@cloudflare/vite-plugin 0.0.0-7c05b1b35 → 0.0.0-7d0be5fa7
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/README.md +0 -7
- package/dist/asset-workers/asset-worker.js +187 -194
- package/dist/asset-workers/router-worker.js +74 -78
- package/dist/index.js +18 -52
- package/dist/runner-worker/index.js +1 -1
- package/package.json +5 -5
|
@@ -20,38 +20,8 @@ var ge = class {
|
|
|
20
20
|
return this.performanceTimer ? this.performanceTimer.timeOrigin + this.performanceTimer.now() : Date.now();
|
|
21
21
|
}
|
|
22
22
|
};
|
|
23
|
-
var Ee = class extends Response {
|
|
24
|
-
constructor(e, n) {
|
|
25
|
-
super(e, { ...n, status: 200 });
|
|
26
|
-
}
|
|
27
|
-
};
|
|
28
|
-
var te = class extends Response {
|
|
29
|
-
constructor(...[e, n]) {
|
|
30
|
-
super(e, { ...n, status: 404, statusText: "Not Found" });
|
|
31
|
-
}
|
|
32
|
-
};
|
|
33
|
-
var ye = class extends Response {
|
|
34
|
-
constructor(...[e, n]) {
|
|
35
|
-
super(e, { ...n, status: 405, statusText: "Method Not Allowed" });
|
|
36
|
-
}
|
|
37
|
-
};
|
|
38
|
-
var L = class extends Response {
|
|
39
|
-
constructor(e, n) {
|
|
40
|
-
super(null, { ...n, status: 500 });
|
|
41
|
-
}
|
|
42
|
-
};
|
|
43
|
-
var Se = class extends Response {
|
|
44
|
-
constructor(...[e, n]) {
|
|
45
|
-
super(null, { ...n, status: 304, statusText: "Not Modified" });
|
|
46
|
-
}
|
|
47
|
-
};
|
|
48
|
-
var Te = class extends Response {
|
|
49
|
-
constructor(e, n) {
|
|
50
|
-
super(null, { ...n, status: 307, statusText: "Temporary Redirect", headers: { ...n?.headers, Location: e } });
|
|
51
|
-
}
|
|
52
|
-
};
|
|
53
23
|
var Yt = Object.prototype.toString;
|
|
54
|
-
function
|
|
24
|
+
function L(t) {
|
|
55
25
|
switch (Yt.call(t)) {
|
|
56
26
|
case "[object Error]":
|
|
57
27
|
case "[object Exception]":
|
|
@@ -67,7 +37,7 @@ function jt(t, e) {
|
|
|
67
37
|
function W(t) {
|
|
68
38
|
return jt(t, "String");
|
|
69
39
|
}
|
|
70
|
-
function
|
|
40
|
+
function Ee(t) {
|
|
71
41
|
return t === null || typeof t != "object" && typeof t != "function";
|
|
72
42
|
}
|
|
73
43
|
function I(t) {
|
|
@@ -79,13 +49,13 @@ function tt(t) {
|
|
|
79
49
|
function nt(t) {
|
|
80
50
|
return typeof Element < "u" && k(t, Element);
|
|
81
51
|
}
|
|
82
|
-
function
|
|
52
|
+
function B(t) {
|
|
83
53
|
return !!(t && t.then && typeof t.then == "function");
|
|
84
54
|
}
|
|
85
55
|
function rt(t) {
|
|
86
56
|
return I(t) && "nativeEvent" in t && "preventDefault" in t && "stopPropagation" in t;
|
|
87
57
|
}
|
|
88
|
-
function
|
|
58
|
+
function te(t) {
|
|
89
59
|
return typeof t == "number" && t !== t;
|
|
90
60
|
}
|
|
91
61
|
function k(t, e) {
|
|
@@ -101,20 +71,20 @@ function st(t) {
|
|
|
101
71
|
function M(t, e = 0) {
|
|
102
72
|
return typeof t != "string" || e === 0 || t.length <= e ? t : `${t.slice(0, e)}...`;
|
|
103
73
|
}
|
|
104
|
-
function
|
|
74
|
+
function ye(t) {
|
|
105
75
|
return t && t.Math == Math ? t : void 0;
|
|
106
76
|
}
|
|
107
|
-
var h = typeof globalThis == "object" &&
|
|
77
|
+
var h = typeof globalThis == "object" && ye(globalThis) || typeof window == "object" && ye(window) || typeof self == "object" && ye(self) || typeof global == "object" && ye(global) || /* @__PURE__ */ function() {
|
|
108
78
|
return this;
|
|
109
79
|
}() || {};
|
|
110
80
|
function A() {
|
|
111
81
|
return h;
|
|
112
82
|
}
|
|
113
|
-
function
|
|
83
|
+
function ne(t, e, n) {
|
|
114
84
|
let r = n || h, s = r.__SENTRY__ = r.__SENTRY__ || {};
|
|
115
85
|
return s[t] || (s[t] = e());
|
|
116
86
|
}
|
|
117
|
-
var
|
|
87
|
+
var zs = A();
|
|
118
88
|
var or = 80;
|
|
119
89
|
function qt(t, e = {}) {
|
|
120
90
|
if (!t) return "<unknown>";
|
|
@@ -140,9 +110,9 @@ function ar(t, e) {
|
|
|
140
110
|
return r.join("");
|
|
141
111
|
}
|
|
142
112
|
var cr = "Sentry Logger ";
|
|
143
|
-
var
|
|
113
|
+
var re = ["debug", "info", "warn", "error", "log", "assert", "trace"];
|
|
144
114
|
var z = {};
|
|
145
|
-
function
|
|
115
|
+
function Se(t) {
|
|
146
116
|
if (!("console" in h)) return t();
|
|
147
117
|
let e = h.console, n = {}, r = Object.keys(z);
|
|
148
118
|
r.forEach((s) => {
|
|
@@ -163,13 +133,13 @@ function ur() {
|
|
|
163
133
|
}, disable: () => {
|
|
164
134
|
t = false;
|
|
165
135
|
}, isEnabled: () => t };
|
|
166
|
-
return typeof __SENTRY_DEBUG__ > "u" || __SENTRY_DEBUG__ ?
|
|
136
|
+
return typeof __SENTRY_DEBUG__ > "u" || __SENTRY_DEBUG__ ? re.forEach((n) => {
|
|
167
137
|
e[n] = (...r) => {
|
|
168
|
-
t &&
|
|
138
|
+
t && Se(() => {
|
|
169
139
|
h.console[n](`${cr}[${n}]:`, ...r);
|
|
170
140
|
});
|
|
171
141
|
};
|
|
172
|
-
}) :
|
|
142
|
+
}) : re.forEach((n) => {
|
|
173
143
|
e[n] = () => {
|
|
174
144
|
};
|
|
175
145
|
}), e;
|
|
@@ -204,7 +174,7 @@ function fr(t) {
|
|
|
204
174
|
let { port: e, projectId: n, protocol: r } = t;
|
|
205
175
|
return ["protocol", "publicKey", "host", "projectId"].find((o) => t[o] ? false : (f.error(`Invalid Sentry Dsn: ${o} missing`), true)) ? false : n.match(/^\d+$/) ? lr(r) ? e && isNaN(parseInt(e, 10)) ? (f.error(`Invalid Sentry Dsn: Invalid port ${e}`), false) : true : (f.error(`Invalid Sentry Dsn: Invalid protocol ${r}`), false) : (f.error(`Invalid Sentry Dsn: Invalid projectId ${n}`), false);
|
|
206
176
|
}
|
|
207
|
-
function
|
|
177
|
+
function Te(t) {
|
|
208
178
|
let e = typeof t == "string" ? Wt(t) : zt(t);
|
|
209
179
|
if (!(!e || !fr(e))) return e;
|
|
210
180
|
}
|
|
@@ -235,8 +205,8 @@ function Kt(t, e) {
|
|
|
235
205
|
function ot(t) {
|
|
236
206
|
return Object.keys(t).map((e) => `${encodeURIComponent(e)}=${encodeURIComponent(t[e])}`).join("&");
|
|
237
207
|
}
|
|
238
|
-
function
|
|
239
|
-
if (
|
|
208
|
+
function be(t) {
|
|
209
|
+
if (L(t)) return { message: t.message, name: t.name, stack: t.stack, ...Jt(t) };
|
|
240
210
|
if (tt(t)) {
|
|
241
211
|
let e = { type: t.type, target: Vt(t.target), currentTarget: Vt(t.currentTarget), ...Jt(t) };
|
|
242
212
|
return typeof CustomEvent < "u" && k(t, CustomEvent) && (e.detail = t.detail), e;
|
|
@@ -256,8 +226,8 @@ function Jt(t) {
|
|
|
256
226
|
return e;
|
|
257
227
|
} else return {};
|
|
258
228
|
}
|
|
259
|
-
function
|
|
260
|
-
let n = Object.keys(
|
|
229
|
+
function se(t, e = 40) {
|
|
230
|
+
let n = Object.keys(be(t));
|
|
261
231
|
if (n.sort(), !n.length) return "[object has no keys]";
|
|
262
232
|
if (n[0].length >= e) return M(n[0], e);
|
|
263
233
|
for (let r = n.length; r > 0; r--) {
|
|
@@ -317,7 +287,7 @@ function Xt(t) {
|
|
|
317
287
|
var en = 50;
|
|
318
288
|
var Zt = /\(error: (.*)\)/;
|
|
319
289
|
var Qt = /captureMessage|captureException/;
|
|
320
|
-
function
|
|
290
|
+
function Re(...t) {
|
|
321
291
|
let e = t.sort((n, r) => n[0] - r[0]).map((n) => n[1]);
|
|
322
292
|
return (n, r = 0) => {
|
|
323
293
|
let s = [], i = n.split(`
|
|
@@ -341,7 +311,7 @@ function Ae(...t) {
|
|
|
341
311
|
};
|
|
342
312
|
}
|
|
343
313
|
function ct(t) {
|
|
344
|
-
return Array.isArray(t) ?
|
|
314
|
+
return Array.isArray(t) ? Re(...t) : t;
|
|
345
315
|
}
|
|
346
316
|
function tn(t) {
|
|
347
317
|
if (!t.length) return [];
|
|
@@ -349,7 +319,7 @@ function tn(t) {
|
|
|
349
319
|
return /sentryWrapped/.test(e[e.length - 1].function || "") && e.pop(), e.reverse(), Qt.test(e[e.length - 1].function || "") && (e.pop(), Qt.test(e[e.length - 1].function || "") && e.pop()), e.slice(0, en).map((n) => ({ ...n, filename: n.filename || e[e.length - 1].filename, function: n.function || "?" }));
|
|
350
320
|
}
|
|
351
321
|
var at = "<anonymous>";
|
|
352
|
-
function
|
|
322
|
+
function ie(t) {
|
|
353
323
|
try {
|
|
354
324
|
return !t || typeof t != "function" ? at : t.name || at;
|
|
355
325
|
} catch {
|
|
@@ -383,14 +353,14 @@ function rn() {
|
|
|
383
353
|
}
|
|
384
354
|
return t;
|
|
385
355
|
}
|
|
386
|
-
var
|
|
356
|
+
var xe = A();
|
|
387
357
|
function sn() {
|
|
388
|
-
let t =
|
|
358
|
+
let t = xe.chrome, e = t && t.app && t.app.runtime, n = "history" in xe && !!xe.history.pushState && !!xe.history.replaceState;
|
|
389
359
|
return !e && n;
|
|
390
360
|
}
|
|
391
361
|
var y = A();
|
|
392
|
-
var
|
|
393
|
-
var
|
|
362
|
+
var oe = "__sentry_xhr_v2__";
|
|
363
|
+
var ae = {};
|
|
394
364
|
var on = {};
|
|
395
365
|
function hr(t) {
|
|
396
366
|
if (!on[t]) switch (on[t] = true, t) {
|
|
@@ -420,21 +390,21 @@ function hr(t) {
|
|
|
420
390
|
return;
|
|
421
391
|
}
|
|
422
392
|
}
|
|
423
|
-
function
|
|
424
|
-
|
|
393
|
+
function we(t, e) {
|
|
394
|
+
ae[t] = ae[t] || [], ae[t].push(e), hr(t);
|
|
425
395
|
}
|
|
426
396
|
function D(t, e) {
|
|
427
|
-
if (!(!t || !
|
|
397
|
+
if (!(!t || !ae[t])) for (let n of ae[t] || []) try {
|
|
428
398
|
n(e);
|
|
429
399
|
} catch (r) {
|
|
430
400
|
(typeof __SENTRY_DEBUG__ > "u" || __SENTRY_DEBUG__) && f.error(`Error while triggering instrumentation handler.
|
|
431
401
|
Type: ${t}
|
|
432
|
-
Name: ${
|
|
402
|
+
Name: ${ie(n)}
|
|
433
403
|
Error:`, r);
|
|
434
404
|
}
|
|
435
405
|
}
|
|
436
406
|
function _r() {
|
|
437
|
-
"console" in h &&
|
|
407
|
+
"console" in h && re.forEach(function(t) {
|
|
438
408
|
t in h.console && N(h.console, t, function(e) {
|
|
439
409
|
return z[t] = e, function(...n) {
|
|
440
410
|
D("console", { args: n, level: t });
|
|
@@ -474,10 +444,10 @@ function ln() {
|
|
|
474
444
|
let t = XMLHttpRequest.prototype;
|
|
475
445
|
N(t, "open", function(e) {
|
|
476
446
|
return function(...n) {
|
|
477
|
-
let r = Date.now(), s = n[1], i = this[
|
|
447
|
+
let r = Date.now(), s = n[1], i = this[oe] = { method: W(n[0]) ? n[0].toUpperCase() : n[0], url: n[1], request_headers: {} };
|
|
478
448
|
W(s) && i.method === "POST" && s.match(/sentry_key/) && (this.__sentry_own_request__ = true);
|
|
479
449
|
let o = () => {
|
|
480
|
-
let a = this[
|
|
450
|
+
let a = this[oe];
|
|
481
451
|
if (a && this.readyState === 4) {
|
|
482
452
|
try {
|
|
483
453
|
a.status_code = this.status;
|
|
@@ -492,25 +462,25 @@ function ln() {
|
|
|
492
462
|
};
|
|
493
463
|
}) : this.addEventListener("readystatechange", o), N(this, "setRequestHeader", function(a) {
|
|
494
464
|
return function(...c) {
|
|
495
|
-
let [u, l] = c, d = this[
|
|
465
|
+
let [u, l] = c, d = this[oe];
|
|
496
466
|
return d && (d.request_headers[u.toLowerCase()] = l), a.apply(this, c);
|
|
497
467
|
};
|
|
498
468
|
}), e.apply(this, n);
|
|
499
469
|
};
|
|
500
470
|
}), N(t, "send", function(e) {
|
|
501
471
|
return function(...n) {
|
|
502
|
-
let r = this[
|
|
472
|
+
let r = this[oe];
|
|
503
473
|
return r && n[0] !== void 0 && (r.body = n[0]), D("xhr", { args: n, startTimestamp: Date.now(), xhr: this }), e.apply(this, n);
|
|
504
474
|
};
|
|
505
475
|
});
|
|
506
476
|
}
|
|
507
|
-
var
|
|
477
|
+
var Ie;
|
|
508
478
|
function Er() {
|
|
509
479
|
if (!sn()) return;
|
|
510
480
|
let t = y.onpopstate;
|
|
511
481
|
y.onpopstate = function(...n) {
|
|
512
|
-
let r = y.location.href, s =
|
|
513
|
-
if (
|
|
482
|
+
let r = y.location.href, s = Ie;
|
|
483
|
+
if (Ie = r, D("history", { from: s, to: r }), t) try {
|
|
514
484
|
return t.apply(this, n);
|
|
515
485
|
} catch {
|
|
516
486
|
}
|
|
@@ -519,8 +489,8 @@ function Er() {
|
|
|
519
489
|
return function(...r) {
|
|
520
490
|
let s = r.length > 2 ? r[2] : void 0;
|
|
521
491
|
if (s) {
|
|
522
|
-
let i =
|
|
523
|
-
|
|
492
|
+
let i = Ie, o = String(s);
|
|
493
|
+
Ie = o, D("history", { from: i, to: o });
|
|
524
494
|
}
|
|
525
495
|
return n.apply(this, r);
|
|
526
496
|
};
|
|
@@ -529,7 +499,7 @@ function Er() {
|
|
|
529
499
|
}
|
|
530
500
|
var yr = 1e3;
|
|
531
501
|
var cn;
|
|
532
|
-
var
|
|
502
|
+
var Ne;
|
|
533
503
|
function Sr(t, e) {
|
|
534
504
|
if (t.type !== e.type) return false;
|
|
535
505
|
try {
|
|
@@ -553,8 +523,8 @@ function un(t, e = false) {
|
|
|
553
523
|
if (!n || n._sentryCaptured || Tr(n)) return;
|
|
554
524
|
V(n, "_sentryCaptured", true);
|
|
555
525
|
let r = n.type === "keypress" ? "input" : n.type;
|
|
556
|
-
(
|
|
557
|
-
|
|
526
|
+
(Ne === void 0 || !Sr(Ne, n)) && (t({ event: n, name: r, global: e }), Ne = n), clearTimeout(cn), cn = y.setTimeout(() => {
|
|
527
|
+
Ne = void 0;
|
|
558
528
|
}, yr);
|
|
559
529
|
};
|
|
560
530
|
}
|
|
@@ -588,16 +558,16 @@ function fn() {
|
|
|
588
558
|
}));
|
|
589
559
|
});
|
|
590
560
|
}
|
|
591
|
-
var
|
|
561
|
+
var Ae = null;
|
|
592
562
|
function br() {
|
|
593
|
-
|
|
594
|
-
return D("error", { column: r, error: s, line: n, msg: t, url: e }),
|
|
563
|
+
Ae = y.onerror, y.onerror = function(t, e, n, r, s) {
|
|
564
|
+
return D("error", { column: r, error: s, line: n, msg: t, url: e }), Ae && !Ae.__SENTRY_LOADER__ ? Ae.apply(this, arguments) : false;
|
|
595
565
|
}, y.onerror.__SENTRY_INSTRUMENTED__ = true;
|
|
596
566
|
}
|
|
597
|
-
var
|
|
567
|
+
var De = null;
|
|
598
568
|
function Rr() {
|
|
599
|
-
|
|
600
|
-
return D("unhandledrejection", t),
|
|
569
|
+
De = y.onunhandledrejection, y.onunhandledrejection = function(t) {
|
|
570
|
+
return D("unhandledrejection", t), De && !De.__SENTRY_LOADER__ ? De.apply(this, arguments) : true;
|
|
601
571
|
}, y.onunhandledrejection.__SENTRY_INSTRUMENTED__ = true;
|
|
602
572
|
}
|
|
603
573
|
function pn() {
|
|
@@ -637,11 +607,11 @@ function g() {
|
|
|
637
607
|
function xr(t) {
|
|
638
608
|
return t.exception && t.exception.values ? t.exception.values[0] : void 0;
|
|
639
609
|
}
|
|
640
|
-
function
|
|
610
|
+
function ce(t, e, n) {
|
|
641
611
|
let r = t.exception = t.exception || {}, s = r.values = r.values || [], i = s[0] = s[0] || {};
|
|
642
612
|
i.value || (i.value = e || ""), i.type || (i.type = n || "Error");
|
|
643
613
|
}
|
|
644
|
-
function
|
|
614
|
+
function ue(t, e) {
|
|
645
615
|
let n = xr(t);
|
|
646
616
|
if (!n) return;
|
|
647
617
|
let r = { type: "generic", handled: true }, s = n.mechanism;
|
|
@@ -650,7 +620,7 @@ function de(t, e) {
|
|
|
650
620
|
n.mechanism.data = i;
|
|
651
621
|
}
|
|
652
622
|
}
|
|
653
|
-
function
|
|
623
|
+
function Oe(t) {
|
|
654
624
|
if (t && t.__sentry_captured__) return true;
|
|
655
625
|
try {
|
|
656
626
|
V(t, "__sentry_captured__", true);
|
|
@@ -658,12 +628,12 @@ function Pe(t) {
|
|
|
658
628
|
}
|
|
659
629
|
return false;
|
|
660
630
|
}
|
|
661
|
-
function
|
|
631
|
+
function de(t) {
|
|
662
632
|
return Array.isArray(t) ? t : [t];
|
|
663
633
|
}
|
|
664
634
|
function w(t, e = 100, n = 1 / 0) {
|
|
665
635
|
try {
|
|
666
|
-
return
|
|
636
|
+
return ve("", t, e, n);
|
|
667
637
|
} catch (r) {
|
|
668
638
|
return { ERROR: `**non-serializable** (${r})` };
|
|
669
639
|
}
|
|
@@ -672,9 +642,9 @@ function J(t, e = 3, n = 100 * 1024) {
|
|
|
672
642
|
let r = w(t, e);
|
|
673
643
|
return Dr(r) > n ? J(t, e - 1, n) : r;
|
|
674
644
|
}
|
|
675
|
-
function
|
|
645
|
+
function ve(t, e, n = 1 / 0, r = 1 / 0, s = _n()) {
|
|
676
646
|
let [i, o] = s;
|
|
677
|
-
if (e == null || ["number", "boolean", "string"].includes(typeof e) && !
|
|
647
|
+
if (e == null || ["number", "boolean", "string"].includes(typeof e) && !te(e)) return e;
|
|
678
648
|
let a = Ir(t, e);
|
|
679
649
|
if (!a.startsWith("[object ")) return a;
|
|
680
650
|
if (e.__sentry_skip_normalization__) return e;
|
|
@@ -684,10 +654,10 @@ function Me(t, e, n = 1 / 0, r = 1 / 0, s = _n()) {
|
|
|
684
654
|
let u = e;
|
|
685
655
|
if (u && typeof u.toJSON == "function") try {
|
|
686
656
|
let m = u.toJSON();
|
|
687
|
-
return
|
|
657
|
+
return ve("", m, c - 1, r, s);
|
|
688
658
|
} catch {
|
|
689
659
|
}
|
|
690
|
-
let l = Array.isArray(e) ? [] : {}, d = 0, p =
|
|
660
|
+
let l = Array.isArray(e) ? [] : {}, d = 0, p = be(e);
|
|
691
661
|
for (let m in p) {
|
|
692
662
|
if (!Object.prototype.hasOwnProperty.call(p, m)) continue;
|
|
693
663
|
if (d >= r) {
|
|
@@ -695,7 +665,7 @@ function Me(t, e, n = 1 / 0, r = 1 / 0, s = _n()) {
|
|
|
695
665
|
break;
|
|
696
666
|
}
|
|
697
667
|
let v = p[m];
|
|
698
|
-
l[m] =
|
|
668
|
+
l[m] = ve(m, v, c - 1, r, s), d++;
|
|
699
669
|
}
|
|
700
670
|
return o(e), l;
|
|
701
671
|
}
|
|
@@ -709,7 +679,7 @@ function Ir(t, e) {
|
|
|
709
679
|
if (st(e)) return "[VueViewModel]";
|
|
710
680
|
if (rt(e)) return "[SyntheticEvent]";
|
|
711
681
|
if (typeof e == "number" && e !== e) return "[NaN]";
|
|
712
|
-
if (typeof e == "function") return `[Function: ${
|
|
682
|
+
if (typeof e == "function") return `[Function: ${ie(e)}]`;
|
|
713
683
|
if (typeof e == "symbol") return `[${String(e)}]`;
|
|
714
684
|
if (typeof e == "bigint") return `[BigInt: ${String(e)}]`;
|
|
715
685
|
let n = Nr(e);
|
|
@@ -750,7 +720,7 @@ function b(t) {
|
|
|
750
720
|
e(t);
|
|
751
721
|
});
|
|
752
722
|
}
|
|
753
|
-
function
|
|
723
|
+
function F(t) {
|
|
754
724
|
return new S((e, n) => {
|
|
755
725
|
n(t);
|
|
756
726
|
});
|
|
@@ -815,7 +785,7 @@ var S = class {
|
|
|
815
785
|
__init3() {
|
|
816
786
|
this._setResult = (e, n) => {
|
|
817
787
|
if (this._state === C.PENDING) {
|
|
818
|
-
if (
|
|
788
|
+
if (B(n)) {
|
|
819
789
|
n.then(this._resolve, this._reject);
|
|
820
790
|
return;
|
|
821
791
|
}
|
|
@@ -842,7 +812,7 @@ function pt(t) {
|
|
|
842
812
|
return e.splice(e.indexOf(o), 1)[0];
|
|
843
813
|
}
|
|
844
814
|
function s(o) {
|
|
845
|
-
if (!n()) return
|
|
815
|
+
if (!n()) return F(new T("Not adding Promise because buffer limit was reached."));
|
|
846
816
|
let a = o();
|
|
847
817
|
return e.indexOf(a) === -1 && e.push(a), a.then(() => r(a)).then(null, () => r(a).then(null, () => {
|
|
848
818
|
})), a;
|
|
@@ -880,17 +850,17 @@ function kr() {
|
|
|
880
850
|
}
|
|
881
851
|
var mt = mn() ? kr() : vr();
|
|
882
852
|
var gn = mt === void 0 ? ht : { nowSeconds: () => (mt.timeOrigin + mt.now()) / 1e3 };
|
|
883
|
-
var
|
|
884
|
-
var
|
|
885
|
-
var
|
|
853
|
+
var $ = ht.nowSeconds.bind(ht);
|
|
854
|
+
var H = gn.nowSeconds.bind(gn);
|
|
855
|
+
var le;
|
|
886
856
|
var Cr = (() => {
|
|
887
857
|
let { performance: t } = En;
|
|
888
858
|
if (!t || !t.now) {
|
|
889
|
-
|
|
859
|
+
le = "none";
|
|
890
860
|
return;
|
|
891
861
|
}
|
|
892
862
|
let e = 3600 * 1e3, n = t.now(), r = Date.now(), s = t.timeOrigin ? Math.abs(t.timeOrigin + n - r) : e, i = s < e, o = t.timing && t.timing.navigationStart, c = typeof o == "number" ? Math.abs(o + n - r) : e, u = c < e;
|
|
893
|
-
return i || u ? s <= c ? (
|
|
863
|
+
return i || u ? s <= c ? (le = "timeOrigin", t.timeOrigin) : (le = "navigationStart", o) : (le = "dateNow", r);
|
|
894
864
|
})();
|
|
895
865
|
var Pr = new RegExp("^[ \\t]*([0-9a-f]{32})?-?([0-9a-f]{16})?-?([01])?[ \\t]*$");
|
|
896
866
|
function _t(t = g(), e = g().substring(16), n) {
|
|
@@ -904,7 +874,7 @@ function Et(t, e) {
|
|
|
904
874
|
let [n, r] = t;
|
|
905
875
|
return [n, [...r, e]];
|
|
906
876
|
}
|
|
907
|
-
function
|
|
877
|
+
function ke(t, e) {
|
|
908
878
|
let n = t[1];
|
|
909
879
|
for (let r of n) {
|
|
910
880
|
let s = r[0].type;
|
|
@@ -947,10 +917,10 @@ function St(t, e) {
|
|
|
947
917
|
return [E({ type: "attachment", length: n.length, filename: t.filename, content_type: t.contentType, attachment_type: t.attachmentType }), n];
|
|
948
918
|
}
|
|
949
919
|
var Ur = { session: "session", sessions: "session", attachment: "attachment", transaction: "transaction", event: "error", client_report: "internal", user_report: "default", profile: "profile", replay_event: "replay", replay_recording: "replay", check_in: "monitor", statsd: "unknown" };
|
|
950
|
-
function
|
|
920
|
+
function Ce(t) {
|
|
951
921
|
return Ur[t];
|
|
952
922
|
}
|
|
953
|
-
function
|
|
923
|
+
function Pe(t) {
|
|
954
924
|
if (!t || !t.sdk) return;
|
|
955
925
|
let { name: e, version: n } = t.sdk;
|
|
956
926
|
return { name: e, version: n };
|
|
@@ -992,11 +962,11 @@ function Gr(t) {
|
|
|
992
962
|
if ("name" in t && typeof t.name == "string") {
|
|
993
963
|
let e = `'${t.name}' captured as exception`;
|
|
994
964
|
return "message" in t && typeof t.message == "string" && (e += ` with message '${t.message}'`), e;
|
|
995
|
-
} else return "message" in t && typeof t.message == "string" ? t.message : `Object captured as exception with keys: ${
|
|
965
|
+
} else return "message" in t && typeof t.message == "string" ? t.message : `Object captured as exception with keys: ${se(t)}`;
|
|
996
966
|
}
|
|
997
967
|
function It(t, e, n, r) {
|
|
998
968
|
let s = n, o = r && r.data && r.data.mechanism || { handled: true, type: "generic" };
|
|
999
|
-
if (!
|
|
969
|
+
if (!L(n)) {
|
|
1000
970
|
if (I(n)) {
|
|
1001
971
|
let c = t(), u = c.getClient(), l = u && u.getOptions().normalizeDepth;
|
|
1002
972
|
c.configureScope((p) => {
|
|
@@ -1008,7 +978,7 @@ function It(t, e, n, r) {
|
|
|
1008
978
|
o.synthetic = true;
|
|
1009
979
|
}
|
|
1010
980
|
let a = { exception: { values: [Tn(e, s)] } };
|
|
1011
|
-
return
|
|
981
|
+
return ce(a, void 0, void 0), ue(a, o), { ...a, event_id: r && r.event_id };
|
|
1012
982
|
}
|
|
1013
983
|
function Nt(t, e, n = "info", r, s) {
|
|
1014
984
|
let i = { event_id: r && r.event_id, level: n, message: e };
|
|
@@ -1019,11 +989,11 @@ function Nt(t, e, n = "info", r, s) {
|
|
|
1019
989
|
return i;
|
|
1020
990
|
}
|
|
1021
991
|
var K = "production";
|
|
1022
|
-
function
|
|
1023
|
-
return
|
|
992
|
+
function fe() {
|
|
993
|
+
return ne("globalEventProcessors", () => []);
|
|
1024
994
|
}
|
|
1025
995
|
function bn(t) {
|
|
1026
|
-
|
|
996
|
+
fe().push(t);
|
|
1027
997
|
}
|
|
1028
998
|
function X(t, e, n, r = 0) {
|
|
1029
999
|
return new S((s, i) => {
|
|
@@ -1031,16 +1001,16 @@ function X(t, e, n, r = 0) {
|
|
|
1031
1001
|
if (e === null || typeof o != "function") s(e);
|
|
1032
1002
|
else {
|
|
1033
1003
|
let a = o({ ...e }, n);
|
|
1034
|
-
(typeof __SENTRY_DEBUG__ > "u" || __SENTRY_DEBUG__) && o.id && a === null && f.log(`Event processor "${o.id}" dropped event`),
|
|
1004
|
+
(typeof __SENTRY_DEBUG__ > "u" || __SENTRY_DEBUG__) && o.id && a === null && f.log(`Event processor "${o.id}" dropped event`), B(a) ? a.then((c) => X(t, c, n, r + 1).then(s)).then(null, i) : X(t, a, n, r + 1).then(s).then(null, i);
|
|
1035
1005
|
}
|
|
1036
1006
|
});
|
|
1037
1007
|
}
|
|
1038
1008
|
function Rn(t) {
|
|
1039
|
-
let e =
|
|
1009
|
+
let e = H(), n = { sid: g(), init: true, timestamp: e, started: e, duration: 0, status: "ok", errors: 0, ignoreDuration: false, toJSON: () => Lr(n) };
|
|
1040
1010
|
return t && P(n, t), n;
|
|
1041
1011
|
}
|
|
1042
1012
|
function P(t, e = {}) {
|
|
1043
|
-
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 ||
|
|
1013
|
+
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 || H(), e.abnormal_mechanism && (t.abnormal_mechanism = e.abnormal_mechanism), e.ignoreDuration && (t.ignoreDuration = e.ignoreDuration), e.sid && (t.sid = e.sid.length === 32 ? e.sid : g()), e.init !== void 0 && (t.init = e.init), !t.did && e.did && (t.did = `${e.did}`), typeof e.started == "number" && (t.started = e.started), t.ignoreDuration) t.duration = void 0;
|
|
1044
1014
|
else if (typeof e.duration == "number") t.duration = e.duration;
|
|
1045
1015
|
else {
|
|
1046
1016
|
let n = t.timestamp - t.started;
|
|
@@ -1136,7 +1106,7 @@ var O = class {
|
|
|
1136
1106
|
addBreadcrumb(e, n) {
|
|
1137
1107
|
let r = typeof n == "number" ? n : Br;
|
|
1138
1108
|
if (r <= 0) return this;
|
|
1139
|
-
let s = { timestamp:
|
|
1109
|
+
let s = { timestamp: $(), ...e }, i = this._breadcrumbs;
|
|
1140
1110
|
return i.push(s), this._breadcrumbs = i.length > r ? i.slice(-r) : i, this._notifyScopeListeners(), this;
|
|
1141
1111
|
}
|
|
1142
1112
|
getLastBreadcrumb() {
|
|
@@ -1166,7 +1136,7 @@ var O = class {
|
|
|
1166
1136
|
}
|
|
1167
1137
|
this._applyFingerprint(e);
|
|
1168
1138
|
let s = this._getBreadcrumbs(), i = [...e.breadcrumbs || [], ...s];
|
|
1169
|
-
return e.breadcrumbs = i.length > 0 ? i : void 0, e.sdkProcessingMetadata = { ...e.sdkProcessingMetadata, ...this._sdkProcessingMetadata, propagationContext: this._propagationContext }, X([...r || [], ...
|
|
1139
|
+
return e.breadcrumbs = i.length > 0 ? i : void 0, e.sdkProcessingMetadata = { ...e.sdkProcessingMetadata, ...this._sdkProcessingMetadata, propagationContext: this._propagationContext }, X([...r || [], ...fe(), ...this._eventProcessors], e, n);
|
|
1170
1140
|
}
|
|
1171
1141
|
setSDKProcessingMetadata(e) {
|
|
1172
1142
|
return this._sdkProcessingMetadata = { ...this._sdkProcessingMetadata, ...e }, this;
|
|
@@ -1186,7 +1156,7 @@ var O = class {
|
|
|
1186
1156
|
}), this._notifyingListeners = false);
|
|
1187
1157
|
}
|
|
1188
1158
|
_applyFingerprint(e) {
|
|
1189
|
-
e.fingerprint = e.fingerprint ?
|
|
1159
|
+
e.fingerprint = e.fingerprint ? de(e.fingerprint) : [], this._fingerprint && (e.fingerprint = e.fingerprint.concat(this._fingerprint)), e.fingerprint && !e.fingerprint.length && delete e.fingerprint;
|
|
1190
1160
|
}
|
|
1191
1161
|
};
|
|
1192
1162
|
function In() {
|
|
@@ -1194,7 +1164,7 @@ function In() {
|
|
|
1194
1164
|
}
|
|
1195
1165
|
var Nn = 4;
|
|
1196
1166
|
var Fr = 100;
|
|
1197
|
-
var
|
|
1167
|
+
var Y = class {
|
|
1198
1168
|
constructor(e, n = new O(), r = Nn) {
|
|
1199
1169
|
this._version = r, this._stack = [{ scope: n }], e && this.bindClient(e);
|
|
1200
1170
|
}
|
|
@@ -1258,7 +1228,7 @@ var j = class {
|
|
|
1258
1228
|
if (!s) return;
|
|
1259
1229
|
let { beforeBreadcrumb: i = null, maxBreadcrumbs: o = Fr } = s.getOptions && s.getOptions() || {};
|
|
1260
1230
|
if (o <= 0) return;
|
|
1261
|
-
let c = { timestamp:
|
|
1231
|
+
let c = { timestamp: $(), ...e }, u = i ? Se(() => i(c, n)) : c;
|
|
1262
1232
|
u !== null && (s.emit && s.emit("beforeAddBreadcrumb", u, n), r.addBreadcrumb(u, o));
|
|
1263
1233
|
}
|
|
1264
1234
|
setUser(e) {
|
|
@@ -1339,34 +1309,34 @@ Sentry.init({...});
|
|
|
1339
1309
|
r && e(r, n);
|
|
1340
1310
|
}
|
|
1341
1311
|
_callExtensionMethod(e, ...n) {
|
|
1342
|
-
let s =
|
|
1312
|
+
let s = j().__SENTRY__;
|
|
1343
1313
|
if (s && s.extensions && typeof s.extensions[e] == "function") return s.extensions[e].apply(this, n);
|
|
1344
1314
|
(typeof __SENTRY_DEBUG__ > "u" || __SENTRY_DEBUG__) && f.warn(`Extension method ${e} couldn't be found, doing nothing.`);
|
|
1345
1315
|
}
|
|
1346
1316
|
};
|
|
1347
|
-
function
|
|
1317
|
+
function j() {
|
|
1348
1318
|
return h.__SENTRY__ = h.__SENTRY__ || { extensions: {}, hub: void 0 }, h;
|
|
1349
1319
|
}
|
|
1350
1320
|
function At(t) {
|
|
1351
|
-
let e =
|
|
1321
|
+
let e = j(), n = Me(e);
|
|
1352
1322
|
return Dt(e, t), n;
|
|
1353
1323
|
}
|
|
1354
1324
|
function R() {
|
|
1355
|
-
let t =
|
|
1325
|
+
let t = j();
|
|
1356
1326
|
if (t.__SENTRY__ && t.__SENTRY__.acs) {
|
|
1357
1327
|
let e = t.__SENTRY__.acs.getCurrentHub();
|
|
1358
1328
|
if (e) return e;
|
|
1359
1329
|
}
|
|
1360
1330
|
return $r(t);
|
|
1361
1331
|
}
|
|
1362
|
-
function $r(t =
|
|
1363
|
-
return (!Hr(t) ||
|
|
1332
|
+
function $r(t = j()) {
|
|
1333
|
+
return (!Hr(t) || Me(t).isOlderThan(Nn)) && Dt(t, new Y()), Me(t);
|
|
1364
1334
|
}
|
|
1365
1335
|
function Hr(t) {
|
|
1366
1336
|
return !!(t && t.__SENTRY__ && t.__SENTRY__.hub);
|
|
1367
1337
|
}
|
|
1368
|
-
function
|
|
1369
|
-
return
|
|
1338
|
+
function Me(t) {
|
|
1339
|
+
return ne("hub", () => new Y(), t);
|
|
1370
1340
|
}
|
|
1371
1341
|
function Dt(t, e) {
|
|
1372
1342
|
if (!t) return false;
|
|
@@ -1378,7 +1348,7 @@ function An(t) {
|
|
|
1378
1348
|
}
|
|
1379
1349
|
var Dn = false;
|
|
1380
1350
|
function wn() {
|
|
1381
|
-
Dn || (Dn = true,
|
|
1351
|
+
Dn || (Dn = true, we("error", wt), we("unhandledrejection", wt));
|
|
1382
1352
|
}
|
|
1383
1353
|
function wt() {
|
|
1384
1354
|
let t = An();
|
|
@@ -1388,7 +1358,7 @@ function wt() {
|
|
|
1388
1358
|
}
|
|
1389
1359
|
}
|
|
1390
1360
|
wt.tag = "sentry_tracingErrorCallback";
|
|
1391
|
-
var
|
|
1361
|
+
var Ue = class {
|
|
1392
1362
|
constructor(e = 1e3) {
|
|
1393
1363
|
this._maxlen = e, this.spans = [];
|
|
1394
1364
|
}
|
|
@@ -1398,7 +1368,7 @@ var Fe = class {
|
|
|
1398
1368
|
};
|
|
1399
1369
|
var Z = class {
|
|
1400
1370
|
constructor(e = {}) {
|
|
1401
|
-
this.traceId = e.traceId || g(), this.spanId = e.spanId || g().substring(16), this.startTimestamp = e.startTimestamp ||
|
|
1371
|
+
this.traceId = e.traceId || g(), this.spanId = e.spanId || g().substring(16), this.startTimestamp = e.startTimestamp || H(), this.tags = e.tags || {}, this.data = e.data || {}, this.instrumenter = e.instrumenter || "sentry", this.origin = e.origin || "manual", e.parentSpanId && (this.parentSpanId = e.parentSpanId), "sampled" in e && (this.sampled = e.sampled), e.op && (this.op = e.op), e.description && (this.description = e.description), e.name && (this.description = e.name), e.status && (this.status = e.status), e.endTimestamp && (this.endTimestamp = e.endTimestamp);
|
|
1402
1372
|
}
|
|
1403
1373
|
get name() {
|
|
1404
1374
|
return this.description || "";
|
|
@@ -1439,7 +1409,7 @@ var Z = class {
|
|
|
1439
1409
|
let { logMessage: n } = this.transaction.metadata.spanMetadata[this.spanId];
|
|
1440
1410
|
n && f.log(n.replace("Starting", "Finishing"));
|
|
1441
1411
|
}
|
|
1442
|
-
this.endTimestamp = typeof e == "number" ? e :
|
|
1412
|
+
this.endTimestamp = typeof e == "number" ? e : H();
|
|
1443
1413
|
}
|
|
1444
1414
|
toTraceparent() {
|
|
1445
1415
|
return _t(this.traceId, this.spanId, this.sampled);
|
|
@@ -1491,7 +1461,7 @@ function Q(t, e, n) {
|
|
|
1491
1461
|
let r = e.getOptions(), { publicKey: s } = e.getDsn() || {}, { segment: i } = n && n.getUser() || {}, o = E({ environment: r.environment || K, release: r.release, user_segment: i, public_key: s, trace_id: t });
|
|
1492
1462
|
return e.emit && e.emit("createDsc", o), o;
|
|
1493
1463
|
}
|
|
1494
|
-
var
|
|
1464
|
+
var Ge = class extends Z {
|
|
1495
1465
|
constructor(e, n) {
|
|
1496
1466
|
super(e), delete this.description, this._measurements = {}, this._contexts = {}, this._hub = n || R(), this._name = e.name || "", this.metadata = { source: "custom", ...e.metadata, spanMetadata: {} }, this._trimEnd = e.trimEnd, this.transaction = this;
|
|
1497
1467
|
let r = this.metadata.dynamicSamplingContext;
|
|
@@ -1507,7 +1477,7 @@ var $e = class extends Z {
|
|
|
1507
1477
|
this._name = e, this.metadata.source = n;
|
|
1508
1478
|
}
|
|
1509
1479
|
initSpanRecorder(e = 1e3) {
|
|
1510
|
-
this.spanRecorder || (this.spanRecorder = new
|
|
1480
|
+
this.spanRecorder || (this.spanRecorder = new Ue(e)), this.spanRecorder.add(this);
|
|
1511
1481
|
}
|
|
1512
1482
|
setContext(e, n) {
|
|
1513
1483
|
n === null ? delete this._contexts[e] : this._contexts[e] = n;
|
|
@@ -1567,7 +1537,7 @@ function vn(t, e, n) {
|
|
|
1567
1537
|
return typeof e.tracesSampler == "function" ? (r = e.tracesSampler(n), t.setMetadata({ sampleRate: Number(r) })) : n.parentSampled !== void 0 ? r = n.parentSampled : typeof e.tracesSampleRate < "u" ? (r = e.tracesSampleRate, t.setMetadata({ sampleRate: Number(r) })) : (r = 1, t.setMetadata({ sampleRate: r })), jr(r) ? r ? (t.sampled = Math.random() < r, t.sampled ? ((typeof __SENTRY_DEBUG__ > "u" || __SENTRY_DEBUG__) && f.log(`[Tracing] starting ${t.op} transaction - ${t.name}`), t) : ((typeof __SENTRY_DEBUG__ > "u" || __SENTRY_DEBUG__) && f.log(`[Tracing] Discarding transaction because it's not included in the random sample (sampling rate = ${Number(r)})`), t)) : ((typeof __SENTRY_DEBUG__ > "u" || __SENTRY_DEBUG__) && f.log(`[Tracing] Discarding transaction because ${typeof e.tracesSampler == "function" ? "tracesSampler returned 0 or false" : "a negative sampling decision was inherited or tracesSampleRate is set to 0"}`), t.sampled = false, t) : ((typeof __SENTRY_DEBUG__ > "u" || __SENTRY_DEBUG__) && f.warn("[Tracing] Discarding transaction because of invalid sample rate."), t.sampled = false, t);
|
|
1568
1538
|
}
|
|
1569
1539
|
function jr(t) {
|
|
1570
|
-
return
|
|
1540
|
+
return te(t) || !(typeof t == "number" || typeof t == "boolean") ? ((typeof __SENTRY_DEBUG__ > "u" || __SENTRY_DEBUG__) && f.warn(`[Tracing] Given sample rate is invalid. Sample rate must be a boolean or a number between 0 and 1. Got ${JSON.stringify(t)} of type ${JSON.stringify(typeof t)}.`), false) : t < 0 || t > 1 ? ((typeof __SENTRY_DEBUG__ > "u" || __SENTRY_DEBUG__) && f.warn(`[Tracing] Given sample rate is invalid. Sample rate must be between 0 and 1. Got ${t}.`), false) : true;
|
|
1571
1541
|
}
|
|
1572
1542
|
function qr() {
|
|
1573
1543
|
let e = this.getScope().getSpan();
|
|
@@ -1577,14 +1547,14 @@ function Wr(t, e) {
|
|
|
1577
1547
|
let n = this.getClient(), r = n && n.getOptions() || {}, s = r.instrumenter || "sentry", i = t.instrumenter || "sentry";
|
|
1578
1548
|
s !== i && ((typeof __SENTRY_DEBUG__ > "u" || __SENTRY_DEBUG__) && f.error(`A transaction was started with instrumenter=\`${i}\`, but the SDK is configured with the \`${s}\` instrumenter.
|
|
1579
1549
|
The transaction will not be sampled. Please use the ${s} instrumentation to start transactions.`), t.sampled = false);
|
|
1580
|
-
let o = new
|
|
1550
|
+
let o = new Ge(t, this);
|
|
1581
1551
|
return o = vn(o, r, { parentSampled: t.parentSampled, transactionContext: t, ...e }), o.sampled && o.initSpanRecorder(r._experiments && r._experiments.maxSpans), n && n.emit && n.emit("startTransaction", o), o;
|
|
1582
1552
|
}
|
|
1583
1553
|
function kn() {
|
|
1584
|
-
let t =
|
|
1554
|
+
let t = j();
|
|
1585
1555
|
t.__SENTRY__ && (t.__SENTRY__.extensions = t.__SENTRY__.extensions || {}, t.__SENTRY__.extensions.startTransaction || (t.__SENTRY__.extensions.startTransaction = Wr), t.__SENTRY__.extensions.traceHeaders || (t.__SENTRY__.extensions.traceHeaders = qr), wn());
|
|
1586
1556
|
}
|
|
1587
|
-
var
|
|
1557
|
+
var Le = class {
|
|
1588
1558
|
constructor(e, n) {
|
|
1589
1559
|
this._client = e, this.flushTimeout = 60, this._pendingAggregates = {}, this._isEnabled = true, this._intervalId = setInterval(() => this.flush(), this.flushTimeout * 1e3), this._sessionAttrs = n;
|
|
1590
1560
|
}
|
|
@@ -1637,11 +1607,11 @@ function Xr(t, e) {
|
|
|
1637
1607
|
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;
|
|
1638
1608
|
}
|
|
1639
1609
|
function Pn(t, e, n, r) {
|
|
1640
|
-
let s =
|
|
1610
|
+
let s = Pe(n), i = { sent_at: (/* @__PURE__ */ new Date()).toISOString(), ...s && { sdk: s }, ...!!r && e && { dsn: U(e) } }, o = "aggregates" in t ? [{ type: "sessions" }, t] : [{ type: "session" }, t.toJSON()];
|
|
1641
1611
|
return G(i, [o]);
|
|
1642
1612
|
}
|
|
1643
1613
|
function Mn(t, e, n, r) {
|
|
1644
|
-
let s =
|
|
1614
|
+
let s = Pe(n), i = t.type && t.type !== "replay_event" ? t.type : "event";
|
|
1645
1615
|
Xr(t, n && n.sdk);
|
|
1646
1616
|
let o = Tt(t, s, r, e);
|
|
1647
1617
|
return delete t.sdkProcessingMetadata, G(o, [[{ type: i }, t]]);
|
|
@@ -1660,7 +1630,7 @@ function Ot(t) {
|
|
|
1660
1630
|
o.isDefaultInstance = true;
|
|
1661
1631
|
});
|
|
1662
1632
|
let r;
|
|
1663
|
-
Array.isArray(n) ? r = [...e, ...n] : typeof n == "function" ? r =
|
|
1633
|
+
Array.isArray(n) ? r = [...e, ...n] : typeof n == "function" ? r = de(n(e)) : r = e;
|
|
1664
1634
|
let s = Zr(r), i = Qr(s, (o) => o.name === "Debug");
|
|
1665
1635
|
if (i !== -1) {
|
|
1666
1636
|
let [o] = s.splice(i, 1);
|
|
@@ -1690,7 +1660,7 @@ function Qr(t, e) {
|
|
|
1690
1660
|
return -1;
|
|
1691
1661
|
}
|
|
1692
1662
|
function Bn(t, e, n, r, s) {
|
|
1693
|
-
let { normalizeDepth: i = 3, normalizeMaxBreadth: o = 1e3 } = t, a = { ...e, event_id: e.event_id || n.event_id || g(), timestamp: e.timestamp ||
|
|
1663
|
+
let { normalizeDepth: i = 3, normalizeMaxBreadth: o = 1e3 } = t, a = { ...e, event_id: e.event_id || n.event_id || g(), timestamp: e.timestamp || $() }, c = n.integrations || t.integrations.map((p) => p.name);
|
|
1694
1664
|
es(a, t), rs(a, c), e.type === void 0 && ts(a, t.stackParser);
|
|
1695
1665
|
let u = r;
|
|
1696
1666
|
n.captureContext && (u = O.clone(u).update(n.captureContext));
|
|
@@ -1701,7 +1671,7 @@ function Bn(t, e, n, r, s) {
|
|
|
1701
1671
|
p.length && (n.attachments = p);
|
|
1702
1672
|
}
|
|
1703
1673
|
l = u.applyToEvent(a, n, d);
|
|
1704
|
-
} else l = X([...d, ...
|
|
1674
|
+
} else l = X([...d, ...fe()], a, n);
|
|
1705
1675
|
return l.then((p) => (p && ns(p), typeof i == "number" && i > 0 ? ss(p, i, o) : p));
|
|
1706
1676
|
}
|
|
1707
1677
|
function es(t, e) {
|
|
@@ -1765,15 +1735,15 @@ function ss(t, e, n) {
|
|
|
1765
1735
|
return t.contexts && t.contexts.trace && r.contexts && (r.contexts.trace = t.contexts.trace, t.contexts.trace.data && (r.contexts.trace.data = w(t.contexts.trace.data, e, n))), t.spans && (r.spans = t.spans.map((s) => (s.data && (s.data = w(s.data, e, n)), s))), r;
|
|
1766
1736
|
}
|
|
1767
1737
|
var Fn = "Not capturing exception because it's already been captured.";
|
|
1768
|
-
var
|
|
1738
|
+
var Be = class {
|
|
1769
1739
|
constructor(e) {
|
|
1770
|
-
if (this._options = e, this._integrations = {}, this._integrationsInitialized = false, this._numProcessing = 0, this._outcomes = {}, this._hooks = {}, this._eventProcessors = [], e.dsn ? this._dsn =
|
|
1740
|
+
if (this._options = e, this._integrations = {}, this._integrationsInitialized = false, this._numProcessing = 0, this._outcomes = {}, this._hooks = {}, this._eventProcessors = [], e.dsn ? this._dsn = Te(e.dsn) : (typeof __SENTRY_DEBUG__ > "u" || __SENTRY_DEBUG__) && f.warn("No DSN provided, client will not send events."), this._dsn) {
|
|
1771
1741
|
let n = Cn(this._dsn, e);
|
|
1772
1742
|
this._transport = e.transport({ recordDroppedEvent: this.recordDroppedEvent.bind(this), ...e.transportOptions, url: n });
|
|
1773
1743
|
}
|
|
1774
1744
|
}
|
|
1775
1745
|
captureException(e, n, r) {
|
|
1776
|
-
if (
|
|
1746
|
+
if (Oe(e)) {
|
|
1777
1747
|
(typeof __SENTRY_DEBUG__ > "u" || __SENTRY_DEBUG__) && f.log(Fn);
|
|
1778
1748
|
return;
|
|
1779
1749
|
}
|
|
@@ -1783,13 +1753,13 @@ var Ye = class {
|
|
|
1783
1753
|
})), s;
|
|
1784
1754
|
}
|
|
1785
1755
|
captureMessage(e, n, r, s) {
|
|
1786
|
-
let i = r && r.event_id, o =
|
|
1756
|
+
let i = r && r.event_id, o = Ee(e) ? this.eventFromMessage(String(e), n, r) : this.eventFromException(e, r);
|
|
1787
1757
|
return this._process(o.then((a) => this._captureEvent(a, r, s)).then((a) => {
|
|
1788
1758
|
i = a;
|
|
1789
1759
|
})), i;
|
|
1790
1760
|
}
|
|
1791
1761
|
captureEvent(e, n, r) {
|
|
1792
|
-
if (n && n.originalException &&
|
|
1762
|
+
if (n && n.originalException && Oe(n.originalException)) {
|
|
1793
1763
|
(typeof __SENTRY_DEBUG__ > "u" || __SENTRY_DEBUG__) && f.log(Fn);
|
|
1794
1764
|
return;
|
|
1795
1765
|
}
|
|
@@ -1914,7 +1884,7 @@ var Ye = class {
|
|
|
1914
1884
|
}
|
|
1915
1885
|
_processEvent(e, n, r) {
|
|
1916
1886
|
let s = this.getOptions(), { sampleRate: i } = s, o = Hn(e), a = $n(e), c = e.type || "error", u = `before send for type \`${c}\``;
|
|
1917
|
-
if (a && typeof i == "number" && Math.random() > i) return this.recordDroppedEvent("sample_rate", "error", e),
|
|
1887
|
+
if (a && typeof i == "number" && Math.random() > i) return this.recordDroppedEvent("sample_rate", "error", e), F(new T(`Discarding event because it's not included in the random sample (sampling rate = ${i})`, "log"));
|
|
1918
1888
|
let l = c === "replay_event" ? "replay" : c;
|
|
1919
1889
|
return this._prepareEvent(e, n, r).then((d) => {
|
|
1920
1890
|
if (d === null) throw this.recordDroppedEvent("event_processor", l, e), new T("An event processor returned `null`, will not send event.", "log");
|
|
@@ -1955,7 +1925,7 @@ Reason: ${d}`));
|
|
|
1955
1925
|
};
|
|
1956
1926
|
function is(t, e) {
|
|
1957
1927
|
let n = `${e} must return \`null\` or a valid event.`;
|
|
1958
|
-
if (
|
|
1928
|
+
if (B(t)) return t.then((r) => {
|
|
1959
1929
|
if (!I(r) && r !== null) throw new T(n);
|
|
1960
1930
|
return r;
|
|
1961
1931
|
}, (r) => {
|
|
@@ -1983,7 +1953,7 @@ function Yn(t, e, n, r, s) {
|
|
|
1983
1953
|
function as(t) {
|
|
1984
1954
|
return [{ type: "check_in" }, t];
|
|
1985
1955
|
}
|
|
1986
|
-
var
|
|
1956
|
+
var pe = class extends Be {
|
|
1987
1957
|
constructor(e) {
|
|
1988
1958
|
kn(), super(e);
|
|
1989
1959
|
}
|
|
@@ -2012,7 +1982,7 @@ var me = class extends Ye {
|
|
|
2012
1982
|
}
|
|
2013
1983
|
initSessionFlusher() {
|
|
2014
1984
|
let { release: e, environment: n } = this._options;
|
|
2015
|
-
e ? this._sessionFlusher = new
|
|
1985
|
+
e ? this._sessionFlusher = new Le(this, { release: e, environment: n }) : (typeof __SENTRY_DEBUG__ > "u" || __SENTRY_DEBUG__) && f.warn("Cannot initialise an instance of SessionFlusher if no release is provided!");
|
|
2016
1986
|
}
|
|
2017
1987
|
captureCheckIn(e, n, r) {
|
|
2018
1988
|
let s = e.status !== "in_progress" && e.checkInId ? e.checkInId : g();
|
|
@@ -2043,17 +2013,17 @@ function kt(t, e, n = pt(t.bufferSize || cs)) {
|
|
|
2043
2013
|
let r = {}, s = (o) => n.drain(o);
|
|
2044
2014
|
function i(o) {
|
|
2045
2015
|
let a = [];
|
|
2046
|
-
if (
|
|
2047
|
-
let m =
|
|
2016
|
+
if (ke(o, (d, p) => {
|
|
2017
|
+
let m = Ce(p);
|
|
2048
2018
|
if (bt(r, m)) {
|
|
2049
2019
|
let v = jn(d, p);
|
|
2050
2020
|
t.recordDroppedEvent("ratelimit_backoff", m, v);
|
|
2051
2021
|
} else a.push(d);
|
|
2052
2022
|
}), a.length === 0) return b();
|
|
2053
2023
|
let c = G(o[0], a), u = (d) => {
|
|
2054
|
-
|
|
2024
|
+
ke(c, (p, m) => {
|
|
2055
2025
|
let v = jn(p, m);
|
|
2056
|
-
t.recordDroppedEvent(d,
|
|
2026
|
+
t.recordDroppedEvent(d, Ce(m), v);
|
|
2057
2027
|
});
|
|
2058
2028
|
}, l = () => e({ body: yt(c, t.textEncoder) }).then((d) => (d.statusCode !== void 0 && (d.statusCode < 200 || d.statusCode >= 300) && (typeof __SENTRY_DEBUG__ > "u" || __SENTRY_DEBUG__) && f.warn(`Sentry responded with status code ${d.statusCode} to sent event.`), r = Rt(r, d), d), (d) => {
|
|
2059
2029
|
throw u("network_error"), d;
|
|
@@ -2096,10 +2066,10 @@ function Vn(t, e) {
|
|
|
2096
2066
|
}
|
|
2097
2067
|
function ps(t, e, n, r) {
|
|
2098
2068
|
let s, o = (r && r.data && ds(r.data) ? r.data.mechanism : void 0) ?? { handled: true, type: "generic" };
|
|
2099
|
-
if (
|
|
2069
|
+
if (L(n)) s = n;
|
|
2100
2070
|
else {
|
|
2101
2071
|
if (I(n)) {
|
|
2102
|
-
let c = `Non-Error exception captured with keys: ${
|
|
2072
|
+
let c = `Non-Error exception captured with keys: ${se(n)}`, u = t?.getClient(), l = u && u.getOptions().normalizeDepth;
|
|
2103
2073
|
t?.configureScope((d) => {
|
|
2104
2074
|
d.setExtra("__serialized__", J(n, l));
|
|
2105
2075
|
}), s = r && r.syntheticException || new Error(c), s.message = c;
|
|
@@ -2107,7 +2077,7 @@ function ps(t, e, n, r) {
|
|
|
2107
2077
|
o.synthetic = true;
|
|
2108
2078
|
}
|
|
2109
2079
|
let a = { exception: { values: [Vn(e, s)] } };
|
|
2110
|
-
return
|
|
2080
|
+
return ce(a, void 0, void 0), ue(a, o), { ...a, event_id: r && r.event_id };
|
|
2111
2081
|
}
|
|
2112
2082
|
function ms(t, e, n = "info", r, s) {
|
|
2113
2083
|
let i = { event_id: r && r.event_id, level: n, message: e };
|
|
@@ -2118,8 +2088,8 @@ function ms(t, e, n = "info", r, s) {
|
|
|
2118
2088
|
return i;
|
|
2119
2089
|
}
|
|
2120
2090
|
var hs = 5;
|
|
2121
|
-
var
|
|
2122
|
-
name =
|
|
2091
|
+
var Ye = class {
|
|
2092
|
+
name = Ye.id;
|
|
2123
2093
|
limit;
|
|
2124
2094
|
constructor(e = {}) {
|
|
2125
2095
|
this.limit = e.limit || hs;
|
|
@@ -2127,13 +2097,13 @@ var ze = class {
|
|
|
2127
2097
|
setupOnce(e, n) {
|
|
2128
2098
|
let r = n().getClient();
|
|
2129
2099
|
r && e((s, i) => {
|
|
2130
|
-
let o = n().getIntegration(
|
|
2100
|
+
let o = n().getIntegration(Ye);
|
|
2131
2101
|
return o ? _s(r.getOptions().stackParser, o.limit, s, i) : s;
|
|
2132
2102
|
});
|
|
2133
2103
|
}
|
|
2134
2104
|
};
|
|
2135
|
-
var
|
|
2136
|
-
_e(
|
|
2105
|
+
var Fe = Ye;
|
|
2106
|
+
_e(Fe, "id", "LinkedErrors");
|
|
2137
2107
|
function _s(t, e, n, r) {
|
|
2138
2108
|
if (!n.exception || !n.exception.values || !r || !k(r.originalException, Error)) return n;
|
|
2139
2109
|
let s = Jn(t, e, r.originalException);
|
|
@@ -2146,21 +2116,21 @@ function Jn(t, e, n, r = []) {
|
|
|
2146
2116
|
}
|
|
2147
2117
|
var gs = { allowedHeaders: ["CF-RAY", "CF-Worker"] };
|
|
2148
2118
|
var ee;
|
|
2149
|
-
var
|
|
2119
|
+
var je = class {
|
|
2150
2120
|
constructor(e = {}) {
|
|
2151
|
-
_e(this, "name",
|
|
2121
|
+
_e(this, "name", je.id);
|
|
2152
2122
|
$t(this, ee, void 0);
|
|
2153
2123
|
Ht(this, ee, { ...gs, ...e });
|
|
2154
2124
|
}
|
|
2155
2125
|
setupOnce(e, n) {
|
|
2156
2126
|
n().getClient() && e((s) => {
|
|
2157
2127
|
let { sdkProcessingMetadata: i } = s;
|
|
2158
|
-
return !n().getIntegration(
|
|
2128
|
+
return !n().getIntegration(je) || !i || ("request" in i && i.request instanceof Request && (s.request = ys(i.request, et(this, ee)), s.user = Es(s.user ?? {}, i.request, et(this, ee))), "requestData" in i && (s.request ? s.request.data = i.requestData : s.request = { data: i.requestData })), s;
|
|
2159
2129
|
});
|
|
2160
2130
|
}
|
|
2161
2131
|
};
|
|
2162
|
-
var
|
|
2163
|
-
ee = /* @__PURE__ */ new WeakMap(), _e(
|
|
2132
|
+
var $e = je;
|
|
2133
|
+
ee = /* @__PURE__ */ new WeakMap(), _e($e, "id", "RequestData");
|
|
2164
2134
|
function Es(t, e, n) {
|
|
2165
2135
|
let r = e.headers.get("CF-Connecting-IP"), { allowedIps: s } = n, i = { ...t };
|
|
2166
2136
|
return !("ip_address" in t) && r && s !== void 0 && Ss(r, s) && (i.ip_address = r), Object.keys(i).length > 0 ? i : void 0;
|
|
@@ -2219,7 +2189,7 @@ function bs(t, e) {
|
|
|
2219
2189
|
}, () => e);
|
|
2220
2190
|
}), n;
|
|
2221
2191
|
}
|
|
2222
|
-
var Pt = class extends
|
|
2192
|
+
var Pt = class extends pe {
|
|
2223
2193
|
#e = null;
|
|
2224
2194
|
constructor(e) {
|
|
2225
2195
|
e._metadata = e._metadata || {}, e._metadata.sdk = e._metadata.sdk || { name: "toucan-js", packages: [{ name: "npm:toucan-js", version: "3.3.1" }], version: "3.3.1" }, super(e);
|
|
@@ -2263,21 +2233,21 @@ function Rs(t) {
|
|
|
2263
2233
|
function xs(t) {
|
|
2264
2234
|
if (t) return ft(t, ".js");
|
|
2265
2235
|
}
|
|
2266
|
-
var Is =
|
|
2236
|
+
var Is = Re(Rs(xs));
|
|
2267
2237
|
function Ns(t) {
|
|
2268
2238
|
function e({ body: n }) {
|
|
2269
2239
|
try {
|
|
2270
2240
|
let s = (t.fetcher ?? fetch)(t.url, { method: "POST", headers: t.headers, body: n }).then((i) => ({ statusCode: i.status, headers: { "retry-after": i.headers.get("Retry-After"), "x-sentry-rate-limits": i.headers.get("X-Sentry-Rate-Limits") } }));
|
|
2271
2241
|
return t.context && t.context.waitUntil(s), s;
|
|
2272
2242
|
} catch (r) {
|
|
2273
|
-
return
|
|
2243
|
+
return F(r);
|
|
2274
2244
|
}
|
|
2275
2245
|
}
|
|
2276
2246
|
return kt(t, e);
|
|
2277
2247
|
}
|
|
2278
|
-
var
|
|
2248
|
+
var He = class extends Y {
|
|
2279
2249
|
constructor(e) {
|
|
2280
|
-
if (e.defaultIntegrations = e.defaultIntegrations === false ? [] : [...Array.isArray(e.defaultIntegrations) ? e.defaultIntegrations : [new
|
|
2250
|
+
if (e.defaultIntegrations = e.defaultIntegrations === false ? [] : [...Array.isArray(e.defaultIntegrations) ? e.defaultIntegrations : [new $e(e.requestDataOptions), new Fe()]], e.release === void 0) {
|
|
2281
2251
|
let r = ls();
|
|
2282
2252
|
r !== void 0 && (e.release = r);
|
|
2283
2253
|
}
|
|
@@ -2296,7 +2266,7 @@ var We = class extends j {
|
|
|
2296
2266
|
};
|
|
2297
2267
|
function Kn(t, e, n, r, s, i, o, a) {
|
|
2298
2268
|
if (!(n && r && s)) return;
|
|
2299
|
-
let c = new
|
|
2269
|
+
let c = new He({ dsn: n, request: t, context: e, sampleRate: 1, 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 } } });
|
|
2300
2270
|
return i && (c.setTag("colo", i.coloId), c.setTag("metal", i.metalId)), o && a && (c.setTag("accountId", o), c.setTag("scriptId", a)), c.setUser({ id: o?.toString() }), c;
|
|
2301
2271
|
}
|
|
2302
2272
|
function As() {
|
|
@@ -2308,7 +2278,7 @@ function As() {
|
|
|
2308
2278
|
function Xn() {
|
|
2309
2279
|
return { enterSpan: (t, e, ...n) => e(As(), ...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" };
|
|
2310
2280
|
}
|
|
2311
|
-
var
|
|
2281
|
+
var qe = class {
|
|
2312
2282
|
constructor(e) {
|
|
2313
2283
|
this.data = {};
|
|
2314
2284
|
this.readyAnalytics = e;
|
|
@@ -2323,7 +2293,7 @@ var Je = class {
|
|
|
2323
2293
|
this.readyAnalytics && this.readyAnalytics.logEvent({ version: 1, accountId: this.data.accountId, indexId: this.data.scriptId?.toString(), doubles: [this.data.requestTime ?? -1, this.data.coloId ?? -1, this.data.metalId ?? -1, this.data.coloTier ?? -1], blobs: [this.data.hostname?.substring(0, 256), this.data.userAgent?.substring(0, 256), this.data.htmlHandling, this.data.notFoundHandling, this.data.error?.substring(0, 256), this.data.version, this.data.coloRegion] });
|
|
2324
2294
|
}
|
|
2325
2295
|
};
|
|
2326
|
-
var
|
|
2296
|
+
var ze = class {
|
|
2327
2297
|
constructor(e) {
|
|
2328
2298
|
this.data = e;
|
|
2329
2299
|
}
|
|
@@ -2359,9 +2329,36 @@ var vs = (t, e) => {
|
|
|
2359
2329
|
return 0;
|
|
2360
2330
|
};
|
|
2361
2331
|
var ks = (t) => [...t.slice(16, 16 + 16)].map((n) => n.toString(16).padStart(2, "0")).join("");
|
|
2362
|
-
var Ut = (t) => {
|
|
2363
|
-
|
|
2364
|
-
|
|
2332
|
+
var Ut = (t) => ({ html_handling: t?.html_handling ?? "auto-trailing-slash", not_found_handling: t?.not_found_handling ?? "none", serve_directly: t?.serve_directly ?? true });
|
|
2333
|
+
var Ve = class extends Response {
|
|
2334
|
+
constructor(e, n) {
|
|
2335
|
+
super(e, { ...n, status: 200 });
|
|
2336
|
+
}
|
|
2337
|
+
};
|
|
2338
|
+
var he = class extends Response {
|
|
2339
|
+
constructor(...[e, n]) {
|
|
2340
|
+
super(e, { ...n, status: 404, statusText: "Not Found" });
|
|
2341
|
+
}
|
|
2342
|
+
};
|
|
2343
|
+
var Je = class extends Response {
|
|
2344
|
+
constructor(...[e, n]) {
|
|
2345
|
+
super(e, { ...n, status: 405, statusText: "Method Not Allowed" });
|
|
2346
|
+
}
|
|
2347
|
+
};
|
|
2348
|
+
var q = class extends Response {
|
|
2349
|
+
constructor(e, n) {
|
|
2350
|
+
super(null, { ...n, status: 500 });
|
|
2351
|
+
}
|
|
2352
|
+
};
|
|
2353
|
+
var Ke = class extends Response {
|
|
2354
|
+
constructor(...[e, n]) {
|
|
2355
|
+
super(null, { ...n, status: 304, statusText: "Not Modified" });
|
|
2356
|
+
}
|
|
2357
|
+
};
|
|
2358
|
+
var Xe = class extends Response {
|
|
2359
|
+
constructor(e, n) {
|
|
2360
|
+
super(null, { ...n, status: 307, statusText: "Temporary Redirect", headers: { ...n?.headers, Location: e } });
|
|
2361
|
+
}
|
|
2365
2362
|
};
|
|
2366
2363
|
var Zn = "public, max-age=0, must-revalidate";
|
|
2367
2364
|
function Qn(t, e, n) {
|
|
@@ -2375,21 +2372,21 @@ var er = async (t, e, n, r, s) => {
|
|
|
2375
2372
|
let { pathname: i, search: o } = new URL(t.url), a = Gt(i);
|
|
2376
2373
|
a = a.replace(/\/+/g, "/");
|
|
2377
2374
|
let c = await Ze(a, n, r);
|
|
2378
|
-
if (!c) return e.JAEGER.enterSpan("no_intent", (x) => (x.setTags({ decodedPathname: a, configuration: JSON.stringify(n), status: 404 }), new
|
|
2375
|
+
if (!c) return e.JAEGER.enterSpan("no_intent", (x) => (x.setTags({ decodedPathname: a, configuration: JSON.stringify(n), status: 404 }), new he()));
|
|
2379
2376
|
let u = t.method.toUpperCase();
|
|
2380
|
-
if (!["GET", "HEAD"].includes(u)) return e.JAEGER.enterSpan("method_not_allowed", (x) => (x.setTags({ method: u, status: 405 }), new
|
|
2377
|
+
if (!["GET", "HEAD"].includes(u)) return e.JAEGER.enterSpan("method_not_allowed", (x) => (x.setTags({ method: u, status: 405 }), new Je()));
|
|
2381
2378
|
let l = c.redirect ?? a, d = Ls(l);
|
|
2382
|
-
if (d !== i && c.asset || c.redirect) return e.JAEGER.enterSpan("redirect", (x) => (x.setTags({ originalPath: i, location: d !== i ? d : c.redirect ?? "<unknown>", status: 307 }), new
|
|
2383
|
-
if (!c.asset) return e.JAEGER.enterSpan("unknown_action", (x) => (x.setTags({ pathname: i, status: 500 }), new
|
|
2379
|
+
if (d !== i && c.asset || c.redirect) return e.JAEGER.enterSpan("redirect", (x) => (x.setTags({ originalPath: i, location: d !== i ? d : c.redirect ?? "<unknown>", status: 307 }), new Xe(d + o)));
|
|
2380
|
+
if (!c.asset) return e.JAEGER.enterSpan("unknown_action", (x) => (x.setTags({ pathname: i, status: 500 }), new q(new Error("Unknown action"))));
|
|
2384
2381
|
let p = await e.JAEGER.enterSpan("getByETag", async (x) => (x.setTags({ pathname: i, eTag: c.asset.eTag, status: c.asset.status }), await s(c.asset.eTag))), m = Qn(c.asset.eTag, p.contentType, t), v = `"${c.asset.eTag}"`, rr = `W/${v}`, Lt = t.headers.get("If-None-Match") || "";
|
|
2385
|
-
return [rr, v].includes(Lt) ? e.JAEGER.enterSpan("matched_etag", (x) => (x.setTags({ matchedEtag: Lt, status: 304 }), new
|
|
2382
|
+
return [rr, v].includes(Lt) ? e.JAEGER.enterSpan("matched_etag", (x) => (x.setTags({ matchedEtag: Lt, status: 304 }), new Ke(null, { headers: m }))) : e.JAEGER.enterSpan("response", (x) => {
|
|
2386
2383
|
x.setTags({ etag: c.asset.eTag, status: c.asset.status, head: u === "HEAD" });
|
|
2387
2384
|
let Bt = u === "HEAD" ? null : p.readableStream;
|
|
2388
2385
|
switch (c.asset.status) {
|
|
2389
2386
|
case 404:
|
|
2390
|
-
return new
|
|
2387
|
+
return new he(Bt, { headers: m });
|
|
2391
2388
|
case 200:
|
|
2392
|
-
return new
|
|
2389
|
+
return new Ve(Bt, { headers: m });
|
|
2393
2390
|
}
|
|
2394
2391
|
});
|
|
2395
2392
|
};
|
|
@@ -2526,33 +2523,29 @@ async function tr(t, e, n, r = 1) {
|
|
|
2526
2523
|
return o.value !== null && n && n.captureException(new Error(`Initial request for asset ${e} failed, but subsequent request succeeded.`)), o;
|
|
2527
2524
|
}
|
|
2528
2525
|
return i;
|
|
2529
|
-
} catch
|
|
2530
|
-
if (s >= r) {
|
|
2531
|
-
let o = `KV GET ${e} failed.`;
|
|
2532
|
-
throw i instanceof Error && (o = `KV GET ${e} failed: ${i.message}`), new Error(o);
|
|
2533
|
-
}
|
|
2526
|
+
} catch {
|
|
2527
|
+
if (s >= r) throw new Error(`Requested asset ${e} could not be fetched from KV namespace.`);
|
|
2534
2528
|
await new Promise((o) => setTimeout(o, Math.pow(2, s++) * 1e3));
|
|
2535
2529
|
}
|
|
2536
2530
|
}
|
|
2537
2531
|
var nr = class extends Bs {
|
|
2538
2532
|
async fetch(t) {
|
|
2539
|
-
let e, n = new
|
|
2533
|
+
let e, n = new qe(this.env.ANALYTICS), r = new ge(this.env.UNSAFE_PERFORMANCE), s = r.now();
|
|
2540
2534
|
try {
|
|
2541
2535
|
this.env.JAEGER || (this.env.JAEGER = Xn()), e = Kn(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.CONFIG?.account_id, this.env.CONFIG?.script_id);
|
|
2542
2536
|
let i = Ut(this.env.CONFIG), o = t.headers.get("user-agent") ?? "UA UNKNOWN", a = new URL(t.url);
|
|
2543
|
-
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.id, hostname: a.hostname, htmlHandling: i.html_handling, notFoundHandling: i.not_found_handling, userAgent: o }),
|
|
2537
|
+
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.id, hostname: a.hostname, htmlHandling: i.html_handling, notFoundHandling: i.not_found_handling, userAgent: o }), this.env.JAEGER.enterSpan("handleRequest", async (c) => (c.setTags({ hostname: a.hostname, eyeballPath: a.pathname, env: this.env.ENVIRONMENT, version: this.env.VERSION_METADATA?.id }), er(t, this.env, i, this.unstable_exists.bind(this), this.unstable_getByETag.bind(this)))).catch((c) => this.handleError(e, n, c)).finally(() => this.submitMetrics(n, r, s));
|
|
2544
2538
|
} catch (i) {
|
|
2545
|
-
|
|
2546
|
-
|
|
2547
|
-
this.submitMetrics(n, r, s);
|
|
2539
|
+
let o = this.handleError(e, n, i);
|
|
2540
|
+
return this.submitMetrics(n, r, s), o;
|
|
2548
2541
|
}
|
|
2549
2542
|
}
|
|
2550
2543
|
handleError(t, e, n) {
|
|
2551
2544
|
try {
|
|
2552
|
-
let r = new
|
|
2545
|
+
let r = new q(n);
|
|
2553
2546
|
return t && t.captureException(n), n instanceof Error && e.setData({ error: n.message }), r;
|
|
2554
2547
|
} catch (r) {
|
|
2555
|
-
return console.error("Error handling error", r), new
|
|
2548
|
+
return console.error("Error handling error", r), new q(r);
|
|
2556
2549
|
}
|
|
2557
2550
|
}
|
|
2558
2551
|
submitMetrics(t, e, n) {
|
|
@@ -2576,7 +2569,7 @@ var nr = class extends Bs {
|
|
|
2576
2569
|
return e ? this.unstable_getByETag(e) : null;
|
|
2577
2570
|
}
|
|
2578
2571
|
async unstable_exists(t) {
|
|
2579
|
-
return await new
|
|
2572
|
+
return await new ze(this.env.ASSETS_MANIFEST).get(t);
|
|
2580
2573
|
}
|
|
2581
2574
|
};
|
|
2582
2575
|
|