@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.
Files changed (73) hide show
  1. package/README.md +27 -3
  2. package/dist/esm/baas-id-react.css +1 -1
  3. package/dist/esm/chunks/ContinueFlow-BzKnkzHf.js +11597 -0
  4. package/dist/esm/chunks/provider-DqpgUBfH.js +87 -0
  5. package/dist/esm/continue.js +11 -7
  6. package/dist/esm/index.js +156 -119
  7. package/dist/esm/native.js +91 -0
  8. package/dist/esm/preview.js +220 -181
  9. package/dist/esm/workers/{detector.worker-DrerkwUk.js → detector.worker-Bpzz3rZ5.js} +1191 -1191
  10. package/dist/types/continue.d.ts +3 -0
  11. package/dist/types/index.d.ts +10 -1
  12. package/dist/types/native.d.ts +38 -0
  13. package/dist/types/react/DocumentCapture.d.ts +1 -0
  14. package/dist/types/react/FingerCapture.d.ts +20 -0
  15. package/dist/types/react/capture/api.d.ts +53 -0
  16. package/dist/types/react/capture/camera.d.ts +1 -1
  17. package/dist/types/react/capture/demo.d.ts +10 -0
  18. package/dist/types/react/capture/index.d.ts +3 -2
  19. package/dist/types/react/capture/keyframes.d.ts +8 -1
  20. package/dist/types/react/capture/torch.d.ts +14 -0
  21. package/dist/types/react/chip/ChipRead.d.ts +21 -0
  22. package/dist/types/react/chip/capability.d.ts +11 -0
  23. package/dist/types/react/chip/evidence.d.ts +9 -0
  24. package/dist/types/react/chip/provider.d.ts +42 -0
  25. package/dist/types/react/chip/useChipRead.d.ts +32 -0
  26. package/dist/types/react/chip/webNfcPresence.d.ts +2 -0
  27. package/dist/types/react/document/DocumentParts.d.ts +1 -0
  28. package/dist/types/react/document/cornerOrder.d.ts +1 -0
  29. package/dist/types/react/document/follow.d.ts +26 -0
  30. package/dist/types/react/document/resolution.d.ts +1 -0
  31. package/dist/types/react/document/review.d.ts +1 -1
  32. package/dist/types/react/document/sideCheck.d.ts +1 -0
  33. package/dist/types/react/document/steady.d.ts +0 -6
  34. package/dist/types/react/document/upright.d.ts +1 -0
  35. package/dist/types/react/document/useDocumentCapture.d.ts +23 -2
  36. package/dist/types/react/face/bestFrame.d.ts +17 -0
  37. package/dist/types/react/face/faceView.d.ts +3 -0
  38. package/dist/types/react/face/runLiveness.d.ts +2 -0
  39. package/dist/types/react/face/useFaceCapture.d.ts +6 -0
  40. package/dist/types/react/finger/FingerGuide.d.ts +14 -0
  41. package/dist/types/react/finger/detector.d.ts +39 -0
  42. package/dist/types/react/finger/qualityGate.d.ts +37 -0
  43. package/dist/types/react/finger/runFingerCapture.d.ts +77 -0
  44. package/dist/types/react/finger/upload.d.ts +10 -0
  45. package/dist/types/react/finger/useFingerCapture.d.ts +31 -0
  46. package/dist/types/react/flows/FlowShell.d.ts +2 -0
  47. package/dist/types/react/flows/experience.d.ts +4 -0
  48. package/dist/types/react/flows/index.d.ts +1 -1
  49. package/dist/types/react/flows/renewal.d.ts +27 -0
  50. package/dist/types/react/flows/session.d.ts +5 -1
  51. package/dist/types/react/flows/state.d.ts +34 -2
  52. package/dist/types/react/flows/types.d.ts +58 -0
  53. package/dist/types/react/flows/useFlowSession.d.ts +12 -2
  54. package/dist/types/react/handoff/ContinueFlow.d.ts +15 -2
  55. package/dist/types/react/handoff/ContinueOnPhone.d.ts +19 -1
  56. package/dist/types/react/handoff/api.d.ts +8 -2
  57. package/dist/types/react/handoff/phoneLink.d.ts +2 -1
  58. package/dist/types/react/i18n/types.d.ts +45 -3
  59. package/dist/types/react/preview/FlowPreview.d.ts +1 -0
  60. package/dist/types/react/telemetry/bus.d.ts +1 -1
  61. package/dist/types/react/theme/scheme.d.ts +17 -0
  62. package/dist/types/react/version.d.ts +1 -1
  63. package/dist/types/react/vision/corners.d.ts +1 -1
  64. package/dist/types/react/vision/face.d.ts +13 -0
  65. package/dist/types/react/vision/quality.d.ts +5 -2
  66. package/dist/types/react/vision/refine.d.ts +71 -0
  67. package/dist/types/react/vision/resample.d.ts +7 -0
  68. package/dist/types/react/vision/tinyDetector.d.ts +1 -0
  69. package/dist/types/react/vision/types.d.ts +3 -1
  70. package/package.json +6 -1
  71. package/dist/esm/chunks/ContinueFlow-mqBIxnlp.js +0 -9327
  72. package/dist/types/react/document/flow.d.ts +0 -52
  73. package/dist/types/react/document/latch.d.ts +0 -25
@@ -0,0 +1,87 @@
1
+ var A = Object.defineProperty;
2
+ var I = (r, e, t) => e in r ? A(r, e, { enumerable: !0, configurable: !0, writable: !0, value: t }) : r[e] = t;
3
+ var C = (r, e, t) => I(r, typeof e != "symbol" ? e + "" : e, t);
4
+ const S = ["ACCESS_DENIED", "TIMEOUT", "NFC_OFF", "NO_CHIP", "READ_FAILED"];
5
+ class _ extends Error {
6
+ constructor(t, n) {
7
+ super(n ?? t);
8
+ C(this, "code");
9
+ this.name = "ChipReadError", this.code = t;
10
+ }
11
+ }
12
+ const N = {
13
+ ACCESS_DENIED: "ACCESS_DENIED",
14
+ BAC_DENIED: "ACCESS_DENIED",
15
+ PACE_DENIED: "ACCESS_DENIED",
16
+ AUTH_FAILED: "ACCESS_DENIED",
17
+ INVALID_MRZ_KEY: "ACCESS_DENIED",
18
+ WRONG_MRZ: "ACCESS_DENIED",
19
+ SECURITY_STATUS_NOT_SATISFIED: "ACCESS_DENIED",
20
+ TIMEOUT: "TIMEOUT",
21
+ TIMED_OUT: "TIMEOUT",
22
+ SESSION_TIMEOUT: "TIMEOUT",
23
+ TAG_LOST: "TIMEOUT",
24
+ NFC_OFF: "NFC_OFF",
25
+ NFC_DISABLED: "NFC_OFF",
26
+ NFC_NOT_ENABLED: "NFC_OFF",
27
+ NO_CHIP: "NO_CHIP",
28
+ NOT_SUPPORTED: "NO_CHIP",
29
+ NO_NFC: "NO_CHIP",
30
+ NFC_UNSUPPORTED: "NO_CHIP",
31
+ TAG_NOT_SUPPORTED: "NO_CHIP",
32
+ READ_FAILED: "READ_FAILED"
33
+ };
34
+ function O(r) {
35
+ if (r instanceof _ || r?.name === "AbortError") return r;
36
+ const t = r?.code ?? (typeof r == "string" ? r : r?.message), n = typeof t == "string" ? t.trim().toUpperCase().replace(/[\s-]+/g, "_") : "", E = N[n] ?? (S.includes(n) ? n : "READ_FAILED");
37
+ return new _(E, typeof r?.message == "string" ? r.message : void 0);
38
+ }
39
+ function D(r) {
40
+ if (r instanceof Uint8Array) return r;
41
+ if (r instanceof ArrayBuffer) return new Uint8Array(r);
42
+ if (Array.isArray(r) && r.every((e) => typeof e == "number")) return Uint8Array.from(r);
43
+ if (typeof r == "string" && r)
44
+ try {
45
+ const e = atob(r.replace(/-/g, "+").replace(/_/g, "/"));
46
+ return Uint8Array.from(e, (t) => t.charCodeAt(0));
47
+ } catch {
48
+ return null;
49
+ }
50
+ return null;
51
+ }
52
+ function f(r, e) {
53
+ return {
54
+ name: r,
55
+ async read(t) {
56
+ if (t.signal.aborted) throw new DOMException("aborted", "AbortError");
57
+ let n;
58
+ try {
59
+ n = await new Promise((a, i) => {
60
+ const o = () => i(new DOMException("aborted", "AbortError"));
61
+ t.signal.addEventListener("abort", o, { once: !0 }), e(t).then(a, i).finally(() => t.signal.removeEventListener("abort", o));
62
+ });
63
+ } catch (a) {
64
+ throw O(a);
65
+ }
66
+ const E = D(n?.sod), s = {};
67
+ for (const [a, i] of Object.entries(n?.dataGroups ?? {})) {
68
+ const o = D(i);
69
+ o && (s[a.toUpperCase()] = o);
70
+ }
71
+ if (!E || !s.DG1 || !s.DG2) throw new _("READ_FAILED", "the reader returned no SOD, DG1 or DG2");
72
+ const c = n.aaSignature != null ? D(n.aaSignature) : null;
73
+ return {
74
+ access: n.access === "pace" ? "pace" : "bac",
75
+ dataGroups: s,
76
+ sod: E,
77
+ ...c ? { aaSignature: c } : {},
78
+ ...n.timings && typeof n.timings == "object" ? { timings: n.timings } : {}
79
+ };
80
+ }
81
+ };
82
+ }
83
+ export {
84
+ _ as C,
85
+ O as a,
86
+ f as n
87
+ };
@@ -1,10 +1,14 @@
1
1
  import "./baas-id-react.css";
2
- import { C as L, D as o, L as e, M as r, g as E, r as S } from "./chunks/ContinueFlow-mqBIxnlp.js";
2
+ import { C as e, D as s, L as o, M as i, c as C, g as t, r as L } from "./chunks/ContinueFlow-BzKnkzHf.js";
3
+ import { C as p, n as E } from "./chunks/provider-DqpgUBfH.js";
3
4
  export {
4
- L as ContinueFlow,
5
- o as DEFAULT_MODELS_URL,
6
- e as LOCALES,
7
- r as MODELS_VERSION,
8
- E as getStrings,
9
- S as readHandoffCode
5
+ p as ChipReadError,
6
+ e as ContinueFlow,
7
+ s as DEFAULT_MODELS_URL,
8
+ o as LOCALES,
9
+ i as MODELS_VERSION,
10
+ C as chipCapability,
11
+ t as getStrings,
12
+ E as nativeChipReader,
13
+ L as readHandoffCode
10
14
  };
package/dist/esm/index.js CHANGED
@@ -1,47 +1,48 @@
1
1
  import "./baas-id-react.css";
2
- /* empty css */
3
- import { Y as D, U as S, V as P, W as u } from "./chunks/ContinueFlow-mqBIxnlp.js";
4
- import { X as Z, Z as aa, C as ea, _ as sa, $ as ta, a0 as na, D as ra, a1 as oa, a2 as ia, a3 as ca, a4 as la, a5 as da, a6 as ua, a7 as pa, a8 as fa, a9 as ha, H as ma, L as Ma, M as Ca, aa as Ea, ab as _a, ac as Aa, ad as ga, ae as Na, af as Oa, ag as Sa, ah as La, ai as Fa, aj as va, ak as ya, al as Ra, am as wa, an as xa, ao as Ia, ap as Ta, aq as ba, ar as Da, as as Pa, at as Ya, au as ka, f as Xa, g as Ha, av as Wa, aw as Ua, ax as Ga, ay as Va, az as Ba, aA as Qa, aB as ja, aC as $a, aD as qa, aE as za, aF as Ka, aG as Ja, aH as Za, aI as ae, r as ee, aJ as se, aK as te, aL as ne, aM as re, aN as oe, aO as ie, aP as ce, aQ as le, aR as de, aS as ue, aT as pe } from "./chunks/ContinueFlow-mqBIxnlp.js";
5
- import { jsxs as i, jsx as e } from "react/jsx-runtime";
2
+ /* empty css */
3
+ import { Y as D, Z as S, _ as P, $ as p } from "./chunks/ContinueFlow-BzKnkzHf.js";
4
+ import { a0 as aa, a1 as ea, a2 as ta, C as sa, a3 as ra, a4 as na, a5 as oa, D as ia, a6 as ca, a7 as la, a8 as da, a9 as ua, aa as pa, ab as fa, ac as ha, ad as ma, ae as Ca, af as Ea, ag as ga, H as ba, L as Ma, M as _a, ah as Aa, ai as Na, aj as Sa, ak as Oa, al as Ra, am as Fa, an as va, ao as La, c as ya, ap as wa, aq as Ta, ar as xa, as as Ia, at as Da, au as Pa, av as Ya, aw as ka, ax as Xa, ay as Ga, az as Ha, aA as Ua, aB as Wa, aC as Va, A as Ba, aD as Qa, aE as $a, f as ja, g as za, aF as qa, aG as Ka, aH as Za, aI as Ja, aJ as ae, aK as ee, aL as te, aM as se, aN as re, aO as ne, aP as oe, aQ as ie, aR as ce, aS as le, r as de, aT as ue, aU as pe, aV as fe, aW as he, aX as me, aY as Ce, aZ as Ee, a_ as ge, a$ as be, b0 as Me, b1 as _e, b2 as Ae, b3 as Ne, b4 as Se, b5 as Oe, b6 as Re, b7 as Fe, b8 as ve, b9 as Le } from "./chunks/ContinueFlow-BzKnkzHf.js";
5
+ import { C as we, n as Te, a as xe } from "./chunks/provider-DqpgUBfH.js";
6
+ import { jsxs as c, jsx as e } from "react/jsx-runtime";
6
7
  function V({
7
8
  direction: a,
8
- progress: o,
9
- wrongWay: s,
10
- confidence: p = 1,
11
- strings: t
9
+ progress: s,
10
+ wrongWay: t,
11
+ confidence: o = 1,
12
+ strings: r
12
13
  }) {
13
- const r = Math.round(Math.min(1, Math.max(0, o)) * 100), c = p < S, h = c ? "unreadable" : s ? "wrong" : r >= 100 ? "pass" : "active", m = c ? t.guide.turn_hold_steady : r >= 100 ? t.guide.turn_complete : r >= 65 ? t.guide.turn_almost : r >= 25 ? t.guide.turn_going_well : a === "left" ? t.turn.turningLeft : t.turn.turningRight;
14
- return /* @__PURE__ */ i("div", { className: "rpid-turn", "data-dir": a, "data-state": h, children: [
15
- /* @__PURE__ */ e("span", { className: "rpid-turn-arrows", "aria-hidden": "true", children: [0, 1, 2].map((l) => /* @__PURE__ */ e(Y, { direction: a, lit: r > l * 30, delay: l * 90 }, l)) }),
16
- /* @__PURE__ */ i("div", { className: "rpid-turn-body", children: [
17
- /* @__PURE__ */ e("span", { className: "rpid-turn-label", children: s && !c ? a === "left" ? t.turn.towardLeft : t.turn.towardRight : m }),
18
- /* @__PURE__ */ i(
14
+ const i = Math.round(Math.min(1, Math.max(0, s)) * 100), l = o < S, h = l ? "unreadable" : t ? "wrong" : i >= 100 ? "pass" : "active", m = l ? r.guide.turn_hold_steady : i >= 100 ? r.guide.turn_complete : i >= 65 ? r.guide.turn_almost : i >= 25 ? r.guide.turn_going_well : a === "left" ? r.turn.turningLeft : r.turn.turningRight;
15
+ return /* @__PURE__ */ c("div", { className: "rpid-turn", "data-dir": a, "data-state": h, children: [
16
+ /* @__PURE__ */ e("span", { className: "rpid-turn-arrows", "aria-hidden": "true", children: [0, 1, 2].map((d) => /* @__PURE__ */ e(Y, { direction: a, lit: i > d * 30, delay: d * 90 }, d)) }),
17
+ /* @__PURE__ */ c("div", { className: "rpid-turn-body", children: [
18
+ /* @__PURE__ */ e("span", { className: "rpid-turn-label", children: t && !l ? a === "left" ? r.turn.towardLeft : r.turn.towardRight : m }),
19
+ /* @__PURE__ */ c(
19
20
  "div",
20
21
  {
21
22
  className: "rpid-turn-track",
22
23
  role: "progressbar",
23
24
  "aria-valuemin": 0,
24
25
  "aria-valuemax": 100,
25
- "aria-valuenow": r,
26
- "aria-label": t.turn.progressAria,
26
+ "aria-valuenow": i,
27
+ "aria-label": r.turn.progressAria,
27
28
  children: [
28
- /* @__PURE__ */ e("i", { style: { width: `${r}%` } }),
29
+ /* @__PURE__ */ e("i", { style: { width: `${i}%` } }),
29
30
  /* @__PURE__ */ e("span", { className: "rpid-turn-mark", style: { left: "25%" } }),
30
31
  /* @__PURE__ */ e("span", { className: "rpid-turn-mark", style: { left: "65%" } })
31
32
  ]
32
33
  }
33
34
  )
34
35
  ] }),
35
- /* @__PURE__ */ i("span", { className: "rpid-turn-pct rpid-num", children: [
36
- r,
36
+ /* @__PURE__ */ c("span", { className: "rpid-turn-pct rpid-num", children: [
37
+ i,
37
38
  "%"
38
39
  ] })
39
40
  ] });
40
41
  }
41
42
  function Y({
42
43
  direction: a,
43
- lit: o,
44
- delay: s
44
+ lit: s,
45
+ delay: t
45
46
  }) {
46
47
  return /* @__PURE__ */ e(
47
48
  "svg",
@@ -54,147 +55,183 @@ function Y({
54
55
  strokeWidth: "2.4",
55
56
  strokeLinecap: "round",
56
57
  strokeLinejoin: "round",
57
- className: `rpid-chevron${o ? " lit" : ""}`,
58
- style: { animationDelay: `${s}ms` },
58
+ className: `rpid-chevron${s ? " lit" : ""}`,
59
+ style: { animationDelay: `${t}ms` },
59
60
  "aria-hidden": "true",
60
61
  children: /* @__PURE__ */ e("path", { d: a === "left" ? "M15 5 8 12l7 7" : "M9 5l7 7-7 7" })
61
62
  }
62
63
  );
63
64
  }
64
- function B(a, o) {
65
- const s = o === P ? a : -a;
65
+ function B(a, s) {
66
+ const t = s === P ? a : -a;
66
67
  return {
67
- progress: Math.min(1, Math.max(0, s / D)),
68
- wrongWay: s < -0.12
68
+ progress: Math.min(1, Math.max(0, t / D)),
69
+ wrongWay: t < -0.12
69
70
  };
70
71
  }
71
72
  function Q({
72
73
  yaw: a,
73
- target: o,
74
- reached: s,
75
- confidence: p = 1
74
+ target: s,
75
+ reached: t,
76
+ confidence: o = 1
76
77
  }) {
77
- const f = Math.max(-1.35, Math.min(1.35, a / (o || 0.42))) * 66 * 1, M = p < S, C = [];
78
+ const f = Math.max(-1.35, Math.min(1.35, a / (s || 0.42))) * 66 * 1, C = o < S, E = [];
78
79
  for (let n = -78; n <= 78; n += 6) {
79
- const E = n * Math.PI / 180, _ = Math.sin(E), A = Math.cos(E), g = 1, N = n === 0 ? 1.13 : 1.08, R = 50 + 44 * g * _, w = 60 - 56 * g * A, x = 50 + 44 * N * _, I = 60 - 56 * N * A, O = n === 0 || Math.sign(n) === Math.sign(f) && Math.abs(n) <= Math.abs(f), T = Math.abs(Math.abs(n) - 66) < 6 / 2, b = s && O ? "done" : O ? "lit" : T ? "goal" : "idle";
80
- C.push(
80
+ const g = n * Math.PI / 180, b = Math.sin(g), M = Math.cos(g), _ = 1, A = n === 0 ? 1.13 : 1.08, L = 50 + 44 * _ * b, y = 60 - 56 * _ * M, w = 50 + 44 * A * b, T = 60 - 56 * A * M, N = n === 0 || Math.sign(n) === Math.sign(f) && Math.abs(n) <= Math.abs(f), x = Math.abs(Math.abs(n) - 66) < 6 / 2, I = t && N ? "done" : N ? "lit" : x ? "goal" : "idle";
81
+ E.push(
81
82
  /* @__PURE__ */ e(
82
83
  "line",
83
84
  {
84
- x1: R,
85
- y1: w,
86
- x2: x,
87
- y2: I,
85
+ x1: L,
86
+ y1: y,
87
+ x2: w,
88
+ y2: T,
88
89
  className: "rpid-dial-tick",
89
- "data-state": b,
90
+ "data-state": I,
90
91
  "data-axis": n === 0 ? "center" : void 0
91
92
  },
92
93
  n
93
94
  )
94
95
  );
95
96
  }
96
- const d = f * Math.PI / 180, L = 50 + 44 * 0.99 * Math.sin(d), F = 60 - 56 * 0.99 * Math.cos(d), v = 50 + 44 * 1.17 * Math.sin(d), y = 60 - 56 * 1.17 * Math.cos(d);
97
- return /* @__PURE__ */ i(
97
+ const u = f * Math.PI / 180, O = 50 + 44 * 0.99 * Math.sin(u), R = 60 - 56 * 0.99 * Math.cos(u), F = 50 + 44 * 1.17 * Math.sin(u), v = 60 - 56 * 1.17 * Math.cos(u);
98
+ return /* @__PURE__ */ c(
98
99
  "svg",
99
100
  {
100
101
  className: "rpid-dial",
101
102
  viewBox: "0 0 100 125",
102
103
  "aria-hidden": "true",
103
- "data-state": M ? "unreadable" : s ? "done" : "active",
104
+ "data-state": C ? "unreadable" : t ? "done" : "active",
104
105
  children: [
105
- C,
106
- !M && /* @__PURE__ */ e("line", { x1: L, y1: F, x2: v, y2: y, className: "rpid-dial-cursor" })
106
+ E,
107
+ !C && /* @__PURE__ */ e("line", { x1: O, y1: R, x2: F, y2: v, className: "rpid-dial-cursor" })
107
108
  ]
108
109
  }
109
110
  );
110
111
  }
112
+ function $(a) {
113
+ return /* @__PURE__ */ e(p, { ...a, purpose: "enrollment" });
114
+ }
111
115
  function j(a) {
112
- return /* @__PURE__ */ e(u, { ...a, purpose: "enrollment" });
116
+ return /* @__PURE__ */ e(p, { ...a, purpose: "signin" });
113
117
  }
114
- function $(a) {
115
- return /* @__PURE__ */ e(u, { ...a, purpose: "signin" });
118
+ function z(a) {
119
+ return /* @__PURE__ */ e(p, { ...a, purpose: "reverification" });
116
120
  }
117
121
  function q(a) {
118
- return /* @__PURE__ */ e(u, { ...a, purpose: "reverification" });
122
+ return /* @__PURE__ */ e(p, { ...a, purpose: "identify" });
119
123
  }
120
- function z(a) {
121
- return /* @__PURE__ */ e(u, { ...a, purpose: "identify" });
124
+ async function K(a, s) {
125
+ try {
126
+ const t = globalThis.NDEFReader;
127
+ if (!t || a.aborted) return !1;
128
+ const o = new t();
129
+ return o.onreadingerror = () => {
130
+ a.aborted || s("tag_suspected");
131
+ }, o.onreading = () => {
132
+ a.aborted || s("ndef_tag");
133
+ }, a.addEventListener("abort", () => {
134
+ o.onreading = null, o.onreadingerror = null;
135
+ }, { once: !0 }), await o.scan({ signal: a }), !0;
136
+ } catch {
137
+ return !1;
138
+ }
122
139
  }
123
140
  export {
124
- Z as CENTER_MIN,
125
- aa as CONTAIN_MIN,
126
- ea as ContinueFlow,
127
- sa as ContinueOnPhone,
128
- ta as DEFAULT_DETECTOR,
129
- na as DEFAULT_LOCALE,
130
- ra as DEFAULT_MODELS_URL,
131
- oa as DocumentCapture,
132
- ia as ES_FORMAL,
133
- ca as EngineLoading,
134
- j as EnrollmentFlow,
135
- la as FACE_W_COMFORT_MAX,
136
- da as FACE_W_COMFORT_MIN,
137
- ua as FACE_W_MAX,
138
- pa as FACE_W_MIN,
139
- fa as FaceCapture,
140
- ha as HandoffPanel,
141
- ma as HandoffView,
142
- z as IdentifyFlow,
141
+ aa as CENTER_MIN,
142
+ ea as CONTAIN_MIN,
143
+ ta as ChipRead,
144
+ we as ChipReadError,
145
+ sa as ContinueFlow,
146
+ ra as ContinueOnPhone,
147
+ na as DEFAULT_DETECTOR,
148
+ oa as DEFAULT_LOCALE,
149
+ ia as DEFAULT_MODELS_URL,
150
+ ca as DocumentCapture,
151
+ la as ES_FORMAL,
152
+ da as EngineLoading,
153
+ $ as EnrollmentFlow,
154
+ ua as FACE_W_COMFORT_MAX,
155
+ pa as FACE_W_COMFORT_MIN,
156
+ fa as FACE_W_MAX,
157
+ ha as FACE_W_MIN,
158
+ ma as FINGER_FLOORS,
159
+ Ca as FaceCapture,
160
+ Ea as FingerCapture,
161
+ ga as HandoffPanel,
162
+ ba as HandoffView,
163
+ q as IdentifyFlow,
143
164
  Ma as LOCALES,
144
- Ca as MODELS_VERSION,
145
- Ea as ProcessingOverlay,
146
- _a as ProximityMeter,
147
- q as ReverificationFlow,
148
- Aa as SDK_VERSION,
149
- ga as SELFIE_QUALITY_DEFAULTS,
150
- $ as SignInFlow,
165
+ _a as MODELS_VERSION,
166
+ Aa as ProcessingOverlay,
167
+ Na as ProximityMeter,
168
+ z as ReverificationFlow,
169
+ Sa as SDK_VERSION,
170
+ Oa as SELFIE_QUALITY_DEFAULTS,
171
+ j as SignInFlow,
151
172
  V as TurnGauge,
152
173
  D as YAW_TARGET,
153
174
  Q as YawDial,
154
- Na as browserLocale,
155
- Oa as captureNonceOf,
156
- Sa as centerBlocker,
175
+ Ra as browserLocale,
176
+ Fa as captureNonceOf,
177
+ va as centerBlocker,
157
178
  La as centeringFrom,
158
- Fa as claimHandoff,
159
- va as collectSnapshot,
160
- ya as cornerRadius,
161
- Ra as createHandoff,
162
- wa as cropQuality,
163
- xa as detectDevice,
164
- Ia as distanceHintOf,
165
- Ta as distanceTrackPos,
166
- ba as encodeQr,
167
- Da as faceCropStats,
168
- Pa as faceWidthOf,
169
- Ya as finalizeSession,
170
- ka as floorsFrom,
171
- Xa as formalityOverrides,
172
- Ha as getStrings,
173
- Wa as gridPeriodicity,
174
- Ua as handoffStatus,
175
- Ga as inAppBrowser,
176
- Va as loadDocumentEngine,
177
- Ba as loadFaceEngine,
178
- Qa as modelsUrlOf,
179
- ja as nativeAttestation,
180
- $a as normalizeSession,
181
- qa as parseUserAgent,
182
- za as peekHandoff,
183
- Ka as preload,
184
- Ja as probeDocument,
185
- Za as proximityOf,
186
- ae as qrPath,
187
- ee as readHandoffCode,
188
- se as reasonEntry,
189
- te as reportClient,
190
- ne as requestHash,
191
- re as resolveLocale,
192
- oe as revokeHandoff,
193
- ie as selfieQualityIssue,
194
- ce as sideOutcomeOf,
195
- le as specularSignature,
196
- de as subscribeClient,
179
+ ya as chipCapability,
180
+ wa as claimHandoff,
181
+ Ta as collectSnapshot,
182
+ xa as cornerRadius,
183
+ Ia as createHandoff,
184
+ Da as cropQuality,
185
+ Pa as detectDevice,
186
+ Ya as distanceHintOf,
187
+ ka as distanceTrackPos,
188
+ Xa as encodeQr,
189
+ Ga as faceCropStats,
190
+ Ha as faceWidthOf,
191
+ Ua as finalizeSession,
192
+ Wa as fingerGate,
193
+ Va as fingerGroups,
194
+ Ba as fingerSlots,
195
+ Qa as fingertipStats,
196
+ $a as floorsFrom,
197
+ ja as formalityOverrides,
198
+ za as getStrings,
199
+ qa as gridPeriodicity,
200
+ Ka as handoffStatus,
201
+ Za as inAppBrowser,
202
+ Ja as loadDocumentEngine,
203
+ ae as loadFaceEngine,
204
+ ee as modelsUrlOf,
205
+ te as nativeAttestation,
206
+ Te as nativeChipReader,
207
+ xe as normalizeChipError,
208
+ se as normalizeSession,
209
+ re as parseUserAgent,
210
+ ne as peekHandoff,
211
+ oe as preload,
212
+ ie as probeDocument,
213
+ ce as proximityOf,
214
+ le as qrPath,
215
+ de as readHandoffCode,
216
+ ue as reasonEntry,
217
+ pe as reportChipUnavailable,
218
+ fe as reportClient,
219
+ he as requestHash,
220
+ me as resolveLocale,
221
+ Ce as revokeHandoff,
222
+ Ee as selfieQualityIssue,
223
+ ge as setTorch,
224
+ be as sideOutcomeOf,
225
+ Me as silhouetteDetector,
226
+ _e as specularSignature,
227
+ Ae as subscribeClient,
228
+ Ne as torchSupported,
197
229
  B as turnGaugeFrom,
198
- ue as uploadCapture,
199
- pe as webAttestation
230
+ Se as unavailableReason,
231
+ Oe as uploadCapture,
232
+ Re as uploadChip,
233
+ Fe as uploadFinger,
234
+ K as watchChipPresence,
235
+ ve as webAttestation,
236
+ Le as webNfcAvailable
200
237
  };
@@ -0,0 +1,91 @@
1
+ import { C as f } from "./chunks/provider-DqpgUBfH.js";
2
+ const b = {
3
+ ACCESS_DENIED: "ACCESS_DENIED",
4
+ TIMEOUT: "TIMEOUT",
5
+ NFC_OFF: "NFC_OFF",
6
+ NO_NFC: "NFC_OFF",
7
+ NO_CHIP: "NO_CHIP"
8
+ };
9
+ function C(r) {
10
+ if (r instanceof f) return r;
11
+ const n = r?.code, t = typeof n == "string" ? n.trim().toUpperCase() : "", e = r?.message;
12
+ return new f(b[t] ?? "READ_FAILED", typeof e == "string" && e ? e : void 0);
13
+ }
14
+ function d(r) {
15
+ if (typeof r != "string" || !r) return null;
16
+ try {
17
+ const n = atob(r.replace(/\s+/g, "").replace(/-/g, "+").replace(/_/g, "/"));
18
+ return Uint8Array.from(n, (t) => t.charCodeAt(0));
19
+ } catch {
20
+ return null;
21
+ }
22
+ }
23
+ const g = () => new DOMException("aborted", "AbortError");
24
+ function y(r, n, t = {}) {
25
+ return {
26
+ name: n,
27
+ async read(e) {
28
+ const { signal: i } = e;
29
+ if (i.aborted) throw g();
30
+ let l = null;
31
+ if (e.onProgress) {
32
+ const a = e.onProgress;
33
+ try {
34
+ l = await r.addListener("progress", (s) => {
35
+ i.aborted || a(s);
36
+ });
37
+ } catch {
38
+ l = null;
39
+ }
40
+ }
41
+ const E = {
42
+ dataGroups: [...e.dataGroups],
43
+ ...e.mrz ? { mrz: { documentNumber: e.mrz.documentNumber, birthDate: e.mrz.birthDate, expiryDate: e.mrz.expiryDate } } : {},
44
+ ...e.can ? { can: e.can } : {},
45
+ ...e.aaChallenge ? { aaChallenge: e.aaChallenge } : {},
46
+ ...t.timeoutMs != null ? { timeoutMs: t.timeoutMs } : {},
47
+ ...t.sessionMessage ? { sessionMessage: t.sessionMessage } : {},
48
+ ...t.chipAuthentication != null ? { chipAuthentication: t.chipAuthentication } : {},
49
+ ...t.preferPace != null ? { preferPace: t.preferPace } : {}
50
+ };
51
+ let o;
52
+ try {
53
+ o = await new Promise((a, s) => {
54
+ const c = () => {
55
+ r.cancel().catch(() => {
56
+ }), s(g());
57
+ };
58
+ if (i.aborted) return c();
59
+ i.addEventListener("abort", c, { once: !0 }), r.readDocument(E).then(a, s).finally(() => i.removeEventListener("abort", c));
60
+ });
61
+ } catch (a) {
62
+ throw a?.name === "AbortError" ? a : C(a);
63
+ } finally {
64
+ if (l)
65
+ try {
66
+ await l.remove();
67
+ } catch {
68
+ }
69
+ }
70
+ const h = d(o?.sod), m = {};
71
+ for (const [a, s] of Object.entries(o?.dataGroups ?? {})) {
72
+ const c = d(s);
73
+ c && (m[a.toUpperCase()] = c);
74
+ }
75
+ if (!h || !m.DG1 || !m.DG2) throw new f("READ_FAILED", "the reader returned no SOD, DG1 or DG2");
76
+ const u = d(o.aaSignature);
77
+ return {
78
+ access: o.access === "pace" ? "pace" : "bac",
79
+ dataGroups: m,
80
+ sod: h,
81
+ ...u ? { aaSignature: u } : {},
82
+ ...o.timings && typeof o.timings == "object" ? { timings: { ...o.timings } } : {}
83
+ };
84
+ }
85
+ };
86
+ }
87
+ export {
88
+ f as ChipReadError,
89
+ y as capacitorChipReader,
90
+ C as chipErrorFromPlugin
91
+ };