@incodetech/core 0.0.0-dev-20261201-5456180d → 0.0.0-dev-20261201-e37652f8

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 (88) hide show
  1. package/dist/{FaceDetectionProvider-DH7QsBFD.esm.js → FaceDetectionProvider-DQYbHLxC.esm.js} +4 -4
  2. package/dist/{addressSearch-Cxpb5vKl.esm.js → addressSearch-gginelz3.esm.js} +28 -26
  3. package/dist/ae-signature.esm.js +1 -1
  4. package/dist/{apiError-BVYipHwI.esm.js → apiError-BRiJu_rv.esm.js} +1 -1
  5. package/dist/authentication.esm.js +2 -2
  6. package/dist/{authenticationManager-Kfm9HxbR.esm.js → authenticationManager-CrBlRkAd.esm.js} +3 -3
  7. package/dist/{authenticationStateMachine-DCVCf6tZ.esm.js → authenticationStateMachine-DLwEyCeH.esm.js} +3 -3
  8. package/dist/consent.d.ts +1 -1
  9. package/dist/{consentManager-vI6QHkHU.d.ts → consentManager-Bow34QP_.d.ts} +9 -9
  10. package/dist/{deepsightCaptureConfig-BfIw-FNj.esm.js → deepsightCaptureConfig-BVJANeRn.esm.js} +2 -2
  11. package/dist/{deepsightLoader-DCSozoXG.esm.js → deepsightLoader-C6nKqY9Q.esm.js} +4 -4
  12. package/dist/{desktopCameraElection-C7OkCslA.esm.js → desktopCameraElection-BAq-Kaiq.esm.js} +4 -4
  13. package/dist/document-capture.d.ts +1 -1
  14. package/dist/document-signature.esm.js +1 -1
  15. package/dist/{documentCaptureManager-sJWgqtUy.d.ts → documentCaptureManager-DOgJTJ4F.d.ts} +4 -4
  16. package/dist/{documentSignatureStateMachine-C1CsjsVW.esm.js → documentSignatureStateMachine-Btlg3q7j.esm.js} +1 -1
  17. package/dist/dynamic-forms.esm.js +2 -2
  18. package/dist/{dynamicFormsManager-DhyIhZ1C.esm.js → dynamicFormsManager-SbEUnFoF.esm.js} +1 -1
  19. package/dist/{dynamicFormsStateMachine-CDyk9sXA.esm.js → dynamicFormsStateMachine-Dxv36mAP.esm.js} +1 -1
  20. package/dist/ekyb.esm.js +2 -2
  21. package/dist/{ekybManager-4ESLrIAZ.esm.js → ekybManager-xhoOX9O9.esm.js} +1 -1
  22. package/dist/{ekybStateMachine-BVQ7DyO1.esm.js → ekybStateMachine-CCjUH0j3.esm.js} +183 -56
  23. package/dist/ekyc-prefill.d.ts +1 -1
  24. package/dist/ekyc-prefill.esm.js +2 -2
  25. package/dist/ekyc.d.ts +3 -0
  26. package/dist/ekyc.esm.js +3 -3
  27. package/dist/{ekycManager-k0d38zcZ.esm.js → ekycManager-DrGuK0kT.esm.js} +1 -1
  28. package/dist/{ekycPrefillManager-3nHwnh_4.esm.js → ekycPrefillManager-C9kdwCC6.esm.js} +2 -2
  29. package/dist/{ekycPrefillManager-BwmPXfhY.d.ts → ekycPrefillManager-Di6aMx68.d.ts} +4 -4
  30. package/dist/{ekycPrefillStateMachine-bz_k9jTV.esm.js → ekycPrefillStateMachine-DiQifkkd.esm.js} +8 -87
  31. package/dist/{ekycStateMachine-BudF0QZu.esm.js → ekycStateMachine-BmMdLe2G.esm.js} +298 -125
  32. package/dist/{ekycUtils-BnTyeA-_.esm.js → ekycUtils-DfBNTcvX.esm.js} +41 -5
  33. package/dist/electronic-signature.esm.js +1 -1
  34. package/dist/{electronicSignatureManager-BMalzzyT.esm.js → electronicSignatureManager-C6liTNbu.esm.js} +1 -1
  35. package/dist/extensibility.d.ts +6 -6
  36. package/dist/extensibility.esm.js +13 -13
  37. package/dist/{faceCaptureManagerFactory-cQl5HDIn.esm.js → faceCaptureManagerFactory-OL8BWaIW.esm.js} +2 -2
  38. package/dist/{faceCaptureSetup-DzWl2VJI.esm.js → faceCaptureSetup-DQVtmb1q.esm.js} +7 -7
  39. package/dist/{feature-management-BVxb2LDw.esm.js → feature-management-D_T-MG_i.esm.js} +1 -1
  40. package/dist/feature-management.esm.js +1 -1
  41. package/dist/flow.esm.js +3 -3
  42. package/dist/{flowCompletionService-DK-fZm71.esm.js → flowCompletionService-L0J63ui-.esm.js} +1 -1
  43. package/dist/{flowServices-DO_evfcT.esm.js → flowServices-3OXrEqDE.esm.js} +5 -5
  44. package/dist/formDefinitionsRollout-B-c4yO2z.esm.js +30 -0
  45. package/dist/{formErrors-lSfh7Y8J.esm.js → formErrors-kpskZLNT.esm.js} +39 -180
  46. package/dist/geolocation.d.ts +1 -1
  47. package/dist/geolocation.esm.js +2 -2
  48. package/dist/{geolocationManager-DcuPbxtE.esm.js → geolocationManager-CREfQNgO.esm.js} +1 -1
  49. package/dist/{geolocationManager-CENrvxpK.d.ts → geolocationManager-Del2ddmt.d.ts} +1 -1
  50. package/dist/{geolocationStateMachine-C2r0HXYO.esm.js → geolocationStateMachine-D9_bBr19.esm.js} +1 -1
  51. package/dist/id-ocr.d.ts +1 -1
  52. package/dist/id-selfie-flow.esm.js +6 -6
  53. package/dist/id.esm.js +3 -3
  54. package/dist/{idCaptureManager-B3e-0VFl.esm.js → idCaptureManager-B5ZN7scK.esm.js} +4 -4
  55. package/dist/{idCaptureServices-CoHVsKtz.esm.js → idCaptureServices-7zZ457LW.esm.js} +2 -2
  56. package/dist/{idCaptureStateMachine-Cbg0iyXR.esm.js → idCaptureStateMachine-FP4j-qeT.esm.js} +11 -11
  57. package/dist/{idOcrManager-DflRx-_u.d.ts → idOcrManager-C0C7lFGd.d.ts} +1 -1
  58. package/dist/index.esm.js +1 -1
  59. package/dist/kyb-checks.esm.js +2 -2
  60. package/dist/{kybChecksManager-BDHpxk15.esm.js → kybChecksManager-tUsFKBCN.esm.js} +1 -1
  61. package/dist/{kybChecksStateMachine-UIwv8ipY.esm.js → kybChecksStateMachine-D1q4K7Xr.esm.js} +3 -3
  62. package/dist/mandatory-consent.d.ts +1 -1
  63. package/dist/{mandatoryConsentManager-ESpx168S.d.ts → mandatoryConsentManager-De9ZX6o4.d.ts} +5 -5
  64. package/dist/qe-signature.esm.js +1 -1
  65. package/dist/{recordingService-G0FrtpAb.esm.js → recordingService-OcyZO_w6.esm.js} +1 -1
  66. package/dist/{runChildModule-Dgi34yo9.esm.js → runChildModule-BuZFd3Df.esm.js} +1 -1
  67. package/dist/{sdkVersion-CrFzbh9y.esm.js → sdkVersion-BY8g-EEL.esm.js} +1 -1
  68. package/dist/selfie.esm.js +7 -7
  69. package/dist/{selfieErrorUtils-DR2Gve4F.esm.js → selfieErrorUtils-DIVWh0ih.esm.js} +1 -1
  70. package/dist/{selfieManager-B3Jd7q4s.esm.js → selfieManager-DQ5xB8y6.esm.js} +3 -3
  71. package/dist/{selfieStateMachine-DM40H79_.esm.js → selfieStateMachine-fyNh2r31.esm.js} +3 -3
  72. package/dist/{session-C7-dU7kj.esm.js → session-DKnCv6zu.esm.js} +4 -4
  73. package/dist/session.esm.js +4 -4
  74. package/dist/{sessionInitializer-NEJvsqjQ.esm.js → sessionInitializer-q5b8Qwr3.esm.js} +4 -4
  75. package/dist/{setup-DXnJ1L0L.esm.js → setup-JGwc0kgu.esm.js} +5 -5
  76. package/dist/trim-OmrUb6mG.esm.js +297 -0
  77. package/dist/trueSight-9VsfHXFt.esm.js +1 -0
  78. package/dist/{trueSightService-MNEZaA-i.esm.js → trueSightService-Dx8AqgKD.esm.js} +1 -1
  79. package/dist/uppercase-CwlIuiwR.esm.js +115 -0
  80. package/dist/video-selfie.esm.js +3 -3
  81. package/dist/{videoSelfieCameraWarmer-CPrXznbc.esm.js → videoSelfieCameraWarmer-AoMytGBD.esm.js} +3 -3
  82. package/dist/wasm.esm.js +1 -1
  83. package/dist/workflow.d.ts +4 -4
  84. package/dist/workflow.esm.js +19 -19
  85. package/package.json +1 -1
  86. package/dist/definitionSource-B9WTvQb9.esm.js +0 -30
  87. package/dist/resolveForm-DaaQSVWp.esm.js +0 -146
  88. package/dist/trueSight-CjUsM1U4.esm.js +0 -1
@@ -0,0 +1,297 @@
1
+ //#region src/shared/displayErrors.ts
2
+ const DYNAMIC_REQUIRED_KEY = "verification.errors.fieldRequiredDynamic";
3
+ //#endregion
4
+ //#region src/internal/forms/values.ts
5
+ /** Whether text is empty once trimmed. */
6
+ const blank = (value) => value.trim() === "";
7
+ /**
8
+ * A value as the kernel reads it: text, a list of texts, or absent. A host
9
+ * can set anything (`setField`), so `null` counts as absent and a number or
10
+ * other scalar as its text.
11
+ */
12
+ function readValue(value) {
13
+ if (value === void 0 || value === null) return void 0;
14
+ if (typeof value === "string") return value;
15
+ if (Array.isArray(value)) return value.map((entry) => entry === void 0 || entry === null ? "" : String(entry));
16
+ return String(value);
17
+ }
18
+ /**
19
+ * Whether a value is empty (spec semantic 2): absent or only whitespace, or
20
+ * a list with no entry that isn't.
21
+ *
22
+ * A phone with only its calling code is a value, not empty, as in every
23
+ * module (CK1 decision K15): the kernel can't tell a calling code from a
24
+ * number being typed (`+44` from `+441`) without calling-code data the phone
25
+ * rules don't expose, and the UI never stores one (an untouched phone input
26
+ * is `""`). ENG-63329 drops the spec's calling-code clause.
27
+ */
28
+ function isEmptyValue(_field, value) {
29
+ const read = readValue(value);
30
+ if (read === void 0) return true;
31
+ return typeof read === "string" ? blank(read) : read.every(blank);
32
+ }
33
+ //#endregion
34
+ //#region src/internal/forms/buildPayload.ts
35
+ /** The request key a field writes, or nothing when it's never sent. */
36
+ const keyOf = (field) => field.payload?.omit ? void 0 : field.payload?.key ?? field.name;
37
+ const isBlank = (value) => (value ?? "").trim() === "";
38
+ /** The ids of a field's request transforms the registry doesn't implement. */
39
+ const unknownTransforms = (field, registry) => (field.payload?.transforms ?? []).map((ref) => ref.id).filter((id) => !registry.transforms.has(id));
40
+ function transform(field, value, registry, env) {
41
+ return (field.payload?.transforms ?? []).reduce((current, ref) => {
42
+ const impl = registry.transforms.get(ref.id);
43
+ return impl ? impl.apply(current, ref.params ?? {}, env) : current;
44
+ }, value);
45
+ }
46
+ /**
47
+ * A `submit.context` entry's runtime value, or nothing when it's empty: the
48
+ * source module configuration names (it can be an alias of the definition's
49
+ * source), else the definition's; the definition's country, else, for a form
50
+ * with no country, the flow's (`env.country`); module configuration's risk
51
+ * add-ons.
52
+ */
53
+ function contextValue(name, definition, env) {
54
+ switch (name) {
55
+ case "source": return env.source || definition.source || void 0;
56
+ case "country": return definition.country || env.country || void 0;
57
+ case "riskAddons": return env.riskAddons?.length ? [...env.riskAddons] : void 0;
58
+ default: return;
59
+ }
60
+ }
61
+ /**
62
+ * The request body a definition describes (spec semantic 5):
63
+ *
64
+ * 1. Every shown field with a non-empty value, under `payload.key` (default
65
+ * its name), after its request transforms. Empty values are left out,
66
+ * never sent as `""` or `null`, so `omitWhenEmpty` changes nothing here;
67
+ * so is a value its transforms leave blank. A list sends its non-blank
68
+ * entries, each transformed. A collection sends each entry with a value as
69
+ * its `join` fields' values, trimmed and joined with a space. With
70
+ * `payload.always` it's sent as `[]` when it isn't shown or no entry has
71
+ * a value; without, it's left out then.
72
+ * 2. `submit.static` keys as written, then `submit.context` keys: the source
73
+ * (`env.source`, else the definition's), the definition's country (else
74
+ * `env.country`), or `riskAddons`. An empty context value is left out.
75
+ * 3. `submit.copies` in order: each replaces `to` with `from`'s value, when
76
+ * `from` is in the body.
77
+ *
78
+ * Two writers of one key keep the first and report a problem.
79
+ */
80
+ function buildPayload(form, values, registry, env, entries = {}) {
81
+ const { definition } = form;
82
+ const body = {};
83
+ const writers = /* @__PURE__ */ new Map();
84
+ const problems = [];
85
+ const write = (key, value, writer) => {
86
+ const first = writers.get(key);
87
+ if (first !== void 0) {
88
+ problems.push({
89
+ kind: "duplicateKey",
90
+ key,
91
+ writers: [first, writer]
92
+ });
93
+ return;
94
+ }
95
+ writers.set(key, writer);
96
+ body[key] = value;
97
+ };
98
+ for (const { field } of form.fields) {
99
+ const key = keyOf(field);
100
+ const value = readValue(values[field.name]);
101
+ if (key === void 0 || isEmptyValue(field, value)) continue;
102
+ for (const id of unknownTransforms(field, registry)) problems.push({
103
+ kind: "unknownTransform",
104
+ field: field.name,
105
+ transform: id
106
+ });
107
+ if (typeof value === "string") {
108
+ const sent = transform(field, value, registry, env);
109
+ if (!isBlank(sent)) write(key, sent, field.name);
110
+ } else if (Array.isArray(value)) {
111
+ const sent = value.filter((entry) => !isBlank(entry)).map((entry) => transform(field, entry, registry, env)).filter((entry) => !isBlank(entry));
112
+ if (sent.length > 0) write(key, sent, field.name);
113
+ }
114
+ }
115
+ const shown = new Set(form.collections.map(({ collection }) => collection.id));
116
+ for (const collection of definition.collections ?? []) {
117
+ const joined = shown.has(collection.id) ? (entries[collection.id] ?? []).map((entry) => collection.payload.join.map((name) => (entry[name] ?? "").trim()).filter((part) => part !== "").join(" ")).filter((value) => value !== "") : [];
118
+ if (joined.length > 0 || collection.payload.always === true) write(collection.payload.key, joined, collection.id);
119
+ }
120
+ for (const [key, value] of Object.entries(definition.submit.static ?? {})) write(key, value, "static");
121
+ for (const [key, name] of Object.entries(definition.submit.context ?? {})) {
122
+ const value = contextValue(name, definition, env);
123
+ if (value !== void 0) write(key, value, "context");
124
+ }
125
+ for (const { from, to } of definition.submit.copies ?? []) if (Object.prototype.hasOwnProperty.call(body, from)) body[to] = body[from];
126
+ return {
127
+ body,
128
+ problems
129
+ };
130
+ }
131
+ //#endregion
132
+ //#region src/internal/forms/checkSupport.ts
133
+ const GROUP_POLICIES = /* @__PURE__ */ new Set(["hide", "forceShow"]);
134
+ const OMIT_WHEN_EMPTY = "payload.omitWhenEmpty";
135
+ /** A collection flag (vocabulary 1.4). */
136
+ const ALWAYS = "payload.always";
137
+ /**
138
+ * Compares `major.minor` vocabulary versions. The compiler's twin is
139
+ * `compareVersions` in `packages/form-definitions/scripts/lib/checks.mjs`;
140
+ * both are tested against that package's `fixtures/vocabularyVersions.json`.
141
+ */
142
+ function compareVocabulary(a, b) {
143
+ const [aMajor = 0, aMinor = 0] = a.split(".").map(Number);
144
+ const [bMajor = 0, bMinor = 0] = b.split(".").map(Number);
145
+ return aMajor - bMajor || aMinor - bMinor;
146
+ }
147
+ /**
148
+ * Whether this build can use a definition. Any id or versioned flag it
149
+ * doesn't implement makes the definition unsupported, so the caller falls
150
+ * back to its bundled definition or current form. Presentation hints
151
+ * (widget, keyboard, autofill) never fail: an unknown hint falls back to the
152
+ * platform default.
153
+ */
154
+ function checkSupport(definition, ids) {
155
+ const problems = [];
156
+ const need = (category, known, id, path) => {
157
+ if (!known.has(id)) problems.push({
158
+ category,
159
+ id,
160
+ path
161
+ });
162
+ };
163
+ if (!ids.schemaVersions.includes(definition.schemaVersion)) problems.push({
164
+ category: "schemaVersion",
165
+ id: String(definition.schemaVersion),
166
+ path: "schemaVersion"
167
+ });
168
+ if (compareVocabulary(definition.vocabulary, ids.vocabulary) > 0) problems.push({
169
+ category: "vocabulary",
170
+ id: definition.vocabulary,
171
+ path: "vocabulary"
172
+ });
173
+ const checkField = (field, path) => {
174
+ need("kind", ids.kinds, field.kind, `${path}.kind`);
175
+ need("group", ids.groups, field.group, `${path}.group`);
176
+ field.rules?.forEach((rule, i) => need("rule", ids.rules, rule.id, `${path}.rules[${i}]`));
177
+ field.input?.format?.forEach((t, i) => need("transform", ids.transforms, t.id, `${path}.input.format[${i}]`));
178
+ field.payload?.transforms?.forEach((t, i) => need("transform", ids.transforms, t.id, `${path}.payload.transforms[${i}]`));
179
+ if (field.payload?.omitWhenEmpty === true) need("flag", ids.flags, OMIT_WHEN_EMPTY, `${path}.${OMIT_WHEN_EMPTY}`);
180
+ if (field.optionsRef) need("optionList", ids.optionLists, field.optionsRef, `${path}.optionsRef`);
181
+ if (field.suggestionsRef) need("optionList", ids.optionLists, field.suggestionsRef, `${path}.suggestionsRef`);
182
+ field.requiredWhen?.forEach((condition, i) => {
183
+ const keys = Object.keys(condition);
184
+ if (keys.length !== 1) problems.push({
185
+ category: "condition",
186
+ id: keys.join("+") || "(empty)",
187
+ path: `${path}.requiredWhen[${i}]`
188
+ });
189
+ for (const key of keys) need("condition", ids.conditions, key, `${path}.requiredWhen[${i}]`);
190
+ });
191
+ field.prefill?.forEach((id, i) => need("prefillSource", ids.prefillSources, id, `${path}.prefill[${i}]`));
192
+ const lock = field.phone?.lockCountry;
193
+ if (typeof lock === "string" && lock !== "whenPhoneRisk") problems.push({
194
+ category: "phoneLock",
195
+ id: lock,
196
+ path: `${path}.phone`
197
+ });
198
+ };
199
+ definition.fields.forEach((field) => checkField(field, `fields.${field.name}`));
200
+ definition.groups?.forEach((policy) => {
201
+ need("group", ids.groups, policy.group, `groups.${policy.group}`);
202
+ if (!GROUP_POLICIES.has(policy.whenDisabled)) problems.push({
203
+ category: "groupPolicy",
204
+ id: policy.whenDisabled,
205
+ path: `groups.${policy.group}`
206
+ });
207
+ });
208
+ definition.groupRules?.forEach((rule, i) => {
209
+ need("groupRule", ids.groupRules, rule.id, `groupRules[${i}]`);
210
+ const cases = rule.id === "rulesByOption" ? rule.params?.cases : void 0;
211
+ if (cases && typeof cases === "object" && !Array.isArray(cases)) for (const [value, rules] of Object.entries(cases)) {
212
+ if (!Array.isArray(rules)) continue;
213
+ rules.forEach((ref, j) => {
214
+ const id = ref?.id;
215
+ need("rule", ids.rules, typeof id === "string" ? id : "(missing)", `groupRules[${i}].params.cases.${value}[${j}]`);
216
+ });
217
+ }
218
+ });
219
+ definition.collections?.forEach((collection) => {
220
+ need("group", ids.groups, collection.group, `collections.${collection.id}`);
221
+ if (collection.payload.always === true) need("flag", ids.flags, ALWAYS, `collections.${collection.id}.${ALWAYS}`);
222
+ collection.fields.forEach((field) => checkField(field, `collections.${collection.id}.fields.${field.name}`));
223
+ });
224
+ return problems.length === 0 ? { supported: true } : {
225
+ supported: false,
226
+ problems
227
+ };
228
+ }
229
+ //#endregion
230
+ //#region src/internal/forms/resolveForm.ts
231
+ const FORCE_SHOW = "forceShow";
232
+ const WHEN_PHONE_RISK = "whenPhoneRisk";
233
+ /**
234
+ * Resolves a definition against module configuration: which fields show,
235
+ * which are required, whether the phone is locked, and which group rules and
236
+ * collections apply. Pure and synchronous, so it runs inside an assign action.
237
+ *
238
+ * Call `checkSupport` first for any definition that wasn't bundled with this
239
+ * build; `resolveForm` ignores ids it doesn't know.
240
+ */
241
+ function resolveForm(definition, context) {
242
+ const forcedGroups = new Set((definition.groups ?? []).filter((policy) => policy.whenDisabled === FORCE_SHOW).map((policy) => policy.group));
243
+ const isOn = (group) => context.groups[group] === true;
244
+ const isShown = (group) => isOn(group) || forcedGroups.has(group);
245
+ const riskAddons = new Set(context.riskAddons ?? []);
246
+ const shownFields = definition.fields.filter((field) => isShown(field.group));
247
+ const shownNames = new Set(shownFields.map((field) => field.name));
248
+ const fields = shownFields.map((field) => {
249
+ const conditions = field.requiredWhen ?? [];
250
+ const addonRequired = conditions.some((condition) => condition.riskAddon !== void 0 && riskAddons.has(condition.riskAddon));
251
+ const requiredIfFilled = conditions.map((condition) => condition.fieldFilled).filter((name) => name !== void 0 && shownNames.has(name));
252
+ const lock = field.phone?.lockCountry;
253
+ return {
254
+ field,
255
+ required: field.required === true || addonRequired,
256
+ requiredIfFilled,
257
+ forced: !isOn(field.group),
258
+ phoneLocked: field.kind === "phone" && (lock === true || lock === WHEN_PHONE_RISK && context.phoneRisk === true)
259
+ };
260
+ });
261
+ const order = shownFields.map((field) => field.name);
262
+ return {
263
+ definition,
264
+ fields,
265
+ groupRules: (definition.groupRules ?? []).map((rule) => ({
266
+ rule,
267
+ fields: order.filter((name) => rule.fields.includes(name))
268
+ })).filter((resolved) => resolved.fields.length > 0),
269
+ collections: (definition.collections ?? []).filter((collection) => isShown(collection.group)).map((collection) => ({
270
+ collection,
271
+ min: collection.min ?? 0,
272
+ max: collection.max
273
+ }))
274
+ };
275
+ }
276
+ //#endregion
277
+ //#region src/internal/forms/rules/e164.ts
278
+ /**
279
+ * `e164`: the phone as `+<country code><number>`. While the phone rules
280
+ * aren't loaded, or the number isn't valid, it stays as typed.
281
+ */
282
+ const e164 = {
283
+ id: "e164",
284
+ apply: (value, _params, env) => env.deps.phone?.formatE164(value, env.country) ?? value
285
+ };
286
+ //#endregion
287
+ //#region src/internal/forms/rules/trim.ts
288
+ /**
289
+ * `trim`: removes leading and trailing whitespace. On a list, the caller
290
+ * applies it to each entry.
291
+ */
292
+ const trim = {
293
+ id: "trim",
294
+ apply: (value) => value.trim()
295
+ };
296
+ //#endregion
297
+ export { buildPayload as a, readValue as c, checkSupport as i, DYNAMIC_REQUIRED_KEY as l, e164 as n, blank as o, resolveForm as r, isEmptyValue as s, trim as t };
@@ -0,0 +1 @@
1
+ import "./trueSightService-Dx8AqgKD.esm.js";
@@ -3,7 +3,7 @@ import { n as getTimestamp } from "./IBrowserEnvironmentCapability-D7JG7ML3.esm.
3
3
  import { S as subscribeEvent, n as eventModuleNames } from "./types-DLsivQsu.esm.js";
4
4
  import { i as isApiConfigured, l as withTiming, n as getApi, o as setClient, r as getToken, t as api, u as endpoints } from "./api-CsXnB7m6.esm.js";
5
5
  import "./events-Dlkhhx5O.esm.js";
6
- import { t as SDK_VERSION } from "./sdkVersion-CrFzbh9y.esm.js";
6
+ import { t as SDK_VERSION } from "./sdkVersion-BY8g-EEL.esm.js";
7
7
  import { n as reportHttpError, t as HttpRequestError } from "./HttpRequestError-Bh0pNGSC.esm.js";
8
8
  /** Dirty-timer half of the interrupted-snapshot rebuild debounce (module boundaries + timer). */
9
9
  const SNAPSHOT_DIRTY_INTERVAL_MS = 15e3;
@@ -0,0 +1,115 @@
1
+ import { n as e164 } from "./trim-OmrUb6mG.esm.js";
2
+ //#region src/internal/forms/checks/charTemplate.ts
3
+ const escapeForPattern = (chars) => chars.replace(/[.*+?^${}()|[\]\\]/g, "\\$&");
4
+ /**
5
+ * `charTemplate`: the whole value matches one template, where `9` is a digit,
6
+ * `A` an uppercase letter A-Z and any other character stands for itself.
7
+ * `ignoreCase` also accepts lowercase letters and literals in either case.
8
+ */
9
+ function matchesCharTemplate(value, templates, ignoreCase = false) {
10
+ return templates.some((template) => {
11
+ const pattern = [...template].map((char) => {
12
+ if (char === "9") return "[0-9]";
13
+ if (char === "A") return "[A-Z]";
14
+ return escapeForPattern(char);
15
+ }).join("");
16
+ return new RegExp(`^${pattern}$`, ignoreCase ? "iu" : "u").test(value);
17
+ });
18
+ }
19
+ //#endregion
20
+ //#region src/internal/forms/definitionSource.ts
21
+ const queryKey = ({ module, source, country, riskAddon }) => `${module}|${source ?? ""}|${country ?? ""}|${riskAddon ?? ""}`;
22
+ /**
23
+ * The definitions bundled with this build. `select` matches module, source,
24
+ * country and risk add-on exactly, so a pair without its own definition keeps
25
+ * the current builder. Aliases live only in the selection index, so
26
+ * `sourceOf` takes them from it.
27
+ */
28
+ function createBundledDefinitionSource(definitions, index = []) {
29
+ const byQuery = new Map(Object.values(definitions).map((definition) => [queryKey(definition), definition]));
30
+ const ownSources = new Set(Object.values(definitions).map((definition) => `${definition.module}|${definition.source ?? ""}`));
31
+ const aliases = /* @__PURE__ */ new Map();
32
+ for (const entry of index) {
33
+ const definition = definitions[entry.id];
34
+ if (!definition?.source) continue;
35
+ for (const alias of entry.aliases ?? []) aliases.set(`${definition.module}|${alias}|${definition.country ?? ""}`, definition.source);
36
+ }
37
+ return {
38
+ select: (query) => byQuery.get(queryKey(query)),
39
+ sourceOf: (module, id, country) => ownSources.has(`${module}|${id}`) ? id : aliases.get(`${module}|${id}|${country ?? ""}`) ?? aliases.get(`${module}|${id}|`) ?? id
40
+ };
41
+ }
42
+ //#endregion
43
+ //#region src/internal/forms/rules/digitGroups.ts
44
+ /**
45
+ * `digitGroups`: formats digits as the user types, such as an SSN shown as
46
+ * 3-2-4 (`groups: [3, 2, 4]`, `separator: "-"`). Other characters are
47
+ * dropped, digits past the last group are cut, and a separator appears once
48
+ * the next group has a digit (`1234` is `123-4`).
49
+ *
50
+ * `separators` (vocabulary 1.4) gives the separator after each group, in
51
+ * order, such as a CPF shown as 3.3.3-2 (`separators: [".", ".", "-"]`). A
52
+ * gap past the end of the list uses `separator`.
53
+ */
54
+ const digitGroups = {
55
+ id: "digitGroups",
56
+ apply: (value, params) => {
57
+ const groups = Array.isArray(params.groups) ? params.groups.filter((size) => typeof size === "number") : [];
58
+ const separator = typeof params.separator === "string" ? params.separator : "";
59
+ const separators = Array.isArray(params.separators) ? params.separators : [];
60
+ const separatorAfter = (index) => {
61
+ const own = separators[index];
62
+ return typeof own === "string" ? own : separator;
63
+ };
64
+ let digits = value.replace(/[^0-9]/g, "");
65
+ let formatted = "";
66
+ for (const [index, size] of groups.entries()) {
67
+ if (!digits) break;
68
+ if (index > 0) formatted += separatorAfter(index - 1);
69
+ formatted += digits.slice(0, size);
70
+ digits = digits.slice(size);
71
+ }
72
+ return formatted;
73
+ }
74
+ };
75
+ //#endregion
76
+ //#region src/internal/forms/rules/e164NoPlus.ts
77
+ /** `e164NoPlus`: the phone as E.164 without the `+`. */
78
+ const e164NoPlus = {
79
+ id: "e164NoPlus",
80
+ apply: (value, params, env) => e164.apply(value, params, env).replace(/^\+/, "")
81
+ };
82
+ //#endregion
83
+ //#region src/internal/forms/rules/nationalNumber.ts
84
+ /**
85
+ * `nationalNumber`: the phone's national significant number, without the
86
+ * calling code or a trunk 0. While the phone rules aren't loaded, or the
87
+ * number can't be read, it stays as typed.
88
+ */
89
+ const nationalNumber = {
90
+ id: "nationalNumber",
91
+ apply: (value, _params, env) => env.deps.phone?.nationalNumber(value, env.country) ?? value
92
+ };
93
+ //#endregion
94
+ //#region src/internal/forms/rules/stripSeparators.ts
95
+ /**
96
+ * `stripSeparators`: removes spaces, `-`, `.` and `/`, or the characters in
97
+ * `chars`. "Spaces" means any whitespace, as eKYC's input format reads it.
98
+ */
99
+ const stripSeparators = {
100
+ id: "stripSeparators",
101
+ apply: (value, params) => {
102
+ if (typeof params.chars !== "string") return value.replace(/[\s./-]/g, "");
103
+ const remove = new Set(params.chars);
104
+ return [...value].filter((char) => !remove.has(char)).join("");
105
+ }
106
+ };
107
+ //#endregion
108
+ //#region src/internal/forms/rules/uppercase.ts
109
+ /** `uppercase`: converts letters to uppercase, over Unicode code points. */
110
+ const uppercase = {
111
+ id: "uppercase",
112
+ apply: (value) => value.toUpperCase()
113
+ };
114
+ //#endregion
115
+ export { digitGroups as a, e164NoPlus as i, stripSeparators as n, createBundledDefinitionSource as o, nationalNumber as r, matchesCharTemplate as s, uppercase as t };
@@ -1,16 +1,16 @@
1
- import { t as ensureWasmPipelines } from "./setup-DXnJ1L0L.esm.js";
1
+ import { t as ensureWasmPipelines } from "./setup-JGwc0kgu.esm.js";
2
2
  import { t as WasmUtilProvider } from "./WasmUtilProvider-unrmGEHD.esm.js";
3
3
  import { t as api, u as endpoints } from "./api-CsXnB7m6.esm.js";
4
4
  import { t as BrowserTimerProvider } from "./BrowserTimerProvider-BXhgNxLt.esm.js";
5
5
  import { t as BrowserLazyImportProvider } from "./BrowserLazyImportProvider-BhoA957O.esm.js";
6
- import { b as videoSelfieWasmPipelines, v as facingModeForStep, y as resolveVideoSelfieSteps } from "./flowServices-DO_evfcT.esm.js";
6
+ import { b as videoSelfieWasmPipelines, v as facingModeForStep, y as resolveVideoSelfieSteps } from "./flowServices-3OXrEqDE.esm.js";
7
7
  import { t as createManager } from "./Manager-BvXAwDv9.esm.js";
8
8
  import { i as assign, l as raise, r as sendTo, s as createActor, t as setup } from "./xstate.esm-CIqUf_i6.esm.js";
9
9
  import { n as fromPromise, t as fromCallback } from "./xstate-actors.esm-BCcwgosu.esm.js";
10
10
  import { t as BrowserVisibilityObserverProvider } from "./BrowserVisibilityObserverProvider-BrJN1B8A.esm.js";
11
11
  import { t as carryAttempts } from "./attemptCarry-8gUYc3pL.esm.js";
12
12
  import { t as VIDEO_SELFIE_VALIDATION_ATTEMPTS_EXHAUSTED_CODE } from "./advanceableErrors-CxZyPRyh.esm.js";
13
- import { c as VIDEO_SELFIE_MICROPHONE_UNAVAILABLE_CODE, l as isConnectionError, n as defaultAcquireCamera, r as createDefaultStepDetector, s as MicrophoneUnavailableError, t as createVideoSelfieCameraWarmer } from "./videoSelfieCameraWarmer-CPrXznbc.esm.js";
13
+ import { c as VIDEO_SELFIE_MICROPHONE_UNAVAILABLE_CODE, l as isConnectionError, n as defaultAcquireCamera, r as createDefaultStepDetector, s as MicrophoneUnavailableError, t as createVideoSelfieCameraWarmer } from "./videoSelfieCameraWarmer-AoMytGBD.esm.js";
14
14
  import { r as createRecordingCompositor } from "./CameraCompositor-C7N1N61V.esm.js";
15
15
  import { t as WorkerEncoderRecordingProvider } from "./WorkerEncoderRecordingProvider-BO7urYwT.esm.js";
16
16
  import { t as MultipartRecordingService } from "./multipartRecordingService-C8v02l56.esm.js";
@@ -1,13 +1,13 @@
1
1
  import { t as api, u as endpoints } from "./api-CsXnB7m6.esm.js";
2
2
  import { t as BrowserTimerProvider } from "./BrowserTimerProvider-BXhgNxLt.esm.js";
3
- import { v as facingModeForStep, y as resolveVideoSelfieSteps } from "./flowServices-DO_evfcT.esm.js";
3
+ import { v as facingModeForStep, y as resolveVideoSelfieSteps } from "./flowServices-3OXrEqDE.esm.js";
4
4
  import { i as requestCameraWithFallback, r as requestCameraAccess } from "./camera-CJKApt0x.esm.js";
5
5
  import { n as checkPermission } from "./permissionServices-GQyOY1tb.esm.js";
6
6
  import { n as getWindowDimensions } from "./getDeviceClass-CeBiEayS.esm.js";
7
- import { c as uploadSelfie, n as encryptSelfieImage, o as startDetection, s as processFace, t as FaceDetectionProvider, u as FACE_ERROR_CODES } from "./FaceDetectionProvider-DH7QsBFD.esm.js";
7
+ import { c as uploadSelfie, n as encryptSelfieImage, o as startDetection, s as processFace, t as FaceDetectionProvider, u as FACE_ERROR_CODES } from "./FaceDetectionProvider-DQYbHLxC.esm.js";
8
8
  import { t as StreamCanvasProcessingSession } from "./StreamCanvasProcessingSession-CBnbTnOr.esm.js";
9
9
  import { n as getBackCameraStream } from "./backCameraStream-6qVHvj76.esm.js";
10
- import { t as getFaceErrorCodeFromUnknown } from "./selfieErrorUtils-DR2Gve4F.esm.js";
10
+ import { t as getFaceErrorCodeFromUnknown } from "./selfieErrorUtils-DIVWh0ih.esm.js";
11
11
  import { n as DEFAULT_ID_CAPTURE_THRESHOLDS, r as IdCaptureProvider, t as DEFAULT_ID_CAPTURE_GEOMETRY } from "./idCaptureDefaults-CFyXIRuM.esm.js";
12
12
  import { t as StreamCanvasCapture } from "./StreamCanvasCapture-CXd87trH.esm.js";
13
13
  //#region src/modules/video-selfie/videoSelfieCompareService.ts
package/dist/wasm.esm.js CHANGED
@@ -1,6 +1,6 @@
1
1
  import { D as WASM_PIPELINE_LAZY_MODEL_NAMES, E as WASM_MODEL_FILES, S as buildWasmConfigFromBasePath, T as resolveWasmConfig, b as DEFAULT_WASM_VERSION, k as WASM_PIPELINE_MODEL_NAMES, x as buildDefaultWasmConfig } from "./wasmWebClient-BIML49JC.esm.js";
2
2
  import { s as warmupWasm } from "./warmup-O3rAoe1-.esm.js";
3
- import { a as resolveWasmConfigForPipelines, c as upgradeToWasmHttpClient, n as initializeWasmUtil, o as setWasmConfig, t as ensureWasmPipelines } from "./setup-DXnJ1L0L.esm.js";
3
+ import { a as resolveWasmConfigForPipelines, c as upgradeToWasmHttpClient, n as initializeWasmUtil, o as setWasmConfig, t as ensureWasmPipelines } from "./setup-JGwc0kgu.esm.js";
4
4
  //#region src/defineWasm.ts
5
5
  function requiredModels(pipelines) {
6
6
  const models = /* @__PURE__ */ new Set();
@@ -365,6 +365,10 @@ declare const workflowMachine: StateMachine<WorkflowContext, {
365
365
  id: string | undefined;
366
366
  };
367
367
  }>, Values<{
368
+ setError: {
369
+ type: "setError";
370
+ params: NonReducibleUnknown;
371
+ };
368
372
  setLoadingResult: {
369
373
  type: "setLoadingResult";
370
374
  params: NonReducibleUnknown;
@@ -397,10 +401,6 @@ declare const workflowMachine: StateMachine<WorkflowContext, {
397
401
  type: "setFinishStatusFailed";
398
402
  params: NonReducibleUnknown;
399
403
  };
400
- setError: {
401
- type: "setError";
402
- params: NonReducibleUnknown;
403
- };
404
404
  setModuleError: {
405
405
  type: "setModuleError";
406
406
  params: NonReducibleUnknown;
@@ -1,34 +1,34 @@
1
1
  import { n as eventModuleNames, v as addEvent } from "./types-DLsivQsu.esm.js";
2
2
  import { t as api, u as endpoints } from "./api-CsXnB7m6.esm.js";
3
3
  import { t as createManagerInstrumentation } from "./events-Dlkhhx5O.esm.js";
4
- import { u as trueSightLog } from "./trueSightService-MNEZaA-i.esm.js";
5
- import "./trueSight-CjUsM1U4.esm.js";
6
- import { i as initializeSession, r as getSessionFingerprintResult } from "./sessionInitializer-NEJvsqjQ.esm.js";
7
- import { E as updateFeatureManagementUser } from "./feature-management-BVxb2LDw.esm.js";
4
+ import { u as trueSightLog } from "./trueSightService-Dx8AqgKD.esm.js";
5
+ import "./trueSight-9VsfHXFt.esm.js";
6
+ import { i as initializeSession, r as getSessionFingerprintResult } from "./sessionInitializer-q5b8Qwr3.esm.js";
7
+ import { E as updateFeatureManagementUser } from "./feature-management-D_T-MG_i.esm.js";
8
8
  import { i as retryAfterReconnect } from "./connectivity-BCuEoQ-n.esm.js";
9
- import { i as toIncodeApiError } from "./apiError-BVYipHwI.esm.js";
9
+ import { i as toIncodeApiError } from "./apiError-BRiJu_rv.esm.js";
10
10
  import { t as createManager } from "./Manager-BvXAwDv9.esm.js";
11
11
  import { i as assign, s as createActor, t as setup } from "./xstate.esm-CIqUf_i6.esm.js";
12
12
  import { n as fromPromise } from "./xstate-actors.esm-BCcwgosu.esm.js";
13
- import { r as electronicSignatureMachine } from "./electronicSignatureManager-BMalzzyT.esm.js";
13
+ import { r as electronicSignatureMachine } from "./electronicSignatureManager-C6liTNbu.esm.js";
14
14
  import "./ae-signature.esm.js";
15
15
  import { t as antifraudMachine } from "./antifraudStateMachine-C_d7-TUA.esm.js";
16
- import { t as authenticationMachine } from "./authenticationStateMachine-DCVCf6tZ.esm.js";
16
+ import { t as authenticationMachine } from "./authenticationStateMachine-DLwEyCeH.esm.js";
17
17
  import { t as certificateIssuanceMachine } from "./certificateIssuanceStateMachine-CBNw9Niu.esm.js";
18
18
  import { t as consentMachine } from "./consentStateMachine-Cb7dKk_1.esm.js";
19
19
  import { t as curpValidationMachine } from "./curpValidationStateMachine-DaSzh9OA.esm.js";
20
20
  import { t as customWatchlistMachine } from "./customWatchlistStateMachine-DvwFHjkC.esm.js";
21
21
  import { t as documentCaptureMachine } from "./documentCaptureStateMachine-C_HQH7vA.esm.js";
22
- import { r as documentSignatureMachine } from "./documentSignatureStateMachine-C1CsjsVW.esm.js";
23
- import { t as dynamicFormsMachine } from "./dynamicFormsStateMachine-CDyk9sXA.esm.js";
22
+ import { r as documentSignatureMachine } from "./documentSignatureStateMachine-Btlg3q7j.esm.js";
23
+ import { t as dynamicFormsMachine } from "./dynamicFormsStateMachine-Dxv36mAP.esm.js";
24
24
  import { s as toEkybConfig } from "./ekybUtils-CX-dR5p9.esm.js";
25
- import { t as ekybMachine } from "./ekybStateMachine-BVQ7DyO1.esm.js";
26
- import { t as ekycPrefillMachine } from "./ekycPrefillStateMachine-bz_k9jTV.esm.js";
27
- import { d as toEkycConfig } from "./ekycUtils-BnTyeA-_.esm.js";
28
- import { t as ekycMachine } from "./ekycStateMachine-BudF0QZu.esm.js";
25
+ import { t as ekybMachine } from "./ekybStateMachine-CCjUH0j3.esm.js";
26
+ import { t as ekycPrefillMachine } from "./ekycPrefillStateMachine-DiQifkkd.esm.js";
27
+ import { d as toEkycConfig } from "./ekycUtils-DfBNTcvX.esm.js";
28
+ import { t as ekycMachine } from "./ekycStateMachine-BmMdLe2G.esm.js";
29
29
  import { t as emailMachine } from "./emailStateMachine-BzWHKLtW.esm.js";
30
- import { t as selfieMachine } from "./selfieStateMachine-DM40H79_.esm.js";
31
- import { t as idCaptureMachine } from "./idCaptureStateMachine-Cbg0iyXR.esm.js";
30
+ import { t as selfieMachine } from "./selfieStateMachine-fyNh2r31.esm.js";
31
+ import { t as idCaptureMachine } from "./idCaptureStateMachine-FP4j-qeT.esm.js";
32
32
  import { t as phoneMachine } from "./phoneStateMachine-B4W4CSqf.esm.js";
33
33
  import { t as watchlistMachine } from "./watchlistStateMachine-BnKGh6Kk.esm.js";
34
34
  import { n as watchlistForBusinessMachine } from "./watchlistForBusinessStateMachine-Dr85bA22.esm.js";
@@ -37,13 +37,13 @@ import { t as mandatoryConsentMachine } from "./mandatoryConsentStateMachine-BtE
37
37
  import { t as idOcrStateMachine } from "./idOcrStateMachine-DANDVn-6.esm.js";
38
38
  import { n as redirectToMobileMachine } from "./redirectToMobileStateMachine-D1wp--wG.esm.js";
39
39
  import { t as signatureMachine } from "./signatureStateMachine-CkES2vVv.esm.js";
40
- import { t as geolocationMachine } from "./geolocationStateMachine-C2r0HXYO.esm.js";
40
+ import { t as geolocationMachine } from "./geolocationStateMachine-D9_bBr19.esm.js";
41
41
  import { t as governmentValidationMachine } from "./governmentValidationStateMachine-BuW6l3ah.esm.js";
42
42
  import { t as idVerificationMachine } from "./idVerificationStateMachine-MjQmD3yQ.esm.js";
43
43
  import { t as faceMatchMachine } from "./faceMatchStateMachine-BItwQ_yA.esm.js";
44
- import { t as kybChecksMachine } from "./kybChecksStateMachine-UIwv8ipY.esm.js";
45
- import { n as getFinishStatus, r as getTotalScoreStatus } from "./flowCompletionService-DK-fZm71.esm.js";
46
- import { n as attachFlowEventEmitter, t as runChildModule } from "./runChildModule-Dgi34yo9.esm.js";
44
+ import { t as kybChecksMachine } from "./kybChecksStateMachine-D1q4K7Xr.esm.js";
45
+ import { n as getFinishStatus, r as getTotalScoreStatus } from "./flowCompletionService-L0J63ui-.esm.js";
46
+ import { n as attachFlowEventEmitter, t as runChildModule } from "./runChildModule-BuZFd3Df.esm.js";
47
47
  import { n as isAdvanceableError } from "./advanceableErrors-CxZyPRyh.esm.js";
48
48
  import "./qe-signature.esm.js";
49
49
  import { t as trustGraphMachine } from "./trustGraphStateMachine-fuYq0Cxf.esm.js";
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@incodetech/core",
3
- "version": "0.0.0-dev-20261201-5456180d",
3
+ "version": "0.0.0-dev-20261201-e37652f8",
4
4
  "license": "ISC",
5
5
  "repository": {
6
6
  "type": "git",
@@ -1,30 +0,0 @@
1
- //#region src/internal/forms/checks/charTemplate.ts
2
- const escapeForPattern = (chars) => chars.replace(/[.*+?^${}()|[\]\\]/g, "\\$&");
3
- /**
4
- * `charTemplate`: the whole value matches one template, where `9` is a digit,
5
- * `A` an uppercase letter A-Z and any other character stands for itself.
6
- * `ignoreCase` also accepts lowercase letters and literals in either case.
7
- */
8
- function matchesCharTemplate(value, templates, ignoreCase = false) {
9
- return templates.some((template) => {
10
- const pattern = [...template].map((char) => {
11
- if (char === "9") return "[0-9]";
12
- if (char === "A") return "[A-Z]";
13
- return escapeForPattern(char);
14
- }).join("");
15
- return new RegExp(`^${pattern}$`, ignoreCase ? "iu" : "u").test(value);
16
- });
17
- }
18
- //#endregion
19
- //#region src/internal/forms/definitionSource.ts
20
- const queryKey = ({ module, source, country }) => `${module}|${source ?? ""}|${country ?? ""}`;
21
- /**
22
- * The definitions bundled with this build. Matches module, source and country
23
- * exactly, so a pair without its own definition keeps the current builder.
24
- */
25
- function createBundledDefinitionSource(definitions) {
26
- const byQuery = new Map(Object.values(definitions).map((definition) => [queryKey(definition), definition]));
27
- return { select: (query) => byQuery.get(queryKey(query)) };
28
- }
29
- //#endregion
30
- export { matchesCharTemplate as n, createBundledDefinitionSource as t };