@incodetech/web 0.0.0-dev-20260407-4580f1c → 0.0.0-dev-20260407-2c382da

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 (162) hide show
  1. package/dist/AsYouType-D1H_js4X.js +2607 -0
  2. package/dist/Trans-aTzdT_SA.js +55 -0
  3. package/dist/addressAutocomplete-C8-wL1j_.js +153 -0
  4. package/dist/aligndevicelottie-DlQCRPfM.js +29 -0
  5. package/dist/antifraud/antifraud.es.js +18 -17
  6. package/dist/antifraud/styles.css +1 -1
  7. package/dist/authentication/authentication.es.js +50 -28
  8. package/dist/back-horizontal-hint-CSlf9KI1.js +5 -0
  9. package/dist/back-tutorial-An9AcMSe.js +29 -0
  10. package/dist/back-vertical-hint-CNieqiCr.js +5 -0
  11. package/dist/backdevicelottie-B4NgyWmX.js +29 -0
  12. package/dist/base.css +67 -327
  13. package/dist/blurdevicelottie-_BZRug1c.js +29 -0
  14. package/dist/browser-ponyfill-B6W6hHVY.js +344 -0
  15. package/dist/button-CE9kRlem.js +184 -0
  16. package/dist/cameraView-C2X7klNb.js +55 -0
  17. package/dist/captureOverlay-tCb4R4WE.js +592 -0
  18. package/dist/checkbox-B5X-mfqq.js +137 -0
  19. package/dist/chevronDown-DSHaPKbi.js +23 -0
  20. package/dist/closeIcon-9Hc97omv.js +28 -0
  21. package/dist/consent/consent.es.js +89 -82
  22. package/dist/consent/styles.css +1 -1
  23. package/dist/countries-DfLkrF0x.js +616 -0
  24. package/dist/curp-validation/curp-validation.es.js +313 -271
  25. package/dist/curp-validation/styles.css +1 -1
  26. package/dist/dateInputComposed-C7PCzh-U.js +173 -0
  27. package/dist/document-capture/styles.css +1 -1
  28. package/dist/documentCapture-C0mO-RGE.js +692 -0
  29. package/dist/dropdownComposed-BpinYlrx.js +367 -0
  30. package/dist/ekyb/styles.css +1 -1
  31. package/dist/ekybModule-Dr6LJUg-.js +357 -0
  32. package/dist/ekyc/styles.css +1 -1
  33. package/dist/ekycModule-C3mswduI.js +291 -0
  34. package/dist/email/email.es.js +154 -110
  35. package/dist/email/styles.css +1 -1
  36. package/dist/errorContent-Cb8nmQAE.js +44 -0
  37. package/dist/errorIcon-DEARBrGx.js +26 -0
  38. package/dist/extensibility.es.js +150 -22
  39. package/dist/face-match/styles.css +73 -147
  40. package/dist/faceMatch-DbDp7D3d.js +237 -0
  41. package/dist/fileIcon-CCSvS10T.js +52 -0
  42. package/dist/flip-animation-COR596wy.js +29 -0
  43. package/dist/flipAnimation-BqV462TA.js +2059 -0
  44. package/dist/flow/flow.es.js +2613 -2273
  45. package/dist/flow/styles.css +73 -432
  46. package/dist/formField-CP6wDdfA.js +106 -0
  47. package/dist/front-horizontal-hint-lRLKd7vY.js +7 -0
  48. package/dist/front-vertical-hint-qQoJXRE3.js +7 -0
  49. package/dist/frontdevicelottie-KhKxT5n9.js +29 -0
  50. package/dist/geolocation/geolocation.es.js +832 -852
  51. package/dist/geolocation/styles.css +1 -1
  52. package/dist/glaredevicelottie-DLuIStvb.js +29 -0
  53. package/dist/governmentValidation/governmentValidation.es.js +106 -100
  54. package/dist/governmentValidation/styles.css +1 -1
  55. package/dist/id/id.es.js +59 -53
  56. package/dist/id/styles.css +1 -1
  57. package/dist/id-laser-h-BBV3r3rz.js +29 -0
  58. package/dist/id-laser-v-BTHJaSfx.js +29 -0
  59. package/dist/id-tutorial-B-F5Q28m.js +29 -0
  60. package/dist/incodeModule-C4XIllao.js +96 -0
  61. package/dist/index.es.js +25 -4
  62. package/dist/inputComposed-fUbAGrDy.js +103 -0
  63. package/dist/instance-BWYzq8dk.js +2163 -0
  64. package/dist/loadingIcon-DmuPXh70.js +195 -0
  65. package/dist/mandatoryConsent-5xPI0cor.js +94 -0
  66. package/dist/manualCaptureButton-BvFmTyJe.js +372 -0
  67. package/dist/numberedStep-DwUB__mh.js +5 -0
  68. package/dist/otpInput-BFXhqFRT.js +156 -0
  69. package/dist/page-SrUl0qtN.js +69 -0
  70. package/dist/passport-horizontal-hint-BCtpMp1Y.js +5 -0
  71. package/dist/passport-tutorial-CaYBFTqt.js +29 -0
  72. package/dist/passport-vertical-hint-GaLnzqHP.js +5 -0
  73. package/dist/permissions-DT4Fz9MR.js +709 -0
  74. package/dist/phone/phone.es.js +121 -87
  75. package/dist/phone/styles.css +1 -1
  76. package/dist/phoneInput-CGr8TxOO.js +158 -0
  77. package/dist/phoneInputComposed-Cm9O2Jba.js +206 -0
  78. package/dist/processing-szVOCQwZ.js +19 -0
  79. package/dist/redirect-to-mobile/styles.css +1 -1
  80. package/dist/richText-cspvNz2a.js +1807 -0
  81. package/dist/selfie/selfie.es.js +50 -29
  82. package/dist/selfie/styles.css +66 -170
  83. package/dist/selfieTutorial-Dm_p0ke9.js +29 -0
  84. package/dist/signature/signature.es.js +707 -557
  85. package/dist/signature/styles.css +1 -1
  86. package/dist/spinner-DygONskw.js +60 -0
  87. package/dist/successIcon-Bjsdc4lF.js +26 -0
  88. package/dist/tutorial-Cdz1025D.js +473 -0
  89. package/dist/types/ekyb/styles.d.ts +1 -0
  90. package/dist/types/ekyc/styles.d.ts +1 -0
  91. package/dist/types/index.d.ts +8 -0
  92. package/dist/typography-BDACYR5i.js +14 -0
  93. package/dist/uiConfig-Dnt-2YWB.js +23 -0
  94. package/dist/useMediaQuery-lJdQBmC2.js +18 -0
  95. package/dist/vendor-preact-BoMmvSgn.js +694 -0
  96. package/dist/warningIcon-DQq_MrOB.js +26 -0
  97. package/package.json +11 -8
  98. package/dist/AsYouType-DPWqJvFu.js +0 -2482
  99. package/dist/addressAutocomplete-B3f6PGTT.js +0 -108
  100. package/dist/aligndevicelottie-C9xl1spu.js +0 -12757
  101. package/dist/back-horizontal-hint-Be3dUGk6.js +0 -137
  102. package/dist/back-tutorial-BNTyW-1N.js +0 -14584
  103. package/dist/back-vertical-hint-Bz_rnhd-.js +0 -128
  104. package/dist/backdevicelottie-DBB1YCtW.js +0 -16678
  105. package/dist/blurdevicelottie-9WvZCZ6C.js +0 -15939
  106. package/dist/browser-ponyfill-B4Qc6yfW.js +0 -299
  107. package/dist/button-DhL5eRT3.js +0 -123
  108. package/dist/checkbox-l8NxPf4o.js +0 -85
  109. package/dist/countries-y2ydYDhN.js +0 -8323
  110. package/dist/dateInputComposed-B9WqdYx9.js +0 -2
  111. package/dist/dateInputComposed-ndsGHX1M.js +0 -94
  112. package/dist/defineProperty-brqHEHA_.js +0 -39
  113. package/dist/documentCapture-wDgRLdon.js +0 -784
  114. package/dist/dropdownComposed-_Ey7wJNG.js +0 -258
  115. package/dist/ekyb/ekyb.es.js +0 -2
  116. package/dist/ekybModule-BBOm1y49.js +0 -2
  117. package/dist/ekybModule-fz6i9ZRt.js +0 -286
  118. package/dist/ekyc/ekyc.es.js +0 -2
  119. package/dist/ekycModule-SeTFG3AJ.js +0 -233
  120. package/dist/ekycModule-hxIcNX8n.js +0 -2
  121. package/dist/extensibility-DJihqIzM.js +0 -2248
  122. package/dist/faceMatch-DH8sLx34.js +0 -191
  123. package/dist/flip-animation-DOJzdXB-.js +0 -6983
  124. package/dist/formField-BRTbY8w9.js +0 -100
  125. package/dist/front-horizontal-hint-aGAhadA2.js +0 -380
  126. package/dist/front-vertical-hint-DZz1VeNp.js +0 -420
  127. package/dist/frontdevicelottie-DadDp6be.js +0 -17302
  128. package/dist/glaredevicelottie-BfI84cPw.js +0 -14466
  129. package/dist/i18n-DZOHbK9q.js +0 -1916
  130. package/dist/icons-BHbofCgJ.js +0 -245
  131. package/dist/id-laser-h-BWyU3VgL.js +0 -467
  132. package/dist/id-laser-v-JiWXUlv0.js +0 -467
  133. package/dist/id-tutorial-Cc9xg5_J.js +0 -13152
  134. package/dist/incodeModule-Bf6yJ8RB.js +0 -18
  135. package/dist/inputComposed-BhbfD8Ru.js +0 -77
  136. package/dist/loadingIcon-CeQt7Zgb.js +0 -146
  137. package/dist/mandatoryConsent-LBS8E0rj.js +0 -101
  138. package/dist/numberedStep-CQVRixRP.js +0 -11
  139. package/dist/otpInput-CDIG9el7.js +0 -143
  140. package/dist/page-SvlJWUfz.js +0 -61
  141. package/dist/passport-horizontal-hint-CFsGs7Dp.js +0 -293
  142. package/dist/passport-tutorial-z0LN7Hsp.js +0 -11688
  143. package/dist/passport-vertical-hint-BnCpKWeN.js +0 -267
  144. package/dist/phoneInput-C9T_8FJt.js +0 -138
  145. package/dist/phoneInputComposed-B-0zieIW.js +0 -407
  146. package/dist/processing-B5zhNH6I.js +0 -15
  147. package/dist/richText-Db0PfpkE.js +0 -1973
  148. package/dist/rolldown-runtime-CjdbFOpI.js +0 -13
  149. package/dist/selfieTutorial-B0MIyPrk.js +0 -2676
  150. package/dist/setup-Dq2bzNKH.js +0 -15
  151. package/dist/spacer-DCljE53A.js +0 -59
  152. package/dist/spinner-Bk0YuoLu.js +0 -1
  153. package/dist/spinner-snIGzmm8.js +0 -41
  154. package/dist/successIcon-AHrfmJvv.js +0 -17
  155. package/dist/tutorial-DNOd11tg.js +0 -2780
  156. package/dist/types/ekyb.d.ts +0 -29
  157. package/dist/types/ekyc.d.ts +0 -29
  158. package/dist/typography-BNbFNFek.js +0 -1
  159. package/dist/typography-DvHeVWfY.js +0 -29
  160. package/dist/uiConfig-CwpQ-IM6.js +0 -20
  161. package/dist/vendor-preact-D6SntenC.js +0 -958
  162. package/dist/warningIcon-Cvj-ayg1.js +0 -17
@@ -0,0 +1,357 @@
1
+ import { b as I, u as o, I as J, a as Q } from "./loadingIcon-DmuPXh70.js";
2
+ import { SUPPORTED_COUNTRIES as M, DEV_ONLY_COUNTRIES as Z, computeEkybDisplayErrors as x, createEkybManager as ee } from "@incodetech/core/ekyb";
3
+ import { T as q, y as V, A as D, d as te, q as C, k as oe } from "./vendor-preact-BoMmvSgn.js";
4
+ import "./instance-BWYzq8dk.js";
5
+ import "@incodetech/core";
6
+ import { u as re, A as ne } from "./addressAutocomplete-C8-wL1j_.js";
7
+ import { B as se } from "./button-CE9kRlem.js";
8
+ import { P as K } from "./page-SrUl0qtN.js";
9
+ import { S as ae } from "./spinner-DygONskw.js";
10
+ import { t as G, F as le, V as P } from "./formField-CP6wDdfA.js";
11
+ import { r as ce } from "./incodeModule-C4XIllao.js";
12
+ import { D as Y } from "./dropdownComposed-BpinYlrx.js";
13
+ import { a as _ } from "./inputComposed-fUbAGrDy.js";
14
+ function ue(t) {
15
+ return [...t.toUpperCase()].map((r) => String.fromCodePoint(127462 + r.charCodeAt(0) - 65)).join("");
16
+ }
17
+ const ie = {
18
+ BR: "Brazil",
19
+ CM: "Cameroon",
20
+ CN: "China",
21
+ FR: "France",
22
+ DE: "Germany",
23
+ IL: "Israel",
24
+ IT: "Italy",
25
+ KE: "Kenya",
26
+ MX: "Mexico",
27
+ NG: "Nigeria",
28
+ ES: "Spain",
29
+ GB: "United Kingdom",
30
+ US: "USA"
31
+ };
32
+ function me(t) {
33
+ const r = ie[t] ?? t;
34
+ return { value: t, label: `${ue(t)} ${r}` };
35
+ }
36
+ function de() {
37
+ if (typeof window > "u") return !1;
38
+ const { hostname: t } = window.location;
39
+ return t === "localhost" || t.includes("stage") || t.includes("demo");
40
+ }
41
+ const be = ({
42
+ value: t,
43
+ onChange: r
44
+ }) => {
45
+ const { t: l } = I(), s = q(() => (de() ? [...M, ...Z] : [...M]).map(me).sort((c, d) => c.label.localeCompare(d.label)), []);
46
+ return /* @__PURE__ */ o("div", { className: "IncodeEkybCountrySelector", children: /* @__PURE__ */ o(
47
+ Y,
48
+ {
49
+ id: "ekyb-country",
50
+ label: l("ekyb.country"),
51
+ value: t,
52
+ options: s,
53
+ onChange: r,
54
+ "data-testid": "ekyb-country-selector"
55
+ }
56
+ ) });
57
+ }, B = ({
58
+ field: t,
59
+ value: r,
60
+ error: l,
61
+ errorParams: s,
62
+ country: i,
63
+ onChange: c,
64
+ onBlur: d
65
+ }) => {
66
+ const { t: b } = I(), u = !t.required, y = b(t.label);
67
+ if (t.type === "dropdown") {
68
+ const m = u ? `${y} (${b("common.optional")})` : y;
69
+ return /* @__PURE__ */ o(
70
+ Y,
71
+ {
72
+ id: `ekyb-${t.name}`,
73
+ label: m,
74
+ placeholder: t.placeholder ? b(t.placeholder) : void 0,
75
+ value: r,
76
+ options: (t.options ?? []).map((n) => ({
77
+ ...n,
78
+ label: b(n.label)
79
+ })),
80
+ error: G(b, l, s),
81
+ searchable: !0,
82
+ onChange: (n) => c(t.name, n),
83
+ onBlur: d ? () => d(t.name) : void 0,
84
+ "data-testid": `ekyb-field-${t.name}`
85
+ }
86
+ );
87
+ }
88
+ return /* @__PURE__ */ o(
89
+ le,
90
+ {
91
+ name: t.name,
92
+ label: t.label,
93
+ value: r,
94
+ error: l,
95
+ errorParams: s,
96
+ required: t.required,
97
+ optional: u,
98
+ onChange: c,
99
+ onBlur: d
100
+ }
101
+ );
102
+ }, pe = ({
103
+ ubos: t,
104
+ errors: r,
105
+ errorParams: l,
106
+ canAddUbo: s,
107
+ onSetField: i,
108
+ onBlur: c,
109
+ onAdd: d,
110
+ onRemove: b
111
+ }) => {
112
+ const { t: u } = I(), y = (m) => G(u, r[m], l[m]);
113
+ return t.length === 0 ? null : /* @__PURE__ */ o("div", { className: "IncodeEkybUbos", children: [
114
+ t.map((m, n) => {
115
+ const v = n === 0 ? u("ekyb.uboName") : u("ekyb.uboNameWithNumber", { number: n + 1 }), f = n === 0 ? u("ekyb.uboSurname") : u("ekyb.uboSurnameWithNumber", { number: n + 1 }), N = n === 0;
116
+ return /* @__PURE__ */ o("div", { className: "IncodeEkybUboEntry", children: [
117
+ /* @__PURE__ */ o(
118
+ _,
119
+ {
120
+ id: `ubo-${n}-name`,
121
+ label: v,
122
+ name: `ubo-${n}-name`,
123
+ value: m.name,
124
+ error: y(`ubo-${n}-name`),
125
+ onInput: (S) => i(n, "name", S.target.value),
126
+ onBlur: c ? () => c(`ubo-${n}-name`) : void 0,
127
+ "data-testid": `ekyb-ubo-${n}-name`
128
+ }
129
+ ),
130
+ /* @__PURE__ */ o(
131
+ _,
132
+ {
133
+ id: `ubo-${n}-surname`,
134
+ label: f,
135
+ name: `ubo-${n}-surname`,
136
+ value: m.surname,
137
+ error: y(`ubo-${n}-surname`),
138
+ onInput: (S) => i(
139
+ n,
140
+ "surname",
141
+ S.target.value
142
+ ),
143
+ onBlur: c ? () => c(`ubo-${n}-surname`) : void 0,
144
+ "data-testid": `ekyb-ubo-${n}-surname`
145
+ }
146
+ ),
147
+ !N && /* @__PURE__ */ o(
148
+ "button",
149
+ {
150
+ className: "IncodeEkybRemoveUbo",
151
+ onClick: () => b(n),
152
+ type: "button",
153
+ children: u("common.remove")
154
+ }
155
+ )
156
+ ] }, m.id);
157
+ }),
158
+ s && /* @__PURE__ */ o(
159
+ "button",
160
+ {
161
+ className: "IncodeEkybAddUbo",
162
+ onClick: d,
163
+ type: "button",
164
+ "data-testid": "ekyb-add-ubo",
165
+ children: u("ekyb.addAnotherUbo")
166
+ }
167
+ )
168
+ ] });
169
+ }, ye = ({ config: t, onFinish: r }) => {
170
+ const { t: l } = I(), [s, i] = Q(() => ee({ config: t }));
171
+ return V(() => {
172
+ (s.status === "finished" || s.status === "closed") && r?.();
173
+ }, [s.status, r]), s.status === "finished" || s.status === "closed" ? null : s.status === "loading" ? /* @__PURE__ */ o(
174
+ P,
175
+ {
176
+ status: "submitting",
177
+ submittingTitle: l("common.loading")
178
+ }
179
+ ) : s.status === "submitting" ? /* @__PURE__ */ o(K, { children: /* @__PURE__ */ o(
180
+ ae,
181
+ {
182
+ fullScreen: !1,
183
+ title: l("common.processing"),
184
+ className: "IncodeEkybSpinner"
185
+ }
186
+ ) }) : s.status === "success" ? /* @__PURE__ */ o(P, { status: "success" }) : s.status === "error" ? /* @__PURE__ */ o(P, { status: "failure", onRetry: () => i.retry() }) : s.status === "form" ? /* @__PURE__ */ o(Ee, { state: s, manager: i }) : null;
187
+ }, O = /* @__PURE__ */ new Set([
188
+ "street",
189
+ "houseNo",
190
+ "addressLine2",
191
+ "city",
192
+ "state",
193
+ "postalCode"
194
+ ]), he = ["street", "city", "state", "postalCode", "houseNo"], Ee = ({ state: t, manager: r }) => {
195
+ const {
196
+ country: l,
197
+ fields: s,
198
+ values: i,
199
+ errors: c,
200
+ isValid: d,
201
+ ubos: b,
202
+ canAddUbo: u,
203
+ addressSuggestions: y,
204
+ submitAttempted: m
205
+ } = t, { t: n } = I(), v = D(null), f = D(null), N = D(void 0), S = re(v, s.length), [w, T] = te({}), p = C((e) => {
206
+ T((a) => a[e] ? a : { ...a, [e]: !0 });
207
+ }, []), { displayErrors: E, errorParams: F } = q(
208
+ () => x(
209
+ c,
210
+ w,
211
+ m,
212
+ l,
213
+ s
214
+ ),
215
+ [c, w, m, l, s]
216
+ ), $ = C(
217
+ (e) => p(e),
218
+ [p]
219
+ ), A = C(
220
+ (e, a) => {
221
+ p(e), r.setField(e, a);
222
+ },
223
+ [r, p]
224
+ ), j = C(
225
+ (e, a, h) => {
226
+ p(`ubo-${e}-${a}`), r.setUboField(e, a, h);
227
+ },
228
+ [r, p]
229
+ ), W = C(
230
+ (e) => {
231
+ for (const a of he) p(a);
232
+ r.selectAddress(e);
233
+ },
234
+ [r, p]
235
+ ), z = C(
236
+ (e) => {
237
+ r.removeUbo(e), T((a) => {
238
+ const h = {};
239
+ for (const [k, U] of Object.entries(a)) {
240
+ const R = k.match(/^ubo-(\d+)-(name|surname)$/);
241
+ if (!R) {
242
+ h[k] = U;
243
+ continue;
244
+ }
245
+ const g = Number(R[1]);
246
+ if (g === e) continue;
247
+ const X = g > e ? g - 1 : g;
248
+ h[`ubo-${X}-${R[2]}`] = U;
249
+ }
250
+ return h;
251
+ });
252
+ },
253
+ [r]
254
+ );
255
+ V(() => {
256
+ const e = E.postalCode, a = N.current;
257
+ if (N.current = e, !e || a === e)
258
+ return;
259
+ const h = requestAnimationFrame(() => {
260
+ const k = f.current;
261
+ if (!k) return;
262
+ (k.querySelector("#postalCode-error") ?? k).scrollIntoView({
263
+ behavior: "smooth",
264
+ block: "nearest"
265
+ });
266
+ });
267
+ return () => cancelAnimationFrame(h);
268
+ }, [E.postalCode]);
269
+ const H = s.filter((e) => !O.has(e.name)), L = s.filter((e) => O.has(e.name));
270
+ return /* @__PURE__ */ o(K, { className: `IncodeEkybPage${S ? " IncodeEkybPageScrollable" : ""}`, title: n("ekyb.title"), children: [
271
+ /* @__PURE__ */ o("div", { ref: v, className: "IncodeEkybForm", children: [
272
+ /* @__PURE__ */ o(
273
+ be,
274
+ {
275
+ value: l,
276
+ onChange: (e) => r.setCountry(e)
277
+ }
278
+ ),
279
+ H.map((e) => /* @__PURE__ */ o(
280
+ B,
281
+ {
282
+ field: e,
283
+ value: i[e.name] ?? "",
284
+ error: E[e.name],
285
+ errorParams: F[e.name],
286
+ country: l,
287
+ onChange: A,
288
+ onBlur: $
289
+ },
290
+ e.name
291
+ )),
292
+ /* @__PURE__ */ o(
293
+ pe,
294
+ {
295
+ ubos: b,
296
+ errors: E,
297
+ errorParams: F,
298
+ canAddUbo: u,
299
+ onSetField: j,
300
+ onBlur: $,
301
+ onAdd: () => r.addUbo(),
302
+ onRemove: z
303
+ }
304
+ ),
305
+ L.length > 0 && /* @__PURE__ */ o(oe, { children: [
306
+ /* @__PURE__ */ o("h3", { className: "IncodeEkybSectionHeader", children: n("ekyb.addressDetails") }),
307
+ L.map((e) => e.name === "street" ? /* @__PURE__ */ o(
308
+ ne,
309
+ {
310
+ label: e.label,
311
+ value: i.street ?? "",
312
+ error: E.street,
313
+ errorParams: F.street,
314
+ suggestions: y,
315
+ optional: !e.required,
316
+ onChange: (a) => A("street", a),
317
+ onSearch: (a) => r.searchAddress(a),
318
+ onSelect: W,
319
+ onBlur: () => $("street")
320
+ },
321
+ e.name
322
+ ) : /* @__PURE__ */ o(
323
+ "div",
324
+ {
325
+ ref: e.name === "postalCode" ? f : void 0,
326
+ children: /* @__PURE__ */ o(
327
+ B,
328
+ {
329
+ field: e,
330
+ value: i[e.name] ?? "",
331
+ error: E[e.name],
332
+ errorParams: F[e.name],
333
+ country: l,
334
+ onChange: A,
335
+ onBlur: $
336
+ }
337
+ )
338
+ },
339
+ e.name
340
+ ))
341
+ ] })
342
+ ] }),
343
+ /* @__PURE__ */ o("div", { className: "IncodeEkybFooter", children: /* @__PURE__ */ o(
344
+ se,
345
+ {
346
+ onClick: () => r.submit(),
347
+ disabled: !d,
348
+ "data-testid": "ekyb-submit",
349
+ children: n("ekyb.continue")
350
+ }
351
+ ) })
352
+ ] });
353
+ }, ke = ({ config: t, onFinish: r }) => /* @__PURE__ */ o(J, { children: t ? /* @__PURE__ */ o(ye, { config: t, onFinish: r }) : null });
354
+ ce(ke, "incode-ekyb");
355
+ export {
356
+ ke as EkybModule
357
+ };
@@ -1,4 +1,4 @@
1
- /*! tailwindcss v4.2.2 | MIT License | https://tailwindcss.com */
1
+ /*! tailwindcss v4.1.17 | MIT License | https://tailwindcss.com */
2
2
  @layer properties {
3
3
  @supports (((-webkit-hyphens: none)) and (not (margin-trim: inline))) or ((-moz-orient: inline) and (not (color: rgb(from red r g b)))) {
4
4
  *, :before, :after, ::backdrop {
@@ -0,0 +1,291 @@
1
+ import { u as r, I as Y, b as $, a as G } from "./loadingIcon-DmuPXh70.js";
2
+ import { computeEkycDisplayErrors as j, createEkycManager as z } from "@incodetech/core/ekyc";
3
+ import { y as q, A as F, d as J, q as E, T as Q } from "./vendor-preact-BoMmvSgn.js";
4
+ import "./instance-BWYzq8dk.js";
5
+ import "@incodetech/core";
6
+ import { u as U, A as W } from "./addressAutocomplete-C8-wL1j_.js";
7
+ import { V as v, t as X, F as Z } from "./formField-CP6wDdfA.js";
8
+ import { B as L } from "./button-CE9kRlem.js";
9
+ import { D as f } from "./dateInputComposed-C7PCzh-U.js";
10
+ import { D as ee } from "./dropdownComposed-BpinYlrx.js";
11
+ import { P as T } from "./page-SrUl0qtN.js";
12
+ import { S as re } from "./spinner-DygONskw.js";
13
+ import { r as oe } from "./incodeModule-C4XIllao.js";
14
+ import { P as te } from "./phoneInputComposed-Cm9O2Jba.js";
15
+ const ae = ({ config: p, onFinish: s }) => {
16
+ const { t: l } = $(), [a, d] = G(() => z({ config: p }));
17
+ return q(() => {
18
+ (a.status === "finished" || a.status === "closed") && s?.();
19
+ }, [a.status, s]), a.status === "finished" || a.status === "closed" ? null : a.status === "loading" ? /* @__PURE__ */ r(
20
+ v,
21
+ {
22
+ status: "submitting",
23
+ submittingTitle: l("common.loading")
24
+ }
25
+ ) : a.status === "submitting" ? /* @__PURE__ */ r(T, { children: /* @__PURE__ */ r(
26
+ re,
27
+ {
28
+ fullScreen: !1,
29
+ title: l("common.processing"),
30
+ className: "IncodeEkycSpinner"
31
+ }
32
+ ) }) : a.status === "success" ? /* @__PURE__ */ r(v, { status: "success" }) : a.status === "error" ? /* @__PURE__ */ r(
33
+ v,
34
+ {
35
+ status: "failure",
36
+ onRetry: () => d.retry(),
37
+ onSkip: () => d.skip()
38
+ }
39
+ ) : a.status === "misconfigured" ? /* @__PURE__ */ r(
40
+ v,
41
+ {
42
+ status: "failure",
43
+ failureTitle: l("verification.noFormFields"),
44
+ onSkip: () => d.close(),
45
+ skipLabel: l("common.close")
46
+ }
47
+ ) : a.status === "form" ? /* @__PURE__ */ r(se, { state: a, manager: d }) : null;
48
+ }, ne = [
49
+ "street",
50
+ "city",
51
+ "state",
52
+ "postalCode",
53
+ "houseNo"
54
+ ], se = ({ state: p, manager: s }) => {
55
+ const {
56
+ fields: l,
57
+ values: a,
58
+ errors: d,
59
+ isValid: V,
60
+ addressSuggestions: w,
61
+ prefilled: K,
62
+ hideEmail: M,
63
+ fieldsCountry: C,
64
+ submitError: S,
65
+ submitAttempted: P
66
+ } = p, { t: n } = $(), N = F(null), A = F(null), R = F(void 0), x = U(N, l.length), [D, _] = J({}), h = E((e) => {
67
+ _((o) => o[e] ? o : { ...o, [e]: !0 });
68
+ }, []), { displayErrors: g, errorParams: I } = Q(
69
+ () => j(
70
+ d,
71
+ D,
72
+ P,
73
+ C,
74
+ l
75
+ ),
76
+ [d, D, P, C, l]
77
+ ), y = E(
78
+ (e) => h(e),
79
+ [h]
80
+ ), b = E(
81
+ (e, o) => {
82
+ h(e), s.setField(e, o);
83
+ },
84
+ [s, h]
85
+ ), H = E(
86
+ (e) => {
87
+ for (const o of ne) h(o);
88
+ s.selectAddress(e);
89
+ },
90
+ [s, h]
91
+ );
92
+ q(() => {
93
+ const e = g.postalCode, o = R.current;
94
+ if (R.current = e, !e || o === e)
95
+ return;
96
+ const i = requestAnimationFrame(() => {
97
+ const c = A.current;
98
+ if (!c) return;
99
+ (c.querySelector("#postalCode-error") ?? c).scrollIntoView({
100
+ behavior: "smooth",
101
+ block: "nearest"
102
+ });
103
+ });
104
+ return () => cancelAnimationFrame(i);
105
+ }, [g.postalCode]);
106
+ const k = (e, o) => X(n, o, I[e]);
107
+ let B;
108
+ return /* @__PURE__ */ r(T, { className: `IncodeEkycPage${x ? " IncodeEkycPageScrollable" : ""}`, title: n("verification.title"), children: [
109
+ /* @__PURE__ */ r("div", { ref: N, className: "IncodeEkycForm", children: l.map((e) => {
110
+ if (e.name === "email" && M) return null;
111
+ let o = null;
112
+ e.section && e.section !== B && (B = e.section, o = /* @__PURE__ */ r("h3", { className: "IncodeEkycSectionHeader", children: n({
113
+ address: "verification.labels.addressDetailsSection",
114
+ driverLicense: "verification.labels.dlDetailsSection"
115
+ }[e.section] ?? e.section) }));
116
+ const i = e.readonly || K[e.name], c = a[e.name] ?? "", u = g[e.name];
117
+ if (e.name === "street" && e.section === "address")
118
+ return /* @__PURE__ */ r("div", { children: [
119
+ o,
120
+ /* @__PURE__ */ r(
121
+ W,
122
+ {
123
+ label: e.label,
124
+ value: c,
125
+ error: u,
126
+ errorParams: I[e.name],
127
+ suggestions: w,
128
+ readonly: i,
129
+ optional: !e.required,
130
+ onChange: (t) => b("street", t),
131
+ onSearch: (t) => s.searchAddress(t),
132
+ onSelect: H,
133
+ onBlur: () => y("street")
134
+ }
135
+ )
136
+ ] }, e.name);
137
+ if (e.type === "dropdown") {
138
+ const t = n(e.label);
139
+ return /* @__PURE__ */ r("div", { children: [
140
+ o,
141
+ /* @__PURE__ */ r(
142
+ ee,
143
+ {
144
+ id: `ekyc-${e.name}`,
145
+ label: t,
146
+ placeholder: e.placeholder ? n(e.placeholder) : void 0,
147
+ value: c,
148
+ options: (e.options ?? []).map((m) => ({
149
+ ...m,
150
+ label: n(m.label)
151
+ })),
152
+ error: k(e.name, u),
153
+ disabled: i,
154
+ searchable: !0,
155
+ onChange: (m) => b(e.name, m),
156
+ onBlur: () => y(e.name),
157
+ "data-testid": `ekyc-field-${e.name}`
158
+ }
159
+ )
160
+ ] }, e.name);
161
+ }
162
+ if (e.type === "date") {
163
+ const t = n(e.label);
164
+ return /* @__PURE__ */ r("div", { children: [
165
+ o,
166
+ /* @__PURE__ */ r(
167
+ f,
168
+ {
169
+ id: `ekyc-${e.name}`,
170
+ label: t,
171
+ value: c,
172
+ error: k(e.name, u),
173
+ disabled: i,
174
+ onInput: (m) => {
175
+ const O = m.target;
176
+ b(e.name, O.value);
177
+ },
178
+ onBlur: () => y(e.name),
179
+ "data-testid": `ekyc-field-${e.name}`
180
+ }
181
+ )
182
+ ] }, e.name);
183
+ }
184
+ if (e.type === "phone") {
185
+ const t = n(e.label);
186
+ return /* @__PURE__ */ r("div", { children: [
187
+ o,
188
+ /* @__PURE__ */ r(
189
+ te,
190
+ {
191
+ id: `ekyc-${e.name}`,
192
+ label: t,
193
+ countryCode: C,
194
+ value: c,
195
+ placeholder: e.placeholder,
196
+ error: k(e.name, u),
197
+ disabled: i,
198
+ disableCountrySelector: e.disableCountrySelector,
199
+ required: !1,
200
+ onChange: (m) => b(e.name, m),
201
+ onBlur: () => y(e.name),
202
+ "data-testid": `ekyc-field-${e.name}`
203
+ }
204
+ )
205
+ ] }, e.name);
206
+ }
207
+ return e.type === "radio" ? /* @__PURE__ */ r("div", { children: [
208
+ o,
209
+ /* @__PURE__ */ r("div", { className: "IncodeEkycRadioGroup", children: [
210
+ /* @__PURE__ */ r("label", { className: "IncodeEkycRadioLabel", children: n(e.label) }),
211
+ /* @__PURE__ */ r("div", { className: "IncodeEkycRadioOptions", children: e.options?.map((t) => /* @__PURE__ */ r(
212
+ "label",
213
+ {
214
+ className: "IncodeEkycRadioOption",
215
+ children: [
216
+ /* @__PURE__ */ r(
217
+ "input",
218
+ {
219
+ type: "radio",
220
+ name: e.name,
221
+ checked: c === t.value,
222
+ value: t.value,
223
+ onChange: () => b(e.name, t.value),
224
+ onBlur: () => y(e.name),
225
+ disabled: i
226
+ }
227
+ ),
228
+ /* @__PURE__ */ r("span", { children: n(t.label) })
229
+ ]
230
+ },
231
+ t.value
232
+ )) }),
233
+ u && /* @__PURE__ */ r("span", { className: "IncodeEkycFieldError", children: k(e.name, u) })
234
+ ] })
235
+ ] }, e.name) : /* @__PURE__ */ r(
236
+ "div",
237
+ {
238
+ ref: e.name === "postalCode" ? A : void 0,
239
+ children: [
240
+ o,
241
+ /* @__PURE__ */ r(
242
+ Z,
243
+ {
244
+ name: e.name,
245
+ label: e.label,
246
+ value: c,
247
+ error: u,
248
+ errorParams: I[e.name],
249
+ type: e.type,
250
+ placeholder: e.placeholder,
251
+ placeholderParams: e.placeholderParams,
252
+ required: e.required,
253
+ optional: e.optional,
254
+ readonly: i,
255
+ maxLength: e.maxLength,
256
+ onChange: b,
257
+ onBlur: y
258
+ }
259
+ )
260
+ ]
261
+ },
262
+ e.name
263
+ );
264
+ }) }),
265
+ /* @__PURE__ */ r("div", { className: "IncodeEkycFooter", children: [
266
+ S && /* @__PURE__ */ r("p", { className: "IncodeEkycSubmitError", children: n(S) }),
267
+ /* @__PURE__ */ r(
268
+ L,
269
+ {
270
+ onClick: () => s.submit(),
271
+ disabled: !V,
272
+ "data-testid": "ekyc-submit",
273
+ children: n("common.continue")
274
+ }
275
+ ),
276
+ S === "verification.errors.countryNotSupported" && /* @__PURE__ */ r(
277
+ L,
278
+ {
279
+ variant: "link",
280
+ onClick: () => s.skip(),
281
+ "data-testid": "ekyc-skip",
282
+ children: n("verification.labels.skip")
283
+ }
284
+ )
285
+ ] })
286
+ ] });
287
+ }, ce = ({ config: p, onFinish: s }) => /* @__PURE__ */ r(Y, { children: p ? /* @__PURE__ */ r(ae, { config: p, onFinish: s }) : null });
288
+ oe(ce, "incode-ekyc");
289
+ export {
290
+ ce as EkycModule
291
+ };