@blueking/open-telemetry 0.0.29 → 0.0.30
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 +393 -452
- 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 +2 -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/span-protocol.md +503 -0
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.30", 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,8 @@ 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
|
+
viewReferrer: "view.referrer",
|
|
62
56
|
viewStartedAt: "view.started_at",
|
|
63
57
|
viewUrl: "view.url",
|
|
64
58
|
viewUrlTemplate: "view.url_template",
|
|
@@ -179,7 +173,6 @@ var C = "BK_RUM_DEVICE_ID", w = 250, T = () => navigator.connection, ee = () =>
|
|
|
179
173
|
if (typeof navigator > "u") return {};
|
|
180
174
|
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
175
|
return {
|
|
182
|
-
[g.deviceMemoryGib]: navigator.deviceMemory,
|
|
183
176
|
[g.deviceType]: i,
|
|
184
177
|
[g.userAgentName]: n.name,
|
|
185
178
|
[g.userAgentVersion]: n.version,
|
|
@@ -230,22 +223,22 @@ var C = "BK_RUM_DEVICE_ID", w = 250, T = () => navigator.connection, ee = () =>
|
|
|
230
223
|
}, ue = /^(?:\d+|[0-9a-f]{8}-[0-9a-f-]{27,}|[0-9a-f]{16,})$/i, de = (e) => e.split(/[?#]/, 1)[0].split("/").map((e) => ue.test(e) ? ":id" : e).join("/"), fe = (e) => e.length > 1 ? e.replace(/\/+$/, "") : e, pe = (e, t) => {
|
|
231
224
|
let n = (e) => fe(e.replace(/[?#].*$/, ""));
|
|
232
225
|
return n(e) === n(t);
|
|
233
|
-
}, me = (e, t) => pe(E(t), E(e.transport.endpoint)),
|
|
226
|
+
}, me = (e, t) => pe(E(t), E(e.transport.endpoint)), he = (e, t) => me(e, t), ge = (e, t) => typeof e == "function" ? e(t) : typeof e == "string" ? t.includes(e) : (e.lastIndex = 0, e.test(t)), D = (e, t) => (Array.isArray(e) ? e : e ? [e] : []).some((e) => ge(e, t)), _e = (e) => typeof e.tracking.request == "object" ? e.tracking.request : void 0, ve = (e, t) => {
|
|
234
227
|
var n;
|
|
235
|
-
return
|
|
236
|
-
},
|
|
228
|
+
return he(e, t) || D((n = _e(e)) == null ? void 0 : n.excludedUrls, E(t));
|
|
229
|
+
}, ye = (e, t) => {
|
|
237
230
|
var n;
|
|
238
|
-
return
|
|
239
|
-
},
|
|
231
|
+
return D((n = _e(e)) == null ? void 0 : n.allowedTracingUrls, E(t));
|
|
232
|
+
}, be = (e) => e.trim().replace(/\/+$/, ""), xe = (e) => {
|
|
240
233
|
var t;
|
|
241
234
|
let n = e.token || e.headers ? S(S({}, e.token ? { Authorization: `Bearer ${e.token}` } : {}), (t = e.headers) == null ? {} : t) : void 0;
|
|
242
235
|
return {
|
|
243
236
|
concurrencyLimit: e.concurrencyLimit,
|
|
244
|
-
endpoint: `${
|
|
237
|
+
endpoint: `${be(e.endpoint)}/v1/rum`,
|
|
245
238
|
headers: n,
|
|
246
239
|
timeoutMillis: e.timeoutMillis
|
|
247
240
|
};
|
|
248
|
-
},
|
|
241
|
+
}, Se = (e) => typeof e != "number" || !Number.isFinite(e) ? 1 : Math.max(0, Math.min(1, e)), Ce = (e) => e, we = (e) => {
|
|
249
242
|
if (!e) return e;
|
|
250
243
|
try {
|
|
251
244
|
let t = new URL(e, typeof location > "u" ? "http://localhost" : location.href);
|
|
@@ -253,13 +246,13 @@ var C = "BK_RUM_DEVICE_ID", w = 250, T = () => navigator.connection, ee = () =>
|
|
|
253
246
|
} catch (t) {
|
|
254
247
|
return e.replace(/[?#].*$/, "");
|
|
255
248
|
}
|
|
256
|
-
},
|
|
249
|
+
}, Te = (e) => {
|
|
257
250
|
try {
|
|
258
251
|
return new URL(e, typeof location > "u" ? "http://localhost" : location.href).pathname || "/";
|
|
259
252
|
} catch (t) {
|
|
260
253
|
return e || "/";
|
|
261
254
|
}
|
|
262
|
-
},
|
|
255
|
+
}, Ee = (e) => de(Te(e)), De = (e, t) => (n) => {
|
|
263
256
|
try {
|
|
264
257
|
let e = t == null ? void 0 : t(n);
|
|
265
258
|
if (e) return e;
|
|
@@ -267,40 +260,40 @@ var C = "BK_RUM_DEVICE_ID", w = 250, T = () => navigator.connection, ee = () =>
|
|
|
267
260
|
var r;
|
|
268
261
|
e.debug && ((r = globalThis.console) == null || r.warn("[bk-ot] url template hook failed:", t));
|
|
269
262
|
}
|
|
270
|
-
return
|
|
271
|
-
},
|
|
263
|
+
return Ee(n);
|
|
264
|
+
}, Oe = (e) => {
|
|
272
265
|
var t;
|
|
273
266
|
return {
|
|
274
267
|
environment: (t = e.environment) == null ? "production" : t,
|
|
275
268
|
name: e.name,
|
|
276
269
|
version: e.version
|
|
277
270
|
};
|
|
278
|
-
},
|
|
271
|
+
}, ke = (e, t, n) => S(S(S({ [g.deploymentEnvironmentName]: e.environment }, t === !1 ? {} : oe()), {}, { [g.serviceName]: e.name }, e.version ? { [g.serviceVersion]: e.version } : {}), {}, {
|
|
279
272
|
[g.sessionSampleRate]: n,
|
|
280
273
|
"telemetry.sdk.language": "webjs",
|
|
281
|
-
"telemetry.sdk.name": "
|
|
274
|
+
"telemetry.sdk.name": "blueking",
|
|
282
275
|
"telemetry.sdk.version": p
|
|
283
|
-
}),
|
|
276
|
+
}), Ae = (e) => {
|
|
284
277
|
var t;
|
|
285
278
|
if (!e) throw Error("[bk-ot] transport is required.");
|
|
286
279
|
if (!((t = e.endpoint) != null && t.trim())) throw Error("[bk-ot] transport.endpoint is required.");
|
|
287
|
-
},
|
|
280
|
+
}, je = (e) => {
|
|
288
281
|
var t, n, r, i, a, o, s, c, l, u, d, f, p;
|
|
289
282
|
return {
|
|
290
283
|
beforeSend: (t = e.tracking) == null ? void 0 : t.beforeSend,
|
|
291
284
|
getPageAttributes: (n = (r = e.context) == null || (r = r.attributes) == null ? void 0 : r.page) == null ? (() => ({})) : n,
|
|
292
285
|
getErrorAttributes: (i = (a = e.context) == null || (a = a.attributes) == null ? void 0 : a.error) == null ? (() => ({})) : i,
|
|
293
286
|
getCustomAttributes: (o = (s = e.context) == null || (s = s.attributes) == null ? void 0 : s.custom) == null ? (() => ({})) : o,
|
|
294
|
-
getRequestUrlTemplate:
|
|
295
|
-
getViewUrlTemplate:
|
|
296
|
-
redactAttributes: (u = (d = e.privacy) == null ? void 0 : d.redactAttributes) == null ?
|
|
297
|
-
redactUrl: (f = (p = e.privacy) == null ? void 0 : p.redactUrl) == null ?
|
|
287
|
+
getRequestUrlTemplate: De(e, typeof ((c = e.tracking) == null ? void 0 : c.request) == "object" ? e.tracking.request.getUrlTemplate : void 0),
|
|
288
|
+
getViewUrlTemplate: De(e, typeof ((l = e.tracking) == null ? void 0 : l.view) == "object" ? e.tracking.view.getUrlTemplate : void 0),
|
|
289
|
+
redactAttributes: (u = (d = e.privacy) == null ? void 0 : d.redactAttributes) == null ? Ce : u,
|
|
290
|
+
redactUrl: (f = (p = e.privacy) == null ? void 0 : p.redactUrl) == null ? we : f
|
|
298
291
|
};
|
|
299
|
-
},
|
|
292
|
+
}, Me = (e) => {
|
|
300
293
|
var t, n, r, i, a, o, s, c, l, u, d, f, p, m, h, g;
|
|
301
294
|
if (!(!((t = e.application) == null || (t = t.name) == null) && t.trim())) throw Error("[bk-ot] application.name is required.");
|
|
302
|
-
|
|
303
|
-
let _ =
|
|
295
|
+
Ae(e.transport);
|
|
296
|
+
let _ = Oe(e.application), v = typeof ((n = e.tracking) == null ? void 0 : n.view) == "object" ? e.tracking.view : void 0, y = je(e), b = Se((r = e.session) == null ? void 0 : r.sampleRate);
|
|
304
297
|
return {
|
|
305
298
|
application: _,
|
|
306
299
|
autoStart: (i = e.autoStart) == null ? !0 : i,
|
|
@@ -311,13 +304,13 @@ var C = "BK_RUM_DEVICE_ID", w = 250, T = () => navigator.connection, ee = () =>
|
|
|
311
304
|
plugins: [...(l = (u = e.extensions) == null ? void 0 : u.plugins) == null ? [] : l]
|
|
312
305
|
},
|
|
313
306
|
hooks: y,
|
|
314
|
-
resourceAttributes: y.redactAttributes(
|
|
307
|
+
resourceAttributes: y.redactAttributes(ke(_, (d = e.tracking) == null ? void 0 : d.device, b)),
|
|
315
308
|
session: S(S({}, e.session), {}, { sampleRate: b }),
|
|
316
309
|
spanBatch: e.transport.batch,
|
|
317
310
|
spanProcessor: (f = e.transport.processor) == null ? "batch" : f,
|
|
318
311
|
tracking: (p = e.tracking) == null ? {} : p,
|
|
319
312
|
trackingConsent: (m = (h = e.privacy) == null ? void 0 : h.trackingConsent) == null ? "granted" : m,
|
|
320
|
-
transport:
|
|
313
|
+
transport: xe(e.transport),
|
|
321
314
|
user: (g = e.context) == null ? void 0 : g.user,
|
|
322
315
|
view: {
|
|
323
316
|
excludedActivityUrls: v == null ? void 0 : v.excludedActivityUrls,
|
|
@@ -328,7 +321,7 @@ var C = "BK_RUM_DEVICE_ID", w = 250, T = () => navigator.connection, ee = () =>
|
|
|
328
321
|
};
|
|
329
322
|
//#endregion
|
|
330
323
|
//#region \0@oxc-project+runtime@0.128.0/helpers/asyncToGenerator.js
|
|
331
|
-
function
|
|
324
|
+
function Ne(e, t, n, r, i, a, o) {
|
|
332
325
|
try {
|
|
333
326
|
var s = e[a](o), c = s.value;
|
|
334
327
|
} catch (e) {
|
|
@@ -337,16 +330,16 @@ function Me(e, t, n, r, i, a, o) {
|
|
|
337
330
|
}
|
|
338
331
|
s.done ? t(c) : Promise.resolve(c).then(r, i);
|
|
339
332
|
}
|
|
340
|
-
function
|
|
333
|
+
function O(e) {
|
|
341
334
|
return function() {
|
|
342
335
|
var t = this, n = arguments;
|
|
343
336
|
return new Promise(function(r, i) {
|
|
344
337
|
var a = e.apply(t, n);
|
|
345
338
|
function o(e) {
|
|
346
|
-
|
|
339
|
+
Ne(a, r, i, o, s, "next", e);
|
|
347
340
|
}
|
|
348
341
|
function s(e) {
|
|
349
|
-
|
|
342
|
+
Ne(a, r, i, o, s, "throw", e);
|
|
350
343
|
}
|
|
351
344
|
o(void 0);
|
|
352
345
|
});
|
|
@@ -354,13 +347,13 @@ function k(e) {
|
|
|
354
347
|
}
|
|
355
348
|
//#endregion
|
|
356
349
|
//#region src/core/plugin.ts
|
|
357
|
-
var
|
|
350
|
+
var Pe = (e, t) => typeof e.enabled == "function" ? e.enabled(t) : e.enabled !== !1, Fe = (e) => e, Ie = class {
|
|
358
351
|
constructor(e) {
|
|
359
352
|
b(this, "plugins", void 0), b(this, "startedPlugins", []), this.plugins = e;
|
|
360
353
|
}
|
|
361
354
|
flush() {
|
|
362
355
|
var e = this;
|
|
363
|
-
return
|
|
356
|
+
return O(function* () {
|
|
364
357
|
yield Promise.all(e.startedPlugins.map((e) => Promise.resolve().then(() => {
|
|
365
358
|
var t;
|
|
366
359
|
return (t = e.flush) == null ? void 0 : t.call(e);
|
|
@@ -369,7 +362,7 @@ var Ne = (e, t) => typeof e.enabled == "function" ? e.enabled(t) : e.enabled !==
|
|
|
369
362
|
}
|
|
370
363
|
shutdown() {
|
|
371
364
|
var e = this;
|
|
372
|
-
return
|
|
365
|
+
return O(function* () {
|
|
373
366
|
let t = [...e.startedPlugins].reverse();
|
|
374
367
|
for (let e of t) {
|
|
375
368
|
var n;
|
|
@@ -380,8 +373,8 @@ var Ne = (e, t) => typeof e.enabled == "function" ? e.enabled(t) : e.enabled !==
|
|
|
380
373
|
}
|
|
381
374
|
start(e) {
|
|
382
375
|
var t = this;
|
|
383
|
-
return
|
|
384
|
-
for (let r of t.plugins) if (
|
|
376
|
+
return O(function* () {
|
|
377
|
+
for (let r of t.plugins) if (Pe(r, e.config)) try {
|
|
385
378
|
yield r.init(e), t.startedPlugins.push(r);
|
|
386
379
|
} catch (t) {
|
|
387
380
|
if (e.config.debug) {
|
|
@@ -391,21 +384,21 @@ var Ne = (e, t) => typeof e.enabled == "function" ? e.enabled(t) : e.enabled !==
|
|
|
391
384
|
}
|
|
392
385
|
})();
|
|
393
386
|
}
|
|
394
|
-
},
|
|
395
|
-
|
|
396
|
-
},
|
|
397
|
-
for (let n of
|
|
387
|
+
}, Le = ["http.url", "url.full"], Re = /* @__PURE__ */ new WeakSet(), ze = (e) => {
|
|
388
|
+
Re.add(e);
|
|
389
|
+
}, Be = (e) => {
|
|
390
|
+
for (let n of Le) {
|
|
398
391
|
var t;
|
|
399
392
|
let r = (t = e.attributes) == null ? void 0 : t[n];
|
|
400
393
|
if (typeof r == "string") return r;
|
|
401
394
|
}
|
|
402
|
-
},
|
|
395
|
+
}, Ve = (e) => {
|
|
403
396
|
let t = e == null ? void 0 : e[g.sessionId];
|
|
404
397
|
return typeof t == "string" && t.length > 0;
|
|
405
|
-
},
|
|
398
|
+
}, He = (e) => {
|
|
406
399
|
let t = e == null ? void 0 : e[g.viewId];
|
|
407
400
|
return typeof t == "string" && t.length > 0;
|
|
408
|
-
},
|
|
401
|
+
}, Ue = (e) => Ve(e) && He(e), We = class {
|
|
409
402
|
constructor(e, t, n) {
|
|
410
403
|
this.inner = e, this.config = t, this.getRuntimeAttributes = n;
|
|
411
404
|
}
|
|
@@ -413,8 +406,8 @@ var Ne = (e, t) => typeof e.enabled == "function" ? e.enabled(t) : e.enabled !==
|
|
|
413
406
|
return this.inner.forceFlush();
|
|
414
407
|
}
|
|
415
408
|
onEnd(e) {
|
|
416
|
-
let t =
|
|
417
|
-
if (!(
|
|
409
|
+
let t = Be(e);
|
|
410
|
+
if (!(Re.delete(e) || t && me(this.config, t) || !Ue(e.attributes) && !(e.name === "browser.session" && Ve(e.attributes)))) {
|
|
418
411
|
try {
|
|
419
412
|
var n, r;
|
|
420
413
|
if (((n = this.config.hooks) == null || (r = n.beforeSend) == null ? void 0 : r.call(n, {
|
|
@@ -438,7 +431,7 @@ var Ne = (e, t) => typeof e.enabled == "function" ? e.enabled(t) : e.enabled !==
|
|
|
438
431
|
shutdown() {
|
|
439
432
|
return this.inner.shutdown();
|
|
440
433
|
}
|
|
441
|
-
},
|
|
434
|
+
}, Ge = new Set(Object.values(g)), Ke = class {
|
|
442
435
|
constructor(e = {}, t) {
|
|
443
436
|
b(this, "actionHistory", []), b(this, "attributes", {}), b(this, "queuedViewCommands", []), b(this, "recordAssociation", (e, t, n, r) => {
|
|
444
437
|
let i = e.at(-1);
|
|
@@ -513,7 +506,7 @@ var Ne = (e, t) => typeof e.enabled == "function" ? e.enabled(t) : e.enabled !==
|
|
|
513
506
|
var n;
|
|
514
507
|
this.viewAttributeKeys.forEach((e) => delete this.attributes[e]), this.viewAttributeKeys.clear();
|
|
515
508
|
let r = {};
|
|
516
|
-
for (let [t, i] of Object.entries((n = e.attributes) == null ? {} : n)) i === void 0 ||
|
|
509
|
+
for (let [t, i] of Object.entries((n = e.attributes) == null ? {} : n)) i === void 0 || Ge.has(t) || (r[t] = i, this.attributes[t] = i, this.viewAttributeKeys.add(t), this.viewScopedAttributeKeys.add(t));
|
|
517
510
|
this.view = S(S({}, e), {}, { attributes: r }), this.setOptionalAttribute(g.viewId, e.id), this.setOptionalAttribute(g.viewUrl, e.url), this.setOptionalAttribute(g.viewUrlTemplate, e.urlTemplate), this.setOptionalAttribute(g.viewLoadingType, e.loadingType), this.setOptionalAttribute(g.viewName, e.name), [
|
|
518
511
|
g.viewId,
|
|
519
512
|
g.viewUrl,
|
|
@@ -523,13 +516,13 @@ var Ne = (e, t) => typeof e.enabled == "function" ? e.enabled(t) : e.enabled !==
|
|
|
523
516
|
].forEach((e) => this.viewScopedAttributeKeys.add(e)), this.recordAssociation(this.viewHistory, this.viewScopedAttributeKeys, t, typeof e.id == "string" && e.id.length > 0), this.viewChangeListeners.forEach((e) => e(this.getView()));
|
|
524
517
|
}), this.setAttributes(e), t && this.setUser(t);
|
|
525
518
|
}
|
|
526
|
-
},
|
|
519
|
+
}, k = {
|
|
527
520
|
abort: "abort",
|
|
528
521
|
error: "error",
|
|
529
522
|
success: "success",
|
|
530
523
|
timeout: "timeout",
|
|
531
524
|
warning: "warning"
|
|
532
|
-
},
|
|
525
|
+
}, A = {
|
|
533
526
|
action: "action",
|
|
534
527
|
custom: "custom",
|
|
535
528
|
error: "error",
|
|
@@ -539,10 +532,7 @@ var Ne = (e, t) => typeof e.enabled == "function" ? e.enabled(t) : e.enabled !==
|
|
|
539
532
|
vital: "vital",
|
|
540
533
|
view: "view",
|
|
541
534
|
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) => {
|
|
535
|
+
}, qe = (e) => e === 408 || e === 504 ? k.timeout : typeof e == "number" && e >= 400 ? k.error : k.success, Je = (e) => e === "good" ? k.success : k.warning, Ye = (e) => {
|
|
546
536
|
if (!e) return {};
|
|
547
537
|
try {
|
|
548
538
|
let t = new URL(e, typeof location > "u" ? "http://localhost" : location.href);
|
|
@@ -553,17 +543,16 @@ var Ne = (e, t) => typeof e.enabled == "function" ? e.enabled(t) : e.enabled !==
|
|
|
553
543
|
} catch (e) {
|
|
554
544
|
return {};
|
|
555
545
|
}
|
|
556
|
-
},
|
|
557
|
-
[g.spanType]:
|
|
546
|
+
}, j = ({ outcome: e = k.success, spanType: t }) => ({
|
|
547
|
+
[g.spanType]: t,
|
|
558
548
|
[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" ?
|
|
561
|
-
return S(S(S(S(S({},
|
|
549
|
+
}), Xe = ({ initiatorType: e = "other", method: t, outcome: n, url: r }) => {
|
|
550
|
+
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" ? k.abort : (n == null ? void 0 : n.type) === "timeout" ? k.timeout : (n == null ? void 0 : n.type) === "network_error" ? k.error : typeof a == "number" ? qe(a) : k.success, s = t == null ? void 0 : t.toUpperCase();
|
|
551
|
+
return S(S(S(S(S({}, j({
|
|
562
552
|
outcome: o,
|
|
563
|
-
|
|
564
|
-
|
|
565
|
-
|
|
566
|
-
}, Ze = 100, Qe = 100, $e = 1e3, et = 100, tt = 1e4, nt = "data-bk-action-name", rt = 100, it = 10, N = (e) => e.replace(/\s+/g, " ").trim().slice(0, rt), P = (e) => {
|
|
553
|
+
spanType: A.resource
|
|
554
|
+
})), 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 } : {});
|
|
555
|
+
}, Ze = 100, Qe = 100, $e = 1e3, et = 100, tt = 1e4, nt = "data-bk-action-name", rt = 100, it = 10, M = (e) => e.replace(/\s+/g, " ").trim().slice(0, rt), N = (e) => {
|
|
567
556
|
var t;
|
|
568
557
|
if (e.parentElement) return e.parentElement;
|
|
569
558
|
let n = (t = e.getRootNode) == null ? void 0 : t.call(e);
|
|
@@ -572,12 +561,12 @@ var Ne = (e, t) => typeof e.enabled == "function" ? e.enabled(t) : e.enabled !==
|
|
|
572
561
|
let n = e;
|
|
573
562
|
for (; n;) {
|
|
574
563
|
let e = n.getAttribute(t);
|
|
575
|
-
if (e) return
|
|
576
|
-
n =
|
|
564
|
+
if (e) return M(e);
|
|
565
|
+
n = N(n);
|
|
577
566
|
}
|
|
578
567
|
}, ot = (e) => {
|
|
579
568
|
var t;
|
|
580
|
-
return e.isContentEditable ? "" :
|
|
569
|
+
return e.isContentEditable ? "" : M((t = e.textContent) == null ? "" : t);
|
|
581
570
|
}, st = (e) => {
|
|
582
571
|
var t, n;
|
|
583
572
|
let r = e, i = (t = r.labels) == null ? void 0 : t[0];
|
|
@@ -592,7 +581,7 @@ var Ne = (e, t) => typeof e.enabled == "function" ? e.enabled(t) : e.enabled !==
|
|
|
592
581
|
"submit"
|
|
593
582
|
].includes(o == null ? "" : o)) {
|
|
594
583
|
var s;
|
|
595
|
-
let e =
|
|
584
|
+
let e = M((s = r.value) == null ? "" : s);
|
|
596
585
|
if (e) return e;
|
|
597
586
|
}
|
|
598
587
|
if (a === "button" || a === "label" || e.getAttribute("role") === "button") {
|
|
@@ -607,7 +596,7 @@ var Ne = (e, t) => typeof e.enabled == "function" ? e.enabled(t) : e.enabled !==
|
|
|
607
596
|
"placeholder"
|
|
608
597
|
]) {
|
|
609
598
|
var c;
|
|
610
|
-
let n =
|
|
599
|
+
let n = M((c = e.getAttribute(t)) == null ? "" : c);
|
|
611
600
|
if (n) return n;
|
|
612
601
|
}
|
|
613
602
|
}, ct = (e, t = nt, n = !1) => {
|
|
@@ -621,7 +610,7 @@ var Ne = (e, t) => typeof e.enabled == "function" ? e.enabled(t) : e.enabled !==
|
|
|
621
610
|
let t = st(i);
|
|
622
611
|
if (t) return t;
|
|
623
612
|
if (e === "form") break;
|
|
624
|
-
i =
|
|
613
|
+
i = N(i), a += 1;
|
|
625
614
|
}
|
|
626
615
|
for (i = e, a = 0; i && a <= it;) {
|
|
627
616
|
let e = i.tagName.toLowerCase();
|
|
@@ -629,7 +618,7 @@ var Ne = (e, t) => typeof e.enabled == "function" ? e.enabled(t) : e.enabled !==
|
|
|
629
618
|
let t = ot(i);
|
|
630
619
|
if (t) return t;
|
|
631
620
|
if (e === "form") break;
|
|
632
|
-
i =
|
|
621
|
+
i = N(i), a += 1;
|
|
633
622
|
}
|
|
634
623
|
return e.tagName.toLowerCase();
|
|
635
624
|
}, lt = (e) => {
|
|
@@ -659,7 +648,7 @@ var Ne = (e, t) => typeof e.enabled == "function" ? e.enabled(t) : e.enabled !==
|
|
|
659
648
|
"submit"
|
|
660
649
|
].includes((r = (i = t.getAttribute("type")) == null ? void 0 : i.toLowerCase()) == null ? "text" : r);
|
|
661
650
|
}
|
|
662
|
-
t =
|
|
651
|
+
t = N(t);
|
|
663
652
|
}
|
|
664
653
|
return !1;
|
|
665
654
|
}, pt = (e = {}) => {
|
|
@@ -672,17 +661,16 @@ var Ne = (e, t) => typeof e.enabled == "function" ? e.enabled(t) : e.enabled !==
|
|
|
672
661
|
"rage_click",
|
|
673
662
|
"dead_click",
|
|
674
663
|
"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:
|
|
678
|
-
spanType:
|
|
664
|
+
].filter((t) => e.frustrations.has(t)), { endTime: n, hasLoadingTime: i } = e.completed, a = e.hadError || t.length > 0;
|
|
665
|
+
s.startSpan("action.click", S(S(S(S({}, s.config.hooks.getPageAttributes()), j({
|
|
666
|
+
outcome: a ? k.warning : k.success,
|
|
667
|
+
spanType: A.action
|
|
679
668
|
})), e.runtimeAttributes), {}, {
|
|
680
669
|
[g.actionId]: e.id,
|
|
681
670
|
[g.actionType]: "click",
|
|
682
|
-
[g.actionName]: `Click on ${e.targetName}`,
|
|
683
671
|
[g.actionTargetName]: e.targetName,
|
|
684
672
|
[g.actionTargetTag]: e.targetTag
|
|
685
|
-
}, t.length ? { [g.actionFrustrationType]: t } : {}),
|
|
673
|
+
}, t.length ? { [g.actionFrustrationType]: t } : {}), { startTime: e.startTime }).end(i ? n : e.startTime);
|
|
686
674
|
}, d = (e, t, i) => {
|
|
687
675
|
if (!n.delete(e.id) || !s) return;
|
|
688
676
|
clearTimeout(e.validationTimer), clearTimeout(e.quietTimer), clearTimeout(e.maxDurationTimer), c(), e.completed = {
|
|
@@ -703,7 +691,7 @@ var Ne = (e, t) => typeof e.enabled == "function" ? e.enabled(t) : e.enabled !==
|
|
|
703
691
|
for (let i of n.values()) {
|
|
704
692
|
if (e.type === "request_start") {
|
|
705
693
|
var t;
|
|
706
|
-
if (e.url &&
|
|
694
|
+
if (e.url && D(s == null || (t = s.config.view) == null ? void 0 : t.excludedActivityUrls, e.url) || !_(i, e.time)) continue;
|
|
707
695
|
i.pendingRequests.add(e.id), m(i, e.time);
|
|
708
696
|
continue;
|
|
709
697
|
}
|
|
@@ -714,7 +702,7 @@ var Ne = (e, t) => typeof e.enabled == "function" ? e.enabled(t) : e.enabled !==
|
|
|
714
702
|
}
|
|
715
703
|
if (e.type === "long_task" || e.type === "resource") {
|
|
716
704
|
var r;
|
|
717
|
-
if (e.type === "resource" && e.url &&
|
|
705
|
+
if (e.type === "resource" && e.url && D(s == null || (r = s.config.view) == null ? void 0 : r.excludedActivityUrls, e.url) || e.startTime > i.startTime + a || (e.type === "resource" ? e.startTime < i.startTime : e.endTime < i.startTime)) continue;
|
|
718
706
|
m(i, e.endTime);
|
|
719
707
|
continue;
|
|
720
708
|
}
|
|
@@ -836,7 +824,7 @@ var Ne = (e, t) => typeof e.enabled == "function" ? e.enabled(t) : e.enabled !==
|
|
|
836
824
|
for (e == null || e.disconnect(), e = void 0; t.length;) (n = t.pop()) == null || n();
|
|
837
825
|
}
|
|
838
826
|
};
|
|
839
|
-
}, _t = (e, t) => !!(t &&
|
|
827
|
+
}, _t = (e, t) => !!(t && D(e.config.view.excludedActivityUrls, t)), vt = (e, t, n) => {
|
|
840
828
|
let r = /* @__PURE__ */ new Set(), i = !1, a = !1, o = t, s, c = (e) => {
|
|
841
829
|
i || (i = !0, clearTimeout(f), clearTimeout(s), d(), n(e));
|
|
842
830
|
}, l = () => {
|
|
@@ -889,46 +877,40 @@ var Ne = (e, t) => typeof e.enabled == "function" ? e.enabled(t) : e.enabled !==
|
|
|
889
877
|
[.2, .8],
|
|
890
878
|
[.5, .8],
|
|
891
879
|
[.8, .8]
|
|
892
|
-
], Tt = (e, t) => typeof e == "number" && Number.isFinite(e) && e >= 0 ? e : t, Et = (e, t) => typeof e == "number" && Number.isFinite(e) ? Math.max(0, Math.min(1, e)) : t, Dt = (e) => {
|
|
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) => {
|
|
880
|
+
], Tt = (e, t) => typeof e == "number" && Number.isFinite(e) && e >= 0 ? e : t, Et = (e, t) => typeof e == "number" && Number.isFinite(e) ? Math.max(0, Math.min(1, e)) : t, Dt = (e, t) => t.some((t) => {
|
|
897
881
|
try {
|
|
898
882
|
return e.matches(t) || !!e.closest(t);
|
|
899
883
|
} catch (e) {
|
|
900
884
|
return !1;
|
|
901
885
|
}
|
|
902
|
-
}),
|
|
886
|
+
}), Ot = (e) => {
|
|
903
887
|
if (typeof getComputedStyle != "function") return !0;
|
|
904
888
|
let t = getComputedStyle(e);
|
|
905
889
|
return t.display !== "none" && t.visibility !== "hidden" && Number(t.opacity || 1) > 0;
|
|
906
|
-
},
|
|
890
|
+
}, kt = (e, t) => {
|
|
907
891
|
if (typeof document.elementsFromPoint == "function") return document.elementsFromPoint(e, t);
|
|
908
892
|
let n = document.elementFromPoint(e, t);
|
|
909
893
|
return n ? [n] : [];
|
|
910
|
-
},
|
|
894
|
+
}, At = (e, t) => {
|
|
911
895
|
var n;
|
|
912
|
-
let r = document.querySelector(e), i = (n = r == null ? document.body : r) == null ? document.documentElement : n, a =
|
|
896
|
+
let r = document.querySelector(e), i = (n = r == null ? document.body : r) == null ? document.documentElement : n, a = 0, o = 0;
|
|
913
897
|
for (let [e, n] of wt) {
|
|
914
|
-
let r =
|
|
915
|
-
if (
|
|
916
|
-
|
|
898
|
+
let r = kt(window.innerWidth * e, window.innerHeight * n);
|
|
899
|
+
if (r.some((e) => Dt(e, t))) {
|
|
900
|
+
o += 1;
|
|
917
901
|
continue;
|
|
918
902
|
}
|
|
919
|
-
r.some((e) => e !== i && e !== document.body && e !== document.documentElement && i.contains(e) &&
|
|
903
|
+
r.some((e) => e !== i && e !== document.body && e !== document.documentElement && i.contains(e) && Ot(e)) || (a += 1);
|
|
920
904
|
}
|
|
921
|
-
let
|
|
905
|
+
let s = wt.length - o;
|
|
922
906
|
return {
|
|
923
|
-
|
|
924
|
-
|
|
925
|
-
|
|
926
|
-
|
|
927
|
-
|
|
928
|
-
score: l ? o / l : 0,
|
|
929
|
-
validCount: l
|
|
907
|
+
emptyCount: a,
|
|
908
|
+
ignoredCount: o,
|
|
909
|
+
reason: r ? "empty_viewport" : "missing_root",
|
|
910
|
+
score: s ? a / s : 0,
|
|
911
|
+
validCount: s
|
|
930
912
|
};
|
|
931
|
-
},
|
|
913
|
+
}, jt = (e = {}) => {
|
|
932
914
|
var t;
|
|
933
915
|
let n = Tt(e.checkDelay, yt), r = Tt(e.confirmationDelay, bt), i = e.rootSelector || xt, a = Et(e.threshold, St), o = [...Ct, ...(t = e.ignoreSelectors) == null ? [] : t], s, c, l, u, d = () => {}, f;
|
|
934
916
|
return {
|
|
@@ -941,26 +923,19 @@ var Ne = (e, t) => typeof e.enabled == "function" ? e.enabled(t) : e.enabled !==
|
|
|
941
923
|
if (s !== t || c === t || !e.isSampled()) return;
|
|
942
924
|
c = t;
|
|
943
925
|
let r = Date.now();
|
|
944
|
-
e.startSpan("browser.blank_screen", S(S({},
|
|
945
|
-
outcome:
|
|
946
|
-
|
|
947
|
-
spanType: j.error
|
|
926
|
+
e.startSpan("browser.blank_screen", S(S({}, j({
|
|
927
|
+
outcome: k.error,
|
|
928
|
+
spanType: A.error
|
|
948
929
|
})), {}, {
|
|
949
|
-
"blank_screen.center_element": n.centerElement,
|
|
950
930
|
"blank_screen.empty_ratio": n.score,
|
|
951
931
|
"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
|
|
932
|
+
"blank_screen.reason": n.reason
|
|
958
933
|
}), { startTime: r }).end(r);
|
|
959
934
|
}, m = (t) => {
|
|
960
935
|
if (s !== t || c === t || document.visibilityState === "hidden") return;
|
|
961
936
|
let n;
|
|
962
937
|
try {
|
|
963
|
-
n =
|
|
938
|
+
n = At(i, o);
|
|
964
939
|
} catch (t) {
|
|
965
940
|
var l;
|
|
966
941
|
e.config.debug && ((l = globalThis.console) == null || l.warn("[bk-ot][blank-screen] detection failed:", t));
|
|
@@ -970,7 +945,7 @@ var Ne = (e, t) => typeof e.enabled == "function" ? e.enabled(t) : e.enabled !==
|
|
|
970
945
|
if (s !== t || document.visibilityState === "hidden") return;
|
|
971
946
|
let n;
|
|
972
947
|
try {
|
|
973
|
-
n =
|
|
948
|
+
n = At(i, o);
|
|
974
949
|
} catch (t) {
|
|
975
950
|
var r;
|
|
976
951
|
e.config.debug && ((r = globalThis.console) == null || r.warn("[bk-ot][blank-screen] confirmation failed:", t));
|
|
@@ -998,45 +973,45 @@ var Ne = (e, t) => typeof e.enabled == "function" ? e.enabled(t) : e.enabled !==
|
|
|
998
973
|
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
974
|
}
|
|
1000
975
|
};
|
|
1001
|
-
},
|
|
1002
|
-
let t =
|
|
1003
|
-
t >= 0 &&
|
|
1004
|
-
},
|
|
976
|
+
}, Mt = 100, Nt = 200, P = [], Pt = (e) => e.replace(/#.*$/, ""), Ft = (e) => {
|
|
977
|
+
let t = P.indexOf(e);
|
|
978
|
+
t >= 0 && P.splice(t, 1), e.timer !== void 0 && clearTimeout(e.timer);
|
|
979
|
+
}, F = (e, t) => {
|
|
1005
980
|
let n = e.callback;
|
|
1006
|
-
|
|
1007
|
-
},
|
|
1008
|
-
let t = performance.timeOrigin + e.startTime, n =
|
|
1009
|
-
n && (n.entry = e, n.callback &&
|
|
1010
|
-
},
|
|
981
|
+
Ft(e), e.callback = void 0, n == null || n(t);
|
|
982
|
+
}, It = (e) => {
|
|
983
|
+
let t = performance.timeOrigin + e.startTime, n = P.filter((n) => !n.entry && Pt(n.url) === Pt(e.name) && t >= n.startTime - 50).sort((e, n) => Math.abs(e.startTime - t) - Math.abs(n.startTime - t))[0];
|
|
984
|
+
n && (n.entry = e, n.callback && F(n, e));
|
|
985
|
+
}, Lt = (e, t = Date.now()) => {
|
|
1011
986
|
let n = {
|
|
1012
987
|
startTime: t,
|
|
1013
988
|
url: e
|
|
1014
989
|
};
|
|
1015
|
-
return
|
|
1016
|
-
cancel: () =>
|
|
990
|
+
return P.push(n), P.length > Mt && F(P[0]), {
|
|
991
|
+
cancel: () => F(n),
|
|
1017
992
|
complete: (e) => {
|
|
1018
993
|
if (n.callback = e, n.entry) {
|
|
1019
|
-
|
|
994
|
+
F(n, n.entry);
|
|
1020
995
|
return;
|
|
1021
996
|
}
|
|
1022
|
-
n.timer = setTimeout(() =>
|
|
997
|
+
n.timer = setTimeout(() => F(n), Nt);
|
|
1023
998
|
}
|
|
1024
999
|
};
|
|
1025
|
-
},
|
|
1000
|
+
}, I = "traceparent", L = 32, R = 16, Rt = "0123456789abcdef", zt = /^[\da-f]+$/, Bt = /^0+$/, Vt = /^\d+$/, Ht = /^([\da-f]{2})-([\da-f]{32})-([\da-f]{16})-([\da-f]{2})(?:-.*)?$/, Ut = /^([\da-f]{32})-([\da-f]{16})(?:-([01]))?$/, Wt = /(?:^|,)_dd\.p\.tid=([\da-f]{16})(?:,|$)/, Gt = "0000000000000000", z = (e, t) => e.length === t && zt.test(e) && !Bt.test(e), Kt = (e) => {
|
|
1026
1001
|
let t = e.toLowerCase();
|
|
1027
|
-
return
|
|
1028
|
-
},
|
|
1002
|
+
return z(t, L) ? t : z(t, R) ? t.padStart(L, "0") : void 0;
|
|
1003
|
+
}, qt = (e) => {
|
|
1029
1004
|
let t = e.toLowerCase();
|
|
1030
|
-
return
|
|
1031
|
-
},
|
|
1005
|
+
return z(t, R) ? t : void 0;
|
|
1006
|
+
}, B = (e) => {
|
|
1032
1007
|
let t = new Uint8Array(e / 2);
|
|
1033
1008
|
if (typeof crypto < "u" && typeof crypto.getRandomValues == "function") crypto.getRandomValues(t);
|
|
1034
1009
|
else for (let e = 0; e < t.length; e += 1) t[e] = Math.floor(Math.random() * 256);
|
|
1035
1010
|
let n = "";
|
|
1036
|
-
for (let e of t) n +=
|
|
1037
|
-
return
|
|
1038
|
-
},
|
|
1039
|
-
if (!
|
|
1011
|
+
for (let e of t) n += Rt[e >> 4] + Rt[e & 15];
|
|
1012
|
+
return Bt.test(n) ? `${n.slice(1)}1` : n;
|
|
1013
|
+
}, Jt = (e) => {
|
|
1014
|
+
if (!Vt.test(e)) return;
|
|
1040
1015
|
let t = [];
|
|
1041
1016
|
for (let n = 0; n < e.length; n += 1) {
|
|
1042
1017
|
let r = e.charCodeAt(n) - 48;
|
|
@@ -1046,11 +1021,11 @@ var Ne = (e, t) => typeof e.enabled == "function" ? e.enabled(t) : e.enabled !==
|
|
|
1046
1021
|
}
|
|
1047
1022
|
for (; r > 0;) t.push(r % 16), r = (r - r % 16) / 16;
|
|
1048
1023
|
}
|
|
1049
|
-
if (t.length >
|
|
1024
|
+
if (t.length > R) return;
|
|
1050
1025
|
let n = "";
|
|
1051
|
-
for (let e = t.length - 1; e >= 0; --e) n +=
|
|
1052
|
-
return n.padStart(
|
|
1053
|
-
},
|
|
1026
|
+
for (let e = t.length - 1; e >= 0; --e) n += Rt[t[e]];
|
|
1027
|
+
return n.padStart(R, "0");
|
|
1028
|
+
}, V = (e, t) => {
|
|
1054
1029
|
let n = {};
|
|
1055
1030
|
for (let i of t) {
|
|
1056
1031
|
var r;
|
|
@@ -1058,17 +1033,17 @@ var Ne = (e, t) => typeof e.enabled == "function" ? e.enabled(t) : e.enabled !==
|
|
|
1058
1033
|
t && (n[i] = t);
|
|
1059
1034
|
}
|
|
1060
1035
|
return n;
|
|
1061
|
-
},
|
|
1036
|
+
}, Yt = [
|
|
1062
1037
|
(e) => {
|
|
1063
1038
|
var t;
|
|
1064
1039
|
let n = (t = e("traceparent")) == null ? void 0 : t.trim().toLowerCase();
|
|
1065
1040
|
if (!n) return;
|
|
1066
|
-
let r =
|
|
1041
|
+
let r = Ht.exec(n);
|
|
1067
1042
|
if (!r || r[1] === "ff") return;
|
|
1068
1043
|
let [, , i, a, o] = r;
|
|
1069
|
-
if (!(!
|
|
1044
|
+
if (!(!z(i, L) || !z(a, R))) return {
|
|
1070
1045
|
format: "traceparent",
|
|
1071
|
-
headers:
|
|
1046
|
+
headers: V(e, [I]),
|
|
1072
1047
|
sampled: (Number.parseInt(o, 16) & 1) == 1,
|
|
1073
1048
|
spanId: a,
|
|
1074
1049
|
traceId: i
|
|
@@ -1078,7 +1053,7 @@ var Ne = (e, t) => typeof e.enabled == "function" ? e.enabled(t) : e.enabled !==
|
|
|
1078
1053
|
var t;
|
|
1079
1054
|
let n = (t = e("sentry-trace")) == null ? void 0 : t.trim().toLowerCase();
|
|
1080
1055
|
if (!n) return;
|
|
1081
|
-
let r =
|
|
1056
|
+
let r = V(e, ["sentry-trace"]), i = Ut.exec(n);
|
|
1082
1057
|
if (!i) return {
|
|
1083
1058
|
format: "sentry-trace",
|
|
1084
1059
|
headers: r
|
|
@@ -1087,7 +1062,7 @@ var Ne = (e, t) => typeof e.enabled == "function" ? e.enabled(t) : e.enabled !==
|
|
|
1087
1062
|
return S(S({
|
|
1088
1063
|
format: "sentry-trace",
|
|
1089
1064
|
headers: r
|
|
1090
|
-
}, s === void 0 ? {} : { sampled: s === "1" }),
|
|
1065
|
+
}, s === void 0 ? {} : { sampled: s === "1" }), z(a, L) && z(o, R) ? {
|
|
1091
1066
|
spanId: o,
|
|
1092
1067
|
traceId: a
|
|
1093
1068
|
} : {});
|
|
@@ -1096,10 +1071,10 @@ var Ne = (e, t) => typeof e.enabled == "function" ? e.enabled(t) : e.enabled !==
|
|
|
1096
1071
|
var t;
|
|
1097
1072
|
let n = (t = e("b3")) == null ? void 0 : t.trim().toLowerCase();
|
|
1098
1073
|
if (!n) return;
|
|
1099
|
-
let [r, i, a] = n.split("-"), o = r ?
|
|
1074
|
+
let [r, i, a] = n.split("-"), o = r ? Kt(r) : void 0, s = i ? qt(i) : void 0;
|
|
1100
1075
|
return S(S({
|
|
1101
1076
|
format: "b3",
|
|
1102
|
-
headers:
|
|
1077
|
+
headers: V(e, ["b3"])
|
|
1103
1078
|
}, o && s ? {
|
|
1104
1079
|
spanId: s,
|
|
1105
1080
|
traceId: o
|
|
@@ -1109,10 +1084,10 @@ var Ne = (e, t) => typeof e.enabled == "function" ? e.enabled(t) : e.enabled !==
|
|
|
1109
1084
|
var t, n, r;
|
|
1110
1085
|
let i = (t = e("x-b3-traceid")) == null ? void 0 : t.trim().toLowerCase(), a = (n = e("x-b3-spanid")) == null ? void 0 : n.trim().toLowerCase(), o = (r = e("x-b3-sampled")) == null ? void 0 : r.trim().toLowerCase();
|
|
1111
1086
|
if (!i && !a && !o) return;
|
|
1112
|
-
let s = i ?
|
|
1087
|
+
let s = i ? Kt(i) : void 0, c = a ? qt(a) : void 0;
|
|
1113
1088
|
return S(S({
|
|
1114
1089
|
format: "b3-multi",
|
|
1115
|
-
headers:
|
|
1090
|
+
headers: V(e, [
|
|
1116
1091
|
"x-b3-traceid",
|
|
1117
1092
|
"x-b3-spanid",
|
|
1118
1093
|
"x-b3-parentspanid",
|
|
@@ -1128,10 +1103,10 @@ var Ne = (e, t) => typeof e.enabled == "function" ? e.enabled(t) : e.enabled !==
|
|
|
1128
1103
|
var t, n, r, i, a, o;
|
|
1129
1104
|
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
1105
|
if (!s && !c && !l) return;
|
|
1131
|
-
let u = (i = e("x-datadog-tags")) == null ? void 0 : i.trim().toLowerCase(), d = (a = u ? (o =
|
|
1106
|
+
let u = (i = e("x-datadog-tags")) == null ? void 0 : i.trim().toLowerCase(), d = (a = u ? (o = Wt.exec(u)) == null ? void 0 : o[1] : void 0) == null ? Gt : a, f = s ? Jt(s) : void 0, p = f ? Kt(`${d}${f}`) : void 0, m = c ? Jt(c) : void 0, h = m ? qt(m) : void 0;
|
|
1132
1107
|
return S(S({
|
|
1133
1108
|
format: "datadog",
|
|
1134
|
-
headers:
|
|
1109
|
+
headers: V(e, [
|
|
1135
1110
|
"x-datadog-trace-id",
|
|
1136
1111
|
"x-datadog-parent-id",
|
|
1137
1112
|
"x-datadog-sampling-priority",
|
|
@@ -1150,42 +1125,42 @@ var Ne = (e, t) => typeof e.enabled == "function" ? e.enabled(t) : e.enabled !==
|
|
|
1150
1125
|
let r = n.split("-")[0];
|
|
1151
1126
|
return S({
|
|
1152
1127
|
format: "sw8",
|
|
1153
|
-
headers:
|
|
1128
|
+
headers: V(e, ["sw8"])
|
|
1154
1129
|
}, r ? { sampled: r === "1" } : {});
|
|
1155
1130
|
}
|
|
1156
|
-
],
|
|
1157
|
-
for (let t of
|
|
1131
|
+
], Xt = (e) => {
|
|
1132
|
+
for (let t of Yt) {
|
|
1158
1133
|
let n = t(e);
|
|
1159
1134
|
if (n) return n;
|
|
1160
1135
|
}
|
|
1161
|
-
},
|
|
1136
|
+
}, Zt = (e, t, r, i) => ({
|
|
1162
1137
|
attributes: r,
|
|
1163
1138
|
context: {
|
|
1164
1139
|
spanId: t,
|
|
1165
1140
|
traceFlags: i === !1 ? n.NONE : n.SAMPLED,
|
|
1166
1141
|
traceId: e
|
|
1167
1142
|
}
|
|
1168
|
-
}),
|
|
1143
|
+
}), Qt = (e) => {
|
|
1169
1144
|
var t, n;
|
|
1170
|
-
let r =
|
|
1145
|
+
let r = Xt(e);
|
|
1171
1146
|
if (!r) {
|
|
1172
|
-
let e =
|
|
1147
|
+
let e = B(L), t = B(R), n = `00-${e}-${t}-01`;
|
|
1173
1148
|
return {
|
|
1174
|
-
links: [
|
|
1149
|
+
links: [Zt(e, t, {
|
|
1175
1150
|
format: "traceparent",
|
|
1176
1151
|
injected: !0,
|
|
1177
|
-
[
|
|
1152
|
+
[I]: n
|
|
1178
1153
|
})],
|
|
1179
1154
|
traceparent: n
|
|
1180
1155
|
};
|
|
1181
1156
|
}
|
|
1182
|
-
return { links: [
|
|
1157
|
+
return { links: [Zt((t = r.traceId) == null ? B(L) : t, (n = r.spanId) == null ? B(R) : n, S({
|
|
1183
1158
|
format: r.format,
|
|
1184
1159
|
injected: !1
|
|
1185
1160
|
}, r.headers), r.sampled)] };
|
|
1186
|
-
},
|
|
1187
|
-
|
|
1188
|
-
},
|
|
1161
|
+
}, $t = (e) => e.deliveryType === "cache" || e.transferSize === 0 && e.decodedBodySize > 0 ? !0 : void 0, en = (e) => e.transferSize === 0 && e.encodedBodySize === 0 && e.decodedBodySize === 0 && e.requestStart === 0 && e.responseStart === 0 && !e.nextHopProtocol, tn = (...e) => e.every((t, n) => n === 0 || e[n - 1] <= t), H = (e, t, n, r, i) => {
|
|
1162
|
+
tn(n, r, i) && (e[`resource.${t}.start`] = r - n, e[`resource.${t}.duration`] = i - r);
|
|
1163
|
+
}, nn = (e) => {
|
|
1189
1164
|
let t = {}, n = [
|
|
1190
1165
|
e.startTime,
|
|
1191
1166
|
e.fetchStart,
|
|
@@ -1197,16 +1172,16 @@ var Ne = (e, t) => typeof e.enabled == "function" ? e.enabled(t) : e.enabled !==
|
|
|
1197
1172
|
e.responseStart,
|
|
1198
1173
|
e.responseEnd
|
|
1199
1174
|
];
|
|
1200
|
-
return !n.every(Number.isFinite) || !
|
|
1201
|
-
},
|
|
1202
|
-
let t =
|
|
1203
|
-
return S(S(S(S(S({ [g.cacheHit]:
|
|
1175
|
+
return !n.every(Number.isFinite) || !tn(...n) ? t : (H(t, "first_byte", e.startTime, e.requestStart, e.responseStart), H(t, "download", e.startTime, e.responseStart, e.responseEnd), e.workerStart > 0 && e.workerStart < e.fetchStart && H(t, "worker", e.startTime, e.workerStart, e.fetchStart), e.fetchStart < e.domainLookupEnd && H(t, "dns", e.startTime, e.domainLookupStart, e.domainLookupEnd), e.fetchStart < e.connectEnd && (H(t, "connect", e.startTime, e.connectStart, e.connectEnd), e.connectStart <= e.secureConnectionStart && e.secureConnectionStart <= e.connectEnd && H(t, "ssl", e.startTime, e.secureConnectionStart, e.connectEnd)), e.redirectEnd > e.startTime && tn(e.startTime, e.redirectStart, e.redirectEnd, e.fetchStart) && H(t, "redirect", e.startTime, e.redirectStart, e.redirectEnd), t);
|
|
1176
|
+
}, rn = (e) => e.duration === 0 && e.responseEnd > e.startTime ? e.responseEnd - e.startTime : e.duration, an = (e) => {
|
|
1177
|
+
let t = en(e), n = typeof e.deliveryType == "string" && e.deliveryType ? e.deliveryType : void 0;
|
|
1178
|
+
return S(S(S(S(S({ [g.cacheHit]: $t(e) }, e.nextHopProtocol ? { [g.nextHopProtocol]: e.nextHopProtocol } : {}), nn(e)), n ? { "resource.delivery_type": n } : {}), e.renderBlockingStatus ? { "resource.render_blocking_status": e.renderBlockingStatus } : {}), t ? {} : {
|
|
1204
1179
|
"resource.size": e.decodedBodySize,
|
|
1205
1180
|
"resource.encoded_body_size": e.encodedBodySize,
|
|
1206
1181
|
"resource.decoded_body_size": e.decodedBodySize,
|
|
1207
1182
|
"resource.transfer_size": e.transferSize
|
|
1208
1183
|
});
|
|
1209
|
-
},
|
|
1184
|
+
}, on = (t = !0) => {
|
|
1210
1185
|
let n;
|
|
1211
1186
|
return {
|
|
1212
1187
|
name: "resource",
|
|
@@ -1214,13 +1189,13 @@ var Ne = (e, t) => typeof e.enabled == "function" ? e.enabled(t) : e.enabled !==
|
|
|
1214
1189
|
var i;
|
|
1215
1190
|
if (typeof PerformanceObserver > "u" || !((i = PerformanceObserver.supportedEntryTypes) != null && i.includes("resource"))) return;
|
|
1216
1191
|
let a = (n) => {
|
|
1217
|
-
if (!r.isSampled() || !n.name ||
|
|
1192
|
+
if (!r.isSampled() || !n.name || he(r.config, n.name)) return;
|
|
1218
1193
|
if (n.initiatorType === "fetch" || n.initiatorType === "xmlhttprequest") {
|
|
1219
|
-
|
|
1194
|
+
It(n);
|
|
1220
1195
|
return;
|
|
1221
1196
|
}
|
|
1222
1197
|
if (n.duration < 0) return;
|
|
1223
|
-
let i = r.config.hooks.redactUrl(n.name), a =
|
|
1198
|
+
let i = r.config.hooks.redactUrl(n.name), a = rn(n), o = performance.timeOrigin + n.startTime, s = o + a;
|
|
1224
1199
|
t && r.isSampled() && r.startSpan("browser.resource", S(S(S({}, r.config.hooks.getPageAttributes()), Xe({
|
|
1225
1200
|
initiatorType: n.initiatorType || "other",
|
|
1226
1201
|
outcome: typeof n.responseStatus == "number" ? {
|
|
@@ -1228,7 +1203,7 @@ var Ne = (e, t) => typeof e.enabled == "function" ? e.enabled(t) : e.enabled !==
|
|
|
1228
1203
|
type: "response"
|
|
1229
1204
|
} : void 0,
|
|
1230
1205
|
url: i
|
|
1231
|
-
})), {}, { "url.full": i },
|
|
1206
|
+
})), {}, { "url.full": i }, an(n)), {
|
|
1232
1207
|
kind: e.CLIENT,
|
|
1233
1208
|
startTime: o
|
|
1234
1209
|
}).end(s), r.notifyActivity({
|
|
@@ -1253,31 +1228,31 @@ var Ne = (e, t) => typeof e.enabled == "function" ? e.enabled(t) : e.enabled !==
|
|
|
1253
1228
|
n == null || n.disconnect(), n = void 0;
|
|
1254
1229
|
}
|
|
1255
1230
|
};
|
|
1256
|
-
},
|
|
1231
|
+
}, sn = (e) => typeof e.config.tracking.request == "object" ? e.config.tracking.request : void 0, cn = (e) => {
|
|
1257
1232
|
var t;
|
|
1258
|
-
let n = (t =
|
|
1233
|
+
let n = (t = sn(e)) == null ? void 0 : t.allowedTracingUrls;
|
|
1259
1234
|
return Array.isArray(n) ? n.length > 0 : n !== void 0;
|
|
1260
|
-
},
|
|
1235
|
+
}, ln = (e) => typeof e == "object" && e && "name" in e && typeof e.name == "string" ? e.name : "", un = (e, t) => {
|
|
1261
1236
|
let n = e.signal;
|
|
1262
|
-
return
|
|
1237
|
+
return ln(n == null ? void 0 : n.reason) === "TimeoutError" || ln(t) === "TimeoutError" ? {
|
|
1263
1238
|
error: t,
|
|
1264
1239
|
type: "timeout"
|
|
1265
|
-
} : n != null && n.aborted ||
|
|
1240
|
+
} : n != null && n.aborted || ln(t) === "AbortError" ? { type: "abort" } : {
|
|
1266
1241
|
error: t,
|
|
1267
1242
|
type: "network_error"
|
|
1268
1243
|
};
|
|
1269
|
-
},
|
|
1244
|
+
}, dn = (e, t) => e === "abort" ? { type: "abort" } : e === "timeout" ? { type: "timeout" } : e === "error" || t.status === 0 ? { type: "network_error" } : {
|
|
1270
1245
|
statusCode: t.status,
|
|
1271
1246
|
type: "response"
|
|
1272
|
-
},
|
|
1247
|
+
}, fn = (e) => e.type === "network_error" || e.type === "timeout" || e.type === "response" && typeof e.statusCode == "number" && e.statusCode >= 400, pn = (e) => typeof e == "string" || e instanceof URL ? E(String(e)) : E(e.url), mn = (e, t) => {
|
|
1273
1248
|
var n;
|
|
1274
1249
|
return ((n = t == null ? void 0 : t.method) == null ? typeof Request < "u" && e instanceof Request ? e.method : "GET" : n).toUpperCase();
|
|
1275
|
-
},
|
|
1250
|
+
}, hn = (e, t) => typeof Request < "u" && e instanceof Request ? e : t == null ? {} : t, gn = (e, t) => {
|
|
1276
1251
|
var n;
|
|
1277
1252
|
let r = typeof Request < "u" && e instanceof Request ? e.headers : void 0;
|
|
1278
1253
|
return new Headers((n = t == null ? void 0 : t.headers) == null ? r : n);
|
|
1279
|
-
},
|
|
1280
|
-
if (
|
|
1254
|
+
}, _n = (e, t, n) => n.traceparent ? (t.set(I, n.traceparent), S(S({}, e), {}, { headers: t })) : e, vn = (e) => (t) => e == null ? void 0 : e[t.toLowerCase()], yn = (e, t) => he(e.config, t) || D(e.config.view.excludedActivityUrls, t), bn = (e, t) => {
|
|
1255
|
+
if (yn(e, t)) return () => {};
|
|
1281
1256
|
let n = h("request");
|
|
1282
1257
|
e.notifyActivity({
|
|
1283
1258
|
id: n,
|
|
@@ -1293,12 +1268,12 @@ var Ne = (e, t) => typeof e.enabled == "function" ? e.enabled(t) : e.enabled !==
|
|
|
1293
1268
|
type: "request_end"
|
|
1294
1269
|
}));
|
|
1295
1270
|
};
|
|
1296
|
-
},
|
|
1271
|
+
}, xn = (e, t) => e.isSampled() ? Lt(t) : {
|
|
1297
1272
|
cancel() {},
|
|
1298
1273
|
complete(e) {
|
|
1299
1274
|
e();
|
|
1300
1275
|
}
|
|
1301
|
-
},
|
|
1276
|
+
}, Sn = (t, n, r, i) => {
|
|
1302
1277
|
var a, o;
|
|
1303
1278
|
let s = (a = r.startedAt) == null ? Date.now() : a;
|
|
1304
1279
|
return t.startSpan("browser.resource", S(S(S({}, t.config.hooks.getPageAttributes()), Xe({
|
|
@@ -1312,7 +1287,7 @@ var Ne = (e, t) => typeof e.enabled == "function" ? e.enabled(t) : e.enabled !==
|
|
|
1312
1287
|
kind: e.CLIENT,
|
|
1313
1288
|
startTime: s
|
|
1314
1289
|
}, i ? { links: i.links } : {}));
|
|
1315
|
-
},
|
|
1290
|
+
}, Cn = (e, n, r, i, a, o = {}) => {
|
|
1316
1291
|
let s = o.url, c = s ? e.config.hooks.redactUrl(s) : void 0, l = o.method, u = {
|
|
1317
1292
|
attributes: S(S(S(S({}, e.config.hooks.getPageAttributes()), Xe({
|
|
1318
1293
|
initiatorType: r,
|
|
@@ -1330,17 +1305,17 @@ var Ne = (e, t) => typeof e.enabled == "function" ? e.enabled(t) : e.enabled !==
|
|
|
1330
1305
|
}, d = !0;
|
|
1331
1306
|
try {
|
|
1332
1307
|
var f, p;
|
|
1333
|
-
d = (f =
|
|
1308
|
+
d = (f = sn(e)) == null || (p = f.beforeSend) == null ? void 0 : p.call(f, u, i);
|
|
1334
1309
|
} catch (t) {
|
|
1335
1310
|
var m;
|
|
1336
1311
|
e.config.debug && ((m = globalThis.console) == null || m.warn("[bk-ot] request.beforeSend failed:", t));
|
|
1337
1312
|
}
|
|
1338
1313
|
if (n.setAttributes(e.applyRedact(u.attributes)), d === !1) {
|
|
1339
|
-
|
|
1314
|
+
ze(n);
|
|
1340
1315
|
return;
|
|
1341
1316
|
}
|
|
1342
|
-
|
|
1343
|
-
},
|
|
1317
|
+
fn(a) && n.setStatus({ code: t.ERROR });
|
|
1318
|
+
}, wn = (e) => {
|
|
1344
1319
|
let t = [], n = /* @__PURE__ */ new Set();
|
|
1345
1320
|
return {
|
|
1346
1321
|
name: "request",
|
|
@@ -1349,20 +1324,20 @@ var Ne = (e, t) => typeof e.enabled == "function" ? e.enabled(t) : e.enabled !==
|
|
|
1349
1324
|
if (!(typeof window > "u")) {
|
|
1350
1325
|
if (typeof window.fetch == "function") {
|
|
1351
1326
|
let r = window.fetch, i = /* @__PURE__ */ function() {
|
|
1352
|
-
var t =
|
|
1353
|
-
let a =
|
|
1354
|
-
if (!e.isSampled() ||
|
|
1327
|
+
var t = O(function* (t, i) {
|
|
1328
|
+
let a = pn(t);
|
|
1329
|
+
if (!e.isSampled() || ve(e.config, a)) return r.call(this, t, i);
|
|
1355
1330
|
let o = {
|
|
1356
|
-
method:
|
|
1331
|
+
method: mn(t, i),
|
|
1357
1332
|
startedAt: Date.now(),
|
|
1358
1333
|
url: a
|
|
1359
|
-
}, s =
|
|
1334
|
+
}, s = ye(e.config, a) ? gn(t, i) : void 0, c = s ? Qt((e) => {
|
|
1360
1335
|
var t;
|
|
1361
1336
|
return (t = s.get(e)) == null ? void 0 : t;
|
|
1362
|
-
}) : void 0, l =
|
|
1337
|
+
}) : void 0, l = Sn(e, "fetch", o, c), u = xn(e, a), d = bn(e, a), f = hn(t, i), p = s && c ? _n(i, s, c) : i, m = !1, h = (t, r = Date.now()) => {
|
|
1363
1338
|
if (!m) {
|
|
1364
1339
|
if (m = !0, n.delete(g), t) {
|
|
1365
|
-
l.setAttributes(e.applyRedact(
|
|
1340
|
+
l.setAttributes(e.applyRedact(an(t))), l.end(performance.timeOrigin + t.startTime + rn(t));
|
|
1366
1341
|
return;
|
|
1367
1342
|
}
|
|
1368
1343
|
l.end(r);
|
|
@@ -1373,7 +1348,7 @@ var Ne = (e, t) => typeof e.enabled == "function" ? e.enabled(t) : e.enabled !==
|
|
|
1373
1348
|
n.add(g);
|
|
1374
1349
|
try {
|
|
1375
1350
|
let n = yield r.call(this, t, p), i = S(S({}, n.status > 0 ? { statusCode: n.status } : {}), {}, { type: "response" });
|
|
1376
|
-
|
|
1351
|
+
Cn(e, l, "fetch", {
|
|
1377
1352
|
request: f,
|
|
1378
1353
|
response: n,
|
|
1379
1354
|
type: "fetch"
|
|
@@ -1381,8 +1356,8 @@ var Ne = (e, t) => typeof e.enabled == "function" ? e.enabled(t) : e.enabled !==
|
|
|
1381
1356
|
let a = Date.now();
|
|
1382
1357
|
return u.complete((e) => h(e, a)), n;
|
|
1383
1358
|
} catch (t) {
|
|
1384
|
-
let n =
|
|
1385
|
-
|
|
1359
|
+
let n = un(f, t);
|
|
1360
|
+
Cn(e, l, "fetch", {
|
|
1386
1361
|
error: t,
|
|
1387
1362
|
request: f,
|
|
1388
1363
|
type: "fetch"
|
|
@@ -1410,10 +1385,10 @@ var Ne = (e, t) => typeof e.enabled == "function" ? e.enabled(t) : e.enabled !==
|
|
|
1410
1385
|
}, c = function(t) {
|
|
1411
1386
|
var a;
|
|
1412
1387
|
let s = (a = r.get(this)) == null ? {} : a;
|
|
1413
|
-
if (!e.isSampled() || !s.url ||
|
|
1388
|
+
if (!e.isSampled() || !s.url || ve(e.config, s.url)) return o.call(this, t);
|
|
1414
1389
|
s.startedAt = Date.now();
|
|
1415
|
-
let c =
|
|
1416
|
-
c != null && c.traceparent && this.setRequestHeader(
|
|
1390
|
+
let c = ye(e.config, s.url) ? Qt(vn(i.get(this))) : void 0, l = Sn(e, "xhr", s, c), u = xn(e, s.url), d = bn(e, s.url);
|
|
1391
|
+
c != null && c.traceparent && this.setRequestHeader(I, c.traceparent);
|
|
1417
1392
|
let f = !1, p = !1, m = () => {}, h = () => {
|
|
1418
1393
|
m(), u.cancel(), !p && (p = !0, n.delete(h), d(), l.end());
|
|
1419
1394
|
};
|
|
@@ -1421,8 +1396,8 @@ var Ne = (e, t) => typeof e.enabled == "function" ? e.enabled(t) : e.enabled !==
|
|
|
1421
1396
|
let g = (t) => {
|
|
1422
1397
|
if (f || p) return;
|
|
1423
1398
|
f = !0, m();
|
|
1424
|
-
let r =
|
|
1425
|
-
|
|
1399
|
+
let r = dn(t, this);
|
|
1400
|
+
Cn(e, l, "xhr", {
|
|
1426
1401
|
type: "xhr",
|
|
1427
1402
|
xhr: this
|
|
1428
1403
|
}, r, s), d();
|
|
@@ -1430,7 +1405,7 @@ var Ne = (e, t) => typeof e.enabled == "function" ? e.enabled(t) : e.enabled !==
|
|
|
1430
1405
|
u.complete((t) => {
|
|
1431
1406
|
if (!p) {
|
|
1432
1407
|
if (p = !0, n.delete(h), t) {
|
|
1433
|
-
l.setAttributes(e.applyRedact(
|
|
1408
|
+
l.setAttributes(e.applyRedact(an(t))), l.end(performance.timeOrigin + t.startTime + rn(t));
|
|
1434
1409
|
return;
|
|
1435
1410
|
}
|
|
1436
1411
|
l.end(i);
|
|
@@ -1448,7 +1423,7 @@ var Ne = (e, t) => typeof e.enabled == "function" ? e.enabled(t) : e.enabled !==
|
|
|
1448
1423
|
};
|
|
1449
1424
|
if (XMLHttpRequest.prototype.open = s, XMLHttpRequest.prototype.send = c, t.push(() => {
|
|
1450
1425
|
XMLHttpRequest.prototype.open === s && (XMLHttpRequest.prototype.open = a), XMLHttpRequest.prototype.send === c && (XMLHttpRequest.prototype.send = o);
|
|
1451
|
-
}),
|
|
1426
|
+
}), cn(e) && typeof XMLHttpRequest.prototype.setRequestHeader == "function") {
|
|
1452
1427
|
let e = XMLHttpRequest.prototype.setRequestHeader, n = function(t, n) {
|
|
1453
1428
|
var r;
|
|
1454
1429
|
let a = t.toLowerCase(), o = (r = i.get(this)) == null ? {} : r;
|
|
@@ -1467,9 +1442,9 @@ var Ne = (e, t) => typeof e.enabled == "function" ? e.enabled(t) : e.enabled !==
|
|
|
1467
1442
|
for (; t.length;) (e = t.pop()) == null || e();
|
|
1468
1443
|
}
|
|
1469
1444
|
};
|
|
1470
|
-
},
|
|
1471
|
-
if (t) return
|
|
1472
|
-
},
|
|
1445
|
+
}, Tn = /^https?:|^\/\//i, En = (e, t) => {
|
|
1446
|
+
if (t) return Tn.test(t) ? e(t) : t;
|
|
1447
|
+
}, Dn = () => {
|
|
1473
1448
|
let e;
|
|
1474
1449
|
return {
|
|
1475
1450
|
name: "csp-violation",
|
|
@@ -1477,11 +1452,10 @@ var Ne = (e, t) => typeof e.enabled == "function" ? e.enabled(t) : e.enabled !==
|
|
|
1477
1452
|
if (typeof window > "u" || typeof document > "u") return;
|
|
1478
1453
|
let n = (e) => {
|
|
1479
1454
|
if (!t.isSampled()) return;
|
|
1480
|
-
let n = Date.now(), r =
|
|
1481
|
-
t.startSpan("csp.violation", S(S(S({}, t.config.hooks.getPageAttributes()),
|
|
1482
|
-
outcome:
|
|
1483
|
-
|
|
1484
|
-
spanType: j.error
|
|
1455
|
+
let n = Date.now(), r = En(t.config.hooks.redactUrl, e.blockedURI), i = e.sourceFile ? t.config.hooks.redactUrl(e.sourceFile) : void 0;
|
|
1456
|
+
t.startSpan("csp.violation", S(S(S({}, t.config.hooks.getPageAttributes()), j({
|
|
1457
|
+
outcome: k.error,
|
|
1458
|
+
spanType: A.error
|
|
1485
1459
|
})), {}, {
|
|
1486
1460
|
"csp.blocked_uri": r,
|
|
1487
1461
|
"csp.violated_directive": e.violatedDirective,
|
|
@@ -1501,7 +1475,7 @@ var Ne = (e, t) => typeof e.enabled == "function" ? e.enabled(t) : e.enabled !==
|
|
|
1501
1475
|
e == null || e(), e = void 0;
|
|
1502
1476
|
}
|
|
1503
1477
|
};
|
|
1504
|
-
},
|
|
1478
|
+
}, On = (e) => {
|
|
1505
1479
|
if (e instanceof Error) return e.message;
|
|
1506
1480
|
if (typeof e == "string") return e;
|
|
1507
1481
|
try {
|
|
@@ -1509,9 +1483,9 @@ var Ne = (e, t) => typeof e.enabled == "function" ? e.enabled(t) : e.enabled !==
|
|
|
1509
1483
|
} catch (t) {
|
|
1510
1484
|
return String(e);
|
|
1511
1485
|
}
|
|
1512
|
-
},
|
|
1486
|
+
}, kn = ({ context: e, error: n, exceptionType: r, extra: i = {}, source: a, spanName: o }) => {
|
|
1513
1487
|
if (!e.isSampled()) return;
|
|
1514
|
-
let s = Date.now(), c =
|
|
1488
|
+
let s = Date.now(), c = On(n);
|
|
1515
1489
|
e.notifyActivity({
|
|
1516
1490
|
time: s,
|
|
1517
1491
|
type: "error"
|
|
@@ -1519,9 +1493,9 @@ var Ne = (e, t) => typeof e.enabled == "function" ? e.enabled(t) : e.enabled !==
|
|
|
1519
1493
|
let l = n instanceof Error ? n : {
|
|
1520
1494
|
message: c,
|
|
1521
1495
|
name: r == null ? a : r
|
|
1522
|
-
}, u = S(S(S(S({}, e.config.hooks.getPageAttributes()), e.config.hooks.getErrorAttributes()),
|
|
1523
|
-
outcome:
|
|
1524
|
-
spanType:
|
|
1496
|
+
}, u = S(S(S(S({}, e.config.hooks.getPageAttributes()), e.config.hooks.getErrorAttributes()), j({
|
|
1497
|
+
outcome: k.error,
|
|
1498
|
+
spanType: A.error
|
|
1525
1499
|
})), {}, {
|
|
1526
1500
|
"error.message": c,
|
|
1527
1501
|
"error.handled": !1,
|
|
@@ -1531,7 +1505,7 @@ var Ne = (e, t) => typeof e.enabled == "function" ? e.enabled(t) : e.enabled !==
|
|
|
1531
1505
|
code: t.ERROR,
|
|
1532
1506
|
message: c
|
|
1533
1507
|
}), d.end();
|
|
1534
|
-
},
|
|
1508
|
+
}, An = () => {
|
|
1535
1509
|
let e = [];
|
|
1536
1510
|
return {
|
|
1537
1511
|
name: "error",
|
|
@@ -1539,20 +1513,19 @@ var Ne = (e, t) => typeof e.enabled == "function" ? e.enabled(t) : e.enabled !==
|
|
|
1539
1513
|
if (typeof window > "u") return;
|
|
1540
1514
|
let n = (e) => {
|
|
1541
1515
|
var n;
|
|
1542
|
-
|
|
1543
|
-
An({
|
|
1516
|
+
kn({
|
|
1544
1517
|
context: t,
|
|
1545
1518
|
spanName: "browser.error",
|
|
1546
1519
|
source: "window.error",
|
|
1547
1520
|
error: (n = e.error) == null ? e.message : n,
|
|
1548
|
-
extra:
|
|
1521
|
+
extra: {
|
|
1549
1522
|
"code.filepath": e.filename,
|
|
1550
1523
|
"code.lineno": e.lineno,
|
|
1551
1524
|
"code.column": e.colno
|
|
1552
|
-
}
|
|
1525
|
+
}
|
|
1553
1526
|
});
|
|
1554
1527
|
}, r = (e) => {
|
|
1555
|
-
|
|
1528
|
+
kn({
|
|
1556
1529
|
context: t,
|
|
1557
1530
|
spanName: "browser.unhandledrejection",
|
|
1558
1531
|
source: "unhandledrejection",
|
|
@@ -1564,16 +1537,13 @@ var Ne = (e, t) => typeof e.enabled == "function" ? e.enabled(t) : e.enabled !==
|
|
|
1564
1537
|
let n = e.target;
|
|
1565
1538
|
if (!(n instanceof Element)) return;
|
|
1566
1539
|
let r = n, i = r.src || r.href || n.currentSrc || "";
|
|
1567
|
-
|
|
1540
|
+
kn({
|
|
1568
1541
|
context: t,
|
|
1569
1542
|
spanName: "browser.resource_error",
|
|
1570
1543
|
source: "resource",
|
|
1571
1544
|
error: /* @__PURE__ */ Error(`Resource load failed: ${n.tagName.toLowerCase()} ${i}`),
|
|
1572
1545
|
exceptionType: "ResourceError",
|
|
1573
|
-
extra: {
|
|
1574
|
-
"url.full": t.config.hooks.redactUrl(i),
|
|
1575
|
-
"html.tag": n.tagName
|
|
1576
|
-
}
|
|
1546
|
+
extra: { "url.full": t.config.hooks.redactUrl(i) }
|
|
1577
1547
|
});
|
|
1578
1548
|
};
|
|
1579
1549
|
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 +1555,7 @@ var Ne = (e, t) => typeof e.enabled == "function" ? e.enabled(t) : e.enabled !==
|
|
|
1585
1555
|
}
|
|
1586
1556
|
}
|
|
1587
1557
|
};
|
|
1588
|
-
},
|
|
1558
|
+
}, jn = 50, Mn = (e, t) => typeof e == "number" && Number.isFinite(e) && e >= 0 ? e : t, U = (e) => Number.isFinite(e) ? e : void 0, Nn = (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 } : {}), Pn = (e, t) => ({
|
|
1589
1559
|
"long_task.script.duration": e.duration,
|
|
1590
1560
|
"long_task.script.execution_start": e.executionStart,
|
|
1591
1561
|
"long_task.script.forced_style_and_layout_duration": e.forcedStyleAndLayoutDuration,
|
|
@@ -1597,8 +1567,8 @@ var Ne = (e, t) => typeof e.enabled == "function" ? e.enabled(t) : e.enabled !==
|
|
|
1597
1567
|
"long_task.script.source_url": e.sourceURL ? t(e.sourceURL) : "",
|
|
1598
1568
|
"long_task.script.start_time": e.startTime,
|
|
1599
1569
|
"long_task.script.window_attribution": e.windowAttribution
|
|
1600
|
-
}),
|
|
1601
|
-
let t =
|
|
1570
|
+
}), Fn = (e = {}) => {
|
|
1571
|
+
let t = Mn(e.threshold, jn), n, r, i = [];
|
|
1602
1572
|
return {
|
|
1603
1573
|
name: "long-task",
|
|
1604
1574
|
init(e) {
|
|
@@ -1609,16 +1579,15 @@ var Ne = (e, t) => typeof e.enabled == "function" ? e.enabled(t) : e.enabled !==
|
|
|
1609
1579
|
let c = (n) => {
|
|
1610
1580
|
var r, i;
|
|
1611
1581
|
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,
|
|
1582
|
+
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()), j({ spanType: A.longTask })), U(o == null ? void 0 : o.blockingDuration) === void 0 ? {} : { [g.longTaskBlockingDuration]: o.blockingDuration }), {}, {
|
|
1614
1583
|
[g.longTaskEntryType]: d,
|
|
1615
1584
|
[g.longTaskId]: c,
|
|
1616
1585
|
"long_task.name": n.name
|
|
1617
|
-
},
|
|
1586
|
+
}, U(o == null ? void 0 : o.firstUIEventTimestamp) === void 0 ? {} : { "long_task.first_ui_event_timestamp": o.firstUIEventTimestamp }), U(o == null ? void 0 : o.renderStart) === void 0 ? {} : { "long_task.render_start": o.renderStart }), U(o == null ? void 0 : o.styleAndLayoutStart) === void 0 ? {} : { "long_task.style_and_layout_start": o.styleAndLayoutStart }), { startTime: l });
|
|
1618
1587
|
s.forEach((t) => {
|
|
1619
|
-
p.addEvent("long_task.script", e.applyRedact(
|
|
1588
|
+
p.addEvent("long_task.script", e.applyRedact(Pn(t, e.config.hooks.redactUrl)), performance.timeOrigin + t.startTime);
|
|
1620
1589
|
}), f.forEach((t, n) => {
|
|
1621
|
-
p.addEvent("long_task.attribution", e.applyRedact(S({ "long_task.attribution.index": n },
|
|
1590
|
+
p.addEvent("long_task.attribution", e.applyRedact(S({ "long_task.attribution.index": n }, Nn(t, e.config.hooks.redactUrl))), l);
|
|
1622
1591
|
}), p.end(u), e.notifyActivity({
|
|
1623
1592
|
endTime: u,
|
|
1624
1593
|
startTime: l,
|
|
@@ -1645,43 +1614,43 @@ var Ne = (e, t) => typeof e.enabled == "function" ? e.enabled(t) : e.enabled !==
|
|
|
1645
1614
|
n == null || n.disconnect(), n = void 0, clearTimeout(r), r = void 0, i = [];
|
|
1646
1615
|
}
|
|
1647
1616
|
};
|
|
1648
|
-
},
|
|
1617
|
+
}, W = /* @__PURE__ */ new Set(), G = "", K, q, J = !1, Y = () => typeof location > "u" ? "" : location.href, In = (e, t) => {
|
|
1649
1618
|
let n = Y();
|
|
1650
|
-
|
|
1619
|
+
G = n;
|
|
1651
1620
|
let r = {
|
|
1652
1621
|
fromUrl: t,
|
|
1653
1622
|
source: e,
|
|
1654
1623
|
toUrl: n
|
|
1655
1624
|
};
|
|
1656
|
-
for (let e of Array.from(
|
|
1625
|
+
for (let e of Array.from(W)) e(r);
|
|
1626
|
+
}, Ln = () => {
|
|
1627
|
+
In("popstate", G || Y());
|
|
1628
|
+
}, Rn = () => {
|
|
1629
|
+
In("hashchange", G || Y());
|
|
1657
1630
|
}, zn = () => {
|
|
1658
|
-
|
|
1659
|
-
|
|
1660
|
-
Rn("hashchange", K || Y());
|
|
1661
|
-
}, Vn = () => {
|
|
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, [
|
|
1631
|
+
J || typeof window > "u" || typeof history > "u" || (J = !0, G = Y(), K = history.pushState, q = history.replaceState, history.pushState = function(e, t, n) {
|
|
1632
|
+
let r = G || Y(), i = K == null ? void 0 : K.apply(this, [
|
|
1664
1633
|
e,
|
|
1665
1634
|
t,
|
|
1666
1635
|
n
|
|
1667
1636
|
]);
|
|
1668
|
-
return
|
|
1637
|
+
return In("pushState", r), i;
|
|
1669
1638
|
}, history.replaceState = function(e, t, n) {
|
|
1670
|
-
let r =
|
|
1639
|
+
let r = G || Y(), i = q == null ? void 0 : q.apply(this, [
|
|
1671
1640
|
e,
|
|
1672
1641
|
t,
|
|
1673
1642
|
n
|
|
1674
1643
|
]);
|
|
1675
|
-
return
|
|
1676
|
-
}, window.addEventListener("popstate",
|
|
1677
|
-
},
|
|
1678
|
-
!
|
|
1679
|
-
},
|
|
1680
|
-
|
|
1644
|
+
return In("replaceState", r), i;
|
|
1645
|
+
}, window.addEventListener("popstate", Ln), window.addEventListener("hashchange", Rn));
|
|
1646
|
+
}, Bn = () => {
|
|
1647
|
+
!J || typeof window > "u" || typeof history > "u" || (K && (history.pushState = K), q && (history.replaceState = q), window.removeEventListener("popstate", Ln), window.removeEventListener("hashchange", Rn), K = void 0, q = void 0, J = !1, G = "");
|
|
1648
|
+
}, Vn = (e) => typeof window > "u" || typeof history > "u" ? () => {} : (zn(), W.add(e), () => {
|
|
1649
|
+
W.delete(e), W.size === 0 && Bn();
|
|
1681
1650
|
});
|
|
1682
1651
|
//#endregion
|
|
1683
1652
|
//#region \0@oxc-project+runtime@0.128.0/helpers/objectWithoutPropertiesLoose.js
|
|
1684
|
-
function
|
|
1653
|
+
function Hn(e, t) {
|
|
1685
1654
|
if (e == null) return {};
|
|
1686
1655
|
var n = {};
|
|
1687
1656
|
for (var r in e) if ({}.hasOwnProperty.call(e, r)) {
|
|
@@ -1692,9 +1661,9 @@ function Wn(e, t) {
|
|
|
1692
1661
|
}
|
|
1693
1662
|
//#endregion
|
|
1694
1663
|
//#region \0@oxc-project+runtime@0.128.0/helpers/objectWithoutProperties.js
|
|
1695
|
-
function
|
|
1664
|
+
function Un(e, t) {
|
|
1696
1665
|
if (e == null) return {};
|
|
1697
|
-
var n, r, i =
|
|
1666
|
+
var n, r, i = Hn(e, t);
|
|
1698
1667
|
if (Object.getOwnPropertySymbols) {
|
|
1699
1668
|
var a = Object.getOwnPropertySymbols(e);
|
|
1700
1669
|
for (r = 0; r < a.length; r++) n = a[r], t.includes(n) || {}.propertyIsEnumerable.call(e, n) && (i[n] = e[n]);
|
|
@@ -1703,7 +1672,7 @@ function Gn(e, t) {
|
|
|
1703
1672
|
}
|
|
1704
1673
|
//#endregion
|
|
1705
1674
|
//#region src/plugins/page-view.ts
|
|
1706
|
-
var
|
|
1675
|
+
var Wn = ["stopLoadingTime"], Gn = new Set(Object.values(g)), Kn = () => typeof location > "u" ? "" : location.href, qn = () => {
|
|
1707
1676
|
if (typeof performance > "u") return {};
|
|
1708
1677
|
let e = performance.getEntriesByType("navigation")[0];
|
|
1709
1678
|
if (!e) return {};
|
|
@@ -1711,10 +1680,10 @@ var Kn = ["stopLoadingTime"], qn = new Set(Object.values(g)), Jn = () => typeof
|
|
|
1711
1680
|
Number.isFinite(n) && n > 0 && (t[e] = n);
|
|
1712
1681
|
};
|
|
1713
1682
|
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
|
-
},
|
|
1683
|
+
}, Jn = (e) => {
|
|
1715
1684
|
let t = e.indexOf("?");
|
|
1716
1685
|
return t < 0 ? e : e.slice(0, t);
|
|
1717
|
-
},
|
|
1686
|
+
}, Yn = (e) => {
|
|
1718
1687
|
let t = e.slice(1);
|
|
1719
1688
|
if (!t || typeof document > "u" || typeof document.getElementById != "function") return !1;
|
|
1720
1689
|
try {
|
|
@@ -1722,14 +1691,14 @@ var Kn = ["stopLoadingTime"], qn = new Set(Object.values(g)), Jn = () => typeof
|
|
|
1722
1691
|
} catch (e) {
|
|
1723
1692
|
return !!document.getElementById(t);
|
|
1724
1693
|
}
|
|
1725
|
-
},
|
|
1694
|
+
}, Xn = (e, t) => {
|
|
1726
1695
|
try {
|
|
1727
1696
|
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 || !
|
|
1697
|
+
return r.pathname !== i.pathname || !Yn(i.hash) && Jn(r.hash) !== Jn(i.hash);
|
|
1729
1698
|
} catch (n) {
|
|
1730
1699
|
return e !== t;
|
|
1731
1700
|
}
|
|
1732
|
-
},
|
|
1701
|
+
}, Zn = () => {
|
|
1733
1702
|
let e = [];
|
|
1734
1703
|
return {
|
|
1735
1704
|
name: "page-view",
|
|
@@ -1756,10 +1725,10 @@ var Kn = ["stopLoadingTime"], qn = new Set(Object.values(g)), Jn = () => typeof
|
|
|
1756
1725
|
let s = S({}, n);
|
|
1757
1726
|
(i = n.stopLoadingTime) == null || i.call(n), o(n, "end", r, e), n = void 0, t && a(r);
|
|
1758
1727
|
let { stopLoadingTime: c } = s;
|
|
1759
|
-
return
|
|
1728
|
+
return Un(s, Wn);
|
|
1760
1729
|
}, c = (e, t, r) => {
|
|
1761
1730
|
if (n !== e || !Number.isFinite(t) || t < 0) return;
|
|
1762
|
-
let i = S(S({}, e.loadingType === "initial_load" ?
|
|
1731
|
+
let i = S(S({}, e.loadingType === "initial_load" ? qn() : {}), {}, {
|
|
1763
1732
|
[g.viewLoadingTime]: t,
|
|
1764
1733
|
[g.viewLoadingTimeSource]: r
|
|
1765
1734
|
});
|
|
@@ -1795,13 +1764,13 @@ var Kn = ["stopLoadingTime"], qn = new Set(Object.values(g)), Jn = () => typeof
|
|
|
1795
1764
|
}, d();
|
|
1796
1765
|
}, u = (e) => {
|
|
1797
1766
|
let n = t.applyRedact(e == null ? {} : e);
|
|
1798
|
-
return Object.fromEntries(Object.entries(n).filter(([e, t]) => t !== void 0 && !
|
|
1767
|
+
return Object.fromEntries(Object.entries(n).filter(([e, t]) => t !== void 0 && !Gn.has(e)));
|
|
1799
1768
|
}, d = (e, r, i, a = ((e) => (e = n == null ? void 0 : n.rawUrl) == null ? "" : e)()) => {
|
|
1800
1769
|
var c;
|
|
1801
1770
|
if (!t.isSessionActive()) return;
|
|
1802
|
-
let d = (c = e.url) == null ?
|
|
1771
|
+
let d = (c = e.url) == null ? Kn() : c, f = t.config.hooks.getViewUrlTemplate(d), p = e.name, m = u(e.attributes);
|
|
1803
1772
|
s(r, !1);
|
|
1804
|
-
let _ = h("view"), v = t.config.hooks.redactUrl(d), y = t.config.hooks.redactUrl(a), b = i === "initial_load", x = b && typeof performance < "u" ? performance.timeOrigin : Date.now(), C = b ?
|
|
1773
|
+
let _ = h("view"), v = t.config.hooks.redactUrl(d), y = t.config.hooks.redactUrl(a), b = i === "initial_load", x = b && typeof performance < "u" ? performance.timeOrigin : Date.now(), C = b ? qn() : {};
|
|
1805
1774
|
t.setView({
|
|
1806
1775
|
attributes: m,
|
|
1807
1776
|
id: _,
|
|
@@ -1817,12 +1786,12 @@ var Kn = ["stopLoadingTime"], qn = new Set(Object.values(g)), Jn = () => typeof
|
|
|
1817
1786
|
loadingType: i,
|
|
1818
1787
|
name: p,
|
|
1819
1788
|
rawUrl: d,
|
|
1820
|
-
snapshotAttributes: S(S(S(S(S(S({}, m), t.config.hooks.getPageAttributes()), C),
|
|
1789
|
+
snapshotAttributes: S(S(S(S(S(S({}, m), t.config.hooks.getPageAttributes()), C), j({ spanType: A.view })), {}, { [g.viewId]: _ }, p ? { [g.viewName]: p } : {}), {}, {
|
|
1821
1790
|
[g.viewUrl]: v,
|
|
1822
1791
|
[g.viewUrlTemplate]: f,
|
|
1823
1792
|
[g.viewLoadingType]: i,
|
|
1824
|
-
|
|
1825
|
-
}, b ? {
|
|
1793
|
+
[g.viewPrevious]: y
|
|
1794
|
+
}, b && document.referrer ? { [g.viewReferrer]: t.config.hooks.redactUrl(document.referrer) } : {}),
|
|
1826
1795
|
startedAt: x,
|
|
1827
1796
|
url: v,
|
|
1828
1797
|
urlTemplate: f
|
|
@@ -1849,8 +1818,8 @@ var Kn = ["stopLoadingTime"], qn = new Set(Object.values(g)), Jn = () => typeof
|
|
|
1849
1818
|
}), o(n, "update"));
|
|
1850
1819
|
}
|
|
1851
1820
|
}), p = () => {};
|
|
1852
|
-
t.config.view.tracking === "auto" && (n || d({}, "load", "initial_load"), p =
|
|
1853
|
-
|
|
1821
|
+
t.config.view.tracking === "auto" && (n || d({}, "load", "initial_load"), p = Vn((e) => {
|
|
1822
|
+
Xn(e.fromUrl, e.toUrl) && d({}, e.source, "route_change", e.fromUrl);
|
|
1854
1823
|
}));
|
|
1855
1824
|
let m = (e) => {
|
|
1856
1825
|
if (e.persisted) {
|
|
@@ -1892,7 +1861,7 @@ var Kn = ["stopLoadingTime"], qn = new Set(Object.values(g)), Jn = () => typeof
|
|
|
1892
1861
|
}
|
|
1893
1862
|
}
|
|
1894
1863
|
};
|
|
1895
|
-
},
|
|
1864
|
+
}, Qn = 5e3, $n = (e) => typeof e == "number" && Number.isFinite(e) && e > 0, er = (e, t, n, r) => ({
|
|
1896
1865
|
expiresAt: Math.min(t + n, t + r),
|
|
1897
1866
|
id: e,
|
|
1898
1867
|
startedAt: t,
|
|
@@ -1900,19 +1869,19 @@ var Kn = ["stopLoadingTime"], qn = new Set(Object.values(g)), Jn = () => typeof
|
|
|
1900
1869
|
}), X = (e, t, n) => {
|
|
1901
1870
|
if (t >= e.startedAt + n) return "maxLifetime";
|
|
1902
1871
|
if (t >= e.expiresAt) return "inactivity";
|
|
1903
|
-
},
|
|
1872
|
+
}, tr = (e, t, n, r) => S(S({}, e), {}, { expiresAt: Math.min(t + n, e.startedAt + r) }), nr = (e, t, n) => {
|
|
1904
1873
|
if (!e) return null;
|
|
1905
1874
|
try {
|
|
1906
1875
|
let r = JSON.parse(e);
|
|
1907
|
-
if (r.status === "active" && typeof r.id == "string" && r.id.length > 0 &&
|
|
1876
|
+
if (r.status === "active" && typeof r.id == "string" && r.id.length > 0 && $n(r.startedAt) && r.startedAt <= t + Qn && $n(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") && $n(r.expiredAt) && r.expiredAt <= t + Qn) return r;
|
|
1908
1877
|
} catch (e) {}
|
|
1909
1878
|
return null;
|
|
1910
|
-
},
|
|
1879
|
+
}, rr = 900 * 1e3, Z = 14400 * 1e3, ir = 1e3, ar = 6e4, or = [
|
|
1911
1880
|
"click",
|
|
1912
1881
|
"keydown",
|
|
1913
1882
|
"scroll",
|
|
1914
1883
|
"touchstart"
|
|
1915
|
-
],
|
|
1884
|
+
], sr = /* @__PURE__ */ new Map(), cr = (e) => {
|
|
1916
1885
|
let t = typeof window < "u", n = () => {
|
|
1917
1886
|
var n;
|
|
1918
1887
|
if (t) try {
|
|
@@ -1920,21 +1889,21 @@ var Kn = ["stopLoadingTime"], qn = new Set(Object.values(g)), Jn = () => typeof
|
|
|
1920
1889
|
} catch (e) {
|
|
1921
1890
|
t = !1;
|
|
1922
1891
|
}
|
|
1923
|
-
return (n =
|
|
1892
|
+
return (n = sr.get(e)) == null ? null : n;
|
|
1924
1893
|
};
|
|
1925
1894
|
return n(), {
|
|
1926
1895
|
isLocalStorage: () => t,
|
|
1927
1896
|
read: n,
|
|
1928
1897
|
write: (n) => {
|
|
1929
1898
|
let r = JSON.stringify(n);
|
|
1930
|
-
if (
|
|
1899
|
+
if (sr.set(e, r), t) try {
|
|
1931
1900
|
window.localStorage.setItem(e, r);
|
|
1932
1901
|
} catch (e) {
|
|
1933
1902
|
t = !1;
|
|
1934
1903
|
}
|
|
1935
1904
|
}
|
|
1936
1905
|
};
|
|
1937
|
-
},
|
|
1906
|
+
}, lr = (e, t) => {
|
|
1938
1907
|
let n = "";
|
|
1939
1908
|
try {
|
|
1940
1909
|
n = new URL(e).host;
|
|
@@ -1942,19 +1911,17 @@ var Kn = ["stopLoadingTime"], qn = new Set(Object.values(g)), Jn = () => typeof
|
|
|
1942
1911
|
n = e;
|
|
1943
1912
|
}
|
|
1944
1913
|
return `bk_ot_session__${m(`${t}\0${n || "default"}`)}`;
|
|
1945
|
-
},
|
|
1946
|
-
e.startSpan("browser.session", S(S(S({}, e.config.hooks.getPageAttributes()),
|
|
1914
|
+
}, ur = (e, t, n, r) => {
|
|
1915
|
+
e.startSpan("browser.session", S(S(S({}, e.config.hooks.getPageAttributes()), j({ spanType: A.session })), {}, {
|
|
1947
1916
|
[g.sessionPhase]: t,
|
|
1948
1917
|
[g.sessionHasReplay]: !1,
|
|
1949
1918
|
[g.sessionId]: n,
|
|
1950
|
-
[g.
|
|
1951
|
-
|
|
1952
|
-
|
|
1953
|
-
|
|
1954
|
-
|
|
1955
|
-
|
|
1956
|
-
}).end(i);
|
|
1957
|
-
}, pr = (e = {}) => {
|
|
1919
|
+
[g.sessionType]: "user"
|
|
1920
|
+
}), {
|
|
1921
|
+
contextTime: r,
|
|
1922
|
+
startTime: r
|
|
1923
|
+
}).end(r);
|
|
1924
|
+
}, dr = (e = {}) => {
|
|
1958
1925
|
let t = [];
|
|
1959
1926
|
return {
|
|
1960
1927
|
name: "session",
|
|
@@ -1965,44 +1932,41 @@ var Kn = ["stopLoadingTime"], qn = new Set(Object.values(g)), Jn = () => typeof
|
|
|
1965
1932
|
n.setRuntimeAttributes({
|
|
1966
1933
|
[g.sessionHasReplay]: !1,
|
|
1967
1934
|
[g.sessionId]: t,
|
|
1968
|
-
[g.sessionStartTime]: e,
|
|
1969
1935
|
[g.sessionType]: "user"
|
|
1970
1936
|
}, e);
|
|
1971
1937
|
return;
|
|
1972
1938
|
}
|
|
1973
|
-
let i = (r = e.storageKey) == null ?
|
|
1974
|
-
|
|
1975
|
-
},
|
|
1976
|
-
|
|
1977
|
-
|
|
1978
|
-
i && (n.notifySessionLifecycle({
|
|
1939
|
+
let i = (r = e.storageKey) == null ? lr(n.config.transport.endpoint, n.config.application.name) : r, a = cr(i), o = typeof performance < "u" && Number.isFinite(performance.timeOrigin) ? performance.timeOrigin : Date.now(), s, c, l = (e = Date.now()) => nr(a.read(), e, Z), u = () => {
|
|
1940
|
+
c !== void 0 && (clearTimeout(c), c = void 0);
|
|
1941
|
+
}, d = (e, t = Date.now()) => {
|
|
1942
|
+
let r = s;
|
|
1943
|
+
r && (n.notifySessionLifecycle({
|
|
1979
1944
|
expiredAt: t,
|
|
1980
|
-
id:
|
|
1945
|
+
id: r,
|
|
1981
1946
|
reason: e,
|
|
1982
1947
|
type: "expired"
|
|
1983
|
-
}),
|
|
1948
|
+
}), ur(n, "end", r, t), u(), s = void 0, n.setRuntimeAttributes({
|
|
1984
1949
|
[g.sessionHasReplay]: void 0,
|
|
1985
1950
|
[g.sessionId]: void 0,
|
|
1986
|
-
[g.sessionStartTime]: void 0,
|
|
1987
1951
|
[g.sessionType]: void 0
|
|
1988
1952
|
}, t), n.flush());
|
|
1989
|
-
},
|
|
1990
|
-
let e = Date.now(), t =
|
|
1953
|
+
}, f = () => {
|
|
1954
|
+
let e = Date.now(), t = l(e);
|
|
1991
1955
|
if (!t) {
|
|
1992
|
-
|
|
1956
|
+
d("external", e);
|
|
1993
1957
|
return;
|
|
1994
1958
|
}
|
|
1995
1959
|
if (t.status === "expired") {
|
|
1996
|
-
|
|
1960
|
+
d(t.reason, t.expiredAt);
|
|
1997
1961
|
return;
|
|
1998
1962
|
}
|
|
1999
1963
|
if (t.id !== s) {
|
|
2000
|
-
|
|
1964
|
+
d("external", e);
|
|
2001
1965
|
return;
|
|
2002
1966
|
}
|
|
2003
1967
|
let n = X(t, e, Z);
|
|
2004
1968
|
if (!n) {
|
|
2005
|
-
|
|
1969
|
+
p(t);
|
|
2006
1970
|
return;
|
|
2007
1971
|
}
|
|
2008
1972
|
let r = {
|
|
@@ -2011,153 +1975,138 @@ var Kn = ["stopLoadingTime"], qn = new Set(Object.values(g)), Jn = () => typeof
|
|
|
2011
1975
|
reason: n,
|
|
2012
1976
|
status: "expired"
|
|
2013
1977
|
};
|
|
2014
|
-
a.write(r),
|
|
2015
|
-
},
|
|
2016
|
-
|
|
1978
|
+
a.write(r), d(n, e);
|
|
1979
|
+
}, p = (e) => {
|
|
1980
|
+
u();
|
|
2017
1981
|
let t = Math.min(e.expiresAt, e.startedAt + Z);
|
|
2018
|
-
|
|
2019
|
-
},
|
|
1982
|
+
c = setTimeout(f, Math.max(0, t - Date.now()));
|
|
1983
|
+
}, m = (e, t) => {
|
|
2020
1984
|
let r = e.id !== s;
|
|
2021
|
-
s = e.id,
|
|
1985
|
+
s = e.id, n.setRuntimeAttributes({
|
|
2022
1986
|
[g.sessionHasReplay]: !1,
|
|
2023
1987
|
[g.sessionId]: e.id,
|
|
2024
|
-
[g.sessionStartTime]: e.startedAt,
|
|
2025
1988
|
[g.sessionType]: "user"
|
|
2026
|
-
}, Math.min(e.startedAt, o)),
|
|
1989
|
+
}, Math.min(e.startedAt, o)), p(e), r && t && n.notifySessionLifecycle({
|
|
2027
1990
|
id: e.id,
|
|
2028
1991
|
previousId: t.previousId,
|
|
2029
1992
|
reason: t.reason,
|
|
2030
1993
|
startedAt: e.startedAt,
|
|
2031
1994
|
type: "renewed"
|
|
2032
1995
|
});
|
|
2033
|
-
},
|
|
2034
|
-
let t = Date.now(), r =
|
|
1996
|
+
}, _ = (e = !1) => {
|
|
1997
|
+
let t = Date.now(), r = l(t);
|
|
2035
1998
|
if ((r == null ? void 0 : r.status) === "active" && !X(r, t, Z)) {
|
|
2036
|
-
let e =
|
|
2037
|
-
a.write(e),
|
|
1999
|
+
let e = tr(r, t, rr, Z);
|
|
2000
|
+
a.write(e), m(e, s ? void 0 : { reason: "shared" });
|
|
2038
2001
|
return;
|
|
2039
2002
|
}
|
|
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),
|
|
2003
|
+
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 = er(h("session"), t, rr, Z);
|
|
2004
|
+
a.write(c), m(c, {
|
|
2042
2005
|
previousId: i,
|
|
2043
2006
|
reason: o == null ? "init" : o
|
|
2044
|
-
});
|
|
2045
|
-
|
|
2046
|
-
fr(n, l === "init" ? "start" : "rotate", c.id, c.startedAt, c.startedAt, l, i);
|
|
2047
|
-
}, y = () => {
|
|
2007
|
+
}), ur(n, (o == null ? "init" : o) === "init" ? "start" : "rotate", c.id, c.startedAt);
|
|
2008
|
+
}, v = () => {
|
|
2048
2009
|
if (!s) return;
|
|
2049
|
-
let e = Date.now(), t =
|
|
2010
|
+
let e = Date.now(), t = l(e);
|
|
2050
2011
|
if ((t == null ? void 0 : t.status) !== "active" || t.id !== s || X(t, e, Z)) {
|
|
2051
|
-
|
|
2012
|
+
f();
|
|
2052
2013
|
return;
|
|
2053
2014
|
}
|
|
2054
|
-
let n =
|
|
2055
|
-
a.write(n),
|
|
2015
|
+
let n = tr(t, e, rr, Z);
|
|
2016
|
+
a.write(n), m(n);
|
|
2056
2017
|
};
|
|
2057
|
-
|
|
2058
|
-
let
|
|
2018
|
+
_(!0);
|
|
2019
|
+
let y = 0, b = () => {
|
|
2059
2020
|
let e = Date.now();
|
|
2060
|
-
e -
|
|
2061
|
-
},
|
|
2021
|
+
e - y < ir || (y = e, _());
|
|
2022
|
+
}, x = {
|
|
2062
2023
|
capture: !0,
|
|
2063
2024
|
passive: !0
|
|
2064
2025
|
};
|
|
2065
|
-
|
|
2066
|
-
|
|
2026
|
+
or.forEach((e) => window.addEventListener(e, b, x)), t.push(() => {
|
|
2027
|
+
or.forEach((e) => window.removeEventListener(e, b, x));
|
|
2067
2028
|
});
|
|
2068
|
-
let
|
|
2069
|
-
document.visibilityState === "visible" &&
|
|
2029
|
+
let S = () => {
|
|
2030
|
+
document.visibilityState === "visible" && v();
|
|
2070
2031
|
};
|
|
2071
|
-
document.addEventListener("visibilitychange",
|
|
2072
|
-
let
|
|
2032
|
+
document.addEventListener("visibilitychange", S);
|
|
2033
|
+
let C = window.setInterval(S, ar);
|
|
2073
2034
|
t.push(() => {
|
|
2074
|
-
document.removeEventListener("visibilitychange",
|
|
2035
|
+
document.removeEventListener("visibilitychange", S), window.clearInterval(C);
|
|
2075
2036
|
});
|
|
2076
|
-
let
|
|
2037
|
+
let w = (e) => {
|
|
2077
2038
|
if (!a.isLocalStorage() || e.storageArea !== window.localStorage || e.key !== i) return;
|
|
2078
|
-
let t = Date.now(), n =
|
|
2039
|
+
let t = Date.now(), n = nr(e.newValue, t, Z);
|
|
2079
2040
|
if ((n == null ? void 0 : n.status) === "active" && n.id === s && !X(n, t, Z)) {
|
|
2080
|
-
|
|
2041
|
+
p(n);
|
|
2081
2042
|
return;
|
|
2082
2043
|
}
|
|
2083
|
-
|
|
2044
|
+
d((n == null ? void 0 : n.status) === "expired" ? n.reason : "external", (n == null ? void 0 : n.status) === "expired" ? n.expiredAt : t);
|
|
2084
2045
|
};
|
|
2085
|
-
window.addEventListener("storage",
|
|
2046
|
+
window.addEventListener("storage", w), t.push(() => window.removeEventListener("storage", w)), t.push(u);
|
|
2086
2047
|
},
|
|
2087
2048
|
shutdown() {
|
|
2088
2049
|
for (var e; t.length;) (e = t.pop()) == null || e();
|
|
2089
2050
|
}
|
|
2090
2051
|
};
|
|
2091
|
-
},
|
|
2052
|
+
}, fr = 10, pr = 6e4, mr = 5e3, hr = 1e3, gr = (e, t) => !!t && e === t, _r = (e, t) => {
|
|
2092
2053
|
let [n, r] = e === "CLS" ? [.1, .25] : [200, 500];
|
|
2093
2054
|
return t <= n ? "good" : t <= r ? "needs-improvement" : "poor";
|
|
2094
|
-
},
|
|
2055
|
+
}, vr = (e) => {
|
|
2095
2056
|
var t, n, r;
|
|
2096
2057
|
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
|
-
},
|
|
2058
|
+
}, yr = () => {
|
|
2098
2059
|
if (typeof performance > "u") return;
|
|
2099
2060
|
let e = performance.interactionCount;
|
|
2100
2061
|
return typeof e == "number" && Number.isFinite(e) ? e : void 0;
|
|
2101
|
-
},
|
|
2062
|
+
}, br = (e, t) => {
|
|
2102
2063
|
var n, r;
|
|
2103
2064
|
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) => {
|
|
2065
|
+
t.hadRecentInput || !Number.isFinite(i) || (e.clsWindowStart === void 0 || t.startTime - ((r = e.clsWindowEnd) == null ? t.startTime : r) >= hr || t.startTime - e.clsWindowStart >= mr ? (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));
|
|
2066
|
+
}, xr = (e, t) => {
|
|
2115
2067
|
var n, r;
|
|
2116
2068
|
if (!t.interactionId || !Number.isFinite(t.duration)) return;
|
|
2117
2069
|
e.interactionIdMin = Math.min(e.interactionIdMin, t.interactionId), e.interactionIdMax = Math.max(e.interactionIdMax, t.interactionId);
|
|
2118
2070
|
let i = (n = t.processingStart) == null ? t.startTime : n, a = (r = t.processingEnd) == null ? i : r, o = {
|
|
2119
|
-
duration: Math.min(t.duration,
|
|
2071
|
+
duration: Math.min(t.duration, pr),
|
|
2120
2072
|
inputDelay: Math.max(0, i - t.startTime),
|
|
2121
2073
|
interactionId: t.interactionId,
|
|
2122
|
-
interactionTarget:
|
|
2074
|
+
interactionTarget: vr(t.target),
|
|
2123
2075
|
interactionType: t.name,
|
|
2124
2076
|
presentationDelay: Math.max(0, t.startTime + t.duration - a),
|
|
2125
2077
|
processingDuration: Math.max(0, a - i)
|
|
2126
2078
|
}, 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 =
|
|
2079
|
+
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(fr);
|
|
2080
|
+
}, Sr = (e) => {
|
|
2081
|
+
let t = yr(), 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
2082
|
if (e.inpCandidates.length) return e.inpCandidates[Math.min(e.inpCandidates.length - 1, Math.floor(n / 50))];
|
|
2131
|
-
},
|
|
2083
|
+
}, Cr = (e, t) => {
|
|
2132
2084
|
var n;
|
|
2133
2085
|
let r = (n = e.attribution) == null ? {} : n, i = {}, a = (e) => r[e], o = (e, t, n) => {
|
|
2134
2086
|
t != null && (typeof t == "string" || typeof t == "number" || typeof t == "boolean") && (i[e] = typeof t == "string" && n ? n(t) : t);
|
|
2135
2087
|
};
|
|
2136
2088
|
switch (e.name) {
|
|
2137
2089
|
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"))
|
|
2090
|
+
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
2091
|
break;
|
|
2140
2092
|
case "CLS":
|
|
2141
|
-
o("vital.cls.
|
|
2093
|
+
o("vital.cls.load_state", a("loadState"));
|
|
2142
2094
|
break;
|
|
2143
2095
|
case "INP":
|
|
2144
2096
|
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
2097
|
break;
|
|
2146
|
-
case "FCP":
|
|
2147
|
-
o("vital.fcp.time_to_first_byte", a("timeToFirstByte")), o("vital.fcp.load_state", a("loadState"));
|
|
2148
|
-
break;
|
|
2149
2098
|
case "TTFB":
|
|
2150
2099
|
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
2100
|
break;
|
|
2152
2101
|
default: break;
|
|
2153
2102
|
}
|
|
2154
2103
|
return i;
|
|
2155
|
-
},
|
|
2104
|
+
}, wr = () => {
|
|
2156
2105
|
let e, t = !1;
|
|
2157
2106
|
return {
|
|
2158
2107
|
name: "web-vitals",
|
|
2159
2108
|
init(n) {
|
|
2160
|
-
return
|
|
2109
|
+
return O(function* () {
|
|
2161
2110
|
if (typeof window > "u") return;
|
|
2162
2111
|
let r;
|
|
2163
2112
|
try {
|
|
@@ -2173,15 +2122,14 @@ var Kn = ["stopLoadingTime"], qn = new Set(Object.values(g)), Jn = () => typeof
|
|
|
2173
2122
|
let { onFCP: a, onLCP: o, onTTFB: s } = r, c = (e, t, r, i = r == null ? Date.now() : r) => {
|
|
2174
2123
|
if (!n.isSampled()) return;
|
|
2175
2124
|
let a = e.name.toLowerCase();
|
|
2176
|
-
n.startSpan("browser.web_vital", S(S(S(S({}, n.config.hooks.getPageAttributes()), t),
|
|
2125
|
+
n.startSpan("browser.web_vital", S(S(S(S({}, n.config.hooks.getPageAttributes()), t), j({
|
|
2177
2126
|
outcome: Je(e.rating),
|
|
2178
|
-
spanType:
|
|
2127
|
+
spanType: A.vital
|
|
2179
2128
|
})), {}, {
|
|
2180
2129
|
[g.vitalMetric]: a,
|
|
2181
2130
|
[g.vitalValue]: e.value,
|
|
2182
|
-
[g.vitalRating]: e.rating,
|
|
2183
2131
|
"vital.id": e.id
|
|
2184
|
-
},
|
|
2132
|
+
}, Cr(e, n.config.hooks.redactUrl)), {
|
|
2185
2133
|
contextTime: r,
|
|
2186
2134
|
startTime: i
|
|
2187
2135
|
}).end(i);
|
|
@@ -2195,17 +2143,14 @@ var Kn = ["stopLoadingTime"], qn = new Set(Object.values(g)), Jn = () => typeof
|
|
|
2195
2143
|
let e = u;
|
|
2196
2144
|
if (!e || !n.isSampled()) return;
|
|
2197
2145
|
p({
|
|
2198
|
-
attribution: {
|
|
2199
|
-
largestShiftTarget: e.largestShiftTarget,
|
|
2200
|
-
largestShiftValue: e.largestShiftValue
|
|
2201
|
-
},
|
|
2146
|
+
attribution: {},
|
|
2202
2147
|
entries: [],
|
|
2203
2148
|
id: h("vital"),
|
|
2204
2149
|
name: "CLS",
|
|
2205
|
-
rating:
|
|
2150
|
+
rating: _r("CLS", e.cls),
|
|
2206
2151
|
value: e.cls
|
|
2207
2152
|
}, e.runtimeAttributes, e.startedAt);
|
|
2208
|
-
let t =
|
|
2153
|
+
let t = Sr(e);
|
|
2209
2154
|
t && p({
|
|
2210
2155
|
attribution: {
|
|
2211
2156
|
inputDelay: t.inputDelay,
|
|
@@ -2217,13 +2162,13 @@ var Kn = ["stopLoadingTime"], qn = new Set(Object.values(g)), Jn = () => typeof
|
|
|
2217
2162
|
entries: [],
|
|
2218
2163
|
id: h("vital"),
|
|
2219
2164
|
name: "INP",
|
|
2220
|
-
rating:
|
|
2165
|
+
rating: _r("INP", t.duration),
|
|
2221
2166
|
value: t.duration
|
|
2222
2167
|
}, e.runtimeAttributes, e.startedAt);
|
|
2223
2168
|
}, _ = n.onViewChange((e) => {
|
|
2224
2169
|
var t;
|
|
2225
2170
|
let r = u;
|
|
2226
|
-
if (r &&
|
|
2171
|
+
if (r && gr(r.id, e.id)) {
|
|
2227
2172
|
r.runtimeAttributes = S(S(S({}, r.runtimeAttributes), {}, { [g.viewId]: e.id }, e.name ? { [g.viewName]: e.name } : {}), {}, {
|
|
2228
2173
|
[g.viewUrl]: e.url,
|
|
2229
2174
|
[g.viewUrlTemplate]: e.urlTemplate
|
|
@@ -2232,14 +2177,12 @@ var Kn = ["stopLoadingTime"], qn = new Set(Object.values(g)), Jn = () => typeof
|
|
|
2232
2177
|
}
|
|
2233
2178
|
m(), u = e.id ? {
|
|
2234
2179
|
cls: 0,
|
|
2235
|
-
clsWindowLargestShiftValue: 0,
|
|
2236
2180
|
clsWindowValue: 0,
|
|
2237
|
-
interactionCountAtStart:
|
|
2181
|
+
interactionCountAtStart: yr(),
|
|
2238
2182
|
interactionIdMax: 0,
|
|
2239
2183
|
interactionIdMin: Infinity,
|
|
2240
2184
|
inpCandidates: [],
|
|
2241
2185
|
id: e.id,
|
|
2242
|
-
largestShiftValue: 0,
|
|
2243
2186
|
runtimeAttributes: n.getRuntimeAttributes(),
|
|
2244
2187
|
startedAt: (t = e.startedAt) == null ? Date.now() : t
|
|
2245
2188
|
} : void 0;
|
|
@@ -2247,12 +2190,12 @@ var Kn = ["stopLoadingTime"], qn = new Set(Object.values(g)), Jn = () => typeof
|
|
|
2247
2190
|
if (typeof PerformanceObserver < "u") {
|
|
2248
2191
|
var v, y;
|
|
2249
2192
|
(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 ||
|
|
2193
|
+
if (u) for (let t of e.getEntries()) performance.timeOrigin + t.startTime < u.startedAt || br(u, t);
|
|
2251
2194
|
}), f.observe({
|
|
2252
2195
|
buffered: !0,
|
|
2253
2196
|
type: "layout-shift"
|
|
2254
2197
|
})), (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) ||
|
|
2198
|
+
if (u) for (let t of e.getEntries()) performance.timeOrigin + t.startTime < u.startedAt || !t.interactionId || !Number.isFinite(t.duration) || xr(u, t);
|
|
2256
2199
|
}), d.observe({
|
|
2257
2200
|
buffered: !0,
|
|
2258
2201
|
durationThreshold: 40,
|
|
@@ -2268,7 +2211,7 @@ var Kn = ["stopLoadingTime"], qn = new Set(Object.values(g)), Jn = () => typeof
|
|
|
2268
2211
|
t = !0, e == null || e(), e = void 0;
|
|
2269
2212
|
}
|
|
2270
2213
|
};
|
|
2271
|
-
},
|
|
2214
|
+
}, Tr = (e, t) => {
|
|
2272
2215
|
let n = {
|
|
2273
2216
|
"network.protocol.name": "websocket",
|
|
2274
2217
|
"url.full": t(e)
|
|
@@ -2278,14 +2221,13 @@ var Kn = ["stopLoadingTime"], qn = new Set(Object.values(g)), Jn = () => typeof
|
|
|
2278
2221
|
n["server.address"] = t.hostname, t.port && (n["server.port"] = Number(t.port)), n["url.scheme"] = t.protocol.replace(":", "");
|
|
2279
2222
|
} catch (e) {}
|
|
2280
2223
|
return n;
|
|
2281
|
-
},
|
|
2282
|
-
let a = h("websocket"), o =
|
|
2224
|
+
}, Er = (t, n, r, i) => {
|
|
2225
|
+
let a = h("websocket"), o = Tr(r, n.config.hooks.redactUrl), s = !1, c = (t, r, s = {}) => {
|
|
2283
2226
|
if (i() || !n.isSampled()) return;
|
|
2284
2227
|
let c = t === "error";
|
|
2285
|
-
n.startSpan("browser.websocket", S(S(S({}, o),
|
|
2286
|
-
outcome: c ?
|
|
2287
|
-
|
|
2288
|
-
spanType: j.websocket
|
|
2228
|
+
n.startSpan("browser.websocket", S(S(S({}, o), j({
|
|
2229
|
+
outcome: c ? k.error : k.success,
|
|
2230
|
+
spanType: A.websocket
|
|
2289
2231
|
})), {}, {
|
|
2290
2232
|
[g.websocketPhase]: t,
|
|
2291
2233
|
"websocket.connection.id": a
|
|
@@ -2305,7 +2247,7 @@ var Kn = ["stopLoadingTime"], qn = new Set(Object.values(g)), Jn = () => typeof
|
|
|
2305
2247
|
"websocket.close.was_clean": e.wasClean
|
|
2306
2248
|
});
|
|
2307
2249
|
});
|
|
2308
|
-
},
|
|
2250
|
+
}, Dr = () => {
|
|
2309
2251
|
let e, t, n = !1;
|
|
2310
2252
|
return {
|
|
2311
2253
|
name: "websocket",
|
|
@@ -2316,29 +2258,29 @@ var Kn = ["stopLoadingTime"], qn = new Set(Object.values(g)), Jn = () => typeof
|
|
|
2316
2258
|
let a = Reflect.construct(e, t, i);
|
|
2317
2259
|
if (n || !r.isSampled()) return a;
|
|
2318
2260
|
let o = t[0] == null ? "" : String(t[0]);
|
|
2319
|
-
return o && !
|
|
2261
|
+
return o && !he(r.config, o) && Er(a, r, o, () => n), a;
|
|
2320
2262
|
} }), window.WebSocket = t;
|
|
2321
2263
|
},
|
|
2322
2264
|
shutdown() {
|
|
2323
2265
|
n = !0, typeof window < "u" && e && window.WebSocket === t && (window.WebSocket = e), t = void 0, e = void 0;
|
|
2324
2266
|
}
|
|
2325
2267
|
};
|
|
2326
|
-
},
|
|
2268
|
+
}, Or = class {
|
|
2327
2269
|
constructor() {
|
|
2328
2270
|
b(this, "listeners", /* @__PURE__ */ new Set()), b(this, "notify", (e) => {
|
|
2329
2271
|
this.listeners.forEach((t) => t(e));
|
|
2330
2272
|
}), b(this, "subscribe", (e) => (this.listeners.add(e), () => this.listeners.delete(e)));
|
|
2331
2273
|
}
|
|
2332
|
-
},
|
|
2274
|
+
}, kr = (e) => {
|
|
2333
2275
|
let t = 2166136261;
|
|
2334
2276
|
for (let n = 0; n < e.length; n += 1) t = Math.imul(t ^ e.charCodeAt(n), 16777619);
|
|
2335
2277
|
return t += t << 13, t ^= t >>> 7, t += t << 3, t ^= t >>> 17, t += t << 5, (t >>> 0) / 4294967296;
|
|
2336
|
-
},
|
|
2278
|
+
}, Ar = ({ application: e, session: t }, n) => t.sampleRate <= 0 ? !1 : t.sampleRate >= 1 ? !0 : kr(`${e.name}\0${n}`) < t.sampleRate, jr = (e) => ({
|
|
2337
2279
|
url: e.endpoint,
|
|
2338
2280
|
headers: e.headers,
|
|
2339
2281
|
concurrencyLimit: e.concurrencyLimit,
|
|
2340
2282
|
timeoutMillis: e.timeoutMillis
|
|
2341
|
-
}),
|
|
2283
|
+
}), Mr = "bk-rum", Nr = class {
|
|
2342
2284
|
constructor(e) {
|
|
2343
2285
|
this.isSampled = e;
|
|
2344
2286
|
}
|
|
@@ -2348,7 +2290,7 @@ var Kn = ["stopLoadingTime"], qn = new Set(Object.values(g)), Jn = () => typeof
|
|
|
2348
2290
|
toString() {
|
|
2349
2291
|
return "RumSessionSampler";
|
|
2350
2292
|
}
|
|
2351
|
-
}, Q,
|
|
2293
|
+
}, Q, Pr = () => {
|
|
2352
2294
|
if (Q) Q.users += 1;
|
|
2353
2295
|
else {
|
|
2354
2296
|
let e = new a().enable(), t = r.setGlobalContextManager(e);
|
|
@@ -2363,28 +2305,28 @@ var Kn = ["stopLoadingTime"], qn = new Set(Object.values(g)), Jn = () => typeof
|
|
|
2363
2305
|
return () => {
|
|
2364
2306
|
e || !Q || (e = !0, --Q.users, !(Q.users > 0) && (Q.ownsContext && r.disable(), Q.ownsPropagator && i.disable(), Q = void 0));
|
|
2365
2307
|
};
|
|
2366
|
-
},
|
|
2308
|
+
}, Fr = (e, t) => t ? new Proxy(e, { get(e, t, n) {
|
|
2367
2309
|
if (t === "export") return (t, n) => {
|
|
2368
2310
|
var r;
|
|
2369
2311
|
return (r = globalThis.console) == null || r.log("[bk-ot][rum]", t), e.export(t, n);
|
|
2370
2312
|
};
|
|
2371
2313
|
let r = Reflect.get(e, t, n);
|
|
2372
2314
|
return typeof r == "function" ? r.bind(e) : r;
|
|
2373
|
-
} }) : e,
|
|
2374
|
-
|
|
2315
|
+
} }) : e, Ir = (e) => [wn(e.tracking.request)], Lr = (e) => [
|
|
2316
|
+
dr(e.session),
|
|
2375
2317
|
...$(e.tracking.device, !0, ce),
|
|
2376
2318
|
gt(),
|
|
2377
|
-
|
|
2378
|
-
|
|
2379
|
-
],
|
|
2380
|
-
...$(e.error, !0,
|
|
2381
|
-
...$(e.webVitals, !0,
|
|
2382
|
-
...$(e.blankScreen, !0,
|
|
2319
|
+
Zn(),
|
|
2320
|
+
on(Rr(e.tracking.resource, !0))
|
|
2321
|
+
], Rr = (e, t) => e === void 0 ? t : e !== !1, zr = (e) => typeof e == "object" && e ? e : void 0, $ = (e, t, n) => Rr(e, t) ? [n(zr(e))] : [], Br = (e) => [
|
|
2322
|
+
...$(e.error, !0, An),
|
|
2323
|
+
...$(e.webVitals, !0, wr),
|
|
2324
|
+
...$(e.blankScreen, !0, jt),
|
|
2383
2325
|
...$(e.action, !0, pt),
|
|
2384
|
-
...$(e.websocket, !1,
|
|
2385
|
-
...$(e.longTask, !1,
|
|
2386
|
-
...$(e.cspViolation, !1,
|
|
2387
|
-
],
|
|
2326
|
+
...$(e.websocket, !1, Dr),
|
|
2327
|
+
...$(e.longTask, !1, Fn),
|
|
2328
|
+
...$(e.cspViolation, !1, Dn)
|
|
2329
|
+
], Vr = class {
|
|
2388
2330
|
assertBeforeStart(e) {
|
|
2389
2331
|
if (this.phase !== "idle") throw Error(`[bk-ot] ${e}() must be called before start(); set autoStart: false before registration.`);
|
|
2390
2332
|
}
|
|
@@ -2414,20 +2356,20 @@ var Kn = ["stopLoadingTime"], qn = new Set(Object.values(g)), Jn = () => typeof
|
|
|
2414
2356
|
}
|
|
2415
2357
|
createPluginManager() {
|
|
2416
2358
|
var e;
|
|
2417
|
-
return new
|
|
2418
|
-
...
|
|
2419
|
-
...
|
|
2420
|
-
...
|
|
2359
|
+
return new Ie([
|
|
2360
|
+
...Lr(this.config),
|
|
2361
|
+
...Ir(this.config),
|
|
2362
|
+
...Br(this.config.tracking),
|
|
2421
2363
|
...(e = this.config.extensions.plugins) == null ? [] : e
|
|
2422
2364
|
]);
|
|
2423
2365
|
}
|
|
2424
2366
|
constructor(n) {
|
|
2425
2367
|
var r = this;
|
|
2426
|
-
b(this, "activityObserver", new
|
|
2368
|
+
b(this, "activityObserver", new Or()), b(this, "flushProviders", O(function* () {
|
|
2427
2369
|
yield r.tracerProvider.forceFlush();
|
|
2428
|
-
})), 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",
|
|
2370
|
+
})), 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", O(function* () {
|
|
2429
2371
|
if (r.pluginManager || !r.config.enabled || r.config.trackingConsent !== "granted") return;
|
|
2430
|
-
r.releaseOtelGlobals =
|
|
2372
|
+
r.releaseOtelGlobals = Pr();
|
|
2431
2373
|
let e = r.createPluginManager();
|
|
2432
2374
|
r.pluginManager = e;
|
|
2433
2375
|
try {
|
|
@@ -2439,7 +2381,7 @@ var Kn = ["stopLoadingTime"], qn = new Set(Object.values(g)), Jn = () => typeof
|
|
|
2439
2381
|
throw (a = r.releaseOtelGlobals) == null || a.call(r), r.releaseOtelGlobals = void 0, t;
|
|
2440
2382
|
}
|
|
2441
2383
|
})), b(this, "stopCollection", function() {
|
|
2442
|
-
var e =
|
|
2384
|
+
var e = O(function* (e) {
|
|
2443
2385
|
var t, n, i;
|
|
2444
2386
|
let a = r.pluginManager;
|
|
2445
2387
|
if (a) {
|
|
@@ -2453,7 +2395,7 @@ var Kn = ["stopLoadingTime"], qn = new Set(Object.values(g)), Jn = () => typeof
|
|
|
2453
2395
|
return function(t) {
|
|
2454
2396
|
return e.apply(this, arguments);
|
|
2455
2397
|
};
|
|
2456
|
-
}()), b(this, "teardownCallbacks", []), b(this, "tracerProvider", void 0), b(this, "applyRedact", (e) => this.config.hooks.redactAttributes(e)), b(this, "config", void 0), b(this, "flush",
|
|
2398
|
+
}()), b(this, "teardownCallbacks", []), b(this, "tracerProvider", void 0), b(this, "applyRedact", (e) => this.config.hooks.redactAttributes(e)), b(this, "config", void 0), b(this, "flush", O(function* () {
|
|
2457
2399
|
var e;
|
|
2458
2400
|
yield (e = r.pluginManager) == null ? void 0 : e.flush(), yield r.flushProviders();
|
|
2459
2401
|
})), b(this, "getRuntimeAttributes", () => this.runtimeContext.getAttributes()), b(this, "getRuntimeAttributesAt", (e) => this.runtimeContext.getAttributesAt(e)), b(this, "isSampled", () => this.sampled), b(this, "isSessionActive", () => this.runtimeContext.isSessionActive()), b(this, "isViewActive", () => this.runtimeContext.isViewActive()), b(this, "notifySessionLifecycle", (e) => {
|
|
@@ -2465,9 +2407,8 @@ var Kn = ["stopLoadingTime"], qn = new Set(Object.values(g)), Jn = () => typeof
|
|
|
2465
2407
|
}), b(this, "reportAction", ({ attributes: e = {}, name: t }) => {
|
|
2466
2408
|
if (!this.isSampled()) return;
|
|
2467
2409
|
let n = h("action"), r = Date.now();
|
|
2468
|
-
this.startSpan(
|
|
2410
|
+
this.startSpan(`action.${t}`, S(S(S(S({}, this.config.hooks.getPageAttributes()), e), j({ spanType: A.action })), {}, {
|
|
2469
2411
|
[g.actionId]: n,
|
|
2470
|
-
[g.actionName]: t,
|
|
2471
2412
|
[g.actionType]: "custom"
|
|
2472
2413
|
}), { startTime: r }).end(r);
|
|
2473
2414
|
}), b(this, "reportCustomEvent", ({ attributes: e = {}, error: n, name: r }) => {
|
|
@@ -2478,9 +2419,9 @@ var Kn = ["stopLoadingTime"], qn = new Set(Object.values(g)), Jn = () => typeof
|
|
|
2478
2419
|
}
|
|
2479
2420
|
return;
|
|
2480
2421
|
}
|
|
2481
|
-
let a = Date.now(), o = this.startSpan(`custom.${r}`, S(S(S(S({}, this.config.hooks.getPageAttributes()), this.config.hooks.getCustomAttributes()), e),
|
|
2482
|
-
outcome: n ?
|
|
2483
|
-
spanType:
|
|
2422
|
+
let a = Date.now(), o = this.startSpan(`custom.${r}`, S(S(S(S({}, this.config.hooks.getPageAttributes()), this.config.hooks.getCustomAttributes()), e), j({
|
|
2423
|
+
outcome: n ? k.error : k.success,
|
|
2424
|
+
spanType: A.custom
|
|
2484
2425
|
})), { startTime: a });
|
|
2485
2426
|
n && (o.recordException(n), o.setStatus({
|
|
2486
2427
|
code: t.ERROR,
|
|
@@ -2490,11 +2431,11 @@ var Kn = ["stopLoadingTime"], qn = new Set(Object.values(g)), Jn = () => typeof
|
|
|
2490
2431
|
let n = S({}, e), r = t == null ? Date.now() : t;
|
|
2491
2432
|
if (g.sessionId in e) {
|
|
2492
2433
|
let t = e[g.sessionId];
|
|
2493
|
-
this.sampled = this.config.enabled && typeof t == "string" && t.length > 0 ?
|
|
2434
|
+
this.sampled = this.config.enabled && typeof t == "string" && t.length > 0 ? Ar(this.config, t) : !1, this.runtimeContext.setSessionSampled(this.sampled, r);
|
|
2494
2435
|
}
|
|
2495
2436
|
this.runtimeContext.setAttributes(n, r);
|
|
2496
2437
|
}), b(this, "setTrackingConsent", function() {
|
|
2497
|
-
var e =
|
|
2438
|
+
var e = O(function* (e) {
|
|
2498
2439
|
r.config.trackingConsent !== e && (r.config.trackingConsent = e, r.phase === "started" && (e === "granted" ? yield r.startCollection() : yield r.stopCollection(!0)));
|
|
2499
2440
|
});
|
|
2500
2441
|
return function(t) {
|
|
@@ -2512,7 +2453,7 @@ var Kn = ["stopLoadingTime"], qn = new Set(Object.values(g)), Jn = () => typeof
|
|
|
2512
2453
|
name: e,
|
|
2513
2454
|
type: "set_name"
|
|
2514
2455
|
});
|
|
2515
|
-
}), b(this, "shutdown",
|
|
2456
|
+
}), b(this, "shutdown", O(function* () {
|
|
2516
2457
|
if (r.phase !== "stopped") {
|
|
2517
2458
|
for (yield r.stopCollection(!1), yield r.flushProviders(); r.teardownCallbacks.length;) {
|
|
2518
2459
|
var e;
|
|
@@ -2520,7 +2461,7 @@ var Kn = ["stopLoadingTime"], qn = new Set(Object.values(g)), Jn = () => typeof
|
|
|
2520
2461
|
}
|
|
2521
2462
|
yield r.tracerProvider.shutdown(), r.phase = "stopped";
|
|
2522
2463
|
}
|
|
2523
|
-
})), b(this, "start",
|
|
2464
|
+
})), b(this, "start", O(function* () {
|
|
2524
2465
|
if (!(r.phase === "started" || r.phase === "starting")) {
|
|
2525
2466
|
if (r.phase === "stopped") throw Error("[bk-ot] instance has been shut down and cannot be restarted; create a new instance instead.");
|
|
2526
2467
|
if (!r.config.enabled) {
|
|
@@ -2568,20 +2509,20 @@ var Kn = ["stopLoadingTime"], qn = new Set(Object.values(g)), Jn = () => typeof
|
|
|
2568
2509
|
}), b(this, "useInstrumentation", (e) => {
|
|
2569
2510
|
var t;
|
|
2570
2511
|
return this.assertBeforeStart("useInstrumentation"), this.config.enabled && ((t = this.config.extensions.instrumentations) == null || t.push(e)), this;
|
|
2571
|
-
}), this.config =
|
|
2512
|
+
}), this.config = Me(n), this.runtimeContext = new Ke({}, this.config.user);
|
|
2572
2513
|
let i = c(this.config.resourceAttributes), a = (() => {
|
|
2573
|
-
let e =
|
|
2574
|
-
return [new
|
|
2514
|
+
let e = Fr(new s(jr(this.config.transport)), this.config.debug);
|
|
2515
|
+
return [new We(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
2516
|
})();
|
|
2576
2517
|
this.tracerProvider = new f({
|
|
2577
2518
|
resource: i,
|
|
2578
|
-
sampler: new
|
|
2519
|
+
sampler: new Nr(this.isSampled),
|
|
2579
2520
|
spanProcessors: a
|
|
2580
|
-
}), this.tracer = this.tracerProvider.getTracer(
|
|
2521
|
+
}), this.tracer = this.tracerProvider.getTracer(Mr), this.registeredInstrumentations = [], this.config.autoStart && this.start().catch((e) => {
|
|
2581
2522
|
var t;
|
|
2582
2523
|
(t = globalThis.console) == null || t.warn("[bk-ot] auto start failed:", e);
|
|
2583
2524
|
});
|
|
2584
2525
|
}
|
|
2585
2526
|
};
|
|
2586
2527
|
//#endregion
|
|
2587
|
-
export {
|
|
2528
|
+
export { Vr as BkOpenTelemetry, mt as EXCLUDED_ACTIVITY_MUTATIONS_ATTRIBUTE, We as FilteringSpanProcessor, g as RUM_ATTRIBUTES, k as RUM_SPAN_OUTCOME, A as RUM_SPAN_TYPE, Ke as RumRuntimeContext, j as buildRumSpanAttributes, pt as createActionPlugin, jt as createBlankScreenPlugin, wn as createCommonInstrumentationsPlugin, Dn as createCspViolationPlugin, ce as createDevicePlugin, An as createErrorPlugin, Fn as createLongTaskPlugin, Fe as createPlugin, on as createResourcePlugin, dr as createSessionPlugin, Dr as createWebSocketPlugin, wr as createWebVitalsPlugin, Me as resolveConfig };
|