@incodetech/core 2.0.1-rc.0 → 2.1.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.
- package/dist/{BrowserStorageProvider-CuOW1Er2.esm.js → BrowserStorageProvider-BpJM-gIl.esm.js} +8 -1
- package/dist/{IpifyProvider-D7jx52AL.esm.js → IpifyProvider-D4LWD15E.esm.js} +28 -0
- package/dist/{MotionSensorProvider-4v7xkqAp.esm.js → MotionSensorProvider-Bx7Mpzt0.esm.js} +63 -13
- package/dist/{OpenViduRecordingProvider-CMu6XVdc.esm.js → OpenViduRecordingProvider-O4GjBseO.esm.js} +1 -1
- package/dist/StateMachine-BC_nGvrc.d.ts +2 -0
- package/dist/StreamCanvasCapture-ImiDQdVA.esm.js +118 -0
- package/dist/StreamCanvasCapture-yyl20qd9.d.ts +152 -0
- package/dist/{BaseWasmProvider-C_DLEI40.esm.js → WasmUtilProvider-CiEN7Gjn.esm.js} +183 -11
- package/dist/{addressSearch-BpTbTWCa.esm.js → addressSearch-DvmWXKZg.esm.js} +63 -57
- package/dist/{ae-signature-DDDZmWXj.esm.js → ae-signature-BFZta3TZ.esm.js} +1 -1
- package/dist/ae-signature.d.ts +3 -3
- package/dist/ae-signature.esm.js +6 -5
- package/dist/antifraud.d.ts +5 -46
- package/dist/antifraud.esm.js +6 -43
- package/dist/antifraudManager-CkV4u-LE.esm.js +55 -0
- package/dist/antifraudManager-CznnhyvD.d.ts +63 -0
- package/dist/{antifraudStateMachine-O0TMf6yc.esm.js → antifraudStateMachine-Ccrb-Jxc.esm.js} +2 -2
- package/dist/apiError-B-j-gyDx.esm.js +51 -0
- package/dist/authentication.d.ts +13 -11
- package/dist/authentication.esm.js +26 -22
- package/dist/{authenticationManager-C83GNIhl.d.ts → authenticationManager-CIVY80H9.d.ts} +4 -4
- package/dist/{authenticationManager-5M-fKzXx.esm.js → authenticationManager-ZNotsWnC.esm.js} +6 -6
- package/dist/{authenticationStateMachine-BMZqatiF.esm.js → authenticationStateMachine-DksVbF_H.esm.js} +21 -9
- package/dist/{backCameraStream-DMdMeGk2.esm.js → backCameraStream-D7Wo4Nbx.esm.js} +95 -7
- package/dist/{session-CGtQJJzB.esm.js → browserSimulation-B1dWiXp7.esm.js} +61 -476
- package/dist/camera.d.ts +4 -3
- package/dist/camera.esm.js +4 -3
- package/dist/canvas-SKcRBxsk.esm.js +230 -0
- package/dist/consent.d.ts +4 -398
- package/dist/consent.esm.js +6 -77
- package/dist/consentManager-BLd51QiW.d.ts +419 -0
- package/dist/consentManager-BYo9Nu1r.esm.js +90 -0
- package/dist/{consentStateMachine-CCT-B60O.esm.js → consentStateMachine-BG3yL8aC.esm.js} +9 -6
- package/dist/cpf-ocr.d.ts +4 -199
- package/dist/cpf-ocr.esm.js +8 -177
- package/dist/cpfOcrManager-BnieFXuG.d.ts +216 -0
- package/dist/cpfOcrManager-sSKegxox.esm.js +190 -0
- package/dist/cross-document-data-match.d.ts +1 -1
- package/dist/cross-document-data-match.esm.js +4 -4
- package/dist/curp-validation.d.ts +8 -158
- package/dist/curp-validation.esm.js +6 -108
- package/dist/curpValidationManager-CFem6zP9.esm.js +122 -0
- package/dist/curpValidationManager-RttixpIc.d.ts +184 -0
- package/dist/{curpValidationStateMachine-CitWLr2c.esm.js → curpValidationStateMachine-B7V_qp66.esm.js} +20 -13
- package/dist/custom-fields.d.ts +2 -2
- package/dist/custom-fields.esm.js +4 -4
- package/dist/custom-watchlist.d.ts +1 -1
- package/dist/custom-watchlist.esm.js +4 -41
- package/dist/customWatchlistStateMachine-HmFybXLX.esm.js +50 -0
- package/dist/{deepsightLoader-Cm4JIT_z.esm.js → deepsightLoader-65k1Appi.esm.js} +19 -10
- package/dist/{deepsightService-CEVxzehb.d.ts → deepsightService-B7ShOkWL.d.ts} +8 -160
- package/dist/deepsightService-CrHmvx8X.esm.js +276 -0
- package/dist/device.esm.js +4 -3
- package/dist/document-capture.d.ts +992 -83
- package/dist/document-capture.esm.js +34 -8
- package/dist/document-upload.d.ts +47 -47
- package/dist/document-upload.esm.js +7 -7
- package/dist/{documentCaptureStateMachine-BqzTDy9k.esm.js → documentCaptureStateMachine-WYV1r9le.esm.js} +90 -6
- package/dist/dynamic-forms.d.ts +20 -5
- package/dist/dynamic-forms.esm.js +150 -61
- package/dist/ekyb.d.ts +32 -13
- package/dist/ekyb.esm.js +25 -15
- package/dist/{ekybStateMachine-BR2let5f.esm.js → ekybStateMachine-aYixw2sL.esm.js} +319 -207
- package/dist/ekyc.d.ts +10 -78
- package/dist/ekyc.esm.js +17 -12
- package/dist/{ekycStateMachine-oeO0Iekd.esm.js → ekycStateMachine-CXbpaJJn.esm.js} +201 -113
- package/dist/electronic-signature.d.ts +3 -3
- package/dist/electronic-signature.esm.js +5 -4
- package/dist/{electronicSignatureManager-D9OHzTpG.esm.js → electronicSignatureManager-BaECdJ1u.esm.js} +91 -23
- package/dist/email.d.ts +4 -3
- package/dist/email.esm.js +6 -5
- package/dist/{emailManager-wAV0LE-H.esm.js → emailManager--D5G3ChB.esm.js} +30 -7
- package/dist/{emailManager-DIfnS5g1.d.ts → emailManager-lAzDoQOs.d.ts} +66 -8
- package/dist/{emailStateMachine-DOf4j58N.esm.js → emailStateMachine-CxTOMAjC.esm.js} +46 -11
- package/dist/{endpoints-CnN3SyDa.esm.js → endpoints-BeTK0Mlt.esm.js} +6 -3
- package/dist/{events-D6-e4vok.esm.js → events-Dvvriq9l.esm.js} +3 -1
- package/dist/events.d.ts +2 -0
- package/dist/events.esm.js +1 -1
- package/dist/extensibility.d.ts +32 -16
- package/dist/extensibility.esm.js +55 -33
- package/dist/face-match.d.ts +32 -2
- package/dist/face-match.esm.js +5 -5
- package/dist/{faceCaptureManagerFactory-yqtpxjnN.d.ts → faceCaptureManagerFactory-C_hRHx8a.d.ts} +35 -11
- package/dist/{faceCaptureManagerFactory-Dh2PdGlF.esm.js → faceCaptureManagerFactory-kqbUqtrr.esm.js} +21 -5
- package/dist/{faceCaptureSetup-B3faSpYA.esm.js → faceCaptureSetup-CtvHWd3x.esm.js} +68 -183
- package/dist/{faceMatchStateMachine-DNFrxTFS.esm.js → faceMatchStateMachine-DdGXUBnx.esm.js} +60 -6
- package/dist/field-comparison.d.ts +4 -0
- package/dist/field-comparison.esm.js +7 -0
- package/dist/fieldComparisonManager-Bu5TaSr3.d.ts +76 -0
- package/dist/fieldComparisonManager-COGI2ARD.esm.js +162 -0
- package/dist/fiscal-qr.d.ts +59 -0
- package/dist/fiscal-qr.esm.js +323 -0
- package/dist/flow-events.d.ts +6 -5
- package/dist/flow.d.ts +23 -15
- package/dist/flow.esm.js +63 -17
- package/dist/flowCompletionService-BdR2cGgB.d.ts +19 -0
- package/dist/flowCompletionService-DdGojV9K.esm.js +20 -0
- package/dist/{flowServices-DG3IdWw6.esm.js → flowServices-BTuHLHVr.esm.js} +10 -5
- package/dist/geolocation.d.ts +4 -4
- package/dist/geolocation.esm.js +6 -6
- package/dist/{geolocationStateMachine-asasuHY2.esm.js → geolocationStateMachine-Dvh7X0wF.esm.js} +5 -5
- package/dist/getBrowser-C8DP7oTB.esm.js +8 -0
- package/dist/{getBrowser-BSXUTWXw.esm.js → getDeviceClass-C0olyNFS.esm.js} +1 -8
- package/dist/{getDeviceClass-BSntT9_j.esm.js → getDeviceClass-C8Do2qYu.esm.js} +1 -1
- package/dist/government-validation.d.ts +28 -8
- package/dist/government-validation.esm.js +19 -8
- package/dist/{governmentValidationStateMachine-BDDYrJTo.esm.js → governmentValidationStateMachine-DcJ-BfsC.esm.js} +35 -77
- package/dist/home.d.ts +15 -14
- package/dist/home.esm.js +2 -2
- package/dist/http-Cai3IoLS.esm.js +0 -0
- package/dist/http.esm.js +1 -0
- package/dist/id-ocr.d.ts +54 -54
- package/dist/id-ocr.esm.js +5 -5
- package/dist/id-verification.d.ts +27 -27
- package/dist/id-verification.esm.js +4 -4
- package/dist/id.d.ts +12 -10
- package/dist/id.esm.js +36 -26
- package/dist/{idCaptureManager-Fyd0eam-.d.ts → idCaptureManager-D-QYESvF.d.ts} +28 -14
- package/dist/{idCaptureManager-ZPkD7Gjk.esm.js → idCaptureManager-DGVv5l1_.esm.js} +22 -7
- package/dist/{idCaptureStateMachine-BK0bPHoc.esm.js → idCaptureStateMachine-DHi7HydI.esm.js} +172 -123
- package/dist/{idOcrStateMachine-YbjjC_Gg.esm.js → idOcrStateMachine-CDQ5d_VM.esm.js} +4 -4
- package/dist/{idVerificationStateMachine-xbw9HP1Z.esm.js → idVerificationStateMachine-kRxwImzO.esm.js} +2 -2
- package/dist/identity-reuse.d.ts +4 -530
- package/dist/identity-reuse.esm.js +8 -274
- package/dist/identityReuseManager-C6n_97dw.esm.js +95 -0
- package/dist/identityReuseManager-DwLtVzUn.d.ts +428 -0
- package/dist/identityReuseStateMachine-BfE5YiEr.esm.js +148 -0
- package/dist/{index-BcRG8rtJ.d.ts → index-B5hPA0Bg.d.ts} +2 -2
- package/dist/{index-DZoqeAo9.d.ts → index-B9NysVDB.d.ts} +469 -195
- package/dist/index.d.ts +2 -2
- package/dist/index.esm.js +10 -8
- package/dist/{invokeOnCaptureCallback-rc6kBHo5.esm.js → invokeOnCaptureCallback-ygByVdnn.esm.js} +1 -1
- package/dist/{lib-BB0B_qQX.esm.js → lib-BY67lgbq.esm.js} +1 -1
- package/dist/mandatory-consent.d.ts +8 -412
- package/dist/mandatory-consent.esm.js +6 -76
- package/dist/mandatoryConsentManager-H6D18cZB.esm.js +89 -0
- package/dist/mandatoryConsentManager-KfIlURRY.d.ts +429 -0
- package/dist/{mandatoryConsentStateMachine-Cnco1jvn.esm.js → mandatoryConsentStateMachine-DtQNW1ji.esm.js} +6 -6
- package/dist/openviduLazy-B8L--0oe.esm.js +3 -0
- package/dist/{openviduLazy-Cok70ZSg.esm.js → openviduLazy-Dh14JNJc.esm.js} +2 -2
- package/dist/otp-CGMdUzBC.esm.js +33 -0
- package/dist/otp-DF5A0sFx.d.ts +8 -0
- package/dist/permissionGuards-C1ispV96.esm.js +23 -0
- package/dist/permissionServices-CG3bMSfG.esm.js +130 -0
- package/dist/phone.d.ts +4 -3
- package/dist/phone.esm.js +6 -5
- package/dist/{phoneManager-DAJbGhlY.esm.js → phoneManager-BmF-0Ez4.esm.js} +30 -7
- package/dist/{phoneManager-B6M30hKE.d.ts → phoneManager-fPmIBYQK.d.ts} +65 -7
- package/dist/{phoneStateMachine-CuPARRaT.esm.js → phoneStateMachine-BiV0yoEx.esm.js} +46 -11
- package/dist/{qe-signature-DFo_Cc-I.esm.js → qe-signature-CUYPcHVo.esm.js} +1 -1
- package/dist/qe-signature.d.ts +3 -3
- package/dist/qe-signature.esm.js +6 -5
- package/dist/{recordingService-Ig2UgbLv.esm.js → recordingService-Bn9EdCmz.esm.js} +197 -179
- package/dist/redirect-to-mobile.d.ts +6 -104
- package/dist/redirect-to-mobile.esm.js +6 -99
- package/dist/redirectToMobileManager-BNe3IzC_.d.ts +178 -0
- package/dist/redirectToMobileManager-Dy3t7o0C.esm.js +159 -0
- package/dist/{redirectToMobileStateMachine-BOEqe46A.esm.js → redirectToMobileStateMachine-DyAdRxfP.esm.js} +28 -19
- package/dist/{runChildModule-CqqwqAkW.esm.js → runChildModule-CuoHZ1cx.esm.js} +35 -3
- package/dist/selfie.d.ts +13 -11
- package/dist/selfie.esm.js +27 -23
- package/dist/{selfieManager-Duisl7qN.esm.js → selfieManager-BjCoKRy0.esm.js} +6 -6
- package/dist/{selfieManager-D0lSgd-J.d.ts → selfieManager-dUbKRzOh.d.ts} +4 -4
- package/dist/{selfieStateMachine-D76whWEf.esm.js → selfieStateMachine-b4F2q9zw.esm.js} +5 -3
- package/dist/session-DoVb-OcB.esm.js +152 -0
- package/dist/session.d.ts +37 -5
- package/dist/session.esm.js +12 -7
- package/dist/sessionInitializer-B8H5MsXM.esm.js +366 -0
- package/dist/{setup-C5AITV8m.d.ts → setup-BbkprdVv.d.ts} +57 -6
- package/dist/{setup-DsM8IG7k.esm.js → setup-BqEfrdja.esm.js} +162 -24
- package/dist/signature.d.ts +2 -2
- package/dist/signature.esm.js +4 -4
- package/dist/{signatureStateMachine-B5-QVUve.esm.js → signatureStateMachine-C5qqYLRz.esm.js} +3 -3
- package/dist/stats-BMNUG1AU.esm.js +41 -0
- package/dist/stats.d.ts +13 -2
- package/dist/stats.esm.js +3 -2
- package/dist/trust-graph.d.ts +33 -4
- package/dist/trust-graph.esm.js +21 -15
- package/dist/{types-CFV9G_7j.d.ts → types-Bj9hdFjU.d.ts} +1 -1
- package/dist/{types-BP1m8VRw.d.ts → types-DOUhndhT.d.ts} +14 -2
- package/dist/types-DsnEVMhr.esm.js +34 -0
- package/dist/types-DvGZI7BF.d.ts +131 -0
- package/dist/{types-B06Ypu2F.d.ts → types-NuT8ftBV.d.ts} +1 -1
- package/dist/types-ya0LN_MX.d.ts +5 -0
- package/dist/{warmup-CEcppFiS.d.ts → warmup-Dg8Lh-50.d.ts} +8 -0
- package/dist/wasm.d.ts +6 -4
- package/dist/wasm.esm.js +11 -9
- package/dist/watchlist-for-business.d.ts +1 -1
- package/dist/watchlist-for-business.esm.js +5 -73
- package/dist/watchlist.d.ts +1 -1
- package/dist/watchlist.esm.js +4 -41
- package/dist/watchlistForBusinessStateMachine-DMl8j2Ov.esm.js +74 -0
- package/dist/watchlistStateMachine-DmQlqI6L.esm.js +50 -0
- package/dist/workflow.d.ts +153 -100
- package/dist/workflow.esm.js +156 -80
- package/package.json +19 -1
- package/dist/StateMachine-BCQrZJhf.d.ts +0 -2
- package/dist/WasmUtilProvider-j98OJf-S.esm.js +0 -114
- package/dist/browserSimulation-gxD8cSpM.esm.js +0 -20
- package/dist/deepsightService-O74l4Y__.esm.js +0 -489
- package/dist/displayErrors-DqJ_IbsG.d.ts +0 -39
- package/dist/flowCompletionService-DhkT4SRY.d.ts +0 -10
- package/dist/flowCompletionService-P54yzGvA.esm.js +0 -13
- package/dist/openviduLazy-Cm0XFh_v.esm.js +0 -3
- package/dist/permissionServices-D_i6nzEw.esm.js +0 -50
- package/dist/stats-CIfiPzb1.esm.js +0 -16
- package/dist/types-CAD4va6a.d.ts +0 -5
- package/dist/watchlistServices-DMbUhkBX.esm.js +0 -12
- /package/dist/{Actor-CI32dTbG.d.ts → Actor-Y0_Fj-KL.d.ts} +0 -0
- /package/dist/{ITimerCapability-C67ZRskg.esm.js → ITimerCapability-CB0I1Uf2.esm.js} +0 -0
- /package/dist/{Manager-C8PrhBOx.d.ts → Manager-BHn8wH8K.d.ts} +0 -0
- /package/dist/{camera-PA2Ljri3.esm.js → camera-DJWm3V4g.esm.js} +0 -0
- /package/dist/{camera-DBSxa6ML.d.ts → camera-SRBpPq2X.d.ts} +0 -0
- /package/dist/{chunk-CRF6K_H_.esm.js → chunk-CMUKZ2uL.esm.js} +0 -0
- /package/dist/{cpf-PPz2Njto.esm.js → cpf-BRzggV8G.esm.js} +0 -0
- /package/dist/{dateUtils-UoN5xswP.esm.js → dateUtils-AksLQmgV.esm.js} +0 -0
- /package/dist/{platform-CfrjKhmi.esm.js → platform-SKvEfCBh.esm.js} +0 -0
- /package/dist/{xstate.esm-B70JrNqo.esm.js → xstate.esm-C9wncMQa.esm.js} +0 -0
|
@@ -1,13 +1,64 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { t as api } from "./api-CESGtpbH.esm.js";
|
|
3
|
-
import { t as endpoints } from "./endpoints-
|
|
4
|
-
import {
|
|
5
|
-
import { n as
|
|
6
|
-
import {
|
|
7
|
-
import {
|
|
8
|
-
import { t as
|
|
9
|
-
import { t as
|
|
1
|
+
import { i as mlWasmJSApi_default, n as BaseWasmProvider, u as WasmPipelineType } from "./WasmUtilProvider-CiEN7Gjn.esm.js";
|
|
2
|
+
import { r as getToken, t as api } from "./api-CESGtpbH.esm.js";
|
|
3
|
+
import { t as endpoints } from "./endpoints-BeTK0Mlt.esm.js";
|
|
4
|
+
import { t as addDeviceStats } from "./stats-BMNUG1AU.esm.js";
|
|
5
|
+
import { a as isIPhone14OrHigher, n as isDesktop, r as isIOS, t as isAndroid } from "./platform-SKvEfCBh.esm.js";
|
|
6
|
+
import { i as stopCameraStream, r as requestCameraAccess } from "./camera-DJWm3V4g.esm.js";
|
|
7
|
+
import { t as sleep } from "./ITimerCapability-CB0I1Uf2.esm.js";
|
|
8
|
+
import { t as IncodeCanvas } from "./canvas-SKcRBxsk.esm.js";
|
|
9
|
+
import { n as getBackCameraStream, r as getDesktopCameraStream, t as ensureFrontCameraStream } from "./backCameraStream-D7Wo4Nbx.esm.js";
|
|
10
|
+
import { t as getDeviceClass } from "./getDeviceClass-C8Do2qYu.esm.js";
|
|
11
|
+
import { t as FACE_ERROR_CODES } from "./types-DsnEVMhr.esm.js";
|
|
10
12
|
|
|
13
|
+
//#region ../infra/src/scheduling/yieldUntilNextPaint.ts
|
|
14
|
+
/**
|
|
15
|
+
* Resolves after the browser has had a chance to commit and paint a queued
|
|
16
|
+
* render.
|
|
17
|
+
*
|
|
18
|
+
* Strategy:
|
|
19
|
+
* - `requestAnimationFrame` callbacks fire BEFORE the paint of the frame
|
|
20
|
+
* they belong to (per the HTML5 "update the rendering" step). If we
|
|
21
|
+
* resolve the promise inside a rAF callback, the await-continuation
|
|
22
|
+
* runs as a microtask immediately after the callback returns — still
|
|
23
|
+
* before the paint phase of that frame. A caller that then blocks the
|
|
24
|
+
* main thread (e.g. synchronous WASM `processPhoto`) starves the paint.
|
|
25
|
+
* - We therefore chain rAF → setTimeout: the rAF fires before frame N's
|
|
26
|
+
* paint, the setTimeout runs as a macrotask scheduled after frame N's
|
|
27
|
+
* "update the rendering" step, which the browser will only get to once
|
|
28
|
+
* the paint actually lands. By the time setTimeout fires, the paint
|
|
29
|
+
* for the queued render is on screen.
|
|
30
|
+
* - In environments where rAF never ticks (jsdom, happy-dom, backgrounded
|
|
31
|
+
* tabs), a parallel `setTimeout` fallback at 100 ms resolves instead.
|
|
32
|
+
* 100 ms is comfortably longer than two real-browser frames so rAF +
|
|
33
|
+
* setTimeout wins reliably in any foregrounded browser. (An earlier
|
|
34
|
+
* implementation raced rAF against a `MessageChannel` macrotask, but
|
|
35
|
+
* MessageChannel drains immediately after the current task's
|
|
36
|
+
* microtasks — before the next paint — so it resolved the promise too
|
|
37
|
+
* early and defeated the whole point of the helper.)
|
|
38
|
+
*
|
|
39
|
+
* Lives in infra because it touches browser APIs (`requestAnimationFrame`,
|
|
40
|
+
* `setTimeout`) that the architecture rules forbid from core. Core modules
|
|
41
|
+
* that need to yield to the browser render loop should import this helper
|
|
42
|
+
* directly via its file path.
|
|
43
|
+
*/
|
|
44
|
+
function yieldUntilNextPaint() {
|
|
45
|
+
return new Promise((resolve) => {
|
|
46
|
+
let resolved = false;
|
|
47
|
+
const done = () => {
|
|
48
|
+
if (resolved) return;
|
|
49
|
+
resolved = true;
|
|
50
|
+
resolve();
|
|
51
|
+
};
|
|
52
|
+
if (typeof requestAnimationFrame === "function") requestAnimationFrame(() => {
|
|
53
|
+
requestAnimationFrame(() => {
|
|
54
|
+
setTimeout(done, 0);
|
|
55
|
+
});
|
|
56
|
+
});
|
|
57
|
+
setTimeout(done, 100);
|
|
58
|
+
});
|
|
59
|
+
}
|
|
60
|
+
|
|
61
|
+
//#endregion
|
|
11
62
|
//#region ../infra/src/providers/wasm/FaceDetectionProvider.ts
|
|
12
63
|
var FaceDetectionProvider = class extends BaseWasmProvider {
|
|
13
64
|
constructor() {
|
|
@@ -31,10 +82,8 @@ var FaceDetectionProvider = class extends BaseWasmProvider {
|
|
|
31
82
|
framesAggregationInterval: 2e3,
|
|
32
83
|
minFramesWithFace: 3
|
|
33
84
|
};
|
|
34
|
-
this.currentFrame = null;
|
|
35
85
|
}
|
|
36
86
|
async processFrame(image) {
|
|
37
|
-
this.currentFrame = image;
|
|
38
87
|
await this.processFrameWasm(image);
|
|
39
88
|
}
|
|
40
89
|
async initialize(config) {
|
|
@@ -55,15 +104,11 @@ var FaceDetectionProvider = class extends BaseWasmProvider {
|
|
|
55
104
|
setCallbacks(callbacks) {
|
|
56
105
|
this.ensureInitialized();
|
|
57
106
|
const onCaptureWrapper = (wasmCanvas, face) => {
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
107
|
+
if (!wasmCanvas) return;
|
|
108
|
+
const frameCanvas = new IncodeCanvas(wasmCanvas);
|
|
109
|
+
frameCanvas.updateBase64Image();
|
|
110
|
+
frameCanvas.updateBlob();
|
|
62
111
|
const faceCoordinates = face ? this.formatFaceCoordinates(face) : this.createDefaultFaceCoordinates(frameCanvas);
|
|
63
|
-
try {
|
|
64
|
-
frameCanvas.updateBase64Image();
|
|
65
|
-
frameCanvas.updateBlob();
|
|
66
|
-
} catch {}
|
|
67
112
|
callbacks.onCapture?.(frameCanvas, faceCoordinates);
|
|
68
113
|
};
|
|
69
114
|
mlWasmJSApi_default.setFaceDetectionCallbacks(this.getPipelineType(), callbacks.onFarAway ?? (() => {}), callbacks.onTooClose ?? (() => {}), callbacks.onTooManyFaces ?? (() => {}), callbacks.onNoFace ?? (() => {}), onCaptureWrapper, callbacks.onGetReady ?? (() => {}), callbacks.onGetReadyFinished ?? (() => {}), callbacks.onCenterFace ?? (() => {}), callbacks.onDark ?? (() => {}), callbacks.onBlur ?? (() => {}), callbacks.onFaceAngle ?? (() => {}), callbacks.onLenses ?? (() => {}), callbacks.onMask ?? (() => {}), callbacks.onEyesClosed ?? (() => {}), callbacks.onHeadWear ?? (() => {}), callbacks.onSwitchToManualCapture ?? (() => {}), callbacks.onFaceOccluded ?? (() => {}));
|
|
@@ -127,10 +172,6 @@ var FaceDetectionProvider = class extends BaseWasmProvider {
|
|
|
127
172
|
this.ensureInitialized();
|
|
128
173
|
mlWasmJSApi_default.setFaceDetectionMode(this.getPipelineType(), enabled);
|
|
129
174
|
}
|
|
130
|
-
reset() {
|
|
131
|
-
super.reset();
|
|
132
|
-
this.currentFrame = null;
|
|
133
|
-
}
|
|
134
175
|
createDefaultFaceCoordinates(canvas) {
|
|
135
176
|
return {
|
|
136
177
|
rightEyeX: 0,
|
|
@@ -240,45 +281,12 @@ async function uploadDeepsightVideo(encryptedVideo, token) {
|
|
|
240
281
|
}
|
|
241
282
|
}
|
|
242
283
|
|
|
243
|
-
//#endregion
|
|
244
|
-
//#region src/internal/faceCapture/types.ts
|
|
245
|
-
const FACE_ERROR_CODES = {
|
|
246
|
-
FACE_OCCLUDED: "FACE_OCCLUDED",
|
|
247
|
-
LIVENESS: "LIVENESS_ERROR",
|
|
248
|
-
BRIGHTNESS: "BRIGHTNESS_ERROR",
|
|
249
|
-
LENSES: "LENSES_ERROR",
|
|
250
|
-
MASK: "MASK_ERROR",
|
|
251
|
-
CLOSED_EYES: "CLOSED_EYES_ERROR",
|
|
252
|
-
HEAD_COVER: "HEAD_COVER_ERROR",
|
|
253
|
-
SERVER: "SERVER_ERROR",
|
|
254
|
-
FACE_NOT_FOUND: "FACE_NOT_FOUND",
|
|
255
|
-
MULTIPLE_FACES: "MULTIPLE_FACES",
|
|
256
|
-
TOO_BLURRY: "TOO_BLURRY_ERROR",
|
|
257
|
-
TOO_DARK: "TOO_DARK_ERROR",
|
|
258
|
-
USER_IS_NOT_RECOGNIZED: "USER_IS_NOT_RECOGNIZED",
|
|
259
|
-
SPOOF_ATTEMPT_DETECTED: "SPOOF_ATTEMPT_DETECTED",
|
|
260
|
-
FACE_TOO_DARK: "FACE_TOO_DARK",
|
|
261
|
-
LENSES_DETECTED: "LENSES_DETECTED",
|
|
262
|
-
FACE_MASK_DETECTED: "FACE_MASK_DETECTED",
|
|
263
|
-
CLOSED_EYES_DETECTED: "CLOSED_EYES_DETECTED",
|
|
264
|
-
HEAD_COVER_DETECTED: "HEAD_COVER_DETECTED",
|
|
265
|
-
FACE_CROPPING_FAILED: "FACE_CROPPING_FAILED",
|
|
266
|
-
FACE_TOO_SMALL: "FACE_TOO_SMALL",
|
|
267
|
-
FACE_TOO_BLURRY: "FACE_TOO_BLURRY",
|
|
268
|
-
BAD_PHOTO_QUALITY: "BAD_PHOTO_QUALITY",
|
|
269
|
-
PROCESSING_ERROR: "PROCESSING_ERROR",
|
|
270
|
-
BAD_REQUEST: "BAD_REQUEST",
|
|
271
|
-
NONEXISTENT_CUSTOMER: "NONEXISTENT_CUSTOMER",
|
|
272
|
-
HINT_NOT_PROVIDED: "HINT_NOT_PROVIDED",
|
|
273
|
-
SELFIE_IMAGE_LOW_QUALITY: "SELFIE_IMAGE_LOW_QUALITY"
|
|
274
|
-
};
|
|
275
|
-
|
|
276
284
|
//#endregion
|
|
277
285
|
//#region src/modules/selfie/selfieUploadService.ts
|
|
278
286
|
/**
|
|
279
287
|
* Uploads a selfie image to the backend.
|
|
280
288
|
*/
|
|
281
|
-
async function uploadSelfie({ encryptedBase64Image, faceCoordinates, signal, metadata, recordingId }) {
|
|
289
|
+
async function uploadSelfie({ encryptedBase64Image, faceCoordinates, signal, metadata, recordingId, deepsightService }) {
|
|
282
290
|
try {
|
|
283
291
|
const payload = {
|
|
284
292
|
base64Image: encryptedBase64Image,
|
|
@@ -294,6 +302,12 @@ async function uploadSelfie({ encryptedBase64Image, faceCoordinates, signal, met
|
|
|
294
302
|
query
|
|
295
303
|
});
|
|
296
304
|
if (!res.ok) throw new Error(`POST ${endpoints.selfie} failed: ${res.status} ${res.statusText}`);
|
|
305
|
+
if (deepsightService) addDeviceStats({
|
|
306
|
+
frontIdStatsAnalysisStatus: "",
|
|
307
|
+
backIdStatsAnalysisStatus: "",
|
|
308
|
+
selfieStatsAnalysisStatus: deepsightService.getAnalysisStatus(),
|
|
309
|
+
motionStatus: deepsightService.getMotionStatus()
|
|
310
|
+
});
|
|
297
311
|
return res.data;
|
|
298
312
|
} catch (error) {
|
|
299
313
|
const errorCode = getFaceErrorCodeFromHttpError(error);
|
|
@@ -326,6 +340,7 @@ async function processFace(imageType = "selfie", signal) {
|
|
|
326
340
|
|
|
327
341
|
//#endregion
|
|
328
342
|
//#region src/internal/faceCapture/faceCaptureServices.ts
|
|
343
|
+
const ONDEVICE_AUTOCAPTURE_INTERVAL_MS = 2147483647;
|
|
329
344
|
function sendLabelInspectionEvent() {
|
|
330
345
|
return addDeviceStats({ cameraLabelInspectionStatus: "FAIL" });
|
|
331
346
|
}
|
|
@@ -341,10 +356,11 @@ const IPHONE14_SELFIE_CONSTRAINTS = {
|
|
|
341
356
|
video: { height: { ideal: 1080 } },
|
|
342
357
|
audio: false
|
|
343
358
|
};
|
|
344
|
-
function buildCameraConstraints(resolution) {
|
|
359
|
+
function buildCameraConstraints(resolution, deviceId) {
|
|
345
360
|
if (resolution) return {
|
|
346
361
|
video: {
|
|
347
362
|
facingMode: "user",
|
|
363
|
+
deviceId: deviceId ? { exact: deviceId } : void 0,
|
|
348
364
|
height: resolution.height ? { ideal: resolution.height } : void 0,
|
|
349
365
|
width: resolution.width ? { ideal: resolution.width } : void 0
|
|
350
366
|
},
|
|
@@ -357,16 +373,18 @@ function stopStream(stream) {
|
|
|
357
373
|
stopCameraStream(stream);
|
|
358
374
|
}
|
|
359
375
|
async function getFrontCameraStream(resolution) {
|
|
360
|
-
if (
|
|
361
|
-
|
|
362
|
-
|
|
376
|
+
if (isDesktop()) {
|
|
377
|
+
if (resolution) return ensureFrontCameraStream((deviceId) => requestCameraAccess(buildCameraConstraints(resolution, deviceId)));
|
|
378
|
+
return ensureFrontCameraStream((deviceId) => getDesktopCameraStream(deviceId ? { deviceId } : {}));
|
|
379
|
+
}
|
|
380
|
+
return requestCameraAccess(resolution ? buildCameraConstraints(resolution) : buildCameraConstraints());
|
|
363
381
|
}
|
|
364
382
|
async function initializeCamera(params) {
|
|
365
383
|
const { config } = params;
|
|
366
384
|
const prcConstraints = buildCameraConstraints(config.cameraResolution);
|
|
367
385
|
const provider = new FaceDetectionProvider();
|
|
368
386
|
await provider.initialize({
|
|
369
|
-
autocaptureInterval: config.autoCaptureTimeout * 1e3,
|
|
387
|
+
autocaptureInterval: isOnDeviceMode(config) ? ONDEVICE_AUTOCAPTURE_INTERVAL_MS : config.autoCaptureTimeout * 1e3,
|
|
370
388
|
useOnDeviceWorkflow: config.onDeviceFaceResultsSubmissionEnabled === true
|
|
371
389
|
});
|
|
372
390
|
provider.setChecksEnabled({
|
|
@@ -472,7 +490,7 @@ function buildResolutionFromStream(stream) {
|
|
|
472
490
|
if (typeof width === "number" && typeof height === "number") return `${width}x${height}`;
|
|
473
491
|
}
|
|
474
492
|
async function createOpenViduRecordingProvider() {
|
|
475
|
-
const { OpenViduRecordingProvider } = await import("./OpenViduRecordingProvider-
|
|
493
|
+
const { OpenViduRecordingProvider } = await import("./OpenViduRecordingProvider-O4GjBseO.esm.js");
|
|
476
494
|
return new OpenViduRecordingProvider();
|
|
477
495
|
}
|
|
478
496
|
async function startRecordingSession(params) {
|
|
@@ -512,7 +530,7 @@ async function stopRecording(session) {
|
|
|
512
530
|
}
|
|
513
531
|
}
|
|
514
532
|
async function initializeDeepsightSession(options) {
|
|
515
|
-
const { loadDeepsightSession } = await import("./deepsightLoader-
|
|
533
|
+
const { loadDeepsightSession } = await import("./deepsightLoader-65k1Appi.esm.js");
|
|
516
534
|
return loadDeepsightSession({
|
|
517
535
|
ds: options.ds,
|
|
518
536
|
storage: options.storage
|
|
@@ -520,119 +538,116 @@ async function initializeDeepsightSession(options) {
|
|
|
520
538
|
}
|
|
521
539
|
|
|
522
540
|
//#endregion
|
|
523
|
-
//#region
|
|
524
|
-
|
|
525
|
-
|
|
526
|
-
|
|
527
|
-
|
|
528
|
-
|
|
529
|
-
|
|
530
|
-
|
|
531
|
-
|
|
532
|
-
|
|
533
|
-
|
|
534
|
-
|
|
535
|
-
|
|
536
|
-
|
|
537
|
-
|
|
538
|
-
|
|
539
|
-
|
|
540
|
-
|
|
541
|
-
|
|
542
|
-
|
|
543
|
-
|
|
544
|
-
|
|
545
|
-
|
|
546
|
-
|
|
547
|
-
|
|
548
|
-
|
|
549
|
-
|
|
550
|
-
|
|
551
|
-
|
|
552
|
-
|
|
553
|
-
|
|
554
|
-
|
|
555
|
-
|
|
556
|
-
|
|
557
|
-
|
|
558
|
-
|
|
559
|
-
|
|
560
|
-
|
|
561
|
-
|
|
562
|
-
|
|
563
|
-
|
|
564
|
-
|
|
565
|
-
|
|
566
|
-
|
|
567
|
-
|
|
568
|
-
|
|
569
|
-
|
|
570
|
-
|
|
571
|
-
|
|
572
|
-
|
|
573
|
-
|
|
574
|
-
|
|
575
|
-
|
|
576
|
-
|
|
577
|
-
|
|
578
|
-
|
|
579
|
-
|
|
580
|
-
|
|
581
|
-
|
|
582
|
-
|
|
583
|
-
|
|
584
|
-
|
|
585
|
-
|
|
586
|
-
|
|
587
|
-
|
|
588
|
-
|
|
589
|
-
|
|
590
|
-
|
|
591
|
-
|
|
592
|
-
|
|
593
|
-
|
|
594
|
-
|
|
595
|
-
|
|
596
|
-
|
|
597
|
-
|
|
598
|
-
|
|
599
|
-
|
|
600
|
-
|
|
601
|
-
|
|
602
|
-
|
|
603
|
-
|
|
604
|
-
|
|
605
|
-
|
|
606
|
-
|
|
607
|
-
|
|
608
|
-
|
|
609
|
-
} else if (this.hasFrame && currentFrameTimeSeconds !== previousFrameTimeSeconds) {
|
|
610
|
-
this.lastFrameTimeSeconds = currentFrameTimeSeconds;
|
|
611
|
-
this.eventTarget.dispatchEvent(new Event("frame"));
|
|
612
|
-
}
|
|
613
|
-
}
|
|
614
|
-
this.rafId = window.requestAnimationFrame(loop);
|
|
615
|
-
};
|
|
616
|
-
this.rafId = window.requestAnimationFrame(loop);
|
|
617
|
-
}
|
|
618
|
-
tick() {
|
|
619
|
-
if (!this.ctx) return;
|
|
620
|
-
if (this.video.readyState < HTMLMediaElement.HAVE_CURRENT_DATA) return;
|
|
621
|
-
const videoWidth = this.video.videoWidth;
|
|
622
|
-
const videoHeight = this.video.videoHeight;
|
|
623
|
-
if (videoWidth === 0 || videoHeight === 0) return;
|
|
624
|
-
if (this.canvas.width !== videoWidth || this.canvas.height !== videoHeight) {
|
|
625
|
-
this.canvas.width = videoWidth;
|
|
626
|
-
this.canvas.height = videoHeight;
|
|
627
|
-
}
|
|
628
|
-
try {
|
|
629
|
-
this.ctx.drawImage(this.video, 0, 0);
|
|
630
|
-
this.hasFrame = true;
|
|
631
|
-
} catch {
|
|
632
|
-
this.hasFrame = false;
|
|
633
|
-
}
|
|
541
|
+
//#region src/internal/faceCapture/onDeviceFaceResults.ts
|
|
542
|
+
/**
|
|
543
|
+
* On-device face-results submission helpers.
|
|
544
|
+
*
|
|
545
|
+
* When a SELFIE or AUTHENTICATION module has
|
|
546
|
+
* `onDeviceFaceResultsSubmissionEnabled: true`, face analysis runs entirely
|
|
547
|
+
* inside the WASM `OnDeviceSelfieWorkflow` pipeline. Captured images are
|
|
548
|
+
* never uploaded — only the staged face-results JSON is POSTed via the WASM
|
|
549
|
+
* `WebApi` to `/omni/add/face-results`. The C++ side encrypts that JSON via
|
|
550
|
+
* `SessionEncryptor`, so the per-request `createWasmApi` encryption pipeline
|
|
551
|
+
* is not engaged on this path.
|
|
552
|
+
*
|
|
553
|
+
* Note: even though the per-request encryption pipeline is skipped, the
|
|
554
|
+
* on-device endpoint (`/omni/add/face-results`) is only served on the
|
|
555
|
+
* E2EE-provisioned host — callers must still configure `setup()` with the
|
|
556
|
+
* dedicated E2EE `apiURL` and `encryption: true`. See `SetupOptions.encryption`.
|
|
557
|
+
*
|
|
558
|
+
* These helpers are deliberately variant-agnostic: both the selfie and auth
|
|
559
|
+
* state machine variants delegate their `prepareFaceUpload`, `uploadFace`,
|
|
560
|
+
* and `processFace` actors here to share behavior. See the "Runtime modes
|
|
561
|
+
* within a module" section of `docs/patterns/XSTATE.md` for the broader
|
|
562
|
+
* pattern.
|
|
563
|
+
*/
|
|
564
|
+
const isOnDeviceMode = (config) => config.onDeviceFaceResultsSubmissionEnabled === true;
|
|
565
|
+
/**
|
|
566
|
+
* The default (non-on-device) prepare-upload body shared by selfie and auth.
|
|
567
|
+
* Stops any active recording, runs deepsight virtual-camera + frame checks,
|
|
568
|
+
* tracks the capture attempt, and encrypts the captured image.
|
|
569
|
+
*
|
|
570
|
+
* Lifted out of `faceCaptureSetup.ts`'s base `prepareFaceUpload` actor so the
|
|
571
|
+
* default path can be reused by both variants while leaving room for an
|
|
572
|
+
* on-device branch alongside it.
|
|
573
|
+
*/
|
|
574
|
+
async function defaultPrepareFaceUpload(ctx) {
|
|
575
|
+
const sessionToken = getToken();
|
|
576
|
+
const recordingId = (await ctx.recordingService?.stop())?.recordingId ?? null;
|
|
577
|
+
try {
|
|
578
|
+
if (ctx.deepsightService) await Promise.all([ctx.deepsightService.performVirtualCameraCheck(sessionToken, "SELFIE"), ctx.deepsightService.analyzeFrame(ctx.capturedImage.getImageData())]);
|
|
579
|
+
} catch (error) {}
|
|
580
|
+
const logs = ctx.deepsightService?.getPipelineState() ?? "";
|
|
581
|
+
ctx.dependencies.trackCaptureAttemptFinished?.({ logs });
|
|
582
|
+
return {
|
|
583
|
+
encryptedBase64Image: await encryptSelfieImage({
|
|
584
|
+
canvas: ctx.capturedImage,
|
|
585
|
+
dependencies: ctx.dependencies
|
|
586
|
+
}),
|
|
587
|
+
recordingId
|
|
588
|
+
};
|
|
589
|
+
}
|
|
590
|
+
/**
|
|
591
|
+
* On-device prepare-upload. No recording to stop (the recording service is
|
|
592
|
+
* never created when the flag is on), no image encryption needed.
|
|
593
|
+
*
|
|
594
|
+
* Behavior depends on which capture path got us here:
|
|
595
|
+
*
|
|
596
|
+
* - **Auto-capture path**: the WASM `OnDeviceSelfiePipeline` has been
|
|
597
|
+
* consuming every video frame via `processFrame()` and aggregating
|
|
598
|
+
* results across them. When it picks a best-shot, the C++
|
|
599
|
+
* `OnDeviceSelfieWorkflow::createOnCaptureHandler` calls
|
|
600
|
+
* `WebApi::setFaceResults(...)` automatically — staging strong,
|
|
601
|
+
* aggregated `BestShotData` for the subsequent `postFaceResults` call.
|
|
602
|
+
* We must NOT call `processPhoto` here: `applyFaceResults` would
|
|
603
|
+
* overwrite that staged state with a weaker single-frame analysis of a
|
|
604
|
+
* post-capture snapshot (camera state has already changed: autocapture
|
|
605
|
+
* freeze, stream pause, post-detection latency), and the server then
|
|
606
|
+
* rejects the submission as "image quality too low".
|
|
607
|
+
*
|
|
608
|
+
* - **Manual-capture path**: the auto-capture timer expired without a
|
|
609
|
+
* successful best-shot, so the C++ pipeline has nothing staged. We
|
|
610
|
+
* need to run a single-frame analysis on the manually captured canvas
|
|
611
|
+
* via `processPhoto`, which itself calls
|
|
612
|
+
* `OnDeviceSelfieWorkflow::applyFaceResults` → `WebApi::setFaceResults`
|
|
613
|
+
* to stage results. Mirrors V1 (`packages/incode-welcome/src/camera/useSelfie.ts`)
|
|
614
|
+
* where `processPhoto` is only invoked from `handleManualCapture`.
|
|
615
|
+
*
|
|
616
|
+
* Returns sentinel values for `encryptedBase64Image` and `recordingId` so
|
|
617
|
+
* the existing FaceCaptureContext shape remains stable; downstream actors
|
|
618
|
+
* for the on-device path simply ignore them.
|
|
619
|
+
*/
|
|
620
|
+
async function prepareOnDeviceFaceUpload(ctx) {
|
|
621
|
+
if (!ctx.capturedImage) throw new Error("On-device capture requires a captured image canvas");
|
|
622
|
+
if (!ctx.provider) throw new Error("On-device capture requires the FaceDetectionProvider to be initialized");
|
|
623
|
+
if (ctx.manualCaptureTriggered) {
|
|
624
|
+
await yieldUntilNextPaint();
|
|
625
|
+
await sleep(350);
|
|
626
|
+
ctx.provider.processPhoto(ctx.capturedImage.canvas);
|
|
634
627
|
}
|
|
635
|
-
|
|
628
|
+
return {
|
|
629
|
+
encryptedBase64Image: "",
|
|
630
|
+
recordingId: null
|
|
631
|
+
};
|
|
632
|
+
}
|
|
633
|
+
/**
|
|
634
|
+
* POSTs the staged on-device face-results JSON to `/omni/add/face-results`
|
|
635
|
+
* through the WASM `WebApi`. Used as the `uploadFace` actor body for both
|
|
636
|
+
* selfie and auth variants when on-device mode is enabled.
|
|
637
|
+
*
|
|
638
|
+
* The C++ `WebApi` handles `SessionEncryptor` encryption and the actual
|
|
639
|
+
* HTTP via the WASM `WebClient` — so callers don't need to thread the
|
|
640
|
+
* session-encryption details through JS.
|
|
641
|
+
*/
|
|
642
|
+
async function postOnDeviceFaceResults(ctx, signal) {
|
|
643
|
+
const provider = ctx.provider;
|
|
644
|
+
if (!provider) throw new Error("On-device upload requires the FaceDetectionProvider to be initialized");
|
|
645
|
+
const sessionToken = getToken();
|
|
646
|
+
return await provider.postFaceResults({
|
|
647
|
+
headers: sessionToken ? { "X-Incode-Hardware-Id": sessionToken } : void 0,
|
|
648
|
+
timeout: 3e4
|
|
649
|
+
}) ?? {};
|
|
650
|
+
}
|
|
636
651
|
|
|
637
652
|
//#endregion
|
|
638
653
|
//#region src/internal/manualReview/manualReviewService.ts
|
|
@@ -898,12 +913,12 @@ var LocalRecordingProvider = class {
|
|
|
898
913
|
let openViduProviderImportPromise;
|
|
899
914
|
let openViduBrowserImportPromise;
|
|
900
915
|
function loadOpenViduProviderModule() {
|
|
901
|
-
if (!openViduProviderImportPromise) openViduProviderImportPromise = import("./OpenViduRecordingProvider-
|
|
916
|
+
if (!openViduProviderImportPromise) openViduProviderImportPromise = import("./OpenViduRecordingProvider-O4GjBseO.esm.js");
|
|
902
917
|
return openViduProviderImportPromise;
|
|
903
918
|
}
|
|
904
919
|
function loadOpenViduBrowserModule() {
|
|
905
920
|
if (!openViduBrowserImportPromise) openViduBrowserImportPromise = (async () => {
|
|
906
|
-
return (await import("./openviduLazy-
|
|
921
|
+
return (await import("./openviduLazy-B8L--0oe.esm.js")).loadOpenVidu();
|
|
907
922
|
})();
|
|
908
923
|
return openViduBrowserImportPromise;
|
|
909
924
|
}
|
|
@@ -922,9 +937,11 @@ var LocalRecordingService = class {
|
|
|
922
937
|
}
|
|
923
938
|
async start(stream) {
|
|
924
939
|
this.recorder.startRecording(stream);
|
|
940
|
+
this.wasmUtil.osv();
|
|
925
941
|
}
|
|
926
942
|
async stop() {
|
|
927
943
|
if (!this.recorder.isRecording) return { recordingId: null };
|
|
944
|
+
this.wasmUtil.oev();
|
|
928
945
|
const result = await this.recorder.stopRecording(10, (base64) => this.wasmUtil.encryptImage(base64), (buffer) => this.wasmUtil.ckvcks(buffer));
|
|
929
946
|
if (!this.sessionToken) return { recordingId: null };
|
|
930
947
|
return { recordingId: await uploadDeepsightVideo(result.encryptedVideo, this.sessionToken) };
|
|
@@ -932,6 +949,7 @@ var LocalRecordingService = class {
|
|
|
932
949
|
async stopAndGetVideo() {
|
|
933
950
|
if (!this.recorder.isRecording) return { videoBase64: void 0 };
|
|
934
951
|
try {
|
|
952
|
+
this.wasmUtil.oev();
|
|
935
953
|
const videoBase64 = (await this.recorder.stopRecording(10, (base64) => base64, () => {})).encryptedVideo;
|
|
936
954
|
return { videoBase64: videoBase64 ? videoBase64 : void 0 };
|
|
937
955
|
} catch {
|
|
@@ -1000,4 +1018,4 @@ function createRecordingService(params) {
|
|
|
1000
1018
|
}
|
|
1001
1019
|
|
|
1002
1020
|
//#endregion
|
|
1003
|
-
export {
|
|
1021
|
+
export { startRecording as _, defaultPrepareFaceUpload as a, prepareOnDeviceFaceUpload as c, sendLabelInspectionEvent as d, startDetection as f, createRecordingSession as g, uploadSelfie as h, flagIdManualReview as i, initializeCamera as l, processFace as m, preloadOpenViduProvider as n, isOnDeviceMode as o, stopStream as p, flagFaceManualReview as r, postOnDeviceFaceResults as s, createRecordingService as t, initializeDeepsightSession as u, stopRecording$1 as v, StreamCanvasProcessingSession as y };
|
|
@@ -1,107 +1,9 @@
|
|
|
1
|
-
import
|
|
2
|
-
import "./Actor-
|
|
1
|
+
import "./Manager-BHn8wH8K.js";
|
|
2
|
+
import "./Actor-Y0_Fj-KL.js";
|
|
3
|
+
import { a as RedirectToMobileActor, c as RedirectToMobileServices, i as createRedirectToMobileManagerFromActor, n as RedirectToMobileState, o as redirectToMobileMachine, r as createRedirectToMobileManager, s as RedirectToMobileConfig, t as RedirectToMobileManager } from "./redirectToMobileManager-BNe3IzC_.js";
|
|
3
4
|
|
|
4
|
-
//#region src/modules/redirect-to-mobile/
|
|
5
|
-
type RedirectToMobileConfig = {
|
|
6
|
-
flowId?: string;
|
|
7
|
-
url?: string;
|
|
8
|
-
disableSmsOption?: boolean;
|
|
9
|
-
addContinueToDesktop?: boolean;
|
|
10
|
-
qrPhishingResistance?: boolean;
|
|
11
|
-
authHint?: string;
|
|
12
|
-
externalId?: string;
|
|
13
|
-
lang?: string;
|
|
14
|
-
};
|
|
15
|
-
//#endregion
|
|
16
|
-
//#region src/modules/redirect-to-mobile/redirectToMobileStateMachine.d.ts
|
|
5
|
+
//#region src/modules/redirect-to-mobile/redirectToMobileServices.d.ts
|
|
17
6
|
|
|
18
|
-
declare const
|
|
19
|
-
//#endregion
|
|
20
|
-
//#region src/modules/redirect-to-mobile/redirectToMobileActor.d.ts
|
|
21
|
-
type CreateRedirectToMobileActorOptions = {
|
|
22
|
-
config: RedirectToMobileConfig;
|
|
23
|
-
};
|
|
24
|
-
//#endregion
|
|
25
|
-
//#region src/modules/redirect-to-mobile/redirectToMobileManager.d.ts
|
|
26
|
-
type RedirectToMobileIdleState = {
|
|
27
|
-
status: 'idle';
|
|
28
|
-
};
|
|
29
|
-
type RedirectToMobileLoadingState = {
|
|
30
|
-
status: 'loading';
|
|
31
|
-
};
|
|
32
|
-
type RedirectToMobileRedirectingState = {
|
|
33
|
-
status: 'redirecting';
|
|
34
|
-
redirectUrl: string;
|
|
35
|
-
phonePrefix: string;
|
|
36
|
-
smsSent: boolean;
|
|
37
|
-
error: string | undefined;
|
|
38
|
-
};
|
|
39
|
-
type RedirectToMobileFinishedState = {
|
|
40
|
-
status: 'finished';
|
|
41
|
-
};
|
|
42
|
-
type RedirectToMobileClosedState = {
|
|
43
|
-
status: 'closed';
|
|
44
|
-
};
|
|
45
|
-
type RedirectToMobileErrorState = {
|
|
46
|
-
status: 'error';
|
|
47
|
-
error: string;
|
|
48
|
-
};
|
|
49
|
-
type RedirectToMobileState = RedirectToMobileIdleState | RedirectToMobileLoadingState | RedirectToMobileRedirectingState | RedirectToMobileFinishedState | RedirectToMobileClosedState | RedirectToMobileErrorState;
|
|
50
|
-
/**
|
|
51
|
-
* Creates a redirect-to-mobile manager for cross-device onboarding flows.
|
|
52
|
-
*
|
|
53
|
-
* On desktop, displays a QR code (and optional SMS input) so the user can
|
|
54
|
-
* continue on their mobile device. Polls the backend until the mobile
|
|
55
|
-
* session completes, then transitions to `finished`.
|
|
56
|
-
*
|
|
57
|
-
* @param options - Configuration for the redirect module
|
|
58
|
-
* @returns A manager instance with state subscription and API methods
|
|
59
|
-
*
|
|
60
|
-
* @example
|
|
61
|
-
* ```ts
|
|
62
|
-
* const manager = createRedirectToMobileManager({
|
|
63
|
-
* config: { disableSmsOption: false, addContinueToDesktop: true },
|
|
64
|
-
* });
|
|
65
|
-
*
|
|
66
|
-
* manager.subscribe((state) => {
|
|
67
|
-
* if (state.status === 'redirecting') {
|
|
68
|
-
* renderQrCode(state.redirectUrl);
|
|
69
|
-
* }
|
|
70
|
-
* if (state.status === 'finished') {
|
|
71
|
-
* console.log('Mobile onboarding complete');
|
|
72
|
-
* }
|
|
73
|
-
* });
|
|
74
|
-
*
|
|
75
|
-
* manager.load();
|
|
76
|
-
* ```
|
|
77
|
-
*/
|
|
78
|
-
declare function createRedirectToMobileManager(options: CreateRedirectToMobileActorOptions): Manager<RedirectToMobileState> & {
|
|
79
|
-
/**
|
|
80
|
-
* Starts the redirect-to-mobile flow by fetching the redirect URL.
|
|
81
|
-
*/
|
|
82
|
-
load(): void;
|
|
83
|
-
/**
|
|
84
|
-
* Sends an SMS with the redirect link to the given phone number.
|
|
85
|
-
* @param phone - Full phone number with country code
|
|
86
|
-
*/
|
|
87
|
-
sendSms(phone: string): void;
|
|
88
|
-
/**
|
|
89
|
-
* Skips the redirect and allows the user to continue on desktop.
|
|
90
|
-
*/
|
|
91
|
-
continueOnDesktop(): void;
|
|
92
|
-
/**
|
|
93
|
-
* Resets the SMS state so the user can re-enter their phone number.
|
|
94
|
-
*/
|
|
95
|
-
resetSms(): void;
|
|
96
|
-
/**
|
|
97
|
-
* Closes/dismisses the redirect screen.
|
|
98
|
-
*/
|
|
99
|
-
close(): void;
|
|
100
|
-
/**
|
|
101
|
-
* Retries generating the redirect URL after an error.
|
|
102
|
-
*/
|
|
103
|
-
retry(): void;
|
|
104
|
-
};
|
|
105
|
-
type RedirectToMobileManager = ReturnType<typeof createRedirectToMobileManager>;
|
|
7
|
+
declare const defaultRedirectToMobileServices: RedirectToMobileServices;
|
|
106
8
|
//#endregion
|
|
107
|
-
export { type RedirectToMobileConfig, type RedirectToMobileManager, type RedirectToMobileState, createRedirectToMobileManager, redirectToMobileMachine };
|
|
9
|
+
export { type RedirectToMobileActor, type RedirectToMobileConfig, type RedirectToMobileManager, type RedirectToMobileServices, type RedirectToMobileState, createRedirectToMobileManager, createRedirectToMobileManagerFromActor, defaultRedirectToMobileServices, redirectToMobileMachine };
|