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