ghost 5.38.0 → 5.40.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (183) hide show
  1. package/components/{tryghost-adapter-cache-memory-ttl-5.38.0.tgz → tryghost-adapter-cache-memory-ttl-5.40.0.tgz} +0 -0
  2. package/components/tryghost-adapter-cache-redis-5.40.0.tgz +0 -0
  3. package/components/tryghost-adapter-manager-5.40.0.tgz +0 -0
  4. package/components/{tryghost-api-framework-5.38.0.tgz → tryghost-api-framework-5.40.0.tgz} +0 -0
  5. package/components/tryghost-api-version-compatibility-service-5.40.0.tgz +0 -0
  6. package/components/tryghost-audience-feedback-5.40.0.tgz +0 -0
  7. package/components/tryghost-bootstrap-socket-5.40.0.tgz +0 -0
  8. package/components/tryghost-constants-5.40.0.tgz +0 -0
  9. package/components/{tryghost-custom-theme-settings-service-5.38.0.tgz → tryghost-custom-theme-settings-service-5.40.0.tgz} +0 -0
  10. package/components/tryghost-data-generator-5.40.0.tgz +0 -0
  11. package/components/{tryghost-domain-events-5.38.0.tgz → tryghost-domain-events-5.40.0.tgz} +0 -0
  12. package/components/tryghost-dynamic-routing-events-5.40.0.tgz +0 -0
  13. package/components/tryghost-email-analytics-provider-mailgun-5.40.0.tgz +0 -0
  14. package/components/tryghost-email-analytics-service-5.40.0.tgz +0 -0
  15. package/components/tryghost-email-content-generator-5.40.0.tgz +0 -0
  16. package/components/tryghost-email-events-5.40.0.tgz +0 -0
  17. package/components/tryghost-email-service-5.40.0.tgz +0 -0
  18. package/components/{tryghost-email-suppression-list-5.38.0.tgz → tryghost-email-suppression-list-5.40.0.tgz} +0 -0
  19. package/components/tryghost-event-aware-cache-wrapper-5.40.0.tgz +0 -0
  20. package/components/{tryghost-express-dynamic-redirects-5.38.0.tgz → tryghost-express-dynamic-redirects-5.40.0.tgz} +0 -0
  21. package/components/tryghost-external-media-inliner-5.40.0.tgz +0 -0
  22. package/components/tryghost-extract-api-key-5.40.0.tgz +0 -0
  23. package/components/tryghost-html-to-plaintext-5.40.0.tgz +0 -0
  24. package/components/tryghost-i18n-5.40.0.tgz +0 -0
  25. package/components/tryghost-importer-handler-content-files-5.40.0.tgz +0 -0
  26. package/components/tryghost-importer-revue-5.40.0.tgz +0 -0
  27. package/components/tryghost-job-manager-5.40.0.tgz +0 -0
  28. package/components/tryghost-link-redirects-5.40.0.tgz +0 -0
  29. package/components/tryghost-link-replacer-5.40.0.tgz +0 -0
  30. package/components/{tryghost-link-tracking-5.38.0.tgz → tryghost-link-tracking-5.40.0.tgz} +0 -0
  31. package/components/tryghost-magic-link-5.40.0.tgz +0 -0
  32. package/components/tryghost-mailgun-client-5.40.0.tgz +0 -0
  33. package/components/tryghost-member-attribution-5.40.0.tgz +0 -0
  34. package/components/tryghost-member-events-5.40.0.tgz +0 -0
  35. package/components/tryghost-members-api-5.40.0.tgz +0 -0
  36. package/components/tryghost-members-csv-5.40.0.tgz +0 -0
  37. package/components/{tryghost-members-events-service-5.38.0.tgz → tryghost-members-events-service-5.40.0.tgz} +0 -0
  38. package/components/tryghost-members-importer-5.40.0.tgz +0 -0
  39. package/components/tryghost-members-offers-5.40.0.tgz +0 -0
  40. package/components/tryghost-members-payments-5.40.0.tgz +0 -0
  41. package/components/tryghost-members-ssr-5.40.0.tgz +0 -0
  42. package/components/tryghost-members-stripe-service-5.40.0.tgz +0 -0
  43. package/components/tryghost-mentions-email-report-5.40.0.tgz +0 -0
  44. package/components/tryghost-milestones-5.40.0.tgz +0 -0
  45. package/components/{tryghost-minifier-5.38.0.tgz → tryghost-minifier-5.40.0.tgz} +0 -0
  46. package/components/tryghost-mw-api-version-mismatch-5.40.0.tgz +0 -0
  47. package/components/{tryghost-mw-cache-control-5.38.0.tgz → tryghost-mw-cache-control-5.40.0.tgz} +0 -0
  48. package/components/tryghost-mw-error-handler-5.40.0.tgz +0 -0
  49. package/components/tryghost-mw-session-from-token-5.40.0.tgz +0 -0
  50. package/components/tryghost-mw-update-user-last-seen-5.40.0.tgz +0 -0
  51. package/components/{tryghost-mw-version-match-5.38.0.tgz → tryghost-mw-version-match-5.40.0.tgz} +0 -0
  52. package/components/tryghost-mw-vhost-5.40.0.tgz +0 -0
  53. package/components/tryghost-oembed-service-5.40.0.tgz +0 -0
  54. package/components/tryghost-package-json-5.40.0.tgz +0 -0
  55. package/components/tryghost-posts-service-5.40.0.tgz +0 -0
  56. package/components/tryghost-referrers-5.40.0.tgz +0 -0
  57. package/components/tryghost-security-5.40.0.tgz +0 -0
  58. package/components/tryghost-session-service-5.40.0.tgz +0 -0
  59. package/components/tryghost-settings-path-manager-5.40.0.tgz +0 -0
  60. package/components/tryghost-slack-notifications-5.40.0.tgz +0 -0
  61. package/components/tryghost-staff-service-5.40.0.tgz +0 -0
  62. package/components/tryghost-stats-service-5.40.0.tgz +0 -0
  63. package/components/tryghost-tiers-5.40.0.tgz +0 -0
  64. package/components/{tryghost-update-check-service-5.38.0.tgz → tryghost-update-check-service-5.40.0.tgz} +0 -0
  65. package/components/tryghost-verification-trigger-5.40.0.tgz +0 -0
  66. package/components/tryghost-version-notifications-data-service-5.40.0.tgz +0 -0
  67. package/components/tryghost-webmentions-5.40.0.tgz +0 -0
  68. package/core/boot.js +7 -0
  69. package/core/built/admin/assets/{chunk.143.c6802c882a911797ce4f.js → chunk.143.9e105aa0a9236484523a.js} +8 -8
  70. package/core/built/admin/assets/{chunk.178.09faefd4027fcba4113d.js → chunk.178.9b53f20952b9ae4763a2.js} +4 -4
  71. package/core/built/admin/assets/{chunk.220.9ca2950240aba3fced21.js → chunk.462.b66cfed1f66c8d2678b2.js} +9407 -9041
  72. package/core/built/admin/assets/chunk.808.2e76eb12fa4d7be8cb23.js +5 -0
  73. package/core/built/admin/assets/{ghost-35103ff053c43f1dfa7f35821c3c2412.js → ghost-467b96c17c6bc0d06fa88e85074fbecf.js} +299 -275
  74. package/core/built/admin/assets/ghost-68ea49029c6d45b4aa090f4e218917aa.css +1 -0
  75. package/core/built/admin/assets/ghost-dark-c9b38252afc29364507e8c92e4ba9933.css +1 -0
  76. package/core/built/admin/assets/img/latest-posts-1-ea1e669b275f2c7dfa23abd4be8d7ad5.png +0 -0
  77. package/core/built/admin/assets/img/latest-posts-2-e6b0809353ac31642839a6f3bab0d4e8.png +0 -0
  78. package/core/built/admin/assets/img/latest-posts-3-ac8c2e95dd9adecb9029a7b037ed7f15.png +0 -0
  79. package/core/built/admin/assets/{vendor-b982e3bf1020bff77b2a3c44d5f59e55.js → vendor-d08b4de6f990b9cd7b5a92d61952a5bb.js} +54 -49
  80. package/core/built/admin/index.html +6 -6
  81. package/core/frontend/meta/schema.js +4 -16
  82. package/core/server/api/endpoints/db.js +10 -2
  83. package/core/server/api/endpoints/members.js +8 -1
  84. package/core/server/api/endpoints/posts.js +30 -1
  85. package/core/server/api/endpoints/utils/serializers/output/mappers/emails.js +2 -1
  86. package/core/server/api/endpoints/utils/serializers/output/posts.js +5 -0
  87. package/core/server/data/importer/import-manager.js +3 -8
  88. package/core/server/data/migrations/versions/5.39/2023-03-13-09-29-add-newsletter-show-post-title-section.js +7 -0
  89. package/core/server/data/migrations/versions/5.39/2023-03-13-13-11-add-newsletter-show-comment-cta.js +7 -0
  90. package/core/server/data/migrations/versions/5.39/2023-03-13-14-30-add-newsletter-show-subscription-details.js +7 -0
  91. package/core/server/data/migrations/versions/5.39/2023-03-14-12-26-add-last-mentions-email-report-timestamp-setting.js +8 -0
  92. package/core/server/data/migrations/versions/5.40/2023-03-13-14-05-add-newsletter-show-latest-posts.js +7 -0
  93. package/core/server/data/migrations/versions/5.40/2023-03-21-18-42-add-self-serve-integration-role.js +31 -0
  94. package/core/server/data/migrations/versions/5.40/2023-03-21-18-43-add-self-serve-migration-and-permissions.js +25 -0
  95. package/core/server/data/migrations/versions/5.40/2023-03-21-18-52-add-self-serve-integration.js +37 -0
  96. package/core/server/data/migrations/versions/5.40/2023-03-21-19-02-add-self-serve-integration-api-key.js +72 -0
  97. package/core/server/data/schema/default-settings/default-settings.json +4 -0
  98. package/core/server/data/schema/fixtures/fixtures.json +21 -0
  99. package/core/server/data/schema/schema.js +4 -0
  100. package/core/server/lib/request-external.js +8 -4
  101. package/core/server/models/base/plugins/relations.js +22 -0
  102. package/core/server/models/base/plugins/sanitize.js +1 -1
  103. package/core/server/models/newsletter.js +4 -0
  104. package/core/server/services/email-service/wrapper.js +4 -1
  105. package/core/server/services/i18n.js +14 -0
  106. package/core/server/services/member-attribution/index.js +2 -1
  107. package/core/server/services/members/api.js +43 -42
  108. package/core/server/services/members/emails/signin.js +9 -9
  109. package/core/server/services/mentions/BookshelfMentionRepository.js +11 -0
  110. package/core/server/services/mentions/service.js +4 -0
  111. package/core/server/services/mentions-email-report/StartMentionEmailReportJob.js +16 -0
  112. package/core/server/services/mentions-email-report/index.js +1 -0
  113. package/core/server/services/mentions-email-report/job.js +11 -0
  114. package/core/server/services/mentions-email-report/service.js +162 -0
  115. package/core/server/services/milestones/BookshelfMilestoneRepository.js +18 -6
  116. package/core/server/services/milestones/service.js +17 -15
  117. package/core/server/services/posts/posts-service.js +22 -119
  118. package/core/server/services/public-config/config.js +1 -1
  119. package/core/server/services/slack-notifications/service.js +1 -2
  120. package/core/server/services/webhooks/trigger.js +2 -2
  121. package/core/server/web/api/endpoints/admin/routes.js +2 -1
  122. package/core/shared/config/defaults.json +3 -4
  123. package/core/shared/config/overrides.json +3 -1
  124. package/core/shared/labs.js +3 -4
  125. package/package.json +149 -142
  126. package/yarn.lock +3544 -1240
  127. package/components/tryghost-adapter-cache-redis-5.38.0.tgz +0 -0
  128. package/components/tryghost-adapter-manager-5.38.0.tgz +0 -0
  129. package/components/tryghost-api-version-compatibility-service-5.38.0.tgz +0 -0
  130. package/components/tryghost-audience-feedback-5.38.0.tgz +0 -0
  131. package/components/tryghost-bootstrap-socket-5.38.0.tgz +0 -0
  132. package/components/tryghost-constants-5.38.0.tgz +0 -0
  133. package/components/tryghost-data-generator-5.38.0.tgz +0 -0
  134. package/components/tryghost-dynamic-routing-events-5.38.0.tgz +0 -0
  135. package/components/tryghost-email-analytics-provider-mailgun-5.38.0.tgz +0 -0
  136. package/components/tryghost-email-analytics-service-5.38.0.tgz +0 -0
  137. package/components/tryghost-email-content-generator-5.38.0.tgz +0 -0
  138. package/components/tryghost-email-events-5.38.0.tgz +0 -0
  139. package/components/tryghost-email-service-5.38.0.tgz +0 -0
  140. package/components/tryghost-event-aware-cache-wrapper-5.38.0.tgz +0 -0
  141. package/components/tryghost-external-media-inliner-5.38.0.tgz +0 -0
  142. package/components/tryghost-extract-api-key-5.38.0.tgz +0 -0
  143. package/components/tryghost-html-to-plaintext-5.38.0.tgz +0 -0
  144. package/components/tryghost-i18n-5.38.0.tgz +0 -0
  145. package/components/tryghost-importer-handler-content-files-5.38.0.tgz +0 -0
  146. package/components/tryghost-importer-revue-5.38.0.tgz +0 -0
  147. package/components/tryghost-job-manager-5.38.0.tgz +0 -0
  148. package/components/tryghost-link-redirects-5.38.0.tgz +0 -0
  149. package/components/tryghost-link-replacer-5.38.0.tgz +0 -0
  150. package/components/tryghost-magic-link-5.38.0.tgz +0 -0
  151. package/components/tryghost-mailgun-client-5.38.0.tgz +0 -0
  152. package/components/tryghost-member-attribution-5.38.0.tgz +0 -0
  153. package/components/tryghost-member-events-5.38.0.tgz +0 -0
  154. package/components/tryghost-members-api-5.38.0.tgz +0 -0
  155. package/components/tryghost-members-csv-5.38.0.tgz +0 -0
  156. package/components/tryghost-members-importer-5.38.0.tgz +0 -0
  157. package/components/tryghost-members-offers-5.38.0.tgz +0 -0
  158. package/components/tryghost-members-payments-5.38.0.tgz +0 -0
  159. package/components/tryghost-members-ssr-5.38.0.tgz +0 -0
  160. package/components/tryghost-members-stripe-service-5.38.0.tgz +0 -0
  161. package/components/tryghost-milestones-5.38.0.tgz +0 -0
  162. package/components/tryghost-mw-api-version-mismatch-5.38.0.tgz +0 -0
  163. package/components/tryghost-mw-error-handler-5.38.0.tgz +0 -0
  164. package/components/tryghost-mw-session-from-token-5.38.0.tgz +0 -0
  165. package/components/tryghost-mw-update-user-last-seen-5.38.0.tgz +0 -0
  166. package/components/tryghost-mw-vhost-5.38.0.tgz +0 -0
  167. package/components/tryghost-oembed-service-5.38.0.tgz +0 -0
  168. package/components/tryghost-package-json-5.38.0.tgz +0 -0
  169. package/components/tryghost-referrers-5.38.0.tgz +0 -0
  170. package/components/tryghost-security-5.38.0.tgz +0 -0
  171. package/components/tryghost-session-service-5.38.0.tgz +0 -0
  172. package/components/tryghost-settings-path-manager-5.38.0.tgz +0 -0
  173. package/components/tryghost-slack-notifications-5.38.0.tgz +0 -0
  174. package/components/tryghost-staff-service-5.38.0.tgz +0 -0
  175. package/components/tryghost-stats-service-5.38.0.tgz +0 -0
  176. package/components/tryghost-tiers-5.38.0.tgz +0 -0
  177. package/components/tryghost-verification-trigger-5.38.0.tgz +0 -0
  178. package/components/tryghost-version-notifications-data-service-5.38.0.tgz +0 -0
  179. package/components/tryghost-webmentions-5.38.0.tgz +0 -0
  180. package/core/built/admin/assets/chunk.79.acb7dd01e1c785f4920c.js +0 -287
  181. package/core/built/admin/assets/ghost-a9307c9cfe26a4bc621e02cd3bae421a.css +0 -1
  182. package/core/built/admin/assets/ghost-dark-f309cf445255344e4861a95ecb8f1920.css +0 -1
  183. /package/core/built/admin/assets/{chunk.220.9ca2950240aba3fced21.js.LICENSE.txt → chunk.462.b66cfed1f66c8d2678b2.js.LICENSE.txt} +0 -0
Binary file
@@ -1,287 +0,0 @@
1
- "use strict";(globalThis.webpackChunk_ember_auto_import_=globalThis.webpackChunk_ember_auto_import_||[]).push([[79],{12058:(t,e,n)=>{n.d(e,{z:()=>s})
2
- var i=n(8651)
3
- function s(t){if("boolean"==typeof __SENTRY_TRACING__&&!__SENTRY_TRACING__)return!1
4
- const e=(0,i.Gd)().getClient(),n=t||e&&e.getOptions()
5
- return!!n&&(n.enableTracing||"tracesSampleRate"in n||"tracesSampler"in n)}},38285:(t,e,n)=>{n.d(e,{ro:()=>f,lb:()=>m})
6
- var i=n(12058),s=n(8651),a=n(88521),r=n(16140),o=n(30180),c=n(8142),_=n(48206)
7
- function d(){const t=(0,_.x1)()
8
- if(t){const e="internal_error";("undefined"==typeof __SENTRY_DEBUG__||__SENTRY_DEBUG__)&&a.kg.log(`[Tracing] Transaction: ${e} -> Global error occured`),t.setStatus(e)}}var l=n(27448),p=n(21535)
9
- function u(){const t=this.getScope()
10
- if(t){const e=t.getSpan()
11
- if(e)return{"sentry-trace":e.toTraceparent()}}return{}}function h(t,e,n){if(!(0,i.z)(e))return t.sampled=!1,t
12
- if(void 0!==t.sampled)return t.setMetadata({sampleRate:Number(t.sampled)}),t
13
- let s
14
- return"function"==typeof e.tracesSampler?(s=e.tracesSampler(n),t.setMetadata({sampleRate:Number(s)})):void 0!==n.parentSampled?s=n.parentSampled:void 0!==e.tracesSampleRate?(s=e.tracesSampleRate,t.setMetadata({sampleRate:Number(s)})):(s=1,t.setMetadata({sampleRate:s})),o=s,((0,r.i2)(o)||"number"!=typeof o&&"boolean"!=typeof o?(("undefined"==typeof __SENTRY_DEBUG__||__SENTRY_DEBUG__)&&a.kg.warn(`[Tracing] Given sample rate is invalid. Sample rate must be a boolean or a number between 0 and 1. Got ${JSON.stringify(o)} of type ${JSON.stringify(typeof o)}.`),0):!(o<0||o>1)||(("undefined"==typeof __SENTRY_DEBUG__||__SENTRY_DEBUG__)&&a.kg.warn(`[Tracing] Given sample rate is invalid. Sample rate must be between 0 and 1. Got ${o}.`),0))?s?(t.sampled=Math.random()<s,t.sampled?(("undefined"==typeof __SENTRY_DEBUG__||__SENTRY_DEBUG__)&&a.kg.log(`[Tracing] starting ${t.op} transaction - ${t.name}`),t):(("undefined"==typeof __SENTRY_DEBUG__||__SENTRY_DEBUG__)&&a.kg.log(`[Tracing] Discarding transaction because it's not included in the random sample (sampling rate = ${Number(s)})`),t)):(("undefined"==typeof __SENTRY_DEBUG__||__SENTRY_DEBUG__)&&a.kg.log("[Tracing] Discarding transaction because "+("function"==typeof e.tracesSampler?"tracesSampler returned 0 or false":"a negative sampling decision was inherited or tracesSampleRate is set to 0")),t.sampled=!1,t):(("undefined"==typeof __SENTRY_DEBUG__||__SENTRY_DEBUG__)&&a.kg.warn("[Tracing] Discarding transaction because of invalid sample rate."),t.sampled=!1,t)
15
- var o}function g(t,e){const n=this.getClient(),i=n&&n.getOptions()||{},s=i.instrumenter||"sentry",r=t.instrumenter||"sentry"
16
- s!==r&&(("undefined"==typeof __SENTRY_DEBUG__||__SENTRY_DEBUG__)&&a.kg.error(`A transaction was started with instrumenter=\`${r}\`, but the SDK is configured with the \`${s}\` instrumenter.\nThe transaction will not be sampled. Please use the ${s} instrumentation to start transactions.`),t.sampled=!1)
17
- let o=new p.Y(t,this)
18
- return o=h(o,i,{parentSampled:t.parentSampled,transactionContext:t,...e}),o.sampled&&o.initSpanRecorder(i._experiments&&i._experiments.maxSpans),o}function m(t,e,n,i,s,a,r){const o=t.getClient(),c=o&&o.getOptions()||{}
19
- let _=new l.io(e,t,n,i,r,s)
20
- return _=h(_,c,{parentSampled:e.parentSampled,transactionContext:e,...a}),_.sampled&&_.initSpanRecorder(c._experiments&&c._experiments.maxSpans),_}function f(){!function(){const t=(0,s.cu)()
21
- t.__SENTRY__&&(t.__SENTRY__.extensions=t.__SENTRY__.extensions||{},t.__SENTRY__.extensions.startTransaction||(t.__SENTRY__.extensions.startTransaction=g),t.__SENTRY__.extensions.traceHeaders||(t.__SENTRY__.extensions.traceHeaders=u))}(),(0,o.KV)()&&function(){const e=(0,s.cu)()
22
- if(!e.__SENTRY__)return
23
- const n={mongodb:()=>new((0,o.l$)(t,"./integrations/node/mongo").Mongo),mongoose:()=>new((0,o.l$)(t,"./integrations/node/mongo").Mongo)({mongoose:!0}),mysql:()=>new((0,o.l$)(t,"./integrations/node/mysql").Mysql),pg:()=>new((0,o.l$)(t,"./integrations/node/postgres").Postgres)},i=Object.keys(n).filter((t=>!!(0,o.$y)(t))).map((t=>{try{return n[t]()}catch(t){return}})).filter((t=>t))
24
- i.length>0&&(e.__SENTRY__.integrations=[...e.__SENTRY__.integrations||[],...i])}(),(0,c.o)("error",d),(0,c.o)("unhandledrejection",d)}t=n.hmd(t)},27448:(t,e,n)=>{n.d(e,{hd:()=>_,io:()=>l,mg:()=>c,nT:()=>o})
25
- var i=n(88468),s=n(88521),a=n(20484),r=n(21535)
26
- const o=1e3,c=3e4,_=5e3
27
- class d extends a.gB{constructor(t,e,n,i){super(i),this._pushActivity=t,this._popActivity=e,this.transactionSpanId=n}add(t){t.spanId!==this.transactionSpanId&&(t.finish=e=>{t.endTimestamp="number"==typeof e?e:(0,i._I)(),this._popActivity(t.spanId)},void 0===t.endTimestamp&&this._pushActivity(t.spanId)),super.add(t)}}class l extends r.Y{__init(){this.activities={}}__init2(){this._heartbeatCounter=0}__init3(){this._finished=!1}__init4(){this._beforeFinishCallbacks=[]}constructor(t,e){let n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:o,i=arguments.length>3&&void 0!==arguments[3]?arguments[3]:c,a=arguments.length>4&&void 0!==arguments[4]?arguments[4]:_,r=arguments.length>5&&void 0!==arguments[5]&&arguments[5]
28
- super(t,e),this._idleHub=e,this._idleTimeout=n,this._finalTimeout=i,this._heartbeatInterval=a,this._onScope=r,l.prototype.__init.call(this),l.prototype.__init2.call(this),l.prototype.__init3.call(this),l.prototype.__init4.call(this),r&&(p(e),("undefined"==typeof __SENTRY_DEBUG__||__SENTRY_DEBUG__)&&s.kg.log(`Setting idle transaction on scope. Span ID: ${this.spanId}`),e.configureScope((t=>t.setSpan(this)))),this._startIdleTimeout(),setTimeout((()=>{this._finished||(this.setStatus("deadline_exceeded"),this.finish())}),this._finalTimeout)}finish(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:(0,i._I)()
29
- if(this._finished=!0,this.activities={},this.spanRecorder){("undefined"==typeof __SENTRY_DEBUG__||__SENTRY_DEBUG__)&&s.kg.log("[Tracing] finishing IdleTransaction",new Date(1e3*t).toISOString(),this.op)
30
- for(const e of this._beforeFinishCallbacks)e(this,t)
31
- this.spanRecorder.spans=this.spanRecorder.spans.filter((e=>{if(e.spanId===this.spanId)return!0
32
- e.endTimestamp||(e.endTimestamp=t,e.setStatus("cancelled"),("undefined"==typeof __SENTRY_DEBUG__||__SENTRY_DEBUG__)&&s.kg.log("[Tracing] cancelling span since transaction ended early",JSON.stringify(e,void 0,2)))
33
- const n=e.startTimestamp<t
34
- return n||("undefined"==typeof __SENTRY_DEBUG__||__SENTRY_DEBUG__)&&s.kg.log("[Tracing] discarding Span since it happened after Transaction was finished",JSON.stringify(e,void 0,2)),n})),("undefined"==typeof __SENTRY_DEBUG__||__SENTRY_DEBUG__)&&s.kg.log("[Tracing] flushing IdleTransaction")}else("undefined"==typeof __SENTRY_DEBUG__||__SENTRY_DEBUG__)&&s.kg.log("[Tracing] No active IdleTransaction")
35
- return this._onScope&&p(this._idleHub),super.finish(t)}registerBeforeFinishCallback(t){this._beforeFinishCallbacks.push(t)}initSpanRecorder(t){if(!this.spanRecorder){const e=t=>{this._finished||this._pushActivity(t)},n=t=>{this._finished||this._popActivity(t)}
36
- this.spanRecorder=new d(e,n,this.spanId,t),("undefined"==typeof __SENTRY_DEBUG__||__SENTRY_DEBUG__)&&s.kg.log("Starting heartbeat"),this._pingHeartbeat()}this.spanRecorder.add(this)}_cancelIdleTimeout(){this._idleTimeoutID&&(clearTimeout(this._idleTimeoutID),this._idleTimeoutID=void 0)}_startIdleTimeout(t){this._cancelIdleTimeout(),this._idleTimeoutID=setTimeout((()=>{this._finished||0!==Object.keys(this.activities).length||this.finish(t)}),this._idleTimeout)}_pushActivity(t){this._cancelIdleTimeout(),("undefined"==typeof __SENTRY_DEBUG__||__SENTRY_DEBUG__)&&s.kg.log(`[Tracing] pushActivity: ${t}`),this.activities[t]=!0,("undefined"==typeof __SENTRY_DEBUG__||__SENTRY_DEBUG__)&&s.kg.log("[Tracing] new activities count",Object.keys(this.activities).length)}_popActivity(t){if(this.activities[t]&&(("undefined"==typeof __SENTRY_DEBUG__||__SENTRY_DEBUG__)&&s.kg.log(`[Tracing] popActivity ${t}`),delete this.activities[t],("undefined"==typeof __SENTRY_DEBUG__||__SENTRY_DEBUG__)&&s.kg.log("[Tracing] new activities count",Object.keys(this.activities).length)),0===Object.keys(this.activities).length){const t=(0,i._I)()+this._idleTimeout/1e3
37
- this._startIdleTimeout(t)}}_beat(){if(this._finished)return
38
- const t=Object.keys(this.activities).join("")
39
- t===this._prevHeartbeatString?this._heartbeatCounter++:this._heartbeatCounter=1,this._prevHeartbeatString=t,this._heartbeatCounter>=3?(("undefined"==typeof __SENTRY_DEBUG__||__SENTRY_DEBUG__)&&s.kg.log("[Tracing] Transaction finished because of no change for 3 heart beats"),this.setStatus("deadline_exceeded"),this.finish()):this._pingHeartbeat()}_pingHeartbeat(){("undefined"==typeof __SENTRY_DEBUG__||__SENTRY_DEBUG__)&&s.kg.log(`pinging Heartbeat -> current counter: ${this._heartbeatCounter}`),setTimeout((()=>{this._beat()}),this._heartbeatInterval)}}function p(t){const e=t.getScope()
40
- e&&e.getTransaction()&&e.setSpan(void 0)}},98079:(t,e,n)=>{n.r(e),n.d(e,{BROWSER_TRACING_INTEGRATION_ID:()=>nt,BrowserTracing:()=>st,IdleTransaction:()=>B.io,Integrations:()=>i,Span:()=>ot.Dr,SpanStatus:()=>rt,TRACEPARENT_REGEXP:()=>b.K,Transaction:()=>ct.Y,addExtensionMethods:()=>s.ro,defaultRequestInstrumentationOptions:()=>tt,extractTraceparentData:()=>b.q,getActiveTransaction:()=>G.x1,hasTracingEnabled:()=>G.zu,instrumentOutgoingRequests:()=>et,spanStatusfromHttpCode:()=>ot.Zd,startIdleTransaction:()=>s.lb,stripUrlQueryAndFragment:()=>o.rt})
41
- var i={}
42
- n.r(i),n.d(i,{Apollo:()=>R,BrowserTracing:()=>st,Express:()=>l,GraphQL:()=>y,Mongo:()=>E,Mysql:()=>m,Postgres:()=>g,Prisma:()=>S})
43
- var s=n(38285)
44
- function a(t){let e,n=t[0],i=1
45
- for(;i<t.length;){const s=t[i],a=t[i+1]
46
- if(i+=2,("optionalAccess"===s||"optionalCall"===s)&&null==n)return
47
- "access"===s||"optionalAccess"===s?(e=n,n=a(n)):"call"!==s&&"optionalCall"!==s||(n=a((function(){for(var t=arguments.length,i=new Array(t),s=0;s<t;s++)i[s]=arguments[s]
48
- return n.call(e,...i)})),e=void 0)}return n}var r=n(88521),o=n(72702),c=n(14205),_=n(16140)
49
- function d(t){const e=a([t,"call",t=>t(),"access",t=>t.getClient,"call",t=>t(),"optionalAccess",t=>t.getOptions,"call",t=>t()])
50
- return"sentry"!==(a([e,"optionalAccess",t=>t.instrumenter])||"sentry")}class l{static __initStatic(){this.id="Express"}__init(){this.name=l.id}constructor(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{}
51
- l.prototype.__init.call(this),this._router=t.router||t.app,this._methods=(Array.isArray(t.methods)?t.methods:[]).concat("use")}setupOnce(t,e){this._router?d(e)?("undefined"==typeof __SENTRY_DEBUG__||__SENTRY_DEBUG__)&&r.kg.log("Express Integration is skipped because of instrumenter configuration."):(function(t){(arguments.length>1&&void 0!==arguments[1]?arguments[1]:[]).forEach((e=>function(t,e){const n=t[e]
52
- return t[e]=function(){for(var t=arguments.length,i=new Array(t),s=0;s<t;s++)i[s]=arguments[s]
53
- return n.call(this,...function(t,e){return t.map((t=>"function"==typeof t?p(t,e):Array.isArray(t)?t.map((t=>"function"==typeof t?p(t,e):t)):t))}(i,e))},t}(t,e)))}(this._router,this._methods),function(t){const e="settings"in t
54
- e&&void 0===t._router&&t.lazyrouter&&t.lazyrouter()
55
- const n=e?t._router:t
56
- if(!n)return("undefined"==typeof __SENTRY_DEBUG__||__SENTRY_DEBUG__)&&r.kg.debug("Cannot instrument router for URL Parameterization (did not find a valid router)."),void(("undefined"==typeof __SENTRY_DEBUG__||__SENTRY_DEBUG__)&&r.kg.debug("Routing instrumentation is currently only supported in Express 4."))
57
- const i=Object.getPrototypeOf(n),s=i.process_params
58
- i.process_params=function(t,e,n,i,r){n._reconstructedRoute||(n._reconstructedRoute="")
59
- const{layerRoutePath:d,isRegex:l,isArray:p,numExtraSegments:u}=function(t){const e=a([t,"access",t=>t.route,"optionalAccess",t=>t.path]),n=(0,_.Kj)(e),i=Array.isArray(e)
60
- if(!e)return{isRegex:n,isArray:i,numExtraSegments:0}
61
- const s=i?Math.max(e.reduce(((t,e)=>t+(0,o.$A)(e.toString())),0)-(0,o.$A)(t.path||""),0):0,r=function(t,e){return t?e.map((t=>t.toString())).join(","):e&&e.toString()}(i,e)
62
- return{layerRoutePath:r,isRegex:n,isArray:i,numExtraSegments:s}}(t);(d||l||p)&&(n._hasParameters=!0)
63
- const h=(d||t.path||"").split("/").filter((t=>t.length>0&&(l||p||!t.includes("*")))).join("/")
64
- if(h&&h.length>0&&(n._reconstructedRoute+=`/${h}${l?"/":""}`),(0,o.$A)(n.originalUrl||"")+u===(0,o.$A)(n._reconstructedRoute)){n._hasParameters||n._reconstructedRoute!==n.originalUrl&&(n._reconstructedRoute=n.originalUrl)
65
- const t=i.__sentry_transaction
66
- if(t&&"custom"!==t.metadata.source){const e=n._reconstructedRoute||"/"
67
- t.setName(...(0,c.oA)(n,{path:!0,method:!0,customRoute:e}))}}return s.call(this,t,e,n,i,r)}}(this._router)):("undefined"==typeof __SENTRY_DEBUG__||__SENTRY_DEBUG__)&&r.kg.error("ExpressIntegration is missing an Express instance")}}function p(t,e){const n=t.length
68
- switch(n){case 2:return function(n,i){const s=i.__sentry_transaction
69
- if(s){const n=s.startChild({description:t.name,op:`middleware.express.${e}`})
70
- i.once("finish",(()=>{n.finish()}))}return t.call(this,n,i)}
71
- case 3:return function(n,i,s){const r=a([i.__sentry_transaction,"optionalAccess",t=>t.startChild,"call",n=>n({description:t.name,op:`middleware.express.${e}`})])
72
- t.call(this,n,i,(function(){a([r,"optionalAccess",t=>t.finish,"call",t=>t()])
73
- for(var t=arguments.length,e=new Array(t),n=0;n<t;n++)e[n]=arguments[n]
74
- s.call(this,...e)}))}
75
- case 4:return function(n,i,s,r){const o=a([s.__sentry_transaction,"optionalAccess",t=>t.startChild,"call",n=>n({description:t.name,op:`middleware.express.${e}`})])
76
- t.call(this,n,i,s,(function(){a([o,"optionalAccess",t=>t.finish,"call",t=>t()])
77
- for(var t=arguments.length,e=new Array(t),n=0;n<t;n++)e[n]=arguments[n]
78
- r.call(this,...e)}))}
79
- default:throw new Error(`Express middleware takes 2-4 arguments. Got: ${n}`)}}l.__initStatic()
80
- var u=n(30180),h=n(15834)
81
- class g{static __initStatic(){this.id="Postgres"}__init(){this.name=g.id}constructor(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{}
82
- g.prototype.__init.call(this),this._usePgNative=!!t.usePgNative}setupOnce(t,e){if(d(e))return void(("undefined"==typeof __SENTRY_DEBUG__||__SENTRY_DEBUG__)&&r.kg.log("Postgres Integration is skipped because of instrumenter configuration."))
83
- const n=(0,u.$y)("pg")
84
- if(!n)return void(("undefined"==typeof __SENTRY_DEBUG__||__SENTRY_DEBUG__)&&r.kg.error("Postgres Integration was unable to require `pg` package."))
85
- if(this._usePgNative&&!a([n,"access",t=>t.native,"optionalAccess",t=>t.Client]))return void(("undefined"==typeof __SENTRY_DEBUG__||__SENTRY_DEBUG__)&&r.kg.error("Postgres Integration was unable to access 'pg-native' bindings."))
86
- const{Client:i}=this._usePgNative?n.native:n;(0,h.hl)(i.prototype,"query",(function(t){return function(n,i,s){const r=a([e().getScope(),"optionalAccess",t=>t.getSpan,"call",t=>t()]),o=a([r,"optionalAccess",t=>t.startChild,"call",t=>t({description:"string"==typeof n?n:n.text,op:"db"})])
87
- if("function"==typeof s)return t.call(this,n,i,(function(t,e){a([o,"optionalAccess",t=>t.finish,"call",t=>t()]),s(t,e)}))
88
- if("function"==typeof i)return t.call(this,n,(function(t,e){a([o,"optionalAccess",t=>t.finish,"call",t=>t()]),i(t,e)}))
89
- const c=void 0!==i?t.call(this,n,i):t.call(this,n)
90
- return(0,_.J8)(c)?c.then((t=>(a([o,"optionalAccess",t=>t.finish,"call",t=>t()]),t))):(a([o,"optionalAccess",t=>t.finish,"call",t=>t()]),c)}}))}}g.__initStatic()
91
- class m{constructor(){m.prototype.__init.call(this)}static __initStatic(){this.id="Mysql"}__init(){this.name=m.id}setupOnce(t,e){if(d(e))return void(("undefined"==typeof __SENTRY_DEBUG__||__SENTRY_DEBUG__)&&r.kg.log("Mysql Integration is skipped because of instrumenter configuration."))
92
- const n=(0,u.$y)("mysql/lib/Connection.js")
93
- n?(0,h.hl)(n,"createQuery",(function(t){return function(n,i,s){const r=a([e().getScope(),"optionalAccess",t=>t.getSpan,"call",t=>t()]),o=a([r,"optionalAccess",t=>t.startChild,"call",t=>t({description:"string"==typeof n?n:n.sql,op:"db"})])
94
- return"function"==typeof s?t.call(this,n,i,(function(t,e,n){a([o,"optionalAccess",t=>t.finish,"call",t=>t()]),s(t,e,n)})):"function"==typeof i?t.call(this,n,(function(t,e,n){a([o,"optionalAccess",t=>t.finish,"call",t=>t()]),i(t,e,n)})):t.call(this,n,i,s)}})):("undefined"==typeof __SENTRY_DEBUG__||__SENTRY_DEBUG__)&&r.kg.error("Mysql Integration was unable to require `mysql` package.")}}m.__initStatic()
95
- const f=["aggregate","bulkWrite","countDocuments","createIndex","createIndexes","deleteMany","deleteOne","distinct","drop","dropIndex","dropIndexes","estimatedDocumentCount","find","findOne","findOneAndDelete","findOneAndReplace","findOneAndUpdate","indexes","indexExists","indexInformation","initializeOrderedBulkOp","insertMany","insertOne","isCapped","mapReduce","options","parallelCollectionScan","rename","replaceOne","stats","updateMany","updateOne"],T={bulkWrite:["operations"],countDocuments:["query"],createIndex:["fieldOrSpec"],createIndexes:["indexSpecs"],deleteMany:["filter"],deleteOne:["filter"],distinct:["key","query"],dropIndex:["indexName"],find:["query"],findOne:["query"],findOneAndDelete:["filter"],findOneAndReplace:["filter","replacement"],findOneAndUpdate:["filter","update"],indexExists:["indexes"],insertMany:["docs"],insertOne:["doc"],mapReduce:["map","reduce"],rename:["newName"],replaceOne:["filter","doc"],updateMany:["filter","update"],updateOne:["filter","update"]}
96
- class E{static __initStatic(){this.id="Mongo"}__init(){this.name=E.id}constructor(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{}
97
- E.prototype.__init.call(this),this._operations=Array.isArray(t.operations)?t.operations:f,this._describeOperations=!("describeOperations"in t)||t.describeOperations,this._useMongoose=!!t.useMongoose}setupOnce(t,e){if(d(e))return void(("undefined"==typeof __SENTRY_DEBUG__||__SENTRY_DEBUG__)&&r.kg.log("Mongo Integration is skipped because of instrumenter configuration."))
98
- const n=this._useMongoose?"mongoose":"mongodb",i=(0,u.$y)(n)
99
- i?this._instrumentOperations(i.Collection,this._operations,e):("undefined"==typeof __SENTRY_DEBUG__||__SENTRY_DEBUG__)&&r.kg.error(`Mongo Integration was unable to require \`${n}\` package.`)}_instrumentOperations(t,e,n){e.forEach((e=>this._patchOperation(t,e,n)))}_patchOperation(t,e,n){if(!(e in t.prototype))return
100
- const i=this._getSpanContextFromOperationArguments.bind(this);(0,h.hl)(t.prototype,e,(function(t){return function(){for(var s=arguments.length,r=new Array(s),o=0;o<s;o++)r[o]=arguments[o]
101
- const c=r[r.length-1],d=a([n().getScope(),"optionalAccess",t=>t.getSpan,"call",t=>t()])
102
- if("function"!=typeof c||"mapReduce"===e&&2===r.length){const n=a([d,"optionalAccess",t=>t.startChild,"call",t=>t(i(this,e,r))]),s=t.call(this,...r)
103
- if((0,_.J8)(s))return s.then((t=>(a([n,"optionalAccess",t=>t.finish,"call",t=>t()]),t)))
104
- if((l=s)&&"object"==typeof l&&l.once&&"function"==typeof l.once){const e=s
105
- try{e.once("close",(()=>{a([n,"optionalAccess",t=>t.finish,"call",t=>t()])}))}catch(t){a([n,"optionalAccess",t=>t.finish,"call",t=>t()])}return e}return a([n,"optionalAccess",t=>t.finish,"call",t=>t()]),s}var l
106
- const p=a([d,"optionalAccess",t=>t.startChild,"call",t=>t(i(this,e,r.slice(0,-1)))])
107
- return t.call(this,...r.slice(0,-1),(function(t,e){a([p,"optionalAccess",t=>t.finish,"call",t=>t()]),c(t,e)}))}}))}_getSpanContextFromOperationArguments(t,e,n){const i={collectionName:t.collectionName,dbName:t.dbName,namespace:t.namespace},s={op:"db",description:e,data:i},a=T[e],r=Array.isArray(this._describeOperations)?this._describeOperations.includes(e):this._describeOperations
108
- if(!a||!r)return s
109
- try{if("mapReduce"===e){const[t,e]=n
110
- i[a[0]]="string"==typeof t?t:t.name||"<anonymous>",i[a[1]]="string"==typeof e?e:e.name||"<anonymous>"}else for(let t=0;t<a.length;t++)i[a[t]]=JSON.stringify(n[t])}catch(t){}return s}}E.__initStatic()
111
- class S{static __initStatic(){this.id="Prisma"}__init(){this.name=S.id}constructor(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{}
112
- var e
113
- S.prototype.__init.call(this),(e=t.client)&&e.$use?this._client=t.client:("undefined"==typeof __SENTRY_DEBUG__||__SENTRY_DEBUG__)&&r.kg.warn(`Unsupported Prisma client provided to PrismaIntegration. Provided client: ${JSON.stringify(t.client)}`)}setupOnce(t,e){this._client?d(e)?("undefined"==typeof __SENTRY_DEBUG__||__SENTRY_DEBUG__)&&r.kg.log("Prisma Integration is skipped because of instrumenter configuration."):this._client.$use(((t,n)=>{const i=a([e().getScope(),"optionalAccess",t=>t.getSpan,"call",t=>t()]),s=t.action,r=t.model,o=a([i,"optionalAccess",t=>t.startChild,"call",t=>t({description:r?`${r} ${s}`:s,op:"db.sql.prisma"})]),c=n(t)
114
- return(0,_.J8)(c)?c.then((t=>(a([o,"optionalAccess",t=>t.finish,"call",t=>t()]),t))):(a([o,"optionalAccess",t=>t.finish,"call",t=>t()]),c)})):("undefined"==typeof __SENTRY_DEBUG__||__SENTRY_DEBUG__)&&r.kg.error("PrismaIntegration is missing a Prisma Client Instance")}}S.__initStatic()
115
- class y{constructor(){y.prototype.__init.call(this)}static __initStatic(){this.id="GraphQL"}__init(){this.name=y.id}setupOnce(t,e){if(d(e))return void(("undefined"==typeof __SENTRY_DEBUG__||__SENTRY_DEBUG__)&&r.kg.log("GraphQL Integration is skipped because of instrumenter configuration."))
116
- const n=(0,u.$y)("graphql/execution/execute.js")
117
- n?(0,h.hl)(n,"execute",(function(t){return function(){const n=e().getScope(),i=a([n,"optionalAccess",t=>t.getSpan,"call",t=>t()]),s=a([i,"optionalAccess",t=>t.startChild,"call",t=>t({description:"execute",op:"graphql.execute"})])
118
- a([n,"optionalAccess",t=>t.setSpan,"call",t=>t(s)])
119
- for(var r=arguments.length,o=new Array(r),c=0;c<r;c++)o[c]=arguments[c]
120
- const d=t.call(this,...o)
121
- return(0,_.J8)(d)?d.then((t=>(a([s,"optionalAccess",t=>t.finish,"call",t=>t()]),a([n,"optionalAccess",t=>t.setSpan,"call",t=>t(i)]),t))):(a([s,"optionalAccess",t=>t.finish,"call",t=>t()]),a([n,"optionalAccess",t=>t.setSpan,"call",t=>t(i)]),d)}})):("undefined"==typeof __SENTRY_DEBUG__||__SENTRY_DEBUG__)&&r.kg.error("GraphQL Integration was unable to require graphql/execution package.")}}y.__initStatic()
122
- var v=n(7209)
123
- class R{static __initStatic(){this.id="Apollo"}__init(){this.name=R.id}constructor(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{useNestjs:!1}
124
- R.prototype.__init.call(this),this._useNest=!!t.useNestjs}setupOnce(t,e){if(d(e))("undefined"==typeof __SENTRY_DEBUG__||__SENTRY_DEBUG__)&&r.kg.log("Apollo Integration is skipped because of instrumenter configuration.")
125
- else if(this._useNest){const t=(0,u.$y)("@nestjs/graphql")
126
- if(!t)return void(("undefined"==typeof __SENTRY_DEBUG__||__SENTRY_DEBUG__)&&r.kg.error("Apollo-NestJS Integration was unable to require @nestjs/graphql package."));(0,h.hl)(t.GraphQLFactory.prototype,"mergeWithSchema",(function(t){return function(){(0,h.hl)(this.resolversExplorerService,"explore",(function(t){return function(){return N((0,v.lE)(t.call(this)),e)}}))
127
- for(var n=arguments.length,i=new Array(n),s=0;s<n;s++)i[s]=arguments[s]
128
- return t.call(this,...i)}}))}else{const t=(0,u.$y)("apollo-server-core")
129
- if(!t)return void(("undefined"==typeof __SENTRY_DEBUG__||__SENTRY_DEBUG__)&&r.kg.error("Apollo Integration was unable to require apollo-server-core package."));(0,h.hl)(t.ApolloServerBase.prototype,"constructSchema",(function(t){return function(){if(!this.config.resolvers)return("undefined"==typeof __SENTRY_DEBUG__||__SENTRY_DEBUG__)&&(this.config.schema?(r.kg.warn("Apollo integration is not able to trace `ApolloServer` instances constructed via `schema` property.If you are using NestJS with Apollo, please use `Sentry.Integrations.Apollo({ useNestjs: true })` instead."),r.kg.warn()):this.config.modules&&r.kg.warn("Apollo integration is not able to trace `ApolloServer` instances constructed via `modules` property."),r.kg.error("Skipping tracing as no resolvers found on the `ApolloServer` instance.")),t.call(this)
130
- const n=(0,v.lE)(this.config.resolvers)
131
- return this.config.resolvers=N(n,e),t.call(this)}}))}}}function N(t,e){return t.map((t=>(Object.keys(t).forEach((n=>{Object.keys(t[n]).forEach((i=>{"function"==typeof t[n][i]&&function(t,e,n,i){(0,h.hl)(t[e],n,(function(t){return function(){const s=a([i().getScope(),"optionalAccess",t=>t.getSpan,"call",t=>t()]),r=a([s,"optionalAccess",t=>t.startChild,"call",t=>t({description:`${e}.${n}`,op:"graphql.resolve"})])
132
- for(var o=arguments.length,c=new Array(o),d=0;d<o;d++)c[d]=arguments[d]
133
- const l=t.call(this,...c)
134
- return(0,_.J8)(l)?l.then((t=>(a([r,"optionalAccess",t=>t.finish,"call",t=>t()]),t))):(a([r,"optionalAccess",t=>t.finish,"call",t=>t()]),l)}}))}(t,n,i,e)}))})),t)))}R.__initStatic()
135
- var b=n(75492),D=n(22850),k=n(68256),B=n(27448),G=n(48206)
136
- const Y=n(27083).n2
137
- var U=n(88468)
138
- const x=(t,e,n)=>{let i,s
139
- return a=>{e.value>=0&&(a||n)&&(s=e.value-(i||0),(s||void 0===i)&&(i=e.value,e.delta=s,t(e)))}},I=()=>Y.__WEB_VITALS_POLYFILL__?Y.performance&&(performance.getEntriesByType&&performance.getEntriesByType("navigation")[0]||(()=>{const t=Y.performance.timing,e=Y.performance.navigation.type,n={entryType:"navigation",startTime:0,type:2==e?"back_forward":1===e?"reload":"navigate"}
140
- for(const i in t)"navigationStart"!==i&&"toJSON"!==i&&(n[i]=Math.max(t[i]-t.navigationStart,0))
141
- return n})()):Y.performance&&performance.getEntriesByType&&performance.getEntriesByType("navigation")[0],A=()=>{const t=I()
142
- return t&&t.activationStart||0},C=(t,e)=>{const n=I()
143
- let i="navigate"
144
- return n&&(i=Y.document.prerendering||A()>0?"prerender":n.type.replace(/_/g,"-")),{name:t,value:void 0===e?-1:e,rating:"good",delta:0,entries:[],id:`v3-${Date.now()}-${Math.floor(8999999999999*Math.random())+1e12}`,navigationType:i}},O=(t,e,n)=>{try{if(PerformanceObserver.supportedEntryTypes.includes(t)){const i=new PerformanceObserver((t=>{e(t.getEntries())}))
145
- return i.observe(Object.assign({type:t,buffered:!0},n||{})),i}}catch(t){}},w=(t,e)=>{const n=i=>{"pagehide"!==i.type&&"hidden"!==Y.document.visibilityState||(t(i),e&&(removeEventListener("visibilitychange",n,!0),removeEventListener("pagehide",n,!0)))}
146
- addEventListener("visibilitychange",n,!0),addEventListener("pagehide",n,!0)}
147
- let $=-1
148
- const L=()=>($<0&&($="hidden"!==Y.document.visibilityState||Y.document.prerendering?1/0:0,w((t=>{let{timeStamp:e}=t
149
- $=e}),!0)),{get firstHiddenTime(){return $}}),M={}
150
- function P(t){return"number"==typeof t&&isFinite(t)}function q(t,e){let{startTimestamp:n,...i}=e
151
- return n&&t.startTimestamp>n&&(t.startTimestamp=n),t.startChild({startTimestamp:n,...i})}function H(){return Y&&Y.addEventListener&&Y.performance}let j,F,z=0,X={}
152
- function J(t,e,n,i,s,a){const r=a?e[a]:e[`${n}End`],o=e[`${n}Start`]
153
- o&&r&&q(t,{op:"browser",description:s||n,startTimestamp:i+(0,G.XL)(o),endTimestamp:i+(0,G.XL)(r)})}var Q=n(12058),W=n(8651),Z=n(8142),K=n(98902)
154
- const V=["localhost",/^\//],tt={traceFetch:!0,traceXHR:!0,tracingOrigins:V,tracePropagationTargets:V}
155
- function et(t){const{traceFetch:e,traceXHR:n,tracePropagationTargets:i,tracingOrigins:s,shouldCreateSpanForRequest:a}={traceFetch:tt.traceFetch,traceXHR:tt.traceXHR,...t},r="function"==typeof a?a:t=>!0,o=t=>function(t,e){return(0,K.U0)(t,e||V)}(t,i||s),c={}
156
- e&&(0,Z.o)("fetch",(t=>{!function(t,e,n,i){if(!(0,Q.z)()||!t.fetchData||!e(t.fetchData.url))return
157
- if(t.endTimestamp){const e=t.fetchData.__span
158
- if(!e)return
159
- const n=i[e]
160
- return void(n&&(t.response?n.setHttpStatus(t.response.status):t.error&&n.setStatus("internal_error"),n.finish(),delete i[e]))}const s=(0,W.Gd)().getScope(),a=s&&s.getSpan(),r=a&&a.transaction
161
- if(a&&r){const e=a.startChild({data:{...t.fetchData,type:"fetch"},description:`${t.fetchData.method} ${t.fetchData.url}`,op:"http.client"})
162
- t.fetchData.__span=e.spanId,i[e.spanId]=e
163
- const s=t.args[0]
164
- t.args[1]=t.args[1]||{}
165
- const o=t.args[1]
166
- n(t.fetchData.url)&&(o.headers=function(t,e,n,i){const s=(0,D.IQ)(e),a=n.toTraceparent(),r="undefined"!=typeof Request&&(0,_.V9)(t,Request)?t.headers:i.headers
167
- if(r){if("undefined"!=typeof Headers&&(0,_.V9)(r,Headers)){const t=new Headers(r)
168
- return t.append("sentry-trace",a),s&&t.append(D.bU,s),t}if(Array.isArray(r)){const t=[...r,["sentry-trace",a]]
169
- return s&&t.push([D.bU,s]),t}{const t="baggage"in r?r.baggage:void 0,e=[]
170
- return Array.isArray(t)?e.push(...t):t&&e.push(t),s&&e.push(s),{...r,"sentry-trace":a,baggage:e.length>0?e.join(","):void 0}}}return{"sentry-trace":a,baggage:s}}(s,r.getDynamicSamplingContext(),e,o))}}(t,r,o,c)})),n&&(0,Z.o)("xhr",(t=>{!function(t,e,n,i){if(!(0,Q.z)()||t.xhr&&t.xhr.__sentry_own_request__||!(t.xhr&&t.xhr.__sentry_xhr__&&e(t.xhr.__sentry_xhr__.url)))return
171
- const s=t.xhr.__sentry_xhr__
172
- if(t.endTimestamp){const e=t.xhr.__sentry_xhr_span_id__
173
- if(!e)return
174
- const n=i[e]
175
- return void(n&&(n.setHttpStatus(s.status_code),n.finish(),delete i[e]))}const a=(0,W.Gd)().getScope(),r=a&&a.getSpan(),o=r&&r.transaction
176
- if(r&&o){const e=r.startChild({data:{...s.data,type:"xhr",method:s.method,url:s.url},description:`${s.method} ${s.url}`,op:"http.client"})
177
- if(t.xhr.__sentry_xhr_span_id__=e.spanId,i[t.xhr.__sentry_xhr_span_id__]=e,t.xhr.setRequestHeader&&n(t.xhr.__sentry_xhr__.url))try{t.xhr.setRequestHeader("sentry-trace",e.toTraceparent())
178
- const n=o.getDynamicSamplingContext(),i=(0,D.IQ)(n)
179
- i&&t.xhr.setRequestHeader(D.bU,i)}catch(t){}}}(t,r,o,c)}))}const nt="BrowserTracing",it={idleTimeout:B.nT,finalTimeout:B.mg,heartbeatInterval:B.hd,markBackgroundTransactions:!0,routingInstrumentation:function(t){let e=!(arguments.length>1&&void 0!==arguments[1])||arguments[1],n=!(arguments.length>2&&void 0!==arguments[2])||arguments[2]
180
- if(!Y||!Y.location)return void(("undefined"==typeof __SENTRY_DEBUG__||__SENTRY_DEBUG__)&&r.kg.warn("Could not initialize routing instrumentation due to invalid location"))
181
- let i,s=Y.location.href
182
- e&&(i=t({name:Y.location.pathname,op:"pageload",metadata:{source:"url"}})),n&&(0,Z.o)("history",(e=>{let{to:n,from:a}=e
183
- void 0===a&&s&&-1!==s.indexOf(n)?s=void 0:a!==n&&(s=void 0,i&&(("undefined"==typeof __SENTRY_DEBUG__||__SENTRY_DEBUG__)&&r.kg.log(`[Tracing] Finishing current transaction with op: ${i.op}`),i.finish()),i=t({name:Y.location.pathname,op:"navigation",metadata:{source:"url"}}))}))},startTransactionOnLocationChange:!0,startTransactionOnPageLoad:!0,enableLongTask:!0,_experiments:{},...tt}
184
- class st{__init(){this.name=nt}constructor(t){st.prototype.__init.call(this),this.options={...it,...t},void 0!==this.options._experiments.enableLongTask&&(this.options.enableLongTask=this.options._experiments.enableLongTask),t&&!t.tracePropagationTargets&&t.tracingOrigins&&(this.options.tracePropagationTargets=t.tracingOrigins),function(){const t=H()
185
- t&&U.Z1&&(t.mark&&Y.performance.mark("sentry-tracing-init"),(t=>{const e=C("CLS",0)
186
- let n,i=0,s=[]
187
- const a=t=>{t.forEach((t=>{if(!t.hadRecentInput){const a=s[0],r=s[s.length-1]
188
- i&&0!==s.length&&t.startTime-r.startTime<1e3&&t.startTime-a.startTime<5e3?(i+=t.value,s.push(t)):(i=t.value,s=[t]),i>e.value&&(e.value=i,e.entries=s,n&&n())}}))},r=O("layout-shift",a)
189
- r&&(n=x(t,e),w((()=>{a(r.takeRecords()),n(!0)})))})((t=>{const e=t.entries.pop()
190
- e&&(("undefined"==typeof __SENTRY_DEBUG__||__SENTRY_DEBUG__)&&r.kg.log("[Measurements] Adding CLS"),X.cls={value:t.value,unit:""},F=e)})),(t=>{const e=L(),n=C("LCP")
191
- let i
192
- const s=t=>{const s=t[t.length-1]
193
- if(s){const t=Math.max(s.startTime-A(),0)
194
- t<e.firstHiddenTime&&(n.value=t,n.entries=[s],i())}},a=O("largest-contentful-paint",s)
195
- if(a){i=x(t,n)
196
- const e=()=>{M[n.id]||(s(a.takeRecords()),a.disconnect(),M[n.id]=!0,i(!0))};["keydown","click"].forEach((t=>{addEventListener(t,e,{once:!0,capture:!0})})),w(e,!0)}})((t=>{const e=t.entries.pop()
197
- e&&(("undefined"==typeof __SENTRY_DEBUG__||__SENTRY_DEBUG__)&&r.kg.log("[Measurements] Adding LCP"),X.lcp={value:t.value,unit:"millisecond"},j=e)})),(t=>{const e=L(),n=C("FID")
198
- let i
199
- const s=t=>{t.startTime<e.firstHiddenTime&&(n.value=t.processingStart-t.startTime,n.entries.push(t),i(!0))},a=t=>{t.forEach(s)},r=O("first-input",a)
200
- i=x(t,n),r&&w((()=>{a(r.takeRecords()),r.disconnect()}),!0)})((t=>{const e=t.entries.pop()
201
- if(!e)return
202
- const n=(0,G.XL)(U.Z1),i=(0,G.XL)(e.startTime);("undefined"==typeof __SENTRY_DEBUG__||__SENTRY_DEBUG__)&&r.kg.log("[Measurements] Adding FID"),X.fid={value:t.value,unit:"millisecond"},X["mark.fid"]={value:n+i,unit:"second"}})))}(),this.options.enableLongTask&&O("longtask",(t=>{for(const e of t){const t=(0,G.x1)()
203
- if(!t)return
204
- const n=(0,G.XL)(U.Z1+e.startTime),i=(0,G.XL)(e.duration)
205
- t.startChild({description:"Main UI thread blocked",op:"ui.long-task",startTimestamp:n,endTimestamp:n+i})}}))}setupOnce(t,e){this._getCurrentHub=e
206
- const{routingInstrumentation:n,startTransactionOnLocationChange:i,startTransactionOnPageLoad:s,markBackgroundTransactions:a,traceFetch:o,traceXHR:c,tracePropagationTargets:_,shouldCreateSpanForRequest:d,_experiments:l}=this.options
207
- n((t=>{const n=this._createRouteTransaction(t)
208
- return this.options._experiments.onStartRouteTransaction&&this.options._experiments.onStartRouteTransaction(n,t,e),n}),s,i),a&&(Y&&Y.document?Y.document.addEventListener("visibilitychange",(()=>{const t=(0,G.x1)()
209
- if(Y.document.hidden&&t){const e="cancelled";("undefined"==typeof __SENTRY_DEBUG__||__SENTRY_DEBUG__)&&r.kg.log(`[Tracing] Transaction: ${e} -> since tab moved to the background, op: ${t.op}`),t.status||t.setStatus(e),t.setTag("visibilitychange","document.hidden"),t.finish()}})):("undefined"==typeof __SENTRY_DEBUG__||__SENTRY_DEBUG__)&&r.kg.warn("[Tracing] Could not set up background tab detection due to lack of global document")),l.enableInteractions&&this._registerInteractionListener(),et({traceFetch:o,traceXHR:c,tracePropagationTargets:_,shouldCreateSpanForRequest:d})}_createRouteTransaction(t){if(!this._getCurrentHub)return void(("undefined"==typeof __SENTRY_DEBUG__||__SENTRY_DEBUG__)&&r.kg.warn(`[Tracing] Did not create ${t.op} transaction because _getCurrentHub is invalid.`))
210
- const{beforeNavigate:e,idleTimeout:n,finalTimeout:i,heartbeatInterval:a}=this.options,o="pageload"===t.op,c=o?at("sentry-trace"):null,_=o?at("baggage"):null,d=c?(0,b.q)(c):void 0,l=_?(0,D.EN)(_):void 0,p={...t,...d,metadata:{...t.metadata,dynamicSamplingContext:d&&!l?{}:l},trimEnd:!0},u="function"==typeof e?e(p):p,h=void 0===u?{...p,sampled:!1}:u
211
- h.metadata=h.name!==p.name?{...h.metadata,source:"custom"}:h.metadata,this._latestRouteName=h.name,this._latestRouteSource=h.metadata&&h.metadata.source,!1===h.sampled&&("undefined"==typeof __SENTRY_DEBUG__||__SENTRY_DEBUG__)&&r.kg.log(`[Tracing] Will not send ${h.op} transaction because of beforeNavigate.`),("undefined"==typeof __SENTRY_DEBUG__||__SENTRY_DEBUG__)&&r.kg.log(`[Tracing] Starting ${h.op} transaction on scope`)
212
- const g=this._getCurrentHub(),{location:m}=Y,f=(0,s.lb)(g,h,n,i,!0,{location:m},a)
213
- return f.registerBeforeFinishCallback((t=>{!function(t){const e=H()
214
- if(!e||!Y.performance.getEntries||!U.Z1)return;("undefined"==typeof __SENTRY_DEBUG__||__SENTRY_DEBUG__)&&r.kg.log("[Tracing] Adding & adjusting spans using Performance API")
215
- const n=(0,G.XL)(U.Z1),i=e.getEntries()
216
- let s,a
217
- if(i.slice(z).forEach((e=>{const i=(0,G.XL)(e.startTime),o=(0,G.XL)(e.duration)
218
- if(!("navigation"===t.op&&n+i<t.startTimestamp))switch(e.entryType){case"navigation":!function(t,e,n){["unloadEvent","redirect","domContentLoadedEvent","loadEvent","connect"].forEach((i=>{J(t,e,i,n)})),J(t,e,"secureConnection",n,"TLS/SSL","connectEnd"),J(t,e,"fetch",n,"cache","domainLookupStart"),J(t,e,"domainLookup",n,"DNS"),function(t,e,n){q(t,{op:"browser",description:"request",startTimestamp:n+(0,G.XL)(e.requestStart),endTimestamp:n+(0,G.XL)(e.responseEnd)}),q(t,{op:"browser",description:"response",startTimestamp:n+(0,G.XL)(e.responseStart),endTimestamp:n+(0,G.XL)(e.responseEnd)})}(t,e,n)}(t,e,n),s=n+(0,G.XL)(e.responseStart),a=n+(0,G.XL)(e.requestStart)
219
- break
220
- case"mark":case"paint":case"measure":{!function(t,e,n,i,s){const a=s+n,r=a+i
221
- q(t,{description:e.name,endTimestamp:r,op:e.entryType,startTimestamp:a})}(t,e,i,o,n)
222
- const s=L(),a=e.startTime<s.firstHiddenTime
223
- "first-paint"===e.name&&a&&(("undefined"==typeof __SENTRY_DEBUG__||__SENTRY_DEBUG__)&&r.kg.log("[Measurements] Adding FP"),X.fp={value:e.startTime,unit:"millisecond"}),"first-contentful-paint"===e.name&&a&&(("undefined"==typeof __SENTRY_DEBUG__||__SENTRY_DEBUG__)&&r.kg.log("[Measurements] Adding FCP"),X.fcp={value:e.startTime,unit:"millisecond"})
224
- break}case"resource":{const s=e.name.replace(Y.location.origin,"")
225
- !function(t,e,n,i,s,a){if("xmlhttprequest"===e.initiatorType||"fetch"===e.initiatorType)return
226
- const r={}
227
- "transferSize"in e&&(r["Transfer Size"]=e.transferSize),"encodedBodySize"in e&&(r["Encoded Body Size"]=e.encodedBodySize),"decodedBodySize"in e&&(r["Decoded Body Size"]=e.decodedBodySize),"renderBlockingStatus"in e&&(r["resource.render_blocking_status"]=e.renderBlockingStatus)
228
- const o=a+i
229
- q(t,{description:n,endTimestamp:o+s,op:e.initiatorType?`resource.${e.initiatorType}`:"resource.other",startTimestamp:o,data:r})}(t,e,s,i,o,n)
230
- break}}})),z=Math.max(i.length-1,0),function(t){const e=Y.navigator
231
- if(!e)return
232
- const n=e.connection
233
- n&&(n.effectiveType&&t.setTag("effectiveConnectionType",n.effectiveType),n.type&&t.setTag("connectionType",n.type),P(n.rtt)&&(X["connection.rtt"]={value:n.rtt,unit:"millisecond"})),P(e.deviceMemory)&&t.setTag("deviceMemory",`${e.deviceMemory} GB`),P(e.hardwareConcurrency)&&t.setTag("hardwareConcurrency",String(e.hardwareConcurrency))}(t),"pageload"===t.op){"number"==typeof s&&(("undefined"==typeof __SENTRY_DEBUG__||__SENTRY_DEBUG__)&&r.kg.log("[Measurements] Adding TTFB"),X.ttfb={value:1e3*(s-t.startTimestamp),unit:"millisecond"},"number"==typeof a&&a<=s&&(X["ttfb.requestTime"]={value:1e3*(s-a),unit:"millisecond"})),["fcp","fp","lcp"].forEach((e=>{if(!X[e]||n>=t.startTimestamp)return
234
- const i=X[e].value,s=n+(0,G.XL)(i),a=Math.abs(1e3*(s-t.startTimestamp)),o=a-i;("undefined"==typeof __SENTRY_DEBUG__||__SENTRY_DEBUG__)&&r.kg.log(`[Measurements] Normalized ${e} from ${i} to ${a} (${o})`),X[e].value=a}))
235
- const e=X["mark.fid"]
236
- e&&X.fid&&(q(t,{description:"first input delay",endTimestamp:e.value+(0,G.XL)(X.fid.value),op:"ui.action",startTimestamp:e.value}),delete X["mark.fid"]),"fcp"in X||delete X.cls,Object.keys(X).forEach((e=>{t.setMeasurement(e,X[e].value,X[e].unit)})),function(t){j&&(("undefined"==typeof __SENTRY_DEBUG__||__SENTRY_DEBUG__)&&r.kg.log("[Measurements] Adding LCP Data"),j.element&&t.setTag("lcp.element",(0,k.Rt)(j.element)),j.id&&t.setTag("lcp.id",j.id),j.url&&t.setTag("lcp.url",j.url.trim().slice(0,200)),t.setTag("lcp.size",j.size)),F&&F.sources&&(("undefined"==typeof __SENTRY_DEBUG__||__SENTRY_DEBUG__)&&r.kg.log("[Measurements] Adding CLS Data"),F.sources.forEach(((e,n)=>t.setTag(`cls.source.${n+1}`,(0,k.Rt)(e.node)))))}(t)}j=void 0,F=void 0,X={}}(t)})),f}_registerInteractionListener(){let t
237
- const e=()=>{const{idleTimeout:e,finalTimeout:n,heartbeatInterval:i}=this.options,a="ui.action.click"
238
- if(t&&(t.finish(),t=void 0),!this._getCurrentHub)return void(("undefined"==typeof __SENTRY_DEBUG__||__SENTRY_DEBUG__)&&r.kg.warn(`[Tracing] Did not create ${a} transaction because _getCurrentHub is invalid.`))
239
- if(!this._latestRouteName)return void(("undefined"==typeof __SENTRY_DEBUG__||__SENTRY_DEBUG__)&&r.kg.warn(`[Tracing] Did not create ${a} transaction because _latestRouteName is missing.`))
240
- const o=this._getCurrentHub(),{location:c}=Y,_={name:this._latestRouteName,op:a,trimEnd:!0,metadata:{source:this._latestRouteSource||"url"}}
241
- t=(0,s.lb)(o,_,e,n,!0,{location:c},i)};["click"].forEach((t=>{addEventListener(t,e,{once:!1,capture:!0})}))}}function at(t){const e=(0,k.qT)(`meta[name=${t}]`)
242
- return e?e.getAttribute("content"):null}var rt,ot=n(20484)
243
- !function(t){t.Ok="ok",t.DeadlineExceeded="deadline_exceeded",t.Unauthenticated="unauthenticated",t.PermissionDenied="permission_denied",t.NotFound="not_found",t.ResourceExhausted="resource_exhausted",t.InvalidArgument="invalid_argument",t.Unimplemented="unimplemented",t.Unavailable="unavailable",t.InternalError="internal_error",t.UnknownError="unknown_error",t.Cancelled="cancelled",t.AlreadyExists="already_exists",t.FailedPrecondition="failed_precondition",t.Aborted="aborted",t.OutOfRange="out_of_range",t.DataLoss="data_loss"}(rt||(rt={}))
244
- var ct=n(21535);("undefined"==typeof __SENTRY_TRACING__||__SENTRY_TRACING__)&&(0,s.ro)()},20484:(t,e,n)=>{n.d(e,{Dr:()=>c,Zd:()=>_,gB:()=>o})
245
- var i=n(7209),s=n(88468),a=n(88521),r=n(15834)
246
- class o{__init(){this.spans=[]}constructor(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:1e3
247
- o.prototype.__init.call(this),this._maxlen=t}add(t){this.spans.length>this._maxlen?t.spanRecorder=void 0:this.spans.push(t)}}class c{__init2(){this.traceId=(0,i.DM)()}__init3(){this.spanId=(0,i.DM)().substring(16)}__init4(){this.startTimestamp=(0,s._I)()}__init5(){this.tags={}}__init6(){this.data={}}__init7(){this.instrumenter="sentry"}constructor(t){if(c.prototype.__init2.call(this),c.prototype.__init3.call(this),c.prototype.__init4.call(this),c.prototype.__init5.call(this),c.prototype.__init6.call(this),c.prototype.__init7.call(this),!t)return this
248
- t.traceId&&(this.traceId=t.traceId),t.spanId&&(this.spanId=t.spanId),t.parentSpanId&&(this.parentSpanId=t.parentSpanId),"sampled"in t&&(this.sampled=t.sampled),t.op&&(this.op=t.op),t.description&&(this.description=t.description),t.data&&(this.data=t.data),t.tags&&(this.tags=t.tags),t.status&&(this.status=t.status),t.startTimestamp&&(this.startTimestamp=t.startTimestamp),t.endTimestamp&&(this.endTimestamp=t.endTimestamp),t.instrumenter&&(this.instrumenter=t.instrumenter)}startChild(t){const e=new c({...t,parentSpanId:this.spanId,sampled:this.sampled,traceId:this.traceId})
249
- if(e.spanRecorder=this.spanRecorder,e.spanRecorder&&e.spanRecorder.add(e),e.transaction=this.transaction,("undefined"==typeof __SENTRY_DEBUG__||__SENTRY_DEBUG__)&&e.transaction){const n=`[Tracing] Starting '${t&&t.op||"< unknown op >"}' span on transaction '${e.transaction.name||"< unknown name >"}' (${e.transaction.spanId}).`
250
- e.transaction.metadata.spanMetadata[e.spanId]={logMessage:n},a.kg.log(n)}return e}setTag(t,e){return this.tags={...this.tags,[t]:e},this}setData(t,e){return this.data={...this.data,[t]:e},this}setStatus(t){return this.status=t,this}setHttpStatus(t){this.setTag("http.status_code",String(t))
251
- const e=_(t)
252
- return"unknown_error"!==e&&this.setStatus(e),this}isSuccess(){return"ok"===this.status}finish(t){if(("undefined"==typeof __SENTRY_DEBUG__||__SENTRY_DEBUG__)&&this.transaction&&this.transaction.spanId!==this.spanId){const{logMessage:t}=this.transaction.metadata.spanMetadata[this.spanId]
253
- t&&a.kg.log(t.replace("Starting","Finishing"))}this.endTimestamp="number"==typeof t?t:(0,s._I)()}toTraceparent(){let t=""
254
- return void 0!==this.sampled&&(t=this.sampled?"-1":"-0"),`${this.traceId}-${this.spanId}${t}`}toContext(){return(0,r.Jr)({data:this.data,description:this.description,endTimestamp:this.endTimestamp,op:this.op,parentSpanId:this.parentSpanId,sampled:this.sampled,spanId:this.spanId,startTimestamp:this.startTimestamp,status:this.status,tags:this.tags,traceId:this.traceId})}updateWithContext(t){return this.data=t.data||{},this.description=t.description,this.endTimestamp=t.endTimestamp,this.op=t.op,this.parentSpanId=t.parentSpanId,this.sampled=t.sampled,this.spanId=t.spanId||this.spanId,this.startTimestamp=t.startTimestamp||this.startTimestamp,this.status=t.status,this.tags=t.tags||{},this.traceId=t.traceId||this.traceId,this}getTraceContext(){return(0,r.Jr)({data:Object.keys(this.data).length>0?this.data:void 0,description:this.description,op:this.op,parent_span_id:this.parentSpanId,span_id:this.spanId,status:this.status,tags:Object.keys(this.tags).length>0?this.tags:void 0,trace_id:this.traceId})}toJSON(){return(0,r.Jr)({data:Object.keys(this.data).length>0?this.data:void 0,description:this.description,op:this.op,parent_span_id:this.parentSpanId,span_id:this.spanId,start_timestamp:this.startTimestamp,status:this.status,tags:Object.keys(this.tags).length>0?this.tags:void 0,timestamp:this.endTimestamp,trace_id:this.traceId})}}function _(t){if(t<400&&t>=100)return"ok"
255
- if(t>=400&&t<500)switch(t){case 401:return"unauthenticated"
256
- case 403:return"permission_denied"
257
- case 404:return"not_found"
258
- case 409:return"already_exists"
259
- case 413:return"failed_precondition"
260
- case 429:return"resource_exhausted"
261
- default:return"invalid_argument"}if(t>=500&&t<600)switch(t){case 501:return"unimplemented"
262
- case 503:return"unavailable"
263
- case 504:return"deadline_exceeded"
264
- default:return"internal_error"}return"unknown_error"}},21535:(t,e,n)=>{n.d(e,{Y:()=>c})
265
- var i=n(8651),s=n(26939),a=n(88521),r=n(15834),o=n(20484)
266
- class c extends o.Dr{__init(){this._measurements={}}__init2(){this._contexts={}}__init3(){this._frozenDynamicSamplingContext=void 0}constructor(t,e){super(t),c.prototype.__init.call(this),c.prototype.__init2.call(this),c.prototype.__init3.call(this),this._hub=e||(0,i.Gd)(),this._name=t.name||"",this.metadata={source:"custom",...t.metadata,spanMetadata:{}},this._trimEnd=t.trimEnd,this.transaction=this
267
- const n=this.metadata.dynamicSamplingContext
268
- n&&(this._frozenDynamicSamplingContext={...n})}get name(){return this._name}set name(t){this.setName(t)}setName(t){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"custom"
269
- this._name=t,this.metadata.source=e}initSpanRecorder(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:1e3
270
- this.spanRecorder||(this.spanRecorder=new o.gB(t)),this.spanRecorder.add(this)}setContext(t,e){null===e?delete this._contexts[t]:this._contexts[t]=e}setMeasurement(t,e){let n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:""
271
- this._measurements[t]={value:e,unit:n}}setMetadata(t){this.metadata={...this.metadata,...t}}finish(t){if(void 0!==this.endTimestamp)return
272
- if(this.name||(("undefined"==typeof __SENTRY_DEBUG__||__SENTRY_DEBUG__)&&a.kg.warn("Transaction has no name, falling back to `<unlabeled transaction>`."),this.name="<unlabeled transaction>"),super.finish(t),!0!==this.sampled){("undefined"==typeof __SENTRY_DEBUG__||__SENTRY_DEBUG__)&&a.kg.log("[Tracing] Discarding transaction because its trace was not chosen to be sampled.")
273
- const t=this._hub.getClient()
274
- return void(t&&t.recordDroppedEvent("sample_rate","transaction"))}const e=this.spanRecorder?this.spanRecorder.spans.filter((t=>t!==this&&t.endTimestamp)):[]
275
- this._trimEnd&&e.length>0&&(this.endTimestamp=e.reduce(((t,e)=>t.endTimestamp&&e.endTimestamp?t.endTimestamp>e.endTimestamp?t:e:t)).endTimestamp)
276
- const n=this.metadata,i={contexts:{...this._contexts,trace:this.getTraceContext()},spans:e,start_timestamp:this.startTimestamp,tags:this.tags,timestamp:this.endTimestamp,transaction:this.name,type:"transaction",sdkProcessingMetadata:{...n,dynamicSamplingContext:this.getDynamicSamplingContext()},...n.source&&{transaction_info:{source:n.source}}}
277
- return Object.keys(this._measurements).length>0&&(("undefined"==typeof __SENTRY_DEBUG__||__SENTRY_DEBUG__)&&a.kg.log("[Measurements] Adding measurements to transaction",JSON.stringify(this._measurements,void 0,2)),i.measurements=this._measurements),("undefined"==typeof __SENTRY_DEBUG__||__SENTRY_DEBUG__)&&a.kg.log(`[Tracing] Finishing ${this.op} transaction: ${this.name}.`),this._hub.captureEvent(i)}toContext(){const t=super.toContext()
278
- return(0,r.Jr)({...t,name:this.name,trimEnd:this._trimEnd})}updateWithContext(t){return super.updateWithContext(t),this.name=t.name||"",this._trimEnd=t.trimEnd,this}getDynamicSamplingContext(){if(this._frozenDynamicSamplingContext)return this._frozenDynamicSamplingContext
279
- const t=this._hub||(0,i.Gd)(),e=t&&t.getClient()
280
- if(!e)return{}
281
- const{environment:n,release:a}=e.getOptions()||{},{publicKey:o}=e.getDsn()||{},c=this.metadata.sampleRate,_=void 0!==c?c.toString():void 0,d=t.getScope(),{segment:l}=d&&d.getUser()||{},p=this.metadata.source,u=p&&"url"!==p?this.name:void 0
282
- return(0,r.Jr)({environment:n||s.J,release:a,transaction:u,user_segment:l,public_key:o,trace_id:this.traceId,sample_rate:_})}}},48206:(t,e,n)=>{n.d(e,{XL:()=>o,x1:()=>r,zu:()=>a})
283
- var i=n(12058),s=n(8651)
284
- function a(t){return(0,i.z)(t)}function r(t){const e=(t||(0,s.Gd)()).getScope()
285
- return e&&e.getTransaction()}function o(t){return t/1e3}}}])
286
-
287
- //# sourceMappingURL=chunk.79.acb7dd01e1c785f4920c.map