@incodetech/core 2.4.1-agentic.10 → 2.4.1-agentic.11

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 (272) hide show
  1. package/dist/Actor-DqjOqDfU.d.ts +1 -0
  2. package/dist/{CameraCompositor-DN7NkJzV.esm.js → CameraCompositor-ppyMYVoY.esm.js} +1 -1
  3. package/dist/{FaceDetectionProvider-BSLpXAGx.esm.js → FaceDetectionProvider-2NzWDbV8.esm.js} +8 -8
  4. package/dist/Manager-BvXAwDv9.esm.js +125 -0
  5. package/dist/{Manager-C9T5amUN.d.ts → Manager-DufwKlav.d.ts} +1 -7
  6. package/dist/{MultipartRecordingProvider-BfQPSgSO.esm.js → MultipartRecordingProvider-CduV32Qa.esm.js} +1 -1
  7. package/dist/{WasmUtilProvider-C_puwvVn.esm.js → WasmUtilProvider-DdhAHHw4.esm.js} +40 -4
  8. package/dist/{WorkerEncoderRecordingProvider-CyCrQnZR.esm.js → WorkerEncoderRecordingProvider-CsDED9UU.esm.js} +1 -1
  9. package/dist/{addressSearch-B_4JYKa-.esm.js → addressSearch-Rxm1K67A.esm.js} +5 -4
  10. package/dist/{advanceableErrors-k-U-cL5m.esm.js → advanceableErrors-CxZyPRyh.esm.js} +3 -0
  11. package/dist/ae-signature.d.ts +2 -2
  12. package/dist/ae-signature.esm.js +1 -1
  13. package/dist/antifraud.d.ts +1 -1
  14. package/dist/antifraud.esm.js +2 -2
  15. package/dist/{antifraudManager-DbGCvlJs.d.ts → antifraudManager-BxfCsyA7.d.ts} +3 -3
  16. package/dist/{antifraudManager-BWCVkSu2.esm.js → antifraudManager-DKNOi9-z.esm.js} +5 -3
  17. package/dist/{antifraudStateMachine-CX9I2f3s.esm.js → antifraudStateMachine-BJ6PmCsw.esm.js} +3 -3
  18. package/dist/{api-BSnbg4HO.esm.js → api-CZpuJuZl.esm.js} +1 -1
  19. package/dist/{apiError-Bmwy1Fa7.esm.js → apiError-BamZ815u.esm.js} +1 -1
  20. package/dist/{attemptCarry-zQH85Elh.esm.js → attemptCarry-BecGGZK8.esm.js} +1 -1
  21. package/dist/authentication.d.ts +3 -3
  22. package/dist/authentication.esm.js +2 -2
  23. package/dist/{authenticationManager-CISxaY6N.d.ts → authenticationManager-DRaugLgH.d.ts} +2 -2
  24. package/dist/{authenticationManager-BoiOaB0m.esm.js → authenticationManager-yBVGiIf_.esm.js} +7 -6
  25. package/dist/{authenticationStateMachine-BMD1JLwr.esm.js → authenticationStateMachine-DPqTOJPp.esm.js} +50 -18
  26. package/dist/{browser-pQZA35G2-PIj2uGBm.esm.js → browser-pQZA35G2-DxIBykpe.esm.js} +1 -1
  27. package/dist/{callback-645_omgz.d.ts → callback-BmjJ1G-5.d.ts} +1 -1
  28. package/dist/camera.esm.js +1 -1
  29. package/dist/certificate-issuance.d.ts +1 -1
  30. package/dist/certificate-issuance.esm.js +2 -2
  31. package/dist/{certificateIssuanceManager-Dr8A4Lgr.d.ts → certificateIssuanceManager-BcYhxO63.d.ts} +4 -3
  32. package/dist/{certificateIssuanceManager-DzDuQTsK.esm.js → certificateIssuanceManager-Dxl9UwR0.esm.js} +5 -3
  33. package/dist/{certificateIssuanceStateMachine-BAOYLACb.esm.js → certificateIssuanceStateMachine-CM4q71h1.esm.js} +3 -3
  34. package/dist/{cnpj-Co1ottYN.esm.js → cnpj-Bl_olpdX.esm.js} +5 -3
  35. package/dist/consent.d.ts +1 -1
  36. package/dist/consent.esm.js +2 -2
  37. package/dist/{consentManager-7aHaehwF.d.ts → consentManager-B2F_VeAo.d.ts} +8 -7
  38. package/dist/{consentManager-DFSKQTcR.esm.js → consentManager-BPocwpm2.esm.js} +5 -3
  39. package/dist/{consentStateMachine-4nZIH2O8.esm.js → consentStateMachine-DgiIcT9q.esm.js} +3 -3
  40. package/dist/{cpf-BIADjddF.esm.js → cpf-DDXMTLYr.esm.js} +1 -1
  41. package/dist/cross-document-data-match.d.ts +1 -1
  42. package/dist/cross-document-data-match.esm.js +1 -1
  43. package/dist/{crossDocumentDataMatchManager-D7ka2qOC.esm.js → crossDocumentDataMatchManager-BfA29Aji.esm.js} +6 -4
  44. package/dist/{crossDocumentDataMatchManager-yCWCOzcU.d.ts → crossDocumentDataMatchManager-crZcIUSY.d.ts} +3 -3
  45. package/dist/curp-DZGvefg3.esm.js +14 -0
  46. package/dist/curp-validation.d.ts +1 -1
  47. package/dist/curp-validation.esm.js +2 -2
  48. package/dist/{curpValidationManager-BVTt7IgC.esm.js → curpValidationManager-CbvBDoE1.esm.js} +6 -4
  49. package/dist/{curpValidationManager-DEqTUWdu.d.ts → curpValidationManager-Ci2iVuog.d.ts} +4 -4
  50. package/dist/{curpValidationStateMachine-FB_MRbZQ.esm.js → curpValidationStateMachine-BQ8XK2Y3.esm.js} +5 -5
  51. package/dist/custom-fields.d.ts +1 -1
  52. package/dist/custom-fields.esm.js +1 -1
  53. package/dist/custom-watchlist.d.ts +1 -1
  54. package/dist/custom-watchlist.esm.js +2 -2
  55. package/dist/{customFieldsManager-gbsq53p6.esm.js → customFieldsManager-BRqSCR9R.esm.js} +6 -4
  56. package/dist/{customFieldsManager-CF-cO8ap.d.ts → customFieldsManager-CdWTbsew.d.ts} +3 -3
  57. package/dist/{customWatchlistManager-50APwk4Z.esm.js → customWatchlistManager-Bd1ooIDB.esm.js} +5 -3
  58. package/dist/{customWatchlistManager-DolUswyR.d.ts → customWatchlistManager-lJrveDS4.d.ts} +3 -3
  59. package/dist/{customWatchlistStateMachine-CpEVPzuT.esm.js → customWatchlistStateMachine-r8nGhyo1.esm.js} +3 -3
  60. package/dist/{deepsightLoader-BKCT8UT1.esm.js → deepsightLoader-CEY2mSPM.esm.js} +5 -5
  61. package/dist/{definitionSource-BHNxbuiv.esm.js → definitionSource-Nw0YCbpe.esm.js} +38 -1
  62. package/dist/{desktopCameraElection-Dvvw7PRY.esm.js → desktopCameraElection-enVPfRsQ.esm.js} +4 -4
  63. package/dist/document-capture.d.ts +1 -1
  64. package/dist/document-capture.esm.js +2 -2
  65. package/dist/{documentCaptureManager-DDfviFg0.d.ts → documentCaptureManager-BZBmcOKI.d.ts} +5 -4
  66. package/dist/{documentCaptureManager-BG5TuqJz.esm.js → documentCaptureManager-C11k5BO-.esm.js} +5 -3
  67. package/dist/{documentCaptureStateMachine-C7PW_Ah9.esm.js → documentCaptureStateMachine-g0gfL0_1.esm.js} +6 -6
  68. package/dist/dynamic-forms.d.ts +1 -1
  69. package/dist/dynamic-forms.esm.js +2 -2
  70. package/dist/{dynamicFormsManager-B0bpHhhJ.esm.js → dynamicFormsManager-BmfCZ2zV.esm.js} +5 -3
  71. package/dist/{dynamicFormsManager-9kwY8Bf5.d.ts → dynamicFormsManager-C45pTncO.d.ts} +3 -3
  72. package/dist/{dynamicFormsStateMachine-2ZHyejBc.esm.js → dynamicFormsStateMachine-B-eYytau.esm.js} +4 -4
  73. package/dist/ekyb.d.ts +3 -3
  74. package/dist/ekyb.esm.js +2 -2
  75. package/dist/{ekybManager-P9mC7W9J.esm.js → ekybManager-BPaMfbgw.esm.js} +5 -3
  76. package/dist/{ekybManager-BLOkwmWO.d.ts → ekybManager-BflWuTe4.d.ts} +3 -3
  77. package/dist/{ekybStateMachine-C7HKaeVr.esm.js → ekybStateMachine-C_lEw4I7.esm.js} +18 -20
  78. package/dist/ekyc-prefill.d.ts +1 -1
  79. package/dist/ekyc-prefill.esm.js +2 -2
  80. package/dist/ekyc.d.ts +2 -2
  81. package/dist/ekyc.esm.js +3 -3
  82. package/dist/{ekycManager-q1fos6IY.d.ts → ekycManager-BKVQazAb.d.ts} +47 -6
  83. package/dist/{ekycManager-CeeJoRFY.esm.js → ekycManager-nRT0rxei.esm.js} +39 -16
  84. package/dist/{ekycPrefillManager-C6BFFKxc.esm.js → ekycPrefillManager-CCtbmrFd.esm.js} +3 -2
  85. package/dist/{ekycPrefillManager-PPGVZbWk.d.ts → ekycPrefillManager-DOTl3Y2w.d.ts} +8 -7
  86. package/dist/{ekycPrefillStateMachine-Dku90kZL.esm.js → ekycPrefillStateMachine-XpxgCAoC.esm.js} +11 -10
  87. package/dist/{ekycRules-BLX7Elcb.esm.js → ekycRules-DXP2hqVw.esm.js} +198 -38
  88. package/dist/{ekycStateMachine-DBTczgGE.esm.js → ekycStateMachine-nwJRel2s.esm.js} +333 -64
  89. package/dist/{ekycUtils-Dcff8BOD.esm.js → ekycUtils-FcqA6oU4.esm.js} +44 -43
  90. package/dist/electronic-signature.d.ts +1 -1
  91. package/dist/electronic-signature.esm.js +1 -1
  92. package/dist/{electronicSignatureManager-DTSLOvKR.d.ts → electronicSignatureManager-5tYz-a4o.d.ts} +4 -3
  93. package/dist/{electronicSignatureManager-BKQuhJm_.esm.js → electronicSignatureManager-M2O2VDks.esm.js} +7 -5
  94. package/dist/email.d.ts +1 -1
  95. package/dist/email.esm.js +2 -2
  96. package/dist/{emailManager-CGmKbsBL.esm.js → emailManager-Co4jarT1.esm.js} +5 -3
  97. package/dist/{emailManager-Dy6omJVp.d.ts → emailManager-pM7ZPuMa.d.ts} +3 -3
  98. package/dist/{emailStateMachine-CGY1UGs2.esm.js → emailStateMachine-CTEaYncs.esm.js} +4 -4
  99. package/dist/events-CP3yOzAl.esm.js +299 -0
  100. package/dist/events.d.ts +3 -1
  101. package/dist/events.esm.js +2 -1
  102. package/dist/extensibility.d.ts +39 -39
  103. package/dist/extensibility.esm.js +38 -38
  104. package/dist/face-match.d.ts +1 -1
  105. package/dist/face-match.esm.js +2 -2
  106. package/dist/{faceCaptureManagerFactory-ClFsByZc.esm.js → faceCaptureManagerFactory-3Or5qfbA.esm.js} +17 -6
  107. package/dist/{faceCaptureManagerFactory-BVwVGa3z.d.ts → faceCaptureManagerFactory-CRGajjZ4.d.ts} +14 -7
  108. package/dist/{faceCaptureSetup-9hv5GC_H.esm.js → faceCaptureSetup-Cf87i0rT.esm.js} +46 -38
  109. package/dist/{faceMatchManager-BZtEw6bB.d.ts → faceMatchManager-C5b5WtcY.d.ts} +3 -2
  110. package/dist/{faceMatchManager-CRe7Nvm6.esm.js → faceMatchManager-CGmNGbov.esm.js} +5 -3
  111. package/dist/{faceMatchStateMachine-EX9QhxFE.esm.js → faceMatchStateMachine-BuHt7kec.esm.js} +18 -6
  112. package/dist/{feature-management-CmKTG_T5.esm.js → feature-management-DG016L6E.esm.js} +1 -1
  113. package/dist/feature-management.esm.js +1 -1
  114. package/dist/field-comparison.d.ts +1 -1
  115. package/dist/field-comparison.esm.js +1 -1
  116. package/dist/{fieldComparisonManager-DuosZJso.esm.js → fieldComparisonManager-VgCU4X96.esm.js} +6 -4
  117. package/dist/{fieldComparisonManager-CUX4gza2.d.ts → fieldComparisonManager-mFOHRhVd.d.ts} +3 -3
  118. package/dist/fiscal-qr.d.ts +1 -1
  119. package/dist/fiscal-qr.esm.js +1 -1
  120. package/dist/{fiscalQrManager-D0Iy7EKR.d.ts → fiscalQrManager-DFnFVpP9.d.ts} +3 -3
  121. package/dist/{fiscalQrManager-ji0qDaTW.esm.js → fiscalQrManager-DOLq45ph.esm.js} +6 -4
  122. package/dist/flow-events.d.ts +1 -1
  123. package/dist/flow.d.ts +47 -11
  124. package/dist/flow.esm.js +214 -58
  125. package/dist/{flowCompletionService-DvcH16XO.esm.js → flowCompletionService-BpeAbbXc.esm.js} +2 -2
  126. package/dist/{flowServices-Ca2vKNt2.esm.js → flowServices-rDg1bAMs.esm.js} +373 -12
  127. package/dist/geolocation.d.ts +1 -1
  128. package/dist/geolocation.esm.js +2 -2
  129. package/dist/{geolocationManager-6e1i9UIR.d.ts → geolocationManager-CENrvxpK.d.ts} +4 -3
  130. package/dist/{geolocationManager-CiG32lIm.esm.js → geolocationManager-T8m4lqvF.esm.js} +5 -3
  131. package/dist/{geolocationStateMachine-5rnTEOuw.esm.js → geolocationStateMachine-NWmA1Dtn.esm.js} +5 -5
  132. package/dist/government-validation.d.ts +1 -1
  133. package/dist/government-validation.esm.js +2 -2
  134. package/dist/{governmentValidationManager-BivVZNVe.esm.js → governmentValidationManager-6JQQkzha.esm.js} +5 -3
  135. package/dist/{governmentValidationManager-B82zOut8.d.ts → governmentValidationManager-De_vU7bm.d.ts} +4 -4
  136. package/dist/{governmentValidationStateMachine-CeSDNgha.esm.js → governmentValidationStateMachine-wBunpfQ9.esm.js} +3 -3
  137. package/dist/home.d.ts +4 -3
  138. package/dist/home.esm.js +4 -2
  139. package/dist/http.esm.js +1 -1
  140. package/dist/id-ocr.d.ts +1 -1
  141. package/dist/id-ocr.esm.js +3 -3
  142. package/dist/id-selfie-flow.d.ts +4 -3
  143. package/dist/id-selfie-flow.esm.js +12 -11
  144. package/dist/id-verification.d.ts +1 -1
  145. package/dist/id-verification.esm.js +2 -2
  146. package/dist/id.d.ts +2 -2
  147. package/dist/id.esm.js +3 -3
  148. package/dist/{idCaptureDefaults-DBnOC28H.esm.js → idCaptureDefaults-Cjesf5i9.esm.js} +1 -1
  149. package/dist/{idCaptureManager-B5xqok0L.esm.js → idCaptureManager-5-ReVgbB.esm.js} +12 -10
  150. package/dist/{idCaptureManager-CG8zbAp0.d.ts → idCaptureManager-Cqx2y_fC.d.ts} +7 -6
  151. package/dist/{idCaptureServices-BIF_7rub.esm.js → idCaptureServices-exB6I9lV.esm.js} +7 -7
  152. package/dist/{idCaptureStateMachine-B5cfgKvn.esm.js → idCaptureStateMachine-DQ14d3GR.esm.js} +21 -19
  153. package/dist/{idOcrCpfUtils-Nfln1Psb.esm.js → idOcrCpfUtils-D5Gwskxu.esm.js} +1 -1
  154. package/dist/{idOcrManager-B5xeI2lg.d.ts → idOcrManager-C0C7lFGd.d.ts} +4 -3
  155. package/dist/{idOcrManager-DNbVTMIu.esm.js → idOcrManager-im7VfJQi.esm.js} +5 -3
  156. package/dist/{idOcrStateMachine-MAGnpWkb.esm.js → idOcrStateMachine-B832arAl.esm.js} +4 -4
  157. package/dist/{idVerificationManager-BJapZfpy.d.ts → idVerificationManager-B6R8xNZq.d.ts} +4 -3
  158. package/dist/{idVerificationManager-BEAkamNm.esm.js → idVerificationManager-PMGM4hXY.esm.js} +5 -3
  159. package/dist/{idVerificationStateMachine-D5mBN2Ye.esm.js → idVerificationStateMachine-DeeugC00.esm.js} +3 -3
  160. package/dist/identity-reuse.d.ts +2 -2
  161. package/dist/identity-reuse.esm.js +2 -2
  162. package/dist/identity-search.d.ts +97 -0
  163. package/dist/identity-search.esm.js +97 -0
  164. package/dist/{identityReuseManager-ooAbp6Kc.d.ts → identityReuseManager-CZ-qJ_Aa.d.ts} +82 -15
  165. package/dist/{identityReuseManager-M8-BTjar.esm.js → identityReuseManager-CjFZ7WRa.esm.js} +9 -4
  166. package/dist/{identityReuseStateMachine-D5bXgw9h.esm.js → identityReuseStateMachine-CLFjPp13.esm.js} +22 -25
  167. package/dist/index-DHuAkTe0.d.ts +1 -0
  168. package/dist/{index-Btj1EhiM.d.ts → index-DM43R87x.d.ts} +1 -1
  169. package/dist/{index-CSPOoqah.d.ts → index-DxYNO94y.d.ts} +2 -2
  170. package/dist/index.d.ts +1 -1
  171. package/dist/index.esm.js +1 -1
  172. package/dist/{invokeOnCaptureCallback-C1-j4fsq.esm.js → invokeOnCaptureCallback-lXP41N7b.esm.js} +1 -1
  173. package/dist/kyb-checks.d.ts +1 -1
  174. package/dist/kyb-checks.esm.js +2 -2
  175. package/dist/{kybChecksManager-CblEL97E.d.ts → kybChecksManager-B7Di9auB.d.ts} +3 -3
  176. package/dist/{kybChecksManager-CnqwgKoV.esm.js → kybChecksManager-CZfdCkLC.esm.js} +3 -2
  177. package/dist/{kybChecksStateMachine-Be41K_NS.esm.js → kybChecksStateMachine-DkWxSU4L.esm.js} +8 -7
  178. package/dist/mandatory-consent.d.ts +2 -2
  179. package/dist/mandatory-consent.esm.js +2 -2
  180. package/dist/{mandatoryConsentManager-CYOJd_IZ.d.ts → mandatoryConsentManager-Bh1asNJh.d.ts} +9 -8
  181. package/dist/{mandatoryConsentManager-LFhUlLvO.esm.js → mandatoryConsentManager-Dh3pBhOe.esm.js} +5 -3
  182. package/dist/{mandatoryConsentStateMachine-DTSyDqQs.esm.js → mandatoryConsentStateMachine-BjuI72HZ.esm.js} +3 -3
  183. package/dist/{mediaRecorderOptions-B9-IEVtV.esm.js → mediaRecorderOptions-g1TwTlhd.esm.js} +20 -3
  184. package/dist/{multipartRecordingService-CCiRpByl.esm.js → multipartRecordingService-WgK8ieRI.esm.js} +2 -2
  185. package/dist/{permissionGuards-DjQUR1du.esm.js → permissionGuards-D-4_VU7-.esm.js} +1 -1
  186. package/dist/{permissionServices-CZpORUWY.esm.js → permissionServices-DpccEnzE.esm.js} +1 -1
  187. package/dist/phone.d.ts +1 -1
  188. package/dist/phone.esm.js +2 -2
  189. package/dist/phoneFormat-C3q0Ukh4.esm.js +27 -0
  190. package/dist/{phoneManager-6nrJkvkG.d.ts → phoneManager-VO1HEoUZ.d.ts} +3 -3
  191. package/dist/{phoneManager-C-qD3p3N.esm.js → phoneManager-rA7updqF.esm.js} +5 -3
  192. package/dist/{phoneServices-BdR1nmSO.esm.js → phoneServices-CFXcwCFr.esm.js} +1 -1
  193. package/dist/{phoneStateMachine-2FMTdjtJ.esm.js → phoneStateMachine-DKdY2Scx.esm.js} +4 -4
  194. package/dist/{processFaceMatch-B1YnoBer.esm.js → processFaceMatch-B_DkDTE5.esm.js} +1 -1
  195. package/dist/qe-signature.d.ts +2 -2
  196. package/dist/qe-signature.esm.js +1 -1
  197. package/dist/{recordingService-BVSCo0ac.esm.js → recordingService-DxiwS8TV.esm.js} +5 -5
  198. package/dist/redirect-to-mobile.d.ts +1 -1
  199. package/dist/redirect-to-mobile.esm.js +2 -2
  200. package/dist/{redirectToMobileManager-CqyDfDxs.esm.js → redirectToMobileManager-DTB_pWuS.esm.js} +6 -4
  201. package/dist/{redirectToMobileManager-Dm9ctRCC.d.ts → redirectToMobileManager-pT6FiPE7.d.ts} +3 -3
  202. package/dist/{redirectToMobileStateMachine-CXqfo2Gd.esm.js → redirectToMobileStateMachine-nP9DM01_.esm.js} +3 -3
  203. package/dist/{resolveForm-f9PhUo9j.esm.js → resolveForm-DaaQSVWp.esm.js} +7 -4
  204. package/dist/{runChildModule-BmteMhR7.esm.js → runChildModule-CXLcOcXN.esm.js} +8 -6
  205. package/dist/{sdkVersion-KZROt6l3.esm.js → sdkVersion-fqxsdqFZ.esm.js} +1 -1
  206. package/dist/selfie.d.ts +3 -3
  207. package/dist/selfie.esm.js +13 -12
  208. package/dist/{selfieErrorUtils-fqxp645p.esm.js → selfieErrorUtils-MOfYdGPz.esm.js} +1 -1
  209. package/dist/{selfieManager-DREuBhXZ.d.ts → selfieManager-DihwheJ6.d.ts} +2 -2
  210. package/dist/{selfieManager-A-n3k9Tu.esm.js → selfieManager-Dq8tIqGd.esm.js} +7 -6
  211. package/dist/{selfieStateMachine-48PKdKrw.esm.js → selfieStateMachine-BZVDQB8R.esm.js} +5 -5
  212. package/dist/{session-D0DWDKp9.esm.js → session-C7x_iJ-p.esm.js} +4 -4
  213. package/dist/session.d.ts +1 -1
  214. package/dist/session.esm.js +5 -5
  215. package/dist/{sessionInitializer-I92b2dmL.esm.js → sessionInitializer-k-hKIBg8.esm.js} +9 -8
  216. package/dist/{setup-BpjzWqR1.esm.js → setup-BRbhjHiU.esm.js} +10 -9
  217. package/dist/{setup-CG6oLkAa.d.ts → setup-CpXbdA1X.d.ts} +1 -1
  218. package/dist/signature.d.ts +1 -1
  219. package/dist/signature.esm.js +2 -2
  220. package/dist/{signatureManager-M9vQBj19.esm.js → signatureManager-BgAja97K.esm.js} +5 -3
  221. package/dist/{signatureManager-BpVt_Jv7.d.ts → signatureManager-daT_8fj_.d.ts} +3 -3
  222. package/dist/{signatureStateMachine-0_frzAN5.esm.js → signatureStateMachine-CVPmvU2p.esm.js} +3 -3
  223. package/dist/{spawn-D9jgw9pW.d.ts → spawn-COZKetCS.d.ts} +1 -1
  224. package/dist/{stats-C2sigf9p.esm.js → stats-DoByUnTa.esm.js} +1 -1
  225. package/dist/stats.esm.js +1 -1
  226. package/dist/step-up.d.ts +3 -2
  227. package/dist/step-up.esm.js +2 -1
  228. package/dist/{tri-DaUNvo-o.esm.js → tri-CI2exudk.esm.js} +2 -2
  229. package/dist/tri.d.ts +1 -1
  230. package/dist/tri.esm-CxLWmTZk.esm.js +2287 -0
  231. package/dist/tri.esm.js +1 -1
  232. package/dist/{trueSightService-DHYTBCIn.esm.js → trueSightService-DhW2O8mB.esm.js} +6 -3
  233. package/dist/trust-graph.d.ts +4 -3
  234. package/dist/trust-graph.esm.js +5 -3
  235. package/dist/{types-CgihAhT_.d.ts → types-9wlf1-GE.d.ts} +1 -1
  236. package/dist/{types-BQA7lRDV.d.ts → types-C3rfDzgE.d.ts} +4 -2
  237. package/dist/types-CE1jkHw3.d.ts +6 -0
  238. package/dist/{types-BqlZSoZ-.d.ts → types-Cpdum4vi.d.ts} +1 -1
  239. package/dist/{types-Cbm9J2yF.d.ts → types-DFP7eSle.d.ts} +1 -1
  240. package/dist/{types-P9LzsfRo.d.ts → types-DJPU3W2M.d.ts} +1 -1
  241. package/dist/{events-C7h7oaTE.esm.js → types-DYYMdAGv.esm.js} +3 -298
  242. package/dist/{types-TisHEbBg.d.ts → types-Ddc4Tr_f.d.ts} +28 -1
  243. package/dist/video-selfie.d.ts +5 -4
  244. package/dist/video-selfie.esm.js +14 -13
  245. package/dist/{videoSelfieCameraWarmer-CTOpqhov.esm.js → videoSelfieCameraWarmer-YwO_uP-b.esm.js} +6 -6
  246. package/dist/{videoSelfieFlowModuleMachine-BCFVHBQ1.esm.js → videoSelfieFlowModuleMachine-IWdxw1TW.esm.js} +1 -1
  247. package/dist/{videoSelfieStepDetector-4XE2QI5q.d.ts → videoSelfieStepDetector-DRrh4P0A.d.ts} +2 -2
  248. package/dist/wasm.d.ts +1 -1
  249. package/dist/wasm.esm.js +1 -1
  250. package/dist/{wasmDsFlagSync-lRIgn5Ic.esm.js → wasmDsFlagSync-D_6e8W62.esm.js} +1 -1
  251. package/dist/watchlist-for-business.d.ts +1 -1
  252. package/dist/watchlist-for-business.esm.js +2 -2
  253. package/dist/watchlist.d.ts +1 -1
  254. package/dist/watchlist.esm.js +2 -2
  255. package/dist/{watchlistForBusinessManager-C1S5y5yj.esm.js → watchlistForBusinessManager-BH6M4kqA.esm.js} +5 -3
  256. package/dist/{watchlistForBusinessManager-DX2AyM4Y.d.ts → watchlistForBusinessManager-l7ZERQcV.d.ts} +3 -3
  257. package/dist/{watchlistForBusinessStateMachine-Bj_hnoK5.esm.js → watchlistForBusinessStateMachine-BMWm5mcP.esm.js} +4 -4
  258. package/dist/{watchlistManager-BpegtZbc.esm.js → watchlistManager-BDaVjzLW.esm.js} +5 -3
  259. package/dist/{watchlistManager-DJQOd8Pw.d.ts → watchlistManager-DQq4GxBO.d.ts} +3 -3
  260. package/dist/{watchlistStateMachine-Bgkh1gra.esm.js → watchlistStateMachine-Cx-6QAvu.esm.js} +3 -3
  261. package/dist/workflow.d.ts +6 -5
  262. package/dist/workflow.esm.js +51 -43
  263. package/dist/{xstate-actors.esm-8Gzepa_A.esm.js → xstate-actors.esm-BCcwgosu.esm.js} +1 -1
  264. package/dist/xstate.cjs-D6Ur0X1F.d.ts +7 -0
  265. package/dist/{xstate.esm-DSajW7CJ.esm.js → xstate.esm-CIqUf_i6.esm.js} +1 -125
  266. package/package.json +6 -1
  267. package/dist/Actor-DpTj5PFb.d.ts +0 -1
  268. package/dist/index-DpTj5PFb.d.ts +0 -1
  269. package/dist/nationalIds-B91f_RuB.esm.js +0 -99
  270. package/dist/phoneFormat-DEpESpz2.esm.js +0 -87
  271. package/dist/tri.esm-Df5eKLsY.esm.js +0 -2165
  272. package/dist/types-kLsU6Jkt.d.ts +0 -6
@@ -1,2165 +0,0 @@
1
- const e = class t {
2
- constructor() {
3
- this.t = !1;
4
- }
5
- static get instance() {
6
- return t.i || (t.i = new t()), t.i;
7
- }
8
- get DEBUG() {
9
- return this.t;
10
- }
11
- set DEBUG(t) {
12
- this.t = t;
13
- }
14
- warn(t, e, ...n) {
15
- this.t && this.o("warn", t, e, ...n);
16
- }
17
- error(t, e, ...n) {
18
- this.t && this.o("error", t, e, ...n);
19
- }
20
- info(t, e, ...n) {
21
- this.t && this.o("info", t, e, ...n);
22
- }
23
- fatal(t, e, n, ...i) {
24
- this.o(t, e, n, ...i);
25
- }
26
- o(t, e, n, ...i) {
27
- const r = e ? `[${e}]` : "", s = console?.[t];
28
- s && s(`[IncodeTRI]${r} ${n}`, ...i);
29
- }
30
- }.instance;
31
- const i = {
32
- "fpSignalsLib.js": "1f626062235d1ff29a29b7bb884cd10ef94e8e02b9f23437bcea950632cfa5ea",
33
- "fpSignalsLib.wasm": "e4c4a6b85995f38df0b11b459a670786e2786cc4e7e41535aa6977d81eb9fad7",
34
- "fpSignalsLibSimd.js": "4b7ae308c1354368e9e48a719923806b70d1ed2c97dd05a6214f991039099c0e",
35
- "fpSignalsLibSimd.wasm": "0d93b31577808d232ed2494825c09c071d0b5f0278c8070c3fc9dfe91af025f7"
36
- };
37
- var r = class extends Error {
38
- constructor(t, e) {
39
- super(e), this.name = "FpSignalsLoadError", this.reason = t;
40
- }
41
- };
42
- async function s(t) {
43
- const e = new URL(t).pathname.split("/").pop() ?? "", n = i[e];
44
- if (!n) throw new r("integrity-mismatch", `fpSignals: no digest for ${e}`);
45
- const s = globalThis.crypto?.subtle;
46
- if (!s) throw new r("no-crypto-subtle", "fpSignals: crypto.subtle is unavailable, so the files cannot be verified. Serve the page over HTTPS.");
47
- const o = await async function(t, e) {
48
- try {
49
- const e = await fetch(t);
50
- if (!e.ok) throw new Error(`HTTP ${e.status}`);
51
- return new Uint8Array(await e.arrayBuffer());
52
- } catch (t) {
53
- throw new r("network-or-csp", `fpSignals: ${e} could not be fetched: ${String(t)}`);
54
- }
55
- }(t, e);
56
- if (function(t) {
57
- let e = "";
58
- for (const n of new Uint8Array(t)) e += n.toString(16).padStart(2, "0");
59
- return e;
60
- }(await s.digest("SHA-256", o)) !== n) throw new r("integrity-mismatch", `fpSignals: ${e} does not match the pinned build`);
61
- return o;
62
- }
63
- var o;
64
- async function a(t) {
65
- const e = t.replace(/\.wasm($|\?)/, ".js$1"), n = await async function(t) {
66
- const e = await s(t), n = URL.createObjectURL(new Blob([e], { type: "text/javascript" }));
67
- try {
68
- return await import(
69
- /* @vite-ignore */
70
- /* webpackIgnore: true */
71
- n
72
- );
73
- } catch (t) {
74
- throw new r("network-or-csp", `fpSignals: the verified glue could not be imported: ${String(t)}`);
75
- } finally {
76
- URL.revokeObjectURL(n);
77
- }
78
- }(e), i = n.Module ?? n.default;
79
- if (!i) throw new Error(`Failed to import Module from ${e}`);
80
- const o = await s(t), a = window.wasmArrayBuffer;
81
- window.wasmArrayBuffer = o;
82
- try {
83
- return await i({ wasmBinary: o });
84
- } finally {
85
- window.wasmArrayBuffer = a;
86
- }
87
- }
88
- (function(t) {
89
- t[t.Device = 1] = "Device", t[t.Behaviour = 2] = "Behaviour", t[t.PID = 3] = "PID";
90
- })(o || (o = {}));
91
- var c = class {
92
- constructor() {
93
- this.wasmModule = null, this.signalsApi = null, this.usedSimd_ = !1;
94
- }
95
- async initialize(t, n, i = !0) {
96
- if (this.signalsApi) return;
97
- const r = i && !!n;
98
- try {
99
- this.wasmModule = await a(r ? n : t), this.usedSimd_ = r;
100
- } catch (n) {
101
- if (!r) throw n;
102
- e.warn("FpSignals", "SIMD init error:", n), this.wasmModule = await a(t), this.usedSimd_ = !1;
103
- }
104
- this.signalsApi = new this.wasmModule.FpSignals();
105
- }
106
- get usedSimd() {
107
- return this.usedSimd_;
108
- }
109
- isReady() {
110
- return null !== this.signalsApi;
111
- }
112
- setHostInfo(t, e) {
113
- this.api().shi(t, e);
114
- }
115
- async collect() {
116
- const t = this.api();
117
- for (; !t.ppf();) await new Promise((t) => setTimeout(t, 0));
118
- }
119
- setBehaviourCollectionEnabled(t) {
120
- this.api().sbc(t);
121
- }
122
- getSignals(t) {
123
- return this.api().gsd(t);
124
- }
125
- hasMethod(t) {
126
- return "function" == typeof this.signalsApi?.[t];
127
- }
128
- getSignalsWithReason(t, e) {
129
- const n = this.api();
130
- return "function" == typeof n.gsr ? n.gsr(t, e) : n.gsd(t);
131
- }
132
- getBufferFill() {
133
- const t = this.api();
134
- if ("function" != typeof t.gbf) return null;
135
- const e = t.gbf();
136
- return "number" == typeof e && Number.isFinite(e) ? e : null;
137
- }
138
- setNextSequence(t) {
139
- const e = this.api();
140
- return "function" == typeof e.ssq && (e.ssq(t), !0);
141
- }
142
- setTabId(t) {
143
- const e = this.api();
144
- return "function" == typeof e.sti && (e.sti(t), !0);
145
- }
146
- setCapturePolicy(t) {
147
- const e = this.api();
148
- return "function" == typeof e.scp && (e.scp(JSON.stringify(t)), !0);
149
- }
150
- setUrlSanitizer(t) {
151
- const e = this.api();
152
- return "function" == typeof e.sus && (e.sus(t), !0);
153
- }
154
- addCustomEvent(t, e) {
155
- const n = this.api();
156
- return "function" == typeof n.ace && (n.ace(t, e), !0);
157
- }
158
- freeResources() {
159
- this.signalsApi && (this.signalsApi.delete(), this.signalsApi = null), this.wasmModule = null;
160
- }
161
- api() {
162
- if (!this.signalsApi) throw new Error("FpSignals has not been initialized");
163
- return this.signalsApi;
164
- }
165
- };
166
- function l(t, e) {
167
- return !t || (t[e]?.enabled ?? !1);
168
- }
169
- function u(t, e, n) {
170
- let i = t, r = e;
171
- if ("devicepixelratiochange" === e) {
172
- const t = window.devicePixelRatio;
173
- i = window.matchMedia(`(resolution: ${t}dppx)`), r = "change";
174
- }
175
- i.addEventListener(r, n, {
176
- capture: !0,
177
- passive: !0
178
- });
179
- }
180
- function h(t, e, n) {
181
- let i = t, r = e;
182
- if ("devicepixelratiochange" === e) {
183
- const t = window.devicePixelRatio;
184
- i = window.matchMedia(`(resolution: ${t}dppx)`), r = "change";
185
- }
186
- i.removeEventListener(r, n, { capture: !0 });
187
- }
188
- const f = globalThis.setTimeout.bind(globalThis);
189
- const d = globalThis.clearTimeout.bind(globalThis);
190
- function p(t, n) {
191
- try {
192
- return t();
193
- } catch (t) {
194
- e.warn("utils", "safeSync swallowed error:", t);
195
- }
196
- }
197
- async function y(t) {
198
- try {
199
- return await t();
200
- } catch (t) {
201
- e.warn("utils", "safeAsync swallowed error:", t);
202
- }
203
- }
204
- function v(t) {
205
- return (e) => p(() => t(e));
206
- }
207
- function w(t) {
208
- return (...n) => {
209
- try {
210
- t(...n);
211
- } catch (t) {
212
- e.warn("utils", "safeTimer swallowed error:", t);
213
- }
214
- };
215
- }
216
- function g(t, e) {
217
- return f(w(t), e);
218
- }
219
- function m(t) {
220
- if (null !== t) try {
221
- d(t);
222
- } catch (t) {
223
- e.warn("utils", "safeClearTimeout swallowed error:", t);
224
- }
225
- }
226
- const b = {
227
- pointer: { events: {
228
- pointer: ["pointerButtons"],
229
- click: ["clicks"],
230
- dblclick: ["dblclicks"],
231
- contextmenu: ["contextmenus"]
232
- } },
233
- pointermove: { all: ["pointerMoves"] },
234
- hover: { all: ["hover"] },
235
- focus: { all: ["focus"] },
236
- input: { all: ["input"] },
237
- keystroke: { all: ["keys"] },
238
- clipboard: { events: {
239
- paste: ["paste"],
240
- cut: ["cut"],
241
- copy: ["copy"]
242
- } },
243
- form: { events: {
244
- submit: ["submit"],
245
- invalid: ["invalid"],
246
- snapshot: ["snapshots"]
247
- } },
248
- change: { all: ["change"] },
249
- selection: { all: ["selection"] },
250
- scroll: { all: ["scroll"] },
251
- wheel: { all: ["wheel"] },
252
- viewportresize: { all: ["resize"] },
253
- viewport: { events: {
254
- orientationchange: ["screenOrientation"],
255
- devicepixelratiochange: ["devicePixelRatio"]
256
- } },
257
- sensors: { events: {
258
- motion: ["deviceMotion"],
259
- orientation: ["deviceOrientation"],
260
- light: ["ambientLight"]
261
- } },
262
- visibility: { all: ["visibility"] },
263
- screen: { all: ["screenChanges"] },
264
- networkconnection: { all: ["online"] }
265
- };
266
- const k = ["pointerButtons", "pointerMoves"];
267
- function S(t, e) {
268
- return !0 === t[e]?.enabled;
269
- }
270
- function T(t, e, n) {
271
- const i = t[e];
272
- if (!i || !i.enabled) return !1;
273
- return ("events" in i ? i.events : void 0)?.[n]?.enabled ?? !0;
274
- }
275
- function _(t) {
276
- const e = [];
277
- for (const n of Object.keys(b)) {
278
- const i = b[n];
279
- if ("all" in i) S(t, n) || e.push(...i.all);
280
- else for (const r of Object.keys(i.events)) T(t, n, r) || e.push(...i.events[r]);
281
- }
282
- let n = !0;
283
- for (const t of k) e.includes(t) || (n = !1);
284
- return n && e.push("touch"), e;
285
- }
286
- let I = null;
287
- const E = /* @__PURE__ */ new Set([
288
- "xmlhttprequest",
289
- "fetch",
290
- "beacon",
291
- "navigation",
292
- "script",
293
- "link",
294
- "css",
295
- "img",
296
- "iframe",
297
- "video",
298
- "audio"
299
- ]);
300
- const A = /* @__PURE__ */ new Set([
301
- "xmlhttprequest",
302
- "fetch",
303
- "beacon"
304
- ]);
305
- function C(t, e) {
306
- return e ? t : null;
307
- }
308
- function R(t, e) {
309
- const n = t.responseStart > 0, i = n ? t.transferSize : null, r = n ? t.encodedBodySize : null, s = n ? t.decodedBodySize : null, o = n && t.nextHopProtocol || null, a = n && void 0 !== t.deliveryType ? t.deliveryType : null, c = t.responseStatus, l = void 0 !== c && 0 !== c ? c : null, u = {
310
- name: "network_request",
311
- timestamp: Date.now(),
312
- performanceTime: t.startTime + t.duration,
313
- url: e(t.name),
314
- initiatorType: (h = t.initiatorType, E.has(h) ? h : "other"),
315
- startTime: t.startTime,
316
- durationMs: t.duration,
317
- fetchStart: t.fetchStart,
318
- domainLookupStart: C(t.domainLookupStart, n),
319
- domainLookupEnd: C(t.domainLookupEnd, n),
320
- connectStart: C(t.connectStart, n),
321
- connectEnd: C(t.connectEnd, n),
322
- secureConnectionStart: C(t.secureConnectionStart, n),
323
- requestStart: C(t.requestStart, n),
324
- responseStart: C(t.responseStart, n),
325
- responseEnd: t.responseEnd,
326
- transferSize: i,
327
- encodedBodySize: r,
328
- decodedBodySize: s,
329
- nextHopProtocol: o,
330
- deliveryType: a,
331
- responseStatus: l
332
- };
333
- var h;
334
- return Object.assign(u, function(t, e) {
335
- return {
336
- dnsLookupMs: C(t.domainLookupEnd - t.domainLookupStart, e),
337
- tcpConnectMs: C(t.connectEnd - t.connectStart, e),
338
- tlsHandshakeMs: C(t.connectEnd > 0 && t.secureConnectionStart > 0 ? t.connectEnd - t.secureConnectionStart : 0, e),
339
- ttfbMs: C(t.responseStart - t.requestStart, e),
340
- responseDownloadMs: C(t.responseEnd - t.responseStart, e)
341
- };
342
- }(t, n)), u;
343
- }
344
- function M() {}
345
- function $(t, e, n, i, r) {
346
- return {
347
- name: "navigation",
348
- timestamp: Date.now(),
349
- ts: performance.now(),
350
- phase: t,
351
- type: e,
352
- from: n.from,
353
- to: n.to,
354
- timeOrigin: i,
355
- timing: r
356
- };
357
- }
358
- function P(t, e) {
359
- if (t.firstElementChild) return t.firstElementChild;
360
- let n = t;
361
- for (; null !== n && n !== e;) {
362
- if (n.nextElementSibling) return n.nextElementSibling;
363
- n = n.parentElement;
364
- }
365
- return null;
366
- }
367
- function x(t, e) {
368
- switch (t) {
369
- case "FORM":
370
- e.formCount++;
371
- break;
372
- case "INPUT":
373
- e.inputCount++;
374
- break;
375
- case "BUTTON":
376
- e.buttonCount++;
377
- break;
378
- case "A":
379
- e.linkCount++;
380
- break;
381
- case "SELECT":
382
- e.selectCount++;
383
- break;
384
- case "TEXTAREA":
385
- e.textareaCount++;
386
- break;
387
- case "IFRAME":
388
- e.iframeCount++;
389
- break;
390
- case "SCRIPT":
391
- e.scriptCount++;
392
- break;
393
- case "IMG": e.imageCount++;
394
- }
395
- }
396
- function z(t) {
397
- let e = null, n = null, i = null;
398
- function r() {
399
- if (m(e), e = null, m(i), i = null, null !== n) {
400
- const t = n;
401
- n = null, p(() => window.cancelIdleCallback?.(t));
402
- }
403
- }
404
- return {
405
- schedule: function(s, o, a) {
406
- r();
407
- const c = function(t) {
408
- if (!t) return null;
409
- try {
410
- return new URL(t, location.href).pathname;
411
- } catch {
412
- return null;
413
- }
414
- }(a);
415
- e = g(() => {
416
- e = null, function(t) {
417
- const e = window;
418
- "function" != typeof e.requestIdleCallback ? i = g(() => {
419
- i = null, t();
420
- }, 0) : n = e.requestIdleCallback(w(() => {
421
- n = null, t();
422
- }), { timeout: 2e3 });
423
- }(() => function(e, n, i) {
424
- const r = function(t = 2e4) {
425
- const e = {
426
- textLength: 0,
427
- interactiveCount: 0,
428
- scrollHeight: 0,
429
- innerHeight: 0,
430
- nodeCount: 0,
431
- formCount: 0,
432
- inputCount: 0,
433
- buttonCount: 0,
434
- linkCount: 0,
435
- selectCount: 0,
436
- textareaCount: 0,
437
- iframeCount: 0,
438
- scriptCount: 0,
439
- imageCount: 0,
440
- truncated: !1
441
- }, n = document.documentElement;
442
- let i = n;
443
- for (; null !== i;) {
444
- if (e.nodeCount >= t) {
445
- e.truncated = !0;
446
- break;
447
- }
448
- e.nodeCount++, x(i.tagName, e), i = P(i, n);
449
- }
450
- return e.textLength = document.body?.textContent?.length ?? 0, e.interactiveCount = document.querySelectorAll("input,button,a,select,textarea").length, e.scrollHeight = document.documentElement?.scrollHeight ?? 0, e.innerHeight = window.innerHeight, e;
451
- }(), s = {
452
- name: "page_complexity",
453
- timestamp: Date.now(),
454
- ts: performance.now(),
455
- phase: e,
456
- type: n,
457
- path: i,
458
- ...r
459
- };
460
- t.push(s);
461
- }(s, o, c));
462
- }, "load" === s ? 1500 : 500);
463
- },
464
- dispose: r
465
- };
466
- }
467
- function L() {
468
- return function() {};
469
- }
470
- const B = {
471
- pointer: {
472
- create: L,
473
- layer: "behavioral",
474
- events: [
475
- "pointer",
476
- "click",
477
- "dblclick",
478
- "contextmenu"
479
- ]
480
- },
481
- pointermove: {
482
- create: L,
483
- layer: "behavioral"
484
- },
485
- focus: {
486
- create: L,
487
- layer: "behavioral"
488
- },
489
- input: {
490
- create: L,
491
- layer: "behavioral"
492
- },
493
- keystroke: {
494
- create: L,
495
- layer: "behavioral"
496
- },
497
- clipboard: {
498
- create: L,
499
- layer: "behavioral",
500
- events: [
501
- "paste",
502
- "cut",
503
- "copy"
504
- ]
505
- },
506
- form: {
507
- create: L,
508
- layer: "behavioral",
509
- events: [
510
- "submit",
511
- "invalid",
512
- "snapshot"
513
- ]
514
- },
515
- change: {
516
- create: L,
517
- layer: "behavioral"
518
- },
519
- selection: {
520
- create: L,
521
- layer: "behavioral"
522
- },
523
- tab: {
524
- create: L,
525
- layer: "session",
526
- events: ["state", "count"]
527
- },
528
- visibility: {
529
- create: L,
530
- layer: "session"
531
- },
532
- navigation: {
533
- create: function(t) {
534
- let e = t.sanitizeUrl(document.referrer || "");
535
- const n = z(t);
536
- function i(i) {
537
- t.push(i), e = i.to ?? "", n && "hide" !== i.phase && n.schedule(i.phase, i.type, i.to);
538
- }
539
- const r = v(() => {
540
- const [e] = performance.getEntriesByType("navigation");
541
- var n;
542
- i($("load", e?.type ?? "navigate", {
543
- from: document.referrer ? t.sanitizeUrl(document.referrer) : null,
544
- to: t.sanitizeUrl(location.href)
545
- }, performance.timeOrigin, e ? {
546
- fetchStart: (n = e).fetchStart,
547
- domainLookupStart: n.domainLookupStart,
548
- domainLookupEnd: n.domainLookupEnd,
549
- connectStart: n.connectStart,
550
- connectEnd: n.connectEnd,
551
- requestStart: n.requestStart,
552
- responseStart: n.responseStart,
553
- responseEnd: n.responseEnd,
554
- domInteractive: n.domInteractive,
555
- domContentLoadedEventStart: n.domContentLoadedEventStart,
556
- domContentLoadedEventEnd: n.domContentLoadedEventEnd,
557
- domComplete: n.domComplete,
558
- loadEventStart: n.loadEventStart,
559
- loadEventEnd: n.loadEventEnd,
560
- redirectCount: n.redirectCount,
561
- transferSize: n.transferSize,
562
- encodedBodySize: n.encodedBodySize,
563
- decodedBodySize: n.decodedBodySize
564
- } : void 0));
565
- }), s = v((n) => {
566
- const r = n;
567
- if (null === r.navigationType) return;
568
- const s = t.sanitizeUrl(location.href);
569
- s !== e && i($("change", r.navigationType, {
570
- from: e,
571
- to: s
572
- }, performance.timeOrigin));
573
- }), o = v(() => c("traverse")), a = v(() => c("hashchange"));
574
- function c(n) {
575
- const r = t.sanitizeUrl(location.href);
576
- "hashchange" === n && r === e || i($("change", n, {
577
- from: e,
578
- to: r
579
- }, performance.timeOrigin));
580
- }
581
- const l = history.pushState, f = history.replaceState, d = function(...t) {
582
- const e = l.apply(this, t);
583
- return p(() => c("push")), e;
584
- }, y = function(...t) {
585
- const e = f.apply(this, t);
586
- return p(() => c("replace")), e;
587
- };
588
- return window.navigation ? u(window.navigation, "currententrychange", s) : (history.pushState = d, history.replaceState = y, u(window, "popstate", o), u(window, "hashchange", a)), "complete" === document.readyState ? r(new Event("load")) : u(window, "load", r), () => {
589
- n?.dispose(), window.navigation ? h(window.navigation, "currententrychange", s) : (history.pushState === d && (history.pushState = l), history.replaceState === y && (history.replaceState = f), h(window, "popstate", o), h(window, "hashchange", a)), h(window, "load", r);
590
- };
591
- },
592
- layer: "session"
593
- },
594
- networkconnection: {
595
- create: L,
596
- layer: "session"
597
- },
598
- scroll: {
599
- create: L,
600
- layer: "behavioral"
601
- },
602
- viewportresize: {
603
- create: L,
604
- layer: "behavioral"
605
- },
606
- viewport: {
607
- create: L,
608
- layer: "behavioral",
609
- events: ["orientationchange", "devicepixelratiochange"]
610
- },
611
- sensors: {
612
- create: L,
613
- layer: "behavioral",
614
- events: [
615
- "motion",
616
- "orientation",
617
- "light"
618
- ]
619
- },
620
- "network-request": {
621
- create: function(t) {
622
- var n;
623
- const i = function(t, n, i, r = A) {
624
- if ("undefined" == typeof PerformanceObserver) return M;
625
- let s = null;
626
- try {
627
- s = new PerformanceObserver((e) => {
628
- for (const s of e.getEntries()) {
629
- const e = s;
630
- r.has(e.initiatorType) && (n(e.name) || t(R(e, i)));
631
- }
632
- }), s.observe({
633
- type: "resource",
634
- buffered: !0
635
- });
636
- } catch {
637
- return e.warn("network-request", "PerformanceObserver failed to start"), M;
638
- }
639
- return function() {
640
- s?.disconnect(), s = null;
641
- };
642
- }(function(e) {
643
- p(() => t.push(e));
644
- }, (n = t.ignoredOrigins, function(t) {
645
- try {
646
- return n.has(new URL(t).origin);
647
- } catch {
648
- return !1;
649
- }
650
- }), t.sanitizeUrl);
651
- return function() {
652
- i();
653
- };
654
- },
655
- layer: "session"
656
- },
657
- screen: {
658
- create: L,
659
- layer: "session"
660
- },
661
- wheel: {
662
- create: L,
663
- layer: "behavioral"
664
- },
665
- hover: {
666
- create: L,
667
- layer: "behavioral"
668
- },
669
- fpsignals: {
670
- create: function(t, i = "off", s) {
671
- const a = l(s, "device"), f = l(s, "pid"), d = l(s, "behaviour"), g = performance.now(), m = new c();
672
- let b, k = !1, S = !1, T = null, E = null, A = null, C = null, R = null, M = !1, $ = !1, P = null;
673
- const x = new Promise(function(t) {
674
- b = t;
675
- });
676
- function z() {
677
- const e = t.getTabId();
678
- e && e !== P && m.setTabId(e) && (P = e);
679
- }
680
- function L(e, n) {
681
- if (!S || !m.isReady()) return null;
682
- z();
683
- const i = t.peekNextSequence(), r = m.setNextSequence(i), s = [];
684
- let o = !1;
685
- try {
686
- const s = n ? m.getSignalsWithReason(e, n) : m.getSignals(e);
687
- return o = function(e, n, i) {
688
- if (!e) return !1;
689
- const r = {
690
- name: "fp_signals",
691
- timestamp: Date.now(),
692
- signals: e
693
- };
694
- return n && (r.reason = n), void 0 !== i && (r.seq = i), t.push(r), !0;
695
- }(s, n, r ? i : void 0), o ? s : null;
696
- } finally {
697
- !o && s.length > 0 && p(() => {});
698
- }
699
- }
700
- function B(t) {
701
- return !!d && null !== L(o.Behaviour, t);
702
- }
703
- function q(t) {
704
- return p(() => L(t)) ?? null;
705
- }
706
- function D() {
707
- null !== A && clearInterval(A), null !== C && clearTimeout(C), A = null, C = null;
708
- }
709
- function O(t = "partial") {
710
- return !(!a || M || $ || !S || !m.isReady() || !m.hasMethod("gsr") || null === L(o.Device, t) || (M = !0, D(), 0));
711
- }
712
- function F() {
713
- a && m.hasMethod("gsr") && (A = setInterval(w(function() {
714
- O();
715
- }), 250), C = setTimeout(w(D), 5e3));
716
- }
717
- function j() {
718
- if (!S || !m.isReady()) return;
719
- const t = m.getBufferFill();
720
- null !== t && t >= .5 && B("fill");
721
- }
722
- function U() {}
723
- function N() {
724
- m.setUrlSanitizer(null);
725
- }
726
- I = x;
727
- const H = v((e) => {
728
- ("click" !== e.type || e.target instanceof Element && e.target.closest("[data-tri-flush]")) && (B("click" === e.type ? "flush-click" : "submit"), t.flush());
729
- }), J = t.registerBehaviourReader ? t.registerBehaviourReader(function(t) {
730
- const e = p(() => O("partial-now")) ?? !1, n = p(() => B(t)) ?? !1;
731
- return e || n;
732
- }) : null;
733
- return y(async () => {
734
- const s = await ("object" != typeof WebAssembly || null === WebAssembly ? Promise.resolve("no-webassembly") : new Promise(function(t) {
735
- let i = !1;
736
- R = function() {
737
- i || (i = !0, clearTimeout(s), t("timeout"));
738
- };
739
- const s = setTimeout(w(function() {
740
- i || (i = !0, t("timeout"));
741
- }), 3e4);
742
- function o(e) {
743
- i ? null === e && p(() => m.freeResources()) : (i = !0, clearTimeout(s), t(e));
744
- }
745
- m.initialize("https://cdn.incodesmile.com/ml-wasm-kit-release/v2.14.54-pre1-fpsignals9/fpSignals/fpSignalsLib.wasm", "https://cdn.incodesmile.com/ml-wasm-kit-release/v2.14.54-pre1-fpsignals9/fpSignals/fpSignalsLibSimd.wasm").then(function() {
746
- o(null);
747
- }, function(t) {
748
- e.warn("fpSignals", "module failed to load:", t), o(function(t) {
749
- return t instanceof r ? t.reason : "instantiate-failed";
750
- }(t));
751
- });
752
- }));
753
- if (k || p(() => function(e) {
754
- const n = null === e, i = {
755
- name: "fp_signals_load",
756
- timestamp: Date.now(),
757
- loadMs: Math.max(0, performance.now() - g),
758
- simd: n && m.usedSimd,
759
- ok: n
760
- };
761
- null !== e && (i.reason = e), t.push(i);
762
- }(s)), null !== s) return;
763
- if (k) return void m.freeResources();
764
- if (S = !0, p(() => m.setHostInfo(t.host.platform, t.host.version)), p(z), p(() => m.setUrlSanitizer(function(e) {
765
- return t.sanitizeUrl(e);
766
- })), p(() => {
767
- return m.setCapturePolicy({
768
- v: 2,
769
- element: t.captureElementLevel,
770
- content: i,
771
- ignore: ["[data-tri-ignore]"],
772
- redact: ["[data-tri-redact]"],
773
- redactAttrsAttribute: "data-tri-redact-attrs",
774
- interactive: ["[data-tri-interactive]"],
775
- off: (e = t.collectorSelection) ? _(e) : []
776
- });
777
- var e;
778
- }), p(U), d && (p(() => m.setBehaviourCollectionEnabled(!0)), T = setInterval(w(function() {
779
- B("interval");
780
- }), 2e3), m.hasMethod("gbf") && (E = setInterval(w(j), 1e3)), u(document, "submit", H), u(document, "click", H)), !a && !f) return;
781
- if (p(F), await m.collect(), $ = !0, D(), k) return;
782
- const c = a ? q(o.Device) : null, l = f ? q(o.PID) : null;
783
- b({
784
- pid: l,
785
- device: c
786
- });
787
- }).then(function() {
788
- b(null);
789
- }), function() {
790
- k = !0, R?.(), b(null), I === x && (I = null), null !== T && clearInterval(T), null !== E && clearInterval(E), D(), h(document, "submit", H), h(document, "click", H), J?.(), p(() => {}), p(() => {
791
- B("stop");
792
- }), p(() => {}), S && p(N), p(() => m.freeResources());
793
- };
794
- },
795
- layer: "device-fingerprinting",
796
- events: [
797
- "device",
798
- "pid",
799
- "behaviour"
800
- ]
801
- }
802
- };
803
- const q = Object.keys(B);
804
- const D = [
805
- /^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$/i,
806
- /^0b[01]+$/i,
807
- /^0o[0-7]+$/i,
808
- /^0x[0-9a-f]+$/i,
809
- /^[a-z][a-z0-9]{1,12}:[A-Za-z0-9+/=_-]{6,}$/i,
810
- /^[a-z]{2,8}_(?=.*\d)[A-Za-z0-9]{3,}$/,
811
- /^\d{4,}$/,
812
- /@/,
813
- /^[A-Za-z0-9_-]{10,}\.[A-Za-z0-9_-]{5,}\.[A-Za-z0-9_-]{10,}$/,
814
- /^[A-Za-z0-9_-]{20,}={0,2}$/,
815
- /^[0-9a-f]{7,}$/i
816
- ];
817
- function O(t) {
818
- try {
819
- const e = new URL(t, location.href);
820
- e.username = "", e.password = "", e.hash = "";
821
- const n = [...e.searchParams.keys()], i = n.length > 0 ? "?" + n.map((t) => `${encodeURIComponent(t)}=<redacted>`).join("&") : "";
822
- e.search = "", e.pathname = e.pathname.split("/").map((t) => "" !== t && function(t) {
823
- for (const e of D) if (e.test(t)) return !0;
824
- return !1;
825
- }(t) ? ":param" : t).join("/");
826
- const r = e.origin + e.pathname + i;
827
- return r.length > 2048 ? r.slice(0, 2048) : r;
828
- } catch {
829
- return "";
830
- }
831
- }
832
- const F = "idle";
833
- const j = "ready";
834
- const U = "started";
835
- const N = "collection-disabled";
836
- const H = "init-failed";
837
- const J = {
838
- flush: {
839
- intervalMs: 2e3,
840
- maxIntervalMs: 3e4,
841
- size: 50,
842
- backoffFailureThreshold: 2
843
- },
844
- queue: { size: 100 }
845
- };
846
- const K = "redact";
847
- function V() {
848
- const t = {};
849
- for (const e of q) t[e] = W(e, void 0, !0);
850
- return t;
851
- }
852
- function Z(t) {
853
- const e = {};
854
- for (const n of q) e[n] = W(n, void 0, t[B[n].layer] ?? !1);
855
- return e;
856
- }
857
- function G(t) {
858
- for (const n of Object.keys(t)) -1 === q.indexOf(n) && e.fatal("warn", "SDK", `collectors has an unknown key '${n}' — ignored. Known collectors: ${q.join(", ")}.`);
859
- const n = {};
860
- for (const e of q) {
861
- const i = t[e];
862
- n[e] = W(e, i, i?.enabled ?? !1);
863
- }
864
- return n;
865
- }
866
- function W(t, e, n) {
867
- const i = B[t]?.events ?? [];
868
- if (0 === i.length) return { enabled: n };
869
- const r = e?.events, s = {};
870
- for (const t of i) s[t] = { enabled: r?.[t] ?? !0 };
871
- return {
872
- enabled: n,
873
- events: s
874
- };
875
- }
876
- function X(t) {
877
- if (!t) return null;
878
- const e = t.split(".")[1], n = atob(e.replace(/-/g, "+").replace(/_/g, "/"));
879
- return JSON.parse(n);
880
- }
881
- const Q = function(t, e = 30) {
882
- if (!t) return !0;
883
- const n = X(t);
884
- return !n || "number" != typeof n.exp || 1e3 * n.exp <= Date.now() + 1e3 * e;
885
- };
886
- async function Y(t, e) {
887
- return globalThis.navigator && "locks" in globalThis.navigator && "request" in globalThis.navigator.locks && "query" in globalThis.navigator.locks ? navigator.locks.request(t, { mode: "exclusive" }, async () => y(e)) : y(e);
888
- }
889
- function tt(t) {
890
- function e() {
891
- return globalThis.window && globalThis.window[t] && void 0 !== globalThis.window[t];
892
- }
893
- return {
894
- get: function(n) {
895
- if (!e()) return null;
896
- try {
897
- const e = window[t].getItem(n) ?? "null";
898
- return "null" === e ? null : JSON.parse(e);
899
- } catch {
900
- return null;
901
- }
902
- },
903
- set: function(n, i) {
904
- e() && p(() => window[t].setItem(n, JSON.stringify(i)));
905
- },
906
- remove: function(n) {
907
- e() && p(() => window[t].removeItem(n));
908
- },
909
- key: function(n) {
910
- return e() ? window[t].key(n) : null;
911
- },
912
- get length() {
913
- return e() ? window[t].length : 0;
914
- }
915
- };
916
- }
917
- const et = tt("localStorage");
918
- const nt = tt("sessionStorage");
919
- const it = "__tri";
920
- const rt = `${it}_activity_token`;
921
- const st = `${it}_activity_id`;
922
- const ot = `${it}_activity_status`;
923
- const at = "__tri_activity_lock";
924
- var ct = class {
925
- constructor(t) {
926
- this.context = t, this.l = null, this.u = null, this.h = null, this.p = null, this.m = null, this.k = !1;
927
- }
928
- getToken() {
929
- return this.l;
930
- }
931
- getActivityId() {
932
- return this.u ?? "";
933
- }
934
- isActive() {
935
- return "ACTIVE" === this.h && null !== this.l;
936
- }
937
- async start() {
938
- return this.k = !0, this.p || (this.p = this.S()), this.p;
939
- }
940
- async stop() {
941
- const t = this.T();
942
- this.m = t;
943
- try {
944
- await t;
945
- } finally {
946
- this.m === t && (this.m = null);
947
- }
948
- }
949
- async T() {
950
- this.k = !1, this.h = "INACTIVE", this._(null), this.p = null, this.l && await this.context.stopActivity(), this.I(null);
951
- }
952
- async refresh() {
953
- if (!this.k) return;
954
- const t = this.l;
955
- await Y(at, async () => {
956
- if (this.l && this.l !== t && !Q(this.l) && "ACTIVE" === this.h) return;
957
- const e = this.A();
958
- e && e.token !== t && !Q(e.token) && "ACTIVE" === e.activityStatus ? this.I(e) : (this.C(), await this.R());
959
- });
960
- }
961
- async S() {
962
- try {
963
- if (this.m && await this.m, this.l && !Q(this.l)) return;
964
- await Y(at, async () => {
965
- await this.R();
966
- });
967
- } finally {
968
- this.p = null;
969
- }
970
- }
971
- async R() {
972
- const t = this.A();
973
- if (t && !Q(t.token) && "ACTIVE" === t.activityStatus) return void this.I(t);
974
- t && this.C();
975
- const e = await this.context.startActivity();
976
- if (!e.ok) return;
977
- if (!e.data.token) return;
978
- const n = e.data;
979
- this.I(n), this.M(n);
980
- }
981
- A() {
982
- const [t, e, n] = [
983
- et.get(rt),
984
- et.get(st),
985
- et.get(ot)
986
- ];
987
- return t && e && n ? {
988
- token: t,
989
- activityId: e,
990
- activityStatus: n
991
- } : ((t || e || n) && this.C(), null);
992
- }
993
- M(t) {
994
- et.set(rt, t.token), et.set(st, t.activityId), et.set(ot, t.activityStatus);
995
- }
996
- C() {
997
- this._(null), this.I(null);
998
- }
999
- _(t) {
1000
- if (!t) return et.remove(rt), et.remove(st), void et.remove(ot);
1001
- et.set(rt, t.token), et.set(st, t.activityId), et.set(ot, t.activityStatus);
1002
- }
1003
- I(t) {
1004
- if (!t) return this.l = null, this.u = null, void (this.h = null);
1005
- this.l = t.token, this.u = t.activityId, this.h = t.activityStatus;
1006
- }
1007
- };
1008
- const lt = [
1009
- 401,
1010
- 403,
1011
- 409
1012
- ];
1013
- const ut = Object.freeze({
1014
- tab: 80,
1015
- navigation: 80,
1016
- page_complexity: 80,
1017
- fp_signals: 80,
1018
- fp_signals_load: 80,
1019
- network_request: 60
1020
- });
1021
- function ht(t) {
1022
- return ut[t.name];
1023
- }
1024
- const ft = Object.freeze({
1025
- tri: "/events/capture",
1026
- "fp-signals": "/events/capture/fp-signals"
1027
- });
1028
- const dt = /* @__PURE__ */ new Map([["fp_signals", "fp-signals"]]);
1029
- function pt(t) {
1030
- return dt.get(t.name) ?? "tri";
1031
- }
1032
- const yt = new Array(256);
1033
- for (let t = 0; t < 256; t++) yt[t] = (t + 256).toString(16).slice(1);
1034
- const vt = /* @__PURE__ */ new Uint8Array(16);
1035
- function wt(t) {
1036
- return yt[t[0]] + yt[t[1]] + yt[t[2]] + yt[t[3]] + "-" + yt[t[4]] + yt[t[5]] + "-" + yt[t[6]] + yt[t[7]] + "-" + yt[t[8]] + yt[t[9]] + "-" + yt[t[10]] + yt[t[11]] + yt[t[12]] + yt[t[13]] + yt[t[14]] + yt[t[15]];
1037
- }
1038
- function gt() {
1039
- return crypto.randomUUID();
1040
- }
1041
- function mt() {
1042
- return crypto.getRandomValues(vt), vt[6] = 15 & vt[6] | 64, vt[8] = 63 & vt[8] | 128, wt(vt);
1043
- }
1044
- function bt() {
1045
- for (let t = 0; t < 16; t++) vt[t] = 256 * Math.random() | 0;
1046
- return vt[6] = 15 & vt[6] | 64, vt[8] = 63 & vt[8] | 128, wt(vt);
1047
- }
1048
- const kt = function() {
1049
- if ("undefined" != typeof crypto) {
1050
- if ("function" == typeof crypto.randomUUID) return gt;
1051
- if ("function" == typeof crypto.getRandomValues) return mt;
1052
- }
1053
- return bt;
1054
- }();
1055
- function St() {
1056
- return kt();
1057
- }
1058
- var Tt = class {
1059
- constructor(t, e) {
1060
- this.$ = t, this.P = e, this.L = [], this.B = null, this.q = [], this.D = null, this.k = !1, this.O = !0, this.F = 0, this.j = 0, this.U = 0, this.N = function(t = 0) {
1061
- let e = t;
1062
- return {
1063
- peek: function() {
1064
- return e;
1065
- },
1066
- next: function() {
1067
- return e++;
1068
- },
1069
- claim: function(t) {
1070
- return !(!Number.isInteger(t) || t < e || (e = t + 1, 0));
1071
- }
1072
- };
1073
- }(), this.H = null, this.J = !1, this.K = t.flush.intervalMs;
1074
- }
1075
- peekNextSequence() {
1076
- return this.N.peek();
1077
- }
1078
- push(t) {
1079
- this.k ? (this.V(t), this.H && this.Z(this.H, t) || (this.G(t), this.W())) : e.warn("Transport", "push() called before start() — event dropped");
1080
- }
1081
- setEventRouter(t) {
1082
- this.H = t;
1083
- }
1084
- getEventRouter() {
1085
- return this.H;
1086
- }
1087
- requeue(t) {
1088
- if (0 !== t.length) if (this.k) {
1089
- for (const e of t) this.G(e);
1090
- this.W();
1091
- } else e.warn("Transport", "requeue() called before start() — events dropped", t.length);
1092
- }
1093
- Z(t, n) {
1094
- try {
1095
- return !0 === t.route(n);
1096
- } catch (t) {
1097
- return e.warn("Transport", "event router threw — event queued:", t), !1;
1098
- }
1099
- }
1100
- G(t) {
1101
- this.L.length < this.X() ? this.L.push(t) : this.Y(t);
1102
- }
1103
- holdCapacityFlush(t) {
1104
- const e = this.J;
1105
- this.J = !0;
1106
- try {
1107
- t();
1108
- } finally {
1109
- this.J = e;
1110
- }
1111
- }
1112
- W() {
1113
- if (this.O) return this.L.length >= this.$.flush.size && !this.J ? (m(this.B), this.B = null, void this.flush("capacity")) : void this.tt();
1114
- }
1115
- flush(t) {
1116
- if (this.k && this.P.isActivityActive()) try {
1117
- if ("lifecycle" === t) return void this.et();
1118
- if (0 === this.L.length) return;
1119
- if ("submit" === t && !this.O) return;
1120
- const n = "submit" === t;
1121
- for (const i of this.nt(!1, n)) {
1122
- const r = this.it(i, t, n ? this.rt() : void 0);
1123
- r && (n ? this.st(r) : this.P.ingest(r, !1)).then((t) => this.ot(t, r)).catch(() => {
1124
- e.warn("Transport", "ingest threw unexpectedly — batch dropped");
1125
- });
1126
- }
1127
- this.L.length > 0 && this.tt();
1128
- } catch (t) {
1129
- e.warn("Transport", "flush() threw unexpectedly:", t);
1130
- }
1131
- }
1132
- start() {
1133
- this.k || (this.k = !0, this.O = "undefined" == typeof navigator || navigator.onLine);
1134
- }
1135
- stop() {
1136
- if (!this.k) return Promise.resolve();
1137
- m(this.B), this.B = null, m(this.D), this.D = null;
1138
- const t = this.et();
1139
- return this.k = !1, this.q = [], t;
1140
- }
1141
- onConnectionChange() {
1142
- const t = "undefined" == typeof navigator || navigator.onLine;
1143
- if (t !== this.O) {
1144
- if (this.O = t, !this.O) return m(this.B), this.B = null, m(this.D), void (this.D = null);
1145
- this.L.length > 0 && this.tt(), this.q.length > 0 && this.ct();
1146
- }
1147
- }
1148
- tt() {
1149
- this.k && this.O && null === this.B && (this.B = g(() => {
1150
- this.B = null, this.flush("interval");
1151
- }, this.K));
1152
- }
1153
- ct() {
1154
- this.k && this.O && null === this.D && (this.D = g(() => {
1155
- this.D = null, this.lt();
1156
- }, this.K));
1157
- }
1158
- lt() {
1159
- if (!this.k || !this.O || 0 === this.q.length || !this.P.isActivityActive()) return;
1160
- const t = this.q.shift();
1161
- this.P.ingest(t.batch, !1).then((e) => this.ut(e, t)).catch(() => {
1162
- e.warn("Transport", "retry drain ingest threw unexpectedly — batch dropped"), this.q.length > 0 && this.ct();
1163
- });
1164
- }
1165
- ht(t, n) {
1166
- this.q.length >= 5 && (this.q.shift(), e.warn("Transport", "retry queue full — oldest batch evicted")), this.q.push({
1167
- batch: t,
1168
- attempts: n
1169
- }), this.ct();
1170
- }
1171
- ot(t, e) {
1172
- this.k && this.P.isActivityActive() && (t.ok ? this.ft() : this.dt(t) && this.ht(e, 1));
1173
- }
1174
- ut(t, n) {
1175
- if (this.k && this.P.isActivityActive()) {
1176
- if (t.ok) return this.ft(), void (this.q.length > 0 && this.ct());
1177
- if (this.dt(t)) {
1178
- if (n.attempts >= 3) return this.yt(), e.warn("Transport", "batch dropped after MAX_RETRY_ATTEMPTS", n.batch.batchId), void (this.q.length > 0 && this.ct());
1179
- this.yt(), this.ht(n.batch, n.attempts + 1);
1180
- } else this.q.length > 0 && this.ct();
1181
- }
1182
- }
1183
- yt() {
1184
- this.F++, this.F % this.$.flush.backoffFailureThreshold === 0 && (this.K = Math.min(2 * this.K, this.$.flush.maxIntervalMs));
1185
- }
1186
- ft() {
1187
- this.F = 0, this.K = this.$.flush.intervalMs;
1188
- }
1189
- X() {
1190
- return this.$.queue.size * (this.O ? 1 : 2);
1191
- }
1192
- async et() {
1193
- if (!this.P.isActivityActive()) return Promise.resolve();
1194
- if (this.H) {
1195
- let t = [];
1196
- try {
1197
- t = this.H.release();
1198
- } catch (t) {
1199
- e.warn("Transport", "event router release threw:", t);
1200
- }
1201
- for (const e of t) this.G(e);
1202
- }
1203
- if (!this.O) return;
1204
- const t = [];
1205
- let n = this.rt();
1206
- for (const i of this.nt(!0, !0)) {
1207
- const r = this.it(i, "lifecycle", n);
1208
- r && (n -= _t(r.events), t.push(this.st(r).then((t) => this.ot(t, r)).catch(() => {
1209
- e.warn("Transport", "lifecycle ingest threw — batch dropped");
1210
- })));
1211
- }
1212
- const i = [];
1213
- for (const r of this.q) {
1214
- const s = _t(r.batch.events);
1215
- s > n ? i.push(r) : (n -= s, t.push(this.st(r.batch).then((t) => this.ut(t, r)).catch(() => {
1216
- e.warn("Transport", "lifecycle retry ingest threw — batch dropped");
1217
- })));
1218
- }
1219
- return this.q = i, Promise.allSettled(t).then(() => {});
1220
- }
1221
- rt() {
1222
- return Math.max(0, 49152 - this.U);
1223
- }
1224
- st(t) {
1225
- const e = _t(t.events);
1226
- return this.U += e, this.P.ingest(t, !0).finally(() => {
1227
- this.U -= e;
1228
- });
1229
- }
1230
- V(t) {
1231
- void 0 !== t.seq && this.N.claim(t.seq) || (void 0 !== t.seq && e.warn("Transport", "event carried a seq that was already used — restamped", t.seq), t.seq = this.N.next());
1232
- }
1233
- Y(t) {
1234
- const e = ht(t);
1235
- for (let n = 0; n < this.L.length; n++) if (ht(this.L[n]) < e) {
1236
- for (let t = n; t < this.L.length - 1; t++) this.L[t] = this.L[t + 1];
1237
- this.L.length -= 1, this.L.push(t);
1238
- return;
1239
- }
1240
- }
1241
- it(t, e, n) {
1242
- const i = "lifecycle" === e, r = this.vt(t, i, i ? 200 : this.$.flush.size, n);
1243
- return 0 === r.length ? null : {
1244
- activityId: "",
1245
- batchId: St(),
1246
- batchSequence: this.j++,
1247
- clientTimestamp: Date.now(),
1248
- schemaVersion: "0.1.0",
1249
- sdkVersion: "0.5.1",
1250
- sdkPlatform: "web",
1251
- tabId: this.P.getTabId(),
1252
- events: r
1253
- };
1254
- }
1255
- vt(t, e, n, i) {
1256
- const r = /* @__PURE__ */ new Set();
1257
- let s = 0;
1258
- for (let o = 0; o < this.L.length && r.size < n; o++) {
1259
- const n = e ? this.L.length - 1 - o : o, a = this.L[n];
1260
- if (pt(a) === t) {
1261
- if (void 0 !== i) {
1262
- const t = It(a);
1263
- if (s + t > i) continue;
1264
- s += t;
1265
- }
1266
- r.add(n);
1267
- }
1268
- }
1269
- if (0 === r.size) return [];
1270
- const o = [], a = [];
1271
- for (let t = 0; t < this.L.length; t++) r.has(t) ? o.push(this.L[t]) : a.push(this.L[t]);
1272
- return this.L = a, o;
1273
- }
1274
- nt(t, e = !1) {
1275
- const n = [];
1276
- for (let e = 0; e < this.L.length; e++) {
1277
- const i = pt(this.L[t ? this.L.length - 1 - e : e]);
1278
- n.includes(i) || n.push(i);
1279
- }
1280
- if (e) {
1281
- const t = n.indexOf("fp-signals");
1282
- t > 0 && (n.splice(t, 1), n.unshift("fp-signals"));
1283
- }
1284
- return n;
1285
- }
1286
- dt(t) {
1287
- if (t.ok) return !1;
1288
- switch (t.kind) {
1289
- case "timeout":
1290
- case "server":
1291
- case "rate_limited":
1292
- case "network": return !0;
1293
- default: return !1;
1294
- }
1295
- }
1296
- };
1297
- function _t(t) {
1298
- let e = 0;
1299
- for (let n = 0; n < t.length; n++) e += It(t[n]);
1300
- return e;
1301
- }
1302
- function It(t) {
1303
- try {
1304
- return JSON.stringify(t).length + 1;
1305
- } catch {
1306
- return 0;
1307
- }
1308
- }
1309
- const Et = "tri:bcast:";
1310
- const At = "function" == typeof BroadcastChannel ? BroadcastChannel : function() {
1311
- if ("undefined" == typeof Storage || "undefined" == typeof window) return !1;
1312
- try {
1313
- const t = "__tri_bcast_probe__";
1314
- localStorage.setItem(t, "1");
1315
- const e = "1" === localStorage.getItem(t);
1316
- return localStorage.removeItem(t), e;
1317
- } catch {
1318
- return !1;
1319
- }
1320
- }() ? class {
1321
- constructor(t) {
1322
- this.seq = 0, this.closed = !1, this.listeners = /* @__PURE__ */ new Set(), this.onStorageEvent = (t) => {
1323
- if (this.closed) return;
1324
- if (!t.key || !t.key.startsWith(`${Et}${this.channelName}:`)) return;
1325
- if (null === t.newValue) return;
1326
- let e;
1327
- p(() => et.remove(t.key));
1328
- try {
1329
- e = JSON.parse(t.newValue);
1330
- } catch {
1331
- return;
1332
- }
1333
- const n = { data: e };
1334
- for (const t of this.listeners) p(() => t(n));
1335
- }, this.channelName = t, this.senderId = St(), window.addEventListener("storage", this.onStorageEvent);
1336
- }
1337
- postMessage(t) {
1338
- if (this.closed) return;
1339
- const e = `${Et}${this.channelName}:${this.senderId}:${this.seq++}`;
1340
- p(() => {
1341
- et.set(e, t), et.remove(e);
1342
- });
1343
- }
1344
- addEventListener(t, e) {
1345
- this.listeners.add(e);
1346
- }
1347
- removeEventListener(t, e) {
1348
- this.listeners.delete(e);
1349
- }
1350
- close() {
1351
- this.closed || (this.closed = !0, window.removeEventListener("storage", this.onStorageEvent), this.listeners.clear());
1352
- }
1353
- } : class {
1354
- constructor(t) {
1355
- e.warn("BroadcastChannel", "BroadcastChannel is unavailable and localStorage is not writable in this context. Cross-tab discovery is disabled; tab count will always be reported as 1.");
1356
- }
1357
- postMessage(t) {}
1358
- addEventListener(t, e) {}
1359
- removeEventListener(t, e) {}
1360
- close() {}
1361
- };
1362
- const Ct = "__tri_tabId";
1363
- var Rt = class {
1364
- constructor(t) {
1365
- this.context = t, this.wt = "", this.k = !1, this.gt = null, this.bt = null, this.kt = null, this.St = /* @__PURE__ */ new Map(), this.Tt = -1, this._t = null;
1366
- }
1367
- async start() {
1368
- this.k || (this.k = !0, this.wt = this.It(), this.Et(), this.At({
1369
- type: "hello",
1370
- tabId: this.wt,
1371
- ts: Date.now()
1372
- }), this.Ct(), this.Rt("active"), this.Mt());
1373
- }
1374
- stop() {
1375
- this.k && (this.k = !1, this.Rt("inactive"), this.At({
1376
- type: "bye",
1377
- tabId: this.wt,
1378
- ts: Date.now()
1379
- }), this.$t(this.Pt()), this.xt(), this.zt(), this.Lt());
1380
- }
1381
- getTabId() {
1382
- return this.wt;
1383
- }
1384
- queryTabsNumber() {
1385
- return this.St.size + 1;
1386
- }
1387
- Et() {
1388
- try {
1389
- this.gt = new At("__tri_tab_channel"), this._t = this.Bt.bind(this), this.gt.addEventListener("message", this._t);
1390
- } catch (t) {
1391
- e.warn("TabManager", "failed to open broadcast channel:", t);
1392
- }
1393
- }
1394
- Lt() {
1395
- try {
1396
- if (!this.gt) return;
1397
- this._t && this.gt.removeEventListener("message", this._t), this.gt.close();
1398
- } catch {} finally {
1399
- this.gt = null, this._t = null;
1400
- }
1401
- }
1402
- Ct() {
1403
- this.bt = setInterval(() => {
1404
- const t = Date.now();
1405
- this.At({
1406
- type: "heartbeat",
1407
- tabId: this.wt,
1408
- ts: t
1409
- });
1410
- }, 1e3);
1411
- }
1412
- xt() {
1413
- null != this.bt && (clearInterval(this.bt), this.bt = null);
1414
- }
1415
- Mt() {
1416
- null != this.kt && clearTimeout(this.kt), this.kt = setTimeout(() => {
1417
- this.kt = null;
1418
- const t = this.Pt() + 1;
1419
- t !== this.Tt && (this.Tt = t, this.$t(t));
1420
- }, 1e3);
1421
- }
1422
- zt() {
1423
- null != this.kt && (clearTimeout(this.kt), this.kt = null);
1424
- }
1425
- At(t) {
1426
- try {
1427
- if (!this.gt) return;
1428
- this.gt.postMessage(t);
1429
- } catch {
1430
- e.warn("TabManager", "failed to broadcast message:", t);
1431
- }
1432
- }
1433
- Bt(t) {
1434
- const { type: e, tabId: n } = t.data;
1435
- if (n === this.wt) return;
1436
- const i = Date.now();
1437
- "hello" === e ? (this.At({
1438
- type: "ack",
1439
- tabId: this.wt,
1440
- ts: i,
1441
- to: n
1442
- }), this.St.set(n, i)) : "heartbeat" === e || "ack" === e ? this.St.set(n, i) : "bye" === e && this.St.delete(n);
1443
- }
1444
- $t(t) {
1445
- this.context.events.count && this.context.push({
1446
- name: "tab",
1447
- type: "count",
1448
- tabId: this.wt,
1449
- timestamp: Date.now(),
1450
- ts: performance.now(),
1451
- value: t
1452
- });
1453
- }
1454
- Rt(t) {
1455
- this.context.events.state && this.context.push({
1456
- name: "tab",
1457
- type: "state",
1458
- tabId: this.wt,
1459
- timestamp: Date.now(),
1460
- ts: performance.now(),
1461
- value: t
1462
- });
1463
- }
1464
- It() {
1465
- const t = nt.get(Ct);
1466
- if (t) return t;
1467
- const e = St();
1468
- return nt.set(Ct, e), e;
1469
- }
1470
- Pt(t = Date.now()) {
1471
- let e = 0;
1472
- for (const [n, i] of this.St.entries()) t - i >= 3e3 ? this.St.delete(n) : e++;
1473
- return e;
1474
- }
1475
- };
1476
- const Mt = globalThis.CompressionStream;
1477
- const $t = globalThis.Response;
1478
- const Pt = globalThis.Blob;
1479
- const xt = new TextEncoder();
1480
- let zt = null;
1481
- async function Lt(t) {
1482
- const n = await async function(t) {
1483
- if ("function" != typeof Mt) return null;
1484
- try {
1485
- const e = xt.encode(t), n = new Pt([e]).stream().pipeThrough(new Mt("gzip"));
1486
- return await new $t(n).arrayBuffer();
1487
- } catch (t) {
1488
- return e.warn("compression", "Native gzip failed:", t), null;
1489
- }
1490
- }(t);
1491
- return null !== n ? n : async function(t) {
1492
- try {
1493
- const n = await function() {
1494
- if (null === zt) {
1495
- const t = function(t, n = 1e4) {
1496
- let i = null;
1497
- const r = new Promise((t) => {
1498
- i = g(() => {
1499
- e.warn("import", `Import timed out after ${n}ms`), t(null);
1500
- }, n);
1501
- }), s = Promise.resolve().then(t).catch((t) => (e.warn("import", "Import failed:", t), null));
1502
- return Promise.race([s, r]).finally(() => {
1503
- m(i);
1504
- });
1505
- }(() => import("./browser-pQZA35G2-PIj2uGBm.esm.js"), 1e4);
1506
- zt = t, t.then((e) => {
1507
- null === e && g(() => {
1508
- zt === t && (zt = null);
1509
- }, 1e4);
1510
- });
1511
- }
1512
- return zt;
1513
- }();
1514
- if (null === n) return null;
1515
- const { gzipSync: i } = n, r = i(xt.encode(t));
1516
- return r.buffer.slice(r.byteOffset, r.byteOffset + r.byteLength);
1517
- } catch (t) {
1518
- return e.warn("compression", "fflate gzip failed:", t), null;
1519
- }
1520
- }(t);
1521
- }
1522
- function Bt(t, e) {
1523
- const n = [JSON.stringify(t)];
1524
- for (let t = 0; t < e.length; t++) try {
1525
- n.push(JSON.stringify(e[t]));
1526
- } catch {}
1527
- return n.join("\n");
1528
- }
1529
- function qt(t) {
1530
- const e = { Accept: "application/json" };
1531
- return t?.hasBody && ("json" === t.contentType ? e["Content-Type"] = "application/json" : "ndjson" === t.contentType && (e["Content-Type"] = "application/x-ndjson"), "gzip" === t.contentEncoding && (e["Content-Encoding"] = "gzip")), t?.token && (e.Authorization = `Bearer ${t.token}`), t?.profileId && (e["x-profile-id"] = t.profileId), t?.api?.version && (e["x-api-version"] = t.api.version), t?.customHeaders && Object.entries(t.customHeaders).forEach(([t, n]) => {
1532
- e[t] = n;
1533
- }), e;
1534
- }
1535
- const Dt = "function" == typeof globalThis.fetch ? globalThis.fetch.bind(globalThis) : void 0;
1536
- function Ot(t) {
1537
- "undefined" != typeof document && "function" == typeof globalThis.fetch || e.warn("FalconService", "createFalconServiceManager called in a non-browser environment — all requests will resolve with { ok: false, kind: 'network' }.");
1538
- const n = function(t) {
1539
- const e = t?.timeout, n = t?.baseUrl ?? "", i = t?.api;
1540
- async function r(t, r, s) {
1541
- if (void 0 === Dt) return {
1542
- ok: !1,
1543
- kind: "network"
1544
- };
1545
- const o = n ? `${n}${r}` : r, a = new AbortController();
1546
- let c = null, l = !1;
1547
- c = g(() => {
1548
- l = !0, a.abort();
1549
- }, e);
1550
- const u = s?.signal;
1551
- let h, f = () => {};
1552
- if (u) if (u.aborted) a.abort();
1553
- else {
1554
- const t = () => a.abort();
1555
- u.addEventListener("abort", t, { once: !0 }), f = () => u.removeEventListener("abort", t);
1556
- }
1557
- if (null != s && "body" in s && null != s.body) {
1558
- const t = function(t) {
1559
- if (null == t) return {
1560
- ok: !0,
1561
- body: void 0
1562
- };
1563
- if ("string" == typeof t || t instanceof ArrayBuffer || ArrayBuffer.isView(t) || t instanceof Blob || t instanceof FormData || t instanceof URLSearchParams || t instanceof ReadableStream) return {
1564
- ok: !0,
1565
- body: t
1566
- };
1567
- try {
1568
- return {
1569
- ok: !0,
1570
- body: JSON.stringify(t)
1571
- };
1572
- } catch {
1573
- return { ok: !1 };
1574
- }
1575
- }(s.body);
1576
- if (!t.ok) return m(c), f(), {
1577
- ok: !1,
1578
- kind: "serialize"
1579
- };
1580
- h = t.body;
1581
- }
1582
- try {
1583
- const e = await Dt(o, {
1584
- method: t,
1585
- headers: qt({
1586
- token: s?.token,
1587
- profileId: s?.profileId,
1588
- contentType: s?.contentType,
1589
- contentEncoding: s?.contentEncoding,
1590
- api: i,
1591
- hasBody: void 0 !== h,
1592
- customHeaders: s?.customHeaders
1593
- }),
1594
- body: h,
1595
- signal: a.signal,
1596
- keepalive: s?.keepalive
1597
- });
1598
- if (!e.ok) return 429 === (d = e.status) ? {
1599
- ok: !1,
1600
- kind: "rate_limited",
1601
- status: d
1602
- } : d >= 400 && d < 500 ? {
1603
- ok: !1,
1604
- kind: "client",
1605
- status: d
1606
- } : {
1607
- ok: !1,
1608
- kind: "server",
1609
- status: d
1610
- };
1611
- if (204 === e.status) return {
1612
- ok: !0,
1613
- data: void 0,
1614
- status: 204
1615
- };
1616
- try {
1617
- return {
1618
- ok: !0,
1619
- data: await e.json(),
1620
- status: e.status
1621
- };
1622
- } catch {
1623
- return a.signal.aborted ? l ? {
1624
- ok: !1,
1625
- kind: "timeout"
1626
- } : {
1627
- ok: !1,
1628
- kind: "abort"
1629
- } : {
1630
- ok: !1,
1631
- kind: "parse",
1632
- status: e.status
1633
- };
1634
- }
1635
- } catch {
1636
- return l ? {
1637
- ok: !1,
1638
- kind: "timeout"
1639
- } : a.signal.aborted ? {
1640
- ok: !1,
1641
- kind: "abort"
1642
- } : {
1643
- ok: !1,
1644
- kind: "network"
1645
- };
1646
- } finally {
1647
- m(c), f();
1648
- }
1649
- var d;
1650
- }
1651
- return {
1652
- post: async function(t, e) {
1653
- return r("POST", t, e);
1654
- },
1655
- get: async function(t, e) {
1656
- return r("GET", t, e);
1657
- }
1658
- };
1659
- }({
1660
- baseUrl: `${t.api.url}/api/v1`,
1661
- timeout: 1e4,
1662
- api: { version: t.api.version }
1663
- }), i = function(t) {
1664
- const { getToken: n, refresh: i } = t;
1665
- let r = null;
1666
- return { withAuth: async function(t, s) {
1667
- if (r) {
1668
- const e = await r;
1669
- if (e) return t(e);
1670
- }
1671
- const o = n() ?? "", a = await t(o);
1672
- if ((c = a).ok || !("rejected" === c.kind || "client" === c.kind && lt.includes(c.status)) || !1 === s?.refreshable) return a;
1673
- var c;
1674
- const l = await (r || (r = async function() {
1675
- try {
1676
- return await i(), n();
1677
- } catch (t) {
1678
- return e.warn("AuthMiddleware", "auth refresh failed", t), null;
1679
- }
1680
- }().finally(() => {
1681
- r = null;
1682
- }), r));
1683
- return l && l !== o ? t(l) : a;
1684
- } };
1685
- }(t), r = () => ({ profileId: t.getProfileId() ?? void 0 });
1686
- return { api: {
1687
- ingest: async function(e, s) {
1688
- return i.withAuth(async (i) => {
1689
- const { events: o, ...a } = e, c = {
1690
- ...a,
1691
- activityId: t.getActivityId()
1692
- };
1693
- let l, u = !1;
1694
- try {
1695
- if (s) l = Bt(c, o);
1696
- else {
1697
- const t = await async function(t, e) {
1698
- const n = Bt(t, e), i = await Lt(n);
1699
- return i ? {
1700
- type: "gzip",
1701
- body: i
1702
- } : {
1703
- type: "ndjson",
1704
- body: n
1705
- };
1706
- }(c, o);
1707
- l = t.body, u = "gzip" === t.type;
1708
- }
1709
- } catch {
1710
- return {
1711
- ok: !1,
1712
- kind: "serialize"
1713
- };
1714
- }
1715
- const h = await n.post(function(t) {
1716
- return t.length > 0 ? ft[pt(t[0])] : ft.tri;
1717
- }(o), {
1718
- body: l,
1719
- token: i,
1720
- keepalive: s,
1721
- contentType: "ndjson",
1722
- contentEncoding: u ? "gzip" : void 0,
1723
- ...r()
1724
- });
1725
- return function(t) {
1726
- return t.ok && !0 === t.data?.malformedBatch;
1727
- }(h) ? {
1728
- ok: !1,
1729
- kind: "rejected",
1730
- status: h.status
1731
- } : h;
1732
- }, { refreshable: !s });
1733
- },
1734
- reportEvent: async function(t) {
1735
- return i.withAuth((e) => n.post("/events/report-event", {
1736
- body: t,
1737
- token: e,
1738
- contentType: "json",
1739
- ...r()
1740
- }));
1741
- },
1742
- startActivity: async function() {
1743
- return n.post("/events/start-activity", {
1744
- token: t.getSdkToken(),
1745
- ...r()
1746
- });
1747
- },
1748
- stopActivity: async function() {
1749
- return i.withAuth((t) => n.post("/events/end-activity", {
1750
- token: t,
1751
- keepalive: !0,
1752
- ...r()
1753
- }), { refreshable: !1 });
1754
- },
1755
- collectionStatus: async function() {
1756
- return n.get("/sdk/collection-status", {
1757
- token: t.getSdkToken(),
1758
- ...r()
1759
- });
1760
- },
1761
- linkInterview: async function(e) {
1762
- const s = t.getToken();
1763
- return s && !Q(s) || await t.refresh(), i.withAuth((t) => n.post("/events/link-interview", {
1764
- token: t,
1765
- contentType: "json",
1766
- ...r(),
1767
- customHeaders: { "X-Incode-Hardware-Id": e }
1768
- }), { refreshable: !1 });
1769
- }
1770
- } };
1771
- }
1772
- var Ft = class {
1773
- constructor(t) {
1774
- this.context = t;
1775
- }
1776
- stop() {}
1777
- async report(t, n) {
1778
- const i = {
1779
- name: t,
1780
- metadata: n,
1781
- timestamp: Date.now(),
1782
- activityId: this.context.getActivityId() ?? ""
1783
- };
1784
- try {
1785
- const r = await this.context.reportEvent(i);
1786
- if (r.ok) return r;
1787
- e.warn("EventReport", "Failed to report event:", t, n, "with result:", r);
1788
- } catch (i) {
1789
- e.warn("EventReport", "Failed to report event:", t, n, "with error:", i);
1790
- }
1791
- }
1792
- };
1793
- async function jt(t, n) {
1794
- const { collectors: i, sdk: r } = t;
1795
- let s = null, o = null, a = null, c = null;
1796
- try {
1797
- s = Ot({
1798
- api: {
1799
- version: r.api.version,
1800
- url: r.api.url
1801
- },
1802
- getSdkToken: () => r.token,
1803
- getProfileId: () => n.getProfileId(),
1804
- getToken: () => o?.getToken() ?? null,
1805
- refresh: async () => o?.refresh() ?? Promise.resolve(),
1806
- getActivityId: () => o?.getActivityId() ?? ""
1807
- });
1808
- const t = await s.api.collectionStatus();
1809
- if (!t.ok || !0 !== t.data.eventsCollectionEnabled) return { status: "collection-disabled" };
1810
- o = new ct({
1811
- startActivity: () => s.api.startActivity(),
1812
- stopActivity: () => s.api.stopActivity()
1813
- }), a = new Tt(J, {
1814
- ingest: (t, e) => s.api.ingest(t, e),
1815
- getTabId: () => c?.getTabId() ?? "unknown",
1816
- isActivityActive: () => o?.isActive() ?? !1
1817
- });
1818
- const l = i.tab;
1819
- c = new Rt({
1820
- push: (t) => a?.push(t),
1821
- events: {
1822
- state: l.enabled && l.events.state.enabled,
1823
- count: l.enabled && l.events.count.enabled
1824
- }
1825
- });
1826
- const f = /* @__PURE__ */ new Set();
1827
- try {
1828
- f.add(new URL(r.api.url).origin);
1829
- } catch {}
1830
- const d = function(t, e, n = "off") {
1831
- const i = /* @__PURE__ */ new Map(), r = /* @__PURE__ */ new Set(), s = {
1832
- ...t,
1833
- registerBehaviourReader: function(t) {
1834
- return r.add(t), function() {
1835
- r.delete(t);
1836
- };
1837
- },
1838
- collectorSelection: e
1839
- };
1840
- function o(t) {
1841
- if (i.has(t)) return;
1842
- const r = B[t];
1843
- if (!r || !function(t, e) {
1844
- return e[t]?.enabled ?? !1;
1845
- }(t, e)) return;
1846
- const o = e[t], a = r.create(s, n, o && "events" in o ? o.events : void 0);
1847
- i.set(t, a);
1848
- }
1849
- return {
1850
- start: o,
1851
- stopCollector: function(t) {
1852
- const e = i.get(t);
1853
- e && (e(), i.delete(t));
1854
- },
1855
- stop: function() {
1856
- for (const [, t] of i) t();
1857
- i.clear();
1858
- },
1859
- isRunning: function(t) {
1860
- return i.has(t);
1861
- },
1862
- autocapture: function() {
1863
- for (const t of q) o(t);
1864
- },
1865
- readBehaviour: function(t) {
1866
- let e = !1;
1867
- for (const n of r) p(() => n(t)) && (e = !0);
1868
- return e;
1869
- }
1870
- };
1871
- }({
1872
- push: (t) => a?.push(t),
1873
- flush: () => a?.flush("submit"),
1874
- sanitizeUrl: r.sanitizeUrl,
1875
- ignoredOrigins: f,
1876
- host: r.host,
1877
- getTabId: () => c?.getTabId() ?? "",
1878
- captureElementLevel: r.capture?.element ?? K,
1879
- peekNextSequence: () => a?.peekNextSequence() ?? 0,
1880
- registerEventRouter: (t) => (a?.setEventRouter(t), function() {
1881
- a?.getEventRouter() === t && a.setEventRouter(null);
1882
- }),
1883
- requeueEvents: (t) => a?.requeue(t)
1884
- }, i, r.capture?.content), y = function(t) {
1885
- let e = !1;
1886
- function n(e) {
1887
- p(() => t.isActivityActive()) && (p(() => t.holdCapacityFlush(function() {
1888
- p(() => t.readBehaviour(e)), "pagehide" === e && p(() => t.stopTab());
1889
- })), p(() => t.flush()), "pagehide" === e && (t.getShouldSkipStopActivity() || t.stopActivity()));
1890
- }
1891
- const i = v((t) => {
1892
- "hidden" === document.visibilityState && n("hidden");
1893
- }), r = v((t) => {
1894
- n("pagehide");
1895
- }), s = v((t) => {
1896
- n("beforeunload");
1897
- }), o = v((e) => {
1898
- e.persisted && t.resume();
1899
- }), a = v(() => t.onConnectionChange());
1900
- return {
1901
- start: function() {
1902
- u(document, "visibilitychange", i), u(window, "pagehide", r), function() {
1903
- if ("undefined" == typeof navigator) return !1;
1904
- const t = navigator.userAgentData;
1905
- return t && "boolean" == typeof t.mobile ? !t.mobile : !/Mobi|Android|iPhone|iPad|iPod/i.test(navigator.userAgent ?? "");
1906
- }() && !/Firefox\//.test(navigator.userAgent ?? "") && (u(window, "beforeunload", s), e = !0), u(window, "pageshow", o), u(window, "online", a), u(window, "offline", a);
1907
- },
1908
- stop: function() {
1909
- h(document, "visibilitychange", i), h(window, "pagehide", r), e && (h(window, "beforeunload", s), e = !1), h(window, "pageshow", o), h(window, "online", a), h(window, "offline", a);
1910
- },
1911
- onHide: n
1912
- };
1913
- }({
1914
- readBehaviour: (t) => d.readBehaviour(t),
1915
- isActivityActive: () => o?.isActive() ?? !1,
1916
- holdCapacityFlush: (t) => {
1917
- a ? a.holdCapacityFlush(t) : t();
1918
- },
1919
- flush: () => a?.flush("lifecycle"),
1920
- stopActivity: async () => o?.stop(),
1921
- stopTab: () => c?.stop(),
1922
- getShouldSkipStopActivity: () => (c?.queryTabsNumber() ?? 0) > 1,
1923
- onConnectionChange: () => a?.onConnectionChange(),
1924
- resume: async () => {
1925
- try {
1926
- await o?.start(), await c?.start();
1927
- } catch (t) {
1928
- e.warn("IncodeTRI", "resume after bfcache restore failed:", t);
1929
- }
1930
- }
1931
- }), w = new Ft({
1932
- getActivityId: () => o?.getActivityId() ?? "",
1933
- reportEvent: (t) => s.api.reportEvent(t)
1934
- });
1935
- return {
1936
- status: "ready",
1937
- managers: {
1938
- falconServiceManager: s,
1939
- activityManager: o,
1940
- transportManager: a,
1941
- tabManager: c,
1942
- lifecycleManager: y,
1943
- collectorManager: d,
1944
- eventReportManager: w
1945
- }
1946
- };
1947
- } catch (t) {
1948
- return e.warn("IncodeTRI", "setup() failed during construction:", t), { status: "init-failed" };
1949
- }
1950
- }
1951
- let Ut = class t {
1952
- constructor() {
1953
- this.qt = 0, this.Dt = null, this.Ot = F;
1954
- }
1955
- static get instance() {
1956
- return t.i || (t.i = new t()), t.i;
1957
- }
1958
- async setup(t) {
1959
- if (this.Ot !== F) return e.fatal("error", "setup()", `cannot set up from state '${this.Ot}' — call reset() (or reload) first. Ignoring.`), H;
1960
- try {
1961
- const n = function(t) {
1962
- if ("undefined" == typeof document) return e.fatal("error", "IncodeTRI", "TRI is not available in a non-browser environment."), null;
1963
- if (!t?.token) return e.fatal("error", "SDK", "token is required."), null;
1964
- if (!t.apiURL) return e.fatal("error", "SDK", "Couldn't initialise SDK — apiURL isn't provided."), null;
1965
- const { element: n, content: i } = t.capture ?? {}, r = {
1966
- token: t.token,
1967
- capture: {
1968
- element: n ?? K,
1969
- content: i ?? "off"
1970
- },
1971
- api: {
1972
- version: t.apiVersion ?? "1.0",
1973
- url: t.apiURL
1974
- },
1975
- sanitizeUrl: (o = t.sanitizeUrl, o ? function(t) {
1976
- return p(() => o(t, O)) ?? O(t);
1977
- } : O),
1978
- host: (s = t.host, "string" == typeof s?.platform && "" !== s.platform && "string" == typeof s.version && "" !== s.version ? {
1979
- platform: s.platform,
1980
- version: s.version
1981
- } : (void 0 !== s && e.warn("SDK", "host needs a non-empty platform and version — reporting TRI itself."), {
1982
- platform: "tri-web",
1983
- version: "0.5.1"
1984
- })),
1985
- DEBUG: t.DEBUG ?? !1
1986
- };
1987
- var s, o;
1988
- return void 0 === t.collectors && void 0 === t.layers ? {
1989
- sdk: r,
1990
- collectors: V()
1991
- } : void 0 !== t.collectors ? {
1992
- sdk: r,
1993
- collectors: G(t.collectors)
1994
- } : {
1995
- sdk: r,
1996
- collectors: Z(t.layers)
1997
- };
1998
- }(t);
1999
- if (!n) return this.Ot = H, H;
2000
- e.DEBUG = n.sdk.DEBUG;
2001
- const i = await jt(n, { getProfileId: () => null });
2002
- return "collection-disabled" === i.status ? (e.fatal("warn", "setup()", "Collection is disabled for the provided API Key."), this.Ot = N, N) : "init-failed" === i.status ? (this.Ot = H, H) : (this.Dt = i.managers, this.Ot = j, !1 !== t.autostart ? this.start() : j);
2003
- } catch (t) {
2004
- return e.warn("setup()", "failed:", t), this.Ot = H, H;
2005
- }
2006
- }
2007
- async start() {
2008
- if (this.Ot === F) return e.warn("start()", "start() requires a prior successful setup() — ignoring."), this.Ot;
2009
- if (this.Ot !== j) return e.fatal("warn", "start()", "TRI is either already started or isn't ready — ignoring."), this.Ot;
2010
- this.Ot = "starting";
2011
- const t = ++this.qt;
2012
- return await this.S(t), this.Ot;
2013
- }
2014
- async stop() {
2015
- e.warn("stop()", "called");
2016
- const t = this.Dt;
2017
- return t ? (++this.qt, t.lifecycleManager.stop(), t.collectorManager.stop(), t.tabManager.stop(), t.eventReportManager.stop(), this.Ot = j, this.Ft(t)) : Promise.resolve(this.Ot);
2018
- }
2019
- async reset() {
2020
- const t = this.stop();
2021
- return this.Ot = F, this.Dt = null, t.then(() => this.Ot);
2022
- }
2023
- async Ft(t) {
2024
- return await function(t) {
2025
- let e = null;
2026
- const n = new Promise((t) => {
2027
- e = g(t, 2e3);
2028
- });
2029
- return Promise.race([t.finally(() => m(e)), n]);
2030
- }(Promise.resolve(t.transportManager.stop())), await t.activityManager.stop(), this.Ot;
2031
- }
2032
- async S(t) {
2033
- const n = this.Dt;
2034
- if (n) {
2035
- try {
2036
- if (await n.activityManager.start(), t !== this.qt) return;
2037
- if (n.transportManager.start(), await n.tabManager.start(), t !== this.qt) return;
2038
- n.lifecycleManager.start(), n.collectorManager.autocapture();
2039
- } catch (n) {
2040
- e.warn("start()", "failed during monitoring start:", n), t === this.qt && (this.Ot = j);
2041
- return;
2042
- }
2043
- t === this.qt && (this.Ot = U);
2044
- }
2045
- }
2046
- async linkInterview(t) {
2047
- if (this.Ot !== U || !this.Dt) return e.warn("linkInterview()", "linkInterview() called before start() completed — ignoring."), !1;
2048
- if (!t) return e.warn("linkInterview()", "linkInterview() called without sessionToken — ignoring."), !1;
2049
- try {
2050
- return (await this.Dt.falconServiceManager.api.linkInterview(t)).ok;
2051
- } catch (t) {
2052
- return e.warn("linkInterview()", "failed:", t), !1;
2053
- }
2054
- }
2055
- async getFpSignals() {
2056
- if (this.Ot !== U) return e.warn("getFpSignals()", "getFpSignals() called before start() completed — ignoring."), null;
2057
- try {
2058
- return await (I ?? Promise.resolve(null));
2059
- } catch (t) {
2060
- return e.warn("getFpSignals()", "failed:", t), null;
2061
- }
2062
- }
2063
- addFpSignals(t) {
2064
- const n = this.Dt;
2065
- if (this.Ot !== U || !n) return e.warn("addFpSignals()", "addFpSignals() called before start() completed — ignoring."), !1;
2066
- if (n.collectorManager.isRunning("fpsignals")) return e.warn("addFpSignals()", "the fpsignals collector is on and sends its own results — ignoring."), !1;
2067
- if ("string" != typeof t || !t) return e.warn("addFpSignals()", "signals is empty — ignoring."), !1;
2068
- try {
2069
- return n.transportManager.push({
2070
- name: "fp_signals",
2071
- timestamp: Date.now(),
2072
- signals: t
2073
- }), !0;
2074
- } catch (t) {
2075
- return e.warn("addFpSignals()", "failed:", t), !1;
2076
- }
2077
- }
2078
- getActivityId() {
2079
- const t = this.Dt;
2080
- if (this.Ot !== U || !t) return e.warn("getActivityId()", "getActivityId() called before start() completed — returning null."), null;
2081
- try {
2082
- const { activityManager: e } = t;
2083
- return e.isActive() && e.getActivityId() || null;
2084
- } catch (t) {
2085
- return e.warn("getActivityId()", "failed:", t), null;
2086
- }
2087
- }
2088
- };
2089
- async function Nt(t, e) {
2090
- const n = function(t) {
2091
- if ("string" != typeof t) return null;
2092
- const e = t.trim();
2093
- try {
2094
- const { protocol: t } = new URL(e);
2095
- return "http:" === t || "https:" === t ? e : null;
2096
- } catch {
2097
- return null;
2098
- }
2099
- }(e?.apiURL);
2100
- if (!n) return {
2101
- token: null,
2102
- expiresAt: null,
2103
- tokenType: null,
2104
- eventsCollectionEnabled: !1,
2105
- error: {
2106
- status: 0,
2107
- message: "[TRI] createSession: apiURL must be an absolute http(s) URL."
2108
- }
2109
- };
2110
- const i = e?.timeout ?? 1e4, r = new AbortController();
2111
- let s = null, o = !1, a = () => {};
2112
- i && (s = g(() => {
2113
- o = !0, r.abort();
2114
- }, i));
2115
- const c = e?.signal;
2116
- if (c) if (c.aborted) r.abort();
2117
- else {
2118
- const t = () => r.abort();
2119
- c.addEventListener("abort", t, { once: !0 }), a = () => c.removeEventListener("abort", t);
2120
- }
2121
- try {
2122
- const e = await fetch(`${n}/api/v1/sdk/init`, {
2123
- method: "POST",
2124
- headers: {
2125
- "content-type": "application/json",
2126
- "x-api-key": t,
2127
- "x-api-version": "1.0"
2128
- },
2129
- signal: r.signal
2130
- });
2131
- if (!e.ok) {
2132
- let t = e.statusText;
2133
- try {
2134
- const n = await e.json();
2135
- n.errorMessage && (t = n.errorMessage);
2136
- } catch {}
2137
- return {
2138
- token: null,
2139
- expiresAt: null,
2140
- tokenType: null,
2141
- eventsCollectionEnabled: !1,
2142
- error: {
2143
- status: e.status,
2144
- message: t
2145
- }
2146
- };
2147
- }
2148
- const i = await e.json();
2149
- return {
2150
- token: i.token,
2151
- expiresAt: i.expiresAt,
2152
- tokenType: i.tokenType,
2153
- eventsCollectionEnabled: !0,
2154
- error: null
2155
- };
2156
- } catch (t) {
2157
- throw new Error((o ? "[TRI] createSession timed out" : "[TRI] Failed to create session:") + " " + t.message);
2158
- } finally {
2159
- m(s), a();
2160
- }
2161
- }
2162
- Ut.i = null;
2163
- const Ht = Ut.instance;
2164
- //#endregion
2165
- export { Nt as createSession, Ht as default };