@safaricom-mxl/web-sdk 0.0.14 → 0.0.16

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 (266) hide show
  1. package/dist/api-logs/api/LogAPI/LogAPI.cjs.map +1 -1
  2. package/dist/api-logs/api/LogAPI/LogAPI.js.map +1 -1
  3. package/dist/api-logs/logAPI.cjs.map +1 -1
  4. package/dist/api-logs/logAPI.js.map +1 -1
  5. package/dist/api-logs/manager/NoOpLogManager/NoOpLogManager.cjs.map +1 -1
  6. package/dist/api-logs/manager/NoOpLogManager/NoOpLogManager.js.map +1 -1
  7. package/dist/api-logs/manager/ProxyLogManager/ProxyLogManager.cjs.map +1 -1
  8. package/dist/api-logs/manager/ProxyLogManager/ProxyLogManager.js.map +1 -1
  9. package/dist/api-page/api/PageAPI/PageAPI.cjs.map +1 -1
  10. package/dist/api-page/api/PageAPI/PageAPI.js.map +1 -1
  11. package/dist/api-page/manager/NoOpPageManager/NoOpPageManager.cjs.map +1 -1
  12. package/dist/api-page/manager/NoOpPageManager/NoOpPageManager.js.map +1 -1
  13. package/dist/api-page/manager/ProxyPageManager/ProxyPageManager.cjs.map +1 -1
  14. package/dist/api-page/manager/ProxyPageManager/ProxyPageManager.js.map +1 -1
  15. package/dist/api-page/pageAPI.cjs.map +1 -1
  16. package/dist/api-page/pageAPI.js.map +1 -1
  17. package/dist/api-sessions/api/SessionAPI/SessionAPI.cjs.map +1 -1
  18. package/dist/api-sessions/api/SessionAPI/SessionAPI.d.cts.map +1 -1
  19. package/dist/api-sessions/api/SessionAPI/SessionAPI.d.ts.map +1 -1
  20. package/dist/api-sessions/api/SessionAPI/SessionAPI.js.map +1 -1
  21. package/dist/api-sessions/manager/NoOpSpanSessionManager/NoOpSpanSessionManager.cjs.map +1 -1
  22. package/dist/api-sessions/manager/NoOpSpanSessionManager/NoOpSpanSessionManager.js.map +1 -1
  23. package/dist/api-sessions/manager/ProxySpanSessionManager/ProxySpanSessionManager.cjs.map +1 -1
  24. package/dist/api-sessions/manager/ProxySpanSessionManager/ProxySpanSessionManager.js.map +1 -1
  25. package/dist/api-sessions/sessionAPI.cjs.map +1 -1
  26. package/dist/api-sessions/sessionAPI.js.map +1 -1
  27. package/dist/api-traces/api/TraceAPI/TraceAPI.cjs.map +1 -1
  28. package/dist/api-traces/api/TraceAPI/TraceAPI.js.map +1 -1
  29. package/dist/api-traces/manager/NoOpTraceManager/NoOpTraceManager.cjs.map +1 -1
  30. package/dist/api-traces/manager/NoOpTraceManager/NoOpTraceManager.js.map +1 -1
  31. package/dist/api-traces/manager/NoOpTraceManager/NonRecordingExtendedSpan.cjs.map +1 -1
  32. package/dist/api-traces/manager/NoOpTraceManager/NonRecordingExtendedSpan.d.cts.map +1 -1
  33. package/dist/api-traces/manager/NoOpTraceManager/NonRecordingExtendedSpan.d.ts.map +1 -1
  34. package/dist/api-traces/manager/NoOpTraceManager/NonRecordingExtendedSpan.js.map +1 -1
  35. package/dist/api-traces/manager/ProxyTraceManager/ProxyTraceManager.cjs.map +1 -1
  36. package/dist/api-traces/manager/ProxyTraceManager/ProxyTraceManager.js.map +1 -1
  37. package/dist/api-traces/traceAPI.cjs.map +1 -1
  38. package/dist/api-traces/traceAPI.js.map +1 -1
  39. package/dist/api-users/api/UserAPI/UserAPI.cjs.map +1 -1
  40. package/dist/api-users/api/UserAPI/UserAPI.js.map +1 -1
  41. package/dist/api-users/manager/NoOpUserManager/NoOpUserManager.cjs.map +1 -1
  42. package/dist/api-users/manager/NoOpUserManager/NoOpUserManager.js.map +1 -1
  43. package/dist/api-users/manager/ProxyUserManager/ProxyUserManager.cjs.map +1 -1
  44. package/dist/api-users/manager/ProxyUserManager/ProxyUserManager.js.map +1 -1
  45. package/dist/api-users/userAPI.cjs.map +1 -1
  46. package/dist/api-users/userAPI.js.map +1 -1
  47. package/dist/common/attributes.cjs.map +1 -1
  48. package/dist/common/attributes.js.map +1 -1
  49. package/dist/constants/attributes.cjs +2 -0
  50. package/dist/constants/attributes.cjs.map +1 -1
  51. package/dist/constants/attributes.d.cts +2 -1
  52. package/dist/constants/attributes.d.cts.map +1 -1
  53. package/dist/constants/attributes.d.ts +2 -1
  54. package/dist/constants/attributes.d.ts.map +1 -1
  55. package/dist/constants/attributes.js +2 -1
  56. package/dist/constants/attributes.js.map +1 -1
  57. package/dist/constants/index.cjs +1 -0
  58. package/dist/constants/index.d.cts +2 -2
  59. package/dist/constants/index.d.ts +2 -2
  60. package/dist/constants/index.js +2 -2
  61. package/dist/exporters/MXLLogExporter/MXLLogExporter.cjs.map +1 -1
  62. package/dist/exporters/MXLLogExporter/MXLLogExporter.js.map +1 -1
  63. package/dist/exporters/MXLLogExporter/OTLPFetchLogExporter.cjs.map +1 -1
  64. package/dist/exporters/MXLLogExporter/OTLPFetchLogExporter.js.map +1 -1
  65. package/dist/exporters/MXLLogExporter/utils.cjs.map +1 -1
  66. package/dist/exporters/MXLLogExporter/utils.js.map +1 -1
  67. package/dist/exporters/MXLTraceExporter/MXLTraceExporter.cjs.map +1 -1
  68. package/dist/exporters/MXLTraceExporter/MXLTraceExporter.js.map +1 -1
  69. package/dist/exporters/MXLTraceExporter/OTLPFetchTraceExporter.cjs.map +1 -1
  70. package/dist/exporters/MXLTraceExporter/OTLPFetchTraceExporter.js.map +1 -1
  71. package/dist/exporters/MXLTraceExporter/utils.cjs.map +1 -1
  72. package/dist/exporters/MXLTraceExporter/utils.js.map +1 -1
  73. package/dist/exporters/otlpBrowserFetchExportDelegate.cjs.map +1 -1
  74. package/dist/exporters/otlpBrowserFetchExportDelegate.d.cts.map +1 -1
  75. package/dist/exporters/otlpBrowserFetchExportDelegate.d.ts.map +1 -1
  76. package/dist/exporters/otlpBrowserFetchExportDelegate.js.map +1 -1
  77. package/dist/instrumentations/MXLInstrumentationBase/MXLInstrumentationBase.cjs.map +1 -1
  78. package/dist/instrumentations/MXLInstrumentationBase/MXLInstrumentationBase.js.map +1 -1
  79. package/dist/instrumentations/clicks/ClicksInstrumentation/ClicksInstrumentation.cjs.map +1 -1
  80. package/dist/instrumentations/clicks/ClicksInstrumentation/ClicksInstrumentation.js.map +1 -1
  81. package/dist/instrumentations/document-load/DocumentLoadInstrumentation/DocumentLoadInstrumentation.cjs.map +1 -1
  82. package/dist/instrumentations/document-load/DocumentLoadInstrumentation/DocumentLoadInstrumentation.d.cts.map +1 -1
  83. package/dist/instrumentations/document-load/DocumentLoadInstrumentation/DocumentLoadInstrumentation.d.ts.map +1 -1
  84. package/dist/instrumentations/document-load/DocumentLoadInstrumentation/DocumentLoadInstrumentation.js.map +1 -1
  85. package/dist/instrumentations/document-load/DocumentLoadInstrumentation/utils.cjs.map +1 -1
  86. package/dist/instrumentations/document-load/DocumentLoadInstrumentation/utils.js.map +1 -1
  87. package/dist/instrumentations/element-timing/ElementTimingInstrumentation/ElementTimingInstrumentation.cjs.map +1 -1
  88. package/dist/instrumentations/element-timing/ElementTimingInstrumentation/ElementTimingInstrumentation.js.map +1 -1
  89. package/dist/instrumentations/empty-root/EmptyRootInstrumentation/EmptyRootInstrumentation.cjs.map +1 -1
  90. package/dist/instrumentations/empty-root/EmptyRootInstrumentation/EmptyRootInstrumentation.js.map +1 -1
  91. package/dist/instrumentations/exceptions/GlobalExceptionInstrumentation/GlobalExceptionInstrumentation.cjs.map +1 -1
  92. package/dist/instrumentations/exceptions/GlobalExceptionInstrumentation/GlobalExceptionInstrumentation.js.map +1 -1
  93. package/dist/instrumentations/exceptions/react/MXLErrorBoundary/MXLErrorBoundary.cjs +1 -1
  94. package/dist/instrumentations/exceptions/react/MXLErrorBoundary/MXLErrorBoundary.cjs.map +1 -1
  95. package/dist/instrumentations/exceptions/react/MXLErrorBoundary/MXLErrorBoundary.d.cts.map +1 -1
  96. package/dist/instrumentations/exceptions/react/MXLErrorBoundary/MXLErrorBoundary.d.ts.map +1 -1
  97. package/dist/instrumentations/exceptions/react/MXLErrorBoundary/MXLErrorBoundary.js +2 -2
  98. package/dist/instrumentations/exceptions/react/MXLErrorBoundary/MXLErrorBoundary.js.map +1 -1
  99. package/dist/instrumentations/fetch/MXLFetchInstrumentation/MXLFetchInstrumentation.cjs.map +1 -1
  100. package/dist/instrumentations/fetch/MXLFetchInstrumentation/MXLFetchInstrumentation.js.map +1 -1
  101. package/dist/instrumentations/loaf/LoafInstrumentation/LoafInstrumentation.cjs.map +1 -1
  102. package/dist/instrumentations/loaf/LoafInstrumentation/LoafInstrumentation.js.map +1 -1
  103. package/dist/instrumentations/navigation/NavigationInstrumentation/NavigationInstrumentation.cjs.map +1 -1
  104. package/dist/instrumentations/navigation/NavigationInstrumentation/NavigationInstrumentation.js.map +1 -1
  105. package/dist/instrumentations/navigation/NavigationInstrumentation/instance.cjs.map +1 -1
  106. package/dist/instrumentations/navigation/NavigationInstrumentation/instance.js.map +1 -1
  107. package/dist/instrumentations/navigation/NavigationInstrumentation/react/createReactRouterNavigationInstrumentation.cjs.map +1 -1
  108. package/dist/instrumentations/navigation/NavigationInstrumentation/react/createReactRouterNavigationInstrumentation.js.map +1 -1
  109. package/dist/instrumentations/navigation/NavigationInstrumentation/react/reactRouterV5/withMXLRoutingLegacy.cjs.map +1 -1
  110. package/dist/instrumentations/navigation/NavigationInstrumentation/react/reactRouterV5/withMXLRoutingLegacy.d.cts.map +1 -1
  111. package/dist/instrumentations/navigation/NavigationInstrumentation/react/reactRouterV5/withMXLRoutingLegacy.d.ts.map +1 -1
  112. package/dist/instrumentations/navigation/NavigationInstrumentation/react/reactRouterV5/withMXLRoutingLegacy.js.map +1 -1
  113. package/dist/instrumentations/navigation/NavigationInstrumentation/react/reactRouterV6Data/listenToRouterChanges.cjs.map +1 -1
  114. package/dist/instrumentations/navigation/NavigationInstrumentation/react/reactRouterV6Data/listenToRouterChanges.js.map +1 -1
  115. package/dist/instrumentations/navigation/NavigationInstrumentation/react/reactRouterV6Declarative/withMXLRouting.cjs.map +1 -1
  116. package/dist/instrumentations/navigation/NavigationInstrumentation/react/reactRouterV6Declarative/withMXLRouting.js.map +1 -1
  117. package/dist/instrumentations/server-timing/ServerTimingInstrumentation/ServerTimingInstrumentation.cjs.map +1 -1
  118. package/dist/instrumentations/server-timing/ServerTimingInstrumentation/ServerTimingInstrumentation.js.map +1 -1
  119. package/dist/instrumentations/session/SpanSessionBrowserActivityInstrumentation/SpanSessionBrowserActivityInstrumentation.cjs.map +1 -1
  120. package/dist/instrumentations/session/SpanSessionBrowserActivityInstrumentation/SpanSessionBrowserActivityInstrumentation.js.map +1 -1
  121. package/dist/instrumentations/session/SpanSessionOnLoadInstrumentation/SpanSessionOnLoadInstrumentation.cjs.map +1 -1
  122. package/dist/instrumentations/session/SpanSessionOnLoadInstrumentation/SpanSessionOnLoadInstrumentation.js.map +1 -1
  123. package/dist/instrumentations/session/SpanSessionTimeoutInstrumentation/SpanSessionTimeoutInstrumentation.cjs.map +1 -1
  124. package/dist/instrumentations/session/SpanSessionTimeoutInstrumentation/SpanSessionTimeoutInstrumentation.js.map +1 -1
  125. package/dist/instrumentations/session/SpanSessionVisibilityInstrumentation/SpanSessionVisibilityInstrumentation.cjs.map +1 -1
  126. package/dist/instrumentations/session/SpanSessionVisibilityInstrumentation/SpanSessionVisibilityInstrumentation.js.map +1 -1
  127. package/dist/instrumentations/user-timing/UserTimingInstrumentation/UserTimingInstrumentation.cjs.map +1 -1
  128. package/dist/instrumentations/user-timing/UserTimingInstrumentation/UserTimingInstrumentation.js.map +1 -1
  129. package/dist/instrumentations/web-vitals/WebVitalsInstrumentation/WebVitalsInstrumentation.cjs.map +1 -1
  130. package/dist/instrumentations/web-vitals/WebVitalsInstrumentation/WebVitalsInstrumentation.d.cts.map +1 -1
  131. package/dist/instrumentations/web-vitals/WebVitalsInstrumentation/WebVitalsInstrumentation.d.ts.map +1 -1
  132. package/dist/instrumentations/web-vitals/WebVitalsInstrumentation/WebVitalsInstrumentation.js.map +1 -1
  133. package/dist/instrumentations/xhr/MXLXHRInstrumentation/MXLXHRInstrumentation.cjs.map +1 -1
  134. package/dist/instrumentations/xhr/MXLXHRInstrumentation/MXLXHRInstrumentation.js.map +1 -1
  135. package/dist/managers/MXLConfigManager/MXLDynamicConfigManager.cjs +1 -1
  136. package/dist/managers/MXLConfigManager/MXLDynamicConfigManager.cjs.map +1 -1
  137. package/dist/managers/MXLConfigManager/MXLDynamicConfigManager.d.cts.map +1 -1
  138. package/dist/managers/MXLConfigManager/MXLDynamicConfigManager.d.ts.map +1 -1
  139. package/dist/managers/MXLConfigManager/MXLDynamicConfigManager.js +1 -1
  140. package/dist/managers/MXLConfigManager/MXLDynamicConfigManager.js.map +1 -1
  141. package/dist/managers/MXLConfigManager/constants.cjs.map +1 -1
  142. package/dist/managers/MXLConfigManager/constants.js.map +1 -1
  143. package/dist/managers/MXLConfigManager/utils.cjs.map +1 -1
  144. package/dist/managers/MXLConfigManager/utils.js.map +1 -1
  145. package/dist/managers/MXLLimitManager/MXLLimitManager.cjs.map +1 -1
  146. package/dist/managers/MXLLimitManager/MXLLimitManager.js.map +1 -1
  147. package/dist/managers/MXLLimitManager/constants.cjs.map +1 -1
  148. package/dist/managers/MXLLimitManager/constants.js.map +1 -1
  149. package/dist/managers/MXLLogManager/MXLLogManager.cjs +3 -1
  150. package/dist/managers/MXLLogManager/MXLLogManager.cjs.map +1 -1
  151. package/dist/managers/MXLLogManager/MXLLogManager.d.cts.map +1 -1
  152. package/dist/managers/MXLLogManager/MXLLogManager.d.ts.map +1 -1
  153. package/dist/managers/MXLLogManager/MXLLogManager.js +4 -2
  154. package/dist/managers/MXLLogManager/MXLLogManager.js.map +1 -1
  155. package/dist/managers/MXLPageManager/MXLPageManager.cjs.map +1 -1
  156. package/dist/managers/MXLPageManager/MXLPageManager.js.map +1 -1
  157. package/dist/managers/MXLSDKFeaturesManager/MXLSDKFeaturesManager.cjs.map +1 -1
  158. package/dist/managers/MXLSDKFeaturesManager/MXLSDKFeaturesManager.js.map +1 -1
  159. package/dist/managers/MXLSpanSessionManager/MXLSpanSessionManager.cjs.map +1 -1
  160. package/dist/managers/MXLSpanSessionManager/MXLSpanSessionManager.d.cts.map +1 -1
  161. package/dist/managers/MXLSpanSessionManager/MXLSpanSessionManager.d.ts.map +1 -1
  162. package/dist/managers/MXLSpanSessionManager/MXLSpanSessionManager.js.map +1 -1
  163. package/dist/managers/MXLTraceManager/MXLExtendedSpan.cjs.map +1 -1
  164. package/dist/managers/MXLTraceManager/MXLExtendedSpan.d.cts.map +1 -1
  165. package/dist/managers/MXLTraceManager/MXLExtendedSpan.d.ts.map +1 -1
  166. package/dist/managers/MXLTraceManager/MXLExtendedSpan.js.map +1 -1
  167. package/dist/managers/MXLTraceManager/MXLTraceManager.cjs.map +1 -1
  168. package/dist/managers/MXLTraceManager/MXLTraceManager.js.map +1 -1
  169. package/dist/managers/MXLUserManager/MXLUserManager.cjs.map +1 -1
  170. package/dist/managers/MXLUserManager/MXLUserManager.js.map +1 -1
  171. package/dist/managers/MXLUserManager/types.cjs.map +1 -1
  172. package/dist/managers/MXLUserManager/types.js.map +1 -1
  173. package/dist/mxl-web-sdk.js +3 -38
  174. package/dist/mxl-web-sdk.js.map +1 -1
  175. package/dist/processors/BrowserLogRecordProcessor/BrowserLogRecordProcessor.cjs.map +1 -1
  176. package/dist/processors/BrowserLogRecordProcessor/BrowserLogRecordProcessor.js.map +1 -1
  177. package/dist/processors/BrowserSpanProcessor/BrowserSpanProcessor.cjs.map +1 -1
  178. package/dist/processors/BrowserSpanProcessor/BrowserSpanProcessor.js.map +1 -1
  179. package/dist/processors/IdentifiableSessionLogRecordProcessor/IdentifiableSessionLogRecordProcessor.cjs.map +1 -1
  180. package/dist/processors/IdentifiableSessionLogRecordProcessor/IdentifiableSessionLogRecordProcessor.js.map +1 -1
  181. package/dist/processors/LogRecordScrubProcessor/LogRecordScrubProcessor.cjs.map +1 -1
  182. package/dist/processors/LogRecordScrubProcessor/LogRecordScrubProcessor.js.map +1 -1
  183. package/dist/processors/MXLLogRecordProcessor/MXLLogRecordProcessor.cjs.map +1 -1
  184. package/dist/processors/MXLLogRecordProcessor/MXLLogRecordProcessor.js.map +1 -1
  185. package/dist/processors/MXLNetworkSpanProcessor/MXLNetworkSpanProcessor.cjs.map +1 -1
  186. package/dist/processors/MXLNetworkSpanProcessor/MXLNetworkSpanProcessor.js.map +1 -1
  187. package/dist/processors/MXLSessionBatchedSpanProcessor/MXLSessionBatchedSpanProcessor.cjs.map +1 -1
  188. package/dist/processors/MXLSessionBatchedSpanProcessor/MXLSessionBatchedSpanProcessor.js.map +1 -1
  189. package/dist/processors/PageLogRecordProcessor/PageLogRecordProcessor.cjs.map +1 -1
  190. package/dist/processors/PageLogRecordProcessor/PageLogRecordProcessor.js.map +1 -1
  191. package/dist/processors/PageSpanProcessor/PageSpanProcessor.cjs.map +1 -1
  192. package/dist/processors/PageSpanProcessor/PageSpanProcessor.js.map +1 -1
  193. package/dist/processors/SpanScrubProcessor/SpanScrubProcessor.cjs.map +1 -1
  194. package/dist/processors/SpanScrubProcessor/SpanScrubProcessor.js.map +1 -1
  195. package/dist/processors/UserLogRecordProcessor/UserLogRecordProcessor.cjs.map +1 -1
  196. package/dist/processors/UserLogRecordProcessor/UserLogRecordProcessor.js.map +1 -1
  197. package/dist/processors/UserSpanProcessor/UserSpanProcessor.cjs.map +1 -1
  198. package/dist/processors/UserSpanProcessor/UserSpanProcessor.js.map +1 -1
  199. package/dist/propagators/MXLW3CTraceContextPropagator/MXLW3CTraceContextPropagator.cjs.map +1 -1
  200. package/dist/propagators/MXLW3CTraceContextPropagator/MXLW3CTraceContextPropagator.js.map +1 -1
  201. package/dist/resources/appInstanceId.cjs.map +1 -1
  202. package/dist/resources/appInstanceId.js.map +1 -1
  203. package/dist/resources/constants/index.cjs +1 -1
  204. package/dist/resources/constants/index.cjs.map +1 -1
  205. package/dist/resources/constants/index.d.cts +1 -1
  206. package/dist/resources/constants/index.d.ts +1 -1
  207. package/dist/resources/constants/index.js +1 -1
  208. package/dist/resources/constants/index.js.map +1 -1
  209. package/dist/resources/webSdkResource.cjs.map +1 -1
  210. package/dist/resources/webSdkResource.d.cts.map +1 -1
  211. package/dist/resources/webSdkResource.d.ts.map +1 -1
  212. package/dist/resources/webSdkResource.js.map +1 -1
  213. package/dist/sdk/defaultAttributeScrubbers.cjs.map +1 -1
  214. package/dist/sdk/defaultAttributeScrubbers.js.map +1 -1
  215. package/dist/sdk/initSDK.cjs +13 -11
  216. package/dist/sdk/initSDK.cjs.map +1 -1
  217. package/dist/sdk/initSDK.d.cts.map +1 -1
  218. package/dist/sdk/initSDK.d.ts.map +1 -1
  219. package/dist/sdk/initSDK.js +14 -12
  220. package/dist/sdk/initSDK.js.map +1 -1
  221. package/dist/sdk/noopSessionRecording.cjs +10 -0
  222. package/dist/sdk/noopSessionRecording.cjs.map +1 -0
  223. package/dist/sdk/noopSessionRecording.d.cts +7 -0
  224. package/dist/sdk/noopSessionRecording.d.cts.map +1 -0
  225. package/dist/sdk/noopSessionRecording.d.ts +7 -0
  226. package/dist/sdk/noopSessionRecording.d.ts.map +1 -0
  227. package/dist/sdk/noopSessionRecording.js +9 -0
  228. package/dist/sdk/noopSessionRecording.js.map +1 -0
  229. package/dist/sdk/registry.cjs.map +1 -1
  230. package/dist/sdk/registry.js.map +1 -1
  231. package/dist/sdk/setupDefaultInstrumentations.cjs.map +1 -1
  232. package/dist/sdk/setupDefaultInstrumentations.js.map +1 -1
  233. package/dist/sdk/setupSessionRecorder.cjs +64 -22
  234. package/dist/sdk/setupSessionRecorder.cjs.map +1 -1
  235. package/dist/sdk/setupSessionRecorder.d.cts +16 -7
  236. package/dist/sdk/setupSessionRecorder.d.cts.map +1 -1
  237. package/dist/sdk/setupSessionRecorder.d.ts +16 -7
  238. package/dist/sdk/setupSessionRecorder.d.ts.map +1 -1
  239. package/dist/sdk/setupSessionRecorder.js +62 -21
  240. package/dist/sdk/setupSessionRecorder.js.map +1 -1
  241. package/dist/sdk/types.d.cts.map +1 -1
  242. package/dist/sdk/types.d.ts +1 -1
  243. package/dist/sdk/types.d.ts.map +1 -1
  244. package/dist/sdk/utils.cjs.map +1 -1
  245. package/dist/sdk/utils.js.map +1 -1
  246. package/dist/transport/FetchTransport/FetchTransport.cjs.map +1 -1
  247. package/dist/transport/FetchTransport/FetchTransport.js.map +1 -1
  248. package/dist/transport/FetchTransport/createFetchTransport.cjs.map +1 -1
  249. package/dist/transport/FetchTransport/createFetchTransport.js.map +1 -1
  250. package/dist/transport/RetryingTransport/RetryingTransport.cjs.map +1 -1
  251. package/dist/transport/RetryingTransport/RetryingTransport.js.map +1 -1
  252. package/dist/transport/RetryingTransport/createRetryingTransport.cjs.map +1 -1
  253. package/dist/transport/RetryingTransport/createRetryingTransport.js.map +1 -1
  254. package/dist/utils/MXLSpanStorage/MXLSpanStorage.cjs.map +1 -1
  255. package/dist/utils/MXLSpanStorage/MXLSpanStorage.js.map +1 -1
  256. package/dist/utils/PerformanceManager/OTelPerformanceManager.cjs.map +1 -1
  257. package/dist/utils/PerformanceManager/OTelPerformanceManager.js.map +1 -1
  258. package/dist/utils/bulkAddEventListener/bulkAddEventListener.cjs.map +1 -1
  259. package/dist/utils/bulkAddEventListener/bulkAddEventListener.js.map +1 -1
  260. package/dist/utils/bulkRemoveEventListener/bulkRemoveEventListener.cjs.map +1 -1
  261. package/dist/utils/bulkRemoveEventListener/bulkRemoveEventListener.js.map +1 -1
  262. package/dist/utils/getVisibilityState.cjs.map +1 -1
  263. package/dist/utils/getVisibilityState.js.map +1 -1
  264. package/dist/utils/nsfConfigValidation.cjs.map +1 -1
  265. package/dist/utils/nsfConfigValidation.js.map +1 -1
  266. package/package.json +2 -2
@@ -1 +1 @@
1
- {"version":3,"file":"instance.js","names":[],"sources":["../../../../src/instrumentations/navigation/NavigationInstrumentation/instance.ts"],"sourcesContent":["import { NavigationInstrumentation } from './NavigationInstrumentation.ts';\nimport type { NavigationInstrumentationArgs } from './types.ts';\n\nlet navigationInstrumentation: NavigationInstrumentation | undefined;\n\nexport const getNavigationInstrumentation = (\n config: NavigationInstrumentationArgs = {},\n): NavigationInstrumentation => {\n if (!navigationInstrumentation) {\n navigationInstrumentation = new NavigationInstrumentation(config);\n }\n\n return navigationInstrumentation;\n};\n"],"mappings":";;AAGA,IAAI;AAEJ,MAAa,gCACX,SAAwC,EAAE,KACZ;AAC9B,KAAI,CAAC,0BACH,6BAA4B,IAAI,0BAA0B,OAAO;AAGnE,QAAO"}
1
+ {"version":3,"file":"instance.js","names":[],"sources":["../../../../src/instrumentations/navigation/NavigationInstrumentation/instance.ts"],"sourcesContent":["import { NavigationInstrumentation } from './NavigationInstrumentation';\nimport type { NavigationInstrumentationArgs } from './types';\n\nlet navigationInstrumentation: NavigationInstrumentation | undefined;\n\nexport const getNavigationInstrumentation = (\n config: NavigationInstrumentationArgs = {},\n): NavigationInstrumentation => {\n if (!navigationInstrumentation) {\n navigationInstrumentation = new NavigationInstrumentation(config);\n }\n\n return navigationInstrumentation;\n};\n"],"mappings":";;AAGA,IAAI;AAEJ,MAAa,gCACX,SAAwC,EAAE,KACZ;AAC9B,KAAI,CAAC,0BACH,6BAA4B,IAAI,0BAA0B,OAAO;AAGnE,QAAO"}
@@ -1 +1 @@
1
- {"version":3,"file":"createReactRouterNavigationInstrumentation.cjs","names":["getNavigationInstrumentation"],"sources":["../../../../../src/instrumentations/navigation/NavigationInstrumentation/react/createReactRouterNavigationInstrumentation.ts"],"sourcesContent":["import type { NavigationInstrumentationArgs } from '../index.ts';\nimport { getNavigationInstrumentation } from '../index.ts';\n\nexport const createReactRouterNavigationInstrumentation = (\n config: NavigationInstrumentationArgs = {},\n) => getNavigationInstrumentation(config);\n"],"mappings":";;;AAGA,MAAa,8CACX,SAAwC,EAAE,KACvCA,uEAAAA,6BAA6B,OAAO"}
1
+ {"version":3,"file":"createReactRouterNavigationInstrumentation.cjs","names":["getNavigationInstrumentation"],"sources":["../../../../../src/instrumentations/navigation/NavigationInstrumentation/react/createReactRouterNavigationInstrumentation.ts"],"sourcesContent":["import type { NavigationInstrumentationArgs } from '../index';\nimport { getNavigationInstrumentation } from '../index';\n\nexport const createReactRouterNavigationInstrumentation = (\n config: NavigationInstrumentationArgs = {},\n) => getNavigationInstrumentation(config);\n"],"mappings":";;;AAGA,MAAa,8CACX,SAAwC,EAAE,KACvCA,uEAAAA,6BAA6B,OAAO"}
@@ -1 +1 @@
1
- {"version":3,"file":"createReactRouterNavigationInstrumentation.js","names":[],"sources":["../../../../../src/instrumentations/navigation/NavigationInstrumentation/react/createReactRouterNavigationInstrumentation.ts"],"sourcesContent":["import type { NavigationInstrumentationArgs } from '../index.ts';\nimport { getNavigationInstrumentation } from '../index.ts';\n\nexport const createReactRouterNavigationInstrumentation = (\n config: NavigationInstrumentationArgs = {},\n) => getNavigationInstrumentation(config);\n"],"mappings":";;AAGA,MAAa,8CACX,SAAwC,EAAE,KACvC,6BAA6B,OAAO"}
1
+ {"version":3,"file":"createReactRouterNavigationInstrumentation.js","names":[],"sources":["../../../../../src/instrumentations/navigation/NavigationInstrumentation/react/createReactRouterNavigationInstrumentation.ts"],"sourcesContent":["import type { NavigationInstrumentationArgs } from '../index';\nimport { getNavigationInstrumentation } from '../index';\n\nexport const createReactRouterNavigationInstrumentation = (\n config: NavigationInstrumentationArgs = {},\n) => getNavigationInstrumentation(config);\n"],"mappings":";;AAGA,MAAa,8CACX,SAAwC,EAAE,KACvC,6BAA6B,OAAO"}
@@ -1 +1 @@
1
- {"version":3,"file":"withMXLRoutingLegacy.cjs","names":["getNavigationInstrumentation","React"],"sources":["../../../../../../src/instrumentations/navigation/NavigationInstrumentation/react/reactRouterV5/withMXLRoutingLegacy.ts"],"sourcesContent":["import hoistNonReactStatics from 'hoist-non-react-statics';\nimport * as React from 'react';\nimport { MXL_NAVIGATION_INSTRUMENTATIONS } from '../../../../../constants/index.ts';\nimport { getNavigationInstrumentation } from '../../index.ts';\nimport type {\n RouteComponentProps,\n SwitchedRouteComponentProps,\n} from './types.ts';\n\nexport const withMXLRoutingLegacy = <P extends RouteComponentProps>(\n WrappedComponent: React.ComponentType<P>,\n) => {\n const navigationInstrumentation = getNavigationInstrumentation();\n navigationInstrumentation.setInstrumentationType(\n MXL_NAVIGATION_INSTRUMENTATIONS.DeclarativeLegacy,\n );\n\n const RouteWithMXLRoutingLegacy: React.FC<P> = (props: P) => {\n // Make sure this is Route component\n if (props.path) {\n // Routes get injected with computedMatch when they are children of a <Switch> but the types do not reflect that\n // Manually setting the type here.\n const routeProps = props as SwitchedRouteComponentProps;\n\n // Depends on this internal behaviour\n // https://github.com/remix-run/react-router/blob/v5.3.4/packages/react-router/modules/Switch.js#L40\n // It shouldn't change as this version is legacy, and it's not being actively worked on\n if (routeProps.computedMatch) {\n navigationInstrumentation.setCurrentRoute({\n path: routeProps.computedMatch.path,\n url: routeProps.computedMatch.url,\n });\n }\n }\n\n return React.createElement<P>(WrappedComponent, props);\n };\n\n // Keep wrapped component metadata\n RouteWithMXLRoutingLegacy.displayName = `withMXLRoutingLegacy(${WrappedComponent.displayName || WrappedComponent.name || 'Component'})`;\n hoistNonReactStatics(RouteWithMXLRoutingLegacy, WrappedComponent);\n\n return RouteWithMXLRoutingLegacy;\n};\n"],"mappings":";;;;;;;;;AASA,MAAa,wBACX,qBACG;CACH,MAAM,4BAA4BA,uEAAAA,8BAA8B;AAChE,2BAA0B,uBAAA,kCAEzB;CAED,MAAM,6BAA0C,UAAa;AAE3D,MAAI,MAAM,MAAM;GAGd,MAAM,aAAa;AAKnB,OAAI,WAAW,cACb,2BAA0B,gBAAgB;IACxC,MAAM,WAAW,cAAc;IAC/B,KAAK,WAAW,cAAc;IAC/B,CAAC;;AAIN,SAAOC,MAAM,cAAiB,kBAAkB,MAAM;;AAIxD,2BAA0B,cAAc,wBAAwB,iBAAiB,eAAe,iBAAiB,QAAQ,YAAY;AACrI,EAAA,GAAA,wBAAA,SAAqB,2BAA2B,iBAAiB;AAEjE,QAAO"}
1
+ {"version":3,"file":"withMXLRoutingLegacy.cjs","names":["getNavigationInstrumentation","React"],"sources":["../../../../../../src/instrumentations/navigation/NavigationInstrumentation/react/reactRouterV5/withMXLRoutingLegacy.ts"],"sourcesContent":["import hoistNonReactStatics from 'hoist-non-react-statics';\nimport * as React from 'react';\nimport { MXL_NAVIGATION_INSTRUMENTATIONS } from '../../../../../constants';\nimport { getNavigationInstrumentation } from '../..';\nimport type { RouteComponentProps, SwitchedRouteComponentProps } from './types';\n\nexport const withMXLRoutingLegacy = <P extends RouteComponentProps>(\n WrappedComponent: React.ComponentType<P>,\n) => {\n const navigationInstrumentation = getNavigationInstrumentation();\n navigationInstrumentation.setInstrumentationType(\n MXL_NAVIGATION_INSTRUMENTATIONS.DeclarativeLegacy,\n );\n\n const RouteWithMXLRoutingLegacy: React.FC<P> = (props: P) => {\n // Make sure this is Route component\n if (props.path) {\n // Routes get injected with computedMatch when they are children of a <Switch> but the types do not reflect that\n // Manually setting the type here.\n const routeProps = props as SwitchedRouteComponentProps;\n\n // Depends on this internal behaviour\n // https://github.com/remix-run/react-router/blob/v5.3.4/packages/react-router/modules/Switch.js#L40\n // It shouldn't change as this version is legacy, and it's not being actively worked on\n if (routeProps.computedMatch) {\n navigationInstrumentation.setCurrentRoute({\n path: routeProps.computedMatch.path,\n url: routeProps.computedMatch.url,\n });\n }\n }\n\n return React.createElement<P>(WrappedComponent, props);\n };\n\n // Keep wrapped component metadata\n RouteWithMXLRoutingLegacy.displayName = `withMXLRoutingLegacy(${WrappedComponent.displayName || WrappedComponent.name || 'Component'})`;\n hoistNonReactStatics(RouteWithMXLRoutingLegacy, WrappedComponent);\n\n return RouteWithMXLRoutingLegacy;\n};\n"],"mappings":";;;;;;;;;AAMA,MAAa,wBACX,qBACG;CACH,MAAM,4BAA4BA,uEAAAA,8BAA8B;AAChE,2BAA0B,uBAAA,kCAEzB;CAED,MAAM,6BAA0C,UAAa;AAE3D,MAAI,MAAM,MAAM;GAGd,MAAM,aAAa;AAKnB,OAAI,WAAW,cACb,2BAA0B,gBAAgB;IACxC,MAAM,WAAW,cAAc;IAC/B,KAAK,WAAW,cAAc;IAC/B,CAAC;;AAIN,SAAOC,MAAM,cAAiB,kBAAkB,MAAM;;AAIxD,2BAA0B,cAAc,wBAAwB,iBAAiB,eAAe,iBAAiB,QAAQ,YAAY;AACrI,EAAA,GAAA,wBAAA,SAAqB,2BAA2B,iBAAiB;AAEjE,QAAO"}
@@ -1 +1 @@
1
- {"version":3,"file":"withMXLRoutingLegacy.d.cts","names":[],"sources":["../../../../../../src/instrumentations/navigation/NavigationInstrumentation/react/reactRouterV5/withMXLRoutingLegacy.ts"],"mappings":";;;;cASa,oBAAA,aAAkC,mBAAA,EAC7C,gBAAA,EAAkB,OAAA,CAAM,aAAA,CAAc,CAAA,MAAE,OAAA,CAAA,EAAA,CAAA,CAAA"}
1
+ {"version":3,"file":"withMXLRoutingLegacy.d.cts","names":[],"sources":["../../../../../../src/instrumentations/navigation/NavigationInstrumentation/react/reactRouterV5/withMXLRoutingLegacy.ts"],"mappings":";;;;cAMa,oBAAA,aAAkC,mBAAA,EAC7C,gBAAA,EAAkB,OAAA,CAAM,aAAA,CAAc,CAAA,MAAE,OAAA,CAAA,EAAA,CAAA,CAAA"}
@@ -1 +1 @@
1
- {"version":3,"file":"withMXLRoutingLegacy.d.ts","names":[],"sources":["../../../../../../src/instrumentations/navigation/NavigationInstrumentation/react/reactRouterV5/withMXLRoutingLegacy.ts"],"mappings":";;;;cASa,oBAAA,aAAkC,mBAAA,EAC7C,gBAAA,EAAkB,OAAA,CAAM,aAAA,CAAc,CAAA,MAAE,OAAA,CAAA,EAAA,CAAA,CAAA"}
1
+ {"version":3,"file":"withMXLRoutingLegacy.d.ts","names":[],"sources":["../../../../../../src/instrumentations/navigation/NavigationInstrumentation/react/reactRouterV5/withMXLRoutingLegacy.ts"],"mappings":";;;;cAMa,oBAAA,aAAkC,mBAAA,EAC7C,gBAAA,EAAkB,OAAA,CAAM,aAAA,CAAc,CAAA,MAAE,OAAA,CAAA,EAAA,CAAA,CAAA"}
@@ -1 +1 @@
1
- {"version":3,"file":"withMXLRoutingLegacy.js","names":["React"],"sources":["../../../../../../src/instrumentations/navigation/NavigationInstrumentation/react/reactRouterV5/withMXLRoutingLegacy.ts"],"sourcesContent":["import hoistNonReactStatics from 'hoist-non-react-statics';\nimport * as React from 'react';\nimport { MXL_NAVIGATION_INSTRUMENTATIONS } from '../../../../../constants/index.ts';\nimport { getNavigationInstrumentation } from '../../index.ts';\nimport type {\n RouteComponentProps,\n SwitchedRouteComponentProps,\n} from './types.ts';\n\nexport const withMXLRoutingLegacy = <P extends RouteComponentProps>(\n WrappedComponent: React.ComponentType<P>,\n) => {\n const navigationInstrumentation = getNavigationInstrumentation();\n navigationInstrumentation.setInstrumentationType(\n MXL_NAVIGATION_INSTRUMENTATIONS.DeclarativeLegacy,\n );\n\n const RouteWithMXLRoutingLegacy: React.FC<P> = (props: P) => {\n // Make sure this is Route component\n if (props.path) {\n // Routes get injected with computedMatch when they are children of a <Switch> but the types do not reflect that\n // Manually setting the type here.\n const routeProps = props as SwitchedRouteComponentProps;\n\n // Depends on this internal behaviour\n // https://github.com/remix-run/react-router/blob/v5.3.4/packages/react-router/modules/Switch.js#L40\n // It shouldn't change as this version is legacy, and it's not being actively worked on\n if (routeProps.computedMatch) {\n navigationInstrumentation.setCurrentRoute({\n path: routeProps.computedMatch.path,\n url: routeProps.computedMatch.url,\n });\n }\n }\n\n return React.createElement<P>(WrappedComponent, props);\n };\n\n // Keep wrapped component metadata\n RouteWithMXLRoutingLegacy.displayName = `withMXLRoutingLegacy(${WrappedComponent.displayName || WrappedComponent.name || 'Component'})`;\n hoistNonReactStatics(RouteWithMXLRoutingLegacy, WrappedComponent);\n\n return RouteWithMXLRoutingLegacy;\n};\n"],"mappings":";;;;;AASA,MAAa,wBACX,qBACG;CACH,MAAM,4BAA4B,8BAA8B;AAChE,2BAA0B,uBAAA,kCAEzB;CAED,MAAM,6BAA0C,UAAa;AAE3D,MAAI,MAAM,MAAM;GAGd,MAAM,aAAa;AAKnB,OAAI,WAAW,cACb,2BAA0B,gBAAgB;IACxC,MAAM,WAAW,cAAc;IAC/B,KAAK,WAAW,cAAc;IAC/B,CAAC;;AAIN,SAAOA,QAAM,cAAiB,kBAAkB,MAAM;;AAIxD,2BAA0B,cAAc,wBAAwB,iBAAiB,eAAe,iBAAiB,QAAQ,YAAY;AACrI,sBAAqB,2BAA2B,iBAAiB;AAEjE,QAAO"}
1
+ {"version":3,"file":"withMXLRoutingLegacy.js","names":["React"],"sources":["../../../../../../src/instrumentations/navigation/NavigationInstrumentation/react/reactRouterV5/withMXLRoutingLegacy.ts"],"sourcesContent":["import hoistNonReactStatics from 'hoist-non-react-statics';\nimport * as React from 'react';\nimport { MXL_NAVIGATION_INSTRUMENTATIONS } from '../../../../../constants';\nimport { getNavigationInstrumentation } from '../..';\nimport type { RouteComponentProps, SwitchedRouteComponentProps } from './types';\n\nexport const withMXLRoutingLegacy = <P extends RouteComponentProps>(\n WrappedComponent: React.ComponentType<P>,\n) => {\n const navigationInstrumentation = getNavigationInstrumentation();\n navigationInstrumentation.setInstrumentationType(\n MXL_NAVIGATION_INSTRUMENTATIONS.DeclarativeLegacy,\n );\n\n const RouteWithMXLRoutingLegacy: React.FC<P> = (props: P) => {\n // Make sure this is Route component\n if (props.path) {\n // Routes get injected with computedMatch when they are children of a <Switch> but the types do not reflect that\n // Manually setting the type here.\n const routeProps = props as SwitchedRouteComponentProps;\n\n // Depends on this internal behaviour\n // https://github.com/remix-run/react-router/blob/v5.3.4/packages/react-router/modules/Switch.js#L40\n // It shouldn't change as this version is legacy, and it's not being actively worked on\n if (routeProps.computedMatch) {\n navigationInstrumentation.setCurrentRoute({\n path: routeProps.computedMatch.path,\n url: routeProps.computedMatch.url,\n });\n }\n }\n\n return React.createElement<P>(WrappedComponent, props);\n };\n\n // Keep wrapped component metadata\n RouteWithMXLRoutingLegacy.displayName = `withMXLRoutingLegacy(${WrappedComponent.displayName || WrappedComponent.name || 'Component'})`;\n hoistNonReactStatics(RouteWithMXLRoutingLegacy, WrappedComponent);\n\n return RouteWithMXLRoutingLegacy;\n};\n"],"mappings":";;;;;AAMA,MAAa,wBACX,qBACG;CACH,MAAM,4BAA4B,8BAA8B;AAChE,2BAA0B,uBAAA,kCAEzB;CAED,MAAM,6BAA0C,UAAa;AAE3D,MAAI,MAAM,MAAM;GAGd,MAAM,aAAa;AAKnB,OAAI,WAAW,cACb,2BAA0B,gBAAgB;IACxC,MAAM,WAAW,cAAc;IAC/B,KAAK,WAAW,cAAc;IAC/B,CAAC;;AAIN,SAAOA,QAAM,cAAiB,kBAAkB,MAAM;;AAIxD,2BAA0B,cAAc,wBAAwB,iBAAiB,eAAe,iBAAiB,QAAQ,YAAY;AACrI,sBAAqB,2BAA2B,iBAAiB;AAEjE,QAAO"}
@@ -1 +1 @@
1
- {"version":3,"file":"listenToRouterChanges.cjs","names":["getNavigationInstrumentation"],"sources":["../../../../../../src/instrumentations/navigation/NavigationInstrumentation/react/reactRouterV6Data/listenToRouterChanges.ts"],"sourcesContent":["import type { Route } from '../../../../../api-page/index.ts';\nimport { MXL_NAVIGATION_INSTRUMENTATIONS } from '../../../../../constants/index.ts';\nimport { getNavigationInstrumentation } from '../../index.ts';\nimport type { ListenToRouterChangesArgs, Match } from './types.ts';\n\n/**\n * getRouteFromMatches goes through all the matches routes to build the full path\n * nested routes contain only the partial match, so we need to go through all of them\n * in order to build the full path.\n *\n * Filtering by currentPathname ensures that we only consider routes that are relevant to the current URL.\n */\nconst getRouteFromMatches = (\n matches: Match[],\n currentPathname: string,\n): Route | null => {\n const currentMatchIndex = matches.findIndex(\n (match) => match.pathname === currentPathname,\n );\n\n if (currentMatchIndex === -1 || !matches[currentMatchIndex].route.path) {\n return null;\n }\n\n // Build full absolute path by reducing all matches up to the current one.\n // Absolute child paths reset the accumulation; relative paths are appended.\n return matches\n .slice(0, currentMatchIndex + 1)\n .reduce<Route | null>((acc, match) => {\n const routePath = match.route.path;\n\n if (!routePath) {\n return acc;\n }\n\n // If the route path starts with '/', it's an absolute path and should reset the accumulated path.\n // Otherwise, it's a relative path and should be appended to the accumulated path.\n const path = routePath.startsWith('/')\n ? routePath\n : `${acc?.path ?? ''}/${routePath}`;\n\n return { path, url: matches[currentMatchIndex].pathname };\n }, null);\n};\n\nexport const listenToRouterChanges = ({\n router,\n routesMatcher,\n config: { pathnameDocument = window.location } = {},\n}: ListenToRouterChangesArgs) => {\n const navigationInstrumentation = getNavigationInstrumentation();\n navigationInstrumentation.setInstrumentationType(\n MXL_NAVIGATION_INSTRUMENTATIONS.Data,\n );\n\n const initialMatches = routesMatcher(router.routes, {\n pathname: pathnameDocument.pathname,\n });\n\n const initialRoute = initialMatches\n ? getRouteFromMatches(initialMatches, pathnameDocument.pathname)\n : null;\n\n if (initialRoute) {\n navigationInstrumentation.setCurrentRoute(initialRoute);\n }\n\n return router.subscribe((state) => {\n // State has a list of already matched routes\n // https://github.com/remix-run/react-router/blob/main/packages/react-router/lib/router/router.ts#L954\n const currentRoute = getRouteFromMatches(\n state.matches,\n state.location.pathname,\n );\n\n if (currentRoute) {\n navigationInstrumentation.setCurrentRoute(currentRoute);\n }\n });\n};\n"],"mappings":";;;;;;;;;;;AAYA,MAAM,uBACJ,SACA,oBACiB;CACjB,MAAM,oBAAoB,QAAQ,WAC/B,UAAU,MAAM,aAAa,gBAC/B;AAED,KAAI,sBAAsB,MAAM,CAAC,QAAQ,mBAAmB,MAAM,KAChE,QAAO;AAKT,QAAO,QACJ,MAAM,GAAG,oBAAoB,EAAE,CAC/B,QAAsB,KAAK,UAAU;EACpC,MAAM,YAAY,MAAM,MAAM;AAE9B,MAAI,CAAC,UACH,QAAO;AAST,SAAO;GAAE,MAJI,UAAU,WAAW,IAAI,GAClC,YACA,GAAG,KAAK,QAAQ,GAAG,GAAG;GAEX,KAAK,QAAQ,mBAAmB;GAAU;IACxD,KAAK;;AAGZ,MAAa,yBAAyB,EACpC,QACA,eACA,QAAQ,EAAE,mBAAmB,OAAO,aAAa,EAAE,OACpB;CAC/B,MAAM,4BAA4BA,uEAAAA,8BAA8B;AAChE,2BAA0B,uBAAA,oBAEzB;CAED,MAAM,iBAAiB,cAAc,OAAO,QAAQ,EAClD,UAAU,iBAAiB,UAC5B,CAAC;CAEF,MAAM,eAAe,iBACjB,oBAAoB,gBAAgB,iBAAiB,SAAS,GAC9D;AAEJ,KAAI,aACF,2BAA0B,gBAAgB,aAAa;AAGzD,QAAO,OAAO,WAAW,UAAU;EAGjC,MAAM,eAAe,oBACnB,MAAM,SACN,MAAM,SAAS,SAChB;AAED,MAAI,aACF,2BAA0B,gBAAgB,aAAa;GAEzD"}
1
+ {"version":3,"file":"listenToRouterChanges.cjs","names":["getNavigationInstrumentation"],"sources":["../../../../../../src/instrumentations/navigation/NavigationInstrumentation/react/reactRouterV6Data/listenToRouterChanges.ts"],"sourcesContent":["import type { Route } from '../../../../../api-page';\nimport { MXL_NAVIGATION_INSTRUMENTATIONS } from '../../../../../constants';\nimport { getNavigationInstrumentation } from '../..';\nimport type { ListenToRouterChangesArgs, Match } from './types';\n\n/**\n * getRouteFromMatches goes through all the matches routes to build the full path\n * nested routes contain only the partial match, so we need to go through all of them\n * in order to build the full path.\n *\n * Filtering by currentPathname ensures that we only consider routes that are relevant to the current URL.\n */\nconst getRouteFromMatches = (\n matches: Match[],\n currentPathname: string,\n): Route | null => {\n const currentMatchIndex = matches.findIndex(\n (match) => match.pathname === currentPathname,\n );\n\n if (currentMatchIndex === -1 || !matches[currentMatchIndex].route.path) {\n return null;\n }\n\n // Build full absolute path by reducing all matches up to the current one.\n // Absolute child paths reset the accumulation; relative paths are appended.\n return matches\n .slice(0, currentMatchIndex + 1)\n .reduce<Route | null>((acc, match) => {\n const routePath = match.route.path;\n\n if (!routePath) {\n return acc;\n }\n\n // If the route path starts with '/', it's an absolute path and should reset the accumulated path.\n // Otherwise, it's a relative path and should be appended to the accumulated path.\n const path = routePath.startsWith('/')\n ? routePath\n : `${acc?.path ?? ''}/${routePath}`;\n\n return { path, url: matches[currentMatchIndex].pathname };\n }, null);\n};\n\nexport const listenToRouterChanges = ({\n router,\n routesMatcher,\n config: { pathnameDocument = window.location } = {},\n}: ListenToRouterChangesArgs) => {\n const navigationInstrumentation = getNavigationInstrumentation();\n navigationInstrumentation.setInstrumentationType(\n MXL_NAVIGATION_INSTRUMENTATIONS.Data,\n );\n\n const initialMatches = routesMatcher(router.routes, {\n pathname: pathnameDocument.pathname,\n });\n\n const initialRoute = initialMatches\n ? getRouteFromMatches(initialMatches, pathnameDocument.pathname)\n : null;\n\n if (initialRoute) {\n navigationInstrumentation.setCurrentRoute(initialRoute);\n }\n\n return router.subscribe((state) => {\n // State has a list of already matched routes\n // https://github.com/remix-run/react-router/blob/main/packages/react-router/lib/router/router.ts#L954\n const currentRoute = getRouteFromMatches(\n state.matches,\n state.location.pathname,\n );\n\n if (currentRoute) {\n navigationInstrumentation.setCurrentRoute(currentRoute);\n }\n });\n};\n"],"mappings":";;;;;;;;;;;AAYA,MAAM,uBACJ,SACA,oBACiB;CACjB,MAAM,oBAAoB,QAAQ,WAC/B,UAAU,MAAM,aAAa,gBAC/B;AAED,KAAI,sBAAsB,MAAM,CAAC,QAAQ,mBAAmB,MAAM,KAChE,QAAO;AAKT,QAAO,QACJ,MAAM,GAAG,oBAAoB,EAAE,CAC/B,QAAsB,KAAK,UAAU;EACpC,MAAM,YAAY,MAAM,MAAM;AAE9B,MAAI,CAAC,UACH,QAAO;AAST,SAAO;GAAE,MAJI,UAAU,WAAW,IAAI,GAClC,YACA,GAAG,KAAK,QAAQ,GAAG,GAAG;GAEX,KAAK,QAAQ,mBAAmB;GAAU;IACxD,KAAK;;AAGZ,MAAa,yBAAyB,EACpC,QACA,eACA,QAAQ,EAAE,mBAAmB,OAAO,aAAa,EAAE,OACpB;CAC/B,MAAM,4BAA4BA,uEAAAA,8BAA8B;AAChE,2BAA0B,uBAAA,oBAEzB;CAED,MAAM,iBAAiB,cAAc,OAAO,QAAQ,EAClD,UAAU,iBAAiB,UAC5B,CAAC;CAEF,MAAM,eAAe,iBACjB,oBAAoB,gBAAgB,iBAAiB,SAAS,GAC9D;AAEJ,KAAI,aACF,2BAA0B,gBAAgB,aAAa;AAGzD,QAAO,OAAO,WAAW,UAAU;EAGjC,MAAM,eAAe,oBACnB,MAAM,SACN,MAAM,SAAS,SAChB;AAED,MAAI,aACF,2BAA0B,gBAAgB,aAAa;GAEzD"}
@@ -1 +1 @@
1
- {"version":3,"file":"listenToRouterChanges.js","names":[],"sources":["../../../../../../src/instrumentations/navigation/NavigationInstrumentation/react/reactRouterV6Data/listenToRouterChanges.ts"],"sourcesContent":["import type { Route } from '../../../../../api-page/index.ts';\nimport { MXL_NAVIGATION_INSTRUMENTATIONS } from '../../../../../constants/index.ts';\nimport { getNavigationInstrumentation } from '../../index.ts';\nimport type { ListenToRouterChangesArgs, Match } from './types.ts';\n\n/**\n * getRouteFromMatches goes through all the matches routes to build the full path\n * nested routes contain only the partial match, so we need to go through all of them\n * in order to build the full path.\n *\n * Filtering by currentPathname ensures that we only consider routes that are relevant to the current URL.\n */\nconst getRouteFromMatches = (\n matches: Match[],\n currentPathname: string,\n): Route | null => {\n const currentMatchIndex = matches.findIndex(\n (match) => match.pathname === currentPathname,\n );\n\n if (currentMatchIndex === -1 || !matches[currentMatchIndex].route.path) {\n return null;\n }\n\n // Build full absolute path by reducing all matches up to the current one.\n // Absolute child paths reset the accumulation; relative paths are appended.\n return matches\n .slice(0, currentMatchIndex + 1)\n .reduce<Route | null>((acc, match) => {\n const routePath = match.route.path;\n\n if (!routePath) {\n return acc;\n }\n\n // If the route path starts with '/', it's an absolute path and should reset the accumulated path.\n // Otherwise, it's a relative path and should be appended to the accumulated path.\n const path = routePath.startsWith('/')\n ? routePath\n : `${acc?.path ?? ''}/${routePath}`;\n\n return { path, url: matches[currentMatchIndex].pathname };\n }, null);\n};\n\nexport const listenToRouterChanges = ({\n router,\n routesMatcher,\n config: { pathnameDocument = window.location } = {},\n}: ListenToRouterChangesArgs) => {\n const navigationInstrumentation = getNavigationInstrumentation();\n navigationInstrumentation.setInstrumentationType(\n MXL_NAVIGATION_INSTRUMENTATIONS.Data,\n );\n\n const initialMatches = routesMatcher(router.routes, {\n pathname: pathnameDocument.pathname,\n });\n\n const initialRoute = initialMatches\n ? getRouteFromMatches(initialMatches, pathnameDocument.pathname)\n : null;\n\n if (initialRoute) {\n navigationInstrumentation.setCurrentRoute(initialRoute);\n }\n\n return router.subscribe((state) => {\n // State has a list of already matched routes\n // https://github.com/remix-run/react-router/blob/main/packages/react-router/lib/router/router.ts#L954\n const currentRoute = getRouteFromMatches(\n state.matches,\n state.location.pathname,\n );\n\n if (currentRoute) {\n navigationInstrumentation.setCurrentRoute(currentRoute);\n }\n });\n};\n"],"mappings":";;;;;;;;;;AAYA,MAAM,uBACJ,SACA,oBACiB;CACjB,MAAM,oBAAoB,QAAQ,WAC/B,UAAU,MAAM,aAAa,gBAC/B;AAED,KAAI,sBAAsB,MAAM,CAAC,QAAQ,mBAAmB,MAAM,KAChE,QAAO;AAKT,QAAO,QACJ,MAAM,GAAG,oBAAoB,EAAE,CAC/B,QAAsB,KAAK,UAAU;EACpC,MAAM,YAAY,MAAM,MAAM;AAE9B,MAAI,CAAC,UACH,QAAO;AAST,SAAO;GAAE,MAJI,UAAU,WAAW,IAAI,GAClC,YACA,GAAG,KAAK,QAAQ,GAAG,GAAG;GAEX,KAAK,QAAQ,mBAAmB;GAAU;IACxD,KAAK;;AAGZ,MAAa,yBAAyB,EACpC,QACA,eACA,QAAQ,EAAE,mBAAmB,OAAO,aAAa,EAAE,OACpB;CAC/B,MAAM,4BAA4B,8BAA8B;AAChE,2BAA0B,uBAAA,oBAEzB;CAED,MAAM,iBAAiB,cAAc,OAAO,QAAQ,EAClD,UAAU,iBAAiB,UAC5B,CAAC;CAEF,MAAM,eAAe,iBACjB,oBAAoB,gBAAgB,iBAAiB,SAAS,GAC9D;AAEJ,KAAI,aACF,2BAA0B,gBAAgB,aAAa;AAGzD,QAAO,OAAO,WAAW,UAAU;EAGjC,MAAM,eAAe,oBACnB,MAAM,SACN,MAAM,SAAS,SAChB;AAED,MAAI,aACF,2BAA0B,gBAAgB,aAAa;GAEzD"}
1
+ {"version":3,"file":"listenToRouterChanges.js","names":[],"sources":["../../../../../../src/instrumentations/navigation/NavigationInstrumentation/react/reactRouterV6Data/listenToRouterChanges.ts"],"sourcesContent":["import type { Route } from '../../../../../api-page';\nimport { MXL_NAVIGATION_INSTRUMENTATIONS } from '../../../../../constants';\nimport { getNavigationInstrumentation } from '../..';\nimport type { ListenToRouterChangesArgs, Match } from './types';\n\n/**\n * getRouteFromMatches goes through all the matches routes to build the full path\n * nested routes contain only the partial match, so we need to go through all of them\n * in order to build the full path.\n *\n * Filtering by currentPathname ensures that we only consider routes that are relevant to the current URL.\n */\nconst getRouteFromMatches = (\n matches: Match[],\n currentPathname: string,\n): Route | null => {\n const currentMatchIndex = matches.findIndex(\n (match) => match.pathname === currentPathname,\n );\n\n if (currentMatchIndex === -1 || !matches[currentMatchIndex].route.path) {\n return null;\n }\n\n // Build full absolute path by reducing all matches up to the current one.\n // Absolute child paths reset the accumulation; relative paths are appended.\n return matches\n .slice(0, currentMatchIndex + 1)\n .reduce<Route | null>((acc, match) => {\n const routePath = match.route.path;\n\n if (!routePath) {\n return acc;\n }\n\n // If the route path starts with '/', it's an absolute path and should reset the accumulated path.\n // Otherwise, it's a relative path and should be appended to the accumulated path.\n const path = routePath.startsWith('/')\n ? routePath\n : `${acc?.path ?? ''}/${routePath}`;\n\n return { path, url: matches[currentMatchIndex].pathname };\n }, null);\n};\n\nexport const listenToRouterChanges = ({\n router,\n routesMatcher,\n config: { pathnameDocument = window.location } = {},\n}: ListenToRouterChangesArgs) => {\n const navigationInstrumentation = getNavigationInstrumentation();\n navigationInstrumentation.setInstrumentationType(\n MXL_NAVIGATION_INSTRUMENTATIONS.Data,\n );\n\n const initialMatches = routesMatcher(router.routes, {\n pathname: pathnameDocument.pathname,\n });\n\n const initialRoute = initialMatches\n ? getRouteFromMatches(initialMatches, pathnameDocument.pathname)\n : null;\n\n if (initialRoute) {\n navigationInstrumentation.setCurrentRoute(initialRoute);\n }\n\n return router.subscribe((state) => {\n // State has a list of already matched routes\n // https://github.com/remix-run/react-router/blob/main/packages/react-router/lib/router/router.ts#L954\n const currentRoute = getRouteFromMatches(\n state.matches,\n state.location.pathname,\n );\n\n if (currentRoute) {\n navigationInstrumentation.setCurrentRoute(currentRoute);\n }\n });\n};\n"],"mappings":";;;;;;;;;;AAYA,MAAM,uBACJ,SACA,oBACiB;CACjB,MAAM,oBAAoB,QAAQ,WAC/B,UAAU,MAAM,aAAa,gBAC/B;AAED,KAAI,sBAAsB,MAAM,CAAC,QAAQ,mBAAmB,MAAM,KAChE,QAAO;AAKT,QAAO,QACJ,MAAM,GAAG,oBAAoB,EAAE,CAC/B,QAAsB,KAAK,UAAU;EACpC,MAAM,YAAY,MAAM,MAAM;AAE9B,MAAI,CAAC,UACH,QAAO;AAST,SAAO;GAAE,MAJI,UAAU,WAAW,IAAI,GAClC,YACA,GAAG,KAAK,QAAQ,GAAG,GAAG;GAEX,KAAK,QAAQ,mBAAmB;GAAU;IACxD,KAAK;;AAGZ,MAAa,yBAAyB,EACpC,QACA,eACA,QAAQ,EAAE,mBAAmB,OAAO,aAAa,EAAE,OACpB;CAC/B,MAAM,4BAA4B,8BAA8B;AAChE,2BAA0B,uBAAA,oBAEzB;CAED,MAAM,iBAAiB,cAAc,OAAO,QAAQ,EAClD,UAAU,iBAAiB,UAC5B,CAAC;CAEF,MAAM,eAAe,iBACjB,oBAAoB,gBAAgB,iBAAiB,SAAS,GAC9D;AAEJ,KAAI,aACF,2BAA0B,gBAAgB,aAAa;AAGzD,QAAO,OAAO,WAAW,UAAU;EAGjC,MAAM,eAAe,oBACnB,MAAM,SACN,MAAM,SAAS,SAChB;AAED,MAAI,aACF,2BAA0B,gBAAgB,aAAa;GAEzD"}
@@ -1 +1 @@
1
- {"version":3,"file":"withMXLRouting.cjs","names":["getNavigationInstrumentation"],"sources":["../../../../../../src/instrumentations/navigation/NavigationInstrumentation/react/reactRouterV6Declarative/withMXLRouting.ts"],"sourcesContent":["import hoistNonReactStatics from 'hoist-non-react-statics';\nimport type React from 'react';\nimport { createElement } from 'react';\nimport type { Route } from '../../../../../api-page/index.ts';\nimport { MXL_NAVIGATION_INSTRUMENTATIONS } from '../../../../../constants/index.ts';\nimport { getNavigationInstrumentation } from '../../index.ts';\nimport type { RoutesFunctionalComponentReturn } from './types.ts';\n\n// Routes can be nested, we need to traverse the routeContext to find the last route\nconst getLastRoute = (\n matchedComponent: RoutesFunctionalComponentReturn,\n lastRoute: Route | null,\n): Route | null => {\n if (!matchedComponent.props.match?.route) {\n return null;\n }\n\n const childPath = matchedComponent.props.match.route.path;\n const path =\n lastRoute && !childPath.startsWith('/')\n ? `${lastRoute.path}/${childPath}`\n : childPath;\n\n if (matchedComponent.props.routeContext?.outlet) {\n return getLastRoute(matchedComponent.props.routeContext.outlet, {\n path,\n url: matchedComponent.props.match.pathname,\n });\n }\n\n return {\n path,\n url: matchedComponent.props.match.pathname,\n };\n};\n\nexport const withMXLRouting = <P extends object>(\n WrappedComponent: React.FunctionComponent<P>,\n) => {\n const navigationInstrumentation = getNavigationInstrumentation();\n navigationInstrumentation.setInstrumentationType(\n MXL_NAVIGATION_INSTRUMENTATIONS.Declarative,\n );\n\n const RoutesWithMXLRouting: React.FC<P> = (props: P) => {\n /**\n * React-router v6+ implementation is very different from v5\n * It doesn't have a <Switch> component that injects props into <Route>\n * Instead, it has <Routes> which internally calculates the matched route\n * and returns it as a children, <Route> cannot be wrapped since it requires all children to be a <Route> component\n * here we rely on that matching to get the current route.\n * It's not ideal to rely on internal implementation details, but it's the easier way of getting the current route\n * without having to manually match it or using hooks on each children component\n *\n * See: https://github.com/remix-run/react-router/blob/main/packages/react-router/lib/hooks.tsx#L553\n */\n const matchedComponent = WrappedComponent(\n props,\n ) as unknown as RoutesFunctionalComponentReturn;\n\n if (matchedComponent.props.match?.route) {\n const lastRoute = getLastRoute(matchedComponent, null);\n if (lastRoute) {\n navigationInstrumentation.setCurrentRoute(lastRoute);\n }\n }\n\n return createElement<P>(WrappedComponent, props);\n };\n\n // Keep wrapped component metadata\n RoutesWithMXLRouting.displayName = `withMXLRouting(${WrappedComponent.displayName || WrappedComponent.name || 'Component'})`;\n hoistNonReactStatics(RoutesWithMXLRouting, WrappedComponent);\n\n return RoutesWithMXLRouting;\n};\n"],"mappings":";;;;;;;;AASA,MAAM,gBACJ,kBACA,cACiB;AACjB,KAAI,CAAC,iBAAiB,MAAM,OAAO,MACjC,QAAO;CAGT,MAAM,YAAY,iBAAiB,MAAM,MAAM,MAAM;CACrD,MAAM,OACJ,aAAa,CAAC,UAAU,WAAW,IAAI,GACnC,GAAG,UAAU,KAAK,GAAG,cACrB;AAEN,KAAI,iBAAiB,MAAM,cAAc,OACvC,QAAO,aAAa,iBAAiB,MAAM,aAAa,QAAQ;EAC9D;EACA,KAAK,iBAAiB,MAAM,MAAM;EACnC,CAAC;AAGJ,QAAO;EACL;EACA,KAAK,iBAAiB,MAAM,MAAM;EACnC;;AAGH,MAAa,kBACX,qBACG;CACH,MAAM,4BAA4BA,uEAAAA,8BAA8B;AAChE,2BAA0B,uBAAA,2BAEzB;CAED,MAAM,wBAAqC,UAAa;;;;;;;;;;;;EAYtD,MAAM,mBAAmB,iBACvB,MACD;AAED,MAAI,iBAAiB,MAAM,OAAO,OAAO;GACvC,MAAM,YAAY,aAAa,kBAAkB,KAAK;AACtD,OAAI,UACF,2BAA0B,gBAAgB,UAAU;;AAIxD,UAAA,GAAA,MAAA,eAAwB,kBAAkB,MAAM;;AAIlD,sBAAqB,cAAc,kBAAkB,iBAAiB,eAAe,iBAAiB,QAAQ,YAAY;AAC1H,EAAA,GAAA,wBAAA,SAAqB,sBAAsB,iBAAiB;AAE5D,QAAO"}
1
+ {"version":3,"file":"withMXLRouting.cjs","names":["getNavigationInstrumentation"],"sources":["../../../../../../src/instrumentations/navigation/NavigationInstrumentation/react/reactRouterV6Declarative/withMXLRouting.ts"],"sourcesContent":["import hoistNonReactStatics from 'hoist-non-react-statics';\nimport type React from 'react';\nimport { createElement } from 'react';\nimport type { Route } from '../../../../../api-page';\nimport { MXL_NAVIGATION_INSTRUMENTATIONS } from '../../../../../constants';\nimport { getNavigationInstrumentation } from '../..';\nimport type { RoutesFunctionalComponentReturn } from './types';\n\n// Routes can be nested, we need to traverse the routeContext to find the last route\nconst getLastRoute = (\n matchedComponent: RoutesFunctionalComponentReturn,\n lastRoute: Route | null,\n): Route | null => {\n if (!matchedComponent.props.match?.route) {\n return null;\n }\n\n const childPath = matchedComponent.props.match.route.path;\n const path =\n lastRoute && !childPath.startsWith('/')\n ? `${lastRoute.path}/${childPath}`\n : childPath;\n\n if (matchedComponent.props.routeContext?.outlet) {\n return getLastRoute(matchedComponent.props.routeContext.outlet, {\n path,\n url: matchedComponent.props.match.pathname,\n });\n }\n\n return {\n path,\n url: matchedComponent.props.match.pathname,\n };\n};\n\nexport const withMXLRouting = <P extends object>(\n WrappedComponent: React.FunctionComponent<P>,\n) => {\n const navigationInstrumentation = getNavigationInstrumentation();\n navigationInstrumentation.setInstrumentationType(\n MXL_NAVIGATION_INSTRUMENTATIONS.Declarative,\n );\n\n const RoutesWithMXLRouting: React.FC<P> = (props: P) => {\n /**\n * React-router v6+ implementation is very different from v5\n * It doesn't have a <Switch> component that injects props into <Route>\n * Instead, it has <Routes> which internally calculates the matched route\n * and returns it as a children, <Route> cannot be wrapped since it requires all children to be a <Route> component\n * here we rely on that matching to get the current route.\n * It's not ideal to rely on internal implementation details, but it's the easier way of getting the current route\n * without having to manually match it or using hooks on each children component\n *\n * See: https://github.com/remix-run/react-router/blob/main/packages/react-router/lib/hooks.tsx#L553\n */\n const matchedComponent = WrappedComponent(\n props,\n ) as unknown as RoutesFunctionalComponentReturn;\n\n if (matchedComponent.props.match?.route) {\n const lastRoute = getLastRoute(matchedComponent, null);\n if (lastRoute) {\n navigationInstrumentation.setCurrentRoute(lastRoute);\n }\n }\n\n return createElement<P>(WrappedComponent, props);\n };\n\n // Keep wrapped component metadata\n RoutesWithMXLRouting.displayName = `withMXLRouting(${WrappedComponent.displayName || WrappedComponent.name || 'Component'})`;\n hoistNonReactStatics(RoutesWithMXLRouting, WrappedComponent);\n\n return RoutesWithMXLRouting;\n};\n"],"mappings":";;;;;;;;AASA,MAAM,gBACJ,kBACA,cACiB;AACjB,KAAI,CAAC,iBAAiB,MAAM,OAAO,MACjC,QAAO;CAGT,MAAM,YAAY,iBAAiB,MAAM,MAAM,MAAM;CACrD,MAAM,OACJ,aAAa,CAAC,UAAU,WAAW,IAAI,GACnC,GAAG,UAAU,KAAK,GAAG,cACrB;AAEN,KAAI,iBAAiB,MAAM,cAAc,OACvC,QAAO,aAAa,iBAAiB,MAAM,aAAa,QAAQ;EAC9D;EACA,KAAK,iBAAiB,MAAM,MAAM;EACnC,CAAC;AAGJ,QAAO;EACL;EACA,KAAK,iBAAiB,MAAM,MAAM;EACnC;;AAGH,MAAa,kBACX,qBACG;CACH,MAAM,4BAA4BA,uEAAAA,8BAA8B;AAChE,2BAA0B,uBAAA,2BAEzB;CAED,MAAM,wBAAqC,UAAa;;;;;;;;;;;;EAYtD,MAAM,mBAAmB,iBACvB,MACD;AAED,MAAI,iBAAiB,MAAM,OAAO,OAAO;GACvC,MAAM,YAAY,aAAa,kBAAkB,KAAK;AACtD,OAAI,UACF,2BAA0B,gBAAgB,UAAU;;AAIxD,UAAA,GAAA,MAAA,eAAwB,kBAAkB,MAAM;;AAIlD,sBAAqB,cAAc,kBAAkB,iBAAiB,eAAe,iBAAiB,QAAQ,YAAY;AAC1H,EAAA,GAAA,wBAAA,SAAqB,sBAAsB,iBAAiB;AAE5D,QAAO"}
@@ -1 +1 @@
1
- {"version":3,"file":"withMXLRouting.js","names":[],"sources":["../../../../../../src/instrumentations/navigation/NavigationInstrumentation/react/reactRouterV6Declarative/withMXLRouting.ts"],"sourcesContent":["import hoistNonReactStatics from 'hoist-non-react-statics';\nimport type React from 'react';\nimport { createElement } from 'react';\nimport type { Route } from '../../../../../api-page/index.ts';\nimport { MXL_NAVIGATION_INSTRUMENTATIONS } from '../../../../../constants/index.ts';\nimport { getNavigationInstrumentation } from '../../index.ts';\nimport type { RoutesFunctionalComponentReturn } from './types.ts';\n\n// Routes can be nested, we need to traverse the routeContext to find the last route\nconst getLastRoute = (\n matchedComponent: RoutesFunctionalComponentReturn,\n lastRoute: Route | null,\n): Route | null => {\n if (!matchedComponent.props.match?.route) {\n return null;\n }\n\n const childPath = matchedComponent.props.match.route.path;\n const path =\n lastRoute && !childPath.startsWith('/')\n ? `${lastRoute.path}/${childPath}`\n : childPath;\n\n if (matchedComponent.props.routeContext?.outlet) {\n return getLastRoute(matchedComponent.props.routeContext.outlet, {\n path,\n url: matchedComponent.props.match.pathname,\n });\n }\n\n return {\n path,\n url: matchedComponent.props.match.pathname,\n };\n};\n\nexport const withMXLRouting = <P extends object>(\n WrappedComponent: React.FunctionComponent<P>,\n) => {\n const navigationInstrumentation = getNavigationInstrumentation();\n navigationInstrumentation.setInstrumentationType(\n MXL_NAVIGATION_INSTRUMENTATIONS.Declarative,\n );\n\n const RoutesWithMXLRouting: React.FC<P> = (props: P) => {\n /**\n * React-router v6+ implementation is very different from v5\n * It doesn't have a <Switch> component that injects props into <Route>\n * Instead, it has <Routes> which internally calculates the matched route\n * and returns it as a children, <Route> cannot be wrapped since it requires all children to be a <Route> component\n * here we rely on that matching to get the current route.\n * It's not ideal to rely on internal implementation details, but it's the easier way of getting the current route\n * without having to manually match it or using hooks on each children component\n *\n * See: https://github.com/remix-run/react-router/blob/main/packages/react-router/lib/hooks.tsx#L553\n */\n const matchedComponent = WrappedComponent(\n props,\n ) as unknown as RoutesFunctionalComponentReturn;\n\n if (matchedComponent.props.match?.route) {\n const lastRoute = getLastRoute(matchedComponent, null);\n if (lastRoute) {\n navigationInstrumentation.setCurrentRoute(lastRoute);\n }\n }\n\n return createElement<P>(WrappedComponent, props);\n };\n\n // Keep wrapped component metadata\n RoutesWithMXLRouting.displayName = `withMXLRouting(${WrappedComponent.displayName || WrappedComponent.name || 'Component'})`;\n hoistNonReactStatics(RoutesWithMXLRouting, WrappedComponent);\n\n return RoutesWithMXLRouting;\n};\n"],"mappings":";;;;;AASA,MAAM,gBACJ,kBACA,cACiB;AACjB,KAAI,CAAC,iBAAiB,MAAM,OAAO,MACjC,QAAO;CAGT,MAAM,YAAY,iBAAiB,MAAM,MAAM,MAAM;CACrD,MAAM,OACJ,aAAa,CAAC,UAAU,WAAW,IAAI,GACnC,GAAG,UAAU,KAAK,GAAG,cACrB;AAEN,KAAI,iBAAiB,MAAM,cAAc,OACvC,QAAO,aAAa,iBAAiB,MAAM,aAAa,QAAQ;EAC9D;EACA,KAAK,iBAAiB,MAAM,MAAM;EACnC,CAAC;AAGJ,QAAO;EACL;EACA,KAAK,iBAAiB,MAAM,MAAM;EACnC;;AAGH,MAAa,kBACX,qBACG;CACH,MAAM,4BAA4B,8BAA8B;AAChE,2BAA0B,uBAAA,2BAEzB;CAED,MAAM,wBAAqC,UAAa;;;;;;;;;;;;EAYtD,MAAM,mBAAmB,iBACvB,MACD;AAED,MAAI,iBAAiB,MAAM,OAAO,OAAO;GACvC,MAAM,YAAY,aAAa,kBAAkB,KAAK;AACtD,OAAI,UACF,2BAA0B,gBAAgB,UAAU;;AAIxD,SAAO,cAAiB,kBAAkB,MAAM;;AAIlD,sBAAqB,cAAc,kBAAkB,iBAAiB,eAAe,iBAAiB,QAAQ,YAAY;AAC1H,sBAAqB,sBAAsB,iBAAiB;AAE5D,QAAO"}
1
+ {"version":3,"file":"withMXLRouting.js","names":[],"sources":["../../../../../../src/instrumentations/navigation/NavigationInstrumentation/react/reactRouterV6Declarative/withMXLRouting.ts"],"sourcesContent":["import hoistNonReactStatics from 'hoist-non-react-statics';\nimport type React from 'react';\nimport { createElement } from 'react';\nimport type { Route } from '../../../../../api-page';\nimport { MXL_NAVIGATION_INSTRUMENTATIONS } from '../../../../../constants';\nimport { getNavigationInstrumentation } from '../..';\nimport type { RoutesFunctionalComponentReturn } from './types';\n\n// Routes can be nested, we need to traverse the routeContext to find the last route\nconst getLastRoute = (\n matchedComponent: RoutesFunctionalComponentReturn,\n lastRoute: Route | null,\n): Route | null => {\n if (!matchedComponent.props.match?.route) {\n return null;\n }\n\n const childPath = matchedComponent.props.match.route.path;\n const path =\n lastRoute && !childPath.startsWith('/')\n ? `${lastRoute.path}/${childPath}`\n : childPath;\n\n if (matchedComponent.props.routeContext?.outlet) {\n return getLastRoute(matchedComponent.props.routeContext.outlet, {\n path,\n url: matchedComponent.props.match.pathname,\n });\n }\n\n return {\n path,\n url: matchedComponent.props.match.pathname,\n };\n};\n\nexport const withMXLRouting = <P extends object>(\n WrappedComponent: React.FunctionComponent<P>,\n) => {\n const navigationInstrumentation = getNavigationInstrumentation();\n navigationInstrumentation.setInstrumentationType(\n MXL_NAVIGATION_INSTRUMENTATIONS.Declarative,\n );\n\n const RoutesWithMXLRouting: React.FC<P> = (props: P) => {\n /**\n * React-router v6+ implementation is very different from v5\n * It doesn't have a <Switch> component that injects props into <Route>\n * Instead, it has <Routes> which internally calculates the matched route\n * and returns it as a children, <Route> cannot be wrapped since it requires all children to be a <Route> component\n * here we rely on that matching to get the current route.\n * It's not ideal to rely on internal implementation details, but it's the easier way of getting the current route\n * without having to manually match it or using hooks on each children component\n *\n * See: https://github.com/remix-run/react-router/blob/main/packages/react-router/lib/hooks.tsx#L553\n */\n const matchedComponent = WrappedComponent(\n props,\n ) as unknown as RoutesFunctionalComponentReturn;\n\n if (matchedComponent.props.match?.route) {\n const lastRoute = getLastRoute(matchedComponent, null);\n if (lastRoute) {\n navigationInstrumentation.setCurrentRoute(lastRoute);\n }\n }\n\n return createElement<P>(WrappedComponent, props);\n };\n\n // Keep wrapped component metadata\n RoutesWithMXLRouting.displayName = `withMXLRouting(${WrappedComponent.displayName || WrappedComponent.name || 'Component'})`;\n hoistNonReactStatics(RoutesWithMXLRouting, WrappedComponent);\n\n return RoutesWithMXLRouting;\n};\n"],"mappings":";;;;;AASA,MAAM,gBACJ,kBACA,cACiB;AACjB,KAAI,CAAC,iBAAiB,MAAM,OAAO,MACjC,QAAO;CAGT,MAAM,YAAY,iBAAiB,MAAM,MAAM,MAAM;CACrD,MAAM,OACJ,aAAa,CAAC,UAAU,WAAW,IAAI,GACnC,GAAG,UAAU,KAAK,GAAG,cACrB;AAEN,KAAI,iBAAiB,MAAM,cAAc,OACvC,QAAO,aAAa,iBAAiB,MAAM,aAAa,QAAQ;EAC9D;EACA,KAAK,iBAAiB,MAAM,MAAM;EACnC,CAAC;AAGJ,QAAO;EACL;EACA,KAAK,iBAAiB,MAAM,MAAM;EACnC;;AAGH,MAAa,kBACX,qBACG;CACH,MAAM,4BAA4B,8BAA8B;AAChE,2BAA0B,uBAAA,2BAEzB;CAED,MAAM,wBAAqC,UAAa;;;;;;;;;;;;EAYtD,MAAM,mBAAmB,iBACvB,MACD;AAED,MAAI,iBAAiB,MAAM,OAAO,OAAO;GACvC,MAAM,YAAY,aAAa,kBAAkB,KAAK;AACtD,OAAI,UACF,2BAA0B,gBAAgB,UAAU;;AAIxD,SAAO,cAAiB,kBAAkB,MAAM;;AAIlD,sBAAqB,cAAc,kBAAkB,iBAAiB,eAAe,iBAAiB,QAAQ,YAAY;AAC1H,sBAAqB,sBAAsB,iBAAiB;AAE5D,QAAO"}
@@ -1 +1 @@
1
- {"version":3,"file":"ServerTimingInstrumentation.cjs","names":["MXLInstrumentationBase","SERVER_TIMING_EVENT_NAME","SeverityNumber","KEY_MXL_TYPE","KEY_MXL_SERVER_TIMING_NAME","KEY_MXL_SERVER_TIMING_DURATION","KEY_MXL_SERVER_TIMING_DESCRIPTION"],"sources":["../../../../src/instrumentations/server-timing/ServerTimingInstrumentation/ServerTimingInstrumentation.ts"],"sourcesContent":["import { SeverityNumber } from '@opentelemetry/api-logs';\nimport { MXL_TYPES, KEY_MXL_TYPE } from '../../../constants/index.ts';\nimport { MXLInstrumentationBase } from '../../MXLInstrumentationBase/index.ts';\nimport {\n KEY_MXL_SERVER_TIMING_DESCRIPTION,\n KEY_MXL_SERVER_TIMING_DURATION,\n KEY_MXL_SERVER_TIMING_NAME,\n SERVER_TIMING_EVENT_NAME,\n} from './constants.ts';\nimport type { ServerTimingInstrumentationArgs } from './types.ts';\n\nexport class ServerTimingInstrumentation extends MXLInstrumentationBase {\n private readonly _onLoad: () => void;\n private _performanceCollected = false;\n\n public constructor({\n diag,\n perf,\n limitManager,\n }: ServerTimingInstrumentationArgs = {}) {\n super({\n instrumentationName: 'ServerTimingInstrumentation',\n instrumentationVersion: '1.0.0',\n diag,\n perf,\n limitManager,\n config: {},\n });\n\n this._onLoad = () => {\n this._readServerTiming();\n };\n\n if (this._config.enabled) {\n this.enable();\n }\n }\n\n public enable(): void {\n window.removeEventListener('load', this._onLoad);\n\n if (window.document.readyState === 'complete') {\n this._readServerTiming();\n return;\n }\n\n window.addEventListener('load', this._onLoad);\n }\n\n public disable(): void {\n window.removeEventListener('load', this._onLoad);\n }\n\n private _readServerTiming(): void {\n if (this._performanceCollected) {\n return;\n }\n this._performanceCollected = true;\n\n const navEntries = performance.getEntriesByType(\n 'navigation',\n ) as PerformanceNavigationTiming[];\n const serverTiming = navEntries[0]?.serverTiming;\n\n if (!serverTiming?.length) {\n return;\n }\n\n for (const entry of serverTiming) {\n if (this.limitManager?.limitServerTimingEntry()) {\n return;\n }\n\n this.logger.emit({\n eventName: SERVER_TIMING_EVENT_NAME,\n severityNumber: SeverityNumber.INFO,\n attributes: {\n [KEY_MXL_TYPE]: MXL_TYPES.ServerTiming,\n [KEY_MXL_SERVER_TIMING_NAME]: entry.name,\n [KEY_MXL_SERVER_TIMING_DURATION]: entry.duration,\n [KEY_MXL_SERVER_TIMING_DESCRIPTION]: entry.description,\n },\n });\n }\n }\n}\n"],"mappings":";;;;;;;AAWA,IAAa,8BAAb,cAAiDA,uEAAAA,uBAAuB;CACtE;CACA,wBAAgC;CAEhC,YAAmB,EACjB,MACA,MACA,iBACmC,EAAE,EAAE;AACvC,QAAM;GACJ,qBAAqB;GACrB,wBAAwB;GACxB;GACA;GACA;GACA,QAAQ,EAAE;GACX,CAAC;AAEF,OAAK,gBAAgB;AACnB,QAAK,mBAAmB;;AAG1B,MAAI,KAAK,QAAQ,QACf,MAAK,QAAQ;;CAIjB,SAAsB;AACpB,SAAO,oBAAoB,QAAQ,KAAK,QAAQ;AAEhD,MAAI,OAAO,SAAS,eAAe,YAAY;AAC7C,QAAK,mBAAmB;AACxB;;AAGF,SAAO,iBAAiB,QAAQ,KAAK,QAAQ;;CAG/C,UAAuB;AACrB,SAAO,oBAAoB,QAAQ,KAAK,QAAQ;;CAGlD,oBAAkC;AAChC,MAAI,KAAK,sBACP;AAEF,OAAK,wBAAwB;EAK7B,MAAM,eAHa,YAAY,iBAC7B,aAE6B,CAAC,IAAI;AAEpC,MAAI,CAAC,cAAc,OACjB;AAGF,OAAK,MAAM,SAAS,cAAc;AAChC,OAAI,KAAK,cAAc,wBAAwB,CAC7C;AAGF,QAAK,OAAO,KAAK;IACf,WAAWC,6EAAAA;IACX,gBAAgBC,wBAAAA,eAAe;IAC/B,YAAY;MACTC,6BAAAA,eAAAA;MACAC,6EAAAA,6BAA6B,MAAM;MACnCC,6EAAAA,iCAAiC,MAAM;MACvCC,6EAAAA,oCAAoC,MAAM;KAC5C;IACF,CAAC"}
1
+ {"version":3,"file":"ServerTimingInstrumentation.cjs","names":["MXLInstrumentationBase","SERVER_TIMING_EVENT_NAME","SeverityNumber","KEY_MXL_TYPE","KEY_MXL_SERVER_TIMING_NAME","KEY_MXL_SERVER_TIMING_DURATION","KEY_MXL_SERVER_TIMING_DESCRIPTION"],"sources":["../../../../src/instrumentations/server-timing/ServerTimingInstrumentation/ServerTimingInstrumentation.ts"],"sourcesContent":["import { SeverityNumber } from '@opentelemetry/api-logs';\nimport { KEY_MXL_TYPE, MXL_TYPES } from '../../../constants';\nimport { MXLInstrumentationBase } from '../../MXLInstrumentationBase';\nimport {\n KEY_MXL_SERVER_TIMING_DESCRIPTION,\n KEY_MXL_SERVER_TIMING_DURATION,\n KEY_MXL_SERVER_TIMING_NAME,\n SERVER_TIMING_EVENT_NAME,\n} from './constants';\nimport type { ServerTimingInstrumentationArgs } from './types';\n\nexport class ServerTimingInstrumentation extends MXLInstrumentationBase {\n private readonly _onLoad: () => void;\n private _performanceCollected = false;\n\n public constructor({\n diag,\n perf,\n limitManager,\n }: ServerTimingInstrumentationArgs = {}) {\n super({\n instrumentationName: 'ServerTimingInstrumentation',\n instrumentationVersion: '1.0.0',\n diag,\n perf,\n limitManager,\n config: {},\n });\n\n this._onLoad = () => {\n this._readServerTiming();\n };\n\n if (this._config.enabled) {\n this.enable();\n }\n }\n\n public enable(): void {\n window.removeEventListener('load', this._onLoad);\n\n if (window.document.readyState === 'complete') {\n this._readServerTiming();\n return;\n }\n\n window.addEventListener('load', this._onLoad);\n }\n\n public disable(): void {\n window.removeEventListener('load', this._onLoad);\n }\n\n private _readServerTiming(): void {\n if (this._performanceCollected) {\n return;\n }\n this._performanceCollected = true;\n\n const navEntries = performance.getEntriesByType(\n 'navigation',\n ) as PerformanceNavigationTiming[];\n const serverTiming = navEntries[0]?.serverTiming;\n\n if (!serverTiming?.length) {\n return;\n }\n\n for (const entry of serverTiming) {\n if (this.limitManager?.limitServerTimingEntry()) {\n return;\n }\n\n this.logger.emit({\n eventName: SERVER_TIMING_EVENT_NAME,\n severityNumber: SeverityNumber.INFO,\n attributes: {\n [KEY_MXL_TYPE]: MXL_TYPES.ServerTiming,\n [KEY_MXL_SERVER_TIMING_NAME]: entry.name,\n [KEY_MXL_SERVER_TIMING_DURATION]: entry.duration,\n [KEY_MXL_SERVER_TIMING_DESCRIPTION]: entry.description,\n },\n });\n }\n }\n}\n"],"mappings":";;;;;;;AAWA,IAAa,8BAAb,cAAiDA,uEAAAA,uBAAuB;CACtE;CACA,wBAAgC;CAEhC,YAAmB,EACjB,MACA,MACA,iBACmC,EAAE,EAAE;AACvC,QAAM;GACJ,qBAAqB;GACrB,wBAAwB;GACxB;GACA;GACA;GACA,QAAQ,EAAE;GACX,CAAC;AAEF,OAAK,gBAAgB;AACnB,QAAK,mBAAmB;;AAG1B,MAAI,KAAK,QAAQ,QACf,MAAK,QAAQ;;CAIjB,SAAsB;AACpB,SAAO,oBAAoB,QAAQ,KAAK,QAAQ;AAEhD,MAAI,OAAO,SAAS,eAAe,YAAY;AAC7C,QAAK,mBAAmB;AACxB;;AAGF,SAAO,iBAAiB,QAAQ,KAAK,QAAQ;;CAG/C,UAAuB;AACrB,SAAO,oBAAoB,QAAQ,KAAK,QAAQ;;CAGlD,oBAAkC;AAChC,MAAI,KAAK,sBACP;AAEF,OAAK,wBAAwB;EAK7B,MAAM,eAHa,YAAY,iBAC7B,aAE6B,CAAC,IAAI;AAEpC,MAAI,CAAC,cAAc,OACjB;AAGF,OAAK,MAAM,SAAS,cAAc;AAChC,OAAI,KAAK,cAAc,wBAAwB,CAC7C;AAGF,QAAK,OAAO,KAAK;IACf,WAAWC,6EAAAA;IACX,gBAAgBC,wBAAAA,eAAe;IAC/B,YAAY;MACTC,6BAAAA,eAAAA;MACAC,6EAAAA,6BAA6B,MAAM;MACnCC,6EAAAA,iCAAiC,MAAM;MACvCC,6EAAAA,oCAAoC,MAAM;KAC5C;IACF,CAAC"}
@@ -1 +1 @@
1
- {"version":3,"file":"ServerTimingInstrumentation.js","names":[],"sources":["../../../../src/instrumentations/server-timing/ServerTimingInstrumentation/ServerTimingInstrumentation.ts"],"sourcesContent":["import { SeverityNumber } from '@opentelemetry/api-logs';\nimport { MXL_TYPES, KEY_MXL_TYPE } from '../../../constants/index.ts';\nimport { MXLInstrumentationBase } from '../../MXLInstrumentationBase/index.ts';\nimport {\n KEY_MXL_SERVER_TIMING_DESCRIPTION,\n KEY_MXL_SERVER_TIMING_DURATION,\n KEY_MXL_SERVER_TIMING_NAME,\n SERVER_TIMING_EVENT_NAME,\n} from './constants.ts';\nimport type { ServerTimingInstrumentationArgs } from './types.ts';\n\nexport class ServerTimingInstrumentation extends MXLInstrumentationBase {\n private readonly _onLoad: () => void;\n private _performanceCollected = false;\n\n public constructor({\n diag,\n perf,\n limitManager,\n }: ServerTimingInstrumentationArgs = {}) {\n super({\n instrumentationName: 'ServerTimingInstrumentation',\n instrumentationVersion: '1.0.0',\n diag,\n perf,\n limitManager,\n config: {},\n });\n\n this._onLoad = () => {\n this._readServerTiming();\n };\n\n if (this._config.enabled) {\n this.enable();\n }\n }\n\n public enable(): void {\n window.removeEventListener('load', this._onLoad);\n\n if (window.document.readyState === 'complete') {\n this._readServerTiming();\n return;\n }\n\n window.addEventListener('load', this._onLoad);\n }\n\n public disable(): void {\n window.removeEventListener('load', this._onLoad);\n }\n\n private _readServerTiming(): void {\n if (this._performanceCollected) {\n return;\n }\n this._performanceCollected = true;\n\n const navEntries = performance.getEntriesByType(\n 'navigation',\n ) as PerformanceNavigationTiming[];\n const serverTiming = navEntries[0]?.serverTiming;\n\n if (!serverTiming?.length) {\n return;\n }\n\n for (const entry of serverTiming) {\n if (this.limitManager?.limitServerTimingEntry()) {\n return;\n }\n\n this.logger.emit({\n eventName: SERVER_TIMING_EVENT_NAME,\n severityNumber: SeverityNumber.INFO,\n attributes: {\n [KEY_MXL_TYPE]: MXL_TYPES.ServerTiming,\n [KEY_MXL_SERVER_TIMING_NAME]: entry.name,\n [KEY_MXL_SERVER_TIMING_DURATION]: entry.duration,\n [KEY_MXL_SERVER_TIMING_DESCRIPTION]: entry.description,\n },\n });\n }\n }\n}\n"],"mappings":";;;;;AAWA,IAAa,8BAAb,cAAiD,uBAAuB;CACtE;CACA,wBAAgC;CAEhC,YAAmB,EACjB,MACA,MACA,iBACmC,EAAE,EAAE;AACvC,QAAM;GACJ,qBAAqB;GACrB,wBAAwB;GACxB;GACA;GACA;GACA,QAAQ,EAAE;GACX,CAAC;AAEF,OAAK,gBAAgB;AACnB,QAAK,mBAAmB;;AAG1B,MAAI,KAAK,QAAQ,QACf,MAAK,QAAQ;;CAIjB,SAAsB;AACpB,SAAO,oBAAoB,QAAQ,KAAK,QAAQ;AAEhD,MAAI,OAAO,SAAS,eAAe,YAAY;AAC7C,QAAK,mBAAmB;AACxB;;AAGF,SAAO,iBAAiB,QAAQ,KAAK,QAAQ;;CAG/C,UAAuB;AACrB,SAAO,oBAAoB,QAAQ,KAAK,QAAQ;;CAGlD,oBAAkC;AAChC,MAAI,KAAK,sBACP;AAEF,OAAK,wBAAwB;EAK7B,MAAM,eAHa,YAAY,iBAC7B,aAE6B,CAAC,IAAI;AAEpC,MAAI,CAAC,cAAc,OACjB;AAGF,OAAK,MAAM,SAAS,cAAc;AAChC,OAAI,KAAK,cAAc,wBAAwB,CAC7C;AAGF,QAAK,OAAO,KAAK;IACf,WAAW;IACX,gBAAgB,eAAe;IAC/B,YAAY;MACT,eAAA;MACA,6BAA6B,MAAM;MACnC,iCAAiC,MAAM;MACvC,oCAAoC,MAAM;KAC5C;IACF,CAAC"}
1
+ {"version":3,"file":"ServerTimingInstrumentation.js","names":[],"sources":["../../../../src/instrumentations/server-timing/ServerTimingInstrumentation/ServerTimingInstrumentation.ts"],"sourcesContent":["import { SeverityNumber } from '@opentelemetry/api-logs';\nimport { KEY_MXL_TYPE, MXL_TYPES } from '../../../constants';\nimport { MXLInstrumentationBase } from '../../MXLInstrumentationBase';\nimport {\n KEY_MXL_SERVER_TIMING_DESCRIPTION,\n KEY_MXL_SERVER_TIMING_DURATION,\n KEY_MXL_SERVER_TIMING_NAME,\n SERVER_TIMING_EVENT_NAME,\n} from './constants';\nimport type { ServerTimingInstrumentationArgs } from './types';\n\nexport class ServerTimingInstrumentation extends MXLInstrumentationBase {\n private readonly _onLoad: () => void;\n private _performanceCollected = false;\n\n public constructor({\n diag,\n perf,\n limitManager,\n }: ServerTimingInstrumentationArgs = {}) {\n super({\n instrumentationName: 'ServerTimingInstrumentation',\n instrumentationVersion: '1.0.0',\n diag,\n perf,\n limitManager,\n config: {},\n });\n\n this._onLoad = () => {\n this._readServerTiming();\n };\n\n if (this._config.enabled) {\n this.enable();\n }\n }\n\n public enable(): void {\n window.removeEventListener('load', this._onLoad);\n\n if (window.document.readyState === 'complete') {\n this._readServerTiming();\n return;\n }\n\n window.addEventListener('load', this._onLoad);\n }\n\n public disable(): void {\n window.removeEventListener('load', this._onLoad);\n }\n\n private _readServerTiming(): void {\n if (this._performanceCollected) {\n return;\n }\n this._performanceCollected = true;\n\n const navEntries = performance.getEntriesByType(\n 'navigation',\n ) as PerformanceNavigationTiming[];\n const serverTiming = navEntries[0]?.serverTiming;\n\n if (!serverTiming?.length) {\n return;\n }\n\n for (const entry of serverTiming) {\n if (this.limitManager?.limitServerTimingEntry()) {\n return;\n }\n\n this.logger.emit({\n eventName: SERVER_TIMING_EVENT_NAME,\n severityNumber: SeverityNumber.INFO,\n attributes: {\n [KEY_MXL_TYPE]: MXL_TYPES.ServerTiming,\n [KEY_MXL_SERVER_TIMING_NAME]: entry.name,\n [KEY_MXL_SERVER_TIMING_DURATION]: entry.duration,\n [KEY_MXL_SERVER_TIMING_DESCRIPTION]: entry.description,\n },\n });\n }\n }\n}\n"],"mappings":";;;;;AAWA,IAAa,8BAAb,cAAiD,uBAAuB;CACtE;CACA,wBAAgC;CAEhC,YAAmB,EACjB,MACA,MACA,iBACmC,EAAE,EAAE;AACvC,QAAM;GACJ,qBAAqB;GACrB,wBAAwB;GACxB;GACA;GACA;GACA,QAAQ,EAAE;GACX,CAAC;AAEF,OAAK,gBAAgB;AACnB,QAAK,mBAAmB;;AAG1B,MAAI,KAAK,QAAQ,QACf,MAAK,QAAQ;;CAIjB,SAAsB;AACpB,SAAO,oBAAoB,QAAQ,KAAK,QAAQ;AAEhD,MAAI,OAAO,SAAS,eAAe,YAAY;AAC7C,QAAK,mBAAmB;AACxB;;AAGF,SAAO,iBAAiB,QAAQ,KAAK,QAAQ;;CAG/C,UAAuB;AACrB,SAAO,oBAAoB,QAAQ,KAAK,QAAQ;;CAGlD,oBAAkC;AAChC,MAAI,KAAK,sBACP;AAEF,OAAK,wBAAwB;EAK7B,MAAM,eAHa,YAAY,iBAC7B,aAE6B,CAAC,IAAI;AAEpC,MAAI,CAAC,cAAc,OACjB;AAGF,OAAK,MAAM,SAAS,cAAc;AAChC,OAAI,KAAK,cAAc,wBAAwB,CAC7C;AAGF,QAAK,OAAO,KAAK;IACf,WAAW;IACX,gBAAgB,eAAe;IAC/B,YAAY;MACT,eAAA;MACA,6BAA6B,MAAM;MACnC,iCAAiC,MAAM;MACvC,oCAAoC,MAAM;KAC5C;IACF,CAAC"}
@@ -1 +1 @@
1
- {"version":3,"file":"SpanSessionBrowserActivityInstrumentation.cjs","names":["MXLInstrumentationBase","throttle","EVENT_THROTTLING_TIME_WINDOW","WINDOW_USER_EVENTS","TIMEOUT_TIME"],"sources":["../../../../src/instrumentations/session/SpanSessionBrowserActivityInstrumentation/SpanSessionBrowserActivityInstrumentation.ts"],"sourcesContent":["import type { TimeoutRef } from '../../../utils/index.ts';\nimport {\n bulkAddEventListener,\n bulkRemoveEventListener,\n throttle,\n} from '../../../utils/index.ts';\nimport { MXLInstrumentationBase } from '../../MXLInstrumentationBase/index.ts';\nimport {\n EVENT_THROTTLING_TIME_WINDOW,\n TIMEOUT_TIME,\n WINDOW_USER_EVENTS,\n} from './constants.ts';\nimport type { SpanSessionBrowserActivityInstrumentationArgs } from './types.ts';\n\n/**\n * SpanSessionBrowserActivityInstrumentation will track the user activity and end the session span if there is no\n * activity for a certain amount of time.\n * SpanSessionBrowserActivityInstrumentation will initialize new sessions if new activity is detected and there is no\n * active session.\n * */\nexport class SpanSessionBrowserActivityInstrumentation extends MXLInstrumentationBase {\n private readonly _onActivityThrottled: () => void;\n private _activityTimeout: TimeoutRef | null;\n\n public constructor({\n diag,\n }: SpanSessionBrowserActivityInstrumentationArgs = {}) {\n super({\n instrumentationName: 'SpanSessionBrowserActivityInstrumentation',\n instrumentationVersion: '1.0.0',\n diag,\n config: {},\n });\n this._activityTimeout = null;\n this._onActivityThrottled = throttle(\n this._onActivity,\n EVENT_THROTTLING_TIME_WINDOW,\n );\n if (this._config.enabled) {\n this.enable();\n }\n }\n\n public disable = () => {\n bulkRemoveEventListener({\n target: window,\n events: WINDOW_USER_EVENTS,\n callback: this._onActivityThrottled,\n });\n if (this._activityTimeout) {\n clearTimeout(this._activityTimeout);\n }\n this._activityTimeout = null;\n };\n\n public enable = () => {\n bulkAddEventListener({\n target: window,\n events: WINDOW_USER_EVENTS,\n callback: this._onActivityThrottled,\n });\n };\n\n private readonly _onInactivity = () => {\n this._diag.debug('Inactivity detected');\n if (this._activityTimeout) {\n clearTimeout(this._activityTimeout);\n }\n this._activityTimeout = null;\n this.sessionManager.endSessionSpanInternal('inactivity');\n };\n\n private readonly _onActivity = () => {\n this._diag.debug('Activity detected');\n if (this._activityTimeout) {\n clearTimeout(this._activityTimeout);\n }\n // if there was no active session, start one\n if (!this.sessionManager.getSessionId()) {\n this.sessionManager.startSessionSpan({ reason: 'activity' });\n }\n this._activityTimeout = setTimeout(this._onInactivity, TIMEOUT_TIME);\n };\n}\n"],"mappings":";;;;;;;;;;;;;AAoBA,IAAa,4CAAb,cAA+DA,uEAAAA,uBAAuB;CACpF;CACA;CAEA,YAAmB,EACjB,SACiD,EAAE,EAAE;AACrD,QAAM;GACJ,qBAAqB;GACrB,wBAAwB;GACxB;GACA,QAAQ,EAAE;GACX,CAAC;AACF,OAAK,mBAAmB;AACxB,OAAK,uBAAuBC,uBAAAA,SAC1B,KAAK,aACLC,qFAAAA,6BACD;AACD,MAAI,KAAK,QAAQ,QACf,MAAK,QAAQ;;CAIjB,gBAAuB;AACrB,gEAAA,wBAAwB;GACtB,QAAQ;GACR,QAAQC,qFAAAA;GACR,UAAU,KAAK;GAChB,CAAC;AACF,MAAI,KAAK,iBACP,cAAa,KAAK,iBAAiB;AAErC,OAAK,mBAAmB;;CAG1B,eAAsB;AACpB,0DAAA,qBAAqB;GACnB,QAAQ;GACR,QAAQA,qFAAAA;GACR,UAAU,KAAK;GAChB,CAAC;;CAGJ,sBAAuC;AACrC,OAAK,MAAM,MAAM,sBAAsB;AACvC,MAAI,KAAK,iBACP,cAAa,KAAK,iBAAiB;AAErC,OAAK,mBAAmB;AACxB,OAAK,eAAe,uBAAuB,aAAa;;CAG1D,oBAAqC;AACnC,OAAK,MAAM,MAAM,oBAAoB;AACrC,MAAI,KAAK,iBACP,cAAa,KAAK,iBAAiB;AAGrC,MAAI,CAAC,KAAK,eAAe,cAAc,CACrC,MAAK,eAAe,iBAAiB,EAAE,QAAQ,YAAY,CAAC;AAE9D,OAAK,mBAAmB,WAAW,KAAK,eAAeC,qFAAAA,aAAa"}
1
+ {"version":3,"file":"SpanSessionBrowserActivityInstrumentation.cjs","names":["MXLInstrumentationBase","throttle","EVENT_THROTTLING_TIME_WINDOW","WINDOW_USER_EVENTS","TIMEOUT_TIME"],"sources":["../../../../src/instrumentations/session/SpanSessionBrowserActivityInstrumentation/SpanSessionBrowserActivityInstrumentation.ts"],"sourcesContent":["import type { TimeoutRef } from '../../../utils';\nimport {\n bulkAddEventListener,\n bulkRemoveEventListener,\n throttle,\n} from '../../../utils';\nimport { MXLInstrumentationBase } from '../../MXLInstrumentationBase';\nimport {\n EVENT_THROTTLING_TIME_WINDOW,\n TIMEOUT_TIME,\n WINDOW_USER_EVENTS,\n} from './constants';\nimport type { SpanSessionBrowserActivityInstrumentationArgs } from './types';\n\n/**\n * SpanSessionBrowserActivityInstrumentation will track the user activity and end the session span if there is no\n * activity for a certain amount of time.\n * SpanSessionBrowserActivityInstrumentation will initialize new sessions if new activity is detected and there is no\n * active session.\n * */\nexport class SpanSessionBrowserActivityInstrumentation extends MXLInstrumentationBase {\n private readonly _onActivityThrottled: () => void;\n private _activityTimeout: TimeoutRef | null;\n\n public constructor({\n diag,\n }: SpanSessionBrowserActivityInstrumentationArgs = {}) {\n super({\n instrumentationName: 'SpanSessionBrowserActivityInstrumentation',\n instrumentationVersion: '1.0.0',\n diag,\n config: {},\n });\n this._activityTimeout = null;\n this._onActivityThrottled = throttle(\n this._onActivity,\n EVENT_THROTTLING_TIME_WINDOW,\n );\n if (this._config.enabled) {\n this.enable();\n }\n }\n\n public disable = () => {\n bulkRemoveEventListener({\n target: window,\n events: WINDOW_USER_EVENTS,\n callback: this._onActivityThrottled,\n });\n if (this._activityTimeout) {\n clearTimeout(this._activityTimeout);\n }\n this._activityTimeout = null;\n };\n\n public enable = () => {\n bulkAddEventListener({\n target: window,\n events: WINDOW_USER_EVENTS,\n callback: this._onActivityThrottled,\n });\n };\n\n private readonly _onInactivity = () => {\n this._diag.debug('Inactivity detected');\n if (this._activityTimeout) {\n clearTimeout(this._activityTimeout);\n }\n this._activityTimeout = null;\n this.sessionManager.endSessionSpanInternal('inactivity');\n };\n\n private readonly _onActivity = () => {\n this._diag.debug('Activity detected');\n if (this._activityTimeout) {\n clearTimeout(this._activityTimeout);\n }\n // if there was no active session, start one\n if (!this.sessionManager.getSessionId()) {\n this.sessionManager.startSessionSpan({ reason: 'activity' });\n }\n this._activityTimeout = setTimeout(this._onInactivity, TIMEOUT_TIME);\n };\n}\n"],"mappings":";;;;;;;;;;;;;AAoBA,IAAa,4CAAb,cAA+DA,uEAAAA,uBAAuB;CACpF;CACA;CAEA,YAAmB,EACjB,SACiD,EAAE,EAAE;AACrD,QAAM;GACJ,qBAAqB;GACrB,wBAAwB;GACxB;GACA,QAAQ,EAAE;GACX,CAAC;AACF,OAAK,mBAAmB;AACxB,OAAK,uBAAuBC,uBAAAA,SAC1B,KAAK,aACLC,qFAAAA,6BACD;AACD,MAAI,KAAK,QAAQ,QACf,MAAK,QAAQ;;CAIjB,gBAAuB;AACrB,gEAAA,wBAAwB;GACtB,QAAQ;GACR,QAAQC,qFAAAA;GACR,UAAU,KAAK;GAChB,CAAC;AACF,MAAI,KAAK,iBACP,cAAa,KAAK,iBAAiB;AAErC,OAAK,mBAAmB;;CAG1B,eAAsB;AACpB,0DAAA,qBAAqB;GACnB,QAAQ;GACR,QAAQA,qFAAAA;GACR,UAAU,KAAK;GAChB,CAAC;;CAGJ,sBAAuC;AACrC,OAAK,MAAM,MAAM,sBAAsB;AACvC,MAAI,KAAK,iBACP,cAAa,KAAK,iBAAiB;AAErC,OAAK,mBAAmB;AACxB,OAAK,eAAe,uBAAuB,aAAa;;CAG1D,oBAAqC;AACnC,OAAK,MAAM,MAAM,oBAAoB;AACrC,MAAI,KAAK,iBACP,cAAa,KAAK,iBAAiB;AAGrC,MAAI,CAAC,KAAK,eAAe,cAAc,CACrC,MAAK,eAAe,iBAAiB,EAAE,QAAQ,YAAY,CAAC;AAE9D,OAAK,mBAAmB,WAAW,KAAK,eAAeC,qFAAAA,aAAa"}
@@ -1 +1 @@
1
- {"version":3,"file":"SpanSessionBrowserActivityInstrumentation.js","names":[],"sources":["../../../../src/instrumentations/session/SpanSessionBrowserActivityInstrumentation/SpanSessionBrowserActivityInstrumentation.ts"],"sourcesContent":["import type { TimeoutRef } from '../../../utils/index.ts';\nimport {\n bulkAddEventListener,\n bulkRemoveEventListener,\n throttle,\n} from '../../../utils/index.ts';\nimport { MXLInstrumentationBase } from '../../MXLInstrumentationBase/index.ts';\nimport {\n EVENT_THROTTLING_TIME_WINDOW,\n TIMEOUT_TIME,\n WINDOW_USER_EVENTS,\n} from './constants.ts';\nimport type { SpanSessionBrowserActivityInstrumentationArgs } from './types.ts';\n\n/**\n * SpanSessionBrowserActivityInstrumentation will track the user activity and end the session span if there is no\n * activity for a certain amount of time.\n * SpanSessionBrowserActivityInstrumentation will initialize new sessions if new activity is detected and there is no\n * active session.\n * */\nexport class SpanSessionBrowserActivityInstrumentation extends MXLInstrumentationBase {\n private readonly _onActivityThrottled: () => void;\n private _activityTimeout: TimeoutRef | null;\n\n public constructor({\n diag,\n }: SpanSessionBrowserActivityInstrumentationArgs = {}) {\n super({\n instrumentationName: 'SpanSessionBrowserActivityInstrumentation',\n instrumentationVersion: '1.0.0',\n diag,\n config: {},\n });\n this._activityTimeout = null;\n this._onActivityThrottled = throttle(\n this._onActivity,\n EVENT_THROTTLING_TIME_WINDOW,\n );\n if (this._config.enabled) {\n this.enable();\n }\n }\n\n public disable = () => {\n bulkRemoveEventListener({\n target: window,\n events: WINDOW_USER_EVENTS,\n callback: this._onActivityThrottled,\n });\n if (this._activityTimeout) {\n clearTimeout(this._activityTimeout);\n }\n this._activityTimeout = null;\n };\n\n public enable = () => {\n bulkAddEventListener({\n target: window,\n events: WINDOW_USER_EVENTS,\n callback: this._onActivityThrottled,\n });\n };\n\n private readonly _onInactivity = () => {\n this._diag.debug('Inactivity detected');\n if (this._activityTimeout) {\n clearTimeout(this._activityTimeout);\n }\n this._activityTimeout = null;\n this.sessionManager.endSessionSpanInternal('inactivity');\n };\n\n private readonly _onActivity = () => {\n this._diag.debug('Activity detected');\n if (this._activityTimeout) {\n clearTimeout(this._activityTimeout);\n }\n // if there was no active session, start one\n if (!this.sessionManager.getSessionId()) {\n this.sessionManager.startSessionSpan({ reason: 'activity' });\n }\n this._activityTimeout = setTimeout(this._onInactivity, TIMEOUT_TIME);\n };\n}\n"],"mappings":";;;;;;;;;;;;AAoBA,IAAa,4CAAb,cAA+D,uBAAuB;CACpF;CACA;CAEA,YAAmB,EACjB,SACiD,EAAE,EAAE;AACrD,QAAM;GACJ,qBAAqB;GACrB,wBAAwB;GACxB;GACA,QAAQ,EAAE;GACX,CAAC;AACF,OAAK,mBAAmB;AACxB,OAAK,uBAAuB,SAC1B,KAAK,aACL,6BACD;AACD,MAAI,KAAK,QAAQ,QACf,MAAK,QAAQ;;CAIjB,gBAAuB;AACrB,0BAAwB;GACtB,QAAQ;GACR,QAAQ;GACR,UAAU,KAAK;GAChB,CAAC;AACF,MAAI,KAAK,iBACP,cAAa,KAAK,iBAAiB;AAErC,OAAK,mBAAmB;;CAG1B,eAAsB;AACpB,uBAAqB;GACnB,QAAQ;GACR,QAAQ;GACR,UAAU,KAAK;GAChB,CAAC;;CAGJ,sBAAuC;AACrC,OAAK,MAAM,MAAM,sBAAsB;AACvC,MAAI,KAAK,iBACP,cAAa,KAAK,iBAAiB;AAErC,OAAK,mBAAmB;AACxB,OAAK,eAAe,uBAAuB,aAAa;;CAG1D,oBAAqC;AACnC,OAAK,MAAM,MAAM,oBAAoB;AACrC,MAAI,KAAK,iBACP,cAAa,KAAK,iBAAiB;AAGrC,MAAI,CAAC,KAAK,eAAe,cAAc,CACrC,MAAK,eAAe,iBAAiB,EAAE,QAAQ,YAAY,CAAC;AAE9D,OAAK,mBAAmB,WAAW,KAAK,eAAe,aAAa"}
1
+ {"version":3,"file":"SpanSessionBrowserActivityInstrumentation.js","names":[],"sources":["../../../../src/instrumentations/session/SpanSessionBrowserActivityInstrumentation/SpanSessionBrowserActivityInstrumentation.ts"],"sourcesContent":["import type { TimeoutRef } from '../../../utils';\nimport {\n bulkAddEventListener,\n bulkRemoveEventListener,\n throttle,\n} from '../../../utils';\nimport { MXLInstrumentationBase } from '../../MXLInstrumentationBase';\nimport {\n EVENT_THROTTLING_TIME_WINDOW,\n TIMEOUT_TIME,\n WINDOW_USER_EVENTS,\n} from './constants';\nimport type { SpanSessionBrowserActivityInstrumentationArgs } from './types';\n\n/**\n * SpanSessionBrowserActivityInstrumentation will track the user activity and end the session span if there is no\n * activity for a certain amount of time.\n * SpanSessionBrowserActivityInstrumentation will initialize new sessions if new activity is detected and there is no\n * active session.\n * */\nexport class SpanSessionBrowserActivityInstrumentation extends MXLInstrumentationBase {\n private readonly _onActivityThrottled: () => void;\n private _activityTimeout: TimeoutRef | null;\n\n public constructor({\n diag,\n }: SpanSessionBrowserActivityInstrumentationArgs = {}) {\n super({\n instrumentationName: 'SpanSessionBrowserActivityInstrumentation',\n instrumentationVersion: '1.0.0',\n diag,\n config: {},\n });\n this._activityTimeout = null;\n this._onActivityThrottled = throttle(\n this._onActivity,\n EVENT_THROTTLING_TIME_WINDOW,\n );\n if (this._config.enabled) {\n this.enable();\n }\n }\n\n public disable = () => {\n bulkRemoveEventListener({\n target: window,\n events: WINDOW_USER_EVENTS,\n callback: this._onActivityThrottled,\n });\n if (this._activityTimeout) {\n clearTimeout(this._activityTimeout);\n }\n this._activityTimeout = null;\n };\n\n public enable = () => {\n bulkAddEventListener({\n target: window,\n events: WINDOW_USER_EVENTS,\n callback: this._onActivityThrottled,\n });\n };\n\n private readonly _onInactivity = () => {\n this._diag.debug('Inactivity detected');\n if (this._activityTimeout) {\n clearTimeout(this._activityTimeout);\n }\n this._activityTimeout = null;\n this.sessionManager.endSessionSpanInternal('inactivity');\n };\n\n private readonly _onActivity = () => {\n this._diag.debug('Activity detected');\n if (this._activityTimeout) {\n clearTimeout(this._activityTimeout);\n }\n // if there was no active session, start one\n if (!this.sessionManager.getSessionId()) {\n this.sessionManager.startSessionSpan({ reason: 'activity' });\n }\n this._activityTimeout = setTimeout(this._onInactivity, TIMEOUT_TIME);\n };\n}\n"],"mappings":";;;;;;;;;;;;AAoBA,IAAa,4CAAb,cAA+D,uBAAuB;CACpF;CACA;CAEA,YAAmB,EACjB,SACiD,EAAE,EAAE;AACrD,QAAM;GACJ,qBAAqB;GACrB,wBAAwB;GACxB;GACA,QAAQ,EAAE;GACX,CAAC;AACF,OAAK,mBAAmB;AACxB,OAAK,uBAAuB,SAC1B,KAAK,aACL,6BACD;AACD,MAAI,KAAK,QAAQ,QACf,MAAK,QAAQ;;CAIjB,gBAAuB;AACrB,0BAAwB;GACtB,QAAQ;GACR,QAAQ;GACR,UAAU,KAAK;GAChB,CAAC;AACF,MAAI,KAAK,iBACP,cAAa,KAAK,iBAAiB;AAErC,OAAK,mBAAmB;;CAG1B,eAAsB;AACpB,uBAAqB;GACnB,QAAQ;GACR,QAAQ;GACR,UAAU,KAAK;GAChB,CAAC;;CAGJ,sBAAuC;AACrC,OAAK,MAAM,MAAM,sBAAsB;AACvC,MAAI,KAAK,iBACP,cAAa,KAAK,iBAAiB;AAErC,OAAK,mBAAmB;AACxB,OAAK,eAAe,uBAAuB,aAAa;;CAG1D,oBAAqC;AACnC,OAAK,MAAM,MAAM,oBAAoB;AACrC,MAAI,KAAK,iBACP,cAAa,KAAK,iBAAiB;AAGrC,MAAI,CAAC,KAAK,eAAe,cAAc,CACrC,MAAK,eAAe,iBAAiB,EAAE,QAAQ,YAAY,CAAC;AAE9D,OAAK,mBAAmB,WAAW,KAAK,eAAe,aAAa"}
@@ -1 +1 @@
1
- {"version":3,"file":"SpanSessionOnLoadInstrumentation.cjs","names":["MXLInstrumentationBase"],"sources":["../../../../src/instrumentations/session/SpanSessionOnLoadInstrumentation/SpanSessionOnLoadInstrumentation.ts"],"sourcesContent":["import { MXLInstrumentationBase } from '../../MXLInstrumentationBase/index.ts';\nimport type { SpanSessionOnLoadInstrumentationArgs } from './types.ts';\n\nexport class SpanSessionOnLoadInstrumentation extends MXLInstrumentationBase {\n public constructor({ diag }: SpanSessionOnLoadInstrumentationArgs = {}) {\n super({\n instrumentationName: 'SpanSessionOnLoadInstrumentation',\n instrumentationVersion: '1.0.0',\n diag,\n config: {},\n });\n if (this._config.enabled) {\n this.enable();\n }\n }\n\n public disable(): void {\n this.sessionManager.endSessionSpanInternal('unknown');\n }\n\n public enable(): void {\n this.sessionManager.startSessionSpan({ reason: 'init' });\n }\n}\n"],"mappings":";;;AAGA,IAAa,mCAAb,cAAsDA,uEAAAA,uBAAuB;CAC3E,YAAmB,EAAE,SAA+C,EAAE,EAAE;AACtE,QAAM;GACJ,qBAAqB;GACrB,wBAAwB;GACxB;GACA,QAAQ,EAAE;GACX,CAAC;AACF,MAAI,KAAK,QAAQ,QACf,MAAK,QAAQ;;CAIjB,UAAuB;AACrB,OAAK,eAAe,uBAAuB,UAAU;;CAGvD,SAAsB;AACpB,OAAK,eAAe,iBAAiB,EAAE,QAAQ,QAAQ,CAAC"}
1
+ {"version":3,"file":"SpanSessionOnLoadInstrumentation.cjs","names":["MXLInstrumentationBase"],"sources":["../../../../src/instrumentations/session/SpanSessionOnLoadInstrumentation/SpanSessionOnLoadInstrumentation.ts"],"sourcesContent":["import { MXLInstrumentationBase } from '../../MXLInstrumentationBase';\nimport type { SpanSessionOnLoadInstrumentationArgs } from './types';\n\nexport class SpanSessionOnLoadInstrumentation extends MXLInstrumentationBase {\n public constructor({ diag }: SpanSessionOnLoadInstrumentationArgs = {}) {\n super({\n instrumentationName: 'SpanSessionOnLoadInstrumentation',\n instrumentationVersion: '1.0.0',\n diag,\n config: {},\n });\n if (this._config.enabled) {\n this.enable();\n }\n }\n\n public disable(): void {\n this.sessionManager.endSessionSpanInternal('unknown');\n }\n\n public enable(): void {\n this.sessionManager.startSessionSpan({ reason: 'init' });\n }\n}\n"],"mappings":";;;AAGA,IAAa,mCAAb,cAAsDA,uEAAAA,uBAAuB;CAC3E,YAAmB,EAAE,SAA+C,EAAE,EAAE;AACtE,QAAM;GACJ,qBAAqB;GACrB,wBAAwB;GACxB;GACA,QAAQ,EAAE;GACX,CAAC;AACF,MAAI,KAAK,QAAQ,QACf,MAAK,QAAQ;;CAIjB,UAAuB;AACrB,OAAK,eAAe,uBAAuB,UAAU;;CAGvD,SAAsB;AACpB,OAAK,eAAe,iBAAiB,EAAE,QAAQ,QAAQ,CAAC"}
@@ -1 +1 @@
1
- {"version":3,"file":"SpanSessionOnLoadInstrumentation.js","names":[],"sources":["../../../../src/instrumentations/session/SpanSessionOnLoadInstrumentation/SpanSessionOnLoadInstrumentation.ts"],"sourcesContent":["import { MXLInstrumentationBase } from '../../MXLInstrumentationBase/index.ts';\nimport type { SpanSessionOnLoadInstrumentationArgs } from './types.ts';\n\nexport class SpanSessionOnLoadInstrumentation extends MXLInstrumentationBase {\n public constructor({ diag }: SpanSessionOnLoadInstrumentationArgs = {}) {\n super({\n instrumentationName: 'SpanSessionOnLoadInstrumentation',\n instrumentationVersion: '1.0.0',\n diag,\n config: {},\n });\n if (this._config.enabled) {\n this.enable();\n }\n }\n\n public disable(): void {\n this.sessionManager.endSessionSpanInternal('unknown');\n }\n\n public enable(): void {\n this.sessionManager.startSessionSpan({ reason: 'init' });\n }\n}\n"],"mappings":";;AAGA,IAAa,mCAAb,cAAsD,uBAAuB;CAC3E,YAAmB,EAAE,SAA+C,EAAE,EAAE;AACtE,QAAM;GACJ,qBAAqB;GACrB,wBAAwB;GACxB;GACA,QAAQ,EAAE;GACX,CAAC;AACF,MAAI,KAAK,QAAQ,QACf,MAAK,QAAQ;;CAIjB,UAAuB;AACrB,OAAK,eAAe,uBAAuB,UAAU;;CAGvD,SAAsB;AACpB,OAAK,eAAe,iBAAiB,EAAE,QAAQ,QAAQ,CAAC"}
1
+ {"version":3,"file":"SpanSessionOnLoadInstrumentation.js","names":[],"sources":["../../../../src/instrumentations/session/SpanSessionOnLoadInstrumentation/SpanSessionOnLoadInstrumentation.ts"],"sourcesContent":["import { MXLInstrumentationBase } from '../../MXLInstrumentationBase';\nimport type { SpanSessionOnLoadInstrumentationArgs } from './types';\n\nexport class SpanSessionOnLoadInstrumentation extends MXLInstrumentationBase {\n public constructor({ diag }: SpanSessionOnLoadInstrumentationArgs = {}) {\n super({\n instrumentationName: 'SpanSessionOnLoadInstrumentation',\n instrumentationVersion: '1.0.0',\n diag,\n config: {},\n });\n if (this._config.enabled) {\n this.enable();\n }\n }\n\n public disable(): void {\n this.sessionManager.endSessionSpanInternal('unknown');\n }\n\n public enable(): void {\n this.sessionManager.startSessionSpan({ reason: 'init' });\n }\n}\n"],"mappings":";;AAGA,IAAa,mCAAb,cAAsD,uBAAuB;CAC3E,YAAmB,EAAE,SAA+C,EAAE,EAAE;AACtE,QAAM;GACJ,qBAAqB;GACrB,wBAAwB;GACxB;GACA,QAAQ,EAAE;GACX,CAAC;AACF,MAAI,KAAK,QAAQ,QACf,MAAK,QAAQ;;CAIjB,UAAuB;AACrB,OAAK,eAAe,uBAAuB,UAAU;;CAGvD,SAAsB;AACpB,OAAK,eAAe,iBAAiB,EAAE,QAAQ,QAAQ,CAAC"}
@@ -1 +1 @@
1
- {"version":3,"file":"SpanSessionTimeoutInstrumentation.cjs","names":["MXLInstrumentationBase","TIMEOUT_TIME"],"sources":["../../../../src/instrumentations/session/SpanSessionTimeoutInstrumentation/SpanSessionTimeoutInstrumentation.ts"],"sourcesContent":["import type { TimeoutRef } from '../../../utils/index.ts';\nimport { MXLInstrumentationBase } from '../../MXLInstrumentationBase/index.ts';\nimport { TIMEOUT_TIME } from './constants.ts';\nimport type { SpanSessionTimeoutInstrumentationArgs } from './types.ts';\n\n/**\n * SpanSessionTimeoutInstrumentation will track how long has a session been active and end it after a certain amount of time.\n * It will immediately start a new session after the previous one ends.\n **/\nexport class SpanSessionTimeoutInstrumentation extends MXLInstrumentationBase {\n private _sessionTimeout: TimeoutRef | null;\n\n public constructor({\n diag,\n perf,\n }: SpanSessionTimeoutInstrumentationArgs = {}) {\n super({\n instrumentationName: 'SpanSessionTimeoutInstrumentation',\n instrumentationVersion: '1.0.0',\n diag,\n perf,\n config: {},\n });\n this._sessionTimeout = null;\n if (this._config.enabled) {\n this.enable();\n }\n }\n\n public disable = () => {\n if (this._sessionTimeout) {\n clearTimeout(this._sessionTimeout);\n }\n this._sessionTimeout = null;\n };\n\n public enable = () => {\n this._checkTimeout();\n };\n\n private readonly _onTimeout = () => {\n this._diag.debug('Timeout detected');\n // clear existing timeout\n if (this._sessionTimeout) {\n clearTimeout(this._sessionTimeout);\n }\n this.sessionManager.endSessionSpanInternal('timer');\n this.sessionManager.startSessionSpan({ reason: 'timer' });\n // set a new check in TIMEOUT_TIME for the session we just started\n this._sessionTimeout = setTimeout(this._checkTimeout, TIMEOUT_TIME);\n };\n\n private readonly _checkTimeout = () => {\n const currentSessionStartTime = this.sessionManager.getSessionStartTime();\n // validate that there is an active session, as it may already been finished for other reasons.\n if (currentSessionStartTime) {\n // check how much time has passed since the session started\n const timePassed = this.perf.millisSinceHRTime(currentSessionStartTime);\n const remainingTime = TIMEOUT_TIME - timePassed;\n // if the remaining time is 0 or less, the session has already timed out.\n if (remainingTime <= 0) {\n // the session has already timed out.\n this._onTimeout();\n return;\n }\n // if there is time remaining, set a new timeout for check again after it\n if (this._sessionTimeout) {\n clearTimeout(this._sessionTimeout);\n }\n this._sessionTimeout = setTimeout(this._checkTimeout, remainingTime);\n return;\n }\n // if there is no currentSessionStartTime then there is no active session,\n // check again in TIMEOUT_TIME in case a new one is started.\n if (this._sessionTimeout) {\n clearTimeout(this._sessionTimeout);\n }\n this._sessionTimeout = setTimeout(this._checkTimeout, TIMEOUT_TIME);\n };\n}\n"],"mappings":";;;;;;;;AASA,IAAa,oCAAb,cAAuDA,uEAAAA,uBAAuB;CAC5E;CAEA,YAAmB,EACjB,MACA,SACyC,EAAE,EAAE;AAC7C,QAAM;GACJ,qBAAqB;GACrB,wBAAwB;GACxB;GACA;GACA,QAAQ,EAAE;GACX,CAAC;AACF,OAAK,kBAAkB;AACvB,MAAI,KAAK,QAAQ,QACf,MAAK,QAAQ;;CAIjB,gBAAuB;AACrB,MAAI,KAAK,gBACP,cAAa,KAAK,gBAAgB;AAEpC,OAAK,kBAAkB;;CAGzB,eAAsB;AACpB,OAAK,eAAe;;CAGtB,mBAAoC;AAClC,OAAK,MAAM,MAAM,mBAAmB;AAEpC,MAAI,KAAK,gBACP,cAAa,KAAK,gBAAgB;AAEpC,OAAK,eAAe,uBAAuB,QAAQ;AACnD,OAAK,eAAe,iBAAiB,EAAE,QAAQ,SAAS,CAAC;AAEzD,OAAK,kBAAkB,WAAW,KAAK,eAAeC,6EAAAA,aAAa;;CAGrE,sBAAuC;EACrC,MAAM,0BAA0B,KAAK,eAAe,qBAAqB;AAEzE,MAAI,yBAAyB;GAG3B,MAAM,gBAAgBA,6EAAAA,eADH,KAAK,KAAK,kBAAkB,wBACA;AAE/C,OAAI,iBAAiB,GAAG;AAEtB,SAAK,YAAY;AACjB;;AAGF,OAAI,KAAK,gBACP,cAAa,KAAK,gBAAgB;AAEpC,QAAK,kBAAkB,WAAW,KAAK,eAAe,cAAc;AACpE;;AAIF,MAAI,KAAK,gBACP,cAAa,KAAK,gBAAgB;AAEpC,OAAK,kBAAkB,WAAW,KAAK,eAAeA,6EAAAA,aAAa"}
1
+ {"version":3,"file":"SpanSessionTimeoutInstrumentation.cjs","names":["MXLInstrumentationBase","TIMEOUT_TIME"],"sources":["../../../../src/instrumentations/session/SpanSessionTimeoutInstrumentation/SpanSessionTimeoutInstrumentation.ts"],"sourcesContent":["import type { TimeoutRef } from '../../../utils';\nimport { MXLInstrumentationBase } from '../../MXLInstrumentationBase';\nimport { TIMEOUT_TIME } from './constants';\nimport type { SpanSessionTimeoutInstrumentationArgs } from './types';\n\n/**\n * SpanSessionTimeoutInstrumentation will track how long has a session been active and end it after a certain amount of time.\n * It will immediately start a new session after the previous one ends.\n **/\nexport class SpanSessionTimeoutInstrumentation extends MXLInstrumentationBase {\n private _sessionTimeout: TimeoutRef | null;\n\n public constructor({\n diag,\n perf,\n }: SpanSessionTimeoutInstrumentationArgs = {}) {\n super({\n instrumentationName: 'SpanSessionTimeoutInstrumentation',\n instrumentationVersion: '1.0.0',\n diag,\n perf,\n config: {},\n });\n this._sessionTimeout = null;\n if (this._config.enabled) {\n this.enable();\n }\n }\n\n public disable = () => {\n if (this._sessionTimeout) {\n clearTimeout(this._sessionTimeout);\n }\n this._sessionTimeout = null;\n };\n\n public enable = () => {\n this._checkTimeout();\n };\n\n private readonly _onTimeout = () => {\n this._diag.debug('Timeout detected');\n // clear existing timeout\n if (this._sessionTimeout) {\n clearTimeout(this._sessionTimeout);\n }\n this.sessionManager.endSessionSpanInternal('timer');\n this.sessionManager.startSessionSpan({ reason: 'timer' });\n // set a new check in TIMEOUT_TIME for the session we just started\n this._sessionTimeout = setTimeout(this._checkTimeout, TIMEOUT_TIME);\n };\n\n private readonly _checkTimeout = () => {\n const currentSessionStartTime = this.sessionManager.getSessionStartTime();\n // validate that there is an active session, as it may already been finished for other reasons.\n if (currentSessionStartTime) {\n // check how much time has passed since the session started\n const timePassed = this.perf.millisSinceHRTime(currentSessionStartTime);\n const remainingTime = TIMEOUT_TIME - timePassed;\n // if the remaining time is 0 or less, the session has already timed out.\n if (remainingTime <= 0) {\n // the session has already timed out.\n this._onTimeout();\n return;\n }\n // if there is time remaining, set a new timeout for check again after it\n if (this._sessionTimeout) {\n clearTimeout(this._sessionTimeout);\n }\n this._sessionTimeout = setTimeout(this._checkTimeout, remainingTime);\n return;\n }\n // if there is no currentSessionStartTime then there is no active session,\n // check again in TIMEOUT_TIME in case a new one is started.\n if (this._sessionTimeout) {\n clearTimeout(this._sessionTimeout);\n }\n this._sessionTimeout = setTimeout(this._checkTimeout, TIMEOUT_TIME);\n };\n}\n"],"mappings":";;;;;;;;AASA,IAAa,oCAAb,cAAuDA,uEAAAA,uBAAuB;CAC5E;CAEA,YAAmB,EACjB,MACA,SACyC,EAAE,EAAE;AAC7C,QAAM;GACJ,qBAAqB;GACrB,wBAAwB;GACxB;GACA;GACA,QAAQ,EAAE;GACX,CAAC;AACF,OAAK,kBAAkB;AACvB,MAAI,KAAK,QAAQ,QACf,MAAK,QAAQ;;CAIjB,gBAAuB;AACrB,MAAI,KAAK,gBACP,cAAa,KAAK,gBAAgB;AAEpC,OAAK,kBAAkB;;CAGzB,eAAsB;AACpB,OAAK,eAAe;;CAGtB,mBAAoC;AAClC,OAAK,MAAM,MAAM,mBAAmB;AAEpC,MAAI,KAAK,gBACP,cAAa,KAAK,gBAAgB;AAEpC,OAAK,eAAe,uBAAuB,QAAQ;AACnD,OAAK,eAAe,iBAAiB,EAAE,QAAQ,SAAS,CAAC;AAEzD,OAAK,kBAAkB,WAAW,KAAK,eAAeC,6EAAAA,aAAa;;CAGrE,sBAAuC;EACrC,MAAM,0BAA0B,KAAK,eAAe,qBAAqB;AAEzE,MAAI,yBAAyB;GAG3B,MAAM,gBAAgBA,6EAAAA,eADH,KAAK,KAAK,kBAAkB,wBACA;AAE/C,OAAI,iBAAiB,GAAG;AAEtB,SAAK,YAAY;AACjB;;AAGF,OAAI,KAAK,gBACP,cAAa,KAAK,gBAAgB;AAEpC,QAAK,kBAAkB,WAAW,KAAK,eAAe,cAAc;AACpE;;AAIF,MAAI,KAAK,gBACP,cAAa,KAAK,gBAAgB;AAEpC,OAAK,kBAAkB,WAAW,KAAK,eAAeA,6EAAAA,aAAa"}
@@ -1 +1 @@
1
- {"version":3,"file":"SpanSessionTimeoutInstrumentation.js","names":[],"sources":["../../../../src/instrumentations/session/SpanSessionTimeoutInstrumentation/SpanSessionTimeoutInstrumentation.ts"],"sourcesContent":["import type { TimeoutRef } from '../../../utils/index.ts';\nimport { MXLInstrumentationBase } from '../../MXLInstrumentationBase/index.ts';\nimport { TIMEOUT_TIME } from './constants.ts';\nimport type { SpanSessionTimeoutInstrumentationArgs } from './types.ts';\n\n/**\n * SpanSessionTimeoutInstrumentation will track how long has a session been active and end it after a certain amount of time.\n * It will immediately start a new session after the previous one ends.\n **/\nexport class SpanSessionTimeoutInstrumentation extends MXLInstrumentationBase {\n private _sessionTimeout: TimeoutRef | null;\n\n public constructor({\n diag,\n perf,\n }: SpanSessionTimeoutInstrumentationArgs = {}) {\n super({\n instrumentationName: 'SpanSessionTimeoutInstrumentation',\n instrumentationVersion: '1.0.0',\n diag,\n perf,\n config: {},\n });\n this._sessionTimeout = null;\n if (this._config.enabled) {\n this.enable();\n }\n }\n\n public disable = () => {\n if (this._sessionTimeout) {\n clearTimeout(this._sessionTimeout);\n }\n this._sessionTimeout = null;\n };\n\n public enable = () => {\n this._checkTimeout();\n };\n\n private readonly _onTimeout = () => {\n this._diag.debug('Timeout detected');\n // clear existing timeout\n if (this._sessionTimeout) {\n clearTimeout(this._sessionTimeout);\n }\n this.sessionManager.endSessionSpanInternal('timer');\n this.sessionManager.startSessionSpan({ reason: 'timer' });\n // set a new check in TIMEOUT_TIME for the session we just started\n this._sessionTimeout = setTimeout(this._checkTimeout, TIMEOUT_TIME);\n };\n\n private readonly _checkTimeout = () => {\n const currentSessionStartTime = this.sessionManager.getSessionStartTime();\n // validate that there is an active session, as it may already been finished for other reasons.\n if (currentSessionStartTime) {\n // check how much time has passed since the session started\n const timePassed = this.perf.millisSinceHRTime(currentSessionStartTime);\n const remainingTime = TIMEOUT_TIME - timePassed;\n // if the remaining time is 0 or less, the session has already timed out.\n if (remainingTime <= 0) {\n // the session has already timed out.\n this._onTimeout();\n return;\n }\n // if there is time remaining, set a new timeout for check again after it\n if (this._sessionTimeout) {\n clearTimeout(this._sessionTimeout);\n }\n this._sessionTimeout = setTimeout(this._checkTimeout, remainingTime);\n return;\n }\n // if there is no currentSessionStartTime then there is no active session,\n // check again in TIMEOUT_TIME in case a new one is started.\n if (this._sessionTimeout) {\n clearTimeout(this._sessionTimeout);\n }\n this._sessionTimeout = setTimeout(this._checkTimeout, TIMEOUT_TIME);\n };\n}\n"],"mappings":";;;;;;;AASA,IAAa,oCAAb,cAAuD,uBAAuB;CAC5E;CAEA,YAAmB,EACjB,MACA,SACyC,EAAE,EAAE;AAC7C,QAAM;GACJ,qBAAqB;GACrB,wBAAwB;GACxB;GACA;GACA,QAAQ,EAAE;GACX,CAAC;AACF,OAAK,kBAAkB;AACvB,MAAI,KAAK,QAAQ,QACf,MAAK,QAAQ;;CAIjB,gBAAuB;AACrB,MAAI,KAAK,gBACP,cAAa,KAAK,gBAAgB;AAEpC,OAAK,kBAAkB;;CAGzB,eAAsB;AACpB,OAAK,eAAe;;CAGtB,mBAAoC;AAClC,OAAK,MAAM,MAAM,mBAAmB;AAEpC,MAAI,KAAK,gBACP,cAAa,KAAK,gBAAgB;AAEpC,OAAK,eAAe,uBAAuB,QAAQ;AACnD,OAAK,eAAe,iBAAiB,EAAE,QAAQ,SAAS,CAAC;AAEzD,OAAK,kBAAkB,WAAW,KAAK,eAAe,aAAa;;CAGrE,sBAAuC;EACrC,MAAM,0BAA0B,KAAK,eAAe,qBAAqB;AAEzE,MAAI,yBAAyB;GAG3B,MAAM,gBAAgB,eADH,KAAK,KAAK,kBAAkB,wBACA;AAE/C,OAAI,iBAAiB,GAAG;AAEtB,SAAK,YAAY;AACjB;;AAGF,OAAI,KAAK,gBACP,cAAa,KAAK,gBAAgB;AAEpC,QAAK,kBAAkB,WAAW,KAAK,eAAe,cAAc;AACpE;;AAIF,MAAI,KAAK,gBACP,cAAa,KAAK,gBAAgB;AAEpC,OAAK,kBAAkB,WAAW,KAAK,eAAe,aAAa"}
1
+ {"version":3,"file":"SpanSessionTimeoutInstrumentation.js","names":[],"sources":["../../../../src/instrumentations/session/SpanSessionTimeoutInstrumentation/SpanSessionTimeoutInstrumentation.ts"],"sourcesContent":["import type { TimeoutRef } from '../../../utils';\nimport { MXLInstrumentationBase } from '../../MXLInstrumentationBase';\nimport { TIMEOUT_TIME } from './constants';\nimport type { SpanSessionTimeoutInstrumentationArgs } from './types';\n\n/**\n * SpanSessionTimeoutInstrumentation will track how long has a session been active and end it after a certain amount of time.\n * It will immediately start a new session after the previous one ends.\n **/\nexport class SpanSessionTimeoutInstrumentation extends MXLInstrumentationBase {\n private _sessionTimeout: TimeoutRef | null;\n\n public constructor({\n diag,\n perf,\n }: SpanSessionTimeoutInstrumentationArgs = {}) {\n super({\n instrumentationName: 'SpanSessionTimeoutInstrumentation',\n instrumentationVersion: '1.0.0',\n diag,\n perf,\n config: {},\n });\n this._sessionTimeout = null;\n if (this._config.enabled) {\n this.enable();\n }\n }\n\n public disable = () => {\n if (this._sessionTimeout) {\n clearTimeout(this._sessionTimeout);\n }\n this._sessionTimeout = null;\n };\n\n public enable = () => {\n this._checkTimeout();\n };\n\n private readonly _onTimeout = () => {\n this._diag.debug('Timeout detected');\n // clear existing timeout\n if (this._sessionTimeout) {\n clearTimeout(this._sessionTimeout);\n }\n this.sessionManager.endSessionSpanInternal('timer');\n this.sessionManager.startSessionSpan({ reason: 'timer' });\n // set a new check in TIMEOUT_TIME for the session we just started\n this._sessionTimeout = setTimeout(this._checkTimeout, TIMEOUT_TIME);\n };\n\n private readonly _checkTimeout = () => {\n const currentSessionStartTime = this.sessionManager.getSessionStartTime();\n // validate that there is an active session, as it may already been finished for other reasons.\n if (currentSessionStartTime) {\n // check how much time has passed since the session started\n const timePassed = this.perf.millisSinceHRTime(currentSessionStartTime);\n const remainingTime = TIMEOUT_TIME - timePassed;\n // if the remaining time is 0 or less, the session has already timed out.\n if (remainingTime <= 0) {\n // the session has already timed out.\n this._onTimeout();\n return;\n }\n // if there is time remaining, set a new timeout for check again after it\n if (this._sessionTimeout) {\n clearTimeout(this._sessionTimeout);\n }\n this._sessionTimeout = setTimeout(this._checkTimeout, remainingTime);\n return;\n }\n // if there is no currentSessionStartTime then there is no active session,\n // check again in TIMEOUT_TIME in case a new one is started.\n if (this._sessionTimeout) {\n clearTimeout(this._sessionTimeout);\n }\n this._sessionTimeout = setTimeout(this._checkTimeout, TIMEOUT_TIME);\n };\n}\n"],"mappings":";;;;;;;AASA,IAAa,oCAAb,cAAuD,uBAAuB;CAC5E;CAEA,YAAmB,EACjB,MACA,SACyC,EAAE,EAAE;AAC7C,QAAM;GACJ,qBAAqB;GACrB,wBAAwB;GACxB;GACA;GACA,QAAQ,EAAE;GACX,CAAC;AACF,OAAK,kBAAkB;AACvB,MAAI,KAAK,QAAQ,QACf,MAAK,QAAQ;;CAIjB,gBAAuB;AACrB,MAAI,KAAK,gBACP,cAAa,KAAK,gBAAgB;AAEpC,OAAK,kBAAkB;;CAGzB,eAAsB;AACpB,OAAK,eAAe;;CAGtB,mBAAoC;AAClC,OAAK,MAAM,MAAM,mBAAmB;AAEpC,MAAI,KAAK,gBACP,cAAa,KAAK,gBAAgB;AAEpC,OAAK,eAAe,uBAAuB,QAAQ;AACnD,OAAK,eAAe,iBAAiB,EAAE,QAAQ,SAAS,CAAC;AAEzD,OAAK,kBAAkB,WAAW,KAAK,eAAe,aAAa;;CAGrE,sBAAuC;EACrC,MAAM,0BAA0B,KAAK,eAAe,qBAAqB;AAEzE,MAAI,yBAAyB;GAG3B,MAAM,gBAAgB,eADH,KAAK,KAAK,kBAAkB,wBACA;AAE/C,OAAI,iBAAiB,GAAG;AAEtB,SAAK,YAAY;AACjB;;AAGF,OAAI,KAAK,gBACP,cAAa,KAAK,gBAAgB;AAEpC,QAAK,kBAAkB,WAAW,KAAK,eAAe,cAAc;AACpE;;AAIF,MAAI,KAAK,gBACP,cAAa,KAAK,gBAAgB;AAEpC,OAAK,kBAAkB,WAAW,KAAK,eAAe,aAAa"}
@@ -1 +1 @@
1
- {"version":3,"file":"SpanSessionVisibilityInstrumentation.cjs","names":["MXLInstrumentationBase"],"sources":["../../../../src/instrumentations/session/SpanSessionVisibilityInstrumentation/SpanSessionVisibilityInstrumentation.ts"],"sourcesContent":["import { MXLInstrumentationBase } from '../../MXLInstrumentationBase/index.ts';\nimport type { SpanSessionVisibilityInstrumentationArgs } from './types.ts';\n\nexport class SpanSessionVisibilityInstrumentation extends MXLInstrumentationBase {\n private readonly _onVisibilityChange: () => void;\n\n public constructor({\n diag,\n perf,\n visibilityDoc = window.document,\n }: SpanSessionVisibilityInstrumentationArgs = {}) {\n super({\n instrumentationName: 'SpanSessionVisibilityInstrumentation',\n instrumentationVersion: '1.0.0',\n diag,\n perf,\n config: {},\n });\n\n this._onVisibilityChange = () => {\n this._diag.debug(\n `Visibility change detected: ${visibilityDoc.visibilityState}`,\n );\n\n try {\n this.sessionManager.endSessionSpanInternal('state_changed');\n\n if (visibilityDoc.visibilityState === 'visible') {\n this._diag.debug(\n 'Starting a session since document visibility switched to visible',\n );\n this.sessionManager.startSessionSpan({ reason: 'visible' });\n }\n } catch (error) {\n this._diag.error(\n `Failed to rotate session on visibility change to ${visibilityDoc.visibilityState}`,\n error,\n );\n }\n };\n\n if (this._config.enabled) {\n this.enable();\n }\n }\n\n public disable(): void {\n window.removeEventListener('visibilitychange', this._onVisibilityChange);\n }\n\n public enable(): void {\n window.addEventListener('visibilitychange', this._onVisibilityChange);\n }\n}\n"],"mappings":";;;AAGA,IAAa,uCAAb,cAA0DA,uEAAAA,uBAAuB;CAC/E;CAEA,YAAmB,EACjB,MACA,MACA,gBAAgB,OAAO,aACqB,EAAE,EAAE;AAChD,QAAM;GACJ,qBAAqB;GACrB,wBAAwB;GACxB;GACA;GACA,QAAQ,EAAE;GACX,CAAC;AAEF,OAAK,4BAA4B;AAC/B,QAAK,MAAM,MACT,+BAA+B,cAAc,kBAC9C;AAED,OAAI;AACF,SAAK,eAAe,uBAAuB,gBAAgB;AAE3D,QAAI,cAAc,oBAAoB,WAAW;AAC/C,UAAK,MAAM,MACT,mEACD;AACD,UAAK,eAAe,iBAAiB,EAAE,QAAQ,WAAW,CAAC;;YAEtD,OAAO;AACd,SAAK,MAAM,MACT,oDAAoD,cAAc,mBAClE,MACD;;;AAIL,MAAI,KAAK,QAAQ,QACf,MAAK,QAAQ;;CAIjB,UAAuB;AACrB,SAAO,oBAAoB,oBAAoB,KAAK,oBAAoB;;CAG1E,SAAsB;AACpB,SAAO,iBAAiB,oBAAoB,KAAK,oBAAoB"}
1
+ {"version":3,"file":"SpanSessionVisibilityInstrumentation.cjs","names":["MXLInstrumentationBase"],"sources":["../../../../src/instrumentations/session/SpanSessionVisibilityInstrumentation/SpanSessionVisibilityInstrumentation.ts"],"sourcesContent":["import { MXLInstrumentationBase } from '../../MXLInstrumentationBase';\nimport type { SpanSessionVisibilityInstrumentationArgs } from './types';\n\nexport class SpanSessionVisibilityInstrumentation extends MXLInstrumentationBase {\n private readonly _onVisibilityChange: () => void;\n\n public constructor({\n diag,\n perf,\n visibilityDoc = window.document,\n }: SpanSessionVisibilityInstrumentationArgs = {}) {\n super({\n instrumentationName: 'SpanSessionVisibilityInstrumentation',\n instrumentationVersion: '1.0.0',\n diag,\n perf,\n config: {},\n });\n\n this._onVisibilityChange = () => {\n this._diag.debug(\n `Visibility change detected: ${visibilityDoc.visibilityState}`,\n );\n\n try {\n this.sessionManager.endSessionSpanInternal('state_changed');\n\n if (visibilityDoc.visibilityState === 'visible') {\n this._diag.debug(\n 'Starting a session since document visibility switched to visible',\n );\n this.sessionManager.startSessionSpan({ reason: 'visible' });\n }\n } catch (error) {\n this._diag.error(\n `Failed to rotate session on visibility change to ${visibilityDoc.visibilityState}`,\n error,\n );\n }\n };\n\n if (this._config.enabled) {\n this.enable();\n }\n }\n\n public disable(): void {\n window.removeEventListener('visibilitychange', this._onVisibilityChange);\n }\n\n public enable(): void {\n window.addEventListener('visibilitychange', this._onVisibilityChange);\n }\n}\n"],"mappings":";;;AAGA,IAAa,uCAAb,cAA0DA,uEAAAA,uBAAuB;CAC/E;CAEA,YAAmB,EACjB,MACA,MACA,gBAAgB,OAAO,aACqB,EAAE,EAAE;AAChD,QAAM;GACJ,qBAAqB;GACrB,wBAAwB;GACxB;GACA;GACA,QAAQ,EAAE;GACX,CAAC;AAEF,OAAK,4BAA4B;AAC/B,QAAK,MAAM,MACT,+BAA+B,cAAc,kBAC9C;AAED,OAAI;AACF,SAAK,eAAe,uBAAuB,gBAAgB;AAE3D,QAAI,cAAc,oBAAoB,WAAW;AAC/C,UAAK,MAAM,MACT,mEACD;AACD,UAAK,eAAe,iBAAiB,EAAE,QAAQ,WAAW,CAAC;;YAEtD,OAAO;AACd,SAAK,MAAM,MACT,oDAAoD,cAAc,mBAClE,MACD;;;AAIL,MAAI,KAAK,QAAQ,QACf,MAAK,QAAQ;;CAIjB,UAAuB;AACrB,SAAO,oBAAoB,oBAAoB,KAAK,oBAAoB;;CAG1E,SAAsB;AACpB,SAAO,iBAAiB,oBAAoB,KAAK,oBAAoB"}
@@ -1 +1 @@
1
- {"version":3,"file":"SpanSessionVisibilityInstrumentation.js","names":[],"sources":["../../../../src/instrumentations/session/SpanSessionVisibilityInstrumentation/SpanSessionVisibilityInstrumentation.ts"],"sourcesContent":["import { MXLInstrumentationBase } from '../../MXLInstrumentationBase/index.ts';\nimport type { SpanSessionVisibilityInstrumentationArgs } from './types.ts';\n\nexport class SpanSessionVisibilityInstrumentation extends MXLInstrumentationBase {\n private readonly _onVisibilityChange: () => void;\n\n public constructor({\n diag,\n perf,\n visibilityDoc = window.document,\n }: SpanSessionVisibilityInstrumentationArgs = {}) {\n super({\n instrumentationName: 'SpanSessionVisibilityInstrumentation',\n instrumentationVersion: '1.0.0',\n diag,\n perf,\n config: {},\n });\n\n this._onVisibilityChange = () => {\n this._diag.debug(\n `Visibility change detected: ${visibilityDoc.visibilityState}`,\n );\n\n try {\n this.sessionManager.endSessionSpanInternal('state_changed');\n\n if (visibilityDoc.visibilityState === 'visible') {\n this._diag.debug(\n 'Starting a session since document visibility switched to visible',\n );\n this.sessionManager.startSessionSpan({ reason: 'visible' });\n }\n } catch (error) {\n this._diag.error(\n `Failed to rotate session on visibility change to ${visibilityDoc.visibilityState}`,\n error,\n );\n }\n };\n\n if (this._config.enabled) {\n this.enable();\n }\n }\n\n public disable(): void {\n window.removeEventListener('visibilitychange', this._onVisibilityChange);\n }\n\n public enable(): void {\n window.addEventListener('visibilitychange', this._onVisibilityChange);\n }\n}\n"],"mappings":";;AAGA,IAAa,uCAAb,cAA0D,uBAAuB;CAC/E;CAEA,YAAmB,EACjB,MACA,MACA,gBAAgB,OAAO,aACqB,EAAE,EAAE;AAChD,QAAM;GACJ,qBAAqB;GACrB,wBAAwB;GACxB;GACA;GACA,QAAQ,EAAE;GACX,CAAC;AAEF,OAAK,4BAA4B;AAC/B,QAAK,MAAM,MACT,+BAA+B,cAAc,kBAC9C;AAED,OAAI;AACF,SAAK,eAAe,uBAAuB,gBAAgB;AAE3D,QAAI,cAAc,oBAAoB,WAAW;AAC/C,UAAK,MAAM,MACT,mEACD;AACD,UAAK,eAAe,iBAAiB,EAAE,QAAQ,WAAW,CAAC;;YAEtD,OAAO;AACd,SAAK,MAAM,MACT,oDAAoD,cAAc,mBAClE,MACD;;;AAIL,MAAI,KAAK,QAAQ,QACf,MAAK,QAAQ;;CAIjB,UAAuB;AACrB,SAAO,oBAAoB,oBAAoB,KAAK,oBAAoB;;CAG1E,SAAsB;AACpB,SAAO,iBAAiB,oBAAoB,KAAK,oBAAoB"}
1
+ {"version":3,"file":"SpanSessionVisibilityInstrumentation.js","names":[],"sources":["../../../../src/instrumentations/session/SpanSessionVisibilityInstrumentation/SpanSessionVisibilityInstrumentation.ts"],"sourcesContent":["import { MXLInstrumentationBase } from '../../MXLInstrumentationBase';\nimport type { SpanSessionVisibilityInstrumentationArgs } from './types';\n\nexport class SpanSessionVisibilityInstrumentation extends MXLInstrumentationBase {\n private readonly _onVisibilityChange: () => void;\n\n public constructor({\n diag,\n perf,\n visibilityDoc = window.document,\n }: SpanSessionVisibilityInstrumentationArgs = {}) {\n super({\n instrumentationName: 'SpanSessionVisibilityInstrumentation',\n instrumentationVersion: '1.0.0',\n diag,\n perf,\n config: {},\n });\n\n this._onVisibilityChange = () => {\n this._diag.debug(\n `Visibility change detected: ${visibilityDoc.visibilityState}`,\n );\n\n try {\n this.sessionManager.endSessionSpanInternal('state_changed');\n\n if (visibilityDoc.visibilityState === 'visible') {\n this._diag.debug(\n 'Starting a session since document visibility switched to visible',\n );\n this.sessionManager.startSessionSpan({ reason: 'visible' });\n }\n } catch (error) {\n this._diag.error(\n `Failed to rotate session on visibility change to ${visibilityDoc.visibilityState}`,\n error,\n );\n }\n };\n\n if (this._config.enabled) {\n this.enable();\n }\n }\n\n public disable(): void {\n window.removeEventListener('visibilitychange', this._onVisibilityChange);\n }\n\n public enable(): void {\n window.addEventListener('visibilitychange', this._onVisibilityChange);\n }\n}\n"],"mappings":";;AAGA,IAAa,uCAAb,cAA0D,uBAAuB;CAC/E;CAEA,YAAmB,EACjB,MACA,MACA,gBAAgB,OAAO,aACqB,EAAE,EAAE;AAChD,QAAM;GACJ,qBAAqB;GACrB,wBAAwB;GACxB;GACA;GACA,QAAQ,EAAE;GACX,CAAC;AAEF,OAAK,4BAA4B;AAC/B,QAAK,MAAM,MACT,+BAA+B,cAAc,kBAC9C;AAED,OAAI;AACF,SAAK,eAAe,uBAAuB,gBAAgB;AAE3D,QAAI,cAAc,oBAAoB,WAAW;AAC/C,UAAK,MAAM,MACT,mEACD;AACD,UAAK,eAAe,iBAAiB,EAAE,QAAQ,WAAW,CAAC;;YAEtD,OAAO;AACd,SAAK,MAAM,MACT,oDAAoD,cAAc,mBAClE,MACD;;;AAIL,MAAI,KAAK,QAAQ,QACf,MAAK,QAAQ;;CAIjB,UAAuB;AACrB,SAAO,oBAAoB,oBAAoB,KAAK,oBAAoB;;CAG1E,SAAsB;AACpB,SAAO,iBAAiB,oBAAoB,KAAK,oBAAoB"}
@@ -1 +1 @@
1
- {"version":3,"file":"UserTimingInstrumentation.cjs","names":["MXLInstrumentationBase","createPerformanceObserver","KEY_MXL_TYPE","KEY_MXL_INSTRUMENTATION","KEY_MXL_USER_TIMING_ENTRY_TYPE","KEY_MXL_USER_TIMING_START_TIME","KEY_MXL_USER_TIMING_DURATION","USER_TIMING_EVENT_NAME","SeverityNumber","KEY_MXL_USER_TIMING_NAME"],"sources":["../../../../src/instrumentations/user-timing/UserTimingInstrumentation/UserTimingInstrumentation.ts"],"sourcesContent":["import { SeverityNumber } from '@opentelemetry/api-logs';\nimport { MXL_PERFORMANCE_INSTRUMENTATIONS } from '../../../constants/attributes.ts';\nimport {\n MXL_TYPES,\n KEY_MXL_INSTRUMENTATION,\n KEY_MXL_TYPE,\n} from '../../../constants/index.ts';\nimport { createPerformanceObserver } from '../../../utils/index.ts';\nimport { MXLInstrumentationBase } from '../../MXLInstrumentationBase/index.ts';\nimport {\n KEY_MXL_USER_TIMING_DETAIL,\n KEY_MXL_USER_TIMING_DURATION,\n KEY_MXL_USER_TIMING_ENTRY_TYPE,\n KEY_MXL_USER_TIMING_NAME,\n KEY_MXL_USER_TIMING_START_TIME,\n USER_TIMING_EVENT_NAME,\n} from './constants.ts';\nimport type {\n UserTimingEntryFilter,\n UserTimingInstrumentationArgs,\n} from './types.ts';\n\nexport class UserTimingInstrumentation extends MXLInstrumentationBase {\n private _markObserver: PerformanceObserver | null = null;\n private _measureObserver: PerformanceObserver | null = null;\n private _seenEntries: Set<string> = new Set();\n private _isEnabled = false;\n private readonly _allowedEntries: UserTimingEntryFilter | undefined;\n\n public constructor({\n diag,\n perf,\n limitManager,\n allowedEntries,\n }: UserTimingInstrumentationArgs = {}) {\n super({\n instrumentationName: 'UserTimingInstrumentation',\n instrumentationVersion: '1.0.0',\n diag,\n perf,\n limitManager,\n config: {},\n });\n this._allowedEntries = allowedEntries;\n\n if (this._config.enabled) {\n this.enable();\n }\n }\n\n public enable(): void {\n if (this._isEnabled) {\n return;\n }\n\n this._isEnabled = true;\n this._seenEntries = new Set();\n\n if (this._markObserver) {\n this._markObserver.disconnect();\n }\n if (this._measureObserver) {\n this._measureObserver.disconnect();\n }\n\n this._markObserver = createPerformanceObserver<PerformanceMark>(\n 'mark',\n this._processEntry.bind(this),\n { diag: this._diag },\n );\n\n if (!this._markObserver) {\n this._diag.error('failed to enable mark observer');\n }\n\n this._measureObserver = createPerformanceObserver<PerformanceMeasure>(\n 'measure',\n (entry) => this._processEntry(entry),\n { diag: this._diag },\n );\n\n if (!this._measureObserver) {\n this._diag.error('failed to enable measure observer');\n }\n\n if (!this._markObserver && !this._measureObserver) {\n this._isEnabled = false;\n }\n }\n\n public disable(): void {\n this._isEnabled = false;\n\n if (this._markObserver) {\n this._markObserver.disconnect();\n this._markObserver = null;\n }\n\n if (this._measureObserver) {\n this._measureObserver.disconnect();\n this._measureObserver = null;\n }\n\n this._seenEntries = new Set();\n }\n\n private _processEntry(entry: PerformanceMark | PerformanceMeasure): void {\n if (!this._isEnabled) {\n return;\n }\n\n if (this._allowedEntries !== undefined) {\n const allowed = Array.isArray(this._allowedEntries)\n ? this._allowedEntries.includes(entry.name)\n : this._allowedEntries(entry);\n if (!allowed) {\n return;\n }\n }\n\n const key = `${location.href}::${entry.name}`;\n // De-duplicate entries by name and page URL, only processing the first occurrence of each unique name on each page URL\n if (this._seenEntries.has(key)) {\n return;\n }\n this._seenEntries.add(key);\n\n if (\n this.limitManager?.limitUserTimingEntry(\n entry.entryType as 'mark' | 'measure',\n )\n ) {\n return;\n }\n\n if (entry.entryType === 'measure') {\n const measureDetail = (entry as PerformanceMeasure).detail;\n const span = this.tracer.startSpan(entry.name, {\n startTime: this.perf.epochMillisFromOriginOffset(entry.startTime),\n attributes: {\n [KEY_MXL_TYPE]: MXL_TYPES.UserTiming,\n [KEY_MXL_INSTRUMENTATION]:\n MXL_PERFORMANCE_INSTRUMENTATIONS.UserTiming,\n [KEY_MXL_USER_TIMING_ENTRY_TYPE]: entry.entryType,\n [KEY_MXL_USER_TIMING_START_TIME]: this.perf.millisFromZeroTime(\n entry.startTime,\n ),\n [KEY_MXL_USER_TIMING_DURATION]: entry.duration,\n ...(measureDetail != null && {\n [KEY_MXL_USER_TIMING_DETAIL]: JSON.stringify(measureDetail),\n }),\n },\n });\n span.end(\n this.perf.epochMillisFromOriginOffset(entry.startTime + entry.duration),\n );\n return;\n }\n\n const detail = (entry as PerformanceMark).detail;\n const body = detail != null ? JSON.stringify(detail) : undefined;\n\n this.logger.emit({\n timestamp: this.perf.epochMillisFromOriginOffset(entry.startTime),\n eventName: USER_TIMING_EVENT_NAME,\n severityNumber: SeverityNumber.INFO,\n attributes: {\n [KEY_MXL_TYPE]: MXL_TYPES.UserTiming,\n [KEY_MXL_USER_TIMING_NAME]: entry.name,\n [KEY_MXL_USER_TIMING_START_TIME]: this.perf.millisFromZeroTime(\n entry.startTime,\n ),\n [KEY_MXL_USER_TIMING_DURATION]: entry.duration,\n [KEY_MXL_USER_TIMING_ENTRY_TYPE]: entry.entryType,\n },\n body,\n });\n }\n}\n"],"mappings":";;;;;;;;AAsBA,IAAa,4BAAb,cAA+CA,uEAAAA,uBAAuB;CACpE,gBAAoD;CACpD,mBAAuD;CACvD,+BAAoC,IAAI,KAAK;CAC7C,aAAqB;CACrB;CAEA,YAAmB,EACjB,MACA,MACA,cACA,mBACiC,EAAE,EAAE;AACrC,QAAM;GACJ,qBAAqB;GACrB,wBAAwB;GACxB;GACA;GACA;GACA,QAAQ,EAAE;GACX,CAAC;AACF,OAAK,kBAAkB;AAEvB,MAAI,KAAK,QAAQ,QACf,MAAK,QAAQ;;CAIjB,SAAsB;AACpB,MAAI,KAAK,WACP;AAGF,OAAK,aAAa;AAClB,OAAK,+BAAe,IAAI,KAAK;AAE7B,MAAI,KAAK,cACP,MAAK,cAAc,YAAY;AAEjC,MAAI,KAAK,iBACP,MAAK,iBAAiB,YAAY;AAGp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MAAM,UACP;MACAC,yEAAAA,+BAA+B,MAAM;KACtC,GAAI,iBAAiB,QAAQ,GAAA,2BACG,KAAK,UAAU,cAAc,EAC5D;KACF;IACF,CACG,CAAC,IACH,KAAK,KAAK,4BAA4B,MAAM,YAAY,MAAM,SAAS,CACxE;AACD;;EAGF,MAAM,SAAU,MAA0B;EAC1C,MAAM,OAAO,UAAU,OAAO,KAAK,UAAU,OAAO,GAAG,KAAA;AAEvD,OAAK,OAAO,KAAK;GACf,WAAW,KAAK,KAAK,4BAA4B,MAAM,UAAU;GACjE,WAAWC,yEAAAA;GACX,gBAAgBC,wBAAAA,eAAe;GAC/B,YAAY;KACTN,6BAAAA,eAAAA;KACAO,yEAAAA,2BAA2B,MAAM;KACjCJ,yEAAAA,iCAAiC,KAAK,KAAK,mBAC1C,MAAM,UACP;KACAC,yEAAAA,+BAA+B,MAAM;KACrCF,yEAAAA,iCAAiC,MAAM;IACzC;GACD;GACD,CAAC"}
1
+ {"version":3,"file":"UserTimingInstrumentation.cjs","names":["MXLInstrumentationBase","createPerformanceObserver","KEY_MXL_TYPE","KEY_MXL_INSTRUMENTATION","KEY_MXL_USER_TIMING_ENTRY_TYPE","KEY_MXL_USER_TIMING_START_TIME","KEY_MXL_USER_TIMING_DURATION","USER_TIMING_EVENT_NAME","SeverityNumber","KEY_MXL_USER_TIMING_NAME"],"sources":["../../../../src/instrumentations/user-timing/UserTimingInstrumentation/UserTimingInstrumentation.ts"],"sourcesContent":["import { SeverityNumber } from '@opentelemetry/api-logs';\nimport {\n KEY_MXL_INSTRUMENTATION,\n KEY_MXL_TYPE,\n MXL_TYPES,\n} from '../../../constants';\nimport { MXL_PERFORMANCE_INSTRUMENTATIONS } from '../../../constants/attributes';\nimport { createPerformanceObserver } from '../../../utils';\nimport { MXLInstrumentationBase } from '../../MXLInstrumentationBase';\nimport {\n KEY_MXL_USER_TIMING_DETAIL,\n KEY_MXL_USER_TIMING_DURATION,\n KEY_MXL_USER_TIMING_ENTRY_TYPE,\n KEY_MXL_USER_TIMING_NAME,\n KEY_MXL_USER_TIMING_START_TIME,\n USER_TIMING_EVENT_NAME,\n} from './constants';\nimport type {\n UserTimingEntryFilter,\n UserTimingInstrumentationArgs,\n} from './types';\n\nexport class UserTimingInstrumentation extends MXLInstrumentationBase {\n private _markObserver: PerformanceObserver | null = null;\n private _measureObserver: PerformanceObserver | null = null;\n private _seenEntries: Set<string> = new Set();\n private _isEnabled = false;\n private readonly _allowedEntries: UserTimingEntryFilter | undefined;\n\n public constructor({\n diag,\n perf,\n limitManager,\n allowedEntries,\n }: UserTimingInstrumentationArgs = {}) {\n super({\n instrumentationName: 'UserTimingInstrumentation',\n instrumentationVersion: '1.0.0',\n diag,\n perf,\n limitManager,\n config: {},\n });\n this._allowedEntries = allowedEntries;\n\n if (this._config.enabled) {\n this.enable();\n }\n }\n\n public enable(): void {\n if (this._isEnabled) {\n return;\n }\n\n this._isEnabled = true;\n this._seenEntries = new Set();\n\n if (this._markObserver) {\n this._markObserver.disconnect();\n }\n if (this._measureObserver) {\n this._measureObserver.disconnect();\n }\n\n this._markObserver = createPerformanceObserver<PerformanceMark>(\n 'mark',\n this._processEntry.bind(this),\n { diag: this._diag },\n );\n\n if (!this._markObserver) {\n this._diag.error('failed to enable mark observer');\n }\n\n this._measureObserver = createPerformanceObserver<PerformanceMeasure>(\n 'measure',\n (entry) => this._processEntry(entry),\n { diag: this._diag },\n );\n\n if (!this._measureObserver) {\n this._diag.error('failed to enable measure observer');\n }\n\n if (!this._markObserver && !this._measureObserver) {\n this._isEnabled = false;\n }\n }\n\n public disable(): void {\n this._isEnabled = false;\n\n if (this._markObserver) {\n this._markObserver.disconnect();\n this._markObserver = null;\n }\n\n if (this._measureObserver) {\n this._measureObserver.disconnect();\n this._measureObserver = null;\n }\n\n this._seenEntries = new Set();\n }\n\n private _processEntry(entry: PerformanceMark | PerformanceMeasure): void {\n if (!this._isEnabled) {\n return;\n }\n\n if (this._allowedEntries !== undefined) {\n const allowed = Array.isArray(this._allowedEntries)\n ? this._allowedEntries.includes(entry.name)\n : this._allowedEntries(entry);\n if (!allowed) {\n return;\n }\n }\n\n const key = `${location.href}::${entry.name}`;\n // De-duplicate entries by name and page URL, only processing the first occurrence of each unique name on each page URL\n if (this._seenEntries.has(key)) {\n return;\n }\n this._seenEntries.add(key);\n\n if (\n this.limitManager?.limitUserTimingEntry(\n entry.entryType as 'mark' | 'measure',\n )\n ) {\n return;\n }\n\n if (entry.entryType === 'measure') {\n const measureDetail = (entry as PerformanceMeasure).detail;\n const span = this.tracer.startSpan(entry.name, {\n startTime: this.perf.epochMillisFromOriginOffset(entry.startTime),\n attributes: {\n [KEY_MXL_TYPE]: MXL_TYPES.UserTiming,\n [KEY_MXL_INSTRUMENTATION]:\n MXL_PERFORMANCE_INSTRUMENTATIONS.UserTiming,\n [KEY_MXL_USER_TIMING_ENTRY_TYPE]: entry.entryType,\n [KEY_MXL_USER_TIMING_START_TIME]: this.perf.millisFromZeroTime(\n entry.startTime,\n ),\n [KEY_MXL_USER_TIMING_DURATION]: entry.duration,\n ...(measureDetail != null && {\n [KEY_MXL_USER_TIMING_DETAIL]: JSON.stringify(measureDetail),\n }),\n },\n });\n span.end(\n this.perf.epochMillisFromOriginOffset(entry.startTime + entry.duration),\n );\n return;\n }\n\n const detail = (entry as PerformanceMark).detail;\n const body = detail != null ? JSON.stringify(detail) : undefined;\n\n this.logger.emit({\n timestamp: this.perf.epochMillisFromOriginOffset(entry.startTime),\n eventName: USER_TIMING_EVENT_NAME,\n severityNumber: SeverityNumber.INFO,\n attributes: {\n [KEY_MXL_TYPE]: MXL_TYPES.UserTiming,\n [KEY_MXL_USER_TIMING_NAME]: entry.name,\n [KEY_MXL_USER_TIMING_START_TIME]: this.perf.millisFromZeroTime(\n entry.startTime,\n ),\n [KEY_MXL_USER_TIMING_DURATION]: entry.duration,\n [KEY_MXL_USER_TIMING_ENTRY_TYPE]: entry.entryType,\n },\n body,\n });\n }\n}\n"],"mappings":";;;;;;;;AAsB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AgB,SAAS,MAAM,KAAK,GACzC,KAAK,gBAAgB,MAAM,EAE7B;;EAIJ,MAAM,MAAM,GAAG,SAAS,KAAK,IAAI,MAAM;AAEvC,MAAI,KAAK,aAAa,IAAI,IAAI,CAC5B;AAEF,OAAK,aAAa,IAAI,IAAI;AAE1B,MACE,KAAK,cAAc,qBACjB,MAAM,UACP,CAED;AAGF,MAAI,MAAM,cAAc,WAAW;GACjC,MAAM,gBAAiB,MAA6B;AACvC,QAAK,OAAO,UAAU,MAAM,MAAM;IAC7C,WAAW,KAAK,KAAK,4BAA4B,MAAM,UAAU;IACjE,YAAY;MACTC,6BAAAA,eAAAA;MACAC,6BAAAA,0BAAAA;MAEAC,yEAAAA,iCAAiC,MAAM;MACvCC,yEAAAA,iCAAiC,KAAK,KAAK,mBAC1C,MAAM,UACP;MACAC,yEAAAA,+BAA+B,MAAM;KACtC,GAAI,iBAAiB,QAAQ,GAAA,2BACG,KAAK,UAAU,cAAc,EAC5D;KACF;IACF,CACG,CAAC,IACH,KAAK,KAAK,4BAA4B,MAAM,YAAY,MAAM,SAAS,CACxE;AACD;;EAGF,MAAM,SAAU,MAA0B;EAC1C,MAAM,OAAO,UAAU,OAAO,KAAK,UAAU,OAAO,GAAG,KAAA;AAEvD,OAAK,OAAO,KAAK;GACf,WAAW,KAAK,KAAK,4BAA4B,MAAM,UAAU;GACjE,WAAWC,yEAAAA;GACX,gBAAgBC,wBAAAA,eAAe;GAC/B,YAAY;KACTN,6BAAAA,eAAAA;KACAO,yEAAAA,2BAA2B,MAAM;KACjCJ,yEAAAA,iCAAiC,KAAK,KAAK,mBAC1C,MAAM,UACP;KACAC,yEAAAA,+BAA+B,MAAM;KACrCF,yEAAAA,iCAAiC,MAAM;IACzC;GACD;GACD,CAAC"}
@@ -1 +1 @@
1
- {"version":3,"file":"UserTimingInstrumentation.js","names":[],"sources":["../../../../src/instrumentations/user-timing/UserTimingInstrumentation/UserTimingInstrumentation.ts"],"sourcesContent":["import { SeverityNumber } from '@opentelemetry/api-logs';\nimport { MXL_PERFORMANCE_INSTRUMENTATIONS } from '../../../constants/attributes.ts';\nimport {\n MXL_TYPES,\n KEY_MXL_INSTRUMENTATION,\n KEY_MXL_TYPE,\n} from '../../../constants/index.ts';\nimport { createPerformanceObserver } from '../../../utils/index.ts';\nimport { MXLInstrumentationBase } from '../../MXLInstrumentationBase/index.ts';\nimport {\n KEY_MXL_USER_TIMING_DETAIL,\n KEY_MXL_USER_TIMING_DURATION,\n KEY_MXL_USER_TIMING_ENTRY_TYPE,\n KEY_MXL_USER_TIMING_NAME,\n KEY_MXL_USER_TIMING_START_TIME,\n USER_TIMING_EVENT_NAME,\n} from './constants.ts';\nimport type {\n UserTimingEntryFilter,\n UserTimingInstrumentationArgs,\n} from './types.ts';\n\nexport class UserTimingInstrumentation extends MXLInstrumentationBase {\n private _markObserver: PerformanceObserver | null = null;\n private _measureObserver: PerformanceObserver | null = null;\n private _seenEntries: Set<string> = new Set();\n private _isEnabled = false;\n private readonly _allowedEntries: UserTimingEntryFilter | undefined;\n\n public constructor({\n diag,\n perf,\n limitManager,\n allowedEntries,\n }: UserTimingInstrumentationArgs = {}) {\n super({\n instrumentationName: 'UserTimingInstrumentation',\n instrumentationVersion: '1.0.0',\n diag,\n perf,\n limitManager,\n config: {},\n });\n this._allowedEntries = allowedEntries;\n\n if (this._config.enabled) {\n this.enable();\n }\n }\n\n public enable(): void {\n if (this._isEnabled) {\n return;\n }\n\n this._isEnabled = true;\n this._seenEntries = new Set();\n\n if (this._markObserver) {\n this._markObserver.disconnect();\n }\n if (this._measureObserver) {\n this._measureObserver.disconnect();\n }\n\n this._markObserver = createPerformanceObserver<PerformanceMark>(\n 'mark',\n this._processEntry.bind(this),\n { diag: this._diag },\n );\n\n if (!this._markObserver) {\n this._diag.error('failed to enable mark observer');\n }\n\n this._measureObserver = createPerformanceObserver<PerformanceMeasure>(\n 'measure',\n (entry) => this._processEntry(entry),\n { diag: this._diag },\n );\n\n if (!this._measureObserver) {\n this._diag.error('failed to enable measure observer');\n }\n\n if (!this._markObserver && !this._measureObserver) {\n this._isEnabled = false;\n }\n }\n\n public disable(): void {\n this._isEnabled = false;\n\n if (this._markObserver) {\n this._markObserver.disconnect();\n this._markObserver = null;\n }\n\n if (this._measureObserver) {\n this._measureObserver.disconnect();\n this._measureObserver = null;\n }\n\n this._seenEntries = new Set();\n }\n\n private _processEntry(entry: PerformanceMark | PerformanceMeasure): void {\n if (!this._isEnabled) {\n return;\n }\n\n if (this._allowedEntries !== undefined) {\n const allowed = Array.isArray(this._allowedEntries)\n ? this._allowedEntries.includes(entry.name)\n : this._allowedEntries(entry);\n if (!allowed) {\n return;\n }\n }\n\n const key = `${location.href}::${entry.name}`;\n // De-duplicate entries by name and page URL, only processing the first occurrence of each unique name on each page URL\n if (this._seenEntries.has(key)) {\n return;\n }\n this._seenEntries.add(key);\n\n if (\n this.limitManager?.limitUserTimingEntry(\n entry.entryType as 'mark' | 'measure',\n )\n ) {\n return;\n }\n\n if (entry.entryType === 'measure') {\n const measureDetail = (entry as PerformanceMeasure).detail;\n const span = this.tracer.startSpan(entry.name, {\n startTime: this.perf.epochMillisFromOriginOffset(entry.startTime),\n attributes: {\n [KEY_MXL_TYPE]: MXL_TYPES.UserTiming,\n [KEY_MXL_INSTRUMENTATION]:\n MXL_PERFORMANCE_INSTRUMENTATIONS.UserTiming,\n [KEY_MXL_USER_TIMING_ENTRY_TYPE]: entry.entryType,\n [KEY_MXL_USER_TIMING_START_TIME]: this.perf.millisFromZeroTime(\n entry.startTime,\n ),\n [KEY_MXL_USER_TIMING_DURATION]: entry.duration,\n ...(measureDetail != null && {\n [KEY_MXL_USER_TIMING_DETAIL]: JSON.stringify(measureDetail),\n }),\n },\n });\n span.end(\n this.perf.epochMillisFromOriginOffset(entry.startTime + entry.duration),\n );\n return;\n }\n\n const detail = (entry as PerformanceMark).detail;\n const body = detail != null ? JSON.stringify(detail) : undefined;\n\n this.logger.emit({\n timestamp: this.perf.epochMillisFromOriginOffset(entry.startTime),\n eventName: USER_TIMING_EVENT_NAME,\n severityNumber: SeverityNumber.INFO,\n attributes: {\n [KEY_MXL_TYPE]: MXL_TYPES.UserTiming,\n [KEY_MXL_USER_TIMING_NAME]: entry.name,\n [KEY_MXL_USER_TIMING_START_TIME]: this.perf.millisFromZeroTime(\n entry.startTime,\n ),\n [KEY_MXL_USER_TIMING_DURATION]: entry.duration,\n [KEY_MXL_USER_TIMING_ENTRY_TYPE]: entry.entryType,\n },\n body,\n });\n }\n}\n"],"mappings":";;;;;;AAsBA,IAAa,4BAAb,cAA+C,uBAAuB;CACpE,gBAAoD;CACpD,mBAAuD;CACvD,+BAAoC,IAAI,KAAK;CAC7C,aAAqB;CACrB;CAEA,YAAmB,EACjB,MACA,MACA,cACA,mBACiC,EAAE,EAAE;AACrC,QAAM;GACJ,qBAAqB;GACrB,wBAAwB;GACxB;GACA;GACA;GACA,QAAQ,EAAE;GACX,CAAC;AACF,OAAK,kBAAkB;AAEvB,MAAI,KAAK,QAAQ,QACf,MAAK,QAAQ;;CAIjB,SAAsB;AACpB,MAAI,KAAK,WACP;AAGF,OAAK,aAAa;AAClB,OAAK,+BAAe,IAAI,KAAK;AAE7B,MAAI,KAAK,cACP,MAAK,cAAc,YAAY;AAEjC,MAAI,KAAK,iBACP,MAAK,iBAAiB,YAAY;AAGpC,OAAK,gBAAgB,0BACnB,QACA,KAAK,cAAc,KAAK,KAAK,EAC7B,EAAE,MAAM,KAAK,OAAO,CACrB;AAED,MAAI,CAAC,KAAK,cACR,MAAK,MAAM,MAAM,iCAAiC;AAGpD,OAAK,mBAAmB,0BACtB,YACC,UAAU,KAAK,cAAc,MAAM,EACpC,EAAE,MAAM,KAAK,OAAO,CACrB;AAED,MAAI,CAAC,KAAK,iBACR,MAAK,MAAM,MAAM,oCAAoC;AAGvD,MAAI,CAAC,KAAK,iBAAiB,CAAC,KAAK,iBAC/B,MAAK,aAAa;;CAItB,UAAuB;AACrB,OAAK,aAAa;AAElB,MAAI,KAAK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M;KACrC,iCAAiC,MAAM;IACzC;GACD;GACD,CAAC"}
1
+ {"version":3,"file":"UserTimingInstrumentation.js","names":[],"sources":["../../../../src/instrumentations/user-timing/UserTimingInstrumentation/UserTimingInstrumentation.ts"],"sourcesContent":["import { SeverityNumber } from '@opentelemetry/api-logs';\nimport {\n KEY_MXL_INSTRUMENTATION,\n KEY_MXL_TYPE,\n MXL_TYPES,\n} from '../../../constants';\nimport { MXL_PERFORMANCE_INSTRUMENTATIONS } from '../../../constants/attributes';\nimport { createPerformanceObserver } from '../../../utils';\nimport { MXLInstrumentationBase } from '../../MXLInstrumentationBase';\nimport {\n KEY_MXL_USER_TIMING_DETAIL,\n KEY_MXL_USER_TIMING_DURATION,\n KEY_MXL_USER_TIMING_ENTRY_TYPE,\n KEY_MXL_USER_TIMING_NAME,\n KEY_MXL_USER_TIMING_START_TIME,\n USER_TIMING_EVENT_NAME,\n} from './constants';\nimport type {\n UserTimingEntryFilter,\n UserTimingInstrumentationArgs,\n} from './types';\n\nexport class UserTimingInstrumentation extends MXLInstrumentationBase {\n private _markObserver: PerformanceObserver | null = null;\n private _measureObserver: PerformanceObserver | null = null;\n private _seenEntries: Set<string> = new Set();\n private _isEnabled = false;\n private readonly _allowedEntries: UserTimingEntryFilter | undefined;\n\n public constructor({\n diag,\n perf,\n limitManager,\n allowedEntries,\n }: UserTimingInstrumentationArgs = {}) {\n super({\n instrumentationName: 'UserTimingInstrumentation',\n instrumentationVersion: '1.0.0',\n diag,\n perf,\n limitManager,\n config: {},\n });\n this._allowedEntries = allowedEntries;\n\n if (this._config.enabled) {\n this.enable();\n }\n }\n\n public enable(): void {\n if (this._isEnabled) {\n return;\n }\n\n this._isEnabled = true;\n this._seenEntries = new Set();\n\n if (this._markObserver) {\n this._markObserver.disconnect();\n }\n if (this._measureObserver) {\n this._measureObserver.disconnect();\n }\n\n this._markObserver = createPerformanceObserver<PerformanceMark>(\n 'mark',\n this._processEntry.bind(this),\n { diag: this._diag },\n );\n\n if (!this._markObserver) {\n this._diag.error('failed to enable mark observer');\n }\n\n this._measureObserver = createPerformanceObserver<PerformanceMeasure>(\n 'measure',\n (entry) => this._processEntry(entry),\n { diag: this._diag },\n );\n\n if (!this._measureObserver) {\n this._diag.error('failed to enable measure observer');\n }\n\n if (!this._markObserver && !this._measureObserver) {\n this._isEnabled = false;\n }\n }\n\n public disable(): void {\n this._isEnabled = false;\n\n if (this._markObserver) {\n this._markObserver.disconnect();\n this._markObserver = null;\n }\n\n if (this._measureObserver) {\n this._measureObserver.disconnect();\n this._measureObserver = null;\n }\n\n this._seenEntries = new Set();\n }\n\n private _processEntry(entry: PerformanceMark | PerformanceMeasure): void {\n if (!this._isEnabled) {\n return;\n }\n\n if (this._allowedEntries !== undefined) {\n const allowed = Array.isArray(this._allowedEntries)\n ? this._allowedEntries.includes(entry.name)\n : this._allowedEntries(entry);\n if (!allowed) {\n return;\n }\n }\n\n const key = `${location.href}::${entry.name}`;\n // De-duplicate entries by name and page URL, only processing the first occurrence of each unique name on each page URL\n if (this._seenEntries.has(key)) {\n return;\n }\n this._seenEntries.add(key);\n\n if (\n this.limitManager?.limitUserTimingEntry(\n entry.entryType as 'mark' | 'measure',\n )\n ) {\n return;\n }\n\n if (entry.entryType === 'measure') {\n const measureDetail = (entry as PerformanceMeasure).detail;\n const span = this.tracer.startSpan(entry.name, {\n startTime: this.perf.epochMillisFromOriginOffset(entry.startTime),\n attributes: {\n [KEY_MXL_TYPE]: MXL_TYPES.UserTiming,\n [KEY_MXL_INSTRUMENTATION]:\n MXL_PERFORMANCE_INSTRUMENTATIONS.UserTiming,\n [KEY_MXL_USER_TIMING_ENTRY_TYPE]: entry.entryType,\n [KEY_MXL_USER_TIMING_START_TIME]: this.perf.millisFromZeroTime(\n entry.startTime,\n ),\n [KEY_MXL_USER_TIMING_DURATION]: entry.duration,\n ...(measureDetail != null && {\n [KEY_MXL_USER_TIMING_DETAIL]: JSON.stringify(measureDetail),\n }),\n },\n });\n span.end(\n this.perf.epochMillisFromOriginOffset(entry.startTime + entry.duration),\n );\n return;\n }\n\n const detail = (entry as PerformanceMark).detail;\n const body = detail != null ? JSON.stringify(detail) : undefined;\n\n this.logger.emit({\n timestamp: this.perf.epochMillisFromOriginOffset(entry.startTime),\n eventName: USER_TIMING_EVENT_NAME,\n severityNumber: SeverityNumber.INFO,\n attributes: {\n [KEY_MXL_TYPE]: MXL_TYPES.UserTiming,\n [KEY_MXL_USER_TIMING_NAME]: entry.name,\n [KEY_MXL_USER_TIMING_START_TIME]: this.perf.millisFromZeroTime(\n entry.startTime,\n ),\n [KEY_MXL_USER_TIMING_DURATION]: entry.duration,\n [KEY_MXL_USER_TIMING_ENTRY_TYPE]: entry.entryType,\n },\n body,\n });\n }\n}\n"],"mappings":";;;;;;AAsBA,IAAa,4BAAb,cAA+C,uBAAuB;CACpE,gBAAoD;CACpD,mBAAuD;CACvD,+BAAoC,IAAI,KAAK;CAC7C,aAAqB;CACrB;CAEA,YAAmB,EACjB,MACA,MACA,cACA,mBACiC,EAAE,EAAE;AACrC,QAAM;GACJ,qBAAqB;GACrB,wBAAwB;GACxB;GACA;GACA;GACA,QAAQ,EAAE;GACX,CAAC;AACF,OAAK,kBAAkB;AAEvB,MAAI,KAAK,QAAQ,QACf,MAAK,QAAQ;;CAIjB,SAAsB;AACpB,MAAI,KAAK,WACP;AAGF,OAAK,aAAa;AAClB,OAAK,+BAAe,IAAI,KAAK;AAE7B,MAAI,KAAK,cACP,MAAK,cAAc,YAAY;AAEjC,MAAI,KAAK,iBACP,MAAK,iBAAiB,YAAY;AAGpC,OAAK,gBAAgB,0BACnB,QACA,KAAK,cAAc,KAAK,KAAK,EAC7B,EAAE,MAAM,KAAK,OAAO,CACrB;AAED,MAAI,CAAC,KAAK,cACR,MAAK,MAAM,MAAM,iCAAiC;AAGpD,OAAK,mBAAmB,0BACtB,YACC,UAAU,KAAK,cAAc,MAAM,EACpC,EAAE,MAAM,KAAK,OAAO,CACrB;AAED,MAAI,CAAC,KAAK,iBACR,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AAU;GACjE,WAAW;GACX,gBAAgB,eAAe;GAC/B,YAAY;KACT,eAAA;KACA,2BAA2B,MAAM;KACjC,iCAAiC,KAAK,KAAK,mBAC1C,MAAM,UACP;KACA,+BAA+B,MAAM;KACrC,iCAAiC,MAAM;IACzC;GACD;GACD,CAAC"}
@@ -1 +1 @@
1
- {"version":3,"file":"WebVitalsInstrumentation.cjs","names":["KEY_MXL_WEB_VITAL_ATTRIBUTION_PREFIX","MAX_LOAF_SCRIPT_URL_LENGTH","MXLInstrumentationBase","WEB_VITALS_ID_TO_LISTENER","page","KEY_MXL_TYPE","ATTR_URL_FULL","KEY_BROWSER_URL_FULL","KEY_MXL_WEB_VITAL_NAVIGATION_TYPE","KEY_MXL_WEB_VITAL_NAME","KEY_MXL_WEB_VITAL_RATING","KEY_MXL_WEB_VITAL_ID","KEY_MXL_WEB_VITAL_DELTA","KEY_MXL_WEB_VITAL_VALUE","KEY_MXL_PAGE_PATH","KEY_MXL_PAGE_ID","KEY_APP_SURFACE_LABEL","MXL_WEB_VITALS_PREFIX"],"sources":["../../../../src/instrumentations/web-vitals/WebVitalsInstrumentation/WebVitalsInstrumentation.ts"],"sourcesContent":["import type {\n Attributes,\n AttributeValue,\n DiagLogger,\n} from '@opentelemetry/api';\nimport { ATTR_URL_FULL } from '@opentelemetry/semantic-conventions';\nimport type {\n CLSMetricWithAttribution,\n INPAttribution,\n Metric,\n MetricWithAttribution,\n TTFBAttribution,\n} from 'web-vitals/attribution';\nimport type { PageManager } from '../../../api-page/index.ts';\nimport { page } from '../../../api-page/index.ts';\nimport type { URLDocument } from '../../../common/index.ts';\nimport {\n MXL_TYPES,\n KEY_APP_SURFACE_LABEL,\n KEY_BROWSER_URL_FULL,\n KEY_MXL_PAGE_ID,\n KEY_MXL_PAGE_PATH,\n KEY_MXL_TYPE,\n} from '../../../constants/index.ts';\nimport { MXLInstrumentationBase } from '../../MXLInstrumentationBase/index.ts';\nimport {\n KEY_MXL_WEB_VITAL_ATTRIBUTION_PREFIX,\n KEY_MXL_WEB_VITAL_DELTA,\n KEY_MXL_WEB_VITAL_ID,\n KEY_MXL_WEB_VITAL_NAME,\n KEY_MXL_WEB_VITAL_NAVIGATION_TYPE,\n KEY_MXL_WEB_VITAL_RATING,\n KEY_MXL_WEB_VITAL_VALUE,\n} from './attributes.ts';\nimport {\n ALL_WEB_VITALS,\n MXL_WEB_VITALS_PREFIX,\n MAX_LOAF_SCRIPT_ENTRIES,\n MAX_LOAF_SCRIPT_URL_LENGTH,\n WEB_VITALS_ID_TO_LISTENER,\n} from './constants.ts';\nimport type {\n WebVitalListeners,\n WebVitalsInstrumentationArgs,\n} from './types.ts';\n\ntype AttributedPage = {\n fullURL: string;\n path?: string;\n pageID?: string;\n label?: string;\n};\n\nconst isPrimitiveValue = (value: unknown): value is AttributeValue => {\n const type = typeof value;\n return type === 'number' || type === 'string' || type === 'boolean';\n};\n\nconst roundClamp = (value: number): number => Math.round(Math.max(0, value));\n\nconst webVitalAttributionToReport = (\n metric: MetricWithAttribution,\n): Attributes => {\n const attributes: Attributes = {};\n const attribution = metric.attribution;\n\n if (!attribution || typeof attribution !== 'object') {\n return attributes;\n }\n\n for (const [key, value] of Object.entries(attribution)) {\n if (isPrimitiveValue(value)) {\n attributes[`${KEY_MXL_WEB_VITAL_ATTRIBUTION_PREFIX}${key}`] = value;\n }\n }\n\n return attributes;\n};\n\nconst loafScriptsAttribution = (\n metric: MetricWithAttribution,\n diag: DiagLogger,\n): Attributes => {\n const attributes: Attributes = {};\n const attribution = metric.attribution as INPAttribution;\n\n try {\n // suppress LoAF baseline errors\n /* eslint-disable baseline-js/use-baseline */\n if (attribution.longAnimationFrameEntries.length > 0) {\n const scripts = new Map<\n string,\n {\n totalDuration: number;\n styleAndLayoutDuration: number;\n count: number;\n }\n >();\n for (const entry of attribution.longAnimationFrameEntries) {\n for (const script of entry.scripts) {\n let url = script.sourceURL || '(inline)';\n if (url.length > MAX_LOAF_SCRIPT_URL_LENGTH) {\n url = `${url.substring(0, MAX_LOAF_SCRIPT_URL_LENGTH)}...`;\n }\n const existing = scripts.get(url);\n if (existing) {\n existing.totalDuration += script.duration;\n existing.styleAndLayoutDuration +=\n script.forcedStyleAndLayoutDuration;\n existing.count++;\n } else {\n scripts.set(url, {\n totalDuration: script.duration,\n styleAndLayoutDuration: script.forcedStyleAndLayoutDuration,\n count: 1,\n });\n }\n }\n }\n if (scripts.size > 0) {\n attributes[`${KEY_MXL_WEB_VITAL_ATTRIBUTION_PREFIX}loaf_scripts`] =\n JSON.stringify(\n Object.fromEntries(\n [...scripts]\n .sort((a, b) => b[1].totalDuration - a[1].totalDuration)\n .slice(0, MAX_LOAF_SCRIPT_ENTRIES)\n .map(([url, script]) => [\n url,\n {\n total_duration: Math.round(script.totalDuration),\n style_and_layout_duration: Math.round(\n script.styleAndLayoutDuration,\n ),\n count: script.count,\n },\n ]),\n ),\n );\n }\n }\n /* eslint-enable baseline-js/use-baseline */\n } catch (e) {\n diag.error('error building loaf scripts for INP', e);\n }\n\n return attributes;\n};\n\nconst ttfbSubPartsAttribution = (\n metric: MetricWithAttribution,\n diag: DiagLogger,\n): Attributes => {\n const attributes: Attributes = {};\n const attribution = metric.attribution as TTFBAttribution;\n const entry = attribution.navigationEntry as\n | PerformanceNavigationTiming\n | undefined;\n\n if (entry) {\n try {\n const redirect = roundClamp(entry.redirectEnd - entry.redirectStart);\n const domainLookup = roundClamp(\n entry.domainLookupEnd - entry.domainLookupStart,\n );\n const tcpConnection = roundClamp(\n entry.secureConnectionStart > 0\n ? entry.secureConnectionStart - entry.connectStart\n : entry.connectEnd - entry.connectStart,\n );\n const tlsNegotiation = roundClamp(\n entry.secureConnectionStart > 0\n ? entry.connectEnd - entry.secureConnectionStart\n : 0,\n );\n const effectiveResponseStart = Math.max(\n // @ts-expect-error 103 Early hints are not supported in all browsers\n // https://developer.mozilla.org/en-US/docs/Web/API/PerformanceResourceTiming/finalResponseHeadersStart\n entry.finalResponseHeadersStart ?? 0,\n entry.responseStart,\n );\n const serverResponse = roundClamp(\n effectiveResponseStart - entry.requestStart,\n );\n const total = Math.round(entry.responseEnd - entry.startTime);\n const unattributed = roundClamp(\n total -\n redirect -\n domainLookup -\n tcpConnection -\n tlsNegotiation -\n serverResponse,\n );\n const prefix = KEY_MXL_WEB_VITAL_ATTRIBUTION_PREFIX;\n attributes[`${prefix}redirect`] = redirect;\n attributes[`${prefix}domainLookup`] = domainLookup;\n attributes[`${prefix}tcpConnection`] = tcpConnection;\n attributes[`${prefix}tlsNegotiation`] = tlsNegotiation;\n attributes[`${prefix}serverResponse`] = serverResponse;\n attributes[`${prefix}unattributed`] = unattributed;\n } catch (e) {\n diag.error('error computing TTFB timing breakdown', e);\n }\n } else {\n diag.debug('TTFB navigationEntry unavailable, skipping timing breakdown');\n }\n\n return attributes;\n};\n\nexport class WebVitalsInstrumentation extends MXLInstrumentationBase {\n private readonly _listeners: WebVitalListeners;\n private readonly _urlDocument: URLDocument;\n private readonly _urlAttribution: boolean;\n private readonly _pageManager: PageManager;\n private readonly _attributedPage: Record<\n Metric['name'],\n AttributedPage | undefined\n > = {\n INP: undefined,\n LCP: undefined,\n CLS: undefined,\n FCP: undefined,\n TTFB: undefined,\n };\n private _largestShiftTargetForCLS: string | undefined;\n private _listenersRegistered = false;\n private _isEnabled = false;\n\n // instrumentation that adds an event to the session span for each web vital report\n public constructor({\n diag,\n perf,\n listeners = WEB_VITALS_ID_TO_LISTENER,\n urlDocument = window.document,\n urlAttribution = true,\n pageManager,\n }: WebVitalsInstrumentationArgs = {}) {\n super({\n instrumentationName: 'WebVitalsInstrumentation',\n instrumentationVersion: '1.0.0',\n diag,\n perf,\n config: {},\n });\n this._listeners = listeners;\n this._urlDocument = urlDocument;\n this._urlAttribution = urlAttribution;\n this._pageManager = pageManager ?? page.getPageManager();\n\n if (this._config.enabled) {\n this.enable();\n }\n }\n\n public override disable(): void {\n // web-vitals library doesn't support removing listeners, so we just pause emission\n // https://github.com/GoogleChrome/web-vitals/issues/357#issuecomment-1593439036\n this._isEnabled = false;\n this._diag.debug('WebVitalsInstrumentation disabled, pausing emission');\n }\n\n public enable(): void {\n this._isEnabled = true;\n\n // web-vitals library doesn't support removing listeners, so only register once\n if (this._listenersRegistered) {\n this._diag.debug(\n 'WebVitalsInstrumentation listeners already registered, resuming emission',\n );\n return;\n }\n this._listenersRegistered = true;\n\n ALL_WEB_VITALS.forEach((name) => {\n this._listeners[name]?.((metric) => {\n if (!this._isEnabled) {\n return;\n }\n\n const currentSessionSpan = this.sessionManager.getSessionSpan();\n\n if (!currentSessionSpan) {\n return;\n }\n\n // first thing record the time when this cb was invoked\n const metricTime = this._getTimeForMetric(metric);\n\n const attributedPage = this._getAttributedPageForMetric(metric);\n\n const attrs: Attributes = {\n [KEY_MXL_TYPE]: MXL_TYPES.WebVital,\n [ATTR_URL_FULL]: attributedPage.fullURL,\n [KEY_BROWSER_URL_FULL]: attributedPage.fullURL,\n [KEY_MXL_WEB_VITAL_NAVIGATION_TYPE]: metric.navigationType,\n [KEY_MXL_WEB_VITAL_NAME]: metric.name,\n [KEY_MXL_WEB_VITAL_RATING]: metric.rating,\n [KEY_MXL_WEB_VITAL_ID]: metric.id,\n [KEY_MXL_WEB_VITAL_DELTA]: metric.delta,\n [KEY_MXL_WEB_VITAL_VALUE]: metric.value,\n ...webVitalAttributionToReport(metric),\n ...(name === 'INP' ? loafScriptsAttribution(metric, this._diag) : {}),\n ...(name === 'TTFB'\n ? ttfbSubPartsAttribution(metric, this._diag)\n : {}),\n };\n\n // Add page attributes if route and page ID exist\n if (attributedPage.path && attributedPage.pageID) {\n attrs[KEY_MXL_PAGE_PATH] = attributedPage.path;\n attrs[KEY_MXL_PAGE_ID] = attributedPage.pageID;\n }\n\n if (attributedPage.label) {\n attrs[KEY_APP_SURFACE_LABEL] = attributedPage.label;\n }\n\n currentSessionSpan.addEvent(\n `${MXL_WEB_VITALS_PREFIX}-report-${name}`,\n attrs,\n metricTime,\n );\n });\n });\n\n if (this._urlAttribution) {\n // When these web vitals make their final report (e.g. when the listeners w/ reportAllChanges=false trigger) the\n // document's URL at that time may not match what it was at the time the scores were last updated. Instead, listen\n // for updates to the scores and keep track of the Page information to attribute for each\n this._listeners.TTFB?.(\n () => {\n this._attributedPage.TTFB = this._currentAttributedPage();\n },\n {\n reportAllChanges: true,\n },\n );\n this._listeners.FCP?.(\n () => {\n this._attributedPage.FCP = this._currentAttributedPage();\n },\n {\n reportAllChanges: true,\n },\n );\n this._listeners.INP?.(\n () => {\n this._attributedPage.INP = this._currentAttributedPage();\n },\n {\n reportAllChanges: true,\n },\n );\n this._listeners.LCP?.(\n () => {\n this._attributedPage.LCP = this._currentAttributedPage();\n },\n {\n reportAllChanges: true,\n },\n );\n this._listeners.CLS?.(\n (metric: MetricWithAttribution) => {\n const clsMetric = metric as CLSMetricWithAttribution;\n // A layout shift could cause CLS to change its rating but because the score is cumulative this might not\n // correspond with an updated `largestShiftTarget`. Since we want to tie the attributed URL to the page that\n // the `largestShiftTarget` was on we only update the attributed URL if that target has changed\n if (\n this._largestShiftTargetForCLS !==\n clsMetric.attribution.largestShiftTarget\n ) {\n this._largestShiftTargetForCLS =\n clsMetric.attribution.largestShiftTarget;\n this._attributedPage.CLS = this._currentAttributedPage();\n }\n },\n {\n reportAllChanges: true,\n },\n );\n }\n }\n\n private _getTimeForMetric(metric: MetricWithAttribution): number {\n if (metric.name === 'CLS' && metric.attribution.largestShiftTime) {\n return this.perf.epochMillisFromOriginOffset(\n metric.attribution.largestShiftTime,\n );\n }\n\n if (metric.name === 'INP' && metric.attribution.interactionTime) {\n return this.perf.epochMillisFromOriginOffset(\n metric.attribution.interactionTime,\n );\n }\n\n return this.perf.getNowMillis();\n }\n\n private _currentAttributedPage(): AttributedPage {\n const attributed: AttributedPage = {\n fullURL: this._urlDocument.URL,\n };\n\n const currentRoute = this._pageManager.getCurrentRoute();\n const currentPageId = this._pageManager.getCurrentPageId();\n if (currentRoute && currentPageId) {\n attributed.path = currentRoute.path;\n attributed.pageID = currentPageId;\n }\n\n const pageLabel = this._pageManager.getPageLabel();\n if (pageLabel) {\n attributed.label = pageLabel;\n }\n\n return attributed;\n }\n\n private _getAttributedPageForMetric(\n metric: MetricWithAttribution,\n ): AttributedPage {\n if (metric.name === 'FCP' && this._attributedPage.FCP) {\n return this._attributedPage.FCP;\n }\n\n if (metric.name === 'TTFB' && this._attributedPage.TTFB) {\n return this._attributedPage.TTFB;\n }\n\n if (metric.name === 'INP' && this._attributedPage.INP) {\n return this._attributedPage.INP;\n }\n\n if (metric.name === 'LCP' && this._attributedPage.LCP) {\n return this._attributedPage.LCP;\n }\n\n if (\n metric.name === 'CLS' &&\n this._attributedPage.CLS &&\n metric.attribution.largestShiftTarget === this._largestShiftTargetForCLS\n ) {\n return this._attributedPage.CLS;\n }\n\n return this._currentAttributedPage();\n }\n}\n"],"mappings":";;;;;;;;;AAqDA,MAAM,oBAAoB,UAA4C;CACpE,MAAM,OAAO,OAAO;AACpB,QAAO,SAAS,YAAY,SAAS,YAAY,SAAS;;AAG5D,MAAM,cAAc,UAA0B,KAAK,MAAM,KAAK,IAAI,GAAG,MAAM,CAAC;AAE5E,MAAM,+BACJ,WACe;CACf,MAAM,aAAyB,EAAE;CACjC,MAAM,cAAc,OAAO;AAE3B,KAAI,CAAC,eAAe,OAAO,gBAAgB,SACzC,QAAO;AAGT,MAAK,MAAM,CAAC,KAAK,UAAU,OAAO,QAAQ,YAAY,CACpD,KAAI,iBAAiB,MAAM,CACzB,YAAW,GAAGA,wEAAAA,uCAAuC,SAAS;AAIlE,QAAO;;AAGT,MAAM,0BACJ,QACA,SACe;CACf,MAAM,aAAyB,EAAE;CACjC,MAAM,cAAc,OAAO;AAE3B,KAAI;AAGF,MAAI,YAAY,0BAA0B,SAAS,GAAG;GACpD,MAAM,0BAAU,IAAI,KAOjB;AACH,QAAK,MAAM,SAAS,YAAY,0BAC9B,MAAK,MAAM,UAAU,MAAM,SAAS;IAClC,IAAI,MAAM,OAAO,aAAa;AAC9B,QAAI,IAAI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TENER","page","KEY_MXL_TYPE","ATTR_URL_FULL","KEY_BROWSER_URL_FULL","KEY_MXL_WEB_VITAL_NAVIGATION_TYPE","KEY_MXL_WEB_VITAL_NAME","KEY_MXL_WEB_VITAL_RATING","KEY_MXL_WEB_VITAL_ID","KEY_MXL_WEB_VITAL_DELTA","KEY_MXL_WEB_VITAL_VALUE","KEY_MXL_PAGE_PATH","KEY_MXL_PAGE_ID","KEY_APP_SURFACE_LABEL","MXL_WEB_VITALS_PREFIX"],"sources":["../../../../src/instrumentations/web-vitals/WebVitalsInstrumentation/WebVitalsInstrumentation.ts"],"sourcesContent":["import type {\n Attributes,\n AttributeValue,\n DiagLogger,\n} from '@opentelemetry/api';\nimport { ATTR_URL_FULL } from '@opentelemetry/semantic-conventions';\nimport type {\n CLSMetricWithAttribution,\n INPAttribution,\n Metric,\n MetricWithAttribution,\n TTFBAttribution,\n} from 'web-vitals/attribution';\nimport type { PageManager } from '../../../api-page';\nimport { page } from '../../../api-page';\nimport type { URLDocument } from '../../../common';\nimport {\n KEY_APP_SURFACE_LABEL,\n KEY_BROWSER_URL_FULL,\n KEY_MXL_PAGE_ID,\n KEY_MXL_PAGE_PATH,\n KEY_MXL_TYPE,\n MXL_TYPES,\n} from '../../../constants';\nimport { MXLInstrumentationBase } from '../../MXLInstrumentationBase';\nimport {\n KEY_MXL_WEB_VITAL_ATTRIBUTION_PREFIX,\n KEY_MXL_WEB_VITAL_DELTA,\n KEY_MXL_WEB_VITAL_ID,\n KEY_MXL_WEB_VITAL_NAME,\n KEY_MXL_WEB_VITAL_NAVIGATION_TYPE,\n KEY_MXL_WEB_VITAL_RATING,\n KEY_MXL_WEB_VITAL_VALUE,\n} from './attributes';\nimport {\n ALL_WEB_VITALS,\n MAX_LOAF_SCRIPT_ENTRIES,\n MAX_LOAF_SCRIPT_URL_LENGTH,\n MXL_WEB_VITALS_PREFIX,\n WEB_VITALS_ID_TO_LISTENER,\n} from './constants';\nimport type { WebVitalListeners, WebVitalsInstrumentationArgs } from './types';\n\ntype AttributedPage = {\n fullURL: string;\n path?: string;\n pageID?: string;\n label?: string;\n};\n\nconst isPrimitiveValue = (value: unknown): value is AttributeValue => {\n const type = typeof value;\n return type === 'number' || type === 'string' || type === 'boolean';\n};\n\nconst roundClamp = (value: number): number => Math.round(Math.max(0, value));\n\nconst webVitalAttributionToReport = (\n metric: MetricWithAttribution,\n): Attributes => {\n const attributes: Attributes = {};\n const attribution = metric.attribution;\n\n if (!attribution || typeof attribution !== 'object') {\n return attributes;\n }\n\n for (const [key, value] of Object.entries(attribution)) {\n if (isPrimitiveValue(value)) {\n attributes[`${KEY_MXL_WEB_VITAL_ATTRIBUTION_PREFIX}${key}`] = value;\n }\n }\n\n return attributes;\n};\n\nconst loafScriptsAttribution = (\n metric: MetricWithAttribution,\n diag: DiagLogger,\n): Attributes => {\n const attributes: Attributes = {};\n const attribution = metric.attribution as INPAttribution;\n\n try {\n // suppress LoAF baseline errors\n /* eslint-disable baseline-js/use-baseline */\n if (attribution.longAnimationFrameEntries.length > 0) {\n const scripts = new Map<\n string,\n {\n totalDuration: number;\n styleAndLayoutDuration: number;\n count: number;\n }\n >();\n for (const entry of attribution.longAnimationFrameEntries) {\n for (const script of entry.scripts) {\n let url = script.sourceURL || '(inline)';\n if (url.length > MAX_LOAF_SCRIPT_URL_LENGTH) {\n url = `${url.substring(0, MAX_LOAF_SCRIPT_URL_LENGTH)}...`;\n }\n const existing = scripts.get(url);\n if (existing) {\n existing.totalDuration += script.duration;\n existing.styleAndLayoutDuration +=\n script.forcedStyleAndLayoutDuration;\n existing.count++;\n } else {\n scripts.set(url, {\n totalDuration: script.duration,\n styleAndLayoutDuration: script.forcedStyleAndLayoutDuration,\n count: 1,\n });\n }\n }\n }\n if (scripts.size > 0) {\n attributes[`${KEY_MXL_WEB_VITAL_ATTRIBUTION_PREFIX}loaf_scripts`] =\n JSON.stringify(\n Object.fromEntries(\n [...scripts]\n .sort((a, b) => b[1].totalDuration - a[1].totalDuration)\n .slice(0, MAX_LOAF_SCRIPT_ENTRIES)\n .map(([url, script]) => [\n url,\n {\n total_duration: Math.round(script.totalDuration),\n style_and_layout_duration: Math.round(\n script.styleAndLayoutDuration,\n ),\n count: script.count,\n },\n ]),\n ),\n );\n }\n }\n /* eslint-enable baseline-js/use-baseline */\n } catch (e) {\n diag.error('error building loaf scripts for INP', e);\n }\n\n return attributes;\n};\n\nconst ttfbSubPartsAttribution = (\n metric: MetricWithAttribution,\n diag: DiagLogger,\n): Attributes => {\n const attributes: Attributes = {};\n const attribution = metric.attribution as TTFBAttribution;\n const entry = attribution.navigationEntry as\n | PerformanceNavigationTiming\n | undefined;\n\n if (entry) {\n try {\n const redirect = roundClamp(entry.redirectEnd - entry.redirectStart);\n const domainLookup = roundClamp(\n entry.domainLookupEnd - entry.domainLookupStart,\n );\n const tcpConnection = roundClamp(\n entry.secureConnectionStart > 0\n ? entry.secureConnectionStart - entry.connectStart\n : entry.connectEnd - entry.connectStart,\n );\n const tlsNegotiation = roundClamp(\n entry.secureConnectionStart > 0\n ? entry.connectEnd - entry.secureConnectionStart\n : 0,\n );\n const effectiveResponseStart = Math.max(\n // @ts-expect-error 103 Early hints are not supported in all browsers\n // https://developer.mozilla.org/en-US/docs/Web/API/PerformanceResourceTiming/finalResponseHeadersStart\n entry.finalResponseHeadersStart ?? 0,\n entry.responseStart,\n );\n const serverResponse = roundClamp(\n effectiveResponseStart - entry.requestStart,\n );\n const total = Math.round(entry.responseEnd - entry.startTime);\n const unattributed = roundClamp(\n total -\n redirect -\n domainLookup -\n tcpConnection -\n tlsNegotiation -\n serverResponse,\n );\n const prefix = KEY_MXL_WEB_VITAL_ATTRIBUTION_PREFIX;\n attributes[`${prefix}redirect`] = redirect;\n attributes[`${prefix}domainLookup`] = domainLookup;\n attributes[`${prefix}tcpConnection`] = tcpConnection;\n attributes[`${prefix}tlsNegotiation`] = tlsNegotiation;\n attributes[`${prefix}serverResponse`] = serverResponse;\n attributes[`${prefix}unattributed`] = unattributed;\n } catch (e) {\n diag.error('error computing TTFB timing breakdown', e);\n }\n } else {\n diag.debug('TTFB navigationEntry unavailable, skipping timing breakdown');\n }\n\n return attributes;\n};\n\nexport class WebVitalsInstrumentation extends MXLInstrumentationBase {\n private readonly _listeners: WebVitalListeners;\n private readonly _urlDocument: URLDocument;\n private readonly _urlAttribution: boolean;\n private readonly _pageManager: PageManager;\n private readonly _attributedPage: Record<\n Metric['name'],\n AttributedPage | undefined\n > = {\n INP: undefined,\n LCP: undefined,\n CLS: undefined,\n FCP: undefined,\n TTFB: undefined,\n };\n private _largestShiftTargetForCLS: string | undefined;\n private _listenersRegistered = false;\n private _isEnabled = false;\n\n // instrumentation that adds an event to the session span for each web vital report\n public constructor({\n diag,\n perf,\n listeners = WEB_VITALS_ID_TO_LISTENER,\n urlDocument = window.document,\n urlAttribution = true,\n pageManager,\n }: WebVitalsInstrumentationArgs = {}) {\n super({\n instrumentationName: 'WebVitalsInstrumentation',\n instrumentationVersion: '1.0.0',\n diag,\n perf,\n config: {},\n });\n this._listeners = listeners;\n this._urlDocument = urlDocument;\n this._urlAttribution = urlAttribution;\n this._pageManager = pageManager ?? page.getPageManager();\n\n if (this._config.enabled) {\n this.enable();\n }\n }\n\n public override disable(): void {\n // web-vitals library doesn't support removing listeners, so we just pause emission\n // https://github.com/GoogleChrome/web-vitals/issues/357#issuecomment-1593439036\n this._isEnabled = false;\n this._diag.debug('WebVitalsInstrumentation disabled, pausing emission');\n }\n\n public enable(): void {\n this._isEnabled = true;\n\n // web-vitals library doesn't support removing listeners, so only register once\n if (this._listenersRegistered) {\n this._diag.debug(\n 'WebVitalsInstrumentation listeners already registered, resuming emission',\n );\n return;\n }\n this._listenersRegistered = true;\n\n ALL_WEB_VITALS.forEach((name) => {\n this._listeners[name]?.((metric) => {\n if (!this._isEnabled) {\n return;\n }\n\n const currentSessionSpan = this.sessionManager.getSessionSpan();\n\n if (!currentSessionSpan) {\n return;\n }\n\n // first thing record the time when this cb was invoked\n const metricTime = this._getTimeForMetric(metric);\n\n const attributedPage = this._getAttributedPageForMetric(metric);\n\n const attrs: Attributes = {\n [KEY_MXL_TYPE]: MXL_TYPES.WebVital,\n [ATTR_URL_FULL]: attributedPage.fullURL,\n [KEY_BROWSER_URL_FULL]: attributedPage.fullURL,\n [KEY_MXL_WEB_VITAL_NAVIGATION_TYPE]: metric.navigationType,\n [KEY_MXL_WEB_VITAL_NAME]: metric.name,\n [KEY_MXL_WEB_VITAL_RATING]: metric.rating,\n [KEY_MXL_WEB_VITAL_ID]: metric.id,\n [KEY_MXL_WEB_VITAL_DELTA]: metric.delta,\n [KEY_MXL_WEB_VITAL_VALUE]: metric.value,\n ...webVitalAttributionToReport(metric),\n ...(name === 'INP' ? loafScriptsAttribution(metric, this._diag) : {}),\n ...(name === 'TTFB'\n ? ttfbSubPartsAttribution(metric, this._diag)\n : {}),\n };\n\n // Add page attributes if route and page ID exist\n if (attributedPage.path && attributedPage.pageID) {\n attrs[KEY_MXL_PAGE_PATH] = attributedPage.path;\n attrs[KEY_MXL_PAGE_ID] = attributedPage.pageID;\n }\n\n if (attributedPage.label) {\n attrs[KEY_APP_SURFACE_LABEL] = attributedPage.label;\n }\n\n currentSessionSpan.addEvent(\n `${MXL_WEB_VITALS_PREFIX}-report-${name}`,\n attrs,\n metricTime,\n );\n });\n });\n\n if (this._urlAttribution) {\n // When these web vitals make their final report (e.g. when the listeners w/ reportAllChanges=false trigger) the\n // document's URL at that time may not match what it was at the time the scores were last updated. Instead, listen\n // for updates to the scores and keep track of the Page information to attribute for each\n this._listeners.TTFB?.(\n () => {\n this._attributedPage.TTFB = this._currentAttributedPage();\n },\n {\n reportAllChanges: true,\n },\n );\n this._listeners.FCP?.(\n () => {\n this._attributedPage.FCP = this._currentAttributedPage();\n },\n {\n reportAllChanges: true,\n },\n );\n this._listeners.INP?.(\n () => {\n this._attributedPage.INP = this._currentAttributedPage();\n },\n {\n reportAllChanges: true,\n },\n );\n this._listeners.LCP?.(\n () => {\n this._attributedPage.LCP = this._currentAttributedPage();\n },\n {\n reportAllChanges: true,\n },\n );\n this._listeners.CLS?.(\n (metric: MetricWithAttribution) => {\n const clsMetric = metric as CLSMetricWithAttribution;\n // A layout shift could cause CLS to change its rating but because the score is cumulative this might not\n // correspond with an updated `largestShiftTarget`. Since we want to tie the attributed URL to the page that\n // the `largestShiftTarget` was on we only update the attributed URL if that target has changed\n if (\n this._largestShiftTargetForCLS !==\n clsMetric.attribution.largestShiftTarget\n ) {\n this._largestShiftTargetForCLS =\n clsMetric.attribution.largestShiftTarget;\n this._attributedPage.CLS = this._currentAttributedPage();\n }\n },\n {\n reportAllChanges: true,\n },\n );\n }\n }\n\n private _getTimeForMetric(metric: MetricWithAttribution): number {\n if (metric.name === 'CLS' && metric.attribution.largestShiftTime) {\n return this.perf.epochMillisFromOriginOffset(\n metric.attribution.largestShiftTime,\n );\n }\n\n if (metric.name === 'INP' && metric.attribution.interactionTime) {\n return this.perf.epochMillisFromOriginOffset(\n metric.attribution.interactionTime,\n );\n }\n\n return this.perf.getNowMillis();\n }\n\n private _currentAttributedPage(): AttributedPage {\n const attributed: AttributedPage = {\n fullURL: this._urlDocument.URL,\n };\n\n const currentRoute = this._pageManager.getCurrentRoute();\n const currentPageId = this._pageManager.getCurrentPageId();\n if (currentRoute && currentPageId) {\n attributed.path = currentRoute.path;\n attributed.pageID = currentPageId;\n }\n\n const pageLabel = this._pageManager.getPageLabel();\n if (pageLabel) {\n attributed.label = pageLabel;\n }\n\n return attributed;\n }\n\n private _getAttributedPageForMetric(\n metric: MetricWithAttribution,\n ): AttributedPage {\n if (metric.name === 'FCP' && this._attributedPage.FCP) {\n return this._attributedPage.FCP;\n }\n\n if (metric.name === 'TTFB' && this._attributedPage.TTFB) {\n return this._attributedPage.TTFB;\n }\n\n if (metric.name === 'INP' && this._attributedPage.INP) {\n return this._attributedPage.INP;\n }\n\n if (metric.name === 'LCP' && this._attributedPage.LCP) {\n return this._attributedPage.LCP;\n }\n\n if (\n metric.name === 'CLS' &&\n this._attributedPage.CLS &&\n metric.attribution.largestShiftTarget === this._largestShiftTargetForCLS\n ) {\n return this._attributedPage.CLS;\n }\n\n return this._currentAttributedPage();\n }\n}\n"],"mappings":";;;;;;;;;AAkDA,MAAM,oBAAoB,UAA4C;CACpE,MAAM,OAAO,OAAO;AACpB,QAAO,SAAS,YAAY,SAAS,YAAY,SAAS;;AAG5D,MAAM,cAAc,UAA0B,KAAK,MAAM,KAAK,IAAI,GAAG,MAAM,CAAC;AAE5E,MAAM,+BACJ,WACe;CACf,MAAM,aAAyB,EAAE;CACjC,MAAM,cAAc,OAAO;AAE3B,KAAI,CAAC,eAAe,OAAO,gBAAgB,SACzC,QAAO;AAGT,MAAK,MAAM,CAAC,KAAK,UAAU,OAAO,QAAQ,YAAY,CACpD,KAAI,iBAAiB,MAAM,CACzB,YAAW,GAAGA,wEAAAA,uCAAuC,SAAS;AAIlE,QAAO;;AAGT,MAAM,0BACJ,QACA,SACe;CACf,MAAM,aAAyB,EAAE;CACjC,MAAM,cAAc,OAAO;AAE3B,KAAI;AAGF,MAAI,YAAY,0BAA0B,SAAS,GAAG;GACpD,MAAM,0BAAU,IAAI,KAOjB;AACH,QAAK,MAAM,SAAS,YAAY,0BAC9B,MAAK,MAAM,UAAU,MAAM,SAAS;IAClC,IAAI,MAAM,OAAO,aAAa;AAC9B,QAAI,IAAI,SAAA,KACN,OAAM,GAAG,IAAI,UAAU,GAAGC,uEAAAA,2BAA2B,CAAC;IAExD,MAAM,WAAW,QAAQ,IAAI,IAAI;AACjC,QAAI,UAAU;AACZ,cAAS,iBAAiB,OAAO;AACjC,cAAS,0BACP,OAAO;AACT,cAAS;UAET,SAAQ,IAAI,KAAK;KACf,eAAe,OAAO;KACtB,wBAAwB,OAAO;KAC/B,OAAO;KACR,CAAC;;AAIR,OAAI,QAAQ,OAAO,EACjB,YAAW,GAAGD,wEAAAA,qCAAqC,iBACjD,KAAK,UACH,OAAO,YACL,CAAC,GAAG,QAAQ,CACT,MAAM,GAAG,M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K,aAAa,KAC5B;EAED,MAAM,eAAe,KAAK,aAAa,iBAAiB;EACxD,MAAM,gBAAgB,KAAK,aAAa,kBAAkB;AAC1D,MAAI,gBAAgB,eAAe;AACjC,cAAW,OAAO,aAAa;AAC/B,cAAW,SAAS;;EAGtB,MAAM,YAAY,KAAK,aAAa,cAAc;AAClD,MAAI,UACF,YAAW,QAAQ;AAGrB,SAAO;;CAGT,4BACE,QACgB;AAChB,MAAI,OAAO,SAAS,SAAS,KAAK,gBAAgB,IAChD,QAAO,KAAK,gBAAgB;AAG9B,MAAI,OAAO,SAAS,UAAU,KAAK,gBAAgB,KACjD,QAAO,KAAK,gBAAgB;AAG9B,MAAI,OAAO,SAAS,SAAS,KAAK,gBAAgB,IAChD,QAAO,KAAK,gBAAgB;AAG9B,MAAI,OAAO,SAAS,SAAS,KAAK,gBAAgB,IAChD,QAAO,KAAK,gBAAgB;AAG9B,MACE,OAAO,SAAS,SAChB,KAAK,gBAAgB,OACrB,OAAO,YAAY,uBAAuB,KAAK,0BAE/C,QAAO,KAAK,gBAAgB;AAG9B,SAAO,KAAK,wBAAwB"}
@@ -1 +1 @@
1
- {"version":3,"file":"WebVitalsInstrumentation.d.cts","names":[],"sources":["../../../../src/instrumentations/web-vitals/WebVitalsInstrumentation/WebVitalsInstrumentation.ts"],"mappings":";;;;cAiNa,wBAAA,SAAiC,sBAAA;EAAA,iBAC3B,UAAA;EAAA,iBACA,YAAA;EAAA,iBACA,eAAA;EAAA,iBACA,YAAA;EAAA,iBACA,eAAA;EAAA,QAUT,yBAAA;EAAA,QACA,oBAAA;EAAA,QACA,UAAA;;IAIN,IAAA;IACA,IAAA;IACA,SAAA;IACA,WAAA;IACA,cAAA;IACA;EAAA,IACC,4BAAA;EAkBa,OAAA,CAAA;EAOT,MAAA,CAAA;EAAA,QA0HC,iBAAA;EAAA,QAgBA,sBAAA;EAAA,QAoBA,2BAAA;AAAA"}
1
+ {"version":3,"file":"WebVitalsInstrumentation.d.cts","names":[],"sources":["../../../../src/instrumentations/web-vitals/WebVitalsInstrumentation/WebVitalsInstrumentation.ts"],"mappings":";;;;cA8Ma,wBAAA,SAAiC,sBAAA;EAAA,iBAC3B,UAAA;EAAA,iBACA,YAAA;EAAA,iBACA,eAAA;EAAA,iBACA,YAAA;EAAA,iBACA,eAAA;EAAA,QAUT,yBAAA;EAAA,QACA,oBAAA;EAAA,QACA,UAAA;;IAIN,IAAA;IACA,IAAA;IACA,SAAA;IACA,WAAA;IACA,cAAA;IACA;EAAA,IACC,4BAAA;EAkBa,OAAA,CAAA;EAOT,MAAA,CAAA;EAAA,QA0HC,iBAAA;EAAA,QAgBA,sBAAA;EAAA,QAoBA,2BAAA;AAAA"}
@@ -1 +1 @@
1
- {"version":3,"file":"WebVitalsInstrumentation.d.ts","names":[],"sources":["../../../../src/instrumentations/web-vitals/WebVitalsInstrumentation/WebVitalsInstrumentation.ts"],"mappings":";;;;cAiNa,wBAAA,SAAiC,sBAAA;EAAA,iBAC3B,UAAA;EAAA,iBACA,YAAA;EAAA,iBACA,eAAA;EAAA,iBACA,YAAA;EAAA,iBACA,eAAA;EAAA,QAUT,yBAAA;EAAA,QACA,oBAAA;EAAA,QACA,UAAA;;IAIN,IAAA;IACA,IAAA;IACA,SAAA;IACA,WAAA;IACA,cAAA;IACA;EAAA,IACC,4BAAA;EAkBa,OAAA,CAAA;EAOT,MAAA,CAAA;EAAA,QA0HC,iBAAA;EAAA,QAgBA,sBAAA;EAAA,QAoBA,2BAAA;AAAA"}
1
+ {"version":3,"file":"WebVitalsInstrumentation.d.ts","names":[],"sources":["../../../../src/instrumentations/web-vitals/WebVitalsInstrumentation/WebVitalsInstrumentation.ts"],"mappings":";;;;cA8Ma,wBAAA,SAAiC,sBAAA;EAAA,iBAC3B,UAAA;EAAA,iBACA,YAAA;EAAA,iBACA,eAAA;EAAA,iBACA,YAAA;EAAA,iBACA,eAAA;EAAA,QAUT,yBAAA;EAAA,QACA,oBAAA;EAAA,QACA,UAAA;;IAIN,IAAA;IACA,IAAA;IACA,SAAA;IACA,WAAA;IACA,cAAA;IACA;EAAA,IACC,4BAAA;EAkBa,OAAA,CAAA;EAOT,MAAA,CAAA;EAAA,QA0HC,iBAAA;EAAA,QAgBA,sBAAA;EAAA,QAoBA,2BAAA;AAAA"}