@incodetech/core 0.0.0-dev-20260715-b208c5e1 → 0.0.0-dev-20260715-dcc78bcd

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 (282) hide show
  1. package/dist/{3dAvatarProvider-BYxFCuIv.esm.js → 3dAvatarProvider-D9H4rR6_.esm.js} +811 -880
  2. package/dist/Actor-iTq7YY48.d.ts +1 -0
  3. package/dist/{BrowserStorageProvider-CBXGCHnK.esm.js → BrowserStorageProvider-P6aUarE9.esm.js} +1 -2
  4. package/dist/{BrowserTimerProvider-CHloo0eQ.esm.js → BrowserTimerProvider-BXhgNxLt.esm.js} +1 -2
  5. package/dist/{BrowserVisibilityObserverProvider-B04zvOXW.esm.js → BrowserVisibilityObserverProvider-sJclps4C.esm.js} +1 -3
  6. package/dist/{Face2DProvider-TeN1Xqr0.esm.js → Face2DProvider-xWUeSJZI.esm.js} +10 -22
  7. package/dist/{createFaceAvatar-BjBu2CrU.d.ts → FaceDetectionProvider-BHweGBEM.d.ts} +108 -159
  8. package/dist/IFaceAvatarCapability-BrL19G0s.d.ts +23 -0
  9. package/dist/IStorageCapability-B8IGxCwe.d.ts +131 -0
  10. package/dist/{ITimerCapability-G7lQg-be.esm.js → ITimerCapability-DgdDzp8G.esm.js} +1 -2
  11. package/dist/{Manager-DE5DydXZ.d.ts → Manager-CQQ99QOI.d.ts} +1 -0
  12. package/dist/{MotionSensorProvider-BkHKMCPE.esm.js → MotionSensorProvider-DYvM90IX.esm.js} +1 -2
  13. package/dist/{OpenViduRecordingProvider-xR5osKzW.esm.js → OpenViduRecordingProvider-Du98qevC.esm.js} +2 -4
  14. package/dist/{PrivacyLensProvider-CqlsCaJv.esm.js → PrivacyLensProvider-BrYSd1dr.esm.js} +2 -5
  15. package/dist/StateMachine-EDpYWy0i.d.ts +6 -0
  16. package/dist/{StreamCanvasCapture-CRk7c7u7.esm.js → StreamCanvasCapture-D2XcXCZ4.esm.js} +2 -4
  17. package/dist/{WasmUtilProvider-BNQ2PBjG.esm.js → WasmUtilProvider-DAshwHhX.esm.js} +38 -71
  18. package/dist/{addressSearch-B2NxSpHl.esm.js → addressSearch-DH-IPF-w.esm.js} +10 -21
  19. package/dist/ae-signature.d.ts +2 -6
  20. package/dist/ae-signature.esm.js +10 -11
  21. package/dist/antifraud.d.ts +1 -6
  22. package/dist/antifraud.esm.js +3 -8
  23. package/dist/{antifraudManager-C490m0p4.d.ts → antifraudManager-BY36bS12.d.ts} +3 -3
  24. package/dist/{antifraudManager-C1xnhF2Q.esm.js → antifraudManager-CL2YhiVX.esm.js} +11 -8
  25. package/dist/{antifraudStateMachine-BQVw46N5.esm.js → antifraudStateMachine-Bf-IiCq7.esm.js} +5 -7
  26. package/dist/{api-DsbUi7TO.esm.js → api-BDTZNnca.esm.js} +1 -2
  27. package/dist/{apiError-DkOXfFBu.esm.js → apiError-COvIGYWe.esm.js} +1 -2
  28. package/dist/authentication.d.ts +2 -19
  29. package/dist/authentication.esm.js +3 -34
  30. package/dist/{authenticationManager-DZXQpCjQ.esm.js → authenticationManager-DM7ttL5V.esm.js} +7 -10
  31. package/dist/{authenticationManager-BD81fnrn.d.ts → authenticationManager-G-k-13Fe.d.ts} +3 -4
  32. package/dist/{authenticationStateMachine-CJrTbLWU.esm.js → authenticationStateMachine-DiI8jfmO.esm.js} +11 -15
  33. package/dist/avatar.d.ts +2 -2
  34. package/dist/avatar.esm.js +2 -3
  35. package/dist/{backCameraStream-DYnfq7Hr.esm.js → backCameraStream-Heg6vA1j.esm.js} +4 -7
  36. package/dist/browser-DlFgHpoC-DnyrCR8r.esm.js +1513 -0
  37. package/dist/callback-645_omgz.d.ts +133 -0
  38. package/dist/{camera-B0yWS33x.esm.js → camera-BmFEyPP_.esm.js} +1 -2
  39. package/dist/camera.d.ts +1 -2
  40. package/dist/camera.esm.js +2 -6
  41. package/dist/{canvas-DsJa51yU.esm.js → canvas-E1zGkel4.esm.js} +1 -2
  42. package/dist/certificate-issuance.d.ts +34 -39
  43. package/dist/certificate-issuance.esm.js +4 -11
  44. package/dist/{certificateIssuanceStateMachine-CpewPqas.esm.js → certificateIssuanceStateMachine-Ce568YfR.esm.js} +7 -11
  45. package/dist/{clientLifecycle-CCJMDjFe.esm.js → clientLifecycle-DzT65Fvf.esm.js} +23 -29
  46. package/dist/consent.d.ts +1 -4
  47. package/dist/consent.esm.js +3 -8
  48. package/dist/{consentManager-r4MTIoV3.esm.js → consentManager-D3GyyH5u.esm.js} +5 -7
  49. package/dist/{consentManager-QGuw4zmH.d.ts → consentManager-DLOyIZzt.d.ts} +58 -64
  50. package/dist/{consentStateMachine-DnqwsZ7o.esm.js → consentStateMachine-Pc3Ez3mV.esm.js} +5 -7
  51. package/dist/{cpf-B9htWzDt.esm.js → cpf-BIADjddF.esm.js} +1 -2
  52. package/dist/cpf-ocr.d.ts +1 -5
  53. package/dist/cpf-ocr.esm.js +2 -8
  54. package/dist/{cpfOcrManager-RkeZCqSz.d.ts → cpfOcrManager-CQkUAeWO.d.ts} +21 -23
  55. package/dist/{cpfOcrManager-D6ZQ9kkv.esm.js → cpfOcrManager-Cwm0MesJ.esm.js} +7 -12
  56. package/dist/createFaceAvatar-BEj18KXi.d.ts +50 -0
  57. package/dist/{createFaceAvatar-B_v2At2h.esm.js → createFaceAvatar-CwVapQiu.esm.js} +5 -9
  58. package/dist/cross-document-data-match.d.ts +1 -5
  59. package/dist/cross-document-data-match.esm.js +2 -8
  60. package/dist/{crossDocumentDataMatchManager-DoFG_S91.esm.js → crossDocumentDataMatchManager-9rdIO8Qk.esm.js} +12 -12
  61. package/dist/{crossDocumentDataMatchManager-CdiqxhJm.d.ts → crossDocumentDataMatchManager-Dq8Z3SOg.d.ts} +3 -3
  62. package/dist/curp-validation.d.ts +1 -11
  63. package/dist/curp-validation.esm.js +3 -8
  64. package/dist/{curpValidationManager-07oV78Bn.d.ts → curpValidationManager--HSBTwOy.d.ts} +4 -6
  65. package/dist/{curpValidationManager-D6jt1Gs9.esm.js → curpValidationManager-C2i9Lzx9.esm.js} +11 -7
  66. package/dist/{curpValidationStateMachine-Dlw4qfFb.esm.js → curpValidationStateMachine-7i3TD8J2.esm.js} +22 -14
  67. package/dist/custom-fields.d.ts +2 -5
  68. package/dist/custom-fields.esm.js +24 -11
  69. package/dist/custom-watchlist.d.ts +1 -3
  70. package/dist/custom-watchlist.esm.js +11 -10
  71. package/dist/{customWatchlistStateMachine-D8w0mNxm.esm.js → customWatchlistStateMachine-D23XTxl2.esm.js} +5 -7
  72. package/dist/{dateUtils-BW6mBV6p.esm.js → dateUtils-CvG0FvK8.esm.js} +1 -2
  73. package/dist/{deepsightService-CV1NAkg9.esm.js → deepsightLoader-CQWGVLP0.esm.js} +62 -14
  74. package/dist/deepsightService-CR-CYdka.d.ts +218 -0
  75. package/dist/device.d.ts +0 -1
  76. package/dist/device.esm.js +5 -10
  77. package/dist/document-capture.d.ts +1 -6
  78. package/dist/document-capture.esm.js +3 -16
  79. package/dist/document-upload.d.ts +48 -55
  80. package/dist/document-upload.esm.js +8 -14
  81. package/dist/{documentCaptureManager-HNu28khr.d.ts → documentCaptureManager-Biz_PFqs.d.ts} +190 -199
  82. package/dist/{documentCaptureManager-pufyUaQz.esm.js → documentCaptureManager-DijbJFun.esm.js} +5 -7
  83. package/dist/{documentCaptureStateMachine-CaJgb_Vn.esm.js → documentCaptureStateMachine-qgsrlcVh.esm.js} +11 -15
  84. package/dist/dynamic-forms.d.ts +1 -4
  85. package/dist/dynamic-forms.esm.js +3 -10
  86. package/dist/{dynamicFormsManager-C3jlNlWK.esm.js → dynamicFormsManager-COik5bJ7.esm.js} +41 -7
  87. package/dist/{dynamicFormsManager-HQhUJCLg.d.ts → dynamicFormsManager-Dposae2l.d.ts} +3 -4
  88. package/dist/{dynamicFormsStateMachine-DdpJI6ne.esm.js → dynamicFormsStateMachine-BV-Fn13x.esm.js} +7 -11
  89. package/dist/ekyb.d.ts +4 -11
  90. package/dist/ekyb.esm.js +3 -20
  91. package/dist/{ekybManager-l67BnqxH.esm.js → ekybManager-BTcW4poN.esm.js} +17 -7
  92. package/dist/{ekybManager-CZUVEWMw.d.ts → ekybManager-CBX0tM04.d.ts} +4 -5
  93. package/dist/{ekybStateMachine-BmfNaHRF.esm.js → ekybStateMachine-DmZLm35R.esm.js} +16 -25
  94. package/dist/ekyc.d.ts +2 -7
  95. package/dist/ekyc.esm.js +3 -11
  96. package/dist/{ekycManager-ClRqj2rg.d.ts → ekycManager-BFpHbBoT.d.ts} +4 -5
  97. package/dist/{ekycManager-B_uUa1iN.esm.js → ekycManager-BSMlIpGA.esm.js} +14 -7
  98. package/dist/{ekycStateMachine-BD8GjdL5.esm.js → ekycStateMachine-a7oP-XWo.esm.js} +140 -201
  99. package/dist/electronic-signature.d.ts +2 -5
  100. package/dist/electronic-signature.esm.js +2 -10
  101. package/dist/{electronicSignatureManager-CzMj-Tjm.esm.js → electronicSignatureManager-DSZu9OHT.esm.js} +9 -14
  102. package/dist/email.d.ts +1 -5
  103. package/dist/email.esm.js +3 -10
  104. package/dist/{emailManager-Lv9BHgel.d.ts → emailManager-CADXW_9X.d.ts} +4 -7
  105. package/dist/{emailManager-BsynjdWX.esm.js → emailManager-c-mDLieD.esm.js} +76 -12
  106. package/dist/{emailStateMachine-Z-Jf4qOc.esm.js → emailStateMachine-ChNwY22u.esm.js} +7 -9
  107. package/dist/{endpoints-CwrFQfW7.esm.js → endpoints-DLQ0g4-R.esm.js} +33 -2
  108. package/dist/{events-aeCkGlnn.esm.js → events-Dy8PyVO5.esm.js} +4 -168
  109. package/dist/events.d.ts +1 -9
  110. package/dist/events.esm.js +2 -4
  111. package/dist/extensibility.d.ts +30 -42
  112. package/dist/extensibility.esm.js +29 -87
  113. package/dist/{externalFetch-hvmz_npP.esm.js → externalFetch-BKBThAUC.esm.js} +2 -4
  114. package/dist/face-match.d.ts +1 -5
  115. package/dist/face-match.esm.js +3 -8
  116. package/dist/{faceCaptureManagerFactory-CGFQg1kl.d.ts → faceCaptureManagerFactory-BWD3O4Eg.d.ts} +50 -14
  117. package/dist/{faceCaptureManagerFactory-BIH53wvb.esm.js → faceCaptureManagerFactory-CZLSziU3.esm.js} +49 -28
  118. package/dist/{faceCaptureSetup-shrwrZaK.esm.js → faceCaptureSetup-__lVldUG.esm.js} +12 -15
  119. package/dist/{faceMatchManager-BrNYVk-p.esm.js → faceMatchManager-B7jlv77Q.esm.js} +24 -7
  120. package/dist/{faceMatchManager-X2eQo0o-.d.ts → faceMatchManager-CJQG1W1u.d.ts} +4 -4
  121. package/dist/{faceMatchStateMachine-CbeacEqd.esm.js → faceMatchStateMachine-DD7FxtUj.esm.js} +6 -9
  122. package/dist/field-comparison.d.ts +1 -4
  123. package/dist/field-comparison.esm.js +2 -7
  124. package/dist/{fieldComparisonManager-BxhleGNI.esm.js → fieldComparisonManager-5LlxYad-.esm.js} +6 -11
  125. package/dist/{fieldComparisonManager-Dg03uIX1.d.ts → fieldComparisonManager-CBvEGxFx.d.ts} +3 -5
  126. package/dist/fiscal-qr.d.ts +1 -6
  127. package/dist/fiscal-qr.esm.js +14 -29
  128. package/dist/flow-events.d.ts +2 -9
  129. package/dist/flow.d.ts +13 -19
  130. package/dist/flow.esm.js +109 -34
  131. package/dist/{flowCompletionService-qf-s8Uxl.esm.js → flowCompletionService-DQSC7Kso.esm.js} +4 -6
  132. package/dist/{flowServices-CJXaWFlZ.esm.js → flowServices-BQEUaMg6.esm.js} +10 -11
  133. package/dist/geolocation.d.ts +1 -4
  134. package/dist/geolocation.esm.js +3 -9
  135. package/dist/{geolocationManager-CAtyY00b.d.ts → geolocationManager-BWhRzBjk.d.ts} +3 -4
  136. package/dist/{geolocationManager-4j_DV3jW.esm.js → geolocationManager-D58ehBHU.esm.js} +19 -8
  137. package/dist/{geolocationStateMachine-BE72KBAX.esm.js → geolocationStateMachine-BorcBNZ6.esm.js} +6 -8
  138. package/dist/getBrowser-Cb8Zgrgp.esm.js +7 -0
  139. package/dist/{getDeviceClass-BdgmyOOu.esm.js → getDeviceClass-CeBiEayS.esm.js} +1 -2
  140. package/dist/{getDeviceClass-DsNb6nEl.esm.js → getDeviceClass-CkgnSJel.esm.js} +3 -5
  141. package/dist/{getBrowser-CZ66VtC7.esm.js → getParsedUserAgent-pJjATANs.esm.js} +109 -30
  142. package/dist/government-validation.d.ts +3 -6
  143. package/dist/government-validation.esm.js +7 -13
  144. package/dist/{governmentValidationStateMachine-BfZ_WQC0.esm.js → governmentValidationStateMachine-DkakcwTj.esm.js} +8 -11
  145. package/dist/home.d.ts +14 -22
  146. package/dist/home.esm.js +3 -8
  147. package/dist/http.d.ts +0 -1
  148. package/dist/http.esm.js +2 -4
  149. package/dist/id-ocr.d.ts +1 -5
  150. package/dist/id-ocr.esm.js +3 -9
  151. package/dist/id-verification.d.ts +1 -4
  152. package/dist/id-verification.esm.js +3 -8
  153. package/dist/id.d.ts +105 -18
  154. package/dist/id.esm.js +40 -50
  155. package/dist/{idCaptureDefaults-Df8XKQ0o.esm.js → idCaptureDefaults-Dzfws4i0.esm.js} +9 -16
  156. package/dist/{idCaptureManager-Fr9c67Rx.esm.js → idCaptureManager-BGAdNNVq.esm.js} +117 -23
  157. package/dist/{idCaptureManager-BXG8kVMW.d.ts → idCaptureManager-CSGbGORT.d.ts} +12 -113
  158. package/dist/{idCaptureStateMachine-CpjwdaYN.esm.js → idCaptureStateMachine-DYgckwCg.esm.js} +56 -195
  159. package/dist/{idOcrManager-DLF3J2cx.esm.js → idOcrManager-niAg-BE0.esm.js} +4 -7
  160. package/dist/{idOcrManager-DnhdGuVX.d.ts → idOcrManager-vXa7GdRh.d.ts} +60 -66
  161. package/dist/{idOcrStateMachine-BPXTUjNY.esm.js → idOcrStateMachine-CpZZL411.esm.js} +13 -18
  162. package/dist/{idVerificationManager-BD2FO09A.d.ts → idVerificationManager-BB4Pj_N6.d.ts} +31 -35
  163. package/dist/{idVerificationManager-23kPMn7T.esm.js → idVerificationManager-CujJqsiX.esm.js} +4 -7
  164. package/dist/{idVerificationStateMachine-C1eMEu_Y.esm.js → idVerificationStateMachine-D-1GlgC5.esm.js} +5 -7
  165. package/dist/identity-reuse.d.ts +1 -4
  166. package/dist/identity-reuse.esm.js +3 -8
  167. package/dist/{identityReuseManager-Ct-9qYpC.esm.js → identityReuseManager-DHfJZTVo.esm.js} +24 -7
  168. package/dist/{identityReuseManager-DOufEjLa.d.ts → identityReuseManager-aTyLyYrr.d.ts} +38 -43
  169. package/dist/{identityReuseStateMachine-Cqc-NwEQ.esm.js → identityReuseStateMachine-CM45EBrb.esm.js} +6 -8
  170. package/dist/index-B8weJxmL.d.ts +1 -0
  171. package/dist/index-BKOWUhxG.d.ts +258 -0
  172. package/dist/{index-WMHgnbC1.d.ts → index-CKbmDFNq.d.ts} +160 -165
  173. package/dist/{index-Bk5nhSg2.d.ts → index-DQ2fdqoI.d.ts} +3 -3
  174. package/dist/index.d.ts +1 -3
  175. package/dist/index.esm.js +2 -15
  176. package/dist/{invokeOnCaptureCallback-Bs09kdY_.esm.js → invokeOnCaptureCallback-B-QfsCQY.esm.js} +2 -4
  177. package/dist/{lib-DvZ6nVvW.esm.js → lib-DAyUtOTj.esm.js} +1510 -1589
  178. package/dist/mandatory-consent.d.ts +1 -10
  179. package/dist/mandatory-consent.esm.js +3 -8
  180. package/dist/{mandatoryConsentManager-D0qQHcl2.d.ts → mandatoryConsentManager-BlB4bX6_.d.ts} +59 -65
  181. package/dist/{mandatoryConsentManager-Bh_n0uEP.esm.js → mandatoryConsentManager-CQC-zA4P.esm.js} +4 -7
  182. package/dist/{mandatoryConsentStateMachine-DYeKH1L7.esm.js → mandatoryConsentStateMachine-BN4Obfl7.esm.js} +5 -7
  183. package/dist/{mediaRecorderOptions-BIn657lu.esm.js → mediaRecorderOptions-BhSZDDNb.esm.js} +2 -4
  184. package/dist/{mediapipeShared-B-RiRyLN.esm.js → mediapipeShared-B0iQQ5k7.esm.js} +2 -6
  185. package/dist/{onDeviceFaceResults-CJuDp67S.esm.js → onDeviceFaceResults-LRTvBL7m.esm.js} +18 -84
  186. package/dist/openviduLazy-CCDpFWg1.esm.js +10 -0
  187. package/dist/{otp-D_9QPNbs.d.ts → otp-CEWfTj9v.d.ts} +0 -1
  188. package/dist/{otp-Bbe_izFJ.esm.js → otp-D2k3PeSL.esm.js} +3 -14
  189. package/dist/{permissionGuards-CayfS8OY.esm.js → permissionGuards-DguX5vFY.esm.js} +2 -4
  190. package/dist/{permissionServices-B7lD6fiG.esm.js → permissionServices-DwNCUB2I.esm.js} +4 -9
  191. package/dist/personhood.d.ts +13 -20
  192. package/dist/personhood.esm.js +153 -72
  193. package/dist/phone.d.ts +1 -5
  194. package/dist/phone.esm.js +3 -10
  195. package/dist/{phoneManager-85eRUhJD.d.ts → phoneManager-BBU8Lq0O.d.ts} +4 -7
  196. package/dist/{phoneManager-Byive8Xl.esm.js → phoneManager-KbcmjEeH.esm.js} +82 -12
  197. package/dist/{phoneStateMachine-BlYF4nKx.esm.js → phoneStateMachine-wDQtaT38.esm.js} +7 -9
  198. package/dist/{platform-BoeUeUrV.esm.js → platform-wmV7oTAJ.esm.js} +1 -9
  199. package/dist/qe-signature.d.ts +2 -6
  200. package/dist/qe-signature.esm.js +10 -11
  201. package/dist/{recordingService-BzQUrf40.esm.js → recordingService-TuBlOjvH.esm.js} +15 -19
  202. package/dist/redirect-to-mobile.d.ts +1 -6
  203. package/dist/redirect-to-mobile.esm.js +3 -10
  204. package/dist/{redirectToMobileManager-DrxIfZr8.esm.js → redirectToMobileManager-EGXGKftv.esm.js} +25 -8
  205. package/dist/{redirectToMobileManager-2TtzpSOw.d.ts → redirectToMobileManager-NVQM3o5P.d.ts} +3 -4
  206. package/dist/{redirectToMobileStateMachine-BetR6r8p.esm.js → redirectToMobileStateMachine-D-8ipBq2.esm.js} +7 -9
  207. package/dist/rolldown-runtime-FZ4Itg2g.esm.js +42 -0
  208. package/dist/{runChildModule-FH_tixbR.esm.js → runChildModule-Crz1nHwJ.esm.js} +5 -9
  209. package/dist/selfie.d.ts +7 -20
  210. package/dist/selfie.esm.js +40 -46
  211. package/dist/{selfieManager-CdUnYjmt.esm.js → selfieManager-C4_2DgTF.esm.js} +7 -10
  212. package/dist/{selfieManager-d7nkO-UP.d.ts → selfieManager-CN8wJ14s.d.ts} +3 -4
  213. package/dist/{selfieStateMachine-zz4WqziP.esm.js → selfieStateMachine-ODRceav2.esm.js} +15 -20
  214. package/dist/selfieUploadService-B4LnSIf6.esm.js +62 -0
  215. package/dist/session-CQ2x2aLl.esm.js +1 -0
  216. package/dist/session.d.ts +2 -9
  217. package/dist/session.esm.js +153 -15
  218. package/dist/sessionInitializer-Cjpnacyg.esm.js +1801 -0
  219. package/dist/{setup-BxB6QUto.d.ts → setup-CgBvqGWw.d.ts} +2 -4
  220. package/dist/{setup-DCyhfufM.esm.js → setup-Hyb_Yiuu.esm.js} +126 -18
  221. package/dist/signature.d.ts +2 -6
  222. package/dist/signature.esm.js +6 -9
  223. package/dist/{signatureStateMachine-U8ewxW1t.esm.js → signatureStateMachine-BmKPC5A9.esm.js} +5 -7
  224. package/dist/spawn-D9jgw9pW.d.ts +1441 -0
  225. package/dist/{stats-BVy52wLy.esm.js → stats-Bu6bL_CX.esm.js} +3 -5
  226. package/dist/stats.esm.js +2 -5
  227. package/dist/topLevelStateName-B5i2avbh.esm.js +41 -0
  228. package/dist/{tri-Calc36Ny.esm.js → tri-N-xlKhZK.esm.js} +3 -7
  229. package/dist/tri.d.ts +2 -2
  230. package/dist/tri.esm-BIjHhBJ2.esm.js +2620 -0
  231. package/dist/tri.esm.js +2 -4
  232. package/dist/trust-graph.d.ts +4 -5
  233. package/dist/trust-graph.esm.js +13 -9
  234. package/dist/{types-Db2ooXIu.esm.js → types-BN5RPPIZ.esm.js} +1 -2
  235. package/dist/{types-ZezaAAbn.d.ts → types-BfgmV7s7.d.ts} +2 -2
  236. package/dist/{types-NizIIgLD.d.ts → types-BnEHzP1K.d.ts} +3 -5
  237. package/dist/{types-DCOl8zy6.d.ts → types-Vb4P9ovf.d.ts} +1 -3
  238. package/dist/{types-C0D4Brd6.d.ts → types-ctqh-iS4.d.ts} +80 -6
  239. package/dist/{urlUtils-CpiYwn7w.esm.js → urlUtils-D6phjq1-.esm.js} +1 -2
  240. package/dist/{video-DXf5H9rY.esm.js → video-BtSWtHy1.esm.js} +1 -2
  241. package/dist/video-selfie.d.ts +10 -15
  242. package/dist/video-selfie.esm.js +114 -106
  243. package/dist/{videoSelfieSteps-DAky5sq5.esm.js → videoSelfieSteps-DHcibfYH.esm.js} +1 -2
  244. package/dist/wasm.d.ts +2 -4
  245. package/dist/wasm.esm.js +3 -15
  246. package/dist/watchlist-for-business.d.ts +1 -3
  247. package/dist/watchlist-for-business.esm.js +9 -9
  248. package/dist/watchlist.d.ts +1 -3
  249. package/dist/watchlist.esm.js +11 -10
  250. package/dist/{watchlistForBusinessStateMachine-Bbn_dcVT.esm.js → watchlistForBusinessStateMachine-BC_-3fJs.esm.js} +5 -7
  251. package/dist/{watchlistStateMachine-SZ-1xpe4.esm.js → watchlistStateMachine-CL2j3aRl.esm.js} +5 -7
  252. package/dist/workflow.d.ts +124 -146
  253. package/dist/workflow.esm.js +75 -80
  254. package/dist/xstate-actors.esm-CtI5S0f4.esm.js +310 -0
  255. package/dist/{xstate.esm-nY3M5UYm.esm.js → xstate.esm-Cf4e0Cfd.esm.js} +136 -610
  256. package/package.json +2 -2
  257. package/dist/Actor-CdjYVucI.d.ts +0 -2
  258. package/dist/FaceDetectionProvider-D-zCGbS9.d.ts +0 -119
  259. package/dist/IWasmUtilCapability-CuiW_6d1.d.ts +0 -150
  260. package/dist/StateMachine-BTkXO3Na.d.ts +0 -2
  261. package/dist/StreamCanvasCapture-D9u4hwul.d.ts +0 -42
  262. package/dist/ae-signature-eQWjmzE8.esm.js +0 -12
  263. package/dist/browser-DlFgHpoC-BTB6a7n-.esm.js +0 -1425
  264. package/dist/browserSimulation-CQjwFn0Z.esm.js +0 -1256
  265. package/dist/canvas-COIxuirO.d.ts +0 -112
  266. package/dist/chunk-CIKcdghV.esm.js +0 -49
  267. package/dist/deepsightLoader-BppeThau.esm.js +0 -67
  268. package/dist/deepsightService-mkIAy_Eq.d.ts +0 -69
  269. package/dist/http-C3Pq6njG.esm.js +0 -0
  270. package/dist/index-BD6ZVw2f.d.ts +0 -93
  271. package/dist/openviduLazy-CuGqb-8Q.esm.js +0 -12
  272. package/dist/openviduLazy-DNb0xHJp.esm.js +0 -3
  273. package/dist/qe-signature-D9XM2d-F.esm.js +0 -12
  274. package/dist/session--C2lbjK5.esm.js +0 -152
  275. package/dist/sessionInitializer-Dx_oPfHP.esm.js +0 -548
  276. package/dist/tri.esm-BDhptA8x.esm.js +0 -2593
  277. /package/dist/{IVisibilityObserverCapability-C3tAkSfF.d.ts → IVisibilityObserverCapability-D4tvIB5v.d.ts} +0 -0
  278. /package/dist/{camera-DRH7co71.d.ts → camera-9wWD-pwg.d.ts} +0 -0
  279. /package/dist/{flowCompletionService-DGcE_OvO.d.ts → flowCompletionService-BlAHsKyv.d.ts} +0 -0
  280. /package/dist/{types-DawqnFVn.d.ts → types-BT-aiBYV.d.ts} +0 -0
  281. /package/dist/{types-B6KIOo6S.d.ts → types-Bk_6dmDa.d.ts} +0 -0
  282. /package/dist/{warmup-CE9Fhs6N.d.ts → warmup-Dv2alr2-.d.ts} +0 -0
@@ -1,75 +1,40 @@
1
- import "./WasmUtilProvider-BNQ2PBjG.esm.js";
2
- import "./BrowserTimerProvider-CHloo0eQ.esm.js";
3
- import { t as api } from "./api-DsbUi7TO.esm.js";
4
- import { g as addEvent, n as eventModuleNames, s as createManagerInstrumentation } from "./events-aeCkGlnn.esm.js";
5
- import { t as endpoints } from "./endpoints-CwrFQfW7.esm.js";
6
- import "./stats-BVy52wLy.esm.js";
7
- import { i as initializeSession, r as getSessionFingerprintResult } from "./sessionInitializer-Dx_oPfHP.esm.js";
8
- import "./getBrowser-CZ66VtC7.esm.js";
9
- import "./browserSimulation-CQjwFn0Z.esm.js";
10
- import "./platform-BoeUeUrV.esm.js";
11
- import "./tri-Calc36Ny.esm.js";
12
- import { a as fromPromise, l as createManager, r as assign, s as createActor, t as setup } from "./xstate.esm-nY3M5UYm.esm.js";
13
- import "./urlUtils-CpiYwn7w.esm.js";
14
- import "./externalFetch-hvmz_npP.esm.js";
15
- import { n as toIncodeApiError } from "./apiError-DkOXfFBu.esm.js";
16
- import { n as electronicSignatureMachine } from "./electronicSignatureManager-CzMj-Tjm.esm.js";
17
- import "./ae-signature-eQWjmzE8.esm.js";
18
- import { t as antifraudMachine } from "./antifraudStateMachine-BQVw46N5.esm.js";
19
- import "./faceCaptureSetup-shrwrZaK.esm.js";
20
- import "./MotionSensorProvider-BkHKMCPE.esm.js";
21
- import "./permissionServices-B7lD6fiG.esm.js";
22
- import "./camera-B0yWS33x.esm.js";
23
- import "./onDeviceFaceResults-CJuDp67S.esm.js";
24
- import "./ITimerCapability-G7lQg-be.esm.js";
25
- import "./canvas-DsJa51yU.esm.js";
26
- import "./backCameraStream-DYnfq7Hr.esm.js";
27
- import "./video-DXf5H9rY.esm.js";
28
- import "./getDeviceClass-BdgmyOOu.esm.js";
29
- import "./deepsightService-CV1NAkg9.esm.js";
30
- import "./getDeviceClass-DsNb6nEl.esm.js";
31
- import "./types-Db2ooXIu.esm.js";
32
- import "./createFaceAvatar-B_v2At2h.esm.js";
33
- import "./StreamCanvasCapture-CRk7c7u7.esm.js";
34
- import "./permissionGuards-CayfS8OY.esm.js";
35
- import "./recordingService-BzQUrf40.esm.js";
36
- import "./mediaRecorderOptions-BIn657lu.esm.js";
37
- import { t as authenticationMachine } from "./authenticationStateMachine-CJrTbLWU.esm.js";
38
- import { t as certificateIssuanceMachine } from "./certificateIssuanceStateMachine-CpewPqas.esm.js";
39
- import { t as consentMachine } from "./consentStateMachine-DnqwsZ7o.esm.js";
40
- import "./cpf-B9htWzDt.esm.js";
41
- import { t as curpValidationMachine } from "./curpValidationStateMachine-Dlw4qfFb.esm.js";
42
- import "./dateUtils-BW6mBV6p.esm.js";
43
- import { t as customWatchlistMachine } from "./customWatchlistStateMachine-D8w0mNxm.esm.js";
44
- import { t as documentCaptureMachine } from "./documentCaptureStateMachine-CaJgb_Vn.esm.js";
45
- import { t as dynamicFormsMachine } from "./dynamicFormsStateMachine-DdpJI6ne.esm.js";
46
- import { n as toEkybConfig, t as ekybMachine } from "./ekybStateMachine-BmfNaHRF.esm.js";
47
- import "./addressSearch-B2NxSpHl.esm.js";
48
- import "./session--C2lbjK5.esm.js";
49
- import "./videoSelfieSteps-DAky5sq5.esm.js";
50
- import "./flowServices-CJXaWFlZ.esm.js";
51
- import { n as toEkycConfig, t as ekycMachine } from "./ekycStateMachine-BD8GjdL5.esm.js";
52
- import { t as emailMachine } from "./emailStateMachine-Z-Jf4qOc.esm.js";
53
- import "./otp-Bbe_izFJ.esm.js";
54
- import { t as selfieMachine } from "./selfieStateMachine-zz4WqziP.esm.js";
55
- import { t as idCaptureMachine } from "./idCaptureStateMachine-CpjwdaYN.esm.js";
56
- import "./idCaptureDefaults-Df8XKQ0o.esm.js";
57
- import { t as phoneMachine } from "./phoneStateMachine-BlYF4nKx.esm.js";
58
- import { n as identityReuseMachine } from "./identityReuseStateMachine-Cqc-NwEQ.esm.js";
59
- import { t as mandatoryConsentMachine } from "./mandatoryConsentStateMachine-DYeKH1L7.esm.js";
60
- import { t as idOcrStateMachine } from "./idOcrStateMachine-BPXTUjNY.esm.js";
61
- import { t as redirectToMobileMachine } from "./redirectToMobileStateMachine-BetR6r8p.esm.js";
62
- import { t as geolocationMachine } from "./geolocationStateMachine-BE72KBAX.esm.js";
63
- import { t as idVerificationMachine } from "./idVerificationStateMachine-C1eMEu_Y.esm.js";
64
- import { t as faceMatchMachine } from "./faceMatchStateMachine-CbeacEqd.esm.js";
65
- import { n as getFinishStatus, r as getTotalScoreStatus } from "./flowCompletionService-qf-s8Uxl.esm.js";
66
- import { n as isAdvanceableError, r as attachFlowEventEmitter, t as runChildModule } from "./runChildModule-FH_tixbR.esm.js";
67
- import { t as governmentValidationMachine } from "./governmentValidationStateMachine-BfZ_WQC0.esm.js";
68
- import "./qe-signature-D9XM2d-F.esm.js";
69
- import { t as signatureMachine } from "./signatureStateMachine-U8ewxW1t.esm.js";
70
- import { t as watchlistMachine } from "./watchlistStateMachine-SZ-1xpe4.esm.js";
71
- import { t as watchlistForBusinessMachine } from "./watchlistForBusinessStateMachine-Bbn_dcVT.esm.js";
72
-
1
+ import { t as api } from "./api-BDTZNnca.esm.js";
2
+ import { m as addEvent, n as eventModuleNames, o as createManagerInstrumentation } from "./events-Dy8PyVO5.esm.js";
3
+ import { t as endpoints } from "./endpoints-DLQ0g4-R.esm.js";
4
+ import { i as initializeSession, r as getSessionFingerprintResult } from "./sessionInitializer-Cjpnacyg.esm.js";
5
+ import { c as createManager, o as createActor, r as assign, t as setup } from "./xstate.esm-Cf4e0Cfd.esm.js";
6
+ import { n as fromPromise } from "./xstate-actors.esm-CtI5S0f4.esm.js";
7
+ import { n as toIncodeApiError } from "./apiError-COvIGYWe.esm.js";
8
+ import { n as electronicSignatureMachine } from "./electronicSignatureManager-DSZu9OHT.esm.js";
9
+ import "./ae-signature.esm.js";
10
+ import { t as antifraudMachine } from "./antifraudStateMachine-Bf-IiCq7.esm.js";
11
+ import { t as authenticationMachine } from "./authenticationStateMachine-DiI8jfmO.esm.js";
12
+ import { t as certificateIssuanceMachine } from "./certificateIssuanceStateMachine-Ce568YfR.esm.js";
13
+ import { t as consentMachine } from "./consentStateMachine-Pc3Ez3mV.esm.js";
14
+ import { t as curpValidationMachine } from "./curpValidationStateMachine-7i3TD8J2.esm.js";
15
+ import { t as customWatchlistMachine } from "./customWatchlistStateMachine-D23XTxl2.esm.js";
16
+ import { t as documentCaptureMachine } from "./documentCaptureStateMachine-qgsrlcVh.esm.js";
17
+ import { t as dynamicFormsMachine } from "./dynamicFormsStateMachine-BV-Fn13x.esm.js";
18
+ import { n as toEkybConfig, t as ekybMachine } from "./ekybStateMachine-DmZLm35R.esm.js";
19
+ import { n as toEkycConfig, t as ekycMachine } from "./ekycStateMachine-a7oP-XWo.esm.js";
20
+ import { t as emailMachine } from "./emailStateMachine-ChNwY22u.esm.js";
21
+ import { t as selfieMachine } from "./selfieStateMachine-ODRceav2.esm.js";
22
+ import { t as idCaptureMachine } from "./idCaptureStateMachine-DYgckwCg.esm.js";
23
+ import { t as phoneMachine } from "./phoneStateMachine-wDQtaT38.esm.js";
24
+ import { n as identityReuseMachine } from "./identityReuseStateMachine-CM45EBrb.esm.js";
25
+ import { t as mandatoryConsentMachine } from "./mandatoryConsentStateMachine-BN4Obfl7.esm.js";
26
+ import { t as idOcrStateMachine } from "./idOcrStateMachine-CpZZL411.esm.js";
27
+ import { t as redirectToMobileMachine } from "./redirectToMobileStateMachine-D-8ipBq2.esm.js";
28
+ import { t as geolocationMachine } from "./geolocationStateMachine-BorcBNZ6.esm.js";
29
+ import { t as idVerificationMachine } from "./idVerificationStateMachine-D-1GlgC5.esm.js";
30
+ import { t as faceMatchMachine } from "./faceMatchStateMachine-DD7FxtUj.esm.js";
31
+ import { n as getFinishStatus, r as getTotalScoreStatus } from "./flowCompletionService-DQSC7Kso.esm.js";
32
+ import { n as isAdvanceableError, r as attachFlowEventEmitter, t as runChildModule } from "./runChildModule-Crz1nHwJ.esm.js";
33
+ import { t as governmentValidationMachine } from "./governmentValidationStateMachine-DkakcwTj.esm.js";
34
+ import "./qe-signature.esm.js";
35
+ import { t as signatureMachine } from "./signatureStateMachine-BmKPC5A9.esm.js";
36
+ import { t as watchlistMachine } from "./watchlistStateMachine-CL2j3aRl.esm.js";
37
+ import { t as watchlistForBusinessMachine } from "./watchlistForBusinessStateMachine-BC_-3fJs.esm.js";
73
38
  //#region src/internal/orchestration/defaultModules.ts
74
39
  /**
75
40
  * Shared default module registry — single source of truth for module key → machine mappings.
@@ -143,7 +108,6 @@ function applyConfigMapper(moduleKey, raw, mappers) {
143
108
  const mapper = moduleKey ? mappers[moduleKey] : void 0;
144
109
  return mapper ? mapper(raw) : raw;
145
110
  }
146
-
147
111
  //#endregion
148
112
  //#region src/modules/workflow/workflowServices.ts
149
113
  function assertWorkflowNode(data, endpoint) {
@@ -188,7 +152,6 @@ async function processCustomNode(data, signal) {
188
152
  toIncodeApiError(endpoints.customModuleExecution, error);
189
153
  }
190
154
  }
191
-
192
155
  //#endregion
193
156
  //#region src/modules/workflow/workflowActors.ts
194
157
  async function loadWorkflow(input, signal) {
@@ -306,7 +269,6 @@ async function resolveModule(input) {
306
269
  if (typeof entry === "function") return entry();
307
270
  return entry;
308
271
  }
309
-
310
272
  //#endregion
311
273
  //#region src/modules/workflow/workflowStateMachine.ts
312
274
  function extractErrorInfo(err) {
@@ -643,7 +605,6 @@ const workflowMachine = setup({
643
605
  error: { type: "final" }
644
606
  }
645
607
  });
646
-
647
608
  //#endregion
648
609
  //#region src/modules/workflow/workflowActor.ts
649
610
  function createWorkflowActor(options) {
@@ -655,7 +616,6 @@ function createWorkflowActor(options) {
655
616
  isDesktop: options.isDesktop
656
617
  } }).start();
657
618
  }
658
-
659
619
  //#endregion
660
620
  //#region src/internal/orchestration/identity-search/identitySearchStateMachine.ts
661
621
  const identitySearchMachine = setup({ types: {
@@ -667,7 +627,6 @@ const identitySearchMachine = setup({ types: {
667
627
  context: {},
668
628
  states: { done: { type: "final" } }
669
629
  });
670
-
671
630
  //#endregion
672
631
  //#region src/modules/workflow/workflowManager.ts
673
632
  const WORKFLOW_DEFAULT_MODULES = {
@@ -752,21 +711,46 @@ function mapState(snapshot) {
752
711
  }
753
712
  function createApi({ actor, getSnapshot, trackElementClicked }) {
754
713
  return {
714
+ /** Start loading the workflow configuration and first node from the backend. */
755
715
  load() {
756
716
  actor.send({ type: "LOAD" });
757
717
  },
718
+ /**
719
+ * Signal that the current module has completed successfully.
720
+ * Call this from your UI component's `onFinish` callback.
721
+ */
758
722
  completeModule() {
759
723
  trackElementClicked?.("completeModule");
760
724
  actor.send({ type: "MODULE_COMPLETE" });
761
725
  },
726
+ /**
727
+ * Skip all remaining nodes and complete the workflow now, notifying the
728
+ * backend (getFinishStatus) on the way to the completion step.
729
+ */
762
730
  completeFlow() {
763
731
  trackElementClicked?.("completeFlow");
764
732
  actor.send({ type: "COMPLETE_FLOW" });
765
733
  },
734
+ /**
735
+ * Finish the workflow because the onboarding was already completed externally —
736
+ * e.g. the REDIRECT_TO_MOBILE handoff finished end-to-end on mobile. Lands
737
+ * on the completion screen WITHOUT calling getFinishStatus: mobile already
738
+ * notified the backend, and the desktop's current node is not FINISH (such a
739
+ * call is rejected 400). Use this (not `completeFlow`) from
740
+ * REDIRECT_TO_MOBILE's `onFinish`.
741
+ */
766
742
  finishWorkflow() {
767
743
  trackElementClicked?.("finishWorkflow");
768
744
  actor.send({ type: "FINISH_WORKFLOW" });
769
745
  },
746
+ /**
747
+ * Signal that the current module encountered a terminal error, optionally
748
+ * with its machine-readable `moduleErrorCode`. The workflow machine decides
749
+ * what to do: an advanceable terminal error (e.g. `NONEXISTENT_CUSTOMER`,
750
+ * `HINT_NOT_PROVIDED`) advances via `processNode`; any other error
751
+ * transitions to the terminal error state. Callers always forward the code
752
+ * and let core classify — no per-module branching in the UI.
753
+ */
770
754
  errorModule(error, moduleErrorCode) {
771
755
  actor.send({
772
756
  type: "MODULE_ERROR",
@@ -774,10 +758,22 @@ function createApi({ actor, getSnapshot, trackElementClicked }) {
774
758
  moduleErrorCode
775
759
  });
776
760
  },
761
+ /**
762
+ * Advance from the launch (home) screen into the first workflow node.
763
+ * No-op when the workflow is not currently waiting on the home screen
764
+ * (e.g. when the backend set `disableLaunchScreen` or the first node is
765
+ * the injected `REDIRECT_TO_MOBILE`).
766
+ */
777
767
  continueFromHome() {
778
768
  trackElementClicked?.("homeContinue");
779
769
  actor.send({ type: "HOME_CONTINUE" });
780
770
  },
771
+ /**
772
+ * Get the current module's configuration, including the `ds` flag from
773
+ * the workflow config. The same module-specific config mapping applied
774
+ * to `state.config` is applied here, so consumers receive a
775
+ * manager-ready shape (e.g. `EkycConfig` for `EXTERNAL_VERIFICATION`).
776
+ */
781
777
  getModuleConfig() {
782
778
  const snapshot = getSnapshot();
783
779
  if (snapshot.value !== "runningModule") return void 0;
@@ -807,6 +803,5 @@ function createWorkflowManager(options = {}) {
807
803
  instrumentation: createManagerInstrumentation(eventModuleNames.workflow)
808
804
  }), { interviewId: options.interviewId });
809
805
  }
810
-
811
806
  //#endregion
812
- export { createWorkflowManager, workflowMachine };
807
+ export { createWorkflowManager, workflowMachine };
@@ -0,0 +1,310 @@
1
+ import { i as XSTATE_STOP } from "./xstate.esm-Cf4e0Cfd.esm.js";
2
+ const instanceStates = /* #__PURE__ */ new WeakMap();
3
+ /**
4
+ * Represents an actor created by `fromCallback`.
5
+ *
6
+ * The type of `self` within the actor's logic.
7
+ *
8
+ * @example
9
+ *
10
+ * ```ts
11
+ * import { fromCallback, createActor } from 'xstate';
12
+ *
13
+ * // The events the actor receives.
14
+ * type Event = { type: 'someEvent' };
15
+ * // The actor's input.
16
+ * type Input = { name: string };
17
+ *
18
+ * // Actor logic that logs whenever it receives an event of type `someEvent`.
19
+ * const logic = fromCallback<Event, Input>(({ self, input, receive }) => {
20
+ * self;
21
+ * // ^? CallbackActorRef<Event, Input>
22
+ *
23
+ * receive((event) => {
24
+ * if (event.type === 'someEvent') {
25
+ * console.log(`${input.name}: received "someEvent" event`);
26
+ * // logs 'myActor: received "someEvent" event'
27
+ * }
28
+ * });
29
+ * });
30
+ *
31
+ * const actor = createActor(logic, { input: { name: 'myActor' } });
32
+ * // ^? CallbackActorRef<Event, Input>
33
+ * ```
34
+ *
35
+ * @see {@link fromCallback}
36
+ */
37
+ /**
38
+ * An actor logic creator which returns callback logic as defined by a callback
39
+ * function.
40
+ *
41
+ * @remarks
42
+ * Useful for subscription-based or other free-form logic that can send events
43
+ * back to the parent actor.
44
+ *
45
+ * Actors created from callback logic (“callback actors”) can:
46
+ *
47
+ * - Receive events via the `receive` function
48
+ * - Send events to the parent actor via the `sendBack` function
49
+ *
50
+ * Callback actors are a bit different from other actors in that they:
51
+ *
52
+ * - Do not work with `onDone`
53
+ * - Do not produce a snapshot using `.getSnapshot()`
54
+ * - Do not emit values when used with `.subscribe()`
55
+ * - Can not be stopped with `.stop()`
56
+ *
57
+ * @example
58
+ *
59
+ * ```typescript
60
+ * const callbackLogic = fromCallback(({ sendBack, receive }) => {
61
+ * let lockStatus = 'unlocked';
62
+ *
63
+ * const handler = (event) => {
64
+ * if (lockStatus === 'locked') {
65
+ * return;
66
+ * }
67
+ * sendBack(event);
68
+ * };
69
+ *
70
+ * receive((event) => {
71
+ * if (event.type === 'lock') {
72
+ * lockStatus = 'locked';
73
+ * } else if (event.type === 'unlock') {
74
+ * lockStatus = 'unlocked';
75
+ * }
76
+ * });
77
+ *
78
+ * document.body.addEventListener('click', handler);
79
+ *
80
+ * return () => {
81
+ * document.body.removeEventListener('click', handler);
82
+ * };
83
+ * });
84
+ * ```
85
+ *
86
+ * @param callback - The callback function used to describe the callback logic
87
+ * The callback function is passed an object with the following properties:
88
+ *
89
+ * - `receive` - A function that can send events back to the parent actor; the
90
+ * listener is then called whenever events are received by the callback
91
+ * actor
92
+ * - `sendBack` - A function that can send events back to the parent actor
93
+ * - `input` - Data that was provided to the callback actor
94
+ * - `self` - The parent actor of the callback actor
95
+ * - `system` - The actor system to which the callback actor belongs The callback
96
+ * function can (optionally) return a cleanup function, which is called
97
+ * when the actor is stopped.
98
+ *
99
+ * @returns Callback logic
100
+ * @see {@link CallbackLogicFunction} for more information about the callback function and its object argument
101
+ * @see {@link https://stately.ai/docs/input | Input docs} for more information about how input is passed
102
+ */
103
+ function fromCallback(callback) {
104
+ return {
105
+ config: callback,
106
+ start: (state, actorScope) => {
107
+ const { self, system, emit } = actorScope;
108
+ const callbackState = {
109
+ receivers: void 0,
110
+ dispose: void 0
111
+ };
112
+ instanceStates.set(self, callbackState);
113
+ callbackState.dispose = callback({
114
+ input: state.input,
115
+ system,
116
+ self,
117
+ sendBack: (event) => {
118
+ if (self.getSnapshot().status === "stopped") return;
119
+ if (self._parent) system._relay(self, self._parent, event);
120
+ },
121
+ receive: (listener) => {
122
+ callbackState.receivers ??= /* @__PURE__ */ new Set();
123
+ callbackState.receivers.add(listener);
124
+ },
125
+ emit
126
+ });
127
+ },
128
+ transition: (state, event, actorScope) => {
129
+ const callbackState = instanceStates.get(actorScope.self);
130
+ if (event.type === "xstate.stop") {
131
+ state = {
132
+ ...state,
133
+ status: "stopped",
134
+ error: void 0
135
+ };
136
+ callbackState.dispose?.();
137
+ return state;
138
+ }
139
+ callbackState.receivers?.forEach((receiver) => receiver(event));
140
+ return state;
141
+ },
142
+ getInitialSnapshot: (_, input) => {
143
+ return {
144
+ status: "active",
145
+ output: void 0,
146
+ error: void 0,
147
+ input
148
+ };
149
+ },
150
+ getPersistedSnapshot: (snapshot) => snapshot,
151
+ restoreSnapshot: (snapshot) => snapshot
152
+ };
153
+ }
154
+ const XSTATE_PROMISE_RESOLVE = "xstate.promise.resolve";
155
+ const XSTATE_PROMISE_REJECT = "xstate.promise.reject";
156
+ /**
157
+ * Represents an actor created by `fromPromise`.
158
+ *
159
+ * The type of `self` within the actor's logic.
160
+ *
161
+ * @example
162
+ *
163
+ * ```ts
164
+ * import { fromPromise, createActor } from 'xstate';
165
+ *
166
+ * // The actor's resolved output
167
+ * type Output = string;
168
+ * // The actor's input.
169
+ * type Input = { message: string };
170
+ *
171
+ * // Actor logic that fetches the url of an image of a cat saying `input.message`.
172
+ * const logic = fromPromise<Output, Input>(async ({ input, self }) => {
173
+ * self;
174
+ * // ^? PromiseActorRef<Output, Input>
175
+ *
176
+ * const data = await fetch(
177
+ * `https://cataas.com/cat/says/${input.message}`
178
+ * );
179
+ * const url = await data.json();
180
+ * return url;
181
+ * });
182
+ *
183
+ * const actor = createActor(logic, { input: { message: 'hello world' } });
184
+ * // ^? PromiseActorRef<Output, Input>
185
+ * ```
186
+ *
187
+ * @see {@link fromPromise}
188
+ */
189
+ const controllerMap = /* @__PURE__ */ new WeakMap();
190
+ /**
191
+ * An actor logic creator which returns promise logic as defined by an async
192
+ * process that resolves or rejects after some time.
193
+ *
194
+ * Actors created from promise actor logic (“promise actors”) can:
195
+ *
196
+ * - Emit the resolved value of the promise
197
+ * - Output the resolved value of the promise
198
+ *
199
+ * Sending events to promise actors will have no effect.
200
+ *
201
+ * @example
202
+ *
203
+ * ```ts
204
+ * const promiseLogic = fromPromise(async () => {
205
+ * const result = await fetch('https://example.com/...').then((data) =>
206
+ * data.json()
207
+ * );
208
+ *
209
+ * return result;
210
+ * });
211
+ *
212
+ * const promiseActor = createActor(promiseLogic);
213
+ * promiseActor.subscribe((snapshot) => {
214
+ * console.log(snapshot);
215
+ * });
216
+ * promiseActor.start();
217
+ * // => {
218
+ * // output: undefined,
219
+ * // status: 'active'
220
+ * // ...
221
+ * // }
222
+ *
223
+ * // After promise resolves
224
+ * // => {
225
+ * // output: { ... },
226
+ * // status: 'done',
227
+ * // ...
228
+ * // }
229
+ * ```
230
+ *
231
+ * @param promiseCreator A function which returns a Promise, and accepts an
232
+ * object with the following properties:
233
+ *
234
+ * - `input` - Data that was provided to the promise actor
235
+ * - `self` - The parent actor of the promise actor
236
+ * - `system` - The actor system to which the promise actor belongs
237
+ *
238
+ * @see {@link https://stately.ai/docs/input | Input docs} for more information about how input is passed
239
+ */
240
+ function fromPromise(promiseCreator) {
241
+ return {
242
+ config: promiseCreator,
243
+ transition: (state, event, scope) => {
244
+ if (state.status !== "active") return state;
245
+ switch (event.type) {
246
+ case XSTATE_PROMISE_RESOLVE: {
247
+ const resolvedValue = event.data;
248
+ return {
249
+ ...state,
250
+ status: "done",
251
+ output: resolvedValue,
252
+ input: void 0
253
+ };
254
+ }
255
+ case XSTATE_PROMISE_REJECT: return {
256
+ ...state,
257
+ status: "error",
258
+ error: event.data,
259
+ input: void 0
260
+ };
261
+ case XSTATE_STOP:
262
+ controllerMap.get(scope.self)?.abort();
263
+ return {
264
+ ...state,
265
+ status: "stopped",
266
+ input: void 0
267
+ };
268
+ default: return state;
269
+ }
270
+ },
271
+ start: (state, { self, system, emit }) => {
272
+ if (state.status !== "active") return;
273
+ const controller = new AbortController();
274
+ controllerMap.set(self, controller);
275
+ Promise.resolve(promiseCreator({
276
+ input: state.input,
277
+ system,
278
+ self,
279
+ signal: controller.signal,
280
+ emit
281
+ })).then((response) => {
282
+ if (self.getSnapshot().status !== "active") return;
283
+ controllerMap.delete(self);
284
+ system._relay(self, self, {
285
+ type: XSTATE_PROMISE_RESOLVE,
286
+ data: response
287
+ });
288
+ }, (errorData) => {
289
+ if (self.getSnapshot().status !== "active") return;
290
+ controllerMap.delete(self);
291
+ system._relay(self, self, {
292
+ type: XSTATE_PROMISE_REJECT,
293
+ data: errorData
294
+ });
295
+ });
296
+ },
297
+ getInitialSnapshot: (_, input) => {
298
+ return {
299
+ status: "active",
300
+ output: void 0,
301
+ error: void 0,
302
+ input
303
+ };
304
+ },
305
+ getPersistedSnapshot: (snapshot) => snapshot,
306
+ restoreSnapshot: (snapshot) => snapshot
307
+ };
308
+ }
309
+ //#endregion
310
+ export { fromPromise as n, fromCallback as t };