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

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 (239) hide show
  1. package/dist/{BaseWasmProvider-Bq3OHo7P.d.ts → BaseWasmProvider-bBNquvYn.d.ts} +2 -2
  2. package/dist/BrowserNetworkStatusProvider-BrDXBEDd.esm.js +21 -0
  3. package/dist/{multipartRecordingService-DMBxHKS2.esm.js → CameraCompositor-DN7NkJzV.esm.js} +7 -734
  4. package/dist/DateFormattingProvider-DPq9zco-.esm.js +25 -0
  5. package/dist/{FaceDetectionProvider-B83VmClw.esm.js → FaceDetectionProvider-BSLpXAGx.esm.js} +11 -12
  6. package/dist/{IIdCaptureCapability-CGcEt2Cw.d.ts → IIdCaptureCapability-C-5M8pP1.d.ts} +2 -2
  7. package/dist/{IWasmUtilCapability-Cqiaxydi.d.ts → IWasmUtilCapability-BRn0wz8v.d.ts} +2 -2
  8. package/dist/MultipartRecordingProvider-BfQPSgSO.esm.js +151 -0
  9. package/dist/{StreamCanvasCapture-C3xNfOsv.d.ts → StreamCanvasCapture-ixfy84ys.d.ts} +2 -2
  10. package/dist/StreamCanvasProcessingSession-CBnbTnOr.esm.js +42 -0
  11. package/dist/{WasmUtilProvider-GTkoJyFY.esm.js → WasmUtilProvider-C_puwvVn.esm.js} +2 -2
  12. package/dist/WorkerEncoderRecordingProvider-CyCrQnZR.esm.js +80 -0
  13. package/dist/addressSearch-B_4JYKa-.esm.js +72 -0
  14. package/dist/ae-signature.esm.js +1 -1
  15. package/dist/antifraud.esm.js +2 -2
  16. package/dist/{antifraudManager-CQ08atTC.esm.js → antifraudManager-BWCVkSu2.esm.js} +2 -2
  17. package/dist/{antifraudStateMachine-BcsUTTIr.esm.js → antifraudStateMachine-CX9I2f3s.esm.js} +1 -1
  18. package/dist/{api-BO8JA7Pf.esm.js → api-BSnbg4HO.esm.js} +4 -0
  19. package/dist/{apiError-CfuIvnUy.esm.js → apiError-Bmwy1Fa7.esm.js} +1 -1
  20. package/dist/{attemptCarry-BjTJ6bMQ.esm.js → attemptCarry-zQH85Elh.esm.js} +2 -2
  21. package/dist/authentication.d.ts +3 -3
  22. package/dist/authentication.esm.js +2 -2
  23. package/dist/{authenticationManager-DvmklBTE.esm.js → authenticationManager-BoiOaB0m.esm.js} +5 -5
  24. package/dist/{authenticationManager-C-cOki0Y.d.ts → authenticationManager-CISxaY6N.d.ts} +1 -1
  25. package/dist/{authenticationStateMachine-BL2ptOA0.esm.js → authenticationStateMachine-BMD1JLwr.esm.js} +3 -3
  26. package/dist/avatar.d.ts +1 -1
  27. package/dist/backCameraLabel-yda5ugE4.esm.js +67 -0
  28. package/dist/{backCameraStream-C5_NNfUN.esm.js → backCameraStream-DS1oDiUq.esm.js} +10 -65
  29. package/dist/{browser-pQZA35G2-DtkAf6sn.esm.js → browser-pQZA35G2-PIj2uGBm.esm.js} +1 -1
  30. package/dist/camera.d.ts +2 -2
  31. package/dist/camera.esm.js +1 -1
  32. package/dist/certificate-issuance.esm.js +2 -2
  33. package/dist/{certificateIssuanceManager-CM0fuqDC.esm.js → certificateIssuanceManager-DzDuQTsK.esm.js} +2 -2
  34. package/dist/{certificateIssuanceStateMachine-kksIUOPD.esm.js → certificateIssuanceStateMachine-BAOYLACb.esm.js} +2 -2
  35. package/dist/{connectivity-HSl0diCx.esm.js → connectivity-BCuEoQ-n.esm.js} +2 -21
  36. package/dist/consent.d.ts +1 -1
  37. package/dist/consent.esm.js +2 -2
  38. package/dist/{consentManager-_q9yJUku.d.ts → consentManager-7aHaehwF.d.ts} +5 -5
  39. package/dist/{consentManager-CBwFozhv.esm.js → consentManager-DFSKQTcR.esm.js} +2 -2
  40. package/dist/{consentStateMachine-CpmRAcr2.esm.js → consentStateMachine-4nZIH2O8.esm.js} +1 -1
  41. package/dist/{cpf-uAZTPUBy.esm.js → cpf-BIADjddF.esm.js} +1 -25
  42. package/dist/{createFaceAvatar-lYX0VTYs.d.ts → createFaceAvatar-BimBTONm.d.ts} +1 -1
  43. package/dist/cross-document-data-match.esm.js +1 -1
  44. package/dist/{crossDocumentDataMatchManager-64O8t10a.esm.js → crossDocumentDataMatchManager-D7ka2qOC.esm.js} +2 -2
  45. package/dist/curp-validation.d.ts +1 -1
  46. package/dist/curp-validation.esm.js +2 -2
  47. package/dist/{curpValidationManager-CLgJQcx0.esm.js → curpValidationManager-BVTt7IgC.esm.js} +2 -2
  48. package/dist/{curpValidationManager-CXpFE-Mv.d.ts → curpValidationManager-DEqTUWdu.d.ts} +1 -1
  49. package/dist/{curpValidationStateMachine-Bx9YhVkJ.esm.js → curpValidationStateMachine-FB_MRbZQ.esm.js} +2 -2
  50. package/dist/custom-fields.esm.js +1 -1
  51. package/dist/custom-watchlist.esm.js +2 -2
  52. package/dist/{customFieldsManager-DWt_0YtJ.esm.js → customFieldsManager-gbsq53p6.esm.js} +2 -2
  53. package/dist/{customWatchlistManager-D8o-2Nej.esm.js → customWatchlistManager-50APwk4Z.esm.js} +2 -2
  54. package/dist/{customWatchlistStateMachine-Sbi6DIcK.esm.js → customWatchlistStateMachine-CpEVPzuT.esm.js} +1 -1
  55. package/dist/{deepsightService-twg3bXqY.esm.js → deepsightLoader-BKCT8UT1.esm.js} +34 -29
  56. package/dist/definitionSource-BHNxbuiv.esm.js +184 -0
  57. package/dist/{desktopCameraElection-kHY2IDJi.esm.js → desktopCameraElection-Dvvw7PRY.esm.js} +5 -5
  58. package/dist/document-capture.d.ts +3 -3
  59. package/dist/document-capture.esm.js +2 -2
  60. package/dist/{documentCaptureManager-CMSC_Mhd.esm.js → documentCaptureManager-BG5TuqJz.esm.js} +3 -2
  61. package/dist/{documentCaptureManager-6tnnDkMX.d.ts → documentCaptureManager-DDfviFg0.d.ts} +25 -4
  62. package/dist/{documentCaptureStateMachine-BCwD5Rto.esm.js → documentCaptureStateMachine-C7PW_Ah9.esm.js} +67 -26
  63. package/dist/dynamic-forms.esm.js +2 -2
  64. package/dist/{dynamicFormsManager-DU6W1e20.esm.js → dynamicFormsManager-B0bpHhhJ.esm.js} +2 -2
  65. package/dist/{dynamicFormsStateMachine-C8Z7k3vo.esm.js → dynamicFormsStateMachine-2ZHyejBc.esm.js} +2 -2
  66. package/dist/ekyb.d.ts +4 -4
  67. package/dist/ekyb.esm.js +3 -3
  68. package/dist/{ekybManager-TB6ZG5lX.d.ts → ekybManager-BLOkwmWO.d.ts} +2 -2
  69. package/dist/{ekybManager-TGfqyjuu.esm.js → ekybManager-P9mC7W9J.esm.js} +2 -2
  70. package/dist/{ekybStateMachine-DBgFuEPK.esm.js → ekybStateMachine-C7HKaeVr.esm.js} +7 -3
  71. package/dist/ekybUtils-Cw8Ta9Qi.esm.js +140 -0
  72. package/dist/ekyc-prefill.d.ts +17 -0
  73. package/dist/ekyc-prefill.esm.js +3 -0
  74. package/dist/ekyc.d.ts +3 -2
  75. package/dist/ekyc.esm.js +3 -3
  76. package/dist/{ekycManager-C2cgG2Pl.esm.js → ekycManager-CeeJoRFY.esm.js} +2 -2
  77. package/dist/{ekycManager-BSQteIfC.d.ts → ekycManager-q1fos6IY.d.ts} +2 -1
  78. package/dist/ekycPrefillManager-C6BFFKxc.esm.js +102 -0
  79. package/dist/ekycPrefillManager-PPGVZbWk.d.ts +565 -0
  80. package/dist/ekycPrefillStateMachine-Dku90kZL.esm.js +686 -0
  81. package/dist/ekycRules-BLX7Elcb.esm.js +319 -0
  82. package/dist/{ekycStateMachine-CuNF7z4O.esm.js → ekycStateMachine-DBTczgGE.esm.js} +719 -596
  83. package/dist/{ekycUtils-BFncpC4F.esm.js → ekycUtils-Dcff8BOD.esm.js} +103 -14
  84. package/dist/electronic-signature.esm.js +1 -1
  85. package/dist/{electronicSignatureManager-C7pqXsRm.esm.js → electronicSignatureManager-BKQuhJm_.esm.js} +4 -4
  86. package/dist/email.esm.js +2 -2
  87. package/dist/{emailManager-FH_CP0cT.esm.js → emailManager-CGmKbsBL.esm.js} +2 -2
  88. package/dist/{emailStateMachine-Cx-uTaBV.esm.js → emailStateMachine-CGY1UGs2.esm.js} +2 -2
  89. package/dist/{events-CQteqXfy.esm.js → events-C7h7oaTE.esm.js} +1 -1
  90. package/dist/events.esm.js +1 -1
  91. package/dist/extensibility.d.ts +20 -18
  92. package/dist/extensibility.esm.js +37 -35
  93. package/dist/{externalFetch-CQY41QT1.esm.js → externalFetch-cUjJYyXj.esm.js} +1 -1
  94. package/dist/face-match.d.ts +1 -1
  95. package/dist/face-match.esm.js +2 -2
  96. package/dist/{faceCaptureManagerFactory-C-xKdj-d.d.ts → faceCaptureManagerFactory-BVwVGa3z.d.ts} +7 -7
  97. package/dist/{faceCaptureManagerFactory-CBm05KnT.esm.js → faceCaptureManagerFactory-ClFsByZc.esm.js} +4 -4
  98. package/dist/{faceCaptureSetup-BQjCbL51.esm.js → faceCaptureSetup-9hv5GC_H.esm.js} +12 -403
  99. package/dist/{faceMatchManager-Z4UDLwAv.d.ts → faceMatchManager-BZtEw6bB.d.ts} +9 -3
  100. package/dist/{faceMatchManager-B2zp7yP4.esm.js → faceMatchManager-CRe7Nvm6.esm.js} +2 -2
  101. package/dist/{faceMatchStateMachine-ByTMQCUC.esm.js → faceMatchStateMachine-EX9QhxFE.esm.js} +28 -14
  102. package/dist/{feature-management-DjAG5lsJ.esm.js → feature-management-CmKTG_T5.esm.js} +35 -21
  103. package/dist/feature-management.esm.js +1 -1
  104. package/dist/field-comparison.esm.js +1 -1
  105. package/dist/{fieldComparisonManager-CC0vKmpf.esm.js → fieldComparisonManager-DuosZJso.esm.js} +2 -2
  106. package/dist/fiscal-qr.esm.js +1 -1
  107. package/dist/{fiscalQrManager-Be-r4oZj.esm.js → fiscalQrManager-ji0qDaTW.esm.js} +3 -3
  108. package/dist/flow-events.d.ts +1 -1
  109. package/dist/flow.d.ts +33 -18
  110. package/dist/flow.esm.js +82 -17
  111. package/dist/{flowCompletionService-ChMU2v79.esm.js → flowCompletionService-DvcH16XO.esm.js} +24 -3
  112. package/dist/{flowServices-g2tVWsJl.esm.js → flowServices-Ca2vKNt2.esm.js} +84 -139
  113. package/dist/geolocation.esm.js +2 -2
  114. package/dist/{geolocationManager-DLbvZwUB.esm.js → geolocationManager-CiG32lIm.esm.js} +2 -2
  115. package/dist/{geolocationStateMachine-CAJVongM.esm.js → geolocationStateMachine-5rnTEOuw.esm.js} +3 -3
  116. package/dist/government-validation.esm.js +2 -2
  117. package/dist/{governmentValidationManager-CkX9TEkh.esm.js → governmentValidationManager-BivVZNVe.esm.js} +2 -2
  118. package/dist/{governmentValidationStateMachine-PTPCP26N.esm.js → governmentValidationStateMachine-CeSDNgha.esm.js} +1 -1
  119. package/dist/home.d.ts +1 -1
  120. package/dist/home.esm.js +1 -1
  121. package/dist/http.esm.js +1 -1
  122. package/dist/id-ocr.d.ts +2 -2
  123. package/dist/id-ocr.esm.js +3 -19
  124. package/dist/id-selfie-flow.d.ts +3 -3
  125. package/dist/id-selfie-flow.esm.js +10 -9
  126. package/dist/id-verification.esm.js +2 -2
  127. package/dist/id.d.ts +4 -4
  128. package/dist/id.esm.js +4 -4
  129. package/dist/{idCaptureDefaults-MSQoqScU.esm.js → idCaptureDefaults-DBnOC28H.esm.js} +3 -3
  130. package/dist/{idCaptureManager-zZdTcpG1.esm.js → idCaptureManager-B5xqok0L.esm.js} +9 -8
  131. package/dist/{idCaptureManager-DzTfQ1Am.d.ts → idCaptureManager-CG8zbAp0.d.ts} +10 -8
  132. package/dist/{idCaptureServices-8OHinO0N.esm.js → idCaptureServices-BIF_7rub.esm.js} +27 -196
  133. package/dist/{idCaptureStateMachine-B3G6XoDG.esm.js → idCaptureStateMachine-B5cfgKvn.esm.js} +50 -22
  134. package/dist/idOcrCpfUtils-Nfln1Psb.esm.js +18 -0
  135. package/dist/{idOcrManager-DT3kPIB3.d.ts → idOcrManager-B5xeI2lg.d.ts} +3 -3
  136. package/dist/{idOcrManager-B64-fjWg.esm.js → idOcrManager-DNbVTMIu.esm.js} +2 -2
  137. package/dist/{idOcrStateMachine-B1aZnobs.esm.js → idOcrStateMachine-MAGnpWkb.esm.js} +8 -7
  138. package/dist/{idVerificationManager-_Kebv-Ue.esm.js → idVerificationManager-BEAkamNm.esm.js} +2 -2
  139. package/dist/{idVerificationStateMachine-DQn6c84z.esm.js → idVerificationStateMachine-D5mBN2Ye.esm.js} +1 -1
  140. package/dist/identity-reuse.esm.js +2 -2
  141. package/dist/{identityReuseManager-DDXkNVZi.esm.js → identityReuseManager-M8-BTjar.esm.js} +2 -2
  142. package/dist/{identityReuseStateMachine-Bcnkbjf8.esm.js → identityReuseStateMachine-D5bXgw9h.esm.js} +1 -1
  143. package/dist/{index-DEfwds5y.d.ts → index-Btj1EhiM.d.ts} +43 -19
  144. package/dist/{index-DMDAk85K.d.ts → index-CSPOoqah.d.ts} +1 -1
  145. package/dist/index.d.ts +1 -1
  146. package/dist/index.esm.js +1 -1
  147. package/dist/{invokeOnCaptureCallback-CXIBwBeE.esm.js → invokeOnCaptureCallback-C1-j4fsq.esm.js} +1 -1
  148. package/dist/kyb-checks.d.ts +3 -0
  149. package/dist/kyb-checks.esm.js +3 -0
  150. package/dist/kybChecksManager-CblEL97E.d.ts +95 -0
  151. package/dist/kybChecksManager-CnqwgKoV.esm.js +89 -0
  152. package/dist/kybChecksStateMachine-Be41K_NS.esm.js +719 -0
  153. package/dist/mandatory-consent.d.ts +2 -2
  154. package/dist/mandatory-consent.esm.js +2 -2
  155. package/dist/{mandatoryConsentManager-xx3mY-xw.d.ts → mandatoryConsentManager-CYOJd_IZ.d.ts} +20 -11
  156. package/dist/{mandatoryConsentManager-43W5d_8G.esm.js → mandatoryConsentManager-LFhUlLvO.esm.js} +2 -2
  157. package/dist/{mandatoryConsentStateMachine-CVlgdlnt.esm.js → mandatoryConsentStateMachine-DTSyDqQs.esm.js} +11 -5
  158. package/dist/mediaRecorderOptions-B9-IEVtV.esm.js +70 -0
  159. package/dist/multipartRecordingService-CCiRpByl.esm.js +407 -0
  160. package/dist/{permissionGuards-B3OPL8Si.esm.js → permissionGuards-DjQUR1du.esm.js} +1 -1
  161. package/dist/{permissionServices-DnBAN_hW.esm.js → permissionServices-CZpORUWY.esm.js} +8 -6
  162. package/dist/phone.esm.js +2 -2
  163. package/dist/phoneFormat-DEpESpz2.esm.js +87 -0
  164. package/dist/{phoneManager-C6jut_pz.esm.js → phoneManager-C-qD3p3N.esm.js} +3 -3
  165. package/dist/phoneServices-BdR1nmSO.esm.js +77 -0
  166. package/dist/{phoneStateMachine-T1-drWfG.esm.js → phoneStateMachine-2FMTdjtJ.esm.js} +20 -60
  167. package/dist/{processFaceMatch-BWme3kVV.esm.js → processFaceMatch-B1YnoBer.esm.js} +1 -1
  168. package/dist/qe-signature.esm.js +1 -1
  169. package/dist/recordingService-BVSCo0ac.esm.js +397 -0
  170. package/dist/redirect-to-mobile.esm.js +2 -2
  171. package/dist/{redirectToMobileManager-BJXC6Kx9.esm.js → redirectToMobileManager-CqyDfDxs.esm.js} +3 -3
  172. package/dist/{redirectToMobileStateMachine-BBMAc2Gb.esm.js → redirectToMobileStateMachine-CXqfo2Gd.esm.js} +40 -22
  173. package/dist/resolveForm-f9PhUo9j.esm.js +143 -0
  174. package/dist/{runChildModule-DPHTqSdF.esm.js → runChildModule-BmteMhR7.esm.js} +2 -2
  175. package/dist/{sdkVersion-C3_P-Qbq.esm.js → sdkVersion-KZROt6l3.esm.js} +1 -1
  176. package/dist/selfie.d.ts +4 -4
  177. package/dist/selfie.esm.js +10 -10
  178. package/dist/{selfieErrorUtils-BL0BLMnp.esm.js → selfieErrorUtils-fqxp645p.esm.js} +1 -1
  179. package/dist/{selfieManager-Cbliomv7.esm.js → selfieManager-A-n3k9Tu.esm.js} +5 -5
  180. package/dist/{selfieManager-BMmpUii2.d.ts → selfieManager-DREuBhXZ.d.ts} +1 -1
  181. package/dist/{selfieStateMachine-B5m_Kn0O.esm.js → selfieStateMachine-48PKdKrw.esm.js} +3 -3
  182. package/dist/{session-DAaAewMX.esm.js → session-D0DWDKp9.esm.js} +4 -4
  183. package/dist/session.d.ts +2 -2
  184. package/dist/session.esm.js +6 -6
  185. package/dist/{sessionInitializer-CWFT4dfw.esm.js → sessionInitializer-I92b2dmL.esm.js} +94 -24
  186. package/dist/{setup-CDAKwTr7.esm.js → setup-BpjzWqR1.esm.js} +25 -27
  187. package/dist/{setup-D9qt8YVU.d.ts → setup-CG6oLkAa.d.ts} +2 -2
  188. package/dist/signature.esm.js +2 -2
  189. package/dist/{signatureManager-BeEVCcsC.esm.js → signatureManager-M9vQBj19.esm.js} +2 -2
  190. package/dist/{signatureStateMachine-_1c1vSid.esm.js → signatureStateMachine-0_frzAN5.esm.js} +1 -1
  191. package/dist/{stats-BpMz-hTP.esm.js → stats-C2sigf9p.esm.js} +1 -1
  192. package/dist/stats.esm.js +1 -1
  193. package/dist/step-up.d.ts +378 -0
  194. package/dist/step-up.esm.js +639 -0
  195. package/dist/textRules-D4NRinKY.d.ts +41 -0
  196. package/dist/{tri-BajQnjbf.esm.js → tri-DaUNvo-o.esm.js} +29 -34
  197. package/dist/tri.d.ts +2 -2
  198. package/dist/tri.esm-Df5eKLsY.esm.js +2165 -0
  199. package/dist/tri.esm.js +2 -2
  200. package/dist/{trueSightService-BujtUIW6.esm.js → trueSightService-DHYTBCIn.esm.js} +4 -4
  201. package/dist/trust-graph.esm.js +1 -1
  202. package/dist/types-B-PIc0en.d.ts +115 -0
  203. package/dist/{types-C397LhmN.d.ts → types-BgRHw-dR.d.ts} +1 -1
  204. package/dist/{types-CJ7Yl9K-.d.ts → types-Bpo97EOh.d.ts} +4 -2
  205. package/dist/{types-xEEWCx1j.d.ts → types-BqlZSoZ-.d.ts} +5 -5
  206. package/dist/types-CTaL0XJz.d.ts +80 -0
  207. package/dist/{types-e8fCsvvk.d.ts → types-Cbm9J2yF.d.ts} +1 -1
  208. package/dist/{types--3HDl2SF.d.ts → types-CgihAhT_.d.ts} +3 -3
  209. package/dist/{types-ZTZelfbM.d.ts → types-CyNndVAT.d.ts} +14 -6
  210. package/dist/{types-B2FK_wYb.d.ts → types-DEa3taWc.d.ts} +9 -41
  211. package/dist/{types-PTZHRhGX.d.ts → types-P9LzsfRo.d.ts} +3 -2
  212. package/dist/{types-DuD8TRJU.d.ts → types-TisHEbBg.d.ts} +12 -4
  213. package/dist/types-kLsU6Jkt.d.ts +6 -0
  214. package/dist/{urlUtils-eYiyWjh0.esm.js → urlUtils-B2wagB5v.esm.js} +14 -1
  215. package/dist/usStates-CwOQ2kAx.esm.js +209 -0
  216. package/dist/video-selfie.d.ts +5 -4
  217. package/dist/video-selfie.esm.js +9 -7
  218. package/dist/{videoSelfieCameraWarmer-DjkPpoj_.esm.js → videoSelfieCameraWarmer-CTOpqhov.esm.js} +16 -14
  219. package/dist/{videoSelfieStepDetector-RfSmlFFW.d.ts → videoSelfieStepDetector-4XE2QI5q.d.ts} +4 -4
  220. package/dist/virtualCameraCheck-eFOm2C9q.esm.js +27 -0
  221. package/dist/{warmup-BkfxQZsC.esm.js → warmup-9iKKNNuW.esm.js} +69 -20
  222. package/dist/{warmup-BO57syF6.d.ts → warmup-BNhIuURi.d.ts} +18 -2
  223. package/dist/wasm.d.ts +9 -3
  224. package/dist/wasm.esm.js +3 -3
  225. package/dist/{wasmDsFlagSync-BhU5H2oR.esm.js → wasmDsFlagSync-lRIgn5Ic.esm.js} +1 -1
  226. package/dist/{wasmWebClient-DTj9auyA.esm.js → wasmWebClient-C3v3s_4H.esm.js} +34 -19
  227. package/dist/watchlist-for-business.esm.js +2 -2
  228. package/dist/watchlist.esm.js +2 -2
  229. package/dist/{watchlistForBusinessManager-CVay6-9A.esm.js → watchlistForBusinessManager-C1S5y5yj.esm.js} +2 -2
  230. package/dist/{watchlistForBusinessStateMachine-DA6K5na4.esm.js → watchlistForBusinessStateMachine-Bj_hnoK5.esm.js} +1 -1
  231. package/dist/{watchlistManager-B8gQ_rw3.esm.js → watchlistManager-BpegtZbc.esm.js} +2 -2
  232. package/dist/{watchlistStateMachine-CSi_ZhtT.esm.js → watchlistStateMachine-Bgkh1gra.esm.js} +1 -1
  233. package/dist/workflow.d.ts +226 -41
  234. package/dist/workflow.esm.js +163 -67
  235. package/package.json +21 -5
  236. package/dist/addressSearch-41sMcnJk.esm.js +0 -604
  237. package/dist/deepsightLoader-DMxtowCm.esm.js +0 -33
  238. package/dist/tri.esm-CzTNi5Q_.esm.js +0 -3826
  239. package/dist/types-D9r3zRfY.d.ts +0 -6
@@ -1,3826 +0,0 @@
1
- const e = class t {
2
- constructor() {
3
- this.i = !1;
4
- }
5
- static get instance() {
6
- return t.o || (t.o = new t()), t.o;
7
- }
8
- get DEBUG() {
9
- return this.i;
10
- }
11
- set DEBUG(t) {
12
- this.i = t;
13
- }
14
- warn(t, e, ...n) {
15
- this.i && this.u("warn", t, e, ...n);
16
- }
17
- error(t, e, ...n) {
18
- this.i && this.u("error", t, e, ...n);
19
- }
20
- info(t, e, ...n) {
21
- this.i && this.u("info", t, e, ...n);
22
- }
23
- fatal(t, e, n, ...i) {
24
- this.u(t, e, n, ...i);
25
- }
26
- u(t, e, n, ...i) {
27
- const o = e ? `[${e}]` : "", r = console?.[t];
28
- r && r(`[IncodeTRI]${o} ${n}`, ...i);
29
- }
30
- }.instance;
31
- const i = {
32
- "fpSignalsLib.js": "4f34fe7685ddf14e1214fff0cfcd368655f3e3c6c5da3e4e0abae34def75c133",
33
- "fpSignalsLib.wasm": "4acba14359630961502ae35296ccccb2b97be8b3ef1bfc4182109bd0213cd77d",
34
- "fpSignalsLibSimd.js": "d98037b6db12cb014dc7220df92a95eb4f2ff1e81acea53903054f8106d872c6",
35
- "fpSignalsLibSimd.wasm": "ba478e2ef6b62e345c2adf5a931f6032a0a6307bfeaae25309cfee3b68cef36d"
36
- };
37
- async function o(t) {
38
- const e = new URL(t).pathname.split("/").pop() ?? "", n = i[e];
39
- if (!n) throw new Error(`fpSignals: no digest for ${e}`);
40
- const o = globalThis.crypto?.subtle;
41
- if (!o) throw new Error("fpSignals: crypto.subtle is unavailable, so the files cannot be verified. Serve the page over HTTPS.");
42
- const r = await fetch(t), s = new Uint8Array(await r.arrayBuffer());
43
- if (function(t) {
44
- let e = "";
45
- for (const n of new Uint8Array(t)) e += n.toString(16).padStart(2, "0");
46
- return e;
47
- }(await o.digest("SHA-256", s)) !== n) throw new Error(`fpSignals: ${e} does not match the pinned build`);
48
- return s;
49
- }
50
- var r;
51
- async function s(t) {
52
- const e = t.replace(/\.wasm($|\?)/, ".js$1"), n = await async function(t) {
53
- const e = await o(t), n = URL.createObjectURL(new Blob([e], { type: "text/javascript" }));
54
- try {
55
- return await import(
56
- /* @vite-ignore */
57
- /* webpackIgnore: true */
58
- n
59
- );
60
- } finally {
61
- URL.revokeObjectURL(n);
62
- }
63
- }(e), i = n.Module ?? n.default;
64
- if (!i) throw new Error(`Failed to import Module from ${e}`);
65
- const r = await o(t), s = window.wasmArrayBuffer;
66
- window.wasmArrayBuffer = r;
67
- try {
68
- return await i({ wasmBinary: r });
69
- } finally {
70
- window.wasmArrayBuffer = s;
71
- }
72
- }
73
- (function(t) {
74
- t[t.Device = 1] = "Device", t[t.Behaviour = 2] = "Behaviour", t[t.PID = 3] = "PID";
75
- })(r || (r = {}));
76
- var a = class {
77
- constructor() {
78
- this.wasmModule = null, this.signalsApi = null, this.usedSimd_ = !1;
79
- }
80
- async initialize(t, n, i = !0) {
81
- if (this.signalsApi) return;
82
- const o = i && !!n;
83
- try {
84
- this.wasmModule = await s(o ? n : t), this.usedSimd_ = o;
85
- } catch (n) {
86
- if (!o) throw n;
87
- e.warn("FpSignals", "SIMD init error:", n), this.wasmModule = await s(t), this.usedSimd_ = !1;
88
- }
89
- this.signalsApi = new this.wasmModule.FpSignals();
90
- }
91
- get usedSimd() {
92
- return this.usedSimd_;
93
- }
94
- isReady() {
95
- return null !== this.signalsApi;
96
- }
97
- setHostInfo(t, e) {
98
- this.api().shi(t, e);
99
- }
100
- async collect() {
101
- const t = this.api();
102
- for (; !t.ppf();) await new Promise((t) => setTimeout(t, 0));
103
- }
104
- setBehaviourCollectionEnabled(t) {
105
- this.api().sbc(t);
106
- }
107
- getSignals(t) {
108
- return this.api().gsd(t);
109
- }
110
- freeResources() {
111
- this.signalsApi && (this.signalsApi.delete(), this.signalsApi = null), this.wasmModule = null;
112
- }
113
- api() {
114
- if (!this.signalsApi) throw new Error("FpSignals has not been initialized");
115
- return this.signalsApi;
116
- }
117
- };
118
- function c(t) {
119
- return !!t && t.nodeType === Node.TEXT_NODE;
120
- }
121
- function u(t, e) {
122
- return t.tagName?.toLowerCase() === e.toLowerCase();
123
- }
124
- function l(t) {
125
- return !!t && t.nodeType === Node.DOCUMENT_FRAGMENT_NODE;
126
- }
127
- function d(t) {
128
- return !!t && t.hasAttribute("data-tri-ignore");
129
- }
130
- function f(t) {
131
- return !!t && t.hasAttribute("data-tri-redact");
132
- }
133
- function h(t, e) {
134
- return e?.includes(t.toLowerCase()) ?? !1;
135
- }
136
- function m(t) {
137
- try {
138
- return new URL(t).origin !== window.location.origin;
139
- } catch {
140
- return !1;
141
- }
142
- }
143
- function p(t, e) {
144
- return !t || (t[e]?.enabled ?? !1);
145
- }
146
- function w() {
147
- const t = document.activeElement;
148
- if (t instanceof HTMLInputElement || t instanceof HTMLTextAreaElement) {
149
- const e = t.selectionStart, n = t.selectionEnd;
150
- return null == e || null == n || e === n ? null : t.value.substring(e, n);
151
- }
152
- const e = window.getSelection();
153
- return !e || e.isCollapsed ? null : e.toString() || null;
154
- }
155
- function y(t, e) {
156
- return "off" !== e && !d(t) && !f(t);
157
- }
158
- function v(t) {
159
- const e = document.activeElement;
160
- if (e instanceof HTMLInputElement || e instanceof HTMLTextAreaElement) return e;
161
- const n = window.getSelection();
162
- return (i = ("start" === t ? n?.anchorNode : n?.focusNode) ?? null) ? c(i) ? i.parentElement : i instanceof Element ? i : null : null;
163
- var i;
164
- }
165
- const g = /* @__PURE__ */ new Set([
166
- "hidden",
167
- "submit",
168
- "button",
169
- "reset",
170
- "image"
171
- ]);
172
- const b = "[data-tri-flush]";
173
- const k = "[data-tri-ignore]";
174
- function T(t, e, n) {
175
- let i = t, o = e;
176
- if ("devicepixelratiochange" === e) {
177
- const t = window.devicePixelRatio;
178
- i = window.matchMedia(`(resolution: ${t}dppx)`), o = "change";
179
- }
180
- i.addEventListener(o, n, {
181
- capture: !0,
182
- passive: !0
183
- });
184
- }
185
- function x(t, e, n) {
186
- let i = t, o = e;
187
- if ("devicepixelratiochange" === e) {
188
- const t = window.devicePixelRatio;
189
- i = window.matchMedia(`(resolution: ${t}dppx)`), o = "change";
190
- }
191
- i.removeEventListener(o, n, { capture: !0 });
192
- }
193
- const S = globalThis.setTimeout.bind(globalThis);
194
- const M = globalThis.clearTimeout.bind(globalThis);
195
- function I(t, n) {
196
- try {
197
- return t();
198
- } catch (t) {
199
- e.warn("utils", "safeSync swallowed error:", t);
200
- }
201
- }
202
- async function E(t) {
203
- try {
204
- return await t();
205
- } catch (t) {
206
- e.warn("utils", "safeAsync swallowed error:", t);
207
- }
208
- }
209
- function _(t) {
210
- return (e) => I(() => t(e));
211
- }
212
- function A(t) {
213
- return (...n) => {
214
- try {
215
- t(...n);
216
- } catch (t) {
217
- e.warn("utils", "safeTimer swallowed error:", t);
218
- }
219
- };
220
- }
221
- function D(t, e) {
222
- return S(A(t), e);
223
- }
224
- function C(t) {
225
- if (null !== t) try {
226
- M(t);
227
- } catch (t) {
228
- e.warn("utils", "safeClearTimeout swallowed error:", t);
229
- }
230
- }
231
- let L = null;
232
- const R = /* @__PURE__ */ new Set([
233
- "xmlhttprequest",
234
- "fetch",
235
- "beacon",
236
- "navigation",
237
- "script",
238
- "link",
239
- "css",
240
- "img",
241
- "iframe",
242
- "video",
243
- "audio"
244
- ]);
245
- const z = /* @__PURE__ */ new Set([
246
- "xmlhttprequest",
247
- "fetch",
248
- "beacon"
249
- ]);
250
- function P(t, e) {
251
- return e ? t : null;
252
- }
253
- function $(t, e) {
254
- const n = t, i = t.responseStart > 0, o = P(t.domainLookupEnd - t.domainLookupStart, i), r = P(t.connectEnd - t.connectStart, i), s = P(t.connectEnd > 0 && t.secureConnectionStart > 0 ? t.connectEnd - t.secureConnectionStart : 0, i), a = P(t.responseStart - t.requestStart, i), c = P(t.responseEnd - t.responseStart, i), u = i ? t.transferSize : null, l = i ? t.encodedBodySize : null, d = i ? t.decodedBodySize : null, f = i && t.nextHopProtocol || null, h = i && void 0 !== n.deliveryType ? n.deliveryType : null, m = n.responseStatus, p = void 0 !== m && 0 !== m ? m : null;
255
- return {
256
- name: "network_request",
257
- timestamp: Date.now(),
258
- performanceTime: t.startTime + t.duration,
259
- url: e(t.name),
260
- initiatorType: (w = t.initiatorType, R.has(w) ? w : "other"),
261
- startTime: t.startTime,
262
- durationMs: t.duration,
263
- dnsLookupMs: o,
264
- tcpConnectMs: r,
265
- tlsHandshakeMs: s,
266
- ttfbMs: a,
267
- responseDownloadMs: c,
268
- transferSize: u,
269
- encodedBodySize: l,
270
- decodedBodySize: d,
271
- nextHopProtocol: f,
272
- deliveryType: h,
273
- responseStatus: p
274
- };
275
- var w;
276
- }
277
- function H() {}
278
- const F = 2e3;
279
- const U = /* @__PURE__ */ new WeakMap();
280
- let B = 0;
281
- function O(t) {
282
- let e = U.get(t);
283
- return void 0 === e && (e = ++B, U.set(t, e)), e;
284
- }
285
- const j = {
286
- focusin: "in",
287
- focusout: "out"
288
- };
289
- function N(t) {
290
- const e = t instanceof HTMLInputElement && ("checkbox" === t.type || "radio" === t.type);
291
- return {
292
- elementId: O(t),
293
- tagName: t.tagName.toLowerCase(),
294
- type: t.type,
295
- valueLength: t.value.length,
296
- checked: e ? t.checked : null,
297
- visible: X(t)
298
- };
299
- }
300
- function q(t) {
301
- return t instanceof HTMLInputElement || t instanceof HTMLSelectElement || t instanceof HTMLTextAreaElement;
302
- }
303
- function W(t) {
304
- return t instanceof HTMLInputElement ? !g.has(t.type) : q(t);
305
- }
306
- function X(t) {
307
- return t.getClientRects().length > 0 && "hidden" !== getComputedStyle(t).visibility;
308
- }
309
- function Y(t) {
310
- return t instanceof HTMLInputElement || t instanceof HTMLTextAreaElement || t instanceof HTMLSelectElement;
311
- }
312
- const J = /* @__PURE__ */ new Set([
313
- "Escape",
314
- "Shift",
315
- "Control",
316
- "Alt",
317
- "Meta",
318
- "Backspace",
319
- "Delete",
320
- "Enter",
321
- "Tab",
322
- "CapsLock",
323
- "ArrowUp",
324
- "ArrowDown",
325
- "ArrowLeft",
326
- "ArrowRight"
327
- ]);
328
- const G = {
329
- mouse: "mouse",
330
- touch: "touch",
331
- pen: "pen"
332
- };
333
- const V = {
334
- pointerdown: "down",
335
- pointerup: "up",
336
- click: "click",
337
- dblclick: "dblclick",
338
- contextmenu: "contextmenu"
339
- };
340
- function Z(t, e, n, i, o) {
341
- return {
342
- name: "navigation",
343
- timestamp: Date.now(),
344
- ts: performance.now(),
345
- phase: t,
346
- type: e,
347
- from: n.from,
348
- to: n.to,
349
- timeOrigin: i,
350
- timing: o
351
- };
352
- }
353
- function K(t) {
354
- return t instanceof Element ? t.closest("button, a, input, select, textarea, label") : null;
355
- }
356
- const Q = /* @__PURE__ */ new Set([
357
- "button",
358
- "a",
359
- "input",
360
- "select",
361
- "textarea",
362
- "label"
363
- ]);
364
- let tt = 0;
365
- let et = 0;
366
- let nt = 0;
367
- let it = 0;
368
- let ot = 0;
369
- let rt = 0;
370
- let st = 0;
371
- let at = 0;
372
- const ct = [];
373
- let ut = 0;
374
- let lt = 0;
375
- let dt = 0;
376
- let ft = 0;
377
- let ht = !1;
378
- const mt = [];
379
- let pt = null;
380
- let wt = 0;
381
- function yt(t) {
382
- const e = performance.now(), n = e - nt, i = n > 0 ? (t.clientX - tt) / n : 0, o = n > 0 ? (t.clientY - et) / n : 0;
383
- if (Math.sqrt((t.clientX - tt) ** 2 + (t.clientY - et) ** 2), tt = t.clientX, et = t.clientY, nt = e, ut = t.clientX, lt = t.clientY, mt.push({
384
- x: t.clientX,
385
- y: t.clientY
386
- }), ot++, void 0 !== t.movementX && (rt += Math.abs(t.movementX), st += Math.abs(t.movementY), at++), e - it < 50) return;
387
- it = e;
388
- const r = t.clientX % 1 != 0 || t.clientY % 1 != 0, s = ot;
389
- ot = 0;
390
- const a = at, c = a > 0 ? rt / a : 0, u = a > 0 ? st / a : 0;
391
- rt = 0, st = 0, at = 0, ct.push({
392
- type: "mouse",
393
- t: e,
394
- data: {
395
- x: t.clientX,
396
- y: t.clientY,
397
- vx: i,
398
- vy: o,
399
- ...r && { subpixel: r },
400
- rawCount: s,
401
- ...a > 0 && {
402
- movementX: t.movementX,
403
- movementY: t.movementY,
404
- mvXAvg: c,
405
- mvYAvg: u
406
- }
407
- }
408
- });
409
- }
410
- function vt(t) {
411
- ct.push({
412
- type: "mouse",
413
- t: performance.now(),
414
- data: (() => {
415
- let e, n, i, o, r;
416
- try {
417
- const s = t.target;
418
- if (s && "function" == typeof s.getBoundingClientRect) {
419
- const a = s.getBoundingClientRect();
420
- a.width > 0 && a.height > 0 && (e = t.clientX - (a.left + a.width / 2), n = t.clientY - (a.top + a.height / 2), o = a.width, r = a.height), i = a.top + window.scrollY;
421
- }
422
- } catch {}
423
- const s = t.clientX % 1 != 0 || t.clientY % 1 != 0, a = Math.sqrt((t.clientX - ut) ** 2 + (t.clientY - lt) ** 2);
424
- let c, u, l;
425
- if (ht && mt.length >= 2) {
426
- const e = Math.sqrt((t.clientX - dt) ** 2 + (t.clientY - ft) ** 2);
427
- if (e > 5) {
428
- let n = 0, i = mt[0];
429
- for (let t = 1; t < mt.length; t++) n += Math.sqrt((mt[t].x - i.x) ** 2 + (mt[t].y - i.y) ** 2), i = mt[t];
430
- c = n / e;
431
- let o = 0;
432
- for (let t = 2; t < mt.length; t++) {
433
- const e = mt[t - 1].x - mt[t - 2].x, n = mt[t - 1].y - mt[t - 2].y, i = mt[t].x - mt[t - 1].x, r = mt[t].y - mt[t - 1].y, s = e * i + n * r, a = Math.sqrt(e * e + n * n), c = Math.sqrt(i * i + r * r);
434
- if (a > 0 && c > 0) {
435
- const t = Math.max(-1, Math.min(1, s / (a * c)));
436
- Math.acos(t) > .5 && o++;
437
- }
438
- }
439
- u = o;
440
- const r = t.clientX - dt, s = t.clientY - ft;
441
- let a = 0;
442
- for (const n of mt) a += Math.abs(s * n.x - r * n.y + t.clientX * ft - t.clientY * dt) / e;
443
- l = a / mt.length;
444
- }
445
- }
446
- return dt = t.clientX, ft = t.clientY, ht = !0, mt.length = 0, {
447
- x: t.clientX,
448
- y: t.clientY,
449
- vx: 0,
450
- vy: 0,
451
- click: !0,
452
- isTrusted: t.isTrusted,
453
- targetType: t.target?.tagName?.toLowerCase() ?? "unknown",
454
- ...void 0 !== e && {
455
- clickOffsetX: e,
456
- clickOffsetY: n
457
- },
458
- ...void 0 !== i && { elementY: i },
459
- ...void 0 !== o && {
460
- elementW: o,
461
- elementH: r
462
- },
463
- ...s && { subpixel: s },
464
- teleportDist: a,
465
- ...void 0 !== c && { straightness: c },
466
- ...void 0 !== u && { directionChanges: u },
467
- ...void 0 !== l && { jitter: l }
468
- };
469
- })()
470
- });
471
- }
472
- function gt(t) {
473
- ct.push({
474
- type: "mouse",
475
- t: performance.now(),
476
- data: {
477
- x: t.clientX,
478
- y: t.clientY,
479
- vx: 0,
480
- vy: 0,
481
- contextmenu: !0,
482
- isTrusted: t.isTrusted
483
- }
484
- });
485
- }
486
- function bt(t) {
487
- const e = t.target;
488
- Q.has(e.tagName?.toLowerCase()) && (pt = e, wt = performance.now());
489
- }
490
- function kt(t) {
491
- const e = t.target;
492
- if (e !== pt || 0 === wt) return;
493
- const n = performance.now() - wt;
494
- pt = null, wt = 0, n < 20 || ct.push({
495
- type: "mouse",
496
- t: performance.now(),
497
- data: {
498
- x: 0,
499
- y: 0,
500
- vx: 0,
501
- vy: 0,
502
- dwell: !0,
503
- dwellMs: n,
504
- targetType: e.tagName?.toLowerCase() ?? "unknown"
505
- }
506
- });
507
- }
508
- function Tt() {
509
- return ct.splice(0);
510
- }
511
- const xt = [];
512
- const St = /* @__PURE__ */ new Map();
513
- let Mt = 0;
514
- let It = 0;
515
- const Et = [];
516
- let _t = !1;
517
- function At(t) {
518
- const e = performance.now(), n = Mt > 0 ? e - Mt : 0;
519
- (n > 500 || 0 === Mt) && It++, Mt = e, St.set(t.code, e);
520
- const i = "Backspace" === t.key || "Delete" === t.key, o = (/* @__PURE__ */ new Set([
521
- "Tab",
522
- "Enter",
523
- "Escape",
524
- "ArrowUp",
525
- "ArrowDown",
526
- "ArrowLeft",
527
- "ArrowRight"
528
- ])).has(t.key) ? t.key : void 0, r = t.shiftKey || t.ctrlKey || t.altKey || t.metaKey ? {
529
- shift: t.shiftKey,
530
- ctrl: t.ctrlKey,
531
- alt: t.altKey,
532
- meta: t.metaKey
533
- } : void 0;
534
- xt.push({
535
- type: "keyboard",
536
- t: e,
537
- data: {
538
- interKeyDelay: n,
539
- holdDuration: 0,
540
- isRepeat: t.repeat,
541
- targetType: t.target?.tagName?.toLowerCase() ?? "unknown",
542
- isTrusted: t.isTrusted,
543
- isCorrection: i,
544
- burstId: It,
545
- ...void 0 !== o && { navKey: o },
546
- ...void 0 !== r && { modifiers: r }
547
- }
548
- });
549
- }
550
- function Dt(t) {
551
- const e = performance.now(), n = St.get(t.code);
552
- if (void 0 === n) return;
553
- const i = e - n;
554
- St.delete(t.code);
555
- for (let t = xt.length - 1; t >= 0; t--) {
556
- const e = xt[t];
557
- if ("keyboard" === e.type && 0 === e.data.holdDuration) {
558
- e.data.holdDuration = i;
559
- break;
560
- }
561
- }
562
- if (!_t && i > 0 && i < 300 && !(/* @__PURE__ */ new Set([
563
- "Tab",
564
- "Enter",
565
- "Escape",
566
- "ArrowUp",
567
- "ArrowDown",
568
- "ArrowLeft",
569
- "ArrowRight"
570
- ])).has(t.key) && (Et.push(i), Et.length >= 8)) {
571
- const t = Et.reduce((t, e) => t + e, 0) / Et.length, n = Et.reduce((e, n) => e + (n - t) ** 2, 0) / Et.length, i = Math.sqrt(n);
572
- i < 2.5 && (_t = !0, xt.push({
573
- type: "keyboard",
574
- t: e,
575
- data: {
576
- action: "hold-uniform",
577
- sampleCount: Et.length,
578
- stddevMs: Math.round(10 * i) / 10,
579
- meanMs: Math.round(10 * t) / 10
580
- }
581
- }));
582
- }
583
- }
584
- function Ct(t) {
585
- xt.push({
586
- type: "clipboard",
587
- t: performance.now(),
588
- data: {
589
- action: "paste",
590
- targetType: t.target?.tagName?.toLowerCase() ?? "unknown",
591
- isTrusted: t.isTrusted
592
- }
593
- });
594
- }
595
- function Lt() {
596
- return xt.splice(0);
597
- }
598
- const Rt = [];
599
- let zt = 0;
600
- let Pt = 0;
601
- let $t = 0;
602
- function Ht() {
603
- const t = performance.now(), e = window.scrollY, n = t - Pt, i = n > 0 ? (e - zt) / n : 0;
604
- zt = e, Pt = t, t - $t < 100 || ($t = t, Rt.push({
605
- type: "scroll",
606
- t,
607
- data: {
608
- x: window.scrollX,
609
- y: e,
610
- vy: i
611
- }
612
- }));
613
- }
614
- function Ft(t) {
615
- const e = t.deltaY % 1 != 0;
616
- Rt.push({
617
- type: "scroll",
618
- t: performance.now(),
619
- data: {
620
- x: window.scrollX,
621
- y: window.scrollY,
622
- vy: 0,
623
- deltaY: t.deltaY,
624
- deltaFractional: e
625
- }
626
- });
627
- }
628
- function Ut() {
629
- return Rt.splice(0);
630
- }
631
- const Bt = [];
632
- let Ot = 0;
633
- let jt = !1;
634
- let Nt = null;
635
- let qt = [];
636
- let Wt = 0;
637
- let Xt = 0;
638
- function Yt() {
639
- Bt.push({
640
- type: "page",
641
- t: performance.now(),
642
- data: { event: document.hidden ? "hidden" : "visible" }
643
- });
644
- }
645
- function Jt() {
646
- Zt(), Bt.push({
647
- type: "page",
648
- t: performance.now(),
649
- data: { event: "focus" }
650
- });
651
- }
652
- function Gt() {
653
- Bt.push({
654
- type: "page",
655
- t: performance.now(),
656
- data: { event: "blur" }
657
- });
658
- }
659
- function Vt() {
660
- Nt && (clearInterval(Nt), Nt = null), qt = [];
661
- }
662
- function Zt() {
663
- const t = performance.now();
664
- jt && (jt = !1, Vt(), Bt.push({
665
- type: "page",
666
- t,
667
- data: { event: "idle-end" }
668
- })), Ot = t;
669
- }
670
- function Kt() {
671
- Zt();
672
- }
673
- function Qt() {
674
- try {
675
- const t = (document.body?.innerText || "").length, e = document.querySelectorAll("input,button,a,select,textarea").length, n = document.documentElement.scrollHeight > 0 ? document.documentElement.scrollHeight / window.innerHeight : 1;
676
- Bt.push({
677
- type: "page",
678
- t: performance.now(),
679
- data: {
680
- event: "page-complexity",
681
- textLength: t,
682
- interactiveCount: e,
683
- scrollRatio: Math.round(100 * n) / 100,
684
- url: location.pathname
685
- }
686
- });
687
- } catch {}
688
- }
689
- function te() {
690
- return function() {
691
- const t = performance.now();
692
- !jt && Ot > 0 && t - Ot >= 5e3 && (jt = !0, Bt.push({
693
- type: "page",
694
- t: Ot + 5e3,
695
- data: { event: "idle-start" }
696
- }), function() {
697
- if (Nt) return;
698
- qt = [], Wt = 0, Xt = 0;
699
- const t = (t) => {
700
- Wt = t.clientX, Xt = t.clientY;
701
- };
702
- document.addEventListener("mousemove", t, { passive: !0 });
703
- let e = 0;
704
- Nt = setInterval(() => {
705
- if (e += 100, 0 === Wt && 0 === Xt || qt.push({
706
- x: Wt,
707
- y: Xt,
708
- t: performance.now()
709
- }), e >= 2e3) {
710
- if (document.removeEventListener("mousemove", t), Nt && (clearInterval(Nt), Nt = null), qt.length >= 2) {
711
- let t = 0;
712
- const e = [];
713
- for (let n = 1; n < qt.length; n++) {
714
- const i = qt[n].x - qt[n - 1].x, o = qt[n].y - qt[n - 1].y, r = Math.sqrt(i * i + o * o);
715
- t += r, e.push(r);
716
- }
717
- const n = e.filter((t) => t > 0).length;
718
- Bt.push({
719
- type: "page",
720
- t: performance.now(),
721
- data: {
722
- event: "idle-movement",
723
- samples: qt.length,
724
- totalDistance: Math.round(100 * t) / 100,
725
- nonZeroDeltas: n,
726
- maxDelta: Math.round(100 * Math.max(...e)) / 100
727
- }
728
- });
729
- } else Bt.push({
730
- type: "page",
731
- t: performance.now(),
732
- data: {
733
- event: "idle-movement",
734
- samples: qt.length,
735
- totalDistance: 0,
736
- nonZeroDeltas: 0,
737
- maxDelta: 0
738
- }
739
- });
740
- qt = [];
741
- }
742
- }, 100);
743
- }());
744
- }(), Bt.splice(0);
745
- }
746
- const ee = [];
747
- const ne = /* @__PURE__ */ new WeakSet();
748
- function ie(t) {
749
- const e = t.target;
750
- if (!e || !e.tagName) return;
751
- const n = e.tagName.toLowerCase();
752
- if (![
753
- "input",
754
- "textarea",
755
- "select",
756
- "button",
757
- "a"
758
- ].includes(n)) return;
759
- if (ne.has(e)) return;
760
- let i = function(t) {
761
- window.getComputedStyle(t);
762
- let e = t;
763
- for (; e && e !== document.documentElement;) {
764
- const t = window.getComputedStyle(e);
765
- if ("none" === t.display) return "display-none";
766
- if ("hidden" === t.visibility) return "visibility-hidden";
767
- if (0 === parseFloat(t.opacity)) return "opacity-zero";
768
- const n = e.getBoundingClientRect();
769
- if ((n.right < 0 || n.bottom < 0 || n.left > window.innerWidth || n.top > window.innerHeight) && ("absolute" === t.position || "fixed" === t.position)) return "off-screen";
770
- if (!(0 !== n.width && 0 !== n.height || "hidden" !== t.overflow || "absolute" !== t.position && "fixed" !== t.position)) return "zero-size";
771
- if (t.clipPath && "none" !== t.clipPath && t.clipPath.includes("inset(100%)")) return "clip-path";
772
- const i = t.clip;
773
- if (i && "auto" !== i && i.includes("rect(0")) return "clip-rect";
774
- e = e.parentElement;
775
- }
776
- return "true" === t.getAttribute("aria-hidden") ? "aria-hidden" : null;
777
- }(e);
778
- if (!i) {
779
- let t = e;
780
- for (; t && t !== document.documentElement;) {
781
- const e = t.getAttribute("data-hp");
782
- if (e) {
783
- i = e;
784
- break;
785
- }
786
- t = t.parentElement;
787
- }
788
- }
789
- if (!i) return;
790
- ne.add(e);
791
- const o = e.name || e.id || e.getAttribute("aria-label") || "unknown";
792
- ee.push({
793
- type: "honeypot",
794
- t: performance.now(),
795
- data: {
796
- action: t.type,
797
- tagName: n,
798
- fieldName: o,
799
- hidingMethod: i
800
- }
801
- });
802
- }
803
- function oe() {
804
- return ee.splice(0);
805
- }
806
- const re = [];
807
- const se = /* @__PURE__ */ new Map();
808
- const ae = /* @__PURE__ */ new Set();
809
- const ce = /* @__PURE__ */ new WeakSet();
810
- let ue = 0;
811
- let le = 0;
812
- const de = /* @__PURE__ */ new WeakSet();
813
- const fe = /* @__PURE__ */ new WeakSet();
814
- let he = 0;
815
- let me = 0;
816
- const pe = [];
817
- let we = null;
818
- const ye = /* @__PURE__ */ new Map();
819
- let ve = 0;
820
- let ge = 0;
821
- const be = /* @__PURE__ */ new WeakSet();
822
- let ke = 0;
823
- let Te = 0;
824
- let xe = 0;
825
- const Se = /* @__PURE__ */ new WeakSet();
826
- function Me(t) {
827
- const e = t.target;
828
- e && (ae.add(e), ce.add(e));
829
- }
830
- function Ie() {
831
- const t = Array.from(document.querySelectorAll("input:not([type=\"hidden\"]):not([type=\"submit\"]):not([type=\"button\"]):not([type=\"reset\"]), textarea")).filter((t) => {
832
- const e = getComputedStyle(t);
833
- return "none" !== e.display && "hidden" !== e.visibility && parseFloat(e.opacity) > 0;
834
- }), e = t.filter((t) => "" !== Re(t)).length, n = t.some((t) => He(t));
835
- e >= 2 && !n && re.push({
836
- type: "form",
837
- t: performance.now(),
838
- data: { action: "form-submit-no-keyboard" }
839
- });
840
- }
841
- function Ee(t) {
842
- const e = t.target;
843
- if (e && Le(e) && !ye.has(e)) {
844
- const t = 0 === ke, n = e.hasAttribute("autofocus"), i = performance.now() - ke;
845
- ye.set(e, t || n || i <= 300 ? "tab" : "programmatic");
846
- }
847
- }
848
- function _e(t) {
849
- ke = performance.now();
850
- const e = t.target;
851
- e && Le(e) && ye.set(e, "mouse");
852
- }
853
- function Ae(t) {
854
- "Tab" === t.key && (ke = performance.now());
855
- }
856
- function De() {
857
- ke = performance.now();
858
- }
859
- function Ce(t) {
860
- const e = t, n = t.target;
861
- n && Le(n) && "insertReplacementText" !== e.inputType && (e.inputType ? pe.push({
862
- type: "form",
863
- t: performance.now(),
864
- data: {
865
- action: "input-method",
866
- fieldName: ze(n),
867
- inputType: e.inputType
868
- }
869
- }) : He(n) || Ue(n));
870
- }
871
- function Le(t) {
872
- const e = t.tagName;
873
- return "INPUT" === e || "TEXTAREA" === e || "SELECT" === e;
874
- }
875
- function Re(t) {
876
- return t.value;
877
- }
878
- function ze(t) {
879
- return t.getAttribute("name") || t.getAttribute("id") || t.tagName.toLowerCase();
880
- }
881
- function Pe() {
882
- return Array.from(document.querySelectorAll("input, textarea, select"));
883
- }
884
- const $e = /* @__PURE__ */ new Set([
885
- "text",
886
- "password",
887
- "email",
888
- "search",
889
- "tel",
890
- "url",
891
- "number"
892
- ]);
893
- function He(t) {
894
- return ce.has(t);
895
- }
896
- function Fe(t) {
897
- return "TEXTAREA" === t.tagName || $e.has(t.type);
898
- }
899
- function Ue(t) {
900
- var e;
901
- Fe(t) && (fe.has(t) || (fe.add(t), le++, de.has(t) || (de.add(t), ue++), re.push({
902
- type: "form",
903
- t: performance.now(),
904
- data: {
905
- action: "programmatic-fill",
906
- fieldName: ze(t),
907
- fieldType: (e = t, e.type || e.tagName.toLowerCase())
908
- }
909
- })));
910
- }
911
- function Be(t) {
912
- for (const e of t) Le(e) && (se.has(e) || se.set(e, Re(e)), Oe(e));
913
- }
914
- function Oe(t) {
915
- if (!Fe(t)) return;
916
- if (t.l) return;
917
- t.l = !0;
918
- const e = t instanceof HTMLTextAreaElement ? HTMLTextAreaElement.prototype : HTMLInputElement.prototype, n = Object.getOwnPropertyDescriptor(e, "value");
919
- if (!n?.get || !n?.set) return;
920
- const i = n.get, o = n.set;
921
- Object.defineProperty(t, "value", {
922
- get() {
923
- return i.call(this);
924
- },
925
- set(e) {
926
- const n = i.call(this);
927
- o.call(this, e), He(t) || ("" === n || "" !== e && e === n || Ue(t), "" === n && "" !== e && Ue(t));
928
- },
929
- configurable: !0
930
- });
931
- }
932
- function je() {
933
- const t = Pe();
934
- for (const e of t) {
935
- if (!Le(e)) continue;
936
- const t = e.type;
937
- if ("submit" === t || "button" === t || "reset" === t) continue;
938
- const n = Re(e);
939
- n !== (se.get(e) ?? "") && "" !== n && (de.has(e) || (de.add(e), ue++), He(e) || Ue(e)), se.set(e, n);
940
- }
941
- for (const e of t) Le(e) && (be.has(e) || "tab" === ye.get(e) && ae.has(e) && Re(e) && (be.add(e), ve++));
942
- for (const e of t) Le(e) && (Se.has(e) || "programmatic" === ye.get(e) && ae.has(e) && Re(e) && (Se.add(e), Te++));
943
- for (const [t] of se) t.isConnected || se.delete(t);
944
- for (const [t] of ye) t.isConnected || ye.delete(t);
945
- ae.clear();
946
- const e = function() {
947
- const t = document.querySelectorAll("input:not([type=\"hidden\"]):not([type=\"submit\"]):not([type=\"button\"]):not([type=\"reset\"]), textarea, select");
948
- let e = 0;
949
- for (let n = 0; n < t.length; n++) {
950
- const i = t[n], o = getComputedStyle(i);
951
- "none" !== o.display && "hidden" !== o.visibility && parseFloat(o.opacity) > 0 && i.offsetWidth > 0 && i.offsetHeight > 0 && e++;
952
- }
953
- return e;
954
- }();
955
- ue === he && le === me && ve === ge && Te === xe || (he = ue, me = le, ge = ve, xe = Te, re.push({
956
- type: "form",
957
- t: performance.now(),
958
- data: {
959
- action: "field-count",
960
- visibleFieldCount: e,
961
- filledFieldCount: ue,
962
- programmaticFillCount: le,
963
- tabNavFillCount: ve,
964
- unfocusedFieldFillCount: Te
965
- }
966
- }));
967
- const n = re.splice(0);
968
- return n.push(...pe.splice(0)), n;
969
- }
970
- function Ne() {
971
- try {
972
- const t = [
973
- navigator.userAgent,
974
- screen.width,
975
- screen.height,
976
- navigator.hardwareConcurrency ?? 0,
977
- navigator.language,
978
- Intl.DateTimeFormat().resolvedOptions().timeZone
979
- ].join("|");
980
- return btoa(t).slice(0, 32);
981
- } catch {
982
- return "unknown";
983
- }
984
- }
985
- const qe = "_ad_batch_seq";
986
- let We = null;
987
- let Xe = 0;
988
- let Ye = "";
989
- let Je = null;
990
- let Ge = null;
991
- let Ve = [];
992
- let Ze = null;
993
- function Ke(t, e) {
994
- try {
995
- sessionStorage.setItem(qe, JSON.stringify({
996
- sid: t,
997
- seq: e
998
- }));
999
- } catch {}
1000
- }
1001
- function Qe() {
1002
- const t = Je?.() ?? "";
1003
- t && t !== Ye && (Ye = t, Xe = function(t) {
1004
- try {
1005
- const e = sessionStorage.getItem(qe);
1006
- if (e) {
1007
- const n = JSON.parse(e);
1008
- if (n.sid === t) return n.seq;
1009
- }
1010
- } catch {}
1011
- return 0;
1012
- }(t));
1013
- }
1014
- function tn(t, e, n, i) {
1015
- We = t, Je = e, Ye = "", Ve = n, Ze = i, Qe(), Ge = setInterval(() => {
1016
- (async function() {
1017
- const t = Ve.flatMap((t) => t());
1018
- if (0 === t.length) return;
1019
- Qe();
1020
- const e = Xe, n = {
1021
- sessionId: Ye,
1022
- pageUrl: location.href,
1023
- batchSequence: e,
1024
- timestamp: Date.now(),
1025
- events: t,
1026
- browserFp: Ne()
1027
- };
1028
- 0 === e && Ze && (n.device = await Ze()), Xe++, Ke(Ye, Xe);
1029
- try {
1030
- We?.send(n);
1031
- } catch {}
1032
- })();
1033
- }, 2e3), document.addEventListener("visibilitychange", en), window.addEventListener("beforeunload", nn);
1034
- }
1035
- function en() {
1036
- document.hidden && on();
1037
- }
1038
- function nn() {
1039
- on();
1040
- }
1041
- function on() {
1042
- const t = Ve.flatMap((t) => t());
1043
- if (0 === t.length) return;
1044
- Qe();
1045
- const e = Xe++;
1046
- Ke(Ye, Xe);
1047
- const n = {
1048
- sessionId: Ye,
1049
- pageUrl: location.href,
1050
- batchSequence: e,
1051
- timestamp: Date.now(),
1052
- events: t,
1053
- browserFp: Ne()
1054
- };
1055
- We?.beacon(n);
1056
- }
1057
- function rn(t) {
1058
- let e = 2166136261;
1059
- for (let n = 0; n < t.length; n++) e ^= t.charCodeAt(n), e = 16777619 * e >>> 0;
1060
- return e.toString(16).padStart(8, "0");
1061
- }
1062
- function sn() {
1063
- try {
1064
- const t = document.createElement("canvas");
1065
- t.width = 200, t.height = 50;
1066
- const e = t.getContext("2d");
1067
- if (!e) return "no-ctx";
1068
- e.textBaseline = "top", e.font = "14px 'Arial'", e.fillStyle = "#f60", e.fillRect(125, 1, 62, 20), e.fillStyle = "#069", e.fillText("Cwm fjordbank glyphs vext quiz!", 2, 15), e.fillStyle = "rgba(102, 204, 0, 0.7)", e.fillRect(100, 5, 80, 40), e.beginPath(), e.arc(50, 25, 20, 0, 2 * Math.PI), e.strokeStyle = "#333", e.stroke();
1069
- const n = t.toDataURL(), i = document.createElement("canvas");
1070
- i.width = 200, i.height = 50;
1071
- const o = i.getContext("2d");
1072
- return o && (o.textBaseline = "top", o.font = "14px 'Arial'", o.fillStyle = "#f60", o.fillRect(125, 1, 62, 20), o.fillStyle = "#069", o.fillText("Cwm fjordbank glyphs vext quiz!", 2, 15), o.fillStyle = "rgba(102, 204, 0, 0.7)", o.fillRect(100, 5, 80, 40), o.beginPath(), o.arc(50, 25, 20, 0, 2 * Math.PI), o.strokeStyle = "#333", o.stroke(), i.toDataURL() !== n) ? "safari-noise-" + rn(n) : rn(n);
1073
- } catch {
1074
- return "error";
1075
- }
1076
- }
1077
- async function an() {
1078
- try {
1079
- const t = window.AudioContext || window.webkitAudioContext;
1080
- if (!t) return "no-audio-ctx";
1081
- const e = new t(), n = e.createOscillator();
1082
- n.type = "triangle", n.frequency.value = 1e4;
1083
- const i = e.createDynamicsCompressor();
1084
- i.threshold.value = -50, i.knee.value = 40, i.ratio.value = 12, i.attack.value = 0, i.release.value = .25;
1085
- const o = e.createAnalyser();
1086
- o.fftSize = 256, n.connect(i), i.connect(o), n.start(0), await new Promise((t) => setTimeout(t, 100));
1087
- const r = new Float32Array(o.frequencyBinCount);
1088
- return o.getFloatFrequencyData(r), n.stop(), await e.close(), function(t) {
1089
- let e = 2166136261;
1090
- for (let n = 0; n < Math.min(t.length, 100); n++) e ^= 255 & Math.floor(1e8 * t[n]), e = 16777619 * e >>> 0;
1091
- return e.toString(16).padStart(8, "0");
1092
- }(r);
1093
- } catch {
1094
- return "error";
1095
- }
1096
- }
1097
- function cn() {
1098
- return {
1099
- screenWidth: screen.width,
1100
- screenHeight: screen.height,
1101
- availWidth: screen.availWidth,
1102
- availHeight: screen.availHeight,
1103
- devicePixelRatio: window.devicePixelRatio ?? 1,
1104
- colorDepth: screen.colorDepth,
1105
- browserChromeWidth: window.outerWidth - window.innerWidth,
1106
- browserChromeHeight: window.outerHeight - window.innerHeight
1107
- };
1108
- }
1109
- let un = !1;
1110
- async function ln() {
1111
- const t = function() {
1112
- const t = navigator;
1113
- return {
1114
- userAgent: t.userAgent,
1115
- platform: t.platform,
1116
- languages: Array.from(t.languages ?? [t.language]),
1117
- hardwareConcurrency: t.hardwareConcurrency ?? 0,
1118
- deviceMemory: t.deviceMemory,
1119
- maxTouchPoints: t.maxTouchPoints ?? 0,
1120
- webdriver: !!t.webdriver,
1121
- pluginsCount: t.plugins?.length ?? 0
1122
- };
1123
- }(), e = cn(), n = function() {
1124
- const t = {
1125
- renderer: "unavailable",
1126
- vendor: "unavailable",
1127
- maxTextureSize: 0,
1128
- extensionCount: 0,
1129
- renderHash: "none"
1130
- };
1131
- try {
1132
- const e = document.createElement("canvas"), n = e.getContext("webgl") || e.getContext("experimental-webgl");
1133
- if (!n) return {
1134
- ...t,
1135
- renderer: "no-webgl"
1136
- };
1137
- const i = n.getExtension("WEBGL_debug_renderer_info"), o = i ? n.getParameter(i.UNMASKED_RENDERER_WEBGL) : "masked", r = i ? n.getParameter(i.UNMASKED_VENDOR_WEBGL) : "masked", s = n.getParameter(n.MAX_TEXTURE_SIZE), a = n.getSupportedExtensions() ?? [];
1138
- e.width = 32, e.height = 32, n.createProgram() && (n.clearColor(.1, .2, .3, 1), n.clear(n.COLOR_BUFFER_BIT));
1139
- const c = /* @__PURE__ */ new Uint8Array(4096);
1140
- n.readPixels(0, 0, 32, 32, n.RGBA, n.UNSIGNED_BYTE, c);
1141
- const u = function(t) {
1142
- let e = 2166136261;
1143
- for (let n = 0; n < t.length; n++) e ^= t.charCodeAt(n), e = 16777619 * e >>> 0;
1144
- return e.toString(16).padStart(8, "0");
1145
- }(c.join(","));
1146
- return {
1147
- renderer: o,
1148
- vendor: r,
1149
- maxTextureSize: s,
1150
- extensionCount: a.length,
1151
- renderHash: u
1152
- };
1153
- } catch {
1154
- return t;
1155
- }
1156
- }(), [i, o] = await Promise.all([Promise.resolve(sn()), an()]), r = function(t, e, n) {
1157
- const i = [], o = /iphone|ipad/i.test(t.userAgent), r = /iphone|ipad/i.test(t.platform), s = !o && /mac/i.test(t.userAgent), a = /windows/i.test(t.userAgent), c = /linux/i.test(t.userAgent) && !/android/i.test(t.userAgent), u = /mac/i.test(t.platform), l = /win/i.test(t.platform), d = /linux/i.test(t.platform), f = o && r || s && u || a && l || c && d || !o && !s && !a && !c;
1158
- i.push({
1159
- check: "ua-platform",
1160
- pass: f,
1161
- detail: f ? void 0 : `UA suggests ${o ? "iOS" : s ? "Mac" : a ? "Win" : "Linux"} but platform=${t.platform}`
1162
- });
1163
- const h = d && t.maxTouchPoints > 1;
1164
- i.push({
1165
- check: "touch-platform",
1166
- pass: !h,
1167
- detail: h ? `Linux desktop with maxTouchPoints=${t.maxTouchPoints}` : void 0
1168
- });
1169
- const m = /intel|llvm|swiftshader|software/i.test(n.renderer) && t.hardwareConcurrency > 16;
1170
- i.push({
1171
- check: "gpu-cores",
1172
- pass: !m,
1173
- detail: m ? `Integrated GPU (${n.renderer}) with ${t.hardwareConcurrency} cores` : void 0
1174
- });
1175
- const p = window.innerWidth > e.screenWidth + 10;
1176
- return i.push({
1177
- check: "screen-viewport",
1178
- pass: !p,
1179
- detail: p ? `innerWidth=${window.innerWidth} > screen.width=${e.screenWidth}` : void 0
1180
- }), i;
1181
- }(t, e, n);
1182
- return {
1183
- canvasHash: i,
1184
- webglRenderer: n.renderer,
1185
- webglVendor: n.vendor,
1186
- audioHash: o,
1187
- userAgent: t.userAgent,
1188
- platform: t.platform,
1189
- languages: t.languages,
1190
- hardwareConcurrency: t.hardwareConcurrency,
1191
- deviceMemory: t.deviceMemory,
1192
- maxTouchPoints: t.maxTouchPoints,
1193
- webdriver: t.webdriver,
1194
- screenWidth: e.screenWidth,
1195
- screenHeight: e.screenHeight,
1196
- devicePixelRatio: e.devicePixelRatio,
1197
- colorDepth: e.colorDepth,
1198
- availWidth: e.availWidth,
1199
- availHeight: e.availHeight,
1200
- browserChromeWidth: e.browserChromeWidth,
1201
- browserChromeHeight: e.browserChromeHeight,
1202
- pluginsCount: t.pluginsCount,
1203
- consistency: r
1204
- };
1205
- }
1206
- const dn = {
1207
- pointer: {
1208
- create: function(t, e, n) {
1209
- const i = _((e) => {
1210
- const n = function(e) {
1211
- const n = e, i = function(t) {
1212
- if ("mouse" === t.pointerType) return {
1213
- button: t.button,
1214
- buttons: t.buttons
1215
- };
1216
- const e = {
1217
- force: t.pressure,
1218
- contact: Math.min(t.width, t.height)
1219
- };
1220
- return "pen" === t.pointerType && (e.tiltX = t.tiltX, e.tiltY = t.tiltY, e.twist = t.twist), e;
1221
- }(n);
1222
- return {
1223
- id: n.pointerId,
1224
- name: "pointer",
1225
- timestamp: Date.now(),
1226
- ts: n.timeStamp,
1227
- type: G[n.pointerType] ?? "unknown",
1228
- phase: V[e.type],
1229
- isTrusted: n.isTrusted,
1230
- element: t.resolveElement(n.target, { freshGeometry: !0 }),
1231
- isPrimary: n.isPrimary,
1232
- modifiers: {
1233
- shift: n.shiftKey,
1234
- ctrl: n.ctrlKey,
1235
- alt: n.altKey,
1236
- meta: n.metaKey
1237
- },
1238
- coordinates: {
1239
- x: n.clientX,
1240
- y: n.clientY
1241
- },
1242
- ...i
1243
- };
1244
- }(e);
1245
- t.push(n);
1246
- });
1247
- return p(n, "pointer") && (T(document, "pointerdown", i), T(document, "pointerup", i)), p(n, "click") && T(document, "click", i), p(n, "dblclick") && T(document, "dblclick", i), p(n, "contextmenu") && T(document, "contextmenu", i), () => {
1248
- x(document, "pointerdown", i), x(document, "pointerup", i), x(document, "click", i), x(document, "dblclick", i), x(document, "contextmenu", i);
1249
- };
1250
- },
1251
- layer: "behavioral",
1252
- events: [
1253
- "pointer",
1254
- "click",
1255
- "dblclick",
1256
- "contextmenu"
1257
- ]
1258
- },
1259
- pointermove: {
1260
- create: function(t) {
1261
- let e = null, n = null;
1262
- const i = _((n) => {
1263
- const i = n;
1264
- e && e.id !== i.pointerId && (t.push(e), e = null), e ? e.samples.ts.length >= 50 ? (t.push(e), e = o(i), r(t)) : (e.samples.x.push(i.clientX), e.samples.y.push(i.clientY), e.samples.ts.push(i.timeStamp), e.samples.movementX.push(i.movementX), e.samples.movementY.push(i.movementY), e.samples.buttons.push(i.buttons), e.samples.isTrusted.push(i.isTrusted), "pen" === i.pointerType && (e.samples.tiltX?.push(i.tiltX), e.samples.tiltY?.push(i.tiltY)), "mouse" !== i.pointerType && (e.samples.force?.push(i.pressure), e.samples.radius?.push(Math.max(i.width, i.height))), r(t)) : (e = o(i), r(t));
1265
- });
1266
- function o(t) {
1267
- const e = function(t) {
1268
- if ("mouse" === t.pointerType) return null;
1269
- const e = {
1270
- force: [t.pressure],
1271
- radius: [Math.max(t.width, t.height)]
1272
- };
1273
- return "pen" === t.pointerType && (e.tiltX = [t.tiltX], e.tiltY = [t.tiltY]), e;
1274
- }(t);
1275
- return {
1276
- name: "pointer",
1277
- timestamp: Date.now(),
1278
- id: t.pointerId,
1279
- type: t.pointerType,
1280
- phase: "move",
1281
- isTrusted: t.isTrusted,
1282
- isPrimary: t.isPrimary,
1283
- samples: {
1284
- x: [t.clientX],
1285
- y: [t.clientY],
1286
- ts: [t.timeStamp],
1287
- movementX: [t.movementX],
1288
- movementY: [t.movementY],
1289
- buttons: [t.buttons],
1290
- isTrusted: [t.isTrusted],
1291
- ...e ?? {}
1292
- }
1293
- };
1294
- }
1295
- function r(t) {
1296
- n && clearTimeout(n), n = setTimeout(() => {
1297
- e && (t.push(e), e = null), n = null;
1298
- }, F);
1299
- }
1300
- return T(document, "pointermove", i), () => {
1301
- x(document, "pointermove", i), n && (clearTimeout(n), n = null), e && (t.push(e), e = null);
1302
- };
1303
- },
1304
- layer: "behavioral"
1305
- },
1306
- focus: {
1307
- create: function(t) {
1308
- const e = _((e) => {
1309
- const n = function(e) {
1310
- const n = e;
1311
- return {
1312
- name: "focus",
1313
- type: j[e.type] ?? "unknown",
1314
- timestamp: Date.now(),
1315
- ts: n.timeStamp,
1316
- isTrusted: n.isTrusted,
1317
- element: t.resolveElement(n.target),
1318
- relatedTarget: t.resolveElement(n.relatedTarget)
1319
- };
1320
- }(e);
1321
- t.push(n);
1322
- });
1323
- return T(document, "focusin", e), T(document, "focusout", e), () => {
1324
- x(document, "focusin", e), x(document, "focusout", e);
1325
- };
1326
- },
1327
- layer: "behavioral"
1328
- },
1329
- input: {
1330
- create: function(t) {
1331
- const e = _((e) => {
1332
- const n = e;
1333
- t.push(function(e) {
1334
- return {
1335
- name: "keystroke",
1336
- type: "input",
1337
- timestamp: Date.now(),
1338
- ts: e.timeStamp,
1339
- isTrusted: e.isTrusted,
1340
- element: t.resolveElement(e.target),
1341
- inputType: e.inputType ?? "",
1342
- isComposing: e.isComposing ?? !1,
1343
- length: (n = e.target, n instanceof HTMLInputElement || n instanceof HTMLTextAreaElement || n instanceof HTMLSelectElement ? n.value.length : 0)
1344
- };
1345
- var n;
1346
- }(n)), function(t) {
1347
- if ("insertReplacementText" === t.inputType) return !0;
1348
- const e = t.target;
1349
- return !!Y(e) && function(t) {
1350
- try {
1351
- return t.matches(":-webkit-autofill");
1352
- } catch {
1353
- return !1;
1354
- }
1355
- }(e);
1356
- }(n) && t.push(function(t, e) {
1357
- const n = t.target;
1358
- let i = 0;
1359
- return Y(n) && (i = n.value.length), {
1360
- name: "autofill",
1361
- timestamp: Date.now(),
1362
- ts: t.timeStamp,
1363
- element: e.resolveElement(n),
1364
- length: i
1365
- };
1366
- }(n, t));
1367
- });
1368
- return T(document, "input", e), function() {
1369
- x(document, "input", e);
1370
- };
1371
- },
1372
- layer: "behavioral"
1373
- },
1374
- keystroke: {
1375
- create: function(t) {
1376
- const { resolve: e, reset: n } = function() {
1377
- let t = 0;
1378
- const e = /* @__PURE__ */ new Map();
1379
- return {
1380
- resolve: function(n, i) {
1381
- if ("keydown" === i) {
1382
- const i = e.get(n);
1383
- if (void 0 !== i) return i;
1384
- const o = ++t;
1385
- if (e.size >= 32) {
1386
- const t = e.keys().next().value;
1387
- void 0 !== t && e.delete(t);
1388
- }
1389
- return e.set(n, o), o;
1390
- }
1391
- const o = e.get(n);
1392
- return void 0 !== o ? (e.delete(n), o) : ++t;
1393
- },
1394
- reset: function() {
1395
- e.clear();
1396
- }
1397
- };
1398
- }(), i = _((n) => {
1399
- const i = function(n) {
1400
- const i = n, o = n.type, r = J.has(i.key);
1401
- return {
1402
- name: "keystroke",
1403
- type: o,
1404
- id: e(i.code, o),
1405
- timestamp: Date.now(),
1406
- ts: i.timeStamp,
1407
- isTrusted: i.isTrusted,
1408
- keys: r ? [i.key] : [],
1409
- repeat: i.repeat,
1410
- location: r ? i.location : null,
1411
- element: t.resolveElement(i.target)
1412
- };
1413
- }(n);
1414
- t.push(i);
1415
- }), o = _(() => {
1416
- n();
1417
- });
1418
- return T(document, "keydown", i), T(document, "keyup", i), T(window, "blur", o), () => {
1419
- x(document, "keydown", i), x(document, "keyup", i), x(window, "blur", o);
1420
- };
1421
- },
1422
- layer: "behavioral"
1423
- },
1424
- clipboard: {
1425
- create: function(t, e = "on", n) {
1426
- const i = _((n) => {
1427
- const i = function(n) {
1428
- const i = n, o = n.type, r = ("paste" === n.type ? i.clipboardData?.getData("text/plain") : w()) ?? null, s = y(i.target, e);
1429
- return {
1430
- name: "clipboard",
1431
- type: o,
1432
- timestamp: Date.now(),
1433
- ts: i.timeStamp,
1434
- isTrusted: i.isTrusted,
1435
- element: t.resolveElement(i.target),
1436
- length: r?.length ?? 0,
1437
- ...s && r ? { content: r } : {}
1438
- };
1439
- }(n);
1440
- t.push(i);
1441
- });
1442
- return p(n, "paste") && T(document, "paste", i), p(n, "cut") && T(document, "cut", i), p(n, "copy") && T(document, "copy", i), () => {
1443
- x(document, "paste", i), x(document, "cut", i), x(document, "copy", i);
1444
- };
1445
- },
1446
- layer: "behavioral",
1447
- events: [
1448
- "paste",
1449
- "cut",
1450
- "copy"
1451
- ]
1452
- },
1453
- form: {
1454
- create: function(t, e, n) {
1455
- const i = p(n, "submit"), o = p(n, "snapshot"), r = _((e) => {
1456
- const n = {
1457
- name: "form",
1458
- type: (i = e).type,
1459
- timestamp: Date.now(),
1460
- ts: i.timeStamp,
1461
- isTrusted: i.isTrusted,
1462
- element: t.resolveElement(i.target)
1463
- };
1464
- var i;
1465
- t.push(n);
1466
- }), s = _((e) => {
1467
- o && e.target instanceof Element && u(e, "submit", e.target), t.flush();
1468
- }), a = _((e) => {
1469
- if (!(e.target instanceof Element)) return;
1470
- const n = e.target.closest(b);
1471
- n && (o && u(e, "flush", n), t.flush());
1472
- }), c = _((t) => {
1473
- q(t.target) && u(t, "change", t.target);
1474
- });
1475
- function u(e, n, i) {
1476
- i.closest(k) || t.push(function(t, e, n) {
1477
- const i = function(t) {
1478
- return t instanceof HTMLFormElement ? t : q(t) ? t.form : t.closest("form");
1479
- }(n), o = i ? i.elements : document.querySelectorAll("input, select, textarea"), r = [];
1480
- let s = !1;
1481
- for (let t = 0; t < o.length; t++) {
1482
- const e = o[t];
1483
- if (W(e) && !e.closest(k)) {
1484
- if (r.length >= 50) {
1485
- s = !0;
1486
- break;
1487
- }
1488
- r.push(N(e));
1489
- }
1490
- }
1491
- return {
1492
- name: "form_snapshot",
1493
- trigger: e,
1494
- timestamp: Date.now(),
1495
- ts: t.timeStamp,
1496
- isTrusted: t.isTrusted,
1497
- targetId: O(n),
1498
- formId: i ? O(i) : null,
1499
- fields: r,
1500
- truncated: s
1501
- };
1502
- }(e, n, i));
1503
- }
1504
- return i && T(document, "submit", r), p(n, "invalid") && T(document, "invalid", r), (i || o) && T(document, "submit", s), T(document, "click", a), o && T(document, "change", c), () => {
1505
- x(document, "submit", r), x(document, "invalid", r), x(document, "submit", s), x(document, "click", a), x(document, "change", c);
1506
- };
1507
- },
1508
- layer: "behavioral",
1509
- events: [
1510
- "submit",
1511
- "invalid",
1512
- "snapshot"
1513
- ]
1514
- },
1515
- change: {
1516
- create: function(t) {
1517
- const e = _((e) => {
1518
- const n = (i = e, {
1519
- name: "change",
1520
- timestamp: Date.now(),
1521
- ts: i.timeStamp,
1522
- isTrusted: i.isTrusted,
1523
- element: t.resolveElement(i.target)
1524
- });
1525
- var i;
1526
- t.push(n);
1527
- });
1528
- return T(document, "change", e), () => {
1529
- x(document, "change", e);
1530
- };
1531
- },
1532
- layer: "behavioral"
1533
- },
1534
- selection: {
1535
- create: function(t, e) {
1536
- let n = !1, i = 0, o = null, r = !1, s = !1;
1537
- function a() {
1538
- o && (clearTimeout(o), o = null);
1539
- }
1540
- function c() {
1541
- a(), r || s || (o = setTimeout(() => {
1542
- o = null, n && u("timeout", performance.now());
1543
- }, 250));
1544
- }
1545
- function u(i, o) {
1546
- n && (n = !1, a(), function(n, i) {
1547
- const o = v("end"), r = o && y(o, e), s = w();
1548
- t.push({
1549
- name: "selection",
1550
- phase: "end",
1551
- timestamp: Date.now(),
1552
- ts: i,
1553
- trigger: n,
1554
- isTrusted: !0,
1555
- element: t.resolveElement(o),
1556
- length: s?.length ?? 0,
1557
- ...r && s ? { content: s } : {}
1558
- });
1559
- }(i, o));
1560
- }
1561
- const l = _((e) => {
1562
- const o = function() {
1563
- const t = document.getSelection();
1564
- return !t || t.isCollapsed || 0 === t.rangeCount;
1565
- }();
1566
- if (!n && !o) return n = !0, r = e.timeStamp, i = Date.now(), t.push({
1567
- name: "selection",
1568
- phase: "start",
1569
- timestamp: i,
1570
- ts: r,
1571
- element: t.resolveElement(v("start"))
1572
- }), void c();
1573
- var r;
1574
- n && o ? u("collapse", e.timeStamp) : n && c();
1575
- }), d = _((t) => {
1576
- 0 === t.button && (r = !0, a());
1577
- }), f = _((t) => {
1578
- 0 === t.button && (r = !1, n && u("pointer", t.timeStamp));
1579
- }), h = _((t) => {
1580
- "Shift" === t.key && (s = !0, a());
1581
- }), m = _((t) => {
1582
- "Shift" === t.key && (s = !1, n && u("keyboard", t.timeStamp));
1583
- }), p = _(() => {
1584
- r = !1;
1585
- }), g = _((t) => {
1586
- "hidden" === document.visibilityState && (r = !1, s = !1, n && u("timeout", t.timeStamp));
1587
- }), b = _((t) => {
1588
- r = !1, n && u("pointer", t.timeStamp);
1589
- });
1590
- return T(document, "selectionchange", l), T(document, "pointerdown", d), T(document, "pointerup", f), T(document, "keydown", h), T(document, "keyup", m), T(document, "contextmenu", p), T(document, "visibilitychange", g), T(document, "dragend", b), () => {
1591
- a(), x(document, "selectionchange", l), x(document, "pointerdown", d), x(document, "pointerup", f), x(document, "keydown", h), x(document, "keyup", m), x(document, "contextmenu", p), x(document, "visibilitychange", g), x(document, "dragend", b);
1592
- };
1593
- },
1594
- layer: "behavioral"
1595
- },
1596
- tab: {
1597
- create: () => () => {},
1598
- layer: "session",
1599
- events: ["state", "count"]
1600
- },
1601
- visibility: {
1602
- create: function(t) {
1603
- const e = _((e) => {
1604
- const n = document.visibilityState;
1605
- if ("visible" !== n && "hidden" !== n) return;
1606
- const i = {
1607
- name: "visibility",
1608
- type: n,
1609
- timestamp: Date.now(),
1610
- ts: e.timeStamp,
1611
- isTrusted: e.isTrusted
1612
- };
1613
- t.push(i);
1614
- });
1615
- return T(document, "visibilitychange", e), () => {
1616
- x(document, "visibilitychange", e);
1617
- };
1618
- },
1619
- layer: "session"
1620
- },
1621
- navigation: {
1622
- create: function(t) {
1623
- let e = t.sanitizeUrl(document.referrer || "");
1624
- function n(n) {
1625
- t.push(n), e = n.to ?? "";
1626
- }
1627
- const i = _(() => {
1628
- const [e] = performance.getEntriesByType("navigation");
1629
- var i;
1630
- n(Z("load", e?.type ?? "navigate", {
1631
- from: document.referrer ? t.sanitizeUrl(document.referrer) : null,
1632
- to: t.sanitizeUrl(location.href)
1633
- }, performance.timeOrigin, e ? {
1634
- fetchStart: (i = e).fetchStart,
1635
- domainLookupStart: i.domainLookupStart,
1636
- domainLookupEnd: i.domainLookupEnd,
1637
- connectStart: i.connectStart,
1638
- connectEnd: i.connectEnd,
1639
- requestStart: i.requestStart,
1640
- responseStart: i.responseStart,
1641
- responseEnd: i.responseEnd,
1642
- domInteractive: i.domInteractive,
1643
- domContentLoadedEventStart: i.domContentLoadedEventStart,
1644
- domContentLoadedEventEnd: i.domContentLoadedEventEnd,
1645
- domComplete: i.domComplete,
1646
- loadEventStart: i.loadEventStart,
1647
- loadEventEnd: i.loadEventEnd,
1648
- redirectCount: i.redirectCount,
1649
- transferSize: i.transferSize,
1650
- encodedBodySize: i.encodedBodySize,
1651
- decodedBodySize: i.decodedBodySize
1652
- } : void 0));
1653
- }), o = _((i) => {
1654
- const o = i;
1655
- if (null === o.navigationType) return;
1656
- const r = t.sanitizeUrl(location.href);
1657
- r !== e && n(Z("change", o.navigationType, {
1658
- from: e,
1659
- to: r
1660
- }, performance.timeOrigin));
1661
- }), r = _(() => a("traverse")), s = _(() => a("hashchange"));
1662
- function a(i) {
1663
- const o = t.sanitizeUrl(location.href);
1664
- "hashchange" === i && o === e || n(Z("change", i, {
1665
- from: e,
1666
- to: o
1667
- }, performance.timeOrigin));
1668
- }
1669
- const c = history.pushState, u = history.replaceState, l = function(...t) {
1670
- const e = c.apply(this, t);
1671
- return I(() => a("push")), e;
1672
- }, d = function(...t) {
1673
- const e = u.apply(this, t);
1674
- return I(() => a("replace")), e;
1675
- };
1676
- return window.navigation ? T(window.navigation, "currententrychange", o) : (history.pushState = l, history.replaceState = d, T(window, "popstate", r), T(window, "hashchange", s)), "complete" === document.readyState ? i(new Event("load")) : T(window, "load", i), () => {
1677
- window.navigation ? x(window.navigation, "currententrychange", o) : (history.pushState === l && (history.pushState = c), history.replaceState === d && (history.replaceState = u), x(window, "popstate", r), x(window, "hashchange", s)), x(window, "load", i);
1678
- };
1679
- },
1680
- layer: "session"
1681
- },
1682
- networkconnection: {
1683
- create: function(t) {
1684
- const e = _((e) => {
1685
- const n = {
1686
- name: "network",
1687
- type: "connection",
1688
- state: navigator.onLine ? "online" : "offline",
1689
- timestamp: Date.now(),
1690
- ts: e.timeStamp
1691
- };
1692
- t.push(n);
1693
- });
1694
- return T(window, "online", e), T(window, "offline", e), () => {
1695
- x(window, "online", e), x(window, "offline", e);
1696
- };
1697
- },
1698
- layer: "session"
1699
- },
1700
- scroll: {
1701
- create: function(t) {
1702
- let e = null, n = null;
1703
- const i = _((n) => {
1704
- const i = (s = n.target) instanceof Element ? s.closest("[data-tri-ignore]") ? null : s : "window";
1705
- var s;
1706
- if (null === i) return;
1707
- const a = "window" === i ? "window" : O(i), c = "window" === i ? null : i;
1708
- e && e.target !== a && (t.push(e), e = null), e ? e.samples.ts.length >= 50 ? (t.push(e), e = o(n, a, c), r(t)) : (e.samples.x.push(window.scrollX), e.samples.y.push(window.scrollY), e.samples.ts.push(n.timeStamp), e.samples.isTrusted.push(n.isTrusted), c && (e.samples.elementX?.push(c.scrollLeft), e.samples.elementY?.push(c.scrollTop)), r(t)) : (e = o(n, a, c), r(t));
1709
- });
1710
- function o(t, e, n) {
1711
- return {
1712
- name: "scroll",
1713
- timestamp: Date.now(),
1714
- target: e,
1715
- isTrusted: t.isTrusted,
1716
- samples: {
1717
- x: [window.scrollX],
1718
- y: [window.scrollY],
1719
- ts: [t.timeStamp],
1720
- isTrusted: [t.isTrusted],
1721
- ...n ? {
1722
- elementX: [n.scrollLeft],
1723
- elementY: [n.scrollTop]
1724
- } : {}
1725
- },
1726
- height: window.innerHeight,
1727
- width: window.innerWidth,
1728
- scrollX: window.scrollX,
1729
- scrollY: window.scrollY,
1730
- pageX: window.pageXOffset,
1731
- pageY: window.pageYOffset
1732
- };
1733
- }
1734
- function r(t) {
1735
- n && clearTimeout(n), n = setTimeout(() => {
1736
- e && (t.push(e), e = null), n = null;
1737
- }, F);
1738
- }
1739
- return T(window, "scroll", i), () => {
1740
- x(window, "scroll", i), n && (clearTimeout(n), n = null), e && (t.push(e), e = null);
1741
- };
1742
- },
1743
- layer: "behavioral"
1744
- },
1745
- viewportresize: {
1746
- create: function(t) {
1747
- let e = null, n = null;
1748
- const i = _((n) => e ? e.samples.ts.length >= 50 ? (t.push(e), e = o(n), void r(t)) : (e.samples.height.push(window.innerHeight), e.samples.width.push(window.innerWidth), e.samples.ts.push(n.timeStamp), e.samples.scrollX.push(window.scrollX), e.samples.scrollY.push(window.scrollY), e.samples.dpr.push(window.devicePixelRatio), e.samples.outerWidth.push(window.outerWidth), e.samples.outerHeight.push(window.outerHeight), void r(t)) : (e = o(n), void r(t)));
1749
- function o(t) {
1750
- return {
1751
- name: "viewport",
1752
- type: "resize",
1753
- timestamp: Date.now(),
1754
- samples: {
1755
- height: [window.innerHeight],
1756
- width: [window.innerWidth],
1757
- ts: [t.timeStamp],
1758
- scrollX: [window.scrollX],
1759
- scrollY: [window.scrollY],
1760
- dpr: [window.devicePixelRatio],
1761
- outerWidth: [window.outerWidth],
1762
- outerHeight: [window.outerHeight]
1763
- }
1764
- };
1765
- }
1766
- function r(t) {
1767
- n && clearTimeout(n), n = setTimeout(() => {
1768
- e && (t.push(e), e = null), n = null;
1769
- }, F);
1770
- }
1771
- return T(window, "resize", i), () => {
1772
- x(window, "resize", i), n && (clearTimeout(n), n = null), e && (t.push(e), e = null);
1773
- };
1774
- },
1775
- layer: "behavioral"
1776
- },
1777
- viewport: {
1778
- create: function(t, e, n) {
1779
- const i = _((e) => {
1780
- const n = r(e, "orientation");
1781
- t.push(n);
1782
- }), o = _((e) => {
1783
- const n = r(e, "ratiochange");
1784
- t.push(n);
1785
- });
1786
- function r(t, e) {
1787
- return {
1788
- name: "viewport",
1789
- type: e,
1790
- timestamp: Date.now(),
1791
- ts: t.timeStamp,
1792
- isTrusted: t.isTrusted,
1793
- height: window.innerHeight,
1794
- width: window.innerWidth,
1795
- scrollX: window.scrollX,
1796
- scrollY: window.scrollY,
1797
- dpr: window.devicePixelRatio
1798
- };
1799
- }
1800
- return p(n, "orientationchange") && T(window, "orientationchange", i), p(n, "devicepixelratiochange") && T(window, "devicepixelratiochange", o), () => {
1801
- x(window, "orientationchange", i), x(window, "devicepixelratiochange", o);
1802
- };
1803
- },
1804
- layer: "behavioral",
1805
- events: ["orientationchange", "devicepixelratiochange"]
1806
- },
1807
- sensors: {
1808
- create: function(t, e, n) {
1809
- let i = null, o = null, r = null, s = null, a = !1;
1810
- function c() {
1811
- s && C(s), s = setTimeout(A(() => {
1812
- u(), s = null;
1813
- }), F);
1814
- }
1815
- function u() {
1816
- i && (t.push(i), i = null), o && (t.push(o), o = null), r && (t.push(r), r = null);
1817
- }
1818
- const l = _((e) => {
1819
- const n = e, o = n.timeStamp, r = n.acceleration, s = n.accelerationIncludingGravity, a = n.rotationRate;
1820
- if (!r && !s && !a || null === r?.x && null === r?.y && null === r?.z && null === s?.x && null === s?.y && null === s?.z && null === a?.alpha && null === a?.beta && null === a?.gamma) return;
1821
- if (!i) return i = {
1822
- name: "sensors",
1823
- type: "motion",
1824
- timestamp: Date.now(),
1825
- interval: n.interval ?? null,
1826
- samples: {
1827
- ax: [r?.x ?? 0],
1828
- ay: [r?.y ?? 0],
1829
- az: [r?.z ?? 0],
1830
- agx: [s?.x ?? 0],
1831
- agy: [s?.y ?? 0],
1832
- agz: [s?.z ?? 0],
1833
- rrAlpha: [a?.alpha ?? 0],
1834
- rrBeta: [a?.beta ?? 0],
1835
- rrGamma: [a?.gamma ?? 0],
1836
- ts: [o]
1837
- }
1838
- }, void c();
1839
- if (i.samples.ts.length >= 50) return t.push(i), i = {
1840
- name: "sensors",
1841
- type: "motion",
1842
- timestamp: Date.now(),
1843
- interval: n.interval ?? null,
1844
- samples: {
1845
- ax: [r?.x ?? 0],
1846
- ay: [r?.y ?? 0],
1847
- az: [r?.z ?? 0],
1848
- agx: [s?.x ?? 0],
1849
- agy: [s?.y ?? 0],
1850
- agz: [s?.z ?? 0],
1851
- rrAlpha: [a?.alpha ?? 0],
1852
- rrBeta: [a?.beta ?? 0],
1853
- rrGamma: [a?.gamma ?? 0],
1854
- ts: [o]
1855
- }
1856
- }, void c();
1857
- const u = i.samples;
1858
- u.ax.push(r?.x ?? 0), u.ay.push(r?.y ?? 0), u.az.push(r?.z ?? 0), u.agx.push(s?.x ?? 0), u.agy.push(s?.y ?? 0), u.agz.push(s?.z ?? 0), u.rrAlpha.push(a?.alpha ?? 0), u.rrBeta.push(a?.beta ?? 0), u.rrGamma.push(a?.gamma ?? 0), u.ts.push(o), c();
1859
- }), d = _((e) => {
1860
- const n = e;
1861
- if (null == n.alpha && null == n.beta && null == n.gamma) return;
1862
- const i = n.timeStamp, r = n.webkitCompassHeading ?? 0;
1863
- if (!o) return o = {
1864
- name: "sensors",
1865
- type: "orientation",
1866
- timestamp: Date.now(),
1867
- absolute: a || n.absolute,
1868
- samples: {
1869
- alpha: [n.alpha ?? 0],
1870
- beta: [n.beta ?? 0],
1871
- gamma: [n.gamma ?? 0],
1872
- compassHeading: [r],
1873
- ts: [i]
1874
- }
1875
- }, void c();
1876
- if (o.samples.ts.length >= 50) return t.push(o), o = {
1877
- name: "sensors",
1878
- type: "orientation",
1879
- timestamp: Date.now(),
1880
- absolute: a || n.absolute,
1881
- samples: {
1882
- alpha: [n.alpha ?? 0],
1883
- beta: [n.beta ?? 0],
1884
- gamma: [n.gamma ?? 0],
1885
- compassHeading: [r],
1886
- ts: [i]
1887
- }
1888
- }, void c();
1889
- const s = o.samples;
1890
- s.alpha.push(n.alpha ?? 0), s.beta.push(n.beta ?? 0), s.gamma.push(n.gamma ?? 0), s.compassHeading.push(r), s.ts.push(i), c();
1891
- }), f = _((e) => {
1892
- const n = e.value;
1893
- if (null == n) return;
1894
- const i = e.timeStamp;
1895
- r ? r.samples.ts.length >= 50 ? (t.push(r), r = {
1896
- name: "sensors",
1897
- type: "light",
1898
- timestamp: Date.now(),
1899
- samples: {
1900
- lux: [n],
1901
- ts: [i]
1902
- }
1903
- }, c()) : (r.samples.lux.push(n), r.samples.ts.push(i), c()) : (r = {
1904
- name: "sensors",
1905
- type: "light",
1906
- timestamp: Date.now(),
1907
- samples: {
1908
- lux: [n],
1909
- ts: [i]
1910
- }
1911
- }, c());
1912
- });
1913
- return p(n, "motion") && T(window, "devicemotion", l), p(n, "orientation") && ("ondeviceorientationabsolute" in window ? (a = !0, T(window, "deviceorientationabsolute", d)) : T(window, "deviceorientation", d)), p(n, "light") && T(window, "devicelight", f), function() {
1914
- x(window, "devicemotion", l), x(window, a ? "deviceorientationabsolute" : "deviceorientation", d), x(window, "devicelight", f), s && (C(s), s = null), u();
1915
- };
1916
- },
1917
- layer: "behavioral",
1918
- events: [
1919
- "motion",
1920
- "orientation",
1921
- "light"
1922
- ]
1923
- },
1924
- "network-request": {
1925
- create: function(t) {
1926
- var n;
1927
- const i = function(t, n, i, o = z) {
1928
- if ("undefined" == typeof PerformanceObserver) return H;
1929
- let r = null;
1930
- try {
1931
- r = new PerformanceObserver((e) => {
1932
- for (const r of e.getEntries()) {
1933
- const e = r;
1934
- o.has(e.initiatorType) && (n(e.name) || t($(e, i)));
1935
- }
1936
- }), r.observe({
1937
- type: "resource",
1938
- buffered: !0
1939
- });
1940
- } catch {
1941
- return e.warn("network-request", "PerformanceObserver failed to start"), H;
1942
- }
1943
- return function() {
1944
- r?.disconnect(), r = null;
1945
- };
1946
- }(function(e) {
1947
- I(() => t.push(e));
1948
- }, (n = t.ignoredOrigins, function(t) {
1949
- try {
1950
- return n.has(new URL(t).origin);
1951
- } catch {
1952
- return !1;
1953
- }
1954
- }), t.sanitizeUrl);
1955
- return function() {
1956
- i();
1957
- };
1958
- },
1959
- layer: "session"
1960
- },
1961
- screen: {
1962
- create: function(t) {
1963
- const e = I(() => function() {
1964
- const t = window.screen;
1965
- return {
1966
- name: "screen",
1967
- timestamp: Date.now(),
1968
- ts: performance.now(),
1969
- availWidth: t.availWidth,
1970
- availHeight: t.availHeight,
1971
- width: t.width,
1972
- height: t.height,
1973
- colorDepth: t.colorDepth,
1974
- pixelDepth: t.pixelDepth,
1975
- availLeft: t.availLeft ?? 0,
1976
- availTop: t.availTop ?? 0,
1977
- orientation: t.orientation ? {
1978
- type: t.orientation.type,
1979
- angle: t.orientation.angle
1980
- } : null,
1981
- isExtended: t.isExtended ?? !1,
1982
- viewport: {
1983
- height: window.innerHeight,
1984
- width: window.innerWidth,
1985
- scrollX: window.scrollX,
1986
- scrollY: window.scrollY,
1987
- dpr: window.devicePixelRatio
1988
- },
1989
- outerWidth: window.outerWidth,
1990
- outerHeight: window.outerHeight
1991
- };
1992
- }());
1993
- return e && t.push(e), () => {};
1994
- },
1995
- layer: "session"
1996
- },
1997
- wheel: {
1998
- create: function(t) {
1999
- let e = null, n = null;
2000
- const i = _((n) => {
2001
- const i = n;
2002
- e ? e.samples.ts.length >= 50 ? (t.push(e), e = o(i), r(t)) : (e.samples.deltaX.push(i.deltaX), e.samples.deltaY.push(i.deltaY), e.samples.deltaZ.push(i.deltaZ), e.samples.deltaMode.push(i.deltaMode), e.samples.isTrusted.push(i.isTrusted), e.samples.ts.push(i.timeStamp), r(t)) : (e = o(i), r(t));
2003
- });
2004
- function o(t) {
2005
- return {
2006
- name: "wheel",
2007
- timestamp: Date.now(),
2008
- samples: {
2009
- deltaX: [t.deltaX],
2010
- deltaY: [t.deltaY],
2011
- deltaZ: [t.deltaZ],
2012
- deltaMode: [t.deltaMode],
2013
- isTrusted: [t.isTrusted],
2014
- ts: [t.timeStamp]
2015
- }
2016
- };
2017
- }
2018
- function r(t) {
2019
- n && clearTimeout(n), n = setTimeout(() => {
2020
- e && (t.push(e), e = null), n = null;
2021
- }, F);
2022
- }
2023
- return T(window, "wheel", i), () => {
2024
- x(window, "wheel", i), n && (clearTimeout(n), n = null), e && (t.push(e), e = null);
2025
- };
2026
- },
2027
- layer: "behavioral"
2028
- },
2029
- hover: {
2030
- create: function(t) {
2031
- const e = _((e) => {
2032
- const n = e, o = K(n.target);
2033
- o && o !== K(n.relatedTarget) && t.push(i(n, "enter", o));
2034
- }), n = _((e) => {
2035
- const n = e, o = K(n.target);
2036
- o && o !== K(n.relatedTarget) && t.push(i(n, "leave", o));
2037
- });
2038
- function i(e, n, i) {
2039
- return {
2040
- name: "hover",
2041
- type: n,
2042
- timestamp: Date.now(),
2043
- ts: e.timeStamp,
2044
- isTrusted: e.isTrusted,
2045
- pointerType: G[e.pointerType] ?? "unknown",
2046
- element: t.resolveElement(i)
2047
- };
2048
- }
2049
- return T(document, "pointerover", e), T(document, "pointerout", n), () => {
2050
- x(document, "pointerover", e), x(document, "pointerout", n);
2051
- };
2052
- },
2053
- layer: "behavioral"
2054
- },
2055
- shinsei: {
2056
- create: function(t) {
2057
- const e = new URLSearchParams(window.location.search).get("source");
2058
- function n(e) {
2059
- const n = t.sanitizeUrl(e);
2060
- try {
2061
- return new URL(n).pathname;
2062
- } catch {
2063
- return n;
2064
- }
2065
- }
2066
- function i(i, o) {
2067
- return function(e) {
2068
- e.pageUrl = t.sanitizeUrl(e.pageUrl);
2069
- for (const i of e.events) {
2070
- if ("page" !== i.type) continue;
2071
- const e = i.data;
2072
- e.url && (e.url = n(e.url)), e.referrer && (e.referrer = t.sanitizeUrl(e.referrer));
2073
- }
2074
- }(o), {
2075
- name: "shinsei_batch",
2076
- timestamp: Date.now(),
2077
- delivery: i,
2078
- source: e,
2079
- batch: o
2080
- };
2081
- }
2082
- return I(() => function(t, e) {
2083
- return !un && (un = !0, function() {
2084
- Ot = performance.now(), jt = !1, Bt.push({
2085
- type: "page",
2086
- t: performance.now(),
2087
- data: {
2088
- event: "load",
2089
- referrer: document.referrer
2090
- }
2091
- });
2092
- const t = () => setTimeout(() => Qt(), 1500);
2093
- "complete" === document.readyState ? t() : window.addEventListener("load", t, { once: !0 }), window.addEventListener("popstate", () => setTimeout(() => Qt(), 500));
2094
- const e = history.pushState.bind(history);
2095
- history.pushState = function(...t) {
2096
- e(...t), setTimeout(() => Qt(), 500);
2097
- }, document.addEventListener("visibilitychange", Yt), window.addEventListener("focus", Jt), window.addEventListener("blur", Gt), document.addEventListener("mousemove", Kt, { passive: !0 }), document.addEventListener("keydown", Kt, { passive: !0 }), document.addEventListener("scroll", Kt, { passive: !0 }), document.addEventListener("click", Kt, { passive: !0 });
2098
- }(), nt = performance.now(), pt = null, wt = 0, ut = 0, lt = 0, dt = 0, ft = 0, ht = !1, mt.length = 0, document.addEventListener("mousemove", yt, { passive: !0 }), document.addEventListener("click", vt, { passive: !0 }), document.addEventListener("contextmenu", gt, { passive: !0 }), document.addEventListener("mouseenter", bt, {
2099
- passive: !0,
2100
- capture: !0
2101
- }), document.addEventListener("mouseleave", kt, {
2102
- passive: !0,
2103
- capture: !0
2104
- }), document.addEventListener("keydown", At, { passive: !0 }), document.addEventListener("keyup", Dt, { passive: !0 }), document.addEventListener("paste", Ct, { passive: !0 }), Pt = performance.now(), zt = window.scrollY, window.addEventListener("scroll", Ht, { passive: !0 }), window.addEventListener("wheel", Ft, { passive: !0 }), document.addEventListener("focus", ie, {
2105
- capture: !0,
2106
- passive: !0
2107
- }), document.addEventListener("input", ie, {
2108
- capture: !0,
2109
- passive: !0
2110
- }), document.addEventListener("click", ie, {
2111
- capture: !0,
2112
- passive: !0
2113
- }), document.addEventListener("keydown", Me, {
2114
- capture: !0,
2115
- passive: !0
2116
- }), document.addEventListener("keydown", Ae, {
2117
- capture: !0,
2118
- passive: !0
2119
- }), document.addEventListener("input", Ce, {
2120
- capture: !0,
2121
- passive: !0
2122
- }), document.addEventListener("focus", Ee, {
2123
- capture: !0,
2124
- passive: !0
2125
- }), document.addEventListener("mousedown", _e, {
2126
- capture: !0,
2127
- passive: !0
2128
- }), document.addEventListener("submit", Ie, {
2129
- capture: !0,
2130
- passive: !0
2131
- }), document.addEventListener("submit", De, {
2132
- capture: !0,
2133
- passive: !0
2134
- }), Be(Pe()), we = new MutationObserver((t) => {
2135
- for (const e of t) for (const t of Array.from(e.addedNodes)) {
2136
- if (!(t instanceof HTMLElement)) continue;
2137
- const e = Le(t) ? [t] : [];
2138
- t.querySelectorAll("input, textarea, select").forEach((t) => e.push(t)), Be(e);
2139
- }
2140
- }), we.observe(document.body, {
2141
- subtree: !0,
2142
- childList: !0
2143
- }), tn(t, e, [
2144
- te,
2145
- Tt,
2146
- Lt,
2147
- Ut,
2148
- oe,
2149
- je
2150
- ], ln), !0);
2151
- }({
2152
- send(e) {
2153
- I(() => t.push(i("interval", e)));
2154
- },
2155
- beacon(e) {
2156
- I(() => {
2157
- t.push(i("beacon", e)), t.flush();
2158
- });
2159
- }
2160
- }, t.getActivityId)), () => {
2161
- I(() => {
2162
- un && (un = !1, document.removeEventListener("visibilitychange", Yt), window.removeEventListener("focus", Jt), window.removeEventListener("blur", Gt), document.removeEventListener("mousemove", Kt), document.removeEventListener("keydown", Kt), document.removeEventListener("scroll", Kt), document.removeEventListener("click", Kt), Vt(), jt = !1, document.removeEventListener("mousemove", yt), document.removeEventListener("click", vt), document.removeEventListener("contextmenu", gt), document.removeEventListener("mouseenter", bt, { capture: !0 }), document.removeEventListener("mouseleave", kt, { capture: !0 }), pt = null, document.removeEventListener("keydown", At), document.removeEventListener("keyup", Dt), document.removeEventListener("paste", Ct), St.clear(), window.removeEventListener("scroll", Ht), window.removeEventListener("wheel", Ft), document.removeEventListener("focus", ie, { capture: !0 }), document.removeEventListener("input", ie, { capture: !0 }), document.removeEventListener("click", ie, { capture: !0 }), document.removeEventListener("keydown", Me, !0), document.removeEventListener("keydown", Ae, !0), document.removeEventListener("input", Ce, !0), document.removeEventListener("focus", Ee, !0), document.removeEventListener("mousedown", _e, !0), document.removeEventListener("submit", Ie, !0), document.removeEventListener("submit", De, !0), we && (we.disconnect(), we = null), Ge && clearInterval(Ge), document.removeEventListener("visibilitychange", en), window.removeEventListener("beforeunload", nn), We = null, Je = null);
2163
- });
2164
- };
2165
- },
2166
- layer: "behavioral"
2167
- },
2168
- fpsignals: {
2169
- create: function(t, e, i) {
2170
- const o = p(i, "device"), s = p(i, "pid"), c = p(i, "behaviour"), u = new a();
2171
- let l, d = !1, f = null;
2172
- const h = new Promise(function(t) {
2173
- l = t;
2174
- });
2175
- function m(e) {
2176
- if (!e) return !1;
2177
- const n = {
2178
- name: "fp_signals",
2179
- timestamp: Date.now(),
2180
- signals: e
2181
- };
2182
- return t.push(n), !0;
2183
- }
2184
- function w() {
2185
- return !!u.isReady() && m(u.getSignals(r.Behaviour));
2186
- }
2187
- function y(t) {
2188
- const e = I(() => u.getSignals(t));
2189
- return e && I(() => m(e)) ? e : null;
2190
- }
2191
- L = h;
2192
- const v = _(() => {
2193
- "hidden" === document.visibilityState && w() && t.flush();
2194
- }), g = _((e) => {
2195
- ("click" !== e.type || e.target instanceof Element && e.target.closest(b)) && w() && t.flush();
2196
- });
2197
- return E(async () => {
2198
- if (await u.initialize("https://cdn.incodesmile.com/ml-wasm-kit-release/v2.14.54-pre1-fpsignals3/fpSignals/fpSignalsLib.wasm", "https://cdn.incodesmile.com/ml-wasm-kit-release/v2.14.54-pre1-fpsignals3/fpSignals/fpSignalsLibSimd.wasm"), d) return void u.freeResources();
2199
- if (u.setHostInfo(t.host.platform, t.host.version), c && (u.setBehaviourCollectionEnabled(!0), f = setInterval(A(w), 1e4), T(document, "visibilitychange", v), T(document, "submit", g), T(document, "click", g)), !o && !s) return;
2200
- if (await u.collect(), d) return;
2201
- const e = o ? y(r.Device) : null, i = s ? y(r.PID) : null;
2202
- l({
2203
- pid: i,
2204
- device: e
2205
- });
2206
- }).then(function() {
2207
- l(null);
2208
- }), () => {
2209
- d = !0, l(null), L === h && (L = null), null !== f && clearInterval(f), x(document, "visibilitychange", v), x(document, "submit", g), x(document, "click", g), I(() => {
2210
- c && w();
2211
- }), I(() => u.freeResources());
2212
- };
2213
- },
2214
- layer: "device-fingerprinting",
2215
- events: [
2216
- "device",
2217
- "pid",
2218
- "behaviour"
2219
- ]
2220
- }
2221
- };
2222
- const fn = Object.keys(dn);
2223
- const hn = [
2224
- /^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$/i,
2225
- /^0b[01]+$/i,
2226
- /^0o[0-7]+$/i,
2227
- /^0x[0-9a-f]+$/i,
2228
- /^[a-z][a-z0-9]{1,12}:[A-Za-z0-9+/=_-]{6,}$/i,
2229
- /^[a-z]{2,8}_(?=.*\d)[A-Za-z0-9]{3,}$/,
2230
- /^\d{4,}$/,
2231
- /@/,
2232
- /^[A-Za-z0-9_-]{10,}\.[A-Za-z0-9_-]{5,}\.[A-Za-z0-9_-]{10,}$/,
2233
- /^[A-Za-z0-9_-]{20,}={0,2}$/,
2234
- /^[0-9a-f]{7,}$/i
2235
- ];
2236
- function mn(t) {
2237
- try {
2238
- const e = new URL(t, location.href);
2239
- e.username = "", e.password = "", e.hash = "";
2240
- const n = [...e.searchParams.keys()], i = n.length > 0 ? "?" + n.map((t) => `${encodeURIComponent(t)}=<redacted>`).join("&") : "";
2241
- e.search = "", e.pathname = e.pathname.split("/").map((t) => "" !== t && function(t) {
2242
- for (const e of hn) if (e.test(t)) return !0;
2243
- return !1;
2244
- }(t) ? ":param" : t).join("/");
2245
- const o = e.origin + e.pathname + i;
2246
- return o.length > 2048 ? o.slice(0, 2048) : o;
2247
- } catch {
2248
- return "";
2249
- }
2250
- }
2251
- const pn = "idle";
2252
- const wn = "ready";
2253
- const yn = "started";
2254
- const vn = "collection-disabled";
2255
- const gn = "init-failed";
2256
- const bn = {
2257
- flush: {
2258
- intervalMs: 2e3,
2259
- maxIntervalMs: 3e4,
2260
- size: 50,
2261
- backoffFailureThreshold: 2
2262
- },
2263
- queue: { size: 100 }
2264
- };
2265
- function kn() {
2266
- const t = {};
2267
- for (const e of fn) t[e] = Sn(e, void 0, !0);
2268
- return t;
2269
- }
2270
- function Tn(t) {
2271
- const e = {};
2272
- for (const n of fn) e[n] = Sn(n, void 0, t[dn[n].layer] ?? !1);
2273
- return e;
2274
- }
2275
- function xn(t) {
2276
- const e = {};
2277
- for (const n of fn) {
2278
- const i = t[n];
2279
- e[n] = Sn(n, i, i?.enabled ?? !1);
2280
- }
2281
- return e;
2282
- }
2283
- function Sn(t, e, n) {
2284
- const i = dn[t]?.events ?? [];
2285
- if (0 === i.length) return { enabled: n };
2286
- const o = e?.events, r = {};
2287
- for (const t of i) r[t] = { enabled: o?.[t] ?? !0 };
2288
- return {
2289
- enabled: n,
2290
- events: r
2291
- };
2292
- }
2293
- function Mn(t) {
2294
- if (!t) return null;
2295
- const e = t.split(".")[1], n = atob(e.replace(/-/g, "+").replace(/_/g, "/"));
2296
- return JSON.parse(n);
2297
- }
2298
- const In = function(t, e = 30) {
2299
- if (!t) return !0;
2300
- const n = Mn(t);
2301
- return !n || "number" != typeof n.exp || 1e3 * n.exp <= Date.now() + 1e3 * e;
2302
- };
2303
- async function En(t, e) {
2304
- return globalThis.navigator && "locks" in globalThis.navigator && "request" in globalThis.navigator.locks && "query" in globalThis.navigator.locks ? navigator.locks.request(t, { mode: "exclusive" }, async () => E(e)) : E(e);
2305
- }
2306
- function _n(t) {
2307
- function e() {
2308
- return globalThis.window && globalThis.window[t] && void 0 !== globalThis.window[t];
2309
- }
2310
- return {
2311
- get: function(n) {
2312
- if (!e()) return null;
2313
- try {
2314
- const e = window[t].getItem(n) ?? "null";
2315
- return "null" === e ? null : JSON.parse(e);
2316
- } catch {
2317
- return null;
2318
- }
2319
- },
2320
- set: function(n, i) {
2321
- e() && I(() => window[t].setItem(n, JSON.stringify(i)));
2322
- },
2323
- remove: function(n) {
2324
- e() && I(() => window[t].removeItem(n));
2325
- },
2326
- key: function(n) {
2327
- return e() ? window[t].key(n) : null;
2328
- },
2329
- get length() {
2330
- return e() ? window[t].length : 0;
2331
- }
2332
- };
2333
- }
2334
- const An = _n("localStorage");
2335
- const Dn = _n("sessionStorage");
2336
- const Cn = "__tri";
2337
- const Ln = `${Cn}_activity_token`;
2338
- const Rn = `${Cn}_activity_id`;
2339
- const zn = `${Cn}_activity_status`;
2340
- const Pn = "__tri_activity_lock";
2341
- var $n = class {
2342
- constructor(t) {
2343
- this.context = t, this.h = null, this.m = null, this.p = null, this.v = null, this.k = null, this.T = !1;
2344
- }
2345
- getToken() {
2346
- return this.h;
2347
- }
2348
- getActivityId() {
2349
- return this.m ?? "";
2350
- }
2351
- isActive() {
2352
- return "ACTIVE" === this.p && null !== this.h;
2353
- }
2354
- async start() {
2355
- return this.T = !0, this.v || (this.v = this.S()), this.v;
2356
- }
2357
- async stop() {
2358
- const t = this.M();
2359
- this.k = t;
2360
- try {
2361
- await t;
2362
- } finally {
2363
- this.k === t && (this.k = null);
2364
- }
2365
- }
2366
- async M() {
2367
- this.T = !1, this.p = "INACTIVE", this.I(null), this.v = null, this.h && await this.context.stopActivity(), this._(null);
2368
- }
2369
- async refresh() {
2370
- if (!this.T) return;
2371
- const t = this.h;
2372
- await En(Pn, async () => {
2373
- if (this.h && this.h !== t && !In(this.h) && "ACTIVE" === this.p) return;
2374
- const e = this.A();
2375
- e && e.token !== t && !In(e.token) && "ACTIVE" === e.activityStatus ? this._(e) : (this.D(), await this.C());
2376
- });
2377
- }
2378
- async S() {
2379
- try {
2380
- if (this.k && await this.k, this.h && !In(this.h)) return;
2381
- await En(Pn, async () => {
2382
- await this.C();
2383
- });
2384
- } finally {
2385
- this.v = null;
2386
- }
2387
- }
2388
- async C() {
2389
- const t = this.A();
2390
- if (t && !In(t.token) && "ACTIVE" === t.activityStatus) return void this._(t);
2391
- t && this.D();
2392
- const e = await this.context.startActivity();
2393
- if (!e.ok) return;
2394
- if (!e.data.token) return;
2395
- const n = e.data;
2396
- this._(n), this.L(n);
2397
- }
2398
- A() {
2399
- const [t, e, n] = [
2400
- An.get(Ln),
2401
- An.get(Rn),
2402
- An.get(zn)
2403
- ];
2404
- return t && e && n ? {
2405
- token: t,
2406
- activityId: e,
2407
- activityStatus: n
2408
- } : ((t || e || n) && this.D(), null);
2409
- }
2410
- L(t) {
2411
- An.set(Ln, t.token), An.set(Rn, t.activityId), An.set(zn, t.activityStatus);
2412
- }
2413
- D() {
2414
- this.I(null), this._(null);
2415
- }
2416
- I(t) {
2417
- if (!t) return An.remove(Ln), An.remove(Rn), void An.remove(zn);
2418
- An.set(Ln, t.token), An.set(Rn, t.activityId), An.set(zn, t.activityStatus);
2419
- }
2420
- _(t) {
2421
- if (!t) return this.h = null, this.m = null, void (this.p = null);
2422
- this.h = t.token, this.m = t.activityId, this.p = t.activityStatus;
2423
- }
2424
- };
2425
- const Hn = [
2426
- 401,
2427
- 403,
2428
- 409
2429
- ];
2430
- const Fn = Object.freeze({
2431
- tab: 80,
2432
- navigation: 80,
2433
- visibility: 80,
2434
- network: 80,
2435
- screen: 80,
2436
- shinsei_batch: 80,
2437
- fp_signals: 80,
2438
- pointer: 60,
2439
- keystroke: 60,
2440
- autofill: 60,
2441
- change: 60,
2442
- form: 60,
2443
- form_snapshot: 60,
2444
- clipboard: 60,
2445
- selection: 60,
2446
- focus: 60,
2447
- viewport: 60,
2448
- network_request: 60,
2449
- scroll: 40,
2450
- sensors: 40,
2451
- wheel: 40,
2452
- hover: 40
2453
- });
2454
- function Un(t) {
2455
- return "pointer" === t.name && "move" === t.phase || "viewport" === t.name && "resize" === t.type ? 40 : Fn[t.name];
2456
- }
2457
- const Bn = Object.freeze({
2458
- tri: "/events/capture",
2459
- shinsei: "/events/capture/shinsei",
2460
- "fp-signals": "/events/capture/fp-signals"
2461
- });
2462
- const On = /* @__PURE__ */ new Map([["shinsei_batch", "shinsei"], ["fp_signals", "fp-signals"]]);
2463
- function jn(t) {
2464
- return On.get(t.name) ?? "tri";
2465
- }
2466
- const Nn = new Array(256);
2467
- for (let t = 0; t < 256; t++) Nn[t] = (t + 256).toString(16).slice(1);
2468
- const qn = /* @__PURE__ */ new Uint8Array(16);
2469
- function Wn(t) {
2470
- return Nn[t[0]] + Nn[t[1]] + Nn[t[2]] + Nn[t[3]] + "-" + Nn[t[4]] + Nn[t[5]] + "-" + Nn[t[6]] + Nn[t[7]] + "-" + Nn[t[8]] + Nn[t[9]] + "-" + Nn[t[10]] + Nn[t[11]] + Nn[t[12]] + Nn[t[13]] + Nn[t[14]] + Nn[t[15]];
2471
- }
2472
- function Xn() {
2473
- return crypto.randomUUID();
2474
- }
2475
- function Yn() {
2476
- return crypto.getRandomValues(qn), qn[6] = 15 & qn[6] | 64, qn[8] = 63 & qn[8] | 128, Wn(qn);
2477
- }
2478
- function Jn() {
2479
- for (let t = 0; t < 16; t++) qn[t] = 256 * Math.random() | 0;
2480
- return qn[6] = 15 & qn[6] | 64, qn[8] = 63 & qn[8] | 128, Wn(qn);
2481
- }
2482
- const Gn = function() {
2483
- if ("undefined" != typeof crypto) {
2484
- if ("function" == typeof crypto.randomUUID) return Xn;
2485
- if ("function" == typeof crypto.getRandomValues) return Yn;
2486
- }
2487
- return Jn;
2488
- }();
2489
- function Vn() {
2490
- return Gn();
2491
- }
2492
- var Zn = class {
2493
- constructor(t, e) {
2494
- this.R = t, this.P = e, this.$ = [], this.H = null, this.F = [], this.U = null, this.T = !1, this.B = !0, this.O = 0, this.j = 0, this.N = 0, this.q = t.flush.intervalMs;
2495
- }
2496
- push(t) {
2497
- if (this.T) {
2498
- if (this.$.length < this.W() ? this.$.push(t) : this.X(t), this.B) return this.$.length >= this.R.flush.size ? (C(this.H), this.H = null, void this.flush("capacity")) : void this.Y();
2499
- } else e.warn("Transport", "push() called before start() — event dropped");
2500
- }
2501
- flush(t) {
2502
- if (this.T && this.P.isActivityActive()) try {
2503
- if ("lifecycle" === t) return void this.J();
2504
- if (0 === this.$.length) return;
2505
- if ("submit" === t && !this.B) return;
2506
- const n = "submit" === t;
2507
- for (const i of this.G(!1)) {
2508
- const o = this.V(i, t, n ? this.Z() : void 0);
2509
- o && (n ? this.K(o) : this.P.ingest(o, !1)).then((t) => this.tt(t, o)).catch(() => {
2510
- e.warn("Transport", "ingest threw unexpectedly — batch dropped");
2511
- });
2512
- }
2513
- this.$.length > 0 && this.Y();
2514
- } catch (t) {
2515
- e.warn("Transport", "flush() threw unexpectedly:", t);
2516
- }
2517
- }
2518
- start() {
2519
- this.T || (this.T = !0, this.B = "undefined" == typeof navigator || navigator.onLine);
2520
- }
2521
- stop() {
2522
- if (!this.T) return Promise.resolve();
2523
- C(this.H), this.H = null, C(this.U), this.U = null;
2524
- const t = this.J();
2525
- return this.T = !1, t;
2526
- }
2527
- onConnectionChange() {
2528
- const t = "undefined" == typeof navigator || navigator.onLine;
2529
- if (t !== this.B) {
2530
- if (this.B = t, !this.B) return C(this.H), this.H = null, C(this.U), void (this.U = null);
2531
- this.$.length > 0 && this.Y(), this.F.length > 0 && this.et();
2532
- }
2533
- }
2534
- Y() {
2535
- this.T && this.B && null === this.H && (this.H = D(() => {
2536
- this.H = null, this.flush("interval");
2537
- }, this.q));
2538
- }
2539
- et() {
2540
- this.T && this.B && null === this.U && (this.U = D(() => {
2541
- this.U = null, this.nt();
2542
- }, this.q));
2543
- }
2544
- nt() {
2545
- if (!this.T || !this.B || 0 === this.F.length || !this.P.isActivityActive()) return;
2546
- const t = this.F.shift();
2547
- this.P.ingest(t.batch, !1).then((e) => this.it(e, t)).catch(() => {
2548
- e.warn("Transport", "retry drain ingest threw unexpectedly — batch dropped"), this.F.length > 0 && this.et();
2549
- });
2550
- }
2551
- ot(t, n) {
2552
- this.F.length >= 5 && (this.F.shift(), e.warn("Transport", "retry queue full — oldest batch evicted")), this.F.push({
2553
- batch: t,
2554
- attempts: n
2555
- }), this.et();
2556
- }
2557
- tt(t, e) {
2558
- t.ok ? this.rt() : this.st(t) && this.ot(e, 1);
2559
- }
2560
- it(t, n) {
2561
- if (t.ok) return this.rt(), void (this.F.length > 0 && this.et());
2562
- if (this.st(t)) {
2563
- if (n.attempts >= 3) return this.ct(), e.warn("Transport", "batch dropped after MAX_RETRY_ATTEMPTS", n.batch.batchId), void (this.F.length > 0 && this.et());
2564
- this.ct(), this.ot(n.batch, n.attempts + 1);
2565
- } else this.F.length > 0 && this.et();
2566
- }
2567
- ct() {
2568
- this.O++, this.O % this.R.flush.backoffFailureThreshold === 0 && (this.q = Math.min(2 * this.q, this.R.flush.maxIntervalMs));
2569
- }
2570
- rt() {
2571
- this.O = 0, this.q = this.R.flush.intervalMs;
2572
- }
2573
- W() {
2574
- return this.R.queue.size * (this.B ? 1 : 2);
2575
- }
2576
- async J() {
2577
- if (!this.P.isActivityActive()) return Promise.resolve();
2578
- const t = [];
2579
- let n = this.Z();
2580
- for (const i of this.G(!0)) {
2581
- const o = this.V(i, "lifecycle", n);
2582
- o && (n -= Kn(o.events), t.push(this.K(o).catch(() => {
2583
- e.warn("Transport", "lifecycle ingest threw — batch dropped");
2584
- })));
2585
- }
2586
- const i = [];
2587
- for (const o of this.F) {
2588
- const r = Kn(o.batch.events);
2589
- r > n ? i.push(o) : (n -= r, t.push(this.K(o.batch).catch(() => {
2590
- e.warn("Transport", "lifecycle retry ingest threw — batch dropped");
2591
- })));
2592
- }
2593
- return this.F = i, Promise.allSettled(t).then(() => {});
2594
- }
2595
- Z() {
2596
- return Math.max(0, 49152 - this.N);
2597
- }
2598
- K(t) {
2599
- const e = Kn(t.events);
2600
- return this.N += e, this.P.ingest(t, !0).finally(() => {
2601
- this.N -= e;
2602
- });
2603
- }
2604
- X(t) {
2605
- const e = Un(t);
2606
- for (let n = 0; n < this.$.length; n++) if (Un(this.$[n]) < e) {
2607
- for (let t = n; t < this.$.length - 1; t++) this.$[t] = this.$[t + 1];
2608
- this.$.length -= 1, this.$.push(t);
2609
- return;
2610
- }
2611
- }
2612
- V(t, e, n) {
2613
- const i = this.ut(t, "lifecycle" === e, n);
2614
- return 0 === i.length ? null : {
2615
- activityId: "",
2616
- batchId: Vn(),
2617
- batchSequence: this.j++,
2618
- clientTimestamp: Date.now(),
2619
- schemaVersion: "0.1.0",
2620
- sdkVersion: "0.5.1",
2621
- sdkPlatform: "web",
2622
- tabId: this.P.getTabId(),
2623
- events: i
2624
- };
2625
- }
2626
- ut(t, e, n) {
2627
- const i = this.R.flush.size, o = /* @__PURE__ */ new Set();
2628
- let r = 0;
2629
- for (let s = 0; s < this.$.length && o.size < i; s++) {
2630
- const i = e ? this.$.length - 1 - s : s, a = this.$[i];
2631
- if (jn(a) === t) {
2632
- if (void 0 !== n && (r += Qn(a), r > n)) break;
2633
- o.add(i);
2634
- }
2635
- }
2636
- if (0 === o.size) return [];
2637
- const s = [], a = [];
2638
- for (let t = 0; t < this.$.length; t++) o.has(t) ? s.push(this.$[t]) : a.push(this.$[t]);
2639
- return this.$ = a, s;
2640
- }
2641
- G(t) {
2642
- const e = [];
2643
- for (let n = 0; n < this.$.length; n++) {
2644
- const i = jn(this.$[t ? this.$.length - 1 - n : n]);
2645
- e.includes(i) || e.push(i);
2646
- }
2647
- return e;
2648
- }
2649
- st(t) {
2650
- if (t.ok) return !1;
2651
- switch (t.kind) {
2652
- case "timeout":
2653
- case "server":
2654
- case "rate_limited":
2655
- case "network": return !0;
2656
- default: return !1;
2657
- }
2658
- }
2659
- };
2660
- function Kn(t) {
2661
- let e = 0;
2662
- for (let n = 0; n < t.length; n++) e += Qn(t[n]);
2663
- return e;
2664
- }
2665
- function Qn(t) {
2666
- try {
2667
- return JSON.stringify(t).length + 1;
2668
- } catch {
2669
- return 0;
2670
- }
2671
- }
2672
- const ti = "tri:bcast:";
2673
- const ei = "function" == typeof BroadcastChannel ? BroadcastChannel : function() {
2674
- if ("undefined" == typeof Storage || "undefined" == typeof window) return !1;
2675
- try {
2676
- const t = "__tri_bcast_probe__";
2677
- localStorage.setItem(t, "1");
2678
- const e = "1" === localStorage.getItem(t);
2679
- return localStorage.removeItem(t), e;
2680
- } catch {
2681
- return !1;
2682
- }
2683
- }() ? class {
2684
- constructor(t) {
2685
- this.seq = 0, this.closed = !1, this.listeners = /* @__PURE__ */ new Set(), this.onStorageEvent = (t) => {
2686
- if (this.closed) return;
2687
- if (!t.key || !t.key.startsWith(`${ti}${this.channelName}:`)) return;
2688
- if (null === t.newValue) return;
2689
- let e;
2690
- I(() => An.remove(t.key));
2691
- try {
2692
- e = JSON.parse(t.newValue);
2693
- } catch {
2694
- return;
2695
- }
2696
- const n = { data: e };
2697
- for (const t of this.listeners) I(() => t(n));
2698
- }, this.channelName = t, this.senderId = Vn(), window.addEventListener("storage", this.onStorageEvent);
2699
- }
2700
- postMessage(t) {
2701
- if (this.closed) return;
2702
- const e = `${ti}${this.channelName}:${this.senderId}:${this.seq++}`;
2703
- I(() => {
2704
- An.set(e, t), An.remove(e);
2705
- });
2706
- }
2707
- addEventListener(t, e) {
2708
- this.listeners.add(e);
2709
- }
2710
- removeEventListener(t, e) {
2711
- this.listeners.delete(e);
2712
- }
2713
- close() {
2714
- this.closed || (this.closed = !0, window.removeEventListener("storage", this.onStorageEvent), this.listeners.clear());
2715
- }
2716
- } : class {
2717
- constructor(t) {
2718
- 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.");
2719
- }
2720
- postMessage(t) {}
2721
- addEventListener(t, e) {}
2722
- removeEventListener(t, e) {}
2723
- close() {}
2724
- };
2725
- const ni = "__tri_tabId";
2726
- var ii = class {
2727
- constructor(t) {
2728
- this.context = t, this.lt = "", this.T = !1, this.dt = null, this.ft = null, this.ht = null, this.wt = /* @__PURE__ */ new Map(), this.yt = -1, this.vt = null;
2729
- }
2730
- async start() {
2731
- this.T || (this.T = !0, this.lt = this.gt(), this.bt(), this.kt({
2732
- type: "hello",
2733
- tabId: this.lt,
2734
- ts: Date.now()
2735
- }), this.Tt(), this.xt("active"), this.St());
2736
- }
2737
- stop() {
2738
- this.T && (this.T = !1, this.xt("inactive"), this.kt({
2739
- type: "bye",
2740
- tabId: this.lt,
2741
- ts: Date.now()
2742
- }), this.Mt(this.It()), this.Et(), this._t(), this.At());
2743
- }
2744
- getTabId() {
2745
- return this.lt;
2746
- }
2747
- queryTabsNumber() {
2748
- return this.wt.size + 1;
2749
- }
2750
- bt() {
2751
- try {
2752
- this.dt = new ei("__tri_tab_channel"), this.vt = this.Dt.bind(this), this.dt.addEventListener("message", this.vt);
2753
- } catch (t) {
2754
- e.warn("TabManager", "failed to open broadcast channel:", t);
2755
- }
2756
- }
2757
- At() {
2758
- try {
2759
- if (!this.dt) return;
2760
- this.vt && this.dt.removeEventListener("message", this.vt), this.dt.close();
2761
- } catch {} finally {
2762
- this.dt = null, this.vt = null;
2763
- }
2764
- }
2765
- Tt() {
2766
- this.ft = setInterval(() => {
2767
- const t = Date.now();
2768
- this.kt({
2769
- type: "heartbeat",
2770
- tabId: this.lt,
2771
- ts: t
2772
- });
2773
- }, 1e3);
2774
- }
2775
- Et() {
2776
- null != this.ft && (clearInterval(this.ft), this.ft = null);
2777
- }
2778
- St() {
2779
- null != this.ht && clearTimeout(this.ht), this.ht = setTimeout(() => {
2780
- this.ht = null;
2781
- const t = this.It() + 1;
2782
- t !== this.yt && (this.yt = t, this.Mt(t));
2783
- }, 1e3);
2784
- }
2785
- _t() {
2786
- null != this.ht && (clearTimeout(this.ht), this.ht = null);
2787
- }
2788
- kt(t) {
2789
- try {
2790
- if (!this.dt) return;
2791
- this.dt.postMessage(t);
2792
- } catch {
2793
- e.warn("TabManager", "failed to broadcast message:", t);
2794
- }
2795
- }
2796
- Dt(t) {
2797
- const { type: e, tabId: n } = t.data;
2798
- if (n === this.lt) return;
2799
- const i = Date.now();
2800
- "hello" === e ? (this.kt({
2801
- type: "ack",
2802
- tabId: this.lt,
2803
- ts: i,
2804
- to: n
2805
- }), this.wt.set(n, i)) : "heartbeat" === e || "ack" === e ? this.wt.set(n, i) : "bye" === e && this.wt.delete(n);
2806
- }
2807
- Mt(t) {
2808
- this.context.events.count && this.context.push({
2809
- name: "tab",
2810
- type: "count",
2811
- tabId: this.lt,
2812
- timestamp: Date.now(),
2813
- ts: performance.now(),
2814
- value: t
2815
- });
2816
- }
2817
- xt(t) {
2818
- this.context.events.state && this.context.push({
2819
- name: "tab",
2820
- type: "state",
2821
- tabId: this.lt,
2822
- timestamp: Date.now(),
2823
- ts: performance.now(),
2824
- value: t
2825
- });
2826
- }
2827
- gt() {
2828
- const t = Dn.get(ni);
2829
- if (t) return t;
2830
- const e = Vn();
2831
- return Dn.set(ni, e), e;
2832
- }
2833
- It(t = Date.now()) {
2834
- let e = 0;
2835
- for (const [n, i] of this.wt.entries()) t - i >= 3e3 ? this.wt.delete(n) : e++;
2836
- return e;
2837
- }
2838
- };
2839
- const oi = globalThis.CompressionStream;
2840
- const ri = globalThis.Response;
2841
- const si = globalThis.Blob;
2842
- const ai = new TextEncoder();
2843
- let ci = null;
2844
- async function ui(t) {
2845
- const n = await async function(t) {
2846
- if ("function" != typeof oi) return null;
2847
- try {
2848
- const e = ai.encode(t), n = new si([e]).stream().pipeThrough(new oi("gzip"));
2849
- return await new ri(n).arrayBuffer();
2850
- } catch (t) {
2851
- return e.warn("compression", "Native gzip failed:", t), null;
2852
- }
2853
- }(t);
2854
- return null !== n ? n : async function(t) {
2855
- try {
2856
- const n = await function() {
2857
- if (null === ci) {
2858
- const t = function(t, n = 1e4) {
2859
- let i = null;
2860
- const o = new Promise((t) => {
2861
- i = D(() => {
2862
- e.warn("import", `Import timed out after ${n}ms`), t(null);
2863
- }, n);
2864
- }), r = Promise.resolve().then(t).catch((t) => (e.warn("import", "Import failed:", t), null));
2865
- return Promise.race([r, o]).finally(() => {
2866
- C(i);
2867
- });
2868
- }(() => import("./browser-pQZA35G2-DtkAf6sn.esm.js"), 1e4);
2869
- ci = t, t.then((e) => {
2870
- null === e && D(() => {
2871
- ci === t && (ci = null);
2872
- }, 1e4);
2873
- });
2874
- }
2875
- return ci;
2876
- }();
2877
- if (null === n) return null;
2878
- const { gzipSync: i } = n, o = i(ai.encode(t));
2879
- return o.buffer.slice(o.byteOffset, o.byteOffset + o.byteLength);
2880
- } catch (t) {
2881
- return e.warn("compression", "fflate gzip failed:", t), null;
2882
- }
2883
- }(t);
2884
- }
2885
- function li(t, e) {
2886
- const n = [JSON.stringify(t)];
2887
- for (let t = 0; t < e.length; t++) try {
2888
- n.push(JSON.stringify(e[t]));
2889
- } catch {}
2890
- return n.join("\n");
2891
- }
2892
- function di(t) {
2893
- const e = { Accept: "application/json" };
2894
- 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]) => {
2895
- e[t] = n;
2896
- }), e;
2897
- }
2898
- const fi = "function" == typeof globalThis.fetch ? globalThis.fetch.bind(globalThis) : void 0;
2899
- function hi(t) {
2900
- "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' }.");
2901
- const n = function(t) {
2902
- const e = t?.timeout, n = t?.baseUrl ?? "", i = t?.api;
2903
- async function o(t, o, r) {
2904
- if (void 0 === fi) return {
2905
- ok: !1,
2906
- kind: "network"
2907
- };
2908
- const s = n ? `${n}${o}` : o, a = new AbortController();
2909
- let c = null, u = !1;
2910
- c = D(() => {
2911
- u = !0, a.abort();
2912
- }, e);
2913
- const l = r?.signal;
2914
- let d, f = () => {};
2915
- if (l) if (l.aborted) a.abort();
2916
- else {
2917
- const t = () => a.abort();
2918
- l.addEventListener("abort", t, { once: !0 }), f = () => l.removeEventListener("abort", t);
2919
- }
2920
- if (null != r && "body" in r && null != r.body) {
2921
- const t = function(t) {
2922
- if (null == t) return {
2923
- ok: !0,
2924
- body: void 0
2925
- };
2926
- if ("string" == typeof t || t instanceof ArrayBuffer || ArrayBuffer.isView(t) || t instanceof Blob || t instanceof FormData || t instanceof URLSearchParams || t instanceof ReadableStream) return {
2927
- ok: !0,
2928
- body: t
2929
- };
2930
- try {
2931
- return {
2932
- ok: !0,
2933
- body: JSON.stringify(t)
2934
- };
2935
- } catch {
2936
- return { ok: !1 };
2937
- }
2938
- }(r.body);
2939
- if (!t.ok) return C(c), f(), {
2940
- ok: !1,
2941
- kind: "serialize"
2942
- };
2943
- d = t.body;
2944
- }
2945
- try {
2946
- const e = await fi(s, {
2947
- method: t,
2948
- headers: di({
2949
- token: r?.token,
2950
- profileId: r?.profileId,
2951
- contentType: r?.contentType,
2952
- contentEncoding: r?.contentEncoding,
2953
- api: i,
2954
- hasBody: void 0 !== d,
2955
- customHeaders: r?.customHeaders
2956
- }),
2957
- body: d,
2958
- signal: a.signal,
2959
- keepalive: r?.keepalive
2960
- });
2961
- if (!e.ok) return 429 === (h = e.status) ? {
2962
- ok: !1,
2963
- kind: "rate_limited",
2964
- status: h
2965
- } : h >= 400 && h < 500 ? {
2966
- ok: !1,
2967
- kind: "client",
2968
- status: h
2969
- } : {
2970
- ok: !1,
2971
- kind: "server",
2972
- status: h
2973
- };
2974
- if (204 === e.status) return {
2975
- ok: !0,
2976
- data: void 0,
2977
- status: 204
2978
- };
2979
- try {
2980
- return {
2981
- ok: !0,
2982
- data: await e.json(),
2983
- status: e.status
2984
- };
2985
- } catch {
2986
- return a.signal.aborted ? u ? {
2987
- ok: !1,
2988
- kind: "timeout"
2989
- } : {
2990
- ok: !1,
2991
- kind: "abort"
2992
- } : {
2993
- ok: !1,
2994
- kind: "parse",
2995
- status: e.status
2996
- };
2997
- }
2998
- } catch {
2999
- return u ? {
3000
- ok: !1,
3001
- kind: "timeout"
3002
- } : a.signal.aborted ? {
3003
- ok: !1,
3004
- kind: "abort"
3005
- } : {
3006
- ok: !1,
3007
- kind: "network"
3008
- };
3009
- } finally {
3010
- C(c), f();
3011
- }
3012
- var h;
3013
- }
3014
- return {
3015
- post: async function(t, e) {
3016
- return o("POST", t, e);
3017
- },
3018
- get: async function(t, e) {
3019
- return o("GET", t, e);
3020
- }
3021
- };
3022
- }({
3023
- baseUrl: `${t.api.url}/api/v1`,
3024
- timeout: 1e4,
3025
- api: { version: t.api.version }
3026
- }), i = function(t) {
3027
- const { getToken: n, refresh: i } = t;
3028
- let o = null;
3029
- return { withAuth: async function(t, r) {
3030
- if (o) {
3031
- const e = await o;
3032
- if (e) return t(e);
3033
- }
3034
- const s = n() ?? "", a = await t(s);
3035
- if ((c = a).ok || !("rejected" === c.kind || "client" === c.kind && Hn.includes(c.status)) || !1 === r?.refreshable) return a;
3036
- var c;
3037
- const u = await (o || (o = async function() {
3038
- try {
3039
- return await i(), n();
3040
- } catch (t) {
3041
- return e.warn("AuthMiddleware", "auth refresh failed", t), null;
3042
- }
3043
- }().finally(() => {
3044
- o = null;
3045
- }), o));
3046
- return u && u !== s ? t(u) : a;
3047
- } };
3048
- }(t), o = () => ({ profileId: t.getProfileId() ?? void 0 });
3049
- return { api: {
3050
- ingest: async function(e, r) {
3051
- return i.withAuth(async (i) => {
3052
- const { events: s, ...a } = e, c = {
3053
- ...a,
3054
- activityId: t.getActivityId()
3055
- };
3056
- let u, l = !1;
3057
- try {
3058
- if (r) u = li(c, s);
3059
- else {
3060
- const t = await async function(t, e) {
3061
- const n = li(t, e), i = await ui(n);
3062
- return i ? {
3063
- type: "gzip",
3064
- body: i
3065
- } : {
3066
- type: "ndjson",
3067
- body: n
3068
- };
3069
- }(c, s);
3070
- u = t.body, l = "gzip" === t.type;
3071
- }
3072
- } catch {
3073
- return {
3074
- ok: !1,
3075
- kind: "serialize"
3076
- };
3077
- }
3078
- const d = await n.post(function(t) {
3079
- return t.length > 0 ? Bn[jn(t[0])] : Bn.tri;
3080
- }(s), {
3081
- body: u,
3082
- token: i,
3083
- keepalive: r,
3084
- contentType: "ndjson",
3085
- contentEncoding: l ? "gzip" : void 0,
3086
- ...o()
3087
- });
3088
- return function(t) {
3089
- return t.ok && !0 === t.data?.malformedBatch;
3090
- }(d) ? {
3091
- ok: !1,
3092
- kind: "rejected",
3093
- status: d.status
3094
- } : d;
3095
- }, { refreshable: !r });
3096
- },
3097
- reportEvent: async function(t) {
3098
- return i.withAuth((e) => n.post("/events/report-event", {
3099
- body: t,
3100
- token: e,
3101
- contentType: "json",
3102
- ...o()
3103
- }));
3104
- },
3105
- startActivity: async function() {
3106
- return n.post("/events/start-activity", {
3107
- token: t.getSdkToken(),
3108
- ...o()
3109
- });
3110
- },
3111
- stopActivity: async function() {
3112
- return i.withAuth((t) => n.post("/events/end-activity", {
3113
- token: t,
3114
- keepalive: !0,
3115
- ...o()
3116
- }), { refreshable: !1 });
3117
- },
3118
- collectionStatus: async function() {
3119
- return n.get("/sdk/collection-status", {
3120
- token: t.getSdkToken(),
3121
- ...o()
3122
- });
3123
- },
3124
- linkInterview: async function(e) {
3125
- const r = t.getToken();
3126
- return r && !In(r) || await t.refresh(), i.withAuth((t) => n.post("/events/link-interview", {
3127
- token: t,
3128
- contentType: "json",
3129
- ...o(),
3130
- customHeaders: { "X-Incode-Hardware-Id": e }
3131
- }), { refreshable: !1 });
3132
- }
3133
- } };
3134
- }
3135
- var mi = class {
3136
- constructor(t) {
3137
- this.context = t;
3138
- }
3139
- stop() {}
3140
- async report(t, n) {
3141
- const i = {
3142
- name: t,
3143
- metadata: n,
3144
- timestamp: Date.now(),
3145
- activityId: this.context.getActivityId() ?? ""
3146
- };
3147
- try {
3148
- const o = await this.context.reportEvent(i);
3149
- if (o.ok) return o;
3150
- e.warn("EventReport", "Failed to report event:", t, n, "with result:", o);
3151
- } catch (i) {
3152
- e.warn("EventReport", "Failed to report event:", t, n, "with error:", i);
3153
- }
3154
- }
3155
- };
3156
- const pi = /* @__PURE__ */ new Set([
3157
- "A",
3158
- "BUTTON",
3159
- "INPUT",
3160
- "SELECT",
3161
- "TEXTAREA",
3162
- "SUMMARY",
3163
- "DETAILS",
3164
- "LABEL",
3165
- "OPTION",
3166
- "FIELDSET"
3167
- ]);
3168
- const wi = /* @__PURE__ */ new Set([
3169
- "button",
3170
- "link",
3171
- "tab",
3172
- "menuitem",
3173
- "menuitemcheckbox",
3174
- "menuitemradio",
3175
- "checkbox",
3176
- "radio",
3177
- "switch",
3178
- "slider",
3179
- "spinbutton",
3180
- "combobox",
3181
- "listbox",
3182
- "option",
3183
- "searchbox",
3184
- "textbox",
3185
- "treeitem"
3186
- ]);
3187
- const yi = 255;
3188
- function vi(t, e, n, i = mn) {
3189
- const o = t.tagName.toLowerCase(), r = function(t) {
3190
- const e = t.parentElement?.children ?? [], n = Math.min(e.length, 1e3);
3191
- let i = n - 1, o = 0, r = 0;
3192
- for (let i = 0; i < n; i++) {
3193
- r++;
3194
- const n = e[i];
3195
- if (u(n, t.tagName) && o++, n === t) break;
3196
- }
3197
- return {
3198
- siblings: i,
3199
- ofType: o,
3200
- child: r
3201
- };
3202
- }(t), s = function(t, e, n) {
3203
- const i = function(t) {
3204
- if (!t) return null;
3205
- const e = t.getAttribute("data-tri-redact-attrs");
3206
- return e ? e.split(",").map((t) => t.trim().toLowerCase()) : null;
3207
- }(t), o = {}, r = t.id;
3208
- r && !h("id", i) && (o.id = r);
3209
- const s = t.getAttribute("autocomplete");
3210
- s && !h("autocomplete", i) && (o.autocomplete = s);
3211
- const a = t.getAttribute("aria-invalid");
3212
- a && !h("aria-invalid", i) && (o.ariaInvalid = a);
3213
- const c = t.getAttribute("tabindex");
3214
- c && !h("tabindex", i) && (o.tabIndex = parseInt(c, 10));
3215
- const u = function(t) {
3216
- return t.getAttribute("data-testid") ?? t.getAttribute("data-cy") ?? null;
3217
- }(t);
3218
- u && !h("data-testid", i) && (o.testId = u);
3219
- const l = t.hasAttribute("readonly");
3220
- l && !h("readonly", i) && (o.readOnly = l);
3221
- const d = t.hasAttribute("required");
3222
- d && !h("required", i) && (o.required = d);
3223
- const f = t.getAttribute("contenteditable");
3224
- f && !h("contenteditable", i) && (o.contentEditable = "true" === f || "" === f);
3225
- const p = t.getAttribute("href");
3226
- p && !h("href", i) && (o.href = {
3227
- ...e ? {} : { url: n(p) },
3228
- external: m(p)
3229
- });
3230
- const w = t.getAttribute("role");
3231
- w && !h("role", i) && (o.role = w);
3232
- const y = t.getAttribute("type");
3233
- y && !h("type", i) && (o.type = y);
3234
- const v = t.getAttribute("name");
3235
- v && !h("name", i) && (o.name = v);
3236
- const g = t.getAttribute("placeholder");
3237
- !g || e || h("placeholder", i) || (o.placeholder = g);
3238
- const b = Array.from(t.classList).slice(0, 5);
3239
- b.length > 0 && !h("class", i) && (o.classes = b);
3240
- const k = t.getAttribute("alt");
3241
- return !k || e || h("alt", i) || (o.alt = k), Object.keys(o).length ? o : null;
3242
- }(t, e, i);
3243
- return {
3244
- tagName: o,
3245
- frame: n,
3246
- ...s ? { attributes: s } : {},
3247
- ...r ? { nth: r } : {}
3248
- };
3249
- }
3250
- function gi(t, e) {
3251
- let n = 0;
3252
- const i = [];
3253
- return function(t) {
3254
- return pi.has(t.tagName);
3255
- }(t) && (n += 40, i.push("native")), function(t) {
3256
- return t.hasAttribute("data-tri-interactive");
3257
- }(t) && (n += 40, i.push("tri-interactive")), function(t) {
3258
- return u(t, "a") && t.hasAttribute("href");
3259
- }(t) && (n += 15, i.push("has-href")), function(t) {
3260
- const e = t.getAttribute("role");
3261
- return null !== e && wi.has(e);
3262
- }(t) && (n += 30, i.push("role")), function(t) {
3263
- return t.hasAttribute("onclick") || t.hasAttribute("ng-click") || t.hasAttribute("data-action") || t.hasAttribute("@click");
3264
- }(t) && (n += 20, i.push("click-handler")), function(t) {
3265
- const e = t.getAttribute("tabindex");
3266
- if (null === e) return !1;
3267
- const n = parseInt(e, 10);
3268
- return null !== n && n >= 0;
3269
- }(t) && (n += 10, i.push("tabindex")), (t.id || t.getAttribute("data-testid")) && (n += 5, i.push("has-id")), e > 0 && (n += Math.round(15 / e), i.push("depth")), {
3270
- score: n,
3271
- reasons: i
3272
- };
3273
- }
3274
- function bi(t) {
3275
- return t >= 20;
3276
- }
3277
- function ki(t) {
3278
- return null !== t && t.width > 0 && t.height > 0 && t.y < window.innerHeight && t.y + t.height > 0 && t.x < window.innerWidth && t.x + t.width > 0;
3279
- }
3280
- function Ti(t) {
3281
- return !0 === t.disabled || "true" === t.getAttribute("aria-disabled");
3282
- }
3283
- function xi(t, e = !1) {
3284
- if (e) return null;
3285
- const n = Mi(t, "labelledby");
3286
- if (n) return {
3287
- text: Ei(n),
3288
- resolutionMethod: "aria-labelledby",
3289
- confidence: "high"
3290
- };
3291
- const i = Ii(t);
3292
- if (i) return {
3293
- text: Ei(i),
3294
- resolutionMethod: "aria-label",
3295
- confidence: "high"
3296
- };
3297
- const o = function(t) {
3298
- if (!t.id) return null;
3299
- const e = document.querySelector(`label[for="${CSS.escape(t.id)}"]`);
3300
- return e ? Si(e) : null;
3301
- }(t);
3302
- if (o) return {
3303
- text: Ei(o),
3304
- resolutionMethod: "html-for",
3305
- confidence: "high"
3306
- };
3307
- const r = function(t) {
3308
- const e = t.closest("label");
3309
- return e ? Si(e) : null;
3310
- }(t);
3311
- if (r) return {
3312
- text: Ei(r),
3313
- resolutionMethod: "wrapping-label",
3314
- confidence: "high"
3315
- };
3316
- const s = function(t) {
3317
- return t.getAttribute("placeholder")?.trim() ?? null;
3318
- }(t);
3319
- if (s) return {
3320
- text: Ei(s),
3321
- resolutionMethod: "placeholder",
3322
- confidence: "low"
3323
- };
3324
- const a = function(t) {
3325
- return t.getAttribute("title")?.trim() ?? null;
3326
- }(t);
3327
- if (a) return {
3328
- text: Ei(a),
3329
- resolutionMethod: "title",
3330
- confidence: "low"
3331
- };
3332
- const c = Mi(t, "describedby");
3333
- if (c) return {
3334
- text: Ei(c),
3335
- resolutionMethod: "aria-describedby",
3336
- confidence: "low"
3337
- };
3338
- const u = Si(t);
3339
- return u ? {
3340
- text: u,
3341
- resolutionMethod: "text-content",
3342
- confidence: "low"
3343
- } : null;
3344
- }
3345
- function Si(t, e = 0) {
3346
- if (e > 8) return "";
3347
- if (c(t)) return function(t) {
3348
- return t ? t.trim().split(/(\s+)/).join("").replace(/[\r\n]/g, " ").replace(/[ ]+/g, " ").substring(0, yi) : null;
3349
- }(t.textContent) ?? "";
3350
- if (!t.childNodes?.length) return "";
3351
- let n = "";
3352
- for (const i of t.childNodes) {
3353
- const t = Si(i, e + 1);
3354
- if (t && (n = n ? `${n} ${t}` : t, n.length >= yi)) break;
3355
- }
3356
- return Ei(n);
3357
- }
3358
- function Mi(t, e) {
3359
- const n = "labelledby" === e ? "aria-labelledby" : "aria-describedby", i = t?.getAttribute(n);
3360
- if (!i) return null;
3361
- const o = i.split(/\s+/), r = [];
3362
- for (const t of o) {
3363
- const e = document.getElementById(t);
3364
- if (!e) continue;
3365
- const n = Ii(e) ?? Si(e);
3366
- n.length && r.push(n);
3367
- }
3368
- return r.length ? r.join(" ") : null;
3369
- }
3370
- function Ii(t) {
3371
- return t?.getAttribute("aria-label")?.trim() ?? null;
3372
- }
3373
- function Ei(t) {
3374
- return t.length > yi ? t.slice(0, yi) + "..." : t;
3375
- }
3376
- function _i(t) {
3377
- const e = t.getBoundingClientRect();
3378
- return {
3379
- x: e.x,
3380
- y: e.y,
3381
- width: e.width,
3382
- height: e.height
3383
- };
3384
- }
3385
- var Ai = class {
3386
- constructor(t) {
3387
- this.capacity = t, this.cache = /* @__PURE__ */ new Map();
3388
- }
3389
- get(t) {
3390
- return this.cache.get(t);
3391
- }
3392
- set(t, e) {
3393
- if (this.cache.has(t)) this.cache.delete(t);
3394
- else if (this.cache.size >= this.capacity) {
3395
- const t = this.cache.keys().next().value;
3396
- t && this.cache.delete(t);
3397
- }
3398
- this.cache.set(t, e);
3399
- }
3400
- delete(t) {
3401
- this.cache.delete(t);
3402
- }
3403
- clear() {
3404
- this.cache.clear();
3405
- }
3406
- size() {
3407
- return this.cache.size;
3408
- }
3409
- };
3410
- function Di() {
3411
- return {
3412
- height: window.innerHeight,
3413
- width: window.innerWidth,
3414
- scrollX: window.scrollX,
3415
- scrollY: window.scrollY,
3416
- dpr: window.devicePixelRatio
3417
- };
3418
- }
3419
- async function Ci(t, n) {
3420
- const { collectors: i, sdk: o } = t;
3421
- let r = null, s = null, a = null, c = null;
3422
- try {
3423
- r = hi({
3424
- api: {
3425
- version: o.api.version,
3426
- url: o.api.url
3427
- },
3428
- getSdkToken: () => o.token,
3429
- getProfileId: () => n.getProfileId(),
3430
- getToken: () => s?.getToken() ?? null,
3431
- refresh: async () => s?.refresh() ?? Promise.resolve(),
3432
- getActivityId: () => s?.getActivityId() ?? ""
3433
- });
3434
- const t = await r.api.collectionStatus();
3435
- if (!t.ok || !0 !== t.data.eventsCollectionEnabled) return { status: "collection-disabled" };
3436
- s = new $n({
3437
- startActivity: () => r.api.startActivity(),
3438
- stopActivity: () => r.api.stopActivity()
3439
- }), a = new Zn(bn, {
3440
- ingest: (t, e) => r.api.ingest(t, e),
3441
- getTabId: () => c?.getTabId() ?? "unknown",
3442
- isActivityActive: () => s?.isActive() ?? !1
3443
- });
3444
- const h = i.tab;
3445
- c = new ii({
3446
- push: (t) => a?.push(t),
3447
- events: {
3448
- state: h.enabled && h.events.state.enabled,
3449
- count: h.enabled && h.events.count.enabled
3450
- }
3451
- });
3452
- const m = function(t) {
3453
- function e(e) {
3454
- "hidden" === document.visibilityState && t.flush();
3455
- }
3456
- function n(e) {
3457
- t.flush(), t.stopTab(), t.getShouldSkipStopActivity() || t.stopActivity();
3458
- }
3459
- const i = _((e) => {
3460
- e.persisted && t.resume();
3461
- }), o = _(() => t.onConnectionChange());
3462
- return {
3463
- start: function() {
3464
- T(document, "visibilitychange", e), T(window, "pagehide", n), T(window, "pageshow", i), T(window, "online", o), T(window, "offline", o);
3465
- },
3466
- stop: function() {
3467
- x(document, "visibilitychange", e), x(window, "pagehide", n), x(window, "pageshow", i), x(window, "online", o), x(window, "offline", o);
3468
- }
3469
- };
3470
- }({
3471
- flush: () => a?.flush("lifecycle"),
3472
- stopActivity: async () => s?.stop(),
3473
- stopTab: () => c?.stop(),
3474
- getShouldSkipStopActivity: () => (c?.queryTabsNumber() ?? 0) > 1,
3475
- onConnectionChange: () => a?.onConnectionChange(),
3476
- resume: async () => {
3477
- try {
3478
- await s?.start(), await c?.start();
3479
- } catch (t) {
3480
- e.warn("IncodeTRI", "resume after bfcache restore failed:", t);
3481
- }
3482
- }
3483
- }), p = function(t = {}) {
3484
- const { elementLevel: e, sanitizeUrl: n = mn } = t, i = e || "redact", o = new Ai(6), r = new Ai(6);
3485
- return { resolve: function(t, e) {
3486
- if (!t || d(t) || "off" === i) return null;
3487
- let s = o.get(t);
3488
- if (s || (s = function(t) {
3489
- if (!t || d(t)) return {
3490
- chain: [],
3491
- redaction: {
3492
- level: "ignore",
3493
- index: -1
3494
- }
3495
- };
3496
- const e = [];
3497
- let n = t, i = -1;
3498
- for (; n;) {
3499
- if (d(n)) return {
3500
- chain: [],
3501
- redaction: {
3502
- level: "ignore",
3503
- index: -1
3504
- }
3505
- };
3506
- f(n) && (i = e.length), e.push(n);
3507
- const t = n.parentNode;
3508
- if (!t || u(n, "body")) break;
3509
- if (l(t)) n = t.host;
3510
- else {
3511
- if (t.nodeType !== Node.ELEMENT_NODE) break;
3512
- n = t;
3513
- }
3514
- }
3515
- return {
3516
- chain: e,
3517
- redaction: {
3518
- level: -1 === i ? "full" : "redact",
3519
- index: i
3520
- }
3521
- };
3522
- }(t.parentElement), o.set(t, s)), "ignore" === s.redaction.level) return null;
3523
- const a = "redact" === s.redaction.level || "redact" === i || f(t), c = r.get(t);
3524
- if (!c) {
3525
- const e = function(t, e, i, o) {
3526
- const r = getComputedStyle(t), s = _i(t), a = function(t, e, n = !1, i = mn) {
3527
- const o = [], r = [];
3528
- for (let s = t.length - 1; s >= 0; s--) {
3529
- const a = t[s], c = n || s <= e, u = s + 1, l = vi(a, c, _i(a), i), { score: d, reasons: f } = gi(a, u);
3530
- if (o.push(l), !bi(d)) continue;
3531
- const h = xi(a, c);
3532
- r.push({
3533
- ...l,
3534
- ...h ? { label: h } : {},
3535
- depth: u,
3536
- score: d,
3537
- reasons: f
3538
- });
3539
- }
3540
- return {
3541
- ancestors: o,
3542
- interactiveCandidates: r.reverse()
3543
- };
3544
- }(e, o, i, n), c = vi(t, i, s, n), u = function(t, e, n) {
3545
- const { score: i, reasons: o } = gi(t, 0);
3546
- return {
3547
- interactive: bi(i),
3548
- ...o.length > 0 ? { reasons: o } : {},
3549
- disabled: Ti(t),
3550
- rendered: "none" !== e?.display,
3551
- visible: "hidden" !== e?.visibility,
3552
- inViewport: ki(n),
3553
- acceptsPointer: "none" !== e?.pointerEvents,
3554
- opacity: parseFloat(e?.opacity || "1")
3555
- };
3556
- }(t, r, s);
3557
- let l = null;
3558
- return i || (l = u.interactive ? xi(t) : null), {
3559
- elementId: O(t),
3560
- tagName: c.tagName,
3561
- frame: c.frame,
3562
- viewport: Di(),
3563
- attributes: c.attributes,
3564
- nth: c.nth,
3565
- ...l ? { label: l } : {},
3566
- ancestors: a.ancestors,
3567
- interactiveCandidates: a.interactiveCandidates,
3568
- interactivity: u
3569
- };
3570
- }(t, s.chain, a, s.redaction.index);
3571
- return r.set(t, e), e;
3572
- }
3573
- return e?.freshGeometry ? {
3574
- ...c,
3575
- frame: _i(t),
3576
- viewport: Di()
3577
- } : c;
3578
- } };
3579
- }({
3580
- elementLevel: o.capture?.element,
3581
- sanitizeUrl: o.sanitizeUrl
3582
- }), w = /* @__PURE__ */ new Set();
3583
- try {
3584
- w.add(new URL(o.api.url).origin);
3585
- } catch {}
3586
- const y = function(t, e, n = "on") {
3587
- const i = /* @__PURE__ */ new Map();
3588
- function o(o) {
3589
- if (i.has(o)) return;
3590
- const r = dn[o];
3591
- if (!r || !function(t, e) {
3592
- return e[t]?.enabled ?? !1;
3593
- }(o, e)) return;
3594
- const s = e[o], a = r.create(t, n, s && "events" in s ? s.events : void 0);
3595
- i.set(o, a);
3596
- }
3597
- return {
3598
- start: o,
3599
- stopCollector: function(t) {
3600
- const e = i.get(t);
3601
- e && (e(), i.delete(t));
3602
- },
3603
- stop: function() {
3604
- for (const [, t] of i) t();
3605
- i.clear();
3606
- },
3607
- isRunning: function(t) {
3608
- return i.has(t);
3609
- },
3610
- autocapture: function() {
3611
- for (const t of fn) o(t);
3612
- }
3613
- };
3614
- }({
3615
- push: (t) => a?.push(t),
3616
- flush: () => a?.flush("submit"),
3617
- resolveElement: (t, e) => p.resolve(t, e),
3618
- sanitizeUrl: o.sanitizeUrl,
3619
- ignoredOrigins: w,
3620
- getActivityId: () => s?.getActivityId() ?? "",
3621
- host: o.host
3622
- }, i, o.capture?.content), v = new mi({
3623
- getActivityId: () => s?.getActivityId() ?? "",
3624
- reportEvent: (t) => r.api.reportEvent(t)
3625
- });
3626
- return {
3627
- status: "ready",
3628
- managers: {
3629
- falconServiceManager: r,
3630
- activityManager: s,
3631
- transportManager: a,
3632
- tabManager: c,
3633
- lifecycleManager: m,
3634
- collectorManager: y,
3635
- eventReportManager: v
3636
- }
3637
- };
3638
- } catch (t) {
3639
- return e.warn("IncodeTRI", "setup() failed during construction:", t), { status: "init-failed" };
3640
- }
3641
- }
3642
- let Li = class t {
3643
- constructor() {
3644
- this.Ct = 0, this.Lt = null, this.Rt = pn;
3645
- }
3646
- static get instance() {
3647
- return t.o || (t.o = new t()), t.o;
3648
- }
3649
- async setup(t) {
3650
- if (this.Rt !== pn) return e.fatal("error", "setup()", `cannot set up from state '${this.Rt}' — call reset() (or reload) first. Ignoring.`), gn;
3651
- try {
3652
- const n = function(t) {
3653
- if ("undefined" == typeof document) return e.fatal("error", "IncodeTRI", "TRI is not available in a non-browser environment."), null;
3654
- if (!t?.token) return e.fatal("error", "SDK", "token is required."), null;
3655
- if (!t.apiURL) return e.fatal("error", "SDK", "Couldn't initialise SDK — apiURL isn't provided."), null;
3656
- const { element: n, content: i } = t.capture ?? {}, o = {
3657
- token: t.token,
3658
- capture: {
3659
- element: n ?? "redact",
3660
- content: i ?? "off"
3661
- },
3662
- api: {
3663
- version: t.apiVersion ?? "1.0",
3664
- url: t.apiURL
3665
- },
3666
- sanitizeUrl: (s = t.sanitizeUrl, s ? function(t) {
3667
- return I(() => s(t, mn)) ?? mn(t);
3668
- } : mn),
3669
- host: (r = t.host, "string" == typeof r?.platform && "" !== r.platform && "string" == typeof r.version && "" !== r.version ? {
3670
- platform: r.platform,
3671
- version: r.version
3672
- } : (void 0 !== r && e.warn("SDK", "host needs a non-empty platform and version — reporting TRI itself."), {
3673
- platform: "tri-web",
3674
- version: "0.5.1"
3675
- })),
3676
- DEBUG: t.DEBUG ?? !1
3677
- };
3678
- var r, s;
3679
- return void 0 === t.collectors && void 0 === t.layers ? {
3680
- sdk: o,
3681
- collectors: kn()
3682
- } : void 0 !== t.collectors ? {
3683
- sdk: o,
3684
- collectors: xn(t.collectors)
3685
- } : {
3686
- sdk: o,
3687
- collectors: Tn(t.layers)
3688
- };
3689
- }(t);
3690
- if (!n) return this.Rt = gn, gn;
3691
- e.DEBUG = n.sdk.DEBUG;
3692
- const i = await Ci(n, { getProfileId: () => null });
3693
- return "collection-disabled" === i.status ? (e.fatal("warn", "setup()", "Collection is disabled for the provided API Key."), this.Rt = vn, vn) : "init-failed" === i.status ? (this.Rt = gn, gn) : (this.Lt = i.managers, this.Rt = wn, !1 !== t.autostart ? this.start() : wn);
3694
- } catch (t) {
3695
- return e.warn("setup()", "failed:", t), this.Rt = gn, gn;
3696
- }
3697
- }
3698
- async start() {
3699
- if (this.Rt === pn) return e.warn("start()", "start() requires a prior successful setup() — ignoring."), this.Rt;
3700
- if (this.Rt !== wn) return e.fatal("warn", "start()", "TRI is either already started or isn't ready — ignoring."), this.Rt;
3701
- this.Rt = "starting";
3702
- const t = ++this.Ct;
3703
- return await this.S(t), this.Rt;
3704
- }
3705
- async stop() {
3706
- e.warn("stop()", "called");
3707
- const t = this.Lt;
3708
- return t ? (++this.Ct, t.lifecycleManager.stop(), t.collectorManager.stop(), t.tabManager.stop(), t.eventReportManager.stop(), this.Rt = wn, this.zt(t)) : Promise.resolve(this.Rt);
3709
- }
3710
- async reset() {
3711
- const t = this.stop();
3712
- return this.Rt = pn, this.Lt = null, t.then(() => this.Rt);
3713
- }
3714
- async zt(t) {
3715
- return await function(t) {
3716
- let e = null;
3717
- const n = new Promise((t) => {
3718
- e = D(t, 2e3);
3719
- });
3720
- return Promise.race([t.finally(() => C(e)), n]);
3721
- }(Promise.resolve(t.transportManager.stop())), await t.activityManager.stop(), this.Rt;
3722
- }
3723
- async S(t) {
3724
- const n = this.Lt;
3725
- if (n) {
3726
- try {
3727
- if (await n.activityManager.start(), t !== this.Ct) return;
3728
- if (n.transportManager.start(), await n.tabManager.start(), t !== this.Ct) return;
3729
- n.lifecycleManager.start(), n.collectorManager.autocapture();
3730
- } catch (n) {
3731
- e.warn("start()", "failed during monitoring start:", n), t === this.Ct && (this.Rt = wn);
3732
- return;
3733
- }
3734
- t === this.Ct && (this.Rt = yn);
3735
- }
3736
- }
3737
- async linkInterview(t) {
3738
- if (this.Rt !== yn || !this.Lt) return e.warn("linkInterview()", "linkInterview() called before start() completed — ignoring."), !1;
3739
- if (!t) return e.warn("linkInterview()", "linkInterview() called without sessionToken — ignoring."), !1;
3740
- try {
3741
- return (await this.Lt.falconServiceManager.api.linkInterview(t)).ok;
3742
- } catch (t) {
3743
- return e.warn("linkInterview()", "failed:", t), !1;
3744
- }
3745
- }
3746
- async getFpSignals() {
3747
- if (this.Rt !== yn) return e.warn("getFpSignals()", "getFpSignals() called before start() completed — ignoring."), null;
3748
- try {
3749
- return await (L ?? Promise.resolve(null));
3750
- } catch (t) {
3751
- return e.warn("getFpSignals()", "failed:", t), null;
3752
- }
3753
- }
3754
- addFpSignals(t) {
3755
- const n = this.Lt;
3756
- if (this.Rt !== yn || !n) return e.warn("addFpSignals()", "addFpSignals() called before start() completed — ignoring."), !1;
3757
- if (n.collectorManager.isRunning("fpsignals")) return e.warn("addFpSignals()", "the fpsignals collector is on and sends its own results — ignoring."), !1;
3758
- if ("string" != typeof t || !t) return e.warn("addFpSignals()", "signals is empty — ignoring."), !1;
3759
- try {
3760
- return n.transportManager.push({
3761
- name: "fp_signals",
3762
- timestamp: Date.now(),
3763
- signals: t
3764
- }), !0;
3765
- } catch (t) {
3766
- return e.warn("addFpSignals()", "failed:", t), !1;
3767
- }
3768
- }
3769
- };
3770
- async function Ri(t, e) {
3771
- const n = e?.apiURL ?? "https://falcon-ingest-k8s.stage.incodetest.com", i = e?.timeout ?? 1e4, o = new AbortController();
3772
- let r = null, s = !1, a = () => {};
3773
- i && (r = D(() => {
3774
- s = !0, o.abort();
3775
- }, i));
3776
- const c = e?.signal;
3777
- if (c) if (c.aborted) o.abort();
3778
- else {
3779
- const t = () => o.abort();
3780
- c.addEventListener("abort", t, { once: !0 }), a = () => c.removeEventListener("abort", t);
3781
- }
3782
- try {
3783
- const e = await fetch(`${n}/api/v1/sdk/init`, {
3784
- method: "POST",
3785
- headers: {
3786
- "content-type": "application/json",
3787
- "x-api-key": t,
3788
- "x-api-version": "1.0"
3789
- },
3790
- signal: o.signal
3791
- });
3792
- if (!e.ok) {
3793
- let t = e.statusText;
3794
- try {
3795
- const n = await e.json();
3796
- n.errorMessage && (t = n.errorMessage);
3797
- } catch {}
3798
- return {
3799
- token: null,
3800
- expiresAt: null,
3801
- tokenType: null,
3802
- eventsCollectionEnabled: !1,
3803
- error: {
3804
- status: e.status,
3805
- message: t
3806
- }
3807
- };
3808
- }
3809
- const i = await e.json();
3810
- return {
3811
- token: i.token,
3812
- expiresAt: i.expiresAt,
3813
- tokenType: i.tokenType,
3814
- eventsCollectionEnabled: !0,
3815
- error: null
3816
- };
3817
- } catch (t) {
3818
- throw new Error((s ? "[TRI] createSession timed out" : "[TRI] Failed to create session:") + " " + t.message);
3819
- } finally {
3820
- C(r), a();
3821
- }
3822
- }
3823
- Li.o = null;
3824
- const zi = Li.instance;
3825
- //#endregion
3826
- export { Ri as createSession, zi as default };