@tracelog/lib 0.3.0 → 0.4.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/browser/tracelog.js +268 -261
- package/dist/cjs/api.d.ts +7 -7
- package/dist/cjs/api.js +7 -7
- package/dist/cjs/app.types.d.ts +1 -1
- package/dist/cjs/handlers/scroll.handler.d.ts +1 -0
- package/dist/cjs/handlers/scroll.handler.js +25 -7
- package/dist/cjs/managers/event.manager.d.ts +1 -1
- package/dist/cjs/managers/event.manager.js +1 -3
- package/dist/cjs/managers/session.manager.js +7 -6
- package/dist/cjs/types/event.types.d.ts +5 -1
- package/dist/esm/api.d.ts +7 -7
- package/dist/esm/api.js +7 -7
- package/dist/esm/app.types.d.ts +1 -1
- package/dist/esm/handlers/scroll.handler.d.ts +1 -0
- package/dist/esm/handlers/scroll.handler.js +25 -7
- package/dist/esm/managers/event.manager.d.ts +1 -1
- package/dist/esm/managers/event.manager.js +1 -3
- package/dist/esm/managers/session.manager.js +7 -6
- package/dist/esm/types/event.types.d.ts +5 -1
- package/package.json +1 -1
package/dist/browser/tracelog.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
var y = /* @__PURE__ */ ((r) => (r.Mobile = "mobile", r.Tablet = "tablet", r.Desktop = "desktop", r.Unknown = "unknown", r))(y || {});
|
|
2
|
-
const ee = 15 * 60 * 1e3,
|
|
2
|
+
const ee = 15 * 60 * 1e3, Je = 1e3, Ze = 1e4, ke = 250, et = 24, Se = 500, Ee = 3, tt = 5e3, Ue = 1e4, rt = 10, ve = 5, ye = 500, Te = 120, A = 1, nt = 0, st = 1, z = 3e4, G = 864e5, Ie = 120, _e = 8 * 1024, we = 10, Ae = 10, Y = 255, T = 1e3, K = 100, be = 3, _ = 2, it = 2e3, k = "data-tl", at = [
|
|
3
3
|
"button",
|
|
4
4
|
"a",
|
|
5
5
|
'input[type="button"]',
|
|
@@ -31,7 +31,7 @@ const ee = 15 * 60 * 1e3, Ze = 1e3, et = 1e4, Ue = 250, tt = 24, Ee = 500, ve =
|
|
|
31
31
|
".menu-item",
|
|
32
32
|
"[data-testid]",
|
|
33
33
|
'[tabindex="0"]'
|
|
34
|
-
],
|
|
34
|
+
], ot = ["utm_source", "utm_medium", "utm_campaign", "utm_term", "utm_content"], lt = 2, ct = /* @__PURE__ */ new Set([
|
|
35
35
|
"mode",
|
|
36
36
|
"tags",
|
|
37
37
|
"samplingRate",
|
|
@@ -54,35 +54,35 @@ const ee = 15 * 60 * 1e3, Ze = 1e3, et = 1e4, Ue = 250, tt = 24, Ee = 500, ve =
|
|
|
54
54
|
INVALID_GLOBAL_METADATA: "Global metadata must be an object",
|
|
55
55
|
// Array validation
|
|
56
56
|
INVALID_SENSITIVE_QUERY_PARAMS: "Sensitive query params must be an array of strings"
|
|
57
|
-
},
|
|
57
|
+
}, xe = [
|
|
58
58
|
/<script\b[^<]*(?:(?!<\/script>)<[^<]*)*<\/script>/gi,
|
|
59
59
|
/javascript:/gi,
|
|
60
60
|
/on\w+\s*=/gi,
|
|
61
61
|
/<iframe\b[^<]*(?:(?!<\/iframe>)<[^<]*)*<\/iframe>/gi,
|
|
62
62
|
/<embed\b[^>]*>/gi,
|
|
63
63
|
/<object\b[^<]*(?:(?!<\/object>)<[^<]*)*<\/object>/gi
|
|
64
|
-
],
|
|
64
|
+
], He = {
|
|
65
65
|
samplingRate: A,
|
|
66
66
|
excludedUrlPaths: [],
|
|
67
67
|
tags: [],
|
|
68
68
|
ipExcluded: !1
|
|
69
|
-
},
|
|
70
|
-
...
|
|
69
|
+
}, Me = (r) => ({
|
|
70
|
+
...He,
|
|
71
71
|
...r,
|
|
72
72
|
allowHttp: !1,
|
|
73
73
|
sessionTimeout: ee,
|
|
74
|
-
samplingRate: r.samplingRate && r.samplingRate >
|
|
74
|
+
samplingRate: r.samplingRate && r.samplingRate > nt && r.samplingRate <= st ? r.samplingRate : A,
|
|
75
75
|
excludedUrlPaths: r.excludedUrlPaths ?? [],
|
|
76
76
|
tags: r.tags ?? [],
|
|
77
77
|
ipExcluded: r.ipExcluded ?? !1
|
|
78
|
-
}), I = "tl",
|
|
78
|
+
}), I = "tl", ut = (r) => r ? `${I}:${r}:uid` : `${I}:uid`, dt = (r) => r ? `${I}:${r}:queue` : `${I}:queue`, ht = (r) => r ? `${I}:${r}:session` : `${I}:session`, gt = (r) => r ? `${I}:${r}:broadcast` : `${I}:broadcast`, Ve = {
|
|
79
79
|
LCP: 4e3,
|
|
80
80
|
FCP: 1800,
|
|
81
81
|
CLS: 0.25,
|
|
82
82
|
INP: 200,
|
|
83
83
|
TTFB: 600,
|
|
84
84
|
LONG_TASK: 50
|
|
85
|
-
},
|
|
85
|
+
}, ft = 1e3, Fe = [
|
|
86
86
|
// Email addresses
|
|
87
87
|
/\b[A-Za-z0-9._%+-]+@[A-Za-z0-9.-]+\.[A-Z|a-z]{2,}\b/gi,
|
|
88
88
|
// US Phone numbers (various formats)
|
|
@@ -91,7 +91,7 @@ const ee = 15 * 60 * 1e3, Ze = 1e3, et = 1e4, Ue = 250, tt = 24, Ee = 500, ve =
|
|
|
91
91
|
/\b\d{4}[-\s]?\d{4}[-\s]?\d{4}[-\s]?\d{4}\b/g,
|
|
92
92
|
// IBAN (International Bank Account Number)
|
|
93
93
|
/\b[A-Z]{2}\d{2}[-\s]?\d{4}[-\s]?\d{4}[-\s]?\d{4}[-\s]?\d{4}[-\s]?\d{4}\b/gi
|
|
94
|
-
],
|
|
94
|
+
], Re = 500, Le = 6e4, X = 50, v = {};
|
|
95
95
|
class f {
|
|
96
96
|
/**
|
|
97
97
|
* Gets a value from the global state
|
|
@@ -148,7 +148,7 @@ class f {
|
|
|
148
148
|
return e === "config" ? t ? "(configured)" : "(not configured)" : t;
|
|
149
149
|
}
|
|
150
150
|
}
|
|
151
|
-
class
|
|
151
|
+
class mt extends f {
|
|
152
152
|
clientError = (e, t, n) => this.log("CLIENT_ERROR", e, t, n);
|
|
153
153
|
clientWarn = (e, t, n) => this.log("CLIENT_WARN", e, t, n);
|
|
154
154
|
info = (e, t, n) => this.log("INFO", e, t, n);
|
|
@@ -169,11 +169,11 @@ class pt extends f {
|
|
|
169
169
|
return ["CLIENT_ERROR", "ERROR"].includes(e) ? "error" : ["CLIENT_WARN", "WARN"].includes(e) ? "warn" : "log";
|
|
170
170
|
}
|
|
171
171
|
}
|
|
172
|
-
const a = new
|
|
173
|
-
let te,
|
|
174
|
-
const
|
|
175
|
-
typeof window < "u" && !te && (te = window.matchMedia("(pointer: coarse)"),
|
|
176
|
-
},
|
|
172
|
+
const a = new mt();
|
|
173
|
+
let te, ze;
|
|
174
|
+
const pt = () => {
|
|
175
|
+
typeof window < "u" && !te && (te = window.matchMedia("(pointer: coarse)"), ze = window.matchMedia("(hover: none)"));
|
|
176
|
+
}, St = () => {
|
|
177
177
|
try {
|
|
178
178
|
a.debug("DeviceDetector", "Starting device detection");
|
|
179
179
|
const r = navigator;
|
|
@@ -186,8 +186,8 @@ const St = () => {
|
|
|
186
186
|
const u = r.userAgentData.mobile ? y.Mobile : y.Desktop;
|
|
187
187
|
return a.debug("DeviceDetector", "Device detected via User-Agent hints", { result: u }), u;
|
|
188
188
|
}
|
|
189
|
-
a.debug("DeviceDetector", "Using fallback detection methods"),
|
|
190
|
-
const e = window.innerWidth, t = te?.matches ?? !1, n =
|
|
189
|
+
a.debug("DeviceDetector", "Using fallback detection methods"), pt();
|
|
190
|
+
const e = window.innerWidth, t = te?.matches ?? !1, n = ze?.matches ?? !1, s = "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), l = {
|
|
191
191
|
width: e,
|
|
192
192
|
hasCoarsePointer: t,
|
|
193
193
|
hasNoHover: n,
|
|
@@ -202,13 +202,13 @@ const St = () => {
|
|
|
202
202
|
error: r instanceof Error ? r.message : r
|
|
203
203
|
}), y.Desktop;
|
|
204
204
|
}
|
|
205
|
-
},
|
|
205
|
+
}, Ne = () => {
|
|
206
206
|
a.debug("UTMParams", "Extracting UTM parameters from URL", {
|
|
207
207
|
url: window.location.href,
|
|
208
208
|
search: window.location.search
|
|
209
209
|
});
|
|
210
210
|
const r = new URLSearchParams(window.location.search), e = {};
|
|
211
|
-
|
|
211
|
+
ot.forEach((n) => {
|
|
212
212
|
const s = r.get(n);
|
|
213
213
|
if (s) {
|
|
214
214
|
const i = n.split("utm_")[1];
|
|
@@ -220,11 +220,11 @@ const St = () => {
|
|
|
220
220
|
parameterCount: Object.keys(t).length,
|
|
221
221
|
parameters: Object.keys(t)
|
|
222
222
|
}) : a.debug("UTMParams", "No UTM parameters found in URL"), t;
|
|
223
|
-
},
|
|
223
|
+
}, Et = () => typeof crypto < "u" && crypto.randomUUID ? crypto.randomUUID() : "xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(/[xy]/g, (r) => {
|
|
224
224
|
const e = Math.random() * 16 | 0;
|
|
225
225
|
return (r === "x" ? e : e & 3 | 8).toString(16);
|
|
226
226
|
});
|
|
227
|
-
var w = /* @__PURE__ */ ((r) => (r.Skip = "skip", r.Localhost = "localhost:", r))(w || {}), re = /* @__PURE__ */ ((r) => (r.EVENT = "event", r.QUEUE = "queue", r))(re || {}), d = /* @__PURE__ */ ((r) => (r.PAGE_VIEW = "page_view", r.CLICK = "click", r.SCROLL = "scroll", r.SESSION_START = "session_start", r.SESSION_END = "session_end", r.CUSTOM = "custom", r.WEB_VITALS = "web_vitals", r.ERROR = "error", r))(d || {}), x = /* @__PURE__ */ ((r) => (r.UP = "up", r.DOWN = "down", r))(x || {}), N = /* @__PURE__ */ ((r) => (r.JS_ERROR = "js_error", r.PROMISE_REJECTION = "promise_rejection", r.NETWORK_ERROR = "network_error", r))(N || {}), H = /* @__PURE__ */ ((r) => (r.QA = "qa", r.DEBUG = "debug", r))(H || {}),
|
|
227
|
+
var w = /* @__PURE__ */ ((r) => (r.Skip = "skip", r.Localhost = "localhost:", r))(w || {}), re = /* @__PURE__ */ ((r) => (r.EVENT = "event", r.QUEUE = "queue", r))(re || {}), d = /* @__PURE__ */ ((r) => (r.PAGE_VIEW = "page_view", r.CLICK = "click", r.SCROLL = "scroll", r.SESSION_START = "session_start", r.SESSION_END = "session_end", r.CUSTOM = "custom", r.WEB_VITALS = "web_vitals", r.ERROR = "error", r))(d || {}), x = /* @__PURE__ */ ((r) => (r.UP = "up", r.DOWN = "down", r))(x || {}), N = /* @__PURE__ */ ((r) => (r.JS_ERROR = "js_error", r.PROMISE_REJECTION = "promise_rejection", r.NETWORK_ERROR = "network_error", r))(N || {}), H = /* @__PURE__ */ ((r) => (r.QA = "qa", r.DEBUG = "debug", r))(H || {}), vt = /* @__PURE__ */ ((r) => (r.AND = "AND", r.OR = "OR", r))(vt || {}), yt = /* @__PURE__ */ ((r) => (r.URL_MATCHES = "url_matches", r.ELEMENT_MATCHES = "element_matches", r.DEVICE_TYPE = "device_type", r.ELEMENT_TEXT = "element_text", r.ELEMENT_ATTRIBUTE = "element_attribute", r.UTM_SOURCE = "utm_source", r.UTM_MEDIUM = "utm_medium", r.UTM_CAMPAIGN = "utm_campaign", r))(yt || {}), Tt = /* @__PURE__ */ ((r) => (r.EQUALS = "equals", r.CONTAINS = "contains", r.STARTS_WITH = "starts_with", r.ENDS_WITH = "ends_with", r.REGEX = "regex", r.GREATER_THAN = "greater_than", r.LESS_THAN = "less_than", r.EXISTS = "exists", r.NOT_EXISTS = "not_exists", r))(Tt || {});
|
|
228
228
|
class O extends Error {
|
|
229
229
|
constructor(e, t, n) {
|
|
230
230
|
super(e), this.errorCode = t, this.layer = n, this.name = this.constructor.name, Error.captureStackTrace && Error.captureStackTrace(this, this.constructor);
|
|
@@ -235,29 +235,29 @@ class ne extends O {
|
|
|
235
235
|
super(e, "PROJECT_ID_INVALID", t);
|
|
236
236
|
}
|
|
237
237
|
}
|
|
238
|
-
class
|
|
238
|
+
class b extends O {
|
|
239
239
|
constructor(e, t = "config") {
|
|
240
240
|
super(e, "APP_CONFIG_INVALID", t);
|
|
241
241
|
}
|
|
242
242
|
}
|
|
243
|
-
class
|
|
243
|
+
class It extends O {
|
|
244
244
|
constructor(e, t = "config") {
|
|
245
245
|
super(e, "SESSION_TIMEOUT_INVALID", t);
|
|
246
246
|
}
|
|
247
247
|
}
|
|
248
|
-
class
|
|
248
|
+
class _t extends O {
|
|
249
249
|
constructor(e, t = "config") {
|
|
250
250
|
super(e, "SAMPLING_RATE_INVALID", t);
|
|
251
251
|
}
|
|
252
252
|
}
|
|
253
|
-
class
|
|
253
|
+
class Ce extends O {
|
|
254
254
|
constructor(e, t = "config") {
|
|
255
255
|
super(e, "INTEGRATION_INVALID", t);
|
|
256
256
|
}
|
|
257
257
|
}
|
|
258
|
-
const
|
|
258
|
+
const wt = (r) => {
|
|
259
259
|
if (!r || typeof r != "object")
|
|
260
|
-
throw a.clientError("ConfigValidation", "Configuration must be an object", { config: r }), new
|
|
260
|
+
throw a.clientError("ConfigValidation", "Configuration must be an object", { config: r }), new b("Configuration must be an object", "config");
|
|
261
261
|
if (!("id" in r))
|
|
262
262
|
throw a.clientError("ConfigValidation", "Project ID is missing from configuration"), new ne(p.MISSING_PROJECT_ID, "config");
|
|
263
263
|
if (r.id === null || r.id === void 0 || typeof r.id != "string")
|
|
@@ -270,31 +270,31 @@ const At = (r) => {
|
|
|
270
270
|
provided: r.sessionTimeout,
|
|
271
271
|
min: z,
|
|
272
272
|
max: G
|
|
273
|
-
}), new
|
|
273
|
+
}), new It(p.INVALID_SESSION_TIMEOUT, "config");
|
|
274
274
|
if (r.globalMetadata !== void 0 && (typeof r.globalMetadata != "object" || r.globalMetadata === null))
|
|
275
275
|
throw a.clientError("ConfigValidation", "Global metadata must be an object", {
|
|
276
276
|
provided: r.globalMetadata,
|
|
277
277
|
type: typeof r.globalMetadata
|
|
278
|
-
}), new
|
|
279
|
-
if (r.scrollContainerSelectors !== void 0 &&
|
|
278
|
+
}), new b(p.INVALID_GLOBAL_METADATA, "config");
|
|
279
|
+
if (r.scrollContainerSelectors !== void 0 && bt(r.scrollContainerSelectors), r.integrations && Mt(r.integrations), r.sensitiveQueryParams !== void 0) {
|
|
280
280
|
if (!Array.isArray(r.sensitiveQueryParams))
|
|
281
281
|
throw a.clientError("ConfigValidation", "Sensitive query params must be an array", {
|
|
282
282
|
provided: r.sensitiveQueryParams,
|
|
283
283
|
type: typeof r.sensitiveQueryParams
|
|
284
|
-
}), new
|
|
284
|
+
}), new b(p.INVALID_SENSITIVE_QUERY_PARAMS, "config");
|
|
285
285
|
for (const e of r.sensitiveQueryParams)
|
|
286
286
|
if (typeof e != "string")
|
|
287
287
|
throw a.clientError("ConfigValidation", "All sensitive query params must be strings", {
|
|
288
288
|
param: e,
|
|
289
289
|
type: typeof e
|
|
290
|
-
}), new
|
|
290
|
+
}), new b("All sensitive query params must be strings", "config");
|
|
291
291
|
}
|
|
292
292
|
if (r.errorSampling !== void 0 && (typeof r.errorSampling != "number" || r.errorSampling < 0 || r.errorSampling > 1))
|
|
293
293
|
throw a.clientError("ConfigValidation", "Invalid error sampling rate", {
|
|
294
294
|
provided: r.errorSampling,
|
|
295
295
|
expected: "0-1"
|
|
296
|
-
}), new
|
|
297
|
-
},
|
|
296
|
+
}), new _t(p.INVALID_ERROR_SAMPLING_RATE, "config");
|
|
297
|
+
}, At = (r) => {
|
|
298
298
|
if (r.includes("<") || r.includes(">") || /on\w+\s*=/i.test(r) || !/^[a-zA-Z0-9\-_#.[\]="':, >+~*()]+$/.test(r))
|
|
299
299
|
return !1;
|
|
300
300
|
let t = 0;
|
|
@@ -305,7 +305,7 @@ const At = (r) => {
|
|
|
305
305
|
for (const s of r)
|
|
306
306
|
if (s === "[" && n++, s === "]" && n--, n < 0) return !1;
|
|
307
307
|
return n === 0;
|
|
308
|
-
},
|
|
308
|
+
}, bt = (r) => {
|
|
309
309
|
const e = Array.isArray(r) ? r : [r];
|
|
310
310
|
for (const t of e) {
|
|
311
311
|
if (typeof t != "string" || t.trim() === "")
|
|
@@ -313,28 +313,28 @@ const At = (r) => {
|
|
|
313
313
|
selector: t,
|
|
314
314
|
type: typeof t,
|
|
315
315
|
isEmpty: t === "" || typeof t == "string" && t.trim() === ""
|
|
316
|
-
}), new
|
|
317
|
-
if (!
|
|
316
|
+
}), new b(p.INVALID_SCROLL_CONTAINER_SELECTORS, "config");
|
|
317
|
+
if (!At(t))
|
|
318
318
|
throw a.clientError("ConfigValidation", "Invalid or potentially unsafe CSS selector", {
|
|
319
319
|
selector: t,
|
|
320
320
|
reason: "Failed security validation"
|
|
321
|
-
}), new
|
|
321
|
+
}), new b("Invalid or potentially unsafe CSS selector", "config");
|
|
322
322
|
}
|
|
323
|
-
},
|
|
323
|
+
}, Mt = (r) => {
|
|
324
324
|
if (r && r.googleAnalytics) {
|
|
325
325
|
if (!r.googleAnalytics.measurementId || typeof r.googleAnalytics.measurementId != "string" || r.googleAnalytics.measurementId.trim() === "")
|
|
326
326
|
throw a.clientError("ConfigValidation", "Invalid Google Analytics measurement ID", {
|
|
327
327
|
provided: r.googleAnalytics.measurementId,
|
|
328
328
|
type: typeof r.googleAnalytics.measurementId
|
|
329
|
-
}), new
|
|
329
|
+
}), new Ce(p.INVALID_GOOGLE_ANALYTICS_ID, "config");
|
|
330
330
|
const e = r.googleAnalytics.measurementId.trim();
|
|
331
331
|
if (!e.match(/^(G-|UA-)/))
|
|
332
332
|
throw a.clientError("ConfigValidation", 'Google Analytics measurement ID must start with "G-" or "UA-"', {
|
|
333
333
|
provided: e
|
|
334
|
-
}), new
|
|
334
|
+
}), new Ce('Google Analytics measurement ID must start with "G-" or "UA-"', "config");
|
|
335
335
|
}
|
|
336
|
-
},
|
|
337
|
-
|
|
336
|
+
}, Rt = (r) => {
|
|
337
|
+
wt(r);
|
|
338
338
|
const e = {
|
|
339
339
|
...r,
|
|
340
340
|
id: r.id.trim(),
|
|
@@ -347,10 +347,10 @@ const At = (r) => {
|
|
|
347
347
|
normalizedId: e.id
|
|
348
348
|
}), new ne(p.PROJECT_ID_EMPTY_AFTER_TRIM, "config");
|
|
349
349
|
return e;
|
|
350
|
-
},
|
|
350
|
+
}, Lt = (r, e) => {
|
|
351
351
|
if (r !== void 0)
|
|
352
352
|
return typeof r != "number" ? (e.push("samplingRate must be a number"), A) : Number.isNaN(r) || r <= 0 || r > 1 ? (e.push(p.INVALID_SAMPLING_RATE), A) : r;
|
|
353
|
-
},
|
|
353
|
+
}, Nt = (r, e, t = "") => {
|
|
354
354
|
if (r !== void 0)
|
|
355
355
|
if (Array.isArray(r))
|
|
356
356
|
for (const [n, s] of r.entries())
|
|
@@ -364,13 +364,13 @@ const At = (r) => {
|
|
|
364
364
|
e.push(`${t}excludedUrlPaths[${n}] must be a string`);
|
|
365
365
|
else
|
|
366
366
|
e.push(`${t}excludedUrlPaths must be an array`);
|
|
367
|
-
},
|
|
367
|
+
}, Ct = (r) => {
|
|
368
368
|
const e = [], t = [];
|
|
369
369
|
r.sessionTimeout !== void 0 && (typeof r.sessionTimeout != "number" ? e.push("sessionTimeout must be a number") : r.sessionTimeout < z ? e.push("sessionTimeout must be at least 30 seconds (30000ms)") : r.sessionTimeout > G && t.push("sessionTimeout is very long (>24 hours), consider reducing it")), r.globalMetadata !== void 0 && (typeof r.globalMetadata != "object" || r.globalMetadata === null ? e.push("globalMetadata must be an object") : (JSON.stringify(r.globalMetadata).length > 10240 && e.push("globalMetadata is too large (max 10KB)"), Object.keys(r.globalMetadata).length > 12 && e.push("globalMetadata has too many keys (max 12)")));
|
|
370
|
-
const n =
|
|
371
|
-
return r.tags !== void 0 && !Array.isArray(r.tags) && e.push("tags must be an array"),
|
|
370
|
+
const n = Lt(r.samplingRate, e) ?? A;
|
|
371
|
+
return r.tags !== void 0 && !Array.isArray(r.tags) && e.push("tags must be an array"), Nt(r.excludedUrlPaths, e), { errors: e, warnings: t, samplingRate: n };
|
|
372
372
|
}, V = (r) => {
|
|
373
|
-
const { errors: e, warnings: t, samplingRate: n } =
|
|
373
|
+
const { errors: e, warnings: t, samplingRate: n } = Ct(r);
|
|
374
374
|
return {
|
|
375
375
|
config: {
|
|
376
376
|
...r,
|
|
@@ -379,7 +379,7 @@ const At = (r) => {
|
|
|
379
379
|
errors: e,
|
|
380
380
|
warnings: t
|
|
381
381
|
};
|
|
382
|
-
},
|
|
382
|
+
}, Pe = (r) => {
|
|
383
383
|
if (!r || typeof r != "string" || r.trim().length === 0)
|
|
384
384
|
return a.debug("Sanitize", "String sanitization skipped - empty or invalid input", { value: r, type: typeof r }), "";
|
|
385
385
|
const e = r.length;
|
|
@@ -390,7 +390,7 @@ const At = (r) => {
|
|
|
390
390
|
truncatedLength: t.length
|
|
391
391
|
}));
|
|
392
392
|
let n = 0;
|
|
393
|
-
for (const i of
|
|
393
|
+
for (const i of xe) {
|
|
394
394
|
const o = t;
|
|
395
395
|
t = t.replace(i, ""), o !== t && n++;
|
|
396
396
|
}
|
|
@@ -406,24 +406,24 @@ const At = (r) => {
|
|
|
406
406
|
xssPatternMatches: n,
|
|
407
407
|
wasTruncated: e > T
|
|
408
408
|
}), s;
|
|
409
|
-
},
|
|
409
|
+
}, Pt = (r) => {
|
|
410
410
|
if (typeof r != "string")
|
|
411
411
|
return "";
|
|
412
412
|
r.length > T && (r = r.slice(0, Math.max(0, T)));
|
|
413
413
|
let e = r;
|
|
414
|
-
for (const t of
|
|
414
|
+
for (const t of xe)
|
|
415
415
|
e = e.replace(t, "");
|
|
416
416
|
return e = e.replaceAll("&", "&").replaceAll("<", "<").replaceAll(">", ">").replaceAll('"', """).replaceAll("'", "'"), e.trim();
|
|
417
417
|
}, P = (r, e = 0) => {
|
|
418
|
-
if (e >
|
|
418
|
+
if (e > be)
|
|
419
419
|
return a.warn("Sanitize", "Maximum object depth exceeded during sanitization", {
|
|
420
420
|
depth: e,
|
|
421
|
-
maxDepth:
|
|
421
|
+
maxDepth: be
|
|
422
422
|
}), null;
|
|
423
423
|
if (r == null)
|
|
424
424
|
return null;
|
|
425
425
|
if (typeof r == "string")
|
|
426
|
-
return
|
|
426
|
+
return Pe(r);
|
|
427
427
|
if (typeof r == "number")
|
|
428
428
|
return !Number.isFinite(r) || r < -Number.MAX_SAFE_INTEGER || r > Number.MAX_SAFE_INTEGER ? (a.warn("Sanitize", "Invalid number sanitized to 0", { value: r, isFinite: Number.isFinite(r) }), 0) : r;
|
|
429
429
|
if (typeof r == "boolean")
|
|
@@ -447,7 +447,7 @@ const At = (r) => {
|
|
|
447
447
|
});
|
|
448
448
|
let o = 0;
|
|
449
449
|
for (const [c, l] of i) {
|
|
450
|
-
const u =
|
|
450
|
+
const u = Pe(c);
|
|
451
451
|
if (u) {
|
|
452
452
|
const h = P(l, e + 1);
|
|
453
453
|
h !== null ? t[u] = h : o++;
|
|
@@ -461,7 +461,7 @@ const At = (r) => {
|
|
|
461
461
|
}), t;
|
|
462
462
|
}
|
|
463
463
|
return a.debug("Sanitize", "Unknown value type sanitized to null", { type: typeof r, depth: e }), null;
|
|
464
|
-
},
|
|
464
|
+
}, Ot = (r) => {
|
|
465
465
|
a.debug("Sanitize", "Starting API config sanitization");
|
|
466
466
|
const e = {};
|
|
467
467
|
if (typeof r != "object" || r === null)
|
|
@@ -470,11 +470,11 @@ const At = (r) => {
|
|
|
470
470
|
const t = Object.keys(r);
|
|
471
471
|
let n = 0, s = 0;
|
|
472
472
|
for (const i of t)
|
|
473
|
-
if (
|
|
473
|
+
if (ct.has(i)) {
|
|
474
474
|
const o = r[i];
|
|
475
475
|
if (i === "excludedUrlPaths") {
|
|
476
476
|
const c = Array.isArray(o) ? o : typeof o == "string" ? [o] : [], l = c.length;
|
|
477
|
-
e.excludedUrlPaths = c.map((h) =>
|
|
477
|
+
e.excludedUrlPaths = c.map((h) => Pt(String(h))).filter(Boolean);
|
|
478
478
|
const u = l - e.excludedUrlPaths.length;
|
|
479
479
|
u > 0 && a.warn("Sanitize", "Some excluded URL paths were filtered during sanitization", {
|
|
480
480
|
originalCount: l,
|
|
@@ -504,7 +504,7 @@ const At = (r) => {
|
|
|
504
504
|
}), new Error(`API config sanitization failed: ${t instanceof Error ? t.message : "Unknown error"}`);
|
|
505
505
|
}
|
|
506
506
|
return e;
|
|
507
|
-
},
|
|
507
|
+
}, Dt = (r) => {
|
|
508
508
|
if (a.debug("Sanitize", "Starting metadata sanitization", { hasMetadata: r != null }), typeof r != "object" || r === null)
|
|
509
509
|
return a.debug("Sanitize", "Metadata is not an object, returning empty object", {
|
|
510
510
|
metadata: r,
|
|
@@ -522,7 +522,7 @@ const At = (r) => {
|
|
|
522
522
|
error: e instanceof Error ? e.message : e
|
|
523
523
|
}), new Error(`Metadata sanitization failed: ${e instanceof Error ? e.message : "Unknown error"}`);
|
|
524
524
|
}
|
|
525
|
-
},
|
|
525
|
+
}, kt = (r) => {
|
|
526
526
|
if (typeof r != "object" || r === null)
|
|
527
527
|
return !1;
|
|
528
528
|
for (const e of Object.values(r)) {
|
|
@@ -539,24 +539,24 @@ const At = (r) => {
|
|
|
539
539
|
}
|
|
540
540
|
}
|
|
541
541
|
return !0;
|
|
542
|
-
},
|
|
542
|
+
}, Ut = (r) => typeof r != "string" ? {
|
|
543
543
|
valid: !1,
|
|
544
544
|
error: "Event name must be a string"
|
|
545
545
|
} : r.length === 0 ? {
|
|
546
546
|
valid: !1,
|
|
547
547
|
error: "Event name cannot be empty"
|
|
548
|
-
} : r.length >
|
|
548
|
+
} : r.length > Ie ? {
|
|
549
549
|
valid: !1,
|
|
550
|
-
error: `Event name is too long (max ${
|
|
550
|
+
error: `Event name is too long (max ${Ie} characters)`
|
|
551
551
|
} : r.includes("<") || r.includes(">") || r.includes("&") ? {
|
|
552
552
|
valid: !1,
|
|
553
553
|
error: "Event name contains invalid characters"
|
|
554
554
|
} : ["constructor", "prototype", "__proto__", "eval", "function", "var", "let", "const"].includes(r.toLowerCase()) ? {
|
|
555
555
|
valid: !1,
|
|
556
556
|
error: "Event name cannot be a reserved word"
|
|
557
|
-
} : { valid: !0 },
|
|
558
|
-
const n =
|
|
559
|
-
if (!
|
|
557
|
+
} : { valid: !0 }, xt = (r, e, t) => {
|
|
558
|
+
const n = Dt(e), s = `${t} "${r}" metadata error`;
|
|
559
|
+
if (!kt(n))
|
|
560
560
|
return {
|
|
561
561
|
valid: !1,
|
|
562
562
|
error: `${s}: object has invalid types. Valid types are string, number, boolean or string arrays.`
|
|
@@ -570,22 +570,22 @@ const At = (r) => {
|
|
|
570
570
|
error: `${s}: object contains circular references or cannot be serialized.`
|
|
571
571
|
};
|
|
572
572
|
}
|
|
573
|
-
if (i.length >
|
|
573
|
+
if (i.length > _e)
|
|
574
574
|
return {
|
|
575
575
|
valid: !1,
|
|
576
|
-
error: `${s}: object is too large (max ${
|
|
576
|
+
error: `${s}: object is too large (max ${_e / 1024} KB).`
|
|
577
577
|
};
|
|
578
|
-
if (Object.keys(n).length >
|
|
578
|
+
if (Object.keys(n).length > we)
|
|
579
579
|
return {
|
|
580
580
|
valid: !1,
|
|
581
|
-
error: `${s}: object has too many keys (max ${
|
|
581
|
+
error: `${s}: object has too many keys (max ${we} keys).`
|
|
582
582
|
};
|
|
583
583
|
for (const [c, l] of Object.entries(n)) {
|
|
584
584
|
if (Array.isArray(l)) {
|
|
585
|
-
if (l.length >
|
|
585
|
+
if (l.length > Ae)
|
|
586
586
|
return {
|
|
587
587
|
valid: !1,
|
|
588
|
-
error: `${s}: array property "${c}" is too large (max ${
|
|
588
|
+
error: `${s}: array property "${c}" is too large (max ${Ae} items).`
|
|
589
589
|
};
|
|
590
590
|
for (const u of l)
|
|
591
591
|
if (typeof u == "string" && u.length > 500)
|
|
@@ -604,13 +604,13 @@ const At = (r) => {
|
|
|
604
604
|
valid: !0,
|
|
605
605
|
sanitizedMetadata: n
|
|
606
606
|
};
|
|
607
|
-
},
|
|
608
|
-
const t =
|
|
607
|
+
}, Ht = (r, e) => {
|
|
608
|
+
const t = Ut(r);
|
|
609
609
|
if (!t.valid)
|
|
610
610
|
return a.clientError("EventValidation", "Event name validation failed", { eventName: r, error: t.error }), t;
|
|
611
611
|
if (!e)
|
|
612
612
|
return { valid: !0 };
|
|
613
|
-
const n =
|
|
613
|
+
const n = xt(r, e, "customEvent");
|
|
614
614
|
return n.valid || a.clientError("EventValidation", "Event metadata validation failed", {
|
|
615
615
|
eventName: r,
|
|
616
616
|
error: n.error
|
|
@@ -622,7 +622,7 @@ const At = (r) => {
|
|
|
622
622
|
} catch {
|
|
623
623
|
return !1;
|
|
624
624
|
}
|
|
625
|
-
},
|
|
625
|
+
}, Vt = (r, e = !1) => {
|
|
626
626
|
const t = new URL(window.location.href), n = t.hostname, s = n.split(".");
|
|
627
627
|
if (s.length === 0)
|
|
628
628
|
throw a.clientError("URLUtils", "Invalid hostname - no domain parts found", { hostname: n }), new Error("Invalid URL");
|
|
@@ -651,7 +651,7 @@ const At = (r) => {
|
|
|
651
651
|
error: t instanceof Error ? t.message : t
|
|
652
652
|
}), r;
|
|
653
653
|
}
|
|
654
|
-
},
|
|
654
|
+
}, Ft = (r, e = []) => {
|
|
655
655
|
if (e.length === 0)
|
|
656
656
|
return !1;
|
|
657
657
|
let t;
|
|
@@ -679,7 +679,7 @@ const At = (r) => {
|
|
|
679
679
|
}
|
|
680
680
|
});
|
|
681
681
|
};
|
|
682
|
-
async function
|
|
682
|
+
async function zt(r, e = {}) {
|
|
683
683
|
const { timeout: t = 1e4, ...n } = e, s = new AbortController(), i = setTimeout(() => {
|
|
684
684
|
s.abort();
|
|
685
685
|
}, t);
|
|
@@ -693,7 +693,7 @@ async function Gt(r, e = {}) {
|
|
|
693
693
|
throw clearTimeout(i), o instanceof Error && o.name === "AbortError" ? new Error(`Request timeout after ${t}ms`) : o;
|
|
694
694
|
}
|
|
695
695
|
}
|
|
696
|
-
class
|
|
696
|
+
class Gt {
|
|
697
697
|
listeners = /* @__PURE__ */ new Map();
|
|
698
698
|
on(e, t) {
|
|
699
699
|
this.listeners.has(e) || this.listeners.set(e, []), this.listeners.get(e).push(t);
|
|
@@ -713,7 +713,7 @@ class jt {
|
|
|
713
713
|
this.listeners.clear();
|
|
714
714
|
}
|
|
715
715
|
}
|
|
716
|
-
function
|
|
716
|
+
function jt(r, e = !1) {
|
|
717
717
|
try {
|
|
718
718
|
if (r.startsWith(w.Localhost)) {
|
|
719
719
|
const n = `http://${r}`;
|
|
@@ -721,7 +721,7 @@ function $t(r, e = !1) {
|
|
|
721
721
|
throw new Error(`Invalid localhost URL format: ${r}`);
|
|
722
722
|
return n;
|
|
723
723
|
}
|
|
724
|
-
const t =
|
|
724
|
+
const t = Vt(r, e);
|
|
725
725
|
if (!se(t, e))
|
|
726
726
|
throw new Error(`Generated API URL failed validation: ${t}`);
|
|
727
727
|
return t;
|
|
@@ -759,10 +759,10 @@ class he {
|
|
|
759
759
|
*/
|
|
760
760
|
async loadFromApi(e, t) {
|
|
761
761
|
try {
|
|
762
|
-
const n = this.buildConfigUrl(e, t), s = this.buildHeaders(t), i = await
|
|
762
|
+
const n = this.buildConfigUrl(e, t), s = this.buildHeaders(t), i = await zt(n, {
|
|
763
763
|
method: "GET",
|
|
764
764
|
headers: s,
|
|
765
|
-
timeout:
|
|
765
|
+
timeout: Ue
|
|
766
766
|
});
|
|
767
767
|
if (!i.ok)
|
|
768
768
|
throw new Error(`HTTP ${i.status}: ${i.statusText}`);
|
|
@@ -826,7 +826,7 @@ class he {
|
|
|
826
826
|
* Merges API configuration with app configuration and applies mode-specific settings.
|
|
827
827
|
*/
|
|
828
828
|
mergeConfigurations(e, t) {
|
|
829
|
-
const n =
|
|
829
|
+
const n = Ot(e), s = { ...He, ...n }, i = Me({ ...t, ...s }), { config: o } = V(i);
|
|
830
830
|
this.isQaModeEnabled() && !o.mode && (o.mode = H.QA, a.info("ConfigManager", "QA mode enabled via URL parameter"));
|
|
831
831
|
const c = Object.values(H).includes(o.mode) ? 1 : o.errorSampling ?? 0.1;
|
|
832
832
|
return { ...o, errorSampling: c };
|
|
@@ -835,7 +835,7 @@ class he {
|
|
|
835
835
|
* Creates default configuration for skip mode and fallback scenarios.
|
|
836
836
|
*/
|
|
837
837
|
createDefaultConfig(e) {
|
|
838
|
-
const t =
|
|
838
|
+
const t = Me({
|
|
839
839
|
...e,
|
|
840
840
|
errorSampling: 1,
|
|
841
841
|
...e.id === w.Skip && { mode: H.DEBUG }
|
|
@@ -843,7 +843,7 @@ class he {
|
|
|
843
843
|
return n;
|
|
844
844
|
}
|
|
845
845
|
}
|
|
846
|
-
class
|
|
846
|
+
class $t extends f {
|
|
847
847
|
storeManager;
|
|
848
848
|
retryTimeoutId = null;
|
|
849
849
|
retryCount = 0;
|
|
@@ -853,7 +853,7 @@ class Qt extends f {
|
|
|
853
853
|
}
|
|
854
854
|
getQueueStorageKey() {
|
|
855
855
|
const e = this.get("config")?.id || "default", t = this.get("userId") || "anonymous";
|
|
856
|
-
return `${
|
|
856
|
+
return `${dt(e)}:${t}`;
|
|
857
857
|
}
|
|
858
858
|
/**
|
|
859
859
|
* Send events synchronously using sendBeacon or XHR fallback
|
|
@@ -927,7 +927,7 @@ class Qt extends f {
|
|
|
927
927
|
}
|
|
928
928
|
}
|
|
929
929
|
async sendWithTimeout(e, t) {
|
|
930
|
-
const n = new AbortController(), s = setTimeout(() => n.abort(),
|
|
930
|
+
const n = new AbortController(), s = setTimeout(() => n.abort(), Ue);
|
|
931
931
|
try {
|
|
932
932
|
const i = await fetch(e, {
|
|
933
933
|
method: "POST",
|
|
@@ -953,7 +953,7 @@ class Qt extends f {
|
|
|
953
953
|
sendSyncXHR(e, t) {
|
|
954
954
|
const n = new XMLHttpRequest();
|
|
955
955
|
try {
|
|
956
|
-
n.open("POST", e, !1), n.setRequestHeader("Content-Type", "application/json"), n.withCredentials = !0, n.timeout =
|
|
956
|
+
n.open("POST", e, !1), n.setRequestHeader("Content-Type", "application/json"), n.withCredentials = !0, n.timeout = it, n.send(t);
|
|
957
957
|
const s = n.status >= 200 && n.status < 300;
|
|
958
958
|
return s || a.warn("SenderManager", "Sync XHR failed", {
|
|
959
959
|
status: n.status,
|
|
@@ -984,7 +984,7 @@ class Qt extends f {
|
|
|
984
984
|
return null;
|
|
985
985
|
}
|
|
986
986
|
isDataRecent(e) {
|
|
987
|
-
return !e.timestamp || typeof e.timestamp != "number" ? !1 : (Date.now() - e.timestamp) / (1e3 * 60 * 60) <
|
|
987
|
+
return !e.timestamp || typeof e.timestamp != "number" ? !1 : (Date.now() - e.timestamp) / (1e3 * 60 * 60) < et;
|
|
988
988
|
}
|
|
989
989
|
createRecoveryBody(e) {
|
|
990
990
|
return {
|
|
@@ -1023,16 +1023,16 @@ class Qt extends f {
|
|
|
1023
1023
|
scheduleRetry(e, t) {
|
|
1024
1024
|
if (this.retryTimeoutId !== null || this.isRetrying)
|
|
1025
1025
|
return;
|
|
1026
|
-
if (this.retryCount >=
|
|
1026
|
+
if (this.retryCount >= Ee) {
|
|
1027
1027
|
a.warn("SenderManager", "Max retries reached, giving up", { retryCount: this.retryCount }), this.clearPersistedEvents(), this.resetRetryState(), t?.onFailure?.();
|
|
1028
1028
|
return;
|
|
1029
1029
|
}
|
|
1030
|
-
const n =
|
|
1030
|
+
const n = tt * Math.pow(2, this.retryCount);
|
|
1031
1031
|
this.retryTimeoutId = window.setTimeout(async () => {
|
|
1032
1032
|
if (this.retryTimeoutId = null, !this.isRetrying) {
|
|
1033
1033
|
this.retryCount++, this.isRetrying = !0;
|
|
1034
1034
|
try {
|
|
1035
|
-
await this.send(e) ? (this.clearPersistedEvents(), this.resetRetryState(), t?.onSuccess?.(e.events.length)) : this.retryCount >=
|
|
1035
|
+
await this.send(e) ? (this.clearPersistedEvents(), this.resetRetryState(), t?.onSuccess?.(e.events.length)) : this.retryCount >= Ee ? (this.clearPersistedEvents(), this.resetRetryState(), t?.onFailure?.()) : this.scheduleRetry(e, t);
|
|
1036
1036
|
} finally {
|
|
1037
1037
|
this.isRetrying = !1;
|
|
1038
1038
|
}
|
|
@@ -1062,7 +1062,7 @@ class Qt extends f {
|
|
|
1062
1062
|
this.retryTimeoutId !== null && (clearTimeout(this.retryTimeoutId), this.retryTimeoutId = null);
|
|
1063
1063
|
}
|
|
1064
1064
|
}
|
|
1065
|
-
class
|
|
1065
|
+
class Qt extends f {
|
|
1066
1066
|
googleAnalytics;
|
|
1067
1067
|
dataSender;
|
|
1068
1068
|
emitter;
|
|
@@ -1071,7 +1071,7 @@ class Wt extends f {
|
|
|
1071
1071
|
lastEventTime = 0;
|
|
1072
1072
|
sendIntervalId = null;
|
|
1073
1073
|
constructor(e, t = null, n = null) {
|
|
1074
|
-
super(), this.googleAnalytics = t, this.dataSender = new
|
|
1074
|
+
super(), this.googleAnalytics = t, this.dataSender = new $t(e), this.emitter = n;
|
|
1075
1075
|
}
|
|
1076
1076
|
/**
|
|
1077
1077
|
* Recovers persisted events from localStorage
|
|
@@ -1102,35 +1102,33 @@ class Wt extends f {
|
|
|
1102
1102
|
custom_event: o,
|
|
1103
1103
|
web_vitals: c,
|
|
1104
1104
|
error_data: l,
|
|
1105
|
-
session_end_reason: u
|
|
1106
|
-
session_start_recovered: h
|
|
1105
|
+
session_end_reason: u
|
|
1107
1106
|
}) {
|
|
1108
1107
|
if (!e) {
|
|
1109
1108
|
a.warn("EventManager", "Event type is required");
|
|
1110
1109
|
return;
|
|
1111
1110
|
}
|
|
1112
|
-
const
|
|
1113
|
-
type:
|
|
1114
|
-
page_url:
|
|
1111
|
+
const h = e, L = h === d.SESSION_START, Ke = h === d.SESSION_END, Xe = L || Ke, qe = t || this.get("pageUrl"), B = this.buildEventPayload({
|
|
1112
|
+
type: h,
|
|
1113
|
+
page_url: qe,
|
|
1115
1114
|
from_page_url: n,
|
|
1116
1115
|
scroll_data: s,
|
|
1117
1116
|
click_data: i,
|
|
1118
1117
|
custom_event: o,
|
|
1119
1118
|
web_vitals: c,
|
|
1120
1119
|
error_data: l,
|
|
1121
|
-
session_end_reason: u
|
|
1122
|
-
session_start_recovered: h
|
|
1120
|
+
session_end_reason: u
|
|
1123
1121
|
});
|
|
1124
|
-
if (!this.isEventExcluded(B) && !(!
|
|
1125
|
-
if (
|
|
1126
|
-
const
|
|
1127
|
-
if (!
|
|
1122
|
+
if (!this.isEventExcluded(B) && !(!Xe && !this.shouldSample())) {
|
|
1123
|
+
if (L) {
|
|
1124
|
+
const pe = this.get("sessionId");
|
|
1125
|
+
if (!pe) {
|
|
1128
1126
|
a.warn("EventManager", "Session start event ignored: missing sessionId");
|
|
1129
1127
|
return;
|
|
1130
1128
|
}
|
|
1131
1129
|
if (this.get("hasStartSession")) {
|
|
1132
1130
|
a.warn("EventManager", "Duplicate session_start detected", {
|
|
1133
|
-
sessionId:
|
|
1131
|
+
sessionId: pe
|
|
1134
1132
|
});
|
|
1135
1133
|
return;
|
|
1136
1134
|
}
|
|
@@ -1238,18 +1236,17 @@ class Wt extends f {
|
|
|
1238
1236
|
...e.web_vitals && { web_vitals: e.web_vitals },
|
|
1239
1237
|
...e.error_data && { error_data: e.error_data },
|
|
1240
1238
|
...e.session_end_reason && { session_end_reason: e.session_end_reason },
|
|
1241
|
-
...
|
|
1242
|
-
...t && Ce() && { utm: Ce() }
|
|
1239
|
+
...t && Ne() && { utm: Ne() }
|
|
1243
1240
|
}, i = this.get("config")?.tags;
|
|
1244
1241
|
return i?.length && (s.tags = i), s;
|
|
1245
1242
|
}
|
|
1246
1243
|
isEventExcluded(e) {
|
|
1247
|
-
const t = this.get("config"), n =
|
|
1244
|
+
const t = this.get("config"), n = Ft(e.page_url, t?.excludedUrlPaths ?? []), s = this.get("hasStartSession"), i = e.type === d.SESSION_END, o = e.type === d.SESSION_START;
|
|
1248
1245
|
return n && !o && !(i && s) ? !0 : t?.ipExcluded === !0;
|
|
1249
1246
|
}
|
|
1250
1247
|
isDuplicateEvent(e) {
|
|
1251
1248
|
const t = Date.now(), n = this.createEventFingerprint(e);
|
|
1252
|
-
return this.lastEventFingerprint === n && t - this.lastEventTime <
|
|
1249
|
+
return this.lastEventFingerprint === n && t - this.lastEventTime < Je ? !0 : (this.lastEventFingerprint = n, this.lastEventTime = t, !1);
|
|
1253
1250
|
}
|
|
1254
1251
|
createEventFingerprint(e) {
|
|
1255
1252
|
let t = `${e.type}_${e.page_url}`;
|
|
@@ -1263,10 +1260,10 @@ class Wt extends f {
|
|
|
1263
1260
|
return this.createEventFingerprint(e);
|
|
1264
1261
|
}
|
|
1265
1262
|
addToQueue(e) {
|
|
1266
|
-
if (this.eventsQueue.push(e), a.info("EventManager", "Event added to queue", e), this.emitEvent(e), this.eventsQueue.length >
|
|
1263
|
+
if (this.eventsQueue.push(e), a.info("EventManager", "Event added to queue", e), this.emitEvent(e), this.eventsQueue.length > Se) {
|
|
1267
1264
|
const t = this.eventsQueue.shift();
|
|
1268
1265
|
a.warn("EventManager", "Event queue overflow, oldest event removed", {
|
|
1269
|
-
maxLength:
|
|
1266
|
+
maxLength: Se,
|
|
1270
1267
|
currentLength: this.eventsQueue.length,
|
|
1271
1268
|
removedEventType: t?.type
|
|
1272
1269
|
});
|
|
@@ -1276,7 +1273,7 @@ class Wt extends f {
|
|
|
1276
1273
|
startSendInterval() {
|
|
1277
1274
|
this.sendIntervalId = window.setInterval(() => {
|
|
1278
1275
|
this.eventsQueue.length > 0 && this.sendEventsQueue();
|
|
1279
|
-
},
|
|
1276
|
+
}, Ze);
|
|
1280
1277
|
}
|
|
1281
1278
|
handleGoogleAnalyticsIntegration(e) {
|
|
1282
1279
|
this.googleAnalytics && e.type === d.CUSTOM && e.custom_event && (this.get("config")?.mode === "qa" || this.get("config")?.mode === "debug" || this.googleAnalytics.trackEvent(e.custom_event.name, e.custom_event.metadata ?? {}));
|
|
@@ -1305,7 +1302,7 @@ class Wt extends f {
|
|
|
1305
1302
|
this.emitter && this.emitter.emit(re.QUEUE, e);
|
|
1306
1303
|
}
|
|
1307
1304
|
}
|
|
1308
|
-
class
|
|
1305
|
+
class Wt {
|
|
1309
1306
|
/**
|
|
1310
1307
|
* Gets or creates a unique user ID for the given project.
|
|
1311
1308
|
* The user ID is persisted in localStorage and reused across sessions.
|
|
@@ -1315,14 +1312,14 @@ class Bt {
|
|
|
1315
1312
|
* @returns Persistent unique user ID
|
|
1316
1313
|
*/
|
|
1317
1314
|
static getId(e, t) {
|
|
1318
|
-
const n =
|
|
1315
|
+
const n = ut(t ?? ""), s = e.getItem(n);
|
|
1319
1316
|
if (s)
|
|
1320
1317
|
return s;
|
|
1321
|
-
const i =
|
|
1318
|
+
const i = Et();
|
|
1322
1319
|
return e.setItem(n, i), i;
|
|
1323
1320
|
}
|
|
1324
1321
|
}
|
|
1325
|
-
class
|
|
1322
|
+
class Bt extends f {
|
|
1326
1323
|
storageManager;
|
|
1327
1324
|
eventManager;
|
|
1328
1325
|
sessionTimeoutId = null;
|
|
@@ -1343,7 +1340,7 @@ class Yt extends f {
|
|
|
1343
1340
|
return;
|
|
1344
1341
|
}
|
|
1345
1342
|
const e = this.getProjectId();
|
|
1346
|
-
this.broadcastChannel = new BroadcastChannel(
|
|
1343
|
+
this.broadcastChannel = new BroadcastChannel(gt(e)), this.broadcastChannel.onmessage = (t) => {
|
|
1347
1344
|
const { action: n, sessionId: s, timestamp: i, projectId: o } = t.data ?? {};
|
|
1348
1345
|
if (o === e) {
|
|
1349
1346
|
if (n === "session_end") {
|
|
@@ -1419,7 +1416,7 @@ class Yt extends f {
|
|
|
1419
1416
|
this.storageManager.setItem(t, JSON.stringify(e));
|
|
1420
1417
|
}
|
|
1421
1418
|
getSessionStorageKey() {
|
|
1422
|
-
return
|
|
1419
|
+
return ht(this.getProjectId());
|
|
1423
1420
|
}
|
|
1424
1421
|
getProjectId() {
|
|
1425
1422
|
return this.get("config")?.id ?? "";
|
|
@@ -1435,9 +1432,8 @@ class Yt extends f {
|
|
|
1435
1432
|
const e = this.recoverSession(), t = e ?? this.generateSessionId(), n = !!e;
|
|
1436
1433
|
this.isTracking = !0;
|
|
1437
1434
|
try {
|
|
1438
|
-
this.set("sessionId", t), this.persistSession(t), this.eventManager.track({
|
|
1439
|
-
type: d.SESSION_START
|
|
1440
|
-
...n && { session_start_recovered: !0 }
|
|
1435
|
+
this.set("sessionId", t), this.persistSession(t), n || this.eventManager.track({
|
|
1436
|
+
type: d.SESSION_START
|
|
1441
1437
|
}), this.initCrossTabSync(), this.shareSession(t), this.setupSessionTimeout(), this.setupActivityListeners(), this.setupLifecycleListeners(), a.info("SessionManager", "Session tracking started", { sessionId: t, recovered: n });
|
|
1442
1438
|
} catch (s) {
|
|
1443
1439
|
throw this.isTracking = !1, this.clearSessionTimeout(), this.cleanupActivityListeners(), this.cleanupLifecycleListeners(), this.cleanupCrossTabSync(), this.set("sessionId", null), s;
|
|
@@ -1492,7 +1488,7 @@ class Yt extends f {
|
|
|
1492
1488
|
this.visibilityChangeHandler || this.beforeUnloadHandler || (this.visibilityChangeHandler = () => {
|
|
1493
1489
|
document.hidden ? this.clearSessionTimeout() : this.get("sessionId") && this.setupSessionTimeout();
|
|
1494
1490
|
}, this.beforeUnloadHandler = () => {
|
|
1495
|
-
this.
|
|
1491
|
+
this.endSession("page_unload");
|
|
1496
1492
|
}, document.addEventListener("visibilitychange", this.visibilityChangeHandler), window.addEventListener("beforeunload", this.beforeUnloadHandler));
|
|
1497
1493
|
}
|
|
1498
1494
|
cleanupLifecycleListeners() {
|
|
@@ -1540,7 +1536,7 @@ class Yt extends f {
|
|
|
1540
1536
|
this.clearSessionTimeout(), this.cleanupActivityListeners(), this.cleanupCrossTabSync(), this.cleanupLifecycleListeners(), this.isTracking = !1, this.set("hasStartSession", !1);
|
|
1541
1537
|
}
|
|
1542
1538
|
}
|
|
1543
|
-
class
|
|
1539
|
+
class Yt extends f {
|
|
1544
1540
|
eventManager;
|
|
1545
1541
|
storageManager;
|
|
1546
1542
|
sessionManager = null;
|
|
@@ -1555,7 +1551,7 @@ class Kt extends f {
|
|
|
1555
1551
|
return;
|
|
1556
1552
|
}
|
|
1557
1553
|
try {
|
|
1558
|
-
this.sessionManager = new
|
|
1554
|
+
this.sessionManager = new Bt(this.storageManager, this.eventManager), await this.sessionManager.startTracking();
|
|
1559
1555
|
} catch (e) {
|
|
1560
1556
|
if (this.sessionManager) {
|
|
1561
1557
|
try {
|
|
@@ -1583,7 +1579,7 @@ class Kt extends f {
|
|
|
1583
1579
|
this.destroyed || (this.sessionManager && (this.sessionManager.destroy(), this.sessionManager = null), this.destroyed = !0, this.set("hasStartSession", !1));
|
|
1584
1580
|
}
|
|
1585
1581
|
}
|
|
1586
|
-
class
|
|
1582
|
+
class Kt extends f {
|
|
1587
1583
|
eventManager;
|
|
1588
1584
|
onTrack;
|
|
1589
1585
|
originalPushState;
|
|
@@ -1637,7 +1633,7 @@ class Xt extends f {
|
|
|
1637
1633
|
};
|
|
1638
1634
|
}
|
|
1639
1635
|
}
|
|
1640
|
-
class
|
|
1636
|
+
class Xt extends f {
|
|
1641
1637
|
eventManager;
|
|
1642
1638
|
clickHandler;
|
|
1643
1639
|
constructor(e) {
|
|
@@ -1678,7 +1674,7 @@ class qt extends f {
|
|
|
1678
1674
|
return e.hasAttribute(`${k}-name`) ? e : e.closest(`[${k}-name]`) || void 0;
|
|
1679
1675
|
}
|
|
1680
1676
|
getRelevantClickElement(e) {
|
|
1681
|
-
for (const t of
|
|
1677
|
+
for (const t of at)
|
|
1682
1678
|
try {
|
|
1683
1679
|
if (e.matches(t))
|
|
1684
1680
|
return e;
|
|
@@ -1759,28 +1755,39 @@ class qt extends f {
|
|
|
1759
1755
|
};
|
|
1760
1756
|
}
|
|
1761
1757
|
}
|
|
1762
|
-
class
|
|
1758
|
+
class qt extends f {
|
|
1763
1759
|
eventManager;
|
|
1764
1760
|
containers = [];
|
|
1765
1761
|
limitWarningLogged = !1;
|
|
1766
|
-
minDepthChange =
|
|
1767
|
-
minIntervalMs =
|
|
1768
|
-
maxEventsPerSession =
|
|
1762
|
+
minDepthChange = ve;
|
|
1763
|
+
minIntervalMs = ye;
|
|
1764
|
+
maxEventsPerSession = Te;
|
|
1769
1765
|
constructor(e) {
|
|
1770
1766
|
super(), this.eventManager = e;
|
|
1771
1767
|
}
|
|
1772
1768
|
startTracking() {
|
|
1773
1769
|
this.limitWarningLogged = !1, this.applyConfigOverrides(), this.set("scrollEventCount", 0);
|
|
1774
|
-
const e = this.get("config").scrollContainerSelectors,
|
|
1775
|
-
|
|
1776
|
-
for (const s of n)
|
|
1777
|
-
this.setupScrollContainer(s);
|
|
1770
|
+
const e = this.get("config").scrollContainerSelectors, t = Array.isArray(e) ? e : typeof e == "string" ? [e] : [];
|
|
1771
|
+
t.length === 0 ? this.setupScrollContainer(window) : this.trySetupContainers(t, 0);
|
|
1778
1772
|
}
|
|
1779
1773
|
stopTracking() {
|
|
1780
1774
|
for (const e of this.containers)
|
|
1781
1775
|
this.clearContainerTimer(e), e.element instanceof Window ? window.removeEventListener("scroll", e.listener) : e.element.removeEventListener("scroll", e.listener);
|
|
1782
1776
|
this.containers.length = 0, this.set("scrollEventCount", 0), this.limitWarningLogged = !1;
|
|
1783
1777
|
}
|
|
1778
|
+
trySetupContainers(e, t) {
|
|
1779
|
+
const n = e.map((s) => this.safeQuerySelector(s)).filter((s) => s instanceof HTMLElement);
|
|
1780
|
+
if (n.length > 0) {
|
|
1781
|
+
for (const s of n)
|
|
1782
|
+
this.containers.some((o) => o.element === s) || this.setupScrollContainer(s);
|
|
1783
|
+
return;
|
|
1784
|
+
}
|
|
1785
|
+
if (t < 5) {
|
|
1786
|
+
setTimeout(() => this.trySetupContainers(e, t + 1), 200);
|
|
1787
|
+
return;
|
|
1788
|
+
}
|
|
1789
|
+
this.containers.length === 0 && this.setupScrollContainer(window);
|
|
1790
|
+
}
|
|
1784
1791
|
setupScrollContainer(e) {
|
|
1785
1792
|
if (e !== window && !this.isElementScrollable(e))
|
|
1786
1793
|
return;
|
|
@@ -1792,7 +1799,7 @@ class Jt extends f {
|
|
|
1792
1799
|
this.processScrollEvent(s, i, o);
|
|
1793
1800
|
}
|
|
1794
1801
|
s.debounceTimer = null;
|
|
1795
|
-
},
|
|
1802
|
+
}, ke));
|
|
1796
1803
|
}, n = this.getScrollTop(e), s = {
|
|
1797
1804
|
element: e,
|
|
1798
1805
|
lastScrollPos: n,
|
|
@@ -1836,7 +1843,7 @@ class Jt extends f {
|
|
|
1836
1843
|
}));
|
|
1837
1844
|
}
|
|
1838
1845
|
applyConfigOverrides() {
|
|
1839
|
-
this.minDepthChange =
|
|
1846
|
+
this.minDepthChange = ve, this.minIntervalMs = ye, this.maxEventsPerSession = Te;
|
|
1840
1847
|
}
|
|
1841
1848
|
isWindowScrollable() {
|
|
1842
1849
|
return document.documentElement.scrollHeight > window.innerHeight;
|
|
@@ -1855,7 +1862,7 @@ class Jt extends f {
|
|
|
1855
1862
|
}
|
|
1856
1863
|
calculateScrollData(e) {
|
|
1857
1864
|
const { element: t, lastScrollPos: n } = e, s = this.getScrollTop(t);
|
|
1858
|
-
if (Math.abs(s - n) <
|
|
1865
|
+
if (Math.abs(s - n) < rt || t === window && !this.isWindowScrollable())
|
|
1859
1866
|
return null;
|
|
1860
1867
|
const o = this.getViewportHeight(t), c = this.getScrollHeight(t), l = this.getScrollDirection(s, n), u = this.calculateScrollDepth(s, c, o);
|
|
1861
1868
|
return e.lastScrollPos = s, { depth: u, direction: l };
|
|
@@ -1884,7 +1891,7 @@ class Jt extends f {
|
|
|
1884
1891
|
}
|
|
1885
1892
|
}
|
|
1886
1893
|
}
|
|
1887
|
-
class
|
|
1894
|
+
class Jt extends f {
|
|
1888
1895
|
isInitialized = !1;
|
|
1889
1896
|
async initialize() {
|
|
1890
1897
|
if (this.isInitialized)
|
|
@@ -1939,7 +1946,7 @@ class Zt extends f {
|
|
|
1939
1946
|
`, document.head.appendChild(n);
|
|
1940
1947
|
}
|
|
1941
1948
|
}
|
|
1942
|
-
class
|
|
1949
|
+
class Zt {
|
|
1943
1950
|
storage;
|
|
1944
1951
|
fallbackStorage = /* @__PURE__ */ new Map();
|
|
1945
1952
|
constructor() {
|
|
@@ -2019,12 +2026,12 @@ class er {
|
|
|
2019
2026
|
}
|
|
2020
2027
|
}
|
|
2021
2028
|
}
|
|
2022
|
-
class
|
|
2029
|
+
class er extends f {
|
|
2023
2030
|
eventManager;
|
|
2024
2031
|
reportedByNav = /* @__PURE__ */ new Map();
|
|
2025
2032
|
observers = [];
|
|
2026
2033
|
lastLongTaskSentAt = 0;
|
|
2027
|
-
vitalThresholds =
|
|
2034
|
+
vitalThresholds = Ve;
|
|
2028
2035
|
constructor(e) {
|
|
2029
2036
|
super(), this.eventManager = e;
|
|
2030
2037
|
}
|
|
@@ -2093,7 +2100,7 @@ class tr extends f {
|
|
|
2093
2100
|
}
|
|
2094
2101
|
async initWebVitals() {
|
|
2095
2102
|
try {
|
|
2096
|
-
const { onLCP: e, onCLS: t, onFCP: n, onTTFB: s, onINP: i } = await Promise.resolve().then(() =>
|
|
2103
|
+
const { onLCP: e, onCLS: t, onFCP: n, onTTFB: s, onINP: i } = await Promise.resolve().then(() => yr), o = (c) => (l) => {
|
|
2097
2104
|
const u = Number(l.value.toFixed(_));
|
|
2098
2105
|
this.sendVital({ type: c, value: u });
|
|
2099
2106
|
};
|
|
@@ -2124,7 +2131,7 @@ class tr extends f {
|
|
|
2124
2131
|
const t = e.getEntries();
|
|
2125
2132
|
for (const n of t) {
|
|
2126
2133
|
const s = Number(n.duration.toFixed(_)), i = Date.now();
|
|
2127
|
-
i - this.lastLongTaskSentAt >=
|
|
2134
|
+
i - this.lastLongTaskSentAt >= ft && (this.shouldSendVital("LONG_TASK", s) && this.trackWebVital("LONG_TASK", s), this.lastLongTaskSentAt = i);
|
|
2128
2135
|
}
|
|
2129
2136
|
},
|
|
2130
2137
|
{ type: "longtask", buffered: !0 }
|
|
@@ -2211,7 +2218,7 @@ class tr extends f {
|
|
|
2211
2218
|
}), !1) : !0;
|
|
2212
2219
|
}
|
|
2213
2220
|
}
|
|
2214
|
-
class
|
|
2221
|
+
class tr extends f {
|
|
2215
2222
|
eventManager;
|
|
2216
2223
|
recentErrors = /* @__PURE__ */ new Map();
|
|
2217
2224
|
constructor(e) {
|
|
@@ -2272,8 +2279,8 @@ class rr extends f {
|
|
|
2272
2279
|
}
|
|
2273
2280
|
}
|
|
2274
2281
|
sanitize(e) {
|
|
2275
|
-
let t = e.length >
|
|
2276
|
-
for (const n of
|
|
2282
|
+
let t = e.length > Re ? e.slice(0, Re) + "..." : e;
|
|
2283
|
+
for (const n of Fe) {
|
|
2277
2284
|
const s = new RegExp(n.source, n.flags);
|
|
2278
2285
|
t = t.replace(s, "[REDACTED]");
|
|
2279
2286
|
}
|
|
@@ -2281,12 +2288,12 @@ class rr extends f {
|
|
|
2281
2288
|
}
|
|
2282
2289
|
shouldSuppressError(e, t) {
|
|
2283
2290
|
const n = Date.now(), s = `${e}:${t}`, i = this.recentErrors.get(s);
|
|
2284
|
-
return i && n - i <
|
|
2291
|
+
return i && n - i < Le ? (this.recentErrors.set(s, n), !0) : (this.recentErrors.set(s, n), this.recentErrors.size > X && this.pruneOldErrors(), !1);
|
|
2285
2292
|
}
|
|
2286
2293
|
pruneOldErrors() {
|
|
2287
2294
|
const e = Date.now();
|
|
2288
2295
|
for (const [s, i] of this.recentErrors.entries())
|
|
2289
|
-
e - i >
|
|
2296
|
+
e - i > Le && this.recentErrors.delete(s);
|
|
2290
2297
|
if (this.recentErrors.size <= X)
|
|
2291
2298
|
return;
|
|
2292
2299
|
const t = Array.from(this.recentErrors.entries()).sort((s, i) => s[1] - i[1]), n = this.recentErrors.size - X;
|
|
@@ -2296,10 +2303,10 @@ class rr extends f {
|
|
|
2296
2303
|
}
|
|
2297
2304
|
}
|
|
2298
2305
|
}
|
|
2299
|
-
class
|
|
2306
|
+
class rr extends f {
|
|
2300
2307
|
isInitialized = !1;
|
|
2301
2308
|
suppressNextScrollTimer = null;
|
|
2302
|
-
emitter = new
|
|
2309
|
+
emitter = new Gt();
|
|
2303
2310
|
managers = {};
|
|
2304
2311
|
handlers = {};
|
|
2305
2312
|
integrations = {};
|
|
@@ -2310,9 +2317,9 @@ class nr extends f {
|
|
|
2310
2317
|
if (!this.isInitialized) {
|
|
2311
2318
|
if (!e.id?.trim())
|
|
2312
2319
|
throw new Error("Project ID is required");
|
|
2313
|
-
this.managers.storage = new
|
|
2320
|
+
this.managers.storage = new Zt();
|
|
2314
2321
|
try {
|
|
2315
|
-
await this.setupState(e), await this.setupIntegrations(), this.managers.event = new
|
|
2322
|
+
await this.setupState(e), await this.setupIntegrations(), this.managers.event = new Qt(this.managers.storage, this.integrations.googleAnalytics, this.emitter), this.initializeHandlers(), await this.managers.event.recoverPersistedEvents().catch(() => {
|
|
2316
2323
|
a.warn("App", "Failed to recover persisted events");
|
|
2317
2324
|
}), this.isInitialized = !0;
|
|
2318
2325
|
} catch (t) {
|
|
@@ -2323,7 +2330,7 @@ class nr extends f {
|
|
|
2323
2330
|
sendCustomEvent(e, t) {
|
|
2324
2331
|
if (!this.managers.event)
|
|
2325
2332
|
return;
|
|
2326
|
-
const { valid: n, error: s, sanitizedMetadata: i } =
|
|
2333
|
+
const { valid: n, error: s, sanitizedMetadata: i } = Ht(e, t);
|
|
2327
2334
|
if (!n) {
|
|
2328
2335
|
const o = this.get("config");
|
|
2329
2336
|
if (o?.mode === "qa" || o?.mode === "debug")
|
|
@@ -2358,12 +2365,12 @@ class nr extends f {
|
|
|
2358
2365
|
await Promise.allSettled(t), this.suppressNextScrollTimer && (clearTimeout(this.suppressNextScrollTimer), this.suppressNextScrollTimer = null), this.managers.event?.stop(), this.emitter.removeAllListeners(), this.set("hasStartSession", !1), this.set("suppressNextScroll", !1), this.set("sessionId", null), this.isInitialized = !1, this.handlers = {};
|
|
2359
2366
|
}
|
|
2360
2367
|
async setupState(e) {
|
|
2361
|
-
const t =
|
|
2368
|
+
const t = jt(e.id, e.allowHttp);
|
|
2362
2369
|
this.set("apiUrl", t);
|
|
2363
2370
|
const s = await new he().get(t, e), { config: i } = V(s);
|
|
2364
2371
|
this.set("config", i);
|
|
2365
|
-
const o =
|
|
2366
|
-
this.set("userId", o), this.set("device",
|
|
2372
|
+
const o = Wt.getId(this.managers.storage, i.id);
|
|
2373
|
+
this.set("userId", o), this.set("device", St());
|
|
2367
2374
|
const c = ie(window.location.href, i.sensitiveQueryParams);
|
|
2368
2375
|
this.set("pageUrl", c);
|
|
2369
2376
|
}
|
|
@@ -2371,13 +2378,13 @@ class nr extends f {
|
|
|
2371
2378
|
const e = this.get("config"), t = e.integrations?.googleAnalytics?.measurementId;
|
|
2372
2379
|
if (!e.ipExcluded && t?.trim())
|
|
2373
2380
|
try {
|
|
2374
|
-
this.integrations.googleAnalytics = new
|
|
2381
|
+
this.integrations.googleAnalytics = new Jt(), await this.integrations.googleAnalytics.initialize();
|
|
2375
2382
|
} catch {
|
|
2376
2383
|
this.integrations.googleAnalytics = void 0;
|
|
2377
2384
|
}
|
|
2378
2385
|
}
|
|
2379
2386
|
initializeHandlers() {
|
|
2380
|
-
this.handlers.session = new
|
|
2387
|
+
this.handlers.session = new Yt(
|
|
2381
2388
|
this.managers.storage,
|
|
2382
2389
|
this.managers.event
|
|
2383
2390
|
), this.handlers.session.startTracking().catch((t) => {
|
|
@@ -2388,15 +2395,15 @@ class nr extends f {
|
|
|
2388
2395
|
const e = () => {
|
|
2389
2396
|
this.set("suppressNextScroll", !0), this.suppressNextScrollTimer && clearTimeout(this.suppressNextScrollTimer), this.suppressNextScrollTimer = window.setTimeout(() => {
|
|
2390
2397
|
this.set("suppressNextScroll", !1);
|
|
2391
|
-
},
|
|
2398
|
+
}, ke * lt);
|
|
2392
2399
|
};
|
|
2393
|
-
this.handlers.pageView = new
|
|
2400
|
+
this.handlers.pageView = new Kt(this.managers.event, e), this.handlers.pageView.startTracking(), this.handlers.click = new Xt(this.managers.event), this.handlers.click.startTracking(), this.handlers.scroll = new qt(this.managers.event), this.handlers.scroll.startTracking(), this.handlers.performance = new er(this.managers.event), this.handlers.performance.startTracking().catch(() => {
|
|
2394
2401
|
a.warn("App", "Failed to start performance tracking");
|
|
2395
|
-
}), this.handlers.error = new
|
|
2402
|
+
}), this.handlers.error = new tr(this.managers.event), this.handlers.error.startTracking();
|
|
2396
2403
|
}
|
|
2397
2404
|
}
|
|
2398
2405
|
let g = null, C = !1, q = !1;
|
|
2399
|
-
const
|
|
2406
|
+
const nr = async (r) => {
|
|
2400
2407
|
if (typeof window > "u" || typeof document > "u")
|
|
2401
2408
|
throw new Error("This library can only be used in a browser environment");
|
|
2402
2409
|
if (!window.__traceLogDisabled) {
|
|
@@ -2409,7 +2416,7 @@ const sr = async (r) => {
|
|
|
2409
2416
|
C = !0;
|
|
2410
2417
|
try {
|
|
2411
2418
|
a.info("API", "Initializing TraceLog", { projectId: r.id });
|
|
2412
|
-
const e =
|
|
2419
|
+
const e = Rt(r), t = new rr();
|
|
2413
2420
|
try {
|
|
2414
2421
|
await t.init(e), g = t, a.info("API", "TraceLog initialized successfully", { projectId: e.id });
|
|
2415
2422
|
} catch (n) {
|
|
@@ -2426,7 +2433,7 @@ const sr = async (r) => {
|
|
|
2426
2433
|
C = !1;
|
|
2427
2434
|
}
|
|
2428
2435
|
}
|
|
2429
|
-
},
|
|
2436
|
+
}, sr = (r, e) => {
|
|
2430
2437
|
if (!g)
|
|
2431
2438
|
throw new Error("TraceLog not initialized. Please call init() first.");
|
|
2432
2439
|
try {
|
|
@@ -2434,15 +2441,15 @@ const sr = async (r) => {
|
|
|
2434
2441
|
} catch (t) {
|
|
2435
2442
|
throw a.error("API", "Failed to send custom event", { eventName: r, error: t }), t;
|
|
2436
2443
|
}
|
|
2437
|
-
},
|
|
2444
|
+
}, ir = (r, e) => {
|
|
2438
2445
|
if (!g)
|
|
2439
2446
|
throw new Error("TraceLog not initialized. Please call init() first.");
|
|
2440
2447
|
g.on(r, e);
|
|
2441
|
-
},
|
|
2448
|
+
}, ar = (r, e) => {
|
|
2442
2449
|
if (!g)
|
|
2443
2450
|
throw new Error("TraceLog not initialized. Please call init() first.");
|
|
2444
2451
|
g.off(r, e);
|
|
2445
|
-
},
|
|
2452
|
+
}, or = () => g !== null, lr = async () => {
|
|
2446
2453
|
if (!g)
|
|
2447
2454
|
throw new Error("App not initialized");
|
|
2448
2455
|
if (q)
|
|
@@ -2455,13 +2462,13 @@ const sr = async (r) => {
|
|
|
2455
2462
|
} finally {
|
|
2456
2463
|
q = !1;
|
|
2457
2464
|
}
|
|
2458
|
-
},
|
|
2459
|
-
WEB_VITALS_THRESHOLDS:
|
|
2465
|
+
}, Tr = {
|
|
2466
|
+
WEB_VITALS_THRESHOLDS: Ve
|
|
2460
2467
|
// Business thresholds for performance analysis
|
|
2461
|
-
},
|
|
2462
|
-
PII_PATTERNS:
|
|
2468
|
+
}, Ir = {
|
|
2469
|
+
PII_PATTERNS: Fe
|
|
2463
2470
|
// Patterns for sensitive data protection
|
|
2464
|
-
},
|
|
2471
|
+
}, _r = {
|
|
2465
2472
|
LOW_ACTIVITY_EVENT_COUNT: 50,
|
|
2466
2473
|
HIGH_ACTIVITY_EVENT_COUNT: 1e3,
|
|
2467
2474
|
MIN_EVENTS_FOR_DYNAMIC_CALCULATION: 100,
|
|
@@ -2471,7 +2478,7 @@ const sr = async (r) => {
|
|
|
2471
2478
|
MIN_ENGAGED_SESSION_DURATION_MS: 30 * 1e3,
|
|
2472
2479
|
MIN_SCROLL_DEPTH_ENGAGEMENT: 25
|
|
2473
2480
|
// 25% scroll depth for engagement
|
|
2474
|
-
},
|
|
2481
|
+
}, wr = {
|
|
2475
2482
|
INACTIVITY_TIMEOUT_MS: 30 * 60 * 1e3,
|
|
2476
2483
|
// 30min for analytics (vs 15min client)
|
|
2477
2484
|
SHORT_SESSION_THRESHOLD_MS: 30 * 1e3,
|
|
@@ -2479,20 +2486,20 @@ const sr = async (r) => {
|
|
|
2479
2486
|
LONG_SESSION_THRESHOLD_MS: 30 * 60 * 1e3,
|
|
2480
2487
|
MAX_REALISTIC_SESSION_DURATION_MS: 8 * 60 * 60 * 1e3
|
|
2481
2488
|
// Filter outliers
|
|
2482
|
-
},
|
|
2489
|
+
}, Ar = {
|
|
2483
2490
|
MOBILE_MAX_WIDTH: 768,
|
|
2484
2491
|
TABLET_MAX_WIDTH: 1024,
|
|
2485
2492
|
MOBILE_PERFORMANCE_FACTOR: 1.5,
|
|
2486
2493
|
// Mobile typically 1.5x slower
|
|
2487
2494
|
TABLET_PERFORMANCE_FACTOR: 1.2
|
|
2488
|
-
},
|
|
2495
|
+
}, br = {
|
|
2489
2496
|
MIN_TEXT_LENGTH_FOR_ANALYSIS: 10,
|
|
2490
2497
|
MIN_CLICKS_FOR_HOT_ELEMENT: 10,
|
|
2491
2498
|
// Popular element threshold
|
|
2492
2499
|
MIN_SCROLL_COMPLETION_PERCENT: 80,
|
|
2493
2500
|
// Page consumption threshold
|
|
2494
2501
|
MIN_TIME_ON_PAGE_FOR_READ_MS: 15 * 1e3
|
|
2495
|
-
},
|
|
2502
|
+
}, Mr = {
|
|
2496
2503
|
SIGNIFICANT_CHANGE_PERCENT: 20,
|
|
2497
2504
|
MAJOR_CHANGE_PERCENT: 50,
|
|
2498
2505
|
MIN_EVENTS_FOR_INSIGHT: 100,
|
|
@@ -2502,19 +2509,19 @@ const sr = async (r) => {
|
|
|
2502
2509
|
LOW_ERROR_RATE_PERCENT: 1,
|
|
2503
2510
|
HIGH_ERROR_RATE_PERCENT: 5,
|
|
2504
2511
|
CRITICAL_ERROR_RATE_PERCENT: 10
|
|
2505
|
-
},
|
|
2512
|
+
}, Rr = {
|
|
2506
2513
|
SHORT_TERM_TREND_HOURS: 24,
|
|
2507
2514
|
MEDIUM_TERM_TREND_DAYS: 7,
|
|
2508
2515
|
LONG_TERM_TREND_DAYS: 30,
|
|
2509
2516
|
MIN_DATA_POINTS_FOR_TREND: 5,
|
|
2510
2517
|
WEEKLY_PATTERN_MIN_WEEKS: 4,
|
|
2511
2518
|
DAILY_PATTERN_MIN_DAYS: 14
|
|
2512
|
-
},
|
|
2519
|
+
}, Lr = {
|
|
2513
2520
|
MIN_SEGMENT_SIZE: 10,
|
|
2514
2521
|
MIN_COHORT_SIZE: 5,
|
|
2515
2522
|
COHORT_ANALYSIS_DAYS: [1, 3, 7, 14, 30],
|
|
2516
2523
|
MIN_FUNNEL_EVENTS: 20
|
|
2517
|
-
},
|
|
2524
|
+
}, Nr = {
|
|
2518
2525
|
DEFAULT_EVENTS_LIMIT: 5,
|
|
2519
2526
|
DEFAULT_SESSIONS_LIMIT: 5,
|
|
2520
2527
|
DEFAULT_PAGES_LIMIT: 5,
|
|
@@ -2522,27 +2529,27 @@ const sr = async (r) => {
|
|
|
2522
2529
|
MAX_TIME_RANGE_DAYS: 365,
|
|
2523
2530
|
ANALYTICS_BATCH_SIZE: 1e3
|
|
2524
2531
|
// For historical analysis
|
|
2525
|
-
},
|
|
2532
|
+
}, Cr = {
|
|
2526
2533
|
ANOMALY_THRESHOLD_SIGMA: 2.5,
|
|
2527
2534
|
STRONG_ANOMALY_THRESHOLD_SIGMA: 3,
|
|
2528
2535
|
TRAFFIC_DROP_ALERT_PERCENT: -30,
|
|
2529
2536
|
TRAFFIC_SPIKE_ALERT_PERCENT: 200,
|
|
2530
2537
|
MIN_BASELINE_DAYS: 7,
|
|
2531
2538
|
MIN_EVENTS_FOR_ANOMALY_DETECTION: 50
|
|
2532
|
-
},
|
|
2539
|
+
}, Pr = {
|
|
2533
2540
|
PAGE_URL_EXCLUDED: "excluded",
|
|
2534
2541
|
PAGE_URL_UNKNOWN: "unknown"
|
|
2535
|
-
},
|
|
2536
|
-
init:
|
|
2537
|
-
event:
|
|
2538
|
-
on:
|
|
2539
|
-
off:
|
|
2540
|
-
isInitialized:
|
|
2541
|
-
destroy:
|
|
2542
|
+
}, Or = {
|
|
2543
|
+
init: nr,
|
|
2544
|
+
event: sr,
|
|
2545
|
+
on: ir,
|
|
2546
|
+
off: ar,
|
|
2547
|
+
isInitialized: or,
|
|
2548
|
+
destroy: lr
|
|
2542
2549
|
};
|
|
2543
|
-
var ae,
|
|
2550
|
+
var ae, Ge = -1, R = function(r) {
|
|
2544
2551
|
addEventListener("pageshow", function(e) {
|
|
2545
|
-
e.persisted && (
|
|
2552
|
+
e.persisted && (Ge = e.timeStamp, r(e));
|
|
2546
2553
|
}, !0);
|
|
2547
2554
|
}, ge = function() {
|
|
2548
2555
|
var r = self.performance && performance.getEntriesByType && performance.getEntriesByType("navigation")[0];
|
|
@@ -2552,7 +2559,7 @@ var ae, je = -1, L = function(r) {
|
|
|
2552
2559
|
return r && r.activationStart || 0;
|
|
2553
2560
|
}, S = function(r, e) {
|
|
2554
2561
|
var t = ge(), n = "navigate";
|
|
2555
|
-
return
|
|
2562
|
+
return Ge >= 0 ? n = "back-forward-cache" : t && (document.prerendering || $() > 0 ? n = "prerender" : document.wasDiscarded ? n = "restore" : t.type && (n = t.type.replace(/_/g, "-"))), { name: r, value: e === void 0 ? -1 : e, rating: "good", delta: 0, entries: [], id: "v4-".concat(Date.now(), "-").concat(Math.floor(8999999999999 * Math.random()) + 1e12), navigationType: n };
|
|
2556
2563
|
}, D = function(r, e, t) {
|
|
2557
2564
|
try {
|
|
2558
2565
|
if (PerformanceObserver.supportedEntryTypes.includes(r)) {
|
|
@@ -2587,70 +2594,70 @@ var ae, je = -1, L = function(r) {
|
|
|
2587
2594
|
return function() {
|
|
2588
2595
|
e || (r(), e = !0);
|
|
2589
2596
|
};
|
|
2590
|
-
},
|
|
2597
|
+
}, M = -1, Oe = function() {
|
|
2591
2598
|
return document.visibilityState !== "hidden" || document.prerendering ? 1 / 0 : 0;
|
|
2592
2599
|
}, j = function(r) {
|
|
2593
|
-
document.visibilityState === "hidden" &&
|
|
2594
|
-
},
|
|
2600
|
+
document.visibilityState === "hidden" && M > -1 && (M = r.type === "visibilitychange" ? r.timeStamp : 0, cr());
|
|
2601
|
+
}, De = function() {
|
|
2595
2602
|
addEventListener("visibilitychange", j, !0), addEventListener("prerenderingchange", j, !0);
|
|
2596
|
-
},
|
|
2603
|
+
}, cr = function() {
|
|
2597
2604
|
removeEventListener("visibilitychange", j, !0), removeEventListener("prerenderingchange", j, !0);
|
|
2598
|
-
},
|
|
2599
|
-
return
|
|
2605
|
+
}, je = function() {
|
|
2606
|
+
return M < 0 && (M = Oe(), De(), R(function() {
|
|
2600
2607
|
setTimeout(function() {
|
|
2601
|
-
|
|
2608
|
+
M = Oe(), De();
|
|
2602
2609
|
}, 0);
|
|
2603
2610
|
})), { get firstHiddenTime() {
|
|
2604
|
-
return
|
|
2611
|
+
return M;
|
|
2605
2612
|
} };
|
|
2606
2613
|
}, W = function(r) {
|
|
2607
2614
|
document.prerendering ? addEventListener("prerenderingchange", function() {
|
|
2608
2615
|
return r();
|
|
2609
2616
|
}, !0) : r();
|
|
2610
|
-
}, oe = [1800, 3e3],
|
|
2617
|
+
}, oe = [1800, 3e3], $e = function(r, e) {
|
|
2611
2618
|
e = e || {}, W(function() {
|
|
2612
|
-
var t, n =
|
|
2619
|
+
var t, n = je(), s = S("FCP"), i = D("paint", function(o) {
|
|
2613
2620
|
o.forEach(function(c) {
|
|
2614
2621
|
c.name === "first-contentful-paint" && (i.disconnect(), c.startTime < n.firstHiddenTime && (s.value = Math.max(c.startTime - $(), 0), s.entries.push(c), t(!0)));
|
|
2615
2622
|
});
|
|
2616
2623
|
});
|
|
2617
|
-
i && (t = E(r, s, oe, e.reportAllChanges),
|
|
2624
|
+
i && (t = E(r, s, oe, e.reportAllChanges), R(function(o) {
|
|
2618
2625
|
s = S("FCP"), t = E(r, s, oe, e.reportAllChanges), fe(function() {
|
|
2619
2626
|
s.value = performance.now() - o.timeStamp, t(!0);
|
|
2620
2627
|
});
|
|
2621
2628
|
}));
|
|
2622
2629
|
});
|
|
2623
|
-
}, le = [0.1, 0.25],
|
|
2624
|
-
e = e || {},
|
|
2630
|
+
}, le = [0.1, 0.25], ur = function(r, e) {
|
|
2631
|
+
e = e || {}, $e(me(function() {
|
|
2625
2632
|
var t, n = S("CLS", 0), s = 0, i = [], o = function(l) {
|
|
2626
2633
|
l.forEach(function(u) {
|
|
2627
2634
|
if (!u.hadRecentInput) {
|
|
2628
|
-
var h = i[0],
|
|
2629
|
-
s && u.startTime -
|
|
2635
|
+
var h = i[0], L = i[i.length - 1];
|
|
2636
|
+
s && u.startTime - L.startTime < 1e3 && u.startTime - h.startTime < 5e3 ? (s += u.value, i.push(u)) : (s = u.value, i = [u]);
|
|
2630
2637
|
}
|
|
2631
2638
|
}), s > n.value && (n.value = s, n.entries = i, t());
|
|
2632
2639
|
}, c = D("layout-shift", o);
|
|
2633
2640
|
c && (t = E(r, n, le, e.reportAllChanges), Q(function() {
|
|
2634
2641
|
o(c.takeRecords()), t(!0);
|
|
2635
|
-
}),
|
|
2642
|
+
}), R(function() {
|
|
2636
2643
|
s = 0, n = S("CLS", 0), t = E(r, n, le, e.reportAllChanges), fe(function() {
|
|
2637
2644
|
return t();
|
|
2638
2645
|
});
|
|
2639
2646
|
}), setTimeout(t, 0));
|
|
2640
2647
|
}));
|
|
2641
|
-
},
|
|
2648
|
+
}, Qe = 0, J = 1 / 0, U = 0, dr = function(r) {
|
|
2642
2649
|
r.forEach(function(e) {
|
|
2643
|
-
e.interactionId && (J = Math.min(J, e.interactionId), U = Math.max(U, e.interactionId),
|
|
2650
|
+
e.interactionId && (J = Math.min(J, e.interactionId), U = Math.max(U, e.interactionId), Qe = U ? (U - J) / 7 + 1 : 0);
|
|
2644
2651
|
});
|
|
2645
|
-
},
|
|
2646
|
-
return ae ?
|
|
2647
|
-
},
|
|
2648
|
-
"interactionCount" in performance || ae || (ae = D("event",
|
|
2649
|
-
}, m = [], F = /* @__PURE__ */ new Map(),
|
|
2650
|
-
var r = Math.min(m.length - 1, Math.floor((
|
|
2652
|
+
}, We = function() {
|
|
2653
|
+
return ae ? Qe : performance.interactionCount || 0;
|
|
2654
|
+
}, hr = function() {
|
|
2655
|
+
"interactionCount" in performance || ae || (ae = D("event", dr, { type: "event", buffered: !0, durationThreshold: 0 }));
|
|
2656
|
+
}, m = [], F = /* @__PURE__ */ new Map(), Be = 0, gr = function() {
|
|
2657
|
+
var r = Math.min(m.length - 1, Math.floor((We() - Be) / 50));
|
|
2651
2658
|
return m[r];
|
|
2652
|
-
},
|
|
2653
|
-
if (
|
|
2659
|
+
}, fr = [], mr = function(r) {
|
|
2660
|
+
if (fr.forEach(function(s) {
|
|
2654
2661
|
return s(r);
|
|
2655
2662
|
}), r.interactionId || r.entryType === "first-input") {
|
|
2656
2663
|
var e = m[m.length - 1], t = F.get(r.interactionId);
|
|
@@ -2667,29 +2674,29 @@ var ae, je = -1, L = function(r) {
|
|
|
2667
2674
|
});
|
|
2668
2675
|
}
|
|
2669
2676
|
}
|
|
2670
|
-
},
|
|
2677
|
+
}, Ye = function(r) {
|
|
2671
2678
|
var e = self.requestIdleCallback || self.setTimeout, t = -1;
|
|
2672
2679
|
return r = me(r), document.visibilityState === "hidden" ? r() : (t = e(r), Q(r)), t;
|
|
2673
|
-
}, ce = [200, 500],
|
|
2680
|
+
}, ce = [200, 500], pr = function(r, e) {
|
|
2674
2681
|
"PerformanceEventTiming" in self && "interactionId" in PerformanceEventTiming.prototype && (e = e || {}, W(function() {
|
|
2675
2682
|
var t;
|
|
2676
|
-
|
|
2683
|
+
hr();
|
|
2677
2684
|
var n, s = S("INP"), i = function(c) {
|
|
2678
|
-
|
|
2679
|
-
c.forEach(
|
|
2680
|
-
var l =
|
|
2685
|
+
Ye(function() {
|
|
2686
|
+
c.forEach(mr);
|
|
2687
|
+
var l = gr();
|
|
2681
2688
|
l && l.latency !== s.value && (s.value = l.latency, s.entries = l.entries, n());
|
|
2682
2689
|
});
|
|
2683
2690
|
}, o = D("event", i, { durationThreshold: (t = e.durationThreshold) !== null && t !== void 0 ? t : 40 });
|
|
2684
2691
|
n = E(r, s, ce, e.reportAllChanges), o && (o.observe({ type: "first-input", buffered: !0 }), Q(function() {
|
|
2685
2692
|
i(o.takeRecords()), n(!0);
|
|
2686
|
-
}),
|
|
2687
|
-
|
|
2693
|
+
}), R(function() {
|
|
2694
|
+
Be = We(), m.length = 0, F.clear(), s = S("INP"), n = E(r, s, ce, e.reportAllChanges);
|
|
2688
2695
|
}));
|
|
2689
2696
|
}));
|
|
2690
|
-
}, ue = [2500, 4e3], Z = {},
|
|
2697
|
+
}, ue = [2500, 4e3], Z = {}, Sr = function(r, e) {
|
|
2691
2698
|
e = e || {}, W(function() {
|
|
2692
|
-
var t, n =
|
|
2699
|
+
var t, n = je(), s = S("LCP"), i = function(l) {
|
|
2693
2700
|
e.reportAllChanges || (l = l.slice(-1)), l.forEach(function(u) {
|
|
2694
2701
|
u.startTime < n.firstHiddenTime && (s.value = Math.max(u.startTime - $(), 0), s.entries = [u], t());
|
|
2695
2702
|
});
|
|
@@ -2701,64 +2708,64 @@ var ae, je = -1, L = function(r) {
|
|
|
2701
2708
|
});
|
|
2702
2709
|
["keydown", "click"].forEach(function(l) {
|
|
2703
2710
|
addEventListener(l, function() {
|
|
2704
|
-
return
|
|
2711
|
+
return Ye(c);
|
|
2705
2712
|
}, { once: !0, capture: !0 });
|
|
2706
|
-
}), Q(c),
|
|
2713
|
+
}), Q(c), R(function(l) {
|
|
2707
2714
|
s = S("LCP"), t = E(r, s, ue, e.reportAllChanges), fe(function() {
|
|
2708
2715
|
s.value = performance.now() - l.timeStamp, Z[s.id] = !0, t(!0);
|
|
2709
2716
|
});
|
|
2710
2717
|
});
|
|
2711
2718
|
}
|
|
2712
2719
|
});
|
|
2713
|
-
}, de = [800, 1800],
|
|
2720
|
+
}, de = [800, 1800], Er = function r(e) {
|
|
2714
2721
|
document.prerendering ? W(function() {
|
|
2715
2722
|
return r(e);
|
|
2716
2723
|
}) : document.readyState !== "complete" ? addEventListener("load", function() {
|
|
2717
2724
|
return r(e);
|
|
2718
2725
|
}, !0) : setTimeout(e, 0);
|
|
2719
|
-
},
|
|
2726
|
+
}, vr = function(r, e) {
|
|
2720
2727
|
e = e || {};
|
|
2721
2728
|
var t = S("TTFB"), n = E(r, t, de, e.reportAllChanges);
|
|
2722
|
-
|
|
2729
|
+
Er(function() {
|
|
2723
2730
|
var s = ge();
|
|
2724
|
-
s && (t.value = Math.max(s.responseStart - $(), 0), t.entries = [s], n(!0),
|
|
2731
|
+
s && (t.value = Math.max(s.responseStart - $(), 0), t.entries = [s], n(!0), R(function() {
|
|
2725
2732
|
t = S("TTFB", 0), (n = E(r, t, de, e.reportAllChanges))(!0);
|
|
2726
2733
|
}));
|
|
2727
2734
|
});
|
|
2728
2735
|
};
|
|
2729
|
-
const
|
|
2736
|
+
const yr = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
2730
2737
|
__proto__: null,
|
|
2731
2738
|
CLSThresholds: le,
|
|
2732
2739
|
FCPThresholds: oe,
|
|
2733
2740
|
INPThresholds: ce,
|
|
2734
2741
|
LCPThresholds: ue,
|
|
2735
2742
|
TTFBThresholds: de,
|
|
2736
|
-
onCLS:
|
|
2737
|
-
onFCP:
|
|
2738
|
-
onINP:
|
|
2739
|
-
onLCP:
|
|
2740
|
-
onTTFB:
|
|
2743
|
+
onCLS: ur,
|
|
2744
|
+
onFCP: $e,
|
|
2745
|
+
onINP: pr,
|
|
2746
|
+
onLCP: Sr,
|
|
2747
|
+
onTTFB: vr
|
|
2741
2748
|
}, Symbol.toStringTag, { value: "Module" }));
|
|
2742
2749
|
export {
|
|
2743
|
-
|
|
2744
|
-
|
|
2745
|
-
|
|
2746
|
-
|
|
2747
|
-
|
|
2750
|
+
Nr as ANALYTICS_QUERY_LIMITS,
|
|
2751
|
+
Cr as ANOMALY_DETECTION,
|
|
2752
|
+
br as CONTENT_ANALYTICS,
|
|
2753
|
+
Ir as DATA_PROTECTION,
|
|
2754
|
+
Ar as DEVICE_ANALYTICS,
|
|
2748
2755
|
y as DeviceType,
|
|
2749
|
-
|
|
2756
|
+
_r as ENGAGEMENT_THRESHOLDS,
|
|
2750
2757
|
N as ErrorType,
|
|
2751
2758
|
d as EventType,
|
|
2752
|
-
|
|
2759
|
+
Mr as INSIGHT_THRESHOLDS,
|
|
2753
2760
|
H as Mode,
|
|
2754
|
-
|
|
2755
|
-
|
|
2756
|
-
|
|
2757
|
-
|
|
2761
|
+
Tr as PERFORMANCE_CONFIG,
|
|
2762
|
+
Lr as SEGMENTATION_ANALYTICS,
|
|
2763
|
+
wr as SESSION_ANALYTICS,
|
|
2764
|
+
Pr as SPECIAL_PAGE_URLS,
|
|
2758
2765
|
x as ScrollDirection,
|
|
2759
|
-
|
|
2760
|
-
|
|
2761
|
-
|
|
2762
|
-
|
|
2763
|
-
|
|
2766
|
+
Rr as TEMPORAL_ANALYSIS,
|
|
2767
|
+
Tt as TagConditionOperator,
|
|
2768
|
+
yt as TagConditionType,
|
|
2769
|
+
vt as TagLogicalOperator,
|
|
2770
|
+
Or as tracelog
|
|
2764
2771
|
};
|