@cloudflare/vite-plugin 0.0.0-ee4873c96 → 0.0.0-efdba4f7f

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