clarity-js 0.6.36 → 0.6.37
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/build/clarity.js +487 -486
- package/build/clarity.min.js +1 -1
- package/build/clarity.module.js +487 -486
- package/package.json +1 -1
- package/src/core/version.ts +1 -1
- package/src/layout/dom.ts +1 -0
- package/test/core.test.ts +27 -18
- package/test/helper.ts +5 -0
- package/test/html/core.html +4 -1
package/build/clarity.module.js
CHANGED
|
@@ -75,7 +75,7 @@ var envelope$1 = /*#__PURE__*/Object.freeze({
|
|
|
75
75
|
|
|
76
76
|
var config$1 = {
|
|
77
77
|
projectId: null,
|
|
78
|
-
delay: 1 * 1000 /* Second */,
|
|
78
|
+
delay: 1 * 1000 /* Time.Second */,
|
|
79
79
|
lean: false,
|
|
80
80
|
track: true,
|
|
81
81
|
content: true,
|
|
@@ -95,7 +95,7 @@ function api(method) {
|
|
|
95
95
|
// Zone.js, a popular package for Angular, overrides native browser APIs which can lead to inconsistent state for single page applications.
|
|
96
96
|
// Example issue: https://github.com/angular/angular/issues/31712
|
|
97
97
|
// As a work around, we ensuring Clarity access APIs outside of Zone (and use native implementation instead)
|
|
98
|
-
return window["Zone" /* Zone */] && "__symbol__" /* Symbol */ in window["Zone" /* Zone */] ? window["Zone" /* Zone */]["__symbol__" /* Symbol */](method) : method;
|
|
98
|
+
return window["Zone" /* Constant.Zone */] && "__symbol__" /* Constant.Symbol */ in window["Zone" /* Constant.Zone */] ? window["Zone" /* Constant.Zone */]["__symbol__" /* Constant.Symbol */](method) : method;
|
|
99
99
|
}
|
|
100
100
|
|
|
101
101
|
var startTime = 0;
|
|
@@ -111,7 +111,7 @@ function stop$B() {
|
|
|
111
111
|
startTime = 0;
|
|
112
112
|
}
|
|
113
113
|
|
|
114
|
-
var version$1 = "0.6.
|
|
114
|
+
var version$1 = "0.6.37";
|
|
115
115
|
|
|
116
116
|
// tslint:disable: no-bitwise
|
|
117
117
|
function hash (input) {
|
|
@@ -144,7 +144,7 @@ function reset$o() {
|
|
|
144
144
|
// Baseline state holds the previous values - if it is updated in the current payload,
|
|
145
145
|
// reset the state to current value after sending the previous state
|
|
146
146
|
if (update$2) {
|
|
147
|
-
state$9 = { time: time(), event: 4 /* Baseline */, data: {
|
|
147
|
+
state$9 = { time: time(), event: 4 /* Event.Baseline */, data: {
|
|
148
148
|
visible: buffer.visible,
|
|
149
149
|
docWidth: buffer.docWidth,
|
|
150
150
|
docHeight: buffer.docHeight,
|
|
@@ -159,7 +159,7 @@ function reset$o() {
|
|
|
159
159
|
};
|
|
160
160
|
}
|
|
161
161
|
buffer = buffer ? buffer : {
|
|
162
|
-
visible: 1 /* True */,
|
|
162
|
+
visible: 1 /* BooleanFlag.True */,
|
|
163
163
|
docWidth: 0,
|
|
164
164
|
docHeight: 0,
|
|
165
165
|
screenWidth: 0,
|
|
@@ -173,15 +173,15 @@ function reset$o() {
|
|
|
173
173
|
}
|
|
174
174
|
function track$7(event, x, y) {
|
|
175
175
|
switch (event) {
|
|
176
|
-
case 8 /* Document */:
|
|
176
|
+
case 8 /* Event.Document */:
|
|
177
177
|
buffer.docWidth = x;
|
|
178
178
|
buffer.docHeight = y;
|
|
179
179
|
break;
|
|
180
|
-
case 11 /* Resize */:
|
|
180
|
+
case 11 /* Event.Resize */:
|
|
181
181
|
buffer.screenWidth = x;
|
|
182
182
|
buffer.screenHeight = y;
|
|
183
183
|
break;
|
|
184
|
-
case 10 /* Scroll */:
|
|
184
|
+
case 10 /* Event.Scroll */:
|
|
185
185
|
buffer.scrollX = x;
|
|
186
186
|
buffer.scrollY = y;
|
|
187
187
|
break;
|
|
@@ -196,7 +196,7 @@ function activity(t) {
|
|
|
196
196
|
buffer.activityTime = t;
|
|
197
197
|
}
|
|
198
198
|
function visibility(t, visible) {
|
|
199
|
-
buffer.visible = visible === "visible" ? 1 /* True */ : 0 /* False */;
|
|
199
|
+
buffer.visible = visible === "visible" ? 1 /* BooleanFlag.True */ : 0 /* BooleanFlag.False */;
|
|
200
200
|
if (!buffer.visible) {
|
|
201
201
|
activity(t);
|
|
202
202
|
}
|
|
@@ -204,7 +204,7 @@ function visibility(t, visible) {
|
|
|
204
204
|
}
|
|
205
205
|
function compute$c() {
|
|
206
206
|
if (update$2) {
|
|
207
|
-
encode$1(4 /* Baseline */);
|
|
207
|
+
encode$1(4 /* Event.Baseline */);
|
|
208
208
|
}
|
|
209
209
|
}
|
|
210
210
|
function stop$A() {
|
|
@@ -228,12 +228,12 @@ function event(key, value) {
|
|
|
228
228
|
if (active() &&
|
|
229
229
|
key &&
|
|
230
230
|
value &&
|
|
231
|
-
typeof key === "string" /* String */ &&
|
|
232
|
-
typeof value === "string" /* String */ &&
|
|
231
|
+
typeof key === "string" /* Constant.String */ &&
|
|
232
|
+
typeof value === "string" /* Constant.String */ &&
|
|
233
233
|
key.length < 255 &&
|
|
234
234
|
value.length < 255) {
|
|
235
235
|
data$j = { key: key, value: value };
|
|
236
|
-
encode$1(24 /* Custom */);
|
|
236
|
+
encode$1(24 /* Event.Custom */);
|
|
237
237
|
}
|
|
238
238
|
}
|
|
239
239
|
|
|
@@ -242,7 +242,7 @@ var updates$3 = null;
|
|
|
242
242
|
function start$D() {
|
|
243
243
|
data$i = {};
|
|
244
244
|
updates$3 = {};
|
|
245
|
-
count$1(5 /* InvokeCount */);
|
|
245
|
+
count$1(5 /* Metric.InvokeCount */);
|
|
246
246
|
}
|
|
247
247
|
function stop$z() {
|
|
248
248
|
data$i = {};
|
|
@@ -283,7 +283,7 @@ function max(metric, value) {
|
|
|
283
283
|
}
|
|
284
284
|
}
|
|
285
285
|
function compute$b() {
|
|
286
|
-
encode$1(0 /* Metric */);
|
|
286
|
+
encode$1(0 /* Event.Metric */);
|
|
287
287
|
}
|
|
288
288
|
function reset$n() {
|
|
289
289
|
updates$3 = {};
|
|
@@ -301,7 +301,7 @@ var last = 0;
|
|
|
301
301
|
var interval = 0;
|
|
302
302
|
var timeout$6 = null;
|
|
303
303
|
function start$C() {
|
|
304
|
-
interval = 60000 /* PingInterval */;
|
|
304
|
+
interval = 60000 /* Setting.PingInterval */;
|
|
305
305
|
last = 0;
|
|
306
306
|
}
|
|
307
307
|
function reset$m() {
|
|
@@ -314,8 +314,8 @@ function reset$m() {
|
|
|
314
314
|
function ping() {
|
|
315
315
|
var now = time();
|
|
316
316
|
data$h = { gap: now - last };
|
|
317
|
-
encode$1(25 /* Ping */);
|
|
318
|
-
if (data$h.gap < 300000 /* PingTimeout */) {
|
|
317
|
+
encode$1(25 /* Event.Ping */);
|
|
318
|
+
if (data$h.gap < 300000 /* Setting.PingTimeout */) {
|
|
319
319
|
timeout$6 = setTimeout(ping, interval);
|
|
320
320
|
}
|
|
321
321
|
else {
|
|
@@ -352,7 +352,7 @@ function track$6(event, time) {
|
|
|
352
352
|
var last = e[e.length - 1];
|
|
353
353
|
// Add a new entry only if the new event occurs after configured interval
|
|
354
354
|
// Otherwise, extend the duration of the previous entry
|
|
355
|
-
if (time - last[0] > 100 /* SummaryInterval */) {
|
|
355
|
+
if (time - last[0] > 100 /* Setting.SummaryInterval */) {
|
|
356
356
|
data$g[event].push([time, 0]);
|
|
357
357
|
}
|
|
358
358
|
else {
|
|
@@ -361,7 +361,7 @@ function track$6(event, time) {
|
|
|
361
361
|
}
|
|
362
362
|
}
|
|
363
363
|
function compute$a() {
|
|
364
|
-
encode$1(36 /* Summary */);
|
|
364
|
+
encode$1(36 /* Event.Summary */);
|
|
365
365
|
}
|
|
366
366
|
function reset$l() {
|
|
367
367
|
data$g = {};
|
|
@@ -380,7 +380,7 @@ var summary = /*#__PURE__*/Object.freeze({
|
|
|
380
380
|
var data$f = null;
|
|
381
381
|
function start$A() {
|
|
382
382
|
if (!config$1.lean && config$1.upgrade) {
|
|
383
|
-
config$1.upgrade("Config" /* Config */);
|
|
383
|
+
config$1.upgrade("Config" /* Constant.Config */);
|
|
384
384
|
}
|
|
385
385
|
data$f = null;
|
|
386
386
|
}
|
|
@@ -399,7 +399,7 @@ function upgrade(key) {
|
|
|
399
399
|
if (config$1.upgrade) {
|
|
400
400
|
config$1.upgrade(key);
|
|
401
401
|
}
|
|
402
|
-
encode$1(3 /* Upgrade */);
|
|
402
|
+
encode$1(3 /* Event.Upgrade */);
|
|
403
403
|
}
|
|
404
404
|
}
|
|
405
405
|
function stop$w() {
|
|
@@ -419,25 +419,25 @@ function start$z() {
|
|
|
419
419
|
reset$k();
|
|
420
420
|
}
|
|
421
421
|
function set(variable, value) {
|
|
422
|
-
var values = typeof value === "string" /* String */ ? [value] : value;
|
|
422
|
+
var values = typeof value === "string" /* Constant.String */ ? [value] : value;
|
|
423
423
|
log$2(variable, values);
|
|
424
424
|
}
|
|
425
425
|
function identify(userId, sessionId, pageId) {
|
|
426
426
|
if (sessionId === void 0) { sessionId = null; }
|
|
427
427
|
if (pageId === void 0) { pageId = null; }
|
|
428
|
-
log$2("userId" /* UserId */, [userId]);
|
|
429
|
-
log$2("sessionId" /* SessionId */, [sessionId]);
|
|
430
|
-
log$2("pageId" /* PageId */, [pageId]);
|
|
428
|
+
log$2("userId" /* Constant.UserId */, [userId]);
|
|
429
|
+
log$2("sessionId" /* Constant.SessionId */, [sessionId]);
|
|
430
|
+
log$2("pageId" /* Constant.PageId */, [pageId]);
|
|
431
431
|
}
|
|
432
432
|
function log$2(variable, value) {
|
|
433
433
|
if (active() &&
|
|
434
434
|
variable &&
|
|
435
435
|
value &&
|
|
436
|
-
typeof variable === "string" /* String */ &&
|
|
436
|
+
typeof variable === "string" /* Constant.String */ &&
|
|
437
437
|
variable.length < 255) {
|
|
438
438
|
var validValues = variable in data$e ? data$e[variable] : [];
|
|
439
439
|
for (var i = 0; i < value.length; i++) {
|
|
440
|
-
if (typeof value[i] === "string" /* String */ && value[i].length < 255) {
|
|
440
|
+
if (typeof value[i] === "string" /* Constant.String */ && value[i].length < 255) {
|
|
441
441
|
validValues.push(value[i]);
|
|
442
442
|
}
|
|
443
443
|
}
|
|
@@ -445,7 +445,7 @@ function log$2(variable, value) {
|
|
|
445
445
|
}
|
|
446
446
|
}
|
|
447
447
|
function compute$9() {
|
|
448
|
-
encode$1(34 /* Variable */);
|
|
448
|
+
encode$1(34 /* Event.Variable */);
|
|
449
449
|
}
|
|
450
450
|
function reset$k() {
|
|
451
451
|
data$e = {};
|
|
@@ -465,7 +465,7 @@ var variable = /*#__PURE__*/Object.freeze({
|
|
|
465
465
|
stop: stop$v
|
|
466
466
|
});
|
|
467
467
|
|
|
468
|
-
|
|
468
|
+
/******************************************************************************
|
|
469
469
|
Copyright (c) Microsoft Corporation.
|
|
470
470
|
|
|
471
471
|
Permission to use, copy, modify, and/or distribute this software for any
|
|
@@ -518,7 +518,7 @@ function __generator(thisArg, body) {
|
|
|
518
518
|
}
|
|
519
519
|
}
|
|
520
520
|
|
|
521
|
-
var supported$1 = "CompressionStream" /* CompressionStream */ in window;
|
|
521
|
+
var supported$1 = "CompressionStream" /* Constant.CompressionStream */ in window;
|
|
522
522
|
function compress (input) {
|
|
523
523
|
return __awaiter(this, void 0, void 0, function () {
|
|
524
524
|
var stream, _a;
|
|
@@ -535,7 +535,7 @@ function compress (input) {
|
|
|
535
535
|
return [2 /*return*/];
|
|
536
536
|
});
|
|
537
537
|
});
|
|
538
|
-
} }).pipeThrough(new TextEncoderStream()).pipeThrough(new window["CompressionStream" /* CompressionStream */]("gzip"));
|
|
538
|
+
} }).pipeThrough(new TextEncoderStream()).pipeThrough(new window["CompressionStream" /* Constant.CompressionStream */]("gzip"));
|
|
539
539
|
_a = Uint8Array.bind;
|
|
540
540
|
return [4 /*yield*/, read(stream)];
|
|
541
541
|
case 1: return [2 /*return*/, new (_a.apply(Uint8Array, [void 0, _c.sent()]))()];
|
|
@@ -604,11 +604,11 @@ function scrub (value, hint, privacy, mangle) {
|
|
|
604
604
|
if (mangle === void 0) { mangle = false; }
|
|
605
605
|
if (value) {
|
|
606
606
|
switch (privacy) {
|
|
607
|
-
case 0 /* None */:
|
|
607
|
+
case 0 /* Privacy.None */:
|
|
608
608
|
return value;
|
|
609
|
-
case 1 /* Sensitive */:
|
|
609
|
+
case 1 /* Privacy.Sensitive */:
|
|
610
610
|
switch (hint) {
|
|
611
|
-
case "*T" /* TextTag */:
|
|
611
|
+
case "*T" /* Layout.Constant.TextTag */:
|
|
612
612
|
case "value":
|
|
613
613
|
case "placeholder":
|
|
614
614
|
return redact(value);
|
|
@@ -616,16 +616,16 @@ function scrub (value, hint, privacy, mangle) {
|
|
|
616
616
|
return mangleToken(value);
|
|
617
617
|
}
|
|
618
618
|
return value;
|
|
619
|
-
case 2 /* Text */:
|
|
620
|
-
case 3 /* TextImage */:
|
|
619
|
+
case 2 /* Privacy.Text */:
|
|
620
|
+
case 3 /* Privacy.TextImage */:
|
|
621
621
|
switch (hint) {
|
|
622
|
-
case "*T" /* TextTag */:
|
|
622
|
+
case "*T" /* Layout.Constant.TextTag */:
|
|
623
623
|
return mangle ? mangleText(value) : mask(value);
|
|
624
624
|
case "src":
|
|
625
625
|
case "srcset":
|
|
626
626
|
case "title":
|
|
627
627
|
case "alt":
|
|
628
|
-
return privacy === 3 /* TextImage */ ? "" /* Empty */ : value;
|
|
628
|
+
return privacy === 3 /* Privacy.TextImage */ ? "" /* Data.Constant.Empty */ : value;
|
|
629
629
|
case "value":
|
|
630
630
|
case "click":
|
|
631
631
|
case "input":
|
|
@@ -645,18 +645,18 @@ function mangleText(value) {
|
|
|
645
645
|
var index = value.indexOf(first);
|
|
646
646
|
var prefix = value.substr(0, index);
|
|
647
647
|
var suffix = value.substr(index + trimmed.length);
|
|
648
|
-
return ""
|
|
648
|
+
return "".concat(prefix).concat(trimmed.length.toString(36)).concat(suffix);
|
|
649
649
|
}
|
|
650
650
|
return value;
|
|
651
651
|
}
|
|
652
652
|
function mask(value) {
|
|
653
|
-
return value.replace(/\S/gi, "\u2022" /* Mask */);
|
|
653
|
+
return value.replace(/\S/gi, "\u2022" /* Data.Constant.Mask */);
|
|
654
654
|
}
|
|
655
655
|
function mangleToken(value) {
|
|
656
|
-
var length = ((Math.floor(value.length / 5 /* WordLength */) + 1) * 5 /* WordLength */);
|
|
657
|
-
var output = "" /* Empty */;
|
|
656
|
+
var length = ((Math.floor(value.length / 5 /* Data.Setting.WordLength */) + 1) * 5 /* Data.Setting.WordLength */);
|
|
657
|
+
var output = "" /* Layout.Constant.Empty */;
|
|
658
658
|
for (var i = 0; i < length; i++) {
|
|
659
|
-
output += i > 0 && i % 5 /* WordLength */ === 0 ? " " /* Space */ : "\u2022" /* Mask */;
|
|
659
|
+
output += i > 0 && i % 5 /* Data.Setting.WordLength */ === 0 ? " " /* Data.Constant.Space */ : "\u2022" /* Data.Constant.Mask */;
|
|
660
660
|
}
|
|
661
661
|
return output;
|
|
662
662
|
}
|
|
@@ -668,15 +668,15 @@ function redact(value) {
|
|
|
668
668
|
var array = null;
|
|
669
669
|
for (var i = 0; i < value.length; i++) {
|
|
670
670
|
var c = value.charCodeAt(i);
|
|
671
|
-
hasDigit = hasDigit || (c >= 48 /* Zero */ && c <= 57 /* Nine */); // Check for digits in the current word
|
|
672
|
-
hasEmail = hasEmail || c === 64 /* At */; // Check for @ sign anywhere within the current word
|
|
673
|
-
hasWhitespace = c === 9 /* Tab */ || c === 10 /* NewLine */ || c === 13 /* Return */ || c === 32 /* Blank */;
|
|
671
|
+
hasDigit = hasDigit || (c >= 48 /* Data.Character.Zero */ && c <= 57 /* Data.Character.Nine */); // Check for digits in the current word
|
|
672
|
+
hasEmail = hasEmail || c === 64 /* Data.Character.At */; // Check for @ sign anywhere within the current word
|
|
673
|
+
hasWhitespace = c === 9 /* Data.Character.Tab */ || c === 10 /* Data.Character.NewLine */ || c === 13 /* Data.Character.Return */ || c === 32 /* Data.Character.Blank */;
|
|
674
674
|
// Process each word as an individual token to redact any sensitive information
|
|
675
675
|
if (i === 0 || i === value.length - 1 || hasWhitespace) {
|
|
676
676
|
// Performance optimization: Lazy load string -> array conversion only when required
|
|
677
677
|
if (hasDigit || hasEmail) {
|
|
678
678
|
if (array === null) {
|
|
679
|
-
array = value.split("" /* Empty */);
|
|
679
|
+
array = value.split("" /* Data.Constant.Empty */);
|
|
680
680
|
}
|
|
681
681
|
mutate(array, spaceIndex, hasWhitespace ? i : i + 1);
|
|
682
682
|
}
|
|
@@ -688,11 +688,11 @@ function redact(value) {
|
|
|
688
688
|
}
|
|
689
689
|
}
|
|
690
690
|
}
|
|
691
|
-
return array ? array.join("" /* Empty */) : value;
|
|
691
|
+
return array ? array.join("" /* Data.Constant.Empty */) : value;
|
|
692
692
|
}
|
|
693
693
|
function mutate(array, start, end) {
|
|
694
694
|
for (var i = start + 1; i < end; i++) {
|
|
695
|
-
array[i] = "\u2022" /* Mask */;
|
|
695
|
+
array[i] = "\u2022" /* Data.Constant.Mask */;
|
|
696
696
|
}
|
|
697
697
|
}
|
|
698
698
|
|
|
@@ -700,16 +700,16 @@ var history$5 = [];
|
|
|
700
700
|
var data$d;
|
|
701
701
|
function start$x() {
|
|
702
702
|
history$5 = [];
|
|
703
|
-
max(26 /* Automation */, navigator.webdriver ? 1 /* True */ : 0 /* False */);
|
|
703
|
+
max(26 /* Metric.Automation */, navigator.webdriver ? 1 /* BooleanFlag.True */ : 0 /* BooleanFlag.False */);
|
|
704
704
|
}
|
|
705
705
|
function check$4(id, target, input) {
|
|
706
706
|
// Compute hash for fraud detection. Hash is computed only if input meets the minimum length criteria
|
|
707
|
-
if (id !== null && input && input.length >= 5 /* WordLength */) {
|
|
707
|
+
if (id !== null && input && input.length >= 5 /* Setting.WordLength */) {
|
|
708
708
|
data$d = { id: id, target: target, hash: hash(input) };
|
|
709
709
|
// Only encode this event if we haven't already reported this hash
|
|
710
710
|
if (history$5.indexOf(data$d.hash) < 0) {
|
|
711
711
|
history$5.push(data$d.hash);
|
|
712
|
-
encode$2(41 /* Fraud */);
|
|
712
|
+
encode$2(41 /* Event.Fraud */);
|
|
713
713
|
}
|
|
714
714
|
}
|
|
715
715
|
}
|
|
@@ -718,45 +718,45 @@ var TAGS = ["DIV", "TR", "P", "LI", "UL", "A", "BUTTON"];
|
|
|
718
718
|
function selector (input, beta) {
|
|
719
719
|
if (beta === void 0) { beta = false; }
|
|
720
720
|
var a = input.attributes;
|
|
721
|
-
var prefix = input.prefix ? input.prefix[beta ? 1 /* Beta */ : 0 /* Stable */] : null;
|
|
722
|
-
var suffix = beta || ((a && !("class" /* Class */ in a)) || TAGS.indexOf(input.tag) >= 0) ? ":nth-of-type("
|
|
721
|
+
var prefix = input.prefix ? input.prefix[beta ? 1 /* Selector.Beta */ : 0 /* Selector.Stable */] : null;
|
|
722
|
+
var suffix = beta || ((a && !("class" /* Constant.Class */ in a)) || TAGS.indexOf(input.tag) >= 0) ? ":nth-of-type(".concat(input.position, ")") : "" /* Constant.Empty */;
|
|
723
723
|
switch (input.tag) {
|
|
724
724
|
case "STYLE":
|
|
725
725
|
case "TITLE":
|
|
726
726
|
case "LINK":
|
|
727
727
|
case "META":
|
|
728
|
-
case "*T" /* TextTag */:
|
|
729
|
-
case "*D" /* DocumentTag */:
|
|
730
|
-
return "" /* Empty */;
|
|
728
|
+
case "*T" /* Constant.TextTag */:
|
|
729
|
+
case "*D" /* Constant.DocumentTag */:
|
|
730
|
+
return "" /* Constant.Empty */;
|
|
731
731
|
case "HTML":
|
|
732
|
-
return "HTML" /* HTML */;
|
|
732
|
+
return "HTML" /* Constant.HTML */;
|
|
733
733
|
default:
|
|
734
734
|
if (prefix === null) {
|
|
735
|
-
return "" /* Empty */;
|
|
735
|
+
return "" /* Constant.Empty */;
|
|
736
736
|
}
|
|
737
|
-
prefix = prefix
|
|
738
|
-
input.tag = input.tag.indexOf("svg:" /* SvgPrefix */) === 0 ? input.tag.substr("svg:" /* SvgPrefix */.length) : input.tag;
|
|
739
|
-
var selector = ""
|
|
740
|
-
var classes = "class" /* Class */ in a && a["class" /* Class */].length > 0 ? a["class" /* Class */].trim().split(/\s+/) : null;
|
|
737
|
+
prefix = "".concat(prefix, ">");
|
|
738
|
+
input.tag = input.tag.indexOf("svg:" /* Constant.SvgPrefix */) === 0 ? input.tag.substr("svg:" /* Constant.SvgPrefix */.length) : input.tag;
|
|
739
|
+
var selector = "".concat(prefix).concat(input.tag).concat(suffix);
|
|
740
|
+
var classes = "class" /* Constant.Class */ in a && a["class" /* Constant.Class */].length > 0 ? a["class" /* Constant.Class */].trim().split(/\s+/) : null;
|
|
741
741
|
if (beta) {
|
|
742
742
|
// In beta mode, update selector to use "id" field when available. There are two exceptions:
|
|
743
743
|
// (1) if "id" appears to be an auto generated string token, e.g. guid or a random id containing digits
|
|
744
744
|
// (2) if "id" appears inside a shadow DOM, in which case we continue to prefix up to shadow DOM to prevent conflicts
|
|
745
|
-
var id = "id" /* Id */ in a && a["id" /* Id */].length > 0 ? a["id" /* Id */] : null;
|
|
746
|
-
classes = input.tag !== "BODY" /* BodyTag */ && classes ? classes.filter(function (c) { return !hasDigits(c); }) : [];
|
|
747
|
-
selector = classes.length > 0 ? ""
|
|
748
|
-
selector = id && hasDigits(id) === false ? getDomPrefix(prefix)
|
|
745
|
+
var id = "id" /* Constant.Id */ in a && a["id" /* Constant.Id */].length > 0 ? a["id" /* Constant.Id */] : null;
|
|
746
|
+
classes = input.tag !== "BODY" /* Constant.BodyTag */ && classes ? classes.filter(function (c) { return !hasDigits(c); }) : [];
|
|
747
|
+
selector = classes.length > 0 ? "".concat(prefix).concat(input.tag, ".").concat(classes.join(".")).concat(suffix) : selector;
|
|
748
|
+
selector = id && hasDigits(id) === false ? "".concat(getDomPrefix(prefix), "#").concat(id) : selector;
|
|
749
749
|
}
|
|
750
750
|
else {
|
|
751
751
|
// Otherwise, fallback to stable mode, where we include class names as part of the selector
|
|
752
|
-
selector = classes ? ""
|
|
752
|
+
selector = classes ? "".concat(prefix).concat(input.tag, ".").concat(classes.join(".")).concat(suffix) : selector;
|
|
753
753
|
}
|
|
754
754
|
return selector;
|
|
755
755
|
}
|
|
756
756
|
}
|
|
757
757
|
function getDomPrefix(prefix) {
|
|
758
|
-
var shadowDomStart = prefix.lastIndexOf("*S" /* ShadowDomTag */);
|
|
759
|
-
var iframeDomStart = prefix.lastIndexOf(""
|
|
758
|
+
var shadowDomStart = prefix.lastIndexOf("*S" /* Constant.ShadowDomTag */);
|
|
759
|
+
var iframeDomStart = prefix.lastIndexOf("".concat("iframe:" /* Constant.IFramePrefix */).concat("HTML" /* Constant.HTML */));
|
|
760
760
|
var domStart = Math.max(shadowDomStart, iframeDomStart);
|
|
761
761
|
if (domStart < 0) {
|
|
762
762
|
return "";
|
|
@@ -768,7 +768,7 @@ function getDomPrefix(prefix) {
|
|
|
768
768
|
function hasDigits(value) {
|
|
769
769
|
for (var i = 0; i < value.length; i++) {
|
|
770
770
|
var c = value.charCodeAt(i);
|
|
771
|
-
if (c >= 48 /* Zero */ && c <= 57 /* Nine */) {
|
|
771
|
+
if (c >= 48 /* Character.Zero */ && c <= 57 /* Character.Nine */) {
|
|
772
772
|
return true;
|
|
773
773
|
}
|
|
774
774
|
}
|
|
@@ -805,7 +805,7 @@ function reset$j() {
|
|
|
805
805
|
pauseTask = null;
|
|
806
806
|
}
|
|
807
807
|
function schedule$1(task, priority) {
|
|
808
|
-
if (priority === void 0) { priority = 0 /* Normal */; }
|
|
808
|
+
if (priority === void 0) { priority = 0 /* Priority.Normal */; }
|
|
809
809
|
return __awaiter(this, void 0, void 0, function () {
|
|
810
810
|
var _i, queuedTasks_1, q, promise;
|
|
811
811
|
return __generator(this, function (_a) {
|
|
@@ -817,7 +817,7 @@ function schedule$1(task, priority) {
|
|
|
817
817
|
}
|
|
818
818
|
}
|
|
819
819
|
promise = new Promise(function (resolve) {
|
|
820
|
-
var insert = priority === 1 /* High */ ? "unshift" : "push";
|
|
820
|
+
var insert = priority === 1 /* Priority.High */ ? "unshift" : "push";
|
|
821
821
|
// Queue this task for asynchronous execution later
|
|
822
822
|
// We also store a unique page identifier (id) along with the task to ensure
|
|
823
823
|
// ensure that we do not accidentally execute this task in context of a different page
|
|
@@ -852,7 +852,7 @@ function run() {
|
|
|
852
852
|
return;
|
|
853
853
|
}
|
|
854
854
|
if (error) {
|
|
855
|
-
log$1(0 /* RunTask */, 1 /* Warning */, error.name, error.message, error.stack);
|
|
855
|
+
log$1(0 /* Code.RunTask */, 1 /* Severity.Warning */, error.name, error.message, error.stack);
|
|
856
856
|
}
|
|
857
857
|
activeTask = null;
|
|
858
858
|
run();
|
|
@@ -863,13 +863,13 @@ function state$8(timer) {
|
|
|
863
863
|
var id = key(timer);
|
|
864
864
|
if (id in tracker) {
|
|
865
865
|
var elapsed = performance.now() - tracker[id].start;
|
|
866
|
-
return (elapsed > tracker[id].yield) ? 0 /* Wait */ : 1 /* Run */;
|
|
866
|
+
return (elapsed > tracker[id].yield) ? 0 /* Task.Wait */ : 1 /* Task.Run */;
|
|
867
867
|
}
|
|
868
868
|
// If this task is no longer being tracked, send stop message to the caller
|
|
869
|
-
return 2 /* Stop */;
|
|
869
|
+
return 2 /* Task.Stop */;
|
|
870
870
|
}
|
|
871
871
|
function start$w(timer) {
|
|
872
|
-
tracker[key(timer)] = { start: performance.now(), calls: 0, yield: 30 /* LongTask */ };
|
|
872
|
+
tracker[key(timer)] = { start: performance.now(), calls: 0, yield: 30 /* Setting.LongTask */ };
|
|
873
873
|
}
|
|
874
874
|
function restart$2(timer) {
|
|
875
875
|
var id = key(timer);
|
|
@@ -886,11 +886,11 @@ function stop$t(timer) {
|
|
|
886
886
|
var id = key(timer);
|
|
887
887
|
var duration = end - tracker[id].start;
|
|
888
888
|
sum(timer.cost, duration);
|
|
889
|
-
count$1(5 /* InvokeCount */);
|
|
889
|
+
count$1(5 /* Metric.InvokeCount */);
|
|
890
890
|
// For the first execution, which is synchronous, time is automatically counted towards TotalDuration.
|
|
891
891
|
// However, for subsequent asynchronous runs, we need to manually update TotalDuration metric.
|
|
892
892
|
if (tracker[id].calls > 0) {
|
|
893
|
-
sum(4 /* TotalCost */, duration);
|
|
893
|
+
sum(4 /* Metric.TotalCost */, duration);
|
|
894
894
|
}
|
|
895
895
|
}
|
|
896
896
|
function suspend$1(timer) {
|
|
@@ -911,13 +911,13 @@ function suspend$1(timer) {
|
|
|
911
911
|
case 2:
|
|
912
912
|
// After we are done with suspending task, ensure that we are still operating in the right context
|
|
913
913
|
// If the task is still being tracked, continue running the task, otherwise ask caller to stop execution
|
|
914
|
-
return [2 /*return*/, id in tracker ? 1 /* Run */ : 2 /* Stop */];
|
|
914
|
+
return [2 /*return*/, id in tracker ? 1 /* Task.Run */ : 2 /* Task.Stop */];
|
|
915
915
|
}
|
|
916
916
|
});
|
|
917
917
|
});
|
|
918
918
|
}
|
|
919
919
|
function key(timer) {
|
|
920
|
-
return timer.id
|
|
920
|
+
return "".concat(timer.id, ".").concat(timer.cost);
|
|
921
921
|
}
|
|
922
922
|
function wait() {
|
|
923
923
|
return __awaiter(this, void 0, void 0, function () {
|
|
@@ -955,14 +955,14 @@ function requestIdleCallbackPolyfill(callback, options) {
|
|
|
955
955
|
var currentTime = performance.now();
|
|
956
956
|
var elapsed = currentTime - startTime;
|
|
957
957
|
var duration = currentTime - event.data;
|
|
958
|
-
if (duration > 30 /* LongTask */ && elapsed < options.timeout) {
|
|
958
|
+
if (duration > 30 /* Setting.LongTask */ && elapsed < options.timeout) {
|
|
959
959
|
requestAnimationFrame(function () { outgoing.postMessage(currentTime); });
|
|
960
960
|
}
|
|
961
961
|
else {
|
|
962
962
|
var didTimeout_1 = elapsed > options.timeout;
|
|
963
963
|
callback({
|
|
964
964
|
didTimeout: didTimeout_1,
|
|
965
|
-
timeRemaining: function () { return didTimeout_1 ? 30 /* LongTask */ : Math.max(0, 30 /* LongTask */ - duration); }
|
|
965
|
+
timeRemaining: function () { return didTimeout_1 ? 30 /* Setting.LongTask */ : Math.max(0, 30 /* Setting.LongTask */ - duration); }
|
|
966
966
|
});
|
|
967
967
|
}
|
|
968
968
|
};
|
|
@@ -983,7 +983,7 @@ function tokenize (tokens) {
|
|
|
983
983
|
var reference = null;
|
|
984
984
|
for (var i = 0; i < tokens.length; i++) {
|
|
985
985
|
// Only optimize for string values
|
|
986
|
-
if (typeof tokens[i] === "string" /* String */) {
|
|
986
|
+
if (typeof tokens[i] === "string" /* Constant.String */) {
|
|
987
987
|
var token = tokens[i];
|
|
988
988
|
var index = lookup[token] || -1;
|
|
989
989
|
if (index >= 0) {
|
|
@@ -1025,10 +1025,10 @@ function encode$4 (type, timer, ts) {
|
|
|
1025
1025
|
tokens = [eventTime, type];
|
|
1026
1026
|
_a = type;
|
|
1027
1027
|
switch (_a) {
|
|
1028
|
-
case 8 /* Document */: return [3 /*break*/, 1];
|
|
1029
|
-
case 7 /* Region */: return [3 /*break*/, 2];
|
|
1030
|
-
case 5 /* Discover */: return [3 /*break*/, 3];
|
|
1031
|
-
case 6 /* Mutation */: return [3 /*break*/, 3];
|
|
1028
|
+
case 8 /* Event.Document */: return [3 /*break*/, 1];
|
|
1029
|
+
case 7 /* Event.Region */: return [3 /*break*/, 2];
|
|
1030
|
+
case 5 /* Event.Discover */: return [3 /*break*/, 3];
|
|
1031
|
+
case 6 /* Event.Mutation */: return [3 /*break*/, 3];
|
|
1032
1032
|
}
|
|
1033
1033
|
return [3 /*break*/, 10];
|
|
1034
1034
|
case 1:
|
|
@@ -1041,7 +1041,7 @@ function encode$4 (type, timer, ts) {
|
|
|
1041
1041
|
case 2:
|
|
1042
1042
|
for (_i = 0, _b = state$1; _i < _b.length; _i++) {
|
|
1043
1043
|
r = _b[_i];
|
|
1044
|
-
tokens = [r.time, 7 /* Region */];
|
|
1044
|
+
tokens = [r.time, 7 /* Event.Region */];
|
|
1045
1045
|
tokens.push(r.data.id);
|
|
1046
1046
|
tokens.push(r.data.interaction);
|
|
1047
1047
|
tokens.push(r.data.visibility);
|
|
@@ -1052,7 +1052,7 @@ function encode$4 (type, timer, ts) {
|
|
|
1052
1052
|
return [3 /*break*/, 10];
|
|
1053
1053
|
case 3:
|
|
1054
1054
|
// Check if we are operating within the context of the current page
|
|
1055
|
-
if (state$8(timer) === 2 /* Stop */) {
|
|
1055
|
+
if (state$8(timer) === 2 /* Task.Stop */) {
|
|
1056
1056
|
return [3 /*break*/, 10];
|
|
1057
1057
|
}
|
|
1058
1058
|
values = updates$2();
|
|
@@ -1063,13 +1063,13 @@ function encode$4 (type, timer, ts) {
|
|
|
1063
1063
|
if (!(_c < values_1.length)) return [3 /*break*/, 8];
|
|
1064
1064
|
value = values_1[_c];
|
|
1065
1065
|
state = state$8(timer);
|
|
1066
|
-
if (!(state === 0 /* Wait */)) return [3 /*break*/, 6];
|
|
1066
|
+
if (!(state === 0 /* Task.Wait */)) return [3 /*break*/, 6];
|
|
1067
1067
|
return [4 /*yield*/, suspend$1(timer)];
|
|
1068
1068
|
case 5:
|
|
1069
1069
|
state = _e.sent();
|
|
1070
1070
|
_e.label = 6;
|
|
1071
1071
|
case 6:
|
|
1072
|
-
if (state === 2 /* Stop */) {
|
|
1072
|
+
if (state === 2 /* Task.Stop */) {
|
|
1073
1073
|
return [3 /*break*/, 8];
|
|
1074
1074
|
}
|
|
1075
1075
|
data = value.data;
|
|
@@ -1092,9 +1092,9 @@ function encode$4 (type, timer, ts) {
|
|
|
1092
1092
|
if (value.previous && active) {
|
|
1093
1093
|
tokens.push(value.previous);
|
|
1094
1094
|
}
|
|
1095
|
-
tokens.push(suspend ? "*M" /* SuspendMutationTag */ : data[key]);
|
|
1095
|
+
tokens.push(suspend ? "*M" /* Constant.SuspendMutationTag */ : data[key]);
|
|
1096
1096
|
if (box && box.length === 2) {
|
|
1097
|
-
tokens.push(""
|
|
1097
|
+
tokens.push("".concat("#" /* Constant.Box */).concat(str$1(box[0]), ".").concat(str$1(box[1])));
|
|
1098
1098
|
}
|
|
1099
1099
|
break;
|
|
1100
1100
|
case "attributes":
|
|
@@ -1116,7 +1116,7 @@ function encode$4 (type, timer, ts) {
|
|
|
1116
1116
|
_c++;
|
|
1117
1117
|
return [3 /*break*/, 4];
|
|
1118
1118
|
case 8:
|
|
1119
|
-
if (type === 6 /* Mutation */) {
|
|
1119
|
+
if (type === 6 /* Event.Mutation */) {
|
|
1120
1120
|
activity(eventTime);
|
|
1121
1121
|
}
|
|
1122
1122
|
queue(tokenize(tokens), !config$1.lean);
|
|
@@ -1129,13 +1129,13 @@ function encode$4 (type, timer, ts) {
|
|
|
1129
1129
|
}
|
|
1130
1130
|
function shouldMangle(value) {
|
|
1131
1131
|
var privacy = value.metadata.privacy;
|
|
1132
|
-
return value.data.tag === "*T" /* TextTag */ && !(privacy === 0 /* None */ || privacy === 1 /* Sensitive */);
|
|
1132
|
+
return value.data.tag === "*T" /* Constant.TextTag */ && !(privacy === 0 /* Privacy.None */ || privacy === 1 /* Privacy.Sensitive */);
|
|
1133
1133
|
}
|
|
1134
1134
|
function size$1(value) {
|
|
1135
1135
|
if (value.metadata.size !== null && value.metadata.size.length === 0) {
|
|
1136
1136
|
var img = getNode(value.id);
|
|
1137
1137
|
if (img) {
|
|
1138
|
-
return [Math.floor(img.offsetWidth * 100 /* BoxPrecision */), Math.floor(img.offsetHeight * 100 /* BoxPrecision */)];
|
|
1138
|
+
return [Math.floor(img.offsetWidth * 100 /* Setting.BoxPrecision */), Math.floor(img.offsetHeight * 100 /* Setting.BoxPrecision */)];
|
|
1139
1139
|
}
|
|
1140
1140
|
}
|
|
1141
1141
|
return value.metadata.size;
|
|
@@ -1144,7 +1144,7 @@ function str$1(input) {
|
|
|
1144
1144
|
return input.toString(36);
|
|
1145
1145
|
}
|
|
1146
1146
|
function attribute(key, value, privacy) {
|
|
1147
|
-
return key
|
|
1147
|
+
return "".concat(key, "=").concat(scrub(value, key, privacy));
|
|
1148
1148
|
}
|
|
1149
1149
|
|
|
1150
1150
|
var data$c;
|
|
@@ -1175,7 +1175,7 @@ function compute$7() {
|
|
|
1175
1175
|
// Check that width or height has changed from before, and also that width & height are not null values
|
|
1176
1176
|
if ((data$c === null || width !== data$c.width || height !== data$c.height) && width !== null && height !== null) {
|
|
1177
1177
|
data$c = { width: width, height: height };
|
|
1178
|
-
encode$4(8 /* Document */);
|
|
1178
|
+
encode$4(8 /* Event.Document */);
|
|
1179
1179
|
}
|
|
1180
1180
|
}
|
|
1181
1181
|
function end() {
|
|
@@ -1204,7 +1204,7 @@ function start$u() {
|
|
|
1204
1204
|
reset$h();
|
|
1205
1205
|
}
|
|
1206
1206
|
function observe$b(root) {
|
|
1207
|
-
bind(root, "click", handler$3.bind(this, 9 /* Click */, root), true);
|
|
1207
|
+
bind(root, "click", handler$3.bind(this, 9 /* Event.Click */, root), true);
|
|
1208
1208
|
}
|
|
1209
1209
|
function handler$3(event, root, evt) {
|
|
1210
1210
|
var frame = iframe(root);
|
|
@@ -1230,8 +1230,8 @@ function handler$3(event, root, evt) {
|
|
|
1230
1230
|
x = Math.round(l.x + (l.w / 2));
|
|
1231
1231
|
y = Math.round(l.y + (l.h / 2));
|
|
1232
1232
|
}
|
|
1233
|
-
var eX = l ? Math.max(Math.floor(((x - l.x) / l.w) * 32767 /* ClickPrecision */), 0) : 0;
|
|
1234
|
-
var eY = l ? Math.max(Math.floor(((y - l.y) / l.h) * 32767 /* ClickPrecision */), 0) : 0;
|
|
1233
|
+
var eX = l ? Math.max(Math.floor(((x - l.x) / l.w) * 32767 /* Setting.ClickPrecision */), 0) : 0;
|
|
1234
|
+
var eY = l ? Math.max(Math.floor(((y - l.y) / l.h) * 32767 /* Setting.ClickPrecision */), 0) : 0;
|
|
1235
1235
|
// Check for null values before processing this event
|
|
1236
1236
|
if (x !== null && y !== null) {
|
|
1237
1237
|
state$7.push({
|
|
@@ -1249,7 +1249,7 @@ function handler$3(event, root, evt) {
|
|
|
1249
1249
|
text: text(t),
|
|
1250
1250
|
link: a ? a.href : null,
|
|
1251
1251
|
hash: null,
|
|
1252
|
-
trust: evt.isTrusted ? 1 /* True */ : 0 /* False */
|
|
1252
|
+
trust: evt.isTrusted ? 1 /* BooleanFlag.True */ : 0 /* BooleanFlag.False */
|
|
1253
1253
|
}
|
|
1254
1254
|
});
|
|
1255
1255
|
schedule$1(encode$3.bind(this, event));
|
|
@@ -1264,7 +1264,7 @@ function text(element) {
|
|
|
1264
1264
|
// Trim any spaces at the beginning or at the end of string
|
|
1265
1265
|
// Also, replace multiple occurrence of space characters with a single white space
|
|
1266
1266
|
// Finally, send only first few characters as specified by the Setting
|
|
1267
|
-
output = t.trim().replace(/\s+/g, " " /* Space */).substr(0, 25 /* ClickText */);
|
|
1267
|
+
output = t.trim().replace(/\s+/g, " " /* Constant.Space */).substr(0, 25 /* Setting.ClickText */);
|
|
1268
1268
|
}
|
|
1269
1269
|
}
|
|
1270
1270
|
return output;
|
|
@@ -1273,10 +1273,10 @@ function reaction(element) {
|
|
|
1273
1273
|
if (element.nodeType === Node.ELEMENT_NODE) {
|
|
1274
1274
|
var tag = element.tagName.toLowerCase();
|
|
1275
1275
|
if (UserInputTags.indexOf(tag) >= 0) {
|
|
1276
|
-
return 0 /* False */;
|
|
1276
|
+
return 0 /* BooleanFlag.False */;
|
|
1277
1277
|
}
|
|
1278
1278
|
}
|
|
1279
|
-
return 1 /* True */;
|
|
1279
|
+
return 1 /* BooleanFlag.True */;
|
|
1280
1280
|
}
|
|
1281
1281
|
function layout$1(element) {
|
|
1282
1282
|
var box = null;
|
|
@@ -1300,14 +1300,14 @@ function layout$1(element) {
|
|
|
1300
1300
|
return box;
|
|
1301
1301
|
}
|
|
1302
1302
|
function context(a) {
|
|
1303
|
-
if (a && a.hasAttribute("target" /* Target */)) {
|
|
1304
|
-
switch (a.getAttribute("target" /* Target */)) {
|
|
1305
|
-
case "_blank" /* Blank */: return 1 /* Blank */;
|
|
1306
|
-
case "_parent" /* Parent */: return 2 /* Parent */;
|
|
1307
|
-
case "_top" /* Top */: return 3 /* Top */;
|
|
1303
|
+
if (a && a.hasAttribute("target" /* Constant.Target */)) {
|
|
1304
|
+
switch (a.getAttribute("target" /* Constant.Target */)) {
|
|
1305
|
+
case "_blank" /* Constant.Blank */: return 1 /* BrowsingContext.Blank */;
|
|
1306
|
+
case "_parent" /* Constant.Parent */: return 2 /* BrowsingContext.Parent */;
|
|
1307
|
+
case "_top" /* Constant.Top */: return 3 /* BrowsingContext.Top */;
|
|
1308
1308
|
}
|
|
1309
1309
|
}
|
|
1310
|
-
return 0 /* Self */;
|
|
1310
|
+
return 0 /* BrowsingContext.Self */;
|
|
1311
1311
|
}
|
|
1312
1312
|
function reset$h() {
|
|
1313
1313
|
state$7 = [];
|
|
@@ -1321,13 +1321,13 @@ function start$t() {
|
|
|
1321
1321
|
reset$g();
|
|
1322
1322
|
}
|
|
1323
1323
|
function observe$a(root) {
|
|
1324
|
-
bind(root, "cut", recompute$7.bind(this, 0 /* Cut */), true);
|
|
1325
|
-
bind(root, "copy", recompute$7.bind(this, 1 /* Copy */), true);
|
|
1326
|
-
bind(root, "paste", recompute$7.bind(this, 2 /* Paste */), true);
|
|
1324
|
+
bind(root, "cut", recompute$7.bind(this, 0 /* Clipboard.Cut */), true);
|
|
1325
|
+
bind(root, "copy", recompute$7.bind(this, 1 /* Clipboard.Copy */), true);
|
|
1326
|
+
bind(root, "paste", recompute$7.bind(this, 2 /* Clipboard.Paste */), true);
|
|
1327
1327
|
}
|
|
1328
1328
|
function recompute$7(action, evt) {
|
|
1329
|
-
state$6.push({ time: time(), event: 38 /* Clipboard */, data: { target: target(evt), action: action } });
|
|
1330
|
-
schedule$1(encode$3.bind(this, 38 /* Clipboard */));
|
|
1329
|
+
state$6.push({ time: time(), event: 38 /* Event.Clipboard */, data: { target: target(evt), action: action } });
|
|
1330
|
+
schedule$1(encode$3.bind(this, 38 /* Event.Clipboard */));
|
|
1331
1331
|
}
|
|
1332
1332
|
function reset$g() {
|
|
1333
1333
|
state$6 = [];
|
|
@@ -1360,9 +1360,9 @@ function recompute$6(evt) {
|
|
|
1360
1360
|
if (state$5.length > 0 && (state$5[state$5.length - 1].data.target === data.target)) {
|
|
1361
1361
|
state$5.pop();
|
|
1362
1362
|
}
|
|
1363
|
-
state$5.push({ time: time(), event: 27 /* Input */, data: data });
|
|
1363
|
+
state$5.push({ time: time(), event: 27 /* Event.Input */, data: data });
|
|
1364
1364
|
clearTimeout(timeout$5);
|
|
1365
|
-
timeout$5 = setTimeout(process$6, 500 /* LookAhead */, 27 /* Input */);
|
|
1365
|
+
timeout$5 = setTimeout(process$6, 500 /* Setting.LookAhead */, 27 /* Event.Input */);
|
|
1366
1366
|
}
|
|
1367
1367
|
}
|
|
1368
1368
|
function process$6(event) {
|
|
@@ -1382,15 +1382,15 @@ function start$r() {
|
|
|
1382
1382
|
reset$e();
|
|
1383
1383
|
}
|
|
1384
1384
|
function observe$8(root) {
|
|
1385
|
-
bind(root, "mousedown", mouse.bind(this, 13 /* MouseDown */, root), true);
|
|
1386
|
-
bind(root, "mouseup", mouse.bind(this, 14 /* MouseUp */, root), true);
|
|
1387
|
-
bind(root, "mousemove", mouse.bind(this, 12 /* MouseMove */, root), true);
|
|
1388
|
-
bind(root, "mousewheel", mouse.bind(this, 15 /* MouseWheel */, root), true);
|
|
1389
|
-
bind(root, "dblclick", mouse.bind(this, 16 /* DoubleClick */, root), true);
|
|
1390
|
-
bind(root, "touchstart", touch.bind(this, 17 /* TouchStart */, root), true);
|
|
1391
|
-
bind(root, "touchend", touch.bind(this, 18 /* TouchEnd */, root), true);
|
|
1392
|
-
bind(root, "touchmove", touch.bind(this, 19 /* TouchMove */, root), true);
|
|
1393
|
-
bind(root, "touchcancel", touch.bind(this, 20 /* TouchCancel */, root), true);
|
|
1385
|
+
bind(root, "mousedown", mouse.bind(this, 13 /* Event.MouseDown */, root), true);
|
|
1386
|
+
bind(root, "mouseup", mouse.bind(this, 14 /* Event.MouseUp */, root), true);
|
|
1387
|
+
bind(root, "mousemove", mouse.bind(this, 12 /* Event.MouseMove */, root), true);
|
|
1388
|
+
bind(root, "mousewheel", mouse.bind(this, 15 /* Event.MouseWheel */, root), true);
|
|
1389
|
+
bind(root, "dblclick", mouse.bind(this, 16 /* Event.DoubleClick */, root), true);
|
|
1390
|
+
bind(root, "touchstart", touch.bind(this, 17 /* Event.TouchStart */, root), true);
|
|
1391
|
+
bind(root, "touchend", touch.bind(this, 18 /* Event.TouchEnd */, root), true);
|
|
1392
|
+
bind(root, "touchmove", touch.bind(this, 19 /* Event.TouchMove */, root), true);
|
|
1393
|
+
bind(root, "touchcancel", touch.bind(this, 20 /* Event.TouchCancel */, root), true);
|
|
1394
1394
|
}
|
|
1395
1395
|
function mouse(event, root, evt) {
|
|
1396
1396
|
var frame = iframe(root);
|
|
@@ -1429,9 +1429,9 @@ function touch(event, root, evt) {
|
|
|
1429
1429
|
}
|
|
1430
1430
|
function handler$2(current) {
|
|
1431
1431
|
switch (current.event) {
|
|
1432
|
-
case 12 /* MouseMove */:
|
|
1433
|
-
case 15 /* MouseWheel */:
|
|
1434
|
-
case 19 /* TouchMove */:
|
|
1432
|
+
case 12 /* Event.MouseMove */:
|
|
1433
|
+
case 15 /* Event.MouseWheel */:
|
|
1434
|
+
case 19 /* Event.TouchMove */:
|
|
1435
1435
|
var length_1 = state$4.length;
|
|
1436
1436
|
var last = length_1 > 1 ? state$4[length_1 - 2] : null;
|
|
1437
1437
|
if (last && similar$1(last, current)) {
|
|
@@ -1439,7 +1439,7 @@ function handler$2(current) {
|
|
|
1439
1439
|
}
|
|
1440
1440
|
state$4.push(current);
|
|
1441
1441
|
clearTimeout(timeout$4);
|
|
1442
|
-
timeout$4 = setTimeout(process$5, 500 /* LookAhead */, current.event);
|
|
1442
|
+
timeout$4 = setTimeout(process$5, 500 /* Setting.LookAhead */, current.event);
|
|
1443
1443
|
break;
|
|
1444
1444
|
default:
|
|
1445
1445
|
state$4.push(current);
|
|
@@ -1459,7 +1459,7 @@ function similar$1(last, current) {
|
|
|
1459
1459
|
var distance = Math.sqrt(dx * dx + dy * dy);
|
|
1460
1460
|
var gap = current.time - last.time;
|
|
1461
1461
|
var match = current.data.target === last.data.target;
|
|
1462
|
-
return current.event === last.event && match && distance < 20 /* Distance */ && gap < 25 /* Interval */;
|
|
1462
|
+
return current.event === last.event && match && distance < 20 /* Setting.Distance */ && gap < 25 /* Setting.Interval */;
|
|
1463
1463
|
}
|
|
1464
1464
|
function stop$p() {
|
|
1465
1465
|
clearTimeout(timeout$4);
|
|
@@ -1482,7 +1482,7 @@ function recompute$5() {
|
|
|
1482
1482
|
width: de && "clientWidth" in de ? Math.min(de.clientWidth, window.innerWidth) : window.innerWidth,
|
|
1483
1483
|
height: de && "clientHeight" in de ? Math.min(de.clientHeight, window.innerHeight) : window.innerHeight,
|
|
1484
1484
|
};
|
|
1485
|
-
encode$3(11 /* Resize */);
|
|
1485
|
+
encode$3(11 /* Event.Resize */);
|
|
1486
1486
|
}
|
|
1487
1487
|
function reset$d() {
|
|
1488
1488
|
data$b = null;
|
|
@@ -1518,7 +1518,7 @@ function recompute$4(event) {
|
|
|
1518
1518
|
// And, if for some reason that is not available, fall back to looking up scrollTop on document.documentElement.
|
|
1519
1519
|
var x = element === de && "pageXOffset" in w ? Math.round(w.pageXOffset) : Math.round(element.scrollLeft);
|
|
1520
1520
|
var y = element === de && "pageYOffset" in w ? Math.round(w.pageYOffset) : Math.round(element.scrollTop);
|
|
1521
|
-
var current = { time: time(), event: 10 /* Scroll */, data: { target: element, x: x, y: y } };
|
|
1521
|
+
var current = { time: time(), event: 10 /* Event.Scroll */, data: { target: element, x: x, y: y } };
|
|
1522
1522
|
// We don't send any scroll events if this is the first event and the current position is top (0,0)
|
|
1523
1523
|
if ((event === null && x === 0 && y === 0) || (x === null || y === null)) {
|
|
1524
1524
|
return;
|
|
@@ -1530,7 +1530,7 @@ function recompute$4(event) {
|
|
|
1530
1530
|
}
|
|
1531
1531
|
state$3.push(current);
|
|
1532
1532
|
clearTimeout(timeout$3);
|
|
1533
|
-
timeout$3 = setTimeout(process$4, 500 /* LookAhead */, 10 /* Scroll */);
|
|
1533
|
+
timeout$3 = setTimeout(process$4, 500 /* Setting.LookAhead */, 10 /* Event.Scroll */);
|
|
1534
1534
|
}
|
|
1535
1535
|
function reset$c() {
|
|
1536
1536
|
state$3 = [];
|
|
@@ -1541,7 +1541,7 @@ function process$4(event) {
|
|
|
1541
1541
|
function similar(last, current) {
|
|
1542
1542
|
var dx = last.data.x - current.data.x;
|
|
1543
1543
|
var dy = last.data.y - current.data.y;
|
|
1544
|
-
return (dx * dx + dy * dy < 20 /* Distance */ * 20 /* Distance */) && (current.time - last.time < 25 /* Interval */);
|
|
1544
|
+
return (dx * dx + dy * dy < 20 /* Setting.Distance */ * 20 /* Setting.Distance */) && (current.time - last.time < 25 /* Setting.Interval */);
|
|
1545
1545
|
}
|
|
1546
1546
|
function stop$n() {
|
|
1547
1547
|
clearTimeout(timeout$3);
|
|
@@ -1576,7 +1576,7 @@ function recompute$3(root) {
|
|
|
1576
1576
|
var startNode = data$a.start ? data$a.start : null;
|
|
1577
1577
|
if (previous !== null && data$a.start !== null && startNode !== current.anchorNode) {
|
|
1578
1578
|
clearTimeout(timeout$2);
|
|
1579
|
-
process$3(21 /* Selection */);
|
|
1579
|
+
process$3(21 /* Event.Selection */);
|
|
1580
1580
|
}
|
|
1581
1581
|
data$a = {
|
|
1582
1582
|
start: current.anchorNode,
|
|
@@ -1586,7 +1586,7 @@ function recompute$3(root) {
|
|
|
1586
1586
|
};
|
|
1587
1587
|
previous = current;
|
|
1588
1588
|
clearTimeout(timeout$2);
|
|
1589
|
-
timeout$2 = setTimeout(process$3, 500 /* LookAhead */, 21 /* Selection */);
|
|
1589
|
+
timeout$2 = setTimeout(process$3, 500 /* Setting.LookAhead */, 21 /* Event.Selection */);
|
|
1590
1590
|
}
|
|
1591
1591
|
function process$3(event) {
|
|
1592
1592
|
schedule$1(encode$3.bind(this, event));
|
|
@@ -1608,8 +1608,8 @@ function observe$5(root) {
|
|
|
1608
1608
|
bind(root, "submit", recompute$2, true);
|
|
1609
1609
|
}
|
|
1610
1610
|
function recompute$2(evt) {
|
|
1611
|
-
state$2.push({ time: time(), event: 39 /* Submit */, data: { target: target(evt) } });
|
|
1612
|
-
schedule$1(encode$3.bind(this, 39 /* Submit */));
|
|
1611
|
+
state$2.push({ time: time(), event: 39 /* Event.Submit */, data: { target: target(evt) } });
|
|
1612
|
+
schedule$1(encode$3.bind(this, 39 /* Event.Submit */));
|
|
1613
1613
|
}
|
|
1614
1614
|
function reset$a() {
|
|
1615
1615
|
state$2 = [];
|
|
@@ -1624,7 +1624,7 @@ function start$m() {
|
|
|
1624
1624
|
}
|
|
1625
1625
|
function recompute$1(evt) {
|
|
1626
1626
|
data$9 = { name: evt.type };
|
|
1627
|
-
encode$3(26 /* Unload */);
|
|
1627
|
+
encode$3(26 /* Event.Unload */);
|
|
1628
1628
|
stop();
|
|
1629
1629
|
}
|
|
1630
1630
|
function reset$9() {
|
|
@@ -1641,7 +1641,7 @@ function start$l() {
|
|
|
1641
1641
|
}
|
|
1642
1642
|
function recompute() {
|
|
1643
1643
|
data$8 = { visible: "visibilityState" in document ? document.visibilityState : "default" };
|
|
1644
|
-
encode$3(28 /* Visibility */);
|
|
1644
|
+
encode$3(28 /* Event.Visibility */);
|
|
1645
1645
|
}
|
|
1646
1646
|
function reset$8() {
|
|
1647
1647
|
data$8 = null;
|
|
@@ -1703,51 +1703,51 @@ function ld(json) {
|
|
|
1703
1703
|
for (var _i = 0, _a = Object.keys(json); _i < _a.length; _i++) {
|
|
1704
1704
|
var key = _a[_i];
|
|
1705
1705
|
var value = json[key];
|
|
1706
|
-
if (key === "@type" /* Type */ && typeof value === "string") {
|
|
1706
|
+
if (key === "@type" /* JsonLD.Type */ && typeof value === "string") {
|
|
1707
1707
|
value = value.toLowerCase();
|
|
1708
1708
|
/* Normalizations */
|
|
1709
|
-
value = value.indexOf("article" /* Article */) >= 0 || value.indexOf("posting" /* Posting */) >= 0 ? "article" /* Article */ : value;
|
|
1709
|
+
value = value.indexOf("article" /* JsonLD.Article */) >= 0 || value.indexOf("posting" /* JsonLD.Posting */) >= 0 ? "article" /* JsonLD.Article */ : value;
|
|
1710
1710
|
switch (value) {
|
|
1711
|
-
case "article" /* Article */:
|
|
1712
|
-
case "recipe" /* Recipe */:
|
|
1713
|
-
log(5 /* SchemaType */, json[key]);
|
|
1714
|
-
log(8 /* AuthorName */, json["creator" /* Creator */]);
|
|
1715
|
-
log(18 /* Headline */, json["headline" /* Headline */]);
|
|
1711
|
+
case "article" /* JsonLD.Article */:
|
|
1712
|
+
case "recipe" /* JsonLD.Recipe */:
|
|
1713
|
+
log(5 /* Dimension.SchemaType */, json[key]);
|
|
1714
|
+
log(8 /* Dimension.AuthorName */, json["creator" /* JsonLD.Creator */]);
|
|
1715
|
+
log(18 /* Dimension.Headline */, json["headline" /* JsonLD.Headline */]);
|
|
1716
1716
|
break;
|
|
1717
|
-
case "product" /* Product */:
|
|
1718
|
-
log(5 /* SchemaType */, json[key]);
|
|
1719
|
-
log(10 /* ProductName */, json["name" /* Name */]);
|
|
1720
|
-
log(12 /* ProductSku */, json["sku" /* Sku */]);
|
|
1721
|
-
if (json["brand" /* Brand */]) {
|
|
1722
|
-
log(6 /* ProductBrand */, json["brand" /* Brand */]["name" /* Name */]);
|
|
1717
|
+
case "product" /* JsonLD.Product */:
|
|
1718
|
+
log(5 /* Dimension.SchemaType */, json[key]);
|
|
1719
|
+
log(10 /* Dimension.ProductName */, json["name" /* JsonLD.Name */]);
|
|
1720
|
+
log(12 /* Dimension.ProductSku */, json["sku" /* JsonLD.Sku */]);
|
|
1721
|
+
if (json["brand" /* JsonLD.Brand */]) {
|
|
1722
|
+
log(6 /* Dimension.ProductBrand */, json["brand" /* JsonLD.Brand */]["name" /* JsonLD.Name */]);
|
|
1723
1723
|
}
|
|
1724
1724
|
break;
|
|
1725
|
-
case "aggregaterating" /* AggregateRating */:
|
|
1726
|
-
if (json["ratingValue" /* RatingValue */]) {
|
|
1727
|
-
max(11 /* RatingValue */, num$1(json["ratingValue" /* RatingValue */], 100 /* RatingScale */));
|
|
1728
|
-
max(18 /* BestRating */, num$1(json["bestRating" /* BestRating */]));
|
|
1729
|
-
max(19 /* WorstRating */, num$1(json["worstRating" /* WorstRating */]));
|
|
1725
|
+
case "aggregaterating" /* JsonLD.AggregateRating */:
|
|
1726
|
+
if (json["ratingValue" /* JsonLD.RatingValue */]) {
|
|
1727
|
+
max(11 /* Metric.RatingValue */, num$1(json["ratingValue" /* JsonLD.RatingValue */], 100 /* Setting.RatingScale */));
|
|
1728
|
+
max(18 /* Metric.BestRating */, num$1(json["bestRating" /* JsonLD.BestRating */]));
|
|
1729
|
+
max(19 /* Metric.WorstRating */, num$1(json["worstRating" /* JsonLD.WorstRating */]));
|
|
1730
1730
|
}
|
|
1731
|
-
max(12 /* RatingCount */, num$1(json["ratingCount" /* RatingCount */]));
|
|
1732
|
-
max(17 /* ReviewCount */, num$1(json["reviewCount" /* ReviewCount */]));
|
|
1731
|
+
max(12 /* Metric.RatingCount */, num$1(json["ratingCount" /* JsonLD.RatingCount */]));
|
|
1732
|
+
max(17 /* Metric.ReviewCount */, num$1(json["reviewCount" /* JsonLD.ReviewCount */]));
|
|
1733
1733
|
break;
|
|
1734
|
-
case "person" /* Author */:
|
|
1735
|
-
log(8 /* AuthorName */, json["name" /* Name */]);
|
|
1734
|
+
case "person" /* JsonLD.Author */:
|
|
1735
|
+
log(8 /* Dimension.AuthorName */, json["name" /* JsonLD.Name */]);
|
|
1736
1736
|
break;
|
|
1737
|
-
case "offer" /* Offer */:
|
|
1738
|
-
log(7 /* ProductAvailability */, json["availability" /* Availability */]);
|
|
1739
|
-
log(14 /* ProductCondition */, json["itemCondition" /* ItemCondition */]);
|
|
1740
|
-
log(13 /* ProductCurrency */, json["priceCurrency" /* PriceCurrency */]);
|
|
1741
|
-
log(12 /* ProductSku */, json["sku" /* Sku */]);
|
|
1742
|
-
max(13 /* ProductPrice */, num$1(json["price" /* Price */]));
|
|
1737
|
+
case "offer" /* JsonLD.Offer */:
|
|
1738
|
+
log(7 /* Dimension.ProductAvailability */, json["availability" /* JsonLD.Availability */]);
|
|
1739
|
+
log(14 /* Dimension.ProductCondition */, json["itemCondition" /* JsonLD.ItemCondition */]);
|
|
1740
|
+
log(13 /* Dimension.ProductCurrency */, json["priceCurrency" /* JsonLD.PriceCurrency */]);
|
|
1741
|
+
log(12 /* Dimension.ProductSku */, json["sku" /* JsonLD.Sku */]);
|
|
1742
|
+
max(13 /* Metric.ProductPrice */, num$1(json["price" /* JsonLD.Price */]));
|
|
1743
1743
|
break;
|
|
1744
|
-
case "brand" /* Brand */:
|
|
1745
|
-
log(6 /* ProductBrand */, json["name" /* Name */]);
|
|
1744
|
+
case "brand" /* JsonLD.Brand */:
|
|
1745
|
+
log(6 /* Dimension.ProductBrand */, json["name" /* JsonLD.Name */]);
|
|
1746
1746
|
break;
|
|
1747
1747
|
}
|
|
1748
1748
|
}
|
|
1749
1749
|
// Continue parsing nested objects
|
|
1750
|
-
if (value !== null && typeof (value) === "object" /* Object */) {
|
|
1750
|
+
if (value !== null && typeof (value) === "object" /* Constant.Object */) {
|
|
1751
1751
|
ld(value);
|
|
1752
1752
|
}
|
|
1753
1753
|
}
|
|
@@ -1756,8 +1756,8 @@ function num$1(input, scale) {
|
|
|
1756
1756
|
if (scale === void 0) { scale = 1; }
|
|
1757
1757
|
if (input !== null) {
|
|
1758
1758
|
switch (typeof input) {
|
|
1759
|
-
case "number" /* Number */: return Math.round(input * scale);
|
|
1760
|
-
case "string" /* String */: return Math.round(parseFloat(input.replace(digitsRegex, "" /* Empty */)) * scale);
|
|
1759
|
+
case "number" /* Constant.Number */: return Math.round(input * scale);
|
|
1760
|
+
case "string" /* Constant.String */: return Math.round(parseFloat(input.replace(digitsRegex, "" /* Constant.Empty */)) * scale);
|
|
1761
1761
|
}
|
|
1762
1762
|
}
|
|
1763
1763
|
return null;
|
|
@@ -1768,11 +1768,11 @@ var newlineRegex = /[\r\n]+/g;
|
|
|
1768
1768
|
function processNode (node, source) {
|
|
1769
1769
|
var child = null;
|
|
1770
1770
|
// Do not track this change if we are attempting to remove a node before discovering it
|
|
1771
|
-
if (source === 2 /* ChildListRemove */ && has(node) === false) {
|
|
1771
|
+
if (source === 2 /* Source.ChildListRemove */ && has(node) === false) {
|
|
1772
1772
|
return child;
|
|
1773
1773
|
}
|
|
1774
1774
|
// Special handling for text nodes that belong to style nodes
|
|
1775
|
-
if (source !== 0 /* Discover */ &&
|
|
1775
|
+
if (source !== 0 /* Source.Discover */ &&
|
|
1776
1776
|
node.nodeType === Node.TEXT_NODE &&
|
|
1777
1777
|
node.parentElement &&
|
|
1778
1778
|
node.parentElement.tagName === "STYLE") {
|
|
@@ -1785,10 +1785,10 @@ function processNode (node, source) {
|
|
|
1785
1785
|
switch (node.nodeType) {
|
|
1786
1786
|
case Node.DOCUMENT_TYPE_NODE:
|
|
1787
1787
|
parent = insideFrame && node.parentNode ? iframe(node.parentNode) : parent;
|
|
1788
|
-
var docTypePrefix = insideFrame ? "iframe:" /* IFramePrefix */ : "" /* Empty */;
|
|
1788
|
+
var docTypePrefix = insideFrame ? "iframe:" /* Constant.IFramePrefix */ : "" /* Constant.Empty */;
|
|
1789
1789
|
var doctype = node;
|
|
1790
1790
|
var docAttributes = { name: doctype.name, publicId: doctype.publicId, systemId: doctype.systemId };
|
|
1791
|
-
var docData = { tag: docTypePrefix + "*D" /* DocumentTag */, attributes: docAttributes };
|
|
1791
|
+
var docData = { tag: docTypePrefix + "*D" /* Constant.DocumentTag */, attributes: docAttributes };
|
|
1792
1792
|
dom[call](node, parent, docData, source);
|
|
1793
1793
|
break;
|
|
1794
1794
|
case Node.DOCUMENT_NODE:
|
|
@@ -1803,26 +1803,26 @@ function processNode (node, source) {
|
|
|
1803
1803
|
if (shadowRoot.host) {
|
|
1804
1804
|
parse$1(shadowRoot);
|
|
1805
1805
|
var type = typeof (shadowRoot.constructor);
|
|
1806
|
-
if (type === "function" /* Function */ && shadowRoot.constructor.toString().indexOf("[native code]" /* NativeCode */) >= 0) {
|
|
1806
|
+
if (type === "function" /* Constant.Function */ && shadowRoot.constructor.toString().indexOf("[native code]" /* Constant.NativeCode */) >= 0) {
|
|
1807
1807
|
observe$3(shadowRoot);
|
|
1808
1808
|
// See: https://wicg.github.io/construct-stylesheets/ for more details on adoptedStyleSheets.
|
|
1809
1809
|
// At the moment, we are only able to capture "open" shadow DOM nodes. If they are closed, they are not accessible.
|
|
1810
1810
|
// In future we may decide to proxy "attachShadow" call to gain access, but at the moment, we don't want to
|
|
1811
1811
|
// cause any unintended side effect to the page. We will re-evaluate after we gather more real world data on this.
|
|
1812
|
-
var style = "" /* Empty */;
|
|
1812
|
+
var style = "" /* Constant.Empty */;
|
|
1813
1813
|
var adoptedStyleSheets = "adoptedStyleSheets" in shadowRoot ? shadowRoot["adoptedStyleSheets"] : [];
|
|
1814
1814
|
for (var _i = 0, adoptedStyleSheets_1 = adoptedStyleSheets; _i < adoptedStyleSheets_1.length; _i++) {
|
|
1815
1815
|
var styleSheet = adoptedStyleSheets_1[_i];
|
|
1816
1816
|
style += getCssRules(styleSheet);
|
|
1817
1817
|
}
|
|
1818
|
-
var fragementData = { tag: "*S" /* ShadowDomTag */, attributes: { style: style } };
|
|
1818
|
+
var fragementData = { tag: "*S" /* Constant.ShadowDomTag */, attributes: { style: style } };
|
|
1819
1819
|
dom[call](node, shadowRoot.host, fragementData, source);
|
|
1820
1820
|
}
|
|
1821
1821
|
else {
|
|
1822
1822
|
// If the browser doesn't support shadow DOM natively, we detect that, and send appropriate tag back.
|
|
1823
1823
|
// The differentiation is important because we don't have to observe pollyfill shadow DOM nodes,
|
|
1824
1824
|
// the same way we observe real shadow DOM nodes (encapsulation provided by the browser).
|
|
1825
|
-
dom[call](node, shadowRoot.host, { tag: "*P" /* PolyfillShadowDomTag */, attributes: {} }, source);
|
|
1825
|
+
dom[call](node, shadowRoot.host, { tag: "*P" /* Constant.PolyfillShadowDomTag */, attributes: {} }, source);
|
|
1826
1826
|
}
|
|
1827
1827
|
}
|
|
1828
1828
|
break;
|
|
@@ -1835,7 +1835,7 @@ function processNode (node, source) {
|
|
|
1835
1835
|
// The only exception is when we receive a mutation to remove the text node, in that case
|
|
1836
1836
|
// parent will be null, but we can still process the node by checking it's an update call.
|
|
1837
1837
|
if (call === "update" || (parent && has(parent) && parent.tagName !== "STYLE")) {
|
|
1838
|
-
var textData = { tag: "*T" /* TextTag */, value: node.nodeValue };
|
|
1838
|
+
var textData = { tag: "*T" /* Constant.TextTag */, value: node.nodeValue };
|
|
1839
1839
|
dom[call](node, parent, textData, source);
|
|
1840
1840
|
}
|
|
1841
1841
|
break;
|
|
@@ -1847,20 +1847,20 @@ function processNode (node, source) {
|
|
|
1847
1847
|
// For correctness, we first look at parentElement and if it not present then fall back to using parentNode
|
|
1848
1848
|
parent = node.parentElement ? node.parentElement : (node.parentNode ? node.parentNode : null);
|
|
1849
1849
|
// If we encounter a node that is part of SVG namespace, prefix the tag with SVG_PREFIX
|
|
1850
|
-
if (element.namespaceURI === "http://www.w3.org/2000/svg" /* SvgNamespace */) {
|
|
1851
|
-
tag = "svg:" /* SvgPrefix */ + tag;
|
|
1850
|
+
if (element.namespaceURI === "http://www.w3.org/2000/svg" /* Constant.SvgNamespace */) {
|
|
1851
|
+
tag = "svg:" /* Constant.SvgPrefix */ + tag;
|
|
1852
1852
|
}
|
|
1853
1853
|
switch (tag) {
|
|
1854
1854
|
case "HTML":
|
|
1855
1855
|
parent = insideFrame && parent ? iframe(parent) : null;
|
|
1856
|
-
var htmlPrefix = insideFrame ? "iframe:" /* IFramePrefix */ : "" /* Empty */;
|
|
1856
|
+
var htmlPrefix = insideFrame ? "iframe:" /* Constant.IFramePrefix */ : "" /* Constant.Empty */;
|
|
1857
1857
|
var htmlData = { tag: htmlPrefix + tag, attributes: attributes };
|
|
1858
1858
|
dom[call](node, parent, htmlData, source);
|
|
1859
1859
|
break;
|
|
1860
1860
|
case "SCRIPT":
|
|
1861
|
-
if ("type" /* Type */ in attributes && attributes["type" /* Type */] === "application/ld+json" /* JsonLD */) {
|
|
1861
|
+
if ("type" /* Constant.Type */ in attributes && attributes["type" /* Constant.Type */] === "application/ld+json" /* Constant.JsonLD */) {
|
|
1862
1862
|
try {
|
|
1863
|
-
ld(JSON.parse(element.text.replace(newlineRegex, "" /* Empty */)));
|
|
1863
|
+
ld(JSON.parse(element.text.replace(newlineRegex, "" /* Constant.Empty */)));
|
|
1864
1864
|
}
|
|
1865
1865
|
catch ( /* do nothing */_a) { /* do nothing */ }
|
|
1866
1866
|
}
|
|
@@ -1868,20 +1868,20 @@ function processNode (node, source) {
|
|
|
1868
1868
|
case "NOSCRIPT":
|
|
1869
1869
|
break;
|
|
1870
1870
|
case "META":
|
|
1871
|
-
var key = ("property" /* Property */ in attributes ?
|
|
1872
|
-
"property" /* Property */ :
|
|
1873
|
-
("name" /* Name */ in attributes ? "name" /* Name */ : null));
|
|
1874
|
-
if (key && "content" /* Content */ in attributes) {
|
|
1875
|
-
var content = attributes["content" /* Content */];
|
|
1871
|
+
var key = ("property" /* Constant.Property */ in attributes ?
|
|
1872
|
+
"property" /* Constant.Property */ :
|
|
1873
|
+
("name" /* Constant.Name */ in attributes ? "name" /* Constant.Name */ : null));
|
|
1874
|
+
if (key && "content" /* Constant.Content */ in attributes) {
|
|
1875
|
+
var content = attributes["content" /* Constant.Content */];
|
|
1876
1876
|
switch (attributes[key]) {
|
|
1877
|
-
case "og:title" /* ogTitle */:
|
|
1878
|
-
log(20 /* MetaTitle */, content);
|
|
1877
|
+
case "og:title" /* Constant.ogTitle */:
|
|
1878
|
+
log(20 /* Dimension.MetaTitle */, content);
|
|
1879
1879
|
break;
|
|
1880
|
-
case "og:type" /* ogType */:
|
|
1881
|
-
log(19 /* MetaType */, content);
|
|
1880
|
+
case "og:type" /* Constant.ogType */:
|
|
1881
|
+
log(19 /* Dimension.MetaType */, content);
|
|
1882
1882
|
break;
|
|
1883
|
-
case "generator" /* Generator */:
|
|
1884
|
-
log(21 /* Generator */, content);
|
|
1883
|
+
case "generator" /* Constant.Generator */:
|
|
1884
|
+
log(21 /* Dimension.Generator */, content);
|
|
1885
1885
|
break;
|
|
1886
1886
|
}
|
|
1887
1887
|
}
|
|
@@ -1889,7 +1889,7 @@ function processNode (node, source) {
|
|
|
1889
1889
|
case "HEAD":
|
|
1890
1890
|
var head = { tag: tag, attributes: attributes };
|
|
1891
1891
|
if (location) {
|
|
1892
|
-
head.attributes["*B" /* Base */] = location.protocol + "//" + location.hostname;
|
|
1892
|
+
head.attributes["*B" /* Constant.Base */] = location.protocol + "//" + location.hostname;
|
|
1893
1893
|
}
|
|
1894
1894
|
dom[call](node, parent, head, source);
|
|
1895
1895
|
break;
|
|
@@ -1902,7 +1902,7 @@ function processNode (node, source) {
|
|
|
1902
1902
|
var frameData = { tag: tag, attributes: attributes };
|
|
1903
1903
|
if (sameorigin(iframe$1)) {
|
|
1904
1904
|
monitor(iframe$1);
|
|
1905
|
-
frameData.attributes["*O" /* SameOrigin */] = "true";
|
|
1905
|
+
frameData.attributes["*O" /* Constant.SameOrigin */] = "true";
|
|
1906
1906
|
if (iframe$1.contentDocument && iframe$1.contentWindow && iframe$1.contentDocument.readyState !== "loading") {
|
|
1907
1907
|
child = iframe$1.contentDocument;
|
|
1908
1908
|
}
|
|
@@ -1931,7 +1931,7 @@ function observe$3(root) {
|
|
|
1931
1931
|
function getStyleValue(style) {
|
|
1932
1932
|
// Call trim on the text content to ensure we do not process white spaces ( , \n, \r\n, \t, etc.)
|
|
1933
1933
|
// Also, check if stylesheet has any data-* attribute, if so process rules instead of looking up text
|
|
1934
|
-
var value = style.textContent ? style.textContent.trim() : "" /* Empty */;
|
|
1934
|
+
var value = style.textContent ? style.textContent.trim() : "" /* Constant.Empty */;
|
|
1935
1935
|
var dataset = style.dataset ? Object.keys(style.dataset).length : 0;
|
|
1936
1936
|
if (value.length === 0 || dataset > 0) {
|
|
1937
1937
|
value = getCssRules(style.sheet);
|
|
@@ -1939,14 +1939,14 @@ function getStyleValue(style) {
|
|
|
1939
1939
|
return value;
|
|
1940
1940
|
}
|
|
1941
1941
|
function getCssRules(sheet) {
|
|
1942
|
-
var value = "" /* Empty */;
|
|
1942
|
+
var value = "" /* Constant.Empty */;
|
|
1943
1943
|
var cssRules = null;
|
|
1944
1944
|
// Firefox throws a SecurityError when trying to access cssRules of a stylesheet from a different domain
|
|
1945
1945
|
try {
|
|
1946
1946
|
cssRules = sheet ? sheet.cssRules : [];
|
|
1947
1947
|
}
|
|
1948
1948
|
catch (e) {
|
|
1949
|
-
log$1(1 /* CssRules */, 1 /* Warning */, e ? e.name : null);
|
|
1949
|
+
log$1(1 /* Code.CssRules */, 1 /* Severity.Warning */, e ? e.name : null);
|
|
1950
1950
|
if (e && e.name !== "SecurityError") {
|
|
1951
1951
|
throw e;
|
|
1952
1952
|
}
|
|
@@ -1970,8 +1970,8 @@ function getAttributes(element) {
|
|
|
1970
1970
|
}
|
|
1971
1971
|
}
|
|
1972
1972
|
// For INPUT tags read the dynamic "value" property if an explicit "value" attribute is not set
|
|
1973
|
-
if (element.tagName === "INPUT" /* InputTag */ && !("value" /* Value */ in output) && element.value) {
|
|
1974
|
-
output["value" /* Value */] = element.value;
|
|
1973
|
+
if (element.tagName === "INPUT" /* Constant.InputTag */ && !("value" /* Constant.Value */ in output) && element.value) {
|
|
1974
|
+
output["value" /* Constant.Value */] = element.value;
|
|
1975
1975
|
}
|
|
1976
1976
|
return output;
|
|
1977
1977
|
}
|
|
@@ -1993,13 +1993,13 @@ function traverse (root, timer, source) {
|
|
|
1993
1993
|
next = next.nextSibling;
|
|
1994
1994
|
}
|
|
1995
1995
|
state = state$8(timer);
|
|
1996
|
-
if (!(state === 0 /* Wait */)) return [3 /*break*/, 3];
|
|
1996
|
+
if (!(state === 0 /* Task.Wait */)) return [3 /*break*/, 3];
|
|
1997
1997
|
return [4 /*yield*/, suspend$1(timer)];
|
|
1998
1998
|
case 2:
|
|
1999
1999
|
state = _a.sent();
|
|
2000
2000
|
_a.label = 3;
|
|
2001
2001
|
case 3:
|
|
2002
|
-
if (state === 2 /* Stop */) {
|
|
2002
|
+
if (state === 2 /* Task.Stop */) {
|
|
2003
2003
|
return [3 /*break*/, 4];
|
|
2004
2004
|
}
|
|
2005
2005
|
subnode = processNode(node, source);
|
|
@@ -2076,7 +2076,7 @@ function observe$2(node) {
|
|
|
2076
2076
|
// For this reason, we need to wire up mutations every time we see a new shadow dom.
|
|
2077
2077
|
// Also, wrap it inside a try / catch. In certain browsers (e.g. legacy Edge), observer on shadow dom can throw errors
|
|
2078
2078
|
try {
|
|
2079
|
-
var m = api("MutationObserver" /* MutationObserver */);
|
|
2079
|
+
var m = api("MutationObserver" /* Constant.MutationObserver */);
|
|
2080
2080
|
var observer = m in window ? new window[m](measure(handle$1)) : null;
|
|
2081
2081
|
if (observer) {
|
|
2082
2082
|
observer.observe(node, { attributes: true, childList: true, characterData: true, subtree: true });
|
|
@@ -2084,7 +2084,7 @@ function observe$2(node) {
|
|
|
2084
2084
|
}
|
|
2085
2085
|
}
|
|
2086
2086
|
catch (e) {
|
|
2087
|
-
log$1(2 /* MutationObserver */, 0 /* Info */, e ? e.name : null);
|
|
2087
|
+
log$1(2 /* Code.MutationObserver */, 0 /* Severity.Info */, e ? e.name : null);
|
|
2088
2088
|
}
|
|
2089
2089
|
}
|
|
2090
2090
|
function monitor(frame) {
|
|
@@ -2092,7 +2092,7 @@ function monitor(frame) {
|
|
|
2092
2092
|
// This includes cases where iframe location is updated without explicitly updating src attribute
|
|
2093
2093
|
// E.g. iframe.contentWindow.location.href = "new-location";
|
|
2094
2094
|
if (has(frame) === false) {
|
|
2095
|
-
bind(frame, "load" /* LoadEvent */, generate.bind(this, frame, "childList" /* ChildList */), true);
|
|
2095
|
+
bind(frame, "load" /* Constant.LoadEvent */, generate.bind(this, frame, "childList" /* Constant.ChildList */), true);
|
|
2096
2096
|
}
|
|
2097
2097
|
}
|
|
2098
2098
|
function stop$h() {
|
|
@@ -2110,14 +2110,14 @@ function stop$h() {
|
|
|
2110
2110
|
timeout$1 = null;
|
|
2111
2111
|
}
|
|
2112
2112
|
function active$2() {
|
|
2113
|
-
activePeriod = time() + 3000 /* MutationActivePeriod */;
|
|
2113
|
+
activePeriod = time() + 3000 /* Setting.MutationActivePeriod */;
|
|
2114
2114
|
}
|
|
2115
2115
|
function handle$1(m) {
|
|
2116
2116
|
// Queue up mutation records for asynchronous processing
|
|
2117
2117
|
var now = time();
|
|
2118
|
-
track$6(6 /* Mutation */, now);
|
|
2118
|
+
track$6(6 /* Event.Mutation */, now);
|
|
2119
2119
|
mutations.push({ time: now, mutations: m });
|
|
2120
|
-
schedule$1(process$2, 1 /* High */).then(function () {
|
|
2120
|
+
schedule$1(process$2, 1 /* Priority.High */).then(function () {
|
|
2121
2121
|
setTimeout(compute$7);
|
|
2122
2122
|
measure(compute$6)();
|
|
2123
2123
|
});
|
|
@@ -2128,7 +2128,7 @@ function process$2() {
|
|
|
2128
2128
|
return __generator(this, function (_b) {
|
|
2129
2129
|
switch (_b.label) {
|
|
2130
2130
|
case 0:
|
|
2131
|
-
timer = { id: id(), cost: 3 /* LayoutCost */ };
|
|
2131
|
+
timer = { id: id(), cost: 3 /* Metric.LayoutCost */ };
|
|
2132
2132
|
start$w(timer);
|
|
2133
2133
|
_b.label = 1;
|
|
2134
2134
|
case 1:
|
|
@@ -2140,13 +2140,13 @@ function process$2() {
|
|
|
2140
2140
|
if (!(_i < _a.length)) return [3 /*break*/, 6];
|
|
2141
2141
|
mutation = _a[_i];
|
|
2142
2142
|
state = state$8(timer);
|
|
2143
|
-
if (!(state === 0 /* Wait */)) return [3 /*break*/, 4];
|
|
2143
|
+
if (!(state === 0 /* Task.Wait */)) return [3 /*break*/, 4];
|
|
2144
2144
|
return [4 /*yield*/, suspend$1(timer)];
|
|
2145
2145
|
case 3:
|
|
2146
2146
|
state = _b.sent();
|
|
2147
2147
|
_b.label = 4;
|
|
2148
2148
|
case 4:
|
|
2149
|
-
if (state === 2 /* Stop */) {
|
|
2149
|
+
if (state === 2 /* Task.Stop */) {
|
|
2150
2150
|
return [3 /*break*/, 6];
|
|
2151
2151
|
}
|
|
2152
2152
|
target = mutation.target;
|
|
@@ -2158,17 +2158,17 @@ function process$2() {
|
|
|
2158
2158
|
parse$1(target);
|
|
2159
2159
|
}
|
|
2160
2160
|
switch (type) {
|
|
2161
|
-
case "attributes" /* Attributes */:
|
|
2162
|
-
processNode(target, 3 /* Attributes */);
|
|
2161
|
+
case "attributes" /* Constant.Attributes */:
|
|
2162
|
+
processNode(target, 3 /* Source.Attributes */);
|
|
2163
2163
|
break;
|
|
2164
|
-
case "characterData" /* CharacterData */:
|
|
2165
|
-
processNode(target, 4 /* CharacterData */);
|
|
2164
|
+
case "characterData" /* Constant.CharacterData */:
|
|
2165
|
+
processNode(target, 4 /* Source.CharacterData */);
|
|
2166
2166
|
break;
|
|
2167
|
-
case "childList" /* ChildList */:
|
|
2168
|
-
processNodeList(mutation.addedNodes, 1 /* ChildListAdd */, timer);
|
|
2169
|
-
processNodeList(mutation.removedNodes, 2 /* ChildListRemove */, timer);
|
|
2167
|
+
case "childList" /* Constant.ChildList */:
|
|
2168
|
+
processNodeList(mutation.addedNodes, 1 /* Source.ChildListAdd */, timer);
|
|
2169
|
+
processNodeList(mutation.removedNodes, 2 /* Source.ChildListRemove */, timer);
|
|
2170
2170
|
break;
|
|
2171
|
-
case "suspend" /* Suspend */:
|
|
2171
|
+
case "suspend" /* Constant.Suspend */:
|
|
2172
2172
|
value = get(target);
|
|
2173
2173
|
if (value) {
|
|
2174
2174
|
value.metadata.suspend = true;
|
|
@@ -2179,7 +2179,7 @@ function process$2() {
|
|
|
2179
2179
|
case 5:
|
|
2180
2180
|
_i++;
|
|
2181
2181
|
return [3 /*break*/, 2];
|
|
2182
|
-
case 6: return [4 /*yield*/, encode$4(6 /* Mutation */, timer, record.time)];
|
|
2182
|
+
case 6: return [4 /*yield*/, encode$4(6 /* Event.Mutation */, timer, record.time)];
|
|
2183
2183
|
case 7:
|
|
2184
2184
|
_b.sent();
|
|
2185
2185
|
return [3 /*break*/, 1];
|
|
@@ -2193,11 +2193,11 @@ function process$2() {
|
|
|
2193
2193
|
function track$5(m, timer) {
|
|
2194
2194
|
var value = m.target ? get(m.target.parentNode) : null;
|
|
2195
2195
|
// Check if the parent is already discovered and that the parent is not the document root
|
|
2196
|
-
if (value && value.data.tag !== "HTML" /* HTML */) {
|
|
2196
|
+
if (value && value.data.tag !== "HTML" /* Constant.HTML */) {
|
|
2197
2197
|
var inactive = time() > activePeriod;
|
|
2198
2198
|
var target = get(m.target);
|
|
2199
2199
|
var element = target && target.selector ? target.selector.join() : m.target.nodeName;
|
|
2200
|
-
var parent_1 = value.selector ? value.selector.join() : "" /* Empty */;
|
|
2200
|
+
var parent_1 = value.selector ? value.selector.join() : "" /* Constant.Empty */;
|
|
2201
2201
|
// We use selector, instead of id, to determine the key (signature for the mutation) because in some cases
|
|
2202
2202
|
// repeated mutations can cause elements to be destroyed and then recreated as new DOM nodes
|
|
2203
2203
|
// In those cases, IDs will change however the selector (which is relative to DOM xPath) remains the same
|
|
@@ -2206,20 +2206,20 @@ function track$5(m, timer) {
|
|
|
2206
2206
|
history$4[key] = key in history$4 ? history$4[key] : [0];
|
|
2207
2207
|
var h = history$4[key];
|
|
2208
2208
|
// Lookup any pending nodes queued up for removal, and process them now if we suspended a mutation before
|
|
2209
|
-
if (inactive === false && h[0] >= 10 /* MutationSuspendThreshold */) {
|
|
2210
|
-
processNodeList(h[1], 2 /* ChildListRemove */, timer);
|
|
2209
|
+
if (inactive === false && h[0] >= 10 /* Setting.MutationSuspendThreshold */) {
|
|
2210
|
+
processNodeList(h[1], 2 /* Source.ChildListRemove */, timer);
|
|
2211
2211
|
}
|
|
2212
2212
|
// Update the counter
|
|
2213
2213
|
h[0] = inactive ? h[0] + 1 : 1;
|
|
2214
2214
|
// Return updated mutation type based on if we have already hit the threshold or not
|
|
2215
|
-
if (h[0] === 10 /* MutationSuspendThreshold */) {
|
|
2215
|
+
if (h[0] === 10 /* Setting.MutationSuspendThreshold */) {
|
|
2216
2216
|
// Store a reference to removedNodes so we can process them later
|
|
2217
2217
|
// when we resume mutations again on user interactions
|
|
2218
2218
|
h[1] = m.removedNodes;
|
|
2219
|
-
return "suspend" /* Suspend */;
|
|
2219
|
+
return "suspend" /* Constant.Suspend */;
|
|
2220
2220
|
}
|
|
2221
|
-
else if (h[0] > 10 /* MutationSuspendThreshold */) {
|
|
2222
|
-
return "" /* Empty */;
|
|
2221
|
+
else if (h[0] > 10 /* Setting.MutationSuspendThreshold */) {
|
|
2222
|
+
return "" /* Constant.Empty */;
|
|
2223
2223
|
}
|
|
2224
2224
|
}
|
|
2225
2225
|
return m.type;
|
|
@@ -2242,18 +2242,18 @@ function processNodeList(list, source, timer) {
|
|
|
2242
2242
|
_a.label = 1;
|
|
2243
2243
|
case 1:
|
|
2244
2244
|
if (!(i < length)) return [3 /*break*/, 6];
|
|
2245
|
-
if (!(source === 1 /* ChildListAdd */)) return [3 /*break*/, 2];
|
|
2245
|
+
if (!(source === 1 /* Source.ChildListAdd */)) return [3 /*break*/, 2];
|
|
2246
2246
|
traverse(list[i], timer, source);
|
|
2247
2247
|
return [3 /*break*/, 5];
|
|
2248
2248
|
case 2:
|
|
2249
2249
|
state = state$8(timer);
|
|
2250
|
-
if (!(state === 0 /* Wait */)) return [3 /*break*/, 4];
|
|
2250
|
+
if (!(state === 0 /* Task.Wait */)) return [3 /*break*/, 4];
|
|
2251
2251
|
return [4 /*yield*/, suspend$1(timer)];
|
|
2252
2252
|
case 3:
|
|
2253
2253
|
state = _a.sent();
|
|
2254
2254
|
_a.label = 4;
|
|
2255
2255
|
case 4:
|
|
2256
|
-
if (state === 2 /* Stop */) {
|
|
2256
|
+
if (state === 2 /* Task.Stop */) {
|
|
2257
2257
|
return [3 /*break*/, 6];
|
|
2258
2258
|
}
|
|
2259
2259
|
processNode(list[i], source);
|
|
@@ -2278,7 +2278,7 @@ function schedule(node, fragment) {
|
|
|
2278
2278
|
if (timeout$1) {
|
|
2279
2279
|
clearTimeout(timeout$1);
|
|
2280
2280
|
}
|
|
2281
|
-
timeout$1 = setTimeout(function () { trigger$1(fragment); }, 33 /* LookAhead */);
|
|
2281
|
+
timeout$1 = setTimeout(function () { trigger$1(fragment); }, 33 /* Setting.LookAhead */);
|
|
2282
2282
|
return node;
|
|
2283
2283
|
}
|
|
2284
2284
|
function trigger$1(fragment) {
|
|
@@ -2291,7 +2291,7 @@ function trigger$1(fragment) {
|
|
|
2291
2291
|
if (shadowRoot && has(node)) {
|
|
2292
2292
|
continue;
|
|
2293
2293
|
}
|
|
2294
|
-
generate(node, shadowRoot || fragment ? "childList" /* ChildList */ : "characterData" /* CharacterData */);
|
|
2294
|
+
generate(node, shadowRoot || fragment ? "childList" /* Constant.ChildList */ : "characterData" /* Constant.CharacterData */);
|
|
2295
2295
|
}
|
|
2296
2296
|
}
|
|
2297
2297
|
queue$2 = [];
|
|
@@ -2340,8 +2340,8 @@ function reset$7() {
|
|
|
2340
2340
|
hashMap = {};
|
|
2341
2341
|
override = [];
|
|
2342
2342
|
unmask = [];
|
|
2343
|
-
maskText = "password,secret,pass,social,ssn,name,code,dob,cell,mob,contact,hidden,account,cvv,ccv,email,tel,phone,address,addr,card,zip" /* Text */.split("," /* Comma */);
|
|
2344
|
-
maskDisable = "radio,checkbox,range,button,reset,submit" /* Disable */.split("," /* Comma */);
|
|
2343
|
+
maskText = "password,secret,pass,social,ssn,name,code,dob,cell,mob,contact,hidden,account,cvv,ccv,email,tel,phone,address,addr,card,zip" /* Mask.Text */.split("," /* Constant.Comma */);
|
|
2344
|
+
maskDisable = "radio,checkbox,range,button,reset,submit" /* Mask.Disable */.split("," /* Constant.Comma */);
|
|
2345
2345
|
idMap = new WeakMap();
|
|
2346
2346
|
iframeMap = new WeakMap();
|
|
2347
2347
|
privacyMap = new WeakMap();
|
|
@@ -2356,19 +2356,19 @@ function parse$1(root, init) {
|
|
|
2356
2356
|
try {
|
|
2357
2357
|
// Parse unmask configuration into separate query selectors and override tokens as part of initialization
|
|
2358
2358
|
if (init) {
|
|
2359
|
-
config$1.unmask.forEach(function (x) { return x.indexOf("!" /* Bang */) < 0 ? unmask.push(x) : override.push(x.substr(1)); });
|
|
2359
|
+
config$1.unmask.forEach(function (x) { return x.indexOf("!" /* Constant.Bang */) < 0 ? unmask.push(x) : override.push(x.substr(1)); });
|
|
2360
2360
|
}
|
|
2361
2361
|
// Since mutations may happen on leaf nodes too, e.g. text nodes, which may not support all selector APIs.
|
|
2362
2362
|
// We ensure that the root note supports querySelectorAll API before executing the code below to identify new regions.
|
|
2363
2363
|
if ("querySelectorAll" in root) {
|
|
2364
|
-
config$1.regions.forEach(function (x) { return root.querySelectorAll(x[1]).forEach(function (e) { return observe$1(e, ""
|
|
2365
|
-
config$1.mask.forEach(function (x) { return root.querySelectorAll(x).forEach(function (e) { return privacyMap.set(e, 3 /* TextImage */); }); }); // Masked Elements
|
|
2364
|
+
config$1.regions.forEach(function (x) { return root.querySelectorAll(x[1]).forEach(function (e) { return observe$1(e, "".concat(x[0])); }); }); // Regions
|
|
2365
|
+
config$1.mask.forEach(function (x) { return root.querySelectorAll(x).forEach(function (e) { return privacyMap.set(e, 3 /* Privacy.TextImage */); }); }); // Masked Elements
|
|
2366
2366
|
config$1.fraud.forEach(function (x) { return root.querySelectorAll(x[1]).forEach(function (e) { return fraudMap.set(e, x[0]); }); }); // Fraud Check
|
|
2367
|
-
unmask.forEach(function (x) { return root.querySelectorAll(x).forEach(function (e) { return privacyMap.set(e, 0 /* None */); }); }); // Unmasked Elements
|
|
2367
|
+
unmask.forEach(function (x) { return root.querySelectorAll(x).forEach(function (e) { return privacyMap.set(e, 0 /* Privacy.None */); }); }); // Unmasked Elements
|
|
2368
2368
|
}
|
|
2369
2369
|
}
|
|
2370
2370
|
catch (e) {
|
|
2371
|
-
log$1(5 /* Selector */, 1 /* Warning */, e ? e.name : null);
|
|
2371
|
+
log$1(5 /* Code.Selector */, 1 /* Severity.Warning */, e ? e.name : null);
|
|
2372
2372
|
}
|
|
2373
2373
|
}
|
|
2374
2374
|
function getId(node, autogen) {
|
|
@@ -2391,17 +2391,18 @@ function add(node, parent, data, source) {
|
|
|
2391
2391
|
var regionId = exists(node) ? id : null;
|
|
2392
2392
|
var fragmentId = null;
|
|
2393
2393
|
var fraudId = fraudMap.has(node) ? fraudMap.get(node) : null;
|
|
2394
|
-
var privacyId = config$1.content ? 1 /* Sensitive */ : 2 /* Text */;
|
|
2394
|
+
var privacyId = config$1.content ? 1 /* Privacy.Sensitive */ : 2 /* Privacy.Text */;
|
|
2395
2395
|
if (parentId >= 0 && values[parentId]) {
|
|
2396
2396
|
parentValue = values[parentId];
|
|
2397
2397
|
parentValue.children.push(id);
|
|
2398
2398
|
regionId = regionId === null ? parentValue.region : regionId;
|
|
2399
2399
|
fragmentId = parentValue.fragment;
|
|
2400
2400
|
fraudId = fraudId === null ? parentValue.metadata.fraud : fraudId;
|
|
2401
|
+
privacyId = parentValue.metadata.privacy;
|
|
2401
2402
|
}
|
|
2402
2403
|
// If there's an explicit region attribute set on the element, use it to mark a region on the page
|
|
2403
|
-
if (data.attributes && "data-clarity-region" /* RegionData */ in data.attributes) {
|
|
2404
|
-
observe$1(node, data.attributes["data-clarity-region" /* RegionData */]);
|
|
2404
|
+
if (data.attributes && "data-clarity-region" /* Constant.RegionData */ in data.attributes) {
|
|
2405
|
+
observe$1(node, data.attributes["data-clarity-region" /* Constant.RegionData */]);
|
|
2405
2406
|
regionId = id;
|
|
2406
2407
|
}
|
|
2407
2408
|
nodes[id] = node;
|
|
@@ -2479,7 +2480,7 @@ function update$1(node, parent, data, source) {
|
|
|
2479
2480
|
}
|
|
2480
2481
|
function sameorigin(node) {
|
|
2481
2482
|
var output = false;
|
|
2482
|
-
if (node.nodeType === Node.ELEMENT_NODE && node.tagName === "IFRAME" /* IFrameTag */) {
|
|
2483
|
+
if (node.nodeType === Node.ELEMENT_NODE && node.tagName === "IFRAME" /* Constant.IFrameTag */) {
|
|
2483
2484
|
var frame = node;
|
|
2484
2485
|
// To determine if the iframe is same-origin or not, we try accessing it's contentDocument.
|
|
2485
2486
|
// If the browser throws an exception, we assume it's cross-origin and move on.
|
|
@@ -2506,11 +2507,11 @@ function privacy(node, value, parent) {
|
|
|
2506
2507
|
var attributes = data.attributes || {};
|
|
2507
2508
|
var tag = data.tag.toUpperCase();
|
|
2508
2509
|
switch (true) {
|
|
2509
|
-
case "data-clarity-mask" /* MaskData */ in attributes:
|
|
2510
|
-
metadata.privacy = 3 /* TextImage */;
|
|
2510
|
+
case "data-clarity-mask" /* Constant.MaskData */ in attributes:
|
|
2511
|
+
metadata.privacy = 3 /* Privacy.TextImage */;
|
|
2511
2512
|
break;
|
|
2512
|
-
case "data-clarity-unmask" /* UnmaskData */ in attributes:
|
|
2513
|
-
metadata.privacy = 0 /* None */;
|
|
2513
|
+
case "data-clarity-unmask" /* Constant.UnmaskData */ in attributes:
|
|
2514
|
+
metadata.privacy = 0 /* Privacy.None */;
|
|
2514
2515
|
break;
|
|
2515
2516
|
case privacyMap.has(node):
|
|
2516
2517
|
// If this node was explicitly configured to contain sensitive content, honor that privacy setting
|
|
@@ -2518,31 +2519,31 @@ function privacy(node, value, parent) {
|
|
|
2518
2519
|
break;
|
|
2519
2520
|
case fraudMap.has(node):
|
|
2520
2521
|
// If this node was explicitly configured to be evaluated for fraud, then also mask content
|
|
2521
|
-
metadata.privacy = 2 /* Text */;
|
|
2522
|
+
metadata.privacy = 2 /* Privacy.Text */;
|
|
2522
2523
|
break;
|
|
2523
|
-
case tag === "*T" /* TextTag */:
|
|
2524
|
+
case tag === "*T" /* Constant.TextTag */:
|
|
2524
2525
|
// If it's a text node belonging to a STYLE or TITLE tag or one of SCRUB_EXCEPTIONS, then capture content
|
|
2525
|
-
var pTag = parent && parent.data ? parent.data.tag : "" /* Empty */;
|
|
2526
|
-
var pSelector_1 = parent && parent.selector ? parent.selector[0 /* Stable */] : "" /* Empty */;
|
|
2527
|
-
metadata.privacy = pTag === "STYLE" /* StyleTag */ || pTag === "TITLE" /* TitleTag */ || override.some(function (x) { return pSelector_1.indexOf(x) >= 0; }) ? 0 /* None */ : current;
|
|
2526
|
+
var pTag = parent && parent.data ? parent.data.tag : "" /* Constant.Empty */;
|
|
2527
|
+
var pSelector_1 = parent && parent.selector ? parent.selector[0 /* Selector.Stable */] : "" /* Constant.Empty */;
|
|
2528
|
+
metadata.privacy = pTag === "STYLE" /* Constant.StyleTag */ || pTag === "TITLE" /* Constant.TitleTag */ || override.some(function (x) { return pSelector_1.indexOf(x) >= 0; }) ? 0 /* Privacy.None */ : current;
|
|
2528
2529
|
break;
|
|
2529
|
-
case "type" /* Type */ in attributes:
|
|
2530
|
+
case "type" /* Constant.Type */ in attributes:
|
|
2530
2531
|
// If this node has an explicit type assigned to it, go through masking rules to determine right privacy setting
|
|
2531
|
-
metadata.privacy = inspect(attributes["type" /* Type */], metadata);
|
|
2532
|
+
metadata.privacy = inspect(attributes["type" /* Constant.Type */], metadata);
|
|
2532
2533
|
break;
|
|
2533
|
-
case tag === "INPUT" /* InputTag */ && current === 0 /* None */:
|
|
2534
|
+
case tag === "INPUT" /* Constant.InputTag */ && current === 0 /* Privacy.None */:
|
|
2534
2535
|
// If even default privacy setting is to not mask, we still scan through input fields for any sensitive information
|
|
2535
|
-
var field_1 = "" /* Empty */;
|
|
2536
|
+
var field_1 = "" /* Constant.Empty */;
|
|
2536
2537
|
Object.keys(attributes).forEach(function (x) { return field_1 += attributes[x].toLowerCase(); });
|
|
2537
2538
|
metadata.privacy = inspect(field_1, metadata);
|
|
2538
2539
|
break;
|
|
2539
|
-
case current === 1 /* Sensitive */ && tag === "INPUT" /* InputTag */:
|
|
2540
|
+
case current === 1 /* Privacy.Sensitive */ && tag === "INPUT" /* Constant.InputTag */:
|
|
2540
2541
|
// If it's a button or an input option, make an exception to disable masking
|
|
2541
|
-
metadata.privacy = maskDisable.indexOf(attributes["type" /* Type */]) >= 0 ? 0 /* None */ : current;
|
|
2542
|
+
metadata.privacy = maskDisable.indexOf(attributes["type" /* Constant.Type */]) >= 0 ? 0 /* Privacy.None */ : current;
|
|
2542
2543
|
break;
|
|
2543
|
-
case current === 1 /* Sensitive */:
|
|
2544
|
+
case current === 1 /* Privacy.Sensitive */:
|
|
2544
2545
|
// In a mode where we mask sensitive information by default, look through class names to aggressively mask content
|
|
2545
|
-
metadata.privacy = inspect(attributes["class" /* Class */], metadata);
|
|
2546
|
+
metadata.privacy = inspect(attributes["class" /* Constant.Class */], metadata);
|
|
2546
2547
|
break;
|
|
2547
2548
|
default:
|
|
2548
2549
|
metadata.privacy = parent ? parent.metadata.privacy : metadata.privacy;
|
|
@@ -2551,7 +2552,7 @@ function privacy(node, value, parent) {
|
|
|
2551
2552
|
}
|
|
2552
2553
|
function inspect(input, metadata) {
|
|
2553
2554
|
if (input && maskText.some(function (x) { return input.indexOf(x) >= 0; })) {
|
|
2554
|
-
return 2 /* Text */;
|
|
2555
|
+
return 2 /* Privacy.Text */;
|
|
2555
2556
|
}
|
|
2556
2557
|
return metadata.privacy;
|
|
2557
2558
|
}
|
|
@@ -2643,7 +2644,7 @@ function remove(id, source) {
|
|
|
2643
2644
|
}
|
|
2644
2645
|
function size(value) {
|
|
2645
2646
|
// If this element is a image node, and is masked, then track box model for the current element
|
|
2646
|
-
if (value.data.tag === "IMG" /* ImageTag */ && value.metadata.privacy === 3 /* TextImage */) {
|
|
2647
|
+
if (value.data.tag === "IMG" /* Constant.ImageTag */ && value.metadata.privacy === 3 /* Privacy.TextImage */) {
|
|
2647
2648
|
value.metadata.size = [];
|
|
2648
2649
|
}
|
|
2649
2650
|
}
|
|
@@ -2678,7 +2679,7 @@ function track$4(id, source, fragment, changed, parentChanged) {
|
|
|
2678
2679
|
// Edge case: If an element is added later on, and pre-discovered element is moved as a child.
|
|
2679
2680
|
// In that case, we need to reorder the pre-discovered element in the update list to keep visualization consistent.
|
|
2680
2681
|
var uIndex = updateMap.indexOf(id);
|
|
2681
|
-
if (uIndex >= 0 && source === 1 /* ChildListAdd */ && parentChanged) {
|
|
2682
|
+
if (uIndex >= 0 && source === 1 /* Source.ChildListAdd */ && parentChanged) {
|
|
2682
2683
|
updateMap.splice(uIndex, 1);
|
|
2683
2684
|
updateMap.push(id);
|
|
2684
2685
|
}
|
|
@@ -2724,15 +2725,15 @@ function exists(node) {
|
|
|
2724
2725
|
}
|
|
2725
2726
|
function track$3(id, event) {
|
|
2726
2727
|
var node = getNode(id);
|
|
2727
|
-
var data = id in regions ? regions[id] : { id: id, visibility: 0 /* Rendered */, interaction: 16 /* None */, name: regionMap.get(node) };
|
|
2728
|
+
var data = id in regions ? regions[id] : { id: id, visibility: 0 /* RegionVisibility.Rendered */, interaction: 16 /* InteractionState.None */, name: regionMap.get(node) };
|
|
2728
2729
|
// Determine the interaction state based on incoming event
|
|
2729
|
-
var interaction = 16 /* None */;
|
|
2730
|
+
var interaction = 16 /* InteractionState.None */;
|
|
2730
2731
|
switch (event) {
|
|
2731
|
-
case 9 /* Click */:
|
|
2732
|
-
interaction = 20 /* Clicked */;
|
|
2732
|
+
case 9 /* Event.Click */:
|
|
2733
|
+
interaction = 20 /* InteractionState.Clicked */;
|
|
2733
2734
|
break;
|
|
2734
|
-
case 27 /* Input */:
|
|
2735
|
-
interaction = 30 /* Input */;
|
|
2735
|
+
case 27 /* Event.Input */:
|
|
2736
|
+
interaction = 30 /* InteractionState.Input */;
|
|
2736
2737
|
break;
|
|
2737
2738
|
}
|
|
2738
2739
|
// Process updates to this region, if applicable
|
|
@@ -2760,7 +2761,7 @@ function compute$6() {
|
|
|
2760
2761
|
queue$1 = q;
|
|
2761
2762
|
// Schedule encode only when we have at least one valid data entry
|
|
2762
2763
|
if (state$1.length > 0) {
|
|
2763
|
-
encode$4(7 /* Region */);
|
|
2764
|
+
encode$4(7 /* Event.Region */);
|
|
2764
2765
|
}
|
|
2765
2766
|
}
|
|
2766
2767
|
function handler$1(entries) {
|
|
@@ -2776,27 +2777,27 @@ function handler$1(entries) {
|
|
|
2776
2777
|
// Also, if these regions ever become non-zero width or height (through AJAX, user action or orientation change) - we will automatically start monitoring them from that point onwards
|
|
2777
2778
|
if (regionMap.has(target) && rect.width + rect.height > 0 && viewport.width > 0 && viewport.height > 0) {
|
|
2778
2779
|
var id = target ? getId(target) : null;
|
|
2779
|
-
var data = id in regions ? regions[id] : { id: id, name: regionMap.get(target), interaction: 16 /* None */, visibility: 0 /* Rendered */ };
|
|
2780
|
+
var data = id in regions ? regions[id] : { id: id, name: regionMap.get(target), interaction: 16 /* InteractionState.None */, visibility: 0 /* RegionVisibility.Rendered */ };
|
|
2780
2781
|
// For regions that have relatively smaller area, we look at intersection ratio and see the overlap relative to element's area
|
|
2781
2782
|
// However, for larger regions, area of regions could be bigger than viewport and therefore comparison is relative to visible area
|
|
2782
2783
|
var viewportRatio = overlap ? (overlap.width * overlap.height * 1.0) / (viewport.width * viewport.height) : 0;
|
|
2783
|
-
var visible = viewportRatio > 0.05 /* ViewportIntersectionRatio */ || entry.intersectionRatio > 0.8 /* IntersectionRatio */;
|
|
2784
|
+
var visible = viewportRatio > 0.05 /* Setting.ViewportIntersectionRatio */ || entry.intersectionRatio > 0.8 /* Setting.IntersectionRatio */;
|
|
2784
2785
|
// If an element is either visible or was visible and has been scrolled to the end
|
|
2785
2786
|
// i.e. Scrolled to end is determined by if the starting position of the element + the window height is more than the total element height.
|
|
2786
2787
|
// starting position is relative to the viewport - so Intersection observer returns a negative value for rect.top to indicate that the element top is above the viewport
|
|
2787
|
-
var scrolledToEnd = (visible || data.visibility == 10 /* Visible */) && Math.abs(rect.top) + viewport.height > rect.height;
|
|
2788
|
+
var scrolledToEnd = (visible || data.visibility == 10 /* RegionVisibility.Visible */) && Math.abs(rect.top) + viewport.height > rect.height;
|
|
2788
2789
|
// Process updates to this region, if applicable
|
|
2789
2790
|
process$1(target, data, data.interaction, (scrolledToEnd ?
|
|
2790
|
-
13 /* ScrolledToEnd */ :
|
|
2791
|
-
(visible ? 10 /* Visible */ : 0 /* Rendered */)));
|
|
2791
|
+
13 /* RegionVisibility.ScrolledToEnd */ :
|
|
2792
|
+
(visible ? 10 /* RegionVisibility.Visible */ : 0 /* RegionVisibility.Rendered */)));
|
|
2792
2793
|
// Stop observing this element now that we have already received scrolled signal
|
|
2793
|
-
if (data.visibility >= 13 /* ScrolledToEnd */ && observer$1) {
|
|
2794
|
+
if (data.visibility >= 13 /* RegionVisibility.ScrolledToEnd */ && observer$1) {
|
|
2794
2795
|
observer$1.unobserve(target);
|
|
2795
2796
|
}
|
|
2796
2797
|
}
|
|
2797
2798
|
}
|
|
2798
2799
|
if (state$1.length > 0) {
|
|
2799
|
-
encode$4(7 /* Region */);
|
|
2800
|
+
encode$4(7 /* Event.Region */);
|
|
2800
2801
|
}
|
|
2801
2802
|
}
|
|
2802
2803
|
function process$1(n, d, s, v) {
|
|
@@ -2855,7 +2856,7 @@ function link(node) {
|
|
|
2855
2856
|
function metadata$2(node, event, text) {
|
|
2856
2857
|
if (text === void 0) { text = null; }
|
|
2857
2858
|
// If the node is null, we return a reserved value for id: 0. Valid assignment of id begins from 1+.
|
|
2858
|
-
var output = { id: 0, hash: null, privacy: 2 /* Text */, node: node };
|
|
2859
|
+
var output = { id: 0, hash: null, privacy: 2 /* Privacy.Text */, node: node };
|
|
2859
2860
|
if (node) {
|
|
2860
2861
|
var value = get(node);
|
|
2861
2862
|
if (value !== null) {
|
|
@@ -2881,15 +2882,15 @@ function encode$3 (type) {
|
|
|
2881
2882
|
t = time();
|
|
2882
2883
|
tokens = [t, type];
|
|
2883
2884
|
switch (type) {
|
|
2884
|
-
case 13 /* MouseDown */:
|
|
2885
|
-
case 14 /* MouseUp */:
|
|
2886
|
-
case 12 /* MouseMove */:
|
|
2887
|
-
case 15 /* MouseWheel */:
|
|
2888
|
-
case 16 /* DoubleClick */:
|
|
2889
|
-
case 17 /* TouchStart */:
|
|
2890
|
-
case 18 /* TouchEnd */:
|
|
2891
|
-
case 19 /* TouchMove */:
|
|
2892
|
-
case 20 /* TouchCancel */:
|
|
2885
|
+
case 13 /* Event.MouseDown */:
|
|
2886
|
+
case 14 /* Event.MouseUp */:
|
|
2887
|
+
case 12 /* Event.MouseMove */:
|
|
2888
|
+
case 15 /* Event.MouseWheel */:
|
|
2889
|
+
case 16 /* Event.DoubleClick */:
|
|
2890
|
+
case 17 /* Event.TouchStart */:
|
|
2891
|
+
case 18 /* Event.TouchEnd */:
|
|
2892
|
+
case 19 /* Event.TouchMove */:
|
|
2893
|
+
case 20 /* Event.TouchCancel */:
|
|
2893
2894
|
for (_i = 0, _a = state$4; _i < _a.length; _i++) {
|
|
2894
2895
|
entry = _a[_i];
|
|
2895
2896
|
pTarget = metadata$2(entry.data.target, entry.event);
|
|
@@ -2904,12 +2905,12 @@ function encode$3 (type) {
|
|
|
2904
2905
|
}
|
|
2905
2906
|
reset$e();
|
|
2906
2907
|
break;
|
|
2907
|
-
case 9 /* Click */:
|
|
2908
|
+
case 9 /* Event.Click */:
|
|
2908
2909
|
for (_b = 0, _c = state$7; _b < _c.length; _b++) {
|
|
2909
2910
|
entry = _c[_b];
|
|
2910
2911
|
cTarget = metadata$2(entry.data.target, entry.event, entry.data.text);
|
|
2911
2912
|
tokens = [entry.time, entry.event];
|
|
2912
|
-
cHash = cTarget.hash.join("." /* Dot */);
|
|
2913
|
+
cHash = cTarget.hash.join("." /* Constant.Dot */);
|
|
2913
2914
|
tokens.push(cTarget.id);
|
|
2914
2915
|
tokens.push(entry.data.x);
|
|
2915
2916
|
tokens.push(entry.data.y);
|
|
@@ -2927,7 +2928,7 @@ function encode$3 (type) {
|
|
|
2927
2928
|
}
|
|
2928
2929
|
reset$h();
|
|
2929
2930
|
break;
|
|
2930
|
-
case 38 /* Clipboard */:
|
|
2931
|
+
case 38 /* Event.Clipboard */:
|
|
2931
2932
|
for (_d = 0, _e = state$6; _d < _e.length; _d++) {
|
|
2932
2933
|
entry = _e[_d];
|
|
2933
2934
|
tokens = [entry.time, entry.event];
|
|
@@ -2940,7 +2941,7 @@ function encode$3 (type) {
|
|
|
2940
2941
|
}
|
|
2941
2942
|
reset$g();
|
|
2942
2943
|
break;
|
|
2943
|
-
case 11 /* Resize */:
|
|
2944
|
+
case 11 /* Event.Resize */:
|
|
2944
2945
|
r = data$b;
|
|
2945
2946
|
tokens.push(r.width);
|
|
2946
2947
|
tokens.push(r.height);
|
|
@@ -2948,13 +2949,13 @@ function encode$3 (type) {
|
|
|
2948
2949
|
reset$d();
|
|
2949
2950
|
queue(tokens);
|
|
2950
2951
|
break;
|
|
2951
|
-
case 26 /* Unload */:
|
|
2952
|
+
case 26 /* Event.Unload */:
|
|
2952
2953
|
u = data$9;
|
|
2953
2954
|
tokens.push(u.name);
|
|
2954
2955
|
reset$9();
|
|
2955
2956
|
queue(tokens);
|
|
2956
2957
|
break;
|
|
2957
|
-
case 27 /* Input */:
|
|
2958
|
+
case 27 /* Event.Input */:
|
|
2958
2959
|
for (_f = 0, _g = state$5; _f < _g.length; _f++) {
|
|
2959
2960
|
entry = _g[_f];
|
|
2960
2961
|
iTarget = metadata$2(entry.data.target, entry.event, entry.data.value);
|
|
@@ -2965,7 +2966,7 @@ function encode$3 (type) {
|
|
|
2965
2966
|
}
|
|
2966
2967
|
reset$f();
|
|
2967
2968
|
break;
|
|
2968
|
-
case 21 /* Selection */:
|
|
2969
|
+
case 21 /* Event.Selection */:
|
|
2969
2970
|
s = data$a;
|
|
2970
2971
|
if (s) {
|
|
2971
2972
|
startTarget = metadata$2(s.start, type);
|
|
@@ -2978,7 +2979,7 @@ function encode$3 (type) {
|
|
|
2978
2979
|
queue(tokens);
|
|
2979
2980
|
}
|
|
2980
2981
|
break;
|
|
2981
|
-
case 10 /* Scroll */:
|
|
2982
|
+
case 10 /* Event.Scroll */:
|
|
2982
2983
|
for (_h = 0, _j = state$3; _h < _j.length; _h++) {
|
|
2983
2984
|
entry = _j[_h];
|
|
2984
2985
|
sTarget = metadata$2(entry.data.target, entry.event);
|
|
@@ -2993,7 +2994,7 @@ function encode$3 (type) {
|
|
|
2993
2994
|
}
|
|
2994
2995
|
reset$c();
|
|
2995
2996
|
break;
|
|
2996
|
-
case 39 /* Submit */:
|
|
2997
|
+
case 39 /* Event.Submit */:
|
|
2997
2998
|
for (_k = 0, _l = state$2; _k < _l.length; _k++) {
|
|
2998
2999
|
entry = _l[_k];
|
|
2999
3000
|
tokens = [entry.time, entry.event];
|
|
@@ -3005,7 +3006,7 @@ function encode$3 (type) {
|
|
|
3005
3006
|
}
|
|
3006
3007
|
reset$a();
|
|
3007
3008
|
break;
|
|
3008
|
-
case 22 /* Timeline */:
|
|
3009
|
+
case 22 /* Event.Timeline */:
|
|
3009
3010
|
for (_m = 0, _o = updates$1; _m < _o.length; _m++) {
|
|
3010
3011
|
entry = _o[_m];
|
|
3011
3012
|
tokens = [entry.time, entry.event];
|
|
@@ -3019,7 +3020,7 @@ function encode$3 (type) {
|
|
|
3019
3020
|
}
|
|
3020
3021
|
reset$5();
|
|
3021
3022
|
break;
|
|
3022
|
-
case 28 /* Visibility */:
|
|
3023
|
+
case 28 /* Event.Visibility */:
|
|
3023
3024
|
v = data$8;
|
|
3024
3025
|
tokens.push(v.visible);
|
|
3025
3026
|
queue(tokens);
|
|
@@ -3042,11 +3043,11 @@ function reset$5() {
|
|
|
3042
3043
|
updates$1 = [];
|
|
3043
3044
|
}
|
|
3044
3045
|
function track$2(time, event, hash, x, y, reaction, context) {
|
|
3045
|
-
if (reaction === void 0) { reaction = 1 /* True */; }
|
|
3046
|
-
if (context === void 0) { context = 0 /* Self */; }
|
|
3046
|
+
if (reaction === void 0) { reaction = 1 /* BooleanFlag.True */; }
|
|
3047
|
+
if (context === void 0) { context = 0 /* BrowsingContext.Self */; }
|
|
3047
3048
|
state.push({
|
|
3048
3049
|
time: time,
|
|
3049
|
-
event: 22 /* Timeline */,
|
|
3050
|
+
event: 22 /* Event.Timeline */,
|
|
3050
3051
|
data: {
|
|
3051
3052
|
type: event,
|
|
3052
3053
|
hash: hash,
|
|
@@ -3065,7 +3066,7 @@ function compute$5() {
|
|
|
3065
3066
|
var temp = [];
|
|
3066
3067
|
updates$1 = [];
|
|
3067
3068
|
var max = data$1.start + data$1.duration;
|
|
3068
|
-
var min = Math.max(max - 2000 /* TimelineSpan */, 0);
|
|
3069
|
+
var min = Math.max(max - 2000 /* Setting.TimelineSpan */, 0);
|
|
3069
3070
|
for (var _i = 0, state_1 = state; _i < state_1.length; _i++) {
|
|
3070
3071
|
var s = state_1[_i];
|
|
3071
3072
|
if (s.time >= min) {
|
|
@@ -3076,7 +3077,7 @@ function compute$5() {
|
|
|
3076
3077
|
}
|
|
3077
3078
|
}
|
|
3078
3079
|
state = temp; // Drop events less than the min time
|
|
3079
|
-
encode$3(22 /* Timeline */);
|
|
3080
|
+
encode$3(22 /* Event.Timeline */);
|
|
3080
3081
|
}
|
|
3081
3082
|
function stop$e() {
|
|
3082
3083
|
state = [];
|
|
@@ -3109,10 +3110,10 @@ function queue(tokens, transmit) {
|
|
|
3109
3110
|
var type = tokens.length > 1 ? tokens[1] : null;
|
|
3110
3111
|
var event_1 = JSON.stringify(tokens);
|
|
3111
3112
|
switch (type) {
|
|
3112
|
-
case 5 /* Discover */:
|
|
3113
|
+
case 5 /* Event.Discover */:
|
|
3113
3114
|
discoverBytes += event_1.length;
|
|
3114
|
-
case 37 /* Box */:
|
|
3115
|
-
case 6 /* Mutation */:
|
|
3115
|
+
case 37 /* Event.Box */:
|
|
3116
|
+
case 6 /* Event.Mutation */:
|
|
3116
3117
|
playbackBytes += event_1.length;
|
|
3117
3118
|
playback.push(event_1);
|
|
3118
3119
|
break;
|
|
@@ -3121,7 +3122,7 @@ function queue(tokens, transmit) {
|
|
|
3121
3122
|
break;
|
|
3122
3123
|
}
|
|
3123
3124
|
// Increment event count metric
|
|
3124
|
-
count$1(25 /* EventCount */);
|
|
3125
|
+
count$1(25 /* Metric.EventCount */);
|
|
3125
3126
|
// Following two checks are precautionary and act as a fail safe mechanism to get out of unexpected situations.
|
|
3126
3127
|
// Check 1: If for any reason the upload hasn't happened after waiting for 2x the config.delay time,
|
|
3127
3128
|
// reset the timer. This allows Clarity to attempt an upload again.
|
|
@@ -3134,7 +3135,7 @@ function queue(tokens, transmit) {
|
|
|
3134
3135
|
// However, in certain scenarios - like metric calculation - which are triggered as part of an existing upload
|
|
3135
3136
|
// We enrich the data going out with the existing upload. In these cases, call to upload comes with 'transmit' set to false.
|
|
3136
3137
|
if (transmit && timeout === null) {
|
|
3137
|
-
if (type !== 25 /* Ping */) {
|
|
3138
|
+
if (type !== 25 /* Event.Ping */) {
|
|
3138
3139
|
reset$m();
|
|
3139
3140
|
}
|
|
3140
3141
|
timeout = setTimeout(upload, gap);
|
|
@@ -3163,9 +3164,9 @@ function upload(final) {
|
|
|
3163
3164
|
switch (_b.label) {
|
|
3164
3165
|
case 0:
|
|
3165
3166
|
timeout = null;
|
|
3166
|
-
sendPlaybackBytes = config$1.lean === false && playbackBytes > 0 && (playbackBytes < 1048576 /* MaxFirstPayloadBytes */ || data$1.sequence > 0);
|
|
3167
|
+
sendPlaybackBytes = config$1.lean === false && playbackBytes > 0 && (playbackBytes < 1048576 /* Setting.MaxFirstPayloadBytes */ || data$1.sequence > 0);
|
|
3167
3168
|
if (sendPlaybackBytes) {
|
|
3168
|
-
max(1 /* Playback */, 1 /* True */);
|
|
3169
|
+
max(1 /* Metric.Playback */, 1 /* BooleanFlag.True */);
|
|
3169
3170
|
}
|
|
3170
3171
|
// CAUTION: Ensure "transmit" is set to false in the queue function for following events
|
|
3171
3172
|
// Otherwise you run a risk of infinite loop.
|
|
@@ -3174,8 +3175,8 @@ function upload(final) {
|
|
|
3174
3175
|
compute$8();
|
|
3175
3176
|
last = final === true;
|
|
3176
3177
|
e = JSON.stringify(envelope(last));
|
|
3177
|
-
a = "["
|
|
3178
|
-
p = sendPlaybackBytes ? "["
|
|
3178
|
+
a = "[".concat(analysis.join(), "]");
|
|
3179
|
+
p = sendPlaybackBytes ? "[".concat(playback.join(), "]") : "" /* Constant.Empty */;
|
|
3179
3180
|
encoded = { e: e, a: a, p: p };
|
|
3180
3181
|
payload = stringify(encoded);
|
|
3181
3182
|
if (!last) return [3 /*break*/, 1];
|
|
@@ -3187,7 +3188,7 @@ function upload(final) {
|
|
|
3187
3188
|
_b.label = 3;
|
|
3188
3189
|
case 3:
|
|
3189
3190
|
zipped = _a;
|
|
3190
|
-
sum(2 /* TotalBytes */, zipped ? zipped.length : payload.length);
|
|
3191
|
+
sum(2 /* Metric.TotalBytes */, zipped ? zipped.length : payload.length);
|
|
3191
3192
|
send(payload, zipped, data$1.sequence, last);
|
|
3192
3193
|
// Clear out events now that payload has been dispatched
|
|
3193
3194
|
analysis = [];
|
|
@@ -3202,12 +3203,12 @@ function upload(final) {
|
|
|
3202
3203
|
});
|
|
3203
3204
|
}
|
|
3204
3205
|
function stringify(encoded) {
|
|
3205
|
-
return encoded.p.length > 0 ? "{\"e\":"
|
|
3206
|
+
return encoded.p.length > 0 ? "{\"e\":".concat(encoded.e, ",\"a\":").concat(encoded.a, ",\"p\":").concat(encoded.p, "}") : "{\"e\":".concat(encoded.e, ",\"a\":").concat(encoded.a, "}");
|
|
3206
3207
|
}
|
|
3207
3208
|
function send(payload, zipped, sequence, beacon) {
|
|
3208
3209
|
if (beacon === void 0) { beacon = false; }
|
|
3209
3210
|
// Upload data if a valid URL is defined in the config
|
|
3210
|
-
if (typeof config$1.upload === "string" /* String */) {
|
|
3211
|
+
if (typeof config$1.upload === "string" /* Constant.String */) {
|
|
3211
3212
|
var url = config$1.upload;
|
|
3212
3213
|
var dispatched = false;
|
|
3213
3214
|
// If it's the last payload, attempt to upload using sendBeacon first.
|
|
@@ -3246,7 +3247,7 @@ function send(payload, zipped, sequence, beacon) {
|
|
|
3246
3247
|
xhr_1.withCredentials = true;
|
|
3247
3248
|
if (zipped) {
|
|
3248
3249
|
// If we do have valid compressed array, send it with appropriate HTTP headers so server can decode it appropriately
|
|
3249
|
-
xhr_1.setRequestHeader("Accept" /* Accept */, "application/x-clarity-gzip" /* ClarityGzip */);
|
|
3250
|
+
xhr_1.setRequestHeader("Accept" /* Constant.Accept */, "application/x-clarity-gzip" /* Constant.ClarityGzip */);
|
|
3250
3251
|
xhr_1.send(zipped);
|
|
3251
3252
|
}
|
|
3252
3253
|
else {
|
|
@@ -3263,13 +3264,13 @@ function send(payload, zipped, sequence, beacon) {
|
|
|
3263
3264
|
}
|
|
3264
3265
|
function check$3(xhr, sequence) {
|
|
3265
3266
|
var transitData = transit[sequence];
|
|
3266
|
-
if (xhr && xhr.readyState === 4 /* Done */ && transitData) {
|
|
3267
|
+
if (xhr && xhr.readyState === 4 /* XMLReadyState.Done */ && transitData) {
|
|
3267
3268
|
// Attempt send payload again (as configured in settings) if we do not receive a success (2XX) response code back from the server
|
|
3268
|
-
if ((xhr.status < 200 || xhr.status > 208) && transitData.attempts <= 1 /* RetryLimit */) {
|
|
3269
|
+
if ((xhr.status < 200 || xhr.status > 208) && transitData.attempts <= 1 /* Setting.RetryLimit */) {
|
|
3269
3270
|
// We re-attempt in all cases except when server explicitly rejects our request with 4XX error
|
|
3270
3271
|
if (xhr.status >= 400 && xhr.status < 500) {
|
|
3271
3272
|
// In case of a 4XX response from the server, we bail out instead of trying again
|
|
3272
|
-
trigger(6 /* Server */);
|
|
3273
|
+
trigger(6 /* Check.Server */);
|
|
3273
3274
|
}
|
|
3274
3275
|
else {
|
|
3275
3276
|
// Browser will send status = 0 when it refuses to put network request over the wire
|
|
@@ -3290,7 +3291,7 @@ function check$3(xhr, sequence) {
|
|
|
3290
3291
|
track$1 = { sequence: sequence, attempts: transitData.attempts, status: xhr.status };
|
|
3291
3292
|
// Send back an event only if we were not successful in our first attempt
|
|
3292
3293
|
if (transitData.attempts > 1) {
|
|
3293
|
-
encode$1(2 /* Upload */);
|
|
3294
|
+
encode$1(2 /* Event.Upload */);
|
|
3294
3295
|
}
|
|
3295
3296
|
// Handle response if it was a 200 response with a valid body
|
|
3296
3297
|
if (xhr.status === 200 && xhr.responseText) {
|
|
@@ -3301,7 +3302,7 @@ function check$3(xhr, sequence) {
|
|
|
3301
3302
|
// And, right before we terminate the session, we will attempt one last time to see if we can use
|
|
3302
3303
|
// different transport option (sendBeacon vs. XHR) to get this data to the server for analysis purposes
|
|
3303
3304
|
send(transitData.data, null, sequence, true);
|
|
3304
|
-
trigger(3 /* Retry */);
|
|
3305
|
+
trigger(3 /* Check.Retry */);
|
|
3305
3306
|
}
|
|
3306
3307
|
// Signal that this request completed successfully
|
|
3307
3308
|
if (xhr.status >= 200 && xhr.status <= 208) {
|
|
@@ -3321,19 +3322,19 @@ function done(sequence) {
|
|
|
3321
3322
|
function delay() {
|
|
3322
3323
|
// Progressively increase delay as we continue to send more payloads from the client to the server
|
|
3323
3324
|
// If we are not uploading data to a server, and instead invoking UploadCallback, in that case keep returning configured value
|
|
3324
|
-
var gap = config$1.lean === false && discoverBytes > 0 ? 100 /* MinUploadDelay */ : data$1.sequence * config$1.delay;
|
|
3325
|
-
return typeof config$1.upload === "string" /* String */ ? Math.max(Math.min(gap, 30000 /* MaxUploadDelay */), 100 /* MinUploadDelay */) : config$1.delay;
|
|
3325
|
+
var gap = config$1.lean === false && discoverBytes > 0 ? 100 /* Setting.MinUploadDelay */ : data$1.sequence * config$1.delay;
|
|
3326
|
+
return typeof config$1.upload === "string" /* Constant.String */ ? Math.max(Math.min(gap, 30000 /* Setting.MaxUploadDelay */), 100 /* Setting.MinUploadDelay */) : config$1.delay;
|
|
3326
3327
|
}
|
|
3327
3328
|
function response(payload) {
|
|
3328
|
-
var key = payload && payload.length > 0 ? payload.split(" ")[0] : "" /* Empty */;
|
|
3329
|
+
var key = payload && payload.length > 0 ? payload.split(" ")[0] : "" /* Constant.Empty */;
|
|
3329
3330
|
switch (key) {
|
|
3330
|
-
case "END" /* End */:
|
|
3331
|
+
case "END" /* Constant.End */:
|
|
3331
3332
|
// Clear out session storage and end the session so we can start fresh the next time
|
|
3332
|
-
trigger(6 /* Server */);
|
|
3333
|
+
trigger(6 /* Check.Server */);
|
|
3333
3334
|
break;
|
|
3334
|
-
case "UPGRADE" /* Upgrade */:
|
|
3335
|
+
case "UPGRADE" /* Constant.Upgrade */:
|
|
3335
3336
|
// Upgrade current session to send back playback information
|
|
3336
|
-
upgrade("Auto" /* Auto */);
|
|
3337
|
+
upgrade("Auto" /* Constant.Auto */);
|
|
3337
3338
|
break;
|
|
3338
3339
|
}
|
|
3339
3340
|
}
|
|
@@ -3351,7 +3352,7 @@ function handler(error) {
|
|
|
3351
3352
|
if (!(e.message in history$3)) {
|
|
3352
3353
|
history$3[e.message] = 0;
|
|
3353
3354
|
}
|
|
3354
|
-
if (history$3[e.message]++ >= 5 /* ScriptErrorLimit */) {
|
|
3355
|
+
if (history$3[e.message]++ >= 5 /* Setting.ScriptErrorLimit */) {
|
|
3355
3356
|
return true;
|
|
3356
3357
|
}
|
|
3357
3358
|
// Send back information only if the handled error has valid information
|
|
@@ -3363,7 +3364,7 @@ function handler(error) {
|
|
|
3363
3364
|
stack: e.stack,
|
|
3364
3365
|
source: error["filename"]
|
|
3365
3366
|
};
|
|
3366
|
-
encode$2(31 /* ScriptError */);
|
|
3367
|
+
encode$2(31 /* Event.ScriptError */);
|
|
3367
3368
|
}
|
|
3368
3369
|
return true;
|
|
3369
3370
|
}
|
|
@@ -3374,7 +3375,7 @@ function encode$2 (type) {
|
|
|
3374
3375
|
return __generator(this, function (_a) {
|
|
3375
3376
|
tokens = [time(), type];
|
|
3376
3377
|
switch (type) {
|
|
3377
|
-
case 31 /* ScriptError */:
|
|
3378
|
+
case 31 /* Event.ScriptError */:
|
|
3378
3379
|
tokens.push(data$7.message);
|
|
3379
3380
|
tokens.push(data$7.line);
|
|
3380
3381
|
tokens.push(data$7.column);
|
|
@@ -3382,7 +3383,7 @@ function encode$2 (type) {
|
|
|
3382
3383
|
tokens.push(data$7.source);
|
|
3383
3384
|
queue(tokens);
|
|
3384
3385
|
break;
|
|
3385
|
-
case 33 /* Log */:
|
|
3386
|
+
case 33 /* Event.Log */:
|
|
3386
3387
|
if (data$6) {
|
|
3387
3388
|
tokens.push(data$6.code);
|
|
3388
3389
|
tokens.push(data$6.name);
|
|
@@ -3392,7 +3393,7 @@ function encode$2 (type) {
|
|
|
3392
3393
|
queue(tokens, false);
|
|
3393
3394
|
}
|
|
3394
3395
|
break;
|
|
3395
|
-
case 41 /* Fraud */:
|
|
3396
|
+
case 41 /* Event.Fraud */:
|
|
3396
3397
|
if (data$d) {
|
|
3397
3398
|
tokens.push(data$d.id);
|
|
3398
3399
|
tokens.push(data$d.target);
|
|
@@ -3415,7 +3416,7 @@ function log$1(code, severity, name, message, stack) {
|
|
|
3415
3416
|
if (name === void 0) { name = null; }
|
|
3416
3417
|
if (message === void 0) { message = null; }
|
|
3417
3418
|
if (stack === void 0) { stack = null; }
|
|
3418
|
-
var key = name ? name
|
|
3419
|
+
var key = name ? "".concat(name, "|").concat(message) : "";
|
|
3419
3420
|
// While rare, it's possible for code to fail repeatedly during the lifetime of the same page
|
|
3420
3421
|
// In those cases, we only want to log the failure once and not spam logs with redundant information.
|
|
3421
3422
|
if (code in history$2 && history$2[code].indexOf(key) >= 0) {
|
|
@@ -3429,7 +3430,7 @@ function log$1(code, severity, name, message, stack) {
|
|
|
3429
3430
|
else {
|
|
3430
3431
|
history$2[code] = [key];
|
|
3431
3432
|
}
|
|
3432
|
-
encode$2(33 /* Log */);
|
|
3433
|
+
encode$2(33 /* Event.Log */);
|
|
3433
3434
|
}
|
|
3434
3435
|
function stop$c() {
|
|
3435
3436
|
history$2 = {};
|
|
@@ -3450,25 +3451,25 @@ function start$c() {
|
|
|
3450
3451
|
var source = e[i];
|
|
3451
3452
|
var key = e[i + 1];
|
|
3452
3453
|
switch (source) {
|
|
3453
|
-
case 0 /* Javascript */:
|
|
3454
|
+
case 0 /* ExtractSource.Javascript */:
|
|
3454
3455
|
var variable = e[i + 2];
|
|
3455
3456
|
variables[key] = parse(variable);
|
|
3456
3457
|
break;
|
|
3457
|
-
case 1 /* Cookie */:
|
|
3458
|
+
case 1 /* ExtractSource.Cookie */:
|
|
3458
3459
|
/*Todo: Add cookie extract logic*/
|
|
3459
3460
|
break;
|
|
3460
|
-
case 2 /* Text */:
|
|
3461
|
+
case 2 /* ExtractSource.Text */:
|
|
3461
3462
|
var match_1 = e[i + 2];
|
|
3462
3463
|
selectors[key] = match_1;
|
|
3463
3464
|
break;
|
|
3464
|
-
case 3 /* Fragment */:
|
|
3465
|
+
case 3 /* ExtractSource.Fragment */:
|
|
3465
3466
|
fragments = e[i + 2];
|
|
3466
3467
|
break;
|
|
3467
3468
|
}
|
|
3468
3469
|
}
|
|
3469
3470
|
}
|
|
3470
3471
|
catch (e) {
|
|
3471
|
-
log$1(8 /* Config */, 1 /* Warning */, e ? e.name : null);
|
|
3472
|
+
log$1(8 /* Code.Config */, 1 /* Severity.Warning */, e ? e.name : null);
|
|
3472
3473
|
}
|
|
3473
3474
|
}
|
|
3474
3475
|
function clone(v) {
|
|
@@ -3490,9 +3491,9 @@ function compute$4() {
|
|
|
3490
3491
|
}
|
|
3491
3492
|
}
|
|
3492
3493
|
catch (e) {
|
|
3493
|
-
log$1(5 /* Selector */, 1 /* Warning */, e ? e.name : null);
|
|
3494
|
+
log$1(5 /* Code.Selector */, 1 /* Severity.Warning */, e ? e.name : null);
|
|
3494
3495
|
}
|
|
3495
|
-
encode$1(40 /* Extract */);
|
|
3496
|
+
encode$1(40 /* Event.Extract */);
|
|
3496
3497
|
}
|
|
3497
3498
|
function reset$4() {
|
|
3498
3499
|
keys = [];
|
|
@@ -3512,15 +3513,15 @@ function stop$b() {
|
|
|
3512
3513
|
}
|
|
3513
3514
|
function parse(variable) {
|
|
3514
3515
|
var syntax = [];
|
|
3515
|
-
var parts = variable.split("." /* Dot */);
|
|
3516
|
+
var parts = variable.split("." /* Constant.Dot */);
|
|
3516
3517
|
while (parts.length > 0) {
|
|
3517
3518
|
var part = parts.shift();
|
|
3518
|
-
var arrayStart = part.indexOf("[" /* ArrayStart */);
|
|
3519
|
-
var conditionStart = part.indexOf("{" /* ConditionStart */);
|
|
3520
|
-
var conditionEnd = part.indexOf("}" /* ConditionEnd */);
|
|
3519
|
+
var arrayStart = part.indexOf("[" /* Constant.ArrayStart */);
|
|
3520
|
+
var conditionStart = part.indexOf("{" /* Constant.ConditionStart */);
|
|
3521
|
+
var conditionEnd = part.indexOf("}" /* Constant.ConditionEnd */);
|
|
3521
3522
|
syntax.push({
|
|
3522
3523
|
name: arrayStart > 0 ? part.substring(0, arrayStart) : (conditionStart > 0 ? part.substring(0, conditionStart) : part),
|
|
3523
|
-
type: arrayStart > 0 ? 1 /* Array */ : (conditionStart > 0 ? 2 /* Object */ : 3 /* Simple */),
|
|
3524
|
+
type: arrayStart > 0 ? 1 /* Type.Array */ : (conditionStart > 0 ? 2 /* Type.Object */ : 3 /* Type.Simple */),
|
|
3524
3525
|
condition: conditionStart > 0 ? part.substring(conditionStart + 1, conditionEnd) : null
|
|
3525
3526
|
});
|
|
3526
3527
|
}
|
|
@@ -3538,7 +3539,7 @@ function evaluate(variable, base) {
|
|
|
3538
3539
|
var output;
|
|
3539
3540
|
if (base && base[part.name]) {
|
|
3540
3541
|
var obj = base[part.name];
|
|
3541
|
-
if (part.type !== 1 /* Array */ && match(obj, part.condition)) {
|
|
3542
|
+
if (part.type !== 1 /* Type.Array */ && match(obj, part.condition)) {
|
|
3542
3543
|
output = evaluate(variable, obj);
|
|
3543
3544
|
}
|
|
3544
3545
|
else if (Array.isArray(obj)) {
|
|
@@ -3560,7 +3561,7 @@ function evaluate(variable, base) {
|
|
|
3560
3561
|
}
|
|
3561
3562
|
function str(input) {
|
|
3562
3563
|
// Automatically trim string to max of Setting.ExtractLimit to avoid fetching long strings
|
|
3563
|
-
return input ? JSON.stringify(input).substring(0, 10000 /* ExtractLimit */) : input;
|
|
3564
|
+
return input ? JSON.stringify(input).substring(0, 10000 /* Setting.ExtractLimit */) : input;
|
|
3564
3565
|
}
|
|
3565
3566
|
function match(base, condition) {
|
|
3566
3567
|
if (condition) {
|
|
@@ -3574,7 +3575,7 @@ function encode$1 (event) {
|
|
|
3574
3575
|
var t = time();
|
|
3575
3576
|
var tokens = [t, event];
|
|
3576
3577
|
switch (event) {
|
|
3577
|
-
case 4 /* Baseline */:
|
|
3578
|
+
case 4 /* Event.Baseline */:
|
|
3578
3579
|
var b = state$9;
|
|
3579
3580
|
if (b) {
|
|
3580
3581
|
tokens = [b.time, b.event];
|
|
@@ -3592,30 +3593,30 @@ function encode$1 (event) {
|
|
|
3592
3593
|
}
|
|
3593
3594
|
reset$o();
|
|
3594
3595
|
break;
|
|
3595
|
-
case 25 /* Ping */:
|
|
3596
|
+
case 25 /* Event.Ping */:
|
|
3596
3597
|
tokens.push(data$h.gap);
|
|
3597
3598
|
queue(tokens);
|
|
3598
3599
|
break;
|
|
3599
|
-
case 35 /* Limit */:
|
|
3600
|
+
case 35 /* Event.Limit */:
|
|
3600
3601
|
tokens.push(data$4.check);
|
|
3601
3602
|
queue(tokens, false);
|
|
3602
3603
|
break;
|
|
3603
|
-
case 3 /* Upgrade */:
|
|
3604
|
+
case 3 /* Event.Upgrade */:
|
|
3604
3605
|
tokens.push(data$f.key);
|
|
3605
3606
|
queue(tokens);
|
|
3606
3607
|
break;
|
|
3607
|
-
case 2 /* Upload */:
|
|
3608
|
+
case 2 /* Event.Upload */:
|
|
3608
3609
|
tokens.push(track$1.sequence);
|
|
3609
3610
|
tokens.push(track$1.attempts);
|
|
3610
3611
|
tokens.push(track$1.status);
|
|
3611
3612
|
queue(tokens, false);
|
|
3612
3613
|
break;
|
|
3613
|
-
case 24 /* Custom */:
|
|
3614
|
+
case 24 /* Event.Custom */:
|
|
3614
3615
|
tokens.push(data$j.key);
|
|
3615
3616
|
tokens.push(data$j.value);
|
|
3616
3617
|
queue(tokens);
|
|
3617
3618
|
break;
|
|
3618
|
-
case 34 /* Variable */:
|
|
3619
|
+
case 34 /* Event.Variable */:
|
|
3619
3620
|
var variableKeys = Object.keys(data$e);
|
|
3620
3621
|
if (variableKeys.length > 0) {
|
|
3621
3622
|
for (var _i = 0, variableKeys_1 = variableKeys; _i < variableKeys_1.length; _i++) {
|
|
@@ -3627,7 +3628,7 @@ function encode$1 (event) {
|
|
|
3627
3628
|
queue(tokens, false);
|
|
3628
3629
|
}
|
|
3629
3630
|
break;
|
|
3630
|
-
case 0 /* Metric */:
|
|
3631
|
+
case 0 /* Event.Metric */:
|
|
3631
3632
|
var metricKeys = Object.keys(updates$3);
|
|
3632
3633
|
if (metricKeys.length > 0) {
|
|
3633
3634
|
for (var _a = 0, metricKeys_1 = metricKeys; _a < metricKeys_1.length; _a++) {
|
|
@@ -3642,7 +3643,7 @@ function encode$1 (event) {
|
|
|
3642
3643
|
queue(tokens, false);
|
|
3643
3644
|
}
|
|
3644
3645
|
break;
|
|
3645
|
-
case 1 /* Dimension */:
|
|
3646
|
+
case 1 /* Event.Dimension */:
|
|
3646
3647
|
var dimensionKeys = Object.keys(updates);
|
|
3647
3648
|
if (dimensionKeys.length > 0) {
|
|
3648
3649
|
for (var _b = 0, dimensionKeys_1 = dimensionKeys; _b < dimensionKeys_1.length; _b++) {
|
|
@@ -3655,7 +3656,7 @@ function encode$1 (event) {
|
|
|
3655
3656
|
queue(tokens, false);
|
|
3656
3657
|
}
|
|
3657
3658
|
break;
|
|
3658
|
-
case 36 /* Summary */:
|
|
3659
|
+
case 36 /* Event.Summary */:
|
|
3659
3660
|
var eventKeys = Object.keys(data$g);
|
|
3660
3661
|
if (eventKeys.length > 0) {
|
|
3661
3662
|
for (var _c = 0, eventKeys_1 = eventKeys; _c < eventKeys_1.length; _c++) {
|
|
@@ -3668,7 +3669,7 @@ function encode$1 (event) {
|
|
|
3668
3669
|
queue(tokens, false);
|
|
3669
3670
|
}
|
|
3670
3671
|
break;
|
|
3671
|
-
case 40 /* Extract */:
|
|
3672
|
+
case 40 /* Event.Extract */:
|
|
3672
3673
|
var extractKeys = keys;
|
|
3673
3674
|
for (var _d = 0, extractKeys_1 = extractKeys; _d < extractKeys_1.length; _d++) {
|
|
3674
3675
|
var e = extractKeys_1[_d];
|
|
@@ -3682,14 +3683,14 @@ function encode$1 (event) {
|
|
|
3682
3683
|
|
|
3683
3684
|
var data$4;
|
|
3684
3685
|
function start$b() {
|
|
3685
|
-
data$4 = { check: 0 /* None */ };
|
|
3686
|
+
data$4 = { check: 0 /* Check.None */ };
|
|
3686
3687
|
}
|
|
3687
3688
|
function check$2(bytes) {
|
|
3688
|
-
if (data$4.check === 0 /* None */) {
|
|
3689
|
+
if (data$4.check === 0 /* Check.None */) {
|
|
3689
3690
|
var reason = data$4.check;
|
|
3690
|
-
reason = data$1.sequence >= 128 /* PayloadLimit */ ? 1 /* Payload */ : reason;
|
|
3691
|
-
reason = time() > 7200000 /* ShutdownLimit */ ? 2 /* Shutdown */ : reason;
|
|
3692
|
-
reason = bytes > 10485760 /* PlaybackBytesLimit */ ? 2 /* Shutdown */ : reason;
|
|
3691
|
+
reason = data$1.sequence >= 128 /* Setting.PayloadLimit */ ? 1 /* Check.Payload */ : reason;
|
|
3692
|
+
reason = time() > 7200000 /* Setting.ShutdownLimit */ ? 2 /* Check.Shutdown */ : reason;
|
|
3693
|
+
reason = bytes > 10485760 /* Setting.PlaybackBytesLimit */ ? 2 /* Check.Shutdown */ : reason;
|
|
3693
3694
|
if (reason !== data$4.check) {
|
|
3694
3695
|
trigger(reason);
|
|
3695
3696
|
}
|
|
@@ -3701,8 +3702,8 @@ function trigger(reason) {
|
|
|
3701
3702
|
stop();
|
|
3702
3703
|
}
|
|
3703
3704
|
function compute$3() {
|
|
3704
|
-
if (data$4.check !== 0 /* None */) {
|
|
3705
|
-
encode$1(35 /* Limit */);
|
|
3705
|
+
if (data$4.check !== 0 /* Check.None */) {
|
|
3706
|
+
encode$1(35 /* Event.Limit */);
|
|
3706
3707
|
}
|
|
3707
3708
|
}
|
|
3708
3709
|
function stop$a() {
|
|
@@ -3723,7 +3724,7 @@ function log(dimension, value) {
|
|
|
3723
3724
|
// Check valid value before moving ahead
|
|
3724
3725
|
if (value) {
|
|
3725
3726
|
// Ensure received value is casted into a string if it wasn't a string to begin with
|
|
3726
|
-
value = ""
|
|
3727
|
+
value = "".concat(value);
|
|
3727
3728
|
if (!(dimension in data$3)) {
|
|
3728
3729
|
data$3[dimension] = [];
|
|
3729
3730
|
}
|
|
@@ -3736,14 +3737,14 @@ function log(dimension, value) {
|
|
|
3736
3737
|
}
|
|
3737
3738
|
updates[dimension].push(value);
|
|
3738
3739
|
// Limit check to ensure we have a cap on number of dimensions we can collect
|
|
3739
|
-
if (data$3[dimension].length > 128 /* CollectionLimit */) {
|
|
3740
|
-
trigger(5 /* Collection */);
|
|
3740
|
+
if (data$3[dimension].length > 128 /* Setting.CollectionLimit */) {
|
|
3741
|
+
trigger(5 /* Check.Collection */);
|
|
3741
3742
|
}
|
|
3742
3743
|
}
|
|
3743
3744
|
}
|
|
3744
3745
|
}
|
|
3745
3746
|
function compute$2() {
|
|
3746
|
-
encode$1(1 /* Dimension */);
|
|
3747
|
+
encode$1(1 /* Event.Dimension */);
|
|
3747
3748
|
}
|
|
3748
3749
|
function reset$3() {
|
|
3749
3750
|
updates = {};
|
|
@@ -3754,8 +3755,8 @@ var callbacks = [];
|
|
|
3754
3755
|
var rootDomain = null;
|
|
3755
3756
|
function start$9() {
|
|
3756
3757
|
rootDomain = null;
|
|
3757
|
-
var ua = navigator && "userAgent" in navigator ? navigator.userAgent : "" /* Empty */;
|
|
3758
|
-
var title = document && document.title ? document.title : "" /* Empty */;
|
|
3758
|
+
var ua = navigator && "userAgent" in navigator ? navigator.userAgent : "" /* Constant.Empty */;
|
|
3759
|
+
var title = document && document.title ? document.title : "" /* Constant.Empty */;
|
|
3759
3760
|
// Populate ids for this page
|
|
3760
3761
|
var s = session();
|
|
3761
3762
|
var u = user();
|
|
@@ -3766,27 +3767,27 @@ function start$9() {
|
|
|
3766
3767
|
pageNum: s.count
|
|
3767
3768
|
};
|
|
3768
3769
|
// Override configuration based on what's in the session storage, unless it is blank (e.g. using upload callback, like in devtools)
|
|
3769
|
-
config$1.lean = config$1.track && s.upgrade !== null ? s.upgrade === 0 /* False */ : config$1.lean;
|
|
3770
|
-
config$1.upload = config$1.track && typeof config$1.upload === "string" /* String */ && s.upload && s.upload.length > "https://" /* HTTPS */.length ? s.upload : config$1.upload;
|
|
3770
|
+
config$1.lean = config$1.track && s.upgrade !== null ? s.upgrade === 0 /* BooleanFlag.False */ : config$1.lean;
|
|
3771
|
+
config$1.upload = config$1.track && typeof config$1.upload === "string" /* Constant.String */ && s.upload && s.upload.length > "https://" /* Constant.HTTPS */.length ? s.upload : config$1.upload;
|
|
3771
3772
|
// Log dimensions
|
|
3772
|
-
log(0 /* UserAgent */, ua);
|
|
3773
|
-
log(3 /* PageTitle */, title);
|
|
3774
|
-
log(1 /* Url */, location.href);
|
|
3775
|
-
log(2 /* Referrer */, document.referrer);
|
|
3776
|
-
log(15 /* TabId */, tab());
|
|
3777
|
-
log(16 /* PageLanguage */, document.documentElement.lang);
|
|
3778
|
-
log(17 /* DocumentDirection */, document.dir);
|
|
3773
|
+
log(0 /* Dimension.UserAgent */, ua);
|
|
3774
|
+
log(3 /* Dimension.PageTitle */, title);
|
|
3775
|
+
log(1 /* Dimension.Url */, location.href);
|
|
3776
|
+
log(2 /* Dimension.Referrer */, document.referrer);
|
|
3777
|
+
log(15 /* Dimension.TabId */, tab());
|
|
3778
|
+
log(16 /* Dimension.PageLanguage */, document.documentElement.lang);
|
|
3779
|
+
log(17 /* Dimension.DocumentDirection */, document.dir);
|
|
3779
3780
|
if (navigator) {
|
|
3780
|
-
log(9 /* Language */, navigator.userLanguage || navigator.language);
|
|
3781
|
+
log(9 /* Dimension.Language */, navigator.userLanguage || navigator.language);
|
|
3781
3782
|
userAgentData();
|
|
3782
3783
|
}
|
|
3783
3784
|
// Metrics
|
|
3784
|
-
max(0 /* ClientTimestamp */, s.ts);
|
|
3785
|
-
max(1 /* Playback */, 0 /* False */);
|
|
3785
|
+
max(0 /* Metric.ClientTimestamp */, s.ts);
|
|
3786
|
+
max(1 /* Metric.Playback */, 0 /* BooleanFlag.False */);
|
|
3786
3787
|
if (screen) {
|
|
3787
|
-
max(14 /* ScreenWidth */, Math.round(screen.width));
|
|
3788
|
-
max(15 /* ScreenHeight */, Math.round(screen.height));
|
|
3789
|
-
max(16 /* ColorDepth */, Math.round(screen.colorDepth));
|
|
3788
|
+
max(14 /* Metric.ScreenWidth */, Math.round(screen.width));
|
|
3789
|
+
max(15 /* Metric.ScreenHeight */, Math.round(screen.height));
|
|
3790
|
+
max(16 /* Metric.ColorDepth */, Math.round(screen.colorDepth));
|
|
3790
3791
|
}
|
|
3791
3792
|
// Read cookies specified in configuration
|
|
3792
3793
|
for (var _i = 0, _a = config$1.cookies; _i < _a.length; _i++) {
|
|
@@ -3807,13 +3808,13 @@ function userAgentData() {
|
|
|
3807
3808
|
"uaFullVersion"])
|
|
3808
3809
|
.then(function (ua) {
|
|
3809
3810
|
var _a;
|
|
3810
|
-
log(22 /* Platform */, ua.platform);
|
|
3811
|
-
log(23 /* PlatformVersion */, ua.platformVersion);
|
|
3811
|
+
log(22 /* Dimension.Platform */, ua.platform);
|
|
3812
|
+
log(23 /* Dimension.PlatformVersion */, ua.platformVersion);
|
|
3812
3813
|
(_a = ua.brands) === null || _a === void 0 ? void 0 : _a.forEach(function (brand) {
|
|
3813
|
-
log(24 /* Brand */, brand.name + "~" /* Tilde */ + brand.version);
|
|
3814
|
+
log(24 /* Dimension.Brand */, brand.name + "~" /* Constant.Tilde */ + brand.version);
|
|
3814
3815
|
});
|
|
3815
|
-
log(25 /* Model */, ua.model);
|
|
3816
|
-
max(27 /* Mobile */, ua.mobile ? 1 /* True */ : 0 /* False */);
|
|
3816
|
+
log(25 /* Dimension.Model */, ua.model);
|
|
3817
|
+
max(27 /* Metric.Mobile */, ua.mobile ? 1 /* BooleanFlag.True */ : 0 /* BooleanFlag.False */);
|
|
3817
3818
|
});
|
|
3818
3819
|
}
|
|
3819
3820
|
}
|
|
@@ -3830,33 +3831,33 @@ function metadata(cb, wait) {
|
|
|
3830
3831
|
callbacks.push({ callback: cb, wait: wait });
|
|
3831
3832
|
}
|
|
3832
3833
|
function id() {
|
|
3833
|
-
return data$2 ? [data$2.userId, data$2.sessionId, data$2.pageNum].join("." /* Dot */) : "" /* Empty */;
|
|
3834
|
+
return data$2 ? [data$2.userId, data$2.sessionId, data$2.pageNum].join("." /* Constant.Dot */) : "" /* Constant.Empty */;
|
|
3834
3835
|
}
|
|
3835
3836
|
function consent() {
|
|
3836
3837
|
if (active()) {
|
|
3837
3838
|
config$1.track = true;
|
|
3838
|
-
track(user(), 1 /* True */);
|
|
3839
|
+
track(user(), 1 /* BooleanFlag.True */);
|
|
3839
3840
|
}
|
|
3840
3841
|
}
|
|
3841
3842
|
function clear() {
|
|
3842
3843
|
// Clear any stored information in the cookie that tracks session information so we can restart fresh the next time
|
|
3843
|
-
setCookie("_clsk" /* SessionKey */, "" /* Empty */, 0);
|
|
3844
|
+
setCookie("_clsk" /* Constant.SessionKey */, "" /* Constant.Empty */, 0);
|
|
3844
3845
|
}
|
|
3845
3846
|
function tab() {
|
|
3846
3847
|
var id = shortid();
|
|
3847
|
-
if (config$1.track && supported(window, "sessionStorage" /* SessionStorage */)) {
|
|
3848
|
-
var value = sessionStorage.getItem("_cltk" /* TabKey */);
|
|
3848
|
+
if (config$1.track && supported(window, "sessionStorage" /* Constant.SessionStorage */)) {
|
|
3849
|
+
var value = sessionStorage.getItem("_cltk" /* Constant.TabKey */);
|
|
3849
3850
|
id = value ? value : id;
|
|
3850
|
-
sessionStorage.setItem("_cltk" /* TabKey */, id);
|
|
3851
|
+
sessionStorage.setItem("_cltk" /* Constant.TabKey */, id);
|
|
3851
3852
|
}
|
|
3852
3853
|
return id;
|
|
3853
3854
|
}
|
|
3854
3855
|
function save() {
|
|
3855
3856
|
var ts = Math.round(Date.now());
|
|
3856
|
-
var upload = config$1.upload && typeof config$1.upload === "string" /* String */ ? config$1.upload.replace("https://" /* HTTPS */, "" /* Empty */) : "" /* Empty */;
|
|
3857
|
-
var upgrade = config$1.lean ? 0 /* False */ : 1 /* True */;
|
|
3857
|
+
var upload = config$1.upload && typeof config$1.upload === "string" /* Constant.String */ ? config$1.upload.replace("https://" /* Constant.HTTPS */, "" /* Constant.Empty */) : "" /* Constant.Empty */;
|
|
3858
|
+
var upgrade = config$1.lean ? 0 /* BooleanFlag.False */ : 1 /* BooleanFlag.True */;
|
|
3858
3859
|
processCallback(upgrade);
|
|
3859
|
-
setCookie("_clsk" /* SessionKey */, [data$2.sessionId, ts, data$2.pageNum, upgrade, upload].join("|" /* Pipe */), 1 /* SessionExpire */);
|
|
3860
|
+
setCookie("_clsk" /* Constant.SessionKey */, [data$2.sessionId, ts, data$2.pageNum, upgrade, upload].join("|" /* Constant.Pipe */), 1 /* Setting.SessionExpire */);
|
|
3860
3861
|
}
|
|
3861
3862
|
function processCallback(upgrade) {
|
|
3862
3863
|
if (callbacks.length > 0) {
|
|
@@ -3881,10 +3882,10 @@ function track(u, consent) {
|
|
|
3881
3882
|
consent = consent === null ? u.consent : consent;
|
|
3882
3883
|
// Convert time precision into days to reduce number of bytes we have to write in a cookie
|
|
3883
3884
|
// E.g. Math.ceil(1628735962643 / (24*60*60*1000)) => 18852 (days) => ejo in base36 (13 bytes => 3 bytes)
|
|
3884
|
-
var end = Math.ceil((Date.now() + (365 /* Expire */ * 86400000 /* Day */)) / 86400000 /* Day */);
|
|
3885
|
+
var end = Math.ceil((Date.now() + (365 /* Setting.Expire */ * 86400000 /* Time.Day */)) / 86400000 /* Time.Day */);
|
|
3885
3886
|
// To avoid cookie churn, write user id cookie only once every day
|
|
3886
|
-
if (u.expiry === null || Math.abs(end - u.expiry) >= 1 /* CookieInterval */ || u.consent !== consent) {
|
|
3887
|
-
setCookie("_clck" /* CookieKey */, [data$2.userId, 1 /* CookieVersion */, end.toString(36), consent].join("|" /* Pipe */), 365 /* Expire */);
|
|
3887
|
+
if (u.expiry === null || Math.abs(end - u.expiry) >= 1 /* Setting.CookieInterval */ || u.consent !== consent) {
|
|
3888
|
+
setCookie("_clck" /* Constant.CookieKey */, [data$2.userId, 1 /* Setting.CookieVersion */, end.toString(36), consent].join("|" /* Constant.Pipe */), 365 /* Setting.Expire */);
|
|
3888
3889
|
}
|
|
3889
3890
|
}
|
|
3890
3891
|
function shortid() {
|
|
@@ -3895,17 +3896,17 @@ function shortid() {
|
|
|
3895
3896
|
return id.toString(36);
|
|
3896
3897
|
}
|
|
3897
3898
|
function session() {
|
|
3898
|
-
var output = { session: shortid(), ts: Math.round(Date.now()), count: 1, upgrade: null, upload: "" /* Empty */ };
|
|
3899
|
-
var value = getCookie("_clsk" /* SessionKey */);
|
|
3899
|
+
var output = { session: shortid(), ts: Math.round(Date.now()), count: 1, upgrade: null, upload: "" /* Constant.Empty */ };
|
|
3900
|
+
var value = getCookie("_clsk" /* Constant.SessionKey */);
|
|
3900
3901
|
if (value) {
|
|
3901
|
-
var parts = value.split("|" /* Pipe */);
|
|
3902
|
+
var parts = value.split("|" /* Constant.Pipe */);
|
|
3902
3903
|
// Making it backward & forward compatible by using greater than comparison (v0.6.21)
|
|
3903
3904
|
// In future version, we can reduce the parts length to be 5 where the last part contains the full upload URL
|
|
3904
|
-
if (parts.length >= 5 && output.ts - num(parts[1]) < 1800000 /* SessionTimeout */) {
|
|
3905
|
+
if (parts.length >= 5 && output.ts - num(parts[1]) < 1800000 /* Setting.SessionTimeout */) {
|
|
3905
3906
|
output.session = parts[0];
|
|
3906
3907
|
output.count = num(parts[2]) + 1;
|
|
3907
3908
|
output.upgrade = num(parts[3]);
|
|
3908
|
-
output.upload = parts.length >= 6 ? ""
|
|
3909
|
+
output.upload = parts.length >= 6 ? "".concat("https://" /* Constant.HTTPS */).concat(parts[5], "/").concat(parts[4]) : "".concat("https://" /* Constant.HTTPS */).concat(parts[4]);
|
|
3909
3910
|
}
|
|
3910
3911
|
}
|
|
3911
3912
|
return output;
|
|
@@ -3915,26 +3916,26 @@ function num(string, base) {
|
|
|
3915
3916
|
return parseInt(string, base);
|
|
3916
3917
|
}
|
|
3917
3918
|
function user() {
|
|
3918
|
-
var output = { id: shortid(), expiry: null, consent: 0 /* False */ };
|
|
3919
|
-
var cookie = getCookie("_clck" /* CookieKey */);
|
|
3919
|
+
var output = { id: shortid(), expiry: null, consent: 0 /* BooleanFlag.False */ };
|
|
3920
|
+
var cookie = getCookie("_clck" /* Constant.CookieKey */);
|
|
3920
3921
|
if (cookie && cookie.length > 0) {
|
|
3921
3922
|
// Splitting and looking up first part for forward compatibility, in case we wish to store additional information in a cookie
|
|
3922
|
-
var parts = cookie.split("|" /* Pipe */);
|
|
3923
|
+
var parts = cookie.split("|" /* Constant.Pipe */);
|
|
3923
3924
|
// For backward compatibility introduced in v0.6.18; following code can be removed with future iterations
|
|
3924
3925
|
// Count number of times Clarity's user cookie crumb appears in document.cookie (could be on different sub-domains e.g. www.domain.com and .domain.com)
|
|
3925
3926
|
var count = 0;
|
|
3926
|
-
for (var _i = 0, _a = document.cookie.split(";" /* Semicolon */); _i < _a.length; _i++) {
|
|
3927
|
+
for (var _i = 0, _a = document.cookie.split(";" /* Constant.Semicolon */); _i < _a.length; _i++) {
|
|
3927
3928
|
var c = _a[_i];
|
|
3928
|
-
count += c.split("=" /* Equals */)[0].trim() === "_clck" /* CookieKey */ ? 1 : 0;
|
|
3929
|
+
count += c.split("=" /* Constant.Equals */)[0].trim() === "_clck" /* Constant.CookieKey */ ? 1 : 0;
|
|
3929
3930
|
}
|
|
3930
3931
|
// Check if we either got version-less cookie value or saw multiple copies of the user cookie crumbs
|
|
3931
3932
|
// In both these cases, we go ahead and delete the existing cookie set on current domain
|
|
3932
3933
|
if (parts.length === 1 || count > 1) {
|
|
3933
|
-
var deleted = ""
|
|
3934
|
+
var deleted = "".concat(";" /* Constant.Semicolon */).concat("expires=" /* Constant.Expires */).concat((new Date(0)).toUTCString()).concat(";path=/" /* Constant.Path */);
|
|
3934
3935
|
// First, delete current user cookie which might be set on current sub-domain vs. root domain
|
|
3935
|
-
document.cookie = "_clck" /* CookieKey
|
|
3936
|
+
document.cookie = "".concat("_clck" /* Constant.CookieKey */, "=").concat(deleted);
|
|
3936
3937
|
// Second, same thing for current session cookie so it can be re-written later with the root domain
|
|
3937
|
-
document.cookie = "_clsk" /* SessionKey
|
|
3938
|
+
document.cookie = "".concat("_clsk" /* Constant.SessionKey */, "=").concat(deleted);
|
|
3938
3939
|
}
|
|
3939
3940
|
// End code for backward compatibility
|
|
3940
3941
|
// Read version information and timestamp from cookie, if available
|
|
@@ -3943,21 +3944,21 @@ function user() {
|
|
|
3943
3944
|
}
|
|
3944
3945
|
// Check if we have explicit consent to track this user
|
|
3945
3946
|
if (parts.length > 3 && num(parts[3]) === 1) {
|
|
3946
|
-
output.consent = 1 /* True */;
|
|
3947
|
+
output.consent = 1 /* BooleanFlag.True */;
|
|
3947
3948
|
}
|
|
3948
3949
|
// Set track configuration to true for this user if we have explicit consent, regardless of project setting
|
|
3949
|
-
config$1.track = config$1.track || output.consent === 1 /* True */;
|
|
3950
|
+
config$1.track = config$1.track || output.consent === 1 /* BooleanFlag.True */;
|
|
3950
3951
|
// Get user id from cookie only if we tracking is enabled, otherwise fallback to a random id
|
|
3951
3952
|
output.id = config$1.track ? parts[0] : output.id;
|
|
3952
3953
|
}
|
|
3953
3954
|
return output;
|
|
3954
3955
|
}
|
|
3955
3956
|
function getCookie(key) {
|
|
3956
|
-
if (supported(document, "cookie" /* Cookie */)) {
|
|
3957
|
-
var cookies = document.cookie.split(";" /* Semicolon */);
|
|
3957
|
+
if (supported(document, "cookie" /* Constant.Cookie */)) {
|
|
3958
|
+
var cookies = document.cookie.split(";" /* Constant.Semicolon */);
|
|
3958
3959
|
if (cookies) {
|
|
3959
3960
|
for (var i = 0; i < cookies.length; i++) {
|
|
3960
|
-
var pair = cookies[i].split("=" /* Equals */);
|
|
3961
|
+
var pair = cookies[i].split("=" /* Constant.Equals */);
|
|
3961
3962
|
if (pair.length > 1 && pair[0] && pair[0].trim() === key) {
|
|
3962
3963
|
return pair[1];
|
|
3963
3964
|
}
|
|
@@ -3967,23 +3968,23 @@ function getCookie(key) {
|
|
|
3967
3968
|
return null;
|
|
3968
3969
|
}
|
|
3969
3970
|
function setCookie(key, value, time) {
|
|
3970
|
-
if (config$1.track && ((navigator && navigator.cookieEnabled) || supported(document, "cookie" /* Cookie */))) {
|
|
3971
|
+
if (config$1.track && ((navigator && navigator.cookieEnabled) || supported(document, "cookie" /* Constant.Cookie */))) {
|
|
3971
3972
|
var expiry = new Date();
|
|
3972
3973
|
expiry.setDate(expiry.getDate() + time);
|
|
3973
|
-
var expires = expiry ? "expires=" /* Expires */ + expiry.toUTCString() : "" /* Empty */;
|
|
3974
|
-
var cookie = key
|
|
3974
|
+
var expires = expiry ? "expires=" /* Constant.Expires */ + expiry.toUTCString() : "" /* Constant.Empty */;
|
|
3975
|
+
var cookie = "".concat(key, "=").concat(value).concat(";" /* Constant.Semicolon */).concat(expires).concat(";path=/" /* Constant.Path */);
|
|
3975
3976
|
try {
|
|
3976
3977
|
// Attempt to get the root domain only once and fall back to writing cookie on the current domain.
|
|
3977
3978
|
if (rootDomain === null) {
|
|
3978
|
-
var hostname = location.hostname ? location.hostname.split("." /* Dot */) : [];
|
|
3979
|
+
var hostname = location.hostname ? location.hostname.split("." /* Constant.Dot */) : [];
|
|
3979
3980
|
// Walk backwards on a domain and attempt to set a cookie, until successful
|
|
3980
3981
|
for (var i = hostname.length - 1; i >= 0; i--) {
|
|
3981
|
-
rootDomain = "."
|
|
3982
|
+
rootDomain = ".".concat(hostname[i]).concat(rootDomain ? rootDomain : "" /* Constant.Empty */);
|
|
3982
3983
|
// We do not wish to attempt writing a cookie on the absolute last part of the domain, e.g. .com or .net.
|
|
3983
3984
|
// So we start attempting after second-last part, e.g. .domain.com (PASS) or .co.uk (FAIL)
|
|
3984
3985
|
if (i < hostname.length - 1) {
|
|
3985
3986
|
// Write the cookie on the current computed top level domain
|
|
3986
|
-
document.cookie = ""
|
|
3987
|
+
document.cookie = "".concat(cookie).concat(";" /* Constant.Semicolon */).concat("domain=" /* Constant.Domain */).concat(rootDomain);
|
|
3987
3988
|
// Once written, check if the cookie exists and its value matches exactly with what we intended to set
|
|
3988
3989
|
// Checking for exact value match helps us eliminate a corner case where the cookie may already be present with a different value
|
|
3989
3990
|
// If the check is successful, no more action is required and we can return from the function since rootDomain cookie is already set
|
|
@@ -3995,13 +3996,13 @@ function setCookie(key, value, time) {
|
|
|
3995
3996
|
}
|
|
3996
3997
|
// Finally, if we were not successful and gone through all the options, play it safe and reset rootDomain to be empty
|
|
3997
3998
|
// This forces our code to fall back to always writing cookie to the current domain
|
|
3998
|
-
rootDomain = "" /* Empty */;
|
|
3999
|
+
rootDomain = "" /* Constant.Empty */;
|
|
3999
4000
|
}
|
|
4000
4001
|
}
|
|
4001
4002
|
catch (_a) {
|
|
4002
|
-
rootDomain = "" /* Empty */;
|
|
4003
|
+
rootDomain = "" /* Constant.Empty */;
|
|
4003
4004
|
}
|
|
4004
|
-
document.cookie = rootDomain ? ""
|
|
4005
|
+
document.cookie = rootDomain ? "".concat(cookie).concat(";" /* Constant.Semicolon */).concat("domain=" /* Constant.Domain */).concat(rootDomain) : cookie;
|
|
4005
4006
|
}
|
|
4006
4007
|
}
|
|
4007
4008
|
|
|
@@ -4017,8 +4018,8 @@ function start$8() {
|
|
|
4017
4018
|
userId: m.userId,
|
|
4018
4019
|
sessionId: m.sessionId,
|
|
4019
4020
|
pageNum: m.pageNum,
|
|
4020
|
-
upload: 0 /* Async */,
|
|
4021
|
-
end: 0 /* False */
|
|
4021
|
+
upload: 0 /* Upload.Async */,
|
|
4022
|
+
end: 0 /* BooleanFlag.False */
|
|
4022
4023
|
};
|
|
4023
4024
|
}
|
|
4024
4025
|
function stop$7() {
|
|
@@ -4028,8 +4029,8 @@ function envelope(last) {
|
|
|
4028
4029
|
data$1.start = data$1.start + data$1.duration;
|
|
4029
4030
|
data$1.duration = time() - data$1.start;
|
|
4030
4031
|
data$1.sequence++;
|
|
4031
|
-
data$1.upload = last && "sendBeacon" in navigator ? 1 /* Beacon */ : 0 /* Async */;
|
|
4032
|
-
data$1.end = last ? 1 /* True */ : 0 /* False */;
|
|
4032
|
+
data$1.upload = last && "sendBeacon" in navigator ? 1 /* Upload.Beacon */ : 0 /* Upload.Async */;
|
|
4033
|
+
data$1.end = last ? 1 /* BooleanFlag.True */ : 0 /* BooleanFlag.False */;
|
|
4033
4034
|
return [
|
|
4034
4035
|
data$1.version,
|
|
4035
4036
|
data$1.sequence,
|
|
@@ -4082,10 +4083,10 @@ function measure (method) {
|
|
|
4082
4083
|
throw report(ex);
|
|
4083
4084
|
}
|
|
4084
4085
|
var duration = performance.now() - start;
|
|
4085
|
-
sum(4 /* TotalCost */, duration);
|
|
4086
|
-
if (duration > 30 /* LongTask */) {
|
|
4087
|
-
count$1(7 /* LongTaskCount */);
|
|
4088
|
-
max(6 /* ThreadBlockedTime */, duration);
|
|
4086
|
+
sum(4 /* Metric.TotalCost */, duration);
|
|
4087
|
+
if (duration > 30 /* Setting.LongTask */) {
|
|
4088
|
+
count$1(7 /* Metric.LongTaskCount */);
|
|
4089
|
+
max(6 /* Metric.ThreadBlockedTime */, duration);
|
|
4089
4090
|
}
|
|
4090
4091
|
};
|
|
4091
4092
|
}
|
|
@@ -4097,7 +4098,7 @@ function bind(target, event, listener, capture) {
|
|
|
4097
4098
|
// Wrapping following lines inside try / catch to cover edge cases where we might try to access an inaccessible element.
|
|
4098
4099
|
// E.g. Iframe may start off as same-origin but later turn into cross-origin, and the following lines will throw an exception.
|
|
4099
4100
|
try {
|
|
4100
|
-
target[api("addEventListener" /* AddEventListener */)](event, listener, capture);
|
|
4101
|
+
target[api("addEventListener" /* Constant.AddEventListener */)](event, listener, capture);
|
|
4101
4102
|
bindings.push({ event: event, target: target, listener: listener, capture: capture });
|
|
4102
4103
|
}
|
|
4103
4104
|
catch ( /* do nothing */_a) { /* do nothing */ }
|
|
@@ -4108,7 +4109,7 @@ function reset$1() {
|
|
|
4108
4109
|
var binding = bindings_1[_i];
|
|
4109
4110
|
// Wrapping inside try / catch to avoid situations where the element may be destroyed before we get a chance to unbind
|
|
4110
4111
|
try {
|
|
4111
|
-
binding.target[api("removeEventListener" /* RemoveEventListener */)](binding.event, binding.listener, binding.capture);
|
|
4112
|
+
binding.target[api("removeEventListener" /* Constant.RemoveEventListener */)](binding.event, binding.listener, binding.capture);
|
|
4112
4113
|
}
|
|
4113
4114
|
catch ( /* do nothing */_a) { /* do nothing */ }
|
|
4114
4115
|
}
|
|
@@ -4145,8 +4146,8 @@ function start$7() {
|
|
|
4145
4146
|
}
|
|
4146
4147
|
}
|
|
4147
4148
|
function check$1() {
|
|
4148
|
-
if (count++ > 20 /* CallStackDepth */) {
|
|
4149
|
-
log$1(4 /* CallStackDepth */, 0 /* Info */);
|
|
4149
|
+
if (count++ > 20 /* Setting.CallStackDepth */) {
|
|
4150
|
+
log$1(4 /* Code.CallStackDepth */, 0 /* Severity.Info */);
|
|
4150
4151
|
return false;
|
|
4151
4152
|
}
|
|
4152
4153
|
return true;
|
|
@@ -4156,15 +4157,15 @@ function compute$1() {
|
|
|
4156
4157
|
if (url !== getCurrentUrl()) {
|
|
4157
4158
|
// If the url changed, start tracking it as a new page
|
|
4158
4159
|
stop();
|
|
4159
|
-
window.setTimeout(restart$1, 250 /* RestartDelay */);
|
|
4160
|
+
window.setTimeout(restart$1, 250 /* Setting.RestartDelay */);
|
|
4160
4161
|
}
|
|
4161
4162
|
}
|
|
4162
4163
|
function restart$1() {
|
|
4163
4164
|
start();
|
|
4164
|
-
max(29 /* SinglePage */, 1 /* True */);
|
|
4165
|
+
max(29 /* Metric.SinglePage */, 1 /* BooleanFlag.True */);
|
|
4165
4166
|
}
|
|
4166
4167
|
function getCurrentUrl() {
|
|
4167
|
-
return location.href ? location.href.replace(location.hash, "" /* Empty */) : location.href;
|
|
4168
|
+
return location.href ? location.href.replace(location.hash, "" /* Constant.Empty */) : location.href;
|
|
4168
4169
|
}
|
|
4169
4170
|
function stop$6() {
|
|
4170
4171
|
url = null;
|
|
@@ -4227,7 +4228,7 @@ function config(override) {
|
|
|
4227
4228
|
// not holding the session during inactive time periods.
|
|
4228
4229
|
function suspend() {
|
|
4229
4230
|
if (status) {
|
|
4230
|
-
event("clarity" /* Clarity */, "suspend" /* Suspend */);
|
|
4231
|
+
event("clarity" /* Constant.Clarity */, "suspend" /* Constant.Suspend */);
|
|
4231
4232
|
stop();
|
|
4232
4233
|
["mousemove", "touchstart"].forEach(function (x) { return bind(document, x, restart); });
|
|
4233
4234
|
["resize", "scroll", "pageshow"].forEach(function (x) { return bind(window, x, restart); });
|
|
@@ -4235,7 +4236,7 @@ function suspend() {
|
|
|
4235
4236
|
}
|
|
4236
4237
|
function restart() {
|
|
4237
4238
|
start();
|
|
4238
|
-
event("clarity" /* Clarity */, "restart" /* Restart */);
|
|
4239
|
+
event("clarity" /* Constant.Clarity */, "restart" /* Constant.Restart */);
|
|
4239
4240
|
}
|
|
4240
4241
|
|
|
4241
4242
|
function start$5() {
|
|
@@ -4254,7 +4255,7 @@ var diagnostic = /*#__PURE__*/Object.freeze({
|
|
|
4254
4255
|
});
|
|
4255
4256
|
|
|
4256
4257
|
function start$4() {
|
|
4257
|
-
schedule$1(discover, 1 /* High */).then(function () {
|
|
4258
|
+
schedule$1(discover, 1 /* Priority.High */).then(function () {
|
|
4258
4259
|
measure(compute$7)();
|
|
4259
4260
|
measure(compute$6)();
|
|
4260
4261
|
});
|
|
@@ -4266,12 +4267,12 @@ function discover() {
|
|
|
4266
4267
|
switch (_a.label) {
|
|
4267
4268
|
case 0:
|
|
4268
4269
|
ts = time();
|
|
4269
|
-
timer = { id: id(), cost: 3 /* LayoutCost */ };
|
|
4270
|
+
timer = { id: id(), cost: 3 /* Metric.LayoutCost */ };
|
|
4270
4271
|
start$w(timer);
|
|
4271
|
-
return [4 /*yield*/, traverse(document, timer, 0 /* Discover */)];
|
|
4272
|
+
return [4 /*yield*/, traverse(document, timer, 0 /* Source.Discover */)];
|
|
4272
4273
|
case 1:
|
|
4273
4274
|
_a.sent();
|
|
4274
|
-
return [4 /*yield*/, encode$4(5 /* Discover */, timer, ts)];
|
|
4275
|
+
return [4 /*yield*/, encode$4(5 /* Event.Discover */, timer, ts)];
|
|
4275
4276
|
case 2:
|
|
4276
4277
|
_a.sent();
|
|
4277
4278
|
stop$t(timer);
|
|
@@ -4310,7 +4311,7 @@ function encode (type) {
|
|
|
4310
4311
|
t = time();
|
|
4311
4312
|
tokens = [t, type];
|
|
4312
4313
|
switch (type) {
|
|
4313
|
-
case 29 /* Navigation */:
|
|
4314
|
+
case 29 /* Event.Navigation */:
|
|
4314
4315
|
tokens.push(data.fetchStart);
|
|
4315
4316
|
tokens.push(data.connectStart);
|
|
4316
4317
|
tokens.push(data.connectEnd);
|
|
@@ -4359,11 +4360,11 @@ function compute(entry) {
|
|
|
4359
4360
|
encodedSize: entry.encodedBodySize ? entry.encodedBodySize : 0,
|
|
4360
4361
|
decodedSize: entry.decodedBodySize ? entry.decodedBodySize : 0
|
|
4361
4362
|
};
|
|
4362
|
-
encode(29 /* Navigation */);
|
|
4363
|
+
encode(29 /* Event.Navigation */);
|
|
4363
4364
|
}
|
|
4364
4365
|
|
|
4365
4366
|
var observer;
|
|
4366
|
-
var types = ["navigation" /* Navigation */, "resource" /* Resource */, "longtask" /* LongTask */, "first-input" /* FID */, "layout-shift" /* CLS */, "largest-contentful-paint" /* LCP */];
|
|
4367
|
+
var types = ["navigation" /* Constant.Navigation */, "resource" /* Constant.Resource */, "longtask" /* Constant.LongTask */, "first-input" /* Constant.FID */, "layout-shift" /* Constant.CLS */, "largest-contentful-paint" /* Constant.LCP */];
|
|
4367
4368
|
function start$2() {
|
|
4368
4369
|
// Check the browser support performance observer as a pre-requisite for any performance measurement
|
|
4369
4370
|
if (window["PerformanceObserver"] && PerformanceObserver.supportedEntryTypes) {
|
|
@@ -4378,7 +4379,7 @@ function start$2() {
|
|
|
4378
4379
|
}
|
|
4379
4380
|
}
|
|
4380
4381
|
else {
|
|
4381
|
-
log$1(3 /* PerformanceObserver */, 0 /* Info */);
|
|
4382
|
+
log$1(3 /* Code.PerformanceObserver */, 0 /* Severity.Info */);
|
|
4382
4383
|
}
|
|
4383
4384
|
}
|
|
4384
4385
|
function observe() {
|
|
@@ -4398,15 +4399,15 @@ function observe() {
|
|
|
4398
4399
|
if (PerformanceObserver.supportedEntryTypes.indexOf(x) >= 0) {
|
|
4399
4400
|
// Initialize CLS with a value of zero. It's possible (and recommended) for sites to not have any cumulative layout shift.
|
|
4400
4401
|
// In those cases, we want to still initialize the metric in Clarity
|
|
4401
|
-
if (x === "layout-shift" /* CLS */) {
|
|
4402
|
-
sum(9 /* CumulativeLayoutShift */, 0);
|
|
4402
|
+
if (x === "layout-shift" /* Constant.CLS */) {
|
|
4403
|
+
sum(9 /* Metric.CumulativeLayoutShift */, 0);
|
|
4403
4404
|
}
|
|
4404
4405
|
observer.observe({ type: x, buffered: true });
|
|
4405
4406
|
}
|
|
4406
4407
|
}
|
|
4407
4408
|
}
|
|
4408
4409
|
catch (_a) {
|
|
4409
|
-
log$1(3 /* PerformanceObserver */, 1 /* Warning */);
|
|
4410
|
+
log$1(3 /* Code.PerformanceObserver */, 1 /* Severity.Warning */);
|
|
4410
4411
|
}
|
|
4411
4412
|
}
|
|
4412
4413
|
function handle(entries) {
|
|
@@ -4417,41 +4418,41 @@ function process(entries) {
|
|
|
4417
4418
|
for (var i = 0; i < entries.length; i++) {
|
|
4418
4419
|
var entry = entries[i];
|
|
4419
4420
|
switch (entry.entryType) {
|
|
4420
|
-
case "navigation" /* Navigation */:
|
|
4421
|
+
case "navigation" /* Constant.Navigation */:
|
|
4421
4422
|
compute(entry);
|
|
4422
4423
|
break;
|
|
4423
|
-
case "resource" /* Resource */:
|
|
4424
|
+
case "resource" /* Constant.Resource */:
|
|
4424
4425
|
var name_1 = entry.name;
|
|
4425
|
-
log(4 /* NetworkHosts */, host(name_1));
|
|
4426
|
+
log(4 /* Dimension.NetworkHosts */, host(name_1));
|
|
4426
4427
|
if (name_1 === config$1.upload || name_1 === config$1.fallback) {
|
|
4427
|
-
max(28 /* UploadTime */, entry.duration);
|
|
4428
|
+
max(28 /* Metric.UploadTime */, entry.duration);
|
|
4428
4429
|
}
|
|
4429
4430
|
break;
|
|
4430
|
-
case "longtask" /* LongTask */:
|
|
4431
|
-
count$1(7 /* LongTaskCount */);
|
|
4431
|
+
case "longtask" /* Constant.LongTask */:
|
|
4432
|
+
count$1(7 /* Metric.LongTaskCount */);
|
|
4432
4433
|
break;
|
|
4433
|
-
case "first-input" /* FID */:
|
|
4434
|
+
case "first-input" /* Constant.FID */:
|
|
4434
4435
|
if (visible) {
|
|
4435
|
-
max(10 /* FirstInputDelay */, entry["processingStart"] - entry.startTime);
|
|
4436
|
+
max(10 /* Metric.FirstInputDelay */, entry["processingStart"] - entry.startTime);
|
|
4436
4437
|
}
|
|
4437
4438
|
break;
|
|
4438
|
-
case "layout-shift" /* CLS */:
|
|
4439
|
+
case "layout-shift" /* Constant.CLS */:
|
|
4439
4440
|
// Scale the value to avoid sending back floating point number
|
|
4440
4441
|
if (visible && !entry["hadRecentInput"]) {
|
|
4441
|
-
sum(9 /* CumulativeLayoutShift */, entry["value"] * 1000);
|
|
4442
|
+
sum(9 /* Metric.CumulativeLayoutShift */, entry["value"] * 1000);
|
|
4442
4443
|
}
|
|
4443
4444
|
break;
|
|
4444
|
-
case "largest-contentful-paint" /* LCP */:
|
|
4445
|
+
case "largest-contentful-paint" /* Constant.LCP */:
|
|
4445
4446
|
if (visible) {
|
|
4446
|
-
max(8 /* LargestPaint */, entry.startTime);
|
|
4447
|
+
max(8 /* Metric.LargestPaint */, entry.startTime);
|
|
4447
4448
|
}
|
|
4448
4449
|
break;
|
|
4449
4450
|
}
|
|
4450
4451
|
}
|
|
4451
|
-
if (performance && "memory" /* Memory */ in performance && performance["memory" /* Memory */].usedJSHeapSize) {
|
|
4452
|
+
if (performance && "memory" /* Constant.Memory */ in performance && performance["memory" /* Constant.Memory */].usedJSHeapSize) {
|
|
4452
4453
|
// Track consumed memory (MBs) where "memory" API is available
|
|
4453
4454
|
// Reference: https://developer.mozilla.org/en-US/docs/Web/API/Performance/memory
|
|
4454
|
-
max(30 /* UsedMemory */, Math.abs(performance["memory" /* Memory */].usedJSHeapSize / 1048576 /* MegaByte */));
|
|
4455
|
+
max(30 /* Metric.UsedMemory */, Math.abs(performance["memory" /* Constant.Memory */].usedJSHeapSize / 1048576 /* Setting.MegaByte */));
|
|
4455
4456
|
}
|
|
4456
4457
|
}
|
|
4457
4458
|
function stop$2() {
|
|
@@ -4499,7 +4500,7 @@ function start(config$1) {
|
|
|
4499
4500
|
// performance impact even further. For reference, we are talking single digit milliseconds optimization here, not seconds.
|
|
4500
4501
|
function pause() {
|
|
4501
4502
|
if (active()) {
|
|
4502
|
-
event("clarity" /* Clarity */, "pause" /* Pause */);
|
|
4503
|
+
event("clarity" /* Constant.Clarity */, "pause" /* Constant.Pause */);
|
|
4503
4504
|
pause$1();
|
|
4504
4505
|
}
|
|
4505
4506
|
}
|
|
@@ -4507,7 +4508,7 @@ function pause() {
|
|
|
4507
4508
|
function resume() {
|
|
4508
4509
|
if (active()) {
|
|
4509
4510
|
resume$1();
|
|
4510
|
-
event("clarity" /* Clarity */, "resume" /* Resume */);
|
|
4511
|
+
event("clarity" /* Constant.Clarity */, "resume" /* Constant.Resume */);
|
|
4511
4512
|
}
|
|
4512
4513
|
}
|
|
4513
4514
|
function stop() {
|