@baas-id/react 0.3.1 → 0.3.7
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 +27 -3
- package/dist/esm/baas-id-react.css +1 -1
- package/dist/esm/chunks/ContinueFlow-BzKnkzHf.js +11597 -0
- package/dist/esm/chunks/provider-DqpgUBfH.js +87 -0
- package/dist/esm/continue.js +11 -7
- package/dist/esm/index.js +156 -119
- package/dist/esm/native.js +91 -0
- package/dist/esm/preview.js +220 -181
- package/dist/esm/workers/{detector.worker-DrerkwUk.js → detector.worker-Bpzz3rZ5.js} +1191 -1191
- package/dist/types/continue.d.ts +3 -0
- package/dist/types/index.d.ts +10 -1
- package/dist/types/native.d.ts +38 -0
- package/dist/types/react/DocumentCapture.d.ts +1 -0
- package/dist/types/react/FingerCapture.d.ts +20 -0
- package/dist/types/react/capture/api.d.ts +53 -0
- package/dist/types/react/capture/camera.d.ts +1 -1
- package/dist/types/react/capture/demo.d.ts +10 -0
- package/dist/types/react/capture/index.d.ts +3 -2
- package/dist/types/react/capture/keyframes.d.ts +8 -1
- package/dist/types/react/capture/torch.d.ts +14 -0
- package/dist/types/react/chip/ChipRead.d.ts +21 -0
- package/dist/types/react/chip/capability.d.ts +11 -0
- package/dist/types/react/chip/evidence.d.ts +9 -0
- package/dist/types/react/chip/provider.d.ts +42 -0
- package/dist/types/react/chip/useChipRead.d.ts +32 -0
- package/dist/types/react/chip/webNfcPresence.d.ts +2 -0
- package/dist/types/react/document/DocumentParts.d.ts +1 -0
- package/dist/types/react/document/cornerOrder.d.ts +1 -0
- package/dist/types/react/document/follow.d.ts +26 -0
- package/dist/types/react/document/resolution.d.ts +1 -0
- package/dist/types/react/document/review.d.ts +1 -1
- package/dist/types/react/document/sideCheck.d.ts +1 -0
- package/dist/types/react/document/steady.d.ts +0 -6
- package/dist/types/react/document/upright.d.ts +1 -0
- package/dist/types/react/document/useDocumentCapture.d.ts +23 -2
- package/dist/types/react/face/bestFrame.d.ts +17 -0
- package/dist/types/react/face/faceView.d.ts +3 -0
- package/dist/types/react/face/runLiveness.d.ts +2 -0
- package/dist/types/react/face/useFaceCapture.d.ts +6 -0
- package/dist/types/react/finger/FingerGuide.d.ts +14 -0
- package/dist/types/react/finger/detector.d.ts +39 -0
- package/dist/types/react/finger/qualityGate.d.ts +37 -0
- package/dist/types/react/finger/runFingerCapture.d.ts +77 -0
- package/dist/types/react/finger/upload.d.ts +10 -0
- package/dist/types/react/finger/useFingerCapture.d.ts +31 -0
- package/dist/types/react/flows/FlowShell.d.ts +2 -0
- package/dist/types/react/flows/experience.d.ts +4 -0
- package/dist/types/react/flows/index.d.ts +1 -1
- package/dist/types/react/flows/renewal.d.ts +27 -0
- package/dist/types/react/flows/session.d.ts +5 -1
- package/dist/types/react/flows/state.d.ts +34 -2
- package/dist/types/react/flows/types.d.ts +58 -0
- package/dist/types/react/flows/useFlowSession.d.ts +12 -2
- package/dist/types/react/handoff/ContinueFlow.d.ts +15 -2
- package/dist/types/react/handoff/ContinueOnPhone.d.ts +19 -1
- package/dist/types/react/handoff/api.d.ts +8 -2
- package/dist/types/react/handoff/phoneLink.d.ts +2 -1
- package/dist/types/react/i18n/types.d.ts +45 -3
- package/dist/types/react/preview/FlowPreview.d.ts +1 -0
- package/dist/types/react/telemetry/bus.d.ts +1 -1
- package/dist/types/react/theme/scheme.d.ts +17 -0
- package/dist/types/react/version.d.ts +1 -1
- package/dist/types/react/vision/corners.d.ts +1 -1
- package/dist/types/react/vision/face.d.ts +13 -0
- package/dist/types/react/vision/quality.d.ts +5 -2
- package/dist/types/react/vision/refine.d.ts +71 -0
- package/dist/types/react/vision/resample.d.ts +7 -0
- package/dist/types/react/vision/tinyDetector.d.ts +1 -0
- package/dist/types/react/vision/types.d.ts +3 -1
- package/package.json +6 -1
- package/dist/esm/chunks/ContinueFlow-mqBIxnlp.js +0 -9327
- package/dist/types/react/document/flow.d.ts +0 -52
- package/dist/types/react/document/latch.d.ts +0 -25
package/dist/esm/preview.js
CHANGED
|
@@ -1,100 +1,100 @@
|
|
|
1
1
|
import "./baas-id-react.css";
|
|
2
|
-
/* empty css
|
|
3
|
-
import { jsxs as
|
|
4
|
-
import { useMemo as E, useRef as
|
|
5
|
-
import { t as $, n as K, a as Q, m as Y, b as J, g as
|
|
6
|
-
import {
|
|
7
|
-
function
|
|
8
|
-
let
|
|
9
|
-
return () => (
|
|
2
|
+
/* empty css */
|
|
3
|
+
import { jsxs as C, jsx as d } from "react/jsx-runtime";
|
|
4
|
+
import { useMemo as E, useRef as R, useState as z, useEffect as H } from "react";
|
|
5
|
+
import { t as $, n as K, a as Q, m as Y, b as J, g as B, f as X, d as Z, i as ee, e as te, F as L, H as oe, h as re, j as ie, S as ne, E as se, k as ae, l as le, o as ce, p as de, q as U, s as ue, u as F, v as fe, G as A, w as pe, x as he, y as me, z as ye, A as ge, B as ve } from "./chunks/ContinueFlow-BzKnkzHf.js";
|
|
6
|
+
import { I as Be, J as Le, K as Ue, N as Ge, O as He, L as qe, P as Ve, Q as je, R as We, T as ze, U as $e, V as Ke, W as Qe, X as Ye } from "./chunks/ContinueFlow-BzKnkzHf.js";
|
|
7
|
+
function Se(e) {
|
|
8
|
+
let n = e >>> 0;
|
|
9
|
+
return () => (n = n * 1664525 + 1013904223 >>> 0, n / 4294967296);
|
|
10
10
|
}
|
|
11
|
-
function
|
|
12
|
-
const
|
|
11
|
+
function q(e, n) {
|
|
12
|
+
const r = $(e, n, 0.8), i = 0.012;
|
|
13
13
|
return [
|
|
14
|
-
{ x:
|
|
15
|
-
{ x:
|
|
16
|
-
{ x:
|
|
17
|
-
{ x:
|
|
14
|
+
{ x: r[0].x + i, y: r[0].y + i * 0.6 },
|
|
15
|
+
{ x: r[1].x - i * 0.4, y: r[1].y },
|
|
16
|
+
{ x: r[2].x, y: r[2].y - i * 0.3 },
|
|
17
|
+
{ x: r[3].x + i * 0.5, y: r[3].y - i * 0.8 }
|
|
18
18
|
];
|
|
19
19
|
}
|
|
20
|
-
function
|
|
21
|
-
e.beginPath(), e.moveTo(
|
|
20
|
+
function _(e, n, r, i, s, t) {
|
|
21
|
+
e.beginPath(), e.moveTo(n + t, r), e.arcTo(n + i, r, n + i, r + s, t), e.arcTo(n + i, r + s, n, r + s, t), e.arcTo(n, r + s, n, r, t), e.arcTo(n, r, n + i, r, t), e.closePath();
|
|
22
22
|
}
|
|
23
|
-
function
|
|
24
|
-
const
|
|
25
|
-
|
|
26
|
-
const t = e.createLinearGradient(0, 0,
|
|
27
|
-
t.addColorStop(0, "#E8EEEC"), t.addColorStop(1, "#D5DFDC"), e.fillStyle = t, e.fillRect(0, 0,
|
|
23
|
+
function V(e, n, r, i) {
|
|
24
|
+
const s = r * 0.037;
|
|
25
|
+
_(e, 0, 0, r, i, s), e.save(), e.clip();
|
|
26
|
+
const t = e.createLinearGradient(0, 0, r, i);
|
|
27
|
+
t.addColorStop(0, "#E8EEEC"), t.addColorStop(1, "#D5DFDC"), e.fillStyle = t, e.fillRect(0, 0, r, i), e.strokeStyle = "rgba(19, 94, 110, 0.13)", e.lineWidth = Math.max(0.6, r * 16e-4);
|
|
28
28
|
for (let o = 0; o < 26; o++)
|
|
29
|
-
e.beginPath(), e.ellipse(
|
|
30
|
-
e.fillStyle = "#135E6E", e.fillRect(0, 0,
|
|
29
|
+
e.beginPath(), e.ellipse(r * 0.72, i * 0.55, r * (0.08 + o * 0.012), i * (0.12 + o * 0.016), o * 0.11, 0, Math.PI * 2), e.stroke();
|
|
30
|
+
e.fillStyle = "#135E6E", e.fillRect(0, 0, r, i * 0.13), e.fillStyle = "rgba(255,255,255,0.9)", e.font = `600 ${Math.round(i * 0.06)}px system-ui, sans-serif`, e.textBaseline = "middle", e.fillText(n === "front" ? "IDENTITY CARD · SPECIMEN" : "SPECIMEN", r * 0.05, i * 0.066);
|
|
31
31
|
const l = "rgba(22, 35, 44, 0.55)";
|
|
32
|
-
if (
|
|
33
|
-
const o =
|
|
34
|
-
e.fillStyle = "#B9C7CE",
|
|
35
|
-
const
|
|
36
|
-
[[0.24, 0.3], [0.32, 0.45], [0.44, 0.2], [0.52, 0.38], [0.64, 0.22], [0.72, 0.42]].forEach(([
|
|
37
|
-
e.globalAlpha = h % 2 ? 1 : 0.55, e.fillRect(
|
|
32
|
+
if (n === "front") {
|
|
33
|
+
const o = r * 0.05, a = i * 0.2, c = r * 0.27, f = i * 0.62;
|
|
34
|
+
e.fillStyle = "#B9C7CE", _(e, o, a, c, f, r * 0.012), e.fill(), e.fillStyle = "#8EA2AC", e.beginPath(), e.ellipse(o + c / 2, a + f * 0.38, c * 0.22, f * 0.2, 0, 0, Math.PI * 2), e.fill(), e.beginPath(), e.ellipse(o + c / 2, a + f * 0.98, c * 0.42, f * 0.3, 0, Math.PI, 0), e.fill(), e.fillStyle = l;
|
|
35
|
+
const p = r * 0.37;
|
|
36
|
+
[[0.24, 0.3], [0.32, 0.45], [0.44, 0.2], [0.52, 0.38], [0.64, 0.22], [0.72, 0.42]].forEach(([g, v], h) => {
|
|
37
|
+
e.globalAlpha = h % 2 ? 1 : 0.55, e.fillRect(p, i * g, r * v, i * (h % 2 ? 0.045 : 0.03));
|
|
38
38
|
}), e.globalAlpha = 1;
|
|
39
39
|
} else {
|
|
40
|
-
const o =
|
|
40
|
+
const o = Se(41), a = r * 0.05, c = i * 0.2, f = r * 0.9, p = i * 0.3;
|
|
41
41
|
e.fillStyle = "#16232C";
|
|
42
|
-
const
|
|
43
|
-
for (let h = 0; h <
|
|
44
|
-
o() > 0.5 && e.fillRect(a + h *
|
|
42
|
+
const g = 64, v = 10;
|
|
43
|
+
for (let h = 0; h < g; h++) for (let u = 0; u < v; u++)
|
|
44
|
+
o() > 0.5 && e.fillRect(a + h * f / g, c + u * p / v, f / g + 0.4, p / v + 0.4);
|
|
45
45
|
e.fillStyle = l;
|
|
46
|
-
for (let h = 0; h < 3; h++) e.fillRect(
|
|
46
|
+
for (let h = 0; h < 3; h++) e.fillRect(r * 0.05, i * (0.62 + h * 0.11), r * 0.9, i * 0.055);
|
|
47
47
|
}
|
|
48
|
-
e.save(), e.translate(
|
|
48
|
+
e.save(), e.translate(r / 2, i / 2), e.rotate(-0.2), e.fillStyle = "rgba(178, 67, 78, 0.22)", e.font = `800 ${Math.round(i * 0.2)}px system-ui, sans-serif`, e.textAlign = "center", e.textBaseline = "middle", e.fillText("SPECIMEN", 0, 0), e.restore(), e.restore();
|
|
49
49
|
}
|
|
50
|
-
function
|
|
51
|
-
const
|
|
52
|
-
e.width = Math.round(
|
|
50
|
+
function be(e, n) {
|
|
51
|
+
const r = e.getBoundingClientRect(), i = Math.max(1, r.width || 390), s = Math.max(1, r.height || 300), t = Math.min(2, typeof devicePixelRatio == "number" ? devicePixelRatio : 1);
|
|
52
|
+
e.width = Math.round(i * t), e.height = Math.round(s * t);
|
|
53
53
|
const l = e.getContext("2d");
|
|
54
54
|
if (!l) return;
|
|
55
55
|
l.setTransform(t, 0, 0, t, 0, 0);
|
|
56
|
-
const o = l.createRadialGradient(
|
|
57
|
-
o.addColorStop(0, "#2B3A44"), o.addColorStop(1, "#141D23"), l.fillStyle = o, l.fillRect(0, 0,
|
|
58
|
-
const a =
|
|
59
|
-
l.save(), l.transform((a[1].x - a[0].x) / c, (a[1].y - a[0].y) / c, (a[3].x - a[0].x) /
|
|
56
|
+
const o = l.createRadialGradient(i * 0.5, s * 0.2, 10, i * 0.5, s * 0.6, i);
|
|
57
|
+
o.addColorStop(0, "#2B3A44"), o.addColorStop(1, "#141D23"), l.fillStyle = o, l.fillRect(0, 0, i, s);
|
|
58
|
+
const a = q(i, s).map((p) => ({ x: p.x * i, y: p.y * s })), c = Math.hypot(a[1].x - a[0].x, a[1].y - a[0].y), f = Math.hypot(a[3].x - a[0].x, a[3].y - a[0].y);
|
|
59
|
+
l.save(), l.transform((a[1].x - a[0].x) / c, (a[1].y - a[0].y) / c, (a[3].x - a[0].x) / f, (a[3].y - a[0].y) / f, a[0].x, a[0].y), l.shadowColor = "rgba(0,0,0,0.45)", l.shadowBlur = 18, l.shadowOffsetY = 6, l.fillStyle = "#000", _(l, 0, 0, c, f, c * 0.037), l.fill(), l.shadowColor = "transparent", V(l, n, c, f), l.restore();
|
|
60
60
|
}
|
|
61
|
-
function
|
|
61
|
+
function G(e) {
|
|
62
62
|
if (typeof document > "u") return;
|
|
63
|
-
const
|
|
64
|
-
|
|
65
|
-
const
|
|
66
|
-
if (
|
|
67
|
-
|
|
63
|
+
const n = document.createElement("canvas");
|
|
64
|
+
n.width = 254, n.height = 160;
|
|
65
|
+
const r = n.getContext("2d");
|
|
66
|
+
if (r) {
|
|
67
|
+
V(r, e, 254, 160);
|
|
68
68
|
try {
|
|
69
|
-
return
|
|
69
|
+
return n.toDataURL("image/png");
|
|
70
70
|
} catch {
|
|
71
71
|
return;
|
|
72
72
|
}
|
|
73
73
|
}
|
|
74
74
|
}
|
|
75
|
-
const
|
|
76
|
-
function
|
|
77
|
-
const { w:
|
|
75
|
+
const M = { w: 720, h: 1280 };
|
|
76
|
+
function Ce(e = 0, n = 1) {
|
|
77
|
+
const { w: r, h: i } = M, s = r / 2 + e * 26, t = i * 0.44, l = 160 * n, o = 205 * n, a = e * l * 0.32;
|
|
78
78
|
return {
|
|
79
|
-
cx:
|
|
79
|
+
cx: s,
|
|
80
80
|
cy: t,
|
|
81
81
|
rx: l,
|
|
82
82
|
ry: o,
|
|
83
|
-
eyes: [{ x:
|
|
84
|
-
nose: { x:
|
|
85
|
-
mouth: { x:
|
|
86
|
-
ears: [{ x:
|
|
83
|
+
eyes: [{ x: s - l * 0.36 + a, y: t - o * 0.12 }, { x: s + l * 0.36 + a, y: t - o * 0.12 }],
|
|
84
|
+
nose: { x: s + a * 1.25, y: t + o * 0.12 },
|
|
85
|
+
mouth: { x: s + a * 1.1, y: t + o * 0.43 },
|
|
86
|
+
ears: [{ x: s - l * 0.98 + a * 0.3, y: t }, { x: s + l * 0.98 + a * 0.3, y: t }]
|
|
87
87
|
};
|
|
88
88
|
}
|
|
89
|
-
function
|
|
90
|
-
const { w:
|
|
91
|
-
e.width =
|
|
89
|
+
function ke(e, n = 0, r = 1) {
|
|
90
|
+
const { w: i, h: s } = M;
|
|
91
|
+
e.width = i, e.height = s;
|
|
92
92
|
const t = e.getContext("2d");
|
|
93
93
|
if (!t) return;
|
|
94
|
-
const l = t.createLinearGradient(0, 0, 0,
|
|
95
|
-
l.addColorStop(0, "#5D6E77"), l.addColorStop(1, "#2E3B43"), t.fillStyle = l, t.fillRect(0, 0,
|
|
96
|
-
const o =
|
|
97
|
-
t.fillStyle = "#24343E", t.beginPath(), t.ellipse(
|
|
94
|
+
const l = t.createLinearGradient(0, 0, 0, s);
|
|
95
|
+
l.addColorStop(0, "#5D6E77"), l.addColorStop(1, "#2E3B43"), t.fillStyle = l, t.fillRect(0, 0, i, s);
|
|
96
|
+
const o = Ce(n, r);
|
|
97
|
+
t.fillStyle = "#24343E", t.beginPath(), t.ellipse(i / 2 + n * 10, s * 0.98, i * 0.56 * r, s * 0.28 * r, 0, Math.PI, 0), t.fill(), t.fillStyle = "#B88C73", t.fillRect(o.cx - o.rx * 0.36, o.cy + o.ry * 0.6, o.rx * 0.72, o.ry * 0.65);
|
|
98
98
|
const a = t.createRadialGradient(o.cx - o.rx * 0.3, o.cy - o.ry * 0.3, 10, o.cx, o.cy, o.ry * 1.1);
|
|
99
99
|
a.addColorStop(0, "#D8AE92"), a.addColorStop(1, "#B98A6E"), t.fillStyle = a, t.beginPath(), t.ellipse(o.cx, o.cy, o.rx, o.ry, 0, 0, Math.PI * 2), t.fill(), t.fillStyle = "#B4856A";
|
|
100
100
|
for (const c of o.ears)
|
|
@@ -107,72 +107,72 @@ function Se(e, r = 0, n = 1) {
|
|
|
107
107
|
t.beginPath(), t.ellipse(c.x, c.y, 24, 13, 0, 0, Math.PI * 2), t.fill();
|
|
108
108
|
t.fillStyle = "#3B2A20";
|
|
109
109
|
for (const c of o.eyes)
|
|
110
|
-
t.beginPath(), t.arc(c.x +
|
|
110
|
+
t.beginPath(), t.arc(c.x + n * 6, c.y, 9, 0, Math.PI * 2), t.fill();
|
|
111
111
|
t.strokeStyle = "rgba(120, 78, 58, 0.7)", t.lineWidth = 6, t.beginPath(), t.moveTo(o.nose.x - 4, o.nose.y - 60), t.quadraticCurveTo(o.nose.x + 10, o.nose.y, o.nose.x - 12, o.nose.y + 6), t.stroke(), t.strokeStyle = "#8A4C42", t.lineWidth = 8, t.beginPath(), t.moveTo(o.mouth.x - 46, o.mouth.y), t.quadraticCurveTo(o.mouth.x, o.mouth.y + 22, o.mouth.x + 46, o.mouth.y), t.stroke();
|
|
112
112
|
}
|
|
113
|
-
const
|
|
114
|
-
function
|
|
115
|
-
const
|
|
116
|
-
if (!
|
|
117
|
-
const
|
|
118
|
-
if (!
|
|
119
|
-
const
|
|
120
|
-
for (const [
|
|
121
|
-
for (const [l, o] of Object.entries(t ?? {})) (
|
|
122
|
-
return
|
|
113
|
+
const w = "k7qxm2dpa4vbn6tr3hsy5ecwz2";
|
|
114
|
+
function Me(e) {
|
|
115
|
+
const n = e && typeof e == "object" ? e : null;
|
|
116
|
+
if (!n) return;
|
|
117
|
+
const r = n.reasons && typeof n.reasons == "object" ? n.reasons : null;
|
|
118
|
+
if (!r) return U(n);
|
|
119
|
+
const i = {};
|
|
120
|
+
for (const [s, t] of Object.entries(r))
|
|
121
|
+
for (const [l, o] of Object.entries(t ?? {})) (i[l] ?? (i[l] = {}))[s] = o;
|
|
122
|
+
return U(i);
|
|
123
123
|
}
|
|
124
|
-
const
|
|
124
|
+
const Ee = {
|
|
125
125
|
enrollment: { verdict: "VERIFIED", purpose: "enrollment", reason: null, score: 0.8412, assurance: "pilot", policy_version: "preview" },
|
|
126
126
|
signin: { verdict: "VERIFIED", purpose: "signin", reason: null, score: 0.8806, assurance: "pilot", policy_version: "preview" },
|
|
127
127
|
reverification: { verdict: "VERIFIED", purpose: "reverification", reason: null, score: 0.8517, assurance: "pilot", policy_version: "preview" },
|
|
128
128
|
identify: { verdict: "VERIFIED", purpose: "identify", reason: null, score: 0.8633, assurance: "pilot", policy_version: "preview" }
|
|
129
129
|
};
|
|
130
|
-
function
|
|
130
|
+
function Ne(e) {
|
|
131
131
|
const {
|
|
132
|
-
screen:
|
|
133
|
-
step:
|
|
134
|
-
challenge:
|
|
135
|
-
purpose:
|
|
132
|
+
screen: n,
|
|
133
|
+
step: r = "front",
|
|
134
|
+
challenge: i = "center",
|
|
135
|
+
purpose: s = "enrollment",
|
|
136
136
|
locale: t,
|
|
137
137
|
errorCode: l = "FACE_MISMATCH",
|
|
138
138
|
documentSides: o,
|
|
139
139
|
document: a = !0,
|
|
140
140
|
challenges: c = 2,
|
|
141
|
-
privacyNote:
|
|
142
|
-
formality:
|
|
143
|
-
} = e,
|
|
141
|
+
privacyNote: f,
|
|
142
|
+
formality: p = "informal"
|
|
143
|
+
} = e, g = E(() => K(e.appearance), [e.appearance]), v = E(() => Q(e.instructions), [e.instructions]), h = E(() => Me(e.messages), [e.messages]), u = E(() => {
|
|
144
144
|
const y = Y(
|
|
145
|
-
X(t,
|
|
146
|
-
J(h, t,
|
|
145
|
+
X(t, p),
|
|
146
|
+
J(h, t, B(t, void 0, p))
|
|
147
147
|
);
|
|
148
|
-
return { t:
|
|
149
|
-
}, [h, t,
|
|
150
|
-
front:
|
|
151
|
-
back:
|
|
152
|
-
}), [
|
|
153
|
-
if (
|
|
154
|
-
const y = e.handoff ?? {},
|
|
155
|
-
return /* @__PURE__ */
|
|
156
|
-
|
|
148
|
+
return { t: B(t, y, p), overrides: y };
|
|
149
|
+
}, [h, t, p]), S = Z(s, { document: a, documentSides: o, ...e.steps ? { steps: e.steps } : {} }), b = S.includes(r) ? r : S[0], m = n === "success" ? { k: "done", result: Ee[s] } : n === "error" ? { k: "failed", reason: l } : ue(b), k = n === "intro" && ee(b, v), T = te(b, t, u.t, v), N = m.k === "doc" || m.k === "face" || m.k === "chip" || m.k === "finger", D = S.length > 1, x = E(() => ({
|
|
150
|
+
front: b !== "front" && S.includes("front") ? G("front") : void 0,
|
|
151
|
+
back: b === "face" && S.includes("back") ? G("back") : void 0
|
|
152
|
+
}), [b, S.join()]);
|
|
153
|
+
if (n === "handoff" || n === "continue" || n === "continueDone") {
|
|
154
|
+
const y = e.handoff ?? {}, O = y.copy?.[t] ?? null, P = y.tenant || "Acme", I = w.slice(-4).toUpperCase(), j = y.continueUrl ? y.continueUrl.includes("{code}") ? y.continueUrl.replace("{code}", w) : `${y.continueUrl}${y.continueUrl.includes("?") ? "&" : "?"}h=${w}` : `https://baaslatam.com/c/${w}`, W = n === "handoff" ? O?.title || u.t.handoff.title : n === "continue" ? u.t.handoff.phoneTitle : u.t.handoff.doneTitle;
|
|
155
|
+
return /* @__PURE__ */ C(
|
|
156
|
+
L,
|
|
157
157
|
{
|
|
158
158
|
step: { k: "opening" },
|
|
159
|
-
purpose:
|
|
160
|
-
t:
|
|
161
|
-
privacy:
|
|
162
|
-
appearance:
|
|
159
|
+
purpose: s,
|
|
160
|
+
t: u.t,
|
|
161
|
+
privacy: f,
|
|
162
|
+
appearance: g,
|
|
163
163
|
forceAppearance: !0,
|
|
164
164
|
manageFocus: !1,
|
|
165
165
|
colorScheme: e.colorScheme,
|
|
166
|
-
screen:
|
|
167
|
-
title:
|
|
166
|
+
screen: n === "handoff" ? "handoff" : n === "continue" ? "confirm" : "done",
|
|
167
|
+
title: W,
|
|
168
168
|
children: [
|
|
169
|
-
|
|
170
|
-
|
|
169
|
+
n === "handoff" && /* @__PURE__ */ d(
|
|
170
|
+
oe,
|
|
171
171
|
{
|
|
172
|
-
t:
|
|
172
|
+
t: u.t,
|
|
173
173
|
mode: y.mode ?? "suggest",
|
|
174
|
-
copy:
|
|
175
|
-
link: { url:
|
|
174
|
+
copy: O,
|
|
175
|
+
link: { url: j, codeHint: I, tenant: P },
|
|
176
176
|
leftMs: (y.ttlMinutes ?? 10) * 6e4 - 18e3,
|
|
177
177
|
expired: !1,
|
|
178
178
|
failed: !1,
|
|
@@ -183,144 +183,183 @@ function Fe(e) {
|
|
|
183
183
|
}
|
|
184
184
|
}
|
|
185
185
|
),
|
|
186
|
-
|
|
187
|
-
|
|
186
|
+
n === "continue" && /* @__PURE__ */ d(re, { t: u.t, tenant: P, codeHint: I }),
|
|
187
|
+
n === "continueDone" && /* @__PURE__ */ d(ie, { t: u.t, tenant: P, codeHint: I })
|
|
188
188
|
]
|
|
189
189
|
}
|
|
190
190
|
);
|
|
191
191
|
}
|
|
192
|
-
return /* @__PURE__ */
|
|
193
|
-
|
|
192
|
+
return /* @__PURE__ */ C(
|
|
193
|
+
L,
|
|
194
194
|
{
|
|
195
|
-
step:
|
|
196
|
-
purpose:
|
|
197
|
-
t:
|
|
198
|
-
privacy:
|
|
199
|
-
appearance:
|
|
195
|
+
step: m,
|
|
196
|
+
purpose: s,
|
|
197
|
+
t: u.t,
|
|
198
|
+
privacy: f,
|
|
199
|
+
appearance: g,
|
|
200
200
|
forceAppearance: !0,
|
|
201
201
|
manageFocus: !1,
|
|
202
202
|
colorScheme: e.colorScheme,
|
|
203
203
|
screen: k ? "intro" : void 0,
|
|
204
|
-
title: k ?
|
|
204
|
+
title: k ? T.title : de(m, s, u.t),
|
|
205
205
|
children: [
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
k && /* @__PURE__ */
|
|
209
|
-
|
|
206
|
+
N && D && /* @__PURE__ */ d(ne, { step: m, t: u.t, plan: S }),
|
|
207
|
+
N && D && (x.front || x.back) && /* @__PURE__ */ d(se, { thumbs: x, t: u.t, plan: S }),
|
|
208
|
+
k && /* @__PURE__ */ d(
|
|
209
|
+
ae,
|
|
210
210
|
{
|
|
211
|
-
step:
|
|
212
|
-
body:
|
|
213
|
-
t:
|
|
214
|
-
movements:
|
|
215
|
-
sessionMinutes:
|
|
211
|
+
step: b,
|
|
212
|
+
body: T.body,
|
|
213
|
+
t: u.t,
|
|
214
|
+
movements: b === "face" ? c : void 0,
|
|
215
|
+
sessionMinutes: S.indexOf(b) === 0 ? 15 : null,
|
|
216
216
|
onStart: () => {
|
|
217
217
|
}
|
|
218
218
|
}
|
|
219
219
|
),
|
|
220
|
-
!k &&
|
|
221
|
-
!k &&
|
|
222
|
-
|
|
223
|
-
|
|
220
|
+
!k && m.k === "doc" && /* @__PURE__ */ d(xe, { side: m.side, t: u.t }),
|
|
221
|
+
!k && m.k === "face" && /* @__PURE__ */ d(Ie, { challenge: i, count: c, t: u.t }),
|
|
222
|
+
!k && m.k === "chip" && /* @__PURE__ */ d(Re, { t: u.t }),
|
|
223
|
+
!k && m.k === "finger" && /* @__PURE__ */ d(we, { t: u.t }),
|
|
224
|
+
m.k === "done" && /* @__PURE__ */ d(le, { result: m.result, t: u.t }),
|
|
225
|
+
m.k === "failed" && /* @__PURE__ */ d(ce, { reason: l, locale: t, t: u.t, overrides: u.overrides, onRestart: () => {
|
|
224
226
|
}, takeFocus: !1 })
|
|
225
227
|
]
|
|
226
228
|
}
|
|
227
229
|
);
|
|
228
230
|
}
|
|
229
|
-
function
|
|
230
|
-
|
|
231
|
-
|
|
232
|
-
|
|
231
|
+
function Re({ t: e }) {
|
|
232
|
+
return /* @__PURE__ */ C("div", { className: "baas-id-scope rpid-chip", "data-rpid-chip": "waiting", "data-rpid-preview": !0, children: [
|
|
233
|
+
/* @__PURE__ */ d("div", { className: "rpid-chip-stage", "data-active": !0, children: /* @__PURE__ */ C("svg", { className: "rpid-chip-art", viewBox: "0 0 200 120", "aria-hidden": "true", focusable: "false", children: [
|
|
234
|
+
/* @__PURE__ */ d("rect", { className: "rpid-chip-card", x: "18", y: "44", width: "124", height: "70", rx: "8" }),
|
|
235
|
+
/* @__PURE__ */ d("rect", { className: "rpid-chip-portrait", x: "28", y: "56", width: "28", height: "36", rx: "3" }),
|
|
236
|
+
/* @__PURE__ */ d("path", { className: "rpid-chip-lines", d: "M66 60h52M66 70h40M66 80h46M28 102h104" }),
|
|
237
|
+
/* @__PURE__ */ d("rect", { className: "rpid-chip-die", x: "104", y: "88", width: "16", height: "12", rx: "2" }),
|
|
238
|
+
/* @__PURE__ */ d("rect", { className: "rpid-chip-phone", x: "96", y: "6", width: "62", height: "104", rx: "10" }),
|
|
239
|
+
/* @__PURE__ */ d("path", { className: "rpid-chip-speaker", d: "M118 16h18" }),
|
|
240
|
+
/* @__PURE__ */ C("g", { className: "rpid-chip-waves", children: [
|
|
241
|
+
/* @__PURE__ */ d("path", { d: "M118 74a12 12 0 0 1 16 0" }),
|
|
242
|
+
/* @__PURE__ */ d("path", { d: "M112 66a21 21 0 0 1 28 0" }),
|
|
243
|
+
/* @__PURE__ */ d("path", { d: "M106 58a30 30 0 0 1 40 0" })
|
|
244
|
+
] })
|
|
245
|
+
] }) }),
|
|
246
|
+
/* @__PURE__ */ d("p", { className: "rpid-chip-status", role: "status", children: e.chip.place }),
|
|
247
|
+
/* @__PURE__ */ d("div", { className: "rpid-chip-actions", children: /* @__PURE__ */ d("button", { type: "button", className: "rpid-action rpid-action-quiet", tabIndex: -1, children: e.chip.skip }) })
|
|
248
|
+
] });
|
|
249
|
+
}
|
|
250
|
+
function we({ t: e }) {
|
|
251
|
+
const n = R(null), r = R(null), i = { w: 960, h: 1280 }, s = ge(["right_little", "right_ring", "right_middle", "right_index"], i.w / i.h);
|
|
252
|
+
return /* @__PURE__ */ d("div", { className: "baas-id-scope rpid-finger-capture", "data-rpid-preview": !0, children: /* @__PURE__ */ C(
|
|
253
|
+
F,
|
|
254
|
+
{
|
|
255
|
+
className: "rpid-viewport rpid-finger rpid-holding",
|
|
256
|
+
attrs: { "data-rpid-finger-phase": "holding" },
|
|
257
|
+
style: { "--rpid-video-ar": (i.w / i.h).toFixed(4) },
|
|
258
|
+
source: "demo",
|
|
259
|
+
videoRef: n,
|
|
260
|
+
canvasRef: r,
|
|
261
|
+
children: [
|
|
262
|
+
/* @__PURE__ */ d(ve, { src: i, slots: s, states: ["good", "good", "found", "good"], hold: 0.4, t: e }),
|
|
263
|
+
/* @__PURE__ */ d(A, { tone: "info", marker: !0, children: e.guide.hold_fingers_still })
|
|
264
|
+
]
|
|
265
|
+
}
|
|
266
|
+
) });
|
|
267
|
+
}
|
|
268
|
+
function xe({ side: e, t: n }) {
|
|
269
|
+
const r = R(null), i = R(null), [s, t] = z({ w: 0, h: 0 });
|
|
270
|
+
H(() => {
|
|
271
|
+
const o = i.current;
|
|
233
272
|
if (!o) return;
|
|
234
273
|
const a = () => {
|
|
235
|
-
const
|
|
236
|
-
t((
|
|
274
|
+
const f = o.getBoundingClientRect();
|
|
275
|
+
t((p) => Math.abs(p.w - f.width) < 0.5 && Math.abs(p.h - f.height) < 0.5 ? p : { w: f.width, h: f.height }), be(o, e);
|
|
237
276
|
};
|
|
238
277
|
if (a(), typeof ResizeObserver > "u") return;
|
|
239
278
|
const c = new ResizeObserver(a);
|
|
240
279
|
return c.observe(o), () => c.disconnect();
|
|
241
280
|
}, [e]);
|
|
242
281
|
const l = E(() => {
|
|
243
|
-
const o =
|
|
282
|
+
const o = q(s.w || 4, s.h || 3);
|
|
244
283
|
return { at: () => o, info: () => ({ kind: "edges", locks: [!0, !0, !0, !0] }) };
|
|
245
|
-
}, [
|
|
246
|
-
return /* @__PURE__ */
|
|
247
|
-
|
|
284
|
+
}, [s.w, s.h]);
|
|
285
|
+
return /* @__PURE__ */ d("div", { className: "baas-id-scope rpid-doc-capture", "data-rpid-preview": !0, children: /* @__PURE__ */ C(
|
|
286
|
+
F,
|
|
248
287
|
{
|
|
249
288
|
className: "rpid-viewport rpid-doc rpid-locked",
|
|
250
289
|
attrs: { "data-rpid-side": e, "data-rpid-frame": "holding" },
|
|
251
290
|
source: "demo",
|
|
252
|
-
videoRef:
|
|
253
|
-
canvasRef:
|
|
291
|
+
videoRef: r,
|
|
292
|
+
canvasRef: i,
|
|
254
293
|
children: [
|
|
255
|
-
/* @__PURE__ */
|
|
256
|
-
/* @__PURE__ */
|
|
294
|
+
/* @__PURE__ */ d(fe, { source: s.w ? l : null, pct: 0.62, state: "holding", t: n }),
|
|
295
|
+
/* @__PURE__ */ d(A, { tone: "ok", children: /* @__PURE__ */ d("span", { className: "rpid-guide-line", children: n.guide.steady }) })
|
|
257
296
|
]
|
|
258
297
|
}
|
|
259
298
|
) });
|
|
260
299
|
}
|
|
261
|
-
const
|
|
300
|
+
const Pe = {
|
|
262
301
|
center: ["turn_left", "move_closer"],
|
|
263
302
|
turn_left: ["turn_left", "move_closer"],
|
|
264
303
|
turn_right: ["turn_right", "move_closer"],
|
|
265
304
|
move_closer: ["turn_left", "move_closer"]
|
|
266
305
|
};
|
|
267
|
-
function
|
|
268
|
-
const
|
|
306
|
+
function Ie({ challenge: e, count: n, t: r }) {
|
|
307
|
+
const i = R(null), s = R(null), t = Pe[e].slice(0, Math.max(1, Math.min(3, n)));
|
|
269
308
|
e !== "center" && !t.includes(e) && (t[t.length - 1] = e);
|
|
270
309
|
const l = e === "center" ? -1 : t.indexOf(e), o = e === "turn_left" ? -0.55 : e === "turn_right" ? 0.55 : 0, a = e === "move_closer" ? 1.12 : 1;
|
|
271
|
-
|
|
272
|
-
|
|
310
|
+
H(() => {
|
|
311
|
+
s.current && ke(s.current, o, a);
|
|
273
312
|
}, [o, a]);
|
|
274
|
-
const c =
|
|
275
|
-
return /* @__PURE__ */
|
|
276
|
-
/* @__PURE__ */
|
|
277
|
-
|
|
313
|
+
const c = pe({ videoWidth: M.w, videoHeight: M.h }), f = e === "center" ? null : e, p = e === "center" ? "perfect" : e === "move_closer" ? "closer_more" : e, g = e === "center" ? 0 : 0.45, v = he({ step: l, total: t.length, hold: 0.65, progress: g, done: !1 }), h = { "--rpid-video-ar": (M.w / M.h).toFixed(4) };
|
|
314
|
+
return /* @__PURE__ */ C("div", { className: "baas-id-scope", "data-rpid-preview": !0, children: [
|
|
315
|
+
/* @__PURE__ */ C(
|
|
316
|
+
F,
|
|
278
317
|
{
|
|
279
318
|
className: `rpid-viewport rpid-face rpid-${e === "center" ? "searching" : "locked"}`,
|
|
280
319
|
attrs: { "data-rpid-guide-state": e === "center" ? "aligned" : "capturing" },
|
|
281
320
|
style: h,
|
|
282
321
|
source: "demo",
|
|
283
|
-
videoRef:
|
|
284
|
-
canvasRef:
|
|
322
|
+
videoRef: i,
|
|
323
|
+
canvasRef: s,
|
|
285
324
|
mirror: !0,
|
|
286
325
|
children: [
|
|
287
|
-
/* @__PURE__ */
|
|
288
|
-
|
|
326
|
+
/* @__PURE__ */ d(
|
|
327
|
+
me,
|
|
289
328
|
{
|
|
290
|
-
src:
|
|
329
|
+
src: M,
|
|
291
330
|
oval: c,
|
|
292
331
|
state: e === "center" ? "aligned" : "capturing",
|
|
293
332
|
scan: e === "center" ? "aligned" : "challenge",
|
|
294
|
-
fills:
|
|
295
|
-
progress:
|
|
296
|
-
cue:
|
|
297
|
-
guide:
|
|
298
|
-
t:
|
|
333
|
+
fills: v,
|
|
334
|
+
progress: g,
|
|
335
|
+
cue: f,
|
|
336
|
+
guide: p,
|
|
337
|
+
t: r
|
|
299
338
|
}
|
|
300
339
|
),
|
|
301
|
-
/* @__PURE__ */
|
|
340
|
+
/* @__PURE__ */ d(A, { tone: "ok", marker: !0, children: e === "center" ? r.guide.perfect : r.guide[p] })
|
|
302
341
|
]
|
|
303
342
|
}
|
|
304
343
|
),
|
|
305
|
-
/* @__PURE__ */
|
|
344
|
+
/* @__PURE__ */ d(ye, { script: t, step: l, t: r })
|
|
306
345
|
] });
|
|
307
346
|
}
|
|
308
347
|
export {
|
|
309
|
-
|
|
310
|
-
|
|
311
|
-
|
|
312
|
-
|
|
313
|
-
|
|
314
|
-
|
|
315
|
-
|
|
316
|
-
|
|
317
|
-
|
|
318
|
-
|
|
319
|
-
|
|
320
|
-
|
|
321
|
-
|
|
322
|
-
|
|
323
|
-
|
|
324
|
-
|
|
325
|
-
|
|
348
|
+
Be as CONTRAST_PAIRS,
|
|
349
|
+
Le as DARK,
|
|
350
|
+
Ue as DEFAULT_COLORS,
|
|
351
|
+
Ge as DEFAULT_RADIUS,
|
|
352
|
+
He as FONT_STACKS,
|
|
353
|
+
Ne as FlowPreview,
|
|
354
|
+
qe as LOCALES,
|
|
355
|
+
Ve as SDK_DEFAULTS,
|
|
356
|
+
je as appearanceGroups,
|
|
357
|
+
We as appearanceStyle,
|
|
358
|
+
ze as contrastChecks,
|
|
359
|
+
$e as contrastRatio,
|
|
360
|
+
Ke as darkPalette,
|
|
361
|
+
B as getStrings,
|
|
362
|
+
te as introFor,
|
|
363
|
+
Qe as liftOn,
|
|
364
|
+
Ye as parseIntroBody
|
|
326
365
|
};
|