@tracelog/lib 3.1.1 → 3.2.0
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 +2 -1
- package/dist/browser/tracelog.esm.js +323 -250
- package/dist/browser/tracelog.esm.js.map +1 -1
- package/dist/browser/tracelog.js +2 -2
- package/dist/browser/tracelog.js.map +1 -1
- package/dist/public-api.cjs +2 -2
- package/dist/public-api.cjs.map +1 -1
- package/dist/public-api.d.mts +7 -0
- package/dist/public-api.d.ts +7 -0
- package/dist/public-api.js +2 -2
- package/dist/public-api.js.map +1 -1
- package/package.json +4 -4
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
const
|
|
2
|
-
const
|
|
3
|
-
const
|
|
4
|
-
const
|
|
1
|
+
const pn = 9e5;
|
|
2
|
+
const Sn = 120, En = 49152, vn = 100, Tn = 500, _n = 200;
|
|
3
|
+
const yn = 1e3, In = 500, wn = 1e3;
|
|
4
|
+
const b = "data-tlog", vt = [
|
|
5
5
|
"button",
|
|
6
6
|
"a",
|
|
7
7
|
'input[type="button"]',
|
|
@@ -67,11 +67,11 @@ const y = {
|
|
|
67
67
|
/<iframe\b[^<]*(?:(?!<\/iframe>)<[^<]*)*<\/iframe>/gi,
|
|
68
68
|
/<embed\b[^>]*>/gi,
|
|
69
69
|
/<object\b[^<]*(?:(?!<\/object>)<[^<]*)*<\/object>/gi
|
|
70
|
-
], g = "tlog", z = `${g}:qa_mode`, Se = `${g}:uid`, nt = "tlog_mode", Ue = "qa", Fe = "qa_off", ce = (n) => n ? `${g}:${n}:queue` : `${g}:queue`, le = (n) => n ? `${g}:${n}:rate_limit` : `${g}:rate_limit`, It = (n) => n ? `${g}:${n}:session` : `${g}:session`,
|
|
71
|
-
var
|
|
72
|
-
class
|
|
70
|
+
], g = "tlog", z = `${g}:qa_mode`, Se = `${g}:uid`, nt = "tlog_mode", Ue = "qa", Fe = "qa_off", ce = (n) => n ? `${g}:${n}:queue` : `${g}:queue`, le = (n) => n ? `${g}:${n}:rate_limit` : `${g}:rate_limit`, It = (n, e) => `${g}:beacon:${n}:${e}`, wt = (n) => n ? `${g}:${n}:session` : `${g}:session`, At = (n) => n ? `${g}:${n}:broadcast` : `${g}:broadcast`, Ve = (n, e) => `${g}:${n}:session_counts:${e}`, He = 10080 * 60 * 1e3, xe = `${g}:session_counts_last_cleanup`, $e = 3600 * 1e3, ue = (n) => n ? `${g}:${n}:identity` : `${g}:identity`, P = `${g}:pending_identity`;
|
|
71
|
+
var M = /* @__PURE__ */ ((n) => (n.Localhost = "localhost:8080", n.Fail = "localhost:9999", n))(M || {}), w = /* @__PURE__ */ ((n) => (n.Mobile = "mobile", n.Tablet = "tablet", n.Desktop = "desktop", n.Unknown = "unknown", n))(w || {}), U = /* @__PURE__ */ ((n) => (n.EVENT = "event", n.QUEUE = "queue", n))(U || {});
|
|
72
|
+
class C extends Error {
|
|
73
73
|
constructor(e, t, s) {
|
|
74
|
-
super(e), this.statusCode = t, this.responseCode = s, this.name = "PermanentError", Error.captureStackTrace && Error.captureStackTrace(this,
|
|
74
|
+
super(e), this.statusCode = t, this.responseCode = s, this.name = "PermanentError", Error.captureStackTrace && Error.captureStackTrace(this, C);
|
|
75
75
|
}
|
|
76
76
|
statusCode;
|
|
77
77
|
responseCode;
|
|
@@ -99,7 +99,7 @@ class m extends $ {
|
|
|
99
99
|
super(e, "APP_CONFIG_INVALID", t);
|
|
100
100
|
}
|
|
101
101
|
}
|
|
102
|
-
class
|
|
102
|
+
class bt extends $ {
|
|
103
103
|
constructor(e, t = "config") {
|
|
104
104
|
super(e, "SESSION_TIMEOUT_INVALID", t);
|
|
105
105
|
}
|
|
@@ -114,7 +114,7 @@ class Xe extends $ {
|
|
|
114
114
|
super(e, "INTEGRATION_INVALID", t);
|
|
115
115
|
}
|
|
116
116
|
}
|
|
117
|
-
class
|
|
117
|
+
class An extends $ {
|
|
118
118
|
constructor(e, t, s = "runtime") {
|
|
119
119
|
super(e, "INITIALIZATION_TIMEOUT", s), this.timeoutMs = t;
|
|
120
120
|
}
|
|
@@ -126,7 +126,7 @@ const Lt = ["gclid", "gbraid", "wbraid", "fbclid", "ttclid"], de = () => {
|
|
|
126
126
|
const r = n.get(s);
|
|
127
127
|
r && (e[s] = r);
|
|
128
128
|
}), Object.keys(e).length ? e : void 0;
|
|
129
|
-
},
|
|
129
|
+
}, Mt = "background: #ff9800; color: white; font-weight: bold; padding: 2px 8px; border-radius: 3px;", Ct = "background: #9e9e9e; color: white; font-weight: bold; padding: 2px 8px; border-radius: 3px;", Rt = "background: #d32f2f; color: white; font-weight: bold; padding: 2px 8px; border-radius: 3px;", Nt = (n, e) => {
|
|
130
130
|
if (e) {
|
|
131
131
|
if (e instanceof Error) {
|
|
132
132
|
const t = e.message.replace(/\s+at\s+.*$/gm, "").replace(/\s*\([^()]+:\d+:\d+\)/g, "");
|
|
@@ -145,7 +145,7 @@ const Lt = ["gclid", "gbraid", "wbraid", "fbclid", "ttclid"], de = () => {
|
|
|
145
145
|
return `[TraceLog] ${n}: ${String(e)}`;
|
|
146
146
|
}
|
|
147
147
|
return `[TraceLog] ${n}`;
|
|
148
|
-
},
|
|
148
|
+
}, Ot = () => {
|
|
149
149
|
if (typeof window > "u" || typeof sessionStorage > "u")
|
|
150
150
|
return !1;
|
|
151
151
|
try {
|
|
@@ -154,12 +154,12 @@ const Lt = ["gclid", "gbraid", "wbraid", "fbclid", "ttclid"], de = () => {
|
|
|
154
154
|
return !1;
|
|
155
155
|
}
|
|
156
156
|
}, a = (n, e, t) => {
|
|
157
|
-
const { error: s, data: r, showToClient: i = !1, style: o, visibility: c } = t ?? {}, l = s ?
|
|
158
|
-
if (!
|
|
157
|
+
const { error: s, data: r, showToClient: i = !1, style: o, visibility: c } = t ?? {}, l = s ? Nt(e, s) : `[TraceLog] ${e}`, u = n === "error" ? "error" : n === "warn" ? "warn" : "log";
|
|
158
|
+
if (!Pt(c, i))
|
|
159
159
|
return;
|
|
160
|
-
const p =
|
|
161
|
-
|
|
162
|
-
},
|
|
160
|
+
const p = kt(c, o), S = r !== void 0 ? ve(r) : void 0;
|
|
161
|
+
Dt(u, l, p, S);
|
|
162
|
+
}, Pt = (n, e) => n === "critical" ? !0 : n === "qa" || e ? Ot() : !1, kt = (n, e) => e !== void 0 && e !== "" ? e : n === "critical" ? Rt : "", Dt = (n, e, t, s) => {
|
|
163
163
|
const r = t !== void 0 && t !== "", i = r ? `%c${e}` : e;
|
|
164
164
|
s !== void 0 ? r ? console[n](i, t, s) : console[n](i, s) : r ? console[n](i, t) : console[n](i);
|
|
165
165
|
}, ve = (n) => {
|
|
@@ -177,9 +177,9 @@ const Lt = ["gclid", "gbraid", "wbraid", "fbclid", "ttclid"], de = () => {
|
|
|
177
177
|
return e;
|
|
178
178
|
};
|
|
179
179
|
let Te, rt;
|
|
180
|
-
const
|
|
180
|
+
const Ut = () => {
|
|
181
181
|
typeof window < "u" && !Te && (Te = window.matchMedia("(pointer: coarse)"), rt = window.matchMedia("(hover: none)"));
|
|
182
|
-
}, te = "Unknown",
|
|
182
|
+
}, te = "Unknown", Ft = (n) => {
|
|
183
183
|
const e = n.userAgentData?.platform;
|
|
184
184
|
if (e != null && e !== "") {
|
|
185
185
|
if (/windows/i.test(e)) return "Windows";
|
|
@@ -191,7 +191,7 @@ const Dt = () => {
|
|
|
191
191
|
}
|
|
192
192
|
const t = navigator.userAgent;
|
|
193
193
|
return /Windows/i.test(t) ? "Windows" : /iPhone|iPad|iPod/i.test(t) ? "iOS" : /Mac OS X|Macintosh/i.test(t) ? "macOS" : /Android/i.test(t) ? "Android" : /CrOS/i.test(t) ? "ChromeOS" : /Linux/i.test(t) ? "Linux" : te;
|
|
194
|
-
},
|
|
194
|
+
}, Vt = (n) => {
|
|
195
195
|
const e = n.userAgentData?.brands;
|
|
196
196
|
if (e != null && e.length > 0) {
|
|
197
197
|
const r = e.filter((i) => !/not.?a.?brand|chromium/i.test(i.brand))[0];
|
|
@@ -202,26 +202,26 @@ const Dt = () => {
|
|
|
202
202
|
}
|
|
203
203
|
const t = navigator.userAgent;
|
|
204
204
|
return /Edg\//i.test(t) ? "Edge" : /OPR\//i.test(t) ? "Opera" : /Chrome/i.test(t) ? "Chrome" : /Firefox/i.test(t) ? "Firefox" : /Safari/i.test(t) && !/Chrome/i.test(t) ? "Safari" : te;
|
|
205
|
-
},
|
|
205
|
+
}, Ht = () => {
|
|
206
206
|
try {
|
|
207
207
|
const n = navigator;
|
|
208
208
|
if (n.userAgentData != null && typeof n.userAgentData.mobile == "boolean") {
|
|
209
209
|
const l = n.userAgentData.platform;
|
|
210
210
|
return l != null && l !== "" && /ipad|tablet/i.test(l) ? w.Tablet : n.userAgentData.mobile ? w.Mobile : w.Desktop;
|
|
211
211
|
}
|
|
212
|
-
|
|
212
|
+
Ut();
|
|
213
213
|
const e = window.innerWidth, t = Te?.matches ?? !1, s = rt?.matches ?? !1, r = "ontouchstart" in window || navigator.maxTouchPoints > 0, i = navigator.userAgent.toLowerCase(), o = /mobile|android|iphone|ipod|blackberry|iemobile|opera mini/.test(i), c = /tablet|ipad|android(?!.*mobile)/.test(i);
|
|
214
214
|
return e <= 767 || o && r ? w.Mobile : e >= 768 && e <= 1024 || c || t && s && r ? w.Tablet : w.Desktop;
|
|
215
215
|
} catch (n) {
|
|
216
216
|
return a("debug", "Device detection failed, defaulting to desktop", { error: n }), w.Desktop;
|
|
217
217
|
}
|
|
218
|
-
},
|
|
218
|
+
}, xt = () => {
|
|
219
219
|
try {
|
|
220
220
|
const n = navigator;
|
|
221
221
|
return {
|
|
222
|
-
type:
|
|
223
|
-
os:
|
|
224
|
-
browser:
|
|
222
|
+
type: Ht(),
|
|
223
|
+
os: Ft(n),
|
|
224
|
+
browser: Vt(n)
|
|
225
225
|
};
|
|
226
226
|
} catch (n) {
|
|
227
227
|
return a("debug", "Device info detection failed, using defaults", { error: n }), {
|
|
@@ -230,7 +230,7 @@ const Dt = () => {
|
|
|
230
230
|
browser: te
|
|
231
231
|
};
|
|
232
232
|
}
|
|
233
|
-
},
|
|
233
|
+
}, je = 500, Ge = 2e3, We = 5e3, Q = 50, $t = Q * 2, it = 1, Bt = 1e3, Xt = 10, Ke = 5e3, jt = 3, Gt = 200, Wt = 6e4, Kt = 64, zt = 10 * 6e4, Qt = 200, bn = {
|
|
234
234
|
LCP: 2500,
|
|
235
235
|
FCP: 1800,
|
|
236
236
|
CLS: 0.1,
|
|
@@ -242,7 +242,7 @@ const Dt = () => {
|
|
|
242
242
|
CLS: 0.1,
|
|
243
243
|
INP: 200,
|
|
244
244
|
TTFB: 800
|
|
245
|
-
},
|
|
245
|
+
}, Yt = {
|
|
246
246
|
LCP: 4e3,
|
|
247
247
|
FCP: 3e3,
|
|
248
248
|
CLS: 0.25,
|
|
@@ -255,11 +255,11 @@ const Dt = () => {
|
|
|
255
255
|
case "needs-improvement":
|
|
256
256
|
return ze;
|
|
257
257
|
case "poor":
|
|
258
|
-
return
|
|
258
|
+
return Yt;
|
|
259
259
|
default:
|
|
260
260
|
return ze;
|
|
261
261
|
}
|
|
262
|
-
},
|
|
262
|
+
}, qt = 50, Jt = "3.1.1", Zt = Jt, es = () => typeof window < "u" && typeof sessionStorage < "u", ts = () => {
|
|
263
263
|
try {
|
|
264
264
|
const n = new URLSearchParams(window.location.search);
|
|
265
265
|
n.delete(nt);
|
|
@@ -267,23 +267,23 @@ const Dt = () => {
|
|
|
267
267
|
window.history.replaceState({}, "", t);
|
|
268
268
|
} catch {
|
|
269
269
|
}
|
|
270
|
-
},
|
|
271
|
-
if (!
|
|
270
|
+
}, ss = () => {
|
|
271
|
+
if (!es())
|
|
272
272
|
return !1;
|
|
273
273
|
try {
|
|
274
274
|
const e = new URLSearchParams(window.location.search).get(nt), t = sessionStorage.getItem(z);
|
|
275
275
|
let s = null;
|
|
276
276
|
return e === Ue ? (s = !0, sessionStorage.setItem(z, "true"), a("info", "QA Mode ACTIVE", {
|
|
277
277
|
visibility: "qa",
|
|
278
|
-
style:
|
|
278
|
+
style: Mt
|
|
279
279
|
})) : e === Fe && (s = !1, sessionStorage.setItem(z, "false"), a("info", "QA Mode DISABLED", {
|
|
280
280
|
visibility: "qa",
|
|
281
|
-
style:
|
|
282
|
-
})), (e === Ue || e === Fe) &&
|
|
281
|
+
style: Ct
|
|
282
|
+
})), (e === Ue || e === Fe) && ts(), s ?? t === "true";
|
|
283
283
|
} catch {
|
|
284
284
|
return !1;
|
|
285
285
|
}
|
|
286
|
-
}, ot = () => typeof document < "u" && document.prerendering === !0,
|
|
286
|
+
}, ot = () => typeof document < "u" && document.prerendering === !0, ns = [
|
|
287
287
|
"co.uk",
|
|
288
288
|
"org.uk",
|
|
289
289
|
"com.au",
|
|
@@ -300,14 +300,14 @@ const Dt = () => {
|
|
|
300
300
|
if (e.length <= 2)
|
|
301
301
|
return n.toLowerCase();
|
|
302
302
|
const t = e.slice(-2).join(".");
|
|
303
|
-
return
|
|
304
|
-
},
|
|
303
|
+
return ns.includes(t) ? e.slice(-3).join(".") : e.slice(-2).join(".");
|
|
304
|
+
}, rs = (n, e) => n === e ? !0 : Ye(n) === Ye(e), he = () => {
|
|
305
305
|
const n = document.referrer;
|
|
306
306
|
if (!n)
|
|
307
307
|
return "Direct";
|
|
308
308
|
try {
|
|
309
309
|
const e = new URL(n).hostname.toLowerCase(), t = window.location.hostname.toLowerCase();
|
|
310
|
-
return
|
|
310
|
+
return rs(e, t) ? "Direct" : n;
|
|
311
311
|
} catch (e) {
|
|
312
312
|
return a("debug", "Failed to parse referrer URL, using raw value", { error: e, data: { referrer: n } }), n;
|
|
313
313
|
}
|
|
@@ -324,11 +324,11 @@ const Dt = () => {
|
|
|
324
324
|
const e = Math.random() * 16 | 0;
|
|
325
325
|
return (n === "x" ? e : e & 3 | 8).toString(16);
|
|
326
326
|
});
|
|
327
|
-
let
|
|
328
|
-
const
|
|
327
|
+
let G = 0, W = 0;
|
|
328
|
+
const is = () => {
|
|
329
329
|
let n = Date.now();
|
|
330
|
-
n <
|
|
331
|
-
const e =
|
|
330
|
+
n < W && (n = W), n === W ? G = (G + 1) % 1e3 : G = 0, W = n;
|
|
331
|
+
const e = G.toString().padStart(3, "0");
|
|
332
332
|
let t = "";
|
|
333
333
|
try {
|
|
334
334
|
if (typeof crypto < "u" && crypto.getRandomValues) {
|
|
@@ -338,13 +338,13 @@ const ss = () => {
|
|
|
338
338
|
} catch {
|
|
339
339
|
}
|
|
340
340
|
return t || (t = Math.floor(Math.random() * 16777215).toString(16).padStart(6, "0")), `${n}-${e}-${t}`;
|
|
341
|
-
},
|
|
341
|
+
}, os = (n) => {
|
|
342
342
|
try {
|
|
343
343
|
return new URL(n).protocol === "https:";
|
|
344
344
|
} catch {
|
|
345
345
|
return !1;
|
|
346
346
|
}
|
|
347
|
-
},
|
|
347
|
+
}, as = (n) => {
|
|
348
348
|
try {
|
|
349
349
|
const t = new URL(window.location.href).hostname;
|
|
350
350
|
if (!t || typeof t != "string")
|
|
@@ -362,15 +362,15 @@ const ss = () => {
|
|
|
362
362
|
if (!r || r.split(".").length < 2)
|
|
363
363
|
throw new Error("Invalid domain structure for SaaS");
|
|
364
364
|
const i = `https://${n}.${r}/collect`;
|
|
365
|
-
if (!
|
|
365
|
+
if (!os(i))
|
|
366
366
|
throw new Error("Generated URL failed validation");
|
|
367
367
|
return i;
|
|
368
368
|
} catch (e) {
|
|
369
369
|
throw new Error(`Invalid SaaS URL configuration: ${e instanceof Error ? e.message : String(e)}`);
|
|
370
370
|
}
|
|
371
|
-
},
|
|
371
|
+
}, cs = (n) => {
|
|
372
372
|
const e = {};
|
|
373
|
-
return n.integrations?.tracelog?.projectId && (e.saas =
|
|
373
|
+
return n.integrations?.tracelog?.projectId && (e.saas = as(n.integrations.tracelog.projectId)), e;
|
|
374
374
|
}, ye = (n, e = []) => {
|
|
375
375
|
if (!n || typeof n != "string")
|
|
376
376
|
return a("warn", "Invalid URL provided to normalizeUrl", { data: { type: typeof n } }), n || "";
|
|
@@ -425,7 +425,7 @@ const ss = () => {
|
|
|
425
425
|
return t;
|
|
426
426
|
}
|
|
427
427
|
return null;
|
|
428
|
-
},
|
|
428
|
+
}, ls = (n) => {
|
|
429
429
|
if (typeof n != "object" || n === null)
|
|
430
430
|
return {};
|
|
431
431
|
try {
|
|
@@ -435,7 +435,7 @@ const ss = () => {
|
|
|
435
435
|
const t = e instanceof Error ? e.message : String(e);
|
|
436
436
|
throw new Error(`[TraceLog] Metadata sanitization failed: ${t}`);
|
|
437
437
|
}
|
|
438
|
-
},
|
|
438
|
+
}, us = [
|
|
439
439
|
// Email addresses.
|
|
440
440
|
// Quantifiers are bounded (local part ≤64, each label ≤63, TLD ≤63 per RFC/DNS limits)
|
|
441
441
|
// and the domain is matched as discrete dot-separated labels so the local-part and
|
|
@@ -458,18 +458,18 @@ const ss = () => {
|
|
|
458
458
|
/[?&](token|password|passwd|auth|secret|secret_key|private_key|auth_key|api_key|apikey|access_token)=[^&\s]+/gi
|
|
459
459
|
], Y = (n) => {
|
|
460
460
|
let e = n;
|
|
461
|
-
for (const t of
|
|
461
|
+
for (const t of us)
|
|
462
462
|
e = e.replace(t, "[REDACTED]");
|
|
463
463
|
return e;
|
|
464
|
-
},
|
|
464
|
+
}, ds = (n) => {
|
|
465
465
|
if (n !== void 0 && (n === null || typeof n != "object"))
|
|
466
466
|
throw new m("Configuration must be an object", "config");
|
|
467
467
|
if (n) {
|
|
468
468
|
if (n.sessionTimeout !== void 0 && (typeof n.sessionTimeout != "number" || n.sessionTimeout < 3e4 || n.sessionTimeout > 864e5))
|
|
469
|
-
throw new
|
|
469
|
+
throw new bt(y.INVALID_SESSION_TIMEOUT, "config");
|
|
470
470
|
if (n.globalMetadata !== void 0 && (typeof n.globalMetadata != "object" || n.globalMetadata === null))
|
|
471
471
|
throw new m(y.INVALID_GLOBAL_METADATA, "config");
|
|
472
|
-
if (n.integrations &&
|
|
472
|
+
if (n.integrations && hs(n.integrations), n.sensitiveQueryParams !== void 0) {
|
|
473
473
|
if (!Array.isArray(n.sensitiveQueryParams))
|
|
474
474
|
throw new m(y.INVALID_SENSITIVE_QUERY_PARAMS, "config");
|
|
475
475
|
for (const e of n.sensitiveQueryParams)
|
|
@@ -529,14 +529,14 @@ const ss = () => {
|
|
|
529
529
|
}
|
|
530
530
|
}
|
|
531
531
|
}
|
|
532
|
-
},
|
|
532
|
+
}, hs = (n) => {
|
|
533
533
|
if (n && n.tracelog) {
|
|
534
534
|
if (!n.tracelog.projectId || typeof n.tracelog.projectId != "string" || n.tracelog.projectId.trim() === "")
|
|
535
535
|
throw new Xe(y.INVALID_TRACELOG_PROJECT_ID, "config");
|
|
536
536
|
if (n.tracelog.shopify !== void 0 && typeof n.tracelog.shopify != "boolean")
|
|
537
537
|
throw new Xe("tracelog.shopify must be a boolean", "config");
|
|
538
538
|
}
|
|
539
|
-
},
|
|
539
|
+
}, fs = (n) => (ds(n), {
|
|
540
540
|
...n ?? {},
|
|
541
541
|
sessionTimeout: n?.sessionTimeout ?? 9e5,
|
|
542
542
|
globalMetadata: n?.globalMetadata ?? {},
|
|
@@ -554,13 +554,13 @@ const ss = () => {
|
|
|
554
554
|
return !0;
|
|
555
555
|
const t = typeof n;
|
|
556
556
|
return t === "string" || t === "number" || t === "boolean" ? !0 : t === "function" || t === "symbol" || t === "bigint" || e.has(n) ? !1 : (e.add(n), Array.isArray(n) ? n.every((s) => we(s, e)) : t === "object" ? Object.values(n).every((s) => we(s, e)) : !1);
|
|
557
|
-
},
|
|
557
|
+
}, gs = (n) => typeof n != "object" || n === null ? !1 : we(n), Ae = (n) => {
|
|
558
558
|
if (typeof n != "object" || n === null || Array.isArray(n)) return;
|
|
559
559
|
const e = {};
|
|
560
560
|
for (const [t, s] of Object.entries(n))
|
|
561
561
|
typeof s == "string" && (e[t] = s);
|
|
562
562
|
return Object.keys(e).length > 0 ? e : void 0;
|
|
563
|
-
},
|
|
563
|
+
}, ms = (n) => typeof n != "string" ? {
|
|
564
564
|
valid: !1,
|
|
565
565
|
error: "Event name must be a string"
|
|
566
566
|
} : n.length === 0 ? {
|
|
@@ -576,8 +576,8 @@ const ss = () => {
|
|
|
576
576
|
valid: !1,
|
|
577
577
|
error: "Event name cannot be a reserved word"
|
|
578
578
|
} : { valid: !0 }, Je = (n, e, t) => {
|
|
579
|
-
const s =
|
|
580
|
-
if (!
|
|
579
|
+
const s = ls(e), r = `${t} "${n}" metadata error`;
|
|
580
|
+
if (!gs(s))
|
|
581
581
|
return {
|
|
582
582
|
valid: !1,
|
|
583
583
|
error: `${r}: object has invalid types. Valid types are string, number, boolean or string arrays.`
|
|
@@ -625,7 +625,7 @@ const ss = () => {
|
|
|
625
625
|
valid: !0,
|
|
626
626
|
sanitizedMetadata: s
|
|
627
627
|
};
|
|
628
|
-
},
|
|
628
|
+
}, ps = (n, e, t) => {
|
|
629
629
|
if (Array.isArray(e)) {
|
|
630
630
|
const s = [], r = `${t} "${n}" metadata error`;
|
|
631
631
|
for (let i = 0; i < e.length; i++) {
|
|
@@ -649,15 +649,15 @@ const ss = () => {
|
|
|
649
649
|
};
|
|
650
650
|
}
|
|
651
651
|
return Je(n, e, t);
|
|
652
|
-
},
|
|
653
|
-
const t =
|
|
652
|
+
}, Ss = (n, e) => {
|
|
653
|
+
const t = ms(n);
|
|
654
654
|
if (!t.valid)
|
|
655
655
|
return a("error", "Event name validation failed", {
|
|
656
656
|
data: { eventName: n, error: t.error }
|
|
657
657
|
}), t;
|
|
658
658
|
if (!e)
|
|
659
659
|
return { valid: !0 };
|
|
660
|
-
const s =
|
|
660
|
+
const s = ps(n, e, "customEvent");
|
|
661
661
|
return s.valid || a("error", "Event metadata validation failed", {
|
|
662
662
|
data: {
|
|
663
663
|
eventName: n,
|
|
@@ -665,7 +665,7 @@ const ss = () => {
|
|
|
665
665
|
}
|
|
666
666
|
}), s;
|
|
667
667
|
};
|
|
668
|
-
class
|
|
668
|
+
class Es {
|
|
669
669
|
listeners = /* @__PURE__ */ new Map();
|
|
670
670
|
/**
|
|
671
671
|
* Subscribes to an event channel
|
|
@@ -782,15 +782,15 @@ class ms {
|
|
|
782
782
|
this.listeners.clear();
|
|
783
783
|
}
|
|
784
784
|
}
|
|
785
|
-
const
|
|
786
|
-
function
|
|
787
|
-
return n.replace(
|
|
785
|
+
const vs = /https?:\/\/\S+/g, Ts = /[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}/gi, _s = /0x[0-9a-fA-F]{4,}/g, ys = /(?<!\d)\d{4,}(?!\d)/g, Is = /(['"])[^'"]{20,}\1/g;
|
|
786
|
+
function ws(n) {
|
|
787
|
+
return n.replace(vs, "[URL]").replace(Ts, "[ID]").replace(_s, "[ADDR]").replace(ys, "[N]").replace(Is, "$1[VAR]$1").toLowerCase().trim();
|
|
788
788
|
}
|
|
789
789
|
function Ze(n) {
|
|
790
790
|
const e = n.search(/[?#]/);
|
|
791
791
|
return e === -1 ? n : n.slice(0, e);
|
|
792
792
|
}
|
|
793
|
-
function
|
|
793
|
+
function As(n, e) {
|
|
794
794
|
const t = Ze((n ?? "").trim());
|
|
795
795
|
if (!t) return "";
|
|
796
796
|
let s;
|
|
@@ -803,8 +803,8 @@ function ys(n, e) {
|
|
|
803
803
|
const r = Ze((e ?? "").trim());
|
|
804
804
|
return r && t === r ? s.origin : t;
|
|
805
805
|
}
|
|
806
|
-
function
|
|
807
|
-
const e =
|
|
806
|
+
function bs(n) {
|
|
807
|
+
const e = ws(n.message), t = As(n.filename, n.page_url), s = n.line == null ? "" : String(n.line);
|
|
808
808
|
return `${e}|${t}|${s}`;
|
|
809
809
|
}
|
|
810
810
|
const ge = { config: {} };
|
|
@@ -828,10 +828,17 @@ class T {
|
|
|
828
828
|
return { ...ge };
|
|
829
829
|
}
|
|
830
830
|
}
|
|
831
|
-
class
|
|
831
|
+
class Ls extends T {
|
|
832
832
|
storeManager;
|
|
833
833
|
apiUrl;
|
|
834
834
|
lastPermanentErrorLog = null;
|
|
835
|
+
/**
|
|
836
|
+
* In-memory fallback for the beacon throttle when localStorage is
|
|
837
|
+
* unavailable. The primary throttle state lives in localStorage (see
|
|
838
|
+
* {@link HEALTH_BEACON_KEY}) so it survives MPA navigations and is shared
|
|
839
|
+
* across tabs.
|
|
840
|
+
*/
|
|
841
|
+
lastBeaconAt = {};
|
|
835
842
|
recoveryInProgress = !1;
|
|
836
843
|
lastMetadataTimestamp = 0;
|
|
837
844
|
pendingControllers = /* @__PURE__ */ new Set();
|
|
@@ -991,7 +998,7 @@ class ws extends T {
|
|
|
991
998
|
const t = this.ensureBatchMetadata(e), s = this.getPersistedData(), r = typeof s?.recoveryFailures == "number" && Number.isFinite(s.recoveryFailures) ? s.recoveryFailures : 0;
|
|
992
999
|
return this.persistEventsWithFailureCount(t, r, !0), !1;
|
|
993
1000
|
}
|
|
994
|
-
return this.apiUrl.includes(
|
|
1001
|
+
return this.apiUrl.includes(M.Fail) ? (a("warn", "Fail mode: simulating network failure (sync)", { data: { events: e.events.length } }), !1) : this.apiUrl.includes(M.Localhost) ? (a("debug", "Success mode: simulating successful send (sync)", { data: { events: e.events.length } }), !0) : this.sendQueueSyncInternal(e);
|
|
995
1002
|
}
|
|
996
1003
|
/**
|
|
997
1004
|
* Sends events asynchronously using `fetch()` with retry, circuit breaker, and 429 cooldown.
|
|
@@ -1003,7 +1010,7 @@ class ws extends T {
|
|
|
1003
1010
|
const r = await this.send(s);
|
|
1004
1011
|
return r ? (this.clearPersistedEvents(), t?.onSuccess?.(s.events.length, s.events, s)) : (this.persistEvents(s), t?.onFailure?.()), r;
|
|
1005
1012
|
} catch (r) {
|
|
1006
|
-
return r instanceof
|
|
1013
|
+
return r instanceof C ? (this.logPermanentError("Permanent error, not retrying", r), this.clearPersistedEvents(), t?.onFailure?.(), !1) : (this.persistEvents(s), t?.onFailure?.(), !1);
|
|
1007
1014
|
}
|
|
1008
1015
|
}
|
|
1009
1016
|
/**
|
|
@@ -1041,7 +1048,7 @@ class ws extends T {
|
|
|
1041
1048
|
}
|
|
1042
1049
|
await this.send(t) ? (this.clearPersistedEvents(), e?.onSuccess?.(r.events.length, r.events, t)) : (this.persistEventsWithFailureCount(t, s + 1, !0), e?.onFailure?.());
|
|
1043
1050
|
} catch (r) {
|
|
1044
|
-
if (r instanceof
|
|
1051
|
+
if (r instanceof C) {
|
|
1045
1052
|
this.logPermanentError("Permanent error during recovery, clearing persisted events", r), this.clearPersistedEvents(), e?.onFailure?.();
|
|
1046
1053
|
return;
|
|
1047
1054
|
}
|
|
@@ -1062,9 +1069,9 @@ class ws extends T {
|
|
|
1062
1069
|
}
|
|
1063
1070
|
async send(e) {
|
|
1064
1071
|
const t = this.ensureBatchMetadata(e, e._metadata?.idempotency_token);
|
|
1065
|
-
if (this.apiUrl.includes(
|
|
1072
|
+
if (this.apiUrl.includes(M.Fail))
|
|
1066
1073
|
return a("debug", "Fail mode: simulating network failure", { data: { events: t.events.length } }), !1;
|
|
1067
|
-
if (this.apiUrl.includes(
|
|
1074
|
+
if (this.apiUrl.includes(M.Localhost))
|
|
1068
1075
|
return a("debug", "Success mode: simulating successful send", { data: { events: t.events.length } }), !0;
|
|
1069
1076
|
if (this.isRateLimited())
|
|
1070
1077
|
return a("debug", "Rate-limit cooldown active, skipping send", {
|
|
@@ -1092,8 +1099,8 @@ class ws extends T {
|
|
|
1092
1099
|
}), this.consecutiveNetworkFailures = 0, this.circuitOpenedAt = 0, !0) : !1;
|
|
1093
1100
|
} catch (l) {
|
|
1094
1101
|
const u = c === 3;
|
|
1095
|
-
if (l instanceof
|
|
1096
|
-
throw this.consecutiveNetworkFailures = 0, this.circuitOpenedAt = 0, l;
|
|
1102
|
+
if (l instanceof C)
|
|
1103
|
+
throw this.consecutiveNetworkFailures = 0, this.circuitOpenedAt = 0, l.statusCode === 403 && this.emitHealthBeacon("events_blocked", l.message), l;
|
|
1097
1104
|
if (l instanceof J) {
|
|
1098
1105
|
this.consecutiveNetworkFailures = 0, this.circuitOpenedAt = 0, i = !1, o = !0, this.armRateLimitCooldown(Date.now() + 6e4), a("warn", "Rate limited, skipping retries", {
|
|
1099
1106
|
data: { events: e.events.length, attempt: c, cooldownMs: 6e4 }
|
|
@@ -1146,13 +1153,13 @@ class ws extends T {
|
|
|
1146
1153
|
if (!o.ok) {
|
|
1147
1154
|
if (o.status >= 400 && o.status < 500 && o.status !== 408 && o.status !== 429) {
|
|
1148
1155
|
const l = await this.readTraceLogErrorCode(o), u = l ? `HTTP ${o.status}: ${o.statusText} (${l})` : `HTTP ${o.status}: ${o.statusText}`;
|
|
1149
|
-
throw new
|
|
1156
|
+
throw new C(u, o.status, l);
|
|
1150
1157
|
}
|
|
1151
1158
|
throw o.status === 429 ? new J(`HTTP 429: ${o.statusText}`) : new Error(`HTTP ${o.status}: ${o.statusText}`);
|
|
1152
1159
|
}
|
|
1153
1160
|
return o;
|
|
1154
1161
|
} catch (o) {
|
|
1155
|
-
throw o instanceof
|
|
1162
|
+
throw o instanceof C ? o : r ? new Z("Request timed out") : o;
|
|
1156
1163
|
} finally {
|
|
1157
1164
|
clearTimeout(i), this.pendingControllers.delete(s);
|
|
1158
1165
|
}
|
|
@@ -1160,7 +1167,7 @@ class ws extends T {
|
|
|
1160
1167
|
async readTraceLogErrorCode(e) {
|
|
1161
1168
|
try {
|
|
1162
1169
|
const t = await e.clone().json();
|
|
1163
|
-
if (typeof t.code == "string" && t.code.length > 0 && t.code.length <=
|
|
1170
|
+
if (typeof t.code == "string" && t.code.length > 0 && t.code.length <= Kt)
|
|
1164
1171
|
return t.code;
|
|
1165
1172
|
} catch {
|
|
1166
1173
|
}
|
|
@@ -1187,7 +1194,7 @@ class ws extends T {
|
|
|
1187
1194
|
idempotency_token: e._metadata?.idempotency_token ?? this.computeContentToken(e),
|
|
1188
1195
|
referer: typeof window < "u" ? window.location.href : void 0,
|
|
1189
1196
|
timestamp: t,
|
|
1190
|
-
client_version:
|
|
1197
|
+
client_version: Zt
|
|
1191
1198
|
}
|
|
1192
1199
|
};
|
|
1193
1200
|
return {
|
|
@@ -1283,8 +1290,74 @@ class ws extends T {
|
|
|
1283
1290
|
data: { status: t.statusCode, code: t.responseCode, message: t.message }
|
|
1284
1291
|
}), this.lastPermanentErrorLog = { key: r, timestamp: s });
|
|
1285
1292
|
}
|
|
1293
|
+
/**
|
|
1294
|
+
* Emits a low-frequency, deduplicated diagnostic "health beacon" to the gate-bypassing
|
|
1295
|
+
* `/client-error` endpoint. Best-effort and silent: never blocks, never throws, never logs to the
|
|
1296
|
+
* host page. Opt out via `integrations.tracelog.healthBeacon: false`.
|
|
1297
|
+
*/
|
|
1298
|
+
emitHealthBeacon(e, t) {
|
|
1299
|
+
try {
|
|
1300
|
+
const s = this.get("config")?.integrations?.tracelog;
|
|
1301
|
+
if (!s?.projectId || s.healthBeacon === !1) return;
|
|
1302
|
+
const r = this.resolveBeaconUrl();
|
|
1303
|
+
if (!r) return;
|
|
1304
|
+
const i = typeof window < "u" && window.location ? window.location.origin : "";
|
|
1305
|
+
if (!i || !this.markBeaconEmitted(s.projectId, e)) return;
|
|
1306
|
+
const o = JSON.stringify({
|
|
1307
|
+
projectId: s.projectId,
|
|
1308
|
+
reason: e,
|
|
1309
|
+
origin: i,
|
|
1310
|
+
...t ? { lastError: t.slice(0, Qt) } : {}
|
|
1311
|
+
});
|
|
1312
|
+
this.postBeacon(r, o);
|
|
1313
|
+
} catch {
|
|
1314
|
+
}
|
|
1315
|
+
}
|
|
1316
|
+
/**
|
|
1317
|
+
* Throttle gate: returns `true` and records the emit timestamp when the
|
|
1318
|
+
* beacon may fire, `false` when still inside {@link HEALTH_BEACON_THROTTLE_MS}.
|
|
1319
|
+
*
|
|
1320
|
+
* State lives in localStorage so the window survives MPA navigations and is
|
|
1321
|
+
* shared across tabs; the in-memory map covers storage-disabled browsers.
|
|
1322
|
+
* The timestamp is deliberately recorded BEFORE the send attempt: if both
|
|
1323
|
+
* transports fail, waiting out the window is fine for a diagnostic signal
|
|
1324
|
+
* and avoids turning transport failures into retry bursts.
|
|
1325
|
+
*/
|
|
1326
|
+
markBeaconEmitted(e, t) {
|
|
1327
|
+
const s = Date.now(), r = It(e, t);
|
|
1328
|
+
let i = this.lastBeaconAt[t] ?? 0;
|
|
1329
|
+
try {
|
|
1330
|
+
const o = Number(this.storeManager.getItem(r));
|
|
1331
|
+
Number.isFinite(o) && o > i && (i = o);
|
|
1332
|
+
} catch {
|
|
1333
|
+
}
|
|
1334
|
+
if (s - i < zt) return !1;
|
|
1335
|
+
this.lastBeaconAt[t] = s;
|
|
1336
|
+
try {
|
|
1337
|
+
this.storeManager.setItem(r, String(s));
|
|
1338
|
+
} catch {
|
|
1339
|
+
}
|
|
1340
|
+
return !0;
|
|
1341
|
+
}
|
|
1342
|
+
/** The collect URL the lib already derived, with the path swapped to the diagnostics route. */
|
|
1343
|
+
resolveBeaconUrl() {
|
|
1344
|
+
return this.apiUrl.includes(M.Localhost) || this.apiUrl.includes(M.Fail) || !/\/collect$/.test(this.apiUrl) ? null : this.apiUrl.replace(/\/collect$/, "/client-error");
|
|
1345
|
+
}
|
|
1346
|
+
postBeacon(e, t) {
|
|
1347
|
+
if (this.isSendBeaconAvailable()) {
|
|
1348
|
+
const s = new Blob([t], { type: "application/json" });
|
|
1349
|
+
if (navigator.sendBeacon(e, s)) return;
|
|
1350
|
+
}
|
|
1351
|
+
typeof fetch == "function" && fetch(e, {
|
|
1352
|
+
method: "POST",
|
|
1353
|
+
body: t,
|
|
1354
|
+
keepalive: !0,
|
|
1355
|
+
headers: { "Content-Type": "application/json" }
|
|
1356
|
+
}).catch(() => {
|
|
1357
|
+
});
|
|
1358
|
+
}
|
|
1286
1359
|
}
|
|
1287
|
-
class
|
|
1360
|
+
class Ms extends T {
|
|
1288
1361
|
bootTime;
|
|
1289
1362
|
bootTimestamp;
|
|
1290
1363
|
hasPerformanceNow;
|
|
@@ -1318,8 +1391,8 @@ class As extends T {
|
|
|
1318
1391
|
} : { valid: !0 };
|
|
1319
1392
|
}
|
|
1320
1393
|
}
|
|
1321
|
-
const
|
|
1322
|
-
class
|
|
1394
|
+
const Cs = new Set(Object.values(d));
|
|
1395
|
+
class Rs extends T {
|
|
1323
1396
|
dataSenders;
|
|
1324
1397
|
emitter;
|
|
1325
1398
|
timeManager;
|
|
@@ -1351,9 +1424,9 @@ class bs extends T {
|
|
|
1351
1424
|
* @param emitter - Optional event emitter for local event consumption
|
|
1352
1425
|
*/
|
|
1353
1426
|
constructor(e, t = null) {
|
|
1354
|
-
super(), this.emitter = t, this.timeManager = new
|
|
1427
|
+
super(), this.emitter = t, this.timeManager = new Ms(), this.dataSenders = [];
|
|
1355
1428
|
const s = this.get("collectApiUrls");
|
|
1356
|
-
s?.saas && this.dataSenders.push(new
|
|
1429
|
+
s?.saas && this.dataSenders.push(new Ls(e, s.saas)), this.saveSessionCountsDebounced = this.debounce((r) => {
|
|
1357
1430
|
this.saveSessionCounts(r);
|
|
1358
1431
|
}, 500), this.cleanupExpiredSessionCounts();
|
|
1359
1432
|
}
|
|
@@ -1471,7 +1544,7 @@ class bs extends T {
|
|
|
1471
1544
|
a("error", "Event type is required - event will be ignored");
|
|
1472
1545
|
return;
|
|
1473
1546
|
}
|
|
1474
|
-
if (!
|
|
1547
|
+
if (!Cs.has(e)) {
|
|
1475
1548
|
a("error", "Invalid event type - event will be ignored", {
|
|
1476
1549
|
data: { type: e }
|
|
1477
1550
|
});
|
|
@@ -1532,7 +1605,7 @@ class bs extends T {
|
|
|
1532
1605
|
if (!this.checkPerEventRateLimit(o.name, _))
|
|
1533
1606
|
return;
|
|
1534
1607
|
}
|
|
1535
|
-
const St = S === d.SESSION_START, Et = t || this.get("pageUrl"),
|
|
1608
|
+
const St = S === d.SESSION_START, Et = t || this.get("pageUrl"), j = this.buildEventPayload({
|
|
1536
1609
|
type: S,
|
|
1537
1610
|
page_url: Et,
|
|
1538
1611
|
from_page_url: s,
|
|
@@ -1543,7 +1616,7 @@ class bs extends T {
|
|
|
1543
1616
|
error_data: l,
|
|
1544
1617
|
page_view: u
|
|
1545
1618
|
});
|
|
1546
|
-
if (
|
|
1619
|
+
if (j && !(!p && !this.shouldSample())) {
|
|
1547
1620
|
if (St) {
|
|
1548
1621
|
const _ = this.get("sessionId");
|
|
1549
1622
|
if (!_) {
|
|
@@ -1558,7 +1631,7 @@ class bs extends T {
|
|
|
1558
1631
|
}
|
|
1559
1632
|
this.set("hasStartSession", !0);
|
|
1560
1633
|
}
|
|
1561
|
-
if (!this.isDuplicateEvent(
|
|
1634
|
+
if (!this.isDuplicateEvent(j)) {
|
|
1562
1635
|
if (this.get("mode") === ee.QA && S === d.CUSTOM && o) {
|
|
1563
1636
|
a("info", `Custom Event: ${o.name}`, {
|
|
1564
1637
|
visibility: "qa",
|
|
@@ -1566,10 +1639,10 @@ class bs extends T {
|
|
|
1566
1639
|
name: o.name,
|
|
1567
1640
|
...o.metadata && { metadata: o.metadata }
|
|
1568
1641
|
}
|
|
1569
|
-
}), this.emitEvent(
|
|
1642
|
+
}), this.emitEvent(j);
|
|
1570
1643
|
return;
|
|
1571
1644
|
}
|
|
1572
|
-
if (this.addToQueue(
|
|
1645
|
+
if (this.addToQueue(j), !p) {
|
|
1573
1646
|
this.sessionEventCounts.total++, this.sessionEventCounts[S] !== void 0 && this.sessionEventCounts[S]++;
|
|
1574
1647
|
const _ = this.get("sessionId");
|
|
1575
1648
|
_ && this.saveSessionCountsDebounced && this.saveSessionCountsDebounced(_);
|
|
@@ -2027,7 +2100,7 @@ class bs extends T {
|
|
|
2027
2100
|
});
|
|
2028
2101
|
const c = this.get("sessionReferrer"), l = this.get("sessionUtm"), u = this.get("sessionClickIds");
|
|
2029
2102
|
return { ...{
|
|
2030
|
-
id:
|
|
2103
|
+
id: is(),
|
|
2031
2104
|
type: e.type,
|
|
2032
2105
|
page_url: r,
|
|
2033
2106
|
timestamp: i,
|
|
@@ -2135,11 +2208,11 @@ class bs extends T {
|
|
|
2135
2208
|
emitEvent(e) {
|
|
2136
2209
|
if (this.emitter) {
|
|
2137
2210
|
const { _session_id: t, ...s } = e;
|
|
2138
|
-
this.emitter.emit(
|
|
2211
|
+
this.emitter.emit(U.EVENT, s);
|
|
2139
2212
|
}
|
|
2140
2213
|
}
|
|
2141
2214
|
emitEventsQueue(e) {
|
|
2142
|
-
this.emitter && this.emitter.emit(
|
|
2215
|
+
this.emitter && this.emitter.emit(U.QUEUE, e);
|
|
2143
2216
|
}
|
|
2144
2217
|
/**
|
|
2145
2218
|
* Creates a debounced version of a function that delays execution until after
|
|
@@ -2339,7 +2412,7 @@ class bs extends T {
|
|
|
2339
2412
|
}
|
|
2340
2413
|
}
|
|
2341
2414
|
}
|
|
2342
|
-
class
|
|
2415
|
+
class Ns {
|
|
2343
2416
|
/**
|
|
2344
2417
|
* Gets or creates a unique user ID.
|
|
2345
2418
|
*
|
|
@@ -2364,8 +2437,8 @@ class Ms {
|
|
|
2364
2437
|
return e.setItem(Se, s), s;
|
|
2365
2438
|
}
|
|
2366
2439
|
}
|
|
2367
|
-
const
|
|
2368
|
-
class
|
|
2440
|
+
const Os = /^\d{13}-[a-z0-9]{9}$/;
|
|
2441
|
+
class Ps extends T {
|
|
2369
2442
|
storageManager;
|
|
2370
2443
|
eventManager;
|
|
2371
2444
|
projectId;
|
|
@@ -2392,7 +2465,7 @@ class Rs extends T {
|
|
|
2392
2465
|
return;
|
|
2393
2466
|
}
|
|
2394
2467
|
const e = this.getProjectId();
|
|
2395
|
-
this.broadcastChannel = new BroadcastChannel(
|
|
2468
|
+
this.broadcastChannel = new BroadcastChannel(At(e)), this.broadcastChannel.onmessage = (t) => {
|
|
2396
2469
|
const { action: s, sessionId: r, timestamp: i, projectId: o } = t.data ?? {};
|
|
2397
2470
|
if (o === e)
|
|
2398
2471
|
if (s === "session_start" && r && typeof i == "number" && i > Date.now() - 5e3) {
|
|
@@ -2417,7 +2490,7 @@ class Rs extends T {
|
|
|
2417
2490
|
const e = this.loadStoredSession();
|
|
2418
2491
|
if (!e)
|
|
2419
2492
|
return null;
|
|
2420
|
-
if (!
|
|
2493
|
+
if (!Os.test(e.id))
|
|
2421
2494
|
return a("warn", "Invalid session ID format recovered from storage, clearing", {
|
|
2422
2495
|
data: { sessionId: e.id }
|
|
2423
2496
|
}), this.clearStoredSession(), null;
|
|
@@ -2463,7 +2536,7 @@ class Rs extends T {
|
|
|
2463
2536
|
this.storageManager.setItem(t, s), this.storageManager.setSessionItem(t, s);
|
|
2464
2537
|
}
|
|
2465
2538
|
getSessionStorageKey() {
|
|
2466
|
-
return
|
|
2539
|
+
return wt(this.getProjectId());
|
|
2467
2540
|
}
|
|
2468
2541
|
getProjectId() {
|
|
2469
2542
|
return this.projectId;
|
|
@@ -2740,7 +2813,7 @@ class Rs extends T {
|
|
|
2740
2813
|
this.prerenderActivationHandler && (document.removeEventListener("prerenderingchange", this.prerenderActivationHandler), this.prerenderActivationHandler = null);
|
|
2741
2814
|
}
|
|
2742
2815
|
}
|
|
2743
|
-
class
|
|
2816
|
+
class ks extends T {
|
|
2744
2817
|
eventManager;
|
|
2745
2818
|
storageManager;
|
|
2746
2819
|
sessionManager = null;
|
|
@@ -2775,7 +2848,7 @@ class Ns extends T {
|
|
|
2775
2848
|
}
|
|
2776
2849
|
const t = this.get("config")?.integrations?.tracelog?.projectId ?? "custom";
|
|
2777
2850
|
try {
|
|
2778
|
-
this.sessionManager = new
|
|
2851
|
+
this.sessionManager = new Ps(this.storageManager, this.eventManager, t), this.sessionManager.startTracking(), this.eventManager.flushPendingEvents();
|
|
2779
2852
|
} catch (s) {
|
|
2780
2853
|
if (this.sessionManager) {
|
|
2781
2854
|
try {
|
|
@@ -2828,7 +2901,7 @@ class Ns extends T {
|
|
|
2828
2901
|
this.destroyed || (this.sessionManager && (this.sessionManager.destroy(), this.sessionManager = null), this.destroyed = !0);
|
|
2829
2902
|
}
|
|
2830
2903
|
}
|
|
2831
|
-
class
|
|
2904
|
+
class Ds extends T {
|
|
2832
2905
|
eventManager;
|
|
2833
2906
|
onTrack;
|
|
2834
2907
|
originalPushState;
|
|
@@ -2902,7 +2975,7 @@ class Os extends T {
|
|
|
2902
2975
|
};
|
|
2903
2976
|
}
|
|
2904
2977
|
}
|
|
2905
|
-
class
|
|
2978
|
+
class Us extends T {
|
|
2906
2979
|
eventManager;
|
|
2907
2980
|
lastClickTimes = /* @__PURE__ */ new Map();
|
|
2908
2981
|
clickHandler;
|
|
@@ -2970,7 +3043,7 @@ class Ps extends T {
|
|
|
2970
3043
|
this.clickHandler && (window.removeEventListener("click", this.clickHandler, !0), this.clickHandler = void 0), this.lastClickTimes.clear(), this.lastPruneTime = 0;
|
|
2971
3044
|
}
|
|
2972
3045
|
shouldIgnoreElement(e) {
|
|
2973
|
-
return e.hasAttribute(`${
|
|
3046
|
+
return e.hasAttribute(`${b}-ignore`) ? !0 : e.closest(`[${b}-ignore]`) !== null;
|
|
2974
3047
|
}
|
|
2975
3048
|
/**
|
|
2976
3049
|
* Checks per-element click throttling to prevent double-clicks and rapid spam
|
|
@@ -3021,8 +3094,8 @@ class Ps extends T {
|
|
|
3021
3094
|
const t = e.getAttribute("data-testid");
|
|
3022
3095
|
if (t)
|
|
3023
3096
|
return `[data-testid="${t}"]`;
|
|
3024
|
-
const s = e.getAttribute(`${
|
|
3025
|
-
return s ? `[${
|
|
3097
|
+
const s = e.getAttribute(`${b}-name`);
|
|
3098
|
+
return s ? `[${b}-name="${s}"]` : this.getElementPath(e);
|
|
3026
3099
|
}
|
|
3027
3100
|
/**
|
|
3028
3101
|
* Generates a DOM path for an element (e.g., "body>div>button")
|
|
@@ -3041,7 +3114,7 @@ class Ps extends T {
|
|
|
3041
3114
|
return t.join(">") || "unknown";
|
|
3042
3115
|
}
|
|
3043
3116
|
findTrackingElement(e) {
|
|
3044
|
-
return e.hasAttribute(`${
|
|
3117
|
+
return e.hasAttribute(`${b}-name`) ? e : e.closest(`[${b}-name]`);
|
|
3045
3118
|
}
|
|
3046
3119
|
getRelevantClickElement(e) {
|
|
3047
3120
|
for (const t of vt)
|
|
@@ -3062,7 +3135,7 @@ class Ps extends T {
|
|
|
3062
3135
|
return typeof t != "number" || typeof s != "number" || !Number.isFinite(t) || !Number.isFinite(s) || t === 0 && s === 0 && !e.isTrusted ? null : { x: t, y: s };
|
|
3063
3136
|
}
|
|
3064
3137
|
extractTrackingData(e) {
|
|
3065
|
-
const t = e.getAttribute(`${
|
|
3138
|
+
const t = e.getAttribute(`${b}-name`), s = e.getAttribute(`${b}-value`);
|
|
3066
3139
|
if (t)
|
|
3067
3140
|
return {
|
|
3068
3141
|
element: e,
|
|
@@ -3096,7 +3169,7 @@ class Ps extends T {
|
|
|
3096
3169
|
};
|
|
3097
3170
|
}
|
|
3098
3171
|
}
|
|
3099
|
-
class
|
|
3172
|
+
class Fs extends T {
|
|
3100
3173
|
eventManager;
|
|
3101
3174
|
containers = [];
|
|
3102
3175
|
limitWarningLogged = !1;
|
|
@@ -3251,8 +3324,8 @@ class ks extends T {
|
|
|
3251
3324
|
return s && r;
|
|
3252
3325
|
}
|
|
3253
3326
|
}
|
|
3254
|
-
const
|
|
3255
|
-
class
|
|
3327
|
+
const Vs = "tracelog_session_id", Hs = "tracelog_user_id";
|
|
3328
|
+
class xs extends T {
|
|
3256
3329
|
visibilityHandler = null;
|
|
3257
3330
|
pageshowHandler = null;
|
|
3258
3331
|
lastSyncedKey = null;
|
|
@@ -3273,8 +3346,8 @@ class Fs extends T {
|
|
|
3273
3346
|
r !== this.lastSyncedKey && (this.lastSyncedKey = r, this.postCartUpdate(e, s));
|
|
3274
3347
|
}
|
|
3275
3348
|
postCartUpdate(e, t) {
|
|
3276
|
-
const s = { [
|
|
3277
|
-
t.length > 0 && (s[
|
|
3349
|
+
const s = { [Vs]: e };
|
|
3350
|
+
t.length > 0 && (s[Hs] = t);
|
|
3278
3351
|
try {
|
|
3279
3352
|
fetch("/cart/update.js", {
|
|
3280
3353
|
method: "POST",
|
|
@@ -3311,7 +3384,7 @@ class Fs extends T {
|
|
|
3311
3384
|
this.visibilityHandler && (document.removeEventListener("visibilitychange", this.visibilityHandler), this.visibilityHandler = null), this.pageshowHandler && (window.removeEventListener("pageshow", this.pageshowHandler), this.pageshowHandler = null);
|
|
3312
3385
|
}
|
|
3313
3386
|
}
|
|
3314
|
-
class
|
|
3387
|
+
class $s {
|
|
3315
3388
|
storage;
|
|
3316
3389
|
sessionStorageRef;
|
|
3317
3390
|
fallbackStorage = /* @__PURE__ */ new Map();
|
|
@@ -3424,7 +3497,7 @@ class Vs {
|
|
|
3424
3497
|
this.fallbackSessionStorage.delete(e);
|
|
3425
3498
|
}
|
|
3426
3499
|
}
|
|
3427
|
-
class
|
|
3500
|
+
class Bs extends T {
|
|
3428
3501
|
eventManager;
|
|
3429
3502
|
reportedByNav = /* @__PURE__ */ new Map();
|
|
3430
3503
|
navigationHistory = [];
|
|
@@ -3521,7 +3594,7 @@ class Hs extends T {
|
|
|
3521
3594
|
}
|
|
3522
3595
|
async initWebVitals() {
|
|
3523
3596
|
try {
|
|
3524
|
-
const { onLCP: e, onCLS: t, onFCP: s, onTTFB: r, onINP: i } = await Promise.resolve().then(() =>
|
|
3597
|
+
const { onLCP: e, onCLS: t, onFCP: s, onTTFB: r, onINP: i } = await Promise.resolve().then(() => mn), o = (c) => (l) => {
|
|
3525
3598
|
const u = Number(l.value.toFixed(2));
|
|
3526
3599
|
this.sendVital({ type: c, value: u });
|
|
3527
3600
|
};
|
|
@@ -3551,7 +3624,7 @@ class Hs extends T {
|
|
|
3551
3624
|
return;
|
|
3552
3625
|
if (s)
|
|
3553
3626
|
s.add(e.type);
|
|
3554
|
-
else if (this.reportedByNav.set(t, /* @__PURE__ */ new Set([e.type])), this.navigationHistory.push(t), this.navigationHistory.length >
|
|
3627
|
+
else if (this.reportedByNav.set(t, /* @__PURE__ */ new Set([e.type])), this.navigationHistory.push(t), this.navigationHistory.length > qt) {
|
|
3555
3628
|
const i = this.navigationHistory.shift();
|
|
3556
3629
|
i && this.reportedByNav.delete(i);
|
|
3557
3630
|
}
|
|
@@ -3669,7 +3742,7 @@ class se extends T {
|
|
|
3669
3742
|
this.resetPageviewCounter();
|
|
3670
3743
|
}, window.addEventListener("pagehide", this.pagehideHandler, { passive: !0 }), this.emitter && (this.pageviewResetListener = (e) => {
|
|
3671
3744
|
(e.type === d.SESSION_START || e.type === d.PAGE_VIEW) && this.resetPageviewCounter();
|
|
3672
|
-
}, this.emitter.on(
|
|
3745
|
+
}, this.emitter.on(U.EVENT, this.pageviewResetListener));
|
|
3673
3746
|
}
|
|
3674
3747
|
/**
|
|
3675
3748
|
* Stops tracking errors and cleans up resources.
|
|
@@ -3680,7 +3753,7 @@ class se extends T {
|
|
|
3680
3753
|
* - Resets burst detection counters
|
|
3681
3754
|
*/
|
|
3682
3755
|
stopTracking() {
|
|
3683
|
-
window.removeEventListener("error", this.handleError), window.removeEventListener("unhandledrejection", this.handleRejection), this.pagehideHandler && (window.removeEventListener("pagehide", this.pagehideHandler), this.pagehideHandler = null), this.emitter && this.pageviewResetListener && (this.emitter.off(
|
|
3756
|
+
window.removeEventListener("error", this.handleError), window.removeEventListener("unhandledrejection", this.handleRejection), this.pagehideHandler && (window.removeEventListener("pagehide", this.pagehideHandler), this.pagehideHandler = null), this.emitter && this.pageviewResetListener && (this.emitter.off(U.EVENT, this.pageviewResetListener), this.pageviewResetListener = null), this.recentErrors.clear(), this.pageviewSignatureCounts.clear(), this.errorBurstCounter = 0, this.burstWindowStart = 0, this.burstBackoffUntil = 0;
|
|
3684
3757
|
}
|
|
3685
3758
|
/**
|
|
3686
3759
|
* Clears the per-pageview signature counter.
|
|
@@ -3699,7 +3772,7 @@ class se extends T {
|
|
|
3699
3772
|
const e = Date.now();
|
|
3700
3773
|
if (e < this.burstBackoffUntil)
|
|
3701
3774
|
return !1;
|
|
3702
|
-
if (e - this.burstWindowStart >
|
|
3775
|
+
if (e - this.burstWindowStart > Bt && (this.errorBurstCounter = 0, this.burstWindowStart = e), this.errorBurstCounter++, this.errorBurstCounter > Xt)
|
|
3703
3776
|
return this.burstBackoffUntil = e + Ke, a("debug", "Error burst detected - entering cooldown", {
|
|
3704
3777
|
data: {
|
|
3705
3778
|
errorsInWindow: this.errorBurstCounter,
|
|
@@ -3716,8 +3789,8 @@ class se extends T {
|
|
|
3716
3789
|
* later signature that recycles the same map key after a counter reset.
|
|
3717
3790
|
*/
|
|
3718
3791
|
shouldThrottleBySignature(e) {
|
|
3719
|
-
const t =
|
|
3720
|
-
if (s >=
|
|
3792
|
+
const t = bs(e), s = this.pageviewSignatureCounts.get(t) ?? 0;
|
|
3793
|
+
if (s >= jt)
|
|
3721
3794
|
return a("debug", "Error throttled (pageview cap)", {
|
|
3722
3795
|
data: { signature: t, count: s }
|
|
3723
3796
|
}), !0;
|
|
@@ -3784,24 +3857,24 @@ class se extends T {
|
|
|
3784
3857
|
}
|
|
3785
3858
|
}
|
|
3786
3859
|
sanitize(e) {
|
|
3787
|
-
const t = e.length >
|
|
3860
|
+
const t = e.length > je ? e.slice(0, je) + "..." : e;
|
|
3788
3861
|
return Y(t);
|
|
3789
3862
|
}
|
|
3790
3863
|
shouldSuppressError(e, t) {
|
|
3791
3864
|
const s = Date.now(), r = `${e}:${t}`, i = this.recentErrors.get(r);
|
|
3792
|
-
return i !== void 0 && s - i <
|
|
3865
|
+
return i !== void 0 && s - i < We ? (this.recentErrors.set(r, s), !0) : (this.recentErrors.set(r, s), this.recentErrors.size > $t ? (this.recentErrors.clear(), this.recentErrors.set(r, s), !1) : (this.recentErrors.size > Q && this.pruneOldErrors(), !1));
|
|
3793
3866
|
}
|
|
3794
3867
|
static TRUNCATION_SUFFIX = `
|
|
3795
3868
|
...truncated`;
|
|
3796
3869
|
truncateStack(e) {
|
|
3797
|
-
if (e.length <=
|
|
3798
|
-
const t =
|
|
3870
|
+
if (e.length <= Ge) return Y(e);
|
|
3871
|
+
const t = Ge - se.TRUNCATION_SUFFIX.length, s = e.slice(0, t) + se.TRUNCATION_SUFFIX;
|
|
3799
3872
|
return Y(s);
|
|
3800
3873
|
}
|
|
3801
3874
|
pruneOldErrors() {
|
|
3802
3875
|
const e = Date.now();
|
|
3803
3876
|
for (const [r, i] of this.recentErrors.entries())
|
|
3804
|
-
e - i >
|
|
3877
|
+
e - i > We && this.recentErrors.delete(r);
|
|
3805
3878
|
if (this.recentErrors.size <= Q)
|
|
3806
3879
|
return;
|
|
3807
3880
|
const t = Array.from(this.recentErrors.entries()).sort((r, i) => r[1] - i[1]), s = this.recentErrors.size - Q;
|
|
@@ -3811,14 +3884,14 @@ class se extends T {
|
|
|
3811
3884
|
}
|
|
3812
3885
|
}
|
|
3813
3886
|
}
|
|
3814
|
-
class
|
|
3887
|
+
class Xs extends T {
|
|
3815
3888
|
isInitialized = !1;
|
|
3816
3889
|
suppressNextScrollTimer = null;
|
|
3817
3890
|
pageUnloadHandler = null;
|
|
3818
3891
|
pageShowHandler = null;
|
|
3819
3892
|
visibilityFlushHandler = null;
|
|
3820
3893
|
prerenderActivationHandler = null;
|
|
3821
|
-
emitter = new
|
|
3894
|
+
emitter = new Es();
|
|
3822
3895
|
managers = {};
|
|
3823
3896
|
handlers = {};
|
|
3824
3897
|
integrationInstances = {};
|
|
@@ -3833,9 +3906,9 @@ class xs extends T {
|
|
|
3833
3906
|
async init(e = {}) {
|
|
3834
3907
|
if (this.isInitialized)
|
|
3835
3908
|
return { sessionId: this.get("sessionId") ?? "" };
|
|
3836
|
-
this.managers.storage = new
|
|
3909
|
+
this.managers.storage = new $s();
|
|
3837
3910
|
try {
|
|
3838
|
-
return this.setupState(e), this.managers.event = new
|
|
3911
|
+
return this.setupState(e), this.managers.event = new Rs(this.managers.storage, this.emitter), this.loadPersistedIdentity(), this.initializeHandlers(), this.setupPageLifecycleListeners(), await this.managers.event.recoverPersistedEvents().catch((t) => {
|
|
3839
3912
|
a("warn", "Failed to recover persisted events", { error: t });
|
|
3840
3913
|
}), this.isInitialized = !0, { sessionId: this.get("sessionId") ?? "" };
|
|
3841
3914
|
} catch (t) {
|
|
@@ -3856,7 +3929,7 @@ class xs extends T {
|
|
|
3856
3929
|
}
|
|
3857
3930
|
let r = t;
|
|
3858
3931
|
t && typeof t == "object" && !Array.isArray(t) && Object.getPrototypeOf(t) !== Object.prototype && (r = Object.assign({}, t));
|
|
3859
|
-
const { valid: i, error: o, sanitizedMetadata: c } =
|
|
3932
|
+
const { valid: i, error: o, sanitizedMetadata: c } = Ss(e, r);
|
|
3860
3933
|
if (!i) {
|
|
3861
3934
|
if (this.get("mode") === ee.QA)
|
|
3862
3935
|
throw new Error(`[TraceLog] Custom event "${e}" validation failed: ${o}`);
|
|
@@ -3895,14 +3968,14 @@ class xs extends T {
|
|
|
3895
3968
|
}
|
|
3896
3969
|
setupState(e = {}) {
|
|
3897
3970
|
this.set("config", e);
|
|
3898
|
-
const t =
|
|
3971
|
+
const t = Ns.getId(this.managers.storage);
|
|
3899
3972
|
this.set("userId", t);
|
|
3900
|
-
const s =
|
|
3973
|
+
const s = cs(e);
|
|
3901
3974
|
this.set("collectApiUrls", s);
|
|
3902
|
-
const r =
|
|
3975
|
+
const r = xt();
|
|
3903
3976
|
this.set("device", r);
|
|
3904
3977
|
const i = ye(window.location.href, e.sensitiveQueryParams);
|
|
3905
|
-
this.set("pageUrl", i),
|
|
3978
|
+
this.set("pageUrl", i), ss() && this.set("mode", ee.QA);
|
|
3906
3979
|
}
|
|
3907
3980
|
/**
|
|
3908
3981
|
* @internal Used by api.ts for configuration access
|
|
@@ -4007,10 +4080,10 @@ class xs extends T {
|
|
|
4007
4080
|
loadPersistedIdentity() {
|
|
4008
4081
|
const e = this.managers.storage, t = this.getProjectId(), s = ue(t);
|
|
4009
4082
|
try {
|
|
4010
|
-
const r = e.getItem(
|
|
4083
|
+
const r = e.getItem(P);
|
|
4011
4084
|
if (r) {
|
|
4012
4085
|
const i = JSON.parse(r);
|
|
4013
|
-
if (e.removeItem(
|
|
4086
|
+
if (e.removeItem(P), !this.isValidIdentityData(i)) {
|
|
4014
4087
|
a("debug", "Invalid pending identity in localStorage, discarded");
|
|
4015
4088
|
return;
|
|
4016
4089
|
}
|
|
@@ -4019,7 +4092,7 @@ class xs extends T {
|
|
|
4019
4092
|
return;
|
|
4020
4093
|
}
|
|
4021
4094
|
} catch {
|
|
4022
|
-
e.removeItem(
|
|
4095
|
+
e.removeItem(P);
|
|
4023
4096
|
}
|
|
4024
4097
|
try {
|
|
4025
4098
|
const r = e.getItem(s);
|
|
@@ -4065,7 +4138,7 @@ class xs extends T {
|
|
|
4065
4138
|
clearPersistedIdentity() {
|
|
4066
4139
|
try {
|
|
4067
4140
|
const e = this.managers.storage, t = this.getProjectId();
|
|
4068
|
-
e.removeItem(ue(t)), e.removeItem(
|
|
4141
|
+
e.removeItem(ue(t)), e.removeItem(P);
|
|
4069
4142
|
} catch {
|
|
4070
4143
|
a("debug", "Failed to clear persisted identity");
|
|
4071
4144
|
}
|
|
@@ -4083,7 +4156,7 @@ class xs extends T {
|
|
|
4083
4156
|
}
|
|
4084
4157
|
initializeHandlers() {
|
|
4085
4158
|
const e = this.get("config");
|
|
4086
|
-
this.handlers.session = new
|
|
4159
|
+
this.handlers.session = new ks(
|
|
4087
4160
|
this.managers.storage,
|
|
4088
4161
|
this.managers.event
|
|
4089
4162
|
), this.handlers.session.startTracking();
|
|
@@ -4092,13 +4165,13 @@ class xs extends T {
|
|
|
4092
4165
|
this.set("suppressNextScroll", !1);
|
|
4093
4166
|
}, 500);
|
|
4094
4167
|
};
|
|
4095
|
-
this.handlers.pageView = new
|
|
4168
|
+
this.handlers.pageView = new Ds(this.managers.event, t), this.handlers.click = new Us(this.managers.event), this.handlers.scroll = new Fs(this.managers.event), this.handlers.performance = new Bs(this.managers.event), this.handlers.error = new se(this.managers.event, this.emitter);
|
|
4096
4169
|
const s = () => {
|
|
4097
4170
|
if (this.handlers.pageView?.startTracking(), this.handlers.click?.startTracking(), this.handlers.scroll?.startTracking(), this.handlers.performance?.startTracking().catch((r) => {
|
|
4098
4171
|
a("warn", "Failed to start performance tracking", { error: r });
|
|
4099
4172
|
}), this.handlers.error?.startTracking(), e.integrations?.tracelog?.shopify) {
|
|
4100
|
-
const r = new
|
|
4101
|
-
r.activate(), this.integrationInstances.shopifyCartLinker = r, this.emitter.on(
|
|
4173
|
+
const r = new xs();
|
|
4174
|
+
r.activate(), this.integrationInstances.shopifyCartLinker = r, this.emitter.on(U.EVENT, (i) => {
|
|
4102
4175
|
i.type === d.SESSION_START && r.onSessionChange();
|
|
4103
4176
|
});
|
|
4104
4177
|
}
|
|
@@ -4108,15 +4181,15 @@ class xs extends T {
|
|
|
4108
4181
|
}, document.addEventListener("prerenderingchange", this.prerenderActivationHandler, { once: !0 })) : s();
|
|
4109
4182
|
}
|
|
4110
4183
|
}
|
|
4111
|
-
const
|
|
4112
|
-
let f = null,
|
|
4113
|
-
const
|
|
4184
|
+
const N = [];
|
|
4185
|
+
let f = null, D = !1, A = !1, R = null;
|
|
4186
|
+
const js = async (n) => typeof window > "u" || typeof document > "u" ? { sessionId: "" } : (A = !1, window.__traceLogDisabled === !0 ? { sessionId: "" } : f ? { sessionId: f.getSessionId() ?? "" } : (D && R || (D = !0, R = (async () => {
|
|
4114
4187
|
try {
|
|
4115
|
-
const e =
|
|
4188
|
+
const e = fs(n ?? {}), t = new Xs();
|
|
4116
4189
|
try {
|
|
4117
|
-
|
|
4190
|
+
N.forEach(({ event: o, callback: c }) => {
|
|
4118
4191
|
t.on(o, c);
|
|
4119
|
-
}),
|
|
4192
|
+
}), N.length = 0;
|
|
4120
4193
|
const s = t.init(e), r = new Promise((o, c) => {
|
|
4121
4194
|
setTimeout(() => {
|
|
4122
4195
|
c(new Error("[TraceLog] Initialization timeout after 10000ms"));
|
|
@@ -4134,9 +4207,9 @@ const $s = async (n) => typeof window > "u" || typeof document > "u" ? { session
|
|
|
4134
4207
|
} catch (e) {
|
|
4135
4208
|
throw f = null, e;
|
|
4136
4209
|
} finally {
|
|
4137
|
-
|
|
4210
|
+
D = !1, R = null;
|
|
4138
4211
|
}
|
|
4139
|
-
})()),
|
|
4212
|
+
})()), R)), Gs = (n, e, t) => {
|
|
4140
4213
|
if (!(typeof window > "u" || typeof document > "u")) {
|
|
4141
4214
|
if (!f)
|
|
4142
4215
|
throw new Error("[TraceLog] TraceLog not initialized. Please call init() first.");
|
|
@@ -4144,24 +4217,24 @@ const $s = async (n) => typeof window > "u" || typeof document > "u" ? { session
|
|
|
4144
4217
|
throw new Error("[TraceLog] Cannot send events while TraceLog is being destroyed");
|
|
4145
4218
|
f.sendCustomEvent(n, e, t);
|
|
4146
4219
|
}
|
|
4147
|
-
},
|
|
4220
|
+
}, Ws = (n, e) => {
|
|
4148
4221
|
if (!(typeof window > "u" || typeof document > "u")) {
|
|
4149
|
-
if (!f ||
|
|
4150
|
-
|
|
4222
|
+
if (!f || D) {
|
|
4223
|
+
N.push({ event: n, callback: e });
|
|
4151
4224
|
return;
|
|
4152
4225
|
}
|
|
4153
4226
|
f.on(n, e);
|
|
4154
4227
|
}
|
|
4155
|
-
},
|
|
4228
|
+
}, Ks = (n, e) => {
|
|
4156
4229
|
if (!(typeof window > "u" || typeof document > "u")) {
|
|
4157
4230
|
if (!f) {
|
|
4158
|
-
const t =
|
|
4159
|
-
t !== -1 &&
|
|
4231
|
+
const t = N.findIndex((s) => s.event === n && s.callback === e);
|
|
4232
|
+
t !== -1 && N.splice(t, 1);
|
|
4160
4233
|
return;
|
|
4161
4234
|
}
|
|
4162
4235
|
f.off(n, e);
|
|
4163
4236
|
}
|
|
4164
|
-
},
|
|
4237
|
+
}, zs = () => typeof window > "u" || typeof document > "u" ? !1 : f !== null, Qs = () => typeof window > "u" || typeof document > "u" || !f ? null : f.getSessionId(), Ys = () => typeof window > "u" || typeof document > "u" || !f ? null : f.getUserId(), qs = () => {
|
|
4165
4238
|
if (!(typeof window > "u" || typeof document > "u")) {
|
|
4166
4239
|
if (A)
|
|
4167
4240
|
throw new Error("[TraceLog] Destroy operation already in progress");
|
|
@@ -4171,12 +4244,12 @@ const $s = async (n) => typeof window > "u" || typeof document > "u" ? { session
|
|
|
4171
4244
|
}
|
|
4172
4245
|
A = !0;
|
|
4173
4246
|
try {
|
|
4174
|
-
f.destroy(), f = null,
|
|
4247
|
+
f.destroy(), f = null, D = !1, R = null, N.length = 0, A = !1;
|
|
4175
4248
|
} catch (n) {
|
|
4176
|
-
f = null,
|
|
4249
|
+
f = null, D = !1, R = null, N.length = 0, A = !1, a("warn", "Error during destroy, forced cleanup completed", { error: n });
|
|
4177
4250
|
}
|
|
4178
4251
|
}
|
|
4179
|
-
},
|
|
4252
|
+
}, Js = (n, e) => {
|
|
4180
4253
|
if (!(typeof window > "u" || typeof document > "u")) {
|
|
4181
4254
|
if (!n || typeof n != "string" || n.trim().length === 0) {
|
|
4182
4255
|
a("warn", "identify() called with invalid userId");
|
|
@@ -4199,16 +4272,16 @@ const $s = async (n) => typeof window > "u" || typeof document > "u" ? { session
|
|
|
4199
4272
|
userId: n.trim(),
|
|
4200
4273
|
...t ? { traits: t } : {}
|
|
4201
4274
|
};
|
|
4202
|
-
localStorage.setItem(
|
|
4275
|
+
localStorage.setItem(P, JSON.stringify(s)), a("debug", "Identity persisted pre-init (will be applied on init)");
|
|
4203
4276
|
} catch {
|
|
4204
4277
|
a("debug", "Failed to persist pre-init identity");
|
|
4205
4278
|
}
|
|
4206
4279
|
}
|
|
4207
|
-
},
|
|
4280
|
+
}, Zs = async () => {
|
|
4208
4281
|
if (!(typeof window > "u" || typeof document > "u")) {
|
|
4209
4282
|
if (!f) {
|
|
4210
4283
|
try {
|
|
4211
|
-
localStorage.removeItem(
|
|
4284
|
+
localStorage.removeItem(P);
|
|
4212
4285
|
} catch {
|
|
4213
4286
|
}
|
|
4214
4287
|
return;
|
|
@@ -4217,19 +4290,19 @@ const $s = async (n) => typeof window > "u" || typeof document > "u" ? { session
|
|
|
4217
4290
|
throw new Error("[TraceLog] Cannot reset identity while TraceLog is being destroyed");
|
|
4218
4291
|
await f.resetIdentity();
|
|
4219
4292
|
}
|
|
4220
|
-
},
|
|
4221
|
-
init:
|
|
4222
|
-
event:
|
|
4223
|
-
on:
|
|
4224
|
-
off:
|
|
4225
|
-
isInitialized:
|
|
4226
|
-
getSessionId:
|
|
4227
|
-
getUserId:
|
|
4228
|
-
destroy:
|
|
4229
|
-
identify:
|
|
4230
|
-
resetIdentity:
|
|
4293
|
+
}, Ln = {
|
|
4294
|
+
init: js,
|
|
4295
|
+
event: Gs,
|
|
4296
|
+
on: Ws,
|
|
4297
|
+
off: Ks,
|
|
4298
|
+
isInitialized: zs,
|
|
4299
|
+
getSessionId: Qs,
|
|
4300
|
+
getUserId: Ys,
|
|
4301
|
+
destroy: qs,
|
|
4302
|
+
identify: Js,
|
|
4303
|
+
resetIdentity: Zs
|
|
4231
4304
|
};
|
|
4232
|
-
var
|
|
4305
|
+
var be, L, x, ct, ne, lt = -1, O = function(n) {
|
|
4233
4306
|
addEventListener("pageshow", (function(e) {
|
|
4234
4307
|
e.persisted && (lt = e.timeStamp, n(e));
|
|
4235
4308
|
}), !0);
|
|
@@ -4242,7 +4315,7 @@ var Le, b, x, ct, ne, lt = -1, N = function(n) {
|
|
|
4242
4315
|
}, E = function(n, e) {
|
|
4243
4316
|
var t = Pe(), s = "navigate";
|
|
4244
4317
|
return lt >= 0 ? s = "back-forward-cache" : t && (document.prerendering || ie() > 0 ? s = "prerender" : document.wasDiscarded ? s = "restore" : t.type && (s = t.type.replace(/_/g, "-"))), { name: n, value: e === void 0 ? -1 : e, rating: "good", delta: 0, entries: [], id: "v4-".concat(Date.now(), "-").concat(Math.floor(8999999999999 * Math.random()) + 1e12), navigationType: s };
|
|
4245
|
-
},
|
|
4318
|
+
}, F = function(n, e, t) {
|
|
4246
4319
|
try {
|
|
4247
4320
|
if (PerformanceObserver.supportedEntryTypes.includes(n)) {
|
|
4248
4321
|
var s = new PerformanceObserver((function(r) {
|
|
@@ -4276,40 +4349,40 @@ var Le, b, x, ct, ne, lt = -1, N = function(n) {
|
|
|
4276
4349
|
return function() {
|
|
4277
4350
|
e || (n(), e = !0);
|
|
4278
4351
|
};
|
|
4279
|
-
},
|
|
4352
|
+
}, k = -1, et = function() {
|
|
4280
4353
|
return document.visibilityState !== "hidden" || document.prerendering ? 1 / 0 : 0;
|
|
4281
4354
|
}, re = function(n) {
|
|
4282
|
-
document.visibilityState === "hidden" &&
|
|
4355
|
+
document.visibilityState === "hidden" && k > -1 && (k = n.type === "visibilitychange" ? n.timeStamp : 0, en());
|
|
4283
4356
|
}, tt = function() {
|
|
4284
4357
|
addEventListener("visibilitychange", re, !0), addEventListener("prerenderingchange", re, !0);
|
|
4285
|
-
},
|
|
4358
|
+
}, en = function() {
|
|
4286
4359
|
removeEventListener("visibilitychange", re, !0), removeEventListener("prerenderingchange", re, !0);
|
|
4287
4360
|
}, De = function() {
|
|
4288
|
-
return
|
|
4361
|
+
return k < 0 && (k = et(), tt(), O((function() {
|
|
4289
4362
|
setTimeout((function() {
|
|
4290
|
-
|
|
4363
|
+
k = et(), tt();
|
|
4291
4364
|
}), 0);
|
|
4292
4365
|
}))), { get firstHiddenTime() {
|
|
4293
|
-
return
|
|
4366
|
+
return k;
|
|
4294
4367
|
} };
|
|
4295
4368
|
}, X = function(n) {
|
|
4296
4369
|
document.prerendering ? addEventListener("prerenderingchange", (function() {
|
|
4297
4370
|
return n();
|
|
4298
4371
|
}), !0) : n();
|
|
4299
|
-
},
|
|
4372
|
+
}, Le = [1800, 3e3], ut = function(n, e) {
|
|
4300
4373
|
e = e || {}, X((function() {
|
|
4301
|
-
var t, s = De(), r = E("FCP"), i =
|
|
4374
|
+
var t, s = De(), r = E("FCP"), i = F("paint", (function(o) {
|
|
4302
4375
|
o.forEach((function(c) {
|
|
4303
4376
|
c.name === "first-contentful-paint" && (i.disconnect(), c.startTime < s.firstHiddenTime && (r.value = Math.max(c.startTime - ie(), 0), r.entries.push(c), t(!0)));
|
|
4304
4377
|
}));
|
|
4305
4378
|
}));
|
|
4306
|
-
i && (t = v(n, r,
|
|
4307
|
-
r = E("FCP"), t = v(n, r,
|
|
4379
|
+
i && (t = v(n, r, Le, e.reportAllChanges), O((function(o) {
|
|
4380
|
+
r = E("FCP"), t = v(n, r, Le, e.reportAllChanges), ke((function() {
|
|
4308
4381
|
r.value = performance.now() - o.timeStamp, t(!0);
|
|
4309
4382
|
}));
|
|
4310
4383
|
})));
|
|
4311
4384
|
}));
|
|
4312
|
-
}, Me = [0.1, 0.25],
|
|
4385
|
+
}, Me = [0.1, 0.25], tn = function(n, e) {
|
|
4313
4386
|
e = e || {}, ut(oe((function() {
|
|
4314
4387
|
var t, s = E("CLS", 0), r = 0, i = [], o = function(l) {
|
|
4315
4388
|
l.forEach((function(u) {
|
|
@@ -4318,28 +4391,28 @@ var Le, b, x, ct, ne, lt = -1, N = function(n) {
|
|
|
4318
4391
|
r && u.startTime - p.startTime < 1e3 && u.startTime - h.startTime < 5e3 ? (r += u.value, i.push(u)) : (r = u.value, i = [u]);
|
|
4319
4392
|
}
|
|
4320
4393
|
})), r > s.value && (s.value = r, s.entries = i, t());
|
|
4321
|
-
}, c =
|
|
4394
|
+
}, c = F("layout-shift", o);
|
|
4322
4395
|
c && (t = v(n, s, Me, e.reportAllChanges), B((function() {
|
|
4323
4396
|
o(c.takeRecords()), t(!0);
|
|
4324
|
-
})),
|
|
4397
|
+
})), O((function() {
|
|
4325
4398
|
r = 0, s = E("CLS", 0), t = v(n, s, Me, e.reportAllChanges), ke((function() {
|
|
4326
4399
|
return t();
|
|
4327
4400
|
}));
|
|
4328
4401
|
})), setTimeout(t, 0));
|
|
4329
4402
|
})));
|
|
4330
|
-
}, dt = 0, me = 1 / 0, K = 0,
|
|
4403
|
+
}, dt = 0, me = 1 / 0, K = 0, sn = function(n) {
|
|
4331
4404
|
n.forEach((function(e) {
|
|
4332
4405
|
e.interactionId && (me = Math.min(me, e.interactionId), K = Math.max(K, e.interactionId), dt = K ? (K - me) / 7 + 1 : 0);
|
|
4333
4406
|
}));
|
|
4334
4407
|
}, ht = function() {
|
|
4335
|
-
return
|
|
4336
|
-
},
|
|
4337
|
-
"interactionCount" in performance ||
|
|
4338
|
-
}, I = [], q = /* @__PURE__ */ new Map(), ft = 0,
|
|
4408
|
+
return be ? dt : performance.interactionCount || 0;
|
|
4409
|
+
}, nn = function() {
|
|
4410
|
+
"interactionCount" in performance || be || (be = F("event", sn, { type: "event", buffered: !0, durationThreshold: 0 }));
|
|
4411
|
+
}, I = [], q = /* @__PURE__ */ new Map(), ft = 0, rn = function() {
|
|
4339
4412
|
var n = Math.min(I.length - 1, Math.floor((ht() - ft) / 50));
|
|
4340
4413
|
return I[n];
|
|
4341
|
-
},
|
|
4342
|
-
if (
|
|
4414
|
+
}, on = [], an = function(n) {
|
|
4415
|
+
if (on.forEach((function(r) {
|
|
4343
4416
|
return r(n);
|
|
4344
4417
|
})), n.interactionId || n.entryType === "first-input") {
|
|
4345
4418
|
var e = I[I.length - 1], t = q.get(n.interactionId);
|
|
@@ -4359,30 +4432,30 @@ var Le, b, x, ct, ne, lt = -1, N = function(n) {
|
|
|
4359
4432
|
}, gt = function(n) {
|
|
4360
4433
|
var e = self.requestIdleCallback || self.setTimeout, t = -1;
|
|
4361
4434
|
return n = oe(n), document.visibilityState === "hidden" ? n() : (t = e(n), B(n)), t;
|
|
4362
|
-
}, Ce = [200, 500],
|
|
4435
|
+
}, Ce = [200, 500], cn = function(n, e) {
|
|
4363
4436
|
"PerformanceEventTiming" in self && "interactionId" in PerformanceEventTiming.prototype && (e = e || {}, X((function() {
|
|
4364
4437
|
var t;
|
|
4365
|
-
|
|
4438
|
+
nn();
|
|
4366
4439
|
var s, r = E("INP"), i = function(c) {
|
|
4367
4440
|
gt((function() {
|
|
4368
|
-
c.forEach(
|
|
4369
|
-
var l =
|
|
4441
|
+
c.forEach(an);
|
|
4442
|
+
var l = rn();
|
|
4370
4443
|
l && l.latency !== r.value && (r.value = l.latency, r.entries = l.entries, s());
|
|
4371
4444
|
}));
|
|
4372
|
-
}, o =
|
|
4445
|
+
}, o = F("event", i, { durationThreshold: (t = e.durationThreshold) !== null && t !== void 0 ? t : 40 });
|
|
4373
4446
|
s = v(n, r, Ce, e.reportAllChanges), o && (o.observe({ type: "first-input", buffered: !0 }), B((function() {
|
|
4374
4447
|
i(o.takeRecords()), s(!0);
|
|
4375
|
-
})),
|
|
4448
|
+
})), O((function() {
|
|
4376
4449
|
ft = ht(), I.length = 0, q.clear(), r = E("INP"), s = v(n, r, Ce, e.reportAllChanges);
|
|
4377
4450
|
})));
|
|
4378
4451
|
})));
|
|
4379
|
-
}, Re = [2500, 4e3], pe = {},
|
|
4452
|
+
}, Re = [2500, 4e3], pe = {}, ln = function(n, e) {
|
|
4380
4453
|
e = e || {}, X((function() {
|
|
4381
4454
|
var t, s = De(), r = E("LCP"), i = function(l) {
|
|
4382
4455
|
e.reportAllChanges || (l = l.slice(-1)), l.forEach((function(u) {
|
|
4383
4456
|
u.startTime < s.firstHiddenTime && (r.value = Math.max(u.startTime - ie(), 0), r.entries = [u], t());
|
|
4384
4457
|
}));
|
|
4385
|
-
}, o =
|
|
4458
|
+
}, o = F("largest-contentful-paint", i);
|
|
4386
4459
|
if (o) {
|
|
4387
4460
|
t = v(n, r, Re, e.reportAllChanges);
|
|
4388
4461
|
var c = oe((function() {
|
|
@@ -4392,38 +4465,38 @@ var Le, b, x, ct, ne, lt = -1, N = function(n) {
|
|
|
4392
4465
|
addEventListener(l, (function() {
|
|
4393
4466
|
return gt(c);
|
|
4394
4467
|
}), { once: !0, capture: !0 });
|
|
4395
|
-
})), B(c),
|
|
4468
|
+
})), B(c), O((function(l) {
|
|
4396
4469
|
r = E("LCP"), t = v(n, r, Re, e.reportAllChanges), ke((function() {
|
|
4397
4470
|
r.value = performance.now() - l.timeStamp, pe[r.id] = !0, t(!0);
|
|
4398
4471
|
}));
|
|
4399
4472
|
}));
|
|
4400
4473
|
}
|
|
4401
4474
|
}));
|
|
4402
|
-
}, Ne = [800, 1800],
|
|
4475
|
+
}, Ne = [800, 1800], un = function n(e) {
|
|
4403
4476
|
document.prerendering ? X((function() {
|
|
4404
4477
|
return n(e);
|
|
4405
4478
|
})) : document.readyState !== "complete" ? addEventListener("load", (function() {
|
|
4406
4479
|
return n(e);
|
|
4407
4480
|
}), !0) : setTimeout(e, 0);
|
|
4408
|
-
},
|
|
4481
|
+
}, dn = function(n, e) {
|
|
4409
4482
|
e = e || {};
|
|
4410
4483
|
var t = E("TTFB"), s = v(n, t, Ne, e.reportAllChanges);
|
|
4411
|
-
|
|
4484
|
+
un((function() {
|
|
4412
4485
|
var r = Pe();
|
|
4413
|
-
r && (t.value = Math.max(r.responseStart - ie(), 0), t.entries = [r], s(!0),
|
|
4486
|
+
r && (t.value = Math.max(r.responseStart - ie(), 0), t.entries = [r], s(!0), O((function() {
|
|
4414
4487
|
t = E("TTFB", 0), (s = v(n, t, Ne, e.reportAllChanges))(!0);
|
|
4415
4488
|
})));
|
|
4416
4489
|
}));
|
|
4417
|
-
}, H = { passive: !0, capture: !0 },
|
|
4418
|
-
|
|
4490
|
+
}, H = { passive: !0, capture: !0 }, hn = /* @__PURE__ */ new Date(), st = function(n, e) {
|
|
4491
|
+
L || (L = e, x = n, ct = /* @__PURE__ */ new Date(), pt(removeEventListener), mt());
|
|
4419
4492
|
}, mt = function() {
|
|
4420
|
-
if (x >= 0 && x < ct -
|
|
4421
|
-
var n = { entryType: "first-input", name:
|
|
4493
|
+
if (x >= 0 && x < ct - hn) {
|
|
4494
|
+
var n = { entryType: "first-input", name: L.type, target: L.target, cancelable: L.cancelable, startTime: L.timeStamp, processingStart: L.timeStamp + x };
|
|
4422
4495
|
ne.forEach((function(e) {
|
|
4423
4496
|
e(n);
|
|
4424
4497
|
})), ne = [];
|
|
4425
4498
|
}
|
|
4426
|
-
},
|
|
4499
|
+
}, fn = function(n) {
|
|
4427
4500
|
if (n.cancelable) {
|
|
4428
4501
|
var e = (n.timeStamp > 1e12 ? /* @__PURE__ */ new Date() : performance.now()) - n.timeStamp;
|
|
4429
4502
|
n.type == "pointerdown" ? (function(t, s) {
|
|
@@ -4439,69 +4512,69 @@ var Le, b, x, ct, ne, lt = -1, N = function(n) {
|
|
|
4439
4512
|
}
|
|
4440
4513
|
}, pt = function(n) {
|
|
4441
4514
|
["mousedown", "keydown", "touchstart", "pointerdown"].forEach((function(e) {
|
|
4442
|
-
return n(e,
|
|
4515
|
+
return n(e, fn, H);
|
|
4443
4516
|
}));
|
|
4444
|
-
}, Oe = [100, 300],
|
|
4517
|
+
}, Oe = [100, 300], gn = function(n, e) {
|
|
4445
4518
|
e = e || {}, X((function() {
|
|
4446
4519
|
var t, s = De(), r = E("FID"), i = function(l) {
|
|
4447
4520
|
l.startTime < s.firstHiddenTime && (r.value = l.processingStart - l.startTime, r.entries.push(l), t(!0));
|
|
4448
4521
|
}, o = function(l) {
|
|
4449
4522
|
l.forEach(i);
|
|
4450
|
-
}, c =
|
|
4523
|
+
}, c = F("first-input", o);
|
|
4451
4524
|
t = v(n, r, Oe, e.reportAllChanges), c && (B(oe((function() {
|
|
4452
4525
|
o(c.takeRecords()), c.disconnect();
|
|
4453
|
-
}))),
|
|
4526
|
+
}))), O((function() {
|
|
4454
4527
|
var l;
|
|
4455
|
-
r = E("FID"), t = v(n, r, Oe, e.reportAllChanges), ne = [], x = -1,
|
|
4528
|
+
r = E("FID"), t = v(n, r, Oe, e.reportAllChanges), ne = [], x = -1, L = null, pt(addEventListener), l = i, ne.push(l), mt();
|
|
4456
4529
|
})));
|
|
4457
4530
|
}));
|
|
4458
4531
|
};
|
|
4459
|
-
const
|
|
4532
|
+
const mn = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
4460
4533
|
__proto__: null,
|
|
4461
4534
|
CLSThresholds: Me,
|
|
4462
|
-
FCPThresholds:
|
|
4535
|
+
FCPThresholds: Le,
|
|
4463
4536
|
FIDThresholds: Oe,
|
|
4464
4537
|
INPThresholds: Ce,
|
|
4465
4538
|
LCPThresholds: Re,
|
|
4466
4539
|
TTFBThresholds: Ne,
|
|
4467
|
-
onCLS:
|
|
4540
|
+
onCLS: tn,
|
|
4468
4541
|
onFCP: ut,
|
|
4469
|
-
onFID:
|
|
4470
|
-
onINP:
|
|
4471
|
-
onLCP:
|
|
4472
|
-
onTTFB:
|
|
4542
|
+
onFID: gn,
|
|
4543
|
+
onINP: cn,
|
|
4544
|
+
onLCP: ln,
|
|
4545
|
+
onTTFB: dn
|
|
4473
4546
|
}, Symbol.toStringTag, { value: "Module" }));
|
|
4474
4547
|
export {
|
|
4475
4548
|
m as AppConfigValidationError,
|
|
4476
|
-
|
|
4549
|
+
pn as DEFAULT_SESSION_TIMEOUT,
|
|
4477
4550
|
_e as DEFAULT_WEB_VITALS_MODE,
|
|
4478
4551
|
w as DeviceType,
|
|
4479
|
-
|
|
4552
|
+
U as EmitterEvent,
|
|
4480
4553
|
V as ErrorType,
|
|
4481
4554
|
d as EventType,
|
|
4482
|
-
|
|
4555
|
+
An as InitializationTimeoutError,
|
|
4483
4556
|
Xe as IntegrationValidationError,
|
|
4484
|
-
|
|
4485
|
-
|
|
4486
|
-
|
|
4487
|
-
|
|
4488
|
-
|
|
4489
|
-
|
|
4490
|
-
|
|
4491
|
-
|
|
4557
|
+
wn as MAX_ARRAY_LENGTH,
|
|
4558
|
+
Tn as MAX_CUSTOM_EVENT_ARRAY_SIZE,
|
|
4559
|
+
vn as MAX_CUSTOM_EVENT_KEYS,
|
|
4560
|
+
Sn as MAX_CUSTOM_EVENT_NAME_LENGTH,
|
|
4561
|
+
En as MAX_CUSTOM_EVENT_STRING_SIZE,
|
|
4562
|
+
_n as MAX_NESTED_OBJECT_KEYS,
|
|
4563
|
+
yn as MAX_STRING_LENGTH,
|
|
4564
|
+
In as MAX_STRING_LENGTH_IN_ARRAY,
|
|
4492
4565
|
ee as Mode,
|
|
4493
|
-
|
|
4494
|
-
|
|
4566
|
+
us as PII_PATTERNS,
|
|
4567
|
+
C as PermanentError,
|
|
4495
4568
|
J as RateLimitError,
|
|
4496
4569
|
Be as SamplingRateValidationError,
|
|
4497
4570
|
Ee as ScrollDirection,
|
|
4498
|
-
|
|
4499
|
-
|
|
4571
|
+
bt as SessionTimeoutValidationError,
|
|
4572
|
+
M as SpecialApiUrl,
|
|
4500
4573
|
Z as TimeoutError,
|
|
4501
4574
|
$ as TraceLogValidationError,
|
|
4502
|
-
|
|
4575
|
+
bn as WEB_VITALS_GOOD_THRESHOLDS,
|
|
4503
4576
|
ze as WEB_VITALS_NEEDS_IMPROVEMENT_THRESHOLDS,
|
|
4504
|
-
|
|
4577
|
+
Yt as WEB_VITALS_POOR_THRESHOLDS,
|
|
4505
4578
|
Qe as getWebVitalsThresholds,
|
|
4506
|
-
|
|
4579
|
+
Ln as tracelog
|
|
4507
4580
|
};
|