@incodetech/core 2.4.0 → 2.4.1-agentic.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.
Files changed (252) hide show
  1. package/dist/BrowserNetworkStatusProvider-BrDXBEDd.esm.js +21 -0
  2. package/dist/{multipartRecordingService-CLwrF5wD.esm.js → CameraCompositor-DN7NkJzV.esm.js} +7 -744
  3. package/dist/{FaceDetectionProvider-DcPOC2gS.esm.js → FaceDetectionProvider-CAY43vSI.esm.js} +28 -64
  4. package/dist/IBrowserEnvironmentCapability-D7JG7ML3.esm.js +16 -0
  5. package/dist/IGeolocationCapability-r49Qo7rR.d.ts +10 -0
  6. package/dist/{IWasmUtilCapability-GF2n7sfm.d.ts → IWasmUtilCapability-Cqiaxydi.d.ts} +31 -4
  7. package/dist/MultipartRecordingProvider-D9mauUdS.esm.js +146 -0
  8. package/dist/{PhoneValidationProvider-SZiOS0jB.esm.js → PhoneValidationProvider-Co4zk2en.esm.js} +7 -0
  9. package/dist/{StreamCanvasCapture-7JRf-2ck.d.ts → StreamCanvasCapture-C3xNfOsv.d.ts} +12 -3
  10. package/dist/StreamCanvasProcessingSession-CBnbTnOr.esm.js +42 -0
  11. package/dist/{WasmUtilProvider-DtJuBdt-.esm.js → WasmUtilProvider-Dp2V-Uct.esm.js} +75 -22
  12. package/dist/WorkerEncoderRecordingProvider-B1ODYtgN.esm.js +80 -0
  13. package/dist/addressSearch-DzbE9Ogt.esm.js +254 -0
  14. package/dist/{advanceableErrors-q_pfU3Cn.esm.js → advanceableErrors-k-U-cL5m.esm.js} +1 -2
  15. package/dist/ae-signature.esm.js +1 -1
  16. package/dist/antifraud.esm.js +2 -2
  17. package/dist/{antifraudManager-CaweCYnY.esm.js → antifraudManager-BObuHBjn.esm.js} +2 -2
  18. package/dist/{antifraudStateMachine-DRl0UVyA.esm.js → antifraudStateMachine-Dfrd2-26.esm.js} +1 -1
  19. package/dist/{api-Cz90EHyu.esm.js → api-CpP4PS4S.esm.js} +8 -5
  20. package/dist/{apiError-DPwFas2f.esm.js → apiError-DH-CH4Nz.esm.js} +1 -1
  21. package/dist/attemptCarry-WOkfvFMw.esm.js +45 -0
  22. package/dist/authentication.d.ts +3 -3
  23. package/dist/authentication.esm.js +2 -2
  24. package/dist/{authenticationManager-BIZC55Bi.d.ts → authenticationManager-CWmh7aSY.d.ts} +1 -1
  25. package/dist/{authenticationManager-2Lr5V_7p.esm.js → authenticationManager-DjX0XDyH.esm.js} +5 -5
  26. package/dist/{authenticationStateMachine-C99B0GFP.esm.js → authenticationStateMachine-BMbZL8wm.esm.js} +3 -3
  27. package/dist/backCameraLabel-yda5ugE4.esm.js +67 -0
  28. package/dist/{backCameraStream-CMvXj4X4.esm.js → backCameraStream-DS1oDiUq.esm.js} +12 -107
  29. package/dist/{browser-DlFgHpoC-DnyrCR8r.esm.js → browser-pQZA35G2-DtkAf6sn.esm.js} +161 -150
  30. package/dist/{camera-sIa9ceW2.esm.js → camera-E_Kcre4O.esm.js} +15 -23
  31. package/dist/camera.d.ts +2 -2
  32. package/dist/camera.esm.js +1 -1
  33. package/dist/certificate-issuance.esm.js +2 -2
  34. package/dist/{certificateIssuanceManager-BfeMv2PU.esm.js → certificateIssuanceManager-C1nETQos.esm.js} +2 -2
  35. package/dist/{certificateIssuanceStateMachine-Frgjbjw8.esm.js → certificateIssuanceStateMachine-DThXMDqr.esm.js} +2 -2
  36. package/dist/cnpj-Co1ottYN.esm.js +77 -0
  37. package/dist/connectivity-BCuEoQ-n.esm.js +114 -0
  38. package/dist/consent.d.ts +1 -1
  39. package/dist/consent.esm.js +2 -2
  40. package/dist/{consentManager-CvEu8h_W.esm.js → consentManager-DMlSL6Ax.esm.js} +4 -3
  41. package/dist/{consentManager-Cv_0QKLD.d.ts → consentManager-bjfVXO7p.d.ts} +9 -2
  42. package/dist/{consentStateMachine-DJTgN_-1.esm.js → consentStateMachine-DIYSMxKQ.esm.js} +20 -7
  43. package/dist/cross-document-data-match.esm.js +1 -1
  44. package/dist/{crossDocumentDataMatchManager-Cu141CE8.esm.js → crossDocumentDataMatchManager-BFTdiEDB.esm.js} +2 -2
  45. package/dist/curp-validation.d.ts +1 -1
  46. package/dist/curp-validation.esm.js +2 -2
  47. package/dist/{curpValidationManager-B-z9q5V3.esm.js → curpValidationManager-DNpC3wyf.esm.js} +3 -2
  48. package/dist/{curpValidationManager-C9sqoh9n.d.ts → curpValidationManager-z8428oCM.d.ts} +1 -1
  49. package/dist/{curpValidationStateMachine-vDEFLMPw.esm.js → curpValidationStateMachine-B3iVsDyt.esm.js} +28 -20
  50. package/dist/custom-fields.esm.js +1 -1
  51. package/dist/custom-watchlist.esm.js +2 -2
  52. package/dist/{customFieldsManager-D1ex2cFM.esm.js → customFieldsManager-CvI-pDT3.esm.js} +2 -2
  53. package/dist/{customWatchlistManager-CTI-SGk0.esm.js → customWatchlistManager-BuHtUb0y.esm.js} +2 -2
  54. package/dist/{customWatchlistStateMachine-hmRd0f2I.esm.js → customWatchlistStateMachine-CiVD9wyF.esm.js} +1 -1
  55. package/dist/{deepsightService-CKTYDIXD.esm.js → deepsightLoader-B7DEYoyY.esm.js} +40 -74
  56. package/dist/{createCameraCycleOwnership-Dj_LHUvN.esm.js → desktopCameraElection-BGMtYwk3.esm.js} +177 -40
  57. package/dist/device.esm.js +2 -2
  58. package/dist/document-capture.d.ts +3 -3
  59. package/dist/document-capture.esm.js +2 -2
  60. package/dist/{documentCaptureManager-DkyDtm3Y.d.ts → documentCaptureManager-CD5iQiUI.d.ts} +37 -4
  61. package/dist/{documentCaptureManager-DUJwpKC5.esm.js → documentCaptureManager-DLPqruXJ.esm.js} +27 -19
  62. package/dist/{documentCaptureStateMachine-B8i7GnLh.esm.js → documentCaptureStateMachine-DCvWQhFG.esm.js} +105 -56
  63. package/dist/dynamic-forms.d.ts +2 -2
  64. package/dist/dynamic-forms.esm.js +2 -2
  65. package/dist/{dynamicFormsManager-C0dHs1ty.d.ts → dynamicFormsManager-9kwY8Bf5.d.ts} +1 -1
  66. package/dist/{dynamicFormsManager-DiKYjcF3.esm.js → dynamicFormsManager-DfqCEPg9.esm.js} +2 -2
  67. package/dist/{dynamicFormsStateMachine-DEI45xYW.esm.js → dynamicFormsStateMachine-USQMB-uV.esm.js} +2 -2
  68. package/dist/ekyb.d.ts +4 -4
  69. package/dist/ekyb.esm.js +3 -3
  70. package/dist/{ekybManager-BaZ_7CEu.d.ts → ekybManager-BLOkwmWO.d.ts} +2 -2
  71. package/dist/{ekybManager-8WLkNcqg.esm.js → ekybManager-CR8YSYux.esm.js} +2 -2
  72. package/dist/{ekybStateMachine-BLRT45Ex.esm.js → ekybStateMachine-kHwdz6hm.esm.js} +28 -44
  73. package/dist/ekybUtils-Cw8Ta9Qi.esm.js +140 -0
  74. package/dist/ekyc.d.ts +4 -3
  75. package/dist/ekyc.esm.js +3 -3
  76. package/dist/{ekycManager-DW-ynodd.d.ts → ekycManager-DlGIn9wA.d.ts} +2 -1
  77. package/dist/{ekycManager-BO-Lui3t.esm.js → ekycManager-DymCvmVB.esm.js} +2 -2
  78. package/dist/ekycStateMachine-CoFCUJ2z.esm.js +7578 -0
  79. package/dist/ekycUtils-GRuMELYr.esm.js +1472 -0
  80. package/dist/electronic-signature.esm.js +1 -1
  81. package/dist/{electronicSignatureManager-CcIMOb_Y.esm.js → electronicSignatureManager-BCE3uA3z.esm.js} +4 -4
  82. package/dist/email.esm.js +2 -2
  83. package/dist/{emailManager-ButFktRm.esm.js → emailManager-CGoE3CUe.esm.js} +2 -2
  84. package/dist/{emailStateMachine-BXtlC0NV.esm.js → emailStateMachine-KgHfDNvM.esm.js} +32 -20
  85. package/dist/{events-Du2A4-Qr.esm.js → events-ggpBBaZ8.esm.js} +2 -2
  86. package/dist/events.esm.js +1 -1
  87. package/dist/extensibility.d.ts +37 -22
  88. package/dist/extensibility.esm.js +36 -35
  89. package/dist/{externalFetch-DrR9xshk.esm.js → externalFetch-CQY41QT1.esm.js} +4 -1
  90. package/dist/face-match.d.ts +1 -1
  91. package/dist/face-match.esm.js +2 -2
  92. package/dist/{faceCaptureManagerFactory-1hzeS_rB.d.ts → faceCaptureManagerFactory-DV2ULUYS.d.ts} +71 -66
  93. package/dist/{faceCaptureManagerFactory-BlGvXzXA.esm.js → faceCaptureManagerFactory-Dp90bedH.esm.js} +4 -4
  94. package/dist/{faceCaptureSetup-TY8RXc2N.esm.js → faceCaptureSetup-ZfiWg0fo.esm.js} +84 -457
  95. package/dist/{faceMatchManager-DWFUQjMQ.esm.js → faceMatchManager-D2xKPjjQ.esm.js} +2 -2
  96. package/dist/{faceMatchManager-DIgG-UFS.d.ts → faceMatchManager-Z4UDLwAv.d.ts} +16 -7
  97. package/dist/{faceMatchStateMachine-CUCvlydD.esm.js → faceMatchStateMachine-CUvwiQi9.esm.js} +40 -27
  98. package/dist/{feature-management-B5rR10uS.esm.js → feature-management-BbCIA4og.esm.js} +35 -21
  99. package/dist/feature-management.esm.js +1 -1
  100. package/dist/field-comparison.esm.js +1 -1
  101. package/dist/{fieldComparisonManager-v3knTYV_.esm.js → fieldComparisonManager-DgDbEeFZ.esm.js} +2 -2
  102. package/dist/fiscal-qr.esm.js +1 -1
  103. package/dist/{fiscalQrManager-Dt9fHG7h.esm.js → fiscalQrManager-BZeklojR.esm.js} +4 -4
  104. package/dist/flow-events.d.ts +1 -1
  105. package/dist/flow.d.ts +10 -10
  106. package/dist/flow.esm.js +10 -9
  107. package/dist/{flowCompletionService-BDI5QpfR.esm.js → flowCompletionService-CcCnPs_T.esm.js} +2 -2
  108. package/dist/{flowServices-roD0oIQL.esm.js → flowServices-Dmnc8Rye.esm.js} +69 -185
  109. package/dist/geolocation.d.ts +1 -1
  110. package/dist/geolocation.esm.js +2 -2
  111. package/dist/{geolocationManager-Dn24g1fl.d.ts → geolocationManager-6e1i9UIR.d.ts} +15 -17
  112. package/dist/{geolocationManager-DnONzWL5.esm.js → geolocationManager-BJJ3m_I8.esm.js} +6 -8
  113. package/dist/{geolocationStateMachine-eWy_G4Os.esm.js → geolocationStateMachine-CTI3m4Ie.esm.js} +12 -8
  114. package/dist/{getDeviceClass-bsWdEDxP.esm.js → getDeviceClass-DoIWuKI8.esm.js} +1 -1
  115. package/dist/government-validation.esm.js +2 -2
  116. package/dist/{governmentValidationManager-BtXWHICu.esm.js → governmentValidationManager-CjChjZ3C.esm.js} +2 -2
  117. package/dist/{governmentValidationStateMachine-COL-Vs48.esm.js → governmentValidationStateMachine-AEbn3Afi.esm.js} +1 -1
  118. package/dist/home.d.ts +1 -1
  119. package/dist/home.esm.js +1 -1
  120. package/dist/http.esm.js +1 -1
  121. package/dist/id-ocr.d.ts +1 -1
  122. package/dist/id-ocr.esm.js +2 -2
  123. package/dist/id-selfie-flow.d.ts +1 -1
  124. package/dist/id-selfie-flow.esm.js +10 -9
  125. package/dist/id-verification.esm.js +2 -2
  126. package/dist/id.d.ts +3 -16
  127. package/dist/id.esm.js +4 -4
  128. package/dist/{idCaptureDefaults-BGsG2OAs.esm.js → idCaptureDefaults-Dszuq9ng.esm.js} +3 -3
  129. package/dist/{idCaptureManager-BrfYjCm_.esm.js → idCaptureManager-B3oR4RnA.esm.js} +64 -17
  130. package/dist/{idCaptureManager-0M02hSuC.d.ts → idCaptureManager-CCA2D1Ah.d.ts} +68 -5
  131. package/dist/{idCaptureServices-BSj6EH2l.esm.js → idCaptureServices-DK0QboqT.esm.js} +29 -198
  132. package/dist/{idCaptureStateMachine-dXKBYHQp.esm.js → idCaptureStateMachine-zzar9MPy.esm.js} +914 -536
  133. package/dist/{idOcrManager-DT3kPIB3.d.ts → idOcrManager-BTdHlJ9D.d.ts} +1 -1
  134. package/dist/{idOcrManager-D3-HNMXP.esm.js → idOcrManager-xyEZNOBa.esm.js} +2 -2
  135. package/dist/{idOcrStateMachine-DyENX6Ki.esm.js → idOcrStateMachine-DNKXh4Rn.esm.js} +2 -2
  136. package/dist/{idVerificationManager-iWz7Avkr.esm.js → idVerificationManager-DdnvYfgN.esm.js} +2 -2
  137. package/dist/{idVerificationStateMachine-CL1kUdBe.esm.js → idVerificationStateMachine-DtIBCa32.esm.js} +1 -1
  138. package/dist/identity-reuse.esm.js +2 -2
  139. package/dist/{identityReuseManager-CD1ucp1d.esm.js → identityReuseManager-CcpovlfD.esm.js} +2 -2
  140. package/dist/{identityReuseStateMachine-DfV81wQC.esm.js → identityReuseStateMachine-DxZFWy47.esm.js} +1 -1
  141. package/dist/{index-CKQ9QBZP.d.ts → index-DC0P2Vzw.d.ts} +1 -1
  142. package/dist/{index-BKOWUhxG.d.ts → index-DEfwds5y.d.ts} +55 -8
  143. package/dist/index.d.ts +1 -1
  144. package/dist/index.esm.js +1 -1
  145. package/dist/{invokeOnCaptureCallback-DYrkOXO6.esm.js → invokeOnCaptureCallback-BJ0GVHGr.esm.js} +1 -1
  146. package/dist/kyb-checks.d.ts +3 -0
  147. package/dist/kyb-checks.esm.js +3 -0
  148. package/dist/kybChecksManager-CblEL97E.d.ts +95 -0
  149. package/dist/kybChecksManager-DpGOp4Su.esm.js +89 -0
  150. package/dist/kybChecksStateMachine-B43NAnv7.esm.js +718 -0
  151. package/dist/mandatory-consent.d.ts +2 -2
  152. package/dist/mandatory-consent.esm.js +2 -2
  153. package/dist/{mandatoryConsentManager-Cwqx1nK7.esm.js → mandatoryConsentManager-B4vCYslr.esm.js} +4 -3
  154. package/dist/{mandatoryConsentManager-BQ43yndC.d.ts → mandatoryConsentManager-B88Sm5nd.d.ts} +10 -3
  155. package/dist/{mandatoryConsentStateMachine-pXWqAHo_.esm.js → mandatoryConsentStateMachine-DWslYPA3.esm.js} +20 -7
  156. package/dist/mediaRecorderOptions-B9-IEVtV.esm.js +70 -0
  157. package/dist/multipartRecordingService-BTqkHGG9.esm.js +407 -0
  158. package/dist/nationalIds-B91f_RuB.esm.js +99 -0
  159. package/dist/{permissionGuards-gcy3U0SL.esm.js → permissionGuards-DFV-Ws0a.esm.js} +1 -1
  160. package/dist/{permissionServices-Ca-tSNhT.esm.js → permissionServices-D190ATGD.esm.js} +11 -9
  161. package/dist/phone-number.d.ts +7 -1
  162. package/dist/phone-number.esm.js +15 -2
  163. package/dist/phone.d.ts +1 -1
  164. package/dist/phone.esm.js +2 -2
  165. package/dist/phoneFormat-JJNaWthV.esm.js +75 -0
  166. package/dist/{phoneManager-BO-LTih5.d.ts → phoneManager-6nrJkvkG.d.ts} +5 -0
  167. package/dist/{phoneManager-KKUq-Vgo.esm.js → phoneManager-Dy5tODCU.esm.js} +3 -3
  168. package/dist/phoneServices-DJgyOzU2.esm.js +77 -0
  169. package/dist/{phoneStateMachine-D2QWS2cu.esm.js → phoneStateMachine-DnlPhnw7.esm.js} +54 -82
  170. package/dist/{phoneValidation-DnBcNUNh.esm.js → phoneValidation-OggtfjRt.esm.js} +1 -2
  171. package/dist/{platform-DkcRc9JV.esm.js → platform-aPh7gTWh.esm.js} +15 -1
  172. package/dist/processFaceMatch-Bst83HaS.esm.js +21 -0
  173. package/dist/qe-signature.esm.js +1 -1
  174. package/dist/recordingService-CTko6Cjn.esm.js +397 -0
  175. package/dist/redirect-to-mobile.d.ts +2 -2
  176. package/dist/redirect-to-mobile.esm.js +2 -2
  177. package/dist/{redirectToMobileManager-uHW3dyuQ.esm.js → redirectToMobileManager-CgGaT2NP.esm.js} +5 -4
  178. package/dist/{redirectToMobileManager-CVsvpVbQ.d.ts → redirectToMobileManager-Dm9ctRCC.d.ts} +3 -1
  179. package/dist/{redirectToMobileStateMachine-b-H-ipGM.esm.js → redirectToMobileStateMachine-CbhN8uVN.esm.js} +65 -26
  180. package/dist/resolveForm-O7-r79VA.esm.js +351 -0
  181. package/dist/{runChildModule-BF_atgNx.esm.js → runChildModule-BffFArwl.esm.js} +3 -3
  182. package/dist/{sdkVersion-CsIbltJF.esm.js → sdkVersion-CDd_gaR7.esm.js} +1 -1
  183. package/dist/selfie.d.ts +4 -4
  184. package/dist/selfie.esm.js +10 -10
  185. package/dist/{selfieErrorUtils-BY0-YbPW.esm.js → selfieErrorUtils-f4MgAG2A.esm.js} +1 -1
  186. package/dist/{selfieManager-BJdNu_nd.d.ts → selfieManager-DmZFzs1-.d.ts} +1 -1
  187. package/dist/{selfieManager-vAAwzsHk.esm.js → selfieManager-hopelYEk.esm.js} +5 -5
  188. package/dist/{selfieStateMachine-BFVp3ElQ.esm.js → selfieStateMachine-DaZIVv3Q.esm.js} +3 -3
  189. package/dist/{session-CpwfoVdH.esm.js → session-CdSX4wsZ.esm.js} +77 -9
  190. package/dist/session.d.ts +96 -10
  191. package/dist/session.esm.js +7 -6
  192. package/dist/{sessionInitializer-BTjYgE-V.esm.js → sessionInitializer-DsL7X2j9.esm.js} +465 -206
  193. package/dist/{setup-YPKTUCY5.d.ts → setup-D9qt8YVU.d.ts} +2 -2
  194. package/dist/{setup-BInNAvQw.esm.js → setup-DDahygZs.esm.js} +44 -30
  195. package/dist/signature.esm.js +2 -2
  196. package/dist/{signatureManager-f_dPAGXn.esm.js → signatureManager-CwqjcxPg.esm.js} +2 -2
  197. package/dist/{signatureStateMachine-C-nUq_oq.esm.js → signatureStateMachine-DBVDd1Eu.esm.js} +1 -1
  198. package/dist/{stats-BEvexnKC.esm.js → stats-CatA2dea.esm.js} +1 -1
  199. package/dist/stats.esm.js +1 -1
  200. package/dist/textRules-D4NRinKY.d.ts +41 -0
  201. package/dist/{tri-xzRLIIMN.esm.js → tri-DG6priFa.esm.js} +142 -8
  202. package/dist/tri.d.ts +1 -1
  203. package/dist/tri.esm-CzTNi5Q_.esm.js +3826 -0
  204. package/dist/tri.esm.js +1 -1
  205. package/dist/{trueSightService-BMT-TubT.esm.js → trueSightService-GuLthUVK.esm.js} +19 -10
  206. package/dist/trust-graph.esm.js +1 -1
  207. package/dist/types-B9C8W01q.d.ts +34 -0
  208. package/dist/{types-yPH8lAH-.d.ts → types-BEVHQbbC.d.ts} +2 -2
  209. package/dist/{types-BAxn7MpY.d.ts → types-BPm1JSu7.d.ts} +123 -48
  210. package/dist/{types-0L-eFDmr.d.ts → types-BgRHw-dR.d.ts} +1 -1
  211. package/dist/{types-B6HsSzpk.d.ts → types-CRaFu6wS.d.ts} +6 -3
  212. package/dist/types-CTaL0XJz.d.ts +80 -0
  213. package/dist/{types-Ckir_BEs.d.ts → types-Cd0J0F9D.d.ts} +1 -1
  214. package/dist/{types-CK8Jbjkp.d.ts → types-Csh8vzPo.d.ts} +1 -1
  215. package/dist/types-CuMJ2M7D.d.ts +210 -0
  216. package/dist/{types-DUnFZ08M.d.ts → types-CyNndVAT.d.ts} +16 -8
  217. package/dist/{types-DPIDuhut.d.ts → types-DNVzoRvi.d.ts} +2 -1
  218. package/dist/types-J6g6iKe_.d.ts +6 -0
  219. package/dist/{urlUtils-6jsE6rKp.esm.js → urlUtils-eYiyWjh0.esm.js} +4 -1
  220. package/dist/video-selfie.d.ts +8 -8
  221. package/dist/video-selfie.esm.js +97 -22
  222. package/dist/{videoSelfieCameraWarmer-D1xA0u8y.esm.js → videoSelfieCameraWarmer-e3irGfcO.esm.js} +18 -21
  223. package/dist/{videoSelfieStepDetector-CGsTltqB.d.ts → videoSelfieStepDetector-Dv3Mgws-.d.ts} +9 -4
  224. package/dist/virtualCameraCheck-eFOm2C9q.esm.js +27 -0
  225. package/dist/{warmup-BElYWRh7.esm.js → warmup-DtB0DJpl.esm.js} +198 -27
  226. package/dist/wasm.d.ts +2 -2
  227. package/dist/wasm.esm.js +3 -3
  228. package/dist/{wasmDsFlagSync-CYj5LL9z.esm.js → wasmDsFlagSync-BtiR5pig.esm.js} +1 -1
  229. package/dist/wasmMetadataVersionSync-U8EFUr1T.esm.js +27 -0
  230. package/dist/{wasmWebClient-BjZw_7OB.esm.js → wasmWebClient-BDrax6Eu.esm.js} +55 -26
  231. package/dist/watchlist-for-business.d.ts +2 -1
  232. package/dist/watchlist-for-business.esm.js +2 -2
  233. package/dist/watchlist.esm.js +2 -2
  234. package/dist/{watchlistForBusinessManager-B3GDPZrr.d.ts → watchlistForBusinessManager-DX2AyM4Y.d.ts} +54 -18
  235. package/dist/{watchlistForBusinessManager-CZZOFkGl.esm.js → watchlistForBusinessManager-DqUpAEj_.esm.js} +37 -7
  236. package/dist/watchlistForBusinessStateMachine-DdaPl2PS.esm.js +166 -0
  237. package/dist/{watchlistManager-DXtX94SN.esm.js → watchlistManager-CdpXzT4B.esm.js} +2 -2
  238. package/dist/{watchlistStateMachine-McALifag.esm.js → watchlistStateMachine-ofHW_lPk.esm.js} +1 -1
  239. package/dist/workflow.d.ts +5 -2
  240. package/dist/workflow.esm.js +60 -50
  241. package/package.json +12 -5
  242. package/dist/IBrowserEnvironmentCapability-DEaRRk-R.esm.js +0 -9
  243. package/dist/addressSearch-DPjIKJrX.esm.js +0 -563
  244. package/dist/deepsightLoader-DeNvGU3c.esm.js +0 -55
  245. package/dist/ekycStateMachine-CDnI_NRq.esm.js +0 -1443
  246. package/dist/ekycUtils-zY8CdKJL.esm.js +0 -300
  247. package/dist/thumbmark.esm-CRc0cYvz.esm.js +0 -1242
  248. package/dist/tri.esm-BIjHhBJ2.esm.js +0 -2620
  249. package/dist/types-BvLo3U4u.d.ts +0 -134
  250. package/dist/types-zOgZqMni.d.ts +0 -6
  251. package/dist/watchlistForBusinessStateMachine-B66E7jud.esm.js +0 -78
  252. /package/dist/{types-BSBzhHRH2.d.ts → types-BSBzhHRH.d.ts} +0 -0
@@ -1,115 +1,5 @@
1
- import { t as api, u as endpoints } from "./api-Cz90EHyu.esm.js";
2
- import { t as BrowserTimerProvider } from "./BrowserTimerProvider-BXhgNxLt.esm.js";
3
- import { a as isIOS } from "./platform-DkcRc9JV.esm.js";
4
- //#region ../infra/src/media/StreamCanvasProcessingSession.ts
5
- var StreamCanvasProcessingSession = class {
6
- /**
7
- * Creates a processing session that reacts to `StreamCanvasCapture` frame events
8
- * and drives a provider's `processFrame()` method with backpressure.
9
- */
10
- constructor(params) {
11
- this.disposed = false;
12
- this.isProcessing = false;
13
- this.onFrameEvent = () => {
14
- if (this.disposed || this.isProcessing) return;
15
- const frame = this.capturer.getLatestFrame();
16
- if (!frame) return;
17
- this.onFrame?.(frame);
18
- this.isProcessing = true;
19
- this.provider.processFrame(frame).catch(() => {}).finally(() => {
20
- this.isProcessing = false;
21
- });
22
- };
23
- this.capturer = params.capturer;
24
- this.provider = params.provider;
25
- this.onFrame = params.onFrame;
26
- this.capturer.addEventListener("frame", this.onFrameEvent);
27
- }
28
- /**
29
- * Unsubscribes from frame events and resets the provider.
30
- */
31
- dispose() {
32
- if (this.disposed) return;
33
- this.disposed = true;
34
- this.capturer.removeEventListener("frame", this.onFrameEvent);
35
- this.provider.reset();
36
- }
37
- /**
38
- * Returns whether the session has been disposed.
39
- */
40
- isDisposed() {
41
- return this.disposed;
42
- }
43
- };
44
- //#endregion
45
- //#region ../infra/src/media/mediaRecorderOptions.ts
46
- /**
47
- * Picks a `MediaRecorder` mime type the current browser actually supports.
48
- * WebM avoids Safari's fragmented-MP4 unknown-duration metadata on versions
49
- * that can record it; older Safari versions fall back to MP4. Returns '' when
50
- * none match.
51
- */
52
- function getSupportedMediaRecorderMimeType() {
53
- for (const type of [
54
- "video/webm",
55
- "video/webm;codecs=vp9",
56
- "video/webm;codecs=vp8",
57
- "video/mp4"
58
- ]) if (MediaRecorder.isTypeSupported(type)) return type;
59
- return "";
60
- }
61
- /**
62
- * Multipart recordings use the same WebM-first order. Some Android devices
63
- * advertise H.264 support but fail after MediaRecorder starts (ENG-56439).
64
- */
65
- function getMultipartRecorderMimeType() {
66
- return getSupportedMediaRecorderMimeType();
67
- }
68
- /**
69
- * `MediaRecorder` options tuned per platform — a higher bitrate on iOS, lower
70
- * elsewhere — paired with the supported mime type.
71
- */
72
- function getAdaptiveMediaRecorderOptions() {
73
- const mimeType = getSupportedMediaRecorderMimeType();
74
- if (isIOS()) return {
75
- mimeType,
76
- videoBitsPerSecond: 1e6,
77
- bitsPerSecond: 1e6
78
- };
79
- return {
80
- mimeType,
81
- videoBitsPerSecond: 5e5,
82
- bitsPerSecond: 5e5
83
- };
84
- }
85
- /**
86
- * Worker-encoded multipart recording profile (ENG-55397). 2 GB-class devices
87
- * (`navigator.deviceMemory` ≤ 2) record 360p at 15 fps: on a Galaxy A01 Core,
88
- * 720p30 plus WASM detection exhausted memory (renderer swapped, GPU process
89
- * killed), and even the in-worker encoder starved the camera preview to
90
- * 6 fps. They also upload 2 s parts: every part is one request through the
91
- * WASM HTTP client on the main thread, and at 0.5 s parts the uploads fell
92
- * behind during face detection, stretching the final "processing" wait.
93
- * Other devices, and browsers without `deviceMemory`, keep 720p30 at the
94
- * MediaRecorder bitrate and 0.5 s parts.
95
- */
96
- function getWorkerRecordingProfile(deviceMemoryGb = typeof navigator !== "undefined" ? navigator.deviceMemory : void 0) {
97
- if (deviceMemoryGb !== void 0 && deviceMemoryGb <= 2) return {
98
- maxLongEdge: 640,
99
- maxShortEdge: 360,
100
- fps: 15,
101
- bitrate: 6e5,
102
- timesliceMs: 2e3
103
- };
104
- return {
105
- maxLongEdge: 1280,
106
- maxShortEdge: 720,
107
- fps: 30,
108
- bitrate: 25e5,
109
- timesliceMs: 500
110
- };
111
- }
112
- //#endregion
1
+ import { n as __exportAll } from "./rolldown-runtime-B-1-B7_t.esm.js";
2
+ import { r as getWorkerRecordingProfile } from "./mediaRecorderOptions-B9-IEVtV.esm.js";
113
3
  //#region ../infra/src/media/cameraCompositorWorker.ts
114
4
  /**
115
5
  * Whether the worker transport is available here. Every probe must hold;
@@ -697,6 +587,10 @@ function buildCameraCompositorWorkerSource() {
697
587
  }
698
588
  //#endregion
699
589
  //#region ../infra/src/media/CameraCompositor.ts
590
+ var CameraCompositor_exports = /* @__PURE__ */ __exportAll({
591
+ CameraCompositor: () => CameraCompositor,
592
+ createRecordingCompositor: () => createRecordingCompositor
593
+ });
700
594
  const MAX_COMPOSITE_LONG_EDGE = 1280;
701
595
  const MAX_COMPOSITE_SHORT_EDGE = 720;
702
596
  const FRAME_INTERVAL_TOLERANCE_RATIO = .9;
@@ -1133,635 +1027,4 @@ var CameraCompositor = class {
1133
1027
  }
1134
1028
  };
1135
1029
  //#endregion
1136
- //#region ../infra/src/providers/browser/MultipartRecordingProvider.ts
1137
- /**
1138
- * How often `MediaRecorder` hands us buffered data (incremental blobs).
1139
- * 500 ms keeps each blob — and therefore each upload chunk — small: less
1140
- * tail lost when a session is interrupted, and a smaller first blob (init
1141
- * header + keyframe), which is the largest and most timeout-prone chunk.
1142
- * Not lower: request rate doubles per halving, and browsers stop honoring
1143
- * very small timeslices reliably.
1144
- */
1145
- const TIMESLICE_MS = 500;
1146
- /**
1147
- * Encoder target for the full video-selfie session. Higher than the
1148
- * short-clip liveness path (0.5–1 Mbps) so a multi-minute session keeps
1149
- * usable quality. It's a ceiling — a still scene still encodes well below it.
1150
- */
1151
- const VIDEO_BITS_PER_SECOND = 25e5;
1152
- /**
1153
- * Records a stream and emits every `MediaRecorder` timeslice blob as its own
1154
- * part, in order. Each blob is a whole container fragment (WebM cluster /
1155
- * fMP4 `moof`+`mdat`), which is the property the video-selfie-service's
1156
- * gap-splicing depends on — parts must never cut a fragment at a byte
1157
- * offset. The service stages sub-5 MiB chunks and combines them server-side,
1158
- * so emitting the smallest whole-fragment unit (~0.5 s of video) maximizes
1159
- * what an interrupted session can salvage.
1160
- *
1161
- * Page-lifecycle orchestration lives in Core: it pauses this recorder before a
1162
- * backgrounded camera can stall, restores the camera/compositor, and only then
1163
- * resumes this same media container.
1164
- */
1165
- var MultipartRecordingProvider = class {
1166
- constructor() {
1167
- this.mediaRecorder = null;
1168
- this._isRecording = false;
1169
- this._hasError = false;
1170
- this._error = null;
1171
- this.mimeType = "";
1172
- this.partNumber = 0;
1173
- this.onPart = null;
1174
- }
1175
- get isRecording() {
1176
- return this._isRecording;
1177
- }
1178
- get hasError() {
1179
- return this._hasError;
1180
- }
1181
- get error() {
1182
- return this._error;
1183
- }
1184
- startRecording(stream, onPart) {
1185
- this.reset();
1186
- this.partNumber = 0;
1187
- this.onPart = onPart;
1188
- try {
1189
- this.mimeType = getMultipartRecorderMimeType();
1190
- const recorder = new MediaRecorder(stream.clone(), {
1191
- mimeType: this.mimeType,
1192
- videoBitsPerSecond: VIDEO_BITS_PER_SECOND
1193
- });
1194
- recorder.ondataavailable = (event) => {
1195
- if (event.data.size > 0 && this.onPart) {
1196
- this.partNumber += 1;
1197
- this.onPart({
1198
- chunk: event.data,
1199
- partNumber: this.partNumber
1200
- });
1201
- }
1202
- };
1203
- recorder.onerror = (event) => {
1204
- const detail = event instanceof ErrorEvent && event.error instanceof Error ? event.error.message : event.type;
1205
- this._error = `Recording error: ${detail}`;
1206
- this._isRecording = false;
1207
- this._hasError = true;
1208
- };
1209
- recorder.start(TIMESLICE_MS);
1210
- this.mediaRecorder = recorder;
1211
- this._isRecording = true;
1212
- this._error = null;
1213
- this._hasError = false;
1214
- } catch (err) {
1215
- const detail = err instanceof Error ? err.message : String(err);
1216
- this._error = `Failed to start recording: ${detail}`;
1217
- this._hasError = true;
1218
- }
1219
- }
1220
- pauseRecording() {
1221
- const recorder = this.mediaRecorder;
1222
- if (!recorder || !this._isRecording || this._hasError) return false;
1223
- if (recorder.state === "paused") return true;
1224
- if (recorder.state !== "recording") return false;
1225
- try {
1226
- recorder.pause();
1227
- return true;
1228
- } catch (err) {
1229
- const detail = err instanceof Error ? err.message : String(err);
1230
- this._error = `Failed to pause recording: ${detail}`;
1231
- this._hasError = true;
1232
- return false;
1233
- }
1234
- }
1235
- resumeRecording() {
1236
- const recorder = this.mediaRecorder;
1237
- if (!recorder || !this._isRecording || this._hasError) return false;
1238
- if (recorder.state === "recording") return true;
1239
- if (recorder.state !== "paused") return false;
1240
- try {
1241
- recorder.resume();
1242
- return true;
1243
- } catch (err) {
1244
- const detail = err instanceof Error ? err.message : String(err);
1245
- this._error = `Failed to resume recording: ${detail}`;
1246
- this._hasError = true;
1247
- return false;
1248
- }
1249
- }
1250
- stopRecording() {
1251
- const recorder = this.mediaRecorder;
1252
- return new Promise((resolve) => {
1253
- if (recorder && this._isRecording) {
1254
- recorder.onstop = () => {
1255
- resolve();
1256
- };
1257
- recorder.stop();
1258
- this._isRecording = false;
1259
- } else resolve();
1260
- recorder?.stream?.getTracks().forEach((track) => track.stop());
1261
- });
1262
- }
1263
- reset() {
1264
- const recorder = this.mediaRecorder;
1265
- if (recorder) {
1266
- recorder.ondataavailable = null;
1267
- recorder.onerror = null;
1268
- recorder.onstop = null;
1269
- if (recorder.state !== "inactive") recorder.stop();
1270
- recorder.stream.getTracks().forEach((track) => track.stop());
1271
- this.mediaRecorder = null;
1272
- }
1273
- this.onPart = null;
1274
- this._isRecording = false;
1275
- this._error = null;
1276
- this._hasError = false;
1277
- }
1278
- };
1279
- //#endregion
1280
- //#region ../infra/src/providers/browser/WorkerEncoderRecordingProvider.ts
1281
- /**
1282
- * Multipart recorder for a `CameraCompositor` that encodes inside its worker
1283
- * (ENG-55397): emits the worker's WebM clusters as parts, in order. When the
1284
- * compositor could not start in-worker encoding (no insertable streams or
1285
- * WebCodecs, strict CSP), it records the composite stream with
1286
- * `MediaRecorder` instead, so callers wire it unconditionally.
1287
- *
1288
- * Why not always `MediaRecorder`: Chrome hands every recorded frame through
1289
- * the page main thread and drops frames while it is blocked. On a Galaxy A01
1290
- * Core the ID flow blocks it for 3–5 s (WASM + 1080p readbacks); a
1291
- * `MediaRecorder` fed by the worker kept 74 of 149 frames under 1.5 s
1292
- * freezes, the in-worker encoder 150 of 151.
1293
- */
1294
- var WorkerEncoderRecordingProvider = class {
1295
- constructor(compositor) {
1296
- this.compositor = compositor;
1297
- this._isRecording = false;
1298
- this._error = null;
1299
- this.partNumber = 0;
1300
- this.fallback = null;
1301
- }
1302
- get isRecording() {
1303
- return this.fallback ? this.fallback.isRecording : this._isRecording;
1304
- }
1305
- get hasError() {
1306
- return this.error !== null;
1307
- }
1308
- get error() {
1309
- if (this.fallback) return this.fallback.error;
1310
- return this._error ?? this.compositor.workerRecordingErrorMessage;
1311
- }
1312
- startRecording(stream, onPart) {
1313
- this.reset();
1314
- if (!this.compositor.encodesInWorker) {
1315
- this.fallback = new MultipartRecordingProvider();
1316
- this.fallback.startRecording(stream, onPart);
1317
- return;
1318
- }
1319
- this.partNumber = 0;
1320
- const started = this.compositor.startWorkerRecording((chunk) => {
1321
- this.partNumber += 1;
1322
- onPart({
1323
- chunk,
1324
- partNumber: this.partNumber
1325
- });
1326
- });
1327
- this._isRecording = started;
1328
- this._error = started ? null : "Failed to start recording: no encoder";
1329
- }
1330
- pauseRecording() {
1331
- if (this.fallback) return this.fallback.pauseRecording();
1332
- return this._isRecording && this.compositor.pauseWorkerRecording();
1333
- }
1334
- resumeRecording() {
1335
- if (this.fallback) return this.fallback.resumeRecording();
1336
- return this._isRecording && this.compositor.resumeWorkerRecording();
1337
- }
1338
- async stopRecording() {
1339
- if (this.fallback) {
1340
- await this.fallback.stopRecording();
1341
- return;
1342
- }
1343
- if (!this._isRecording) return;
1344
- this._isRecording = false;
1345
- await this.compositor.stopWorkerRecording();
1346
- }
1347
- reset() {
1348
- this.fallback?.reset();
1349
- this.fallback = null;
1350
- this.compositor.cancelWorkerRecording();
1351
- this._isRecording = false;
1352
- this._error = null;
1353
- }
1354
- };
1355
- //#endregion
1356
- //#region ../infra/src/providers/browser/BrowserNetworkStatusProvider.ts
1357
- var BrowserNetworkStatusProvider = class {
1358
- onOnline(listener) {
1359
- if (typeof window === "undefined" || typeof window.addEventListener !== "function") return () => {};
1360
- window.addEventListener("online", listener);
1361
- return () => {
1362
- window.removeEventListener("online", listener);
1363
- };
1364
- }
1365
- };
1366
- //#endregion
1367
- //#region src/internal/recordings/videoSelfieUploadService.ts
1368
- /**
1369
- * Opens a scoped multipart video upload session. Idempotent server-side: if
1370
- * an upload is already in progress for the `(session, scope)` pair, the same `uploadId`
1371
- * comes back along with the parts already stored (`parts` non-empty) — but
1372
- * always with a fresh `epoch` that locks out whoever held the previous one.
1373
- */
1374
- async function initiateVideoSelfieUpload(scope = "videoselfie") {
1375
- const response = await api.post(endpoints.videoSelfieUploadInitiate, void 0, { query: { scope } });
1376
- return {
1377
- uploadId: response.data.uploadId,
1378
- epoch: response.data.epoch,
1379
- scope,
1380
- parts: response.data.parts ?? []
1381
- };
1382
- }
1383
- /**
1384
- * Uploads a single chunk as a multipart part. The body is the raw video bytes
1385
- * (no base64, no client-side encryption — encryption at rest is server-side
1386
- * S3 SSE). Every part except the last must be >= 5 MiB (enforced
1387
- * server-side). Returns the part number + `etag` needed to complete the
1388
- * upload. Rejects with a `409` status when a newer initiate fenced this
1389
- * session out.
1390
- */
1391
- async function uploadVideoSelfiePart(session, partNumber, chunk) {
1392
- const response = await api.post(endpoints.videoSelfieUploadPart, chunk, {
1393
- query: {
1394
- uploadId: session.uploadId,
1395
- epoch: session.epoch,
1396
- partNumber,
1397
- scope: session.scope
1398
- },
1399
- headers: { "Content-Type": "application/octet-stream" }
1400
- });
1401
- return {
1402
- partNumber: response.data.partNumber,
1403
- etag: response.data.etag
1404
- };
1405
- }
1406
- /**
1407
- * Finalizes the upload. The service assembles from the parts it stored; the
1408
- * optional `parts` list is deliberately NOT sent — chunks staged below the
1409
- * S3 minimum are combined and renumbered server-side, so a client-side list
1410
- * could contradict the authoritative one. Safe to repeat if the response
1411
- * was lost. Returns the server-reported status. Rejects with `400` naming a
1412
- * missing part when the sequence has a hole.
1413
- */
1414
- async function completeVideoSelfieUpload(session) {
1415
- return (await api.post(endpoints.videoSelfieUploadComplete, {
1416
- uploadId: session.uploadId,
1417
- epoch: session.epoch
1418
- }, { query: { scope: session.scope } })).data.status;
1419
- }
1420
- /**
1421
- * Discards an in-progress upload and everything already sent for it, so the
1422
- * backend fails the upload straight away instead of waiting for its expiry.
1423
- * Call when a recording is abandoned or its upload can no longer complete.
1424
- */
1425
- async function abortVideoSelfieUpload(session) {
1426
- return (await api.post(endpoints.videoSelfieUploadAbort, {
1427
- uploadId: session.uploadId,
1428
- epoch: session.epoch
1429
- }, { query: { scope: session.scope } })).data.status;
1430
- }
1431
- //#endregion
1432
- //#region src/internal/recordings/videoSelfieChunkUploader.ts
1433
- /**
1434
- * How many part uploads run concurrently. The service allows 10 rps with a
1435
- * burst of 30 per session; a real recorder emits ~2 chunks/s, so this cap
1436
- * only matters when a backlog is draining after a network stall.
1437
- */
1438
- const MAX_IN_FLIGHT = 3;
1439
- /** Attempts per chunk in the live round (first try + retries). */
1440
- const MAX_ATTEMPTS = 4;
1441
- /** Extra attempts per parked chunk during the final drain() round. */
1442
- const DRAIN_ATTEMPTS = 2;
1443
- const BACKOFF_BASE_MS = 500;
1444
- const BACKOFF_CAP_MS = 8e3;
1445
- /** Upper bound honored for a server-sent `Retry-After` (seconds). */
1446
- const RETRY_AFTER_CAP_MS = 3e4;
1447
- /**
1448
- * Ceiling on un-acknowledged chunk bytes held in memory. On a network slower
1449
- * than the encoder the backlog grows without bound; past this the upload
1450
- * cannot realistically catch up, so the uploader fails instead of eating
1451
- * memory on a low-end device. ~48 MiB ≈ 2.5 minutes of video at our bitrate.
1452
- */
1453
- const MAX_BUFFERED_BYTES = 48 * 1024 * 1024;
1454
- function httpStatusOf$1(error) {
1455
- if (typeof error === "object" && error !== null && "status" in error && typeof error.status === "number") return error.status;
1456
- return null;
1457
- }
1458
- function retryAfterMsOf(error) {
1459
- if (typeof error === "object" && error !== null && "headers" in error && typeof error.headers === "object") {
1460
- const headers = error.headers;
1461
- const seconds = Number(headers?.["retry-after"]);
1462
- if (Number.isFinite(seconds) && seconds >= 0) return Math.min(seconds * 1e3, RETRY_AFTER_CAP_MS);
1463
- }
1464
- return null;
1465
- }
1466
- /**
1467
- * Uploads video-selfie chunks with the client-side half of the service's
1468
- * resilience contract (`video-selfie-service` README, "What a client can
1469
- * rely on"):
1470
- *
1471
- * - **Keep-until-ack** — every chunk is held in memory until its upload
1472
- * returns 200 (a hole in the sequence can only be filled by that exact
1473
- * data). Acked bytes are durable in S3 (stored as a part or staged), so
1474
- * the blob is released the moment the ack lands.
1475
- * - **Retry with backoff** — transient failures (network error/timeout,
1476
- * 408, 429, 5xx) retry the same bytes under the same partNumber with
1477
- * exponential backoff + full jitter; 429 honors the server's
1478
- * `Retry-After`. Chunks may land out of order — the service stages them.
1479
- * - **Park, then drain** — a chunk that exhausts its live retries is parked
1480
- * (blob kept) without failing the recording; {@link drain} gives every
1481
- * parked chunk a final round once recording stops, so a mid-recording
1482
- * network outage only fails the upload if it persists to the end. A
1483
- * browser `online` event un-parks early: parked chunks get a fresh live
1484
- * round as soon as connectivity returns instead of waiting for stop.
1485
- * - **409 is fatal** — a newer initiate fenced this session out ("latest
1486
- * initiate wins"); no retry can succeed, so the uploader stops.
1487
- * - **Bounded memory** — when un-acked bytes exceed the ceiling the
1488
- * uploader fails rather than buffering a runaway backlog.
1489
- */
1490
- var VideoSelfieChunkUploader = class {
1491
- constructor(session, dependencies = {}) {
1492
- this.queue = [];
1493
- this.parked = [];
1494
- this.inFlight = 0;
1495
- this.bufferedBytes = 0;
1496
- this.fatal = false;
1497
- this.disposed = false;
1498
- this.tasks = [];
1499
- this.session = session;
1500
- this.timer = dependencies.timer ?? BrowserTimerProvider.getInstance();
1501
- this.jitter = dependencies.jitter ?? Math.random;
1502
- const networkStatus = dependencies.networkStatus ?? new BrowserNetworkStatusProvider();
1503
- this.unsubscribeOnline = networkStatus.onOnline(() => this.unparkEarly());
1504
- }
1505
- /** True once the upload cannot complete (fenced out or over the memory cap). */
1506
- get failed() {
1507
- return this.fatal;
1508
- }
1509
- /**
1510
- * Accepts the next chunk for upload. Non-blocking: the upload (and any
1511
- * retries) run in the background; failures surface through {@link failed}
1512
- * and {@link drain}.
1513
- */
1514
- enqueue(partNumber, chunk) {
1515
- if (this.fatal || this.disposed) return;
1516
- this.bufferedBytes += chunk.size;
1517
- if (this.bufferedBytes > MAX_BUFFERED_BYTES) {
1518
- this.fatal = true;
1519
- return;
1520
- }
1521
- this.queue.push({
1522
- partNumber,
1523
- chunk,
1524
- attempts: 0
1525
- });
1526
- this.pump();
1527
- }
1528
- /**
1529
- * Waits for every accepted chunk to be acknowledged, giving parked chunks
1530
- * one final retry round. Returns `true` when all chunks landed and the
1531
- * upload can be completed.
1532
- */
1533
- async drain() {
1534
- this.unsubscribeOnline();
1535
- await this.settleLiveRound();
1536
- while (!this.fatal && this.parked.length > 0) {
1537
- const chunk = this.parked.shift();
1538
- chunk.attempts = MAX_ATTEMPTS - DRAIN_ATTEMPTS;
1539
- this.queue.push(chunk);
1540
- this.pump();
1541
- await this.settleLiveRound();
1542
- if (this.parked.some((p) => p.partNumber === chunk.partNumber)) return false;
1543
- }
1544
- return !this.disposed && !this.fatal && this.parked.length === 0;
1545
- }
1546
- /** Cancels all pending work; held blobs are released. */
1547
- dispose() {
1548
- this.disposed = true;
1549
- this.queue = [];
1550
- this.parked = [];
1551
- this.unsubscribeOnline();
1552
- }
1553
- /**
1554
- * Connectivity is back (browser `online` event) — give parked chunks a
1555
- * fresh live round right away instead of holding them until {@link drain}.
1556
- * The event is only a hint: chunks that still fail simply park again.
1557
- */
1558
- unparkEarly() {
1559
- if (this.fatal || this.disposed || this.parked.length === 0) return;
1560
- for (const chunk of this.parked.splice(0)) {
1561
- chunk.attempts = 0;
1562
- this.queue.push(chunk);
1563
- }
1564
- this.pump();
1565
- }
1566
- async settleLiveRound() {
1567
- while (this.tasks.length > 0) {
1568
- const snapshot = [...this.tasks];
1569
- await Promise.all(snapshot);
1570
- this.tasks = this.tasks.filter((task) => !snapshot.includes(task));
1571
- }
1572
- }
1573
- pump() {
1574
- while (!this.fatal && !this.disposed && this.inFlight < MAX_IN_FLIGHT && this.queue.length > 0) {
1575
- const chunk = this.queue.shift();
1576
- this.inFlight += 1;
1577
- const task = this.uploadWithRetry(chunk).finally(() => {
1578
- this.inFlight -= 1;
1579
- this.pump();
1580
- });
1581
- this.tasks.push(task);
1582
- }
1583
- }
1584
- async uploadWithRetry(pending) {
1585
- while (!this.disposed) {
1586
- pending.attempts += 1;
1587
- try {
1588
- await uploadVideoSelfiePart(this.session, pending.partNumber, pending.chunk);
1589
- this.bufferedBytes -= pending.chunk.size;
1590
- return;
1591
- } catch (error) {
1592
- const status = httpStatusOf$1(error);
1593
- if (status === 409) {
1594
- this.fatal = true;
1595
- return;
1596
- }
1597
- if (status !== null && status >= 400 && status < 500 && status !== 408 && status !== 429 || pending.attempts >= MAX_ATTEMPTS) {
1598
- this.parked.push(pending);
1599
- return;
1600
- }
1601
- await this.delayBeforeRetry(pending.attempts, error);
1602
- }
1603
- }
1604
- }
1605
- delayBeforeRetry(attempt, error) {
1606
- const retryAfterMs = retryAfterMsOf(error);
1607
- const backoffCeiling = Math.min(BACKOFF_BASE_MS * 2 ** (attempt - 1), BACKOFF_CAP_MS);
1608
- const waitMs = retryAfterMs ?? backoffCeiling / 2 + this.jitter() * (backoffCeiling / 2);
1609
- return new Promise((resolve) => {
1610
- this.timer.setTimeout(resolve, waitMs);
1611
- });
1612
- }
1613
- };
1614
- //#endregion
1615
- //#region src/internal/recordings/multipartRecordingService.ts
1616
- /** Attempts for `complete` — documented safe to repeat if the response was lost. */
1617
- const COMPLETE_ATTEMPTS = 3;
1618
- const COMPLETE_BACKOFF_MS = 500;
1619
- function httpStatusOf(error) {
1620
- if (typeof error === "object" && error !== null && "status" in error && typeof error.status === "number") return error.status;
1621
- return null;
1622
- }
1623
- /**
1624
- * Records the camera on-device and streams it to the backend as it is
1625
- * captured, using the video-selfie-service multipart upload protocol
1626
- * (`/v1/video-upload/*`).
1627
- *
1628
- * This is the client-side recorder for Video Selfie and for scoped regular
1629
- * Selfie and ID recordings. It replaces the former server-side recording path.
1630
- *
1631
- * Every ~0.5 s recorder blob uploads as its own chunk, concurrently with
1632
- * recording, through {@link VideoSelfieChunkUploader} (keep-until-ack +
1633
- * retry with backoff — see its doc for the full policy). The service stages
1634
- * sub-5 MiB chunks and combines them server-side, so `stop()` only drains
1635
- * the stragglers and finalizes; client memory holds un-acked chunks only.
1636
- * No client-side encryption: video is encrypted at rest server-side
1637
- * (S3 SSE-AES-256).
1638
- */
1639
- var MultipartRecordingService = class {
1640
- constructor(scope = "videoselfie", recorder = new MultipartRecordingProvider()) {
1641
- this.scope = scope;
1642
- this.timer = BrowserTimerProvider.getInstance();
1643
- this.session = null;
1644
- this.uploader = null;
1645
- this.chunksEmitted = 0;
1646
- this.stopPromise = null;
1647
- this.abandonRequested = false;
1648
- this.recorder = recorder;
1649
- }
1650
- get isRecording() {
1651
- return this.recorder.isRecording;
1652
- }
1653
- async start(stream) {
1654
- if (this.recorder.isRecording) return;
1655
- let initiated = await initiateVideoSelfieUpload(this.scope);
1656
- if (initiated.parts.length > 0) {
1657
- await abortVideoSelfieUpload(initiated).catch(() => {});
1658
- initiated = await initiateVideoSelfieUpload(this.scope);
1659
- }
1660
- this.session = {
1661
- uploadId: initiated.uploadId,
1662
- epoch: initiated.epoch,
1663
- scope: this.scope
1664
- };
1665
- this.uploader = new VideoSelfieChunkUploader(this.session);
1666
- this.chunksEmitted = 0;
1667
- this.abandonRequested = false;
1668
- this.recorder.startRecording(stream, ({ chunk, partNumber }) => {
1669
- this.chunksEmitted += 1;
1670
- this.uploader?.enqueue(partNumber, chunk);
1671
- });
1672
- }
1673
- /** Pause the current media container without finalizing its upload. */
1674
- pause() {
1675
- return this.recorder.pauseRecording?.() ?? false;
1676
- }
1677
- /** Resume the same media container after its video source has recovered. */
1678
- resume() {
1679
- return this.recorder.resumeRecording?.() ?? false;
1680
- }
1681
- stop() {
1682
- if (this.stopPromise) return this.stopPromise;
1683
- const stopPromise = this.finalizeRecording();
1684
- this.stopPromise = stopPromise;
1685
- const clearStopPromise = () => {
1686
- if (this.stopPromise === stopPromise) {
1687
- this.stopPromise = null;
1688
- this.abandonRequested = false;
1689
- }
1690
- };
1691
- stopPromise.then(clearStopPromise, clearStopPromise);
1692
- return stopPromise;
1693
- }
1694
- async finalizeRecording() {
1695
- const session = this.session;
1696
- const uploader = this.uploader;
1697
- if (!this.recorder.isRecording || !session || !uploader) return { recordingId: null };
1698
- try {
1699
- await this.recorder.stopRecording();
1700
- if (this.abandonRequested) {
1701
- this.abandonUpload(session);
1702
- return { recordingId: null };
1703
- }
1704
- const delivered = await uploader.drain();
1705
- if (this.abandonRequested || !delivered || uploader.failed || this.chunksEmitted === 0) {
1706
- this.abandonUpload(session);
1707
- return { recordingId: null };
1708
- }
1709
- } catch (error) {
1710
- this.abandonUpload(session);
1711
- throw error;
1712
- }
1713
- try {
1714
- await this.completeWithRetry(session);
1715
- this.session = null;
1716
- this.uploader = null;
1717
- return { recordingId: session.uploadId };
1718
- } catch {
1719
- this.abandonUpload(session);
1720
- return { recordingId: null };
1721
- }
1722
- }
1723
- cleanup() {
1724
- if (this.session) if (this.stopPromise) {
1725
- this.abandonRequested = true;
1726
- this.uploader?.dispose();
1727
- } else this.abandonUpload(this.session);
1728
- this.recorder.reset();
1729
- }
1730
- /**
1731
- * `complete` is idempotent server-side ("safe to repeat if the response
1732
- * was lost"), so transient failures — network errors, 5xx, 429 — retry a
1733
- * couple of times before the recording is declared failed. A 4xx (e.g.
1734
- * `400` naming a missing part) is permanent: after a clean drain every
1735
- * chunk was acked, so a reported hole cannot be filled from here.
1736
- */
1737
- async completeWithRetry(session) {
1738
- for (let attempt = 1;; attempt += 1) {
1739
- if (this.abandonRequested) throw new Error("Video upload abandoned");
1740
- try {
1741
- await completeVideoSelfieUpload(session);
1742
- return;
1743
- } catch (error) {
1744
- const status = httpStatusOf(error);
1745
- if (status !== null && status >= 400 && status < 500 && status !== 408 && status !== 429 || attempt >= COMPLETE_ATTEMPTS) throw error;
1746
- await new Promise((resolve) => {
1747
- this.timer.setTimeout(resolve, COMPLETE_BACKOFF_MS * attempt);
1748
- });
1749
- }
1750
- }
1751
- }
1752
- /**
1753
- * Fire-and-forget abort: the upload can no longer complete, so tell the
1754
- * backend to fail it immediately rather than at its expiry. Best-effort —
1755
- * an abort that doesn't land (including a 409 from a newer epoch having
1756
- * taken over) just means the server falls back to expiry or salvage.
1757
- */
1758
- abandonUpload(session) {
1759
- if (this.session !== session) return;
1760
- this.session = null;
1761
- this.uploader?.dispose();
1762
- this.uploader = null;
1763
- abortVideoSelfieUpload(session).catch(() => {});
1764
- }
1765
- };
1766
- //#endregion
1767
- export { getAdaptiveMediaRecorderOptions as a, createRecordingCompositor as i, WorkerEncoderRecordingProvider as n, StreamCanvasProcessingSession as o, CameraCompositor as r, MultipartRecordingService as t };
1030
+ export { CameraCompositor_exports as n, createRecordingCompositor as r, CameraCompositor as t };