@incodetech/core 0.0.0-dev-20260407-4677d7f → 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 (109) hide show
  1. package/dist/{BaseWasmProvider-CQgeReKV.esm.js → BaseWasmProvider--AzPfwOm.esm.js} +785 -1
  2. package/dist/{xstate.esm-BXrcOcSC.esm.js → Manager-C6AGXEq_.esm.js} +507 -103
  3. package/dist/{warmup-CEOVQKby.d.ts → StateMachine-CM_aOfNL.d.ts} +4 -1
  4. package/dist/{recordingsRepository-blYn-iKZ.esm.js → StreamCanvasCapture-DkpkIgyL.esm.js} +215 -157
  5. package/dist/{WasmUtilProvider-C45HStLj.esm.js → WasmUtilProvider-BonqBWdj.esm.js} +1 -1
  6. package/dist/{addressSearch-C5qzDvkN.esm.js → addressSearch-B8Fo4v9V.esm.js} +4 -4
  7. package/dist/antifraud.d.ts +1 -1
  8. package/dist/antifraud.esm.js +3 -3
  9. package/dist/authentication.d.ts +9 -11
  10. package/dist/authentication.esm.js +13 -18
  11. package/dist/{authenticationManager-CW4qxgcq.esm.js → authenticationManager-B4gSCgrO.esm.js} +6 -7
  12. package/dist/{authenticationManager-CiXsOTdM.d.ts → authenticationManager-Bd10YGSO.d.ts} +2 -2
  13. package/dist/{backCameraStream-CUo1USCT.esm.js → backCameraStream-DF_d7hTz.esm.js} +2 -2
  14. package/dist/consent.d.ts +52 -52
  15. package/dist/consent.esm.js +3 -3
  16. package/dist/curp-validation.d.ts +5 -5
  17. package/dist/curp-validation.esm.js +3 -3
  18. package/dist/{deepsightLoader-Bs5jHgca.esm.js → deepsightLoader-DKgEdLIS.esm.js} +7 -10
  19. package/dist/{deepsightService-CMAtxAC9.d.ts → deepsightService-Ciu0atv5.d.ts} +197 -193
  20. package/dist/document-capture.d.ts +70 -70
  21. package/dist/document-capture.esm.js +6 -6
  22. package/dist/document-upload.d.ts +4 -4
  23. package/dist/document-upload.esm.js +6 -6
  24. package/dist/ekyb.d.ts +3 -3
  25. package/dist/ekyb.esm.js +9 -9
  26. package/dist/ekyc.d.ts +3 -3
  27. package/dist/ekyc.esm.js +5 -5
  28. package/dist/email.d.ts +3 -3
  29. package/dist/email.esm.js +5 -5
  30. package/dist/{emailManager-DEIxY7l6.d.ts → emailManager-BQPIJR_O.d.ts} +2 -2
  31. package/dist/{emailManager-CZ2IGW0g.esm.js → emailManager-CpAwvP3v.esm.js} +4 -4
  32. package/dist/endpoints-CI5-28jT.esm.js +69 -0
  33. package/dist/extensibility.d.ts +13 -15
  34. package/dist/extensibility.esm.js +20 -25
  35. package/dist/face-match.d.ts +1 -1
  36. package/dist/face-match.esm.js +3 -3
  37. package/dist/{faceCaptureManagerFactory-CWj-nXdx.d.ts → faceCaptureManagerFactory-CdwpYykv.d.ts} +6 -8
  38. package/dist/{faceCaptureSetup-DIE5cftl.esm.js → faceCaptureSetup-DbXgtcp7.esm.js} +10 -13
  39. package/dist/flow.d.ts +6 -7
  40. package/dist/flow.esm.js +8 -8
  41. package/dist/{flowCompletionService-N6-xypy-.esm.js → flowCompletionService-TnWijsSw.esm.js} +2 -2
  42. package/dist/{flowServices-xgqnJ64L.esm.js → flowServices-CO2sIR3D.esm.js} +3 -3
  43. package/dist/geolocation.d.ts +2 -2
  44. package/dist/geolocation.esm.js +4 -4
  45. package/dist/government-validation.d.ts +2 -2
  46. package/dist/government-validation.esm.js +4 -4
  47. package/dist/id-CzDAG_kM.esm.js +0 -0
  48. package/dist/id.d.ts +10 -11
  49. package/dist/id.esm.js +15 -19
  50. package/dist/{idCaptureManager-SHBRQ-X_.esm.js → idCaptureManager-DaLU1ug7.esm.js} +11 -15
  51. package/dist/{idCaptureManager-H-rkXnbK.d.ts → idCaptureManager-IdqsAASp.d.ts} +6 -7
  52. package/dist/index-BuVKc9bv.d.ts +1 -0
  53. package/dist/index.d.ts +611 -3
  54. package/dist/index.esm.js +562 -10
  55. package/dist/{lib-Cq5Wc-Hd.esm.js → lib-i-4qLKdG.esm.js} +1 -1
  56. package/dist/mandatory-consent.d.ts +55 -55
  57. package/dist/mandatory-consent.esm.js +3 -3
  58. package/dist/phone.d.ts +3 -3
  59. package/dist/phone.esm.js +5 -5
  60. package/dist/{phoneManager-CscgaER2.esm.js → phoneManager-BAPHSXx8.esm.js} +4 -4
  61. package/dist/{phoneManager-Clfbrs6b.d.ts → phoneManager-DA8WUJtl.d.ts} +2 -2
  62. package/dist/redirect-to-mobile.d.ts +2 -2
  63. package/dist/redirect-to-mobile.esm.js +4 -4
  64. package/dist/selfie.d.ts +9 -11
  65. package/dist/selfie.esm.js +13 -18
  66. package/dist/{selfieManager-DeGqD5aN.esm.js → selfieManager-BSkzncsa.esm.js} +4 -5
  67. package/dist/{selfieManager-h_hhEefT.d.ts → selfieManager-Dft5wZQ_.d.ts} +2 -2
  68. package/dist/{session-PLjFj_T3.esm.js → session-OglUYC9l.esm.js} +19 -5
  69. package/dist/session.d.ts +2 -46
  70. package/dist/session.esm.js +4 -7
  71. package/dist/signature.d.ts +2 -2
  72. package/dist/signature.esm.js +3 -3
  73. package/dist/{stats-BZ1kFW4p.esm.js → stats-BVigf5Rn.esm.js} +1 -1
  74. package/dist/stats.esm.js +2 -2
  75. package/dist/{types-T0VjZW3T.d.ts → types-CiLyvJGb.d.ts} +1 -1
  76. package/dist/{types-zH5PDmSe.d.ts → types-D8Y1faI5.d.ts} +1 -1
  77. package/package.json +2 -18
  78. package/dist/MotionSensorProvider-BTDLt08l.esm.js +0 -254
  79. package/dist/StateMachine-8d441d6x.d.ts +0 -2
  80. package/dist/camera.d.ts +0 -16
  81. package/dist/camera.esm.js +0 -5
  82. package/dist/deepsightService-C3gQ_9Ml.esm.js +0 -493
  83. package/dist/device.d.ts +0 -46
  84. package/dist/device.esm.js +0 -106
  85. package/dist/events-BlVGS-8F.esm.js +0 -472
  86. package/dist/events.d.ts +0 -232
  87. package/dist/events.esm.js +0 -4
  88. package/dist/getBrowser-B800KRAi.esm.js +0 -41
  89. package/dist/getDeviceClass-BKd2FOAf.esm.js +0 -14
  90. package/dist/http.d.ts +0 -57
  91. package/dist/http.esm.js +0 -3
  92. package/dist/permissionServices-CDqkkway.esm.js +0 -50
  93. package/dist/setup-DJ3dFl5k.d.ts +0 -120
  94. package/dist/setup-fvDWE7f8.esm.js +0 -450
  95. package/dist/types-qhLxpptI.d.ts +0 -5
  96. package/dist/wasm.d.ts +0 -15
  97. package/dist/wasm.esm.js +0 -10
  98. /package/dist/{Actor-C-jivmFF.d.ts → Actor-By8WNHi-.d.ts} +0 -0
  99. /package/dist/{BrowserEnvironmentProvider--xQUs3sg.esm.js → BrowserEnvironmentProvider-BECjyw3_.esm.js} +0 -0
  100. /package/dist/{BrowserTimerProvider-CkHEwJFa.esm.js → BrowserTimerProvider-CIqH6hJp.esm.js} +0 -0
  101. /package/dist/{Manager-BqFybBV-.d.ts → Manager-CCT_-HuZ.d.ts} +0 -0
  102. /package/dist/{api-CyI8qTie.esm.js → api-C2uzxrpN.esm.js} +0 -0
  103. /package/dist/{browserSimulation-yzDdWSBf.esm.js → browserSimulation-DYAk0Ipe.esm.js} +0 -0
  104. /package/dist/{camera-CKsQVNlH.d.ts → camera-6XJdOeBF.d.ts} +0 -0
  105. /package/dist/{camera-CsT06Zqy.esm.js → camera-DAuRUvnp.esm.js} +0 -0
  106. /package/dist/{chunk-BcQWkoAq.esm.js → chunk-D6hkk-hd.esm.js} +0 -0
  107. /package/dist/{displayErrors-CjMXlBnu.d.ts → displayErrors-CGJwvrTl.d.ts} +0 -0
  108. /package/dist/{flowCompletionService-BV6ThEJ1.d.ts → flowCompletionService-BOd4Rk8n.d.ts} +0 -0
  109. /package/dist/{platform-Dcuv6w60.esm.js → platform-DdhkonXk.esm.js} +0 -0
@@ -1,8 +1,20 @@
1
- import { a as __toDynamicImportESM } from "./chunk-BcQWkoAq.esm.js";
2
- import { t as api } from "./api-CyI8qTie.esm.js";
3
- import { _ as endpoints } from "./events-BlVGS-8F.esm.js";
4
- import { n as IncodeCanvas } from "./deepsightService-C3gQ_9Ml.esm.js";
1
+ import { a as __toDynamicImportESM } from "./chunk-D6hkk-hd.esm.js";
2
+ import { a as getDeviceInfo, i as IncodeCanvas, n as MotionSensorProvider } from "./BaseWasmProvider--AzPfwOm.esm.js";
3
+ import { t as api } from "./api-C2uzxrpN.esm.js";
4
+ import { t as endpoints } from "./endpoints-CI5-28jT.esm.js";
5
+ import { i as stopCameraStream, r as requestCameraAccess } from "./camera-DAuRUvnp.esm.js";
5
6
 
7
+ //#region src/internal/device/getDeviceClass.ts
8
+ function getDeviceClass() {
9
+ const { userAgent, platform, maxTouchPoints } = getDeviceInfo();
10
+ if (!userAgent) return "desktop";
11
+ const ua = userAgent.toLowerCase();
12
+ if (/iphone|ipad|ipod/.test(ua) || platform === "MacIntel" && maxTouchPoints > 1) return "ios";
13
+ if (/android/.test(ua)) return "android";
14
+ return "desktop";
15
+ }
16
+
17
+ //#endregion
6
18
  //#region ../infra/src/providers/browser/BrowserStorageProvider.ts
7
19
  /**
8
20
  * Browser-based storage provider wrapping localStorage.
@@ -57,131 +69,104 @@ var BrowserStorageProvider = class {
57
69
  };
58
70
 
59
71
  //#endregion
60
- //#region ../infra/src/media/StreamCanvasCapture.ts
61
- var StreamCanvasCapture = class {
62
- constructor(stream, options) {
63
- this.hasFrame = false;
64
- this.disposed = false;
65
- this.eventTarget = new EventTarget();
66
- this.video = document.createElement("video");
67
- this.video.srcObject = stream;
68
- this.video.autoplay = true;
69
- this.video.playsInline = true;
70
- this.video.muted = true;
71
- const settings = stream.getVideoTracks()[0]?.getSettings();
72
- const initialWidth = options?.width ?? settings?.width ?? 1280;
73
- const initialHeight = options?.height ?? settings?.height ?? 720;
74
- this.canvas = document.createElement("canvas");
75
- this.canvas.width = initialWidth;
76
- this.canvas.height = initialHeight;
77
- this.ctx = this.canvas.getContext("2d", { willReadFrequently: true });
78
- const fps = options?.fps ?? 10;
79
- const intervalMs = fps > 0 ? Math.max(16, Math.floor(1e3 / fps)) : 0;
80
- this.video.addEventListener("loadedmetadata", () => {
81
- if (this.video.videoWidth > 0 && this.video.videoHeight > 0) {
82
- this.canvas.width = this.video.videoWidth;
83
- this.canvas.height = this.video.videoHeight;
84
- }
85
- });
86
- try {
87
- this.video.play();
88
- } catch {}
89
- this.rafLoop(intervalMs);
90
- }
91
- addEventListener(type, listener, options) {
92
- this.eventTarget.addEventListener(type, listener, options);
93
- }
94
- removeEventListener(type, listener, options) {
95
- this.eventTarget.removeEventListener(type, listener, options);
96
- }
97
- /**
98
- * Returns the latest cached frame as an {@link IncodeCanvas}.
99
- */
100
- getLatestCanvas() {
101
- if (!this.hasFrame) this.tick();
102
- if (!this.hasFrame) return null;
103
- return new IncodeCanvas(this.canvas);
104
- }
72
+ //#region src/internal/manualReview/manualReviewService.ts
73
+ async function flagFaceManualReview() {
74
+ try {
75
+ await api.put(endpoints.updateSession, { manualSelfieCheckNeeded: true });
76
+ } catch {}
77
+ }
78
+ async function flagIdManualReview() {
79
+ try {
80
+ await api.put(endpoints.updateSession, { manualIdCheckNeeded: true });
81
+ } catch {}
82
+ }
83
+
84
+ //#endregion
85
+ //#region ../infra/src/media/StreamCanvasProcessingSession.ts
86
+ var StreamCanvasProcessingSession = class {
105
87
  /**
106
- * Returns the latest cached frame as raw {@link ImageData}.
88
+ * Creates a processing session that reacts to `StreamCanvasCapture` frame events
89
+ * and drives a provider's `processFrame()` method with backpressure.
107
90
  */
108
- getLatestFrame() {
109
- if (!this.ctx) return null;
110
- if (!this.hasFrame) this.tick();
111
- if (!this.hasFrame) return null;
112
- try {
113
- return this.ctx.getImageData(0, 0, this.canvas.width, this.canvas.height);
114
- } catch {
115
- return null;
116
- }
91
+ constructor(params) {
92
+ this.disposed = false;
93
+ this.isProcessing = false;
94
+ this.onFrameEvent = () => {
95
+ if (this.disposed || this.isProcessing) return;
96
+ const frame = this.capturer.getLatestFrame();
97
+ if (!frame) return;
98
+ this.onFrame?.(frame);
99
+ this.isProcessing = true;
100
+ this.provider.processFrame(frame).catch(() => {}).finally(() => {
101
+ this.isProcessing = false;
102
+ });
103
+ };
104
+ this.capturer = params.capturer;
105
+ this.provider = params.provider;
106
+ this.onFrame = params.onFrame;
107
+ this.capturer.addEventListener("frame", this.onFrameEvent);
117
108
  }
118
109
  /**
119
- * Disposes internal resources and stops the capture loop.
110
+ * Unsubscribes from frame events and resets the provider.
120
111
  */
121
112
  dispose() {
122
113
  if (this.disposed) return;
123
114
  this.disposed = true;
124
- if (this.rafId !== void 0) {
125
- window.cancelAnimationFrame(this.rafId);
126
- this.rafId = void 0;
127
- }
128
- this.video.srcObject = null;
129
- this.canvas.width = 0;
130
- this.canvas.height = 0;
131
- this.hasFrame = false;
132
- }
133
- rafLoop(intervalMs) {
134
- const loop = (timeMs) => {
135
- if (this.disposed) return;
136
- if (intervalMs <= 0 || this.lastTickTimeMs === void 0 || timeMs - this.lastTickTimeMs >= intervalMs) {
137
- this.lastTickTimeMs = timeMs;
138
- const previousFrameTimeSeconds = this.lastFrameTimeSeconds;
139
- this.tick();
140
- const currentFrameTimeSeconds = this.video.currentTime;
141
- if (previousFrameTimeSeconds === void 0) {
142
- if (this.hasFrame) {
143
- this.lastFrameTimeSeconds = currentFrameTimeSeconds;
144
- this.eventTarget.dispatchEvent(new Event("frame"));
145
- }
146
- } else if (this.hasFrame && currentFrameTimeSeconds !== previousFrameTimeSeconds) {
147
- this.lastFrameTimeSeconds = currentFrameTimeSeconds;
148
- this.eventTarget.dispatchEvent(new Event("frame"));
149
- }
150
- }
151
- this.rafId = window.requestAnimationFrame(loop);
152
- };
153
- this.rafId = window.requestAnimationFrame(loop);
115
+ this.capturer.removeEventListener("frame", this.onFrameEvent);
116
+ this.provider.reset();
154
117
  }
155
- tick() {
156
- if (!this.ctx) return;
157
- if (this.video.readyState < HTMLMediaElement.HAVE_CURRENT_DATA) return;
158
- const videoWidth = this.video.videoWidth;
159
- const videoHeight = this.video.videoHeight;
160
- if (videoWidth === 0 || videoHeight === 0) return;
161
- if (this.canvas.width !== videoWidth || this.canvas.height !== videoHeight) {
162
- this.canvas.width = videoWidth;
163
- this.canvas.height = videoHeight;
164
- }
165
- try {
166
- this.ctx.drawImage(this.video, 0, 0);
167
- this.hasFrame = true;
168
- } catch {
169
- this.hasFrame = false;
170
- }
118
+ /**
119
+ * Returns whether the session has been disposed.
120
+ */
121
+ isDisposed() {
122
+ return this.disposed;
171
123
  }
172
124
  };
173
125
 
174
126
  //#endregion
175
- //#region src/internal/manualReview/manualReviewService.ts
176
- async function flagFaceManualReview() {
127
+ //#region ../infra/src/media/permissions.ts
128
+ async function queryPermission(name) {
177
129
  try {
178
- await api.put(endpoints.updateSession, { manualSelfieCheckNeeded: true });
179
- } catch {}
130
+ if (typeof navigator === "undefined" || !navigator.permissions) return "prompt";
131
+ return (await navigator.permissions.query({ name })).state;
132
+ } catch {
133
+ return "prompt";
134
+ }
180
135
  }
181
- async function flagIdManualReview() {
136
+ async function queryCameraPermission() {
137
+ return queryPermission("camera");
138
+ }
139
+
140
+ //#endregion
141
+ //#region src/internal/permissions/permissionServices.ts
142
+ /**
143
+ * Checks the current camera permission state without prompting the user.
144
+ */
145
+ async function checkPermission() {
146
+ return queryCameraPermission();
147
+ }
148
+ /**
149
+ * Requests motion sensor permission. Must be called during a user gesture on iOS.
150
+ * Returns the permission result.
151
+ */
152
+ async function requestMotionPermission() {
153
+ return new MotionSensorProvider().requestPermission();
154
+ }
155
+ /**
156
+ * Requests camera permission by attempting to access the camera, then immediately
157
+ * stops the obtained stream. Also requests motion sensor permission (required on iOS
158
+ * to be called during a user gesture). This function does not keep or return the stream.
159
+ */
160
+ async function requestPermission() {
182
161
  try {
183
- await api.put(endpoints.updateSession, { manualIdCheckNeeded: true });
184
- } catch {}
162
+ await requestMotionPermission();
163
+ stopCameraStream(await requestCameraAccess({ video: true }));
164
+ return "granted";
165
+ } catch (error) {
166
+ const name = error instanceof Error ? error.name : void 0;
167
+ if (name === "NotAllowedError" || name === "PermissionDeniedError") return "denied";
168
+ return "prompt";
169
+ }
185
170
  }
186
171
 
187
172
  //#endregion
@@ -189,7 +174,7 @@ async function flagIdManualReview() {
189
174
  let openViduImport;
190
175
  async function loadOpenVidu() {
191
176
  if (openViduImport) return openViduImport;
192
- openViduImport = import("./lib-Cq5Wc-Hd.esm.js").then(__toDynamicImportESM(1));
177
+ openViduImport = import("./lib-i-4qLKdG.esm.js").then(__toDynamicImportESM(1));
193
178
  return openViduImport;
194
179
  }
195
180
 
@@ -277,48 +262,6 @@ var OpenViduRecordingProvider = class {
277
262
  }
278
263
  };
279
264
 
280
- //#endregion
281
- //#region ../infra/src/media/StreamCanvasProcessingSession.ts
282
- var StreamCanvasProcessingSession = class {
283
- /**
284
- * Creates a processing session that reacts to `StreamCanvasCapture` frame events
285
- * and drives a provider's `processFrame()` method with backpressure.
286
- */
287
- constructor(params) {
288
- this.disposed = false;
289
- this.isProcessing = false;
290
- this.onFrameEvent = () => {
291
- if (this.disposed || this.isProcessing) return;
292
- const frame = this.capturer.getLatestFrame();
293
- if (!frame) return;
294
- this.onFrame?.(frame);
295
- this.isProcessing = true;
296
- this.provider.processFrame(frame).catch(() => {}).finally(() => {
297
- this.isProcessing = false;
298
- });
299
- };
300
- this.capturer = params.capturer;
301
- this.provider = params.provider;
302
- this.onFrame = params.onFrame;
303
- this.capturer.addEventListener("frame", this.onFrameEvent);
304
- }
305
- /**
306
- * Unsubscribes from frame events and resets the provider.
307
- */
308
- dispose() {
309
- if (this.disposed) return;
310
- this.disposed = true;
311
- this.capturer.removeEventListener("frame", this.onFrameEvent);
312
- this.provider.reset();
313
- }
314
- /**
315
- * Returns whether the session has been disposed.
316
- */
317
- isDisposed() {
318
- return this.disposed;
319
- }
320
- };
321
-
322
265
  //#endregion
323
266
  //#region src/internal/recordings/recordingsRepository.ts
324
267
  async function createRecordingSession(type) {
@@ -349,4 +292,119 @@ async function uploadDeepsightVideo(encryptedVideo, token) {
349
292
  }
350
293
 
351
294
  //#endregion
352
- export { StreamCanvasProcessingSession as a, flagIdManualReview as c, uploadDeepsightVideo as i, StreamCanvasCapture as l, startRecording as n, OpenViduRecordingProvider as o, stopRecording as r, flagFaceManualReview as s, createRecordingSession as t, BrowserStorageProvider as u };
295
+ //#region ../infra/src/media/StreamCanvasCapture.ts
296
+ var StreamCanvasCapture = class {
297
+ constructor(stream, options) {
298
+ this.hasFrame = false;
299
+ this.disposed = false;
300
+ this.eventTarget = new EventTarget();
301
+ this.video = document.createElement("video");
302
+ this.video.srcObject = stream;
303
+ this.video.autoplay = true;
304
+ this.video.playsInline = true;
305
+ this.video.muted = true;
306
+ const settings = stream.getVideoTracks()[0]?.getSettings();
307
+ const initialWidth = options?.width ?? settings?.width ?? 1280;
308
+ const initialHeight = options?.height ?? settings?.height ?? 720;
309
+ this.canvas = document.createElement("canvas");
310
+ this.canvas.width = initialWidth;
311
+ this.canvas.height = initialHeight;
312
+ this.ctx = this.canvas.getContext("2d", { willReadFrequently: true });
313
+ const fps = options?.fps ?? 10;
314
+ const intervalMs = fps > 0 ? Math.max(16, Math.floor(1e3 / fps)) : 0;
315
+ this.video.addEventListener("loadedmetadata", () => {
316
+ if (this.video.videoWidth > 0 && this.video.videoHeight > 0) {
317
+ this.canvas.width = this.video.videoWidth;
318
+ this.canvas.height = this.video.videoHeight;
319
+ }
320
+ });
321
+ try {
322
+ this.video.play();
323
+ } catch {}
324
+ this.rafLoop(intervalMs);
325
+ }
326
+ addEventListener(type, listener, options) {
327
+ this.eventTarget.addEventListener(type, listener, options);
328
+ }
329
+ removeEventListener(type, listener, options) {
330
+ this.eventTarget.removeEventListener(type, listener, options);
331
+ }
332
+ /**
333
+ * Returns the latest cached frame as an {@link IncodeCanvas}.
334
+ */
335
+ getLatestCanvas() {
336
+ if (!this.hasFrame) this.tick();
337
+ if (!this.hasFrame) return null;
338
+ return new IncodeCanvas(this.canvas);
339
+ }
340
+ /**
341
+ * Returns the latest cached frame as raw {@link ImageData}.
342
+ */
343
+ getLatestFrame() {
344
+ if (!this.ctx) return null;
345
+ if (!this.hasFrame) this.tick();
346
+ if (!this.hasFrame) return null;
347
+ try {
348
+ return this.ctx.getImageData(0, 0, this.canvas.width, this.canvas.height);
349
+ } catch {
350
+ return null;
351
+ }
352
+ }
353
+ /**
354
+ * Disposes internal resources and stops the capture loop.
355
+ */
356
+ dispose() {
357
+ if (this.disposed) return;
358
+ this.disposed = true;
359
+ if (this.rafId !== void 0) {
360
+ window.cancelAnimationFrame(this.rafId);
361
+ this.rafId = void 0;
362
+ }
363
+ this.video.srcObject = null;
364
+ this.canvas.width = 0;
365
+ this.canvas.height = 0;
366
+ this.hasFrame = false;
367
+ }
368
+ rafLoop(intervalMs) {
369
+ const loop = (timeMs) => {
370
+ if (this.disposed) return;
371
+ if (intervalMs <= 0 || this.lastTickTimeMs === void 0 || timeMs - this.lastTickTimeMs >= intervalMs) {
372
+ this.lastTickTimeMs = timeMs;
373
+ const previousFrameTimeSeconds = this.lastFrameTimeSeconds;
374
+ this.tick();
375
+ const currentFrameTimeSeconds = this.video.currentTime;
376
+ if (previousFrameTimeSeconds === void 0) {
377
+ if (this.hasFrame) {
378
+ this.lastFrameTimeSeconds = currentFrameTimeSeconds;
379
+ this.eventTarget.dispatchEvent(new Event("frame"));
380
+ }
381
+ } else if (this.hasFrame && currentFrameTimeSeconds !== previousFrameTimeSeconds) {
382
+ this.lastFrameTimeSeconds = currentFrameTimeSeconds;
383
+ this.eventTarget.dispatchEvent(new Event("frame"));
384
+ }
385
+ }
386
+ this.rafId = window.requestAnimationFrame(loop);
387
+ };
388
+ this.rafId = window.requestAnimationFrame(loop);
389
+ }
390
+ tick() {
391
+ if (!this.ctx) return;
392
+ if (this.video.readyState < HTMLMediaElement.HAVE_CURRENT_DATA) return;
393
+ const videoWidth = this.video.videoWidth;
394
+ const videoHeight = this.video.videoHeight;
395
+ if (videoWidth === 0 || videoHeight === 0) return;
396
+ if (this.canvas.width !== videoWidth || this.canvas.height !== videoHeight) {
397
+ this.canvas.width = videoWidth;
398
+ this.canvas.height = videoHeight;
399
+ }
400
+ try {
401
+ this.ctx.drawImage(this.video, 0, 0);
402
+ this.hasFrame = true;
403
+ } catch {
404
+ this.hasFrame = false;
405
+ }
406
+ }
407
+ };
408
+
409
+ //#endregion
410
+ export { uploadDeepsightVideo as a, requestPermission as c, flagIdManualReview as d, BrowserStorageProvider as f, stopRecording as i, StreamCanvasProcessingSession as l, createRecordingSession as n, OpenViduRecordingProvider as o, getDeviceClass as p, startRecording as r, checkPermission as s, StreamCanvasCapture as t, flagFaceManualReview as u };
@@ -1,4 +1,4 @@
1
- import { r as mlWasmJSApi_default, t as BaseWasmProvider } from "./BaseWasmProvider-CQgeReKV.esm.js";
1
+ import { l as mlWasmJSApi_default, t as BaseWasmProvider } from "./BaseWasmProvider--AzPfwOm.esm.js";
2
2
 
3
3
  //#region ../infra/src/providers/wasm/WasmUtilProvider.ts
4
4
  var WasmUtilProvider = class WasmUtilProvider extends BaseWasmProvider {
@@ -1,7 +1,7 @@
1
- import { t as api } from "./api-CyI8qTie.esm.js";
2
- import { _ as endpoints } from "./events-BlVGS-8F.esm.js";
3
- import { r as fromCallback } from "./xstate.esm-BXrcOcSC.esm.js";
4
- import { t as BrowserTimerProvider } from "./BrowserTimerProvider-CkHEwJFa.esm.js";
1
+ import { t as api } from "./api-C2uzxrpN.esm.js";
2
+ import { x as fromCallback } from "./Manager-C6AGXEq_.esm.js";
3
+ import { t as endpoints } from "./endpoints-CI5-28jT.esm.js";
4
+ import { t as BrowserTimerProvider } from "./BrowserTimerProvider-CIqH6hJp.esm.js";
5
5
 
6
6
  //#region src/shared/usStates.ts
7
7
  const usStates = {
@@ -1,4 +1,4 @@
1
- import { t as Manager } from "./Manager-BqFybBV-.js";
1
+ import { t as Manager } from "./Manager-CCT_-HuZ.js";
2
2
 
3
3
  //#region src/modules/antifraud/antifraudManager.d.ts
4
4
  type AntifraudIdleState = {
@@ -1,6 +1,6 @@
1
- import { t as api } from "./api-CyI8qTie.esm.js";
2
- import { _ as endpoints, n as eventModuleNames, o as createManagerInstrumentation } from "./events-BlVGS-8F.esm.js";
3
- import { a as createActor, i as fromPromise, o as createManager, t as setup } from "./xstate.esm-BXrcOcSC.esm.js";
1
+ import { t as api } from "./api-C2uzxrpN.esm.js";
2
+ import { C as createActor, S as fromPromise, r as eventModuleNames, s as createManagerInstrumentation, t as createManager, y as setup } from "./Manager-C6AGXEq_.esm.js";
3
+ import { t as endpoints } from "./endpoints-CI5-28jT.esm.js";
4
4
 
5
5
  //#region src/modules/antifraud/antifraudServices.ts
6
6
  async function processAntifraud(signal) {
@@ -1,12 +1,10 @@
1
- import "./warmup-CEOVQKby.js";
2
- import "./Manager-BqFybBV-.js";
3
- import "./Actor-C-jivmFF.js";
4
- import "./StateMachine-8d441d6x.js";
5
- import { _ as AuthenticationConfig, b as authenticationMachine, g as createAuthenticationActor, h as CreateAuthenticationActorOptions, m as AuthenticationActor } from "./faceCaptureManagerFactory-CWj-nXdx.js";
6
- import "./camera-CKsQVNlH.js";
7
- import "./types-T0VjZW3T.js";
8
- import "./types-zH5PDmSe.js";
9
- import "./deepsightService-CMAtxAC9.js";
10
- import "./types-qhLxpptI.js";
11
- import { n as AuthenticationState, r as createAuthenticationManager, t as AuthenticationManager } from "./authenticationManager-CiXsOTdM.js";
1
+ import "./StateMachine-CM_aOfNL.js";
2
+ import "./Actor-By8WNHi-.js";
3
+ import "./deepsightService-Ciu0atv5.js";
4
+ import "./camera-6XJdOeBF.js";
5
+ import "./types-CiLyvJGb.js";
6
+ import "./types-D8Y1faI5.js";
7
+ import "./Manager-CCT_-HuZ.js";
8
+ import { _ as AuthenticationConfig, b as authenticationMachine, g as createAuthenticationActor, h as CreateAuthenticationActorOptions, m as AuthenticationActor } from "./faceCaptureManagerFactory-CdwpYykv.js";
9
+ import { n as AuthenticationState, r as createAuthenticationManager, t as AuthenticationManager } from "./authenticationManager-Bd10YGSO.js";
12
10
  export { type AuthenticationActor, type AuthenticationConfig, type AuthenticationManager, type AuthenticationState, type CreateAuthenticationActorOptions, authenticationMachine, createAuthenticationActor, createAuthenticationManager };
@@ -1,20 +1,15 @@
1
- import "./BaseWasmProvider-CQgeReKV.esm.js";
2
- import "./WasmUtilProvider-C45HStLj.esm.js";
3
- import "./api-CyI8qTie.esm.js";
4
- import "./events-BlVGS-8F.esm.js";
5
- import "./browserSimulation-yzDdWSBf.esm.js";
6
- import "./xstate.esm-BXrcOcSC.esm.js";
7
- import "./faceCaptureSetup-DIE5cftl.esm.js";
8
- import "./recordingsRepository-blYn-iKZ.esm.js";
9
- import "./deepsightService-C3gQ_9Ml.esm.js";
10
- import "./camera-CsT06Zqy.esm.js";
11
- import "./getBrowser-B800KRAi.esm.js";
12
- import "./stats-BZ1kFW4p.esm.js";
13
- import "./MotionSensorProvider-BTDLt08l.esm.js";
14
- import "./permissionServices-CDqkkway.esm.js";
15
- import "./platform-Dcuv6w60.esm.js";
16
- import "./backCameraStream-CUo1USCT.esm.js";
17
- import "./getDeviceClass-BKd2FOAf.esm.js";
18
- import { i as authenticationMachine, r as createAuthenticationActor, t as createAuthenticationManager } from "./authenticationManager-CW4qxgcq.esm.js";
1
+ import "./platform-DdhkonXk.esm.js";
2
+ import "./BaseWasmProvider--AzPfwOm.esm.js";
3
+ import "./StreamCanvasCapture-DkpkIgyL.esm.js";
4
+ import "./browserSimulation-DYAk0Ipe.esm.js";
5
+ import "./api-C2uzxrpN.esm.js";
6
+ import "./Manager-C6AGXEq_.esm.js";
7
+ import "./endpoints-CI5-28jT.esm.js";
8
+ import "./camera-DAuRUvnp.esm.js";
9
+ import "./stats-BVigf5Rn.esm.js";
10
+ import "./backCameraStream-DF_d7hTz.esm.js";
11
+ import "./WasmUtilProvider-BonqBWdj.esm.js";
12
+ import "./faceCaptureSetup-DbXgtcp7.esm.js";
13
+ import { i as authenticationMachine, r as createAuthenticationActor, t as createAuthenticationManager } from "./authenticationManager-B4gSCgrO.esm.js";
19
14
 
20
15
  export { authenticationMachine, createAuthenticationActor, createAuthenticationManager };
@@ -1,10 +1,9 @@
1
- import { t as WasmUtilProvider } from "./WasmUtilProvider-C45HStLj.esm.js";
2
- import { t as api } from "./api-CyI8qTie.esm.js";
3
- import { _ as endpoints, n as eventModuleNames } from "./events-BlVGS-8F.esm.js";
4
- import { a as createActor, i as fromPromise, n as assign } from "./xstate.esm-BXrcOcSC.esm.js";
5
- import { a as createFaceCaptureManagerFromActor, i as FACE_ERROR_CODES, t as faceCaptureMachine } from "./faceCaptureSetup-DIE5cftl.esm.js";
6
- import { u as BrowserStorageProvider } from "./recordingsRepository-blYn-iKZ.esm.js";
7
- import { t as getDeviceClass } from "./getDeviceClass-BKd2FOAf.esm.js";
1
+ import { f as BrowserStorageProvider, p as getDeviceClass } from "./StreamCanvasCapture-DkpkIgyL.esm.js";
2
+ import { t as api } from "./api-C2uzxrpN.esm.js";
3
+ import { C as createActor, S as fromPromise, b as assign, r as eventModuleNames } from "./Manager-C6AGXEq_.esm.js";
4
+ import { t as endpoints } from "./endpoints-CI5-28jT.esm.js";
5
+ import { t as WasmUtilProvider } from "./WasmUtilProvider-BonqBWdj.esm.js";
6
+ import { a as createFaceCaptureManagerFromActor, i as FACE_ERROR_CODES, t as faceCaptureMachine } from "./faceCaptureSetup-DbXgtcp7.esm.js";
8
7
 
9
8
  //#region src/modules/authentication/authenticationErrorUtils.ts
10
9
  const AUTH_ERROR_MAP = {
@@ -1,5 +1,5 @@
1
- import { t as Manager } from "./Manager-BqFybBV-.js";
2
- import { h as CreateAuthenticationActorOptions, m as AuthenticationActor, n as FaceCaptureManagerState, t as FaceCaptureManager } from "./faceCaptureManagerFactory-CWj-nXdx.js";
1
+ import { t as Manager } from "./Manager-CCT_-HuZ.js";
2
+ import { h as CreateAuthenticationActorOptions, m as AuthenticationActor, n as FaceCaptureManagerState, t as FaceCaptureManager } from "./faceCaptureManagerFactory-CdwpYykv.js";
3
3
 
4
4
  //#region src/modules/authentication/authenticationManager.d.ts
5
5
  type AuthenticationState = FaceCaptureManagerState;
@@ -1,5 +1,5 @@
1
- import { i as stopCameraStream, n as enumerateVideoDevices, r as requestCameraAccess, t as applyTrackConstraints } from "./camera-CsT06Zqy.esm.js";
2
- import { a as isIPhone14OrHigher, o as isSafari, r as isIOS, t as isAndroid } from "./platform-Dcuv6w60.esm.js";
1
+ import { a as isIPhone14OrHigher, o as isSafari, r as isIOS, t as isAndroid } from "./platform-DdhkonXk.esm.js";
2
+ import { i as stopCameraStream, n as enumerateVideoDevices, r as requestCameraAccess, t as applyTrackConstraints } from "./camera-DAuRUvnp.esm.js";
3
3
 
4
4
  //#region ../infra/src/capabilities/ITimerCapability.ts
5
5
  function sleep(ms) {