@incodetech/web 0.0.0-dev-20260629-b328e270 → 0.0.0-dev-20260630-183debc7

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 (112) hide show
  1. package/dist/ae-signature/ae-signature.es.js +2 -2
  2. package/dist/antifraud/antifraud.es.js +3 -3
  3. package/dist/authentication/authentication.es.js +5 -4
  4. package/dist/cameraView-DIEzM5ru.js +47 -0
  5. package/dist/{tutorial-BGSXiqW5.js → capture-Dxt6iWnd.js} +12 -701
  6. package/dist/certificate-issuance/certificate-issuance.es.js +6 -6
  7. package/dist/consent/consent.es.js +7 -7
  8. package/dist/{countrySelector-B4WuNUya.js → countrySelector-SvUOyPo0.js} +1 -1
  9. package/dist/cpf-ocr/cpf-ocr.es.js +1 -1
  10. package/dist/{cpfOcr-liTE9e70.js → cpfOcr-CSm-00nk.js} +2 -2
  11. package/dist/cpfOcr-DEZZicRS.js +2 -0
  12. package/dist/cross-document-data-match/cross-document-data-match.es.js +3 -3
  13. package/dist/curp-validation/curp-validation.es.js +6 -6
  14. package/dist/{customFields-BQ4scZfL.js → customFields-201bo3AI.js} +5 -5
  15. package/dist/{customWatchlist-7s0_wGtE.js → customWatchlist-CYoRNCim.js} +5 -5
  16. package/dist/document-capture/document-capture.es.js +1 -1
  17. package/dist/documentCapture-COIa8mmu.js +2 -0
  18. package/dist/{documentCapture-Bj9TYJTP.js → documentCapture-Dbp6cy2d.js} +9 -7
  19. package/dist/{dynamicForms-D1DiD5i6.js → dynamicForms-BJ_LI0PU.js} +7 -7
  20. package/dist/ekyb/ekyb.es.js +1 -1
  21. package/dist/{ekybModule-DbEWlZ3Z.js → ekybModule-X9lbZnqi.js} +10 -10
  22. package/dist/ekybModule-XMUaiosN.js +2 -0
  23. package/dist/ekyc/ekyc.es.js +1 -1
  24. package/dist/{ekycModule-jkXByPXe.js → ekycModule-BB4Nm0Cq.js} +8 -8
  25. package/dist/ekycModule-CdCSpWq3.js +2 -0
  26. package/dist/electronic-signature/electronic-signature.es.js +1 -1
  27. package/dist/{electronic-signature-BZ5w_RAk.js → electronic-signature-D0qnp91I.js} +6 -6
  28. package/dist/email/email.es.js +6 -6
  29. package/dist/{emailInput-C-lU_T0m.js → emailInput-D14hKRxf.js} +2 -2
  30. package/dist/{expiredId-0GUaIbV1.js → expiredId-UiGGdRyM.js} +1 -1
  31. package/dist/{extensibility-C5yR5Rma.js → extensibility-SGdq3PlE.js} +29 -71
  32. package/dist/extensibility.es.js +11 -9
  33. package/dist/face-match/face-match.es.js +1 -1
  34. package/dist/{faceMatch-BSrFwS4c.js → faceMatch-BfwaUAm_.js} +6 -6
  35. package/dist/faceMatch-T5EmOL8W.js +2 -0
  36. package/dist/field-comparison/field-comparison.es.js +1 -1
  37. package/dist/fieldComparison-5yBIO7hm.js +2 -0
  38. package/dist/{fieldComparison-COyIoh0S.js → fieldComparison-CHX1cdUX.js} +6 -6
  39. package/dist/fiscal-qr/fiscal-qr.es.js +7 -6
  40. package/dist/flow/flow.es.js +17 -7
  41. package/dist/flow/styles.css +3147 -2073
  42. package/dist/geolocation/geolocation.es.js +5 -5
  43. package/dist/government-validation/government-validation.es.js +7 -7
  44. package/dist/{homeScreen-BIdVm9KA.js → homeScreen-BFMejvmk.js} +1 -1
  45. package/dist/{hooks-Da_yP_Dr.js → hooks-CNu7o-v8.js} +39 -2
  46. package/dist/{i18n-DoP1NB7u.js → i18n-CU4xq8qC.js} +1 -1
  47. package/dist/id/id.es.js +67 -41
  48. package/dist/id-verification/id-verification.es.js +4 -4
  49. package/dist/{idOcr-D6-SIM0k.js → idOcr-CZIs3Ue9.js} +8 -8
  50. package/dist/identity-reuse/identity-reuse.es.js +4 -4
  51. package/dist/{incodeComponent-Cmi1rlWs.js → incodeComponent-CfzJGETt.js} +2 -2
  52. package/dist/{incodeModule-M8DszCee.js → incodeModule-B-4_3JrK.js} +1 -1
  53. package/dist/index.es.js +1 -1
  54. package/dist/{mandatoryConsent-DOQ0DKgM.js → mandatoryConsent-B9Jdswhx.js} +6 -6
  55. package/dist/{optionAccessibleLabel-_nvVCTSL.js → optionAccessibleLabel-gfF-58Mv.js} +3 -3
  56. package/dist/{otpInput-Q_kzSZeD.js → otpInput-ICExSJVT.js} +1 -1
  57. package/dist/{pdf-BMUXKJuC.js → pdf-BqtJTlor.js} +1 -1
  58. package/dist/{pdfViewer-bx59Lwwt.js → pdfViewer-LTQA54iS.js} +1 -1
  59. package/dist/phone/phone.es.js +5 -5
  60. package/dist/{processing-Boki1Z8j.js → processing-C5pzUUiq.js} +1 -1
  61. package/dist/qe-signature/qe-signature.es.js +2 -2
  62. package/dist/{radioGroupComposed-TuAWUAFK.js → radioGroupComposed-DuQxslB2.js} +1 -1
  63. package/dist/redirect-to-mobile/redirect-to-mobile.es.js +8 -8
  64. package/dist/{richText-DsTP4H3j.js → richText-CB1fmegc.js} +1 -1
  65. package/dist/selfie/selfie.es.js +8 -7
  66. package/dist/selfie/styles.css +112 -61
  67. package/dist/signature/signature.es.js +7 -7
  68. package/dist/{transitionSpinner-4rPkt-KM.js → transitionSpinner-SZgloiXn.js} +1 -1
  69. package/dist/tutorial-Djs82ySW.js +701 -0
  70. package/dist/types/video-selfie.d.ts +72 -0
  71. package/dist/{useModuleLoader-DSAcG10Q.js → useModuleLoader-CJDUw2W-.js} +19 -17
  72. package/dist/{verificationResult-B6PBXbp9.js → verificationResult-NWJn7l6C.js} +1 -1
  73. package/dist/video-selfie/styles.css +1644 -0
  74. package/dist/video-selfie/video-selfie.es.js +857 -0
  75. package/dist/watchlist/watchlist.es.js +5 -5
  76. package/dist/{watchlistForBusiness-DCKlKG81.js → watchlistForBusiness-y_yYQHQW.js} +6 -6
  77. package/dist/workflow/styles.css +112 -61
  78. package/dist/workflow/workflow.es.js +7 -7
  79. package/package.json +11 -2
  80. package/dist/cpfOcr-BJOYoITy.js +0 -2
  81. package/dist/documentCapture-DYLw-NNT.js +0 -2
  82. package/dist/ekybModule-DR9eUyGC.js +0 -2
  83. package/dist/ekycModule-BIbj7hr1.js +0 -2
  84. package/dist/faceMatch-D_uyeaBt.js +0 -2
  85. package/dist/fieldComparison-BOYh6Xq9.js +0 -2
  86. /package/dist/{aligndevicelottie-DMXPhIDs.js → aligndevicelottie-DFscByAI.js} +0 -0
  87. /package/dist/{back-horizontal-hint-DNIIDrEW.js → back-horizontal-hint-xTnSQbzn.js} +0 -0
  88. /package/dist/{back-tutorial-B8JJSJBB.js → back-tutorial-cI_4VHmE.js} +0 -0
  89. /package/dist/{back-vertical-hint-CW6ZS7bP.js → back-vertical-hint-BWWlHfX2.js} +0 -0
  90. /package/dist/{backdevicelottie-By75Bznp.js → backdevicelottie-COyhTrxM.js} +0 -0
  91. /package/dist/{blurdevicelottie-C_9VAHkM.js → blurdevicelottie-BLVeJHEG.js} +0 -0
  92. /package/dist/{browser-ponyfill-C_DpU0lQ.js → browser-ponyfill-Df13Th-G.js} +0 -0
  93. /package/dist/{defineProperty-CTu-cLWm.js → defineProperty-Qjefk7Uf.js} +0 -0
  94. /package/dist/{flip-animation-st9bra1p.js → flip-animation-CZYSUtMm.js} +0 -0
  95. /package/dist/{front-horizontal-hint-DvME-aVk.js → front-horizontal-hint-B84GgTO1.js} +0 -0
  96. /package/dist/{front-vertical-hint-BUG1VMsP.js → front-vertical-hint-Bs_avngq.js} +0 -0
  97. /package/dist/{frontdevicelottie-uObOEs8p.js → frontdevicelottie-B4tE2PYQ.js} +0 -0
  98. /package/dist/{glaredevicelottie-CsfIgqIc.js → glaredevicelottie-D1pR73sx.js} +0 -0
  99. /package/dist/{id-laser-h-BvVSaLyU.js → id-laser-h-CzPegPMn.js} +0 -0
  100. /package/dist/{id-laser-v-Dj_RN_s9.js → id-laser-v-BiUXkM4x.js} +0 -0
  101. /package/dist/{id-tutorial-BOOsXlAJ.js → id-tutorial-DwO90SAm.js} +0 -0
  102. /package/dist/{lottie_light-BG-RL2Iu.js → lottie_light-C6B2ec41.js} +0 -0
  103. /package/dist/{numberedStep-Dc0BUU-j.js → numberedStep-CEb-lFJm.js} +0 -0
  104. /package/dist/{passport-horizontal-hint-BhpVt73n.js → passport-horizontal-hint-Bj0ZJY0g.js} +0 -0
  105. /package/dist/{passport-tutorial-CeSup6m9.js → passport-tutorial-D9JNsMsM.js} +0 -0
  106. /package/dist/{passport-vertical-hint-CVRBnZXS.js → passport-vertical-hint-Dfk77xUJ.js} +0 -0
  107. /package/dist/{registerIncodeElement-CdlNRRv5.js → registerIncodeElement-DaNjbAwZ.js} +0 -0
  108. /package/dist/{requiredLabelHint-DX3oVNtu.js → requiredLabelHint-D0RhuMed.js} +0 -0
  109. /package/dist/{selfieTutorial-CYa8bq6B.js → selfieTutorial-pB-N-fj5.js} +0 -0
  110. /package/dist/{snackbar-CGL6gp9u.js → snackbar-DS7Mv62v.js} +0 -0
  111. /package/dist/{statusPage-BUm5gtQY.js → statusPage-Bk8nJwXV.js} +0 -0
  112. /package/dist/{tabs-DUkWjBGk.js → tabs-C__chW-u.js} +0 -0
@@ -1,300 +1,17 @@
1
- import { r as __toESM } from "./rolldown-runtime--E5BIlTp.js";
2
- import { n as useTranslation, t as Trans } from "./i18n-DoP1NB7u.js";
3
- import { _ as y, a as D, d as T, h as q, l as A, m as g, p as d, v as u, x as k } from "./vendor-preact-DThS2ZQ_.js";
4
- import { r as useIsMobileDeviceWidth } from "./hooks-Da_yP_Dr.js";
5
- import { n as cn, r as Spacer, t as LoadingIcon } from "./loadingIcon-B0ysgiNq.js";
1
+ import { n as useTranslation, t as Trans } from "./i18n-CU4xq8qC.js";
2
+ import { _ as y, h as q, l as A, m as g, v as u, x as k } from "./vendor-preact-DThS2ZQ_.js";
3
+ import { a as useIsMobileDeviceWidth } from "./hooks-CNu7o-v8.js";
4
+ import { n as cn, r as Spacer } from "./loadingIcon-B0ysgiNq.js";
6
5
  import { t as Page } from "./page-DidH_RkX.js";
7
6
  import { i as TypographyH4, n as TypographyH1, t as Title } from "./typography-BZIpjo97.js";
8
- import { t as TransitionSpinner } from "./transitionSpinner-4rPkt-KM.js";
7
+ import { t as TransitionSpinner } from "./transitionSpinner-SZgloiXn.js";
9
8
  import { t as Button } from "./button-Ch5-QgHB.js";
10
- import { t as ErrorIcon } from "./errorIcon-BA4T6iy-.js";
11
9
  import { h as WarningIcon } from "./icons-CJJbIpBq.js";
12
- import { t as SuccessIcon } from "./successIcon-B5mGvdx1.js";
13
10
  import { t as Modal } from "./modal-OxkFuuiR.js";
14
11
  import { t as BottomSheet } from "./bottomSheet-CnWbbUAM.js";
15
- import { t as NumberedStep } from "./numberedStep-Dc0BUU-j.js";
12
+ import { t as NumberedStep } from "./numberedStep-CEb-lFJm.js";
16
13
  import { getBrowser, getDeviceClass } from "@incodetech/core/device";
17
14
  import "@incodetech/core/camera";
18
- //#region src/shared/errorContent/errorContent.tsx
19
- var ErrorContent = ({ title, description, attemptsRemaining, onButtonClick, "data-testid": testId }) => {
20
- const { t } = useTranslation();
21
- const noMoreAttempts = attemptsRemaining <= 0;
22
- const titleRef = A(null);
23
- y(() => {
24
- titleRef.current?.focus();
25
- }, []);
26
- return /* @__PURE__ */ u(Modal.Root, {
27
- open: true,
28
- dismissible: false,
29
- hasBackdrop: false,
30
- manageInitialFocus: false,
31
- class: "IncodeErrorContent",
32
- children: /* @__PURE__ */ u(Modal.Content, {
33
- class: "IncodeErrorContentContent",
34
- children: /* @__PURE__ */ u(Page, {
35
- "data-testid": testId,
36
- className: "IncodeErrorContentPage",
37
- children: /* @__PURE__ */ u("div", {
38
- class: "IncodeErrorContentContainer",
39
- children: [/* @__PURE__ */ u("div", {
40
- class: "IncodeErrorContentIconContainer",
41
- children: [
42
- noMoreAttempts ? /* @__PURE__ */ u(ErrorIcon, { size: 32 }) : /* @__PURE__ */ u(WarningIcon, { size: 32 }),
43
- /* @__PURE__ */ u(Spacer, { size: 16 }),
44
- /* @__PURE__ */ u(Title, {
45
- ref: titleRef,
46
- id: "incode-modal-title",
47
- tabIndex: -1,
48
- className: "IncodeErrorContentTitle",
49
- children: title
50
- }),
51
- /* @__PURE__ */ u(Spacer, { size: 12 }),
52
- /* @__PURE__ */ u("p", {
53
- class: "IncodeErrorContentDescription",
54
- children: description
55
- })
56
- ]
57
- }), /* @__PURE__ */ u("div", {
58
- class: "IncodeErrorContentAttemptsContainer",
59
- children: [
60
- !noMoreAttempts ? /* @__PURE__ */ u("p", {
61
- class: "IncodeErrorContentAttemptsText",
62
- children: t("common.attemptsRemaining", { count: attemptsRemaining })
63
- }) : null,
64
- /* @__PURE__ */ u(Button, {
65
- onClick: onButtonClick,
66
- children: noMoreAttempts ? t("common.continue") : t("common.tryAgain")
67
- }),
68
- /* @__PURE__ */ u(Spacer, { size: 16 })
69
- ]
70
- })]
71
- })
72
- })
73
- })
74
- });
75
- };
76
- //#endregion
77
- //#region src/shared/lottie/lottie.tsx
78
- var lottiePromise = null;
79
- async function loadLottie() {
80
- if (lottiePromise) return lottiePromise;
81
- lottiePromise = import("./lottie_light-BG-RL2Iu.js").then((m) => /* @__PURE__ */ __toESM(m.default, 1)).then((mod) => mod.default);
82
- return lottiePromise;
83
- }
84
- var AUTO_STOP_AFTER_MS = 5e3;
85
- function Lottie({ animationData, loop = true, autoplay = true, reverse = false, style, className, onComplete, autoStop = false, stopFramePosition }) {
86
- const containerRef = A(null);
87
- const effectiveAutoplay = reverse ? false : autoplay;
88
- const animationOptionsRef = A({
89
- container: containerRef.current,
90
- renderer: "svg",
91
- loop,
92
- autoplay: effectiveAutoplay,
93
- animationData
94
- });
95
- y(() => {
96
- animationOptionsRef.current = {
97
- container: containerRef.current,
98
- renderer: "svg",
99
- loop,
100
- autoplay: effectiveAutoplay,
101
- animationData
102
- };
103
- }, [
104
- animationData,
105
- loop,
106
- effectiveAutoplay
107
- ]);
108
- y(() => {
109
- if (!containerRef.current) return;
110
- let anim;
111
- let stopTimer;
112
- let isMounted = true;
113
- loadLottie().then((lottie) => {
114
- if (!isMounted) return;
115
- anim = lottie.loadAnimation(animationOptionsRef.current);
116
- if (reverse) {
117
- anim.setDirection(-1);
118
- anim.goToAndPlay(anim.totalFrames - 1, true);
119
- }
120
- if (onComplete) anim.addEventListener("complete", onComplete);
121
- if (autoStop) stopTimer = window.setTimeout(() => {
122
- const current = anim;
123
- if (!current) return;
124
- if (!stopFramePosition) {
125
- current.pause();
126
- return;
127
- }
128
- const totalFrames = current.totalFrames;
129
- if (!totalFrames || totalFrames <= 0) {
130
- current.stop();
131
- return;
132
- }
133
- const targetFrame = stopFramePosition === "last" ? Math.max(totalFrames - 1, 0) : stopFramePosition === "first" ? 0 : Math.floor((totalFrames - 1) / 2);
134
- current.goToAndStop(targetFrame, true);
135
- }, AUTO_STOP_AFTER_MS);
136
- });
137
- return () => {
138
- isMounted = false;
139
- if (stopTimer !== void 0) window.clearTimeout(stopTimer);
140
- if (anim) {
141
- if (onComplete) anim.removeEventListener("complete", onComplete);
142
- anim.destroy();
143
- }
144
- };
145
- }, [
146
- onComplete,
147
- reverse,
148
- autoStop,
149
- stopFramePosition
150
- ]);
151
- return /* @__PURE__ */ u("div", {
152
- ref: containerRef,
153
- style,
154
- className,
155
- "aria-hidden": "true"
156
- });
157
- }
158
- //#endregion
159
- //#region src/shared/baseTutorial/replaceBaseTutorial.ts
160
- /**
161
- * The brand blues baked into the tutorial animations. The selfie oval/shoulders
162
- * use `#007aff`; the ID/passport tutorials additionally use `#006aff` (the
163
- * default brand blue) for their accent. Both are re-tinted to the active
164
- * branding color.
165
- *
166
- * Authored as hex and converted to Lottie's normalized `[r, g, b]` (0–1) form.
167
- * The two greens are ~0.06 apart, comfortably outside `COLOR_MATCH_TOLERANCE`,
168
- * so they neither cross-match nor catch the (grayscale/white) document and
169
- * face artwork.
170
- */
171
- var SOURCE_BRAND_COLORS = ["#007aff", "#006aff"].map(hexToRgbUnit).filter((color) => color !== null);
172
- /**
173
- * Per-channel tolerance when matching a source color. The baked values are
174
- * authored as rounded decimals (e.g. `0.48`), so an exact comparison is too
175
- * brittle; a small tolerance keeps the match robust without catching
176
- * unrelated colors.
177
- */
178
- var COLOR_MATCH_TOLERANCE = .02;
179
- /**
180
- * Reads a CSS custom property off the document root and returns its value.
181
- * Returns `fallback` (empty by default) when the property is unset or
182
- * unavailable (e.g. during SSR / tests). With the default empty fallback the
183
- * recolor no-ops, leaving the animation's authored colors in place — which are
184
- * the default brand blue, so no theme-specific literal is needed here.
185
- */
186
- function getCssVariableAsHex(variableName, fallback = "") {
187
- if (typeof document === "undefined") return fallback;
188
- return getComputedStyle(document.documentElement).getPropertyValue(variableName).trim() || fallback;
189
- }
190
- function hexToRgbUnit(hex) {
191
- let normalized = hex.replace("#", "").trim();
192
- if (normalized.length === 3) normalized = normalized.split("").map((char) => char + char).join("");
193
- const result = /^([a-f\d]{2})([a-f\d]{2})([a-f\d]{2})$/i.exec(normalized);
194
- if (!result) return null;
195
- return [
196
- Number.parseInt(result[1], 16) / 255,
197
- Number.parseInt(result[2], 16) / 255,
198
- Number.parseInt(result[3], 16) / 255
199
- ];
200
- }
201
- function channelMatches(a, b) {
202
- return Math.abs(a - b) <= COLOR_MATCH_TOLERANCE;
203
- }
204
- function isSourceColor(r, g, b) {
205
- return SOURCE_BRAND_COLORS.some(([sr, sg, sb]) => channelMatches(r, sr) && channelMatches(g, sg) && channelMatches(b, sb));
206
- }
207
- function isStaticColorArray(value) {
208
- return Array.isArray(value) && value.length >= 3 && value.every((entry) => typeof entry === "number");
209
- }
210
- function recolorSolid(node, target) {
211
- const colorHolder = node.c;
212
- if (!colorHolder || typeof colorHolder !== "object") return;
213
- const k = colorHolder.k;
214
- if (isStaticColorArray(k) && isSourceColor(k[0], k[1], k[2])) {
215
- k[0] = target[0];
216
- k[1] = target[1];
217
- k[2] = target[2];
218
- }
219
- }
220
- function recolorGradient(node, target) {
221
- const gradient = node.g;
222
- if (!gradient || typeof gradient !== "object") return;
223
- const { p, k } = gradient;
224
- const stopCount = typeof p === "number" ? p : 0;
225
- const stops = k?.k;
226
- if (stopCount <= 0 || !Array.isArray(stops)) return;
227
- for (let stop = 0; stop < stopCount; stop++) {
228
- const base = stop * 4;
229
- const r = stops[base + 1];
230
- const g = stops[base + 2];
231
- const b = stops[base + 3];
232
- if (typeof r === "number" && typeof g === "number" && typeof b === "number" && isSourceColor(r, g, b)) {
233
- stops[base + 1] = target[0];
234
- stops[base + 2] = target[1];
235
- stops[base + 3] = target[2];
236
- }
237
- }
238
- }
239
- function recolorNode(node, target) {
240
- if (Array.isArray(node)) {
241
- for (const child of node) recolorNode(child, target);
242
- return;
243
- }
244
- if (!node || typeof node !== "object") return;
245
- const obj = node;
246
- if (obj.ty === "fl" || obj.ty === "st") recolorSolid(obj, target);
247
- else if (obj.ty === "gf" || obj.ty === "gs") recolorGradient(obj, target);
248
- for (const key of Object.keys(obj)) recolorNode(obj[key], target);
249
- }
250
- /**
251
- * Returns a deep copy of `animationData` with the baked-in brand blue swapped
252
- * for `hexColor`. The input is never mutated. Unparseable colors leave the
253
- * animation untouched.
254
- */
255
- function replaceLottieColor(animationData, hexColor) {
256
- const target = hexToRgbUnit(hexColor);
257
- if (!target) return animationData;
258
- const clone = JSON.parse(JSON.stringify(animationData));
259
- recolorNode(clone, target);
260
- return clone;
261
- }
262
- //#endregion
263
- //#region src/shared/baseTutorial/baseTutorial.tsx
264
- var BaseTutorial = ({ className = "", animationData, title, titleId, subtitle, onContinue, buttonText, disclaimerText, isLoading, stopFramePosition = "middle" }) => {
265
- const themedAnimationData = T(() => animationData ? replaceLottieColor(animationData, getCssVariableAsHex("--primitive-color-brand-500")) : null, [animationData]);
266
- return /* @__PURE__ */ u(Page, {
267
- className: cn("IncodeTutorialPage", className),
268
- title,
269
- titleId,
270
- subtitle,
271
- children: [/* @__PURE__ */ u("div", {
272
- class: "IncodeBaseTutorialContainer",
273
- children: /* @__PURE__ */ u("div", {
274
- class: "IncodeBaseTutorialAnimationContainer",
275
- "aria-hidden": "true",
276
- children: themedAnimationData ? /* @__PURE__ */ u(Lottie, {
277
- animationData: themedAnimationData,
278
- className: "IncodeBaseTutorialAnimation",
279
- autoStop: true,
280
- stopFramePosition
281
- }) : null
282
- })
283
- }), /* @__PURE__ */ u("div", { children: [/* @__PURE__ */ u("p", {
284
- class: "IncodeBaseTutorialDisclaimer",
285
- children: disclaimerText
286
- }), /* @__PURE__ */ u("div", {
287
- class: "IncodeBaseTutorialButtonContainer",
288
- children: /* @__PURE__ */ u(Button, {
289
- onClick: onContinue,
290
- class: "m-auto max-w-[420px]",
291
- isLoading,
292
- children: buttonText
293
- })
294
- })] })]
295
- });
296
- };
297
- //#endregion
298
15
  //#region src/shared/permissions/camera/boldWithArrow.tsx
299
16
  var BoldWithArrow = ({ i18nKey }) => /* @__PURE__ */ u("span", {
300
17
  class: "IncodeBoldWithArrow",
@@ -2375,206 +2092,7 @@ var Permissions = ({ manager, permissionStatus }) => {
2375
2092
  });
2376
2093
  };
2377
2094
  //#endregion
2378
- //#region src/modules/selfie/avatarCanvas.tsx
2379
- /**
2380
- * Mounts the avatar `<canvas>` in place of the live selfie video. The element
2381
- * is created and rendered to in the infra layer; the UI only hosts it and
2382
- * applies layout + mirror classes (the latter parallels the video's
2383
- * `.IncodeCaptureVideoMirrored`, keeping handedness in one place). Cosmetic
2384
- * only — the capture pipeline runs on the real frames regardless.
2385
- */
2386
- var AvatarCanvas = ({ canvas, mirrored }) => {
2387
- const hostRef = A(null);
2388
- y(() => {
2389
- const host = hostRef.current;
2390
- if (!host || !canvas) return void 0;
2391
- canvas.classList.add("IncodeCaptureAvatarElement");
2392
- canvas.classList.toggle("IncodeCaptureAvatarMirrored", mirrored);
2393
- host.appendChild(canvas);
2394
- return () => {
2395
- if (canvas.parentElement === host) host.removeChild(canvas);
2396
- };
2397
- }, [canvas, mirrored]);
2398
- return /* @__PURE__ */ u("div", {
2399
- ref: hostRef,
2400
- class: "IncodeCaptureAvatarHost",
2401
- "aria-hidden": "true"
2402
- });
2403
- };
2404
- //#endregion
2405
- //#region src/modules/selfie/captureStatusPage.tsx
2406
- var CaptureStatusPage = ({ icon, title, className, isLoading }) => {
2407
- const titleRef = A(null);
2408
- y(() => {
2409
- titleRef.current?.focus();
2410
- }, []);
2411
- return /* @__PURE__ */ u(Page, {
2412
- className: `IncodeCaptureStatusPage ${className ?? ""}`,
2413
- children: [/* @__PURE__ */ u(Spacer, { size: 40 }), /* @__PURE__ */ u("div", {
2414
- class: "IncodeCaptureStatusContainer",
2415
- role: isLoading ? "status" : void 0,
2416
- "aria-live": isLoading ? "polite" : void 0,
2417
- children: [
2418
- /* @__PURE__ */ u(Spacer, { size: 120 }),
2419
- icon,
2420
- /* @__PURE__ */ u(Spacer, { size: 16 }),
2421
- /* @__PURE__ */ u(Title, {
2422
- ref: titleRef,
2423
- className: "IncodeCaptureStatusTitle",
2424
- tabIndex: -1,
2425
- children: title
2426
- })
2427
- ]
2428
- })]
2429
- });
2430
- };
2431
- //#endregion
2432
- //#region src/modules/selfie/errorModal.tsx
2433
- var defaultError = {
2434
- title: "Something went wrong",
2435
- description: "Please try again later"
2436
- };
2437
- var errorContent = {
2438
- MASK_ERROR: {
2439
- title: "notifications.mask",
2440
- description: "notifications.maskDescription"
2441
- },
2442
- BRIGHTNESS_ERROR: {
2443
- title: "notifications.brightness",
2444
- description: "notifications.brightnessDescription"
2445
- },
2446
- LIVENESS_ERROR: {
2447
- title: "notifications.spoof",
2448
- description: "notifications.spoofDescription"
2449
- },
2450
- CLOSED_EYES_ERROR: {
2451
- title: "notifications.closedEyes",
2452
- description: "notifications.closedEyesDescription"
2453
- },
2454
- HEAD_COVER_ERROR: {
2455
- title: "notifications.removeHeadwear",
2456
- description: "notifications.removeHeadwearDescription"
2457
- },
2458
- LENSES_ERROR: {
2459
- title: "notifications.lenses",
2460
- description: "notifications.lensesDescription"
2461
- },
2462
- FACE_NOT_FOUND: {
2463
- title: "notifications.faceNotFound",
2464
- description: "notifications.faceNotFoundDescription"
2465
- },
2466
- MULTIPLE_FACES: {
2467
- title: "notifications.multiple",
2468
- description: "notifications.multipleDescription"
2469
- },
2470
- TOO_BLURRY_ERROR: defaultError,
2471
- TOO_DARK_ERROR: defaultError,
2472
- SERVER_ERROR: defaultError,
2473
- FACE_CROPPING_FAILED: defaultError,
2474
- FACE_TOO_SMALL: defaultError,
2475
- PROCESSING_ERROR: defaultError,
2476
- BAD_REQUEST: defaultError,
2477
- USER_IS_NOT_RECOGNIZED: {
2478
- title: "notifications.accessDenied",
2479
- description: "notifications.accessDeniedDescription"
2480
- },
2481
- SPOOF_ATTEMPT_DETECTED: {
2482
- title: "notifications.spoof",
2483
- description: "notifications.spoofDescription"
2484
- },
2485
- FACE_TOO_DARK: {
2486
- title: "notifications.brightness",
2487
- description: "notifications.brightnessDescription"
2488
- },
2489
- LENSES_DETECTED: {
2490
- title: "notifications.lenses",
2491
- description: "notifications.lensesDescription"
2492
- },
2493
- FACE_MASK_DETECTED: {
2494
- title: "notifications.mask",
2495
- description: "notifications.maskDescription"
2496
- },
2497
- CLOSED_EYES_DETECTED: {
2498
- title: "notifications.closedEyes",
2499
- description: "notifications.closedEyesDescription"
2500
- },
2501
- HEAD_COVER_DETECTED: {
2502
- title: "notifications.removeHeadwear",
2503
- description: "notifications.removeHeadwearDescription"
2504
- },
2505
- FACE_TOO_BLURRY: {
2506
- title: "notifications.spoof",
2507
- description: "notifications.spoofDescription"
2508
- },
2509
- BAD_PHOTO_QUALITY: {
2510
- title: "notifications.lowQualityImage",
2511
- description: "notifications.lowQualityImageDescription"
2512
- },
2513
- NONEXISTENT_CUSTOMER: {
2514
- title: "notifications.nonexistentCustomer",
2515
- description: "notifications.nonexistentCustomerDescription"
2516
- },
2517
- HINT_NOT_PROVIDED: {
2518
- title: "notifications.hintNotProvided",
2519
- description: "notifications.hintNotProvidedDescription"
2520
- },
2521
- SELFIE_IMAGE_LOW_QUALITY: {
2522
- title: "notifications.selfieImageLowQuality",
2523
- description: "notifications.selfieImageLowQualityDescription"
2524
- }
2525
- };
2526
- var ERROR_CODES = [
2527
- "LIVENESS_ERROR",
2528
- "BRIGHTNESS_ERROR",
2529
- "LENSES_ERROR",
2530
- "MASK_ERROR",
2531
- "CLOSED_EYES_ERROR",
2532
- "HEAD_COVER_ERROR",
2533
- "SERVER_ERROR",
2534
- "FACE_NOT_FOUND",
2535
- "MULTIPLE_FACES",
2536
- "TOO_BLURRY_ERROR",
2537
- "TOO_DARK_ERROR",
2538
- "USER_IS_NOT_RECOGNIZED",
2539
- "SPOOF_ATTEMPT_DETECTED",
2540
- "FACE_TOO_DARK",
2541
- "LENSES_DETECTED",
2542
- "FACE_MASK_DETECTED",
2543
- "CLOSED_EYES_DETECTED",
2544
- "HEAD_COVER_DETECTED",
2545
- "FACE_CROPPING_FAILED",
2546
- "FACE_TOO_SMALL",
2547
- "FACE_TOO_BLURRY",
2548
- "BAD_PHOTO_QUALITY",
2549
- "PROCESSING_ERROR",
2550
- "BAD_REQUEST",
2551
- "NONEXISTENT_CUSTOMER",
2552
- "HINT_NOT_PROVIDED",
2553
- "SELFIE_IMAGE_LOW_QUALITY"
2554
- ];
2555
- var parseErrorCode = (error) => {
2556
- const upperError = error.toUpperCase();
2557
- if (upperError.includes("HTTP 400") || upperError.includes("BAD_REQUEST")) return "BAD_REQUEST";
2558
- if (upperError.includes("HTTP 500") || upperError.includes("SERVER_ERROR")) return "SERVER_ERROR";
2559
- for (const code of ERROR_CODES) if (upperError.includes(code)) return code;
2560
- return null;
2561
- };
2562
- var ErrorModal = ({ error, attemptsRemaining, onTryAgain }) => {
2563
- const { t } = useTranslation();
2564
- if (!error) return null;
2565
- const { title, description } = errorContent[parseErrorCode(error) ?? error] ?? defaultError;
2566
- const titleText = t(title) ?? title;
2567
- const descriptionText = attemptsRemaining <= 0 ? t("notifications.selfieCaptureFailedDescription") : t(description);
2568
- return /* @__PURE__ */ u(ErrorContent, {
2569
- "data-testid": "face-capture-error-modal",
2570
- title: titleText,
2571
- description: descriptionText,
2572
- attemptsRemaining,
2573
- onButtonClick: onTryAgain
2574
- });
2575
- };
2576
- //#endregion
2577
- //#region src/modules/selfie/faceOutline.tsx
2095
+ //#region src/shared/capture/faceOutline.tsx
2578
2096
  var FaceOutline = () => {
2579
2097
  return /* @__PURE__ */ u("svg", {
2580
2098
  width: "292",
@@ -2592,7 +2110,7 @@ var FaceOutline = () => {
2592
2110
  });
2593
2111
  };
2594
2112
  //#endregion
2595
- //#region src/modules/selfie/loadingBorder.tsx
2113
+ //#region src/shared/capture/loadingBorder.tsx
2596
2114
  var IDLE_COLOR = "var(--surface-neutral-100)";
2597
2115
  var getColor = (borderState) => {
2598
2116
  switch (borderState) {
@@ -2655,65 +2173,7 @@ var LoadingBorder = ({ borderState = "idle" }) => {
2655
2173
  });
2656
2174
  };
2657
2175
  //#endregion
2658
- //#region src/modules/selfie/cameraButton.tsx
2659
- var CameraButton = () => {
2660
- return /* @__PURE__ */ u("div", {
2661
- class: "IncodeCameraButton",
2662
- children: /* @__PURE__ */ u("svg", {
2663
- width: "64",
2664
- height: "64",
2665
- viewBox: "0 0 64 64",
2666
- fill: "none",
2667
- xmlns: "http://www.w3.org/2000/svg",
2668
- "aria-hidden": "true",
2669
- children: [
2670
- /* @__PURE__ */ u("circle", {
2671
- cx: "32",
2672
- cy: "32",
2673
- r: "32",
2674
- class: "IncodeCameraButtonBackground"
2675
- }),
2676
- /* @__PURE__ */ u("path", {
2677
- d: "M55.5874 31.8191C55.5872 18.6938 44.9464 8.0537 31.821 8.0537C18.6958 8.05385 8.05581 18.6939 8.05566 31.8191C8.05566 44.9444 18.6958 55.5853 31.821 55.5854C44.9465 55.5854 55.5874 44.9445 55.5874 31.8191ZM57.5566 31.8191C57.5566 46.0321 46.034 57.5547 31.821 57.5547C17.6082 57.5545 6.08643 46.032 6.08643 31.8191C6.08657 17.6063 17.6083 6.08462 31.821 6.08447C46.0339 6.08447 57.5565 17.6062 57.5566 31.8191Z",
2678
- class: "IncodeCameraButtonRing"
2679
- }),
2680
- /* @__PURE__ */ u("path", {
2681
- d: "M35.5186 20.6768C36.887 20.677 37.995 21.777 37.9951 23.1338V24.1045H41.4766C43.0397 24.1052 44.3074 25.3626 44.3076 26.9131V38.5459C44.3076 40.0966 43.0398 41.3535 41.4766 41.3535H21.5381C19.975 41.3533 18.7081 40.0965 18.708 38.5459V26.9131C18.7083 25.3627 19.9751 24.1057 21.5381 24.1055H25.0205V23.1338C25.0206 21.7769 26.1285 20.6768 27.4971 20.6768H35.5186ZM31.5068 26.5273C28.0604 26.5273 25.2559 29.309 25.2559 32.7285C25.2559 36.148 28.0604 38.9297 31.5068 38.9297C34.954 38.9297 37.7588 36.148 37.7588 32.7285C37.7588 29.309 34.954 26.5274 31.5068 26.5273ZM31.5068 28.6348C33.7835 28.6348 35.6357 30.4728 35.6357 32.7305C35.6356 34.9887 33.7833 36.8252 31.5068 36.8252C29.2303 36.8252 27.3791 34.9887 27.3789 32.7305C27.3789 30.4721 29.2302 28.6348 31.5068 28.6348Z",
2682
- class: "IncodeCameraButtonPath"
2683
- })
2684
- ]
2685
- })
2686
- });
2687
- };
2688
- //#endregion
2689
- //#region src/modules/selfie/manualCaptureButton.tsx
2690
- var ManualCaptureButton = D(({ onClick, disabled }, ref) => {
2691
- const { t } = useTranslation();
2692
- return /* @__PURE__ */ u("div", {
2693
- class: "IncodeSelfieManualCapture",
2694
- "data-testid": "manual-capture-button",
2695
- children: [
2696
- /* @__PURE__ */ u("p", {
2697
- id: "manual-capture-instructions",
2698
- class: "IncodeSelfieManualCaptureText",
2699
- children: t("selfiev2.manualCapture.instructions")
2700
- }),
2701
- /* @__PURE__ */ u(Spacer, { size: 32 }),
2702
- /* @__PURE__ */ u("div", { children: /* @__PURE__ */ u(Button, {
2703
- ref,
2704
- id: "manual-capture-button",
2705
- variant: "link",
2706
- onClick,
2707
- disabled,
2708
- class: "IncodeSelfieManualCaptureButton",
2709
- "aria-label": t("selfiev2.manualCapture.captureButton"),
2710
- children: /* @__PURE__ */ u(CameraButton, {})
2711
- }) })
2712
- ]
2713
- });
2714
- });
2715
- //#endregion
2716
- //#region src/modules/selfie/notification.tsx
2176
+ //#region src/shared/capture/notification.tsx
2717
2177
  var Notification = ({ detectionState, disabled }) => {
2718
2178
  const { t } = useTranslation();
2719
2179
  const liveRef = A(null);
@@ -2741,7 +2201,8 @@ var Notification = ({ detectionState, disabled }) => {
2741
2201
  faceMask: t("notifications.mask"),
2742
2202
  centerFace: t("notifications.centerFaceV2"),
2743
2203
  getReady: t("notifications.getReady"),
2744
- capturing: t("idv2.capture.takingPhoto")
2204
+ capturing: t("idv2.capture.takingPhoto"),
2205
+ error: t("common.tryAgain")
2745
2206
  }[detectionState] ?? "";
2746
2207
  const announce = q((message) => {
2747
2208
  const now = Date.now();
@@ -2821,154 +2282,4 @@ var Notification = ({ detectionState, disabled }) => {
2821
2282
  }), /* @__PURE__ */ u(Spacer, { size: 24 })] }) : null] });
2822
2283
  };
2823
2284
  //#endregion
2824
- //#region src/modules/selfie/capture.tsx
2825
- var Capture = ({ manager, state }) => {
2826
- const { captureStatus, stream, detectionStatus, attemptsRemaining, uploadError, assistedOnboarding, ageAssurance, onDeviceMode, obfuscateWithAvatar, avatarCanvas, avatarVariant } = state;
2827
- const [isManualCapturing, setIsManualCapturing] = d(false);
2828
- const { t } = useTranslation();
2829
- const manualCaptureRef = A(null);
2830
- y(() => {
2831
- if (detectionStatus === "manualCapture") manualCaptureRef.current?.focus();
2832
- }, [detectionStatus]);
2833
- if (captureStatus === "initializing") return /* @__PURE__ */ u(TransitionSpinner, { spinnerConfig: { subtitle: t("loadingCircle.preparingCamera") } });
2834
- if (captureStatus === "detecting") {
2835
- if (detectionStatus === "offline") return /* @__PURE__ */ u(Page, { title: "No internet connection" });
2836
- const getBorderState = () => {
2837
- if (isManualCapturing) return "capturing";
2838
- if (detectionStatus === "detecting") return "idle";
2839
- if (detectionStatus === "getReady") return "loading";
2840
- if (detectionStatus === "getReadyFinished") return "loading";
2841
- if (detectionStatus === "success") return "success";
2842
- if (detectionStatus === "error") return "error";
2843
- return "idle";
2844
- };
2845
- return /* @__PURE__ */ u(Page, {
2846
- "data-testid": "capture-container",
2847
- children: [
2848
- /* @__PURE__ */ u(Title, {
2849
- className: "IncodeCaptureVisuallyHidden",
2850
- children: t("selfiev2.capture.title")
2851
- }),
2852
- /* @__PURE__ */ u(Spacer, { size: 48 }),
2853
- /* @__PURE__ */ u("div", {
2854
- class: "IncodeCaptureContainer",
2855
- children: [
2856
- /* @__PURE__ */ u(LoadingBorder, { borderState: getBorderState() }),
2857
- /* @__PURE__ */ u("div", {
2858
- class: "IncodeCaptureFrame",
2859
- children: /* @__PURE__ */ u("div", {
2860
- class: "IncodeCaptureVideoWrapper",
2861
- "aria-hidden": "true",
2862
- children: stream ? /* @__PURE__ */ u(k, { children: [obfuscateWithAvatar ? /* @__PURE__ */ u(AvatarCanvas, {
2863
- canvas: avatarCanvas,
2864
- mirrored: !assistedOnboarding
2865
- }) : /* @__PURE__ */ u(Video, {
2866
- stream,
2867
- mirrored: !assistedOnboarding
2868
- }), obfuscateWithAvatar && avatarVariant !== "privacy-lens" ? null : /* @__PURE__ */ u("div", {
2869
- class: "IncodeCaptureVideo",
2870
- children: /* @__PURE__ */ u(FaceOutline, {})
2871
- })] }) : null
2872
- })
2873
- }),
2874
- /* @__PURE__ */ u(Spacer, { size: 32 }),
2875
- detectionStatus ? /* @__PURE__ */ u(Notification, {
2876
- detectionState: detectionStatus,
2877
- disabled: !!uploadError || isManualCapturing
2878
- }) : null,
2879
- detectionStatus === "manualCapture" && !onDeviceMode ? /* @__PURE__ */ u(ManualCaptureButton, {
2880
- ref: manualCaptureRef,
2881
- onClick: () => {
2882
- setIsManualCapturing(true);
2883
- manager.capture();
2884
- },
2885
- disabled: isManualCapturing
2886
- }) : null
2887
- ]
2888
- }),
2889
- uploadError ? /* @__PURE__ */ u(ErrorModal, {
2890
- error: uploadError,
2891
- attemptsRemaining,
2892
- onTryAgain: () => {
2893
- manager.retryCapture();
2894
- setIsManualCapturing(false);
2895
- }
2896
- }) : null
2897
- ]
2898
- });
2899
- }
2900
- if (captureStatus === "capturing") return /* @__PURE__ */ u(Page, {
2901
- className: "IncodeCaptureCapturingPage",
2902
- title: "Capturing",
2903
- subtitle: "Taking photo...",
2904
- children: /* @__PURE__ */ u("div", {
2905
- class: "IncodeCaptureCapturingActions",
2906
- children: /* @__PURE__ */ u(Button, {
2907
- isLoading: true,
2908
- children: "Capturing..."
2909
- })
2910
- })
2911
- });
2912
- if (captureStatus === "uploading") return /* @__PURE__ */ u(CaptureStatusPage, {
2913
- className: "IncodeCaptureStatusUploading",
2914
- isLoading: true,
2915
- icon: /* @__PURE__ */ u(LoadingIcon, { size: 64 }),
2916
- title: t(ageAssurance ? "idv2.capture.processing.verifying" : "idv2.capture.processing.uploading")
2917
- });
2918
- if (captureStatus === "uploadError") return /* @__PURE__ */ u(ErrorModal, {
2919
- error: uploadError,
2920
- attemptsRemaining,
2921
- onTryAgain: () => {
2922
- manager.retryCapture();
2923
- setIsManualCapturing(false);
2924
- }
2925
- });
2926
- if (captureStatus === "success") return /* @__PURE__ */ u(CaptureStatusPage, {
2927
- icon: /* @__PURE__ */ u(SuccessIcon, { size: 64 }),
2928
- title: t("idv2.capture.processing.success")
2929
- });
2930
- return null;
2931
- };
2932
- var Video = ({ stream, mirrored }) => {
2933
- const ref = A(null);
2934
- y(() => {
2935
- if (ref.current && stream) ref.current.srcObject = stream;
2936
- }, [stream]);
2937
- return /* @__PURE__ */ u("video", {
2938
- ref,
2939
- autoplay: true,
2940
- playsInline: true,
2941
- muted: true,
2942
- "aria-hidden": "true",
2943
- class: mirrored ? "IncodeCaptureVideoElement IncodeCaptureVideoMirrored" : "IncodeCaptureVideoElement"
2944
- });
2945
- };
2946
- //#endregion
2947
- //#region src/modules/selfie/tutorial.tsx
2948
- var Tutorial = ({ manager, ageAssurance = false }) => {
2949
- const { t } = useTranslation();
2950
- const [isLoading, setIsLoading] = d(false);
2951
- const [animationData, setAnimationData] = d(null);
2952
- y(() => {
2953
- import("./selfieTutorial-CYa8bq6B.js").then((module) => {
2954
- setAnimationData(module.default);
2955
- });
2956
- }, []);
2957
- const handleContinue = async () => {
2958
- setIsLoading(true);
2959
- await manager.nextStep();
2960
- };
2961
- return /* @__PURE__ */ u(BaseTutorial, {
2962
- animationData,
2963
- title: t(ageAssurance ? "face.tutorial.ageAssuranceTitle" : "face.tutorial.title"),
2964
- titleId: "face-tutorial-heading",
2965
- subtitle: t(ageAssurance ? "face.tutorial.ageAssuranceSubtitle" : "face.tutorial.subtitle"),
2966
- onContinue: handleContinue,
2967
- buttonText: t(ageAssurance ? "face.tutorial.ageAssuranceStartCapture" : "face.tutorial.startCapture"),
2968
- disclaimerText: t("face.tutorial.autoCapture"),
2969
- isLoading,
2970
- className: "IncodeSelfieTutorial"
2971
- });
2972
- };
2973
- //#endregion
2974
- export { Lottie as a, BaseTutorial as i, Capture as n, ErrorContent as o, Permissions as r, Tutorial as t };
2285
+ export { Permissions as i, LoadingBorder as n, FaceOutline as r, Notification as t };