@cloudflare/vite-plugin 0.0.0-fe0f83310 → 0.0.0-fff677e35

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.
@@ -1,6 +1,18 @@
1
1
  // ../workers-shared/dist/asset-worker.mjs
2
- import { WorkerEntrypoint as $s } from "cloudflare:workers";
3
- var ne = class {
2
+ import { WorkerEntrypoint as zs } from "cloudflare:workers";
3
+ var mr = Object.defineProperty;
4
+ var hr = (t, e, n) => e in t ? mr(t, e, { enumerable: true, configurable: true, writable: true, value: n }) : t[e] = n;
5
+ var Se = (t, e, n) => (hr(t, typeof e != "symbol" ? e + "" : e, n), n);
6
+ var zt = (t, e, n) => {
7
+ if (!e.has(t)) throw TypeError("Cannot " + n);
8
+ };
9
+ var rt = (t, e, n) => (zt(t, e, "read from private field"), n ? n.call(t) : e.get(t));
10
+ var Vt = (t, e, n) => {
11
+ if (e.has(t)) throw TypeError("Cannot add the same private member more than once");
12
+ e instanceof WeakSet ? e.add(t) : e.set(t, n);
13
+ };
14
+ var Jt = (t, e, n, r) => (zt(t, e, "write to private field"), r ? r.call(t, n) : e.set(t, n), n);
15
+ var se = class {
4
16
  constructor(e) {
5
17
  this.performanceTimer = e;
6
18
  }
@@ -8,135 +20,134 @@ var ne = class {
8
20
  return this.performanceTimer ? this.performanceTimer.timeOrigin + this.performanceTimer.now() : Date.now();
9
21
  }
10
22
  };
11
- var Ee = class extends Response {
23
+ var Te = class extends Response {
12
24
  constructor(e, n) {
13
25
  super(e, { ...n, status: 200 });
14
26
  }
15
27
  };
16
- var re = class extends Response {
28
+ var ie = class extends Response {
17
29
  constructor(...[e, n]) {
18
30
  super(e, { ...n, status: 404, statusText: "Not Found" });
19
31
  }
20
32
  };
21
- var Se = class extends Response {
33
+ var be = class extends Response {
22
34
  constructor(...[e, n]) {
23
35
  super(e, { ...n, status: 405, statusText: "Method Not Allowed" });
24
36
  }
25
37
  };
26
- var j = class extends Response {
38
+ var $ = class extends Response {
27
39
  constructor(e, n) {
28
40
  super(null, { ...n, status: 500 });
29
41
  }
30
42
  };
31
- var ye = class extends Response {
43
+ var xe = class extends Response {
32
44
  constructor(...[e, n]) {
33
45
  super(null, { ...n, status: 304, statusText: "Not Modified" });
34
46
  }
35
47
  };
36
- var Te = class extends Response {
48
+ var Re = class extends Response {
37
49
  constructor(e, n) {
38
50
  super(null, { ...n, status: 307, statusText: "Temporary Redirect", headers: { ...n?.headers, Location: e } });
39
51
  }
40
52
  };
41
- var zt = Object.prototype.toString;
42
- function G(t) {
43
- switch (zt.call(t)) {
53
+ var Kt = Object.prototype.toString;
54
+ function H(t) {
55
+ switch (Kt.call(t)) {
44
56
  case "[object Error]":
45
57
  case "[object Exception]":
46
58
  case "[object DOMException]":
47
59
  return true;
48
60
  default:
49
- return v(t, Error);
61
+ return P(t, Error);
50
62
  }
51
63
  }
52
- function Ze(t, e) {
53
- return zt.call(t) === `[object ${e}]`;
64
+ function Xt(t, e) {
65
+ return Kt.call(t) === `[object ${e}]`;
54
66
  }
55
- function Xe(t) {
56
- return Ze(t, "ErrorEvent");
57
- }
58
- function Qe(t) {
59
- return Ze(t, "String");
60
- }
61
- function V(t) {
62
- return typeof t == "object" && t !== null && "__sentry_template_string__" in t && "__sentry_template_values__" in t;
67
+ function J(t) {
68
+ return Xt(t, "String");
63
69
  }
64
70
  function Ie(t) {
65
- return t === null || V(t) || typeof t != "object" && typeof t != "function";
71
+ return t === null || typeof t != "object" && typeof t != "function";
66
72
  }
67
- function C(t) {
68
- return Ze(t, "Object");
73
+ function N(t) {
74
+ return Xt(t, "Object");
69
75
  }
70
- function et(t) {
71
- return typeof Event < "u" && v(t, Event);
76
+ function st(t) {
77
+ return typeof Event < "u" && P(t, Event);
72
78
  }
73
- function tt(t) {
74
- return typeof Element < "u" && v(t, Element);
79
+ function it(t) {
80
+ return typeof Element < "u" && P(t, Element);
75
81
  }
76
- function w(t) {
82
+ function Y(t) {
77
83
  return !!(t && t.then && typeof t.then == "function");
78
84
  }
79
- function nt(t) {
80
- return C(t) && "nativeEvent" in t && "preventDefault" in t && "stopPropagation" in t;
85
+ function ot(t) {
86
+ return N(t) && "nativeEvent" in t && "preventDefault" in t && "stopPropagation" in t;
81
87
  }
82
- function v(t, e) {
88
+ function oe(t) {
89
+ return typeof t == "number" && t !== t;
90
+ }
91
+ function P(t, e) {
83
92
  try {
84
93
  return t instanceof e;
85
94
  } catch {
86
95
  return false;
87
96
  }
88
97
  }
89
- function rt(t) {
98
+ function at(t) {
90
99
  return !!(typeof t == "object" && t !== null && (t.__isVue || t._isVue));
91
100
  }
92
- function M(t, e = 0) {
101
+ function L(t, e = 0) {
93
102
  return typeof t != "string" || e === 0 || t.length <= e ? t : `${t.slice(0, e)}...`;
94
103
  }
95
- var P = "8.9.2";
96
- var g = globalThis;
97
- function K(t, e, n) {
98
- let r = n || g, s = r.__SENTRY__ = r.__SENTRY__ || {}, o = s[P] = s[P] || {};
99
- return o[t] || (o[t] = e());
104
+ function Ae(t) {
105
+ return t && t.Math == Math ? t : void 0;
100
106
  }
101
- var nr = g;
102
- var rr = 80;
103
- function Yt(t, e = {}) {
107
+ var h = typeof globalThis == "object" && Ae(globalThis) || typeof window == "object" && Ae(window) || typeof self == "object" && Ae(self) || typeof global == "object" && Ae(global) || /* @__PURE__ */ function() {
108
+ return this;
109
+ }() || {};
110
+ function D() {
111
+ return h;
112
+ }
113
+ function ae(t, e, n) {
114
+ let r = n || h, s = r.__SENTRY__ = r.__SENTRY__ || {};
115
+ return s[t] || (s[t] = e());
116
+ }
117
+ var ni = D();
118
+ var _r = 80;
119
+ function Zt(t, e = {}) {
104
120
  if (!t) return "<unknown>";
105
121
  try {
106
- let n = t, r = 5, s = [], o = 0, i = 0, a = " > ", c = a.length, u, f = Array.isArray(e) ? e : e.keyAttrs, l = !Array.isArray(e) && e.maxStringLength || rr;
107
- for (; n && o++ < r && (u = sr(n, f), !(u === "html" || o > 1 && i + s.length * c + u.length >= l)); ) s.push(u), i += u.length, n = n.parentNode;
122
+ let n = t, r = 5, s = [], i = 0, o = 0, a = " > ", c = a.length, u, l = Array.isArray(e) ? e : e.keyAttrs, d = !Array.isArray(e) && e.maxStringLength || _r;
123
+ for (; n && i++ < r && (u = gr(n, l), !(u === "html" || i > 1 && o + s.length * c + u.length >= d)); ) s.push(u), o += u.length, n = n.parentNode;
108
124
  return s.reverse().join(a);
109
125
  } catch {
110
126
  return "<unknown>";
111
127
  }
112
128
  }
113
- function sr(t, e) {
114
- let n = t, r = [], s, o, i, a, c;
129
+ function gr(t, e) {
130
+ let n = t, r = [], s, i, o, a, c;
115
131
  if (!n || !n.tagName) return "";
116
- if (nr.HTMLElement && n instanceof HTMLElement && n.dataset) {
117
- if (n.dataset.sentryComponent) return n.dataset.sentryComponent;
118
- if (n.dataset.sentryElement) return n.dataset.sentryElement;
119
- }
120
132
  r.push(n.tagName.toLowerCase());
121
- let u = e && e.length ? e.filter((l) => n.getAttribute(l)).map((l) => [l, n.getAttribute(l)]) : null;
122
- if (u && u.length) u.forEach((l) => {
123
- r.push(`[${l[0]}="${l[1]}"]`);
133
+ let u = e && e.length ? e.filter((d) => n.getAttribute(d)).map((d) => [d, n.getAttribute(d)]) : null;
134
+ if (u && u.length) u.forEach((d) => {
135
+ r.push(`[${d[0]}="${d[1]}"]`);
124
136
  });
125
- else if (n.id && r.push(`#${n.id}`), s = n.className, s && Qe(s)) for (o = s.split(/\s+/), c = 0; c < o.length; c++) r.push(`.${o[c]}`);
126
- let f = ["aria-label", "type", "name", "title", "alt"];
127
- for (c = 0; c < f.length; c++) i = f[c], a = n.getAttribute(i), a && r.push(`[${i}="${a}"]`);
137
+ else if (n.id && r.push(`#${n.id}`), s = n.className, s && J(s)) for (i = s.split(/\s+/), c = 0; c < i.length; c++) r.push(`.${i[c]}`);
138
+ let l = ["aria-label", "type", "name", "title", "alt"];
139
+ for (c = 0; c < l.length; c++) o = l[c], a = n.getAttribute(o), a && r.push(`[${o}="${a}"]`);
128
140
  return r.join("");
129
141
  }
130
- var k = typeof __SENTRY_DEBUG__ > "u" || __SENTRY_DEBUG__;
131
- var or = "Sentry Logger ";
132
- var st = ["debug", "info", "warn", "error", "log", "assert", "trace"];
133
- var ot = {};
134
- function xe(t) {
135
- if (!("console" in g)) return t();
136
- let e = g.console, n = {}, r = Object.keys(ot);
142
+ var Er = "Sentry Logger ";
143
+ var ce = ["debug", "info", "warn", "error", "log", "assert", "trace"];
144
+ var K = {};
145
+ function Ne(t) {
146
+ if (!("console" in h)) return t();
147
+ let e = h.console, n = {}, r = Object.keys(K);
137
148
  r.forEach((s) => {
138
- let o = ot[s];
139
- n[s] = e[s], e[s] = o;
149
+ let i = K[s];
150
+ n[s] = e[s], e[s] = i;
140
151
  });
141
152
  try {
142
153
  return t();
@@ -146,115 +157,125 @@ function xe(t) {
146
157
  });
147
158
  }
148
159
  }
149
- function ir() {
160
+ function yr() {
150
161
  let t = false, e = { enable: () => {
151
162
  t = true;
152
163
  }, disable: () => {
153
164
  t = false;
154
165
  }, isEnabled: () => t };
155
- return k ? st.forEach((n) => {
166
+ return typeof __SENTRY_DEBUG__ > "u" || __SENTRY_DEBUG__ ? ce.forEach((n) => {
156
167
  e[n] = (...r) => {
157
- t && xe(() => {
158
- g.console[n](`${or}[${n}]:`, ...r);
168
+ t && Ne(() => {
169
+ h.console[n](`${Er}[${n}]:`, ...r);
159
170
  });
160
171
  };
161
- }) : st.forEach((n) => {
172
+ }) : ce.forEach((n) => {
162
173
  e[n] = () => {
163
174
  };
164
175
  }), e;
165
176
  }
166
- var p = ir();
167
- var ar = /^(?:(\w+):)\/\/(?:(\w+)(?::(\w+)?)?@)([\w.-]+)(?::(\d+))?\/(.+)/;
168
- function cr(t) {
177
+ var f = yr();
178
+ var Sr = /^(?:(\w+):)\/\/(?:(\w+)(?::(\w+)?)?@)([\w.-]+)(?::(\d+))?\/(.+)/;
179
+ function Tr(t) {
169
180
  return t === "http" || t === "https";
170
181
  }
171
- function L(t, e = false) {
172
- let { host: n, path: r, pass: s, port: o, projectId: i, protocol: a, publicKey: c } = t;
173
- return `${a}://${c}${e && s ? `:${s}` : ""}@${n}${o ? `:${o}` : ""}/${r && `${r}/`}${i}`;
182
+ function B(t, e = false) {
183
+ let { host: n, path: r, pass: s, port: i, projectId: o, protocol: a, publicKey: c } = t;
184
+ return `${a}://${c}${e && s ? `:${s}` : ""}@${n}${i ? `:${i}` : ""}/${r && `${r}/`}${o}`;
174
185
  }
175
- function Jt(t) {
176
- let e = ar.exec(t);
186
+ function Qt(t) {
187
+ let e = Sr.exec(t);
177
188
  if (!e) {
178
- xe(() => {
179
- console.error(`Invalid Sentry Dsn: ${t}`);
180
- });
189
+ console.error(`Invalid Sentry Dsn: ${t}`);
181
190
  return;
182
191
  }
183
- let [n, r, s = "", o, i = "", a] = e.slice(1), c = "", u = a, f = u.split("/");
184
- if (f.length > 1 && (c = f.slice(0, -1).join("/"), u = f.pop()), u) {
185
- let l = u.match(/^\d+/);
186
- l && (u = l[0]);
192
+ let [n, r, s = "", i, o = "", a] = e.slice(1), c = "", u = a, l = u.split("/");
193
+ if (l.length > 1 && (c = l.slice(0, -1).join("/"), u = l.pop()), u) {
194
+ let d = u.match(/^\d+/);
195
+ d && (u = d[0]);
187
196
  }
188
- return Wt({ host: o, pass: s, path: c, projectId: u, port: i, protocol: n, publicKey: r });
197
+ return en({ host: i, pass: s, path: c, projectId: u, port: o, protocol: n, publicKey: r });
189
198
  }
190
- function Wt(t) {
199
+ function en(t) {
191
200
  return { protocol: t.protocol, publicKey: t.publicKey || "", pass: t.pass || "", host: t.host, port: t.port || "", path: t.path || "", projectId: t.projectId };
192
201
  }
193
- function ur(t) {
194
- if (!k) return true;
202
+ function br(t) {
203
+ if (!(typeof __SENTRY_DEBUG__ > "u" || __SENTRY_DEBUG__)) return true;
195
204
  let { port: e, projectId: n, protocol: r } = t;
196
- return ["protocol", "publicKey", "host", "projectId"].find((i) => t[i] ? false : (p.error(`Invalid Sentry Dsn: ${i} missing`), true)) ? false : n.match(/^\d+$/) ? cr(r) ? e && isNaN(parseInt(e, 10)) ? (p.error(`Invalid Sentry Dsn: Invalid port ${e}`), false) : true : (p.error(`Invalid Sentry Dsn: Invalid protocol ${r}`), false) : (p.error(`Invalid Sentry Dsn: Invalid projectId ${n}`), false);
205
+ return ["protocol", "publicKey", "host", "projectId"].find((o) => t[o] ? false : (f.error(`Invalid Sentry Dsn: ${o} missing`), true)) ? false : n.match(/^\d+$/) ? Tr(r) ? e && isNaN(parseInt(e, 10)) ? (f.error(`Invalid Sentry Dsn: Invalid port ${e}`), false) : true : (f.error(`Invalid Sentry Dsn: Invalid protocol ${r}`), false) : (f.error(`Invalid Sentry Dsn: Invalid projectId ${n}`), false);
197
206
  }
198
- function Ae(t) {
199
- let e = typeof t == "string" ? Jt(t) : Wt(t);
200
- if (!(!e || !ur(e))) return e;
207
+ function we(t) {
208
+ let e = typeof t == "string" ? Qt(t) : en(t);
209
+ if (!(!e || !br(e))) return e;
201
210
  }
202
- var x = class extends Error {
211
+ var T = class extends Error {
203
212
  constructor(e, n = "warn") {
204
213
  super(e), this.message = e, this.name = new.target.prototype.constructor.name, Object.setPrototypeOf(this, new.target.prototype), this.logLevel = n;
205
214
  }
206
215
  };
207
- function q(t, e, n) {
216
+ function w(t, e, n) {
217
+ if (!(e in t)) return;
218
+ let r = t[e], s = n(r);
219
+ typeof s == "function" && rn(s, r), t[e] = s;
220
+ }
221
+ function X(t, e, n) {
208
222
  try {
209
223
  Object.defineProperty(t, e, { value: n, writable: true, configurable: true });
210
224
  } catch {
211
- k && p.log(`Failed to add non-enumerable property "${e}" to object`, t);
225
+ (typeof __SENTRY_DEBUG__ > "u" || __SENTRY_DEBUG__) && f.log(`Failed to add non-enumerable property "${e}" to object`, t);
212
226
  }
213
227
  }
214
- function at(t) {
228
+ function rn(t, e) {
229
+ try {
230
+ let n = e.prototype || {};
231
+ t.prototype = e.prototype = n, X(t, "__sentry_original__", e);
232
+ } catch {
233
+ }
234
+ }
235
+ function ut(t) {
215
236
  return Object.keys(t).map((e) => `${encodeURIComponent(e)}=${encodeURIComponent(t[e])}`).join("&");
216
237
  }
217
- function be(t) {
218
- if (G(t)) return { message: t.message, name: t.name, stack: t.stack, ...Kt(t) };
219
- if (et(t)) {
220
- let e = { type: t.type, target: Vt(t.target), currentTarget: Vt(t.currentTarget), ...Kt(t) };
221
- return typeof CustomEvent < "u" && v(t, CustomEvent) && (e.detail = t.detail), e;
238
+ function De(t) {
239
+ if (H(t)) return { message: t.message, name: t.name, stack: t.stack, ...nn(t) };
240
+ if (st(t)) {
241
+ let e = { type: t.type, target: tn(t.target), currentTarget: tn(t.currentTarget), ...nn(t) };
242
+ return typeof CustomEvent < "u" && P(t, CustomEvent) && (e.detail = t.detail), e;
222
243
  } else return t;
223
244
  }
224
- function Vt(t) {
245
+ function tn(t) {
225
246
  try {
226
- return tt(t) ? Yt(t) : Object.prototype.toString.call(t);
247
+ return it(t) ? Zt(t) : Object.prototype.toString.call(t);
227
248
  } catch {
228
249
  return "<unknown>";
229
250
  }
230
251
  }
231
- function Kt(t) {
252
+ function nn(t) {
232
253
  if (typeof t == "object" && t !== null) {
233
254
  let e = {};
234
255
  for (let n in t) Object.prototype.hasOwnProperty.call(t, n) && (e[n] = t[n]);
235
256
  return e;
236
257
  } else return {};
237
258
  }
238
- function se(t, e = 40) {
239
- let n = Object.keys(be(t));
259
+ function ue(t, e = 40) {
260
+ let n = Object.keys(De(t));
240
261
  if (n.sort(), !n.length) return "[object has no keys]";
241
- if (n[0].length >= e) return M(n[0], e);
262
+ if (n[0].length >= e) return L(n[0], e);
242
263
  for (let r = n.length; r > 0; r--) {
243
264
  let s = n.slice(0, r).join(", ");
244
- if (!(s.length > e)) return r === n.length ? s : M(s, e);
265
+ if (!(s.length > e)) return r === n.length ? s : L(s, e);
245
266
  }
246
267
  return "";
247
268
  }
248
- function S(t) {
249
- return it(t, /* @__PURE__ */ new Map());
269
+ function E(t) {
270
+ return ct(t, /* @__PURE__ */ new Map());
250
271
  }
251
- function it(t, e) {
252
- if (lr(t)) {
272
+ function ct(t, e) {
273
+ if (N(t)) {
253
274
  let n = e.get(t);
254
275
  if (n !== void 0) return n;
255
276
  let r = {};
256
277
  e.set(t, r);
257
- for (let s of Object.keys(t)) typeof t[s] < "u" && (r[s] = it(t[s], e));
278
+ for (let s of Object.keys(t)) typeof t[s] < "u" && (r[s] = ct(t[s], e));
258
279
  return r;
259
280
  }
260
281
  if (Array.isArray(t)) {
@@ -262,245 +283,452 @@ function it(t, e) {
262
283
  if (n !== void 0) return n;
263
284
  let r = [];
264
285
  return e.set(t, r), t.forEach((s) => {
265
- r.push(it(s, e));
286
+ r.push(ct(s, e));
266
287
  }), r;
267
288
  }
268
289
  return t;
269
290
  }
270
- function lr(t) {
271
- if (!C(t)) return false;
272
- try {
273
- let e = Object.getPrototypeOf(t).constructor.name;
274
- return !e || e === "Object";
275
- } catch {
276
- return true;
277
- }
291
+ function xr(t, e = false) {
292
+ return !(e || t && !t.startsWith("/") && !t.includes(":\\") && !t.startsWith(".") && !t.match(/^[a-zA-Z]([a-zA-Z0-9.\-+])*:\/\//)) && t !== void 0 && !t.includes("node_modules/");
278
293
  }
279
- var Re = "?";
280
- var Zt = /\(error: (.*)\)/;
281
- var Xt = /captureMessage|captureException/;
282
- function Ne(...t) {
294
+ function sn(t) {
295
+ let e = /^\s*[-]{4,}$/, n = /at (?:async )?(?:(.+?)\s+\()?(?:(.+):(\d+):(\d+)?|([^)]+))\)?/;
296
+ return (r) => {
297
+ let s = r.match(n);
298
+ if (s) {
299
+ let i, o, a, c, u;
300
+ if (s[1]) {
301
+ a = s[1];
302
+ let p = a.lastIndexOf(".");
303
+ if (a[p - 1] === "." && p--, p > 0) {
304
+ i = a.slice(0, p), o = a.slice(p + 1);
305
+ let m = i.indexOf(".Module");
306
+ m > 0 && (a = a.slice(m + 1), i = i.slice(0, m));
307
+ }
308
+ c = void 0;
309
+ }
310
+ o && (c = i, u = o), o === "<anonymous>" && (u = void 0, a = void 0), a === void 0 && (u = u || "<anonymous>", a = c ? `${c}.${u}` : u);
311
+ let l = s[2] && s[2].startsWith("file://") ? s[2].slice(7) : s[2], d = s[5] === "native";
312
+ return !l && s[5] && !d && (l = s[5]), { filename: l, module: t ? t(l) : void 0, function: a, lineno: parseInt(s[3], 10) || void 0, colno: parseInt(s[4], 10) || void 0, in_app: xr(l, d) };
313
+ }
314
+ if (r.match(e)) return { filename: r };
315
+ };
316
+ }
317
+ var cn = 50;
318
+ var on = /\(error: (.*)\)/;
319
+ var an = /captureMessage|captureException/;
320
+ function Oe(...t) {
283
321
  let e = t.sort((n, r) => n[0] - r[0]).map((n) => n[1]);
284
- return (n, r = 0, s = 0) => {
285
- let o = [], i = n.split(`
322
+ return (n, r = 0) => {
323
+ let s = [], i = n.split(`
286
324
  `);
287
- for (let a = r; a < i.length; a++) {
288
- let c = i[a];
289
- if (c.length > 1024) continue;
290
- let u = Zt.test(c) ? c.replace(Zt, "$1") : c;
291
- if (!u.match(/\S*Error: /)) {
292
- for (let f of e) {
293
- let l = f(u);
325
+ for (let o = r; o < i.length; o++) {
326
+ let a = i[o];
327
+ if (a.length > 1024) continue;
328
+ let c = on.test(a) ? a.replace(on, "$1") : a;
329
+ if (!c.match(/\S*Error: /)) {
330
+ for (let u of e) {
331
+ let l = u(c);
294
332
  if (l) {
295
- o.push(l);
333
+ s.push(l);
296
334
  break;
297
335
  }
298
336
  }
299
- if (o.length >= 50 + s) break;
337
+ if (s.length >= cn) break;
300
338
  }
301
339
  }
302
- return Qt(o.slice(s));
340
+ return un(s);
303
341
  };
304
342
  }
305
- function ut(t) {
306
- return Array.isArray(t) ? Ne(...t) : t;
343
+ function lt(t) {
344
+ return Array.isArray(t) ? Oe(...t) : t;
307
345
  }
308
- function Qt(t) {
346
+ function un(t) {
309
347
  if (!t.length) return [];
310
348
  let e = Array.from(t);
311
- return /sentryWrapped/.test(e[e.length - 1].function || "") && e.pop(), e.reverse(), Xt.test(e[e.length - 1].function || "") && (e.pop(), Xt.test(e[e.length - 1].function || "") && e.pop()), e.slice(0, 50).map((n) => ({ ...n, filename: n.filename || e[e.length - 1].filename, function: n.function || Re }));
349
+ return /sentryWrapped/.test(e[e.length - 1].function || "") && e.pop(), e.reverse(), an.test(e[e.length - 1].function || "") && (e.pop(), an.test(e[e.length - 1].function || "") && e.pop()), e.slice(0, cn).map((n) => ({ ...n, filename: n.filename || e[e.length - 1].filename, function: n.function || "?" }));
312
350
  }
313
- var ct = "<anonymous>";
314
- function oe(t) {
351
+ var dt = "<anonymous>";
352
+ function de(t) {
315
353
  try {
316
- return !t || typeof t != "function" ? ct : t.name || ct;
354
+ return !t || typeof t != "function" ? dt : t.name || dt;
317
355
  } catch {
318
- return ct;
356
+ return dt;
319
357
  }
320
358
  }
321
- var Ce = {};
322
- var en = {};
323
- function Oe(t, e) {
324
- Ce[t] = Ce[t] || [], Ce[t].push(e);
359
+ function ft(t) {
360
+ return [90, sn(t)];
325
361
  }
326
- function we(t, e) {
327
- en[t] || (e(), en[t] = true);
362
+ var pt = D();
363
+ function Rr() {
364
+ if (!("fetch" in pt)) return false;
365
+ try {
366
+ return new Headers(), new Request("http://www.example.com"), new Response(), true;
367
+ } catch {
368
+ return false;
369
+ }
328
370
  }
329
- function ve(t, e) {
330
- let n = t && Ce[t];
331
- if (n) for (let r of n) try {
332
- r(e);
333
- } catch (s) {
334
- k && p.error(`Error while triggering instrumentation handler.
335
- Type: ${t}
336
- Name: ${oe(r)}
337
- Error:`, s);
371
+ function dn(t) {
372
+ return t && /^function fetch\(\)\s+\{\s+\[native code\]\s+\}$/.test(t.toString());
373
+ }
374
+ function ln() {
375
+ if (!Rr()) return false;
376
+ if (dn(pt.fetch)) return true;
377
+ let t = false, e = pt.document;
378
+ if (e && typeof e.createElement == "function") try {
379
+ let n = e.createElement("iframe");
380
+ n.hidden = true, e.head.appendChild(n), n.contentWindow && n.contentWindow.fetch && (t = dn(n.contentWindow.fetch)), e.head.removeChild(n);
381
+ } catch (n) {
382
+ (typeof __SENTRY_DEBUG__ > "u" || __SENTRY_DEBUG__) && f.warn("Could not create sandbox iframe for pure fetch check, bailing to window.fetch: ", n);
338
383
  }
384
+ return t;
339
385
  }
340
- var tn = 1e3;
341
- function Z() {
342
- return Date.now() / tn;
386
+ var ve = D();
387
+ function fn() {
388
+ let t = ve.chrome, e = t && t.app && t.app.runtime, n = "history" in ve && !!ve.history.pushState && !!ve.history.replaceState;
389
+ return !e && n;
343
390
  }
344
- function fr() {
345
- let { performance: t } = g;
346
- if (!t || !t.now) return Z;
347
- let e = Date.now() - t.now(), n = t.timeOrigin == null ? e : t.timeOrigin;
348
- return () => (n + t.now()) / tn;
391
+ var y = D();
392
+ var le = "__sentry_xhr_v2__";
393
+ var fe = {};
394
+ var pn = {};
395
+ function Ir(t) {
396
+ if (!pn[t]) switch (pn[t] = true, t) {
397
+ case "console":
398
+ Ar();
399
+ break;
400
+ case "dom":
401
+ yn();
402
+ break;
403
+ case "xhr":
404
+ En();
405
+ break;
406
+ case "fetch":
407
+ Nr();
408
+ break;
409
+ case "history":
410
+ wr();
411
+ break;
412
+ case "error":
413
+ kr();
414
+ break;
415
+ case "unhandledrejection":
416
+ Cr();
417
+ break;
418
+ default:
419
+ (typeof __SENTRY_DEBUG__ > "u" || __SENTRY_DEBUG__) && f.warn("unknown instrumentation type:", t);
420
+ return;
421
+ }
349
422
  }
350
- var ae = fr();
351
- var ie;
352
- var pr = (() => {
353
- let { performance: t } = g;
354
- if (!t || !t.now) {
355
- ie = "none";
356
- return;
423
+ function Ue(t, e) {
424
+ fe[t] = fe[t] || [], fe[t].push(e), Ir(t);
425
+ }
426
+ function O(t, e) {
427
+ if (!(!t || !fe[t])) for (let n of fe[t] || []) try {
428
+ n(e);
429
+ } catch (r) {
430
+ (typeof __SENTRY_DEBUG__ > "u" || __SENTRY_DEBUG__) && f.error(`Error while triggering instrumentation handler.
431
+ Type: ${t}
432
+ Name: ${de(n)}
433
+ Error:`, r);
434
+ }
435
+ }
436
+ function Ar() {
437
+ "console" in h && ce.forEach(function(t) {
438
+ t in h.console && w(h.console, t, function(e) {
439
+ return K[t] = e, function(...n) {
440
+ O("console", { args: n, level: t });
441
+ let r = K[t];
442
+ r && r.apply(h.console, n);
443
+ };
444
+ });
445
+ });
446
+ }
447
+ function Nr() {
448
+ ln() && w(h, "fetch", function(t) {
449
+ return function(...e) {
450
+ let { method: n, url: r } = gn(e), s = { args: e, fetchData: { method: n, url: r }, startTimestamp: Date.now() };
451
+ return O("fetch", { ...s }), t.apply(h, e).then((i) => (O("fetch", { ...s, endTimestamp: Date.now(), response: i }), i), (i) => {
452
+ throw O("fetch", { ...s, endTimestamp: Date.now(), error: i }), i;
453
+ });
454
+ };
455
+ });
456
+ }
457
+ function mt(t, e) {
458
+ return !!t && typeof t == "object" && !!t[e];
459
+ }
460
+ function mn(t) {
461
+ return typeof t == "string" ? t : t ? mt(t, "url") ? t.url : t.toString ? t.toString() : "" : "";
462
+ }
463
+ function gn(t) {
464
+ if (t.length === 0) return { method: "GET", url: "" };
465
+ if (t.length === 2) {
466
+ let [n, r] = t;
467
+ return { url: mn(n), method: mt(r, "method") ? String(r.method).toUpperCase() : "GET" };
468
+ }
469
+ let e = t[0];
470
+ return { url: mn(e), method: mt(e, "method") ? String(e.method).toUpperCase() : "GET" };
471
+ }
472
+ function En() {
473
+ if (!y.XMLHttpRequest) return;
474
+ let t = XMLHttpRequest.prototype;
475
+ w(t, "open", function(e) {
476
+ return function(...n) {
477
+ let r = Date.now(), s = n[1], i = this[le] = { method: J(n[0]) ? n[0].toUpperCase() : n[0], url: n[1], request_headers: {} };
478
+ J(s) && i.method === "POST" && s.match(/sentry_key/) && (this.__sentry_own_request__ = true);
479
+ let o = () => {
480
+ let a = this[le];
481
+ if (a && this.readyState === 4) {
482
+ try {
483
+ a.status_code = this.status;
484
+ } catch {
485
+ }
486
+ O("xhr", { args: n, endTimestamp: Date.now(), startTimestamp: r, xhr: this });
487
+ }
488
+ };
489
+ return "onreadystatechange" in this && typeof this.onreadystatechange == "function" ? w(this, "onreadystatechange", function(a) {
490
+ return function(...c) {
491
+ return o(), a.apply(this, c);
492
+ };
493
+ }) : this.addEventListener("readystatechange", o), w(this, "setRequestHeader", function(a) {
494
+ return function(...c) {
495
+ let [u, l] = c, d = this[le];
496
+ return d && (d.request_headers[u.toLowerCase()] = l), a.apply(this, c);
497
+ };
498
+ }), e.apply(this, n);
499
+ };
500
+ }), w(t, "send", function(e) {
501
+ return function(...n) {
502
+ let r = this[le];
503
+ return r && n[0] !== void 0 && (r.body = n[0]), O("xhr", { args: n, startTimestamp: Date.now(), xhr: this }), e.apply(this, n);
504
+ };
505
+ });
506
+ }
507
+ var ke;
508
+ function wr() {
509
+ if (!fn()) return;
510
+ let t = y.onpopstate;
511
+ y.onpopstate = function(...n) {
512
+ let r = y.location.href, s = ke;
513
+ if (ke = r, O("history", { from: s, to: r }), t) try {
514
+ return t.apply(this, n);
515
+ } catch {
516
+ }
517
+ };
518
+ function e(n) {
519
+ return function(...r) {
520
+ let s = r.length > 2 ? r[2] : void 0;
521
+ if (s) {
522
+ let i = ke, o = String(s);
523
+ ke = o, O("history", { from: i, to: o });
524
+ }
525
+ return n.apply(this, r);
526
+ };
357
527
  }
358
- let e = 3600 * 1e3, n = t.now(), r = Date.now(), s = t.timeOrigin ? Math.abs(t.timeOrigin + n - r) : e, o = s < e, i = t.timing && t.timing.navigationStart, c = typeof i == "number" ? Math.abs(i + n - r) : e, u = c < e;
359
- return o || u ? s <= c ? (ie = "timeOrigin", t.timeOrigin) : (ie = "navigationStart", i) : (ie = "dateNow", r);
360
- })();
361
- var De = null;
362
- function lt(t) {
363
- let e = "error";
364
- Oe(e, t), we(e, dr);
528
+ w(y.history, "pushState", e), w(y.history, "replaceState", e);
365
529
  }
366
- function dr() {
367
- De = g.onerror, g.onerror = function(t, e, n, r, s) {
368
- return ve("error", { column: r, error: s, line: n, msg: t, url: e }), De && !De.__SENTRY_LOADER__ ? De.apply(this, arguments) : false;
369
- }, g.onerror.__SENTRY_INSTRUMENTED__ = true;
530
+ var Dr = 1e3;
531
+ var hn;
532
+ var Ce;
533
+ function Or(t, e) {
534
+ if (t.type !== e.type) return false;
535
+ try {
536
+ if (t.target !== e.target) return false;
537
+ } catch {
538
+ }
539
+ return true;
540
+ }
541
+ function vr(t) {
542
+ if (t.type !== "keypress") return false;
543
+ try {
544
+ let e = t.target;
545
+ if (!e || !e.tagName) return true;
546
+ if (e.tagName === "INPUT" || e.tagName === "TEXTAREA" || e.isContentEditable) return false;
547
+ } catch {
548
+ }
549
+ return true;
550
+ }
551
+ function _n(t, e = false) {
552
+ return (n) => {
553
+ if (!n || n._sentryCaptured || vr(n)) return;
554
+ X(n, "_sentryCaptured", true);
555
+ let r = n.type === "keypress" ? "input" : n.type;
556
+ (Ce === void 0 || !Or(Ce, n)) && (t({ event: n, name: r, global: e }), Ce = n), clearTimeout(hn), hn = y.setTimeout(() => {
557
+ Ce = void 0;
558
+ }, Dr);
559
+ };
560
+ }
561
+ function yn() {
562
+ if (!y.document) return;
563
+ let t = O.bind(null, "dom"), e = _n(t, true);
564
+ y.document.addEventListener("click", e, false), y.document.addEventListener("keypress", e, false), ["EventTarget", "Node"].forEach((n) => {
565
+ let r = y[n] && y[n].prototype;
566
+ !r || !r.hasOwnProperty || !r.hasOwnProperty("addEventListener") || (w(r, "addEventListener", function(s) {
567
+ return function(i, o, a) {
568
+ if (i === "click" || i == "keypress") try {
569
+ let c = this, u = c.__sentry_instrumentation_handlers__ = c.__sentry_instrumentation_handlers__ || {}, l = u[i] = u[i] || { refCount: 0 };
570
+ if (!l.handler) {
571
+ let d = _n(t);
572
+ l.handler = d, s.call(this, i, d, a);
573
+ }
574
+ l.refCount++;
575
+ } catch {
576
+ }
577
+ return s.call(this, i, o, a);
578
+ };
579
+ }), w(r, "removeEventListener", function(s) {
580
+ return function(i, o, a) {
581
+ if (i === "click" || i == "keypress") try {
582
+ let c = this, u = c.__sentry_instrumentation_handlers__ || {}, l = u[i];
583
+ l && (l.refCount--, l.refCount <= 0 && (s.call(this, i, l.handler, a), l.handler = void 0, delete u[i]), Object.keys(u).length === 0 && delete c.__sentry_instrumentation_handlers__);
584
+ } catch {
585
+ }
586
+ return s.call(this, i, o, a);
587
+ };
588
+ }));
589
+ });
590
+ }
591
+ var Pe = null;
592
+ function kr() {
593
+ Pe = y.onerror, y.onerror = function(t, e, n, r, s) {
594
+ return O("error", { column: r, error: s, line: n, msg: t, url: e }), Pe && !Pe.__SENTRY_LOADER__ ? Pe.apply(this, arguments) : false;
595
+ }, y.onerror.__SENTRY_INSTRUMENTED__ = true;
370
596
  }
371
597
  var Me = null;
372
- function ft(t) {
373
- let e = "unhandledrejection";
374
- Oe(e, t), we(e, mr);
598
+ function Cr() {
599
+ Me = y.onunhandledrejection, y.onunhandledrejection = function(t) {
600
+ return O("unhandledrejection", t), Me && !Me.__SENTRY_LOADER__ ? Me.apply(this, arguments) : true;
601
+ }, y.onunhandledrejection.__SENTRY_INSTRUMENTED__ = true;
602
+ }
603
+ function Sn() {
604
+ return typeof __SENTRY_BROWSER_BUNDLE__ < "u" && !!__SENTRY_BROWSER_BUNDLE__;
375
605
  }
376
- function mr() {
377
- Me = g.onunhandledrejection, g.onunhandledrejection = function(t) {
378
- return ve("unhandledrejection", t), Me && !Me.__SENTRY_LOADER__ ? Me.apply(this, arguments) : true;
379
- }, g.onunhandledrejection.__SENTRY_INSTRUMENTED__ = true;
606
+ function Tn() {
607
+ return !Sn() && Object.prototype.toString.call(typeof process < "u" ? process : 0) === "[object process]";
380
608
  }
381
- function nn() {
609
+ function bn(t, e) {
610
+ return t.require(e);
611
+ }
612
+ function xn() {
382
613
  let t = typeof WeakSet == "function", e = t ? /* @__PURE__ */ new WeakSet() : [];
383
614
  function n(s) {
384
615
  if (t) return e.has(s) ? true : (e.add(s), false);
385
- for (let o = 0; o < e.length; o++) if (e[o] === s) return true;
616
+ for (let i = 0; i < e.length; i++) if (e[i] === s) return true;
386
617
  return e.push(s), false;
387
618
  }
388
619
  function r(s) {
389
620
  if (t) e.delete(s);
390
- else for (let o = 0; o < e.length; o++) if (e[o] === s) {
391
- e.splice(o, 1);
621
+ else for (let i = 0; i < e.length; i++) if (e[i] === s) {
622
+ e.splice(i, 1);
392
623
  break;
393
624
  }
394
625
  }
395
626
  return [n, r];
396
627
  }
397
- function T() {
398
- let t = g, e = t.crypto || t.msCrypto, n = () => Math.random() * 16;
628
+ function g() {
629
+ let t = h, e = t.crypto || t.msCrypto, n = () => Math.random() * 16;
399
630
  try {
400
631
  if (e && e.randomUUID) return e.randomUUID().replace(/-/g, "");
401
- e && e.getRandomValues && (n = () => {
402
- let r = new Uint8Array(1);
403
- return e.getRandomValues(r), r[0];
404
- });
632
+ e && e.getRandomValues && (n = () => e.getRandomValues(new Uint8Array(1))[0]);
405
633
  } catch {
406
634
  }
407
635
  return ("10000000100040008000" + 1e11).replace(/[018]/g, (r) => (r ^ (n() & 15) >> r / 4).toString(16));
408
636
  }
409
- function gr(t) {
637
+ function Pr(t) {
410
638
  return t.exception && t.exception.values ? t.exception.values[0] : void 0;
411
639
  }
412
- function ce(t, e, n) {
413
- let r = t.exception = t.exception || {}, s = r.values = r.values || [], o = s[0] = s[0] || {};
414
- o.value || (o.value = e || ""), o.type || (o.type = n || "Error");
640
+ function pe(t, e, n) {
641
+ let r = t.exception = t.exception || {}, s = r.values = r.values || [], i = s[0] = s[0] || {};
642
+ i.value || (i.value = e || ""), i.type || (i.type = n || "Error");
415
643
  }
416
- function z(t, e) {
417
- let n = gr(t);
644
+ function me(t, e) {
645
+ let n = Pr(t);
418
646
  if (!n) return;
419
647
  let r = { type: "generic", handled: true }, s = n.mechanism;
420
648
  if (n.mechanism = { ...r, ...s, ...e }, e && "data" in e) {
421
- let o = { ...s && s.data, ...e.data };
422
- n.mechanism.data = o;
649
+ let i = { ...s && s.data, ...e.data };
650
+ n.mechanism.data = i;
423
651
  }
424
652
  }
425
- function Pe(t) {
653
+ function Le(t) {
426
654
  if (t && t.__sentry_captured__) return true;
427
655
  try {
428
- q(t, "__sentry_captured__", true);
656
+ X(t, "__sentry_captured__", true);
429
657
  } catch {
430
658
  }
431
659
  return false;
432
660
  }
433
- function ue(t) {
661
+ function he(t) {
434
662
  return Array.isArray(t) ? t : [t];
435
663
  }
436
- function O(t, e = 100, n = 1 / 0) {
664
+ function v(t, e = 100, n = 1 / 0) {
437
665
  try {
438
- return pt("", t, e, n);
666
+ return Be("", t, e, n);
439
667
  } catch (r) {
440
668
  return { ERROR: `**non-serializable** (${r})` };
441
669
  }
442
670
  }
443
- function X(t, e = 3, n = 100 * 1024) {
444
- let r = O(t, e);
445
- return Sr(r) > n ? X(t, e - 1, n) : r;
671
+ function Z(t, e = 3, n = 100 * 1024) {
672
+ let r = v(t, e);
673
+ return Br(r) > n ? Z(t, e - 1, n) : r;
446
674
  }
447
- function pt(t, e, n = 1 / 0, r = 1 / 0, s = nn()) {
448
- let [o, i] = s;
449
- if (e == null || ["number", "boolean", "string"].includes(typeof e) && !Number.isNaN(e)) return e;
450
- let a = hr(t, e);
675
+ function Be(t, e, n = 1 / 0, r = 1 / 0, s = xn()) {
676
+ let [i, o] = s;
677
+ if (e == null || ["number", "boolean", "string"].includes(typeof e) && !oe(e)) return e;
678
+ let a = Mr(t, e);
451
679
  if (!a.startsWith("[object ")) return a;
452
680
  if (e.__sentry_skip_normalization__) return e;
453
681
  let c = typeof e.__sentry_override_normalization_depth__ == "number" ? e.__sentry_override_normalization_depth__ : n;
454
682
  if (c === 0) return a.replace("object ", "");
455
- if (o(e)) return "[Circular ~]";
683
+ if (i(e)) return "[Circular ~]";
456
684
  let u = e;
457
685
  if (u && typeof u.toJSON == "function") try {
458
- let d = u.toJSON();
459
- return pt("", d, c - 1, r, s);
686
+ let m = u.toJSON();
687
+ return Be("", m, c - 1, r, s);
460
688
  } catch {
461
689
  }
462
- let f = Array.isArray(e) ? [] : {}, l = 0, m = be(e);
463
- for (let d in m) {
464
- if (!Object.prototype.hasOwnProperty.call(m, d)) continue;
465
- if (l >= r) {
466
- f[d] = "[MaxProperties ~]";
690
+ let l = Array.isArray(e) ? [] : {}, d = 0, p = De(e);
691
+ for (let m in p) {
692
+ if (!Object.prototype.hasOwnProperty.call(p, m)) continue;
693
+ if (d >= r) {
694
+ l[m] = "[MaxProperties ~]";
467
695
  break;
468
696
  }
469
- let h = m[d];
470
- f[d] = pt(d, h, c - 1, r, s), l++;
697
+ let I = p[m];
698
+ l[m] = Be(m, I, c - 1, r, s), d++;
471
699
  }
472
- return i(e), f;
700
+ return o(e), l;
473
701
  }
474
- function hr(t, e) {
702
+ function Mr(t, e) {
475
703
  try {
476
704
  if (t === "domain" && e && typeof e == "object" && e._events) return "[Domain]";
477
705
  if (t === "domainEmitter") return "[DomainEmitter]";
478
706
  if (typeof global < "u" && e === global) return "[Global]";
479
707
  if (typeof window < "u" && e === window) return "[Window]";
480
708
  if (typeof document < "u" && e === document) return "[Document]";
481
- if (rt(e)) return "[VueViewModel]";
482
- if (nt(e)) return "[SyntheticEvent]";
709
+ if (at(e)) return "[VueViewModel]";
710
+ if (ot(e)) return "[SyntheticEvent]";
483
711
  if (typeof e == "number" && e !== e) return "[NaN]";
484
- if (typeof e == "function") return `[Function: ${oe(e)}]`;
712
+ if (typeof e == "function") return `[Function: ${de(e)}]`;
485
713
  if (typeof e == "symbol") return `[${String(e)}]`;
486
714
  if (typeof e == "bigint") return `[BigInt: ${String(e)}]`;
487
- let n = _r(e);
715
+ let n = Ur(e);
488
716
  return /^HTML(\w*)Element$/.test(n) ? `[HTMLElement: ${n}]` : `[object ${n}]`;
489
717
  } catch (n) {
490
718
  return `**non-serializable** (${n})`;
491
719
  }
492
720
  }
493
- function _r(t) {
721
+ function Ur(t) {
494
722
  let e = Object.getPrototypeOf(t);
495
723
  return e ? e.constructor.name : "null prototype";
496
724
  }
497
- function Er(t) {
725
+ function Lr(t) {
498
726
  return ~-encodeURI(t).split(/%..|./).length;
499
727
  }
500
- function Sr(t) {
501
- return Er(JSON.stringify(t));
728
+ function Br(t) {
729
+ return Lr(JSON.stringify(t));
502
730
  }
503
- function yr(t, e) {
731
+ function Gr(t, e) {
504
732
  let n = 0;
505
733
  for (let r = t.length - 1; r >= 0; r--) {
506
734
  let s = t[r];
@@ -509,62 +737,62 @@ function yr(t, e) {
509
737
  if (e) for (; n--; n) t.unshift("..");
510
738
  return t;
511
739
  }
512
- var Tr = /^(\S+:\\|\/?)([\s\S]*?)((?:\.{1,2}|[^/\\]+?|)(\.[^./\\]*|))(?:[/\\]*)$/;
513
- function Ir(t) {
514
- let e = t.length > 1024 ? `<truncated>${t.slice(-1024)}` : t, n = Tr.exec(e);
740
+ var Fr = /^(\S+:\\|\/?)([\s\S]*?)((?:\.{1,2}|[^/\\]+?|)(\.[^./\\]*|))(?:[/\\]*)$/;
741
+ function $r(t) {
742
+ let e = t.length > 1024 ? `<truncated>${t.slice(-1024)}` : t, n = Fr.exec(e);
515
743
  return n ? n.slice(1) : [];
516
744
  }
517
- function dt(...t) {
745
+ function ht(...t) {
518
746
  let e = "", n = false;
519
747
  for (let r = t.length - 1; r >= -1 && !n; r--) {
520
748
  let s = r >= 0 ? t[r] : "/";
521
749
  s && (e = `${s}/${e}`, n = s.charAt(0) === "/");
522
750
  }
523
- return e = yr(e.split("/").filter((r) => !!r), !n).join("/"), (n ? "/" : "") + e || ".";
751
+ return e = Gr(e.split("/").filter((r) => !!r), !n).join("/"), (n ? "/" : "") + e || ".";
524
752
  }
525
- function rn(t) {
753
+ function Rn(t) {
526
754
  let e = 0;
527
755
  for (; e < t.length && t[e] === ""; e++) ;
528
756
  let n = t.length - 1;
529
757
  for (; n >= 0 && t[n] === ""; n--) ;
530
758
  return e > n ? [] : t.slice(e, n - e + 1);
531
759
  }
532
- function mt(t, e) {
533
- t = dt(t).slice(1), e = dt(e).slice(1);
534
- let n = rn(t.split("/")), r = rn(e.split("/")), s = Math.min(n.length, r.length), o = s;
760
+ function _t(t, e) {
761
+ t = ht(t).slice(1), e = ht(e).slice(1);
762
+ let n = Rn(t.split("/")), r = Rn(e.split("/")), s = Math.min(n.length, r.length), i = s;
535
763
  for (let a = 0; a < s; a++) if (n[a] !== r[a]) {
536
- o = a;
764
+ i = a;
537
765
  break;
538
766
  }
539
- let i = [];
540
- for (let a = o; a < n.length; a++) i.push("..");
541
- return i = i.concat(r.slice(o)), i.join("/");
767
+ let o = [];
768
+ for (let a = i; a < n.length; a++) o.push("..");
769
+ return o = o.concat(r.slice(i)), o.join("/");
542
770
  }
543
- function le(t, e) {
544
- let n = Ir(t)[2];
771
+ function _e(t, e) {
772
+ let n = $r(t)[2];
545
773
  return e && n.slice(e.length * -1) === e && (n = n.slice(0, n.length - e.length)), n;
546
774
  }
547
- var D;
775
+ var M;
548
776
  (function(t) {
549
777
  t[t.PENDING = 0] = "PENDING";
550
778
  let n = 1;
551
779
  t[t.RESOLVED = n] = "RESOLVED";
552
780
  let r = 2;
553
781
  t[t.REJECTED = r] = "REJECTED";
554
- })(D || (D = {}));
782
+ })(M || (M = {}));
555
783
  function b(t) {
556
- return new I((e) => {
784
+ return new S((e) => {
557
785
  e(t);
558
786
  });
559
787
  }
560
- function Y(t) {
561
- return new I((e, n) => {
788
+ function j(t) {
789
+ return new S((e, n) => {
562
790
  n(t);
563
791
  });
564
792
  }
565
- var I = class {
793
+ var S = class {
566
794
  constructor(e) {
567
- I.prototype.__init.call(this), I.prototype.__init2.call(this), I.prototype.__init3.call(this), I.prototype.__init4.call(this), this._state = D.PENDING, this._handlers = [];
795
+ S.prototype.__init.call(this), S.prototype.__init2.call(this), S.prototype.__init3.call(this), S.prototype.__init4.call(this), this._state = M.PENDING, this._handlers = [];
568
796
  try {
569
797
  e(this._resolve, this._reject);
570
798
  } catch (n) {
@@ -572,20 +800,20 @@ var I = class {
572
800
  }
573
801
  }
574
802
  then(e, n) {
575
- return new I((r, s) => {
576
- this._handlers.push([false, (o) => {
577
- if (!e) r(o);
803
+ return new S((r, s) => {
804
+ this._handlers.push([false, (i) => {
805
+ if (!e) r(i);
578
806
  else try {
579
- r(e(o));
580
- } catch (i) {
581
- s(i);
807
+ r(e(i));
808
+ } catch (o) {
809
+ s(o);
582
810
  }
583
- }, (o) => {
584
- if (!n) s(o);
811
+ }, (i) => {
812
+ if (!n) s(i);
585
813
  else try {
586
- r(n(o));
587
- } catch (i) {
588
- s(i);
814
+ r(n(i));
815
+ } catch (o) {
816
+ s(o);
589
817
  }
590
818
  }]), this._executeHandlers();
591
819
  });
@@ -594,14 +822,14 @@ var I = class {
594
822
  return this.then((n) => n, e);
595
823
  }
596
824
  finally(e) {
597
- return new I((n, r) => {
598
- let s, o;
599
- return this.then((i) => {
600
- o = false, s = i, e && e();
601
- }, (i) => {
602
- o = true, s = i, e && e();
825
+ return new S((n, r) => {
826
+ let s, i;
827
+ return this.then((o) => {
828
+ i = false, s = o, e && e();
829
+ }, (o) => {
830
+ i = true, s = o, e && e();
603
831
  }).then(() => {
604
- if (o) {
832
+ if (i) {
605
833
  r(s);
606
834
  return;
607
835
  }
@@ -611,18 +839,18 @@ var I = class {
611
839
  }
612
840
  __init() {
613
841
  this._resolve = (e) => {
614
- this._setResult(D.RESOLVED, e);
842
+ this._setResult(M.RESOLVED, e);
615
843
  };
616
844
  }
617
845
  __init2() {
618
846
  this._reject = (e) => {
619
- this._setResult(D.REJECTED, e);
847
+ this._setResult(M.REJECTED, e);
620
848
  };
621
849
  }
622
850
  __init3() {
623
851
  this._setResult = (e, n) => {
624
- if (this._state === D.PENDING) {
625
- if (w(n)) {
852
+ if (this._state === M.PENDING) {
853
+ if (Y(n)) {
626
854
  n.then(this._resolve, this._reject);
627
855
  return;
628
856
  }
@@ -632,10 +860,10 @@ var I = class {
632
860
  }
633
861
  __init4() {
634
862
  this._executeHandlers = () => {
635
- if (this._state === D.PENDING) return;
863
+ if (this._state === M.PENDING) return;
636
864
  let e = this._handlers.slice();
637
865
  this._handlers = [], e.forEach((n) => {
638
- n[0] || (this._state === D.RESOLVED && n[1](this._value), this._state === D.REJECTED && n[2](this._value), n[0] = true);
866
+ n[0] || (this._state === M.RESOLVED && n[1](this._value), this._state === M.REJECTED && n[2](this._value), n[0] = true);
639
867
  });
640
868
  };
641
869
  }
@@ -645,68 +873,73 @@ function gt(t) {
645
873
  function n() {
646
874
  return t === void 0 || e.length < t;
647
875
  }
648
- function r(i) {
649
- return e.splice(e.indexOf(i), 1)[0];
876
+ function r(o) {
877
+ return e.splice(e.indexOf(o), 1)[0];
650
878
  }
651
- function s(i) {
652
- if (!n()) return Y(new x("Not adding Promise because buffer limit was reached."));
653
- let a = i();
879
+ function s(o) {
880
+ if (!n()) return j(new T("Not adding Promise because buffer limit was reached."));
881
+ let a = o();
654
882
  return e.indexOf(a) === -1 && e.push(a), a.then(() => r(a)).then(null, () => r(a).then(null, () => {
655
883
  })), a;
656
884
  }
657
- function o(i) {
658
- return new I((a, c) => {
885
+ function i(o) {
886
+ return new S((a, c) => {
659
887
  let u = e.length;
660
888
  if (!u) return a(true);
661
- let f = setTimeout(() => {
662
- i && i > 0 && a(false);
663
- }, i);
664
- e.forEach((l) => {
665
- b(l).then(() => {
666
- --u || (clearTimeout(f), a(true));
889
+ let l = setTimeout(() => {
890
+ o && o > 0 && a(false);
891
+ }, o);
892
+ e.forEach((d) => {
893
+ b(d).then(() => {
894
+ --u || (clearTimeout(l), a(true));
667
895
  }, c);
668
896
  });
669
897
  });
670
898
  }
671
- return { $: e, add: s, drain: o };
899
+ return { $: e, add: s, drain: i };
672
900
  }
673
- function sn(t, e = false) {
674
- return !(e || t && !t.startsWith("/") && !t.match(/^[A-Z]:/) && !t.startsWith(".") && !t.match(/^[a-zA-Z]([a-zA-Z0-9.\-+])*:\/\//)) && t !== void 0 && !t.includes("node_modules/");
901
+ var An = D();
902
+ var yt = { nowSeconds: () => Date.now() / 1e3 };
903
+ function Hr() {
904
+ let { performance: t } = An;
905
+ if (!t || !t.now) return;
906
+ let e = Date.now() - t.now();
907
+ return { now: () => t.now(), timeOrigin: e };
675
908
  }
676
- function on(t) {
677
- let e = /^\s*[-]{4,}$/, n = /at (?:async )?(?:(.+?)\s+\()?(?:(.+):(\d+):(\d+)?|([^)]+))\)?/;
678
- return (r) => {
679
- let s = r.match(n);
680
- if (s) {
681
- let o, i, a, c, u;
682
- if (s[1]) {
683
- a = s[1];
684
- let m = a.lastIndexOf(".");
685
- if (a[m - 1] === "." && m--, m > 0) {
686
- o = a.slice(0, m), i = a.slice(m + 1);
687
- let d = o.indexOf(".Module");
688
- d > 0 && (a = a.slice(d + 1), o = o.slice(0, d));
689
- }
690
- c = void 0;
691
- }
692
- i && (c = o, u = i), i === "<anonymous>" && (u = void 0, a = void 0), a === void 0 && (u = u || Re, a = c ? `${c}.${u}` : u);
693
- let f = s[2] && s[2].startsWith("file://") ? s[2].slice(7) : s[2], l = s[5] === "native";
694
- return f && f.match(/\/[A-Z]:/) && (f = f.slice(1)), !f && s[5] && !l && (f = s[5]), { filename: f, module: t ? t(f) : void 0, function: a, lineno: parseInt(s[3], 10) || void 0, colno: parseInt(s[4], 10) || void 0, in_app: sn(f, l) };
695
- }
696
- if (r.match(e)) return { filename: r };
697
- };
909
+ function Yr() {
910
+ try {
911
+ return bn(module, "perf_hooks").performance;
912
+ } catch {
913
+ return;
914
+ }
698
915
  }
699
- function ht(t) {
700
- return [90, on(t)];
916
+ var Et = Tn() ? Yr() : Hr();
917
+ var In = Et === void 0 ? yt : { nowSeconds: () => (Et.timeOrigin + Et.now()) / 1e3 };
918
+ var q = yt.nowSeconds.bind(yt);
919
+ var W = In.nowSeconds.bind(In);
920
+ var ge;
921
+ var jr = (() => {
922
+ let { performance: t } = An;
923
+ if (!t || !t.now) {
924
+ ge = "none";
925
+ return;
926
+ }
927
+ let e = 3600 * 1e3, n = t.now(), r = Date.now(), s = t.timeOrigin ? Math.abs(t.timeOrigin + n - r) : e, i = s < e, o = t.timing && t.timing.navigationStart, c = typeof o == "number" ? Math.abs(o + n - r) : e, u = c < e;
928
+ return i || u ? s <= c ? (ge = "timeOrigin", t.timeOrigin) : (ge = "navigationStart", o) : (ge = "dateNow", r);
929
+ })();
930
+ var qr = new RegExp("^[ \\t]*([0-9a-f]{32})?-?([0-9a-f]{16})?-?([01])?[ \\t]*$");
931
+ function St(t = g(), e = g().substring(16), n) {
932
+ let r = "";
933
+ return n !== void 0 && (r = n ? "-1" : "-0"), `${t}-${e}${r}`;
701
934
  }
702
- function U(t, e = []) {
935
+ function G(t, e = []) {
703
936
  return [t, e];
704
937
  }
705
- function Et(t, e) {
938
+ function bt(t, e) {
706
939
  let [n, r] = t;
707
940
  return [n, [...r, e]];
708
941
  }
709
- function ke(t, e) {
942
+ function Ge(t, e) {
710
943
  let n = t[1];
711
944
  for (let r of n) {
712
945
  let s = r[0].type;
@@ -714,145 +947,174 @@ function ke(t, e) {
714
947
  }
715
948
  return false;
716
949
  }
717
- function _t(t) {
718
- return g.__SENTRY__ && g.__SENTRY__.encodePolyfill ? g.__SENTRY__.encodePolyfill(t) : new TextEncoder().encode(t);
950
+ function Tt(t, e) {
951
+ return (e || new TextEncoder()).encode(t);
719
952
  }
720
- function St(t) {
721
- let [e, n] = t, r = JSON.stringify(e);
722
- function s(o) {
723
- typeof r == "string" ? r = typeof o == "string" ? r + o : [_t(r), o] : r.push(typeof o == "string" ? _t(o) : o);
953
+ function xt(t, e) {
954
+ let [n, r] = t, s = JSON.stringify(n);
955
+ function i(o) {
956
+ typeof s == "string" ? s = typeof o == "string" ? s + o : [Tt(s, e), o] : s.push(typeof o == "string" ? Tt(o, e) : o);
724
957
  }
725
- for (let o of n) {
726
- let [i, a] = o;
727
- if (s(`
728
- ${JSON.stringify(i)}
729
- `), typeof a == "string" || a instanceof Uint8Array) s(a);
958
+ for (let o of r) {
959
+ let [a, c] = o;
960
+ if (i(`
961
+ ${JSON.stringify(a)}
962
+ `), typeof c == "string" || c instanceof Uint8Array) i(c);
730
963
  else {
731
- let c;
964
+ let u;
732
965
  try {
733
- c = JSON.stringify(a);
966
+ u = JSON.stringify(c);
734
967
  } catch {
735
- c = JSON.stringify(O(a));
968
+ u = JSON.stringify(v(c));
736
969
  }
737
- s(c);
970
+ i(u);
738
971
  }
739
972
  }
740
- return typeof r == "string" ? r : xr(r);
973
+ return typeof s == "string" ? s : Wr(s);
741
974
  }
742
- function xr(t) {
743
- let e = t.reduce((s, o) => s + o.length, 0), n = new Uint8Array(e), r = 0;
975
+ function Wr(t) {
976
+ let e = t.reduce((s, i) => s + i.length, 0), n = new Uint8Array(e), r = 0;
744
977
  for (let s of t) n.set(s, r), r += s.length;
745
978
  return n;
746
979
  }
747
- function yt(t) {
748
- let e = typeof t.data == "string" ? _t(t.data) : t.data;
749
- return [S({ type: "attachment", length: e.length, filename: t.filename, content_type: t.contentType, attachment_type: t.attachmentType }), e];
980
+ function Rt(t, e) {
981
+ let n = typeof t.data == "string" ? Tt(t.data, e) : t.data;
982
+ return [E({ type: "attachment", length: n.length, filename: t.filename, content_type: t.contentType, attachment_type: t.attachmentType }), n];
750
983
  }
751
- var Ar = { 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", statsd: "metric_bucket" };
752
- function Le(t) {
753
- return Ar[t];
984
+ var zr = { session: "session", sessions: "session", attachment: "attachment", transaction: "transaction", event: "error", client_report: "internal", user_report: "default", profile: "profile", replay_event: "replay", replay_recording: "replay", check_in: "monitor", statsd: "unknown" };
985
+ function Fe(t) {
986
+ return zr[t];
754
987
  }
755
- function Ue(t) {
988
+ function $e(t) {
756
989
  if (!t || !t.sdk) return;
757
990
  let { name: e, version: n } = t.sdk;
758
991
  return { name: e, version: n };
759
992
  }
760
- function Tt(t, e, n, r) {
993
+ function It(t, e, n, r) {
761
994
  let s = t.sdkProcessingMetadata && t.sdkProcessingMetadata.dynamicSamplingContext;
762
- return { event_id: t.event_id, sent_at: (/* @__PURE__ */ new Date()).toISOString(), ...e && { sdk: e }, ...!!n && r && { dsn: L(r) }, ...s && { trace: S({ ...s }) } };
995
+ return { event_id: t.event_id, sent_at: (/* @__PURE__ */ new Date()).toISOString(), ...e && { sdk: e }, ...!!n && r && { dsn: B(r) }, ...s && { trace: E({ ...s }) } };
763
996
  }
764
- function an(t, e = Date.now()) {
997
+ function Nn(t, e = Date.now()) {
765
998
  let n = parseInt(`${t}`, 10);
766
999
  if (!isNaN(n)) return n * 1e3;
767
1000
  let r = Date.parse(`${t}`);
768
1001
  return isNaN(r) ? 6e4 : r - e;
769
1002
  }
770
- function cn(t, e) {
1003
+ function wn(t, e) {
771
1004
  return t[e] || t.all || 0;
772
1005
  }
773
- function It(t, e, n = Date.now()) {
774
- return cn(t, e) > n;
1006
+ function At(t, e, n = Date.now()) {
1007
+ return wn(t, e) > n;
775
1008
  }
776
- function xt(t, { statusCode: e, headers: n }, r = Date.now()) {
777
- let s = { ...t }, o = n && n["x-sentry-rate-limits"], i = n && n["retry-after"];
778
- if (o) for (let a of o.trim().split(",")) {
779
- let [c, u, , , f] = a.split(":", 5), l = parseInt(c, 10), m = (isNaN(l) ? 60 : l) * 1e3;
780
- if (!u) s.all = r + m;
781
- else for (let d of u.split(";")) d === "metric_bucket" ? (!f || f.split(";").includes("custom")) && (s[d] = r + m) : s[d] = r + m;
1009
+ function Nt(t, { statusCode: e, headers: n }, r = Date.now()) {
1010
+ let s = { ...t }, i = n && n["x-sentry-rate-limits"], o = n && n["retry-after"];
1011
+ if (i) for (let a of i.trim().split(",")) {
1012
+ let [c, u] = a.split(":", 2), l = parseInt(c, 10), d = (isNaN(l) ? 60 : l) * 1e3;
1013
+ if (!u) s.all = r + d;
1014
+ else for (let p of u.split(";")) s[p] = r + d;
782
1015
  }
783
- else i ? s.all = r + an(i, r) : e === 429 && (s.all = r + 60 * 1e3);
1016
+ else o ? s.all = r + Nn(o, r) : e === 429 && (s.all = r + 60 * 1e3);
784
1017
  return s;
785
1018
  }
786
- function At(t, e) {
1019
+ function wt(t, e) {
787
1020
  return t(e.stack || "", 1);
788
1021
  }
789
- function un(t, e) {
790
- let n = { type: e.name || e.constructor.name, value: e.message }, r = At(t, e);
1022
+ function Dn(t, e) {
1023
+ let n = { type: e.name || e.constructor.name, value: e.message }, r = wt(t, e);
791
1024
  return r.length && (n.stacktrace = { frames: r }), n;
792
1025
  }
793
- function br(t) {
794
- for (let e in t) if (Object.prototype.hasOwnProperty.call(t, e)) {
795
- let n = t[e];
796
- if (n instanceof Error) return n;
797
- }
798
- }
799
- function Rr(t) {
1026
+ function Vr(t) {
800
1027
  if ("name" in t && typeof t.name == "string") {
801
- let r = `'${t.name}' captured as exception`;
802
- return "message" in t && typeof t.message == "string" && (r += ` with message '${t.message}'`), r;
803
- } else if ("message" in t && typeof t.message == "string") return t.message;
804
- let e = se(t);
805
- if (Xe(t)) return `Event \`ErrorEvent\` captured as exception with message \`${t.message}\``;
806
- let n = Nr(t);
807
- return `${n && n !== "Object" ? `'${n}'` : "Object"} captured as exception with keys: ${e}`;
808
- }
809
- function Nr(t) {
810
- try {
811
- let e = Object.getPrototypeOf(t);
812
- return e ? e.constructor.name : void 0;
813
- } catch {
1028
+ let e = `'${t.name}' captured as exception`;
1029
+ return "message" in t && typeof t.message == "string" && (e += ` with message '${t.message}'`), e;
1030
+ } else return "message" in t && typeof t.message == "string" ? t.message : `Object captured as exception with keys: ${ue(t)}`;
1031
+ }
1032
+ function Dt(t, e, n, r) {
1033
+ let s = n, o = r && r.data && r.data.mechanism || { handled: true, type: "generic" };
1034
+ if (!H(n)) {
1035
+ if (N(n)) {
1036
+ let c = t(), u = c.getClient(), l = u && u.getOptions().normalizeDepth;
1037
+ c.configureScope((p) => {
1038
+ p.setExtra("__serialized__", Z(n, l));
1039
+ });
1040
+ let d = Vr(n);
1041
+ s = r && r.syntheticException || new Error(d), s.message = d;
1042
+ } else s = r && r.syntheticException || new Error(n), s.message = n;
1043
+ o.synthetic = true;
814
1044
  }
1045
+ let a = { exception: { values: [Dn(e, s)] } };
1046
+ return pe(a, void 0, void 0), me(a, o), { ...a, event_id: r && r.event_id };
815
1047
  }
816
- function Cr(t, e, n, r) {
817
- if (G(n)) return [n, void 0];
818
- if (e.synthetic = true, C(n)) {
819
- let o = t && t.getOptions().normalizeDepth, i = { __serialized__: X(n, o) }, a = br(n);
820
- if (a) return [a, i];
821
- let c = Rr(n), u = r && r.syntheticException || new Error(c);
822
- return u.message = c, [u, i];
1048
+ function Ot(t, e, n = "info", r, s) {
1049
+ let i = { event_id: r && r.event_id, level: n, message: e };
1050
+ if (s && r && r.syntheticException) {
1051
+ let o = wt(t, r.syntheticException);
1052
+ o.length && (i.exception = { values: [{ value: e, stacktrace: { frames: o } }] });
823
1053
  }
824
- let s = r && r.syntheticException || new Error(n);
825
- return s.message = `${n}`, [s, void 0];
826
- }
827
- function bt(t, e, n, r) {
828
- let o = r && r.data && r.data.mechanism || { handled: true, type: "generic" }, [i, a] = Cr(t, o, n, r), c = { exception: { values: [un(e, i)] } };
829
- return a && (c.extra = a), ce(c, void 0, void 0), z(c, o), { ...c, event_id: r && r.event_id };
1054
+ return i;
830
1055
  }
831
- function Rt(t, e, n = "info", r, s) {
832
- let o = { event_id: r && r.event_id, level: n };
833
- if (s && r && r.syntheticException) {
834
- let i = At(t, r.syntheticException);
835
- i.length && (o.exception = { values: [{ value: e, stacktrace: { frames: i } }] });
1056
+ var C = class {
1057
+ static __initStatic() {
1058
+ this.id = "RewriteFrames";
836
1059
  }
837
- if (V(e)) {
838
- let { __sentry_template_string__: i, __sentry_template_values__: a } = e;
839
- return o.logentry = { message: i, params: a }, o;
1060
+ constructor(e = {}) {
1061
+ C.prototype.__init.call(this), this.name = C.id, e.root && (this._root = e.root), this._prefix = e.prefix || "app:///", e.iteratee && (this._iteratee = e.iteratee);
840
1062
  }
841
- return o.message = e, o;
842
- }
843
- function Fe() {
844
- return { traceId: T(), spanId: T().substring(16) };
845
- }
846
- var _ = typeof __SENTRY_DEBUG__ > "u" || __SENTRY_DEBUG__;
847
- function F() {
848
- return fe(g), g;
1063
+ setupOnce(e, n) {
1064
+ }
1065
+ processEvent(e) {
1066
+ return this.process(e);
1067
+ }
1068
+ process(e) {
1069
+ let n = e;
1070
+ return e.exception && Array.isArray(e.exception.values) && (n = this._processExceptionsEvent(n)), n;
1071
+ }
1072
+ __init() {
1073
+ this._iteratee = (e) => {
1074
+ if (!e.filename) return e;
1075
+ let n = /^[a-zA-Z]:\\/.test(e.filename) || e.filename.includes("\\") && !e.filename.includes("/"), r = /^\//.test(e.filename);
1076
+ if (n || r) {
1077
+ let s = n ? e.filename.replace(/^[a-zA-Z]:/, "").replace(/\\/g, "/") : e.filename, i = this._root ? _t(this._root, s) : _e(s);
1078
+ e.filename = `${this._prefix}${i}`;
1079
+ }
1080
+ return e;
1081
+ };
1082
+ }
1083
+ _processExceptionsEvent(e) {
1084
+ try {
1085
+ return { ...e, exception: { ...e.exception, values: e.exception.values.map((n) => ({ ...n, ...n.stacktrace && { stacktrace: this._processStacktrace(n.stacktrace) } })) } };
1086
+ } catch {
1087
+ return e;
1088
+ }
1089
+ }
1090
+ _processStacktrace(e) {
1091
+ return { ...e, frames: e && e.frames && e.frames.map((n) => this._iteratee(n)) };
1092
+ }
1093
+ };
1094
+ C.__initStatic();
1095
+ var Q = "production";
1096
+ function Ee() {
1097
+ return ae("globalEventProcessors", () => []);
1098
+ }
1099
+ function On(t) {
1100
+ Ee().push(t);
1101
+ }
1102
+ function ee(t, e, n, r = 0) {
1103
+ return new S((s, i) => {
1104
+ let o = t[r];
1105
+ if (e === null || typeof o != "function") s(e);
1106
+ else {
1107
+ let a = o({ ...e }, n);
1108
+ (typeof __SENTRY_DEBUG__ > "u" || __SENTRY_DEBUG__) && o.id && a === null && f.log(`Event processor "${o.id}" dropped event`), Y(a) ? a.then((c) => ee(t, c, n, r + 1).then(s)).then(null, i) : ee(t, a, n, r + 1).then(s).then(null, i);
1109
+ }
1110
+ });
849
1111
  }
850
- function fe(t) {
851
- let e = t.__SENTRY__ = t.__SENTRY__ || {};
852
- return e.version = e.version || P, e[P] = e[P] || {};
1112
+ function vn(t) {
1113
+ let e = W(), n = { sid: g(), init: true, timestamp: e, started: e, duration: 0, status: "ok", errors: 0, ignoreDuration: false, toJSON: () => Jr(n) };
1114
+ return t && U(n, t), n;
853
1115
  }
854
- function pe(t, e = {}) {
855
- if (e.user && (!t.ipAddress && e.user.ip_address && (t.ipAddress = e.user.ip_address), !t.did && !e.did && (t.did = e.user.id || e.user.email || e.user.username)), t.timestamp = e.timestamp || ae(), e.abnormal_mechanism && (t.abnormal_mechanism = e.abnormal_mechanism), e.ignoreDuration && (t.ignoreDuration = e.ignoreDuration), e.sid && (t.sid = e.sid.length === 32 ? e.sid : T()), e.init !== void 0 && (t.init = e.init), !t.did && e.did && (t.did = `${e.did}`), typeof e.started == "number" && (t.started = e.started), t.ignoreDuration) t.duration = void 0;
1116
+ function U(t, e = {}) {
1117
+ if (e.user && (!t.ipAddress && e.user.ip_address && (t.ipAddress = e.user.ip_address), !t.did && !e.did && (t.did = e.user.id || e.user.email || e.user.username)), t.timestamp = e.timestamp || W(), e.abnormal_mechanism && (t.abnormal_mechanism = e.abnormal_mechanism), e.ignoreDuration && (t.ignoreDuration = e.ignoreDuration), e.sid && (t.sid = e.sid.length === 32 ? e.sid : g()), e.init !== void 0 && (t.init = e.init), !t.did && e.did && (t.did = `${e.did}`), typeof e.started == "number" && (t.started = e.started), t.ignoreDuration) t.duration = void 0;
856
1118
  else if (typeof e.duration == "number") t.duration = e.duration;
857
1119
  else {
858
1120
  let n = t.timestamp - t.started;
@@ -860,33 +1122,21 @@ function pe(t, e = {}) {
860
1122
  }
861
1123
  e.release && (t.release = e.release), e.environment && (t.environment = e.environment), !t.ipAddress && e.ipAddress && (t.ipAddress = e.ipAddress), !t.userAgent && e.userAgent && (t.userAgent = e.userAgent), typeof e.errors == "number" && (t.errors = e.errors), e.status && (t.status = e.status);
862
1124
  }
863
- var Nt = "_sentrySpan";
864
- function Ct(t, e) {
865
- e ? q(t, Nt, e) : delete t[Nt];
1125
+ function kn(t, e) {
1126
+ let n = {};
1127
+ e ? n = { status: e } : t.status === "ok" && (n = { status: "exited" }), U(t, n);
866
1128
  }
867
- function J(t) {
868
- return t[Nt];
1129
+ function Jr(t) {
1130
+ return E({ sid: `${t.sid}`, init: t.init, started: new Date(t.started * 1e3).toISOString(), timestamp: new Date(t.timestamp * 1e3).toISOString(), status: t.status, errors: t.errors, did: typeof t.did == "number" || typeof t.did == "string" ? `${t.did}` : void 0, duration: t.duration, abnormal_mechanism: t.abnormal_mechanism, attrs: { release: t.release, environment: t.environment, ip_address: t.ipAddress, user_agent: t.userAgent } });
869
1131
  }
870
- var wr = 100;
871
- var de = class {
1132
+ var Kr = 100;
1133
+ var k = class {
872
1134
  constructor() {
873
- this._notifyingListeners = false, this._scopeListeners = [], this._eventProcessors = [], this._breadcrumbs = [], this._attachments = [], this._user = {}, this._tags = {}, this._extra = {}, this._contexts = {}, this._sdkProcessingMetadata = {}, this._propagationContext = Fe();
874
- }
875
- clone() {
876
- let e = new de();
877
- return e._breadcrumbs = [...this._breadcrumbs], e._tags = { ...this._tags }, e._extra = { ...this._extra }, e._contexts = { ...this._contexts }, e._user = this._user, e._level = this._level, e._session = this._session, e._transactionName = this._transactionName, e._fingerprint = this._fingerprint, e._eventProcessors = [...this._eventProcessors], e._requestSession = this._requestSession, e._attachments = [...this._attachments], e._sdkProcessingMetadata = { ...this._sdkProcessingMetadata }, e._propagationContext = { ...this._propagationContext }, e._client = this._client, e._lastEventId = this._lastEventId, Ct(e, J(this)), e;
1135
+ this._notifyingListeners = false, this._scopeListeners = [], this._eventProcessors = [], this._breadcrumbs = [], this._attachments = [], this._user = {}, this._tags = {}, this._extra = {}, this._contexts = {}, this._sdkProcessingMetadata = {}, this._propagationContext = Cn();
878
1136
  }
879
- setClient(e) {
880
- this._client = e;
881
- }
882
- setLastEventId(e) {
883
- this._lastEventId = e;
884
- }
885
- getClient() {
886
- return this._client;
887
- }
888
- lastEventId() {
889
- return this._lastEventId;
1137
+ static clone(e) {
1138
+ let n = new k();
1139
+ return e && (n._breadcrumbs = [...e._breadcrumbs], n._tags = { ...e._tags }, n._extra = { ...e._extra }, n._contexts = { ...e._contexts }, n._user = e._user, n._level = e._level, n._span = e._span, n._session = e._session, n._transactionName = e._transactionName, n._fingerprint = e._fingerprint, n._eventProcessors = [...e._eventProcessors], n._requestSession = e._requestSession, n._attachments = [...e._attachments], n._sdkProcessingMetadata = { ...e._sdkProcessingMetadata }, n._propagationContext = { ...e._propagationContext }), n;
890
1140
  }
891
1141
  addScopeListener(e) {
892
1142
  this._scopeListeners.push(e);
@@ -895,7 +1145,7 @@ var de = class {
895
1145
  return this._eventProcessors.push(e), this;
896
1146
  }
897
1147
  setUser(e) {
898
- return this._user = e || { email: void 0, id: void 0, ip_address: void 0, username: void 0 }, this._session && pe(this._session, { user: e }), this._notifyScopeListeners(), this;
1148
+ return this._user = e || {}, this._session && U(this._session, { user: e }), this._notifyScopeListeners(), this;
899
1149
  }
900
1150
  getUser() {
901
1151
  return this._user;
@@ -930,6 +1180,16 @@ var de = class {
930
1180
  setContext(e, n) {
931
1181
  return n === null ? delete this._contexts[e] : this._contexts[e] = n, this._notifyScopeListeners(), this;
932
1182
  }
1183
+ setSpan(e) {
1184
+ return this._span = e, this._notifyScopeListeners(), this;
1185
+ }
1186
+ getSpan() {
1187
+ return this._span;
1188
+ }
1189
+ getTransaction() {
1190
+ let e = this.getSpan();
1191
+ return e && e.transaction;
1192
+ }
933
1193
  setSession(e) {
934
1194
  return e ? this._session = e : delete this._session, this._notifyScopeListeners(), this;
935
1195
  }
@@ -938,17 +1198,20 @@ var de = class {
938
1198
  }
939
1199
  update(e) {
940
1200
  if (!e) return this;
941
- let n = typeof e == "function" ? e(this) : e, [r, s] = n instanceof R ? [n.getScopeData(), n.getRequestSession()] : C(n) ? [e, e.requestSession] : [], { tags: o, extra: i, user: a, contexts: c, level: u, fingerprint: f = [], propagationContext: l } = r || {};
942
- return this._tags = { ...this._tags, ...o }, this._extra = { ...this._extra, ...i }, this._contexts = { ...this._contexts, ...c }, a && Object.keys(a).length && (this._user = a), u && (this._level = u), f.length && (this._fingerprint = f), l && (this._propagationContext = l), s && (this._requestSession = s), this;
1201
+ if (typeof e == "function") {
1202
+ let n = e(this);
1203
+ return n instanceof k ? n : this;
1204
+ }
1205
+ return e instanceof k ? (this._tags = { ...this._tags, ...e._tags }, this._extra = { ...this._extra, ...e._extra }, this._contexts = { ...this._contexts, ...e._contexts }, e._user && Object.keys(e._user).length && (this._user = e._user), e._level && (this._level = e._level), e._fingerprint && (this._fingerprint = e._fingerprint), e._requestSession && (this._requestSession = e._requestSession), e._propagationContext && (this._propagationContext = e._propagationContext)) : N(e) && (e = e, this._tags = { ...this._tags, ...e.tags }, this._extra = { ...this._extra, ...e.extra }, this._contexts = { ...this._contexts, ...e.contexts }, e.user && (this._user = e.user), e.level && (this._level = e.level), e.fingerprint && (this._fingerprint = e.fingerprint), e.requestSession && (this._requestSession = e.requestSession), e.propagationContext && (this._propagationContext = e.propagationContext)), this;
943
1206
  }
944
1207
  clear() {
945
- return this._breadcrumbs = [], this._tags = {}, this._extra = {}, this._user = {}, this._contexts = {}, this._level = void 0, this._transactionName = void 0, this._fingerprint = void 0, this._requestSession = void 0, this._session = void 0, Ct(this, void 0), this._attachments = [], this._propagationContext = Fe(), this._notifyScopeListeners(), this;
1208
+ return this._breadcrumbs = [], this._tags = {}, this._extra = {}, this._user = {}, this._contexts = {}, this._level = void 0, this._transactionName = void 0, this._fingerprint = void 0, this._requestSession = void 0, this._span = void 0, this._session = void 0, this._notifyScopeListeners(), this._attachments = [], this._propagationContext = Cn(), this;
946
1209
  }
947
1210
  addBreadcrumb(e, n) {
948
- let r = typeof n == "number" ? n : wr;
1211
+ let r = typeof n == "number" ? n : Kr;
949
1212
  if (r <= 0) return this;
950
- let s = { timestamp: Z(), ...e }, o = this._breadcrumbs;
951
- return o.push(s), this._breadcrumbs = o.length > r ? o.slice(-r) : o, this._notifyScopeListeners(), this;
1213
+ let s = { timestamp: q(), ...e }, i = this._breadcrumbs;
1214
+ return i.push(s), this._breadcrumbs = i.length > r ? i.slice(-r) : i, this._notifyScopeListeners(), this;
952
1215
  }
953
1216
  getLastBreadcrumb() {
954
1217
  return this._breadcrumbs[this._breadcrumbs.length - 1];
@@ -959,11 +1222,25 @@ var de = class {
959
1222
  addAttachment(e) {
960
1223
  return this._attachments.push(e), this;
961
1224
  }
1225
+ getAttachments() {
1226
+ return this._attachments;
1227
+ }
962
1228
  clearAttachments() {
963
1229
  return this._attachments = [], this;
964
1230
  }
965
- getScopeData() {
966
- return { breadcrumbs: this._breadcrumbs, attachments: this._attachments, contexts: this._contexts, tags: this._tags, extra: this._extra, user: this._user, level: this._level, fingerprint: this._fingerprint || [], eventProcessors: this._eventProcessors, propagationContext: this._propagationContext, sdkProcessingMetadata: this._sdkProcessingMetadata, transactionName: this._transactionName, span: J(this) };
1231
+ applyToEvent(e, n = {}, r) {
1232
+ if (this._extra && Object.keys(this._extra).length && (e.extra = { ...this._extra, ...e.extra }), this._tags && Object.keys(this._tags).length && (e.tags = { ...this._tags, ...e.tags }), this._user && Object.keys(this._user).length && (e.user = { ...this._user, ...e.user }), this._contexts && Object.keys(this._contexts).length && (e.contexts = { ...this._contexts, ...e.contexts }), this._level && (e.level = this._level), this._transactionName && (e.transaction = this._transactionName), this._span) {
1233
+ e.contexts = { trace: this._span.getTraceContext(), ...e.contexts };
1234
+ let o = this._span.transaction;
1235
+ if (o) {
1236
+ e.sdkProcessingMetadata = { dynamicSamplingContext: o.getDynamicSamplingContext(), ...e.sdkProcessingMetadata };
1237
+ let a = o.name;
1238
+ a && (e.tags = { transaction: a, ...e.tags });
1239
+ }
1240
+ }
1241
+ this._applyFingerprint(e);
1242
+ let s = this._getBreadcrumbs(), i = [...e.breadcrumbs || [], ...s];
1243
+ return e.breadcrumbs = i.length > 0 ? i : void 0, e.sdkProcessingMetadata = { ...e.sdkProcessingMetadata, ...this._sdkProcessingMetadata, propagationContext: this._propagationContext }, ee([...r || [], ...Ee(), ...this._eventProcessors], e, n);
967
1244
  }
968
1245
  setSDKProcessingMetadata(e) {
969
1246
  return this._sdkProcessingMetadata = { ...this._sdkProcessingMetadata, ...e }, this;
@@ -974,52 +1251,48 @@ var de = class {
974
1251
  getPropagationContext() {
975
1252
  return this._propagationContext;
976
1253
  }
977
- captureException(e, n) {
978
- let r = n && n.event_id ? n.event_id : T();
979
- if (!this._client) return p.warn("No client configured on scope - will not capture exception!"), r;
980
- let s = new Error("Sentry syntheticException");
981
- return this._client.captureException(e, { originalException: e, syntheticException: s, ...n, event_id: r }, this), r;
982
- }
983
- captureMessage(e, n, r) {
984
- let s = r && r.event_id ? r.event_id : T();
985
- if (!this._client) return p.warn("No client configured on scope - will not capture message!"), s;
986
- let o = new Error(e);
987
- return this._client.captureMessage(e, n, { originalException: e, syntheticException: o, ...r, event_id: s }, this), s;
988
- }
989
- captureEvent(e, n) {
990
- let r = n && n.event_id ? n.event_id : T();
991
- return this._client ? (this._client.captureEvent(e, { ...n, event_id: r }, this), r) : (p.warn("No client configured on scope - will not capture event!"), r);
1254
+ _getBreadcrumbs() {
1255
+ return this._breadcrumbs;
992
1256
  }
993
1257
  _notifyScopeListeners() {
994
1258
  this._notifyingListeners || (this._notifyingListeners = true, this._scopeListeners.forEach((e) => {
995
1259
  e(this);
996
1260
  }), this._notifyingListeners = false);
997
1261
  }
1262
+ _applyFingerprint(e) {
1263
+ e.fingerprint = e.fingerprint ? he(e.fingerprint) : [], this._fingerprint && (e.fingerprint = e.fingerprint.concat(this._fingerprint)), e.fingerprint && !e.fingerprint.length && delete e.fingerprint;
1264
+ }
998
1265
  };
999
- var R = de;
1000
- function ln() {
1001
- return K("defaultCurrentScope", () => new R());
1002
- }
1003
- function fn() {
1004
- return K("defaultIsolationScope", () => new R());
1266
+ function Cn() {
1267
+ return { traceId: g(), spanId: g().substring(16) };
1005
1268
  }
1006
- var Ot = class {
1007
- constructor(e, n) {
1008
- let r;
1009
- e ? r = e : r = new R();
1010
- let s;
1011
- n ? s = n : s = new R(), this._stack = [{ scope: r }], this._isolationScope = s;
1269
+ var Pn = 4;
1270
+ var Xr = 100;
1271
+ var z = class {
1272
+ constructor(e, n = new k(), r = Pn) {
1273
+ this._version = r, this._stack = [{ scope: n }], e && this.bindClient(e);
1274
+ }
1275
+ isOlderThan(e) {
1276
+ return this._version < e;
1277
+ }
1278
+ bindClient(e) {
1279
+ let n = this.getStackTop();
1280
+ n.client = e, e && e.setupIntegrations && e.setupIntegrations();
1281
+ }
1282
+ pushScope() {
1283
+ let e = k.clone(this.getScope());
1284
+ return this.getStack().push({ client: this.getClient(), scope: e }), e;
1285
+ }
1286
+ popScope() {
1287
+ return this.getStack().length <= 1 ? false : !!this.getStack().pop();
1012
1288
  }
1013
1289
  withScope(e) {
1014
- let n = this._pushScope(), r;
1290
+ let n = this.pushScope();
1015
1291
  try {
1016
- r = e(n);
1017
- } catch (s) {
1018
- throw this._popScope(), s;
1292
+ e(n);
1293
+ } finally {
1294
+ this.popScope();
1019
1295
  }
1020
- return w(r) ? r.then((s) => (this._popScope(), s), (s) => {
1021
- throw this._popScope(), s;
1022
- }) : (this._popScope(), r);
1023
1296
  }
1024
1297
  getClient() {
1025
1298
  return this.getStackTop().client;
@@ -1027,304 +1300,367 @@ var Ot = class {
1027
1300
  getScope() {
1028
1301
  return this.getStackTop().scope;
1029
1302
  }
1030
- getIsolationScope() {
1031
- return this._isolationScope;
1032
- }
1033
1303
  getStack() {
1034
1304
  return this._stack;
1035
1305
  }
1036
1306
  getStackTop() {
1037
1307
  return this._stack[this._stack.length - 1];
1038
1308
  }
1039
- _pushScope() {
1040
- let e = this.getScope().clone();
1041
- return this.getStack().push({ client: this.getClient(), scope: e }), e;
1309
+ captureException(e, n) {
1310
+ let r = this._lastEventId = n && n.event_id ? n.event_id : g(), s = new Error("Sentry syntheticException");
1311
+ return this._withClient((i, o) => {
1312
+ i.captureException(e, { originalException: e, syntheticException: s, ...n, event_id: r }, o);
1313
+ }), r;
1042
1314
  }
1043
- _popScope() {
1044
- return this.getStack().length <= 1 ? false : !!this.getStack().pop();
1315
+ captureMessage(e, n, r) {
1316
+ let s = this._lastEventId = r && r.event_id ? r.event_id : g(), i = new Error(e);
1317
+ return this._withClient((o, a) => {
1318
+ o.captureMessage(e, n, { originalException: e, syntheticException: i, ...r, event_id: s }, a);
1319
+ }), s;
1320
+ }
1321
+ captureEvent(e, n) {
1322
+ let r = n && n.event_id ? n.event_id : g();
1323
+ return e.type || (this._lastEventId = r), this._withClient((s, i) => {
1324
+ s.captureEvent(e, { ...n, event_id: r }, i);
1325
+ }), r;
1326
+ }
1327
+ lastEventId() {
1328
+ return this._lastEventId;
1329
+ }
1330
+ addBreadcrumb(e, n) {
1331
+ let { scope: r, client: s } = this.getStackTop();
1332
+ if (!s) return;
1333
+ let { beforeBreadcrumb: i = null, maxBreadcrumbs: o = Xr } = s.getOptions && s.getOptions() || {};
1334
+ if (o <= 0) return;
1335
+ let c = { timestamp: q(), ...e }, u = i ? Ne(() => i(c, n)) : c;
1336
+ u !== null && (s.emit && s.emit("beforeAddBreadcrumb", u, n), r.addBreadcrumb(u, o));
1337
+ }
1338
+ setUser(e) {
1339
+ this.getScope().setUser(e);
1340
+ }
1341
+ setTags(e) {
1342
+ this.getScope().setTags(e);
1343
+ }
1344
+ setExtras(e) {
1345
+ this.getScope().setExtras(e);
1346
+ }
1347
+ setTag(e, n) {
1348
+ this.getScope().setTag(e, n);
1349
+ }
1350
+ setExtra(e, n) {
1351
+ this.getScope().setExtra(e, n);
1352
+ }
1353
+ setContext(e, n) {
1354
+ this.getScope().setContext(e, n);
1355
+ }
1356
+ configureScope(e) {
1357
+ let { scope: n, client: r } = this.getStackTop();
1358
+ r && e(n);
1359
+ }
1360
+ run(e) {
1361
+ let n = vt(this);
1362
+ try {
1363
+ e(this);
1364
+ } finally {
1365
+ vt(n);
1366
+ }
1367
+ }
1368
+ getIntegration(e) {
1369
+ let n = this.getClient();
1370
+ if (!n) return null;
1371
+ try {
1372
+ return n.getIntegration(e);
1373
+ } catch {
1374
+ return (typeof __SENTRY_DEBUG__ > "u" || __SENTRY_DEBUG__) && f.warn(`Cannot retrieve integration ${e.id} from the current Hub`), null;
1375
+ }
1376
+ }
1377
+ startTransaction(e, n) {
1378
+ let r = this._callExtensionMethod("startTransaction", e, n);
1379
+ if ((typeof __SENTRY_DEBUG__ > "u" || __SENTRY_DEBUG__) && !r) {
1380
+ let s = this.getClient();
1381
+ console.warn(s ? `Tracing extension 'startTransaction' has not been added. Call 'addTracingExtensions' before calling 'init':
1382
+ Sentry.addTracingExtensions();
1383
+ Sentry.init({...});
1384
+ ` : "Tracing extension 'startTransaction' is missing. You should 'init' the SDK before calling 'startTransaction'");
1385
+ }
1386
+ return r;
1387
+ }
1388
+ traceHeaders() {
1389
+ return this._callExtensionMethod("traceHeaders");
1390
+ }
1391
+ captureSession(e = false) {
1392
+ if (e) return this.endSession();
1393
+ this._sendSessionUpdate();
1394
+ }
1395
+ endSession() {
1396
+ let n = this.getStackTop().scope, r = n.getSession();
1397
+ r && kn(r), this._sendSessionUpdate(), n.setSession();
1398
+ }
1399
+ startSession(e) {
1400
+ let { scope: n, client: r } = this.getStackTop(), { release: s, environment: i = Q } = r && r.getOptions() || {}, { userAgent: o } = h.navigator || {}, a = vn({ release: s, environment: i, user: n.getUser(), ...o && { userAgent: o }, ...e }), c = n.getSession && n.getSession();
1401
+ return c && c.status === "ok" && U(c, { status: "exited" }), this.endSession(), n.setSession(a), a;
1402
+ }
1403
+ shouldSendDefaultPii() {
1404
+ let e = this.getClient(), n = e && e.getOptions();
1405
+ return !!(n && n.sendDefaultPii);
1406
+ }
1407
+ _sendSessionUpdate() {
1408
+ let { scope: e, client: n } = this.getStackTop(), r = e.getSession();
1409
+ r && n && n.captureSession && n.captureSession(r);
1410
+ }
1411
+ _withClient(e) {
1412
+ let { scope: n, client: r } = this.getStackTop();
1413
+ r && e(r, n);
1414
+ }
1415
+ _callExtensionMethod(e, ...n) {
1416
+ let s = V().__SENTRY__;
1417
+ if (s && s.extensions && typeof s.extensions[e] == "function") return s.extensions[e].apply(this, n);
1418
+ (typeof __SENTRY_DEBUG__ > "u" || __SENTRY_DEBUG__) && f.warn(`Extension method ${e} couldn't be found, doing nothing.`);
1045
1419
  }
1046
1420
  };
1047
- function Q() {
1048
- let t = F(), e = fe(t);
1049
- return e.stack = e.stack || new Ot(ln(), fn());
1421
+ function V() {
1422
+ return h.__SENTRY__ = h.__SENTRY__ || { extensions: {}, hub: void 0 }, h;
1050
1423
  }
1051
- function vr(t) {
1052
- return Q().withScope(t);
1424
+ function vt(t) {
1425
+ let e = V(), n = He(e);
1426
+ return kt(e, t), n;
1053
1427
  }
1054
- function Dr(t, e) {
1055
- let n = Q();
1056
- return n.withScope(() => (n.getStackTop().scope = t, e(t)));
1057
- }
1058
- function pn(t) {
1059
- return Q().withScope(() => t(Q().getIsolationScope()));
1060
- }
1061
- function dn() {
1062
- return { withIsolationScope: pn, withScope: vr, withSetScope: Dr, withSetIsolationScope: (t, e) => pn(e), getCurrentScope: () => Q().getScope(), getIsolationScope: () => Q().getIsolationScope() };
1063
- }
1064
- function me(t) {
1065
- let e = fe(t);
1066
- return e.acs ? e.acs : dn();
1067
- }
1068
- function wt() {
1069
- let t = F();
1070
- return me(t).getCurrentScope();
1428
+ function x() {
1429
+ let t = V();
1430
+ if (t.__SENTRY__ && t.__SENTRY__.acs) {
1431
+ let e = t.__SENTRY__.acs.getCurrentHub();
1432
+ if (e) return e;
1433
+ }
1434
+ return Zr(t);
1071
1435
  }
1072
- function W() {
1073
- let t = F();
1074
- return me(t).getIsolationScope();
1436
+ function Zr(t = V()) {
1437
+ return (!Qr(t) || He(t).isOlderThan(Pn)) && kt(t, new z()), He(t);
1075
1438
  }
1076
- function mn() {
1077
- return K("globalScope", () => new R());
1439
+ function Qr(t) {
1440
+ return !!(t && t.__SENTRY__ && t.__SENTRY__.hub);
1078
1441
  }
1079
- function gn() {
1080
- return wt().getClient();
1442
+ function He(t) {
1443
+ return ae("hub", () => new z(), t);
1081
1444
  }
1082
- var Mr = "_sentryMetrics";
1083
- function hn(t) {
1084
- let e = t[Mr];
1085
- if (!e) return;
1086
- let n = {};
1087
- for (let [, [r, s]] of e) n[r] || (n[r] = []), n[r].push(S(s));
1088
- return n;
1445
+ function kt(t, e) {
1446
+ if (!t) return false;
1447
+ let n = t.__SENTRY__ = t.__SENTRY__ || {};
1448
+ return n.hub = e, true;
1089
1449
  }
1090
- var _n = "sentry.source";
1091
- var En = "sentry.sample_rate";
1092
- var Sn = "sentry.op";
1093
- var yn = "sentry.origin";
1094
- var Pr = 1;
1095
- function Be(t) {
1096
- let { spanId: e, traceId: n } = t.spanContext(), { parent_span_id: r } = ee(t);
1097
- return S({ parent_span_id: r, span_id: e, trace_id: n });
1450
+ function Mn(t) {
1451
+ return (t || x()).getScope().getTransaction();
1098
1452
  }
1099
- function Tn(t) {
1100
- return typeof t == "number" ? In(t) : Array.isArray(t) ? t[0] + t[1] / 1e9 : t instanceof Date ? In(t.getTime()) : ae();
1453
+ var Un = false;
1454
+ function Ln() {
1455
+ Un || (Un = true, Ue("error", Ct), Ue("unhandledrejection", Ct));
1101
1456
  }
1102
- function In(t) {
1103
- return t > 9999999999 ? t / 1e3 : t;
1457
+ function Ct() {
1458
+ let t = Mn();
1459
+ if (t) {
1460
+ let e = "internal_error";
1461
+ (typeof __SENTRY_DEBUG__ > "u" || __SENTRY_DEBUG__) && f.log(`[Tracing] Transaction: ${e} -> Global error occured`), t.setStatus(e);
1462
+ }
1104
1463
  }
1105
- function ee(t) {
1106
- if (Lr(t)) return t.getSpanJSON();
1107
- try {
1108
- let { spanId: e, traceId: n } = t.spanContext();
1109
- if (kr(t)) {
1110
- let { attributes: r, startTime: s, name: o, endTime: i, parentSpanId: a, status: c } = t;
1111
- return S({ span_id: e, trace_id: n, data: r, description: o, parent_span_id: a, start_timestamp: Tn(s), timestamp: Tn(i) || void 0, status: Ur(c), op: r[Sn], origin: r[yn], _metrics_summary: hn(t) });
1464
+ Ct.tag = "sentry_tracingErrorCallback";
1465
+ var Ye = class {
1466
+ constructor(e = 1e3) {
1467
+ this._maxlen = e, this.spans = [];
1468
+ }
1469
+ add(e) {
1470
+ this.spans.length > this._maxlen ? e.spanRecorder = void 0 : this.spans.push(e);
1471
+ }
1472
+ };
1473
+ var te = class {
1474
+ constructor(e = {}) {
1475
+ this.traceId = e.traceId || g(), this.spanId = e.spanId || g().substring(16), this.startTimestamp = e.startTimestamp || W(), this.tags = e.tags || {}, this.data = e.data || {}, this.instrumenter = e.instrumenter || "sentry", this.origin = e.origin || "manual", e.parentSpanId && (this.parentSpanId = e.parentSpanId), "sampled" in e && (this.sampled = e.sampled), e.op && (this.op = e.op), e.description && (this.description = e.description), e.name && (this.description = e.name), e.status && (this.status = e.status), e.endTimestamp && (this.endTimestamp = e.endTimestamp);
1476
+ }
1477
+ get name() {
1478
+ return this.description || "";
1479
+ }
1480
+ set name(e) {
1481
+ this.setName(e);
1482
+ }
1483
+ startChild(e) {
1484
+ let n = new te({ ...e, parentSpanId: this.spanId, sampled: this.sampled, traceId: this.traceId });
1485
+ if (n.spanRecorder = this.spanRecorder, n.spanRecorder && n.spanRecorder.add(n), n.transaction = this.transaction, (typeof __SENTRY_DEBUG__ > "u" || __SENTRY_DEBUG__) && n.transaction) {
1486
+ let r = e && e.op || "< unknown op >", s = n.transaction.name || "< unknown name >", i = n.transaction.spanId, o = `[Tracing] Starting '${r}' span on transaction '${s}' (${i}).`;
1487
+ n.transaction.metadata.spanMetadata[n.spanId] = { logMessage: o }, f.log(o);
1112
1488
  }
1113
- return { span_id: e, trace_id: n };
1114
- } catch {
1115
- return {};
1489
+ return n;
1116
1490
  }
1117
- }
1118
- function kr(t) {
1119
- let e = t;
1120
- return !!e.attributes && !!e.startTime && !!e.name && !!e.endTime && !!e.status;
1121
- }
1122
- function Lr(t) {
1123
- return typeof t.getSpanJSON == "function";
1124
- }
1125
- function xn(t) {
1126
- let { traceFlags: e } = t.spanContext();
1127
- return e === Pr;
1128
- }
1129
- function Ur(t) {
1130
- if (!(!t || t.code === 0)) return t.code === 1 ? "ok" : t.message || "unknown_error";
1131
- }
1132
- var Fr = "_sentryRootSpan";
1133
- function B(t) {
1134
- return t[Fr] || t;
1135
- }
1136
- function An() {
1137
- let t = F(), e = me(t);
1138
- return e.getActiveSpan ? e.getActiveSpan() : J(wt());
1139
- }
1140
- var bn = false;
1141
- function Rn() {
1142
- bn || (bn = true, lt(vt), ft(vt));
1143
- }
1144
- function vt() {
1145
- let t = An(), e = t && B(t);
1146
- if (e) {
1147
- let n = "internal_error";
1148
- _ && p.log(`[Tracing] Root span: ${n} -> Global error occured`), e.setStatus({ code: 2, message: n });
1491
+ setTag(e, n) {
1492
+ return this.tags = { ...this.tags, [e]: n }, this;
1149
1493
  }
1150
- }
1151
- vt.tag = "sentry_tracingErrorCallback";
1152
- var $e = "production";
1153
- var Br = "_frozenDsc";
1154
- function ge(t, e) {
1155
- let n = e.getOptions(), { publicKey: r } = e.getDsn() || {}, s = S({ environment: n.environment || $e, release: n.release, public_key: r, trace_id: t });
1156
- return e.emit("createDsc", s), s;
1157
- }
1158
- function He(t) {
1159
- let e = gn();
1160
- if (!e) return {};
1161
- let n = ge(ee(t).trace_id || "", e), r = B(t);
1162
- if (!r) return n;
1163
- let s = r[Br];
1164
- if (s) return s;
1165
- let o = ee(r), i = o.data || {}, a = i[En];
1166
- a != null && (n.sample_rate = `${a}`);
1167
- let c = i[_n];
1168
- return c && c !== "url" && (n.transaction = o.description), n.sampled = String(xn(r)), e.emit("createDsc", n), n;
1169
- }
1170
- function Nn(t) {
1171
- if (typeof t == "boolean") return Number(t);
1172
- let e = typeof t == "string" ? parseFloat(t) : t;
1173
- if (typeof e != "number" || isNaN(e) || e < 0 || e > 1) {
1174
- _ && p.warn(`[Tracing] Given sample rate is invalid. Sample rate must be a boolean or a number between 0 and 1. Got ${JSON.stringify(t)} of type ${JSON.stringify(typeof t)}.`);
1175
- return;
1494
+ setData(e, n) {
1495
+ return this.data = { ...this.data, [e]: n }, this;
1176
1496
  }
1177
- return e;
1178
- }
1179
- function $r(t, e) {
1180
- return e && (t.sdk = t.sdk || {}, t.sdk.name = t.sdk.name || e.name, t.sdk.version = t.sdk.version || e.version, t.sdk.integrations = [...t.sdk.integrations || [], ...e.integrations || []], t.sdk.packages = [...t.sdk.packages || [], ...e.packages || []]), t;
1181
- }
1182
- function Cn(t, e, n, r) {
1183
- let s = Ue(n), o = { sent_at: (/* @__PURE__ */ new Date()).toISOString(), ...s && { sdk: s }, ...!!r && e && { dsn: L(e) } }, i = "aggregates" in t ? [{ type: "sessions" }, t] : [{ type: "session" }, t.toJSON()];
1184
- return U(o, [i]);
1185
- }
1186
- function On(t, e, n, r) {
1187
- let s = Ue(n), o = t.type && t.type !== "replay_event" ? t.type : "event";
1188
- $r(t, n && n.sdk);
1189
- let i = Tt(t, s, r, e);
1190
- return delete t.sdkProcessingMetadata, U(i, [[{ type: o }, t]]);
1191
- }
1192
- function je(t, e, n, r = 0) {
1193
- return new I((s, o) => {
1194
- let i = t[r];
1195
- if (e === null || typeof i != "function") s(e);
1196
- else {
1197
- let a = i({ ...e }, n);
1198
- _ && i.id && a === null && p.log(`Event processor "${i.id}" dropped event`), w(a) ? a.then((c) => je(t, c, n, r + 1).then(s)).then(null, o) : je(t, a, n, r + 1).then(s).then(null, o);
1497
+ setStatus(e) {
1498
+ return this.status = e, this;
1499
+ }
1500
+ setHttpStatus(e) {
1501
+ this.setTag("http.status_code", String(e)), this.setData("http.response.status_code", e);
1502
+ let n = es(e);
1503
+ return n !== "unknown_error" && this.setStatus(n), this;
1504
+ }
1505
+ setName(e) {
1506
+ this.description = e;
1507
+ }
1508
+ isSuccess() {
1509
+ return this.status === "ok";
1510
+ }
1511
+ finish(e) {
1512
+ if ((typeof __SENTRY_DEBUG__ > "u" || __SENTRY_DEBUG__) && this.transaction && this.transaction.spanId !== this.spanId) {
1513
+ let { logMessage: n } = this.transaction.metadata.spanMetadata[this.spanId];
1514
+ n && f.log(n.replace("Starting", "Finishing"));
1199
1515
  }
1200
- });
1201
- }
1202
- function wn(t, e) {
1203
- let { fingerprint: n, span: r, breadcrumbs: s, sdkProcessingMetadata: o } = e;
1204
- Hr(t, e), r && qr(t, r), zr(t, n), jr(t, s), Gr(t, o);
1205
- }
1206
- function Dt(t, e) {
1207
- let { extra: n, tags: r, user: s, contexts: o, level: i, sdkProcessingMetadata: a, breadcrumbs: c, fingerprint: u, eventProcessors: f, attachments: l, propagationContext: m, transactionName: d, span: h } = e;
1208
- he(t, "extra", n), he(t, "tags", r), he(t, "user", s), he(t, "contexts", o), he(t, "sdkProcessingMetadata", a), i && (t.level = i), d && (t.transactionName = d), h && (t.span = h), c.length && (t.breadcrumbs = [...t.breadcrumbs, ...c]), u.length && (t.fingerprint = [...t.fingerprint, ...u]), f.length && (t.eventProcessors = [...t.eventProcessors, ...f]), l.length && (t.attachments = [...t.attachments, ...l]), t.propagationContext = { ...t.propagationContext, ...m };
1209
- }
1210
- function he(t, e, n) {
1211
- if (n && Object.keys(n).length) {
1212
- t[e] = { ...t[e] };
1213
- for (let r in n) Object.prototype.hasOwnProperty.call(n, r) && (t[e][r] = n[r]);
1516
+ this.endTimestamp = typeof e == "number" ? e : W();
1214
1517
  }
1518
+ toTraceparent() {
1519
+ return St(this.traceId, this.spanId, this.sampled);
1520
+ }
1521
+ toContext() {
1522
+ return E({ 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 });
1523
+ }
1524
+ updateWithContext(e) {
1525
+ return this.data = e.data || {}, this.description = e.description, this.endTimestamp = e.endTimestamp, this.op = e.op, this.parentSpanId = e.parentSpanId, this.sampled = e.sampled, this.spanId = e.spanId || this.spanId, this.startTimestamp = e.startTimestamp || this.startTimestamp, this.status = e.status, this.tags = e.tags || {}, this.traceId = e.traceId || this.traceId, this;
1526
+ }
1527
+ getTraceContext() {
1528
+ return E({ 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 });
1529
+ }
1530
+ toJSON() {
1531
+ return E({ 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, origin: this.origin });
1532
+ }
1533
+ };
1534
+ function es(t) {
1535
+ if (t < 400 && t >= 100) return "ok";
1536
+ if (t >= 400 && t < 500) switch (t) {
1537
+ case 401:
1538
+ return "unauthenticated";
1539
+ case 403:
1540
+ return "permission_denied";
1541
+ case 404:
1542
+ return "not_found";
1543
+ case 409:
1544
+ return "already_exists";
1545
+ case 413:
1546
+ return "failed_precondition";
1547
+ case 429:
1548
+ return "resource_exhausted";
1549
+ default:
1550
+ return "invalid_argument";
1551
+ }
1552
+ if (t >= 500 && t < 600) switch (t) {
1553
+ case 501:
1554
+ return "unimplemented";
1555
+ case 503:
1556
+ return "unavailable";
1557
+ case 504:
1558
+ return "deadline_exceeded";
1559
+ default:
1560
+ return "internal_error";
1561
+ }
1562
+ return "unknown_error";
1215
1563
  }
1216
- function Hr(t, e) {
1217
- let { extra: n, tags: r, user: s, contexts: o, level: i, transactionName: a } = e, c = S(n);
1218
- c && Object.keys(c).length && (t.extra = { ...c, ...t.extra });
1219
- let u = S(r);
1220
- u && Object.keys(u).length && (t.tags = { ...u, ...t.tags });
1221
- let f = S(s);
1222
- f && Object.keys(f).length && (t.user = { ...f, ...t.user });
1223
- let l = S(o);
1224
- l && Object.keys(l).length && (t.contexts = { ...l, ...t.contexts }), i && (t.level = i), a && t.type !== "transaction" && (t.transaction = a);
1225
- }
1226
- function jr(t, e) {
1227
- let n = [...t.breadcrumbs || [], ...e];
1228
- t.breadcrumbs = n.length ? n : void 0;
1229
- }
1230
- function Gr(t, e) {
1231
- t.sdkProcessingMetadata = { ...t.sdkProcessingMetadata, ...e };
1232
- }
1233
- function qr(t, e) {
1234
- t.contexts = { trace: Be(e), ...t.contexts }, t.sdkProcessingMetadata = { dynamicSamplingContext: He(e), ...t.sdkProcessingMetadata };
1235
- let n = B(e), r = ee(n).description;
1236
- r && !t.transaction && t.type === "transaction" && (t.transaction = r);
1237
- }
1238
- function zr(t, e) {
1239
- t.fingerprint = t.fingerprint ? ue(t.fingerprint) : [], e && (t.fingerprint = t.fingerprint.concat(e)), t.fingerprint && !t.fingerprint.length && delete t.fingerprint;
1240
- }
1241
- function Dn(t, e, n, r, s, o) {
1242
- let { normalizeDepth: i = 3, normalizeMaxBreadth: a = 1e3 } = t, c = { ...e, event_id: e.event_id || n.event_id || T(), timestamp: e.timestamp || Z() }, u = n.integrations || t.integrations.map((y) => y.name);
1243
- Yr(c, t), Vr(c, u), e.type === void 0 && Jr(c, t.stackParser);
1244
- let f = Zr(r, n.captureContext);
1245
- n.mechanism && z(c, n.mechanism);
1246
- let l = s ? s.getEventProcessors() : [], m = mn().getScopeData();
1247
- if (o) {
1248
- let y = o.getScopeData();
1249
- Dt(m, y);
1250
- }
1251
- if (f) {
1252
- let y = f.getScopeData();
1253
- Dt(m, y);
1254
- }
1255
- let d = [...n.attachments || [], ...m.attachments];
1256
- d.length && (n.attachments = d), wn(c, m);
1257
- let h = [...l, ...m.eventProcessors];
1258
- return je(h, c, n).then((y) => (y && Wr(y), typeof i == "number" && i > 0 ? Kr(y, i, a) : y));
1259
- }
1260
- function Yr(t, e) {
1261
- let { environment: n, release: r, dist: s, maxValueLength: o = 250 } = e;
1262
- "environment" in t || (t.environment = "environment" in e ? n : $e), t.release === void 0 && r !== void 0 && (t.release = r), t.dist === void 0 && s !== void 0 && (t.dist = s), t.message && (t.message = M(t.message, o));
1263
- let i = t.exception && t.exception.values && t.exception.values[0];
1264
- i && i.value && (i.value = M(i.value, o));
1265
- let a = t.request;
1266
- a && a.url && (a.url = M(a.url, o));
1564
+ function ne(t, e, n) {
1565
+ let r = e.getOptions(), { publicKey: s } = e.getDsn() || {}, { segment: i } = n && n.getUser() || {}, o = E({ environment: r.environment || Q, release: r.release, user_segment: i, public_key: s, trace_id: t });
1566
+ return e.emit && e.emit("createDsc", o), o;
1267
1567
  }
1268
- var vn = /* @__PURE__ */ new WeakMap();
1269
- function Jr(t, e) {
1270
- let n = g._sentryDebugIds;
1271
- if (!n) return;
1272
- let r, s = vn.get(e);
1273
- s ? r = s : (r = /* @__PURE__ */ new Map(), vn.set(e, r));
1274
- let o = Object.keys(n).reduce((i, a) => {
1275
- let c, u = r.get(a);
1276
- u ? c = u : (c = e(a), r.set(a, c));
1277
- for (let f = c.length - 1; f >= 0; f--) {
1278
- let l = c[f];
1279
- if (l.filename) {
1280
- i[l.filename] = n[a];
1281
- break;
1282
- }
1568
+ var je = class extends te {
1569
+ constructor(e, n) {
1570
+ super(e), delete this.description, this._measurements = {}, this._contexts = {}, this._hub = n || x(), this._name = e.name || "", this.metadata = { source: "custom", ...e.metadata, spanMetadata: {} }, this._trimEnd = e.trimEnd, this.transaction = this;
1571
+ let r = this.metadata.dynamicSamplingContext;
1572
+ r && (this._frozenDynamicSamplingContext = { ...r });
1573
+ }
1574
+ get name() {
1575
+ return this._name;
1576
+ }
1577
+ set name(e) {
1578
+ this.setName(e);
1579
+ }
1580
+ setName(e, n = "custom") {
1581
+ this._name = e, this.metadata.source = n;
1582
+ }
1583
+ initSpanRecorder(e = 1e3) {
1584
+ this.spanRecorder || (this.spanRecorder = new Ye(e)), this.spanRecorder.add(this);
1585
+ }
1586
+ setContext(e, n) {
1587
+ n === null ? delete this._contexts[e] : this._contexts[e] = n;
1588
+ }
1589
+ setMeasurement(e, n, r = "") {
1590
+ this._measurements[e] = { value: n, unit: r };
1591
+ }
1592
+ setMetadata(e) {
1593
+ this.metadata = { ...this.metadata, ...e };
1594
+ }
1595
+ finish(e) {
1596
+ let n = this._finishTransaction(e);
1597
+ if (n) return this._hub.captureEvent(n);
1598
+ }
1599
+ toContext() {
1600
+ let e = super.toContext();
1601
+ return E({ ...e, name: this.name, trimEnd: this._trimEnd });
1602
+ }
1603
+ updateWithContext(e) {
1604
+ return super.updateWithContext(e), this.name = e.name || "", this._trimEnd = e.trimEnd, this;
1605
+ }
1606
+ getDynamicSamplingContext() {
1607
+ if (this._frozenDynamicSamplingContext) return this._frozenDynamicSamplingContext;
1608
+ let e = this._hub || x(), n = e.getClient();
1609
+ if (!n) return {};
1610
+ let r = e.getScope(), s = ne(this.traceId, n, r), i = this.metadata.sampleRate;
1611
+ i !== void 0 && (s.sample_rate = `${i}`);
1612
+ let o = this.metadata.source;
1613
+ return o && o !== "url" && (s.transaction = this.name), this.sampled !== void 0 && (s.sampled = String(this.sampled)), s;
1614
+ }
1615
+ setHub(e) {
1616
+ this._hub = e;
1617
+ }
1618
+ _finishTransaction(e) {
1619
+ if (this.endTimestamp !== void 0) return;
1620
+ this.name || ((typeof __SENTRY_DEBUG__ > "u" || __SENTRY_DEBUG__) && f.warn("Transaction has no name, falling back to `<unlabeled transaction>`."), this.name = "<unlabeled transaction>"), super.finish(e);
1621
+ let n = this._hub.getClient();
1622
+ if (n && n.emit && n.emit("finishTransaction", this), this.sampled !== true) {
1623
+ (typeof __SENTRY_DEBUG__ > "u" || __SENTRY_DEBUG__) && f.log("[Tracing] Discarding transaction because its trace was not chosen to be sampled."), n && n.recordDroppedEvent("sample_rate", "transaction");
1624
+ return;
1283
1625
  }
1284
- return i;
1285
- }, {});
1286
- try {
1287
- t.exception.values.forEach((i) => {
1288
- i.stacktrace.frames.forEach((a) => {
1289
- a.filename && (a.debug_id = o[a.filename]);
1290
- });
1291
- });
1292
- } catch {
1626
+ let r = this.spanRecorder ? this.spanRecorder.spans.filter((a) => a !== this && a.endTimestamp) : [];
1627
+ this._trimEnd && r.length > 0 && (this.endTimestamp = r.reduce((a, c) => a.endTimestamp && c.endTimestamp ? a.endTimestamp > c.endTimestamp ? a : c : a).endTimestamp);
1628
+ let s = this.metadata, i = { contexts: { ...this._contexts, trace: this.getTraceContext() }, spans: r, start_timestamp: this.startTimestamp, tags: this.tags, timestamp: this.endTimestamp, transaction: this.name, type: "transaction", sdkProcessingMetadata: { ...s, dynamicSamplingContext: this.getDynamicSamplingContext() }, ...s.source && { transaction_info: { source: s.source } } };
1629
+ return Object.keys(this._measurements).length > 0 && ((typeof __SENTRY_DEBUG__ > "u" || __SENTRY_DEBUG__) && f.log("[Measurements] Adding measurements to transaction", JSON.stringify(this._measurements, void 0, 2)), i.measurements = this._measurements), (typeof __SENTRY_DEBUG__ > "u" || __SENTRY_DEBUG__) && f.log(`[Tracing] Finishing ${this.op} transaction: ${this.name}.`), i;
1293
1630
  }
1631
+ };
1632
+ function Bn(t) {
1633
+ if (typeof __SENTRY_TRACING__ == "boolean" && !__SENTRY_TRACING__) return false;
1634
+ let e = x().getClient(), n = t || e && e.getOptions();
1635
+ return !!n && (n.enableTracing || "tracesSampleRate" in n || "tracesSampler" in n);
1636
+ }
1637
+ function Gn(t, e, n) {
1638
+ if (!Bn(e)) return t.sampled = false, t;
1639
+ if (t.sampled !== void 0) return t.setMetadata({ sampleRate: Number(t.sampled) }), t;
1640
+ let r;
1641
+ return typeof e.tracesSampler == "function" ? (r = e.tracesSampler(n), t.setMetadata({ sampleRate: Number(r) })) : n.parentSampled !== void 0 ? r = n.parentSampled : typeof e.tracesSampleRate < "u" ? (r = e.tracesSampleRate, t.setMetadata({ sampleRate: Number(r) })) : (r = 1, t.setMetadata({ sampleRate: r })), ts(r) ? r ? (t.sampled = Math.random() < r, t.sampled ? ((typeof __SENTRY_DEBUG__ > "u" || __SENTRY_DEBUG__) && f.log(`[Tracing] starting ${t.op} transaction - ${t.name}`), t) : ((typeof __SENTRY_DEBUG__ > "u" || __SENTRY_DEBUG__) && f.log(`[Tracing] Discarding transaction because it's not included in the random sample (sampling rate = ${Number(r)})`), t)) : ((typeof __SENTRY_DEBUG__ > "u" || __SENTRY_DEBUG__) && f.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"}`), t.sampled = false, t) : ((typeof __SENTRY_DEBUG__ > "u" || __SENTRY_DEBUG__) && f.warn("[Tracing] Discarding transaction because of invalid sample rate."), t.sampled = false, t);
1294
1642
  }
1295
- function Wr(t) {
1296
- let e = {};
1297
- try {
1298
- t.exception.values.forEach((r) => {
1299
- r.stacktrace.frames.forEach((s) => {
1300
- s.debug_id && (s.abs_path ? e[s.abs_path] = s.debug_id : s.filename && (e[s.filename] = s.debug_id), delete s.debug_id);
1301
- });
1302
- });
1303
- } catch {
1304
- }
1305
- if (Object.keys(e).length === 0) return;
1306
- t.debug_meta = t.debug_meta || {}, t.debug_meta.images = t.debug_meta.images || [];
1307
- let n = t.debug_meta.images;
1308
- Object.keys(e).forEach((r) => {
1309
- n.push({ type: "sourcemap", code_file: r, debug_id: e[r] });
1310
- });
1643
+ function ts(t) {
1644
+ return oe(t) || !(typeof t == "number" || typeof t == "boolean") ? ((typeof __SENTRY_DEBUG__ > "u" || __SENTRY_DEBUG__) && f.warn(`[Tracing] Given sample rate is invalid. Sample rate must be a boolean or a number between 0 and 1. Got ${JSON.stringify(t)} of type ${JSON.stringify(typeof t)}.`), false) : t < 0 || t > 1 ? ((typeof __SENTRY_DEBUG__ > "u" || __SENTRY_DEBUG__) && f.warn(`[Tracing] Given sample rate is invalid. Sample rate must be between 0 and 1. Got ${t}.`), false) : true;
1311
1645
  }
1312
- function Vr(t, e) {
1313
- e.length > 0 && (t.sdk = t.sdk || {}, t.sdk.integrations = [...t.sdk.integrations || [], ...e]);
1646
+ function ns() {
1647
+ let e = this.getScope().getSpan();
1648
+ return e ? { "sentry-trace": e.toTraceparent() } : {};
1314
1649
  }
1315
- function Kr(t, e, n) {
1316
- if (!t) return null;
1317
- let r = { ...t, ...t.breadcrumbs && { breadcrumbs: t.breadcrumbs.map((s) => ({ ...s, ...s.data && { data: O(s.data, e, n) } })) }, ...t.user && { user: O(t.user, e, n) }, ...t.contexts && { contexts: O(t.contexts, e, n) }, ...t.extra && { extra: O(t.extra, e, n) } };
1318
- return t.contexts && t.contexts.trace && r.contexts && (r.contexts.trace = t.contexts.trace, t.contexts.trace.data && (r.contexts.trace.data = O(t.contexts.trace.data, e, n))), t.spans && (r.spans = t.spans.map((s) => ({ ...s, ...s.data && { data: O(s.data, e, n) } }))), r;
1650
+ function rs(t, e) {
1651
+ let n = this.getClient(), r = n && n.getOptions() || {}, s = r.instrumenter || "sentry", i = t.instrumenter || "sentry";
1652
+ s !== i && ((typeof __SENTRY_DEBUG__ > "u" || __SENTRY_DEBUG__) && f.error(`A transaction was started with instrumenter=\`${i}\`, but the SDK is configured with the \`${s}\` instrumenter.
1653
+ The transaction will not be sampled. Please use the ${s} instrumentation to start transactions.`), t.sampled = false);
1654
+ let o = new je(t, this);
1655
+ return o = Gn(o, r, { parentSampled: t.parentSampled, transactionContext: t, ...e }), o.sampled && o.initSpanRecorder(r._experiments && r._experiments.maxSpans), n && n.emit && n.emit("startTransaction", o), o;
1319
1656
  }
1320
- function Zr(t, e) {
1321
- if (!e) return t;
1322
- let n = t ? t.clone() : new R();
1323
- return n.update(e), n;
1657
+ function Fn() {
1658
+ let t = V();
1659
+ t.__SENTRY__ && (t.__SENTRY__.extensions = t.__SENTRY__.extensions || {}, t.__SENTRY__.extensions.startTransaction || (t.__SENTRY__.extensions.startTransaction = rs), t.__SENTRY__.extensions.traceHeaders || (t.__SENTRY__.extensions.traceHeaders = ns), Ln());
1324
1660
  }
1325
- var Ge = class {
1661
+ var qe = class {
1326
1662
  constructor(e, n) {
1327
- this._client = e, this.flushTimeout = 60, this._pendingAggregates = {}, this._isEnabled = true, this._intervalId = setInterval(() => this.flush(), this.flushTimeout * 1e3), this._intervalId.unref && this._intervalId.unref(), this._sessionAttrs = n;
1663
+ this._client = e, this.flushTimeout = 60, this._pendingAggregates = {}, this._isEnabled = true, this._intervalId = setInterval(() => this.flush(), this.flushTimeout * 1e3), this._sessionAttrs = n;
1328
1664
  }
1329
1665
  flush() {
1330
1666
  let e = this.getSessionAggregates();
@@ -1332,14 +1668,14 @@ var Ge = class {
1332
1668
  }
1333
1669
  getSessionAggregates() {
1334
1670
  let e = Object.keys(this._pendingAggregates).map((r) => this._pendingAggregates[parseInt(r)]), n = { attrs: this._sessionAttrs, aggregates: e };
1335
- return S(n);
1671
+ return E(n);
1336
1672
  }
1337
1673
  close() {
1338
1674
  clearInterval(this._intervalId), this._isEnabled = false, this.flush();
1339
1675
  }
1340
1676
  incrementSessionStatusCount() {
1341
1677
  if (!this._isEnabled) return;
1342
- let e = W(), n = e.getRequestSession();
1678
+ let e = x().getScope(), n = e.getRequestSession();
1343
1679
  n && n.status && (this._incrementSessionStatusCount(n.status, /* @__PURE__ */ new Date()), e.setRequestSession(void 0));
1344
1680
  }
1345
1681
  _incrementSessionStatusCount(e, n) {
@@ -1356,96 +1692,188 @@ var Ge = class {
1356
1692
  }
1357
1693
  }
1358
1694
  };
1359
- var Xr = "7";
1360
- function Qr(t) {
1695
+ var ss = "7";
1696
+ function is(t) {
1361
1697
  let e = t.protocol ? `${t.protocol}:` : "", n = t.port ? `:${t.port}` : "";
1362
1698
  return `${e}//${t.host}${n}${t.path ? `/${t.path}` : ""}/api/`;
1363
1699
  }
1364
- function es(t) {
1365
- return `${Qr(t)}${t.projectId}/envelope/`;
1700
+ function os(t) {
1701
+ return `${is(t)}${t.projectId}/envelope/`;
1702
+ }
1703
+ function as(t, e) {
1704
+ return ut({ sentry_key: t.publicKey, sentry_version: ss, ...e && { sentry_client: `${e.name}/${e.version}` } });
1705
+ }
1706
+ function $n(t, e = {}) {
1707
+ let n = typeof e == "string" ? e : e.tunnel, r = typeof e == "string" || !e._metadata ? void 0 : e._metadata.sdk;
1708
+ return n || `${os(t)}?${as(t, r)}`;
1709
+ }
1710
+ function cs(t, e) {
1711
+ return e && (t.sdk = t.sdk || {}, t.sdk.name = t.sdk.name || e.name, t.sdk.version = t.sdk.version || e.version, t.sdk.integrations = [...t.sdk.integrations || [], ...e.integrations || []], t.sdk.packages = [...t.sdk.packages || [], ...e.packages || []]), t;
1366
1712
  }
1367
- function ts(t, e) {
1368
- return at({ sentry_key: t.publicKey, sentry_version: Xr, ...e && { sentry_client: `${e.name}/${e.version}` } });
1713
+ function Hn(t, e, n, r) {
1714
+ let s = $e(n), i = { sent_at: (/* @__PURE__ */ new Date()).toISOString(), ...s && { sdk: s }, ...!!r && e && { dsn: B(e) } }, o = "aggregates" in t ? [{ type: "sessions" }, t] : [{ type: "session" }, t.toJSON()];
1715
+ return G(i, [o]);
1369
1716
  }
1370
- function Mn(t, e, n) {
1371
- return e || `${es(t)}?${ts(t, n)}`;
1717
+ function Yn(t, e, n, r) {
1718
+ let s = $e(n), i = t.type && t.type !== "replay_event" ? t.type : "event";
1719
+ cs(t, n && n.sdk);
1720
+ let o = It(t, s, r, e);
1721
+ return delete t.sdkProcessingMetadata, G(o, [[{ type: i }, t]]);
1372
1722
  }
1373
- var Pn = [];
1374
- function ns(t) {
1723
+ var jn = [];
1724
+ function us(t) {
1375
1725
  let e = {};
1376
1726
  return t.forEach((n) => {
1377
1727
  let { name: r } = n, s = e[r];
1378
1728
  s && !s.isDefaultInstance && n.isDefaultInstance || (e[r] = n);
1379
1729
  }), Object.keys(e).map((n) => e[n]);
1380
1730
  }
1381
- function Mt(t) {
1731
+ function Pt(t) {
1382
1732
  let e = t.defaultIntegrations || [], n = t.integrations;
1383
- e.forEach((i) => {
1384
- i.isDefaultInstance = true;
1733
+ e.forEach((o) => {
1734
+ o.isDefaultInstance = true;
1385
1735
  });
1386
1736
  let r;
1387
- Array.isArray(n) ? r = [...e, ...n] : typeof n == "function" ? r = ue(n(e)) : r = e;
1388
- let s = ns(r), o = rs(s, (i) => i.name === "Debug");
1389
- if (o !== -1) {
1390
- let [i] = s.splice(o, 1);
1391
- s.push(i);
1737
+ Array.isArray(n) ? r = [...e, ...n] : typeof n == "function" ? r = he(n(e)) : r = e;
1738
+ let s = us(r), i = ds(s, (o) => o.name === "Debug");
1739
+ if (i !== -1) {
1740
+ let [o] = s.splice(i, 1);
1741
+ s.push(o);
1392
1742
  }
1393
1743
  return s;
1394
1744
  }
1395
- function kn(t, e) {
1745
+ function qn(t, e) {
1396
1746
  let n = {};
1397
1747
  return e.forEach((r) => {
1398
- r && kt(t, r, n);
1748
+ r && Mt(t, r, n);
1399
1749
  }), n;
1400
1750
  }
1401
- function Pt(t, e) {
1402
- for (let n of e) n && n.afterAllSetup && n.afterAllSetup(t);
1403
- }
1404
- function kt(t, e, n) {
1405
- if (n[e.name]) {
1406
- _ && p.log(`Integration skipped because it was already installed: ${e.name}`);
1407
- return;
1408
- }
1409
- if (n[e.name] = e, Pn.indexOf(e.name) === -1 && typeof e.setupOnce == "function" && (e.setupOnce(), Pn.push(e.name)), e.setup && typeof e.setup == "function" && e.setup(t), typeof e.preprocessEvent == "function") {
1751
+ function Mt(t, e, n) {
1752
+ if (n[e.name] = e, jn.indexOf(e.name) === -1 && (e.setupOnce(On, x), jn.push(e.name)), t.on && typeof e.preprocessEvent == "function") {
1410
1753
  let r = e.preprocessEvent.bind(e);
1411
- t.on("preprocessEvent", (s, o) => r(s, o, t));
1754
+ t.on("preprocessEvent", (s, i) => r(s, i, t));
1412
1755
  }
1413
- if (typeof e.processEvent == "function") {
1414
- let r = e.processEvent.bind(e), s = Object.assign((o, i) => r(o, i, t), { id: e.name });
1756
+ if (t.addEventProcessor && typeof e.processEvent == "function") {
1757
+ let r = e.processEvent.bind(e), s = Object.assign((i, o) => r(i, o, t), { id: e.name });
1415
1758
  t.addEventProcessor(s);
1416
1759
  }
1417
- _ && p.log(`Integration installed: ${e.name}`);
1760
+ (typeof __SENTRY_DEBUG__ > "u" || __SENTRY_DEBUG__) && f.log(`Integration installed: ${e.name}`);
1418
1761
  }
1419
- function rs(t, e) {
1762
+ function ds(t, e) {
1420
1763
  for (let n = 0; n < t.length; n++) if (e(t[n]) === true) return n;
1421
1764
  return -1;
1422
1765
  }
1423
- var Ln = "Not capturing exception because it's already been captured.";
1424
- var qe = class {
1766
+ function zn(t, e, n, r, s) {
1767
+ let { normalizeDepth: i = 3, normalizeMaxBreadth: o = 1e3 } = t, a = { ...e, event_id: e.event_id || n.event_id || g(), timestamp: e.timestamp || q() }, c = n.integrations || t.integrations.map((p) => p.name);
1768
+ ls(a, t), ms(a, c), e.type === void 0 && fs(a, t.stackParser);
1769
+ let u = r;
1770
+ n.captureContext && (u = k.clone(u).update(n.captureContext));
1771
+ let l = b(a), d = s && s.getEventProcessors ? s.getEventProcessors() : [];
1772
+ if (u) {
1773
+ if (u.getAttachments) {
1774
+ let p = [...n.attachments || [], ...u.getAttachments()];
1775
+ p.length && (n.attachments = p);
1776
+ }
1777
+ l = u.applyToEvent(a, n, d);
1778
+ } else l = ee([...d, ...Ee()], a, n);
1779
+ return l.then((p) => (p && ps(p), typeof i == "number" && i > 0 ? hs(p, i, o) : p));
1780
+ }
1781
+ function ls(t, e) {
1782
+ let { environment: n, release: r, dist: s, maxValueLength: i = 250 } = e;
1783
+ "environment" in t || (t.environment = "environment" in e ? n : Q), t.release === void 0 && r !== void 0 && (t.release = r), t.dist === void 0 && s !== void 0 && (t.dist = s), t.message && (t.message = L(t.message, i));
1784
+ let o = t.exception && t.exception.values && t.exception.values[0];
1785
+ o && o.value && (o.value = L(o.value, i));
1786
+ let a = t.request;
1787
+ a && a.url && (a.url = L(a.url, i));
1788
+ }
1789
+ var Wn = /* @__PURE__ */ new WeakMap();
1790
+ function fs(t, e) {
1791
+ let n = h._sentryDebugIds;
1792
+ if (!n) return;
1793
+ let r, s = Wn.get(e);
1794
+ s ? r = s : (r = /* @__PURE__ */ new Map(), Wn.set(e, r));
1795
+ let i = Object.keys(n).reduce((o, a) => {
1796
+ let c, u = r.get(a);
1797
+ u ? c = u : (c = e(a), r.set(a, c));
1798
+ for (let l = c.length - 1; l >= 0; l--) {
1799
+ let d = c[l];
1800
+ if (d.filename) {
1801
+ o[d.filename] = n[a];
1802
+ break;
1803
+ }
1804
+ }
1805
+ return o;
1806
+ }, {});
1807
+ try {
1808
+ t.exception.values.forEach((o) => {
1809
+ o.stacktrace.frames.forEach((a) => {
1810
+ a.filename && (a.debug_id = i[a.filename]);
1811
+ });
1812
+ });
1813
+ } catch {
1814
+ }
1815
+ }
1816
+ function ps(t) {
1817
+ let e = {};
1818
+ try {
1819
+ t.exception.values.forEach((r) => {
1820
+ r.stacktrace.frames.forEach((s) => {
1821
+ s.debug_id && (s.abs_path ? e[s.abs_path] = s.debug_id : s.filename && (e[s.filename] = s.debug_id), delete s.debug_id);
1822
+ });
1823
+ });
1824
+ } catch {
1825
+ }
1826
+ if (Object.keys(e).length === 0) return;
1827
+ t.debug_meta = t.debug_meta || {}, t.debug_meta.images = t.debug_meta.images || [];
1828
+ let n = t.debug_meta.images;
1829
+ Object.keys(e).forEach((r) => {
1830
+ n.push({ type: "sourcemap", code_file: r, debug_id: e[r] });
1831
+ });
1832
+ }
1833
+ function ms(t, e) {
1834
+ e.length > 0 && (t.sdk = t.sdk || {}, t.sdk.integrations = [...t.sdk.integrations || [], ...e]);
1835
+ }
1836
+ function hs(t, e, n) {
1837
+ if (!t) return null;
1838
+ let r = { ...t, ...t.breadcrumbs && { breadcrumbs: t.breadcrumbs.map((s) => ({ ...s, ...s.data && { data: v(s.data, e, n) } })) }, ...t.user && { user: v(t.user, e, n) }, ...t.contexts && { contexts: v(t.contexts, e, n) }, ...t.extra && { extra: v(t.extra, e, n) } };
1839
+ return t.contexts && t.contexts.trace && r.contexts && (r.contexts.trace = t.contexts.trace, t.contexts.trace.data && (r.contexts.trace.data = v(t.contexts.trace.data, e, n))), t.spans && (r.spans = t.spans.map((s) => (s.data && (s.data = v(s.data, e, n)), s))), r;
1840
+ }
1841
+ var Vn = "Not capturing exception because it's already been captured.";
1842
+ var We = class {
1425
1843
  constructor(e) {
1426
- if (this._options = e, this._integrations = {}, this._numProcessing = 0, this._outcomes = {}, this._hooks = {}, this._eventProcessors = [], e.dsn ? this._dsn = Ae(e.dsn) : _ && p.warn("No DSN provided, client will not send events."), this._dsn) {
1427
- let n = Mn(this._dsn, e.tunnel, e._metadata ? e._metadata.sdk : void 0);
1428
- this._transport = e.transport({ tunnel: this._options.tunnel, recordDroppedEvent: this.recordDroppedEvent.bind(this), ...e.transportOptions, url: n });
1844
+ if (this._options = e, this._integrations = {}, this._integrationsInitialized = false, this._numProcessing = 0, this._outcomes = {}, this._hooks = {}, this._eventProcessors = [], e.dsn ? this._dsn = we(e.dsn) : (typeof __SENTRY_DEBUG__ > "u" || __SENTRY_DEBUG__) && f.warn("No DSN provided, client will not send events."), this._dsn) {
1845
+ let n = $n(this._dsn, e);
1846
+ this._transport = e.transport({ recordDroppedEvent: this.recordDroppedEvent.bind(this), ...e.transportOptions, url: n });
1429
1847
  }
1430
1848
  }
1431
1849
  captureException(e, n, r) {
1432
- let s = T();
1433
- if (Pe(e)) return _ && p.log(Ln), s;
1434
- let o = { event_id: s, ...n };
1435
- return this._process(this.eventFromException(e, o).then((i) => this._captureEvent(i, o, r))), o.event_id;
1850
+ if (Le(e)) {
1851
+ (typeof __SENTRY_DEBUG__ > "u" || __SENTRY_DEBUG__) && f.log(Vn);
1852
+ return;
1853
+ }
1854
+ let s = n && n.event_id;
1855
+ return this._process(this.eventFromException(e, n).then((i) => this._captureEvent(i, n, r)).then((i) => {
1856
+ s = i;
1857
+ })), s;
1436
1858
  }
1437
1859
  captureMessage(e, n, r, s) {
1438
- let o = { event_id: T(), ...r }, i = V(e) ? e : String(e), a = Ie(e) ? this.eventFromMessage(i, n, o) : this.eventFromException(e, o);
1439
- return this._process(a.then((c) => this._captureEvent(c, o, s))), o.event_id;
1860
+ let i = r && r.event_id, o = Ie(e) ? this.eventFromMessage(String(e), n, r) : this.eventFromException(e, r);
1861
+ return this._process(o.then((a) => this._captureEvent(a, r, s)).then((a) => {
1862
+ i = a;
1863
+ })), i;
1440
1864
  }
1441
1865
  captureEvent(e, n, r) {
1442
- let s = T();
1443
- if (n && n.originalException && Pe(n.originalException)) return _ && p.log(Ln), s;
1444
- let o = { event_id: s, ...n }, a = (e.sdkProcessingMetadata || {}).capturedSpanScope;
1445
- return this._process(this._captureEvent(e, o, a || r)), o.event_id;
1866
+ if (n && n.originalException && Le(n.originalException)) {
1867
+ (typeof __SENTRY_DEBUG__ > "u" || __SENTRY_DEBUG__) && f.log(Vn);
1868
+ return;
1869
+ }
1870
+ let s = n && n.event_id;
1871
+ return this._process(this._captureEvent(e, n, r).then((i) => {
1872
+ s = i;
1873
+ })), s;
1446
1874
  }
1447
1875
  captureSession(e) {
1448
- typeof e.release != "string" ? _ && p.warn("Discarded session because of missing or non-string release") : (this.sendSession(e), pe(e, { init: false }));
1876
+ typeof e.release != "string" ? (typeof __SENTRY_DEBUG__ > "u" || __SENTRY_DEBUG__) && f.warn("Discarded session because of missing or non-string release") : (this.sendSession(e), U(e, { init: false }));
1449
1877
  }
1450
1878
  getDsn() {
1451
1879
  return this._dsn;
@@ -1461,10 +1889,10 @@ var qe = class {
1461
1889
  }
1462
1890
  flush(e) {
1463
1891
  let n = this._transport;
1464
- return n ? (this.emit("flush"), this._isClientDoneProcessing(e).then((r) => n.flush(e).then((s) => r && s))) : b(true);
1892
+ return n ? this._isClientDoneProcessing(e).then((r) => n.flush(e).then((s) => r && s)) : b(true);
1465
1893
  }
1466
1894
  close(e) {
1467
- return this.flush(e).then((n) => (this.getOptions().enabled = false, this.emit("close"), n));
1895
+ return this.flush(e).then((n) => (this.getOptions().enabled = false, n));
1468
1896
  }
1469
1897
  getEventProcessors() {
1470
1898
  return this._eventProcessors;
@@ -1472,31 +1900,37 @@ var qe = class {
1472
1900
  addEventProcessor(e) {
1473
1901
  this._eventProcessors.push(e);
1474
1902
  }
1475
- init() {
1476
- this._isEnabled() && this._setupIntegrations();
1903
+ setupIntegrations(e) {
1904
+ (e && !this._integrationsInitialized || this._isEnabled() && !this._integrationsInitialized) && (this._integrations = qn(this, this._options.integrations), this._integrationsInitialized = true);
1477
1905
  }
1478
- getIntegrationByName(e) {
1906
+ getIntegrationById(e) {
1479
1907
  return this._integrations[e];
1480
1908
  }
1909
+ getIntegration(e) {
1910
+ try {
1911
+ return this._integrations[e.id] || null;
1912
+ } catch {
1913
+ return (typeof __SENTRY_DEBUG__ > "u" || __SENTRY_DEBUG__) && f.warn(`Cannot retrieve integration ${e.id} from the current Client`), null;
1914
+ }
1915
+ }
1481
1916
  addIntegration(e) {
1482
- let n = this._integrations[e.name];
1483
- kt(this, e, this._integrations), n || Pt(this, [e]);
1917
+ Mt(this, e, this._integrations);
1484
1918
  }
1485
1919
  sendEvent(e, n = {}) {
1486
1920
  this.emit("beforeSendEvent", e, n);
1487
- let r = On(e, this._dsn, this._options._metadata, this._options.tunnel);
1488
- for (let o of n.attachments || []) r = Et(r, yt(o));
1489
- let s = this.sendEnvelope(r);
1490
- s && s.then((o) => this.emit("afterSendEvent", e, o), null);
1921
+ let r = Yn(e, this._dsn, this._options._metadata, this._options.tunnel);
1922
+ for (let i of n.attachments || []) r = bt(r, Rt(i, this._options.transportOptions && this._options.transportOptions.textEncoder));
1923
+ let s = this._sendEnvelope(r);
1924
+ s && s.then((i) => this.emit("afterSendEvent", e, i), null);
1491
1925
  }
1492
1926
  sendSession(e) {
1493
- let n = Cn(e, this._dsn, this._options._metadata, this._options.tunnel);
1494
- this.sendEnvelope(n);
1927
+ let n = Hn(e, this._dsn, this._options._metadata, this._options.tunnel);
1928
+ this._sendEnvelope(n);
1495
1929
  }
1496
1930
  recordDroppedEvent(e, n, r) {
1497
1931
  if (this._options.sendClientReports) {
1498
1932
  let s = `${e}:${n}`;
1499
- _ && p.log(`Adding outcome: "${s}"`), this._outcomes[s] = this._outcomes[s] + 1 || 1;
1933
+ (typeof __SENTRY_DEBUG__ > "u" || __SENTRY_DEBUG__) && f.log(`Adding outcome: "${s}"`), this._outcomes[s] = this._outcomes[s] + 1 || 1;
1500
1934
  }
1501
1935
  }
1502
1936
  on(e, n) {
@@ -1505,18 +1939,11 @@ var qe = class {
1505
1939
  emit(e, ...n) {
1506
1940
  this._hooks[e] && this._hooks[e].forEach((r) => r(...n));
1507
1941
  }
1508
- sendEnvelope(e) {
1509
- return this.emit("beforeEnvelope", e), this._isEnabled() && this._transport ? this._transport.send(e).then(null, (n) => (_ && p.error("Error while sending event:", n), n)) : (_ && p.error("Transport disabled"), b({}));
1510
- }
1511
- _setupIntegrations() {
1512
- let { integrations: e } = this._options;
1513
- this._integrations = kn(this, e), Pt(this, e);
1514
- }
1515
1942
  _updateSessionFromEvent(e, n) {
1516
- let r = false, s = false, o = n.exception && n.exception.values;
1517
- if (o) {
1943
+ let r = false, s = false, i = n.exception && n.exception.values;
1944
+ if (i) {
1518
1945
  s = true;
1519
- for (let c of o) {
1946
+ for (let c of i) {
1520
1947
  let u = c.mechanism;
1521
1948
  if (u && u.handled === false) {
1522
1949
  r = true;
@@ -1524,68 +1951,74 @@ var qe = class {
1524
1951
  }
1525
1952
  }
1526
1953
  }
1527
- let i = e.status === "ok";
1528
- (i && e.errors === 0 || i && r) && (pe(e, { ...r && { status: "crashed" }, errors: e.errors || Number(s || r) }), this.captureSession(e));
1954
+ let o = e.status === "ok";
1955
+ (o && e.errors === 0 || o && r) && (U(e, { ...r && { status: "crashed" }, errors: e.errors || Number(s || r) }), this.captureSession(e));
1529
1956
  }
1530
1957
  _isClientDoneProcessing(e) {
1531
- return new I((n) => {
1532
- let r = 0, s = 1, o = setInterval(() => {
1533
- this._numProcessing == 0 ? (clearInterval(o), n(true)) : (r += s, e && r >= e && (clearInterval(o), n(false)));
1958
+ return new S((n) => {
1959
+ let r = 0, s = 1, i = setInterval(() => {
1960
+ this._numProcessing == 0 ? (clearInterval(i), n(true)) : (r += s, e && r >= e && (clearInterval(i), n(false)));
1534
1961
  }, s);
1535
1962
  });
1536
1963
  }
1537
1964
  _isEnabled() {
1538
1965
  return this.getOptions().enabled !== false && this._transport !== void 0;
1539
1966
  }
1540
- _prepareEvent(e, n, r, s = W()) {
1541
- let o = this.getOptions(), i = Object.keys(this._integrations);
1542
- return !n.integrations && i.length > 0 && (n.integrations = i), this.emit("preprocessEvent", e, n), e.type || s.setLastEventId(e.event_id || n.event_id), Dn(o, e, n, r, this, s).then((a) => {
1543
- if (a === null) return a;
1544
- let c = { ...s.getPropagationContext(), ...r ? r.getPropagationContext() : void 0 };
1545
- if (!(a.contexts && a.contexts.trace) && c) {
1546
- let { traceId: f, spanId: l, parentSpanId: m, dsc: d } = c;
1547
- a.contexts = { trace: S({ trace_id: f, span_id: l, parent_span_id: m }), ...a.contexts };
1548
- let h = d || ge(f, this);
1549
- a.sdkProcessingMetadata = { dynamicSamplingContext: h, ...a.sdkProcessingMetadata };
1967
+ _prepareEvent(e, n, r) {
1968
+ let s = this.getOptions(), i = Object.keys(this._integrations);
1969
+ return !n.integrations && i.length > 0 && (n.integrations = i), this.emit("preprocessEvent", e, n), zn(s, e, n, r, this).then((o) => {
1970
+ if (o === null) return o;
1971
+ let { propagationContext: a } = o.sdkProcessingMetadata || {};
1972
+ if (!(o.contexts && o.contexts.trace) && a) {
1973
+ let { traceId: u, spanId: l, parentSpanId: d, dsc: p } = a;
1974
+ o.contexts = { trace: { trace_id: u, span_id: l, parent_span_id: d }, ...o.contexts };
1975
+ let m = p || ne(u, this, r);
1976
+ o.sdkProcessingMetadata = { dynamicSamplingContext: m, ...o.sdkProcessingMetadata };
1550
1977
  }
1551
- return a;
1978
+ return o;
1552
1979
  });
1553
1980
  }
1554
1981
  _captureEvent(e, n = {}, r) {
1555
1982
  return this._processEvent(e, n, r).then((s) => s.event_id, (s) => {
1556
- if (_) {
1557
- let o = s;
1558
- o.logLevel === "log" ? p.log(o.message) : p.warn(o);
1983
+ if (typeof __SENTRY_DEBUG__ > "u" || __SENTRY_DEBUG__) {
1984
+ let i = s;
1985
+ i.logLevel === "log" ? f.log(i.message) : f.warn(i);
1559
1986
  }
1560
1987
  });
1561
1988
  }
1562
1989
  _processEvent(e, n, r) {
1563
- let s = this.getOptions(), { sampleRate: o } = s, i = Fn(e), a = Un(e), c = e.type || "error", u = `before send for type \`${c}\``, f = typeof o > "u" ? void 0 : Nn(o);
1564
- if (a && typeof f == "number" && Math.random() > f) return this.recordDroppedEvent("sample_rate", "error", e), Y(new x(`Discarding event because it's not included in the random sample (sampling rate = ${o})`, "log"));
1565
- let l = c === "replay_event" ? "replay" : c, d = (e.sdkProcessingMetadata || {}).capturedSpanIsolationScope;
1566
- return this._prepareEvent(e, n, r, d).then((h) => {
1567
- if (h === null) throw this.recordDroppedEvent("event_processor", l, e), new x("An event processor returned `null`, will not send event.", "log");
1568
- if (n.data && n.data.__sentry__ === true) return h;
1569
- let y = os(s, h, n);
1570
- return ss(y, u);
1571
- }).then((h) => {
1572
- if (h === null) throw this.recordDroppedEvent("before_send", l, e), new x(`${u} returned \`null\`, will not send event.`, "log");
1573
- let H = r && r.getSession();
1574
- !i && H && this._updateSessionFromEvent(H, h);
1575
- let y = h.transaction_info;
1576
- if (i && y && h.transaction !== e.transaction) {
1577
- let A = "custom";
1578
- h.transaction_info = { ...y, source: A };
1990
+ let s = this.getOptions(), { sampleRate: i } = s, o = Kn(e), a = Jn(e), c = e.type || "error", u = `before send for type \`${c}\``;
1991
+ if (a && typeof i == "number" && Math.random() > i) return this.recordDroppedEvent("sample_rate", "error", e), j(new T(`Discarding event because it's not included in the random sample (sampling rate = ${i})`, "log"));
1992
+ let l = c === "replay_event" ? "replay" : c;
1993
+ return this._prepareEvent(e, n, r).then((d) => {
1994
+ if (d === null) throw this.recordDroppedEvent("event_processor", l, e), new T("An event processor returned `null`, will not send event.", "log");
1995
+ if (n.data && n.data.__sentry__ === true) return d;
1996
+ let m = gs(s, d, n);
1997
+ return _s(m, u);
1998
+ }).then((d) => {
1999
+ if (d === null) throw this.recordDroppedEvent("before_send", l, e), new T(`${u} returned \`null\`, will not send event.`, "log");
2000
+ let p = r && r.getSession();
2001
+ !o && p && this._updateSessionFromEvent(p, d);
2002
+ let m = d.transaction_info;
2003
+ if (o && m && d.transaction !== e.transaction) {
2004
+ let I = "custom";
2005
+ d.transaction_info = { ...m, source: I };
1579
2006
  }
1580
- return this.sendEvent(h, n), h;
1581
- }).then(null, (h) => {
1582
- throw h instanceof x ? h : (this.captureException(h, { data: { __sentry__: true }, originalException: h }), new x(`Event processing pipeline threw an error, original event will not be sent. Details have been sent as a new event.
1583
- Reason: ${h}`));
2007
+ return this.sendEvent(d, n), d;
2008
+ }).then(null, (d) => {
2009
+ throw d instanceof T ? d : (this.captureException(d, { data: { __sentry__: true }, originalException: d }), new T(`Event processing pipeline threw an error, original event will not be sent. Details have been sent as a new event.
2010
+ Reason: ${d}`));
1584
2011
  });
1585
2012
  }
1586
2013
  _process(e) {
1587
2014
  this._numProcessing++, e.then((n) => (this._numProcessing--, n), (n) => (this._numProcessing--, n));
1588
2015
  }
2016
+ _sendEnvelope(e) {
2017
+ if (this.emit("beforeEnvelope", e), this._isEnabled() && this._transport) return this._transport.send(e).then(null, (n) => {
2018
+ (typeof __SENTRY_DEBUG__ > "u" || __SENTRY_DEBUG__) && f.error("Error while sending event:", n);
2019
+ });
2020
+ (typeof __SENTRY_DEBUG__ > "u" || __SENTRY_DEBUG__) && f.error("Transport disabled");
2021
+ }
1589
2022
  _clearOutcomes() {
1590
2023
  let e = this._outcomes;
1591
2024
  return this._outcomes = {}, Object.keys(e).map((n) => {
@@ -1594,69 +2027,57 @@ Reason: ${h}`));
1594
2027
  });
1595
2028
  }
1596
2029
  };
1597
- function ss(t, e) {
2030
+ function _s(t, e) {
1598
2031
  let n = `${e} must return \`null\` or a valid event.`;
1599
- if (w(t)) return t.then((r) => {
1600
- if (!C(r) && r !== null) throw new x(n);
2032
+ if (Y(t)) return t.then((r) => {
2033
+ if (!N(r) && r !== null) throw new T(n);
1601
2034
  return r;
1602
2035
  }, (r) => {
1603
- throw new x(`${e} rejected with ${r}`);
2036
+ throw new T(`${e} rejected with ${r}`);
1604
2037
  });
1605
- if (!C(t) && t !== null) throw new x(n);
2038
+ if (!N(t) && t !== null) throw new T(n);
1606
2039
  return t;
1607
2040
  }
1608
- function os(t, e, n) {
1609
- let { beforeSend: r, beforeSendTransaction: s, beforeSendSpan: o } = t;
1610
- if (Un(e) && r) return r(e, n);
1611
- if (Fn(e)) {
1612
- if (e.spans && o) {
1613
- let i = [];
1614
- for (let a of e.spans) {
1615
- let c = o(a);
1616
- c && i.push(c);
1617
- }
1618
- e.spans = i;
1619
- }
1620
- if (s) return s(e, n);
1621
- }
1622
- return e;
2041
+ function gs(t, e, n) {
2042
+ let { beforeSend: r, beforeSendTransaction: s } = t;
2043
+ return Jn(e) && r ? r(e, n) : Kn(e) && s ? s(e, n) : e;
1623
2044
  }
1624
- function Un(t) {
2045
+ function Jn(t) {
1625
2046
  return t.type === void 0;
1626
2047
  }
1627
- function Fn(t) {
2048
+ function Kn(t) {
1628
2049
  return t.type === "transaction";
1629
2050
  }
1630
- function Bn(t, e, n, r, s) {
1631
- let o = { sent_at: (/* @__PURE__ */ new Date()).toISOString() };
1632
- n && n.sdk && (o.sdk = { name: n.sdk.name, version: n.sdk.version }), r && s && (o.dsn = L(s)), e && (o.trace = S(e));
1633
- let i = is(t);
1634
- return U(o, [i]);
2051
+ function Xn(t, e, n, r, s) {
2052
+ let i = { sent_at: (/* @__PURE__ */ new Date()).toISOString() };
2053
+ n && n.sdk && (i.sdk = { name: n.sdk.name, version: n.sdk.version }), r && s && (i.dsn = B(s)), e && (i.trace = E(e));
2054
+ let o = Es(t);
2055
+ return G(i, [o]);
1635
2056
  }
1636
- function is(t) {
2057
+ function Es(t) {
1637
2058
  return [{ type: "check_in" }, t];
1638
2059
  }
1639
- var _e = class extends qe {
2060
+ var ye = class extends We {
1640
2061
  constructor(e) {
1641
- Rn(), super(e);
2062
+ Fn(), super(e);
1642
2063
  }
1643
2064
  eventFromException(e, n) {
1644
- return b(bt(this, this._options.stackParser, e, n));
2065
+ return b(Dt(x, this._options.stackParser, e, n));
1645
2066
  }
1646
2067
  eventFromMessage(e, n = "info", r) {
1647
- return b(Rt(this._options.stackParser, e, n, r, this._options.attachStacktrace));
2068
+ return b(Ot(this._options.stackParser, e, n, r, this._options.attachStacktrace));
1648
2069
  }
1649
2070
  captureException(e, n, r) {
1650
- if (this._options.autoSessionTracking && this._sessionFlusher) {
1651
- let s = W().getRequestSession();
2071
+ if (this._options.autoSessionTracking && this._sessionFlusher && r) {
2072
+ let s = r.getRequestSession();
1652
2073
  s && s.status === "ok" && (s.status = "errored");
1653
2074
  }
1654
2075
  return super.captureException(e, n, r);
1655
2076
  }
1656
2077
  captureEvent(e, n, r) {
1657
- if (this._options.autoSessionTracking && this._sessionFlusher && (e.type || "exception") === "exception" && e.exception && e.exception.values && e.exception.values.length > 0) {
1658
- let i = W().getRequestSession();
1659
- i && i.status === "ok" && (i.status = "errored");
2078
+ if (this._options.autoSessionTracking && this._sessionFlusher && r && (e.type || "exception") === "exception" && e.exception && e.exception.values && e.exception.values.length > 0) {
2079
+ let o = r.getRequestSession();
2080
+ o && o.status === "ok" && (o.status = "errored");
1660
2081
  }
1661
2082
  return super.captureEvent(e, n, r);
1662
2083
  }
@@ -1665,199 +2086,188 @@ var _e = class extends qe {
1665
2086
  }
1666
2087
  initSessionFlusher() {
1667
2088
  let { release: e, environment: n } = this._options;
1668
- e ? this._sessionFlusher = new Ge(this, { release: e, environment: n }) : _ && p.warn("Cannot initialise an instance of SessionFlusher if no release is provided!");
2089
+ e ? this._sessionFlusher = new qe(this, { release: e, environment: n }) : (typeof __SENTRY_DEBUG__ > "u" || __SENTRY_DEBUG__) && f.warn("Cannot initialise an instance of SessionFlusher if no release is provided!");
1669
2090
  }
1670
2091
  captureCheckIn(e, n, r) {
1671
- let s = "checkInId" in e && e.checkInId ? e.checkInId : T();
1672
- if (!this._isEnabled()) return _ && p.warn("SDK not enabled, will not capture checkin."), s;
1673
- let o = this.getOptions(), { release: i, environment: a, tunnel: c } = o, u = { check_in_id: s, monitor_slug: e.monitorSlug, status: e.status, release: i, environment: a };
1674
- "duration" in e && (u.duration = e.duration), n && (u.monitor_config = { schedule: n.schedule, checkin_margin: n.checkinMargin, max_runtime: n.maxRuntime, timezone: n.timezone, failure_issue_threshold: n.failureIssueThreshold, recovery_threshold: n.recoveryThreshold });
1675
- let [f, l] = this._getTraceInfoFromScope(r);
1676
- l && (u.contexts = { trace: l });
1677
- let m = Bn(u, f, this.getSdkMetadata(), c, this.getDsn());
1678
- return _ && p.info("Sending checkin:", e.monitorSlug, e.status), this.sendEnvelope(m), s;
2092
+ let s = e.status !== "in_progress" && e.checkInId ? e.checkInId : g();
2093
+ if (!this._isEnabled()) return (typeof __SENTRY_DEBUG__ > "u" || __SENTRY_DEBUG__) && f.warn("SDK not enabled, will not capture checkin."), s;
2094
+ let i = this.getOptions(), { release: o, environment: a, tunnel: c } = i, u = { check_in_id: s, monitor_slug: e.monitorSlug, status: e.status, release: o, environment: a };
2095
+ e.status !== "in_progress" && (u.duration = e.duration), n && (u.monitor_config = { schedule: n.schedule, checkin_margin: n.checkinMargin, max_runtime: n.maxRuntime, timezone: n.timezone });
2096
+ let [l, d] = this._getTraceInfoFromScope(r);
2097
+ d && (u.contexts = { trace: d });
2098
+ let p = Xn(u, l, this.getSdkMetadata(), c, this.getDsn());
2099
+ return (typeof __SENTRY_DEBUG__ > "u" || __SENTRY_DEBUG__) && f.info("Sending checkin:", e.monitorSlug, e.status), this._sendEnvelope(p), s;
1679
2100
  }
1680
2101
  _captureRequestSession() {
1681
- this._sessionFlusher ? this._sessionFlusher.incrementSessionStatusCount() : _ && p.warn("Discarded request mode session because autoSessionTracking option was disabled");
2102
+ this._sessionFlusher ? this._sessionFlusher.incrementSessionStatusCount() : (typeof __SENTRY_DEBUG__ > "u" || __SENTRY_DEBUG__) && f.warn("Discarded request mode session because autoSessionTracking option was disabled");
1682
2103
  }
1683
- _prepareEvent(e, n, r, s) {
1684
- return this._options.platform && (e.platform = e.platform || this._options.platform), this._options.runtime && (e.contexts = { ...e.contexts, runtime: (e.contexts || {}).runtime || this._options.runtime }), this._options.serverName && (e.server_name = e.server_name || this._options.serverName), super._prepareEvent(e, n, r, s);
2104
+ _prepareEvent(e, n, r) {
2105
+ return this._options.platform && (e.platform = e.platform || this._options.platform), this._options.runtime && (e.contexts = { ...e.contexts, runtime: (e.contexts || {}).runtime || this._options.runtime }), this._options.serverName && (e.server_name = e.server_name || this._options.serverName), super._prepareEvent(e, n, r);
1685
2106
  }
1686
2107
  _getTraceInfoFromScope(e) {
1687
2108
  if (!e) return [void 0, void 0];
1688
- let n = J(e);
1689
- if (n) {
1690
- let c = B(n);
1691
- return [He(c), Be(c)];
1692
- }
1693
- let { traceId: r, spanId: s, parentSpanId: o, dsc: i } = e.getPropagationContext(), a = { trace_id: r, span_id: s, parent_span_id: o };
1694
- return i ? [i, a] : [ge(r, this), a];
2109
+ let n = e.getSpan();
2110
+ if (n) return [n.transaction ? n.transaction.getDynamicSamplingContext() : void 0, n.getTraceContext()];
2111
+ let { traceId: r, spanId: s, parentSpanId: i, dsc: o } = e.getPropagationContext(), a = { trace_id: r, span_id: s, parent_span_id: i };
2112
+ return o ? [o, a] : [ne(r, this, e), a];
1695
2113
  }
1696
2114
  };
1697
- var as = 64;
1698
- function Lt(t, e, n = gt(t.bufferSize || as)) {
1699
- let r = {}, s = (i) => n.drain(i);
1700
- function o(i) {
2115
+ var ys = 30;
2116
+ function Ut(t, e, n = gt(t.bufferSize || ys)) {
2117
+ let r = {}, s = (o) => n.drain(o);
2118
+ function i(o) {
1701
2119
  let a = [];
1702
- if (ke(i, (l, m) => {
1703
- let d = Le(m);
1704
- if (It(r, d)) {
1705
- let h = $n(l, m);
1706
- t.recordDroppedEvent("ratelimit_backoff", d, h);
1707
- } else a.push(l);
1708
- }), a.length === 0) return b({});
1709
- let c = U(i[0], a), u = (l) => {
1710
- ke(c, (m, d) => {
1711
- let h = $n(m, d);
1712
- t.recordDroppedEvent(l, Le(d), h);
2120
+ if (Ge(o, (d, p) => {
2121
+ let m = Fe(p);
2122
+ if (At(r, m)) {
2123
+ let I = Zn(d, p);
2124
+ t.recordDroppedEvent("ratelimit_backoff", m, I);
2125
+ } else a.push(d);
2126
+ }), a.length === 0) return b();
2127
+ let c = G(o[0], a), u = (d) => {
2128
+ Ge(c, (p, m) => {
2129
+ let I = Zn(p, m);
2130
+ t.recordDroppedEvent(d, Fe(m), I);
1713
2131
  });
1714
- }, f = () => e({ body: St(c) }).then((l) => (l.statusCode !== void 0 && (l.statusCode < 200 || l.statusCode >= 300) && _ && p.warn(`Sentry responded with status code ${l.statusCode} to sent event.`), r = xt(r, l), l), (l) => {
1715
- throw u("network_error"), l;
2132
+ }, l = () => e({ body: xt(c, t.textEncoder) }).then((d) => (d.statusCode !== void 0 && (d.statusCode < 200 || d.statusCode >= 300) && (typeof __SENTRY_DEBUG__ > "u" || __SENTRY_DEBUG__) && f.warn(`Sentry responded with status code ${d.statusCode} to sent event.`), r = Nt(r, d), d), (d) => {
2133
+ throw u("network_error"), d;
1716
2134
  });
1717
- return n.add(f).then((l) => l, (l) => {
1718
- if (l instanceof x) return _ && p.error("Skipped sending event because buffer is full."), u("queue_overflow"), b({});
1719
- throw l;
2135
+ return n.add(l).then((d) => d, (d) => {
2136
+ if (d instanceof T) return (typeof __SENTRY_DEBUG__ > "u" || __SENTRY_DEBUG__) && f.error("Skipped sending event because buffer is full."), u("queue_overflow"), b();
2137
+ throw d;
1720
2138
  });
1721
2139
  }
1722
- return { send: o, flush: s };
2140
+ return i.__sentry__baseTransport__ = true, { send: i, flush: s };
1723
2141
  }
1724
- function $n(t, e) {
2142
+ function Zn(t, e) {
1725
2143
  if (!(e !== "event" && e !== "transaction")) return Array.isArray(t) ? t[1] : void 0;
1726
2144
  }
1727
- var cs = "RewriteFrames";
1728
- var ze = (t = {}) => {
1729
- let e = t.root, n = t.prefix || "app:///", r = "window" in g && g.window !== void 0, s = t.iteratee || us({ isBrowser: r, root: e, prefix: n });
1730
- function o(a) {
1731
- try {
1732
- return { ...a, exception: { ...a.exception, values: a.exception.values.map((c) => ({ ...c, ...c.stacktrace && { stacktrace: i(c.stacktrace) } })) } };
1733
- } catch {
1734
- return a;
1735
- }
1736
- }
1737
- function i(a) {
1738
- return { ...a, frames: a && a.frames && a.frames.map((c) => s(c)) };
1739
- }
1740
- return { name: cs, processEvent(a) {
1741
- let c = a;
1742
- return a.exception && Array.isArray(a.exception.values) && (c = o(c)), c;
1743
- } };
1744
- };
1745
- function us({ isBrowser: t, root: e, prefix: n }) {
1746
- return (r) => {
1747
- if (!r.filename) return r;
1748
- let s = /^[a-zA-Z]:\\/.test(r.filename) || r.filename.includes("\\") && !r.filename.includes("/"), o = /^\//.test(r.filename);
1749
- if (t) {
1750
- if (e) {
1751
- let i = r.filename;
1752
- i.indexOf(e) === 0 && (r.filename = i.replace(e, n));
1753
- }
1754
- } else if (s || o) {
1755
- let i = s ? r.filename.replace(/^[a-zA-Z]:/, "").replace(/\\/g, "/") : r.filename, a = e ? mt(e, i) : le(i);
1756
- r.filename = `${n}${a}`;
1757
- }
1758
- return r;
1759
- };
1760
- }
1761
- function jn(t) {
2145
+ function er(t) {
1762
2146
  return typeof t == "object" && t !== null;
1763
2147
  }
1764
- function fs(t) {
1765
- return jn(t) && "handled" in t && typeof t.handled == "boolean" && "type" in t && typeof t.type == "string";
2148
+ function Ss(t) {
2149
+ return er(t) && "handled" in t && typeof t.handled == "boolean" && "type" in t && typeof t.type == "string";
1766
2150
  }
1767
- function ps(t) {
1768
- return jn(t) && "mechanism" in t && fs(t.mechanism);
2151
+ function Ts(t) {
2152
+ return er(t) && "mechanism" in t && Ss(t.mechanism);
1769
2153
  }
1770
- function ds() {
1771
- if (g.SENTRY_RELEASE && g.SENTRY_RELEASE.id) return g.SENTRY_RELEASE.id;
2154
+ function bs() {
2155
+ if (h.SENTRY_RELEASE && h.SENTRY_RELEASE.id) return h.SENTRY_RELEASE.id;
1772
2156
  }
1773
- function Hn(t, e) {
2157
+ function Qn(t, e) {
1774
2158
  return t !== void 0 ? (t[e[0]] = e[1], t) : { [e[0]]: e[1] };
1775
2159
  }
1776
- function Gn(t, e) {
2160
+ function tr(t, e) {
1777
2161
  return t(e.stack || "", 1);
1778
2162
  }
1779
- function ms(t) {
2163
+ function xs(t) {
1780
2164
  let e = t && t.message;
1781
2165
  return e ? e.error && typeof e.error.message == "string" ? e.error.message : e : "No error message";
1782
2166
  }
1783
- function qn(t, e) {
1784
- let n = { type: e.name || e.constructor.name, value: ms(e) }, r = Gn(t, e);
2167
+ function nr(t, e) {
2168
+ let n = { type: e.name || e.constructor.name, value: xs(e) }, r = tr(t, e);
1785
2169
  return r.length && (n.stacktrace = { frames: r }), n.type === void 0 && n.value === "" && (n.value = "Unrecoverable error caught"), n;
1786
2170
  }
1787
- function gs(t, e, n, r) {
1788
- let s, i = (r && r.data && ps(r.data) ? r.data.mechanism : void 0) ?? { handled: true, type: "generic" };
1789
- if (G(n)) s = n;
2171
+ function Rs(t, e, n, r) {
2172
+ let s, o = (r && r.data && Ts(r.data) ? r.data.mechanism : void 0) ?? { handled: true, type: "generic" };
2173
+ if (H(n)) s = n;
1790
2174
  else {
1791
- if (C(n)) {
1792
- let c = `Non-Error exception captured with keys: ${se(n)}`, u = t?.getClient(), f = u && u.getOptions().normalizeDepth;
1793
- t?.setExtra("__serialized__", X(n, f)), s = r && r.syntheticException || new Error(c), s.message = c;
2175
+ if (N(n)) {
2176
+ let c = `Non-Error exception captured with keys: ${ue(n)}`, u = t?.getClient(), l = u && u.getOptions().normalizeDepth;
2177
+ t?.configureScope((d) => {
2178
+ d.setExtra("__serialized__", Z(n, l));
2179
+ }), s = r && r.syntheticException || new Error(c), s.message = c;
1794
2180
  } else s = r && r.syntheticException || new Error(n), s.message = n;
1795
- i.synthetic = true;
2181
+ o.synthetic = true;
1796
2182
  }
1797
- let a = { exception: { values: [qn(e, s)] } };
1798
- return ce(a, void 0, void 0), z(a, i), { ...a, event_id: r && r.event_id };
2183
+ let a = { exception: { values: [nr(e, s)] } };
2184
+ return pe(a, void 0, void 0), me(a, o), { ...a, event_id: r && r.event_id };
1799
2185
  }
1800
- function hs(t, e, n = "info", r, s) {
1801
- let o = { event_id: r && r.event_id, level: n, message: e };
2186
+ function Is(t, e, n = "info", r, s) {
2187
+ let i = { event_id: r && r.event_id, level: n, message: e };
1802
2188
  if (s && r && r.syntheticException) {
1803
- let i = Gn(t, r.syntheticException);
1804
- i.length && (o.exception = { values: [{ value: e, stacktrace: { frames: i } }] });
2189
+ let o = tr(t, r.syntheticException);
2190
+ o.length && (i.exception = { values: [{ value: e, stacktrace: { frames: o } }] });
2191
+ }
2192
+ return i;
2193
+ }
2194
+ var As = 5;
2195
+ var Ke = class {
2196
+ name = Ke.id;
2197
+ limit;
2198
+ constructor(e = {}) {
2199
+ this.limit = e.limit || As;
2200
+ }
2201
+ setupOnce(e, n) {
2202
+ let r = n().getClient();
2203
+ r && e((s, i) => {
2204
+ let o = n().getIntegration(Ke);
2205
+ return o ? Ns(r.getOptions().stackParser, o.limit, s, i) : s;
2206
+ });
1805
2207
  }
1806
- return o;
1807
- }
1808
- var _s = 5;
1809
- var Es = (t = { limit: _s }) => ({ name: "LinkedErrors", processEvent: (e, n, r) => Ss(r.getOptions().stackParser, t.limit, e, n) });
1810
- function Ss(t, e, n, r) {
1811
- if (!n.exception || !n.exception.values || !r || !v(r.originalException, Error)) return n;
1812
- let s = zn(t, e, r.originalException);
2208
+ };
2209
+ var ze = Ke;
2210
+ Se(ze, "id", "LinkedErrors");
2211
+ function Ns(t, e, n, r) {
2212
+ if (!n.exception || !n.exception.values || !r || !P(r.originalException, Error)) return n;
2213
+ let s = rr(t, e, r.originalException);
1813
2214
  return n.exception.values = [...s, ...n.exception.values], n;
1814
2215
  }
1815
- function zn(t, e, n, r = []) {
1816
- if (!v(n.cause, Error) || r.length + 1 >= e) return r;
1817
- let s = qn(t, n.cause);
1818
- return zn(t, e, n.cause, [s, ...r]);
1819
- }
1820
- var ys = { allowedHeaders: ["CF-RAY", "CF-Worker"] };
1821
- var Ts = (t = {}) => {
1822
- let e = { ...ys, ...t };
1823
- return { name: "RequestData", preprocessEvent: (n) => {
1824
- let { sdkProcessingMetadata: r } = n;
1825
- return r && ("request" in r && r.request instanceof Request && (n.request = xs(r.request, e), n.user = Is(n.user ?? {}, r.request, e)), "requestData" in r && (n.request ? n.request.data = r.requestData : n.request = { data: r.requestData })), n;
1826
- } };
2216
+ function rr(t, e, n, r = []) {
2217
+ if (!P(n.cause, Error) || r.length + 1 >= e) return r;
2218
+ let s = nr(t, n.cause);
2219
+ return rr(t, e, n.cause, [s, ...r]);
2220
+ }
2221
+ var ws = { allowedHeaders: ["CF-RAY", "CF-Worker"] };
2222
+ var re;
2223
+ var Xe = class {
2224
+ constructor(e = {}) {
2225
+ Se(this, "name", Xe.id);
2226
+ Vt(this, re, void 0);
2227
+ Jt(this, re, { ...ws, ...e });
2228
+ }
2229
+ setupOnce(e, n) {
2230
+ n().getClient() && e((s) => {
2231
+ let { sdkProcessingMetadata: i } = s;
2232
+ return !n().getIntegration(Xe) || !i || ("request" in i && i.request instanceof Request && (s.request = Os(i.request, rt(this, re)), s.user = Ds(s.user ?? {}, i.request, rt(this, re))), "requestData" in i && (s.request ? s.request.data = i.requestData : s.request = { data: i.requestData })), s;
2233
+ });
2234
+ }
1827
2235
  };
1828
- function Is(t, e, n) {
1829
- let r = e.headers.get("CF-Connecting-IP"), { allowedIps: s } = n, o = { ...t };
1830
- return !("ip_address" in t) && r && s !== void 0 && As(r, s) && (o.ip_address = r), Object.keys(o).length > 0 ? o : void 0;
2236
+ var Ve = Xe;
2237
+ re = /* @__PURE__ */ new WeakMap(), Se(Ve, "id", "RequestData");
2238
+ function Ds(t, e, n) {
2239
+ let r = e.headers.get("CF-Connecting-IP"), { allowedIps: s } = n, i = { ...t };
2240
+ return !("ip_address" in t) && r && s !== void 0 && vs(r, s) && (i.ip_address = r), Object.keys(i).length > 0 ? i : void 0;
1831
2241
  }
1832
- function xs(t, e) {
2242
+ function Os(t, e) {
1833
2243
  let n = t.headers.get("cookie"), r;
1834
2244
  if (n) try {
1835
- r = bs(n);
2245
+ r = ks(n);
1836
2246
  } catch {
1837
2247
  }
1838
2248
  let s = {};
1839
- for (let [u, f] of t.headers.entries()) u !== "cookie" && (s[u] = f);
1840
- let o = { method: t.method, cookies: r, headers: s };
2249
+ for (let [u, l] of t.headers.entries()) u !== "cookie" && (s[u] = l);
2250
+ let i = { method: t.method, cookies: r, headers: s };
1841
2251
  try {
1842
2252
  let u = new URL(t.url);
1843
- o.url = `${u.protocol}//${u.hostname}${u.pathname}`, o.query_string = u.search;
2253
+ i.url = `${u.protocol}//${u.hostname}${u.pathname}`, i.query_string = u.search;
1844
2254
  } catch {
1845
- let f = t.url.indexOf("?");
1846
- f < 0 ? o.url = t.url : (o.url = t.url.substr(0, f), o.query_string = t.url.substr(f + 1));
1847
- }
1848
- let { allowedHeaders: i, allowedCookies: a, allowedSearchParams: c } = e;
1849
- if (i !== void 0 && o.headers ? (o.headers = Ut(o.headers, i), Object.keys(o.headers).length === 0 && delete o.headers) : delete o.headers, a !== void 0 && o.cookies ? (o.cookies = Ut(o.cookies, a), Object.keys(o.cookies).length === 0 && delete o.cookies) : delete o.cookies, c !== void 0) {
1850
- let u = Object.fromEntries(new URLSearchParams(o.query_string)), f = new URLSearchParams();
1851
- Object.keys(Ut(u, c)).forEach((l) => {
1852
- f.set(l, u[l]);
1853
- }), o.query_string = f.toString();
1854
- } else delete o.query_string;
1855
- return o;
1856
- }
1857
- function As(t, e) {
2255
+ let l = t.url.indexOf("?");
2256
+ l < 0 ? i.url = t.url : (i.url = t.url.substr(0, l), i.query_string = t.url.substr(l + 1));
2257
+ }
2258
+ let { allowedHeaders: o, allowedCookies: a, allowedSearchParams: c } = e;
2259
+ if (o !== void 0 && i.headers ? (i.headers = Lt(i.headers, o), Object.keys(i.headers).length === 0 && delete i.headers) : delete i.headers, a !== void 0 && i.cookies ? (i.cookies = Lt(i.cookies, a), Object.keys(i.cookies).length === 0 && delete i.cookies) : delete i.cookies, c !== void 0) {
2260
+ let u = Object.fromEntries(new URLSearchParams(i.query_string)), l = new URLSearchParams();
2261
+ Object.keys(Lt(u, c)).forEach((d) => {
2262
+ l.set(d, u[d]);
2263
+ }), i.query_string = l.toString();
2264
+ } else delete i.query_string;
2265
+ return i;
2266
+ }
2267
+ function vs(t, e) {
1858
2268
  return typeof e == "boolean" ? e : e instanceof RegExp ? e.test(t) : Array.isArray(e) ? e.map((r) => r.toLowerCase()).includes(t) : false;
1859
2269
  }
1860
- function Ut(t, e) {
2270
+ function Lt(t, e) {
1861
2271
  let n = () => false;
1862
2272
  if (typeof e == "boolean") return e ? t : {};
1863
2273
  if (e instanceof RegExp) n = (r) => e.test(r);
@@ -1867,7 +2277,7 @@ function Ut(t, e) {
1867
2277
  } else return {};
1868
2278
  return Object.keys(t).filter(n).reduce((r, s) => (r[s] = t[s], r), {});
1869
2279
  }
1870
- function bs(t) {
2280
+ function ks(t) {
1871
2281
  if (typeof t != "string") return {};
1872
2282
  try {
1873
2283
  return t.split(";").map((e) => e.split("=")).reduce((e, [n, r]) => (e[decodeURIComponent(n.trim())] = decodeURIComponent(r.trim()), e), {});
@@ -1875,40 +2285,30 @@ function bs(t) {
1875
2285
  return {};
1876
2286
  }
1877
2287
  }
1878
- function Rs(t, e) {
2288
+ function Cs(t, e) {
1879
2289
  let n = {};
1880
2290
  return t.forEach((r) => {
1881
- n[r.name] = r, typeof r.setupOnce == "function" && r.setupOnce();
1882
- let s = e.getClient();
1883
- if (s) {
1884
- if (typeof r.setup == "function" && r.setup(s), typeof r.preprocessEvent == "function") {
1885
- let o = r.preprocessEvent.bind(r);
1886
- s.on("preprocessEvent", (i, a) => o(i, a, s));
1887
- }
1888
- if (typeof r.processEvent == "function") {
1889
- let o = r.processEvent.bind(r), i = Object.assign((a, c) => o(a, c, s), { id: r.name });
1890
- s.addEventProcessor(i);
1891
- }
1892
- }
2291
+ n[r.name] = r, r.setupOnce((s) => {
2292
+ e.getScope()?.addEventProcessor(s);
2293
+ }, () => e);
1893
2294
  }), n;
1894
2295
  }
1895
- var Ft = class extends _e {
2296
+ var Bt = class extends ye {
1896
2297
  #e = null;
1897
- #t = false;
1898
2298
  constructor(e) {
1899
- e._metadata = e._metadata || {}, e._metadata.sdk = e._metadata.sdk || { name: "toucan-js", packages: [{ name: "npm:toucan-js", version: "4.0.0" }], version: "4.0.0" }, super(e);
2299
+ e._metadata = e._metadata || {}, e._metadata.sdk = e._metadata.sdk || { name: "toucan-js", packages: [{ name: "npm:toucan-js", version: "3.3.1" }], version: "3.3.1" }, super(e);
1900
2300
  }
1901
2301
  setupIntegrations() {
1902
- this._isEnabled() && !this.#t && this.#e && (this._integrations = Rs(this._options.integrations, this.#e), this.#t = true);
2302
+ this._isEnabled() && !this._integrationsInitialized && this.#e && (this._integrations = Cs(this._options.integrations, this.#e), this._integrationsInitialized = true);
1903
2303
  }
1904
2304
  eventFromException(e, n) {
1905
- return b(gs(this.#e, this._options.stackParser, e, n));
2305
+ return b(Rs(this.#e, this._options.stackParser, e, n));
1906
2306
  }
1907
2307
  eventFromMessage(e, n = "info", r) {
1908
- return b(hs(this._options.stackParser, e, n, r, this._options.attachStacktrace));
2308
+ return b(Is(this._options.stackParser, e, n, r, this._options.attachStacktrace));
1909
2309
  }
1910
2310
  _prepareEvent(e, n, r) {
1911
- return e.platform = e.platform || "javascript", this.getOptions().request && (e.sdkProcessingMetadata = Hn(e.sdkProcessingMetadata, ["request", this.getOptions().request])), this.getOptions().requestData && (e.sdkProcessingMetadata = Hn(e.sdkProcessingMetadata, ["requestData", this.getOptions().requestData])), super._prepareEvent(e, n, r);
2311
+ return e.platform = e.platform || "javascript", this.getOptions().request && (e.sdkProcessingMetadata = Qn(e.sdkProcessingMetadata, ["request", this.getOptions().request])), this.getOptions().requestData && (e.sdkProcessingMetadata = Qn(e.sdkProcessingMetadata, ["requestData", this.getOptions().requestData])), super._prepareEvent(e, n, r);
1912
2312
  }
1913
2313
  getSdk() {
1914
2314
  return this.#e;
@@ -1923,44 +2323,40 @@ var Ft = class extends _e {
1923
2323
  this.getOptions().enabled = e;
1924
2324
  }
1925
2325
  };
1926
- function Ns(t) {
1927
- let [e, n] = ht(t);
2326
+ function Ps(t) {
2327
+ let [e, n] = ft(t);
1928
2328
  return [e, (s) => {
1929
- let o = n(s);
1930
- if (o) {
1931
- let i = o.filename;
1932
- o.abs_path = i !== void 0 && !i.startsWith("/") ? `/${i}` : i, o.in_app = i !== void 0;
2329
+ let i = n(s);
2330
+ if (i) {
2331
+ let o = i.filename;
2332
+ i.abs_path = o !== void 0 && !o.startsWith("/") ? `/${o}` : o, i.in_app = o !== void 0;
1933
2333
  }
1934
- return o;
2334
+ return i;
1935
2335
  }];
1936
2336
  }
1937
- function Cs(t) {
1938
- if (t) return le(t, ".js");
2337
+ function Ms(t) {
2338
+ if (t) return _e(t, ".js");
1939
2339
  }
1940
- var Os = Ne(Ns(Cs));
1941
- function ws(t) {
2340
+ var Us = Oe(Ps(Ms));
2341
+ function Ls(t) {
1942
2342
  function e({ body: n }) {
1943
2343
  try {
1944
- let s = (t.fetcher ?? fetch)(t.url, { method: "POST", headers: t.headers, body: n }).then((o) => ({ statusCode: o.status, headers: { "retry-after": o.headers.get("Retry-After"), "x-sentry-rate-limits": o.headers.get("X-Sentry-Rate-Limits") } }));
2344
+ let s = (t.fetcher ?? fetch)(t.url, { method: "POST", headers: t.headers, body: n }).then((i) => ({ statusCode: i.status, headers: { "retry-after": i.headers.get("Retry-After"), "x-sentry-rate-limits": i.headers.get("X-Sentry-Rate-Limits") } }));
1945
2345
  return t.context && t.context.waitUntil(s), s;
1946
2346
  } catch (r) {
1947
- return Y(r);
2347
+ return j(r);
1948
2348
  }
1949
2349
  }
1950
- return Lt(t, e);
2350
+ return Ut(t, e);
1951
2351
  }
1952
- var te = class extends R {
1953
- #e;
2352
+ var Je = class extends z {
1954
2353
  constructor(e) {
1955
- if (super(), e.defaultIntegrations = e.defaultIntegrations === false ? [] : [...Array.isArray(e.defaultIntegrations) ? e.defaultIntegrations : [Ts(e.requestDataOptions), Es()]], e.release === void 0) {
1956
- let n = ds();
1957
- n !== void 0 && (e.release = n);
2354
+ if (e.defaultIntegrations = e.defaultIntegrations === false ? [] : [...Array.isArray(e.defaultIntegrations) ? e.defaultIntegrations : [new Ve(e.requestDataOptions), new ze()]], e.release === void 0) {
2355
+ let r = bs();
2356
+ r !== void 0 && (e.release = r);
1958
2357
  }
1959
- this.#e = e, this.attachNewClient();
1960
- }
1961
- attachNewClient() {
1962
- let e = new Ft({ ...this.#e, transport: ws, integrations: Mt(this.#e), stackParser: ut(this.#e.stackParser || Os), transportOptions: { ...this.#e.transportOptions, context: this.#e.context } });
1963
- this.setClient(e), e.setSdk(this), e.setupIntegrations();
2358
+ let n = new Bt({ ...e, transport: Ls, integrations: Pt(e), stackParser: lt(e.stackParser || Us), transportOptions: { ...e.transportOptions, context: e.context } });
2359
+ super(n), n.setSdk(this), n.setupIntegrations();
1964
2360
  }
1965
2361
  setRequestBody(e) {
1966
2362
  this.getClient()?.setRequestBody(e);
@@ -1971,36 +2367,24 @@ var te = class extends R {
1971
2367
  captureCheckIn(e, n, r) {
1972
2368
  return e.status === "in_progress" && this.setContext("monitor", { slug: e.monitorSlug }), this.getClient().captureCheckIn(e, n, r);
1973
2369
  }
1974
- addBreadcrumb(e, n = 100) {
1975
- let s = this.getClient().getOptions().maxBreadcrumbs || n;
1976
- return super.addBreadcrumb(e, s);
1977
- }
1978
- clone() {
1979
- let e = new te({ ...this.#e });
1980
- return e._breadcrumbs = [...this._breadcrumbs], e._tags = { ...this._tags }, e._extra = { ...this._extra }, e._contexts = { ...this._contexts }, e._user = this._user, e._level = this._level, e._session = this._session, e._transactionName = this._transactionName, e._fingerprint = this._fingerprint, e._eventProcessors = [...this._eventProcessors], e._requestSession = this._requestSession, e._attachments = [...this._attachments], e._sdkProcessingMetadata = { ...this._sdkProcessingMetadata }, e._propagationContext = { ...this._propagationContext }, e._lastEventId = this._lastEventId, e;
1981
- }
1982
- withScope(e) {
1983
- let n = this.clone();
1984
- return e(n);
1985
- }
1986
2370
  };
1987
- function Yn(t, e, n, r, s, o, i, a, c) {
2371
+ function sr(t, e, n, r, s, i, o, a, c) {
1988
2372
  if (!(n && r && s)) return;
1989
- let u = new te({ dsn: n, request: t, context: e, sampleRate: 1, release: i?.tag, integrations: [ze({ iteratee(f) {
1990
- return f.filename = "/index.js", f;
2373
+ let u = new Je({ dsn: n, request: t, context: e, sampleRate: 1, release: o?.tag, integrations: [new C({ iteratee(l) {
2374
+ return l.filename = "/index.js", l;
1991
2375
  } })], requestDataOptions: { allowedHeaders: ["user-agent", "cf-challenge", "accept-encoding", "accept-language", "cf-ray", "content-length", "content-type", "host"], allowedSearchParams: /(.*)/ }, transportOptions: { headers: { "CF-Access-Client-ID": r, "CF-Access-Client-Secret": s } } });
1992
- return o && (u.setTag("colo", o.coloId), u.setTag("metal", o.metalId)), a && c && (u.setTag("accountId", a), u.setTag("scriptId", c)), u.setUser({ id: a?.toString() }), u;
2376
+ return i && (u.setTag("colo", i.coloId), u.setTag("metal", i.metalId)), a && c && (u.setTag("accountId", a), u.setTag("scriptId", c)), u.setUser({ id: a?.toString() }), u;
1993
2377
  }
1994
- function vs() {
2378
+ function Bs() {
1995
2379
  return { addLogs: () => {
1996
2380
  }, setTags: () => {
1997
2381
  }, end: () => {
1998
2382
  }, isRecording: true };
1999
2383
  }
2000
- function Jn() {
2001
- return { enterSpan: (t, e, ...n) => e(vs(), ...n), getSpanContext: () => ({ traceId: "test-trace", spanId: "test-span", parentSpanId: "test-parent-span", traceFlags: 0 }), runWithSpanContext: (t, e, ...n) => e(...n), traceId: "test-trace", spanId: "test-span", parentSpanId: "test-parent-span", cfTraceIdHeader: "test-trace:test-span:0" };
2384
+ function ir() {
2385
+ return { enterSpan: (t, e, ...n) => e(Bs(), ...n), getSpanContext: () => ({ traceId: "test-trace", spanId: "test-span", parentSpanId: "test-parent-span", traceFlags: 0 }), runWithSpanContext: (t, e, ...n) => e(...n), traceId: "test-trace", spanId: "test-span", parentSpanId: "test-parent-span", cfTraceIdHeader: "test-trace:test-span:0" };
2002
2386
  }
2003
- var Ye = class {
2387
+ var Ze = class {
2004
2388
  constructor(e) {
2005
2389
  this.data = {};
2006
2390
  this.readyAnalytics = e;
@@ -2012,67 +2396,67 @@ var Ye = class {
2012
2396
  return this.data[e];
2013
2397
  }
2014
2398
  write() {
2015
- this.readyAnalytics && this.readyAnalytics.logEvent({ version: 1, accountId: this.data.accountId, indexId: this.data.scriptId?.toString(), doubles: [this.data.requestTime ?? -1, this.data.coloId ?? -1, this.data.metalId ?? -1, this.data.coloTier ?? -1, this.data.status ?? -1], blobs: [this.data.hostname?.substring(0, 256), this.data.userAgent?.substring(0, 256), this.data.htmlHandling, this.data.notFoundHandling, this.data.error?.substring(0, 256), this.data.version, this.data.coloRegion] });
2399
+ this.readyAnalytics && this.readyAnalytics.logEvent({ version: 1, accountId: this.data.accountId, indexId: this.data.scriptId?.toString(), doubles: [this.data.requestTime ?? -1, this.data.coloId ?? -1, this.data.metalId ?? -1, this.data.coloTier ?? -1], blobs: [this.data.hostname?.substring(0, 256), this.data.userAgent?.substring(0, 256), this.data.htmlHandling, this.data.notFoundHandling, this.data.error?.substring(0, 256), this.data.version, this.data.coloRegion] });
2016
2400
  }
2017
2401
  };
2018
- var Je = class {
2402
+ var Qe = class {
2019
2403
  constructor(e) {
2020
2404
  this.data = e;
2021
2405
  }
2022
2406
  async getWithBinarySearch(e) {
2023
- let n = await Vn(e), r = $t(new Uint8Array(this.data, 20), n);
2024
- return r ? Kn(r) : null;
2407
+ let n = await ar(e), r = Ft(new Uint8Array(this.data, 20), n);
2408
+ return r ? cr(r) : null;
2025
2409
  }
2026
2410
  async getWithInterpolationSearch(e) {
2027
- let n = await Vn(e), r = Ms(new Uint8Array(this.data, 20), n);
2028
- return r ? Kn(r) : null;
2411
+ let n = await ar(e), r = Fs(new Uint8Array(this.data, 20), n);
2412
+ return r ? cr(r) : null;
2029
2413
  }
2030
2414
  };
2031
- var Vn = async (t) => {
2415
+ var ar = async (t) => {
2032
2416
  let n = new TextEncoder().encode(t), r = await crypto.subtle.digest("SHA-256", n.buffer);
2033
2417
  return new Uint8Array(r, 0, 16);
2034
2418
  };
2035
- var $t = (t, e) => {
2419
+ var Ft = (t, e) => {
2036
2420
  if (t.byteLength === 0) return false;
2037
2421
  let n = t.byteOffset + (t.byteLength / 40 >> 1) * 40, r = new Uint8Array(t.buffer, n, 16);
2038
2422
  if (r.byteLength !== e.byteLength) throw new TypeError("Search value and current value are of different lengths");
2039
- let s = Ht(e, r);
2423
+ let s = $t(e, r);
2040
2424
  if (s < 0) {
2041
- let o = t.byteOffset, i = n - t.byteOffset;
2042
- return $t(new Uint8Array(t.buffer, o, i), e);
2425
+ let i = t.byteOffset, o = n - t.byteOffset;
2426
+ return Ft(new Uint8Array(t.buffer, i, o), e);
2043
2427
  } else if (s > 0) {
2044
- let o = n + 40, i = t.buffer.byteLength - n - 40;
2045
- return $t(new Uint8Array(t.buffer, o, i), e);
2428
+ let i = n + 40, o = t.buffer.byteLength - n - 40;
2429
+ return Ft(new Uint8Array(t.buffer, i, o), e);
2046
2430
  } else return new Uint8Array(t.buffer, n, 40);
2047
2431
  };
2048
- var Bt = (t) => {
2432
+ var Gt = (t) => {
2049
2433
  let e = new DataView(t.buffer, t.byteOffset);
2050
2434
  return (e.getBigUint64(0) << 64n) + e.getBigUint64(8);
2051
2435
  };
2052
- var Ms = (t, e) => {
2436
+ var Fs = (t, e) => {
2053
2437
  if (t.byteLength === 0) return false;
2054
- let n = 0, r = t.byteLength / 40 - 1, s = Bt(e);
2438
+ let n = 0, r = t.byteLength / 40 - 1, s = Gt(e);
2055
2439
  for (; n <= r; ) {
2056
2440
  if (n === r) {
2057
- let h = new Uint8Array(t.buffer, t.byteOffset + n * 40, 16);
2058
- if (h.byteLength !== e.byteLength) throw new TypeError("Search value and current value are of different lengths");
2059
- return Ht(h, e) === 0 ? new Uint8Array(t.buffer, t.byteOffset + n * 40, 40) : false;
2441
+ let I = new Uint8Array(t.buffer, t.byteOffset + n * 40, 16);
2442
+ if (I.byteLength !== e.byteLength) throw new TypeError("Search value and current value are of different lengths");
2443
+ return $t(I, e) === 0 ? new Uint8Array(t.buffer, t.byteOffset + n * 40, 40) : false;
2060
2444
  }
2061
- let o = new Uint8Array(t.buffer, t.byteOffset + n * 40, 16), i = new Uint8Array(t.buffer, t.byteOffset + r * 40, 16), a = Bt(o), u = Bt(i) - a;
2445
+ let i = new Uint8Array(t.buffer, t.byteOffset + n * 40, 16), o = new Uint8Array(t.buffer, t.byteOffset + r * 40, 16), a = Gt(i), u = Gt(o) - a;
2062
2446
  if (u <= 0n) throw new TypeError("Search space is unordered");
2063
- let f = s - a;
2064
- if (f < 0n) return false;
2065
- let l = Math.floor(Number(BigInt(n) + BigInt(r - n) * f / u));
2066
- if (l < n || l > r) return false;
2067
- let m = new Uint8Array(t.buffer, t.byteOffset + l * 40, 16);
2068
- if (m.byteLength !== e.byteLength) throw new TypeError("Search value and current value are of different lengths");
2069
- let d = Ht(m, e);
2070
- if (d === 0) return new Uint8Array(t.buffer, t.byteOffset + l * 40, 40);
2071
- d < 0 ? n = l + 1 : r = l - 1;
2447
+ let l = s - a;
2448
+ if (l < 0n) return false;
2449
+ let d = Math.floor(Number(BigInt(n) + BigInt(r - n) * l / u));
2450
+ if (d < n || d > r) return false;
2451
+ let p = new Uint8Array(t.buffer, t.byteOffset + d * 40, 16);
2452
+ if (p.byteLength !== e.byteLength) throw new TypeError("Search value and current value are of different lengths");
2453
+ let m = $t(p, e);
2454
+ if (m === 0) return new Uint8Array(t.buffer, t.byteOffset + d * 40, 40);
2455
+ m < 0 ? n = d + 1 : r = d - 1;
2072
2456
  }
2073
2457
  return false;
2074
2458
  };
2075
- var Ht = (t, e) => {
2459
+ var $t = (t, e) => {
2076
2460
  if (t.byteLength < e.byteLength) return -1;
2077
2461
  if (t.byteLength > e.byteLength) return 1;
2078
2462
  for (let [n, r] of t.entries()) {
@@ -2081,12 +2465,12 @@ var Ht = (t, e) => {
2081
2465
  }
2082
2466
  return 0;
2083
2467
  };
2084
- var Kn = (t) => [...t.slice(16, 16 + 16)].map((n) => n.toString(16).padStart(2, "0")).join("");
2085
- var jt = (t) => {
2468
+ var cr = (t) => [...t.slice(16, 16 + 16)].map((n) => n.toString(16).padStart(2, "0")).join("");
2469
+ var Ht = (t) => {
2086
2470
  let e;
2087
2471
  return t?.run_worker_first !== void 0 ? e = t?.run_worker_first : t?.serve_directly !== void 0 ? e = !t.serve_directly : e = false, { html_handling: t?.html_handling ?? "auto-trailing-slash", not_found_handling: t?.not_found_handling ?? "none", run_worker_first: e, serve_directly: !e };
2088
2472
  };
2089
- var We = class {
2473
+ var et = class {
2090
2474
  constructor(e) {
2091
2475
  this.data = {};
2092
2476
  this.readyAnalytics = e;
@@ -2101,119 +2485,119 @@ var We = class {
2101
2485
  this.readyAnalytics && this.readyAnalytics.logEvent({ version: 1, accountId: this.data.accountId, indexId: this.data.experimentName, doubles: [this.data.manifestReadTime ?? -1], blobs: [this.data.manifestReadMethod] });
2102
2486
  }
2103
2487
  };
2104
- var Zn = "public, max-age=0, must-revalidate";
2105
- function Xn(t, e, n) {
2488
+ var ur = "public, max-age=0, must-revalidate";
2489
+ function dr(t, e, n) {
2106
2490
  let r = new Headers({ "Content-Type": e, ETag: `"${t}"` });
2107
- return Ps(n) && r.append("Cache-Control", Zn), r;
2491
+ return $s(n) && r.append("Cache-Control", ur), r;
2108
2492
  }
2109
- function Ps(t) {
2493
+ function $s(t) {
2110
2494
  return !t.headers.has("Authorization") && !t.headers.has("Range");
2111
2495
  }
2112
- var Qn = async (t, e, n, r, s) => {
2113
- let { pathname: o, search: i } = new URL(t.url), a = Gt(o);
2496
+ var lr = async (t, e, n, r, s) => {
2497
+ let { pathname: i, search: o } = new URL(t.url), a = Yt(i);
2114
2498
  a = a.replace(/\/+/g, "/");
2115
- let c = await Ve(a, n, r);
2116
- if (!c) return e.JAEGER.enterSpan("no_intent", (A) => (A.setTags({ decodedPathname: a, configuration: JSON.stringify(n), status: 404 }), new re()));
2499
+ let c = await tt(a, n, r);
2500
+ if (!c) return e.JAEGER.enterSpan("no_intent", (A) => (A.setTags({ decodedPathname: a, configuration: JSON.stringify(n), status: 404 }), new ie()));
2117
2501
  let u = t.method.toUpperCase();
2118
- if (!["GET", "HEAD"].includes(u)) return e.JAEGER.enterSpan("method_not_allowed", (A) => (A.setTags({ method: u, status: 405 }), new Se()));
2119
- let f = c.redirect ?? a, l = Bs(f);
2120
- if (l !== o && c.asset || c.redirect) return e.JAEGER.enterSpan("redirect", (A) => (A.setTags({ originalPath: o, location: l !== o ? l : c.redirect ?? "<unknown>", status: 307 }), new Te(l + i)));
2121
- if (!c.asset) return e.JAEGER.enterSpan("unknown_action", (A) => (A.setTags({ pathname: o, status: 500 }), new j(new Error("Unknown action"))));
2122
- let m = await e.JAEGER.enterSpan("getByETag", async (A) => (A.setTags({ pathname: o, eTag: c.asset.eTag, status: c.asset.status }), await s(c.asset.eTag))), d = Xn(c.asset.eTag, m.contentType, t), h = `"${c.asset.eTag}"`, H = `W/${h}`, y = t.headers.get("If-None-Match") || "";
2123
- return [H, h].includes(y) ? e.JAEGER.enterSpan("matched_etag", (A) => (A.setTags({ matchedEtag: y, status: 304 }), new ye(null, { headers: d }))) : e.JAEGER.enterSpan("response", (A) => {
2502
+ if (!["GET", "HEAD"].includes(u)) return e.JAEGER.enterSpan("method_not_allowed", (A) => (A.setTags({ method: u, status: 405 }), new be()));
2503
+ let l = c.redirect ?? a, d = Ws(l);
2504
+ if (d !== i && c.asset || c.redirect) return e.JAEGER.enterSpan("redirect", (A) => (A.setTags({ originalPath: i, location: d !== i ? d : c.redirect ?? "<unknown>", status: 307 }), new Re(d + o)));
2505
+ if (!c.asset) return e.JAEGER.enterSpan("unknown_action", (A) => (A.setTags({ pathname: i, status: 500 }), new $(new Error("Unknown action"))));
2506
+ let p = await e.JAEGER.enterSpan("getByETag", async (A) => (A.setTags({ pathname: i, eTag: c.asset.eTag, status: c.asset.status }), await s(c.asset.eTag))), m = dr(c.asset.eTag, p.contentType, t), I = `"${c.asset.eTag}"`, jt = `W/${I}`, qt = t.headers.get("If-None-Match") || "";
2507
+ return [jt, I].includes(qt) ? e.JAEGER.enterSpan("matched_etag", (A) => (A.setTags({ matchedEtag: qt, status: 304 }), new xe(null, { headers: m }))) : e.JAEGER.enterSpan("response", (A) => {
2124
2508
  A.setTags({ etag: c.asset.eTag, status: c.asset.status, head: u === "HEAD" });
2125
- let qt = u === "HEAD" ? null : m.readableStream;
2509
+ let Wt = u === "HEAD" ? null : p.readableStream;
2126
2510
  switch (c.asset.status) {
2127
2511
  case 404:
2128
- return new re(qt, { headers: d });
2512
+ return new ie(Wt, { headers: m });
2129
2513
  case 200:
2130
- return new Ee(qt, { headers: d });
2514
+ return new Te(Wt, { headers: m });
2131
2515
  }
2132
2516
  });
2133
2517
  };
2134
- var Ve = async (t, e, n, r = false) => {
2518
+ var tt = async (t, e, n, r = false) => {
2135
2519
  switch (e.html_handling) {
2136
2520
  case "auto-trailing-slash":
2137
- return ks(t, e, n, r);
2521
+ return Hs(t, e, n, r);
2138
2522
  case "force-trailing-slash":
2139
- return Ls(t, e, n, r);
2523
+ return Ys(t, e, n, r);
2140
2524
  case "drop-trailing-slash":
2141
- return Us(t, e, n, r);
2525
+ return js(t, e, n, r);
2142
2526
  case "none":
2143
- return Fs(t, e, n);
2527
+ return qs(t, e, n);
2144
2528
  }
2145
2529
  };
2146
- var ks = async (t, e, n, r) => {
2147
- let s = null, o = null, i = await n(t);
2530
+ var Hs = async (t, e, n, r) => {
2531
+ let s = null, i = null, o = await n(t);
2148
2532
  if (t.endsWith("/index")) {
2149
- if (i) return { asset: { eTag: i, status: 200 }, redirect: null };
2150
- if (s = await E(`${t}.html`, t.slice(0, -5), e, n, r)) return s;
2151
- if (s = await E(`${t.slice(0, -6)}.html`, t.slice(0, -6), e, n, r)) return s;
2533
+ if (o) return { asset: { eTag: o, status: 200 }, redirect: null };
2534
+ if (s = await _(`${t}.html`, t.slice(0, -5), e, n, r)) return s;
2535
+ if (s = await _(`${t.slice(0, -6)}.html`, t.slice(0, -6), e, n, r)) return s;
2152
2536
  } else if (t.endsWith("/index.html")) {
2153
- if (s = await E(t, t.slice(0, -10), e, n, r)) return s;
2154
- if (s = await E(`${t.slice(0, -11)}.html`, t.slice(0, -11), e, n, r)) return s;
2537
+ if (s = await _(t, t.slice(0, -10), e, n, r)) return s;
2538
+ if (s = await _(`${t.slice(0, -11)}.html`, t.slice(0, -11), e, n, r)) return s;
2155
2539
  } else if (t.endsWith("/")) {
2156
- if (o = await n(`${t}index.html`)) return { asset: { eTag: o, status: 200 }, redirect: null };
2157
- if (s = await E(`${t.slice(0, -1)}.html`, t.slice(0, -1), e, n, r)) return s;
2540
+ if (i = await n(`${t}index.html`)) return { asset: { eTag: i, status: 200 }, redirect: null };
2541
+ if (s = await _(`${t.slice(0, -1)}.html`, t.slice(0, -1), e, n, r)) return s;
2158
2542
  } else if (t.endsWith(".html")) {
2159
- if (s = await E(t, t.slice(0, -5), e, n, r)) return s;
2160
- if (s = await E(`${t.slice(0, -5)}/index.html`, `${t.slice(0, -5)}/`, e, n, r)) return s;
2543
+ if (s = await _(t, t.slice(0, -5), e, n, r)) return s;
2544
+ if (s = await _(`${t.slice(0, -5)}/index.html`, `${t.slice(0, -5)}/`, e, n, r)) return s;
2161
2545
  }
2162
- return i ? { asset: { eTag: i, status: 200 }, redirect: null } : (o = await n(`${t}.html`)) ? { asset: { eTag: o, status: 200 }, redirect: null } : (s = await E(`${t}/index.html`, `${t}/`, e, n, r)) ? s : Ke(t, e, n);
2546
+ return o ? { asset: { eTag: o, status: 200 }, redirect: null } : (i = await n(`${t}.html`)) ? { asset: { eTag: i, status: 200 }, redirect: null } : (s = await _(`${t}/index.html`, `${t}/`, e, n, r)) ? s : nt(t, e, n);
2163
2547
  };
2164
- var Ls = async (t, e, n, r) => {
2165
- let s = null, o = null, i = await n(t);
2548
+ var Ys = async (t, e, n, r) => {
2549
+ let s = null, i = null, o = await n(t);
2166
2550
  if (t.endsWith("/index")) {
2167
- if (i) return { asset: { eTag: i, status: 200 }, redirect: null };
2168
- if (s = await E(`${t}.html`, t.slice(0, -5), e, n, r)) return s;
2169
- if (s = await E(`${t.slice(0, -6)}.html`, t.slice(0, -5), e, n, r)) return s;
2551
+ if (o) return { asset: { eTag: o, status: 200 }, redirect: null };
2552
+ if (s = await _(`${t}.html`, t.slice(0, -5), e, n, r)) return s;
2553
+ if (s = await _(`${t.slice(0, -6)}.html`, t.slice(0, -5), e, n, r)) return s;
2170
2554
  } else if (t.endsWith("/index.html")) {
2171
- if (s = await E(t, t.slice(0, -10), e, n, r)) return s;
2172
- if (s = await E(`${t.slice(0, -11)}.html`, t.slice(0, -10), e, n, r)) return s;
2555
+ if (s = await _(t, t.slice(0, -10), e, n, r)) return s;
2556
+ if (s = await _(`${t.slice(0, -11)}.html`, t.slice(0, -10), e, n, r)) return s;
2173
2557
  } else if (t.endsWith("/")) {
2174
- if (o = await n(`${t}index.html`)) return { asset: { eTag: o, status: 200 }, redirect: null };
2175
- if (o = await n(`${t.slice(0, -1)}.html`)) return { asset: { eTag: o, status: 200 }, redirect: null };
2558
+ if (i = await n(`${t}index.html`)) return { asset: { eTag: i, status: 200 }, redirect: null };
2559
+ if (i = await n(`${t.slice(0, -1)}.html`)) return { asset: { eTag: i, status: 200 }, redirect: null };
2176
2560
  } else if (t.endsWith(".html")) {
2177
- if (s = await E(t, `${t.slice(0, -5)}/`, e, n, r)) return s;
2178
- if (i) return { asset: { eTag: i, status: 200 }, redirect: null };
2179
- if (s = await E(`${t.slice(0, -5)}/index.html`, `${t.slice(0, -5)}/`, e, n, r)) return s;
2561
+ if (s = await _(t, `${t.slice(0, -5)}/`, e, n, r)) return s;
2562
+ if (o) return { asset: { eTag: o, status: 200 }, redirect: null };
2563
+ if (s = await _(`${t.slice(0, -5)}/index.html`, `${t.slice(0, -5)}/`, e, n, r)) return s;
2180
2564
  }
2181
- return i ? { asset: { eTag: i, status: 200 }, redirect: null } : (s = await E(`${t}.html`, `${t}/`, e, n, r)) || (s = await E(`${t}/index.html`, `${t}/`, e, n, r)) ? s : Ke(t, e, n);
2565
+ return o ? { asset: { eTag: o, status: 200 }, redirect: null } : (s = await _(`${t}.html`, `${t}/`, e, n, r)) || (s = await _(`${t}/index.html`, `${t}/`, e, n, r)) ? s : nt(t, e, n);
2182
2566
  };
2183
- var Us = async (t, e, n, r) => {
2184
- let s = null, o = null, i = await n(t);
2567
+ var js = async (t, e, n, r) => {
2568
+ let s = null, i = null, o = await n(t);
2185
2569
  if (t.endsWith("/index")) {
2186
- if (i) return { asset: { eTag: i, status: 200 }, redirect: null };
2570
+ if (o) return { asset: { eTag: o, status: 200 }, redirect: null };
2187
2571
  if (t === "/index") {
2188
- if (s = await E("/index.html", "/", e, n, r)) return s;
2572
+ if (s = await _("/index.html", "/", e, n, r)) return s;
2189
2573
  } else {
2190
- if (s = await E(`${t.slice(0, -6)}.html`, t.slice(0, -6), e, n, r)) return s;
2191
- if (s = await E(`${t}.html`, t.slice(0, -6), e, n, r)) return s;
2574
+ if (s = await _(`${t.slice(0, -6)}.html`, t.slice(0, -6), e, n, r)) return s;
2575
+ if (s = await _(`${t}.html`, t.slice(0, -6), e, n, r)) return s;
2192
2576
  }
2193
2577
  } else if (t.endsWith("/index.html")) if (t === "/index.html") {
2194
- if (s = await E("/index.html", "/", e, n, r)) return s;
2578
+ if (s = await _("/index.html", "/", e, n, r)) return s;
2195
2579
  } else {
2196
- if (s = await E(t, t.slice(0, -11), e, n, r)) return s;
2197
- if (i) return { asset: { eTag: i, status: 200 }, redirect: null };
2198
- if (s = await E(`${t.slice(0, -11)}.html`, t.slice(0, -11), e, n, r)) return s;
2580
+ if (s = await _(t, t.slice(0, -11), e, n, r)) return s;
2581
+ if (o) return { asset: { eTag: o, status: 200 }, redirect: null };
2582
+ if (s = await _(`${t.slice(0, -11)}.html`, t.slice(0, -11), e, n, r)) return s;
2199
2583
  }
2200
2584
  else if (t.endsWith("/")) if (t === "/") {
2201
- if (o = await n("/index.html")) return { asset: { eTag: o, status: 200 }, redirect: null };
2585
+ if (i = await n("/index.html")) return { asset: { eTag: i, status: 200 }, redirect: null };
2202
2586
  } else {
2203
- if (s = await E(`${t.slice(0, -1)}.html`, t.slice(0, -1), e, n, r)) return s;
2204
- if (s = await E(`${t.slice(0, -1)}/index.html`, t.slice(0, -1), e, n, r)) return s;
2587
+ if (s = await _(`${t.slice(0, -1)}.html`, t.slice(0, -1), e, n, r)) return s;
2588
+ if (s = await _(`${t.slice(0, -1)}/index.html`, t.slice(0, -1), e, n, r)) return s;
2205
2589
  }
2206
2590
  else if (t.endsWith(".html")) {
2207
- if (s = await E(t, t.slice(0, -5), e, n, r)) return s;
2208
- if (s = await E(`${t.slice(0, -5)}/index.html`, t.slice(0, -5), e, n, r)) return s;
2591
+ if (s = await _(t, t.slice(0, -5), e, n, r)) return s;
2592
+ if (s = await _(`${t.slice(0, -5)}/index.html`, t.slice(0, -5), e, n, r)) return s;
2209
2593
  }
2210
- return i ? { asset: { eTag: i, status: 200 }, redirect: null } : (o = await n(`${t}.html`)) ? { asset: { eTag: o, status: 200 }, redirect: null } : (o = await n(`${t}/index.html`)) ? { asset: { eTag: o, status: 200 }, redirect: null } : Ke(t, e, n);
2594
+ return o ? { asset: { eTag: o, status: 200 }, redirect: null } : (i = await n(`${t}.html`)) ? { asset: { eTag: i, status: 200 }, redirect: null } : (i = await n(`${t}/index.html`)) ? { asset: { eTag: i, status: 200 }, redirect: null } : nt(t, e, n);
2211
2595
  };
2212
- var Fs = async (t, e, n) => {
2596
+ var qs = async (t, e, n) => {
2213
2597
  let r = await n(t);
2214
- return r ? { asset: { eTag: r, status: 200 }, redirect: null } : Ke(t, e, n);
2598
+ return r ? { asset: { eTag: r, status: 200 }, redirect: null } : nt(t, e, n);
2215
2599
  };
2216
- var Ke = async (t, e, n) => {
2600
+ var nt = async (t, e, n) => {
2217
2601
  switch (e.not_found_handling) {
2218
2602
  case "single-page-application": {
2219
2603
  let r = await n("/index.html");
@@ -2233,68 +2617,64 @@ var Ke = async (t, e, n) => {
2233
2617
  return null;
2234
2618
  }
2235
2619
  };
2236
- var E = async (t, e, n, r, s) => {
2620
+ var _ = async (t, e, n, r, s) => {
2237
2621
  if (s) return null;
2238
2622
  if (!await r(e)) {
2239
- let o = await Ve(e, n, r, true);
2240
- if (o?.asset && o.asset.eTag === await r(t)) return { asset: null, redirect: e };
2623
+ let i = await tt(e, n, r, true);
2624
+ if (i?.asset && i.asset.eTag === await r(t)) return { asset: null, redirect: e };
2241
2625
  }
2242
2626
  return null;
2243
2627
  };
2244
- var Gt = (t) => t.split("/").map((e) => {
2628
+ var Yt = (t) => t.split("/").map((e) => {
2245
2629
  try {
2246
2630
  return decodeURIComponent(e);
2247
2631
  } catch {
2248
2632
  return e;
2249
2633
  }
2250
2634
  }).join("/");
2251
- var Bs = (t) => t.split("/").map((e) => {
2635
+ var Ws = (t) => t.split("/").map((e) => {
2252
2636
  try {
2253
2637
  return encodeURIComponent(e);
2254
2638
  } catch {
2255
2639
  return e;
2256
2640
  }
2257
2641
  }).join("/");
2258
- async function er(t, e, n, r = 1) {
2642
+ async function fr(t, e, n, r = 1) {
2259
2643
  let s = 0;
2260
2644
  for (; s <= r; ) try {
2261
- let o = await t.getWithMetadata(e, { type: "stream", cacheTtl: 31536e3 });
2262
- if (o.value === null) {
2263
- let i = await t.getWithMetadata(e, { type: "stream", cacheTtl: 60 });
2264
- return i.value !== null && n && n.captureException(new Error(`Initial request for asset ${e} failed, but subsequent request succeeded.`)), i;
2645
+ let i = await t.getWithMetadata(e, { type: "stream", cacheTtl: 31536e3 });
2646
+ if (i.value === null) {
2647
+ let o = await t.getWithMetadata(e, { type: "stream", cacheTtl: 60 });
2648
+ return o.value !== null && n && n.captureException(new Error(`Initial request for asset ${e} failed, but subsequent request succeeded.`)), o;
2265
2649
  }
2266
- return o;
2267
- } catch (o) {
2650
+ return i;
2651
+ } catch (i) {
2268
2652
  if (s >= r) {
2269
- let i = `KV GET ${e} failed.`;
2270
- throw o instanceof Error && (i = `KV GET ${e} failed: ${o.message}`), new Error(i);
2653
+ let o = `KV GET ${e} failed.`;
2654
+ throw i instanceof Error && (o = `KV GET ${e} failed: ${i.message}`), new Error(o);
2271
2655
  }
2272
- await new Promise((i) => setTimeout(i, Math.pow(2, s++) * 1e3));
2656
+ await new Promise((o) => setTimeout(o, Math.pow(2, s++) * 1e3));
2273
2657
  }
2274
2658
  }
2275
- var tr = class extends $s {
2659
+ var pr = class extends zs {
2276
2660
  async fetch(t) {
2277
- let e, n = new Ye(this.env.ANALYTICS), r = new ne(this.env.UNSAFE_PERFORMANCE), s = r.now();
2661
+ let e, n = new Ze(this.env.ANALYTICS), r = new se(this.env.UNSAFE_PERFORMANCE), s = r.now();
2278
2662
  try {
2279
- this.env.JAEGER || (this.env.JAEGER = Jn()), e = Yn(t, this.ctx, this.env.SENTRY_DSN, this.env.SENTRY_ACCESS_CLIENT_ID, this.env.SENTRY_ACCESS_CLIENT_SECRET, this.env.COLO_METADATA, this.env.VERSION_METADATA, this.env.CONFIG?.account_id, this.env.CONFIG?.script_id);
2280
- let o = jt(this.env.CONFIG), i = t.headers.get("user-agent") ?? "UA UNKNOWN", a = new URL(t.url);
2281
- return this.env.COLO_METADATA && this.env.VERSION_METADATA && this.env.CONFIG && n.setData({ accountId: this.env.CONFIG.account_id, scriptId: this.env.CONFIG.script_id, coloId: this.env.COLO_METADATA.coloId, metalId: this.env.COLO_METADATA.metalId, coloTier: this.env.COLO_METADATA.coloTier, coloRegion: this.env.COLO_METADATA.coloRegion, version: this.env.VERSION_METADATA.tag, hostname: a.hostname, htmlHandling: o.html_handling, notFoundHandling: o.not_found_handling, userAgent: i }), await this.env.JAEGER.enterSpan("handleRequest", async (c) => {
2282
- c.setTags({ hostname: a.hostname, eyeballPath: a.pathname, env: this.env.ENVIRONMENT, version: this.env.VERSION_METADATA?.id });
2283
- let u = await Qn(t, this.env, o, this.unstable_exists.bind(this), this.unstable_getByETag.bind(this));
2284
- return n.setData({ status: u.status }), u;
2285
- });
2286
- } catch (o) {
2287
- return this.handleError(e, n, o);
2663
+ this.env.JAEGER || (this.env.JAEGER = ir()), e = sr(t, this.ctx, this.env.SENTRY_DSN, this.env.SENTRY_ACCESS_CLIENT_ID, this.env.SENTRY_ACCESS_CLIENT_SECRET, this.env.COLO_METADATA, this.env.VERSION_METADATA, this.env.CONFIG?.account_id, this.env.CONFIG?.script_id);
2664
+ let i = Ht(this.env.CONFIG), o = t.headers.get("user-agent") ?? "UA UNKNOWN", a = new URL(t.url);
2665
+ return this.env.COLO_METADATA && this.env.VERSION_METADATA && this.env.CONFIG && n.setData({ accountId: this.env.CONFIG.account_id, scriptId: this.env.CONFIG.script_id, coloId: this.env.COLO_METADATA.coloId, metalId: this.env.COLO_METADATA.metalId, coloTier: this.env.COLO_METADATA.coloTier, coloRegion: this.env.COLO_METADATA.coloRegion, version: this.env.VERSION_METADATA.tag, hostname: a.hostname, htmlHandling: i.html_handling, notFoundHandling: i.not_found_handling, userAgent: o }), await this.env.JAEGER.enterSpan("handleRequest", async (c) => (c.setTags({ hostname: a.hostname, eyeballPath: a.pathname, env: this.env.ENVIRONMENT, version: this.env.VERSION_METADATA?.id }), lr(t, this.env, i, this.unstable_exists.bind(this), this.unstable_getByETag.bind(this))));
2666
+ } catch (i) {
2667
+ return this.handleError(e, n, i);
2288
2668
  } finally {
2289
2669
  this.submitMetrics(n, r, s);
2290
2670
  }
2291
2671
  }
2292
2672
  handleError(t, e, n) {
2293
2673
  try {
2294
- let r = new j(n);
2674
+ let r = new $(n);
2295
2675
  return t && t.captureException(n), n instanceof Error && e.setData({ error: n.message }), r;
2296
2676
  } catch (r) {
2297
- return console.error("Error handling error", r), new j(r);
2677
+ return console.error("Error handling error", r), new $(r);
2298
2678
  }
2299
2679
  }
2300
2680
  submitMetrics(t, e, n) {
@@ -2305,11 +2685,11 @@ var tr = class extends $s {
2305
2685
  }
2306
2686
  }
2307
2687
  async unstable_canFetch(t) {
2308
- let e = new URL(t.url), n = Gt(e.pathname);
2309
- return await Ve(n, { ...jt(this.env.CONFIG), not_found_handling: "none" }, this.unstable_exists.bind(this)) !== null;
2688
+ let e = new URL(t.url), n = Yt(e.pathname);
2689
+ return await tt(n, { ...Ht(this.env.CONFIG), not_found_handling: "none" }, this.unstable_exists.bind(this)) !== null;
2310
2690
  }
2311
2691
  async unstable_getByETag(t) {
2312
- let e = await er(this.env.ASSETS_KV_NAMESPACE, t);
2692
+ let e = await fr(this.env.ASSETS_KV_NAMESPACE, t);
2313
2693
  if (!e || !e.value) throw new Error(`Requested asset ${t} exists in the asset manifest but not in the KV namespace.`);
2314
2694
  return { readableStream: e.value, contentType: e.metadata?.contentType ?? "application/octet-stream" };
2315
2695
  }
@@ -2318,19 +2698,19 @@ var tr = class extends $s {
2318
2698
  return e ? this.unstable_getByETag(e) : null;
2319
2699
  }
2320
2700
  async unstable_exists(t) {
2321
- let e = new We(this.env.EXPERIMENT_ANALYTICS), n = new ne(this.env.UNSAFE_PERFORMANCE), r = 0.5, s = "binary";
2701
+ let e = new et(this.env.EXPERIMENT_ANALYTICS), n = new se(this.env.UNSAFE_PERFORMANCE), r = 1 / 100, s = "binary";
2322
2702
  Math.random() < r && (s = "interpolation"), e.setData({ manifestReadMethod: s }), this.env.COLO_METADATA && this.env.VERSION_METADATA && this.env.CONFIG && e.setData({ accountId: this.env.CONFIG.account_id, experimentName: "manifest-read-timing" });
2323
- let o = n.now();
2703
+ let i = n.now();
2324
2704
  try {
2325
- let i = new Je(this.env.ASSETS_MANIFEST);
2705
+ let o = new Qe(this.env.ASSETS_MANIFEST);
2326
2706
  if (s === "interpolation") try {
2327
- return await i.getWithInterpolationSearch(t);
2707
+ return await o.getWithInterpolationSearch(t);
2328
2708
  } catch {
2329
- return e.setData({ manifestReadMethod: "binary-fallback" }), await i.getWithBinarySearch(t);
2709
+ return e.setData({ manifestReadMethod: "binary-fallback" }), await o.getWithBinarySearch(t);
2330
2710
  }
2331
- else return await i.getWithBinarySearch(t);
2711
+ else return await o.getWithBinarySearch(t);
2332
2712
  } finally {
2333
- e.setData({ manifestReadTime: n.now() - o }), e.write();
2713
+ e.setData({ manifestReadTime: n.now() - i }), e.write();
2334
2714
  }
2335
2715
  }
2336
2716
  };
@@ -2343,7 +2723,7 @@ var UNKNOWN_HOST = "http://localhost";
2343
2723
  var MODULE_PATTERN = `__CLOUDFLARE_MODULE__(${MODULE_TYPES.join("|")})__(.*?)__`;
2344
2724
 
2345
2725
  // src/asset-workers/asset-worker.ts
2346
- var CustomAssetWorker = class extends tr {
2726
+ var CustomAssetWorker = class extends pr {
2347
2727
  async fetch(request) {
2348
2728
  const response = await super.fetch(request);
2349
2729
  const modifiedResponse = new Response(response.body, response);