@blueking/open-telemetry 0.0.27 → 0.0.29
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +3 -3
- package/dist/bk-rum.global.js +1 -1
- package/dist/bk-rum.global.js.map +1 -1
- package/dist/core/config.d.ts +7 -4
- package/dist/core/runtime-context.d.ts +1 -1
- package/dist/core/url.d.ts +5 -0
- package/dist/index.js +430 -420
- package/dist/index.js.map +1 -1
- package/dist/schema/attributes.d.ts +1 -1
- package/package.json +1 -1
- package/skills/bk-rum-otele/SKILL.md +1 -1
- package/skills/bk-rum-otele/evals/evals.json +1 -1
- package/skills/bk-rum-otele/references/api.md +1 -1
- package/skills/bk-rum-otele/references/architecture.md +1 -1
- package/skills/bk-rum-otele/references/capabilities.md +1 -1
- package/skills/bk-rum-otele/references/configuration.md +5 -4
- package/skills/bk-rum-otele/references/framework-integration.md +7 -7
- package/skills/bk-rum-otele/references/getting-started.md +2 -2
- package/skills/bk-rum-otele/references/network.md +11 -3
- package/skills/bk-rum-otele/references/privacy.md +8 -6
- package/skills/bk-rum-otele/references/production.md +3 -3
- package/skills/bk-rum-otele/references/session-context.md +1 -1
- package/skills/bk-rum-otele/references/telemetry-reference.md +16 -12
- package/skills/bk-rum-otele/references/transport-sampling.md +2 -2
- package/skills/bk-rum-otele/references/troubleshooting.md +3 -3
- package/skills/bk-rum-otele/references/views-routing.md +9 -7
- package/dist/core/telemetry-attributes.d.ts +0 -3
package/dist/index.js
CHANGED
|
@@ -6,7 +6,7 @@ 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.29", 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);
|
|
@@ -61,7 +61,7 @@ var p = "0.0.27", m = (e) => {
|
|
|
61
61
|
viewPhase: "view.phase",
|
|
62
62
|
viewStartedAt: "view.started_at",
|
|
63
63
|
viewUrl: "view.url",
|
|
64
|
-
|
|
64
|
+
viewUrlTemplate: "view.url_template",
|
|
65
65
|
viewVersion: "view.version",
|
|
66
66
|
websocketPhase: "websocket.phase"
|
|
67
67
|
};
|
|
@@ -221,16 +221,31 @@ var C = "BK_RUM_DEVICE_ID", w = 250, T = () => navigator.connection, ee = () =>
|
|
|
221
221
|
}
|
|
222
222
|
}
|
|
223
223
|
};
|
|
224
|
-
}, le = (
|
|
224
|
+
}, le = () => typeof window > "u" ? "http://localhost" : window.location.origin, E = (e) => {
|
|
225
|
+
try {
|
|
226
|
+
return new URL(e, le()).href;
|
|
227
|
+
} catch (t) {
|
|
228
|
+
return e;
|
|
229
|
+
}
|
|
230
|
+
}, 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
|
+
let n = (e) => fe(e.replace(/[?#].*$/, ""));
|
|
232
|
+
return n(e) === n(t);
|
|
233
|
+
}, me = (e, t) => pe(E(t), E(e.transport.endpoint)), D = (e, t) => me(e, t), he = (e, t) => typeof e == "function" ? e(t) : typeof e == "string" ? t.includes(e) : (e.lastIndex = 0, e.test(t)), O = (e, t) => (Array.isArray(e) ? e : e ? [e] : []).some((e) => he(e, t)), ge = (e) => typeof e.tracking.request == "object" ? e.tracking.request : void 0, _e = (e, t) => {
|
|
234
|
+
var n;
|
|
235
|
+
return D(e, t) || O((n = ge(e)) == null ? void 0 : n.excludedUrls, E(t));
|
|
236
|
+
}, ve = (e, t) => {
|
|
237
|
+
var n;
|
|
238
|
+
return O((n = ge(e)) == null ? void 0 : n.allowedTracingUrls, E(t));
|
|
239
|
+
}, ye = (e) => e.trim().replace(/\/+$/, ""), be = (e) => {
|
|
225
240
|
var t;
|
|
226
241
|
let n = e.token || e.headers ? S(S({}, e.token ? { Authorization: `Bearer ${e.token}` } : {}), (t = e.headers) == null ? {} : t) : void 0;
|
|
227
242
|
return {
|
|
228
243
|
concurrencyLimit: e.concurrencyLimit,
|
|
229
|
-
endpoint: `${
|
|
244
|
+
endpoint: `${ye(e.endpoint)}/v1/rum`,
|
|
230
245
|
headers: n,
|
|
231
246
|
timeoutMillis: e.timeoutMillis
|
|
232
247
|
};
|
|
233
|
-
},
|
|
248
|
+
}, xe = (e) => typeof e != "number" || !Number.isFinite(e) ? 1 : Math.max(0, Math.min(1, e)), Se = (e) => e, Ce = (e) => {
|
|
234
249
|
if (!e) return e;
|
|
235
250
|
try {
|
|
236
251
|
let t = new URL(e, typeof location > "u" ? "http://localhost" : location.href);
|
|
@@ -238,47 +253,54 @@ var C = "BK_RUM_DEVICE_ID", w = 250, T = () => navigator.connection, ee = () =>
|
|
|
238
253
|
} catch (t) {
|
|
239
254
|
return e.replace(/[?#].*$/, "");
|
|
240
255
|
}
|
|
241
|
-
},
|
|
256
|
+
}, we = (e) => {
|
|
242
257
|
try {
|
|
243
258
|
return new URL(e, typeof location > "u" ? "http://localhost" : location.href).pathname || "/";
|
|
244
259
|
} catch (t) {
|
|
245
260
|
return e || "/";
|
|
246
261
|
}
|
|
247
|
-
},
|
|
262
|
+
}, Te = (e) => de(we(e)), Ee = (e, t) => (n) => {
|
|
263
|
+
try {
|
|
264
|
+
let e = t == null ? void 0 : t(n);
|
|
265
|
+
if (e) return e;
|
|
266
|
+
} catch (t) {
|
|
267
|
+
var r;
|
|
268
|
+
e.debug && ((r = globalThis.console) == null || r.warn("[bk-ot] url template hook failed:", t));
|
|
269
|
+
}
|
|
270
|
+
return Te(n);
|
|
271
|
+
}, De = (e) => {
|
|
248
272
|
var t;
|
|
249
273
|
return {
|
|
250
274
|
environment: (t = e.environment) == null ? "production" : t,
|
|
251
275
|
name: e.name,
|
|
252
276
|
version: e.version
|
|
253
277
|
};
|
|
254
|
-
},
|
|
278
|
+
}, Oe = (e, t, n) => S(S(S({ [g.deploymentEnvironmentName]: e.environment }, t === !1 ? {} : oe()), {}, { [g.serviceName]: e.name }, e.version ? { [g.serviceVersion]: e.version } : {}), {}, {
|
|
255
279
|
[g.sessionSampleRate]: n,
|
|
256
280
|
"telemetry.sdk.language": "webjs",
|
|
257
281
|
"telemetry.sdk.name": "@blueking/open-telemetry",
|
|
258
282
|
"telemetry.sdk.version": p
|
|
259
|
-
}),
|
|
283
|
+
}), ke = (e) => {
|
|
260
284
|
var t;
|
|
261
285
|
if (!e) throw Error("[bk-ot] transport is required.");
|
|
262
286
|
if (!((t = e.endpoint) != null && t.trim())) throw Error("[bk-ot] transport.endpoint is required.");
|
|
263
|
-
},
|
|
264
|
-
var t, n, r, i, a, o, s, c, l, u, d;
|
|
287
|
+
}, Ae = (e) => {
|
|
288
|
+
var t, n, r, i, a, o, s, c, l, u, d, f, p;
|
|
265
289
|
return {
|
|
266
290
|
beforeSend: (t = e.tracking) == null ? void 0 : t.beforeSend,
|
|
267
291
|
getPageAttributes: (n = (r = e.context) == null || (r = r.attributes) == null ? void 0 : r.page) == null ? (() => ({})) : n,
|
|
268
292
|
getErrorAttributes: (i = (a = e.context) == null || (a = a.attributes) == null ? void 0 : a.error) == null ? (() => ({})) : i,
|
|
269
293
|
getCustomAttributes: (o = (s = e.context) == null || (s = s.attributes) == null ? void 0 : s.custom) == null ? (() => ({})) : o,
|
|
270
|
-
|
|
271
|
-
|
|
272
|
-
|
|
273
|
-
|
|
274
|
-
redactAttributes: (c = (l = e.privacy) == null ? void 0 : l.redactAttributes) == null ? fe : c,
|
|
275
|
-
redactUrl: (u = (d = e.privacy) == null ? void 0 : d.redactUrl) == null ? pe : u
|
|
294
|
+
getRequestUrlTemplate: Ee(e, typeof ((c = e.tracking) == null ? void 0 : c.request) == "object" ? e.tracking.request.getUrlTemplate : void 0),
|
|
295
|
+
getViewUrlTemplate: Ee(e, typeof ((l = e.tracking) == null ? void 0 : l.view) == "object" ? e.tracking.view.getUrlTemplate : void 0),
|
|
296
|
+
redactAttributes: (u = (d = e.privacy) == null ? void 0 : d.redactAttributes) == null ? Se : u,
|
|
297
|
+
redactUrl: (f = (p = e.privacy) == null ? void 0 : p.redactUrl) == null ? Ce : f
|
|
276
298
|
};
|
|
277
|
-
},
|
|
299
|
+
}, je = (e) => {
|
|
278
300
|
var t, n, r, i, a, o, s, c, l, u, d, f, p, m, h, g;
|
|
279
301
|
if (!(!((t = e.application) == null || (t = t.name) == null) && t.trim())) throw Error("[bk-ot] application.name is required.");
|
|
280
|
-
|
|
281
|
-
let _ =
|
|
302
|
+
ke(e.transport);
|
|
303
|
+
let _ = De(e.application), v = typeof ((n = e.tracking) == null ? void 0 : n.view) == "object" ? e.tracking.view : void 0, y = Ae(e), b = xe((r = e.session) == null ? void 0 : r.sampleRate);
|
|
282
304
|
return {
|
|
283
305
|
application: _,
|
|
284
306
|
autoStart: (i = e.autoStart) == null ? !0 : i,
|
|
@@ -289,13 +311,13 @@ var C = "BK_RUM_DEVICE_ID", w = 250, T = () => navigator.connection, ee = () =>
|
|
|
289
311
|
plugins: [...(l = (u = e.extensions) == null ? void 0 : u.plugins) == null ? [] : l]
|
|
290
312
|
},
|
|
291
313
|
hooks: y,
|
|
292
|
-
resourceAttributes: y.redactAttributes(
|
|
314
|
+
resourceAttributes: y.redactAttributes(Oe(_, (d = e.tracking) == null ? void 0 : d.device, b)),
|
|
293
315
|
session: S(S({}, e.session), {}, { sampleRate: b }),
|
|
294
316
|
spanBatch: e.transport.batch,
|
|
295
317
|
spanProcessor: (f = e.transport.processor) == null ? "batch" : f,
|
|
296
318
|
tracking: (p = e.tracking) == null ? {} : p,
|
|
297
319
|
trackingConsent: (m = (h = e.privacy) == null ? void 0 : h.trackingConsent) == null ? "granted" : m,
|
|
298
|
-
transport:
|
|
320
|
+
transport: be(e.transport),
|
|
299
321
|
user: (g = e.context) == null ? void 0 : g.user,
|
|
300
322
|
view: {
|
|
301
323
|
excludedActivityUrls: v == null ? void 0 : v.excludedActivityUrls,
|
|
@@ -306,7 +328,7 @@ var C = "BK_RUM_DEVICE_ID", w = 250, T = () => navigator.connection, ee = () =>
|
|
|
306
328
|
};
|
|
307
329
|
//#endregion
|
|
308
330
|
//#region \0@oxc-project+runtime@0.128.0/helpers/asyncToGenerator.js
|
|
309
|
-
function
|
|
331
|
+
function Me(e, t, n, r, i, a, o) {
|
|
310
332
|
try {
|
|
311
333
|
var s = e[a](o), c = s.value;
|
|
312
334
|
} catch (e) {
|
|
@@ -315,16 +337,16 @@ function be(e, t, n, r, i, a, o) {
|
|
|
315
337
|
}
|
|
316
338
|
s.done ? t(c) : Promise.resolve(c).then(r, i);
|
|
317
339
|
}
|
|
318
|
-
function
|
|
340
|
+
function k(e) {
|
|
319
341
|
return function() {
|
|
320
342
|
var t = this, n = arguments;
|
|
321
343
|
return new Promise(function(r, i) {
|
|
322
344
|
var a = e.apply(t, n);
|
|
323
345
|
function o(e) {
|
|
324
|
-
|
|
346
|
+
Me(a, r, i, o, s, "next", e);
|
|
325
347
|
}
|
|
326
348
|
function s(e) {
|
|
327
|
-
|
|
349
|
+
Me(a, r, i, o, s, "throw", e);
|
|
328
350
|
}
|
|
329
351
|
o(void 0);
|
|
330
352
|
});
|
|
@@ -332,13 +354,13 @@ function E(e) {
|
|
|
332
354
|
}
|
|
333
355
|
//#endregion
|
|
334
356
|
//#region src/core/plugin.ts
|
|
335
|
-
var
|
|
357
|
+
var Ne = (e, t) => typeof e.enabled == "function" ? e.enabled(t) : e.enabled !== !1, Pe = (e) => e, Fe = class {
|
|
336
358
|
constructor(e) {
|
|
337
359
|
b(this, "plugins", void 0), b(this, "startedPlugins", []), this.plugins = e;
|
|
338
360
|
}
|
|
339
361
|
flush() {
|
|
340
362
|
var e = this;
|
|
341
|
-
return
|
|
363
|
+
return k(function* () {
|
|
342
364
|
yield Promise.all(e.startedPlugins.map((e) => Promise.resolve().then(() => {
|
|
343
365
|
var t;
|
|
344
366
|
return (t = e.flush) == null ? void 0 : t.call(e);
|
|
@@ -347,7 +369,7 @@ var xe = (e, t) => typeof e.enabled == "function" ? e.enabled(t) : e.enabled !==
|
|
|
347
369
|
}
|
|
348
370
|
shutdown() {
|
|
349
371
|
var e = this;
|
|
350
|
-
return
|
|
372
|
+
return k(function* () {
|
|
351
373
|
let t = [...e.startedPlugins].reverse();
|
|
352
374
|
for (let e of t) {
|
|
353
375
|
var n;
|
|
@@ -358,8 +380,8 @@ var xe = (e, t) => typeof e.enabled == "function" ? e.enabled(t) : e.enabled !==
|
|
|
358
380
|
}
|
|
359
381
|
start(e) {
|
|
360
382
|
var t = this;
|
|
361
|
-
return
|
|
362
|
-
for (let r of t.plugins) if (
|
|
383
|
+
return k(function* () {
|
|
384
|
+
for (let r of t.plugins) if (Ne(r, e.config)) try {
|
|
363
385
|
yield r.init(e), t.startedPlugins.push(r);
|
|
364
386
|
} catch (t) {
|
|
365
387
|
if (e.config.debug) {
|
|
@@ -369,36 +391,21 @@ var xe = (e, t) => typeof e.enabled == "function" ? e.enabled(t) : e.enabled !==
|
|
|
369
391
|
}
|
|
370
392
|
})();
|
|
371
393
|
}
|
|
372
|
-
},
|
|
373
|
-
|
|
374
|
-
|
|
375
|
-
|
|
376
|
-
return e;
|
|
377
|
-
}
|
|
378
|
-
}, Te = (e) => e.length > 1 ? e.replace(/\/+$/, "") : e, Ee = (e, t) => {
|
|
379
|
-
let n = (e) => Te(e.replace(/[?#].*$/, ""));
|
|
380
|
-
return n(e) === n(t);
|
|
381
|
-
}, De = (e, t) => Ee(D(t), D(e.transport.endpoint)), Oe = (e, t) => De(e, t), ke = (e, t) => typeof e == "function" ? e(t) : typeof e == "string" ? t.includes(e) : (e.lastIndex = 0, e.test(t)), O = (e, t) => (Array.isArray(e) ? e : e ? [e] : []).some((e) => ke(e, t)), Ae = (e) => typeof e.tracking.request == "object" ? e.tracking.request : void 0, je = (e, t) => {
|
|
382
|
-
var n;
|
|
383
|
-
return Oe(e, t) || O((n = Ae(e)) == null ? void 0 : n.excludedUrls, D(t));
|
|
384
|
-
}, Me = (e, t) => {
|
|
385
|
-
var n;
|
|
386
|
-
return O((n = Ae(e)) == null ? void 0 : n.allowedTracingUrls, D(t));
|
|
387
|
-
}, Ne = ["http.url", "url.full"], Pe = /* @__PURE__ */ new WeakSet(), Fe = (e) => {
|
|
388
|
-
Pe.add(e);
|
|
389
|
-
}, Ie = (e) => {
|
|
390
|
-
for (let n of Ne) {
|
|
394
|
+
}, Ie = ["http.url", "url.full"], Le = /* @__PURE__ */ new WeakSet(), Re = (e) => {
|
|
395
|
+
Le.add(e);
|
|
396
|
+
}, ze = (e) => {
|
|
397
|
+
for (let n of Ie) {
|
|
391
398
|
var t;
|
|
392
399
|
let r = (t = e.attributes) == null ? void 0 : t[n];
|
|
393
400
|
if (typeof r == "string") return r;
|
|
394
401
|
}
|
|
395
|
-
},
|
|
402
|
+
}, Be = (e) => {
|
|
396
403
|
let t = e == null ? void 0 : e[g.sessionId];
|
|
397
404
|
return typeof t == "string" && t.length > 0;
|
|
398
|
-
},
|
|
405
|
+
}, Ve = (e) => {
|
|
399
406
|
let t = e == null ? void 0 : e[g.viewId];
|
|
400
407
|
return typeof t == "string" && t.length > 0;
|
|
401
|
-
},
|
|
408
|
+
}, He = (e) => Be(e) && Ve(e), Ue = class {
|
|
402
409
|
constructor(e, t, n) {
|
|
403
410
|
this.inner = e, this.config = t, this.getRuntimeAttributes = n;
|
|
404
411
|
}
|
|
@@ -406,8 +413,8 @@ var xe = (e, t) => typeof e.enabled == "function" ? e.enabled(t) : e.enabled !==
|
|
|
406
413
|
return this.inner.forceFlush();
|
|
407
414
|
}
|
|
408
415
|
onEnd(e) {
|
|
409
|
-
let t =
|
|
410
|
-
if (!(
|
|
416
|
+
let t = ze(e);
|
|
417
|
+
if (!(Le.delete(e) || t && me(this.config, t) || !He(e.attributes) && !(e.name === "browser.session" && Be(e.attributes)))) {
|
|
411
418
|
try {
|
|
412
419
|
var n, r;
|
|
413
420
|
if (((n = this.config.hooks) == null || (r = n.beforeSend) == null ? void 0 : r.call(n, {
|
|
@@ -431,7 +438,7 @@ var xe = (e, t) => typeof e.enabled == "function" ? e.enabled(t) : e.enabled !==
|
|
|
431
438
|
shutdown() {
|
|
432
439
|
return this.inner.shutdown();
|
|
433
440
|
}
|
|
434
|
-
},
|
|
441
|
+
}, We = new Set(Object.values(g)), Ge = class {
|
|
435
442
|
constructor(e = {}, t) {
|
|
436
443
|
b(this, "actionHistory", []), b(this, "attributes", {}), b(this, "queuedViewCommands", []), b(this, "recordAssociation", (e, t, n, r) => {
|
|
437
444
|
let i = e.at(-1);
|
|
@@ -506,23 +513,23 @@ var xe = (e, t) => typeof e.enabled == "function" ? e.enabled(t) : e.enabled !==
|
|
|
506
513
|
var n;
|
|
507
514
|
this.viewAttributeKeys.forEach((e) => delete this.attributes[e]), this.viewAttributeKeys.clear();
|
|
508
515
|
let r = {};
|
|
509
|
-
for (let [t, i] of Object.entries((n = e.attributes) == null ? {} : n)) i === void 0 ||
|
|
510
|
-
this.view = S(S({}, e), {}, { attributes: r }), this.setOptionalAttribute(g.viewId, e.id), this.setOptionalAttribute(g.viewUrl, e.url), this.setOptionalAttribute(g.
|
|
516
|
+
for (let [t, i] of Object.entries((n = e.attributes) == null ? {} : n)) i === void 0 || We.has(t) || (r[t] = i, this.attributes[t] = i, this.viewAttributeKeys.add(t), this.viewScopedAttributeKeys.add(t));
|
|
517
|
+
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), [
|
|
511
518
|
g.viewId,
|
|
512
519
|
g.viewUrl,
|
|
513
|
-
g.
|
|
520
|
+
g.viewUrlTemplate,
|
|
514
521
|
g.viewLoadingType,
|
|
515
522
|
g.viewName
|
|
516
523
|
].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()));
|
|
517
524
|
}), this.setAttributes(e), t && this.setUser(t);
|
|
518
525
|
}
|
|
519
|
-
},
|
|
526
|
+
}, A = {
|
|
520
527
|
abort: "abort",
|
|
521
528
|
error: "error",
|
|
522
529
|
success: "success",
|
|
523
530
|
timeout: "timeout",
|
|
524
531
|
warning: "warning"
|
|
525
|
-
},
|
|
532
|
+
}, j = {
|
|
526
533
|
action: "action",
|
|
527
534
|
custom: "custom",
|
|
528
535
|
error: "error",
|
|
@@ -532,10 +539,10 @@ var xe = (e, t) => typeof e.enabled == "function" ? e.enabled(t) : e.enabled !==
|
|
|
532
539
|
vital: "vital",
|
|
533
540
|
view: "view",
|
|
534
541
|
websocket: "websocket"
|
|
535
|
-
},
|
|
542
|
+
}, Ke = (e) => e === 408 || e === 504 ? A.timeout : typeof e == "number" && e >= 400 ? A.error : A.success, qe = (e) => {
|
|
536
543
|
if (e === 408 || e === 504) return "network_timeout";
|
|
537
544
|
if (!(typeof e != "number" || e < 400)) return e >= 500 ? "http_5xx" : "http_4xx";
|
|
538
|
-
},
|
|
545
|
+
}, Je = (e) => e === "good" ? A.success : A.warning, Ye = (e) => {
|
|
539
546
|
if (!e) return {};
|
|
540
547
|
try {
|
|
541
548
|
let t = new URL(e, typeof location > "u" ? "http://localhost" : location.href);
|
|
@@ -546,36 +553,36 @@ var xe = (e, t) => typeof e.enabled == "function" ? e.enabled(t) : e.enabled !==
|
|
|
546
553
|
} catch (e) {
|
|
547
554
|
return {};
|
|
548
555
|
}
|
|
549
|
-
},
|
|
556
|
+
}, M = ({ outcome: e = A.success, outcomeReason: t, spanType: n }) => S({
|
|
550
557
|
[g.spanType]: n,
|
|
551
558
|
[g.outcomeType]: e
|
|
552
|
-
}, t ? { [g.outcomeReason]: t } : {}),
|
|
553
|
-
let i =
|
|
554
|
-
return S(S(S(S(S({},
|
|
559
|
+
}, t ? { [g.outcomeReason]: t } : {}), Xe = ({ initiatorType: e = "other", method: t, outcome: n, url: r }) => {
|
|
560
|
+
let i = Ye(r), a = (n == null ? void 0 : n.type) === "response" && typeof n.statusCode == "number" && n.statusCode > 0 ? n.statusCode : void 0, o = (n == null ? void 0 : n.type) === "abort" ? A.abort : (n == null ? void 0 : n.type) === "timeout" ? A.timeout : (n == null ? void 0 : n.type) === "network_error" ? A.error : typeof a == "number" ? Ke(a) : A.success, s = (n == null ? void 0 : n.type) === "timeout" ? "network_timeout" : (n == null ? void 0 : n.type) === "network_error" ? "network" : typeof a == "number" ? qe(a) : void 0, c = t == null ? void 0 : t.toUpperCase();
|
|
561
|
+
return S(S(S(S(S({}, M({
|
|
555
562
|
outcome: o,
|
|
556
563
|
outcomeReason: s,
|
|
557
|
-
spanType:
|
|
564
|
+
spanType: j.resource
|
|
558
565
|
})), i.serverAddress ? { "server.address": i.serverAddress } : {}), i.serverPort === void 0 ? {} : { "server.port": i.serverPort }), {}, { "resource.type": e }, c ? { "http.request.method": c } : {}), typeof a == "number" ? { "http.response.status_code": a } : {});
|
|
559
|
-
},
|
|
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) => {
|
|
560
567
|
var t;
|
|
561
568
|
if (e.parentElement) return e.parentElement;
|
|
562
569
|
let n = (t = e.getRootNode) == null ? void 0 : t.call(e);
|
|
563
570
|
return typeof ShadowRoot < "u" && n instanceof ShadowRoot ? n.host : null;
|
|
564
|
-
},
|
|
571
|
+
}, at = (e, t) => {
|
|
565
572
|
let n = e;
|
|
566
573
|
for (; n;) {
|
|
567
574
|
let e = n.getAttribute(t);
|
|
568
|
-
if (e) return
|
|
569
|
-
n =
|
|
575
|
+
if (e) return N(e);
|
|
576
|
+
n = P(n);
|
|
570
577
|
}
|
|
571
|
-
},
|
|
578
|
+
}, ot = (e) => {
|
|
572
579
|
var t;
|
|
573
|
-
return e.isContentEditable ? "" :
|
|
574
|
-
},
|
|
580
|
+
return e.isContentEditable ? "" : N((t = e.textContent) == null ? "" : t);
|
|
581
|
+
}, st = (e) => {
|
|
575
582
|
var t, n;
|
|
576
583
|
let r = e, i = (t = r.labels) == null ? void 0 : t[0];
|
|
577
584
|
if (i) {
|
|
578
|
-
let e =
|
|
585
|
+
let e = ot(i);
|
|
579
586
|
if (e) return e;
|
|
580
587
|
}
|
|
581
588
|
let a = e.tagName.toLowerCase(), o = (n = e.getAttribute("type")) == null ? void 0 : n.toLowerCase();
|
|
@@ -585,11 +592,11 @@ var xe = (e, t) => typeof e.enabled == "function" ? e.enabled(t) : e.enabled !==
|
|
|
585
592
|
"submit"
|
|
586
593
|
].includes(o == null ? "" : o)) {
|
|
587
594
|
var s;
|
|
588
|
-
let e =
|
|
595
|
+
let e = N((s = r.value) == null ? "" : s);
|
|
589
596
|
if (e) return e;
|
|
590
597
|
}
|
|
591
598
|
if (a === "button" || a === "label" || e.getAttribute("role") === "button") {
|
|
592
|
-
let t =
|
|
599
|
+
let t = ot(e);
|
|
593
600
|
if (t) return t;
|
|
594
601
|
}
|
|
595
602
|
for (let t of [
|
|
@@ -600,39 +607,39 @@ var xe = (e, t) => typeof e.enabled == "function" ? e.enabled(t) : e.enabled !==
|
|
|
600
607
|
"placeholder"
|
|
601
608
|
]) {
|
|
602
609
|
var c;
|
|
603
|
-
let n =
|
|
610
|
+
let n = N((c = e.getAttribute(t)) == null ? "" : c);
|
|
604
611
|
if (n) return n;
|
|
605
612
|
}
|
|
606
|
-
},
|
|
607
|
-
let r =
|
|
613
|
+
}, ct = (e, t = nt, n = !1) => {
|
|
614
|
+
let r = at(e, t);
|
|
608
615
|
if (r) return r;
|
|
609
616
|
if (!n) return e.tagName.toLowerCase();
|
|
610
617
|
let i = e, a = 0;
|
|
611
|
-
for (; i && a <=
|
|
618
|
+
for (; i && a <= it;) {
|
|
612
619
|
let e = i.tagName.toLowerCase();
|
|
613
620
|
if (e === "body" || e === "html" || e === "head") break;
|
|
614
|
-
let t =
|
|
621
|
+
let t = st(i);
|
|
615
622
|
if (t) return t;
|
|
616
623
|
if (e === "form") break;
|
|
617
|
-
i =
|
|
624
|
+
i = P(i), a += 1;
|
|
618
625
|
}
|
|
619
|
-
for (i = e, a = 0; i && a <=
|
|
626
|
+
for (i = e, a = 0; i && a <= it;) {
|
|
620
627
|
let e = i.tagName.toLowerCase();
|
|
621
628
|
if (e === "body" || e === "html" || e === "head") break;
|
|
622
|
-
let t =
|
|
629
|
+
let t = ot(i);
|
|
623
630
|
if (t) return t;
|
|
624
631
|
if (e === "form") break;
|
|
625
|
-
i =
|
|
632
|
+
i = P(i), a += 1;
|
|
626
633
|
}
|
|
627
634
|
return e.tagName.toLowerCase();
|
|
628
|
-
},
|
|
635
|
+
}, lt = (e) => {
|
|
629
636
|
var t;
|
|
630
637
|
let n = (t = e.composedPath) == null ? void 0 : t.call(e)[0];
|
|
631
638
|
return n instanceof Element ? n : e.target instanceof Element ? e.target : void 0;
|
|
632
|
-
},
|
|
639
|
+
}, ut = (e) => {
|
|
633
640
|
let t = e.timeStamp;
|
|
634
641
|
return !Number.isFinite(t) || t <= 0 ? Date.now() : t > 0xe8d4a51000 ? t : typeof performance > "u" ? Date.now() : performance.timeOrigin + t;
|
|
635
|
-
},
|
|
642
|
+
}, dt = (e, t) => typeof e == "number" && Number.isFinite(e) && e > 0 ? e : t, ft = (e) => {
|
|
636
643
|
let t = e;
|
|
637
644
|
if (t.tagName.toLowerCase() === "label" && t.hasAttribute("for")) {
|
|
638
645
|
var n;
|
|
@@ -652,13 +659,13 @@ var xe = (e, t) => typeof e.enabled == "function" ? e.enabled(t) : e.enabled !==
|
|
|
652
659
|
"submit"
|
|
653
660
|
].includes((r = (i = t.getAttribute("type")) == null ? void 0 : i.toLowerCase()) == null ? "text" : r);
|
|
654
661
|
}
|
|
655
|
-
t =
|
|
662
|
+
t = P(t);
|
|
656
663
|
}
|
|
657
664
|
return !1;
|
|
658
|
-
},
|
|
659
|
-
let t = [], n = /* @__PURE__ */ new Map(), r = /* @__PURE__ */ new Set(), i = e.actionNameAttribute ||
|
|
665
|
+
}, pt = (e = {}) => {
|
|
666
|
+
let t = [], n = /* @__PURE__ */ new Map(), r = /* @__PURE__ */ new Set(), i = e.actionNameAttribute || nt, a = dt(e.maxDuration, tt), o = [], s, c = () => {
|
|
660
667
|
s == null || s.setRuntimeAttributes({ [g.actionId]: n.size ? [...n.keys()] : void 0 });
|
|
661
|
-
}, l = (e) => !e.hadActivity && !e.userActivity.input && !e.userActivity.scroll && !e.userActivity.selection && !
|
|
668
|
+
}, l = (e) => !e.hadActivity && !e.userActivity.input && !e.userActivity.scroll && !e.userActivity.selection && !ft(e.target), u = (e) => {
|
|
662
669
|
if (!r.delete(e) || !s || !e.completed) return;
|
|
663
670
|
clearTimeout(e.reportTimer), e.hadError && e.frustrations.add("error_click"), l(e) && e.frustrations.add("dead_click");
|
|
664
671
|
let t = [
|
|
@@ -666,9 +673,9 @@ var xe = (e, t) => typeof e.enabled == "function" ? e.enabled(t) : e.enabled !==
|
|
|
666
673
|
"dead_click",
|
|
667
674
|
"error_click"
|
|
668
675
|
].filter((t) => e.frustrations.has(t)), { endTime: n, hasLoadingTime: i } = e.completed, a = Math.max(0, n - e.startTime), o = e.hadError || t.length > 0;
|
|
669
|
-
s.startSpan("action.click", S(S(S(S(S({}, s.config.hooks.getPageAttributes()),
|
|
670
|
-
outcome: o ?
|
|
671
|
-
spanType:
|
|
676
|
+
s.startSpan("action.click", S(S(S(S(S({}, s.config.hooks.getPageAttributes()), M({
|
|
677
|
+
outcome: o ? A.warning : A.success,
|
|
678
|
+
spanType: j.action
|
|
672
679
|
})), e.runtimeAttributes), {}, {
|
|
673
680
|
[g.actionId]: e.id,
|
|
674
681
|
[g.actionType]: "click",
|
|
@@ -682,13 +689,13 @@ var xe = (e, t) => typeof e.enabled == "function" ? e.enabled(t) : e.enabled !==
|
|
|
682
689
|
endTime: t,
|
|
683
690
|
hasLoadingTime: i
|
|
684
691
|
}, r.add(e);
|
|
685
|
-
let a = Math.max(0, e.startTime +
|
|
692
|
+
let a = Math.max(0, e.startTime + $e - Date.now());
|
|
686
693
|
e.reportTimer = setTimeout(() => u(e), a);
|
|
687
694
|
}, f = () => {
|
|
688
695
|
[...r].forEach(u);
|
|
689
696
|
}, p = (e) => {
|
|
690
697
|
if (clearTimeout(e.quietTimer), !e.hadActivity || e.pendingRequests.size) return;
|
|
691
|
-
let t = Math.max(0, e.lastActivityTime +
|
|
698
|
+
let t = Math.max(0, e.lastActivityTime + Qe - Date.now());
|
|
692
699
|
e.quietTimer = setTimeout(() => d(e, e.lastActivityTime, !0), t);
|
|
693
700
|
}, m = (e, t) => {
|
|
694
701
|
e.hadActivity = !0, e.lastActivityTime = Math.max(e.lastActivityTime, t), p(e);
|
|
@@ -721,14 +728,14 @@ var xe = (e, t) => typeof e.enabled == "function" ? e.enabled(t) : e.enabled !==
|
|
|
721
728
|
[...n.values()].forEach((t) => d(t, e, t.hadActivity));
|
|
722
729
|
}, b = (e, t) => {
|
|
723
730
|
let n = "clientX" in t && typeof t.clientX == "number" ? t.clientX : 0, r = "clientY" in t && typeof t.clientY == "number" ? t.clientY : 0;
|
|
724
|
-
o = o.filter((t) => e.startTime - t.action.startTime <=
|
|
725
|
-
let i = o.at(-1), a = o.some((e) => e.action.userActivity.scroll || e.action.userActivity.selection), s = (i == null ? void 0 : i.target) === e.target && Math.hypot(i.x - n, i.y - r) <=
|
|
731
|
+
o = o.filter((t) => e.startTime - t.action.startTime <= $e);
|
|
732
|
+
let i = o.at(-1), a = o.some((e) => e.action.userActivity.scroll || e.action.userActivity.selection), s = (i == null ? void 0 : i.target) === e.target && Math.hypot(i.x - n, i.y - r) <= et;
|
|
726
733
|
(a || i && !s) && (o = []), o.push({
|
|
727
734
|
action: e,
|
|
728
735
|
target: e.target,
|
|
729
736
|
x: n,
|
|
730
737
|
y: r
|
|
731
|
-
}), o.length >= 3 && e.startTime - o[o.length - 3].action.startTime <=
|
|
738
|
+
}), o.length >= 3 && e.startTime - o[o.length - 3].action.startTime <= $e && (o.slice(-3).map((e) => e.action).forEach((e) => e.frustrations.add("rage_click")), o = []);
|
|
732
739
|
};
|
|
733
740
|
return {
|
|
734
741
|
name: "action",
|
|
@@ -740,9 +747,9 @@ var xe = (e, t) => typeof e.enabled == "function" ? e.enabled(t) : e.enabled !==
|
|
|
740
747
|
passive: !0
|
|
741
748
|
}, p = (t) => {
|
|
742
749
|
if (!l.isSampled() || "button" in t && typeof t.button == "number" && t.button !== 0) return;
|
|
743
|
-
let r =
|
|
750
|
+
let r = lt(t);
|
|
744
751
|
if (!r) return;
|
|
745
|
-
let o =
|
|
752
|
+
let o = ut(t), s = h("action"), u = {
|
|
746
753
|
frustrations: /* @__PURE__ */ new Set(),
|
|
747
754
|
hadActivity: !1,
|
|
748
755
|
hadError: !1,
|
|
@@ -753,7 +760,7 @@ var xe = (e, t) => typeof e.enabled == "function" ? e.enabled(t) : e.enabled !==
|
|
|
753
760
|
runtimeAttributes: l.getRuntimeAttributes(),
|
|
754
761
|
startTime: o,
|
|
755
762
|
target: r,
|
|
756
|
-
targetName:
|
|
763
|
+
targetName: ct(r, i, e.nameCollection === "text"),
|
|
757
764
|
targetTag: r.tagName.toLowerCase(),
|
|
758
765
|
userActivity: {
|
|
759
766
|
input: !1,
|
|
@@ -762,7 +769,7 @@ var xe = (e, t) => typeof e.enabled == "function" ? e.enabled(t) : e.enabled !==
|
|
|
762
769
|
},
|
|
763
770
|
validationTimer: setTimeout(() => {
|
|
764
771
|
u.hadActivity || d(u, u.startTime, !1);
|
|
765
|
-
},
|
|
772
|
+
}, Ze)
|
|
766
773
|
};
|
|
767
774
|
n.set(s, u), b(u, t), c();
|
|
768
775
|
};
|
|
@@ -796,16 +803,16 @@ var xe = (e, t) => typeof e.enabled == "function" ? e.enabled(t) : e.enabled !==
|
|
|
796
803
|
o = [], s = void 0;
|
|
797
804
|
}
|
|
798
805
|
};
|
|
799
|
-
},
|
|
806
|
+
}, mt = "data-bk-excluded-activity-mutations", ht = (e) => {
|
|
800
807
|
let t = e.type === "characterData" ? e.target.parentElement : e.target;
|
|
801
808
|
return t instanceof Element && !!t.closest("[data-bk-excluded-activity-mutations]");
|
|
802
|
-
},
|
|
809
|
+
}, gt = () => {
|
|
803
810
|
let e, t = [];
|
|
804
811
|
return {
|
|
805
812
|
name: "activity",
|
|
806
813
|
init(n) {
|
|
807
814
|
if (typeof document < "u" && typeof MutationObserver < "u" && (e = new MutationObserver((e) => {
|
|
808
|
-
e.length && !e.every(
|
|
815
|
+
e.length && !e.every(ht) && n.notifyActivity({
|
|
809
816
|
time: Date.now(),
|
|
810
817
|
type: "dom_mutation"
|
|
811
818
|
});
|
|
@@ -829,7 +836,7 @@ var xe = (e, t) => typeof e.enabled == "function" ? e.enabled(t) : e.enabled !==
|
|
|
829
836
|
for (e == null || e.disconnect(), e = void 0; t.length;) (n = t.pop()) == null || n();
|
|
830
837
|
}
|
|
831
838
|
};
|
|
832
|
-
},
|
|
839
|
+
}, _t = (e, t) => !!(t && O(e.config.view.excludedActivityUrls, t)), vt = (e, t, n) => {
|
|
833
840
|
let r = /* @__PURE__ */ new Set(), i = !1, a = !1, o = t, s, c = (e) => {
|
|
834
841
|
i || (i = !0, clearTimeout(f), clearTimeout(s), d(), n(e));
|
|
835
842
|
}, l = () => {
|
|
@@ -842,7 +849,7 @@ var xe = (e, t) => typeof e.enabled == "function" ? e.enabled(t) : e.enabled !==
|
|
|
842
849
|
}, d = e.onActivity((n) => {
|
|
843
850
|
if (!(n.type === "error" || n.type === "long_task")) {
|
|
844
851
|
if (n.type === "request_start") {
|
|
845
|
-
if (n.time < t ||
|
|
852
|
+
if (n.time < t || _t(e, n.url)) return;
|
|
846
853
|
r.add(n.id), u(n.time);
|
|
847
854
|
return;
|
|
848
855
|
}
|
|
@@ -852,7 +859,7 @@ var xe = (e, t) => typeof e.enabled == "function" ? e.enabled(t) : e.enabled !==
|
|
|
852
859
|
return;
|
|
853
860
|
}
|
|
854
861
|
if (n.type === "resource") {
|
|
855
|
-
if (n.endTime < t ||
|
|
862
|
+
if (n.endTime < t || _t(e, n.url)) return;
|
|
856
863
|
u(n.endTime);
|
|
857
864
|
return;
|
|
858
865
|
}
|
|
@@ -864,7 +871,7 @@ var xe = (e, t) => typeof e.enabled == "function" ? e.enabled(t) : e.enabled !==
|
|
|
864
871
|
return () => {
|
|
865
872
|
i || (i = !0, clearTimeout(f), clearTimeout(s), d());
|
|
866
873
|
};
|
|
867
|
-
},
|
|
874
|
+
}, yt = 1e3, bt = 200, xt = "body", St = .8, Ct = [
|
|
868
875
|
"[data-loading=\"true\"]",
|
|
869
876
|
"[aria-busy=\"true\"]",
|
|
870
877
|
".loading",
|
|
@@ -872,7 +879,7 @@ var xe = (e, t) => typeof e.enabled == "function" ? e.enabled(t) : e.enabled !==
|
|
|
872
879
|
".spinner",
|
|
873
880
|
".skeleton",
|
|
874
881
|
".bk-loading"
|
|
875
|
-
],
|
|
882
|
+
], wt = [
|
|
876
883
|
[.2, .2],
|
|
877
884
|
[.5, .2],
|
|
878
885
|
[.8, .2],
|
|
@@ -882,36 +889,36 @@ var xe = (e, t) => typeof e.enabled == "function" ? e.enabled(t) : e.enabled !==
|
|
|
882
889
|
[.2, .8],
|
|
883
890
|
[.5, .8],
|
|
884
891
|
[.8, .8]
|
|
885
|
-
],
|
|
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) => {
|
|
886
893
|
if (!e) return "";
|
|
887
894
|
let t = e.tagName.toLowerCase();
|
|
888
895
|
return e.id ? `${t}#${e.id}` : t;
|
|
889
|
-
},
|
|
896
|
+
}, Ot = (e, t) => t.some((t) => {
|
|
890
897
|
try {
|
|
891
898
|
return e.matches(t) || !!e.closest(t);
|
|
892
899
|
} catch (e) {
|
|
893
900
|
return !1;
|
|
894
901
|
}
|
|
895
|
-
}),
|
|
902
|
+
}), kt = (e) => {
|
|
896
903
|
if (typeof getComputedStyle != "function") return !0;
|
|
897
904
|
let t = getComputedStyle(e);
|
|
898
905
|
return t.display !== "none" && t.visibility !== "hidden" && Number(t.opacity || 1) > 0;
|
|
899
|
-
},
|
|
906
|
+
}, At = (e, t) => {
|
|
900
907
|
if (typeof document.elementsFromPoint == "function") return document.elementsFromPoint(e, t);
|
|
901
908
|
let n = document.elementFromPoint(e, t);
|
|
902
909
|
return n ? [n] : [];
|
|
903
|
-
},
|
|
910
|
+
}, jt = (e, t) => {
|
|
904
911
|
var n;
|
|
905
912
|
let r = document.querySelector(e), i = (n = r == null ? document.body : r) == null ? document.documentElement : n, a = !!r, o = 0, s = 0, c = "";
|
|
906
|
-
for (let [e, n] of
|
|
907
|
-
let r =
|
|
908
|
-
if (e === .5 && n === .5 && (c =
|
|
913
|
+
for (let [e, n] of wt) {
|
|
914
|
+
let r = At(window.innerWidth * e, window.innerHeight * n);
|
|
915
|
+
if (e === .5 && n === .5 && (c = Dt(r[0])), r.some((e) => Ot(e, t))) {
|
|
909
916
|
s += 1;
|
|
910
917
|
continue;
|
|
911
918
|
}
|
|
912
|
-
r.some((e) => e !== i && e !== document.body && e !== document.documentElement && i.contains(e) &&
|
|
919
|
+
r.some((e) => e !== i && e !== document.body && e !== document.documentElement && i.contains(e) && kt(e)) || (o += 1);
|
|
913
920
|
}
|
|
914
|
-
let l =
|
|
921
|
+
let l = wt.length - s;
|
|
915
922
|
return {
|
|
916
923
|
centerElement: c,
|
|
917
924
|
emptyCount: o,
|
|
@@ -921,9 +928,9 @@ var xe = (e, t) => typeof e.enabled == "function" ? e.enabled(t) : e.enabled !==
|
|
|
921
928
|
score: l ? o / l : 0,
|
|
922
929
|
validCount: l
|
|
923
930
|
};
|
|
924
|
-
},
|
|
931
|
+
}, Mt = (e = {}) => {
|
|
925
932
|
var t;
|
|
926
|
-
let n =
|
|
933
|
+
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;
|
|
927
934
|
return {
|
|
928
935
|
name: "blank-screen",
|
|
929
936
|
init(e) {
|
|
@@ -934,10 +941,10 @@ var xe = (e, t) => typeof e.enabled == "function" ? e.enabled(t) : e.enabled !==
|
|
|
934
941
|
if (s !== t || c === t || !e.isSampled()) return;
|
|
935
942
|
c = t;
|
|
936
943
|
let r = Date.now();
|
|
937
|
-
e.startSpan("browser.blank_screen", S(S({},
|
|
938
|
-
outcome:
|
|
944
|
+
e.startSpan("browser.blank_screen", S(S({}, M({
|
|
945
|
+
outcome: A.error,
|
|
939
946
|
outcomeReason: "blank_screen",
|
|
940
|
-
spanType:
|
|
947
|
+
spanType: j.error
|
|
941
948
|
})), {}, {
|
|
942
949
|
"blank_screen.center_element": n.centerElement,
|
|
943
950
|
"blank_screen.empty_ratio": n.score,
|
|
@@ -946,14 +953,14 @@ var xe = (e, t) => typeof e.enabled == "function" ? e.enabled(t) : e.enabled !==
|
|
|
946
953
|
"blank_screen.reason": n.reason,
|
|
947
954
|
"blank_screen.root_found": n.rootFound,
|
|
948
955
|
"blank_screen.root_selector": i,
|
|
949
|
-
"blank_screen.sample_count":
|
|
956
|
+
"blank_screen.sample_count": wt.length,
|
|
950
957
|
"blank_screen.valid_sample_count": n.validCount
|
|
951
958
|
}), { startTime: r }).end(r);
|
|
952
959
|
}, m = (t) => {
|
|
953
960
|
if (s !== t || c === t || document.visibilityState === "hidden") return;
|
|
954
961
|
let n;
|
|
955
962
|
try {
|
|
956
|
-
n =
|
|
963
|
+
n = jt(i, o);
|
|
957
964
|
} catch (t) {
|
|
958
965
|
var l;
|
|
959
966
|
e.config.debug && ((l = globalThis.console) == null || l.warn("[bk-ot][blank-screen] detection failed:", t));
|
|
@@ -963,7 +970,7 @@ var xe = (e, t) => typeof e.enabled == "function" ? e.enabled(t) : e.enabled !==
|
|
|
963
970
|
if (s !== t || document.visibilityState === "hidden") return;
|
|
964
971
|
let n;
|
|
965
972
|
try {
|
|
966
|
-
n =
|
|
973
|
+
n = jt(i, o);
|
|
967
974
|
} catch (t) {
|
|
968
975
|
var r;
|
|
969
976
|
e.config.debug && ((r = globalThis.console) == null || r.warn("[bk-ot][blank-screen] confirmation failed:", t));
|
|
@@ -977,7 +984,7 @@ var xe = (e, t) => typeof e.enabled == "function" ? e.enabled(t) : e.enabled !==
|
|
|
977
984
|
d = e.onViewChange((n) => {
|
|
978
985
|
if (n.id !== s && (t(), l == null || l(), l = void 0, s = n.id, c = void 0, n.id)) {
|
|
979
986
|
let t = n.id;
|
|
980
|
-
l =
|
|
987
|
+
l = vt(e, Date.now(), () => {
|
|
981
988
|
l = void 0, h(t);
|
|
982
989
|
});
|
|
983
990
|
}
|
|
@@ -991,45 +998,45 @@ var xe = (e, t) => typeof e.enabled == "function" ? e.enabled(t) : e.enabled !==
|
|
|
991
998
|
clearTimeout(u), u = void 0, d(), l == null || l(), l = void 0, f == null || f(), f = void 0, s = void 0, c = void 0;
|
|
992
999
|
}
|
|
993
1000
|
};
|
|
994
|
-
},
|
|
995
|
-
let t =
|
|
996
|
-
t >= 0 &&
|
|
997
|
-
},
|
|
1001
|
+
}, Nt = 100, Pt = 200, F = [], Ft = (e) => e.replace(/#.*$/, ""), It = (e) => {
|
|
1002
|
+
let t = F.indexOf(e);
|
|
1003
|
+
t >= 0 && F.splice(t, 1), e.timer !== void 0 && clearTimeout(e.timer);
|
|
1004
|
+
}, I = (e, t) => {
|
|
998
1005
|
let n = e.callback;
|
|
999
|
-
|
|
1000
|
-
},
|
|
1001
|
-
let t = performance.timeOrigin + e.startTime, n =
|
|
1002
|
-
n && (n.entry = e, n.callback &&
|
|
1003
|
-
},
|
|
1006
|
+
It(e), e.callback = void 0, n == null || n(t);
|
|
1007
|
+
}, Lt = (e) => {
|
|
1008
|
+
let t = performance.timeOrigin + e.startTime, n = F.filter((n) => !n.entry && Ft(n.url) === Ft(e.name) && t >= n.startTime - 50).sort((e, n) => Math.abs(e.startTime - t) - Math.abs(n.startTime - t))[0];
|
|
1009
|
+
n && (n.entry = e, n.callback && I(n, e));
|
|
1010
|
+
}, Rt = (e, t = Date.now()) => {
|
|
1004
1011
|
let n = {
|
|
1005
1012
|
startTime: t,
|
|
1006
1013
|
url: e
|
|
1007
1014
|
};
|
|
1008
|
-
return
|
|
1009
|
-
cancel: () =>
|
|
1015
|
+
return F.push(n), F.length > Nt && I(F[0]), {
|
|
1016
|
+
cancel: () => I(n),
|
|
1010
1017
|
complete: (e) => {
|
|
1011
1018
|
if (n.callback = e, n.entry) {
|
|
1012
|
-
|
|
1019
|
+
I(n, n.entry);
|
|
1013
1020
|
return;
|
|
1014
1021
|
}
|
|
1015
|
-
n.timer = setTimeout(() =>
|
|
1022
|
+
n.timer = setTimeout(() => I(n), Pt);
|
|
1016
1023
|
}
|
|
1017
1024
|
};
|
|
1018
|
-
},
|
|
1025
|
+
}, L = "traceparent", R = 32, z = 16, zt = "0123456789abcdef", Bt = /^[\da-f]+$/, Vt = /^0+$/, Ht = /^\d+$/, Ut = /^([\da-f]{2})-([\da-f]{32})-([\da-f]{16})-([\da-f]{2})(?:-.*)?$/, Wt = /^([\da-f]{32})-([\da-f]{16})(?:-([01]))?$/, Gt = /(?:^|,)_dd\.p\.tid=([\da-f]{16})(?:,|$)/, Kt = "0000000000000000", B = (e, t) => e.length === t && Bt.test(e) && !Vt.test(e), qt = (e) => {
|
|
1019
1026
|
let t = e.toLowerCase();
|
|
1020
|
-
return
|
|
1021
|
-
},
|
|
1027
|
+
return B(t, R) ? t : B(t, z) ? t.padStart(R, "0") : void 0;
|
|
1028
|
+
}, Jt = (e) => {
|
|
1022
1029
|
let t = e.toLowerCase();
|
|
1023
|
-
return
|
|
1024
|
-
},
|
|
1030
|
+
return B(t, z) ? t : void 0;
|
|
1031
|
+
}, V = (e) => {
|
|
1025
1032
|
let t = new Uint8Array(e / 2);
|
|
1026
1033
|
if (typeof crypto < "u" && typeof crypto.getRandomValues == "function") crypto.getRandomValues(t);
|
|
1027
1034
|
else for (let e = 0; e < t.length; e += 1) t[e] = Math.floor(Math.random() * 256);
|
|
1028
1035
|
let n = "";
|
|
1029
|
-
for (let e of t) n +=
|
|
1030
|
-
return
|
|
1031
|
-
},
|
|
1032
|
-
if (!
|
|
1036
|
+
for (let e of t) n += zt[e >> 4] + zt[e & 15];
|
|
1037
|
+
return Vt.test(n) ? `${n.slice(1)}1` : n;
|
|
1038
|
+
}, Yt = (e) => {
|
|
1039
|
+
if (!Ht.test(e)) return;
|
|
1033
1040
|
let t = [];
|
|
1034
1041
|
for (let n = 0; n < e.length; n += 1) {
|
|
1035
1042
|
let r = e.charCodeAt(n) - 48;
|
|
@@ -1039,11 +1046,11 @@ var xe = (e, t) => typeof e.enabled == "function" ? e.enabled(t) : e.enabled !==
|
|
|
1039
1046
|
}
|
|
1040
1047
|
for (; r > 0;) t.push(r % 16), r = (r - r % 16) / 16;
|
|
1041
1048
|
}
|
|
1042
|
-
if (t.length >
|
|
1049
|
+
if (t.length > z) return;
|
|
1043
1050
|
let n = "";
|
|
1044
|
-
for (let e = t.length - 1; e >= 0; --e) n +=
|
|
1045
|
-
return n.padStart(
|
|
1046
|
-
},
|
|
1051
|
+
for (let e = t.length - 1; e >= 0; --e) n += zt[t[e]];
|
|
1052
|
+
return n.padStart(z, "0");
|
|
1053
|
+
}, H = (e, t) => {
|
|
1047
1054
|
let n = {};
|
|
1048
1055
|
for (let i of t) {
|
|
1049
1056
|
var r;
|
|
@@ -1051,17 +1058,17 @@ var xe = (e, t) => typeof e.enabled == "function" ? e.enabled(t) : e.enabled !==
|
|
|
1051
1058
|
t && (n[i] = t);
|
|
1052
1059
|
}
|
|
1053
1060
|
return n;
|
|
1054
|
-
},
|
|
1061
|
+
}, Xt = [
|
|
1055
1062
|
(e) => {
|
|
1056
1063
|
var t;
|
|
1057
1064
|
let n = (t = e("traceparent")) == null ? void 0 : t.trim().toLowerCase();
|
|
1058
1065
|
if (!n) return;
|
|
1059
|
-
let r =
|
|
1066
|
+
let r = Ut.exec(n);
|
|
1060
1067
|
if (!r || r[1] === "ff") return;
|
|
1061
1068
|
let [, , i, a, o] = r;
|
|
1062
|
-
if (!(!
|
|
1069
|
+
if (!(!B(i, R) || !B(a, z))) return {
|
|
1063
1070
|
format: "traceparent",
|
|
1064
|
-
headers:
|
|
1071
|
+
headers: H(e, [L]),
|
|
1065
1072
|
sampled: (Number.parseInt(o, 16) & 1) == 1,
|
|
1066
1073
|
spanId: a,
|
|
1067
1074
|
traceId: i
|
|
@@ -1071,7 +1078,7 @@ var xe = (e, t) => typeof e.enabled == "function" ? e.enabled(t) : e.enabled !==
|
|
|
1071
1078
|
var t;
|
|
1072
1079
|
let n = (t = e("sentry-trace")) == null ? void 0 : t.trim().toLowerCase();
|
|
1073
1080
|
if (!n) return;
|
|
1074
|
-
let r =
|
|
1081
|
+
let r = H(e, ["sentry-trace"]), i = Wt.exec(n);
|
|
1075
1082
|
if (!i) return {
|
|
1076
1083
|
format: "sentry-trace",
|
|
1077
1084
|
headers: r
|
|
@@ -1080,7 +1087,7 @@ var xe = (e, t) => typeof e.enabled == "function" ? e.enabled(t) : e.enabled !==
|
|
|
1080
1087
|
return S(S({
|
|
1081
1088
|
format: "sentry-trace",
|
|
1082
1089
|
headers: r
|
|
1083
|
-
}, s === void 0 ? {} : { sampled: s === "1" }),
|
|
1090
|
+
}, s === void 0 ? {} : { sampled: s === "1" }), B(a, R) && B(o, z) ? {
|
|
1084
1091
|
spanId: o,
|
|
1085
1092
|
traceId: a
|
|
1086
1093
|
} : {});
|
|
@@ -1089,10 +1096,10 @@ var xe = (e, t) => typeof e.enabled == "function" ? e.enabled(t) : e.enabled !==
|
|
|
1089
1096
|
var t;
|
|
1090
1097
|
let n = (t = e("b3")) == null ? void 0 : t.trim().toLowerCase();
|
|
1091
1098
|
if (!n) return;
|
|
1092
|
-
let [r, i, a] = n.split("-"), o = r ?
|
|
1099
|
+
let [r, i, a] = n.split("-"), o = r ? qt(r) : void 0, s = i ? Jt(i) : void 0;
|
|
1093
1100
|
return S(S({
|
|
1094
1101
|
format: "b3",
|
|
1095
|
-
headers:
|
|
1102
|
+
headers: H(e, ["b3"])
|
|
1096
1103
|
}, o && s ? {
|
|
1097
1104
|
spanId: s,
|
|
1098
1105
|
traceId: o
|
|
@@ -1102,10 +1109,10 @@ var xe = (e, t) => typeof e.enabled == "function" ? e.enabled(t) : e.enabled !==
|
|
|
1102
1109
|
var t, n, r;
|
|
1103
1110
|
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();
|
|
1104
1111
|
if (!i && !a && !o) return;
|
|
1105
|
-
let s = i ?
|
|
1112
|
+
let s = i ? qt(i) : void 0, c = a ? Jt(a) : void 0;
|
|
1106
1113
|
return S(S({
|
|
1107
1114
|
format: "b3-multi",
|
|
1108
|
-
headers:
|
|
1115
|
+
headers: H(e, [
|
|
1109
1116
|
"x-b3-traceid",
|
|
1110
1117
|
"x-b3-spanid",
|
|
1111
1118
|
"x-b3-parentspanid",
|
|
@@ -1121,10 +1128,10 @@ var xe = (e, t) => typeof e.enabled == "function" ? e.enabled(t) : e.enabled !==
|
|
|
1121
1128
|
var t, n, r, i, a, o;
|
|
1122
1129
|
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();
|
|
1123
1130
|
if (!s && !c && !l) return;
|
|
1124
|
-
let u = (i = e("x-datadog-tags")) == null ? void 0 : i.trim().toLowerCase(), d = (a = u ? (o =
|
|
1131
|
+
let u = (i = e("x-datadog-tags")) == null ? void 0 : i.trim().toLowerCase(), d = (a = u ? (o = Gt.exec(u)) == null ? void 0 : o[1] : void 0) == null ? Kt : a, f = s ? Yt(s) : void 0, p = f ? qt(`${d}${f}`) : void 0, m = c ? Yt(c) : void 0, h = m ? Jt(m) : void 0;
|
|
1125
1132
|
return S(S({
|
|
1126
1133
|
format: "datadog",
|
|
1127
|
-
headers:
|
|
1134
|
+
headers: H(e, [
|
|
1128
1135
|
"x-datadog-trace-id",
|
|
1129
1136
|
"x-datadog-parent-id",
|
|
1130
1137
|
"x-datadog-sampling-priority",
|
|
@@ -1143,38 +1150,42 @@ var xe = (e, t) => typeof e.enabled == "function" ? e.enabled(t) : e.enabled !==
|
|
|
1143
1150
|
let r = n.split("-")[0];
|
|
1144
1151
|
return S({
|
|
1145
1152
|
format: "sw8",
|
|
1146
|
-
headers:
|
|
1153
|
+
headers: H(e, ["sw8"])
|
|
1147
1154
|
}, r ? { sampled: r === "1" } : {});
|
|
1148
1155
|
}
|
|
1149
|
-
],
|
|
1150
|
-
for (let t of
|
|
1156
|
+
], Zt = (e) => {
|
|
1157
|
+
for (let t of Xt) {
|
|
1151
1158
|
let n = t(e);
|
|
1152
1159
|
if (n) return n;
|
|
1153
1160
|
}
|
|
1154
|
-
},
|
|
1161
|
+
}, Qt = (e, t, r, i) => ({
|
|
1155
1162
|
attributes: r,
|
|
1156
1163
|
context: {
|
|
1157
1164
|
spanId: t,
|
|
1158
1165
|
traceFlags: i === !1 ? n.NONE : n.SAMPLED,
|
|
1159
1166
|
traceId: e
|
|
1160
1167
|
}
|
|
1161
|
-
}),
|
|
1168
|
+
}), $t = (e) => {
|
|
1162
1169
|
var t, n;
|
|
1163
|
-
let r =
|
|
1170
|
+
let r = Zt(e);
|
|
1164
1171
|
if (!r) {
|
|
1165
|
-
let e =
|
|
1172
|
+
let e = V(R), t = V(z), n = `00-${e}-${t}-01`;
|
|
1166
1173
|
return {
|
|
1167
|
-
links: [
|
|
1174
|
+
links: [Qt(e, t, {
|
|
1168
1175
|
format: "traceparent",
|
|
1169
|
-
|
|
1176
|
+
injected: !0,
|
|
1177
|
+
[L]: n
|
|
1170
1178
|
})],
|
|
1171
1179
|
traceparent: n
|
|
1172
1180
|
};
|
|
1173
1181
|
}
|
|
1174
|
-
return { links: [
|
|
1175
|
-
|
|
1176
|
-
|
|
1177
|
-
},
|
|
1182
|
+
return { links: [Qt((t = r.traceId) == null ? V(R) : t, (n = r.spanId) == null ? V(z) : n, S({
|
|
1183
|
+
format: r.format,
|
|
1184
|
+
injected: !1
|
|
1185
|
+
}, r.headers), r.sampled)] };
|
|
1186
|
+
}, en = (e) => e.deliveryType === "cache" || e.transferSize === 0 && e.decodedBodySize > 0 ? !0 : void 0, tn = (e) => e.transferSize === 0 && e.encodedBodySize === 0 && e.decodedBodySize === 0 && e.requestStart === 0 && e.responseStart === 0 && !e.nextHopProtocol, nn = (...e) => e.every((t, n) => n === 0 || e[n - 1] <= t), U = (e, t, n, r, i) => {
|
|
1187
|
+
nn(n, r, i) && (e[`resource.${t}.start`] = r - n, e[`resource.${t}.duration`] = i - r);
|
|
1188
|
+
}, rn = (e) => {
|
|
1178
1189
|
let t = {}, n = [
|
|
1179
1190
|
e.startTime,
|
|
1180
1191
|
e.fetchStart,
|
|
@@ -1186,16 +1197,16 @@ var xe = (e, t) => typeof e.enabled == "function" ? e.enabled(t) : e.enabled !==
|
|
|
1186
1197
|
e.responseStart,
|
|
1187
1198
|
e.responseEnd
|
|
1188
1199
|
];
|
|
1189
|
-
return !n.every(Number.isFinite) ||
|
|
1190
|
-
},
|
|
1191
|
-
let t =
|
|
1192
|
-
return S(S(S(S(S({ [g.cacheHit]:
|
|
1200
|
+
return !n.every(Number.isFinite) || !nn(...n) ? t : (U(t, "first_byte", e.startTime, e.requestStart, e.responseStart), U(t, "download", e.startTime, e.responseStart, e.responseEnd), e.workerStart > 0 && e.workerStart < e.fetchStart && U(t, "worker", e.startTime, e.workerStart, e.fetchStart), e.fetchStart < e.domainLookupEnd && U(t, "dns", e.startTime, e.domainLookupStart, e.domainLookupEnd), e.fetchStart < e.connectEnd && (U(t, "connect", e.startTime, e.connectStart, e.connectEnd), e.connectStart <= e.secureConnectionStart && e.secureConnectionStart <= e.connectEnd && U(t, "ssl", e.startTime, e.secureConnectionStart, e.connectEnd)), e.redirectEnd > e.startTime && nn(e.startTime, e.redirectStart, e.redirectEnd, e.fetchStart) && U(t, "redirect", e.startTime, e.redirectStart, e.redirectEnd), t);
|
|
1201
|
+
}, an = (e) => e.duration === 0 && e.responseEnd > e.startTime ? e.responseEnd - e.startTime : e.duration, on = (e) => {
|
|
1202
|
+
let t = tn(e), n = typeof e.deliveryType == "string" && e.deliveryType ? e.deliveryType : void 0;
|
|
1203
|
+
return S(S(S(S(S({ [g.cacheHit]: en(e) }, e.nextHopProtocol ? { [g.nextHopProtocol]: e.nextHopProtocol } : {}), rn(e)), n ? { "resource.delivery_type": n } : {}), e.renderBlockingStatus ? { "resource.render_blocking_status": e.renderBlockingStatus } : {}), t ? {} : {
|
|
1193
1204
|
"resource.size": e.decodedBodySize,
|
|
1194
1205
|
"resource.encoded_body_size": e.encodedBodySize,
|
|
1195
1206
|
"resource.decoded_body_size": e.decodedBodySize,
|
|
1196
1207
|
"resource.transfer_size": e.transferSize
|
|
1197
1208
|
});
|
|
1198
|
-
},
|
|
1209
|
+
}, sn = (t = !0) => {
|
|
1199
1210
|
let n;
|
|
1200
1211
|
return {
|
|
1201
1212
|
name: "resource",
|
|
@@ -1203,21 +1214,21 @@ var xe = (e, t) => typeof e.enabled == "function" ? e.enabled(t) : e.enabled !==
|
|
|
1203
1214
|
var i;
|
|
1204
1215
|
if (typeof PerformanceObserver > "u" || !((i = PerformanceObserver.supportedEntryTypes) != null && i.includes("resource"))) return;
|
|
1205
1216
|
let a = (n) => {
|
|
1206
|
-
if (!r.isSampled() || !n.name ||
|
|
1217
|
+
if (!r.isSampled() || !n.name || D(r.config, n.name)) return;
|
|
1207
1218
|
if (n.initiatorType === "fetch" || n.initiatorType === "xmlhttprequest") {
|
|
1208
|
-
|
|
1219
|
+
Lt(n);
|
|
1209
1220
|
return;
|
|
1210
1221
|
}
|
|
1211
1222
|
if (n.duration < 0) return;
|
|
1212
|
-
let i = r.config.hooks.redactUrl(n.name), a =
|
|
1213
|
-
t && r.isSampled() && r.startSpan("browser.resource", S(S(S({}, r.config.hooks.getPageAttributes()),
|
|
1223
|
+
let i = r.config.hooks.redactUrl(n.name), a = an(n), o = performance.timeOrigin + n.startTime, s = o + a;
|
|
1224
|
+
t && r.isSampled() && r.startSpan("browser.resource", S(S(S({}, r.config.hooks.getPageAttributes()), Xe({
|
|
1214
1225
|
initiatorType: n.initiatorType || "other",
|
|
1215
1226
|
outcome: typeof n.responseStatus == "number" ? {
|
|
1216
1227
|
statusCode: n.responseStatus,
|
|
1217
1228
|
type: "response"
|
|
1218
1229
|
} : void 0,
|
|
1219
1230
|
url: i
|
|
1220
|
-
})), {}, { "url.full": i },
|
|
1231
|
+
})), {}, { "url.full": i }, on(n)), {
|
|
1221
1232
|
kind: e.CLIENT,
|
|
1222
1233
|
startTime: o
|
|
1223
1234
|
}).end(s), r.notifyActivity({
|
|
@@ -1242,31 +1253,31 @@ var xe = (e, t) => typeof e.enabled == "function" ? e.enabled(t) : e.enabled !==
|
|
|
1242
1253
|
n == null || n.disconnect(), n = void 0;
|
|
1243
1254
|
}
|
|
1244
1255
|
};
|
|
1245
|
-
},
|
|
1256
|
+
}, cn = (e) => typeof e.config.tracking.request == "object" ? e.config.tracking.request : void 0, ln = (e) => {
|
|
1246
1257
|
var t;
|
|
1247
|
-
let n = (t =
|
|
1258
|
+
let n = (t = cn(e)) == null ? void 0 : t.allowedTracingUrls;
|
|
1248
1259
|
return Array.isArray(n) ? n.length > 0 : n !== void 0;
|
|
1249
|
-
},
|
|
1260
|
+
}, un = (e) => typeof e == "object" && e && "name" in e && typeof e.name == "string" ? e.name : "", dn = (e, t) => {
|
|
1250
1261
|
let n = e.signal;
|
|
1251
|
-
return
|
|
1262
|
+
return un(n == null ? void 0 : n.reason) === "TimeoutError" || un(t) === "TimeoutError" ? {
|
|
1252
1263
|
error: t,
|
|
1253
1264
|
type: "timeout"
|
|
1254
|
-
} : n != null && n.aborted ||
|
|
1265
|
+
} : n != null && n.aborted || un(t) === "AbortError" ? { type: "abort" } : {
|
|
1255
1266
|
error: t,
|
|
1256
1267
|
type: "network_error"
|
|
1257
1268
|
};
|
|
1258
|
-
},
|
|
1269
|
+
}, fn = (e, t) => e === "abort" ? { type: "abort" } : e === "timeout" ? { type: "timeout" } : e === "error" || t.status === 0 ? { type: "network_error" } : {
|
|
1259
1270
|
statusCode: t.status,
|
|
1260
1271
|
type: "response"
|
|
1261
|
-
},
|
|
1272
|
+
}, pn = (e) => e.type === "network_error" || e.type === "timeout" || e.type === "response" && typeof e.statusCode == "number" && e.statusCode >= 400, mn = (e) => typeof e == "string" || e instanceof URL ? E(String(e)) : E(e.url), hn = (e, t) => {
|
|
1262
1273
|
var n;
|
|
1263
1274
|
return ((n = t == null ? void 0 : t.method) == null ? typeof Request < "u" && e instanceof Request ? e.method : "GET" : n).toUpperCase();
|
|
1264
|
-
},
|
|
1275
|
+
}, gn = (e, t) => typeof Request < "u" && e instanceof Request ? e : t == null ? {} : t, _n = (e, t) => {
|
|
1265
1276
|
var n;
|
|
1266
1277
|
let r = typeof Request < "u" && e instanceof Request ? e.headers : void 0;
|
|
1267
1278
|
return new Headers((n = t == null ? void 0 : t.headers) == null ? r : n);
|
|
1268
|
-
},
|
|
1269
|
-
if (
|
|
1279
|
+
}, vn = (e, t, n) => n.traceparent ? (t.set(L, n.traceparent), S(S({}, e), {}, { headers: t })) : e, yn = (e) => (t) => e == null ? void 0 : e[t.toLowerCase()], bn = (e, t) => D(e.config, t) || O(e.config.view.excludedActivityUrls, t), xn = (e, t) => {
|
|
1280
|
+
if (bn(e, t)) return () => {};
|
|
1270
1281
|
let n = h("request");
|
|
1271
1282
|
e.notifyActivity({
|
|
1272
1283
|
id: n,
|
|
@@ -1282,30 +1293,33 @@ var xe = (e, t) => typeof e.enabled == "function" ? e.enabled(t) : e.enabled !==
|
|
|
1282
1293
|
type: "request_end"
|
|
1283
1294
|
}));
|
|
1284
1295
|
};
|
|
1285
|
-
},
|
|
1296
|
+
}, Sn = (e, t) => e.isSampled() ? Rt(t) : {
|
|
1286
1297
|
cancel() {},
|
|
1287
1298
|
complete(e) {
|
|
1288
1299
|
e();
|
|
1289
1300
|
}
|
|
1290
|
-
},
|
|
1301
|
+
}, Cn = (t, n, r, i) => {
|
|
1291
1302
|
var a, o;
|
|
1292
1303
|
let s = (a = r.startedAt) == null ? Date.now() : a;
|
|
1293
|
-
return t.startSpan("browser.resource", S(S(S({}, t.config.hooks.getPageAttributes()),
|
|
1304
|
+
return t.startSpan("browser.resource", S(S(S({}, t.config.hooks.getPageAttributes()), Xe({
|
|
1294
1305
|
initiatorType: n,
|
|
1295
1306
|
method: r.method,
|
|
1296
1307
|
url: (o = r.url) == null ? "" : o
|
|
1297
|
-
})), r.url ? {
|
|
1308
|
+
})), r.url ? {
|
|
1309
|
+
"url.full": t.config.hooks.redactUrl(r.url),
|
|
1310
|
+
"url.template": t.config.hooks.getRequestUrlTemplate(r.url)
|
|
1311
|
+
} : {}), S({
|
|
1298
1312
|
kind: e.CLIENT,
|
|
1299
1313
|
startTime: s
|
|
1300
1314
|
}, i ? { links: i.links } : {}));
|
|
1301
|
-
},
|
|
1315
|
+
}, wn = (e, n, r, i, a, o = {}) => {
|
|
1302
1316
|
let s = o.url, c = s ? e.config.hooks.redactUrl(s) : void 0, l = o.method, u = {
|
|
1303
|
-
attributes: S(S(S({}, e.config.hooks.getPageAttributes()),
|
|
1317
|
+
attributes: S(S(S(S({}, e.config.hooks.getPageAttributes()), Xe({
|
|
1304
1318
|
initiatorType: r,
|
|
1305
1319
|
method: l,
|
|
1306
1320
|
outcome: a,
|
|
1307
1321
|
url: c == null ? "" : c
|
|
1308
|
-
})), c ? { "url.full": c } : {}),
|
|
1322
|
+
})), c ? { "url.full": c } : {}), s ? { "url.template": e.config.hooks.getRequestUrlTemplate(s) } : {}),
|
|
1309
1323
|
resource: {
|
|
1310
1324
|
method: l,
|
|
1311
1325
|
outcome: a,
|
|
@@ -1316,17 +1330,17 @@ var xe = (e, t) => typeof e.enabled == "function" ? e.enabled(t) : e.enabled !==
|
|
|
1316
1330
|
}, d = !0;
|
|
1317
1331
|
try {
|
|
1318
1332
|
var f, p;
|
|
1319
|
-
d = (f =
|
|
1333
|
+
d = (f = cn(e)) == null || (p = f.beforeSend) == null ? void 0 : p.call(f, u, i);
|
|
1320
1334
|
} catch (t) {
|
|
1321
1335
|
var m;
|
|
1322
1336
|
e.config.debug && ((m = globalThis.console) == null || m.warn("[bk-ot] request.beforeSend failed:", t));
|
|
1323
1337
|
}
|
|
1324
1338
|
if (n.setAttributes(e.applyRedact(u.attributes)), d === !1) {
|
|
1325
|
-
|
|
1339
|
+
Re(n);
|
|
1326
1340
|
return;
|
|
1327
1341
|
}
|
|
1328
|
-
|
|
1329
|
-
},
|
|
1342
|
+
pn(a) && n.setStatus({ code: t.ERROR });
|
|
1343
|
+
}, Tn = (e) => {
|
|
1330
1344
|
let t = [], n = /* @__PURE__ */ new Set();
|
|
1331
1345
|
return {
|
|
1332
1346
|
name: "request",
|
|
@@ -1335,20 +1349,20 @@ var xe = (e, t) => typeof e.enabled == "function" ? e.enabled(t) : e.enabled !==
|
|
|
1335
1349
|
if (!(typeof window > "u")) {
|
|
1336
1350
|
if (typeof window.fetch == "function") {
|
|
1337
1351
|
let r = window.fetch, i = /* @__PURE__ */ function() {
|
|
1338
|
-
var t =
|
|
1339
|
-
let a =
|
|
1340
|
-
if (!e.isSampled() ||
|
|
1352
|
+
var t = k(function* (t, i) {
|
|
1353
|
+
let a = mn(t);
|
|
1354
|
+
if (!e.isSampled() || _e(e.config, a)) return r.call(this, t, i);
|
|
1341
1355
|
let o = {
|
|
1342
|
-
method:
|
|
1356
|
+
method: hn(t, i),
|
|
1343
1357
|
startedAt: Date.now(),
|
|
1344
1358
|
url: a
|
|
1345
|
-
}, s =
|
|
1359
|
+
}, s = ve(e.config, a) ? _n(t, i) : void 0, c = s ? $t((e) => {
|
|
1346
1360
|
var t;
|
|
1347
1361
|
return (t = s.get(e)) == null ? void 0 : t;
|
|
1348
|
-
}) : void 0, l =
|
|
1362
|
+
}) : void 0, l = Cn(e, "fetch", o, c), u = Sn(e, a), d = xn(e, a), f = gn(t, i), p = s && c ? vn(i, s, c) : i, m = !1, h = (t, r = Date.now()) => {
|
|
1349
1363
|
if (!m) {
|
|
1350
1364
|
if (m = !0, n.delete(g), t) {
|
|
1351
|
-
l.setAttributes(e.applyRedact(
|
|
1365
|
+
l.setAttributes(e.applyRedact(on(t))), l.end(performance.timeOrigin + t.startTime + an(t));
|
|
1352
1366
|
return;
|
|
1353
1367
|
}
|
|
1354
1368
|
l.end(r);
|
|
@@ -1359,7 +1373,7 @@ var xe = (e, t) => typeof e.enabled == "function" ? e.enabled(t) : e.enabled !==
|
|
|
1359
1373
|
n.add(g);
|
|
1360
1374
|
try {
|
|
1361
1375
|
let n = yield r.call(this, t, p), i = S(S({}, n.status > 0 ? { statusCode: n.status } : {}), {}, { type: "response" });
|
|
1362
|
-
|
|
1376
|
+
wn(e, l, "fetch", {
|
|
1363
1377
|
request: f,
|
|
1364
1378
|
response: n,
|
|
1365
1379
|
type: "fetch"
|
|
@@ -1367,8 +1381,8 @@ var xe = (e, t) => typeof e.enabled == "function" ? e.enabled(t) : e.enabled !==
|
|
|
1367
1381
|
let a = Date.now();
|
|
1368
1382
|
return u.complete((e) => h(e, a)), n;
|
|
1369
1383
|
} catch (t) {
|
|
1370
|
-
let n =
|
|
1371
|
-
|
|
1384
|
+
let n = dn(f, t);
|
|
1385
|
+
wn(e, l, "fetch", {
|
|
1372
1386
|
error: t,
|
|
1373
1387
|
request: f,
|
|
1374
1388
|
type: "fetch"
|
|
@@ -1391,15 +1405,15 @@ var xe = (e, t) => typeof e.enabled == "function" ? e.enabled(t) : e.enabled !==
|
|
|
1391
1405
|
let r = /* @__PURE__ */ new WeakMap(), i = /* @__PURE__ */ new WeakMap(), a = XMLHttpRequest.prototype.open, o = XMLHttpRequest.prototype.send, s = function(e, t, n = !0, o, s) {
|
|
1392
1406
|
return r.set(this, {
|
|
1393
1407
|
method: e.toUpperCase(),
|
|
1394
|
-
url:
|
|
1408
|
+
url: E(String(t))
|
|
1395
1409
|
}), i.delete(this), a.call(this, e, String(t), n, o, s);
|
|
1396
1410
|
}, c = function(t) {
|
|
1397
1411
|
var a;
|
|
1398
1412
|
let s = (a = r.get(this)) == null ? {} : a;
|
|
1399
|
-
if (!e.isSampled() || !s.url ||
|
|
1413
|
+
if (!e.isSampled() || !s.url || _e(e.config, s.url)) return o.call(this, t);
|
|
1400
1414
|
s.startedAt = Date.now();
|
|
1401
|
-
let c =
|
|
1402
|
-
c != null && c.traceparent && this.setRequestHeader(
|
|
1415
|
+
let c = ve(e.config, s.url) ? $t(yn(i.get(this))) : void 0, l = Cn(e, "xhr", s, c), u = Sn(e, s.url), d = xn(e, s.url);
|
|
1416
|
+
c != null && c.traceparent && this.setRequestHeader(L, c.traceparent);
|
|
1403
1417
|
let f = !1, p = !1, m = () => {}, h = () => {
|
|
1404
1418
|
m(), u.cancel(), !p && (p = !0, n.delete(h), d(), l.end());
|
|
1405
1419
|
};
|
|
@@ -1407,8 +1421,8 @@ var xe = (e, t) => typeof e.enabled == "function" ? e.enabled(t) : e.enabled !==
|
|
|
1407
1421
|
let g = (t) => {
|
|
1408
1422
|
if (f || p) return;
|
|
1409
1423
|
f = !0, m();
|
|
1410
|
-
let r =
|
|
1411
|
-
|
|
1424
|
+
let r = fn(t, this);
|
|
1425
|
+
wn(e, l, "xhr", {
|
|
1412
1426
|
type: "xhr",
|
|
1413
1427
|
xhr: this
|
|
1414
1428
|
}, r, s), d();
|
|
@@ -1416,7 +1430,7 @@ var xe = (e, t) => typeof e.enabled == "function" ? e.enabled(t) : e.enabled !==
|
|
|
1416
1430
|
u.complete((t) => {
|
|
1417
1431
|
if (!p) {
|
|
1418
1432
|
if (p = !0, n.delete(h), t) {
|
|
1419
|
-
l.setAttributes(e.applyRedact(
|
|
1433
|
+
l.setAttributes(e.applyRedact(on(t))), l.end(performance.timeOrigin + t.startTime + an(t));
|
|
1420
1434
|
return;
|
|
1421
1435
|
}
|
|
1422
1436
|
l.end(i);
|
|
@@ -1434,7 +1448,7 @@ var xe = (e, t) => typeof e.enabled == "function" ? e.enabled(t) : e.enabled !==
|
|
|
1434
1448
|
};
|
|
1435
1449
|
if (XMLHttpRequest.prototype.open = s, XMLHttpRequest.prototype.send = c, t.push(() => {
|
|
1436
1450
|
XMLHttpRequest.prototype.open === s && (XMLHttpRequest.prototype.open = a), XMLHttpRequest.prototype.send === c && (XMLHttpRequest.prototype.send = o);
|
|
1437
|
-
}),
|
|
1451
|
+
}), ln(e) && typeof XMLHttpRequest.prototype.setRequestHeader == "function") {
|
|
1438
1452
|
let e = XMLHttpRequest.prototype.setRequestHeader, n = function(t, n) {
|
|
1439
1453
|
var r;
|
|
1440
1454
|
let a = t.toLowerCase(), o = (r = i.get(this)) == null ? {} : r;
|
|
@@ -1453,9 +1467,9 @@ var xe = (e, t) => typeof e.enabled == "function" ? e.enabled(t) : e.enabled !==
|
|
|
1453
1467
|
for (; t.length;) (e = t.pop()) == null || e();
|
|
1454
1468
|
}
|
|
1455
1469
|
};
|
|
1456
|
-
},
|
|
1457
|
-
if (t) return
|
|
1458
|
-
},
|
|
1470
|
+
}, En = /^https?:|^\/\//i, Dn = (e, t) => {
|
|
1471
|
+
if (t) return En.test(t) ? e(t) : t;
|
|
1472
|
+
}, On = () => {
|
|
1459
1473
|
let e;
|
|
1460
1474
|
return {
|
|
1461
1475
|
name: "csp-violation",
|
|
@@ -1463,11 +1477,11 @@ var xe = (e, t) => typeof e.enabled == "function" ? e.enabled(t) : e.enabled !==
|
|
|
1463
1477
|
if (typeof window > "u" || typeof document > "u") return;
|
|
1464
1478
|
let n = (e) => {
|
|
1465
1479
|
if (!t.isSampled()) return;
|
|
1466
|
-
let n = Date.now(), r =
|
|
1467
|
-
t.startSpan("csp.violation", S(S(S({}, t.config.hooks.getPageAttributes()),
|
|
1468
|
-
outcome:
|
|
1480
|
+
let n = Date.now(), r = Dn(t.config.hooks.redactUrl, e.blockedURI), i = e.sourceFile ? t.config.hooks.redactUrl(e.sourceFile) : void 0;
|
|
1481
|
+
t.startSpan("csp.violation", S(S(S({}, t.config.hooks.getPageAttributes()), M({
|
|
1482
|
+
outcome: A.error,
|
|
1469
1483
|
outcomeReason: "csp",
|
|
1470
|
-
spanType:
|
|
1484
|
+
spanType: j.error
|
|
1471
1485
|
})), {}, {
|
|
1472
1486
|
"csp.blocked_uri": r,
|
|
1473
1487
|
"csp.violated_directive": e.violatedDirective,
|
|
@@ -1487,7 +1501,7 @@ var xe = (e, t) => typeof e.enabled == "function" ? e.enabled(t) : e.enabled !==
|
|
|
1487
1501
|
e == null || e(), e = void 0;
|
|
1488
1502
|
}
|
|
1489
1503
|
};
|
|
1490
|
-
},
|
|
1504
|
+
}, kn = (e) => {
|
|
1491
1505
|
if (e instanceof Error) return e.message;
|
|
1492
1506
|
if (typeof e == "string") return e;
|
|
1493
1507
|
try {
|
|
@@ -1495,9 +1509,9 @@ var xe = (e, t) => typeof e.enabled == "function" ? e.enabled(t) : e.enabled !==
|
|
|
1495
1509
|
} catch (t) {
|
|
1496
1510
|
return String(e);
|
|
1497
1511
|
}
|
|
1498
|
-
},
|
|
1512
|
+
}, An = ({ context: e, error: n, exceptionType: r, extra: i = {}, source: a, spanName: o }) => {
|
|
1499
1513
|
if (!e.isSampled()) return;
|
|
1500
|
-
let s = Date.now(), c =
|
|
1514
|
+
let s = Date.now(), c = kn(n);
|
|
1501
1515
|
e.notifyActivity({
|
|
1502
1516
|
time: s,
|
|
1503
1517
|
type: "error"
|
|
@@ -1505,9 +1519,9 @@ var xe = (e, t) => typeof e.enabled == "function" ? e.enabled(t) : e.enabled !==
|
|
|
1505
1519
|
let l = n instanceof Error ? n : {
|
|
1506
1520
|
message: c,
|
|
1507
1521
|
name: r == null ? a : r
|
|
1508
|
-
}, u = S(S(S(S({}, e.config.hooks.getPageAttributes()), e.config.hooks.getErrorAttributes()),
|
|
1509
|
-
outcome:
|
|
1510
|
-
spanType:
|
|
1522
|
+
}, u = S(S(S(S({}, e.config.hooks.getPageAttributes()), e.config.hooks.getErrorAttributes()), M({
|
|
1523
|
+
outcome: A.error,
|
|
1524
|
+
spanType: j.error
|
|
1511
1525
|
})), {}, {
|
|
1512
1526
|
"error.message": c,
|
|
1513
1527
|
"error.handled": !1,
|
|
@@ -1517,7 +1531,7 @@ var xe = (e, t) => typeof e.enabled == "function" ? e.enabled(t) : e.enabled !==
|
|
|
1517
1531
|
code: t.ERROR,
|
|
1518
1532
|
message: c
|
|
1519
1533
|
}), d.end();
|
|
1520
|
-
},
|
|
1534
|
+
}, jn = () => {
|
|
1521
1535
|
let e = [];
|
|
1522
1536
|
return {
|
|
1523
1537
|
name: "error",
|
|
@@ -1526,7 +1540,7 @@ var xe = (e, t) => typeof e.enabled == "function" ? e.enabled(t) : e.enabled !==
|
|
|
1526
1540
|
let n = (e) => {
|
|
1527
1541
|
var n;
|
|
1528
1542
|
let r = !e.error && !e.filename && e.message === "Script error.";
|
|
1529
|
-
|
|
1543
|
+
An({
|
|
1530
1544
|
context: t,
|
|
1531
1545
|
spanName: "browser.error",
|
|
1532
1546
|
source: "window.error",
|
|
@@ -1538,7 +1552,7 @@ var xe = (e, t) => typeof e.enabled == "function" ? e.enabled(t) : e.enabled !==
|
|
|
1538
1552
|
}, r ? { "error.cross_origin": !0 } : {})
|
|
1539
1553
|
});
|
|
1540
1554
|
}, r = (e) => {
|
|
1541
|
-
|
|
1555
|
+
An({
|
|
1542
1556
|
context: t,
|
|
1543
1557
|
spanName: "browser.unhandledrejection",
|
|
1544
1558
|
source: "unhandledrejection",
|
|
@@ -1550,7 +1564,7 @@ var xe = (e, t) => typeof e.enabled == "function" ? e.enabled(t) : e.enabled !==
|
|
|
1550
1564
|
let n = e.target;
|
|
1551
1565
|
if (!(n instanceof Element)) return;
|
|
1552
1566
|
let r = n, i = r.src || r.href || n.currentSrc || "";
|
|
1553
|
-
|
|
1567
|
+
An({
|
|
1554
1568
|
context: t,
|
|
1555
1569
|
spanName: "browser.resource_error",
|
|
1556
1570
|
source: "resource",
|
|
@@ -1571,7 +1585,7 @@ var xe = (e, t) => typeof e.enabled == "function" ? e.enabled(t) : e.enabled !==
|
|
|
1571
1585
|
}
|
|
1572
1586
|
}
|
|
1573
1587
|
};
|
|
1574
|
-
},
|
|
1588
|
+
}, Mn = 50, Nn = (e, t) => typeof e == "number" && Number.isFinite(e) && e >= 0 ? e : t, W = (e) => Number.isFinite(e) ? e : void 0, Pn = (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 } : {}), Fn = (e, t) => ({
|
|
1575
1589
|
"long_task.script.duration": e.duration,
|
|
1576
1590
|
"long_task.script.execution_start": e.executionStart,
|
|
1577
1591
|
"long_task.script.forced_style_and_layout_duration": e.forcedStyleAndLayoutDuration,
|
|
@@ -1583,8 +1597,8 @@ var xe = (e, t) => typeof e.enabled == "function" ? e.enabled(t) : e.enabled !==
|
|
|
1583
1597
|
"long_task.script.source_url": e.sourceURL ? t(e.sourceURL) : "",
|
|
1584
1598
|
"long_task.script.start_time": e.startTime,
|
|
1585
1599
|
"long_task.script.window_attribution": e.windowAttribution
|
|
1586
|
-
}),
|
|
1587
|
-
let t =
|
|
1600
|
+
}), In = (e = {}) => {
|
|
1601
|
+
let t = Nn(e.threshold, Mn), n, r, i = [];
|
|
1588
1602
|
return {
|
|
1589
1603
|
name: "long-task",
|
|
1590
1604
|
init(e) {
|
|
@@ -1595,16 +1609,16 @@ var xe = (e, t) => typeof e.enabled == "function" ? e.enabled(t) : e.enabled !==
|
|
|
1595
1609
|
let c = (n) => {
|
|
1596
1610
|
var r, i;
|
|
1597
1611
|
if (!e.isSampled() || !Number.isFinite(n.duration) || n.duration < t) return;
|
|
1598
|
-
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(S({}, e.config.hooks.getPageAttributes()),
|
|
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(S({}, e.config.hooks.getPageAttributes()), M({ spanType: j.longTask })), W(o == null ? void 0 : o.blockingDuration) === void 0 ? {} : { [g.longTaskBlockingDuration]: o.blockingDuration }), {}, {
|
|
1599
1613
|
[g.longTaskDuration]: n.duration,
|
|
1600
1614
|
[g.longTaskEntryType]: d,
|
|
1601
1615
|
[g.longTaskId]: c,
|
|
1602
1616
|
"long_task.name": n.name
|
|
1603
|
-
},
|
|
1617
|
+
}, W(o == null ? void 0 : o.firstUIEventTimestamp) === void 0 ? {} : { "long_task.first_ui_event_timestamp": o.firstUIEventTimestamp }), W(o == null ? void 0 : o.renderStart) === void 0 ? {} : { "long_task.render_start": o.renderStart }), W(o == null ? void 0 : o.styleAndLayoutStart) === void 0 ? {} : { "long_task.style_and_layout_start": o.styleAndLayoutStart }), o ? { [g.longTaskStartTime]: o.startTime } : {}), { startTime: l });
|
|
1604
1618
|
s.forEach((t) => {
|
|
1605
|
-
p.addEvent("long_task.script", e.applyRedact(
|
|
1619
|
+
p.addEvent("long_task.script", e.applyRedact(Fn(t, e.config.hooks.redactUrl)), performance.timeOrigin + t.startTime);
|
|
1606
1620
|
}), f.forEach((t, n) => {
|
|
1607
|
-
p.addEvent("long_task.attribution", e.applyRedact(S({ "long_task.attribution.index": n },
|
|
1621
|
+
p.addEvent("long_task.attribution", e.applyRedact(S({ "long_task.attribution.index": n }, Pn(t, e.config.hooks.redactUrl))), l);
|
|
1608
1622
|
}), p.end(u), e.notifyActivity({
|
|
1609
1623
|
endTime: u,
|
|
1610
1624
|
startTime: l,
|
|
@@ -1631,43 +1645,43 @@ var xe = (e, t) => typeof e.enabled == "function" ? e.enabled(t) : e.enabled !==
|
|
|
1631
1645
|
n == null || n.disconnect(), n = void 0, clearTimeout(r), r = void 0, i = [];
|
|
1632
1646
|
}
|
|
1633
1647
|
};
|
|
1634
|
-
},
|
|
1648
|
+
}, G = /* @__PURE__ */ new Set(), K = "", q, J, Ln = !1, Y = () => typeof location > "u" ? "" : location.href, Rn = (e, t) => {
|
|
1635
1649
|
let n = Y();
|
|
1636
|
-
|
|
1650
|
+
K = n;
|
|
1637
1651
|
let r = {
|
|
1638
1652
|
fromUrl: t,
|
|
1639
1653
|
source: e,
|
|
1640
1654
|
toUrl: n
|
|
1641
1655
|
};
|
|
1642
|
-
for (let e of Array.from(
|
|
1643
|
-
},
|
|
1644
|
-
|
|
1645
|
-
},
|
|
1646
|
-
|
|
1647
|
-
},
|
|
1648
|
-
|
|
1649
|
-
let r =
|
|
1656
|
+
for (let e of Array.from(G)) e(r);
|
|
1657
|
+
}, zn = () => {
|
|
1658
|
+
Rn("popstate", K || Y());
|
|
1659
|
+
}, Bn = () => {
|
|
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, [
|
|
1650
1664
|
e,
|
|
1651
1665
|
t,
|
|
1652
1666
|
n
|
|
1653
1667
|
]);
|
|
1654
|
-
return
|
|
1668
|
+
return Rn("pushState", r), i;
|
|
1655
1669
|
}, history.replaceState = function(e, t, n) {
|
|
1656
|
-
let r =
|
|
1670
|
+
let r = K || Y(), i = J == null ? void 0 : J.apply(this, [
|
|
1657
1671
|
e,
|
|
1658
1672
|
t,
|
|
1659
1673
|
n
|
|
1660
1674
|
]);
|
|
1661
|
-
return
|
|
1662
|
-
}, window.addEventListener("popstate",
|
|
1663
|
-
},
|
|
1664
|
-
!
|
|
1665
|
-
},
|
|
1666
|
-
|
|
1675
|
+
return Rn("replaceState", r), i;
|
|
1676
|
+
}, window.addEventListener("popstate", zn), window.addEventListener("hashchange", Bn));
|
|
1677
|
+
}, Hn = () => {
|
|
1678
|
+
!Ln || typeof window > "u" || typeof history > "u" || (q && (history.pushState = q), J && (history.replaceState = J), window.removeEventListener("popstate", zn), window.removeEventListener("hashchange", Bn), q = void 0, J = void 0, Ln = !1, K = "");
|
|
1679
|
+
}, Un = (e) => typeof window > "u" || typeof history > "u" ? () => {} : (Vn(), G.add(e), () => {
|
|
1680
|
+
G.delete(e), G.size === 0 && Hn();
|
|
1667
1681
|
});
|
|
1668
1682
|
//#endregion
|
|
1669
1683
|
//#region \0@oxc-project+runtime@0.128.0/helpers/objectWithoutPropertiesLoose.js
|
|
1670
|
-
function
|
|
1684
|
+
function Wn(e, t) {
|
|
1671
1685
|
if (e == null) return {};
|
|
1672
1686
|
var n = {};
|
|
1673
1687
|
for (var r in e) if ({}.hasOwnProperty.call(e, r)) {
|
|
@@ -1678,9 +1692,9 @@ function Bn(e, t) {
|
|
|
1678
1692
|
}
|
|
1679
1693
|
//#endregion
|
|
1680
1694
|
//#region \0@oxc-project+runtime@0.128.0/helpers/objectWithoutProperties.js
|
|
1681
|
-
function
|
|
1695
|
+
function Gn(e, t) {
|
|
1682
1696
|
if (e == null) return {};
|
|
1683
|
-
var n, r, i =
|
|
1697
|
+
var n, r, i = Wn(e, t);
|
|
1684
1698
|
if (Object.getOwnPropertySymbols) {
|
|
1685
1699
|
var a = Object.getOwnPropertySymbols(e);
|
|
1686
1700
|
for (r = 0; r < a.length; r++) n = a[r], t.includes(n) || {}.propertyIsEnumerable.call(e, n) && (i[n] = e[n]);
|
|
@@ -1689,7 +1703,7 @@ function Vn(e, t) {
|
|
|
1689
1703
|
}
|
|
1690
1704
|
//#endregion
|
|
1691
1705
|
//#region src/plugins/page-view.ts
|
|
1692
|
-
var
|
|
1706
|
+
var Kn = ["stopLoadingTime"], qn = new Set(Object.values(g)), Jn = () => typeof location > "u" ? "" : location.href, Yn = () => {
|
|
1693
1707
|
if (typeof performance > "u") return {};
|
|
1694
1708
|
let e = performance.getEntriesByType("navigation")[0];
|
|
1695
1709
|
if (!e) return {};
|
|
@@ -1697,10 +1711,10 @@ var Hn = ["stopLoadingTime"], Un = new Set(Object.values(g)), Wn = () => typeof
|
|
|
1697
1711
|
Number.isFinite(n) && n > 0 && (t[e] = n);
|
|
1698
1712
|
};
|
|
1699
1713
|
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;
|
|
1700
|
-
},
|
|
1714
|
+
}, Xn = (e) => {
|
|
1701
1715
|
let t = e.indexOf("?");
|
|
1702
1716
|
return t < 0 ? e : e.slice(0, t);
|
|
1703
|
-
},
|
|
1717
|
+
}, Zn = (e) => {
|
|
1704
1718
|
let t = e.slice(1);
|
|
1705
1719
|
if (!t || typeof document > "u" || typeof document.getElementById != "function") return !1;
|
|
1706
1720
|
try {
|
|
@@ -1708,14 +1722,14 @@ var Hn = ["stopLoadingTime"], Un = new Set(Object.values(g)), Wn = () => typeof
|
|
|
1708
1722
|
} catch (e) {
|
|
1709
1723
|
return !!document.getElementById(t);
|
|
1710
1724
|
}
|
|
1711
|
-
},
|
|
1725
|
+
}, Qn = (e, t) => {
|
|
1712
1726
|
try {
|
|
1713
1727
|
let n = typeof location > "u" ? "http://localhost" : location.href, r = new URL(e, n), i = new URL(t, n);
|
|
1714
|
-
return r.pathname !== i.pathname || !
|
|
1728
|
+
return r.pathname !== i.pathname || !Zn(i.hash) && Xn(r.hash) !== Xn(i.hash);
|
|
1715
1729
|
} catch (n) {
|
|
1716
1730
|
return e !== t;
|
|
1717
1731
|
}
|
|
1718
|
-
},
|
|
1732
|
+
}, $n = () => {
|
|
1719
1733
|
let e = [];
|
|
1720
1734
|
return {
|
|
1721
1735
|
name: "page-view",
|
|
@@ -1742,10 +1756,10 @@ var Hn = ["stopLoadingTime"], Un = new Set(Object.values(g)), Wn = () => typeof
|
|
|
1742
1756
|
let s = S({}, n);
|
|
1743
1757
|
(i = n.stopLoadingTime) == null || i.call(n), o(n, "end", r, e), n = void 0, t && a(r);
|
|
1744
1758
|
let { stopLoadingTime: c } = s;
|
|
1745
|
-
return
|
|
1759
|
+
return Gn(s, Kn);
|
|
1746
1760
|
}, c = (e, t, r) => {
|
|
1747
1761
|
if (n !== e || !Number.isFinite(t) || t < 0) return;
|
|
1748
|
-
let i = S(S({}, e.loadingType === "initial_load" ?
|
|
1762
|
+
let i = S(S({}, e.loadingType === "initial_load" ? Yn() : {}), {}, {
|
|
1749
1763
|
[g.viewLoadingTime]: t,
|
|
1750
1764
|
[g.viewLoadingTimeSource]: r
|
|
1751
1765
|
});
|
|
@@ -1770,7 +1784,7 @@ var Hn = ["stopLoadingTime"], Un = new Set(Object.values(g)), Wn = () => typeof
|
|
|
1770
1784
|
};
|
|
1771
1785
|
window.addEventListener("load", t, { once: !0 }), s = () => window.removeEventListener("load", t);
|
|
1772
1786
|
}
|
|
1773
|
-
let p =
|
|
1787
|
+
let p = vt(t, e.startedAt, (t) => {
|
|
1774
1788
|
r = !0, t.hadActivity && (i = Math.max(0, t.endTime - e.startedAt)), d();
|
|
1775
1789
|
}), m = () => {
|
|
1776
1790
|
var t;
|
|
@@ -1781,40 +1795,38 @@ var Hn = ["stopLoadingTime"], Un = new Set(Object.values(g)), Wn = () => typeof
|
|
|
1781
1795
|
}, d();
|
|
1782
1796
|
}, u = (e) => {
|
|
1783
1797
|
let n = t.applyRedact(e == null ? {} : e);
|
|
1784
|
-
return Object.fromEntries(Object.entries(n).filter(([e, t]) => t !== void 0 && !
|
|
1798
|
+
return Object.fromEntries(Object.entries(n).filter(([e, t]) => t !== void 0 && !qn.has(e)));
|
|
1785
1799
|
}, d = (e, r, i, a = ((e) => (e = n == null ? void 0 : n.rawUrl) == null ? "" : e)()) => {
|
|
1786
|
-
var c
|
|
1800
|
+
var c;
|
|
1787
1801
|
if (!t.isSessionActive()) return;
|
|
1788
|
-
let
|
|
1802
|
+
let d = (c = e.url) == null ? Jn() : c, f = t.config.hooks.getViewUrlTemplate(d), p = e.name, m = u(e.attributes);
|
|
1789
1803
|
s(r, !1);
|
|
1790
|
-
let
|
|
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 ? Yn() : {};
|
|
1791
1805
|
t.setView({
|
|
1792
|
-
attributes:
|
|
1793
|
-
id:
|
|
1806
|
+
attributes: m,
|
|
1807
|
+
id: _,
|
|
1794
1808
|
loadingType: i,
|
|
1795
|
-
name:
|
|
1796
|
-
startedAt:
|
|
1797
|
-
url:
|
|
1798
|
-
|
|
1799
|
-
},
|
|
1800
|
-
attributes:
|
|
1809
|
+
name: p,
|
|
1810
|
+
startedAt: x,
|
|
1811
|
+
url: v,
|
|
1812
|
+
urlTemplate: f
|
|
1813
|
+
}, x), n = {
|
|
1814
|
+
attributes: m,
|
|
1801
1815
|
version: 0,
|
|
1802
|
-
id:
|
|
1816
|
+
id: _,
|
|
1803
1817
|
loadingType: i,
|
|
1804
|
-
name:
|
|
1805
|
-
rawUrl:
|
|
1806
|
-
snapshotAttributes: S(S(S(S(S({},
|
|
1807
|
-
[g.
|
|
1808
|
-
[g.
|
|
1809
|
-
[g.viewUrl]: y,
|
|
1810
|
-
[g.viewUrlPathGroup]: p,
|
|
1818
|
+
name: p,
|
|
1819
|
+
rawUrl: d,
|
|
1820
|
+
snapshotAttributes: S(S(S(S(S(S({}, m), t.config.hooks.getPageAttributes()), C), M({ spanType: j.view })), {}, { [g.viewId]: _ }, p ? { [g.viewName]: p } : {}), {}, {
|
|
1821
|
+
[g.viewUrl]: v,
|
|
1822
|
+
[g.viewUrlTemplate]: f,
|
|
1811
1823
|
[g.viewLoadingType]: i,
|
|
1812
|
-
"url.previous":
|
|
1813
|
-
},
|
|
1814
|
-
startedAt:
|
|
1815
|
-
url:
|
|
1816
|
-
|
|
1817
|
-
}, o(n, "start",
|
|
1824
|
+
"url.previous": y
|
|
1825
|
+
}, b ? { "document.referrer": t.config.hooks.redactUrl(document.referrer || "") } : {}),
|
|
1826
|
+
startedAt: x,
|
|
1827
|
+
url: v,
|
|
1828
|
+
urlTemplate: f
|
|
1829
|
+
}, o(n, "start", x), l(n);
|
|
1818
1830
|
}, f = t.onViewCommand((e) => {
|
|
1819
1831
|
if (e.type === "start") {
|
|
1820
1832
|
d(e.options, "manual", n ? "route_change" : "initial_load");
|
|
@@ -1833,12 +1845,12 @@ var Hn = ["stopLoadingTime"], Un = new Set(Object.values(g)), Wn = () => typeof
|
|
|
1833
1845
|
name: n.name,
|
|
1834
1846
|
startedAt: n.startedAt,
|
|
1835
1847
|
url: n.url,
|
|
1836
|
-
|
|
1848
|
+
urlTemplate: n.urlTemplate
|
|
1837
1849
|
}), o(n, "update"));
|
|
1838
1850
|
}
|
|
1839
1851
|
}), p = () => {};
|
|
1840
|
-
t.config.view.tracking === "auto" && (n || d({}, "load", "initial_load"), p =
|
|
1841
|
-
|
|
1852
|
+
t.config.view.tracking === "auto" && (n || d({}, "load", "initial_load"), p = Un((e) => {
|
|
1853
|
+
Qn(e.fromUrl, e.toUrl) && d({}, e.source, "route_change", e.fromUrl);
|
|
1842
1854
|
}));
|
|
1843
1855
|
let m = (e) => {
|
|
1844
1856
|
if (e.persisted) {
|
|
@@ -1880,7 +1892,7 @@ var Hn = ["stopLoadingTime"], Un = new Set(Object.values(g)), Wn = () => typeof
|
|
|
1880
1892
|
}
|
|
1881
1893
|
}
|
|
1882
1894
|
};
|
|
1883
|
-
},
|
|
1895
|
+
}, er = 5e3, tr = (e) => typeof e == "number" && Number.isFinite(e) && e > 0, nr = (e, t, n, r) => ({
|
|
1884
1896
|
expiresAt: Math.min(t + n, t + r),
|
|
1885
1897
|
id: e,
|
|
1886
1898
|
startedAt: t,
|
|
@@ -1888,19 +1900,19 @@ var Hn = ["stopLoadingTime"], Un = new Set(Object.values(g)), Wn = () => typeof
|
|
|
1888
1900
|
}), X = (e, t, n) => {
|
|
1889
1901
|
if (t >= e.startedAt + n) return "maxLifetime";
|
|
1890
1902
|
if (t >= e.expiresAt) return "inactivity";
|
|
1891
|
-
},
|
|
1903
|
+
}, rr = (e, t, n, r) => S(S({}, e), {}, { expiresAt: Math.min(t + n, e.startedAt + r) }), ir = (e, t, n) => {
|
|
1892
1904
|
if (!e) return null;
|
|
1893
1905
|
try {
|
|
1894
1906
|
let r = JSON.parse(e);
|
|
1895
|
-
if (r.status === "active" && typeof r.id == "string" && r.id.length > 0 &&
|
|
1907
|
+
if (r.status === "active" && typeof r.id == "string" && r.id.length > 0 && tr(r.startedAt) && r.startedAt <= t + er && tr(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") && tr(r.expiredAt) && r.expiredAt <= t + er) return r;
|
|
1896
1908
|
} catch (e) {}
|
|
1897
1909
|
return null;
|
|
1898
|
-
},
|
|
1910
|
+
}, ar = 900 * 1e3, Z = 14400 * 1e3, or = 1e3, sr = 6e4, cr = [
|
|
1899
1911
|
"click",
|
|
1900
1912
|
"keydown",
|
|
1901
1913
|
"scroll",
|
|
1902
1914
|
"touchstart"
|
|
1903
|
-
],
|
|
1915
|
+
], lr = /* @__PURE__ */ new Map(), ur = (e) => {
|
|
1904
1916
|
let t = typeof window < "u", n = () => {
|
|
1905
1917
|
var n;
|
|
1906
1918
|
if (t) try {
|
|
@@ -1908,21 +1920,21 @@ var Hn = ["stopLoadingTime"], Un = new Set(Object.values(g)), Wn = () => typeof
|
|
|
1908
1920
|
} catch (e) {
|
|
1909
1921
|
t = !1;
|
|
1910
1922
|
}
|
|
1911
|
-
return (n =
|
|
1923
|
+
return (n = lr.get(e)) == null ? null : n;
|
|
1912
1924
|
};
|
|
1913
1925
|
return n(), {
|
|
1914
1926
|
isLocalStorage: () => t,
|
|
1915
1927
|
read: n,
|
|
1916
1928
|
write: (n) => {
|
|
1917
1929
|
let r = JSON.stringify(n);
|
|
1918
|
-
if (
|
|
1930
|
+
if (lr.set(e, r), t) try {
|
|
1919
1931
|
window.localStorage.setItem(e, r);
|
|
1920
1932
|
} catch (e) {
|
|
1921
1933
|
t = !1;
|
|
1922
1934
|
}
|
|
1923
1935
|
}
|
|
1924
1936
|
};
|
|
1925
|
-
},
|
|
1937
|
+
}, dr = (e, t) => {
|
|
1926
1938
|
let n = "";
|
|
1927
1939
|
try {
|
|
1928
1940
|
n = new URL(e).host;
|
|
@@ -1930,8 +1942,8 @@ var Hn = ["stopLoadingTime"], Un = new Set(Object.values(g)), Wn = () => typeof
|
|
|
1930
1942
|
n = e;
|
|
1931
1943
|
}
|
|
1932
1944
|
return `bk_ot_session__${m(`${t}\0${n || "default"}`)}`;
|
|
1933
|
-
},
|
|
1934
|
-
e.startSpan("browser.session", S(S(S({}, e.config.hooks.getPageAttributes()),
|
|
1945
|
+
}, fr = (e, t, n, r, i, a, o) => {
|
|
1946
|
+
e.startSpan("browser.session", S(S(S({}, e.config.hooks.getPageAttributes()), M({ spanType: j.session })), {}, {
|
|
1935
1947
|
[g.sessionPhase]: t,
|
|
1936
1948
|
[g.sessionHasReplay]: !1,
|
|
1937
1949
|
[g.sessionId]: n,
|
|
@@ -1942,7 +1954,7 @@ var Hn = ["stopLoadingTime"], Un = new Set(Object.values(g)), Wn = () => typeof
|
|
|
1942
1954
|
contextTime: i,
|
|
1943
1955
|
startTime: i
|
|
1944
1956
|
}).end(i);
|
|
1945
|
-
},
|
|
1957
|
+
}, pr = (e = {}) => {
|
|
1946
1958
|
let t = [];
|
|
1947
1959
|
return {
|
|
1948
1960
|
name: "session",
|
|
@@ -1958,7 +1970,7 @@ var Hn = ["stopLoadingTime"], Un = new Set(Object.values(g)), Wn = () => typeof
|
|
|
1958
1970
|
}, e);
|
|
1959
1971
|
return;
|
|
1960
1972
|
}
|
|
1961
|
-
let i = (r = e.storageKey) == null ?
|
|
1973
|
+
let i = (r = e.storageKey) == null ? dr(n.config.transport.endpoint, n.config.application.name) : r, a = ur(i), o = typeof performance < "u" && Number.isFinite(performance.timeOrigin) ? performance.timeOrigin : Date.now(), s, c, l, u = (e = Date.now()) => ir(a.read(), e, Z), d = () => {
|
|
1962
1974
|
l !== void 0 && (clearTimeout(l), l = void 0);
|
|
1963
1975
|
}, f = (e, t = Date.now()) => {
|
|
1964
1976
|
var r;
|
|
@@ -1968,7 +1980,7 @@ var Hn = ["stopLoadingTime"], Un = new Set(Object.values(g)), Wn = () => typeof
|
|
|
1968
1980
|
id: i,
|
|
1969
1981
|
reason: e,
|
|
1970
1982
|
type: "expired"
|
|
1971
|
-
}),
|
|
1983
|
+
}), fr(n, "end", i, (r = c) == null ? t : r, t, e), d(), s = void 0, c = void 0, n.setRuntimeAttributes({
|
|
1972
1984
|
[g.sessionHasReplay]: void 0,
|
|
1973
1985
|
[g.sessionId]: void 0,
|
|
1974
1986
|
[g.sessionStartTime]: void 0,
|
|
@@ -2021,17 +2033,17 @@ var Hn = ["stopLoadingTime"], Un = new Set(Object.values(g)), Wn = () => typeof
|
|
|
2021
2033
|
}, v = (e = !1) => {
|
|
2022
2034
|
let t = Date.now(), r = u(t);
|
|
2023
2035
|
if ((r == null ? void 0 : r.status) === "active" && !X(r, t, Z)) {
|
|
2024
|
-
let e =
|
|
2036
|
+
let e = rr(r, t, ar, Z);
|
|
2025
2037
|
a.write(e), _(e, s ? void 0 : { reason: "shared" });
|
|
2026
2038
|
return;
|
|
2027
2039
|
}
|
|
2028
|
-
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 =
|
|
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 = nr(h("session"), t, ar, Z);
|
|
2029
2041
|
a.write(c), _(c, {
|
|
2030
2042
|
previousId: i,
|
|
2031
2043
|
reason: o == null ? "init" : o
|
|
2032
2044
|
});
|
|
2033
2045
|
let l = o == null ? "init" : o;
|
|
2034
|
-
|
|
2046
|
+
fr(n, l === "init" ? "start" : "rotate", c.id, c.startedAt, c.startedAt, l, i);
|
|
2035
2047
|
}, y = () => {
|
|
2036
2048
|
if (!s) return;
|
|
2037
2049
|
let e = Date.now(), t = u(e);
|
|
@@ -2039,31 +2051,31 @@ var Hn = ["stopLoadingTime"], Un = new Set(Object.values(g)), Wn = () => typeof
|
|
|
2039
2051
|
p();
|
|
2040
2052
|
return;
|
|
2041
2053
|
}
|
|
2042
|
-
let n =
|
|
2054
|
+
let n = rr(t, e, ar, Z);
|
|
2043
2055
|
a.write(n), _(n);
|
|
2044
2056
|
};
|
|
2045
2057
|
v(!0);
|
|
2046
2058
|
let b = 0, x = () => {
|
|
2047
2059
|
let e = Date.now();
|
|
2048
|
-
e - b <
|
|
2060
|
+
e - b < or || (b = e, v());
|
|
2049
2061
|
}, S = {
|
|
2050
2062
|
capture: !0,
|
|
2051
2063
|
passive: !0
|
|
2052
2064
|
};
|
|
2053
|
-
|
|
2054
|
-
|
|
2065
|
+
cr.forEach((e) => window.addEventListener(e, x, S)), t.push(() => {
|
|
2066
|
+
cr.forEach((e) => window.removeEventListener(e, x, S));
|
|
2055
2067
|
});
|
|
2056
2068
|
let C = () => {
|
|
2057
2069
|
document.visibilityState === "visible" && y();
|
|
2058
2070
|
};
|
|
2059
2071
|
document.addEventListener("visibilitychange", C);
|
|
2060
|
-
let w = window.setInterval(C,
|
|
2072
|
+
let w = window.setInterval(C, sr);
|
|
2061
2073
|
t.push(() => {
|
|
2062
2074
|
document.removeEventListener("visibilitychange", C), window.clearInterval(w);
|
|
2063
2075
|
});
|
|
2064
2076
|
let T = (e) => {
|
|
2065
2077
|
if (!a.isLocalStorage() || e.storageArea !== window.localStorage || e.key !== i) return;
|
|
2066
|
-
let t = Date.now(), n =
|
|
2078
|
+
let t = Date.now(), n = ir(e.newValue, t, Z);
|
|
2067
2079
|
if ((n == null ? void 0 : n.status) === "active" && n.id === s && !X(n, t, Z)) {
|
|
2068
2080
|
m(n);
|
|
2069
2081
|
return;
|
|
@@ -2076,47 +2088,47 @@ var Hn = ["stopLoadingTime"], Un = new Set(Object.values(g)), Wn = () => typeof
|
|
|
2076
2088
|
for (var e; t.length;) (e = t.pop()) == null || e();
|
|
2077
2089
|
}
|
|
2078
2090
|
};
|
|
2079
|
-
},
|
|
2091
|
+
}, mr = 10, hr = 6e4, gr = 5e3, _r = 1e3, vr = (e, t) => !!t && e === t, yr = (e, t) => {
|
|
2080
2092
|
let [n, r] = e === "CLS" ? [.1, .25] : [200, 500];
|
|
2081
2093
|
return t <= n ? "good" : t <= r ? "needs-improvement" : "poor";
|
|
2082
|
-
},
|
|
2094
|
+
}, br = (e) => {
|
|
2083
2095
|
var t, n, r;
|
|
2084
2096
|
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;
|
|
2085
|
-
},
|
|
2097
|
+
}, xr = () => {
|
|
2086
2098
|
if (typeof performance > "u") return;
|
|
2087
2099
|
let e = performance.interactionCount;
|
|
2088
2100
|
return typeof e == "number" && Number.isFinite(e) ? e : void 0;
|
|
2089
|
-
},
|
|
2101
|
+
}, Sr = (e, t) => {
|
|
2090
2102
|
var n, r;
|
|
2091
2103
|
let i = (n = t.value) == null ? 0 : n;
|
|
2092
2104
|
if (!(t.hadRecentInput || !Number.isFinite(i))) {
|
|
2093
|
-
if (e.clsWindowStart === void 0 || t.startTime - ((r = e.clsWindowEnd) == null ? t.startTime : r) >=
|
|
2105
|
+
if (e.clsWindowStart === void 0 || t.startTime - ((r = e.clsWindowEnd) == null ? t.startTime : r) >= _r || t.startTime - e.clsWindowStart >= gr) {
|
|
2094
2106
|
var a;
|
|
2095
|
-
e.clsWindowStart = t.startTime, e.clsWindowValue = i, e.clsWindowLargestShiftValue = i, e.clsWindowLargestShiftTarget =
|
|
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);
|
|
2096
2108
|
} else if (e.clsWindowValue += i, i > e.clsWindowLargestShiftValue) {
|
|
2097
2109
|
var o;
|
|
2098
|
-
e.clsWindowLargestShiftValue = i, e.clsWindowLargestShiftTarget =
|
|
2110
|
+
e.clsWindowLargestShiftValue = i, e.clsWindowLargestShiftTarget = br((o = t.sources) == null || (o = o[0]) == null ? void 0 : o.node);
|
|
2099
2111
|
}
|
|
2100
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);
|
|
2101
2113
|
}
|
|
2102
|
-
},
|
|
2114
|
+
}, Cr = (e, t) => {
|
|
2103
2115
|
var n, r;
|
|
2104
2116
|
if (!t.interactionId || !Number.isFinite(t.duration)) return;
|
|
2105
2117
|
e.interactionIdMin = Math.min(e.interactionIdMin, t.interactionId), e.interactionIdMax = Math.max(e.interactionIdMax, t.interactionId);
|
|
2106
2118
|
let i = (n = t.processingStart) == null ? t.startTime : n, a = (r = t.processingEnd) == null ? i : r, o = {
|
|
2107
|
-
duration: Math.min(t.duration,
|
|
2119
|
+
duration: Math.min(t.duration, hr),
|
|
2108
2120
|
inputDelay: Math.max(0, i - t.startTime),
|
|
2109
2121
|
interactionId: t.interactionId,
|
|
2110
|
-
interactionTarget:
|
|
2122
|
+
interactionTarget: br(t.target),
|
|
2111
2123
|
interactionType: t.name,
|
|
2112
2124
|
presentationDelay: Math.max(0, t.startTime + t.duration - a),
|
|
2113
2125
|
processingDuration: Math.max(0, a - i)
|
|
2114
2126
|
}, s = e.inpCandidates.findIndex((e) => e.interactionId === t.interactionId);
|
|
2115
|
-
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(
|
|
2116
|
-
},
|
|
2117
|
-
let t =
|
|
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(mr);
|
|
2128
|
+
}, wr = (e) => {
|
|
2129
|
+
let t = xr(), n = t !== void 0 && e.interactionCountAtStart !== void 0 ? Math.max(0, t - e.interactionCountAtStart) : e.interactionIdMin === Infinity ? 0 : (e.interactionIdMax - e.interactionIdMin) / 7 + 1;
|
|
2118
2130
|
if (e.inpCandidates.length) return e.inpCandidates[Math.min(e.inpCandidates.length - 1, Math.floor(n / 50))];
|
|
2119
|
-
},
|
|
2131
|
+
}, Tr = (e, t) => {
|
|
2120
2132
|
var n;
|
|
2121
2133
|
let r = (n = e.attribution) == null ? {} : n, i = {}, a = (e) => r[e], o = (e, t, n) => {
|
|
2122
2134
|
t != null && (typeof t == "string" || typeof t == "number" || typeof t == "boolean") && (i[e] = typeof t == "string" && n ? n(t) : t);
|
|
@@ -2140,12 +2152,12 @@ var Hn = ["stopLoadingTime"], Un = new Set(Object.values(g)), Wn = () => typeof
|
|
|
2140
2152
|
default: break;
|
|
2141
2153
|
}
|
|
2142
2154
|
return i;
|
|
2143
|
-
},
|
|
2155
|
+
}, Er = () => {
|
|
2144
2156
|
let e, t = !1;
|
|
2145
2157
|
return {
|
|
2146
2158
|
name: "web-vitals",
|
|
2147
2159
|
init(n) {
|
|
2148
|
-
return
|
|
2160
|
+
return k(function* () {
|
|
2149
2161
|
if (typeof window > "u") return;
|
|
2150
2162
|
let r;
|
|
2151
2163
|
try {
|
|
@@ -2161,15 +2173,15 @@ var Hn = ["stopLoadingTime"], Un = new Set(Object.values(g)), Wn = () => typeof
|
|
|
2161
2173
|
let { onFCP: a, onLCP: o, onTTFB: s } = r, c = (e, t, r, i = r == null ? Date.now() : r) => {
|
|
2162
2174
|
if (!n.isSampled()) return;
|
|
2163
2175
|
let a = e.name.toLowerCase();
|
|
2164
|
-
n.startSpan("browser.web_vital", S(S(S(S({}, n.config.hooks.getPageAttributes()), t),
|
|
2165
|
-
outcome:
|
|
2166
|
-
spanType:
|
|
2176
|
+
n.startSpan("browser.web_vital", S(S(S(S({}, n.config.hooks.getPageAttributes()), t), M({
|
|
2177
|
+
outcome: Je(e.rating),
|
|
2178
|
+
spanType: j.vital
|
|
2167
2179
|
})), {}, {
|
|
2168
2180
|
[g.vitalMetric]: a,
|
|
2169
2181
|
[g.vitalValue]: e.value,
|
|
2170
2182
|
[g.vitalRating]: e.rating,
|
|
2171
2183
|
"vital.id": e.id
|
|
2172
|
-
},
|
|
2184
|
+
}, Tr(e, n.config.hooks.redactUrl)), {
|
|
2173
2185
|
contextTime: r,
|
|
2174
2186
|
startTime: i
|
|
2175
2187
|
}).end(i);
|
|
@@ -2190,10 +2202,10 @@ var Hn = ["stopLoadingTime"], Un = new Set(Object.values(g)), Wn = () => typeof
|
|
|
2190
2202
|
entries: [],
|
|
2191
2203
|
id: h("vital"),
|
|
2192
2204
|
name: "CLS",
|
|
2193
|
-
rating:
|
|
2205
|
+
rating: yr("CLS", e.cls),
|
|
2194
2206
|
value: e.cls
|
|
2195
2207
|
}, e.runtimeAttributes, e.startedAt);
|
|
2196
|
-
let t =
|
|
2208
|
+
let t = wr(e);
|
|
2197
2209
|
t && p({
|
|
2198
2210
|
attribution: {
|
|
2199
2211
|
inputDelay: t.inputDelay,
|
|
@@ -2205,18 +2217,16 @@ var Hn = ["stopLoadingTime"], Un = new Set(Object.values(g)), Wn = () => typeof
|
|
|
2205
2217
|
entries: [],
|
|
2206
2218
|
id: h("vital"),
|
|
2207
2219
|
name: "INP",
|
|
2208
|
-
rating:
|
|
2220
|
+
rating: yr("INP", t.duration),
|
|
2209
2221
|
value: t.duration
|
|
2210
2222
|
}, e.runtimeAttributes, e.startedAt);
|
|
2211
2223
|
}, _ = n.onViewChange((e) => {
|
|
2212
2224
|
var t;
|
|
2213
2225
|
let r = u;
|
|
2214
|
-
if (r &&
|
|
2215
|
-
r.runtimeAttributes = S(S({}, r.runtimeAttributes), {}, {
|
|
2216
|
-
[g.viewId]: e.id,
|
|
2217
|
-
[g.viewName]: e.name,
|
|
2226
|
+
if (r && vr(r.id, e.id)) {
|
|
2227
|
+
r.runtimeAttributes = S(S(S({}, r.runtimeAttributes), {}, { [g.viewId]: e.id }, e.name ? { [g.viewName]: e.name } : {}), {}, {
|
|
2218
2228
|
[g.viewUrl]: e.url,
|
|
2219
|
-
[g.
|
|
2229
|
+
[g.viewUrlTemplate]: e.urlTemplate
|
|
2220
2230
|
});
|
|
2221
2231
|
return;
|
|
2222
2232
|
}
|
|
@@ -2224,7 +2234,7 @@ var Hn = ["stopLoadingTime"], Un = new Set(Object.values(g)), Wn = () => typeof
|
|
|
2224
2234
|
cls: 0,
|
|
2225
2235
|
clsWindowLargestShiftValue: 0,
|
|
2226
2236
|
clsWindowValue: 0,
|
|
2227
|
-
interactionCountAtStart:
|
|
2237
|
+
interactionCountAtStart: xr(),
|
|
2228
2238
|
interactionIdMax: 0,
|
|
2229
2239
|
interactionIdMin: Infinity,
|
|
2230
2240
|
inpCandidates: [],
|
|
@@ -2237,12 +2247,12 @@ var Hn = ["stopLoadingTime"], Un = new Set(Object.values(g)), Wn = () => typeof
|
|
|
2237
2247
|
if (typeof PerformanceObserver < "u") {
|
|
2238
2248
|
var v, y;
|
|
2239
2249
|
(v = PerformanceObserver.supportedEntryTypes) != null && v.includes("layout-shift") && (f = new PerformanceObserver((e) => {
|
|
2240
|
-
if (u) for (let t of e.getEntries()) performance.timeOrigin + t.startTime < u.startedAt ||
|
|
2250
|
+
if (u) for (let t of e.getEntries()) performance.timeOrigin + t.startTime < u.startedAt || Sr(u, t);
|
|
2241
2251
|
}), f.observe({
|
|
2242
2252
|
buffered: !0,
|
|
2243
2253
|
type: "layout-shift"
|
|
2244
2254
|
})), (y = PerformanceObserver.supportedEntryTypes) != null && y.includes("event") && (d = new PerformanceObserver((e) => {
|
|
2245
|
-
if (u) for (let t of e.getEntries()) performance.timeOrigin + t.startTime < u.startedAt || !t.interactionId || !Number.isFinite(t.duration) ||
|
|
2255
|
+
if (u) for (let t of e.getEntries()) performance.timeOrigin + t.startTime < u.startedAt || !t.interactionId || !Number.isFinite(t.duration) || Cr(u, t);
|
|
2246
2256
|
}), d.observe({
|
|
2247
2257
|
buffered: !0,
|
|
2248
2258
|
durationThreshold: 40,
|
|
@@ -2258,7 +2268,7 @@ var Hn = ["stopLoadingTime"], Un = new Set(Object.values(g)), Wn = () => typeof
|
|
|
2258
2268
|
t = !0, e == null || e(), e = void 0;
|
|
2259
2269
|
}
|
|
2260
2270
|
};
|
|
2261
|
-
},
|
|
2271
|
+
}, Dr = (e, t) => {
|
|
2262
2272
|
let n = {
|
|
2263
2273
|
"network.protocol.name": "websocket",
|
|
2264
2274
|
"url.full": t(e)
|
|
@@ -2268,14 +2278,14 @@ var Hn = ["stopLoadingTime"], Un = new Set(Object.values(g)), Wn = () => typeof
|
|
|
2268
2278
|
n["server.address"] = t.hostname, t.port && (n["server.port"] = Number(t.port)), n["url.scheme"] = t.protocol.replace(":", "");
|
|
2269
2279
|
} catch (e) {}
|
|
2270
2280
|
return n;
|
|
2271
|
-
},
|
|
2272
|
-
let a = h("websocket"), o =
|
|
2281
|
+
}, Or = (t, n, r, i) => {
|
|
2282
|
+
let a = h("websocket"), o = Dr(r, n.config.hooks.redactUrl), s = !1, c = (t, r, s = {}) => {
|
|
2273
2283
|
if (i() || !n.isSampled()) return;
|
|
2274
2284
|
let c = t === "error";
|
|
2275
|
-
n.startSpan("browser.websocket", S(S(S({}, o),
|
|
2276
|
-
outcome: c ?
|
|
2285
|
+
n.startSpan("browser.websocket", S(S(S({}, o), M({
|
|
2286
|
+
outcome: c ? A.error : A.success,
|
|
2277
2287
|
outcomeReason: c ? "network" : void 0,
|
|
2278
|
-
spanType:
|
|
2288
|
+
spanType: j.websocket
|
|
2279
2289
|
})), {}, {
|
|
2280
2290
|
[g.websocketPhase]: t,
|
|
2281
2291
|
"websocket.connection.id": a
|
|
@@ -2295,7 +2305,7 @@ var Hn = ["stopLoadingTime"], Un = new Set(Object.values(g)), Wn = () => typeof
|
|
|
2295
2305
|
"websocket.close.was_clean": e.wasClean
|
|
2296
2306
|
});
|
|
2297
2307
|
});
|
|
2298
|
-
},
|
|
2308
|
+
}, kr = () => {
|
|
2299
2309
|
let e, t, n = !1;
|
|
2300
2310
|
return {
|
|
2301
2311
|
name: "websocket",
|
|
@@ -2306,29 +2316,29 @@ var Hn = ["stopLoadingTime"], Un = new Set(Object.values(g)), Wn = () => typeof
|
|
|
2306
2316
|
let a = Reflect.construct(e, t, i);
|
|
2307
2317
|
if (n || !r.isSampled()) return a;
|
|
2308
2318
|
let o = t[0] == null ? "" : String(t[0]);
|
|
2309
|
-
return o && !
|
|
2319
|
+
return o && !D(r.config, o) && Or(a, r, o, () => n), a;
|
|
2310
2320
|
} }), window.WebSocket = t;
|
|
2311
2321
|
},
|
|
2312
2322
|
shutdown() {
|
|
2313
2323
|
n = !0, typeof window < "u" && e && window.WebSocket === t && (window.WebSocket = e), t = void 0, e = void 0;
|
|
2314
2324
|
}
|
|
2315
2325
|
};
|
|
2316
|
-
},
|
|
2326
|
+
}, Ar = class {
|
|
2317
2327
|
constructor() {
|
|
2318
2328
|
b(this, "listeners", /* @__PURE__ */ new Set()), b(this, "notify", (e) => {
|
|
2319
2329
|
this.listeners.forEach((t) => t(e));
|
|
2320
2330
|
}), b(this, "subscribe", (e) => (this.listeners.add(e), () => this.listeners.delete(e)));
|
|
2321
2331
|
}
|
|
2322
|
-
},
|
|
2332
|
+
}, jr = (e) => {
|
|
2323
2333
|
let t = 2166136261;
|
|
2324
2334
|
for (let n = 0; n < e.length; n += 1) t = Math.imul(t ^ e.charCodeAt(n), 16777619);
|
|
2325
2335
|
return t += t << 13, t ^= t >>> 7, t += t << 3, t ^= t >>> 17, t += t << 5, (t >>> 0) / 4294967296;
|
|
2326
|
-
},
|
|
2336
|
+
}, Mr = ({ application: e, session: t }, n) => t.sampleRate <= 0 ? !1 : t.sampleRate >= 1 ? !0 : jr(`${e.name}\0${n}`) < t.sampleRate, Nr = (e) => ({
|
|
2327
2337
|
url: e.endpoint,
|
|
2328
2338
|
headers: e.headers,
|
|
2329
2339
|
concurrencyLimit: e.concurrencyLimit,
|
|
2330
2340
|
timeoutMillis: e.timeoutMillis
|
|
2331
|
-
}),
|
|
2341
|
+
}), Pr = "bk-rum", Fr = class {
|
|
2332
2342
|
constructor(e) {
|
|
2333
2343
|
this.isSampled = e;
|
|
2334
2344
|
}
|
|
@@ -2338,7 +2348,7 @@ var Hn = ["stopLoadingTime"], Un = new Set(Object.values(g)), Wn = () => typeof
|
|
|
2338
2348
|
toString() {
|
|
2339
2349
|
return "RumSessionSampler";
|
|
2340
2350
|
}
|
|
2341
|
-
}, Q,
|
|
2351
|
+
}, Q, Ir = () => {
|
|
2342
2352
|
if (Q) Q.users += 1;
|
|
2343
2353
|
else {
|
|
2344
2354
|
let e = new a().enable(), t = r.setGlobalContextManager(e);
|
|
@@ -2353,28 +2363,28 @@ var Hn = ["stopLoadingTime"], Un = new Set(Object.values(g)), Wn = () => typeof
|
|
|
2353
2363
|
return () => {
|
|
2354
2364
|
e || !Q || (e = !0, --Q.users, !(Q.users > 0) && (Q.ownsContext && r.disable(), Q.ownsPropagator && i.disable(), Q = void 0));
|
|
2355
2365
|
};
|
|
2356
|
-
},
|
|
2366
|
+
}, Lr = (e, t) => t ? new Proxy(e, { get(e, t, n) {
|
|
2357
2367
|
if (t === "export") return (t, n) => {
|
|
2358
2368
|
var r;
|
|
2359
2369
|
return (r = globalThis.console) == null || r.log("[bk-ot][rum]", t), e.export(t, n);
|
|
2360
2370
|
};
|
|
2361
2371
|
let r = Reflect.get(e, t, n);
|
|
2362
2372
|
return typeof r == "function" ? r.bind(e) : r;
|
|
2363
|
-
} }) : e,
|
|
2364
|
-
|
|
2373
|
+
} }) : e, Rr = (e) => [Tn(e.tracking.request)], zr = (e) => [
|
|
2374
|
+
pr(e.session),
|
|
2365
2375
|
...$(e.tracking.device, !0, ce),
|
|
2366
|
-
|
|
2367
|
-
|
|
2368
|
-
|
|
2369
|
-
],
|
|
2370
|
-
...$(e.error, !0,
|
|
2371
|
-
...$(e.webVitals, !0,
|
|
2372
|
-
...$(e.blankScreen, !0,
|
|
2373
|
-
...$(e.action, !0,
|
|
2374
|
-
...$(e.websocket, !1,
|
|
2375
|
-
...$(e.longTask, !1,
|
|
2376
|
-
...$(e.cspViolation, !1,
|
|
2377
|
-
],
|
|
2376
|
+
gt(),
|
|
2377
|
+
$n(),
|
|
2378
|
+
sn(Br(e.tracking.resource, !0))
|
|
2379
|
+
], Br = (e, t) => e === void 0 ? t : e !== !1, Vr = (e) => typeof e == "object" && e ? e : void 0, $ = (e, t, n) => Br(e, t) ? [n(Vr(e))] : [], Hr = (e) => [
|
|
2380
|
+
...$(e.error, !0, jn),
|
|
2381
|
+
...$(e.webVitals, !0, Er),
|
|
2382
|
+
...$(e.blankScreen, !0, Mt),
|
|
2383
|
+
...$(e.action, !0, pt),
|
|
2384
|
+
...$(e.websocket, !1, kr),
|
|
2385
|
+
...$(e.longTask, !1, In),
|
|
2386
|
+
...$(e.cspViolation, !1, On)
|
|
2387
|
+
], Ur = class {
|
|
2378
2388
|
assertBeforeStart(e) {
|
|
2379
2389
|
if (this.phase !== "idle") throw Error(`[bk-ot] ${e}() must be called before start(); set autoStart: false before registration.`);
|
|
2380
2390
|
}
|
|
@@ -2404,20 +2414,20 @@ var Hn = ["stopLoadingTime"], Un = new Set(Object.values(g)), Wn = () => typeof
|
|
|
2404
2414
|
}
|
|
2405
2415
|
createPluginManager() {
|
|
2406
2416
|
var e;
|
|
2407
|
-
return new
|
|
2408
|
-
...
|
|
2409
|
-
...
|
|
2410
|
-
...
|
|
2417
|
+
return new Fe([
|
|
2418
|
+
...zr(this.config),
|
|
2419
|
+
...Rr(this.config),
|
|
2420
|
+
...Hr(this.config.tracking),
|
|
2411
2421
|
...(e = this.config.extensions.plugins) == null ? [] : e
|
|
2412
2422
|
]);
|
|
2413
2423
|
}
|
|
2414
2424
|
constructor(n) {
|
|
2415
2425
|
var r = this;
|
|
2416
|
-
b(this, "activityObserver", new
|
|
2426
|
+
b(this, "activityObserver", new Ar()), b(this, "flushProviders", k(function* () {
|
|
2417
2427
|
yield r.tracerProvider.forceFlush();
|
|
2418
|
-
})), 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",
|
|
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", k(function* () {
|
|
2419
2429
|
if (r.pluginManager || !r.config.enabled || r.config.trackingConsent !== "granted") return;
|
|
2420
|
-
r.releaseOtelGlobals =
|
|
2430
|
+
r.releaseOtelGlobals = Ir();
|
|
2421
2431
|
let e = r.createPluginManager();
|
|
2422
2432
|
r.pluginManager = e;
|
|
2423
2433
|
try {
|
|
@@ -2429,7 +2439,7 @@ var Hn = ["stopLoadingTime"], Un = new Set(Object.values(g)), Wn = () => typeof
|
|
|
2429
2439
|
throw (a = r.releaseOtelGlobals) == null || a.call(r), r.releaseOtelGlobals = void 0, t;
|
|
2430
2440
|
}
|
|
2431
2441
|
})), b(this, "stopCollection", function() {
|
|
2432
|
-
var e =
|
|
2442
|
+
var e = k(function* (e) {
|
|
2433
2443
|
var t, n, i;
|
|
2434
2444
|
let a = r.pluginManager;
|
|
2435
2445
|
if (a) {
|
|
@@ -2443,7 +2453,7 @@ var Hn = ["stopLoadingTime"], Un = new Set(Object.values(g)), Wn = () => typeof
|
|
|
2443
2453
|
return function(t) {
|
|
2444
2454
|
return e.apply(this, arguments);
|
|
2445
2455
|
};
|
|
2446
|
-
}()), 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",
|
|
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", k(function* () {
|
|
2447
2457
|
var e;
|
|
2448
2458
|
yield (e = r.pluginManager) == null ? void 0 : e.flush(), yield r.flushProviders();
|
|
2449
2459
|
})), 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) => {
|
|
@@ -2455,7 +2465,7 @@ var Hn = ["stopLoadingTime"], Un = new Set(Object.values(g)), Wn = () => typeof
|
|
|
2455
2465
|
}), b(this, "reportAction", ({ attributes: e = {}, name: t }) => {
|
|
2456
2466
|
if (!this.isSampled()) return;
|
|
2457
2467
|
let n = h("action"), r = Date.now();
|
|
2458
|
-
this.startSpan("action.custom", S(S(S(S({}, this.config.hooks.getPageAttributes()), e),
|
|
2468
|
+
this.startSpan("action.custom", S(S(S(S({}, this.config.hooks.getPageAttributes()), e), M({ spanType: j.action })), {}, {
|
|
2459
2469
|
[g.actionId]: n,
|
|
2460
2470
|
[g.actionName]: t,
|
|
2461
2471
|
[g.actionType]: "custom"
|
|
@@ -2468,9 +2478,9 @@ var Hn = ["stopLoadingTime"], Un = new Set(Object.values(g)), Wn = () => typeof
|
|
|
2468
2478
|
}
|
|
2469
2479
|
return;
|
|
2470
2480
|
}
|
|
2471
|
-
let a = Date.now(), o = this.startSpan(`custom.${r}`, S(S(S(S({}, this.config.hooks.getPageAttributes()), this.config.hooks.getCustomAttributes()), e),
|
|
2472
|
-
outcome: n ?
|
|
2473
|
-
spanType:
|
|
2481
|
+
let a = Date.now(), o = this.startSpan(`custom.${r}`, S(S(S(S({}, this.config.hooks.getPageAttributes()), this.config.hooks.getCustomAttributes()), e), M({
|
|
2482
|
+
outcome: n ? A.error : A.success,
|
|
2483
|
+
spanType: j.custom
|
|
2474
2484
|
})), { startTime: a });
|
|
2475
2485
|
n && (o.recordException(n), o.setStatus({
|
|
2476
2486
|
code: t.ERROR,
|
|
@@ -2480,11 +2490,11 @@ var Hn = ["stopLoadingTime"], Un = new Set(Object.values(g)), Wn = () => typeof
|
|
|
2480
2490
|
let n = S({}, e), r = t == null ? Date.now() : t;
|
|
2481
2491
|
if (g.sessionId in e) {
|
|
2482
2492
|
let t = e[g.sessionId];
|
|
2483
|
-
this.sampled = this.config.enabled && typeof t == "string" && t.length > 0 ?
|
|
2493
|
+
this.sampled = this.config.enabled && typeof t == "string" && t.length > 0 ? Mr(this.config, t) : !1, this.runtimeContext.setSessionSampled(this.sampled, r);
|
|
2484
2494
|
}
|
|
2485
2495
|
this.runtimeContext.setAttributes(n, r);
|
|
2486
2496
|
}), b(this, "setTrackingConsent", function() {
|
|
2487
|
-
var e =
|
|
2497
|
+
var e = k(function* (e) {
|
|
2488
2498
|
r.config.trackingConsent !== e && (r.config.trackingConsent = e, r.phase === "started" && (e === "granted" ? yield r.startCollection() : yield r.stopCollection(!0)));
|
|
2489
2499
|
});
|
|
2490
2500
|
return function(t) {
|
|
@@ -2502,7 +2512,7 @@ var Hn = ["stopLoadingTime"], Un = new Set(Object.values(g)), Wn = () => typeof
|
|
|
2502
2512
|
name: e,
|
|
2503
2513
|
type: "set_name"
|
|
2504
2514
|
});
|
|
2505
|
-
}), b(this, "shutdown",
|
|
2515
|
+
}), b(this, "shutdown", k(function* () {
|
|
2506
2516
|
if (r.phase !== "stopped") {
|
|
2507
2517
|
for (yield r.stopCollection(!1), yield r.flushProviders(); r.teardownCallbacks.length;) {
|
|
2508
2518
|
var e;
|
|
@@ -2510,7 +2520,7 @@ var Hn = ["stopLoadingTime"], Un = new Set(Object.values(g)), Wn = () => typeof
|
|
|
2510
2520
|
}
|
|
2511
2521
|
yield r.tracerProvider.shutdown(), r.phase = "stopped";
|
|
2512
2522
|
}
|
|
2513
|
-
})), b(this, "start",
|
|
2523
|
+
})), b(this, "start", k(function* () {
|
|
2514
2524
|
if (!(r.phase === "started" || r.phase === "starting")) {
|
|
2515
2525
|
if (r.phase === "stopped") throw Error("[bk-ot] instance has been shut down and cannot be restarted; create a new instance instead.");
|
|
2516
2526
|
if (!r.config.enabled) {
|
|
@@ -2558,20 +2568,20 @@ var Hn = ["stopLoadingTime"], Un = new Set(Object.values(g)), Wn = () => typeof
|
|
|
2558
2568
|
}), b(this, "useInstrumentation", (e) => {
|
|
2559
2569
|
var t;
|
|
2560
2570
|
return this.assertBeforeStart("useInstrumentation"), this.config.enabled && ((t = this.config.extensions.instrumentations) == null || t.push(e)), this;
|
|
2561
|
-
}), this.config =
|
|
2571
|
+
}), this.config = je(n), this.runtimeContext = new Ge({}, this.config.user);
|
|
2562
2572
|
let i = c(this.config.resourceAttributes), a = (() => {
|
|
2563
|
-
let e =
|
|
2564
|
-
return [new
|
|
2573
|
+
let e = Lr(new s(Nr(this.config.transport)), this.config.debug);
|
|
2574
|
+
return [new Ue(this.config.spanProcessor === "simple" ? new d(e) : new l(e, this.config.spanBatch), this.config, () => this.applyRedact(S(S({}, this.runtimeContext.getAttributes()), this.config.hooks.getPageAttributes())))];
|
|
2565
2575
|
})();
|
|
2566
2576
|
this.tracerProvider = new f({
|
|
2567
2577
|
resource: i,
|
|
2568
|
-
sampler: new
|
|
2578
|
+
sampler: new Fr(this.isSampled),
|
|
2569
2579
|
spanProcessors: a
|
|
2570
|
-
}), this.tracer = this.tracerProvider.getTracer(
|
|
2580
|
+
}), this.tracer = this.tracerProvider.getTracer(Pr), this.registeredInstrumentations = [], this.config.autoStart && this.start().catch((e) => {
|
|
2571
2581
|
var t;
|
|
2572
2582
|
(t = globalThis.console) == null || t.warn("[bk-ot] auto start failed:", e);
|
|
2573
2583
|
});
|
|
2574
2584
|
}
|
|
2575
2585
|
};
|
|
2576
2586
|
//#endregion
|
|
2577
|
-
export {
|
|
2587
|
+
export { Ur as BkOpenTelemetry, mt as EXCLUDED_ACTIVITY_MUTATIONS_ATTRIBUTE, Ue as FilteringSpanProcessor, g as RUM_ATTRIBUTES, A as RUM_SPAN_OUTCOME, j as RUM_SPAN_TYPE, Ge as RumRuntimeContext, M as buildRumSpanAttributes, pt as createActionPlugin, Mt as createBlankScreenPlugin, Tn as createCommonInstrumentationsPlugin, On as createCspViolationPlugin, ce as createDevicePlugin, jn as createErrorPlugin, In as createLongTaskPlugin, Pe as createPlugin, sn as createResourcePlugin, pr as createSessionPlugin, kr as createWebSocketPlugin, Er as createWebVitalsPlugin, je as resolveConfig };
|