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