@spotlightjs/spotlight 4.11.4 → 4.11.6

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 (184) hide show
  1. package/dist/_virtual/ajv.js +6 -3
  2. package/dist/_virtual/ajv2.js +13 -0
  3. package/dist/_virtual/index.js +6 -3
  4. package/dist/_virtual/index10.js +3 -3
  5. package/dist/_virtual/index11.js +3 -3
  6. package/dist/_virtual/index12.js +13 -0
  7. package/dist/_virtual/index2.js +3 -3
  8. package/dist/_virtual/index3.js +3 -3
  9. package/dist/_virtual/index4.js +3 -3
  10. package/dist/_virtual/index5.js +3 -3
  11. package/dist/_virtual/index6.js +3 -3
  12. package/dist/_virtual/index7.js +3 -3
  13. package/dist/_virtual/index9.js +3 -3
  14. package/dist/node_modules/.pnpm/@modelcontextprotocol_sdk@1.27.1_zod@4.1.13/node_modules/@modelcontextprotocol/sdk/dist/esm/server/completable.js +1 -1
  15. package/dist/node_modules/.pnpm/@modelcontextprotocol_sdk@1.27.1_zod@4.1.13/node_modules/@modelcontextprotocol/sdk/dist/esm/server/completable.js.map +1 -1
  16. package/dist/node_modules/.pnpm/@modelcontextprotocol_sdk@1.27.1_zod@4.1.13/node_modules/@modelcontextprotocol/sdk/dist/esm/validation/ajv-provider.js +3 -3
  17. package/dist/node_modules/.pnpm/ajv-formats@3.0.1_ajv@8.18.0/node_modules/ajv-formats/dist/formats.js +203 -194
  18. package/dist/node_modules/.pnpm/ajv-formats@3.0.1_ajv@8.18.0/node_modules/ajv-formats/dist/formats.js.map +1 -1
  19. package/dist/node_modules/.pnpm/ajv-formats@3.0.1_ajv@8.18.0/node_modules/ajv-formats/dist/index.js +47 -47
  20. package/dist/node_modules/.pnpm/ajv-formats@3.0.1_ajv@8.18.0/node_modules/ajv-formats/dist/index.js.map +1 -1
  21. package/dist/node_modules/.pnpm/ajv-formats@3.0.1_ajv@8.18.0/node_modules/ajv-formats/dist/limit.js +77 -69
  22. package/dist/node_modules/.pnpm/ajv-formats@3.0.1_ajv@8.18.0/node_modules/ajv-formats/dist/limit.js.map +1 -1
  23. package/dist/node_modules/.pnpm/ajv@8.18.0/node_modules/ajv/dist/ajv.js +78 -81
  24. package/dist/node_modules/.pnpm/ajv@8.18.0/node_modules/ajv/dist/ajv.js.map +1 -1
  25. package/dist/node_modules/.pnpm/ajv@8.18.0/node_modules/ajv/dist/compile/codegen/code.js +145 -136
  26. package/dist/node_modules/.pnpm/ajv@8.18.0/node_modules/ajv/dist/compile/codegen/code.js.map +1 -1
  27. package/dist/node_modules/.pnpm/ajv@8.18.0/node_modules/ajv/dist/compile/codegen/index.js +692 -685
  28. package/dist/node_modules/.pnpm/ajv@8.18.0/node_modules/ajv/dist/compile/codegen/index.js.map +1 -1
  29. package/dist/node_modules/.pnpm/ajv@8.18.0/node_modules/ajv/dist/compile/codegen/scope.js +143 -135
  30. package/dist/node_modules/.pnpm/ajv@8.18.0/node_modules/ajv/dist/compile/codegen/scope.js.map +1 -1
  31. package/dist/node_modules/.pnpm/ajv@8.18.0/node_modules/ajv/dist/compile/errors.js +122 -116
  32. package/dist/node_modules/.pnpm/ajv@8.18.0/node_modules/ajv/dist/compile/errors.js.map +1 -1
  33. package/dist/node_modules/.pnpm/ajv@8.18.0/node_modules/ajv/dist/compile/index.js +216 -214
  34. package/dist/node_modules/.pnpm/ajv@8.18.0/node_modules/ajv/dist/compile/index.js.map +1 -1
  35. package/dist/node_modules/.pnpm/ajv@8.18.0/node_modules/ajv/dist/compile/names.js +43 -35
  36. package/dist/node_modules/.pnpm/ajv@8.18.0/node_modules/ajv/dist/compile/names.js.map +1 -1
  37. package/dist/node_modules/.pnpm/ajv@8.18.0/node_modules/ajv/dist/compile/ref_error.js +19 -11
  38. package/dist/node_modules/.pnpm/ajv@8.18.0/node_modules/ajv/dist/compile/ref_error.js.map +1 -1
  39. package/dist/node_modules/.pnpm/ajv@8.18.0/node_modules/ajv/dist/compile/resolve.js +149 -144
  40. package/dist/node_modules/.pnpm/ajv@8.18.0/node_modules/ajv/dist/compile/resolve.js.map +1 -1
  41. package/dist/node_modules/.pnpm/ajv@8.18.0/node_modules/ajv/dist/compile/rules.js +31 -25
  42. package/dist/node_modules/.pnpm/ajv@8.18.0/node_modules/ajv/dist/compile/rules.js.map +1 -1
  43. package/dist/node_modules/.pnpm/ajv@8.18.0/node_modules/ajv/dist/compile/util.js +164 -160
  44. package/dist/node_modules/.pnpm/ajv@8.18.0/node_modules/ajv/dist/compile/util.js.map +1 -1
  45. package/dist/node_modules/.pnpm/ajv@8.18.0/node_modules/ajv/dist/compile/validate/applicability.js +23 -17
  46. package/dist/node_modules/.pnpm/ajv@8.18.0/node_modules/ajv/dist/compile/validate/applicability.js.map +1 -1
  47. package/dist/node_modules/.pnpm/ajv@8.18.0/node_modules/ajv/dist/compile/validate/boolSchema.js +7 -10
  48. package/dist/node_modules/.pnpm/ajv@8.18.0/node_modules/ajv/dist/compile/validate/boolSchema.js.map +1 -1
  49. package/dist/node_modules/.pnpm/ajv@8.18.0/node_modules/ajv/dist/compile/validate/dataType.js +174 -173
  50. package/dist/node_modules/.pnpm/ajv@8.18.0/node_modules/ajv/dist/compile/validate/dataType.js.map +1 -1
  51. package/dist/node_modules/.pnpm/ajv@8.18.0/node_modules/ajv/dist/compile/validate/defaults.js +5 -7
  52. package/dist/node_modules/.pnpm/ajv@8.18.0/node_modules/ajv/dist/compile/validate/defaults.js.map +1 -1
  53. package/dist/node_modules/.pnpm/ajv@8.18.0/node_modules/ajv/dist/compile/validate/index.js +21 -28
  54. package/dist/node_modules/.pnpm/ajv@8.18.0/node_modules/ajv/dist/compile/validate/index.js.map +1 -1
  55. package/dist/node_modules/.pnpm/ajv@8.18.0/node_modules/ajv/dist/compile/validate/keyword.js +11 -15
  56. package/dist/node_modules/.pnpm/ajv@8.18.0/node_modules/ajv/dist/compile/validate/keyword.js.map +1 -1
  57. package/dist/node_modules/.pnpm/ajv@8.18.0/node_modules/ajv/dist/compile/validate/subschema.js +5 -7
  58. package/dist/node_modules/.pnpm/ajv@8.18.0/node_modules/ajv/dist/compile/validate/subschema.js.map +1 -1
  59. package/dist/node_modules/.pnpm/ajv@8.18.0/node_modules/ajv/dist/core.js +571 -570
  60. package/dist/node_modules/.pnpm/ajv@8.18.0/node_modules/ajv/dist/core.js.map +1 -1
  61. package/dist/node_modules/.pnpm/ajv@8.18.0/node_modules/ajv/dist/refs/data.json.js +3 -17
  62. package/dist/node_modules/.pnpm/ajv@8.18.0/node_modules/ajv/dist/refs/data.json.js.map +1 -1
  63. package/dist/node_modules/.pnpm/ajv@8.18.0/node_modules/ajv/dist/refs/json-schema-draft-07.json.js +4 -236
  64. package/dist/node_modules/.pnpm/ajv@8.18.0/node_modules/ajv/dist/refs/json-schema-draft-07.json.js.map +1 -1
  65. package/dist/node_modules/.pnpm/ajv@8.18.0/node_modules/ajv/dist/runtime/equal.js +16 -7
  66. package/dist/node_modules/.pnpm/ajv@8.18.0/node_modules/ajv/dist/runtime/equal.js.map +1 -1
  67. package/dist/node_modules/.pnpm/ajv@8.18.0/node_modules/ajv/dist/runtime/ucs2length.js +27 -18
  68. package/dist/node_modules/.pnpm/ajv@8.18.0/node_modules/ajv/dist/runtime/ucs2length.js.map +1 -1
  69. package/dist/node_modules/.pnpm/ajv@8.18.0/node_modules/ajv/dist/runtime/uri.js +16 -7
  70. package/dist/node_modules/.pnpm/ajv@8.18.0/node_modules/ajv/dist/runtime/uri.js.map +1 -1
  71. package/dist/node_modules/.pnpm/ajv@8.18.0/node_modules/ajv/dist/runtime/validation_error.js.map +1 -1
  72. package/dist/node_modules/.pnpm/ajv@8.18.0/node_modules/ajv/dist/vocabularies/applicator/additionalItems.js +55 -48
  73. package/dist/node_modules/.pnpm/ajv@8.18.0/node_modules/ajv/dist/vocabularies/applicator/additionalItems.js.map +1 -1
  74. package/dist/node_modules/.pnpm/ajv@8.18.0/node_modules/ajv/dist/vocabularies/applicator/additionalProperties.js +104 -99
  75. package/dist/node_modules/.pnpm/ajv@8.18.0/node_modules/ajv/dist/vocabularies/applicator/additionalProperties.js.map +1 -1
  76. package/dist/node_modules/.pnpm/ajv@8.18.0/node_modules/ajv/dist/vocabularies/applicator/allOf.js +30 -22
  77. package/dist/node_modules/.pnpm/ajv@8.18.0/node_modules/ajv/dist/vocabularies/applicator/allOf.js.map +1 -1
  78. package/dist/node_modules/.pnpm/ajv@8.18.0/node_modules/ajv/dist/vocabularies/applicator/anyOf.js +20 -12
  79. package/dist/node_modules/.pnpm/ajv@8.18.0/node_modules/ajv/dist/vocabularies/applicator/anyOf.js.map +1 -1
  80. package/dist/node_modules/.pnpm/ajv@8.18.0/node_modules/ajv/dist/vocabularies/applicator/contains.js +95 -88
  81. package/dist/node_modules/.pnpm/ajv@8.18.0/node_modules/ajv/dist/vocabularies/applicator/contains.js.map +1 -1
  82. package/dist/node_modules/.pnpm/ajv@8.18.0/node_modules/ajv/dist/vocabularies/applicator/dependencies.js +94 -88
  83. package/dist/node_modules/.pnpm/ajv@8.18.0/node_modules/ajv/dist/vocabularies/applicator/dependencies.js.map +1 -1
  84. package/dist/node_modules/.pnpm/ajv@8.18.0/node_modules/ajv/dist/vocabularies/applicator/if.js +71 -64
  85. package/dist/node_modules/.pnpm/ajv@8.18.0/node_modules/ajv/dist/vocabularies/applicator/if.js.map +1 -1
  86. package/dist/node_modules/.pnpm/ajv@8.18.0/node_modules/ajv/dist/vocabularies/applicator/index.js +66 -73
  87. package/dist/node_modules/.pnpm/ajv@8.18.0/node_modules/ajv/dist/vocabularies/applicator/index.js.map +1 -1
  88. package/dist/node_modules/.pnpm/ajv@8.18.0/node_modules/ajv/dist/vocabularies/applicator/items.js +60 -54
  89. package/dist/node_modules/.pnpm/ajv@8.18.0/node_modules/ajv/dist/vocabularies/applicator/items.js.map +1 -1
  90. package/dist/node_modules/.pnpm/ajv@8.18.0/node_modules/ajv/dist/vocabularies/applicator/items2020.js +41 -36
  91. package/dist/node_modules/.pnpm/ajv@8.18.0/node_modules/ajv/dist/vocabularies/applicator/items2020.js.map +1 -1
  92. package/dist/node_modules/.pnpm/ajv@8.18.0/node_modules/ajv/dist/vocabularies/applicator/not.js +34 -26
  93. package/dist/node_modules/.pnpm/ajv@8.18.0/node_modules/ajv/dist/vocabularies/applicator/not.js.map +1 -1
  94. package/dist/node_modules/.pnpm/ajv@8.18.0/node_modules/ajv/dist/vocabularies/applicator/oneOf.js +60 -53
  95. package/dist/node_modules/.pnpm/ajv@8.18.0/node_modules/ajv/dist/vocabularies/applicator/oneOf.js.map +1 -1
  96. package/dist/node_modules/.pnpm/ajv@8.18.0/node_modules/ajv/dist/vocabularies/applicator/patternProperties.js +73 -67
  97. package/dist/node_modules/.pnpm/ajv@8.18.0/node_modules/ajv/dist/vocabularies/applicator/patternProperties.js.map +1 -1
  98. package/dist/node_modules/.pnpm/ajv@8.18.0/node_modules/ajv/dist/vocabularies/applicator/prefixItems.js +20 -12
  99. package/dist/node_modules/.pnpm/ajv@8.18.0/node_modules/ajv/dist/vocabularies/applicator/prefixItems.js.map +1 -1
  100. package/dist/node_modules/.pnpm/ajv@8.18.0/node_modules/ajv/dist/vocabularies/applicator/properties.js +61 -55
  101. package/dist/node_modules/.pnpm/ajv@8.18.0/node_modules/ajv/dist/vocabularies/applicator/properties.js.map +1 -1
  102. package/dist/node_modules/.pnpm/ajv@8.18.0/node_modules/ajv/dist/vocabularies/applicator/propertyNames.js +46 -39
  103. package/dist/node_modules/.pnpm/ajv@8.18.0/node_modules/ajv/dist/vocabularies/applicator/propertyNames.js.map +1 -1
  104. package/dist/node_modules/.pnpm/ajv@8.18.0/node_modules/ajv/dist/vocabularies/applicator/thenElse.js +21 -13
  105. package/dist/node_modules/.pnpm/ajv@8.18.0/node_modules/ajv/dist/vocabularies/applicator/thenElse.js.map +1 -1
  106. package/dist/node_modules/.pnpm/ajv@8.18.0/node_modules/ajv/dist/vocabularies/code.js +132 -129
  107. package/dist/node_modules/.pnpm/ajv@8.18.0/node_modules/ajv/dist/vocabularies/code.js.map +1 -1
  108. package/dist/node_modules/.pnpm/ajv@8.18.0/node_modules/ajv/dist/vocabularies/core/id.js +17 -8
  109. package/dist/node_modules/.pnpm/ajv@8.18.0/node_modules/ajv/dist/vocabularies/core/id.js.map +1 -1
  110. package/dist/node_modules/.pnpm/ajv@8.18.0/node_modules/ajv/dist/vocabularies/core/index.js +27 -20
  111. package/dist/node_modules/.pnpm/ajv@8.18.0/node_modules/ajv/dist/vocabularies/core/index.js.map +1 -1
  112. package/dist/node_modules/.pnpm/ajv@8.18.0/node_modules/ajv/dist/vocabularies/core/ref.js +121 -118
  113. package/dist/node_modules/.pnpm/ajv@8.18.0/node_modules/ajv/dist/vocabularies/core/ref.js.map +1 -1
  114. package/dist/node_modules/.pnpm/ajv@8.18.0/node_modules/ajv/dist/vocabularies/discriminator/index.js +104 -100
  115. package/dist/node_modules/.pnpm/ajv@8.18.0/node_modules/ajv/dist/vocabularies/discriminator/index.js.map +1 -1
  116. package/dist/node_modules/.pnpm/ajv@8.18.0/node_modules/ajv/dist/vocabularies/discriminator/types.js +15 -9
  117. package/dist/node_modules/.pnpm/ajv@8.18.0/node_modules/ajv/dist/vocabularies/discriminator/types.js.map +1 -1
  118. package/dist/node_modules/.pnpm/ajv@8.18.0/node_modules/ajv/dist/vocabularies/draft7.js +30 -26
  119. package/dist/node_modules/.pnpm/ajv@8.18.0/node_modules/ajv/dist/vocabularies/draft7.js.map +1 -1
  120. package/dist/node_modules/.pnpm/ajv@8.18.0/node_modules/ajv/dist/vocabularies/format/format.js +84 -76
  121. package/dist/node_modules/.pnpm/ajv@8.18.0/node_modules/ajv/dist/vocabularies/format/format.js.map +1 -1
  122. package/dist/node_modules/.pnpm/ajv@8.18.0/node_modules/ajv/dist/vocabularies/format/index.js +16 -8
  123. package/dist/node_modules/.pnpm/ajv@8.18.0/node_modules/ajv/dist/vocabularies/format/index.js.map +1 -1
  124. package/dist/node_modules/.pnpm/ajv@8.18.0/node_modules/ajv/dist/vocabularies/metadata.js +24 -18
  125. package/dist/node_modules/.pnpm/ajv@8.18.0/node_modules/ajv/dist/vocabularies/metadata.js.map +1 -1
  126. package/dist/node_modules/.pnpm/ajv@8.18.0/node_modules/ajv/dist/vocabularies/validation/const.js +33 -27
  127. package/dist/node_modules/.pnpm/ajv@8.18.0/node_modules/ajv/dist/vocabularies/validation/const.js.map +1 -1
  128. package/dist/node_modules/.pnpm/ajv@8.18.0/node_modules/ajv/dist/vocabularies/validation/enum.js +53 -47
  129. package/dist/node_modules/.pnpm/ajv@8.18.0/node_modules/ajv/dist/vocabularies/validation/enum.js.map +1 -1
  130. package/dist/node_modules/.pnpm/ajv@8.18.0/node_modules/ajv/dist/vocabularies/validation/index.js +52 -53
  131. package/dist/node_modules/.pnpm/ajv@8.18.0/node_modules/ajv/dist/vocabularies/validation/index.js.map +1 -1
  132. package/dist/node_modules/.pnpm/ajv@8.18.0/node_modules/ajv/dist/vocabularies/validation/limitItems.js +32 -24
  133. package/dist/node_modules/.pnpm/ajv@8.18.0/node_modules/ajv/dist/vocabularies/validation/limitItems.js.map +1 -1
  134. package/dist/node_modules/.pnpm/ajv@8.18.0/node_modules/ajv/dist/vocabularies/validation/limitLength.js +37 -31
  135. package/dist/node_modules/.pnpm/ajv@8.18.0/node_modules/ajv/dist/vocabularies/validation/limitLength.js.map +1 -1
  136. package/dist/node_modules/.pnpm/ajv@8.18.0/node_modules/ajv/dist/vocabularies/validation/limitNumber.js +35 -27
  137. package/dist/node_modules/.pnpm/ajv@8.18.0/node_modules/ajv/dist/vocabularies/validation/limitNumber.js.map +1 -1
  138. package/dist/node_modules/.pnpm/ajv@8.18.0/node_modules/ajv/dist/vocabularies/validation/limitProperties.js +32 -24
  139. package/dist/node_modules/.pnpm/ajv@8.18.0/node_modules/ajv/dist/vocabularies/validation/limitProperties.js.map +1 -1
  140. package/dist/node_modules/.pnpm/ajv@8.18.0/node_modules/ajv/dist/vocabularies/validation/multipleOf.js +31 -23
  141. package/dist/node_modules/.pnpm/ajv@8.18.0/node_modules/ajv/dist/vocabularies/validation/multipleOf.js.map +1 -1
  142. package/dist/node_modules/.pnpm/ajv@8.18.0/node_modules/ajv/dist/vocabularies/validation/pattern.js +41 -35
  143. package/dist/node_modules/.pnpm/ajv@8.18.0/node_modules/ajv/dist/vocabularies/validation/pattern.js.map +1 -1
  144. package/dist/node_modules/.pnpm/ajv@8.18.0/node_modules/ajv/dist/vocabularies/validation/required.js +80 -74
  145. package/dist/node_modules/.pnpm/ajv@8.18.0/node_modules/ajv/dist/vocabularies/validation/required.js.map +1 -1
  146. package/dist/node_modules/.pnpm/ajv@8.18.0/node_modules/ajv/dist/vocabularies/validation/uniqueItems.js +71 -66
  147. package/dist/node_modules/.pnpm/ajv@8.18.0/node_modules/ajv/dist/vocabularies/validation/uniqueItems.js.map +1 -1
  148. package/dist/node_modules/.pnpm/fast-deep-equal@3.1.3/node_modules/fast-deep-equal/index.js +34 -27
  149. package/dist/node_modules/.pnpm/fast-deep-equal@3.1.3/node_modules/fast-deep-equal/index.js.map +1 -1
  150. package/dist/node_modules/.pnpm/fast-uri@3.1.2/node_modules/fast-uri/index.js +250 -245
  151. package/dist/node_modules/.pnpm/fast-uri@3.1.2/node_modules/fast-uri/index.js.map +1 -1
  152. package/dist/node_modules/.pnpm/fast-uri@3.1.2/node_modules/fast-uri/lib/schemes.js +201 -175
  153. package/dist/node_modules/.pnpm/fast-uri@3.1.2/node_modules/fast-uri/lib/schemes.js.map +1 -1
  154. package/dist/node_modules/.pnpm/fast-uri@3.1.2/node_modules/fast-uri/lib/utils.js +267 -259
  155. package/dist/node_modules/.pnpm/fast-uri@3.1.2/node_modules/fast-uri/lib/utils.js.map +1 -1
  156. package/dist/node_modules/.pnpm/{hono@4.12.18 → hono@4.12.25}/node_modules/hono/dist/helper/streaming/sse.js.map +1 -1
  157. package/dist/node_modules/.pnpm/{hono@4.12.18 → hono@4.12.25}/node_modules/hono/dist/middleware/cors/index.js +3 -6
  158. package/dist/node_modules/.pnpm/hono@4.12.25/node_modules/hono/dist/middleware/cors/index.js.map +1 -0
  159. package/dist/node_modules/.pnpm/{hono@4.12.18 → hono@4.12.25}/node_modules/hono/dist/utils/html.js.map +1 -1
  160. package/dist/node_modules/.pnpm/{hono@4.12.18 → hono@4.12.25}/node_modules/hono/dist/utils/stream.js +5 -3
  161. package/dist/node_modules/.pnpm/hono@4.12.25/node_modules/hono/dist/utils/stream.js.map +1 -0
  162. package/dist/node_modules/.pnpm/json-schema-traverse@1.0.0/node_modules/json-schema-traverse/index.js +83 -78
  163. package/dist/node_modules/.pnpm/json-schema-traverse@1.0.0/node_modules/json-schema-traverse/index.js.map +1 -1
  164. package/dist/node_modules/.pnpm/zod-to-json-schema@3.25.1_zod@4.1.13/node_modules/zod-to-json-schema/dist/esm/Options.js +1 -1
  165. package/dist/node_modules/.pnpm/zod-to-json-schema@3.25.1_zod@4.1.13/node_modules/zod-to-json-schema/dist/esm/Options.js.map +1 -1
  166. package/dist/node_modules/.pnpm/zod@4.1.13/node_modules/zod/v4/core/util.js +1 -1
  167. package/dist/node_modules/.pnpm/zod@4.1.13/node_modules/zod/v4/core/util.js.map +1 -1
  168. package/dist/sentry-config.js +2 -2
  169. package/dist/server/cli/run.js +2 -2
  170. package/dist/server/cli.js +2 -2
  171. package/dist/server/main.js +2 -2
  172. package/dist/server/mcp/mcp.js +2 -2
  173. package/dist/server/routes/stream/streaming.js +2 -2
  174. package/dist/ui/assets/index.js +65 -74
  175. package/dist/ui/assets/index2.js +1 -1
  176. package/dist/ui/assets/instrumentation.js +18 -18
  177. package/dist/ui/assets/main.css +1 -1
  178. package/dist/ui/assets/main.js +1 -1
  179. package/dist/ui/assets/serverTimingMeta.js +23 -30
  180. package/package.json +7 -7
  181. package/dist/node_modules/.pnpm/hono@4.12.18/node_modules/hono/dist/middleware/cors/index.js.map +0 -1
  182. package/dist/node_modules/.pnpm/hono@4.12.18/node_modules/hono/dist/utils/stream.js.map +0 -1
  183. /package/dist/node_modules/.pnpm/{hono@4.12.18 → hono@4.12.25}/node_modules/hono/dist/helper/streaming/sse.js +0 -0
  184. /package/dist/node_modules/.pnpm/{hono@4.12.18 → hono@4.12.25}/node_modules/hono/dist/utils/html.js +0 -0
@@ -1,24 +1,24 @@
1
- import{D as R,d as m,g as Ve,G as Q,a as de,b as le,S as vt,i as br,c as On,e as Lt,T as Do,n as tr,f as Fo,h as ut,j as He,s as $,k as Ur,l as nr,m as Xt,o as Qt,t as ue,p as Ue,q as ce,r as lu,u as Dt,v as Ae,w as du,x as Ct,y as ls,z as fu,A as z,B as ni,C as ne,E as Tn,F as ri,H as pu,I as Bo,J as xe,K as zt,L as rr,_ as sr,M as Ho,N as Uo,O as $o,P as In,Q as Mt,R as zo,U as hu,V as Wo,W as Wt,X as mu,Y as gu,Z as _u,$ as qo,a0 as ds,a1 as fs,a2 as Zt,a3 as wn,a4 as si,a5 as jo,a6 as ps,a7 as Vo,a8 as ir,a9 as Su,aa as yu,ab as Pe,ac as ii,ad as oi,ae as Go,af as Yo,ag as ot,ah as Eu,ai as $r,aj as ai,ak as bu,al as vu,am as Tu,an as Iu,ao as wu,ap as ku,aq as Ru,ar as Jo,as as et,at as Fe,au as Ln,av as Ko,aw as _e,ax as ci,ay as ui,az as Xo,aA as hs,aB as Cu,aC as Qo,aD as Dn,aE as Zo,aF as li,aG as Mu,aH as di,aI as ms,aJ as Fn,aK as Au,aL as xu,aM as F,aN as fe,aO as be,aP as ea,aQ as Ft,aR as Pu,aS as Tt,aT as v,aU as fi,aV as qt,aW as pi,aX as hi,aY as ta,aZ as na,a_ as en,a$ as gs,b0 as Nu,b1 as Ou,b2 as ra,b3 as Lu,b4 as Du,b5 as Fu,b6 as Bu,b7 as Hu,b8 as sa,b9 as vr,ba as Uu,bb as $u,bc as zu,bd as Wu,be as qu}from"./serverTimingMeta.js";(function(){try{var e=typeof window<"u"?window:typeof global<"u"?global:typeof globalThis<"u"?globalThis:typeof self<"u"?self:{},t=new e.Error().stack;t&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[t]="6c0afc59-a5f3-404e-8343-6ae4c66282f8",e._sentryDebugIdIdentifier="sentry-dbid-6c0afc59-a5f3-404e-8343-6ae4c66282f8")}catch{}})();const kn={},mi={};function Ke(e,t){kn[e]=kn[e]||[],kn[e].push(t)}function Xe(e,t){if(!mi[e]){mi[e]=!0;try{t()}catch(n){R&&m.error(`Error while instrumenting ${e}`,n)}}}function ke(e,t){const n=e&&kn[e];if(n)for(const r of n)try{r(t)}catch(s){R&&m.error(`Error while triggering instrumentation handler.
1
+ import{D as R,d as m,g as ze,G as X,a as de,b as le,S as St,i as Er,c as On,e as Ot,T as No,n as tr,f as Po,h as ot,j as De,s as H,k as Ur,l as nr,m as Yt,o as Jt,t as ue,p as Fe,q as ae,r as au,u as Nt,v as Re,w as cu,x as It,y as us,z as uu,A as $,B as ti,C as te,E as bn,F as ni,H as lu,I as Lo,J as Ce,K as Ut,L as rr,_ as sr,M as Do,N as Fo,O as Bo,P as vn,Q as wt,R as Uo,U as du,V as Ho,W as Ht,X as fu,Y as pu,Z as hu,$ as $o,a0 as ls,a1 as ds,a2 as Kt,a3 as Tn,a4 as ri,a5 as Wo,a6 as fs,a7 as zo,a8 as ir,a9 as mu,aa as gu,ab as Me,ac as si,ad as ii,ae as qo,af as jo,ag as rt,ah as _u,ai as Hr,aj as oi,ak as Su,al as yu,am as Eu,an as bu,ao as vu,ap as Tu,aq as Iu,ar as Vo,as as Xe,at as Pe,au as Nn,av as Go,aw as _e,ax as ai,ay as ci,az as Yo,aA as ps,aB as wu,aC as Jo,aD as Pn,aE as Ko,aF as ui,aG as ku,aH as li,aI as hs,aJ as Ln,aK as Ru,aL as Cu,aM as D,aN as pe,aO as be,aP as Xo,aQ as Pt,aR as Mu,aS as yt,aT as v,aU as di,aV as $t,aW as fi,aX as pi,aY as Qo,aZ as Zo,a_ as Xt,a$ as ms,b0 as Au,b1 as xu,b2 as ea,b3 as Ou,b4 as Nu,b5 as Pu,b6 as Lu,b7 as Du,b8 as ta,b9 as br,ba as Fu,bb as Bu,bc as Uu,bd as Hu,be as $u}from"./serverTimingMeta.js";(function(){try{var e=typeof window<"u"?window:typeof global<"u"?global:typeof globalThis<"u"?globalThis:typeof self<"u"?self:{},t=new e.Error().stack;t&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[t]="f92683a9-a574-465a-83f0-5f126f040da1",e._sentryDebugIdIdentifier="sentry-dbid-f92683a9-a574-465a-83f0-5f126f040da1")}catch{}})();const In={},hi={};function Ge(e,t){In[e]=In[e]||[],In[e].push(t)}function Ye(e,t){if(!hi[e]){hi[e]=!0;try{t()}catch(n){R&&m.error(`Error while instrumenting ${e}`,n)}}}function Te(e,t){const n=e&&In[e];if(n)for(const r of n)try{r(t)}catch(s){R&&m.error(`Error while triggering instrumentation handler.
2
2
  Type: ${e}
3
- Name: ${Ve(r)}
4
- Error:`,s)}}let Tr=null;function ia(e){const t="error";Ke(t,e),Xe(t,ju)}function ju(){Tr=Q.onerror,Q.onerror=function(e,t,n,r,s){return ke("error",{column:r,error:s,line:n,msg:e,url:t}),Tr?Tr.apply(this,arguments):!1},Q.onerror.__SENTRY_INSTRUMENTED__=!0}let Ir=null;function oa(e){const t="unhandledrejection";Ke(t,e),Xe(t,Vu)}function Vu(){Ir=Q.onunhandledrejection,Q.onunhandledrejection=function(e){return ke("unhandledrejection",e),Ir?Ir.apply(this,arguments):!0},Q.onunhandledrejection.__SENTRY_INSTRUMENTED__=!0}let gi=!1;function Gu(){if(gi)return;function e(){const t=de(),n=t&&le(t);if(n){const r="internal_error";R&&m.log(`[Tracing] Root span: ${r} -> Global error occurred`),n.setStatus({code:vt,message:r})}}e.tag="sentry_tracingErrorCallback",gi=!0,ia(e),oa(e)}function _i(e){m.log(`Ignoring span ${e.op} - ${e.description} because it matches \`ignoreSpans\`.`)}function Bn(e,t){if(!(t!=null&&t.length)||!e.description)return!1;for(const n of t){if(Ju(n)){if(br(e.description,n))return R&&_i(e),!0;continue}if(!n.name&&!n.op)continue;const r=n.name?br(e.description,n.name):!0,s=n.op?e.op&&br(e.op,n.op):!0;if(r&&s)return R&&_i(e),!0}return!1}function Yu(e,t){const n=t.parent_span_id,r=t.span_id;if(n)for(const s of e)s.parent_span_id===r&&(s.parent_span_id=n)}function Ju(e){return typeof e=="string"||e instanceof RegExp}class Ge{constructor(t={}){this._traceId=t.traceId||On(),this._spanId=t.spanId||Lt()}spanContext(){return{spanId:this._spanId,traceId:this._traceId,traceFlags:Do}}end(t){}setAttribute(t,n){return this}setAttributes(t){return this}setStatus(t){return this}updateName(t){return this}isRecording(){return!1}addEvent(t,n,r){return this}addLink(t){return this}addLinks(t){return this}recordException(t,n){}}function $e(e,t=[]){return[e,t]}function Ku(e,t){const[n,r]=e;return[n,[...r,t]]}function Hn(e,t){const n=e[1];for(const r of n){const s=r[0].type;if(t(r,s))return!0}return!1}function Si(e,t){return Hn(e,(n,r)=>t.includes(r))}function Un(e){const t=Fo(Q);return t.encodePolyfill?t.encodePolyfill(e):new TextEncoder().encode(e)}function Xu(e){const t=Fo(Q);return t.decodePolyfill?t.decodePolyfill(e):new TextDecoder().decode(e)}function $n(e){const[t,n]=e;let r=JSON.stringify(t);function s(i){typeof r=="string"?r=typeof i=="string"?r+i:[Un(r),i]:r.push(typeof i=="string"?Un(i):i)}for(const i of n){const[o,c]=i;if(s(`
3
+ Name: ${ze(r)}
4
+ Error:`,s)}}let vr=null;function na(e){const t="error";Ge(t,e),Ye(t,Wu)}function Wu(){vr=X.onerror,X.onerror=function(e,t,n,r,s){return Te("error",{column:r,error:s,line:n,msg:e,url:t}),vr?vr.apply(this,arguments):!1},X.onerror.__SENTRY_INSTRUMENTED__=!0}let Tr=null;function ra(e){const t="unhandledrejection";Ge(t,e),Ye(t,zu)}function zu(){Tr=X.onunhandledrejection,X.onunhandledrejection=function(e){return Te("unhandledrejection",e),Tr?Tr.apply(this,arguments):!0},X.onunhandledrejection.__SENTRY_INSTRUMENTED__=!0}let mi=!1;function qu(){if(mi)return;function e(){const t=de(),n=t&&le(t);if(n){const r="internal_error";R&&m.log(`[Tracing] Root span: ${r} -> Global error occurred`),n.setStatus({code:St,message:r})}}e.tag="sentry_tracingErrorCallback",mi=!0,na(e),ra(e)}function gi(e){m.log(`Ignoring span ${e.op} - ${e.description} because it matches \`ignoreSpans\`.`)}function Dn(e,t){if(!t?.length||!e.description)return!1;for(const n of t){if(Vu(n)){if(Er(e.description,n))return R&&gi(e),!0;continue}if(!n.name&&!n.op)continue;const r=n.name?Er(e.description,n.name):!0,s=n.op?e.op&&Er(e.op,n.op):!0;if(r&&s)return R&&gi(e),!0}return!1}function ju(e,t){const n=t.parent_span_id,r=t.span_id;if(n)for(const s of e)s.parent_span_id===r&&(s.parent_span_id=n)}function Vu(e){return typeof e=="string"||e instanceof RegExp}class qe{constructor(t={}){this._traceId=t.traceId||On(),this._spanId=t.spanId||Ot()}spanContext(){return{spanId:this._spanId,traceId:this._traceId,traceFlags:No}}end(t){}setAttribute(t,n){return this}setAttributes(t){return this}setStatus(t){return this}updateName(t){return this}isRecording(){return!1}addEvent(t,n,r){return this}addLink(t){return this}addLinks(t){return this}recordException(t,n){}}function Be(e,t=[]){return[e,t]}function Gu(e,t){const[n,r]=e;return[n,[...r,t]]}function Fn(e,t){const n=e[1];for(const r of n){const s=r[0].type;if(t(r,s))return!0}return!1}function _i(e,t){return Fn(e,(n,r)=>t.includes(r))}function Bn(e){const t=Po(X);return t.encodePolyfill?t.encodePolyfill(e):new TextEncoder().encode(e)}function Yu(e){const t=Po(X);return t.decodePolyfill?t.decodePolyfill(e):new TextDecoder().decode(e)}function Un(e){const[t,n]=e;let r=JSON.stringify(t);function s(i){typeof r=="string"?r=typeof i=="string"?r+i:[Bn(r),i]:r.push(typeof i=="string"?Bn(i):i)}for(const i of n){const[o,c]=i;if(s(`
5
5
  ${JSON.stringify(o)}
6
- `),typeof c=="string"||c instanceof Uint8Array)s(c);else{let a;try{a=JSON.stringify(c)}catch{a=JSON.stringify(tr(c))}s(a)}}return typeof r=="string"?r:Qu(r)}function Qu(e){const t=e.reduce((s,i)=>s+i.length,0),n=new Uint8Array(t);let r=0;for(const s of e)n.set(s,r),r+=s.length;return n}function Zu(e){let t=typeof e=="string"?Un(e):e;function n(o){const c=t.subarray(0,o);return t=t.subarray(o+1),c}function r(){let o=t.indexOf(10);return o<0&&(o=t.length),JSON.parse(Xu(n(o)))}const s=r(),i=[];for(;t.length;){const o=r(),c=typeof o.length=="number"?o.length:void 0;i.push([o,c?n(c):r()])}return[s,i]}function el(e){return[{type:"span"},e]}function tl(e){const t=typeof e.data=="string"?Un(e.data):e.data;return[{type:"attachment",length:t.length,filename:e.filename,content_type:e.contentType,attachment_type:e.attachmentType},t]}const nl={session:"session",sessions:"session",attachment:"attachment",transaction:"transaction",event:"error",client_report:"internal",user_report:"default",profile:"profile",profile_chunk:"profile",replay_event:"replay",replay_recording:"replay",check_in:"monitor",feedback:"feedback",span:"span",raw_security:"security",log:"log_item",metric:"metric",trace_metric:"metric"};function yi(e){return nl[e]}function or(e){if(!(e!=null&&e.sdk))return;const{name:t,version:n}=e.sdk;return{name:t,version:n}}function aa(e,t,n,r){var i;const s=(i=e.sdkProcessingMetadata)==null?void 0:i.dynamicSamplingContext;return{event_id:e.event_id,sent_at:new Date().toISOString(),...t&&{sdk:t},...!!n&&r&&{dsn:ut(r)},...s&&{trace:s}}}function rl(e,t){var r,s,i,o;if(!t)return e;const n=e.sdk||{};return e.sdk={...n,name:n.name||t.name,version:n.version||t.version,integrations:[...((r=e.sdk)==null?void 0:r.integrations)||[],...t.integrations||[]],packages:[...((s=e.sdk)==null?void 0:s.packages)||[],...t.packages||[]],settings:(i=e.sdk)!=null&&i.settings||t.settings?{...(o=e.sdk)==null?void 0:o.settings,...t.settings}:void 0},e}function sl(e,t,n,r){const s=or(n),i={sent_at:new Date().toISOString(),...s&&{sdk:s},...!!r&&t&&{dsn:ut(t)}},o="aggregates"in e?[{type:"sessions"},e]:[{type:"session"},e.toJSON()];return $e(i,[o])}function il(e,t,n,r){const s=or(n),i=e.type&&e.type!=="replay_event"?e.type:"event";rl(e,n==null?void 0:n.sdk);const o=aa(e,s,r,t);return delete e.sdkProcessingMetadata,$e(o,[[{type:i},e]])}function ol(e,t){function n(p){return!!p.trace_id&&!!p.public_key}const r=He(e[0]),s=t==null?void 0:t.getDsn(),i=t==null?void 0:t.getOptions().tunnel,o={sent_at:new Date().toISOString(),...n(r)&&{trace:r},...!!i&&s&&{dsn:ut(s)}},{beforeSendSpan:c,ignoreSpans:a}=(t==null?void 0:t.getOptions())||{},u=a!=null&&a.length?e.filter(p=>!Bn($(p),a)):e,d=e.length-u.length;d&&(t==null||t.recordDroppedEvent("before_send","span",d));const l=c?p=>{const h=$(p),g=c(h);return g||(Ur(),h)}:$,f=[];for(const p of u){const h=l(p);h&&f.push(el(h))}return $e(o,f)}function al(e){if(!R)return;const{description:t="< unknown name >",op:n="< unknown op >",parent_span_id:r}=$(e),{spanId:s}=e.spanContext(),i=nr(e),o=le(e),c=o===e,a=`[Tracing] Starting ${i?"sampled":"unsampled"} ${c?"root ":""}span`,u=[`op: ${n}`,`name: ${t}`,`ID: ${s}`];if(r&&u.push(`parent ID: ${r}`),!c){const{op:d,description:l}=$(o);u.push(`root ID: ${o.spanContext().spanId}`),d&&u.push(`root op: ${d}`),l&&u.push(`root description: ${l}`)}m.log(`${a}
6
+ `),typeof c=="string"||c instanceof Uint8Array)s(c);else{let a;try{a=JSON.stringify(c)}catch{a=JSON.stringify(tr(c))}s(a)}}return typeof r=="string"?r:Ju(r)}function Ju(e){const t=e.reduce((s,i)=>s+i.length,0),n=new Uint8Array(t);let r=0;for(const s of e)n.set(s,r),r+=s.length;return n}function Ku(e){let t=typeof e=="string"?Bn(e):e;function n(o){const c=t.subarray(0,o);return t=t.subarray(o+1),c}function r(){let o=t.indexOf(10);return o<0&&(o=t.length),JSON.parse(Yu(n(o)))}const s=r(),i=[];for(;t.length;){const o=r(),c=typeof o.length=="number"?o.length:void 0;i.push([o,c?n(c):r()])}return[s,i]}function Xu(e){return[{type:"span"},e]}function Qu(e){const t=typeof e.data=="string"?Bn(e.data):e.data;return[{type:"attachment",length:t.length,filename:e.filename,content_type:e.contentType,attachment_type:e.attachmentType},t]}const Zu={session:"session",sessions:"session",attachment:"attachment",transaction:"transaction",event:"error",client_report:"internal",user_report:"default",profile:"profile",profile_chunk:"profile",replay_event:"replay",replay_recording:"replay",check_in:"monitor",feedback:"feedback",span:"span",raw_security:"security",log:"log_item",metric:"metric",trace_metric:"metric"};function Si(e){return Zu[e]}function or(e){if(!e?.sdk)return;const{name:t,version:n}=e.sdk;return{name:t,version:n}}function sa(e,t,n,r){const s=e.sdkProcessingMetadata?.dynamicSamplingContext;return{event_id:e.event_id,sent_at:new Date().toISOString(),...t&&{sdk:t},...!!n&&r&&{dsn:ot(r)},...s&&{trace:s}}}function el(e,t){if(!t)return e;const n=e.sdk||{};return e.sdk={...n,name:n.name||t.name,version:n.version||t.version,integrations:[...e.sdk?.integrations||[],...t.integrations||[]],packages:[...e.sdk?.packages||[],...t.packages||[]],settings:e.sdk?.settings||t.settings?{...e.sdk?.settings,...t.settings}:void 0},e}function tl(e,t,n,r){const s=or(n),i={sent_at:new Date().toISOString(),...s&&{sdk:s},...!!r&&t&&{dsn:ot(t)}},o="aggregates"in e?[{type:"sessions"},e]:[{type:"session"},e.toJSON()];return Be(i,[o])}function nl(e,t,n,r){const s=or(n),i=e.type&&e.type!=="replay_event"?e.type:"event";el(e,n?.sdk);const o=sa(e,s,r,t);return delete e.sdkProcessingMetadata,Be(o,[[{type:i},e]])}function rl(e,t){function n(p){return!!p.trace_id&&!!p.public_key}const r=De(e[0]),s=t?.getDsn(),i=t?.getOptions().tunnel,o={sent_at:new Date().toISOString(),...n(r)&&{trace:r},...!!i&&s&&{dsn:ot(s)}},{beforeSendSpan:c,ignoreSpans:a}=t?.getOptions()||{},u=a?.length?e.filter(p=>!Dn(H(p),a)):e,d=e.length-u.length;d&&t?.recordDroppedEvent("before_send","span",d);const l=c?p=>{const h=H(p),g=c(h);return g||(Ur(),h)}:H,f=[];for(const p of u){const h=l(p);h&&f.push(Xu(h))}return Be(o,f)}function sl(e){if(!R)return;const{description:t="< unknown name >",op:n="< unknown op >",parent_span_id:r}=H(e),{spanId:s}=e.spanContext(),i=nr(e),o=le(e),c=o===e,a=`[Tracing] Starting ${i?"sampled":"unsampled"} ${c?"root ":""}span`,u=[`op: ${n}`,`name: ${t}`,`ID: ${s}`];if(r&&u.push(`parent ID: ${r}`),!c){const{op:d,description:l}=H(o);u.push(`root ID: ${o.spanContext().spanId}`),d&&u.push(`root op: ${d}`),l&&u.push(`root description: ${l}`)}m.log(`${a}
7
7
  ${u.join(`
8
- `)}`)}function cl(e){if(!R)return;const{description:t="< unknown name >",op:n="< unknown op >"}=$(e),{spanId:r}=e.spanContext(),i=le(e)===e,o=`[Tracing] Finishing "${n}" ${i?"root ":""}span "${t}" with ID ${r}`;m.log(o)}function ul(e,t,n,r=de()){const s=r&&le(r);s&&(R&&m.log(`[Measurement] Setting measurement on root span: ${e} = ${t} ${n}`),s.addEvent(e,{[Qt]:t,[Xt]:n}))}function Ei(e){if(!e||e.length===0)return;const t={};return e.forEach(n=>{const r=n.attributes||{},s=r[Xt],i=r[Qt];typeof s=="string"&&typeof i=="number"&&(t[n.name]={value:i,unit:s})}),t}const bi=1e3;class ar{constructor(t={}){this._traceId=t.traceId||On(),this._spanId=t.spanId||Lt(),this._startTime=t.startTimestamp||ue(),this._links=t.links,this._attributes={},this.setAttributes({[ce]:"manual",[Ue]:t.op,...t.attributes}),this._name=t.name,t.parentSpanId&&(this._parentSpanId=t.parentSpanId),"sampled"in t&&(this._sampled=t.sampled),t.endTimestamp&&(this._endTime=t.endTimestamp),this._events=[],this._isStandaloneSpan=t.isStandalone,this._endTime&&this._onSpanEnded()}addLink(t){return this._links?this._links.push(t):this._links=[t],this}addLinks(t){return this._links?this._links.push(...t):this._links=t,this}recordException(t,n){}spanContext(){const{_spanId:t,_traceId:n,_sampled:r}=this;return{spanId:t,traceId:n,traceFlags:r?lu:Do}}setAttribute(t,n){return n===void 0?delete this._attributes[t]:this._attributes[t]=n,this}setAttributes(t){return Object.keys(t).forEach(n=>this.setAttribute(n,t[n])),this}updateStartTime(t){this._startTime=Dt(t)}setStatus(t){return this._status=t,this}updateName(t){return this._name=t,this.setAttribute(Ae,"custom"),this}end(t){this._endTime||(this._endTime=Dt(t),cl(this),this._onSpanEnded())}getSpanJSON(){return{data:this._attributes,description:this._name,op:this._attributes[Ue],parent_span_id:this._parentSpanId,span_id:this._spanId,start_timestamp:this._startTime,status:fu(this._status),timestamp:this._endTime,trace_id:this._traceId,origin:this._attributes[ce],profile_id:this._attributes[ls],exclusive_time:this._attributes[Ct],measurements:Ei(this._events),is_segment:this._isStandaloneSpan&&le(this)===this||void 0,segment_id:this._isStandaloneSpan?le(this).spanContext().spanId:void 0,links:du(this._links)}}isRecording(){return!this._endTime&&!!this._sampled}addEvent(t,n,r){R&&m.log("[Tracing] Adding an event to span:",t);const s=vi(n)?n:r||ue(),i=vi(n)?{}:n||{},o={name:t,time:Dt(s),attributes:i};return this._events.push(o),this}isStandaloneSpan(){return!!this._isStandaloneSpan}_onSpanEnded(){const t=z();if(t&&t.emit("spanEnd",this),!(this._isStandaloneSpan||this===le(this)))return;if(this._isStandaloneSpan){this._sampled?dl(ol([this],t)):(R&&m.log("[Tracing] Discarding standalone span because its trace was not chosen to be sampled."),t&&t.recordDroppedEvent("sample_rate","span"));return}const r=this._convertSpanToTransaction();r&&(ni(this).scope||ne()).captureEvent(r)}_convertSpanToTransaction(){var d;if(!Ti($(this)))return;this._name||(R&&m.warn("Transaction has no name, falling back to `<unlabeled transaction>`."),this._name="<unlabeled transaction>");const{scope:t,isolationScope:n}=ni(this),r=(d=t==null?void 0:t.getScopeData().sdkProcessingMetadata)==null?void 0:d.normalizedRequest;if(this._sampled!==!0)return;const i=Tn(this).filter(l=>l!==this&&!ll(l)).map(l=>$(l)).filter(Ti),o=this._attributes[Ae];delete this._attributes[ri],i.forEach(l=>{delete l.data[ri]});const c={contexts:{trace:pu(this)},spans:i.length>bi?i.sort((l,f)=>l.start_timestamp-f.start_timestamp).slice(0,bi):i,start_timestamp:this._startTime,timestamp:this._endTime,transaction:this._name,type:"transaction",sdkProcessingMetadata:{capturedSpanScope:t,capturedSpanIsolationScope:n,dynamicSamplingContext:He(this)},request:r,...o&&{transaction_info:{source:o}}},a=Ei(this._events);return a&&Object.keys(a).length&&(R&&m.log("[Measurements] Adding measurements to transaction event",JSON.stringify(a,void 0,2)),c.measurements=a),c}}function vi(e){return e&&typeof e=="number"||e instanceof Date||Array.isArray(e)}function Ti(e){return!!e.start_timestamp&&!!e.timestamp&&!!e.span_id&&!!e.trace_id}function ll(e){return e instanceof ar&&e.isStandaloneSpan()}function dl(e){const t=z();if(!t)return;const n=e[1];if(!n||n.length===0){t.recordDroppedEvent("before_send","span");return}t.sendEnvelope(e)}function fl(e,t,n=()=>{},r=()=>{}){let s;try{s=e()}catch(i){throw t(i),n(),i}return pl(s,t,n,r)}function pl(e,t,n,r){return Bo(e)?e.then(s=>(n(),r(s),s),s=>{throw t(s),n(),s}):(n(),r(e),e)}function hl(e,t,n){if(!xe(e))return[!1];let r,s;typeof e.tracesSampler=="function"?(s=e.tracesSampler({...t,inheritOrSampleWith:c=>typeof t.parentSampleRate=="number"?t.parentSampleRate:typeof t.parentSampled=="boolean"?Number(t.parentSampled):c}),r=!0):t.parentSampled!==void 0?s=t.parentSampled:typeof e.tracesSampleRate<"u"&&(s=e.tracesSampleRate,r=!0);const i=zt(s);if(i===void 0)return R&&m.warn(`[Tracing] Discarding root span because of invalid sample rate. Sample rate must be a boolean or a number between 0 and 1. Got ${JSON.stringify(s)} of type ${JSON.stringify(typeof s)}.`),[!1];if(!i)return R&&m.log(`[Tracing] Discarding transaction because ${typeof e.tracesSampler=="function"?"tracesSampler returned 0 or false":"a negative sampling decision was inherited or tracesSampleRate is set to 0"}`),[!1,i,r];const o=n<i;return o||R&&m.log(`[Tracing] Discarding transaction because it's not included in the random sample (sampling rate = ${Number(s)})`),[o,i,r]}const ca="__SENTRY_SUPPRESS_TRACING__";function ml(e,t){const n=Ss();if(n.startSpan)return n.startSpan(e,t);const r=la(e),{forceTransaction:s,parentSpan:i,scope:o}=e,c=o==null?void 0:o.clone();return rr(c,()=>_l(i)(()=>{const u=ne(),d=da(u,i),f=e.onlyIfParent&&!d?new Ge:ua({parentSpan:d,spanArguments:r,forceTransaction:s,scope:u});return sr(u,f),fl(()=>t(f),()=>{const{status:p}=$(f);f.isRecording()&&(!p||p==="ok")&&f.setStatus({code:vt,message:"internal_error"})},()=>{f.end()})}))}function At(e){const t=Ss();if(t.startInactiveSpan)return t.startInactiveSpan(e);const n=la(e),{forceTransaction:r,parentSpan:s}=e;return(e.scope?o=>rr(e.scope,o):s!==void 0?o=>_s(s,o):o=>o())(()=>{const o=ne(),c=da(o,s);return e.onlyIfParent&&!c?new Ge:ua({parentSpan:c,spanArguments:n,forceTransaction:r,scope:o})})}function _s(e,t){const n=Ss();return n.withActiveSpan?n.withActiveSpan(e,t):rr(r=>(sr(r,e||void 0),t(r)))}function ua({parentSpan:e,spanArguments:t,forceTransaction:n,scope:r}){if(!xe()){const o=new Ge;if(n||!e){const c={sampled:"false",sample_rate:"0",transaction:t.name,...He(o)};In(o,c)}return o}const s=Mt();let i;if(e&&!n)i=gl(e,r,t),zo(e,i);else if(e){const o=He(e),{traceId:c,spanId:a}=e.spanContext(),u=nr(e);i=Ii({traceId:c,parentSpanId:a,...t},r,u),In(i,o)}else{const{traceId:o,dsc:c,parentSpanId:a,sampled:u}={...s.getPropagationContext(),...r.getPropagationContext()};i=Ii({traceId:o,parentSpanId:a,...t},r,u),c&&In(i,c)}return al(i),hu(i,r,s),i}function la(e){const n={isStandalone:(e.experimental||{}).standalone,...e};if(e.startTime){const r={...n};return r.startTimestamp=Dt(e.startTime),delete r.startTime,r}return n}function Ss(){const e=Ho();return Uo(e)}function Ii(e,t,n){var h;const r=z(),s=(r==null?void 0:r.getOptions())||{},{name:i=""}=e,o={spanAttributes:{...e.attributes},spanName:i,parentSampled:n};r==null||r.emit("beforeSampling",o,{decision:!1});const c=o.parentSampled??n,a=o.spanAttributes,u=t.getPropagationContext(),[d,l,f]=t.getScopeData().sdkProcessingMetadata[ca]?[!1]:hl(s,{name:i,parentSampled:c,attributes:a,parentSampleRate:zt((h=u.dsc)==null?void 0:h.sample_rate)},u.sampleRand),p=new ar({...e,attributes:{[Ae]:"custom",[Wo]:l!==void 0&&f?l:void 0,...a},sampled:d});return!d&&r&&(R&&m.log("[Tracing] Discarding root span because its trace was not chosen to be sampled."),r.recordDroppedEvent("sample_rate","transaction")),r&&r.emit("spanStart",p),p}function gl(e,t,n){const{spanId:r,traceId:s}=e.spanContext(),i=t.getScopeData().sdkProcessingMetadata[ca]?!1:nr(e),o=i?new ar({...n,parentSpanId:r,traceId:s,sampled:i}):new Ge({traceId:s});zo(e,o);const c=z();return c&&(c.emit("spanStart",o),n.endTimestamp&&c.emit("spanEnd",o)),o}function da(e,t){if(t)return t;if(t===null)return;const n=$o(e);if(!n)return;const r=z();return(r?r.getOptions():{}).parentSpanIsAlwaysRootSpan?le(n):n}function _l(e){return e!==void 0?t=>_s(e,t):t=>t()}const Rn={idleTimeout:1e3,finalTimeout:3e4,childSpanTimeout:15e3},Sl="heartbeatFailed",yl="idleTimeout",El="finalTimeout",bl="externalFinish";function fa(e,t={}){const n=new Map;let r=!1,s,i=bl,o=!t.disableAutoFinish;const c=[],{idleTimeout:a=Rn.idleTimeout,finalTimeout:u=Rn.finalTimeout,childSpanTimeout:d=Rn.childSpanTimeout,beforeSpanEnd:l,trimIdleSpanEndTimestamp:f=!0}=t,p=z();if(!p||!xe()){const S=new Ge,I={sample_rate:"0",sampled:"false",...He(S)};return In(S,I),S}const h=ne(),g=de(),_=vl(e);_.end=new Proxy(_.end,{apply(S,I,J){if(l&&l(_),I instanceof Ge)return;const[E,...w]=J,B=E||ue(),H=Dt(B),N=Tn(_).filter(k=>k!==_),oe=$(_);if(!N.length||!f)return x(H),Reflect.apply(S,I,[H,...w]);const K=p.getOptions().ignoreSpans,X=N==null?void 0:N.reduce((k,G)=>{const Z=$(G);return!Z.timestamp||K&&Bn(Z,K)?k:k?Math.max(k,Z.timestamp):Z.timestamp},void 0),b=oe.start_timestamp,j=Math.min(b?b+u/1e3:1/0,Math.max(b||-1/0,Math.min(H,X||1/0)));return x(j),Reflect.apply(S,I,[j,...w])}});function y(){s&&(clearTimeout(s),s=void 0)}function T(S){y(),s=setTimeout(()=>{!r&&n.size===0&&o&&(i=yl,_.end(S))},a)}function O(S){s=setTimeout(()=>{!r&&o&&(i=Sl,_.end(S))},d)}function L(S){y(),n.set(S,!0);const I=ue();O(I+d/1e3)}function q(S){if(n.has(S)&&n.delete(S),n.size===0){const I=ue();T(I+a/1e3)}}function x(S){r=!0,n.clear(),c.forEach(N=>N()),sr(h,g);const I=$(_),{start_timestamp:J}=I;if(!J)return;I.data[Wt]||_.setAttribute(Wt,i);const w=I.status;(!w||w==="unknown")&&_.setStatus({code:mu}),m.log(`[Tracing] Idle span "${I.op}" finished`);const B=Tn(_).filter(N=>N!==_);let H=0;B.forEach(N=>{N.isRecording()&&(N.setStatus({code:vt,message:"cancelled"}),N.end(S),R&&m.log("[Tracing] Cancelling span since span ended early",JSON.stringify(N,void 0,2)));const oe=$(N),{timestamp:K=0,start_timestamp:X=0}=oe,b=X<=S,j=(u+a)/1e3,k=K-X<=j;if(R){const G=JSON.stringify(N,void 0,2);b?k||m.log("[Tracing] Discarding span since it finished after idle span final timeout",G):m.log("[Tracing] Discarding span since it happened after idle span was finished",G)}(!k||!b)&&(gu(_,N),H++)}),H>0&&_.setAttribute("sentry.idle_span_discarded_spans",H)}return c.push(p.on("spanStart",S=>{if(r||S===_||$(S).timestamp||S instanceof ar&&S.isStandaloneSpan())return;Tn(_).includes(S)&&L(S.spanContext().spanId)})),c.push(p.on("spanEnd",S=>{r||q(S.spanContext().spanId)})),c.push(p.on("idleSpanEnableAutoFinish",S=>{S===_&&(o=!0,T(),n.size&&O())})),t.disableAutoFinish||T(),setTimeout(()=>{r||(_.setStatus({code:vt,message:"deadline_exceeded"}),i=El,_.end())},u),_}function vl(e){const t=At(e);return sr(ne(),t),R&&m.log("[Tracing] Started span is an idle span"),t}const wi=[];function Tl(e){const t={};return e.forEach(n=>{const{name:r}=n,s=t[r];s&&!s.isDefaultInstance&&n.isDefaultInstance||(t[r]=n)}),Object.values(t)}function Il(e){const t=e.defaultIntegrations||[],n=e.integrations;t.forEach(s=>{s.isDefaultInstance=!0});let r;if(Array.isArray(n))r=[...t,...n];else if(typeof n=="function"){const s=n(t);r=Array.isArray(s)?s:[s]}else r=t;return Tl(r)}function wl(e,t){const n={};return t.forEach(r=>{r&&pa(e,r,n)}),n}function ki(e,t){for(const n of t)n!=null&&n.afterAllSetup&&n.afterAllSetup(e)}function pa(e,t,n){if(n[t.name]){R&&m.log(`Integration skipped because it was already installed: ${t.name}`);return}if(n[t.name]=t,!wi.includes(t.name)&&typeof t.setupOnce=="function"&&(t.setupOnce(),wi.push(t.name)),t.setup&&typeof t.setup=="function"&&t.setup(e),typeof t.preprocessEvent=="function"){const r=t.preprocessEvent.bind(t);e.on("preprocessEvent",(s,i)=>r(s,i,e))}if(typeof t.processEvent=="function"){const r=t.processEvent.bind(t),s=Object.assign((i,o)=>r(i,o,e),{id:t.name});e.addEventProcessor(s)}R&&m.log(`Integration installed: ${t.name}`)}function kl(e){return typeof e=="object"&&e!=null&&!Array.isArray(e)&&Object.keys(e).includes("value")}function Rl(e,t){const{value:n,unit:r}=kl(e)?e:{value:e,unit:void 0},s=Cl(n),i=r&&typeof r=="string"?{unit:r}:{};if(s)return{...s,...i};if(!t)return;let o="";try{o=JSON.stringify(n)??""}catch{}return{value:o,type:"string",...i}}function Ri(e,t=!1){const n={};for(const[r,s]of Object.entries(e)){const i=Rl(s,t);i&&(n[r]=i)}return n}function Cl(e){const t=typeof e=="string"?"string":typeof e=="boolean"?"boolean":typeof e=="number"&&!Number.isNaN(e)?Number.isInteger(e)?"integer":"double":null;if(t)return{value:e,type:t}}function Ml(e,t){return t?rr(t,()=>{const n=de(),r=n?_u(n):qo(t);return[n?He(n):ds(e,t),r]}):[void 0,void 0]}const Al={trace:1,debug:5,info:9,warn:13,error:17,fatal:21};function xl(e){return[{type:"log",item_count:e.length,content_type:"application/vnd.sentry.items.log+json"},{items:e}]}function Pl(e,t,n,r){const s={};return t!=null&&t.sdk&&(s.sdk={name:t.sdk.name,version:t.sdk.version}),n&&r&&(s.dsn=ut(r)),$e(s,[xl(e)])}const Nl=100;function Ne(e,t,n,r=!0){n&&(!e[t]||r)&&(e[t]=n)}function Ol(e,t){const n=Es(),r=ha(e);r===void 0?n.set(e,[t]):r.length>=Nl?(ys(e,r),n.set(e,[t])):n.set(e,[...r,t])}function Ci(e,t=ne(),n=Ol){var w;const r=(t==null?void 0:t.getClient())??z();if(!r){R&&m.warn("No client available to capture log.");return}const{release:s,environment:i,enableLogs:o=!1,beforeSendLog:c}=r.getOptions();if(!o){R&&m.warn("logging option not enabled, log will not be captured.");return}const[,a]=Ml(r,t),u={...e.attributes},{user:{id:d,email:l,username:f},attributes:p={}}=Ll(t);Ne(u,"user.id",d,!1),Ne(u,"user.email",l,!1),Ne(u,"user.name",f,!1),Ne(u,"sentry.release",s),Ne(u,"sentry.environment",i);const{name:h,version:g}=((w=r.getSdkMetadata())==null?void 0:w.sdk)??{};Ne(u,"sentry.sdk.name",h),Ne(u,"sentry.sdk.version",g);const _=r.getIntegrationByName("Replay"),y=_==null?void 0:_.getReplayId(!0);Ne(u,"sentry.replay_id",y),y&&(_==null?void 0:_.getRecordingMode())==="buffer"&&Ne(u,"sentry._internal.replay_is_buffering",!0);const T=e.message;if(fs(T)){const{__sentry_template_string__:B,__sentry_template_values__:H=[]}=T;H!=null&&H.length&&(u["sentry.message.template"]=B),H.forEach((N,oe)=>{u[`sentry.message.parameter.${oe}`]=N})}const O=$o(t);Ne(u,"sentry.trace.parent_span_id",O==null?void 0:O.spanContext().spanId);const L={...e,attributes:u};r.emit("beforeCaptureLog",L);const q=c?Zt(()=>c(L)):L;if(!q){r.recordDroppedEvent("before_send","log_item",1),R&&m.warn("beforeSendLog returned null, log will not be captured.");return}const{level:x,message:S,attributes:I={},severityNumber:J}=q,E={timestamp:ue(),level:x,body:S,trace_id:a==null?void 0:a.trace_id,severity_number:J??Al[x],attributes:{...Ri(p),...Ri(I,!0)}};n(r,E),r.emit("afterCaptureLog",q)}function ys(e,t){const n=t??ha(e)??[];if(n.length===0)return;const r=e.getOptions(),s=Pl(n,r._metadata,r.tunnel,e.getDsn());Es().set(e,[]),e.emit("flushLogs"),e.sendEnvelope(s)}function ha(e){return Es().get(e)}function Ll(e){const t=wn().getScopeData();return si(t,Mt().getScopeData()),si(t,e.getScopeData()),t}function Es(){return jo("clientToLogBufferMap",()=>new WeakMap)}function Dl(e){return[{type:"trace_metric",item_count:e.length,content_type:"application/vnd.sentry.items.trace-metric+json"},{items:e}]}function Fl(e,t,n,r){const s={};return t!=null&&t.sdk&&(s.sdk={name:t.sdk.name,version:t.sdk.version}),n&&r&&(s.dsn=ut(r)),$e(s,[Dl(e)])}function ma(e,t){const n=t??Bl(e)??[];if(n.length===0)return;const r=e.getOptions(),s=Fl(n,r._metadata,r.tunnel,e.getDsn());ga().set(e,[]),e.emit("flushMetrics"),e.sendEnvelope(s)}function Bl(e){return ga().get(e)}function ga(){return jo("clientToMetricBufferMap",()=>new WeakMap)}const bs=Symbol.for("SentryBufferFullError");function vs(e=100){const t=new Set;function n(){return t.size<e}function r(o){t.delete(o)}function s(o){if(!n())return Vo(bs);const c=o();return t.add(c),c.then(()=>r(c),()=>r(c)),c}function i(o){if(!t.size)return ps(!0);const c=Promise.allSettled(Array.from(t)).then(()=>!0);if(!o)return c;const a=[c,new Promise(u=>setTimeout(()=>u(!1),o))];return Promise.race(a)}return{get $(){return Array.from(t)},add:s,drain:i}}const Hl=60*1e3;function _a(e,t=Date.now()){const n=parseInt(`${e}`,10);if(!isNaN(n))return n*1e3;const r=Date.parse(`${e}`);return isNaN(r)?Hl:r-t}function Ul(e,t){return e[t]||e.all||0}function Sa(e,t,n=Date.now()){return Ul(e,t)>n}function ya(e,{statusCode:t,headers:n},r=Date.now()){const s={...e},i=n==null?void 0:n["x-sentry-rate-limits"],o=n==null?void 0:n["retry-after"];if(i)for(const c of i.trim().split(",")){const[a,u,,,d]=c.split(":",5),l=parseInt(a,10),f=(isNaN(l)?60:l)*1e3;if(!u)s.all=r+f;else for(const p of u.split(";"))p==="metric_bucket"?(!d||d.split(";").includes("custom"))&&(s[p]=r+f):s[p]=r+f}else o?s.all=r+_a(o,r):t===429&&(s.all=r+60*1e3);return s}const Ea=64;function $l(e,t,n=vs(e.bufferSize||Ea)){let r={};const s=o=>n.drain(o);function i(o){const c=[];if(Hn(o,(l,f)=>{const p=yi(f);Sa(r,p)?e.recordDroppedEvent("ratelimit_backoff",p):c.push(l)}),c.length===0)return Promise.resolve({});const a=$e(o[0],c),u=l=>{Hn(a,(f,p)=>{e.recordDroppedEvent(l,yi(p))})},d=()=>t({body:$n(a)}).then(l=>(l.statusCode!==void 0&&(l.statusCode<200||l.statusCode>=300)&&R&&m.warn(`Sentry responded with status code ${l.statusCode} to sent event.`),r=ya(r,l),l),l=>{throw u("network_error"),R&&m.error("Encountered error running transport request:",l),l});return n.add(d).then(l=>l,l=>{if(l===bs)return R&&m.error("Skipped sending event because buffer is full."),u("queue_overflow"),Promise.resolve({});throw l})}return{send:i,flush:s}}function zl(e,t,n){const r=[{type:"client_report"},{timestamp:ir(),discarded_events:e}];return $e(t?{dsn:t}:{},[r])}function ba(e){const t=[];e.message&&t.push(e.message);try{const n=e.exception.values[e.exception.values.length-1];n!=null&&n.value&&(t.push(n.value),n.type&&t.push(`${n.type}: ${n.value}`))}catch{}return t}function Wl(e){var a;const{trace_id:t,parent_span_id:n,span_id:r,status:s,origin:i,data:o,op:c}=((a=e.contexts)==null?void 0:a.trace)??{};return{data:o??{},description:e.transaction,op:c,parent_span_id:n,span_id:r??"",start_timestamp:e.start_timestamp??0,status:s,timestamp:e.timestamp,trace_id:t??"",origin:i,profile_id:o==null?void 0:o[ls],exclusive_time:o==null?void 0:o[Ct],measurements:e.measurements,is_segment:!0}}function ql(e){return{type:"transaction",timestamp:e.timestamp,start_timestamp:e.start_timestamp,transaction:e.description,contexts:{trace:{trace_id:e.trace_id,span_id:e.span_id,parent_span_id:e.parent_span_id,op:e.op,status:e.status,origin:e.origin,data:{...e.data,...e.profile_id&&{[ls]:e.profile_id},...e.exclusive_time&&{[Ct]:e.exclusive_time}}}},measurements:e.measurements}}const Mi="Not capturing exception because it's already been captured.",Ai="Discarded session because of missing or non-string release",va=Symbol.for("SentryInternalError"),Ta=Symbol.for("SentryDoNotSendEventError"),jl=5e3;function Cn(e){return{message:e,[va]:!0}}function wr(e){return{message:e,[Ta]:!0}}function xi(e){return!!e&&typeof e=="object"&&va in e}function Pi(e){return!!e&&typeof e=="object"&&Ta in e}function Ni(e,t,n,r,s){let i=0,o,c=!1;e.on(n,()=>{i=0,clearTimeout(o),c=!1}),e.on(t,a=>{i+=r(a),i>=8e5?s(e):c||(c=!0,o=setTimeout(()=>{s(e)},jl))}),e.on("flush",()=>{s(e)})}class Vl{constructor(t){var r,s,i;if(this._options=t,this._integrations={},this._numProcessing=0,this._outcomes={},this._hooks={},this._eventProcessors=[],this._promiseBuffer=vs(((r=t.transportOptions)==null?void 0:r.bufferSize)??Ea),t.dsn?this._dsn=Su(t.dsn):R&&m.warn("No DSN provided, client will not send events."),this._dsn){const o=yu(this._dsn,t.tunnel,t._metadata?t._metadata.sdk:void 0);this._transport=t.transport({tunnel:this._options.tunnel,recordDroppedEvent:this.recordDroppedEvent.bind(this),...t.transportOptions,url:o})}this._options.enableLogs=this._options.enableLogs??((s=this._options._experiments)==null?void 0:s.enableLogs),this._options.enableLogs&&Ni(this,"afterCaptureLog","flushLogs",Kl,ys),(this._options.enableMetrics??((i=this._options._experiments)==null?void 0:i.enableMetrics)??!0)&&Ni(this,"afterCaptureMetric","flushMetrics",Jl,ma)}captureException(t,n,r){const s=Pe();if(ii(t))return R&&m.log(Mi),s;const i={event_id:s,...n};return this._process(()=>this.eventFromException(t,i).then(o=>this._captureEvent(o,i,r)).then(o=>o),"error"),i.event_id}captureMessage(t,n,r,s){const i={event_id:Pe(),...r},o=fs(t)?t:String(t),c=ot(t),a=c?this.eventFromMessage(o,n,i):this.eventFromException(t,i);return this._process(()=>a.then(u=>this._captureEvent(u,i,s)),c?"unknown":"error"),i.event_id}captureEvent(t,n,r){const s=Pe();if(n!=null&&n.originalException&&ii(n.originalException))return R&&m.log(Mi),s;const i={event_id:s,...n},o=t.sdkProcessingMetadata||{},c=o.capturedSpanScope,a=o.capturedSpanIsolationScope,u=Oi(t.type);return this._process(()=>this._captureEvent(t,i,c||r,a),u),i.event_id}captureSession(t){this.sendSession(t),oi(t,{init:!1})}getDsn(){return this._dsn}getOptions(){return this._options}getSdkMetadata(){return this._options._metadata}getTransport(){return this._transport}async flush(t){const n=this._transport;if(!n)return!0;this.emit("flush");const r=await this._isClientDoneProcessing(t),s=await n.flush(t);return r&&s}async close(t){const n=await this.flush(t);return this.getOptions().enabled=!1,this.emit("close"),n}getEventProcessors(){return this._eventProcessors}addEventProcessor(t){this._eventProcessors.push(t)}init(){(this._isEnabled()||this._options.integrations.some(({name:t})=>t.startsWith("Spotlight")))&&this._setupIntegrations()}getIntegrationByName(t){return this._integrations[t]}addIntegration(t){const n=this._integrations[t.name];pa(this,t,this._integrations),n||ki(this,[t])}sendEvent(t,n={}){this.emit("beforeSendEvent",t,n);let r=il(t,this._dsn,this._options._metadata,this._options.tunnel);for(const s of n.attachments||[])r=Ku(r,tl(s));this.sendEnvelope(r).then(s=>this.emit("afterSendEvent",t,s))}sendSession(t){const{release:n,environment:r=Go}=this._options;if("aggregates"in t){const i=t.attrs||{};if(!i.release&&!n){R&&m.warn(Ai);return}i.release=i.release||n,i.environment=i.environment||r,t.attrs=i}else{if(!t.release&&!n){R&&m.warn(Ai);return}t.release=t.release||n,t.environment=t.environment||r}this.emit("beforeSendSession",t);const s=sl(t,this._dsn,this._options._metadata,this._options.tunnel);this.sendEnvelope(s)}recordDroppedEvent(t,n,r=1){if(this._options.sendClientReports){const s=`${t}:${n}`;R&&m.log(`Recording outcome: "${s}"${r>1?` (${r} times)`:""}`),this._outcomes[s]=(this._outcomes[s]||0)+r}}on(t,n){const r=this._hooks[t]=this._hooks[t]||new Set,s=(...i)=>n(...i);return r.add(s),()=>{r.delete(s)}}emit(t,...n){const r=this._hooks[t];r&&r.forEach(s=>s(...n))}async sendEnvelope(t){if(this.emit("beforeEnvelope",t),this._isEnabled()&&this._transport)try{return await this._transport.send(t)}catch(n){return R&&m.error("Error while sending envelope:",n),{}}return R&&m.error("Transport disabled"),{}}_setupIntegrations(){const{integrations:t}=this._options;this._integrations=wl(this,t),ki(this,t)}_updateSessionFromEvent(t,n){var a,u;let r=n.level==="fatal",s=!1;const i=(a=n.exception)==null?void 0:a.values;if(i){s=!0,r=!1;for(const d of i)if(((u=d.mechanism)==null?void 0:u.handled)===!1){r=!0;break}}const o=t.status==="ok";(o&&t.errors===0||o&&r)&&(oi(t,{...r&&{status:"crashed"},errors:t.errors||Number(s||r)}),this.captureSession(t))}async _isClientDoneProcessing(t){let n=0;for(;!t||n<t;){if(await new Promise(r=>setTimeout(r,1)),!this._numProcessing)return!0;n++}return!1}_isEnabled(){return this.getOptions().enabled!==!1&&this._transport!==void 0}_prepareEvent(t,n,r,s){const i=this.getOptions(),o=Object.keys(this._integrations);return!n.integrations&&(o!=null&&o.length)&&(n.integrations=o),this.emit("preprocessEvent",t,n),t.type||s.setLastEventId(t.event_id||n.event_id),Yo(i,t,n,r,this,s).then(c=>{if(c===null)return c;this.emit("postprocessEvent",c,n),c.contexts={trace:qo(r),...c.contexts};const a=ds(this,r);return c.sdkProcessingMetadata={dynamicSamplingContext:a,...c.sdkProcessingMetadata},c})}_captureEvent(t,n={},r=ne(),s=Mt()){return R&&zr(t)&&m.log(`Captured error event \`${ba(t)[0]||"<unknown>"}\``),this._processEvent(t,n,r,s).then(i=>i.event_id,i=>{R&&(Pi(i)?m.log(i.message):xi(i)?m.warn(i.message):m.warn(i))})}_processEvent(t,n,r,s){const i=this.getOptions(),{sampleRate:o}=i,c=Ia(t),a=zr(t),d=`before send for type \`${t.type||"error"}\``,l=typeof o>"u"?void 0:zt(o);if(a&&typeof l=="number"&&Math.random()>l)return this.recordDroppedEvent("sample_rate","error"),Vo(wr(`Discarding event because it's not included in the random sample (sampling rate = ${o})`));const f=Oi(t.type);return this._prepareEvent(t,n,r,s).then(p=>{if(p===null)throw this.recordDroppedEvent("event_processor",f),wr("An event processor returned `null`, will not send event.");if(n.data&&n.data.__sentry__===!0)return p;const g=Yl(this,i,p,n);return Gl(g,d)}).then(p=>{var _;if(p===null){if(this.recordDroppedEvent("before_send",f),c){const T=1+(t.spans||[]).length;this.recordDroppedEvent("before_send","span",T)}throw wr(`${d} returned \`null\`, will not send event.`)}const h=r.getSession()||s.getSession();if(a&&h&&this._updateSessionFromEvent(h,p),c){const y=((_=p.sdkProcessingMetadata)==null?void 0:_.spanCountBeforeProcessing)||0,T=p.spans?p.spans.length:0,O=y-T;O>0&&this.recordDroppedEvent("before_send","span",O)}const g=p.transaction_info;if(c&&g&&p.transaction!==t.transaction){const y="custom";p.transaction_info={...g,source:y}}return this.sendEvent(p,n),p}).then(null,p=>{throw Pi(p)||xi(p)?p:(this.captureException(p,{mechanism:{handled:!1,type:"internal"},data:{__sentry__:!0},originalException:p}),Cn(`Event processing pipeline threw an error, original event will not be sent. Details have been sent as a new event.
9
- Reason: ${p}`))})}_process(t,n){this._numProcessing++,this._promiseBuffer.add(t).then(r=>(this._numProcessing--,r),r=>(this._numProcessing--,r===bs&&this.recordDroppedEvent("queue_overflow",n),r))}_clearOutcomes(){const t=this._outcomes;return this._outcomes={},Object.entries(t).map(([n,r])=>{const[s,i]=n.split(":");return{reason:s,category:i,quantity:r}})}_flushOutcomes(){R&&m.log("Flushing outcomes...");const t=this._clearOutcomes();if(t.length===0){R&&m.log("No outcomes to send");return}if(!this._dsn){R&&m.log("No dsn provided, will not send outcomes");return}R&&m.log("Sending outcomes:",t);const n=zl(t,this._options.tunnel&&ut(this._dsn));this.sendEnvelope(n)}}function Oi(e){return e==="replay_event"?"replay":e||"error"}function Gl(e,t){const n=`${t} must return \`null\` or a valid event.`;if(Bo(e))return e.then(r=>{if(!$r(r)&&r!==null)throw Cn(n);return r},r=>{throw Cn(`${t} rejected with ${r}`)});if(!$r(e)&&e!==null)throw Cn(n);return e}function Yl(e,t,n,r){const{beforeSend:s,beforeSendTransaction:i,beforeSendSpan:o,ignoreSpans:c}=t;let a=n;if(zr(a)&&s)return s(a,r);if(Ia(a)){if(o||c){const u=Wl(a);if(c!=null&&c.length&&Bn(u,c))return null;if(o){const d=o(u);d?a=Eu(n,ql(d)):Ur()}if(a.spans){const d=[],l=a.spans;for(const p of l){if(c!=null&&c.length&&Bn(p,c)){Yu(l,p);continue}if(o){const h=o(p);h?d.push(h):(Ur(),d.push(p))}else d.push(p)}const f=a.spans.length-d.length;f&&e.recordDroppedEvent("before_send","span",f),a.spans=d}}if(i){if(a.spans){const u=a.spans.length;a.sdkProcessingMetadata={...n.sdkProcessingMetadata,spanCountBeforeProcessing:u}}return i(a,r)}}return a}function zr(e){return e.type===void 0}function Ia(e){return e.type==="transaction"}function Jl(e){let t=0;return e.name&&(t+=e.name.length*2),t+=8,t+wa(e.attributes)}function Kl(e){let t=0;return e.message&&(t+=e.message.length*2),t+wa(e.attributes)}function wa(e){if(!e)return 0;let t=0;return Object.values(e).forEach(n=>{Array.isArray(n)?t+=n.length*Li(n[0]):ot(n)?t+=Li(n):t+=100}),t}function Li(e){return typeof e=="string"?e.length*2:typeof e=="number"?8:typeof e=="boolean"?4:0}function Xl(e,t){t.debug===!0&&(R?m.enable():Zt(()=>{console.warn("[Sentry] Cannot initialize SDK with `debug` option using a non-debug bundle.")})),ne().update(t.initialScope);const r=new e(t);return Ql(r),r.init(),r}function Ql(e){ne().setClient(e)}const kr=100,Rr=5e3,Zl=36e5;function ed(e){function t(...n){R&&m.log("[Offline]:",...n)}return n=>{const r=e(n);if(!n.createStore)throw new Error("No `createStore` function was provided");const s=n.createStore(n);let i=Rr,o;function c(l,f,p){return Si(l,["client_report"])?!1:n.shouldStore?n.shouldStore(l,f,p):!0}function a(l){o&&clearTimeout(o),o=setTimeout(async()=>{o=void 0;const f=await s.shift();f&&(t("Attempting to send previously queued event"),f[0].sent_at=new Date().toISOString(),d(f,!0).catch(p=>{t("Failed to retry sending",p)}))},l),typeof o!="number"&&o.unref&&o.unref()}function u(){o||(a(i),i=Math.min(i*2,Zl))}async function d(l,f=!1){var p,h;if(!f&&Si(l,["replay_event","replay_recording"]))return await s.push(l),a(kr),{};try{if(n.shouldSend&&await n.shouldSend(l)===!1)throw new Error("Envelope not sent because `shouldSend` callback returned false");const g=await r.send(l);let _=kr;if(g){if((p=g.headers)!=null&&p["retry-after"])_=_a(g.headers["retry-after"]);else if((h=g.headers)!=null&&h["x-sentry-rate-limits"])_=6e4;else if((g.statusCode||0)>=400)return g}return a(_),i=Rr,g}catch(g){if(await c(l,g,i))return f?await s.unshift(l):await s.push(l),u(),t("Error sending. Event queued.",g),{};throw g}}return n.flushAtStartup&&u(),{send:d,flush:l=>(l===void 0&&(i=Rr,a(kr)),r.flush(l))}}}const td="thismessage:/";function Ts(e){return"isRelative"in e}function Is(e,t){const n=e.indexOf("://")<=0&&e.indexOf("//")!==0,r=n?td:void 0;try{if("canParse"in URL&&!URL.canParse(e,r))return;const s=new URL(e,r);return n?{isRelative:n,pathname:s.pathname,search:s.search,hash:s.hash}:s}catch{}}function nd(e){if(Ts(e))return e.pathname;const t=new URL(e);return t.search="",t.hash="",["80","443"].includes(t.port)&&(t.port=""),t.password&&(t.password="%filtered%"),t.username&&(t.username="%filtered%"),t.toString()}function st(e){if(!e)return{};const t=e.match(/^(([^:/?#]+):)?(\/\/([^/?#]*))?([^?#]*)(\?([^#]*))?(#(.*))?$/);if(!t)return{};const n=t[6]||"",r=t[8]||"";return{host:t[4],path:t[5],protocol:t[2],search:n,hash:r,relative:t[5]+n+r}}function rd(e){return e.split(/[?#]/,1)[0]}function sd(e,t){const n=t==null?void 0:t.getDsn(),r=t==null?void 0:t.getOptions().tunnel;return od(e,n)||id(e,r)}function id(e,t){return t?Di(e)===Di(t):!1}function od(e,t){const n=Is(e);return!n||Ts(n)?!1:t?n.host.includes(t.host)&&/(^|&|\?)sentry_key=/.test(n.search):!1}function Di(e){return e[e.length-1]==="/"?e.slice(0,-1):e}function ad(e){var t;"aggregates"in e?((t=e.attrs)==null?void 0:t.ip_address)===void 0&&(e.attrs={...e.attrs,ip_address:"{{auto}}"}):e.ipAddress===void 0&&(e.ipAddress="{{auto}}")}function ka(e,t,n=[t],r="npm"){const s=e._metadata||{};s.sdk||(s.sdk={name:`sentry.javascript.${t}`,packages:n.map(i=>({name:`${r}:@sentry/${i}`,version:ai})),version:ai}),e._metadata=s}function Ra(e={}){const t=e.client||z();if(!bu()||!t)return{};const n=Ho(),r=Uo(n);if(r.getTraceData)return r.getTraceData(e);const s=e.scope||ne(),i=e.span||de(),o=i?vu(i):cd(s),c=i?He(i):ds(t,s),a=Tu(c);if(!Iu.test(o))return m.warn("Invalid sentry-trace data. Cannot generate trace data"),{};const d={"sentry-trace":o,baggage:a};return e.propagateTraceparent&&(d.traceparent=i?wu(i):ud(s)),d}function cd(e){const{traceId:t,sampled:n,propagationSpanId:r}=e.getPropagationContext();return ku(t,r,n)}function ud(e){const{traceId:t,sampled:n,propagationSpanId:r}=e.getPropagationContext();return Ru(t,r,n)}function ld(e,t,n){let r,s,i;const o=n!=null&&n.maxWait?Math.max(n.maxWait,t):0,c=(n==null?void 0:n.setTimeoutImpl)||setTimeout;function a(){return u(),r=e(),r}function u(){s!==void 0&&clearTimeout(s),i!==void 0&&clearTimeout(i),s=i=void 0}function d(){return s!==void 0||i!==void 0?a():r}function l(){return s&&clearTimeout(s),s=c(a,t),o&&i===void 0&&(i=c(a,o)),r}return l.cancel=u,l.flush=d,l}const dd=100;function Ye(e,t){const n=z(),r=Mt();if(!n)return;const{beforeBreadcrumb:s=null,maxBreadcrumbs:i=dd}=n.getOptions();if(i<=0)return;const c={timestamp:ir(),...e},a=s?Zt(()=>s(c,t)):c;a!==null&&(n.emit&&n.emit("beforeAddBreadcrumb",a,t),r.addBreadcrumb(a,i))}let Fi;const fd="FunctionToString",Bi=new WeakMap,pd=(()=>({name:fd,setupOnce(){Fi=Function.prototype.toString;try{Function.prototype.toString=function(...e){const t=Jo(this),n=Bi.has(z())&&t!==void 0?t:this;return Fi.apply(n,e)}}catch{}},setup(e){Bi.set(e,!0)}})),hd=pd,md=[/^Script error\.?$/,/^Javascript error: Script error\.? on line 0$/,/^ResizeObserver loop completed with undelivered notifications.$/,/^Cannot redefine property: googletag$/,/^Can't find variable: gmo$/,/^undefined is not an object \(evaluating 'a\.[A-Z]'\)$/,`can't redefine non-configurable property "solana"`,"vv().getRestrictions is not a function. (In 'vv().getRestrictions(1,a)', 'vv().getRestrictions' is undefined)","Can't find variable: _AutofillCallbackHandler",/^Non-Error promise rejection captured with value: Object Not Found Matching Id:\d+, MethodName:simulateEvent, ParamCount:\d+$/,/^Java exception was raised during method invocation$/],gd="EventFilters",_d=(e={})=>{let t;return{name:gd,setup(n){const r=n.getOptions();t=Hi(e,r)},processEvent(n,r,s){if(!t){const i=s.getOptions();t=Hi(e,i)}return yd(n,t)?null:n}}},Sd=((e={})=>({..._d(e),name:"InboundFilters"}));function Hi(e={},t={}){return{allowUrls:[...e.allowUrls||[],...t.allowUrls||[]],denyUrls:[...e.denyUrls||[],...t.denyUrls||[]],ignoreErrors:[...e.ignoreErrors||[],...t.ignoreErrors||[],...e.disableErrorDefaults?[]:md],ignoreTransactions:[...e.ignoreTransactions||[],...t.ignoreTransactions||[]]}}function yd(e,t){if(e.type){if(e.type==="transaction"&&bd(e,t.ignoreTransactions))return R&&m.warn(`Event dropped due to being matched by \`ignoreTransactions\` option.
10
- Event: ${et(e)}`),!0}else{if(Ed(e,t.ignoreErrors))return R&&m.warn(`Event dropped due to being matched by \`ignoreErrors\` option.
11
- Event: ${et(e)}`),!0;if(wd(e))return R&&m.warn(`Event dropped due to not having an error message, error type or stacktrace.
12
- Event: ${et(e)}`),!0;if(vd(e,t.denyUrls))return R&&m.warn(`Event dropped due to being matched by \`denyUrls\` option.
13
- Event: ${et(e)}.
14
- Url: ${zn(e)}`),!0;if(!Td(e,t.allowUrls))return R&&m.warn(`Event dropped due to not being matched by \`allowUrls\` option.
15
- Event: ${et(e)}.
16
- Url: ${zn(e)}`),!0}return!1}function Ed(e,t){return t!=null&&t.length?ba(e).some(n=>Fe(n,t)):!1}function bd(e,t){if(!(t!=null&&t.length))return!1;const n=e.transaction;return n?Fe(n,t):!1}function vd(e,t){if(!(t!=null&&t.length))return!1;const n=zn(e);return n?Fe(n,t):!1}function Td(e,t){if(!(t!=null&&t.length))return!0;const n=zn(e);return n?Fe(n,t):!0}function Id(e=[]){for(let t=e.length-1;t>=0;t--){const n=e[t];if(n&&n.filename!=="<anonymous>"&&n.filename!=="[native code]")return n.filename||null}return null}function zn(e){var t,n;try{const r=[...((t=e.exception)==null?void 0:t.values)??[]].reverse().find(i=>{var o,c,a;return((o=i.mechanism)==null?void 0:o.parent_id)===void 0&&((a=(c=i.stacktrace)==null?void 0:c.frames)==null?void 0:a.length)}),s=(n=r==null?void 0:r.stacktrace)==null?void 0:n.frames;return s?Id(s):null}catch{return R&&m.error(`Cannot extract url for event ${et(e)}`),null}}function wd(e){var t,n;return(n=(t=e.exception)==null?void 0:t.values)!=null&&n.length?!e.message&&!e.exception.values.some(r=>r.stacktrace||r.type&&r.type!=="Error"||r.value):!1}function kd(e,t,n,r,s,i){var c;if(!((c=s.exception)!=null&&c.values)||!i||!Ln(i.originalException,Error))return;const o=s.exception.values.length>0?s.exception.values[s.exception.values.length-1]:void 0;o&&(s.exception.values=Wr(e,t,r,i.originalException,n,s.exception.values,o,0))}function Wr(e,t,n,r,s,i,o,c){if(i.length>=n+1)return i;let a=[...i];if(Ln(r[s],Error)){Ui(o,c);const u=e(t,r[s]),d=a.length;$i(u,s,d,c),a=Wr(e,t,n,r[s],s,[u,...a],u,d)}return Array.isArray(r.errors)&&r.errors.forEach((u,d)=>{if(Ln(u,Error)){Ui(o,c);const l=e(t,u),f=a.length;$i(l,`errors[${d}]`,f,c),a=Wr(e,t,n,u,s,[l,...a],l,f)}}),a}function Ui(e,t){e.mechanism={handled:!0,type:"auto.core.linked_errors",...e.mechanism,...e.type==="AggregateError"&&{is_exception_group:!0},exception_id:t}}function $i(e,t,n,r){e.mechanism={handled:!0,...e.mechanism,type:"chained",source:t,exception_id:n,parent_id:r}}function Ca(e){const t="console";Ke(t,e),Xe(t,Rd)}function Rd(){"console"in Q&&Ko.forEach(function(e){e in Q.console&&_e(Q.console,e,function(t){return ci[e]=t,function(...n){ke("console",{args:n,level:e});const s=ci[e];s==null||s.apply(Q.console,n)}})})}function Ma(e){return e==="warn"?"warning":["fatal","error","warning","log","info","debug"].includes(e)?e:"log"}const Cd="Dedupe",Md=(()=>{let e;return{name:Cd,processEvent(t){if(t.type)return t;try{if(xd(t,e))return R&&m.warn("Event dropped due to being a duplicate of previously captured event."),null}catch{}return e=t}}}),Ad=Md;function xd(e,t){return t?!!(Pd(e,t)||Nd(e,t)):!1}function Pd(e,t){const n=e.message,r=t.message;return!(!n&&!r||n&&!r||!n&&r||n!==r||!xa(e,t)||!Aa(e,t))}function Nd(e,t){const n=zi(t),r=zi(e);return!(!n||!r||n.type!==r.type||n.value!==r.value||!xa(e,t)||!Aa(e,t))}function Aa(e,t){let n=ui(e),r=ui(t);if(!n&&!r)return!0;if(n&&!r||!n&&r||(n=n,r=r,r.length!==n.length))return!1;for(let s=0;s<r.length;s++){const i=r[s],o=n[s];if(i.filename!==o.filename||i.lineno!==o.lineno||i.colno!==o.colno||i.function!==o.function)return!1}return!0}function xa(e,t){let n=e.fingerprint,r=t.fingerprint;if(!n&&!r)return!0;if(n&&!r||!n&&r)return!1;n=n,r=r;try{return n.join("")===r.join("")}catch{return!1}}function zi(e){var t,n;return(n=(t=e.exception)==null?void 0:t.values)==null?void 0:n[0]}function Od(e,t,n,r,s){if(!e.fetchData)return;const{method:i,url:o}=e.fetchData,c=xe()&&t(o);if(e.endTimestamp&&c){const p=e.fetchData.__span;if(!p)return;const h=r[p];h&&(Fd(h,e),Ld(h,e,s),delete r[p]);return}const{spanOrigin:a="auto.http.browser",propagateTraceparent:u=!1}=typeof s=="object"?s:{spanOrigin:s},d=!!de(),l=c&&d?At(Hd(o,i,a)):new Ge;if(e.fetchData.__span=l.spanContext().spanId,r[l.spanContext().spanId]=l,n(e.fetchData.url)){const p=e.args[0],h=e.args[1]||{},g=Dd(p,h,xe()&&d?l:void 0,u);g&&(e.args[1]=h,h.headers=g)}const f=z();if(f){const p={input:e.args,response:e.response,startTimestamp:e.startTimestamp,endTimestamp:e.endTimestamp};f.emit("beforeOutgoingRequestSpan",l,p)}return l}function Ld(e,t,n){var s;const r=typeof n=="object"&&n!==null?n.onRequestSpanEnd:void 0;r==null||r(e,{headers:(s=t.response)==null?void 0:s.headers,error:t.error})}function Dd(e,t,n,r){const s=Ra({span:n,propagateTraceparent:r}),i=s["sentry-trace"],o=s.baggage,c=s.traceparent;if(!i)return;const a=t.headers||(hs(e)?e.headers:void 0);if(a)if(Bd(a)){const u=new Headers(a);if(u.get("sentry-trace")||u.set("sentry-trace",i),r&&c&&!u.get("traceparent")&&u.set("traceparent",c),o){const d=u.get("baggage");d?pn(d)||u.set("baggage",`${d},${o}`):u.set("baggage",o)}return u}else if(Array.isArray(a)){const u=[...a];a.find(l=>l[0]==="sentry-trace")||u.push(["sentry-trace",i]),r&&c&&!a.find(l=>l[0]==="traceparent")&&u.push(["traceparent",c]);const d=a.find(l=>l[0]==="baggage"&&pn(l[1]));return o&&!d&&u.push(["baggage",o]),u}else{const u="sentry-trace"in a?a["sentry-trace"]:void 0,d="traceparent"in a?a.traceparent:void 0,l="baggage"in a?a.baggage:void 0,f=l?Array.isArray(l)?[...l]:[l]:[],p=l&&(Array.isArray(l)?l.find(g=>pn(g)):pn(l));o&&!p&&f.push(o);const h={...a,"sentry-trace":u??i,baggage:f.length>0?f.join(","):void 0};return r&&c&&!d&&(h.traceparent=c),h}else return{...s}}function Fd(e,t){var n,r;if(t.response){Xo(e,t.response.status);const s=(r=(n=t.response)==null?void 0:n.headers)==null?void 0:r.get("content-length");if(s){const i=parseInt(s);i>0&&e.setAttribute("http.response_content_length",i)}}else t.error&&e.setStatus({code:vt,message:"internal_error"});e.end()}function pn(e){return e.split(",").some(t=>t.trim().startsWith(Cu))}function Bd(e){return typeof Headers<"u"&&Ln(e,Headers)}function Hd(e,t,n){const r=Is(e);return{name:r?`${t} ${nd(r)}`:t,attributes:Ud(e,r,t,n)}}function Ud(e,t,n,r){const s={url:e,type:"fetch","http.method":n,[ce]:r,[Ue]:"http.client"};return t&&(Ts(t)||(s["http.url"]=t.href,s["server.address"]=t.host),t.search&&(s["http.query"]=t.search),t.hash&&(s["http.fragment"]=t.hash)),s}function Wi(e,t,n){return"util"in Q&&typeof Q.util.format=="function"?Q.util.format(...e):$d(e,t,n)}function $d(e,t,n){return e.map(r=>ot(r)?String(r):JSON.stringify(tr(r,t,n))).join(" ")}function zd(e){return/%[sdifocO]/.test(e)}function Wd(e,t){const n={},r=new Array(t.length).fill("{}").join(" ");return n["sentry.message.template"]=`${e} ${r}`,t.forEach((s,i)=>{n[`sentry.message.parameter.${i}`]=s}),n}const qd="ConsoleLogs",qi={[ce]:"auto.log.console"},jd=((e={})=>{const t=e.levels||Ko;return{name:qd,setup(n){const{enableLogs:r,normalizeDepth:s=3,normalizeMaxBreadth:i=1e3}=n.getOptions();if(!r){R&&m.warn("`enableLogs` is not enabled, ConsoleLogs integration disabled");return}Ca(({args:o,level:c})=>{if(z()!==n||!t.includes(c))return;const a=o[0],u=o.slice(1);if(c==="assert"){if(!a){const p=u.length>0?`Assertion failed: ${Wi(u,s,i)}`:"Assertion failed";Ci({level:"error",message:p,attributes:qi})}return}const d=c==="log",l=o.length>1&&typeof o[0]=="string"&&!zd(o[0]),f={...qi,...l?Wd(a,u):{}};Ci({level:d?"info":c,message:Wi(o,s,i),severityNumber:d?10:void 0,attributes:f})})}}}),Vd=jd;function Pa(e){if(e!==void 0)return e>=400&&e<500?"warning":e>=500?"error":void 0}const jt=Q;function Gd(){return"history"in jt&&!!jt.history}function Yd(){if(!("fetch"in jt))return!1;try{return new Headers,new Request("data:,"),new Response,!0}catch{return!1}}function qr(e){return e&&/^function\s+\w+\(\)\s+\{\s+\[native code\]\s+\}$/.test(e.toString())}function Jd(){var n;if(typeof EdgeRuntime=="string")return!0;if(!Yd())return!1;if(qr(jt.fetch))return!0;let e=!1;const t=jt.document;if(t&&typeof t.createElement=="function")try{const r=t.createElement("iframe");r.hidden=!0,t.head.appendChild(r),(n=r.contentWindow)!=null&&n.fetch&&(e=qr(r.contentWindow.fetch)),t.head.removeChild(r)}catch(r){R&&m.warn("Could not create sandbox iframe for pure fetch check, bailing to window.fetch: ",r)}return e}function Na(e,t){const n="fetch";Ke(n,e),Xe(n,()=>Oa(void 0,t))}function Kd(e){const t="fetch-body-resolved";Ke(t,e),Xe(t,()=>Oa(Qd))}function Oa(e,t=!1){t&&!Jd()||_e(Q,"fetch",function(n){return function(...r){const s=new Error,{method:i,url:o}=Zd(r),c={args:r,fetchData:{method:i,url:o},startTimestamp:ue()*1e3,virtualError:s,headers:ef(r)};return e||ke("fetch",{...c}),n.apply(Q,r).then(async a=>(e?e(a):ke("fetch",{...c,endTimestamp:ue()*1e3,response:a}),a),a=>{if(ke("fetch",{...c,endTimestamp:ue()*1e3,error:a}),Qo(a)&&a.stack===void 0&&(a.stack=s.stack,Dn(a,"framesToPop",1)),a instanceof TypeError&&(a.message==="Failed to fetch"||a.message==="Load failed"||a.message==="NetworkError when attempting to fetch resource."))try{const u=new URL(c.fetchData.url);a.message=`${a.message} (${u.host})`}catch{}throw a})}})}async function Xd(e,t){if(e!=null&&e.body){const n=e.body,r=n.getReader(),s=setTimeout(()=>{n.cancel().then(null,()=>{})},90*1e3);let i=!0;for(;i;){let o;try{o=setTimeout(()=>{n.cancel().then(null,()=>{})},5e3);const{done:c}=await r.read();clearTimeout(o),c&&(t(),i=!1)}catch{i=!1}finally{clearTimeout(o)}}clearTimeout(s),r.releaseLock(),n.cancel().then(null,()=>{})}}function Qd(e){let t;try{t=e.clone()}catch{return}Xd(t,()=>{ke("fetch-body-resolved",{endTimestamp:ue()*1e3,response:e})})}function Mn(e,t){return!!e&&typeof e=="object"&&!!e[t]}function ji(e){return typeof e=="string"?e:e?Mn(e,"url")?e.url:e.toString?e.toString():"":""}function Zd(e){if(e.length===0)return{method:"GET",url:""};if(e.length===2){const[n,r]=e;return{url:ji(n),method:Mn(r,"method")?String(r.method).toUpperCase():hs(n)&&Mn(n,"method")?String(n.method).toUpperCase():"GET"}}const t=e[0];return{url:ji(t),method:Mn(t,"method")?String(t.method).toUpperCase():"GET"}}function ef(e){const[t,n]=e;try{if(typeof n=="object"&&n!==null&&"headers"in n&&n.headers)return new Headers(n.headers);if(hs(t))return new Headers(t.headers)}catch{}}function tf(){return typeof __SENTRY_BROWSER_BUNDLE__<"u"&&!!__SENTRY_BROWSER_BUNDLE__}function nf(){return"npm"}function rf(){return!tf()&&Object.prototype.toString.call(typeof process<"u"?process:0)==="[object process]"}function jr(){return typeof window<"u"&&(!rf()||sf())}function sf(){const e=Q.process;return(e==null?void 0:e.type)==="renderer"}function ws(e,t){const n=ks(e,t),r={type:lf(t),value:df(t)};return n.length&&(r.stacktrace={frames:n}),r.type===void 0&&r.value===""&&(r.value="Unrecoverable error caught"),r}function of(e,t,n,r){const s=z(),i=s==null?void 0:s.getOptions().normalizeDepth,o=gf(t),c={__serialized__:Au(t,i)};if(o)return{exception:{values:[ws(e,o)]},extra:c};const a={exception:{values:[{type:ms(t)?t.constructor.name:r?"UnhandledRejection":"Error",value:hf(t,{isUnhandledRejection:r})}]},extra:c};if(n){const u=ks(e,n);u.length&&(a.exception.values[0].stacktrace={frames:u})}return a}function Cr(e,t){return{exception:{values:[ws(e,t)]}}}function ks(e,t){const n=t.stacktrace||t.stack||"",r=cf(t),s=uf(t);try{return e(n,r,s)}catch{}return[]}const af=/Minified React error #\d+;/i;function cf(e){return e&&af.test(e.message)?1:0}function uf(e){return typeof e.framesToPop=="number"?e.framesToPop:0}function La(e){return typeof WebAssembly<"u"&&typeof WebAssembly.Exception<"u"?e instanceof WebAssembly.Exception:!1}function lf(e){const t=e==null?void 0:e.name;return!t&&La(e)?e.message&&Array.isArray(e.message)&&e.message.length==2?e.message[0]:"WebAssembly.Exception":t}function df(e){const t=e==null?void 0:e.message;return La(e)?Array.isArray(e.message)&&e.message.length==2?e.message[1]:"wasm exception":t?t.error&&typeof t.error.message=="string"?t.error.message:t:"No error message"}function ff(e,t,n,r){const s=(n==null?void 0:n.syntheticException)||void 0,i=Rs(e,t,s,r);return Fn(i),i.level="error",n!=null&&n.event_id&&(i.event_id=n.event_id),ps(i)}function pf(e,t,n="info",r,s){const i=(r==null?void 0:r.syntheticException)||void 0,o=Vr(e,t,i,s);return o.level=n,r!=null&&r.event_id&&(o.event_id=r.event_id),ps(o)}function Rs(e,t,n,r,s){let i;if(Zo(t)&&t.error)return Cr(e,t.error);if(li(t)||Mu(t)){const o=t;if("stack"in t)i=Cr(e,t);else{const c=o.name||(li(o)?"DOMError":"DOMException"),a=o.message?`${c}: ${o.message}`:c;i=Vr(e,a,n,r),di(i,a)}return"code"in o&&(i.tags={...i.tags,"DOMException.code":`${o.code}`}),i}return Qo(t)?Cr(e,t):$r(t)||ms(t)?(i=of(e,t,n,s),Fn(i,{synthetic:!0}),i):(i=Vr(e,t,n,r),di(i,`${t}`),Fn(i,{synthetic:!0}),i)}function Vr(e,t,n,r){const s={};if(r&&n){const i=ks(e,n);i.length&&(s.exception={values:[{value:t,stacktrace:{frames:i}}]}),Fn(s,{synthetic:!0})}if(fs(t)){const{__sentry_template_string__:i,__sentry_template_values__:o}=t;return s.logentry={message:i,params:o},s}return s.message=t,s}function hf(e,{isUnhandledRejection:t}){const n=xu(e),r=t?"promise rejection":"exception";return Zo(e)?`Event \`ErrorEvent\` captured as ${r} with message \`${e.message}\``:ms(e)?`Event \`${mf(e)}\` (type=${e.type}) captured as ${r}`:`Object captured as ${r} with keys: ${n}`}function mf(e){try{const t=Object.getPrototypeOf(e);return t?t.constructor.name:void 0}catch{}}function gf(e){for(const t in e)if(Object.prototype.hasOwnProperty.call(e,t)){const n=e[t];if(n instanceof Error)return n}}class _f extends Vl{constructor(t){var d;const n=Sf(t),r=F.SENTRY_SDK_SOURCE||nf();ka(n,"browser",["browser"],r),(d=n._metadata)!=null&&d.sdk&&(n._metadata.sdk.settings={infer_ip:n.sendDefaultPii?"auto":"never",...n._metadata.sdk.settings}),super(n);const{sendDefaultPii:s,sendClientReports:i,enableLogs:o,_experiments:c,enableMetrics:a}=this._options,u=a??(c==null?void 0:c.enableMetrics)??!0;F.document&&(i||o||u)&&F.document.addEventListener("visibilitychange",()=>{F.document.visibilityState==="hidden"&&(i&&this._flushOutcomes(),o&&ys(this),u&&ma(this))}),s&&this.on("beforeSendSession",ad)}eventFromException(t,n){return ff(this._options.stackParser,t,n,this._options.attachStacktrace)}eventFromMessage(t,n="info",r){return pf(this._options.stackParser,t,n,r,this._options.attachStacktrace)}_prepareEvent(t,n,r,s){return t.platform=t.platform||"javascript",super._prepareEvent(t,n,r,s)}}function Sf(e){var t;return{release:typeof __SENTRY_RELEASE__=="string"?__SENTRY_RELEASE__:(t=F.SENTRY_RELEASE)==null?void 0:t.id,sendClientReports:!0,parentSpanIsAlwaysRootSpan:!0,...e}}const at=typeof __SENTRY_DEBUG__>"u"||__SENTRY_DEBUG__,A=Q,yf=(e,t)=>e>t[1]?"poor":e>t[0]?"needs-improvement":"good",tn=(e,t,n,r)=>{let s,i;return o=>{t.value>=0&&(o||r)&&(i=t.value-(s??0),(i||s===void 0)&&(s=t.value,t.delta=i,t.rating=yf(t.value,n),e(t)))}},nn=(e=!0)=>{var n,r;const t=(r=(n=A.performance)==null?void 0:n.getEntriesByType)==null?void 0:r.call(n,"navigation")[0];if(!e||t&&t.responseStart>0&&t.responseStart<performance.now())return t},xt=()=>{const e=nn();return(e==null?void 0:e.activationStart)??0};function it(e,t,n){A.document&&A.addEventListener(e,t,n)}function Cs(e,t,n){A.document&&A.removeEventListener(e,t,n)}let bt=-1;const Da=new Set,Ef=()=>{var e,t;return((e=A.document)==null?void 0:e.visibilityState)==="hidden"&&!((t=A.document)!=null&&t.prerendering)?0:1/0},An=e=>{if(bf(e)&&bt>-1){if(e.type==="visibilitychange"||e.type==="pagehide")for(const t of Da)t();isFinite(bt)||(bt=e.type==="visibilitychange"?e.timeStamp:0,Cs("prerenderingchange",An,!0))}},rn=()=>{var e;if(A.document&&bt<0){const t=xt();bt=(A.document.prerendering||(e=globalThis.performance.getEntriesByType("visibility-state").filter(r=>r.name==="hidden"&&r.startTime>t)[0])==null?void 0:e.startTime)??Ef(),it("visibilitychange",An,!0),it("pagehide",An,!0),it("prerenderingchange",An,!0)}return{get firstHiddenTime(){return bt},onHidden(t){Da.add(t)}}};function bf(e){var t;return e.type==="pagehide"||((t=A.document)==null?void 0:t.visibilityState)==="hidden"}const vf=()=>`v5-${Date.now()}-${Math.floor(Math.random()*(9e12-1))+1e12}`,sn=(e,t=-1)=>{var i,o;const n=nn();let r="navigate";return n&&((i=A.document)!=null&&i.prerendering||xt()>0?r="prerender":(o=A.document)!=null&&o.wasDiscarded?r="restore":n.type&&(r=n.type.replace(/_/g,"-"))),{name:e,value:t,rating:"good",delta:0,entries:[],id:vf(),navigationType:r}},Mr=new WeakMap;function Ms(e,t){return Mr.get(e)||Mr.set(e,new t),Mr.get(e)}class Wn{constructor(){Wn.prototype.__init.call(this),Wn.prototype.__init2.call(this)}__init(){this._sessionValue=0}__init2(){this._sessionEntries=[]}_processEntry(t){var s;if(t.hadRecentInput)return;const n=this._sessionEntries[0],r=this._sessionEntries[this._sessionEntries.length-1];this._sessionValue&&n&&r&&t.startTime-r.startTime<1e3&&t.startTime-n.startTime<5e3?(this._sessionValue+=t.value,this._sessionEntries.push(t)):(this._sessionValue=t.value,this._sessionEntries=[t]),(s=this._onAfterProcessingUnexpectedShift)==null||s.call(this,t)}}const Pt=(e,t,n={})=>{try{if(PerformanceObserver.supportedEntryTypes.includes(e)){const r=new PerformanceObserver(s=>{Promise.resolve().then(()=>{t(s.getEntries())})});return r.observe({type:e,buffered:!0,...n}),r}}catch{}},As=e=>{let t=!1;return()=>{t||(e(),t=!0)}},cr=e=>{var t;(t=A.document)!=null&&t.prerendering?addEventListener("prerenderingchange",()=>e(),!0):e()},Tf=[1800,3e3],If=(e,t={})=>{cr(()=>{const n=rn(),r=sn("FCP");let s;const o=Pt("paint",c=>{for(const a of c)a.name==="first-contentful-paint"&&(o.disconnect(),a.startTime<n.firstHiddenTime&&(r.value=Math.max(a.startTime-xt(),0),r.entries.push(a),s(!0)))});o&&(s=tn(e,r,Tf,t.reportAllChanges))})},wf=[.1,.25],kf=(e,t={})=>{If(As(()=>{var a;const n=sn("CLS",0);let r;const s=rn(),i=Ms(t,Wn),o=u=>{for(const d of u)i._processEntry(d);i._sessionValue>n.value&&(n.value=i._sessionValue,n.entries=i._sessionEntries,r())},c=Pt("layout-shift",o);c&&(r=tn(e,n,wf,t.reportAllChanges),s.onHidden(()=>{o(c.takeRecords()),r(!0)}),(a=A==null?void 0:A.setTimeout)==null||a.call(A,r))}))};let Fa=0,Ar=1/0,hn=0;const Rf=e=>{e.forEach(t=>{t.interactionId&&(Ar=Math.min(Ar,t.interactionId),hn=Math.max(hn,t.interactionId),Fa=hn?(hn-Ar)/7+1:0)})};let Gr;const Ba=()=>Gr?Fa:performance.interactionCount||0,Cf=()=>{"interactionCount"in performance||Gr||(Gr=Pt("event",Rf,{type:"event",buffered:!0,durationThreshold:0}))},xr=10;let Ha=0;const Mf=()=>Ba()-Ha;class qn{constructor(){qn.prototype.__init.call(this),qn.prototype.__init2.call(this)}__init(){this._longestInteractionList=[]}__init2(){this._longestInteractionMap=new Map}_resetInteractions(){Ha=Ba(),this._longestInteractionList.length=0,this._longestInteractionMap.clear()}_estimateP98LongestInteraction(){const t=Math.min(this._longestInteractionList.length-1,Math.floor(Mf()/50));return this._longestInteractionList[t]}_processEntry(t){var s,i;if((s=this._onBeforeProcessingEntry)==null||s.call(this,t),!(t.interactionId||t.entryType==="first-input"))return;const n=this._longestInteractionList.at(-1);let r=this._longestInteractionMap.get(t.interactionId);if(r||this._longestInteractionList.length<xr||t.duration>n._latency){if(r?t.duration>r._latency?(r.entries=[t],r._latency=t.duration):t.duration===r._latency&&t.startTime===r.entries[0].startTime&&r.entries.push(t):(r={id:t.interactionId,entries:[t],_latency:t.duration},this._longestInteractionMap.set(r.id,r),this._longestInteractionList.push(r)),this._longestInteractionList.sort((o,c)=>c._latency-o._latency),this._longestInteractionList.length>xr){const o=this._longestInteractionList.splice(xr);for(const c of o)this._longestInteractionMap.delete(c.id)}(i=this._onAfterProcessingINPCandidate)==null||i.call(this,r)}}}const Ua=e=>{const t=n=>{var r;(n.type==="pagehide"||((r=A.document)==null?void 0:r.visibilityState)==="hidden")&&e(n)};it("visibilitychange",t,!0),it("pagehide",t,!0)},$a=e=>{var n;const t=A.requestIdleCallback||A.setTimeout;((n=A.document)==null?void 0:n.visibilityState)==="hidden"?e():(e=As(e),it("visibilitychange",e,{once:!0,capture:!0}),t(()=>{e(),Cs("visibilitychange",e,{capture:!0})}),Ua(e))},Af=[200,500],xf=40,Pf=(e,t={})=>{if(!(globalThis.PerformanceEventTiming&&"interactionId"in PerformanceEventTiming.prototype))return;const n=rn();cr(()=>{Cf();const r=sn("INP");let s;const i=Ms(t,qn),o=a=>{$a(()=>{for(const d of a)i._processEntry(d);const u=i._estimateP98LongestInteraction();u&&u._latency!==r.value&&(r.value=u._latency,r.entries=u.entries,s())})},c=Pt("event",o,{durationThreshold:t.durationThreshold??xf});s=tn(e,r,Af,t.reportAllChanges),c&&(c.observe({type:"first-input",buffered:!0}),n.onHidden(()=>{o(c.takeRecords()),s(!0)}))})};class Nf{_processEntry(t){var n;(n=this._onBeforeProcessingEntry)==null||n.call(this,t)}}const Of=[2500,4e3],Lf=(e,t={})=>{cr(()=>{const n=rn(),r=sn("LCP");let s;const i=Ms(t,Nf),o=a=>{t.reportAllChanges||(a=a.slice(-1));for(const u of a)i._processEntry(u),u.startTime<n.firstHiddenTime&&(r.value=Math.max(u.startTime-xt(),0),r.entries=[u],s())},c=Pt("largest-contentful-paint",o);if(c){s=tn(e,r,Of,t.reportAllChanges);const a=As(()=>{o(c.takeRecords()),c.disconnect(),s(!0)}),u=d=>{d.isTrusted&&($a(a),Cs(d.type,u,{capture:!0}))};for(const d of["keydown","click","visibilitychange"])it(d,u,{capture:!0})}})},Df=[800,1800],Yr=e=>{var t,n;(t=A.document)!=null&&t.prerendering?cr(()=>Yr(e)):((n=A.document)==null?void 0:n.readyState)!=="complete"?addEventListener("load",()=>Yr(e),!0):setTimeout(e)},Ff=(e,t={})=>{const n=sn("TTFB"),r=tn(e,n,Df,t.reportAllChanges);Yr(()=>{const s=nn();s&&(n.value=Math.max(s.responseStart-xt(),0),n.entries=[s],r(!0))})},Bt={},jn={};let za,Wa,qa,ja;function xs(e,t=!1){return ur("cls",e,Hf,za,t)}function Ps(e,t=!1){return ur("lcp",e,Uf,Wa,t)}function Bf(e){return ur("ttfb",e,$f,qa)}function Va(e){return ur("inp",e,zf,ja)}function ct(e,t){return Ga(e,t),jn[e]||(Wf(e),jn[e]=!0),Ya(e,t)}function on(e,t){const n=Bt[e];if(n!=null&&n.length)for(const r of n)try{r(t)}catch(s){at&&m.error(`Error while triggering instrumentation handler.
8
+ `)}`)}function il(e){if(!R)return;const{description:t="< unknown name >",op:n="< unknown op >"}=H(e),{spanId:r}=e.spanContext(),i=le(e)===e,o=`[Tracing] Finishing "${n}" ${i?"root ":""}span "${t}" with ID ${r}`;m.log(o)}function ol(e,t,n,r=de()){const s=r&&le(r);s&&(R&&m.log(`[Measurement] Setting measurement on root span: ${e} = ${t} ${n}`),s.addEvent(e,{[Jt]:t,[Yt]:n}))}function yi(e){if(!e||e.length===0)return;const t={};return e.forEach(n=>{const r=n.attributes||{},s=r[Yt],i=r[Jt];typeof s=="string"&&typeof i=="number"&&(t[n.name]={value:i,unit:s})}),t}const Ei=1e3;class ar{constructor(t={}){this._traceId=t.traceId||On(),this._spanId=t.spanId||Ot(),this._startTime=t.startTimestamp||ue(),this._links=t.links,this._attributes={},this.setAttributes({[ae]:"manual",[Fe]:t.op,...t.attributes}),this._name=t.name,t.parentSpanId&&(this._parentSpanId=t.parentSpanId),"sampled"in t&&(this._sampled=t.sampled),t.endTimestamp&&(this._endTime=t.endTimestamp),this._events=[],this._isStandaloneSpan=t.isStandalone,this._endTime&&this._onSpanEnded()}addLink(t){return this._links?this._links.push(t):this._links=[t],this}addLinks(t){return this._links?this._links.push(...t):this._links=t,this}recordException(t,n){}spanContext(){const{_spanId:t,_traceId:n,_sampled:r}=this;return{spanId:t,traceId:n,traceFlags:r?au:No}}setAttribute(t,n){return n===void 0?delete this._attributes[t]:this._attributes[t]=n,this}setAttributes(t){return Object.keys(t).forEach(n=>this.setAttribute(n,t[n])),this}updateStartTime(t){this._startTime=Nt(t)}setStatus(t){return this._status=t,this}updateName(t){return this._name=t,this.setAttribute(Re,"custom"),this}end(t){this._endTime||(this._endTime=Nt(t),il(this),this._onSpanEnded())}getSpanJSON(){return{data:this._attributes,description:this._name,op:this._attributes[Fe],parent_span_id:this._parentSpanId,span_id:this._spanId,start_timestamp:this._startTime,status:uu(this._status),timestamp:this._endTime,trace_id:this._traceId,origin:this._attributes[ae],profile_id:this._attributes[us],exclusive_time:this._attributes[It],measurements:yi(this._events),is_segment:this._isStandaloneSpan&&le(this)===this||void 0,segment_id:this._isStandaloneSpan?le(this).spanContext().spanId:void 0,links:cu(this._links)}}isRecording(){return!this._endTime&&!!this._sampled}addEvent(t,n,r){R&&m.log("[Tracing] Adding an event to span:",t);const s=bi(n)?n:r||ue(),i=bi(n)?{}:n||{},o={name:t,time:Nt(s),attributes:i};return this._events.push(o),this}isStandaloneSpan(){return!!this._isStandaloneSpan}_onSpanEnded(){const t=$();if(t&&t.emit("spanEnd",this),!(this._isStandaloneSpan||this===le(this)))return;if(this._isStandaloneSpan){this._sampled?cl(rl([this],t)):(R&&m.log("[Tracing] Discarding standalone span because its trace was not chosen to be sampled."),t&&t.recordDroppedEvent("sample_rate","span"));return}const r=this._convertSpanToTransaction();r&&(ti(this).scope||te()).captureEvent(r)}_convertSpanToTransaction(){if(!vi(H(this)))return;this._name||(R&&m.warn("Transaction has no name, falling back to `<unlabeled transaction>`."),this._name="<unlabeled transaction>");const{scope:t,isolationScope:n}=ti(this),r=t?.getScopeData().sdkProcessingMetadata?.normalizedRequest;if(this._sampled!==!0)return;const i=bn(this).filter(d=>d!==this&&!al(d)).map(d=>H(d)).filter(vi),o=this._attributes[Re];delete this._attributes[ni],i.forEach(d=>{delete d.data[ni]});const c={contexts:{trace:lu(this)},spans:i.length>Ei?i.sort((d,l)=>d.start_timestamp-l.start_timestamp).slice(0,Ei):i,start_timestamp:this._startTime,timestamp:this._endTime,transaction:this._name,type:"transaction",sdkProcessingMetadata:{capturedSpanScope:t,capturedSpanIsolationScope:n,dynamicSamplingContext:De(this)},request:r,...o&&{transaction_info:{source:o}}},a=yi(this._events);return a&&Object.keys(a).length&&(R&&m.log("[Measurements] Adding measurements to transaction event",JSON.stringify(a,void 0,2)),c.measurements=a),c}}function bi(e){return e&&typeof e=="number"||e instanceof Date||Array.isArray(e)}function vi(e){return!!e.start_timestamp&&!!e.timestamp&&!!e.span_id&&!!e.trace_id}function al(e){return e instanceof ar&&e.isStandaloneSpan()}function cl(e){const t=$();if(!t)return;const n=e[1];if(!n||n.length===0){t.recordDroppedEvent("before_send","span");return}t.sendEnvelope(e)}function ul(e,t,n=()=>{},r=()=>{}){let s;try{s=e()}catch(i){throw t(i),n(),i}return ll(s,t,n,r)}function ll(e,t,n,r){return Lo(e)?e.then(s=>(n(),r(s),s),s=>{throw t(s),n(),s}):(n(),r(e),e)}function dl(e,t,n){if(!Ce(e))return[!1];let r,s;typeof e.tracesSampler=="function"?(s=e.tracesSampler({...t,inheritOrSampleWith:c=>typeof t.parentSampleRate=="number"?t.parentSampleRate:typeof t.parentSampled=="boolean"?Number(t.parentSampled):c}),r=!0):t.parentSampled!==void 0?s=t.parentSampled:typeof e.tracesSampleRate<"u"&&(s=e.tracesSampleRate,r=!0);const i=Ut(s);if(i===void 0)return R&&m.warn(`[Tracing] Discarding root span because of invalid sample rate. Sample rate must be a boolean or a number between 0 and 1. Got ${JSON.stringify(s)} of type ${JSON.stringify(typeof s)}.`),[!1];if(!i)return R&&m.log(`[Tracing] Discarding transaction because ${typeof e.tracesSampler=="function"?"tracesSampler returned 0 or false":"a negative sampling decision was inherited or tracesSampleRate is set to 0"}`),[!1,i,r];const o=n<i;return o||R&&m.log(`[Tracing] Discarding transaction because it's not included in the random sample (sampling rate = ${Number(s)})`),[o,i,r]}const ia="__SENTRY_SUPPRESS_TRACING__";function fl(e,t){const n=_s();if(n.startSpan)return n.startSpan(e,t);const r=aa(e),{forceTransaction:s,parentSpan:i,scope:o}=e,c=o?.clone();return rr(c,()=>hl(i)(()=>{const u=te(),d=ca(u,i),f=e.onlyIfParent&&!d?new qe:oa({parentSpan:d,spanArguments:r,forceTransaction:s,scope:u});return sr(u,f),ul(()=>t(f),()=>{const{status:p}=H(f);f.isRecording()&&(!p||p==="ok")&&f.setStatus({code:St,message:"internal_error"})},()=>{f.end()})}))}function kt(e){const t=_s();if(t.startInactiveSpan)return t.startInactiveSpan(e);const n=aa(e),{forceTransaction:r,parentSpan:s}=e;return(e.scope?o=>rr(e.scope,o):s!==void 0?o=>gs(s,o):o=>o())(()=>{const o=te(),c=ca(o,s);return e.onlyIfParent&&!c?new qe:oa({parentSpan:c,spanArguments:n,forceTransaction:r,scope:o})})}function gs(e,t){const n=_s();return n.withActiveSpan?n.withActiveSpan(e,t):rr(r=>(sr(r,e||void 0),t(r)))}function oa({parentSpan:e,spanArguments:t,forceTransaction:n,scope:r}){if(!Ce()){const o=new qe;if(n||!e){const c={sampled:"false",sample_rate:"0",transaction:t.name,...De(o)};vn(o,c)}return o}const s=wt();let i;if(e&&!n)i=pl(e,r,t),Uo(e,i);else if(e){const o=De(e),{traceId:c,spanId:a}=e.spanContext(),u=nr(e);i=Ti({traceId:c,parentSpanId:a,...t},r,u),vn(i,o)}else{const{traceId:o,dsc:c,parentSpanId:a,sampled:u}={...s.getPropagationContext(),...r.getPropagationContext()};i=Ti({traceId:o,parentSpanId:a,...t},r,u),c&&vn(i,c)}return sl(i),du(i,r,s),i}function aa(e){const n={isStandalone:(e.experimental||{}).standalone,...e};if(e.startTime){const r={...n};return r.startTimestamp=Nt(e.startTime),delete r.startTime,r}return n}function _s(){const e=Do();return Fo(e)}function Ti(e,t,n){const r=$(),s=r?.getOptions()||{},{name:i=""}=e,o={spanAttributes:{...e.attributes},spanName:i,parentSampled:n};r?.emit("beforeSampling",o,{decision:!1});const c=o.parentSampled??n,a=o.spanAttributes,u=t.getPropagationContext(),[d,l,f]=t.getScopeData().sdkProcessingMetadata[ia]?[!1]:dl(s,{name:i,parentSampled:c,attributes:a,parentSampleRate:Ut(u.dsc?.sample_rate)},u.sampleRand),p=new ar({...e,attributes:{[Re]:"custom",[Ho]:l!==void 0&&f?l:void 0,...a},sampled:d});return!d&&r&&(R&&m.log("[Tracing] Discarding root span because its trace was not chosen to be sampled."),r.recordDroppedEvent("sample_rate","transaction")),r&&r.emit("spanStart",p),p}function pl(e,t,n){const{spanId:r,traceId:s}=e.spanContext(),i=t.getScopeData().sdkProcessingMetadata[ia]?!1:nr(e),o=i?new ar({...n,parentSpanId:r,traceId:s,sampled:i}):new qe({traceId:s});Uo(e,o);const c=$();return c&&(c.emit("spanStart",o),n.endTimestamp&&c.emit("spanEnd",o)),o}function ca(e,t){if(t)return t;if(t===null)return;const n=Bo(e);if(!n)return;const r=$();return(r?r.getOptions():{}).parentSpanIsAlwaysRootSpan?le(n):n}function hl(e){return e!==void 0?t=>gs(e,t):t=>t()}const wn={idleTimeout:1e3,finalTimeout:3e4,childSpanTimeout:15e3},ml="heartbeatFailed",gl="idleTimeout",_l="finalTimeout",Sl="externalFinish";function ua(e,t={}){const n=new Map;let r=!1,s,i=Sl,o=!t.disableAutoFinish;const c=[],{idleTimeout:a=wn.idleTimeout,finalTimeout:u=wn.finalTimeout,childSpanTimeout:d=wn.childSpanTimeout,beforeSpanEnd:l,trimIdleSpanEndTimestamp:f=!0}=t,p=$();if(!p||!Ce()){const _=new qe,I={sample_rate:"0",sampled:"false",...De(_)};return vn(_,I),_}const h=te(),g=de(),S=yl(e);S.end=new Proxy(S.end,{apply(_,I,Y){if(l&&l(S),I instanceof qe)return;const[E,...k]=Y,F=E||ue(),q=Nt(F),P=bn(S).filter(w=>w!==S),ce=H(S);if(!P.length||!f)return A(q),Reflect.apply(_,I,[q,...k]);const J=p.getOptions().ignoreSpans,ee=P?.reduce((w,K)=>{const ne=H(K);return!ne.timestamp||J&&Dn(ne,J)?w:w?Math.max(w,ne.timestamp):ne.timestamp},void 0),b=ce.start_timestamp,G=Math.min(b?b+u/1e3:1/0,Math.max(b||-1/0,Math.min(q,ee||1/0)));return A(G),Reflect.apply(_,I,[G,...k])}});function y(){s&&(clearTimeout(s),s=void 0)}function T(_){y(),s=setTimeout(()=>{!r&&n.size===0&&o&&(i=gl,S.end(_))},a)}function B(_){s=setTimeout(()=>{!r&&o&&(i=ml,S.end(_))},d)}function N(_){y(),n.set(_,!0);const I=ue();B(I+d/1e3)}function z(_){if(n.has(_)&&n.delete(_),n.size===0){const I=ue();T(I+a/1e3)}}function A(_){r=!0,n.clear(),c.forEach(P=>P()),sr(h,g);const I=H(S),{start_timestamp:Y}=I;if(!Y)return;I.data[Ht]||S.setAttribute(Ht,i);const k=I.status;(!k||k==="unknown")&&S.setStatus({code:fu}),m.log(`[Tracing] Idle span "${I.op}" finished`);const F=bn(S).filter(P=>P!==S);let q=0;F.forEach(P=>{P.isRecording()&&(P.setStatus({code:St,message:"cancelled"}),P.end(_),R&&m.log("[Tracing] Cancelling span since span ended early",JSON.stringify(P,void 0,2)));const ce=H(P),{timestamp:J=0,start_timestamp:ee=0}=ce,b=ee<=_,G=(u+a)/1e3,w=J-ee<=G;if(R){const K=JSON.stringify(P,void 0,2);b?w||m.log("[Tracing] Discarding span since it finished after idle span final timeout",K):m.log("[Tracing] Discarding span since it happened after idle span was finished",K)}(!w||!b)&&(pu(S,P),q++)}),q>0&&S.setAttribute("sentry.idle_span_discarded_spans",q)}return c.push(p.on("spanStart",_=>{if(r||_===S||H(_).timestamp||_ instanceof ar&&_.isStandaloneSpan())return;bn(S).includes(_)&&N(_.spanContext().spanId)})),c.push(p.on("spanEnd",_=>{r||z(_.spanContext().spanId)})),c.push(p.on("idleSpanEnableAutoFinish",_=>{_===S&&(o=!0,T(),n.size&&B())})),t.disableAutoFinish||T(),setTimeout(()=>{r||(S.setStatus({code:St,message:"deadline_exceeded"}),i=_l,S.end())},u),S}function yl(e){const t=kt(e);return sr(te(),t),R&&m.log("[Tracing] Started span is an idle span"),t}const Ii=[];function El(e){const t={};return e.forEach(n=>{const{name:r}=n,s=t[r];s&&!s.isDefaultInstance&&n.isDefaultInstance||(t[r]=n)}),Object.values(t)}function bl(e){const t=e.defaultIntegrations||[],n=e.integrations;t.forEach(s=>{s.isDefaultInstance=!0});let r;if(Array.isArray(n))r=[...t,...n];else if(typeof n=="function"){const s=n(t);r=Array.isArray(s)?s:[s]}else r=t;return El(r)}function vl(e,t){const n={};return t.forEach(r=>{r&&la(e,r,n)}),n}function wi(e,t){for(const n of t)n?.afterAllSetup&&n.afterAllSetup(e)}function la(e,t,n){if(n[t.name]){R&&m.log(`Integration skipped because it was already installed: ${t.name}`);return}if(n[t.name]=t,!Ii.includes(t.name)&&typeof t.setupOnce=="function"&&(t.setupOnce(),Ii.push(t.name)),t.setup&&typeof t.setup=="function"&&t.setup(e),typeof t.preprocessEvent=="function"){const r=t.preprocessEvent.bind(t);e.on("preprocessEvent",(s,i)=>r(s,i,e))}if(typeof t.processEvent=="function"){const r=t.processEvent.bind(t),s=Object.assign((i,o)=>r(i,o,e),{id:t.name});e.addEventProcessor(s)}R&&m.log(`Integration installed: ${t.name}`)}function Tl(e){return typeof e=="object"&&e!=null&&!Array.isArray(e)&&Object.keys(e).includes("value")}function Il(e,t){const{value:n,unit:r}=Tl(e)?e:{value:e,unit:void 0},s=wl(n),i=r&&typeof r=="string"?{unit:r}:{};if(s)return{...s,...i};if(!t)return;let o="";try{o=JSON.stringify(n)??""}catch{}return{value:o,type:"string",...i}}function ki(e,t=!1){const n={};for(const[r,s]of Object.entries(e)){const i=Il(s,t);i&&(n[r]=i)}return n}function wl(e){const t=typeof e=="string"?"string":typeof e=="boolean"?"boolean":typeof e=="number"&&!Number.isNaN(e)?Number.isInteger(e)?"integer":"double":null;if(t)return{value:e,type:t}}function kl(e,t){return t?rr(t,()=>{const n=de(),r=n?hu(n):$o(t);return[n?De(n):ls(e,t),r]}):[void 0,void 0]}const Rl={trace:1,debug:5,info:9,warn:13,error:17,fatal:21};function Cl(e){return[{type:"log",item_count:e.length,content_type:"application/vnd.sentry.items.log+json"},{items:e}]}function Ml(e,t,n,r){const s={};return t?.sdk&&(s.sdk={name:t.sdk.name,version:t.sdk.version}),n&&r&&(s.dsn=ot(r)),Be(s,[Cl(e)])}const Al=100;function Ae(e,t,n,r=!0){n&&(!e[t]||r)&&(e[t]=n)}function xl(e,t){const n=ys(),r=da(e);r===void 0?n.set(e,[t]):r.length>=Al?(Ss(e,r),n.set(e,[t])):n.set(e,[...r,t])}function Ri(e,t=te(),n=xl){const r=t?.getClient()??$();if(!r){R&&m.warn("No client available to capture log.");return}const{release:s,environment:i,enableLogs:o=!1,beforeSendLog:c}=r.getOptions();if(!o){R&&m.warn("logging option not enabled, log will not be captured.");return}const[,a]=kl(r,t),u={...e.attributes},{user:{id:d,email:l,username:f},attributes:p={}}=Ol(t);Ae(u,"user.id",d,!1),Ae(u,"user.email",l,!1),Ae(u,"user.name",f,!1),Ae(u,"sentry.release",s),Ae(u,"sentry.environment",i);const{name:h,version:g}=r.getSdkMetadata()?.sdk??{};Ae(u,"sentry.sdk.name",h),Ae(u,"sentry.sdk.version",g);const S=r.getIntegrationByName("Replay"),y=S?.getReplayId(!0);Ae(u,"sentry.replay_id",y),y&&S?.getRecordingMode()==="buffer"&&Ae(u,"sentry._internal.replay_is_buffering",!0);const T=e.message;if(ds(T)){const{__sentry_template_string__:k,__sentry_template_values__:F=[]}=T;F?.length&&(u["sentry.message.template"]=k),F.forEach((q,P)=>{u[`sentry.message.parameter.${P}`]=q})}const B=Bo(t);Ae(u,"sentry.trace.parent_span_id",B?.spanContext().spanId);const N={...e,attributes:u};r.emit("beforeCaptureLog",N);const z=c?Kt(()=>c(N)):N;if(!z){r.recordDroppedEvent("before_send","log_item",1),R&&m.warn("beforeSendLog returned null, log will not be captured.");return}const{level:A,message:_,attributes:I={},severityNumber:Y}=z,E={timestamp:ue(),level:A,body:_,trace_id:a?.trace_id,severity_number:Y??Rl[A],attributes:{...ki(p),...ki(I,!0)}};n(r,E),r.emit("afterCaptureLog",z)}function Ss(e,t){const n=t??da(e)??[];if(n.length===0)return;const r=e.getOptions(),s=Ml(n,r._metadata,r.tunnel,e.getDsn());ys().set(e,[]),e.emit("flushLogs"),e.sendEnvelope(s)}function da(e){return ys().get(e)}function Ol(e){const t=Tn().getScopeData();return ri(t,wt().getScopeData()),ri(t,e.getScopeData()),t}function ys(){return Wo("clientToLogBufferMap",()=>new WeakMap)}function Nl(e){return[{type:"trace_metric",item_count:e.length,content_type:"application/vnd.sentry.items.trace-metric+json"},{items:e}]}function Pl(e,t,n,r){const s={};return t?.sdk&&(s.sdk={name:t.sdk.name,version:t.sdk.version}),n&&r&&(s.dsn=ot(r)),Be(s,[Nl(e)])}function fa(e,t){const n=t??Ll(e)??[];if(n.length===0)return;const r=e.getOptions(),s=Pl(n,r._metadata,r.tunnel,e.getDsn());pa().set(e,[]),e.emit("flushMetrics"),e.sendEnvelope(s)}function Ll(e){return pa().get(e)}function pa(){return Wo("clientToMetricBufferMap",()=>new WeakMap)}const Es=Symbol.for("SentryBufferFullError");function bs(e=100){const t=new Set;function n(){return t.size<e}function r(o){t.delete(o)}function s(o){if(!n())return zo(Es);const c=o();return t.add(c),c.then(()=>r(c),()=>r(c)),c}function i(o){if(!t.size)return fs(!0);const c=Promise.allSettled(Array.from(t)).then(()=>!0);if(!o)return c;const a=[c,new Promise(u=>setTimeout(()=>u(!1),o))];return Promise.race(a)}return{get $(){return Array.from(t)},add:s,drain:i}}const Dl=60*1e3;function ha(e,t=Date.now()){const n=parseInt(`${e}`,10);if(!isNaN(n))return n*1e3;const r=Date.parse(`${e}`);return isNaN(r)?Dl:r-t}function Fl(e,t){return e[t]||e.all||0}function ma(e,t,n=Date.now()){return Fl(e,t)>n}function ga(e,{statusCode:t,headers:n},r=Date.now()){const s={...e},i=n?.["x-sentry-rate-limits"],o=n?.["retry-after"];if(i)for(const c of i.trim().split(",")){const[a,u,,,d]=c.split(":",5),l=parseInt(a,10),f=(isNaN(l)?60:l)*1e3;if(!u)s.all=r+f;else for(const p of u.split(";"))p==="metric_bucket"?(!d||d.split(";").includes("custom"))&&(s[p]=r+f):s[p]=r+f}else o?s.all=r+ha(o,r):t===429&&(s.all=r+60*1e3);return s}const _a=64;function Bl(e,t,n=bs(e.bufferSize||_a)){let r={};const s=o=>n.drain(o);function i(o){const c=[];if(Fn(o,(l,f)=>{const p=Si(f);ma(r,p)?e.recordDroppedEvent("ratelimit_backoff",p):c.push(l)}),c.length===0)return Promise.resolve({});const a=Be(o[0],c),u=l=>{Fn(a,(f,p)=>{e.recordDroppedEvent(l,Si(p))})},d=()=>t({body:Un(a)}).then(l=>(l.statusCode!==void 0&&(l.statusCode<200||l.statusCode>=300)&&R&&m.warn(`Sentry responded with status code ${l.statusCode} to sent event.`),r=ga(r,l),l),l=>{throw u("network_error"),R&&m.error("Encountered error running transport request:",l),l});return n.add(d).then(l=>l,l=>{if(l===Es)return R&&m.error("Skipped sending event because buffer is full."),u("queue_overflow"),Promise.resolve({});throw l})}return{send:i,flush:s}}function Ul(e,t,n){const r=[{type:"client_report"},{timestamp:ir(),discarded_events:e}];return Be(t?{dsn:t}:{},[r])}function Sa(e){const t=[];e.message&&t.push(e.message);try{const n=e.exception.values[e.exception.values.length-1];n?.value&&(t.push(n.value),n.type&&t.push(`${n.type}: ${n.value}`))}catch{}return t}function Hl(e){const{trace_id:t,parent_span_id:n,span_id:r,status:s,origin:i,data:o,op:c}=e.contexts?.trace??{};return{data:o??{},description:e.transaction,op:c,parent_span_id:n,span_id:r??"",start_timestamp:e.start_timestamp??0,status:s,timestamp:e.timestamp,trace_id:t??"",origin:i,profile_id:o?.[us],exclusive_time:o?.[It],measurements:e.measurements,is_segment:!0}}function $l(e){return{type:"transaction",timestamp:e.timestamp,start_timestamp:e.start_timestamp,transaction:e.description,contexts:{trace:{trace_id:e.trace_id,span_id:e.span_id,parent_span_id:e.parent_span_id,op:e.op,status:e.status,origin:e.origin,data:{...e.data,...e.profile_id&&{[us]:e.profile_id},...e.exclusive_time&&{[It]:e.exclusive_time}}}},measurements:e.measurements}}const Ci="Not capturing exception because it's already been captured.",Mi="Discarded session because of missing or non-string release",ya=Symbol.for("SentryInternalError"),Ea=Symbol.for("SentryDoNotSendEventError"),Wl=5e3;function kn(e){return{message:e,[ya]:!0}}function Ir(e){return{message:e,[Ea]:!0}}function Ai(e){return!!e&&typeof e=="object"&&ya in e}function xi(e){return!!e&&typeof e=="object"&&Ea in e}function Oi(e,t,n,r,s){let i=0,o,c=!1;e.on(n,()=>{i=0,clearTimeout(o),c=!1}),e.on(t,a=>{i+=r(a),i>=8e5?s(e):c||(c=!0,o=setTimeout(()=>{s(e)},Wl))}),e.on("flush",()=>{s(e)})}class zl{constructor(t){if(this._options=t,this._integrations={},this._numProcessing=0,this._outcomes={},this._hooks={},this._eventProcessors=[],this._promiseBuffer=bs(t.transportOptions?.bufferSize??_a),t.dsn?this._dsn=mu(t.dsn):R&&m.warn("No DSN provided, client will not send events."),this._dsn){const r=gu(this._dsn,t.tunnel,t._metadata?t._metadata.sdk:void 0);this._transport=t.transport({tunnel:this._options.tunnel,recordDroppedEvent:this.recordDroppedEvent.bind(this),...t.transportOptions,url:r})}this._options.enableLogs=this._options.enableLogs??this._options._experiments?.enableLogs,this._options.enableLogs&&Oi(this,"afterCaptureLog","flushLogs",Gl,Ss),(this._options.enableMetrics??this._options._experiments?.enableMetrics??!0)&&Oi(this,"afterCaptureMetric","flushMetrics",Vl,fa)}captureException(t,n,r){const s=Me();if(si(t))return R&&m.log(Ci),s;const i={event_id:s,...n};return this._process(()=>this.eventFromException(t,i).then(o=>this._captureEvent(o,i,r)).then(o=>o),"error"),i.event_id}captureMessage(t,n,r,s){const i={event_id:Me(),...r},o=ds(t)?t:String(t),c=rt(t),a=c?this.eventFromMessage(o,n,i):this.eventFromException(t,i);return this._process(()=>a.then(u=>this._captureEvent(u,i,s)),c?"unknown":"error"),i.event_id}captureEvent(t,n,r){const s=Me();if(n?.originalException&&si(n.originalException))return R&&m.log(Ci),s;const i={event_id:s,...n},o=t.sdkProcessingMetadata||{},c=o.capturedSpanScope,a=o.capturedSpanIsolationScope,u=Ni(t.type);return this._process(()=>this._captureEvent(t,i,c||r,a),u),i.event_id}captureSession(t){this.sendSession(t),ii(t,{init:!1})}getDsn(){return this._dsn}getOptions(){return this._options}getSdkMetadata(){return this._options._metadata}getTransport(){return this._transport}async flush(t){const n=this._transport;if(!n)return!0;this.emit("flush");const r=await this._isClientDoneProcessing(t),s=await n.flush(t);return r&&s}async close(t){const n=await this.flush(t);return this.getOptions().enabled=!1,this.emit("close"),n}getEventProcessors(){return this._eventProcessors}addEventProcessor(t){this._eventProcessors.push(t)}init(){(this._isEnabled()||this._options.integrations.some(({name:t})=>t.startsWith("Spotlight")))&&this._setupIntegrations()}getIntegrationByName(t){return this._integrations[t]}addIntegration(t){const n=this._integrations[t.name];la(this,t,this._integrations),n||wi(this,[t])}sendEvent(t,n={}){this.emit("beforeSendEvent",t,n);let r=nl(t,this._dsn,this._options._metadata,this._options.tunnel);for(const s of n.attachments||[])r=Gu(r,Qu(s));this.sendEnvelope(r).then(s=>this.emit("afterSendEvent",t,s))}sendSession(t){const{release:n,environment:r=qo}=this._options;if("aggregates"in t){const i=t.attrs||{};if(!i.release&&!n){R&&m.warn(Mi);return}i.release=i.release||n,i.environment=i.environment||r,t.attrs=i}else{if(!t.release&&!n){R&&m.warn(Mi);return}t.release=t.release||n,t.environment=t.environment||r}this.emit("beforeSendSession",t);const s=tl(t,this._dsn,this._options._metadata,this._options.tunnel);this.sendEnvelope(s)}recordDroppedEvent(t,n,r=1){if(this._options.sendClientReports){const s=`${t}:${n}`;R&&m.log(`Recording outcome: "${s}"${r>1?` (${r} times)`:""}`),this._outcomes[s]=(this._outcomes[s]||0)+r}}on(t,n){const r=this._hooks[t]=this._hooks[t]||new Set,s=(...i)=>n(...i);return r.add(s),()=>{r.delete(s)}}emit(t,...n){const r=this._hooks[t];r&&r.forEach(s=>s(...n))}async sendEnvelope(t){if(this.emit("beforeEnvelope",t),this._isEnabled()&&this._transport)try{return await this._transport.send(t)}catch(n){return R&&m.error("Error while sending envelope:",n),{}}return R&&m.error("Transport disabled"),{}}_setupIntegrations(){const{integrations:t}=this._options;this._integrations=vl(this,t),wi(this,t)}_updateSessionFromEvent(t,n){let r=n.level==="fatal",s=!1;const i=n.exception?.values;if(i){s=!0,r=!1;for(const a of i)if(a.mechanism?.handled===!1){r=!0;break}}const o=t.status==="ok";(o&&t.errors===0||o&&r)&&(ii(t,{...r&&{status:"crashed"},errors:t.errors||Number(s||r)}),this.captureSession(t))}async _isClientDoneProcessing(t){let n=0;for(;!t||n<t;){if(await new Promise(r=>setTimeout(r,1)),!this._numProcessing)return!0;n++}return!1}_isEnabled(){return this.getOptions().enabled!==!1&&this._transport!==void 0}_prepareEvent(t,n,r,s){const i=this.getOptions(),o=Object.keys(this._integrations);return!n.integrations&&o?.length&&(n.integrations=o),this.emit("preprocessEvent",t,n),t.type||s.setLastEventId(t.event_id||n.event_id),jo(i,t,n,r,this,s).then(c=>{if(c===null)return c;this.emit("postprocessEvent",c,n),c.contexts={trace:$o(r),...c.contexts};const a=ls(this,r);return c.sdkProcessingMetadata={dynamicSamplingContext:a,...c.sdkProcessingMetadata},c})}_captureEvent(t,n={},r=te(),s=wt()){return R&&$r(t)&&m.log(`Captured error event \`${Sa(t)[0]||"<unknown>"}\``),this._processEvent(t,n,r,s).then(i=>i.event_id,i=>{R&&(xi(i)?m.log(i.message):Ai(i)?m.warn(i.message):m.warn(i))})}_processEvent(t,n,r,s){const i=this.getOptions(),{sampleRate:o}=i,c=ba(t),a=$r(t),d=`before send for type \`${t.type||"error"}\``,l=typeof o>"u"?void 0:Ut(o);if(a&&typeof l=="number"&&Math.random()>l)return this.recordDroppedEvent("sample_rate","error"),zo(Ir(`Discarding event because it's not included in the random sample (sampling rate = ${o})`));const f=Ni(t.type);return this._prepareEvent(t,n,r,s).then(p=>{if(p===null)throw this.recordDroppedEvent("event_processor",f),Ir("An event processor returned `null`, will not send event.");if(n.data&&n.data.__sentry__===!0)return p;const g=jl(this,i,p,n);return ql(g,d)}).then(p=>{if(p===null){if(this.recordDroppedEvent("before_send",f),c){const y=1+(t.spans||[]).length;this.recordDroppedEvent("before_send","span",y)}throw Ir(`${d} returned \`null\`, will not send event.`)}const h=r.getSession()||s.getSession();if(a&&h&&this._updateSessionFromEvent(h,p),c){const S=p.sdkProcessingMetadata?.spanCountBeforeProcessing||0,y=p.spans?p.spans.length:0,T=S-y;T>0&&this.recordDroppedEvent("before_send","span",T)}const g=p.transaction_info;if(c&&g&&p.transaction!==t.transaction){const S="custom";p.transaction_info={...g,source:S}}return this.sendEvent(p,n),p}).then(null,p=>{throw xi(p)||Ai(p)?p:(this.captureException(p,{mechanism:{handled:!1,type:"internal"},data:{__sentry__:!0},originalException:p}),kn(`Event processing pipeline threw an error, original event will not be sent. Details have been sent as a new event.
9
+ Reason: ${p}`))})}_process(t,n){this._numProcessing++,this._promiseBuffer.add(t).then(r=>(this._numProcessing--,r),r=>(this._numProcessing--,r===Es&&this.recordDroppedEvent("queue_overflow",n),r))}_clearOutcomes(){const t=this._outcomes;return this._outcomes={},Object.entries(t).map(([n,r])=>{const[s,i]=n.split(":");return{reason:s,category:i,quantity:r}})}_flushOutcomes(){R&&m.log("Flushing outcomes...");const t=this._clearOutcomes();if(t.length===0){R&&m.log("No outcomes to send");return}if(!this._dsn){R&&m.log("No dsn provided, will not send outcomes");return}R&&m.log("Sending outcomes:",t);const n=Ul(t,this._options.tunnel&&ot(this._dsn));this.sendEnvelope(n)}}function Ni(e){return e==="replay_event"?"replay":e||"error"}function ql(e,t){const n=`${t} must return \`null\` or a valid event.`;if(Lo(e))return e.then(r=>{if(!Hr(r)&&r!==null)throw kn(n);return r},r=>{throw kn(`${t} rejected with ${r}`)});if(!Hr(e)&&e!==null)throw kn(n);return e}function jl(e,t,n,r){const{beforeSend:s,beforeSendTransaction:i,beforeSendSpan:o,ignoreSpans:c}=t;let a=n;if($r(a)&&s)return s(a,r);if(ba(a)){if(o||c){const u=Hl(a);if(c?.length&&Dn(u,c))return null;if(o){const d=o(u);d?a=_u(n,$l(d)):Ur()}if(a.spans){const d=[],l=a.spans;for(const p of l){if(c?.length&&Dn(p,c)){ju(l,p);continue}if(o){const h=o(p);h?d.push(h):(Ur(),d.push(p))}else d.push(p)}const f=a.spans.length-d.length;f&&e.recordDroppedEvent("before_send","span",f),a.spans=d}}if(i){if(a.spans){const u=a.spans.length;a.sdkProcessingMetadata={...n.sdkProcessingMetadata,spanCountBeforeProcessing:u}}return i(a,r)}}return a}function $r(e){return e.type===void 0}function ba(e){return e.type==="transaction"}function Vl(e){let t=0;return e.name&&(t+=e.name.length*2),t+=8,t+va(e.attributes)}function Gl(e){let t=0;return e.message&&(t+=e.message.length*2),t+va(e.attributes)}function va(e){if(!e)return 0;let t=0;return Object.values(e).forEach(n=>{Array.isArray(n)?t+=n.length*Pi(n[0]):rt(n)?t+=Pi(n):t+=100}),t}function Pi(e){return typeof e=="string"?e.length*2:typeof e=="number"?8:typeof e=="boolean"?4:0}function Yl(e,t){t.debug===!0&&(R?m.enable():Kt(()=>{console.warn("[Sentry] Cannot initialize SDK with `debug` option using a non-debug bundle.")})),te().update(t.initialScope);const r=new e(t);return Jl(r),r.init(),r}function Jl(e){te().setClient(e)}const wr=100,kr=5e3,Kl=36e5;function Xl(e){function t(...n){R&&m.log("[Offline]:",...n)}return n=>{const r=e(n);if(!n.createStore)throw new Error("No `createStore` function was provided");const s=n.createStore(n);let i=kr,o;function c(l,f,p){return _i(l,["client_report"])?!1:n.shouldStore?n.shouldStore(l,f,p):!0}function a(l){o&&clearTimeout(o),o=setTimeout(async()=>{o=void 0;const f=await s.shift();f&&(t("Attempting to send previously queued event"),f[0].sent_at=new Date().toISOString(),d(f,!0).catch(p=>{t("Failed to retry sending",p)}))},l),typeof o!="number"&&o.unref&&o.unref()}function u(){o||(a(i),i=Math.min(i*2,Kl))}async function d(l,f=!1){if(!f&&_i(l,["replay_event","replay_recording"]))return await s.push(l),a(wr),{};try{if(n.shouldSend&&await n.shouldSend(l)===!1)throw new Error("Envelope not sent because `shouldSend` callback returned false");const p=await r.send(l);let h=wr;if(p){if(p.headers?.["retry-after"])h=ha(p.headers["retry-after"]);else if(p.headers?.["x-sentry-rate-limits"])h=6e4;else if((p.statusCode||0)>=400)return p}return a(h),i=kr,p}catch(p){if(await c(l,p,i))return f?await s.unshift(l):await s.push(l),u(),t("Error sending. Event queued.",p),{};throw p}}return n.flushAtStartup&&u(),{send:d,flush:l=>(l===void 0&&(i=kr,a(wr)),r.flush(l))}}}const Ql="thismessage:/";function vs(e){return"isRelative"in e}function Ts(e,t){const n=e.indexOf("://")<=0&&e.indexOf("//")!==0,r=n?Ql:void 0;try{if("canParse"in URL&&!URL.canParse(e,r))return;const s=new URL(e,r);return n?{isRelative:n,pathname:s.pathname,search:s.search,hash:s.hash}:s}catch{}}function Zl(e){if(vs(e))return e.pathname;const t=new URL(e);return t.search="",t.hash="",["80","443"].includes(t.port)&&(t.port=""),t.password&&(t.password="%filtered%"),t.username&&(t.username="%filtered%"),t.toString()}function tt(e){if(!e)return{};const t=e.match(/^(([^:/?#]+):)?(\/\/([^/?#]*))?([^?#]*)(\?([^#]*))?(#(.*))?$/);if(!t)return{};const n=t[6]||"",r=t[8]||"";return{host:t[4],path:t[5],protocol:t[2],search:n,hash:r,relative:t[5]+n+r}}function ed(e){return e.split(/[?#]/,1)[0]}function td(e,t){const n=t?.getDsn(),r=t?.getOptions().tunnel;return rd(e,n)||nd(e,r)}function nd(e,t){return t?Li(e)===Li(t):!1}function rd(e,t){const n=Ts(e);return!n||vs(n)?!1:t?n.host.includes(t.host)&&/(^|&|\?)sentry_key=/.test(n.search):!1}function Li(e){return e[e.length-1]==="/"?e.slice(0,-1):e}function sd(e){"aggregates"in e?e.attrs?.ip_address===void 0&&(e.attrs={...e.attrs,ip_address:"{{auto}}"}):e.ipAddress===void 0&&(e.ipAddress="{{auto}}")}function Ta(e,t,n=[t],r="npm"){const s=e._metadata||{};s.sdk||(s.sdk={name:`sentry.javascript.${t}`,packages:n.map(i=>({name:`${r}:@sentry/${i}`,version:oi})),version:oi}),e._metadata=s}function Ia(e={}){const t=e.client||$();if(!Su()||!t)return{};const n=Do(),r=Fo(n);if(r.getTraceData)return r.getTraceData(e);const s=e.scope||te(),i=e.span||de(),o=i?yu(i):id(s),c=i?De(i):ls(t,s),a=Eu(c);if(!bu.test(o))return m.warn("Invalid sentry-trace data. Cannot generate trace data"),{};const d={"sentry-trace":o,baggage:a};return e.propagateTraceparent&&(d.traceparent=i?vu(i):od(s)),d}function id(e){const{traceId:t,sampled:n,propagationSpanId:r}=e.getPropagationContext();return Tu(t,r,n)}function od(e){const{traceId:t,sampled:n,propagationSpanId:r}=e.getPropagationContext();return Iu(t,r,n)}function ad(e,t,n){let r,s,i;const o=n?.maxWait?Math.max(n.maxWait,t):0,c=n?.setTimeoutImpl||setTimeout;function a(){return u(),r=e(),r}function u(){s!==void 0&&clearTimeout(s),i!==void 0&&clearTimeout(i),s=i=void 0}function d(){return s!==void 0||i!==void 0?a():r}function l(){return s&&clearTimeout(s),s=c(a,t),o&&i===void 0&&(i=c(a,o)),r}return l.cancel=u,l.flush=d,l}const cd=100;function je(e,t){const n=$(),r=wt();if(!n)return;const{beforeBreadcrumb:s=null,maxBreadcrumbs:i=cd}=n.getOptions();if(i<=0)return;const c={timestamp:ir(),...e},a=s?Kt(()=>s(c,t)):c;a!==null&&(n.emit&&n.emit("beforeAddBreadcrumb",a,t),r.addBreadcrumb(a,i))}let Di;const ud="FunctionToString",Fi=new WeakMap,ld=(()=>({name:ud,setupOnce(){Di=Function.prototype.toString;try{Function.prototype.toString=function(...e){const t=Vo(this),n=Fi.has($())&&t!==void 0?t:this;return Di.apply(n,e)}}catch{}},setup(e){Fi.set(e,!0)}})),dd=ld,fd=[/^Script error\.?$/,/^Javascript error: Script error\.? on line 0$/,/^ResizeObserver loop completed with undelivered notifications.$/,/^Cannot redefine property: googletag$/,/^Can't find variable: gmo$/,/^undefined is not an object \(evaluating 'a\.[A-Z]'\)$/,`can't redefine non-configurable property "solana"`,"vv().getRestrictions is not a function. (In 'vv().getRestrictions(1,a)', 'vv().getRestrictions' is undefined)","Can't find variable: _AutofillCallbackHandler",/^Non-Error promise rejection captured with value: Object Not Found Matching Id:\d+, MethodName:simulateEvent, ParamCount:\d+$/,/^Java exception was raised during method invocation$/],pd="EventFilters",hd=(e={})=>{let t;return{name:pd,setup(n){const r=n.getOptions();t=Bi(e,r)},processEvent(n,r,s){if(!t){const i=s.getOptions();t=Bi(e,i)}return gd(n,t)?null:n}}},md=((e={})=>({...hd(e),name:"InboundFilters"}));function Bi(e={},t={}){return{allowUrls:[...e.allowUrls||[],...t.allowUrls||[]],denyUrls:[...e.denyUrls||[],...t.denyUrls||[]],ignoreErrors:[...e.ignoreErrors||[],...t.ignoreErrors||[],...e.disableErrorDefaults?[]:fd],ignoreTransactions:[...e.ignoreTransactions||[],...t.ignoreTransactions||[]]}}function gd(e,t){if(e.type){if(e.type==="transaction"&&Sd(e,t.ignoreTransactions))return R&&m.warn(`Event dropped due to being matched by \`ignoreTransactions\` option.
10
+ Event: ${Xe(e)}`),!0}else{if(_d(e,t.ignoreErrors))return R&&m.warn(`Event dropped due to being matched by \`ignoreErrors\` option.
11
+ Event: ${Xe(e)}`),!0;if(vd(e))return R&&m.warn(`Event dropped due to not having an error message, error type or stacktrace.
12
+ Event: ${Xe(e)}`),!0;if(yd(e,t.denyUrls))return R&&m.warn(`Event dropped due to being matched by \`denyUrls\` option.
13
+ Event: ${Xe(e)}.
14
+ Url: ${Hn(e)}`),!0;if(!Ed(e,t.allowUrls))return R&&m.warn(`Event dropped due to not being matched by \`allowUrls\` option.
15
+ Event: ${Xe(e)}.
16
+ Url: ${Hn(e)}`),!0}return!1}function _d(e,t){return t?.length?Sa(e).some(n=>Pe(n,t)):!1}function Sd(e,t){if(!t?.length)return!1;const n=e.transaction;return n?Pe(n,t):!1}function yd(e,t){if(!t?.length)return!1;const n=Hn(e);return n?Pe(n,t):!1}function Ed(e,t){if(!t?.length)return!0;const n=Hn(e);return n?Pe(n,t):!0}function bd(e=[]){for(let t=e.length-1;t>=0;t--){const n=e[t];if(n&&n.filename!=="<anonymous>"&&n.filename!=="[native code]")return n.filename||null}return null}function Hn(e){try{const n=[...e.exception?.values??[]].reverse().find(r=>r.mechanism?.parent_id===void 0&&r.stacktrace?.frames?.length)?.stacktrace?.frames;return n?bd(n):null}catch{return R&&m.error(`Cannot extract url for event ${Xe(e)}`),null}}function vd(e){return e.exception?.values?.length?!e.message&&!e.exception.values.some(t=>t.stacktrace||t.type&&t.type!=="Error"||t.value):!1}function Td(e,t,n,r,s,i){if(!s.exception?.values||!i||!Nn(i.originalException,Error))return;const o=s.exception.values.length>0?s.exception.values[s.exception.values.length-1]:void 0;o&&(s.exception.values=Wr(e,t,r,i.originalException,n,s.exception.values,o,0))}function Wr(e,t,n,r,s,i,o,c){if(i.length>=n+1)return i;let a=[...i];if(Nn(r[s],Error)){Ui(o,c);const u=e(t,r[s]),d=a.length;Hi(u,s,d,c),a=Wr(e,t,n,r[s],s,[u,...a],u,d)}return Array.isArray(r.errors)&&r.errors.forEach((u,d)=>{if(Nn(u,Error)){Ui(o,c);const l=e(t,u),f=a.length;Hi(l,`errors[${d}]`,f,c),a=Wr(e,t,n,u,s,[l,...a],l,f)}}),a}function Ui(e,t){e.mechanism={handled:!0,type:"auto.core.linked_errors",...e.mechanism,...e.type==="AggregateError"&&{is_exception_group:!0},exception_id:t}}function Hi(e,t,n,r){e.mechanism={handled:!0,...e.mechanism,type:"chained",source:t,exception_id:n,parent_id:r}}function wa(e){const t="console";Ge(t,e),Ye(t,Id)}function Id(){"console"in X&&Go.forEach(function(e){e in X.console&&_e(X.console,e,function(t){return ai[e]=t,function(...n){Te("console",{args:n,level:e}),ai[e]?.apply(X.console,n)}})})}function ka(e){return e==="warn"?"warning":["fatal","error","warning","log","info","debug"].includes(e)?e:"log"}const wd="Dedupe",kd=(()=>{let e;return{name:wd,processEvent(t){if(t.type)return t;try{if(Cd(t,e))return R&&m.warn("Event dropped due to being a duplicate of previously captured event."),null}catch{}return e=t}}}),Rd=kd;function Cd(e,t){return t?!!(Md(e,t)||Ad(e,t)):!1}function Md(e,t){const n=e.message,r=t.message;return!(!n&&!r||n&&!r||!n&&r||n!==r||!Ca(e,t)||!Ra(e,t))}function Ad(e,t){const n=$i(t),r=$i(e);return!(!n||!r||n.type!==r.type||n.value!==r.value||!Ca(e,t)||!Ra(e,t))}function Ra(e,t){let n=ci(e),r=ci(t);if(!n&&!r)return!0;if(n&&!r||!n&&r||(n=n,r=r,r.length!==n.length))return!1;for(let s=0;s<r.length;s++){const i=r[s],o=n[s];if(i.filename!==o.filename||i.lineno!==o.lineno||i.colno!==o.colno||i.function!==o.function)return!1}return!0}function Ca(e,t){let n=e.fingerprint,r=t.fingerprint;if(!n&&!r)return!0;if(n&&!r||!n&&r)return!1;n=n,r=r;try{return n.join("")===r.join("")}catch{return!1}}function $i(e){return e.exception?.values?.[0]}function xd(e,t,n,r,s){if(!e.fetchData)return;const{method:i,url:o}=e.fetchData,c=Ce()&&t(o);if(e.endTimestamp&&c){const p=e.fetchData.__span;if(!p)return;const h=r[p];h&&(Pd(h,e),Od(h,e,s),delete r[p]);return}const{spanOrigin:a="auto.http.browser",propagateTraceparent:u=!1}=typeof s=="object"?s:{spanOrigin:s},d=!!de(),l=c&&d?kt(Dd(o,i,a)):new qe;if(e.fetchData.__span=l.spanContext().spanId,r[l.spanContext().spanId]=l,n(e.fetchData.url)){const p=e.args[0],h=e.args[1]||{},g=Nd(p,h,Ce()&&d?l:void 0,u);g&&(e.args[1]=h,h.headers=g)}const f=$();if(f){const p={input:e.args,response:e.response,startTimestamp:e.startTimestamp,endTimestamp:e.endTimestamp};f.emit("beforeOutgoingRequestSpan",l,p)}return l}function Od(e,t,n){(typeof n=="object"&&n!==null?n.onRequestSpanEnd:void 0)?.(e,{headers:t.response?.headers,error:t.error})}function Nd(e,t,n,r){const s=Ia({span:n,propagateTraceparent:r}),i=s["sentry-trace"],o=s.baggage,c=s.traceparent;if(!i)return;const a=t.headers||(ps(e)?e.headers:void 0);if(a)if(Ld(a)){const u=new Headers(a);if(u.get("sentry-trace")||u.set("sentry-trace",i),r&&c&&!u.get("traceparent")&&u.set("traceparent",c),o){const d=u.get("baggage");d?ln(d)||u.set("baggage",`${d},${o}`):u.set("baggage",o)}return u}else if(Array.isArray(a)){const u=[...a];a.find(l=>l[0]==="sentry-trace")||u.push(["sentry-trace",i]),r&&c&&!a.find(l=>l[0]==="traceparent")&&u.push(["traceparent",c]);const d=a.find(l=>l[0]==="baggage"&&ln(l[1]));return o&&!d&&u.push(["baggage",o]),u}else{const u="sentry-trace"in a?a["sentry-trace"]:void 0,d="traceparent"in a?a.traceparent:void 0,l="baggage"in a?a.baggage:void 0,f=l?Array.isArray(l)?[...l]:[l]:[],p=l&&(Array.isArray(l)?l.find(g=>ln(g)):ln(l));o&&!p&&f.push(o);const h={...a,"sentry-trace":u??i,baggage:f.length>0?f.join(","):void 0};return r&&c&&!d&&(h.traceparent=c),h}else return{...s}}function Pd(e,t){if(t.response){Yo(e,t.response.status);const n=t.response?.headers?.get("content-length");if(n){const r=parseInt(n);r>0&&e.setAttribute("http.response_content_length",r)}}else t.error&&e.setStatus({code:St,message:"internal_error"});e.end()}function ln(e){return e.split(",").some(t=>t.trim().startsWith(wu))}function Ld(e){return typeof Headers<"u"&&Nn(e,Headers)}function Dd(e,t,n){const r=Ts(e);return{name:r?`${t} ${Zl(r)}`:t,attributes:Fd(e,r,t,n)}}function Fd(e,t,n,r){const s={url:e,type:"fetch","http.method":n,[ae]:r,[Fe]:"http.client"};return t&&(vs(t)||(s["http.url"]=t.href,s["server.address"]=t.host),t.search&&(s["http.query"]=t.search),t.hash&&(s["http.fragment"]=t.hash)),s}function Wi(e,t,n){return"util"in X&&typeof X.util.format=="function"?X.util.format(...e):Bd(e,t,n)}function Bd(e,t,n){return e.map(r=>rt(r)?String(r):JSON.stringify(tr(r,t,n))).join(" ")}function Ud(e){return/%[sdifocO]/.test(e)}function Hd(e,t){const n={},r=new Array(t.length).fill("{}").join(" ");return n["sentry.message.template"]=`${e} ${r}`,t.forEach((s,i)=>{n[`sentry.message.parameter.${i}`]=s}),n}const $d="ConsoleLogs",zi={[ae]:"auto.log.console"},Wd=((e={})=>{const t=e.levels||Go;return{name:$d,setup(n){const{enableLogs:r,normalizeDepth:s=3,normalizeMaxBreadth:i=1e3}=n.getOptions();if(!r){R&&m.warn("`enableLogs` is not enabled, ConsoleLogs integration disabled");return}wa(({args:o,level:c})=>{if($()!==n||!t.includes(c))return;const a=o[0],u=o.slice(1);if(c==="assert"){if(!a){const p=u.length>0?`Assertion failed: ${Wi(u,s,i)}`:"Assertion failed";Ri({level:"error",message:p,attributes:zi})}return}const d=c==="log",l=o.length>1&&typeof o[0]=="string"&&!Ud(o[0]),f={...zi,...l?Hd(a,u):{}};Ri({level:d?"info":c,message:Wi(o,s,i),severityNumber:d?10:void 0,attributes:f})})}}}),zd=Wd;function Ma(e){if(e!==void 0)return e>=400&&e<500?"warning":e>=500?"error":void 0}const Wt=X;function qd(){return"history"in Wt&&!!Wt.history}function jd(){if(!("fetch"in Wt))return!1;try{return new Headers,new Request("data:,"),new Response,!0}catch{return!1}}function zr(e){return e&&/^function\s+\w+\(\)\s+\{\s+\[native code\]\s+\}$/.test(e.toString())}function Vd(){if(typeof EdgeRuntime=="string")return!0;if(!jd())return!1;if(zr(Wt.fetch))return!0;let e=!1;const t=Wt.document;if(t&&typeof t.createElement=="function")try{const n=t.createElement("iframe");n.hidden=!0,t.head.appendChild(n),n.contentWindow?.fetch&&(e=zr(n.contentWindow.fetch)),t.head.removeChild(n)}catch(n){R&&m.warn("Could not create sandbox iframe for pure fetch check, bailing to window.fetch: ",n)}return e}function Aa(e,t){const n="fetch";Ge(n,e),Ye(n,()=>xa(void 0,t))}function Gd(e){const t="fetch-body-resolved";Ge(t,e),Ye(t,()=>xa(Jd))}function xa(e,t=!1){t&&!Vd()||_e(X,"fetch",function(n){return function(...r){const s=new Error,{method:i,url:o}=Kd(r),c={args:r,fetchData:{method:i,url:o},startTimestamp:ue()*1e3,virtualError:s,headers:Xd(r)};return e||Te("fetch",{...c}),n.apply(X,r).then(async a=>(e?e(a):Te("fetch",{...c,endTimestamp:ue()*1e3,response:a}),a),a=>{if(Te("fetch",{...c,endTimestamp:ue()*1e3,error:a}),Jo(a)&&a.stack===void 0&&(a.stack=s.stack,Pn(a,"framesToPop",1)),a instanceof TypeError&&(a.message==="Failed to fetch"||a.message==="Load failed"||a.message==="NetworkError when attempting to fetch resource."))try{const u=new URL(c.fetchData.url);a.message=`${a.message} (${u.host})`}catch{}throw a})}})}async function Yd(e,t){if(e?.body){const n=e.body,r=n.getReader(),s=setTimeout(()=>{n.cancel().then(null,()=>{})},90*1e3);let i=!0;for(;i;){let o;try{o=setTimeout(()=>{n.cancel().then(null,()=>{})},5e3);const{done:c}=await r.read();clearTimeout(o),c&&(t(),i=!1)}catch{i=!1}finally{clearTimeout(o)}}clearTimeout(s),r.releaseLock(),n.cancel().then(null,()=>{})}}function Jd(e){let t;try{t=e.clone()}catch{return}Yd(t,()=>{Te("fetch-body-resolved",{endTimestamp:ue()*1e3,response:e})})}function Rn(e,t){return!!e&&typeof e=="object"&&!!e[t]}function qi(e){return typeof e=="string"?e:e?Rn(e,"url")?e.url:e.toString?e.toString():"":""}function Kd(e){if(e.length===0)return{method:"GET",url:""};if(e.length===2){const[n,r]=e;return{url:qi(n),method:Rn(r,"method")?String(r.method).toUpperCase():ps(n)&&Rn(n,"method")?String(n.method).toUpperCase():"GET"}}const t=e[0];return{url:qi(t),method:Rn(t,"method")?String(t.method).toUpperCase():"GET"}}function Xd(e){const[t,n]=e;try{if(typeof n=="object"&&n!==null&&"headers"in n&&n.headers)return new Headers(n.headers);if(ps(t))return new Headers(t.headers)}catch{}}function Qd(){return typeof __SENTRY_BROWSER_BUNDLE__<"u"&&!!__SENTRY_BROWSER_BUNDLE__}function Zd(){return"npm"}function ef(){return!Qd()&&Object.prototype.toString.call(typeof process<"u"?process:0)==="[object process]"}function qr(){return typeof window<"u"&&(!ef()||tf())}function tf(){return X.process?.type==="renderer"}function Is(e,t){const n=ws(e,t),r={type:af(t),value:cf(t)};return n.length&&(r.stacktrace={frames:n}),r.type===void 0&&r.value===""&&(r.value="Unrecoverable error caught"),r}function nf(e,t,n,r){const i=$()?.getOptions().normalizeDepth,o=pf(t),c={__serialized__:Ru(t,i)};if(o)return{exception:{values:[Is(e,o)]},extra:c};const a={exception:{values:[{type:hs(t)?t.constructor.name:r?"UnhandledRejection":"Error",value:df(t,{isUnhandledRejection:r})}]},extra:c};if(n){const u=ws(e,n);u.length&&(a.exception.values[0].stacktrace={frames:u})}return a}function Rr(e,t){return{exception:{values:[Is(e,t)]}}}function ws(e,t){const n=t.stacktrace||t.stack||"",r=sf(t),s=of(t);try{return e(n,r,s)}catch{}return[]}const rf=/Minified React error #\d+;/i;function sf(e){return e&&rf.test(e.message)?1:0}function of(e){return typeof e.framesToPop=="number"?e.framesToPop:0}function Oa(e){return typeof WebAssembly<"u"&&typeof WebAssembly.Exception<"u"?e instanceof WebAssembly.Exception:!1}function af(e){const t=e?.name;return!t&&Oa(e)?e.message&&Array.isArray(e.message)&&e.message.length==2?e.message[0]:"WebAssembly.Exception":t}function cf(e){const t=e?.message;return Oa(e)?Array.isArray(e.message)&&e.message.length==2?e.message[1]:"wasm exception":t?t.error&&typeof t.error.message=="string"?t.error.message:t:"No error message"}function uf(e,t,n,r){const s=n?.syntheticException||void 0,i=ks(e,t,s,r);return Ln(i),i.level="error",n?.event_id&&(i.event_id=n.event_id),fs(i)}function lf(e,t,n="info",r,s){const i=r?.syntheticException||void 0,o=jr(e,t,i,s);return o.level=n,r?.event_id&&(o.event_id=r.event_id),fs(o)}function ks(e,t,n,r,s){let i;if(Ko(t)&&t.error)return Rr(e,t.error);if(ui(t)||ku(t)){const o=t;if("stack"in t)i=Rr(e,t);else{const c=o.name||(ui(o)?"DOMError":"DOMException"),a=o.message?`${c}: ${o.message}`:c;i=jr(e,a,n,r),li(i,a)}return"code"in o&&(i.tags={...i.tags,"DOMException.code":`${o.code}`}),i}return Jo(t)?Rr(e,t):Hr(t)||hs(t)?(i=nf(e,t,n,s),Ln(i,{synthetic:!0}),i):(i=jr(e,t,n,r),li(i,`${t}`),Ln(i,{synthetic:!0}),i)}function jr(e,t,n,r){const s={};if(r&&n){const i=ws(e,n);i.length&&(s.exception={values:[{value:t,stacktrace:{frames:i}}]}),Ln(s,{synthetic:!0})}if(ds(t)){const{__sentry_template_string__:i,__sentry_template_values__:o}=t;return s.logentry={message:i,params:o},s}return s.message=t,s}function df(e,{isUnhandledRejection:t}){const n=Cu(e),r=t?"promise rejection":"exception";return Ko(e)?`Event \`ErrorEvent\` captured as ${r} with message \`${e.message}\``:hs(e)?`Event \`${ff(e)}\` (type=${e.type}) captured as ${r}`:`Object captured as ${r} with keys: ${n}`}function ff(e){try{const t=Object.getPrototypeOf(e);return t?t.constructor.name:void 0}catch{}}function pf(e){for(const t in e)if(Object.prototype.hasOwnProperty.call(e,t)){const n=e[t];if(n instanceof Error)return n}}class hf extends zl{constructor(t){const n=mf(t),r=D.SENTRY_SDK_SOURCE||Zd();Ta(n,"browser",["browser"],r),n._metadata?.sdk&&(n._metadata.sdk.settings={infer_ip:n.sendDefaultPii?"auto":"never",...n._metadata.sdk.settings}),super(n);const{sendDefaultPii:s,sendClientReports:i,enableLogs:o,_experiments:c,enableMetrics:a}=this._options,u=a??c?.enableMetrics??!0;D.document&&(i||o||u)&&D.document.addEventListener("visibilitychange",()=>{D.document.visibilityState==="hidden"&&(i&&this._flushOutcomes(),o&&Ss(this),u&&fa(this))}),s&&this.on("beforeSendSession",sd)}eventFromException(t,n){return uf(this._options.stackParser,t,n,this._options.attachStacktrace)}eventFromMessage(t,n="info",r){return lf(this._options.stackParser,t,n,r,this._options.attachStacktrace)}_prepareEvent(t,n,r,s){return t.platform=t.platform||"javascript",super._prepareEvent(t,n,r,s)}}function mf(e){return{release:typeof __SENTRY_RELEASE__=="string"?__SENTRY_RELEASE__:D.SENTRY_RELEASE?.id,sendClientReports:!0,parentSpanIsAlwaysRootSpan:!0,...e}}const st=typeof __SENTRY_DEBUG__>"u"||__SENTRY_DEBUG__,O=X,gf=(e,t)=>e>t[1]?"poor":e>t[0]?"needs-improvement":"good",Qt=(e,t,n,r)=>{let s,i;return o=>{t.value>=0&&(o||r)&&(i=t.value-(s??0),(i||s===void 0)&&(s=t.value,t.delta=i,t.rating=gf(t.value,n),e(t)))}},Zt=(e=!0)=>{const t=O.performance?.getEntriesByType?.("navigation")[0];if(!e||t&&t.responseStart>0&&t.responseStart<performance.now())return t},Rt=()=>Zt()?.activationStart??0;function nt(e,t,n){O.document&&O.addEventListener(e,t,n)}function Rs(e,t,n){O.document&&O.removeEventListener(e,t,n)}let _t=-1;const Na=new Set,_f=()=>O.document?.visibilityState==="hidden"&&!O.document?.prerendering?0:1/0,Cn=e=>{if(Sf(e)&&_t>-1){if(e.type==="visibilitychange"||e.type==="pagehide")for(const t of Na)t();isFinite(_t)||(_t=e.type==="visibilitychange"?e.timeStamp:0,Rs("prerenderingchange",Cn,!0))}},en=()=>{if(O.document&&_t<0){const e=Rt();_t=(O.document.prerendering?void 0:globalThis.performance.getEntriesByType("visibility-state").filter(n=>n.name==="hidden"&&n.startTime>e)[0]?.startTime)??_f(),nt("visibilitychange",Cn,!0),nt("pagehide",Cn,!0),nt("prerenderingchange",Cn,!0)}return{get firstHiddenTime(){return _t},onHidden(e){Na.add(e)}}};function Sf(e){return e.type==="pagehide"||O.document?.visibilityState==="hidden"}const yf=()=>`v5-${Date.now()}-${Math.floor(Math.random()*(9e12-1))+1e12}`,tn=(e,t=-1)=>{const n=Zt();let r="navigate";return n&&(O.document?.prerendering||Rt()>0?r="prerender":O.document?.wasDiscarded?r="restore":n.type&&(r=n.type.replace(/_/g,"-"))),{name:e,value:t,rating:"good",delta:0,entries:[],id:yf(),navigationType:r}},Cr=new WeakMap;function Cs(e,t){return Cr.get(e)||Cr.set(e,new t),Cr.get(e)}class $n{constructor(){$n.prototype.__init.call(this),$n.prototype.__init2.call(this)}__init(){this._sessionValue=0}__init2(){this._sessionEntries=[]}_processEntry(t){if(t.hadRecentInput)return;const n=this._sessionEntries[0],r=this._sessionEntries[this._sessionEntries.length-1];this._sessionValue&&n&&r&&t.startTime-r.startTime<1e3&&t.startTime-n.startTime<5e3?(this._sessionValue+=t.value,this._sessionEntries.push(t)):(this._sessionValue=t.value,this._sessionEntries=[t]),this._onAfterProcessingUnexpectedShift?.(t)}}const Ct=(e,t,n={})=>{try{if(PerformanceObserver.supportedEntryTypes.includes(e)){const r=new PerformanceObserver(s=>{Promise.resolve().then(()=>{t(s.getEntries())})});return r.observe({type:e,buffered:!0,...n}),r}}catch{}},Ms=e=>{let t=!1;return()=>{t||(e(),t=!0)}},cr=e=>{O.document?.prerendering?addEventListener("prerenderingchange",()=>e(),!0):e()},Ef=[1800,3e3],bf=(e,t={})=>{cr(()=>{const n=en(),r=tn("FCP");let s;const o=Ct("paint",c=>{for(const a of c)a.name==="first-contentful-paint"&&(o.disconnect(),a.startTime<n.firstHiddenTime&&(r.value=Math.max(a.startTime-Rt(),0),r.entries.push(a),s(!0)))});o&&(s=Qt(e,r,Ef,t.reportAllChanges))})},vf=[.1,.25],Tf=(e,t={})=>{bf(Ms(()=>{const n=tn("CLS",0);let r;const s=en(),i=Cs(t,$n),o=a=>{for(const u of a)i._processEntry(u);i._sessionValue>n.value&&(n.value=i._sessionValue,n.entries=i._sessionEntries,r())},c=Ct("layout-shift",o);c&&(r=Qt(e,n,vf,t.reportAllChanges),s.onHidden(()=>{o(c.takeRecords()),r(!0)}),O?.setTimeout?.(r))}))};let Pa=0,Mr=1/0,dn=0;const If=e=>{e.forEach(t=>{t.interactionId&&(Mr=Math.min(Mr,t.interactionId),dn=Math.max(dn,t.interactionId),Pa=dn?(dn-Mr)/7+1:0)})};let Vr;const La=()=>Vr?Pa:performance.interactionCount||0,wf=()=>{"interactionCount"in performance||Vr||(Vr=Ct("event",If,{type:"event",buffered:!0,durationThreshold:0}))},Ar=10;let Da=0;const kf=()=>La()-Da;class Wn{constructor(){Wn.prototype.__init.call(this),Wn.prototype.__init2.call(this)}__init(){this._longestInteractionList=[]}__init2(){this._longestInteractionMap=new Map}_resetInteractions(){Da=La(),this._longestInteractionList.length=0,this._longestInteractionMap.clear()}_estimateP98LongestInteraction(){const t=Math.min(this._longestInteractionList.length-1,Math.floor(kf()/50));return this._longestInteractionList[t]}_processEntry(t){if(this._onBeforeProcessingEntry?.(t),!(t.interactionId||t.entryType==="first-input"))return;const n=this._longestInteractionList.at(-1);let r=this._longestInteractionMap.get(t.interactionId);if(r||this._longestInteractionList.length<Ar||t.duration>n._latency){if(r?t.duration>r._latency?(r.entries=[t],r._latency=t.duration):t.duration===r._latency&&t.startTime===r.entries[0].startTime&&r.entries.push(t):(r={id:t.interactionId,entries:[t],_latency:t.duration},this._longestInteractionMap.set(r.id,r),this._longestInteractionList.push(r)),this._longestInteractionList.sort((s,i)=>i._latency-s._latency),this._longestInteractionList.length>Ar){const s=this._longestInteractionList.splice(Ar);for(const i of s)this._longestInteractionMap.delete(i.id)}this._onAfterProcessingINPCandidate?.(r)}}}const Fa=e=>{const t=n=>{(n.type==="pagehide"||O.document?.visibilityState==="hidden")&&e(n)};nt("visibilitychange",t,!0),nt("pagehide",t,!0)},Ba=e=>{const t=O.requestIdleCallback||O.setTimeout;O.document?.visibilityState==="hidden"?e():(e=Ms(e),nt("visibilitychange",e,{once:!0,capture:!0}),t(()=>{e(),Rs("visibilitychange",e,{capture:!0})}),Fa(e))},Rf=[200,500],Cf=40,Mf=(e,t={})=>{if(!(globalThis.PerformanceEventTiming&&"interactionId"in PerformanceEventTiming.prototype))return;const n=en();cr(()=>{wf();const r=tn("INP");let s;const i=Cs(t,Wn),o=a=>{Ba(()=>{for(const d of a)i._processEntry(d);const u=i._estimateP98LongestInteraction();u&&u._latency!==r.value&&(r.value=u._latency,r.entries=u.entries,s())})},c=Ct("event",o,{durationThreshold:t.durationThreshold??Cf});s=Qt(e,r,Rf,t.reportAllChanges),c&&(c.observe({type:"first-input",buffered:!0}),n.onHidden(()=>{o(c.takeRecords()),s(!0)}))})};class Af{_processEntry(t){this._onBeforeProcessingEntry?.(t)}}const xf=[2500,4e3],Of=(e,t={})=>{cr(()=>{const n=en(),r=tn("LCP");let s;const i=Cs(t,Af),o=a=>{t.reportAllChanges||(a=a.slice(-1));for(const u of a)i._processEntry(u),u.startTime<n.firstHiddenTime&&(r.value=Math.max(u.startTime-Rt(),0),r.entries=[u],s())},c=Ct("largest-contentful-paint",o);if(c){s=Qt(e,r,xf,t.reportAllChanges);const a=Ms(()=>{o(c.takeRecords()),c.disconnect(),s(!0)}),u=d=>{d.isTrusted&&(Ba(a),Rs(d.type,u,{capture:!0}))};for(const d of["keydown","click","visibilitychange"])nt(d,u,{capture:!0})}})},Nf=[800,1800],Gr=e=>{O.document?.prerendering?cr(()=>Gr(e)):O.document?.readyState!=="complete"?addEventListener("load",()=>Gr(e),!0):setTimeout(e)},Pf=(e,t={})=>{const n=tn("TTFB"),r=Qt(e,n,Nf,t.reportAllChanges);Gr(()=>{const s=Zt();s&&(n.value=Math.max(s.responseStart-Rt(),0),n.entries=[s],r(!0))})},Lt={},zn={};let Ua,Ha,$a,Wa;function As(e,t=!1){return ur("cls",e,Df,Ua,t)}function xs(e,t=!1){return ur("lcp",e,Ff,Ha,t)}function Lf(e){return ur("ttfb",e,Bf,$a)}function za(e){return ur("inp",e,Uf,Wa)}function it(e,t){return qa(e,t),zn[e]||(Hf(e),zn[e]=!0),ja(e,t)}function nn(e,t){const n=Lt[e];if(n?.length)for(const r of n)try{r(t)}catch(s){st&&m.error(`Error while triggering instrumentation handler.
17
17
  Type: ${e}
18
- Name: ${Ve(r)}
19
- Error:`,s)}}function Hf(){return kf(e=>{on("cls",{metric:e}),za=e},{reportAllChanges:!0})}function Uf(){return Lf(e=>{on("lcp",{metric:e}),Wa=e},{reportAllChanges:!0})}function $f(){return Ff(e=>{on("ttfb",{metric:e}),qa=e})}function zf(){return Pf(e=>{on("inp",{metric:e}),ja=e})}function ur(e,t,n,r,s=!1){Ga(e,t);let i;return jn[e]||(i=n(),jn[e]=!0),r&&t({metric:r}),Ya(e,t,s?i:void 0)}function Wf(e){const t={};e==="event"&&(t.durationThreshold=0),Pt(e,n=>{on(e,{entries:n})},t)}function Ga(e,t){Bt[e]=Bt[e]||[],Bt[e].push(t)}function Ya(e,t,n){return()=>{n&&n();const r=Bt[e];if(!r)return;const s=r.indexOf(t);s!==-1&&r.splice(s,1)}}function qf(e){return"duration"in e}function Pr(e){return typeof e=="number"&&isFinite(e)}function Je(e,t,n,{...r}){const s=$(e).start_timestamp;return s&&s>t&&typeof e.updateStartTime=="function"&&e.updateStartTime(t),_s(e,()=>{const i=At({startTime:t,...r});return i&&i.end(n),i})}function Ns(e){var _;const t=z();if(!t)return;const{name:n,transaction:r,attributes:s,startTime:i}=e,{release:o,environment:c,sendDefaultPii:a}=t.getOptions(),u=t.getIntegrationByName("Replay"),d=u==null?void 0:u.getReplayId(),l=ne(),f=l.getUser(),p=f!==void 0?f.email||f.id||f.ip_address:void 0;let h;try{h=l.getScopeData().contexts.profile.profile_id}catch{}const g={release:o,environment:c,user:p||void 0,profile_id:h||void 0,replay_id:d||void 0,transaction:r,"user_agent.original":(_=A.navigator)==null?void 0:_.userAgent,"client.address":a?"{{auto}}":void 0,...s};return At({name:n,attributes:g,startTime:i,experimental:{standalone:!0}})}function an(){return A.addEventListener&&A.performance}function ie(e){return e/1e3}function jf(e){let t="unknown",n="unknown",r="";for(const s of e){if(s==="/"){[t,n]=e.split("/");break}if(!isNaN(Number(s))){t=r==="h"?"http":r,n=e.split(r)[1];break}r+=s}return r===e&&(t=r),{name:t,version:n}}function Ja(e){try{return PerformanceObserver.supportedEntryTypes.includes(e)}catch{return!1}}function Ka(e,t){let n,r=!1;function s(c){!r&&n&&t(c,n),r=!0}Ua(()=>{s("pagehide")});const i=e.on("beforeStartNavigationSpan",(c,a)=>{a!=null&&a.isRedirect||(s("navigation"),i(),o())}),o=e.on("afterStartPageLoadSpan",c=>{n=c.spanContext().spanId,o()})}function Vf(e){let t=0,n;if(!Ja("layout-shift"))return;const r=xs(({metric:s})=>{const i=s.entries[s.entries.length-1];i&&(t=s.value,n=i)},!0);Ka(e,(s,i)=>{Gf(t,n,i,s),r()})}function Gf(e,t,n,r){var u;at&&m.log(`Sending CLS span (${e})`);const s=t?ie((fe()||0)+t.startTime):ue(),i=ne().getScopeData().transactionName,o=t?be((u=t.sources[0])==null?void 0:u.node):"Layout shift",c={[ce]:"auto.http.browser.cls",[Ue]:"ui.webvital.cls",[Ct]:0,"sentry.pageload.span_id":n,"sentry.report_event":r};t!=null&&t.sources&&t.sources.forEach((d,l)=>{c[`cls.source.${l+1}`]=be(d.node)});const a=Ns({name:o,transaction:i,attributes:c,startTime:s});a&&(a.addEvent("cls",{[Xt]:"",[Qt]:e}),a.end(s))}function Yf(e){let t=0,n;if(!Ja("largest-contentful-paint"))return;const r=Ps(({metric:s})=>{const i=s.entries[s.entries.length-1];i&&(t=s.value,n=i)},!0);Ka(e,(s,i)=>{Jf(t,n,i,s),r()})}function Jf(e,t,n,r){at&&m.log(`Sending LCP span (${e})`);const s=ie((fe()||0)+((t==null?void 0:t.startTime)||0)),i=ne().getScopeData().transactionName,o=t?be(t.element):"Largest contentful paint",c={[ce]:"auto.http.browser.lcp",[Ue]:"ui.webvital.lcp",[Ct]:0,"sentry.pageload.span_id":n,"sentry.report_event":r};t&&(t.element&&(c["lcp.element"]=be(t.element)),t.id&&(c["lcp.id"]=t.id),t.url&&(c["lcp.url"]=t.url),t.loadTime!=null&&(c["lcp.loadTime"]=t.loadTime),t.renderTime!=null&&(c["lcp.renderTime"]=t.renderTime),t.size!=null&&(c["lcp.size"]=t.size));const a=Ns({name:o,transaction:i,attributes:c,startTime:s});a&&(a.addEvent("lcp",{[Xt]:"millisecond",[Qt]:e}),a.end(s))}function Te(e){return e&&((fe()||performance.timeOrigin)+e)/1e3}function Xa(e){var n;const t={};if(e.nextHopProtocol!=null){const{name:r,version:s}=jf(e.nextHopProtocol);t["network.protocol.version"]=s,t["network.protocol.name"]=r}return fe()||(n=an())!=null&&n.timeOrigin?Kf({...t,"http.request.redirect_start":Te(e.redirectStart),"http.request.redirect_end":Te(e.redirectEnd),"http.request.worker_start":Te(e.workerStart),"http.request.fetch_start":Te(e.fetchStart),"http.request.domain_lookup_start":Te(e.domainLookupStart),"http.request.domain_lookup_end":Te(e.domainLookupEnd),"http.request.connect_start":Te(e.connectStart),"http.request.secure_connection_start":Te(e.secureConnectionStart),"http.request.connection_end":Te(e.connectEnd),"http.request.request_start":Te(e.requestStart),"http.request.response_start":Te(e.responseStart),"http.request.response_end":Te(e.responseEnd),"http.request.time_to_first_byte":e.responseStart!=null?e.responseStart/1e3:void 0}):t}function Kf(e){return Object.fromEntries(Object.entries(e).filter(([,t])=>t!=null))}const Xf=2147483647;let Vi=0,Me={},ge,gt;function Qf({recordClsStandaloneSpans:e,recordLcpStandaloneSpans:t,client:n}){const r=an();if(r&&fe()){r.mark&&A.performance.mark("sentry-tracing-init");const s=t?Yf(n):rp(),i=sp(),o=e?Vf(n):np();return()=>{s==null||s(),i(),o==null||o()}}return()=>{}}function Zf(){ct("longtask",({entries:e})=>{const t=de();if(!t)return;const{op:n,start_timestamp:r}=$(t);for(const s of e){const i=ie(fe()+s.startTime),o=ie(s.duration);n==="navigation"&&r&&i<r||Je(t,i,i+o,{name:"Main UI thread blocked",op:"ui.long-task",attributes:{[ce]:"auto.ui.browser.metrics"}})}})}function ep(){new PerformanceObserver(t=>{const n=de();if(n)for(const r of t.getEntries()){if(!r.scripts[0])continue;const s=ie(fe()+r.startTime),{start_timestamp:i,op:o}=$(n);if(o==="navigation"&&i&&s<i)continue;const c=ie(r.duration),a={[ce]:"auto.ui.browser.metrics"},u=r.scripts[0],{invoker:d,invokerType:l,sourceURL:f,sourceFunctionName:p,sourceCharPosition:h}=u;a["browser.script.invoker"]=d,a["browser.script.invoker_type"]=l,f&&(a["code.filepath"]=f),p&&(a["code.function"]=p),h!==-1&&(a["browser.script.source_char_position"]=h),Je(n,s,s+c,{name:"Main UI thread blocked",op:"ui.long-animation-frame",attributes:a})}}).observe({type:"long-animation-frame",buffered:!0})}function tp(){ct("event",({entries:e})=>{const t=de();if(t){for(const n of e)if(n.name==="click"){const r=ie(fe()+n.startTime),s=ie(n.duration),i={name:be(n.target),op:`ui.interaction.${n.name}`,startTime:r,attributes:{[ce]:"auto.ui.browser.metrics"}},o=ea(n.target);o&&(i.attributes["ui.component_name"]=o),Je(t,r,r+s,i)}}})}function np(){return xs(({metric:e})=>{const t=e.entries[e.entries.length-1];t&&(Me.cls={value:e.value,unit:""},gt=t)},!0)}function rp(){return Ps(({metric:e})=>{const t=e.entries[e.entries.length-1];t&&(Me.lcp={value:e.value,unit:"millisecond"},ge=t)},!0)}function sp(){return Bf(({metric:e})=>{e.entries[e.entries.length-1]&&(Me.ttfb={value:e.value,unit:"millisecond"})})}function ip(e,t){const n=an(),r=fe();if(!(n!=null&&n.getEntries)||!r)return;const s=ie(r),i=n.getEntries(),{op:o,start_timestamp:c}=$(e);i.slice(Vi).forEach(a=>{const u=ie(a.startTime),d=ie(Math.max(0,a.duration));if(!(o==="navigation"&&c&&s+u<c))switch(a.entryType){case"navigation":{up(e,a,s);break}case"mark":case"paint":case"measure":{ap(e,a,u,d,s,t.ignorePerformanceApiSpans);const l=rn(),f=a.startTime<l.firstHiddenTime;a.name==="first-paint"&&f&&(Me.fp={value:a.startTime,unit:"millisecond"}),a.name==="first-contentful-paint"&&f&&(Me.fcp={value:a.startTime,unit:"millisecond"});break}case"resource":{fp(e,a,a.name,u,d,s,t.ignoreResourceSpans);break}}}),Vi=Math.max(i.length-1,0),pp(e),o==="pageload"&&(gp(Me),t.recordClsOnPageloadSpan||delete Me.cls,t.recordLcpOnPageloadSpan||delete Me.lcp,Object.entries(Me).forEach(([a,u])=>{ul(a,u.value,u.unit)}),e.setAttribute("performance.timeOrigin",s),e.setAttribute("performance.activationStart",xt()),hp(e,t)),ge=void 0,gt=void 0,Me={}}function op(e){if((e==null?void 0:e.entryType)==="measure")try{return e.detail.devtools.track==="Components ⚛"}catch{return}}function ap(e,t,n,r,s,i){if(op(t)||["mark","measure"].includes(t.entryType)&&Fe(t.name,i))return;const o=nn(!1),c=ie(o?o.requestStart:0),a=s+Math.max(n,c),u=s+n,d=u+r,l={[ce]:"auto.resource.browser.metrics"};a!==u&&(l["sentry.browser.measure_happened_before_request"]=!0,l["sentry.browser.measure_start_time"]=a),cp(l,t),a<=d&&Je(e,a,d,{name:t.name,op:t.entryType,attributes:l})}function cp(e,t){try{const n=t.detail;if(!n)return;if(typeof n=="object"){for(const[r,s]of Object.entries(n))if(s&&ot(s))e[`sentry.browser.measure.detail.${r}`]=s;else if(s!==void 0)try{e[`sentry.browser.measure.detail.${r}`]=JSON.stringify(s)}catch{}return}if(ot(n)){e["sentry.browser.measure.detail"]=n;return}try{e["sentry.browser.measure.detail"]=JSON.stringify(n)}catch{}}catch{}}function up(e,t,n){["unloadEvent","redirect","domContentLoadedEvent","loadEvent","connect"].forEach(r=>{mn(e,t,r,n)}),mn(e,t,"secureConnection",n,"TLS/SSL"),mn(e,t,"fetch",n,"cache"),mn(e,t,"domainLookup",n,"DNS"),dp(e,t,n)}function mn(e,t,n,r,s=n){const i=lp(n),o=t[i],c=t[`${n}Start`];!c||!o||Je(e,r+ie(c),r+ie(o),{op:`browser.${s}`,name:t.name,attributes:{[ce]:"auto.ui.browser.metrics",...n==="redirect"&&t.redirectCount!=null?{"http.redirect_count":t.redirectCount}:{}}})}function lp(e){return e==="secureConnection"?"connectEnd":e==="fetch"?"domainLookupStart":`${e}End`}function dp(e,t,n){const r=n+ie(t.requestStart),s=n+ie(t.responseEnd),i=n+ie(t.responseStart);t.responseEnd&&(Je(e,r,s,{op:"browser.request",name:t.name,attributes:{[ce]:"auto.ui.browser.metrics"}}),Je(e,i,s,{op:"browser.response",name:t.name,attributes:{[ce]:"auto.ui.browser.metrics"}}))}function fp(e,t,n,r,s,i,o){if(t.initiatorType==="xmlhttprequest"||t.initiatorType==="fetch")return;const c=t.initiatorType?`resource.${t.initiatorType}`:"resource.other";if(o!=null&&o.includes(c))return;const a={[ce]:"auto.resource.browser.metrics"},u=st(n);u.protocol&&(a["url.scheme"]=u.protocol.split(":").pop()),u.host&&(a["server.address"]=u.host),a["url.same_origin"]=n.includes(A.location.origin),mp(t,a,[["responseStatus","http.response.status_code"],["transferSize","http.response_transfer_size"],["encodedBodySize","http.response_content_length"],["decodedBodySize","http.decoded_response_content_length"],["renderBlockingStatus","resource.render_blocking_status"],["deliveryType","http.response_delivery_type"]]);const d={...a,...Xa(t)},l=i+r,f=l+s;Je(e,l,f,{name:n.replace(A.location.origin,""),op:c,attributes:d})}function pp(e){const t=A.navigator;if(!t)return;const n=t.connection;n&&(n.effectiveType&&e.setAttribute("effectiveConnectionType",n.effectiveType),n.type&&e.setAttribute("connectionType",n.type),Pr(n.rtt)&&(Me["connection.rtt"]={value:n.rtt,unit:"millisecond"})),Pr(t.deviceMemory)&&e.setAttribute("deviceMemory",`${t.deviceMemory} GB`),Pr(t.hardwareConcurrency)&&e.setAttribute("hardwareConcurrency",String(t.hardwareConcurrency))}function hp(e,t){ge&&t.recordLcpOnPageloadSpan&&(ge.element&&e.setAttribute("lcp.element",be(ge.element)),ge.id&&e.setAttribute("lcp.id",ge.id),ge.url&&e.setAttribute("lcp.url",ge.url.trim().slice(0,200)),ge.loadTime!=null&&e.setAttribute("lcp.loadTime",ge.loadTime),ge.renderTime!=null&&e.setAttribute("lcp.renderTime",ge.renderTime),e.setAttribute("lcp.size",ge.size)),gt!=null&&gt.sources&&t.recordClsOnPageloadSpan&&gt.sources.forEach((n,r)=>e.setAttribute(`cls.source.${r+1}`,be(n.node)))}function mp(e,t,n){n.forEach(([r,s])=>{const i=e[r];i!=null&&(typeof i=="number"&&i<Xf||typeof i=="string")&&(t[s]=i)})}function gp(e){const t=nn(!1);if(!t)return;const{responseStart:n,requestStart:r}=t;r<=n&&(e["ttfb.requestTime"]={value:n-r,unit:"millisecond"})}function _p(){return an()&&fe()?ct("element",Sp):()=>{}}const Sp=({entries:e})=>{const t=de(),n=t?le(t):void 0,r=n?$(n).description:ne().getScopeData().transactionName;e.forEach(s=>{var p,h;const i=s;if(!i.identifier)return;const o=i.name,c=i.renderTime,a=i.loadTime,[u,d]=a?[ie(a),"load-time"]:c?[ie(c),"render-time"]:[ue(),"entry-emission"],l=o==="image-paint"?ie(Math.max(0,(c??0)-(a??0))):0,f={[ce]:"auto.ui.browser.elementtiming",[Ue]:"ui.elementtiming",[Ae]:"component","sentry.span_start_time_source":d,"sentry.transaction_name":r,"element.id":i.id,"element.type":((h=(p=i.element)==null?void 0:p.tagName)==null?void 0:h.toLowerCase())||"unknown","element.size":i.naturalWidth&&i.naturalHeight?`${i.naturalWidth}x${i.naturalHeight}`:void 0,"element.render_time":c,"element.load_time":a,"element.url":i.url||void 0,"element.identifier":i.identifier,"element.paint_type":o};ml({name:`element[${i.identifier}]`,attributes:f,startTime:u,onlyIfParent:!0},g=>{g.end(u+l)})})},yp=1e3;let Gi,Jr,Kr;function Qa(e){Ke("dom",e),Xe("dom",Ep)}function Ep(){if(!A.document)return;const e=ke.bind(null,"dom"),t=Yi(e,!0);A.document.addEventListener("click",t,!1),A.document.addEventListener("keypress",t,!1),["EventTarget","Node"].forEach(n=>{var i,o;const s=(i=A[n])==null?void 0:i.prototype;(o=s==null?void 0:s.hasOwnProperty)!=null&&o.call(s,"addEventListener")&&(_e(s,"addEventListener",function(c){return function(a,u,d){if(a==="click"||a=="keypress")try{const l=this.__sentry_instrumentation_handlers__=this.__sentry_instrumentation_handlers__||{},f=l[a]=l[a]||{refCount:0};if(!f.handler){const p=Yi(e);f.handler=p,c.call(this,a,p,d)}f.refCount++}catch{}return c.call(this,a,u,d)}}),_e(s,"removeEventListener",function(c){return function(a,u,d){if(a==="click"||a=="keypress")try{const l=this.__sentry_instrumentation_handlers__||{},f=l[a];f&&(f.refCount--,f.refCount<=0&&(c.call(this,a,f.handler,d),f.handler=void 0,delete l[a]),Object.keys(l).length===0&&delete this.__sentry_instrumentation_handlers__)}catch{}return c.call(this,a,u,d)}}))})}function bp(e){if(e.type!==Jr)return!1;try{if(!e.target||e.target._sentryId!==Kr)return!1}catch{}return!0}function vp(e,t){return e!=="keypress"?!1:t!=null&&t.tagName?!(t.tagName==="INPUT"||t.tagName==="TEXTAREA"||t.isContentEditable):!0}function Yi(e,t=!1){return n=>{if(!n||n._sentryCaptured)return;const r=Tp(n);if(vp(n.type,r))return;Dn(n,"_sentryCaptured",!0),r&&!r._sentryId&&Dn(r,"_sentryId",Pe());const s=n.type==="keypress"?"input":n.type;bp(n)||(e({event:n,name:s,global:t}),Jr=n.type,Kr=r?r._sentryId:void 0),clearTimeout(Gi),Gi=A.setTimeout(()=>{Kr=void 0,Jr=void 0},yp)}}function Tp(e){try{return e.target}catch{return null}}let gn;function lr(e){const t="history";Ke(t,e),Xe(t,Ip)}function Ip(){if(A.addEventListener("popstate",()=>{const t=A.location.href,n=gn;if(gn=t,n===t)return;ke("history",{from:n,to:t})}),!Gd())return;function e(t){return function(...n){const r=n.length>2?n[2]:void 0;if(r){const s=gn,i=wp(String(r));if(gn=i,s===i)return t.apply(this,n);ke("history",{from:s,to:i})}return t.apply(this,n)}}_e(A.history,"pushState",e),_e(A.history,"replaceState",e)}function wp(e){try{return new URL(e,A.location.origin).toString()}catch{return e}}const xn={};function Os(e){const t=xn[e];if(t)return t;let n=A[e];if(qr(n))return xn[e]=n.bind(A);const r=A.document;if(r&&typeof r.createElement=="function")try{const s=r.createElement("iframe");s.hidden=!0,r.head.appendChild(s);const i=s.contentWindow;i!=null&&i[e]&&(n=i[e]),r.head.removeChild(s)}catch(s){at&&m.warn(`Could not create sandbox iframe for ${e} check, bailing to window.${e}: `,s)}return n&&(xn[e]=n.bind(A))}function kp(e){xn[e]=void 0}function cn(...e){return Os("setTimeout")(...e)}const tt="__sentry_xhr_v3__";function Za(e){Ke("xhr",e),Xe("xhr",Rp)}function Rp(){if(!A.XMLHttpRequest)return;const e=XMLHttpRequest.prototype;e.open=new Proxy(e.open,{apply(t,n,r){const s=new Error,i=ue()*1e3,o=Ft(r[0])?r[0].toUpperCase():void 0,c=Cp(r[1]);if(!o||!c)return t.apply(n,r);n[tt]={method:o,url:c,request_headers:{}},o==="POST"&&c.match(/sentry_key/)&&(n.__sentry_own_request__=!0);const a=()=>{const u=n[tt];if(u&&n.readyState===4){try{u.status_code=n.status}catch{}const d={endTimestamp:ue()*1e3,startTimestamp:i,xhr:n,virtualError:s};ke("xhr",d)}};return"onreadystatechange"in n&&typeof n.onreadystatechange=="function"?n.onreadystatechange=new Proxy(n.onreadystatechange,{apply(u,d,l){return a(),u.apply(d,l)}}):n.addEventListener("readystatechange",a),n.setRequestHeader=new Proxy(n.setRequestHeader,{apply(u,d,l){const[f,p]=l,h=d[tt];return h&&Ft(f)&&Ft(p)&&(h.request_headers[f.toLowerCase()]=p),u.apply(d,l)}}),t.apply(n,r)}}),e.send=new Proxy(e.send,{apply(t,n,r){const s=n[tt];if(!s)return t.apply(n,r);r[0]!==void 0&&(s.body=r[0]);const i={startTimestamp:ue()*1e3,xhr:n};return ke("xhr",i),t.apply(n,r)}})}function Cp(e){if(Ft(e))return e;try{return e.toString()}catch{}}const Mp=Symbol.for("sentry__originalRequestBody");function ec(e){return new URLSearchParams(e).toString()}function tc(e,t=m){try{if(typeof e=="string")return[e];if(e instanceof URLSearchParams)return[e.toString()];if(e instanceof FormData)return[ec(e)];if(!e)return[void 0]}catch(n){return at&&t.error(n,"Failed to serialize body",e),[void 0,"BODY_PARSE_ERROR"]}return at&&t.log("Skipping network body because of body type",e),[void 0,"UNPARSEABLE_BODY_TYPE"]}function nc(e=[]){if(e.length>=2&&e[1]&&typeof e[1]=="object"&&"body"in e[1])return e[1].body;if(e.length>=1&&e[0]instanceof Request){const n=e[0][Mp];return n!==void 0?n:void 0}}function rc(e){let t;try{t=e.getAllResponseHeaders()}catch(n){return at&&m.error(n,"Failed to get xhr response headers",e),{}}return t?t.split(`\r
20
- `).reduce((n,r)=>{const[s,i]=r.split(": ");return i&&(n[s.toLowerCase()]=i),n},{}):{}}const Nr=[],Pn=new Map,ft=new Map,Ap=60;function xp(){if(an()&&fe()){const t=Pp();return()=>{t()}}return()=>{}}const Xr={click:"click",pointerdown:"click",pointerup:"click",mousedown:"click",mouseup:"click",touchstart:"click",touchend:"click",mouseover:"hover",mouseout:"hover",mouseenter:"hover",mouseleave:"hover",pointerover:"hover",pointerout:"hover",pointerenter:"hover",pointerleave:"hover",dragstart:"drag",dragend:"drag",drag:"drag",dragenter:"drag",dragleave:"drag",dragover:"drag",drop:"drag",keydown:"press",keyup:"press",keypress:"press",input:"press"};function Pp(){return Va(Np)}const Np=({metric:e})=>{if(e.value==null)return;const t=ie(e.value);if(t>Ap)return;const n=e.entries.find(h=>h.duration===e.value&&Xr[h.name]);if(!n)return;const{interactionId:r}=n,s=Xr[n.name],i=ie(fe()+n.startTime),o=de(),c=o?le(o):void 0,a=r!=null?Pn.get(r):void 0,u=(a==null?void 0:a.span)||c,d=u?$(u).description:ne().getScopeData().transactionName,l=(a==null?void 0:a.elementName)||be(n.target),f={[ce]:"auto.http.browser.inp",[Ue]:`ui.interaction.${s}`,[Ct]:n.duration},p=Ns({name:l,transaction:d,attributes:f,startTime:i});p&&(p.addEvent("inp",{[Xt]:"millisecond",[Qt]:e.value}),p.end(i+t))};function Op(){const e=Object.keys(Xr);jr()&&e.forEach(s=>{A.addEventListener(s,t,{capture:!0,passive:!0})});function t(s){const i=s.target;if(!i)return;const o=be(i),c=Math.round(s.timeStamp);if(ft.set(c,o),ft.size>50){const a=ft.keys().next().value;a!==void 0&&ft.delete(a)}}function n(s){const i=Math.round(s.startTime);let o=ft.get(i);if(!o)for(let c=-5;c<=5;c++){const a=ft.get(i+c);if(a){o=a;break}}return o||"<unknown>"}const r=({entries:s})=>{const i=de(),o=i&&le(i);s.forEach(c=>{if(!qf(c))return;const a=c.interactionId;if(a==null||Pn.has(a))return;const u=c.target?be(c.target):n(c);if(Nr.length>10){const d=Nr.shift();Pn.delete(d)}Nr.push(a),Pn.set(a,{span:o,elementName:u})})};ct("event",r),ct("first-input",r)}const Lp=40;function Ls(e,t=Os("fetch")){let n=0,r=0;async function s(i){const o=i.body.length;n+=o,r++;const c={body:i.body,method:"POST",referrerPolicy:"strict-origin",headers:e.headers,keepalive:n<=6e4&&r<15,...e.fetchOptions};try{const a=await t(e.url,c);return{statusCode:a.status,headers:{"x-sentry-rate-limits":a.headers.get("X-Sentry-Rate-Limits"),"retry-after":a.headers.get("Retry-After")}}}catch(a){throw kp("fetch"),a}finally{n-=o,r--}}return $l(e,s,vs(e.bufferSize||Lp))}const Dp=30,Fp=50;function Qr(e,t,n,r){const s={filename:e,function:t==="<anonymous>"?Tt:t,in_app:!0};return n!==void 0&&(s.lineno=n),r!==void 0&&(s.colno=r),s}const Bp=/^\s*at (\S+?)(?::(\d+))(?::(\d+))\s*$/i,Hp=/^\s*at (?:(.+?\)(?: \[.+\])?|.*?) ?\((?:address at )?)?(?:async )?((?:<anonymous>|[-a-z]+:|.*bundle|\/)?.*?)(?::(\d+))?(?::(\d+))?\)?\s*$/i,Up=/\((\S*)(?::(\d+))(?::(\d+))\)/,$p=/at (.+?) ?\(data:(.+?),/,zp=e=>{const t=e.match($p);if(t)return{filename:`<data:${t[2]}>`,function:t[1]};const n=Bp.exec(e);if(n){const[,s,i,o]=n;return Qr(s,Tt,+i,+o)}const r=Hp.exec(e);if(r){if(r[2]&&r[2].indexOf("eval")===0){const c=Up.exec(r[2]);c&&(r[2]=c[1],r[3]=c[2],r[4]=c[3])}const[i,o]=sc(r[1]||Tt,r[2]);return Qr(o,i,r[3]?+r[3]:void 0,r[4]?+r[4]:void 0)}},Wp=[Dp,zp],qp=/^\s*(.*?)(?:\((.*?)\))?(?:^|@)?((?:[-a-z]+)?:\/.*?|\[native code\]|[^@]*(?:bundle|\d+\.js)|\/[\w\-. /=]+)(?::(\d+))?(?::(\d+))?\s*$/i,jp=/(\S+) line (\d+)(?: > eval line \d+)* > eval/i,Vp=e=>{const t=qp.exec(e);if(t){if(t[3]&&t[3].indexOf(" > eval")>-1){const i=jp.exec(t[3]);i&&(t[1]=t[1]||"eval",t[3]=i[1],t[4]=i[2],t[5]="")}let r=t[3],s=t[1]||Tt;return[s,r]=sc(s,r),Qr(r,s,t[4]?+t[4]:void 0,t[5]?+t[5]:void 0)}},Gp=[Fp,Vp],Yp=[Wp,Gp],Jp=Pu(...Yp),sc=(e,t)=>{const n=e.indexOf("safari-extension")!==-1,r=e.indexOf("safari-web-extension")!==-1;return n||r?[e.indexOf("@")!==-1?e.split("@")[0]:Tt,n?`safari-extension:${t}`:`safari-web-extension:${t}`]:[e,t]},_n=1024,Kp="Breadcrumbs",Xp=((e={})=>{const t={console:!0,dom:!0,fetch:!0,history:!0,sentry:!0,xhr:!0,...e};return{name:Kp,setup(n){t.console&&Ca(th(n)),t.dom&&Qa(eh(n,t.dom)),t.xhr&&Za(nh(n)),t.fetch&&Na(rh(n)),t.history&&lr(sh(n)),t.sentry&&n.on("beforeSendEvent",Zp(n))}}}),Qp=Xp;function Zp(e){return function(n){z()===e&&Ye({category:`sentry.${n.type==="transaction"?"transaction":"event"}`,event_id:n.event_id,level:n.level,message:et(n)},{event:n})}}function eh(e,t){return function(r){if(z()!==e)return;let s,i,o=typeof t=="object"?t.serializeAttribute:void 0,c=typeof t=="object"&&typeof t.maxStringLength=="number"?t.maxStringLength:void 0;c&&c>_n&&(v&&m.warn(`\`dom.maxStringLength\` cannot exceed ${_n}, but a value of ${c} was configured. Sentry will use ${_n} instead.`),c=_n),typeof o=="string"&&(o=[o]);try{const u=r.event,d=ih(u)?u.target:u;s=be(d,{keyAttrs:o,maxStringLength:c}),i=ea(d)}catch{s="<unknown>"}if(s.length===0)return;const a={category:`ui.${r.name}`,message:s};i&&(a.data={"ui.component_name":i}),Ye(a,{event:r.event,name:r.name,global:r.global})}}function th(e){return function(n){if(z()!==e)return;const r={category:"console",data:{arguments:n.args,logger:"console"},level:Ma(n.level),message:fi(n.args," ")};if(n.level==="assert")if(n.args[0]===!1)r.message=`Assertion failed: ${fi(n.args.slice(1)," ")||"console.assert"}`,r.data.arguments=n.args.slice(1);else return;Ye(r,{input:n.args,level:n.level})}}function nh(e){return function(n){if(z()!==e)return;const{startTimestamp:r,endTimestamp:s}=n,i=n.xhr[tt];if(!r||!s||!i)return;const{method:o,url:c,status_code:a,body:u}=i,d={method:o,url:c,status_code:a},l={xhr:n.xhr,input:u,startTimestamp:r,endTimestamp:s},f={category:"xhr",data:d,type:"http",level:Pa(a)};e.emit("beforeOutgoingRequestBreadcrumb",f,l),Ye(f,l)}}function rh(e){return function(n){if(z()!==e)return;const{startTimestamp:r,endTimestamp:s}=n;if(s&&!(n.fetchData.url.match(/sentry_key/)&&n.fetchData.method==="POST"))if(n.fetchData.method,n.fetchData.url,n.error){const i=n.fetchData,o={data:n.error,input:n.args,startTimestamp:r,endTimestamp:s},c={category:"fetch",data:i,level:"error",type:"http"};e.emit("beforeOutgoingRequestBreadcrumb",c,o),Ye(c,o)}else{const i=n.response,o={...n.fetchData,status_code:i==null?void 0:i.status};n.fetchData.request_body_size,n.fetchData.response_body_size,i==null||i.status;const c={input:n.args,response:i,startTimestamp:r,endTimestamp:s},a={category:"fetch",data:o,type:"http",level:Pa(o.status_code)};e.emit("beforeOutgoingRequestBreadcrumb",a,c),Ye(a,c)}}}function sh(e){return function(n){if(z()!==e)return;let r=n.from,s=n.to;const i=st(F.location.href);let o=r?st(r):void 0;const c=st(s);o!=null&&o.path||(o=i),i.protocol===c.protocol&&i.host===c.host&&(s=c.relative),i.protocol===o.protocol&&i.host===o.host&&(r=o.relative),Ye({category:"navigation",data:{from:r,to:s}})}}function ih(e){return!!e&&!!e.target}const oh=["EventTarget","Window","Node","ApplicationCache","AudioTrackList","BroadcastChannel","ChannelMergerNode","CryptoOperation","EventSource","FileReader","HTMLUnknownElement","IDBDatabase","IDBRequest","IDBTransaction","KeyOperation","MediaController","MessagePort","ModalWindow","Notification","SVGElementInstance","Screen","SharedWorker","TextTrack","TextTrackCue","TextTrackList","WebSocket","WebSocketWorker","Worker","XMLHttpRequest","XMLHttpRequestEventTarget","XMLHttpRequestUpload"],ah="BrowserApiErrors",ch=((e={})=>{const t={XMLHttpRequest:!0,eventTarget:!0,requestAnimationFrame:!0,setInterval:!0,setTimeout:!0,unregisterOriginalCallbacks:!1,...e};return{name:ah,setupOnce(){t.setTimeout&&_e(F,"setTimeout",Ji),t.setInterval&&_e(F,"setInterval",Ji),t.requestAnimationFrame&&_e(F,"requestAnimationFrame",lh),t.XMLHttpRequest&&"XMLHttpRequest"in F&&_e(XMLHttpRequest.prototype,"send",dh);const n=t.eventTarget;n&&(Array.isArray(n)?n:oh).forEach(s=>fh(s,t))}}}),uh=ch;function Ji(e){return function(...t){const n=t[0];return t[0]=qt(n,{mechanism:{handled:!1,type:`auto.browser.browserapierrors.${Ve(e)}`}}),e.apply(this,t)}}function lh(e){return function(t){return e.apply(this,[qt(t,{mechanism:{data:{handler:Ve(e)},handled:!1,type:"auto.browser.browserapierrors.requestAnimationFrame"}})])}}function dh(e){return function(...t){const n=this;return["onload","onerror","onprogress","onreadystatechange"].forEach(s=>{s in n&&typeof n[s]=="function"&&_e(n,s,function(i){const o={mechanism:{data:{handler:Ve(i)},handled:!1,type:`auto.browser.browserapierrors.xhr.${s}`}},c=Jo(i);return c&&(o.mechanism.data.handler=Ve(c)),qt(i,o)})}),e.apply(this,t)}}function fh(e,t){var s,i;const r=(s=F[e])==null?void 0:s.prototype;(i=r==null?void 0:r.hasOwnProperty)!=null&&i.call(r,"addEventListener")&&(_e(r,"addEventListener",function(o){return function(c,a,u){try{ph(a)&&(a.handleEvent=qt(a.handleEvent,{mechanism:{data:{handler:Ve(a),target:e},handled:!1,type:"auto.browser.browserapierrors.handleEvent"}}))}catch{}return t.unregisterOriginalCallbacks&&hh(this,c,a),o.apply(this,[c,qt(a,{mechanism:{data:{handler:Ve(a),target:e},handled:!1,type:"auto.browser.browserapierrors.addEventListener"}}),u])}}),_e(r,"removeEventListener",function(o){return function(c,a,u){try{const d=a.__sentry_wrapped__;d&&o.call(this,c,d,u)}catch{}return o.call(this,c,a,u)}}))}function ph(e){return typeof e.handleEvent=="function"}function hh(e,t,n){e&&typeof e=="object"&&"removeEventListener"in e&&typeof e.removeEventListener=="function"&&e.removeEventListener(t,n)}const mh=()=>({name:"BrowserSession",setupOnce(){if(typeof F.document>"u"){v&&m.warn("Using the `browserSessionIntegration` in non-browser environments is not supported.");return}pi({ignoreDuration:!0}),hi(),lr(({from:e,to:t})=>{e!==void 0&&e!==t&&(pi({ignoreDuration:!0}),hi())})}}),gh="GlobalHandlers",_h=((e={})=>{const t={onerror:!0,onunhandledrejection:!0,...e};return{name:gh,setupOnce(){Error.stackTraceLimit=50},setup(n){t.onerror&&(yh(n),Ki("onerror")),t.onunhandledrejection&&(Eh(n),Ki("onunhandledrejection"))}}}),Sh=_h;function yh(e){ia(t=>{const{stackParser:n,attachStacktrace:r}=ic();if(z()!==e||ta())return;const{msg:s,url:i,line:o,column:c,error:a}=t,u=Th(Rs(n,a||s,void 0,r,!1),i,o,c);u.level="error",na(u,{originalException:a,mechanism:{handled:!1,type:"auto.browser.global_handlers.onerror"}})})}function Eh(e){oa(t=>{const{stackParser:n,attachStacktrace:r}=ic();if(z()!==e||ta())return;const s=bh(t),i=ot(s)?vh(s):Rs(n,s,void 0,r,!0);i.level="error",na(i,{originalException:s,mechanism:{handled:!1,type:"auto.browser.global_handlers.onunhandledrejection"}})})}function bh(e){if(ot(e))return e;try{if("reason"in e)return e.reason;if("detail"in e&&"reason"in e.detail)return e.detail.reason}catch{}return e}function vh(e){return{exception:{values:[{type:"UnhandledRejection",value:`Non-Error promise rejection captured with value: ${String(e)}`}]}}}function Th(e,t,n,r){const s=e.exception=e.exception||{},i=s.values=s.values||[],o=i[0]=i[0]||{},c=o.stacktrace=o.stacktrace||{},a=c.frames=c.frames||[],u=r,d=n,l=Ih(t)??en();return a.length===0&&a.push({colno:u,filename:l,function:Tt,in_app:!0,lineno:d}),e}function Ki(e){v&&m.log(`Global Handler attached: ${e}`)}function ic(){const e=z();return(e==null?void 0:e.getOptions())||{stackParser:()=>[],attachStacktrace:!1}}function Ih(e){if(!(!Ft(e)||e.length===0)){if(e.startsWith("data:")){const t=e.match(/^data:([^;]+)/),n=t?t[1]:"text/javascript",r=e.includes("base64,");return`<data:${n}${r?",base64":""}>`}return e}}const wh=()=>({name:"HttpContext",preprocessEvent(e){var r;if(!F.navigator&&!F.location&&!F.document)return;const t=gs(),n={...t.headers,...(r=e.request)==null?void 0:r.headers};e.request={...t,...e.request,headers:n}}}),kh="cause",Rh=5,Ch="LinkedErrors",Mh=((e={})=>{const t=e.limit||Rh,n=e.key||kh;return{name:Ch,preprocessEvent(r,s,i){const o=i.getOptions();kd(ws,o.stackParser,n,t,r,s)}}}),Ah=Mh,xh="SpotlightBrowser",Ph=((e={})=>{const t=e.sidecarUrl||"http://localhost:8969/stream";return{name:xh,setup:()=>{v&&m.log("Using Sidecar URL",t)},processEvent:n=>Lh(n)?null:n,afterAllSetup:n=>{Nh(n,t)}}});function Nh(e,t){const n=Os("fetch");let r=0;e.on("beforeEnvelope",s=>{if(r>3){m.warn("[Spotlight] Disabled Sentry -> Spotlight integration due to too many failed requests:",r);return}n(t,{method:"POST",body:$n(s),headers:{"Content-Type":"application/x-sentry-envelope"},mode:"cors"}).then(i=>{i.status>=200&&i.status<400&&(r=0)},i=>{r++,m.error("Sentry SDK can't connect to Sidecar is it running? See: https://spotlightjs.com/sidecar/npx/",i)})})}const Oh=Ph;function Lh(e){var t;return!!(e.type==="transaction"&&e.spans&&((t=e.contexts)!=null&&t.trace)&&e.contexts.trace.op==="ui.action.click"&&e.spans.some(({description:n})=>n==null?void 0:n.includes("#sentry-spotlight")))}function Dh(){return Fh()?(v&&Zt(()=>{console.error("[Sentry] You cannot use Sentry.init() in a browser extension, see: https://docs.sentry.io/platforms/javascript/best-practices/browser-extensions/")}),!0):!1}function Fh(){var i;if(typeof F.window>"u")return!1;const e=F;if(e.nw)return!1;const t=e.chrome||e.browser;if(!((i=t==null?void 0:t.runtime)!=null&&i.id))return!1;const n=en(),r=["chrome-extension","moz-extension","ms-browser-extension","safari-web-extension"];return!(F===F.top&&r.some(o=>n.startsWith(`${o}://`)))}function Bh(e){return[Sd(),hd(),uh(),Qp(),Sh(),Ah(),Ad(),wh(),mh()]}function Hh(e={}){const t=!e.skipBrowserExtensionCheck&&Dh();let n=e.defaultIntegrations==null?Bh():e.defaultIntegrations;const r={...e,enabled:t?!1:e.enabled,stackParser:Nu(e.stackParser||Jp),integrations:Il({integrations:e.integrations,defaultIntegrations:n}),transport:e.transport||Ls};return Xl(_f,r)}const te=Q,Ds="sentryReplaySession",Uh="replay_event",Fs="Unable to send Replay",$h=3e5,zh=9e5,Wh=5e3,qh=5500,jh=6e4,Vh=5e3,Gh=3,Xi=15e4,Sn=5e3,Yh=3e3,Jh=300,Bs=2e7,Kh=4999,Xh=5e4,Qi=36e5;var Qh=Object.defineProperty,Zh=(e,t,n)=>t in e?Qh(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,Zi=(e,t,n)=>Zh(e,typeof t!="symbol"?t+"":t,n),ae=(e=>(e[e.Document=0]="Document",e[e.DocumentType=1]="DocumentType",e[e.Element=2]="Element",e[e.Text=3]="Text",e[e.CDATA=4]="CDATA",e[e.Comment=5]="Comment",e))(ae||{});function em(e){return e.nodeType===e.ELEMENT_NODE}function Ht(e){const t=e==null?void 0:e.host;return(t==null?void 0:t.shadowRoot)===e}function Ut(e){return Object.prototype.toString.call(e)==="[object ShadowRoot]"}function tm(e){return e.includes(" background-clip: text;")&&!e.includes(" -webkit-background-clip: text;")&&(e=e.replace(/\sbackground-clip:\s*text;/g," -webkit-background-clip: text; background-clip: text;")),e}function nm(e){const{cssText:t}=e;if(t.split('"').length<3)return t;const n=["@import",`url(${JSON.stringify(e.href)})`];return e.layerName===""?n.push("layer"):e.layerName&&n.push(`layer(${e.layerName})`),e.supportsText&&n.push(`supports(${e.supportsText})`),e.media.length&&n.push(e.media.mediaText),n.join(" ")+";"}function Vn(e){try{const t=e.rules||e.cssRules;return t?tm(Array.from(t,oc).join("")):null}catch{return null}}function rm(e){let t="";for(let n=0;n<e.style.length;n++){const r=e.style,s=r[n],i=r.getPropertyPriority(s);t+=`${s}:${r.getPropertyValue(s)}${i?" !important":""};`}return`${e.selectorText} { ${t} }`}function oc(e){let t;if(im(e))try{t=Vn(e.styleSheet)||nm(e)}catch{}else if(om(e)){let n=e.cssText;const r=e.selectorText.includes(":"),s=typeof e.style.all=="string"&&e.style.all;if(s&&(n=rm(e)),r&&(n=sm(n)),r||s)return n}return t||e.cssText}function sm(e){const t=/(\[(?:[\w-]+)[^\\])(:(?:[\w-]+)\])/gm;return e.replace(t,"$1\\$2")}function im(e){return"styleSheet"in e}function om(e){return"selectorText"in e}class ac{constructor(){Zi(this,"idNodeMap",new Map),Zi(this,"nodeMetaMap",new WeakMap)}getId(t){var r;return t?((r=this.getMeta(t))==null?void 0:r.id)??-1:-1}getNode(t){return this.idNodeMap.get(t)||null}getIds(){return Array.from(this.idNodeMap.keys())}getMeta(t){return this.nodeMetaMap.get(t)||null}removeNodeFromMap(t){const n=this.getId(t);this.idNodeMap.delete(n),t.childNodes&&t.childNodes.forEach(r=>this.removeNodeFromMap(r))}has(t){return this.idNodeMap.has(t)}hasNode(t){return this.nodeMetaMap.has(t)}add(t,n){const r=n.id;this.idNodeMap.set(r,t),this.nodeMetaMap.set(t,n)}replace(t,n){const r=this.getNode(t);if(r){const s=this.nodeMetaMap.get(r);s&&this.nodeMetaMap.set(n,s)}this.idNodeMap.set(t,n)}reset(){this.idNodeMap=new Map,this.nodeMetaMap=new WeakMap}}function am(){return new ac}function dr({maskInputOptions:e,tagName:t,type:n}){return t==="OPTION"&&(t="SELECT"),!!(e[t.toLowerCase()]||n&&e[n]||n==="password"||t==="INPUT"&&!n&&e.text)}function Vt({isMasked:e,element:t,value:n,maskInputFn:r}){let s=n||"";return e?(r&&(s=r(s,t)),"*".repeat(s.length)):s}function It(e){return e.toLowerCase()}function Zr(e){return e.toUpperCase()}const eo="__rrweb_original__";function cm(e){const t=e.getContext("2d");if(!t)return!0;const n=50;for(let r=0;r<e.width;r+=n)for(let s=0;s<e.height;s+=n){const i=t.getImageData,o=eo in i?i[eo]:i;if(new Uint32Array(o.call(t,r,s,Math.min(n,e.width-r),Math.min(n,e.height-s)).data.buffer).some(a=>a!==0))return!1}return!0}function Hs(e){const t=e.type;return e.hasAttribute("data-rr-is-password")?"password":t?It(t):null}function Gn(e,t,n){return t==="INPUT"&&(n==="radio"||n==="checkbox")?e.getAttribute("value")||"":e.value}function cc(e,t){let n;try{n=new URL(e,t??window.location.href)}catch{return null}const r=/\.([0-9a-z]+)(?:$)/i,s=n.pathname.match(r);return(s==null?void 0:s[1])??null}const to={};function uc(e){const t=to[e];if(t)return t;const n=window.document;let r=window[e];if(n&&typeof n.createElement=="function")try{const s=n.createElement("iframe");s.hidden=!0,n.head.appendChild(s);const i=s.contentWindow;i&&i[e]&&(r=i[e]),n.head.removeChild(s)}catch{}return to[e]=r.bind(window)}function es(...e){return uc("setTimeout")(...e)}function lc(...e){return uc("clearTimeout")(...e)}function dc(e){try{return e.contentDocument}catch{}}let um=1;const lm=new RegExp("[^a-z0-9-_:]"),Gt=-2;function Us(){return um++}function dm(e){if(e instanceof HTMLFormElement)return"form";const t=It(e.tagName);return lm.test(t)?"div":t}function fm(e){let t="";return e.indexOf("//")>-1?t=e.split("/").slice(0,3).join("/"):t=e.split("/")[0],t=t.split("?")[0],t}let pt,no;const pm=/url\((?:(')([^']*)'|(")(.*?)"|([^)]*))\)/gm,hm=/^(?:[a-z+]+:)?\/\//i,mm=/^www\..*/i,gm=/^(data:)([^,]*),(.*)/i;function _m(e,t){if(!e||t.size===0)return e;try{const n=e.split(";"),r=[];for(let s of n){if(s=s.trim(),!s)continue;const i=s.indexOf(":");if(i===-1){r.push(s);continue}const o=s.slice(0,i).trim();t.has(o)||r.push(s)}return r.join("; ")+(r.length>0&&e.endsWith(";")?";":"")}catch(n){return console.warn("Error filtering CSS properties:",n),e}}function Yn(e,t){return(e||"").replace(pm,(n,r,s,i,o,c)=>{const a=s||o||c,u=r||i||"";if(!a)return n;if(hm.test(a)||mm.test(a))return`url(${u}${a}${u})`;if(gm.test(a))return`url(${u}${a}${u})`;if(a[0]==="/")return`url(${u}${fm(t)+a}${u})`;const d=t.split("/"),l=a.split("/");d.pop();for(const f of l)f!=="."&&(f===".."?d.pop():d.push(f));return`url(${u}${d.join("/")}${u})`})}const Sm=/^[^ \t\n\r\u000c]+/,ym=/^[, \t\n\r\u000c]+/;function Em(e,t){if(t.trim()==="")return t;let n=0;function r(i){let o;const c=i.exec(t.substring(n));return c?(o=c[0],n+=o.length,o):""}const s=[];for(;r(ym),!(n>=t.length);){let i=r(Sm);if(i.slice(-1)===",")i=_t(e,i.substring(0,i.length-1)),s.push(i);else{let o="";i=_t(e,i);let c=!1;for(;;){const a=t.charAt(n);if(a===""){s.push((i+o).trim());break}else if(c)a===")"&&(c=!1);else if(a===","){n+=1,s.push((i+o).trim());break}else a==="("&&(c=!0);o+=a,n+=1}}}return s.join(", ")}const ro=new WeakMap;function _t(e,t){return!t||t.trim()===""?t:fr(e,t)}function bm(e){return!!(e.tagName==="svg"||e.ownerSVGElement)}function fr(e,t){let n=ro.get(e);if(n||(n=e.createElement("a"),ro.set(e,n)),!t)t="";else if(t.startsWith("blob:")||t.startsWith("data:"))return t;return n.setAttribute("href",t),n.href}function fc(e,t,n,r,s,i,o){if(!r)return r;if(n==="src"||n==="href"&&!(t==="use"&&r[0]==="#"))return _t(e,r);if(n==="xlink:href"&&r[0]!=="#")return _t(e,r);if(n==="background"&&(t==="table"||t==="td"||t==="th"))return _t(e,r);if(n==="srcset")return Em(e,r);if(n==="style"){let c=Yn(r,fr(e));return o&&o.size>0&&(c=_m(c,o)),c}else if(t==="object"&&n==="data")return _t(e,r);return typeof i=="function"?i(n,r,s):r}function pc(e,t,n){return(e==="video"||e==="audio")&&t==="autoplay"}function vm(e,t,n,r){try{if(r&&e.matches(r))return!1;if(typeof t=="string"){if(e.classList.contains(t))return!0}else for(let s=e.classList.length;s--;){const i=e.classList[s];if(t.test(i))return!0}if(n)return e.matches(n)}catch{}return!1}function Tm(e,t){for(let n=e.classList.length;n--;){const r=e.classList[n];if(t.test(r))return!0}return!1}function nt(e,t,n=1/0,r=0){return!e||e.nodeType!==e.ELEMENT_NODE||r>n?-1:t(e)?r:nt(e.parentNode,t,n,r+1)}function St(e,t){return n=>{const r=n;if(r===null)return!1;try{if(e){if(typeof e=="string"){if(r.matches(`.${e}`))return!0}else if(Tm(r,e))return!0}return!!(t&&r.matches(t))}catch{return!1}}}function wt(e,t,n,r,s,i){try{const o=e.nodeType===e.ELEMENT_NODE?e:e.parentElement;if(o===null)return!1;if(o.tagName==="INPUT"){const u=o.getAttribute("autocomplete");if(["current-password","new-password","cc-number","cc-exp","cc-exp-month","cc-exp-year","cc-csc"].includes(u))return!0}let c=-1,a=-1;if(i){if(a=nt(o,St(r,s)),a<0)return!0;c=nt(o,St(t,n),a>=0?a:1/0)}else{if(c=nt(o,St(t,n)),c<0)return!1;a=nt(o,St(r,s),c>=0?c:1/0)}return c>=0?a>=0?c<=a:!0:a>=0?!1:!!i}catch{}return!!i}function Im(e,t,n){const r=e.contentWindow;if(!r)return;let s=!1,i;try{i=r.document.readyState}catch{return}if(i!=="complete"){const c=es(()=>{s||(t(),s=!0)},n);e.addEventListener("load",()=>{lc(c),s=!0,t()});return}const o="about:blank";if(r.location.href!==o||e.src===o||e.src==="")return es(t,0),e.addEventListener("load",t);e.addEventListener("load",t)}function wm(e,t,n){let r=!1,s;try{s=e.sheet}catch{return}if(s)return;const i=es(()=>{r||(t(),r=!0)},n);e.addEventListener("load",()=>{lc(i),r=!0,t()})}function km(e,t){const{doc:n,mirror:r,blockClass:s,blockSelector:i,unblockSelector:o,maskAllText:c,maskAttributeFn:a,maskTextClass:u,unmaskTextClass:d,maskTextSelector:l,unmaskTextSelector:f,inlineStylesheet:p,maskInputOptions:h={},maskTextFn:g,maskInputFn:_,dataURLOptions:y={},inlineImages:T,recordCanvas:O,keepIframeSrcFn:L,newlyAddedElement:q=!1,ignoreCSSAttributes:x}=t,S=Rm(n,r);switch(e.nodeType){case e.DOCUMENT_NODE:return e.compatMode!=="CSS1Compat"?{type:ae.Document,childNodes:[],compatMode:e.compatMode}:{type:ae.Document,childNodes:[]};case e.DOCUMENT_TYPE_NODE:return{type:ae.DocumentType,name:e.name,publicId:e.publicId,systemId:e.systemId,rootId:S};case e.ELEMENT_NODE:return Mm(e,{doc:n,blockClass:s,blockSelector:i,unblockSelector:o,inlineStylesheet:p,maskAttributeFn:a,maskInputOptions:h,maskInputFn:_,dataURLOptions:y,inlineImages:T,recordCanvas:O,keepIframeSrcFn:L,newlyAddedElement:q,rootId:S,maskTextClass:u,unmaskTextClass:d,maskTextSelector:l,unmaskTextSelector:f,ignoreCSSAttributes:x});case e.TEXT_NODE:return Cm(e,{doc:n,maskAllText:c,maskTextClass:u,unmaskTextClass:d,maskTextSelector:l,unmaskTextSelector:f,maskTextFn:g,maskInputOptions:h,maskInputFn:_,rootId:S});case e.CDATA_SECTION_NODE:return{type:ae.CDATA,textContent:"",rootId:S};case e.COMMENT_NODE:return{type:ae.Comment,textContent:e.textContent||"",rootId:S};default:return!1}}function Rm(e,t){if(!t.hasNode(e))return;const n=t.getId(e);return n===1?void 0:n}function Cm(e,t){var y;const{maskAllText:n,maskTextClass:r,unmaskTextClass:s,maskTextSelector:i,unmaskTextSelector:o,maskTextFn:c,maskInputOptions:a,maskInputFn:u,rootId:d}=t,l=e.parentNode&&e.parentNode.tagName;let f=e.textContent;const p=l==="STYLE"?!0:void 0,h=l==="SCRIPT"?!0:void 0,g=l==="TEXTAREA"?!0:void 0;if(p&&f){try{e.nextSibling||e.previousSibling||(y=e.parentNode.sheet)!=null&&y.cssRules&&(f=Vn(e.parentNode.sheet))}catch(T){console.warn(`Cannot get CSS styles from text's parentNode. Error: ${T}`,e)}f=Yn(f,fr(t.doc))}h&&(f="SCRIPT_PLACEHOLDER");const _=wt(e,r,i,s,o,n);if(!p&&!h&&!g&&f&&_&&(f=c?c(f,e.parentElement):f.replace(/[\S]/g,"*")),g&&f&&(a.textarea||_)&&(f=u?u(f,e.parentNode):f.replace(/[\S]/g,"*")),l==="OPTION"&&f){const T=dr({type:null,tagName:l,maskInputOptions:a});f=Vt({isMasked:wt(e,r,i,s,o,T),element:e,value:f,maskInputFn:u})}return{type:ae.Text,textContent:f||"",isStyle:p,rootId:d}}function Mm(e,t){const{doc:n,blockClass:r,blockSelector:s,unblockSelector:i,inlineStylesheet:o,maskInputOptions:c={},maskAttributeFn:a,maskInputFn:u,dataURLOptions:d={},inlineImages:l,recordCanvas:f,keepIframeSrcFn:p,newlyAddedElement:h=!1,rootId:g,maskTextClass:_,unmaskTextClass:y,maskTextSelector:T,unmaskTextSelector:O,ignoreCSSAttributes:L}=t,q=vm(e,r,s,i),x=dm(e);let S={};const I=e.attributes.length;for(let E=0;E<I;E++){const w=e.attributes[E];w.name&&!pc(x,w.name,w.value)&&(S[w.name]=fc(n,x,It(w.name),w.value,e,a,L))}if(x==="link"&&o){const E=Array.from(n.styleSheets).find(B=>B.href===e.href);let w=null;E&&(w=Vn(E)),w&&(S.rel=null,S.href=null,S.crossorigin=null,S._cssText=Yn(w,E.href))}if(x==="style"&&e.sheet&&!(e.innerText||e.textContent||"").trim().length){const E=Vn(e.sheet);E&&(S._cssText=Yn(E,fr(n)))}if(x==="input"||x==="textarea"||x==="select"||x==="option"){const E=e,w=Hs(E),B=Gn(E,Zr(x),w),H=E.checked;if(w!=="submit"&&w!=="button"&&B){const N=wt(E,_,T,y,O,dr({type:w,tagName:Zr(x),maskInputOptions:c}));S.value=Vt({isMasked:N,element:E,value:B,maskInputFn:u})}H&&(S.checked=H)}if(x==="option"&&(e.selected&&!c.select?S.selected=!0:delete S.selected),x==="canvas"&&f){if(e.__context==="2d")cm(e)||(S.rr_dataURL=e.toDataURL(d.type,d.quality));else if(!("__context"in e)){const E=e.toDataURL(d.type,d.quality),w=n.createElement("canvas");w.width=e.width,w.height=e.height;const B=w.toDataURL(d.type,d.quality);E!==B&&(S.rr_dataURL=E)}}if(x==="img"&&l){pt||(pt=n.createElement("canvas"),no=pt.getContext("2d"));const E=e,w=E.currentSrc||E.getAttribute("src")||"<unknown-src>",B=E.crossOrigin,H=()=>{E.removeEventListener("load",H);try{pt.width=E.naturalWidth,pt.height=E.naturalHeight,no.drawImage(E,0,0),S.rr_dataURL=pt.toDataURL(d.type,d.quality)}catch(N){if(E.crossOrigin!=="anonymous"){E.crossOrigin="anonymous",E.complete&&E.naturalWidth!==0?H():E.addEventListener("load",H);return}else console.warn(`Cannot inline img src=${w}! Error: ${N}`)}E.crossOrigin==="anonymous"&&(B?S.crossOrigin=B:E.removeAttribute("crossorigin"))};E.complete&&E.naturalWidth!==0?H():E.addEventListener("load",H)}if((x==="audio"||x==="video")&&(S.rr_mediaState=e.paused?"paused":"played",S.rr_mediaCurrentTime=e.currentTime),h||(e.scrollLeft&&(S.rr_scrollLeft=e.scrollLeft),e.scrollTop&&(S.rr_scrollTop=e.scrollTop)),q){const{width:E,height:w}=e.getBoundingClientRect();S={class:S.class,rr_width:`${E}px`,rr_height:`${w}px`}}x==="iframe"&&!p(S.src)&&(!q&&!dc(e)&&(S.rr_src=S.src),delete S.src);let J;try{customElements.get(x)&&(J=!0)}catch{}return{type:ae.Element,tagName:x,attributes:S,childNodes:[],isSVG:bm(e)||void 0,needBlock:q,rootId:g,isCustom:J}}function ee(e){return e==null?"":e.toLowerCase()}function Am(e,t){if(t.comment&&e.type===ae.Comment)return!0;if(e.type===ae.Element){if(t.script&&(e.tagName==="script"||e.tagName==="link"&&(e.attributes.rel==="preload"||e.attributes.rel==="modulepreload")||e.tagName==="link"&&e.attributes.rel==="prefetch"&&typeof e.attributes.href=="string"&&cc(e.attributes.href)==="js"))return!0;if(t.headFavicon&&(e.tagName==="link"&&e.attributes.rel==="shortcut icon"||e.tagName==="meta"&&(ee(e.attributes.name).match(/^msapplication-tile(image|color)$/)||ee(e.attributes.name)==="application-name"||ee(e.attributes.rel)==="icon"||ee(e.attributes.rel)==="apple-touch-icon"||ee(e.attributes.rel)==="shortcut icon")))return!0;if(e.tagName==="meta"){if(t.headMetaDescKeywords&&ee(e.attributes.name).match(/^description|keywords$/))return!0;if(t.headMetaSocial&&(ee(e.attributes.property).match(/^(og|twitter|fb):/)||ee(e.attributes.name).match(/^(og|twitter):/)||ee(e.attributes.name)==="pinterest"))return!0;if(t.headMetaRobots&&(ee(e.attributes.name)==="robots"||ee(e.attributes.name)==="googlebot"||ee(e.attributes.name)==="bingbot"))return!0;if(t.headMetaHttpEquiv&&e.attributes["http-equiv"]!==void 0)return!0;if(t.headMetaAuthorship&&(ee(e.attributes.name)==="author"||ee(e.attributes.name)==="generator"||ee(e.attributes.name)==="framework"||ee(e.attributes.name)==="publisher"||ee(e.attributes.name)==="progid"||ee(e.attributes.property).match(/^article:/)||ee(e.attributes.property).match(/^product:/)))return!0;if(t.headMetaVerification&&(ee(e.attributes.name)==="google-site-verification"||ee(e.attributes.name)==="yandex-verification"||ee(e.attributes.name)==="csrf-token"||ee(e.attributes.name)==="p:domain_verify"||ee(e.attributes.name)==="verify-v1"||ee(e.attributes.name)==="verification"||ee(e.attributes.name)==="shopify-checkout-api-token"))return!0}}return!1}function yt(e,t){const{doc:n,mirror:r,blockClass:s,blockSelector:i,unblockSelector:o,maskAllText:c,maskTextClass:a,unmaskTextClass:u,maskTextSelector:d,unmaskTextSelector:l,skipChild:f=!1,inlineStylesheet:p=!0,maskInputOptions:h={},maskAttributeFn:g,maskTextFn:_,maskInputFn:y,slimDOMOptions:T,dataURLOptions:O={},inlineImages:L=!1,recordCanvas:q=!1,onSerialize:x,onIframeLoad:S,iframeLoadTimeout:I=5e3,onBlockedImageLoad:J,onStylesheetLoad:E,stylesheetLoadTimeout:w=5e3,keepIframeSrcFn:B=()=>!1,newlyAddedElement:H=!1,ignoreCSSAttributes:N}=t;let{preserveWhiteSpace:oe=!0}=t;const K=km(e,{doc:n,mirror:r,blockClass:s,blockSelector:i,maskAllText:c,unblockSelector:o,maskTextClass:a,unmaskTextClass:u,maskTextSelector:d,unmaskTextSelector:l,inlineStylesheet:p,maskInputOptions:h,maskAttributeFn:g,maskTextFn:_,maskInputFn:y,dataURLOptions:O,inlineImages:L,recordCanvas:q,keepIframeSrcFn:B,newlyAddedElement:H,ignoreCSSAttributes:N});if(!K)return console.warn(e,"not serialized"),null;let X;r.hasNode(e)?X=r.getId(e):Am(K,T)||!oe&&K.type===ae.Text&&!K.isStyle&&!K.textContent.replace(/^\s+|\s+$/gm,"").length?X=Gt:X=Us();const b=Object.assign(K,{id:X});if(r.add(e,b),X===Gt)return null;x&&x(e);let j=!f;if(b.type===ae.Element){j=j&&!b.needBlock;const k=e.shadowRoot;k&&Ut(k)&&(b.isShadowHost=!0)}if((b.type===ae.Document||b.type===ae.Element)&&j){T.headWhitespace&&b.type===ae.Element&&b.tagName==="head"&&(oe=!1);const k={doc:n,mirror:r,blockClass:s,blockSelector:i,maskAllText:c,unblockSelector:o,maskTextClass:a,unmaskTextClass:u,maskTextSelector:d,unmaskTextSelector:l,skipChild:f,inlineStylesheet:p,maskInputOptions:h,maskAttributeFn:g,maskTextFn:_,maskInputFn:y,slimDOMOptions:T,dataURLOptions:O,inlineImages:L,recordCanvas:q,preserveWhiteSpace:oe,onSerialize:x,onIframeLoad:S,iframeLoadTimeout:I,onBlockedImageLoad:J,onStylesheetLoad:E,stylesheetLoadTimeout:w,keepIframeSrcFn:B,ignoreCSSAttributes:N},G=e.childNodes?Array.from(e.childNodes):[];for(const Z of G){const re=yt(Z,k);re&&b.childNodes.push(re)}if(em(e)&&e.shadowRoot)for(const Z of Array.from(e.shadowRoot.childNodes)){const re=yt(Z,k);re&&(Ut(e.shadowRoot)&&(re.isShadow=!0),b.childNodes.push(re))}}if(e.parentNode&&Ht(e.parentNode)&&Ut(e.parentNode)&&(b.isShadow=!0),b.type===ae.Element&&b.tagName==="iframe"&&!b.needBlock&&Im(e,()=>{const k=dc(e);if(k&&S){const G=yt(k,{doc:k,mirror:r,blockClass:s,blockSelector:i,unblockSelector:o,maskAllText:c,maskTextClass:a,unmaskTextClass:u,maskTextSelector:d,unmaskTextSelector:l,skipChild:!1,inlineStylesheet:p,maskInputOptions:h,maskAttributeFn:g,maskTextFn:_,maskInputFn:y,slimDOMOptions:T,dataURLOptions:O,inlineImages:L,recordCanvas:q,preserveWhiteSpace:oe,onSerialize:x,onIframeLoad:S,iframeLoadTimeout:I,onStylesheetLoad:E,stylesheetLoadTimeout:w,keepIframeSrcFn:B,ignoreCSSAttributes:N});G&&S(e,G)}},I),b.type===ae.Element&&b.tagName==="img"&&!e.complete&&b.needBlock){const k=e,G=()=>{if(k.isConnected&&!k.complete&&J)try{const Z=k.getBoundingClientRect();Z.width>0&&Z.height>0&&J(k,b,Z)}catch{}k.removeEventListener("load",G)};k.isConnected&&k.addEventListener("load",G)}return b.type===ae.Element&&b.tagName==="link"&&typeof b.attributes.rel=="string"&&(b.attributes.rel==="stylesheet"||b.attributes.rel==="preload"&&typeof b.attributes.href=="string"&&cc(b.attributes.href)==="css")&&wm(e,()=>{if(E){const k=yt(e,{doc:n,mirror:r,blockClass:s,blockSelector:i,unblockSelector:o,maskAllText:c,maskTextClass:a,unmaskTextClass:u,maskTextSelector:d,unmaskTextSelector:l,skipChild:!1,inlineStylesheet:p,maskInputOptions:h,maskAttributeFn:g,maskTextFn:_,maskInputFn:y,slimDOMOptions:T,dataURLOptions:O,inlineImages:L,recordCanvas:q,preserveWhiteSpace:oe,onSerialize:x,onIframeLoad:S,iframeLoadTimeout:I,onStylesheetLoad:E,stylesheetLoadTimeout:w,keepIframeSrcFn:B,ignoreCSSAttributes:N});k&&E(e,k)}},w),b.type===ae.Element&&delete b.needBlock,b}function xm(e,t){const{mirror:n=new ac,blockClass:r="rr-block",blockSelector:s=null,unblockSelector:i=null,maskAllText:o=!1,maskTextClass:c="rr-mask",unmaskTextClass:a=null,maskTextSelector:u=null,unmaskTextSelector:d=null,inlineStylesheet:l=!0,inlineImages:f=!1,recordCanvas:p=!1,maskAllInputs:h=!1,maskAttributeFn:g,maskTextFn:_,maskInputFn:y,slimDOM:T=!1,dataURLOptions:O,preserveWhiteSpace:L,onSerialize:q,onIframeLoad:x,iframeLoadTimeout:S,onBlockedImageLoad:I,onStylesheetLoad:J,stylesheetLoadTimeout:E,keepIframeSrcFn:w=()=>!1,ignoreCSSAttributes:B=new Set([])}=t||{};return yt(e,{doc:e,mirror:n,blockClass:r,blockSelector:s,unblockSelector:i,maskAllText:o,maskTextClass:c,unmaskTextClass:a,maskTextSelector:u,unmaskTextSelector:d,skipChild:!1,inlineStylesheet:l,maskInputOptions:h===!0?{color:!0,date:!0,"datetime-local":!0,email:!0,month:!0,number:!0,range:!0,search:!0,tel:!0,text:!0,time:!0,url:!0,week:!0,textarea:!0,select:!0}:h===!1?{}:h,maskAttributeFn:g,maskTextFn:_,maskInputFn:y,slimDOMOptions:T===!0||T==="all"?{script:!0,comment:!0,headFavicon:!0,headWhitespace:!0,headMetaDescKeywords:T==="all",headMetaSocial:!0,headMetaRobots:!0,headMetaHttpEquiv:!0,headMetaAuthorship:!0,headMetaVerification:!0}:T===!1?{}:T,dataURLOptions:O,inlineImages:f,recordCanvas:p,preserveWhiteSpace:L,onSerialize:q,onIframeLoad:x,iframeLoadTimeout:S,onBlockedImageLoad:I,onStylesheetLoad:J,stylesheetLoadTimeout:E,keepIframeSrcFn:w,newlyAddedElement:!1,ignoreCSSAttributes:B})}function he(e,t,n=document){const r={capture:!0,passive:!0};return n.addEventListener(e,t,r),()=>n.removeEventListener(e,t,r)}const ht=`Please stop import mirror directly. Instead of that,\r
18
+ Name: ${ze(r)}
19
+ Error:`,s)}}function Df(){return Tf(e=>{nn("cls",{metric:e}),Ua=e},{reportAllChanges:!0})}function Ff(){return Of(e=>{nn("lcp",{metric:e}),Ha=e},{reportAllChanges:!0})}function Bf(){return Pf(e=>{nn("ttfb",{metric:e}),$a=e})}function Uf(){return Mf(e=>{nn("inp",{metric:e}),Wa=e})}function ur(e,t,n,r,s=!1){qa(e,t);let i;return zn[e]||(i=n(),zn[e]=!0),r&&t({metric:r}),ja(e,t,s?i:void 0)}function Hf(e){const t={};e==="event"&&(t.durationThreshold=0),Ct(e,n=>{nn(e,{entries:n})},t)}function qa(e,t){Lt[e]=Lt[e]||[],Lt[e].push(t)}function ja(e,t,n){return()=>{n&&n();const r=Lt[e];if(!r)return;const s=r.indexOf(t);s!==-1&&r.splice(s,1)}}function $f(e){return"duration"in e}function xr(e){return typeof e=="number"&&isFinite(e)}function Ve(e,t,n,{...r}){const s=H(e).start_timestamp;return s&&s>t&&typeof e.updateStartTime=="function"&&e.updateStartTime(t),gs(e,()=>{const i=kt({startTime:t,...r});return i&&i.end(n),i})}function Os(e){const t=$();if(!t)return;const{name:n,transaction:r,attributes:s,startTime:i}=e,{release:o,environment:c,sendDefaultPii:a}=t.getOptions(),d=t.getIntegrationByName("Replay")?.getReplayId(),l=te(),f=l.getUser(),p=f!==void 0?f.email||f.id||f.ip_address:void 0;let h;try{h=l.getScopeData().contexts.profile.profile_id}catch{}const g={release:o,environment:c,user:p||void 0,profile_id:h||void 0,replay_id:d||void 0,transaction:r,"user_agent.original":O.navigator?.userAgent,"client.address":a?"{{auto}}":void 0,...s};return kt({name:n,attributes:g,startTime:i,experimental:{standalone:!0}})}function rn(){return O.addEventListener&&O.performance}function ie(e){return e/1e3}function Wf(e){let t="unknown",n="unknown",r="";for(const s of e){if(s==="/"){[t,n]=e.split("/");break}if(!isNaN(Number(s))){t=r==="h"?"http":r,n=e.split(r)[1];break}r+=s}return r===e&&(t=r),{name:t,version:n}}function Va(e){try{return PerformanceObserver.supportedEntryTypes.includes(e)}catch{return!1}}function Ga(e,t){let n,r=!1;function s(c){!r&&n&&t(c,n),r=!0}Fa(()=>{s("pagehide")});const i=e.on("beforeStartNavigationSpan",(c,a)=>{a?.isRedirect||(s("navigation"),i(),o())}),o=e.on("afterStartPageLoadSpan",c=>{n=c.spanContext().spanId,o()})}function zf(e){let t=0,n;if(!Va("layout-shift"))return;const r=As(({metric:s})=>{const i=s.entries[s.entries.length-1];i&&(t=s.value,n=i)},!0);Ga(e,(s,i)=>{qf(t,n,i,s),r()})}function qf(e,t,n,r){st&&m.log(`Sending CLS span (${e})`);const s=t?ie((pe()||0)+t.startTime):ue(),i=te().getScopeData().transactionName,o=t?be(t.sources[0]?.node):"Layout shift",c={[ae]:"auto.http.browser.cls",[Fe]:"ui.webvital.cls",[It]:0,"sentry.pageload.span_id":n,"sentry.report_event":r};t?.sources&&t.sources.forEach((u,d)=>{c[`cls.source.${d+1}`]=be(u.node)});const a=Os({name:o,transaction:i,attributes:c,startTime:s});a&&(a.addEvent("cls",{[Yt]:"",[Jt]:e}),a.end(s))}function jf(e){let t=0,n;if(!Va("largest-contentful-paint"))return;const r=xs(({metric:s})=>{const i=s.entries[s.entries.length-1];i&&(t=s.value,n=i)},!0);Ga(e,(s,i)=>{Vf(t,n,i,s),r()})}function Vf(e,t,n,r){st&&m.log(`Sending LCP span (${e})`);const s=ie((pe()||0)+(t?.startTime||0)),i=te().getScopeData().transactionName,o=t?be(t.element):"Largest contentful paint",c={[ae]:"auto.http.browser.lcp",[Fe]:"ui.webvital.lcp",[It]:0,"sentry.pageload.span_id":n,"sentry.report_event":r};t&&(t.element&&(c["lcp.element"]=be(t.element)),t.id&&(c["lcp.id"]=t.id),t.url&&(c["lcp.url"]=t.url),t.loadTime!=null&&(c["lcp.loadTime"]=t.loadTime),t.renderTime!=null&&(c["lcp.renderTime"]=t.renderTime),t.size!=null&&(c["lcp.size"]=t.size));const a=Os({name:o,transaction:i,attributes:c,startTime:s});a&&(a.addEvent("lcp",{[Yt]:"millisecond",[Jt]:e}),a.end(s))}function ve(e){return e&&((pe()||performance.timeOrigin)+e)/1e3}function Ya(e){const t={};if(e.nextHopProtocol!=null){const{name:n,version:r}=Wf(e.nextHopProtocol);t["network.protocol.version"]=r,t["network.protocol.name"]=n}return pe()||rn()?.timeOrigin?Gf({...t,"http.request.redirect_start":ve(e.redirectStart),"http.request.redirect_end":ve(e.redirectEnd),"http.request.worker_start":ve(e.workerStart),"http.request.fetch_start":ve(e.fetchStart),"http.request.domain_lookup_start":ve(e.domainLookupStart),"http.request.domain_lookup_end":ve(e.domainLookupEnd),"http.request.connect_start":ve(e.connectStart),"http.request.secure_connection_start":ve(e.secureConnectionStart),"http.request.connection_end":ve(e.connectEnd),"http.request.request_start":ve(e.requestStart),"http.request.response_start":ve(e.responseStart),"http.request.response_end":ve(e.responseEnd),"http.request.time_to_first_byte":e.responseStart!=null?e.responseStart/1e3:void 0}):t}function Gf(e){return Object.fromEntries(Object.entries(e).filter(([,t])=>t!=null))}const Yf=2147483647;let ji=0,ke={},ge,qn;function Jf({recordClsStandaloneSpans:e,recordLcpStandaloneSpans:t,client:n}){const r=rn();if(r&&pe()){r.mark&&O.performance.mark("sentry-tracing-init");const s=t?jf(n):ep(),i=tp(),o=e?zf(n):Zf();return()=>{s?.(),i(),o?.()}}return()=>{}}function Kf(){it("longtask",({entries:e})=>{const t=de();if(!t)return;const{op:n,start_timestamp:r}=H(t);for(const s of e){const i=ie(pe()+s.startTime),o=ie(s.duration);n==="navigation"&&r&&i<r||Ve(t,i,i+o,{name:"Main UI thread blocked",op:"ui.long-task",attributes:{[ae]:"auto.ui.browser.metrics"}})}})}function Xf(){new PerformanceObserver(t=>{const n=de();if(n)for(const r of t.getEntries()){if(!r.scripts[0])continue;const s=ie(pe()+r.startTime),{start_timestamp:i,op:o}=H(n);if(o==="navigation"&&i&&s<i)continue;const c=ie(r.duration),a={[ae]:"auto.ui.browser.metrics"},u=r.scripts[0],{invoker:d,invokerType:l,sourceURL:f,sourceFunctionName:p,sourceCharPosition:h}=u;a["browser.script.invoker"]=d,a["browser.script.invoker_type"]=l,f&&(a["code.filepath"]=f),p&&(a["code.function"]=p),h!==-1&&(a["browser.script.source_char_position"]=h),Ve(n,s,s+c,{name:"Main UI thread blocked",op:"ui.long-animation-frame",attributes:a})}}).observe({type:"long-animation-frame",buffered:!0})}function Qf(){it("event",({entries:e})=>{const t=de();if(t){for(const n of e)if(n.name==="click"){const r=ie(pe()+n.startTime),s=ie(n.duration),i={name:be(n.target),op:`ui.interaction.${n.name}`,startTime:r,attributes:{[ae]:"auto.ui.browser.metrics"}},o=Xo(n.target);o&&(i.attributes["ui.component_name"]=o),Ve(t,r,r+s,i)}}})}function Zf(){return As(({metric:e})=>{const t=e.entries[e.entries.length-1];t&&(ke.cls={value:e.value,unit:""},qn=t)},!0)}function ep(){return xs(({metric:e})=>{const t=e.entries[e.entries.length-1];t&&(ke.lcp={value:e.value,unit:"millisecond"},ge=t)},!0)}function tp(){return Lf(({metric:e})=>{e.entries[e.entries.length-1]&&(ke.ttfb={value:e.value,unit:"millisecond"})})}function np(e,t){const n=rn(),r=pe();if(!n?.getEntries||!r)return;const s=ie(r),i=n.getEntries(),{op:o,start_timestamp:c}=H(e);i.slice(ji).forEach(a=>{const u=ie(a.startTime),d=ie(Math.max(0,a.duration));if(!(o==="navigation"&&c&&s+u<c))switch(a.entryType){case"navigation":{op(e,a,s);break}case"mark":case"paint":case"measure":{sp(e,a,u,d,s,t.ignorePerformanceApiSpans);const l=en(),f=a.startTime<l.firstHiddenTime;a.name==="first-paint"&&f&&(ke.fp={value:a.startTime,unit:"millisecond"}),a.name==="first-contentful-paint"&&f&&(ke.fcp={value:a.startTime,unit:"millisecond"});break}case"resource":{up(e,a,a.name,u,d,s,t.ignoreResourceSpans);break}}}),ji=Math.max(i.length-1,0),lp(e),o==="pageload"&&(pp(ke),t.recordClsOnPageloadSpan||delete ke.cls,t.recordLcpOnPageloadSpan||delete ke.lcp,Object.entries(ke).forEach(([a,u])=>{ol(a,u.value,u.unit)}),e.setAttribute("performance.timeOrigin",s),e.setAttribute("performance.activationStart",Rt()),dp(e,t)),ge=void 0,qn=void 0,ke={}}function rp(e){if(e?.entryType==="measure")try{return e.detail.devtools.track==="Components ⚛"}catch{return}}function sp(e,t,n,r,s,i){if(rp(t)||["mark","measure"].includes(t.entryType)&&Pe(t.name,i))return;const o=Zt(!1),c=ie(o?o.requestStart:0),a=s+Math.max(n,c),u=s+n,d=u+r,l={[ae]:"auto.resource.browser.metrics"};a!==u&&(l["sentry.browser.measure_happened_before_request"]=!0,l["sentry.browser.measure_start_time"]=a),ip(l,t),a<=d&&Ve(e,a,d,{name:t.name,op:t.entryType,attributes:l})}function ip(e,t){try{const n=t.detail;if(!n)return;if(typeof n=="object"){for(const[r,s]of Object.entries(n))if(s&&rt(s))e[`sentry.browser.measure.detail.${r}`]=s;else if(s!==void 0)try{e[`sentry.browser.measure.detail.${r}`]=JSON.stringify(s)}catch{}return}if(rt(n)){e["sentry.browser.measure.detail"]=n;return}try{e["sentry.browser.measure.detail"]=JSON.stringify(n)}catch{}}catch{}}function op(e,t,n){["unloadEvent","redirect","domContentLoadedEvent","loadEvent","connect"].forEach(r=>{fn(e,t,r,n)}),fn(e,t,"secureConnection",n,"TLS/SSL"),fn(e,t,"fetch",n,"cache"),fn(e,t,"domainLookup",n,"DNS"),cp(e,t,n)}function fn(e,t,n,r,s=n){const i=ap(n),o=t[i],c=t[`${n}Start`];!c||!o||Ve(e,r+ie(c),r+ie(o),{op:`browser.${s}`,name:t.name,attributes:{[ae]:"auto.ui.browser.metrics",...n==="redirect"&&t.redirectCount!=null?{"http.redirect_count":t.redirectCount}:{}}})}function ap(e){return e==="secureConnection"?"connectEnd":e==="fetch"?"domainLookupStart":`${e}End`}function cp(e,t,n){const r=n+ie(t.requestStart),s=n+ie(t.responseEnd),i=n+ie(t.responseStart);t.responseEnd&&(Ve(e,r,s,{op:"browser.request",name:t.name,attributes:{[ae]:"auto.ui.browser.metrics"}}),Ve(e,i,s,{op:"browser.response",name:t.name,attributes:{[ae]:"auto.ui.browser.metrics"}}))}function up(e,t,n,r,s,i,o){if(t.initiatorType==="xmlhttprequest"||t.initiatorType==="fetch")return;const c=t.initiatorType?`resource.${t.initiatorType}`:"resource.other";if(o?.includes(c))return;const a={[ae]:"auto.resource.browser.metrics"},u=tt(n);u.protocol&&(a["url.scheme"]=u.protocol.split(":").pop()),u.host&&(a["server.address"]=u.host),a["url.same_origin"]=n.includes(O.location.origin),fp(t,a,[["responseStatus","http.response.status_code"],["transferSize","http.response_transfer_size"],["encodedBodySize","http.response_content_length"],["decodedBodySize","http.decoded_response_content_length"],["renderBlockingStatus","resource.render_blocking_status"],["deliveryType","http.response_delivery_type"]]);const d={...a,...Ya(t)},l=i+r,f=l+s;Ve(e,l,f,{name:n.replace(O.location.origin,""),op:c,attributes:d})}function lp(e){const t=O.navigator;if(!t)return;const n=t.connection;n&&(n.effectiveType&&e.setAttribute("effectiveConnectionType",n.effectiveType),n.type&&e.setAttribute("connectionType",n.type),xr(n.rtt)&&(ke["connection.rtt"]={value:n.rtt,unit:"millisecond"})),xr(t.deviceMemory)&&e.setAttribute("deviceMemory",`${t.deviceMemory} GB`),xr(t.hardwareConcurrency)&&e.setAttribute("hardwareConcurrency",String(t.hardwareConcurrency))}function dp(e,t){ge&&t.recordLcpOnPageloadSpan&&(ge.element&&e.setAttribute("lcp.element",be(ge.element)),ge.id&&e.setAttribute("lcp.id",ge.id),ge.url&&e.setAttribute("lcp.url",ge.url.trim().slice(0,200)),ge.loadTime!=null&&e.setAttribute("lcp.loadTime",ge.loadTime),ge.renderTime!=null&&e.setAttribute("lcp.renderTime",ge.renderTime),e.setAttribute("lcp.size",ge.size)),qn?.sources&&t.recordClsOnPageloadSpan&&qn.sources.forEach((n,r)=>e.setAttribute(`cls.source.${r+1}`,be(n.node)))}function fp(e,t,n){n.forEach(([r,s])=>{const i=e[r];i!=null&&(typeof i=="number"&&i<Yf||typeof i=="string")&&(t[s]=i)})}function pp(e){const t=Zt(!1);if(!t)return;const{responseStart:n,requestStart:r}=t;r<=n&&(e["ttfb.requestTime"]={value:n-r,unit:"millisecond"})}function hp(){return rn()&&pe()?it("element",mp):()=>{}}const mp=({entries:e})=>{const t=de(),n=t?le(t):void 0,r=n?H(n).description:te().getScopeData().transactionName;e.forEach(s=>{const i=s;if(!i.identifier)return;const o=i.name,c=i.renderTime,a=i.loadTime,[u,d]=a?[ie(a),"load-time"]:c?[ie(c),"render-time"]:[ue(),"entry-emission"],l=o==="image-paint"?ie(Math.max(0,(c??0)-(a??0))):0,f={[ae]:"auto.ui.browser.elementtiming",[Fe]:"ui.elementtiming",[Re]:"component","sentry.span_start_time_source":d,"sentry.transaction_name":r,"element.id":i.id,"element.type":i.element?.tagName?.toLowerCase()||"unknown","element.size":i.naturalWidth&&i.naturalHeight?`${i.naturalWidth}x${i.naturalHeight}`:void 0,"element.render_time":c,"element.load_time":a,"element.url":i.url||void 0,"element.identifier":i.identifier,"element.paint_type":o};fl({name:`element[${i.identifier}]`,attributes:f,startTime:u,onlyIfParent:!0},p=>{p.end(u+l)})})},gp=1e3;let Vi,Yr,Jr;function Ja(e){Ge("dom",e),Ye("dom",_p)}function _p(){if(!O.document)return;const e=Te.bind(null,"dom"),t=Gi(e,!0);O.document.addEventListener("click",t,!1),O.document.addEventListener("keypress",t,!1),["EventTarget","Node"].forEach(n=>{const s=O[n]?.prototype;s?.hasOwnProperty?.("addEventListener")&&(_e(s,"addEventListener",function(i){return function(o,c,a){if(o==="click"||o=="keypress")try{const u=this.__sentry_instrumentation_handlers__=this.__sentry_instrumentation_handlers__||{},d=u[o]=u[o]||{refCount:0};if(!d.handler){const l=Gi(e);d.handler=l,i.call(this,o,l,a)}d.refCount++}catch{}return i.call(this,o,c,a)}}),_e(s,"removeEventListener",function(i){return function(o,c,a){if(o==="click"||o=="keypress")try{const u=this.__sentry_instrumentation_handlers__||{},d=u[o];d&&(d.refCount--,d.refCount<=0&&(i.call(this,o,d.handler,a),d.handler=void 0,delete u[o]),Object.keys(u).length===0&&delete this.__sentry_instrumentation_handlers__)}catch{}return i.call(this,o,c,a)}}))})}function Sp(e){if(e.type!==Yr)return!1;try{if(!e.target||e.target._sentryId!==Jr)return!1}catch{}return!0}function yp(e,t){return e!=="keypress"?!1:t?.tagName?!(t.tagName==="INPUT"||t.tagName==="TEXTAREA"||t.isContentEditable):!0}function Gi(e,t=!1){return n=>{if(!n||n._sentryCaptured)return;const r=Ep(n);if(yp(n.type,r))return;Pn(n,"_sentryCaptured",!0),r&&!r._sentryId&&Pn(r,"_sentryId",Me());const s=n.type==="keypress"?"input":n.type;Sp(n)||(e({event:n,name:s,global:t}),Yr=n.type,Jr=r?r._sentryId:void 0),clearTimeout(Vi),Vi=O.setTimeout(()=>{Jr=void 0,Yr=void 0},gp)}}function Ep(e){try{return e.target}catch{return null}}let pn;function lr(e){const t="history";Ge(t,e),Ye(t,bp)}function bp(){if(O.addEventListener("popstate",()=>{const t=O.location.href,n=pn;if(pn=t,n===t)return;Te("history",{from:n,to:t})}),!qd())return;function e(t){return function(...n){const r=n.length>2?n[2]:void 0;if(r){const s=pn,i=vp(String(r));if(pn=i,s===i)return t.apply(this,n);Te("history",{from:s,to:i})}return t.apply(this,n)}}_e(O.history,"pushState",e),_e(O.history,"replaceState",e)}function vp(e){try{return new URL(e,O.location.origin).toString()}catch{return e}}const Mn={};function Ns(e){const t=Mn[e];if(t)return t;let n=O[e];if(zr(n))return Mn[e]=n.bind(O);const r=O.document;if(r&&typeof r.createElement=="function")try{const s=r.createElement("iframe");s.hidden=!0,r.head.appendChild(s);const i=s.contentWindow;i?.[e]&&(n=i[e]),r.head.removeChild(s)}catch(s){st&&m.warn(`Could not create sandbox iframe for ${e} check, bailing to window.${e}: `,s)}return n&&(Mn[e]=n.bind(O))}function Tp(e){Mn[e]=void 0}function sn(...e){return Ns("setTimeout")(...e)}const Qe="__sentry_xhr_v3__";function Ka(e){Ge("xhr",e),Ye("xhr",Ip)}function Ip(){if(!O.XMLHttpRequest)return;const e=XMLHttpRequest.prototype;e.open=new Proxy(e.open,{apply(t,n,r){const s=new Error,i=ue()*1e3,o=Pt(r[0])?r[0].toUpperCase():void 0,c=wp(r[1]);if(!o||!c)return t.apply(n,r);n[Qe]={method:o,url:c,request_headers:{}},o==="POST"&&c.match(/sentry_key/)&&(n.__sentry_own_request__=!0);const a=()=>{const u=n[Qe];if(u&&n.readyState===4){try{u.status_code=n.status}catch{}const d={endTimestamp:ue()*1e3,startTimestamp:i,xhr:n,virtualError:s};Te("xhr",d)}};return"onreadystatechange"in n&&typeof n.onreadystatechange=="function"?n.onreadystatechange=new Proxy(n.onreadystatechange,{apply(u,d,l){return a(),u.apply(d,l)}}):n.addEventListener("readystatechange",a),n.setRequestHeader=new Proxy(n.setRequestHeader,{apply(u,d,l){const[f,p]=l,h=d[Qe];return h&&Pt(f)&&Pt(p)&&(h.request_headers[f.toLowerCase()]=p),u.apply(d,l)}}),t.apply(n,r)}}),e.send=new Proxy(e.send,{apply(t,n,r){const s=n[Qe];if(!s)return t.apply(n,r);r[0]!==void 0&&(s.body=r[0]);const i={startTimestamp:ue()*1e3,xhr:n};return Te("xhr",i),t.apply(n,r)}})}function wp(e){if(Pt(e))return e;try{return e.toString()}catch{}}const kp=Symbol.for("sentry__originalRequestBody");function Xa(e){return new URLSearchParams(e).toString()}function Qa(e,t=m){try{if(typeof e=="string")return[e];if(e instanceof URLSearchParams)return[e.toString()];if(e instanceof FormData)return[Xa(e)];if(!e)return[void 0]}catch(n){return st&&t.error(n,"Failed to serialize body",e),[void 0,"BODY_PARSE_ERROR"]}return st&&t.log("Skipping network body because of body type",e),[void 0,"UNPARSEABLE_BODY_TYPE"]}function Za(e=[]){if(e.length>=2&&e[1]&&typeof e[1]=="object"&&"body"in e[1])return e[1].body;if(e.length>=1&&e[0]instanceof Request){const n=e[0][kp];return n!==void 0?n:void 0}}function ec(e){let t;try{t=e.getAllResponseHeaders()}catch(n){return st&&m.error(n,"Failed to get xhr response headers",e),{}}return t?t.split(`\r
20
+ `).reduce((n,r)=>{const[s,i]=r.split(": ");return i&&(n[s.toLowerCase()]=i),n},{}):{}}const Or=[],An=new Map,ut=new Map,Rp=60;function Cp(){if(rn()&&pe()){const t=Mp();return()=>{t()}}return()=>{}}const Kr={click:"click",pointerdown:"click",pointerup:"click",mousedown:"click",mouseup:"click",touchstart:"click",touchend:"click",mouseover:"hover",mouseout:"hover",mouseenter:"hover",mouseleave:"hover",pointerover:"hover",pointerout:"hover",pointerenter:"hover",pointerleave:"hover",dragstart:"drag",dragend:"drag",drag:"drag",dragenter:"drag",dragleave:"drag",dragover:"drag",drop:"drag",keydown:"press",keyup:"press",keypress:"press",input:"press"};function Mp(){return za(Ap)}const Ap=({metric:e})=>{if(e.value==null)return;const t=ie(e.value);if(t>Rp)return;const n=e.entries.find(h=>h.duration===e.value&&Kr[h.name]);if(!n)return;const{interactionId:r}=n,s=Kr[n.name],i=ie(pe()+n.startTime),o=de(),c=o?le(o):void 0,a=r!=null?An.get(r):void 0,u=a?.span||c,d=u?H(u).description:te().getScopeData().transactionName,l=a?.elementName||be(n.target),f={[ae]:"auto.http.browser.inp",[Fe]:`ui.interaction.${s}`,[It]:n.duration},p=Os({name:l,transaction:d,attributes:f,startTime:i});p&&(p.addEvent("inp",{[Yt]:"millisecond",[Jt]:e.value}),p.end(i+t))};function xp(){const e=Object.keys(Kr);qr()&&e.forEach(s=>{O.addEventListener(s,t,{capture:!0,passive:!0})});function t(s){const i=s.target;if(!i)return;const o=be(i),c=Math.round(s.timeStamp);if(ut.set(c,o),ut.size>50){const a=ut.keys().next().value;a!==void 0&&ut.delete(a)}}function n(s){const i=Math.round(s.startTime);let o=ut.get(i);if(!o)for(let c=-5;c<=5;c++){const a=ut.get(i+c);if(a){o=a;break}}return o||"<unknown>"}const r=({entries:s})=>{const i=de(),o=i&&le(i);s.forEach(c=>{if(!$f(c))return;const a=c.interactionId;if(a==null||An.has(a))return;const u=c.target?be(c.target):n(c);if(Or.length>10){const d=Or.shift();An.delete(d)}Or.push(a),An.set(a,{span:o,elementName:u})})};it("event",r),it("first-input",r)}const Op=40;function Ps(e,t=Ns("fetch")){let n=0,r=0;async function s(i){const o=i.body.length;n+=o,r++;const c={body:i.body,method:"POST",referrerPolicy:"strict-origin",headers:e.headers,keepalive:n<=6e4&&r<15,...e.fetchOptions};try{const a=await t(e.url,c);return{statusCode:a.status,headers:{"x-sentry-rate-limits":a.headers.get("X-Sentry-Rate-Limits"),"retry-after":a.headers.get("Retry-After")}}}catch(a){throw Tp("fetch"),a}finally{n-=o,r--}}return Bl(e,s,bs(e.bufferSize||Op))}const Np=30,Pp=50;function Xr(e,t,n,r){const s={filename:e,function:t==="<anonymous>"?yt:t,in_app:!0};return n!==void 0&&(s.lineno=n),r!==void 0&&(s.colno=r),s}const Lp=/^\s*at (\S+?)(?::(\d+))(?::(\d+))\s*$/i,Dp=/^\s*at (?:(.+?\)(?: \[.+\])?|.*?) ?\((?:address at )?)?(?:async )?((?:<anonymous>|[-a-z]+:|.*bundle|\/)?.*?)(?::(\d+))?(?::(\d+))?\)?\s*$/i,Fp=/\((\S*)(?::(\d+))(?::(\d+))\)/,Bp=/at (.+?) ?\(data:(.+?),/,Up=e=>{const t=e.match(Bp);if(t)return{filename:`<data:${t[2]}>`,function:t[1]};const n=Lp.exec(e);if(n){const[,s,i,o]=n;return Xr(s,yt,+i,+o)}const r=Dp.exec(e);if(r){if(r[2]&&r[2].indexOf("eval")===0){const c=Fp.exec(r[2]);c&&(r[2]=c[1],r[3]=c[2],r[4]=c[3])}const[i,o]=tc(r[1]||yt,r[2]);return Xr(o,i,r[3]?+r[3]:void 0,r[4]?+r[4]:void 0)}},Hp=[Np,Up],$p=/^\s*(.*?)(?:\((.*?)\))?(?:^|@)?((?:[-a-z]+)?:\/.*?|\[native code\]|[^@]*(?:bundle|\d+\.js)|\/[\w\-. /=]+)(?::(\d+))?(?::(\d+))?\s*$/i,Wp=/(\S+) line (\d+)(?: > eval line \d+)* > eval/i,zp=e=>{const t=$p.exec(e);if(t){if(t[3]&&t[3].indexOf(" > eval")>-1){const i=Wp.exec(t[3]);i&&(t[1]=t[1]||"eval",t[3]=i[1],t[4]=i[2],t[5]="")}let r=t[3],s=t[1]||yt;return[s,r]=tc(s,r),Xr(r,s,t[4]?+t[4]:void 0,t[5]?+t[5]:void 0)}},qp=[Pp,zp],jp=[Hp,qp],Vp=Mu(...jp),tc=(e,t)=>{const n=e.indexOf("safari-extension")!==-1,r=e.indexOf("safari-web-extension")!==-1;return n||r?[e.indexOf("@")!==-1?e.split("@")[0]:yt,n?`safari-extension:${t}`:`safari-web-extension:${t}`]:[e,t]},hn=1024,Gp="Breadcrumbs",Yp=((e={})=>{const t={console:!0,dom:!0,fetch:!0,history:!0,sentry:!0,xhr:!0,...e};return{name:Gp,setup(n){t.console&&wa(Qp(n)),t.dom&&Ja(Xp(n,t.dom)),t.xhr&&Ka(Zp(n)),t.fetch&&Aa(eh(n)),t.history&&lr(th(n)),t.sentry&&n.on("beforeSendEvent",Kp(n))}}}),Jp=Yp;function Kp(e){return function(n){$()===e&&je({category:`sentry.${n.type==="transaction"?"transaction":"event"}`,event_id:n.event_id,level:n.level,message:Xe(n)},{event:n})}}function Xp(e,t){return function(r){if($()!==e)return;let s,i,o=typeof t=="object"?t.serializeAttribute:void 0,c=typeof t=="object"&&typeof t.maxStringLength=="number"?t.maxStringLength:void 0;c&&c>hn&&(v&&m.warn(`\`dom.maxStringLength\` cannot exceed ${hn}, but a value of ${c} was configured. Sentry will use ${hn} instead.`),c=hn),typeof o=="string"&&(o=[o]);try{const u=r.event,d=nh(u)?u.target:u;s=be(d,{keyAttrs:o,maxStringLength:c}),i=Xo(d)}catch{s="<unknown>"}if(s.length===0)return;const a={category:`ui.${r.name}`,message:s};i&&(a.data={"ui.component_name":i}),je(a,{event:r.event,name:r.name,global:r.global})}}function Qp(e){return function(n){if($()!==e)return;const r={category:"console",data:{arguments:n.args,logger:"console"},level:ka(n.level),message:di(n.args," ")};if(n.level==="assert")if(n.args[0]===!1)r.message=`Assertion failed: ${di(n.args.slice(1)," ")||"console.assert"}`,r.data.arguments=n.args.slice(1);else return;je(r,{input:n.args,level:n.level})}}function Zp(e){return function(n){if($()!==e)return;const{startTimestamp:r,endTimestamp:s}=n,i=n.xhr[Qe];if(!r||!s||!i)return;const{method:o,url:c,status_code:a,body:u}=i,d={method:o,url:c,status_code:a},l={xhr:n.xhr,input:u,startTimestamp:r,endTimestamp:s},f={category:"xhr",data:d,type:"http",level:Ma(a)};e.emit("beforeOutgoingRequestBreadcrumb",f,l),je(f,l)}}function eh(e){return function(n){if($()!==e)return;const{startTimestamp:r,endTimestamp:s}=n;if(s&&!(n.fetchData.url.match(/sentry_key/)&&n.fetchData.method==="POST"))if(n.fetchData.method,n.fetchData.url,n.error){const i=n.fetchData,o={data:n.error,input:n.args,startTimestamp:r,endTimestamp:s},c={category:"fetch",data:i,level:"error",type:"http"};e.emit("beforeOutgoingRequestBreadcrumb",c,o),je(c,o)}else{const i=n.response,o={...n.fetchData,status_code:i?.status};n.fetchData.request_body_size,n.fetchData.response_body_size,i?.status;const c={input:n.args,response:i,startTimestamp:r,endTimestamp:s},a={category:"fetch",data:o,type:"http",level:Ma(o.status_code)};e.emit("beforeOutgoingRequestBreadcrumb",a,c),je(a,c)}}}function th(e){return function(n){if($()!==e)return;let r=n.from,s=n.to;const i=tt(D.location.href);let o=r?tt(r):void 0;const c=tt(s);o?.path||(o=i),i.protocol===c.protocol&&i.host===c.host&&(s=c.relative),i.protocol===o.protocol&&i.host===o.host&&(r=o.relative),je({category:"navigation",data:{from:r,to:s}})}}function nh(e){return!!e&&!!e.target}const rh=["EventTarget","Window","Node","ApplicationCache","AudioTrackList","BroadcastChannel","ChannelMergerNode","CryptoOperation","EventSource","FileReader","HTMLUnknownElement","IDBDatabase","IDBRequest","IDBTransaction","KeyOperation","MediaController","MessagePort","ModalWindow","Notification","SVGElementInstance","Screen","SharedWorker","TextTrack","TextTrackCue","TextTrackList","WebSocket","WebSocketWorker","Worker","XMLHttpRequest","XMLHttpRequestEventTarget","XMLHttpRequestUpload"],sh="BrowserApiErrors",ih=((e={})=>{const t={XMLHttpRequest:!0,eventTarget:!0,requestAnimationFrame:!0,setInterval:!0,setTimeout:!0,unregisterOriginalCallbacks:!1,...e};return{name:sh,setupOnce(){t.setTimeout&&_e(D,"setTimeout",Yi),t.setInterval&&_e(D,"setInterval",Yi),t.requestAnimationFrame&&_e(D,"requestAnimationFrame",ah),t.XMLHttpRequest&&"XMLHttpRequest"in D&&_e(XMLHttpRequest.prototype,"send",ch);const n=t.eventTarget;n&&(Array.isArray(n)?n:rh).forEach(s=>uh(s,t))}}}),oh=ih;function Yi(e){return function(...t){const n=t[0];return t[0]=$t(n,{mechanism:{handled:!1,type:`auto.browser.browserapierrors.${ze(e)}`}}),e.apply(this,t)}}function ah(e){return function(t){return e.apply(this,[$t(t,{mechanism:{data:{handler:ze(e)},handled:!1,type:"auto.browser.browserapierrors.requestAnimationFrame"}})])}}function ch(e){return function(...t){const n=this;return["onload","onerror","onprogress","onreadystatechange"].forEach(s=>{s in n&&typeof n[s]=="function"&&_e(n,s,function(i){const o={mechanism:{data:{handler:ze(i)},handled:!1,type:`auto.browser.browserapierrors.xhr.${s}`}},c=Vo(i);return c&&(o.mechanism.data.handler=ze(c)),$t(i,o)})}),e.apply(this,t)}}function uh(e,t){const r=D[e]?.prototype;r?.hasOwnProperty?.("addEventListener")&&(_e(r,"addEventListener",function(s){return function(i,o,c){try{lh(o)&&(o.handleEvent=$t(o.handleEvent,{mechanism:{data:{handler:ze(o),target:e},handled:!1,type:"auto.browser.browserapierrors.handleEvent"}}))}catch{}return t.unregisterOriginalCallbacks&&dh(this,i,o),s.apply(this,[i,$t(o,{mechanism:{data:{handler:ze(o),target:e},handled:!1,type:"auto.browser.browserapierrors.addEventListener"}}),c])}}),_e(r,"removeEventListener",function(s){return function(i,o,c){try{const a=o.__sentry_wrapped__;a&&s.call(this,i,a,c)}catch{}return s.call(this,i,o,c)}}))}function lh(e){return typeof e.handleEvent=="function"}function dh(e,t,n){e&&typeof e=="object"&&"removeEventListener"in e&&typeof e.removeEventListener=="function"&&e.removeEventListener(t,n)}const fh=()=>({name:"BrowserSession",setupOnce(){if(typeof D.document>"u"){v&&m.warn("Using the `browserSessionIntegration` in non-browser environments is not supported.");return}fi({ignoreDuration:!0}),pi(),lr(({from:e,to:t})=>{e!==void 0&&e!==t&&(fi({ignoreDuration:!0}),pi())})}}),ph="GlobalHandlers",hh=((e={})=>{const t={onerror:!0,onunhandledrejection:!0,...e};return{name:ph,setupOnce(){Error.stackTraceLimit=50},setup(n){t.onerror&&(gh(n),Ji("onerror")),t.onunhandledrejection&&(_h(n),Ji("onunhandledrejection"))}}}),mh=hh;function gh(e){na(t=>{const{stackParser:n,attachStacktrace:r}=nc();if($()!==e||Qo())return;const{msg:s,url:i,line:o,column:c,error:a}=t,u=Eh(ks(n,a||s,void 0,r,!1),i,o,c);u.level="error",Zo(u,{originalException:a,mechanism:{handled:!1,type:"auto.browser.global_handlers.onerror"}})})}function _h(e){ra(t=>{const{stackParser:n,attachStacktrace:r}=nc();if($()!==e||Qo())return;const s=Sh(t),i=rt(s)?yh(s):ks(n,s,void 0,r,!0);i.level="error",Zo(i,{originalException:s,mechanism:{handled:!1,type:"auto.browser.global_handlers.onunhandledrejection"}})})}function Sh(e){if(rt(e))return e;try{if("reason"in e)return e.reason;if("detail"in e&&"reason"in e.detail)return e.detail.reason}catch{}return e}function yh(e){return{exception:{values:[{type:"UnhandledRejection",value:`Non-Error promise rejection captured with value: ${String(e)}`}]}}}function Eh(e,t,n,r){const s=e.exception=e.exception||{},i=s.values=s.values||[],o=i[0]=i[0]||{},c=o.stacktrace=o.stacktrace||{},a=c.frames=c.frames||[],u=r,d=n,l=bh(t)??Xt();return a.length===0&&a.push({colno:u,filename:l,function:yt,in_app:!0,lineno:d}),e}function Ji(e){v&&m.log(`Global Handler attached: ${e}`)}function nc(){return $()?.getOptions()||{stackParser:()=>[],attachStacktrace:!1}}function bh(e){if(!(!Pt(e)||e.length===0)){if(e.startsWith("data:")){const t=e.match(/^data:([^;]+)/),n=t?t[1]:"text/javascript",r=e.includes("base64,");return`<data:${n}${r?",base64":""}>`}return e}}const vh=()=>({name:"HttpContext",preprocessEvent(e){if(!D.navigator&&!D.location&&!D.document)return;const t=ms(),n={...t.headers,...e.request?.headers};e.request={...t,...e.request,headers:n}}}),Th="cause",Ih=5,wh="LinkedErrors",kh=((e={})=>{const t=e.limit||Ih,n=e.key||Th;return{name:wh,preprocessEvent(r,s,i){const o=i.getOptions();Td(Is,o.stackParser,n,t,r,s)}}}),Rh=kh,Ch="SpotlightBrowser",Mh=((e={})=>{const t=e.sidecarUrl||"http://localhost:8969/stream";return{name:Ch,setup:()=>{v&&m.log("Using Sidecar URL",t)},processEvent:n=>Oh(n)?null:n,afterAllSetup:n=>{Ah(n,t)}}});function Ah(e,t){const n=Ns("fetch");let r=0;e.on("beforeEnvelope",s=>{if(r>3){m.warn("[Spotlight] Disabled Sentry -> Spotlight integration due to too many failed requests:",r);return}n(t,{method:"POST",body:Un(s),headers:{"Content-Type":"application/x-sentry-envelope"},mode:"cors"}).then(i=>{i.status>=200&&i.status<400&&(r=0)},i=>{r++,m.error("Sentry SDK can't connect to Sidecar is it running? See: https://spotlightjs.com/sidecar/npx/",i)})})}const xh=Mh;function Oh(e){return!!(e.type==="transaction"&&e.spans&&e.contexts?.trace&&e.contexts.trace.op==="ui.action.click"&&e.spans.some(({description:t})=>t?.includes("#sentry-spotlight")))}function Nh(){return Ph()?(v&&Kt(()=>{console.error("[Sentry] You cannot use Sentry.init() in a browser extension, see: https://docs.sentry.io/platforms/javascript/best-practices/browser-extensions/")}),!0):!1}function Ph(){if(typeof D.window>"u")return!1;const e=D;if(e.nw||!(e.chrome||e.browser)?.runtime?.id)return!1;const n=Xt(),r=["chrome-extension","moz-extension","ms-browser-extension","safari-web-extension"];return!(D===D.top&&r.some(i=>n.startsWith(`${i}://`)))}function Lh(e){return[md(),dd(),oh(),Jp(),mh(),Rh(),Rd(),vh(),fh()]}function Dh(e={}){const t=!e.skipBrowserExtensionCheck&&Nh();let n=e.defaultIntegrations==null?Lh():e.defaultIntegrations;const r={...e,enabled:t?!1:e.enabled,stackParser:Au(e.stackParser||Vp),integrations:bl({integrations:e.integrations,defaultIntegrations:n}),transport:e.transport||Ps};return Yl(hf,r)}const Z=X,Ls="sentryReplaySession",Fh="replay_event",Ds="Unable to send Replay",Bh=3e5,Uh=9e5,Hh=5e3,$h=5500,Wh=6e4,zh=5e3,qh=3,Ki=15e4,mn=5e3,jh=3e3,Vh=300,Fs=2e7,Gh=4999,Yh=5e4,Xi=36e5;var Jh=Object.defineProperty,Kh=(e,t,n)=>t in e?Jh(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,Qi=(e,t,n)=>Kh(e,typeof t!="symbol"?t+"":t,n),oe=(e=>(e[e.Document=0]="Document",e[e.DocumentType=1]="DocumentType",e[e.Element=2]="Element",e[e.Text=3]="Text",e[e.CDATA=4]="CDATA",e[e.Comment=5]="Comment",e))(oe||{});function Xh(e){return e.nodeType===e.ELEMENT_NODE}function Dt(e){return e?.host?.shadowRoot===e}function Ft(e){return Object.prototype.toString.call(e)==="[object ShadowRoot]"}function Qh(e){return e.includes(" background-clip: text;")&&!e.includes(" -webkit-background-clip: text;")&&(e=e.replace(/\sbackground-clip:\s*text;/g," -webkit-background-clip: text; background-clip: text;")),e}function Zh(e){const{cssText:t}=e;if(t.split('"').length<3)return t;const n=["@import",`url(${JSON.stringify(e.href)})`];return e.layerName===""?n.push("layer"):e.layerName&&n.push(`layer(${e.layerName})`),e.supportsText&&n.push(`supports(${e.supportsText})`),e.media.length&&n.push(e.media.mediaText),n.join(" ")+";"}function jn(e){try{const t=e.rules||e.cssRules;return t?Qh(Array.from(t,rc).join("")):null}catch{return null}}function em(e){let t="";for(let n=0;n<e.style.length;n++){const r=e.style,s=r[n],i=r.getPropertyPriority(s);t+=`${s}:${r.getPropertyValue(s)}${i?" !important":""};`}return`${e.selectorText} { ${t} }`}function rc(e){let t;if(nm(e))try{t=jn(e.styleSheet)||Zh(e)}catch{}else if(rm(e)){let n=e.cssText;const r=e.selectorText.includes(":"),s=typeof e.style.all=="string"&&e.style.all;if(s&&(n=em(e)),r&&(n=tm(n)),r||s)return n}return t||e.cssText}function tm(e){const t=/(\[(?:[\w-]+)[^\\])(:(?:[\w-]+)\])/gm;return e.replace(t,"$1\\$2")}function nm(e){return"styleSheet"in e}function rm(e){return"selectorText"in e}class sc{constructor(){Qi(this,"idNodeMap",new Map),Qi(this,"nodeMetaMap",new WeakMap)}getId(t){return t?this.getMeta(t)?.id??-1:-1}getNode(t){return this.idNodeMap.get(t)||null}getIds(){return Array.from(this.idNodeMap.keys())}getMeta(t){return this.nodeMetaMap.get(t)||null}removeNodeFromMap(t){const n=this.getId(t);this.idNodeMap.delete(n),t.childNodes&&t.childNodes.forEach(r=>this.removeNodeFromMap(r))}has(t){return this.idNodeMap.has(t)}hasNode(t){return this.nodeMetaMap.has(t)}add(t,n){const r=n.id;this.idNodeMap.set(r,t),this.nodeMetaMap.set(t,n)}replace(t,n){const r=this.getNode(t);if(r){const s=this.nodeMetaMap.get(r);s&&this.nodeMetaMap.set(n,s)}this.idNodeMap.set(t,n)}reset(){this.idNodeMap=new Map,this.nodeMetaMap=new WeakMap}}function sm(){return new sc}function dr({maskInputOptions:e,tagName:t,type:n}){return t==="OPTION"&&(t="SELECT"),!!(e[t.toLowerCase()]||n&&e[n]||n==="password"||t==="INPUT"&&!n&&e.text)}function zt({isMasked:e,element:t,value:n,maskInputFn:r}){let s=n||"";return e?(r&&(s=r(s,t)),"*".repeat(s.length)):s}function Et(e){return e.toLowerCase()}function Qr(e){return e.toUpperCase()}const Zi="__rrweb_original__";function im(e){const t=e.getContext("2d");if(!t)return!0;const n=50;for(let r=0;r<e.width;r+=n)for(let s=0;s<e.height;s+=n){const i=t.getImageData,o=Zi in i?i[Zi]:i;if(new Uint32Array(o.call(t,r,s,Math.min(n,e.width-r),Math.min(n,e.height-s)).data.buffer).some(a=>a!==0))return!1}return!0}function Bs(e){const t=e.type;return e.hasAttribute("data-rr-is-password")?"password":t?Et(t):null}function Vn(e,t,n){return t==="INPUT"&&(n==="radio"||n==="checkbox")?e.getAttribute("value")||"":e.value}function ic(e,t){let n;try{n=new URL(e,t??window.location.href)}catch{return null}const r=/\.([0-9a-z]+)(?:$)/i;return n.pathname.match(r)?.[1]??null}const eo={};function oc(e){const t=eo[e];if(t)return t;const n=window.document;let r=window[e];if(n&&typeof n.createElement=="function")try{const s=n.createElement("iframe");s.hidden=!0,n.head.appendChild(s);const i=s.contentWindow;i&&i[e]&&(r=i[e]),n.head.removeChild(s)}catch{}return eo[e]=r.bind(window)}function Zr(...e){return oc("setTimeout")(...e)}function ac(...e){return oc("clearTimeout")(...e)}function cc(e){try{return e.contentDocument}catch{}}let om=1;const am=new RegExp("[^a-z0-9-_:]"),qt=-2;function Us(){return om++}function cm(e){if(e instanceof HTMLFormElement)return"form";const t=Et(e.tagName);return am.test(t)?"div":t}function um(e){let t="";return e.indexOf("//")>-1?t=e.split("/").slice(0,3).join("/"):t=e.split("/")[0],t=t.split("?")[0],t}let lt,to;const lm=/url\((?:(')([^']*)'|(")(.*?)"|([^)]*))\)/gm,dm=/^(?:[a-z+]+:)?\/\//i,fm=/^www\..*/i,pm=/^(data:)([^,]*),(.*)/i;function hm(e,t){if(!e||t.size===0)return e;try{const n=e.split(";"),r=[];for(let s of n){if(s=s.trim(),!s)continue;const i=s.indexOf(":");if(i===-1){r.push(s);continue}const o=s.slice(0,i).trim();t.has(o)||r.push(s)}return r.join("; ")+(r.length>0&&e.endsWith(";")?";":"")}catch(n){return console.warn("Error filtering CSS properties:",n),e}}function Gn(e,t){return(e||"").replace(lm,(n,r,s,i,o,c)=>{const a=s||o||c,u=r||i||"";if(!a)return n;if(dm.test(a)||fm.test(a))return`url(${u}${a}${u})`;if(pm.test(a))return`url(${u}${a}${u})`;if(a[0]==="/")return`url(${u}${um(t)+a}${u})`;const d=t.split("/"),l=a.split("/");d.pop();for(const f of l)f!=="."&&(f===".."?d.pop():d.push(f));return`url(${u}${d.join("/")}${u})`})}const mm=/^[^ \t\n\r\u000c]+/,gm=/^[, \t\n\r\u000c]+/;function _m(e,t){if(t.trim()==="")return t;let n=0;function r(i){let o;const c=i.exec(t.substring(n));return c?(o=c[0],n+=o.length,o):""}const s=[];for(;r(gm),!(n>=t.length);){let i=r(mm);if(i.slice(-1)===",")i=pt(e,i.substring(0,i.length-1)),s.push(i);else{let o="";i=pt(e,i);let c=!1;for(;;){const a=t.charAt(n);if(a===""){s.push((i+o).trim());break}else if(c)a===")"&&(c=!1);else if(a===","){n+=1,s.push((i+o).trim());break}else a==="("&&(c=!0);o+=a,n+=1}}}return s.join(", ")}const no=new WeakMap;function pt(e,t){return!t||t.trim()===""?t:fr(e,t)}function Sm(e){return!!(e.tagName==="svg"||e.ownerSVGElement)}function fr(e,t){let n=no.get(e);if(n||(n=e.createElement("a"),no.set(e,n)),!t)t="";else if(t.startsWith("blob:")||t.startsWith("data:"))return t;return n.setAttribute("href",t),n.href}function uc(e,t,n,r,s,i,o){if(!r)return r;if(n==="src"||n==="href"&&!(t==="use"&&r[0]==="#"))return pt(e,r);if(n==="xlink:href"&&r[0]!=="#")return pt(e,r);if(n==="background"&&(t==="table"||t==="td"||t==="th"))return pt(e,r);if(n==="srcset")return _m(e,r);if(n==="style"){let c=Gn(r,fr(e));return o&&o.size>0&&(c=hm(c,o)),c}else if(t==="object"&&n==="data")return pt(e,r);return typeof i=="function"?i(n,r,s):r}function lc(e,t,n){return(e==="video"||e==="audio")&&t==="autoplay"}function ym(e,t,n,r){try{if(r&&e.matches(r))return!1;if(typeof t=="string"){if(e.classList.contains(t))return!0}else for(let s=e.classList.length;s--;){const i=e.classList[s];if(t.test(i))return!0}if(n)return e.matches(n)}catch{}return!1}function Em(e,t){for(let n=e.classList.length;n--;){const r=e.classList[n];if(t.test(r))return!0}return!1}function Ze(e,t,n=1/0,r=0){return!e||e.nodeType!==e.ELEMENT_NODE||r>n?-1:t(e)?r:Ze(e.parentNode,t,n,r+1)}function ht(e,t){return n=>{const r=n;if(r===null)return!1;try{if(e){if(typeof e=="string"){if(r.matches(`.${e}`))return!0}else if(Em(r,e))return!0}return!!(t&&r.matches(t))}catch{return!1}}}function bt(e,t,n,r,s,i){try{const o=e.nodeType===e.ELEMENT_NODE?e:e.parentElement;if(o===null)return!1;if(o.tagName==="INPUT"){const u=o.getAttribute("autocomplete");if(["current-password","new-password","cc-number","cc-exp","cc-exp-month","cc-exp-year","cc-csc"].includes(u))return!0}let c=-1,a=-1;if(i){if(a=Ze(o,ht(r,s)),a<0)return!0;c=Ze(o,ht(t,n),a>=0?a:1/0)}else{if(c=Ze(o,ht(t,n)),c<0)return!1;a=Ze(o,ht(r,s),c>=0?c:1/0)}return c>=0?a>=0?c<=a:!0:a>=0?!1:!!i}catch{}return!!i}function bm(e,t,n){const r=e.contentWindow;if(!r)return;let s=!1,i;try{i=r.document.readyState}catch{return}if(i!=="complete"){const c=Zr(()=>{s||(t(),s=!0)},n);e.addEventListener("load",()=>{ac(c),s=!0,t()});return}const o="about:blank";if(r.location.href!==o||e.src===o||e.src==="")return Zr(t,0),e.addEventListener("load",t);e.addEventListener("load",t)}function vm(e,t,n){let r=!1,s;try{s=e.sheet}catch{return}if(s)return;const i=Zr(()=>{r||(t(),r=!0)},n);e.addEventListener("load",()=>{ac(i),r=!0,t()})}function Tm(e,t){const{doc:n,mirror:r,blockClass:s,blockSelector:i,unblockSelector:o,maskAllText:c,maskAttributeFn:a,maskTextClass:u,unmaskTextClass:d,maskTextSelector:l,unmaskTextSelector:f,inlineStylesheet:p,maskInputOptions:h={},maskTextFn:g,maskInputFn:S,dataURLOptions:y={},inlineImages:T,recordCanvas:B,keepIframeSrcFn:N,newlyAddedElement:z=!1,ignoreCSSAttributes:A}=t,_=Im(n,r);switch(e.nodeType){case e.DOCUMENT_NODE:return e.compatMode!=="CSS1Compat"?{type:oe.Document,childNodes:[],compatMode:e.compatMode}:{type:oe.Document,childNodes:[]};case e.DOCUMENT_TYPE_NODE:return{type:oe.DocumentType,name:e.name,publicId:e.publicId,systemId:e.systemId,rootId:_};case e.ELEMENT_NODE:return km(e,{doc:n,blockClass:s,blockSelector:i,unblockSelector:o,inlineStylesheet:p,maskAttributeFn:a,maskInputOptions:h,maskInputFn:S,dataURLOptions:y,inlineImages:T,recordCanvas:B,keepIframeSrcFn:N,newlyAddedElement:z,rootId:_,maskTextClass:u,unmaskTextClass:d,maskTextSelector:l,unmaskTextSelector:f,ignoreCSSAttributes:A});case e.TEXT_NODE:return wm(e,{doc:n,maskAllText:c,maskTextClass:u,unmaskTextClass:d,maskTextSelector:l,unmaskTextSelector:f,maskTextFn:g,maskInputOptions:h,maskInputFn:S,rootId:_});case e.CDATA_SECTION_NODE:return{type:oe.CDATA,textContent:"",rootId:_};case e.COMMENT_NODE:return{type:oe.Comment,textContent:e.textContent||"",rootId:_};default:return!1}}function Im(e,t){if(!t.hasNode(e))return;const n=t.getId(e);return n===1?void 0:n}function wm(e,t){const{maskAllText:n,maskTextClass:r,unmaskTextClass:s,maskTextSelector:i,unmaskTextSelector:o,maskTextFn:c,maskInputOptions:a,maskInputFn:u,rootId:d}=t,l=e.parentNode&&e.parentNode.tagName;let f=e.textContent;const p=l==="STYLE"?!0:void 0,h=l==="SCRIPT"?!0:void 0,g=l==="TEXTAREA"?!0:void 0;if(p&&f){try{e.nextSibling||e.previousSibling||e.parentNode.sheet?.cssRules&&(f=jn(e.parentNode.sheet))}catch(y){console.warn(`Cannot get CSS styles from text's parentNode. Error: ${y}`,e)}f=Gn(f,fr(t.doc))}h&&(f="SCRIPT_PLACEHOLDER");const S=bt(e,r,i,s,o,n);if(!p&&!h&&!g&&f&&S&&(f=c?c(f,e.parentElement):f.replace(/[\S]/g,"*")),g&&f&&(a.textarea||S)&&(f=u?u(f,e.parentNode):f.replace(/[\S]/g,"*")),l==="OPTION"&&f){const y=dr({type:null,tagName:l,maskInputOptions:a});f=zt({isMasked:bt(e,r,i,s,o,y),element:e,value:f,maskInputFn:u})}return{type:oe.Text,textContent:f||"",isStyle:p,rootId:d}}function km(e,t){const{doc:n,blockClass:r,blockSelector:s,unblockSelector:i,inlineStylesheet:o,maskInputOptions:c={},maskAttributeFn:a,maskInputFn:u,dataURLOptions:d={},inlineImages:l,recordCanvas:f,keepIframeSrcFn:p,newlyAddedElement:h=!1,rootId:g,maskTextClass:S,unmaskTextClass:y,maskTextSelector:T,unmaskTextSelector:B,ignoreCSSAttributes:N}=t,z=ym(e,r,s,i),A=cm(e);let _={};const I=e.attributes.length;for(let E=0;E<I;E++){const k=e.attributes[E];k.name&&!lc(A,k.name,k.value)&&(_[k.name]=uc(n,A,Et(k.name),k.value,e,a,N))}if(A==="link"&&o){const E=Array.from(n.styleSheets).find(F=>F.href===e.href);let k=null;E&&(k=jn(E)),k&&(_.rel=null,_.href=null,_.crossorigin=null,_._cssText=Gn(k,E.href))}if(A==="style"&&e.sheet&&!(e.innerText||e.textContent||"").trim().length){const E=jn(e.sheet);E&&(_._cssText=Gn(E,fr(n)))}if(A==="input"||A==="textarea"||A==="select"||A==="option"){const E=e,k=Bs(E),F=Vn(E,Qr(A),k),q=E.checked;if(k!=="submit"&&k!=="button"&&F){const P=bt(E,S,T,y,B,dr({type:k,tagName:Qr(A),maskInputOptions:c}));_.value=zt({isMasked:P,element:E,value:F,maskInputFn:u})}q&&(_.checked=q)}if(A==="option"&&(e.selected&&!c.select?_.selected=!0:delete _.selected),A==="canvas"&&f){if(e.__context==="2d")im(e)||(_.rr_dataURL=e.toDataURL(d.type,d.quality));else if(!("__context"in e)){const E=e.toDataURL(d.type,d.quality),k=n.createElement("canvas");k.width=e.width,k.height=e.height;const F=k.toDataURL(d.type,d.quality);E!==F&&(_.rr_dataURL=E)}}if(A==="img"&&l){lt||(lt=n.createElement("canvas"),to=lt.getContext("2d"));const E=e,k=E.currentSrc||E.getAttribute("src")||"<unknown-src>",F=E.crossOrigin,q=()=>{E.removeEventListener("load",q);try{lt.width=E.naturalWidth,lt.height=E.naturalHeight,to.drawImage(E,0,0),_.rr_dataURL=lt.toDataURL(d.type,d.quality)}catch(P){if(E.crossOrigin!=="anonymous"){E.crossOrigin="anonymous",E.complete&&E.naturalWidth!==0?q():E.addEventListener("load",q);return}else console.warn(`Cannot inline img src=${k}! Error: ${P}`)}E.crossOrigin==="anonymous"&&(F?_.crossOrigin=F:E.removeAttribute("crossorigin"))};E.complete&&E.naturalWidth!==0?q():E.addEventListener("load",q)}if((A==="audio"||A==="video")&&(_.rr_mediaState=e.paused?"paused":"played",_.rr_mediaCurrentTime=e.currentTime),h||(e.scrollLeft&&(_.rr_scrollLeft=e.scrollLeft),e.scrollTop&&(_.rr_scrollTop=e.scrollTop)),z){const{width:E,height:k}=e.getBoundingClientRect();_={class:_.class,rr_width:`${E}px`,rr_height:`${k}px`}}A==="iframe"&&!p(_.src)&&(!z&&!cc(e)&&(_.rr_src=_.src),delete _.src);let Y;try{customElements.get(A)&&(Y=!0)}catch{}return{type:oe.Element,tagName:A,attributes:_,childNodes:[],isSVG:Sm(e)||void 0,needBlock:z,rootId:g,isCustom:Y}}function Q(e){return e==null?"":e.toLowerCase()}function Rm(e,t){if(t.comment&&e.type===oe.Comment)return!0;if(e.type===oe.Element){if(t.script&&(e.tagName==="script"||e.tagName==="link"&&(e.attributes.rel==="preload"||e.attributes.rel==="modulepreload")||e.tagName==="link"&&e.attributes.rel==="prefetch"&&typeof e.attributes.href=="string"&&ic(e.attributes.href)==="js"))return!0;if(t.headFavicon&&(e.tagName==="link"&&e.attributes.rel==="shortcut icon"||e.tagName==="meta"&&(Q(e.attributes.name).match(/^msapplication-tile(image|color)$/)||Q(e.attributes.name)==="application-name"||Q(e.attributes.rel)==="icon"||Q(e.attributes.rel)==="apple-touch-icon"||Q(e.attributes.rel)==="shortcut icon")))return!0;if(e.tagName==="meta"){if(t.headMetaDescKeywords&&Q(e.attributes.name).match(/^description|keywords$/))return!0;if(t.headMetaSocial&&(Q(e.attributes.property).match(/^(og|twitter|fb):/)||Q(e.attributes.name).match(/^(og|twitter):/)||Q(e.attributes.name)==="pinterest"))return!0;if(t.headMetaRobots&&(Q(e.attributes.name)==="robots"||Q(e.attributes.name)==="googlebot"||Q(e.attributes.name)==="bingbot"))return!0;if(t.headMetaHttpEquiv&&e.attributes["http-equiv"]!==void 0)return!0;if(t.headMetaAuthorship&&(Q(e.attributes.name)==="author"||Q(e.attributes.name)==="generator"||Q(e.attributes.name)==="framework"||Q(e.attributes.name)==="publisher"||Q(e.attributes.name)==="progid"||Q(e.attributes.property).match(/^article:/)||Q(e.attributes.property).match(/^product:/)))return!0;if(t.headMetaVerification&&(Q(e.attributes.name)==="google-site-verification"||Q(e.attributes.name)==="yandex-verification"||Q(e.attributes.name)==="csrf-token"||Q(e.attributes.name)==="p:domain_verify"||Q(e.attributes.name)==="verify-v1"||Q(e.attributes.name)==="verification"||Q(e.attributes.name)==="shopify-checkout-api-token"))return!0}}return!1}function mt(e,t){const{doc:n,mirror:r,blockClass:s,blockSelector:i,unblockSelector:o,maskAllText:c,maskTextClass:a,unmaskTextClass:u,maskTextSelector:d,unmaskTextSelector:l,skipChild:f=!1,inlineStylesheet:p=!0,maskInputOptions:h={},maskAttributeFn:g,maskTextFn:S,maskInputFn:y,slimDOMOptions:T,dataURLOptions:B={},inlineImages:N=!1,recordCanvas:z=!1,onSerialize:A,onIframeLoad:_,iframeLoadTimeout:I=5e3,onBlockedImageLoad:Y,onStylesheetLoad:E,stylesheetLoadTimeout:k=5e3,keepIframeSrcFn:F=()=>!1,newlyAddedElement:q=!1,ignoreCSSAttributes:P}=t;let{preserveWhiteSpace:ce=!0}=t;const J=Tm(e,{doc:n,mirror:r,blockClass:s,blockSelector:i,maskAllText:c,unblockSelector:o,maskTextClass:a,unmaskTextClass:u,maskTextSelector:d,unmaskTextSelector:l,inlineStylesheet:p,maskInputOptions:h,maskAttributeFn:g,maskTextFn:S,maskInputFn:y,dataURLOptions:B,inlineImages:N,recordCanvas:z,keepIframeSrcFn:F,newlyAddedElement:q,ignoreCSSAttributes:P});if(!J)return console.warn(e,"not serialized"),null;let ee;r.hasNode(e)?ee=r.getId(e):Rm(J,T)||!ce&&J.type===oe.Text&&!J.isStyle&&!J.textContent.replace(/^\s+|\s+$/gm,"").length?ee=qt:ee=Us();const b=Object.assign(J,{id:ee});if(r.add(e,b),ee===qt)return null;A&&A(e);let G=!f;if(b.type===oe.Element){G=G&&!b.needBlock;const w=e.shadowRoot;w&&Ft(w)&&(b.isShadowHost=!0)}if((b.type===oe.Document||b.type===oe.Element)&&G){T.headWhitespace&&b.type===oe.Element&&b.tagName==="head"&&(ce=!1);const w={doc:n,mirror:r,blockClass:s,blockSelector:i,maskAllText:c,unblockSelector:o,maskTextClass:a,unmaskTextClass:u,maskTextSelector:d,unmaskTextSelector:l,skipChild:f,inlineStylesheet:p,maskInputOptions:h,maskAttributeFn:g,maskTextFn:S,maskInputFn:y,slimDOMOptions:T,dataURLOptions:B,inlineImages:N,recordCanvas:z,preserveWhiteSpace:ce,onSerialize:A,onIframeLoad:_,iframeLoadTimeout:I,onBlockedImageLoad:Y,onStylesheetLoad:E,stylesheetLoadTimeout:k,keepIframeSrcFn:F,ignoreCSSAttributes:P},K=e.childNodes?Array.from(e.childNodes):[];for(const ne of K){const re=mt(ne,w);re&&b.childNodes.push(re)}if(Xh(e)&&e.shadowRoot)for(const ne of Array.from(e.shadowRoot.childNodes)){const re=mt(ne,w);re&&(Ft(e.shadowRoot)&&(re.isShadow=!0),b.childNodes.push(re))}}if(e.parentNode&&Dt(e.parentNode)&&Ft(e.parentNode)&&(b.isShadow=!0),b.type===oe.Element&&b.tagName==="iframe"&&!b.needBlock&&bm(e,()=>{const w=cc(e);if(w&&_){const K=mt(w,{doc:w,mirror:r,blockClass:s,blockSelector:i,unblockSelector:o,maskAllText:c,maskTextClass:a,unmaskTextClass:u,maskTextSelector:d,unmaskTextSelector:l,skipChild:!1,inlineStylesheet:p,maskInputOptions:h,maskAttributeFn:g,maskTextFn:S,maskInputFn:y,slimDOMOptions:T,dataURLOptions:B,inlineImages:N,recordCanvas:z,preserveWhiteSpace:ce,onSerialize:A,onIframeLoad:_,iframeLoadTimeout:I,onStylesheetLoad:E,stylesheetLoadTimeout:k,keepIframeSrcFn:F,ignoreCSSAttributes:P});K&&_(e,K)}},I),b.type===oe.Element&&b.tagName==="img"&&!e.complete&&b.needBlock){const w=e,K=()=>{if(w.isConnected&&!w.complete&&Y)try{const ne=w.getBoundingClientRect();ne.width>0&&ne.height>0&&Y(w,b,ne)}catch{}w.removeEventListener("load",K)};w.isConnected&&w.addEventListener("load",K)}return b.type===oe.Element&&b.tagName==="link"&&typeof b.attributes.rel=="string"&&(b.attributes.rel==="stylesheet"||b.attributes.rel==="preload"&&typeof b.attributes.href=="string"&&ic(b.attributes.href)==="css")&&vm(e,()=>{if(E){const w=mt(e,{doc:n,mirror:r,blockClass:s,blockSelector:i,unblockSelector:o,maskAllText:c,maskTextClass:a,unmaskTextClass:u,maskTextSelector:d,unmaskTextSelector:l,skipChild:!1,inlineStylesheet:p,maskInputOptions:h,maskAttributeFn:g,maskTextFn:S,maskInputFn:y,slimDOMOptions:T,dataURLOptions:B,inlineImages:N,recordCanvas:z,preserveWhiteSpace:ce,onSerialize:A,onIframeLoad:_,iframeLoadTimeout:I,onStylesheetLoad:E,stylesheetLoadTimeout:k,keepIframeSrcFn:F,ignoreCSSAttributes:P});w&&E(e,w)}},k),b.type===oe.Element&&delete b.needBlock,b}function Cm(e,t){const{mirror:n=new sc,blockClass:r="rr-block",blockSelector:s=null,unblockSelector:i=null,maskAllText:o=!1,maskTextClass:c="rr-mask",unmaskTextClass:a=null,maskTextSelector:u=null,unmaskTextSelector:d=null,inlineStylesheet:l=!0,inlineImages:f=!1,recordCanvas:p=!1,maskAllInputs:h=!1,maskAttributeFn:g,maskTextFn:S,maskInputFn:y,slimDOM:T=!1,dataURLOptions:B,preserveWhiteSpace:N,onSerialize:z,onIframeLoad:A,iframeLoadTimeout:_,onBlockedImageLoad:I,onStylesheetLoad:Y,stylesheetLoadTimeout:E,keepIframeSrcFn:k=()=>!1,ignoreCSSAttributes:F=new Set([])}=t||{};return mt(e,{doc:e,mirror:n,blockClass:r,blockSelector:s,unblockSelector:i,maskAllText:o,maskTextClass:c,unmaskTextClass:a,maskTextSelector:u,unmaskTextSelector:d,skipChild:!1,inlineStylesheet:l,maskInputOptions:h===!0?{color:!0,date:!0,"datetime-local":!0,email:!0,month:!0,number:!0,range:!0,search:!0,tel:!0,text:!0,time:!0,url:!0,week:!0,textarea:!0,select:!0}:h===!1?{}:h,maskAttributeFn:g,maskTextFn:S,maskInputFn:y,slimDOMOptions:T===!0||T==="all"?{script:!0,comment:!0,headFavicon:!0,headWhitespace:!0,headMetaDescKeywords:T==="all",headMetaSocial:!0,headMetaRobots:!0,headMetaHttpEquiv:!0,headMetaAuthorship:!0,headMetaVerification:!0}:T===!1?{}:T,dataURLOptions:B,inlineImages:f,recordCanvas:p,preserveWhiteSpace:N,onSerialize:z,onIframeLoad:A,iframeLoadTimeout:_,onBlockedImageLoad:I,onStylesheetLoad:Y,stylesheetLoadTimeout:E,keepIframeSrcFn:k,newlyAddedElement:!1,ignoreCSSAttributes:F})}function me(e,t,n=document){const r={capture:!0,passive:!0};return n.addEventListener(e,t,r),()=>n.removeEventListener(e,t,r)}const dt=`Please stop import mirror directly. Instead of that,\r
21
21
  now you can use replayer.getMirror() to access the mirror instance of a replayer,\r
22
- or you can use record.mirror to access the mirror instance during recording.`;let so={map:{},getId(){return console.error(ht),-1},getNode(){return console.error(ht),null},removeNodeFromMap(){console.error(ht)},has(){return console.error(ht),!1},reset(){console.error(ht)}};typeof window<"u"&&window.Proxy&&window.Reflect&&(so=new Proxy(so,{get(e,t,n){return t==="map"&&console.error(ht),Reflect.get(e,t,n)}}));function Yt(e,t,n={}){let r=null,s=0;return function(...i){const o=Date.now();!s&&n.leading===!1&&(s=o);const c=t-(o-s),a=this;c<=0||c>t?(r&&(Bm(r),r=null),s=o,e.apply(a,i)):!r&&n.trailing!==!1&&(r=pr(()=>{s=n.leading===!1?0:Date.now(),r=null,e.apply(a,i)},c))}}function hc(e,t,n,r,s=window){const i=s.Object.getOwnPropertyDescriptor(e,t);return s.Object.defineProperty(e,t,r?n:{set(o){pr(()=>{n.set.call(this,o)},0),i&&i.set&&i.set.call(this,o)}}),()=>hc(e,t,i||{},!0)}function $s(e,t,n){try{if(!(t in e))return()=>{};const r=e[t],s=n(r);return typeof s=="function"&&(s.prototype=s.prototype||{},Object.defineProperties(s,{__rrweb_original__:{enumerable:!1,value:r}})),e[t]=s,()=>{e[t]=r}}catch{return()=>{}}}let Jn=Date.now;/[1-9][0-9]{12}/.test(Date.now().toString())||(Jn=()=>new Date().getTime());function mc(e){var n,r,s,i,o,c;const t=e.document;return{left:t.scrollingElement?t.scrollingElement.scrollLeft:e.pageXOffset!==void 0?e.pageXOffset:(t==null?void 0:t.documentElement.scrollLeft)||((r=(n=t==null?void 0:t.body)==null?void 0:n.parentElement)==null?void 0:r.scrollLeft)||((s=t==null?void 0:t.body)==null?void 0:s.scrollLeft)||0,top:t.scrollingElement?t.scrollingElement.scrollTop:e.pageYOffset!==void 0?e.pageYOffset:(t==null?void 0:t.documentElement.scrollTop)||((o=(i=t==null?void 0:t.body)==null?void 0:i.parentElement)==null?void 0:o.scrollTop)||((c=t==null?void 0:t.body)==null?void 0:c.scrollTop)||0}}function gc(){return window.innerHeight||document.documentElement&&document.documentElement.clientHeight||document.body&&document.body.clientHeight}function _c(){return window.innerWidth||document.documentElement&&document.documentElement.clientWidth||document.body&&document.body.clientWidth}function Sc(e){if(!e)return null;try{return e.nodeType===e.ELEMENT_NODE?e:e.parentElement}catch{return null}}function Ee(e,t,n,r,s){if(!e)return!1;const i=Sc(e);if(!i)return!1;const o=St(t,n);if(!s){const u=r&&i.matches(r);return o(i)&&!u}const c=nt(i,o);let a=-1;return c<0?!1:(r&&(a=nt(i,St(null,r))),c>-1&&a<0?!0:c<a)}function Pm(e,t){return t.getId(e)!==-1}function Or(e,t){return t.getId(e)===Gt}function yc(e,t){if(Ht(e))return!1;const n=t.getId(e);return t.has(n)?e.parentNode&&e.parentNode.nodeType===e.DOCUMENT_NODE?!1:e.parentNode?yc(e.parentNode,t):!0:!0}function ts(e){return!!e.changedTouches}function Nm(e=window){"NodeList"in e&&!e.NodeList.prototype.forEach&&(e.NodeList.prototype.forEach=Array.prototype.forEach),"DOMTokenList"in e&&!e.DOMTokenList.prototype.forEach&&(e.DOMTokenList.prototype.forEach=Array.prototype.forEach),Node.prototype.contains||(Node.prototype.contains=(...t)=>{let n=t[0];if(!(0 in t))throw new TypeError("1 argument is required");do if(this===n)return!0;while(n=n&&n.parentNode);return!1})}function Ec(e,t){return!!(e.nodeName==="IFRAME"&&t.getMeta(e))}function bc(e,t){return!!(e.nodeName==="LINK"&&e.nodeType===e.ELEMENT_NODE&&e.getAttribute&&e.getAttribute("rel")==="stylesheet"&&t.getMeta(e))}function ns(e){return!!(e!=null&&e.shadowRoot)}class Om{constructor(){this.id=1,this.styleIDMap=new WeakMap,this.idStyleMap=new Map}getId(t){return this.styleIDMap.get(t)??-1}has(t){return this.styleIDMap.has(t)}add(t,n){if(this.has(t))return this.getId(t);let r;return n===void 0?r=this.id++:r=n,this.styleIDMap.set(t,r),this.idStyleMap.set(r,t),r}getStyle(t){return this.idStyleMap.get(t)||null}reset(){this.styleIDMap=new WeakMap,this.idStyleMap=new Map,this.id=1}generateId(){return this.id++}}function vc(e){var n,r;let t=null;return((r=(n=e.getRootNode)==null?void 0:n.call(e))==null?void 0:r.nodeType)===Node.DOCUMENT_FRAGMENT_NODE&&e.getRootNode().host&&(t=e.getRootNode().host),t}function Lm(e){let t=e,n;for(;n=vc(t);)t=n;return t}function Dm(e){const t=e.ownerDocument;if(!t)return!1;const n=Lm(e);return t.contains(n)}function Tc(e){const t=e.ownerDocument;return t?t.contains(e)||Dm(e):!1}const io={};function zs(e){const t=io[e];if(t)return t;const n=window.document;let r=window[e];if(n&&typeof n.createElement=="function")try{const s=n.createElement("iframe");s.hidden=!0,n.head.appendChild(s);const i=s.contentWindow;i&&i[e]&&(r=i[e]),n.head.removeChild(s)}catch{}return io[e]=r.bind(window)}function Fm(...e){return zs("requestAnimationFrame")(...e)}function pr(...e){return zs("setTimeout")(...e)}function Bm(...e){return zs("clearTimeout")(...e)}var D=(e=>(e[e.DomContentLoaded=0]="DomContentLoaded",e[e.Load=1]="Load",e[e.FullSnapshot=2]="FullSnapshot",e[e.IncrementalSnapshot=3]="IncrementalSnapshot",e[e.Meta=4]="Meta",e[e.Custom=5]="Custom",e[e.Plugin=6]="Plugin",e))(D||{}),P=(e=>(e[e.Mutation=0]="Mutation",e[e.MouseMove=1]="MouseMove",e[e.MouseInteraction=2]="MouseInteraction",e[e.Scroll=3]="Scroll",e[e.ViewportResize=4]="ViewportResize",e[e.Input=5]="Input",e[e.TouchMove=6]="TouchMove",e[e.MediaInteraction=7]="MediaInteraction",e[e.StyleSheetRule=8]="StyleSheetRule",e[e.CanvasMutation=9]="CanvasMutation",e[e.Font=10]="Font",e[e.Log=11]="Log",e[e.Drag=12]="Drag",e[e.StyleDeclaration=13]="StyleDeclaration",e[e.Selection=14]="Selection",e[e.AdoptedStyleSheet=15]="AdoptedStyleSheet",e[e.CustomElement=16]="CustomElement",e))(P||{}),pe=(e=>(e[e.MouseUp=0]="MouseUp",e[e.MouseDown=1]="MouseDown",e[e.Click=2]="Click",e[e.ContextMenu=3]="ContextMenu",e[e.DblClick=4]="DblClick",e[e.Focus=5]="Focus",e[e.Blur=6]="Blur",e[e.TouchStart=7]="TouchStart",e[e.TouchMove_Departed=8]="TouchMove_Departed",e[e.TouchEnd=9]="TouchEnd",e[e.TouchCancel=10]="TouchCancel",e))(pe||{}),De=(e=>(e[e.Mouse=0]="Mouse",e[e.Pen=1]="Pen",e[e.Touch=2]="Touch",e))(De||{}),mt=(e=>(e[e.Play=0]="Play",e[e.Pause=1]="Pause",e[e.Seeked=2]="Seeked",e[e.VolumeChange=3]="VolumeChange",e[e.RateChange=4]="RateChange",e))(mt||{});function Ws(e){try{return e.contentDocument}catch{}}function Hm(e){try{return e.contentWindow}catch{}}function oo(e){return"__ln"in e}class Um{constructor(){this.length=0,this.head=null,this.tail=null}get(t){if(t>=this.length)throw new Error("Position outside of list range");let n=this.head;for(let r=0;r<t;r++)n=(n==null?void 0:n.next)||null;return n}addNode(t){const n={value:t,previous:null,next:null};if(t.__ln=n,t.previousSibling&&oo(t.previousSibling)){const r=t.previousSibling.__ln.next;n.next=r,n.previous=t.previousSibling.__ln,t.previousSibling.__ln.next=n,r&&(r.previous=n)}else if(t.nextSibling&&oo(t.nextSibling)&&t.nextSibling.__ln.previous){const r=t.nextSibling.__ln.previous;n.previous=r,n.next=t.nextSibling.__ln,t.nextSibling.__ln.previous=n,r&&(r.next=n)}else this.head&&(this.head.previous=n),n.next=this.head,this.head=n;n.next===null&&(this.tail=n),this.length++}removeNode(t){const n=t.__ln;this.head&&(n.previous?(n.previous.next=n.next,n.next?n.next.previous=n.previous:this.tail=n.previous):(this.head=n.next,this.head?this.head.previous=null:this.tail=null),t.__ln&&delete t.__ln,this.length--)}}const ao=(e,t)=>`${e}@${t}`;class $m{constructor(){this.frozen=!1,this.locked=!1,this.texts=[],this.attributes=[],this.attributeMap=new WeakMap,this.removes=[],this.mapRemoves=[],this.movedMap={},this.addedSet=new Set,this.movedSet=new Set,this.droppedSet=new Set,this.processMutations=t=>{t.forEach(this.processMutation),this.emit()},this.emit=()=>{if(this.frozen||this.locked)return;const t=[],n=new Set,r=new Um,s=a=>{let u=a,d=Gt;for(;d===Gt;)u=u&&u.nextSibling,d=u&&this.mirror.getId(u);return d},i=a=>{if(!a.parentNode||!Tc(a))return;const u=Ht(a.parentNode)?this.mirror.getId(vc(a)):this.mirror.getId(a.parentNode),d=s(a);if(u===-1||d===-1)return r.addNode(a);const l=yt(a,{doc:this.doc,mirror:this.mirror,blockClass:this.blockClass,blockSelector:this.blockSelector,maskAllText:this.maskAllText,unblockSelector:this.unblockSelector,maskTextClass:this.maskTextClass,unmaskTextClass:this.unmaskTextClass,maskTextSelector:this.maskTextSelector,unmaskTextSelector:this.unmaskTextSelector,skipChild:!0,newlyAddedElement:!0,inlineStylesheet:this.inlineStylesheet,maskInputOptions:this.maskInputOptions,maskAttributeFn:this.maskAttributeFn,maskTextFn:this.maskTextFn,maskInputFn:this.maskInputFn,slimDOMOptions:this.slimDOMOptions,dataURLOptions:this.dataURLOptions,recordCanvas:this.recordCanvas,inlineImages:this.inlineImages,onSerialize:f=>{Ec(f,this.mirror)&&!Ee(f,this.blockClass,this.blockSelector,this.unblockSelector,!1)&&this.iframeManager.addIframe(f),bc(f,this.mirror)&&this.stylesheetManager.trackLinkElement(f),ns(a)&&this.shadowDomManager.addShadowRoot(a.shadowRoot,this.doc)},onIframeLoad:(f,p)=>{Ee(f,this.blockClass,this.blockSelector,this.unblockSelector,!1)||(this.iframeManager.attachIframe(f,p),f.contentWindow&&this.canvasManager.addWindow(f.contentWindow),this.shadowDomManager.observeAttachShadow(f))},onStylesheetLoad:(f,p)=>{this.stylesheetManager.attachLinkElement(f,p)},onBlockedImageLoad:(f,p,{width:h,height:g})=>{this.mutationCb({adds:[],removes:[],texts:[],attributes:[{id:p.id,attributes:{style:{width:`${h}px`,height:`${g}px`}}}]})},ignoreCSSAttributes:this.ignoreCSSAttributes});l&&(t.push({parentId:u,nextId:d,node:l}),n.add(l.id))};for(;this.mapRemoves.length;)this.mirror.removeNodeFromMap(this.mapRemoves.shift());for(const a of this.movedSet)co(this.removes,a,this.mirror)&&!this.movedSet.has(a.parentNode)||i(a);for(const a of this.addedSet)!uo(this.droppedSet,a)&&!co(this.removes,a,this.mirror)||uo(this.movedSet,a)?i(a):this.droppedSet.add(a);let o=null;for(;r.length;){let a=null;if(o){const u=this.mirror.getId(o.value.parentNode),d=s(o.value);u!==-1&&d!==-1&&(a=o)}if(!a){let u=r.tail;for(;u;){const d=u;if(u=u.previous,d){const l=this.mirror.getId(d.value.parentNode);if(s(d.value)===-1)continue;if(l!==-1){a=d;break}else{const p=d.value;if(p.parentNode&&p.parentNode.nodeType===Node.DOCUMENT_FRAGMENT_NODE){const h=p.parentNode.host;if(this.mirror.getId(h)!==-1){a=d;break}}}}}}if(!a){for(;r.head;)r.removeNode(r.head.value);break}o=a.previous,r.removeNode(a.value),i(a.value)}const c={texts:this.texts.map(a=>({id:this.mirror.getId(a.node),value:a.value})).filter(a=>!n.has(a.id)).filter(a=>this.mirror.has(a.id)),attributes:this.attributes.map(a=>{const{attributes:u}=a;if(typeof u.style=="string"){const d=JSON.stringify(a.styleDiff),l=JSON.stringify(a._unchangedStyles);d.length<u.style.length&&(d+l).split("var(").length===u.style.split("var(").length&&(u.style=a.styleDiff)}return{id:this.mirror.getId(a.node),attributes:u}}).filter(a=>!n.has(a.id)).filter(a=>this.mirror.has(a.id)),removes:this.removes,adds:t};!c.texts.length&&!c.attributes.length&&!c.removes.length&&!c.adds.length||(this.texts=[],this.attributes=[],this.attributeMap=new WeakMap,this.removes=[],this.addedSet=new Set,this.movedSet=new Set,this.droppedSet=new Set,this.movedMap={},this.mutationCb(c))},this.processMutation=t=>{if(!Or(t.target,this.mirror))switch(t.type){case"characterData":{const n=t.target.textContent;!Ee(t.target,this.blockClass,this.blockSelector,this.unblockSelector,!1)&&n!==t.oldValue&&this.texts.push({value:wt(t.target,this.maskTextClass,this.maskTextSelector,this.unmaskTextClass,this.unmaskTextSelector,this.maskAllText)&&n?this.maskTextFn?this.maskTextFn(n,Sc(t.target)):n.replace(/[\S]/g,"*"):n,node:t.target});break}case"attributes":{const n=t.target;let r=t.attributeName,s=t.target.getAttribute(r);if(r==="value"){const o=Hs(n),c=n.tagName;s=Gn(n,c,o);const a=dr({maskInputOptions:this.maskInputOptions,tagName:c,type:o}),u=wt(t.target,this.maskTextClass,this.maskTextSelector,this.unmaskTextClass,this.unmaskTextSelector,a);s=Vt({isMasked:u,element:n,value:s,maskInputFn:this.maskInputFn})}if(Ee(t.target,this.blockClass,this.blockSelector,this.unblockSelector,!1)||s===t.oldValue)return;let i=this.attributeMap.get(t.target);if(n.tagName==="IFRAME"&&r==="src"&&!this.keepIframeSrcFn(s))if(!Ws(n))r="rr_src";else return;if(i||(i={node:t.target,attributes:{},styleDiff:{},_unchangedStyles:{}},this.attributes.push(i),this.attributeMap.set(t.target,i)),r==="type"&&n.tagName==="INPUT"&&(t.oldValue||"").toLowerCase()==="password"&&n.setAttribute("data-rr-is-password","true"),!pc(n.tagName,r)&&(i.attributes[r]=fc(this.doc,It(n.tagName),It(r),s,n,this.maskAttributeFn),r==="style")){if(!this.unattachedDoc)try{this.unattachedDoc=document.implementation.createHTMLDocument()}catch{this.unattachedDoc=this.doc}const o=this.unattachedDoc.createElement("span");t.oldValue&&o.setAttribute("style",t.oldValue);for(const c of Array.from(n.style)){const a=n.style.getPropertyValue(c),u=n.style.getPropertyPriority(c);a!==o.style.getPropertyValue(c)||u!==o.style.getPropertyPriority(c)?u===""?i.styleDiff[c]=a:i.styleDiff[c]=[a,u]:i._unchangedStyles[c]=[a,u]}for(const c of Array.from(o.style))n.style.getPropertyValue(c)===""&&(i.styleDiff[c]=!1)}break}case"childList":{if(Ee(t.target,this.blockClass,this.blockSelector,this.unblockSelector,!0))return;t.addedNodes.forEach(n=>this.genAdds(n,t.target)),t.removedNodes.forEach(n=>{const r=this.mirror.getId(n),s=Ht(t.target)?this.mirror.getId(t.target.host):this.mirror.getId(t.target);Ee(t.target,this.blockClass,this.blockSelector,this.unblockSelector,!1)||Or(n,this.mirror)||!Pm(n,this.mirror)||(this.addedSet.has(n)?(rs(this.addedSet,n),this.droppedSet.add(n)):this.addedSet.has(t.target)&&r===-1||yc(t.target,this.mirror)||(this.movedSet.has(n)&&this.movedMap[ao(r,s)]?rs(this.movedSet,n):this.removes.push({parentId:s,id:r,isShadow:Ht(t.target)&&Ut(t.target)?!0:void 0})),this.mapRemoves.push(n))});break}}},this.genAdds=(t,n)=>{if(!this.processedNodeManager.inOtherBuffer(t,this)&&!(this.addedSet.has(t)||this.movedSet.has(t))){if(this.mirror.hasNode(t)){if(Or(t,this.mirror))return;this.movedSet.add(t);let r=null;n&&this.mirror.hasNode(n)&&(r=this.mirror.getId(n)),r&&r!==-1&&(this.movedMap[ao(this.mirror.getId(t),r)]=!0)}else this.addedSet.add(t),this.droppedSet.delete(t);Ee(t,this.blockClass,this.blockSelector,this.unblockSelector,!1)||(t.childNodes&&t.childNodes.forEach(r=>this.genAdds(r)),ns(t)&&t.shadowRoot.childNodes.forEach(r=>{this.processedNodeManager.add(r,this),this.genAdds(r,t)}))}}}init(t){["mutationCb","blockClass","blockSelector","unblockSelector","maskAllText","maskTextClass","unmaskTextClass","maskTextSelector","unmaskTextSelector","inlineStylesheet","maskInputOptions","maskAttributeFn","maskTextFn","maskInputFn","keepIframeSrcFn","recordCanvas","inlineImages","slimDOMOptions","dataURLOptions","doc","mirror","iframeManager","stylesheetManager","shadowDomManager","canvasManager","processedNodeManager","ignoreCSSAttributes"].forEach(n=>{this[n]=t[n]})}freeze(){this.frozen=!0,this.canvasManager.freeze()}unfreeze(){this.frozen=!1,this.canvasManager.unfreeze(),this.emit()}isFrozen(){return this.frozen}lock(){this.locked=!0,this.canvasManager.lock()}unlock(){this.locked=!1,this.canvasManager.unlock(),this.emit()}reset(){this.shadowDomManager.reset(),this.canvasManager.reset()}}function rs(e,t){var n;e.delete(t),(n=t.childNodes)==null||n.forEach(r=>rs(e,r))}function co(e,t,n){return e.length===0?!1:zm(e,t,n)}function zm(e,t,n){let r=t.parentNode;for(;r;){const s=n.getId(r);if(e.some(i=>i.id===s))return!0;r=r.parentNode}return!1}function uo(e,t){return e.size===0?!1:Ic(e,t)}function Ic(e,t){const{parentNode:n}=t;return n?e.has(n)?!0:Ic(e,n):!1}let $t;function Wm(e){$t=e}function qm(){$t=void 0}const W=e=>$t?(...n)=>{try{return e(...n)}catch(r){if($t&&$t(r)===!0)return()=>{};throw r}}:e,Et=[];function un(e){try{if("composedPath"in e){const t=e.composedPath();if(t.length)return t[0]}else if("path"in e&&e.path.length)return e.path[0]}catch{}return e&&e.target}function wc(e,t){var o,c;const n=new $m;Et.push(n),n.init(e);let r=window.MutationObserver||window.__rrMutationObserver;const s=(c=(o=window==null?void 0:window.Zone)==null?void 0:o.__symbol__)==null?void 0:c.call(o,"MutationObserver");s&&window[s]&&(r=window[s]);const i=new r(W(a=>{e.onMutation&&e.onMutation(a)===!1||n.processMutations.bind(n)(a)}));return i.observe(t,{attributes:!0,attributeOldValue:!0,characterData:!0,characterDataOldValue:!0,childList:!0,subtree:!0}),i}function jm({mousemoveCb:e,sampling:t,doc:n,mirror:r}){if(t.mousemove===!1)return()=>{};const s=typeof t.mousemove=="number"?t.mousemove:50,i=typeof t.mousemoveCallback=="number"?t.mousemoveCallback:500;let o=[],c;const a=Yt(W(l=>{const f=Date.now()-c;e(o.map(p=>(p.timeOffset-=f,p)),l),o=[],c=null}),i),u=W(Yt(W(l=>{const f=un(l),{clientX:p,clientY:h}=ts(l)?l.changedTouches[0]:l;c||(c=Jn()),o.push({x:p,y:h,id:r.getId(f),timeOffset:Jn()-c}),a(typeof DragEvent<"u"&&l instanceof DragEvent?P.Drag:l instanceof MouseEvent?P.MouseMove:P.TouchMove)}),s,{trailing:!1})),d=[he("mousemove",u,n),he("touchmove",u,n),he("drag",u,n)];return W(()=>{d.forEach(l=>l())})}function Vm({mouseInteractionCb:e,doc:t,mirror:n,blockClass:r,blockSelector:s,unblockSelector:i,sampling:o}){if(o.mouseInteraction===!1)return()=>{};const c=o.mouseInteraction===!0||o.mouseInteraction===void 0?{}:o.mouseInteraction,a=[];let u=null;const d=l=>f=>{const p=un(f);if(Ee(p,r,s,i,!0))return;let h=null,g=l;if("pointerType"in f){switch(f.pointerType){case"mouse":h=De.Mouse;break;case"touch":h=De.Touch;break;case"pen":h=De.Pen;break}h===De.Touch?pe[l]===pe.MouseDown?g="TouchStart":pe[l]===pe.MouseUp&&(g="TouchEnd"):De.Pen}else ts(f)&&(h=De.Touch);h!==null?(u=h,(g.startsWith("Touch")&&h===De.Touch||g.startsWith("Mouse")&&h===De.Mouse)&&(h=null)):pe[l]===pe.Click&&(h=u,u=null);const _=ts(f)?f.changedTouches[0]:f;if(!_)return;const y=n.getId(p),{clientX:T,clientY:O}=_;W(e)({type:pe[g],id:y,x:T,y:O,...h!==null&&{pointerType:h}})};return Object.keys(pe).filter(l=>Number.isNaN(Number(l))&&!l.endsWith("_Departed")&&c[l]!==!1).forEach(l=>{let f=It(l);const p=d(l);if(window.PointerEvent)switch(pe[l]){case pe.MouseDown:case pe.MouseUp:f=f.replace("mouse","pointer");break;case pe.TouchStart:case pe.TouchEnd:return}a.push(he(f,p,t))}),W(()=>{a.forEach(l=>l())})}function kc({scrollCb:e,doc:t,mirror:n,blockClass:r,blockSelector:s,unblockSelector:i,sampling:o}){const c=W(Yt(W(a=>{const u=un(a);if(!u||Ee(u,r,s,i,!0))return;const d=n.getId(u);if(u===t&&t.defaultView){const l=mc(t.defaultView);e({id:d,x:l.left,y:l.top})}else e({id:d,x:u.scrollLeft,y:u.scrollTop})}),o.scroll||100));return he("scroll",c,t)}function Gm({viewportResizeCb:e},{win:t}){let n=-1,r=-1;const s=W(Yt(W(()=>{const i=gc(),o=_c();(n!==i||r!==o)&&(e({width:Number(o),height:Number(i)}),n=i,r=o)}),200));return he("resize",s,t)}const Ym=["INPUT","TEXTAREA","SELECT"],lo=new WeakMap;function Jm({inputCb:e,doc:t,mirror:n,blockClass:r,blockSelector:s,unblockSelector:i,ignoreClass:o,ignoreSelector:c,maskInputOptions:a,maskInputFn:u,sampling:d,userTriggeredOnInput:l,maskTextClass:f,unmaskTextClass:p,maskTextSelector:h,unmaskTextSelector:g}){function _(S){let I=un(S);const J=S.isTrusted,E=I&&Zr(I.tagName);if(E==="OPTION"&&(I=I.parentElement),!I||!E||Ym.indexOf(E)<0||Ee(I,r,s,i,!0))return;const w=I;if(w.classList.contains(o)||c&&w.matches(c))return;const B=Hs(I);let H=Gn(w,E,B),N=!1;const oe=dr({maskInputOptions:a,tagName:E,type:B}),K=wt(I,f,h,p,g,oe);(B==="radio"||B==="checkbox")&&(N=I.checked),H=Vt({isMasked:K,element:I,value:H,maskInputFn:u}),y(I,l?{text:H,isChecked:N,userTriggered:J}:{text:H,isChecked:N});const X=I.name;B==="radio"&&X&&N&&t.querySelectorAll(`input[type="radio"][name="${X}"]`).forEach(b=>{if(b!==I){const j=Vt({isMasked:K,element:b,value:Gn(b,E,B),maskInputFn:u});y(b,l?{text:j,isChecked:!N,userTriggered:!1}:{text:j,isChecked:!N})}})}function y(S,I){const J=lo.get(S);if(!J||J.text!==I.text||J.isChecked!==I.isChecked){lo.set(S,I);const E=n.getId(S);W(e)({...I,id:E})}}const O=(d.input==="last"?["change"]:["input","change"]).map(S=>he(S,W(_),t)),L=t.defaultView;if(!L)return()=>{O.forEach(S=>S())};const q=L.Object.getOwnPropertyDescriptor(L.HTMLInputElement.prototype,"value"),x=[[L.HTMLInputElement.prototype,"value"],[L.HTMLInputElement.prototype,"checked"],[L.HTMLSelectElement.prototype,"value"],[L.HTMLTextAreaElement.prototype,"value"],[L.HTMLSelectElement.prototype,"selectedIndex"],[L.HTMLOptionElement.prototype,"selected"]];return q&&q.set&&O.push(...x.map(S=>hc(S[0],S[1],{set(){W(_)({target:this,isTrusted:!1})}},!1,L))),W(()=>{O.forEach(S=>S())})}function Kn(e){const t=[];function n(r,s){if(yn("CSSGroupingRule")&&r.parentRule instanceof CSSGroupingRule||yn("CSSMediaRule")&&r.parentRule instanceof CSSMediaRule||yn("CSSSupportsRule")&&r.parentRule instanceof CSSSupportsRule||yn("CSSConditionRule")&&r.parentRule instanceof CSSConditionRule){const o=Array.from(r.parentRule.cssRules).indexOf(r);s.unshift(o)}else if(r.parentStyleSheet){const o=Array.from(r.parentStyleSheet.cssRules).indexOf(r);s.unshift(o)}return s}return n(e,t)}function ze(e,t,n){let r,s;return e?(e.ownerNode?r=t.getId(e.ownerNode):s=n.getId(e),{styleId:s,id:r}):{}}function Km({styleSheetRuleCb:e,mirror:t,stylesheetManager:n},{win:r}){if(!r.CSSStyleSheet||!r.CSSStyleSheet.prototype)return()=>{};const s=r.CSSStyleSheet.prototype.insertRule;r.CSSStyleSheet.prototype.insertRule=new Proxy(s,{apply:W((d,l,f)=>{const[p,h]=f,{id:g,styleId:_}=ze(l,t,n.styleMirror);return(g&&g!==-1||_&&_!==-1)&&e({id:g,styleId:_,adds:[{rule:p,index:h}]}),d.apply(l,f)})});const i=r.CSSStyleSheet.prototype.deleteRule;r.CSSStyleSheet.prototype.deleteRule=new Proxy(i,{apply:W((d,l,f)=>{const[p]=f,{id:h,styleId:g}=ze(l,t,n.styleMirror);return(h&&h!==-1||g&&g!==-1)&&e({id:h,styleId:g,removes:[{index:p}]}),d.apply(l,f)})});let o;r.CSSStyleSheet.prototype.replace&&(o=r.CSSStyleSheet.prototype.replace,r.CSSStyleSheet.prototype.replace=new Proxy(o,{apply:W((d,l,f)=>{const[p]=f,{id:h,styleId:g}=ze(l,t,n.styleMirror);return(h&&h!==-1||g&&g!==-1)&&e({id:h,styleId:g,replace:p}),d.apply(l,f)})}));let c;r.CSSStyleSheet.prototype.replaceSync&&(c=r.CSSStyleSheet.prototype.replaceSync,r.CSSStyleSheet.prototype.replaceSync=new Proxy(c,{apply:W((d,l,f)=>{const[p]=f,{id:h,styleId:g}=ze(l,t,n.styleMirror);return(h&&h!==-1||g&&g!==-1)&&e({id:h,styleId:g,replaceSync:p}),d.apply(l,f)})}));const a={};En("CSSGroupingRule")?a.CSSGroupingRule=r.CSSGroupingRule:(En("CSSMediaRule")&&(a.CSSMediaRule=r.CSSMediaRule),En("CSSConditionRule")&&(a.CSSConditionRule=r.CSSConditionRule),En("CSSSupportsRule")&&(a.CSSSupportsRule=r.CSSSupportsRule));const u={};return Object.entries(a).forEach(([d,l])=>{u[d]={insertRule:l.prototype.insertRule,deleteRule:l.prototype.deleteRule},l.prototype.insertRule=new Proxy(u[d].insertRule,{apply:W((f,p,h)=>{const[g,_]=h,{id:y,styleId:T}=ze(p.parentStyleSheet,t,n.styleMirror);return(y&&y!==-1||T&&T!==-1)&&e({id:y,styleId:T,adds:[{rule:g,index:[...Kn(p),_||0]}]}),f.apply(p,h)})}),l.prototype.deleteRule=new Proxy(u[d].deleteRule,{apply:W((f,p,h)=>{const[g]=h,{id:_,styleId:y}=ze(p.parentStyleSheet,t,n.styleMirror);return(_&&_!==-1||y&&y!==-1)&&e({id:_,styleId:y,removes:[{index:[...Kn(p),g]}]}),f.apply(p,h)})})}),W(()=>{r.CSSStyleSheet.prototype.insertRule=s,r.CSSStyleSheet.prototype.deleteRule=i,o&&(r.CSSStyleSheet.prototype.replace=o),c&&(r.CSSStyleSheet.prototype.replaceSync=c),Object.entries(a).forEach(([d,l])=>{l.prototype.insertRule=u[d].insertRule,l.prototype.deleteRule=u[d].deleteRule})})}function Rc({mirror:e,stylesheetManager:t},n){var o,c,a;let r=null;n.nodeName==="#document"?r=e.getId(n):r=e.getId(n.host);const s=n.nodeName==="#document"?(o=n.defaultView)==null?void 0:o.Document:(a=(c=n.ownerDocument)==null?void 0:c.defaultView)==null?void 0:a.ShadowRoot,i=s!=null&&s.prototype?Object.getOwnPropertyDescriptor(s==null?void 0:s.prototype,"adoptedStyleSheets"):void 0;return r===null||r===-1||!s||!i?()=>{}:(Object.defineProperty(n,"adoptedStyleSheets",{configurable:i.configurable,enumerable:i.enumerable,get(){var u;return(u=i.get)==null?void 0:u.call(this)},set(u){var l;const d=(l=i.set)==null?void 0:l.call(this,u);if(r!==null&&r!==-1)try{t.adoptStyleSheets(u,r)}catch{}return d}}),W(()=>{Object.defineProperty(n,"adoptedStyleSheets",{configurable:i.configurable,enumerable:i.enumerable,get:i.get,set:i.set})}))}function Xm({styleDeclarationCb:e,mirror:t,ignoreCSSAttributes:n,stylesheetManager:r},{win:s}){const i=s.CSSStyleDeclaration.prototype.setProperty;s.CSSStyleDeclaration.prototype.setProperty=new Proxy(i,{apply:W((c,a,u)=>{var g;const[d,l,f]=u;if(n.has(d))return i.apply(a,[d,l,f]);const{id:p,styleId:h}=ze((g=a.parentRule)==null?void 0:g.parentStyleSheet,t,r.styleMirror);return(p&&p!==-1||h&&h!==-1)&&e({id:p,styleId:h,set:{property:d,value:l,priority:f},index:Kn(a.parentRule)}),c.apply(a,u)})});const o=s.CSSStyleDeclaration.prototype.removeProperty;return s.CSSStyleDeclaration.prototype.removeProperty=new Proxy(o,{apply:W((c,a,u)=>{var p;const[d]=u;if(n.has(d))return o.apply(a,[d]);const{id:l,styleId:f}=ze((p=a.parentRule)==null?void 0:p.parentStyleSheet,t,r.styleMirror);return(l&&l!==-1||f&&f!==-1)&&e({id:l,styleId:f,remove:{property:d},index:Kn(a.parentRule)}),c.apply(a,u)})}),W(()=>{s.CSSStyleDeclaration.prototype.setProperty=i,s.CSSStyleDeclaration.prototype.removeProperty=o})}function Qm({mediaInteractionCb:e,blockClass:t,blockSelector:n,unblockSelector:r,mirror:s,sampling:i,doc:o}){const c=W(u=>Yt(W(d=>{const l=un(d);if(!l||Ee(l,t,n,r,!0))return;const{currentTime:f,volume:p,muted:h,playbackRate:g}=l;e({type:u,id:s.getId(l),currentTime:f,volume:p,muted:h,playbackRate:g})}),i.media||500)),a=[he("play",c(mt.Play),o),he("pause",c(mt.Pause),o),he("seeked",c(mt.Seeked),o),he("volumechange",c(mt.VolumeChange),o),he("ratechange",c(mt.RateChange),o)];return W(()=>{a.forEach(u=>u())})}function Zm({fontCb:e,doc:t}){const n=t.defaultView;if(!n)return()=>{};const r=[],s=new WeakMap,i=n.FontFace;n.FontFace=function(a,u,d){const l=new i(a,u,d);return s.set(l,{family:a,buffer:typeof u!="string",descriptors:d,fontSource:typeof u=="string"?u:JSON.stringify(Array.from(new Uint8Array(u)))}),l};const o=$s(t.fonts,"add",function(c){return function(a){return pr(W(()=>{const u=s.get(a);u&&(e(u),s.delete(a))}),0),c.apply(this,[a])}});return r.push(()=>{n.FontFace=i}),r.push(o),W(()=>{r.forEach(c=>c())})}function eg(e){const{doc:t,mirror:n,blockClass:r,blockSelector:s,unblockSelector:i,selectionCb:o}=e;let c=!0;const a=W(()=>{const u=t.getSelection();if(!u||c&&(u!=null&&u.isCollapsed))return;c=u.isCollapsed||!1;const d=[],l=u.rangeCount||0;for(let f=0;f<l;f++){const p=u.getRangeAt(f),{startContainer:h,startOffset:g,endContainer:_,endOffset:y}=p;Ee(h,r,s,i,!0)||Ee(_,r,s,i,!0)||d.push({start:n.getId(h),startOffset:g,end:n.getId(_),endOffset:y})}o({ranges:d})});return a(),he("selectionchange",a)}function tg({doc:e,customElementCb:t}){const n=e.defaultView;return!n||!n.customElements?()=>{}:$s(n.customElements,"define",function(s){return function(i,o,c){try{t({define:{name:i}})}catch{}return s.apply(this,[i,o,c])}})}function ng(e,t={}){const n=e.doc.defaultView;if(!n)return()=>{};let r;e.recordDOM&&(r=wc(e,e.doc));const s=jm(e),i=Vm(e),o=kc(e),c=Gm(e,{win:n}),a=Jm(e),u=Qm(e);let d=()=>{},l=()=>{},f=()=>{},p=()=>{};e.recordDOM&&(d=Km(e,{win:n}),l=Rc(e,e.doc),f=Xm(e,{win:n}),e.collectFonts&&(p=Zm(e)));const h=eg(e),g=tg(e),_=[];for(const y of e.plugins)_.push(y.observer(y.callback,n,y.options));return W(()=>{Et.forEach(y=>y.reset()),r==null||r.disconnect(),s(),i(),o(),c(),a(),u(),d(),l(),f(),p(),h(),g(),_.forEach(y=>y())})}function yn(e){return typeof window[e]<"u"}function En(e){return!!(typeof window[e]<"u"&&window[e].prototype&&"insertRule"in window[e].prototype&&"deleteRule"in window[e].prototype)}class ss{constructor(t){this.generateIdFn=t,this.iframeIdToRemoteIdMap=new WeakMap,this.iframeRemoteIdToIdMap=new WeakMap}getId(t,n,r,s){const i=r||this.getIdToRemoteIdMap(t),o=s||this.getRemoteIdToIdMap(t);let c=i.get(n);return c||(c=this.generateIdFn(),i.set(n,c),o.set(c,n)),c}getIds(t,n){const r=this.getIdToRemoteIdMap(t),s=this.getRemoteIdToIdMap(t);return n.map(i=>this.getId(t,i,r,s))}getRemoteId(t,n,r){const s=r||this.getRemoteIdToIdMap(t);if(typeof n!="number")return n;const i=s.get(n);return i||-1}getRemoteIds(t,n){const r=this.getRemoteIdToIdMap(t);return n.map(s=>this.getRemoteId(t,s,r))}reset(t){if(!t){this.iframeIdToRemoteIdMap=new WeakMap,this.iframeRemoteIdToIdMap=new WeakMap;return}this.iframeIdToRemoteIdMap.delete(t),this.iframeRemoteIdToIdMap.delete(t)}getIdToRemoteIdMap(t){let n=this.iframeIdToRemoteIdMap.get(t);return n||(n=new Map,this.iframeIdToRemoteIdMap.set(t,n)),n}getRemoteIdToIdMap(t){let n=this.iframeRemoteIdToIdMap.get(t);return n||(n=new Map,this.iframeRemoteIdToIdMap.set(t,n)),n}}class rg{constructor(){this.crossOriginIframeMirror=new ss(Us),this.crossOriginIframeRootIdMap=new WeakMap}addIframe(){}addLoadListener(){}attachIframe(){}}class sg{constructor(t){this.iframes=new WeakMap,this.crossOriginIframeMap=new WeakMap,this.crossOriginIframeMirror=new ss(Us),this.crossOriginIframeRootIdMap=new WeakMap,this.mutationCb=t.mutationCb,this.wrappedEmit=t.wrappedEmit,this.stylesheetManager=t.stylesheetManager,this.recordCrossOriginIframes=t.recordCrossOriginIframes,this.crossOriginIframeStyleMirror=new ss(this.stylesheetManager.styleMirror.generateId.bind(this.stylesheetManager.styleMirror)),this.mirror=t.mirror,this.recordCrossOriginIframes&&window.addEventListener("message",this.handleMessage.bind(this))}addIframe(t){this.iframes.set(t,!0),t.contentWindow&&this.crossOriginIframeMap.set(t.contentWindow,t)}addLoadListener(t){this.loadListener=t}attachIframe(t,n){var s,i;this.mutationCb({adds:[{parentId:this.mirror.getId(t),nextId:null,node:n}],removes:[],texts:[],attributes:[],isAttachIframe:!0}),this.recordCrossOriginIframes&&((s=t.contentWindow)==null||s.addEventListener("message",this.handleMessage.bind(this))),(i=this.loadListener)==null||i.call(this,t);const r=Ws(t);r&&r.adoptedStyleSheets&&r.adoptedStyleSheets.length>0&&this.stylesheetManager.adoptStyleSheets(r.adoptedStyleSheets,this.mirror.getId(r))}handleMessage(t){const n=t;if(n.data.type!=="rrweb"||n.origin!==n.data.origin||!t.source)return;const s=this.crossOriginIframeMap.get(t.source);if(!s)return;const i=this.transformCrossOriginEvent(s,n.data.event);i&&this.wrappedEmit(i,n.data.isCheckout)}transformCrossOriginEvent(t,n){var r;switch(n.type){case D.FullSnapshot:{this.crossOriginIframeMirror.reset(t),this.crossOriginIframeStyleMirror.reset(t),this.replaceIdOnNode(n.data.node,t);const s=n.data.node.id;return this.crossOriginIframeRootIdMap.set(t,s),this.patchRootIdOnNode(n.data.node,s),{timestamp:n.timestamp,type:D.IncrementalSnapshot,data:{source:P.Mutation,adds:[{parentId:this.mirror.getId(t),nextId:null,node:n.data.node}],removes:[],texts:[],attributes:[],isAttachIframe:!0}}}case D.Meta:case D.Load:case D.DomContentLoaded:return!1;case D.Plugin:return n;case D.Custom:return this.replaceIds(n.data.payload,t,["id","parentId","previousId","nextId"]),n;case D.IncrementalSnapshot:switch(n.data.source){case P.Mutation:return n.data.adds.forEach(s=>{this.replaceIds(s,t,["parentId","nextId","previousId"]),this.replaceIdOnNode(s.node,t);const i=this.crossOriginIframeRootIdMap.get(t);i&&this.patchRootIdOnNode(s.node,i)}),n.data.removes.forEach(s=>{this.replaceIds(s,t,["parentId","id"])}),n.data.attributes.forEach(s=>{this.replaceIds(s,t,["id"])}),n.data.texts.forEach(s=>{this.replaceIds(s,t,["id"])}),n;case P.Drag:case P.TouchMove:case P.MouseMove:return n.data.positions.forEach(s=>{this.replaceIds(s,t,["id"])}),n;case P.ViewportResize:return!1;case P.MediaInteraction:case P.MouseInteraction:case P.Scroll:case P.CanvasMutation:case P.Input:return this.replaceIds(n.data,t,["id"]),n;case P.StyleSheetRule:case P.StyleDeclaration:return this.replaceIds(n.data,t,["id"]),this.replaceStyleIds(n.data,t,["styleId"]),n;case P.Font:return n;case P.Selection:return n.data.ranges.forEach(s=>{this.replaceIds(s,t,["start","end"])}),n;case P.AdoptedStyleSheet:return this.replaceIds(n.data,t,["id"]),this.replaceStyleIds(n.data,t,["styleIds"]),(r=n.data.styles)==null||r.forEach(s=>{this.replaceStyleIds(s,t,["styleId"])}),n}}return!1}replace(t,n,r,s){for(const i of s)!Array.isArray(n[i])&&typeof n[i]!="number"||(Array.isArray(n[i])?n[i]=t.getIds(r,n[i]):n[i]=t.getId(r,n[i]));return n}replaceIds(t,n,r){return this.replace(this.crossOriginIframeMirror,t,n,r)}replaceStyleIds(t,n,r){return this.replace(this.crossOriginIframeStyleMirror,t,n,r)}replaceIdOnNode(t,n){this.replaceIds(t,n,["id","rootId"]),"childNodes"in t&&t.childNodes.forEach(r=>{this.replaceIdOnNode(r,n)})}patchRootIdOnNode(t,n){t.type!==ae.Document&&!t.rootId&&(t.rootId=n),"childNodes"in t&&t.childNodes.forEach(r=>{this.patchRootIdOnNode(r,n)})}}class ig{init(){}addShadowRoot(){}observeAttachShadow(){}reset(){}}class og{constructor(t){this.shadowDoms=new WeakSet,this.restoreHandlers=[],this.mutationCb=t.mutationCb,this.scrollCb=t.scrollCb,this.bypassOptions=t.bypassOptions,this.mirror=t.mirror,this.init()}init(){this.reset(),this.patchAttachShadow(Element,document)}addShadowRoot(t,n){if(!Ut(t)||this.shadowDoms.has(t))return;this.shadowDoms.add(t),this.bypassOptions.canvasManager.addShadowRoot(t);const r=wc({...this.bypassOptions,doc:n,mutationCb:this.mutationCb,mirror:this.mirror,shadowDomManager:this},t);this.restoreHandlers.push(()=>r.disconnect()),this.restoreHandlers.push(kc({...this.bypassOptions,scrollCb:this.scrollCb,doc:t,mirror:this.mirror})),pr(()=>{t.adoptedStyleSheets&&t.adoptedStyleSheets.length>0&&this.bypassOptions.stylesheetManager.adoptStyleSheets(t.adoptedStyleSheets,this.mirror.getId(t.host)),this.restoreHandlers.push(Rc({mirror:this.mirror,stylesheetManager:this.bypassOptions.stylesheetManager},t))},0)}observeAttachShadow(t){const n=Ws(t),r=Hm(t);!n||!r||this.patchAttachShadow(r.Element,n)}patchAttachShadow(t,n){const r=this;this.restoreHandlers.push($s(t.prototype,"attachShadow",function(s){return function(i){const o=s.call(this,i);return this.shadowRoot&&Tc(this)&&r.addShadowRoot(this.shadowRoot,n),o}}))}reset(){this.restoreHandlers.forEach(t=>{try{t()}catch{}}),this.restoreHandlers=[],this.shadowDoms=new WeakSet,this.bypassOptions.canvasManager.resetShadowRoots()}}var fo="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",ag=typeof Uint8Array>"u"?[]:new Uint8Array(256);for(var bn=0;bn<fo.length;bn++)ag[fo.charCodeAt(bn)]=bn;class po{reset(){}freeze(){}unfreeze(){}lock(){}unlock(){}snapshot(){}addWindow(){}addShadowRoot(){}resetShadowRoots(){}}class cg{constructor(t){this.trackedLinkElements=new WeakSet,this.styleMirror=new Om,this.mutationCb=t.mutationCb,this.adoptedStyleSheetCb=t.adoptedStyleSheetCb}attachLinkElement(t,n){"_cssText"in n.attributes&&this.mutationCb({adds:[],removes:[],texts:[],attributes:[{id:n.id,attributes:n.attributes}]}),this.trackLinkElement(t)}trackLinkElement(t){this.trackedLinkElements.has(t)||(this.trackedLinkElements.add(t),this.trackStylesheetInLinkElement(t))}adoptStyleSheets(t,n){if(t.length===0)return;const r={id:n,styleIds:[]},s=[];for(const i of t){let o;this.styleMirror.has(i)?o=this.styleMirror.getId(i):(o=this.styleMirror.add(i),s.push({styleId:o,rules:Array.from(i.rules||CSSRule,(c,a)=>({rule:oc(c),index:a}))})),r.styleIds.push(o)}s.length>0&&(r.styles=s),this.adoptedStyleSheetCb(r)}reset(){this.styleMirror.reset(),this.trackedLinkElements=new WeakSet}trackStylesheetInLinkElement(t){}}class ug{constructor(){this.nodeMap=new WeakMap,this.active=!1}inOtherBuffer(t,n){const r=this.nodeMap.get(t);return r&&Array.from(r).some(s=>s!==n)}add(t,n){this.active||(this.active=!0,Fm(()=>{this.nodeMap=new WeakMap,this.active=!1})),this.nodeMap.set(t,(this.nodeMap.get(t)||new Set).add(n))}destroy(){}}let se,Xn;var Oo;try{if(Array.from([1],e=>e*2)[0]!==2){const e=document.createElement("iframe");document.body.appendChild(e),Array.from=((Oo=e.contentWindow)==null?void 0:Oo.Array.from)||Array.from,document.body.removeChild(e)}}catch(e){console.debug("Unable to override Array.from",e)}const Ce=am();function Be(e={}){const{emit:t,checkoutEveryNms:n,checkoutEveryNth:r,blockClass:s="rr-block",blockSelector:i=null,unblockSelector:o=null,ignoreClass:c="rr-ignore",ignoreSelector:a=null,maskAllText:u=!1,maskTextClass:d="rr-mask",unmaskTextClass:l=null,maskTextSelector:f=null,unmaskTextSelector:p=null,inlineStylesheet:h=!0,maskAllInputs:g,maskInputOptions:_,slimDOMOptions:y,maskAttributeFn:T,maskInputFn:O,maskTextFn:L,maxCanvasSize:q=null,packFn:x,sampling:S={},dataURLOptions:I={},mousemoveWait:J,recordDOM:E=!0,recordCanvas:w=!1,recordCrossOriginIframes:B=!1,recordAfter:H=e.recordAfter==="DOMContentLoaded"?e.recordAfter:"load",userTriggeredOnInput:N=!1,collectFonts:oe=!1,inlineImages:K=!1,plugins:X,keepIframeSrcFn:b=()=>!1,ignoreCSSAttributes:j=new Set([]),errorHandler:k,onMutation:G,getCanvasManager:Z}=e;Wm(k);const re=B?window.parent===window:!0;let Se=!1;if(!re)try{window.parent.document&&(Se=!1)}catch{Se=!0}if(re&&!t)throw new Error("emit function is required");if(!re&&!Se)return()=>{};J!==void 0&&S.mousemove===void 0&&(S.mousemove=J),Ce.reset();const ye=g===!0?{color:!0,date:!0,"datetime-local":!0,email:!0,month:!0,number:!0,range:!0,search:!0,tel:!0,text:!0,time:!0,url:!0,week:!0,textarea:!0,select:!0,radio:!0,checkbox:!0}:_!==void 0?_:{},lt=y===!0||y==="all"?{script:!0,comment:!0,headFavicon:!0,headWhitespace:!0,headMetaSocial:!0,headMetaRobots:!0,headMetaHttpEquiv:!0,headMetaVerification:!0,headMetaAuthorship:y==="all",headMetaDescKeywords:y==="all"}:y||{};Nm();let Le,dt=0;const dn=V=>{for(const Re of X||[])Re.eventProcessor&&(V=Re.eventProcessor(V));return x&&!Se&&(V=x(V)),V};se=(V,Re)=>{var me;const U=V;if(U.timestamp=Jn(),(me=Et[0])!=null&&me.isFrozen()&&U.type!==D.FullSnapshot&&!(U.type===D.IncrementalSnapshot&&U.data.source===P.Mutation)&&Et.forEach(ve=>ve.unfreeze()),re)t==null||t(dn(U),Re);else if(Se){const ve={type:"rrweb",event:dn(U),origin:window.location.origin,isCheckout:Re};window.parent.postMessage(ve,"*")}if(U.type===D.FullSnapshot)Le=U,dt=0;else if(U.type===D.IncrementalSnapshot){if(U.data.source===P.Mutation&&U.data.isAttachIframe)return;dt++;const ve=r&&dt>=r,Y=n&&Le&&U.timestamp-Le.timestamp>n;(ve||Y)&&yr(!0)}};const Nt=V=>{se({type:D.IncrementalSnapshot,data:{source:P.Mutation,...V}})},ti=V=>se({type:D.IncrementalSnapshot,data:{source:P.Scroll,...V}}),cu=V=>se({type:D.IncrementalSnapshot,data:{source:P.CanvasMutation,...V}}),uu=V=>se({type:D.IncrementalSnapshot,data:{source:P.AdoptedStyleSheet,...V}}),Qe=new cg({mutationCb:Nt,adoptedStyleSheetCb:uu}),Ze=typeof __RRWEB_EXCLUDE_IFRAME__=="boolean"&&__RRWEB_EXCLUDE_IFRAME__?new rg:new sg({mirror:Ce,mutationCb:Nt,stylesheetManager:Qe,recordCrossOriginIframes:B,wrappedEmit:se});for(const V of X||[])V.getMirror&&V.getMirror({nodeMirror:Ce,crossOriginIframeMirror:Ze.crossOriginIframeMirror,crossOriginIframeStyleMirror:Ze.crossOriginIframeStyleMirror});const _r=new ug,Sr=dg(Z,{mirror:Ce,win:window,mutationCb:V=>se({type:D.IncrementalSnapshot,data:{source:P.CanvasMutation,...V}}),recordCanvas:w,blockClass:s,blockSelector:i,unblockSelector:o,maxCanvasSize:q,sampling:S.canvas,dataURLOptions:I,errorHandler:k}),fn=typeof __RRWEB_EXCLUDE_SHADOW_DOM__=="boolean"&&__RRWEB_EXCLUDE_SHADOW_DOM__?new ig:new og({mutationCb:Nt,scrollCb:ti,bypassOptions:{onMutation:G,blockClass:s,blockSelector:i,unblockSelector:o,maskAllText:u,maskTextClass:d,unmaskTextClass:l,maskTextSelector:f,unmaskTextSelector:p,inlineStylesheet:h,maskInputOptions:ye,dataURLOptions:I,maskAttributeFn:T,maskTextFn:L,maskInputFn:O,recordCanvas:w,inlineImages:K,sampling:S,slimDOMOptions:lt,iframeManager:Ze,stylesheetManager:Qe,canvasManager:Sr,keepIframeSrcFn:b,processedNodeManager:_r,ignoreCSSAttributes:j},mirror:Ce}),yr=(V=!1)=>{if(!E)return;se({type:D.Meta,data:{href:window.location.href,width:_c(),height:gc()}},V),Qe.reset(),fn.init(),Et.forEach(U=>U.lock());const Re=xm(document,{mirror:Ce,blockClass:s,blockSelector:i,unblockSelector:o,maskAllText:u,maskTextClass:d,unmaskTextClass:l,maskTextSelector:f,unmaskTextSelector:p,inlineStylesheet:h,maskAllInputs:ye,maskAttributeFn:T,maskInputFn:O,maskTextFn:L,slimDOM:lt,dataURLOptions:I,recordCanvas:w,inlineImages:K,onSerialize:U=>{Ec(U,Ce)&&Ze.addIframe(U),bc(U,Ce)&&Qe.trackLinkElement(U),ns(U)&&fn.addShadowRoot(U.shadowRoot,document)},onIframeLoad:(U,me)=>{Ze.attachIframe(U,me),U.contentWindow&&Sr.addWindow(U.contentWindow),fn.observeAttachShadow(U)},onStylesheetLoad:(U,me)=>{Qe.attachLinkElement(U,me)},onBlockedImageLoad:(U,me,{width:ve,height:Y})=>{Nt({adds:[],removes:[],texts:[],attributes:[{id:me.id,attributes:{style:{width:`${ve}px`,height:`${Y}px`}}}]})},keepIframeSrcFn:b,ignoreCSSAttributes:j});if(!Re)return console.warn("Failed to snapshot the document");se({type:D.FullSnapshot,data:{node:Re,initialOffset:mc(window)}}),Et.forEach(U=>U.unlock()),document.adoptedStyleSheets&&document.adoptedStyleSheets.length>0&&Qe.adoptStyleSheets(document.adoptedStyleSheets,Ce.getId(document))};Xn=yr;try{const V=[],Re=me=>{var ve;return W(ng)({onMutation:G,mutationCb:Nt,mousemoveCb:(Y,Er)=>se({type:D.IncrementalSnapshot,data:{source:Er,positions:Y}}),mouseInteractionCb:Y=>se({type:D.IncrementalSnapshot,data:{source:P.MouseInteraction,...Y}}),scrollCb:ti,viewportResizeCb:Y=>se({type:D.IncrementalSnapshot,data:{source:P.ViewportResize,...Y}}),inputCb:Y=>se({type:D.IncrementalSnapshot,data:{source:P.Input,...Y}}),mediaInteractionCb:Y=>se({type:D.IncrementalSnapshot,data:{source:P.MediaInteraction,...Y}}),styleSheetRuleCb:Y=>se({type:D.IncrementalSnapshot,data:{source:P.StyleSheetRule,...Y}}),styleDeclarationCb:Y=>se({type:D.IncrementalSnapshot,data:{source:P.StyleDeclaration,...Y}}),canvasMutationCb:cu,fontCb:Y=>se({type:D.IncrementalSnapshot,data:{source:P.Font,...Y}}),selectionCb:Y=>{se({type:D.IncrementalSnapshot,data:{source:P.Selection,...Y}})},customElementCb:Y=>{se({type:D.IncrementalSnapshot,data:{source:P.CustomElement,...Y}})},blockClass:s,ignoreClass:c,ignoreSelector:a,maskAllText:u,maskTextClass:d,unmaskTextClass:l,maskTextSelector:f,unmaskTextSelector:p,maskInputOptions:ye,inlineStylesheet:h,sampling:S,recordDOM:E,recordCanvas:w,inlineImages:K,userTriggeredOnInput:N,collectFonts:oe,doc:me,maskAttributeFn:T,maskInputFn:O,maskTextFn:L,keepIframeSrcFn:b,blockSelector:i,unblockSelector:o,slimDOMOptions:lt,dataURLOptions:I,mirror:Ce,iframeManager:Ze,stylesheetManager:Qe,shadowDomManager:fn,processedNodeManager:_r,canvasManager:Sr,ignoreCSSAttributes:j,plugins:((ve=X==null?void 0:X.filter(Y=>Y.observer))==null?void 0:ve.map(Y=>({observer:Y.observer,options:Y.options,callback:Er=>se({type:D.Plugin,data:{plugin:Y.name,payload:Er}})})))||[]},{})};Ze.addLoadListener(me=>{try{V.push(Re(me.contentDocument))}catch(ve){console.warn(ve)}});const U=()=>{yr(),V.push(Re(document))};return document.readyState==="interactive"||document.readyState==="complete"?U():(V.push(he("DOMContentLoaded",()=>{se({type:D.DomContentLoaded,data:{}}),H==="DOMContentLoaded"&&U()})),V.push(he("load",()=>{se({type:D.Load,data:{}}),H==="load"&&U()},window))),()=>{V.forEach(me=>me()),_r.destroy(),Xn=void 0,qm()}}catch(V){console.warn(V)}}function lg(e){if(!Xn)throw new Error("please take full snapshot after start recording");Xn(e)}Be.mirror=Ce;Be.takeFullSnapshot=lg;function dg(e,t){try{return e?e(t):new po}catch{return console.warn("Unable to initialize CanvasManager"),new po}}var ho;(function(e){e[e.NotStarted=0]="NotStarted",e[e.Running=1]="Running",e[e.Stopped=2]="Stopped"})(ho||(ho={}));const fg=3,pg=5;function qs(e){return e>9999999999?e:e*1e3}function Lr(e){return e>9999999999?e/1e3:e}function ln(e,t){t.category!=="sentry.transaction"&&(["ui.click","ui.input"].includes(t.category)?e.triggerUserActivity():e.checkAndHandleExpiredSession(),e.addUpdate(()=>(e.throttledAddEvent({type:D.Custom,timestamp:(t.timestamp||0)*1e3,data:{tag:"breadcrumb",payload:tr(t,10,1e3)}}),t.category==="console")))}const hg="button,a";function Cc(e){return e.closest(hg)||e}function Mc(e){const t=Ac(e);return!t||!(t instanceof Element)?t:Cc(t)}function Ac(e){return mg(e)?e.target:e}function mg(e){return typeof e=="object"&&!!e&&"target"in e}let We;function gg(e){return We||(We=[],_g()),We.push(e),()=>{const t=We?We.indexOf(e):-1;t>-1&&We.splice(t,1)}}function _g(){_e(te,"open",function(e){return function(...t){if(We)try{We.forEach(n=>n())}catch{}return e.apply(te,t)}})}const Sg=new Set([P.Mutation,P.StyleSheetRule,P.StyleDeclaration,P.AdoptedStyleSheet,P.CanvasMutation,P.Selection,P.MediaInteraction]);function yg(e,t,n){e.handleClick(t,n)}class Eg{constructor(t,n,r=ln){this._lastMutation=0,this._lastScroll=0,this._clicks=[],this._timeout=n.timeout/1e3,this._threshold=n.threshold/1e3,this._scrollTimeout=n.scrollTimeout/1e3,this._replay=t,this._ignoreSelector=n.ignoreSelector,this._addBreadcrumbEvent=r}addListeners(){const t=gg(()=>{this._lastMutation=mo()});this._teardown=()=>{t(),this._clicks=[],this._lastMutation=0,this._lastScroll=0}}removeListeners(){this._teardown&&this._teardown(),this._checkClickTimeout&&clearTimeout(this._checkClickTimeout)}handleClick(t,n){if(vg(n,this._ignoreSelector)||!Tg(t))return;const r={timestamp:Lr(t.timestamp),clickBreadcrumb:t,clickCount:0,node:n};this._clicks.some(s=>s.node===r.node&&Math.abs(s.timestamp-r.timestamp)<1)||(this._clicks.push(r),this._clicks.length===1&&this._scheduleCheckClicks())}registerMutation(t=Date.now()){this._lastMutation=Lr(t)}registerScroll(t=Date.now()){this._lastScroll=Lr(t)}registerClick(t){const n=Cc(t);this._handleMultiClick(n)}_handleMultiClick(t){this._getClicks(t).forEach(n=>{n.clickCount++})}_getClicks(t){return this._clicks.filter(n=>n.node===t)}_checkClicks(){const t=[],n=mo();this._clicks.forEach(r=>{!r.mutationAfter&&this._lastMutation&&(r.mutationAfter=r.timestamp<=this._lastMutation?this._lastMutation-r.timestamp:void 0),!r.scrollAfter&&this._lastScroll&&(r.scrollAfter=r.timestamp<=this._lastScroll?this._lastScroll-r.timestamp:void 0),r.timestamp+this._timeout<=n&&t.push(r)});for(const r of t){const s=this._clicks.indexOf(r);s>-1&&(this._generateBreadcrumbs(r),this._clicks.splice(s,1))}this._clicks.length&&this._scheduleCheckClicks()}_generateBreadcrumbs(t){const n=this._replay,r=t.scrollAfter&&t.scrollAfter<=this._scrollTimeout,s=t.mutationAfter&&t.mutationAfter<=this._threshold,i=!r&&!s,{clickCount:o,clickBreadcrumb:c}=t;if(i){const a=Math.min(t.mutationAfter||this._timeout,this._timeout)*1e3,u=a<this._timeout*1e3?"mutation":"timeout",d={type:"default",message:c.message,timestamp:c.timestamp,category:"ui.slowClickDetected",data:{...c.data,url:te.location.href,route:n.getCurrentRoute(),timeAfterClickMs:a,endReason:u,clickCount:o||1}};this._addBreadcrumbEvent(n,d);return}if(o>1){const a={type:"default",message:c.message,timestamp:c.timestamp,category:"ui.multiClick",data:{...c.data,url:te.location.href,route:n.getCurrentRoute(),clickCount:o,metric:!0}};this._addBreadcrumbEvent(n,a)}}_scheduleCheckClicks(){this._checkClickTimeout&&clearTimeout(this._checkClickTimeout),this._checkClickTimeout=cn(()=>this._checkClicks(),1e3)}}const bg=["A","BUTTON","INPUT"];function vg(e,t){return!!(!bg.includes(e.tagName)||e.tagName==="INPUT"&&!["submit","button"].includes(e.getAttribute("type")||"")||e.tagName==="A"&&(e.hasAttribute("download")||e.hasAttribute("target")&&e.getAttribute("target")!=="_self")||t&&e.matches(t))}function Tg(e){return!!(e.data&&typeof e.data.nodeId=="number"&&e.timestamp)}function mo(){return Date.now()/1e3}function Ig(e,t){try{if(!wg(t))return;const{source:n}=t.data;if(Sg.has(n)&&e.registerMutation(t.timestamp),n===P.Scroll&&e.registerScroll(t.timestamp),kg(t)){const{type:r,id:s}=t.data,i=Be.mirror.getNode(s);i instanceof HTMLElement&&r===pe.Click&&e.registerClick(i)}}catch{}}function wg(e){return e.type===fg}function kg(e){return e.data.source===P.MouseInteraction}function Oe(e){return{timestamp:Date.now()/1e3,type:"default",...e}}var js=(e=>(e[e.Document=0]="Document",e[e.DocumentType=1]="DocumentType",e[e.Element=2]="Element",e[e.Text=3]="Text",e[e.CDATA=4]="CDATA",e[e.Comment=5]="Comment",e))(js||{});const Rg=new Set(["id","class","aria-label","role","name","alt","title","data-test-id","data-testid","disabled","aria-disabled","data-sentry-component"]);function Cg(e){const t={};!e["data-sentry-component"]&&e["data-sentry-element"]&&(e["data-sentry-component"]=e["data-sentry-element"]);for(const n in e)if(Rg.has(n)){let r=n;(n==="data-testid"||n==="data-test-id")&&(r="testId"),t[r]=e[n]}return t}const Mg=e=>t=>{if(!e.isEnabled())return;const n=Ag(t);if(!n)return;const r=t.name==="click",s=r?t.event:void 0;r&&e.clickDetector&&(s!=null&&s.target)&&!s.altKey&&!s.metaKey&&!s.ctrlKey&&!s.shiftKey&&yg(e.clickDetector,n,Mc(t.event)),ln(e,n)};function xc(e,t){const n=Be.mirror.getId(e),r=n&&Be.mirror.getNode(n),s=r&&Be.mirror.getMeta(r),i=s&&Pg(s)?s:null;return{message:t,data:i?{nodeId:n,node:{id:n,tagName:i.tagName,textContent:Array.from(i.childNodes).map(o=>o.type===js.Text&&o.textContent).filter(Boolean).map(o=>o.trim()).join(""),attributes:Cg(i.attributes)}}:{}}}function Ag(e){const{target:t,message:n}=xg(e);return Oe({category:`ui.${e.name}`,...xc(t,n)})}function xg(e){const t=e.name==="click";let n,r=null;try{r=t?Mc(e.event):Ac(e.event),n=be(r,{maxStringLength:200})||"<unknown>"}catch{n="<unknown>"}return{target:r,message:n}}function Pg(e){return e.type===js.Element}function Ng(e,t){if(!e.isEnabled())return;e.updateUserActivity();const n=Og(t);n&&ln(e,n)}function Og(e){const{metaKey:t,shiftKey:n,ctrlKey:r,altKey:s,key:i,target:o}=e;if(!o||Lg(o)||!i)return null;const c=t||r||s,a=i.length===1;if(!c&&a)return null;const u=be(o,{maxStringLength:200})||"<unknown>",d=xc(o,u);return Oe({category:"ui.keyDown",message:u,data:{...d.data,metaKey:t,shiftKey:n,ctrlKey:r,altKey:s,key:i}})}function Lg(e){return e.tagName==="INPUT"||e.tagName==="TEXTAREA"||e.isContentEditable}const Dg={resource:$g,paint:Hg,navigation:Ug};function Dr(e,t){return({metric:n})=>void t.replayPerformanceEntries.push(e(n))}function Fg(e){return e.map(Bg).filter(Boolean)}function Bg(e){const t=Dg[e.entryType];return t?t(e):null}function kt(e){return((fe()||te.performance.timeOrigin)+e)/1e3}function Hg(e){const{duration:t,entryType:n,name:r,startTime:s}=e,i=kt(s);return{type:n,name:r,start:i,end:i+t,data:void 0}}function Ug(e){const{entryType:t,name:n,decodedBodySize:r,duration:s,domComplete:i,encodedBodySize:o,domContentLoadedEventStart:c,domContentLoadedEventEnd:a,domInteractive:u,loadEventStart:d,loadEventEnd:l,redirectCount:f,startTime:p,transferSize:h,type:g}=e;return s===0?null:{type:`${t}.${g}`,start:kt(p),end:kt(i),name:n,data:{size:h,decodedBodySize:r,encodedBodySize:o,duration:s,domInteractive:u,domContentLoadedEventStart:c,domContentLoadedEventEnd:a,loadEventStart:d,loadEventEnd:l,domComplete:i,redirectCount:f}}}function $g(e){const{entryType:t,initiatorType:n,name:r,responseEnd:s,startTime:i,decodedBodySize:o,encodedBodySize:c,responseStatus:a,transferSize:u}=e;return["fetch","xmlhttprequest"].includes(n)?null:{type:`${t}.${n}`,start:kt(i),end:kt(s),name:r,data:{size:u,statusCode:a,decodedBodySize:o,encodedBodySize:c}}}function zg(e){const t=e.entries[e.entries.length-1],n=t!=null&&t.element?[t.element]:void 0;return Vs(e,"largest-contentful-paint",n)}function Wg(e){return e.sources!==void 0}function qg(e){const t=[],n=[];for(const r of e.entries)if(Wg(r)){const s=[];for(const i of r.sources)if(i.node){n.push(i.node);const o=Be.mirror.getId(i.node);o&&s.push(o)}t.push({value:r.value,nodeIds:s.length?s:void 0})}return Vs(e,"cumulative-layout-shift",n,t)}function jg(e){const t=e.entries[e.entries.length-1],n=t!=null&&t.target?[t.target]:void 0;return Vs(e,"interaction-to-next-paint",n)}function Vs(e,t,n,r){const s=e.value,i=e.rating,o=kt(s);return{type:"web-vital",name:t,start:o,end:o,data:{value:s,size:s,rating:i,nodeIds:n?n.map(c=>Be.mirror.getId(c)):void 0,attributions:r}}}function Vg(e){function t(s){e.performanceEntries.includes(s)||e.performanceEntries.push(s)}function n({entries:s}){s.forEach(t)}const r=[];return["navigation","paint","resource"].forEach(s=>{r.push(ct(s,n))}),r.push(Ps(Dr(zg,e)),xs(Dr(qg,e)),Va(Dr(jg,e))),()=>{r.forEach(s=>s())}}const C=typeof __SENTRY_DEBUG__>"u"||__SENTRY_DEBUG__,Gg='var t=Uint8Array,n=Uint16Array,r=Int32Array,e=new t([0,0,0,0,0,0,0,0,1,1,1,1,2,2,2,2,3,3,3,3,4,4,4,4,5,5,5,5,0,0,0,0]),i=new t([0,0,0,0,1,1,2,2,3,3,4,4,5,5,6,6,7,7,8,8,9,9,10,10,11,11,12,12,13,13,0,0]),s=new t([16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15]),a=function(t,e){for(var i=new n(31),s=0;s<31;++s)i[s]=e+=1<<t[s-1];var a=new r(i[30]);for(s=1;s<30;++s)for(var o=i[s];o<i[s+1];++o)a[o]=o-i[s]<<5|s;return{b:i,r:a}},o=a(e,2),h=o.b,f=o.r;h[28]=258,f[258]=28;for(var l=a(i,0).r,u=new n(32768),c=0;c<32768;++c){var v=(43690&c)>>1|(21845&c)<<1;v=(61680&(v=(52428&v)>>2|(13107&v)<<2))>>4|(3855&v)<<4,u[c]=((65280&v)>>8|(255&v)<<8)>>1}var d=function(t,r,e){for(var i=t.length,s=0,a=new n(r);s<i;++s)t[s]&&++a[t[s]-1];var o,h=new n(r);for(s=1;s<r;++s)h[s]=h[s-1]+a[s-1]<<1;if(e){o=new n(1<<r);var f=15-r;for(s=0;s<i;++s)if(t[s])for(var l=s<<4|t[s],c=r-t[s],v=h[t[s]-1]++<<c,d=v|(1<<c)-1;v<=d;++v)o[u[v]>>f]=l}else for(o=new n(i),s=0;s<i;++s)t[s]&&(o[s]=u[h[t[s]-1]++]>>15-t[s]);return o},p=new t(288);for(c=0;c<144;++c)p[c]=8;for(c=144;c<256;++c)p[c]=9;for(c=256;c<280;++c)p[c]=7;for(c=280;c<288;++c)p[c]=8;var g=new t(32);for(c=0;c<32;++c)g[c]=5;var w=d(p,9,0),y=d(g,5,0),m=function(t){return(t+7)/8|0},b=function(n,r,e){return(null==e||e>n.length)&&(e=n.length),new t(n.subarray(r,e))},M=["unexpected EOF","invalid block type","invalid length/literal","invalid distance","stream finished","no stream handler",,"no callback","invalid UTF-8 data","extra field too long","date not in range 1980-2099","filename too long","stream finishing","invalid zip data"],E=function(t,n,r){var e=new Error(n||M[t]);if(e.code=t,Error.captureStackTrace&&Error.captureStackTrace(e,E),!r)throw e;return e},z=function(t,n,r){r<<=7&n;var e=n/8|0;t[e]|=r,t[e+1]|=r>>8},_=function(t,n,r){r<<=7&n;var e=n/8|0;t[e]|=r,t[e+1]|=r>>8,t[e+2]|=r>>16},x=function(r,e){for(var i=[],s=0;s<r.length;++s)r[s]&&i.push({s:s,f:r[s]});var a=i.length,o=i.slice();if(!a)return{t:F,l:0};if(1==a){var h=new t(i[0].s+1);return h[i[0].s]=1,{t:h,l:1}}i.sort(function(t,n){return t.f-n.f}),i.push({s:-1,f:25001});var f=i[0],l=i[1],u=0,c=1,v=2;for(i[0]={s:-1,f:f.f+l.f,l:f,r:l};c!=a-1;)f=i[i[u].f<i[v].f?u++:v++],l=i[u!=c&&i[u].f<i[v].f?u++:v++],i[c++]={s:-1,f:f.f+l.f,l:f,r:l};var d=o[0].s;for(s=1;s<a;++s)o[s].s>d&&(d=o[s].s);var p=new n(d+1),g=A(i[c-1],p,0);if(g>e){s=0;var w=0,y=g-e,m=1<<y;for(o.sort(function(t,n){return p[n.s]-p[t.s]||t.f-n.f});s<a;++s){var b=o[s].s;if(!(p[b]>e))break;w+=m-(1<<g-p[b]),p[b]=e}for(w>>=y;w>0;){var M=o[s].s;p[M]<e?w-=1<<e-p[M]++-1:++s}for(;s>=0&&w;--s){var E=o[s].s;p[E]==e&&(--p[E],++w)}g=e}return{t:new t(p),l:g}},A=function(t,n,r){return-1==t.s?Math.max(A(t.l,n,r+1),A(t.r,n,r+1)):n[t.s]=r},D=function(t){for(var r=t.length;r&&!t[--r];);for(var e=new n(++r),i=0,s=t[0],a=1,o=function(t){e[i++]=t},h=1;h<=r;++h)if(t[h]==s&&h!=r)++a;else{if(!s&&a>2){for(;a>138;a-=138)o(32754);a>2&&(o(a>10?a-11<<5|28690:a-3<<5|12305),a=0)}else if(a>3){for(o(s),--a;a>6;a-=6)o(8304);a>2&&(o(a-3<<5|8208),a=0)}for(;a--;)o(s);a=1,s=t[h]}return{c:e.subarray(0,i),n:r}},T=function(t,n){for(var r=0,e=0;e<n.length;++e)r+=t[e]*n[e];return r},k=function(t,n,r){var e=r.length,i=m(n+2);t[i]=255&e,t[i+1]=e>>8,t[i+2]=255^t[i],t[i+3]=255^t[i+1];for(var s=0;s<e;++s)t[i+s+4]=r[s];return 8*(i+4+e)},U=function(t,r,a,o,h,f,l,u,c,v,m){z(r,m++,a),++h[256];for(var b=x(h,15),M=b.t,E=b.l,A=x(f,15),U=A.t,C=A.l,F=D(M),I=F.c,S=F.n,L=D(U),O=L.c,j=L.n,q=new n(19),B=0;B<I.length;++B)++q[31&I[B]];for(B=0;B<O.length;++B)++q[31&O[B]];for(var G=x(q,7),H=G.t,J=G.l,K=19;K>4&&!H[s[K-1]];--K);var N,P,Q,R,V=v+5<<3,W=T(h,p)+T(f,g)+l,X=T(h,M)+T(f,U)+l+14+3*K+T(q,H)+2*q[16]+3*q[17]+7*q[18];if(c>=0&&V<=W&&V<=X)return k(r,m,t.subarray(c,c+v));if(z(r,m,1+(X<W)),m+=2,X<W){N=d(M,E,0),P=M,Q=d(U,C,0),R=U;var Y=d(H,J,0);z(r,m,S-257),z(r,m+5,j-1),z(r,m+10,K-4),m+=14;for(B=0;B<K;++B)z(r,m+3*B,H[s[B]]);m+=3*K;for(var Z=[I,O],$=0;$<2;++$){var tt=Z[$];for(B=0;B<tt.length;++B){var nt=31&tt[B];z(r,m,Y[nt]),m+=H[nt],nt>15&&(z(r,m,tt[B]>>5&127),m+=tt[B]>>12)}}}else N=w,P=p,Q=y,R=g;for(B=0;B<u;++B){var rt=o[B];if(rt>255){_(r,m,N[(nt=rt>>18&31)+257]),m+=P[nt+257],nt>7&&(z(r,m,rt>>23&31),m+=e[nt]);var et=31&rt;_(r,m,Q[et]),m+=R[et],et>3&&(_(r,m,rt>>5&8191),m+=i[et])}else _(r,m,N[rt]),m+=P[rt]}return _(r,m,N[256]),m+P[256]},C=new r([65540,131080,131088,131104,262176,1048704,1048832,2114560,2117632]),F=new t(0),I=function(){for(var t=new Int32Array(256),n=0;n<256;++n){for(var r=n,e=9;--e;)r=(1&r&&-306674912)^r>>>1;t[n]=r}return t}(),S=function(){var t=1,n=0;return{p:function(r){for(var e=t,i=n,s=0|r.length,a=0;a!=s;){for(var o=Math.min(a+2655,s);a<o;++a)i+=e+=r[a];e=(65535&e)+15*(e>>16),i=(65535&i)+15*(i>>16)}t=e,n=i},d:function(){return(255&(t%=65521))<<24|(65280&t)<<8|(255&(n%=65521))<<8|n>>8}}},L=function(s,a,o,h,u){if(!u&&(u={l:1},a.dictionary)){var c=a.dictionary.subarray(-32768),v=new t(c.length+s.length);v.set(c),v.set(s,c.length),s=v,u.w=c.length}return function(s,a,o,h,u,c){var v=c.z||s.length,d=new t(h+v+5*(1+Math.ceil(v/7e3))+u),p=d.subarray(h,d.length-u),g=c.l,w=7&(c.r||0);if(a){w&&(p[0]=c.r>>3);for(var y=C[a-1],M=y>>13,E=8191&y,z=(1<<o)-1,_=c.p||new n(32768),x=c.h||new n(z+1),A=Math.ceil(o/3),D=2*A,T=function(t){return(s[t]^s[t+1]<<A^s[t+2]<<D)&z},F=new r(25e3),I=new n(288),S=new n(32),L=0,O=0,j=c.i||0,q=0,B=c.w||0,G=0;j+2<v;++j){var H=T(j),J=32767&j,K=x[H];if(_[J]=K,x[H]=J,B<=j){var N=v-j;if((L>7e3||q>24576)&&(N>423||!g)){w=U(s,p,0,F,I,S,O,q,G,j-G,w),q=L=O=0,G=j;for(var P=0;P<286;++P)I[P]=0;for(P=0;P<30;++P)S[P]=0}var Q=2,R=0,V=E,W=J-K&32767;if(N>2&&H==T(j-W))for(var X=Math.min(M,N)-1,Y=Math.min(32767,j),Z=Math.min(258,N);W<=Y&&--V&&J!=K;){if(s[j+Q]==s[j+Q-W]){for(var $=0;$<Z&&s[j+$]==s[j+$-W];++$);if($>Q){if(Q=$,R=W,$>X)break;var tt=Math.min(W,$-2),nt=0;for(P=0;P<tt;++P){var rt=j-W+P&32767,et=rt-_[rt]&32767;et>nt&&(nt=et,K=rt)}}}W+=(J=K)-(K=_[J])&32767}if(R){F[q++]=268435456|f[Q]<<18|l[R];var it=31&f[Q],st=31&l[R];O+=e[it]+i[st],++I[257+it],++S[st],B=j+Q,++L}else F[q++]=s[j],++I[s[j]]}}for(j=Math.max(j,B);j<v;++j)F[q++]=s[j],++I[s[j]];w=U(s,p,g,F,I,S,O,q,G,j-G,w),g||(c.r=7&w|p[w/8|0]<<3,w-=7,c.h=x,c.p=_,c.i=j,c.w=B)}else{for(j=c.w||0;j<v+g;j+=65535){var at=j+65535;at>=v&&(p[w/8|0]=g,at=v),w=k(p,w+1,s.subarray(j,at))}c.i=v}return b(d,0,h+m(w)+u)}(s,null==a.level?6:a.level,null==a.mem?u.l?Math.ceil(1.5*Math.max(8,Math.min(13,Math.log(s.length)))):20:12+a.mem,o,h,u)},O=function(t,n,r){for(;r;++n)t[n]=r,r>>>=8},j=function(){function n(n,r){if("function"==typeof n&&(r=n,n={}),this.ondata=r,this.o=n||{},this.s={l:0,i:32768,w:32768,z:32768},this.b=new t(98304),this.o.dictionary){var e=this.o.dictionary.subarray(-32768);this.b.set(e,32768-e.length),this.s.i=32768-e.length}}return n.prototype.p=function(t,n){this.ondata(L(t,this.o,0,0,this.s),n)},n.prototype.push=function(n,r){this.ondata||E(5),this.s.l&&E(4);var e=n.length+this.s.z;if(e>this.b.length){if(e>2*this.b.length-32768){var i=new t(-32768&e);i.set(this.b.subarray(0,this.s.z)),this.b=i}var s=this.b.length-this.s.z;this.b.set(n.subarray(0,s),this.s.z),this.s.z=this.b.length,this.p(this.b,!1),this.b.set(this.b.subarray(-32768)),this.b.set(n.subarray(s),32768),this.s.z=n.length-s+32768,this.s.i=32766,this.s.w=32768}else this.b.set(n,this.s.z),this.s.z+=n.length;this.s.l=1&r,(this.s.z>this.s.w+8191||r)&&(this.p(this.b,r||!1),this.s.w=this.s.i,this.s.i-=2)},n.prototype.flush=function(){this.ondata||E(5),this.s.l&&E(4),this.p(this.b,!1),this.s.w=this.s.i,this.s.i-=2},n}();function q(t,n){n||(n={});var r=function(){var t=-1;return{p:function(n){for(var r=t,e=0;e<n.length;++e)r=I[255&r^n[e]]^r>>>8;t=r},d:function(){return~t}}}(),e=t.length;r.p(t);var i,s=L(t,n,10+((i=n).filename?i.filename.length+1:0),8),a=s.length;return function(t,n){var r=n.filename;if(t[0]=31,t[1]=139,t[2]=8,t[8]=n.level<2?4:9==n.level?2:0,t[9]=3,0!=n.mtime&&O(t,4,Math.floor(new Date(n.mtime||Date.now())/1e3)),r){t[3]=8;for(var e=0;e<=r.length;++e)t[e+10]=r.charCodeAt(e)}}(s,n),O(s,a-8,r.d()),O(s,a-4,e),s}var B=function(){function t(t,n){this.c=S(),this.v=1,j.call(this,t,n)}return t.prototype.push=function(t,n){this.c.p(t),j.prototype.push.call(this,t,n)},t.prototype.p=function(t,n){var r=L(t,this.o,this.v&&(this.o.dictionary?6:2),n&&4,this.s);this.v&&(function(t,n){var r=n.level,e=0==r?0:r<6?1:9==r?3:2;if(t[0]=120,t[1]=e<<6|(n.dictionary&&32),t[1]|=31-(t[0]<<8|t[1])%31,n.dictionary){var i=S();i.p(n.dictionary),O(t,2,i.d())}}(r,this.o),this.v=0),n&&O(r,r.length-4,this.c.d()),this.ondata(r,n)},t.prototype.flush=function(){j.prototype.flush.call(this)},t}(),G="undefined"!=typeof TextEncoder&&new TextEncoder,H="undefined"!=typeof TextDecoder&&new TextDecoder;try{H.decode(F,{stream:!0})}catch(t){}var J=function(){function t(t){this.ondata=t}return t.prototype.push=function(t,n){this.ondata||E(5),this.d&&E(4),this.ondata(K(t),this.d=n||!1)},t}();function K(n,r){if(G)return G.encode(n);for(var e=n.length,i=new t(n.length+(n.length>>1)),s=0,a=function(t){i[s++]=t},o=0;o<e;++o){if(s+5>i.length){var h=new t(s+8+(e-o<<1));h.set(i),i=h}var f=n.charCodeAt(o);f<128||r?a(f):f<2048?(a(192|f>>6),a(128|63&f)):f>55295&&f<57344?(a(240|(f=65536+(1047552&f)|1023&n.charCodeAt(++o))>>18),a(128|f>>12&63),a(128|f>>6&63),a(128|63&f)):(a(224|f>>12),a(128|f>>6&63),a(128|63&f))}return b(i,0,s)}const N=new class{constructor(){this._init()}clear(){this._init()}addEvent(t){if(!t)throw new Error("Adding invalid event");const n=this._hasEvents?",":"";this.stream.push(n+t),this._hasEvents=!0}finish(){this.stream.push("]",!0);const t=function(t){let n=0;for(const r of t)n+=r.length;const r=new Uint8Array(n);for(let n=0,e=0,i=t.length;n<i;n++){const i=t[n];r.set(i,e),e+=i.length}return r}(this._deflatedData);return this._init(),t}_init(){this._hasEvents=!1,this._deflatedData=[],this.deflate=new B,this.deflate.ondata=(t,n)=>{this._deflatedData.push(t)},this.stream=new J((t,n)=>{this.deflate.push(t,n)}),this.stream.push("[")}},P={clear:()=>{N.clear()},addEvent:t=>N.addEvent(t),finish:()=>N.finish(),compress:t=>function(t){return q(K(t))}(t)};addEventListener("message",function(t){const n=t.data.method,r=t.data.id,e=t.data.arg;if(n in P&&"function"==typeof P[n])try{const t=P[n](e);postMessage({id:r,method:n,success:!0,response:t})}catch(t){postMessage({id:r,method:n,success:!1,response:t.message}),console.error(t)}}),postMessage({id:void 0,method:"init",success:!0,response:void 0});';function Yg(){const e=new Blob([Gg]);return URL.createObjectURL(e)}const go=["log","warn","error"],Nn="[Replay] ";function Fr(e,t="info"){Ye({category:"console",data:{logger:"replay"},level:t,message:`${Nn}${e}`},{level:t})}function Jg(){let e=!1,t=!1;const n={exception:()=>{},infoTick:()=>{},setConfig:r=>{e=!!r.captureExceptions,t=!!r.traceInternals}};return C?(go.forEach(r=>{n[r]=(...s)=>{m[r](Nn,...s),t&&Fr(s.join(""),Ma(r))}}),n.exception=(r,...s)=>{s.length&&n.error&&n.error(...s),m.error(Nn,r),e?Lu(r,{mechanism:{handled:!0,type:"auto.function.replay.debug"}}):t&&Fr(r,"error")},n.infoTick=(...r)=>{m.log(Nn,...r),t&&setTimeout(()=>Fr(r[0]),0)}):go.forEach(r=>{n[r]=()=>{}}),n}const M=Jg();class Gs extends Error{constructor(){super(`Event buffer exceeded maximum size of ${Bs}.`)}}class Pc{constructor(){this.events=[],this._totalSize=0,this.hasCheckout=!1,this.waitForCheckout=!1}get hasEvents(){return this.events.length>0}get type(){return"sync"}destroy(){this.events=[]}async addEvent(t){const n=JSON.stringify(t).length;if(this._totalSize+=n,this._totalSize>Bs)throw new Gs;this.events.push(t)}finish(){return new Promise(t=>{const n=this.events;this.clear(),t(JSON.stringify(n))})}clear(){this.events=[],this._totalSize=0,this.hasCheckout=!1}getEarliestTimestamp(){const t=this.events.map(n=>n.timestamp).sort()[0];return t?qs(t):null}}class Kg{constructor(t){this._worker=t,this._id=0}ensureReady(){return this._ensureReadyPromise?this._ensureReadyPromise:(this._ensureReadyPromise=new Promise((t,n)=>{this._worker.addEventListener("message",({data:r})=>{r.success?t():n()},{once:!0}),this._worker.addEventListener("error",r=>{n(r)},{once:!0})}),this._ensureReadyPromise)}destroy(){C&&M.log("Destroying compression worker"),this._worker.terminate()}postMessage(t,n){const r=this._getAndIncrementId();return new Promise((s,i)=>{const o=({data:c})=>{const a=c;if(a.method===t&&a.id===r){if(this._worker.removeEventListener("message",o),!a.success){C&&M.error("Error in compression worker: ",a.response),i(new Error("Error in compression worker"));return}s(a.response)}};this._worker.addEventListener("message",o),this._worker.postMessage({id:r,method:t,arg:n})})}_getAndIncrementId(){return this._id++}}class Xg{constructor(t){this._worker=new Kg(t),this._earliestTimestamp=null,this._totalSize=0,this.hasCheckout=!1,this.waitForCheckout=!1}get hasEvents(){return!!this._earliestTimestamp}get type(){return"worker"}ensureReady(){return this._worker.ensureReady()}destroy(){this._worker.destroy()}addEvent(t){const n=qs(t.timestamp);(!this._earliestTimestamp||n<this._earliestTimestamp)&&(this._earliestTimestamp=n);const r=JSON.stringify(t);return this._totalSize+=r.length,this._totalSize>Bs?Promise.reject(new Gs):this._sendEventToWorker(r)}finish(){return this._finishRequest()}clear(){this._earliestTimestamp=null,this._totalSize=0,this.hasCheckout=!1,this._worker.postMessage("clear").then(null,t=>{C&&M.exception(t,'Sending "clear" message to worker failed',t)})}getEarliestTimestamp(){return this._earliestTimestamp}_sendEventToWorker(t){return this._worker.postMessage("addEvent",t)}async _finishRequest(){const t=await this._worker.postMessage("finish");return this._earliestTimestamp=null,this._totalSize=0,t}}class Qg{constructor(t){this._fallback=new Pc,this._compression=new Xg(t),this._used=this._fallback,this._ensureWorkerIsLoadedPromise=this._ensureWorkerIsLoaded()}get waitForCheckout(){return this._used.waitForCheckout}get type(){return this._used.type}get hasEvents(){return this._used.hasEvents}get hasCheckout(){return this._used.hasCheckout}set hasCheckout(t){this._used.hasCheckout=t}set waitForCheckout(t){this._used.waitForCheckout=t}destroy(){this._fallback.destroy(),this._compression.destroy()}clear(){return this._used.clear()}getEarliestTimestamp(){return this._used.getEarliestTimestamp()}addEvent(t){return this._used.addEvent(t)}async finish(){return await this.ensureWorkerIsLoaded(),this._used.finish()}ensureWorkerIsLoaded(){return this._ensureWorkerIsLoadedPromise}async _ensureWorkerIsLoaded(){try{await this._compression.ensureReady()}catch(t){C&&M.exception(t,"Failed to load the compression worker, falling back to simple buffer");return}await this._switchToCompressionWorker()}async _switchToCompressionWorker(){const{events:t,hasCheckout:n,waitForCheckout:r}=this._fallback,s=[];for(const i of t)s.push(this._compression.addEvent(i));this._compression.hasCheckout=n,this._compression.waitForCheckout=r,this._used=this._compression;try{await Promise.all(s),this._fallback.clear()}catch(i){C&&M.exception(i,"Failed to add events when switching buffers.")}}}function Zg({useCompression:e,workerUrl:t}){if(e&&window.Worker){const n=e_(t);if(n)return n}return C&&M.log("Using simple buffer"),new Pc}function e_(e){try{const t=e||t_();if(!t)return;C&&M.log(`Using compression worker${e?` from ${e}`:""}`);const n=new Worker(t);return new Qg(n)}catch(t){C&&M.exception(t,"Failed to create compression worker")}}function t_(){return typeof __SENTRY_EXCLUDE_REPLAY_WORKER__>"u"||!__SENTRY_EXCLUDE_REPLAY_WORKER__?Yg():""}function Ys(){try{return"sessionStorage"in te&&!!te.sessionStorage}catch{return!1}}function n_(e){r_(),e.session=void 0}function r_(){if(Ys())try{te.sessionStorage.removeItem(Ds)}catch{}}function Nc(e){return e===void 0?!1:Math.random()<e}function hr(e){if(Ys())try{te.sessionStorage.setItem(Ds,JSON.stringify(e))}catch{}}function Oc(e){const t=Date.now(),n=e.id||Pe(),r=e.started||t,s=e.lastActivity||t,i=e.segmentId||0,o=e.sampled,c=e.previousSessionId,a=e.dirty||!1;return{id:n,started:r,lastActivity:s,segmentId:i,sampled:o,previousSessionId:c,dirty:a}}function s_(e,t){return Nc(e)?"session":t?"buffer":!1}function _o({sessionSampleRate:e,allowBuffering:t,stickySession:n=!1},{previousSessionId:r}={}){const s=s_(e,t),i=Oc({sampled:s,previousSessionId:r});return n&&hr(i),i}function i_(){if(!Ys())return null;try{const e=te.sessionStorage.getItem(Ds);if(!e)return null;const t=JSON.parse(e);return C&&M.infoTick("Loading existing session"),Oc(t)}catch{return null}}function is(e,t,n=+new Date){return e===null||t===void 0||t<0?!0:t===0?!1:e+t<=n}function Lc(e,{maxReplayDuration:t,sessionIdleExpire:n,targetTime:r=Date.now()}){return is(e.started,t,r)||is(e.lastActivity,n,r)}function Dc(e,{sessionIdleExpire:t,maxReplayDuration:n}){return!(!Lc(e,{sessionIdleExpire:t,maxReplayDuration:n})||e.sampled==="buffer"&&e.segmentId===0)}function Br({sessionIdleExpire:e,maxReplayDuration:t,previousSessionId:n},r){const s=r.stickySession&&i_();return s?Dc(s,{sessionIdleExpire:e,maxReplayDuration:t})?(C&&M.infoTick("Session in sessionStorage is expired, creating new one..."),_o(r,{previousSessionId:s.id})):s:(C&&M.infoTick("Creating new session"),_o(r,{previousSessionId:n}))}function o_(e){return e.type===D.Custom}function Js(e,t,n){return Bc(e,t)?(Fc(e,t,n),!0):!1}function a_(e,t,n){return Bc(e,t)?Fc(e,t,n):Promise.resolve(null)}async function Fc(e,t,n){const{eventBuffer:r}=e;if(!r||r.waitForCheckout&&!n)return null;const s=e.recordingMode==="buffer";try{n&&s&&r.clear(),n&&(r.hasCheckout=!0,r.waitForCheckout=!1);const i=e.getOptions(),o=c_(t,i.beforeAddRecordingEvent);return o?await r.addEvent(o):void 0}catch(i){const o=i&&i instanceof Gs,c=o?"addEventSizeExceeded":"addEvent",a=z();if(a){const u=o?"buffer_overflow":"internal_sdk_error";a.recordDroppedEvent(u,"replay")}if(o&&s)return r.clear(),r.waitForCheckout=!0,null;e.handleException(i),await e.stop({reason:c})}}function Bc(e,t){if(!e.eventBuffer||e.isPaused()||!e.isEnabled())return!1;const n=qs(t.timestamp);return n+e.timeouts.sessionIdlePause<Date.now()?!1:n>e.getContext().initialTimestamp+e.getOptions().maxReplayDuration?(C&&M.infoTick(`Skipping event with timestamp ${n} because it is after maxReplayDuration`),!1):!0}function c_(e,t){try{if(typeof t=="function"&&o_(e))return t(e)}catch(n){return C&&M.exception(n,"An error occurred in the `beforeAddRecordingEvent` callback, skipping the event..."),null}return e}function Ks(e){return!e.type}function os(e){return e.type==="transaction"}function u_(e){return e.type==="replay_event"}function So(e){return e.type==="feedback"}function l_(e){return(t,n)=>{if(!e.isEnabled()||!Ks(t)&&!os(t))return;const r=n.statusCode;if(!(!r||r<200||r>=300)){if(os(t)){d_(e,t);return}f_(e,t)}}}function d_(e,t){var r,s;const n=e.getContext();(s=(r=t.contexts)==null?void 0:r.trace)!=null&&s.trace_id&&n.traceIds.size<100&&n.traceIds.add(t.contexts.trace.trace_id)}function f_(e,t){const n=e.getContext();if(t.event_id&&n.errorIds.size<100&&n.errorIds.add(t.event_id),e.recordingMode!=="buffer"||!t.tags||!t.tags.replayId)return;const{beforeErrorSampling:r}=e.getOptions();typeof r=="function"&&!r(t)||cn(async()=>{try{await e.sendBufferedReplayOrFlush()}catch(s){e.handleException(s)}})}function p_(e){return t=>{!e.isEnabled()||!Ks(t)||h_(e,t)}}function h_(e,t){var r,s,i;const n=(i=(s=(r=t.exception)==null?void 0:r.values)==null?void 0:s[0])==null?void 0:i.value;if(typeof n=="string"&&(n.match(/(reactjs\.org\/docs\/error-decoder\.html\?invariant=|react\.dev\/errors\/)(418|419|422|423|425)/)||n.match(/(does not match server-rendered HTML|Hydration failed because)/i))){const o=Oe({category:"replay.hydrate-error",data:{url:en()}});ln(e,o)}}function m_(e){const t=z();t&&t.on("beforeAddBreadcrumb",n=>g_(e,n))}function g_(e,t){if(!e.isEnabled()||!Hc(t))return;const n=__(t);n&&ln(e,n)}function __(e){return!Hc(e)||["fetch","xhr","sentry.event","sentry.transaction"].includes(e.category)||e.category.startsWith("ui.")?null:e.category==="console"?S_(e):Oe(e)}function S_(e){var s;const t=(s=e.data)==null?void 0:s.arguments;if(!Array.isArray(t)||t.length===0)return Oe(e);let n=!1;const r=t.map(i=>{if(!i)return i;if(typeof i=="string")return i.length>Sn?(n=!0,`${i.slice(0,Sn)}…`):i;if(typeof i=="object")try{const o=tr(i,7);return JSON.stringify(o).length>Sn?(n=!0,`${JSON.stringify(o,null,2).slice(0,Sn)}…`):o}catch{}return i});return Oe({...e,data:{...e.data,arguments:r,...n?{_meta:{warnings:["CONSOLE_ARG_TRUNCATED"]}}:{}}})}function Hc(e){return!!e.category}function y_(e,t){var n,r,s;return e.type||!((r=(n=e.exception)==null?void 0:n.values)!=null&&r.length)?!1:!!((s=t.originalException)!=null&&s.__rrweb__)}function Uc(){const e=ne().getPropagationContext().dsc;e&&delete e.replay_id;const t=de();if(t){const n=He(t);delete n.replay_id}}function E_(e,t){e.triggerUserActivity(),e.addUpdate(()=>t.timestamp?(e.throttledAddEvent({type:D.Custom,timestamp:t.timestamp*1e3,data:{tag:"breadcrumb",payload:{timestamp:t.timestamp,type:"default",category:"sentry.feedback",data:{feedbackId:t.event_id}}}}),!1):!0)}function b_(e,t){return e.recordingMode!=="buffer"||t.message===Fs||!t.exception||t.type?!1:Nc(e.getOptions().errorSampleRate)}function v_(e){return Object.assign((t,n)=>{var o;if(!e.isEnabled()||e.isPaused())return t;if(u_(t))return delete t.breadcrumbs,t;if(!Ks(t)&&!os(t)&&!So(t))return t;if(!e.checkAndHandleExpiredSession())return Uc(),t;if(So(t))return e.flush(),t.contexts.feedback.replay_id=e.getSessionId(),E_(e,t),t;if(y_(t,n)&&!e.getOptions()._experiments.captureExceptions)return C&&M.log("Ignoring error from rrweb internals",t),null;const s=b_(e,t);if((s||e.recordingMode==="session")&&(t.tags={...t.tags,replayId:e.getSessionId()}),s&&e.recordingMode==="buffer"&&((o=e.session)==null?void 0:o.sampled)==="buffer"){const c=e.session;c.dirty=!0,e.getOptions().stickySession&&hr(c)}return t},{id:"Replay"})}function mr(e,t){return t.map(({type:n,start:r,end:s,name:i,data:o})=>{const c=e.throttledAddEvent({type:D.Custom,timestamp:r,data:{tag:"performanceSpan",payload:{op:n,description:i,startTimestamp:r,endTimestamp:s,data:o}}});return typeof c=="string"?Promise.resolve(null):c})}function T_(e){const{from:t,to:n}=e,r=Date.now()/1e3;return{type:"navigation.push",start:r,end:r,name:n,data:{previous:t}}}function I_(e){return t=>{if(!e.isEnabled())return;const n=T_(t);n!==null&&(e.getContext().urls.push(n.name),e.triggerUserActivity(),e.addUpdate(()=>(mr(e,[n]),!1)))}}function w_(e,t){return C&&e.getOptions()._experiments.traceInternals?!1:sd(t,z())}function $c(e,t){e.isEnabled()&&t!==null&&(w_(e,t.name)||e.addUpdate(()=>(mr(e,[t]),!0)))}function gr(e){if(!e)return;const t=new TextEncoder;try{if(typeof e=="string")return t.encode(e).length;if(e instanceof URLSearchParams)return t.encode(e.toString()).length;if(e instanceof FormData){const n=ec(e);return t.encode(n).length}if(e instanceof Blob)return e.size;if(e instanceof ArrayBuffer)return e.byteLength}catch{}}function zc(e){if(!e)return;const t=parseInt(e,10);return isNaN(t)?void 0:t}function Qn(e,t){if(!e)return{headers:{},size:void 0,_meta:{warnings:[t]}};const n={...e._meta},r=n.warnings||[];return n.warnings=[...r,t],e._meta=n,e}function Wc(e,t){if(!t)return null;const{startTimestamp:n,endTimestamp:r,url:s,method:i,statusCode:o,request:c,response:a}=t;return{type:e,start:n/1e3,end:r/1e3,name:s,data:{method:i,statusCode:o,request:c,response:a}}}function Jt(e){return{headers:{},size:e,_meta:{warnings:["URL_SKIPPED"]}}}function qe(e,t,n){if(!t&&Object.keys(e).length===0)return;if(!t)return{headers:e};if(!n)return{headers:e,size:t};const r={headers:e,size:t},{body:s,warnings:i}=k_(n);return r.body=s,i!=null&&i.length&&(r._meta={warnings:i}),r}function as(e,t){return Object.entries(e).reduce((n,[r,s])=>{const i=r.toLowerCase();return t.includes(i)&&e[r]&&(n[i]=s),n},{})}function k_(e){if(!e||typeof e!="string")return{body:e};const t=e.length>Xi,n=R_(e);if(t){const r=e.slice(0,Xi);return n?{body:r,warnings:["MAYBE_JSON_TRUNCATED"]}:{body:`${r}…`,warnings:["TEXT_TRUNCATED"]}}if(n)try{return{body:JSON.parse(e)}}catch{}return{body:e}}function R_(e){const t=e[0],n=e[e.length-1];return t==="["&&n==="]"||t==="{"&&n==="}"}function Zn(e,t){const n=C_(e);return Fe(n,t)}function C_(e,t=te.document.baseURI){if(e.startsWith("http://")||e.startsWith("https://")||e.startsWith(te.location.origin))return e;const n=new URL(e,t);if(n.origin!==new URL(t).origin)return e;const r=n.href;return!e.endsWith("/")&&r.endsWith("/")?r.slice(0,-1):r}async function M_(e,t,n){try{const r=await x_(e,t,n),s=Wc("resource.fetch",r);$c(n.replay,s)}catch(r){C&&M.exception(r,"Failed to capture fetch breadcrumb")}}function A_(e,t){const{input:n,response:r}=t,s=n?nc(n):void 0,i=gr(s),o=r?zc(r.headers.get("content-length")):void 0;i!==void 0&&(e.data.request_body_size=i),o!==void 0&&(e.data.response_body_size=o)}async function x_(e,t,n){const r=Date.now(),{startTimestamp:s=r,endTimestamp:i=r}=t,{url:o,method:c,status_code:a=0,request_body_size:u,response_body_size:d}=e.data,l=Zn(o,n.networkDetailAllowUrls)&&!Zn(o,n.networkDetailDenyUrls),f=l?P_(n,t.input,u):Jt(u),p=await N_(l,n,t.response,d);return{startTimestamp:s,endTimestamp:i,url:o,method:c,statusCode:a,request:f,response:p}}function P_({networkCaptureBodies:e,networkRequestHeaders:t},n,r){const s=n?D_(n,t):{};if(!e)return qe(s,r,void 0);const i=nc(n),[o,c]=tc(i,M),a=qe(s,r,o);return c?Qn(a,c):a}async function N_(e,{networkCaptureBodies:t,networkResponseHeaders:n},r,s){if(!e&&s!==void 0)return Jt(s);const i=r?qc(r.headers,n):{};if(!r||!t&&s!==void 0)return qe(i,s,void 0);const[o,c]=await L_(r),a=O_(o,{networkCaptureBodies:t,responseBodySize:s,captureDetails:e,headers:i});return c?Qn(a,c):a}function O_(e,{networkCaptureBodies:t,responseBodySize:n,captureDetails:r,headers:s}){try{const i=e!=null&&e.length&&n===void 0?gr(e):n;return r?t?qe(s,i,e):qe(s,i,void 0):Jt(i)}catch(i){return C&&M.exception(i,"Failed to serialize response body"),qe(s,n,void 0)}}async function L_(e){const t=F_(e);if(!t)return[void 0,"BODY_PARSE_ERROR"];try{return[await B_(t)]}catch(n){return n instanceof Error&&n.message.indexOf("Timeout")>-1?(C&&M.warn("Parsing text body from response timed out"),[void 0,"BODY_PARSE_TIMEOUT"]):(C&&M.exception(n,"Failed to get text body from response"),[void 0,"BODY_PARSE_ERROR"])}}function qc(e,t){const n={};return t.forEach(r=>{e.get(r)&&(n[r]=e.get(r))}),n}function D_(e,t){return e.length===1&&typeof e[0]!="string"?yo(e[0],t):e.length===2?yo(e[1],t):{}}function yo(e,t){if(!e)return{};const n=e.headers;return n?n instanceof Headers?qc(n,t):Array.isArray(n)?{}:as(n,t):{}}function F_(e){try{return e.clone()}catch(t){C&&M.exception(t,"Failed to clone response body")}}function B_(e){return new Promise((t,n)=>{const r=cn(()=>n(new Error("Timeout while trying to read response body")),500);H_(e).then(s=>t(s),s=>n(s)).finally(()=>clearTimeout(r))})}async function H_(e){return await e.text()}async function U_(e,t,n){try{const r=z_(e,t,n),s=Wc("resource.xhr",r);$c(n.replay,s)}catch(r){C&&M.exception(r,"Failed to capture xhr breadcrumb")}}function $_(e,t){const{xhr:n,input:r}=t;if(!n)return;const s=gr(r),i=n.getResponseHeader("content-length")?zc(n.getResponseHeader("content-length")):j_(n.response,n.responseType);s!==void 0&&(e.data.request_body_size=s),i!==void 0&&(e.data.response_body_size=i)}function z_(e,t,n){const r=Date.now(),{startTimestamp:s=r,endTimestamp:i=r,input:o,xhr:c}=t,{url:a,method:u,status_code:d=0,request_body_size:l,response_body_size:f}=e.data;if(!a)return null;if(!c||!Zn(a,n.networkDetailAllowUrls)||Zn(a,n.networkDetailDenyUrls)){const x=Jt(l),S=Jt(f);return{startTimestamp:s,endTimestamp:i,url:a,method:u,statusCode:d,request:x,response:S}}const p=c[tt],h=p?as(p.request_headers,n.networkRequestHeaders):{},g=as(rc(c),n.networkResponseHeaders),[_,y]=n.networkCaptureBodies?tc(o,M):[void 0],[T,O]=n.networkCaptureBodies?W_(c):[void 0],L=qe(h,l,_),q=qe(g,f,T);return{startTimestamp:s,endTimestamp:i,url:a,method:u,statusCode:d,request:y?Qn(L,y):L,response:O?Qn(q,O):q}}function W_(e){const t=[];try{return[e.responseText]}catch(n){t.push(n)}try{return q_(e.response,e.responseType)}catch(n){t.push(n)}return C&&M.warn("Failed to get xhr response body",...t),[void 0]}function q_(e,t){try{if(typeof e=="string")return[e];if(e instanceof Document)return[e.body.outerHTML];if(t==="json"&&e&&typeof e=="object")return[JSON.stringify(e)];if(!e)return[void 0]}catch(n){return C&&M.exception(n,"Failed to serialize body",e),[void 0,"BODY_PARSE_ERROR"]}return C&&M.log("Skipping network body because of body type",e),[void 0,"UNPARSEABLE_BODY_TYPE"]}function j_(e,t){try{const n=t==="json"&&e&&typeof e=="object"?JSON.stringify(e):e;return gr(n)}catch{return}}function V_(e){const t=z();try{const{networkDetailAllowUrls:n,networkDetailDenyUrls:r,networkCaptureBodies:s,networkRequestHeaders:i,networkResponseHeaders:o}=e.getOptions(),c={replay:e,networkDetailAllowUrls:n,networkDetailDenyUrls:r,networkCaptureBodies:s,networkRequestHeaders:i,networkResponseHeaders:o};t&&t.on("beforeAddBreadcrumb",(a,u)=>G_(c,a,u))}catch{}}function G_(e,t,n){if(t.data)try{Y_(t)&&K_(n)&&($_(t,n),U_(t,n,e)),J_(t)&&X_(n)&&(A_(t,n),M_(t,n,e))}catch(r){C&&M.exception(r,"Error when enriching network breadcrumb")}}function Y_(e){return e.category==="xhr"}function J_(e){return e.category==="fetch"}function K_(e){return e==null?void 0:e.xhr}function X_(e){return e==null?void 0:e.response}function Q_(e){const t=z();Qa(Mg(e)),lr(I_(e)),m_(e),V_(e);const n=v_(e);Ou(n),t&&(t.on("beforeSendEvent",p_(e)),t.on("afterSendEvent",l_(e)),t.on("createDsc",r=>{const s=e.getSessionId();s&&e.isEnabled()&&e.recordingMode==="session"&&e.checkAndHandleExpiredSession()&&(r.replay_id=s)}),t.on("spanStart",r=>{e.lastActiveSpan=r}),t.on("spanEnd",r=>{e.lastActiveSpan=r}),t.on("beforeSendFeedback",async(r,s)=>{var o;const i=e.getSessionId();s!=null&&s.includeReplay&&e.isEnabled()&&i&&((o=r.contexts)!=null&&o.feedback)&&(r.contexts.feedback.source==="api"&&await e.sendBufferedReplayOrFlush(),r.contexts.feedback.replay_id=i)}),t.on("openFeedbackWidget",async()=>{await e.sendBufferedReplayOrFlush()}))}async function Z_(e){try{return Promise.all(mr(e,[eS(te.performance.memory)]))}catch{return[]}}function eS(e){const{jsHeapSizeLimit:t,totalJSHeapSize:n,usedJSHeapSize:r}=e,s=Date.now()/1e3;return{type:"memory",name:"memory",start:s,end:s,data:{memory:{jsHeapSizeLimit:t,totalJSHeapSize:n,usedJSHeapSize:r}}}}function tS(e,t,n){return ld(e,t,{...n,setTimeoutImpl:cn})}const Ie=Q.navigator;function nS(){return/iPhone|iPad|iPod/i.test((Ie==null?void 0:Ie.userAgent)??"")||/Macintosh/i.test((Ie==null?void 0:Ie.userAgent)??"")&&(Ie!=null&&Ie.maxTouchPoints)&&(Ie==null?void 0:Ie.maxTouchPoints)>1?{sampling:{mousemove:!1}}:{}}function rS(e){let t=!1;return(n,r)=>{if(!e.checkAndHandleExpiredSession()){C&&M.warn("Received replay event after session expired.");return}const s=r||!t;t=!0,e.clickDetector&&Ig(e.clickDetector,n),e.addUpdate(()=>{if(e.recordingMode==="buffer"&&s&&e.setInitialState(),!Js(e,n,s))return!0;if(!s)return!1;const i=e.session;if(iS(e,s),e.recordingMode==="buffer"&&i&&e.eventBuffer&&!i.dirty){const o=e.eventBuffer.getEarliestTimestamp();o&&(C&&M.log(`Updating session start time to earliest event in buffer to ${new Date(o)}`),i.started=o,e.getOptions().stickySession&&hr(i))}return i!=null&&i.previousSessionId||e.recordingMode==="session"&&e.flush(),!0})}}function sS(e){const t=e.getOptions();return{type:D.Custom,timestamp:Date.now(),data:{tag:"options",payload:{shouldRecordCanvas:e.isRecordingCanvas(),sessionSampleRate:t.sessionSampleRate,errorSampleRate:t.errorSampleRate,useCompressionOption:t.useCompression,blockAllMedia:t.blockAllMedia,maskAllText:t.maskAllText,maskAllInputs:t.maskAllInputs,useCompression:e.eventBuffer?e.eventBuffer.type==="worker":!1,networkDetailHasUrls:t.networkDetailAllowUrls.length>0,networkCaptureBodies:t.networkCaptureBodies,networkRequestHasHeaders:t.networkRequestHeaders.length>0,networkResponseHasHeaders:t.networkResponseHeaders.length>0}}}}function iS(e,t){!t||!e.session||e.session.segmentId!==0||Js(e,sS(e),!1)}function oS(e){if(!e)return null;try{return e.nodeType===e.ELEMENT_NODE?e:e.parentElement}catch{return null}}function aS(e,t,n,r){return $e(aa(e,or(e),r,n),[[{type:"replay_event"},e],[{type:"replay_recording",length:typeof t=="string"?new TextEncoder().encode(t).length:t.length},t]])}function cS({recordingData:e,headers:t}){let n;const r=`${JSON.stringify(t)}
23
- `;if(typeof e=="string")n=`${r}${e}`;else{const i=new TextEncoder().encode(r);n=new Uint8Array(i.length+e.length),n.set(i),n.set(e,i.length)}return n}async function uS({client:e,scope:t,replayId:n,event:r}){const s=typeof e._integrations=="object"&&e._integrations!==null&&!Array.isArray(e._integrations)?Object.keys(e._integrations):void 0,i={event_id:n,integrations:s};e.emit("preprocessEvent",r,i);const o=await Yo(e.getOptions(),r,i,t,e,Mt());if(!o)return null;e.emit("postprocessEvent",o,i),o.platform=o.platform||"javascript";const c=e.getSdkMetadata(),{name:a,version:u,settings:d}=(c==null?void 0:c.sdk)||{};return o.sdk={...o.sdk,name:a||"sentry.javascript.unknown",version:u||"0.0.0",settings:d},o}async function lS({recordingData:e,replayId:t,segmentId:n,eventContext:r,timestamp:s,session:i}){const o=cS({recordingData:e,headers:{segment_id:n}}),{urls:c,errorIds:a,traceIds:u,initialTimestamp:d}=r,l=z(),f=ne(),p=l==null?void 0:l.getTransport(),h=l==null?void 0:l.getDsn();if(!l||!p||!h||!i.sampled)return Promise.resolve({});const g={type:Uh,replay_start_timestamp:d/1e3,timestamp:s/1e3,error_ids:a,trace_ids:u,urls:c,replay_id:t,segment_id:n,replay_type:i.sampled},_=await uS({scope:f,client:l,replayId:t,event:g});if(!_)return l.recordDroppedEvent("event_processor","replay"),C&&M.log("An event processor returned `null`, will not send event."),Promise.resolve({});delete _.sdkProcessingMetadata;const y=aS(_,o,h,l.getOptions().tunnel);let T;try{T=await p.send(y)}catch(L){const q=new Error(Fs);try{q.cause=L}catch{}throw q}if(typeof T.statusCode=="number"&&(T.statusCode<200||T.statusCode>=300))throw new jc(T.statusCode);const O=ya({},T);if(Sa(O,"replay"))throw new Xs(O);return T}class jc extends Error{constructor(t){super(`Transport returned status code ${t}`)}}class Xs extends Error{constructor(t){super("Rate limit hit"),this.rateLimits=t}}async function Vc(e,t={count:0,interval:Vh}){const{recordingData:n,onError:r}=e;if(n.length)try{return await lS(e),!0}catch(s){if(s instanceof jc||s instanceof Xs)throw s;if(ra("Replays",{_retryCount:t.count}),r&&r(s),t.count>=Gh){const i=new Error(`${Fs} - max retries exceeded`);try{i.cause=s}catch{}throw i}return t.interval*=++t.count,new Promise((i,o)=>{cn(async()=>{try{await Vc(e,t),i(!0)}catch(c){o(c)}},t.interval)})}}const Gc="__THROTTLED",dS="__SKIPPED";function fS(e,t,n){const r=new Map,s=c=>{const a=c-n;r.forEach((u,d)=>{d<a&&r.delete(d)})},i=()=>[...r.values()].reduce((c,a)=>c+a,0);let o=!1;return(...c)=>{const a=Math.floor(Date.now()/1e3);if(s(a),i()>=t){const d=o;return o=!0,d?dS:Gc}o=!1;const u=r.get(a)||0;return r.set(a,u+1),e(...c)}}class pS{constructor({options:t,recordingOptions:n}){this.eventBuffer=null,this.performanceEntries=[],this.replayPerformanceEntries=[],this.recordingMode="session",this.timeouts={sessionIdlePause:$h,sessionIdleExpire:zh},this._lastActivity=Date.now(),this._isEnabled=!1,this._isPaused=!1,this._requiresManualStart=!1,this._hasInitializedCoreListeners=!1,this._context={errorIds:new Set,traceIds:new Set,urls:[],initialTimestamp:Date.now(),initialUrl:""},this._recordingOptions=n,this._options=t,this._debouncedFlush=tS(()=>this._flush(),this._options.flushMinDelay,{maxWait:this._options.flushMaxDelay}),this._throttledAddEvent=fS((o,c)=>a_(this,o,c),300,5);const{slowClickTimeout:r,slowClickIgnoreSelectors:s}=this.getOptions(),i=r?{threshold:Math.min(Yh,r),timeout:r,scrollTimeout:Jh,ignoreSelector:s?s.join(","):""}:void 0;if(i&&(this.clickDetector=new Eg(this,i)),C){const o=t._experiments;M.setConfig({captureExceptions:!!o.captureExceptions,traceInternals:!!o.traceInternals})}this._handleVisibilityChange=()=>{te.document.visibilityState==="visible"?this._doChangeToForegroundTasks():this._doChangeToBackgroundTasks()},this._handleWindowBlur=()=>{const o=Oe({category:"ui.blur"});this._doChangeToBackgroundTasks(o)},this._handleWindowFocus=()=>{const o=Oe({category:"ui.focus"});this._doChangeToForegroundTasks(o)},this._handleKeyboardEvent=o=>{Ng(this,o)}}getContext(){return this._context}isEnabled(){return this._isEnabled}isPaused(){return this._isPaused}isRecordingCanvas(){return!!this._canvas}getOptions(){return this._options}handleException(t){C&&M.exception(t),this._options.onError&&this._options.onError(t)}initializeSampling(t){const{errorSampleRate:n,sessionSampleRate:r}=this._options,s=n<=0&&r<=0;if(this._requiresManualStart=s,!s){if(this._initializeSessionForSampling(t),!this.session){C&&M.exception(new Error("Unable to initialize and create session"));return}this.session.sampled!==!1&&(this.recordingMode=this.session.sampled==="buffer"&&this.session.segmentId===0?"buffer":"session",C&&M.infoTick(`Starting replay in ${this.recordingMode} mode`),this._initializeRecording())}}start(){if(this._isEnabled&&this.recordingMode==="session"){C&&M.log("Recording is already in progress");return}if(this._isEnabled&&this.recordingMode==="buffer"){C&&M.log("Buffering is in progress, call `flush()` to save the replay");return}C&&M.infoTick("Starting replay in session mode"),this._updateUserActivity();const t=Br({maxReplayDuration:this._options.maxReplayDuration,sessionIdleExpire:this.timeouts.sessionIdleExpire},{stickySession:this._options.stickySession,sessionSampleRate:1,allowBuffering:!1});this.session=t,this.recordingMode="session",this._initializeRecording()}startBuffering(){if(this._isEnabled){C&&M.log("Buffering is in progress, call `flush()` to save the replay");return}C&&M.infoTick("Starting replay in buffer mode");const t=Br({sessionIdleExpire:this.timeouts.sessionIdleExpire,maxReplayDuration:this._options.maxReplayDuration},{stickySession:this._options.stickySession,sessionSampleRate:0,allowBuffering:!0});this.session=t,this.recordingMode="buffer",this._initializeRecording()}startRecording(){try{const t=this._canvas;this._stopRecording=Be({...this._recordingOptions,...this.recordingMode==="buffer"?{checkoutEveryNms:jh}:this._options._experiments.continuousCheckout&&{checkoutEveryNms:Math.max(36e4,this._options._experiments.continuousCheckout)},emit:rS(this),...nS(),onMutation:this._onMutationHandler.bind(this),...t?{recordCanvas:t.recordCanvas,getCanvasManager:t.getCanvasManager,sampling:t.sampling,dataURLOptions:t.dataURLOptions}:{}})}catch(t){this.handleException(t)}}stopRecording(){try{return this._stopRecording&&(this._stopRecording(),this._stopRecording=void 0),!0}catch(t){return this.handleException(t),!1}}async stop({forceFlush:t=!1,reason:n}={}){var r;if(this._isEnabled){this._isEnabled=!1,this.recordingMode="buffer";try{C&&M.log(`Stopping Replay${n?` triggered by ${n}`:""}`),Uc(),this._removeListeners(),this.stopRecording(),this._debouncedFlush.cancel(),t&&await this._flush({force:!0}),(r=this.eventBuffer)==null||r.destroy(),this.eventBuffer=null,n_(this)}catch(s){this.handleException(s)}}}pause(){this._isPaused||(this._isPaused=!0,this.stopRecording(),C&&M.log("Pausing replay"))}resume(){!this._isPaused||!this._checkSession()||(this._isPaused=!1,this.startRecording(),C&&M.log("Resuming replay"))}async sendBufferedReplayOrFlush({continueRecording:t=!0}={}){if(this.recordingMode==="session")return this.flushImmediate();const n=Date.now();C&&M.log("Converting buffer to session"),await this.flushImmediate();const r=this.stopRecording();!t||!r||this.recordingMode!=="session"&&(this.recordingMode="session",this.session&&(this.session.dirty=!1,this._updateUserActivity(n),this._updateSessionActivity(n),this._maybeSaveSession()),this.startRecording())}addUpdate(t){const n=t();this.recordingMode==="buffer"||!this._isEnabled||n!==!0&&this._debouncedFlush()}triggerUserActivity(){if(this._updateUserActivity(),!this._stopRecording){if(!this._checkSession())return;this.resume();return}this.checkAndHandleExpiredSession(),this._updateSessionActivity()}updateUserActivity(){this._updateUserActivity(),this._updateSessionActivity()}conditionalFlush(){return this.recordingMode==="buffer"?Promise.resolve():this.flushImmediate()}flush(){return this._debouncedFlush()}flushImmediate(){return this._debouncedFlush(),this._debouncedFlush.flush()}cancelFlush(){this._debouncedFlush.cancel()}getSessionId(t){var n,r;if(!(t&&((n=this.session)==null?void 0:n.sampled)===!1))return(r=this.session)==null?void 0:r.id}checkAndHandleExpiredSession(){if(this._lastActivity&&is(this._lastActivity,this.timeouts.sessionIdlePause)&&this.session&&this.session.sampled==="session"){this.pause();return}return!!this._checkSession()}setInitialState(){const t=`${te.location.pathname}${te.location.hash}${te.location.search}`,n=`${te.location.origin}${t}`;this.performanceEntries=[],this.replayPerformanceEntries=[],this._clearContext(),this._context.initialUrl=n,this._context.initialTimestamp=Date.now(),this._context.urls.push(n)}throttledAddEvent(t,n){const r=this._throttledAddEvent(t,n);if(r===Gc){const s=Oe({category:"replay.throttled"});this.addUpdate(()=>!Js(this,{type:pg,timestamp:s.timestamp||0,data:{tag:"breadcrumb",payload:s,metric:!0}}))}return r}getCurrentRoute(){const t=this.lastActiveSpan||de(),n=t&&le(t),s=(n&&$(n).data||{})[Ae];if(!(!n||!s||!["route","custom"].includes(s)))return $(n).description}_initializeRecording(){this.setInitialState(),this._updateSessionActivity(),this.eventBuffer=Zg({useCompression:this._options.useCompression,workerUrl:this._options.workerUrl}),this._removeListeners(),this._addListeners(),this._isEnabled=!0,this._isPaused=!1,this.startRecording()}_initializeSessionForSampling(t){const n=this._options.errorSampleRate>0,r=Br({sessionIdleExpire:this.timeouts.sessionIdleExpire,maxReplayDuration:this._options.maxReplayDuration,previousSessionId:t},{stickySession:this._options.stickySession,sessionSampleRate:this._options.sessionSampleRate,allowBuffering:n});this.session=r}_checkSession(){if(!this.session)return!1;const t=this.session;return Dc(t,{sessionIdleExpire:this.timeouts.sessionIdleExpire,maxReplayDuration:this._options.maxReplayDuration})?(this._refreshSession(t),!1):!0}async _refreshSession(t){this._isEnabled&&(await this.stop({reason:"refresh session"}),this.initializeSampling(t.id))}_addListeners(){try{te.document.addEventListener("visibilitychange",this._handleVisibilityChange),te.addEventListener("blur",this._handleWindowBlur),te.addEventListener("focus",this._handleWindowFocus),te.addEventListener("keydown",this._handleKeyboardEvent),this.clickDetector&&this.clickDetector.addListeners(),this._hasInitializedCoreListeners||(Q_(this),this._hasInitializedCoreListeners=!0)}catch(t){this.handleException(t)}this._performanceCleanupCallback=Vg(this)}_removeListeners(){try{te.document.removeEventListener("visibilitychange",this._handleVisibilityChange),te.removeEventListener("blur",this._handleWindowBlur),te.removeEventListener("focus",this._handleWindowFocus),te.removeEventListener("keydown",this._handleKeyboardEvent),this.clickDetector&&this.clickDetector.removeListeners(),this._performanceCleanupCallback&&this._performanceCleanupCallback()}catch(t){this.handleException(t)}}_doChangeToBackgroundTasks(t){!this.session||Lc(this.session,{maxReplayDuration:this._options.maxReplayDuration,sessionIdleExpire:this.timeouts.sessionIdleExpire})||(t&&this._createCustomBreadcrumb(t),this.conditionalFlush())}_doChangeToForegroundTasks(t){if(!this.session)return;if(!this.checkAndHandleExpiredSession()){C&&M.log("Document has become active, but session has expired");return}t&&this._createCustomBreadcrumb(t)}_updateUserActivity(t=Date.now()){this._lastActivity=t}_updateSessionActivity(t=Date.now()){this.session&&(this.session.lastActivity=t,this._maybeSaveSession())}_createCustomBreadcrumb(t){this.addUpdate(()=>{this.throttledAddEvent({type:D.Custom,timestamp:t.timestamp||0,data:{tag:"breadcrumb",payload:t}})})}_addPerformanceEntries(){let t=Fg(this.performanceEntries).concat(this.replayPerformanceEntries);if(this.performanceEntries=[],this.replayPerformanceEntries=[],this._requiresManualStart){const n=this._context.initialTimestamp/1e3;t=t.filter(r=>r.start>=n)}return Promise.all(mr(this,t))}_clearContext(){this._context.errorIds.clear(),this._context.traceIds.clear(),this._context.urls=[]}_updateInitialTimestampFromEventBuffer(){const{session:t,eventBuffer:n}=this;if(!t||!n||this._requiresManualStart||t.segmentId)return;const r=n.getEarliestTimestamp();r&&r<this._context.initialTimestamp&&(this._context.initialTimestamp=r)}_popEventContext(){const t={initialTimestamp:this._context.initialTimestamp,initialUrl:this._context.initialUrl,errorIds:Array.from(this._context.errorIds),traceIds:Array.from(this._context.traceIds),urls:this._context.urls};return this._clearContext(),t}async _runFlush(){var n;const t=this.getSessionId();if(!this.session||!this.eventBuffer||!t){C&&M.error("No session or eventBuffer found to flush.");return}if(await this._addPerformanceEntries(),!!((n=this.eventBuffer)!=null&&n.hasEvents)&&(await Z_(this),!!this.eventBuffer&&t===this.getSessionId()))try{this._updateInitialTimestampFromEventBuffer();const r=Date.now();if(r-this._context.initialTimestamp>this._options.maxReplayDuration+3e4)throw new Error("Session is too long, not sending replay");const s=this._popEventContext(),i=this.session.segmentId++;this._maybeSaveSession();const o=await this.eventBuffer.finish();await Vc({replayId:t,recordingData:o,segmentId:i,eventContext:s,session:this.session,timestamp:r,onError:c=>this.handleException(c)})}catch(r){this.handleException(r),this.stop({reason:"sendReplay"});const s=z();if(s){const i=r instanceof Xs?"ratelimit_backoff":"send_error";s.recordDroppedEvent(i,"replay")}}}async _flush({force:t=!1}={}){if(!this._isEnabled&&!t)return;if(!this.checkAndHandleExpiredSession()){C&&M.error("Attempting to finish replay event after session expired.");return}if(!this.session)return;const n=this.session.started,s=Date.now()-n;this._debouncedFlush.cancel();const i=s<this._options.minReplayDuration,o=s>this._options.maxReplayDuration+5e3;if(i||o){C&&M.log(`Session duration (${Math.floor(s/1e3)}s) is too ${i?"short":"long"}, not sending replay.`),i&&this._debouncedFlush();return}const c=this.eventBuffer;c&&this.session.segmentId===0&&!c.hasCheckout&&C&&M.log("Flushing initial segment without checkout.");const a=!!this._flushLock;this._flushLock||(this._flushLock=this._runFlush());try{await this._flushLock}catch(u){this.handleException(u)}finally{this._flushLock=void 0,a&&this._debouncedFlush()}}_maybeSaveSession(){this.session&&this._options.stickySession&&hr(this.session)}_onMutationHandler(t){const{ignoreMutations:n}=this._options._experiments;if(n!=null&&n.length&&t.some(c=>{const a=oS(c.target),u=n.join(",");return a==null?void 0:a.matches(u)}))return!1;const r=t.length,s=this._options.mutationLimit,i=this._options.mutationBreadcrumbLimit,o=s&&r>s;if(r>i||o){const c=Oe({category:"replay.mutations",data:{count:r,limit:o}});this._createCustomBreadcrumb(c)}return o?(this.stop({reason:"mutationLimit",forceFlush:this.recordingMode==="session"}),!1):!0}}function Ot(e,t){return[...e,...t].join(",")}function hS({mask:e,unmask:t,block:n,unblock:r,ignore:s}){const i=["base","iframe[srcdoc]:not([src])"],o=Ot(e,[".sentry-mask","[data-sentry-mask]"]),c=Ot(t,[]);return{maskTextSelector:o,unmaskTextSelector:c,blockSelector:Ot(n,[".sentry-block","[data-sentry-block]",...i]),unblockSelector:Ot(r,[]),ignoreSelector:Ot(s,[".sentry-ignore","[data-sentry-ignore]",'input[type="file"]'])}}function mS({el:e,key:t,maskAttributes:n,maskAllText:r,privacyOptions:s,value:i}){return!r||s.unmaskTextSelector&&e.matches(s.unmaskTextSelector)?i:n.includes(t)||t==="value"&&e.tagName==="INPUT"&&["submit","button"].includes(e.getAttribute("type")||"")?i.replace(/[\S]/g,"*"):i}const Eo='img,image,svg,video,object,picture,embed,map,audio,link[rel="icon"],link[rel="apple-touch-icon"]',gS=["content-length","content-type","accept"],_S=Symbol.for("sentry__originalRequestBody");let bo=!1,vo=!1;function SS(){if(typeof Request>"u"||vo)return;const e=Request;try{const t=function(n,r){const s=new e(n,r);return(r==null?void 0:r.body)!=null&&(s[_S]=r.body),s};t.prototype=e.prototype,Q.Request=t,vo=!0}catch{}}const yS=(e=>new ES(e));class ES{constructor({flushMinDelay:t=Wh,flushMaxDelay:n=qh,minReplayDuration:r=Kh,maxReplayDuration:s=Qi,stickySession:i=!0,useCompression:o=!0,workerUrl:c,_experiments:a={},maskAllText:u=!0,maskAllInputs:d=!0,blockAllMedia:l=!0,mutationBreadcrumbLimit:f=750,mutationLimit:p=1e4,slowClickTimeout:h=7e3,slowClickIgnoreSelectors:g=[],networkDetailAllowUrls:_=[],networkDetailDenyUrls:y=[],networkCaptureBodies:T=!0,networkRequestHeaders:O=[],networkResponseHeaders:L=[],mask:q=[],maskAttributes:x=["title","placeholder","aria-label"],unmask:S=[],block:I=[],unblock:J=[],ignore:E=[],maskFn:w,beforeAddRecordingEvent:B,beforeErrorSampling:H,onError:N,attachRawBodyFromRequest:oe=!1}={}){this.name="Replay";const K=hS({mask:q,unmask:S,block:I,unblock:J,ignore:E});if(this._recordingOptions={maskAllInputs:d,maskAllText:u,maskInputOptions:{password:!0},maskTextFn:w,maskInputFn:w,maskAttributeFn:(X,b,j)=>mS({maskAttributes:x,maskAllText:u,privacyOptions:K,key:X,value:b,el:j}),...K,slimDOMOptions:"all",inlineStylesheet:!0,inlineImages:!1,collectFonts:!0,errorHandler:X=>{try{X.__rrweb__=!0}catch{}},recordCrossOriginIframes:!!a.recordCrossOriginIframes},this._initialOptions={flushMinDelay:t,flushMaxDelay:n,minReplayDuration:Math.min(r,Xh),maxReplayDuration:Math.min(s,Qi),stickySession:i,useCompression:o,workerUrl:c,blockAllMedia:l,maskAllInputs:d,maskAllText:u,mutationBreadcrumbLimit:f,mutationLimit:p,slowClickTimeout:h,slowClickIgnoreSelectors:g,networkDetailAllowUrls:_,networkDetailDenyUrls:y,networkCaptureBodies:T,networkRequestHeaders:To(O),networkResponseHeaders:To(L),beforeAddRecordingEvent:B,beforeErrorSampling:H,onError:N,attachRawBodyFromRequest:oe,_experiments:a},this._initialOptions.blockAllMedia&&(this._recordingOptions.blockSelector=this._recordingOptions.blockSelector?`${this._recordingOptions.blockSelector},${Eo}`:Eo,this._recordingOptions.ignoreCSSAttributes=new Set(["background-image"])),this._isInitialized&&jr())throw new Error("Multiple Sentry Session Replay instances are not supported");this._isInitialized=!0}get _isInitialized(){return bo}set _isInitialized(t){bo=t}afterAllSetup(t){!jr()||this._replay||(this._initialOptions.attachRawBodyFromRequest&&SS(),this._setup(t),this._initialize(t))}start(){this._replay&&this._replay.start()}startBuffering(){this._replay&&this._replay.startBuffering()}stop(){return this._replay?this._replay.stop({forceFlush:this._replay.recordingMode==="session"}):Promise.resolve()}flush(t){return this._replay?this._replay.isEnabled()?this._replay.sendBufferedReplayOrFlush(t):(this._replay.start(),Promise.resolve()):Promise.resolve()}getReplayId(t){var n;if((n=this._replay)!=null&&n.isEnabled())return this._replay.getSessionId(t)}getRecordingMode(){var t;if((t=this._replay)!=null&&t.isEnabled())return this._replay.recordingMode}_initialize(t){this._replay&&(this._maybeLoadFromReplayCanvasIntegration(t),this._replay.initializeSampling())}_setup(t){const n=bS(this._initialOptions,t);this._replay=new pS({options:n,recordingOptions:this._recordingOptions})}_maybeLoadFromReplayCanvasIntegration(t){try{const n=t.getIntegrationByName("ReplayCanvas");if(!n)return;this._replay._canvas=n.getOptions()}catch{}}}function bS(e,t){const n=t.getOptions(),r={sessionSampleRate:0,errorSampleRate:0,...e},s=zt(n.replaysSessionSampleRate),i=zt(n.replaysOnErrorSampleRate);return s==null&&i==null&&Zt(()=>{console.warn("Replay is disabled because neither `replaysSessionSampleRate` nor `replaysOnErrorSampleRate` are set.")}),s!=null&&(r.sessionSampleRate=s),i!=null&&(r.errorSampleRate=i),r}function To(e){return[...gS,...e.map(t=>t.toLowerCase())]}function vS(e){return e.split(",").some(t=>t.trim().startsWith("sentry-"))}function Yc(e){try{return new URL(e,F.location.origin).href}catch{return}}function TS(e){return e.entryType==="resource"&&"initiatorType"in e&&typeof e.nextHopProtocol=="string"&&(e.initiatorType==="fetch"||e.initiatorType==="xmlhttprequest")}function Jc(e){try{return new Headers(e)}catch{return}}const Io=new WeakMap,Hr=new Map,Kc={traceFetch:!0,traceXHR:!0,enableHTTPTimings:!0,trackFetchStreamPerformance:!1};function IS(e,t){const{traceFetch:n,traceXHR:r,trackFetchStreamPerformance:s,shouldCreateSpanForRequest:i,enableHTTPTimings:o,tracePropagationTargets:c,onRequestSpanStart:a,onRequestSpanEnd:u}={...Kc,...t},d=typeof i=="function"?i:h=>!0,l=h=>wS(h,c),f={},p=e.getOptions().propagateTraceparent;n&&(e.addEventProcessor(h=>(h.type==="transaction"&&h.spans&&h.spans.forEach(g=>{if(g.op==="http.client"){const _=Hr.get(g.span_id);_&&(g.timestamp=_/1e3,Hr.delete(g.span_id))}}),h)),s&&Kd(h=>{if(h.response){const g=Io.get(h.response);g&&h.endTimestamp&&Hr.set(g,h.endTimestamp)}}),Na(h=>{const g=Od(h,d,l,f,{propagateTraceparent:p,onRequestSpanEnd:u});if(h.response&&h.fetchData.__span&&Io.set(h.response,h.fetchData.__span),g){const _=Yc(h.fetchData.url),y=_?st(_).host:void 0;g.setAttributes({"http.url":_,"server.address":y}),o&&wo(g),a==null||a(g,{headers:h.headers})}})),r&&Za(h=>{var _;const g=kS(h,d,l,f,p,u);g&&(o&&wo(g),a==null||a(g,{headers:Jc((_=h.xhr.__sentry_xhr_v3__)==null?void 0:_.request_headers)}))})}function wo(e){const{url:t}=$(e).data;if(!t||typeof t!="string")return;const n=ct("resource",({entries:r})=>{r.forEach(s=>{TS(s)&&s.name.endsWith(t)&&(e.setAttributes(Xa(s)),setTimeout(n))})})}function wS(e,t){const n=en();if(n){let r,s;try{r=new URL(e,n),s=new URL(n).origin}catch{return!1}const i=r.origin===s;return t?Fe(r.toString(),t)||i&&Fe(r.pathname,t):i}else{const r=!!e.match(/^\/(?!\/)/);return t?Fe(e,t):r}}function kS(e,t,n,r,s,i){const o=e.xhr,c=o==null?void 0:o[tt];if(!o||o.__sentry_own_request__||!c)return;const{url:a,method:u}=c,d=xe()&&t(a);if(e.endTimestamp&&d){const y=o.__sentry_xhr_span_id__;if(!y)return;const T=r[y];T&&c.status_code!==void 0&&(Xo(T,c.status_code),T.end(),i==null||i(T,{headers:Jc(rc(o)),error:e.error}),delete r[y]);return}const l=Yc(a),f=st(l||a),p=rd(a),h=!!de(),g=d&&h?At({name:`${u} ${p}`,attributes:{url:a,type:"xhr","http.method":u,"http.url":l,"server.address":f==null?void 0:f.host,[ce]:"auto.http.browser",[Ue]:"http.client",...(f==null?void 0:f.search)&&{"http.query":f==null?void 0:f.search},...(f==null?void 0:f.hash)&&{"http.fragment":f==null?void 0:f.hash}}}):new Ge;o.__sentry_xhr_span_id__=g.spanContext().spanId,r[o.__sentry_xhr_span_id__]=g,n(a)&&RS(o,xe()&&h?g:void 0,s);const _=z();return _&&_.emit("beforeOutgoingRequestSpan",g,e),g}function RS(e,t,n){const{"sentry-trace":r,baggage:s,traceparent:i}=Ra({span:t,propagateTraceparent:n});r&&CS(e,r,s,i)}function CS(e,t,n,r){var i;const s=(i=e.__sentry_xhr_v3__)==null?void 0:i.request_headers;if(!(s!=null&&s["sentry-trace"]||!e.setRequestHeader))try{if(e.setRequestHeader("sentry-trace",t),r&&!(s!=null&&s.traceparent)&&e.setRequestHeader("traceparent",r),n){const o=s==null?void 0:s.baggage;(!o||!vS(o))&&e.setRequestHeader("baggage",n)}}catch{}}function MS(){F.document?F.document.addEventListener("visibilitychange",()=>{const e=de();if(!e)return;const t=le(e);if(F.document.hidden&&t){const n="cancelled",{op:r,status:s}=$(t);v&&m.log(`[Tracing] Transaction: ${n} -> since tab moved to the background, op: ${r}`),s||t.setStatus({code:vt,message:n}),t.setAttribute("sentry.cancellation_reason","document.hidden"),t.end()}}):v&&m.warn("[Tracing] Could not set up background tab detection due to lack of global document")}const AS=3600,Xc="sentry_previous_trace",xS="sentry.previous_trace";function PS(e,{linkPreviousTrace:t,consistentTraceSampling:n}){const r=t==="session-storage";let s=r?LS():void 0;e.on("spanStart",o=>{if(le(o)!==o)return;const c=ne().getPropagationContext();s=NS(s,o,c),r&&OS(s)});let i=!0;n&&e.on("beforeSampling",o=>{if(!s)return;const c=ne(),a=c.getPropagationContext();if(i&&a.parentSpanId){i=!1;return}c.setPropagationContext({...a,dsc:{...a.dsc,sample_rate:String(s.sampleRate),sampled:String(cs(s.spanContext))},sampleRand:s.sampleRand}),o.parentSampled=cs(s.spanContext),o.parentSampleRate=s.sampleRate,o.spanAttributes={...o.spanAttributes,[Du]:s.sampleRate}})}function NS(e,t,n){const r=$(t);function s(){var c,a;try{return Number((c=n.dsc)==null?void 0:c.sample_rate)??Number((a=r.data)==null?void 0:a[Wo])}catch{return 0}}const i={spanContext:t.spanContext(),startTimestamp:r.start_timestamp,sampleRate:s(),sampleRand:n.sampleRand};if(!e)return i;const o=e.spanContext;return o.traceId===r.trace_id?e:(Date.now()/1e3-e.startTimestamp<=AS&&(v&&m.log(`Adding previous_trace \`${JSON.stringify(o)}\` link to span \`${JSON.stringify({op:r.op,...t.spanContext()})}\``),t.addLink({context:o,attributes:{[Fu]:"previous_trace"}}),t.setAttribute(xS,`${o.traceId}-${o.spanId}-${cs(o)?1:0}`)),i)}function OS(e){try{F.sessionStorage.setItem(Xc,JSON.stringify(e))}catch(t){v&&m.warn("Could not store previous trace in sessionStorage",t)}}function LS(){var e;try{const t=(e=F.sessionStorage)==null?void 0:e.getItem(Xc);return JSON.parse(t)}catch{return}}function cs(e){return e.traceFlags===1}const DS="BrowserTracing",FS={...Rn,instrumentNavigation:!0,instrumentPageLoad:!0,markBackgroundSpan:!0,enableLongTask:!0,enableLongAnimationFrame:!0,enableInp:!0,enableElementTiming:!0,ignoreResourceSpans:[],ignorePerformanceApiSpans:[],detectRedirects:!0,linkPreviousTrace:"in-memory",consistentTraceSampling:!1,enableReportPageLoaded:!1,_experiments:{},...Kc},BS=((e={})=>{const t={name:void 0,source:void 0},n=F.document,{enableInp:r,enableElementTiming:s,enableLongTask:i,enableLongAnimationFrame:o,_experiments:{enableInteractions:c,enableStandaloneClsSpans:a,enableStandaloneLcpSpans:u},beforeStartSpan:d,idleTimeout:l,finalTimeout:f,childSpanTimeout:p,markBackgroundSpan:h,traceFetch:g,traceXHR:_,trackFetchStreamPerformance:y,shouldCreateSpanForRequest:T,enableHTTPTimings:O,ignoreResourceSpans:L,ignorePerformanceApiSpans:q,instrumentPageLoad:x,instrumentNavigation:S,detectRedirects:I,linkPreviousTrace:J,consistentTraceSampling:E,enableReportPageLoaded:w,onRequestSpanStart:B,onRequestSpanEnd:H}={...FS,...e};let N,oe,K;function X(b,j,k=!0){const G=j.op==="pageload",Z=j.name,re=d?d(j):j,Se=re.attributes||{};if(Z!==re.name&&(Se[Ae]="custom",re.attributes=Se),!k){const Le=ir();At({...re,startTime:Le}).end(Le);return}t.name=re.name,t.source=Se[Ae];const ye=fa(re,{idleTimeout:l,finalTimeout:f,childSpanTimeout:p,disableAutoFinish:G,beforeSpanEnd:Le=>{N==null||N(),ip(Le,{recordClsOnPageloadSpan:!a,recordLcpOnPageloadSpan:!u,ignoreResourceSpans:L,ignorePerformanceApiSpans:q}),Ro(b,void 0);const dt=ne(),dn=dt.getPropagationContext();dt.setPropagationContext({...dn,traceId:ye.spanContext().traceId,sampled:nr(ye),dsc:He(Le)}),G&&(K=void 0)},trimIdleSpanEndTimestamp:!w});G&&w&&(K=ye),Ro(b,ye);function lt(){n&&["interactive","complete"].includes(n.readyState)&&b.emit("idleSpanEnableAutoFinish",ye)}G&&!w&&n&&(n.addEventListener("readystatechange",()=>{lt()}),lt())}return{name:DS,setup(b){if(Gu(),N=Qf({recordClsStandaloneSpans:a||!1,recordLcpStandaloneSpans:u||!1,client:b}),r&&xp(),s&&_p(),o&&Q.PerformanceObserver&&PerformanceObserver.supportedEntryTypes&&PerformanceObserver.supportedEntryTypes.includes("long-animation-frame")?ep():i&&Zf(),c&&tp(),I&&n){const k=()=>{oe=ue()};addEventListener("click",k,{capture:!0}),addEventListener("keydown",k,{capture:!0,passive:!0})}function j(){const k=Kt(b);k&&!$(k).timestamp&&(v&&m.log(`[Tracing] Finishing current active span with op: ${$(k).op}`),k.setAttribute(Wt,"cancelled"),k.end())}b.on("startNavigationSpan",(k,G)=>{if(z()!==b)return;if(G!=null&&G.isRedirect){v&&m.warn("[Tracing] Detected redirect, navigation span will not be the root span, but a child span."),X(b,{op:"navigation.redirect",...k},!1);return}oe=void 0,j(),Mt().setPropagationContext({traceId:On(),sampleRand:Math.random(),propagationSpanId:xe()?void 0:Lt()});const Z=ne();Z.setPropagationContext({traceId:On(),sampleRand:Math.random(),propagationSpanId:xe()?void 0:Lt()}),Z.setSDKProcessingMetadata({normalizedRequest:void 0}),X(b,{op:"navigation",...k,parentSpan:null,forceTransaction:!0})}),b.on("startPageLoadSpan",(k,G={})=>{if(z()!==b)return;j();const Z=G.sentryTrace||ko("sentry-trace"),re=G.baggage||ko("baggage"),Se=Bu(Z,re),ye=ne();ye.setPropagationContext(Se),xe()||(ye.getPropagationContext().propagationSpanId=Lt()),ye.setSDKProcessingMetadata({normalizedRequest:gs()}),X(b,{op:"pageload",...k})}),b.on("endPageloadSpan",()=>{w&&K&&(K.setAttribute(Wt,"reportPageLoaded"),K.end())})},afterAllSetup(b){let j=en();if(J!=="off"&&PS(b,{linkPreviousTrace:J,consistentTraceSampling:E}),F.location){if(x){const k=fe();Qs(b,{name:F.location.pathname,startTime:k?k/1e3:void 0,attributes:{[Ae]:"url",[ce]:"auto.pageload.browser"}})}S&&lr(({to:k,from:G})=>{if(G===void 0&&(j==null?void 0:j.indexOf(k))!==-1){j=void 0;return}j=void 0;const Z=Is(k),re=Kt(b),Se=re&&I&&$S(re,oe);HS(b,{name:(Z==null?void 0:Z.pathname)||F.location.pathname,attributes:{[Ae]:"url",[ce]:"auto.navigation.browser"}},{url:k,isRedirect:Se})})}h&&MS(),c&&US(b,l,f,p,t),r&&Op(),IS(b,{traceFetch:g,traceXHR:_,trackFetchStreamPerformance:y,tracePropagationTargets:b.getOptions().tracePropagationTargets,shouldCreateSpanForRequest:T,enableHTTPTimings:O,onRequestSpanStart:B,onRequestSpanEnd:H})}}});function Qs(e,t,n){e.emit("startPageLoadSpan",t,n),ne().setTransactionName(t.name);const r=Kt(e);return r&&e.emit("afterStartPageLoadSpan",r),r}function HS(e,t,n){const{url:r,isRedirect:s}=n||{};e.emit("beforeStartNavigationSpan",t,{isRedirect:s}),e.emit("startNavigationSpan",t,{isRedirect:s});const i=ne();return i.setTransactionName(t.name),r&&!s&&i.setSDKProcessingMetadata({normalizedRequest:{...gs(),url:r}}),Kt(e)}function ko(e){const t=F.document,n=t==null?void 0:t.querySelector(`meta[name=${e}]`);return(n==null?void 0:n.getAttribute("content"))||void 0}function US(e,t,n,r,s){const i=F.document;let o;const c=()=>{const a="ui.action.click",u=Kt(e);if(u){const d=$(u).op;if(["navigation","pageload"].includes(d)){v&&m.warn(`[Tracing] Did not create ${a} span because a pageload or navigation span is in progress.`);return}}if(o&&(o.setAttribute(Wt,"interactionInterrupted"),o.end(),o=void 0),!s.name){v&&m.warn(`[Tracing] Did not create ${a} transaction because _latestRouteName is missing.`);return}o=fa({name:s.name,op:a,attributes:{[Ae]:s.source||"url"}},{idleTimeout:t,finalTimeout:n,childSpanTimeout:r})};i&&addEventListener("click",c,{capture:!0})}const Qc="_sentry_idleSpan";function Kt(e){return e[Qc]}function Ro(e,t){Dn(e,Qc,t)}const Co=1.5;function $S(e,t){const n=$(e),r=ir(),s=n.start_timestamp;return!(r-s>Co||t&&r-t<=Co)}function Rt(e){return new Promise((t,n)=>{e.oncomplete=e.onsuccess=()=>t(e.result),e.onabort=e.onerror=()=>n(e.error)})}function zS(e,t){const n=indexedDB.open(e);n.onupgradeneeded=()=>n.result.createObjectStore(t);const r=Rt(n);return s=>r.then(i=>s(i.transaction(t,"readwrite").objectStore(t)))}function Zs(e){return Rt(e.getAllKeys())}function WS(e,t,n){return e(r=>Zs(r).then(s=>{if(!(s.length>=n))return r.put(t,Math.max(...s,0)+1),Rt(r.transaction)}))}function qS(e,t,n){return e(r=>Zs(r).then(s=>{if(!(s.length>=n))return r.put(t,Math.min(...s,0)-1),Rt(r.transaction)}))}function jS(e){return e(t=>Zs(t).then(n=>{const r=n[0];if(r!=null)return Rt(t.get(r)).then(s=>(t.delete(r),Rt(t.transaction).then(()=>s)))}))}function VS(e){let t;function n(){return t==null&&(t=zS(e.dbName||"sentry-offline",e.storeName||"queue")),t}return{push:async r=>{try{const s=await $n(r);await WS(n(),s,e.maxQueueSize||30)}catch{}},unshift:async r=>{try{const s=await $n(r);await qS(n(),s,e.maxQueueSize||30)}catch{}},shift:async()=>{try{const r=await jS(n());if(r)return Zu(r)}catch{}}}}function GS(e){return t=>{const n=e({...t,createStore:VS});return F.addEventListener("online",async r=>{await n.flush()}),n}}function YS(e=Ls){return GS(ed(e))}const Mo=1e6,JS="window"in Q&&Q.window===Q&&typeof importScripts>"u",je=String(0),er=JS?"main":"worker",we=F.navigator;let Zc="",eu="",tu="",us=(we==null?void 0:we.userAgent)||"",nu="";var Lo;const KS=(we==null?void 0:we.language)||((Lo=we==null?void 0:we.languages)==null?void 0:Lo[0])||"";function XS(e){return typeof e=="object"&&e!==null&&"getHighEntropyValues"in e}const Ao=we==null?void 0:we.userAgentData;XS(Ao)&&Ao.getHighEntropyValues(["architecture","model","platform","platformVersion","fullVersionList"]).then(e=>{var t;if(Zc=e.platform||"",tu=e.architecture||"",nu=e.model||"",eu=e.platformVersion||"",(t=e.fullVersionList)!=null&&t.length){const n=e.fullVersionList[e.fullVersionList.length-1];us=`${n.brand} ${n.version}`}}).catch(e=>{});function QS(e){return!("thread_metadata"in e)}function ZS(e){return QS(e)?iy(e):e}function ey(e){var n,r;const t=(r=(n=e.contexts)==null?void 0:n.trace)==null?void 0:r.trace_id;return typeof t=="string"&&t.length!==32&&v&&m.log(`[Profiling] Invalid traceId: ${t} on profiled event`),typeof t!="string"?"":t}function ty(e,t,n,r){if(r.type!=="transaction")throw new TypeError("Profiling events may only be attached to transactions, this should never occur.");if(n==null)throw new TypeError(`Cannot construct profiling event envelope without a valid profile. Got ${n} instead.`);const s=ey(r),i=ZS(n),o=t||(typeof r.start_timestamp=="number"?r.start_timestamp*1e3:ue()*1e3),c=typeof r.timestamp=="number"?r.timestamp*1e3:ue()*1e3;return{event_id:e,timestamp:new Date(o).toISOString(),platform:"javascript",version:"1",release:r.release||"",environment:r.environment||Go,runtime:{name:"javascript",version:F.navigator.userAgent},os:{name:Zc,version:eu,build_number:us},device:{locale:KS,model:nu,manufacturer:us,architecture:tu,is_emulator:!1},debug_meta:{images:su(n.resources)},profile:i,transactions:[{name:r.transaction||"",id:r.event_id||Pe(),trace_id:s,active_thread_id:je,relative_start_ns:"0",relative_end_ns:((c-o)*1e6).toFixed(0)}]}}function ny(e,t,n){var o,c;if(e==null)throw new TypeError(`Cannot construct profiling event envelope without a valid profile. Got ${e} instead.`);const r=sy(e),s=t.getOptions(),i=(c=(o=t.getSdkMetadata)==null?void 0:o.call(t))==null?void 0:c.sdk;return{chunk_id:Pe(),client_sdk:{name:(i==null?void 0:i.name)??"sentry.javascript.browser",version:(i==null?void 0:i.version)??"0.0.0"},profiler_id:n||Pe(),platform:"javascript",version:"2",release:s.release??"",environment:s.environment??"production",debug_meta:{images:su(e.resources)},profile:r}}function ry(e){try{if(!e||typeof e!="object")return{reason:"chunk is not an object"};const t=r=>typeof r=="string"&&/^[a-f0-9]{32}$/.test(r);if(!t(e.profiler_id))return{reason:"missing or invalid profiler_id"};if(!t(e.chunk_id))return{reason:"missing or invalid chunk_id"};if(!e.client_sdk)return{reason:"missing client_sdk metadata"};const n=e.profile;return n?!Array.isArray(n.frames)||!n.frames.length?{reason:"profile has no frames"}:!Array.isArray(n.stacks)||!n.stacks.length?{reason:"profile has no stacks"}:!Array.isArray(n.samples)||!n.samples.length?{reason:"profile has no samples"}:{valid:!0}:{reason:"missing profile data"}}catch(t){return{reason:`unknown validation error: ${t}`}}}function sy(e){const t=[];for(let c=0;c<e.frames.length;c++){const a=e.frames[c];a&&(t[c]={function:a.name,abs_path:typeof a.resourceId=="number"?e.resources[a.resourceId]:void 0,lineno:a.line,colno:a.column})}const n=[];for(let c=0;c<e.stacks.length;c++){const a=e.stacks[c];if(!a)continue;const u=[];let d=a;for(;d;)u.push(d.frameId),d=d.parentId===void 0?void 0:e.stacks[d.parentId];n[c]=u}const r=fe(),s=typeof performance.timeOrigin=="number"?performance.timeOrigin:r||0,i=s-(r||s),o=[];for(let c=0;c<e.samples.length;c++){const a=e.samples[c];if(!a)continue;const u=(s+(a.timestamp-i))/1e3;o[c]={stack_id:a.stackId??0,thread_id:je,timestamp:u}}return{frames:t,stacks:n,samples:o,thread_metadata:{[je]:{name:er}}}}function ru(e){return $(e).op==="pageload"}function iy(e){let t,n=0;const r={samples:[],stacks:[],frames:[],thread_metadata:{[je]:{name:er}}},s=e.samples[0];if(!s)return r;const i=s.timestamp,o=fe(),c=typeof performance.timeOrigin=="number"?performance.timeOrigin:o||0,a=c-(o||c);return e.samples.forEach((u,d)=>{if(u.stackId===void 0){t===void 0&&(t=n,r.stacks[t]=[],n++),r.samples[d]={elapsed_since_start_ns:((u.timestamp+a-i)*Mo).toFixed(0),stack_id:t,thread_id:je};return}let l=e.stacks[u.stackId];const f=[];for(;l;){f.push(l.frameId);const h=e.frames[l.frameId];h&&r.frames[l.frameId]===void 0&&(r.frames[l.frameId]={function:h.name,abs_path:typeof h.resourceId=="number"?e.resources[h.resourceId]:void 0,lineno:h.line,colno:h.column}),l=l.parentId===void 0?void 0:e.stacks[l.parentId]}const p={elapsed_since_start_ns:((u.timestamp+a-i)*Mo).toFixed(0),stack_id:n,thread_id:je};r.stacks[n]=f,r.samples[d]=p,n++}),r}function oy(e,t){if(!t.length)return e;for(const n of t)e[1].push([{type:"profile"},n]);return e}function ay(e){const t=[];return Hn(e,(n,r)=>{var s,i;if(r==="transaction")for(let o=1;o<n.length;o++){const c=n[o];(i=(s=c==null?void 0:c.contexts)==null?void 0:s.profile)!=null&&i.profile_id&&t.push(n[o])}}),t}function su(e){const t=z(),n=t==null?void 0:t.getOptions(),r=n==null?void 0:n.stackParser;return r?Hu(r,e):[]}function iu(e){return typeof e!="number"&&typeof e!="boolean"||typeof e=="number"&&isNaN(e)?(v&&m.warn(`[Profiling] Invalid sample rate. Sample rate must be a boolean or a number between 0 and 1. Got ${JSON.stringify(e)} of type ${JSON.stringify(typeof e)}.`),!1):e===!0||e===!1?!0:e<0||e>1?(v&&m.warn(`[Profiling] Invalid sample rate. Sample rate must be between 0 and 1. Got ${e}.`),!1):!0}function cy(e){return e.samples.length<2?(v&&m.log("[Profiling] Discarding profile because it contains less than 2 samples"),!1):e.frames.length?!0:(v&&m.log("[Profiling] Discarding profile because it contains no frames"),!1)}let ei=!1;const ou=3e4;function uy(e){return typeof e=="function"}function au(){const e=F.Profiler;if(!uy(e)){v&&m.log("[Profiling] Profiling is not supported by this browser, Profiler interface missing on window object.");return}const t=10,n=Math.floor(ou/t);try{return new e({sampleInterval:t,maxBufferSize:n})}catch{v&&(m.log("[Profiling] Failed to initialize the Profiling constructor, this is likely due to a missing 'Document-Policy': 'js-profiling' header."),m.log("[Profiling] Disabling profiling for current user session.")),ei=!0}}function xo(e){if(ei)return v&&m.log("[Profiling] Profiling has been disabled for the duration of the current user session."),!1;if(!e.isRecording())return v&&m.log("[Profiling] Discarding profile because root span was not sampled."),!1;const t=z(),n=t==null?void 0:t.getOptions();if(!n)return v&&m.log("[Profiling] Profiling disabled, no options found."),!1;const r=n.profilesSampleRate;return iu(r)?r?(r===!0?!0:Math.random()<r)?!0:(v&&m.log(`[Profiling] Discarding profile because it's not included in the random sample (sampling rate = ${Number(r)})`),!1):(v&&m.log("[Profiling] Discarding profile because a negative sampling decision was inherited or profileSampleRate is set to 0"),!1):(v&&m.warn("[Profiling] Discarding profile because of invalid sample rate."),!1)}function ly(e){if(ei)return v&&m.log("[Profiling] Profiling has been disabled for the duration of the current user session as the JS Profiler could not be started."),!1;if(e.profileLifecycle!=="trace"&&e.profileLifecycle!=="manual")return v&&m.warn("[Profiling] Session not sampled. Invalid `profileLifecycle` option."),!1;const t=e.profileSessionSampleRate;return iu(t)?t?Math.random()<=t:(v&&m.log("[Profiling] Discarding profile because profileSessionSampleRate is not defined or set to 0"),!1):(v&&m.warn("[Profiling] Discarding profile because of invalid profileSessionSampleRate."),!1)}function vn(e){return typeof e.profilesSampleRate<"u"}function dy(e,t,n,r){return cy(n)?ty(e,t,n,r):null}const rt=new Map;function fy(){return rt.size}function py(e){const t=rt.get(e);return t&&rt.delete(e),t}function hy(e,t){if(rt.set(e,t),rt.size>30){const n=rt.keys().next().value;n!==void 0&&rt.delete(n)}}function my(e){var t,n,r,s,i;return!((t=e==null?void 0:e.contexts)!=null&&t.profile)||!e.contexts||(e.contexts.trace={...((n=e.contexts)==null?void 0:n.trace)??{},data:{...((s=(r=e.contexts)==null?void 0:r.trace)==null?void 0:s.data)??{},"thread.id":je,"thread.name":er}},(i=e.spans)==null||i.forEach(o=>{o.data={...o.data||{},"thread.id":je,"thread.name":er}})),e}function Po(e){let t;ru(e)&&(t=ue()*1e3);const n=au();if(!n)return;v&&m.log(`[Profiling] started profiling span: ${$(e).description}`);const r=Pe();let s=null;ne().setContext("profile",{profile_id:r,start_timestamp:t});async function i(){if(e&&n){if(s){v&&m.log("[Profiling] profile for:",$(e).description,"already exists, returning early");return}return n.stop().then(u=>{if(o&&(F.clearTimeout(o),o=void 0),v&&m.log(`[Profiling] stopped profiling of span: ${$(e).description}`),!u){v&&m.log(`[Profiling] profiler returned null profile for: ${$(e).description}`,"this may indicate an overlapping span or a call to stopProfiling with a profile title that was never started");return}s=u,hy(r,u)}).catch(u=>{v&&m.log("[Profiling] error while stopping profiler:",u)})}}let o=F.setTimeout(()=>{v&&m.log("[Profiling] max profile duration elapsed, stopping profiling for:",$(e).description),i()},ou);const c=e.end.bind(e);function a(){return e?(i().then(()=>{c()},()=>{c()}),e):c()}e.end=a}const gy=6e4,_y=3e5;class Sy{constructor(){this._client=void 0,this._profiler=void 0,this._chunkTimer=void 0,this._profilerId=void 0,this._isRunning=!1,this._sessionSampled=!1,this._lifecycleMode=void 0,this._activeRootSpanIds=new Set,this._rootSpanTimeouts=new Map}initialize(t){const n=t.getOptions().profileLifecycle,r=ly(t.getOptions());v&&m.log(`[Profiling] Initializing profiler (lifecycle='${n}').`),r||v&&m.log("[Profiling] Session not sampled. Skipping lifecycle profiler initialization."),this._profilerId=Pe(),this._client=t,this._sessionSampled=r,this._lifecycleMode=n,n==="trace"&&this._setupTraceLifecycleListeners(t)}start(){if(this._lifecycleMode==="trace"){v&&m.warn('[Profiling] `profileLifecycle` is set to "trace". Calls to `uiProfiler.start()` are ignored in trace mode.');return}if(this._isRunning){v&&m.warn("[Profiling] Profile session is already running, `uiProfiler.start()` is a no-op.");return}if(!this._sessionSampled){v&&m.warn("[Profiling] Session is not sampled, `uiProfiler.start()` is a no-op.");return}this._beginProfiling()}stop(){if(this._lifecycleMode==="trace"){v&&m.warn('[Profiling] `profileLifecycle` is set to "trace". Calls to `uiProfiler.stop()` are ignored in trace mode.');return}if(!this._isRunning){v&&m.warn("[Profiling] Profiler is not running, `uiProfiler.stop()` is a no-op.");return}this._endProfiling()}notifyRootSpanActive(t){if(this._lifecycleMode!=="trace"||!this._sessionSampled)return;const n=t.spanContext().spanId;if(!n||this._activeRootSpanIds.has(n))return;this._registerTraceRootSpan(n);const r=this._activeRootSpanIds.size;r===1&&(v&&m.log("[Profiling] Detected already active root span during setup. Active root spans now:",r),this._beginProfiling())}_beginProfiling(){if(!this._isRunning){if(this._isRunning=!0,v&&m.log("[Profiling] Started profiling with profiler ID:",this._profilerId),wn().setContext("profile",{profiler_id:this._profilerId}),this._startProfilerInstance(),!this._profiler){v&&m.log("[Profiling] Failed to start JS Profiler; stopping."),this._resetProfilerInfo();return}this._startPeriodicChunking()}}_endProfiling(){this._isRunning&&(this._isRunning=!1,this._chunkTimer&&(clearTimeout(this._chunkTimer),this._chunkTimer=void 0),this._clearAllRootSpanTimeouts(),this._collectCurrentChunk().catch(t=>{v&&m.error("[Profiling] Failed to collect current profile chunk on `stop()`:",t)}),this._lifecycleMode==="manual"&&wn().setContext("profile",{}))}_setupTraceLifecycleListeners(t){t.on("spanStart",n=>{if(!this._sessionSampled){v&&m.log("[Profiling] Span not profiled because of negative sampling decision for user session.");return}if(n!==le(n))return;if(!n.isRecording()){v&&m.log("[Profiling] Discarding profile because root span was not sampled.");return}const r=n.spanContext().spanId;if(!r||this._activeRootSpanIds.has(r))return;this._registerTraceRootSpan(r);const s=this._activeRootSpanIds.size;s===1&&(v&&m.log(`[Profiling] Root span ${r} started. Profiling active while there are active root spans (count=${s}).`),this._beginProfiling())}),t.on("spanEnd",n=>{if(!this._sessionSampled)return;const r=n.spanContext().spanId;if(!r||!this._activeRootSpanIds.has(r))return;this._activeRootSpanIds.delete(r);const s=this._activeRootSpanIds.size;v&&m.log(`[Profiling] Root span with ID ${r} ended. Will continue profiling for as long as there are active root spans (currently: ${s}).`),s===0&&(this._collectCurrentChunk().catch(i=>{v&&m.error("[Profiling] Failed to collect current profile chunk on last `spanEnd`:",i)}),this._endProfiling())})}_resetProfilerInfo(){this._isRunning=!1,wn().setContext("profile",{})}_clearAllRootSpanTimeouts(){this._rootSpanTimeouts.forEach(t=>clearTimeout(t)),this._rootSpanTimeouts.clear()}_registerTraceRootSpan(t){this._activeRootSpanIds.add(t);const n=setTimeout(()=>this._onRootSpanTimeout(t),_y);this._rootSpanTimeouts.set(t,n)}_startProfilerInstance(){var n;if(((n=this._profiler)==null?void 0:n.stopped)===!1)return;const t=au();if(!t){v&&m.log("[Profiling] Failed to start JS Profiler.");return}this._profiler=t}_startPeriodicChunking(){this._isRunning&&(this._chunkTimer=setTimeout(()=>{if(this._collectCurrentChunk().catch(t=>{v&&m.error("[Profiling] Failed to collect current profile chunk during periodic chunking:",t)}),this._isRunning){if(this._startProfilerInstance(),!this._profiler){this._resetProfilerInfo();return}this._startPeriodicChunking()}},gy))}_onRootSpanTimeout(t){this._rootSpanTimeouts.has(t)&&(this._rootSpanTimeouts.delete(t),this._activeRootSpanIds.has(t)&&(v&&m.log(`[Profiling] Reached 5-minute timeout for root span ${t}. You likely started a manual root span that never called \`.end()\`.`),this._activeRootSpanIds.delete(t),this._activeRootSpanIds.size===0&&this._endProfiling()))}async _collectCurrentChunk(){const t=this._profiler;if(this._profiler=void 0,!!t)try{const n=await t.stop(),r=ny(n,this._client,this._profilerId),s=ry(r);if("reason"in s){v&&m.log("[Profiling] Discarding invalid profile chunk (this is probably a bug in the SDK):",s.reason);return}this._sendProfileChunk(r),v&&m.log("[Profiling] Collected browser profile chunk.")}catch(n){v&&m.log("[Profiling] Error while stopping JS Profiler for chunk:",n)}}_sendProfileChunk(t){var c;const n=this._client,r=or((c=n.getSdkMetadata)==null?void 0:c.call(n)),s=n.getDsn(),i=n.getOptions().tunnel,o=$e({event_id:Pe(),sent_at:new Date().toISOString(),...r&&{sdk:r},...!!i&&s&&{dsn:ut(s)}},[[{type:"profile_chunk"},t]]);n.sendEnvelope(o).then(null,a=>{v&&m.error("Error while sending profile chunk envelope:",a)})}}const yy="BrowserProfiling",Ey=(()=>({name:yy,setup(e){const t=e.getOptions(),n=new Sy;if(!vn(t)&&!t.profileLifecycle&&(t.profileLifecycle="manual"),vn(t)&&!t.profilesSampleRate){v&&m.log("[Profiling] Profiling disabled, no profiling options found.");return}const r=de(),s=r&&le(r);if(vn(t)&&t.profileSessionSampleRate!==void 0&&v&&m.warn("[Profiling] Both legacy profiling (`profilesSampleRate`) and UI profiling settings are defined. `profileSessionSampleRate` has no effect when legacy profiling is enabled."),vn(t))s&&ru(s)&&xo(s)&&Po(s),e.on("spanStart",i=>{i===le(i)&&xo(i)&&Po(i)}),e.on("beforeEnvelope",i=>{var a,u;if(!fy())return;const o=ay(i);if(!o.length)return;const c=[];for(const d of o){const l=d==null?void 0:d.contexts,f=(a=l==null?void 0:l.profile)==null?void 0:a.profile_id,p=(u=l==null?void 0:l.profile)==null?void 0:u.start_timestamp;if(typeof f!="string"){v&&m.log("[Profiling] cannot find profile for a span without a profile context");continue}if(!f){v&&m.log("[Profiling] cannot find profile for a span without a profile context");continue}l!=null&&l.profile&&delete l.profile;const h=py(f);if(!h){v&&m.log(`[Profiling] Could not retrieve profile for span: ${f}`);continue}const g=dy(f,p,h,d);g&&c.push(g)}oy(i,c)});else{const i=t.profileLifecycle;if(e.on("startUIProfiler",()=>n.start()),e.on("stopUIProfiler",()=>n.stop()),i==="manual")n.initialize(e);else if(i==="trace"){if(!xe(t)){v&&m.warn("[Profiling] `profileLifecycle` is 'trace' but tracing is disabled. Set a `tracesSampleRate` or `tracesSampler` to enable span tracing.");return}n.initialize(e),s&&n.notifyRootSpanActive(s),F.setTimeout(()=>{const o=de(),c=o&&le(o);c&&n.notifyRootSpanActive(c)},0)}}},processEvent(e){return my(e)}})),by=Ey;function vy(e){const t={...e};return ka(t,"react"),ra("react",{version:sa.version}),Hh(t)}const Ty=new WeakSet;function Iy(e,t){const n=BS({...e,instrumentPageLoad:!1,instrumentNavigation:!1}),{useEffect:r,useLocation:s,useNavigationType:i,createRoutesFromChildren:o,matchRoutes:c,stripBasename:a,enableAsyncRouteHandlers:u=!1,instrumentPageLoad:d=!0,instrumentNavigation:l=!0,lazyRouteTimeout:f}=e;return{...n,setup(p){n.setup(p);const h=e.finalTimeout??3e4,g=(e.idleTimeout??1e3)*3,_=f??g;_===1/0?vr&&m.log("[React Router] lazyRouteTimeout set to Infinity, capping at finalTimeout:",h,"ms to prevent indefinite hangs"):Number.isNaN(_)?vr&&m.warn("[React Router] lazyRouteTimeout must be a number, falling back to default:",g):_<0&&vr&&m.warn("[React Router] lazyRouteTimeout must be non-negative or Infinity, got:",_,"falling back to:",g)},afterAllSetup(p){var g;n.afterAllSetup(p);const h=(g=F.location)==null?void 0:g.pathname;d&&h&&Qs(p,{name:h,attributes:{[Ae]:"url",[Ue]:"pageload",[ce]:`auto.pageload.react.reactrouter_v${t}`}}),l&&Ty.add(p)}}}function wy(e){return Iy(e,"6")}var No={};const ky=No.CI==="true"||No.GITHUB_ACTIONS==="true",Ry="4.11.4",Cy={enabled:!0,environment:ky?"github-ci":"production",release:`spotlight@${Ry}`,tracesSampleRate:1,enableLogs:!0},My=["sentryTrace","baggage"];function Ay(e=!0){const t=[wy({instrumentPageLoad:e,useEffect:sa.useEffect,useLocation:qu,useNavigationType:Wu,createRoutesFromChildren:zu,matchRoutes:$u}),yS(),by(),Vd({levels:["log","info","warn","error","debug"]})],n=document.location.hash.slice(1);if(n.startsWith("spotlight")){const r=n.indexOf("="),s=r>-1?decodeURIComponent(n.slice(r+1)):void 0;t.push(Oh({sidecarUrl:s}))}return t}function Py(){const e=My.map(s=>[s,Uu(s)]),t=e.every(([,s])=>!!s),n=Ay(!t),r=vy({...Cy,transport:YS(Ls),dsn:"https://51bcd92dba1128934afd1c5726c84442@o1.ingest.us.sentry.io/4508404727283713",integrations:n,tracePropagationTargets:[/^\//,document.location.origin],profilesSampleRate:1,replaysSessionSampleRate:.01,replaysOnErrorSampleRate:1});t&&r&&Qs(r,{name:"pageload"},Object.fromEntries(e))}export{Py as default,Ay as getIntegrations};
22
+ or you can use record.mirror to access the mirror instance during recording.`;let ro={map:{},getId(){return console.error(dt),-1},getNode(){return console.error(dt),null},removeNodeFromMap(){console.error(dt)},has(){return console.error(dt),!1},reset(){console.error(dt)}};typeof window<"u"&&window.Proxy&&window.Reflect&&(ro=new Proxy(ro,{get(e,t,n){return t==="map"&&console.error(dt),Reflect.get(e,t,n)}}));function jt(e,t,n={}){let r=null,s=0;return function(...i){const o=Date.now();!s&&n.leading===!1&&(s=o);const c=t-(o-s),a=this;c<=0||c>t?(r&&(Lm(r),r=null),s=o,e.apply(a,i)):!r&&n.trailing!==!1&&(r=pr(()=>{s=n.leading===!1?0:Date.now(),r=null,e.apply(a,i)},c))}}function dc(e,t,n,r,s=window){const i=s.Object.getOwnPropertyDescriptor(e,t);return s.Object.defineProperty(e,t,r?n:{set(o){pr(()=>{n.set.call(this,o)},0),i&&i.set&&i.set.call(this,o)}}),()=>dc(e,t,i||{},!0)}function Hs(e,t,n){try{if(!(t in e))return()=>{};const r=e[t],s=n(r);return typeof s=="function"&&(s.prototype=s.prototype||{},Object.defineProperties(s,{__rrweb_original__:{enumerable:!1,value:r}})),e[t]=s,()=>{e[t]=r}}catch{return()=>{}}}let Yn=Date.now;/[1-9][0-9]{12}/.test(Date.now().toString())||(Yn=()=>new Date().getTime());function fc(e){const t=e.document;return{left:t.scrollingElement?t.scrollingElement.scrollLeft:e.pageXOffset!==void 0?e.pageXOffset:t?.documentElement.scrollLeft||t?.body?.parentElement?.scrollLeft||t?.body?.scrollLeft||0,top:t.scrollingElement?t.scrollingElement.scrollTop:e.pageYOffset!==void 0?e.pageYOffset:t?.documentElement.scrollTop||t?.body?.parentElement?.scrollTop||t?.body?.scrollTop||0}}function pc(){return window.innerHeight||document.documentElement&&document.documentElement.clientHeight||document.body&&document.body.clientHeight}function hc(){return window.innerWidth||document.documentElement&&document.documentElement.clientWidth||document.body&&document.body.clientWidth}function mc(e){if(!e)return null;try{return e.nodeType===e.ELEMENT_NODE?e:e.parentElement}catch{return null}}function Ee(e,t,n,r,s){if(!e)return!1;const i=mc(e);if(!i)return!1;const o=ht(t,n);if(!s){const u=r&&i.matches(r);return o(i)&&!u}const c=Ze(i,o);let a=-1;return c<0?!1:(r&&(a=Ze(i,ht(null,r))),c>-1&&a<0?!0:c<a)}function Mm(e,t){return t.getId(e)!==-1}function Nr(e,t){return t.getId(e)===qt}function gc(e,t){if(Dt(e))return!1;const n=t.getId(e);return t.has(n)?e.parentNode&&e.parentNode.nodeType===e.DOCUMENT_NODE?!1:e.parentNode?gc(e.parentNode,t):!0:!0}function es(e){return!!e.changedTouches}function Am(e=window){"NodeList"in e&&!e.NodeList.prototype.forEach&&(e.NodeList.prototype.forEach=Array.prototype.forEach),"DOMTokenList"in e&&!e.DOMTokenList.prototype.forEach&&(e.DOMTokenList.prototype.forEach=Array.prototype.forEach),Node.prototype.contains||(Node.prototype.contains=(...t)=>{let n=t[0];if(!(0 in t))throw new TypeError("1 argument is required");do if(this===n)return!0;while(n=n&&n.parentNode);return!1})}function _c(e,t){return!!(e.nodeName==="IFRAME"&&t.getMeta(e))}function Sc(e,t){return!!(e.nodeName==="LINK"&&e.nodeType===e.ELEMENT_NODE&&e.getAttribute&&e.getAttribute("rel")==="stylesheet"&&t.getMeta(e))}function ts(e){return!!e?.shadowRoot}class xm{constructor(){this.id=1,this.styleIDMap=new WeakMap,this.idStyleMap=new Map}getId(t){return this.styleIDMap.get(t)??-1}has(t){return this.styleIDMap.has(t)}add(t,n){if(this.has(t))return this.getId(t);let r;return n===void 0?r=this.id++:r=n,this.styleIDMap.set(t,r),this.idStyleMap.set(r,t),r}getStyle(t){return this.idStyleMap.get(t)||null}reset(){this.styleIDMap=new WeakMap,this.idStyleMap=new Map,this.id=1}generateId(){return this.id++}}function yc(e){let t=null;return e.getRootNode?.()?.nodeType===Node.DOCUMENT_FRAGMENT_NODE&&e.getRootNode().host&&(t=e.getRootNode().host),t}function Om(e){let t=e,n;for(;n=yc(t);)t=n;return t}function Nm(e){const t=e.ownerDocument;if(!t)return!1;const n=Om(e);return t.contains(n)}function Ec(e){const t=e.ownerDocument;return t?t.contains(e)||Nm(e):!1}const so={};function $s(e){const t=so[e];if(t)return t;const n=window.document;let r=window[e];if(n&&typeof n.createElement=="function")try{const s=n.createElement("iframe");s.hidden=!0,n.head.appendChild(s);const i=s.contentWindow;i&&i[e]&&(r=i[e]),n.head.removeChild(s)}catch{}return so[e]=r.bind(window)}function Pm(...e){return $s("requestAnimationFrame")(...e)}function pr(...e){return $s("setTimeout")(...e)}function Lm(...e){return $s("clearTimeout")(...e)}var L=(e=>(e[e.DomContentLoaded=0]="DomContentLoaded",e[e.Load=1]="Load",e[e.FullSnapshot=2]="FullSnapshot",e[e.IncrementalSnapshot=3]="IncrementalSnapshot",e[e.Meta=4]="Meta",e[e.Custom=5]="Custom",e[e.Plugin=6]="Plugin",e))(L||{}),x=(e=>(e[e.Mutation=0]="Mutation",e[e.MouseMove=1]="MouseMove",e[e.MouseInteraction=2]="MouseInteraction",e[e.Scroll=3]="Scroll",e[e.ViewportResize=4]="ViewportResize",e[e.Input=5]="Input",e[e.TouchMove=6]="TouchMove",e[e.MediaInteraction=7]="MediaInteraction",e[e.StyleSheetRule=8]="StyleSheetRule",e[e.CanvasMutation=9]="CanvasMutation",e[e.Font=10]="Font",e[e.Log=11]="Log",e[e.Drag=12]="Drag",e[e.StyleDeclaration=13]="StyleDeclaration",e[e.Selection=14]="Selection",e[e.AdoptedStyleSheet=15]="AdoptedStyleSheet",e[e.CustomElement=16]="CustomElement",e))(x||{}),he=(e=>(e[e.MouseUp=0]="MouseUp",e[e.MouseDown=1]="MouseDown",e[e.Click=2]="Click",e[e.ContextMenu=3]="ContextMenu",e[e.DblClick=4]="DblClick",e[e.Focus=5]="Focus",e[e.Blur=6]="Blur",e[e.TouchStart=7]="TouchStart",e[e.TouchMove_Departed=8]="TouchMove_Departed",e[e.TouchEnd=9]="TouchEnd",e[e.TouchCancel=10]="TouchCancel",e))(he||{}),Ne=(e=>(e[e.Mouse=0]="Mouse",e[e.Pen=1]="Pen",e[e.Touch=2]="Touch",e))(Ne||{}),ft=(e=>(e[e.Play=0]="Play",e[e.Pause=1]="Pause",e[e.Seeked=2]="Seeked",e[e.VolumeChange=3]="VolumeChange",e[e.RateChange=4]="RateChange",e))(ft||{});function Ws(e){try{return e.contentDocument}catch{}}function Dm(e){try{return e.contentWindow}catch{}}function io(e){return"__ln"in e}class Fm{constructor(){this.length=0,this.head=null,this.tail=null}get(t){if(t>=this.length)throw new Error("Position outside of list range");let n=this.head;for(let r=0;r<t;r++)n=n?.next||null;return n}addNode(t){const n={value:t,previous:null,next:null};if(t.__ln=n,t.previousSibling&&io(t.previousSibling)){const r=t.previousSibling.__ln.next;n.next=r,n.previous=t.previousSibling.__ln,t.previousSibling.__ln.next=n,r&&(r.previous=n)}else if(t.nextSibling&&io(t.nextSibling)&&t.nextSibling.__ln.previous){const r=t.nextSibling.__ln.previous;n.previous=r,n.next=t.nextSibling.__ln,t.nextSibling.__ln.previous=n,r&&(r.next=n)}else this.head&&(this.head.previous=n),n.next=this.head,this.head=n;n.next===null&&(this.tail=n),this.length++}removeNode(t){const n=t.__ln;this.head&&(n.previous?(n.previous.next=n.next,n.next?n.next.previous=n.previous:this.tail=n.previous):(this.head=n.next,this.head?this.head.previous=null:this.tail=null),t.__ln&&delete t.__ln,this.length--)}}const oo=(e,t)=>`${e}@${t}`;class Bm{constructor(){this.frozen=!1,this.locked=!1,this.texts=[],this.attributes=[],this.attributeMap=new WeakMap,this.removes=[],this.mapRemoves=[],this.movedMap={},this.addedSet=new Set,this.movedSet=new Set,this.droppedSet=new Set,this.processMutations=t=>{t.forEach(this.processMutation),this.emit()},this.emit=()=>{if(this.frozen||this.locked)return;const t=[],n=new Set,r=new Fm,s=a=>{let u=a,d=qt;for(;d===qt;)u=u&&u.nextSibling,d=u&&this.mirror.getId(u);return d},i=a=>{if(!a.parentNode||!Ec(a))return;const u=Dt(a.parentNode)?this.mirror.getId(yc(a)):this.mirror.getId(a.parentNode),d=s(a);if(u===-1||d===-1)return r.addNode(a);const l=mt(a,{doc:this.doc,mirror:this.mirror,blockClass:this.blockClass,blockSelector:this.blockSelector,maskAllText:this.maskAllText,unblockSelector:this.unblockSelector,maskTextClass:this.maskTextClass,unmaskTextClass:this.unmaskTextClass,maskTextSelector:this.maskTextSelector,unmaskTextSelector:this.unmaskTextSelector,skipChild:!0,newlyAddedElement:!0,inlineStylesheet:this.inlineStylesheet,maskInputOptions:this.maskInputOptions,maskAttributeFn:this.maskAttributeFn,maskTextFn:this.maskTextFn,maskInputFn:this.maskInputFn,slimDOMOptions:this.slimDOMOptions,dataURLOptions:this.dataURLOptions,recordCanvas:this.recordCanvas,inlineImages:this.inlineImages,onSerialize:f=>{_c(f,this.mirror)&&!Ee(f,this.blockClass,this.blockSelector,this.unblockSelector,!1)&&this.iframeManager.addIframe(f),Sc(f,this.mirror)&&this.stylesheetManager.trackLinkElement(f),ts(a)&&this.shadowDomManager.addShadowRoot(a.shadowRoot,this.doc)},onIframeLoad:(f,p)=>{Ee(f,this.blockClass,this.blockSelector,this.unblockSelector,!1)||(this.iframeManager.attachIframe(f,p),f.contentWindow&&this.canvasManager.addWindow(f.contentWindow),this.shadowDomManager.observeAttachShadow(f))},onStylesheetLoad:(f,p)=>{this.stylesheetManager.attachLinkElement(f,p)},onBlockedImageLoad:(f,p,{width:h,height:g})=>{this.mutationCb({adds:[],removes:[],texts:[],attributes:[{id:p.id,attributes:{style:{width:`${h}px`,height:`${g}px`}}}]})},ignoreCSSAttributes:this.ignoreCSSAttributes});l&&(t.push({parentId:u,nextId:d,node:l}),n.add(l.id))};for(;this.mapRemoves.length;)this.mirror.removeNodeFromMap(this.mapRemoves.shift());for(const a of this.movedSet)ao(this.removes,a,this.mirror)&&!this.movedSet.has(a.parentNode)||i(a);for(const a of this.addedSet)!co(this.droppedSet,a)&&!ao(this.removes,a,this.mirror)||co(this.movedSet,a)?i(a):this.droppedSet.add(a);let o=null;for(;r.length;){let a=null;if(o){const u=this.mirror.getId(o.value.parentNode),d=s(o.value);u!==-1&&d!==-1&&(a=o)}if(!a){let u=r.tail;for(;u;){const d=u;if(u=u.previous,d){const l=this.mirror.getId(d.value.parentNode);if(s(d.value)===-1)continue;if(l!==-1){a=d;break}else{const p=d.value;if(p.parentNode&&p.parentNode.nodeType===Node.DOCUMENT_FRAGMENT_NODE){const h=p.parentNode.host;if(this.mirror.getId(h)!==-1){a=d;break}}}}}}if(!a){for(;r.head;)r.removeNode(r.head.value);break}o=a.previous,r.removeNode(a.value),i(a.value)}const c={texts:this.texts.map(a=>({id:this.mirror.getId(a.node),value:a.value})).filter(a=>!n.has(a.id)).filter(a=>this.mirror.has(a.id)),attributes:this.attributes.map(a=>{const{attributes:u}=a;if(typeof u.style=="string"){const d=JSON.stringify(a.styleDiff),l=JSON.stringify(a._unchangedStyles);d.length<u.style.length&&(d+l).split("var(").length===u.style.split("var(").length&&(u.style=a.styleDiff)}return{id:this.mirror.getId(a.node),attributes:u}}).filter(a=>!n.has(a.id)).filter(a=>this.mirror.has(a.id)),removes:this.removes,adds:t};!c.texts.length&&!c.attributes.length&&!c.removes.length&&!c.adds.length||(this.texts=[],this.attributes=[],this.attributeMap=new WeakMap,this.removes=[],this.addedSet=new Set,this.movedSet=new Set,this.droppedSet=new Set,this.movedMap={},this.mutationCb(c))},this.processMutation=t=>{if(!Nr(t.target,this.mirror))switch(t.type){case"characterData":{const n=t.target.textContent;!Ee(t.target,this.blockClass,this.blockSelector,this.unblockSelector,!1)&&n!==t.oldValue&&this.texts.push({value:bt(t.target,this.maskTextClass,this.maskTextSelector,this.unmaskTextClass,this.unmaskTextSelector,this.maskAllText)&&n?this.maskTextFn?this.maskTextFn(n,mc(t.target)):n.replace(/[\S]/g,"*"):n,node:t.target});break}case"attributes":{const n=t.target;let r=t.attributeName,s=t.target.getAttribute(r);if(r==="value"){const o=Bs(n),c=n.tagName;s=Vn(n,c,o);const a=dr({maskInputOptions:this.maskInputOptions,tagName:c,type:o}),u=bt(t.target,this.maskTextClass,this.maskTextSelector,this.unmaskTextClass,this.unmaskTextSelector,a);s=zt({isMasked:u,element:n,value:s,maskInputFn:this.maskInputFn})}if(Ee(t.target,this.blockClass,this.blockSelector,this.unblockSelector,!1)||s===t.oldValue)return;let i=this.attributeMap.get(t.target);if(n.tagName==="IFRAME"&&r==="src"&&!this.keepIframeSrcFn(s))if(!Ws(n))r="rr_src";else return;if(i||(i={node:t.target,attributes:{},styleDiff:{},_unchangedStyles:{}},this.attributes.push(i),this.attributeMap.set(t.target,i)),r==="type"&&n.tagName==="INPUT"&&(t.oldValue||"").toLowerCase()==="password"&&n.setAttribute("data-rr-is-password","true"),!lc(n.tagName,r)&&(i.attributes[r]=uc(this.doc,Et(n.tagName),Et(r),s,n,this.maskAttributeFn),r==="style")){if(!this.unattachedDoc)try{this.unattachedDoc=document.implementation.createHTMLDocument()}catch{this.unattachedDoc=this.doc}const o=this.unattachedDoc.createElement("span");t.oldValue&&o.setAttribute("style",t.oldValue);for(const c of Array.from(n.style)){const a=n.style.getPropertyValue(c),u=n.style.getPropertyPriority(c);a!==o.style.getPropertyValue(c)||u!==o.style.getPropertyPriority(c)?u===""?i.styleDiff[c]=a:i.styleDiff[c]=[a,u]:i._unchangedStyles[c]=[a,u]}for(const c of Array.from(o.style))n.style.getPropertyValue(c)===""&&(i.styleDiff[c]=!1)}break}case"childList":{if(Ee(t.target,this.blockClass,this.blockSelector,this.unblockSelector,!0))return;t.addedNodes.forEach(n=>this.genAdds(n,t.target)),t.removedNodes.forEach(n=>{const r=this.mirror.getId(n),s=Dt(t.target)?this.mirror.getId(t.target.host):this.mirror.getId(t.target);Ee(t.target,this.blockClass,this.blockSelector,this.unblockSelector,!1)||Nr(n,this.mirror)||!Mm(n,this.mirror)||(this.addedSet.has(n)?(ns(this.addedSet,n),this.droppedSet.add(n)):this.addedSet.has(t.target)&&r===-1||gc(t.target,this.mirror)||(this.movedSet.has(n)&&this.movedMap[oo(r,s)]?ns(this.movedSet,n):this.removes.push({parentId:s,id:r,isShadow:Dt(t.target)&&Ft(t.target)?!0:void 0})),this.mapRemoves.push(n))});break}}},this.genAdds=(t,n)=>{if(!this.processedNodeManager.inOtherBuffer(t,this)&&!(this.addedSet.has(t)||this.movedSet.has(t))){if(this.mirror.hasNode(t)){if(Nr(t,this.mirror))return;this.movedSet.add(t);let r=null;n&&this.mirror.hasNode(n)&&(r=this.mirror.getId(n)),r&&r!==-1&&(this.movedMap[oo(this.mirror.getId(t),r)]=!0)}else this.addedSet.add(t),this.droppedSet.delete(t);Ee(t,this.blockClass,this.blockSelector,this.unblockSelector,!1)||(t.childNodes&&t.childNodes.forEach(r=>this.genAdds(r)),ts(t)&&t.shadowRoot.childNodes.forEach(r=>{this.processedNodeManager.add(r,this),this.genAdds(r,t)}))}}}init(t){["mutationCb","blockClass","blockSelector","unblockSelector","maskAllText","maskTextClass","unmaskTextClass","maskTextSelector","unmaskTextSelector","inlineStylesheet","maskInputOptions","maskAttributeFn","maskTextFn","maskInputFn","keepIframeSrcFn","recordCanvas","inlineImages","slimDOMOptions","dataURLOptions","doc","mirror","iframeManager","stylesheetManager","shadowDomManager","canvasManager","processedNodeManager","ignoreCSSAttributes"].forEach(n=>{this[n]=t[n]})}freeze(){this.frozen=!0,this.canvasManager.freeze()}unfreeze(){this.frozen=!1,this.canvasManager.unfreeze(),this.emit()}isFrozen(){return this.frozen}lock(){this.locked=!0,this.canvasManager.lock()}unlock(){this.locked=!1,this.canvasManager.unlock(),this.emit()}reset(){this.shadowDomManager.reset(),this.canvasManager.reset()}}function ns(e,t){e.delete(t),t.childNodes?.forEach(n=>ns(e,n))}function ao(e,t,n){return e.length===0?!1:Um(e,t,n)}function Um(e,t,n){let r=t.parentNode;for(;r;){const s=n.getId(r);if(e.some(i=>i.id===s))return!0;r=r.parentNode}return!1}function co(e,t){return e.size===0?!1:bc(e,t)}function bc(e,t){const{parentNode:n}=t;return n?e.has(n)?!0:bc(e,n):!1}let Bt;function Hm(e){Bt=e}function $m(){Bt=void 0}const W=e=>Bt?(...n)=>{try{return e(...n)}catch(r){if(Bt&&Bt(r)===!0)return()=>{};throw r}}:e,gt=[];function on(e){try{if("composedPath"in e){const t=e.composedPath();if(t.length)return t[0]}else if("path"in e&&e.path.length)return e.path[0]}catch{}return e&&e.target}function vc(e,t){const n=new Bm;gt.push(n),n.init(e);let r=window.MutationObserver||window.__rrMutationObserver;const s=window?.Zone?.__symbol__?.("MutationObserver");s&&window[s]&&(r=window[s]);const i=new r(W(o=>{e.onMutation&&e.onMutation(o)===!1||n.processMutations.bind(n)(o)}));return i.observe(t,{attributes:!0,attributeOldValue:!0,characterData:!0,characterDataOldValue:!0,childList:!0,subtree:!0}),i}function Wm({mousemoveCb:e,sampling:t,doc:n,mirror:r}){if(t.mousemove===!1)return()=>{};const s=typeof t.mousemove=="number"?t.mousemove:50,i=typeof t.mousemoveCallback=="number"?t.mousemoveCallback:500;let o=[],c;const a=jt(W(l=>{const f=Date.now()-c;e(o.map(p=>(p.timeOffset-=f,p)),l),o=[],c=null}),i),u=W(jt(W(l=>{const f=on(l),{clientX:p,clientY:h}=es(l)?l.changedTouches[0]:l;c||(c=Yn()),o.push({x:p,y:h,id:r.getId(f),timeOffset:Yn()-c}),a(typeof DragEvent<"u"&&l instanceof DragEvent?x.Drag:l instanceof MouseEvent?x.MouseMove:x.TouchMove)}),s,{trailing:!1})),d=[me("mousemove",u,n),me("touchmove",u,n),me("drag",u,n)];return W(()=>{d.forEach(l=>l())})}function zm({mouseInteractionCb:e,doc:t,mirror:n,blockClass:r,blockSelector:s,unblockSelector:i,sampling:o}){if(o.mouseInteraction===!1)return()=>{};const c=o.mouseInteraction===!0||o.mouseInteraction===void 0?{}:o.mouseInteraction,a=[];let u=null;const d=l=>f=>{const p=on(f);if(Ee(p,r,s,i,!0))return;let h=null,g=l;if("pointerType"in f){switch(f.pointerType){case"mouse":h=Ne.Mouse;break;case"touch":h=Ne.Touch;break;case"pen":h=Ne.Pen;break}h===Ne.Touch?he[l]===he.MouseDown?g="TouchStart":he[l]===he.MouseUp&&(g="TouchEnd"):Ne.Pen}else es(f)&&(h=Ne.Touch);h!==null?(u=h,(g.startsWith("Touch")&&h===Ne.Touch||g.startsWith("Mouse")&&h===Ne.Mouse)&&(h=null)):he[l]===he.Click&&(h=u,u=null);const S=es(f)?f.changedTouches[0]:f;if(!S)return;const y=n.getId(p),{clientX:T,clientY:B}=S;W(e)({type:he[g],id:y,x:T,y:B,...h!==null&&{pointerType:h}})};return Object.keys(he).filter(l=>Number.isNaN(Number(l))&&!l.endsWith("_Departed")&&c[l]!==!1).forEach(l=>{let f=Et(l);const p=d(l);if(window.PointerEvent)switch(he[l]){case he.MouseDown:case he.MouseUp:f=f.replace("mouse","pointer");break;case he.TouchStart:case he.TouchEnd:return}a.push(me(f,p,t))}),W(()=>{a.forEach(l=>l())})}function Tc({scrollCb:e,doc:t,mirror:n,blockClass:r,blockSelector:s,unblockSelector:i,sampling:o}){const c=W(jt(W(a=>{const u=on(a);if(!u||Ee(u,r,s,i,!0))return;const d=n.getId(u);if(u===t&&t.defaultView){const l=fc(t.defaultView);e({id:d,x:l.left,y:l.top})}else e({id:d,x:u.scrollLeft,y:u.scrollTop})}),o.scroll||100));return me("scroll",c,t)}function qm({viewportResizeCb:e},{win:t}){let n=-1,r=-1;const s=W(jt(W(()=>{const i=pc(),o=hc();(n!==i||r!==o)&&(e({width:Number(o),height:Number(i)}),n=i,r=o)}),200));return me("resize",s,t)}const jm=["INPUT","TEXTAREA","SELECT"],uo=new WeakMap;function Vm({inputCb:e,doc:t,mirror:n,blockClass:r,blockSelector:s,unblockSelector:i,ignoreClass:o,ignoreSelector:c,maskInputOptions:a,maskInputFn:u,sampling:d,userTriggeredOnInput:l,maskTextClass:f,unmaskTextClass:p,maskTextSelector:h,unmaskTextSelector:g}){function S(_){let I=on(_);const Y=_.isTrusted,E=I&&Qr(I.tagName);if(E==="OPTION"&&(I=I.parentElement),!I||!E||jm.indexOf(E)<0||Ee(I,r,s,i,!0))return;const k=I;if(k.classList.contains(o)||c&&k.matches(c))return;const F=Bs(I);let q=Vn(k,E,F),P=!1;const ce=dr({maskInputOptions:a,tagName:E,type:F}),J=bt(I,f,h,p,g,ce);(F==="radio"||F==="checkbox")&&(P=I.checked),q=zt({isMasked:J,element:I,value:q,maskInputFn:u}),y(I,l?{text:q,isChecked:P,userTriggered:Y}:{text:q,isChecked:P});const ee=I.name;F==="radio"&&ee&&P&&t.querySelectorAll(`input[type="radio"][name="${ee}"]`).forEach(b=>{if(b!==I){const G=zt({isMasked:J,element:b,value:Vn(b,E,F),maskInputFn:u});y(b,l?{text:G,isChecked:!P,userTriggered:!1}:{text:G,isChecked:!P})}})}function y(_,I){const Y=uo.get(_);if(!Y||Y.text!==I.text||Y.isChecked!==I.isChecked){uo.set(_,I);const E=n.getId(_);W(e)({...I,id:E})}}const B=(d.input==="last"?["change"]:["input","change"]).map(_=>me(_,W(S),t)),N=t.defaultView;if(!N)return()=>{B.forEach(_=>_())};const z=N.Object.getOwnPropertyDescriptor(N.HTMLInputElement.prototype,"value"),A=[[N.HTMLInputElement.prototype,"value"],[N.HTMLInputElement.prototype,"checked"],[N.HTMLSelectElement.prototype,"value"],[N.HTMLTextAreaElement.prototype,"value"],[N.HTMLSelectElement.prototype,"selectedIndex"],[N.HTMLOptionElement.prototype,"selected"]];return z&&z.set&&B.push(...A.map(_=>dc(_[0],_[1],{set(){W(S)({target:this,isTrusted:!1})}},!1,N))),W(()=>{B.forEach(_=>_())})}function Jn(e){const t=[];function n(r,s){if(gn("CSSGroupingRule")&&r.parentRule instanceof CSSGroupingRule||gn("CSSMediaRule")&&r.parentRule instanceof CSSMediaRule||gn("CSSSupportsRule")&&r.parentRule instanceof CSSSupportsRule||gn("CSSConditionRule")&&r.parentRule instanceof CSSConditionRule){const o=Array.from(r.parentRule.cssRules).indexOf(r);s.unshift(o)}else if(r.parentStyleSheet){const o=Array.from(r.parentStyleSheet.cssRules).indexOf(r);s.unshift(o)}return s}return n(e,t)}function Ue(e,t,n){let r,s;return e?(e.ownerNode?r=t.getId(e.ownerNode):s=n.getId(e),{styleId:s,id:r}):{}}function Gm({styleSheetRuleCb:e,mirror:t,stylesheetManager:n},{win:r}){if(!r.CSSStyleSheet||!r.CSSStyleSheet.prototype)return()=>{};const s=r.CSSStyleSheet.prototype.insertRule;r.CSSStyleSheet.prototype.insertRule=new Proxy(s,{apply:W((d,l,f)=>{const[p,h]=f,{id:g,styleId:S}=Ue(l,t,n.styleMirror);return(g&&g!==-1||S&&S!==-1)&&e({id:g,styleId:S,adds:[{rule:p,index:h}]}),d.apply(l,f)})});const i=r.CSSStyleSheet.prototype.deleteRule;r.CSSStyleSheet.prototype.deleteRule=new Proxy(i,{apply:W((d,l,f)=>{const[p]=f,{id:h,styleId:g}=Ue(l,t,n.styleMirror);return(h&&h!==-1||g&&g!==-1)&&e({id:h,styleId:g,removes:[{index:p}]}),d.apply(l,f)})});let o;r.CSSStyleSheet.prototype.replace&&(o=r.CSSStyleSheet.prototype.replace,r.CSSStyleSheet.prototype.replace=new Proxy(o,{apply:W((d,l,f)=>{const[p]=f,{id:h,styleId:g}=Ue(l,t,n.styleMirror);return(h&&h!==-1||g&&g!==-1)&&e({id:h,styleId:g,replace:p}),d.apply(l,f)})}));let c;r.CSSStyleSheet.prototype.replaceSync&&(c=r.CSSStyleSheet.prototype.replaceSync,r.CSSStyleSheet.prototype.replaceSync=new Proxy(c,{apply:W((d,l,f)=>{const[p]=f,{id:h,styleId:g}=Ue(l,t,n.styleMirror);return(h&&h!==-1||g&&g!==-1)&&e({id:h,styleId:g,replaceSync:p}),d.apply(l,f)})}));const a={};_n("CSSGroupingRule")?a.CSSGroupingRule=r.CSSGroupingRule:(_n("CSSMediaRule")&&(a.CSSMediaRule=r.CSSMediaRule),_n("CSSConditionRule")&&(a.CSSConditionRule=r.CSSConditionRule),_n("CSSSupportsRule")&&(a.CSSSupportsRule=r.CSSSupportsRule));const u={};return Object.entries(a).forEach(([d,l])=>{u[d]={insertRule:l.prototype.insertRule,deleteRule:l.prototype.deleteRule},l.prototype.insertRule=new Proxy(u[d].insertRule,{apply:W((f,p,h)=>{const[g,S]=h,{id:y,styleId:T}=Ue(p.parentStyleSheet,t,n.styleMirror);return(y&&y!==-1||T&&T!==-1)&&e({id:y,styleId:T,adds:[{rule:g,index:[...Jn(p),S||0]}]}),f.apply(p,h)})}),l.prototype.deleteRule=new Proxy(u[d].deleteRule,{apply:W((f,p,h)=>{const[g]=h,{id:S,styleId:y}=Ue(p.parentStyleSheet,t,n.styleMirror);return(S&&S!==-1||y&&y!==-1)&&e({id:S,styleId:y,removes:[{index:[...Jn(p),g]}]}),f.apply(p,h)})})}),W(()=>{r.CSSStyleSheet.prototype.insertRule=s,r.CSSStyleSheet.prototype.deleteRule=i,o&&(r.CSSStyleSheet.prototype.replace=o),c&&(r.CSSStyleSheet.prototype.replaceSync=c),Object.entries(a).forEach(([d,l])=>{l.prototype.insertRule=u[d].insertRule,l.prototype.deleteRule=u[d].deleteRule})})}function Ic({mirror:e,stylesheetManager:t},n){let r=null;n.nodeName==="#document"?r=e.getId(n):r=e.getId(n.host);const s=n.nodeName==="#document"?n.defaultView?.Document:n.ownerDocument?.defaultView?.ShadowRoot,i=s?.prototype?Object.getOwnPropertyDescriptor(s?.prototype,"adoptedStyleSheets"):void 0;return r===null||r===-1||!s||!i?()=>{}:(Object.defineProperty(n,"adoptedStyleSheets",{configurable:i.configurable,enumerable:i.enumerable,get(){return i.get?.call(this)},set(o){const c=i.set?.call(this,o);if(r!==null&&r!==-1)try{t.adoptStyleSheets(o,r)}catch{}return c}}),W(()=>{Object.defineProperty(n,"adoptedStyleSheets",{configurable:i.configurable,enumerable:i.enumerable,get:i.get,set:i.set})}))}function Ym({styleDeclarationCb:e,mirror:t,ignoreCSSAttributes:n,stylesheetManager:r},{win:s}){const i=s.CSSStyleDeclaration.prototype.setProperty;s.CSSStyleDeclaration.prototype.setProperty=new Proxy(i,{apply:W((c,a,u)=>{const[d,l,f]=u;if(n.has(d))return i.apply(a,[d,l,f]);const{id:p,styleId:h}=Ue(a.parentRule?.parentStyleSheet,t,r.styleMirror);return(p&&p!==-1||h&&h!==-1)&&e({id:p,styleId:h,set:{property:d,value:l,priority:f},index:Jn(a.parentRule)}),c.apply(a,u)})});const o=s.CSSStyleDeclaration.prototype.removeProperty;return s.CSSStyleDeclaration.prototype.removeProperty=new Proxy(o,{apply:W((c,a,u)=>{const[d]=u;if(n.has(d))return o.apply(a,[d]);const{id:l,styleId:f}=Ue(a.parentRule?.parentStyleSheet,t,r.styleMirror);return(l&&l!==-1||f&&f!==-1)&&e({id:l,styleId:f,remove:{property:d},index:Jn(a.parentRule)}),c.apply(a,u)})}),W(()=>{s.CSSStyleDeclaration.prototype.setProperty=i,s.CSSStyleDeclaration.prototype.removeProperty=o})}function Jm({mediaInteractionCb:e,blockClass:t,blockSelector:n,unblockSelector:r,mirror:s,sampling:i,doc:o}){const c=W(u=>jt(W(d=>{const l=on(d);if(!l||Ee(l,t,n,r,!0))return;const{currentTime:f,volume:p,muted:h,playbackRate:g}=l;e({type:u,id:s.getId(l),currentTime:f,volume:p,muted:h,playbackRate:g})}),i.media||500)),a=[me("play",c(ft.Play),o),me("pause",c(ft.Pause),o),me("seeked",c(ft.Seeked),o),me("volumechange",c(ft.VolumeChange),o),me("ratechange",c(ft.RateChange),o)];return W(()=>{a.forEach(u=>u())})}function Km({fontCb:e,doc:t}){const n=t.defaultView;if(!n)return()=>{};const r=[],s=new WeakMap,i=n.FontFace;n.FontFace=function(a,u,d){const l=new i(a,u,d);return s.set(l,{family:a,buffer:typeof u!="string",descriptors:d,fontSource:typeof u=="string"?u:JSON.stringify(Array.from(new Uint8Array(u)))}),l};const o=Hs(t.fonts,"add",function(c){return function(a){return pr(W(()=>{const u=s.get(a);u&&(e(u),s.delete(a))}),0),c.apply(this,[a])}});return r.push(()=>{n.FontFace=i}),r.push(o),W(()=>{r.forEach(c=>c())})}function Xm(e){const{doc:t,mirror:n,blockClass:r,blockSelector:s,unblockSelector:i,selectionCb:o}=e;let c=!0;const a=W(()=>{const u=t.getSelection();if(!u||c&&u?.isCollapsed)return;c=u.isCollapsed||!1;const d=[],l=u.rangeCount||0;for(let f=0;f<l;f++){const p=u.getRangeAt(f),{startContainer:h,startOffset:g,endContainer:S,endOffset:y}=p;Ee(h,r,s,i,!0)||Ee(S,r,s,i,!0)||d.push({start:n.getId(h),startOffset:g,end:n.getId(S),endOffset:y})}o({ranges:d})});return a(),me("selectionchange",a)}function Qm({doc:e,customElementCb:t}){const n=e.defaultView;return!n||!n.customElements?()=>{}:Hs(n.customElements,"define",function(s){return function(i,o,c){try{t({define:{name:i}})}catch{}return s.apply(this,[i,o,c])}})}function Zm(e,t={}){const n=e.doc.defaultView;if(!n)return()=>{};let r;e.recordDOM&&(r=vc(e,e.doc));const s=Wm(e),i=zm(e),o=Tc(e),c=qm(e,{win:n}),a=Vm(e),u=Jm(e);let d=()=>{},l=()=>{},f=()=>{},p=()=>{};e.recordDOM&&(d=Gm(e,{win:n}),l=Ic(e,e.doc),f=Ym(e,{win:n}),e.collectFonts&&(p=Km(e)));const h=Xm(e),g=Qm(e),S=[];for(const y of e.plugins)S.push(y.observer(y.callback,n,y.options));return W(()=>{gt.forEach(y=>y.reset()),r?.disconnect(),s(),i(),o(),c(),a(),u(),d(),l(),f(),p(),h(),g(),S.forEach(y=>y())})}function gn(e){return typeof window[e]<"u"}function _n(e){return!!(typeof window[e]<"u"&&window[e].prototype&&"insertRule"in window[e].prototype&&"deleteRule"in window[e].prototype)}class rs{constructor(t){this.generateIdFn=t,this.iframeIdToRemoteIdMap=new WeakMap,this.iframeRemoteIdToIdMap=new WeakMap}getId(t,n,r,s){const i=r||this.getIdToRemoteIdMap(t),o=s||this.getRemoteIdToIdMap(t);let c=i.get(n);return c||(c=this.generateIdFn(),i.set(n,c),o.set(c,n)),c}getIds(t,n){const r=this.getIdToRemoteIdMap(t),s=this.getRemoteIdToIdMap(t);return n.map(i=>this.getId(t,i,r,s))}getRemoteId(t,n,r){const s=r||this.getRemoteIdToIdMap(t);if(typeof n!="number")return n;const i=s.get(n);return i||-1}getRemoteIds(t,n){const r=this.getRemoteIdToIdMap(t);return n.map(s=>this.getRemoteId(t,s,r))}reset(t){if(!t){this.iframeIdToRemoteIdMap=new WeakMap,this.iframeRemoteIdToIdMap=new WeakMap;return}this.iframeIdToRemoteIdMap.delete(t),this.iframeRemoteIdToIdMap.delete(t)}getIdToRemoteIdMap(t){let n=this.iframeIdToRemoteIdMap.get(t);return n||(n=new Map,this.iframeIdToRemoteIdMap.set(t,n)),n}getRemoteIdToIdMap(t){let n=this.iframeRemoteIdToIdMap.get(t);return n||(n=new Map,this.iframeRemoteIdToIdMap.set(t,n)),n}}class eg{constructor(){this.crossOriginIframeMirror=new rs(Us),this.crossOriginIframeRootIdMap=new WeakMap}addIframe(){}addLoadListener(){}attachIframe(){}}class tg{constructor(t){this.iframes=new WeakMap,this.crossOriginIframeMap=new WeakMap,this.crossOriginIframeMirror=new rs(Us),this.crossOriginIframeRootIdMap=new WeakMap,this.mutationCb=t.mutationCb,this.wrappedEmit=t.wrappedEmit,this.stylesheetManager=t.stylesheetManager,this.recordCrossOriginIframes=t.recordCrossOriginIframes,this.crossOriginIframeStyleMirror=new rs(this.stylesheetManager.styleMirror.generateId.bind(this.stylesheetManager.styleMirror)),this.mirror=t.mirror,this.recordCrossOriginIframes&&window.addEventListener("message",this.handleMessage.bind(this))}addIframe(t){this.iframes.set(t,!0),t.contentWindow&&this.crossOriginIframeMap.set(t.contentWindow,t)}addLoadListener(t){this.loadListener=t}attachIframe(t,n){this.mutationCb({adds:[{parentId:this.mirror.getId(t),nextId:null,node:n}],removes:[],texts:[],attributes:[],isAttachIframe:!0}),this.recordCrossOriginIframes&&t.contentWindow?.addEventListener("message",this.handleMessage.bind(this)),this.loadListener?.(t);const r=Ws(t);r&&r.adoptedStyleSheets&&r.adoptedStyleSheets.length>0&&this.stylesheetManager.adoptStyleSheets(r.adoptedStyleSheets,this.mirror.getId(r))}handleMessage(t){const n=t;if(n.data.type!=="rrweb"||n.origin!==n.data.origin||!t.source)return;const s=this.crossOriginIframeMap.get(t.source);if(!s)return;const i=this.transformCrossOriginEvent(s,n.data.event);i&&this.wrappedEmit(i,n.data.isCheckout)}transformCrossOriginEvent(t,n){switch(n.type){case L.FullSnapshot:{this.crossOriginIframeMirror.reset(t),this.crossOriginIframeStyleMirror.reset(t),this.replaceIdOnNode(n.data.node,t);const r=n.data.node.id;return this.crossOriginIframeRootIdMap.set(t,r),this.patchRootIdOnNode(n.data.node,r),{timestamp:n.timestamp,type:L.IncrementalSnapshot,data:{source:x.Mutation,adds:[{parentId:this.mirror.getId(t),nextId:null,node:n.data.node}],removes:[],texts:[],attributes:[],isAttachIframe:!0}}}case L.Meta:case L.Load:case L.DomContentLoaded:return!1;case L.Plugin:return n;case L.Custom:return this.replaceIds(n.data.payload,t,["id","parentId","previousId","nextId"]),n;case L.IncrementalSnapshot:switch(n.data.source){case x.Mutation:return n.data.adds.forEach(r=>{this.replaceIds(r,t,["parentId","nextId","previousId"]),this.replaceIdOnNode(r.node,t);const s=this.crossOriginIframeRootIdMap.get(t);s&&this.patchRootIdOnNode(r.node,s)}),n.data.removes.forEach(r=>{this.replaceIds(r,t,["parentId","id"])}),n.data.attributes.forEach(r=>{this.replaceIds(r,t,["id"])}),n.data.texts.forEach(r=>{this.replaceIds(r,t,["id"])}),n;case x.Drag:case x.TouchMove:case x.MouseMove:return n.data.positions.forEach(r=>{this.replaceIds(r,t,["id"])}),n;case x.ViewportResize:return!1;case x.MediaInteraction:case x.MouseInteraction:case x.Scroll:case x.CanvasMutation:case x.Input:return this.replaceIds(n.data,t,["id"]),n;case x.StyleSheetRule:case x.StyleDeclaration:return this.replaceIds(n.data,t,["id"]),this.replaceStyleIds(n.data,t,["styleId"]),n;case x.Font:return n;case x.Selection:return n.data.ranges.forEach(r=>{this.replaceIds(r,t,["start","end"])}),n;case x.AdoptedStyleSheet:return this.replaceIds(n.data,t,["id"]),this.replaceStyleIds(n.data,t,["styleIds"]),n.data.styles?.forEach(r=>{this.replaceStyleIds(r,t,["styleId"])}),n}}return!1}replace(t,n,r,s){for(const i of s)!Array.isArray(n[i])&&typeof n[i]!="number"||(Array.isArray(n[i])?n[i]=t.getIds(r,n[i]):n[i]=t.getId(r,n[i]));return n}replaceIds(t,n,r){return this.replace(this.crossOriginIframeMirror,t,n,r)}replaceStyleIds(t,n,r){return this.replace(this.crossOriginIframeStyleMirror,t,n,r)}replaceIdOnNode(t,n){this.replaceIds(t,n,["id","rootId"]),"childNodes"in t&&t.childNodes.forEach(r=>{this.replaceIdOnNode(r,n)})}patchRootIdOnNode(t,n){t.type!==oe.Document&&!t.rootId&&(t.rootId=n),"childNodes"in t&&t.childNodes.forEach(r=>{this.patchRootIdOnNode(r,n)})}}class ng{init(){}addShadowRoot(){}observeAttachShadow(){}reset(){}}class rg{constructor(t){this.shadowDoms=new WeakSet,this.restoreHandlers=[],this.mutationCb=t.mutationCb,this.scrollCb=t.scrollCb,this.bypassOptions=t.bypassOptions,this.mirror=t.mirror,this.init()}init(){this.reset(),this.patchAttachShadow(Element,document)}addShadowRoot(t,n){if(!Ft(t)||this.shadowDoms.has(t))return;this.shadowDoms.add(t),this.bypassOptions.canvasManager.addShadowRoot(t);const r=vc({...this.bypassOptions,doc:n,mutationCb:this.mutationCb,mirror:this.mirror,shadowDomManager:this},t);this.restoreHandlers.push(()=>r.disconnect()),this.restoreHandlers.push(Tc({...this.bypassOptions,scrollCb:this.scrollCb,doc:t,mirror:this.mirror})),pr(()=>{t.adoptedStyleSheets&&t.adoptedStyleSheets.length>0&&this.bypassOptions.stylesheetManager.adoptStyleSheets(t.adoptedStyleSheets,this.mirror.getId(t.host)),this.restoreHandlers.push(Ic({mirror:this.mirror,stylesheetManager:this.bypassOptions.stylesheetManager},t))},0)}observeAttachShadow(t){const n=Ws(t),r=Dm(t);!n||!r||this.patchAttachShadow(r.Element,n)}patchAttachShadow(t,n){const r=this;this.restoreHandlers.push(Hs(t.prototype,"attachShadow",function(s){return function(i){const o=s.call(this,i);return this.shadowRoot&&Ec(this)&&r.addShadowRoot(this.shadowRoot,n),o}}))}reset(){this.restoreHandlers.forEach(t=>{try{t()}catch{}}),this.restoreHandlers=[],this.shadowDoms=new WeakSet,this.bypassOptions.canvasManager.resetShadowRoots()}}var lo="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",sg=typeof Uint8Array>"u"?[]:new Uint8Array(256);for(var Sn=0;Sn<lo.length;Sn++)sg[lo.charCodeAt(Sn)]=Sn;class fo{reset(){}freeze(){}unfreeze(){}lock(){}unlock(){}snapshot(){}addWindow(){}addShadowRoot(){}resetShadowRoots(){}}class ig{constructor(t){this.trackedLinkElements=new WeakSet,this.styleMirror=new xm,this.mutationCb=t.mutationCb,this.adoptedStyleSheetCb=t.adoptedStyleSheetCb}attachLinkElement(t,n){"_cssText"in n.attributes&&this.mutationCb({adds:[],removes:[],texts:[],attributes:[{id:n.id,attributes:n.attributes}]}),this.trackLinkElement(t)}trackLinkElement(t){this.trackedLinkElements.has(t)||(this.trackedLinkElements.add(t),this.trackStylesheetInLinkElement(t))}adoptStyleSheets(t,n){if(t.length===0)return;const r={id:n,styleIds:[]},s=[];for(const i of t){let o;this.styleMirror.has(i)?o=this.styleMirror.getId(i):(o=this.styleMirror.add(i),s.push({styleId:o,rules:Array.from(i.rules||CSSRule,(c,a)=>({rule:rc(c),index:a}))})),r.styleIds.push(o)}s.length>0&&(r.styles=s),this.adoptedStyleSheetCb(r)}reset(){this.styleMirror.reset(),this.trackedLinkElements=new WeakSet}trackStylesheetInLinkElement(t){}}class og{constructor(){this.nodeMap=new WeakMap,this.active=!1}inOtherBuffer(t,n){const r=this.nodeMap.get(t);return r&&Array.from(r).some(s=>s!==n)}add(t,n){this.active||(this.active=!0,Pm(()=>{this.nodeMap=new WeakMap,this.active=!1})),this.nodeMap.set(t,(this.nodeMap.get(t)||new Set).add(n))}destroy(){}}let se,Kn;try{if(Array.from([1],e=>e*2)[0]!==2){const e=document.createElement("iframe");document.body.appendChild(e),Array.from=e.contentWindow?.Array.from||Array.from,document.body.removeChild(e)}}catch(e){console.debug("Unable to override Array.from",e)}const we=sm();function Le(e={}){const{emit:t,checkoutEveryNms:n,checkoutEveryNth:r,blockClass:s="rr-block",blockSelector:i=null,unblockSelector:o=null,ignoreClass:c="rr-ignore",ignoreSelector:a=null,maskAllText:u=!1,maskTextClass:d="rr-mask",unmaskTextClass:l=null,maskTextSelector:f=null,unmaskTextSelector:p=null,inlineStylesheet:h=!0,maskAllInputs:g,maskInputOptions:S,slimDOMOptions:y,maskAttributeFn:T,maskInputFn:B,maskTextFn:N,maxCanvasSize:z=null,packFn:A,sampling:_={},dataURLOptions:I={},mousemoveWait:Y,recordDOM:E=!0,recordCanvas:k=!1,recordCrossOriginIframes:F=!1,recordAfter:q=e.recordAfter==="DOMContentLoaded"?e.recordAfter:"load",userTriggeredOnInput:P=!1,collectFonts:ce=!1,inlineImages:J=!1,plugins:ee,keepIframeSrcFn:b=()=>!1,ignoreCSSAttributes:G=new Set([]),errorHandler:w,onMutation:K,getCanvasManager:ne}=e;Hm(w);const re=F?window.parent===window:!0;let Se=!1;if(!re)try{window.parent.document&&(Se=!1)}catch{Se=!0}if(re&&!t)throw new Error("emit function is required");if(!re&&!Se)return()=>{};Y!==void 0&&_.mousemove===void 0&&(_.mousemove=Y),we.reset();const ye=g===!0?{color:!0,date:!0,"datetime-local":!0,email:!0,month:!0,number:!0,range:!0,search:!0,tel:!0,text:!0,time:!0,url:!0,week:!0,textarea:!0,select:!0,radio:!0,checkbox:!0}:S!==void 0?S:{},at=y===!0||y==="all"?{script:!0,comment:!0,headFavicon:!0,headWhitespace:!0,headMetaSocial:!0,headMetaRobots:!0,headMetaHttpEquiv:!0,headMetaVerification:!0,headMetaAuthorship:y==="all",headMetaDescKeywords:y==="all"}:y||{};Am();let Oe,ct=0;const cn=j=>{for(const Ie of ee||[])Ie.eventProcessor&&(j=Ie.eventProcessor(j));return A&&!Se&&(j=A(j)),j};se=(j,Ie)=>{const U=j;if(U.timestamp=Yn(),gt[0]?.isFrozen()&&U.type!==L.FullSnapshot&&!(U.type===L.IncrementalSnapshot&&U.data.source===x.Mutation)&&gt.forEach(fe=>fe.unfreeze()),re)t?.(cn(U),Ie);else if(Se){const fe={type:"rrweb",event:cn(U),origin:window.location.origin,isCheckout:Ie};window.parent.postMessage(fe,"*")}if(U.type===L.FullSnapshot)Oe=U,ct=0;else if(U.type===L.IncrementalSnapshot){if(U.data.source===x.Mutation&&U.data.isAttachIframe)return;ct++;const fe=r&&ct>=r,V=n&&Oe&&U.timestamp-Oe.timestamp>n;(fe||V)&&yr(!0)}};const Mt=j=>{se({type:L.IncrementalSnapshot,data:{source:x.Mutation,...j}})},ei=j=>se({type:L.IncrementalSnapshot,data:{source:x.Scroll,...j}}),iu=j=>se({type:L.IncrementalSnapshot,data:{source:x.CanvasMutation,...j}}),ou=j=>se({type:L.IncrementalSnapshot,data:{source:x.AdoptedStyleSheet,...j}}),Je=new ig({mutationCb:Mt,adoptedStyleSheetCb:ou}),Ke=typeof __RRWEB_EXCLUDE_IFRAME__=="boolean"&&__RRWEB_EXCLUDE_IFRAME__?new eg:new tg({mirror:we,mutationCb:Mt,stylesheetManager:Je,recordCrossOriginIframes:F,wrappedEmit:se});for(const j of ee||[])j.getMirror&&j.getMirror({nodeMirror:we,crossOriginIframeMirror:Ke.crossOriginIframeMirror,crossOriginIframeStyleMirror:Ke.crossOriginIframeStyleMirror});const _r=new og,Sr=cg(ne,{mirror:we,win:window,mutationCb:j=>se({type:L.IncrementalSnapshot,data:{source:x.CanvasMutation,...j}}),recordCanvas:k,blockClass:s,blockSelector:i,unblockSelector:o,maxCanvasSize:z,sampling:_.canvas,dataURLOptions:I,errorHandler:w}),un=typeof __RRWEB_EXCLUDE_SHADOW_DOM__=="boolean"&&__RRWEB_EXCLUDE_SHADOW_DOM__?new ng:new rg({mutationCb:Mt,scrollCb:ei,bypassOptions:{onMutation:K,blockClass:s,blockSelector:i,unblockSelector:o,maskAllText:u,maskTextClass:d,unmaskTextClass:l,maskTextSelector:f,unmaskTextSelector:p,inlineStylesheet:h,maskInputOptions:ye,dataURLOptions:I,maskAttributeFn:T,maskTextFn:N,maskInputFn:B,recordCanvas:k,inlineImages:J,sampling:_,slimDOMOptions:at,iframeManager:Ke,stylesheetManager:Je,canvasManager:Sr,keepIframeSrcFn:b,processedNodeManager:_r,ignoreCSSAttributes:G},mirror:we}),yr=(j=!1)=>{if(!E)return;se({type:L.Meta,data:{href:window.location.href,width:hc(),height:pc()}},j),Je.reset(),un.init(),gt.forEach(U=>U.lock());const Ie=Cm(document,{mirror:we,blockClass:s,blockSelector:i,unblockSelector:o,maskAllText:u,maskTextClass:d,unmaskTextClass:l,maskTextSelector:f,unmaskTextSelector:p,inlineStylesheet:h,maskAllInputs:ye,maskAttributeFn:T,maskInputFn:B,maskTextFn:N,slimDOM:at,dataURLOptions:I,recordCanvas:k,inlineImages:J,onSerialize:U=>{_c(U,we)&&Ke.addIframe(U),Sc(U,we)&&Je.trackLinkElement(U),ts(U)&&un.addShadowRoot(U.shadowRoot,document)},onIframeLoad:(U,fe)=>{Ke.attachIframe(U,fe),U.contentWindow&&Sr.addWindow(U.contentWindow),un.observeAttachShadow(U)},onStylesheetLoad:(U,fe)=>{Je.attachLinkElement(U,fe)},onBlockedImageLoad:(U,fe,{width:V,height:At})=>{Mt({adds:[],removes:[],texts:[],attributes:[{id:fe.id,attributes:{style:{width:`${V}px`,height:`${At}px`}}}]})},keepIframeSrcFn:b,ignoreCSSAttributes:G});if(!Ie)return console.warn("Failed to snapshot the document");se({type:L.FullSnapshot,data:{node:Ie,initialOffset:fc(window)}}),gt.forEach(U=>U.unlock()),document.adoptedStyleSheets&&document.adoptedStyleSheets.length>0&&Je.adoptStyleSheets(document.adoptedStyleSheets,we.getId(document))};Kn=yr;try{const j=[],Ie=fe=>W(Zm)({onMutation:K,mutationCb:Mt,mousemoveCb:(V,At)=>se({type:L.IncrementalSnapshot,data:{source:At,positions:V}}),mouseInteractionCb:V=>se({type:L.IncrementalSnapshot,data:{source:x.MouseInteraction,...V}}),scrollCb:ei,viewportResizeCb:V=>se({type:L.IncrementalSnapshot,data:{source:x.ViewportResize,...V}}),inputCb:V=>se({type:L.IncrementalSnapshot,data:{source:x.Input,...V}}),mediaInteractionCb:V=>se({type:L.IncrementalSnapshot,data:{source:x.MediaInteraction,...V}}),styleSheetRuleCb:V=>se({type:L.IncrementalSnapshot,data:{source:x.StyleSheetRule,...V}}),styleDeclarationCb:V=>se({type:L.IncrementalSnapshot,data:{source:x.StyleDeclaration,...V}}),canvasMutationCb:iu,fontCb:V=>se({type:L.IncrementalSnapshot,data:{source:x.Font,...V}}),selectionCb:V=>{se({type:L.IncrementalSnapshot,data:{source:x.Selection,...V}})},customElementCb:V=>{se({type:L.IncrementalSnapshot,data:{source:x.CustomElement,...V}})},blockClass:s,ignoreClass:c,ignoreSelector:a,maskAllText:u,maskTextClass:d,unmaskTextClass:l,maskTextSelector:f,unmaskTextSelector:p,maskInputOptions:ye,inlineStylesheet:h,sampling:_,recordDOM:E,recordCanvas:k,inlineImages:J,userTriggeredOnInput:P,collectFonts:ce,doc:fe,maskAttributeFn:T,maskInputFn:B,maskTextFn:N,keepIframeSrcFn:b,blockSelector:i,unblockSelector:o,slimDOMOptions:at,dataURLOptions:I,mirror:we,iframeManager:Ke,stylesheetManager:Je,shadowDomManager:un,processedNodeManager:_r,canvasManager:Sr,ignoreCSSAttributes:G,plugins:ee?.filter(V=>V.observer)?.map(V=>({observer:V.observer,options:V.options,callback:At=>se({type:L.Plugin,data:{plugin:V.name,payload:At}})}))||[]},{});Ke.addLoadListener(fe=>{try{j.push(Ie(fe.contentDocument))}catch(V){console.warn(V)}});const U=()=>{yr(),j.push(Ie(document))};return document.readyState==="interactive"||document.readyState==="complete"?U():(j.push(me("DOMContentLoaded",()=>{se({type:L.DomContentLoaded,data:{}}),q==="DOMContentLoaded"&&U()})),j.push(me("load",()=>{se({type:L.Load,data:{}}),q==="load"&&U()},window))),()=>{j.forEach(fe=>fe()),_r.destroy(),Kn=void 0,$m()}}catch(j){console.warn(j)}}function ag(e){if(!Kn)throw new Error("please take full snapshot after start recording");Kn(e)}Le.mirror=we;Le.takeFullSnapshot=ag;function cg(e,t){try{return e?e(t):new fo}catch{return console.warn("Unable to initialize CanvasManager"),new fo}}var po;(function(e){e[e.NotStarted=0]="NotStarted",e[e.Running=1]="Running",e[e.Stopped=2]="Stopped"})(po||(po={}));const ug=3,lg=5;function zs(e){return e>9999999999?e:e*1e3}function Pr(e){return e>9999999999?e/1e3:e}function an(e,t){t.category!=="sentry.transaction"&&(["ui.click","ui.input"].includes(t.category)?e.triggerUserActivity():e.checkAndHandleExpiredSession(),e.addUpdate(()=>(e.throttledAddEvent({type:L.Custom,timestamp:(t.timestamp||0)*1e3,data:{tag:"breadcrumb",payload:tr(t,10,1e3)}}),t.category==="console")))}const dg="button,a";function wc(e){return e.closest(dg)||e}function kc(e){const t=Rc(e);return!t||!(t instanceof Element)?t:wc(t)}function Rc(e){return fg(e)?e.target:e}function fg(e){return typeof e=="object"&&!!e&&"target"in e}let He;function pg(e){return He||(He=[],hg()),He.push(e),()=>{const t=He?He.indexOf(e):-1;t>-1&&He.splice(t,1)}}function hg(){_e(Z,"open",function(e){return function(...t){if(He)try{He.forEach(n=>n())}catch{}return e.apply(Z,t)}})}const mg=new Set([x.Mutation,x.StyleSheetRule,x.StyleDeclaration,x.AdoptedStyleSheet,x.CanvasMutation,x.Selection,x.MediaInteraction]);function gg(e,t,n){e.handleClick(t,n)}class _g{constructor(t,n,r=an){this._lastMutation=0,this._lastScroll=0,this._clicks=[],this._timeout=n.timeout/1e3,this._threshold=n.threshold/1e3,this._scrollTimeout=n.scrollTimeout/1e3,this._replay=t,this._ignoreSelector=n.ignoreSelector,this._addBreadcrumbEvent=r}addListeners(){const t=pg(()=>{this._lastMutation=ho()});this._teardown=()=>{t(),this._clicks=[],this._lastMutation=0,this._lastScroll=0}}removeListeners(){this._teardown&&this._teardown(),this._checkClickTimeout&&clearTimeout(this._checkClickTimeout)}handleClick(t,n){if(yg(n,this._ignoreSelector)||!Eg(t))return;const r={timestamp:Pr(t.timestamp),clickBreadcrumb:t,clickCount:0,node:n};this._clicks.some(s=>s.node===r.node&&Math.abs(s.timestamp-r.timestamp)<1)||(this._clicks.push(r),this._clicks.length===1&&this._scheduleCheckClicks())}registerMutation(t=Date.now()){this._lastMutation=Pr(t)}registerScroll(t=Date.now()){this._lastScroll=Pr(t)}registerClick(t){const n=wc(t);this._handleMultiClick(n)}_handleMultiClick(t){this._getClicks(t).forEach(n=>{n.clickCount++})}_getClicks(t){return this._clicks.filter(n=>n.node===t)}_checkClicks(){const t=[],n=ho();this._clicks.forEach(r=>{!r.mutationAfter&&this._lastMutation&&(r.mutationAfter=r.timestamp<=this._lastMutation?this._lastMutation-r.timestamp:void 0),!r.scrollAfter&&this._lastScroll&&(r.scrollAfter=r.timestamp<=this._lastScroll?this._lastScroll-r.timestamp:void 0),r.timestamp+this._timeout<=n&&t.push(r)});for(const r of t){const s=this._clicks.indexOf(r);s>-1&&(this._generateBreadcrumbs(r),this._clicks.splice(s,1))}this._clicks.length&&this._scheduleCheckClicks()}_generateBreadcrumbs(t){const n=this._replay,r=t.scrollAfter&&t.scrollAfter<=this._scrollTimeout,s=t.mutationAfter&&t.mutationAfter<=this._threshold,i=!r&&!s,{clickCount:o,clickBreadcrumb:c}=t;if(i){const a=Math.min(t.mutationAfter||this._timeout,this._timeout)*1e3,u=a<this._timeout*1e3?"mutation":"timeout",d={type:"default",message:c.message,timestamp:c.timestamp,category:"ui.slowClickDetected",data:{...c.data,url:Z.location.href,route:n.getCurrentRoute(),timeAfterClickMs:a,endReason:u,clickCount:o||1}};this._addBreadcrumbEvent(n,d);return}if(o>1){const a={type:"default",message:c.message,timestamp:c.timestamp,category:"ui.multiClick",data:{...c.data,url:Z.location.href,route:n.getCurrentRoute(),clickCount:o,metric:!0}};this._addBreadcrumbEvent(n,a)}}_scheduleCheckClicks(){this._checkClickTimeout&&clearTimeout(this._checkClickTimeout),this._checkClickTimeout=sn(()=>this._checkClicks(),1e3)}}const Sg=["A","BUTTON","INPUT"];function yg(e,t){return!!(!Sg.includes(e.tagName)||e.tagName==="INPUT"&&!["submit","button"].includes(e.getAttribute("type")||"")||e.tagName==="A"&&(e.hasAttribute("download")||e.hasAttribute("target")&&e.getAttribute("target")!=="_self")||t&&e.matches(t))}function Eg(e){return!!(e.data&&typeof e.data.nodeId=="number"&&e.timestamp)}function ho(){return Date.now()/1e3}function bg(e,t){try{if(!vg(t))return;const{source:n}=t.data;if(mg.has(n)&&e.registerMutation(t.timestamp),n===x.Scroll&&e.registerScroll(t.timestamp),Tg(t)){const{type:r,id:s}=t.data,i=Le.mirror.getNode(s);i instanceof HTMLElement&&r===he.Click&&e.registerClick(i)}}catch{}}function vg(e){return e.type===ug}function Tg(e){return e.data.source===x.MouseInteraction}function xe(e){return{timestamp:Date.now()/1e3,type:"default",...e}}var qs=(e=>(e[e.Document=0]="Document",e[e.DocumentType=1]="DocumentType",e[e.Element=2]="Element",e[e.Text=3]="Text",e[e.CDATA=4]="CDATA",e[e.Comment=5]="Comment",e))(qs||{});const Ig=new Set(["id","class","aria-label","role","name","alt","title","data-test-id","data-testid","disabled","aria-disabled","data-sentry-component"]);function wg(e){const t={};!e["data-sentry-component"]&&e["data-sentry-element"]&&(e["data-sentry-component"]=e["data-sentry-element"]);for(const n in e)if(Ig.has(n)){let r=n;(n==="data-testid"||n==="data-test-id")&&(r="testId"),t[r]=e[n]}return t}const kg=e=>t=>{if(!e.isEnabled())return;const n=Rg(t);if(!n)return;const r=t.name==="click",s=r?t.event:void 0;r&&e.clickDetector&&s?.target&&!s.altKey&&!s.metaKey&&!s.ctrlKey&&!s.shiftKey&&gg(e.clickDetector,n,kc(t.event)),an(e,n)};function Cc(e,t){const n=Le.mirror.getId(e),r=n&&Le.mirror.getNode(n),s=r&&Le.mirror.getMeta(r),i=s&&Mg(s)?s:null;return{message:t,data:i?{nodeId:n,node:{id:n,tagName:i.tagName,textContent:Array.from(i.childNodes).map(o=>o.type===qs.Text&&o.textContent).filter(Boolean).map(o=>o.trim()).join(""),attributes:wg(i.attributes)}}:{}}}function Rg(e){const{target:t,message:n}=Cg(e);return xe({category:`ui.${e.name}`,...Cc(t,n)})}function Cg(e){const t=e.name==="click";let n,r=null;try{r=t?kc(e.event):Rc(e.event),n=be(r,{maxStringLength:200})||"<unknown>"}catch{n="<unknown>"}return{target:r,message:n}}function Mg(e){return e.type===qs.Element}function Ag(e,t){if(!e.isEnabled())return;e.updateUserActivity();const n=xg(t);n&&an(e,n)}function xg(e){const{metaKey:t,shiftKey:n,ctrlKey:r,altKey:s,key:i,target:o}=e;if(!o||Og(o)||!i)return null;const c=t||r||s,a=i.length===1;if(!c&&a)return null;const u=be(o,{maxStringLength:200})||"<unknown>",d=Cc(o,u);return xe({category:"ui.keyDown",message:u,data:{...d.data,metaKey:t,shiftKey:n,ctrlKey:r,altKey:s,key:i}})}function Og(e){return e.tagName==="INPUT"||e.tagName==="TEXTAREA"||e.isContentEditable}const Ng={resource:Bg,paint:Dg,navigation:Fg};function Lr(e,t){return({metric:n})=>{t.replayPerformanceEntries.push(e(n))}}function Pg(e){return e.map(Lg).filter(Boolean)}function Lg(e){const t=Ng[e.entryType];return t?t(e):null}function vt(e){return((pe()||Z.performance.timeOrigin)+e)/1e3}function Dg(e){const{duration:t,entryType:n,name:r,startTime:s}=e,i=vt(s);return{type:n,name:r,start:i,end:i+t,data:void 0}}function Fg(e){const{entryType:t,name:n,decodedBodySize:r,duration:s,domComplete:i,encodedBodySize:o,domContentLoadedEventStart:c,domContentLoadedEventEnd:a,domInteractive:u,loadEventStart:d,loadEventEnd:l,redirectCount:f,startTime:p,transferSize:h,type:g}=e;return s===0?null:{type:`${t}.${g}`,start:vt(p),end:vt(i),name:n,data:{size:h,decodedBodySize:r,encodedBodySize:o,duration:s,domInteractive:u,domContentLoadedEventStart:c,domContentLoadedEventEnd:a,loadEventStart:d,loadEventEnd:l,domComplete:i,redirectCount:f}}}function Bg(e){const{entryType:t,initiatorType:n,name:r,responseEnd:s,startTime:i,decodedBodySize:o,encodedBodySize:c,responseStatus:a,transferSize:u}=e;return["fetch","xmlhttprequest"].includes(n)?null:{type:`${t}.${n}`,start:vt(i),end:vt(s),name:r,data:{size:u,statusCode:a,decodedBodySize:o,encodedBodySize:c}}}function Ug(e){const t=e.entries[e.entries.length-1],n=t?.element?[t.element]:void 0;return js(e,"largest-contentful-paint",n)}function Hg(e){return e.sources!==void 0}function $g(e){const t=[],n=[];for(const r of e.entries)if(Hg(r)){const s=[];for(const i of r.sources)if(i.node){n.push(i.node);const o=Le.mirror.getId(i.node);o&&s.push(o)}t.push({value:r.value,nodeIds:s.length?s:void 0})}return js(e,"cumulative-layout-shift",n,t)}function Wg(e){const t=e.entries[e.entries.length-1],n=t?.target?[t.target]:void 0;return js(e,"interaction-to-next-paint",n)}function js(e,t,n,r){const s=e.value,i=e.rating,o=vt(s);return{type:"web-vital",name:t,start:o,end:o,data:{value:s,size:s,rating:i,nodeIds:n?n.map(c=>Le.mirror.getId(c)):void 0,attributions:r}}}function zg(e){function t(s){e.performanceEntries.includes(s)||e.performanceEntries.push(s)}function n({entries:s}){s.forEach(t)}const r=[];return["navigation","paint","resource"].forEach(s=>{r.push(it(s,n))}),r.push(xs(Lr(Ug,e)),As(Lr($g,e)),za(Lr(Wg,e))),()=>{r.forEach(s=>s())}}const C=typeof __SENTRY_DEBUG__>"u"||__SENTRY_DEBUG__,qg='var t=Uint8Array,n=Uint16Array,r=Int32Array,e=new t([0,0,0,0,0,0,0,0,1,1,1,1,2,2,2,2,3,3,3,3,4,4,4,4,5,5,5,5,0,0,0,0]),i=new t([0,0,0,0,1,1,2,2,3,3,4,4,5,5,6,6,7,7,8,8,9,9,10,10,11,11,12,12,13,13,0,0]),s=new t([16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15]),a=function(t,e){for(var i=new n(31),s=0;s<31;++s)i[s]=e+=1<<t[s-1];var a=new r(i[30]);for(s=1;s<30;++s)for(var o=i[s];o<i[s+1];++o)a[o]=o-i[s]<<5|s;return{b:i,r:a}},o=a(e,2),h=o.b,f=o.r;h[28]=258,f[258]=28;for(var l=a(i,0).r,u=new n(32768),c=0;c<32768;++c){var v=(43690&c)>>1|(21845&c)<<1;v=(61680&(v=(52428&v)>>2|(13107&v)<<2))>>4|(3855&v)<<4,u[c]=((65280&v)>>8|(255&v)<<8)>>1}var d=function(t,r,e){for(var i=t.length,s=0,a=new n(r);s<i;++s)t[s]&&++a[t[s]-1];var o,h=new n(r);for(s=1;s<r;++s)h[s]=h[s-1]+a[s-1]<<1;if(e){o=new n(1<<r);var f=15-r;for(s=0;s<i;++s)if(t[s])for(var l=s<<4|t[s],c=r-t[s],v=h[t[s]-1]++<<c,d=v|(1<<c)-1;v<=d;++v)o[u[v]>>f]=l}else for(o=new n(i),s=0;s<i;++s)t[s]&&(o[s]=u[h[t[s]-1]++]>>15-t[s]);return o},p=new t(288);for(c=0;c<144;++c)p[c]=8;for(c=144;c<256;++c)p[c]=9;for(c=256;c<280;++c)p[c]=7;for(c=280;c<288;++c)p[c]=8;var g=new t(32);for(c=0;c<32;++c)g[c]=5;var w=d(p,9,0),y=d(g,5,0),m=function(t){return(t+7)/8|0},b=function(n,r,e){return(null==e||e>n.length)&&(e=n.length),new t(n.subarray(r,e))},M=["unexpected EOF","invalid block type","invalid length/literal","invalid distance","stream finished","no stream handler",,"no callback","invalid UTF-8 data","extra field too long","date not in range 1980-2099","filename too long","stream finishing","invalid zip data"],E=function(t,n,r){var e=new Error(n||M[t]);if(e.code=t,Error.captureStackTrace&&Error.captureStackTrace(e,E),!r)throw e;return e},z=function(t,n,r){r<<=7&n;var e=n/8|0;t[e]|=r,t[e+1]|=r>>8},_=function(t,n,r){r<<=7&n;var e=n/8|0;t[e]|=r,t[e+1]|=r>>8,t[e+2]|=r>>16},x=function(r,e){for(var i=[],s=0;s<r.length;++s)r[s]&&i.push({s:s,f:r[s]});var a=i.length,o=i.slice();if(!a)return{t:F,l:0};if(1==a){var h=new t(i[0].s+1);return h[i[0].s]=1,{t:h,l:1}}i.sort(function(t,n){return t.f-n.f}),i.push({s:-1,f:25001});var f=i[0],l=i[1],u=0,c=1,v=2;for(i[0]={s:-1,f:f.f+l.f,l:f,r:l};c!=a-1;)f=i[i[u].f<i[v].f?u++:v++],l=i[u!=c&&i[u].f<i[v].f?u++:v++],i[c++]={s:-1,f:f.f+l.f,l:f,r:l};var d=o[0].s;for(s=1;s<a;++s)o[s].s>d&&(d=o[s].s);var p=new n(d+1),g=A(i[c-1],p,0);if(g>e){s=0;var w=0,y=g-e,m=1<<y;for(o.sort(function(t,n){return p[n.s]-p[t.s]||t.f-n.f});s<a;++s){var b=o[s].s;if(!(p[b]>e))break;w+=m-(1<<g-p[b]),p[b]=e}for(w>>=y;w>0;){var M=o[s].s;p[M]<e?w-=1<<e-p[M]++-1:++s}for(;s>=0&&w;--s){var E=o[s].s;p[E]==e&&(--p[E],++w)}g=e}return{t:new t(p),l:g}},A=function(t,n,r){return-1==t.s?Math.max(A(t.l,n,r+1),A(t.r,n,r+1)):n[t.s]=r},D=function(t){for(var r=t.length;r&&!t[--r];);for(var e=new n(++r),i=0,s=t[0],a=1,o=function(t){e[i++]=t},h=1;h<=r;++h)if(t[h]==s&&h!=r)++a;else{if(!s&&a>2){for(;a>138;a-=138)o(32754);a>2&&(o(a>10?a-11<<5|28690:a-3<<5|12305),a=0)}else if(a>3){for(o(s),--a;a>6;a-=6)o(8304);a>2&&(o(a-3<<5|8208),a=0)}for(;a--;)o(s);a=1,s=t[h]}return{c:e.subarray(0,i),n:r}},T=function(t,n){for(var r=0,e=0;e<n.length;++e)r+=t[e]*n[e];return r},k=function(t,n,r){var e=r.length,i=m(n+2);t[i]=255&e,t[i+1]=e>>8,t[i+2]=255^t[i],t[i+3]=255^t[i+1];for(var s=0;s<e;++s)t[i+s+4]=r[s];return 8*(i+4+e)},U=function(t,r,a,o,h,f,l,u,c,v,m){z(r,m++,a),++h[256];for(var b=x(h,15),M=b.t,E=b.l,A=x(f,15),U=A.t,C=A.l,F=D(M),I=F.c,S=F.n,L=D(U),O=L.c,j=L.n,q=new n(19),B=0;B<I.length;++B)++q[31&I[B]];for(B=0;B<O.length;++B)++q[31&O[B]];for(var G=x(q,7),H=G.t,J=G.l,K=19;K>4&&!H[s[K-1]];--K);var N,P,Q,R,V=v+5<<3,W=T(h,p)+T(f,g)+l,X=T(h,M)+T(f,U)+l+14+3*K+T(q,H)+2*q[16]+3*q[17]+7*q[18];if(c>=0&&V<=W&&V<=X)return k(r,m,t.subarray(c,c+v));if(z(r,m,1+(X<W)),m+=2,X<W){N=d(M,E,0),P=M,Q=d(U,C,0),R=U;var Y=d(H,J,0);z(r,m,S-257),z(r,m+5,j-1),z(r,m+10,K-4),m+=14;for(B=0;B<K;++B)z(r,m+3*B,H[s[B]]);m+=3*K;for(var Z=[I,O],$=0;$<2;++$){var tt=Z[$];for(B=0;B<tt.length;++B){var nt=31&tt[B];z(r,m,Y[nt]),m+=H[nt],nt>15&&(z(r,m,tt[B]>>5&127),m+=tt[B]>>12)}}}else N=w,P=p,Q=y,R=g;for(B=0;B<u;++B){var rt=o[B];if(rt>255){_(r,m,N[(nt=rt>>18&31)+257]),m+=P[nt+257],nt>7&&(z(r,m,rt>>23&31),m+=e[nt]);var et=31&rt;_(r,m,Q[et]),m+=R[et],et>3&&(_(r,m,rt>>5&8191),m+=i[et])}else _(r,m,N[rt]),m+=P[rt]}return _(r,m,N[256]),m+P[256]},C=new r([65540,131080,131088,131104,262176,1048704,1048832,2114560,2117632]),F=new t(0),I=function(){for(var t=new Int32Array(256),n=0;n<256;++n){for(var r=n,e=9;--e;)r=(1&r&&-306674912)^r>>>1;t[n]=r}return t}(),S=function(){var t=1,n=0;return{p:function(r){for(var e=t,i=n,s=0|r.length,a=0;a!=s;){for(var o=Math.min(a+2655,s);a<o;++a)i+=e+=r[a];e=(65535&e)+15*(e>>16),i=(65535&i)+15*(i>>16)}t=e,n=i},d:function(){return(255&(t%=65521))<<24|(65280&t)<<8|(255&(n%=65521))<<8|n>>8}}},L=function(s,a,o,h,u){if(!u&&(u={l:1},a.dictionary)){var c=a.dictionary.subarray(-32768),v=new t(c.length+s.length);v.set(c),v.set(s,c.length),s=v,u.w=c.length}return function(s,a,o,h,u,c){var v=c.z||s.length,d=new t(h+v+5*(1+Math.ceil(v/7e3))+u),p=d.subarray(h,d.length-u),g=c.l,w=7&(c.r||0);if(a){w&&(p[0]=c.r>>3);for(var y=C[a-1],M=y>>13,E=8191&y,z=(1<<o)-1,_=c.p||new n(32768),x=c.h||new n(z+1),A=Math.ceil(o/3),D=2*A,T=function(t){return(s[t]^s[t+1]<<A^s[t+2]<<D)&z},F=new r(25e3),I=new n(288),S=new n(32),L=0,O=0,j=c.i||0,q=0,B=c.w||0,G=0;j+2<v;++j){var H=T(j),J=32767&j,K=x[H];if(_[J]=K,x[H]=J,B<=j){var N=v-j;if((L>7e3||q>24576)&&(N>423||!g)){w=U(s,p,0,F,I,S,O,q,G,j-G,w),q=L=O=0,G=j;for(var P=0;P<286;++P)I[P]=0;for(P=0;P<30;++P)S[P]=0}var Q=2,R=0,V=E,W=J-K&32767;if(N>2&&H==T(j-W))for(var X=Math.min(M,N)-1,Y=Math.min(32767,j),Z=Math.min(258,N);W<=Y&&--V&&J!=K;){if(s[j+Q]==s[j+Q-W]){for(var $=0;$<Z&&s[j+$]==s[j+$-W];++$);if($>Q){if(Q=$,R=W,$>X)break;var tt=Math.min(W,$-2),nt=0;for(P=0;P<tt;++P){var rt=j-W+P&32767,et=rt-_[rt]&32767;et>nt&&(nt=et,K=rt)}}}W+=(J=K)-(K=_[J])&32767}if(R){F[q++]=268435456|f[Q]<<18|l[R];var it=31&f[Q],st=31&l[R];O+=e[it]+i[st],++I[257+it],++S[st],B=j+Q,++L}else F[q++]=s[j],++I[s[j]]}}for(j=Math.max(j,B);j<v;++j)F[q++]=s[j],++I[s[j]];w=U(s,p,g,F,I,S,O,q,G,j-G,w),g||(c.r=7&w|p[w/8|0]<<3,w-=7,c.h=x,c.p=_,c.i=j,c.w=B)}else{for(j=c.w||0;j<v+g;j+=65535){var at=j+65535;at>=v&&(p[w/8|0]=g,at=v),w=k(p,w+1,s.subarray(j,at))}c.i=v}return b(d,0,h+m(w)+u)}(s,null==a.level?6:a.level,null==a.mem?u.l?Math.ceil(1.5*Math.max(8,Math.min(13,Math.log(s.length)))):20:12+a.mem,o,h,u)},O=function(t,n,r){for(;r;++n)t[n]=r,r>>>=8},j=function(){function n(n,r){if("function"==typeof n&&(r=n,n={}),this.ondata=r,this.o=n||{},this.s={l:0,i:32768,w:32768,z:32768},this.b=new t(98304),this.o.dictionary){var e=this.o.dictionary.subarray(-32768);this.b.set(e,32768-e.length),this.s.i=32768-e.length}}return n.prototype.p=function(t,n){this.ondata(L(t,this.o,0,0,this.s),n)},n.prototype.push=function(n,r){this.ondata||E(5),this.s.l&&E(4);var e=n.length+this.s.z;if(e>this.b.length){if(e>2*this.b.length-32768){var i=new t(-32768&e);i.set(this.b.subarray(0,this.s.z)),this.b=i}var s=this.b.length-this.s.z;this.b.set(n.subarray(0,s),this.s.z),this.s.z=this.b.length,this.p(this.b,!1),this.b.set(this.b.subarray(-32768)),this.b.set(n.subarray(s),32768),this.s.z=n.length-s+32768,this.s.i=32766,this.s.w=32768}else this.b.set(n,this.s.z),this.s.z+=n.length;this.s.l=1&r,(this.s.z>this.s.w+8191||r)&&(this.p(this.b,r||!1),this.s.w=this.s.i,this.s.i-=2)},n.prototype.flush=function(){this.ondata||E(5),this.s.l&&E(4),this.p(this.b,!1),this.s.w=this.s.i,this.s.i-=2},n}();function q(t,n){n||(n={});var r=function(){var t=-1;return{p:function(n){for(var r=t,e=0;e<n.length;++e)r=I[255&r^n[e]]^r>>>8;t=r},d:function(){return~t}}}(),e=t.length;r.p(t);var i,s=L(t,n,10+((i=n).filename?i.filename.length+1:0),8),a=s.length;return function(t,n){var r=n.filename;if(t[0]=31,t[1]=139,t[2]=8,t[8]=n.level<2?4:9==n.level?2:0,t[9]=3,0!=n.mtime&&O(t,4,Math.floor(new Date(n.mtime||Date.now())/1e3)),r){t[3]=8;for(var e=0;e<=r.length;++e)t[e+10]=r.charCodeAt(e)}}(s,n),O(s,a-8,r.d()),O(s,a-4,e),s}var B=function(){function t(t,n){this.c=S(),this.v=1,j.call(this,t,n)}return t.prototype.push=function(t,n){this.c.p(t),j.prototype.push.call(this,t,n)},t.prototype.p=function(t,n){var r=L(t,this.o,this.v&&(this.o.dictionary?6:2),n&&4,this.s);this.v&&(function(t,n){var r=n.level,e=0==r?0:r<6?1:9==r?3:2;if(t[0]=120,t[1]=e<<6|(n.dictionary&&32),t[1]|=31-(t[0]<<8|t[1])%31,n.dictionary){var i=S();i.p(n.dictionary),O(t,2,i.d())}}(r,this.o),this.v=0),n&&O(r,r.length-4,this.c.d()),this.ondata(r,n)},t.prototype.flush=function(){j.prototype.flush.call(this)},t}(),G="undefined"!=typeof TextEncoder&&new TextEncoder,H="undefined"!=typeof TextDecoder&&new TextDecoder;try{H.decode(F,{stream:!0})}catch(t){}var J=function(){function t(t){this.ondata=t}return t.prototype.push=function(t,n){this.ondata||E(5),this.d&&E(4),this.ondata(K(t),this.d=n||!1)},t}();function K(n,r){if(G)return G.encode(n);for(var e=n.length,i=new t(n.length+(n.length>>1)),s=0,a=function(t){i[s++]=t},o=0;o<e;++o){if(s+5>i.length){var h=new t(s+8+(e-o<<1));h.set(i),i=h}var f=n.charCodeAt(o);f<128||r?a(f):f<2048?(a(192|f>>6),a(128|63&f)):f>55295&&f<57344?(a(240|(f=65536+(1047552&f)|1023&n.charCodeAt(++o))>>18),a(128|f>>12&63),a(128|f>>6&63),a(128|63&f)):(a(224|f>>12),a(128|f>>6&63),a(128|63&f))}return b(i,0,s)}const N=new class{constructor(){this._init()}clear(){this._init()}addEvent(t){if(!t)throw new Error("Adding invalid event");const n=this._hasEvents?",":"";this.stream.push(n+t),this._hasEvents=!0}finish(){this.stream.push("]",!0);const t=function(t){let n=0;for(const r of t)n+=r.length;const r=new Uint8Array(n);for(let n=0,e=0,i=t.length;n<i;n++){const i=t[n];r.set(i,e),e+=i.length}return r}(this._deflatedData);return this._init(),t}_init(){this._hasEvents=!1,this._deflatedData=[],this.deflate=new B,this.deflate.ondata=(t,n)=>{this._deflatedData.push(t)},this.stream=new J((t,n)=>{this.deflate.push(t,n)}),this.stream.push("[")}},P={clear:()=>{N.clear()},addEvent:t=>N.addEvent(t),finish:()=>N.finish(),compress:t=>function(t){return q(K(t))}(t)};addEventListener("message",function(t){const n=t.data.method,r=t.data.id,e=t.data.arg;if(n in P&&"function"==typeof P[n])try{const t=P[n](e);postMessage({id:r,method:n,success:!0,response:t})}catch(t){postMessage({id:r,method:n,success:!1,response:t.message}),console.error(t)}}),postMessage({id:void 0,method:"init",success:!0,response:void 0});';function jg(){const e=new Blob([qg]);return URL.createObjectURL(e)}const mo=["log","warn","error"],xn="[Replay] ";function Dr(e,t="info"){je({category:"console",data:{logger:"replay"},level:t,message:`${xn}${e}`},{level:t})}function Vg(){let e=!1,t=!1;const n={exception:()=>{},infoTick:()=>{},setConfig:r=>{e=!!r.captureExceptions,t=!!r.traceInternals}};return C?(mo.forEach(r=>{n[r]=(...s)=>{m[r](xn,...s),t&&Dr(s.join(""),ka(r))}}),n.exception=(r,...s)=>{s.length&&n.error&&n.error(...s),m.error(xn,r),e?Ou(r,{mechanism:{handled:!0,type:"auto.function.replay.debug"}}):t&&Dr(r,"error")},n.infoTick=(...r)=>{m.log(xn,...r),t&&setTimeout(()=>Dr(r[0]),0)}):mo.forEach(r=>{n[r]=()=>{}}),n}const M=Vg();class Vs extends Error{constructor(){super(`Event buffer exceeded maximum size of ${Fs}.`)}}class Mc{constructor(){this.events=[],this._totalSize=0,this.hasCheckout=!1,this.waitForCheckout=!1}get hasEvents(){return this.events.length>0}get type(){return"sync"}destroy(){this.events=[]}async addEvent(t){const n=JSON.stringify(t).length;if(this._totalSize+=n,this._totalSize>Fs)throw new Vs;this.events.push(t)}finish(){return new Promise(t=>{const n=this.events;this.clear(),t(JSON.stringify(n))})}clear(){this.events=[],this._totalSize=0,this.hasCheckout=!1}getEarliestTimestamp(){const t=this.events.map(n=>n.timestamp).sort()[0];return t?zs(t):null}}class Gg{constructor(t){this._worker=t,this._id=0}ensureReady(){return this._ensureReadyPromise?this._ensureReadyPromise:(this._ensureReadyPromise=new Promise((t,n)=>{this._worker.addEventListener("message",({data:r})=>{r.success?t():n()},{once:!0}),this._worker.addEventListener("error",r=>{n(r)},{once:!0})}),this._ensureReadyPromise)}destroy(){C&&M.log("Destroying compression worker"),this._worker.terminate()}postMessage(t,n){const r=this._getAndIncrementId();return new Promise((s,i)=>{const o=({data:c})=>{const a=c;if(a.method===t&&a.id===r){if(this._worker.removeEventListener("message",o),!a.success){C&&M.error("Error in compression worker: ",a.response),i(new Error("Error in compression worker"));return}s(a.response)}};this._worker.addEventListener("message",o),this._worker.postMessage({id:r,method:t,arg:n})})}_getAndIncrementId(){return this._id++}}class Yg{constructor(t){this._worker=new Gg(t),this._earliestTimestamp=null,this._totalSize=0,this.hasCheckout=!1,this.waitForCheckout=!1}get hasEvents(){return!!this._earliestTimestamp}get type(){return"worker"}ensureReady(){return this._worker.ensureReady()}destroy(){this._worker.destroy()}addEvent(t){const n=zs(t.timestamp);(!this._earliestTimestamp||n<this._earliestTimestamp)&&(this._earliestTimestamp=n);const r=JSON.stringify(t);return this._totalSize+=r.length,this._totalSize>Fs?Promise.reject(new Vs):this._sendEventToWorker(r)}finish(){return this._finishRequest()}clear(){this._earliestTimestamp=null,this._totalSize=0,this.hasCheckout=!1,this._worker.postMessage("clear").then(null,t=>{C&&M.exception(t,'Sending "clear" message to worker failed',t)})}getEarliestTimestamp(){return this._earliestTimestamp}_sendEventToWorker(t){return this._worker.postMessage("addEvent",t)}async _finishRequest(){const t=await this._worker.postMessage("finish");return this._earliestTimestamp=null,this._totalSize=0,t}}class Jg{constructor(t){this._fallback=new Mc,this._compression=new Yg(t),this._used=this._fallback,this._ensureWorkerIsLoadedPromise=this._ensureWorkerIsLoaded()}get waitForCheckout(){return this._used.waitForCheckout}get type(){return this._used.type}get hasEvents(){return this._used.hasEvents}get hasCheckout(){return this._used.hasCheckout}set hasCheckout(t){this._used.hasCheckout=t}set waitForCheckout(t){this._used.waitForCheckout=t}destroy(){this._fallback.destroy(),this._compression.destroy()}clear(){return this._used.clear()}getEarliestTimestamp(){return this._used.getEarliestTimestamp()}addEvent(t){return this._used.addEvent(t)}async finish(){return await this.ensureWorkerIsLoaded(),this._used.finish()}ensureWorkerIsLoaded(){return this._ensureWorkerIsLoadedPromise}async _ensureWorkerIsLoaded(){try{await this._compression.ensureReady()}catch(t){C&&M.exception(t,"Failed to load the compression worker, falling back to simple buffer");return}await this._switchToCompressionWorker()}async _switchToCompressionWorker(){const{events:t,hasCheckout:n,waitForCheckout:r}=this._fallback,s=[];for(const i of t)s.push(this._compression.addEvent(i));this._compression.hasCheckout=n,this._compression.waitForCheckout=r,this._used=this._compression;try{await Promise.all(s),this._fallback.clear()}catch(i){C&&M.exception(i,"Failed to add events when switching buffers.")}}}function Kg({useCompression:e,workerUrl:t}){if(e&&window.Worker){const n=Xg(t);if(n)return n}return C&&M.log("Using simple buffer"),new Mc}function Xg(e){try{const t=e||Qg();if(!t)return;C&&M.log(`Using compression worker${e?` from ${e}`:""}`);const n=new Worker(t);return new Jg(n)}catch(t){C&&M.exception(t,"Failed to create compression worker")}}function Qg(){return typeof __SENTRY_EXCLUDE_REPLAY_WORKER__>"u"||!__SENTRY_EXCLUDE_REPLAY_WORKER__?jg():""}function Gs(){try{return"sessionStorage"in Z&&!!Z.sessionStorage}catch{return!1}}function Zg(e){e_(),e.session=void 0}function e_(){if(Gs())try{Z.sessionStorage.removeItem(Ls)}catch{}}function Ac(e){return e===void 0?!1:Math.random()<e}function hr(e){if(Gs())try{Z.sessionStorage.setItem(Ls,JSON.stringify(e))}catch{}}function xc(e){const t=Date.now(),n=e.id||Me(),r=e.started||t,s=e.lastActivity||t,i=e.segmentId||0,o=e.sampled,c=e.previousSessionId,a=e.dirty||!1;return{id:n,started:r,lastActivity:s,segmentId:i,sampled:o,previousSessionId:c,dirty:a}}function t_(e,t){return Ac(e)?"session":t?"buffer":!1}function go({sessionSampleRate:e,allowBuffering:t,stickySession:n=!1},{previousSessionId:r}={}){const s=t_(e,t),i=xc({sampled:s,previousSessionId:r});return n&&hr(i),i}function n_(){if(!Gs())return null;try{const e=Z.sessionStorage.getItem(Ls);if(!e)return null;const t=JSON.parse(e);return C&&M.infoTick("Loading existing session"),xc(t)}catch{return null}}function ss(e,t,n=+new Date){return e===null||t===void 0||t<0?!0:t===0?!1:e+t<=n}function Oc(e,{maxReplayDuration:t,sessionIdleExpire:n,targetTime:r=Date.now()}){return ss(e.started,t,r)||ss(e.lastActivity,n,r)}function Nc(e,{sessionIdleExpire:t,maxReplayDuration:n}){return!(!Oc(e,{sessionIdleExpire:t,maxReplayDuration:n})||e.sampled==="buffer"&&e.segmentId===0)}function Fr({sessionIdleExpire:e,maxReplayDuration:t,previousSessionId:n},r){const s=r.stickySession&&n_();return s?Nc(s,{sessionIdleExpire:e,maxReplayDuration:t})?(C&&M.infoTick("Session in sessionStorage is expired, creating new one..."),go(r,{previousSessionId:s.id})):s:(C&&M.infoTick("Creating new session"),go(r,{previousSessionId:n}))}function r_(e){return e.type===L.Custom}function Ys(e,t,n){return Lc(e,t)?(Pc(e,t,n),!0):!1}function s_(e,t,n){return Lc(e,t)?Pc(e,t,n):Promise.resolve(null)}async function Pc(e,t,n){const{eventBuffer:r}=e;if(!r||r.waitForCheckout&&!n)return null;const s=e.recordingMode==="buffer";try{n&&s&&r.clear(),n&&(r.hasCheckout=!0,r.waitForCheckout=!1);const i=e.getOptions(),o=i_(t,i.beforeAddRecordingEvent);return o?await r.addEvent(o):void 0}catch(i){const o=i&&i instanceof Vs,c=o?"addEventSizeExceeded":"addEvent",a=$();if(a){const u=o?"buffer_overflow":"internal_sdk_error";a.recordDroppedEvent(u,"replay")}if(o&&s)return r.clear(),r.waitForCheckout=!0,null;e.handleException(i),await e.stop({reason:c})}}function Lc(e,t){if(!e.eventBuffer||e.isPaused()||!e.isEnabled())return!1;const n=zs(t.timestamp);return n+e.timeouts.sessionIdlePause<Date.now()?!1:n>e.getContext().initialTimestamp+e.getOptions().maxReplayDuration?(C&&M.infoTick(`Skipping event with timestamp ${n} because it is after maxReplayDuration`),!1):!0}function i_(e,t){try{if(typeof t=="function"&&r_(e))return t(e)}catch(n){return C&&M.exception(n,"An error occurred in the `beforeAddRecordingEvent` callback, skipping the event..."),null}return e}function Js(e){return!e.type}function is(e){return e.type==="transaction"}function o_(e){return e.type==="replay_event"}function _o(e){return e.type==="feedback"}function a_(e){return(t,n)=>{if(!e.isEnabled()||!Js(t)&&!is(t))return;const r=n.statusCode;if(!(!r||r<200||r>=300)){if(is(t)){c_(e,t);return}u_(e,t)}}}function c_(e,t){const n=e.getContext();t.contexts?.trace?.trace_id&&n.traceIds.size<100&&n.traceIds.add(t.contexts.trace.trace_id)}function u_(e,t){const n=e.getContext();if(t.event_id&&n.errorIds.size<100&&n.errorIds.add(t.event_id),e.recordingMode!=="buffer"||!t.tags||!t.tags.replayId)return;const{beforeErrorSampling:r}=e.getOptions();typeof r=="function"&&!r(t)||sn(async()=>{try{await e.sendBufferedReplayOrFlush()}catch(s){e.handleException(s)}})}function l_(e){return t=>{!e.isEnabled()||!Js(t)||d_(e,t)}}function d_(e,t){const n=t.exception?.values?.[0]?.value;if(typeof n=="string"&&(n.match(/(reactjs\.org\/docs\/error-decoder\.html\?invariant=|react\.dev\/errors\/)(418|419|422|423|425)/)||n.match(/(does not match server-rendered HTML|Hydration failed because)/i))){const r=xe({category:"replay.hydrate-error",data:{url:Xt()}});an(e,r)}}function f_(e){const t=$();t&&t.on("beforeAddBreadcrumb",n=>p_(e,n))}function p_(e,t){if(!e.isEnabled()||!Dc(t))return;const n=h_(t);n&&an(e,n)}function h_(e){return!Dc(e)||["fetch","xhr","sentry.event","sentry.transaction"].includes(e.category)||e.category.startsWith("ui.")?null:e.category==="console"?m_(e):xe(e)}function m_(e){const t=e.data?.arguments;if(!Array.isArray(t)||t.length===0)return xe(e);let n=!1;const r=t.map(s=>{if(!s)return s;if(typeof s=="string")return s.length>mn?(n=!0,`${s.slice(0,mn)}…`):s;if(typeof s=="object")try{const i=tr(s,7);return JSON.stringify(i).length>mn?(n=!0,`${JSON.stringify(i,null,2).slice(0,mn)}…`):i}catch{}return s});return xe({...e,data:{...e.data,arguments:r,...n?{_meta:{warnings:["CONSOLE_ARG_TRUNCATED"]}}:{}}})}function Dc(e){return!!e.category}function g_(e,t){return e.type||!e.exception?.values?.length?!1:!!t.originalException?.__rrweb__}function Fc(){const e=te().getPropagationContext().dsc;e&&delete e.replay_id;const t=de();if(t){const n=De(t);delete n.replay_id}}function __(e,t){e.triggerUserActivity(),e.addUpdate(()=>t.timestamp?(e.throttledAddEvent({type:L.Custom,timestamp:t.timestamp*1e3,data:{tag:"breadcrumb",payload:{timestamp:t.timestamp,type:"default",category:"sentry.feedback",data:{feedbackId:t.event_id}}}}),!1):!0)}function S_(e,t){return e.recordingMode!=="buffer"||t.message===Ds||!t.exception||t.type?!1:Ac(e.getOptions().errorSampleRate)}function y_(e){return Object.assign((t,n)=>{if(!e.isEnabled()||e.isPaused())return t;if(o_(t))return delete t.breadcrumbs,t;if(!Js(t)&&!is(t)&&!_o(t))return t;if(!e.checkAndHandleExpiredSession())return Fc(),t;if(_o(t))return e.flush(),t.contexts.feedback.replay_id=e.getSessionId(),__(e,t),t;if(g_(t,n)&&!e.getOptions()._experiments.captureExceptions)return C&&M.log("Ignoring error from rrweb internals",t),null;const s=S_(e,t);if((s||e.recordingMode==="session")&&(t.tags={...t.tags,replayId:e.getSessionId()}),s&&e.recordingMode==="buffer"&&e.session?.sampled==="buffer"){const o=e.session;o.dirty=!0,e.getOptions().stickySession&&hr(o)}return t},{id:"Replay"})}function mr(e,t){return t.map(({type:n,start:r,end:s,name:i,data:o})=>{const c=e.throttledAddEvent({type:L.Custom,timestamp:r,data:{tag:"performanceSpan",payload:{op:n,description:i,startTimestamp:r,endTimestamp:s,data:o}}});return typeof c=="string"?Promise.resolve(null):c})}function E_(e){const{from:t,to:n}=e,r=Date.now()/1e3;return{type:"navigation.push",start:r,end:r,name:n,data:{previous:t}}}function b_(e){return t=>{if(!e.isEnabled())return;const n=E_(t);n!==null&&(e.getContext().urls.push(n.name),e.triggerUserActivity(),e.addUpdate(()=>(mr(e,[n]),!1)))}}function v_(e,t){return C&&e.getOptions()._experiments.traceInternals?!1:td(t,$())}function Bc(e,t){e.isEnabled()&&t!==null&&(v_(e,t.name)||e.addUpdate(()=>(mr(e,[t]),!0)))}function gr(e){if(!e)return;const t=new TextEncoder;try{if(typeof e=="string")return t.encode(e).length;if(e instanceof URLSearchParams)return t.encode(e.toString()).length;if(e instanceof FormData){const n=Xa(e);return t.encode(n).length}if(e instanceof Blob)return e.size;if(e instanceof ArrayBuffer)return e.byteLength}catch{}}function Uc(e){if(!e)return;const t=parseInt(e,10);return isNaN(t)?void 0:t}function Xn(e,t){if(!e)return{headers:{},size:void 0,_meta:{warnings:[t]}};const n={...e._meta},r=n.warnings||[];return n.warnings=[...r,t],e._meta=n,e}function Hc(e,t){if(!t)return null;const{startTimestamp:n,endTimestamp:r,url:s,method:i,statusCode:o,request:c,response:a}=t;return{type:e,start:n/1e3,end:r/1e3,name:s,data:{method:i,statusCode:o,request:c,response:a}}}function Vt(e){return{headers:{},size:e,_meta:{warnings:["URL_SKIPPED"]}}}function $e(e,t,n){if(!t&&Object.keys(e).length===0)return;if(!t)return{headers:e};if(!n)return{headers:e,size:t};const r={headers:e,size:t},{body:s,warnings:i}=T_(n);return r.body=s,i?.length&&(r._meta={warnings:i}),r}function os(e,t){return Object.entries(e).reduce((n,[r,s])=>{const i=r.toLowerCase();return t.includes(i)&&e[r]&&(n[i]=s),n},{})}function T_(e){if(!e||typeof e!="string")return{body:e};const t=e.length>Ki,n=I_(e);if(t){const r=e.slice(0,Ki);return n?{body:r,warnings:["MAYBE_JSON_TRUNCATED"]}:{body:`${r}…`,warnings:["TEXT_TRUNCATED"]}}if(n)try{return{body:JSON.parse(e)}}catch{}return{body:e}}function I_(e){const t=e[0],n=e[e.length-1];return t==="["&&n==="]"||t==="{"&&n==="}"}function Qn(e,t){const n=w_(e);return Pe(n,t)}function w_(e,t=Z.document.baseURI){if(e.startsWith("http://")||e.startsWith("https://")||e.startsWith(Z.location.origin))return e;const n=new URL(e,t);if(n.origin!==new URL(t).origin)return e;const r=n.href;return!e.endsWith("/")&&r.endsWith("/")?r.slice(0,-1):r}async function k_(e,t,n){try{const r=await C_(e,t,n),s=Hc("resource.fetch",r);Bc(n.replay,s)}catch(r){C&&M.exception(r,"Failed to capture fetch breadcrumb")}}function R_(e,t){const{input:n,response:r}=t,s=n?Za(n):void 0,i=gr(s),o=r?Uc(r.headers.get("content-length")):void 0;i!==void 0&&(e.data.request_body_size=i),o!==void 0&&(e.data.response_body_size=o)}async function C_(e,t,n){const r=Date.now(),{startTimestamp:s=r,endTimestamp:i=r}=t,{url:o,method:c,status_code:a=0,request_body_size:u,response_body_size:d}=e.data,l=Qn(o,n.networkDetailAllowUrls)&&!Qn(o,n.networkDetailDenyUrls),f=l?M_(n,t.input,u):Vt(u),p=await A_(l,n,t.response,d);return{startTimestamp:s,endTimestamp:i,url:o,method:c,statusCode:a,request:f,response:p}}function M_({networkCaptureBodies:e,networkRequestHeaders:t},n,r){const s=n?N_(n,t):{};if(!e)return $e(s,r,void 0);const i=Za(n),[o,c]=Qa(i,M),a=$e(s,r,o);return c?Xn(a,c):a}async function A_(e,{networkCaptureBodies:t,networkResponseHeaders:n},r,s){if(!e&&s!==void 0)return Vt(s);const i=r?$c(r.headers,n):{};if(!r||!t&&s!==void 0)return $e(i,s,void 0);const[o,c]=await O_(r),a=x_(o,{networkCaptureBodies:t,responseBodySize:s,captureDetails:e,headers:i});return c?Xn(a,c):a}function x_(e,{networkCaptureBodies:t,responseBodySize:n,captureDetails:r,headers:s}){try{const i=e?.length&&n===void 0?gr(e):n;return r?t?$e(s,i,e):$e(s,i,void 0):Vt(i)}catch(i){return C&&M.exception(i,"Failed to serialize response body"),$e(s,n,void 0)}}async function O_(e){const t=P_(e);if(!t)return[void 0,"BODY_PARSE_ERROR"];try{return[await L_(t)]}catch(n){return n instanceof Error&&n.message.indexOf("Timeout")>-1?(C&&M.warn("Parsing text body from response timed out"),[void 0,"BODY_PARSE_TIMEOUT"]):(C&&M.exception(n,"Failed to get text body from response"),[void 0,"BODY_PARSE_ERROR"])}}function $c(e,t){const n={};return t.forEach(r=>{e.get(r)&&(n[r]=e.get(r))}),n}function N_(e,t){return e.length===1&&typeof e[0]!="string"?So(e[0],t):e.length===2?So(e[1],t):{}}function So(e,t){if(!e)return{};const n=e.headers;return n?n instanceof Headers?$c(n,t):Array.isArray(n)?{}:os(n,t):{}}function P_(e){try{return e.clone()}catch(t){C&&M.exception(t,"Failed to clone response body")}}function L_(e){return new Promise((t,n)=>{const r=sn(()=>n(new Error("Timeout while trying to read response body")),500);D_(e).then(s=>t(s),s=>n(s)).finally(()=>clearTimeout(r))})}async function D_(e){return await e.text()}async function F_(e,t,n){try{const r=U_(e,t,n),s=Hc("resource.xhr",r);Bc(n.replay,s)}catch(r){C&&M.exception(r,"Failed to capture xhr breadcrumb")}}function B_(e,t){const{xhr:n,input:r}=t;if(!n)return;const s=gr(r),i=n.getResponseHeader("content-length")?Uc(n.getResponseHeader("content-length")):W_(n.response,n.responseType);s!==void 0&&(e.data.request_body_size=s),i!==void 0&&(e.data.response_body_size=i)}function U_(e,t,n){const r=Date.now(),{startTimestamp:s=r,endTimestamp:i=r,input:o,xhr:c}=t,{url:a,method:u,status_code:d=0,request_body_size:l,response_body_size:f}=e.data;if(!a)return null;if(!c||!Qn(a,n.networkDetailAllowUrls)||Qn(a,n.networkDetailDenyUrls)){const A=Vt(l),_=Vt(f);return{startTimestamp:s,endTimestamp:i,url:a,method:u,statusCode:d,request:A,response:_}}const p=c[Qe],h=p?os(p.request_headers,n.networkRequestHeaders):{},g=os(ec(c),n.networkResponseHeaders),[S,y]=n.networkCaptureBodies?Qa(o,M):[void 0],[T,B]=n.networkCaptureBodies?H_(c):[void 0],N=$e(h,l,S),z=$e(g,f,T);return{startTimestamp:s,endTimestamp:i,url:a,method:u,statusCode:d,request:y?Xn(N,y):N,response:B?Xn(z,B):z}}function H_(e){const t=[];try{return[e.responseText]}catch(n){t.push(n)}try{return $_(e.response,e.responseType)}catch(n){t.push(n)}return C&&M.warn("Failed to get xhr response body",...t),[void 0]}function $_(e,t){try{if(typeof e=="string")return[e];if(e instanceof Document)return[e.body.outerHTML];if(t==="json"&&e&&typeof e=="object")return[JSON.stringify(e)];if(!e)return[void 0]}catch(n){return C&&M.exception(n,"Failed to serialize body",e),[void 0,"BODY_PARSE_ERROR"]}return C&&M.log("Skipping network body because of body type",e),[void 0,"UNPARSEABLE_BODY_TYPE"]}function W_(e,t){try{const n=t==="json"&&e&&typeof e=="object"?JSON.stringify(e):e;return gr(n)}catch{return}}function z_(e){const t=$();try{const{networkDetailAllowUrls:n,networkDetailDenyUrls:r,networkCaptureBodies:s,networkRequestHeaders:i,networkResponseHeaders:o}=e.getOptions(),c={replay:e,networkDetailAllowUrls:n,networkDetailDenyUrls:r,networkCaptureBodies:s,networkRequestHeaders:i,networkResponseHeaders:o};t&&t.on("beforeAddBreadcrumb",(a,u)=>q_(c,a,u))}catch{}}function q_(e,t,n){if(t.data)try{j_(t)&&G_(n)&&(B_(t,n),F_(t,n,e)),V_(t)&&Y_(n)&&(R_(t,n),k_(t,n,e))}catch(r){C&&M.exception(r,"Error when enriching network breadcrumb")}}function j_(e){return e.category==="xhr"}function V_(e){return e.category==="fetch"}function G_(e){return e?.xhr}function Y_(e){return e?.response}function J_(e){const t=$();Ja(kg(e)),lr(b_(e)),f_(e),z_(e);const n=y_(e);xu(n),t&&(t.on("beforeSendEvent",l_(e)),t.on("afterSendEvent",a_(e)),t.on("createDsc",r=>{const s=e.getSessionId();s&&e.isEnabled()&&e.recordingMode==="session"&&e.checkAndHandleExpiredSession()&&(r.replay_id=s)}),t.on("spanStart",r=>{e.lastActiveSpan=r}),t.on("spanEnd",r=>{e.lastActiveSpan=r}),t.on("beforeSendFeedback",async(r,s)=>{const i=e.getSessionId();s?.includeReplay&&e.isEnabled()&&i&&r.contexts?.feedback&&(r.contexts.feedback.source==="api"&&await e.sendBufferedReplayOrFlush(),r.contexts.feedback.replay_id=i)}),t.on("openFeedbackWidget",async()=>{await e.sendBufferedReplayOrFlush()}))}async function K_(e){try{return Promise.all(mr(e,[X_(Z.performance.memory)]))}catch{return[]}}function X_(e){const{jsHeapSizeLimit:t,totalJSHeapSize:n,usedJSHeapSize:r}=e,s=Date.now()/1e3;return{type:"memory",name:"memory",start:s,end:s,data:{memory:{jsHeapSizeLimit:t,totalJSHeapSize:n,usedJSHeapSize:r}}}}function Q_(e,t,n){return ad(e,t,{...n,setTimeoutImpl:sn})}const yn=X.navigator;function Z_(){return/iPhone|iPad|iPod/i.test(yn?.userAgent??"")||/Macintosh/i.test(yn?.userAgent??"")&&yn?.maxTouchPoints&&yn?.maxTouchPoints>1?{sampling:{mousemove:!1}}:{}}function eS(e){let t=!1;return(n,r)=>{if(!e.checkAndHandleExpiredSession()){C&&M.warn("Received replay event after session expired.");return}const s=r||!t;t=!0,e.clickDetector&&bg(e.clickDetector,n),e.addUpdate(()=>{if(e.recordingMode==="buffer"&&s&&e.setInitialState(),!Ys(e,n,s))return!0;if(!s)return!1;const i=e.session;if(nS(e,s),e.recordingMode==="buffer"&&i&&e.eventBuffer&&!i.dirty){const o=e.eventBuffer.getEarliestTimestamp();o&&(C&&M.log(`Updating session start time to earliest event in buffer to ${new Date(o)}`),i.started=o,e.getOptions().stickySession&&hr(i))}return i?.previousSessionId||e.recordingMode==="session"&&e.flush(),!0})}}function tS(e){const t=e.getOptions();return{type:L.Custom,timestamp:Date.now(),data:{tag:"options",payload:{shouldRecordCanvas:e.isRecordingCanvas(),sessionSampleRate:t.sessionSampleRate,errorSampleRate:t.errorSampleRate,useCompressionOption:t.useCompression,blockAllMedia:t.blockAllMedia,maskAllText:t.maskAllText,maskAllInputs:t.maskAllInputs,useCompression:e.eventBuffer?e.eventBuffer.type==="worker":!1,networkDetailHasUrls:t.networkDetailAllowUrls.length>0,networkCaptureBodies:t.networkCaptureBodies,networkRequestHasHeaders:t.networkRequestHeaders.length>0,networkResponseHasHeaders:t.networkResponseHeaders.length>0}}}}function nS(e,t){!t||!e.session||e.session.segmentId!==0||Ys(e,tS(e),!1)}function rS(e){if(!e)return null;try{return e.nodeType===e.ELEMENT_NODE?e:e.parentElement}catch{return null}}function sS(e,t,n,r){return Be(sa(e,or(e),r,n),[[{type:"replay_event"},e],[{type:"replay_recording",length:typeof t=="string"?new TextEncoder().encode(t).length:t.length},t]])}function iS({recordingData:e,headers:t}){let n;const r=`${JSON.stringify(t)}
23
+ `;if(typeof e=="string")n=`${r}${e}`;else{const i=new TextEncoder().encode(r);n=new Uint8Array(i.length+e.length),n.set(i),n.set(e,i.length)}return n}async function oS({client:e,scope:t,replayId:n,event:r}){const s=typeof e._integrations=="object"&&e._integrations!==null&&!Array.isArray(e._integrations)?Object.keys(e._integrations):void 0,i={event_id:n,integrations:s};e.emit("preprocessEvent",r,i);const o=await jo(e.getOptions(),r,i,t,e,wt());if(!o)return null;e.emit("postprocessEvent",o,i),o.platform=o.platform||"javascript";const c=e.getSdkMetadata(),{name:a,version:u,settings:d}=c?.sdk||{};return o.sdk={...o.sdk,name:a||"sentry.javascript.unknown",version:u||"0.0.0",settings:d},o}async function aS({recordingData:e,replayId:t,segmentId:n,eventContext:r,timestamp:s,session:i}){const o=iS({recordingData:e,headers:{segment_id:n}}),{urls:c,errorIds:a,traceIds:u,initialTimestamp:d}=r,l=$(),f=te(),p=l?.getTransport(),h=l?.getDsn();if(!l||!p||!h||!i.sampled)return Promise.resolve({});const g={type:Fh,replay_start_timestamp:d/1e3,timestamp:s/1e3,error_ids:a,trace_ids:u,urls:c,replay_id:t,segment_id:n,replay_type:i.sampled},S=await oS({scope:f,client:l,replayId:t,event:g});if(!S)return l.recordDroppedEvent("event_processor","replay"),C&&M.log("An event processor returned `null`, will not send event."),Promise.resolve({});delete S.sdkProcessingMetadata;const y=sS(S,o,h,l.getOptions().tunnel);let T;try{T=await p.send(y)}catch(N){const z=new Error(Ds);try{z.cause=N}catch{}throw z}if(typeof T.statusCode=="number"&&(T.statusCode<200||T.statusCode>=300))throw new Wc(T.statusCode);const B=ga({},T);if(ma(B,"replay"))throw new Ks(B);return T}class Wc extends Error{constructor(t){super(`Transport returned status code ${t}`)}}class Ks extends Error{constructor(t){super("Rate limit hit"),this.rateLimits=t}}async function zc(e,t={count:0,interval:zh}){const{recordingData:n,onError:r}=e;if(n.length)try{return await aS(e),!0}catch(s){if(s instanceof Wc||s instanceof Ks)throw s;if(ea("Replays",{_retryCount:t.count}),r&&r(s),t.count>=qh){const i=new Error(`${Ds} - max retries exceeded`);try{i.cause=s}catch{}throw i}return t.interval*=++t.count,new Promise((i,o)=>{sn(async()=>{try{await zc(e,t),i(!0)}catch(c){o(c)}},t.interval)})}}const qc="__THROTTLED",cS="__SKIPPED";function uS(e,t,n){const r=new Map,s=c=>{const a=c-n;r.forEach((u,d)=>{d<a&&r.delete(d)})},i=()=>[...r.values()].reduce((c,a)=>c+a,0);let o=!1;return(...c)=>{const a=Math.floor(Date.now()/1e3);if(s(a),i()>=t){const d=o;return o=!0,d?cS:qc}o=!1;const u=r.get(a)||0;return r.set(a,u+1),e(...c)}}class lS{constructor({options:t,recordingOptions:n}){this.eventBuffer=null,this.performanceEntries=[],this.replayPerformanceEntries=[],this.recordingMode="session",this.timeouts={sessionIdlePause:Bh,sessionIdleExpire:Uh},this._lastActivity=Date.now(),this._isEnabled=!1,this._isPaused=!1,this._requiresManualStart=!1,this._hasInitializedCoreListeners=!1,this._context={errorIds:new Set,traceIds:new Set,urls:[],initialTimestamp:Date.now(),initialUrl:""},this._recordingOptions=n,this._options=t,this._debouncedFlush=Q_(()=>this._flush(),this._options.flushMinDelay,{maxWait:this._options.flushMaxDelay}),this._throttledAddEvent=uS((o,c)=>s_(this,o,c),300,5);const{slowClickTimeout:r,slowClickIgnoreSelectors:s}=this.getOptions(),i=r?{threshold:Math.min(jh,r),timeout:r,scrollTimeout:Vh,ignoreSelector:s?s.join(","):""}:void 0;if(i&&(this.clickDetector=new _g(this,i)),C){const o=t._experiments;M.setConfig({captureExceptions:!!o.captureExceptions,traceInternals:!!o.traceInternals})}this._handleVisibilityChange=()=>{Z.document.visibilityState==="visible"?this._doChangeToForegroundTasks():this._doChangeToBackgroundTasks()},this._handleWindowBlur=()=>{const o=xe({category:"ui.blur"});this._doChangeToBackgroundTasks(o)},this._handleWindowFocus=()=>{const o=xe({category:"ui.focus"});this._doChangeToForegroundTasks(o)},this._handleKeyboardEvent=o=>{Ag(this,o)}}getContext(){return this._context}isEnabled(){return this._isEnabled}isPaused(){return this._isPaused}isRecordingCanvas(){return!!this._canvas}getOptions(){return this._options}handleException(t){C&&M.exception(t),this._options.onError&&this._options.onError(t)}initializeSampling(t){const{errorSampleRate:n,sessionSampleRate:r}=this._options,s=n<=0&&r<=0;if(this._requiresManualStart=s,!s){if(this._initializeSessionForSampling(t),!this.session){C&&M.exception(new Error("Unable to initialize and create session"));return}this.session.sampled!==!1&&(this.recordingMode=this.session.sampled==="buffer"&&this.session.segmentId===0?"buffer":"session",C&&M.infoTick(`Starting replay in ${this.recordingMode} mode`),this._initializeRecording())}}start(){if(this._isEnabled&&this.recordingMode==="session"){C&&M.log("Recording is already in progress");return}if(this._isEnabled&&this.recordingMode==="buffer"){C&&M.log("Buffering is in progress, call `flush()` to save the replay");return}C&&M.infoTick("Starting replay in session mode"),this._updateUserActivity();const t=Fr({maxReplayDuration:this._options.maxReplayDuration,sessionIdleExpire:this.timeouts.sessionIdleExpire},{stickySession:this._options.stickySession,sessionSampleRate:1,allowBuffering:!1});this.session=t,this.recordingMode="session",this._initializeRecording()}startBuffering(){if(this._isEnabled){C&&M.log("Buffering is in progress, call `flush()` to save the replay");return}C&&M.infoTick("Starting replay in buffer mode");const t=Fr({sessionIdleExpire:this.timeouts.sessionIdleExpire,maxReplayDuration:this._options.maxReplayDuration},{stickySession:this._options.stickySession,sessionSampleRate:0,allowBuffering:!0});this.session=t,this.recordingMode="buffer",this._initializeRecording()}startRecording(){try{const t=this._canvas;this._stopRecording=Le({...this._recordingOptions,...this.recordingMode==="buffer"?{checkoutEveryNms:Wh}:this._options._experiments.continuousCheckout&&{checkoutEveryNms:Math.max(36e4,this._options._experiments.continuousCheckout)},emit:eS(this),...Z_(),onMutation:this._onMutationHandler.bind(this),...t?{recordCanvas:t.recordCanvas,getCanvasManager:t.getCanvasManager,sampling:t.sampling,dataURLOptions:t.dataURLOptions}:{}})}catch(t){this.handleException(t)}}stopRecording(){try{return this._stopRecording&&(this._stopRecording(),this._stopRecording=void 0),!0}catch(t){return this.handleException(t),!1}}async stop({forceFlush:t=!1,reason:n}={}){if(this._isEnabled){this._isEnabled=!1,this.recordingMode="buffer";try{C&&M.log(`Stopping Replay${n?` triggered by ${n}`:""}`),Fc(),this._removeListeners(),this.stopRecording(),this._debouncedFlush.cancel(),t&&await this._flush({force:!0}),this.eventBuffer?.destroy(),this.eventBuffer=null,Zg(this)}catch(r){this.handleException(r)}}}pause(){this._isPaused||(this._isPaused=!0,this.stopRecording(),C&&M.log("Pausing replay"))}resume(){!this._isPaused||!this._checkSession()||(this._isPaused=!1,this.startRecording(),C&&M.log("Resuming replay"))}async sendBufferedReplayOrFlush({continueRecording:t=!0}={}){if(this.recordingMode==="session")return this.flushImmediate();const n=Date.now();C&&M.log("Converting buffer to session"),await this.flushImmediate();const r=this.stopRecording();!t||!r||this.recordingMode!=="session"&&(this.recordingMode="session",this.session&&(this.session.dirty=!1,this._updateUserActivity(n),this._updateSessionActivity(n),this._maybeSaveSession()),this.startRecording())}addUpdate(t){const n=t();this.recordingMode==="buffer"||!this._isEnabled||n!==!0&&this._debouncedFlush()}triggerUserActivity(){if(this._updateUserActivity(),!this._stopRecording){if(!this._checkSession())return;this.resume();return}this.checkAndHandleExpiredSession(),this._updateSessionActivity()}updateUserActivity(){this._updateUserActivity(),this._updateSessionActivity()}conditionalFlush(){return this.recordingMode==="buffer"?Promise.resolve():this.flushImmediate()}flush(){return this._debouncedFlush()}flushImmediate(){return this._debouncedFlush(),this._debouncedFlush.flush()}cancelFlush(){this._debouncedFlush.cancel()}getSessionId(t){if(!(t&&this.session?.sampled===!1))return this.session?.id}checkAndHandleExpiredSession(){if(this._lastActivity&&ss(this._lastActivity,this.timeouts.sessionIdlePause)&&this.session&&this.session.sampled==="session"){this.pause();return}return!!this._checkSession()}setInitialState(){const t=`${Z.location.pathname}${Z.location.hash}${Z.location.search}`,n=`${Z.location.origin}${t}`;this.performanceEntries=[],this.replayPerformanceEntries=[],this._clearContext(),this._context.initialUrl=n,this._context.initialTimestamp=Date.now(),this._context.urls.push(n)}throttledAddEvent(t,n){const r=this._throttledAddEvent(t,n);if(r===qc){const s=xe({category:"replay.throttled"});this.addUpdate(()=>!Ys(this,{type:lg,timestamp:s.timestamp||0,data:{tag:"breadcrumb",payload:s,metric:!0}}))}return r}getCurrentRoute(){const t=this.lastActiveSpan||de(),n=t&&le(t),s=(n&&H(n).data||{})[Re];if(!(!n||!s||!["route","custom"].includes(s)))return H(n).description}_initializeRecording(){this.setInitialState(),this._updateSessionActivity(),this.eventBuffer=Kg({useCompression:this._options.useCompression,workerUrl:this._options.workerUrl}),this._removeListeners(),this._addListeners(),this._isEnabled=!0,this._isPaused=!1,this.startRecording()}_initializeSessionForSampling(t){const n=this._options.errorSampleRate>0,r=Fr({sessionIdleExpire:this.timeouts.sessionIdleExpire,maxReplayDuration:this._options.maxReplayDuration,previousSessionId:t},{stickySession:this._options.stickySession,sessionSampleRate:this._options.sessionSampleRate,allowBuffering:n});this.session=r}_checkSession(){if(!this.session)return!1;const t=this.session;return Nc(t,{sessionIdleExpire:this.timeouts.sessionIdleExpire,maxReplayDuration:this._options.maxReplayDuration})?(this._refreshSession(t),!1):!0}async _refreshSession(t){this._isEnabled&&(await this.stop({reason:"refresh session"}),this.initializeSampling(t.id))}_addListeners(){try{Z.document.addEventListener("visibilitychange",this._handleVisibilityChange),Z.addEventListener("blur",this._handleWindowBlur),Z.addEventListener("focus",this._handleWindowFocus),Z.addEventListener("keydown",this._handleKeyboardEvent),this.clickDetector&&this.clickDetector.addListeners(),this._hasInitializedCoreListeners||(J_(this),this._hasInitializedCoreListeners=!0)}catch(t){this.handleException(t)}this._performanceCleanupCallback=zg(this)}_removeListeners(){try{Z.document.removeEventListener("visibilitychange",this._handleVisibilityChange),Z.removeEventListener("blur",this._handleWindowBlur),Z.removeEventListener("focus",this._handleWindowFocus),Z.removeEventListener("keydown",this._handleKeyboardEvent),this.clickDetector&&this.clickDetector.removeListeners(),this._performanceCleanupCallback&&this._performanceCleanupCallback()}catch(t){this.handleException(t)}}_doChangeToBackgroundTasks(t){!this.session||Oc(this.session,{maxReplayDuration:this._options.maxReplayDuration,sessionIdleExpire:this.timeouts.sessionIdleExpire})||(t&&this._createCustomBreadcrumb(t),this.conditionalFlush())}_doChangeToForegroundTasks(t){if(!this.session)return;if(!this.checkAndHandleExpiredSession()){C&&M.log("Document has become active, but session has expired");return}t&&this._createCustomBreadcrumb(t)}_updateUserActivity(t=Date.now()){this._lastActivity=t}_updateSessionActivity(t=Date.now()){this.session&&(this.session.lastActivity=t,this._maybeSaveSession())}_createCustomBreadcrumb(t){this.addUpdate(()=>{this.throttledAddEvent({type:L.Custom,timestamp:t.timestamp||0,data:{tag:"breadcrumb",payload:t}})})}_addPerformanceEntries(){let t=Pg(this.performanceEntries).concat(this.replayPerformanceEntries);if(this.performanceEntries=[],this.replayPerformanceEntries=[],this._requiresManualStart){const n=this._context.initialTimestamp/1e3;t=t.filter(r=>r.start>=n)}return Promise.all(mr(this,t))}_clearContext(){this._context.errorIds.clear(),this._context.traceIds.clear(),this._context.urls=[]}_updateInitialTimestampFromEventBuffer(){const{session:t,eventBuffer:n}=this;if(!t||!n||this._requiresManualStart||t.segmentId)return;const r=n.getEarliestTimestamp();r&&r<this._context.initialTimestamp&&(this._context.initialTimestamp=r)}_popEventContext(){const t={initialTimestamp:this._context.initialTimestamp,initialUrl:this._context.initialUrl,errorIds:Array.from(this._context.errorIds),traceIds:Array.from(this._context.traceIds),urls:this._context.urls};return this._clearContext(),t}async _runFlush(){const t=this.getSessionId();if(!this.session||!this.eventBuffer||!t){C&&M.error("No session or eventBuffer found to flush.");return}if(await this._addPerformanceEntries(),!!this.eventBuffer?.hasEvents&&(await K_(this),!!this.eventBuffer&&t===this.getSessionId()))try{this._updateInitialTimestampFromEventBuffer();const n=Date.now();if(n-this._context.initialTimestamp>this._options.maxReplayDuration+3e4)throw new Error("Session is too long, not sending replay");const r=this._popEventContext(),s=this.session.segmentId++;this._maybeSaveSession();const i=await this.eventBuffer.finish();await zc({replayId:t,recordingData:i,segmentId:s,eventContext:r,session:this.session,timestamp:n,onError:o=>this.handleException(o)})}catch(n){this.handleException(n),this.stop({reason:"sendReplay"});const r=$();if(r){const s=n instanceof Ks?"ratelimit_backoff":"send_error";r.recordDroppedEvent(s,"replay")}}}async _flush({force:t=!1}={}){if(!this._isEnabled&&!t)return;if(!this.checkAndHandleExpiredSession()){C&&M.error("Attempting to finish replay event after session expired.");return}if(!this.session)return;const n=this.session.started,s=Date.now()-n;this._debouncedFlush.cancel();const i=s<this._options.minReplayDuration,o=s>this._options.maxReplayDuration+5e3;if(i||o){C&&M.log(`Session duration (${Math.floor(s/1e3)}s) is too ${i?"short":"long"}, not sending replay.`),i&&this._debouncedFlush();return}const c=this.eventBuffer;c&&this.session.segmentId===0&&!c.hasCheckout&&C&&M.log("Flushing initial segment without checkout.");const a=!!this._flushLock;this._flushLock||(this._flushLock=this._runFlush());try{await this._flushLock}catch(u){this.handleException(u)}finally{this._flushLock=void 0,a&&this._debouncedFlush()}}_maybeSaveSession(){this.session&&this._options.stickySession&&hr(this.session)}_onMutationHandler(t){const{ignoreMutations:n}=this._options._experiments;if(n?.length&&t.some(c=>{const a=rS(c.target),u=n.join(",");return a?.matches(u)}))return!1;const r=t.length,s=this._options.mutationLimit,i=this._options.mutationBreadcrumbLimit,o=s&&r>s;if(r>i||o){const c=xe({category:"replay.mutations",data:{count:r,limit:o}});this._createCustomBreadcrumb(c)}return o?(this.stop({reason:"mutationLimit",forceFlush:this.recordingMode==="session"}),!1):!0}}function xt(e,t){return[...e,...t].join(",")}function dS({mask:e,unmask:t,block:n,unblock:r,ignore:s}){const i=["base","iframe[srcdoc]:not([src])"],o=xt(e,[".sentry-mask","[data-sentry-mask]"]),c=xt(t,[]);return{maskTextSelector:o,unmaskTextSelector:c,blockSelector:xt(n,[".sentry-block","[data-sentry-block]",...i]),unblockSelector:xt(r,[]),ignoreSelector:xt(s,[".sentry-ignore","[data-sentry-ignore]",'input[type="file"]'])}}function fS({el:e,key:t,maskAttributes:n,maskAllText:r,privacyOptions:s,value:i}){return!r||s.unmaskTextSelector&&e.matches(s.unmaskTextSelector)?i:n.includes(t)||t==="value"&&e.tagName==="INPUT"&&["submit","button"].includes(e.getAttribute("type")||"")?i.replace(/[\S]/g,"*"):i}const yo='img,image,svg,video,object,picture,embed,map,audio,link[rel="icon"],link[rel="apple-touch-icon"]',pS=["content-length","content-type","accept"],hS=Symbol.for("sentry__originalRequestBody");let Eo=!1,bo=!1;function mS(){if(typeof Request>"u"||bo)return;const e=Request;try{const t=function(n,r){const s=new e(n,r);return r?.body!=null&&(s[hS]=r.body),s};t.prototype=e.prototype,X.Request=t,bo=!0}catch{}}const gS=(e=>new _S(e));class _S{constructor({flushMinDelay:t=Hh,flushMaxDelay:n=$h,minReplayDuration:r=Gh,maxReplayDuration:s=Xi,stickySession:i=!0,useCompression:o=!0,workerUrl:c,_experiments:a={},maskAllText:u=!0,maskAllInputs:d=!0,blockAllMedia:l=!0,mutationBreadcrumbLimit:f=750,mutationLimit:p=1e4,slowClickTimeout:h=7e3,slowClickIgnoreSelectors:g=[],networkDetailAllowUrls:S=[],networkDetailDenyUrls:y=[],networkCaptureBodies:T=!0,networkRequestHeaders:B=[],networkResponseHeaders:N=[],mask:z=[],maskAttributes:A=["title","placeholder","aria-label"],unmask:_=[],block:I=[],unblock:Y=[],ignore:E=[],maskFn:k,beforeAddRecordingEvent:F,beforeErrorSampling:q,onError:P,attachRawBodyFromRequest:ce=!1}={}){this.name="Replay";const J=dS({mask:z,unmask:_,block:I,unblock:Y,ignore:E});if(this._recordingOptions={maskAllInputs:d,maskAllText:u,maskInputOptions:{password:!0},maskTextFn:k,maskInputFn:k,maskAttributeFn:(ee,b,G)=>fS({maskAttributes:A,maskAllText:u,privacyOptions:J,key:ee,value:b,el:G}),...J,slimDOMOptions:"all",inlineStylesheet:!0,inlineImages:!1,collectFonts:!0,errorHandler:ee=>{try{ee.__rrweb__=!0}catch{}},recordCrossOriginIframes:!!a.recordCrossOriginIframes},this._initialOptions={flushMinDelay:t,flushMaxDelay:n,minReplayDuration:Math.min(r,Yh),maxReplayDuration:Math.min(s,Xi),stickySession:i,useCompression:o,workerUrl:c,blockAllMedia:l,maskAllInputs:d,maskAllText:u,mutationBreadcrumbLimit:f,mutationLimit:p,slowClickTimeout:h,slowClickIgnoreSelectors:g,networkDetailAllowUrls:S,networkDetailDenyUrls:y,networkCaptureBodies:T,networkRequestHeaders:vo(B),networkResponseHeaders:vo(N),beforeAddRecordingEvent:F,beforeErrorSampling:q,onError:P,attachRawBodyFromRequest:ce,_experiments:a},this._initialOptions.blockAllMedia&&(this._recordingOptions.blockSelector=this._recordingOptions.blockSelector?`${this._recordingOptions.blockSelector},${yo}`:yo,this._recordingOptions.ignoreCSSAttributes=new Set(["background-image"])),this._isInitialized&&qr())throw new Error("Multiple Sentry Session Replay instances are not supported");this._isInitialized=!0}get _isInitialized(){return Eo}set _isInitialized(t){Eo=t}afterAllSetup(t){!qr()||this._replay||(this._initialOptions.attachRawBodyFromRequest&&mS(),this._setup(t),this._initialize(t))}start(){this._replay&&this._replay.start()}startBuffering(){this._replay&&this._replay.startBuffering()}stop(){return this._replay?this._replay.stop({forceFlush:this._replay.recordingMode==="session"}):Promise.resolve()}flush(t){return this._replay?this._replay.isEnabled()?this._replay.sendBufferedReplayOrFlush(t):(this._replay.start(),Promise.resolve()):Promise.resolve()}getReplayId(t){if(this._replay?.isEnabled())return this._replay.getSessionId(t)}getRecordingMode(){if(this._replay?.isEnabled())return this._replay.recordingMode}_initialize(t){this._replay&&(this._maybeLoadFromReplayCanvasIntegration(t),this._replay.initializeSampling())}_setup(t){const n=SS(this._initialOptions,t);this._replay=new lS({options:n,recordingOptions:this._recordingOptions})}_maybeLoadFromReplayCanvasIntegration(t){try{const n=t.getIntegrationByName("ReplayCanvas");if(!n)return;this._replay._canvas=n.getOptions()}catch{}}}function SS(e,t){const n=t.getOptions(),r={sessionSampleRate:0,errorSampleRate:0,...e},s=Ut(n.replaysSessionSampleRate),i=Ut(n.replaysOnErrorSampleRate);return s==null&&i==null&&Kt(()=>{console.warn("Replay is disabled because neither `replaysSessionSampleRate` nor `replaysOnErrorSampleRate` are set.")}),s!=null&&(r.sessionSampleRate=s),i!=null&&(r.errorSampleRate=i),r}function vo(e){return[...pS,...e.map(t=>t.toLowerCase())]}function yS(e){return e.split(",").some(t=>t.trim().startsWith("sentry-"))}function jc(e){try{return new URL(e,D.location.origin).href}catch{return}}function ES(e){return e.entryType==="resource"&&"initiatorType"in e&&typeof e.nextHopProtocol=="string"&&(e.initiatorType==="fetch"||e.initiatorType==="xmlhttprequest")}function Vc(e){try{return new Headers(e)}catch{return}}const To=new WeakMap,Br=new Map,Gc={traceFetch:!0,traceXHR:!0,enableHTTPTimings:!0,trackFetchStreamPerformance:!1};function bS(e,t){const{traceFetch:n,traceXHR:r,trackFetchStreamPerformance:s,shouldCreateSpanForRequest:i,enableHTTPTimings:o,tracePropagationTargets:c,onRequestSpanStart:a,onRequestSpanEnd:u}={...Gc,...t},d=typeof i=="function"?i:h=>!0,l=h=>vS(h,c),f={},p=e.getOptions().propagateTraceparent;n&&(e.addEventProcessor(h=>(h.type==="transaction"&&h.spans&&h.spans.forEach(g=>{if(g.op==="http.client"){const S=Br.get(g.span_id);S&&(g.timestamp=S/1e3,Br.delete(g.span_id))}}),h)),s&&Gd(h=>{if(h.response){const g=To.get(h.response);g&&h.endTimestamp&&Br.set(g,h.endTimestamp)}}),Aa(h=>{const g=xd(h,d,l,f,{propagateTraceparent:p,onRequestSpanEnd:u});if(h.response&&h.fetchData.__span&&To.set(h.response,h.fetchData.__span),g){const S=jc(h.fetchData.url),y=S?tt(S).host:void 0;g.setAttributes({"http.url":S,"server.address":y}),o&&Io(g),a?.(g,{headers:h.headers})}})),r&&Ka(h=>{const g=TS(h,d,l,f,p,u);g&&(o&&Io(g),a?.(g,{headers:Vc(h.xhr.__sentry_xhr_v3__?.request_headers)}))})}function Io(e){const{url:t}=H(e).data;if(!t||typeof t!="string")return;const n=it("resource",({entries:r})=>{r.forEach(s=>{ES(s)&&s.name.endsWith(t)&&(e.setAttributes(Ya(s)),setTimeout(n))})})}function vS(e,t){const n=Xt();if(n){let r,s;try{r=new URL(e,n),s=new URL(n).origin}catch{return!1}const i=r.origin===s;return t?Pe(r.toString(),t)||i&&Pe(r.pathname,t):i}else{const r=!!e.match(/^\/(?!\/)/);return t?Pe(e,t):r}}function TS(e,t,n,r,s,i){const o=e.xhr,c=o?.[Qe];if(!o||o.__sentry_own_request__||!c)return;const{url:a,method:u}=c,d=Ce()&&t(a);if(e.endTimestamp&&d){const y=o.__sentry_xhr_span_id__;if(!y)return;const T=r[y];T&&c.status_code!==void 0&&(Yo(T,c.status_code),T.end(),i?.(T,{headers:Vc(ec(o)),error:e.error}),delete r[y]);return}const l=jc(a),f=tt(l||a),p=ed(a),h=!!de(),g=d&&h?kt({name:`${u} ${p}`,attributes:{url:a,type:"xhr","http.method":u,"http.url":l,"server.address":f?.host,[ae]:"auto.http.browser",[Fe]:"http.client",...f?.search&&{"http.query":f?.search},...f?.hash&&{"http.fragment":f?.hash}}}):new qe;o.__sentry_xhr_span_id__=g.spanContext().spanId,r[o.__sentry_xhr_span_id__]=g,n(a)&&IS(o,Ce()&&h?g:void 0,s);const S=$();return S&&S.emit("beforeOutgoingRequestSpan",g,e),g}function IS(e,t,n){const{"sentry-trace":r,baggage:s,traceparent:i}=Ia({span:t,propagateTraceparent:n});r&&wS(e,r,s,i)}function wS(e,t,n,r){const s=e.__sentry_xhr_v3__?.request_headers;if(!(s?.["sentry-trace"]||!e.setRequestHeader))try{if(e.setRequestHeader("sentry-trace",t),r&&!s?.traceparent&&e.setRequestHeader("traceparent",r),n){const i=s?.baggage;(!i||!yS(i))&&e.setRequestHeader("baggage",n)}}catch{}}function kS(){D.document?D.document.addEventListener("visibilitychange",()=>{const e=de();if(!e)return;const t=le(e);if(D.document.hidden&&t){const n="cancelled",{op:r,status:s}=H(t);v&&m.log(`[Tracing] Transaction: ${n} -> since tab moved to the background, op: ${r}`),s||t.setStatus({code:St,message:n}),t.setAttribute("sentry.cancellation_reason","document.hidden"),t.end()}}):v&&m.warn("[Tracing] Could not set up background tab detection due to lack of global document")}const RS=3600,Yc="sentry_previous_trace",CS="sentry.previous_trace";function MS(e,{linkPreviousTrace:t,consistentTraceSampling:n}){const r=t==="session-storage";let s=r?OS():void 0;e.on("spanStart",o=>{if(le(o)!==o)return;const c=te().getPropagationContext();s=AS(s,o,c),r&&xS(s)});let i=!0;n&&e.on("beforeSampling",o=>{if(!s)return;const c=te(),a=c.getPropagationContext();if(i&&a.parentSpanId){i=!1;return}c.setPropagationContext({...a,dsc:{...a.dsc,sample_rate:String(s.sampleRate),sampled:String(as(s.spanContext))},sampleRand:s.sampleRand}),o.parentSampled=as(s.spanContext),o.parentSampleRate=s.sampleRate,o.spanAttributes={...o.spanAttributes,[Nu]:s.sampleRate}})}function AS(e,t,n){const r=H(t);function s(){try{return Number(n.dsc?.sample_rate)??Number(r.data?.[Ho])}catch{return 0}}const i={spanContext:t.spanContext(),startTimestamp:r.start_timestamp,sampleRate:s(),sampleRand:n.sampleRand};if(!e)return i;const o=e.spanContext;return o.traceId===r.trace_id?e:(Date.now()/1e3-e.startTimestamp<=RS&&(v&&m.log(`Adding previous_trace \`${JSON.stringify(o)}\` link to span \`${JSON.stringify({op:r.op,...t.spanContext()})}\``),t.addLink({context:o,attributes:{[Pu]:"previous_trace"}}),t.setAttribute(CS,`${o.traceId}-${o.spanId}-${as(o)?1:0}`)),i)}function xS(e){try{D.sessionStorage.setItem(Yc,JSON.stringify(e))}catch(t){v&&m.warn("Could not store previous trace in sessionStorage",t)}}function OS(){try{const e=D.sessionStorage?.getItem(Yc);return JSON.parse(e)}catch{return}}function as(e){return e.traceFlags===1}const NS="BrowserTracing",PS={...wn,instrumentNavigation:!0,instrumentPageLoad:!0,markBackgroundSpan:!0,enableLongTask:!0,enableLongAnimationFrame:!0,enableInp:!0,enableElementTiming:!0,ignoreResourceSpans:[],ignorePerformanceApiSpans:[],detectRedirects:!0,linkPreviousTrace:"in-memory",consistentTraceSampling:!1,enableReportPageLoaded:!1,_experiments:{},...Gc},LS=((e={})=>{const t={name:void 0,source:void 0},n=D.document,{enableInp:r,enableElementTiming:s,enableLongTask:i,enableLongAnimationFrame:o,_experiments:{enableInteractions:c,enableStandaloneClsSpans:a,enableStandaloneLcpSpans:u},beforeStartSpan:d,idleTimeout:l,finalTimeout:f,childSpanTimeout:p,markBackgroundSpan:h,traceFetch:g,traceXHR:S,trackFetchStreamPerformance:y,shouldCreateSpanForRequest:T,enableHTTPTimings:B,ignoreResourceSpans:N,ignorePerformanceApiSpans:z,instrumentPageLoad:A,instrumentNavigation:_,detectRedirects:I,linkPreviousTrace:Y,consistentTraceSampling:E,enableReportPageLoaded:k,onRequestSpanStart:F,onRequestSpanEnd:q}={...PS,...e};let P,ce,J;function ee(b,G,w=!0){const K=G.op==="pageload",ne=G.name,re=d?d(G):G,Se=re.attributes||{};if(ne!==re.name&&(Se[Re]="custom",re.attributes=Se),!w){const Oe=ir();kt({...re,startTime:Oe}).end(Oe);return}t.name=re.name,t.source=Se[Re];const ye=ua(re,{idleTimeout:l,finalTimeout:f,childSpanTimeout:p,disableAutoFinish:K,beforeSpanEnd:Oe=>{P?.(),np(Oe,{recordClsOnPageloadSpan:!a,recordLcpOnPageloadSpan:!u,ignoreResourceSpans:N,ignorePerformanceApiSpans:z}),ko(b,void 0);const ct=te(),cn=ct.getPropagationContext();ct.setPropagationContext({...cn,traceId:ye.spanContext().traceId,sampled:nr(ye),dsc:De(Oe)}),K&&(J=void 0)},trimIdleSpanEndTimestamp:!k});K&&k&&(J=ye),ko(b,ye);function at(){n&&["interactive","complete"].includes(n.readyState)&&b.emit("idleSpanEnableAutoFinish",ye)}K&&!k&&n&&(n.addEventListener("readystatechange",()=>{at()}),at())}return{name:NS,setup(b){if(qu(),P=Jf({recordClsStandaloneSpans:a||!1,recordLcpStandaloneSpans:u||!1,client:b}),r&&Cp(),s&&hp(),o&&X.PerformanceObserver&&PerformanceObserver.supportedEntryTypes&&PerformanceObserver.supportedEntryTypes.includes("long-animation-frame")?Xf():i&&Kf(),c&&Qf(),I&&n){const w=()=>{ce=ue()};addEventListener("click",w,{capture:!0}),addEventListener("keydown",w,{capture:!0,passive:!0})}function G(){const w=Gt(b);w&&!H(w).timestamp&&(v&&m.log(`[Tracing] Finishing current active span with op: ${H(w).op}`),w.setAttribute(Ht,"cancelled"),w.end())}b.on("startNavigationSpan",(w,K)=>{if($()!==b)return;if(K?.isRedirect){v&&m.warn("[Tracing] Detected redirect, navigation span will not be the root span, but a child span."),ee(b,{op:"navigation.redirect",...w},!1);return}ce=void 0,G(),wt().setPropagationContext({traceId:On(),sampleRand:Math.random(),propagationSpanId:Ce()?void 0:Ot()});const ne=te();ne.setPropagationContext({traceId:On(),sampleRand:Math.random(),propagationSpanId:Ce()?void 0:Ot()}),ne.setSDKProcessingMetadata({normalizedRequest:void 0}),ee(b,{op:"navigation",...w,parentSpan:null,forceTransaction:!0})}),b.on("startPageLoadSpan",(w,K={})=>{if($()!==b)return;G();const ne=K.sentryTrace||wo("sentry-trace"),re=K.baggage||wo("baggage"),Se=Lu(ne,re),ye=te();ye.setPropagationContext(Se),Ce()||(ye.getPropagationContext().propagationSpanId=Ot()),ye.setSDKProcessingMetadata({normalizedRequest:ms()}),ee(b,{op:"pageload",...w})}),b.on("endPageloadSpan",()=>{k&&J&&(J.setAttribute(Ht,"reportPageLoaded"),J.end())})},afterAllSetup(b){let G=Xt();if(Y!=="off"&&MS(b,{linkPreviousTrace:Y,consistentTraceSampling:E}),D.location){if(A){const w=pe();Xs(b,{name:D.location.pathname,startTime:w?w/1e3:void 0,attributes:{[Re]:"url",[ae]:"auto.pageload.browser"}})}_&&lr(({to:w,from:K})=>{if(K===void 0&&G?.indexOf(w)!==-1){G=void 0;return}G=void 0;const ne=Ts(w),re=Gt(b),Se=re&&I&&BS(re,ce);DS(b,{name:ne?.pathname||D.location.pathname,attributes:{[Re]:"url",[ae]:"auto.navigation.browser"}},{url:w,isRedirect:Se})})}h&&kS(),c&&FS(b,l,f,p,t),r&&xp(),bS(b,{traceFetch:g,traceXHR:S,trackFetchStreamPerformance:y,tracePropagationTargets:b.getOptions().tracePropagationTargets,shouldCreateSpanForRequest:T,enableHTTPTimings:B,onRequestSpanStart:F,onRequestSpanEnd:q})}}});function Xs(e,t,n){e.emit("startPageLoadSpan",t,n),te().setTransactionName(t.name);const r=Gt(e);return r&&e.emit("afterStartPageLoadSpan",r),r}function DS(e,t,n){const{url:r,isRedirect:s}=n||{};e.emit("beforeStartNavigationSpan",t,{isRedirect:s}),e.emit("startNavigationSpan",t,{isRedirect:s});const i=te();return i.setTransactionName(t.name),r&&!s&&i.setSDKProcessingMetadata({normalizedRequest:{...ms(),url:r}}),Gt(e)}function wo(e){return D.document?.querySelector(`meta[name=${e}]`)?.getAttribute("content")||void 0}function FS(e,t,n,r,s){const i=D.document;let o;const c=()=>{const a="ui.action.click",u=Gt(e);if(u){const d=H(u).op;if(["navigation","pageload"].includes(d)){v&&m.warn(`[Tracing] Did not create ${a} span because a pageload or navigation span is in progress.`);return}}if(o&&(o.setAttribute(Ht,"interactionInterrupted"),o.end(),o=void 0),!s.name){v&&m.warn(`[Tracing] Did not create ${a} transaction because _latestRouteName is missing.`);return}o=ua({name:s.name,op:a,attributes:{[Re]:s.source||"url"}},{idleTimeout:t,finalTimeout:n,childSpanTimeout:r})};i&&addEventListener("click",c,{capture:!0})}const Jc="_sentry_idleSpan";function Gt(e){return e[Jc]}function ko(e,t){Pn(e,Jc,t)}const Ro=1.5;function BS(e,t){const n=H(e),r=ir(),s=n.start_timestamp;return!(r-s>Ro||t&&r-t<=Ro)}function Tt(e){return new Promise((t,n)=>{e.oncomplete=e.onsuccess=()=>t(e.result),e.onabort=e.onerror=()=>n(e.error)})}function US(e,t){const n=indexedDB.open(e);n.onupgradeneeded=()=>n.result.createObjectStore(t);const r=Tt(n);return s=>r.then(i=>s(i.transaction(t,"readwrite").objectStore(t)))}function Qs(e){return Tt(e.getAllKeys())}function HS(e,t,n){return e(r=>Qs(r).then(s=>{if(!(s.length>=n))return r.put(t,Math.max(...s,0)+1),Tt(r.transaction)}))}function $S(e,t,n){return e(r=>Qs(r).then(s=>{if(!(s.length>=n))return r.put(t,Math.min(...s,0)-1),Tt(r.transaction)}))}function WS(e){return e(t=>Qs(t).then(n=>{const r=n[0];if(r!=null)return Tt(t.get(r)).then(s=>(t.delete(r),Tt(t.transaction).then(()=>s)))}))}function zS(e){let t;function n(){return t==null&&(t=US(e.dbName||"sentry-offline",e.storeName||"queue")),t}return{push:async r=>{try{const s=await Un(r);await HS(n(),s,e.maxQueueSize||30)}catch{}},unshift:async r=>{try{const s=await Un(r);await $S(n(),s,e.maxQueueSize||30)}catch{}},shift:async()=>{try{const r=await WS(n());if(r)return Ku(r)}catch{}}}}function qS(e){return t=>{const n=e({...t,createStore:zS});return D.addEventListener("online",async r=>{await n.flush()}),n}}function jS(e=Ps){return qS(Xl(e))}const Co=1e6,VS="window"in X&&X.window===X&&typeof importScripts>"u",We=String(0),Zn=VS?"main":"worker",er=D.navigator;let Kc="",Xc="",Qc="",cs=er?.userAgent||"",Zc="";const GS=er?.language||er?.languages?.[0]||"";function YS(e){return typeof e=="object"&&e!==null&&"getHighEntropyValues"in e}const Mo=er?.userAgentData;YS(Mo)&&Mo.getHighEntropyValues(["architecture","model","platform","platformVersion","fullVersionList"]).then(e=>{if(Kc=e.platform||"",Qc=e.architecture||"",Zc=e.model||"",Xc=e.platformVersion||"",e.fullVersionList?.length){const t=e.fullVersionList[e.fullVersionList.length-1];cs=`${t.brand} ${t.version}`}}).catch(e=>{});function JS(e){return!("thread_metadata"in e)}function KS(e){return JS(e)?ny(e):e}function XS(e){const t=e.contexts?.trace?.trace_id;return typeof t=="string"&&t.length!==32&&v&&m.log(`[Profiling] Invalid traceId: ${t} on profiled event`),typeof t!="string"?"":t}function QS(e,t,n,r){if(r.type!=="transaction")throw new TypeError("Profiling events may only be attached to transactions, this should never occur.");if(n==null)throw new TypeError(`Cannot construct profiling event envelope without a valid profile. Got ${n} instead.`);const s=XS(r),i=KS(n),o=t||(typeof r.start_timestamp=="number"?r.start_timestamp*1e3:ue()*1e3),c=typeof r.timestamp=="number"?r.timestamp*1e3:ue()*1e3;return{event_id:e,timestamp:new Date(o).toISOString(),platform:"javascript",version:"1",release:r.release||"",environment:r.environment||qo,runtime:{name:"javascript",version:D.navigator.userAgent},os:{name:Kc,version:Xc,build_number:cs},device:{locale:GS,model:Zc,manufacturer:cs,architecture:Qc,is_emulator:!1},debug_meta:{images:tu(n.resources)},profile:i,transactions:[{name:r.transaction||"",id:r.event_id||Me(),trace_id:s,active_thread_id:We,relative_start_ns:"0",relative_end_ns:((c-o)*1e6).toFixed(0)}]}}function ZS(e,t,n){if(e==null)throw new TypeError(`Cannot construct profiling event envelope without a valid profile. Got ${e} instead.`);const r=ty(e),s=t.getOptions(),i=t.getSdkMetadata?.()?.sdk;return{chunk_id:Me(),client_sdk:{name:i?.name??"sentry.javascript.browser",version:i?.version??"0.0.0"},profiler_id:n||Me(),platform:"javascript",version:"2",release:s.release??"",environment:s.environment??"production",debug_meta:{images:tu(e.resources)},profile:r}}function ey(e){try{if(!e||typeof e!="object")return{reason:"chunk is not an object"};const t=r=>typeof r=="string"&&/^[a-f0-9]{32}$/.test(r);if(!t(e.profiler_id))return{reason:"missing or invalid profiler_id"};if(!t(e.chunk_id))return{reason:"missing or invalid chunk_id"};if(!e.client_sdk)return{reason:"missing client_sdk metadata"};const n=e.profile;return n?!Array.isArray(n.frames)||!n.frames.length?{reason:"profile has no frames"}:!Array.isArray(n.stacks)||!n.stacks.length?{reason:"profile has no stacks"}:!Array.isArray(n.samples)||!n.samples.length?{reason:"profile has no samples"}:{valid:!0}:{reason:"missing profile data"}}catch(t){return{reason:`unknown validation error: ${t}`}}}function ty(e){const t=[];for(let c=0;c<e.frames.length;c++){const a=e.frames[c];a&&(t[c]={function:a.name,abs_path:typeof a.resourceId=="number"?e.resources[a.resourceId]:void 0,lineno:a.line,colno:a.column})}const n=[];for(let c=0;c<e.stacks.length;c++){const a=e.stacks[c];if(!a)continue;const u=[];let d=a;for(;d;)u.push(d.frameId),d=d.parentId===void 0?void 0:e.stacks[d.parentId];n[c]=u}const r=pe(),s=typeof performance.timeOrigin=="number"?performance.timeOrigin:r||0,i=s-(r||s),o=[];for(let c=0;c<e.samples.length;c++){const a=e.samples[c];if(!a)continue;const u=(s+(a.timestamp-i))/1e3;o[c]={stack_id:a.stackId??0,thread_id:We,timestamp:u}}return{frames:t,stacks:n,samples:o,thread_metadata:{[We]:{name:Zn}}}}function eu(e){return H(e).op==="pageload"}function ny(e){let t,n=0;const r={samples:[],stacks:[],frames:[],thread_metadata:{[We]:{name:Zn}}},s=e.samples[0];if(!s)return r;const i=s.timestamp,o=pe(),c=typeof performance.timeOrigin=="number"?performance.timeOrigin:o||0,a=c-(o||c);return e.samples.forEach((u,d)=>{if(u.stackId===void 0){t===void 0&&(t=n,r.stacks[t]=[],n++),r.samples[d]={elapsed_since_start_ns:((u.timestamp+a-i)*Co).toFixed(0),stack_id:t,thread_id:We};return}let l=e.stacks[u.stackId];const f=[];for(;l;){f.push(l.frameId);const h=e.frames[l.frameId];h&&r.frames[l.frameId]===void 0&&(r.frames[l.frameId]={function:h.name,abs_path:typeof h.resourceId=="number"?e.resources[h.resourceId]:void 0,lineno:h.line,colno:h.column}),l=l.parentId===void 0?void 0:e.stacks[l.parentId]}const p={elapsed_since_start_ns:((u.timestamp+a-i)*Co).toFixed(0),stack_id:n,thread_id:We};r.stacks[n]=f,r.samples[d]=p,n++}),r}function ry(e,t){if(!t.length)return e;for(const n of t)e[1].push([{type:"profile"},n]);return e}function sy(e){const t=[];return Fn(e,(n,r)=>{if(r==="transaction")for(let s=1;s<n.length;s++)n[s]?.contexts?.profile?.profile_id&&t.push(n[s])}),t}function tu(e){const r=$()?.getOptions()?.stackParser;return r?Du(r,e):[]}function nu(e){return typeof e!="number"&&typeof e!="boolean"||typeof e=="number"&&isNaN(e)?(v&&m.warn(`[Profiling] Invalid sample rate. Sample rate must be a boolean or a number between 0 and 1. Got ${JSON.stringify(e)} of type ${JSON.stringify(typeof e)}.`),!1):e===!0||e===!1?!0:e<0||e>1?(v&&m.warn(`[Profiling] Invalid sample rate. Sample rate must be between 0 and 1. Got ${e}.`),!1):!0}function iy(e){return e.samples.length<2?(v&&m.log("[Profiling] Discarding profile because it contains less than 2 samples"),!1):e.frames.length?!0:(v&&m.log("[Profiling] Discarding profile because it contains no frames"),!1)}let Zs=!1;const ru=3e4;function oy(e){return typeof e=="function"}function su(){const e=D.Profiler;if(!oy(e)){v&&m.log("[Profiling] Profiling is not supported by this browser, Profiler interface missing on window object.");return}const t=10,n=Math.floor(ru/t);try{return new e({sampleInterval:t,maxBufferSize:n})}catch{v&&(m.log("[Profiling] Failed to initialize the Profiling constructor, this is likely due to a missing 'Document-Policy': 'js-profiling' header."),m.log("[Profiling] Disabling profiling for current user session.")),Zs=!0}}function Ao(e){if(Zs)return v&&m.log("[Profiling] Profiling has been disabled for the duration of the current user session."),!1;if(!e.isRecording())return v&&m.log("[Profiling] Discarding profile because root span was not sampled."),!1;const n=$()?.getOptions();if(!n)return v&&m.log("[Profiling] Profiling disabled, no options found."),!1;const r=n.profilesSampleRate;return nu(r)?r?(r===!0?!0:Math.random()<r)?!0:(v&&m.log(`[Profiling] Discarding profile because it's not included in the random sample (sampling rate = ${Number(r)})`),!1):(v&&m.log("[Profiling] Discarding profile because a negative sampling decision was inherited or profileSampleRate is set to 0"),!1):(v&&m.warn("[Profiling] Discarding profile because of invalid sample rate."),!1)}function ay(e){if(Zs)return v&&m.log("[Profiling] Profiling has been disabled for the duration of the current user session as the JS Profiler could not be started."),!1;if(e.profileLifecycle!=="trace"&&e.profileLifecycle!=="manual")return v&&m.warn("[Profiling] Session not sampled. Invalid `profileLifecycle` option."),!1;const t=e.profileSessionSampleRate;return nu(t)?t?Math.random()<=t:(v&&m.log("[Profiling] Discarding profile because profileSessionSampleRate is not defined or set to 0"),!1):(v&&m.warn("[Profiling] Discarding profile because of invalid profileSessionSampleRate."),!1)}function En(e){return typeof e.profilesSampleRate<"u"}function cy(e,t,n,r){return iy(n)?QS(e,t,n,r):null}const et=new Map;function uy(){return et.size}function ly(e){const t=et.get(e);return t&&et.delete(e),t}function dy(e,t){if(et.set(e,t),et.size>30){const n=et.keys().next().value;n!==void 0&&et.delete(n)}}function fy(e){return!e?.contexts?.profile||!e.contexts||(e.contexts.trace={...e.contexts?.trace??{},data:{...e.contexts?.trace?.data??{},"thread.id":We,"thread.name":Zn}},e.spans?.forEach(t=>{t.data={...t.data||{},"thread.id":We,"thread.name":Zn}})),e}function xo(e){let t;eu(e)&&(t=ue()*1e3);const n=su();if(!n)return;v&&m.log(`[Profiling] started profiling span: ${H(e).description}`);const r=Me();let s=null;te().setContext("profile",{profile_id:r,start_timestamp:t});async function i(){if(e&&n){if(s){v&&m.log("[Profiling] profile for:",H(e).description,"already exists, returning early");return}return n.stop().then(u=>{if(o&&(D.clearTimeout(o),o=void 0),v&&m.log(`[Profiling] stopped profiling of span: ${H(e).description}`),!u){v&&m.log(`[Profiling] profiler returned null profile for: ${H(e).description}`,"this may indicate an overlapping span or a call to stopProfiling with a profile title that was never started");return}s=u,dy(r,u)}).catch(u=>{v&&m.log("[Profiling] error while stopping profiler:",u)})}}let o=D.setTimeout(()=>{v&&m.log("[Profiling] max profile duration elapsed, stopping profiling for:",H(e).description),i()},ru);const c=e.end.bind(e);function a(){return e?(i().then(()=>{c()},()=>{c()}),e):c()}e.end=a}const py=6e4,hy=3e5;class my{constructor(){this._client=void 0,this._profiler=void 0,this._chunkTimer=void 0,this._profilerId=void 0,this._isRunning=!1,this._sessionSampled=!1,this._lifecycleMode=void 0,this._activeRootSpanIds=new Set,this._rootSpanTimeouts=new Map}initialize(t){const n=t.getOptions().profileLifecycle,r=ay(t.getOptions());v&&m.log(`[Profiling] Initializing profiler (lifecycle='${n}').`),r||v&&m.log("[Profiling] Session not sampled. Skipping lifecycle profiler initialization."),this._profilerId=Me(),this._client=t,this._sessionSampled=r,this._lifecycleMode=n,n==="trace"&&this._setupTraceLifecycleListeners(t)}start(){if(this._lifecycleMode==="trace"){v&&m.warn('[Profiling] `profileLifecycle` is set to "trace". Calls to `uiProfiler.start()` are ignored in trace mode.');return}if(this._isRunning){v&&m.warn("[Profiling] Profile session is already running, `uiProfiler.start()` is a no-op.");return}if(!this._sessionSampled){v&&m.warn("[Profiling] Session is not sampled, `uiProfiler.start()` is a no-op.");return}this._beginProfiling()}stop(){if(this._lifecycleMode==="trace"){v&&m.warn('[Profiling] `profileLifecycle` is set to "trace". Calls to `uiProfiler.stop()` are ignored in trace mode.');return}if(!this._isRunning){v&&m.warn("[Profiling] Profiler is not running, `uiProfiler.stop()` is a no-op.");return}this._endProfiling()}notifyRootSpanActive(t){if(this._lifecycleMode!=="trace"||!this._sessionSampled)return;const n=t.spanContext().spanId;if(!n||this._activeRootSpanIds.has(n))return;this._registerTraceRootSpan(n);const r=this._activeRootSpanIds.size;r===1&&(v&&m.log("[Profiling] Detected already active root span during setup. Active root spans now:",r),this._beginProfiling())}_beginProfiling(){if(!this._isRunning){if(this._isRunning=!0,v&&m.log("[Profiling] Started profiling with profiler ID:",this._profilerId),Tn().setContext("profile",{profiler_id:this._profilerId}),this._startProfilerInstance(),!this._profiler){v&&m.log("[Profiling] Failed to start JS Profiler; stopping."),this._resetProfilerInfo();return}this._startPeriodicChunking()}}_endProfiling(){this._isRunning&&(this._isRunning=!1,this._chunkTimer&&(clearTimeout(this._chunkTimer),this._chunkTimer=void 0),this._clearAllRootSpanTimeouts(),this._collectCurrentChunk().catch(t=>{v&&m.error("[Profiling] Failed to collect current profile chunk on `stop()`:",t)}),this._lifecycleMode==="manual"&&Tn().setContext("profile",{}))}_setupTraceLifecycleListeners(t){t.on("spanStart",n=>{if(!this._sessionSampled){v&&m.log("[Profiling] Span not profiled because of negative sampling decision for user session.");return}if(n!==le(n))return;if(!n.isRecording()){v&&m.log("[Profiling] Discarding profile because root span was not sampled.");return}const r=n.spanContext().spanId;if(!r||this._activeRootSpanIds.has(r))return;this._registerTraceRootSpan(r);const s=this._activeRootSpanIds.size;s===1&&(v&&m.log(`[Profiling] Root span ${r} started. Profiling active while there are active root spans (count=${s}).`),this._beginProfiling())}),t.on("spanEnd",n=>{if(!this._sessionSampled)return;const r=n.spanContext().spanId;if(!r||!this._activeRootSpanIds.has(r))return;this._activeRootSpanIds.delete(r);const s=this._activeRootSpanIds.size;v&&m.log(`[Profiling] Root span with ID ${r} ended. Will continue profiling for as long as there are active root spans (currently: ${s}).`),s===0&&(this._collectCurrentChunk().catch(i=>{v&&m.error("[Profiling] Failed to collect current profile chunk on last `spanEnd`:",i)}),this._endProfiling())})}_resetProfilerInfo(){this._isRunning=!1,Tn().setContext("profile",{})}_clearAllRootSpanTimeouts(){this._rootSpanTimeouts.forEach(t=>clearTimeout(t)),this._rootSpanTimeouts.clear()}_registerTraceRootSpan(t){this._activeRootSpanIds.add(t);const n=setTimeout(()=>this._onRootSpanTimeout(t),hy);this._rootSpanTimeouts.set(t,n)}_startProfilerInstance(){if(this._profiler?.stopped===!1)return;const t=su();if(!t){v&&m.log("[Profiling] Failed to start JS Profiler.");return}this._profiler=t}_startPeriodicChunking(){this._isRunning&&(this._chunkTimer=setTimeout(()=>{if(this._collectCurrentChunk().catch(t=>{v&&m.error("[Profiling] Failed to collect current profile chunk during periodic chunking:",t)}),this._isRunning){if(this._startProfilerInstance(),!this._profiler){this._resetProfilerInfo();return}this._startPeriodicChunking()}},py))}_onRootSpanTimeout(t){this._rootSpanTimeouts.has(t)&&(this._rootSpanTimeouts.delete(t),this._activeRootSpanIds.has(t)&&(v&&m.log(`[Profiling] Reached 5-minute timeout for root span ${t}. You likely started a manual root span that never called \`.end()\`.`),this._activeRootSpanIds.delete(t),this._activeRootSpanIds.size===0&&this._endProfiling()))}async _collectCurrentChunk(){const t=this._profiler;if(this._profiler=void 0,!!t)try{const n=await t.stop(),r=ZS(n,this._client,this._profilerId),s=ey(r);if("reason"in s){v&&m.log("[Profiling] Discarding invalid profile chunk (this is probably a bug in the SDK):",s.reason);return}this._sendProfileChunk(r),v&&m.log("[Profiling] Collected browser profile chunk.")}catch(n){v&&m.log("[Profiling] Error while stopping JS Profiler for chunk:",n)}}_sendProfileChunk(t){const n=this._client,r=or(n.getSdkMetadata?.()),s=n.getDsn(),i=n.getOptions().tunnel,o=Be({event_id:Me(),sent_at:new Date().toISOString(),...r&&{sdk:r},...!!i&&s&&{dsn:ot(s)}},[[{type:"profile_chunk"},t]]);n.sendEnvelope(o).then(null,c=>{v&&m.error("Error while sending profile chunk envelope:",c)})}}const gy="BrowserProfiling",_y=(()=>({name:gy,setup(e){const t=e.getOptions(),n=new my;if(!En(t)&&!t.profileLifecycle&&(t.profileLifecycle="manual"),En(t)&&!t.profilesSampleRate){v&&m.log("[Profiling] Profiling disabled, no profiling options found.");return}const r=de(),s=r&&le(r);if(En(t)&&t.profileSessionSampleRate!==void 0&&v&&m.warn("[Profiling] Both legacy profiling (`profilesSampleRate`) and UI profiling settings are defined. `profileSessionSampleRate` has no effect when legacy profiling is enabled."),En(t))s&&eu(s)&&Ao(s)&&xo(s),e.on("spanStart",i=>{i===le(i)&&Ao(i)&&xo(i)}),e.on("beforeEnvelope",i=>{if(!uy())return;const o=sy(i);if(!o.length)return;const c=[];for(const a of o){const u=a?.contexts,d=u?.profile?.profile_id,l=u?.profile?.start_timestamp;if(typeof d!="string"){v&&m.log("[Profiling] cannot find profile for a span without a profile context");continue}if(!d){v&&m.log("[Profiling] cannot find profile for a span without a profile context");continue}u?.profile&&delete u.profile;const f=ly(d);if(!f){v&&m.log(`[Profiling] Could not retrieve profile for span: ${d}`);continue}const p=cy(d,l,f,a);p&&c.push(p)}ry(i,c)});else{const i=t.profileLifecycle;if(e.on("startUIProfiler",()=>n.start()),e.on("stopUIProfiler",()=>n.stop()),i==="manual")n.initialize(e);else if(i==="trace"){if(!Ce(t)){v&&m.warn("[Profiling] `profileLifecycle` is 'trace' but tracing is disabled. Set a `tracesSampleRate` or `tracesSampler` to enable span tracing.");return}n.initialize(e),s&&n.notifyRootSpanActive(s),D.setTimeout(()=>{const o=de(),c=o&&le(o);c&&n.notifyRootSpanActive(c)},0)}}},processEvent(e){return fy(e)}})),Sy=_y;function yy(e){const t={...e};return Ta(t,"react"),ea("react",{version:ta.version}),Dh(t)}const Ey=new WeakSet;function by(e,t){const n=LS({...e,instrumentPageLoad:!1,instrumentNavigation:!1}),{useEffect:r,useLocation:s,useNavigationType:i,createRoutesFromChildren:o,matchRoutes:c,stripBasename:a,enableAsyncRouteHandlers:u=!1,instrumentPageLoad:d=!0,instrumentNavigation:l=!0,lazyRouteTimeout:f}=e;return{...n,setup(p){n.setup(p);const h=e.finalTimeout??3e4,g=(e.idleTimeout??1e3)*3,S=f??g;S===1/0?br&&m.log("[React Router] lazyRouteTimeout set to Infinity, capping at finalTimeout:",h,"ms to prevent indefinite hangs"):Number.isNaN(S)?br&&m.warn("[React Router] lazyRouteTimeout must be a number, falling back to default:",g):S<0&&br&&m.warn("[React Router] lazyRouteTimeout must be non-negative or Infinity, got:",S,"falling back to:",g)},afterAllSetup(p){n.afterAllSetup(p);const h=D.location?.pathname;d&&h&&Xs(p,{name:h,attributes:{[Re]:"url",[Fe]:"pageload",[ae]:`auto.pageload.react.reactrouter_v${t}`}}),l&&Ey.add(p)}}}function vy(e){return by(e,"6")}var Oo={};const Ty=Oo.CI==="true"||Oo.GITHUB_ACTIONS==="true",Iy="4.11.6",wy={enabled:!0,environment:Ty?"github-ci":"production",release:`spotlight@${Iy}`,tracesSampleRate:1,enableLogs:!0},ky=["sentryTrace","baggage"];function Ry(e=!0){const t=[vy({instrumentPageLoad:e,useEffect:ta.useEffect,useLocation:$u,useNavigationType:Hu,createRoutesFromChildren:Uu,matchRoutes:Bu}),gS(),Sy(),zd({levels:["log","info","warn","error","debug"]})],n=document.location.hash.slice(1);if(n.startsWith("spotlight")){const r=n.indexOf("="),s=r>-1?decodeURIComponent(n.slice(r+1)):void 0;t.push(xh({sidecarUrl:s}))}return t}function My(){const e=ky.map(s=>[s,Fu(s)]),t=e.every(([,s])=>!!s),n=Ry(!t),r=yy({...wy,transport:jS(Ps),dsn:"https://51bcd92dba1128934afd1c5726c84442@o1.ingest.us.sentry.io/4508404727283713",integrations:n,tracePropagationTargets:[/^\//,document.location.origin],profilesSampleRate:1,replaysSessionSampleRate:.01,replaysOnErrorSampleRate:1});t&&r&&Xs(r,{name:"pageload"},Object.fromEntries(e))}export{My as default,Ry as getIntegrations};
24
24
  //# sourceMappingURL=instrumentation.js.map