@depup/datadog__browser-rum 6.31.0-depup.0

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 (688) hide show
  1. package/LICENSE +201 -0
  2. package/README.md +25 -0
  3. package/bundle/chunks/profiler-9f1c1103f1ef0aa98257-datadog-rum.js +1 -0
  4. package/bundle/chunks/recorder-926b641c6ef51d09a378-datadog-rum.js +1 -0
  5. package/bundle/datadog-rum.js +1 -0
  6. package/changes.json +5 -0
  7. package/cjs/boot/isBrowserSupported.d.ts +4 -0
  8. package/cjs/boot/isBrowserSupported.js +17 -0
  9. package/cjs/boot/isBrowserSupported.js.map +1 -0
  10. package/cjs/boot/lazyLoadProfiler.d.ts +3 -0
  11. package/cjs/boot/lazyLoadProfiler.js +56 -0
  12. package/cjs/boot/lazyLoadProfiler.js.map +1 -0
  13. package/cjs/boot/lazyLoadRecorder.d.ts +3 -0
  14. package/cjs/boot/lazyLoadRecorder.js +56 -0
  15. package/cjs/boot/lazyLoadRecorder.js.map +1 -0
  16. package/cjs/boot/postStartStrategy.d.ts +33 -0
  17. package/cjs/boot/postStartStrategy.js +98 -0
  18. package/cjs/boot/postStartStrategy.js.map +1 -0
  19. package/cjs/boot/preStartStrategy.d.ts +6 -0
  20. package/cjs/boot/preStartStrategy.js +24 -0
  21. package/cjs/boot/preStartStrategy.js.map +1 -0
  22. package/cjs/boot/profilerApi.d.ts +2 -0
  23. package/cjs/boot/profilerApi.js +52 -0
  24. package/cjs/boot/profilerApi.js.map +1 -0
  25. package/cjs/boot/recorderApi.d.ts +3 -0
  26. package/cjs/boot/recorderApi.js +71 -0
  27. package/cjs/boot/recorderApi.js.map +1 -0
  28. package/cjs/boot/startRecording.d.ts +6 -0
  29. package/cjs/boot/startRecording.js +45 -0
  30. package/cjs/boot/startRecording.js.map +1 -0
  31. package/cjs/domain/deflate/deflateEncoder.d.ts +3 -0
  32. package/cjs/domain/deflate/deflateEncoder.js +110 -0
  33. package/cjs/domain/deflate/deflateEncoder.js.map +1 -0
  34. package/cjs/domain/deflate/deflateWorker.d.ts +29 -0
  35. package/cjs/domain/deflate/deflateWorker.js +105 -0
  36. package/cjs/domain/deflate/deflateWorker.js.map +1 -0
  37. package/cjs/domain/deflate/index.d.ts +3 -0
  38. package/cjs/domain/deflate/index.js +11 -0
  39. package/cjs/domain/deflate/index.js.map +1 -0
  40. package/cjs/domain/getSessionReplayLink.d.ts +2 -0
  41. package/cjs/domain/getSessionReplayLink.js +35 -0
  42. package/cjs/domain/getSessionReplayLink.js.map +1 -0
  43. package/cjs/domain/profiling/actionHistory.d.ts +10 -0
  44. package/cjs/domain/profiling/actionHistory.js +49 -0
  45. package/cjs/domain/profiling/actionHistory.js.map +1 -0
  46. package/cjs/domain/profiling/longTaskHistory.d.ts +11 -0
  47. package/cjs/domain/profiling/longTaskHistory.js +28 -0
  48. package/cjs/domain/profiling/longTaskHistory.js.map +1 -0
  49. package/cjs/domain/profiling/profiler.d.ts +7 -0
  50. package/cjs/domain/profiling/profiler.js +267 -0
  51. package/cjs/domain/profiling/profiler.js.map +1 -0
  52. package/cjs/domain/profiling/profilingContext.d.ts +6 -0
  53. package/cjs/domain/profiling/profilingContext.js +31 -0
  54. package/cjs/domain/profiling/profilingContext.js.map +1 -0
  55. package/cjs/domain/profiling/profilingSupported.d.ts +1 -0
  56. package/cjs/domain/profiling/profilingSupported.js +11 -0
  57. package/cjs/domain/profiling/profilingSupported.js.map +1 -0
  58. package/cjs/domain/profiling/test-utils/mockedTrace.d.ts +3 -0
  59. package/cjs/domain/profiling/test-utils/mockedTrace.js +57 -0
  60. package/cjs/domain/profiling/test-utils/mockedTrace.js.map +1 -0
  61. package/cjs/domain/profiling/transport/assembly.d.ts +7 -0
  62. package/cjs/domain/profiling/transport/assembly.js +45 -0
  63. package/cjs/domain/profiling/transport/assembly.js.map +1 -0
  64. package/cjs/domain/profiling/transport/buildProfileEventAttributes.d.ts +33 -0
  65. package/cjs/domain/profiling/transport/buildProfileEventAttributes.js +63 -0
  66. package/cjs/domain/profiling/transport/buildProfileEventAttributes.js.map +1 -0
  67. package/cjs/domain/profiling/types/index.d.ts +2 -0
  68. package/cjs/domain/profiling/types/index.js +3 -0
  69. package/cjs/domain/profiling/types/index.js.map +1 -0
  70. package/cjs/domain/profiling/types/profilerApi.types.d.ts +58 -0
  71. package/cjs/domain/profiling/types/profilerApi.types.js +5 -0
  72. package/cjs/domain/profiling/types/profilerApi.types.js.map +1 -0
  73. package/cjs/domain/profiling/types/rumProfiler.types.d.ts +55 -0
  74. package/cjs/domain/profiling/types/rumProfiler.types.js +3 -0
  75. package/cjs/domain/profiling/types/rumProfiler.types.js.map +1 -0
  76. package/cjs/domain/profiling/utils/getCustomOrDefaultViewName.d.ts +1 -0
  77. package/cjs/domain/profiling/utils/getCustomOrDefaultViewName.js +7 -0
  78. package/cjs/domain/profiling/utils/getCustomOrDefaultViewName.js.map +1 -0
  79. package/cjs/domain/profiling/utils/getDefaultViewName.d.ts +1 -0
  80. package/cjs/domain/profiling/utils/getDefaultViewName.js +14 -0
  81. package/cjs/domain/profiling/utils/getDefaultViewName.js.map +1 -0
  82. package/cjs/domain/profiling/utils/getNumberOfSamples.d.ts +8 -0
  83. package/cjs/domain/profiling/utils/getNumberOfSamples.js +19 -0
  84. package/cjs/domain/profiling/utils/getNumberOfSamples.js.map +1 -0
  85. package/cjs/domain/profiling/vitalHistory.d.ts +10 -0
  86. package/cjs/domain/profiling/vitalHistory.js +42 -0
  87. package/cjs/domain/profiling/vitalHistory.js.map +1 -0
  88. package/cjs/domain/record/assembly.d.ts +3 -0
  89. package/cjs/domain/record/assembly.js +16 -0
  90. package/cjs/domain/record/assembly.js.map +1 -0
  91. package/cjs/domain/record/elementsScrollPositions.d.ts +10 -0
  92. package/cjs/domain/record/elementsScrollPositions.js +23 -0
  93. package/cjs/domain/record/elementsScrollPositions.js.map +1 -0
  94. package/cjs/domain/record/eventsUtils.d.ts +2 -0
  95. package/cjs/domain/record/eventsUtils.js +15 -0
  96. package/cjs/domain/record/eventsUtils.js.map +1 -0
  97. package/cjs/domain/record/index.d.ts +6 -0
  98. package/cjs/domain/record/index.js +17 -0
  99. package/cjs/domain/record/index.js.map +1 -0
  100. package/cjs/domain/record/internalApi.d.ts +22 -0
  101. package/cjs/domain/record/internalApi.js +55 -0
  102. package/cjs/domain/record/internalApi.js.map +1 -0
  103. package/cjs/domain/record/itemIds.d.ts +40 -0
  104. package/cjs/domain/record/itemIds.js +58 -0
  105. package/cjs/domain/record/itemIds.js.map +1 -0
  106. package/cjs/domain/record/mutationBatch.d.ts +12 -0
  107. package/cjs/domain/record/mutationBatch.js +44 -0
  108. package/cjs/domain/record/mutationBatch.js.map +1 -0
  109. package/cjs/domain/record/record.d.ts +16 -0
  110. package/cjs/domain/record/record.js +88 -0
  111. package/cjs/domain/record/record.js.map +1 -0
  112. package/cjs/domain/record/record.types.d.ts +18 -0
  113. package/cjs/domain/record/record.types.js +3 -0
  114. package/cjs/domain/record/record.types.js.map +1 -0
  115. package/cjs/domain/record/recordingScope.d.ts +24 -0
  116. package/cjs/domain/record/recordingScope.js +29 -0
  117. package/cjs/domain/record/recordingScope.js.map +1 -0
  118. package/cjs/domain/record/serialization/changeEncoder.d.ts +22 -0
  119. package/cjs/domain/record/serialization/changeEncoder.js +59 -0
  120. package/cjs/domain/record/serialization/changeEncoder.js.map +1 -0
  121. package/cjs/domain/record/serialization/conversions/changeConverter.d.ts +10 -0
  122. package/cjs/domain/record/serialization/conversions/changeConverter.js +216 -0
  123. package/cjs/domain/record/serialization/conversions/changeConverter.js.map +1 -0
  124. package/cjs/domain/record/serialization/conversions/changeDecoder.d.ts +16 -0
  125. package/cjs/domain/record/serialization/conversions/changeDecoder.js +137 -0
  126. package/cjs/domain/record/serialization/conversions/changeDecoder.js.map +1 -0
  127. package/cjs/domain/record/serialization/conversions/index.d.ts +7 -0
  128. package/cjs/domain/record/serialization/conversions/index.js +11 -0
  129. package/cjs/domain/record/serialization/conversions/index.js.map +1 -0
  130. package/cjs/domain/record/serialization/conversions/mutationLog.d.ts +15 -0
  131. package/cjs/domain/record/serialization/conversions/mutationLog.js +36 -0
  132. package/cjs/domain/record/serialization/conversions/mutationLog.js.map +1 -0
  133. package/cjs/domain/record/serialization/conversions/nodeIdRemapper.d.ts +10 -0
  134. package/cjs/domain/record/serialization/conversions/nodeIdRemapper.js +53 -0
  135. package/cjs/domain/record/serialization/conversions/nodeIdRemapper.js.map +1 -0
  136. package/cjs/domain/record/serialization/conversions/renderOptions.d.ts +6 -0
  137. package/cjs/domain/record/serialization/conversions/renderOptions.js +12 -0
  138. package/cjs/domain/record/serialization/conversions/renderOptions.js.map +1 -0
  139. package/cjs/domain/record/serialization/conversions/stringTable.d.ts +5 -0
  140. package/cjs/domain/record/serialization/conversions/stringTable.js +22 -0
  141. package/cjs/domain/record/serialization/conversions/stringTable.js.map +1 -0
  142. package/cjs/domain/record/serialization/conversions/vDocument.d.ts +23 -0
  143. package/cjs/domain/record/serialization/conversions/vDocument.js +176 -0
  144. package/cjs/domain/record/serialization/conversions/vDocument.js.map +1 -0
  145. package/cjs/domain/record/serialization/conversions/vNode.d.ts +66 -0
  146. package/cjs/domain/record/serialization/conversions/vNode.js +285 -0
  147. package/cjs/domain/record/serialization/conversions/vNode.js.map +1 -0
  148. package/cjs/domain/record/serialization/conversions/vStyleSheet.d.ts +16 -0
  149. package/cjs/domain/record/serialization/conversions/vStyleSheet.js +29 -0
  150. package/cjs/domain/record/serialization/conversions/vStyleSheet.js.map +1 -0
  151. package/cjs/domain/record/serialization/experimentalFeatures.d.ts +2 -0
  152. package/cjs/domain/record/serialization/experimentalFeatures.js +16 -0
  153. package/cjs/domain/record/serialization/experimentalFeatures.js.map +1 -0
  154. package/cjs/domain/record/serialization/index.d.ts +17 -0
  155. package/cjs/domain/record/serialization/index.js +37 -0
  156. package/cjs/domain/record/serialization/index.js.map +1 -0
  157. package/cjs/domain/record/serialization/insertionCursor.d.ts +57 -0
  158. package/cjs/domain/record/serialization/insertionCursor.js +68 -0
  159. package/cjs/domain/record/serialization/insertionCursor.js.map +1 -0
  160. package/cjs/domain/record/serialization/serialization.types.d.ts +24 -0
  161. package/cjs/domain/record/serialization/serialization.types.js +3 -0
  162. package/cjs/domain/record/serialization/serialization.types.js.map +1 -0
  163. package/cjs/domain/record/serialization/serializationStats.d.ts +12 -0
  164. package/cjs/domain/record/serialization/serializationStats.js +32 -0
  165. package/cjs/domain/record/serialization/serializationStats.js.map +1 -0
  166. package/cjs/domain/record/serialization/serializationTransaction.d.ts +96 -0
  167. package/cjs/domain/record/serialization/serializationTransaction.js +103 -0
  168. package/cjs/domain/record/serialization/serializationTransaction.js.map +1 -0
  169. package/cjs/domain/record/serialization/serializationUtils.d.ts +18 -0
  170. package/cjs/domain/record/serialization/serializationUtils.js +88 -0
  171. package/cjs/domain/record/serialization/serializationUtils.js.map +1 -0
  172. package/cjs/domain/record/serialization/serializeAttribute.d.ts +4 -0
  173. package/cjs/domain/record/serialization/serializeAttribute.js +42 -0
  174. package/cjs/domain/record/serialization/serializeAttribute.js.map +1 -0
  175. package/cjs/domain/record/serialization/serializeAttributes.d.ts +7 -0
  176. package/cjs/domain/record/serialization/serializeAttributes.js +167 -0
  177. package/cjs/domain/record/serialization/serializeAttributes.js.map +1 -0
  178. package/cjs/domain/record/serialization/serializeFullSnapshot.d.ts +5 -0
  179. package/cjs/domain/record/serialization/serializeFullSnapshot.js +34 -0
  180. package/cjs/domain/record/serialization/serializeFullSnapshot.js.map +1 -0
  181. package/cjs/domain/record/serialization/serializeFullSnapshotAsChange.d.ts +5 -0
  182. package/cjs/domain/record/serialization/serializeFullSnapshotAsChange.js +13 -0
  183. package/cjs/domain/record/serialization/serializeFullSnapshotAsChange.js.map +1 -0
  184. package/cjs/domain/record/serialization/serializeMutations.d.ts +11 -0
  185. package/cjs/domain/record/serialization/serializeMutations.js +262 -0
  186. package/cjs/domain/record/serialization/serializeMutations.js.map +1 -0
  187. package/cjs/domain/record/serialization/serializeMutationsAsChange.d.ts +5 -0
  188. package/cjs/domain/record/serialization/serializeMutationsAsChange.js +204 -0
  189. package/cjs/domain/record/serialization/serializeMutationsAsChange.js.map +1 -0
  190. package/cjs/domain/record/serialization/serializeNode.d.ts +7 -0
  191. package/cjs/domain/record/serialization/serializeNode.js +154 -0
  192. package/cjs/domain/record/serialization/serializeNode.js.map +1 -0
  193. package/cjs/domain/record/serialization/serializeNodeAsChange.d.ts +4 -0
  194. package/cjs/domain/record/serialization/serializeNodeAsChange.js +153 -0
  195. package/cjs/domain/record/serialization/serializeNodeAsChange.js.map +1 -0
  196. package/cjs/domain/record/serialization/serializeStyleSheets.d.ts +3 -0
  197. package/cjs/domain/record/serialization/serializeStyleSheets.js +30 -0
  198. package/cjs/domain/record/serialization/serializeStyleSheets.js.map +1 -0
  199. package/cjs/domain/record/serializationVerifier.d.ts +18 -0
  200. package/cjs/domain/record/serializationVerifier.js +126 -0
  201. package/cjs/domain/record/serializationVerifier.js.map +1 -0
  202. package/cjs/domain/record/shadowRootsController.d.ts +11 -0
  203. package/cjs/domain/record/shadowRootsController.js +45 -0
  204. package/cjs/domain/record/shadowRootsController.js.map +1 -0
  205. package/cjs/domain/record/startFullSnapshots.d.ts +10 -0
  206. package/cjs/domain/record/startFullSnapshots.js +50 -0
  207. package/cjs/domain/record/startFullSnapshots.js.map +1 -0
  208. package/cjs/domain/record/trackers/index.d.ts +12 -0
  209. package/cjs/domain/record/trackers/index.js +27 -0
  210. package/cjs/domain/record/trackers/index.js.map +1 -0
  211. package/cjs/domain/record/trackers/trackFocus.d.ts +5 -0
  212. package/cjs/domain/record/trackers/trackFocus.js +15 -0
  213. package/cjs/domain/record/trackers/trackFocus.js.map +1 -0
  214. package/cjs/domain/record/trackers/trackFrustration.d.ts +6 -0
  215. package/cjs/domain/record/trackers/trackFrustration.js +31 -0
  216. package/cjs/domain/record/trackers/trackFrustration.js.map +1 -0
  217. package/cjs/domain/record/trackers/trackInput.d.ts +4 -0
  218. package/cjs/domain/record/trackers/trackInput.js +104 -0
  219. package/cjs/domain/record/trackers/trackInput.js.map +1 -0
  220. package/cjs/domain/record/trackers/trackMediaInteraction.d.ts +5 -0
  221. package/cjs/domain/record/trackers/trackMediaInteraction.js +29 -0
  222. package/cjs/domain/record/trackers/trackMediaInteraction.js.map +1 -0
  223. package/cjs/domain/record/trackers/trackMouseInteraction.d.ts +5 -0
  224. package/cjs/domain/record/trackers/trackMouseInteraction.js +59 -0
  225. package/cjs/domain/record/trackers/trackMouseInteraction.js.map +1 -0
  226. package/cjs/domain/record/trackers/trackMove.d.ts +9 -0
  227. package/cjs/domain/record/trackers/trackMove.js +55 -0
  228. package/cjs/domain/record/trackers/trackMove.js.map +1 -0
  229. package/cjs/domain/record/trackers/trackMutation.d.ts +13 -0
  230. package/cjs/domain/record/trackers/trackMutation.js +41 -0
  231. package/cjs/domain/record/trackers/trackMutation.js.map +1 -0
  232. package/cjs/domain/record/trackers/trackScroll.d.ts +5 -0
  233. package/cjs/domain/record/trackers/trackScroll.js +48 -0
  234. package/cjs/domain/record/trackers/trackScroll.js.map +1 -0
  235. package/cjs/domain/record/trackers/trackStyleSheet.d.ts +6 -0
  236. package/cjs/domain/record/trackers/trackStyleSheet.js +89 -0
  237. package/cjs/domain/record/trackers/trackStyleSheet.js.map +1 -0
  238. package/cjs/domain/record/trackers/trackViewEnd.d.ts +5 -0
  239. package/cjs/domain/record/trackers/trackViewEnd.js +20 -0
  240. package/cjs/domain/record/trackers/trackViewEnd.js.map +1 -0
  241. package/cjs/domain/record/trackers/trackViewportResize.d.ts +6 -0
  242. package/cjs/domain/record/trackers/trackViewportResize.js +46 -0
  243. package/cjs/domain/record/trackers/trackViewportResize.js.map +1 -0
  244. package/cjs/domain/record/trackers/tracker.types.d.ts +3 -0
  245. package/cjs/domain/record/trackers/tracker.types.js +3 -0
  246. package/cjs/domain/record/trackers/tracker.types.js.map +1 -0
  247. package/cjs/domain/record/viewports.d.ts +20 -0
  248. package/cjs/domain/record/viewports.js +60 -0
  249. package/cjs/domain/record/viewports.js.map +1 -0
  250. package/cjs/domain/replayStats.d.ts +8 -0
  251. package/cjs/domain/replayStats.js +60 -0
  252. package/cjs/domain/replayStats.js.map +1 -0
  253. package/cjs/domain/scriptLoadingError.d.ts +6 -0
  254. package/cjs/domain/scriptLoadingError.js +26 -0
  255. package/cjs/domain/scriptLoadingError.js.map +1 -0
  256. package/cjs/domain/segmentCollection/buildReplayPayload.d.ts +15 -0
  257. package/cjs/domain/segmentCollection/buildReplayPayload.js +26 -0
  258. package/cjs/domain/segmentCollection/buildReplayPayload.js.map +1 -0
  259. package/cjs/domain/segmentCollection/index.d.ts +4 -0
  260. package/cjs/domain/segmentCollection/index.js +11 -0
  261. package/cjs/domain/segmentCollection/index.js.map +1 -0
  262. package/cjs/domain/segmentCollection/segment.d.ts +16 -0
  263. package/cjs/domain/segmentCollection/segment.js +82 -0
  264. package/cjs/domain/segmentCollection/segment.js.map +1 -0
  265. package/cjs/domain/segmentCollection/segmentCollection.d.ts +31 -0
  266. package/cjs/domain/segmentCollection/segmentCollection.js +113 -0
  267. package/cjs/domain/segmentCollection/segmentCollection.js.map +1 -0
  268. package/cjs/domain/segmentCollection/startSegmentTelemetry.d.ts +6 -0
  269. package/cjs/domain/segmentCollection/startSegmentTelemetry.js +52 -0
  270. package/cjs/domain/segmentCollection/startSegmentTelemetry.js.map +1 -0
  271. package/cjs/domain/startRecordBridge.d.ts +5 -0
  272. package/cjs/domain/startRecordBridge.js +17 -0
  273. package/cjs/domain/startRecordBridge.js.map +1 -0
  274. package/cjs/domain/startRecorderInitTelemetry.d.ts +15 -0
  275. package/cjs/domain/startRecorderInitTelemetry.js +55 -0
  276. package/cjs/domain/startRecorderInitTelemetry.js.map +1 -0
  277. package/cjs/entries/internal.d.ts +11 -0
  278. package/cjs/entries/internal.js +28 -0
  279. package/cjs/entries/internal.js.map +1 -0
  280. package/cjs/entries/internalSynthetics.d.ts +2 -0
  281. package/cjs/entries/internalSynthetics.js +27 -0
  282. package/cjs/entries/internalSynthetics.js.map +1 -0
  283. package/cjs/entries/main.d.ts +23 -0
  284. package/cjs/entries/main.js +35 -0
  285. package/cjs/entries/main.js.map +1 -0
  286. package/cjs/types/index.d.ts +3 -0
  287. package/cjs/types/index.js +18 -0
  288. package/cjs/types/index.js.map +1 -0
  289. package/cjs/types/profiling.d.ts +296 -0
  290. package/cjs/types/profiling.js +6 -0
  291. package/cjs/types/profiling.js.map +1 -0
  292. package/cjs/types/sessionReplay.d.ts +934 -0
  293. package/cjs/types/sessionReplay.js +6 -0
  294. package/cjs/types/sessionReplay.js.map +1 -0
  295. package/cjs/types/sessionReplayConstants.d.ts +71 -0
  296. package/cjs/types/sessionReplayConstants.js +67 -0
  297. package/cjs/types/sessionReplayConstants.js.map +1 -0
  298. package/esm/boot/isBrowserSupported.d.ts +4 -0
  299. package/esm/boot/isBrowserSupported.js +14 -0
  300. package/esm/boot/isBrowserSupported.js.map +1 -0
  301. package/esm/boot/lazyLoadProfiler.d.ts +3 -0
  302. package/esm/boot/lazyLoadProfiler.js +19 -0
  303. package/esm/boot/lazyLoadProfiler.js.map +1 -0
  304. package/esm/boot/lazyLoadRecorder.d.ts +3 -0
  305. package/esm/boot/lazyLoadRecorder.js +19 -0
  306. package/esm/boot/lazyLoadRecorder.js.map +1 -0
  307. package/esm/boot/postStartStrategy.d.ts +33 -0
  308. package/esm/boot/postStartStrategy.js +95 -0
  309. package/esm/boot/postStartStrategy.js.map +1 -0
  310. package/esm/boot/preStartStrategy.d.ts +6 -0
  311. package/esm/boot/preStartStrategy.js +21 -0
  312. package/esm/boot/preStartStrategy.js.map +1 -0
  313. package/esm/boot/profilerApi.d.ts +2 -0
  314. package/esm/boot/profilerApi.js +49 -0
  315. package/esm/boot/profilerApi.js.map +1 -0
  316. package/esm/boot/recorderApi.d.ts +3 -0
  317. package/esm/boot/recorderApi.js +68 -0
  318. package/esm/boot/recorderApi.js.map +1 -0
  319. package/esm/boot/startRecording.d.ts +6 -0
  320. package/esm/boot/startRecording.js +42 -0
  321. package/esm/boot/startRecording.js.map +1 -0
  322. package/esm/domain/deflate/deflateEncoder.d.ts +3 -0
  323. package/esm/domain/deflate/deflateEncoder.js +107 -0
  324. package/esm/domain/deflate/deflateEncoder.js.map +1 -0
  325. package/esm/domain/deflate/deflateWorker.d.ts +29 -0
  326. package/esm/domain/deflate/deflateWorker.js +97 -0
  327. package/esm/domain/deflate/deflateWorker.js.map +1 -0
  328. package/esm/domain/deflate/index.d.ts +3 -0
  329. package/esm/domain/deflate/index.js +3 -0
  330. package/esm/domain/deflate/index.js.map +1 -0
  331. package/esm/domain/getSessionReplayLink.d.ts +2 -0
  332. package/esm/domain/getSessionReplayLink.js +32 -0
  333. package/esm/domain/getSessionReplayLink.js.map +1 -0
  334. package/esm/domain/profiling/actionHistory.d.ts +10 -0
  335. package/esm/domain/profiling/actionHistory.js +45 -0
  336. package/esm/domain/profiling/actionHistory.js.map +1 -0
  337. package/esm/domain/profiling/longTaskHistory.d.ts +11 -0
  338. package/esm/domain/profiling/longTaskHistory.js +24 -0
  339. package/esm/domain/profiling/longTaskHistory.js.map +1 -0
  340. package/esm/domain/profiling/profiler.d.ts +7 -0
  341. package/esm/domain/profiling/profiler.js +263 -0
  342. package/esm/domain/profiling/profiler.js.map +1 -0
  343. package/esm/domain/profiling/profilingContext.d.ts +6 -0
  344. package/esm/domain/profiling/profilingContext.js +28 -0
  345. package/esm/domain/profiling/profilingContext.js.map +1 -0
  346. package/esm/domain/profiling/profilingSupported.d.ts +1 -0
  347. package/esm/domain/profiling/profilingSupported.js +8 -0
  348. package/esm/domain/profiling/profilingSupported.js.map +1 -0
  349. package/esm/domain/profiling/test-utils/mockedTrace.d.ts +3 -0
  350. package/esm/domain/profiling/test-utils/mockedTrace.js +54 -0
  351. package/esm/domain/profiling/test-utils/mockedTrace.js.map +1 -0
  352. package/esm/domain/profiling/transport/assembly.d.ts +7 -0
  353. package/esm/domain/profiling/transport/assembly.js +42 -0
  354. package/esm/domain/profiling/transport/assembly.js.map +1 -0
  355. package/esm/domain/profiling/transport/buildProfileEventAttributes.d.ts +33 -0
  356. package/esm/domain/profiling/transport/buildProfileEventAttributes.js +60 -0
  357. package/esm/domain/profiling/transport/buildProfileEventAttributes.js.map +1 -0
  358. package/esm/domain/profiling/types/index.d.ts +2 -0
  359. package/esm/domain/profiling/types/index.js +2 -0
  360. package/esm/domain/profiling/types/index.js.map +1 -0
  361. package/esm/domain/profiling/types/profilerApi.types.d.ts +58 -0
  362. package/esm/domain/profiling/types/profilerApi.types.js +4 -0
  363. package/esm/domain/profiling/types/profilerApi.types.js.map +1 -0
  364. package/esm/domain/profiling/types/rumProfiler.types.d.ts +55 -0
  365. package/esm/domain/profiling/types/rumProfiler.types.js +2 -0
  366. package/esm/domain/profiling/types/rumProfiler.types.js.map +1 -0
  367. package/esm/domain/profiling/utils/getCustomOrDefaultViewName.d.ts +1 -0
  368. package/esm/domain/profiling/utils/getCustomOrDefaultViewName.js +3 -0
  369. package/esm/domain/profiling/utils/getCustomOrDefaultViewName.js.map +1 -0
  370. package/esm/domain/profiling/utils/getDefaultViewName.d.ts +1 -0
  371. package/esm/domain/profiling/utils/getDefaultViewName.js +11 -0
  372. package/esm/domain/profiling/utils/getDefaultViewName.js.map +1 -0
  373. package/esm/domain/profiling/utils/getNumberOfSamples.d.ts +8 -0
  374. package/esm/domain/profiling/utils/getNumberOfSamples.js +16 -0
  375. package/esm/domain/profiling/utils/getNumberOfSamples.js.map +1 -0
  376. package/esm/domain/profiling/vitalHistory.d.ts +10 -0
  377. package/esm/domain/profiling/vitalHistory.js +38 -0
  378. package/esm/domain/profiling/vitalHistory.js.map +1 -0
  379. package/esm/domain/record/assembly.d.ts +3 -0
  380. package/esm/domain/record/assembly.js +13 -0
  381. package/esm/domain/record/assembly.js.map +1 -0
  382. package/esm/domain/record/elementsScrollPositions.d.ts +10 -0
  383. package/esm/domain/record/elementsScrollPositions.js +20 -0
  384. package/esm/domain/record/elementsScrollPositions.js.map +1 -0
  385. package/esm/domain/record/eventsUtils.d.ts +2 -0
  386. package/esm/domain/record/eventsUtils.js +11 -0
  387. package/esm/domain/record/eventsUtils.js.map +1 -0
  388. package/esm/domain/record/index.d.ts +6 -0
  389. package/esm/domain/record/index.js +5 -0
  390. package/esm/domain/record/index.js.map +1 -0
  391. package/esm/domain/record/internalApi.d.ts +22 -0
  392. package/esm/domain/record/internalApi.js +51 -0
  393. package/esm/domain/record/internalApi.js.map +1 -0
  394. package/esm/domain/record/itemIds.d.ts +40 -0
  395. package/esm/domain/record/itemIds.js +52 -0
  396. package/esm/domain/record/itemIds.js.map +1 -0
  397. package/esm/domain/record/mutationBatch.d.ts +12 -0
  398. package/esm/domain/record/mutationBatch.js +40 -0
  399. package/esm/domain/record/mutationBatch.js.map +1 -0
  400. package/esm/domain/record/record.d.ts +16 -0
  401. package/esm/domain/record/record.js +52 -0
  402. package/esm/domain/record/record.js.map +1 -0
  403. package/esm/domain/record/record.types.d.ts +18 -0
  404. package/esm/domain/record/record.types.js +2 -0
  405. package/esm/domain/record/record.types.js.map +1 -0
  406. package/esm/domain/record/recordingScope.d.ts +24 -0
  407. package/esm/domain/record/recordingScope.js +26 -0
  408. package/esm/domain/record/recordingScope.js.map +1 -0
  409. package/esm/domain/record/serialization/changeEncoder.d.ts +22 -0
  410. package/esm/domain/record/serialization/changeEncoder.js +56 -0
  411. package/esm/domain/record/serialization/changeEncoder.js.map +1 -0
  412. package/esm/domain/record/serialization/conversions/changeConverter.d.ts +10 -0
  413. package/esm/domain/record/serialization/conversions/changeConverter.js +213 -0
  414. package/esm/domain/record/serialization/conversions/changeConverter.js.map +1 -0
  415. package/esm/domain/record/serialization/conversions/changeDecoder.d.ts +16 -0
  416. package/esm/domain/record/serialization/conversions/changeDecoder.js +134 -0
  417. package/esm/domain/record/serialization/conversions/changeDecoder.js.map +1 -0
  418. package/esm/domain/record/serialization/conversions/index.d.ts +7 -0
  419. package/esm/domain/record/serialization/conversions/index.js +4 -0
  420. package/esm/domain/record/serialization/conversions/index.js.map +1 -0
  421. package/esm/domain/record/serialization/conversions/mutationLog.d.ts +15 -0
  422. package/esm/domain/record/serialization/conversions/mutationLog.js +33 -0
  423. package/esm/domain/record/serialization/conversions/mutationLog.js.map +1 -0
  424. package/esm/domain/record/serialization/conversions/nodeIdRemapper.d.ts +10 -0
  425. package/esm/domain/record/serialization/conversions/nodeIdRemapper.js +49 -0
  426. package/esm/domain/record/serialization/conversions/nodeIdRemapper.js.map +1 -0
  427. package/esm/domain/record/serialization/conversions/renderOptions.d.ts +6 -0
  428. package/esm/domain/record/serialization/conversions/renderOptions.js +9 -0
  429. package/esm/domain/record/serialization/conversions/renderOptions.js.map +1 -0
  430. package/esm/domain/record/serialization/conversions/stringTable.d.ts +5 -0
  431. package/esm/domain/record/serialization/conversions/stringTable.js +19 -0
  432. package/esm/domain/record/serialization/conversions/stringTable.js.map +1 -0
  433. package/esm/domain/record/serialization/conversions/vDocument.d.ts +23 -0
  434. package/esm/domain/record/serialization/conversions/vDocument.js +173 -0
  435. package/esm/domain/record/serialization/conversions/vDocument.js.map +1 -0
  436. package/esm/domain/record/serialization/conversions/vNode.d.ts +66 -0
  437. package/esm/domain/record/serialization/conversions/vNode.js +282 -0
  438. package/esm/domain/record/serialization/conversions/vNode.js.map +1 -0
  439. package/esm/domain/record/serialization/conversions/vStyleSheet.d.ts +16 -0
  440. package/esm/domain/record/serialization/conversions/vStyleSheet.js +26 -0
  441. package/esm/domain/record/serialization/conversions/vStyleSheet.js.map +1 -0
  442. package/esm/domain/record/serialization/experimentalFeatures.d.ts +2 -0
  443. package/esm/domain/record/serialization/experimentalFeatures.js +12 -0
  444. package/esm/domain/record/serialization/experimentalFeatures.js.map +1 -0
  445. package/esm/domain/record/serialization/index.d.ts +17 -0
  446. package/esm/domain/record/serialization/index.js +14 -0
  447. package/esm/domain/record/serialization/index.js.map +1 -0
  448. package/esm/domain/record/serialization/insertionCursor.d.ts +57 -0
  449. package/esm/domain/record/serialization/insertionCursor.js +64 -0
  450. package/esm/domain/record/serialization/insertionCursor.js.map +1 -0
  451. package/esm/domain/record/serialization/serialization.types.d.ts +24 -0
  452. package/esm/domain/record/serialization/serialization.types.js +2 -0
  453. package/esm/domain/record/serialization/serialization.types.js.map +1 -0
  454. package/esm/domain/record/serialization/serializationStats.d.ts +12 -0
  455. package/esm/domain/record/serialization/serializationStats.js +27 -0
  456. package/esm/domain/record/serialization/serializationStats.js.map +1 -0
  457. package/esm/domain/record/serialization/serializationTransaction.d.ts +96 -0
  458. package/esm/domain/record/serialization/serializationTransaction.js +99 -0
  459. package/esm/domain/record/serialization/serializationTransaction.js.map +1 -0
  460. package/esm/domain/record/serialization/serializationUtils.d.ts +18 -0
  461. package/esm/domain/record/serialization/serializationUtils.js +80 -0
  462. package/esm/domain/record/serialization/serializationUtils.js.map +1 -0
  463. package/esm/domain/record/serialization/serializeAttribute.d.ts +4 -0
  464. package/esm/domain/record/serialization/serializeAttribute.js +38 -0
  465. package/esm/domain/record/serialization/serializeAttribute.js.map +1 -0
  466. package/esm/domain/record/serialization/serializeAttributes.d.ts +7 -0
  467. package/esm/domain/record/serialization/serializeAttributes.js +161 -0
  468. package/esm/domain/record/serialization/serializeAttributes.js.map +1 -0
  469. package/esm/domain/record/serialization/serializeFullSnapshot.d.ts +5 -0
  470. package/esm/domain/record/serialization/serializeFullSnapshot.js +31 -0
  471. package/esm/domain/record/serialization/serializeFullSnapshot.js.map +1 -0
  472. package/esm/domain/record/serialization/serializeFullSnapshotAsChange.d.ts +5 -0
  473. package/esm/domain/record/serialization/serializeFullSnapshotAsChange.js +10 -0
  474. package/esm/domain/record/serialization/serializeFullSnapshotAsChange.js.map +1 -0
  475. package/esm/domain/record/serialization/serializeMutations.d.ts +11 -0
  476. package/esm/domain/record/serialization/serializeMutations.js +257 -0
  477. package/esm/domain/record/serialization/serializeMutations.js.map +1 -0
  478. package/esm/domain/record/serialization/serializeMutationsAsChange.d.ts +5 -0
  479. package/esm/domain/record/serialization/serializeMutationsAsChange.js +201 -0
  480. package/esm/domain/record/serialization/serializeMutationsAsChange.js.map +1 -0
  481. package/esm/domain/record/serialization/serializeNode.d.ts +7 -0
  482. package/esm/domain/record/serialization/serializeNode.js +149 -0
  483. package/esm/domain/record/serialization/serializeNode.js.map +1 -0
  484. package/esm/domain/record/serialization/serializeNodeAsChange.d.ts +4 -0
  485. package/esm/domain/record/serialization/serializeNodeAsChange.js +150 -0
  486. package/esm/domain/record/serialization/serializeNodeAsChange.js.map +1 -0
  487. package/esm/domain/record/serialization/serializeStyleSheets.d.ts +3 -0
  488. package/esm/domain/record/serialization/serializeStyleSheets.js +27 -0
  489. package/esm/domain/record/serialization/serializeStyleSheets.js.map +1 -0
  490. package/esm/domain/record/serializationVerifier.d.ts +18 -0
  491. package/esm/domain/record/serializationVerifier.js +123 -0
  492. package/esm/domain/record/serializationVerifier.js.map +1 -0
  493. package/esm/domain/record/shadowRootsController.d.ts +11 -0
  494. package/esm/domain/record/shadowRootsController.js +41 -0
  495. package/esm/domain/record/shadowRootsController.js.map +1 -0
  496. package/esm/domain/record/startFullSnapshots.d.ts +10 -0
  497. package/esm/domain/record/startFullSnapshots.js +46 -0
  498. package/esm/domain/record/startFullSnapshots.js.map +1 -0
  499. package/esm/domain/record/trackers/index.d.ts +12 -0
  500. package/esm/domain/record/trackers/index.js +12 -0
  501. package/esm/domain/record/trackers/index.js.map +1 -0
  502. package/esm/domain/record/trackers/trackFocus.d.ts +5 -0
  503. package/esm/domain/record/trackers/trackFocus.js +12 -0
  504. package/esm/domain/record/trackers/trackFocus.js.map +1 -0
  505. package/esm/domain/record/trackers/trackFrustration.d.ts +6 -0
  506. package/esm/domain/record/trackers/trackFrustration.js +28 -0
  507. package/esm/domain/record/trackers/trackFrustration.js.map +1 -0
  508. package/esm/domain/record/trackers/trackInput.d.ts +4 -0
  509. package/esm/domain/record/trackers/trackInput.js +101 -0
  510. package/esm/domain/record/trackers/trackInput.js.map +1 -0
  511. package/esm/domain/record/trackers/trackMediaInteraction.d.ts +5 -0
  512. package/esm/domain/record/trackers/trackMediaInteraction.js +26 -0
  513. package/esm/domain/record/trackers/trackMediaInteraction.js.map +1 -0
  514. package/esm/domain/record/trackers/trackMouseInteraction.d.ts +5 -0
  515. package/esm/domain/record/trackers/trackMouseInteraction.js +56 -0
  516. package/esm/domain/record/trackers/trackMouseInteraction.js.map +1 -0
  517. package/esm/domain/record/trackers/trackMove.d.ts +9 -0
  518. package/esm/domain/record/trackers/trackMove.js +51 -0
  519. package/esm/domain/record/trackers/trackMove.js.map +1 -0
  520. package/esm/domain/record/trackers/trackMutation.d.ts +13 -0
  521. package/esm/domain/record/trackers/trackMutation.js +38 -0
  522. package/esm/domain/record/trackers/trackMutation.js.map +1 -0
  523. package/esm/domain/record/trackers/trackScroll.d.ts +5 -0
  524. package/esm/domain/record/trackers/trackScroll.js +45 -0
  525. package/esm/domain/record/trackers/trackScroll.js.map +1 -0
  526. package/esm/domain/record/trackers/trackStyleSheet.d.ts +6 -0
  527. package/esm/domain/record/trackers/trackStyleSheet.js +85 -0
  528. package/esm/domain/record/trackers/trackStyleSheet.js.map +1 -0
  529. package/esm/domain/record/trackers/trackViewEnd.d.ts +5 -0
  530. package/esm/domain/record/trackers/trackViewEnd.js +17 -0
  531. package/esm/domain/record/trackers/trackViewEnd.js.map +1 -0
  532. package/esm/domain/record/trackers/trackViewportResize.d.ts +6 -0
  533. package/esm/domain/record/trackers/trackViewportResize.js +42 -0
  534. package/esm/domain/record/trackers/trackViewportResize.js.map +1 -0
  535. package/esm/domain/record/trackers/tracker.types.d.ts +3 -0
  536. package/esm/domain/record/trackers/tracker.types.js +2 -0
  537. package/esm/domain/record/trackers/tracker.types.js.map +1 -0
  538. package/esm/domain/record/viewports.d.ts +20 -0
  539. package/esm/domain/record/viewports.js +55 -0
  540. package/esm/domain/record/viewports.js.map +1 -0
  541. package/esm/domain/replayStats.d.ts +8 -0
  542. package/esm/domain/replayStats.js +51 -0
  543. package/esm/domain/replayStats.js.map +1 -0
  544. package/esm/domain/scriptLoadingError.d.ts +6 -0
  545. package/esm/domain/scriptLoadingError.js +23 -0
  546. package/esm/domain/scriptLoadingError.js.map +1 -0
  547. package/esm/domain/segmentCollection/buildReplayPayload.d.ts +15 -0
  548. package/esm/domain/segmentCollection/buildReplayPayload.js +23 -0
  549. package/esm/domain/segmentCollection/buildReplayPayload.js.map +1 -0
  550. package/esm/domain/segmentCollection/index.d.ts +4 -0
  551. package/esm/domain/segmentCollection/index.js +4 -0
  552. package/esm/domain/segmentCollection/index.js.map +1 -0
  553. package/esm/domain/segmentCollection/segment.d.ts +16 -0
  554. package/esm/domain/segmentCollection/segment.js +46 -0
  555. package/esm/domain/segmentCollection/segment.js.map +1 -0
  556. package/esm/domain/segmentCollection/segmentCollection.d.ts +31 -0
  557. package/esm/domain/segmentCollection/segmentCollection.js +106 -0
  558. package/esm/domain/segmentCollection/segmentCollection.js.map +1 -0
  559. package/esm/domain/segmentCollection/startSegmentTelemetry.d.ts +6 -0
  560. package/esm/domain/segmentCollection/startSegmentTelemetry.js +49 -0
  561. package/esm/domain/segmentCollection/startSegmentTelemetry.js.map +1 -0
  562. package/esm/domain/startRecordBridge.d.ts +5 -0
  563. package/esm/domain/startRecordBridge.js +14 -0
  564. package/esm/domain/startRecordBridge.js.map +1 -0
  565. package/esm/domain/startRecorderInitTelemetry.d.ts +15 -0
  566. package/esm/domain/startRecorderInitTelemetry.js +52 -0
  567. package/esm/domain/startRecorderInitTelemetry.js.map +1 -0
  568. package/esm/entries/internal.d.ts +11 -0
  569. package/esm/entries/internal.js +4 -0
  570. package/esm/entries/internal.js.map +1 -0
  571. package/esm/entries/internalSynthetics.d.ts +2 -0
  572. package/esm/entries/internalSynthetics.js +23 -0
  573. package/esm/entries/internalSynthetics.js.map +1 -0
  574. package/esm/entries/main.d.ts +23 -0
  575. package/esm/entries/main.js +31 -0
  576. package/esm/entries/main.js.map +1 -0
  577. package/esm/types/index.d.ts +3 -0
  578. package/esm/types/index.js +2 -0
  579. package/esm/types/index.js.map +1 -0
  580. package/esm/types/profiling.d.ts +296 -0
  581. package/esm/types/profiling.js +5 -0
  582. package/esm/types/profiling.js.map +1 -0
  583. package/esm/types/sessionReplay.d.ts +934 -0
  584. package/esm/types/sessionReplay.js +5 -0
  585. package/esm/types/sessionReplay.js.map +1 -0
  586. package/esm/types/sessionReplayConstants.d.ts +71 -0
  587. package/esm/types/sessionReplayConstants.js +64 -0
  588. package/esm/types/sessionReplayConstants.js.map +1 -0
  589. package/internal/package.json +6 -0
  590. package/internal-synthetics/package.json +6 -0
  591. package/package.json +52 -0
  592. package/src/boot/isBrowserSupported.ts +14 -0
  593. package/src/boot/lazyLoadProfiler.ts +20 -0
  594. package/src/boot/lazyLoadRecorder.ts +20 -0
  595. package/src/boot/postStartStrategy.ts +176 -0
  596. package/src/boot/preStartStrategy.ts +34 -0
  597. package/src/boot/profilerApi.ts +82 -0
  598. package/src/boot/recorderApi.ts +113 -0
  599. package/src/boot/startRecording.ts +70 -0
  600. package/src/domain/deflate/deflateEncoder.ts +144 -0
  601. package/src/domain/deflate/deflateWorker.ts +152 -0
  602. package/src/domain/deflate/index.ts +9 -0
  603. package/src/domain/getSessionReplayLink.ts +40 -0
  604. package/src/domain/profiling/actionHistory.ts +65 -0
  605. package/src/domain/profiling/longTaskHistory.ts +40 -0
  606. package/src/domain/profiling/profiler.ts +366 -0
  607. package/src/domain/profiling/profilingContext.ts +39 -0
  608. package/src/domain/profiling/profilingSupported.ts +10 -0
  609. package/src/domain/profiling/test-utils/mockedTrace.ts +58 -0
  610. package/src/domain/profiling/transport/assembly.ts +63 -0
  611. package/src/domain/profiling/transport/buildProfileEventAttributes.ts +106 -0
  612. package/src/domain/profiling/types/index.ts +2 -0
  613. package/src/domain/profiling/types/profilerApi.types.ts +87 -0
  614. package/src/domain/profiling/types/rumProfiler.types.ts +62 -0
  615. package/src/domain/profiling/utils/getCustomOrDefaultViewName.ts +4 -0
  616. package/src/domain/profiling/utils/getDefaultViewName.ts +12 -0
  617. package/src/domain/profiling/utils/getNumberOfSamples.ts +17 -0
  618. package/src/domain/profiling/vitalHistory.ts +58 -0
  619. package/src/domain/record/assembly.ts +19 -0
  620. package/src/domain/record/elementsScrollPositions.ts +28 -0
  621. package/src/domain/record/eventsUtils.ts +12 -0
  622. package/src/domain/record/index.ts +12 -0
  623. package/src/domain/record/internalApi.ts +84 -0
  624. package/src/domain/record/itemIds.ts +97 -0
  625. package/src/domain/record/mutationBatch.ts +47 -0
  626. package/src/domain/record/record.ts +90 -0
  627. package/src/domain/record/record.types.ts +22 -0
  628. package/src/domain/record/recordingScope.ts +58 -0
  629. package/src/domain/record/serialization/changeEncoder.ts +89 -0
  630. package/src/domain/record/serialization/conversions/changeConverter.ts +277 -0
  631. package/src/domain/record/serialization/conversions/changeDecoder.ts +192 -0
  632. package/src/domain/record/serialization/conversions/index.ts +7 -0
  633. package/src/domain/record/serialization/conversions/mutationLog.ts +56 -0
  634. package/src/domain/record/serialization/conversions/nodeIdRemapper.ts +69 -0
  635. package/src/domain/record/serialization/conversions/renderOptions.ts +14 -0
  636. package/src/domain/record/serialization/conversions/stringTable.ts +25 -0
  637. package/src/domain/record/serialization/conversions/vDocument.ts +239 -0
  638. package/src/domain/record/serialization/conversions/vNode.ts +417 -0
  639. package/src/domain/record/serialization/conversions/vStyleSheet.ts +47 -0
  640. package/src/domain/record/serialization/experimentalFeatures.ts +15 -0
  641. package/src/domain/record/serialization/index.ts +21 -0
  642. package/src/domain/record/serialization/insertionCursor.ts +131 -0
  643. package/src/domain/record/serialization/serialization.types.ts +38 -0
  644. package/src/domain/record/serialization/serializationStats.ts +43 -0
  645. package/src/domain/record/serialization/serializationTransaction.ts +255 -0
  646. package/src/domain/record/serialization/serializationUtils.ts +103 -0
  647. package/src/domain/record/serialization/serializeAttribute.ts +55 -0
  648. package/src/domain/record/serialization/serializeAttributes.ts +194 -0
  649. package/src/domain/record/serialization/serializeFullSnapshot.ts +46 -0
  650. package/src/domain/record/serialization/serializeFullSnapshotAsChange.ts +33 -0
  651. package/src/domain/record/serialization/serializeMutations.ts +395 -0
  652. package/src/domain/record/serialization/serializeMutationsAsChange.ts +298 -0
  653. package/src/domain/record/serialization/serializeNode.ts +229 -0
  654. package/src/domain/record/serialization/serializeNodeAsChange.ts +237 -0
  655. package/src/domain/record/serialization/serializeStyleSheets.ts +36 -0
  656. package/src/domain/record/serializationVerifier.ts +208 -0
  657. package/src/domain/record/shadowRootsController.ts +62 -0
  658. package/src/domain/record/startFullSnapshots.ts +92 -0
  659. package/src/domain/record/trackers/index.ts +12 -0
  660. package/src/domain/record/trackers/trackFocus.ts +16 -0
  661. package/src/domain/record/trackers/trackFrustration.ts +39 -0
  662. package/src/domain/record/trackers/trackInput.ts +128 -0
  663. package/src/domain/record/trackers/trackMediaInteraction.ts +43 -0
  664. package/src/domain/record/trackers/trackMouseInteraction.ts +74 -0
  665. package/src/domain/record/trackers/trackMove.ts +78 -0
  666. package/src/domain/record/trackers/trackMutation.ts +74 -0
  667. package/src/domain/record/trackers/trackScroll.ts +61 -0
  668. package/src/domain/record/trackers/trackStyleSheet.ts +117 -0
  669. package/src/domain/record/trackers/trackViewEnd.ts +27 -0
  670. package/src/domain/record/trackers/trackViewportResize.ts +69 -0
  671. package/src/domain/record/trackers/tracker.types.ts +3 -0
  672. package/src/domain/record/viewports.ts +68 -0
  673. package/src/domain/replayStats.ts +61 -0
  674. package/src/domain/scriptLoadingError.ts +36 -0
  675. package/src/domain/segmentCollection/buildReplayPayload.ts +52 -0
  676. package/src/domain/segmentCollection/index.ts +4 -0
  677. package/src/domain/segmentCollection/segment.ts +79 -0
  678. package/src/domain/segmentCollection/segmentCollection.ts +200 -0
  679. package/src/domain/segmentCollection/startSegmentTelemetry.ts +91 -0
  680. package/src/domain/startRecordBridge.ts +17 -0
  681. package/src/domain/startRecorderInitTelemetry.ts +90 -0
  682. package/src/entries/internal.ts +18 -0
  683. package/src/entries/internalSynthetics.ts +24 -0
  684. package/src/entries/main.ts +96 -0
  685. package/src/types/index.ts +3 -0
  686. package/src/types/profiling.ts +298 -0
  687. package/src/types/sessionReplay.ts +990 -0
  688. package/src/types/sessionReplayConstants.ts +130 -0
@@ -0,0 +1 @@
1
+ {"version":3,"file":"vNode.js","sourceRoot":"","sources":["../../../../../src/domain/record/serialization/conversions/vNode.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,aAAa,EAAE,QAAQ,EAAE,MAAM,mBAAmB,CAAA;AAgF3D,MAAM,UAAU,WAAW,CAAC,QAAmB,EAAE,EAAU,EAAE,IAAe;IAC1E,IAAI,KAAK,GAAe,KAAK,CAAA;IAE7B,MAAM,wBAAwB,GAAG,GAAS,EAAE;QAC1C,IAAI,IAAI,CAAC,KAAK,KAAK,WAAW,EAAE,CAAC;YAC/B,MAAM,IAAI,KAAK,CAAC,iBAAiB,IAAI,CAAC,EAAE,yBAAyB,IAAI,CAAC,KAAK,EAAE,CAAC,CAAA;QAChF,CAAC;QAED,KAAK,MAAM,UAAU,IAAI,CAAC,YAAY,EAAE,WAAW,EAAE,iBAAiB,EAAE,aAAa,EAAE,QAAQ,CAAU,EAAE,CAAC;YAC1G,MAAM,aAAa,GAAG,IAAI,CAAC,UAAU,CAAC,CAAA;YACtC,IAAI,aAAa,IAAI,aAAa,CAAC,KAAK,KAAK,WAAW,EAAE,CAAC;gBACzD,MAAM,IAAI,KAAK,CAAC,iBAAiB,IAAI,CAAC,EAAE,MAAM,UAAU,yBAAyB,aAAa,CAAC,KAAK,EAAE,CAAC,CAAA;YACzG,CAAC;QACH,CAAC;IACH,CAAC,CAAA;IAED,MAAM,IAAI,GAAU;QAClB,KAAK,CAAC,IAAW;;YACf,IAAI,CAAC,MAAM,GAAG,IAAI,CAAC,MAAM,CAAA;YACzB,IAAI,CAAC,eAAe,GAAG,IAAI,CAAA;YAE3B,IAAI,IAAI,CAAC,WAAW,EAAE,CAAC;gBACrB,IAAI,CAAC,WAAW,CAAC,eAAe,GAAG,IAAI,CAAA;YACzC,CAAC;YACD,IAAI,CAAC,WA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gBAEH,KAAK,OAAO;oBACV,OAAO;wBACL,IAAI,EAAE,QAAQ,CAAC,IAAI;wBACnB,EAAE;wBACF,WAAW,EAAE,IAAI,CAAC,WAAW;qBAC9B,CAAA;gBAEH;oBACE,IAAoB,CAAA;oBACpB,MAAM,IAAI,KAAK,CAAC,iCAAiC,IAAI,CAAC,IAAI,CAAC,IAAI,SAAS,EAAE,EAAE,CAAC,CAAA;YACjF,CAAC;QACH,CAAC;QAED,IAAI,IAAI;YACN,OAAO,IAAI,CAAA;QACb,CAAC;QACD,IAAI,aAAa;YACf,OAAO,QAAQ,CAAA;QACjB,CAAC;QACD,IAAI,EAAE;YACJ,OAAO,EAAE,CAAA;QACX,CAAC;QAED,IAAI,KAAK;YACP,OAAO,KAAK,CAAA;QACd,CAAC;QACD,IAAI,KAAK,CAAC,KAAiB;YACzB,IACE,CAAC,KAAK,KAAK,KAAK,IAAI,KAAK,KAAK,WAAW,CAAC;gBAC1C,CAAC,KAAK,KAAK,WAAW,IAAI,KAAK,KAAK,cAAc,CAAC;gBACnD,KAAK,KAAK,cAAc,EACxB,CAAC;gBACD,MAAM,IAAI,KAAK,CAAC,iCAAiC,KAAK,OAAO,KAAK,EAAE,CAAC,CAAA;YACvE,CAAC;YACD,KAAK,GAAG,KAAK,CAAA;QACf,CAAC;QAED,UAAU,EAAE,SAAS;QACrB,SAAS,EAAE,SAAS;QACpB,eAAe,EAAE,SAAS;QAC1B,WAAW,EAAE,SAAS;QACtB,MAAM,EAAE,SAAS;KAClB,CAAA;IAED,OAAO,IAAI,CAAA;AACb,CAAC"}
@@ -0,0 +1,16 @@
1
+ import type { StyleSheet } from '../../../../types';
2
+ import type { StyleSheetId } from '../../itemIds';
3
+ import type { VDocument } from './vDocument';
4
+ export interface VStyleSheet {
5
+ renderAsAdoptedStyleSheet(): StyleSheet;
6
+ renderAsCssText(): string;
7
+ get data(): VStyleSheetData;
8
+ get id(): StyleSheetId;
9
+ get ownerDocument(): VDocument;
10
+ }
11
+ export interface VStyleSheetData {
12
+ disabled: boolean;
13
+ mediaList: string[];
14
+ rules: string | string[];
15
+ }
16
+ export declare function createVStyleSheet(document: VDocument, id: StyleSheetId, data: VStyleSheetData): VStyleSheet;
@@ -0,0 +1,26 @@
1
+ export function createVStyleSheet(document, id, data) {
2
+ const self = {
3
+ renderAsAdoptedStyleSheet() {
4
+ const cssRules = typeof data.rules === 'string' ? [data.rules] : data.rules;
5
+ return {
6
+ cssRules,
7
+ disabled: data.disabled ? true : undefined,
8
+ media: data.mediaList.length > 0 ? data.mediaList : undefined,
9
+ };
10
+ },
11
+ renderAsCssText() {
12
+ return typeof data.rules === 'string' ? data.rules : data.rules.join('');
13
+ },
14
+ get data() {
15
+ return data;
16
+ },
17
+ get id() {
18
+ return id;
19
+ },
20
+ get ownerDocument() {
21
+ return document;
22
+ },
23
+ };
24
+ return self;
25
+ }
26
+ //# sourceMappingURL=vStyleSheet.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"vStyleSheet.js","sourceRoot":"","sources":["../../../../../src/domain/record/serialization/conversions/vStyleSheet.ts"],"names":[],"mappings":"AAmBA,MAAM,UAAU,iBAAiB,CAAC,QAAmB,EAAE,EAAgB,EAAE,IAAqB;IAC5F,MAAM,IAAI,GAAgB;QACxB,yBAAyB;YACvB,MAAM,QAAQ,GAAG,OAAO,IAAI,CAAC,KAAK,KAAK,QAAQ,CAAC,CAAC,CAAC,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC,IAAI,CAAC,KAAK,CAAA;YAC3E,OAAO;gBACL,QAAQ;gBACR,QAAQ,EAAE,IAAI,CAAC,QAAQ,CAAC,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,SAAS;gBAC1C,KAAK,EAAE,IAAI,CAAC,SAAS,CAAC,MAAM,GAAG,CAAC,CAAC,CAAC,CAAC,IAAI,CAAC,SAAS,CAAC,CAAC,CAAC,SAAS;aAC9D,CAAA;QACH,CAAC;QAED,eAAe;YACb,OAAO,OAAO,IAAI,CAAC,KAAK,KAAK,QAAQ,CAAC,CAAC,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC,CAAC,IAAI,CAAC,KAAK,CAAC,IAAI,CAAC,EAAE,CAAC,CAAA;QAC1E,CAAC;QAED,IAAI,IAAI;YACN,OAAO,IAAI,CAAA;QACb,CAAC;QACD,IAAI,EAAE;YACJ,OAAO,EAAE,CAAA;QACX,CAAC;QACD,IAAI,aAAa;YACf,OAAO,QAAQ,CAAA;QACjB,CAAC;KACF,CAAA;IAED,OAAO,IAAI,CAAA;AACb,CAAC"}
@@ -0,0 +1,2 @@
1
+ export declare function isFullSnapshotChangeRecordsEnabled(): boolean;
2
+ export declare function isIncrementalSnapshotChangeRecordsEnabled(): boolean;
@@ -0,0 +1,12 @@
1
+ import { ExperimentalFeature, isExperimentalFeatureEnabled } from '@datadog/browser-core';
2
+ export function isFullSnapshotChangeRecordsEnabled() {
3
+ // We don't want to have to support the case where full snapshots use the old format and
4
+ // incremental snapshots use the new one, so we should generate full snapshot Change
5
+ // records if either feature flag is enabled.
6
+ return (isExperimentalFeatureEnabled(ExperimentalFeature.USE_CHANGE_RECORDS) ||
7
+ isExperimentalFeatureEnabled(ExperimentalFeature.USE_INCREMENTAL_CHANGE_RECORDS));
8
+ }
9
+ export function isIncrementalSnapshotChangeRecordsEnabled() {
10
+ return isExperimentalFeatureEnabled(ExperimentalFeature.USE_INCREMENTAL_CHANGE_RECORDS);
11
+ }
12
+ //# sourceMappingURL=experimentalFeatures.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"experimentalFeatures.js","sourceRoot":"","sources":["../../../../src/domain/record/serialization/experimentalFeatures.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,mBAAmB,EAAE,4BAA4B,EAAE,MAAM,uBAAuB,CAAA;AAEzF,MAAM,UAAU,kCAAkC;IAChD,wFAAwF;IACxF,oFAAoF;IACpF,6CAA6C;IAC7C,OAAO,CACL,4BAA4B,CAAC,mBAAmB,CAAC,kBAAkB,CAAC;QACpE,4BAA4B,CAAC,mBAAmB,CAAC,8BAA8B,CAAC,CACjF,CAAA;AACH,CAAC;AAED,MAAM,UAAU,yCAAyC;IACvD,OAAO,4BAA4B,CAAC,mBAAmB,CAAC,8BAA8B,CAAC,CAAA;AACzF,CAAC"}
@@ -0,0 +1,17 @@
1
+ export type { ChangeConverter, MutationLog, NodeIdRemapper } from './conversions';
2
+ export { createChangeConverter, createCopyingNodeIdRemapper, createIdentityNodeIdRemapper } from './conversions';
3
+ export { isFullSnapshotChangeRecordsEnabled, isIncrementalSnapshotChangeRecordsEnabled } from './experimentalFeatures';
4
+ export { createChildInsertionCursor, createRootInsertionCursor } from './insertionCursor';
5
+ export { getElementInputValue } from './serializationUtils';
6
+ export { serializeFullSnapshot } from './serializeFullSnapshot';
7
+ export { serializeFullSnapshotAsChange } from './serializeFullSnapshotAsChange';
8
+ export { serializeMutations } from './serializeMutations';
9
+ export { serializeMutationsAsChange } from './serializeMutationsAsChange';
10
+ export { serializeNode } from './serializeNode';
11
+ export { serializeNodeAsChange } from './serializeNodeAsChange';
12
+ export { serializeAttribute } from './serializeAttribute';
13
+ export { createSerializationStats, updateSerializationStats, aggregateSerializationStats } from './serializationStats';
14
+ export type { SerializationMetric, SerializationStats } from './serializationStats';
15
+ export { serializeChangesInTransaction, serializeInTransaction, SerializationKind } from './serializationTransaction';
16
+ export type { ChangeSerializationTransaction, SerializationTransaction, SerializationTransactionCallback, } from './serializationTransaction';
17
+ export type { ParentNodePrivacyLevel } from './serialization.types';
@@ -0,0 +1,14 @@
1
+ export { createChangeConverter, createCopyingNodeIdRemapper, createIdentityNodeIdRemapper } from './conversions';
2
+ export { isFullSnapshotChangeRecordsEnabled, isIncrementalSnapshotChangeRecordsEnabled } from './experimentalFeatures';
3
+ export { createChildInsertionCursor, createRootInsertionCursor } from './insertionCursor';
4
+ export { getElementInputValue } from './serializationUtils';
5
+ export { serializeFullSnapshot } from './serializeFullSnapshot';
6
+ export { serializeFullSnapshotAsChange } from './serializeFullSnapshotAsChange';
7
+ export { serializeMutations } from './serializeMutations';
8
+ export { serializeMutationsAsChange } from './serializeMutationsAsChange';
9
+ export { serializeNode } from './serializeNode';
10
+ export { serializeNodeAsChange } from './serializeNodeAsChange';
11
+ export { serializeAttribute } from './serializeAttribute';
12
+ export { createSerializationStats, updateSerializationStats, aggregateSerializationStats } from './serializationStats';
13
+ export { serializeChangesInTransaction, serializeInTransaction } from './serializationTransaction';
14
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../src/domain/record/serialization/index.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,qBAAqB,EAAE,2BAA2B,EAAE,4BAA4B,EAAE,MAAM,eAAe,CAAA;AAChH,OAAO,EAAE,kCAAkC,EAAE,yCAAyC,EAAE,MAAM,wBAAwB,CAAA;AACtH,OAAO,EAAE,0BAA0B,EAAE,yBAAyB,EAAE,MAAM,mBAAmB,CAAA;AACzF,OAAO,EAAE,oBAAoB,EAAE,MAAM,sBAAsB,CAAA;AAC3D,OAAO,EAAE,qBAAqB,EAAE,MAAM,yBAAyB,CAAA;AAC/D,OAAO,EAAE,6BAA6B,EAAE,MAAM,iCAAiC,CAAA;AAC/E,OAAO,EAAE,kBAAkB,EAAE,MAAM,sBAAsB,CAAA;AACzD,OAAO,EAAE,0BAA0B,EAAE,MAAM,8BAA8B,CAAA;AACzE,OAAO,EAAE,aAAa,EAAE,MAAM,iBAAiB,CAAA;AAC/C,OAAO,EAAE,qBAAqB,EAAE,MAAM,yBAAyB,CAAA;AAC/D,OAAO,EAAE,kBAAkB,EAAE,MAAM,sBAAsB,CAAA;AACzD,OAAO,EAAE,wBAAwB,EAAE,wBAAwB,EAAE,2BAA2B,EAAE,MAAM,sBAAsB,CAAA;AAEtH,OAAO,EAAE,6BAA6B,EAAE,sBAAsB,EAAqB,MAAM,4BAA4B,CAAA"}
@@ -0,0 +1,57 @@
1
+ import type { InsertionPoint } from '../../../types';
2
+ import type { NodeId, NodeIds } from '../itemIds';
3
+ /**
4
+ * InsertionCursor tracks the point at which the next node will be inserted during
5
+ * Change-style DOM serialization.
6
+ *
7
+ * When a new node is added to the document, we use an InsertionPoint to encode its
8
+ * position. There are often multiple equally-valid ways to express the same insertion
9
+ * point; we generally want to favor encodings that use as few characters as possible (to
10
+ * reduce uncompressed size) and that are as repetitive as possible (to reduce compressed
11
+ * size). InsertionCursor's purpose is to heuristically pick an efficient encoding based
12
+ * on the nodes we've recently serialized, while doing as little work as possible. The
13
+ * results are not optimal, but should be close to it in most situations.
14
+ *
15
+ * At the beginning of the serialization process, use a factory function like
16
+ * createRootInsertionCursor() to create a new cursor with an appropriate initial
17
+ * position.
18
+ *
19
+ * When visiting a node, the expected usage pattern is as follows:
20
+ * 1. Call advance() to get a node id and insertion point for the node.
21
+ * 2. Serialize the node.
22
+ * 3. If the node has no children, we're done; continue to the node's next
23
+ * sibling and apply this algorithm again.
24
+ * 4. Otherwise, call descend() to move the cursor into the node's child list.
25
+ * 5. Recursively apply this algorithm.
26
+ * 6. Call ascend() to move the cursor out of the node's child list. We're done;
27
+ * continue to the node's next sibling and apply this algorithm again.
28
+ */
29
+ export interface InsertionCursor {
30
+ /**
31
+ * Given the node id for a new node, returns the InsertionPoint for that node.
32
+ * Updates the cursor to point to the new node's next sibling.
33
+ */
34
+ advance(node: Node): {
35
+ nodeId: NodeId;
36
+ insertionPoint: InsertionPoint;
37
+ };
38
+ /**
39
+ * Ascends out of the current child list and updates the cursor to point to the parent
40
+ * node's next sibling.
41
+ */
42
+ ascend(): void;
43
+ /**
44
+ * Descends into the child list of the last node we inserted and updates the cursor to
45
+ * point to the node's first child.
46
+ */
47
+ descend(): void;
48
+ }
49
+ /** Returns an InsertionCursor which starts positioned at the root of the document. */
50
+ export declare function createRootInsertionCursor(nodeIds: NodeIds): InsertionCursor;
51
+ /**
52
+ * Returns an InsertionCursor which starts positioned in the child list of the given
53
+ * parent node. If a next sibling is provided, the cursor points to the position
54
+ * immediately before the next sibling; otherwise, the cursor points to the end of the
55
+ * child list.
56
+ */
57
+ export declare function createChildInsertionCursor(parentId: NodeId, nextSiblingId: NodeId | undefined, nodeIds: NodeIds): InsertionCursor;
@@ -0,0 +1,64 @@
1
+ /** Returns an InsertionCursor which starts positioned at the root of the document. */
2
+ export function createRootInsertionCursor(nodeIds) {
3
+ return createInsertionCursor(undefined, undefined, nodeIds);
4
+ }
5
+ /**
6
+ * Returns an InsertionCursor which starts positioned in the child list of the given
7
+ * parent node. If a next sibling is provided, the cursor points to the position
8
+ * immediately before the next sibling; otherwise, the cursor points to the end of the
9
+ * child list.
10
+ */
11
+ export function createChildInsertionCursor(parentId, nextSiblingId, nodeIds) {
12
+ return createInsertionCursor(parentId, nextSiblingId, nodeIds);
13
+ }
14
+ function createInsertionCursor(parentId, nextSiblingId, nodeIds) {
15
+ let cursor = {
16
+ container: undefined,
17
+ parentId,
18
+ previousSiblingId: undefined,
19
+ nextSiblingId,
20
+ };
21
+ const computeInsertionPoint = (nodeId) => {
22
+ if (cursor.previousSiblingId === nodeId - 1) {
23
+ // Use an AppendAfterPreviousInsertionPoint. (i.e., 0)
24
+ return 0;
25
+ }
26
+ if (cursor.nextSiblingId !== undefined) {
27
+ // Use an InsertBeforeInsertionPoint. We identify the next sibling using a
28
+ // negative integer indicating the difference between the new node's id and its next
29
+ // sibling's id.
30
+ return cursor.nextSiblingId - nodeId;
31
+ }
32
+ if (cursor.parentId !== undefined) {
33
+ // Use an AppendChildInsertionPoint. We identify the parent node using a positive
34
+ // integer indicating the difference between the new node's id and its parent's id.
35
+ return nodeId - cursor.parentId;
36
+ }
37
+ // There's no parent. Use a RootInsertionPoint. (i.e., null)
38
+ return null;
39
+ };
40
+ return {
41
+ advance(node) {
42
+ const nodeId = nodeIds.getOrInsert(node);
43
+ const insertionPoint = computeInsertionPoint(nodeId);
44
+ cursor.previousSiblingId = nodeId;
45
+ return { nodeId, insertionPoint };
46
+ },
47
+ ascend() {
48
+ if (cursor.container) {
49
+ cursor = cursor.container;
50
+ }
51
+ },
52
+ descend() {
53
+ if (cursor.previousSiblingId !== undefined) {
54
+ cursor = {
55
+ container: cursor,
56
+ parentId: cursor.previousSiblingId,
57
+ previousSiblingId: undefined,
58
+ nextSiblingId: undefined,
59
+ };
60
+ }
61
+ },
62
+ };
63
+ }
64
+ //# sourceMappingURL=insertionCursor.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"insertionCursor.js","sourceRoot":"","sources":["../../../../src/domain/record/serialization/insertionCursor.ts"],"names":[],"mappings":"AAiDA,sFAAsF;AACtF,MAAM,UAAU,yBAAyB,CAAC,OAAgB;IACxD,OAAO,qBAAqB,CAAC,SAAS,EAAE,SAAS,EAAE,OAAO,CAAC,CAAA;AAC7D,CAAC;AAED;;;;;GAKG;AACH,MAAM,UAAU,0BAA0B,CACxC,QAAgB,EAChB,aAAiC,EACjC,OAAgB;IAEhB,OAAO,qBAAqB,CAAC,QAAQ,EAAE,aAAa,EAAE,OAAO,CAAC,CAAA;AAChE,CAAC;AAED,SAAS,qBAAqB,CAC5B,QAA4B,EAC5B,aAAiC,EACjC,OAAgB;IAShB,IAAI,MAAM,GAAoB;QAC5B,SAAS,EAAE,SAAS;QACpB,QAAQ;QACR,iBAAiB,EAAE,SAAS;QAC5B,aAAa;KACd,CAAA;IAED,MAAM,qBAAqB,GAAG,CAAC,MAAc,EAAkB,EAAE;QAC/D,IAAI,MAAM,CAAC,iBAAiB,KAAK,MAAM,GAAG,CAAC,EAAE,CAAC;YAC5C,sDAAsD;YACtD,OAAO,CAAC,CAAA;QACV,CAAC;QACD,IAAI,MAAM,CAAC,aAAa,KAAK,SAAS,EAAE,CAAC;YACvC,0EAA0E;YAC1E,oFAAoF;YACpF,gBAAgB;YAChB,OAAO,MAAM,CAAC,aAAa,GAAG,MAAM,CAAA;QACtC,CAAC;QACD,IAAI,MAAM,CAAC,QAAQ,KAAK,SAAS,EAAE,CAAC;YAClC,iFAAiF;YACjF,mFAAmF;YACnF,OAAO,MAAM,GAAG,MAAM,CAAC,QAAQ,CAAA;QACjC,CAAC;QACD,4DAA4D;QAC5D,OAAO,IAAI,CAAA;IACb,CAAC,CAAA;IAED,OAAO;QACL,OAAO,CAAC,IAAU;YAChB,MAAM,MAAM,GAAG,OAAO,CAAC,WAAW,CAAC,IAAI,CAAC,CAAA;YACxC,MAAM,cAAc,GAAG,qBAAqB,CAAC,MAAM,CAAC,CAAA;YACpD,MAAM,CAAC,iBAAiB,GAAG,MAAM,CAAA;YACjC,OAAO,EAAE,MAAM,EAAE,cAAc,EAAE,CAAA;QACnC,CAAC;QACD,MAAM;YACJ,IAAI,MAAM,CAAC,SAAS,EAAE,CAAC;gBACrB,MAAM,GAAG,MAAM,CAAC,SAAS,CAAA;YAC3B,CAAC;QACH,CAAC;QACD,OAAO;YACL,IAAI,MAAM,CAAC,iBAAiB,KAAK,SAAS,EAAE,CAAC;gBAC3C,MAAM,GAAG;oBACP,SAAS,EAAE,MAAM;oBACjB,QAAQ,EAAE,MAAM,CAAC,iBAAiB;oBAClC,iBAAiB,EAAE,SAAS;oBAC5B,aAAa,EAAE,SAAS;iBACzB,CAAA;YACH,CAAC;QACH,CAAC;KACF,CAAA;AACH,CAAC"}
@@ -0,0 +1,24 @@
1
+ import type { NodePrivacyLevel } from '@datadog/browser-rum-core';
2
+ export type ParentNodePrivacyLevel = typeof NodePrivacyLevel.ALLOW | typeof NodePrivacyLevel.MASK | typeof NodePrivacyLevel.MASK_USER_INPUT | typeof NodePrivacyLevel.MASK_UNLESS_ALLOWLISTED;
3
+ /**
4
+ * Virtual attributes. These attributes appear in the serialized attribute map of
5
+ * elements, but they're not actually derived from the DOM; they're used to represent
6
+ * metadata about the element they're attached to.
7
+ */
8
+ export interface VirtualAttributes {
9
+ /**
10
+ * For <style> and <link> elements, the rules in the element's stylesheet, extracted
11
+ * from the CSSOM.
12
+ */
13
+ _cssText?: string;
14
+ /** For <audio> and <video> elements, the playback state of the element's media. */
15
+ rr_mediaState?: 'paused' | 'played';
16
+ /** For elements which are scroll containers, the element's X scroll position, if non-zero. */
17
+ rr_scrollLeft?: number;
18
+ /** For elements which are scroll containers, the element's Y scroll position, if non-zero. */
19
+ rr_scrollTop?: number;
20
+ /** For HIDDEN elements, the width of the element's bounding client rect. */
21
+ rr_width?: string;
22
+ /** For HIDDEN elements, the height of the element's bounding client rect. */
23
+ rr_height?: string;
24
+ }
@@ -0,0 +1,2 @@
1
+ export {};
2
+ //# sourceMappingURL=serialization.types.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"serialization.types.js","sourceRoot":"","sources":["../../../../src/domain/record/serialization/serialization.types.ts"],"names":[],"mappings":""}
@@ -0,0 +1,12 @@
1
+ export interface SerializationMetric {
2
+ count: number;
3
+ max: number;
4
+ sum: number;
5
+ }
6
+ export interface SerializationStats {
7
+ cssText: SerializationMetric;
8
+ serializationDuration: SerializationMetric;
9
+ }
10
+ export declare function createSerializationStats(): SerializationStats;
11
+ export declare function updateSerializationStats(stats: SerializationStats, metric: keyof SerializationStats, value: number): void;
12
+ export declare function aggregateSerializationStats(aggregateStats: SerializationStats, stats: SerializationStats): void;
@@ -0,0 +1,27 @@
1
+ export function createSerializationStats() {
2
+ return {
3
+ cssText: {
4
+ count: 0,
5
+ max: 0,
6
+ sum: 0,
7
+ },
8
+ serializationDuration: {
9
+ count: 0,
10
+ max: 0,
11
+ sum: 0,
12
+ },
13
+ };
14
+ }
15
+ export function updateSerializationStats(stats, metric, value) {
16
+ stats[metric].count += 1;
17
+ stats[metric].max = Math.max(stats[metric].max, value);
18
+ stats[metric].sum += value;
19
+ }
20
+ export function aggregateSerializationStats(aggregateStats, stats) {
21
+ for (const metric of ['cssText', 'serializationDuration']) {
22
+ aggregateStats[metric].count += stats[metric].count;
23
+ aggregateStats[metric].max = Math.max(aggregateStats[metric].max, stats[metric].max);
24
+ aggregateStats[metric].sum += stats[metric].sum;
25
+ }
26
+ }
27
+ //# sourceMappingURL=serializationStats.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"serializationStats.js","sourceRoot":"","sources":["../../../../src/domain/record/serialization/serializationStats.ts"],"names":[],"mappings":"AAWA,MAAM,UAAU,wBAAwB;IACtC,OAAO;QACL,OAAO,EAAE;YACP,KAAK,EAAE,CAAC;YACR,GAAG,EAAE,CAAC;YACN,GAAG,EAAE,CAAC;SACP;QACD,qBAAqB,EAAE;YACrB,KAAK,EAAE,CAAC;YACR,GAAG,EAAE,CAAC;YACN,GAAG,EAAE,CAAC;SACP;KACF,CAAA;AACH,CAAC;AAED,MAAM,UAAU,wBAAwB,CACtC,KAAyB,EACzB,MAAgC,EAChC,KAAa;IAEb,KAAK,CAAC,MAAM,CAAC,CAAC,KAAK,IAAI,CAAC,CAAA;IACxB,KAAK,CAAC,MAAM,CAAC,CAAC,GAAG,GAAG,IAAI,CAAC,GAAG,CAAC,KAAK,CAAC,MAAM,CAAC,CAAC,GAAG,EAAE,KAAK,CAAC,CAAA;IACtD,KAAK,CAAC,MAAM,CAAC,CAAC,GAAG,IAAI,KAAK,CAAA;AAC5B,CAAC;AAED,MAAM,UAAU,2BAA2B,CAAC,cAAkC,EAAE,KAAyB;IACvG,KAAK,MAAM,MAAM,IAAI,CAAC,SAAS,EAAE,uBAAuB,CAAU,EAAE,CAAC;QACnE,cAAc,CAAC,MAAM,CAAC,CAAC,KAAK,IAAI,KAAK,CAAC,MAAM,CAAC,CAAC,KAAK,CAAA;QACnD,cAAc,CAAC,MAAM,CAAC,CAAC,GAAG,GAAG,IAAI,CAAC,GAAG,CAAC,cAAc,CAAC,MAAM,CAAC,CAAC,GAAG,EAAE,KAAK,CAAC,MAAM,CAAC,CAAC,GAAG,CAAC,CAAA;QACpF,cAAc,CAAC,MAAM,CAAC,CAAC,GAAG,IAAI,KAAK,CAAC,MAAM,CAAC,CAAC,GAAG,CAAA;IACjD,CAAC;AACH,CAAC"}
@@ -0,0 +1,96 @@
1
+ import type { TimeStamp } from '@datadog/browser-core';
2
+ import type { AddCDataSectionNodeChange, AddDocTypeNodeChange, AddDocumentFragmentNodeChange, AddDocumentNodeChange, AddElementNodeChange, AddNodeChange, AddShadowRootNodeChange, AddTextNodeChange, AttributeChange, BrowserRecord, InsertionPoint, MediaInteractionType, StyleSheetMediaList, StyleSheetRules } from '../../../types';
3
+ import type { NodeId, StyleSheetId } from '../itemIds';
4
+ import type { EmitRecordCallback, EmitStatsCallback } from '../record.types';
5
+ import type { RecordingScope } from '../recordingScope';
6
+ import type { SerializationStats } from './serializationStats';
7
+ export type SerializationTransactionCallback = (transaction: SerializationTransaction) => void;
8
+ export declare const enum SerializationKind {
9
+ INITIAL_FULL_SNAPSHOT = 0,
10
+ SUBSEQUENT_FULL_SNAPSHOT = 1,
11
+ INCREMENTAL_SNAPSHOT = 2
12
+ }
13
+ /**
14
+ * A serialization transaction is used to build and emit a sequence of session replay
15
+ * records containing a serialized snapshot of the DOM.
16
+ */
17
+ export interface SerializationTransaction {
18
+ /** Add a record to the transaction. It will be emitted when the transaction ends. */
19
+ add(record: BrowserRecord): void;
20
+ /**
21
+ * Add a metric to the transaction's statistics. The aggregated statistics will be
22
+ * emitted when the transaction ends.
23
+ */
24
+ addMetric(metric: keyof SerializationStats, value: number): void;
25
+ /**
26
+ * Assign and return an id to the given node. If the node has previously been assigned
27
+ * an id, the existing id will be reused.
28
+ */
29
+ assignId(node: Node): NodeId;
30
+ /** The kind of serialization being performed in this transaction. */
31
+ kind: SerializationKind;
32
+ /**
33
+ * A set used to track nodes which have been serialized in the current transaction. If
34
+ * undefined, this feature is disabled; this is the default state in new transactions
35
+ * for performance reasons. Set the property to a non-undefined value if you need this
36
+ * capability.
37
+ */
38
+ serializedNodeIds?: Set<NodeId>;
39
+ /** The recording scope in which this transaction is occurring. */
40
+ scope: RecordingScope;
41
+ }
42
+ /**
43
+ * Perform serialization within a transaction. At the end of the transaction, the
44
+ * generated records and statistics will be emitted.
45
+ */
46
+ export declare function serializeInTransaction(kind: SerializationKind, emitRecord: EmitRecordCallback, emitStats: EmitStatsCallback, scope: RecordingScope, serialize: SerializationTransactionCallback): void;
47
+ type AddNodeParams<NodeChange extends AddNodeChange> = NodeChange extends [any, any, ...infer Params] ? Params : never;
48
+ export type ChangeSerializationTransactionCallback = (transaction: ChangeSerializationTransaction) => void;
49
+ /**
50
+ * ChangeSerializationTransaction is used to build and emit a BrowserChangeRecord
51
+ * containing a serialized snapshot of the DOM. Unlike SerializationTransaction, it
52
+ * doesn't support emitting arbitrary BrowserRecords; instead, the builder methods it
53
+ * exposes are used to construct a single BrowserChangeRecord which is emitted at the end
54
+ * of the transaction.
55
+ */
56
+ export interface ChangeSerializationTransaction {
57
+ /**
58
+ * Add a metric to the transaction's statistics. The aggregated statistics will be
59
+ * emitted when the transaction ends.
60
+ */
61
+ addMetric(metric: keyof SerializationStats, value: number): void;
62
+ /** Add a node to the document at the given insertion point. */
63
+ addNode(pos: InsertionPoint, nodeName: '#cdata-section', ...params: AddNodeParams<AddCDataSectionNodeChange>): void;
64
+ addNode(pos: InsertionPoint, nodeName: '#doctype', ...params: AddNodeParams<AddDocTypeNodeChange>): void;
65
+ addNode(pos: InsertionPoint, nodeName: '#document', ...params: AddNodeParams<AddDocumentNodeChange>): void;
66
+ addNode(pos: InsertionPoint, nodeName: '#document-fragment', ...params: AddNodeParams<AddDocumentFragmentNodeChange>): void;
67
+ addNode(pos: InsertionPoint, nodeName: '#shadow-root', ...params: AddNodeParams<AddShadowRootNodeChange>): void;
68
+ addNode(pos: InsertionPoint, nodeName: '#text', ...params: AddNodeParams<AddTextNodeChange>): void;
69
+ addNode(pos: InsertionPoint, nodeName: Exclude<string, `#${string}`>, ...params: AddNodeParams<AddElementNodeChange>): void;
70
+ addNode(pos: InsertionPoint, nodeName: string, ...params: AddNodeParams<AddNodeChange>): void;
71
+ /** Add a stylesheet to the document. */
72
+ addStyleSheet(rules: StyleSheetRules, mediaList?: StyleSheetMediaList, disabled?: boolean): void;
73
+ /**
74
+ * Attach one or more stylesheets to a <link>, <style>, #document, #document-fragment,
75
+ * or #shadow-root node.
76
+ */
77
+ attachStyleSheets(nodeId: NodeId, sheetIds: StyleSheetId[]): void;
78
+ /** Remove a node from the document. */
79
+ removeNode(nodeId: NodeId): void;
80
+ /** Set a node's attributes to the given values. */
81
+ setAttributes(change: AttributeChange): void;
82
+ /** Set the media playback state of an <audio> or <video> element. */
83
+ setMediaPlaybackState(nodeId: NodeId, state: MediaInteractionType): void;
84
+ /** Set the given node's scroll position in CSS pixels. */
85
+ setScrollPosition(nodeId: NodeId, x: number, y: number): void;
86
+ /** Set the given node's size in CSS pixels. */
87
+ setSize(nodeId: NodeId, width: number, height: number): void;
88
+ /** Set the given node's text content. */
89
+ setText(nodeId: NodeId, content: string): void;
90
+ /** The kind of serialization being performed in this transaction. */
91
+ kind: SerializationKind;
92
+ /** The recording scope in which this transaction is occurring. */
93
+ scope: RecordingScope;
94
+ }
95
+ export declare function serializeChangesInTransaction(kind: SerializationKind, emitRecord: EmitRecordCallback, emitStats: EmitStatsCallback, scope: RecordingScope, timestamp: TimeStamp, serialize: ChangeSerializationTransactionCallback): void;
96
+ export {};
@@ -0,0 +1,99 @@
1
+ import { elapsed, timeStampNow } from '@datadog/browser-core';
2
+ import { ChangeType, RecordType } from '../../../types';
3
+ import { createSerializationStats, updateSerializationStats } from './serializationStats';
4
+ import { createChangeEncoder } from './changeEncoder';
5
+ /**
6
+ * Perform serialization within a transaction. At the end of the transaction, the
7
+ * generated records and statistics will be emitted.
8
+ */
9
+ export function serializeInTransaction(kind, emitRecord, emitStats, scope, serialize) {
10
+ const records = [];
11
+ const stats = createSerializationStats();
12
+ const transaction = {
13
+ add(record) {
14
+ records.push(record);
15
+ },
16
+ addMetric(metric, value) {
17
+ updateSerializationStats(stats, metric, value);
18
+ },
19
+ assignId(node) {
20
+ const id = scope.nodeIds.getOrInsert(node);
21
+ if (transaction.serializedNodeIds) {
22
+ transaction.serializedNodeIds.add(id);
23
+ }
24
+ return id;
25
+ },
26
+ kind,
27
+ scope,
28
+ };
29
+ const start = timeStampNow();
30
+ serialize(transaction);
31
+ updateSerializationStats(stats, 'serializationDuration', elapsed(start, timeStampNow()));
32
+ for (const record of records) {
33
+ emitRecord(record);
34
+ }
35
+ emitStats(stats);
36
+ }
37
+ export function serializeChangesInTransaction(kind, emitRecord, emitStats, scope, timestamp, serialize) {
38
+ const encoder = createChangeEncoder(scope.stringIds);
39
+ const stats = createSerializationStats();
40
+ const transaction = {
41
+ addMetric(metric, value) {
42
+ updateSerializationStats(stats, metric, value);
43
+ },
44
+ addNode(...change) {
45
+ encoder.add(ChangeType.AddNode, change);
46
+ },
47
+ addStyleSheet(rules, mediaList, disabled) {
48
+ if (disabled) {
49
+ encoder.add(ChangeType.AddStyleSheet, [rules, mediaList || [], disabled]);
50
+ }
51
+ else if (mediaList) {
52
+ encoder.add(ChangeType.AddStyleSheet, [rules, mediaList]);
53
+ }
54
+ else {
55
+ encoder.add(ChangeType.AddStyleSheet, [rules]);
56
+ }
57
+ },
58
+ attachStyleSheets(nodeId, sheetIds) {
59
+ const change = [nodeId];
60
+ for (const sheetId of sheetIds) {
61
+ change.push(sheetId);
62
+ }
63
+ encoder.add(ChangeType.AttachedStyleSheets, change);
64
+ },
65
+ removeNode(nodeId) {
66
+ encoder.add(ChangeType.RemoveNode, nodeId);
67
+ },
68
+ setAttributes(change) {
69
+ encoder.add(ChangeType.Attribute, change);
70
+ },
71
+ setMediaPlaybackState(nodeId, state) {
72
+ encoder.add(ChangeType.MediaPlaybackState, [nodeId, state]);
73
+ },
74
+ setScrollPosition(nodeId, x, y) {
75
+ encoder.add(ChangeType.ScrollPosition, [nodeId, x, y]);
76
+ },
77
+ setSize(nodeId, width, height) {
78
+ encoder.add(ChangeType.Size, [nodeId, width, height]);
79
+ },
80
+ setText(nodeId, content) {
81
+ encoder.add(ChangeType.Text, [nodeId, content]);
82
+ },
83
+ kind,
84
+ scope,
85
+ };
86
+ const start = timeStampNow();
87
+ serialize(transaction);
88
+ updateSerializationStats(stats, 'serializationDuration', elapsed(start, timeStampNow()));
89
+ const changes = encoder.flush();
90
+ if (changes.length > 0) {
91
+ emitRecord({
92
+ data: changes,
93
+ type: RecordType.Change,
94
+ timestamp,
95
+ });
96
+ }
97
+ emitStats(stats);
98
+ }
99
+ //# sourceMappingURL=serializationTransaction.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"serializationTransaction.js","sourceRoot":"","sources":["../../../../src/domain/record/serialization/serializationTransaction.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,OAAO,EAAE,YAAY,EAAE,MAAM,uBAAuB,CAAA;AAE7D,OAAO,EAAE,UAAU,EAAE,UAAU,EAAE,MAAM,gBAAgB,CAAA;AAsBvD,OAAO,EAAE,wBAAwB,EAAE,wBAAwB,EAAE,MAAM,sBAAsB,CAAA;AACzF,OAAO,EAAE,mBAAmB,EAAE,MAAM,iBAAiB,CAAA;AA6CrD;;;GAGG;AACH,MAAM,UAAU,sBAAsB,CACpC,IAAuB,EACvB,UAA8B,EAC9B,SAA4B,EAC5B,KAAqB,EACrB,SAA2C;IAE3C,MAAM,OAAO,GAAoB,EAAE,CAAA;IACnC,MAAM,KAAK,GAAG,wBAAwB,EAAE,CAAA;IAExC,MAAM,WAAW,GAA6B;QAC5C,GAAG,CAAC,MAAqB;YACvB,OAAO,CAAC,IAAI,CAAC,MAAM,CAAC,CAAA;QACtB,CAAC;QACD,SAAS,CAAC,MAAgC,EAAE,KAAa;YACvD,wBAAwB,CAAC,KAAK,EAAE,MAAM,EAAE,KAAK,CAAC,CAAA;QAChD,CAAC;QACD,QAAQ,CAAC,IAAU;YACjB,MAAM,EAAE,GAAG,KAAK,CAAC,OAAO,CAAC,WAAW,CAAC,IAAI,CAAC,CAAA;YAC1C,IAAI,WAAW,CAAC,iBAAiB,EAAE,CAAC;gBAClC,WAAW,CAAC,iBAAiB,CAAC,GAAG,CAAC,EAAE,CAAC,CAAA;YACvC,CAAC;YACD,OAAO,EAAE,CAAA;QACX,CAAC;QACD,IAAI;QACJ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IAED,MAAM,KAAK,GAAG,YAAY,EAAE,CAAA;IAC5B,SAAS,CAAC,WAAW,CAAC,CAAA;IACtB,wBAAwB,CAAC,KAAK,EAAE,uBAAuB,EAAE,OAAO,CAAC,KAAK,EAAE,YAAY,EAAE,CAAC,CAAC,CAAA;IAExF,MAAM,OAAO,GAAG,OAAO,CAAC,KAAK,EAAE,CAAA;IAC/B,IAAI,OAAO,CAAC,MAAM,GAAG,CAAC,EAAE,CAAC;QACvB,UAAU,CAAC;YACT,IAAI,EAAE,OAAO;YACb,IAAI,EAAE,UAAU,CAAC,MAAM;YACvB,SAAS;SACV,CAAC,CAAA;IACJ,CAAC;IAED,SAAS,CAAC,KAAK,CAAC,CAAA;AAClB,CAAC"}
@@ -0,0 +1,18 @@
1
+ import type { NodePrivacyLevel } from '@datadog/browser-rum-core';
2
+ /**
3
+ * Get the element "value" to be serialized as an attribute or an input update record. It respects
4
+ * the input privacy mode of the element.
5
+ * PERFROMANCE OPTIMIZATION: Assumes that privacy level `HIDDEN` is never encountered because of earlier checks.
6
+ */
7
+ export declare function getElementInputValue(element: Element, nodePrivacyLevel: NodePrivacyLevel): string | undefined;
8
+ export declare const URL_IN_CSS_REF: RegExp;
9
+ export declare const ABSOLUTE_URL: RegExp;
10
+ export declare const DATA_URI: RegExp;
11
+ export declare function switchToAbsoluteUrl(cssText: string, cssHref: string | null): string;
12
+ export declare function getValidTagName(tagName: string): string;
13
+ /**
14
+ * Returns the tag name of the given element, normalized to ensure a consistent lowercase
15
+ * representation regardless of whether the element is HTML, XHTML, or SVG.
16
+ */
17
+ export declare function normalizedTagName(element: Element): string;
18
+ export declare function censoredImageForSize(width: number, height: number): string;