@cloudflare/vite-plugin 0.0.1 → 0.0.2
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.
|
@@ -11,7 +11,7 @@ var Ft = (t, e, n) => {
|
|
|
11
11
|
if (e.has(t)) throw TypeError("Cannot add the same private member more than once");
|
|
12
12
|
e instanceof WeakSet ? e.add(t) : e.set(t, n);
|
|
13
13
|
};
|
|
14
|
-
var
|
|
14
|
+
var Gt = (t, e, n, r) => (Bt(t, e, "write to private field"), r ? r.call(t, n) : e.set(t, n), n);
|
|
15
15
|
var _e = class {
|
|
16
16
|
constructor(e) {
|
|
17
17
|
this.performanceTimer = e;
|
|
@@ -20,19 +20,19 @@ var _e = class {
|
|
|
20
20
|
return this.performanceTimer ? this.performanceTimer.timeOrigin + this.performanceTimer.now() : Date.now();
|
|
21
21
|
}
|
|
22
22
|
};
|
|
23
|
-
var
|
|
23
|
+
var $t = Object.prototype.toString;
|
|
24
24
|
function L(t) {
|
|
25
|
-
switch (
|
|
25
|
+
switch ($t.call(t)) {
|
|
26
26
|
case "[object Error]":
|
|
27
27
|
case "[object Exception]":
|
|
28
28
|
case "[object DOMException]":
|
|
29
29
|
return true;
|
|
30
30
|
default:
|
|
31
|
-
return
|
|
31
|
+
return O(t, Error);
|
|
32
32
|
}
|
|
33
33
|
}
|
|
34
34
|
function Ht(t, e) {
|
|
35
|
-
return
|
|
35
|
+
return $t.call(t) === `[object ${e}]`;
|
|
36
36
|
}
|
|
37
37
|
function q(t) {
|
|
38
38
|
return Ht(t, "String");
|
|
@@ -44,10 +44,10 @@ function x(t) {
|
|
|
44
44
|
return Ht(t, "Object");
|
|
45
45
|
}
|
|
46
46
|
function et(t) {
|
|
47
|
-
return typeof Event < "u" &&
|
|
47
|
+
return typeof Event < "u" && O(t, Event);
|
|
48
48
|
}
|
|
49
49
|
function tt(t) {
|
|
50
|
-
return typeof Element < "u" &&
|
|
50
|
+
return typeof Element < "u" && O(t, Element);
|
|
51
51
|
}
|
|
52
52
|
function B(t) {
|
|
53
53
|
return !!(t && t.then && typeof t.then == "function");
|
|
@@ -58,7 +58,7 @@ function nt(t) {
|
|
|
58
58
|
function ee(t) {
|
|
59
59
|
return typeof t == "number" && t !== t;
|
|
60
60
|
}
|
|
61
|
-
function
|
|
61
|
+
function O(t, e) {
|
|
62
62
|
try {
|
|
63
63
|
return t instanceof e;
|
|
64
64
|
} catch {
|
|
@@ -209,7 +209,7 @@ function Te(t) {
|
|
|
209
209
|
if (L(t)) return { message: t.message, name: t.name, stack: t.stack, ...zt(t) };
|
|
210
210
|
if (et(t)) {
|
|
211
211
|
let e = { type: t.type, target: Wt(t.target), currentTarget: Wt(t.currentTarget), ...zt(t) };
|
|
212
|
-
return typeof CustomEvent < "u" &&
|
|
212
|
+
return typeof CustomEvent < "u" && O(t, CustomEvent) && (e.detail = t.detail), e;
|
|
213
213
|
} else return t;
|
|
214
214
|
}
|
|
215
215
|
function Wt(t) {
|
|
@@ -633,7 +633,7 @@ function ue(t) {
|
|
|
633
633
|
}
|
|
634
634
|
function D(t, e = 100, n = 1 / 0) {
|
|
635
635
|
try {
|
|
636
|
-
return
|
|
636
|
+
return ve("", t, e, n);
|
|
637
637
|
} catch (r) {
|
|
638
638
|
return { ERROR: `**non-serializable** (${r})` };
|
|
639
639
|
}
|
|
@@ -642,7 +642,7 @@ function V(t, e = 3, n = 100 * 1024) {
|
|
|
642
642
|
let r = D(t, e);
|
|
643
643
|
return Dr(r) > n ? V(t, e - 1, n) : r;
|
|
644
644
|
}
|
|
645
|
-
function
|
|
645
|
+
function ve(t, e, n = 1 / 0, r = 1 / 0, s = mn()) {
|
|
646
646
|
let [i, o] = s;
|
|
647
647
|
if (e == null || ["number", "boolean", "string"].includes(typeof e) && !ee(e)) return e;
|
|
648
648
|
let a = Ir(t, e);
|
|
@@ -654,7 +654,7 @@ function Oe(t, e, n = 1 / 0, r = 1 / 0, s = mn()) {
|
|
|
654
654
|
let u = e;
|
|
655
655
|
if (u && typeof u.toJSON == "function") try {
|
|
656
656
|
let m = u.toJSON();
|
|
657
|
-
return
|
|
657
|
+
return ve("", m, c - 1, r, s);
|
|
658
658
|
} catch {
|
|
659
659
|
}
|
|
660
660
|
let l = Array.isArray(e) ? [] : {}, d = 0, p = Te(e);
|
|
@@ -664,8 +664,8 @@ function Oe(t, e, n = 1 / 0, r = 1 / 0, s = mn()) {
|
|
|
664
664
|
l[m] = "[MaxProperties ~]";
|
|
665
665
|
break;
|
|
666
666
|
}
|
|
667
|
-
let
|
|
668
|
-
l[m] =
|
|
667
|
+
let v = p[m];
|
|
668
|
+
l[m] = ve(m, v, c - 1, r, s), d++;
|
|
669
669
|
}
|
|
670
670
|
return o(e), l;
|
|
671
671
|
}
|
|
@@ -699,12 +699,12 @@ function Dr(t) {
|
|
|
699
699
|
return Ar(JSON.stringify(t));
|
|
700
700
|
}
|
|
701
701
|
var wr = /^(\S+:\\|\/?)([\s\S]*?)((?:\.{1,2}|[^/\\]+?|)(\.[^./\\]*|))(?:[/\\]*)$/;
|
|
702
|
-
function
|
|
702
|
+
function vr(t) {
|
|
703
703
|
let e = t.length > 1024 ? `<truncated>${t.slice(-1024)}` : t, n = wr.exec(e);
|
|
704
704
|
return n ? n.slice(1) : [];
|
|
705
705
|
}
|
|
706
706
|
function lt(t, e) {
|
|
707
|
-
let n =
|
|
707
|
+
let n = vr(t)[2];
|
|
708
708
|
return e && n.slice(e.length * -1) === e && (n = n.slice(0, n.length - e.length)), n;
|
|
709
709
|
}
|
|
710
710
|
var k;
|
|
@@ -835,7 +835,7 @@ function ft(t) {
|
|
|
835
835
|
}
|
|
836
836
|
var _n = N();
|
|
837
837
|
var mt = { nowSeconds: () => Date.now() / 1e3 };
|
|
838
|
-
function
|
|
838
|
+
function Or() {
|
|
839
839
|
let { performance: t } = _n;
|
|
840
840
|
if (!t || !t.now) return;
|
|
841
841
|
let e = Date.now() - t.now();
|
|
@@ -848,10 +848,10 @@ function kr() {
|
|
|
848
848
|
return;
|
|
849
849
|
}
|
|
850
850
|
}
|
|
851
|
-
var pt = fn() ? kr() :
|
|
851
|
+
var pt = fn() ? kr() : Or();
|
|
852
852
|
var hn = pt === void 0 ? mt : { nowSeconds: () => (pt.timeOrigin + pt.now()) / 1e3 };
|
|
853
|
-
var
|
|
854
|
-
var
|
|
853
|
+
var G = mt.nowSeconds.bind(mt);
|
|
854
|
+
var $ = hn.nowSeconds.bind(hn);
|
|
855
855
|
var de;
|
|
856
856
|
var Cr = (() => {
|
|
857
857
|
let { performance: t } = _n;
|
|
@@ -874,7 +874,7 @@ function gt(t, e) {
|
|
|
874
874
|
let [n, r] = t;
|
|
875
875
|
return [n, [...r, e]];
|
|
876
876
|
}
|
|
877
|
-
function
|
|
877
|
+
function Oe(t, e) {
|
|
878
878
|
let n = t[1];
|
|
879
879
|
for (let r of n) {
|
|
880
880
|
let s = r[0].type;
|
|
@@ -1006,11 +1006,11 @@ function K(t, e, n, r = 0) {
|
|
|
1006
1006
|
});
|
|
1007
1007
|
}
|
|
1008
1008
|
function Tn(t) {
|
|
1009
|
-
let e =
|
|
1009
|
+
let e = $(), n = { sid: g(), init: true, timestamp: e, started: e, duration: 0, status: "ok", errors: 0, ignoreDuration: false, toJSON: () => Br(n) };
|
|
1010
1010
|
return t && C(n, t), n;
|
|
1011
1011
|
}
|
|
1012
1012
|
function C(t, e = {}) {
|
|
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 ||
|
|
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 || $(), 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;
|
|
1014
1014
|
else if (typeof e.duration == "number") t.duration = e.duration;
|
|
1015
1015
|
else {
|
|
1016
1016
|
let n = t.timestamp - t.started;
|
|
@@ -1106,7 +1106,7 @@ var w = class {
|
|
|
1106
1106
|
addBreadcrumb(e, n) {
|
|
1107
1107
|
let r = typeof n == "number" ? n : Fr;
|
|
1108
1108
|
if (r <= 0) return this;
|
|
1109
|
-
let s = { timestamp:
|
|
1109
|
+
let s = { timestamp: G(), ...e }, i = this._breadcrumbs;
|
|
1110
1110
|
return i.push(s), this._breadcrumbs = i.length > r ? i.slice(-r) : i, this._notifyScopeListeners(), this;
|
|
1111
1111
|
}
|
|
1112
1112
|
getLastBreadcrumb() {
|
|
@@ -1163,7 +1163,7 @@ function Rn() {
|
|
|
1163
1163
|
return { traceId: g(), spanId: g().substring(16) };
|
|
1164
1164
|
}
|
|
1165
1165
|
var xn = 4;
|
|
1166
|
-
var
|
|
1166
|
+
var Gr = 100;
|
|
1167
1167
|
var H = class {
|
|
1168
1168
|
constructor(e, n = new w(), r = xn) {
|
|
1169
1169
|
this._version = r, this._stack = [{ scope: n }], e && this.bindClient(e);
|
|
@@ -1226,9 +1226,9 @@ var H = class {
|
|
|
1226
1226
|
addBreadcrumb(e, n) {
|
|
1227
1227
|
let { scope: r, client: s } = this.getStackTop();
|
|
1228
1228
|
if (!s) return;
|
|
1229
|
-
let { beforeBreadcrumb: i = null, maxBreadcrumbs: o =
|
|
1229
|
+
let { beforeBreadcrumb: i = null, maxBreadcrumbs: o = Gr } = s.getOptions && s.getOptions() || {};
|
|
1230
1230
|
if (o <= 0) return;
|
|
1231
|
-
let c = { timestamp:
|
|
1231
|
+
let c = { timestamp: G(), ...e }, u = i ? ye(() => i(c, n)) : c;
|
|
1232
1232
|
u !== null && (s.emit && s.emit("beforeAddBreadcrumb", u, n), r.addBreadcrumb(u, o));
|
|
1233
1233
|
}
|
|
1234
1234
|
setUser(e) {
|
|
@@ -1327,9 +1327,9 @@ function R() {
|
|
|
1327
1327
|
let e = t.__SENTRY__.acs.getCurrentHub();
|
|
1328
1328
|
if (e) return e;
|
|
1329
1329
|
}
|
|
1330
|
-
return
|
|
1330
|
+
return $r(t);
|
|
1331
1331
|
}
|
|
1332
|
-
function
|
|
1332
|
+
function $r(t = Y()) {
|
|
1333
1333
|
return (!Hr(t) || Pe(t).isOlderThan(xn)) && At(t, new H()), Pe(t);
|
|
1334
1334
|
}
|
|
1335
1335
|
function Hr(t) {
|
|
@@ -1368,7 +1368,7 @@ var Me = class {
|
|
|
1368
1368
|
};
|
|
1369
1369
|
var X = class {
|
|
1370
1370
|
constructor(e = {}) {
|
|
1371
|
-
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 || $(), 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);
|
|
1372
1372
|
}
|
|
1373
1373
|
get name() {
|
|
1374
1374
|
return this.description || "";
|
|
@@ -1409,7 +1409,7 @@ var X = class {
|
|
|
1409
1409
|
let { logMessage: n } = this.transaction.metadata.spanMetadata[this.spanId];
|
|
1410
1410
|
n && f.log(n.replace("Starting", "Finishing"));
|
|
1411
1411
|
}
|
|
1412
|
-
this.endTimestamp = typeof e == "number" ? e :
|
|
1412
|
+
this.endTimestamp = typeof e == "number" ? e : $();
|
|
1413
1413
|
}
|
|
1414
1414
|
toTraceparent() {
|
|
1415
1415
|
return ht(this.traceId, this.spanId, this.sampled);
|
|
@@ -1550,7 +1550,7 @@ The transaction will not be sampled. Please use the ${s} instrumentation to star
|
|
|
1550
1550
|
let o = new Ue(t, this);
|
|
1551
1551
|
return o = wn(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;
|
|
1552
1552
|
}
|
|
1553
|
-
function
|
|
1553
|
+
function vn() {
|
|
1554
1554
|
let t = Y();
|
|
1555
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), An());
|
|
1556
1556
|
}
|
|
@@ -1599,7 +1599,7 @@ function Jr(t) {
|
|
|
1599
1599
|
function Kr(t, e) {
|
|
1600
1600
|
return it({ sentry_key: t.publicKey, sentry_version: zr, ...e && { sentry_client: `${e.name}/${e.version}` } });
|
|
1601
1601
|
}
|
|
1602
|
-
function
|
|
1602
|
+
function On(t, e = {}) {
|
|
1603
1603
|
let n = typeof e == "string" ? e : e.tunnel, r = typeof e == "string" || !e._metadata ? void 0 : e._metadata.sdk;
|
|
1604
1604
|
return n || `${Jr(t)}?${Kr(t, r)}`;
|
|
1605
1605
|
}
|
|
@@ -1641,10 +1641,10 @@ function wt(t) {
|
|
|
1641
1641
|
function Mn(t, e) {
|
|
1642
1642
|
let n = {};
|
|
1643
1643
|
return e.forEach((r) => {
|
|
1644
|
-
r &&
|
|
1644
|
+
r && vt(t, r, n);
|
|
1645
1645
|
}), n;
|
|
1646
1646
|
}
|
|
1647
|
-
function
|
|
1647
|
+
function vt(t, e, n) {
|
|
1648
1648
|
if (n[e.name] = e, Pn.indexOf(e.name) === -1 && (e.setupOnce(Sn, R), Pn.push(e.name)), t.on && typeof e.preprocessEvent == "function") {
|
|
1649
1649
|
let r = e.preprocessEvent.bind(e);
|
|
1650
1650
|
t.on("preprocessEvent", (s, i) => r(s, i, t));
|
|
@@ -1660,7 +1660,7 @@ function Qr(t, e) {
|
|
|
1660
1660
|
return -1;
|
|
1661
1661
|
}
|
|
1662
1662
|
function Ln(t, e, n, r, s) {
|
|
1663
|
-
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 || G() }, c = n.integrations || t.integrations.map((p) => p.name);
|
|
1664
1664
|
es(a, t), rs(a, c), e.type === void 0 && ts(a, t.stackParser);
|
|
1665
1665
|
let u = r;
|
|
1666
1666
|
n.captureContext && (u = w.clone(u).update(n.captureContext));
|
|
@@ -1738,7 +1738,7 @@ var Bn = "Not capturing exception because it's already been captured.";
|
|
|
1738
1738
|
var Be = class {
|
|
1739
1739
|
constructor(e) {
|
|
1740
1740
|
if (this._options = e, this._integrations = {}, this._integrationsInitialized = false, this._numProcessing = 0, this._outcomes = {}, this._hooks = {}, this._eventProcessors = [], e.dsn ? this._dsn = Se(e.dsn) : (typeof __SENTRY_DEBUG__ > "u" || __SENTRY_DEBUG__) && f.warn("No DSN provided, client will not send events."), this._dsn) {
|
|
1741
|
-
let n =
|
|
1741
|
+
let n = On(this._dsn, e);
|
|
1742
1742
|
this._transport = e.transport({ recordDroppedEvent: this.recordDroppedEvent.bind(this), ...e.transportOptions, url: n });
|
|
1743
1743
|
}
|
|
1744
1744
|
}
|
|
@@ -1810,7 +1810,7 @@ var Be = class {
|
|
|
1810
1810
|
}
|
|
1811
1811
|
}
|
|
1812
1812
|
addIntegration(e) {
|
|
1813
|
-
|
|
1813
|
+
vt(this, e, this._integrations);
|
|
1814
1814
|
}
|
|
1815
1815
|
sendEvent(e, n = {}) {
|
|
1816
1816
|
this.emit("beforeSendEvent", e, n);
|
|
@@ -1883,7 +1883,7 @@ var Be = class {
|
|
|
1883
1883
|
});
|
|
1884
1884
|
}
|
|
1885
1885
|
_processEvent(e, n, r) {
|
|
1886
|
-
let s = this.getOptions(), { sampleRate: i } = s, o =
|
|
1886
|
+
let s = this.getOptions(), { sampleRate: i } = s, o = Gn(e), a = Fn(e), c = e.type || "error", u = `before send for type \`${c}\``;
|
|
1887
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"));
|
|
1888
1888
|
let l = c === "replay_event" ? "replay" : c;
|
|
1889
1889
|
return this._prepareEvent(e, n, r).then((d) => {
|
|
@@ -1897,8 +1897,8 @@ var Be = class {
|
|
|
1897
1897
|
!o && p && this._updateSessionFromEvent(p, d);
|
|
1898
1898
|
let m = d.transaction_info;
|
|
1899
1899
|
if (o && m && d.transaction !== e.transaction) {
|
|
1900
|
-
let
|
|
1901
|
-
d.transaction_info = { ...m, source:
|
|
1900
|
+
let v = "custom";
|
|
1901
|
+
d.transaction_info = { ...m, source: v };
|
|
1902
1902
|
}
|
|
1903
1903
|
return this.sendEvent(d, n), d;
|
|
1904
1904
|
}).then(null, (d) => {
|
|
@@ -1936,15 +1936,15 @@ function is(t, e) {
|
|
|
1936
1936
|
}
|
|
1937
1937
|
function os(t, e, n) {
|
|
1938
1938
|
let { beforeSend: r, beforeSendTransaction: s } = t;
|
|
1939
|
-
return Fn(e) && r ? r(e, n) :
|
|
1939
|
+
return Fn(e) && r ? r(e, n) : Gn(e) && s ? s(e, n) : e;
|
|
1940
1940
|
}
|
|
1941
1941
|
function Fn(t) {
|
|
1942
1942
|
return t.type === void 0;
|
|
1943
1943
|
}
|
|
1944
|
-
function
|
|
1944
|
+
function Gn(t) {
|
|
1945
1945
|
return t.type === "transaction";
|
|
1946
1946
|
}
|
|
1947
|
-
function
|
|
1947
|
+
function $n(t, e, n, r, s) {
|
|
1948
1948
|
let i = { sent_at: (/* @__PURE__ */ new Date()).toISOString() };
|
|
1949
1949
|
n && n.sdk && (i.sdk = { name: n.sdk.name, version: n.sdk.version }), r && s && (i.dsn = M(s)), e && (i.trace = E(e));
|
|
1950
1950
|
let o = as(t);
|
|
@@ -1955,7 +1955,7 @@ function as(t) {
|
|
|
1955
1955
|
}
|
|
1956
1956
|
var fe = class extends Be {
|
|
1957
1957
|
constructor(e) {
|
|
1958
|
-
|
|
1958
|
+
vn(), super(e);
|
|
1959
1959
|
}
|
|
1960
1960
|
eventFromException(e, n) {
|
|
1961
1961
|
return b(xt(R, this._options.stackParser, e, n));
|
|
@@ -1991,7 +1991,7 @@ var fe = class extends Be {
|
|
|
1991
1991
|
e.status !== "in_progress" && (u.duration = e.duration), n && (u.monitor_config = { schedule: n.schedule, checkin_margin: n.checkinMargin, max_runtime: n.maxRuntime, timezone: n.timezone });
|
|
1992
1992
|
let [l, d] = this._getTraceInfoFromScope(r);
|
|
1993
1993
|
d && (u.contexts = { trace: d });
|
|
1994
|
-
let p =
|
|
1994
|
+
let p = $n(u, l, this.getSdkMetadata(), c, this.getDsn());
|
|
1995
1995
|
return (typeof __SENTRY_DEBUG__ > "u" || __SENTRY_DEBUG__) && f.info("Sending checkin:", e.monitorSlug, e.status), this._sendEnvelope(p), s;
|
|
1996
1996
|
}
|
|
1997
1997
|
_captureRequestSession() {
|
|
@@ -2009,21 +2009,21 @@ var fe = class extends Be {
|
|
|
2009
2009
|
}
|
|
2010
2010
|
};
|
|
2011
2011
|
var cs = 30;
|
|
2012
|
-
function
|
|
2012
|
+
function Ot(t, e, n = ft(t.bufferSize || cs)) {
|
|
2013
2013
|
let r = {}, s = (o) => n.drain(o);
|
|
2014
2014
|
function i(o) {
|
|
2015
2015
|
let a = [];
|
|
2016
|
-
if (
|
|
2016
|
+
if (Oe(o, (d, p) => {
|
|
2017
2017
|
let m = ke(p);
|
|
2018
2018
|
if (Tt(r, m)) {
|
|
2019
|
-
let
|
|
2020
|
-
t.recordDroppedEvent("ratelimit_backoff", m,
|
|
2019
|
+
let v = Hn(d, p);
|
|
2020
|
+
t.recordDroppedEvent("ratelimit_backoff", m, v);
|
|
2021
2021
|
} else a.push(d);
|
|
2022
2022
|
}), a.length === 0) return b();
|
|
2023
2023
|
let c = U(o[0], a), u = (d) => {
|
|
2024
|
-
|
|
2025
|
-
let
|
|
2026
|
-
t.recordDroppedEvent(d, ke(m),
|
|
2024
|
+
Oe(c, (p, m) => {
|
|
2025
|
+
let v = Hn(p, m);
|
|
2026
|
+
t.recordDroppedEvent(d, ke(m), v);
|
|
2027
2027
|
});
|
|
2028
2028
|
}, l = () => e({ body: Et(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 = bt(r, d), d), (d) => {
|
|
2029
2029
|
throw u("network_error"), d;
|
|
@@ -2105,12 +2105,12 @@ var He = class {
|
|
|
2105
2105
|
var Fe = He;
|
|
2106
2106
|
he(Fe, "id", "LinkedErrors");
|
|
2107
2107
|
function _s(t, e, n, r) {
|
|
2108
|
-
if (!n.exception || !n.exception.values || !r || !
|
|
2108
|
+
if (!n.exception || !n.exception.values || !r || !O(r.originalException, Error)) return n;
|
|
2109
2109
|
let s = zn(t, e, r.originalException);
|
|
2110
2110
|
return n.exception.values = [...s, ...n.exception.values], n;
|
|
2111
2111
|
}
|
|
2112
2112
|
function zn(t, e, n, r = []) {
|
|
2113
|
-
if (!
|
|
2113
|
+
if (!O(n.cause, Error) || r.length + 1 >= e) return r;
|
|
2114
2114
|
let s = Wn(t, n.cause);
|
|
2115
2115
|
return zn(t, e, n.cause, [s, ...r]);
|
|
2116
2116
|
}
|
|
@@ -2120,7 +2120,7 @@ var Ye = class {
|
|
|
2120
2120
|
constructor(e = {}) {
|
|
2121
2121
|
he(this, "name", Ye.id);
|
|
2122
2122
|
Ft(this, Q, void 0);
|
|
2123
|
-
|
|
2123
|
+
Gt(this, Q, { ...gs, ...e });
|
|
2124
2124
|
}
|
|
2125
2125
|
setupOnce(e, n) {
|
|
2126
2126
|
n().getClient() && e((s) => {
|
|
@@ -2129,8 +2129,8 @@ var Ye = class {
|
|
|
2129
2129
|
});
|
|
2130
2130
|
}
|
|
2131
2131
|
};
|
|
2132
|
-
var
|
|
2133
|
-
Q = /* @__PURE__ */ new WeakMap(), he(
|
|
2132
|
+
var Ge = Ye;
|
|
2133
|
+
Q = /* @__PURE__ */ new WeakMap(), he(Ge, "id", "RequestData");
|
|
2134
2134
|
function Es(t, e, n) {
|
|
2135
2135
|
let r = e.headers.get("CF-Connecting-IP"), { allowedIps: s } = n, i = { ...t };
|
|
2136
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;
|
|
@@ -2243,11 +2243,11 @@ function Ns(t) {
|
|
|
2243
2243
|
return F(r);
|
|
2244
2244
|
}
|
|
2245
2245
|
}
|
|
2246
|
-
return
|
|
2246
|
+
return Ot(t, e);
|
|
2247
2247
|
}
|
|
2248
|
-
var
|
|
2248
|
+
var $e = class extends H {
|
|
2249
2249
|
constructor(e) {
|
|
2250
|
-
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 Ge(e.requestDataOptions), new Fe()]], e.release === void 0) {
|
|
2251
2251
|
let r = ls();
|
|
2252
2252
|
r !== void 0 && (e.release = r);
|
|
2253
2253
|
}
|
|
@@ -2264,12 +2264,10 @@ var Ge = class extends H {
|
|
|
2264
2264
|
return e.status === "in_progress" && this.setContext("monitor", { slug: e.monitorSlug }), this.getClient().captureCheckIn(e, n, r);
|
|
2265
2265
|
}
|
|
2266
2266
|
};
|
|
2267
|
-
function Vn(t, e, n, r, s) {
|
|
2267
|
+
function Vn(t, e, n, r, s, i, o, a) {
|
|
2268
2268
|
if (!(n && r && s)) return;
|
|
2269
|
-
let
|
|
2270
|
-
i.setTag("colo", o);
|
|
2271
|
-
let a = t.headers.get("user-agent") ?? "UA UNKNOWN";
|
|
2272
|
-
return i.setUser({ userAgent: a, colo: o }), i;
|
|
2269
|
+
let c = new $e({ 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 } } });
|
|
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;
|
|
2273
2271
|
}
|
|
2274
2272
|
var je = class {
|
|
2275
2273
|
constructor(e) {
|
|
@@ -2283,7 +2281,7 @@ var je = class {
|
|
|
2283
2281
|
return this.data[e];
|
|
2284
2282
|
}
|
|
2285
2283
|
write() {
|
|
2286
|
-
this.readyAnalytics && this.readyAnalytics.logEvent({ version: 1, accountId:
|
|
2284
|
+
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] });
|
|
2287
2285
|
}
|
|
2288
2286
|
};
|
|
2289
2287
|
var We = class {
|
|
@@ -2292,7 +2290,7 @@ var We = class {
|
|
|
2292
2290
|
}
|
|
2293
2291
|
async get(e) {
|
|
2294
2292
|
let n = await ws(e), r = Pt(new Uint8Array(this.data, 20), n);
|
|
2295
|
-
return r ?
|
|
2293
|
+
return r ? Os(r) : null;
|
|
2296
2294
|
}
|
|
2297
2295
|
};
|
|
2298
2296
|
var ws = async (t) => {
|
|
@@ -2303,7 +2301,7 @@ var Pt = (t, e) => {
|
|
|
2303
2301
|
if (t.byteLength === 0) return false;
|
|
2304
2302
|
let n = t.byteOffset + (t.byteLength / 40 >> 1) * 40, r = new Uint8Array(t.buffer, n, 16);
|
|
2305
2303
|
if (r.byteLength !== e.byteLength) throw new TypeError("Search value and current value are of different lengths");
|
|
2306
|
-
let s =
|
|
2304
|
+
let s = vs(e, r);
|
|
2307
2305
|
if (s < 0) {
|
|
2308
2306
|
let i = t.byteOffset, o = n - t.byteOffset;
|
|
2309
2307
|
return Pt(new Uint8Array(t.buffer, i, o), e);
|
|
@@ -2312,7 +2310,7 @@ var Pt = (t, e) => {
|
|
|
2312
2310
|
return Pt(new Uint8Array(t.buffer, i, o), e);
|
|
2313
2311
|
} else return new Uint8Array(t.buffer, n, 40);
|
|
2314
2312
|
};
|
|
2315
|
-
var
|
|
2313
|
+
var vs = (t, e) => {
|
|
2316
2314
|
if (t.byteLength < e.byteLength) return -1;
|
|
2317
2315
|
if (t.byteLength > e.byteLength) return 1;
|
|
2318
2316
|
for (let [n, r] of t.entries()) {
|
|
@@ -2321,7 +2319,7 @@ var Os = (t, e) => {
|
|
|
2321
2319
|
}
|
|
2322
2320
|
return 0;
|
|
2323
2321
|
};
|
|
2324
|
-
var
|
|
2322
|
+
var Os = (t) => [...t.slice(16, 16 + 16)].map((n) => n.toString(16).padStart(2, "0")).join("");
|
|
2325
2323
|
var Mt = (t) => ({ html_handling: t?.html_handling ?? "auto-trailing-slash", not_found_handling: t?.not_found_handling ?? "none", serve_directly: t?.serve_directly ?? true });
|
|
2326
2324
|
var ze = class extends Response {
|
|
2327
2325
|
constructor(e, n) {
|
|
@@ -2371,8 +2369,8 @@ var Xn = async (t, e, n, r, s) => {
|
|
|
2371
2369
|
let l = c.redirect ?? a, d = Ls(l);
|
|
2372
2370
|
if (d !== i && c.asset || c.redirect) return new Ke(d + o);
|
|
2373
2371
|
if (!c.asset) return new j(new Error("Unknown action"));
|
|
2374
|
-
let p = await e.JAEGER.enterSpan("getByETag", async (rr) => (rr.setTags({ pathname: i, eTag: c.asset.eTag, status: c.asset.status }), await s(c.asset.eTag))), m = Kn(c.asset.eTag, p.contentType, t),
|
|
2375
|
-
if ([tr,
|
|
2372
|
+
let p = await e.JAEGER.enterSpan("getByETag", async (rr) => (rr.setTags({ pathname: i, eTag: c.asset.eTag, status: c.asset.status }), await s(c.asset.eTag))), m = Kn(c.asset.eTag, p.contentType, t), v = `"${c.asset.eTag}"`, tr = `W/${v}`, nr = t.headers.get("If-None-Match") || "";
|
|
2373
|
+
if ([tr, v].includes(nr)) return new Je(null, { headers: m });
|
|
2376
2374
|
let Lt = u === "HEAD" ? null : p.readableStream;
|
|
2377
2375
|
switch (c.asset.status) {
|
|
2378
2376
|
case 404:
|
|
@@ -2532,14 +2530,9 @@ var er = class extends Fs {
|
|
|
2532
2530
|
async fetch(t) {
|
|
2533
2531
|
let e, n = new je(this.env.ANALYTICS), r = new _e(this.env.UNSAFE_PERFORMANCE), s = r.now();
|
|
2534
2532
|
try {
|
|
2535
|
-
this.env.JAEGER || (this.env.JAEGER = Qn()), e = Vn(t, this.ctx, this.env.SENTRY_DSN, this.env.SENTRY_ACCESS_CLIENT_ID, this.env.SENTRY_ACCESS_CLIENT_SECRET);
|
|
2536
|
-
let i = Mt(this.env.CONFIG), o = t.headers.get("user-agent") ?? "UA UNKNOWN";
|
|
2537
|
-
|
|
2538
|
-
let c = this.env.COLO_METADATA.coloId;
|
|
2539
|
-
e.setTag("colo", this.env.COLO_METADATA.coloId), e.setTag("metal", this.env.COLO_METADATA.metalId), e.setUser({ userAgent: o, colo: c });
|
|
2540
|
-
}
|
|
2541
|
-
let a = new URL(t.url);
|
|
2542
|
-
return this.env.COLO_METADATA && this.env.VERSION_METADATA && n.setData({ 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 }), Xn(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));
|
|
2533
|
+
this.env.JAEGER || (this.env.JAEGER = Qn()), e = Vn(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);
|
|
2534
|
+
let i = Mt(this.env.CONFIG), o = t.headers.get("user-agent") ?? "UA UNKNOWN", a = new URL(t.url);
|
|
2535
|
+
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 }), Xn(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));
|
|
2543
2536
|
} catch (i) {
|
|
2544
2537
|
let o = this.handleError(e, n, i);
|
|
2545
2538
|
return this.submitMetrics(n, r, s), o;
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
// ../workers-shared/dist/router-worker.mjs
|
|
2
|
-
var
|
|
3
|
-
var
|
|
4
|
-
var fe = (t, e, n) => (
|
|
2
|
+
var Cn = Object.defineProperty;
|
|
3
|
+
var Pn = (t, e, n) => e in t ? Cn(t, e, { enumerable: true, configurable: true, writable: true, value: n }) : t[e] = n;
|
|
4
|
+
var fe = (t, e, n) => (Pn(t, typeof e != "symbol" ? e + "" : e, n), n);
|
|
5
5
|
var bt = (t, e, n) => {
|
|
6
6
|
if (!e.has(t)) throw TypeError("Cannot " + n);
|
|
7
7
|
};
|
|
@@ -67,7 +67,7 @@ function O(t, e) {
|
|
|
67
67
|
function qe(t) {
|
|
68
68
|
return !!(typeof t == "object" && t !== null && (t.__isVue || t._isVue));
|
|
69
69
|
}
|
|
70
|
-
function
|
|
70
|
+
function v(t, e = 0) {
|
|
71
71
|
return typeof t != "string" || e === 0 || t.length <= e ? t : `${t.slice(0, e)}...`;
|
|
72
72
|
}
|
|
73
73
|
function me(t) {
|
|
@@ -148,7 +148,7 @@ var Bn = /^(?:(\w+):)\/\/(?:(\w+)(?::(\w+)?)?@)([\w.-]+)(?::(\d+))?\/(.+)/;
|
|
|
148
148
|
function Ln(t) {
|
|
149
149
|
return t === "http" || t === "https";
|
|
150
150
|
}
|
|
151
|
-
function
|
|
151
|
+
function C(t, e = false) {
|
|
152
152
|
let { host: n, path: r, pass: s, port: i, projectId: o, protocol: a, publicKey: c } = t;
|
|
153
153
|
return `${a}://${c}${e && s ? `:${s}` : ""}@${n}${i ? `:${i}` : ""}/${r && `${r}/`}${o}`;
|
|
154
154
|
}
|
|
@@ -185,7 +185,7 @@ var y = class extends Error {
|
|
|
185
185
|
function x(t, e, n) {
|
|
186
186
|
if (!(e in t)) return;
|
|
187
187
|
let r = t[e], s = n(r);
|
|
188
|
-
typeof s == "function" &&
|
|
188
|
+
typeof s == "function" && vt(s, r), t[e] = s;
|
|
189
189
|
}
|
|
190
190
|
function q(t, e, n) {
|
|
191
191
|
try {
|
|
@@ -194,7 +194,7 @@ function q(t, e, n) {
|
|
|
194
194
|
(typeof __SENTRY_DEBUG__ > "u" || __SENTRY_DEBUG__) && p.log(`Failed to add non-enumerable property "${e}" to object`, t);
|
|
195
195
|
}
|
|
196
196
|
}
|
|
197
|
-
function
|
|
197
|
+
function vt(t, e) {
|
|
198
198
|
try {
|
|
199
199
|
let n = e.prototype || {};
|
|
200
200
|
t.prototype = e.prototype = n, q(t, "__sentry_original__", e);
|
|
@@ -205,9 +205,9 @@ function We(t) {
|
|
|
205
205
|
return Object.keys(t).map((e) => `${encodeURIComponent(e)}=${encodeURIComponent(t[e])}`).join("&");
|
|
206
206
|
}
|
|
207
207
|
function ge(t) {
|
|
208
|
-
if (U(t)) return { message: t.message, name: t.name, stack: t.stack, ...
|
|
208
|
+
if (U(t)) return { message: t.message, name: t.name, stack: t.stack, ...wt(t) };
|
|
209
209
|
if ($e(t)) {
|
|
210
|
-
let e = { type: t.type, target: At(t.target), currentTarget: At(t.currentTarget), ...
|
|
210
|
+
let e = { type: t.type, target: At(t.target), currentTarget: At(t.currentTarget), ...wt(t) };
|
|
211
211
|
return typeof CustomEvent < "u" && O(t, CustomEvent) && (e.detail = t.detail), e;
|
|
212
212
|
} else return t;
|
|
213
213
|
}
|
|
@@ -218,7 +218,7 @@ function At(t) {
|
|
|
218
218
|
return "<unknown>";
|
|
219
219
|
}
|
|
220
220
|
}
|
|
221
|
-
function
|
|
221
|
+
function wt(t) {
|
|
222
222
|
if (typeof t == "object" && t !== null) {
|
|
223
223
|
let e = {};
|
|
224
224
|
for (let n in t) Object.prototype.hasOwnProperty.call(t, n) && (e[n] = t[n]);
|
|
@@ -228,10 +228,10 @@ function vt(t) {
|
|
|
228
228
|
function te(t, e = 40) {
|
|
229
229
|
let n = Object.keys(ge(t));
|
|
230
230
|
if (n.sort(), !n.length) return "[object has no keys]";
|
|
231
|
-
if (n[0].length >= e) return
|
|
231
|
+
if (n[0].length >= e) return v(n[0], e);
|
|
232
232
|
for (let r = n.length; r > 0; r--) {
|
|
233
233
|
let s = n.slice(0, r).join(", ");
|
|
234
|
-
if (!(s.length > e)) return r === n.length ? s :
|
|
234
|
+
if (!(s.length > e)) return r === n.length ? s : v(s, e);
|
|
235
235
|
}
|
|
236
236
|
return "";
|
|
237
237
|
}
|
|
@@ -260,7 +260,7 @@ function ze(t, e) {
|
|
|
260
260
|
function $n(t, e = false) {
|
|
261
261
|
return !(e || t && !t.startsWith("/") && !t.includes(":\\") && !t.startsWith(".") && !t.match(/^[a-zA-Z]([a-zA-Z0-9.\-+])*:\/\//)) && t !== void 0 && !t.includes("node_modules/");
|
|
262
262
|
}
|
|
263
|
-
function
|
|
263
|
+
function Ct(t) {
|
|
264
264
|
let e = /^\s*[-]{4,}$/, n = /at (?:async )?(?:(.+?)\s+\()?(?:(.+):(\d+):(\d+)?|([^)]+))\)?/;
|
|
265
265
|
return (r) => {
|
|
266
266
|
let s = r.match(n);
|
|
@@ -284,7 +284,7 @@ function Pt(t) {
|
|
|
284
284
|
};
|
|
285
285
|
}
|
|
286
286
|
var Ut = 50;
|
|
287
|
-
var
|
|
287
|
+
var Pt = /\(error: (.*)\)/;
|
|
288
288
|
var Mt = /captureMessage|captureException/;
|
|
289
289
|
function Ee(...t) {
|
|
290
290
|
let e = t.sort((n, r) => n[0] - r[0]).map((n) => n[1]);
|
|
@@ -294,7 +294,7 @@ function Ee(...t) {
|
|
|
294
294
|
for (let o = r; o < i.length; o++) {
|
|
295
295
|
let a = i[o];
|
|
296
296
|
if (a.length > 1024) continue;
|
|
297
|
-
let c =
|
|
297
|
+
let c = Pt.test(a) ? a.replace(Pt, "$1") : a;
|
|
298
298
|
if (!c.match(/\S*Error: /)) {
|
|
299
299
|
for (let u of e) {
|
|
300
300
|
let f = u(c);
|
|
@@ -309,7 +309,7 @@ function Ee(...t) {
|
|
|
309
309
|
return Gt(s);
|
|
310
310
|
};
|
|
311
311
|
}
|
|
312
|
-
function
|
|
312
|
+
function Ke(t) {
|
|
313
313
|
return Array.isArray(t) ? Ee(...t) : t;
|
|
314
314
|
}
|
|
315
315
|
function Gt(t) {
|
|
@@ -317,16 +317,16 @@ function Gt(t) {
|
|
|
317
317
|
let e = Array.from(t);
|
|
318
318
|
return /sentryWrapped/.test(e[e.length - 1].function || "") && e.pop(), e.reverse(), Mt.test(e[e.length - 1].function || "") && (e.pop(), Mt.test(e[e.length - 1].function || "") && e.pop()), e.slice(0, Ut).map((n) => ({ ...n, filename: n.filename || e[e.length - 1].filename, function: n.function || "?" }));
|
|
319
319
|
}
|
|
320
|
-
var
|
|
320
|
+
var Ve = "<anonymous>";
|
|
321
321
|
function ne(t) {
|
|
322
322
|
try {
|
|
323
|
-
return !t || typeof t != "function" ?
|
|
323
|
+
return !t || typeof t != "function" ? Ve : t.name || Ve;
|
|
324
324
|
} catch {
|
|
325
|
-
return
|
|
325
|
+
return Ve;
|
|
326
326
|
}
|
|
327
327
|
}
|
|
328
328
|
function Je(t) {
|
|
329
|
-
return [90,
|
|
329
|
+
return [90, Ct(t)];
|
|
330
330
|
}
|
|
331
331
|
var Xe = I();
|
|
332
332
|
function jn() {
|
|
@@ -496,10 +496,10 @@ function Wn() {
|
|
|
496
496
|
}
|
|
497
497
|
x(E.history, "pushState", e), x(E.history, "replaceState", e);
|
|
498
498
|
}
|
|
499
|
-
var
|
|
499
|
+
var Vn = 1e3;
|
|
500
500
|
var jt;
|
|
501
501
|
var Te;
|
|
502
|
-
function
|
|
502
|
+
function Kn(t, e) {
|
|
503
503
|
if (t.type !== e.type) return false;
|
|
504
504
|
try {
|
|
505
505
|
if (t.target !== e.target) return false;
|
|
@@ -522,9 +522,9 @@ function Ht(t, e = false) {
|
|
|
522
522
|
if (!n || n._sentryCaptured || Jn(n)) return;
|
|
523
523
|
q(n, "_sentryCaptured", true);
|
|
524
524
|
let r = n.type === "keypress" ? "input" : n.type;
|
|
525
|
-
(Te === void 0 || !
|
|
525
|
+
(Te === void 0 || !Kn(Te, n)) && (t({ event: n, name: r, global: e }), Te = n), clearTimeout(jt), jt = E.setTimeout(() => {
|
|
526
526
|
Te = void 0;
|
|
527
|
-
},
|
|
527
|
+
}, Vn);
|
|
528
528
|
};
|
|
529
529
|
}
|
|
530
530
|
function Wt() {
|
|
@@ -569,11 +569,11 @@ function Zn() {
|
|
|
569
569
|
return D("unhandledrejection", t), Re && !Re.__SENTRY_LOADER__ ? Re.apply(this, arguments) : true;
|
|
570
570
|
}, E.onunhandledrejection.__SENTRY_INSTRUMENTED__ = true;
|
|
571
571
|
}
|
|
572
|
-
function
|
|
572
|
+
function Vt() {
|
|
573
573
|
return typeof __SENTRY_BROWSER_BUNDLE__ < "u" && !!__SENTRY_BROWSER_BUNDLE__;
|
|
574
574
|
}
|
|
575
|
-
function
|
|
576
|
-
return !
|
|
575
|
+
function Kt() {
|
|
576
|
+
return !Vt() && Object.prototype.toString.call(typeof process < "u" ? process : 0) === "[object process]";
|
|
577
577
|
}
|
|
578
578
|
function Jt(t, e) {
|
|
579
579
|
return t.require(e);
|
|
@@ -847,7 +847,7 @@ function ar() {
|
|
|
847
847
|
return;
|
|
848
848
|
}
|
|
849
849
|
}
|
|
850
|
-
var tt =
|
|
850
|
+
var tt = Kt() ? ar() : or();
|
|
851
851
|
var Zt = tt === void 0 ? nt : { nowSeconds: () => (tt.timeOrigin + tt.now()) / 1e3 };
|
|
852
852
|
var B = nt.nowSeconds.bind(nt);
|
|
853
853
|
var L = Zt.nowSeconds.bind(Zt);
|
|
@@ -866,7 +866,7 @@ function rt(t = h(), e = h().substring(16), n) {
|
|
|
866
866
|
let r = "";
|
|
867
867
|
return n !== void 0 && (r = n ? "-1" : "-0"), `${t}-${e}${r}`;
|
|
868
868
|
}
|
|
869
|
-
function
|
|
869
|
+
function P(t, e = []) {
|
|
870
870
|
return [t, e];
|
|
871
871
|
}
|
|
872
872
|
function it(t, e) {
|
|
@@ -926,7 +926,7 @@ function Oe(t) {
|
|
|
926
926
|
}
|
|
927
927
|
function ct(t, e, n, r) {
|
|
928
928
|
let s = t.sdkProcessingMetadata && t.sdkProcessingMetadata.dynamicSamplingContext;
|
|
929
|
-
return { event_id: t.event_id, sent_at: (/* @__PURE__ */ new Date()).toISOString(), ...e && { sdk: e }, ...!!n && r && { dsn:
|
|
929
|
+
return { event_id: t.event_id, sent_at: (/* @__PURE__ */ new Date()).toISOString(), ...e && { sdk: e }, ...!!n && r && { dsn: C(r) }, ...s && { trace: g({ ...s }) } };
|
|
930
930
|
}
|
|
931
931
|
function en(t, e = Date.now()) {
|
|
932
932
|
let n = parseInt(`${t}`, 10);
|
|
@@ -994,21 +994,21 @@ function ue() {
|
|
|
994
994
|
function rn(t) {
|
|
995
995
|
ue().push(t);
|
|
996
996
|
}
|
|
997
|
-
function
|
|
997
|
+
function V(t, e, n, r = 0) {
|
|
998
998
|
return new S((s, i) => {
|
|
999
999
|
let o = t[r];
|
|
1000
1000
|
if (e === null || typeof o != "function") s(e);
|
|
1001
1001
|
else {
|
|
1002
1002
|
let a = o({ ...e }, n);
|
|
1003
|
-
(typeof __SENTRY_DEBUG__ > "u" || __SENTRY_DEBUG__) && o.id && a === null && p.log(`Event processor "${o.id}" dropped event`), G(a) ? a.then((c) =>
|
|
1003
|
+
(typeof __SENTRY_DEBUG__ > "u" || __SENTRY_DEBUG__) && o.id && a === null && p.log(`Event processor "${o.id}" dropped event`), G(a) ? a.then((c) => V(t, c, n, r + 1).then(s)).then(null, i) : V(t, a, n, r + 1).then(s).then(null, i);
|
|
1004
1004
|
}
|
|
1005
1005
|
});
|
|
1006
1006
|
}
|
|
1007
1007
|
function sn(t) {
|
|
1008
1008
|
let e = L(), n = { sid: h(), init: true, timestamp: e, started: e, duration: 0, status: "ok", errors: 0, ignoreDuration: false, toJSON: () => lr(n) };
|
|
1009
|
-
return t &&
|
|
1009
|
+
return t && w(n, t), n;
|
|
1010
1010
|
}
|
|
1011
|
-
function
|
|
1011
|
+
function w(t, e = {}) {
|
|
1012
1012
|
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 || L(), e.abnormal_mechanism && (t.abnormal_mechanism = e.abnormal_mechanism), e.ignoreDuration && (t.ignoreDuration = e.ignoreDuration), e.sid && (t.sid = e.sid.length === 32 ? e.sid : h()), e.init !== void 0 && (t.init = e.init), !t.did && e.did && (t.did = `${e.did}`), typeof e.started == "number" && (t.started = e.started), t.ignoreDuration) t.duration = void 0;
|
|
1013
1013
|
else if (typeof e.duration == "number") t.duration = e.duration;
|
|
1014
1014
|
else {
|
|
@@ -1019,7 +1019,7 @@ function v(t, e = {}) {
|
|
|
1019
1019
|
}
|
|
1020
1020
|
function on(t, e) {
|
|
1021
1021
|
let n = {};
|
|
1022
|
-
e ? n = { status: e } : t.status === "ok" && (n = { status: "exited" }),
|
|
1022
|
+
e ? n = { status: e } : t.status === "ok" && (n = { status: "exited" }), w(t, n);
|
|
1023
1023
|
}
|
|
1024
1024
|
function lr(t) {
|
|
1025
1025
|
return g({ sid: `${t.sid}`, init: t.init, started: new Date(t.started * 1e3).toISOString(), timestamp: new Date(t.timestamp * 1e3).toISOString(), status: t.status, errors: t.errors, did: typeof t.did == "number" || typeof t.did == "string" ? `${t.did}` : void 0, duration: t.duration, abnormal_mechanism: t.abnormal_mechanism, attrs: { release: t.release, environment: t.environment, ip_address: t.ipAddress, user_agent: t.userAgent } });
|
|
@@ -1040,7 +1040,7 @@ var k = class {
|
|
|
1040
1040
|
return this._eventProcessors.push(e), this;
|
|
1041
1041
|
}
|
|
1042
1042
|
setUser(e) {
|
|
1043
|
-
return this._user = e || {}, this._session &&
|
|
1043
|
+
return this._user = e || {}, this._session && w(this._session, { user: e }), this._notifyScopeListeners(), this;
|
|
1044
1044
|
}
|
|
1045
1045
|
getUser() {
|
|
1046
1046
|
return this._user;
|
|
@@ -1135,7 +1135,7 @@ var k = class {
|
|
|
1135
1135
|
}
|
|
1136
1136
|
this._applyFingerprint(e);
|
|
1137
1137
|
let s = this._getBreadcrumbs(), i = [...e.breadcrumbs || [], ...s];
|
|
1138
|
-
return e.breadcrumbs = i.length > 0 ? i : void 0, e.sdkProcessingMetadata = { ...e.sdkProcessingMetadata, ...this._sdkProcessingMetadata, propagationContext: this._propagationContext },
|
|
1138
|
+
return e.breadcrumbs = i.length > 0 ? i : void 0, e.sdkProcessingMetadata = { ...e.sdkProcessingMetadata, ...this._sdkProcessingMetadata, propagationContext: this._propagationContext }, V([...r || [], ...ue(), ...this._eventProcessors], e, n);
|
|
1139
1139
|
}
|
|
1140
1140
|
setSDKProcessingMetadata(e) {
|
|
1141
1141
|
return this._sdkProcessingMetadata = { ...this._sdkProcessingMetadata, ...e }, this;
|
|
@@ -1293,7 +1293,7 @@ Sentry.init({...});
|
|
|
1293
1293
|
}
|
|
1294
1294
|
startSession(e) {
|
|
1295
1295
|
let { scope: n, client: r } = this.getStackTop(), { release: s, environment: i = W } = r && r.getOptions() || {}, { userAgent: o } = m.navigator || {}, a = sn({ release: s, environment: i, user: n.getUser(), ...o && { userAgent: o }, ...e }), c = n.getSession && n.getSession();
|
|
1296
|
-
return c && c.status === "ok" &&
|
|
1296
|
+
return c && c.status === "ok" && w(c, { status: "exited" }), this.endSession(), n.setSession(a), a;
|
|
1297
1297
|
}
|
|
1298
1298
|
shouldSendDefaultPii() {
|
|
1299
1299
|
let e = this.getClient(), n = e && e.getOptions();
|
|
@@ -1357,7 +1357,7 @@ function ht() {
|
|
|
1357
1357
|
}
|
|
1358
1358
|
}
|
|
1359
1359
|
ht.tag = "sentry_tracingErrorCallback";
|
|
1360
|
-
var
|
|
1360
|
+
var we = class {
|
|
1361
1361
|
constructor(e = 1e3) {
|
|
1362
1362
|
this._maxlen = e, this.spans = [];
|
|
1363
1363
|
}
|
|
@@ -1365,7 +1365,7 @@ var ve = class {
|
|
|
1365
1365
|
this.spans.length > this._maxlen ? e.spanRecorder = void 0 : this.spans.push(e);
|
|
1366
1366
|
}
|
|
1367
1367
|
};
|
|
1368
|
-
var
|
|
1368
|
+
var K = class {
|
|
1369
1369
|
constructor(e = {}) {
|
|
1370
1370
|
this.traceId = e.traceId || h(), this.spanId = e.spanId || h().substring(16), this.startTimestamp = e.startTimestamp || L(), 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);
|
|
1371
1371
|
}
|
|
@@ -1376,7 +1376,7 @@ var V = class {
|
|
|
1376
1376
|
this.setName(e);
|
|
1377
1377
|
}
|
|
1378
1378
|
startChild(e) {
|
|
1379
|
-
let n = new
|
|
1379
|
+
let n = new K({ ...e, parentSpanId: this.spanId, sampled: this.sampled, traceId: this.traceId });
|
|
1380
1380
|
if (n.spanRecorder = this.spanRecorder, n.spanRecorder && n.spanRecorder.add(n), n.transaction = this.transaction, (typeof __SENTRY_DEBUG__ > "u" || __SENTRY_DEBUG__) && n.transaction) {
|
|
1381
1381
|
let r = e && e.op || "< unknown op >", s = n.transaction.name || "< unknown name >", i = n.transaction.spanId, o = `[Tracing] Starting '${r}' span on transaction '${s}' (${i}).`;
|
|
1382
1382
|
n.transaction.metadata.spanMetadata[n.spanId] = { logMessage: o }, p.log(o);
|
|
@@ -1460,7 +1460,7 @@ function J(t, e, n) {
|
|
|
1460
1460
|
let r = e.getOptions(), { publicKey: s } = e.getDsn() || {}, { segment: i } = n && n.getUser() || {}, o = g({ environment: r.environment || W, release: r.release, user_segment: i, public_key: s, trace_id: t });
|
|
1461
1461
|
return e.emit && e.emit("createDsc", o), o;
|
|
1462
1462
|
}
|
|
1463
|
-
var
|
|
1463
|
+
var ve = class extends K {
|
|
1464
1464
|
constructor(e, n) {
|
|
1465
1465
|
super(e), delete this.description, this._measurements = {}, this._contexts = {}, this._hub = n || b(), this._name = e.name || "", this.metadata = { source: "custom", ...e.metadata, spanMetadata: {} }, this._trimEnd = e.trimEnd, this.transaction = this;
|
|
1466
1466
|
let r = this.metadata.dynamicSamplingContext;
|
|
@@ -1476,7 +1476,7 @@ var we = class extends V {
|
|
|
1476
1476
|
this._name = e, this.metadata.source = n;
|
|
1477
1477
|
}
|
|
1478
1478
|
initSpanRecorder(e = 1e3) {
|
|
1479
|
-
this.spanRecorder || (this.spanRecorder = new
|
|
1479
|
+
this.spanRecorder || (this.spanRecorder = new we(e)), this.spanRecorder.add(this);
|
|
1480
1480
|
}
|
|
1481
1481
|
setContext(e, n) {
|
|
1482
1482
|
n === null ? delete this._contexts[e] : this._contexts[e] = n;
|
|
@@ -1546,14 +1546,14 @@ function Tr(t, e) {
|
|
|
1546
1546
|
let n = this.getClient(), r = n && n.getOptions() || {}, s = r.instrumenter || "sentry", i = t.instrumenter || "sentry";
|
|
1547
1547
|
s !== i && ((typeof __SENTRY_DEBUG__ > "u" || __SENTRY_DEBUG__) && p.error(`A transaction was started with instrumenter=\`${i}\`, but the SDK is configured with the \`${s}\` instrumenter.
|
|
1548
1548
|
The transaction will not be sampled. Please use the ${s} instrumentation to start transactions.`), t.sampled = false);
|
|
1549
|
-
let o = new
|
|
1549
|
+
let o = new ve(t, this);
|
|
1550
1550
|
return o = ln(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;
|
|
1551
1551
|
}
|
|
1552
1552
|
function mn() {
|
|
1553
1553
|
let t = $();
|
|
1554
1554
|
t.__SENTRY__ && (t.__SENTRY__.extensions = t.__SENTRY__.extensions || {}, t.__SENTRY__.extensions.startTransaction || (t.__SENTRY__.extensions.startTransaction = Tr), t.__SENTRY__.extensions.traceHeaders || (t.__SENTRY__.extensions.traceHeaders = yr), fn());
|
|
1555
1555
|
}
|
|
1556
|
-
var
|
|
1556
|
+
var Ce = class {
|
|
1557
1557
|
constructor(e, n) {
|
|
1558
1558
|
this._client = e, this.flushTimeout = 60, this._pendingAggregates = {}, this._isEnabled = true, this._intervalId = setInterval(() => this.flush(), this.flushTimeout * 1e3), this._sessionAttrs = n;
|
|
1559
1559
|
}
|
|
@@ -1606,14 +1606,14 @@ function Dr(t, e) {
|
|
|
1606
1606
|
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;
|
|
1607
1607
|
}
|
|
1608
1608
|
function hn(t, e, n, r) {
|
|
1609
|
-
let s = Oe(n), i = { sent_at: (/* @__PURE__ */ new Date()).toISOString(), ...s && { sdk: s }, ...!!r && e && { dsn:
|
|
1610
|
-
return
|
|
1609
|
+
let s = Oe(n), i = { sent_at: (/* @__PURE__ */ new Date()).toISOString(), ...s && { sdk: s }, ...!!r && e && { dsn: C(e) } }, o = "aggregates" in t ? [{ type: "sessions" }, t] : [{ type: "session" }, t.toJSON()];
|
|
1610
|
+
return P(i, [o]);
|
|
1611
1611
|
}
|
|
1612
1612
|
function gn(t, e, n, r) {
|
|
1613
1613
|
let s = Oe(n), i = t.type && t.type !== "replay_event" ? t.type : "event";
|
|
1614
1614
|
Dr(t, n && n.sdk);
|
|
1615
1615
|
let o = ct(t, s, r, e);
|
|
1616
|
-
return delete t.sdkProcessingMetadata,
|
|
1616
|
+
return delete t.sdkProcessingMetadata, P(o, [[{ type: i }, t]]);
|
|
1617
1617
|
}
|
|
1618
1618
|
var En = [];
|
|
1619
1619
|
function Nr(t) {
|
|
@@ -1660,7 +1660,7 @@ function kr(t, e) {
|
|
|
1660
1660
|
}
|
|
1661
1661
|
function Tn(t, e, n, r, s) {
|
|
1662
1662
|
let { normalizeDepth: i = 3, normalizeMaxBreadth: o = 1e3 } = t, a = { ...e, event_id: e.event_id || n.event_id || h(), timestamp: e.timestamp || B() }, c = n.integrations || t.integrations.map((l) => l.name);
|
|
1663
|
-
Or(a, t),
|
|
1663
|
+
Or(a, t), vr(a, c), e.type === void 0 && Ar(a, t.stackParser);
|
|
1664
1664
|
let u = r;
|
|
1665
1665
|
n.captureContext && (u = k.clone(u).update(n.captureContext));
|
|
1666
1666
|
let f = T(a), d = s && s.getEventProcessors ? s.getEventProcessors() : [];
|
|
@@ -1670,16 +1670,16 @@ function Tn(t, e, n, r, s) {
|
|
|
1670
1670
|
l.length && (n.attachments = l);
|
|
1671
1671
|
}
|
|
1672
1672
|
f = u.applyToEvent(a, n, d);
|
|
1673
|
-
} else f =
|
|
1674
|
-
return f.then((l) => (l &&
|
|
1673
|
+
} else f = V([...d, ...ue()], a, n);
|
|
1674
|
+
return f.then((l) => (l && wr(l), typeof i == "number" && i > 0 ? Cr(l, i, o) : l));
|
|
1675
1675
|
}
|
|
1676
1676
|
function Or(t, e) {
|
|
1677
1677
|
let { environment: n, release: r, dist: s, maxValueLength: i = 250 } = e;
|
|
1678
|
-
"environment" in t || (t.environment = "environment" in e ? n : W), t.release === void 0 && r !== void 0 && (t.release = r), t.dist === void 0 && s !== void 0 && (t.dist = s), t.message && (t.message =
|
|
1678
|
+
"environment" in t || (t.environment = "environment" in e ? n : W), t.release === void 0 && r !== void 0 && (t.release = r), t.dist === void 0 && s !== void 0 && (t.dist = s), t.message && (t.message = v(t.message, i));
|
|
1679
1679
|
let o = t.exception && t.exception.values && t.exception.values[0];
|
|
1680
|
-
o && o.value && (o.value =
|
|
1680
|
+
o && o.value && (o.value = v(o.value, i));
|
|
1681
1681
|
let a = t.request;
|
|
1682
|
-
a && a.url && (a.url =
|
|
1682
|
+
a && a.url && (a.url = v(a.url, i));
|
|
1683
1683
|
}
|
|
1684
1684
|
var yn = /* @__PURE__ */ new WeakMap();
|
|
1685
1685
|
function Ar(t, e) {
|
|
@@ -1708,7 +1708,7 @@ function Ar(t, e) {
|
|
|
1708
1708
|
} catch {
|
|
1709
1709
|
}
|
|
1710
1710
|
}
|
|
1711
|
-
function
|
|
1711
|
+
function wr(t) {
|
|
1712
1712
|
let e = {};
|
|
1713
1713
|
try {
|
|
1714
1714
|
t.exception.values.forEach((r) => {
|
|
@@ -1725,16 +1725,16 @@ function vr(t) {
|
|
|
1725
1725
|
n.push({ type: "sourcemap", code_file: r, debug_id: e[r] });
|
|
1726
1726
|
});
|
|
1727
1727
|
}
|
|
1728
|
-
function
|
|
1728
|
+
function vr(t, e) {
|
|
1729
1729
|
e.length > 0 && (t.sdk = t.sdk || {}, t.sdk.integrations = [...t.sdk.integrations || [], ...e]);
|
|
1730
1730
|
}
|
|
1731
|
-
function
|
|
1731
|
+
function Cr(t, e, n) {
|
|
1732
1732
|
if (!t) return null;
|
|
1733
1733
|
let r = { ...t, ...t.breadcrumbs && { breadcrumbs: t.breadcrumbs.map((s) => ({ ...s, ...s.data && { data: N(s.data, e, n) } })) }, ...t.user && { user: N(t.user, e, n) }, ...t.contexts && { contexts: N(t.contexts, e, n) }, ...t.extra && { extra: N(t.extra, e, n) } };
|
|
1734
1734
|
return t.contexts && t.contexts.trace && r.contexts && (r.contexts.trace = t.contexts.trace, t.contexts.trace.data && (r.contexts.trace.data = N(t.contexts.trace.data, e, n))), t.spans && (r.spans = t.spans.map((s) => (s.data && (s.data = N(s.data, e, n)), s))), r;
|
|
1735
1735
|
}
|
|
1736
1736
|
var bn = "Not capturing exception because it's already been captured.";
|
|
1737
|
-
var
|
|
1737
|
+
var Pe = class {
|
|
1738
1738
|
constructor(e) {
|
|
1739
1739
|
if (this._options = e, this._integrations = {}, this._integrationsInitialized = false, this._numProcessing = 0, this._outcomes = {}, this._hooks = {}, this._eventProcessors = [], e.dsn ? this._dsn = he(e.dsn) : (typeof __SENTRY_DEBUG__ > "u" || __SENTRY_DEBUG__) && p.warn("No DSN provided, client will not send events."), this._dsn) {
|
|
1740
1740
|
let n = _n(this._dsn, e);
|
|
@@ -1768,7 +1768,7 @@ var Ce = class {
|
|
|
1768
1768
|
})), s;
|
|
1769
1769
|
}
|
|
1770
1770
|
captureSession(e) {
|
|
1771
|
-
typeof e.release != "string" ? (typeof __SENTRY_DEBUG__ > "u" || __SENTRY_DEBUG__) && p.warn("Discarded session because of missing or non-string release") : (this.sendSession(e),
|
|
1771
|
+
typeof e.release != "string" ? (typeof __SENTRY_DEBUG__ > "u" || __SENTRY_DEBUG__) && p.warn("Discarded session because of missing or non-string release") : (this.sendSession(e), w(e, { init: false }));
|
|
1772
1772
|
}
|
|
1773
1773
|
getDsn() {
|
|
1774
1774
|
return this._dsn;
|
|
@@ -1847,7 +1847,7 @@ var Ce = class {
|
|
|
1847
1847
|
}
|
|
1848
1848
|
}
|
|
1849
1849
|
let o = e.status === "ok";
|
|
1850
|
-
(o && e.errors === 0 || o && r) && (
|
|
1850
|
+
(o && e.errors === 0 || o && r) && (w(e, { ...r && { status: "crashed" }, errors: e.errors || Number(s || r) }), this.captureSession(e));
|
|
1851
1851
|
}
|
|
1852
1852
|
_isClientDoneProcessing(e) {
|
|
1853
1853
|
return new S((n) => {
|
|
@@ -1889,7 +1889,7 @@ var Ce = class {
|
|
|
1889
1889
|
if (d === null) throw this.recordDroppedEvent("event_processor", f, e), new y("An event processor returned `null`, will not send event.", "log");
|
|
1890
1890
|
if (n.data && n.data.__sentry__ === true) return d;
|
|
1891
1891
|
let _ = Mr(s, d, n);
|
|
1892
|
-
return
|
|
1892
|
+
return Pr(_, u);
|
|
1893
1893
|
}).then((d) => {
|
|
1894
1894
|
if (d === null) throw this.recordDroppedEvent("before_send", f, e), new y(`${u} returned \`null\`, will not send event.`, "log");
|
|
1895
1895
|
let l = r && r.getSession();
|
|
@@ -1922,7 +1922,7 @@ Reason: ${d}`));
|
|
|
1922
1922
|
});
|
|
1923
1923
|
}
|
|
1924
1924
|
};
|
|
1925
|
-
function
|
|
1925
|
+
function Pr(t, e) {
|
|
1926
1926
|
let n = `${e} must return \`null\` or a valid event.`;
|
|
1927
1927
|
if (G(t)) return t.then((r) => {
|
|
1928
1928
|
if (!R(r) && r !== null) throw new y(n);
|
|
@@ -1945,14 +1945,14 @@ function xn(t) {
|
|
|
1945
1945
|
}
|
|
1946
1946
|
function In(t, e, n, r, s) {
|
|
1947
1947
|
let i = { sent_at: (/* @__PURE__ */ new Date()).toISOString() };
|
|
1948
|
-
n && n.sdk && (i.sdk = { name: n.sdk.name, version: n.sdk.version }), r && s && (i.dsn =
|
|
1948
|
+
n && n.sdk && (i.sdk = { name: n.sdk.name, version: n.sdk.version }), r && s && (i.dsn = C(s)), e && (i.trace = g(e));
|
|
1949
1949
|
let o = Ur(t);
|
|
1950
|
-
return
|
|
1950
|
+
return P(i, [o]);
|
|
1951
1951
|
}
|
|
1952
1952
|
function Ur(t) {
|
|
1953
1953
|
return [{ type: "check_in" }, t];
|
|
1954
1954
|
}
|
|
1955
|
-
var de = class extends
|
|
1955
|
+
var de = class extends Pe {
|
|
1956
1956
|
constructor(e) {
|
|
1957
1957
|
mn(), super(e);
|
|
1958
1958
|
}
|
|
@@ -1981,7 +1981,7 @@ var de = class extends Ce {
|
|
|
1981
1981
|
}
|
|
1982
1982
|
initSessionFlusher() {
|
|
1983
1983
|
let { release: e, environment: n } = this._options;
|
|
1984
|
-
e ? this._sessionFlusher = new
|
|
1984
|
+
e ? this._sessionFlusher = new Ce(this, { release: e, environment: n }) : (typeof __SENTRY_DEBUG__ > "u" || __SENTRY_DEBUG__) && p.warn("Cannot initialise an instance of SessionFlusher if no release is provided!");
|
|
1985
1985
|
}
|
|
1986
1986
|
captureCheckIn(e, n, r) {
|
|
1987
1987
|
let s = e.status !== "in_progress" && e.checkInId ? e.checkInId : h();
|
|
@@ -2019,7 +2019,7 @@ function St(t, e, n = et(t.bufferSize || Gr)) {
|
|
|
2019
2019
|
t.recordDroppedEvent("ratelimit_backoff", _, M);
|
|
2020
2020
|
} else a.push(d);
|
|
2021
2021
|
}), a.length === 0) return T();
|
|
2022
|
-
let c =
|
|
2022
|
+
let c = P(o[0], a), u = (d) => {
|
|
2023
2023
|
Ne(c, (l, _) => {
|
|
2024
2024
|
let M = Dn(l, _);
|
|
2025
2025
|
t.recordDroppedEvent(d, ke(_), M);
|
|
@@ -2105,13 +2105,13 @@ var Me = Fe;
|
|
|
2105
2105
|
fe(Me, "id", "LinkedErrors");
|
|
2106
2106
|
function qr(t, e, n, r) {
|
|
2107
2107
|
if (!n.exception || !n.exception.values || !r || !O(r.originalException, Error)) return n;
|
|
2108
|
-
let s =
|
|
2108
|
+
let s = wn(t, e, r.originalException);
|
|
2109
2109
|
return n.exception.values = [...s, ...n.exception.values], n;
|
|
2110
2110
|
}
|
|
2111
|
-
function
|
|
2111
|
+
function wn(t, e, n, r = []) {
|
|
2112
2112
|
if (!O(n.cause, Error) || r.length + 1 >= e) return r;
|
|
2113
2113
|
let s = An(t, n.cause);
|
|
2114
|
-
return
|
|
2114
|
+
return wn(t, e, n.cause, [s, ...r]);
|
|
2115
2115
|
}
|
|
2116
2116
|
var zr = { allowedHeaders: ["CF-RAY", "CF-Worker"] };
|
|
2117
2117
|
var X;
|
|
@@ -2124,7 +2124,7 @@ var Be = class {
|
|
|
2124
2124
|
setupOnce(e, n) {
|
|
2125
2125
|
n().getClient() && e((s) => {
|
|
2126
2126
|
let { sdkProcessingMetadata: i } = s;
|
|
2127
|
-
return !n().getIntegration(Be) || !i || ("request" in i && i.request instanceof Request && (s.request =
|
|
2127
|
+
return !n().getIntegration(Be) || !i || ("request" in i && i.request instanceof Request && (s.request = Vr(i.request, Ye(this, X)), s.user = Wr(s.user ?? {}, i.request, Ye(this, X))), "requestData" in i && (s.request ? s.request.data = i.requestData : s.request = { data: i.requestData })), s;
|
|
2128
2128
|
});
|
|
2129
2129
|
}
|
|
2130
2130
|
};
|
|
@@ -2132,9 +2132,9 @@ var Ue = Be;
|
|
|
2132
2132
|
X = /* @__PURE__ */ new WeakMap(), fe(Ue, "id", "RequestData");
|
|
2133
2133
|
function Wr(t, e, n) {
|
|
2134
2134
|
let r = e.headers.get("CF-Connecting-IP"), { allowedIps: s } = n, i = { ...t };
|
|
2135
|
-
return !("ip_address" in t) && r && s !== void 0 &&
|
|
2135
|
+
return !("ip_address" in t) && r && s !== void 0 && Kr(r, s) && (i.ip_address = r), Object.keys(i).length > 0 ? i : void 0;
|
|
2136
2136
|
}
|
|
2137
|
-
function
|
|
2137
|
+
function Vr(t, e) {
|
|
2138
2138
|
let n = t.headers.get("cookie"), r;
|
|
2139
2139
|
if (n) try {
|
|
2140
2140
|
r = Jr(n);
|
|
@@ -2159,7 +2159,7 @@ function Kr(t, e) {
|
|
|
2159
2159
|
} else delete i.query_string;
|
|
2160
2160
|
return i;
|
|
2161
2161
|
}
|
|
2162
|
-
function
|
|
2162
|
+
function Kr(t, e) {
|
|
2163
2163
|
return typeof e == "boolean" ? e : e instanceof RegExp ? e.test(t) : Array.isArray(e) ? e.map((r) => r.toLowerCase()).includes(t) : false;
|
|
2164
2164
|
}
|
|
2165
2165
|
function yt(t, e) {
|
|
@@ -2250,7 +2250,7 @@ var Ge = class extends Y {
|
|
|
2250
2250
|
let r = Lr();
|
|
2251
2251
|
r !== void 0 && (e.release = r);
|
|
2252
2252
|
}
|
|
2253
|
-
let n = new Tt({ ...e, transport: ts, integrations: gt(e), stackParser:
|
|
2253
|
+
let n = new Tt({ ...e, transport: ts, integrations: gt(e), stackParser: Ke(e.stackParser || es), transportOptions: { ...e.transportOptions, context: e.context } });
|
|
2254
2254
|
super(n), n.setSdk(this), n.setupIntegrations();
|
|
2255
2255
|
}
|
|
2256
2256
|
setRequestBody(e) {
|
|
@@ -2263,12 +2263,10 @@ var Ge = class extends Y {
|
|
|
2263
2263
|
return e.status === "in_progress" && this.setContext("monitor", { slug: e.monitorSlug }), this.getClient().captureCheckIn(e, n, r);
|
|
2264
2264
|
}
|
|
2265
2265
|
};
|
|
2266
|
-
function
|
|
2266
|
+
function vn(t, e, n, r, s, i, o, a) {
|
|
2267
2267
|
if (!(n && r && s)) return;
|
|
2268
|
-
let
|
|
2269
|
-
i.setTag("colo", o);
|
|
2270
|
-
let a = t.headers.get("user-agent") ?? "UA UNKNOWN";
|
|
2271
|
-
return i.setUser({ userAgent: a, colo: o }), i;
|
|
2268
|
+
let c = new Ge({ 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 } } });
|
|
2269
|
+
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;
|
|
2272
2270
|
}
|
|
2273
2271
|
var Le = class {
|
|
2274
2272
|
constructor(e) {
|
|
@@ -2282,15 +2280,15 @@ var Le = class {
|
|
|
2282
2280
|
return this.data[e];
|
|
2283
2281
|
}
|
|
2284
2282
|
write() {
|
|
2285
|
-
this.readyAnalytics && this.readyAnalytics.logEvent({ version: 1, accountId:
|
|
2283
|
+
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.userWorkerAhead === void 0 ? -1 : Number(this.data.userWorkerAhead)], blobs: [this.data.hostname?.substring(0, 256), this.data.dispatchtype, this.data.error?.substring(0, 256), this.data.version, this.data.coloRegion] });
|
|
2286
2284
|
}
|
|
2287
2285
|
};
|
|
2288
2286
|
var Za = { async fetch(t, e, n) {
|
|
2289
2287
|
let r, s = new Le(e.ANALYTICS), i = new pe(e.UNSAFE_PERFORMANCE), o = i.now();
|
|
2290
2288
|
try {
|
|
2291
|
-
r =
|
|
2289
|
+
r = vn(t, n, e.SENTRY_DSN, e.SENTRY_ACCESS_CLIENT_ID, e.SENTRY_ACCESS_CLIENT_SECRET, e.COLO_METADATA, e.CONFIG?.account_id, e.CONFIG?.script_id);
|
|
2292
2290
|
let a = new URL(t.url);
|
|
2293
|
-
|
|
2291
|
+
e.COLO_METADATA && e.VERSION_METADATA && e.CONFIG && s.setData({ accountId: e.CONFIG.account_id, scriptId: e.CONFIG.script_id, coloId: e.COLO_METADATA.coloId, metalId: e.COLO_METADATA.metalId, coloTier: e.COLO_METADATA.coloTier, coloRegion: e.COLO_METADATA.coloRegion, hostname: a.hostname, version: e.VERSION_METADATA.id, userWorkerAhead: e.CONFIG.invoke_user_worker_ahead_of_assets });
|
|
2294
2292
|
let c = t.clone();
|
|
2295
2293
|
if (e.CONFIG.invoke_user_worker_ahead_of_assets) {
|
|
2296
2294
|
if (!e.CONFIG.has_user_worker) throw new Error("Fetch for user worker without having a user worker binding");
|
package/dist/index.js
CHANGED
|
@@ -1268,7 +1268,10 @@ var CloudflareDevEnvironment = class extends vite2.DevEnvironment {
|
|
|
1268
1268
|
}
|
|
1269
1269
|
}
|
|
1270
1270
|
);
|
|
1271
|
-
assert(
|
|
1271
|
+
assert(
|
|
1272
|
+
response.ok,
|
|
1273
|
+
`Failed to initialize module runner, error: ${await response.text()}`
|
|
1274
|
+
);
|
|
1272
1275
|
const webSocket = response.webSocket;
|
|
1273
1276
|
assert(webSocket, "Failed to establish WebSocket");
|
|
1274
1277
|
webSocket.accept();
|
|
@@ -1531,7 +1531,14 @@ function createWorkerEntrypointWrapper(entrypoint) {
|
|
|
1531
1531
|
const url = new URL(request.url);
|
|
1532
1532
|
if (url.pathname === INIT_PATH) {
|
|
1533
1533
|
const { 0: client, 1: server } = new WebSocketPair();
|
|
1534
|
-
|
|
1534
|
+
try {
|
|
1535
|
+
await createModuleRunner(this.env, server);
|
|
1536
|
+
} catch (e) {
|
|
1537
|
+
return new Response(
|
|
1538
|
+
e instanceof Error ? e.message : JSON.stringify(e),
|
|
1539
|
+
{ status: 500 }
|
|
1540
|
+
);
|
|
1541
|
+
}
|
|
1535
1542
|
return new Response(null, { status: 101, webSocket: client });
|
|
1536
1543
|
}
|
|
1537
1544
|
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@cloudflare/vite-plugin",
|
|
3
|
-
"version": "0.0.
|
|
3
|
+
"version": "0.0.2",
|
|
4
4
|
"description": "Cloudflare plugin for Vite",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"cloudflare",
|
|
@@ -43,12 +43,12 @@
|
|
|
43
43
|
"@types/node": "^22.10.1",
|
|
44
44
|
"@types/ws": "^8.5.13",
|
|
45
45
|
"magic-string": "^0.30.12",
|
|
46
|
-
"tsup": "
|
|
46
|
+
"tsup": "8.3.0",
|
|
47
47
|
"typescript": "^5.7.2",
|
|
48
48
|
"vite": "^6.0.7",
|
|
49
|
-
"@cloudflare/workers-shared": "0.12.
|
|
49
|
+
"@cloudflare/workers-shared": "0.12.3",
|
|
50
50
|
"@cloudflare/workers-tsconfig": "0.0.0",
|
|
51
|
-
"wrangler": "3.
|
|
51
|
+
"wrangler": "3.105.0"
|
|
52
52
|
},
|
|
53
53
|
"peerDependencies": {
|
|
54
54
|
"vite": "^6.0.7",
|
|
@@ -63,8 +63,8 @@
|
|
|
63
63
|
"scripts": {
|
|
64
64
|
"build": "tsup",
|
|
65
65
|
"check:type": "tsc --build",
|
|
66
|
+
"dev": "tsup --watch",
|
|
66
67
|
"test": "vitest",
|
|
67
|
-
"test:ci": "vitest run"
|
|
68
|
-
"watch": "tsup --watch"
|
|
68
|
+
"test:ci": "vitest run"
|
|
69
69
|
}
|
|
70
70
|
}
|