@incodetech/core 2.0.0-alpha.8 → 2.0.0-rc.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (184) hide show
  1. package/dist/Actor-CI32dTbG.d.ts +2 -0
  2. package/dist/BaseWasmProvider-C_DLEI40.esm.js +1118 -0
  3. package/dist/BrowserStorageProvider-CuOW1Er2.esm.js +55 -0
  4. package/dist/BrowserTimerProvider-DhNc_x02.esm.js +22 -0
  5. package/dist/ITimerCapability-C67ZRskg.esm.js +7 -0
  6. package/dist/IpifyProvider-D7jx52AL.esm.js +139 -0
  7. package/dist/MotionSensorProvider-4v7xkqAp.esm.js +254 -0
  8. package/dist/OpenViduRecordingProvider-CMu6XVdc.esm.js +87 -0
  9. package/dist/StateMachine-BCQrZJhf.d.ts +2 -0
  10. package/dist/WasmUtilProvider-j98OJf-S.esm.js +114 -0
  11. package/dist/addressSearch-BpTbTWCa.esm.js +430 -0
  12. package/dist/ae-signature-DDDZmWXj.esm.js +12 -0
  13. package/dist/ae-signature.d.ts +25 -0
  14. package/dist/ae-signature.esm.js +8 -0
  15. package/dist/antifraud.d.ts +57 -0
  16. package/dist/antifraud.esm.js +45 -0
  17. package/dist/antifraudStateMachine-O0TMf6yc.esm.js +39 -0
  18. package/dist/api-CESGtpbH.esm.js +53 -0
  19. package/dist/authentication.d.ts +12 -0
  20. package/dist/authentication.esm.js +25 -0
  21. package/dist/authenticationManager-5M-fKzXx.esm.js +67 -0
  22. package/dist/authenticationManager-C83GNIhl.d.ts +66 -0
  23. package/dist/authenticationStateMachine-BMZqatiF.esm.js +139 -0
  24. package/dist/backCameraStream-DMdMeGk2.esm.js +346 -0
  25. package/dist/browserSimulation-gxD8cSpM.esm.js +20 -0
  26. package/dist/camera-DBSxa6ML.d.ts +4 -0
  27. package/dist/camera-PA2Ljri3.esm.js +22 -0
  28. package/dist/camera.d.ts +15 -0
  29. package/dist/camera.esm.js +5 -0
  30. package/dist/consent.d.ts +398 -0
  31. package/dist/consent.esm.js +79 -0
  32. package/dist/consentStateMachine-CCT-B60O.esm.js +151 -0
  33. package/dist/cpf-PPz2Njto.esm.js +38 -0
  34. package/dist/cpf-ocr.d.ts +204 -0
  35. package/dist/cpf-ocr.esm.js +177 -0
  36. package/dist/cross-document-data-match.d.ts +34 -0
  37. package/dist/cross-document-data-match.esm.js +71 -0
  38. package/dist/curp-validation.d.ts +188 -0
  39. package/dist/curp-validation.esm.js +110 -0
  40. package/dist/curpValidationStateMachine-CitWLr2c.esm.js +595 -0
  41. package/dist/custom-fields.d.ts +115 -0
  42. package/dist/custom-fields.esm.js +177 -0
  43. package/dist/custom-watchlist.d.ts +66 -0
  44. package/dist/custom-watchlist.esm.js +86 -0
  45. package/dist/dateUtils-UoN5xswP.esm.js +23 -0
  46. package/dist/deepsightLoader-Cm4JIT_z.esm.js +52 -0
  47. package/dist/deepsightService-CEVxzehb.d.ts +412 -0
  48. package/dist/deepsightService-O74l4Y__.esm.js +489 -0
  49. package/dist/device.d.ts +46 -0
  50. package/dist/device.esm.js +106 -0
  51. package/dist/displayErrors-DqJ_IbsG.d.ts +39 -0
  52. package/dist/document-capture.d.ts +906 -0
  53. package/dist/document-capture.esm.js +156 -0
  54. package/dist/document-upload.d.ts +331 -0
  55. package/dist/document-upload.esm.js +203 -0
  56. package/dist/documentCaptureStateMachine-BqzTDy9k.esm.js +394 -0
  57. package/dist/dynamic-forms.d.ts +178 -0
  58. package/dist/dynamic-forms.esm.js +323 -0
  59. package/dist/ekyb.d.ts +148 -0
  60. package/dist/ekyb.esm.js +127 -0
  61. package/dist/ekybStateMachine-B59rQjgj.esm.js +674 -0
  62. package/dist/ekyc.d.ts +164 -0
  63. package/dist/ekyc.esm.js +104 -0
  64. package/dist/ekycStateMachine-oeO0Iekd.esm.js +10626 -0
  65. package/dist/electronic-signature.d.ts +4 -0
  66. package/dist/electronic-signature.esm.js +7 -0
  67. package/dist/electronicSignatureManager-D9OHzTpG.esm.js +428 -0
  68. package/dist/email.d.ts +3 -263
  69. package/dist/email.esm.js +7 -477
  70. package/dist/emailManager-DIfnS5g1.d.ts +352 -0
  71. package/dist/emailManager-wAV0LE-H.esm.js +238 -0
  72. package/dist/emailStateMachine-DOf4j58N.esm.js +292 -0
  73. package/dist/endpoints-CnN3SyDa.esm.js +87 -0
  74. package/dist/events-D6-e4vok.esm.js +596 -0
  75. package/dist/events.d.ts +265 -0
  76. package/dist/events.esm.js +4 -0
  77. package/dist/extensibility.d.ts +122 -0
  78. package/dist/extensibility.esm.js +43 -0
  79. package/dist/face-match.d.ts +228 -0
  80. package/dist/face-match.esm.js +173 -0
  81. package/dist/faceCaptureManagerFactory-Dh2PdGlF.esm.js +290 -0
  82. package/dist/faceCaptureManagerFactory-yqtpxjnN.d.ts +690 -0
  83. package/dist/faceCaptureSetup-B3faSpYA.esm.js +873 -0
  84. package/dist/faceMatchStateMachine-DNFrxTFS.esm.js +127 -0
  85. package/dist/flow-events.d.ts +6 -0
  86. package/dist/flow-events.esm.js +0 -0
  87. package/dist/flow.d.ts +101 -321
  88. package/dist/flow.esm.js +370 -173
  89. package/dist/flowCompletionService-DhkT4SRY.d.ts +10 -0
  90. package/dist/flowCompletionService-P54yzGvA.esm.js +13 -0
  91. package/dist/flowServices-DTsm-Vf1.esm.js +188 -0
  92. package/dist/geolocation.d.ts +127 -0
  93. package/dist/geolocation.esm.js +89 -0
  94. package/dist/geolocationStateMachine-asasuHY2.esm.js +105 -0
  95. package/dist/getBrowser-BSXUTWXw.esm.js +41 -0
  96. package/dist/getDeviceClass-BSntT9_j.esm.js +14 -0
  97. package/dist/government-validation.d.ts +67 -0
  98. package/dist/government-validation.esm.js +81 -0
  99. package/dist/governmentValidationStateMachine-BDDYrJTo.esm.js +271 -0
  100. package/dist/home.d.ts +99 -0
  101. package/dist/home.esm.js +61 -0
  102. package/dist/http.d.ts +68 -0
  103. package/dist/http.esm.js +3 -0
  104. package/dist/id-ocr.d.ts +635 -0
  105. package/dist/id-ocr.esm.js +86 -0
  106. package/dist/id-verification.d.ts +190 -0
  107. package/dist/id-verification.esm.js +43 -0
  108. package/dist/id.d.ts +24 -0
  109. package/dist/id.esm.js +164 -0
  110. package/dist/idCaptureManager-B9TGA5dq.d.ts +956 -0
  111. package/dist/idCaptureManager-DMK0GIt3.esm.js +581 -0
  112. package/dist/idCaptureStateMachine-Bq0fVZXl.esm.js +2954 -0
  113. package/dist/idOcrStateMachine-YbjjC_Gg.esm.js +388 -0
  114. package/dist/idVerificationStateMachine-xbw9HP1Z.esm.js +71 -0
  115. package/dist/identity-reuse.d.ts +530 -0
  116. package/dist/identity-reuse.esm.js +274 -0
  117. package/dist/index-BLKtMA0g.d.ts +1177 -0
  118. package/dist/index-BcRG8rtJ.d.ts +97 -0
  119. package/dist/index.d.ts +3 -226
  120. package/dist/index.esm.js +11 -154
  121. package/dist/invokeOnCaptureCallback-rc6kBHo5.esm.js +30 -0
  122. package/dist/{lib-Bu9XGMBW.esm.js → lib-BB0B_qQX.esm.js} +801 -2
  123. package/dist/mandatory-consent.d.ts +412 -0
  124. package/dist/mandatory-consent.esm.js +78 -0
  125. package/dist/mandatoryConsentStateMachine-Cnco1jvn.esm.js +126 -0
  126. package/dist/openviduLazy-Cm0XFh_v.esm.js +3 -0
  127. package/dist/openviduLazy-Cok70ZSg.esm.js +12 -0
  128. package/dist/permissionServices-D_i6nzEw.esm.js +50 -0
  129. package/dist/phone.d.ts +3 -291
  130. package/dist/phone.esm.js +7 -548
  131. package/dist/phoneManager-B6M30hKE.d.ts +397 -0
  132. package/dist/phoneManager-DAJbGhlY.esm.js +256 -0
  133. package/dist/phoneStateMachine-CuPARRaT.esm.js +351 -0
  134. package/dist/platform-CfrjKhmi.esm.js +83 -0
  135. package/dist/qe-signature-DFo_Cc-I.esm.js +12 -0
  136. package/dist/qe-signature.d.ts +25 -0
  137. package/dist/qe-signature.esm.js +8 -0
  138. package/dist/recordingService-Ig2UgbLv.esm.js +1003 -0
  139. package/dist/redirect-to-mobile.d.ts +107 -0
  140. package/dist/redirect-to-mobile.esm.js +102 -0
  141. package/dist/redirectToMobileStateMachine-BOEqe46A.esm.js +249 -0
  142. package/dist/runChildModule-CqqwqAkW.esm.js +219 -0
  143. package/dist/selfie.d.ts +21 -754
  144. package/dist/selfie.esm.js +113 -962
  145. package/dist/selfieManager-D0lSgd-J.d.ts +68 -0
  146. package/dist/selfieManager-Duisl7qN.esm.js +60 -0
  147. package/dist/selfieStateMachine-D76whWEf.esm.js +68 -0
  148. package/dist/session-BS-d_vuE.esm.js +3206 -0
  149. package/dist/session.d.ts +217 -0
  150. package/dist/session.esm.js +9 -0
  151. package/dist/setup-Buy-hyj4.esm.js +887 -0
  152. package/dist/setup-C5AITV8m.d.ts +254 -0
  153. package/dist/signature.d.ts +94 -0
  154. package/dist/signature.esm.js +66 -0
  155. package/dist/signatureStateMachine-B5-QVUve.esm.js +132 -0
  156. package/dist/stats-CIfiPzb1.esm.js +16 -0
  157. package/dist/stats.d.ts +16 -0
  158. package/dist/stats.esm.js +4 -0
  159. package/dist/trust-graph.d.ts +54 -0
  160. package/dist/trust-graph.esm.js +56 -0
  161. package/dist/types-B06Ypu2F.d.ts +49 -0
  162. package/dist/types-BP1m8VRw.d.ts +340 -0
  163. package/dist/types-CFV9G_7j.d.ts +24 -0
  164. package/dist/{warmup-CEJTfxQr.d.ts → warmup-CEcppFiS.d.ts} +11 -3
  165. package/dist/wasm.d.ts +15 -0
  166. package/dist/wasm.esm.js +12 -0
  167. package/dist/watchlist-for-business.d.ts +79 -0
  168. package/dist/watchlist-for-business.esm.js +148 -0
  169. package/dist/watchlist.d.ts +62 -0
  170. package/dist/watchlist.esm.js +86 -0
  171. package/dist/watchlistServices-DMbUhkBX.esm.js +12 -0
  172. package/dist/workflow.d.ts +907 -0
  173. package/dist/workflow.esm.js +702 -0
  174. package/dist/{xstate.esm-B_rda9yU.esm.js → xstate.esm-B70JrNqo.esm.js} +144 -1
  175. package/package.json +203 -6
  176. package/dist/OpenViduLogger-BdPfiZO6.esm.js +0 -3
  177. package/dist/OpenViduLogger-CQyDxBvM.esm.js +0 -803
  178. package/dist/StateMachine-DRE1oH2B.d.ts +0 -2
  179. package/dist/addEvent-W0ORK0jT.esm.js +0 -16
  180. package/dist/endpoints-BSTFaHYo.esm.js +0 -1706
  181. package/dist/permissionServices-I6vX6DBy.esm.js +0 -72
  182. /package/dist/{Manager-BGfxEmyv.d.ts → Manager-C8PrhBOx.d.ts} +0 -0
  183. /package/dist/{chunk-C_Yo44FK.esm.js → chunk-CRF6K_H_.esm.js} +0 -0
  184. /package/dist/{types-iZi2rawo.d.ts → types-CAD4va6a.d.ts} +0 -0
@@ -0,0 +1,115 @@
1
+ import { t as Manager } from "./Manager-C8PrhBOx.js";
2
+ import "./Actor-CI32dTbG.js";
3
+
4
+ //#region src/modules/custom-fields/types.d.ts
5
+ type CustomFieldType = 'INTEGER' | 'DOUBLE' | 'BOOLEAN' | 'STRING' | 'DATE';
6
+ type CustomField = {
7
+ name: string;
8
+ alias: string;
9
+ type: CustomFieldType;
10
+ };
11
+ type CustomFieldsConfig = {
12
+ title: string;
13
+ customFields: CustomField[];
14
+ };
15
+ //#endregion
16
+ //#region src/modules/custom-fields/customFieldsStateMachine.d.ts
17
+ type CustomFieldsResult = 'success' | 'failed';
18
+ declare const customFieldsMachine: any;
19
+ //#endregion
20
+ //#region src/modules/custom-fields/customFieldsActor.d.ts
21
+ type CreateCustomFieldsActorOptions = {
22
+ config: CustomFieldsConfig;
23
+ };
24
+ //#endregion
25
+ //#region src/modules/custom-fields/customFieldsManager.d.ts
26
+ /**
27
+ * A `CustomField` enriched with a computed `label` for display.
28
+ * Label is derived from `alias` when present, otherwise auto-formatted from `name`.
29
+ */
30
+ type MappedCustomField = CustomField & {
31
+ label: string;
32
+ };
33
+ /** Custom fields manager is in initial state, waiting for `load()` to be called */
34
+ type CustomFieldsIdleState = {
35
+ status: 'idle';
36
+ };
37
+ /**
38
+ * Ready for field input — use `setField()` and `submit()`
39
+ * @property title - Form title from configuration
40
+ * @property customFields - Field definitions with computed display labels
41
+ * @property canSubmit - True when all non-boolean fields have a non-empty value
42
+ */
43
+ type CustomFieldsInputtingState = {
44
+ status: 'inputting';
45
+ title: string;
46
+ customFields: MappedCustomField[];
47
+ canSubmit: boolean;
48
+ };
49
+ /** Fields are being submitted to the backend */
50
+ type CustomFieldsSubmittingState = {
51
+ status: 'submitting';
52
+ title: string;
53
+ };
54
+ /** API call succeeded — success page is visible for ~3 s before finishing */
55
+ type CustomFieldsSuccessState = {
56
+ status: 'success';
57
+ };
58
+ /** Custom fields flow complete. `result` indicates whether the API call succeeded or failed. */
59
+ type CustomFieldsFinishedState = {
60
+ status: 'finished';
61
+ result: CustomFieldsResult | null;
62
+ };
63
+ /**
64
+ * Union of all possible custom fields manager states.
65
+ */
66
+ type CustomFieldsState = CustomFieldsIdleState | CustomFieldsInputtingState | CustomFieldsSubmittingState | CustomFieldsSuccessState | CustomFieldsFinishedState;
67
+ /**
68
+ * Creates a custom fields manager for headless or UI-driven usage.
69
+ *
70
+ * @param options - Configuration options
71
+ * @param options.config - Custom fields configuration (title + field definitions)
72
+ *
73
+ * @returns Custom fields manager with state, API methods, and subscription
74
+ *
75
+ * @example Headless usage
76
+ * ```typescript
77
+ * const manager = createCustomFieldsManager({
78
+ * config: {
79
+ * title: 'Additional Information',
80
+ * customFields: [{ name: 'company', alias: 'Company', type: 'STRING' }],
81
+ * },
82
+ * });
83
+ *
84
+ * manager.subscribe((state) => console.log(state.status));
85
+ * manager.load();
86
+ * manager.setField('company', 'Incode');
87
+ * manager.submit();
88
+ * manager.stop();
89
+ * ```
90
+ */
91
+ declare function createCustomFieldsManager(options: CreateCustomFieldsActorOptions): Manager<CustomFieldsState> & {
92
+ /**
93
+ * Initializes the custom fields flow.
94
+ * Transitions from 'idle' to 'inputting'.
95
+ * Must be called before any other method.
96
+ */
97
+ load(): void;
98
+ /**
99
+ * Updates the value of a single field.
100
+ * Should be called when state is 'inputting'.
101
+ *
102
+ * @param name - The field name (matches CustomField.name)
103
+ * @param value - The field value (string, number, or boolean)
104
+ */
105
+ setField(name: string, value: string | number | boolean): void;
106
+ /**
107
+ * Submits all custom field values to the backend.
108
+ * Transitions to 'submitting', then 'finished' regardless of outcome.
109
+ */
110
+ submit(): void;
111
+ };
112
+ /** Type representing a custom fields manager instance. */
113
+ type CustomFieldsManager = ReturnType<typeof createCustomFieldsManager>;
114
+ //#endregion
115
+ export { type CustomField, type CustomFieldType, type CustomFieldsConfig, type CustomFieldsManager, type CustomFieldsState, type MappedCustomField, createCustomFieldsManager, customFieldsMachine };
@@ -0,0 +1,177 @@
1
+ import { t as api } from "./api-CESGtpbH.esm.js";
2
+ import { n as eventModuleNames, o as createManagerInstrumentation } from "./events-D6-e4vok.esm.js";
3
+ import { t as endpoints } from "./endpoints-CnN3SyDa.esm.js";
4
+ import { a as fromPromise, c as createManager, r as assign, s as createActor, t as setup } from "./xstate.esm-B70JrNqo.esm.js";
5
+ import { t as isoDateToMs } from "./dateUtils-UoN5xswP.esm.js";
6
+
7
+ //#region src/modules/custom-fields/customFieldsServices.ts
8
+ async function submitCustomFields(params, signal) {
9
+ const res = await api.post(endpoints.addCustomFields, params.fields, { signal });
10
+ if (!res.ok) throw new Error(`POST ${endpoints.addCustomFields} failed: ${res.status} ${res.statusText}`);
11
+ return res.data;
12
+ }
13
+
14
+ //#endregion
15
+ //#region src/modules/custom-fields/customFieldsStateMachine.ts
16
+ function transformFields(fields, customFields) {
17
+ const result = {};
18
+ for (const [key, value] of Object.entries(fields)) if (customFields.find((f) => f.name === key)?.type === "DATE" && typeof value === "string" && value !== "") result[key] = isoDateToMs(value);
19
+ else result[key] = value;
20
+ return result;
21
+ }
22
+ const customFieldsMachine = setup({
23
+ types: {
24
+ context: {},
25
+ events: {},
26
+ input: {}
27
+ },
28
+ actors: { submitFields: fromPromise(async ({ input, signal }) => {
29
+ return submitCustomFields({ fields: transformFields(input.fields, input.customFields) }, signal);
30
+ }) },
31
+ actions: {
32
+ setField: assign(({ context, event }) => {
33
+ const e = event;
34
+ return { fields: {
35
+ ...context.fields,
36
+ [e.name]: e.value
37
+ } };
38
+ }),
39
+ markSuccess: assign({ result: "success" }),
40
+ markFailed: assign({ result: "failed" })
41
+ },
42
+ guards: { apiSucceeded: ({ event }) => event.output.success }
43
+ }).createMachine({
44
+ id: "customFields",
45
+ initial: "idle",
46
+ context: ({ input }) => ({
47
+ config: input.config,
48
+ fields: {},
49
+ result: null
50
+ }),
51
+ states: {
52
+ idle: { on: { LOAD: { target: "inputting" } } },
53
+ inputting: { on: {
54
+ FIELD_CHANGED: { actions: "setField" },
55
+ SUBMIT: { target: "submitting" }
56
+ } },
57
+ submitting: { invoke: {
58
+ id: "submitFields",
59
+ src: "submitFields",
60
+ input: ({ context }) => ({
61
+ fields: context.fields,
62
+ customFields: context.config.customFields
63
+ }),
64
+ onDone: [{
65
+ target: "success",
66
+ guard: "apiSucceeded"
67
+ }, {
68
+ target: "finished",
69
+ actions: "markFailed"
70
+ }],
71
+ onError: {
72
+ target: "finished",
73
+ actions: "markFailed"
74
+ }
75
+ } },
76
+ success: { after: { 3e3: {
77
+ target: "finished",
78
+ actions: "markSuccess"
79
+ } } },
80
+ finished: { type: "final" }
81
+ }
82
+ });
83
+
84
+ //#endregion
85
+ //#region src/modules/custom-fields/customFieldsActor.ts
86
+ function createCustomFieldsActor(options) {
87
+ return createActor(customFieldsMachine, { input: { config: options.config } }).start();
88
+ }
89
+
90
+ //#endregion
91
+ //#region src/modules/custom-fields/customFieldsManager.ts
92
+ function toDisplayLabel(field) {
93
+ if (field.alias) return field.alias;
94
+ return field.name.replace(/([A-Z])/g, " $1").replace(/^./, (s) => s.toUpperCase());
95
+ }
96
+ function isFormComplete(fields, customFields) {
97
+ return customFields.every((f) => {
98
+ if (f.type === "BOOLEAN") return true;
99
+ const value = fields[f.name];
100
+ return value !== void 0 && value !== "";
101
+ });
102
+ }
103
+ function mapState(snapshot) {
104
+ const typedSnapshot = snapshot;
105
+ const { context } = typedSnapshot;
106
+ if (typedSnapshot.matches("idle")) return { status: "idle" };
107
+ if (typedSnapshot.matches("inputting")) return {
108
+ status: "inputting",
109
+ title: context.config.title,
110
+ customFields: context.config.customFields.map((f) => ({
111
+ ...f,
112
+ label: toDisplayLabel(f)
113
+ })),
114
+ canSubmit: isFormComplete(context.fields, context.config.customFields)
115
+ };
116
+ if (typedSnapshot.matches("submitting")) return {
117
+ status: "submitting",
118
+ title: context.config.title
119
+ };
120
+ if (typedSnapshot.matches("success")) return { status: "success" };
121
+ return {
122
+ status: "finished",
123
+ result: typedSnapshot.context.result
124
+ };
125
+ }
126
+ function createApi({ actor }) {
127
+ return {
128
+ load() {
129
+ actor.send({ type: "LOAD" });
130
+ },
131
+ setField(name, value) {
132
+ actor.send({
133
+ type: "FIELD_CHANGED",
134
+ name,
135
+ value
136
+ });
137
+ },
138
+ submit() {
139
+ actor.send({ type: "SUBMIT" });
140
+ }
141
+ };
142
+ }
143
+ /**
144
+ * Creates a custom fields manager for headless or UI-driven usage.
145
+ *
146
+ * @param options - Configuration options
147
+ * @param options.config - Custom fields configuration (title + field definitions)
148
+ *
149
+ * @returns Custom fields manager with state, API methods, and subscription
150
+ *
151
+ * @example Headless usage
152
+ * ```typescript
153
+ * const manager = createCustomFieldsManager({
154
+ * config: {
155
+ * title: 'Additional Information',
156
+ * customFields: [{ name: 'company', alias: 'Company', type: 'STRING' }],
157
+ * },
158
+ * });
159
+ *
160
+ * manager.subscribe((state) => console.log(state.status));
161
+ * manager.load();
162
+ * manager.setField('company', 'Incode');
163
+ * manager.submit();
164
+ * manager.stop();
165
+ * ```
166
+ */
167
+ function createCustomFieldsManager(options) {
168
+ return createManager({
169
+ actor: createCustomFieldsActor(options),
170
+ mapState,
171
+ createApi,
172
+ instrumentation: createManagerInstrumentation(eventModuleNames.customFields)
173
+ });
174
+ }
175
+
176
+ //#endregion
177
+ export { createCustomFieldsManager, customFieldsMachine };
@@ -0,0 +1,66 @@
1
+ import { t as Manager } from "./Manager-C8PrhBOx.js";
2
+
3
+ //#region src/modules/custom-watchlist/customWatchlistStateMachine.d.ts
4
+ type CustomWatchlistResult = 'success' | 'skipped';
5
+ declare const customWatchlistMachine: any;
6
+ //#endregion
7
+ //#region src/modules/custom-watchlist/customWatchlistManager.d.ts
8
+ type CustomWatchlistIdleState = {
9
+ status: 'idle';
10
+ };
11
+ type CustomWatchlistProcessingState = {
12
+ status: 'processing';
13
+ };
14
+ type CustomWatchlistSuccessState = {
15
+ status: 'success';
16
+ };
17
+ type CustomWatchlistFinishedState = {
18
+ status: 'finished';
19
+ result: CustomWatchlistResult;
20
+ };
21
+ /**
22
+ * Union of all possible custom watchlist manager states.
23
+ *
24
+ * @example
25
+ * ```typescript
26
+ * const state = customWatchlistManager.getState();
27
+ * if (state.status === 'finished') {
28
+ * console.log('Custom watchlist check complete');
29
+ * }
30
+ * ```
31
+ */
32
+ type CustomWatchlistState = CustomWatchlistIdleState | CustomWatchlistProcessingState | CustomWatchlistSuccessState | CustomWatchlistFinishedState;
33
+ /**
34
+ * Creates a custom watchlist manager for headless or UI-driven usage.
35
+ *
36
+ * @example Headless usage
37
+ * ```typescript
38
+ * const manager = createCustomWatchlistManager();
39
+ * manager.subscribe((state) => console.log(state.status));
40
+ * manager.load();
41
+ * ```
42
+ */
43
+ declare function createCustomWatchlistManager(): Manager<CustomWatchlistState> & {
44
+ /**
45
+ * Kicks off the custom watchlist check.
46
+ * Transitions from 'idle' to 'processing'.
47
+ */
48
+ load(): void;
49
+ };
50
+ type CustomWatchlistManager = ReturnType<typeof createCustomWatchlistManager>;
51
+ //#endregion
52
+ //#region src/modules/custom-watchlist/types.d.ts
53
+ /**
54
+ * Configuration for the custom watchlist module (INCODE_WATCHLIST flow key).
55
+ *
56
+ * These fields are supplied by the backend flow configuration and control
57
+ * backend-side behaviour. They are not forwarded in the API request body —
58
+ * the module is fire-and-forget from the client's perspective.
59
+ */
60
+ type CustomWatchlistConfig = {
61
+ failIfFaceOnBlocklist: boolean;
62
+ addSuspectedFraudAutomatically: boolean;
63
+ autoExecution: boolean;
64
+ };
65
+ //#endregion
66
+ export { type CustomWatchlistConfig, type CustomWatchlistManager, type CustomWatchlistState, createCustomWatchlistManager, customWatchlistMachine };
@@ -0,0 +1,86 @@
1
+ import "./api-CESGtpbH.esm.js";
2
+ import { n as eventModuleNames, o as createManagerInstrumentation } from "./events-D6-e4vok.esm.js";
3
+ import "./endpoints-CnN3SyDa.esm.js";
4
+ import { a as fromPromise, c as createManager, r as assign, s as createActor, t as setup } from "./xstate.esm-B70JrNqo.esm.js";
5
+ import { t as processWatchlist } from "./watchlistServices-DMbUhkBX.esm.js";
6
+
7
+ //#region src/modules/custom-watchlist/customWatchlistStateMachine.ts
8
+ const customWatchlistMachine = setup({
9
+ types: {
10
+ context: {},
11
+ events: {}
12
+ },
13
+ actors: { processWatchlist: fromPromise(async ({ signal }) => {
14
+ await processWatchlist(signal);
15
+ }) },
16
+ actions: {
17
+ markSuccess: assign({ result: "success" }),
18
+ markSkipped: assign({ result: "skipped" })
19
+ }
20
+ }).createMachine({
21
+ id: "customWatchlist",
22
+ initial: "idle",
23
+ context: { result: null },
24
+ states: {
25
+ idle: { on: { LOAD: { target: "processing" } } },
26
+ processing: { invoke: {
27
+ id: "processWatchlist",
28
+ src: "processWatchlist",
29
+ onDone: { target: "success" },
30
+ onError: {
31
+ target: "finished",
32
+ actions: "markSkipped"
33
+ }
34
+ } },
35
+ success: { after: { 3e3: {
36
+ target: "finished",
37
+ actions: "markSuccess"
38
+ } } },
39
+ finished: { type: "final" }
40
+ }
41
+ });
42
+
43
+ //#endregion
44
+ //#region src/modules/custom-watchlist/customWatchlistActor.ts
45
+ function createCustomWatchlistActor() {
46
+ return createActor(customWatchlistMachine).start();
47
+ }
48
+
49
+ //#endregion
50
+ //#region src/modules/custom-watchlist/customWatchlistManager.ts
51
+ function mapState(snapshot) {
52
+ const typedSnapshot = snapshot;
53
+ if (typedSnapshot.matches("processing")) return { status: "processing" };
54
+ if (typedSnapshot.matches("success")) return { status: "success" };
55
+ if (typedSnapshot.matches("finished")) return {
56
+ status: "finished",
57
+ result: typedSnapshot.context.result ?? "skipped"
58
+ };
59
+ return { status: "idle" };
60
+ }
61
+ function createApi({ actor }) {
62
+ return { load() {
63
+ actor.send({ type: "LOAD" });
64
+ } };
65
+ }
66
+ /**
67
+ * Creates a custom watchlist manager for headless or UI-driven usage.
68
+ *
69
+ * @example Headless usage
70
+ * ```typescript
71
+ * const manager = createCustomWatchlistManager();
72
+ * manager.subscribe((state) => console.log(state.status));
73
+ * manager.load();
74
+ * ```
75
+ */
76
+ function createCustomWatchlistManager() {
77
+ return createManager({
78
+ actor: createCustomWatchlistActor(),
79
+ mapState,
80
+ createApi,
81
+ instrumentation: createManagerInstrumentation(eventModuleNames.customWatchList)
82
+ });
83
+ }
84
+
85
+ //#endregion
86
+ export { createCustomWatchlistManager, customWatchlistMachine };
@@ -0,0 +1,23 @@
1
+ //#region src/shared/dateUtils.ts
2
+ /**
3
+ * Converts an ISO date string (YYYY-MM-DD) to Unix milliseconds.
4
+ *
5
+ * Uses Julian Day Number arithmetic so no platform Date API is needed,
6
+ * keeping this utility usable in any environment (browser, Node, workers).
7
+ *
8
+ * @param dateStr - A date string in YYYY-MM-DD format (as produced by HTML date inputs)
9
+ * @returns Milliseconds since the Unix epoch (UTC midnight of the given date)
10
+ */
11
+ function isoDateToMs(dateStr) {
12
+ const [yearStr = "1970", monthStr = "01", dayStr = "01"] = dateStr.split("-");
13
+ const y = +yearStr;
14
+ const m = +monthStr;
15
+ const d = +dayStr;
16
+ const a = Math.floor((14 - m) / 12);
17
+ const ya = y + 4800 - a;
18
+ const ma = m + 12 * a - 3;
19
+ return (d + Math.floor((153 * ma + 2) / 5) + 365 * ya + Math.floor(ya / 4) - Math.floor(ya / 100) + Math.floor(ya / 400) - 32045 - 2440588) * 864e5;
20
+ }
21
+
22
+ //#endregion
23
+ export { isoDateToMs as t };
@@ -0,0 +1,52 @@
1
+ import "./BaseWasmProvider-C_DLEI40.esm.js";
2
+ import { t as WasmUtilProvider } from "./WasmUtilProvider-j98OJf-S.esm.js";
3
+ import "./api-CESGtpbH.esm.js";
4
+ import { r as BrowserEnvironmentProvider, t as IpifyProvider } from "./IpifyProvider-D7jx52AL.esm.js";
5
+ import "./browserSimulation-gxD8cSpM.esm.js";
6
+ import "./camera-PA2Ljri3.esm.js";
7
+ import { t as createDeepsightService } from "./deepsightService-O74l4Y__.esm.js";
8
+ import "./getBrowser-BSXUTWXw.esm.js";
9
+ import "./stats-CIfiPzb1.esm.js";
10
+ import { t as MotionSensorProvider } from "./MotionSensorProvider-4v7xkqAp.esm.js";
11
+
12
+ //#region ../infra/src/providers/browser/VisibilityProvider.ts
13
+ var VisibilityProvider = class {
14
+ constructor() {
15
+ this._wasBackgrounded = false;
16
+ this.visibilityChangeHandler = this.onVisibilityChange.bind(this);
17
+ document.addEventListener("visibilitychange", this.visibilityChangeHandler);
18
+ }
19
+ get wasBackgrounded() {
20
+ return this._wasBackgrounded;
21
+ }
22
+ reset() {
23
+ this._wasBackgrounded = false;
24
+ }
25
+ cleanup() {
26
+ document.removeEventListener("visibilitychange", this.visibilityChangeHandler);
27
+ }
28
+ onVisibilityChange() {
29
+ if (document.hidden) this._wasBackgrounded = true;
30
+ }
31
+ };
32
+
33
+ //#endregion
34
+ //#region src/internal/deepsight/deepsightLoader.ts
35
+ const SDK_VERSION = "2.0.0";
36
+ async function loadDeepsightSession(options) {
37
+ await options.storage.set("ds", options.ds ? 1 : 0);
38
+ const service = createDeepsightService({
39
+ sdkVersion: SDK_VERSION,
40
+ wasmUtil: await WasmUtilProvider.getInstance(),
41
+ visibility: new VisibilityProvider(),
42
+ browserEnv: new BrowserEnvironmentProvider(),
43
+ motionSensor: new MotionSensorProvider(),
44
+ ipLookup: new IpifyProvider()
45
+ });
46
+ await service.initialize(options.disableIpify);
47
+ await service.startMotionSensors();
48
+ return service;
49
+ }
50
+
51
+ //#endregion
52
+ export { loadDeepsightSession };