@nice2dev/ui-security 1.1.10 → 1.2.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +173 -0
- package/README.md +0 -6
- package/dist/components/NiceMfaSelector.d.ts +1 -1
- package/dist/components/NiceSecurityAuditLog.d.ts +1 -1
- package/dist/components/NiceSessionManager.d.ts +1 -1
- package/dist/index.cjs +8 -8
- package/dist/index.mjs +384 -381
- package/dist/ui-security.css +1 -1
- package/package.json +3 -1
package/dist/index.mjs
CHANGED
|
@@ -1,11 +1,12 @@
|
|
|
1
1
|
import { jsx as c, jsxs as P, Fragment as Pe } from "react/jsx-runtime";
|
|
2
|
-
import { useContext as Ee, createContext as Fe, useRef as ee, useState as
|
|
3
|
-
|
|
2
|
+
import { useContext as Ee, createContext as Fe, useRef as ee, useState as _, useCallback as G, useEffect as ne, useMemo as ae } from "react";
|
|
3
|
+
import { NtdBackspace as ze, NtdArrowLeft as Ne, NtdArrowRight as Le } from "@nice2dev/icons";
|
|
4
|
+
const $e = {
|
|
4
5
|
low: 0.7,
|
|
5
6
|
medium: 0.8,
|
|
6
7
|
high: 0.85,
|
|
7
8
|
critical: 0.95
|
|
8
|
-
},
|
|
9
|
+
}, _e = {
|
|
9
10
|
matchThreshold: 0.85,
|
|
10
11
|
timeout: 3e4,
|
|
11
12
|
maxRetries: 3,
|
|
@@ -19,8 +20,8 @@ const ze = {
|
|
|
19
20
|
antiSpoofing: !0
|
|
20
21
|
};
|
|
21
22
|
function fe(e) {
|
|
22
|
-
const t = { ...
|
|
23
|
-
return e != null && e.matchThreshold || (t.matchThreshold =
|
|
23
|
+
const t = { ..._e, ...e };
|
|
24
|
+
return e != null && e.matchThreshold || (t.matchThreshold = $e[t.securityLevel]), t;
|
|
24
25
|
}
|
|
25
26
|
async function ue(e) {
|
|
26
27
|
const t = new TextEncoder().encode(e), r = await crypto.subtle.digest("SHA-256", t);
|
|
@@ -30,11 +31,11 @@ function ye(e = 8) {
|
|
|
30
31
|
const t = new Uint8Array(e);
|
|
31
32
|
return crypto.getRandomValues(t), Array.from(t).map((r) => r.toString(36).padStart(2, "0")).join("").slice(0, e);
|
|
32
33
|
}
|
|
33
|
-
function
|
|
34
|
+
function je(e) {
|
|
34
35
|
const t = new Uint32Array(1);
|
|
35
36
|
return crypto.getRandomValues(t), t[0] % e;
|
|
36
37
|
}
|
|
37
|
-
function
|
|
38
|
+
function Be(e, t) {
|
|
38
39
|
return Math.sqrt((e.x - t.x) ** 2 + (e.y - t.y) ** 2);
|
|
39
40
|
}
|
|
40
41
|
async function pe(e = "user") {
|
|
@@ -71,7 +72,7 @@ function Ae(e, t, r) {
|
|
|
71
72
|
}
|
|
72
73
|
return n;
|
|
73
74
|
}
|
|
74
|
-
function
|
|
75
|
+
function We(e, t, r) {
|
|
75
76
|
const n = new Uint8Array(t * r);
|
|
76
77
|
for (let s = 1; s < r - 1; s++)
|
|
77
78
|
for (let i = 1; i < t - 1; i++) {
|
|
@@ -80,7 +81,7 @@ function je(e, t, r) {
|
|
|
80
81
|
}
|
|
81
82
|
return n;
|
|
82
83
|
}
|
|
83
|
-
function
|
|
84
|
+
function Oe(e) {
|
|
84
85
|
const t = new Array(256).fill(0);
|
|
85
86
|
for (const v of e)
|
|
86
87
|
t[v]++;
|
|
@@ -104,9 +105,9 @@ function Be(e) {
|
|
|
104
105
|
g[v] = e[v] > a ? 255 : 0;
|
|
105
106
|
return { threshold: a, binary: g };
|
|
106
107
|
}
|
|
107
|
-
function
|
|
108
|
+
function Ue(e, t = 0.3) {
|
|
108
109
|
var p;
|
|
109
|
-
const r = e.width, n = e.height, s = ce(e), i = Ae(s, r, n), o =
|
|
110
|
+
const r = e.width, n = e.height, s = ce(e), i = Ae(s, r, n), o = We(i, r, n), { binary: a } = Oe(o), g = [], v = [], f = [];
|
|
110
111
|
for (let S = 2; S < n - 2; S++)
|
|
111
112
|
for (let u = 2; u < r - 2; u++) {
|
|
112
113
|
if (a[S * r + u] === 0)
|
|
@@ -122,23 +123,23 @@ function _e(e, t = 0.3) {
|
|
|
122
123
|
a[(S - 1) * r + (u - 1)]
|
|
123
124
|
];
|
|
124
125
|
let l = 0;
|
|
125
|
-
for (let
|
|
126
|
-
const
|
|
127
|
-
l += Math.abs(
|
|
126
|
+
for (let B = 0; B < 8; B++) {
|
|
127
|
+
const U = w[B] > 0 ? 1 : 0, J = w[(B + 1) % 8] > 0 ? 1 : 0;
|
|
128
|
+
l += Math.abs(U - J);
|
|
128
129
|
}
|
|
129
130
|
l /= 2;
|
|
130
131
|
let h = 0, L = 0;
|
|
131
|
-
for (let
|
|
132
|
-
for (let
|
|
133
|
-
h += o[(S +
|
|
132
|
+
for (let B = -2; B <= 2; B++)
|
|
133
|
+
for (let U = -2; U <= 2; U++)
|
|
134
|
+
h += o[(S + B) * r + (u + U)], L++;
|
|
134
135
|
const q = h / L / 255;
|
|
135
136
|
if (q < t)
|
|
136
137
|
continue;
|
|
137
|
-
const
|
|
138
|
+
const Y = Math.atan2(
|
|
138
139
|
s[(S + 1) * r + u] - s[(S - 1) * r + u],
|
|
139
140
|
s[S * r + (u + 1)] - s[S * r + (u - 1)]
|
|
140
141
|
);
|
|
141
|
-
l === 1 ? g.push({ x: u / r, y: S / n, angle:
|
|
142
|
+
l === 1 ? g.push({ x: u / r, y: S / n, angle: Y, type: "ending", quality: q }) : l === 3 && g.push({ x: u / r, y: S / n, angle: Y, type: "bifurcation", quality: q });
|
|
142
143
|
}
|
|
143
144
|
g.sort((S, u) => u.quality - S.quality);
|
|
144
145
|
const m = g.slice(0, 120);
|
|
@@ -146,9 +147,9 @@ function _e(e, t = 0.3) {
|
|
|
146
147
|
const S = m.reduce((w, l) => w + l.x, 0) / m.length, u = m.reduce((w, l) => w + l.y, 0) / m.length;
|
|
147
148
|
v.push({ x: S, y: u });
|
|
148
149
|
}
|
|
149
|
-
const k = m.length, y = m.filter((S) => S.type === "ending").length,
|
|
150
|
+
const k = m.length, y = m.filter((S) => S.type === "ending").length, M = m.filter((S) => S.type === "bifurcation").length / (y + 1);
|
|
150
151
|
let b = "loop-right";
|
|
151
|
-
|
|
152
|
+
M > 1.5 ? b = "whorl" : M < 0.5 ? b = "arch" : ((p = v[0]) == null ? void 0 : p.x) < 0.45 && (b = "loop-left");
|
|
152
153
|
const T = m.length > 20 ? m.reduce((S, u) => S + u.quality, 0) / m.length : 0;
|
|
153
154
|
return {
|
|
154
155
|
minutiae: m,
|
|
@@ -159,7 +160,7 @@ function _e(e, t = 0.3) {
|
|
|
159
160
|
quality: T
|
|
160
161
|
};
|
|
161
162
|
}
|
|
162
|
-
function
|
|
163
|
+
function He(e, t) {
|
|
163
164
|
if (e.minutiae.length < 5 || t.minutiae.length < 5)
|
|
164
165
|
return 0;
|
|
165
166
|
let r = 0;
|
|
@@ -172,7 +173,7 @@ function We(e, t) {
|
|
|
172
173
|
const m = t.minutiae[f];
|
|
173
174
|
if (a.type !== m.type)
|
|
174
175
|
continue;
|
|
175
|
-
const k =
|
|
176
|
+
const k = Be(a, m), y = Math.abs(a.angle - m.angle);
|
|
176
177
|
k < n && y < s && k < g && (g = k, v = f);
|
|
177
178
|
}
|
|
178
179
|
v >= 0 && (r++, i.add(v));
|
|
@@ -180,7 +181,7 @@ function We(e, t) {
|
|
|
180
181
|
const o = Math.min(e.minutiae.length, t.minutiae.length);
|
|
181
182
|
return o > 0 ? r / o : 0;
|
|
182
183
|
}
|
|
183
|
-
async function
|
|
184
|
+
async function qe(e, t) {
|
|
184
185
|
const r = JSON.stringify(e), n = await ue(r);
|
|
185
186
|
return {
|
|
186
187
|
id: `fp_${Date.now()}_${ye()}`,
|
|
@@ -191,22 +192,22 @@ async function Ue(e, t) {
|
|
|
191
192
|
hash: n
|
|
192
193
|
};
|
|
193
194
|
}
|
|
194
|
-
function
|
|
195
|
+
function Ke(e) {
|
|
195
196
|
return JSON.parse(atob(e.templateData));
|
|
196
197
|
}
|
|
197
|
-
function
|
|
198
|
+
function Ge(e, t = "left") {
|
|
198
199
|
const r = e.width, n = e.height, s = ce(e), i = Ae(s, r, n);
|
|
199
200
|
let o = { cx: r / 2, cy: n / 2, r: Math.min(r, n) * 0.08, score: 1 / 0 };
|
|
200
201
|
for (let D = Math.round(n * 0.3); D < Math.round(n * 0.7); D += 2)
|
|
201
|
-
for (let
|
|
202
|
+
for (let M = Math.round(r * 0.3); M < Math.round(r * 0.7); M += 2)
|
|
202
203
|
for (let b = Math.round(Math.min(r, n) * 0.04); b < Math.round(Math.min(r, n) * 0.15); b += 2) {
|
|
203
204
|
let T = 0, p = 0;
|
|
204
205
|
for (let l = 0; l < Math.PI * 2; l += 0.3) {
|
|
205
|
-
const h = Math.round(
|
|
206
|
+
const h = Math.round(M + b * Math.cos(l)), L = Math.round(D + b * Math.sin(l));
|
|
206
207
|
h >= 0 && h < r && L >= 0 && L < n && (T += i[L * r + h], p++);
|
|
207
208
|
}
|
|
208
|
-
const S = p > 0 ? T / p : 255, u = i[D * r +
|
|
209
|
-
w < o.score && (o = { cx:
|
|
209
|
+
const S = p > 0 ? T / p : 255, u = i[D * r + M], w = S * 0.5 + u * 0.5;
|
|
210
|
+
w < o.score && (o = { cx: M, cy: D, r: b, score: w });
|
|
210
211
|
}
|
|
211
212
|
const a = o.r * 3, g = {
|
|
212
213
|
cx: o.cx,
|
|
@@ -214,9 +215,9 @@ function Oe(e, t = "left") {
|
|
|
214
215
|
r: Math.min(a, Math.min(r, n) * 0.4)
|
|
215
216
|
}, v = 256, f = [];
|
|
216
217
|
for (let D = 0; D < v; D++) {
|
|
217
|
-
const
|
|
218
|
+
const M = D / v * Math.PI * 2, b = o.r + (g.r - o.r) * 0.5, T = Math.round(o.cx + b * Math.cos(M)), p = Math.round(o.cy + b * Math.sin(M));
|
|
218
219
|
if (T >= 0 && T < r && p >= 0 && p < n) {
|
|
219
|
-
const S = Math.round(o.cx + b * Math.cos(
|
|
220
|
+
const S = Math.round(o.cx + b * Math.cos(M + 0.1)), u = Math.round(o.cy + b * Math.sin(M + 0.1)), w = i[p * r + T], l = S >= 0 && S < r && u >= 0 && u < n ? i[u * r + S] : w;
|
|
220
221
|
f.push(w > l ? 1 : 0);
|
|
221
222
|
} else
|
|
222
223
|
f.push(0);
|
|
@@ -230,7 +231,7 @@ function Oe(e, t = "left") {
|
|
|
230
231
|
eye: t
|
|
231
232
|
};
|
|
232
233
|
}
|
|
233
|
-
function
|
|
234
|
+
function Je(e, t) {
|
|
234
235
|
if (!e.irisCode || !t.irisCode)
|
|
235
236
|
return 0;
|
|
236
237
|
const r = Math.min(e.irisCode.length, t.irisCode.length);
|
|
@@ -249,7 +250,7 @@ function qe(e, t) {
|
|
|
249
250
|
const i = n / r;
|
|
250
251
|
return Math.max(0, 1 - i * 2.5);
|
|
251
252
|
}
|
|
252
|
-
async function
|
|
253
|
+
async function Ye(e, t) {
|
|
253
254
|
const r = JSON.stringify(e), n = await ue(r);
|
|
254
255
|
return {
|
|
255
256
|
id: `iris_${Date.now()}_${ye()}`,
|
|
@@ -260,14 +261,14 @@ async function Ke(e, t) {
|
|
|
260
261
|
hash: n
|
|
261
262
|
};
|
|
262
263
|
}
|
|
263
|
-
function
|
|
264
|
+
function Ze(e) {
|
|
264
265
|
return JSON.parse(atob(e.templateData));
|
|
265
266
|
}
|
|
266
267
|
function he(e) {
|
|
267
268
|
const t = e.width, r = e.height, n = e.data, s = new Uint8Array(t * r);
|
|
268
269
|
for (let u = 0; u < t * r; u++) {
|
|
269
|
-
const w = u * 4, l = n[w], h = n[w + 1], L = n[w + 2], q = 0.299 * l + 0.587 * h + 0.114 * L,
|
|
270
|
-
|
|
270
|
+
const w = u * 4, l = n[w], h = n[w + 1], L = n[w + 2], q = 0.299 * l + 0.587 * h + 0.114 * L, Y = 128 - 0.169 * l - 0.331 * h + 0.5 * L, B = 128 + 0.5 * l - 0.419 * h - 0.081 * L;
|
|
271
|
+
Y >= 77 && Y <= 127 && B >= 133 && B <= 173 && q > 80 && (s[u] = 1);
|
|
271
272
|
}
|
|
272
273
|
let i = t, o = r, a = 0, g = 0, v = 0;
|
|
273
274
|
for (let u = 0; u < r; u++)
|
|
@@ -276,10 +277,10 @@ function he(e) {
|
|
|
276
277
|
const f = a - i, m = g - o;
|
|
277
278
|
if (f < t * 0.1 || m < r * 0.1)
|
|
278
279
|
return null;
|
|
279
|
-
const k = { x: i, y: o, width: f, height: m }, y = [], D = ce(e),
|
|
280
|
+
const k = { x: i, y: o, width: f, height: m }, y = [], D = ce(e), M = Math.max(1, Math.floor(f / 8)), b = Math.max(1, Math.floor(m / 16));
|
|
280
281
|
for (let u = 0; u < 16; u++)
|
|
281
282
|
for (let w = 0; w < 8; w++) {
|
|
282
|
-
const l = i + w *
|
|
283
|
+
const l = i + w * M + Math.floor(M / 2), h = o + u * b + Math.floor(b / 2);
|
|
283
284
|
l < t && h < r ? y.push(D[h * t + l] / 255) : y.push(0);
|
|
284
285
|
}
|
|
285
286
|
const T = [], p = { x: i + f / 2, y: o + m / 2 };
|
|
@@ -308,11 +309,11 @@ function Te(e, t) {
|
|
|
308
309
|
const i = Math.sqrt(n) * Math.sqrt(s);
|
|
309
310
|
return i > 0 ? (r / i + 1) / 2 : 0;
|
|
310
311
|
}
|
|
311
|
-
function
|
|
312
|
+
function Xe(e, t) {
|
|
312
313
|
const r = he(e), n = he(t);
|
|
313
314
|
return !r || !n ? { similarity: 0, cameraFeatures: r, refFeatures: n } : { similarity: Te(r, n), cameraFeatures: r, refFeatures: n };
|
|
314
315
|
}
|
|
315
|
-
async function
|
|
316
|
+
async function Qe(e, t) {
|
|
316
317
|
const r = JSON.stringify(e), n = await ue(r);
|
|
317
318
|
return {
|
|
318
319
|
id: `face_${Date.now()}_${ye()}`,
|
|
@@ -323,10 +324,10 @@ async function Ze(e, t) {
|
|
|
323
324
|
hash: n
|
|
324
325
|
};
|
|
325
326
|
}
|
|
326
|
-
function
|
|
327
|
+
function Ve(e) {
|
|
327
328
|
return JSON.parse(atob(e.templateData));
|
|
328
329
|
}
|
|
329
|
-
function
|
|
330
|
+
function Ft() {
|
|
330
331
|
const e = [
|
|
331
332
|
"blink",
|
|
332
333
|
"smile",
|
|
@@ -334,7 +335,7 @@ function It() {
|
|
|
334
335
|
"turn-right",
|
|
335
336
|
"nod",
|
|
336
337
|
"raise-eyebrows"
|
|
337
|
-
], t = e[
|
|
338
|
+
], t = e[je(e.length)];
|
|
338
339
|
return { type: t, instruction: {
|
|
339
340
|
blink: "Please blink your eyes",
|
|
340
341
|
smile: "Please smile",
|
|
@@ -376,7 +377,7 @@ async function de() {
|
|
|
376
377
|
function Ce() {
|
|
377
378
|
return typeof window < "u" && !!window.PublicKeyCredential;
|
|
378
379
|
}
|
|
379
|
-
async function
|
|
380
|
+
async function et() {
|
|
380
381
|
if (!Ce())
|
|
381
382
|
return !1;
|
|
382
383
|
try {
|
|
@@ -385,7 +386,7 @@ async function Xe() {
|
|
|
385
386
|
return !1;
|
|
386
387
|
}
|
|
387
388
|
}
|
|
388
|
-
async function
|
|
389
|
+
async function tt(e) {
|
|
389
390
|
const t = {
|
|
390
391
|
rp: { name: e.rpName, id: e.rpId },
|
|
391
392
|
user: {
|
|
@@ -410,7 +411,7 @@ async function Qe(e) {
|
|
|
410
411
|
};
|
|
411
412
|
return await navigator.credentials.create({ publicKey: t });
|
|
412
413
|
}
|
|
413
|
-
async function
|
|
414
|
+
async function rt(e) {
|
|
414
415
|
const t = {
|
|
415
416
|
rpId: e.rpId,
|
|
416
417
|
challenge: e.challenge,
|
|
@@ -441,11 +442,11 @@ function re(e, t) {
|
|
|
441
442
|
const s = typeof Element < "u" && t instanceof Element && t.isConnected ? t : document.documentElement, i = getComputedStyle(s).getPropertyValue(r[1]).trim();
|
|
442
443
|
return i || (n ? re(n, t) : e);
|
|
443
444
|
}
|
|
444
|
-
const
|
|
445
|
+
const nt = (e, t) => t, Me = /* @__PURE__ */ Fe(nt), zt = ({ t: e, children: t }) => /* @__PURE__ */ c(Me.Provider, { value: e, children: t });
|
|
445
446
|
function te() {
|
|
446
|
-
return { t: Ee(
|
|
447
|
+
return { t: Ee(Me) };
|
|
447
448
|
}
|
|
448
|
-
const
|
|
449
|
+
const it = { sm: 200, md: 280, lg: 380 }, Nt = (e) => {
|
|
449
450
|
const {
|
|
450
451
|
mode: t,
|
|
451
452
|
enrolledTemplates: r = [],
|
|
@@ -461,8 +462,8 @@ const tt = { sm: 200, md: 280, lg: 380 }, Ct = (e) => {
|
|
|
461
462
|
showMinutiae: k = !1,
|
|
462
463
|
instructionText: y,
|
|
463
464
|
cameraFacing: D = "environment",
|
|
464
|
-
...
|
|
465
|
-
} = e, { t: b } = te(), T = fe(
|
|
465
|
+
...M
|
|
466
|
+
} = e, { t: b } = te(), T = fe(M), p = it[v], S = ee(null), u = ee(null), w = ee(null), [l, h] = _("idle"), [L, q] = _(0), [Y, B] = _(null), [U, J] = _(0), [W, $] = _(""), j = G(
|
|
466
467
|
(E) => {
|
|
467
468
|
h(E), o == null || o(E);
|
|
468
469
|
},
|
|
@@ -470,33 +471,33 @@ const tt = { sm: 200, md: 280, lg: 380 }, Ct = (e) => {
|
|
|
470
471
|
), F = G(async () => {
|
|
471
472
|
try {
|
|
472
473
|
const E = await pe(D);
|
|
473
|
-
w.current = E, S.current && (S.current.srcObject = E, await S.current.play()),
|
|
474
|
+
w.current = E, S.current && (S.current.srcObject = E, await S.current.play()), j("idle"), $(b("security.fingerprint.placeFingerPrompt", "Place your finger on the scanner"));
|
|
474
475
|
} catch (E) {
|
|
475
|
-
a == null || a(E instanceof Error ? E : new Error(String(E))), $(b("security.fingerprint.cameraError", "Camera access denied")),
|
|
476
|
+
a == null || a(E instanceof Error ? E : new Error(String(E))), $(b("security.fingerprint.cameraError", "Camera access denied")), j("error");
|
|
476
477
|
}
|
|
477
|
-
}, [D, b,
|
|
478
|
+
}, [D, b, j, a]), K = G(() => {
|
|
478
479
|
var E;
|
|
479
480
|
(E = w.current) == null || E.getTracks().forEach((C) => C.stop()), w.current = null;
|
|
480
481
|
}, []);
|
|
481
482
|
ne(() => (F(), K), [F, K]);
|
|
482
|
-
const
|
|
483
|
+
const O = G(async () => {
|
|
483
484
|
if (!(!S.current || l === "processing" || l === "success")) {
|
|
484
|
-
|
|
485
|
+
j("scanning"), $(b("security.fingerprint.scanning", "Scanning…"));
|
|
485
486
|
try {
|
|
486
487
|
const { imageData: E } = le(S.current);
|
|
487
|
-
|
|
488
|
-
const C =
|
|
489
|
-
if (
|
|
490
|
-
$(b("security.fingerprint.lowQuality", "Low quality — try again")),
|
|
488
|
+
j("processing"), $(b("security.fingerprint.processing", "Processing fingerprint…"));
|
|
489
|
+
const C = Ue(E);
|
|
490
|
+
if (B(C), q(C.quality), C.quality < 0.2) {
|
|
491
|
+
$(b("security.fingerprint.lowQuality", "Low quality — try again")), j("idle");
|
|
491
492
|
return;
|
|
492
493
|
}
|
|
493
494
|
if (t === "enroll") {
|
|
494
|
-
const z = await
|
|
495
|
-
s == null || s(z, C), $(b("security.fingerprint.enrolled", "Fingerprint enrolled successfully")),
|
|
495
|
+
const z = await qe(C, f ?? n);
|
|
496
|
+
s == null || s(z, C), $(b("security.fingerprint.enrolled", "Fingerprint enrolled successfully")), j("success");
|
|
496
497
|
} else {
|
|
497
498
|
let z = 0;
|
|
498
499
|
for (const d of r) {
|
|
499
|
-
const A =
|
|
500
|
+
const A = Ke(d), N = He(C, A);
|
|
500
501
|
N > z && (z = N);
|
|
501
502
|
}
|
|
502
503
|
const I = z >= T.matchThreshold, x = {
|
|
@@ -520,10 +521,10 @@ const tt = { sm: 200, md: 280, lg: 380 }, Ct = (e) => {
|
|
|
520
521
|
);
|
|
521
522
|
x.success = A.verified;
|
|
522
523
|
}
|
|
523
|
-
x.success ? ($(b("security.fingerprint.verified", "Fingerprint verified")),
|
|
524
|
+
x.success ? ($(b("security.fingerprint.verified", "Fingerprint verified")), j("success")) : (J((d) => d + 1), U + 1 >= T.maxRetries ? ($(b("security.fingerprint.maxAttempts", "Maximum attempts reached")), j("failure")) : ($(b("security.fingerprint.noMatch", "No match — try again")), j("idle"))), i == null || i(x);
|
|
524
525
|
}
|
|
525
526
|
} catch (E) {
|
|
526
|
-
a == null || a(E instanceof Error ? E : new Error(String(E))), $(b("security.fingerprint.error", "Scan error — try again")),
|
|
527
|
+
a == null || a(E instanceof Error ? E : new Error(String(E))), $(b("security.fingerprint.error", "Scan error — try again")), j("error");
|
|
527
528
|
}
|
|
528
529
|
}
|
|
529
530
|
}, [
|
|
@@ -532,26 +533,26 @@ const tt = { sm: 200, md: 280, lg: 380 }, Ct = (e) => {
|
|
|
532
533
|
r,
|
|
533
534
|
T,
|
|
534
535
|
b,
|
|
535
|
-
|
|
536
|
+
j,
|
|
536
537
|
s,
|
|
537
538
|
i,
|
|
538
539
|
a,
|
|
539
540
|
f,
|
|
540
541
|
n,
|
|
541
|
-
|
|
542
|
+
U
|
|
542
543
|
]);
|
|
543
544
|
ne(() => {
|
|
544
|
-
if (!k || !
|
|
545
|
+
if (!k || !Y || !u.current)
|
|
545
546
|
return;
|
|
546
547
|
const E = u.current.getContext("2d");
|
|
547
548
|
if (!E)
|
|
548
549
|
return;
|
|
549
550
|
E.clearRect(0, 0, p, p);
|
|
550
551
|
const C = re("var(--nice-success, #10b981)", E.canvas), z = re("var(--nice-warning, #f59e0b)", E.canvas);
|
|
551
|
-
|
|
552
|
+
Y.minutiae.forEach((I) => {
|
|
552
553
|
E.beginPath(), E.arc(I.x * p, I.y * p, 2, 0, Math.PI * 2), E.fillStyle = I.type === "ending" ? C : z, E.fill(), E.beginPath(), E.moveTo(I.x * p, I.y * p), E.lineTo(I.x * p + Math.cos(I.angle) * 8, I.y * p + Math.sin(I.angle) * 8), E.strokeStyle = E.fillStyle, E.lineWidth = 1, E.stroke();
|
|
553
554
|
});
|
|
554
|
-
}, [
|
|
555
|
+
}, [Y, k, p]);
|
|
555
556
|
const Q = l === "success" ? "var(--security-success)" : l === "failure" || l === "error" ? "var(--security-error)" : l === "scanning" || l === "processing" ? "var(--security-biometric)" : "var(--security-border)";
|
|
556
557
|
return /* @__PURE__ */ P(
|
|
557
558
|
"div",
|
|
@@ -701,14 +702,14 @@ const tt = { sm: 200, md: 280, lg: 380 }, Ct = (e) => {
|
|
|
701
702
|
l !== "success" && l !== "failure" && /* @__PURE__ */ c(
|
|
702
703
|
"button",
|
|
703
704
|
{
|
|
704
|
-
onClick:
|
|
705
|
+
onClick: O,
|
|
705
706
|
disabled: l === "scanning" || l === "processing",
|
|
706
707
|
style: {
|
|
707
708
|
padding: "10px 24px",
|
|
708
709
|
fontSize: 14,
|
|
709
710
|
fontWeight: 600,
|
|
710
711
|
background: "var(--security-biometric)",
|
|
711
|
-
color: "var(--nice-
|
|
712
|
+
color: "var(--nice-color-white, #fff)",
|
|
712
713
|
border: "none",
|
|
713
714
|
borderRadius: "var(--security-radius)",
|
|
714
715
|
cursor: "pointer",
|
|
@@ -721,7 +722,7 @@ const tt = { sm: 200, md: 280, lg: 380 }, Ct = (e) => {
|
|
|
721
722
|
"button",
|
|
722
723
|
{
|
|
723
724
|
onClick: () => {
|
|
724
|
-
J(0),
|
|
725
|
+
J(0), j("idle"), $("");
|
|
725
726
|
},
|
|
726
727
|
style: {
|
|
727
728
|
padding: "8px 20px",
|
|
@@ -739,7 +740,7 @@ const tt = { sm: 200, md: 280, lg: 380 }, Ct = (e) => {
|
|
|
739
740
|
]
|
|
740
741
|
}
|
|
741
742
|
);
|
|
742
|
-
},
|
|
743
|
+
}, st = { sm: 220, md: 300, lg: 400 }, Lt = (e) => {
|
|
743
744
|
const {
|
|
744
745
|
mode: t,
|
|
745
746
|
enrolledTemplates: r = [],
|
|
@@ -755,8 +756,8 @@ const tt = { sm: 200, md: 280, lg: 380 }, Ct = (e) => {
|
|
|
755
756
|
showSegmentation: k = !0,
|
|
756
757
|
showGuide: y = !0,
|
|
757
758
|
instructionText: D,
|
|
758
|
-
...
|
|
759
|
-
} = e, { t: b } = te(), T = fe(
|
|
759
|
+
...M
|
|
760
|
+
} = e, { t: b } = te(), T = fe(M), p = st[v], S = ee(null), u = ee(null), w = ee(null), l = ee([]), [h, L] = _("idle"), [q, Y] = _(0), [B, U] = _(null), [J, W] = _(0), [$, j] = _(""), F = G(
|
|
760
761
|
(C) => {
|
|
761
762
|
L(C), o == null || o(C);
|
|
762
763
|
},
|
|
@@ -764,18 +765,18 @@ const tt = { sm: 200, md: 280, lg: 380 }, Ct = (e) => {
|
|
|
764
765
|
), K = G(async () => {
|
|
765
766
|
try {
|
|
766
767
|
const C = await pe("user");
|
|
767
|
-
w.current = C, S.current && (S.current.srcObject = C, await S.current.play()), F("idle"),
|
|
768
|
+
w.current = C, S.current && (S.current.srcObject = C, await S.current.play()), F("idle"), j(b("security.iris.alignEyePrompt", "Align your eye with the circle"));
|
|
768
769
|
} catch (C) {
|
|
769
|
-
a == null || a(C instanceof Error ? C : new Error(String(C))),
|
|
770
|
+
a == null || a(C instanceof Error ? C : new Error(String(C))), j(b("security.iris.cameraError", "Camera access denied")), F("error");
|
|
770
771
|
}
|
|
771
|
-
}, [b, F, a]),
|
|
772
|
+
}, [b, F, a]), O = G(() => {
|
|
772
773
|
var C;
|
|
773
774
|
(C = w.current) == null || C.getTracks().forEach((z) => z.stop()), w.current = null;
|
|
774
775
|
}, []);
|
|
775
|
-
ne(() => (K(),
|
|
776
|
+
ne(() => (K(), O), [K, O]);
|
|
776
777
|
const Q = G(async () => {
|
|
777
778
|
if (!(!S.current || h === "processing" || h === "success")) {
|
|
778
|
-
F("scanning"),
|
|
779
|
+
F("scanning"), j(b("security.iris.scanning", "Scanning iris…"));
|
|
779
780
|
try {
|
|
780
781
|
const C = [];
|
|
781
782
|
for (let x = 0; x < 5; x++) {
|
|
@@ -783,19 +784,19 @@ const tt = { sm: 200, md: 280, lg: 380 }, Ct = (e) => {
|
|
|
783
784
|
C.push(d), await new Promise((A) => setTimeout(A, 200));
|
|
784
785
|
}
|
|
785
786
|
if (l.current = C, T.livenessDetection && !Ie(C).isLive) {
|
|
786
|
-
|
|
787
|
+
j(
|
|
787
788
|
b("security.iris.notLive", "Liveness check failed — please blink or move slightly")
|
|
788
789
|
), F("idle");
|
|
789
790
|
return;
|
|
790
791
|
}
|
|
791
|
-
F("processing"),
|
|
792
|
-
const z = C[C.length - 1], I =
|
|
792
|
+
F("processing"), j(b("security.iris.processing", "Processing iris pattern…"));
|
|
793
|
+
const z = C[C.length - 1], I = Ge(z, n === "both" ? "left" : n);
|
|
793
794
|
if (!I) {
|
|
794
|
-
|
|
795
|
+
j(b("security.iris.noIrisDetected", "No iris detected — adjust position")), F("idle");
|
|
795
796
|
return;
|
|
796
797
|
}
|
|
797
|
-
if (
|
|
798
|
-
|
|
798
|
+
if (U(I), Y(I.quality), I.quality < 0.1) {
|
|
799
|
+
j(b("security.iris.lowQuality", "Low quality — move closer")), F("idle");
|
|
799
800
|
return;
|
|
800
801
|
}
|
|
801
802
|
if (k && u.current) {
|
|
@@ -819,13 +820,13 @@ const tt = { sm: 200, md: 280, lg: 380 }, Ct = (e) => {
|
|
|
819
820
|
}
|
|
820
821
|
}
|
|
821
822
|
if (t === "enroll") {
|
|
822
|
-
const x = await
|
|
823
|
-
s == null || s(x, I),
|
|
823
|
+
const x = await Ye(I, f ?? `${n} eye`);
|
|
824
|
+
s == null || s(x, I), j(b("security.iris.enrolled", "Iris enrolled successfully")), F("success");
|
|
824
825
|
} else {
|
|
825
826
|
let x = 0;
|
|
826
827
|
for (const N of r) {
|
|
827
|
-
const
|
|
828
|
-
|
|
828
|
+
const R = Ze(N), H = Je(I, R);
|
|
829
|
+
H > x && (x = H);
|
|
829
830
|
}
|
|
830
831
|
const d = x >= T.matchThreshold, A = {
|
|
831
832
|
success: d,
|
|
@@ -837,7 +838,7 @@ const tt = { sm: 200, md: 280, lg: 380 }, Ct = (e) => {
|
|
|
837
838
|
payload: btoa(JSON.stringify(I))
|
|
838
839
|
};
|
|
839
840
|
if (d && T.verifyEndpoint) {
|
|
840
|
-
const N = await de(),
|
|
841
|
+
const N = await de(), R = await ge(
|
|
841
842
|
T.verifyEndpoint,
|
|
842
843
|
{
|
|
843
844
|
method: "iris",
|
|
@@ -847,12 +848,12 @@ const tt = { sm: 200, md: 280, lg: 380 }, Ct = (e) => {
|
|
|
847
848
|
},
|
|
848
849
|
T.authToken
|
|
849
850
|
);
|
|
850
|
-
A.success =
|
|
851
|
+
A.success = R.verified;
|
|
851
852
|
}
|
|
852
|
-
A.success ? (
|
|
853
|
+
A.success ? (j(b("security.iris.verified", "Iris verified")), F("success")) : (W((N) => N + 1), J + 1 >= T.maxRetries ? (j(b("security.iris.maxAttempts", "Maximum attempts reached")), F("failure")) : (j(b("security.iris.noMatch", "No match — try again")), F("idle"))), i == null || i(A);
|
|
853
854
|
}
|
|
854
855
|
} catch (C) {
|
|
855
|
-
a == null || a(C instanceof Error ? C : new Error(String(C))),
|
|
856
|
+
a == null || a(C instanceof Error ? C : new Error(String(C))), j(b("security.iris.error", "Scan error")), F("error");
|
|
856
857
|
}
|
|
857
858
|
}
|
|
858
859
|
}, [
|
|
@@ -1040,7 +1041,7 @@ const tt = { sm: 200, md: 280, lg: 380 }, Ct = (e) => {
|
|
|
1040
1041
|
fontSize: 14,
|
|
1041
1042
|
fontWeight: 600,
|
|
1042
1043
|
background: "var(--security-biometric)",
|
|
1043
|
-
color: "var(--nice-
|
|
1044
|
+
color: "var(--nice-color-white, #fff)",
|
|
1044
1045
|
border: "none",
|
|
1045
1046
|
borderRadius: "var(--security-radius)",
|
|
1046
1047
|
cursor: "pointer",
|
|
@@ -1053,7 +1054,7 @@ const tt = { sm: 200, md: 280, lg: 380 }, Ct = (e) => {
|
|
|
1053
1054
|
"button",
|
|
1054
1055
|
{
|
|
1055
1056
|
onClick: () => {
|
|
1056
|
-
W(0), F("idle"),
|
|
1057
|
+
W(0), F("idle"), j("");
|
|
1057
1058
|
},
|
|
1058
1059
|
style: {
|
|
1059
1060
|
padding: "8px 20px",
|
|
@@ -1076,7 +1077,7 @@ const tt = { sm: 200, md: 280, lg: 380 }, Ct = (e) => {
|
|
|
1076
1077
|
]
|
|
1077
1078
|
}
|
|
1078
1079
|
);
|
|
1079
|
-
},
|
|
1080
|
+
}, ot = { sm: 240, md: 320, lg: 440 }, $t = (e) => {
|
|
1080
1081
|
const {
|
|
1081
1082
|
mode: t,
|
|
1082
1083
|
enrolledTemplates: r = [],
|
|
@@ -1092,9 +1093,9 @@ const tt = { sm: 200, md: 280, lg: 380 }, Ct = (e) => {
|
|
|
1092
1093
|
showBoundingBox: k = !0,
|
|
1093
1094
|
livenessSteps: y = 1,
|
|
1094
1095
|
showReference: D = !0,
|
|
1095
|
-
instructionText:
|
|
1096
|
+
instructionText: M,
|
|
1096
1097
|
...b
|
|
1097
|
-
} = e, { t: T } = te(), p = fe(b), S =
|
|
1098
|
+
} = e, { t: T } = te(), p = fe(b), S = ot[v], u = ee(null), w = ee(null), l = ee(null), [h, L] = _("idle"), [q, Y] = _(0), [B, U] = _(0), [J, W] = _(""), [$, j] = _(null), [F, K] = _(0), O = G(
|
|
1098
1099
|
(x) => {
|
|
1099
1100
|
L(x), o == null || o(x);
|
|
1100
1101
|
},
|
|
@@ -1102,11 +1103,11 @@ const tt = { sm: 200, md: 280, lg: 380 }, Ct = (e) => {
|
|
|
1102
1103
|
), Q = G(async () => {
|
|
1103
1104
|
try {
|
|
1104
1105
|
const x = await pe("user");
|
|
1105
|
-
l.current = x, u.current && (u.current.srcObject = x, await u.current.play()),
|
|
1106
|
+
l.current = x, u.current && (u.current.srcObject = x, await u.current.play()), O("idle"), W(T("security.face.lookAtCamera", "Look at the camera"));
|
|
1106
1107
|
} catch (x) {
|
|
1107
|
-
a == null || a(x instanceof Error ? x : new Error(String(x))), W(T("security.face.cameraError", "Camera access denied")),
|
|
1108
|
+
a == null || a(x instanceof Error ? x : new Error(String(x))), W(T("security.face.cameraError", "Camera access denied")), O("error");
|
|
1108
1109
|
}
|
|
1109
|
-
}, [T,
|
|
1110
|
+
}, [T, O, a]), E = G(() => {
|
|
1110
1111
|
var x;
|
|
1111
1112
|
(x = l.current) == null || x.getTracks().forEach((d) => d.stop()), l.current = null;
|
|
1112
1113
|
}, []);
|
|
@@ -1120,44 +1121,44 @@ const tt = { sm: 200, md: 280, lg: 380 }, Ct = (e) => {
|
|
|
1120
1121
|
const A = w.current.width, N = w.current.height;
|
|
1121
1122
|
if (d.clearRect(0, 0, A, N), !x || !k)
|
|
1122
1123
|
return;
|
|
1123
|
-
const
|
|
1124
|
+
const R = x.boundingBox, H = A / (((ve = u.current) == null ? void 0 : ve.videoWidth) ?? A), Z = N / (((be = u.current) == null ? void 0 : be.videoHeight) ?? N);
|
|
1124
1125
|
d.strokeStyle = re(
|
|
1125
1126
|
h === "success" ? "var(--nice-success, #10b981)" : "var(--nice-primary, #3b82f6)",
|
|
1126
1127
|
d.canvas
|
|
1127
|
-
), d.lineWidth = 2, d.setLineDash([6, 4]), d.strokeRect(
|
|
1128
|
+
), d.lineWidth = 2, d.setLineDash([6, 4]), d.strokeRect(R.x * H, R.y * Z, R.width * H, R.height * Z), d.setLineDash([]);
|
|
1128
1129
|
const V = [
|
|
1129
|
-
[
|
|
1130
|
-
[(
|
|
1131
|
-
[
|
|
1132
|
-
[(
|
|
1130
|
+
[R.x * H, R.y * Z],
|
|
1131
|
+
[(R.x + R.width) * H, R.y * Z],
|
|
1132
|
+
[R.x * H, (R.y + R.height) * Z],
|
|
1133
|
+
[(R.x + R.width) * H, (R.y + R.height) * Z]
|
|
1133
1134
|
], X = 12;
|
|
1134
1135
|
d.lineWidth = 3;
|
|
1135
1136
|
for (const [se, oe] of V)
|
|
1136
|
-
d.beginPath(), d.moveTo(se ===
|
|
1137
|
+
d.beginPath(), d.moveTo(se === R.x * H ? se : se - X, oe), d.lineTo(se, oe), d.lineTo(se, oe === R.y * Z ? oe + X : oe - X), d.stroke();
|
|
1137
1138
|
},
|
|
1138
1139
|
[k, h]
|
|
1139
1140
|
), z = G(async () => {
|
|
1140
1141
|
if (!(!u.current || h === "processing" || h === "success")) {
|
|
1141
|
-
|
|
1142
|
+
O("scanning"), W(T("security.face.scanning", "Scanning face…"));
|
|
1142
1143
|
try {
|
|
1143
1144
|
if (p.livenessDetection) {
|
|
1144
1145
|
const A = [];
|
|
1145
|
-
for (let
|
|
1146
|
-
A.push(le(u.current).imageData), await new Promise((
|
|
1146
|
+
for (let R = 0; R < 8; R++)
|
|
1147
|
+
A.push(le(u.current).imageData), await new Promise((H) => setTimeout(H, 200));
|
|
1147
1148
|
if (!Ie(A).isLive) {
|
|
1148
|
-
W(T("security.face.notLive", "Liveness check failed — move naturally")),
|
|
1149
|
+
W(T("security.face.notLive", "Liveness check failed — move naturally")), O("idle");
|
|
1149
1150
|
return;
|
|
1150
1151
|
}
|
|
1151
1152
|
}
|
|
1152
|
-
|
|
1153
|
+
O("processing"), W(T("security.face.processing", "Analysing face…"));
|
|
1153
1154
|
const { imageData: x } = le(u.current);
|
|
1154
1155
|
if (t === "compare" && n) {
|
|
1155
|
-
const A = typeof n == "string" ? await
|
|
1156
|
+
const A = typeof n == "string" ? await at(n) : ct(n), {
|
|
1156
1157
|
similarity: N,
|
|
1157
|
-
cameraFeatures:
|
|
1158
|
-
refFeatures:
|
|
1159
|
-
} =
|
|
1160
|
-
K(N),
|
|
1158
|
+
cameraFeatures: R,
|
|
1159
|
+
refFeatures: H
|
|
1160
|
+
} = Xe(x, A);
|
|
1161
|
+
K(N), Y((R == null ? void 0 : R.quality) ?? 0), C(R);
|
|
1161
1162
|
const V = {
|
|
1162
1163
|
success: N >= p.matchThreshold,
|
|
1163
1164
|
confidence: N,
|
|
@@ -1166,25 +1167,25 @@ const tt = { sm: 200, md: 280, lg: 380 }, Ct = (e) => {
|
|
|
1166
1167
|
duration: 0,
|
|
1167
1168
|
livenessPassed: p.livenessDetection
|
|
1168
1169
|
};
|
|
1169
|
-
V.success ? (W(T("security.face.matchFound", `Match: ${(N * 100).toFixed(0)}%`)),
|
|
1170
|
+
V.success ? (W(T("security.face.matchFound", `Match: ${(N * 100).toFixed(0)}%`)), O("success")) : (U((X) => X + 1), B + 1 >= p.maxRetries ? (W(T("security.face.maxAttempts", "Maximum attempts reached")), O("failure")) : (W(T("security.face.noMatch", "No match — try again")), O("idle"))), i == null || i(V);
|
|
1170
1171
|
return;
|
|
1171
1172
|
}
|
|
1172
1173
|
const d = he(x);
|
|
1173
1174
|
if (!d) {
|
|
1174
|
-
W(T("security.face.noFaceDetected", "No face detected")),
|
|
1175
|
+
W(T("security.face.noFaceDetected", "No face detected")), O("idle");
|
|
1175
1176
|
return;
|
|
1176
1177
|
}
|
|
1177
|
-
if (
|
|
1178
|
-
const A = await
|
|
1179
|
-
s == null || s(A, d), W(T("security.face.enrolled", "Face enrolled successfully")),
|
|
1178
|
+
if (Y(d.quality), C(d), t === "enroll") {
|
|
1179
|
+
const A = await Qe(d, f ?? "face");
|
|
1180
|
+
s == null || s(A, d), W(T("security.face.enrolled", "Face enrolled successfully")), O("success");
|
|
1180
1181
|
} else {
|
|
1181
1182
|
let A = 0;
|
|
1182
|
-
for (const
|
|
1183
|
-
const
|
|
1183
|
+
for (const H of r) {
|
|
1184
|
+
const Z = Ve(H), V = Te(d, Z);
|
|
1184
1185
|
V > A && (A = V);
|
|
1185
1186
|
}
|
|
1186
1187
|
K(A);
|
|
1187
|
-
const N = A >= p.matchThreshold,
|
|
1188
|
+
const N = A >= p.matchThreshold, R = {
|
|
1188
1189
|
success: N,
|
|
1189
1190
|
confidence: A,
|
|
1190
1191
|
method: "face",
|
|
@@ -1193,22 +1194,22 @@ const tt = { sm: 200, md: 280, lg: 380 }, Ct = (e) => {
|
|
|
1193
1194
|
livenessPassed: p.livenessDetection
|
|
1194
1195
|
};
|
|
1195
1196
|
if (N && p.verifyEndpoint) {
|
|
1196
|
-
const
|
|
1197
|
+
const H = await de(), Z = await ge(
|
|
1197
1198
|
p.verifyEndpoint,
|
|
1198
1199
|
{
|
|
1199
1200
|
method: "face",
|
|
1200
1201
|
templateData: btoa(JSON.stringify(d)),
|
|
1201
1202
|
matchScore: A,
|
|
1202
|
-
deviceFingerprint:
|
|
1203
|
+
deviceFingerprint: H
|
|
1203
1204
|
},
|
|
1204
1205
|
p.authToken
|
|
1205
1206
|
);
|
|
1206
|
-
|
|
1207
|
+
R.success = Z.verified;
|
|
1207
1208
|
}
|
|
1208
|
-
|
|
1209
|
+
R.success ? (W(T("security.face.verified", "Face verified")), O("success")) : (U((H) => H + 1), B + 1 >= p.maxRetries ? (W(T("security.face.maxAttempts", "Maximum attempts reached")), O("failure")) : (W(T("security.face.noMatch", "No match — try again")), O("idle"))), i == null || i(R);
|
|
1209
1210
|
}
|
|
1210
1211
|
} catch (x) {
|
|
1211
|
-
a == null || a(x instanceof Error ? x : new Error(String(x))), W(T("security.face.error", "Error — try again")),
|
|
1212
|
+
a == null || a(x instanceof Error ? x : new Error(String(x))), W(T("security.face.error", "Error — try again")), O("error");
|
|
1212
1213
|
}
|
|
1213
1214
|
}
|
|
1214
1215
|
}, [
|
|
@@ -1218,12 +1219,12 @@ const tt = { sm: 200, md: 280, lg: 380 }, Ct = (e) => {
|
|
|
1218
1219
|
n,
|
|
1219
1220
|
p,
|
|
1220
1221
|
T,
|
|
1221
|
-
|
|
1222
|
+
O,
|
|
1222
1223
|
s,
|
|
1223
1224
|
i,
|
|
1224
1225
|
a,
|
|
1225
1226
|
f,
|
|
1226
|
-
|
|
1227
|
+
B,
|
|
1227
1228
|
C
|
|
1228
1229
|
]), I = h === "success" ? "var(--security-success)" : h === "failure" || h === "error" ? "var(--security-error)" : h === "scanning" || h === "processing" ? "var(--security-biometric)" : "var(--security-border)";
|
|
1229
1230
|
return /* @__PURE__ */ P(
|
|
@@ -1418,7 +1419,7 @@ const tt = { sm: 200, md: 280, lg: 380 }, Ct = (e) => {
|
|
|
1418
1419
|
textAlign: "center",
|
|
1419
1420
|
minHeight: 20
|
|
1420
1421
|
},
|
|
1421
|
-
children:
|
|
1422
|
+
children: M ?? J
|
|
1422
1423
|
}
|
|
1423
1424
|
),
|
|
1424
1425
|
h !== "success" && h !== "failure" && /* @__PURE__ */ c(
|
|
@@ -1431,7 +1432,7 @@ const tt = { sm: 200, md: 280, lg: 380 }, Ct = (e) => {
|
|
|
1431
1432
|
fontSize: 14,
|
|
1432
1433
|
fontWeight: 600,
|
|
1433
1434
|
background: "var(--security-biometric)",
|
|
1434
|
-
color: "var(--nice-
|
|
1435
|
+
color: "var(--nice-color-white, #fff)",
|
|
1435
1436
|
border: "none",
|
|
1436
1437
|
borderRadius: "var(--security-radius)",
|
|
1437
1438
|
cursor: "pointer",
|
|
@@ -1444,7 +1445,7 @@ const tt = { sm: 200, md: 280, lg: 380 }, Ct = (e) => {
|
|
|
1444
1445
|
"button",
|
|
1445
1446
|
{
|
|
1446
1447
|
onClick: () => {
|
|
1447
|
-
|
|
1448
|
+
U(0), K(0), O("idle"), W("");
|
|
1448
1449
|
},
|
|
1449
1450
|
style: {
|
|
1450
1451
|
padding: "8px 20px",
|
|
@@ -1463,7 +1464,7 @@ const tt = { sm: 200, md: 280, lg: 380 }, Ct = (e) => {
|
|
|
1463
1464
|
}
|
|
1464
1465
|
);
|
|
1465
1466
|
};
|
|
1466
|
-
async function
|
|
1467
|
+
async function at(e) {
|
|
1467
1468
|
return new Promise((t, r) => {
|
|
1468
1469
|
const n = new Image();
|
|
1469
1470
|
n.crossOrigin = "anonymous", n.onload = () => {
|
|
@@ -1474,19 +1475,19 @@ async function it(e) {
|
|
|
1474
1475
|
}, n.onerror = () => r(new Error("Failed to load reference image")), n.src = e;
|
|
1475
1476
|
});
|
|
1476
1477
|
}
|
|
1477
|
-
function
|
|
1478
|
+
function ct(e) {
|
|
1478
1479
|
const t = document.createElement("canvas");
|
|
1479
1480
|
t.width = e.naturalWidth || e.width, t.height = e.naturalHeight || e.height;
|
|
1480
1481
|
const r = t.getContext("2d");
|
|
1481
1482
|
return r.drawImage(e, 0, 0), r.getImageData(0, 0, t.width, t.height);
|
|
1482
1483
|
}
|
|
1483
|
-
const
|
|
1484
|
+
const lt = 4, ut = 5, dt = 3e4, _t = (e) => {
|
|
1484
1485
|
const {
|
|
1485
|
-
length: t =
|
|
1486
|
+
length: t = lt,
|
|
1486
1487
|
scramble: r = !1,
|
|
1487
1488
|
showDigits: n = !1,
|
|
1488
|
-
maxAttempts: s =
|
|
1489
|
-
lockoutDuration: i =
|
|
1489
|
+
maxAttempts: s = ut,
|
|
1490
|
+
lockoutDuration: i = dt,
|
|
1490
1491
|
keySize: o = 64,
|
|
1491
1492
|
haptic: a = !0,
|
|
1492
1493
|
keyLabels: g,
|
|
@@ -1496,12 +1497,12 @@ const ot = 4, at = 5, ct = 3e4, Pt = (e) => {
|
|
|
1496
1497
|
onComplete: k,
|
|
1497
1498
|
onVerify: y,
|
|
1498
1499
|
onStatusChange: D,
|
|
1499
|
-
onError:
|
|
1500
|
+
onError: M,
|
|
1500
1501
|
showBiometricFallback: b = !1,
|
|
1501
1502
|
onBiometricFallback: T,
|
|
1502
1503
|
label: p,
|
|
1503
1504
|
className: S
|
|
1504
|
-
} = e, { t: u } = te(), [w, l] =
|
|
1505
|
+
} = e, { t: u } = te(), [w, l] = _([]), [h, L] = _("idle"), [q, Y] = _(0), [B, U] = _(0), [J, W] = _(null), $ = ee(void 0), j = ae(() => {
|
|
1505
1506
|
const z = ["1", "2", "3", "4", "5", "6", "7", "8", "9", "", "0", "back"];
|
|
1506
1507
|
if (!r)
|
|
1507
1508
|
return z;
|
|
@@ -1533,18 +1534,18 @@ const ot = 4, at = 5, ct = 3e4, Pt = (e) => {
|
|
|
1533
1534
|
[D]
|
|
1534
1535
|
);
|
|
1535
1536
|
ne(() => {
|
|
1536
|
-
if (!(
|
|
1537
|
+
if (!(B <= Date.now()))
|
|
1537
1538
|
return $.current = setInterval(() => {
|
|
1538
|
-
Date.now() >=
|
|
1539
|
+
Date.now() >= B && (clearInterval($.current), F("idle"), Y(0), l([]));
|
|
1539
1540
|
}, 500), () => clearInterval($.current);
|
|
1540
|
-
}, [
|
|
1541
|
-
const K =
|
|
1541
|
+
}, [B, F]);
|
|
1542
|
+
const K = B > Date.now(), O = G(() => {
|
|
1542
1543
|
a && navigator.vibrate && navigator.vibrate(20);
|
|
1543
1544
|
}, [a]), Q = G(
|
|
1544
1545
|
async (z) => {
|
|
1545
1546
|
if (K || h === "success")
|
|
1546
1547
|
return;
|
|
1547
|
-
if (
|
|
1548
|
+
if (O(), z === "back") {
|
|
1548
1549
|
l((A) => A.slice(0, -1));
|
|
1549
1550
|
return;
|
|
1550
1551
|
}
|
|
@@ -1569,7 +1570,7 @@ const ot = 4, at = 5, ct = 3e4, Pt = (e) => {
|
|
|
1569
1570
|
let d = !1;
|
|
1570
1571
|
if (v) {
|
|
1571
1572
|
const A = new TextEncoder(), N = await crypto.subtle.digest("SHA-256", A.encode(x));
|
|
1572
|
-
d = Array.from(new Uint8Array(N)).map((
|
|
1573
|
+
d = Array.from(new Uint8Array(N)).map((H) => H.toString(16).padStart(2, "0")).join("") === v;
|
|
1573
1574
|
} else if (f)
|
|
1574
1575
|
d = x === f;
|
|
1575
1576
|
else {
|
|
@@ -1586,9 +1587,9 @@ const ot = 4, at = 5, ct = 3e4, Pt = (e) => {
|
|
|
1586
1587
|
}), k == null || k(x);
|
|
1587
1588
|
else {
|
|
1588
1589
|
const A = q + 1;
|
|
1589
|
-
if (
|
|
1590
|
+
if (Y(A), A >= s) {
|
|
1590
1591
|
const N = Date.now() + i;
|
|
1591
|
-
|
|
1592
|
+
U(N), F("failure"), M == null || M(new Error("Too many failed PIN attempts"));
|
|
1592
1593
|
} else
|
|
1593
1594
|
F("failure"), setTimeout(() => {
|
|
1594
1595
|
F("idle"), l([]);
|
|
@@ -1614,13 +1615,13 @@ const ot = 4, at = 5, ct = 3e4, Pt = (e) => {
|
|
|
1614
1615
|
q,
|
|
1615
1616
|
s,
|
|
1616
1617
|
i,
|
|
1617
|
-
|
|
1618
|
+
O,
|
|
1618
1619
|
F,
|
|
1619
1620
|
k,
|
|
1620
1621
|
y,
|
|
1621
|
-
|
|
1622
|
+
M
|
|
1622
1623
|
]
|
|
1623
|
-
), E = Math.max(0, Math.ceil((
|
|
1624
|
+
), E = Math.max(0, Math.ceil((B - Date.now()) / 1e3)), C = h === "success" ? "var(--security-success)" : h === "failure" ? "var(--security-error)" : "var(--security-border)";
|
|
1624
1625
|
return /* @__PURE__ */ P(
|
|
1625
1626
|
"div",
|
|
1626
1627
|
{
|
|
@@ -1671,7 +1672,7 @@ const ot = 4, at = 5, ct = 3e4, Pt = (e) => {
|
|
|
1671
1672
|
opacity: K ? 0.4 : 1,
|
|
1672
1673
|
pointerEvents: K ? "none" : "auto"
|
|
1673
1674
|
},
|
|
1674
|
-
children:
|
|
1675
|
+
children: j.map((z, I) => {
|
|
1675
1676
|
if (z === "")
|
|
1676
1677
|
return /* @__PURE__ */ c("div", {}, I);
|
|
1677
1678
|
const x = z === "back";
|
|
@@ -1706,7 +1707,7 @@ const ot = 4, at = 5, ct = 3e4, Pt = (e) => {
|
|
|
1706
1707
|
onMouseLeave: (d) => {
|
|
1707
1708
|
d.currentTarget.style.transform = "";
|
|
1708
1709
|
},
|
|
1709
|
-
children: x ?
|
|
1710
|
+
children: x ? /* @__PURE__ */ c(ze, { size: 22 }) : (g == null ? void 0 : g[z]) ?? z
|
|
1710
1711
|
},
|
|
1711
1712
|
I
|
|
1712
1713
|
);
|
|
@@ -1748,14 +1749,14 @@ const ot = 4, at = 5, ct = 3e4, Pt = (e) => {
|
|
|
1748
1749
|
]
|
|
1749
1750
|
}
|
|
1750
1751
|
);
|
|
1751
|
-
},
|
|
1752
|
+
}, ht = 3, ft = 4, yt = 5, pt = 14, jt = (e) => {
|
|
1752
1753
|
const {
|
|
1753
|
-
gridSize: t =
|
|
1754
|
-
minLength: r =
|
|
1754
|
+
gridSize: t = ht,
|
|
1755
|
+
minLength: r = ft,
|
|
1755
1756
|
showTrail: n = !0,
|
|
1756
1757
|
showError: s = !0,
|
|
1757
|
-
maxAttempts: i =
|
|
1758
|
-
dotSize: o =
|
|
1758
|
+
maxAttempts: i = yt,
|
|
1759
|
+
dotSize: o = pt,
|
|
1759
1760
|
trailColor: a,
|
|
1760
1761
|
mode: g = "verify",
|
|
1761
1762
|
expectedHash: v,
|
|
@@ -1764,57 +1765,57 @@ const ot = 4, at = 5, ct = 3e4, Pt = (e) => {
|
|
|
1764
1765
|
onVerify: k,
|
|
1765
1766
|
onStatusChange: y,
|
|
1766
1767
|
onError: D,
|
|
1767
|
-
label:
|
|
1768
|
+
label: M,
|
|
1768
1769
|
className: b,
|
|
1769
1770
|
canvasSize: T
|
|
1770
|
-
} = e, { t: p } = te(), S = ee(null), [u, w] =
|
|
1771
|
+
} = e, { t: p } = te(), S = ee(null), [u, w] = _([]), [l, h] = _(!1), [L, q] = _("idle"), [Y, B] = _(0), [U, J] = _(null), [W, $] = _(null), j = T ?? t * 80, F = j / t, K = G(
|
|
1771
1772
|
(d) => {
|
|
1772
1773
|
q(d), y == null || y(d);
|
|
1773
1774
|
},
|
|
1774
1775
|
[y]
|
|
1775
|
-
),
|
|
1776
|
+
), O = G(() => {
|
|
1776
1777
|
const d = [];
|
|
1777
1778
|
for (let A = 0; A < t; A++)
|
|
1778
1779
|
for (let N = 0; N < t; N++)
|
|
1779
1780
|
d.push({ x: N * F + F / 2, y: A * F + F / 2 });
|
|
1780
1781
|
return d;
|
|
1781
1782
|
}, [t, F]), Q = G((d) => {
|
|
1782
|
-
const A = S.current.getBoundingClientRect(), N = "touches" in d ? d.touches[0].clientX : d.clientX,
|
|
1783
|
-
return { x: N - A.left, y:
|
|
1783
|
+
const A = S.current.getBoundingClientRect(), N = "touches" in d ? d.touches[0].clientX : d.clientX, R = "touches" in d ? d.touches[0].clientY : d.clientY;
|
|
1784
|
+
return { x: N - A.left, y: R - A.top };
|
|
1784
1785
|
}, []), E = G(
|
|
1785
1786
|
(d, A) => {
|
|
1786
|
-
const N =
|
|
1787
|
-
for (let
|
|
1788
|
-
const
|
|
1789
|
-
if (
|
|
1790
|
-
return
|
|
1787
|
+
const N = O(), R = F * 0.38;
|
|
1788
|
+
for (let H = 0; H < N.length; H++) {
|
|
1789
|
+
const Z = N[H].x - d, V = N[H].y - A;
|
|
1790
|
+
if (Z * Z + V * V < R * R)
|
|
1791
|
+
return H;
|
|
1791
1792
|
}
|
|
1792
1793
|
return -1;
|
|
1793
1794
|
},
|
|
1794
|
-
[
|
|
1795
|
+
[O, F]
|
|
1795
1796
|
), C = G(() => {
|
|
1796
1797
|
var V;
|
|
1797
1798
|
const d = (V = S.current) == null ? void 0 : V.getContext("2d");
|
|
1798
1799
|
if (!d)
|
|
1799
1800
|
return;
|
|
1800
|
-
d.clearRect(0, 0,
|
|
1801
|
-
const A =
|
|
1801
|
+
d.clearRect(0, 0, j, j);
|
|
1802
|
+
const A = O(), N = L === "failure", R = d.canvas, H = re(
|
|
1802
1803
|
N && s ? "var(--security-error)" : a ?? "var(--security-biometric)",
|
|
1803
|
-
|
|
1804
|
-
),
|
|
1804
|
+
R
|
|
1805
|
+
), Z = re("var(--security-border)", R);
|
|
1805
1806
|
for (let X = 0; X < A.length; X++) {
|
|
1806
1807
|
const ie = u.includes(X);
|
|
1807
|
-
d.beginPath(), d.arc(A[X].x, A[X].y, ie ? o * 0.75 : o * 0.5, 0, Math.PI * 2), d.fillStyle = ie ?
|
|
1808
|
+
d.beginPath(), d.arc(A[X].x, A[X].y, ie ? o * 0.75 : o * 0.5, 0, Math.PI * 2), d.fillStyle = ie ? H : Z, d.fill(), ie && (d.beginPath(), d.arc(A[X].x, A[X].y, o * 1.2, 0, Math.PI * 2), d.strokeStyle = H, d.lineWidth = 1.5, d.globalAlpha = 0.3, d.stroke(), d.globalAlpha = 1);
|
|
1808
1809
|
}
|
|
1809
1810
|
if (n && u.length > 1) {
|
|
1810
1811
|
d.beginPath(), d.moveTo(A[u[0]].x, A[u[0]].y);
|
|
1811
1812
|
for (let X = 1; X < u.length; X++)
|
|
1812
1813
|
d.lineTo(A[u[X]].x, A[u[X]].y);
|
|
1813
|
-
l && W && d.lineTo(W.x, W.y), d.strokeStyle =
|
|
1814
|
-
} else n && u.length === 1 && l && W && (d.beginPath(), d.moveTo(A[u[0]].x, A[u[0]].y), d.lineTo(W.x, W.y), d.strokeStyle = re(a ?? "var(--security-biometric)",
|
|
1814
|
+
l && W && d.lineTo(W.x, W.y), d.strokeStyle = H, d.lineWidth = 3, d.lineCap = "round", d.lineJoin = "round", d.globalAlpha = 0.5, d.stroke(), d.globalAlpha = 1;
|
|
1815
|
+
} else n && u.length === 1 && l && W && (d.beginPath(), d.moveTo(A[u[0]].x, A[u[0]].y), d.lineTo(W.x, W.y), d.strokeStyle = re(a ?? "var(--security-biometric)", R), d.lineWidth = 3, d.globalAlpha = 0.4, d.stroke(), d.globalAlpha = 1);
|
|
1815
1816
|
}, [
|
|
1816
|
-
|
|
1817
|
-
|
|
1817
|
+
j,
|
|
1818
|
+
O,
|
|
1818
1819
|
o,
|
|
1819
1820
|
u,
|
|
1820
1821
|
l,
|
|
@@ -1832,8 +1833,8 @@ const ot = 4, at = 5, ct = 3e4, Pt = (e) => {
|
|
|
1832
1833
|
if (L === "success" || L === "failure")
|
|
1833
1834
|
return;
|
|
1834
1835
|
d.preventDefault();
|
|
1835
|
-
const { x: A, y: N } = Q(d),
|
|
1836
|
-
|
|
1836
|
+
const { x: A, y: N } = Q(d), R = E(A, N);
|
|
1837
|
+
R >= 0 && (h(!0), w([R]), $({ x: A, y: N }));
|
|
1837
1838
|
},
|
|
1838
1839
|
[L, Q, E]
|
|
1839
1840
|
), I = G(
|
|
@@ -1843,8 +1844,8 @@ const ot = 4, at = 5, ct = 3e4, Pt = (e) => {
|
|
|
1843
1844
|
d.preventDefault();
|
|
1844
1845
|
const { x: A, y: N } = Q(d);
|
|
1845
1846
|
$({ x: A, y: N });
|
|
1846
|
-
const
|
|
1847
|
-
|
|
1847
|
+
const R = E(A, N);
|
|
1848
|
+
R >= 0 && !u.includes(R) && w((H) => [...H, R]);
|
|
1848
1849
|
},
|
|
1849
1850
|
[l, Q, E, u]
|
|
1850
1851
|
), x = G(async () => {
|
|
@@ -1856,11 +1857,11 @@ const ot = 4, at = 5, ct = 3e4, Pt = (e) => {
|
|
|
1856
1857
|
}
|
|
1857
1858
|
const d = u.join(",");
|
|
1858
1859
|
if (g === "set") {
|
|
1859
|
-
if (
|
|
1860
|
+
if (U === null) {
|
|
1860
1861
|
J([...u]), w([]);
|
|
1861
1862
|
return;
|
|
1862
1863
|
}
|
|
1863
|
-
if (
|
|
1864
|
+
if (U.join(",") !== d) {
|
|
1864
1865
|
J(null), K("failure"), setTimeout(() => {
|
|
1865
1866
|
K("idle"), w([]);
|
|
1866
1867
|
}, 800);
|
|
@@ -1872,8 +1873,8 @@ const ot = 4, at = 5, ct = 3e4, Pt = (e) => {
|
|
|
1872
1873
|
K("processing");
|
|
1873
1874
|
let A = !1;
|
|
1874
1875
|
if (v) {
|
|
1875
|
-
const N = new TextEncoder(),
|
|
1876
|
-
A = Array.from(new Uint8Array(
|
|
1876
|
+
const N = new TextEncoder(), R = await crypto.subtle.digest("SHA-256", N.encode(d));
|
|
1877
|
+
A = Array.from(new Uint8Array(R)).map((Z) => Z.toString(16).padStart(2, "0")).join("") === v;
|
|
1877
1878
|
} else if (f)
|
|
1878
1879
|
A = d === f;
|
|
1879
1880
|
else {
|
|
@@ -1889,8 +1890,8 @@ const ot = 4, at = 5, ct = 3e4, Pt = (e) => {
|
|
|
1889
1890
|
duration: 0
|
|
1890
1891
|
}), m == null || m([...u]);
|
|
1891
1892
|
else {
|
|
1892
|
-
const N =
|
|
1893
|
-
|
|
1893
|
+
const N = Y + 1;
|
|
1894
|
+
B(N), K("failure"), N >= i && (D == null || D(new Error("Too many failed pattern attempts"))), setTimeout(() => {
|
|
1894
1895
|
K("idle"), w([]);
|
|
1895
1896
|
}, 900), k == null || k({
|
|
1896
1897
|
success: !1,
|
|
@@ -1905,10 +1906,10 @@ const ot = 4, at = 5, ct = 3e4, Pt = (e) => {
|
|
|
1905
1906
|
u,
|
|
1906
1907
|
r,
|
|
1907
1908
|
g,
|
|
1908
|
-
|
|
1909
|
+
U,
|
|
1909
1910
|
v,
|
|
1910
1911
|
f,
|
|
1911
|
-
|
|
1912
|
+
Y,
|
|
1912
1913
|
i,
|
|
1913
1914
|
K,
|
|
1914
1915
|
m,
|
|
@@ -1928,7 +1929,7 @@ const ot = 4, at = 5, ct = 3e4, Pt = (e) => {
|
|
|
1928
1929
|
color: "var(--security-text)"
|
|
1929
1930
|
},
|
|
1930
1931
|
children: [
|
|
1931
|
-
|
|
1932
|
+
M && /* @__PURE__ */ c("div", { style: { fontSize: 14, fontWeight: 600 }, children: M }),
|
|
1932
1933
|
/* @__PURE__ */ c(
|
|
1933
1934
|
"div",
|
|
1934
1935
|
{
|
|
@@ -1938,15 +1939,15 @@ const ot = 4, at = 5, ct = 3e4, Pt = (e) => {
|
|
|
1938
1939
|
minHeight: 18,
|
|
1939
1940
|
textAlign: "center"
|
|
1940
1941
|
},
|
|
1941
|
-
children: L === "success" ? p("security.pattern.success", "Pattern accepted") : L === "failure" ? p("security.pattern.wrong", "Wrong pattern") : g === "set" &&
|
|
1942
|
+
children: L === "success" ? p("security.pattern.success", "Pattern accepted") : L === "failure" ? p("security.pattern.wrong", "Wrong pattern") : g === "set" && U !== null ? p("security.pattern.confirm", "Draw pattern again to confirm") : g === "set" ? p("security.pattern.setNew", "Draw a new pattern") : p("security.pattern.draw", "Draw your pattern")
|
|
1942
1943
|
}
|
|
1943
1944
|
),
|
|
1944
1945
|
/* @__PURE__ */ c(
|
|
1945
1946
|
"canvas",
|
|
1946
1947
|
{
|
|
1947
1948
|
ref: S,
|
|
1948
|
-
width:
|
|
1949
|
-
height:
|
|
1949
|
+
width: j,
|
|
1950
|
+
height: j,
|
|
1950
1951
|
style: {
|
|
1951
1952
|
touchAction: "none",
|
|
1952
1953
|
borderRadius: "var(--security-radius-lg)",
|
|
@@ -1968,7 +1969,7 @@ const ot = 4, at = 5, ct = 3e4, Pt = (e) => {
|
|
|
1968
1969
|
"button",
|
|
1969
1970
|
{
|
|
1970
1971
|
onClick: () => {
|
|
1971
|
-
w([]),
|
|
1972
|
+
w([]), B(0), J(null), K("idle");
|
|
1972
1973
|
},
|
|
1973
1974
|
style: {
|
|
1974
1975
|
fontSize: 13,
|
|
@@ -1982,11 +1983,11 @@ const ot = 4, at = 5, ct = 3e4, Pt = (e) => {
|
|
|
1982
1983
|
children: p("security.common.retry", "Try Again")
|
|
1983
1984
|
}
|
|
1984
1985
|
),
|
|
1985
|
-
|
|
1986
|
+
Y > 0 && L !== "success" && /* @__PURE__ */ c("div", { style: { fontSize: 11, color: "var(--security-warning)" }, children: p("security.pattern.attempts", `${Y}/${i} attempts`) })
|
|
1986
1987
|
]
|
|
1987
1988
|
}
|
|
1988
1989
|
);
|
|
1989
|
-
},
|
|
1990
|
+
}, gt = { sm: "8px 16px", md: "12px 24px", lg: "14px 32px" }, mt = { sm: 13, md: 14, lg: 16 }, Bt = (e) => {
|
|
1990
1991
|
const {
|
|
1991
1992
|
mode: t,
|
|
1992
1993
|
credentialIds: r = [],
|
|
@@ -2002,21 +2003,21 @@ const ot = 4, at = 5, ct = 3e4, Pt = (e) => {
|
|
|
2002
2003
|
onAuthenticate: k,
|
|
2003
2004
|
onVerify: y,
|
|
2004
2005
|
onStatusChange: D,
|
|
2005
|
-
onError:
|
|
2006
|
+
onError: M,
|
|
2006
2007
|
label: b,
|
|
2007
2008
|
className: T,
|
|
2008
2009
|
variant: p = "primary",
|
|
2009
2010
|
size: S = "md",
|
|
2010
2011
|
fullWidth: u = !1,
|
|
2011
2012
|
icon: w
|
|
2012
|
-
} = e, { t: l } = te(), [h, L] =
|
|
2013
|
+
} = e, { t: l } = te(), [h, L] = _("idle"), [q, Y] = _(!0), [B, U] = _(!1), J = G(
|
|
2013
2014
|
(C) => {
|
|
2014
2015
|
L(C), D == null || D(C);
|
|
2015
2016
|
},
|
|
2016
2017
|
[D]
|
|
2017
2018
|
);
|
|
2018
2019
|
ne(() => {
|
|
2019
|
-
|
|
2020
|
+
Y(Ce()), et().then(U);
|
|
2020
2021
|
}, []);
|
|
2021
2022
|
const W = G(() => {
|
|
2022
2023
|
if (n) {
|
|
@@ -2028,13 +2029,13 @@ const ot = 4, at = 5, ct = 3e4, Pt = (e) => {
|
|
|
2028
2029
|
return crypto.getRandomValues(new Uint8Array(32)).buffer;
|
|
2029
2030
|
}, [n]), $ = G(async () => {
|
|
2030
2031
|
if (!q) {
|
|
2031
|
-
|
|
2032
|
+
M == null || M(new Error("WebAuthn not available"));
|
|
2032
2033
|
return;
|
|
2033
2034
|
}
|
|
2034
2035
|
J("processing");
|
|
2035
2036
|
try {
|
|
2036
2037
|
if (t === "register") {
|
|
2037
|
-
const C = (o == null ? void 0 : o.id) ?? crypto.getRandomValues(new Uint8Array(16)), z = (o == null ? void 0 : o.name) ?? "user", I = (o == null ? void 0 : o.displayName) ?? z, x = W(), d = await
|
|
2038
|
+
const C = (o == null ? void 0 : o.id) ?? crypto.getRandomValues(new Uint8Array(16)), z = (o == null ? void 0 : o.name) ?? "user", I = (o == null ? void 0 : o.displayName) ?? z, x = W(), d = await tt({
|
|
2038
2039
|
rpName: s,
|
|
2039
2040
|
rpId: i,
|
|
2040
2041
|
userId: typeof C == "string" ? C : Array.from(C).join(""),
|
|
@@ -2050,7 +2051,7 @@ const ot = 4, at = 5, ct = 3e4, Pt = (e) => {
|
|
|
2050
2051
|
duration: 0
|
|
2051
2052
|
});
|
|
2052
2053
|
} else {
|
|
2053
|
-
const C = await
|
|
2054
|
+
const C = await rt({
|
|
2054
2055
|
rpId: i,
|
|
2055
2056
|
challenge: W(),
|
|
2056
2057
|
allowCredentials: r == null ? void 0 : r.map((z) => ({
|
|
@@ -2068,7 +2069,7 @@ const ot = 4, at = 5, ct = 3e4, Pt = (e) => {
|
|
|
2068
2069
|
}
|
|
2069
2070
|
} catch (C) {
|
|
2070
2071
|
const z = C instanceof Error ? C : new Error(String(C));
|
|
2071
|
-
z.name === "NotAllowedError" ? J("idle") : (J("error"),
|
|
2072
|
+
z.name === "NotAllowedError" ? J("idle") : (J("error"), M == null || M(z), y == null || y({
|
|
2072
2073
|
success: !1,
|
|
2073
2074
|
confidence: 0,
|
|
2074
2075
|
method: "webauthn",
|
|
@@ -2092,18 +2093,18 @@ const ot = 4, at = 5, ct = 3e4, Pt = (e) => {
|
|
|
2092
2093
|
m,
|
|
2093
2094
|
k,
|
|
2094
2095
|
y,
|
|
2095
|
-
|
|
2096
|
-
]),
|
|
2096
|
+
M
|
|
2097
|
+
]), j = t === "register" ? B ? l("security.webauthn.registerPasskey", "Register Passkey") : l("security.webauthn.register", "Register Security Key") : B ? l("security.webauthn.signInPasskey", "Sign in with Passkey") : l("security.webauthn.signIn", "Sign in with Security Key"), F = b ?? j, K = {
|
|
2097
2098
|
primary: "var(--security-biometric)",
|
|
2098
2099
|
outline: "transparent",
|
|
2099
2100
|
ghost: "transparent"
|
|
2100
|
-
},
|
|
2101
|
+
}, O = {
|
|
2101
2102
|
primary: "none",
|
|
2102
2103
|
outline: "2px solid var(--security-biometric)",
|
|
2103
2104
|
ghost: "none"
|
|
2104
2105
|
}, Q = {
|
|
2105
2106
|
// Label on the brand-coloured button: the on-primary text token, not a surface token.
|
|
2106
|
-
primary: "var(--nice-
|
|
2107
|
+
primary: "var(--nice-color-white, #fff)",
|
|
2107
2108
|
outline: "var(--security-biometric)",
|
|
2108
2109
|
ghost: "var(--security-biometric)"
|
|
2109
2110
|
}, E = !q || h === "processing" || h === "success";
|
|
@@ -2120,13 +2121,13 @@ const ot = 4, at = 5, ct = 3e4, Pt = (e) => {
|
|
|
2120
2121
|
disabled: E,
|
|
2121
2122
|
style: {
|
|
2122
2123
|
width: u ? "100%" : "auto",
|
|
2123
|
-
padding:
|
|
2124
|
-
fontSize:
|
|
2124
|
+
padding: gt[S],
|
|
2125
|
+
fontSize: mt[S],
|
|
2125
2126
|
fontWeight: 600,
|
|
2126
2127
|
fontFamily: "var(--security-font)",
|
|
2127
2128
|
background: K[p],
|
|
2128
2129
|
color: Q[p],
|
|
2129
|
-
border:
|
|
2130
|
+
border: O[p],
|
|
2130
2131
|
borderRadius: "var(--security-radius)",
|
|
2131
2132
|
cursor: E ? "not-allowed" : "pointer",
|
|
2132
2133
|
opacity: E ? 0.6 : 1,
|
|
@@ -2177,8 +2178,8 @@ const ot = 4, at = 5, ct = 3e4, Pt = (e) => {
|
|
|
2177
2178
|
]
|
|
2178
2179
|
}
|
|
2179
2180
|
);
|
|
2180
|
-
},
|
|
2181
|
-
entries: e,
|
|
2181
|
+
}, vt = [], bt = (e) => e >= 80 ? "var(--security-error)" : e >= 50 ? "var(--security-warning)" : "var(--security-success)", Wt = ({
|
|
2182
|
+
entries: e = vt,
|
|
2182
2183
|
pageSize: t = 20,
|
|
2183
2184
|
showExport: r = !0,
|
|
2184
2185
|
filterMethods: n,
|
|
@@ -2186,10 +2187,10 @@ const ot = 4, at = 5, ct = 3e4, Pt = (e) => {
|
|
|
2186
2187
|
className: i,
|
|
2187
2188
|
label: o
|
|
2188
2189
|
}) => {
|
|
2189
|
-
const { t: a } = te(), [g, v] =
|
|
2190
|
+
const { t: a } = te(), [g, v] = _("all"), [f, m] = _("all"), [k, y] = _(0), D = ae(() => {
|
|
2190
2191
|
let l = [...e];
|
|
2191
2192
|
return g !== "all" && (l = l.filter((h) => h.method === g)), f !== "all" && (l = l.filter((h) => h.status === f)), l.sort((h, L) => L.timestamp - h.timestamp), l;
|
|
2192
|
-
}, [e, g, f]),
|
|
2193
|
+
}, [e, g, f]), M = Math.max(1, Math.ceil(D.length / t)), b = D.slice(k * t, (k + 1) * t), T = ae(() => n || Array.from(new Set(e.map((l) => l.method))), [e, n]), p = ae(() => Array.from(new Set(e.map((l) => l.status))), [e]), S = G(() => {
|
|
2193
2194
|
const l = new Blob([JSON.stringify(D, null, 2)], { type: "application/json" }), h = URL.createObjectURL(l), L = document.createElement("a");
|
|
2194
2195
|
L.href = h, L.download = `security-audit-${(/* @__PURE__ */ new Date()).toISOString().slice(0, 10)}.json`, L.click(), URL.revokeObjectURL(h);
|
|
2195
2196
|
}, [D]), u = (l) => new Date(l).toLocaleString(), w = {
|
|
@@ -2257,9 +2258,9 @@ const ot = 4, at = 5, ct = 3e4, Pt = (e) => {
|
|
|
2257
2258
|
"button",
|
|
2258
2259
|
{
|
|
2259
2260
|
onClick: S,
|
|
2260
|
-
style:
|
|
2261
|
+
style: xt,
|
|
2261
2262
|
title: a("security.audit.exportJson", "Export JSON"),
|
|
2262
|
-
children: "JSON"
|
|
2263
|
+
children: a("security.json", "JSON")
|
|
2263
2264
|
}
|
|
2264
2265
|
)
|
|
2265
2266
|
] })
|
|
@@ -2330,7 +2331,7 @@ const ot = 4, at = 5, ct = 3e4, Pt = (e) => {
|
|
|
2330
2331
|
}
|
|
2331
2332
|
) }),
|
|
2332
2333
|
/* @__PURE__ */ c("td", { style: { ...w, textAlign: "center" }, children: l.status }),
|
|
2333
|
-
/* @__PURE__ */ c("td", { style: { ...w, textAlign: "center" }, children: l.riskScore != null && /* @__PURE__ */ c("span", { style: { color:
|
|
2334
|
+
/* @__PURE__ */ c("td", { style: { ...w, textAlign: "center" }, children: l.riskScore != null && /* @__PURE__ */ c("span", { style: { color: bt(l.riskScore), fontWeight: 600 }, children: l.riskScore }) }),
|
|
2334
2335
|
/* @__PURE__ */ c(
|
|
2335
2336
|
"td",
|
|
2336
2337
|
{
|
|
@@ -2349,7 +2350,7 @@ const ot = 4, at = 5, ct = 3e4, Pt = (e) => {
|
|
|
2349
2350
|
))
|
|
2350
2351
|
] })
|
|
2351
2352
|
] }) }),
|
|
2352
|
-
|
|
2353
|
+
M > 1 && /* @__PURE__ */ P(
|
|
2353
2354
|
"div",
|
|
2354
2355
|
{
|
|
2355
2356
|
style: {
|
|
@@ -2364,23 +2365,25 @@ const ot = 4, at = 5, ct = 3e4, Pt = (e) => {
|
|
|
2364
2365
|
},
|
|
2365
2366
|
children: [
|
|
2366
2367
|
/* @__PURE__ */ P("button", { disabled: k === 0, onClick: () => y(k - 1), style: we, children: [
|
|
2367
|
-
"
|
|
2368
|
+
/* @__PURE__ */ c(Ne, { size: 14, style: { verticalAlign: "-2px" } }),
|
|
2369
|
+
" ",
|
|
2368
2370
|
a("security.audit.prev", "Prev")
|
|
2369
2371
|
] }),
|
|
2370
2372
|
/* @__PURE__ */ P("span", { children: [
|
|
2371
2373
|
k + 1,
|
|
2372
2374
|
" / ",
|
|
2373
|
-
|
|
2375
|
+
M
|
|
2374
2376
|
] }),
|
|
2375
2377
|
/* @__PURE__ */ P(
|
|
2376
2378
|
"button",
|
|
2377
2379
|
{
|
|
2378
|
-
disabled: k >=
|
|
2380
|
+
disabled: k >= M - 1,
|
|
2379
2381
|
onClick: () => y(k + 1),
|
|
2380
2382
|
style: we,
|
|
2381
2383
|
children: [
|
|
2382
2384
|
a("security.audit.next", "Next"),
|
|
2383
|
-
"
|
|
2385
|
+
" ",
|
|
2386
|
+
/* @__PURE__ */ c(Le, { size: 14, style: { verticalAlign: "-2px" } })
|
|
2384
2387
|
]
|
|
2385
2388
|
}
|
|
2386
2389
|
)
|
|
@@ -2409,7 +2412,7 @@ const ot = 4, at = 5, ct = 3e4, Pt = (e) => {
|
|
|
2409
2412
|
color: "var(--security-text)",
|
|
2410
2413
|
border: "1px solid var(--security-border)",
|
|
2411
2414
|
borderRadius: "var(--security-radius)"
|
|
2412
|
-
},
|
|
2415
|
+
}, xt = {
|
|
2413
2416
|
background: "none",
|
|
2414
2417
|
border: "1px solid var(--security-border)",
|
|
2415
2418
|
borderRadius: "var(--security-radius)",
|
|
@@ -2423,7 +2426,7 @@ const ot = 4, at = 5, ct = 3e4, Pt = (e) => {
|
|
|
2423
2426
|
color: "var(--security-biometric)",
|
|
2424
2427
|
fontWeight: 600,
|
|
2425
2428
|
fontSize: 13
|
|
2426
|
-
}, Se = {
|
|
2429
|
+
}, wt = [], Se = {
|
|
2427
2430
|
display: "inline-block",
|
|
2428
2431
|
width: "0.3em",
|
|
2429
2432
|
height: "0.6em",
|
|
@@ -2431,8 +2434,8 @@ const ot = 4, at = 5, ct = 3e4, Pt = (e) => {
|
|
|
2431
2434
|
borderRight: "0.12em solid currentColor",
|
|
2432
2435
|
borderBottom: "0.12em solid currentColor",
|
|
2433
2436
|
transform: "rotate(45deg)"
|
|
2434
|
-
},
|
|
2435
|
-
options: e,
|
|
2437
|
+
}, Ot = ({
|
|
2438
|
+
options: e = wt,
|
|
2436
2439
|
requiredCount: t = 1,
|
|
2437
2440
|
onSelect: r,
|
|
2438
2441
|
onComplete: n,
|
|
@@ -2477,7 +2480,7 @@ const ot = 4, at = 5, ct = 3e4, Pt = (e) => {
|
|
|
2477
2480
|
alignItems: "center",
|
|
2478
2481
|
gap: o === "grid" ? 8 : 12,
|
|
2479
2482
|
padding: o === "grid" ? "20px 16px" : "12px 16px",
|
|
2480
|
-
background: m ? "
|
|
2483
|
+
background: m ? "color-mix(in srgb, var(--nice-color-success, #10b981) 8%, transparent)" : "var(--security-bg-panel)",
|
|
2481
2484
|
border: `2px solid ${m ? "var(--security-success)" : "var(--security-border)"}`,
|
|
2482
2485
|
borderRadius: "var(--security-radius-lg)",
|
|
2483
2486
|
cursor: k || m ? "default" : "pointer",
|
|
@@ -2523,8 +2526,8 @@ const ot = 4, at = 5, ct = 3e4, Pt = (e) => {
|
|
|
2523
2526
|
]
|
|
2524
2527
|
}
|
|
2525
2528
|
);
|
|
2526
|
-
},
|
|
2527
|
-
sessions: e,
|
|
2529
|
+
}, St = [], Ut = ({
|
|
2530
|
+
sessions: e = St,
|
|
2528
2531
|
onRevoke: t,
|
|
2529
2532
|
onRevokeAll: r,
|
|
2530
2533
|
onTrust: n,
|
|
@@ -2532,7 +2535,7 @@ const ot = 4, at = 5, ct = 3e4, Pt = (e) => {
|
|
|
2532
2535
|
label: i,
|
|
2533
2536
|
showRevokeAll: o = !0
|
|
2534
2537
|
}) => {
|
|
2535
|
-
const { t: a } = te(), [g, v] =
|
|
2538
|
+
const { t: a } = te(), [g, v] = _(/* @__PURE__ */ new Set()), f = ae(
|
|
2536
2539
|
() => [...e].sort(
|
|
2537
2540
|
(y, D) => (D.current ? 1 : 0) - (y.current ? 1 : 0) || D.lastActive - y.lastActive
|
|
2538
2541
|
),
|
|
@@ -2599,7 +2602,7 @@ const ot = 4, at = 5, ct = 3e4, Pt = (e) => {
|
|
|
2599
2602
|
padding: "12px 16px",
|
|
2600
2603
|
borderBottom: "1px solid var(--security-border)",
|
|
2601
2604
|
opacity: g.has(y.id) ? 0.5 : 1,
|
|
2602
|
-
background: y.current ? "
|
|
2605
|
+
background: y.current ? "color-mix(in srgb, var(--nice-color-primary, #3b82f6) 4%, transparent)" : void 0
|
|
2603
2606
|
},
|
|
2604
2607
|
children: [
|
|
2605
2608
|
/* @__PURE__ */ P("div", { style: { display: "flex", gap: 12, alignItems: "center" }, children: [
|
|
@@ -2627,7 +2630,7 @@ const ot = 4, at = 5, ct = 3e4, Pt = (e) => {
|
|
|
2627
2630
|
fontSize: 10,
|
|
2628
2631
|
padding: "1px 6px",
|
|
2629
2632
|
background: "var(--security-biometric)",
|
|
2630
|
-
color: "var(--nice-
|
|
2633
|
+
color: "var(--nice-color-white, #fff)",
|
|
2631
2634
|
borderRadius: 8
|
|
2632
2635
|
},
|
|
2633
2636
|
children: a("security.session.current", "Current")
|
|
@@ -2715,7 +2718,7 @@ const ot = 4, at = 5, ct = 3e4, Pt = (e) => {
|
|
|
2715
2718
|
]
|
|
2716
2719
|
}
|
|
2717
2720
|
);
|
|
2718
|
-
},
|
|
2721
|
+
}, Ht = ({
|
|
2719
2722
|
trustScore: e,
|
|
2720
2723
|
onScoreComputed: t,
|
|
2721
2724
|
trustThreshold: r = 60,
|
|
@@ -2724,13 +2727,13 @@ const ot = 4, at = 5, ct = 3e4, Pt = (e) => {
|
|
|
2724
2727
|
className: i,
|
|
2725
2728
|
label: o
|
|
2726
2729
|
}) => {
|
|
2727
|
-
const { t: a } = te(), [g, v] =
|
|
2730
|
+
const { t: a } = te(), [g, v] = _(e ?? null), [f, m] = _(!e), k = G(async () => {
|
|
2728
2731
|
var D;
|
|
2729
2732
|
m(!0);
|
|
2730
2733
|
try {
|
|
2731
|
-
const
|
|
2734
|
+
const M = De(), b = await de(), T = [];
|
|
2732
2735
|
let p = 50;
|
|
2733
|
-
|
|
2736
|
+
M.platform && !M.platform.includes("Linux") && (T.push({
|
|
2734
2737
|
name: "Known platform",
|
|
2735
2738
|
score: 5,
|
|
2736
2739
|
description: "Running on a recognized platform",
|
|
@@ -2740,7 +2743,7 @@ const ot = 4, at = 5, ct = 3e4, Pt = (e) => {
|
|
|
2740
2743
|
score: 5,
|
|
2741
2744
|
description: "Browser cookies are enabled",
|
|
2742
2745
|
weight: 0.05
|
|
2743
|
-
}), p += 5),
|
|
2746
|
+
}), p += 5), M.screenResolution[0] >= 360 && M.screenResolution[1] >= 640 && (T.push({
|
|
2744
2747
|
name: "Standard resolution",
|
|
2745
2748
|
score: 5,
|
|
2746
2749
|
description: "Screen resolution within normal range",
|
|
@@ -2755,7 +2758,7 @@ const ot = 4, at = 5, ct = 3e4, Pt = (e) => {
|
|
|
2755
2758
|
score: 5,
|
|
2756
2759
|
description: "Browser language is set",
|
|
2757
2760
|
weight: 0.05
|
|
2758
|
-
}), p += 5),
|
|
2761
|
+
}), p += 5), M.touchSupport && (T.push({
|
|
2759
2762
|
name: "Touch device",
|
|
2760
2763
|
score: 5,
|
|
2761
2764
|
description: "Touch input is supported",
|
|
@@ -2893,7 +2896,7 @@ const ot = 4, at = 5, ct = 3e4, Pt = (e) => {
|
|
|
2893
2896
|
]
|
|
2894
2897
|
}
|
|
2895
2898
|
),
|
|
2896
|
-
/* @__PURE__ */ c("ul", { style: { margin: 0, paddingLeft: 18, color: "var(--security-text-muted)" }, children: g.factors.map((D,
|
|
2899
|
+
/* @__PURE__ */ c("ul", { style: { margin: 0, paddingLeft: 18, color: "var(--security-text-muted)" }, children: g.factors.map((D, M) => /* @__PURE__ */ c("li", { style: { marginBottom: 2 }, children: D.name }, M)) })
|
|
2897
2900
|
] }),
|
|
2898
2901
|
s && g.fingerprint && /* @__PURE__ */ c(
|
|
2899
2902
|
"div",
|
|
@@ -2914,19 +2917,19 @@ const ot = 4, at = 5, ct = 3e4, Pt = (e) => {
|
|
|
2914
2917
|
}
|
|
2915
2918
|
);
|
|
2916
2919
|
};
|
|
2917
|
-
function
|
|
2920
|
+
function kt(e) {
|
|
2918
2921
|
if (!e)
|
|
2919
2922
|
return 0;
|
|
2920
2923
|
let t = 0;
|
|
2921
2924
|
return e.length >= 8 && t++, e.length >= 12 && t++, /[a-z]/.test(e) && /[A-Z]/.test(e) && t++, /\d/.test(e) && t++, /[^a-zA-Z0-9]/.test(e) && t++, /(.)\1{3,}/.test(e) && t--, Math.max(0, Math.min(4, t));
|
|
2922
2925
|
}
|
|
2923
|
-
const
|
|
2926
|
+
const At = ["Very weak", "Weak", "Fair", "Strong", "Very strong"], ke = [
|
|
2924
2927
|
"var(--nice-danger, #ef4444)",
|
|
2925
2928
|
"var(--nice-warning, #f97316)",
|
|
2926
2929
|
"var(--nice-warning, #eab308)",
|
|
2927
2930
|
"var(--nice-success, #22c55e)",
|
|
2928
2931
|
"var(--nice-success, #10b981)"
|
|
2929
|
-
],
|
|
2932
|
+
], qt = ({
|
|
2930
2933
|
mode: e = "verify",
|
|
2931
2934
|
expectedHash: t,
|
|
2932
2935
|
minStrength: r = 2,
|
|
@@ -2941,32 +2944,32 @@ const vt = ["Very weak", "Weak", "Fair", "Strong", "Very strong"], ke = [
|
|
|
2941
2944
|
showStrength: m = !0,
|
|
2942
2945
|
maxAttempts: k = 5
|
|
2943
2946
|
}) => {
|
|
2944
|
-
const { t: y } = te(), [D,
|
|
2947
|
+
const { t: y } = te(), [D, M] = _(""), [b, T] = _(""), [p, S] = _(!1), [u, w] = _("idle"), [l, h] = _(0), [L, q] = _(""), Y = ee(null), B = kt(D), U = G(
|
|
2945
2948
|
($) => {
|
|
2946
2949
|
w($), o == null || o($);
|
|
2947
2950
|
},
|
|
2948
2951
|
[o]
|
|
2949
2952
|
), J = G(async () => {
|
|
2950
|
-
if (q(""),
|
|
2953
|
+
if (q(""), U("processing"), e === "set") {
|
|
2951
2954
|
if (D.length < n) {
|
|
2952
|
-
q(y("security.passphrase.tooShort", `Minimum ${n} characters`)),
|
|
2955
|
+
q(y("security.passphrase.tooShort", `Minimum ${n} characters`)), U("idle");
|
|
2953
2956
|
return;
|
|
2954
2957
|
}
|
|
2955
|
-
if (
|
|
2956
|
-
q(y("security.passphrase.tooWeak", "Passphrase is too weak")),
|
|
2958
|
+
if (B < r) {
|
|
2959
|
+
q(y("security.passphrase.tooWeak", "Passphrase is too weak")), U("idle");
|
|
2957
2960
|
return;
|
|
2958
2961
|
}
|
|
2959
2962
|
if (D !== b) {
|
|
2960
|
-
q(y("security.passphrase.noMatch", "Passphrases do not match")),
|
|
2963
|
+
q(y("security.passphrase.noMatch", "Passphrases do not match")), U("failure"), setTimeout(() => U("idle"), 1e3);
|
|
2961
2964
|
return;
|
|
2962
2965
|
}
|
|
2963
|
-
s == null || s(D),
|
|
2966
|
+
s == null || s(D), U("success");
|
|
2964
2967
|
return;
|
|
2965
2968
|
}
|
|
2966
2969
|
if (t) {
|
|
2967
|
-
const $ = new TextEncoder(),
|
|
2968
|
-
if (Array.from(new Uint8Array(
|
|
2969
|
-
|
|
2970
|
+
const $ = new TextEncoder(), j = await crypto.subtle.digest("SHA-256", $.encode(D));
|
|
2971
|
+
if (Array.from(new Uint8Array(j)).map((O) => O.toString(16).padStart(2, "0")).join("") === t)
|
|
2972
|
+
U("success"), i == null || i({
|
|
2970
2973
|
success: !0,
|
|
2971
2974
|
confidence: 1,
|
|
2972
2975
|
method: "passphrase",
|
|
@@ -2974,8 +2977,8 @@ const vt = ["Very weak", "Weak", "Fair", "Strong", "Very strong"], ke = [
|
|
|
2974
2977
|
duration: 0
|
|
2975
2978
|
}), s == null || s(D);
|
|
2976
2979
|
else {
|
|
2977
|
-
const
|
|
2978
|
-
h(
|
|
2980
|
+
const O = l + 1;
|
|
2981
|
+
h(O), O >= k ? (U("failure"), a == null || a(new Error("Too many failed attempts"))) : (q(y("security.passphrase.incorrect", "Incorrect passphrase")), U("idle")), i == null || i({
|
|
2979
2982
|
success: !1,
|
|
2980
2983
|
confidence: 0,
|
|
2981
2984
|
method: "passphrase",
|
|
@@ -2984,19 +2987,19 @@ const vt = ["Very weak", "Weak", "Fair", "Strong", "Very strong"], ke = [
|
|
|
2984
2987
|
});
|
|
2985
2988
|
}
|
|
2986
2989
|
} else
|
|
2987
|
-
s == null || s(D),
|
|
2990
|
+
s == null || s(D), U("success");
|
|
2988
2991
|
}, [
|
|
2989
2992
|
D,
|
|
2990
2993
|
b,
|
|
2991
2994
|
e,
|
|
2992
2995
|
t,
|
|
2993
|
-
|
|
2996
|
+
B,
|
|
2994
2997
|
r,
|
|
2995
2998
|
n,
|
|
2996
2999
|
l,
|
|
2997
3000
|
k,
|
|
2998
3001
|
y,
|
|
2999
|
-
|
|
3002
|
+
U,
|
|
3000
3003
|
s,
|
|
3001
3004
|
i,
|
|
3002
3005
|
a
|
|
@@ -3029,10 +3032,10 @@ const vt = ["Very weak", "Weak", "Fair", "Strong", "Very strong"], ke = [
|
|
|
3029
3032
|
/* @__PURE__ */ c(
|
|
3030
3033
|
"input",
|
|
3031
3034
|
{
|
|
3032
|
-
ref:
|
|
3035
|
+
ref: Y,
|
|
3033
3036
|
type: p ? "text" : "password",
|
|
3034
3037
|
value: D,
|
|
3035
|
-
onChange: ($) =>
|
|
3038
|
+
onChange: ($) => M($.target.value),
|
|
3036
3039
|
placeholder: v ?? y("security.passphrase.placeholder", "Enter passphrase"),
|
|
3037
3040
|
style: W,
|
|
3038
3041
|
disabled: u === "success",
|
|
@@ -3067,13 +3070,13 @@ const vt = ["Very weak", "Weak", "Fair", "Strong", "Very strong"], ke = [
|
|
|
3067
3070
|
style: {
|
|
3068
3071
|
flex: 1,
|
|
3069
3072
|
borderRadius: 2,
|
|
3070
|
-
background: $ <
|
|
3073
|
+
background: $ < B ? ke[B] : "var(--security-border)",
|
|
3071
3074
|
transition: "background 0.2s"
|
|
3072
3075
|
}
|
|
3073
3076
|
},
|
|
3074
3077
|
$
|
|
3075
3078
|
)) }),
|
|
3076
|
-
/* @__PURE__ */ c("div", { style: { fontSize: 11, marginTop: 4, color: ke[
|
|
3079
|
+
/* @__PURE__ */ c("div", { style: { fontSize: 11, marginTop: 4, color: ke[B] }, children: y(`security.passphrase.strength${B}`, At[B]) })
|
|
3077
3080
|
] }),
|
|
3078
3081
|
e === "set" && /* @__PURE__ */ c(
|
|
3079
3082
|
"input",
|
|
@@ -3099,7 +3102,7 @@ const vt = ["Very weak", "Weak", "Fair", "Strong", "Very strong"], ke = [
|
|
|
3099
3102
|
fontSize: 14,
|
|
3100
3103
|
fontWeight: 600,
|
|
3101
3104
|
background: u === "success" ? "var(--security-success)" : "var(--security-biometric)",
|
|
3102
|
-
color: "var(--nice-
|
|
3105
|
+
color: "var(--nice-color-white, #fff)",
|
|
3103
3106
|
border: "none",
|
|
3104
3107
|
borderRadius: "var(--security-radius)",
|
|
3105
3108
|
cursor: u === "success" ? "default" : "pointer",
|
|
@@ -3113,7 +3116,7 @@ const vt = ["Very weak", "Weak", "Fair", "Strong", "Very strong"], ke = [
|
|
|
3113
3116
|
}
|
|
3114
3117
|
);
|
|
3115
3118
|
};
|
|
3116
|
-
function
|
|
3119
|
+
function Kt(e) {
|
|
3117
3120
|
const t = [], r = {
|
|
3118
3121
|
defaultSrc: "default-src",
|
|
3119
3122
|
scriptSrc: "script-src",
|
|
@@ -3148,7 +3151,7 @@ function Bt(e) {
|
|
|
3148
3151
|
}
|
|
3149
3152
|
}), t.join("; ");
|
|
3150
3153
|
}
|
|
3151
|
-
function
|
|
3154
|
+
function Gt(e) {
|
|
3152
3155
|
const t = "'self'";
|
|
3153
3156
|
return {
|
|
3154
3157
|
defaultSrc: [t],
|
|
@@ -3167,10 +3170,10 @@ function _t(e) {
|
|
|
3167
3170
|
reportUri: e == null ? void 0 : e.reportUri
|
|
3168
3171
|
};
|
|
3169
3172
|
}
|
|
3170
|
-
function
|
|
3173
|
+
function Jt() {
|
|
3171
3174
|
return typeof crypto < "u" && crypto.randomUUID ? crypto.randomUUID().replace(/-/g, "") : Math.random().toString(36).substring(2) + Date.now().toString(36);
|
|
3172
3175
|
}
|
|
3173
|
-
const
|
|
3176
|
+
const Tt = {
|
|
3174
3177
|
"&": "&",
|
|
3175
3178
|
"<": "<",
|
|
3176
3179
|
">": ">",
|
|
@@ -3180,14 +3183,14 @@ const bt = {
|
|
|
3180
3183
|
"`": "`",
|
|
3181
3184
|
"=": "="
|
|
3182
3185
|
};
|
|
3183
|
-
function
|
|
3184
|
-
return e.replace(/[&<>"'`=/]/g, (t) =>
|
|
3186
|
+
function It(e) {
|
|
3187
|
+
return e.replace(/[&<>"'`=/]/g, (t) => Tt[t] || t);
|
|
3185
3188
|
}
|
|
3186
|
-
function
|
|
3187
|
-
let r =
|
|
3189
|
+
function Yt(e, t) {
|
|
3190
|
+
let r = It(e);
|
|
3188
3191
|
return t != null && t.maxLength && r.length > t.maxLength && (r = r.substring(0, t.maxLength)), r;
|
|
3189
3192
|
}
|
|
3190
|
-
function
|
|
3193
|
+
function Zt(e) {
|
|
3191
3194
|
if (!e)
|
|
3192
3195
|
return null;
|
|
3193
3196
|
try {
|
|
@@ -3197,7 +3200,7 @@ function Ht(e) {
|
|
|
3197
3200
|
return null;
|
|
3198
3201
|
}
|
|
3199
3202
|
}
|
|
3200
|
-
function
|
|
3203
|
+
function Xt(e) {
|
|
3201
3204
|
const t = ["script", "iframe", "object", "embed", "form"];
|
|
3202
3205
|
let r = e;
|
|
3203
3206
|
t.forEach((i) => {
|
|
@@ -3211,7 +3214,7 @@ function Ot(e) {
|
|
|
3211
3214
|
const s = /javascript:/gi;
|
|
3212
3215
|
return r = r.replace(s, ""), r;
|
|
3213
3216
|
}
|
|
3214
|
-
function
|
|
3217
|
+
function Qt(e, t) {
|
|
3215
3218
|
let r = e;
|
|
3216
3219
|
if (t != null && t.allowedTags) {
|
|
3217
3220
|
const n = /<\/?([a-z][a-z0-9]*)[^>]*>/gi;
|
|
@@ -3224,29 +3227,29 @@ const me = {
|
|
|
3224
3227
|
cookieName: "XSRF-TOKEN",
|
|
3225
3228
|
fieldName: "_csrf"
|
|
3226
3229
|
};
|
|
3227
|
-
function
|
|
3230
|
+
function Vt() {
|
|
3228
3231
|
if (typeof crypto < "u") {
|
|
3229
3232
|
const e = new Uint8Array(32);
|
|
3230
3233
|
return crypto.getRandomValues(e), Array.from(e, (t) => t.toString(16).padStart(2, "0")).join("");
|
|
3231
3234
|
}
|
|
3232
3235
|
return Math.random().toString(36).substring(2) + Date.now().toString(36);
|
|
3233
3236
|
}
|
|
3234
|
-
function
|
|
3237
|
+
function Re(e = me.cookieName) {
|
|
3235
3238
|
if (typeof document > "u")
|
|
3236
3239
|
return null;
|
|
3237
3240
|
const t = document.cookie.match(new RegExp(`(^| )${e}=([^;]+)`));
|
|
3238
3241
|
return t ? decodeURIComponent(t[2]) : null;
|
|
3239
3242
|
}
|
|
3240
|
-
function
|
|
3243
|
+
function er(e = me) {
|
|
3241
3244
|
return async function(r, n = {}) {
|
|
3242
|
-
const s =
|
|
3245
|
+
const s = Re(e.cookieName);
|
|
3243
3246
|
s || console.warn("CSRF token not found");
|
|
3244
3247
|
const i = new Headers(n.headers);
|
|
3245
3248
|
return s && e.headerName && i.set(e.headerName, s), fetch(r, { ...n, headers: i });
|
|
3246
3249
|
};
|
|
3247
3250
|
}
|
|
3248
|
-
function
|
|
3249
|
-
const t =
|
|
3251
|
+
function tr(e = me) {
|
|
3252
|
+
const t = Re(e.cookieName);
|
|
3250
3253
|
return {
|
|
3251
3254
|
token: t,
|
|
3252
3255
|
inputProps: {
|
|
@@ -3257,7 +3260,7 @@ function Jt(e = me) {
|
|
|
3257
3260
|
headerName: e.headerName
|
|
3258
3261
|
};
|
|
3259
3262
|
}
|
|
3260
|
-
function
|
|
3263
|
+
function Dt(e) {
|
|
3261
3264
|
const t = /* @__PURE__ */ new Map(), r = e.keyGenerator || ((i) => i.url);
|
|
3262
3265
|
function n(i) {
|
|
3263
3266
|
const o = r(i), a = Date.now();
|
|
@@ -3274,8 +3277,8 @@ function wt(e) {
|
|
|
3274
3277
|
}
|
|
3275
3278
|
return { checkLimit: n, reset: s };
|
|
3276
3279
|
}
|
|
3277
|
-
function
|
|
3278
|
-
const t =
|
|
3280
|
+
function rr(e) {
|
|
3281
|
+
const t = Dt(e);
|
|
3279
3282
|
return { checkAndFetch: async (n, s) => {
|
|
3280
3283
|
const i = t.checkLimit({ url: n, method: s == null ? void 0 : s.method });
|
|
3281
3284
|
if (!i.allowed) {
|
|
@@ -3285,7 +3288,7 @@ function Zt(e) {
|
|
|
3285
3288
|
return fetch(n, s);
|
|
3286
3289
|
}, checkLimit: t.checkLimit, reset: t.reset };
|
|
3287
3290
|
}
|
|
3288
|
-
function
|
|
3291
|
+
function Ct(e, t) {
|
|
3289
3292
|
const r = [];
|
|
3290
3293
|
if (t.allowedTypes && t.allowedTypes.length > 0 && (t.allowedTypes.includes(e.type) || r.push(
|
|
3291
3294
|
`File type '${e.type}' is not allowed. Allowed types: ${t.allowedTypes.join(", ")}`
|
|
@@ -3305,7 +3308,7 @@ function St(e, t) {
|
|
|
3305
3308
|
file: r.length === 0 ? e : void 0
|
|
3306
3309
|
};
|
|
3307
3310
|
}
|
|
3308
|
-
function
|
|
3311
|
+
function nr(e, t) {
|
|
3309
3312
|
const r = [], n = [], s = [];
|
|
3310
3313
|
t.maxFiles && e.length > t.maxFiles && r.push(`Too many files. Maximum allowed: ${t.maxFiles}`);
|
|
3311
3314
|
const i = e.reduce((o, a) => o + a.size, 0);
|
|
@@ -3314,7 +3317,7 @@ function Yt(e, t) {
|
|
|
3314
3317
|
r.push(`Total file size (${a}MB) exceeds maximum (${o}MB)`);
|
|
3315
3318
|
}
|
|
3316
3319
|
return e.forEach((o) => {
|
|
3317
|
-
const a =
|
|
3320
|
+
const a = Ct(o, t);
|
|
3318
3321
|
a.valid ? n.push(o) : s.push({ file: o, errors: a.errors });
|
|
3319
3322
|
}), {
|
|
3320
3323
|
valid: r.length === 0 && s.length === 0,
|
|
@@ -3323,7 +3326,7 @@ function Yt(e, t) {
|
|
|
3323
3326
|
invalidFiles: s
|
|
3324
3327
|
};
|
|
3325
3328
|
}
|
|
3326
|
-
async function
|
|
3329
|
+
async function ir(e, t) {
|
|
3327
3330
|
const r = new FormData();
|
|
3328
3331
|
r.append("file", e);
|
|
3329
3332
|
try {
|
|
@@ -3338,7 +3341,7 @@ async function Xt(e, t) {
|
|
|
3338
3341
|
return console.error("Virus scan error:", n), { clean: !1, threat: "Scan failed" };
|
|
3339
3342
|
}
|
|
3340
3343
|
}
|
|
3341
|
-
function
|
|
3344
|
+
function Mt() {
|
|
3342
3345
|
if (typeof localStorage > "u")
|
|
3343
3346
|
return null;
|
|
3344
3347
|
const e = localStorage.getItem("nice2dev_consent");
|
|
@@ -3350,7 +3353,7 @@ function kt() {
|
|
|
3350
3353
|
return null;
|
|
3351
3354
|
}
|
|
3352
3355
|
}
|
|
3353
|
-
function
|
|
3356
|
+
function sr(e) {
|
|
3354
3357
|
typeof localStorage > "u" || localStorage.setItem(
|
|
3355
3358
|
"nice2dev_consent",
|
|
3356
3359
|
JSON.stringify({
|
|
@@ -3361,11 +3364,11 @@ function Qt(e) {
|
|
|
3361
3364
|
})
|
|
3362
3365
|
);
|
|
3363
3366
|
}
|
|
3364
|
-
function
|
|
3365
|
-
const t =
|
|
3367
|
+
function or(e) {
|
|
3368
|
+
const t = Mt();
|
|
3366
3369
|
return t ? t[e] === !0 : !1;
|
|
3367
3370
|
}
|
|
3368
|
-
function
|
|
3371
|
+
function ar(e) {
|
|
3369
3372
|
if (typeof document > "u")
|
|
3370
3373
|
return;
|
|
3371
3374
|
document.cookie.split(";").forEach((r) => {
|
|
@@ -3373,7 +3376,7 @@ function er(e) {
|
|
|
3373
3376
|
e.includes(n) || (document.cookie = `${n}=; expires=Thu, 01 Jan 1970 00:00:00 UTC; path=/;`);
|
|
3374
3377
|
});
|
|
3375
3378
|
}
|
|
3376
|
-
async function
|
|
3379
|
+
async function cr(e, t, r = fetch) {
|
|
3377
3380
|
const n = {
|
|
3378
3381
|
exportDate: (/* @__PURE__ */ new Date()).toISOString(),
|
|
3379
3382
|
userId: e
|
|
@@ -3389,7 +3392,7 @@ async function tr(e, t, r = fetch) {
|
|
|
3389
3392
|
})
|
|
3390
3393
|
), n;
|
|
3391
3394
|
}
|
|
3392
|
-
async function
|
|
3395
|
+
async function lr(e, t, r = fetch) {
|
|
3393
3396
|
try {
|
|
3394
3397
|
const n = await r(t, {
|
|
3395
3398
|
method: "DELETE",
|
|
@@ -3401,7 +3404,7 @@ async function rr(e, t, r = fetch) {
|
|
|
3401
3404
|
return { success: !1, error: String(n) };
|
|
3402
3405
|
}
|
|
3403
3406
|
}
|
|
3404
|
-
function
|
|
3407
|
+
function ur(e, t) {
|
|
3405
3408
|
var n;
|
|
3406
3409
|
const r = {
|
|
3407
3410
|
...e,
|
|
@@ -3414,7 +3417,7 @@ function nr(e, t) {
|
|
|
3414
3417
|
body: JSON.stringify(r)
|
|
3415
3418
|
}).catch(console.error), process.env.NODE_ENV === "development" && console.warn("[HIPAA] PHI Access:", r), r;
|
|
3416
3419
|
}
|
|
3417
|
-
function
|
|
3420
|
+
function dr(e) {
|
|
3418
3421
|
let t = null, r = null, n = Date.now();
|
|
3419
3422
|
const s = e.timeoutMinutes * 60 * 1e3, i = e.warningBeforeMs || 6e4;
|
|
3420
3423
|
function o() {
|
|
@@ -3434,7 +3437,7 @@ function ir(e) {
|
|
|
3434
3437
|
window.addEventListener(f, o, { passive: !0 });
|
|
3435
3438
|
}), { resetTimer: o, destroy: a, getTimeRemaining: g };
|
|
3436
3439
|
}
|
|
3437
|
-
function
|
|
3440
|
+
function hr(e, t) {
|
|
3438
3441
|
const r = (o) => {
|
|
3439
3442
|
const a = o.replace("#", ""), g = parseInt(a.substr(0, 2), 16) / 255, v = parseInt(a.substr(2, 2), 16) / 255, f = parseInt(a.substr(4, 2), 16) / 255, m = (k) => k <= 0.03928 ? k / 12.92 : Math.pow((k + 0.055) / 1.055, 2.4);
|
|
3440
3443
|
return 0.2126 * m(g) + 0.7152 * m(v) + 0.0722 * m(f);
|
|
@@ -3451,7 +3454,7 @@ function sr(e, t) {
|
|
|
3451
3454
|
// Large text enhanced
|
|
3452
3455
|
};
|
|
3453
3456
|
}
|
|
3454
|
-
function
|
|
3457
|
+
function fr(e) {
|
|
3455
3458
|
var r, n, s;
|
|
3456
3459
|
if (e.getAttribute("aria-label"))
|
|
3457
3460
|
return !0;
|
|
@@ -3468,7 +3471,7 @@ function or(e) {
|
|
|
3468
3471
|
}
|
|
3469
3472
|
return !!((s = e.textContent) != null && s.trim() || e.getAttribute("title") || e.placeholder);
|
|
3470
3473
|
}
|
|
3471
|
-
function
|
|
3474
|
+
function yr(e) {
|
|
3472
3475
|
const r = (e || document.body).querySelectorAll("h1, h2, h3, h4, h5, h6"), n = [];
|
|
3473
3476
|
let s = 0, i = !1;
|
|
3474
3477
|
return r.forEach((o) => {
|
|
@@ -3488,7 +3491,7 @@ function ar(e) {
|
|
|
3488
3491
|
issue: "Missing H1 element"
|
|
3489
3492
|
}), { valid: n.length === 0, issues: n };
|
|
3490
3493
|
}
|
|
3491
|
-
function
|
|
3494
|
+
function pr(e) {
|
|
3492
3495
|
const t = [];
|
|
3493
3496
|
let r = null;
|
|
3494
3497
|
const n = e.batchSize || 10, s = e.flushInterval || 5e3;
|
|
@@ -3526,7 +3529,7 @@ function cr(e) {
|
|
|
3526
3529
|
}
|
|
3527
3530
|
return { log: a, flush: i, destroy: g };
|
|
3528
3531
|
}
|
|
3529
|
-
function
|
|
3532
|
+
function gr() {
|
|
3530
3533
|
return [
|
|
3531
3534
|
// Security
|
|
3532
3535
|
{
|
|
@@ -3604,7 +3607,7 @@ function lr() {
|
|
|
3604
3607
|
}
|
|
3605
3608
|
];
|
|
3606
3609
|
}
|
|
3607
|
-
const
|
|
3610
|
+
const mr = {
|
|
3608
3611
|
// Hardcoded secrets
|
|
3609
3612
|
hardcodedSecrets: [
|
|
3610
3613
|
{ pattern: /password\s*[:=]\s*["'][^"']+["']/gi, name: "Hardcoded password" },
|
|
@@ -3641,7 +3644,7 @@ const ur = {
|
|
|
3641
3644
|
{ pattern: /TODO.*password/gi, name: "TODO mentioning password" }
|
|
3642
3645
|
]
|
|
3643
3646
|
};
|
|
3644
|
-
function
|
|
3647
|
+
function vr() {
|
|
3645
3648
|
return `# .github/workflows/sast.yml
|
|
3646
3649
|
name: Security Scan (SAST)
|
|
3647
3650
|
|
|
@@ -3692,7 +3695,7 @@ jobs:
|
|
|
3692
3695
|
uses: github/codeql-action/analyze@v3
|
|
3693
3696
|
`;
|
|
3694
3697
|
}
|
|
3695
|
-
function
|
|
3698
|
+
function br() {
|
|
3696
3699
|
return `# .github/workflows/sca.yml
|
|
3697
3700
|
name: Dependency Security (SCA)
|
|
3698
3701
|
|
|
@@ -3758,7 +3761,7 @@ jobs:
|
|
|
3758
3761
|
args: --severity-threshold=high
|
|
3759
3762
|
`;
|
|
3760
3763
|
}
|
|
3761
|
-
const
|
|
3764
|
+
const xr = [
|
|
3762
3765
|
// API Keys
|
|
3763
3766
|
{ name: "AWS Access Key ID", pattern: /AKIA[0-9A-Z]{16}/g, severity: "critical" },
|
|
3764
3767
|
{ name: "AWS Secret Access Key", pattern: /[A-Za-z0-9/+=]{40}/g, severity: "critical" },
|
|
@@ -3789,7 +3792,7 @@ const fr = [
|
|
|
3789
3792
|
{ name: "Bearer Token", pattern: /bearer [a-zA-Z0-9_\-.=]+/gi, severity: "high" },
|
|
3790
3793
|
{ name: "Connection String", pattern: /[a-z]+:\/\/[^:]+:[^@]+@[^/]+/gi, severity: "critical" }
|
|
3791
3794
|
];
|
|
3792
|
-
function
|
|
3795
|
+
function wr() {
|
|
3793
3796
|
return `#!/bin/sh
|
|
3794
3797
|
# .git/hooks/pre-commit
|
|
3795
3798
|
|
|
@@ -3820,7 +3823,7 @@ echo "No secrets detected."
|
|
|
3820
3823
|
exit 0
|
|
3821
3824
|
`;
|
|
3822
3825
|
}
|
|
3823
|
-
function
|
|
3826
|
+
function Sr() {
|
|
3824
3827
|
return `# .github/workflows/secret-scanning.yml
|
|
3825
3828
|
name: Secret Scanning
|
|
3826
3829
|
|
|
@@ -3858,7 +3861,7 @@ jobs:
|
|
|
3858
3861
|
head: HEAD
|
|
3859
3862
|
`;
|
|
3860
3863
|
}
|
|
3861
|
-
function
|
|
3864
|
+
function kr(e) {
|
|
3862
3865
|
return `# Security Advisory
|
|
3863
3866
|
|
|
3864
3867
|
## ${e.cves.join(", ")} - ${e.description}
|
|
@@ -3906,7 +3909,7 @@ ${e.cves.map((t) => `- [${t}](https://www.cve.org/CVERecord?id=${t})`).join(`
|
|
|
3906
3909
|
`)}
|
|
3907
3910
|
`;
|
|
3908
3911
|
}
|
|
3909
|
-
function
|
|
3912
|
+
function Ar() {
|
|
3910
3913
|
return `# Security Policy
|
|
3911
3914
|
|
|
3912
3915
|
## Supported Versions
|
|
@@ -3977,80 +3980,80 @@ We will not pursue legal action against researchers who:
|
|
|
3977
3980
|
`;
|
|
3978
3981
|
}
|
|
3979
3982
|
export {
|
|
3980
|
-
|
|
3981
|
-
|
|
3982
|
-
|
|
3983
|
-
|
|
3984
|
-
|
|
3985
|
-
|
|
3986
|
-
|
|
3987
|
-
|
|
3988
|
-
|
|
3989
|
-
|
|
3990
|
-
|
|
3991
|
-
|
|
3992
|
-
|
|
3993
|
-
|
|
3994
|
-
|
|
3983
|
+
Ht as NiceDeviceTrust,
|
|
3984
|
+
$t as NiceFaceRecognition,
|
|
3985
|
+
Nt as NiceFingerprintScanner,
|
|
3986
|
+
zt as NiceI18nProvider,
|
|
3987
|
+
Lt as NiceIrisScanner,
|
|
3988
|
+
Ot as NiceMfaSelector,
|
|
3989
|
+
qt as NicePassphraseInput,
|
|
3990
|
+
jt as NicePatternLock,
|
|
3991
|
+
_t as NicePinKeypad,
|
|
3992
|
+
Wt as NiceSecurityAuditLog,
|
|
3993
|
+
Ut as NiceSessionManager,
|
|
3994
|
+
Bt as NiceWebAuthnButton,
|
|
3995
|
+
xr as SECRET_PATTERNS,
|
|
3996
|
+
mr as SECURITY_PATTERNS,
|
|
3997
|
+
rt as authenticateWebAuthn,
|
|
3995
3998
|
le as captureFrame,
|
|
3996
|
-
|
|
3997
|
-
|
|
3999
|
+
hr as checkColorContrast,
|
|
4000
|
+
yr as checkHeadingHierarchy,
|
|
3998
4001
|
Ie as checkLiveness,
|
|
3999
|
-
|
|
4002
|
+
ar as clearNonEssentialCookies,
|
|
4000
4003
|
De as collectDeviceInfo,
|
|
4001
|
-
|
|
4002
|
-
|
|
4003
|
-
|
|
4004
|
-
|
|
4005
|
-
|
|
4006
|
-
|
|
4007
|
-
|
|
4008
|
-
|
|
4004
|
+
Xe as compareFaceToPhoto,
|
|
4005
|
+
pr as createAuditLogger,
|
|
4006
|
+
er as createCSRFFetch,
|
|
4007
|
+
dr as createHIPAASession,
|
|
4008
|
+
Dt as createRateLimiter,
|
|
4009
|
+
Qt as createSafeHtml,
|
|
4010
|
+
Ge as detectIris,
|
|
4011
|
+
It as escapeHtml,
|
|
4009
4012
|
he as extractFaceFeatures,
|
|
4010
|
-
|
|
4011
|
-
|
|
4012
|
-
|
|
4013
|
-
|
|
4014
|
-
|
|
4015
|
-
|
|
4013
|
+
Ue as extractMinutiae,
|
|
4014
|
+
Qe as faceToTemplate,
|
|
4015
|
+
qe as fingerprintToTemplate,
|
|
4016
|
+
Kt as generateCSPHeader,
|
|
4017
|
+
Vt as generateCSRFToken,
|
|
4018
|
+
cr as generateDataExport,
|
|
4016
4019
|
de as generateDeviceFingerprint,
|
|
4017
|
-
|
|
4018
|
-
|
|
4019
|
-
|
|
4020
|
-
|
|
4021
|
-
|
|
4022
|
-
|
|
4023
|
-
|
|
4024
|
-
|
|
4025
|
-
|
|
4020
|
+
Ft as generateLivenessChallenge,
|
|
4021
|
+
Jt as generateNonce,
|
|
4022
|
+
wr as generatePreCommitHook,
|
|
4023
|
+
vr as generateSASTConfig,
|
|
4024
|
+
br as generateSCAConfig,
|
|
4025
|
+
Sr as generateSecretScanningConfig,
|
|
4026
|
+
kr as generateSecurityAdvisory,
|
|
4027
|
+
Ar as generateSecurityMd,
|
|
4028
|
+
Re as getCSRFTokenFromCookie,
|
|
4026
4029
|
pe as getCameraStream,
|
|
4027
|
-
|
|
4028
|
-
|
|
4029
|
-
|
|
4030
|
-
|
|
4031
|
-
|
|
4032
|
-
|
|
4033
|
-
|
|
4030
|
+
Mt as getConsentPreferences,
|
|
4031
|
+
Gt as getRecommendedCSP,
|
|
4032
|
+
gr as getSOC2Checklist,
|
|
4033
|
+
fr as hasAccessibleName,
|
|
4034
|
+
or as hasConsent,
|
|
4035
|
+
Ye as irisToTemplate,
|
|
4036
|
+
et as isPasskeyAvailable,
|
|
4034
4037
|
Ce as isWebAuthnAvailable,
|
|
4035
|
-
|
|
4038
|
+
ur as logPHIAccess,
|
|
4036
4039
|
Te as matchFaces,
|
|
4037
|
-
|
|
4038
|
-
|
|
4039
|
-
|
|
4040
|
-
|
|
4040
|
+
He as matchFingerprints,
|
|
4041
|
+
Je as matchIris,
|
|
4042
|
+
tt as registerWebAuthn,
|
|
4043
|
+
lr as requestDataDeletion,
|
|
4041
4044
|
fe as resolveConfig,
|
|
4042
|
-
|
|
4043
|
-
|
|
4044
|
-
|
|
4045
|
-
|
|
4046
|
-
|
|
4047
|
-
|
|
4048
|
-
|
|
4049
|
-
|
|
4050
|
-
|
|
4045
|
+
Yt as sanitizeInput,
|
|
4046
|
+
Xt as sanitizeSvg,
|
|
4047
|
+
Zt as sanitizeUrl,
|
|
4048
|
+
sr as saveConsentPreferences,
|
|
4049
|
+
ir as scanFileForViruses,
|
|
4050
|
+
Ve as templateToFace,
|
|
4051
|
+
Ke as templateToFingerprint,
|
|
4052
|
+
Ze as templateToIris,
|
|
4053
|
+
tr as useCSRFToken,
|
|
4051
4054
|
te as useNiceTranslation,
|
|
4052
|
-
|
|
4053
|
-
|
|
4054
|
-
|
|
4055
|
+
rr as useRateLimiter,
|
|
4056
|
+
Ct as validateFile,
|
|
4057
|
+
nr as validateFiles,
|
|
4055
4058
|
ge as verifyWithBackend
|
|
4056
4059
|
};
|