@incodetech/core 2.3.2 → 2.4.0-rc.1
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/THIRD_PARTY_NOTICES.txt +1243 -3
- package/dist/Actor-DpTj5PFb.d.ts +1 -0
- package/dist/{BaseWasmProvider-Dyi6dKp1.d.ts → BaseWasmProvider-Bq3OHo7P.d.ts} +2 -2
- package/dist/BrowserDiagnosticsEnvelopeProvider-BQca6KPG.esm.js +43 -0
- package/dist/{FaceDetectionProvider-DtmtCKa9.esm.js → FaceDetectionProvider-BIImDZrc.esm.js} +125 -10
- package/dist/HttpRequestError-Bh0pNGSC.esm.js +35 -0
- package/dist/{IIdCaptureCapability-RNiFhvXR.d.ts → IIdCaptureCapability-CGcEt2Cw.d.ts} +2 -2
- package/dist/{IWasmUtilCapability-CNWRl7jr.d.ts → IWasmUtilCapability-GF2n7sfm.d.ts} +28 -5
- package/dist/{Manager-CQQ99QOI.d.ts → Manager-C9T5amUN.d.ts} +7 -1
- package/dist/{MotionSensorProvider-DyhbM4Si.esm.js → MotionSensorProvider-DYxh8TjR.esm.js} +1 -1
- package/dist/{ekycStateMachine-UeJRO8_p.esm.js → PhoneValidationProvider-SZiOS0jB.esm.js} +232 -827
- package/dist/{StreamCanvasCapture-_8gdW5Lk.d.ts → StreamCanvasCapture-7JRf-2ck.d.ts} +2 -2
- package/dist/{safeStorage-BdU9_m2E.esm.js → WasmUtilProvider-DtJuBdt-.esm.js} +111 -49
- package/dist/{addressSearch-DyHGgeX8.esm.js → addressSearch-DPjIKJrX.esm.js} +142 -4
- package/dist/{advanceableErrors-CpF2cBy6.esm.js → advanceableErrors-q_pfU3Cn.esm.js} +5 -4
- package/dist/ae-signature.d.ts +2 -2
- package/dist/ae-signature.esm.js +1 -1
- package/dist/antifraud.d.ts +1 -1
- package/dist/antifraud.esm.js +2 -2
- package/dist/{antifraudManager-DNkw66oW.esm.js → antifraudManager-CaweCYnY.esm.js} +3 -3
- package/dist/{antifraudManager-BY36bS12.d.ts → antifraudManager-DbGCvlJs.d.ts} +2 -2
- package/dist/{antifraudStateMachine-DBeq47D2.esm.js → antifraudStateMachine-DRl0UVyA.esm.js} +3 -4
- package/dist/{endpoints-B-3Q-LUw.esm.js → api-Cz90EHyu.esm.js} +151 -1
- package/dist/{apiError-CmGEmaGU.esm.js → apiError-D5u6HIDG.esm.js} +2 -1
- package/dist/authentication.d.ts +3 -3
- package/dist/authentication.esm.js +2 -2
- package/dist/{authenticationManager-CboRCl_N.d.ts → authenticationManager-BIZC55Bi.d.ts} +2 -8
- package/dist/{authenticationManager-BFjSjtQ_.esm.js → authenticationManager-CB3YW6EK.esm.js} +6 -6
- package/dist/{authenticationStateMachine-Dfo34ZiI.esm.js → authenticationStateMachine-BJJhLmdH.esm.js} +5 -6
- package/dist/avatar.d.ts +1 -1
- package/dist/{backCameraStream-B0-YgP_y.esm.js → backCameraStream-CMvXj4X4.esm.js} +1 -1
- package/dist/camera.esm.js +1 -1
- package/dist/certificate-issuance.d.ts +1 -1
- package/dist/certificate-issuance.esm.js +2 -2
- package/dist/{certificateIssuanceManager-C3-CI0_s.esm.js → certificateIssuanceManager-BfeMv2PU.esm.js} +3 -3
- package/dist/{certificateIssuanceManager-DCgEidHz.d.ts → certificateIssuanceManager-Dr8A4Lgr.d.ts} +2 -3
- package/dist/{certificateIssuanceStateMachine-CxqS_nD-.esm.js → certificateIssuanceStateMachine-Frgjbjw8.esm.js} +4 -5
- package/dist/consent.d.ts +1 -1
- package/dist/consent.esm.js +2 -2
- package/dist/{consentManager-B6E1XJDw.esm.js → consentManager-CvEu8h_W.esm.js} +3 -3
- package/dist/{consentManager-2h_w6wFc.d.ts → consentManager-Cv_0QKLD.d.ts} +7 -8
- package/dist/{consentStateMachine-DTSfdGiW.esm.js → consentStateMachine-DJTgN_-1.esm.js} +3 -4
- package/dist/{createCameraCycleOwnership-DnwTl1ad.esm.js → createCameraCycleOwnership-Dj_LHUvN.esm.js} +71 -66
- package/dist/{createFaceAvatar-BlcTYgJv.d.ts → createFaceAvatar-lYX0VTYs.d.ts} +1 -1
- package/dist/cross-document-data-match.d.ts +1 -1
- package/dist/cross-document-data-match.esm.js +1 -1
- package/dist/{crossDocumentDataMatchManager-9XhFVZ5S.esm.js → crossDocumentDataMatchManager-Cu141CE8.esm.js} +4 -5
- package/dist/{crossDocumentDataMatchManager-Dq8Z3SOg.d.ts → crossDocumentDataMatchManager-yCWCOzcU.d.ts} +2 -2
- package/dist/curp-validation.d.ts +1 -1
- package/dist/curp-validation.esm.js +2 -2
- package/dist/{curpValidationManager-DbIMYFcJ.esm.js → curpValidationManager-B-z9q5V3.esm.js} +15 -22
- package/dist/{curpValidationManager-DNuZn9fn.d.ts → curpValidationManager-C9sqoh9n.d.ts} +3 -3
- package/dist/{curpValidationStateMachine-g5kMfuLj.esm.js → curpValidationStateMachine-vDEFLMPw.esm.js} +4 -5
- package/dist/custom-fields.d.ts +1 -1
- package/dist/custom-fields.esm.js +1 -1
- package/dist/custom-watchlist.d.ts +1 -1
- package/dist/custom-watchlist.esm.js +2 -2
- package/dist/{customFieldsManager-8-W2KY4n.d.ts → customFieldsManager-CF-cO8ap.d.ts} +2 -2
- package/dist/{customFieldsManager-CzWZTkW-.esm.js → customFieldsManager-D1ex2cFM.esm.js} +4 -5
- package/dist/{customWatchlistManager-DWTED5Ur.esm.js → customWatchlistManager-CTI-SGk0.esm.js} +3 -3
- package/dist/{customWatchlistManager-PBWHr_oM.d.ts → customWatchlistManager-DolUswyR.d.ts} +2 -2
- package/dist/{customWatchlistStateMachine-DOQou6TW.esm.js → customWatchlistStateMachine-hmRd0f2I.esm.js} +3 -4
- package/dist/deepsightLoader-DZMdYSl-.esm.js +55 -0
- package/dist/{deepsightLoader-v-dLejS-.esm.js → deepsightService-tGP53cSS.esm.js} +51 -56
- package/dist/device.esm.js +1 -1
- package/dist/document-capture.d.ts +2 -2
- package/dist/document-capture.esm.js +2 -2
- package/dist/{documentCaptureManager-BRPxqYD2.esm.js → documentCaptureManager-DUJwpKC5.esm.js} +17 -18
- package/dist/{documentCaptureManager-lEtCM320.d.ts → documentCaptureManager-DkyDtm3Y.d.ts} +11 -34
- package/dist/{documentCaptureStateMachine-D312sSIu.esm.js → documentCaptureStateMachine-B8i7GnLh.esm.js} +55 -59
- package/dist/dynamic-forms.d.ts +2 -2
- package/dist/dynamic-forms.esm.js +2 -2
- package/dist/{dynamicFormsManager-C-9Jhnd3.esm.js → dynamicFormsManager-Bxmv_9PB.esm.js} +3 -3
- package/dist/{dynamicFormsManager-D5R_uxLQ.d.ts → dynamicFormsManager-C0dHs1ty.d.ts} +3 -3
- package/dist/{dynamicFormsStateMachine-DGI_F2PP.esm.js → dynamicFormsStateMachine-CoOWTzyM.esm.js} +4 -5
- package/dist/ekyb.d.ts +5 -5
- package/dist/ekyb.esm.js +3 -3
- package/dist/{ekybManager-DeoMcZEz.esm.js → ekybManager-BBkdPxUY.esm.js} +23 -27
- package/dist/{ekybManager-BwRuGAwt.d.ts → ekybManager-BaZ_7CEu.d.ts} +4 -4
- package/dist/{ekybStateMachine-D1IJ1Z72.esm.js → ekybStateMachine-n4Iz9iLc.esm.js} +338 -14
- package/dist/ekyc.d.ts +2 -2
- package/dist/ekyc.esm.js +3 -3
- package/dist/{ekycManager-BX2d46FY.esm.js → ekycManager-BO-Lui3t.esm.js} +29 -36
- package/dist/{ekycManager-DLzDuBzI.d.ts → ekycManager-DW-ynodd.d.ts} +3 -3
- package/dist/ekycStateMachine-CDnI_NRq.esm.js +1443 -0
- package/dist/{ekycUtils-D6wfSpPN.esm.js → ekycUtils-zY8CdKJL.esm.js} +53 -3
- package/dist/electronic-signature.d.ts +1 -1
- package/dist/electronic-signature.esm.js +1 -1
- package/dist/{electronicSignatureManager-yYUc30na.esm.js → electronicSignatureManager-BtWCrz5_.esm.js} +10 -11
- package/dist/{electronicSignatureManager-Ds-KEVTq.d.ts → electronicSignatureManager-DTSLOvKR.d.ts} +2 -3
- package/dist/email.d.ts +1 -1
- package/dist/email.esm.js +2 -2
- package/dist/{emailManager-bR1N5rV_.esm.js → emailManager-ButFktRm.esm.js} +20 -26
- package/dist/{emailManager-CADXW_9X.d.ts → emailManager-Dy6omJVp.d.ts} +2 -2
- package/dist/{emailStateMachine-Bc_6oIYw.esm.js → emailStateMachine-BXtlC0NV.esm.js} +3 -4
- package/dist/{events-ijlbX_Wx.esm.js → events-Du2A4-Qr.esm.js} +203 -8
- package/dist/events.d.ts +3 -2
- package/dist/events.esm.js +1 -1
- package/dist/extensibility.d.ts +38 -38
- package/dist/extensibility.esm.js +36 -36
- package/dist/{externalFetch-BKBThAUC.esm.js → externalFetch-DrR9xshk.esm.js} +3 -2
- package/dist/face-match.d.ts +1 -1
- package/dist/face-match.esm.js +2 -2
- package/dist/{faceCaptureManagerFactory-m-7ae67q.d.ts → faceCaptureManagerFactory-1hzeS_rB.d.ts} +11 -51
- package/dist/{faceCaptureManagerFactory-B6i9QcAk.esm.js → faceCaptureManagerFactory-CwZUeYfq.esm.js} +19 -54
- package/dist/{faceCaptureSetup-DU1mjRr6.esm.js → faceCaptureSetup-CYbdKNlI.esm.js} +104 -396
- package/dist/{faceMatchManager-BnvrZM2F.d.ts → faceMatchManager-DIgG-UFS.d.ts} +1 -2
- package/dist/{faceMatchManager-Bmv0HzuY.esm.js → faceMatchManager-DWFUQjMQ.esm.js} +3 -3
- package/dist/{faceMatchStateMachine-mRIHQ3dA.esm.js → faceMatchStateMachine-CUCvlydD.esm.js} +6 -5
- package/dist/{feature-management-C8CuN0os.esm.js → feature-management-rTfjzdDa.esm.js} +3 -3
- package/dist/feature-management.esm.js +1 -1
- package/dist/field-comparison.d.ts +2 -2
- package/dist/field-comparison.esm.js +1 -1
- package/dist/{fieldComparisonManager-CBvEGxFx.d.ts → fieldComparisonManager-CUX4gza2.d.ts} +6 -3
- package/dist/{fieldComparisonManager-CC-klG0h.esm.js → fieldComparisonManager-v3knTYV_.esm.js} +35 -18
- package/dist/fiscal-qr.d.ts +1 -1
- package/dist/fiscal-qr.esm.js +1 -1
- package/dist/{fiscalQrManager-B1STmT6z.d.ts → fiscalQrManager-D0Iy7EKR.d.ts} +2 -2
- package/dist/fiscalQrManager-Dt9fHG7h.esm.js +6798 -0
- package/dist/flow-events.d.ts +1 -1
- package/dist/flow.d.ts +14 -13
- package/dist/flow.esm.js +14 -14
- package/dist/{flowCompletionService-DccgtDnm.esm.js → flowCompletionService-oiK1PjPr.esm.js} +2 -3
- package/dist/{flowServices-CdsWsppG.esm.js → flowServices-CTc-zqfN.esm.js} +11 -8
- package/dist/geolocation.d.ts +1 -1
- package/dist/geolocation.esm.js +2 -2
- package/dist/{geolocationManager-CGHBxtMb.esm.js → geolocationManager-BOdtVuR8.esm.js} +6 -7
- package/dist/{geolocationManager-Cz744E5S.d.ts → geolocationManager-Dn24g1fl.d.ts} +2 -3
- package/dist/{geolocationStateMachine-CdEb1Gn0.esm.js → geolocationStateMachine-BnGuZ3hn.esm.js} +4 -5
- package/dist/{getDeviceClass-5NYZg9s6.esm.js → getDeviceClass-bsWdEDxP.esm.js} +1 -1
- package/dist/{getParsedUserAgent-B2iFDql1.esm.js → getParsedUserAgent-DhQPeKqw.esm.js} +1 -1
- package/dist/government-validation.d.ts +1 -1
- package/dist/government-validation.esm.js +2 -2
- package/dist/{governmentValidationManager-D02vT4yY.d.ts → governmentValidationManager-B82zOut8.d.ts} +3 -3
- package/dist/{governmentValidationManager-CacFOtKO.esm.js → governmentValidationManager-BtXWHICu.esm.js} +3 -3
- package/dist/{governmentValidationStateMachine-CoaZOSTP.esm.js → governmentValidationStateMachine-COL-Vs48.esm.js} +3 -4
- package/dist/home.d.ts +3 -26
- package/dist/home.esm.js +2 -2
- package/dist/http.esm.js +1 -1
- package/dist/id-ocr.d.ts +1 -1
- package/dist/id-ocr.esm.js +2 -2
- package/dist/id-selfie-flow.d.ts +6 -9
- package/dist/id-selfie-flow.esm.js +23 -28
- package/dist/id-verification.d.ts +1 -1
- package/dist/id-verification.esm.js +2 -2
- package/dist/id.d.ts +4 -4
- package/dist/id.esm.js +4 -205
- package/dist/{idCaptureDefaults-Dl64Trv5.esm.js → idCaptureDefaults-BGsG2OAs.esm.js} +7 -5
- package/dist/{idCaptureManager-BHwL2Z0V.d.ts → idCaptureManager-0M02hSuC.d.ts} +242 -98
- package/dist/{idCaptureManager-BNmVJQkd.esm.js → idCaptureManager-BKedt48Y.esm.js} +276 -210
- package/dist/{idCaptureServices-dtDG2HXS.esm.js → idCaptureServices-D0p_RFqk.esm.js} +21 -40
- package/dist/{idCaptureStateMachine-BbiZD3uf.esm.js → idCaptureStateMachine-CxwoN5ff.esm.js} +992 -872
- package/dist/{idOcrManager-ByWuQ4ej.esm.js → idOcrManager-D3-HNMXP.esm.js} +3 -3
- package/dist/{idOcrManager-CFlDwUvN.d.ts → idOcrManager-DT3kPIB3.d.ts} +3 -4
- package/dist/{idOcrStateMachine-Bt_abXQQ.esm.js → idOcrStateMachine-DyENX6Ki.esm.js} +3 -4
- package/dist/{idVerificationManager-BB4Pj_N6.d.ts → idVerificationManager-BJapZfpy.d.ts} +2 -3
- package/dist/{idVerificationManager-DT42c77H.esm.js → idVerificationManager-iWz7Avkr.esm.js} +3 -3
- package/dist/{idVerificationStateMachine-DbDVIh9t.esm.js → idVerificationStateMachine-CL1kUdBe.esm.js} +3 -4
- package/dist/identity-reuse.d.ts +2 -2
- package/dist/identity-reuse.esm.js +2 -2
- package/dist/{identityReuseManager-BXEBBI3N.d.ts → identityReuseManager-B1birg5X.d.ts} +162 -44
- package/dist/{identityReuseManager-yG3acUrQ.esm.js → identityReuseManager-CD1ucp1d.esm.js} +26 -13
- package/dist/{identityReuseStateMachine-BhAkuIra.esm.js → identityReuseStateMachine-DfV81wQC.esm.js} +89 -24
- package/dist/{index-CeaC32qI.d.ts → index-CKQ9QBZP.d.ts} +2 -2
- package/dist/index-DpTj5PFb.d.ts +1 -0
- package/dist/index.d.ts +1 -1
- package/dist/index.esm.js +1 -1
- package/dist/{invokeOnCaptureCallback-BjzPjJ_p.esm.js → invokeOnCaptureCallback-DYrkOXO6.esm.js} +1 -1
- package/dist/lamejs-B6TzhU5q.esm.js +10 -0
- package/dist/mandatory-consent.d.ts +2 -2
- package/dist/mandatory-consent.esm.js +2 -2
- package/dist/{mandatoryConsentManager-7dI0D08q.esm.js → mandatoryConsentManager-Cwqx1nK7.esm.js} +3 -3
- package/dist/{mandatoryConsentManager-DFVm_i2B.d.ts → mandatoryConsentManager-okPILEru.d.ts} +8 -9
- package/dist/{mandatoryConsentStateMachine-DC5Mo6M1.esm.js → mandatoryConsentStateMachine-pXWqAHo_.esm.js} +3 -4
- package/dist/{multipartRecordingService-mwKFTlhR.esm.js → multipartRecordingService-CLwrF5wD.esm.js} +1 -2
- package/dist/{permissionGuards-D6TfVop2.esm.js → permissionGuards-gcy3U0SL.esm.js} +1 -1
- package/dist/{permissionServices-EY3_Vx6c.esm.js → permissionServices-Ca-tSNhT.esm.js} +34 -3
- package/dist/phone-number.d.ts +24 -0
- package/dist/phone-number.esm.js +1922 -0
- package/dist/phone.d.ts +1 -1
- package/dist/phone.esm.js +2 -2
- package/dist/{phoneManager-BBU8Lq0O.d.ts → phoneManager-BO-LTih5.d.ts} +16 -3
- package/dist/{phoneManager-IjhSv5XS.esm.js → phoneManager-KKUq-Vgo.esm.js} +31 -22
- package/dist/{phoneStateMachine-CXdXufKg.esm.js → phoneStateMachine-D2QWS2cu.esm.js} +38 -20
- package/dist/phoneValidation-DnBcNUNh.esm.js +48 -0
- package/dist/qe-signature.d.ts +2 -2
- package/dist/qe-signature.esm.js +1 -1
- package/dist/redirect-to-mobile.d.ts +1 -1
- package/dist/redirect-to-mobile.esm.js +2 -2
- package/dist/{redirectToMobileManager-BD2PvT5B.d.ts → redirectToMobileManager-CVsvpVbQ.d.ts} +2 -2
- package/dist/{redirectToMobileManager-FLEWJtv8.esm.js → redirectToMobileManager-uHW3dyuQ.esm.js} +4 -4
- package/dist/{redirectToMobileStateMachine-CSWWgUTO.esm.js → redirectToMobileStateMachine-b-H-ipGM.esm.js} +4 -5
- package/dist/{rolldown-runtime-FDOR9p9I.esm.js → rolldown-runtime-B-1-B7_t.esm.js} +10 -1
- package/dist/{runChildModule-B2Y_hlix.esm.js → runChildModule-CPa0i2_C.esm.js} +13 -12
- package/dist/safeStorage-UxDrnjwa.esm.js +35 -0
- package/dist/{sdkVersion-N1UiyFiY.esm.js → sdkVersion-BtROs6OA.esm.js} +1 -1
- package/dist/selfie.d.ts +4 -4
- package/dist/selfie.esm.js +12 -12
- package/dist/selfieErrorUtils-sMc0MaNh.esm.js +21 -0
- package/dist/{selfieManager-BSZG891S.d.ts → selfieManager-BJdNu_nd.d.ts} +2 -8
- package/dist/{selfieManager-AS6wfUvZ.esm.js → selfieManager-Ch9xJbWJ.esm.js} +6 -6
- package/dist/selfieStateMachine-DT8QCfKR.esm.js +41 -0
- package/dist/{session-BESZc05k.esm.js → session-CNNTckUS.esm.js} +5 -6
- package/dist/session.d.ts +15 -3
- package/dist/session.esm.js +30 -5
- package/dist/sessionInitializer-DVWMJh25.esm.js +973 -0
- package/dist/{setup-BuPbxpwF.esm.js → setup-B7ehQ-lf.esm.js} +155 -140
- package/dist/{setup-Cyko6cAn.d.ts → setup-YPKTUCY5.d.ts} +42 -15
- package/dist/signature.d.ts +1 -1
- package/dist/signature.esm.js +2 -2
- package/dist/{signatureManager-DGBSWz2_.d.ts → signatureManager-BpVt_Jv7.d.ts} +2 -2
- package/dist/{signatureManager-B72np4ZO.esm.js → signatureManager-f_dPAGXn.esm.js} +7 -11
- package/dist/{signatureStateMachine-ce_XMA3l.esm.js → signatureStateMachine-C-nUq_oq.esm.js} +3 -4
- package/dist/splitTrackedName-3zJRd2RD.esm.js +19 -0
- package/dist/{src-35ekGRzK.esm.js → src-DJAJjRYQ.esm.js} +1 -1
- package/dist/{stats-CZcy2J53.esm.js → stats-BEvexnKC.esm.js} +1 -2
- package/dist/stats.esm.js +1 -1
- package/dist/{sessionInitializer-CnhAkMUN.esm.js → thumbmark.esm-CRc0cYvz.esm.js} +33 -776
- package/dist/{trueSightService-M5VpCo96.esm.js → trueSightService-BzLdXpmJ.esm.js} +1391 -709
- package/dist/trust-graph.d.ts +1 -2
- package/dist/trust-graph.esm.js +2 -2
- package/dist/{types-C0oWGUzg.d.ts → types-0L-eFDmr.d.ts} +1 -1
- package/dist/{types-C1g9itHE.d.ts → types-B6HsSzpk.d.ts} +6 -7
- package/dist/{types-DEGVXwsk2.d.ts → types-BAxn7MpY.d.ts} +110 -62
- package/dist/{types-BfgmV7s7.d.ts → types-BQA7lRDV.d.ts} +1 -1
- package/dist/{types-Cx-1zo-i.d.ts → types-BvLo3U4u.d.ts} +1 -1
- package/dist/{types-Bx-BWveD.d.ts → types-CK8Jbjkp.d.ts} +1 -1
- package/dist/{types-CxGdmzxa.d.ts → types-Ckir_BEs.d.ts} +1 -1
- package/dist/{types-BjSly8cp.d.ts → types-DUnFZ08M.d.ts} +1 -1
- package/dist/{types-ESdtnHtg.d.ts → types-yPH8lAH-.d.ts} +3 -4
- package/dist/types-zOgZqMni.d.ts +6 -0
- package/dist/{urlUtils-D6phjq1-.esm.js → urlUtils-6jsE6rKp.esm.js} +9 -1
- package/dist/video-selfie.d.ts +6 -9
- package/dist/video-selfie.esm.js +1390 -1349
- package/dist/{videoSelfieCameraWarmer-q9ZjvXu9.esm.js → videoSelfieCameraWarmer-DWoFBJAn.esm.js} +10 -11
- package/dist/{videoSelfieFlowModuleMachine-BUe2uACW.esm.js → videoSelfieFlowModuleMachine-BCFVHBQ1.esm.js} +1 -1
- package/dist/{videoSelfieStepDetector-ChYgFM15.d.ts → videoSelfieStepDetector-CGsTltqB.d.ts} +4 -4
- package/dist/videoTrimByCopy-BFfAiNpv.esm.js +15901 -0
- package/dist/{warmup-ChDwHSel.esm.js → warmup-BElYWRh7.esm.js} +348 -11
- package/dist/{warmup-Cis2p6O0.d.ts → warmup-BO57syF6.d.ts} +8 -0
- package/dist/wasm.d.ts +2 -2
- package/dist/wasm.esm.js +3 -4
- package/dist/{wasmDsFlagSync-DYrLUEII.esm.js → wasmDsFlagSync-CYj5LL9z.esm.js} +1 -1
- package/dist/{wasmWebClient-B7baE-Wf.esm.js → wasmWebClient-BjZw_7OB.esm.js} +570 -33
- package/dist/watchlist-for-business.d.ts +1 -1
- package/dist/watchlist-for-business.esm.js +2 -2
- package/dist/watchlist.d.ts +1 -1
- package/dist/watchlist.esm.js +2 -2
- package/dist/{watchlistForBusinessManager-CsnJnG-C.d.ts → watchlistForBusinessManager-B3GDPZrr.d.ts} +2 -2
- package/dist/{watchlistForBusinessManager-CIMkpEhu.esm.js → watchlistForBusinessManager-CZZOFkGl.esm.js} +7 -5
- package/dist/{watchlistForBusinessStateMachine-CJ-MvUre.esm.js → watchlistForBusinessStateMachine-B66E7jud.esm.js} +3 -4
- package/dist/{watchlistManager-DLXef90v.d.ts → watchlistManager-DJQOd8Pw.d.ts} +2 -2
- package/dist/{watchlistManager-CixcLNDT.esm.js → watchlistManager-DXtX94SN.esm.js} +3 -3
- package/dist/{watchlistStateMachine-CBqk2w-h.esm.js → watchlistStateMachine-McALifag.esm.js} +3 -4
- package/dist/workflow.d.ts +34 -5
- package/dist/workflow.esm.js +64 -47
- package/dist/{xstate-actors.esm-BXeQ-Ucz.esm.js → xstate-actors.esm-8Gzepa_A.esm.js} +1 -1
- package/dist/{xstate.esm-BuFLFuzz.esm.js → xstate.esm-DSajW7CJ.esm.js} +24 -10
- package/package.json +13 -5
- package/dist/Actor-iTq7YY48.d.ts +0 -1
- package/dist/BrowserDiagnosticsCryptoProvider-BuzqvbhN.esm.js +0 -77
- package/dist/StateMachine-EDpYWy0i.d.ts +0 -6
- package/dist/api-Bx3gKW_y.esm.js +0 -129
- package/dist/fiscalQrManager-DbCVMIBx.esm.js +0 -34143
- package/dist/index-B8weJxmL.d.ts +0 -1
- package/dist/selfieErrorUtils-UiQ46EBa.esm.js +0 -116
- package/dist/selfieStateMachine-DY7vJVNY.esm.js +0 -71
- package/dist/types-BN5RPPIZ.esm.js +0 -34
- package/dist/types-Bt9RuRqt.d.ts +0 -6
- package/dist/virtualCameraCheck-Cjab7FTI.esm.js +0 -48
- /package/dist/{types-BSBzhHRH.d.ts → types-BSBzhHRH2.d.ts} +0 -0
|
@@ -1,3 +1,191 @@
|
|
|
1
|
+
import { t as getTimestamp } from "./IBrowserEnvironmentCapability-DEaRRk-R.esm.js";
|
|
2
|
+
//#region ../infra/src/wasm/wasmIntegrityManifest.ts
|
|
3
|
+
/** SHA-256 digests of the official WASM release files this SDK loads. */
|
|
4
|
+
const WASM_INTEGRITY_MANIFEST = {
|
|
5
|
+
wasmVersion: "v2.14.50-post1",
|
|
6
|
+
files: {
|
|
7
|
+
"models/current/age_estimation_v2_2_2_fp16.ortmodelv2": "70bd372b5e140ea8e9773a25d371cb65e5a9090651fdfe73ab6fc7ce25d59c83",
|
|
8
|
+
"models/current/barcode_enhance_896x224_fp16.ortmodelv2": "bccecd74abf48181efb95bf020784b7e50d37ae255bf89c14c2c5186976279e0",
|
|
9
|
+
"models/current/face_attributes_v1_3_fp16.ortmodelv2": "96079ec080a92ae1821b456f06281a604b4b013af42313f9668210c9bbe7041f",
|
|
10
|
+
"models/current/face_occlusion_v0_2_fp16.ortmodelv2": "7a846b12b7a9a5afe72e07f19b408095439a214aaa306e88d34d1f17ffce72fb",
|
|
11
|
+
"models/current/id_capture_2_01_fp16.ortmodelv2": "06b337368249131af6bab66bdf4fca680298034e3e83d678656d255cdb480507",
|
|
12
|
+
"models/current/id_facedetector_v2_1_fp16.ortmodelv2": "ab35d7c2f69d5c156f7e247bde652c4ac7b78cdc4a90ef55f5a928edc54e2bd8",
|
|
13
|
+
"models/current/id_fiqa_19a81a0b9bf6492eb03b4667f6db4c85_fp16.ortmodelv2": "1cc02608aed0078bf9cc66ae4f51b150e7b5aa65c5fb270248bda7c327867d26",
|
|
14
|
+
"models/current/mls_regressor_4773007c657b4f05a460321456740d0f_fp16.ortmodelv2": "74a955dff00183c69544a9b61cc7e1122c7cd3814811dcd7ae8cf862bda35c41",
|
|
15
|
+
"models/current/ondevice_physical_liveness_v2_1_fp16.ortmodelv2": "188227beafee6ccce16d562ae531eae894aa4b1056dce339741b5e80a695794a",
|
|
16
|
+
"models/current/selfie_bf_angles_192x192_opset9_fp16.ortmodelv2": "6bdb142f67e81d9e6006d94888eba2e6a7bf20a6283c66e14db8b654c8fa9bfd",
|
|
17
|
+
"models/legacy/age_estimation_v2_2_2_fp16.ortmodelv2": "28ffdec742ec7856a3b113ee86af01e4629b576139faff1cf7094bf451c94a60",
|
|
18
|
+
"models/legacy/barcode_enhance_896x224_fp16.ortmodelv2": "aef15080020d5a329870cc3d50f73a1c676526d1f6f6df282f7dc0c95e6018b9",
|
|
19
|
+
"models/legacy/face_attributes_v1_3_fp16.ortmodelv2": "7c6754b63b4e205370463df4c6396f29123d7b5a17823a2d78a59b2fb17cc98b",
|
|
20
|
+
"models/legacy/face_occlusion_v0_2_fp16.ortmodelv2": "19fc95f2081e55962045f0e38387399fb11c1b636699e31558383d2ea4156aed",
|
|
21
|
+
"models/legacy/id_capture_2_01_fp16.ortmodelv2": "2f791bbf1f0dc9c6b8ff95587ce61479a764a18070e83658f6366996a7df9615",
|
|
22
|
+
"models/legacy/id_facedetector_v2_1_fp16.ortmodelv2": "f790693395cc1473a824a97b86fd2943586b490582e003b240dff4d51d9f417f",
|
|
23
|
+
"models/legacy/id_fiqa_19a81a0b9bf6492eb03b4667f6db4c85_fp16.ortmodelv2": "d058e82efca7c30a35dd0a03472695656c105952f27af2ea158cb00818caab8c",
|
|
24
|
+
"models/legacy/mls_regressor_4773007c657b4f05a460321456740d0f_fp16.ortmodelv2": "e41887f75b284ba1f973f2a26209bf365da8a587d266492b642e5b7c36716069",
|
|
25
|
+
"models/legacy/ondevice_physical_liveness_v2_1_fp16.ortmodelv2": "405eee9fd961c48fff608246ef579dc8ce9f0b5ce51361e05dac7d9afcf9162d",
|
|
26
|
+
"models/legacy/selfie_bf_angles_192x192_opset9_fp16.ortmodelv2": "1c8dda528d5111fa7b4272ffabca7cf0a59099f57258aaece7262974aebafc4a",
|
|
27
|
+
"webLib.js": "2953d4da3b8eddf1ff48e113ac4ff11d69eb379e1ab091fec1dad34a17d23844",
|
|
28
|
+
"webLib.wasm": "7616ea70cab3171ef376f9d0fa646548efc90beab49fdefa25d1b241ca704673",
|
|
29
|
+
"webLibSimd.js": "51407ce3032dd330ae806d9aea1b43eb5c245e2b64780b4b62c9c62310a0bee1",
|
|
30
|
+
"webLibSimd.wasm": "0575425989803e58ccb82fcd30d64508a7c7b52019564d8644b59d5cf11135ab"
|
|
31
|
+
},
|
|
32
|
+
dist: {
|
|
33
|
+
"webLib.js": "6d7177b6e2e86a0d975b595ea546bf87fc11a194ad4cbdc0613fb3b2a2810e90",
|
|
34
|
+
"webLibSimd.js": "4ac981fa15dd748ec1a312bd25408fb4af3449d8c1bb6ebb8fe436476049d446"
|
|
35
|
+
}
|
|
36
|
+
};
|
|
37
|
+
//#endregion
|
|
38
|
+
//#region ../infra/src/wasm/wasmIntegrity.ts
|
|
39
|
+
/**
|
|
40
|
+
* Integrity check for every WASM binary, glue file and ML model the SDK loads.
|
|
41
|
+
*
|
|
42
|
+
* Each asset is matched, by slot, against the SHA-256 digests of the official
|
|
43
|
+
* ml-wasm-kit release in {@link WASM_INTEGRITY_MANIFEST}. The host does not
|
|
44
|
+
* matter: the Incode CDN, a self-hosted copy and `@incodetech/wasm-assets` all
|
|
45
|
+
* serve the same official files, so they all carry the same digests. A file
|
|
46
|
+
* that does not match is never instantiated or evaluated.
|
|
47
|
+
*
|
|
48
|
+
* The one input this cannot hash is a `loadGlue` callback: the integrator's
|
|
49
|
+
* bundler hands over a module, not bytes. That glue is part of the
|
|
50
|
+
* integrator's own bundle, the same trust boundary as the SDK code running
|
|
51
|
+
* this check, and is reported as `bundled`.
|
|
52
|
+
*/
|
|
53
|
+
var WasmIntegrityError = class extends Error {
|
|
54
|
+
constructor(code, asset, message, cause) {
|
|
55
|
+
super(`[Incode SDK] ${message}`);
|
|
56
|
+
this.name = "WasmIntegrityError";
|
|
57
|
+
this.code = code;
|
|
58
|
+
this.asset = asset;
|
|
59
|
+
this.cause = cause;
|
|
60
|
+
}
|
|
61
|
+
};
|
|
62
|
+
const DIGEST_PREFIX_LENGTH = 12;
|
|
63
|
+
const HTML_SNIFF_BYTES = 512;
|
|
64
|
+
let observer = null;
|
|
65
|
+
let verified = 0;
|
|
66
|
+
let failed = 0;
|
|
67
|
+
let bundled = 0;
|
|
68
|
+
let hashMs = 0;
|
|
69
|
+
/**
|
|
70
|
+
* Installs the sink core maps to TrueSight and the event log. Infra cannot
|
|
71
|
+
* import either, so core injects it, as with `setWebApiHttpTransport`.
|
|
72
|
+
*/
|
|
73
|
+
function setWasmIntegrityObserver(next) {
|
|
74
|
+
observer = next;
|
|
75
|
+
}
|
|
76
|
+
function notify(check) {
|
|
77
|
+
if (check.status === "verified") verified += 1;
|
|
78
|
+
else if (check.status === "bundled") bundled += 1;
|
|
79
|
+
else failed += 1;
|
|
80
|
+
hashMs += check.durationMs ?? 0;
|
|
81
|
+
try {
|
|
82
|
+
observer?.onAssetChecked?.(check);
|
|
83
|
+
} catch {}
|
|
84
|
+
}
|
|
85
|
+
/** Reports the totals since the last summary, then resets them. */
|
|
86
|
+
function reportWasmIntegritySummary() {
|
|
87
|
+
if (verified + failed + bundled === 0) return;
|
|
88
|
+
const summary = {
|
|
89
|
+
wasmVersion: WASM_INTEGRITY_MANIFEST.wasmVersion,
|
|
90
|
+
verified,
|
|
91
|
+
failed,
|
|
92
|
+
bundled,
|
|
93
|
+
hashMs: Math.round(hashMs)
|
|
94
|
+
};
|
|
95
|
+
verified = 0;
|
|
96
|
+
failed = 0;
|
|
97
|
+
bundled = 0;
|
|
98
|
+
hashMs = 0;
|
|
99
|
+
try {
|
|
100
|
+
observer?.onSummary?.(summary);
|
|
101
|
+
} catch {}
|
|
102
|
+
}
|
|
103
|
+
/** Records glue that arrived through a `loadGlue` callback and has no bytes. */
|
|
104
|
+
function reportBundledWasmGlue(slot) {
|
|
105
|
+
notify({
|
|
106
|
+
asset: slot,
|
|
107
|
+
status: "bundled"
|
|
108
|
+
});
|
|
109
|
+
}
|
|
110
|
+
function assetLabel(asset) {
|
|
111
|
+
return asset.kind === "model" ? asset.file ?? "model" : asset.slot;
|
|
112
|
+
}
|
|
113
|
+
function expectedDigests(asset) {
|
|
114
|
+
const { files, dist } = WASM_INTEGRITY_MANIFEST;
|
|
115
|
+
if (asset.kind === "binary") return [files[asset.slot]].filter(isDigest);
|
|
116
|
+
if (asset.kind === "glue") return [files[asset.slot], dist[asset.slot]].filter(isDigest);
|
|
117
|
+
if (asset.file === void 0) return Object.entries(files).filter(([key]) => key.startsWith("models/")).map(([, digest]) => digest);
|
|
118
|
+
return [files[`models/current/${asset.file}`], files[`models/legacy/${asset.file}`]].filter(isDigest);
|
|
119
|
+
}
|
|
120
|
+
function isDigest(value) {
|
|
121
|
+
return typeof value === "string" && value.length > 0;
|
|
122
|
+
}
|
|
123
|
+
function toHex(buffer) {
|
|
124
|
+
return Array.from(new Uint8Array(buffer), (byte) => byte.toString(16).padStart(2, "0")).join("");
|
|
125
|
+
}
|
|
126
|
+
function looksLikeHtml(bytes) {
|
|
127
|
+
let text = new TextDecoder("utf-8", { fatal: false }).decode(bytes.subarray(0, HTML_SNIFF_BYTES));
|
|
128
|
+
if (text.charCodeAt(0) === 65279) text = text.slice(1);
|
|
129
|
+
const start = text.trimStart().slice(0, 9).toLowerCase();
|
|
130
|
+
return start.startsWith("<!doctype") || start.startsWith("<html");
|
|
131
|
+
}
|
|
132
|
+
/**
|
|
133
|
+
* Rejects an HTML page served in place of an asset. The Incode CDN answers
|
|
134
|
+
* every missing path with HTTP 200 and a small HTML page, so `response.ok`
|
|
135
|
+
* cannot detect a miss.
|
|
136
|
+
*/
|
|
137
|
+
function assertNotHtml(contentType, bytes, asset) {
|
|
138
|
+
if (contentType?.toLowerCase().includes("text/html") || looksLikeHtml(bytes)) {
|
|
139
|
+
const label = assetLabel(asset);
|
|
140
|
+
notify({
|
|
141
|
+
asset: label,
|
|
142
|
+
status: "not-binary",
|
|
143
|
+
byteLength: bytes.byteLength
|
|
144
|
+
});
|
|
145
|
+
throw new WasmIntegrityError("WASM_ASSET_NOT_BINARY", label, `The WASM asset ${label} was served as an HTML page (${bytes.byteLength} bytes), not the release file. Check that the file exists at its configured URL.`);
|
|
146
|
+
}
|
|
147
|
+
}
|
|
148
|
+
/**
|
|
149
|
+
* Verifies `bytes` against the official digests for `asset` and throws a
|
|
150
|
+
* {@link WasmIntegrityError} when they do not match. `fetchMs`, when the
|
|
151
|
+
* bytes came over the network, rides along on the reported check.
|
|
152
|
+
*/
|
|
153
|
+
async function verifyWasmAsset(asset, bytes, fetchMs) {
|
|
154
|
+
const label = assetLabel(asset);
|
|
155
|
+
const subtle = globalThis.crypto?.subtle;
|
|
156
|
+
if (subtle === void 0) {
|
|
157
|
+
notify({
|
|
158
|
+
asset: label,
|
|
159
|
+
status: "unavailable"
|
|
160
|
+
});
|
|
161
|
+
throw new WasmIntegrityError("WASM_INTEGRITY_UNAVAILABLE", label, "WASM assets cannot be verified because crypto.subtle is unavailable. Serve the page over HTTPS.");
|
|
162
|
+
}
|
|
163
|
+
const startedAt = performance.now();
|
|
164
|
+
const actual = toHex(await subtle.digest("SHA-256", bytes));
|
|
165
|
+
const durationMs = performance.now() - startedAt;
|
|
166
|
+
const expected = expectedDigests(asset);
|
|
167
|
+
if (expected.includes(actual)) {
|
|
168
|
+
notify({
|
|
169
|
+
asset: label,
|
|
170
|
+
status: "verified",
|
|
171
|
+
durationMs,
|
|
172
|
+
fetchMs,
|
|
173
|
+
byteLength: bytes.byteLength
|
|
174
|
+
});
|
|
175
|
+
return;
|
|
176
|
+
}
|
|
177
|
+
notify({
|
|
178
|
+
asset: label,
|
|
179
|
+
status: "mismatch",
|
|
180
|
+
durationMs,
|
|
181
|
+
fetchMs,
|
|
182
|
+
byteLength: bytes.byteLength,
|
|
183
|
+
expectedDigestPrefix: expected[0]?.slice(0, DIGEST_PREFIX_LENGTH),
|
|
184
|
+
actualDigestPrefix: actual.slice(0, DIGEST_PREFIX_LENGTH)
|
|
185
|
+
});
|
|
186
|
+
throw new WasmIntegrityError("WASM_INTEGRITY_MISMATCH", label, `The WASM asset ${label} does not match the official ${WASM_INTEGRITY_MANIFEST.wasmVersion} release file. Serve the unmodified files for this SDK release.`);
|
|
187
|
+
}
|
|
188
|
+
//#endregion
|
|
1
189
|
//#region ../infra/src/wasm/wasmAssets.ts
|
|
2
190
|
const WASM_MODEL_FILES = {
|
|
3
191
|
idCapture: "id_capture_2_01_fp16.ortmodelv2",
|
|
@@ -83,9 +271,21 @@ const WASM_PIPELINE_MODELS = {
|
|
|
83
271
|
videoSelfie: WASM_PIPELINE_MODEL_NAMES.videoSelfie.map((model) => WASM_MODEL_FILES[model]),
|
|
84
272
|
videoSelfieId: WASM_PIPELINE_MODEL_NAMES.videoSelfieId.map((model) => WASM_MODEL_FILES[model])
|
|
85
273
|
};
|
|
86
|
-
|
|
274
|
+
/**
|
|
275
|
+
* Loads a WASM asset as bytes and verifies it against the official release
|
|
276
|
+
* digests before returning it. Byte sources are verified too: the check does
|
|
277
|
+
* not depend on where an asset comes from.
|
|
278
|
+
*/
|
|
279
|
+
async function resolveWasmSource(source, asset) {
|
|
280
|
+
const fetchStartedAt = performance.now();
|
|
281
|
+
const bytes = await fetchWasmSource(source, asset);
|
|
282
|
+
await verifyWasmAsset(asset, bytes, typeof source === "string" ? performance.now() - fetchStartedAt : void 0);
|
|
283
|
+
return bytes;
|
|
284
|
+
}
|
|
285
|
+
async function fetchWasmSource(source, asset) {
|
|
87
286
|
if (source instanceof Uint8Array) return source;
|
|
88
287
|
if (source instanceof ArrayBuffer) return new Uint8Array(source);
|
|
288
|
+
const { kind } = asset;
|
|
89
289
|
let response;
|
|
90
290
|
try {
|
|
91
291
|
response = await fetch(source);
|
|
@@ -94,7 +294,9 @@ async function resolveWasmSource(source, kind) {
|
|
|
94
294
|
throw new Error(`[Incode SDK] Could not load the WASM ${kind} at ${source}: ${detail}`);
|
|
95
295
|
}
|
|
96
296
|
if (!response.ok) throw new Error(`[Incode SDK] Could not load the WASM ${kind} at ${source}: ${response.status} ${response.statusText}`);
|
|
97
|
-
|
|
297
|
+
const bytes = new Uint8Array(await response.arrayBuffer());
|
|
298
|
+
assertNotHtml(response.headers.get("content-type"), bytes, asset);
|
|
299
|
+
return bytes;
|
|
98
300
|
}
|
|
99
301
|
function missingWasmModelError(fileName, pipeline) {
|
|
100
302
|
return /* @__PURE__ */ new Error(`[Incode SDK] The "${pipeline}" pipeline needs ${fileName}, but the self-hosted WASM configuration does not provide it.`);
|
|
@@ -109,6 +311,155 @@ function deriveSiblingJsPath(wasmPath) {
|
|
|
109
311
|
return `${wasmPath.slice(0, index)}.js${rest}`;
|
|
110
312
|
}
|
|
111
313
|
//#endregion
|
|
314
|
+
//#region ../infra/src/wasm/wasmDefaults.ts
|
|
315
|
+
const WASM_CDN_BASE_URL = "https://cdn.incodesmile.com/ml-wasm-kit-release";
|
|
316
|
+
/** The WASM version bundled and tested with this SDK release. */
|
|
317
|
+
const DEFAULT_WASM_VERSION = "v2.14.50-post1";
|
|
318
|
+
const PATH_KEYS = [
|
|
319
|
+
"wasmPath",
|
|
320
|
+
"wasmSimdPath",
|
|
321
|
+
"glueCodePath",
|
|
322
|
+
"glueCodeSimdPath",
|
|
323
|
+
"modelsBasePath"
|
|
324
|
+
];
|
|
325
|
+
function isBlank(value) {
|
|
326
|
+
return value.trim() === "";
|
|
327
|
+
}
|
|
328
|
+
function hasDisallowedControlChars(value) {
|
|
329
|
+
for (let i = 0; i < value.length; i += 1) {
|
|
330
|
+
const code = value.charCodeAt(i);
|
|
331
|
+
if (code < 32 || code === 127) return true;
|
|
332
|
+
}
|
|
333
|
+
return false;
|
|
334
|
+
}
|
|
335
|
+
function isMalformedPath(value) {
|
|
336
|
+
const trimmed = value.trim();
|
|
337
|
+
if (trimmed === "") return false;
|
|
338
|
+
if (hasDisallowedControlChars(trimmed)) return true;
|
|
339
|
+
if (/^https?:\/\//i.test(trimmed)) try {
|
|
340
|
+
new URL(trimmed);
|
|
341
|
+
return false;
|
|
342
|
+
} catch {
|
|
343
|
+
return true;
|
|
344
|
+
}
|
|
345
|
+
return false;
|
|
346
|
+
}
|
|
347
|
+
function warnInvalidWasmPath(field, reason) {
|
|
348
|
+
if (reason === "empty") {
|
|
349
|
+
console.warn(`[Incode SDK] wasm.${field} is empty. Falling back to CDN default.`);
|
|
350
|
+
return;
|
|
351
|
+
}
|
|
352
|
+
console.warn(`[Incode SDK] wasm.${field} appears malformed. Falling back to CDN default.`);
|
|
353
|
+
}
|
|
354
|
+
function warnMalformedWasmPath(field) {
|
|
355
|
+
console.warn(`[Incode SDK] wasm.${field} appears malformed. Check the URL or path.`);
|
|
356
|
+
}
|
|
357
|
+
/**
|
|
358
|
+
* Validates merged WASM path strings. When overrides contained blank path
|
|
359
|
+
* values, callers should have already fallen back to defaults before this runs.
|
|
360
|
+
*/
|
|
361
|
+
function validateWasmPaths(config) {
|
|
362
|
+
for (const key of PATH_KEYS) {
|
|
363
|
+
const value = config[key];
|
|
364
|
+
if (typeof value === "string" && isMalformedPath(value)) warnMalformedWasmPath(key);
|
|
365
|
+
}
|
|
366
|
+
}
|
|
367
|
+
function pickPath(key, overrides, defaultValue) {
|
|
368
|
+
if (!overrides || !(key in overrides)) return defaultValue;
|
|
369
|
+
const raw = overrides[key];
|
|
370
|
+
if (raw === void 0) return defaultValue;
|
|
371
|
+
if (typeof raw !== "string") return defaultValue;
|
|
372
|
+
if (isBlank(raw)) {
|
|
373
|
+
warnInvalidWasmPath(key, "empty");
|
|
374
|
+
return defaultValue;
|
|
375
|
+
}
|
|
376
|
+
if (isMalformedPath(raw)) {
|
|
377
|
+
warnInvalidWasmPath(key, "malformed");
|
|
378
|
+
return defaultValue;
|
|
379
|
+
}
|
|
380
|
+
return raw.trim();
|
|
381
|
+
}
|
|
382
|
+
function pickSource(key, overrides, defaultValue) {
|
|
383
|
+
if (!(key in overrides) || overrides[key] === void 0) return defaultValue;
|
|
384
|
+
const source = overrides[key];
|
|
385
|
+
if (typeof source !== "string") return source;
|
|
386
|
+
return pickPath(key, overrides, String(defaultValue));
|
|
387
|
+
}
|
|
388
|
+
function resolveBasePath(overrides) {
|
|
389
|
+
const defaultValue = `${WASM_CDN_BASE_URL}/${DEFAULT_WASM_VERSION}`;
|
|
390
|
+
if (!("basePath" in overrides) || overrides.basePath === void 0) return defaultValue;
|
|
391
|
+
const basePath = overrides.basePath;
|
|
392
|
+
if (typeof basePath !== "string" || isBlank(basePath) || isMalformedPath(basePath)) throw new Error("[Incode SDK] wasm.basePath is invalid.");
|
|
393
|
+
return basePath.trim();
|
|
394
|
+
}
|
|
395
|
+
/** Builds a WarmupConfig from a directory that mirrors the ml-wasm-kit CDN layout. */
|
|
396
|
+
function buildWasmConfigFromBasePath(basePath) {
|
|
397
|
+
const base = basePath.endsWith("/") ? basePath.slice(0, -1) : basePath;
|
|
398
|
+
return {
|
|
399
|
+
wasmPath: `${base}/webLib.wasm`,
|
|
400
|
+
wasmSimdPath: `${base}/webLibSimd.wasm`,
|
|
401
|
+
glueCodePath: `${base}/webLib.js`,
|
|
402
|
+
glueCodeSimdPath: `${base}/webLibSimd.js`,
|
|
403
|
+
modelsBasePath: `${base}/models`
|
|
404
|
+
};
|
|
405
|
+
}
|
|
406
|
+
/** Builds the standard WarmupConfig from the Incode CDN. */
|
|
407
|
+
function buildDefaultWasmConfig() {
|
|
408
|
+
return buildWasmConfigFromBasePath(`${WASM_CDN_BASE_URL}/${DEFAULT_WASM_VERSION}`);
|
|
409
|
+
}
|
|
410
|
+
/**
|
|
411
|
+
* Whether `config` loads the SDK's own CDN build of `DEFAULT_WASM_VERSION`.
|
|
412
|
+
* TrueSight reports its negation as `basePathPinned`: the host pointed the
|
|
413
|
+
* SDK at its own location, version, or bytes.
|
|
414
|
+
*/
|
|
415
|
+
function isDefaultCdnWasmConfig(config) {
|
|
416
|
+
const defaults = buildDefaultWasmConfig();
|
|
417
|
+
return config.selfHosted !== true && config.wasmPath === defaults.wasmPath && config.glueCodePath === defaults.glueCodePath;
|
|
418
|
+
}
|
|
419
|
+
const BARCODE_ENHANCE_MODEL_FILE = WASM_MODEL_FILES.barcode;
|
|
420
|
+
/**
|
|
421
|
+
* URL of the lazily-loaded PDF417 barcode enhancement model (US Smart Capture).
|
|
422
|
+
* Derived from the resolved `modelsBasePath` so self-hosted / air-gapped
|
|
423
|
+
* deployments resolve it correctly, falling back to the CDN default. Loaded on
|
|
424
|
+
* demand via `IIdCaptureCapability.setBarcodeEnhancementModel` — deliberately
|
|
425
|
+
* NOT part of any warmup model bundle.
|
|
426
|
+
*/
|
|
427
|
+
function getBarcodeEnhanceModelUrl(modelsBasePath, variant = "current") {
|
|
428
|
+
const source = buildModelVariantSources(modelsBasePath ?? `${WASM_CDN_BASE_URL}/v2.14.50-post1/models`, BARCODE_ENHANCE_MODEL_FILE);
|
|
429
|
+
return typeof source === "string" ? source : source[variant];
|
|
430
|
+
}
|
|
431
|
+
/**
|
|
432
|
+
* Merges optional WASM path overrides with CDN defaults. Explicit non-blank
|
|
433
|
+
* paths take precedence. Blank override strings log a warning and fall back to defaults.
|
|
434
|
+
*/
|
|
435
|
+
function resolveWasmConfig(overrides) {
|
|
436
|
+
if (!overrides) return buildDefaultWasmConfig();
|
|
437
|
+
const defaults = buildWasmConfigFromBasePath(resolveBasePath(overrides));
|
|
438
|
+
const resolvedWasmPath = pickSource("wasmPath", overrides, defaults.wasmPath);
|
|
439
|
+
const simdDefault = overrides.selfHosted ? resolvedWasmPath : defaults.wasmSimdPath;
|
|
440
|
+
const modelsDefault = defaults.modelsBasePath;
|
|
441
|
+
const resolvedWasmSimdPath = pickSource("wasmSimdPath", overrides, simdDefault);
|
|
442
|
+
const glueCodeSimdDefault = typeof resolvedWasmSimdPath === "string" ? deriveSiblingJsPath(resolvedWasmSimdPath) : defaults.glueCodeSimdPath;
|
|
443
|
+
const merged = {
|
|
444
|
+
wasmPath: resolvedWasmPath,
|
|
445
|
+
wasmSimdPath: resolvedWasmSimdPath,
|
|
446
|
+
glueCodePath: pickPath("glueCodePath", overrides, defaults.glueCodePath),
|
|
447
|
+
glueCodeSimdPath: pickPath("glueCodeSimdPath", overrides, glueCodeSimdDefault),
|
|
448
|
+
modelsBasePath: pickPath("modelsBasePath", overrides, modelsDefault),
|
|
449
|
+
useSimd: overrides.useSimd,
|
|
450
|
+
showLogs: overrides.showLogs,
|
|
451
|
+
pipelines: overrides.pipelines,
|
|
452
|
+
pipelineModels: overrides.pipelineModels,
|
|
453
|
+
modelUrls: overrides.modelUrls,
|
|
454
|
+
legacyModelUrls: overrides.legacyModelUrls,
|
|
455
|
+
loadGlue: overrides.loadGlue,
|
|
456
|
+
loadGlueSimd: overrides.loadGlueSimd,
|
|
457
|
+
selfHosted: overrides.selfHosted
|
|
458
|
+
};
|
|
459
|
+
validateWasmPaths(merged);
|
|
460
|
+
return merged;
|
|
461
|
+
}
|
|
462
|
+
//#endregion
|
|
112
463
|
//#region ../infra/src/providers/browser/SemaphoreProvider.ts
|
|
113
464
|
const DEFAULT_ACQUIRE_TIMEOUT_MS = 3e4;
|
|
114
465
|
/**
|
|
@@ -208,6 +559,44 @@ var SemaphoreProvider = class {
|
|
|
208
559
|
}
|
|
209
560
|
};
|
|
210
561
|
//#endregion
|
|
562
|
+
//#region ../infra/src/wasm/wasmDiagnostics.ts
|
|
563
|
+
let handler = null;
|
|
564
|
+
function setWasmDiagnosticsHandler(next) {
|
|
565
|
+
handler = next;
|
|
566
|
+
}
|
|
567
|
+
/**
|
|
568
|
+
* Fire-and-forget: a no-op without a handler, and handler exceptions are
|
|
569
|
+
* swallowed — diagnostics must never throw into the host code path.
|
|
570
|
+
*/
|
|
571
|
+
function emitWasmDiagnostic(entry) {
|
|
572
|
+
if (handler === null) return;
|
|
573
|
+
try {
|
|
574
|
+
handler(entry);
|
|
575
|
+
} catch {}
|
|
576
|
+
}
|
|
577
|
+
//#endregion
|
|
578
|
+
//#region ../infra/src/wasm/wasmGlueImport.ts
|
|
579
|
+
/**
|
|
580
|
+
* Evaluates verified glue bytes as an ES module from a `blob:` URL.
|
|
581
|
+
*
|
|
582
|
+
* The bytes are the ones the integrity check hashed. Importing the original URL
|
|
583
|
+
* instead would fetch it a second time, and that response is not the one that
|
|
584
|
+
* was checked. Kept in its own module so unit tests, which cannot import
|
|
585
|
+
* `blob:` URLs under Node, can substitute it.
|
|
586
|
+
*/
|
|
587
|
+
async function importVerifiedGlue(bytes) {
|
|
588
|
+
const blobUrl = URL.createObjectURL(new Blob([bytes], { type: "text/javascript" }));
|
|
589
|
+
try {
|
|
590
|
+
return await import(
|
|
591
|
+
/* @vite-ignore */
|
|
592
|
+
/* webpackIgnore: true */
|
|
593
|
+
blobUrl
|
|
594
|
+
);
|
|
595
|
+
} finally {
|
|
596
|
+
URL.revokeObjectURL(blobUrl);
|
|
597
|
+
}
|
|
598
|
+
}
|
|
599
|
+
//#endregion
|
|
211
600
|
//#region ../infra/src/wasm/wasmStorageFallback.ts
|
|
212
601
|
/**
|
|
213
602
|
* SDK-local compatibility fallback for ml-wasm-kit releases whose embind
|
|
@@ -411,30 +800,61 @@ function acquireWasmStorageFallback() {
|
|
|
411
800
|
if (typeof window !== "undefined" && window.wasmArrayBuffer === void 0) window.wasmArrayBuffer = null;
|
|
412
801
|
let loadPromise = null;
|
|
413
802
|
let loadedResult = null;
|
|
414
|
-
|
|
415
|
-
|
|
416
|
-
|
|
417
|
-
|
|
418
|
-
|
|
419
|
-
);
|
|
803
|
+
/** Fetches the glue, verifies it, and evaluates exactly the verified bytes. */
|
|
804
|
+
async function importGlueAt(glueCodePath, slot) {
|
|
805
|
+
const bytes = await resolveWasmSource(glueCodePath, {
|
|
806
|
+
kind: "glue",
|
|
807
|
+
slot
|
|
808
|
+
});
|
|
809
|
+
let mod;
|
|
810
|
+
try {
|
|
811
|
+
mod = await importVerifiedGlue(bytes);
|
|
812
|
+
} catch (error) {
|
|
813
|
+
throw new WasmIntegrityError("WASM_GLUE_BLOCKED_BY_CSP", slot, `The verified WASM glue ${slot} could not be loaded from a blob: URL. Allow blob: in the script-src Content-Security-Policy directive.`, error);
|
|
814
|
+
}
|
|
420
815
|
if (typeof mod.Module !== "function") throw new Error(`WASM glue at ${glueCodePath} did not export a Module factory`);
|
|
421
816
|
return mod.Module;
|
|
422
817
|
}
|
|
423
|
-
async function resolveGlue(loader, glueCodePath) {
|
|
818
|
+
async function resolveGlue(loader, glueCodePath, slot) {
|
|
424
819
|
if (loader) {
|
|
425
820
|
const module = await loader();
|
|
426
821
|
if (typeof module.Module !== "function") throw new Error("[Incode SDK] WASM glue module did not export a Module factory.");
|
|
822
|
+
reportBundledWasmGlue(slot);
|
|
427
823
|
return module.Module;
|
|
428
824
|
}
|
|
429
825
|
if (!glueCodePath) throw new Error("WASM glue code is required");
|
|
430
|
-
return await importGlueAt(glueCodePath);
|
|
826
|
+
return await importGlueAt(glueCodePath, slot);
|
|
431
827
|
}
|
|
432
|
-
async function instantiate(factory, libPath) {
|
|
433
|
-
window.wasmArrayBuffer = await resolveWasmSource(libPath,
|
|
434
|
-
|
|
828
|
+
async function instantiate(factory, libPath, slot, showLogs = false) {
|
|
829
|
+
window.wasmArrayBuffer = await resolveWasmSource(libPath, {
|
|
830
|
+
kind: "binary",
|
|
831
|
+
slot
|
|
832
|
+
});
|
|
833
|
+
return await factory({
|
|
834
|
+
wasmBinary: window.wasmArrayBuffer,
|
|
835
|
+
print: (text) => {
|
|
836
|
+
if (showLogs) console.log(text);
|
|
837
|
+
},
|
|
838
|
+
printErr: (text) => {
|
|
839
|
+
if (showLogs) console.error(text);
|
|
840
|
+
},
|
|
841
|
+
onAbort: (what) => {
|
|
842
|
+
emitWasmDiagnostic({
|
|
843
|
+
level: "severe",
|
|
844
|
+
subsystem: "abort",
|
|
845
|
+
category: "other",
|
|
846
|
+
message: `wasm aborted what=${String(what)}`
|
|
847
|
+
});
|
|
848
|
+
}
|
|
849
|
+
});
|
|
850
|
+
}
|
|
851
|
+
/** `code=` for integrity failures, which name a cause more precisely than the message. */
|
|
852
|
+
function describeLoadError(error) {
|
|
853
|
+
return error instanceof WasmIntegrityError ? `code=${error.code} asset=${error.asset}` : `error=${String(error)}`;
|
|
435
854
|
}
|
|
436
855
|
/**
|
|
437
|
-
* Load the WASM module, memoized. Subsequent calls return the same instance
|
|
856
|
+
* Load the WASM module, memoized. Subsequent calls return the same instance,
|
|
857
|
+
* retaining the first caller's logging configuration.
|
|
438
858
|
*
|
|
439
859
|
* SIMD-first with fallback: if `useSimd !== false` and a `wasmSimdPath` is
|
|
440
860
|
* provided, the SIMD binary + SIMD glue are tried first; on instantiation
|
|
@@ -444,6 +864,7 @@ async function instantiate(factory, libPath) {
|
|
|
444
864
|
async function loadWasmModule(config) {
|
|
445
865
|
if (loadedResult) return loadedResult;
|
|
446
866
|
if (loadPromise) return loadPromise;
|
|
867
|
+
const startedAtMs = getTimestamp();
|
|
447
868
|
loadPromise = (async () => {
|
|
448
869
|
let storageFallbackLease = null;
|
|
449
870
|
try {
|
|
@@ -451,27 +872,52 @@ async function loadWasmModule(config) {
|
|
|
451
872
|
const wantSimd = config.useSimd !== false;
|
|
452
873
|
const simdBinary = config.wasmSimdPath ?? config.wasmPath;
|
|
453
874
|
if (wantSimd && simdBinary !== config.wasmPath) try {
|
|
454
|
-
const simdFactory = await resolveGlue(config.loadGlueSimd, typeof simdBinary === "string" ? config.glueCodeSimdPath || deriveSiblingJsPath(simdBinary) : config.glueCodeSimdPath);
|
|
875
|
+
const simdFactory = await resolveGlue(config.loadGlueSimd, typeof simdBinary === "string" ? config.glueCodeSimdPath || deriveSiblingJsPath(simdBinary) : config.glueCodeSimdPath, "webLibSimd.js");
|
|
455
876
|
window.Module = simdFactory;
|
|
456
877
|
const result = {
|
|
457
|
-
wasmModule: await instantiate(simdFactory, simdBinary),
|
|
878
|
+
wasmModule: await instantiate(simdFactory, simdBinary, "webLibSimd.wasm", config.showLogs),
|
|
458
879
|
simdUsed: true
|
|
459
880
|
};
|
|
460
881
|
loadedResult = result;
|
|
882
|
+
emitWasmDiagnostic({
|
|
883
|
+
level: "debug",
|
|
884
|
+
subsystem: "loader",
|
|
885
|
+
category: "other",
|
|
886
|
+
message: `wasm module loaded simd=true durationMs=${getTimestamp() - startedAtMs}`
|
|
887
|
+
});
|
|
461
888
|
return result;
|
|
462
889
|
} catch (simdError) {
|
|
463
|
-
|
|
890
|
+
if (simdError instanceof WasmIntegrityError) throw simdError;
|
|
891
|
+
if (config.showLogs) console.warn("[Incode SDK] SIMD WASM load failed, falling back to non-SIMD", simdError);
|
|
892
|
+
emitWasmDiagnostic({
|
|
893
|
+
level: "warning",
|
|
894
|
+
subsystem: "loader",
|
|
895
|
+
category: "other",
|
|
896
|
+
message: `simd load failed falling back ${describeLoadError(simdError)}`
|
|
897
|
+
});
|
|
464
898
|
}
|
|
465
|
-
const nonSimdFactory = await resolveGlue(config.loadGlue, config.glueCodePath);
|
|
899
|
+
const nonSimdFactory = await resolveGlue(config.loadGlue, config.glueCodePath, "webLib.js");
|
|
466
900
|
window.Module = nonSimdFactory;
|
|
467
901
|
const result = {
|
|
468
|
-
wasmModule: await instantiate(nonSimdFactory, config.wasmPath),
|
|
902
|
+
wasmModule: await instantiate(nonSimdFactory, config.wasmPath, "webLib.wasm", config.showLogs),
|
|
469
903
|
simdUsed: false
|
|
470
904
|
};
|
|
471
905
|
loadedResult = result;
|
|
906
|
+
emitWasmDiagnostic({
|
|
907
|
+
level: "debug",
|
|
908
|
+
subsystem: "loader",
|
|
909
|
+
category: "other",
|
|
910
|
+
message: `wasm module loaded simd=false durationMs=${getTimestamp() - startedAtMs}`
|
|
911
|
+
});
|
|
472
912
|
return result;
|
|
473
913
|
} catch (error) {
|
|
474
914
|
loadPromise = null;
|
|
915
|
+
emitWasmDiagnostic({
|
|
916
|
+
level: "error",
|
|
917
|
+
subsystem: "loader",
|
|
918
|
+
category: "other",
|
|
919
|
+
message: `wasm load failed ${describeLoadError(error)}`
|
|
920
|
+
});
|
|
475
921
|
throw error;
|
|
476
922
|
} finally {
|
|
477
923
|
storageFallbackLease?.release();
|
|
@@ -479,6 +925,98 @@ async function loadWasmModule(config) {
|
|
|
479
925
|
})();
|
|
480
926
|
return loadPromise;
|
|
481
927
|
}
|
|
928
|
+
function emptyCounters() {
|
|
929
|
+
return {
|
|
930
|
+
analyzeFrameCount: 0,
|
|
931
|
+
analyzeFrameMaxMs: 0,
|
|
932
|
+
getCheckCount: 0,
|
|
933
|
+
collisionCount: 0
|
|
934
|
+
};
|
|
935
|
+
}
|
|
936
|
+
let lockHeldBy = null;
|
|
937
|
+
let waitWarningsLogged = 0;
|
|
938
|
+
let collisionWarningsLogged = 0;
|
|
939
|
+
let counters = emptyCounters();
|
|
940
|
+
function noteLockAcquired(label, waitMs) {
|
|
941
|
+
lockHeldBy = label;
|
|
942
|
+
if (waitMs > 250 && waitWarningsLogged < 5) {
|
|
943
|
+
waitWarningsLogged += 1;
|
|
944
|
+
emitWasmDiagnostic({
|
|
945
|
+
level: "warning",
|
|
946
|
+
subsystem: "calls",
|
|
947
|
+
category: "other",
|
|
948
|
+
message: `semaphore wait method=${label} waitMs=${Math.round(waitMs)}`
|
|
949
|
+
});
|
|
950
|
+
}
|
|
951
|
+
}
|
|
952
|
+
function noteLockReleased(label, waitMs, durationMs) {
|
|
953
|
+
lockHeldBy = null;
|
|
954
|
+
emitWasmDiagnostic({
|
|
955
|
+
level: "debug",
|
|
956
|
+
subsystem: "calls",
|
|
957
|
+
category: "other",
|
|
958
|
+
message: `call method=${label} waitMs=${Math.round(waitMs)} durationMs=${Math.round(durationMs)}`
|
|
959
|
+
});
|
|
960
|
+
}
|
|
961
|
+
/** Collision check for the lock-bypassing deepsight methods. */
|
|
962
|
+
function noteUnlockedCallStart(name) {
|
|
963
|
+
if (lockHeldBy === null) return;
|
|
964
|
+
counters.collisionCount += 1;
|
|
965
|
+
if (collisionWarningsLogged < 5) {
|
|
966
|
+
collisionWarningsLogged += 1;
|
|
967
|
+
emitWasmDiagnostic({
|
|
968
|
+
level: "warning",
|
|
969
|
+
subsystem: "calls",
|
|
970
|
+
category: "other",
|
|
971
|
+
message: `collision unlocked=${name} lockedBy=${lockHeldBy}`
|
|
972
|
+
});
|
|
973
|
+
}
|
|
974
|
+
}
|
|
975
|
+
function noteUnlockedCallEnd(name, durationMs) {
|
|
976
|
+
if (name === "analyzeFrame") {
|
|
977
|
+
counters.analyzeFrameCount += 1;
|
|
978
|
+
counters.analyzeFrameMaxMs = Math.max(counters.analyzeFrameMaxMs, Math.round(durationMs));
|
|
979
|
+
return;
|
|
980
|
+
}
|
|
981
|
+
counters.getCheckCount += 1;
|
|
982
|
+
}
|
|
983
|
+
/** Aggregates since the last snapshot; clears them for the next capture. */
|
|
984
|
+
function snapshotAndResetCallCounters() {
|
|
985
|
+
const snapshot = counters;
|
|
986
|
+
counters = emptyCounters();
|
|
987
|
+
return snapshot;
|
|
988
|
+
}
|
|
989
|
+
let pipelinePullEmissions = 0;
|
|
990
|
+
/**
|
|
991
|
+
* Row 36: each pipeline-state pull (once per capture) carries the row 29b
|
|
992
|
+
* counters accumulated since the previous one, then resets them. The state
|
|
993
|
+
* itself is never read: what the kit's pipelines expose to diagnostics is
|
|
994
|
+
* the kit's own decision (its sensor withholds verdicts such as age and
|
|
995
|
+
* liveness), so the SDK keeps no second gate over the C++ blob.
|
|
996
|
+
*/
|
|
997
|
+
function notePipelineStatePulled() {
|
|
998
|
+
if (pipelinePullEmissions >= 20) return;
|
|
999
|
+
pipelinePullEmissions += 1;
|
|
1000
|
+
const calls = snapshotAndResetCallCounters();
|
|
1001
|
+
emitWasmDiagnostic({
|
|
1002
|
+
level: "debug",
|
|
1003
|
+
subsystem: "pipeline",
|
|
1004
|
+
category: "other",
|
|
1005
|
+
message: `pipeline state pulled analyzeFrames=${calls.analyzeFrameCount} maxAnalyzeMs=${calls.analyzeFrameMaxMs} getChecks=${calls.getCheckCount} collisions=${calls.collisionCount}`
|
|
1006
|
+
});
|
|
1007
|
+
}
|
|
1008
|
+
/** Per-session budgets and counters; called from `setup()` via `rearmWasmDiagnostics`. */
|
|
1009
|
+
function rearmWasmCallDiagnostics() {
|
|
1010
|
+
waitWarningsLogged = 0;
|
|
1011
|
+
collisionWarningsLogged = 0;
|
|
1012
|
+
counters = emptyCounters();
|
|
1013
|
+
pipelinePullEmissions = 0;
|
|
1014
|
+
}
|
|
1015
|
+
/** Full reset with the runtime (`WasmRuntime.freeResources()`). */
|
|
1016
|
+
function resetWasmCallDiagnostics() {
|
|
1017
|
+
lockHeldBy = null;
|
|
1018
|
+
rearmWasmCallDiagnostics();
|
|
1019
|
+
}
|
|
482
1020
|
//#endregion
|
|
483
1021
|
//#region ../infra/src/wasm/wasmCallUtils.ts
|
|
484
1022
|
/**
|
|
@@ -513,18 +1051,6 @@ var WasmPollTimeoutError = class extends Error {
|
|
|
513
1051
|
this.label = label;
|
|
514
1052
|
}
|
|
515
1053
|
};
|
|
516
|
-
/**
|
|
517
|
-
* Busy-polls an iterative WASM method until it returns `true`, optionally under
|
|
518
|
-
* a concurrency lock.
|
|
519
|
-
*
|
|
520
|
-
* @param concurrency - semaphore used when `useSemaphore` is true.
|
|
521
|
-
* @param wasmMethod - zero-arg closure over the C++ call; `false` means "call me
|
|
522
|
-
* again", `true` means done. Bind any arguments in the closure.
|
|
523
|
-
* @param useSemaphore - `false` bypasses the lock (caller already holds one, or
|
|
524
|
-
* is provably the only caller).
|
|
525
|
-
* @param options - see {@link WasmPollOptions}. `maxPolls` omitted = unbounded.
|
|
526
|
-
* @throws {WasmPollTimeoutError} when `maxPolls` is exhausted.
|
|
527
|
-
*/
|
|
528
1054
|
async function wasmCallWrapper(concurrency, wasmMethod, useSemaphore = true, options = {}) {
|
|
529
1055
|
const { maxPolls, label } = options;
|
|
530
1056
|
const innerCall = async () => {
|
|
@@ -537,7 +1063,18 @@ async function wasmCallWrapper(concurrency, wasmMethod, useSemaphore = true, opt
|
|
|
537
1063
|
}
|
|
538
1064
|
};
|
|
539
1065
|
if (useSemaphore) {
|
|
540
|
-
|
|
1066
|
+
const callLabel = label ?? "unlabeled";
|
|
1067
|
+
const requestedAt = performance.now();
|
|
1068
|
+
await concurrency.withLock(async () => {
|
|
1069
|
+
const acquiredAt = performance.now();
|
|
1070
|
+
const waitMs = acquiredAt - requestedAt;
|
|
1071
|
+
noteLockAcquired(callLabel, waitMs);
|
|
1072
|
+
try {
|
|
1073
|
+
await innerCall();
|
|
1074
|
+
} finally {
|
|
1075
|
+
noteLockReleased(callLabel, waitMs, performance.now() - acquiredAt);
|
|
1076
|
+
}
|
|
1077
|
+
});
|
|
541
1078
|
return;
|
|
542
1079
|
}
|
|
543
1080
|
await innerCall();
|
|
@@ -734,4 +1271,4 @@ function ensureReady() {
|
|
|
734
1271
|
return webClientApi;
|
|
735
1272
|
}
|
|
736
1273
|
//#endregion
|
|
737
|
-
export {
|
|
1274
|
+
export { buildModelVariantSources as A, isDefaultCdnWasmConfig as C, WASM_PIPELINE_MODELS as D, WASM_PIPELINE_LAZY_MODEL_NAMES as E, resolveWasmSource as M, reportWasmIntegritySummary as N, WASM_PIPELINE_MODEL_NAMES as O, setWasmIntegrityObserver as P, getBarcodeEnhanceModelUrl as S, WASM_MODEL_FILES as T, setWasmDiagnosticsHandler as _, setWebApiHttpTransport as a, buildDefaultWasmConfig as b, wasmCallWrapper as c, noteUnlockedCallStart as d, rearmWasmCallDiagnostics as f, emitWasmDiagnostic as g, acquireWasmStorageFallback as h, initializeWasmWebClient as i, missingWasmModelError as j, WASM_PIPELINE_OPTIONAL_MODEL_NAMES as k, notePipelineStatePulled as l, loadWasmModule as m, createWebApiHostAdapter as n, setupWasmConnection as o, resetWasmCallDiagnostics as p, executeWasmRequest as r, ML_CALL_MAX_POLLS as s, WasmWebClientError as t, noteUnlockedCallEnd as u, SemaphoreProvider as v, resolveWasmConfig as w, buildWasmConfigFromBasePath as x, DEFAULT_WASM_VERSION as y };
|