@incodetech/core 2.1.0-rc.1 → 2.1.0-rc.3
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/3dAvatarProvider-ChciZmjE.esm.js +28214 -0
- package/dist/{BrowserStorageProvider-BpJM-gIl.esm.js → BrowserStorageProvider-CrrN540a.esm.js} +1 -8
- package/dist/BrowserVisibilityObserverProvider-rim9Jrz-.esm.js +25 -0
- package/dist/Face2DProvider-BeLlYBbB.esm.js +824 -0
- package/dist/FaceDetectionProvider-B78455D4.d.ts +119 -0
- package/dist/IVisibilityObserverCapability-BbWjgpiF.d.ts +12 -0
- package/dist/IWasmUtilCapability-d2XvzaCk.d.ts +145 -0
- package/dist/IpifyProvider-BRW14_uo.esm.js +51 -0
- package/dist/{OpenViduRecordingProvider-O4GjBseO.esm.js → OpenViduRecordingProvider-B_0GKkzc.esm.js} +1 -1
- package/dist/PrivacyLensProvider-hDzaDzZ6.esm.js +339 -0
- package/dist/{StreamCanvasCapture-ImiDQdVA.esm.js → StreamCanvasCapture-Bz17q4FP.esm.js} +1 -1
- package/dist/StreamCanvasCapture-DS1TOoiH.d.ts +42 -0
- package/dist/{WasmUtilProvider-BKWm8rSA.esm.js → WasmUtilProvider-ADG54T6M.esm.js} +26 -2
- package/dist/{addressSearch-DvmWXKZg.esm.js → addressSearch-DJyNTg5S.esm.js} +4 -4
- package/dist/{ae-signature-BFZta3TZ.esm.js → ae-signature-DlElqFrZ.esm.js} +1 -1
- package/dist/ae-signature.d.ts +4 -3
- package/dist/ae-signature.esm.js +10 -7
- package/dist/antifraud.d.ts +4 -3
- package/dist/antifraud.esm.js +7 -6
- package/dist/antifraudManager-BKdQoMFf.esm.js +84 -0
- package/dist/{antifraudManager-CznnhyvD.d.ts → antifraudManager-DpIvbrZP.d.ts} +2 -2
- package/dist/{antifraudStateMachine-Ccrb-Jxc.esm.js → antifraudStateMachine-C0NGnP9W.esm.js} +3 -3
- package/dist/{api-CESGtpbH.esm.js → api-DsbUi7TO.esm.js} +21 -2
- package/dist/authentication.d.ts +19 -13
- package/dist/authentication.esm.js +33 -27
- package/dist/{authenticationManager-CaiQbp-q.d.ts → authenticationManager-CdPbNS2H.d.ts} +13 -3
- package/dist/{authenticationManager-BlR6mSaG.esm.js → authenticationManager-Dtl1vcET.esm.js} +17 -8
- package/dist/{authenticationStateMachine-DkcGUMw5.esm.js → authenticationStateMachine-D-hOlg8p.esm.js} +20 -23
- package/dist/avatar.d.ts +3 -0
- package/dist/avatar.esm.js +3 -0
- package/dist/{backCameraStream-D7Wo4Nbx.esm.js → backCameraStream-ZyqrFyjO.esm.js} +3 -3
- package/dist/browser-DlFgHpoC-qLKs75Qp.esm.js +1425 -0
- package/dist/{browserSimulation-B1dWiXp7.esm.js → browserSimulation-TsSoavQv.esm.js} +153 -1216
- package/dist/camera-DUkgmYMo.esm.js +79 -0
- package/dist/camera.d.ts +7 -1
- package/dist/camera.esm.js +4 -4
- package/dist/{StreamCanvasCapture-yyl20qd9.d.ts → canvas-CJUmoXSD.d.ts} +1 -41
- package/dist/certificate-issuance.d.ts +312 -0
- package/dist/certificate-issuance.esm.js +74 -0
- package/dist/certificateIssuanceStateMachine-C07m7qtP.esm.js +127 -0
- package/dist/clientLifecycle-Ct7h9uxx.esm.js +534 -0
- package/dist/consent.d.ts +4 -3
- package/dist/consent.esm.js +7 -6
- package/dist/{consentManager-BYo9Nu1r.esm.js → consentManager-BtnPZUW4.esm.js} +30 -5
- package/dist/{consentManager-Cg5Sk2tv.d.ts → consentManager-DufVo9D9.d.ts} +55 -55
- package/dist/{consentStateMachine-BG3yL8aC.esm.js → consentStateMachine-DO2JqoZW.esm.js} +3 -3
- package/dist/cpf-ocr.d.ts +4 -3
- package/dist/cpf-ocr.esm.js +7 -6
- package/dist/{cpfOcrManager-sSKegxox.esm.js → cpfOcrManager-C4rLgKsu.esm.js} +6 -5
- package/dist/{cpfOcrManager-Dg1s_TY5.d.ts → cpfOcrManager-DqZZ94Gt.d.ts} +19 -19
- package/dist/createFaceAvatar-B8pFpy6o.d.ts +401 -0
- package/dist/createFaceAvatar-BOHDKQRq.esm.js +46 -0
- package/dist/cross-document-data-match.d.ts +2 -1
- package/dist/cross-document-data-match.esm.js +6 -5
- package/dist/curp-validation.d.ts +10 -7
- package/dist/curp-validation.esm.js +7 -6
- package/dist/{curpValidationManager-CFem6zP9.esm.js → curpValidationManager-BafobPXC.esm.js} +52 -5
- package/dist/{curpValidationManager-RttixpIc.d.ts → curpValidationManager-Co6LZAHT.d.ts} +4 -3
- package/dist/{curpValidationStateMachine-B7V_qp66.esm.js → curpValidationStateMachine-DXTPK6vI.esm.js} +3 -3
- package/dist/custom-fields.d.ts +4 -2
- package/dist/custom-fields.esm.js +49 -6
- package/dist/custom-watchlist.d.ts +2 -1
- package/dist/custom-watchlist.esm.js +27 -6
- package/dist/{customWatchlistStateMachine-HmFybXLX.esm.js → customWatchlistStateMachine-B4G3Chkx.esm.js} +3 -3
- package/dist/{deepsightLoader-8tnddNx-.esm.js → deepsightLoader-DHSVD776.esm.js} +14 -13
- package/dist/{deepsightService-CrHmvx8X.esm.js → deepsightService-CDahSjGP.esm.js} +9 -38
- package/dist/deepsightService-CMB9XjES.d.ts +69 -0
- package/dist/device.d.ts +9 -1
- package/dist/device.esm.js +5 -5
- package/dist/document-capture.d.ts +178 -177
- package/dist/document-capture.esm.js +78 -14
- package/dist/document-upload.d.ts +51 -50
- package/dist/document-upload.esm.js +10 -9
- package/dist/{documentCaptureStateMachine-CUTUzUw_.esm.js → documentCaptureStateMachine-DSOX2epf.esm.js} +7 -7
- package/dist/dynamic-forms.d.ts +4 -192
- package/dist/dynamic-forms.esm.js +8 -410
- package/dist/dynamicFormsManager-BOefZbyF.esm.js +168 -0
- package/dist/dynamicFormsManager-CUYLOj9g.d.ts +239 -0
- package/dist/dynamicFormsStateMachine-BXHcaocI.esm.js +284 -0
- package/dist/ekyb.d.ts +10 -6
- package/dist/ekyb.esm.js +62 -17
- package/dist/{ekybStateMachine-klc-AImJ.esm.js → ekybStateMachine-CCSeqjCt.esm.js} +5 -5
- package/dist/ekyc.d.ts +5 -3
- package/dist/ekyc.esm.js +55 -9
- package/dist/{ekycStateMachine-CXbpaJJn.esm.js → ekycStateMachine-DkLVTOyA.esm.js} +5 -5
- package/dist/electronic-signature.d.ts +4 -3
- package/dist/electronic-signature.esm.js +9 -6
- package/dist/{electronicSignatureManager-BaECdJ1u.esm.js → electronicSignatureManager-DjzUzqZj.esm.js} +135 -92
- package/dist/email.d.ts +5 -4
- package/dist/email.esm.js +9 -8
- package/dist/{emailManager--D5G3ChB.esm.js → emailManager-B_XzEsXH.esm.js} +47 -6
- package/dist/{emailManager-lAzDoQOs.d.ts → emailManager-fHASH6uo.d.ts} +4 -3
- package/dist/{emailStateMachine-CxTOMAjC.esm.js → emailStateMachine-fqJ42b19.esm.js} +5 -5
- package/dist/{endpoints-BeTK0Mlt.esm.js → endpoints-BzMJFAPV.esm.js} +15 -0
- package/dist/{events-Dvvriq9l.esm.js → events-CqGY1yMq.esm.js} +87 -206
- package/dist/events.d.ts +23 -16
- package/dist/events.esm.js +3 -2
- package/dist/extensibility.d.ts +37 -27
- package/dist/extensibility.esm.js +74 -57
- package/dist/externalFetch-CyhBfD-n.esm.js +22 -0
- package/dist/face-match.d.ts +2 -2
- package/dist/face-match.esm.js +6 -5
- package/dist/{faceCaptureManagerFactory-ej2j1LMr.esm.js → faceCaptureManagerFactory-2brKTzMb.esm.js} +115 -25
- package/dist/faceCaptureManagerFactory-CGKbf7zt.d.ts +400 -0
- package/dist/{faceCaptureSetup-B9t6bYze.esm.js → faceCaptureSetup-CDUVU1nl.esm.js} +97 -13
- package/dist/{faceMatchStateMachine-DeXXzSuz.esm.js → faceMatchStateMachine-DUeUjEPx.esm.js} +3 -3
- package/dist/field-comparison.d.ts +4 -3
- package/dist/field-comparison.esm.js +6 -5
- package/dist/{fieldComparisonManager-COGI2ARD.esm.js → fieldComparisonManager-B9W0a9A5.esm.js} +5 -4
- package/dist/{fieldComparisonManager-Bu5TaSr3.d.ts → fieldComparisonManager-DdLqDeB2.d.ts} +2 -2
- package/dist/fiscal-qr.d.ts +5 -3
- package/dist/fiscal-qr.esm.js +13 -12
- package/dist/flow-events.d.ts +8 -6
- package/dist/flow.d.ts +34 -16
- package/dist/flow.esm.js +53 -30
- package/dist/flowCompletionService-BIqSTZcd.d.ts +28 -0
- package/dist/flowCompletionService-qEqh_g14.esm.js +42 -0
- package/dist/{flowServices-ChgTNggJ.esm.js → flowServices-C4piblgx.esm.js} +24 -9
- package/dist/geolocation.d.ts +4 -126
- package/dist/geolocation.esm.js +8 -87
- package/dist/geolocationManager-BP2Do9O-.esm.js +123 -0
- package/dist/geolocationManager-Cs50eRlC.d.ts +156 -0
- package/dist/{geolocationStateMachine-Dvh7X0wF.esm.js → geolocationStateMachine-BYfOOOG0.esm.js} +4 -4
- package/dist/{getDeviceClass-C8Do2qYu.esm.js → getDeviceClass-DGGzzfqm.esm.js} +1 -1
- package/dist/getDeviceData-TrKM8NPh.esm.js +101 -0
- package/dist/government-validation.d.ts +4 -3
- package/dist/government-validation.esm.js +43 -8
- package/dist/{governmentValidationStateMachine-DcJ-BfsC.esm.js → governmentValidationStateMachine-CwoPPO8b.esm.js} +5 -5
- package/dist/home.d.ts +18 -15
- package/dist/home.esm.js +5 -4
- package/dist/http.d.ts +1 -0
- package/dist/http.esm.js +2 -2
- package/dist/id-ocr.d.ts +4 -625
- package/dist/id-ocr.esm.js +8 -84
- package/dist/id-verification.d.ts +28 -27
- package/dist/id-verification.esm.js +6 -5
- package/dist/id.d.ts +24 -13
- package/dist/id.esm.js +48 -33
- package/dist/idCaptureDefaults-DNJON8Xo.esm.js +188 -0
- package/dist/{idCaptureManager-ChCNmgBj.d.ts → idCaptureManager-BVdvfJys.d.ts} +47 -12
- package/dist/{idCaptureManager-D3pwWutw.esm.js → idCaptureManager-Bo9DCQSU.esm.js} +100 -15
- package/dist/{idCaptureStateMachine-B3AiDIsT.esm.js → idCaptureStateMachine-BeDidMLU.esm.js} +525 -439
- package/dist/idOcrManager-BkRDrpZu.esm.js +92 -0
- package/dist/idOcrManager-CJzrmM91.d.ts +641 -0
- package/dist/{idOcrStateMachine-CDQ5d_VM.esm.js → idOcrStateMachine-DRZc4FBl.esm.js} +5 -5
- package/dist/{idVerificationStateMachine-kRxwImzO.esm.js → idVerificationStateMachine-oqiERKpg.esm.js} +3 -3
- package/dist/identity-reuse.d.ts +4 -3
- package/dist/identity-reuse.esm.js +7 -6
- package/dist/{identityReuseManager-C6n_97dw.esm.js → identityReuseManager-Bu62LToE.esm.js} +4 -3
- package/dist/{identityReuseManager-Cww-NDtd.d.ts → identityReuseManager-TWKbXuvY.d.ts} +33 -33
- package/dist/{identityReuseStateMachine-BfE5YiEr.esm.js → identityReuseStateMachine-BmONeF6B.esm.js} +3 -3
- package/dist/{index-B5hPA0Bg.d.ts → index-DtUlD-bz.d.ts} +2 -2
- package/dist/{index-B9NysVDB.d.ts → index-Icld-cKW.d.ts} +175 -295
- package/dist/index-XTtxaahe.d.ts +93 -0
- package/dist/index.d.ts +3 -2
- package/dist/index.esm.js +16 -12
- package/dist/{invokeOnCaptureCallback-ygByVdnn.esm.js → invokeOnCaptureCallback-v_PV_IJz.esm.js} +1 -1
- package/dist/{lib-BY67lgbq.esm.js → lib-B050WTth.esm.js} +1 -1
- package/dist/mandatory-consent.d.ts +10 -7
- package/dist/mandatory-consent.esm.js +7 -6
- package/dist/{mandatoryConsentManager-Dq6WiOZh.d.ts → mandatoryConsentManager-Bmdjo14S.d.ts} +50 -50
- package/dist/{mandatoryConsentManager-H6D18cZB.esm.js → mandatoryConsentManager-CQ3jirlZ.esm.js} +4 -3
- package/dist/{mandatoryConsentStateMachine-DtQNW1ji.esm.js → mandatoryConsentStateMachine-DkJJLHqC.esm.js} +3 -3
- package/dist/mediaRecorderOptions-C3NAkVgK.esm.js +42 -0
- package/dist/mediapipeShared-CRAKVElv.esm.js +67 -0
- package/dist/{recordingService-yRw7hfzU.esm.js → onDeviceFaceResults-DVBggeq8.esm.js} +71 -389
- package/dist/{openviduLazy-Dh14JNJc.esm.js → openviduLazy-BTOIauGP.esm.js} +2 -2
- package/dist/openviduLazy-Dov8oKfL.esm.js +3 -0
- package/dist/{permissionGuards-D0wGddy7.esm.js → permissionGuards-BR2oN573.esm.js} +1 -1
- package/dist/{permissionServices-Doec4X5L.esm.js → permissionServices-BJhGL13R.esm.js} +7 -4
- package/dist/personhood.d.ts +534 -0
- package/dist/personhood.esm.js +1494 -0
- package/dist/phone.d.ts +5 -4
- package/dist/phone.esm.js +9 -8
- package/dist/{phoneManager-fPmIBYQK.d.ts → phoneManager-BOTcjXgs.d.ts} +4 -3
- package/dist/{phoneManager-BmF-0Ez4.esm.js → phoneManager-BWlxqbyD.esm.js} +48 -6
- package/dist/{phoneStateMachine-BiV0yoEx.esm.js → phoneStateMachine-B_V9nODs.esm.js} +5 -5
- package/dist/{qe-signature-CUYPcHVo.esm.js → qe-signature-BhFnI9pT.esm.js} +1 -1
- package/dist/qe-signature.d.ts +4 -3
- package/dist/qe-signature.esm.js +10 -7
- package/dist/recordingService-m_1xCthr.esm.js +347 -0
- package/dist/redirect-to-mobile.d.ts +4 -3
- package/dist/redirect-to-mobile.esm.js +9 -7
- package/dist/{redirectToMobileManager-Dy3t7o0C.esm.js → redirectToMobileManager-BaAo9rgi.esm.js} +5 -4
- package/dist/{redirectToMobileManager-BNe3IzC_.d.ts → redirectToMobileManager-Br0KZK1G.d.ts} +2 -2
- package/dist/{redirectToMobileStateMachine-DyAdRxfP.esm.js → redirectToMobileStateMachine-DoAnf2ql.esm.js} +16 -28
- package/dist/{runChildModule-CuoHZ1cx.esm.js → runChildModule-0nQfjVVo.esm.js} +14 -24
- package/dist/selfie.d.ts +27 -14
- package/dist/selfie.esm.js +43 -30
- package/dist/{selfieManager-BNuTIGAz.esm.js → selfieManager-D_ZFERsE.esm.js} +17 -8
- package/dist/{selfieManager-C2y_t6DG.d.ts → selfieManager-R0Jw5sjb.d.ts} +13 -3
- package/dist/{selfieStateMachine-Bv99bZJE.esm.js → selfieStateMachine-CIgeeiN9.esm.js} +4 -4
- package/dist/{session-DoVb-OcB.esm.js → session-9jIfKFCc.esm.js} +3 -3
- package/dist/session.d.ts +11 -8
- package/dist/session.esm.js +16 -12
- package/dist/{sessionInitializer-DRB-hgbV.esm.js → sessionInitializer-C_TYIgyk.esm.js} +16 -109
- package/dist/{setup-BwCluiw3.d.ts → setup-CpRnXxn8.d.ts} +61 -2
- package/dist/setup-DHc6OaHm.esm.js +562 -0
- package/dist/signature.d.ts +4 -2
- package/dist/signature.esm.js +49 -6
- package/dist/{signatureStateMachine-C5qqYLRz.esm.js → signatureStateMachine-DtoiPzys.esm.js} +21 -39
- package/dist/{stats-BMNUG1AU.esm.js → stats-CYcScXcO.esm.js} +2 -2
- package/dist/stats.esm.js +3 -3
- package/dist/thumbmarkAdapter-fHBUDlAP.esm.js +1194 -0
- package/dist/tri-BG1iJsr4.esm.js +399 -0
- package/dist/tri.d.ts +2 -0
- package/dist/tri.esm-DUC01NgO.esm.js +2593 -0
- package/dist/tri.esm.js +4 -0
- package/dist/trust-graph.d.ts +4 -3
- package/dist/trust-graph.esm.js +4 -3
- package/dist/{types-NuT8ftBV.d.ts → types-BklZ_Wne.d.ts} +2 -1
- package/dist/{types-DOUhndhT.d.ts → types-BsYXnC5s.d.ts} +39 -3
- package/dist/{types-DsnEVMhr.esm.js → types-CMcxlSmH.esm.js} +2 -1
- package/dist/types-CxW2e0Ar.d.ts +132 -0
- package/dist/{types-Bj9hdFjU.d.ts → types-DgGlgyZT.d.ts} +1 -1
- package/dist/types-ElOJAGaM.esm.js +189 -0
- package/dist/urlUtils-BZqFU9rR.esm.js +16 -0
- package/dist/video-C2WIj6TS.esm.js +36 -0
- package/dist/video-selfie.d.ts +351 -0
- package/dist/video-selfie.esm.js +1509 -0
- package/dist/videoSelfieSteps-7M5vxKn-.esm.js +58 -0
- package/dist/{warmup-Dg8Lh-50.d.ts → warmup-BJZPQIiX.d.ts} +5 -1
- package/dist/wasm.d.ts +4 -3
- package/dist/wasm.esm.js +17 -13
- package/dist/watchlist-for-business.d.ts +2 -1
- package/dist/watchlist-for-business.esm.js +30 -7
- package/dist/watchlist.d.ts +2 -1
- package/dist/watchlist.esm.js +28 -6
- package/dist/{watchlistForBusinessStateMachine-DMl8j2Ov.esm.js → watchlistForBusinessStateMachine-DvEunDxs.esm.js} +3 -3
- package/dist/{watchlistStateMachine-DmQlqI6L.esm.js → watchlistStateMachine-AHXVf-TB.esm.js} +3 -3
- package/dist/workflow.d.ts +296 -103
- package/dist/workflow.esm.js +137 -74
- package/dist/{xstate.esm-C9wncMQa.esm.js → xstate.esm-Bomq1a0z.esm.js} +54 -5
- package/package.json +26 -1
- package/dist/IpifyProvider-D4LWD15E.esm.js +0 -167
- package/dist/antifraudManager-CkV4u-LE.esm.js +0 -55
- package/dist/camera-DJWm3V4g.esm.js +0 -22
- package/dist/deepsightService-Dh5P-hLf.d.ts +0 -265
- package/dist/faceCaptureManagerFactory-CjdBUS6s.d.ts +0 -721
- package/dist/flowCompletionService-BdR2cGgB.d.ts +0 -19
- package/dist/flowCompletionService-DdGojV9K.esm.js +0 -20
- package/dist/getBrowser-C8DP7oTB.esm.js +0 -8
- package/dist/openviduLazy-B8L--0oe.esm.js +0 -3
- package/dist/setup-CUO4mErT.esm.js +0 -1037
- /package/dist/{Actor-Y0_Fj-KL.d.ts → Actor-CGEelYtQ.d.ts} +0 -0
- /package/dist/{BrowserTimerProvider-DhNc_x02.esm.js → BrowserTimerProvider-CHloo0eQ.esm.js} +0 -0
- /package/dist/{ITimerCapability-CB0I1Uf2.esm.js → ITimerCapability-pltuG1E8.esm.js} +0 -0
- /package/dist/{Manager-BHn8wH8K.d.ts → Manager-CJ3G2zqi.d.ts} +0 -0
- /package/dist/{MotionSensorProvider-Bx7Mpzt0.esm.js → MotionSensorProvider-DCbId4De.esm.js} +0 -0
- /package/dist/{StateMachine-BC_nGvrc.d.ts → StateMachine-C_AY4cs7.d.ts} +0 -0
- /package/dist/{apiError-B-j-gyDx.esm.js → apiError-DNS2OCEX.esm.js} +0 -0
- /package/dist/{camera-SRBpPq2X.d.ts → camera-CNVUo-bC.d.ts} +0 -0
- /package/dist/{canvas-SKcRBxsk.esm.js → canvas-_I95hkPg.esm.js} +0 -0
- /package/dist/{chunk-CMUKZ2uL.esm.js → chunk-CIKcdghV.esm.js} +0 -0
- /package/dist/{cpf-BRzggV8G.esm.js → cpf-BKaho0j_.esm.js} +0 -0
- /package/dist/{dateUtils-AksLQmgV.esm.js → dateUtils-7-tQYRNN.esm.js} +0 -0
- /package/dist/{getDeviceClass-C0olyNFS.esm.js → getDeviceClass-DavNdcxh.esm.js} +0 -0
- /package/dist/{http-Cai3IoLS.esm.js → http-BkiUT7EB.esm.js} +0 -0
- /package/dist/{otp-CGMdUzBC.esm.js → otp-Bfnzf7I3.esm.js} +0 -0
- /package/dist/{otp-DF5A0sFx.d.ts → otp-M4iy57XY.d.ts} +0 -0
- /package/dist/{platform-SKvEfCBh.esm.js → platform-uIVQUnJP.esm.js} +0 -0
- /package/dist/{types-DvGZI7BF.d.ts → types-D_IceWxT.d.ts} +0 -0
- /package/dist/{types-ya0LN_MX.d.ts → types-Duy2rDxF.d.ts} +0 -0
package/dist/id-ocr.esm.js
CHANGED
|
@@ -1,86 +1,10 @@
|
|
|
1
|
-
import "./api-
|
|
2
|
-
import
|
|
3
|
-
import "./
|
|
4
|
-
import
|
|
5
|
-
import "./
|
|
6
|
-
import
|
|
1
|
+
import "./api-DsbUi7TO.esm.js";
|
|
2
|
+
import "./events-CqGY1yMq.esm.js";
|
|
3
|
+
import "./types-ElOJAGaM.esm.js";
|
|
4
|
+
import "./endpoints-BzMJFAPV.esm.js";
|
|
5
|
+
import "./xstate.esm-Bomq1a0z.esm.js";
|
|
6
|
+
import "./cpf-BKaho0j_.esm.js";
|
|
7
|
+
import { a as MIN_AGE, i as CPFFlowIds, n as OCR_FIELDS, r as getOcrFields, t as idOcrStateMachine } from "./idOcrStateMachine-DRZc4FBl.esm.js";
|
|
8
|
+
import { t as createIdOcrManager } from "./idOcrManager-BkRDrpZu.esm.js";
|
|
7
9
|
|
|
8
|
-
//#region src/modules/id-ocr/idOcrActor.ts
|
|
9
|
-
function createIdOcrActor(options) {
|
|
10
|
-
return createActor(idOcrStateMachine, { input: { config: options.config } }).start();
|
|
11
|
-
}
|
|
12
|
-
|
|
13
|
-
//#endregion
|
|
14
|
-
//#region src/modules/id-ocr/idOcrManager.ts
|
|
15
|
-
function mapState(snapshot) {
|
|
16
|
-
const { context } = snapshot;
|
|
17
|
-
const editableOcr = context.config.editableOcr === true;
|
|
18
|
-
if (snapshot.matches("idle")) return { status: "idle" };
|
|
19
|
-
if (snapshot.matches("loading")) return {
|
|
20
|
-
status: "loading",
|
|
21
|
-
ocrDocument: context.activeOcrDocument
|
|
22
|
-
};
|
|
23
|
-
if (snapshot.matches("readonly")) return {
|
|
24
|
-
status: "readonly",
|
|
25
|
-
formData: context.formData,
|
|
26
|
-
editableOcr,
|
|
27
|
-
ocrDocument: context.activeOcrDocument
|
|
28
|
-
};
|
|
29
|
-
if (snapshot.matches("inputting")) return {
|
|
30
|
-
status: "inputting",
|
|
31
|
-
formData: context.formData,
|
|
32
|
-
editedFields: context.editedFields,
|
|
33
|
-
editableOcr,
|
|
34
|
-
ocrDocument: context.activeOcrDocument,
|
|
35
|
-
validationErrors: context.validationErrors
|
|
36
|
-
};
|
|
37
|
-
if (snapshot.matches("submitting")) return {
|
|
38
|
-
status: "submitting",
|
|
39
|
-
ocrDocument: context.activeOcrDocument
|
|
40
|
-
};
|
|
41
|
-
if (snapshot.matches("success")) return { status: "success" };
|
|
42
|
-
if (snapshot.matches("finished")) return { status: "finished" };
|
|
43
|
-
if (snapshot.matches("error")) return {
|
|
44
|
-
status: "error",
|
|
45
|
-
error: context.error ?? "Unknown error"
|
|
46
|
-
};
|
|
47
|
-
return { status: "idle" };
|
|
48
|
-
}
|
|
49
|
-
function createApi({ actor, trackElementClicked }) {
|
|
50
|
-
return {
|
|
51
|
-
load() {
|
|
52
|
-
actor.send({ type: "LOAD" });
|
|
53
|
-
},
|
|
54
|
-
setField(field, value) {
|
|
55
|
-
actor.send({
|
|
56
|
-
type: "DATA_CHANGED",
|
|
57
|
-
field,
|
|
58
|
-
value
|
|
59
|
-
});
|
|
60
|
-
},
|
|
61
|
-
validateField(field) {
|
|
62
|
-
actor.send({
|
|
63
|
-
type: "VALIDATE_FIELD",
|
|
64
|
-
field
|
|
65
|
-
});
|
|
66
|
-
},
|
|
67
|
-
continue() {
|
|
68
|
-
actor.send({ type: "CONTINUE" });
|
|
69
|
-
trackElementClicked?.("continue");
|
|
70
|
-
},
|
|
71
|
-
retry() {
|
|
72
|
-
actor.send({ type: "RETRY" });
|
|
73
|
-
}
|
|
74
|
-
};
|
|
75
|
-
}
|
|
76
|
-
function createIdOcrManager(options) {
|
|
77
|
-
return createManager({
|
|
78
|
-
actor: createIdOcrActor(options),
|
|
79
|
-
mapState,
|
|
80
|
-
createApi,
|
|
81
|
-
instrumentation: createManagerInstrumentation(eventModuleNames.idOcr)
|
|
82
|
-
});
|
|
83
|
-
}
|
|
84
|
-
|
|
85
|
-
//#endregion
|
|
86
10
|
export { CPFFlowIds, MIN_AGE, OCR_FIELDS, createIdOcrManager, getOcrFields, idOcrStateMachine };
|
|
@@ -1,6 +1,7 @@
|
|
|
1
|
-
import
|
|
2
|
-
import "./
|
|
3
|
-
import
|
|
1
|
+
import "./StateMachine-C_AY4cs7.js";
|
|
2
|
+
import { t as Manager } from "./Manager-CJ3G2zqi.js";
|
|
3
|
+
import "./Actor-CGEelYtQ.js";
|
|
4
|
+
import * as xstate836 from "xstate";
|
|
4
5
|
|
|
5
6
|
//#region src/modules/id-verification/types.d.ts
|
|
6
7
|
type IdVerificationConfig = {
|
|
@@ -32,26 +33,26 @@ type IdVerificationContext = {
|
|
|
32
33
|
type IdVerificationInput = {
|
|
33
34
|
config: IdVerificationConfig;
|
|
34
35
|
};
|
|
35
|
-
declare const idVerificationMachine:
|
|
36
|
+
declare const idVerificationMachine: xstate836.StateMachine<IdVerificationContext, {
|
|
36
37
|
type: "LOAD";
|
|
37
38
|
} | {
|
|
38
39
|
type: "CONTINUE";
|
|
39
40
|
}, {
|
|
40
|
-
[x: string]:
|
|
41
|
+
[x: string]: xstate836.ActorRefFromLogic<xstate836.PromiseActorLogic<ProcessIdResponse, {
|
|
41
42
|
isSecondId: boolean;
|
|
42
43
|
queueName: string;
|
|
43
|
-
},
|
|
44
|
+
}, xstate836.EventObject>> | undefined;
|
|
44
45
|
}, {
|
|
45
46
|
src: "processId";
|
|
46
|
-
logic:
|
|
47
|
+
logic: xstate836.PromiseActorLogic<ProcessIdResponse, {
|
|
47
48
|
isSecondId: boolean;
|
|
48
49
|
queueName: string;
|
|
49
|
-
},
|
|
50
|
+
}, xstate836.EventObject>;
|
|
50
51
|
id: string | undefined;
|
|
51
52
|
}, never, {
|
|
52
53
|
type: "isDocumentExpired";
|
|
53
54
|
params: unknown;
|
|
54
|
-
}, never, "idle" | "processing" | "finished" | "expired", string, IdVerificationInput,
|
|
55
|
+
}, never, "idle" | "processing" | "finished" | "expired", string, IdVerificationInput, xstate836.NonReducibleUnknown, xstate836.EventObject, xstate836.MetaObject, {
|
|
55
56
|
readonly id: "idVerification";
|
|
56
57
|
readonly initial: "idle";
|
|
57
58
|
readonly context: ({
|
|
@@ -60,50 +61,50 @@ declare const idVerificationMachine: xstate654.StateMachine<IdVerificationContex
|
|
|
60
61
|
spawn: {
|
|
61
62
|
<TSrc extends "processId">(logic: TSrc, ...[options]: {
|
|
62
63
|
src: "processId";
|
|
63
|
-
logic:
|
|
64
|
+
logic: xstate836.PromiseActorLogic<ProcessIdResponse, {
|
|
64
65
|
isSecondId: boolean;
|
|
65
66
|
queueName: string;
|
|
66
|
-
},
|
|
67
|
+
}, xstate836.EventObject>;
|
|
67
68
|
id: string | undefined;
|
|
68
69
|
} extends infer T ? T extends {
|
|
69
70
|
src: "processId";
|
|
70
|
-
logic:
|
|
71
|
+
logic: xstate836.PromiseActorLogic<ProcessIdResponse, {
|
|
71
72
|
isSecondId: boolean;
|
|
72
73
|
queueName: string;
|
|
73
|
-
},
|
|
74
|
+
}, xstate836.EventObject>;
|
|
74
75
|
id: string | undefined;
|
|
75
76
|
} ? T extends {
|
|
76
77
|
src: TSrc;
|
|
77
|
-
} ?
|
|
78
|
+
} ? xstate836.ConditionalRequired<[options?: ({
|
|
78
79
|
id?: T["id"] | undefined;
|
|
79
80
|
systemId?: string;
|
|
80
|
-
input?:
|
|
81
|
+
input?: xstate836.InputFrom<T["logic"]> | undefined;
|
|
81
82
|
syncSnapshot?: boolean;
|
|
82
|
-
} & { [K in
|
|
83
|
+
} & { [K in xstate836.RequiredActorOptions<T>]: unknown }) | undefined], xstate836.IsNotNever<xstate836.RequiredActorOptions<T>>> : never : never : never): xstate836.ActorRefFromLogic<xstate836.GetConcreteByKey<{
|
|
83
84
|
src: "processId";
|
|
84
|
-
logic:
|
|
85
|
+
logic: xstate836.PromiseActorLogic<ProcessIdResponse, {
|
|
85
86
|
isSecondId: boolean;
|
|
86
87
|
queueName: string;
|
|
87
|
-
},
|
|
88
|
+
}, xstate836.EventObject>;
|
|
88
89
|
id: string | undefined;
|
|
89
90
|
}, "src", TSrc>["logic"]>;
|
|
90
|
-
<TLogic extends
|
|
91
|
+
<TLogic extends xstate836.AnyActorLogic>(src: TLogic, ...[options]: xstate836.ConditionalRequired<[options?: ({
|
|
91
92
|
id?: never;
|
|
92
93
|
systemId?: string;
|
|
93
|
-
input?:
|
|
94
|
+
input?: xstate836.InputFrom<TLogic> | undefined;
|
|
94
95
|
syncSnapshot?: boolean;
|
|
95
|
-
} & { [K in
|
|
96
|
+
} & { [K in xstate836.RequiredLogicInput<TLogic>]: unknown }) | undefined], xstate836.IsNotNever<xstate836.RequiredLogicInput<TLogic>>>): xstate836.ActorRefFromLogic<TLogic>;
|
|
96
97
|
};
|
|
97
98
|
input: IdVerificationInput;
|
|
98
|
-
self:
|
|
99
|
+
self: xstate836.ActorRef<xstate836.MachineSnapshot<IdVerificationContext, {
|
|
99
100
|
type: "LOAD";
|
|
100
101
|
} | {
|
|
101
102
|
type: "CONTINUE";
|
|
102
|
-
}, Record<string,
|
|
103
|
+
}, Record<string, xstate836.AnyActorRef | undefined>, xstate836.StateValue, string, unknown, any, any>, {
|
|
103
104
|
type: "LOAD";
|
|
104
105
|
} | {
|
|
105
106
|
type: "CONTINUE";
|
|
106
|
-
},
|
|
107
|
+
}, xstate836.AnyEventObject>;
|
|
107
108
|
}) => {
|
|
108
109
|
config: IdVerificationConfig;
|
|
109
110
|
isSecondId: boolean;
|
|
@@ -127,15 +128,15 @@ declare const idVerificationMachine: xstate654.StateMachine<IdVerificationContex
|
|
|
127
128
|
} | {
|
|
128
129
|
type: "CONTINUE";
|
|
129
130
|
};
|
|
130
|
-
self:
|
|
131
|
+
self: xstate836.ActorRef<xstate836.MachineSnapshot<IdVerificationContext, {
|
|
131
132
|
type: "LOAD";
|
|
132
133
|
} | {
|
|
133
134
|
type: "CONTINUE";
|
|
134
|
-
}, Record<string,
|
|
135
|
+
}, Record<string, xstate836.AnyActorRef>, xstate836.StateValue, string, unknown, any, any>, {
|
|
135
136
|
type: "LOAD";
|
|
136
137
|
} | {
|
|
137
138
|
type: "CONTINUE";
|
|
138
|
-
},
|
|
139
|
+
}, xstate836.AnyEventObject>;
|
|
139
140
|
}) => {
|
|
140
141
|
isSecondId: boolean;
|
|
141
142
|
queueName: string;
|
|
@@ -1,8 +1,9 @@
|
|
|
1
|
-
import "./api-
|
|
2
|
-
import {
|
|
3
|
-
import "./
|
|
4
|
-
import
|
|
5
|
-
import {
|
|
1
|
+
import "./api-DsbUi7TO.esm.js";
|
|
2
|
+
import { n as createManagerInstrumentation } from "./events-CqGY1yMq.esm.js";
|
|
3
|
+
import "./types-ElOJAGaM.esm.js";
|
|
4
|
+
import "./endpoints-BzMJFAPV.esm.js";
|
|
5
|
+
import { l as createManager, s as createActor } from "./xstate.esm-Bomq1a0z.esm.js";
|
|
6
|
+
import { t as idVerificationMachine } from "./idVerificationStateMachine-oqiERKpg.esm.js";
|
|
6
7
|
|
|
7
8
|
//#region src/modules/id-verification/idVerificationActor.ts
|
|
8
9
|
function createIdVerificationActor(options) {
|
package/dist/id.d.ts
CHANGED
|
@@ -1,19 +1,30 @@
|
|
|
1
|
-
import "./warmup-
|
|
2
|
-
import "./
|
|
3
|
-
import "./
|
|
4
|
-
import "./
|
|
5
|
-
import { t as
|
|
6
|
-
import "./
|
|
7
|
-
import "./types-
|
|
8
|
-
import "./types-
|
|
9
|
-
import "./
|
|
10
|
-
import
|
|
11
|
-
import "./
|
|
12
|
-
import
|
|
1
|
+
import "./warmup-BJZPQIiX.js";
|
|
2
|
+
import "./StateMachine-C_AY4cs7.js";
|
|
3
|
+
import "./Manager-CJ3G2zqi.js";
|
|
4
|
+
import "./Actor-CGEelYtQ.js";
|
|
5
|
+
import { t as IVisibilityObserverCapability } from "./IVisibilityObserverCapability-BbWjgpiF.js";
|
|
6
|
+
import { t as CameraStream } from "./camera-CNVUo-bC.js";
|
|
7
|
+
import "./types-DgGlgyZT.js";
|
|
8
|
+
import "./types-D_IceWxT.js";
|
|
9
|
+
import "./canvas-CJUmoXSD.js";
|
|
10
|
+
import "./createFaceAvatar-B8pFpy6o.js";
|
|
11
|
+
import "./types-BsYXnC5s.js";
|
|
12
|
+
import "./IWasmUtilCapability-d2XvzaCk.js";
|
|
13
|
+
import { n as PermissionStatus, t as PermissionResult } from "./types-Duy2rDxF.js";
|
|
14
|
+
import "./StreamCanvasCapture-DS1TOoiH.js";
|
|
15
|
+
import "./deepsightService-CMB9XjES.js";
|
|
16
|
+
import { $ as MANUAL_UPLOAD_MAX_FILE_SIZE_BYTES, A as CaptureIdResponse, B as IdCaptureGeometry, C as IdCaptureOnlyMachine, D as createIdCaptureActor, E as IdCaptureActor, F as ID_ERROR_CODES, G as IdCapturedImageData, H as IdCaptureMode, I as IdCaptureConfig, J as IdErrorCode, K as IdDocumentType, L as IdCaptureContext, M as CapturedImage, N as DetectionArea, O as IdCaptureMachine, P as DetectionStatus, Q as MANUAL_UPLOAD_EXHAUSTION_FORWARD_MS, R as IdCaptureDependencies, S as createIdCaptureOnlyActor, T as CreateIdCaptureActorOptions, U as IdCaptureOnlyConfig, V as IdCaptureInput, W as IdCaptureThresholds, X as RecordingSession, Y as IdFlowStep, Z as UploadIdResponse, _ as uploadIdImage, a as IdCaptureInitResult, at as IdCaptureSettings, b as CreateIdCaptureOnlyActorOptions, c as UploadIdImageParams, d as initializeIdCapture, et as MANUAL_UPLOAD_MAX_RETRIES, f as preloadIdRecordingProvider, g as stopStream, h as stopRecording, it as DetectionOrientation, j as CaptureOnlyResponse, k as idCaptureMachine, l as UploadManualIdFileParams, m as startRecordingSession, n as IdCaptureManager, nt as ManualUploadSide, o as InitializeIdCaptureParams, p as processId, q as IdError, r as IdCaptureState, rt as ManualUploadTab, s as StartRecordingParams, t as createIdCaptureManager, tt as ManualUploadContext, u as ValidationError, v as uploadManualIdFile, w as idCaptureOnlyMachine, x as IdCaptureOnlyActor, y as validateUploadResponse, z as IdCaptureEvent } from "./idCaptureManager-BVdvfJys.js";
|
|
13
17
|
|
|
14
18
|
//#region src/modules/id/idCaptureOnlyManager.d.ts
|
|
15
19
|
type IdCaptureOnlyManager = IdCaptureManager;
|
|
16
|
-
|
|
20
|
+
/**
|
|
21
|
+
* `visibilityObserver` is an optional override escape-hatch — first-party
|
|
22
|
+
* callers omit it and the downstream factory defaults to
|
|
23
|
+
* `BrowserVisibilityObserverProvider`. Pass a custom or no-op observer to
|
|
24
|
+
* disable `background`/`foreground` tracking or to run in a non-DOM
|
|
25
|
+
* environment (e.g. SSR / tests).
|
|
26
|
+
*/
|
|
27
|
+
declare function createIdCaptureOnlyManagerFromActor(actor: IdCaptureOnlyActor, config: IdCaptureOnlyConfig, visibilityObserver?: IVisibilityObserverCapability): IdCaptureOnlyManager;
|
|
17
28
|
/**
|
|
18
29
|
* Creates a captureOnly ID capture manager.
|
|
19
30
|
*
|
package/dist/id.esm.js
CHANGED
|
@@ -1,34 +1,42 @@
|
|
|
1
|
-
import "./WasmUtilProvider-
|
|
2
|
-
import "./BrowserTimerProvider-
|
|
3
|
-
import "./api-
|
|
4
|
-
import
|
|
5
|
-
import "./
|
|
6
|
-
import "./
|
|
7
|
-
import "./
|
|
8
|
-
import "./browserSimulation-
|
|
9
|
-
import "./sessionInitializer-
|
|
10
|
-
import "./
|
|
11
|
-
import "./
|
|
12
|
-
import
|
|
13
|
-
import "./
|
|
14
|
-
import
|
|
15
|
-
import "./
|
|
16
|
-
import "./
|
|
17
|
-
import "./
|
|
18
|
-
import "./
|
|
19
|
-
import "./
|
|
20
|
-
import "./
|
|
21
|
-
import "./
|
|
22
|
-
import "./
|
|
23
|
-
import "./
|
|
24
|
-
import "./
|
|
25
|
-
import "./
|
|
26
|
-
import "./
|
|
27
|
-
import "./
|
|
28
|
-
import "./
|
|
29
|
-
import
|
|
30
|
-
import
|
|
31
|
-
import
|
|
1
|
+
import "./WasmUtilProvider-ADG54T6M.esm.js";
|
|
2
|
+
import "./BrowserTimerProvider-CHloo0eQ.esm.js";
|
|
3
|
+
import "./api-DsbUi7TO.esm.js";
|
|
4
|
+
import "./events-CqGY1yMq.esm.js";
|
|
5
|
+
import { n as eventModuleNames } from "./types-ElOJAGaM.esm.js";
|
|
6
|
+
import "./endpoints-BzMJFAPV.esm.js";
|
|
7
|
+
import "./stats-CYcScXcO.esm.js";
|
|
8
|
+
import "./browserSimulation-TsSoavQv.esm.js";
|
|
9
|
+
import "./sessionInitializer-C_TYIgyk.esm.js";
|
|
10
|
+
import "./getDeviceData-TrKM8NPh.esm.js";
|
|
11
|
+
import "./thumbmarkAdapter-fHBUDlAP.esm.js";
|
|
12
|
+
import "./IpifyProvider-BRW14_uo.esm.js";
|
|
13
|
+
import "./platform-uIVQUnJP.esm.js";
|
|
14
|
+
import "./tri-BG1iJsr4.esm.js";
|
|
15
|
+
import { a as fromPromise, r as assign, s as createActor } from "./xstate.esm-Bomq1a0z.esm.js";
|
|
16
|
+
import "./apiError-DNS2OCEX.esm.js";
|
|
17
|
+
import "./BrowserVisibilityObserverProvider-rim9Jrz-.esm.js";
|
|
18
|
+
import "./MotionSensorProvider-DCbId4De.esm.js";
|
|
19
|
+
import "./permissionServices-BJhGL13R.esm.js";
|
|
20
|
+
import "./camera-DUkgmYMo.esm.js";
|
|
21
|
+
import { t as BrowserStorageProvider } from "./BrowserStorageProvider-CrrN540a.esm.js";
|
|
22
|
+
import "./onDeviceFaceResults-DVBggeq8.esm.js";
|
|
23
|
+
import "./ITimerCapability-pltuG1E8.esm.js";
|
|
24
|
+
import "./canvas-_I95hkPg.esm.js";
|
|
25
|
+
import "./backCameraStream-ZyqrFyjO.esm.js";
|
|
26
|
+
import "./video-C2WIj6TS.esm.js";
|
|
27
|
+
import "./getDeviceClass-DavNdcxh.esm.js";
|
|
28
|
+
import "./deepsightService-CDahSjGP.esm.js";
|
|
29
|
+
import "./getDeviceClass-DGGzzfqm.esm.js";
|
|
30
|
+
import "./types-CMcxlSmH.esm.js";
|
|
31
|
+
import "./StreamCanvasCapture-Bz17q4FP.esm.js";
|
|
32
|
+
import "./permissionGuards-BR2oN573.esm.js";
|
|
33
|
+
import "./recordingService-m_1xCthr.esm.js";
|
|
34
|
+
import "./mediaRecorderOptions-C3NAkVgK.esm.js";
|
|
35
|
+
import "./session-9jIfKFCc.esm.js";
|
|
36
|
+
import { _ as MANUAL_UPLOAD_MAX_RETRIES, a as initializeIdCapture, c as startRecordingSession, d as uploadIdImage, f as uploadManualIdFile, g as MANUAL_UPLOAD_MAX_FILE_SIZE_BYTES, h as MANUAL_UPLOAD_EXHAUSTION_FORWARD_MS, l as stopRecording, m as ID_ERROR_CODES, o as preloadIdRecordingProvider, p as validateUploadResponse, s as processId, t as idCaptureMachine, u as stopStream } from "./idCaptureStateMachine-BeDidMLU.esm.js";
|
|
37
|
+
import "./idCaptureDefaults-DNJON8Xo.esm.js";
|
|
38
|
+
import { n as createIdCaptureActor, r as createIdCaptureManagerFromActor, t as createIdCaptureManager } from "./idCaptureManager-Bo9DCQSU.esm.js";
|
|
39
|
+
import { t as invokeOnCaptureCallback } from "./invokeOnCaptureCallback-v_PV_IJz.esm.js";
|
|
32
40
|
|
|
33
41
|
//#region src/modules/id/idCaptureOnlyStateMachine.ts
|
|
34
42
|
function buildSubImage(canvas) {
|
|
@@ -181,9 +189,16 @@ function attachOnCaptureFiring(actor, config) {
|
|
|
181
189
|
} });
|
|
182
190
|
return () => subscription.unsubscribe();
|
|
183
191
|
}
|
|
184
|
-
|
|
192
|
+
/**
|
|
193
|
+
* `visibilityObserver` is an optional override escape-hatch — first-party
|
|
194
|
+
* callers omit it and the downstream factory defaults to
|
|
195
|
+
* `BrowserVisibilityObserverProvider`. Pass a custom or no-op observer to
|
|
196
|
+
* disable `background`/`foreground` tracking or to run in a non-DOM
|
|
197
|
+
* environment (e.g. SSR / tests).
|
|
198
|
+
*/
|
|
199
|
+
function createIdCaptureOnlyManagerFromActor(actor, config, visibilityObserver) {
|
|
185
200
|
const unsubscribe = attachOnCaptureFiring(actor, config);
|
|
186
|
-
const manager = createIdCaptureManagerFromActor(actor);
|
|
201
|
+
const manager = createIdCaptureManagerFromActor(actor, visibilityObserver);
|
|
187
202
|
return {
|
|
188
203
|
...manager,
|
|
189
204
|
stop: () => {
|
|
@@ -0,0 +1,188 @@
|
|
|
1
|
+
import { d as IdCaptureModelType, i as mlWasmJSApi_default, n as BaseWasmProvider, u as WasmPipelineType } from "./WasmUtilProvider-ADG54T6M.esm.js";
|
|
2
|
+
import { t as IncodeCanvas } from "./canvas-_I95hkPg.esm.js";
|
|
3
|
+
|
|
4
|
+
//#region ../infra/src/providers/wasm/IdCaptureProvider.ts
|
|
5
|
+
var IdCaptureProvider = class extends BaseWasmProvider {
|
|
6
|
+
constructor() {
|
|
7
|
+
super(WasmPipelineType.IdBlurGlarePipeline);
|
|
8
|
+
this.lastProcessResult = null;
|
|
9
|
+
this.capturedCanvas = null;
|
|
10
|
+
this.originalCapturedCanvas = null;
|
|
11
|
+
}
|
|
12
|
+
async initialize(config) {
|
|
13
|
+
if (config.videoSelfie === true) {
|
|
14
|
+
this.pipelineType = WasmPipelineType.IdVideoSelfiePipeline;
|
|
15
|
+
await this.initializeBase(config, "videoSelfieId");
|
|
16
|
+
} else await this.initializeBase(config, "idCapture");
|
|
17
|
+
}
|
|
18
|
+
setCallbacks(callbacks) {
|
|
19
|
+
this.ensureInitialized();
|
|
20
|
+
const onCaptureWrapper = () => {
|
|
21
|
+
callbacks.onCapture?.();
|
|
22
|
+
};
|
|
23
|
+
mlWasmJSApi_default.setIdCaptureCallbacks(this.getPipelineType(), callbacks.onFarAway ?? (() => {}), callbacks.onDetectionStarted ?? (() => {}), callbacks.onMaskChange ? (show, mask, top, orientation) => callbacks.onMaskChange?.(show, mask, top, orientation) : () => {}, callbacks.onBlur ?? (() => {}), callbacks.onGlare ?? (() => {}), callbacks.onCapturing ?? (() => {}), callbacks.onCapture ? onCaptureWrapper : () => {}, callbacks.onBestFrame ? (blur, glare, orientation) => callbacks.onBestFrame?.(blur, glare, orientation) : () => {}, callbacks.onIdNotDetected ?? (() => {}), callbacks.onSwitchToManualCapture ?? (() => {}), callbacks.onIdTypeChange ? (idType) => callbacks.onIdTypeChange?.(idType) : () => {}, callbacks.onIdSideChange ? (side) => callbacks.onIdSideChange?.(side) : () => {}, callbacks.onCapturingCounterValueChange ? (value) => callbacks.onCapturingCounterValueChange?.(value) : () => {});
|
|
24
|
+
}
|
|
25
|
+
setThresholds(thresholds) {
|
|
26
|
+
this.ensureInitialized();
|
|
27
|
+
mlWasmJSApi_default.setIdCaptureThresholds(this.getPipelineType(), thresholds.blurThreshold, thresholds.blurChangeThreshold, thresholds.glareThreshold, thresholds.clsThreshold, thresholds.sideThreshold, thresholds.iouThreshold, thresholds.idDetectedTimeout, thresholds.autocaptureTimeout, thresholds.framesAggregationInterval);
|
|
28
|
+
}
|
|
29
|
+
setGeometry(geometry) {
|
|
30
|
+
this.ensureInitialized();
|
|
31
|
+
mlWasmJSApi_default.setIdCaptureGeometryParams(this.getPipelineType(), geometry.areaDown, geometry.areaUp, geometry.areaIOSPassportUp, geometry.areaIOSPassportDown, geometry.widthIOSUp, geometry.widthIOSDown, geometry.widthDown, geometry.widthUp, geometry.windowOuterWidth, geometry.windowOuterHeight, geometry.windowInnerWidth, geometry.windowInnerHeight);
|
|
32
|
+
}
|
|
33
|
+
setSettings(settings) {
|
|
34
|
+
this.ensureInitialized();
|
|
35
|
+
mlWasmJSApi_default.setIdCaptureConfigParams(this.getPipelineType(), settings.isFixedMask, settings.isIPhone14OrHigher, settings.idType, settings.blurCheckEnabled, settings.glareCheckEnabled, settings.faceQualityCheckEnabled, settings.iouCheckEnabled, settings.fpsLimitEnabled);
|
|
36
|
+
}
|
|
37
|
+
setModelType(modelType) {
|
|
38
|
+
this.ensureInitialized();
|
|
39
|
+
let wasmModelType;
|
|
40
|
+
switch (modelType) {
|
|
41
|
+
case "v1":
|
|
42
|
+
wasmModelType = IdCaptureModelType.IdCaptureV1x;
|
|
43
|
+
break;
|
|
44
|
+
case "v2":
|
|
45
|
+
wasmModelType = IdCaptureModelType.IdCaptureV2x;
|
|
46
|
+
break;
|
|
47
|
+
case "v3":
|
|
48
|
+
wasmModelType = IdCaptureModelType.IdCaptureV3x;
|
|
49
|
+
break;
|
|
50
|
+
default: throw new Error(`Unknown model type: ${modelType}`);
|
|
51
|
+
}
|
|
52
|
+
mlWasmJSApi_default.setIdCaptureModelType(this.getPipelineType(), wasmModelType);
|
|
53
|
+
}
|
|
54
|
+
/**
|
|
55
|
+
* Processes a frame through the WASM pipeline and stores the result.
|
|
56
|
+
*/
|
|
57
|
+
async processFrame(image) {
|
|
58
|
+
const result = await this.processFrameWasm(image);
|
|
59
|
+
const pipelineType = this.getPipelineType();
|
|
60
|
+
if (result && (pipelineType === WasmPipelineType.IdBlurGlarePipeline || pipelineType === WasmPipelineType.IdVideoSelfiePipeline)) this.lastProcessResult = result;
|
|
61
|
+
else this.lastProcessResult = null;
|
|
62
|
+
}
|
|
63
|
+
/**
|
|
64
|
+
* Gets the last process result from the most recent frame processing.
|
|
65
|
+
* @returns The last process result with quad coordinates, or null if not available
|
|
66
|
+
*/
|
|
67
|
+
getLastProcessResult() {
|
|
68
|
+
return this.lastProcessResult;
|
|
69
|
+
}
|
|
70
|
+
transformPerspective(canvas, frameRect) {
|
|
71
|
+
this.ensureInitialized();
|
|
72
|
+
const originalWidth = canvas.width();
|
|
73
|
+
const originalHeight = canvas.height();
|
|
74
|
+
try {
|
|
75
|
+
const imageData = canvas.getImageData();
|
|
76
|
+
if (!imageData) return canvas;
|
|
77
|
+
const transformedCanvas = mlWasmJSApi_default.IdPerspectiveTransform(imageData, frameRect);
|
|
78
|
+
if (transformedCanvas) {
|
|
79
|
+
const wrappedCanvas = new IncodeCanvas(transformedCanvas);
|
|
80
|
+
const wrappedWidth = wrappedCanvas.width();
|
|
81
|
+
const wrappedHeight = wrappedCanvas.height();
|
|
82
|
+
if (wrappedWidth === originalWidth && wrappedHeight === originalHeight) {
|
|
83
|
+
const croppedCanvas = this.cropCanvasToRect(wrappedCanvas, {
|
|
84
|
+
x: Math.round(frameRect.x),
|
|
85
|
+
y: Math.round(frameRect.y),
|
|
86
|
+
w: Math.round(frameRect.w),
|
|
87
|
+
h: Math.round(frameRect.h)
|
|
88
|
+
});
|
|
89
|
+
if (croppedCanvas) return croppedCanvas;
|
|
90
|
+
}
|
|
91
|
+
return wrappedCanvas;
|
|
92
|
+
}
|
|
93
|
+
return canvas;
|
|
94
|
+
} catch (_error) {
|
|
95
|
+
return canvas;
|
|
96
|
+
}
|
|
97
|
+
}
|
|
98
|
+
/**
|
|
99
|
+
* Crops a canvas to the specified rectangle region.
|
|
100
|
+
* @param canvas - The canvas to crop
|
|
101
|
+
* @param rect - The rectangle to crop to (x, y, w, h)
|
|
102
|
+
* @returns A new IncodeCanvas with the cropped region, or null if cropping fails
|
|
103
|
+
*/
|
|
104
|
+
cropCanvasToRect(canvas, rect) {
|
|
105
|
+
const canvasWidth = canvas.width();
|
|
106
|
+
const canvasHeight = canvas.height();
|
|
107
|
+
if (!canvasWidth || !canvasHeight) return null;
|
|
108
|
+
const x = Math.max(0, Math.min(rect.x, canvasWidth));
|
|
109
|
+
const y = Math.max(0, Math.min(rect.y, canvasHeight));
|
|
110
|
+
const w = Math.max(1, Math.min(rect.w, canvasWidth - x));
|
|
111
|
+
const h = Math.max(1, Math.min(rect.h, canvasHeight - y));
|
|
112
|
+
const croppedCanvasElement = document.createElement("canvas");
|
|
113
|
+
croppedCanvasElement.width = w;
|
|
114
|
+
croppedCanvasElement.height = h;
|
|
115
|
+
const ctx = croppedCanvasElement.getContext("2d");
|
|
116
|
+
if (!ctx) return null;
|
|
117
|
+
ctx.drawImage(canvas.canvas, x, y, w, h, 0, 0, w, h);
|
|
118
|
+
return new IncodeCanvas(croppedCanvasElement);
|
|
119
|
+
}
|
|
120
|
+
/**
|
|
121
|
+
* Gets the captured canvas (transformed for preview).
|
|
122
|
+
* @returns The captured canvas, or null if not available
|
|
123
|
+
*/
|
|
124
|
+
getCapturedCanvas() {
|
|
125
|
+
return this.capturedCanvas;
|
|
126
|
+
}
|
|
127
|
+
/**
|
|
128
|
+
* Gets the original captured canvas (full frame for upload).
|
|
129
|
+
* @returns The original captured canvas, or null if not available
|
|
130
|
+
*/
|
|
131
|
+
getOriginalCapturedCanvas() {
|
|
132
|
+
return this.originalCapturedCanvas;
|
|
133
|
+
}
|
|
134
|
+
/**
|
|
135
|
+
* Sets the captured canvases (original and transformed).
|
|
136
|
+
* @param original - The original full-frame canvas (for upload)
|
|
137
|
+
* @param transformed - The transformed canvas (for preview)
|
|
138
|
+
*/
|
|
139
|
+
setCapturedCanvases(original, transformed) {
|
|
140
|
+
this.originalCapturedCanvas = original;
|
|
141
|
+
this.capturedCanvas = transformed;
|
|
142
|
+
}
|
|
143
|
+
reset() {
|
|
144
|
+
super.reset();
|
|
145
|
+
this.lastProcessResult = null;
|
|
146
|
+
this.capturedCanvas = null;
|
|
147
|
+
this.originalCapturedCanvas = null;
|
|
148
|
+
}
|
|
149
|
+
};
|
|
150
|
+
|
|
151
|
+
//#endregion
|
|
152
|
+
//#region ../infra/src/wasm/idCaptureDefaults.ts
|
|
153
|
+
/**
|
|
154
|
+
* Default WASM thresholds for ID capture quality checks.
|
|
155
|
+
* Based on legacy pipelinesConfig.ts values.
|
|
156
|
+
*/
|
|
157
|
+
const DEFAULT_ID_CAPTURE_THRESHOLDS = {
|
|
158
|
+
blurThreshold: .2,
|
|
159
|
+
blurChangeThreshold: .2,
|
|
160
|
+
glareThreshold: .3,
|
|
161
|
+
clsThreshold: .98,
|
|
162
|
+
sideThreshold: .8,
|
|
163
|
+
iouThreshold: .8,
|
|
164
|
+
idDetectedTimeout: 1e4,
|
|
165
|
+
autocaptureTimeout: 5e3,
|
|
166
|
+
framesAggregationInterval: 3e3
|
|
167
|
+
};
|
|
168
|
+
/**
|
|
169
|
+
* Default geometry parameters for ID detection.
|
|
170
|
+
* Window dimensions must be provided at runtime.
|
|
171
|
+
*/
|
|
172
|
+
const DEFAULT_ID_CAPTURE_GEOMETRY = {
|
|
173
|
+
areaDown: 25e3,
|
|
174
|
+
areaUp: 55e3,
|
|
175
|
+
areaIOSPassportUp: 3e4,
|
|
176
|
+
areaIOSPassportDown: 2e4,
|
|
177
|
+
widthIOSUp: 160,
|
|
178
|
+
widthIOSDown: 85,
|
|
179
|
+
widthDown: 110,
|
|
180
|
+
widthUp: 205
|
|
181
|
+
};
|
|
182
|
+
/**
|
|
183
|
+
* Default model version for ID capture.
|
|
184
|
+
*/
|
|
185
|
+
const DEFAULT_ID_CAPTURE_MODEL_VERSION = "v2";
|
|
186
|
+
|
|
187
|
+
//#endregion
|
|
188
|
+
export { IdCaptureProvider as i, DEFAULT_ID_CAPTURE_MODEL_VERSION as n, DEFAULT_ID_CAPTURE_THRESHOLDS as r, DEFAULT_ID_CAPTURE_GEOMETRY as t };
|