@blueking/open-telemetry 0.0.29 → 0.0.31
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/bk-rum.global.js +1 -1
- package/dist/bk-rum.global.js.map +1 -1
- package/dist/index.js +349 -397
- package/dist/index.js.map +1 -1
- package/dist/plugins/blank-screen.d.ts +0 -2
- package/dist/plugins/device.d.ts +0 -1
- package/dist/plugins/web-vitals.d.ts +0 -7
- package/dist/schema/attributes.d.ts +3 -8
- package/dist/schema/span.d.ts +1 -3
- package/package.json +1 -1
- package/skills/bk-rum-otele/SKILL.md +2 -1
- package/skills/bk-rum-otele/references/actions.md +1 -1
- package/skills/bk-rum-otele/references/data-model.md +3 -1
- package/skills/bk-rum-otele/references/network.md +6 -2
- package/skills/bk-rum-otele/references/privacy.md +1 -1
- package/skills/bk-rum-otele/references/span-protocol.md +667 -0
- package/skills/bk-rum-otele/references/telemetry-reference.md +7 -6
- package/skills/bk-rum-otele/references/views-routing.md +4 -3
package/dist/index.js
CHANGED
|
@@ -6,31 +6,25 @@ import { resourceFromAttributes as c } from "@opentelemetry/resources";
|
|
|
6
6
|
import { BatchSpanProcessor as l, SamplingDecision as u, SimpleSpanProcessor as d } from "@opentelemetry/sdk-trace-base";
|
|
7
7
|
import { WebTracerProvider as f } from "@opentelemetry/sdk-trace-web";
|
|
8
8
|
//#region package.json
|
|
9
|
-
var p = "0.0.
|
|
9
|
+
var p = "0.0.31", m = (e) => {
|
|
10
10
|
let t = 5381;
|
|
11
11
|
for (let n = 0; n < e.length; n++) t = t * 33 ^ e.charCodeAt(n);
|
|
12
12
|
return (t >>> 0).toString(36);
|
|
13
13
|
}, h = (e) => typeof crypto < "u" && typeof crypto.randomUUID == "function" ? crypto.randomUUID() : `${e}-${Date.now()}-${Math.random().toString(16).slice(2)}`, g = {
|
|
14
14
|
actionFrustrationType: "action.frustration.type",
|
|
15
15
|
actionId: "action.id",
|
|
16
|
-
actionLoadingTime: "action.loading_time",
|
|
17
|
-
actionName: "action.name",
|
|
18
16
|
actionTargetName: "action.target.name",
|
|
19
17
|
actionTargetTag: "action.target.tag",
|
|
20
18
|
actionType: "action.type",
|
|
21
19
|
deploymentEnvironmentName: "deployment.environment.name",
|
|
22
20
|
cacheHit: "resource.cache.hit",
|
|
23
|
-
deviceMemoryGib: "device.memory_gib",
|
|
24
21
|
deviceType: "device.type",
|
|
25
22
|
longTaskBlockingDuration: "long_task.blocking_duration",
|
|
26
|
-
longTaskDuration: "long_task.duration",
|
|
27
23
|
longTaskEntryType: "long_task.entry_type",
|
|
28
24
|
longTaskId: "long_task.id",
|
|
29
|
-
longTaskStartTime: "long_task.start_time",
|
|
30
25
|
networkEffectiveType: "network.effective_type",
|
|
31
26
|
networkStatus: "network.status",
|
|
32
27
|
nextHopProtocol: "resource.protocol",
|
|
33
|
-
outcomeReason: "outcome.reason",
|
|
34
28
|
outcomeType: "outcome.type",
|
|
35
29
|
serviceName: "service.name",
|
|
36
30
|
serviceVersion: "service.version",
|
|
@@ -38,7 +32,6 @@ var p = "0.0.29", m = (e) => {
|
|
|
38
32
|
sessionId: "session.id",
|
|
39
33
|
sessionSampleRate: "session.sample_rate",
|
|
40
34
|
sessionPhase: "session.phase",
|
|
41
|
-
sessionStartTime: "session.start_time",
|
|
42
35
|
sessionType: "session.type",
|
|
43
36
|
spanType: "span_type",
|
|
44
37
|
userId: "user.id",
|
|
@@ -46,7 +39,6 @@ var p = "0.0.29", m = (e) => {
|
|
|
46
39
|
userAgentOsName: "user_agent.os.name",
|
|
47
40
|
userAgentVersion: "user_agent.version",
|
|
48
41
|
vitalMetric: "vital.metric",
|
|
49
|
-
vitalRating: "vital.rating",
|
|
50
42
|
vitalValue: "vital.value",
|
|
51
43
|
viewDomComplete: "view.dom_complete",
|
|
52
44
|
viewDomContentLoaded: "view.dom_content_loaded",
|
|
@@ -59,6 +51,9 @@ var p = "0.0.29", m = (e) => {
|
|
|
59
51
|
viewLoadingType: "view.loading_type",
|
|
60
52
|
viewName: "view.name",
|
|
61
53
|
viewPhase: "view.phase",
|
|
54
|
+
viewPrevious: "view.previous",
|
|
55
|
+
viewPreviousUrlTemplate: "view.previous_url_template",
|
|
56
|
+
viewReferrer: "view.referrer",
|
|
62
57
|
viewStartedAt: "view.started_at",
|
|
63
58
|
viewUrl: "view.url",
|
|
64
59
|
viewUrlTemplate: "view.url_template",
|
|
@@ -179,7 +174,6 @@ var C = "BK_RUM_DEVICE_ID", w = 250, T = () => navigator.connection, ee = () =>
|
|
|
179
174
|
if (typeof navigator > "u") return {};
|
|
180
175
|
let e = ee(), t = navigator.userAgent, n = te(t), r = ne(t, e == null ? void 0 : e.platform), i = e != null && e.mobile || /mobi|android|iphone|ipad|ipod/i.test(t) ? "mobile" : "desktop";
|
|
181
176
|
return {
|
|
182
|
-
[g.deviceMemoryGib]: navigator.deviceMemory,
|
|
183
177
|
[g.deviceType]: i,
|
|
184
178
|
[g.userAgentName]: n.name,
|
|
185
179
|
[g.userAgentVersion]: n.version,
|
|
@@ -278,7 +272,7 @@ var C = "BK_RUM_DEVICE_ID", w = 250, T = () => navigator.connection, ee = () =>
|
|
|
278
272
|
}, Oe = (e, t, n) => S(S(S({ [g.deploymentEnvironmentName]: e.environment }, t === !1 ? {} : oe()), {}, { [g.serviceName]: e.name }, e.version ? { [g.serviceVersion]: e.version } : {}), {}, {
|
|
279
273
|
[g.sessionSampleRate]: n,
|
|
280
274
|
"telemetry.sdk.language": "webjs",
|
|
281
|
-
"telemetry.sdk.name": "
|
|
275
|
+
"telemetry.sdk.name": "blueking",
|
|
282
276
|
"telemetry.sdk.version": p
|
|
283
277
|
}), ke = (e) => {
|
|
284
278
|
var t;
|
|
@@ -438,7 +432,13 @@ var Ne = (e, t) => typeof e.enabled == "function" ? e.enabled(t) : e.enabled !==
|
|
|
438
432
|
shutdown() {
|
|
439
433
|
return this.inner.shutdown();
|
|
440
434
|
}
|
|
441
|
-
}, We = new Set(Object.values(g)), Ge =
|
|
435
|
+
}, We = new Set(Object.values(g)), Ge = (e) => {
|
|
436
|
+
if (typeof e == "string" && e.length > 0) return e;
|
|
437
|
+
if (Array.isArray(e)) for (let t = e.length - 1; t >= 0; --t) {
|
|
438
|
+
let n = e[t];
|
|
439
|
+
if (typeof n == "string" && n.length > 0) return n;
|
|
440
|
+
}
|
|
441
|
+
}, Ke = class {
|
|
442
442
|
constructor(e = {}, t) {
|
|
443
443
|
b(this, "actionHistory", []), b(this, "attributes", {}), b(this, "queuedViewCommands", []), b(this, "recordAssociation", (e, t, n, r) => {
|
|
444
444
|
let i = e.at(-1);
|
|
@@ -491,8 +491,8 @@ var Ne = (e, t) => typeof e.enabled == "function" ? e.enabled(t) : e.enabled !==
|
|
|
491
491
|
this.attributes[t] = n;
|
|
492
492
|
}
|
|
493
493
|
if (g.sessionId in e && this.recordAssociation(this.sessionHistory, [g.sessionId, g.sessionHasReplay], t, typeof this.attributes[g.sessionId] == "string"), g.actionId in e) {
|
|
494
|
-
let e = this.attributes[g.actionId];
|
|
495
|
-
this.recordAssociation(this.actionHistory, [g.actionId], t,
|
|
494
|
+
let e = Ge(this.attributes[g.actionId]);
|
|
495
|
+
e === void 0 ? delete this.attributes[g.actionId] : this.attributes[g.actionId] = e, this.recordAssociation(this.actionHistory, [g.actionId], t, typeof this.attributes[g.actionId] == "string");
|
|
496
496
|
}
|
|
497
497
|
}), b(this, "setUser", (e) => {
|
|
498
498
|
if (this.user = S(S({}, this.user), e), "id" in e) {
|
|
@@ -539,10 +539,7 @@ var Ne = (e, t) => typeof e.enabled == "function" ? e.enabled(t) : e.enabled !==
|
|
|
539
539
|
vital: "vital",
|
|
540
540
|
view: "view",
|
|
541
541
|
websocket: "websocket"
|
|
542
|
-
},
|
|
543
|
-
if (e === 408 || e === 504) return "network_timeout";
|
|
544
|
-
if (!(typeof e != "number" || e < 400)) return e >= 500 ? "http_5xx" : "http_4xx";
|
|
545
|
-
}, Je = (e) => e === "good" ? A.success : A.warning, Ye = (e) => {
|
|
542
|
+
}, qe = (e) => e === 408 || e === 504 ? A.timeout : typeof e == "number" && e >= 400 ? A.error : A.success, Je = (e) => e === "good" ? A.success : A.warning, Ye = (e) => {
|
|
546
543
|
if (!e) return {};
|
|
547
544
|
try {
|
|
548
545
|
let t = new URL(e, typeof location > "u" ? "http://localhost" : location.href);
|
|
@@ -553,36 +550,35 @@ var Ne = (e, t) => typeof e.enabled == "function" ? e.enabled(t) : e.enabled !==
|
|
|
553
550
|
} catch (e) {
|
|
554
551
|
return {};
|
|
555
552
|
}
|
|
556
|
-
}, M = ({ outcome: e = A.success,
|
|
557
|
-
[g.spanType]:
|
|
553
|
+
}, M = ({ outcome: e = A.success, spanType: t }) => ({
|
|
554
|
+
[g.spanType]: t,
|
|
558
555
|
[g.outcomeType]: e
|
|
559
|
-
}
|
|
560
|
-
let i = Ye(r), a = (n == null ? void 0 : n.type) === "response" && typeof n.statusCode == "number" && n.statusCode > 0 ? n.statusCode : void 0, o = (n == null ? void 0 : n.type) === "abort" ? A.abort : (n == null ? void 0 : n.type) === "timeout" ? A.timeout : (n == null ? void 0 : n.type) === "network_error" ? A.error : typeof a == "number" ?
|
|
556
|
+
}), Xe = ({ initiatorType: e = "other", method: t, outcome: n, url: r }) => {
|
|
557
|
+
let i = Ye(r), a = (n == null ? void 0 : n.type) === "response" && typeof n.statusCode == "number" && n.statusCode > 0 ? n.statusCode : void 0, o = (n == null ? void 0 : n.type) === "abort" ? A.abort : (n == null ? void 0 : n.type) === "timeout" ? A.timeout : (n == null ? void 0 : n.type) === "network_error" ? A.error : typeof a == "number" ? qe(a) : A.success, s = t == null ? void 0 : t.toUpperCase();
|
|
561
558
|
return S(S(S(S(S({}, M({
|
|
562
559
|
outcome: o,
|
|
563
|
-
outcomeReason: s,
|
|
564
560
|
spanType: j.resource
|
|
565
|
-
})), i.serverAddress ? { "server.address": i.serverAddress } : {}), i.serverPort === void 0 ? {} : { "server.port": i.serverPort }), {}, { "resource.type": e },
|
|
566
|
-
}, Ze = 100, Qe = 100, $e = 1e3, et = 100, tt = 1e4, nt = "data-bk-action-name", rt = 100, it = 10,
|
|
561
|
+
})), i.serverAddress ? { "server.address": i.serverAddress } : {}), i.serverPort === void 0 ? {} : { "server.port": i.serverPort }), {}, { "resource.type": e }, s ? { "http.request.method": s } : {}), typeof a == "number" ? { "http.response.status_code": a } : {});
|
|
562
|
+
}, Ze = 100, Qe = 100, $e = 1e3, et = 100, tt = 1e4, nt = "data-bk-action-name", rt = 100, it = 10, at = (e) => e.replace(/\s+/g, " ").trim().slice(0, rt), N = (e) => {
|
|
567
563
|
var t;
|
|
568
564
|
if (e.parentElement) return e.parentElement;
|
|
569
565
|
let n = (t = e.getRootNode) == null ? void 0 : t.call(e);
|
|
570
566
|
return typeof ShadowRoot < "u" && n instanceof ShadowRoot ? n.host : null;
|
|
571
|
-
},
|
|
567
|
+
}, ot = (e, t) => {
|
|
572
568
|
let n = e;
|
|
573
569
|
for (; n;) {
|
|
574
570
|
let e = n.getAttribute(t);
|
|
575
|
-
if (e) return
|
|
576
|
-
n =
|
|
571
|
+
if (e) return at(e);
|
|
572
|
+
n = N(n);
|
|
577
573
|
}
|
|
578
|
-
}, ot = (e) => {
|
|
579
|
-
var t;
|
|
580
|
-
return e.isContentEditable ? "" : N((t = e.textContent) == null ? "" : t);
|
|
581
574
|
}, st = (e) => {
|
|
575
|
+
var t;
|
|
576
|
+
return e.isContentEditable ? "" : at((t = e.textContent) == null ? "" : t);
|
|
577
|
+
}, ct = (e) => {
|
|
582
578
|
var t, n;
|
|
583
579
|
let r = e, i = (t = r.labels) == null ? void 0 : t[0];
|
|
584
580
|
if (i) {
|
|
585
|
-
let e =
|
|
581
|
+
let e = st(i);
|
|
586
582
|
if (e) return e;
|
|
587
583
|
}
|
|
588
584
|
let a = e.tagName.toLowerCase(), o = (n = e.getAttribute("type")) == null ? void 0 : n.toLowerCase();
|
|
@@ -592,11 +588,11 @@ var Ne = (e, t) => typeof e.enabled == "function" ? e.enabled(t) : e.enabled !==
|
|
|
592
588
|
"submit"
|
|
593
589
|
].includes(o == null ? "" : o)) {
|
|
594
590
|
var s;
|
|
595
|
-
let e =
|
|
591
|
+
let e = at((s = r.value) == null ? "" : s);
|
|
596
592
|
if (e) return e;
|
|
597
593
|
}
|
|
598
594
|
if (a === "button" || a === "label" || e.getAttribute("role") === "button") {
|
|
599
|
-
let t =
|
|
595
|
+
let t = st(e);
|
|
600
596
|
if (t) return t;
|
|
601
597
|
}
|
|
602
598
|
for (let t of [
|
|
@@ -607,39 +603,39 @@ var Ne = (e, t) => typeof e.enabled == "function" ? e.enabled(t) : e.enabled !==
|
|
|
607
603
|
"placeholder"
|
|
608
604
|
]) {
|
|
609
605
|
var c;
|
|
610
|
-
let n =
|
|
606
|
+
let n = at((c = e.getAttribute(t)) == null ? "" : c);
|
|
611
607
|
if (n) return n;
|
|
612
608
|
}
|
|
613
|
-
},
|
|
614
|
-
let r =
|
|
609
|
+
}, lt = (e, t = nt, n = !1) => {
|
|
610
|
+
let r = ot(e, t);
|
|
615
611
|
if (r) return r;
|
|
616
612
|
if (!n) return e.tagName.toLowerCase();
|
|
617
613
|
let i = e, a = 0;
|
|
618
614
|
for (; i && a <= it;) {
|
|
619
615
|
let e = i.tagName.toLowerCase();
|
|
620
616
|
if (e === "body" || e === "html" || e === "head") break;
|
|
621
|
-
let t =
|
|
617
|
+
let t = ct(i);
|
|
622
618
|
if (t) return t;
|
|
623
619
|
if (e === "form") break;
|
|
624
|
-
i =
|
|
620
|
+
i = N(i), a += 1;
|
|
625
621
|
}
|
|
626
622
|
for (i = e, a = 0; i && a <= it;) {
|
|
627
623
|
let e = i.tagName.toLowerCase();
|
|
628
624
|
if (e === "body" || e === "html" || e === "head") break;
|
|
629
|
-
let t =
|
|
625
|
+
let t = st(i);
|
|
630
626
|
if (t) return t;
|
|
631
627
|
if (e === "form") break;
|
|
632
|
-
i =
|
|
628
|
+
i = N(i), a += 1;
|
|
633
629
|
}
|
|
634
630
|
return e.tagName.toLowerCase();
|
|
635
|
-
},
|
|
631
|
+
}, ut = (e) => {
|
|
636
632
|
var t;
|
|
637
633
|
let n = (t = e.composedPath) == null ? void 0 : t.call(e)[0];
|
|
638
634
|
return n instanceof Element ? n : e.target instanceof Element ? e.target : void 0;
|
|
639
|
-
},
|
|
635
|
+
}, dt = (e) => {
|
|
640
636
|
let t = e.timeStamp;
|
|
641
637
|
return !Number.isFinite(t) || t <= 0 ? Date.now() : t > 0xe8d4a51000 ? t : typeof performance > "u" ? Date.now() : performance.timeOrigin + t;
|
|
642
|
-
},
|
|
638
|
+
}, ft = (e, t) => typeof e == "number" && Number.isFinite(e) && e > 0 ? e : t, pt = (e) => {
|
|
643
639
|
let t = e;
|
|
644
640
|
if (t.tagName.toLowerCase() === "label" && t.hasAttribute("for")) {
|
|
645
641
|
var n;
|
|
@@ -659,30 +655,29 @@ var Ne = (e, t) => typeof e.enabled == "function" ? e.enabled(t) : e.enabled !==
|
|
|
659
655
|
"submit"
|
|
660
656
|
].includes((r = (i = t.getAttribute("type")) == null ? void 0 : i.toLowerCase()) == null ? "text" : r);
|
|
661
657
|
}
|
|
662
|
-
t =
|
|
658
|
+
t = N(t);
|
|
663
659
|
}
|
|
664
660
|
return !1;
|
|
665
|
-
},
|
|
666
|
-
let t = [], n = /* @__PURE__ */ new Map(), r = /* @__PURE__ */ new Set(), i = e.actionNameAttribute || nt, a =
|
|
667
|
-
s == null || s.setRuntimeAttributes({ [g.actionId]:
|
|
668
|
-
}, l = (e) => !e.hadActivity && !e.userActivity.input && !e.userActivity.scroll && !e.userActivity.selection && !
|
|
661
|
+
}, mt = (e = {}) => {
|
|
662
|
+
let t = [], n = /* @__PURE__ */ new Map(), r = /* @__PURE__ */ new Set(), i = e.actionNameAttribute || nt, a = ft(e.maxDuration, tt), o = [], s, c = () => {
|
|
663
|
+
s == null || s.setRuntimeAttributes({ [g.actionId]: [...n.keys()].at(-1) });
|
|
664
|
+
}, l = (e) => !e.hadActivity && !e.userActivity.input && !e.userActivity.scroll && !e.userActivity.selection && !pt(e.target), u = (e) => {
|
|
669
665
|
if (!r.delete(e) || !s || !e.completed) return;
|
|
670
666
|
clearTimeout(e.reportTimer), e.hadError && e.frustrations.add("error_click"), l(e) && e.frustrations.add("dead_click");
|
|
671
667
|
let t = [
|
|
672
668
|
"rage_click",
|
|
673
669
|
"dead_click",
|
|
674
670
|
"error_click"
|
|
675
|
-
].filter((t) => e.frustrations.has(t)), { endTime: n, hasLoadingTime: i } = e.completed, a =
|
|
676
|
-
s.startSpan("action.click", S(S(S(S(
|
|
677
|
-
outcome:
|
|
671
|
+
].filter((t) => e.frustrations.has(t)), { endTime: n, hasLoadingTime: i } = e.completed, a = e.hadError || t.length > 0;
|
|
672
|
+
s.startSpan("action.click", S(S(S(S({}, s.config.hooks.getPageAttributes()), M({
|
|
673
|
+
outcome: a ? A.warning : A.success,
|
|
678
674
|
spanType: j.action
|
|
679
675
|
})), e.runtimeAttributes), {}, {
|
|
680
676
|
[g.actionId]: e.id,
|
|
681
677
|
[g.actionType]: "click",
|
|
682
|
-
[g.actionName]: `Click on ${e.targetName}`,
|
|
683
678
|
[g.actionTargetName]: e.targetName,
|
|
684
679
|
[g.actionTargetTag]: e.targetTag
|
|
685
|
-
}, t.length ? { [g.actionFrustrationType]: t } : {}),
|
|
680
|
+
}, t.length ? { [g.actionFrustrationType]: t } : {}), { startTime: e.startTime }).end(i ? n : e.startTime);
|
|
686
681
|
}, d = (e, t, i) => {
|
|
687
682
|
if (!n.delete(e.id) || !s) return;
|
|
688
683
|
clearTimeout(e.validationTimer), clearTimeout(e.quietTimer), clearTimeout(e.maxDurationTimer), c(), e.completed = {
|
|
@@ -747,9 +742,9 @@ var Ne = (e, t) => typeof e.enabled == "function" ? e.enabled(t) : e.enabled !==
|
|
|
747
742
|
passive: !0
|
|
748
743
|
}, p = (t) => {
|
|
749
744
|
if (!l.isSampled() || "button" in t && typeof t.button == "number" && t.button !== 0) return;
|
|
750
|
-
let r =
|
|
745
|
+
let r = ut(t);
|
|
751
746
|
if (!r) return;
|
|
752
|
-
let o =
|
|
747
|
+
let o = dt(t), s = h("action"), u = {
|
|
753
748
|
frustrations: /* @__PURE__ */ new Set(),
|
|
754
749
|
hadActivity: !1,
|
|
755
750
|
hadError: !1,
|
|
@@ -760,7 +755,7 @@ var Ne = (e, t) => typeof e.enabled == "function" ? e.enabled(t) : e.enabled !==
|
|
|
760
755
|
runtimeAttributes: l.getRuntimeAttributes(),
|
|
761
756
|
startTime: o,
|
|
762
757
|
target: r,
|
|
763
|
-
targetName:
|
|
758
|
+
targetName: lt(r, i, e.nameCollection === "text"),
|
|
764
759
|
targetTag: r.tagName.toLowerCase(),
|
|
765
760
|
userActivity: {
|
|
766
761
|
input: !1,
|
|
@@ -803,16 +798,16 @@ var Ne = (e, t) => typeof e.enabled == "function" ? e.enabled(t) : e.enabled !==
|
|
|
803
798
|
o = [], s = void 0;
|
|
804
799
|
}
|
|
805
800
|
};
|
|
806
|
-
},
|
|
801
|
+
}, ht = "data-bk-excluded-activity-mutations", gt = (e) => {
|
|
807
802
|
let t = e.type === "characterData" ? e.target.parentElement : e.target;
|
|
808
803
|
return t instanceof Element && !!t.closest("[data-bk-excluded-activity-mutations]");
|
|
809
|
-
},
|
|
804
|
+
}, _t = () => {
|
|
810
805
|
let e, t = [];
|
|
811
806
|
return {
|
|
812
807
|
name: "activity",
|
|
813
808
|
init(n) {
|
|
814
809
|
if (typeof document < "u" && typeof MutationObserver < "u" && (e = new MutationObserver((e) => {
|
|
815
|
-
e.length && !e.every(
|
|
810
|
+
e.length && !e.every(gt) && n.notifyActivity({
|
|
816
811
|
time: Date.now(),
|
|
817
812
|
type: "dom_mutation"
|
|
818
813
|
});
|
|
@@ -836,7 +831,7 @@ var Ne = (e, t) => typeof e.enabled == "function" ? e.enabled(t) : e.enabled !==
|
|
|
836
831
|
for (e == null || e.disconnect(), e = void 0; t.length;) (n = t.pop()) == null || n();
|
|
837
832
|
}
|
|
838
833
|
};
|
|
839
|
-
},
|
|
834
|
+
}, vt = (e, t) => !!(t && O(e.config.view.excludedActivityUrls, t)), yt = (e, t, n) => {
|
|
840
835
|
let r = /* @__PURE__ */ new Set(), i = !1, a = !1, o = t, s, c = (e) => {
|
|
841
836
|
i || (i = !0, clearTimeout(f), clearTimeout(s), d(), n(e));
|
|
842
837
|
}, l = () => {
|
|
@@ -849,7 +844,7 @@ var Ne = (e, t) => typeof e.enabled == "function" ? e.enabled(t) : e.enabled !==
|
|
|
849
844
|
}, d = e.onActivity((n) => {
|
|
850
845
|
if (!(n.type === "error" || n.type === "long_task")) {
|
|
851
846
|
if (n.type === "request_start") {
|
|
852
|
-
if (n.time < t ||
|
|
847
|
+
if (n.time < t || vt(e, n.url)) return;
|
|
853
848
|
r.add(n.id), u(n.time);
|
|
854
849
|
return;
|
|
855
850
|
}
|
|
@@ -859,7 +854,7 @@ var Ne = (e, t) => typeof e.enabled == "function" ? e.enabled(t) : e.enabled !==
|
|
|
859
854
|
return;
|
|
860
855
|
}
|
|
861
856
|
if (n.type === "resource") {
|
|
862
|
-
if (n.endTime < t ||
|
|
857
|
+
if (n.endTime < t || vt(e, n.url)) return;
|
|
863
858
|
u(n.endTime);
|
|
864
859
|
return;
|
|
865
860
|
}
|
|
@@ -871,7 +866,7 @@ var Ne = (e, t) => typeof e.enabled == "function" ? e.enabled(t) : e.enabled !==
|
|
|
871
866
|
return () => {
|
|
872
867
|
i || (i = !0, clearTimeout(f), clearTimeout(s), d());
|
|
873
868
|
};
|
|
874
|
-
},
|
|
869
|
+
}, bt = 1e3, xt = 200, St = "body", Ct = .8, wt = [
|
|
875
870
|
"[data-loading=\"true\"]",
|
|
876
871
|
"[aria-busy=\"true\"]",
|
|
877
872
|
".loading",
|
|
@@ -879,7 +874,7 @@ var Ne = (e, t) => typeof e.enabled == "function" ? e.enabled(t) : e.enabled !==
|
|
|
879
874
|
".spinner",
|
|
880
875
|
".skeleton",
|
|
881
876
|
".bk-loading"
|
|
882
|
-
],
|
|
877
|
+
], Tt = [
|
|
883
878
|
[.2, .2],
|
|
884
879
|
[.5, .2],
|
|
885
880
|
[.8, .2],
|
|
@@ -889,11 +884,7 @@ var Ne = (e, t) => typeof e.enabled == "function" ? e.enabled(t) : e.enabled !==
|
|
|
889
884
|
[.2, .8],
|
|
890
885
|
[.5, .8],
|
|
891
886
|
[.8, .8]
|
|
892
|
-
],
|
|
893
|
-
if (!e) return "";
|
|
894
|
-
let t = e.tagName.toLowerCase();
|
|
895
|
-
return e.id ? `${t}#${e.id}` : t;
|
|
896
|
-
}, Ot = (e, t) => t.some((t) => {
|
|
887
|
+
], Et = (e, t) => typeof e == "number" && Number.isFinite(e) && e >= 0 ? e : t, Dt = (e, t) => typeof e == "number" && Number.isFinite(e) ? Math.max(0, Math.min(1, e)) : t, Ot = (e, t) => t.some((t) => {
|
|
897
888
|
try {
|
|
898
889
|
return e.matches(t) || !!e.closest(t);
|
|
899
890
|
} catch (e) {
|
|
@@ -909,28 +900,26 @@ var Ne = (e, t) => typeof e.enabled == "function" ? e.enabled(t) : e.enabled !==
|
|
|
909
900
|
return n ? [n] : [];
|
|
910
901
|
}, jt = (e, t) => {
|
|
911
902
|
var n;
|
|
912
|
-
let r = document.querySelector(e), i = (n = r == null ? document.body : r) == null ? document.documentElement : n, a =
|
|
913
|
-
for (let [e, n] of
|
|
903
|
+
let r = document.querySelector(e), i = (n = r == null ? document.body : r) == null ? document.documentElement : n, a = 0, o = 0;
|
|
904
|
+
for (let [e, n] of Tt) {
|
|
914
905
|
let r = At(window.innerWidth * e, window.innerHeight * n);
|
|
915
|
-
if (
|
|
916
|
-
|
|
906
|
+
if (r.some((e) => Ot(e, t))) {
|
|
907
|
+
o += 1;
|
|
917
908
|
continue;
|
|
918
909
|
}
|
|
919
|
-
r.some((e) => e !== i && e !== document.body && e !== document.documentElement && i.contains(e) && kt(e)) || (
|
|
910
|
+
r.some((e) => e !== i && e !== document.body && e !== document.documentElement && i.contains(e) && kt(e)) || (a += 1);
|
|
920
911
|
}
|
|
921
|
-
let
|
|
912
|
+
let s = Tt.length - o;
|
|
922
913
|
return {
|
|
923
|
-
|
|
924
|
-
|
|
925
|
-
|
|
926
|
-
|
|
927
|
-
|
|
928
|
-
score: l ? o / l : 0,
|
|
929
|
-
validCount: l
|
|
914
|
+
emptyCount: a,
|
|
915
|
+
ignoredCount: o,
|
|
916
|
+
reason: r ? "empty_viewport" : "missing_root",
|
|
917
|
+
score: s ? a / s : 0,
|
|
918
|
+
validCount: s
|
|
930
919
|
};
|
|
931
920
|
}, Mt = (e = {}) => {
|
|
932
921
|
var t;
|
|
933
|
-
let n =
|
|
922
|
+
let n = Et(e.checkDelay, bt), r = Et(e.confirmationDelay, xt), i = e.rootSelector || St, a = Dt(e.threshold, Ct), o = [...wt, ...(t = e.ignoreSelectors) == null ? [] : t], s, c, l, u, d = () => {}, f;
|
|
934
923
|
return {
|
|
935
924
|
name: "blank-screen",
|
|
936
925
|
init(e) {
|
|
@@ -943,18 +932,11 @@ var Ne = (e, t) => typeof e.enabled == "function" ? e.enabled(t) : e.enabled !==
|
|
|
943
932
|
let r = Date.now();
|
|
944
933
|
e.startSpan("browser.blank_screen", S(S({}, M({
|
|
945
934
|
outcome: A.error,
|
|
946
|
-
outcomeReason: "blank_screen",
|
|
947
935
|
spanType: j.error
|
|
948
936
|
})), {}, {
|
|
949
|
-
"blank_screen.center_element": n.centerElement,
|
|
950
937
|
"blank_screen.empty_ratio": n.score,
|
|
951
938
|
"blank_screen.empty_sample_count": n.emptyCount,
|
|
952
|
-
"blank_screen.
|
|
953
|
-
"blank_screen.reason": n.reason,
|
|
954
|
-
"blank_screen.root_found": n.rootFound,
|
|
955
|
-
"blank_screen.root_selector": i,
|
|
956
|
-
"blank_screen.sample_count": wt.length,
|
|
957
|
-
"blank_screen.valid_sample_count": n.validCount
|
|
939
|
+
"blank_screen.reason": n.reason
|
|
958
940
|
}), { startTime: r }).end(r);
|
|
959
941
|
}, m = (t) => {
|
|
960
942
|
if (s !== t || c === t || document.visibilityState === "hidden") return;
|
|
@@ -984,7 +966,7 @@ var Ne = (e, t) => typeof e.enabled == "function" ? e.enabled(t) : e.enabled !==
|
|
|
984
966
|
d = e.onViewChange((n) => {
|
|
985
967
|
if (n.id !== s && (t(), l == null || l(), l = void 0, s = n.id, c = void 0, n.id)) {
|
|
986
968
|
let t = n.id;
|
|
987
|
-
l =
|
|
969
|
+
l = yt(e, Date.now(), () => {
|
|
988
970
|
l = void 0, h(t);
|
|
989
971
|
});
|
|
990
972
|
}
|
|
@@ -998,44 +980,44 @@ var Ne = (e, t) => typeof e.enabled == "function" ? e.enabled(t) : e.enabled !==
|
|
|
998
980
|
clearTimeout(u), u = void 0, d(), l == null || l(), l = void 0, f == null || f(), f = void 0, s = void 0, c = void 0;
|
|
999
981
|
}
|
|
1000
982
|
};
|
|
1001
|
-
}, Nt = 100, Pt = 200,
|
|
1002
|
-
let t =
|
|
1003
|
-
t >= 0 &&
|
|
1004
|
-
},
|
|
983
|
+
}, Nt = 100, Pt = 200, P = [], Ft = (e) => e.replace(/#.*$/, ""), It = (e) => {
|
|
984
|
+
let t = P.indexOf(e);
|
|
985
|
+
t >= 0 && P.splice(t, 1), e.timer !== void 0 && clearTimeout(e.timer);
|
|
986
|
+
}, F = (e, t) => {
|
|
1005
987
|
let n = e.callback;
|
|
1006
988
|
It(e), e.callback = void 0, n == null || n(t);
|
|
1007
989
|
}, Lt = (e) => {
|
|
1008
|
-
let t = performance.timeOrigin + e.startTime, n =
|
|
1009
|
-
n && (n.entry = e, n.callback &&
|
|
990
|
+
let t = performance.timeOrigin + e.startTime, n = P.filter((n) => !n.entry && Ft(n.url) === Ft(e.name) && t >= n.startTime - 50).sort((e, n) => Math.abs(e.startTime - t) - Math.abs(n.startTime - t))[0];
|
|
991
|
+
n && (n.entry = e, n.callback && F(n, e));
|
|
1010
992
|
}, Rt = (e, t = Date.now()) => {
|
|
1011
993
|
let n = {
|
|
1012
994
|
startTime: t,
|
|
1013
995
|
url: e
|
|
1014
996
|
};
|
|
1015
|
-
return
|
|
1016
|
-
cancel: () =>
|
|
997
|
+
return P.push(n), P.length > Nt && F(P[0]), {
|
|
998
|
+
cancel: () => F(n),
|
|
1017
999
|
complete: (e) => {
|
|
1018
1000
|
if (n.callback = e, n.entry) {
|
|
1019
|
-
|
|
1001
|
+
F(n, n.entry);
|
|
1020
1002
|
return;
|
|
1021
1003
|
}
|
|
1022
|
-
n.timer = setTimeout(() =>
|
|
1004
|
+
n.timer = setTimeout(() => F(n), Pt);
|
|
1023
1005
|
}
|
|
1024
1006
|
};
|
|
1025
|
-
},
|
|
1007
|
+
}, I = "traceparent", L = 32, R = 16, zt = "0123456789abcdef", Bt = /^[\da-f]+$/, Vt = /^0+$/, Ht = /^\d+$/, Ut = /^([\da-f]{2})-([\da-f]{32})-([\da-f]{16})-([\da-f]{2})(?:-.*)?$/, Wt = /^([\da-f]{32})-([\da-f]{16})(?:-([01]))?$/, Gt = /(?:^|,)_dd\.p\.tid=([\da-f]{16})(?:,|$)/, Kt = "0000000000000000", z = (e, t) => e.length === t && Bt.test(e) && !Vt.test(e), qt = (e) => {
|
|
1026
1008
|
let t = e.toLowerCase();
|
|
1027
|
-
return
|
|
1009
|
+
return z(t, L) ? t : z(t, R) ? t.padStart(L, "0") : void 0;
|
|
1028
1010
|
}, Jt = (e) => {
|
|
1029
1011
|
let t = e.toLowerCase();
|
|
1030
|
-
return
|
|
1031
|
-
},
|
|
1012
|
+
return z(t, R) ? t : void 0;
|
|
1013
|
+
}, Yt = (e) => {
|
|
1032
1014
|
let t = new Uint8Array(e / 2);
|
|
1033
1015
|
if (typeof crypto < "u" && typeof crypto.getRandomValues == "function") crypto.getRandomValues(t);
|
|
1034
1016
|
else for (let e = 0; e < t.length; e += 1) t[e] = Math.floor(Math.random() * 256);
|
|
1035
1017
|
let n = "";
|
|
1036
1018
|
for (let e of t) n += zt[e >> 4] + zt[e & 15];
|
|
1037
1019
|
return Vt.test(n) ? `${n.slice(1)}1` : n;
|
|
1038
|
-
},
|
|
1020
|
+
}, Xt = (e) => {
|
|
1039
1021
|
if (!Ht.test(e)) return;
|
|
1040
1022
|
let t = [];
|
|
1041
1023
|
for (let n = 0; n < e.length; n += 1) {
|
|
@@ -1046,11 +1028,11 @@ var Ne = (e, t) => typeof e.enabled == "function" ? e.enabled(t) : e.enabled !==
|
|
|
1046
1028
|
}
|
|
1047
1029
|
for (; r > 0;) t.push(r % 16), r = (r - r % 16) / 16;
|
|
1048
1030
|
}
|
|
1049
|
-
if (t.length >
|
|
1031
|
+
if (t.length > R) return;
|
|
1050
1032
|
let n = "";
|
|
1051
1033
|
for (let e = t.length - 1; e >= 0; --e) n += zt[t[e]];
|
|
1052
|
-
return n.padStart(
|
|
1053
|
-
},
|
|
1034
|
+
return n.padStart(R, "0");
|
|
1035
|
+
}, B = (e, t) => {
|
|
1054
1036
|
let n = {};
|
|
1055
1037
|
for (let i of t) {
|
|
1056
1038
|
var r;
|
|
@@ -1058,7 +1040,7 @@ var Ne = (e, t) => typeof e.enabled == "function" ? e.enabled(t) : e.enabled !==
|
|
|
1058
1040
|
t && (n[i] = t);
|
|
1059
1041
|
}
|
|
1060
1042
|
return n;
|
|
1061
|
-
},
|
|
1043
|
+
}, Zt = [
|
|
1062
1044
|
(e) => {
|
|
1063
1045
|
var t;
|
|
1064
1046
|
let n = (t = e("traceparent")) == null ? void 0 : t.trim().toLowerCase();
|
|
@@ -1066,9 +1048,9 @@ var Ne = (e, t) => typeof e.enabled == "function" ? e.enabled(t) : e.enabled !==
|
|
|
1066
1048
|
let r = Ut.exec(n);
|
|
1067
1049
|
if (!r || r[1] === "ff") return;
|
|
1068
1050
|
let [, , i, a, o] = r;
|
|
1069
|
-
if (!(!
|
|
1051
|
+
if (!(!z(i, L) || !z(a, R))) return {
|
|
1070
1052
|
format: "traceparent",
|
|
1071
|
-
headers:
|
|
1053
|
+
headers: B(e, [I]),
|
|
1072
1054
|
sampled: (Number.parseInt(o, 16) & 1) == 1,
|
|
1073
1055
|
spanId: a,
|
|
1074
1056
|
traceId: i
|
|
@@ -1078,7 +1060,7 @@ var Ne = (e, t) => typeof e.enabled == "function" ? e.enabled(t) : e.enabled !==
|
|
|
1078
1060
|
var t;
|
|
1079
1061
|
let n = (t = e("sentry-trace")) == null ? void 0 : t.trim().toLowerCase();
|
|
1080
1062
|
if (!n) return;
|
|
1081
|
-
let r =
|
|
1063
|
+
let r = B(e, ["sentry-trace"]), i = Wt.exec(n);
|
|
1082
1064
|
if (!i) return {
|
|
1083
1065
|
format: "sentry-trace",
|
|
1084
1066
|
headers: r
|
|
@@ -1087,7 +1069,7 @@ var Ne = (e, t) => typeof e.enabled == "function" ? e.enabled(t) : e.enabled !==
|
|
|
1087
1069
|
return S(S({
|
|
1088
1070
|
format: "sentry-trace",
|
|
1089
1071
|
headers: r
|
|
1090
|
-
}, s === void 0 ? {} : { sampled: s === "1" }),
|
|
1072
|
+
}, s === void 0 ? {} : { sampled: s === "1" }), z(a, L) && z(o, R) ? {
|
|
1091
1073
|
spanId: o,
|
|
1092
1074
|
traceId: a
|
|
1093
1075
|
} : {});
|
|
@@ -1099,7 +1081,7 @@ var Ne = (e, t) => typeof e.enabled == "function" ? e.enabled(t) : e.enabled !==
|
|
|
1099
1081
|
let [r, i, a] = n.split("-"), o = r ? qt(r) : void 0, s = i ? Jt(i) : void 0;
|
|
1100
1082
|
return S(S({
|
|
1101
1083
|
format: "b3",
|
|
1102
|
-
headers:
|
|
1084
|
+
headers: B(e, ["b3"])
|
|
1103
1085
|
}, o && s ? {
|
|
1104
1086
|
spanId: s,
|
|
1105
1087
|
traceId: o
|
|
@@ -1112,7 +1094,7 @@ var Ne = (e, t) => typeof e.enabled == "function" ? e.enabled(t) : e.enabled !==
|
|
|
1112
1094
|
let s = i ? qt(i) : void 0, c = a ? Jt(a) : void 0;
|
|
1113
1095
|
return S(S({
|
|
1114
1096
|
format: "b3-multi",
|
|
1115
|
-
headers:
|
|
1097
|
+
headers: B(e, [
|
|
1116
1098
|
"x-b3-traceid",
|
|
1117
1099
|
"x-b3-spanid",
|
|
1118
1100
|
"x-b3-parentspanid",
|
|
@@ -1128,10 +1110,10 @@ var Ne = (e, t) => typeof e.enabled == "function" ? e.enabled(t) : e.enabled !==
|
|
|
1128
1110
|
var t, n, r, i, a, o;
|
|
1129
1111
|
let s = (t = e("x-datadog-trace-id")) == null ? void 0 : t.trim(), c = (n = e("x-datadog-parent-id")) == null ? void 0 : n.trim(), l = (r = e("x-datadog-sampling-priority")) == null ? void 0 : r.trim();
|
|
1130
1112
|
if (!s && !c && !l) return;
|
|
1131
|
-
let u = (i = e("x-datadog-tags")) == null ? void 0 : i.trim().toLowerCase(), d = (a = u ? (o = Gt.exec(u)) == null ? void 0 : o[1] : void 0) == null ? Kt : a, f = s ?
|
|
1113
|
+
let u = (i = e("x-datadog-tags")) == null ? void 0 : i.trim().toLowerCase(), d = (a = u ? (o = Gt.exec(u)) == null ? void 0 : o[1] : void 0) == null ? Kt : a, f = s ? Xt(s) : void 0, p = f ? qt(`${d}${f}`) : void 0, m = c ? Xt(c) : void 0, h = m ? Jt(m) : void 0;
|
|
1132
1114
|
return S(S({
|
|
1133
1115
|
format: "datadog",
|
|
1134
|
-
headers:
|
|
1116
|
+
headers: B(e, [
|
|
1135
1117
|
"x-datadog-trace-id",
|
|
1136
1118
|
"x-datadog-parent-id",
|
|
1137
1119
|
"x-datadog-sampling-priority",
|
|
@@ -1150,42 +1132,42 @@ var Ne = (e, t) => typeof e.enabled == "function" ? e.enabled(t) : e.enabled !==
|
|
|
1150
1132
|
let r = n.split("-")[0];
|
|
1151
1133
|
return S({
|
|
1152
1134
|
format: "sw8",
|
|
1153
|
-
headers:
|
|
1135
|
+
headers: B(e, ["sw8"])
|
|
1154
1136
|
}, r ? { sampled: r === "1" } : {});
|
|
1155
1137
|
}
|
|
1156
|
-
],
|
|
1157
|
-
for (let t of
|
|
1138
|
+
], Qt = (e) => {
|
|
1139
|
+
for (let t of Zt) {
|
|
1158
1140
|
let n = t(e);
|
|
1159
1141
|
if (n) return n;
|
|
1160
1142
|
}
|
|
1161
|
-
},
|
|
1143
|
+
}, $t = (e, t, r, i) => ({
|
|
1162
1144
|
attributes: r,
|
|
1163
1145
|
context: {
|
|
1164
1146
|
spanId: t,
|
|
1165
1147
|
traceFlags: i === !1 ? n.NONE : n.SAMPLED,
|
|
1166
1148
|
traceId: e
|
|
1167
1149
|
}
|
|
1168
|
-
}),
|
|
1150
|
+
}), en = (e) => {
|
|
1169
1151
|
var t, n;
|
|
1170
|
-
let r =
|
|
1152
|
+
let r = Qt(e);
|
|
1171
1153
|
if (!r) {
|
|
1172
|
-
let e =
|
|
1154
|
+
let e = Yt(L), t = Yt(R), n = `00-${e}-${t}-01`;
|
|
1173
1155
|
return {
|
|
1174
|
-
links: [
|
|
1156
|
+
links: [$t(e, t, {
|
|
1175
1157
|
format: "traceparent",
|
|
1176
1158
|
injected: !0,
|
|
1177
|
-
[
|
|
1159
|
+
[I]: n
|
|
1178
1160
|
})],
|
|
1179
1161
|
traceparent: n
|
|
1180
1162
|
};
|
|
1181
1163
|
}
|
|
1182
|
-
return { links: [
|
|
1164
|
+
return { links: [$t((t = r.traceId) == null ? Yt(L) : t, (n = r.spanId) == null ? Yt(R) : n, S({
|
|
1183
1165
|
format: r.format,
|
|
1184
1166
|
injected: !1
|
|
1185
1167
|
}, r.headers), r.sampled)] };
|
|
1186
|
-
},
|
|
1187
|
-
|
|
1188
|
-
},
|
|
1168
|
+
}, tn = (e) => e.deliveryType === "cache" || e.transferSize === 0 && e.decodedBodySize > 0 ? !0 : void 0, nn = (e) => e.transferSize === 0 && e.encodedBodySize === 0 && e.decodedBodySize === 0 && e.requestStart === 0 && e.responseStart === 0 && !e.nextHopProtocol, rn = (...e) => e.every((t, n) => n === 0 || e[n - 1] <= t), V = (e, t, n, r, i) => {
|
|
1169
|
+
rn(n, r, i) && (e[`resource.${t}.start`] = r - n, e[`resource.${t}.duration`] = i - r);
|
|
1170
|
+
}, an = (e) => {
|
|
1189
1171
|
let t = {}, n = [
|
|
1190
1172
|
e.startTime,
|
|
1191
1173
|
e.fetchStart,
|
|
@@ -1197,16 +1179,16 @@ var Ne = (e, t) => typeof e.enabled == "function" ? e.enabled(t) : e.enabled !==
|
|
|
1197
1179
|
e.responseStart,
|
|
1198
1180
|
e.responseEnd
|
|
1199
1181
|
];
|
|
1200
|
-
return !n.every(Number.isFinite) || !
|
|
1201
|
-
},
|
|
1202
|
-
let t =
|
|
1203
|
-
return S(S(S(S(S({ [g.cacheHit]:
|
|
1182
|
+
return !n.every(Number.isFinite) || !rn(...n) ? t : (V(t, "first_byte", e.startTime, e.requestStart, e.responseStart), V(t, "download", e.startTime, e.responseStart, e.responseEnd), e.workerStart > 0 && e.workerStart < e.fetchStart && V(t, "worker", e.startTime, e.workerStart, e.fetchStart), e.fetchStart < e.domainLookupEnd && V(t, "dns", e.startTime, e.domainLookupStart, e.domainLookupEnd), e.fetchStart < e.connectEnd && (V(t, "connect", e.startTime, e.connectStart, e.connectEnd), e.connectStart <= e.secureConnectionStart && e.secureConnectionStart <= e.connectEnd && V(t, "ssl", e.startTime, e.secureConnectionStart, e.connectEnd)), e.redirectEnd > e.startTime && rn(e.startTime, e.redirectStart, e.redirectEnd, e.fetchStart) && V(t, "redirect", e.startTime, e.redirectStart, e.redirectEnd), t);
|
|
1183
|
+
}, on = (e) => e.duration === 0 && e.responseEnd > e.startTime ? e.responseEnd - e.startTime : e.duration, sn = (e) => {
|
|
1184
|
+
let t = nn(e), n = typeof e.deliveryType == "string" && e.deliveryType ? e.deliveryType : void 0;
|
|
1185
|
+
return S(S(S(S(S({ [g.cacheHit]: tn(e) }, e.nextHopProtocol ? { [g.nextHopProtocol]: e.nextHopProtocol } : {}), an(e)), n ? { "resource.delivery_type": n } : {}), e.renderBlockingStatus ? { "resource.render_blocking_status": e.renderBlockingStatus } : {}), t ? {} : {
|
|
1204
1186
|
"resource.size": e.decodedBodySize,
|
|
1205
1187
|
"resource.encoded_body_size": e.encodedBodySize,
|
|
1206
1188
|
"resource.decoded_body_size": e.decodedBodySize,
|
|
1207
1189
|
"resource.transfer_size": e.transferSize
|
|
1208
1190
|
});
|
|
1209
|
-
},
|
|
1191
|
+
}, cn = (t = !0) => {
|
|
1210
1192
|
let n;
|
|
1211
1193
|
return {
|
|
1212
1194
|
name: "resource",
|
|
@@ -1220,7 +1202,7 @@ var Ne = (e, t) => typeof e.enabled == "function" ? e.enabled(t) : e.enabled !==
|
|
|
1220
1202
|
return;
|
|
1221
1203
|
}
|
|
1222
1204
|
if (n.duration < 0) return;
|
|
1223
|
-
let i = r.config.hooks.redactUrl(n.name), a =
|
|
1205
|
+
let i = r.config.hooks.redactUrl(n.name), a = on(n), o = performance.timeOrigin + n.startTime, s = o + a;
|
|
1224
1206
|
t && r.isSampled() && r.startSpan("browser.resource", S(S(S({}, r.config.hooks.getPageAttributes()), Xe({
|
|
1225
1207
|
initiatorType: n.initiatorType || "other",
|
|
1226
1208
|
outcome: typeof n.responseStatus == "number" ? {
|
|
@@ -1228,7 +1210,10 @@ var Ne = (e, t) => typeof e.enabled == "function" ? e.enabled(t) : e.enabled !==
|
|
|
1228
1210
|
type: "response"
|
|
1229
1211
|
} : void 0,
|
|
1230
1212
|
url: i
|
|
1231
|
-
})), {}, {
|
|
1213
|
+
})), {}, {
|
|
1214
|
+
"url.full": i,
|
|
1215
|
+
"url.template": r.config.hooks.getRequestUrlTemplate(i)
|
|
1216
|
+
}, sn(n)), {
|
|
1232
1217
|
kind: e.CLIENT,
|
|
1233
1218
|
startTime: o
|
|
1234
1219
|
}).end(s), r.notifyActivity({
|
|
@@ -1253,31 +1238,31 @@ var Ne = (e, t) => typeof e.enabled == "function" ? e.enabled(t) : e.enabled !==
|
|
|
1253
1238
|
n == null || n.disconnect(), n = void 0;
|
|
1254
1239
|
}
|
|
1255
1240
|
};
|
|
1256
|
-
},
|
|
1241
|
+
}, ln = (e) => typeof e.config.tracking.request == "object" ? e.config.tracking.request : void 0, un = (e) => {
|
|
1257
1242
|
var t;
|
|
1258
|
-
let n = (t =
|
|
1243
|
+
let n = (t = ln(e)) == null ? void 0 : t.allowedTracingUrls;
|
|
1259
1244
|
return Array.isArray(n) ? n.length > 0 : n !== void 0;
|
|
1260
|
-
},
|
|
1245
|
+
}, dn = (e) => typeof e == "object" && e && "name" in e && typeof e.name == "string" ? e.name : "", fn = (e, t) => {
|
|
1261
1246
|
let n = e.signal;
|
|
1262
|
-
return
|
|
1247
|
+
return dn(n == null ? void 0 : n.reason) === "TimeoutError" || dn(t) === "TimeoutError" ? {
|
|
1263
1248
|
error: t,
|
|
1264
1249
|
type: "timeout"
|
|
1265
|
-
} : n != null && n.aborted ||
|
|
1250
|
+
} : n != null && n.aborted || dn(t) === "AbortError" ? { type: "abort" } : {
|
|
1266
1251
|
error: t,
|
|
1267
1252
|
type: "network_error"
|
|
1268
1253
|
};
|
|
1269
|
-
},
|
|
1254
|
+
}, pn = (e, t) => e === "abort" ? { type: "abort" } : e === "timeout" ? { type: "timeout" } : e === "error" || t.status === 0 ? { type: "network_error" } : {
|
|
1270
1255
|
statusCode: t.status,
|
|
1271
1256
|
type: "response"
|
|
1272
|
-
},
|
|
1257
|
+
}, mn = (e) => e.type === "network_error" || e.type === "timeout" || e.type === "response" && typeof e.statusCode == "number" && e.statusCode >= 400, hn = (e) => typeof e == "string" || e instanceof URL ? E(String(e)) : E(e.url), gn = (e, t) => {
|
|
1273
1258
|
var n;
|
|
1274
1259
|
return ((n = t == null ? void 0 : t.method) == null ? typeof Request < "u" && e instanceof Request ? e.method : "GET" : n).toUpperCase();
|
|
1275
|
-
},
|
|
1260
|
+
}, _n = (e, t) => typeof Request < "u" && e instanceof Request ? e : t == null ? {} : t, vn = (e, t) => {
|
|
1276
1261
|
var n;
|
|
1277
1262
|
let r = typeof Request < "u" && e instanceof Request ? e.headers : void 0;
|
|
1278
1263
|
return new Headers((n = t == null ? void 0 : t.headers) == null ? r : n);
|
|
1279
|
-
},
|
|
1280
|
-
if (
|
|
1264
|
+
}, yn = (e, t, n) => n.traceparent ? (t.set(I, n.traceparent), S(S({}, e), {}, { headers: t })) : e, bn = (e) => (t) => e == null ? void 0 : e[t.toLowerCase()], xn = (e, t) => D(e.config, t) || O(e.config.view.excludedActivityUrls, t), Sn = (e, t) => {
|
|
1265
|
+
if (xn(e, t)) return () => {};
|
|
1281
1266
|
let n = h("request");
|
|
1282
1267
|
e.notifyActivity({
|
|
1283
1268
|
id: n,
|
|
@@ -1293,12 +1278,12 @@ var Ne = (e, t) => typeof e.enabled == "function" ? e.enabled(t) : e.enabled !==
|
|
|
1293
1278
|
type: "request_end"
|
|
1294
1279
|
}));
|
|
1295
1280
|
};
|
|
1296
|
-
},
|
|
1281
|
+
}, Cn = (e, t) => e.isSampled() ? Rt(t) : {
|
|
1297
1282
|
cancel() {},
|
|
1298
1283
|
complete(e) {
|
|
1299
1284
|
e();
|
|
1300
1285
|
}
|
|
1301
|
-
},
|
|
1286
|
+
}, wn = (t, n, r, i) => {
|
|
1302
1287
|
var a, o;
|
|
1303
1288
|
let s = (a = r.startedAt) == null ? Date.now() : a;
|
|
1304
1289
|
return t.startSpan("browser.resource", S(S(S({}, t.config.hooks.getPageAttributes()), Xe({
|
|
@@ -1312,7 +1297,7 @@ var Ne = (e, t) => typeof e.enabled == "function" ? e.enabled(t) : e.enabled !==
|
|
|
1312
1297
|
kind: e.CLIENT,
|
|
1313
1298
|
startTime: s
|
|
1314
1299
|
}, i ? { links: i.links } : {}));
|
|
1315
|
-
},
|
|
1300
|
+
}, Tn = (e, n, r, i, a, o = {}) => {
|
|
1316
1301
|
let s = o.url, c = s ? e.config.hooks.redactUrl(s) : void 0, l = o.method, u = {
|
|
1317
1302
|
attributes: S(S(S(S({}, e.config.hooks.getPageAttributes()), Xe({
|
|
1318
1303
|
initiatorType: r,
|
|
@@ -1330,7 +1315,7 @@ var Ne = (e, t) => typeof e.enabled == "function" ? e.enabled(t) : e.enabled !==
|
|
|
1330
1315
|
}, d = !0;
|
|
1331
1316
|
try {
|
|
1332
1317
|
var f, p;
|
|
1333
|
-
d = (f =
|
|
1318
|
+
d = (f = ln(e)) == null || (p = f.beforeSend) == null ? void 0 : p.call(f, u, i);
|
|
1334
1319
|
} catch (t) {
|
|
1335
1320
|
var m;
|
|
1336
1321
|
e.config.debug && ((m = globalThis.console) == null || m.warn("[bk-ot] request.beforeSend failed:", t));
|
|
@@ -1339,8 +1324,8 @@ var Ne = (e, t) => typeof e.enabled == "function" ? e.enabled(t) : e.enabled !==
|
|
|
1339
1324
|
Re(n);
|
|
1340
1325
|
return;
|
|
1341
1326
|
}
|
|
1342
|
-
|
|
1343
|
-
},
|
|
1327
|
+
mn(a) && n.setStatus({ code: t.ERROR });
|
|
1328
|
+
}, En = (e) => {
|
|
1344
1329
|
let t = [], n = /* @__PURE__ */ new Set();
|
|
1345
1330
|
return {
|
|
1346
1331
|
name: "request",
|
|
@@ -1350,19 +1335,19 @@ var Ne = (e, t) => typeof e.enabled == "function" ? e.enabled(t) : e.enabled !==
|
|
|
1350
1335
|
if (typeof window.fetch == "function") {
|
|
1351
1336
|
let r = window.fetch, i = /* @__PURE__ */ function() {
|
|
1352
1337
|
var t = k(function* (t, i) {
|
|
1353
|
-
let a =
|
|
1338
|
+
let a = hn(t);
|
|
1354
1339
|
if (!e.isSampled() || _e(e.config, a)) return r.call(this, t, i);
|
|
1355
1340
|
let o = {
|
|
1356
|
-
method:
|
|
1341
|
+
method: gn(t, i),
|
|
1357
1342
|
startedAt: Date.now(),
|
|
1358
1343
|
url: a
|
|
1359
|
-
}, s = ve(e.config, a) ?
|
|
1344
|
+
}, s = ve(e.config, a) ? vn(t, i) : void 0, c = s ? en((e) => {
|
|
1360
1345
|
var t;
|
|
1361
1346
|
return (t = s.get(e)) == null ? void 0 : t;
|
|
1362
|
-
}) : void 0, l =
|
|
1347
|
+
}) : void 0, l = wn(e, "fetch", o, c), u = Cn(e, a), d = Sn(e, a), f = _n(t, i), p = s && c ? yn(i, s, c) : i, m = !1, h = (t, r = Date.now()) => {
|
|
1363
1348
|
if (!m) {
|
|
1364
1349
|
if (m = !0, n.delete(g), t) {
|
|
1365
|
-
l.setAttributes(e.applyRedact(
|
|
1350
|
+
l.setAttributes(e.applyRedact(sn(t))), l.end(performance.timeOrigin + t.startTime + on(t));
|
|
1366
1351
|
return;
|
|
1367
1352
|
}
|
|
1368
1353
|
l.end(r);
|
|
@@ -1373,7 +1358,7 @@ var Ne = (e, t) => typeof e.enabled == "function" ? e.enabled(t) : e.enabled !==
|
|
|
1373
1358
|
n.add(g);
|
|
1374
1359
|
try {
|
|
1375
1360
|
let n = yield r.call(this, t, p), i = S(S({}, n.status > 0 ? { statusCode: n.status } : {}), {}, { type: "response" });
|
|
1376
|
-
|
|
1361
|
+
Tn(e, l, "fetch", {
|
|
1377
1362
|
request: f,
|
|
1378
1363
|
response: n,
|
|
1379
1364
|
type: "fetch"
|
|
@@ -1381,8 +1366,8 @@ var Ne = (e, t) => typeof e.enabled == "function" ? e.enabled(t) : e.enabled !==
|
|
|
1381
1366
|
let a = Date.now();
|
|
1382
1367
|
return u.complete((e) => h(e, a)), n;
|
|
1383
1368
|
} catch (t) {
|
|
1384
|
-
let n =
|
|
1385
|
-
|
|
1369
|
+
let n = fn(f, t);
|
|
1370
|
+
Tn(e, l, "fetch", {
|
|
1386
1371
|
error: t,
|
|
1387
1372
|
request: f,
|
|
1388
1373
|
type: "fetch"
|
|
@@ -1412,8 +1397,8 @@ var Ne = (e, t) => typeof e.enabled == "function" ? e.enabled(t) : e.enabled !==
|
|
|
1412
1397
|
let s = (a = r.get(this)) == null ? {} : a;
|
|
1413
1398
|
if (!e.isSampled() || !s.url || _e(e.config, s.url)) return o.call(this, t);
|
|
1414
1399
|
s.startedAt = Date.now();
|
|
1415
|
-
let c = ve(e.config, s.url) ?
|
|
1416
|
-
c != null && c.traceparent && this.setRequestHeader(
|
|
1400
|
+
let c = ve(e.config, s.url) ? en(bn(i.get(this))) : void 0, l = wn(e, "xhr", s, c), u = Cn(e, s.url), d = Sn(e, s.url);
|
|
1401
|
+
c != null && c.traceparent && this.setRequestHeader(I, c.traceparent);
|
|
1417
1402
|
let f = !1, p = !1, m = () => {}, h = () => {
|
|
1418
1403
|
m(), u.cancel(), !p && (p = !0, n.delete(h), d(), l.end());
|
|
1419
1404
|
};
|
|
@@ -1421,8 +1406,8 @@ var Ne = (e, t) => typeof e.enabled == "function" ? e.enabled(t) : e.enabled !==
|
|
|
1421
1406
|
let g = (t) => {
|
|
1422
1407
|
if (f || p) return;
|
|
1423
1408
|
f = !0, m();
|
|
1424
|
-
let r =
|
|
1425
|
-
|
|
1409
|
+
let r = pn(t, this);
|
|
1410
|
+
Tn(e, l, "xhr", {
|
|
1426
1411
|
type: "xhr",
|
|
1427
1412
|
xhr: this
|
|
1428
1413
|
}, r, s), d();
|
|
@@ -1430,7 +1415,7 @@ var Ne = (e, t) => typeof e.enabled == "function" ? e.enabled(t) : e.enabled !==
|
|
|
1430
1415
|
u.complete((t) => {
|
|
1431
1416
|
if (!p) {
|
|
1432
1417
|
if (p = !0, n.delete(h), t) {
|
|
1433
|
-
l.setAttributes(e.applyRedact(
|
|
1418
|
+
l.setAttributes(e.applyRedact(sn(t))), l.end(performance.timeOrigin + t.startTime + on(t));
|
|
1434
1419
|
return;
|
|
1435
1420
|
}
|
|
1436
1421
|
l.end(i);
|
|
@@ -1448,7 +1433,7 @@ var Ne = (e, t) => typeof e.enabled == "function" ? e.enabled(t) : e.enabled !==
|
|
|
1448
1433
|
};
|
|
1449
1434
|
if (XMLHttpRequest.prototype.open = s, XMLHttpRequest.prototype.send = c, t.push(() => {
|
|
1450
1435
|
XMLHttpRequest.prototype.open === s && (XMLHttpRequest.prototype.open = a), XMLHttpRequest.prototype.send === c && (XMLHttpRequest.prototype.send = o);
|
|
1451
|
-
}),
|
|
1436
|
+
}), un(e) && typeof XMLHttpRequest.prototype.setRequestHeader == "function") {
|
|
1452
1437
|
let e = XMLHttpRequest.prototype.setRequestHeader, n = function(t, n) {
|
|
1453
1438
|
var r;
|
|
1454
1439
|
let a = t.toLowerCase(), o = (r = i.get(this)) == null ? {} : r;
|
|
@@ -1467,9 +1452,9 @@ var Ne = (e, t) => typeof e.enabled == "function" ? e.enabled(t) : e.enabled !==
|
|
|
1467
1452
|
for (; t.length;) (e = t.pop()) == null || e();
|
|
1468
1453
|
}
|
|
1469
1454
|
};
|
|
1470
|
-
},
|
|
1471
|
-
if (t) return
|
|
1472
|
-
},
|
|
1455
|
+
}, Dn = /^https?:|^\/\//i, On = (e, t) => {
|
|
1456
|
+
if (t) return Dn.test(t) ? e(t) : t;
|
|
1457
|
+
}, kn = () => {
|
|
1473
1458
|
let e;
|
|
1474
1459
|
return {
|
|
1475
1460
|
name: "csp-violation",
|
|
@@ -1477,10 +1462,9 @@ var Ne = (e, t) => typeof e.enabled == "function" ? e.enabled(t) : e.enabled !==
|
|
|
1477
1462
|
if (typeof window > "u" || typeof document > "u") return;
|
|
1478
1463
|
let n = (e) => {
|
|
1479
1464
|
if (!t.isSampled()) return;
|
|
1480
|
-
let n = Date.now(), r =
|
|
1465
|
+
let n = Date.now(), r = On(t.config.hooks.redactUrl, e.blockedURI), i = e.sourceFile ? t.config.hooks.redactUrl(e.sourceFile) : void 0;
|
|
1481
1466
|
t.startSpan("csp.violation", S(S(S({}, t.config.hooks.getPageAttributes()), M({
|
|
1482
1467
|
outcome: A.error,
|
|
1483
|
-
outcomeReason: "csp",
|
|
1484
1468
|
spanType: j.error
|
|
1485
1469
|
})), {}, {
|
|
1486
1470
|
"csp.blocked_uri": r,
|
|
@@ -1501,7 +1485,7 @@ var Ne = (e, t) => typeof e.enabled == "function" ? e.enabled(t) : e.enabled !==
|
|
|
1501
1485
|
e == null || e(), e = void 0;
|
|
1502
1486
|
}
|
|
1503
1487
|
};
|
|
1504
|
-
},
|
|
1488
|
+
}, An = (e) => {
|
|
1505
1489
|
if (e instanceof Error) return e.message;
|
|
1506
1490
|
if (typeof e == "string") return e;
|
|
1507
1491
|
try {
|
|
@@ -1509,9 +1493,9 @@ var Ne = (e, t) => typeof e.enabled == "function" ? e.enabled(t) : e.enabled !==
|
|
|
1509
1493
|
} catch (t) {
|
|
1510
1494
|
return String(e);
|
|
1511
1495
|
}
|
|
1512
|
-
},
|
|
1496
|
+
}, jn = ({ context: e, error: n, exceptionType: r, extra: i = {}, source: a, spanName: o }) => {
|
|
1513
1497
|
if (!e.isSampled()) return;
|
|
1514
|
-
let s = Date.now(), c =
|
|
1498
|
+
let s = Date.now(), c = An(n);
|
|
1515
1499
|
e.notifyActivity({
|
|
1516
1500
|
time: s,
|
|
1517
1501
|
type: "error"
|
|
@@ -1531,7 +1515,7 @@ var Ne = (e, t) => typeof e.enabled == "function" ? e.enabled(t) : e.enabled !==
|
|
|
1531
1515
|
code: t.ERROR,
|
|
1532
1516
|
message: c
|
|
1533
1517
|
}), d.end();
|
|
1534
|
-
},
|
|
1518
|
+
}, Mn = () => {
|
|
1535
1519
|
let e = [];
|
|
1536
1520
|
return {
|
|
1537
1521
|
name: "error",
|
|
@@ -1539,20 +1523,19 @@ var Ne = (e, t) => typeof e.enabled == "function" ? e.enabled(t) : e.enabled !==
|
|
|
1539
1523
|
if (typeof window > "u") return;
|
|
1540
1524
|
let n = (e) => {
|
|
1541
1525
|
var n;
|
|
1542
|
-
|
|
1543
|
-
An({
|
|
1526
|
+
jn({
|
|
1544
1527
|
context: t,
|
|
1545
1528
|
spanName: "browser.error",
|
|
1546
1529
|
source: "window.error",
|
|
1547
1530
|
error: (n = e.error) == null ? e.message : n,
|
|
1548
|
-
extra:
|
|
1531
|
+
extra: {
|
|
1549
1532
|
"code.filepath": e.filename,
|
|
1550
1533
|
"code.lineno": e.lineno,
|
|
1551
1534
|
"code.column": e.colno
|
|
1552
|
-
}
|
|
1535
|
+
}
|
|
1553
1536
|
});
|
|
1554
1537
|
}, r = (e) => {
|
|
1555
|
-
|
|
1538
|
+
jn({
|
|
1556
1539
|
context: t,
|
|
1557
1540
|
spanName: "browser.unhandledrejection",
|
|
1558
1541
|
source: "unhandledrejection",
|
|
@@ -1564,16 +1547,13 @@ var Ne = (e, t) => typeof e.enabled == "function" ? e.enabled(t) : e.enabled !==
|
|
|
1564
1547
|
let n = e.target;
|
|
1565
1548
|
if (!(n instanceof Element)) return;
|
|
1566
1549
|
let r = n, i = r.src || r.href || n.currentSrc || "";
|
|
1567
|
-
|
|
1550
|
+
jn({
|
|
1568
1551
|
context: t,
|
|
1569
1552
|
spanName: "browser.resource_error",
|
|
1570
1553
|
source: "resource",
|
|
1571
1554
|
error: /* @__PURE__ */ Error(`Resource load failed: ${n.tagName.toLowerCase()} ${i}`),
|
|
1572
1555
|
exceptionType: "ResourceError",
|
|
1573
|
-
extra: {
|
|
1574
|
-
"url.full": t.config.hooks.redactUrl(i),
|
|
1575
|
-
"html.tag": n.tagName
|
|
1576
|
-
}
|
|
1556
|
+
extra: { "url.full": t.config.hooks.redactUrl(i) }
|
|
1577
1557
|
});
|
|
1578
1558
|
};
|
|
1579
1559
|
window.addEventListener("error", n), window.addEventListener("unhandledrejection", r), window.addEventListener("error", i, !0), e.push(() => window.removeEventListener("error", n), () => window.removeEventListener("unhandledrejection", r), () => window.removeEventListener("error", i, !0));
|
|
@@ -1585,7 +1565,7 @@ var Ne = (e, t) => typeof e.enabled == "function" ? e.enabled(t) : e.enabled !==
|
|
|
1585
1565
|
}
|
|
1586
1566
|
}
|
|
1587
1567
|
};
|
|
1588
|
-
},
|
|
1568
|
+
}, Nn = 50, Pn = (e, t) => typeof e == "number" && Number.isFinite(e) && e >= 0 ? e : t, H = (e) => Number.isFinite(e) ? e : void 0, Fn = (e, t) => S(S(S(S(S({}, e.containerId ? { "long_task.attribution.container_id": e.containerId } : {}), e.containerName ? { "long_task.attribution.container_name": e.containerName } : {}), e.containerSrc ? { "long_task.attribution.container_src": t(e.containerSrc) } : {}), e.containerType ? { "long_task.attribution.container_type": e.containerType } : {}), e.name ? { "long_task.attribution.name": e.name } : {}), In = (e, t) => ({
|
|
1589
1569
|
"long_task.script.duration": e.duration,
|
|
1590
1570
|
"long_task.script.execution_start": e.executionStart,
|
|
1591
1571
|
"long_task.script.forced_style_and_layout_duration": e.forcedStyleAndLayoutDuration,
|
|
@@ -1597,8 +1577,8 @@ var Ne = (e, t) => typeof e.enabled == "function" ? e.enabled(t) : e.enabled !==
|
|
|
1597
1577
|
"long_task.script.source_url": e.sourceURL ? t(e.sourceURL) : "",
|
|
1598
1578
|
"long_task.script.start_time": e.startTime,
|
|
1599
1579
|
"long_task.script.window_attribution": e.windowAttribution
|
|
1600
|
-
}),
|
|
1601
|
-
let t =
|
|
1580
|
+
}), Ln = (e = {}) => {
|
|
1581
|
+
let t = Pn(e.threshold, Nn), n, r, i = [];
|
|
1602
1582
|
return {
|
|
1603
1583
|
name: "long-task",
|
|
1604
1584
|
init(e) {
|
|
@@ -1609,16 +1589,15 @@ var Ne = (e, t) => typeof e.enabled == "function" ? e.enabled(t) : e.enabled !==
|
|
|
1609
1589
|
let c = (n) => {
|
|
1610
1590
|
var r, i;
|
|
1611
1591
|
if (!e.isSampled() || !Number.isFinite(n.duration) || n.duration < t) return;
|
|
1612
|
-
let a = n.entryType === "long-animation-frame", o = a ? n : void 0, s = (r = o == null ? void 0 : o.scripts) == null ? [] : r, c = h("long-task"), l = performance.timeOrigin + n.startTime, u = l + n.duration, d = a ? "long-animation-frame" : "long-task", f = a || (i = n.attribution) == null ? [] : i, p = e.startSpan("browser.long_task", S(S(S(S(S(S(
|
|
1613
|
-
[g.longTaskDuration]: n.duration,
|
|
1592
|
+
let a = n.entryType === "long-animation-frame", o = a ? n : void 0, s = (r = o == null ? void 0 : o.scripts) == null ? [] : r, c = h("long-task"), l = performance.timeOrigin + n.startTime, u = l + n.duration, d = a ? "long-animation-frame" : "long-task", f = a || (i = n.attribution) == null ? [] : i, p = e.startSpan("browser.long_task", S(S(S(S(S(S({}, e.config.hooks.getPageAttributes()), M({ spanType: j.longTask })), H(o == null ? void 0 : o.blockingDuration) === void 0 ? {} : { [g.longTaskBlockingDuration]: o.blockingDuration }), {}, {
|
|
1614
1593
|
[g.longTaskEntryType]: d,
|
|
1615
1594
|
[g.longTaskId]: c,
|
|
1616
1595
|
"long_task.name": n.name
|
|
1617
|
-
},
|
|
1596
|
+
}, H(o == null ? void 0 : o.firstUIEventTimestamp) === void 0 ? {} : { "long_task.first_ui_event_timestamp": o.firstUIEventTimestamp }), H(o == null ? void 0 : o.renderStart) === void 0 ? {} : { "long_task.render_start": o.renderStart }), H(o == null ? void 0 : o.styleAndLayoutStart) === void 0 ? {} : { "long_task.style_and_layout_start": o.styleAndLayoutStart }), { startTime: l });
|
|
1618
1597
|
s.forEach((t) => {
|
|
1619
|
-
p.addEvent("long_task.script", e.applyRedact(
|
|
1598
|
+
p.addEvent("long_task.script", e.applyRedact(In(t, e.config.hooks.redactUrl)), performance.timeOrigin + t.startTime);
|
|
1620
1599
|
}), f.forEach((t, n) => {
|
|
1621
|
-
p.addEvent("long_task.attribution", e.applyRedact(S({ "long_task.attribution.index": n },
|
|
1600
|
+
p.addEvent("long_task.attribution", e.applyRedact(S({ "long_task.attribution.index": n }, Fn(t, e.config.hooks.redactUrl))), l);
|
|
1622
1601
|
}), p.end(u), e.notifyActivity({
|
|
1623
1602
|
endTime: u,
|
|
1624
1603
|
startTime: l,
|
|
@@ -1645,43 +1624,43 @@ var Ne = (e, t) => typeof e.enabled == "function" ? e.enabled(t) : e.enabled !==
|
|
|
1645
1624
|
n == null || n.disconnect(), n = void 0, clearTimeout(r), r = void 0, i = [];
|
|
1646
1625
|
}
|
|
1647
1626
|
};
|
|
1648
|
-
},
|
|
1649
|
-
let n =
|
|
1650
|
-
|
|
1627
|
+
}, U = /* @__PURE__ */ new Set(), W = "", G, K, q = !1, J = () => typeof location > "u" ? "" : location.href, Y = (e, t) => {
|
|
1628
|
+
let n = J();
|
|
1629
|
+
W = n;
|
|
1651
1630
|
let r = {
|
|
1652
1631
|
fromUrl: t,
|
|
1653
1632
|
source: e,
|
|
1654
1633
|
toUrl: n
|
|
1655
1634
|
};
|
|
1656
|
-
for (let e of Array.from(
|
|
1635
|
+
for (let e of Array.from(U)) e(r);
|
|
1636
|
+
}, Rn = () => {
|
|
1637
|
+
Y("popstate", W || J());
|
|
1657
1638
|
}, zn = () => {
|
|
1658
|
-
|
|
1639
|
+
Y("hashchange", W || J());
|
|
1659
1640
|
}, Bn = () => {
|
|
1660
|
-
|
|
1661
|
-
|
|
1662
|
-
Ln || typeof window > "u" || typeof history > "u" || (Ln = !0, K = Y(), q = history.pushState, J = history.replaceState, history.pushState = function(e, t, n) {
|
|
1663
|
-
let r = K || Y(), i = q == null ? void 0 : q.apply(this, [
|
|
1641
|
+
q || typeof window > "u" || typeof history > "u" || (q = !0, W = J(), G = history.pushState, K = history.replaceState, history.pushState = function(e, t, n) {
|
|
1642
|
+
let r = W || J(), i = G == null ? void 0 : G.apply(this, [
|
|
1664
1643
|
e,
|
|
1665
1644
|
t,
|
|
1666
1645
|
n
|
|
1667
1646
|
]);
|
|
1668
|
-
return
|
|
1647
|
+
return Y("pushState", r), i;
|
|
1669
1648
|
}, history.replaceState = function(e, t, n) {
|
|
1670
|
-
let r =
|
|
1649
|
+
let r = W || J(), i = K == null ? void 0 : K.apply(this, [
|
|
1671
1650
|
e,
|
|
1672
1651
|
t,
|
|
1673
1652
|
n
|
|
1674
1653
|
]);
|
|
1675
|
-
return
|
|
1676
|
-
}, window.addEventListener("popstate",
|
|
1677
|
-
},
|
|
1678
|
-
!
|
|
1679
|
-
},
|
|
1680
|
-
|
|
1654
|
+
return Y("replaceState", r), i;
|
|
1655
|
+
}, window.addEventListener("popstate", Rn), window.addEventListener("hashchange", zn));
|
|
1656
|
+
}, Vn = () => {
|
|
1657
|
+
!q || typeof window > "u" || typeof history > "u" || (G && (history.pushState = G), K && (history.replaceState = K), window.removeEventListener("popstate", Rn), window.removeEventListener("hashchange", zn), G = void 0, K = void 0, q = !1, W = "");
|
|
1658
|
+
}, Hn = (e) => typeof window > "u" || typeof history > "u" ? () => {} : (Bn(), U.add(e), () => {
|
|
1659
|
+
U.delete(e), U.size === 0 && Vn();
|
|
1681
1660
|
});
|
|
1682
1661
|
//#endregion
|
|
1683
1662
|
//#region \0@oxc-project+runtime@0.128.0/helpers/objectWithoutPropertiesLoose.js
|
|
1684
|
-
function
|
|
1663
|
+
function Un(e, t) {
|
|
1685
1664
|
if (e == null) return {};
|
|
1686
1665
|
var n = {};
|
|
1687
1666
|
for (var r in e) if ({}.hasOwnProperty.call(e, r)) {
|
|
@@ -1692,9 +1671,9 @@ function Wn(e, t) {
|
|
|
1692
1671
|
}
|
|
1693
1672
|
//#endregion
|
|
1694
1673
|
//#region \0@oxc-project+runtime@0.128.0/helpers/objectWithoutProperties.js
|
|
1695
|
-
function
|
|
1674
|
+
function Wn(e, t) {
|
|
1696
1675
|
if (e == null) return {};
|
|
1697
|
-
var n, r, i =
|
|
1676
|
+
var n, r, i = Un(e, t);
|
|
1698
1677
|
if (Object.getOwnPropertySymbols) {
|
|
1699
1678
|
var a = Object.getOwnPropertySymbols(e);
|
|
1700
1679
|
for (r = 0; r < a.length; r++) n = a[r], t.includes(n) || {}.propertyIsEnumerable.call(e, n) && (i[n] = e[n]);
|
|
@@ -1703,7 +1682,7 @@ function Gn(e, t) {
|
|
|
1703
1682
|
}
|
|
1704
1683
|
//#endregion
|
|
1705
1684
|
//#region src/plugins/page-view.ts
|
|
1706
|
-
var
|
|
1685
|
+
var Gn = ["stopLoadingTime"], Kn = new Set(Object.values(g)), qn = () => typeof location > "u" ? "" : location.href, Jn = () => {
|
|
1707
1686
|
if (typeof performance > "u") return {};
|
|
1708
1687
|
let e = performance.getEntriesByType("navigation")[0];
|
|
1709
1688
|
if (!e) return {};
|
|
@@ -1711,10 +1690,10 @@ var Kn = ["stopLoadingTime"], qn = new Set(Object.values(g)), Jn = () => typeof
|
|
|
1711
1690
|
Number.isFinite(n) && n > 0 && (t[e] = n);
|
|
1712
1691
|
};
|
|
1713
1692
|
return n(g.viewFirstByte, e.responseStart), n(g.viewDomInteractive, e.domInteractive), n(g.viewDomContentLoaded, e.domContentLoadedEventEnd), n(g.viewDomComplete, e.domComplete), n(g.viewLoadEvent, e.loadEventEnd), t;
|
|
1714
|
-
},
|
|
1693
|
+
}, Yn = (e) => {
|
|
1715
1694
|
let t = e.indexOf("?");
|
|
1716
1695
|
return t < 0 ? e : e.slice(0, t);
|
|
1717
|
-
},
|
|
1696
|
+
}, Xn = (e) => {
|
|
1718
1697
|
let t = e.slice(1);
|
|
1719
1698
|
if (!t || typeof document > "u" || typeof document.getElementById != "function") return !1;
|
|
1720
1699
|
try {
|
|
@@ -1722,14 +1701,14 @@ var Kn = ["stopLoadingTime"], qn = new Set(Object.values(g)), Jn = () => typeof
|
|
|
1722
1701
|
} catch (e) {
|
|
1723
1702
|
return !!document.getElementById(t);
|
|
1724
1703
|
}
|
|
1725
|
-
},
|
|
1704
|
+
}, Zn = (e, t) => {
|
|
1726
1705
|
try {
|
|
1727
1706
|
let n = typeof location > "u" ? "http://localhost" : location.href, r = new URL(e, n), i = new URL(t, n);
|
|
1728
|
-
return r.pathname !== i.pathname || !
|
|
1707
|
+
return r.pathname !== i.pathname || !Xn(i.hash) && Yn(r.hash) !== Yn(i.hash);
|
|
1729
1708
|
} catch (n) {
|
|
1730
1709
|
return e !== t;
|
|
1731
1710
|
}
|
|
1732
|
-
},
|
|
1711
|
+
}, Qn = () => {
|
|
1733
1712
|
let e = [];
|
|
1734
1713
|
return {
|
|
1735
1714
|
name: "page-view",
|
|
@@ -1756,10 +1735,10 @@ var Kn = ["stopLoadingTime"], qn = new Set(Object.values(g)), Jn = () => typeof
|
|
|
1756
1735
|
let s = S({}, n);
|
|
1757
1736
|
(i = n.stopLoadingTime) == null || i.call(n), o(n, "end", r, e), n = void 0, t && a(r);
|
|
1758
1737
|
let { stopLoadingTime: c } = s;
|
|
1759
|
-
return
|
|
1738
|
+
return Wn(s, Gn);
|
|
1760
1739
|
}, c = (e, t, r) => {
|
|
1761
1740
|
if (n !== e || !Number.isFinite(t) || t < 0) return;
|
|
1762
|
-
let i = S(S({}, e.loadingType === "initial_load" ?
|
|
1741
|
+
let i = S(S({}, e.loadingType === "initial_load" ? Jn() : {}), {}, {
|
|
1763
1742
|
[g.viewLoadingTime]: t,
|
|
1764
1743
|
[g.viewLoadingTimeSource]: r
|
|
1765
1744
|
});
|
|
@@ -1784,7 +1763,7 @@ var Kn = ["stopLoadingTime"], qn = new Set(Object.values(g)), Jn = () => typeof
|
|
|
1784
1763
|
};
|
|
1785
1764
|
window.addEventListener("load", t, { once: !0 }), s = () => window.removeEventListener("load", t);
|
|
1786
1765
|
}
|
|
1787
|
-
let p =
|
|
1766
|
+
let p = yt(t, e.startedAt, (t) => {
|
|
1788
1767
|
r = !0, t.hadActivity && (i = Math.max(0, t.endTime - e.startedAt)), d();
|
|
1789
1768
|
}), m = () => {
|
|
1790
1769
|
var t;
|
|
@@ -1795,38 +1774,39 @@ var Kn = ["stopLoadingTime"], qn = new Set(Object.values(g)), Jn = () => typeof
|
|
|
1795
1774
|
}, d();
|
|
1796
1775
|
}, u = (e) => {
|
|
1797
1776
|
let n = t.applyRedact(e == null ? {} : e);
|
|
1798
|
-
return Object.fromEntries(Object.entries(n).filter(([e, t]) => t !== void 0 && !
|
|
1777
|
+
return Object.fromEntries(Object.entries(n).filter(([e, t]) => t !== void 0 && !Kn.has(e)));
|
|
1799
1778
|
}, d = (e, r, i, a = ((e) => (e = n == null ? void 0 : n.rawUrl) == null ? "" : e)()) => {
|
|
1800
1779
|
var c;
|
|
1801
1780
|
if (!t.isSessionActive()) return;
|
|
1802
|
-
let d = (c = e.url) == null ?
|
|
1781
|
+
let d = (c = e.url) == null ? qn() : c, f = t.config.hooks.getViewUrlTemplate(d), p = a ? t.config.hooks.getViewUrlTemplate(a) : "", m = e.name, _ = u(e.attributes);
|
|
1803
1782
|
s(r, !1);
|
|
1804
|
-
let
|
|
1783
|
+
let v = h("view"), y = t.config.hooks.redactUrl(d), b = t.config.hooks.redactUrl(a), x = i === "initial_load", C = x && typeof performance < "u" ? performance.timeOrigin : Date.now(), w = x ? Jn() : {};
|
|
1805
1784
|
t.setView({
|
|
1806
|
-
attributes:
|
|
1807
|
-
id:
|
|
1785
|
+
attributes: _,
|
|
1786
|
+
id: v,
|
|
1808
1787
|
loadingType: i,
|
|
1809
|
-
name:
|
|
1810
|
-
startedAt:
|
|
1811
|
-
url:
|
|
1788
|
+
name: m,
|
|
1789
|
+
startedAt: C,
|
|
1790
|
+
url: y,
|
|
1812
1791
|
urlTemplate: f
|
|
1813
|
-
},
|
|
1814
|
-
attributes:
|
|
1792
|
+
}, C), n = {
|
|
1793
|
+
attributes: _,
|
|
1815
1794
|
version: 0,
|
|
1816
|
-
id:
|
|
1795
|
+
id: v,
|
|
1817
1796
|
loadingType: i,
|
|
1818
|
-
name:
|
|
1797
|
+
name: m,
|
|
1819
1798
|
rawUrl: d,
|
|
1820
|
-
snapshotAttributes: S(S(S(S(S(S({},
|
|
1821
|
-
[g.viewUrl]:
|
|
1799
|
+
snapshotAttributes: S(S(S(S(S(S({}, _), t.config.hooks.getPageAttributes()), w), M({ spanType: j.view })), {}, { [g.viewId]: v }, m ? { [g.viewName]: m } : {}), {}, {
|
|
1800
|
+
[g.viewUrl]: y,
|
|
1822
1801
|
[g.viewUrlTemplate]: f,
|
|
1823
1802
|
[g.viewLoadingType]: i,
|
|
1824
|
-
|
|
1825
|
-
|
|
1826
|
-
|
|
1827
|
-
|
|
1803
|
+
[g.viewPrevious]: b,
|
|
1804
|
+
[g.viewPreviousUrlTemplate]: p
|
|
1805
|
+
}, x && document.referrer ? { [g.viewReferrer]: t.config.hooks.redactUrl(document.referrer) } : {}),
|
|
1806
|
+
startedAt: C,
|
|
1807
|
+
url: y,
|
|
1828
1808
|
urlTemplate: f
|
|
1829
|
-
}, o(n, "start",
|
|
1809
|
+
}, o(n, "start", C), l(n);
|
|
1830
1810
|
}, f = t.onViewCommand((e) => {
|
|
1831
1811
|
if (e.type === "start") {
|
|
1832
1812
|
d(e.options, "manual", n ? "route_change" : "initial_load");
|
|
@@ -1849,8 +1829,8 @@ var Kn = ["stopLoadingTime"], qn = new Set(Object.values(g)), Jn = () => typeof
|
|
|
1849
1829
|
}), o(n, "update"));
|
|
1850
1830
|
}
|
|
1851
1831
|
}), p = () => {};
|
|
1852
|
-
t.config.view.tracking === "auto" && (n || d({}, "load", "initial_load"), p =
|
|
1853
|
-
|
|
1832
|
+
t.config.view.tracking === "auto" && (n || d({}, "load", "initial_load"), p = Hn((e) => {
|
|
1833
|
+
Zn(e.fromUrl, e.toUrl) && d({}, e.source, "route_change", e.fromUrl);
|
|
1854
1834
|
}));
|
|
1855
1835
|
let m = (e) => {
|
|
1856
1836
|
if (e.persisted) {
|
|
@@ -1892,7 +1872,7 @@ var Kn = ["stopLoadingTime"], qn = new Set(Object.values(g)), Jn = () => typeof
|
|
|
1892
1872
|
}
|
|
1893
1873
|
}
|
|
1894
1874
|
};
|
|
1895
|
-
},
|
|
1875
|
+
}, $n = 5e3, er = (e) => typeof e == "number" && Number.isFinite(e) && e > 0, tr = (e, t, n, r) => ({
|
|
1896
1876
|
expiresAt: Math.min(t + n, t + r),
|
|
1897
1877
|
id: e,
|
|
1898
1878
|
startedAt: t,
|
|
@@ -1900,19 +1880,19 @@ var Kn = ["stopLoadingTime"], qn = new Set(Object.values(g)), Jn = () => typeof
|
|
|
1900
1880
|
}), X = (e, t, n) => {
|
|
1901
1881
|
if (t >= e.startedAt + n) return "maxLifetime";
|
|
1902
1882
|
if (t >= e.expiresAt) return "inactivity";
|
|
1903
|
-
},
|
|
1883
|
+
}, nr = (e, t, n, r) => S(S({}, e), {}, { expiresAt: Math.min(t + n, e.startedAt + r) }), rr = (e, t, n) => {
|
|
1904
1884
|
if (!e) return null;
|
|
1905
1885
|
try {
|
|
1906
1886
|
let r = JSON.parse(e);
|
|
1907
|
-
if (r.status === "active" && typeof r.id == "string" && r.id.length > 0 &&
|
|
1887
|
+
if (r.status === "active" && typeof r.id == "string" && r.id.length > 0 && er(r.startedAt) && r.startedAt <= t + $n && er(r.expiresAt) && r.expiresAt >= r.startedAt && r.expiresAt <= r.startedAt + n || r.status === "expired" && typeof r.previousId == "string" && r.previousId.length > 0 && (r.reason === "inactivity" || r.reason === "maxLifetime") && er(r.expiredAt) && r.expiredAt <= t + $n) return r;
|
|
1908
1888
|
} catch (e) {}
|
|
1909
1889
|
return null;
|
|
1910
|
-
},
|
|
1890
|
+
}, ir = 900 * 1e3, Z = 14400 * 1e3, ar = 1e3, or = 6e4, sr = [
|
|
1911
1891
|
"click",
|
|
1912
1892
|
"keydown",
|
|
1913
1893
|
"scroll",
|
|
1914
1894
|
"touchstart"
|
|
1915
|
-
],
|
|
1895
|
+
], cr = /* @__PURE__ */ new Map(), lr = (e) => {
|
|
1916
1896
|
let t = typeof window < "u", n = () => {
|
|
1917
1897
|
var n;
|
|
1918
1898
|
if (t) try {
|
|
@@ -1920,21 +1900,21 @@ var Kn = ["stopLoadingTime"], qn = new Set(Object.values(g)), Jn = () => typeof
|
|
|
1920
1900
|
} catch (e) {
|
|
1921
1901
|
t = !1;
|
|
1922
1902
|
}
|
|
1923
|
-
return (n =
|
|
1903
|
+
return (n = cr.get(e)) == null ? null : n;
|
|
1924
1904
|
};
|
|
1925
1905
|
return n(), {
|
|
1926
1906
|
isLocalStorage: () => t,
|
|
1927
1907
|
read: n,
|
|
1928
1908
|
write: (n) => {
|
|
1929
1909
|
let r = JSON.stringify(n);
|
|
1930
|
-
if (
|
|
1910
|
+
if (cr.set(e, r), t) try {
|
|
1931
1911
|
window.localStorage.setItem(e, r);
|
|
1932
1912
|
} catch (e) {
|
|
1933
1913
|
t = !1;
|
|
1934
1914
|
}
|
|
1935
1915
|
}
|
|
1936
1916
|
};
|
|
1937
|
-
},
|
|
1917
|
+
}, ur = (e, t) => {
|
|
1938
1918
|
let n = "";
|
|
1939
1919
|
try {
|
|
1940
1920
|
n = new URL(e).host;
|
|
@@ -1942,19 +1922,17 @@ var Kn = ["stopLoadingTime"], qn = new Set(Object.values(g)), Jn = () => typeof
|
|
|
1942
1922
|
n = e;
|
|
1943
1923
|
}
|
|
1944
1924
|
return `bk_ot_session__${m(`${t}\0${n || "default"}`)}`;
|
|
1945
|
-
},
|
|
1925
|
+
}, dr = (e, t, n, r) => {
|
|
1946
1926
|
e.startSpan("browser.session", S(S(S({}, e.config.hooks.getPageAttributes()), M({ spanType: j.session })), {}, {
|
|
1947
1927
|
[g.sessionPhase]: t,
|
|
1948
1928
|
[g.sessionHasReplay]: !1,
|
|
1949
1929
|
[g.sessionId]: n,
|
|
1950
|
-
[g.
|
|
1951
|
-
|
|
1952
|
-
|
|
1953
|
-
|
|
1954
|
-
|
|
1955
|
-
|
|
1956
|
-
}).end(i);
|
|
1957
|
-
}, pr = (e = {}) => {
|
|
1930
|
+
[g.sessionType]: "user"
|
|
1931
|
+
}), {
|
|
1932
|
+
contextTime: r,
|
|
1933
|
+
startTime: r
|
|
1934
|
+
}).end(r);
|
|
1935
|
+
}, fr = (e = {}) => {
|
|
1958
1936
|
let t = [];
|
|
1959
1937
|
return {
|
|
1960
1938
|
name: "session",
|
|
@@ -1965,44 +1943,41 @@ var Kn = ["stopLoadingTime"], qn = new Set(Object.values(g)), Jn = () => typeof
|
|
|
1965
1943
|
n.setRuntimeAttributes({
|
|
1966
1944
|
[g.sessionHasReplay]: !1,
|
|
1967
1945
|
[g.sessionId]: t,
|
|
1968
|
-
[g.sessionStartTime]: e,
|
|
1969
1946
|
[g.sessionType]: "user"
|
|
1970
1947
|
}, e);
|
|
1971
1948
|
return;
|
|
1972
1949
|
}
|
|
1973
|
-
let i = (r = e.storageKey) == null ?
|
|
1974
|
-
|
|
1975
|
-
},
|
|
1976
|
-
|
|
1977
|
-
|
|
1978
|
-
i && (n.notifySessionLifecycle({
|
|
1950
|
+
let i = (r = e.storageKey) == null ? ur(n.config.transport.endpoint, n.config.application.name) : r, a = lr(i), o = typeof performance < "u" && Number.isFinite(performance.timeOrigin) ? performance.timeOrigin : Date.now(), s, c, l = (e = Date.now()) => rr(a.read(), e, Z), u = () => {
|
|
1951
|
+
c !== void 0 && (clearTimeout(c), c = void 0);
|
|
1952
|
+
}, d = (e, t = Date.now()) => {
|
|
1953
|
+
let r = s;
|
|
1954
|
+
r && (n.notifySessionLifecycle({
|
|
1979
1955
|
expiredAt: t,
|
|
1980
|
-
id:
|
|
1956
|
+
id: r,
|
|
1981
1957
|
reason: e,
|
|
1982
1958
|
type: "expired"
|
|
1983
|
-
}),
|
|
1959
|
+
}), dr(n, "end", r, t), u(), s = void 0, n.setRuntimeAttributes({
|
|
1984
1960
|
[g.sessionHasReplay]: void 0,
|
|
1985
1961
|
[g.sessionId]: void 0,
|
|
1986
|
-
[g.sessionStartTime]: void 0,
|
|
1987
1962
|
[g.sessionType]: void 0
|
|
1988
1963
|
}, t), n.flush());
|
|
1989
|
-
},
|
|
1990
|
-
let e = Date.now(), t =
|
|
1964
|
+
}, f = () => {
|
|
1965
|
+
let e = Date.now(), t = l(e);
|
|
1991
1966
|
if (!t) {
|
|
1992
|
-
|
|
1967
|
+
d("external", e);
|
|
1993
1968
|
return;
|
|
1994
1969
|
}
|
|
1995
1970
|
if (t.status === "expired") {
|
|
1996
|
-
|
|
1971
|
+
d(t.reason, t.expiredAt);
|
|
1997
1972
|
return;
|
|
1998
1973
|
}
|
|
1999
1974
|
if (t.id !== s) {
|
|
2000
|
-
|
|
1975
|
+
d("external", e);
|
|
2001
1976
|
return;
|
|
2002
1977
|
}
|
|
2003
1978
|
let n = X(t, e, Z);
|
|
2004
1979
|
if (!n) {
|
|
2005
|
-
|
|
1980
|
+
p(t);
|
|
2006
1981
|
return;
|
|
2007
1982
|
}
|
|
2008
1983
|
let r = {
|
|
@@ -2011,148 +1986,133 @@ var Kn = ["stopLoadingTime"], qn = new Set(Object.values(g)), Jn = () => typeof
|
|
|
2011
1986
|
reason: n,
|
|
2012
1987
|
status: "expired"
|
|
2013
1988
|
};
|
|
2014
|
-
a.write(r),
|
|
2015
|
-
},
|
|
2016
|
-
|
|
1989
|
+
a.write(r), d(n, e);
|
|
1990
|
+
}, p = (e) => {
|
|
1991
|
+
u();
|
|
2017
1992
|
let t = Math.min(e.expiresAt, e.startedAt + Z);
|
|
2018
|
-
|
|
2019
|
-
},
|
|
1993
|
+
c = setTimeout(f, Math.max(0, t - Date.now()));
|
|
1994
|
+
}, m = (e, t) => {
|
|
2020
1995
|
let r = e.id !== s;
|
|
2021
|
-
s = e.id,
|
|
1996
|
+
s = e.id, n.setRuntimeAttributes({
|
|
2022
1997
|
[g.sessionHasReplay]: !1,
|
|
2023
1998
|
[g.sessionId]: e.id,
|
|
2024
|
-
[g.sessionStartTime]: e.startedAt,
|
|
2025
1999
|
[g.sessionType]: "user"
|
|
2026
|
-
}, Math.min(e.startedAt, o)),
|
|
2000
|
+
}, Math.min(e.startedAt, o)), p(e), r && t && n.notifySessionLifecycle({
|
|
2027
2001
|
id: e.id,
|
|
2028
2002
|
previousId: t.previousId,
|
|
2029
2003
|
reason: t.reason,
|
|
2030
2004
|
startedAt: e.startedAt,
|
|
2031
2005
|
type: "renewed"
|
|
2032
2006
|
});
|
|
2033
|
-
},
|
|
2034
|
-
let t = Date.now(), r =
|
|
2007
|
+
}, _ = (e = !1) => {
|
|
2008
|
+
let t = Date.now(), r = l(t);
|
|
2035
2009
|
if ((r == null ? void 0 : r.status) === "active" && !X(r, t, Z)) {
|
|
2036
|
-
let e =
|
|
2037
|
-
a.write(e),
|
|
2010
|
+
let e = nr(r, t, ir, Z);
|
|
2011
|
+
a.write(e), m(e, s ? void 0 : { reason: "shared" });
|
|
2038
2012
|
return;
|
|
2039
2013
|
}
|
|
2040
|
-
let i = (r == null ? void 0 : r.status) === "expired" ? r.previousId : r == null ? void 0 : r.id, o = (r == null ? void 0 : r.status) === "expired" ? r.reason : r ? X(r, t, Z) : e ? "init" : void 0, c =
|
|
2041
|
-
a.write(c),
|
|
2014
|
+
let i = (r == null ? void 0 : r.status) === "expired" ? r.previousId : r == null ? void 0 : r.id, o = (r == null ? void 0 : r.status) === "expired" ? r.reason : r ? X(r, t, Z) : e ? "init" : void 0, c = tr(h("session"), t, ir, Z);
|
|
2015
|
+
a.write(c), m(c, {
|
|
2042
2016
|
previousId: i,
|
|
2043
2017
|
reason: o == null ? "init" : o
|
|
2044
|
-
});
|
|
2045
|
-
|
|
2046
|
-
fr(n, l === "init" ? "start" : "rotate", c.id, c.startedAt, c.startedAt, l, i);
|
|
2047
|
-
}, y = () => {
|
|
2018
|
+
}), dr(n, (o == null ? "init" : o) === "init" ? "start" : "rotate", c.id, c.startedAt);
|
|
2019
|
+
}, v = () => {
|
|
2048
2020
|
if (!s) return;
|
|
2049
|
-
let e = Date.now(), t =
|
|
2021
|
+
let e = Date.now(), t = l(e);
|
|
2050
2022
|
if ((t == null ? void 0 : t.status) !== "active" || t.id !== s || X(t, e, Z)) {
|
|
2051
|
-
|
|
2023
|
+
f();
|
|
2052
2024
|
return;
|
|
2053
2025
|
}
|
|
2054
|
-
let n =
|
|
2055
|
-
a.write(n),
|
|
2026
|
+
let n = nr(t, e, ir, Z);
|
|
2027
|
+
a.write(n), m(n);
|
|
2056
2028
|
};
|
|
2057
|
-
|
|
2058
|
-
let
|
|
2029
|
+
_(!0);
|
|
2030
|
+
let y = 0, b = () => {
|
|
2059
2031
|
let e = Date.now();
|
|
2060
|
-
e -
|
|
2061
|
-
},
|
|
2032
|
+
e - y < ar || (y = e, _());
|
|
2033
|
+
}, x = {
|
|
2062
2034
|
capture: !0,
|
|
2063
2035
|
passive: !0
|
|
2064
2036
|
};
|
|
2065
|
-
|
|
2066
|
-
|
|
2037
|
+
sr.forEach((e) => window.addEventListener(e, b, x)), t.push(() => {
|
|
2038
|
+
sr.forEach((e) => window.removeEventListener(e, b, x));
|
|
2067
2039
|
});
|
|
2068
|
-
let
|
|
2069
|
-
document.visibilityState === "visible" &&
|
|
2040
|
+
let S = () => {
|
|
2041
|
+
document.visibilityState === "visible" && v();
|
|
2070
2042
|
};
|
|
2071
|
-
document.addEventListener("visibilitychange",
|
|
2072
|
-
let
|
|
2043
|
+
document.addEventListener("visibilitychange", S);
|
|
2044
|
+
let C = window.setInterval(S, or);
|
|
2073
2045
|
t.push(() => {
|
|
2074
|
-
document.removeEventListener("visibilitychange",
|
|
2046
|
+
document.removeEventListener("visibilitychange", S), window.clearInterval(C);
|
|
2075
2047
|
});
|
|
2076
|
-
let
|
|
2048
|
+
let w = (e) => {
|
|
2077
2049
|
if (!a.isLocalStorage() || e.storageArea !== window.localStorage || e.key !== i) return;
|
|
2078
|
-
let t = Date.now(), n =
|
|
2050
|
+
let t = Date.now(), n = rr(e.newValue, t, Z);
|
|
2079
2051
|
if ((n == null ? void 0 : n.status) === "active" && n.id === s && !X(n, t, Z)) {
|
|
2080
|
-
|
|
2052
|
+
p(n);
|
|
2081
2053
|
return;
|
|
2082
2054
|
}
|
|
2083
|
-
|
|
2055
|
+
d((n == null ? void 0 : n.status) === "expired" ? n.reason : "external", (n == null ? void 0 : n.status) === "expired" ? n.expiredAt : t);
|
|
2084
2056
|
};
|
|
2085
|
-
window.addEventListener("storage",
|
|
2057
|
+
window.addEventListener("storage", w), t.push(() => window.removeEventListener("storage", w)), t.push(u);
|
|
2086
2058
|
},
|
|
2087
2059
|
shutdown() {
|
|
2088
2060
|
for (var e; t.length;) (e = t.pop()) == null || e();
|
|
2089
2061
|
}
|
|
2090
2062
|
};
|
|
2091
|
-
},
|
|
2063
|
+
}, pr = 10, mr = 6e4, hr = 5e3, gr = 1e3, _r = (e, t) => !!t && e === t, vr = (e, t) => {
|
|
2092
2064
|
let [n, r] = e === "CLS" ? [.1, .25] : [200, 500];
|
|
2093
2065
|
return t <= n ? "good" : t <= r ? "needs-improvement" : "poor";
|
|
2094
|
-
},
|
|
2066
|
+
}, yr = (e) => {
|
|
2095
2067
|
var t, n, r;
|
|
2096
2068
|
if (!(typeof Element > "u" || !(e instanceof Element))) return (t = (n = (r = e.getAttribute("data-bk-action-name")) == null ? e.getAttribute("aria-label") : r) == null ? e.getAttribute("name") : n) == null ? e.tagName.toLowerCase() : t;
|
|
2097
|
-
},
|
|
2069
|
+
}, br = () => {
|
|
2098
2070
|
if (typeof performance > "u") return;
|
|
2099
2071
|
let e = performance.interactionCount;
|
|
2100
2072
|
return typeof e == "number" && Number.isFinite(e) ? e : void 0;
|
|
2101
|
-
},
|
|
2073
|
+
}, xr = (e, t) => {
|
|
2102
2074
|
var n, r;
|
|
2103
2075
|
let i = (n = t.value) == null ? 0 : n;
|
|
2104
|
-
|
|
2105
|
-
|
|
2106
|
-
var a;
|
|
2107
|
-
e.clsWindowStart = t.startTime, e.clsWindowValue = i, e.clsWindowLargestShiftValue = i, e.clsWindowLargestShiftTarget = br((a = t.sources) == null || (a = a[0]) == null ? void 0 : a.node);
|
|
2108
|
-
} else if (e.clsWindowValue += i, i > e.clsWindowLargestShiftValue) {
|
|
2109
|
-
var o;
|
|
2110
|
-
e.clsWindowLargestShiftValue = i, e.clsWindowLargestShiftTarget = br((o = t.sources) == null || (o = o[0]) == null ? void 0 : o.node);
|
|
2111
|
-
}
|
|
2112
|
-
e.clsWindowEnd = t.startTime, e.clsWindowValue > e.cls && (e.cls = Math.round(e.clsWindowValue * 1e4) / 1e4, e.largestShiftValue = e.clsWindowLargestShiftValue, e.largestShiftTarget = e.clsWindowLargestShiftTarget);
|
|
2113
|
-
}
|
|
2114
|
-
}, Cr = (e, t) => {
|
|
2076
|
+
t.hadRecentInput || !Number.isFinite(i) || (e.clsWindowStart === void 0 || t.startTime - ((r = e.clsWindowEnd) == null ? t.startTime : r) >= gr || t.startTime - e.clsWindowStart >= hr ? (e.clsWindowStart = t.startTime, e.clsWindowValue = i) : e.clsWindowValue += i, e.clsWindowEnd = t.startTime, e.clsWindowValue > e.cls && (e.cls = Math.round(e.clsWindowValue * 1e4) / 1e4));
|
|
2077
|
+
}, Sr = (e, t) => {
|
|
2115
2078
|
var n, r;
|
|
2116
2079
|
if (!t.interactionId || !Number.isFinite(t.duration)) return;
|
|
2117
2080
|
e.interactionIdMin = Math.min(e.interactionIdMin, t.interactionId), e.interactionIdMax = Math.max(e.interactionIdMax, t.interactionId);
|
|
2118
2081
|
let i = (n = t.processingStart) == null ? t.startTime : n, a = (r = t.processingEnd) == null ? i : r, o = {
|
|
2119
|
-
duration: Math.min(t.duration,
|
|
2082
|
+
duration: Math.min(t.duration, mr),
|
|
2120
2083
|
inputDelay: Math.max(0, i - t.startTime),
|
|
2121
2084
|
interactionId: t.interactionId,
|
|
2122
|
-
interactionTarget:
|
|
2085
|
+
interactionTarget: yr(t.target),
|
|
2123
2086
|
interactionType: t.name,
|
|
2124
2087
|
presentationDelay: Math.max(0, t.startTime + t.duration - a),
|
|
2125
2088
|
processingDuration: Math.max(0, a - i)
|
|
2126
2089
|
}, s = e.inpCandidates.findIndex((e) => e.interactionId === t.interactionId);
|
|
2127
|
-
s >= 0 ? o.duration > e.inpCandidates[s].duration && (e.inpCandidates[s] = o) : e.inpCandidates.push(o), e.inpCandidates.sort((e, t) => t.duration - e.duration).splice(
|
|
2128
|
-
},
|
|
2129
|
-
let t =
|
|
2090
|
+
s >= 0 ? o.duration > e.inpCandidates[s].duration && (e.inpCandidates[s] = o) : e.inpCandidates.push(o), e.inpCandidates.sort((e, t) => t.duration - e.duration).splice(pr);
|
|
2091
|
+
}, Cr = (e) => {
|
|
2092
|
+
let t = br(), n = t !== void 0 && e.interactionCountAtStart !== void 0 ? Math.max(0, t - e.interactionCountAtStart) : e.interactionIdMin === Infinity ? 0 : (e.interactionIdMax - e.interactionIdMin) / 7 + 1;
|
|
2130
2093
|
if (e.inpCandidates.length) return e.inpCandidates[Math.min(e.inpCandidates.length - 1, Math.floor(n / 50))];
|
|
2131
|
-
},
|
|
2094
|
+
}, wr = (e, t) => {
|
|
2132
2095
|
var n;
|
|
2133
2096
|
let r = (n = e.attribution) == null ? {} : n, i = {}, a = (e) => r[e], o = (e, t, n) => {
|
|
2134
2097
|
t != null && (typeof t == "string" || typeof t == "number" || typeof t == "boolean") && (i[e] = typeof t == "string" && n ? n(t) : t);
|
|
2135
2098
|
};
|
|
2136
2099
|
switch (e.name) {
|
|
2137
2100
|
case "LCP":
|
|
2138
|
-
o("vital.lcp.url", a("url"), t), o("vital.lcp.target", a("target")), o("vital.lcp.element_render_delay", a("elementRenderDelay")), o("vital.lcp.resource_load_duration", a("resourceLoadDuration"))
|
|
2101
|
+
o("vital.lcp.url", a("url"), t), o("vital.lcp.target", a("target")), o("vital.lcp.element_render_delay", a("elementRenderDelay")), o("vital.lcp.resource_load_duration", a("resourceLoadDuration"));
|
|
2139
2102
|
break;
|
|
2140
2103
|
case "CLS":
|
|
2141
|
-
o("vital.cls.
|
|
2104
|
+
o("vital.cls.load_state", a("loadState"));
|
|
2142
2105
|
break;
|
|
2143
2106
|
case "INP":
|
|
2144
2107
|
o("vital.inp.interaction_target", a("interactionTarget")), o("vital.inp.interaction_type", a("interactionType")), o("vital.inp.input_delay", a("inputDelay")), o("vital.inp.processing_duration", a("processingDuration")), o("vital.inp.presentation_delay", a("presentationDelay"));
|
|
2145
2108
|
break;
|
|
2146
|
-
case "FCP":
|
|
2147
|
-
o("vital.fcp.time_to_first_byte", a("timeToFirstByte")), o("vital.fcp.load_state", a("loadState"));
|
|
2148
|
-
break;
|
|
2149
2109
|
case "TTFB":
|
|
2150
2110
|
o("vital.ttfb.waiting_duration", a("waitingDuration")), o("vital.ttfb.dns_duration", a("dnsDuration")), o("vital.ttfb.connection_duration", a("connectionDuration")), o("vital.ttfb.request_duration", a("requestDuration"));
|
|
2151
2111
|
break;
|
|
2152
2112
|
default: break;
|
|
2153
2113
|
}
|
|
2154
2114
|
return i;
|
|
2155
|
-
},
|
|
2115
|
+
}, Tr = () => {
|
|
2156
2116
|
let e, t = !1;
|
|
2157
2117
|
return {
|
|
2158
2118
|
name: "web-vitals",
|
|
@@ -2179,9 +2139,8 @@ var Kn = ["stopLoadingTime"], qn = new Set(Object.values(g)), Jn = () => typeof
|
|
|
2179
2139
|
})), {}, {
|
|
2180
2140
|
[g.vitalMetric]: a,
|
|
2181
2141
|
[g.vitalValue]: e.value,
|
|
2182
|
-
[g.vitalRating]: e.rating,
|
|
2183
2142
|
"vital.id": e.id
|
|
2184
|
-
},
|
|
2143
|
+
}, wr(e, n.config.hooks.redactUrl)), {
|
|
2185
2144
|
contextTime: r,
|
|
2186
2145
|
startTime: i
|
|
2187
2146
|
}).end(i);
|
|
@@ -2195,17 +2154,14 @@ var Kn = ["stopLoadingTime"], qn = new Set(Object.values(g)), Jn = () => typeof
|
|
|
2195
2154
|
let e = u;
|
|
2196
2155
|
if (!e || !n.isSampled()) return;
|
|
2197
2156
|
p({
|
|
2198
|
-
attribution: {
|
|
2199
|
-
largestShiftTarget: e.largestShiftTarget,
|
|
2200
|
-
largestShiftValue: e.largestShiftValue
|
|
2201
|
-
},
|
|
2157
|
+
attribution: {},
|
|
2202
2158
|
entries: [],
|
|
2203
2159
|
id: h("vital"),
|
|
2204
2160
|
name: "CLS",
|
|
2205
|
-
rating:
|
|
2161
|
+
rating: vr("CLS", e.cls),
|
|
2206
2162
|
value: e.cls
|
|
2207
2163
|
}, e.runtimeAttributes, e.startedAt);
|
|
2208
|
-
let t =
|
|
2164
|
+
let t = Cr(e);
|
|
2209
2165
|
t && p({
|
|
2210
2166
|
attribution: {
|
|
2211
2167
|
inputDelay: t.inputDelay,
|
|
@@ -2217,13 +2173,13 @@ var Kn = ["stopLoadingTime"], qn = new Set(Object.values(g)), Jn = () => typeof
|
|
|
2217
2173
|
entries: [],
|
|
2218
2174
|
id: h("vital"),
|
|
2219
2175
|
name: "INP",
|
|
2220
|
-
rating:
|
|
2176
|
+
rating: vr("INP", t.duration),
|
|
2221
2177
|
value: t.duration
|
|
2222
2178
|
}, e.runtimeAttributes, e.startedAt);
|
|
2223
2179
|
}, _ = n.onViewChange((e) => {
|
|
2224
2180
|
var t;
|
|
2225
2181
|
let r = u;
|
|
2226
|
-
if (r &&
|
|
2182
|
+
if (r && _r(r.id, e.id)) {
|
|
2227
2183
|
r.runtimeAttributes = S(S(S({}, r.runtimeAttributes), {}, { [g.viewId]: e.id }, e.name ? { [g.viewName]: e.name } : {}), {}, {
|
|
2228
2184
|
[g.viewUrl]: e.url,
|
|
2229
2185
|
[g.viewUrlTemplate]: e.urlTemplate
|
|
@@ -2232,14 +2188,12 @@ var Kn = ["stopLoadingTime"], qn = new Set(Object.values(g)), Jn = () => typeof
|
|
|
2232
2188
|
}
|
|
2233
2189
|
m(), u = e.id ? {
|
|
2234
2190
|
cls: 0,
|
|
2235
|
-
clsWindowLargestShiftValue: 0,
|
|
2236
2191
|
clsWindowValue: 0,
|
|
2237
|
-
interactionCountAtStart:
|
|
2192
|
+
interactionCountAtStart: br(),
|
|
2238
2193
|
interactionIdMax: 0,
|
|
2239
2194
|
interactionIdMin: Infinity,
|
|
2240
2195
|
inpCandidates: [],
|
|
2241
2196
|
id: e.id,
|
|
2242
|
-
largestShiftValue: 0,
|
|
2243
2197
|
runtimeAttributes: n.getRuntimeAttributes(),
|
|
2244
2198
|
startedAt: (t = e.startedAt) == null ? Date.now() : t
|
|
2245
2199
|
} : void 0;
|
|
@@ -2247,12 +2201,12 @@ var Kn = ["stopLoadingTime"], qn = new Set(Object.values(g)), Jn = () => typeof
|
|
|
2247
2201
|
if (typeof PerformanceObserver < "u") {
|
|
2248
2202
|
var v, y;
|
|
2249
2203
|
(v = PerformanceObserver.supportedEntryTypes) != null && v.includes("layout-shift") && (f = new PerformanceObserver((e) => {
|
|
2250
|
-
if (u) for (let t of e.getEntries()) performance.timeOrigin + t.startTime < u.startedAt ||
|
|
2204
|
+
if (u) for (let t of e.getEntries()) performance.timeOrigin + t.startTime < u.startedAt || xr(u, t);
|
|
2251
2205
|
}), f.observe({
|
|
2252
2206
|
buffered: !0,
|
|
2253
2207
|
type: "layout-shift"
|
|
2254
2208
|
})), (y = PerformanceObserver.supportedEntryTypes) != null && y.includes("event") && (d = new PerformanceObserver((e) => {
|
|
2255
|
-
if (u) for (let t of e.getEntries()) performance.timeOrigin + t.startTime < u.startedAt || !t.interactionId || !Number.isFinite(t.duration) ||
|
|
2209
|
+
if (u) for (let t of e.getEntries()) performance.timeOrigin + t.startTime < u.startedAt || !t.interactionId || !Number.isFinite(t.duration) || Sr(u, t);
|
|
2256
2210
|
}), d.observe({
|
|
2257
2211
|
buffered: !0,
|
|
2258
2212
|
durationThreshold: 40,
|
|
@@ -2268,7 +2222,7 @@ var Kn = ["stopLoadingTime"], qn = new Set(Object.values(g)), Jn = () => typeof
|
|
|
2268
2222
|
t = !0, e == null || e(), e = void 0;
|
|
2269
2223
|
}
|
|
2270
2224
|
};
|
|
2271
|
-
},
|
|
2225
|
+
}, Er = (e, t) => {
|
|
2272
2226
|
let n = {
|
|
2273
2227
|
"network.protocol.name": "websocket",
|
|
2274
2228
|
"url.full": t(e)
|
|
@@ -2278,13 +2232,12 @@ var Kn = ["stopLoadingTime"], qn = new Set(Object.values(g)), Jn = () => typeof
|
|
|
2278
2232
|
n["server.address"] = t.hostname, t.port && (n["server.port"] = Number(t.port)), n["url.scheme"] = t.protocol.replace(":", "");
|
|
2279
2233
|
} catch (e) {}
|
|
2280
2234
|
return n;
|
|
2281
|
-
},
|
|
2282
|
-
let a = h("websocket"), o =
|
|
2235
|
+
}, Dr = (t, n, r, i) => {
|
|
2236
|
+
let a = h("websocket"), o = Er(r, n.config.hooks.redactUrl), s = !1, c = (t, r, s = {}) => {
|
|
2283
2237
|
if (i() || !n.isSampled()) return;
|
|
2284
2238
|
let c = t === "error";
|
|
2285
2239
|
n.startSpan("browser.websocket", S(S(S({}, o), M({
|
|
2286
2240
|
outcome: c ? A.error : A.success,
|
|
2287
|
-
outcomeReason: c ? "network" : void 0,
|
|
2288
2241
|
spanType: j.websocket
|
|
2289
2242
|
})), {}, {
|
|
2290
2243
|
[g.websocketPhase]: t,
|
|
@@ -2305,7 +2258,7 @@ var Kn = ["stopLoadingTime"], qn = new Set(Object.values(g)), Jn = () => typeof
|
|
|
2305
2258
|
"websocket.close.was_clean": e.wasClean
|
|
2306
2259
|
});
|
|
2307
2260
|
});
|
|
2308
|
-
},
|
|
2261
|
+
}, Or = () => {
|
|
2309
2262
|
let e, t, n = !1;
|
|
2310
2263
|
return {
|
|
2311
2264
|
name: "websocket",
|
|
@@ -2316,29 +2269,29 @@ var Kn = ["stopLoadingTime"], qn = new Set(Object.values(g)), Jn = () => typeof
|
|
|
2316
2269
|
let a = Reflect.construct(e, t, i);
|
|
2317
2270
|
if (n || !r.isSampled()) return a;
|
|
2318
2271
|
let o = t[0] == null ? "" : String(t[0]);
|
|
2319
|
-
return o && !D(r.config, o) &&
|
|
2272
|
+
return o && !D(r.config, o) && Dr(a, r, o, () => n), a;
|
|
2320
2273
|
} }), window.WebSocket = t;
|
|
2321
2274
|
},
|
|
2322
2275
|
shutdown() {
|
|
2323
2276
|
n = !0, typeof window < "u" && e && window.WebSocket === t && (window.WebSocket = e), t = void 0, e = void 0;
|
|
2324
2277
|
}
|
|
2325
2278
|
};
|
|
2326
|
-
},
|
|
2279
|
+
}, kr = class {
|
|
2327
2280
|
constructor() {
|
|
2328
2281
|
b(this, "listeners", /* @__PURE__ */ new Set()), b(this, "notify", (e) => {
|
|
2329
2282
|
this.listeners.forEach((t) => t(e));
|
|
2330
2283
|
}), b(this, "subscribe", (e) => (this.listeners.add(e), () => this.listeners.delete(e)));
|
|
2331
2284
|
}
|
|
2332
|
-
},
|
|
2285
|
+
}, Ar = (e) => {
|
|
2333
2286
|
let t = 2166136261;
|
|
2334
2287
|
for (let n = 0; n < e.length; n += 1) t = Math.imul(t ^ e.charCodeAt(n), 16777619);
|
|
2335
2288
|
return t += t << 13, t ^= t >>> 7, t += t << 3, t ^= t >>> 17, t += t << 5, (t >>> 0) / 4294967296;
|
|
2336
|
-
},
|
|
2289
|
+
}, jr = ({ application: e, session: t }, n) => t.sampleRate <= 0 ? !1 : t.sampleRate >= 1 ? !0 : Ar(`${e.name}\0${n}`) < t.sampleRate, Mr = (e) => ({
|
|
2337
2290
|
url: e.endpoint,
|
|
2338
2291
|
headers: e.headers,
|
|
2339
2292
|
concurrencyLimit: e.concurrencyLimit,
|
|
2340
2293
|
timeoutMillis: e.timeoutMillis
|
|
2341
|
-
}),
|
|
2294
|
+
}), Nr = "bk-rum", Pr = class {
|
|
2342
2295
|
constructor(e) {
|
|
2343
2296
|
this.isSampled = e;
|
|
2344
2297
|
}
|
|
@@ -2348,7 +2301,7 @@ var Kn = ["stopLoadingTime"], qn = new Set(Object.values(g)), Jn = () => typeof
|
|
|
2348
2301
|
toString() {
|
|
2349
2302
|
return "RumSessionSampler";
|
|
2350
2303
|
}
|
|
2351
|
-
}, Q,
|
|
2304
|
+
}, Q, Fr = () => {
|
|
2352
2305
|
if (Q) Q.users += 1;
|
|
2353
2306
|
else {
|
|
2354
2307
|
let e = new a().enable(), t = r.setGlobalContextManager(e);
|
|
@@ -2363,28 +2316,28 @@ var Kn = ["stopLoadingTime"], qn = new Set(Object.values(g)), Jn = () => typeof
|
|
|
2363
2316
|
return () => {
|
|
2364
2317
|
e || !Q || (e = !0, --Q.users, !(Q.users > 0) && (Q.ownsContext && r.disable(), Q.ownsPropagator && i.disable(), Q = void 0));
|
|
2365
2318
|
};
|
|
2366
|
-
},
|
|
2319
|
+
}, Ir = (e, t) => t ? new Proxy(e, { get(e, t, n) {
|
|
2367
2320
|
if (t === "export") return (t, n) => {
|
|
2368
2321
|
var r;
|
|
2369
2322
|
return (r = globalThis.console) == null || r.log("[bk-ot][rum]", t), e.export(t, n);
|
|
2370
2323
|
};
|
|
2371
2324
|
let r = Reflect.get(e, t, n);
|
|
2372
2325
|
return typeof r == "function" ? r.bind(e) : r;
|
|
2373
|
-
} }) : e,
|
|
2374
|
-
|
|
2326
|
+
} }) : e, Lr = (e) => [En(e.tracking.request)], Rr = (e) => [
|
|
2327
|
+
fr(e.session),
|
|
2375
2328
|
...$(e.tracking.device, !0, ce),
|
|
2376
|
-
|
|
2377
|
-
|
|
2378
|
-
|
|
2379
|
-
],
|
|
2380
|
-
...$(e.error, !0,
|
|
2381
|
-
...$(e.webVitals, !0,
|
|
2329
|
+
_t(),
|
|
2330
|
+
Qn(),
|
|
2331
|
+
cn(zr(e.tracking.resource, !0))
|
|
2332
|
+
], zr = (e, t) => e === void 0 ? t : e !== !1, Br = (e) => typeof e == "object" && e ? e : void 0, $ = (e, t, n) => zr(e, t) ? [n(Br(e))] : [], Vr = (e) => [
|
|
2333
|
+
...$(e.error, !0, Mn),
|
|
2334
|
+
...$(e.webVitals, !0, Tr),
|
|
2382
2335
|
...$(e.blankScreen, !0, Mt),
|
|
2383
|
-
...$(e.action, !0,
|
|
2384
|
-
...$(e.websocket, !1,
|
|
2385
|
-
...$(e.longTask, !1,
|
|
2386
|
-
...$(e.cspViolation, !1,
|
|
2387
|
-
],
|
|
2336
|
+
...$(e.action, !0, mt),
|
|
2337
|
+
...$(e.websocket, !1, Or),
|
|
2338
|
+
...$(e.longTask, !1, Ln),
|
|
2339
|
+
...$(e.cspViolation, !1, kn)
|
|
2340
|
+
], Hr = class {
|
|
2388
2341
|
assertBeforeStart(e) {
|
|
2389
2342
|
if (this.phase !== "idle") throw Error(`[bk-ot] ${e}() must be called before start(); set autoStart: false before registration.`);
|
|
2390
2343
|
}
|
|
@@ -2415,19 +2368,19 @@ var Kn = ["stopLoadingTime"], qn = new Set(Object.values(g)), Jn = () => typeof
|
|
|
2415
2368
|
createPluginManager() {
|
|
2416
2369
|
var e;
|
|
2417
2370
|
return new Fe([
|
|
2418
|
-
...zr(this.config),
|
|
2419
2371
|
...Rr(this.config),
|
|
2420
|
-
...
|
|
2372
|
+
...Lr(this.config),
|
|
2373
|
+
...Vr(this.config.tracking),
|
|
2421
2374
|
...(e = this.config.extensions.plugins) == null ? [] : e
|
|
2422
2375
|
]);
|
|
2423
2376
|
}
|
|
2424
2377
|
constructor(n) {
|
|
2425
2378
|
var r = this;
|
|
2426
|
-
b(this, "activityObserver", new
|
|
2379
|
+
b(this, "activityObserver", new kr()), b(this, "flushProviders", k(function* () {
|
|
2427
2380
|
yield r.tracerProvider.forceFlush();
|
|
2428
2381
|
})), b(this, "phase", "idle"), b(this, "pluginManager", void 0), b(this, "registeredInstrumentations", void 0), b(this, "releaseOtelGlobals", void 0), b(this, "runtimeContext", void 0), b(this, "sampled", !1), b(this, "startCollection", k(function* () {
|
|
2429
2382
|
if (r.pluginManager || !r.config.enabled || r.config.trackingConsent !== "granted") return;
|
|
2430
|
-
r.releaseOtelGlobals =
|
|
2383
|
+
r.releaseOtelGlobals = Fr();
|
|
2431
2384
|
let e = r.createPluginManager();
|
|
2432
2385
|
r.pluginManager = e;
|
|
2433
2386
|
try {
|
|
@@ -2465,9 +2418,8 @@ var Kn = ["stopLoadingTime"], qn = new Set(Object.values(g)), Jn = () => typeof
|
|
|
2465
2418
|
}), b(this, "reportAction", ({ attributes: e = {}, name: t }) => {
|
|
2466
2419
|
if (!this.isSampled()) return;
|
|
2467
2420
|
let n = h("action"), r = Date.now();
|
|
2468
|
-
this.startSpan(
|
|
2421
|
+
this.startSpan(`action.${t}`, S(S(S(S({}, this.config.hooks.getPageAttributes()), e), M({ spanType: j.action })), {}, {
|
|
2469
2422
|
[g.actionId]: n,
|
|
2470
|
-
[g.actionName]: t,
|
|
2471
2423
|
[g.actionType]: "custom"
|
|
2472
2424
|
}), { startTime: r }).end(r);
|
|
2473
2425
|
}), b(this, "reportCustomEvent", ({ attributes: e = {}, error: n, name: r }) => {
|
|
@@ -2490,7 +2442,7 @@ var Kn = ["stopLoadingTime"], qn = new Set(Object.values(g)), Jn = () => typeof
|
|
|
2490
2442
|
let n = S({}, e), r = t == null ? Date.now() : t;
|
|
2491
2443
|
if (g.sessionId in e) {
|
|
2492
2444
|
let t = e[g.sessionId];
|
|
2493
|
-
this.sampled = this.config.enabled && typeof t == "string" && t.length > 0 ?
|
|
2445
|
+
this.sampled = this.config.enabled && typeof t == "string" && t.length > 0 ? jr(this.config, t) : !1, this.runtimeContext.setSessionSampled(this.sampled, r);
|
|
2494
2446
|
}
|
|
2495
2447
|
this.runtimeContext.setAttributes(n, r);
|
|
2496
2448
|
}), b(this, "setTrackingConsent", function() {
|
|
@@ -2568,20 +2520,20 @@ var Kn = ["stopLoadingTime"], qn = new Set(Object.values(g)), Jn = () => typeof
|
|
|
2568
2520
|
}), b(this, "useInstrumentation", (e) => {
|
|
2569
2521
|
var t;
|
|
2570
2522
|
return this.assertBeforeStart("useInstrumentation"), this.config.enabled && ((t = this.config.extensions.instrumentations) == null || t.push(e)), this;
|
|
2571
|
-
}), this.config = je(n), this.runtimeContext = new
|
|
2523
|
+
}), this.config = je(n), this.runtimeContext = new Ke({}, this.config.user);
|
|
2572
2524
|
let i = c(this.config.resourceAttributes), a = (() => {
|
|
2573
|
-
let e =
|
|
2525
|
+
let e = Ir(new s(Mr(this.config.transport)), this.config.debug);
|
|
2574
2526
|
return [new Ue(this.config.spanProcessor === "simple" ? new d(e) : new l(e, this.config.spanBatch), this.config, () => this.applyRedact(S(S({}, this.runtimeContext.getAttributes()), this.config.hooks.getPageAttributes())))];
|
|
2575
2527
|
})();
|
|
2576
2528
|
this.tracerProvider = new f({
|
|
2577
2529
|
resource: i,
|
|
2578
|
-
sampler: new
|
|
2530
|
+
sampler: new Pr(this.isSampled),
|
|
2579
2531
|
spanProcessors: a
|
|
2580
|
-
}), this.tracer = this.tracerProvider.getTracer(
|
|
2532
|
+
}), this.tracer = this.tracerProvider.getTracer(Nr), this.registeredInstrumentations = [], this.config.autoStart && this.start().catch((e) => {
|
|
2581
2533
|
var t;
|
|
2582
2534
|
(t = globalThis.console) == null || t.warn("[bk-ot] auto start failed:", e);
|
|
2583
2535
|
});
|
|
2584
2536
|
}
|
|
2585
2537
|
};
|
|
2586
2538
|
//#endregion
|
|
2587
|
-
export {
|
|
2539
|
+
export { Hr as BkOpenTelemetry, ht as EXCLUDED_ACTIVITY_MUTATIONS_ATTRIBUTE, Ue as FilteringSpanProcessor, g as RUM_ATTRIBUTES, A as RUM_SPAN_OUTCOME, j as RUM_SPAN_TYPE, Ke as RumRuntimeContext, M as buildRumSpanAttributes, mt as createActionPlugin, Mt as createBlankScreenPlugin, En as createCommonInstrumentationsPlugin, kn as createCspViolationPlugin, ce as createDevicePlugin, Mn as createErrorPlugin, Ln as createLongTaskPlugin, Pe as createPlugin, cn as createResourcePlugin, fr as createSessionPlugin, Or as createWebSocketPlugin, Tr as createWebVitalsPlugin, je as resolveConfig };
|