@incodetech/web 2.0.1-rc.0 → 2.1.0-rc.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (253) hide show
  1. package/dist/ae-signature/ae-signature.es.js +15 -13
  2. package/dist/ae-signature/styles.css +3 -17
  3. package/dist/ae-signature/styles2.css +15 -5
  4. package/dist/aligndevicelottie-DY_bX_p8.js +12769 -0
  5. package/dist/antifraud/antifraud.es.js +23 -16
  6. package/dist/authentication/authentication.es.js +42 -27
  7. package/dist/autoFocusTitle-BzkUiELM.js +29 -0
  8. package/dist/{back-horizontal-hint-B8Brxh3U.js → back-horizontal-hint-D_8LptLm.js} +26 -26
  9. package/dist/back-tutorial-vb1MxlrT.js +14597 -0
  10. package/dist/{back-vertical-hint-BBo36dxn.js → back-vertical-hint-C1evxxq2.js} +27 -27
  11. package/dist/backdevicelottie-HypPqBz7.js +16690 -0
  12. package/dist/base.css +1258 -104
  13. package/dist/blurdevicelottie-CBXtBFiJ.js +15951 -0
  14. package/dist/bottomSheet-F1GJfQx_.js +39 -0
  15. package/dist/browser-ponyfill-CLLvZCVg.js +441 -0
  16. package/dist/button-CM_hgyIP.js +35 -0
  17. package/dist/checkbox-BoeLHKgp.js +96 -0
  18. package/dist/consent/consent.es.js +89 -73
  19. package/dist/consent/styles.css +35 -22
  20. package/dist/countrySelector-mSWyHSy4.js +60 -0
  21. package/dist/cpf-ocr/cpf-ocr.es.js +2 -0
  22. package/dist/cpfOcr-MtpRztkG.js +92 -0
  23. package/dist/cpfOcr-jJkYCfsX.js +2 -0
  24. package/dist/cross-document-data-match/cross-document-data-match.es.js +20 -16
  25. package/dist/curp-validation/curp-validation.es.js +247 -203
  26. package/dist/customFields-DXXt9HGM.js +140 -0
  27. package/dist/customWatchlist-DsW04UF6.js +36 -0
  28. package/dist/dateInputComposed-C_mh4XBg.js +69 -0
  29. package/dist/dateInputComposed-Cy6a7ymh.js +1 -0
  30. package/dist/defineProperty-mefzVtTv.js +39 -0
  31. package/dist/document-capture/document-capture.es.js +2 -0
  32. package/dist/document-capture/styles.css +2 -5
  33. package/dist/documentCapture-8ypBJehw.js +2 -0
  34. package/dist/documentCapture-BDV_921m.js +880 -0
  35. package/dist/dropdownComposed-CEWBSdGl.js +1 -0
  36. package/dist/dropdownComposed-_fgAlo_C.js +380 -0
  37. package/dist/dynamic-forms/styles.css +25 -13
  38. package/dist/dynamicForms-DyfnsS7E.js +352 -0
  39. package/dist/ekyb/ekyb.es.js +2 -2
  40. package/dist/ekyb/styles.css +2 -0
  41. package/dist/ekybModule-CIPGmCvD.js +279 -0
  42. package/dist/ekybModule-DFoYpheB.js +2 -0
  43. package/dist/ekyc/ekyc.es.js +2 -2
  44. package/dist/ekyc/styles.css +9 -7
  45. package/dist/ekycModule-BGzwgjl1.js +2 -0
  46. package/dist/ekycModule-BuTaC5ct.js +257 -0
  47. package/dist/electronic-signature/electronic-signature.es.js +2 -2
  48. package/dist/electronic-signature-B-Q7M0wK.js +430 -0
  49. package/dist/email/email.es.js +199 -66
  50. package/dist/emailInput-KZmhjOdZ.js +39 -0
  51. package/dist/errorIcon-DJRZpd8j.js +26 -0
  52. package/dist/expiredId-Q1t6aVpk.js +85 -0
  53. package/dist/extensibility-Cs3KQQdC.js +3070 -0
  54. package/dist/extensibility.es.js +26 -25
  55. package/dist/face-match/face-match.es.js +2 -2
  56. package/dist/face-match/styles.css +0 -4
  57. package/dist/faceMatch--RDHJe4t.js +343 -0
  58. package/dist/faceMatch-yEKPYaym.js +2 -0
  59. package/dist/field-comparison/field-comparison.es.js +2 -0
  60. package/dist/field-comparison/styles.css +16 -0
  61. package/dist/fieldComparison-CAF86bTC.js +88 -0
  62. package/dist/fieldComparison-D0an7T_g.js +2 -0
  63. package/dist/fiscal-qr/fiscal-qr.es.js +224 -0
  64. package/dist/fiscal-qr/styles.css +71 -0
  65. package/dist/{flip-animation-CgwRsEmK.js → flip-animation-BGRvygw9.js} +4221 -4221
  66. package/dist/flow/flow.es.js +619 -484
  67. package/dist/flow/styles.css +378 -418
  68. package/dist/{front-horizontal-hint-DGGGi8e1.js → front-horizontal-hint-Uf5bHCsd.js} +70 -70
  69. package/dist/{front-vertical-hint-CNr5mE6Q.js → front-vertical-hint-DdWNA45v.js} +81 -81
  70. package/dist/frontdevicelottie-CLqitJhG.js +17314 -0
  71. package/dist/geolocation/geolocation.es.js +486 -395
  72. package/dist/glaredevicelottie-BS04U6Fc.js +14478 -0
  73. package/dist/governmentValidation/governmentValidation.es.js +166 -93
  74. package/dist/governmentValidation/styles.css +0 -17
  75. package/dist/homeScreen-BZnIEDrV.js +264 -0
  76. package/dist/hooks-Da_yP_Dr.js +149 -0
  77. package/dist/i18n-CoCO2ZuN.js +2971 -0
  78. package/dist/icons-Dbs9ZfYM.js +360 -0
  79. package/dist/id/id.es.js +583 -414
  80. package/dist/id/styles.css +59 -43
  81. package/dist/id-laser-h-DX8UbVNH.js +467 -0
  82. package/dist/id-laser-v-DhnHdjlB.js +490 -0
  83. package/dist/id-tutorial-lj4iKtYT.js +13165 -0
  84. package/dist/id-verification/id-verification.es.js +21 -17
  85. package/dist/idOcr-CjGbb4dB.js +123 -0
  86. package/dist/identity-reuse/identity-reuse.es.js +311 -182
  87. package/dist/identity-reuse/styles.css +134 -80
  88. package/dist/incode-logo-57XFniXU.js +4 -0
  89. package/dist/incodeComponent-wfnHlnXx.js +63 -0
  90. package/dist/incodeModule-BUDoTwT9.js +13 -0
  91. package/dist/index.es.js +16 -13
  92. package/dist/inputComposed-BEn7_nZd.js +1 -0
  93. package/dist/inputComposed-CQ4AsvZg.js +99 -0
  94. package/dist/loadingIcon-B0ysgiNq.js +148 -0
  95. package/dist/lottie_light-Dp9Bz3mf.js +9031 -0
  96. package/dist/mandatoryConsent-r0PQHmv-.js +107 -0
  97. package/dist/modal-nTSaG7nB.js +139 -0
  98. package/dist/modal.hooks-D2xhIuHA.js +195 -0
  99. package/dist/numberedStep-CEtwZqLp.js +13 -0
  100. package/dist/optionAccessibleLabel-CnA-mNAU.js +202 -0
  101. package/dist/otpInput-_JmtVwa0.js +195 -0
  102. package/dist/page-DxGQj7Gk.js +71 -0
  103. package/dist/{passport-horizontal-hint-Bgquwtac.js → passport-horizontal-hint-Bbm2mvSn.js} +55 -55
  104. package/dist/{passport-tutorial-DwRwtPVX.js → passport-tutorial-zT1ZoA-D.js} +7096 -7084
  105. package/dist/{passport-vertical-hint-BT1D5BrW.js → passport-vertical-hint-DJbCtBiM.js} +49 -49
  106. package/dist/pdf-BZA70WbM.js +22398 -0
  107. package/dist/pdfViewer-BK-yVIve.js +114 -0
  108. package/dist/phone/phone.es.js +214 -70
  109. package/dist/phoneInputComposed-DjNdsmPE.js +12142 -0
  110. package/dist/processing-BM-wT-1W.js +8 -0
  111. package/dist/qe-signature/qe-signature.es.js +15 -13
  112. package/dist/radioGroupComposed-BNuaopVr.js +215 -0
  113. package/dist/redirect-to-mobile/redirect-to-mobile.es.js +2774 -0
  114. package/dist/redirect-to-mobile/styles.css +19 -269
  115. package/dist/registerIncodeElement-77NGCDsy.js +11 -0
  116. package/dist/requiredLabelHint-DEadtiwx.js +17 -0
  117. package/dist/richText-Cf9aMOCk.js +3153 -0
  118. package/dist/rolldown-runtime--E5BIlTp.js +33 -0
  119. package/dist/selfie/selfie.es.js +54 -37
  120. package/dist/selfie/styles.css +0 -4
  121. package/dist/selfieTutorial-CtruLyO2.js +2689 -0
  122. package/dist/signature/signature.es.js +778 -405
  123. package/dist/snackbar-CxepGC3e.js +16 -0
  124. package/dist/spinner-B6RxGFrI.js +1 -0
  125. package/dist/spinner-D8a_2LvW.js +42 -0
  126. package/dist/statusPage-DMYPUwRZ.js +28 -0
  127. package/dist/successIcon-BAyDPT7I.js +30 -0
  128. package/dist/tabs-C8npVBbk.js +103 -0
  129. package/dist/themes/dark.css +5 -0
  130. package/dist/themes/light.css +4 -0
  131. package/dist/transitionSpinner-DRRz-NV8.js +26 -0
  132. package/dist/{tutorial-9vHAHvMK.js → tutorial-D1qaY2Tm.js} +1105 -856
  133. package/dist/types/ae-signature.d.ts +4 -1
  134. package/dist/types/antifraud.d.ts +9 -3
  135. package/dist/types/authentication.d.ts +4 -1
  136. package/dist/types/consent.d.ts +4 -1
  137. package/dist/types/cpf-ocr.d.ts +12 -0
  138. package/dist/types/cross-document-data-match.d.ts +4 -1
  139. package/dist/types/curp-validation.d.ts +9 -3
  140. package/dist/types/document-capture.d.ts +37 -0
  141. package/dist/types/ekyb.d.ts +4 -1
  142. package/dist/types/ekyc.d.ts +4 -1
  143. package/dist/types/electronic-signature.d.ts +4 -1
  144. package/dist/types/email.d.ts +4 -1
  145. package/dist/types/extensibility.d.ts +40 -15
  146. package/dist/types/face-match.d.ts +4 -1
  147. package/dist/types/field-comparison.d.ts +38 -0
  148. package/dist/types/fiscal-qr.d.ts +43 -0
  149. package/dist/types/flow.d.ts +5 -2
  150. package/dist/types/geolocation.d.ts +4 -1
  151. package/dist/types/governmentValidation.d.ts +4 -1
  152. package/dist/types/id-verification.d.ts +4 -1
  153. package/dist/types/id.d.ts +4 -1
  154. package/dist/types/identity-reuse.d.ts +4 -1
  155. package/dist/types/index.d.ts +20 -2
  156. package/dist/types/phone.d.ts +4 -1
  157. package/dist/types/qe-signature.d.ts +4 -1
  158. package/dist/types/redirect-to-mobile.d.ts +17 -0
  159. package/dist/types/selfie.d.ts +4 -1
  160. package/dist/types/signature.d.ts +4 -1
  161. package/dist/types/watchlist.d.ts +4 -1
  162. package/dist/types/workflow.d.ts +55 -11
  163. package/dist/typography-YLgHHuao.js +45 -0
  164. package/dist/uiConfig-D2_wawvr.js +25 -0
  165. package/dist/useModuleLoader-CeJ2jL25.js +672 -0
  166. package/dist/vendor-preact-DThS2ZQ_.js +955 -0
  167. package/dist/verificationResult-Do5SpZ6X.js +64 -0
  168. package/dist/verifiedByIncode-DjXOdCml.js +103 -0
  169. package/dist/watchlist/watchlist.es.js +31 -28
  170. package/dist/watchlistForBusiness-BFFXC9d-.js +80 -0
  171. package/dist/workflow/styles.css +449 -427
  172. package/dist/workflow/workflow.es.js +268 -182
  173. package/package.json +32 -10
  174. package/dist/aligndevicelottie-DoV8xKjh.js +0 -12757
  175. package/dist/autoFocusTitle-QexamZ4i.js +0 -16
  176. package/dist/back-tutorial-1NOQobGO.js +0 -14585
  177. package/dist/backdevicelottie-C_ceuqY7.js +0 -16678
  178. package/dist/blurdevicelottie-UO14Y0WC.js +0 -15939
  179. package/dist/bottomSheet-DE_8TFEC.js +0 -31
  180. package/dist/browser-ponyfill-jOkuz57z.js +0 -299
  181. package/dist/button-DcCUEn2n.js +0 -24
  182. package/dist/checkbox-Cl57ltq_.js +0 -85
  183. package/dist/countrySelector-CE-JgIsv.js +0 -58
  184. package/dist/cpfOcr-D_tbwbvh.js +0 -78
  185. package/dist/customFields-CW38fQUv.js +0 -127
  186. package/dist/customWatchlist-D9_yjEQd.js +0 -33
  187. package/dist/dateInputComposed-BpAGsjN6.js +0 -55
  188. package/dist/dateInputComposed-DU3o6PAV.js +0 -1
  189. package/dist/defineProperty-Dh8nSJpJ.js +0 -39
  190. package/dist/documentCapture-xX-JT7ZY.js +0 -763
  191. package/dist/dropdownComposed-DFRBG22E.js +0 -284
  192. package/dist/dropdownComposed-DwTzc2YU.js +0 -1
  193. package/dist/dynamicForms-CJP1Ia6Q.js +0 -262
  194. package/dist/ekybModule-BSs7mndb.js +0 -280
  195. package/dist/ekybModule-D9M3E2Gm.js +0 -2
  196. package/dist/ekycModule-CU9pt5YN.js +0 -246
  197. package/dist/ekycModule-CZw9cLno.js +0 -2
  198. package/dist/electronic-signature-COYXjGdd.js +0 -410
  199. package/dist/emailInput-DppGf9pv.js +0 -37
  200. package/dist/expiredId-BnmzE8T3.js +0 -70
  201. package/dist/extensibility-CzEJfRwo.js +0 -2586
  202. package/dist/faceMatch-B8j0g0Yo.js +0 -2
  203. package/dist/faceMatch-BV8UD7tj.js +0 -201
  204. package/dist/frontdevicelottie-Bu6f9fDE.js +0 -17302
  205. package/dist/glaredevicelottie-B10axYs_.js +0 -14466
  206. package/dist/homeScreen-DnP1jw9A.js +0 -227
  207. package/dist/hooks-BVnGysT7.js +0 -80
  208. package/dist/i18n-9s4OSqwi.js +0 -2010
  209. package/dist/icons-Cc7zwchP.js +0 -310
  210. package/dist/id-laser-h-mBAzHVOK.js +0 -467
  211. package/dist/id-laser-v-CrFg4bcJ.js +0 -483
  212. package/dist/id-tutorial-BCr42Pnn.js +0 -13153
  213. package/dist/idOcr-CCjfWQvH.js +0 -94
  214. package/dist/incode-logo-DX016usY.js +0 -4
  215. package/dist/incodeComponent-C1o4M0ZK.js +0 -50
  216. package/dist/incodeModule-BqCjVgEI.js +0 -18
  217. package/dist/inputComposed-APSw8C7o.js +0 -89
  218. package/dist/inputComposed-XYrarFxS.js +0 -1
  219. package/dist/loadingIcon-BN5YRQUb.js +0 -104
  220. package/dist/mandatoryConsent-DssKMC3v.js +0 -100
  221. package/dist/modal-NMxsQHAO.js +0 -135
  222. package/dist/modal.hooks-CAjcIFZK.js +0 -126
  223. package/dist/numberedStep-CT-alrK5.js +0 -11
  224. package/dist/optionAccessibleLabel-CzEeX3Q4.js +0 -140
  225. package/dist/otpInput-DqRA_egd.js +0 -145
  226. package/dist/page-C1yT4DLb.js +0 -69
  227. package/dist/pdf-BurGZ08w.js +0 -14967
  228. package/dist/pdfViewer-BGBNL1Ea.js +0 -63
  229. package/dist/phoneInputComposed-bvWhGLFZ.js +0 -11206
  230. package/dist/processing-G_y3o32b.js +0 -6
  231. package/dist/radioGroupComposed-BbmvxmD2.js +0 -177
  232. package/dist/redirectToMobile-C3k1gloW.js +0 -1514
  233. package/dist/requiredLabelHint-BLwgqozE.js +0 -13
  234. package/dist/richText-DbJ5sl2n.js +0 -1973
  235. package/dist/rolldown-runtime-CYMK-g2i.js +0 -20
  236. package/dist/selfieTutorial-BgrlUMXP.js +0 -2677
  237. package/dist/snackbar-BDp8x7Cv.js +0 -14
  238. package/dist/spinner-B4dcie2T.js +0 -1
  239. package/dist/spinner-CKnjVHxw.js +0 -39
  240. package/dist/statusPage-CUI7ApcU.js +0 -28
  241. package/dist/successIcon-DbILeIz_.js +0 -28
  242. package/dist/tabs-DaPyP71c.js +0 -78
  243. package/dist/transitionSpinner-PIEPU2Vx.js +0 -17
  244. package/dist/types/cpf-ocr/styles.d.ts +0 -1
  245. package/dist/types/document-capture/styles.d.ts +0 -1
  246. package/dist/types/redirect-to-mobile/styles.d.ts +0 -1
  247. package/dist/typography-CxjaknHN.js +0 -28
  248. package/dist/uiConfig-CwpQ-IM6.js +0 -20
  249. package/dist/useModuleLoader-BFiVA41N.js +0 -432
  250. package/dist/vendor-preact-D6SntenC.js +0 -958
  251. package/dist/verificationResult-BrVbUJ4U.js +0 -97
  252. package/dist/verifiedByIncode-ChZBpqNy.js +0 -101
  253. package/dist/watchlistForBusiness-BcSNtHCV.js +0 -77
package/dist/id/id.es.js CHANGED
@@ -1,38 +1,39 @@
1
- import { n as e } from "../i18n-9s4OSqwi.js";
2
- import { _ as t, c as n, d as r, l as i, o as a, p as o, v as s } from "../vendor-preact-D6SntenC.js";
3
- import { o as c } from "../hooks-BVnGysT7.js";
4
- import { t as l } from "../incodeComponent-C1o4M0ZK.js";
5
- import { n as u } from "../loadingIcon-BN5YRQUb.js";
6
- import { t as d } from "../page-C1yT4DLb.js";
7
- import { a as f, i as p, n as m, o as h, r as ee, s as te, t as g } from "../extensibility-CzEJfRwo.js";
8
- import { t as _ } from "../spinner-CKnjVHxw.js";
9
- import "../spinner-B4dcie2T.js";
10
- import { t as v } from "../transitionSpinner-PIEPU2Vx.js";
11
- import { t as y } from "../processing-G_y3o32b.js";
12
- import { t as b } from "../button-DcCUEn2n.js";
13
- import { g as x, s as S } from "../icons-Cc7zwchP.js";
14
- import { t as C } from "../successIcon-DbILeIz_.js";
15
- import { a as w, o as T, r as E } from "../tutorial-9vHAHvMK.js";
16
- import { t as D } from "../pdfViewer-BGBNL1Ea.js";
17
- import { t as ne } from "../incodeModule-BqCjVgEI.js";
18
- import { t as re } from "../id-laser-v-CrFg4bcJ.js";
19
- import { t as O } from "../tabs-DaPyP71c.js";
20
- import { createIdCaptureManager as k } from "@incodetech/core/id";
1
+ import { n as useTranslation } from "../i18n-CoCO2ZuN.js";
2
+ import { _ as y, c as z, d as T, l as A, o as P, p as d, v as u, x as k } from "../vendor-preact-DThS2ZQ_.js";
3
+ import { c as useManager, o as useModuleTerminalCallbacks } from "../hooks-Da_yP_Dr.js";
4
+ import { t as IncodeComponent } from "../incodeComponent-wfnHlnXx.js";
5
+ import { n as cn } from "../loadingIcon-B0ysgiNq.js";
6
+ import { t as Page } from "../page-DxGQj7Gk.js";
7
+ import { a as IdNoAttempts, i as Capture, n as Chooser, o as IdExpired, r as Tutorial, s as IdError, t as FlipAnimation, y as ProgressBar } from "../extensibility-Cs3KQQdC.js";
8
+ import { t as Spinner } from "../spinner-D8a_2LvW.js";
9
+ import "../spinner-B6RxGFrI.js";
10
+ import { t as TransitionSpinner } from "../transitionSpinner-DRRz-NV8.js";
11
+ import { t as Processing } from "../processing-BM-wT-1W.js";
12
+ import { t as Button } from "../button-CM_hgyIP.js";
13
+ import { t as ErrorIcon } from "../errorIcon-DJRZpd8j.js";
14
+ import { s as ChevronRightIcon } from "../icons-Dbs9ZfYM.js";
15
+ import { t as SuccessIcon } from "../successIcon-BAyDPT7I.js";
16
+ import { a as Lottie, o as ErrorContent, r as Permissions } from "../tutorial-D1qaY2Tm.js";
17
+ import { t as PdfViewer } from "../pdfViewer-BK-yVIve.js";
18
+ import { t as registerIncodeModuleElement } from "../incodeModule-BUDoTwT9.js";
19
+ import { t as id_laser_v_default } from "../id-laser-v-DhnHdjlB.js";
20
+ import { t as Tabs } from "../tabs-C8npVBbk.js";
21
+ import { createIdCaptureManager } from "@incodetech/core/id";
21
22
  //#region src/shared/fonts/preloadDisplayFont.ts
22
- var A = !1;
23
- function j() {
24
- if (A || typeof document > "u") return;
25
- let e = document.fonts;
26
- e?.load && (A = !0, e.load("800 1rem \"Rethink Sans\"").catch(() => {}));
23
+ function preloadDisplayFont() {
24
+ if (typeof document === "undefined") return;
25
+ const fonts = document.fonts;
26
+ if (!fonts?.load) return;
27
+ fonts.load("800 1rem \"Rethink Sans\"").catch(() => {});
27
28
  }
28
- function M() {
29
- t(() => {
30
- j();
29
+ function usePreloadDisplayFont() {
30
+ y(() => {
31
+ preloadDisplayFont();
31
32
  }, []);
32
33
  }
33
34
  //#endregion
34
35
  //#region src/modules/id/ageVerification/ageVerification.tsx
35
- var N = [
36
+ var steps = [
36
37
  {
37
38
  textKey: "idv2.ageVerificationPage.showYourIdAndScanIt",
38
39
  imageUrl: "data:image/svg+xml,%3csvg%20preserveAspectRatio='none'%20width='100%25'%20height='100%25'%20overflow='visible'%20viewBox='0%200%2096%2064'%20fill='none'%20xmlns='http://www.w3.org/2000/svg'%3e%3cg%20id='id'%3e%3crect%20width='96'%20height='64'%20rx='4'%20fill='var(--fill-0,%20%23E5F0FF)'/%3e%3cpath%20id='bg-white'%20d='M9%2011C9%209.34315%2010.3431%208%2012%208H83.9996C85.6564%208%2086.9996%209.34315%2086.9996%2011V51C86.9996%2052.6569%2085.6564%2054%2083.9996%2054H12C10.3432%2054%209%2052.6569%209%2051V11Z'%20fill='var(--fill-0,%20%23C9C9C9)'%20fill-opacity='0.8'/%3e%3cpath%20id='bg'%20d='M10.4336%2011.4297C10.4336%2010.3251%2011.329%209.42969%2012.4336%209.42969L83.1836%209.42969C84.2882%209.42969%2085.1836%2010.3251%2085.1836%2011.4297V50.2864C85.1836%2051.3909%2084.2882%2052.2864%2083.1836%2052.2864L12.4336%2052.2864C11.329%2052.2864%2010.4336%2051.3909%2010.4336%2050.2864L10.4336%2011.4297Z'%20fill='var(--fill-0,%20white)'/%3e%3cpath%20id='Line%202%20(Stroke)'%20fill-rule='evenodd'%20clip-rule='evenodd'%20d='M14.4204%2020.3907C14.4206%2019.8405%2014.8668%2019.3945%2015.417%2019.3945L80.1999%2019.3945C80.7504%2019.3945%2081.1966%2019.8408%2081.1966%2020.3912C81.1966%2020.9416%2080.7504%2021.3879%2080.1999%2021.3879L15.417%2021.3879C14.8664%2021.3879%2014.4201%2020.9414%2014.4204%2020.3907Z'%20fill='var(--fill-0,%20%23C9C9C9)'%20fill-opacity='0.5'/%3e%3cpath%20id='shapes'%20d='M46.3135%2046.3066H38.3398V43.3164H46.3135V46.3066ZM62.2598%2040.3262H38.3398V37.3359H62.2598V40.3262ZM56.2803%2034.3457L38.3398%2034.3457V31.3555H56.2803V34.3457ZM56.2803%2028.3652H38.3398V25.375H56.2803V28.3652Z'%20fill='var(--fill-0,%20%23C9C9C9)'%20fill-opacity='0.5'/%3e%3crect%20id='shapes_2'%20x='14.4199'%20y='12.418'%20width='30.8967'%20height='3.98667'%20rx='1'%20fill='var(--fill-0,%20%23C9C9C9)'%20fill-opacity='0.5'/%3e%3crect%20id='shapes_3'%20x='74.833'%20y='12.4902'%20width='5.98'%20height='3.93138'%20fill='var(--fill-0,%20%23EAF0F6)'/%3e%3cg%20id='img-lef'%3e%3crect%20id='bg_2'%20x='14.5'%20y='23.5'%20width='21'%20height='24'%20rx='2'%20fill='var(--fill-0,%20%23006AFF)'/%3e%3cpath%20id='neck'%20d='M21.668%2040.4193C21.6578%2041.1962%2020.3094%2041.4448%2019.4033%2042.3191C20.9799%2043.4551%2023.2584%2044.2192%2024.8349%2044.2192C26.6695%2044.2193%2028.7902%2043.4551%2030.3667%2042.3191C29.4606%2041.4448%2028.0296%2041.1975%2028.0105%2040.4193C28.0105%2040.124%2028.0115%2037.2468%2028.0129%2036.9514C28.0129%2031.9788%2021.4785%2029.0203%2021.6594%2037.0327C21.6628%2038.1615%2021.668%2039.2905%2021.668%2040.4193Z'%20fill='url(%23paint0_linear_0_546)'/%3e%3cpath%20id='tshirt'%20d='M28.9864%2041.3224C28.9864%2041.3224%2033.9028%2042.9122%2034.8516%2044.6261C35.0635%2045.0089%2035.2528%2045.5041%2035.4229%2046.0412C35.1866%2046.8824%2034.4168%2047.5002%2033.5%2047.5002H16.5C15.3955%2047.5002%2014.5001%2046.6047%2014.5%2045.5002V43.9797C16.2627%2042.5328%2020.7071%2041.3224%2020.7071%2041.3224C20.7071%2042.3611%2023.2872%2043.9872%2024.8467%2044.0138C27.0213%2044.0138%2028.9864%2042.3617%2028.9864%2041.3224Z'%20fill='var(--fill-0,%20%23CECECE)'/%3e%3cpath%20id='shadow'%20d='M21.6689%2037.2958C24.0023%2037.047%2026.1992%2038.9562%2026.1992%2038.9562C26.1992%2038.9562%2025.7637%2041.3043%2021.6689%2040.6219V37.2958Z'%20fill='var(--fill-0,%20%23CDCDCD)'/%3e%3cpath%20id='ear'%20d='M30.4589%2033.2935C30.5836%2032.8283%2030.3075%2032.3501%2029.8422%2032.2254L29.7507%2032.2009C29.3228%2032.0863%2028.877%2032.3105%2028.7141%2032.7224L28.0175%2034.4827C27.8101%2035.0069%2028.1471%2035.5872%2028.7052%2035.6669L29.0163%2035.7113C29.4531%2035.7737%2029.8677%2035.4999%2029.9819%2035.0737L30.4589%2033.2935Z'%20fill='url(%23paint1_linear_0_546)'/%3e%3cpath%20id='ear_2'%20d='M19.5411%2033.2935C19.4165%2032.8283%2019.6926%2032.3501%2020.1578%2032.2255C20.623%2032.1008%2021.1012%2032.3769%2021.2259%2032.8421L21.6773%2034.5269C21.802%2034.9921%2021.5259%2035.4703%2021.0607%2035.595C20.5954%2035.7196%2020.1172%2035.4435%2019.9926%2034.9783L19.5411%2033.2935Z'%20fill='url(%23paint2_linear_0_546)'/%3e%3cpath%20id='head'%20d='M29.7961%2033.0854C29.7961%2036.9044%2027.1022%2040.0004%2024.9996%2040.0004C22.6999%2040.0004%2020.2031%2036.9044%2020.2031%2033.0854C20.2031%2029.6827%2020.4677%2026.0469%2024.9996%2026.0469C29.5316%2026.0469%2029.7961%2029.6041%2029.7961%2033.0854Z'%20fill='url(%23paint3_linear_0_546)'/%3e%3c/g%3e%3cg%20id='img-bot-rig'%3e%3cpath%20id='Combined%20Shape'%20d='M74.805%2043.3724C74.7998%2043.7637%2074.3448%2043.9652%2073.8847%2044.4056C74.6853%2044.9778%2075.7662%2045.2864%2076.5668%2045.2864C77.4985%2045.2865%2078.2993%2044.9778%2079.0999%2044.4057C78.6398%2043.9653%2078.1893%2043.7644%2078.1796%2043.3724C78.1796%2043.2237%2078.1801%2041.7744%2078.1808%2041.6257C78.1808%2039.121%2074.7087%2037.6308%2074.8006%2041.6666C74.8023%2042.2352%2074.805%2042.8038%2074.805%2043.3724Z'%20fill='url(%23paint4_linear_0_546)'/%3e%3cpath%20id='Path%2048'%20d='M74.7537%2040.9329C76.0967%2040.7449%2077.3612%2042.1874%2077.3612%2042.1874C77.3612%2042.1874%2077.1105%2043.9615%2074.7537%2043.4459V40.9329Z'%20fill='var(--fill-0,%20%23F1F1F1)'/%3e%3cpath%20id='Combined%20Shape_2'%20d='M81.7073%2045.2883C82.14%2046.0951%2082.1941%2046.804%2082.1941%2046.804H70.7324C70.7324%2046.804%2070.8444%2046.0949%2071.277%2045.2883C71.7097%2044.4818%2074.7538%2043.5391%2074.7538%2043.5391C74.7538%2044.028%2075.7809%2044.4011%2076.4922%2044.4137C77.484%2044.4137%2078.2305%2044.0283%2078.2305%2043.5391C78.2305%2043.5391%2081.2745%2044.4815%2081.7073%2045.2883Z'%20fill='var(--fill-0,%20%23E1E1E1)'/%3e%3cpath%20id='Ellipse%20148'%20d='M79.3958%2039.3396C79.3958%2041.2491%2077.9264%2042.7971%2076.7795%2042.7971C75.5252%2042.7971%2074.1633%2041.2491%2074.1633%2039.3396C74.1633%2037.6382%2074.3076%2035.8203%2076.7795%2035.8203C79.2515%2035.8203%2079.3958%2037.5989%2079.3958%2039.3396Z'%20fill='url(%23paint5_linear_0_546)'/%3e%3c/g%3e%3c/g%3e%3cdefs%3e%3clinearGradient%20id='paint0_linear_0_546'%20x1='24.4155'%20y1='37.2573'%20x2='24.4155'%20y2='41.7755'%20gradientUnits='userSpaceOnUse'%3e%3cstop%20stop-color='%23B1B1B1'/%3e%3cstop%20offset='1'%20stop-color='white'/%3e%3c/linearGradient%3e%3clinearGradient%20id='paint1_linear_0_546'%20x1='28.4828'%20y1='34.8213'%20x2='29.7888'%20y2='34.8737'%20gradientUnits='userSpaceOnUse'%3e%3cstop%20offset='0.0416667'%20stop-color='%23B5B5B5'/%3e%3cstop%20offset='1'%20stop-color='white'/%3e%3c/linearGradient%3e%3clinearGradient%20id='paint2_linear_0_546'%20x1='20.5758'%20y1='34.8211'%20x2='19.2698'%20y2='34.8735'%20gradientUnits='userSpaceOnUse'%3e%3cstop%20offset='0.0416667'%20stop-color='%23B5B5B5'/%3e%3cstop%20offset='1'%20stop-color='white'/%3e%3c/linearGradient%3e%3clinearGradient%20id='paint3_linear_0_546'%20x1='20.322'%20y1='33.028'%20x2='27.0973'%20y2='33.0529'%20gradientUnits='userSpaceOnUse'%3e%3cstop%20stop-color='%23E0E0E0'/%3e%3cstop%20offset='1'%20stop-color='white'/%3e%3c/linearGradient%3e%3clinearGradient%20id='paint4_linear_0_546'%20x1='76.277'%20y1='41.7261'%20x2='76.277'%20y2='44.002'%20gradientUnits='userSpaceOnUse'%3e%3cstop%20stop-color='%23EDEDED'/%3e%3cstop%20offset='1'%20stop-color='white'/%3e%3c/linearGradient%3e%3clinearGradient%20id='paint5_linear_0_546'%20x1='74.4849'%20y1='39.2761'%20x2='78.1805'%20y2='39.2909'%20gradientUnits='userSpaceOnUse'%3e%3cstop%20stop-color='%23E0E0E0'/%3e%3cstop%20offset='1'%20stop-color='white'/%3e%3c/linearGradient%3e%3c/defs%3e%3c/svg%3e"
@@ -45,240 +46,277 @@ var N = [
45
46
  textKey: "idv2.ageVerificationPage.TheRestOfYourInformationWillBeDeletedToEnsureYourPrivacy",
46
47
  imageUrl: "data:image/svg+xml,%3csvg%20preserveAspectRatio='none'%20width='100%25'%20height='100%25'%20overflow='visible'%20viewBox='0%200%2096%2064'%20fill='none'%20xmlns='http://www.w3.org/2000/svg'%3e%3cg%20id='id'%3e%3crect%20width='96'%20height='64'%20rx='4'%20fill='var(--fill-0,%20%23E5F0FF)'/%3e%3cpath%20id='bg-white'%20d='M9%2012C9%2010.3431%2010.3431%209%2012%209H83.9996C85.6564%209%2086.9996%2010.3431%2086.9996%2012V37H9V12Z'%20fill='var(--fill-0,%20%23C9C9C9)'%20fill-opacity='0.8'/%3e%3cpath%20id='bg'%20d='M10.4336%2012.4297C10.4336%2011.3251%2011.329%2010.4297%2012.4336%2010.4297L83.1836%2010.4297C84.2882%2010.4297%2085.1836%2011.3251%2085.1836%2012.4297V37.0005H10.4336L10.4336%2012.4297Z'%20fill='var(--fill-0,%20white)'/%3e%3cpath%20id='Line%202%20(Stroke)'%20fill-rule='evenodd'%20clip-rule='evenodd'%20d='M14.4204%2021.3907C14.4206%2020.8405%2014.8668%2020.3945%2015.417%2020.3945L80.1999%2020.3945C80.7504%2020.3945%2081.1966%2020.8408%2081.1966%2021.3912C81.1966%2021.9416%2080.7504%2022.3879%2080.1999%2022.3879L15.417%2022.3879C14.8664%2022.3879%2014.4201%2021.9414%2014.4204%2021.3907Z'%20fill='var(--fill-0,%20%23C9C9C9)'%20fill-opacity='0.5'/%3e%3cpath%20id='shapes'%20d='M56.2803%2035.3457L38.3398%2035.3457V32.3555L56.2803%2032.3555V35.3457ZM56.2803%2029.3652H38.3398V26.375H56.2803V29.3652Z'%20fill='var(--fill-0,%20%23C9C9C9)'%20fill-opacity='0.5'/%3e%3crect%20id='shapes_2'%20x='14.4199'%20y='13.418'%20width='30.8967'%20height='3.98667'%20rx='1'%20fill='var(--fill-0,%20%23C9C9C9)'%20fill-opacity='0.5'/%3e%3crect%20id='shapes_3'%20x='74.833'%20y='13.4902'%20width='5.98'%20height='3.93138'%20fill='var(--fill-0,%20%23EAF0F6)'/%3e%3crect%20id='Rectangle%2039983'%20x='18'%20y='37'%20width='3'%20height='15'%20fill='var(--fill-0,%20white)'/%3e%3crect%20id='Rectangle%2039995'%20x='13'%20y='37'%20width='3'%20height='15'%20fill='var(--fill-0,%20white)'/%3e%3crect%20id='Rectangle%2039984'%20x='23'%20y='37'%20width='3'%20height='15'%20fill='var(--fill-0,%20white)'/%3e%3crect%20id='Rectangle%2039985'%20x='28'%20y='37'%20width='3'%20height='15'%20fill='var(--fill-0,%20white)'/%3e%3crect%20id='Rectangle%2039986'%20x='33'%20y='37'%20width='3'%20height='15'%20fill='var(--fill-0,%20white)'/%3e%3crect%20id='Rectangle%2039987'%20x='38'%20y='37'%20width='3'%20height='15'%20fill='var(--fill-0,%20white)'/%3e%3crect%20id='Rectangle%2039988'%20x='43'%20y='37'%20width='3'%20height='15'%20fill='var(--fill-0,%20white)'/%3e%3crect%20id='Rectangle%2039989'%20x='49'%20y='37'%20width='3'%20height='15'%20fill='var(--fill-0,%20white)'/%3e%3crect%20id='Rectangle%2039990'%20x='54'%20y='37'%20width='3'%20height='15'%20fill='var(--fill-0,%20white)'/%3e%3crect%20id='Rectangle%2039991'%20x='59'%20y='37'%20width='3'%20height='15'%20fill='var(--fill-0,%20white)'/%3e%3crect%20id='Rectangle%2039992'%20x='64'%20y='37'%20width='3'%20height='15'%20fill='var(--fill-0,%20white)'/%3e%3crect%20id='Rectangle%2039993'%20x='69'%20y='37'%20width='3'%20height='15'%20fill='var(--fill-0,%20white)'/%3e%3crect%20id='Rectangle%2039994'%20x='74'%20y='37'%20width='3'%20height='15'%20fill='var(--fill-0,%20white)'/%3e%3crect%20id='Rectangle%2039996'%20x='79'%20y='37'%20width='3'%20height='15'%20fill='var(--fill-0,%20white)'/%3e%3c/g%3e%3c/svg%3e"
47
48
  }
48
- ], P = ({ manager: t }) => {
49
- let { t: n } = e(), [r, i] = o(!1), a = () => {
50
- i(!0), t.nextStep();
49
+ ];
50
+ var AgeVerification = ({ manager }) => {
51
+ const { t } = useTranslation();
52
+ const [isLoading, setIsLoading] = d(false);
53
+ const handleContinue = () => {
54
+ setIsLoading(true);
55
+ manager.nextStep();
51
56
  };
52
- return /* @__PURE__ */ s(d, {
57
+ return /* @__PURE__ */ u(Page, {
53
58
  className: "IncodeAgeVerificationPage",
54
- title: n("idv2.ageVerificationPage.ageVerification"),
59
+ title: t("idv2.ageVerificationPage.ageVerification"),
55
60
  titleId: "id-age-verification-heading",
56
- subtitle: n("idv2.ageVerificationPage.weNeedToScanYourIDToKnowYourAge"),
61
+ subtitle: t("idv2.ageVerificationPage.weNeedToScanYourIDToKnowYourAge"),
57
62
  "data-testid": "age-verification-container",
58
- children: /* @__PURE__ */ s("div", {
63
+ children: /* @__PURE__ */ u("div", {
59
64
  class: "IncodeAgeVerificationContent",
60
- children: [/* @__PURE__ */ s("ul", {
65
+ children: [/* @__PURE__ */ u("ul", {
61
66
  class: "IncodeAgeVerificationList",
62
67
  "aria-labelledby": "id-age-verification-heading",
63
- children: N.map(({ textKey: e, imageUrl: t }) => /* @__PURE__ */ s("li", {
68
+ children: steps.map(({ textKey, imageUrl }) => /* @__PURE__ */ u("li", {
64
69
  class: "IncodeAgeVerificationItem",
65
- children: [/* @__PURE__ */ s("div", {
70
+ children: [/* @__PURE__ */ u("div", {
66
71
  class: "IncodeAgeVerificationIcon",
67
- children: /* @__PURE__ */ s("img", {
68
- src: t,
72
+ children: /* @__PURE__ */ u("img", {
73
+ src: imageUrl,
69
74
  alt: "",
70
75
  "aria-hidden": "true"
71
76
  })
72
- }), /* @__PURE__ */ s("p", {
77
+ }), /* @__PURE__ */ u("p", {
73
78
  class: "IncodeAgeVerificationText",
74
- children: n(e)
79
+ children: t(textKey)
75
80
  })]
76
- }, e))
77
- }), /* @__PURE__ */ s(b, {
81
+ }, textKey))
82
+ }), /* @__PURE__ */ u(Button, {
78
83
  class: "IncodeAgeVerificationButton",
79
- onClick: a,
80
- isLoading: r,
84
+ onClick: handleContinue,
85
+ isLoading,
81
86
  "data-testid": "age-verification-continue-button",
82
- children: n("idv2.ageVerificationPage.Continue")
87
+ children: t("idv2.ageVerificationPage.Continue")
83
88
  })]
84
89
  })
85
90
  });
86
91
  };
87
92
  //#endregion
88
93
  //#region src/modules/id/digitalIdUpload/useFilePreviewUrl.ts
89
- function F(e) {
90
- let n = r(() => e ? URL.createObjectURL(e) : null, [e]);
91
- return t(() => () => {
92
- n && URL.revokeObjectURL(n);
93
- }, [n]), n;
94
+ /**
95
+ * Produces a stable object-URL for the given file and revokes it on cleanup
96
+ * (or whenever the file changes). Returns `null` when no file is provided.
97
+ *
98
+ * Centralizes the `URL.createObjectURL` / `URL.revokeObjectURL` lifecycle
99
+ * that every preview screen in the digital ID upload flow needs.
100
+ */
101
+ function useFilePreviewUrl(file) {
102
+ const fileUrl = T(() => {
103
+ if (!file) return null;
104
+ return URL.createObjectURL(file);
105
+ }, [file]);
106
+ y(() => {
107
+ return () => {
108
+ if (fileUrl) URL.revokeObjectURL(fileUrl);
109
+ };
110
+ }, [fileUrl]);
111
+ return fileUrl;
94
112
  }
95
113
  //#endregion
96
114
  //#region src/modules/id/digitalIdUpload/analyzingScreen.tsx
97
- var I = ({ state: t }) => {
98
- let { t: n } = e(), r = F(t.file), i = t.phase === "holding" ? n("idv2.digitalIdUpload.successfullyProcessed") : n("idv2.digitalIdUpload.analyzing");
99
- return /* @__PURE__ */ s(d, {
100
- title: i,
101
- subtitle: n("idv2.digitalIdUpload.screenDescription"),
115
+ var AnalyzingScreen = ({ state }) => {
116
+ const { t } = useTranslation();
117
+ const fileUrl = useFilePreviewUrl(state.file);
118
+ const isUploading = state.phase === "uploading";
119
+ const statusLabel = isUploading ? t("idv2.digitalIdUpload.analyzing") : t("idv2.digitalIdUpload.successfullyProcessed");
120
+ return /* @__PURE__ */ u(Page, {
121
+ title: statusLabel,
122
+ titleId: "digitalIdUploadStatusTitle",
123
+ subtitle: isUploading ? void 0 : t("idv2.digitalIdUpload.screenDescription"),
102
124
  className: "IncodeDigitalIdUploadPage",
103
125
  "data-testid": "digital-id-upload-analyzing",
104
126
  children: [
105
- /* @__PURE__ */ s("div", {
127
+ /* @__PURE__ */ u("div", {
106
128
  role: "status",
107
129
  "aria-live": "polite",
108
130
  class: "IncodeSrOnly",
109
- children: i
131
+ children: statusLabel
110
132
  }),
111
- /* @__PURE__ */ s("div", {
133
+ /* @__PURE__ */ u("div", {
112
134
  class: "IncodeDigitalIdUploadPreviewBody",
113
- "aria-busy": t.phase !== "holding",
135
+ "aria-busy": isUploading,
114
136
  children: [
115
- /* @__PURE__ */ s("div", {
137
+ /* @__PURE__ */ u("div", {
116
138
  class: "IncodeDigitalIdUploadPreStatusZone",
117
- children: /* @__PURE__ */ s("div", {
118
- class: "IncodeDigitalIdUploadProgressBar",
119
- role: "progressbar",
120
- "aria-valuemin": 0,
121
- "aria-valuemax": 100,
122
- "aria-valuenow": t.uploadProgress,
123
- "aria-label": n("idv2.digitalIdUpload.analyzing"),
124
- children: /* @__PURE__ */ s("span", { style: { width: `${t.uploadProgress}%` } })
125
- })
139
+ children: isUploading ? /* @__PURE__ */ u(ProgressBar, {
140
+ progress: state.uploadProgress,
141
+ labelledById: "digitalIdUploadStatusTitle",
142
+ className: "IncodeDigitalIdUploadProgressBar"
143
+ }) : null
126
144
  }),
127
- /* @__PURE__ */ s("div", {
145
+ /* @__PURE__ */ u("div", {
128
146
  class: "IncodeDigitalIdUploadDocumentPreview",
129
147
  "aria-hidden": "true",
130
- children: [r ? /* @__PURE__ */ s(D, {
131
- url: r,
148
+ children: [fileUrl ? /* @__PURE__ */ u(PdfViewer, {
149
+ url: fileUrl,
132
150
  mode: "thumbnail",
133
151
  className: "IncodeDigitalIdUploadDocumentPreviewPdf"
134
- }) : null, /* @__PURE__ */ s("div", {
152
+ }) : null, /* @__PURE__ */ u("div", {
135
153
  class: "IncodeDigitalIdUploadLaserOverlay",
136
- children: /* @__PURE__ */ s(w, {
137
- animationData: re,
138
- loop: !0
154
+ children: /* @__PURE__ */ u(Lottie, {
155
+ animationData: id_laser_v_default,
156
+ loop: true,
157
+ autoStop: true
139
158
  })
140
159
  })]
141
160
  }),
142
- /* @__PURE__ */ s("div", {
161
+ /* @__PURE__ */ u("div", {
143
162
  class: "IncodeDigitalIdUploadPostCaptionZone",
144
163
  "aria-hidden": "true"
145
164
  })
146
165
  ]
147
166
  }),
148
- /* @__PURE__ */ s("div", {
167
+ /* @__PURE__ */ u("div", {
149
168
  class: "IncodeDigitalIdUploadFooter",
150
169
  "aria-hidden": "true"
151
170
  })
152
171
  ]
153
172
  });
154
- }, L = new Set(["DIGITAL_ID_REQUESTED_BUT_OTHER_PROVIDED", "ID_TYPE_UNACCEPTABLE"]), R = {
173
+ };
174
+ //#endregion
175
+ //#region src/modules/id/digitalIdUpload/errorScreen.tsx
176
+ var TERMINAL_REASONS = new Set(["DIGITAL_ID_REQUESTED_BUT_OTHER_PROVIDED", "ID_TYPE_UNACCEPTABLE"]);
177
+ var KEY_BY_FAIL_REASON = {
155
178
  DIGITAL_ID_REQUESTED_BUT_OTHER_PROVIDED: "idv2.digitalIdUpload.errorScreen.thisIdMustBeScanned",
156
179
  ID_TYPE_UNACCEPTABLE: "idv2.digitalIdUpload.wrongDocumentTypeScreen.errorTitle",
157
180
  FILE_CHANGED_ERROR: "idv2.digitalIdUpload.unknownDocumentTypeScreen.errorTitle",
158
181
  INVALID_FILE_TYPE: "idv2.digitalIdUpload.unknownDocumentTypeScreen.errorTitle",
159
182
  NETWORK_ERROR: "idv2.digitalIdUpload.unknownDocumentTypeScreen.errorTitle",
160
183
  GENERIC: "idv2.digitalIdUpload.unknownDocumentTypeScreen.errorTitle"
161
- }, z = ({ manager: t, state: n }) => {
162
- let { t: r } = e(), i = n.failReason ?? "GENERIC", a = n.phase === "exhausted" || L.has(i), o = F(n.file);
163
- return /* @__PURE__ */ s(d, {
164
- title: r(R[i] ?? R.GENERIC),
165
- subtitle: r("idv2.digitalIdUpload.errorScreen.pleaseTryScanning"),
184
+ };
185
+ var ErrorScreen = ({ manager, state }) => {
186
+ const { t } = useTranslation();
187
+ const failReason = state.failReason ?? "GENERIC";
188
+ const isTerminal = state.phase === "exhausted" || TERMINAL_REASONS.has(failReason);
189
+ const fileUrl = useFilePreviewUrl(state.file);
190
+ return /* @__PURE__ */ u(Page, {
191
+ title: t(KEY_BY_FAIL_REASON[failReason] ?? KEY_BY_FAIL_REASON.GENERIC),
192
+ subtitle: t("idv2.digitalIdUpload.errorScreen.pleaseTryScanning"),
166
193
  className: "IncodeDigitalIdUploadPage",
167
194
  "data-testid": "digital-id-upload-error",
168
- children: [/* @__PURE__ */ s("div", {
195
+ children: [/* @__PURE__ */ u("div", {
169
196
  class: "IncodeDigitalIdUploadBody",
170
- role: "alert",
171
- "aria-live": "assertive",
172
197
  children: [
173
- /* @__PURE__ */ s("div", {
198
+ /* @__PURE__ */ u("div", {
174
199
  class: "IncodeDigitalIdUploadErrorIcon",
175
200
  "aria-hidden": "true",
176
- children: /* @__PURE__ */ s(x, { size: 40 })
201
+ children: /* @__PURE__ */ u(ErrorIcon, { size: 40 })
177
202
  }),
178
- o ? /* @__PURE__ */ s("div", {
203
+ fileUrl ? /* @__PURE__ */ u("div", {
179
204
  class: "IncodeDigitalIdUploadErrorPreview",
180
- children: /* @__PURE__ */ s(D, {
181
- url: o,
205
+ children: /* @__PURE__ */ u(PdfViewer, {
206
+ url: fileUrl,
182
207
  mode: "thumbnail",
183
- "aria-label": r("idv2.digitalIdUpload.errorScreen.pleaseTryScanning"),
208
+ "aria-label": t("idv2.digitalIdUpload.errorScreen.previewAriaLabel"),
184
209
  className: "IncodeDigitalIdUploadPreviewPdf"
185
210
  })
186
211
  }) : null,
187
- !a && n.attemptsRemaining > 0 ? /* @__PURE__ */ s("p", {
212
+ !isTerminal && state.attemptsRemaining > 0 ? /* @__PURE__ */ u("p", {
188
213
  class: "IncodeDigitalIdUploadAttempts",
189
- children: r("common.attemptsRemaining", { count: n.attemptsRemaining })
214
+ children: t("common.attemptsRemaining", { count: state.attemptsRemaining })
190
215
  }) : null
191
216
  ]
192
- }), /* @__PURE__ */ s("div", {
217
+ }), /* @__PURE__ */ u("div", {
193
218
  class: "IncodeDigitalIdUploadFooter",
194
- children: [a ? null : /* @__PURE__ */ s(b, {
195
- onClick: () => t.digitalUploadRetry(),
196
- children: r("common.tryAgain")
197
- }), /* @__PURE__ */ s(b, {
198
- variant: a ? "primary" : "secondary",
199
- onClick: () => t.digitalUploadScanInstead(),
200
- children: r("idv2.digitalIdUpload.errorScreen.scanId")
219
+ children: [!isTerminal ? /* @__PURE__ */ u(Button, {
220
+ onClick: () => manager.digitalUploadRetry(),
221
+ children: t("common.tryAgain")
222
+ }) : null, /* @__PURE__ */ u(Button, {
223
+ variant: isTerminal ? "primary" : "secondary",
224
+ onClick: () => manager.digitalUploadScanInstead(),
225
+ children: t("idv2.digitalIdUpload.errorScreen.scanId")
201
226
  })]
202
227
  })]
203
228
  });
204
- }, B = ({ manager: t, state: n }) => {
205
- let { t: r } = e(), a = i(null), o = F(n.file), c = (e) => {
206
- let n = e.currentTarget.files?.[0];
207
- n && t.digitalUploadPickFile(n);
229
+ };
230
+ //#endregion
231
+ //#region src/modules/id/digitalIdUpload/fileReviewScreen.tsx
232
+ var FileReviewScreen = ({ manager, state }) => {
233
+ const { t } = useTranslation();
234
+ const fileInputRef = A(null);
235
+ const fileUrl = useFilePreviewUrl(state.file);
236
+ const onFileSelect = (event) => {
237
+ const file = event.currentTarget.files?.[0];
238
+ if (!file) return;
239
+ manager.digitalUploadPickFile(file);
208
240
  };
209
- return /* @__PURE__ */ s(d, {
210
- title: r("idv2.digitalIdUpload.reviewScreen.title"),
211
- subtitle: r("idv2.digitalIdUpload.reviewScreen.description"),
241
+ return /* @__PURE__ */ u(Page, {
242
+ title: t("idv2.digitalIdUpload.reviewScreen.title"),
243
+ subtitle: t("idv2.digitalIdUpload.reviewScreen.description"),
212
244
  className: "IncodeDigitalIdUploadPage",
213
245
  "data-testid": "digital-id-upload-review",
214
- children: [/* @__PURE__ */ s("div", {
246
+ children: [/* @__PURE__ */ u("div", {
215
247
  class: "IncodeDigitalIdUploadPreviewBody",
216
248
  children: [
217
- /* @__PURE__ */ s("input", {
218
- ref: a,
249
+ /* @__PURE__ */ u("input", {
250
+ ref: fileInputRef,
219
251
  type: "file",
220
252
  accept: "application/pdf",
221
- onChange: c,
253
+ onChange: onFileSelect,
222
254
  class: "IncodeDigitalIdUploadHiddenInput",
223
- "aria-label": r("idv2.digitalIdUpload.reviewScreen.replaceButton")
255
+ tabIndex: -1,
256
+ "aria-hidden": "true"
224
257
  }),
225
- /* @__PURE__ */ s("div", {
258
+ /* @__PURE__ */ u("div", {
226
259
  class: "IncodeDigitalIdUploadPreStatusZone",
227
260
  "aria-hidden": "true"
228
261
  }),
229
- /* @__PURE__ */ s("div", {
262
+ /* @__PURE__ */ u("div", {
230
263
  class: "IncodeDigitalIdUploadPreviewCard",
231
- children: o ? /* @__PURE__ */ s(D, {
232
- url: o,
264
+ children: fileUrl ? /* @__PURE__ */ u(PdfViewer, {
265
+ url: fileUrl,
233
266
  mode: "thumbnail",
234
- "aria-label": r("idv2.digitalIdUpload.reviewScreen.title"),
267
+ "aria-label": t("idv2.digitalIdUpload.reviewScreen.previewAriaLabel"),
235
268
  className: "IncodeDigitalIdUploadPreviewPdf"
236
269
  }) : null
237
270
  }),
238
- /* @__PURE__ */ s("div", {
271
+ /* @__PURE__ */ u("div", {
239
272
  class: "IncodeDigitalIdUploadPostCaptionZone",
240
- children: n.fileName ? /* @__PURE__ */ s("p", {
273
+ children: state.fileName ? /* @__PURE__ */ u("p", {
241
274
  class: "IncodeDigitalIdUploadFileName",
242
- children: n.fileName
275
+ children: state.fileName
243
276
  }) : null
244
277
  })
245
278
  ]
246
- }), /* @__PURE__ */ s("div", {
279
+ }), /* @__PURE__ */ u("div", {
247
280
  class: "IncodeDigitalIdUploadFooter",
248
- children: [/* @__PURE__ */ s(b, {
249
- onClick: () => t.digitalUploadConfirm(),
250
- children: r("idv2.digitalIdUpload.reviewScreen.continue")
251
- }), /* @__PURE__ */ s(b, {
281
+ children: [/* @__PURE__ */ u(Button, {
282
+ onClick: () => manager.digitalUploadConfirm(),
283
+ children: t("idv2.digitalIdUpload.reviewScreen.continue")
284
+ }), /* @__PURE__ */ u(Button, {
252
285
  variant: "secondary",
286
+ "aria-haspopup": "dialog",
253
287
  onClick: () => {
254
- t.digitalUploadReplace(), a.current?.click();
288
+ manager.digitalUploadReplace();
289
+ fileInputRef.current?.click();
255
290
  },
256
- children: r("idv2.digitalIdUpload.reviewScreen.replaceButton")
291
+ children: t("idv2.digitalIdUpload.reviewScreen.replaceButton")
257
292
  })]
258
293
  })]
259
294
  });
260
- }, V = (e) => /* @__PURE__ */ s("svg", {
295
+ };
296
+ //#endregion
297
+ //#region src/modules/id/assets/upload-id-screen-image.svg?react
298
+ var SvgUploadIdScreenImage = (props) => /* @__PURE__ */ u("svg", {
261
299
  viewBox: "0 0 191 266",
262
300
  fill: "none",
263
301
  xmlns: "http://www.w3.org/2000/svg",
264
302
  "aria-hidden": "true",
265
303
  focusable: "false",
266
304
  className: "IncodeUploadIdScreenImage",
267
- ...e,
305
+ ...props,
268
306
  children: [
269
- /* @__PURE__ */ s("title", { children: "Upload ID Screen Image" }),
270
- /* @__PURE__ */ s("path", {
307
+ /* @__PURE__ */ u("title", { children: "Upload ID Screen Image" }),
308
+ /* @__PURE__ */ u("path", {
271
309
  d: "M17.5 11.1724C17.5 7.21119 20.7112 4 24.6724 4H166.328C170.289 4 173.5 7.2112 173.5 11.1724V228.138C173.5 232.099 170.289 235.31 166.328 235.31H24.6724C20.7112 235.31 17.5 232.099 17.5 228.138V11.1724Z",
272
310
  fill: "var(--digital-id-illustration-surface, #FFFFFF)"
273
311
  }),
274
- /* @__PURE__ */ s("rect", {
312
+ /* @__PURE__ */ u("rect", {
275
313
  x: 17.5,
276
314
  y: 16.5518,
277
315
  width: 156,
278
316
  height: 10.7586,
279
317
  fill: "var(--digital-id-illustration-strip, #EBECEF)"
280
318
  }),
281
- /* @__PURE__ */ s("rect", {
319
+ /* @__PURE__ */ u("rect", {
282
320
  x: 98.1895,
283
321
  y: 35.3799,
284
322
  width: 68.1379,
@@ -286,67 +324,67 @@ var I = ({ state: t }) => {
286
324
  rx: 7.17241,
287
325
  fill: "var(--digital-id-illustration-photo, #F0F6FF)"
288
326
  }),
289
- /* @__PURE__ */ s("path", {
327
+ /* @__PURE__ */ u("path", {
290
328
  fillRule: "evenodd",
291
329
  clipRule: "evenodd",
292
330
  d: "M124.391 67.5897C124.391 68.725 123.469 69.6497 122.331 69.6497H114.953C113.818 69.6497 112.893 68.725 112.893 67.5897V60.2117C112.893 59.074 113.818 58.1518 114.953 58.1518H122.331C123.469 58.1518 124.391 59.074 124.391 60.2117V67.5897ZM122.331 53.3105H114.953C111.148 53.3105 108.052 56.4065 108.052 60.2117V67.5897C108.052 71.3949 111.148 74.4909 114.953 74.4909H122.331C126.136 74.4909 129.232 71.3949 129.232 67.5897V60.2117C129.232 56.4065 126.136 53.3105 122.331 53.3105Z",
293
331
  fill: "var(--digital-id-illustration-accent, var(--icon-brand-500-static, #006AFF))"
294
332
  }),
295
- /* @__PURE__ */ s("path", {
333
+ /* @__PURE__ */ u("path", {
296
334
  fillRule: "evenodd",
297
335
  clipRule: "evenodd",
298
336
  d: "M118.643 61.4951C117.307 61.4951 116.223 62.5941 116.223 63.9303C116.223 65.2664 117.307 66.3509 118.643 66.3509C119.979 66.3509 121.064 65.2664 121.064 63.9303V63.9012C121.064 62.565 119.979 61.4951 118.643 61.4951Z",
299
337
  fill: "var(--digital-id-illustration-accent, var(--icon-brand-500-static, #006AFF))"
300
338
  }),
301
- /* @__PURE__ */ s("path", {
339
+ /* @__PURE__ */ u("path", {
302
340
  fillRule: "evenodd",
303
341
  clipRule: "evenodd",
304
342
  d: "M118.643 88.7246C117.307 88.7246 116.223 89.8236 116.223 91.1597C116.223 92.4959 117.307 93.5804 118.643 93.5804C119.979 93.5804 121.064 92.4959 121.064 91.1597V91.1307C121.064 89.7945 119.979 88.7246 118.643 88.7246Z",
305
343
  fill: "var(--digital-id-illustration-accent, var(--icon-brand-500-static, #006AFF))"
306
344
  }),
307
- /* @__PURE__ */ s("path", {
345
+ /* @__PURE__ */ u("path", {
308
346
  fillRule: "evenodd",
309
347
  clipRule: "evenodd",
310
348
  d: "M124.391 94.8222C124.391 95.9574 123.469 96.8821 122.331 96.8821H114.953C113.818 96.8821 112.893 95.9574 112.893 94.8222V87.4441C112.893 86.3064 113.818 85.3842 114.953 85.3842H122.331C123.469 85.3842 124.391 86.3064 124.391 87.4441V94.8222ZM122.331 80.543H114.953C111.148 80.543 108.052 83.6389 108.052 87.4441V94.8222C108.052 98.6274 111.148 101.723 114.953 101.723H122.331C126.136 101.723 129.232 98.6274 129.232 94.8222V87.4441C129.232 83.6389 126.136 80.543 122.331 80.543Z",
311
349
  fill: "var(--digital-id-illustration-accent, var(--icon-brand-500-static, #006AFF))"
312
350
  }),
313
- /* @__PURE__ */ s("path", {
351
+ /* @__PURE__ */ u("path", {
314
352
  fillRule: "evenodd",
315
353
  clipRule: "evenodd",
316
354
  d: "M151.623 94.8222C151.623 95.9574 150.701 96.8821 149.563 96.8821H142.185C141.05 96.8821 140.125 95.9574 140.125 94.8222V87.4441C140.125 86.3064 141.05 85.3842 142.185 85.3842H149.563C150.701 85.3842 151.623 86.3064 151.623 87.4441V94.8222ZM149.563 80.543H142.185C138.38 80.543 135.284 83.6389 135.284 87.4441V94.8222C135.284 98.6274 138.38 101.723 142.185 101.723H149.563C153.369 101.723 156.465 98.6274 156.465 94.8222V87.4441C156.465 83.6389 153.369 80.543 149.563 80.543Z",
317
355
  fill: "var(--digital-id-illustration-accent, var(--icon-brand-500-static, #006AFF))"
318
356
  }),
319
- /* @__PURE__ */ s("path", {
357
+ /* @__PURE__ */ u("path", {
320
358
  fillRule: "evenodd",
321
359
  clipRule: "evenodd",
322
360
  d: "M145.876 88.6826C144.54 88.6826 143.455 89.7671 143.455 91.1032V91.1299C143.455 92.466 144.54 93.5359 145.876 93.5359C147.212 93.5359 148.296 92.4394 148.296 91.1032C148.296 89.7671 147.212 88.6826 145.876 88.6826Z",
323
361
  fill: "var(--digital-id-illustration-accent, var(--icon-brand-500-static, #006AFF))"
324
362
  }),
325
- /* @__PURE__ */ s("path", {
363
+ /* @__PURE__ */ u("path", {
326
364
  fillRule: "evenodd",
327
365
  clipRule: "evenodd",
328
366
  d: "M137.705 58.18C139.041 58.18 140.125 57.0955 140.125 55.7594V55.7303C140.125 54.3941 139.041 53.3242 137.705 53.3242C136.369 53.3242 135.284 54.4232 135.284 55.7594C135.284 57.0955 136.369 58.18 137.705 58.18Z",
329
367
  fill: "var(--digital-id-illustration-accent, var(--icon-brand-500-static, #006AFF))"
330
368
  }),
331
- /* @__PURE__ */ s("path", {
369
+ /* @__PURE__ */ u("path", {
332
370
  fillRule: "evenodd",
333
371
  clipRule: "evenodd",
334
372
  d: "M150.487 53.3105H145.876C144.537 53.3105 143.455 54.395 143.455 55.7312C143.455 57.0673 144.537 58.1518 145.876 58.1518H150.487C151.114 58.1518 151.625 58.6625 151.625 59.2919V63.9007C151.625 65.2369 152.707 66.3213 154.045 66.3213C155.381 66.3213 156.466 65.2369 156.466 63.9007V59.2919C156.466 55.9926 153.784 53.3105 150.487 53.3105Z",
335
373
  fill: "var(--digital-id-illustration-accent, var(--icon-brand-500-static, #006AFF))"
336
374
  }),
337
- /* @__PURE__ */ s("path", {
375
+ /* @__PURE__ */ u("path", {
338
376
  fillRule: "evenodd",
339
377
  clipRule: "evenodd",
340
378
  d: "M154.045 69.6514H145.876C144.54 69.6514 143.455 70.7358 143.455 72.072C143.455 73.4081 144.54 74.4925 145.876 74.4925H154.045C155.381 74.4925 156.466 73.4081 156.466 72.072C156.466 70.7358 155.381 69.6514 154.045 69.6514Z",
341
379
  fill: "var(--digital-id-illustration-accent, var(--icon-brand-500-static, #006AFF))"
342
380
  }),
343
- /* @__PURE__ */ s("path", {
381
+ /* @__PURE__ */ u("path", {
344
382
  fillRule: "evenodd",
345
383
  clipRule: "evenodd",
346
384
  d: "M137.705 74.4922C139.041 74.4922 140.125 73.4078 140.125 72.0716V67.4604C140.125 66.8334 140.636 66.3227 141.266 66.3227H145.874C147.211 66.3227 148.295 65.2382 148.295 63.9021C148.295 62.5659 147.211 61.4814 145.874 61.4814H141.266C137.966 61.4814 135.284 64.1635 135.284 67.4604V72.0716C135.284 73.4078 136.369 74.4922 137.705 74.4922Z",
347
385
  fill: "var(--digital-id-illustration-accent, var(--icon-brand-500-static, #006AFF))"
348
386
  }),
349
- /* @__PURE__ */ s("rect", {
387
+ /* @__PURE__ */ u("rect", {
350
388
  x: 29.1553,
351
389
  y: 134,
352
390
  width: 54.6897,
@@ -354,7 +392,7 @@ var I = ({ state: t }) => {
354
392
  rx: 3.58621,
355
393
  fill: "var(--digital-id-illustration-strip, #EBECEF)"
356
394
  }),
357
- /* @__PURE__ */ s("rect", {
395
+ /* @__PURE__ */ u("rect", {
358
396
  x: 29.1553,
359
397
  y: 152.828,
360
398
  width: 54.6897,
@@ -362,7 +400,7 @@ var I = ({ state: t }) => {
362
400
  rx: 3.58621,
363
401
  fill: "var(--digital-id-illustration-strip, #EBECEF)"
364
402
  }),
365
- /* @__PURE__ */ s("rect", {
403
+ /* @__PURE__ */ u("rect", {
366
404
  x: 29.1553,
367
405
  y: 171.655,
368
406
  width: 72.6207,
@@ -370,12 +408,12 @@ var I = ({ state: t }) => {
370
408
  rx: 3.58621,
371
409
  fill: "var(--digital-id-illustration-strip, #EBECEF)"
372
410
  }),
373
- /* @__PURE__ */ s("path", {
411
+ /* @__PURE__ */ u("path", {
374
412
  d: "M24.6729 4.44824H166.327C170.041 4.44824 173.052 7.45921 173.052 11.1729V228.138C173.052 231.851 170.041 234.862 166.327 234.862H24.6729C20.9592 234.862 17.9482 231.851 17.9482 228.138V11.1729C17.9482 7.45921 20.9592 4.44824 24.6729 4.44824Z",
375
413
  stroke: "var(--digital-id-illustration-border, #EBECEF)",
376
414
  strokeWidth: .896552
377
415
  }),
378
- /* @__PURE__ */ s("rect", {
416
+ /* @__PURE__ */ u("rect", {
379
417
  x: 24.6729,
380
418
  y: 35.8066,
381
419
  width: 68.1379,
@@ -383,246 +421,322 @@ var I = ({ state: t }) => {
383
421
  rx: 4.93753,
384
422
  fill: "var(--digital-id-illustration-photo, #F0F6FF)"
385
423
  }),
386
- /* @__PURE__ */ s("path", {
424
+ /* @__PURE__ */ u("path", {
387
425
  d: "M49.36 91.1735V91.2999C49.3251 93.9726 47.0753 95.9823 42.6104 97.3291C47.9904 101.237 53.3707 104.364 58.7507 104.364C64.1307 104.364 69.5111 101.237 74.8911 97.3291C70.4565 95.9808 68.2066 93.968 68.1415 91.2908C68.1415 90.2747 68.145 80.3761 68.1497 79.36C68.4704 79.4052 68.4432 79.3765 68.1497 79.295C68.1585 75.9478 68.1729 80.3294 68.1928 75.7552C68.2128 71.181 49.0493 67.0886 49.3306 79.6487C49.3344 80.9294 49.3421 89.7232 49.36 91.1735Z",
388
426
  fill: "var(--digital-id-illustration-face-highlight, #E0E0E0)"
389
427
  }),
390
- /* @__PURE__ */ s("path", {
428
+ /* @__PURE__ */ u("path", {
391
429
  d: "M92.8103 106.416C92.8103 108.838 92.8103 111.556 92.8103 113.823C92.8103 116.55 90.5997 118.759 87.8728 118.759H29.6104C26.8835 118.759 24.6729 116.55 24.6729 113.823C24.6729 111.669 24.6729 109.075 24.6729 106.609C27.8413 100.94 46.2752 95.6817 46.2752 95.6817C47.9856 98.7716 53.0062 101.59 58.1454 101.716C63.7221 101.853 69.4385 99.0337 71.2165 95.6797C71.2165 95.6797 89.6412 100.745 92.8103 106.416Z",
392
430
  fill: "var(--digital-id-illustration-accent, var(--icon-brand-500-static, #006AFF))"
393
431
  }),
394
- /* @__PURE__ */ s("path", {
432
+ /* @__PURE__ */ u("path", {
395
433
  d: "M49.1074 85.037C56.9841 84.2188 64.4004 87.6292 64.4004 87.6292C64.4004 87.6292 62.9302 95.3516 49.1074 93.1072V85.037Z",
396
434
  fill: "var(--digital-id-illustration-face-shadow, #CDCDCD)"
397
435
  }),
398
- /* @__PURE__ */ s("path", {
436
+ /* @__PURE__ */ u("path", {
399
437
  d: "M42.6488 68.8767C43.699 67.1248 45.009 68.3295 45.5328 69.1509L46.2644 76.9402C46.2387 77.6181 45.8326 78.0487 44.7734 78.1827C43.4493 78.3502 42.5746 74.7442 42.2696 73.3982C41.9645 72.0521 41.336 71.0665 42.6488 68.8767Z",
400
438
  fill: "var(--digital-id-illustration-mask-shadow, #D0D0D0)"
401
439
  }),
402
- /* @__PURE__ */ s("path", {
440
+ /* @__PURE__ */ u("path", {
403
441
  d: "M74.3552 69.3252C73.3216 67.5635 72.0003 68.7558 71.4688 69.5721L70.6635 77.3542C70.6827 78.0322 71.0848 78.4667 72.1427 78.6107C73.4651 78.7907 74.3739 75.1932 74.6917 73.8501C75.0094 72.507 75.6472 71.5273 74.3552 69.3252Z",
404
442
  fill: "var(--digital-id-illustration-mask-shadow, #D0D0D0)"
405
443
  }),
406
- /* @__PURE__ */ s("path", {
444
+ /* @__PURE__ */ u("path", {
407
445
  d: "M73.3109 70.6918C73.3109 81.9566 65.1557 91.0886 58.7907 91.0886C51.829 91.0886 44.2705 81.9566 44.2705 70.6918C44.2705 60.6551 45.0714 49.9307 58.7907 49.9307C72.51 49.9307 73.3109 60.423 73.3109 70.6918Z",
408
446
  fill: "var(--digital-id-illustration-mask, #FAFAFA)"
409
447
  })
410
448
  ]
411
- }), H = ({ size: e = 191 }) => /* @__PURE__ */ s(V, {
412
- width: e,
413
- height: Math.round(e * 266 / 191),
414
- "aria-hidden": !0
415
- }), U = ({ manager: n, state: r }) => {
416
- let { t: a } = e(), o = i(null);
417
- t(() => {
418
- o.current && o.current.click();
419
- }, [r.pickerRequestId]);
420
- let c = (e) => {
421
- let t = e.currentTarget.files?.[0];
422
- t && n.digitalUploadPickFile(t);
449
+ });
450
+ //#endregion
451
+ //#region src/modules/id/assets/uploadIdScreenImage.tsx
452
+ var UploadIdScreenImage = ({ size = 191 }) => {
453
+ return /* @__PURE__ */ u(SvgUploadIdScreenImage, {
454
+ width: size,
455
+ height: Math.round(size * 266 / 191),
456
+ "aria-hidden": true
457
+ });
458
+ };
459
+ //#endregion
460
+ //#region src/modules/id/digitalIdUpload/fileSelectionScreen.tsx
461
+ var FileSelectionScreen = ({ manager, state }) => {
462
+ const { t } = useTranslation();
463
+ const fileInputRef = A(null);
464
+ y(() => {
465
+ if (!fileInputRef.current) return;
466
+ fileInputRef.current.click();
467
+ }, [state.pickerRequestId]);
468
+ const onFileSelect = (event) => {
469
+ const file = event.currentTarget.files?.[0];
470
+ if (!file) return;
471
+ manager.digitalUploadPickFile(file);
423
472
  };
424
- return /* @__PURE__ */ s(d, {
425
- title: a("idv2.digitalIdUpload.screenTitle"),
426
- subtitle: a("idv2.digitalIdUpload.screenDescription"),
473
+ return /* @__PURE__ */ u(Page, {
474
+ title: t("idv2.digitalIdUpload.screenTitle"),
475
+ subtitle: t("idv2.digitalIdUpload.screenDescription"),
427
476
  className: "IncodeDigitalIdUploadPage",
428
477
  "data-testid": "digital-id-upload-selection",
429
- children: [/* @__PURE__ */ s("div", {
478
+ children: [/* @__PURE__ */ u("div", {
430
479
  class: "IncodeDigitalIdUploadBody",
431
- children: [/* @__PURE__ */ s("input", {
432
- ref: o,
480
+ children: [/* @__PURE__ */ u("input", {
481
+ ref: fileInputRef,
433
482
  type: "file",
434
483
  accept: "application/pdf",
435
- onChange: c,
484
+ onChange: onFileSelect,
436
485
  class: "IncodeDigitalIdUploadHiddenInput",
437
- "aria-label": a("idv2.digitalIdUpload.digitalIdUploadButtonTitle")
438
- }), /* @__PURE__ */ s("div", {
486
+ tabIndex: -1,
487
+ "aria-hidden": "true"
488
+ }), /* @__PURE__ */ u("div", {
439
489
  class: "IncodeDigitalIdUploadTutorialIllustration",
440
490
  "aria-hidden": "true",
441
- children: /* @__PURE__ */ s(H, {})
491
+ children: /* @__PURE__ */ u(UploadIdScreenImage, {})
442
492
  })]
443
- }), /* @__PURE__ */ s("div", {
493
+ }), /* @__PURE__ */ u("div", {
444
494
  class: "IncodeDigitalIdUploadFooter",
445
- children: /* @__PURE__ */ s(b, {
446
- onClick: () => o.current?.click(),
447
- children: a("idv2.digitalIdUpload.digitalIdUploadButtonTitle")
495
+ children: /* @__PURE__ */ u(Button, {
496
+ onClick: () => fileInputRef.current?.click(),
497
+ "aria-haspopup": "dialog",
498
+ children: t("idv2.digitalIdUpload.digitalIdUploadButtonTitle")
448
499
  })
449
500
  })]
450
501
  });
451
- }, ie = ({ manager: t }) => {
452
- let { t: n } = e();
453
- return /* @__PURE__ */ s(d, {
454
- title: n("idv2.digitalIdUpload.fileTooLargeScreen.title"),
455
- subtitle: n("idv2.digitalIdUpload.fileTooLargeScreen.subtitle"),
502
+ };
503
+ //#endregion
504
+ //#region src/modules/id/digitalIdUpload/fileTooLargeScreen.tsx
505
+ var FileTooLargeScreen = ({ manager }) => {
506
+ const { t } = useTranslation();
507
+ return /* @__PURE__ */ u(Page, {
508
+ title: t("idv2.digitalIdUpload.fileTooLargeScreen.title"),
509
+ subtitle: t("idv2.digitalIdUpload.fileTooLargeScreen.subtitle"),
456
510
  className: "IncodeDigitalIdUploadPage",
457
511
  "data-testid": "digital-id-upload-file-too-large",
458
- children: [/* @__PURE__ */ s("div", { class: "IncodeDigitalIdUploadBody" }), /* @__PURE__ */ s("div", {
512
+ children: [/* @__PURE__ */ u("div", { class: "IncodeDigitalIdUploadBody" }), /* @__PURE__ */ u("div", {
459
513
  class: "IncodeDigitalIdUploadFooter",
460
- children: /* @__PURE__ */ s(b, {
461
- onClick: () => t.digitalUploadChooseAnother(),
462
- children: n("idv2.digitalIdUpload.fileTooLargeScreen.cta")
514
+ children: /* @__PURE__ */ u(Button, {
515
+ onClick: () => manager.digitalUploadChooseAnother(),
516
+ children: t("idv2.digitalIdUpload.fileTooLargeScreen.cta")
463
517
  })
464
518
  })]
465
519
  });
466
- }, W = ({ manager: t, state: n }) => {
467
- let { t: r } = e(), i = F(n.file);
468
- return /* @__PURE__ */ s(d, {
469
- titleTopSlot: /* @__PURE__ */ s("div", {
520
+ };
521
+ //#endregion
522
+ //#region src/modules/id/digitalIdUpload/successScreen.tsx
523
+ var SuccessScreen = ({ manager, state }) => {
524
+ const { t } = useTranslation();
525
+ const fileUrl = useFilePreviewUrl(state.file);
526
+ return /* @__PURE__ */ u(Page, {
527
+ titleTopSlot: /* @__PURE__ */ u("div", {
470
528
  class: "IncodeDigitalIdUploadSuccessIcon",
471
529
  "aria-hidden": "true",
472
- children: /* @__PURE__ */ s(C, { size: 32 })
530
+ children: /* @__PURE__ */ u(SuccessIcon, { size: 32 })
473
531
  }),
474
- title: r("idv2.digitalIdUpload.successfullyProcessed"),
475
- subtitle: r("idv2.digitalIdUpload.loadingSuccess.letsContinue"),
532
+ title: t("idv2.digitalIdUpload.successfullyProcessed"),
533
+ subtitle: t("idv2.digitalIdUpload.loadingSuccess.letsContinue"),
476
534
  className: "IncodeDigitalIdUploadPage",
477
535
  "data-testid": "digital-id-upload-success",
478
- children: [/* @__PURE__ */ s("div", {
536
+ children: [/* @__PURE__ */ u("div", {
479
537
  class: "IncodeDigitalIdUploadPreviewBody",
480
538
  children: [
481
- /* @__PURE__ */ s("div", {
539
+ /* @__PURE__ */ u("div", {
482
540
  class: "IncodeDigitalIdUploadPreStatusZone",
483
541
  "aria-hidden": "true"
484
542
  }),
485
- /* @__PURE__ */ s("div", {
543
+ /* @__PURE__ */ u("div", {
486
544
  class: "IncodeDigitalIdUploadDocumentPreview",
487
545
  "aria-hidden": "true",
488
- children: i ? /* @__PURE__ */ s(D, {
489
- url: i,
546
+ children: fileUrl ? /* @__PURE__ */ u(PdfViewer, {
547
+ url: fileUrl,
490
548
  mode: "thumbnail",
491
549
  className: "IncodeDigitalIdUploadDocumentPreviewPdf"
492
550
  }) : null
493
551
  }),
494
- /* @__PURE__ */ s("div", {
552
+ /* @__PURE__ */ u("div", {
495
553
  class: "IncodeDigitalIdUploadPostCaptionZone",
496
554
  "aria-hidden": "true"
497
555
  })
498
556
  ]
499
- }), /* @__PURE__ */ s("div", {
557
+ }), /* @__PURE__ */ u("div", {
500
558
  class: "IncodeDigitalIdUploadFooter",
501
- children: /* @__PURE__ */ s(b, {
502
- onClick: () => t.digitalUploadNextStep(),
503
- children: r("idv2.digitalIdUpload.continue")
559
+ children: /* @__PURE__ */ u(Button, {
560
+ onClick: () => manager.digitalUploadNextStep(),
561
+ children: t("idv2.digitalIdUpload.continue")
504
562
  })
505
563
  })]
506
564
  });
507
- }, G = ({ manager: t }) => {
508
- let { t: n } = e();
509
- return /* @__PURE__ */ s(d, {
510
- title: n("idv2.digitalIdUpload.screenTitle"),
511
- subtitle: n("idv2.digitalIdUpload.screenDescription"),
565
+ };
566
+ //#endregion
567
+ //#region src/modules/id/digitalIdUpload/tutorialScreen.tsx
568
+ var TutorialScreen = ({ manager }) => {
569
+ const { t } = useTranslation();
570
+ return /* @__PURE__ */ u(Page, {
571
+ title: t("idv2.digitalIdUpload.screenTitle"),
572
+ subtitle: t("idv2.digitalIdUpload.screenDescription"),
512
573
  className: "IncodeDigitalIdUploadPage",
513
574
  "data-testid": "digital-id-upload-tutorial",
514
- children: [/* @__PURE__ */ s("div", {
575
+ children: [/* @__PURE__ */ u("div", {
515
576
  class: "IncodeDigitalIdUploadBody",
516
- children: /* @__PURE__ */ s("div", {
577
+ children: /* @__PURE__ */ u("div", {
517
578
  class: "IncodeDigitalIdUploadTutorialIllustration",
518
579
  "aria-hidden": "true",
519
- children: /* @__PURE__ */ s(H, {})
580
+ children: /* @__PURE__ */ u(UploadIdScreenImage, {})
520
581
  })
521
- }), /* @__PURE__ */ s("div", {
582
+ }), /* @__PURE__ */ u("div", {
522
583
  class: "IncodeDigitalIdUploadFooter",
523
- children: /* @__PURE__ */ s(b, {
524
- onClick: () => t.digitalUploadNextStep(),
525
- children: n("idv2.digitalIdUpload.digitalIdUploadButtonTitle")
584
+ children: /* @__PURE__ */ u(Button, {
585
+ onClick: () => manager.digitalUploadNextStep(),
586
+ children: t("idv2.digitalIdUpload.digitalIdUploadButtonTitle")
526
587
  })
527
588
  })]
528
589
  });
529
- }, K = ({ manager: e, state: t }) => t.phase === "tutorial" ? /* @__PURE__ */ s(G, { manager: e }) : t.phase === "selecting" ? /* @__PURE__ */ s(U, {
530
- manager: e,
531
- state: t
532
- }) : t.phase === "reviewing" ? /* @__PURE__ */ s(B, {
533
- manager: e,
534
- state: t
535
- }) : t.phase === "uploading" || t.phase === "holding" ? /* @__PURE__ */ s(I, { state: t }) : t.phase === "success" ? /* @__PURE__ */ s(W, {
536
- manager: e,
537
- state: t
538
- }) : t.phase === "fileTooLarge" ? /* @__PURE__ */ s(ie, { manager: e }) : t.phase === "error" || t.phase === "exhausted" ? /* @__PURE__ */ s(z, {
539
- manager: e,
540
- state: t
541
- }) : null, q = ({ icon: e, label: t, uploaded: n, uploading: r, disabled: a, testId: o, onFile: c }) => {
542
- let l = i(null), d = a || r, f = () => {
543
- d || l.current?.click();
544
- }, p = (e) => {
545
- let t = e.target, n = t.files?.[0];
546
- n && c(n), t.value = "";
547
- }, m = () => r ? /* @__PURE__ */ s(_, { size: "small" }) : n ? /* @__PURE__ */ s(C, { size: 40 }) : /* @__PURE__ */ s(S, {
548
- variant: "xs",
549
- size: 16
590
+ };
591
+ //#endregion
592
+ //#region src/modules/id/digitalIdUpload/digitalIdUpload.tsx
593
+ var DigitalIdUpload = ({ manager, state }) => {
594
+ if (state.phase === "tutorial") return /* @__PURE__ */ u(TutorialScreen, { manager });
595
+ if (state.phase === "selecting") return /* @__PURE__ */ u(FileSelectionScreen, {
596
+ manager,
597
+ state
598
+ });
599
+ if (state.phase === "reviewing") return /* @__PURE__ */ u(FileReviewScreen, {
600
+ manager,
601
+ state
550
602
  });
551
- return /* @__PURE__ */ s("div", {
552
- class: u("IncodeManualUploadSlot", n && "IncodeManualUploadSlot--uploaded", d && "IncodeManualUploadSlot--disabled"),
603
+ if (state.phase === "uploading" || state.phase === "holding") return /* @__PURE__ */ u(AnalyzingScreen, { state });
604
+ if (state.phase === "success") return /* @__PURE__ */ u(SuccessScreen, {
605
+ manager,
606
+ state
607
+ });
608
+ if (state.phase === "fileTooLarge") return /* @__PURE__ */ u(FileTooLargeScreen, { manager });
609
+ if (state.phase === "error" || state.phase === "exhausted") return /* @__PURE__ */ u(ErrorScreen, {
610
+ manager,
611
+ state
612
+ });
613
+ return null;
614
+ };
615
+ //#endregion
616
+ //#region src/modules/id/manualUpload/uploadButton.tsx
617
+ /**
618
+ * Slot card for a single document side. The whole card is the clickable
619
+ * trigger: a row with a small pictogram, the slot label, and a decorative
620
+ * circular action icon on the right. Clicking anywhere on the card opens
621
+ * the native file picker. When the upload has succeeded, the action icon
622
+ * collapses to the success icon.
623
+ *
624
+ * Kept local to the manual-upload flow — not promoted to `shared/`.
625
+ */
626
+ var UploadButton = ({ icon, label, uploaded, uploading, disabled, invalid, describedById, testId, onFile }) => {
627
+ const inputRef = A(null);
628
+ const isDisabled = disabled || uploading;
629
+ const openPicker = () => {
630
+ if (isDisabled) return;
631
+ inputRef.current?.click();
632
+ };
633
+ const handleChange = (event) => {
634
+ const input = event.target;
635
+ const file = input.files?.[0];
636
+ if (file) onFile(file);
637
+ input.value = "";
638
+ };
639
+ const renderActionIcon = () => {
640
+ if (uploading) return /* @__PURE__ */ u(Spinner, { size: "small" });
641
+ if (uploaded) return /* @__PURE__ */ u(SuccessIcon, { size: 40 });
642
+ return /* @__PURE__ */ u(ChevronRightIcon, {
643
+ variant: "xs",
644
+ size: 16
645
+ });
646
+ };
647
+ return /* @__PURE__ */ u(k, { children: [/* @__PURE__ */ u("button", {
648
+ type: "button",
649
+ class: cn("IncodeManualUploadSlot", uploaded && "IncodeManualUploadSlot--uploaded"),
650
+ onClick: openPicker,
651
+ disabled: isDisabled,
652
+ "aria-label": label,
653
+ "aria-busy": uploading || void 0,
654
+ "aria-invalid": invalid || void 0,
655
+ "aria-describedby": describedById,
656
+ "data-testid": testId,
553
657
  children: [
554
- /* @__PURE__ */ s("div", {
658
+ /* @__PURE__ */ u("div", {
555
659
  class: "IncodeManualUploadSlotIcon",
556
660
  "aria-hidden": "true",
557
- children: e
661
+ children: icon
558
662
  }),
559
- /* @__PURE__ */ s("div", {
663
+ /* @__PURE__ */ u("div", {
560
664
  class: "IncodeManualUploadSlotLabel",
561
- children: t
665
+ children: label
562
666
  }),
563
- /* @__PURE__ */ s("button", {
564
- type: "button",
667
+ /* @__PURE__ */ u("div", {
565
668
  class: "IncodeManualUploadSlotAction",
566
- onClick: f,
567
- disabled: d,
568
- "aria-label": t,
569
- "aria-busy": r || void 0,
570
- "data-testid": o,
571
- children: m()
572
- }),
573
- /* @__PURE__ */ s("input", {
574
- ref: l,
575
- type: "file",
576
- accept: "image/*",
577
- class: "IncodeManualUploadSlotInput",
578
- onChange: p,
579
- onInput: p,
580
- tabIndex: -1,
581
- "aria-hidden": "true"
669
+ "aria-hidden": "true",
670
+ children: renderActionIcon()
582
671
  })
583
672
  ]
584
- });
585
- }, J = "IncodeManualUploadSlotIconHighlight", Y = () => /* @__PURE__ */ s("svg", {
673
+ }), /* @__PURE__ */ u("input", {
674
+ ref: inputRef,
675
+ type: "file",
676
+ accept: "image/*",
677
+ class: "IncodeManualUploadSlotInput",
678
+ onChange: handleChange,
679
+ onInput: handleChange,
680
+ tabIndex: -1,
681
+ "aria-hidden": "true"
682
+ })] });
683
+ };
684
+ //#endregion
685
+ //#region src/modules/id/manualUpload/slotIcons.tsx
686
+ /**
687
+ * Slot pictograms used inside the manual-upload cards.
688
+ * Sourced from the Figma `IconIdDocument` component (front / back / passport).
689
+ * The primary shape uses `currentColor` so the parent card controls the tint
690
+ * via CSS. The inner highlight is filled via `.IncodeManualUploadSlotIconHighlight`
691
+ * so it remains theme-aware (dark mode included).
692
+ */
693
+ var HIGHLIGHT_CLASS = "IncodeManualUploadSlotIconHighlight";
694
+ var IdFrontIcon = () => /* @__PURE__ */ u("svg", {
586
695
  xmlns: "http://www.w3.org/2000/svg",
587
696
  width: "27",
588
697
  height: "27",
589
698
  viewBox: "0 0 27 27",
590
699
  fill: "none",
591
700
  "aria-hidden": "true",
592
- children: [/* @__PURE__ */ s("path", {
701
+ children: [/* @__PURE__ */ u("path", {
593
702
  d: "M11.4187 12.2343C11.4187 12.557 11.323 12.8724 11.1437 13.1406C10.9645 13.4089 10.7097 13.618 10.4117 13.7414C10.1136 13.8649 9.78559 13.8972 9.46916 13.8343C9.15273 13.7713 8.86207 13.6159 8.63393 13.3878C8.4058 13.1597 8.25044 12.869 8.1875 12.5526C8.12455 12.2362 8.15686 11.9082 8.28032 11.6101C8.40379 11.312 8.61287 11.0573 8.88113 10.878C9.14939 10.6988 9.46477 10.6031 9.7874 10.6031C10.22 10.6031 10.635 10.775 10.9409 11.0809C11.2468 11.3868 11.4187 11.8017 11.4187 12.2343ZM23.653 5.70934V20.3906C23.653 20.8232 23.4812 21.2381 23.1752 21.5441C22.8693 21.85 22.4544 22.0218 22.0218 22.0218H4.07803C3.64539 22.0218 3.23048 21.85 2.92456 21.5441C2.61864 21.2381 2.44678 20.8232 2.44678 20.3906V5.70934C2.44678 5.27671 2.61864 4.8618 2.92456 4.55588C3.23048 4.24996 3.64539 4.07809 4.07803 4.07809H22.0218C22.4544 4.07809 22.8693 4.24996 23.1752 4.55588C23.4812 4.8618 23.653 5.27671 23.653 5.70934ZM20.3905 14.6812C20.3905 14.4649 20.3046 14.2574 20.1516 14.1045C19.9987 13.9515 19.7912 13.8656 19.5749 13.8656H15.4968C15.2805 13.8656 15.073 13.9515 14.92 14.1045C14.7671 14.2574 14.6812 14.4649 14.6812 14.6812C14.6812 14.8975 14.7671 15.105 14.92 15.258C15.073 15.4109 15.2805 15.4968 15.4968 15.4968H19.5749C19.7912 15.4968 19.9987 15.4109 20.1516 15.258C20.3046 15.105 20.3905 14.8975 20.3905 14.6812ZM20.3905 11.4187C20.3905 11.2024 20.3046 10.9949 20.1516 10.842C19.9987 10.689 19.7912 10.6031 19.5749 10.6031H15.4968C15.2805 10.6031 15.073 10.689 14.92 10.842C14.7671 10.9949 14.6812 11.2024 14.6812 11.4187C14.6812 11.635 14.7671 11.8425 14.92 11.9955C15.073 12.1484 15.2805 12.2343 15.4968 12.2343H19.5749C19.7912 12.2343 19.9987 12.1484 20.1516 11.9955C20.3046 11.8425 20.3905 11.635 20.3905 11.4187Z",
594
703
  fill: "currentColor"
595
- }), /* @__PURE__ */ s("path", {
704
+ }), /* @__PURE__ */ u("path", {
596
705
  d: "M5.02231 16.1109C5.58996 15.3667 6.34651 14.7807 7.21692 14.4111H7.22173C6.74461 13.9847 6.41033 13.4271 6.26277 12.8114C6.11521 12.1957 6.16125 11.5507 6.39486 10.9611C6.62847 10.3715 7.03873 9.86478 7.5718 9.50748C8.10487 9.15018 8.73583 8.95898 9.3819 8.95898C10.028 8.95898 10.6589 9.15018 11.192 9.50748C11.7251 9.86478 12.1353 10.3715 12.3689 10.9611C12.6025 11.5507 12.6486 12.1957 12.501 12.8114C12.3535 13.4271 12.0192 13.9847 11.5421 14.4111C12.4125 14.7807 13.169 15.3667 13.7367 16.1109C13.8083 16.2041 13.852 16.315 13.8628 16.4311C13.8736 16.5472 13.8511 16.664 13.7979 16.7683C13.7446 16.8727 13.6627 16.9604 13.5614 17.0217C13.46 17.0829 13.3432 17.1153 13.2241 17.1152H5.53492C5.41579 17.1153 5.29898 17.0829 5.19762 17.0217C5.09626 16.9604 5.01436 16.8727 4.96111 16.7683C4.90787 16.664 4.88539 16.5472 4.8962 16.4311C4.90701 16.315 4.95068 16.2041 5.02231 16.1109Z",
597
706
  fill: "white"
598
707
  })]
599
- }), ae = () => /* @__PURE__ */ s("svg", {
708
+ });
709
+ var IdBackIcon = () => /* @__PURE__ */ u("svg", {
600
710
  viewBox: "0 0 27 27",
601
711
  fill: "none",
602
712
  "aria-hidden": "true",
603
- children: /* @__PURE__ */ s("path", {
713
+ children: /* @__PURE__ */ u("path", {
604
714
  d: "M22.022 4.07812C22.4545 4.07818 22.8694 4.24985 23.1753 4.55566C23.4811 4.86149 23.6527 5.27649 23.6528 5.70898V20.3906C23.6528 20.8232 23.4811 21.238 23.1753 21.5439C22.8694 21.8498 22.4545 22.0214 22.022 22.0215H4.07764C3.64514 22.0214 3.23014 21.8498 2.92432 21.5439C2.61852 21.238 2.44678 20.8232 2.44678 20.3906V5.70898C2.44688 5.27649 2.61849 4.86149 2.92432 4.55566C3.23014 4.24984 3.64514 4.07823 4.07764 4.07812H22.022ZM5.49658 17C5.28034 17.0001 5.07332 17.0863 4.92041 17.2393C4.7675 17.3922 4.6812 17.5992 4.68115 17.8154C4.68115 18.0317 4.76745 18.2396 4.92041 18.3926C5.0733 18.5453 5.28047 18.6308 5.49658 18.6309H11.9995C12.2158 18.6309 12.4237 18.5455 12.5767 18.3926C12.7296 18.2396 12.8159 18.0317 12.8159 17.8154C12.8159 17.5993 12.7295 17.3922 12.5767 17.2393C12.4237 17.0863 12.2158 17 11.9995 17H5.49658ZM5.49658 7.60352C5.28047 7.60357 5.0733 7.68907 4.92041 7.8418C4.76745 7.99476 4.68115 8.20263 4.68115 8.41895C4.68116 8.46917 4.68462 10.4372 4.69189 10.5498C4.71927 10.9728 5.05459 11.289 5.49658 11.2891H20.1841C20.5995 11.2891 20.9497 10.9654 20.981 10.5498C20.9934 10.3844 20.9995 8.48197 20.9995 8.41895C20.9995 8.20263 20.9142 7.99476 20.7612 7.8418C20.6083 7.68884 20.4004 7.60352 20.1841 7.60352H5.49658Z",
605
715
  fill: "currentColor"
606
716
  })
607
- }), X = () => /* @__PURE__ */ s("svg", {
717
+ });
718
+ var PassportSlotIcon = () => /* @__PURE__ */ u("svg", {
608
719
  viewBox: "0 0 27 27",
609
720
  fill: "none",
610
721
  "aria-hidden": "true",
611
722
  children: [
612
- /* @__PURE__ */ s("path", {
723
+ /* @__PURE__ */ u("path", {
613
724
  d: "M14.8498 4.01579L24.7216 4.01579C25.0873 4.01579 25.4379 4.18646 25.6964 4.49026C25.955 4.79406 26.1002 5.20609 26.1002 5.63573L26.1002 21.4689C26.1002 21.8986 25.955 22.3106 25.6964 22.6144C25.4379 22.9182 25.0873 23.0889 24.7216 23.0889L14.8498 23.0889C14.4841 23.0889 14.1335 22.9182 13.875 22.6144C13.6164 22.3106 13.4712 21.8986 13.4712 21.4689L13.4712 5.63573C13.4712 5.20609 13.6164 4.79406 13.875 4.49026C14.1335 4.18646 14.4841 4.01579 14.8498 4.01579ZM21.5868 7.25567C21.404 7.25567 21.2287 7.341 21.0994 7.4929C20.9702 7.6448 20.8975 7.85082 20.8975 8.06564L20.8975 11.1224C20.8975 11.3372 20.9702 11.5433 21.0994 11.6952C21.2287 11.8471 21.404 11.9324 21.5868 11.9324C21.7696 11.9324 21.945 11.8471 22.0742 11.6952C22.2035 11.5433 22.2761 11.3372 22.2761 11.1224L22.2761 8.06564C22.2761 7.85082 22.2035 7.6448 22.0742 7.4929C21.945 7.341 21.7696 7.25567 21.5868 7.25567ZM18.8297 7.25567C18.6469 7.25567 18.4715 7.341 18.3423 7.4929C18.213 7.6448 18.1404 7.85082 18.1404 8.06564L18.1404 11.1224C18.1404 11.3372 18.213 11.5433 18.3423 11.6952C18.4715 11.8471 18.6469 11.9324 18.8297 11.9324C19.0125 11.9324 19.1878 11.8471 19.3171 11.6952C19.4463 11.5433 19.519 11.3372 19.519 11.1224L19.519 8.06564C19.519 7.85082 19.4463 7.6448 19.3171 7.4929C19.1878 7.341 19.0125 7.25567 18.8297 7.25567Z",
614
725
  fill: "currentColor"
615
726
  }),
616
- /* @__PURE__ */ s("path", {
617
- class: J,
727
+ /* @__PURE__ */ u("path", {
728
+ class: HIGHLIGHT_CLASS,
618
729
  d: "M22.1102 19.9907C21.6493 19.6096 21.2864 19.1017 21.0575 18.5174L21.0575 18.5142C20.7934 18.8345 20.448 19.0589 20.0667 19.158C19.6853 19.257 19.2859 19.2261 18.9207 19.0693C18.5555 18.9124 18.2417 18.637 18.0204 18.2792C17.7991 17.9213 17.6807 17.4977 17.6807 17.064C17.6807 16.6303 17.7991 16.2067 18.0204 15.8488C18.2417 15.491 18.5555 15.2155 18.9207 15.0587C19.2859 14.9019 19.6853 14.871 20.0667 14.97C20.448 15.0691 20.7934 15.2935 21.0575 15.6138C21.2864 15.0295 21.6493 14.5216 22.1102 14.1405C22.1679 14.0924 22.2366 14.0631 22.3086 14.0558C22.3805 14.0486 22.4528 14.0637 22.5174 14.0994C22.582 14.1352 22.6364 14.1902 22.6743 14.2582C22.7123 14.3262 22.7323 14.4047 22.7323 14.4846L22.7323 19.6466C22.7323 19.7266 22.7123 19.805 22.6743 19.873C22.6364 19.9411 22.582 19.996 22.5174 20.0318C22.4528 20.0675 22.3805 20.0826 22.3086 20.0754C22.2366 20.0681 22.1679 20.0388 22.1102 19.9907Z"
619
730
  }),
620
- /* @__PURE__ */ s("path", {
731
+ /* @__PURE__ */ u("path", {
621
732
  d: "M1.14809 4.01579L11.4809 4.01579C11.7854 4.01579 12.0775 4.18582 12.2928 4.48848C12.5081 4.79114 12.629 5.20164 12.629 5.62967L12.629 21.475C12.629 21.903 12.5081 22.3135 12.2928 22.6162C12.0775 22.9188 11.7854 23.0889 11.4809 23.0889L1.14809 23.0889C0.843601 23.0889 0.551578 22.9188 0.336269 22.6162C0.12096 22.3135 2.17692e-08 21.903 3.05959e-09 21.475L-7.63166e-07 5.62967C-7.81875e-07 5.20164 0.120959 4.79115 0.336268 4.48849C0.551577 4.18583 0.8436 4.01579 1.14809 4.01579Z",
622
733
  fill: "currentColor"
623
734
  })
624
735
  ]
625
- }), oe = {
736
+ });
737
+ //#endregion
738
+ //#region src/modules/id/manualUpload/uploadTab.tsx
739
+ var SLOT_LABEL_KEYS = {
626
740
  front: {
627
741
  idle: "manualIdUpload.frontId",
628
742
  uploading: "manualIdUpload.uploadingFrontId",
@@ -638,195 +752,250 @@ var I = ({ state: t }) => {
638
752
  uploading: "manualIdUpload.uploadingPassport",
639
753
  uploaded: "manualIdUpload.passportUploaded"
640
754
  }
641
- }, Z = ({ mode: t, manager: n, state: r }) => {
642
- let { t: i } = e(), a = (e, t, n) => {
643
- let r = oe[e];
644
- return i(t ? r.uploading : n ? r.uploaded : r.idle);
755
+ };
756
+ var UploadTab = ({ mode, manager, state, errorMessageId }) => {
757
+ const { t } = useTranslation();
758
+ const slotLabel = (slot, isUploading, isUploaded) => {
759
+ const keys = SLOT_LABEL_KEYS[slot];
760
+ return t(isUploading ? keys.uploading : isUploaded ? keys.uploaded : keys.idle);
645
761
  };
646
- if (t === "passport") {
647
- let e = r.uploadingSide === "passport";
648
- return /* @__PURE__ */ s("div", {
762
+ const slotErrorProps = (slot) => state.errorSide === slot ? {
763
+ invalid: true,
764
+ describedById: errorMessageId
765
+ } : {};
766
+ if (mode === "passport") {
767
+ const isUploading = state.uploadingSide === "passport";
768
+ return /* @__PURE__ */ u("div", {
649
769
  class: "IncodeManualUploadTab",
650
- children: /* @__PURE__ */ s(q, {
651
- icon: /* @__PURE__ */ s(X, {}),
652
- label: a("passport", e, r.passportUploaded),
653
- uploaded: r.passportUploaded,
654
- uploading: e,
770
+ children: /* @__PURE__ */ u(UploadButton, {
771
+ icon: /* @__PURE__ */ u(PassportSlotIcon, {}),
772
+ label: slotLabel("passport", isUploading, state.passportUploaded),
773
+ uploaded: state.passportUploaded,
774
+ uploading: isUploading,
655
775
  testId: "manual-upload-passport",
656
- onFile: (e) => n.manualUploadSelectFile("passport", e)
776
+ onFile: (file) => manager.manualUploadSelectFile("passport", file),
777
+ ...slotErrorProps("passport")
657
778
  })
658
779
  });
659
780
  }
660
- let o = r.uploadingSide === "front", c = r.uploadingSide === "back";
661
- return /* @__PURE__ */ s("div", {
781
+ const isUploadingFront = state.uploadingSide === "front";
782
+ const isUploadingBack = state.uploadingSide === "back";
783
+ return /* @__PURE__ */ u("div", {
662
784
  class: "IncodeManualUploadTab",
663
- children: [/* @__PURE__ */ s(q, {
664
- icon: /* @__PURE__ */ s(Y, {}),
665
- label: a("front", o, r.frontUploaded),
666
- uploaded: r.frontUploaded,
667
- uploading: o,
785
+ children: [/* @__PURE__ */ u(UploadButton, {
786
+ icon: /* @__PURE__ */ u(IdFrontIcon, {}),
787
+ label: slotLabel("front", isUploadingFront, state.frontUploaded),
788
+ uploaded: state.frontUploaded,
789
+ uploading: isUploadingFront,
668
790
  testId: "manual-upload-front",
669
- onFile: (e) => n.manualUploadSelectFile("front", e)
670
- }), r.showBackSlot && /* @__PURE__ */ s(q, {
671
- icon: /* @__PURE__ */ s(ae, {}),
672
- label: a("back", c, r.backUploaded),
673
- uploaded: r.backUploaded,
674
- uploading: c,
791
+ onFile: (file) => manager.manualUploadSelectFile("front", file),
792
+ ...slotErrorProps("front")
793
+ }), state.showBackSlot && /* @__PURE__ */ u(UploadButton, {
794
+ icon: /* @__PURE__ */ u(IdBackIcon, {}),
795
+ label: slotLabel("back", isUploadingBack, state.backUploaded),
796
+ uploaded: state.backUploaded,
797
+ uploading: isUploadingBack,
675
798
  testId: "manual-upload-back",
676
- onFile: (e) => n.manualUploadSelectFile("back", e)
799
+ onFile: (file) => manager.manualUploadSelectFile("back", file),
800
+ ...slotErrorProps("back")
677
801
  })]
678
802
  });
679
- }, se = (e) => e === "id" || e === "passport", ce = ({ manager: t, state: n }) => {
680
- let { t: r } = e();
681
- if (n.phase === "exhausted") return /* @__PURE__ */ s(T, {
682
- title: r("manualIdUpload.tooManyTries"),
683
- description: r("manualIdUpload.contactedByAdmin"),
803
+ };
804
+ //#endregion
805
+ //#region src/modules/id/manualUpload/manualUpload.tsx
806
+ var isManualUploadTab = (value) => value === "id" || value === "passport";
807
+ var ManualUpload = ({ manager, state }) => {
808
+ const { t } = useTranslation();
809
+ if (state.phase === "exhausted") return /* @__PURE__ */ u(ErrorContent, {
810
+ title: t("manualIdUpload.tooManyTries"),
811
+ description: t("manualIdUpload.contactedByAdmin"),
684
812
  attemptsRemaining: 0,
685
- onButtonClick: () => t.manualUploadContinue(),
813
+ onButtonClick: () => manager.manualUploadContinue(),
686
814
  "data-testid": "manual-upload-exhausted"
687
815
  });
688
- if (n.phase === "uploading") return /* @__PURE__ */ s(_, {
689
- fullScreen: !0,
816
+ if (state.phase === "uploading") return /* @__PURE__ */ u(Spinner, {
817
+ fullScreen: true,
690
818
  size: "large",
691
- title: r("manualIdUpload.holdOnASec"),
692
- subtitle: r("idv2.manualUploadLoading.subtitle"),
819
+ title: t("manualIdUpload.holdOnASec"),
820
+ subtitle: t("idv2.manualUploadLoading.subtitle"),
693
821
  className: "IncodeManualUploadLoading"
694
822
  });
695
- let i = n.showIdTab && n.showPassportTab, a = (e) => {
696
- se(e) && t.manualUploadChangeTab(e);
697
- }, o = n.activeTab === "passport" ? ["hintPassportReadable", "hintSharpAndGlareFree"] : ["hintIdReadable", "hintSharpAndGlareFree"];
698
- return /* @__PURE__ */ s(d, {
699
- title: r("manualIdUpload.title"),
700
- subtitle: r("manualIdUpload.subtitle"),
823
+ const bothTabs = state.showIdTab && state.showPassportTab;
824
+ const handleTabChange = (next) => {
825
+ if (isManualUploadTab(next)) manager.manualUploadChangeTab(next);
826
+ };
827
+ const hintKeys = state.activeTab === "passport" ? ["hintPassportReadable", "hintSharpAndGlareFree"] : ["hintIdReadable", "hintSharpAndGlareFree"];
828
+ const errorMessageId = state.errorSide ? `manualUploadError-${state.errorSide}` : void 0;
829
+ return /* @__PURE__ */ u(Page, {
830
+ title: t("manualIdUpload.title"),
831
+ subtitle: t("manualIdUpload.subtitle"),
701
832
  "data-testid": "manual-upload-page",
702
833
  className: "IncodeManualUploadPage",
703
- children: [/* @__PURE__ */ s("div", {
834
+ children: [/* @__PURE__ */ u("div", {
704
835
  class: "IncodeManualUploadContainer",
705
- children: [i ? /* @__PURE__ */ s(O, {
706
- value: n.activeTab,
707
- onValueChange: a,
836
+ children: [bothTabs ? /* @__PURE__ */ u(Tabs, {
837
+ value: state.activeTab,
838
+ onValueChange: handleTabChange,
708
839
  listClassName: "IncodeManualUploadTabsList",
709
840
  triggerClassName: "IncodeManualUploadTabTrigger",
710
841
  activeTriggerClassName: "IncodeManualUploadTabTrigger--active",
711
842
  children: [
712
- /* @__PURE__ */ s(O.List, {
713
- label: r("manualIdUpload.tabsLabel"),
714
- children: [/* @__PURE__ */ s(O.Trigger, {
843
+ /* @__PURE__ */ u(Tabs.List, {
844
+ label: t("manualIdUpload.tabsLabel"),
845
+ children: [/* @__PURE__ */ u(Tabs.Trigger, {
715
846
  value: "id",
716
- children: r("manualIdUpload.id")
717
- }), /* @__PURE__ */ s(O.Trigger, {
847
+ children: t("manualIdUpload.id")
848
+ }), /* @__PURE__ */ u(Tabs.Trigger, {
718
849
  value: "passport",
719
- children: r("manualIdUpload.passport")
850
+ children: t("manualIdUpload.passport")
720
851
  })]
721
852
  }),
722
- /* @__PURE__ */ s(O.Content, {
853
+ /* @__PURE__ */ u(Tabs.Content, {
723
854
  value: "id",
724
- children: /* @__PURE__ */ s(Z, {
855
+ children: /* @__PURE__ */ u(UploadTab, {
725
856
  mode: "id",
726
- manager: t,
727
- state: n
857
+ manager,
858
+ state,
859
+ errorMessageId
728
860
  })
729
861
  }),
730
- /* @__PURE__ */ s(O.Content, {
862
+ /* @__PURE__ */ u(Tabs.Content, {
731
863
  value: "passport",
732
- children: /* @__PURE__ */ s(Z, {
864
+ children: /* @__PURE__ */ u(UploadTab, {
733
865
  mode: "passport",
734
- manager: t,
735
- state: n
866
+ manager,
867
+ state,
868
+ errorMessageId
736
869
  })
737
870
  })
738
871
  ]
739
- }) : n.showIdTab ? /* @__PURE__ */ s(Z, {
872
+ }) : state.showIdTab ? /* @__PURE__ */ u(UploadTab, {
740
873
  mode: "id",
741
- manager: t,
742
- state: n
743
- }) : n.showPassportTab ? /* @__PURE__ */ s(Z, {
874
+ manager,
875
+ state,
876
+ errorMessageId
877
+ }) : state.showPassportTab ? /* @__PURE__ */ u(UploadTab, {
744
878
  mode: "passport",
745
- manager: t,
746
- state: n
747
- }) : null, n.errorKey ? /* @__PURE__ */ s("div", {
879
+ manager,
880
+ state,
881
+ errorMessageId
882
+ }) : null, state.errorKey ? /* @__PURE__ */ u("div", {
883
+ id: errorMessageId,
748
884
  class: "IncodeManualUploadError",
749
885
  role: "alert",
750
886
  "data-testid": "manual-upload-error",
751
- children: [/* @__PURE__ */ s(x, { size: 16 }), /* @__PURE__ */ s("p", { children: r(n.errorKey) })]
887
+ children: [/* @__PURE__ */ u(ErrorIcon, { size: 16 }), /* @__PURE__ */ u("p", { children: t(state.errorKey) })]
752
888
  }) : null]
753
- }), /* @__PURE__ */ s("div", {
889
+ }), /* @__PURE__ */ u("div", {
754
890
  class: "IncodeManualUploadFooter",
755
- children: [/* @__PURE__ */ s("ul", {
891
+ children: [/* @__PURE__ */ u("ul", {
756
892
  class: "IncodeManualUploadHintCard",
757
893
  "data-testid": "manual-upload-hint-card",
758
- children: o.map((e) => /* @__PURE__ */ s("li", { children: r(`manualIdUpload.${e}`) }, e))
759
- }), /* @__PURE__ */ s(b, {
760
- onClick: () => t.manualUploadContinue(),
761
- disabled: !n.canContinue,
894
+ children: hintKeys.map((key) => /* @__PURE__ */ u("li", { children: t(`manualIdUpload.${key}`) }, key))
895
+ }), /* @__PURE__ */ u(Button, {
896
+ onClick: () => manager.manualUploadContinue(),
897
+ disabled: !state.canContinue,
762
898
  "data-testid": "manual-upload-continue",
763
- children: r("manualIdUpload.continue")
899
+ children: t("manualIdUpload.continue")
764
900
  })]
765
901
  })]
766
902
  });
767
- }, Q = !1;
768
- function le() {
769
- Q || (Q = !0, import("../id-tutorial-BCr42Pnn.js"), import("../back-tutorial-1NOQobGO.js"), import("../passport-tutorial-DwRwtPVX.js"));
903
+ };
904
+ //#endregion
905
+ //#region src/modules/id/preloadTutorialAssets.ts
906
+ var started = false;
907
+ function preloadIdTutorialAssets() {
908
+ if (started) return;
909
+ started = true;
910
+ import("../id-tutorial-lj4iKtYT.js");
911
+ import("../back-tutorial-vb1MxlrT.js");
912
+ import("../passport-tutorial-zT1ZoA-D.js");
770
913
  }
771
914
  //#endregion
772
915
  //#region src/modules/id/id.tsx
773
- var ue = n(() => import("../mandatoryConsent-DssKMC3v.js").then((e) => ({ default: e.MandatoryConsent }))), de = ({ config: n, manager: r, onFinish: i, onError: o }) => {
774
- M();
775
- let { t: l } = e();
776
- t(() => {
777
- le();
916
+ var MandatoryConsent = z(() => import("../mandatoryConsent-r0PQHmv-.js").then((module) => ({ default: module.MandatoryConsent })));
917
+ var IdContent = ({ config, manager: externalManager, onFinish, onError }) => {
918
+ usePreloadDisplayFont();
919
+ const { t } = useTranslation();
920
+ y(() => {
921
+ preloadIdTutorialAssets();
778
922
  }, []);
779
- let [u, d] = c(() => {
780
- if (r) return r;
781
- if (!n) throw Error("ID capture config is required when no manager is provided");
782
- return k({ config: n });
783
- }, { manageLifecycle: !r });
784
- return u.status === "idle" ? /* @__PURE__ */ s(v, { hideText: !0 }) : u.status === "loading" ? /* @__PURE__ */ s(v, { spinnerConfig: { subtitle: l("loadingCircle.preparingCamera") } }) : u.status === "chooser" ? /* @__PURE__ */ s(m, {
785
- manager: d,
786
- state: u
787
- }) : u.status === "ageVerification" ? /* @__PURE__ */ s(P, { manager: d }) : u.status === "tutorial" ? /* @__PURE__ */ s(ee, {
788
- manager: d,
789
- state: u
790
- }) : u.status === "permissions" ? /* @__PURE__ */ s(E, {
791
- manager: d,
792
- permissionStatus: u.permissionStatus
793
- }) : u.status === "frontFinished" ? /* @__PURE__ */ s(g, {
794
- manager: d,
923
+ const [state, manager] = useManager(() => {
924
+ if (externalManager) return externalManager;
925
+ if (!config) throw new Error("ID capture config is required when no manager is provided");
926
+ return createIdCaptureManager({ config });
927
+ }, { manageLifecycle: !externalManager });
928
+ useModuleTerminalCallbacks({
929
+ status: state.status === "finished" || state.status === "closed" ? state.status : "loading",
930
+ onFinish,
931
+ onError
932
+ });
933
+ if (state.status === "idle") return /* @__PURE__ */ u(TransitionSpinner, { hideText: true });
934
+ if (state.status === "loading") return /* @__PURE__ */ u(TransitionSpinner, { spinnerConfig: { subtitle: t("loadingCircle.preparingCamera") } });
935
+ if (state.status === "chooser") return /* @__PURE__ */ u(Chooser, {
936
+ manager,
937
+ state
938
+ });
939
+ if (state.status === "ageVerification") return /* @__PURE__ */ u(AgeVerification, { manager });
940
+ if (state.status === "tutorial") return /* @__PURE__ */ u(Tutorial, {
941
+ manager,
942
+ state
943
+ });
944
+ if (state.status === "permissions") return /* @__PURE__ */ u(Permissions, {
945
+ manager,
946
+ permissionStatus: state.permissionStatus
947
+ });
948
+ if (state.status === "frontFinished") return /* @__PURE__ */ u(FlipAnimation, {
949
+ manager,
795
950
  direction: "toBack"
796
- }) : u.status === "backFinished" ? /* @__PURE__ */ s(g, {
797
- manager: d,
951
+ });
952
+ if (state.status === "backFinished") return /* @__PURE__ */ u(FlipAnimation, {
953
+ manager,
798
954
  direction: "toFront"
799
- }) : u.status === "capture" ? /* @__PURE__ */ s(p, {
800
- manager: d,
801
- state: u,
802
- onFinish: () => i?.()
803
- }) : u.status === "mandatoryConsent" ? /* @__PURE__ */ s(a, {
955
+ });
956
+ if (state.status === "capture") return /* @__PURE__ */ u(Capture, {
957
+ manager,
958
+ state,
959
+ onFinish: () => onFinish?.()
960
+ });
961
+ if (state.status === "mandatoryConsent") return /* @__PURE__ */ u(P, {
804
962
  fallback: null,
805
- children: /* @__PURE__ */ s(ue, {
806
- config: { consentType: u.regulationType },
807
- onFinish: () => d.acceptMandatoryConsent(),
808
- onError: () => d.cancelMandatoryConsent()
963
+ children: /* @__PURE__ */ u(MandatoryConsent, {
964
+ config: { consentType: state.regulationType },
965
+ onFinish: () => manager.acceptMandatoryConsent(),
966
+ onError: () => manager.cancelMandatoryConsent()
809
967
  })
810
- }) : u.status === "processing" ? /* @__PURE__ */ s(y, {}) : u.status === "expired" ? /* @__PURE__ */ s(h, {
811
- manager: d,
812
- attemptsRemaining: u.attemptsRemaining
813
- }) : u.status === "expiredExhausted" ? /* @__PURE__ */ s(f, { manager: d }) : u.status === "finished" ? (i?.(), null) : u.status === "closed" ? (o?.(void 0), null) : u.status === "error" ? /* @__PURE__ */ s(te, {
814
- manager: d,
815
- state: u,
816
- onError: o
817
- }) : u.status === "manualUpload" ? /* @__PURE__ */ s(ce, {
818
- manager: d,
819
- state: u
820
- }) : u.status === "digitalIdUpload" ? /* @__PURE__ */ s(K, {
821
- manager: d,
822
- state: u
823
- }) : null;
824
- }, $ = ({ config: e, manager: t, onFinish: n, onError: r }) => /* @__PURE__ */ s(l, { children: e || t ? /* @__PURE__ */ s(de, {
825
- config: e,
826
- manager: t,
827
- onFinish: n,
828
- onError: r
829
- }) : null });
830
- ne($, "incode-id");
968
+ });
969
+ if (state.status === "processing") return /* @__PURE__ */ u(Processing, {});
970
+ if (state.status === "expired") return /* @__PURE__ */ u(IdExpired, {
971
+ manager,
972
+ attemptsRemaining: state.attemptsRemaining
973
+ });
974
+ if (state.status === "expiredExhausted") return /* @__PURE__ */ u(IdNoAttempts, { manager });
975
+ if (state.status === "finished" || state.status === "closed") return null;
976
+ if (state.status === "error") return /* @__PURE__ */ u(IdError, {
977
+ manager,
978
+ state,
979
+ onError
980
+ });
981
+ if (state.status === "manualUpload") return /* @__PURE__ */ u(ManualUpload, {
982
+ manager,
983
+ state
984
+ });
985
+ if (state.status === "digitalIdUpload") return /* @__PURE__ */ u(DigitalIdUpload, {
986
+ manager,
987
+ state
988
+ });
989
+ return null;
990
+ };
991
+ var Id = ({ config, manager, onFinish, onError }) => {
992
+ return /* @__PURE__ */ u(IncodeComponent, { children: config || manager ? /* @__PURE__ */ u(IdContent, {
993
+ config,
994
+ manager,
995
+ onFinish,
996
+ onError
997
+ }) : null });
998
+ };
999
+ registerIncodeModuleElement(Id, "incode-id");
831
1000
  //#endregion
832
- export { $ as Id };
1001
+ export { Id };