@incodetech/web 0.0.0-dev-20260608-c8c427ca → 0.0.0-dev-20260609-11ba3e8a

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 (211) hide show
  1. package/dist/ae-signature/ae-signature.es.js +15 -13
  2. package/dist/aligndevicelottie-DY_bX_p8.js +12769 -0
  3. package/dist/antifraud/antifraud.es.js +22 -19
  4. package/dist/authentication/authentication.es.js +42 -33
  5. package/dist/autoFocusTitle-DM6PvgcP.js +29 -0
  6. package/dist/{back-horizontal-hint-DsPhKbR4.js → back-horizontal-hint-BXYix0Wj.js} +26 -26
  7. package/dist/back-tutorial-vb1MxlrT.js +14597 -0
  8. package/dist/{back-vertical-hint-BFJbYQrX.js → back-vertical-hint-DNSh6JNH.js} +27 -27
  9. package/dist/backdevicelottie-HypPqBz7.js +16690 -0
  10. package/dist/base.css +5 -0
  11. package/dist/blurdevicelottie-CBXtBFiJ.js +15951 -0
  12. package/dist/bottomSheet-BuzqNQtG.js +39 -0
  13. package/dist/browser-ponyfill-CLLvZCVg.js +441 -0
  14. package/dist/button-B-qlr4iI.js +35 -0
  15. package/dist/checkbox-CTPETqo5.js +96 -0
  16. package/dist/consent/consent.es.js +75 -64
  17. package/dist/countrySelector-CzyuaDIs.js +60 -0
  18. package/dist/cpf-ocr/cpf-ocr.es.js +2 -2
  19. package/dist/cpfOcr-DQVs3r8N.js +92 -0
  20. package/dist/cpfOcr-WNklFuxT.js +2 -0
  21. package/dist/cross-document-data-match/cross-document-data-match.es.js +20 -17
  22. package/dist/curp-validation/curp-validation.es.js +246 -211
  23. package/dist/customFields-B4MqqDI6.js +140 -0
  24. package/dist/customWatchlist-Dfqw1DQP.js +36 -0
  25. package/dist/dateInputComposed-BsPQHG5o.js +1 -0
  26. package/dist/dateInputComposed-DY97tQVK.js +69 -0
  27. package/dist/defineProperty-mefzVtTv.js +39 -0
  28. package/dist/document-capture/document-capture.es.js +2 -2
  29. package/dist/documentCapture-BE78MIlR.js +876 -0
  30. package/dist/documentCapture-BVfNZL29.js +2 -0
  31. package/dist/dropdownComposed-BF4L-7mJ.js +380 -0
  32. package/dist/dropdownComposed-mvHuRFHn.js +1 -0
  33. package/dist/dynamicForms-BYGGAQoc.js +352 -0
  34. package/dist/ekyb/ekyb.es.js +2 -2
  35. package/dist/ekybModule-BUPX0QhW.js +2 -0
  36. package/dist/ekybModule-CkTXu-4u.js +279 -0
  37. package/dist/ekyc/ekyc.es.js +2 -2
  38. package/dist/ekycModule-BWsVX39d.js +257 -0
  39. package/dist/ekycModule-DNDPqvUc.js +2 -0
  40. package/dist/electronic-signature/electronic-signature.es.js +2 -2
  41. package/dist/electronic-signature-BJSyzex9.js +426 -0
  42. package/dist/email/email.es.js +198 -78
  43. package/dist/emailInput-BHp4Apt4.js +39 -0
  44. package/dist/errorIcon-B0rmz3rw.js +26 -0
  45. package/dist/expiredId-C105HVKv.js +85 -0
  46. package/dist/extensibility-DJwVxojG.js +3070 -0
  47. package/dist/extensibility.es.js +26 -26
  48. package/dist/face-match/face-match.es.js +2 -2
  49. package/dist/faceMatch-BOFGxzzx.js +343 -0
  50. package/dist/faceMatch-CDMcFQwR.js +2 -0
  51. package/dist/field-comparison/field-comparison.es.js +2 -2
  52. package/dist/fieldComparison-BMDmQ8eA.js +88 -0
  53. package/dist/fieldComparison-Z1NleSxD.js +2 -0
  54. package/dist/{flip-animation-CuQ57qTn.js → flip-animation-BGRvygw9.js} +4221 -4221
  55. package/dist/flow/flow.es.js +597 -493
  56. package/dist/flow/styles.css +0 -8
  57. package/dist/{front-horizontal-hint-CKm7PnmS.js → front-horizontal-hint-CLSU0iVo.js} +70 -70
  58. package/dist/{front-vertical-hint-CLHC2qoH.js → front-vertical-hint-BWq-yWQ8.js} +81 -81
  59. package/dist/frontdevicelottie-CLqitJhG.js +17314 -0
  60. package/dist/geolocation/geolocation.es.js +485 -395
  61. package/dist/glaredevicelottie-BS04U6Fc.js +14478 -0
  62. package/dist/governmentValidation/governmentValidation.es.js +145 -64
  63. package/dist/governmentValidation/styles.css +0 -36
  64. package/dist/homeScreen-BsEYyiDB.js +264 -0
  65. package/dist/hooks-BtgmGvba.js +149 -0
  66. package/dist/i18n-gTHArCl9.js +2971 -0
  67. package/dist/icons-DKY3xDkf.js +360 -0
  68. package/dist/id/id.es.js +565 -413
  69. package/dist/id-laser-h-DX8UbVNH.js +467 -0
  70. package/dist/id-laser-v-DhnHdjlB.js +490 -0
  71. package/dist/id-tutorial-lj4iKtYT.js +13165 -0
  72. package/dist/id-verification/id-verification.es.js +21 -18
  73. package/dist/idOcr-BS77o1VC.js +123 -0
  74. package/dist/identity-reuse/identity-reuse.es.js +168 -130
  75. package/dist/incode-logo-57XFniXU.js +4 -0
  76. package/dist/incodeComponent-CDJxFZvS.js +63 -0
  77. package/dist/incodeModule-DkA_yd0X.js +13 -0
  78. package/dist/index.es.js +16 -14
  79. package/dist/inputComposed-5V2nLTqH.js +99 -0
  80. package/dist/inputComposed-BPOYwUBl.js +1 -0
  81. package/dist/loadingIcon-DN62ugKs.js +148 -0
  82. package/dist/lottie_light-Dp9Bz3mf.js +9031 -0
  83. package/dist/mandatoryConsent-DP189TUn.js +107 -0
  84. package/dist/modal-B5QeulDu.js +153 -0
  85. package/dist/modal.hooks-C7K9k_pY.js +202 -0
  86. package/dist/numberedStep-DVAyTPv1.js +13 -0
  87. package/dist/optionAccessibleLabel-Czc2YC8z.js +202 -0
  88. package/dist/otpInput-2IQ-JCK8.js +195 -0
  89. package/dist/page-BZ-0eNWq.js +71 -0
  90. package/dist/{passport-horizontal-hint-C_le0HVU.js → passport-horizontal-hint-DfVsf4Cc.js} +55 -55
  91. package/dist/{passport-tutorial-BYN4T_TE.js → passport-tutorial-zT1ZoA-D.js} +7096 -7084
  92. package/dist/{passport-vertical-hint-H-pyICSv.js → passport-vertical-hint-DVxbTyQp.js} +49 -49
  93. package/dist/pdf-BZA70WbM.js +22398 -0
  94. package/dist/pdfViewer-Dr63sJ51.js +114 -0
  95. package/dist/phone/phone.es.js +214 -87
  96. package/dist/phoneInputComposed-D_IabWKJ.js +12142 -0
  97. package/dist/processing-B_u8wUB7.js +8 -0
  98. package/dist/qe-signature/qe-signature.es.js +15 -13
  99. package/dist/radioGroupComposed-DwYW-Ld-.js +215 -0
  100. package/dist/redirect-to-mobile/redirect-to-mobile.es.js +2099 -859
  101. package/dist/registerIncodeElement-BJJGzVdq.js +11 -0
  102. package/dist/requiredLabelHint-DEadtiwx.js +17 -0
  103. package/dist/richText-C7GUm0WL.js +3153 -0
  104. package/dist/rolldown-runtime--E5BIlTp.js +33 -0
  105. package/dist/selfie/selfie.es.js +54 -42
  106. package/dist/selfieTutorial-CtruLyO2.js +2689 -0
  107. package/dist/signature/signature.es.js +765 -406
  108. package/dist/snackbar-Dz9crm39.js +16 -0
  109. package/dist/spinner-BfBIZkDQ.js +42 -0
  110. package/dist/spinner-DEDtE7Pz.js +1 -0
  111. package/dist/statusPage-CVCoieyd.js +28 -0
  112. package/dist/successIcon-rmzr-pxu.js +30 -0
  113. package/dist/tabs--UMd6eEB.js +103 -0
  114. package/dist/transitionSpinner-CWhGcr7c.js +26 -0
  115. package/dist/{tutorial-QzQ536BL.js → tutorial-Jv0noW4z.js} +832 -578
  116. package/dist/types/extensibility.d.ts +3 -1
  117. package/dist/types/index.d.ts +13 -4
  118. package/dist/typography-BK4AmfKX.js +45 -0
  119. package/dist/uiConfig-sgEkFuuA.js +25 -0
  120. package/dist/useModuleLoader-CuhHtmgr.js +670 -0
  121. package/dist/vendor-preact-BH7vOa2r.js +957 -0
  122. package/dist/verificationResult-CJ0JyV6A.js +64 -0
  123. package/dist/verifiedByIncode-8QBn-kgZ.js +103 -0
  124. package/dist/watchlist/watchlist.es.js +31 -26
  125. package/dist/watchlistForBusiness-RZcnjVDb.js +80 -0
  126. package/dist/workflow/styles.css +0 -8
  127. package/dist/workflow/workflow.es.js +251 -209
  128. package/package.json +4 -2
  129. package/dist/aligndevicelottie-D8KsO77t.js +0 -12757
  130. package/dist/autoFocusTitle-BpYdaSUM.js +0 -16
  131. package/dist/back-tutorial-DhSE2FJo.js +0 -14585
  132. package/dist/backdevicelottie-CJWGVMdw.js +0 -16678
  133. package/dist/blurdevicelottie-Dxt2deEB.js +0 -15939
  134. package/dist/bottomSheet-QrpyatOD.js +0 -31
  135. package/dist/browser-ponyfill-Crda_c5R.js +0 -299
  136. package/dist/button-DcCUEn2n.js +0 -24
  137. package/dist/checkbox-DCCzBAuF.js +0 -86
  138. package/dist/countrySelector-CJ8egQ4C.js +0 -58
  139. package/dist/cpfOcr-Db06i-Lm.js +0 -2
  140. package/dist/cpfOcr-FixhUeMQ.js +0 -79
  141. package/dist/customFields-C1G9xHNX.js +0 -125
  142. package/dist/customWatchlist-IKEblz7u.js +0 -31
  143. package/dist/dateInputComposed-Cg8BvYSK.js +0 -1
  144. package/dist/dateInputComposed-Ddd7HLyM.js +0 -58
  145. package/dist/defineProperty-xczUyn-m.js +0 -39
  146. package/dist/documentCapture-D9I7FjGe.js +0 -2
  147. package/dist/documentCapture-b61wlala.js +0 -765
  148. package/dist/dropdownComposed-B4U0AIak.js +0 -1
  149. package/dist/dropdownComposed-CS2pyn-g.js +0 -293
  150. package/dist/dynamicForms-tYQog0kw.js +0 -298
  151. package/dist/ekybModule-C33C4JES.js +0 -237
  152. package/dist/ekybModule-LON6G2Bz.js +0 -2
  153. package/dist/ekycModule-BJOgtTAh.js +0 -225
  154. package/dist/ekycModule-BSf_DIG7.js +0 -2
  155. package/dist/electronic-signature-OdgTyso4.js +0 -406
  156. package/dist/emailInput-CU7mLB21.js +0 -37
  157. package/dist/errorIcon-DpHzAoAo.js +0 -24
  158. package/dist/expiredId-nfVAZgTL.js +0 -70
  159. package/dist/extensibility-BbNy3mVG.js +0 -2602
  160. package/dist/faceMatch-BIila4kf.js +0 -2
  161. package/dist/faceMatch-DJ7Mqujx.js +0 -206
  162. package/dist/fieldComparison-D2RSFYl-.js +0 -84
  163. package/dist/fieldComparison-DbUyouFd.js +0 -2
  164. package/dist/frontdevicelottie-65Vyfpff.js +0 -17302
  165. package/dist/glaredevicelottie-BEyaqtc6.js +0 -14466
  166. package/dist/homeScreen-CyPddxWl.js +0 -227
  167. package/dist/hooks-MxHtZWTS.js +0 -112
  168. package/dist/i18n-Kzzvkz94.js +0 -2019
  169. package/dist/icons-9I5g9-_1.js +0 -292
  170. package/dist/id-laser-h-iCPbFixz.js +0 -467
  171. package/dist/id-laser-v-CNzwliP2.js +0 -483
  172. package/dist/id-tutorial-CF4nO4oX.js +0 -13153
  173. package/dist/idOcr-DlMLMDqa.js +0 -97
  174. package/dist/incode-logo-DX016usY.js +0 -4
  175. package/dist/incodeComponent-BoFhgK7G.js +0 -50
  176. package/dist/incodeModule-BiCoAJ5k.js +0 -13
  177. package/dist/inputComposed-DAEey9xm.js +0 -94
  178. package/dist/inputComposed-eS4B0Mkh.js +0 -1
  179. package/dist/loadingIcon-BN5YRQUb.js +0 -104
  180. package/dist/lottie_light-DLqSnziX.js +0 -4419
  181. package/dist/mandatoryConsent-DNz2jZ43.js +0 -98
  182. package/dist/modal-ZqAhwiRF.js +0 -135
  183. package/dist/modal.hooks-LdusROLW.js +0 -126
  184. package/dist/numberedStep-CdLWASwL.js +0 -11
  185. package/dist/optionAccessibleLabel-DcygPaME.js +0 -140
  186. package/dist/otpInput-C4pk4BJU.js +0 -157
  187. package/dist/page-DA3R7q0J.js +0 -69
  188. package/dist/pdf-51QeiFSx.js +0 -14967
  189. package/dist/pdfViewer-rKzTHket.js +0 -64
  190. package/dist/phoneInputComposed-CjAxk2Gj.js +0 -11230
  191. package/dist/processing-DPktVde2.js +0 -6
  192. package/dist/radioGroupComposed-DRRxVk9Z.js +0 -178
  193. package/dist/registerIncodeElement-BHWOwdSS.js +0 -7
  194. package/dist/requiredLabelHint-B6FN3v88.js +0 -13
  195. package/dist/richText-6pIbydcz.js +0 -1973
  196. package/dist/rolldown-runtime-CYMK-g2i.js +0 -20
  197. package/dist/selfieTutorial-Yo9AlUoT.js +0 -2677
  198. package/dist/snackbar-CQiiWO4p.js +0 -14
  199. package/dist/spinner-B4dcie2T.js +0 -1
  200. package/dist/spinner-CKnjVHxw.js +0 -39
  201. package/dist/statusPage-B8b3Jg6N.js +0 -28
  202. package/dist/successIcon-SlKgTSty.js +0 -28
  203. package/dist/tabs-D7lGst3Q.js +0 -78
  204. package/dist/transitionSpinner-Di3bOyOu.js +0 -17
  205. package/dist/typography-CxjaknHN.js +0 -28
  206. package/dist/uiConfig-CwpQ-IM6.js +0 -20
  207. package/dist/useModuleLoader-Bqs7fglI.js +0 -517
  208. package/dist/vendor-preact-D6SntenC.js +0 -958
  209. package/dist/verificationResult-DhT3hH1b.js +0 -90
  210. package/dist/verifiedByIncode-DpbxzO0y.js +0 -101
  211. package/dist/watchlistForBusiness-CRXVbH4l.js +0 -75
@@ -1,95 +1,106 @@
1
- import { n as e } from "../i18n-Kzzvkz94.js";
2
- import { d as t, v as n } from "../vendor-preact-D6SntenC.js";
3
- import { a as r, c as i, o as a } from "../hooks-MxHtZWTS.js";
4
- import { t as o } from "../incodeComponent-BoFhgK7G.js";
5
- import { t as s } from "../page-DA3R7q0J.js";
6
- import { t as c } from "../transitionSpinner-Di3bOyOu.js";
7
- import { t as l } from "../button-DcCUEn2n.js";
8
- import { t as u } from "../checkbox-DCCzBAuF.js";
9
- import { t as d } from "../incodeModule-BiCoAJ5k.js";
10
- import { t as f } from "../richText-6pIbydcz.js";
11
- import { n as p, t as m } from "../requiredLabelHint-B6FN3v88.js";
12
- import { createConsentManager as h } from "@incodetech/core/consent";
1
+ import { n as useTranslation } from "../i18n-gTHArCl9.js";
2
+ import { d as T, v as u } from "../vendor-preact-BH7vOa2r.js";
3
+ import { a as isTerminalModuleState, c as useManager, o as useModuleTerminalCallbacks } from "../hooks-BtgmGvba.js";
4
+ import { t as IncodeComponent } from "../incodeComponent-CDJxFZvS.js";
5
+ import { t as Page } from "../page-BZ-0eNWq.js";
6
+ import { t as TransitionSpinner } from "../transitionSpinner-CWhGcr7c.js";
7
+ import { t as Button } from "../button-B-qlr4iI.js";
8
+ import { t as Checkbox } from "../checkbox-CTPETqo5.js";
9
+ import { t as registerIncodeModuleElement } from "../incodeModule-DkA_yd0X.js";
10
+ import { t as RichText } from "../richText-C7GUm0WL.js";
11
+ import { n as getRequiredHintMode, t as getFieldHint } from "../requiredLabelHint-DEadtiwx.js";
12
+ import { createConsentManager } from "@incodetech/core/consent";
13
13
  //#region src/modules/consent/consent.tsx
14
- var g = (e) => {
15
- e.target.closest("a") && e.stopPropagation();
16
- }, _ = ({ config: o, manager: d, onFinish: _, onError: v }) => {
17
- let { t: y, i18n: b } = e(), [x, S] = i(() => {
18
- if (d) return d;
19
- if (!o) throw Error("Consent config is required");
20
- return h({ config: {
21
- ...o,
22
- language: b.language
14
+ var stopLinkPropagation = (event) => {
15
+ if (event.target.closest("a")) event.stopPropagation();
16
+ };
17
+ var ConsentContent = ({ config, manager: externalManager, onFinish, onError }) => {
18
+ const { t, i18n } = useTranslation();
19
+ const [state, manager] = useManager(() => {
20
+ if (externalManager) return externalManager;
21
+ if (!config) throw new Error("Consent config is required");
22
+ return createConsentManager({ config: {
23
+ ...config,
24
+ language: i18n.language
23
25
  } });
24
- }, { manageLifecycle: !d }), C = "checkboxes" in x ? x.checkboxes : void 0, w = t(() => p(C?.map((e) => e.required) ?? []), [C]);
25
- return a({
26
- status: x.status,
27
- onFinish: _,
28
- onError: v,
29
- error: x.status === "error" ? x.error : void 0
30
- }), r(x) ? null : x.status === "idle" || x.status === "loading" ? /* @__PURE__ */ n(c, { hideText: !0 }) : /* @__PURE__ */ n(s, {
26
+ }, { manageLifecycle: !externalManager });
27
+ const checkboxes = "checkboxes" in state ? state.checkboxes : void 0;
28
+ const mode = T(() => getRequiredHintMode(checkboxes?.map((c) => c.required) ?? []), [checkboxes]);
29
+ useModuleTerminalCallbacks({
30
+ status: state.status,
31
+ onFinish,
32
+ onError,
33
+ error: state.status === "error" ? state.error : void 0
34
+ });
35
+ if (isTerminalModuleState(state)) return null;
36
+ if (state.status === "idle" || state.status === "loading") return /* @__PURE__ */ u(TransitionSpinner, { hideText: true });
37
+ return /* @__PURE__ */ u(Page, {
31
38
  className: "IncodeConsentPage",
32
- title: x.title,
33
- children: /* @__PURE__ */ n("div", {
39
+ title: state.title,
40
+ children: /* @__PURE__ */ u("div", {
34
41
  class: "IncodeConsentContent",
35
42
  children: [
36
- /* @__PURE__ */ n("div", {
43
+ /* @__PURE__ */ u("div", {
37
44
  class: "IncodeConsentBody",
38
- children: [/* @__PURE__ */ n(f, {
39
- content: x.richText,
45
+ children: [/* @__PURE__ */ u(RichText, {
46
+ content: state.richText,
40
47
  class: "IncodeRichText"
41
- }), /* @__PURE__ */ n("div", {
48
+ }), /* @__PURE__ */ u("div", {
42
49
  class: "IncodeConsentCheckboxList",
43
50
  role: "group",
44
- "aria-label": y("biometricConsent.consentOptions"),
45
- children: x.checkboxes.map((e) => {
46
- let t = m(w, e.required), r = t ? y(`forms.label.${t}`) : void 0;
47
- return /* @__PURE__ */ n(u, {
48
- id: `consent-checkbox-${e.id}`,
51
+ "aria-label": t("biometricConsent.consentOptions"),
52
+ children: state.checkboxes.map((checkbox) => {
53
+ const hint = getFieldHint(mode, checkbox.required);
54
+ const labelHint = hint ? t(`forms.label.${hint}`) : void 0;
55
+ return /* @__PURE__ */ u(Checkbox, {
56
+ id: `consent-checkbox-${checkbox.id}`,
49
57
  class: "IncodeConsentCheckbox",
50
58
  size: "s",
51
- checked: e.checked,
52
- required: e.required,
53
- labelHint: r,
54
- onChange: () => S.toggleCheckbox(e.id),
55
- label: /* @__PURE__ */ n("span", {
59
+ checked: checkbox.checked,
60
+ required: checkbox.required,
61
+ labelHint,
62
+ onChange: () => manager.toggleCheckbox(checkbox.id),
63
+ label: /* @__PURE__ */ u("span", {
56
64
  class: "IncodeConsentCheckboxLabel",
57
65
  role: "presentation",
58
- onClick: g,
59
- onKeyDown: g,
60
- children: /* @__PURE__ */ n(f, {
61
- content: e.label,
66
+ onClick: stopLinkPropagation,
67
+ onKeyDown: stopLinkPropagation,
68
+ children: /* @__PURE__ */ u(RichText, {
69
+ content: checkbox.label,
62
70
  class: "IncodeRichText",
63
71
  disallowedTags: ["img"]
64
72
  })
65
73
  })
66
- }, e.id);
74
+ }, checkbox.id);
67
75
  })
68
76
  })]
69
77
  }),
70
- x.status === "display" && x.error ? /* @__PURE__ */ n("p", {
78
+ state.status === "display" && state.error ? /* @__PURE__ */ u("p", {
71
79
  class: "IncodeConsentSubmitError",
72
80
  "data-testid": "consent-submit-error",
73
81
  role: "alert",
74
- children: x.error
82
+ children: state.error
75
83
  }) : null,
76
- /* @__PURE__ */ n(l, {
84
+ /* @__PURE__ */ u(Button, {
77
85
  class: "IncodeConsentButton",
78
86
  "data-testid": "consent-submit",
79
- onClick: () => S.submit(),
80
- disabled: !x.canSubmit,
81
- isLoading: x.status === "submitting",
82
- children: y("biometricConsent.button.continue")
87
+ onClick: () => manager.submit(),
88
+ disabled: !state.canSubmit,
89
+ isLoading: state.status === "submitting",
90
+ children: t("biometricConsent.button.continue")
83
91
  })
84
92
  ]
85
93
  })
86
94
  }, "ready");
87
- }, v = ({ config: e, manager: t, onFinish: r, onError: i }) => /* @__PURE__ */ n(o, { children: e || t ? /* @__PURE__ */ n(_, {
88
- config: e,
89
- manager: t,
90
- onFinish: r,
91
- onError: i
92
- }) : null });
93
- d(v, "incode-consent");
95
+ };
96
+ var Consent = ({ config, manager, onFinish, onError }) => {
97
+ return /* @__PURE__ */ u(IncodeComponent, { children: config || manager ? /* @__PURE__ */ u(ConsentContent, {
98
+ config,
99
+ manager,
100
+ onFinish,
101
+ onError
102
+ }) : null });
103
+ };
104
+ registerIncodeModuleElement(Consent, "incode-consent");
94
105
  //#endregion
95
- export { v as Consent };
106
+ export { Consent };
@@ -0,0 +1,60 @@
1
+ import { n as useTranslation } from "./i18n-gTHArCl9.js";
2
+ import { d as T, v as u } from "./vendor-preact-BH7vOa2r.js";
3
+ import { t as DropdownComposed } from "./dropdownComposed-BF4L-7mJ.js";
4
+ //#region src/shared/countrySelector/countrySelector.tsx
5
+ var DEFAULT_COUNTRY_CODES = [
6
+ "BR",
7
+ "CN",
8
+ "FR",
9
+ "DE",
10
+ "IL",
11
+ "IT",
12
+ "MX",
13
+ "ES",
14
+ "GB",
15
+ "US"
16
+ ];
17
+ var DEFAULT_DEV_ONLY_COUNTRY_CODES = [
18
+ "CM",
19
+ "KE",
20
+ "NG"
21
+ ];
22
+ function countryFlag(code) {
23
+ return [...code.toUpperCase()].map((c) => String.fromCodePoint(127462 + c.charCodeAt(0) - 65)).join("");
24
+ }
25
+ function isDevEnvironment() {
26
+ if (typeof window === "undefined") return false;
27
+ const { hostname } = window.location;
28
+ return hostname === "localhost" || hostname.includes("stage") || hostname.includes("demo");
29
+ }
30
+ var CountrySelector = ({ value, onChange, label, id = "country-selector", countryCodes = DEFAULT_COUNTRY_CODES, devOnlyCountryCodes = DEFAULT_DEV_ONLY_COUNTRY_CODES, "data-testid": testId }) => {
31
+ const { i18n } = useTranslation();
32
+ const locale = i18n.language || "en";
33
+ return /* @__PURE__ */ u("div", {
34
+ class: "IncodeCountrySelector",
35
+ children: /* @__PURE__ */ u(DropdownComposed, {
36
+ id,
37
+ label,
38
+ value,
39
+ options: T(() => {
40
+ const displayNames = new Intl.DisplayNames([locale, "en"], { type: "region" });
41
+ return (isDevEnvironment() ? [...countryCodes, ...devOnlyCountryCodes] : [...countryCodes]).map((code) => {
42
+ const name = displayNames.of(code) ?? code;
43
+ return {
44
+ value: code,
45
+ label: `${countryFlag(code)} ${name}`,
46
+ ariaLabel: name
47
+ };
48
+ }).sort((a, b) => a.label.localeCompare(b.label, locale));
49
+ }, [
50
+ countryCodes,
51
+ devOnlyCountryCodes,
52
+ locale
53
+ ]),
54
+ onChange,
55
+ "data-testid": testId
56
+ })
57
+ });
58
+ };
59
+ //#endregion
60
+ export { CountrySelector as t };
@@ -1,2 +1,2 @@
1
- import { t as e } from "../cpfOcr-FixhUeMQ.js";
2
- export { e as CpfOcr };
1
+ import { t as CpfOcr } from "../cpfOcr-DQVs3r8N.js";
2
+ export { CpfOcr };
@@ -0,0 +1,92 @@
1
+ import { _ as y, p as d, v as u } from "./vendor-preact-BH7vOa2r.js";
2
+ import { c as useManager, o as useModuleTerminalCallbacks } from "./hooks-BtgmGvba.js";
3
+ import { r as Spacer } from "./loadingIcon-DN62ugKs.js";
4
+ import { t as Page } from "./page-BZ-0eNWq.js";
5
+ import { t as Spinner } from "./spinner-BfBIZkDQ.js";
6
+ import "./spinner-DEDtE7Pz.js";
7
+ import { t as Button } from "./button-B-qlr4iI.js";
8
+ import { t as VerificationResult } from "./verificationResult-CJ0JyV6A.js";
9
+ import { t as InputComposed } from "./inputComposed-5V2nLTqH.js";
10
+ import { createCpfOcrManager } from "@incodetech/core/cpf-ocr";
11
+ //#region src/modules/cpf-ocr/cpfOcr.tsx
12
+ var getInputState = (state) => {
13
+ if (state.status === "inputting") return {
14
+ cpf: state.cpf,
15
+ isValid: state.isValid
16
+ };
17
+ return {
18
+ cpf: "",
19
+ isValid: false
20
+ };
21
+ };
22
+ var CpfOcr = ({ manager: externalManager, onFinish, onError }) => {
23
+ const [state, manager] = useManager(() => externalManager ?? createCpfOcrManager(), { manageLifecycle: !externalManager });
24
+ const [hasBlurred, setHasBlurred] = d(false);
25
+ const [hasEdited, setHasEdited] = d(false);
26
+ const [isFocused, setIsFocused] = d(false);
27
+ useModuleTerminalCallbacks({
28
+ status: state.status === "finished" ? "finished" : "loading",
29
+ onFinish
30
+ });
31
+ y(() => {
32
+ if (state.status === "error") onError?.(state.error);
33
+ }, [state, onError]);
34
+ if (state.status === "idle" || state.status === "loading" || state.status === "submitting") return /* @__PURE__ */ u(Page, {
35
+ className: "IncodeCpfOcrPage",
36
+ children: /* @__PURE__ */ u("div", {
37
+ class: "IncodeCpfOcrLoading",
38
+ children: /* @__PURE__ */ u(Spinner, { fullScreen: false })
39
+ })
40
+ });
41
+ if (state.status === "error") return /* @__PURE__ */ u(VerificationResult, {
42
+ status: "failure",
43
+ failureTitle: "Não foi possível verificar o CPF",
44
+ onRetry: () => manager.retry()
45
+ });
46
+ if (state.status === "finished") return null;
47
+ const inputState = getInputState(state);
48
+ const isComplete = inputState.cpf.replace(/\D/g, "").length === 11;
49
+ const cpfError = hasEdited && !inputState.isValid && (isComplete || hasBlurred && !isFocused) ? "Insira um CPF válido" : void 0;
50
+ return /* @__PURE__ */ u(Page, {
51
+ className: "IncodeCpfOcrPage",
52
+ title: "Insira e verifique o número do seu CPF",
53
+ children: /* @__PURE__ */ u("div", {
54
+ class: "IncodeCpfOcr",
55
+ children: [
56
+ /* @__PURE__ */ u(Spacer, { size: 32 }),
57
+ /* @__PURE__ */ u(InputComposed, {
58
+ id: "cpf-ocr-input",
59
+ label: "",
60
+ value: inputState.cpf,
61
+ placeholder: "Seu CPF",
62
+ maxLength: 14,
63
+ inputMode: "numeric",
64
+ "aria-label": "CPF",
65
+ onInput: (event) => {
66
+ setHasEdited(true);
67
+ manager.setCpf(event.target.value);
68
+ },
69
+ onFocus: () => {
70
+ setIsFocused(true);
71
+ },
72
+ onBlur: () => {
73
+ setIsFocused(false);
74
+ setHasBlurred(true);
75
+ },
76
+ error: cpfError,
77
+ showErrorIcon: true
78
+ }),
79
+ /* @__PURE__ */ u(Spacer, {}),
80
+ /* @__PURE__ */ u(Button, {
81
+ type: "button",
82
+ onClick: () => manager.submit(),
83
+ disabled: !inputState.isValid,
84
+ "data-testid": "cpf-ocr-continue",
85
+ children: "Continuar"
86
+ })
87
+ ]
88
+ })
89
+ });
90
+ };
91
+ //#endregion
92
+ export { CpfOcr as t };
@@ -0,0 +1,2 @@
1
+ import { t as CpfOcr } from "./cpfOcr-DQVs3r8N.js";
2
+ export { CpfOcr };
@@ -1,19 +1,22 @@
1
- import { _ as e, v as t } from "../vendor-preact-D6SntenC.js";
2
- import { c as n, o as r } from "../hooks-MxHtZWTS.js";
3
- import { t as i } from "../incodeComponent-BoFhgK7G.js";
4
- import { t as a } from "../spinner-CKnjVHxw.js";
5
- import { t as o } from "../incodeModule-BiCoAJ5k.js";
6
- import { createCrossDocumentDataMatchManager as s } from "@incodetech/core/cross-document-data-match";
1
+ import { _ as y, v as u } from "../vendor-preact-BH7vOa2r.js";
2
+ import { c as useManager, o as useModuleTerminalCallbacks } from "../hooks-BtgmGvba.js";
3
+ import { t as IncodeComponent } from "../incodeComponent-CDJxFZvS.js";
4
+ import { t as Spinner } from "../spinner-BfBIZkDQ.js";
5
+ import { t as registerIncodeModuleElement } from "../incodeModule-DkA_yd0X.js";
6
+ import { createCrossDocumentDataMatchManager } from "@incodetech/core/cross-document-data-match";
7
7
  //#region src/modules/cross-document-data-match/cross-document-data-match.tsx
8
- var c = ({ onFinish: i }) => {
9
- let [o, c] = n(() => s());
10
- return e(() => {
11
- c.load();
12
- }, [c]), r({
13
- status: o.status === "finished" ? "finished" : "loading",
14
- onFinish: i
15
- }), /* @__PURE__ */ t(a, { fullScreen: !0 });
16
- }, l = ({ onFinish: e }) => /* @__PURE__ */ t(i, { children: /* @__PURE__ */ t(c, { onFinish: e }) });
17
- o(l, "incode-cross-document-data-match");
8
+ var CrossDocumentDataMatchContent = ({ onFinish }) => {
9
+ const [state, manager] = useManager(() => createCrossDocumentDataMatchManager());
10
+ y(() => {
11
+ manager.load();
12
+ }, [manager]);
13
+ useModuleTerminalCallbacks({
14
+ status: state.status === "finished" ? "finished" : "loading",
15
+ onFinish
16
+ });
17
+ return /* @__PURE__ */ u(Spinner, { fullScreen: true });
18
+ };
19
+ var CrossDocumentDataMatch = ({ onFinish }) => /* @__PURE__ */ u(IncodeComponent, { children: /* @__PURE__ */ u(CrossDocumentDataMatchContent, { onFinish }) });
20
+ registerIncodeModuleElement(CrossDocumentDataMatch, "incode-cross-document-data-match");
18
21
  //#endregion
19
- export { l as CrossDocumentDataMatch };
22
+ export { CrossDocumentDataMatch };