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.js
CHANGED
|
@@ -79,7 +79,7 @@ var envelope$1 = /*#__PURE__*/Object.freeze({
|
|
|
79
79
|
|
|
80
80
|
var config$1 = {
|
|
81
81
|
projectId: null,
|
|
82
|
-
delay: 1 * 1000 /* Second */,
|
|
82
|
+
delay: 1 * 1000 /* Time.Second */,
|
|
83
83
|
lean: false,
|
|
84
84
|
track: true,
|
|
85
85
|
content: true,
|
|
@@ -99,7 +99,7 @@ function api(method) {
|
|
|
99
99
|
// Zone.js, a popular package for Angular, overrides native browser APIs which can lead to inconsistent state for single page applications.
|
|
100
100
|
// Example issue: https://github.com/angular/angular/issues/31712
|
|
101
101
|
// As a work around, we ensuring Clarity access APIs outside of Zone (and use native implementation instead)
|
|
102
|
-
return window["Zone" /* Zone */] && "__symbol__" /* Symbol */ in window["Zone" /* Zone */] ? window["Zone" /* Zone */]["__symbol__" /* Symbol */](method) : method;
|
|
102
|
+
return window["Zone" /* Constant.Zone */] && "__symbol__" /* Constant.Symbol */ in window["Zone" /* Constant.Zone */] ? window["Zone" /* Constant.Zone */]["__symbol__" /* Constant.Symbol */](method) : method;
|
|
103
103
|
}
|
|
104
104
|
|
|
105
105
|
var startTime = 0;
|
|
@@ -115,7 +115,7 @@ function stop$B() {
|
|
|
115
115
|
startTime = 0;
|
|
116
116
|
}
|
|
117
117
|
|
|
118
|
-
var version$1 = "0.6.
|
|
118
|
+
var version$1 = "0.6.37";
|
|
119
119
|
|
|
120
120
|
// tslint:disable: no-bitwise
|
|
121
121
|
function hash (input) {
|
|
@@ -148,7 +148,7 @@ function reset$o() {
|
|
|
148
148
|
// Baseline state holds the previous values - if it is updated in the current payload,
|
|
149
149
|
// reset the state to current value after sending the previous state
|
|
150
150
|
if (update$2) {
|
|
151
|
-
state$9 = { time: time(), event: 4 /* Baseline */, data: {
|
|
151
|
+
state$9 = { time: time(), event: 4 /* Event.Baseline */, data: {
|
|
152
152
|
visible: buffer.visible,
|
|
153
153
|
docWidth: buffer.docWidth,
|
|
154
154
|
docHeight: buffer.docHeight,
|
|
@@ -163,7 +163,7 @@ function reset$o() {
|
|
|
163
163
|
};
|
|
164
164
|
}
|
|
165
165
|
buffer = buffer ? buffer : {
|
|
166
|
-
visible: 1 /* True */,
|
|
166
|
+
visible: 1 /* BooleanFlag.True */,
|
|
167
167
|
docWidth: 0,
|
|
168
168
|
docHeight: 0,
|
|
169
169
|
screenWidth: 0,
|
|
@@ -177,15 +177,15 @@ function reset$o() {
|
|
|
177
177
|
}
|
|
178
178
|
function track$7(event, x, y) {
|
|
179
179
|
switch (event) {
|
|
180
|
-
case 8 /* Document */:
|
|
180
|
+
case 8 /* Event.Document */:
|
|
181
181
|
buffer.docWidth = x;
|
|
182
182
|
buffer.docHeight = y;
|
|
183
183
|
break;
|
|
184
|
-
case 11 /* Resize */:
|
|
184
|
+
case 11 /* Event.Resize */:
|
|
185
185
|
buffer.screenWidth = x;
|
|
186
186
|
buffer.screenHeight = y;
|
|
187
187
|
break;
|
|
188
|
-
case 10 /* Scroll */:
|
|
188
|
+
case 10 /* Event.Scroll */:
|
|
189
189
|
buffer.scrollX = x;
|
|
190
190
|
buffer.scrollY = y;
|
|
191
191
|
break;
|
|
@@ -200,7 +200,7 @@ function activity(t) {
|
|
|
200
200
|
buffer.activityTime = t;
|
|
201
201
|
}
|
|
202
202
|
function visibility(t, visible) {
|
|
203
|
-
buffer.visible = visible === "visible" ? 1 /* True */ : 0 /* False */;
|
|
203
|
+
buffer.visible = visible === "visible" ? 1 /* BooleanFlag.True */ : 0 /* BooleanFlag.False */;
|
|
204
204
|
if (!buffer.visible) {
|
|
205
205
|
activity(t);
|
|
206
206
|
}
|
|
@@ -208,7 +208,7 @@ function visibility(t, visible) {
|
|
|
208
208
|
}
|
|
209
209
|
function compute$c() {
|
|
210
210
|
if (update$2) {
|
|
211
|
-
encode$1(4 /* Baseline */);
|
|
211
|
+
encode$1(4 /* Event.Baseline */);
|
|
212
212
|
}
|
|
213
213
|
}
|
|
214
214
|
function stop$A() {
|
|
@@ -232,12 +232,12 @@ function event(key, value) {
|
|
|
232
232
|
if (active() &&
|
|
233
233
|
key &&
|
|
234
234
|
value &&
|
|
235
|
-
typeof key === "string" /* String */ &&
|
|
236
|
-
typeof value === "string" /* String */ &&
|
|
235
|
+
typeof key === "string" /* Constant.String */ &&
|
|
236
|
+
typeof value === "string" /* Constant.String */ &&
|
|
237
237
|
key.length < 255 &&
|
|
238
238
|
value.length < 255) {
|
|
239
239
|
data$j = { key: key, value: value };
|
|
240
|
-
encode$1(24 /* Custom */);
|
|
240
|
+
encode$1(24 /* Event.Custom */);
|
|
241
241
|
}
|
|
242
242
|
}
|
|
243
243
|
|
|
@@ -246,7 +246,7 @@ var updates$3 = null;
|
|
|
246
246
|
function start$D() {
|
|
247
247
|
data$i = {};
|
|
248
248
|
updates$3 = {};
|
|
249
|
-
count$1(5 /* InvokeCount */);
|
|
249
|
+
count$1(5 /* Metric.InvokeCount */);
|
|
250
250
|
}
|
|
251
251
|
function stop$z() {
|
|
252
252
|
data$i = {};
|
|
@@ -287,7 +287,7 @@ function max(metric, value) {
|
|
|
287
287
|
}
|
|
288
288
|
}
|
|
289
289
|
function compute$b() {
|
|
290
|
-
encode$1(0 /* Metric */);
|
|
290
|
+
encode$1(0 /* Event.Metric */);
|
|
291
291
|
}
|
|
292
292
|
function reset$n() {
|
|
293
293
|
updates$3 = {};
|
|
@@ -305,7 +305,7 @@ var last = 0;
|
|
|
305
305
|
var interval = 0;
|
|
306
306
|
var timeout$6 = null;
|
|
307
307
|
function start$C() {
|
|
308
|
-
interval = 60000 /* PingInterval */;
|
|
308
|
+
interval = 60000 /* Setting.PingInterval */;
|
|
309
309
|
last = 0;
|
|
310
310
|
}
|
|
311
311
|
function reset$m() {
|
|
@@ -318,8 +318,8 @@ function reset$m() {
|
|
|
318
318
|
function ping() {
|
|
319
319
|
var now = time();
|
|
320
320
|
data$h = { gap: now - last };
|
|
321
|
-
encode$1(25 /* Ping */);
|
|
322
|
-
if (data$h.gap < 300000 /* PingTimeout */) {
|
|
321
|
+
encode$1(25 /* Event.Ping */);
|
|
322
|
+
if (data$h.gap < 300000 /* Setting.PingTimeout */) {
|
|
323
323
|
timeout$6 = setTimeout(ping, interval);
|
|
324
324
|
}
|
|
325
325
|
else {
|
|
@@ -356,7 +356,7 @@ function track$6(event, time) {
|
|
|
356
356
|
var last = e[e.length - 1];
|
|
357
357
|
// Add a new entry only if the new event occurs after configured interval
|
|
358
358
|
// Otherwise, extend the duration of the previous entry
|
|
359
|
-
if (time - last[0] > 100 /* SummaryInterval */) {
|
|
359
|
+
if (time - last[0] > 100 /* Setting.SummaryInterval */) {
|
|
360
360
|
data$g[event].push([time, 0]);
|
|
361
361
|
}
|
|
362
362
|
else {
|
|
@@ -365,7 +365,7 @@ function track$6(event, time) {
|
|
|
365
365
|
}
|
|
366
366
|
}
|
|
367
367
|
function compute$a() {
|
|
368
|
-
encode$1(36 /* Summary */);
|
|
368
|
+
encode$1(36 /* Event.Summary */);
|
|
369
369
|
}
|
|
370
370
|
function reset$l() {
|
|
371
371
|
data$g = {};
|
|
@@ -384,7 +384,7 @@ var summary = /*#__PURE__*/Object.freeze({
|
|
|
384
384
|
var data$f = null;
|
|
385
385
|
function start$A() {
|
|
386
386
|
if (!config$1.lean && config$1.upgrade) {
|
|
387
|
-
config$1.upgrade("Config" /* Config */);
|
|
387
|
+
config$1.upgrade("Config" /* Constant.Config */);
|
|
388
388
|
}
|
|
389
389
|
data$f = null;
|
|
390
390
|
}
|
|
@@ -403,7 +403,7 @@ function upgrade(key) {
|
|
|
403
403
|
if (config$1.upgrade) {
|
|
404
404
|
config$1.upgrade(key);
|
|
405
405
|
}
|
|
406
|
-
encode$1(3 /* Upgrade */);
|
|
406
|
+
encode$1(3 /* Event.Upgrade */);
|
|
407
407
|
}
|
|
408
408
|
}
|
|
409
409
|
function stop$w() {
|
|
@@ -423,25 +423,25 @@ function start$z() {
|
|
|
423
423
|
reset$k();
|
|
424
424
|
}
|
|
425
425
|
function set(variable, value) {
|
|
426
|
-
var values = typeof value === "string" /* String */ ? [value] : value;
|
|
426
|
+
var values = typeof value === "string" /* Constant.String */ ? [value] : value;
|
|
427
427
|
log$2(variable, values);
|
|
428
428
|
}
|
|
429
429
|
function identify(userId, sessionId, pageId) {
|
|
430
430
|
if (sessionId === void 0) { sessionId = null; }
|
|
431
431
|
if (pageId === void 0) { pageId = null; }
|
|
432
|
-
log$2("userId" /* UserId */, [userId]);
|
|
433
|
-
log$2("sessionId" /* SessionId */, [sessionId]);
|
|
434
|
-
log$2("pageId" /* PageId */, [pageId]);
|
|
432
|
+
log$2("userId" /* Constant.UserId */, [userId]);
|
|
433
|
+
log$2("sessionId" /* Constant.SessionId */, [sessionId]);
|
|
434
|
+
log$2("pageId" /* Constant.PageId */, [pageId]);
|
|
435
435
|
}
|
|
436
436
|
function log$2(variable, value) {
|
|
437
437
|
if (active() &&
|
|
438
438
|
variable &&
|
|
439
439
|
value &&
|
|
440
|
-
typeof variable === "string" /* String */ &&
|
|
440
|
+
typeof variable === "string" /* Constant.String */ &&
|
|
441
441
|
variable.length < 255) {
|
|
442
442
|
var validValues = variable in data$e ? data$e[variable] : [];
|
|
443
443
|
for (var i = 0; i < value.length; i++) {
|
|
444
|
-
if (typeof value[i] === "string" /* String */ && value[i].length < 255) {
|
|
444
|
+
if (typeof value[i] === "string" /* Constant.String */ && value[i].length < 255) {
|
|
445
445
|
validValues.push(value[i]);
|
|
446
446
|
}
|
|
447
447
|
}
|
|
@@ -449,7 +449,7 @@ function log$2(variable, value) {
|
|
|
449
449
|
}
|
|
450
450
|
}
|
|
451
451
|
function compute$9() {
|
|
452
|
-
encode$1(34 /* Variable */);
|
|
452
|
+
encode$1(34 /* Event.Variable */);
|
|
453
453
|
}
|
|
454
454
|
function reset$k() {
|
|
455
455
|
data$e = {};
|
|
@@ -469,7 +469,7 @@ var variable = /*#__PURE__*/Object.freeze({
|
|
|
469
469
|
stop: stop$v
|
|
470
470
|
});
|
|
471
471
|
|
|
472
|
-
|
|
472
|
+
/******************************************************************************
|
|
473
473
|
Copyright (c) Microsoft Corporation.
|
|
474
474
|
|
|
475
475
|
Permission to use, copy, modify, and/or distribute this software for any
|
|
@@ -522,7 +522,7 @@ function __generator(thisArg, body) {
|
|
|
522
522
|
}
|
|
523
523
|
}
|
|
524
524
|
|
|
525
|
-
var supported$1 = "CompressionStream" /* CompressionStream */ in window;
|
|
525
|
+
var supported$1 = "CompressionStream" /* Constant.CompressionStream */ in window;
|
|
526
526
|
function compress (input) {
|
|
527
527
|
return __awaiter(this, void 0, void 0, function () {
|
|
528
528
|
var stream, _a;
|
|
@@ -539,7 +539,7 @@ function compress (input) {
|
|
|
539
539
|
return [2 /*return*/];
|
|
540
540
|
});
|
|
541
541
|
});
|
|
542
|
-
} }).pipeThrough(new TextEncoderStream()).pipeThrough(new window["CompressionStream" /* CompressionStream */]("gzip"));
|
|
542
|
+
} }).pipeThrough(new TextEncoderStream()).pipeThrough(new window["CompressionStream" /* Constant.CompressionStream */]("gzip"));
|
|
543
543
|
_a = Uint8Array.bind;
|
|
544
544
|
return [4 /*yield*/, read(stream)];
|
|
545
545
|
case 1: return [2 /*return*/, new (_a.apply(Uint8Array, [void 0, _c.sent()]))()];
|
|
@@ -608,11 +608,11 @@ function scrub (value, hint, privacy, mangle) {
|
|
|
608
608
|
if (mangle === void 0) { mangle = false; }
|
|
609
609
|
if (value) {
|
|
610
610
|
switch (privacy) {
|
|
611
|
-
case 0 /* None */:
|
|
611
|
+
case 0 /* Privacy.None */:
|
|
612
612
|
return value;
|
|
613
|
-
case 1 /* Sensitive */:
|
|
613
|
+
case 1 /* Privacy.Sensitive */:
|
|
614
614
|
switch (hint) {
|
|
615
|
-
case "*T" /* TextTag */:
|
|
615
|
+
case "*T" /* Layout.Constant.TextTag */:
|
|
616
616
|
case "value":
|
|
617
617
|
case "placeholder":
|
|
618
618
|
return redact(value);
|
|
@@ -620,16 +620,16 @@ function scrub (value, hint, privacy, mangle) {
|
|
|
620
620
|
return mangleToken(value);
|
|
621
621
|
}
|
|
622
622
|
return value;
|
|
623
|
-
case 2 /* Text */:
|
|
624
|
-
case 3 /* TextImage */:
|
|
623
|
+
case 2 /* Privacy.Text */:
|
|
624
|
+
case 3 /* Privacy.TextImage */:
|
|
625
625
|
switch (hint) {
|
|
626
|
-
case "*T" /* TextTag */:
|
|
626
|
+
case "*T" /* Layout.Constant.TextTag */:
|
|
627
627
|
return mangle ? mangleText(value) : mask(value);
|
|
628
628
|
case "src":
|
|
629
629
|
case "srcset":
|
|
630
630
|
case "title":
|
|
631
631
|
case "alt":
|
|
632
|
-
return privacy === 3 /* TextImage */ ? "" /* Empty */ : value;
|
|
632
|
+
return privacy === 3 /* Privacy.TextImage */ ? "" /* Data.Constant.Empty */ : value;
|
|
633
633
|
case "value":
|
|
634
634
|
case "click":
|
|
635
635
|
case "input":
|
|
@@ -649,18 +649,18 @@ function mangleText(value) {
|
|
|
649
649
|
var index = value.indexOf(first);
|
|
650
650
|
var prefix = value.substr(0, index);
|
|
651
651
|
var suffix = value.substr(index + trimmed.length);
|
|
652
|
-
return ""
|
|
652
|
+
return "".concat(prefix).concat(trimmed.length.toString(36)).concat(suffix);
|
|
653
653
|
}
|
|
654
654
|
return value;
|
|
655
655
|
}
|
|
656
656
|
function mask(value) {
|
|
657
|
-
return value.replace(/\S/gi, "\u2022" /* Mask */);
|
|
657
|
+
return value.replace(/\S/gi, "\u2022" /* Data.Constant.Mask */);
|
|
658
658
|
}
|
|
659
659
|
function mangleToken(value) {
|
|
660
|
-
var length = ((Math.floor(value.length / 5 /* WordLength */) + 1) * 5 /* WordLength */);
|
|
661
|
-
var output = "" /* Empty */;
|
|
660
|
+
var length = ((Math.floor(value.length / 5 /* Data.Setting.WordLength */) + 1) * 5 /* Data.Setting.WordLength */);
|
|
661
|
+
var output = "" /* Layout.Constant.Empty */;
|
|
662
662
|
for (var i = 0; i < length; i++) {
|
|
663
|
-
output += i > 0 && i % 5 /* WordLength */ === 0 ? " " /* Space */ : "\u2022" /* Mask */;
|
|
663
|
+
output += i > 0 && i % 5 /* Data.Setting.WordLength */ === 0 ? " " /* Data.Constant.Space */ : "\u2022" /* Data.Constant.Mask */;
|
|
664
664
|
}
|
|
665
665
|
return output;
|
|
666
666
|
}
|
|
@@ -672,15 +672,15 @@ function redact(value) {
|
|
|
672
672
|
var array = null;
|
|
673
673
|
for (var i = 0; i < value.length; i++) {
|
|
674
674
|
var c = value.charCodeAt(i);
|
|
675
|
-
hasDigit = hasDigit || (c >= 48 /* Zero */ && c <= 57 /* Nine */); // Check for digits in the current word
|
|
676
|
-
hasEmail = hasEmail || c === 64 /* At */; // Check for @ sign anywhere within the current word
|
|
677
|
-
hasWhitespace = c === 9 /* Tab */ || c === 10 /* NewLine */ || c === 13 /* Return */ || c === 32 /* Blank */;
|
|
675
|
+
hasDigit = hasDigit || (c >= 48 /* Data.Character.Zero */ && c <= 57 /* Data.Character.Nine */); // Check for digits in the current word
|
|
676
|
+
hasEmail = hasEmail || c === 64 /* Data.Character.At */; // Check for @ sign anywhere within the current word
|
|
677
|
+
hasWhitespace = c === 9 /* Data.Character.Tab */ || c === 10 /* Data.Character.NewLine */ || c === 13 /* Data.Character.Return */ || c === 32 /* Data.Character.Blank */;
|
|
678
678
|
// Process each word as an individual token to redact any sensitive information
|
|
679
679
|
if (i === 0 || i === value.length - 1 || hasWhitespace) {
|
|
680
680
|
// Performance optimization: Lazy load string -> array conversion only when required
|
|
681
681
|
if (hasDigit || hasEmail) {
|
|
682
682
|
if (array === null) {
|
|
683
|
-
array = value.split("" /* Empty */);
|
|
683
|
+
array = value.split("" /* Data.Constant.Empty */);
|
|
684
684
|
}
|
|
685
685
|
mutate(array, spaceIndex, hasWhitespace ? i : i + 1);
|
|
686
686
|
}
|
|
@@ -692,11 +692,11 @@ function redact(value) {
|
|
|
692
692
|
}
|
|
693
693
|
}
|
|
694
694
|
}
|
|
695
|
-
return array ? array.join("" /* Empty */) : value;
|
|
695
|
+
return array ? array.join("" /* Data.Constant.Empty */) : value;
|
|
696
696
|
}
|
|
697
697
|
function mutate(array, start, end) {
|
|
698
698
|
for (var i = start + 1; i < end; i++) {
|
|
699
|
-
array[i] = "\u2022" /* Mask */;
|
|
699
|
+
array[i] = "\u2022" /* Data.Constant.Mask */;
|
|
700
700
|
}
|
|
701
701
|
}
|
|
702
702
|
|
|
@@ -704,16 +704,16 @@ var history$5 = [];
|
|
|
704
704
|
var data$d;
|
|
705
705
|
function start$x() {
|
|
706
706
|
history$5 = [];
|
|
707
|
-
max(26 /* Automation */, navigator.webdriver ? 1 /* True */ : 0 /* False */);
|
|
707
|
+
max(26 /* Metric.Automation */, navigator.webdriver ? 1 /* BooleanFlag.True */ : 0 /* BooleanFlag.False */);
|
|
708
708
|
}
|
|
709
709
|
function check$4(id, target, input) {
|
|
710
710
|
// Compute hash for fraud detection. Hash is computed only if input meets the minimum length criteria
|
|
711
|
-
if (id !== null && input && input.length >= 5 /* WordLength */) {
|
|
711
|
+
if (id !== null && input && input.length >= 5 /* Setting.WordLength */) {
|
|
712
712
|
data$d = { id: id, target: target, hash: hash(input) };
|
|
713
713
|
// Only encode this event if we haven't already reported this hash
|
|
714
714
|
if (history$5.indexOf(data$d.hash) < 0) {
|
|
715
715
|
history$5.push(data$d.hash);
|
|
716
|
-
encode$2(41 /* Fraud */);
|
|
716
|
+
encode$2(41 /* Event.Fraud */);
|
|
717
717
|
}
|
|
718
718
|
}
|
|
719
719
|
}
|
|
@@ -722,45 +722,45 @@ var TAGS = ["DIV", "TR", "P", "LI", "UL", "A", "BUTTON"];
|
|
|
722
722
|
function selector (input, beta) {
|
|
723
723
|
if (beta === void 0) { beta = false; }
|
|
724
724
|
var a = input.attributes;
|
|
725
|
-
var prefix = input.prefix ? input.prefix[beta ? 1 /* Beta */ : 0 /* Stable */] : null;
|
|
726
|
-
var suffix = beta || ((a && !("class" /* Class */ in a)) || TAGS.indexOf(input.tag) >= 0) ? ":nth-of-type("
|
|
725
|
+
var prefix = input.prefix ? input.prefix[beta ? 1 /* Selector.Beta */ : 0 /* Selector.Stable */] : null;
|
|
726
|
+
var suffix = beta || ((a && !("class" /* Constant.Class */ in a)) || TAGS.indexOf(input.tag) >= 0) ? ":nth-of-type(".concat(input.position, ")") : "" /* Constant.Empty */;
|
|
727
727
|
switch (input.tag) {
|
|
728
728
|
case "STYLE":
|
|
729
729
|
case "TITLE":
|
|
730
730
|
case "LINK":
|
|
731
731
|
case "META":
|
|
732
|
-
case "*T" /* TextTag */:
|
|
733
|
-
case "*D" /* DocumentTag */:
|
|
734
|
-
return "" /* Empty */;
|
|
732
|
+
case "*T" /* Constant.TextTag */:
|
|
733
|
+
case "*D" /* Constant.DocumentTag */:
|
|
734
|
+
return "" /* Constant.Empty */;
|
|
735
735
|
case "HTML":
|
|
736
|
-
return "HTML" /* HTML */;
|
|
736
|
+
return "HTML" /* Constant.HTML */;
|
|
737
737
|
default:
|
|
738
738
|
if (prefix === null) {
|
|
739
|
-
return "" /* Empty */;
|
|
739
|
+
return "" /* Constant.Empty */;
|
|
740
740
|
}
|
|
741
|
-
prefix = prefix
|
|
742
|
-
input.tag = input.tag.indexOf("svg:" /* SvgPrefix */) === 0 ? input.tag.substr("svg:" /* SvgPrefix */.length) : input.tag;
|
|
743
|
-
var selector = ""
|
|
744
|
-
var classes = "class" /* Class */ in a && a["class" /* Class */].length > 0 ? a["class" /* Class */].trim().split(/\s+/) : null;
|
|
741
|
+
prefix = "".concat(prefix, ">");
|
|
742
|
+
input.tag = input.tag.indexOf("svg:" /* Constant.SvgPrefix */) === 0 ? input.tag.substr("svg:" /* Constant.SvgPrefix */.length) : input.tag;
|
|
743
|
+
var selector = "".concat(prefix).concat(input.tag).concat(suffix);
|
|
744
|
+
var classes = "class" /* Constant.Class */ in a && a["class" /* Constant.Class */].length > 0 ? a["class" /* Constant.Class */].trim().split(/\s+/) : null;
|
|
745
745
|
if (beta) {
|
|
746
746
|
// In beta mode, update selector to use "id" field when available. There are two exceptions:
|
|
747
747
|
// (1) if "id" appears to be an auto generated string token, e.g. guid or a random id containing digits
|
|
748
748
|
// (2) if "id" appears inside a shadow DOM, in which case we continue to prefix up to shadow DOM to prevent conflicts
|
|
749
|
-
var id = "id" /* Id */ in a && a["id" /* Id */].length > 0 ? a["id" /* Id */] : null;
|
|
750
|
-
classes = input.tag !== "BODY" /* BodyTag */ && classes ? classes.filter(function (c) { return !hasDigits(c); }) : [];
|
|
751
|
-
selector = classes.length > 0 ? ""
|
|
752
|
-
selector = id && hasDigits(id) === false ? getDomPrefix(prefix)
|
|
749
|
+
var id = "id" /* Constant.Id */ in a && a["id" /* Constant.Id */].length > 0 ? a["id" /* Constant.Id */] : null;
|
|
750
|
+
classes = input.tag !== "BODY" /* Constant.BodyTag */ && classes ? classes.filter(function (c) { return !hasDigits(c); }) : [];
|
|
751
|
+
selector = classes.length > 0 ? "".concat(prefix).concat(input.tag, ".").concat(classes.join(".")).concat(suffix) : selector;
|
|
752
|
+
selector = id && hasDigits(id) === false ? "".concat(getDomPrefix(prefix), "#").concat(id) : selector;
|
|
753
753
|
}
|
|
754
754
|
else {
|
|
755
755
|
// Otherwise, fallback to stable mode, where we include class names as part of the selector
|
|
756
|
-
selector = classes ? ""
|
|
756
|
+
selector = classes ? "".concat(prefix).concat(input.tag, ".").concat(classes.join(".")).concat(suffix) : selector;
|
|
757
757
|
}
|
|
758
758
|
return selector;
|
|
759
759
|
}
|
|
760
760
|
}
|
|
761
761
|
function getDomPrefix(prefix) {
|
|
762
|
-
var shadowDomStart = prefix.lastIndexOf("*S" /* ShadowDomTag */);
|
|
763
|
-
var iframeDomStart = prefix.lastIndexOf(""
|
|
762
|
+
var shadowDomStart = prefix.lastIndexOf("*S" /* Constant.ShadowDomTag */);
|
|
763
|
+
var iframeDomStart = prefix.lastIndexOf("".concat("iframe:" /* Constant.IFramePrefix */).concat("HTML" /* Constant.HTML */));
|
|
764
764
|
var domStart = Math.max(shadowDomStart, iframeDomStart);
|
|
765
765
|
if (domStart < 0) {
|
|
766
766
|
return "";
|
|
@@ -772,7 +772,7 @@ function getDomPrefix(prefix) {
|
|
|
772
772
|
function hasDigits(value) {
|
|
773
773
|
for (var i = 0; i < value.length; i++) {
|
|
774
774
|
var c = value.charCodeAt(i);
|
|
775
|
-
if (c >= 48 /* Zero */ && c <= 57 /* Nine */) {
|
|
775
|
+
if (c >= 48 /* Character.Zero */ && c <= 57 /* Character.Nine */) {
|
|
776
776
|
return true;
|
|
777
777
|
}
|
|
778
778
|
}
|
|
@@ -809,7 +809,7 @@ function reset$j() {
|
|
|
809
809
|
pauseTask = null;
|
|
810
810
|
}
|
|
811
811
|
function schedule$1(task, priority) {
|
|
812
|
-
if (priority === void 0) { priority = 0 /* Normal */; }
|
|
812
|
+
if (priority === void 0) { priority = 0 /* Priority.Normal */; }
|
|
813
813
|
return __awaiter(this, void 0, void 0, function () {
|
|
814
814
|
var _i, queuedTasks_1, q, promise;
|
|
815
815
|
return __generator(this, function (_a) {
|
|
@@ -821,7 +821,7 @@ function schedule$1(task, priority) {
|
|
|
821
821
|
}
|
|
822
822
|
}
|
|
823
823
|
promise = new Promise(function (resolve) {
|
|
824
|
-
var insert = priority === 1 /* High */ ? "unshift" : "push";
|
|
824
|
+
var insert = priority === 1 /* Priority.High */ ? "unshift" : "push";
|
|
825
825
|
// Queue this task for asynchronous execution later
|
|
826
826
|
// We also store a unique page identifier (id) along with the task to ensure
|
|
827
827
|
// ensure that we do not accidentally execute this task in context of a different page
|
|
@@ -856,7 +856,7 @@ function run() {
|
|
|
856
856
|
return;
|
|
857
857
|
}
|
|
858
858
|
if (error) {
|
|
859
|
-
log$1(0 /* RunTask */, 1 /* Warning */, error.name, error.message, error.stack);
|
|
859
|
+
log$1(0 /* Code.RunTask */, 1 /* Severity.Warning */, error.name, error.message, error.stack);
|
|
860
860
|
}
|
|
861
861
|
activeTask = null;
|
|
862
862
|
run();
|
|
@@ -867,13 +867,13 @@ function state$8(timer) {
|
|
|
867
867
|
var id = key(timer);
|
|
868
868
|
if (id in tracker) {
|
|
869
869
|
var elapsed = performance.now() - tracker[id].start;
|
|
870
|
-
return (elapsed > tracker[id].yield) ? 0 /* Wait */ : 1 /* Run */;
|
|
870
|
+
return (elapsed > tracker[id].yield) ? 0 /* Task.Wait */ : 1 /* Task.Run */;
|
|
871
871
|
}
|
|
872
872
|
// If this task is no longer being tracked, send stop message to the caller
|
|
873
|
-
return 2 /* Stop */;
|
|
873
|
+
return 2 /* Task.Stop */;
|
|
874
874
|
}
|
|
875
875
|
function start$w(timer) {
|
|
876
|
-
tracker[key(timer)] = { start: performance.now(), calls: 0, yield: 30 /* LongTask */ };
|
|
876
|
+
tracker[key(timer)] = { start: performance.now(), calls: 0, yield: 30 /* Setting.LongTask */ };
|
|
877
877
|
}
|
|
878
878
|
function restart$2(timer) {
|
|
879
879
|
var id = key(timer);
|
|
@@ -890,11 +890,11 @@ function stop$t(timer) {
|
|
|
890
890
|
var id = key(timer);
|
|
891
891
|
var duration = end - tracker[id].start;
|
|
892
892
|
sum(timer.cost, duration);
|
|
893
|
-
count$1(5 /* InvokeCount */);
|
|
893
|
+
count$1(5 /* Metric.InvokeCount */);
|
|
894
894
|
// For the first execution, which is synchronous, time is automatically counted towards TotalDuration.
|
|
895
895
|
// However, for subsequent asynchronous runs, we need to manually update TotalDuration metric.
|
|
896
896
|
if (tracker[id].calls > 0) {
|
|
897
|
-
sum(4 /* TotalCost */, duration);
|
|
897
|
+
sum(4 /* Metric.TotalCost */, duration);
|
|
898
898
|
}
|
|
899
899
|
}
|
|
900
900
|
function suspend$1(timer) {
|
|
@@ -915,13 +915,13 @@ function suspend$1(timer) {
|
|
|
915
915
|
case 2:
|
|
916
916
|
// After we are done with suspending task, ensure that we are still operating in the right context
|
|
917
917
|
// If the task is still being tracked, continue running the task, otherwise ask caller to stop execution
|
|
918
|
-
return [2 /*return*/, id in tracker ? 1 /* Run */ : 2 /* Stop */];
|
|
918
|
+
return [2 /*return*/, id in tracker ? 1 /* Task.Run */ : 2 /* Task.Stop */];
|
|
919
919
|
}
|
|
920
920
|
});
|
|
921
921
|
});
|
|
922
922
|
}
|
|
923
923
|
function key(timer) {
|
|
924
|
-
return timer.id
|
|
924
|
+
return "".concat(timer.id, ".").concat(timer.cost);
|
|
925
925
|
}
|
|
926
926
|
function wait() {
|
|
927
927
|
return __awaiter(this, void 0, void 0, function () {
|
|
@@ -959,14 +959,14 @@ function requestIdleCallbackPolyfill(callback, options) {
|
|
|
959
959
|
var currentTime = performance.now();
|
|
960
960
|
var elapsed = currentTime - startTime;
|
|
961
961
|
var duration = currentTime - event.data;
|
|
962
|
-
if (duration > 30 /* LongTask */ && elapsed < options.timeout) {
|
|
962
|
+
if (duration > 30 /* Setting.LongTask */ && elapsed < options.timeout) {
|
|
963
963
|
requestAnimationFrame(function () { outgoing.postMessage(currentTime); });
|
|
964
964
|
}
|
|
965
965
|
else {
|
|
966
966
|
var didTimeout_1 = elapsed > options.timeout;
|
|
967
967
|
callback({
|
|
968
968
|
didTimeout: didTimeout_1,
|
|
969
|
-
timeRemaining: function () { return didTimeout_1 ? 30 /* LongTask */ : Math.max(0, 30 /* LongTask */ - duration); }
|
|
969
|
+
timeRemaining: function () { return didTimeout_1 ? 30 /* Setting.LongTask */ : Math.max(0, 30 /* Setting.LongTask */ - duration); }
|
|
970
970
|
});
|
|
971
971
|
}
|
|
972
972
|
};
|
|
@@ -987,7 +987,7 @@ function tokenize (tokens) {
|
|
|
987
987
|
var reference = null;
|
|
988
988
|
for (var i = 0; i < tokens.length; i++) {
|
|
989
989
|
// Only optimize for string values
|
|
990
|
-
if (typeof tokens[i] === "string" /* String */) {
|
|
990
|
+
if (typeof tokens[i] === "string" /* Constant.String */) {
|
|
991
991
|
var token = tokens[i];
|
|
992
992
|
var index = lookup[token] || -1;
|
|
993
993
|
if (index >= 0) {
|
|
@@ -1029,10 +1029,10 @@ function encode$4 (type, timer, ts) {
|
|
|
1029
1029
|
tokens = [eventTime, type];
|
|
1030
1030
|
_a = type;
|
|
1031
1031
|
switch (_a) {
|
|
1032
|
-
case 8 /* Document */: return [3 /*break*/, 1];
|
|
1033
|
-
case 7 /* Region */: return [3 /*break*/, 2];
|
|
1034
|
-
case 5 /* Discover */: return [3 /*break*/, 3];
|
|
1035
|
-
case 6 /* Mutation */: return [3 /*break*/, 3];
|
|
1032
|
+
case 8 /* Event.Document */: return [3 /*break*/, 1];
|
|
1033
|
+
case 7 /* Event.Region */: return [3 /*break*/, 2];
|
|
1034
|
+
case 5 /* Event.Discover */: return [3 /*break*/, 3];
|
|
1035
|
+
case 6 /* Event.Mutation */: return [3 /*break*/, 3];
|
|
1036
1036
|
}
|
|
1037
1037
|
return [3 /*break*/, 10];
|
|
1038
1038
|
case 1:
|
|
@@ -1045,7 +1045,7 @@ function encode$4 (type, timer, ts) {
|
|
|
1045
1045
|
case 2:
|
|
1046
1046
|
for (_i = 0, _b = state$1; _i < _b.length; _i++) {
|
|
1047
1047
|
r = _b[_i];
|
|
1048
|
-
tokens = [r.time, 7 /* Region */];
|
|
1048
|
+
tokens = [r.time, 7 /* Event.Region */];
|
|
1049
1049
|
tokens.push(r.data.id);
|
|
1050
1050
|
tokens.push(r.data.interaction);
|
|
1051
1051
|
tokens.push(r.data.visibility);
|
|
@@ -1056,7 +1056,7 @@ function encode$4 (type, timer, ts) {
|
|
|
1056
1056
|
return [3 /*break*/, 10];
|
|
1057
1057
|
case 3:
|
|
1058
1058
|
// Check if we are operating within the context of the current page
|
|
1059
|
-
if (state$8(timer) === 2 /* Stop */) {
|
|
1059
|
+
if (state$8(timer) === 2 /* Task.Stop */) {
|
|
1060
1060
|
return [3 /*break*/, 10];
|
|
1061
1061
|
}
|
|
1062
1062
|
values = updates$2();
|
|
@@ -1067,13 +1067,13 @@ function encode$4 (type, timer, ts) {
|
|
|
1067
1067
|
if (!(_c < values_1.length)) return [3 /*break*/, 8];
|
|
1068
1068
|
value = values_1[_c];
|
|
1069
1069
|
state = state$8(timer);
|
|
1070
|
-
if (!(state === 0 /* Wait */)) return [3 /*break*/, 6];
|
|
1070
|
+
if (!(state === 0 /* Task.Wait */)) return [3 /*break*/, 6];
|
|
1071
1071
|
return [4 /*yield*/, suspend$1(timer)];
|
|
1072
1072
|
case 5:
|
|
1073
1073
|
state = _e.sent();
|
|
1074
1074
|
_e.label = 6;
|
|
1075
1075
|
case 6:
|
|
1076
|
-
if (state === 2 /* Stop */) {
|
|
1076
|
+
if (state === 2 /* Task.Stop */) {
|
|
1077
1077
|
return [3 /*break*/, 8];
|
|
1078
1078
|
}
|
|
1079
1079
|
data = value.data;
|
|
@@ -1096,9 +1096,9 @@ function encode$4 (type, timer, ts) {
|
|
|
1096
1096
|
if (value.previous && active) {
|
|
1097
1097
|
tokens.push(value.previous);
|
|
1098
1098
|
}
|
|
1099
|
-
tokens.push(suspend ? "*M" /* SuspendMutationTag */ : data[key]);
|
|
1099
|
+
tokens.push(suspend ? "*M" /* Constant.SuspendMutationTag */ : data[key]);
|
|
1100
1100
|
if (box && box.length === 2) {
|
|
1101
|
-
tokens.push(""
|
|
1101
|
+
tokens.push("".concat("#" /* Constant.Box */).concat(str$1(box[0]), ".").concat(str$1(box[1])));
|
|
1102
1102
|
}
|
|
1103
1103
|
break;
|
|
1104
1104
|
case "attributes":
|
|
@@ -1120,7 +1120,7 @@ function encode$4 (type, timer, ts) {
|
|
|
1120
1120
|
_c++;
|
|
1121
1121
|
return [3 /*break*/, 4];
|
|
1122
1122
|
case 8:
|
|
1123
|
-
if (type === 6 /* Mutation */) {
|
|
1123
|
+
if (type === 6 /* Event.Mutation */) {
|
|
1124
1124
|
activity(eventTime);
|
|
1125
1125
|
}
|
|
1126
1126
|
queue(tokenize(tokens), !config$1.lean);
|
|
@@ -1133,13 +1133,13 @@ function encode$4 (type, timer, ts) {
|
|
|
1133
1133
|
}
|
|
1134
1134
|
function shouldMangle(value) {
|
|
1135
1135
|
var privacy = value.metadata.privacy;
|
|
1136
|
-
return value.data.tag === "*T" /* TextTag */ && !(privacy === 0 /* None */ || privacy === 1 /* Sensitive */);
|
|
1136
|
+
return value.data.tag === "*T" /* Constant.TextTag */ && !(privacy === 0 /* Privacy.None */ || privacy === 1 /* Privacy.Sensitive */);
|
|
1137
1137
|
}
|
|
1138
1138
|
function size$1(value) {
|
|
1139
1139
|
if (value.metadata.size !== null && value.metadata.size.length === 0) {
|
|
1140
1140
|
var img = getNode(value.id);
|
|
1141
1141
|
if (img) {
|
|
1142
|
-
return [Math.floor(img.offsetWidth * 100 /* BoxPrecision */), Math.floor(img.offsetHeight * 100 /* BoxPrecision */)];
|
|
1142
|
+
return [Math.floor(img.offsetWidth * 100 /* Setting.BoxPrecision */), Math.floor(img.offsetHeight * 100 /* Setting.BoxPrecision */)];
|
|
1143
1143
|
}
|
|
1144
1144
|
}
|
|
1145
1145
|
return value.metadata.size;
|
|
@@ -1148,7 +1148,7 @@ function str$1(input) {
|
|
|
1148
1148
|
return input.toString(36);
|
|
1149
1149
|
}
|
|
1150
1150
|
function attribute(key, value, privacy) {
|
|
1151
|
-
return key
|
|
1151
|
+
return "".concat(key, "=").concat(scrub(value, key, privacy));
|
|
1152
1152
|
}
|
|
1153
1153
|
|
|
1154
1154
|
var data$c;
|
|
@@ -1179,7 +1179,7 @@ function compute$7() {
|
|
|
1179
1179
|
// Check that width or height has changed from before, and also that width & height are not null values
|
|
1180
1180
|
if ((data$c === null || width !== data$c.width || height !== data$c.height) && width !== null && height !== null) {
|
|
1181
1181
|
data$c = { width: width, height: height };
|
|
1182
|
-
encode$4(8 /* Document */);
|
|
1182
|
+
encode$4(8 /* Event.Document */);
|
|
1183
1183
|
}
|
|
1184
1184
|
}
|
|
1185
1185
|
function end() {
|
|
@@ -1208,7 +1208,7 @@ function start$u() {
|
|
|
1208
1208
|
reset$h();
|
|
1209
1209
|
}
|
|
1210
1210
|
function observe$b(root) {
|
|
1211
|
-
bind(root, "click", handler$3.bind(this, 9 /* Click */, root), true);
|
|
1211
|
+
bind(root, "click", handler$3.bind(this, 9 /* Event.Click */, root), true);
|
|
1212
1212
|
}
|
|
1213
1213
|
function handler$3(event, root, evt) {
|
|
1214
1214
|
var frame = iframe(root);
|
|
@@ -1234,8 +1234,8 @@ function handler$3(event, root, evt) {
|
|
|
1234
1234
|
x = Math.round(l.x + (l.w / 2));
|
|
1235
1235
|
y = Math.round(l.y + (l.h / 2));
|
|
1236
1236
|
}
|
|
1237
|
-
var eX = l ? Math.max(Math.floor(((x - l.x) / l.w) * 32767 /* ClickPrecision */), 0) : 0;
|
|
1238
|
-
var eY = l ? Math.max(Math.floor(((y - l.y) / l.h) * 32767 /* ClickPrecision */), 0) : 0;
|
|
1237
|
+
var eX = l ? Math.max(Math.floor(((x - l.x) / l.w) * 32767 /* Setting.ClickPrecision */), 0) : 0;
|
|
1238
|
+
var eY = l ? Math.max(Math.floor(((y - l.y) / l.h) * 32767 /* Setting.ClickPrecision */), 0) : 0;
|
|
1239
1239
|
// Check for null values before processing this event
|
|
1240
1240
|
if (x !== null && y !== null) {
|
|
1241
1241
|
state$7.push({
|
|
@@ -1253,7 +1253,7 @@ function handler$3(event, root, evt) {
|
|
|
1253
1253
|
text: text(t),
|
|
1254
1254
|
link: a ? a.href : null,
|
|
1255
1255
|
hash: null,
|
|
1256
|
-
trust: evt.isTrusted ? 1 /* True */ : 0 /* False */
|
|
1256
|
+
trust: evt.isTrusted ? 1 /* BooleanFlag.True */ : 0 /* BooleanFlag.False */
|
|
1257
1257
|
}
|
|
1258
1258
|
});
|
|
1259
1259
|
schedule$1(encode$3.bind(this, event));
|
|
@@ -1268,7 +1268,7 @@ function text(element) {
|
|
|
1268
1268
|
// Trim any spaces at the beginning or at the end of string
|
|
1269
1269
|
// Also, replace multiple occurrence of space characters with a single white space
|
|
1270
1270
|
// Finally, send only first few characters as specified by the Setting
|
|
1271
|
-
output = t.trim().replace(/\s+/g, " " /* Space */).substr(0, 25 /* ClickText */);
|
|
1271
|
+
output = t.trim().replace(/\s+/g, " " /* Constant.Space */).substr(0, 25 /* Setting.ClickText */);
|
|
1272
1272
|
}
|
|
1273
1273
|
}
|
|
1274
1274
|
return output;
|
|
@@ -1277,10 +1277,10 @@ function reaction(element) {
|
|
|
1277
1277
|
if (element.nodeType === Node.ELEMENT_NODE) {
|
|
1278
1278
|
var tag = element.tagName.toLowerCase();
|
|
1279
1279
|
if (UserInputTags.indexOf(tag) >= 0) {
|
|
1280
|
-
return 0 /* False */;
|
|
1280
|
+
return 0 /* BooleanFlag.False */;
|
|
1281
1281
|
}
|
|
1282
1282
|
}
|
|
1283
|
-
return 1 /* True */;
|
|
1283
|
+
return 1 /* BooleanFlag.True */;
|
|
1284
1284
|
}
|
|
1285
1285
|
function layout$1(element) {
|
|
1286
1286
|
var box = null;
|
|
@@ -1304,14 +1304,14 @@ function layout$1(element) {
|
|
|
1304
1304
|
return box;
|
|
1305
1305
|
}
|
|
1306
1306
|
function context(a) {
|
|
1307
|
-
if (a && a.hasAttribute("target" /* Target */)) {
|
|
1308
|
-
switch (a.getAttribute("target" /* Target */)) {
|
|
1309
|
-
case "_blank" /* Blank */: return 1 /* Blank */;
|
|
1310
|
-
case "_parent" /* Parent */: return 2 /* Parent */;
|
|
1311
|
-
case "_top" /* Top */: return 3 /* Top */;
|
|
1307
|
+
if (a && a.hasAttribute("target" /* Constant.Target */)) {
|
|
1308
|
+
switch (a.getAttribute("target" /* Constant.Target */)) {
|
|
1309
|
+
case "_blank" /* Constant.Blank */: return 1 /* BrowsingContext.Blank */;
|
|
1310
|
+
case "_parent" /* Constant.Parent */: return 2 /* BrowsingContext.Parent */;
|
|
1311
|
+
case "_top" /* Constant.Top */: return 3 /* BrowsingContext.Top */;
|
|
1312
1312
|
}
|
|
1313
1313
|
}
|
|
1314
|
-
return 0 /* Self */;
|
|
1314
|
+
return 0 /* BrowsingContext.Self */;
|
|
1315
1315
|
}
|
|
1316
1316
|
function reset$h() {
|
|
1317
1317
|
state$7 = [];
|
|
@@ -1325,13 +1325,13 @@ function start$t() {
|
|
|
1325
1325
|
reset$g();
|
|
1326
1326
|
}
|
|
1327
1327
|
function observe$a(root) {
|
|
1328
|
-
bind(root, "cut", recompute$7.bind(this, 0 /* Cut */), true);
|
|
1329
|
-
bind(root, "copy", recompute$7.bind(this, 1 /* Copy */), true);
|
|
1330
|
-
bind(root, "paste", recompute$7.bind(this, 2 /* Paste */), true);
|
|
1328
|
+
bind(root, "cut", recompute$7.bind(this, 0 /* Clipboard.Cut */), true);
|
|
1329
|
+
bind(root, "copy", recompute$7.bind(this, 1 /* Clipboard.Copy */), true);
|
|
1330
|
+
bind(root, "paste", recompute$7.bind(this, 2 /* Clipboard.Paste */), true);
|
|
1331
1331
|
}
|
|
1332
1332
|
function recompute$7(action, evt) {
|
|
1333
|
-
state$6.push({ time: time(), event: 38 /* Clipboard */, data: { target: target(evt), action: action } });
|
|
1334
|
-
schedule$1(encode$3.bind(this, 38 /* Clipboard */));
|
|
1333
|
+
state$6.push({ time: time(), event: 38 /* Event.Clipboard */, data: { target: target(evt), action: action } });
|
|
1334
|
+
schedule$1(encode$3.bind(this, 38 /* Event.Clipboard */));
|
|
1335
1335
|
}
|
|
1336
1336
|
function reset$g() {
|
|
1337
1337
|
state$6 = [];
|
|
@@ -1364,9 +1364,9 @@ function recompute$6(evt) {
|
|
|
1364
1364
|
if (state$5.length > 0 && (state$5[state$5.length - 1].data.target === data.target)) {
|
|
1365
1365
|
state$5.pop();
|
|
1366
1366
|
}
|
|
1367
|
-
state$5.push({ time: time(), event: 27 /* Input */, data: data });
|
|
1367
|
+
state$5.push({ time: time(), event: 27 /* Event.Input */, data: data });
|
|
1368
1368
|
clearTimeout(timeout$5);
|
|
1369
|
-
timeout$5 = setTimeout(process$6, 500 /* LookAhead */, 27 /* Input */);
|
|
1369
|
+
timeout$5 = setTimeout(process$6, 500 /* Setting.LookAhead */, 27 /* Event.Input */);
|
|
1370
1370
|
}
|
|
1371
1371
|
}
|
|
1372
1372
|
function process$6(event) {
|
|
@@ -1386,15 +1386,15 @@ function start$r() {
|
|
|
1386
1386
|
reset$e();
|
|
1387
1387
|
}
|
|
1388
1388
|
function observe$8(root) {
|
|
1389
|
-
bind(root, "mousedown", mouse.bind(this, 13 /* MouseDown */, root), true);
|
|
1390
|
-
bind(root, "mouseup", mouse.bind(this, 14 /* MouseUp */, root), true);
|
|
1391
|
-
bind(root, "mousemove", mouse.bind(this, 12 /* MouseMove */, root), true);
|
|
1392
|
-
bind(root, "mousewheel", mouse.bind(this, 15 /* MouseWheel */, root), true);
|
|
1393
|
-
bind(root, "dblclick", mouse.bind(this, 16 /* DoubleClick */, root), true);
|
|
1394
|
-
bind(root, "touchstart", touch.bind(this, 17 /* TouchStart */, root), true);
|
|
1395
|
-
bind(root, "touchend", touch.bind(this, 18 /* TouchEnd */, root), true);
|
|
1396
|
-
bind(root, "touchmove", touch.bind(this, 19 /* TouchMove */, root), true);
|
|
1397
|
-
bind(root, "touchcancel", touch.bind(this, 20 /* TouchCancel */, root), true);
|
|
1389
|
+
bind(root, "mousedown", mouse.bind(this, 13 /* Event.MouseDown */, root), true);
|
|
1390
|
+
bind(root, "mouseup", mouse.bind(this, 14 /* Event.MouseUp */, root), true);
|
|
1391
|
+
bind(root, "mousemove", mouse.bind(this, 12 /* Event.MouseMove */, root), true);
|
|
1392
|
+
bind(root, "mousewheel", mouse.bind(this, 15 /* Event.MouseWheel */, root), true);
|
|
1393
|
+
bind(root, "dblclick", mouse.bind(this, 16 /* Event.DoubleClick */, root), true);
|
|
1394
|
+
bind(root, "touchstart", touch.bind(this, 17 /* Event.TouchStart */, root), true);
|
|
1395
|
+
bind(root, "touchend", touch.bind(this, 18 /* Event.TouchEnd */, root), true);
|
|
1396
|
+
bind(root, "touchmove", touch.bind(this, 19 /* Event.TouchMove */, root), true);
|
|
1397
|
+
bind(root, "touchcancel", touch.bind(this, 20 /* Event.TouchCancel */, root), true);
|
|
1398
1398
|
}
|
|
1399
1399
|
function mouse(event, root, evt) {
|
|
1400
1400
|
var frame = iframe(root);
|
|
@@ -1433,9 +1433,9 @@ function touch(event, root, evt) {
|
|
|
1433
1433
|
}
|
|
1434
1434
|
function handler$2(current) {
|
|
1435
1435
|
switch (current.event) {
|
|
1436
|
-
case 12 /* MouseMove */:
|
|
1437
|
-
case 15 /* MouseWheel */:
|
|
1438
|
-
case 19 /* TouchMove */:
|
|
1436
|
+
case 12 /* Event.MouseMove */:
|
|
1437
|
+
case 15 /* Event.MouseWheel */:
|
|
1438
|
+
case 19 /* Event.TouchMove */:
|
|
1439
1439
|
var length_1 = state$4.length;
|
|
1440
1440
|
var last = length_1 > 1 ? state$4[length_1 - 2] : null;
|
|
1441
1441
|
if (last && similar$1(last, current)) {
|
|
@@ -1443,7 +1443,7 @@ function handler$2(current) {
|
|
|
1443
1443
|
}
|
|
1444
1444
|
state$4.push(current);
|
|
1445
1445
|
clearTimeout(timeout$4);
|
|
1446
|
-
timeout$4 = setTimeout(process$5, 500 /* LookAhead */, current.event);
|
|
1446
|
+
timeout$4 = setTimeout(process$5, 500 /* Setting.LookAhead */, current.event);
|
|
1447
1447
|
break;
|
|
1448
1448
|
default:
|
|
1449
1449
|
state$4.push(current);
|
|
@@ -1463,7 +1463,7 @@ function similar$1(last, current) {
|
|
|
1463
1463
|
var distance = Math.sqrt(dx * dx + dy * dy);
|
|
1464
1464
|
var gap = current.time - last.time;
|
|
1465
1465
|
var match = current.data.target === last.data.target;
|
|
1466
|
-
return current.event === last.event && match && distance < 20 /* Distance */ && gap < 25 /* Interval */;
|
|
1466
|
+
return current.event === last.event && match && distance < 20 /* Setting.Distance */ && gap < 25 /* Setting.Interval */;
|
|
1467
1467
|
}
|
|
1468
1468
|
function stop$p() {
|
|
1469
1469
|
clearTimeout(timeout$4);
|
|
@@ -1486,7 +1486,7 @@ function recompute$5() {
|
|
|
1486
1486
|
width: de && "clientWidth" in de ? Math.min(de.clientWidth, window.innerWidth) : window.innerWidth,
|
|
1487
1487
|
height: de && "clientHeight" in de ? Math.min(de.clientHeight, window.innerHeight) : window.innerHeight,
|
|
1488
1488
|
};
|
|
1489
|
-
encode$3(11 /* Resize */);
|
|
1489
|
+
encode$3(11 /* Event.Resize */);
|
|
1490
1490
|
}
|
|
1491
1491
|
function reset$d() {
|
|
1492
1492
|
data$b = null;
|
|
@@ -1522,7 +1522,7 @@ function recompute$4(event) {
|
|
|
1522
1522
|
// And, if for some reason that is not available, fall back to looking up scrollTop on document.documentElement.
|
|
1523
1523
|
var x = element === de && "pageXOffset" in w ? Math.round(w.pageXOffset) : Math.round(element.scrollLeft);
|
|
1524
1524
|
var y = element === de && "pageYOffset" in w ? Math.round(w.pageYOffset) : Math.round(element.scrollTop);
|
|
1525
|
-
var current = { time: time(), event: 10 /* Scroll */, data: { target: element, x: x, y: y } };
|
|
1525
|
+
var current = { time: time(), event: 10 /* Event.Scroll */, data: { target: element, x: x, y: y } };
|
|
1526
1526
|
// We don't send any scroll events if this is the first event and the current position is top (0,0)
|
|
1527
1527
|
if ((event === null && x === 0 && y === 0) || (x === null || y === null)) {
|
|
1528
1528
|
return;
|
|
@@ -1534,7 +1534,7 @@ function recompute$4(event) {
|
|
|
1534
1534
|
}
|
|
1535
1535
|
state$3.push(current);
|
|
1536
1536
|
clearTimeout(timeout$3);
|
|
1537
|
-
timeout$3 = setTimeout(process$4, 500 /* LookAhead */, 10 /* Scroll */);
|
|
1537
|
+
timeout$3 = setTimeout(process$4, 500 /* Setting.LookAhead */, 10 /* Event.Scroll */);
|
|
1538
1538
|
}
|
|
1539
1539
|
function reset$c() {
|
|
1540
1540
|
state$3 = [];
|
|
@@ -1545,7 +1545,7 @@ function process$4(event) {
|
|
|
1545
1545
|
function similar(last, current) {
|
|
1546
1546
|
var dx = last.data.x - current.data.x;
|
|
1547
1547
|
var dy = last.data.y - current.data.y;
|
|
1548
|
-
return (dx * dx + dy * dy < 20 /* Distance */ * 20 /* Distance */) && (current.time - last.time < 25 /* Interval */);
|
|
1548
|
+
return (dx * dx + dy * dy < 20 /* Setting.Distance */ * 20 /* Setting.Distance */) && (current.time - last.time < 25 /* Setting.Interval */);
|
|
1549
1549
|
}
|
|
1550
1550
|
function stop$n() {
|
|
1551
1551
|
clearTimeout(timeout$3);
|
|
@@ -1580,7 +1580,7 @@ function recompute$3(root) {
|
|
|
1580
1580
|
var startNode = data$a.start ? data$a.start : null;
|
|
1581
1581
|
if (previous !== null && data$a.start !== null && startNode !== current.anchorNode) {
|
|
1582
1582
|
clearTimeout(timeout$2);
|
|
1583
|
-
process$3(21 /* Selection */);
|
|
1583
|
+
process$3(21 /* Event.Selection */);
|
|
1584
1584
|
}
|
|
1585
1585
|
data$a = {
|
|
1586
1586
|
start: current.anchorNode,
|
|
@@ -1590,7 +1590,7 @@ function recompute$3(root) {
|
|
|
1590
1590
|
};
|
|
1591
1591
|
previous = current;
|
|
1592
1592
|
clearTimeout(timeout$2);
|
|
1593
|
-
timeout$2 = setTimeout(process$3, 500 /* LookAhead */, 21 /* Selection */);
|
|
1593
|
+
timeout$2 = setTimeout(process$3, 500 /* Setting.LookAhead */, 21 /* Event.Selection */);
|
|
1594
1594
|
}
|
|
1595
1595
|
function process$3(event) {
|
|
1596
1596
|
schedule$1(encode$3.bind(this, event));
|
|
@@ -1612,8 +1612,8 @@ function observe$5(root) {
|
|
|
1612
1612
|
bind(root, "submit", recompute$2, true);
|
|
1613
1613
|
}
|
|
1614
1614
|
function recompute$2(evt) {
|
|
1615
|
-
state$2.push({ time: time(), event: 39 /* Submit */, data: { target: target(evt) } });
|
|
1616
|
-
schedule$1(encode$3.bind(this, 39 /* Submit */));
|
|
1615
|
+
state$2.push({ time: time(), event: 39 /* Event.Submit */, data: { target: target(evt) } });
|
|
1616
|
+
schedule$1(encode$3.bind(this, 39 /* Event.Submit */));
|
|
1617
1617
|
}
|
|
1618
1618
|
function reset$a() {
|
|
1619
1619
|
state$2 = [];
|
|
@@ -1628,7 +1628,7 @@ function start$m() {
|
|
|
1628
1628
|
}
|
|
1629
1629
|
function recompute$1(evt) {
|
|
1630
1630
|
data$9 = { name: evt.type };
|
|
1631
|
-
encode$3(26 /* Unload */);
|
|
1631
|
+
encode$3(26 /* Event.Unload */);
|
|
1632
1632
|
stop();
|
|
1633
1633
|
}
|
|
1634
1634
|
function reset$9() {
|
|
@@ -1645,7 +1645,7 @@ function start$l() {
|
|
|
1645
1645
|
}
|
|
1646
1646
|
function recompute() {
|
|
1647
1647
|
data$8 = { visible: "visibilityState" in document ? document.visibilityState : "default" };
|
|
1648
|
-
encode$3(28 /* Visibility */);
|
|
1648
|
+
encode$3(28 /* Event.Visibility */);
|
|
1649
1649
|
}
|
|
1650
1650
|
function reset$8() {
|
|
1651
1651
|
data$8 = null;
|
|
@@ -1707,51 +1707,51 @@ function ld(json) {
|
|
|
1707
1707
|
for (var _i = 0, _a = Object.keys(json); _i < _a.length; _i++) {
|
|
1708
1708
|
var key = _a[_i];
|
|
1709
1709
|
var value = json[key];
|
|
1710
|
-
if (key === "@type" /* Type */ && typeof value === "string") {
|
|
1710
|
+
if (key === "@type" /* JsonLD.Type */ && typeof value === "string") {
|
|
1711
1711
|
value = value.toLowerCase();
|
|
1712
1712
|
/* Normalizations */
|
|
1713
|
-
value = value.indexOf("article" /* Article */) >= 0 || value.indexOf("posting" /* Posting */) >= 0 ? "article" /* Article */ : value;
|
|
1713
|
+
value = value.indexOf("article" /* JsonLD.Article */) >= 0 || value.indexOf("posting" /* JsonLD.Posting */) >= 0 ? "article" /* JsonLD.Article */ : value;
|
|
1714
1714
|
switch (value) {
|
|
1715
|
-
case "article" /* Article */:
|
|
1716
|
-
case "recipe" /* Recipe */:
|
|
1717
|
-
log(5 /* SchemaType */, json[key]);
|
|
1718
|
-
log(8 /* AuthorName */, json["creator" /* Creator */]);
|
|
1719
|
-
log(18 /* Headline */, json["headline" /* Headline */]);
|
|
1715
|
+
case "article" /* JsonLD.Article */:
|
|
1716
|
+
case "recipe" /* JsonLD.Recipe */:
|
|
1717
|
+
log(5 /* Dimension.SchemaType */, json[key]);
|
|
1718
|
+
log(8 /* Dimension.AuthorName */, json["creator" /* JsonLD.Creator */]);
|
|
1719
|
+
log(18 /* Dimension.Headline */, json["headline" /* JsonLD.Headline */]);
|
|
1720
1720
|
break;
|
|
1721
|
-
case "product" /* Product */:
|
|
1722
|
-
log(5 /* SchemaType */, json[key]);
|
|
1723
|
-
log(10 /* ProductName */, json["name" /* Name */]);
|
|
1724
|
-
log(12 /* ProductSku */, json["sku" /* Sku */]);
|
|
1725
|
-
if (json["brand" /* Brand */]) {
|
|
1726
|
-
log(6 /* ProductBrand */, json["brand" /* Brand */]["name" /* Name */]);
|
|
1721
|
+
case "product" /* JsonLD.Product */:
|
|
1722
|
+
log(5 /* Dimension.SchemaType */, json[key]);
|
|
1723
|
+
log(10 /* Dimension.ProductName */, json["name" /* JsonLD.Name */]);
|
|
1724
|
+
log(12 /* Dimension.ProductSku */, json["sku" /* JsonLD.Sku */]);
|
|
1725
|
+
if (json["brand" /* JsonLD.Brand */]) {
|
|
1726
|
+
log(6 /* Dimension.ProductBrand */, json["brand" /* JsonLD.Brand */]["name" /* JsonLD.Name */]);
|
|
1727
1727
|
}
|
|
1728
1728
|
break;
|
|
1729
|
-
case "aggregaterating" /* AggregateRating */:
|
|
1730
|
-
if (json["ratingValue" /* RatingValue */]) {
|
|
1731
|
-
max(11 /* RatingValue */, num$1(json["ratingValue" /* RatingValue */], 100 /* RatingScale */));
|
|
1732
|
-
max(18 /* BestRating */, num$1(json["bestRating" /* BestRating */]));
|
|
1733
|
-
max(19 /* WorstRating */, num$1(json["worstRating" /* WorstRating */]));
|
|
1729
|
+
case "aggregaterating" /* JsonLD.AggregateRating */:
|
|
1730
|
+
if (json["ratingValue" /* JsonLD.RatingValue */]) {
|
|
1731
|
+
max(11 /* Metric.RatingValue */, num$1(json["ratingValue" /* JsonLD.RatingValue */], 100 /* Setting.RatingScale */));
|
|
1732
|
+
max(18 /* Metric.BestRating */, num$1(json["bestRating" /* JsonLD.BestRating */]));
|
|
1733
|
+
max(19 /* Metric.WorstRating */, num$1(json["worstRating" /* JsonLD.WorstRating */]));
|
|
1734
1734
|
}
|
|
1735
|
-
max(12 /* RatingCount */, num$1(json["ratingCount" /* RatingCount */]));
|
|
1736
|
-
max(17 /* ReviewCount */, num$1(json["reviewCount" /* ReviewCount */]));
|
|
1735
|
+
max(12 /* Metric.RatingCount */, num$1(json["ratingCount" /* JsonLD.RatingCount */]));
|
|
1736
|
+
max(17 /* Metric.ReviewCount */, num$1(json["reviewCount" /* JsonLD.ReviewCount */]));
|
|
1737
1737
|
break;
|
|
1738
|
-
case "person" /* Author */:
|
|
1739
|
-
log(8 /* AuthorName */, json["name" /* Name */]);
|
|
1738
|
+
case "person" /* JsonLD.Author */:
|
|
1739
|
+
log(8 /* Dimension.AuthorName */, json["name" /* JsonLD.Name */]);
|
|
1740
1740
|
break;
|
|
1741
|
-
case "offer" /* Offer */:
|
|
1742
|
-
log(7 /* ProductAvailability */, json["availability" /* Availability */]);
|
|
1743
|
-
log(14 /* ProductCondition */, json["itemCondition" /* ItemCondition */]);
|
|
1744
|
-
log(13 /* ProductCurrency */, json["priceCurrency" /* PriceCurrency */]);
|
|
1745
|
-
log(12 /* ProductSku */, json["sku" /* Sku */]);
|
|
1746
|
-
max(13 /* ProductPrice */, num$1(json["price" /* Price */]));
|
|
1741
|
+
case "offer" /* JsonLD.Offer */:
|
|
1742
|
+
log(7 /* Dimension.ProductAvailability */, json["availability" /* JsonLD.Availability */]);
|
|
1743
|
+
log(14 /* Dimension.ProductCondition */, json["itemCondition" /* JsonLD.ItemCondition */]);
|
|
1744
|
+
log(13 /* Dimension.ProductCurrency */, json["priceCurrency" /* JsonLD.PriceCurrency */]);
|
|
1745
|
+
log(12 /* Dimension.ProductSku */, json["sku" /* JsonLD.Sku */]);
|
|
1746
|
+
max(13 /* Metric.ProductPrice */, num$1(json["price" /* JsonLD.Price */]));
|
|
1747
1747
|
break;
|
|
1748
|
-
case "brand" /* Brand */:
|
|
1749
|
-
log(6 /* ProductBrand */, json["name" /* Name */]);
|
|
1748
|
+
case "brand" /* JsonLD.Brand */:
|
|
1749
|
+
log(6 /* Dimension.ProductBrand */, json["name" /* JsonLD.Name */]);
|
|
1750
1750
|
break;
|
|
1751
1751
|
}
|
|
1752
1752
|
}
|
|
1753
1753
|
// Continue parsing nested objects
|
|
1754
|
-
if (value !== null && typeof (value) === "object" /* Object */) {
|
|
1754
|
+
if (value !== null && typeof (value) === "object" /* Constant.Object */) {
|
|
1755
1755
|
ld(value);
|
|
1756
1756
|
}
|
|
1757
1757
|
}
|
|
@@ -1760,8 +1760,8 @@ function num$1(input, scale) {
|
|
|
1760
1760
|
if (scale === void 0) { scale = 1; }
|
|
1761
1761
|
if (input !== null) {
|
|
1762
1762
|
switch (typeof input) {
|
|
1763
|
-
case "number" /* Number */: return Math.round(input * scale);
|
|
1764
|
-
case "string" /* String */: return Math.round(parseFloat(input.replace(digitsRegex, "" /* Empty */)) * scale);
|
|
1763
|
+
case "number" /* Constant.Number */: return Math.round(input * scale);
|
|
1764
|
+
case "string" /* Constant.String */: return Math.round(parseFloat(input.replace(digitsRegex, "" /* Constant.Empty */)) * scale);
|
|
1765
1765
|
}
|
|
1766
1766
|
}
|
|
1767
1767
|
return null;
|
|
@@ -1772,11 +1772,11 @@ var newlineRegex = /[\r\n]+/g;
|
|
|
1772
1772
|
function processNode (node, source) {
|
|
1773
1773
|
var child = null;
|
|
1774
1774
|
// Do not track this change if we are attempting to remove a node before discovering it
|
|
1775
|
-
if (source === 2 /* ChildListRemove */ && has(node) === false) {
|
|
1775
|
+
if (source === 2 /* Source.ChildListRemove */ && has(node) === false) {
|
|
1776
1776
|
return child;
|
|
1777
1777
|
}
|
|
1778
1778
|
// Special handling for text nodes that belong to style nodes
|
|
1779
|
-
if (source !== 0 /* Discover */ &&
|
|
1779
|
+
if (source !== 0 /* Source.Discover */ &&
|
|
1780
1780
|
node.nodeType === Node.TEXT_NODE &&
|
|
1781
1781
|
node.parentElement &&
|
|
1782
1782
|
node.parentElement.tagName === "STYLE") {
|
|
@@ -1789,10 +1789,10 @@ function processNode (node, source) {
|
|
|
1789
1789
|
switch (node.nodeType) {
|
|
1790
1790
|
case Node.DOCUMENT_TYPE_NODE:
|
|
1791
1791
|
parent = insideFrame && node.parentNode ? iframe(node.parentNode) : parent;
|
|
1792
|
-
var docTypePrefix = insideFrame ? "iframe:" /* IFramePrefix */ : "" /* Empty */;
|
|
1792
|
+
var docTypePrefix = insideFrame ? "iframe:" /* Constant.IFramePrefix */ : "" /* Constant.Empty */;
|
|
1793
1793
|
var doctype = node;
|
|
1794
1794
|
var docAttributes = { name: doctype.name, publicId: doctype.publicId, systemId: doctype.systemId };
|
|
1795
|
-
var docData = { tag: docTypePrefix + "*D" /* DocumentTag */, attributes: docAttributes };
|
|
1795
|
+
var docData = { tag: docTypePrefix + "*D" /* Constant.DocumentTag */, attributes: docAttributes };
|
|
1796
1796
|
dom[call](node, parent, docData, source);
|
|
1797
1797
|
break;
|
|
1798
1798
|
case Node.DOCUMENT_NODE:
|
|
@@ -1807,26 +1807,26 @@ function processNode (node, source) {
|
|
|
1807
1807
|
if (shadowRoot.host) {
|
|
1808
1808
|
parse$1(shadowRoot);
|
|
1809
1809
|
var type = typeof (shadowRoot.constructor);
|
|
1810
|
-
if (type === "function" /* Function */ && shadowRoot.constructor.toString().indexOf("[native code]" /* NativeCode */) >= 0) {
|
|
1810
|
+
if (type === "function" /* Constant.Function */ && shadowRoot.constructor.toString().indexOf("[native code]" /* Constant.NativeCode */) >= 0) {
|
|
1811
1811
|
observe$3(shadowRoot);
|
|
1812
1812
|
// See: https://wicg.github.io/construct-stylesheets/ for more details on adoptedStyleSheets.
|
|
1813
1813
|
// At the moment, we are only able to capture "open" shadow DOM nodes. If they are closed, they are not accessible.
|
|
1814
1814
|
// In future we may decide to proxy "attachShadow" call to gain access, but at the moment, we don't want to
|
|
1815
1815
|
// cause any unintended side effect to the page. We will re-evaluate after we gather more real world data on this.
|
|
1816
|
-
var style = "" /* Empty */;
|
|
1816
|
+
var style = "" /* Constant.Empty */;
|
|
1817
1817
|
var adoptedStyleSheets = "adoptedStyleSheets" in shadowRoot ? shadowRoot["adoptedStyleSheets"] : [];
|
|
1818
1818
|
for (var _i = 0, adoptedStyleSheets_1 = adoptedStyleSheets; _i < adoptedStyleSheets_1.length; _i++) {
|
|
1819
1819
|
var styleSheet = adoptedStyleSheets_1[_i];
|
|
1820
1820
|
style += getCssRules(styleSheet);
|
|
1821
1821
|
}
|
|
1822
|
-
var fragementData = { tag: "*S" /* ShadowDomTag */, attributes: { style: style } };
|
|
1822
|
+
var fragementData = { tag: "*S" /* Constant.ShadowDomTag */, attributes: { style: style } };
|
|
1823
1823
|
dom[call](node, shadowRoot.host, fragementData, source);
|
|
1824
1824
|
}
|
|
1825
1825
|
else {
|
|
1826
1826
|
// If the browser doesn't support shadow DOM natively, we detect that, and send appropriate tag back.
|
|
1827
1827
|
// The differentiation is important because we don't have to observe pollyfill shadow DOM nodes,
|
|
1828
1828
|
// the same way we observe real shadow DOM nodes (encapsulation provided by the browser).
|
|
1829
|
-
dom[call](node, shadowRoot.host, { tag: "*P" /* PolyfillShadowDomTag */, attributes: {} }, source);
|
|
1829
|
+
dom[call](node, shadowRoot.host, { tag: "*P" /* Constant.PolyfillShadowDomTag */, attributes: {} }, source);
|
|
1830
1830
|
}
|
|
1831
1831
|
}
|
|
1832
1832
|
break;
|
|
@@ -1839,7 +1839,7 @@ function processNode (node, source) {
|
|
|
1839
1839
|
// The only exception is when we receive a mutation to remove the text node, in that case
|
|
1840
1840
|
// parent will be null, but we can still process the node by checking it's an update call.
|
|
1841
1841
|
if (call === "update" || (parent && has(parent) && parent.tagName !== "STYLE")) {
|
|
1842
|
-
var textData = { tag: "*T" /* TextTag */, value: node.nodeValue };
|
|
1842
|
+
var textData = { tag: "*T" /* Constant.TextTag */, value: node.nodeValue };
|
|
1843
1843
|
dom[call](node, parent, textData, source);
|
|
1844
1844
|
}
|
|
1845
1845
|
break;
|
|
@@ -1851,20 +1851,20 @@ function processNode (node, source) {
|
|
|
1851
1851
|
// For correctness, we first look at parentElement and if it not present then fall back to using parentNode
|
|
1852
1852
|
parent = node.parentElement ? node.parentElement : (node.parentNode ? node.parentNode : null);
|
|
1853
1853
|
// If we encounter a node that is part of SVG namespace, prefix the tag with SVG_PREFIX
|
|
1854
|
-
if (element.namespaceURI === "http://www.w3.org/2000/svg" /* SvgNamespace */) {
|
|
1855
|
-
tag = "svg:" /* SvgPrefix */ + tag;
|
|
1854
|
+
if (element.namespaceURI === "http://www.w3.org/2000/svg" /* Constant.SvgNamespace */) {
|
|
1855
|
+
tag = "svg:" /* Constant.SvgPrefix */ + tag;
|
|
1856
1856
|
}
|
|
1857
1857
|
switch (tag) {
|
|
1858
1858
|
case "HTML":
|
|
1859
1859
|
parent = insideFrame && parent ? iframe(parent) : null;
|
|
1860
|
-
var htmlPrefix = insideFrame ? "iframe:" /* IFramePrefix */ : "" /* Empty */;
|
|
1860
|
+
var htmlPrefix = insideFrame ? "iframe:" /* Constant.IFramePrefix */ : "" /* Constant.Empty */;
|
|
1861
1861
|
var htmlData = { tag: htmlPrefix + tag, attributes: attributes };
|
|
1862
1862
|
dom[call](node, parent, htmlData, source);
|
|
1863
1863
|
break;
|
|
1864
1864
|
case "SCRIPT":
|
|
1865
|
-
if ("type" /* Type */ in attributes && attributes["type" /* Type */] === "application/ld+json" /* JsonLD */) {
|
|
1865
|
+
if ("type" /* Constant.Type */ in attributes && attributes["type" /* Constant.Type */] === "application/ld+json" /* Constant.JsonLD */) {
|
|
1866
1866
|
try {
|
|
1867
|
-
ld(JSON.parse(element.text.replace(newlineRegex, "" /* Empty */)));
|
|
1867
|
+
ld(JSON.parse(element.text.replace(newlineRegex, "" /* Constant.Empty */)));
|
|
1868
1868
|
}
|
|
1869
1869
|
catch ( /* do nothing */_a) { /* do nothing */ }
|
|
1870
1870
|
}
|
|
@@ -1872,20 +1872,20 @@ function processNode (node, source) {
|
|
|
1872
1872
|
case "NOSCRIPT":
|
|
1873
1873
|
break;
|
|
1874
1874
|
case "META":
|
|
1875
|
-
var key = ("property" /* Property */ in attributes ?
|
|
1876
|
-
"property" /* Property */ :
|
|
1877
|
-
("name" /* Name */ in attributes ? "name" /* Name */ : null));
|
|
1878
|
-
if (key && "content" /* Content */ in attributes) {
|
|
1879
|
-
var content = attributes["content" /* Content */];
|
|
1875
|
+
var key = ("property" /* Constant.Property */ in attributes ?
|
|
1876
|
+
"property" /* Constant.Property */ :
|
|
1877
|
+
("name" /* Constant.Name */ in attributes ? "name" /* Constant.Name */ : null));
|
|
1878
|
+
if (key && "content" /* Constant.Content */ in attributes) {
|
|
1879
|
+
var content = attributes["content" /* Constant.Content */];
|
|
1880
1880
|
switch (attributes[key]) {
|
|
1881
|
-
case "og:title" /* ogTitle */:
|
|
1882
|
-
log(20 /* MetaTitle */, content);
|
|
1881
|
+
case "og:title" /* Constant.ogTitle */:
|
|
1882
|
+
log(20 /* Dimension.MetaTitle */, content);
|
|
1883
1883
|
break;
|
|
1884
|
-
case "og:type" /* ogType */:
|
|
1885
|
-
log(19 /* MetaType */, content);
|
|
1884
|
+
case "og:type" /* Constant.ogType */:
|
|
1885
|
+
log(19 /* Dimension.MetaType */, content);
|
|
1886
1886
|
break;
|
|
1887
|
-
case "generator" /* Generator */:
|
|
1888
|
-
log(21 /* Generator */, content);
|
|
1887
|
+
case "generator" /* Constant.Generator */:
|
|
1888
|
+
log(21 /* Dimension.Generator */, content);
|
|
1889
1889
|
break;
|
|
1890
1890
|
}
|
|
1891
1891
|
}
|
|
@@ -1893,7 +1893,7 @@ function processNode (node, source) {
|
|
|
1893
1893
|
case "HEAD":
|
|
1894
1894
|
var head = { tag: tag, attributes: attributes };
|
|
1895
1895
|
if (location) {
|
|
1896
|
-
head.attributes["*B" /* Base */] = location.protocol + "//" + location.hostname;
|
|
1896
|
+
head.attributes["*B" /* Constant.Base */] = location.protocol + "//" + location.hostname;
|
|
1897
1897
|
}
|
|
1898
1898
|
dom[call](node, parent, head, source);
|
|
1899
1899
|
break;
|
|
@@ -1906,7 +1906,7 @@ function processNode (node, source) {
|
|
|
1906
1906
|
var frameData = { tag: tag, attributes: attributes };
|
|
1907
1907
|
if (sameorigin(iframe$1)) {
|
|
1908
1908
|
monitor(iframe$1);
|
|
1909
|
-
frameData.attributes["*O" /* SameOrigin */] = "true";
|
|
1909
|
+
frameData.attributes["*O" /* Constant.SameOrigin */] = "true";
|
|
1910
1910
|
if (iframe$1.contentDocument && iframe$1.contentWindow && iframe$1.contentDocument.readyState !== "loading") {
|
|
1911
1911
|
child = iframe$1.contentDocument;
|
|
1912
1912
|
}
|
|
@@ -1935,7 +1935,7 @@ function observe$3(root) {
|
|
|
1935
1935
|
function getStyleValue(style) {
|
|
1936
1936
|
// Call trim on the text content to ensure we do not process white spaces ( , \n, \r\n, \t, etc.)
|
|
1937
1937
|
// Also, check if stylesheet has any data-* attribute, if so process rules instead of looking up text
|
|
1938
|
-
var value = style.textContent ? style.textContent.trim() : "" /* Empty */;
|
|
1938
|
+
var value = style.textContent ? style.textContent.trim() : "" /* Constant.Empty */;
|
|
1939
1939
|
var dataset = style.dataset ? Object.keys(style.dataset).length : 0;
|
|
1940
1940
|
if (value.length === 0 || dataset > 0) {
|
|
1941
1941
|
value = getCssRules(style.sheet);
|
|
@@ -1943,14 +1943,14 @@ function getStyleValue(style) {
|
|
|
1943
1943
|
return value;
|
|
1944
1944
|
}
|
|
1945
1945
|
function getCssRules(sheet) {
|
|
1946
|
-
var value = "" /* Empty */;
|
|
1946
|
+
var value = "" /* Constant.Empty */;
|
|
1947
1947
|
var cssRules = null;
|
|
1948
1948
|
// Firefox throws a SecurityError when trying to access cssRules of a stylesheet from a different domain
|
|
1949
1949
|
try {
|
|
1950
1950
|
cssRules = sheet ? sheet.cssRules : [];
|
|
1951
1951
|
}
|
|
1952
1952
|
catch (e) {
|
|
1953
|
-
log$1(1 /* CssRules */, 1 /* Warning */, e ? e.name : null);
|
|
1953
|
+
log$1(1 /* Code.CssRules */, 1 /* Severity.Warning */, e ? e.name : null);
|
|
1954
1954
|
if (e && e.name !== "SecurityError") {
|
|
1955
1955
|
throw e;
|
|
1956
1956
|
}
|
|
@@ -1974,8 +1974,8 @@ function getAttributes(element) {
|
|
|
1974
1974
|
}
|
|
1975
1975
|
}
|
|
1976
1976
|
// For INPUT tags read the dynamic "value" property if an explicit "value" attribute is not set
|
|
1977
|
-
if (element.tagName === "INPUT" /* InputTag */ && !("value" /* Value */ in output) && element.value) {
|
|
1978
|
-
output["value" /* Value */] = element.value;
|
|
1977
|
+
if (element.tagName === "INPUT" /* Constant.InputTag */ && !("value" /* Constant.Value */ in output) && element.value) {
|
|
1978
|
+
output["value" /* Constant.Value */] = element.value;
|
|
1979
1979
|
}
|
|
1980
1980
|
return output;
|
|
1981
1981
|
}
|
|
@@ -1997,13 +1997,13 @@ function traverse (root, timer, source) {
|
|
|
1997
1997
|
next = next.nextSibling;
|
|
1998
1998
|
}
|
|
1999
1999
|
state = state$8(timer);
|
|
2000
|
-
if (!(state === 0 /* Wait */)) return [3 /*break*/, 3];
|
|
2000
|
+
if (!(state === 0 /* Task.Wait */)) return [3 /*break*/, 3];
|
|
2001
2001
|
return [4 /*yield*/, suspend$1(timer)];
|
|
2002
2002
|
case 2:
|
|
2003
2003
|
state = _a.sent();
|
|
2004
2004
|
_a.label = 3;
|
|
2005
2005
|
case 3:
|
|
2006
|
-
if (state === 2 /* Stop */) {
|
|
2006
|
+
if (state === 2 /* Task.Stop */) {
|
|
2007
2007
|
return [3 /*break*/, 4];
|
|
2008
2008
|
}
|
|
2009
2009
|
subnode = processNode(node, source);
|
|
@@ -2080,7 +2080,7 @@ function observe$2(node) {
|
|
|
2080
2080
|
// For this reason, we need to wire up mutations every time we see a new shadow dom.
|
|
2081
2081
|
// Also, wrap it inside a try / catch. In certain browsers (e.g. legacy Edge), observer on shadow dom can throw errors
|
|
2082
2082
|
try {
|
|
2083
|
-
var m = api("MutationObserver" /* MutationObserver */);
|
|
2083
|
+
var m = api("MutationObserver" /* Constant.MutationObserver */);
|
|
2084
2084
|
var observer = m in window ? new window[m](measure(handle$1)) : null;
|
|
2085
2085
|
if (observer) {
|
|
2086
2086
|
observer.observe(node, { attributes: true, childList: true, characterData: true, subtree: true });
|
|
@@ -2088,7 +2088,7 @@ function observe$2(node) {
|
|
|
2088
2088
|
}
|
|
2089
2089
|
}
|
|
2090
2090
|
catch (e) {
|
|
2091
|
-
log$1(2 /* MutationObserver */, 0 /* Info */, e ? e.name : null);
|
|
2091
|
+
log$1(2 /* Code.MutationObserver */, 0 /* Severity.Info */, e ? e.name : null);
|
|
2092
2092
|
}
|
|
2093
2093
|
}
|
|
2094
2094
|
function monitor(frame) {
|
|
@@ -2096,7 +2096,7 @@ function monitor(frame) {
|
|
|
2096
2096
|
// This includes cases where iframe location is updated without explicitly updating src attribute
|
|
2097
2097
|
// E.g. iframe.contentWindow.location.href = "new-location";
|
|
2098
2098
|
if (has(frame) === false) {
|
|
2099
|
-
bind(frame, "load" /* LoadEvent */, generate.bind(this, frame, "childList" /* ChildList */), true);
|
|
2099
|
+
bind(frame, "load" /* Constant.LoadEvent */, generate.bind(this, frame, "childList" /* Constant.ChildList */), true);
|
|
2100
2100
|
}
|
|
2101
2101
|
}
|
|
2102
2102
|
function stop$h() {
|
|
@@ -2114,14 +2114,14 @@ function stop$h() {
|
|
|
2114
2114
|
timeout$1 = null;
|
|
2115
2115
|
}
|
|
2116
2116
|
function active$2() {
|
|
2117
|
-
activePeriod = time() + 3000 /* MutationActivePeriod */;
|
|
2117
|
+
activePeriod = time() + 3000 /* Setting.MutationActivePeriod */;
|
|
2118
2118
|
}
|
|
2119
2119
|
function handle$1(m) {
|
|
2120
2120
|
// Queue up mutation records for asynchronous processing
|
|
2121
2121
|
var now = time();
|
|
2122
|
-
track$6(6 /* Mutation */, now);
|
|
2122
|
+
track$6(6 /* Event.Mutation */, now);
|
|
2123
2123
|
mutations.push({ time: now, mutations: m });
|
|
2124
|
-
schedule$1(process$2, 1 /* High */).then(function () {
|
|
2124
|
+
schedule$1(process$2, 1 /* Priority.High */).then(function () {
|
|
2125
2125
|
setTimeout(compute$7);
|
|
2126
2126
|
measure(compute$6)();
|
|
2127
2127
|
});
|
|
@@ -2132,7 +2132,7 @@ function process$2() {
|
|
|
2132
2132
|
return __generator(this, function (_b) {
|
|
2133
2133
|
switch (_b.label) {
|
|
2134
2134
|
case 0:
|
|
2135
|
-
timer = { id: id(), cost: 3 /* LayoutCost */ };
|
|
2135
|
+
timer = { id: id(), cost: 3 /* Metric.LayoutCost */ };
|
|
2136
2136
|
start$w(timer);
|
|
2137
2137
|
_b.label = 1;
|
|
2138
2138
|
case 1:
|
|
@@ -2144,13 +2144,13 @@ function process$2() {
|
|
|
2144
2144
|
if (!(_i < _a.length)) return [3 /*break*/, 6];
|
|
2145
2145
|
mutation = _a[_i];
|
|
2146
2146
|
state = state$8(timer);
|
|
2147
|
-
if (!(state === 0 /* Wait */)) return [3 /*break*/, 4];
|
|
2147
|
+
if (!(state === 0 /* Task.Wait */)) return [3 /*break*/, 4];
|
|
2148
2148
|
return [4 /*yield*/, suspend$1(timer)];
|
|
2149
2149
|
case 3:
|
|
2150
2150
|
state = _b.sent();
|
|
2151
2151
|
_b.label = 4;
|
|
2152
2152
|
case 4:
|
|
2153
|
-
if (state === 2 /* Stop */) {
|
|
2153
|
+
if (state === 2 /* Task.Stop */) {
|
|
2154
2154
|
return [3 /*break*/, 6];
|
|
2155
2155
|
}
|
|
2156
2156
|
target = mutation.target;
|
|
@@ -2162,17 +2162,17 @@ function process$2() {
|
|
|
2162
2162
|
parse$1(target);
|
|
2163
2163
|
}
|
|
2164
2164
|
switch (type) {
|
|
2165
|
-
case "attributes" /* Attributes */:
|
|
2166
|
-
processNode(target, 3 /* Attributes */);
|
|
2165
|
+
case "attributes" /* Constant.Attributes */:
|
|
2166
|
+
processNode(target, 3 /* Source.Attributes */);
|
|
2167
2167
|
break;
|
|
2168
|
-
case "characterData" /* CharacterData */:
|
|
2169
|
-
processNode(target, 4 /* CharacterData */);
|
|
2168
|
+
case "characterData" /* Constant.CharacterData */:
|
|
2169
|
+
processNode(target, 4 /* Source.CharacterData */);
|
|
2170
2170
|
break;
|
|
2171
|
-
case "childList" /* ChildList */:
|
|
2172
|
-
processNodeList(mutation.addedNodes, 1 /* ChildListAdd */, timer);
|
|
2173
|
-
processNodeList(mutation.removedNodes, 2 /* ChildListRemove */, timer);
|
|
2171
|
+
case "childList" /* Constant.ChildList */:
|
|
2172
|
+
processNodeList(mutation.addedNodes, 1 /* Source.ChildListAdd */, timer);
|
|
2173
|
+
processNodeList(mutation.removedNodes, 2 /* Source.ChildListRemove */, timer);
|
|
2174
2174
|
break;
|
|
2175
|
-
case "suspend" /* Suspend */:
|
|
2175
|
+
case "suspend" /* Constant.Suspend */:
|
|
2176
2176
|
value = get(target);
|
|
2177
2177
|
if (value) {
|
|
2178
2178
|
value.metadata.suspend = true;
|
|
@@ -2183,7 +2183,7 @@ function process$2() {
|
|
|
2183
2183
|
case 5:
|
|
2184
2184
|
_i++;
|
|
2185
2185
|
return [3 /*break*/, 2];
|
|
2186
|
-
case 6: return [4 /*yield*/, encode$4(6 /* Mutation */, timer, record.time)];
|
|
2186
|
+
case 6: return [4 /*yield*/, encode$4(6 /* Event.Mutation */, timer, record.time)];
|
|
2187
2187
|
case 7:
|
|
2188
2188
|
_b.sent();
|
|
2189
2189
|
return [3 /*break*/, 1];
|
|
@@ -2197,11 +2197,11 @@ function process$2() {
|
|
|
2197
2197
|
function track$5(m, timer) {
|
|
2198
2198
|
var value = m.target ? get(m.target.parentNode) : null;
|
|
2199
2199
|
// Check if the parent is already discovered and that the parent is not the document root
|
|
2200
|
-
if (value && value.data.tag !== "HTML" /* HTML */) {
|
|
2200
|
+
if (value && value.data.tag !== "HTML" /* Constant.HTML */) {
|
|
2201
2201
|
var inactive = time() > activePeriod;
|
|
2202
2202
|
var target = get(m.target);
|
|
2203
2203
|
var element = target && target.selector ? target.selector.join() : m.target.nodeName;
|
|
2204
|
-
var parent_1 = value.selector ? value.selector.join() : "" /* Empty */;
|
|
2204
|
+
var parent_1 = value.selector ? value.selector.join() : "" /* Constant.Empty */;
|
|
2205
2205
|
// We use selector, instead of id, to determine the key (signature for the mutation) because in some cases
|
|
2206
2206
|
// repeated mutations can cause elements to be destroyed and then recreated as new DOM nodes
|
|
2207
2207
|
// In those cases, IDs will change however the selector (which is relative to DOM xPath) remains the same
|
|
@@ -2210,20 +2210,20 @@ function track$5(m, timer) {
|
|
|
2210
2210
|
history$4[key] = key in history$4 ? history$4[key] : [0];
|
|
2211
2211
|
var h = history$4[key];
|
|
2212
2212
|
// Lookup any pending nodes queued up for removal, and process them now if we suspended a mutation before
|
|
2213
|
-
if (inactive === false && h[0] >= 10 /* MutationSuspendThreshold */) {
|
|
2214
|
-
processNodeList(h[1], 2 /* ChildListRemove */, timer);
|
|
2213
|
+
if (inactive === false && h[0] >= 10 /* Setting.MutationSuspendThreshold */) {
|
|
2214
|
+
processNodeList(h[1], 2 /* Source.ChildListRemove */, timer);
|
|
2215
2215
|
}
|
|
2216
2216
|
// Update the counter
|
|
2217
2217
|
h[0] = inactive ? h[0] + 1 : 1;
|
|
2218
2218
|
// Return updated mutation type based on if we have already hit the threshold or not
|
|
2219
|
-
if (h[0] === 10 /* MutationSuspendThreshold */) {
|
|
2219
|
+
if (h[0] === 10 /* Setting.MutationSuspendThreshold */) {
|
|
2220
2220
|
// Store a reference to removedNodes so we can process them later
|
|
2221
2221
|
// when we resume mutations again on user interactions
|
|
2222
2222
|
h[1] = m.removedNodes;
|
|
2223
|
-
return "suspend" /* Suspend */;
|
|
2223
|
+
return "suspend" /* Constant.Suspend */;
|
|
2224
2224
|
}
|
|
2225
|
-
else if (h[0] > 10 /* MutationSuspendThreshold */) {
|
|
2226
|
-
return "" /* Empty */;
|
|
2225
|
+
else if (h[0] > 10 /* Setting.MutationSuspendThreshold */) {
|
|
2226
|
+
return "" /* Constant.Empty */;
|
|
2227
2227
|
}
|
|
2228
2228
|
}
|
|
2229
2229
|
return m.type;
|
|
@@ -2246,18 +2246,18 @@ function processNodeList(list, source, timer) {
|
|
|
2246
2246
|
_a.label = 1;
|
|
2247
2247
|
case 1:
|
|
2248
2248
|
if (!(i < length)) return [3 /*break*/, 6];
|
|
2249
|
-
if (!(source === 1 /* ChildListAdd */)) return [3 /*break*/, 2];
|
|
2249
|
+
if (!(source === 1 /* Source.ChildListAdd */)) return [3 /*break*/, 2];
|
|
2250
2250
|
traverse(list[i], timer, source);
|
|
2251
2251
|
return [3 /*break*/, 5];
|
|
2252
2252
|
case 2:
|
|
2253
2253
|
state = state$8(timer);
|
|
2254
|
-
if (!(state === 0 /* Wait */)) return [3 /*break*/, 4];
|
|
2254
|
+
if (!(state === 0 /* Task.Wait */)) return [3 /*break*/, 4];
|
|
2255
2255
|
return [4 /*yield*/, suspend$1(timer)];
|
|
2256
2256
|
case 3:
|
|
2257
2257
|
state = _a.sent();
|
|
2258
2258
|
_a.label = 4;
|
|
2259
2259
|
case 4:
|
|
2260
|
-
if (state === 2 /* Stop */) {
|
|
2260
|
+
if (state === 2 /* Task.Stop */) {
|
|
2261
2261
|
return [3 /*break*/, 6];
|
|
2262
2262
|
}
|
|
2263
2263
|
processNode(list[i], source);
|
|
@@ -2282,7 +2282,7 @@ function schedule(node, fragment) {
|
|
|
2282
2282
|
if (timeout$1) {
|
|
2283
2283
|
clearTimeout(timeout$1);
|
|
2284
2284
|
}
|
|
2285
|
-
timeout$1 = setTimeout(function () { trigger$1(fragment); }, 33 /* LookAhead */);
|
|
2285
|
+
timeout$1 = setTimeout(function () { trigger$1(fragment); }, 33 /* Setting.LookAhead */);
|
|
2286
2286
|
return node;
|
|
2287
2287
|
}
|
|
2288
2288
|
function trigger$1(fragment) {
|
|
@@ -2295,7 +2295,7 @@ function trigger$1(fragment) {
|
|
|
2295
2295
|
if (shadowRoot && has(node)) {
|
|
2296
2296
|
continue;
|
|
2297
2297
|
}
|
|
2298
|
-
generate(node, shadowRoot || fragment ? "childList" /* ChildList */ : "characterData" /* CharacterData */);
|
|
2298
|
+
generate(node, shadowRoot || fragment ? "childList" /* Constant.ChildList */ : "characterData" /* Constant.CharacterData */);
|
|
2299
2299
|
}
|
|
2300
2300
|
}
|
|
2301
2301
|
queue$2 = [];
|
|
@@ -2344,8 +2344,8 @@ function reset$7() {
|
|
|
2344
2344
|
hashMap = {};
|
|
2345
2345
|
override = [];
|
|
2346
2346
|
unmask = [];
|
|
2347
|
-
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 */);
|
|
2348
|
-
maskDisable = "radio,checkbox,range,button,reset,submit" /* Disable */.split("," /* Comma */);
|
|
2347
|
+
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 */);
|
|
2348
|
+
maskDisable = "radio,checkbox,range,button,reset,submit" /* Mask.Disable */.split("," /* Constant.Comma */);
|
|
2349
2349
|
idMap = new WeakMap();
|
|
2350
2350
|
iframeMap = new WeakMap();
|
|
2351
2351
|
privacyMap = new WeakMap();
|
|
@@ -2360,19 +2360,19 @@ function parse$1(root, init) {
|
|
|
2360
2360
|
try {
|
|
2361
2361
|
// Parse unmask configuration into separate query selectors and override tokens as part of initialization
|
|
2362
2362
|
if (init) {
|
|
2363
|
-
config$1.unmask.forEach(function (x) { return x.indexOf("!" /* Bang */) < 0 ? unmask.push(x) : override.push(x.substr(1)); });
|
|
2363
|
+
config$1.unmask.forEach(function (x) { return x.indexOf("!" /* Constant.Bang */) < 0 ? unmask.push(x) : override.push(x.substr(1)); });
|
|
2364
2364
|
}
|
|
2365
2365
|
// Since mutations may happen on leaf nodes too, e.g. text nodes, which may not support all selector APIs.
|
|
2366
2366
|
// We ensure that the root note supports querySelectorAll API before executing the code below to identify new regions.
|
|
2367
2367
|
if ("querySelectorAll" in root) {
|
|
2368
|
-
config$1.regions.forEach(function (x) { return root.querySelectorAll(x[1]).forEach(function (e) { return observe$1(e, ""
|
|
2369
|
-
config$1.mask.forEach(function (x) { return root.querySelectorAll(x).forEach(function (e) { return privacyMap.set(e, 3 /* TextImage */); }); }); // Masked Elements
|
|
2368
|
+
config$1.regions.forEach(function (x) { return root.querySelectorAll(x[1]).forEach(function (e) { return observe$1(e, "".concat(x[0])); }); }); // Regions
|
|
2369
|
+
config$1.mask.forEach(function (x) { return root.querySelectorAll(x).forEach(function (e) { return privacyMap.set(e, 3 /* Privacy.TextImage */); }); }); // Masked Elements
|
|
2370
2370
|
config$1.fraud.forEach(function (x) { return root.querySelectorAll(x[1]).forEach(function (e) { return fraudMap.set(e, x[0]); }); }); // Fraud Check
|
|
2371
|
-
unmask.forEach(function (x) { return root.querySelectorAll(x).forEach(function (e) { return privacyMap.set(e, 0 /* None */); }); }); // Unmasked Elements
|
|
2371
|
+
unmask.forEach(function (x) { return root.querySelectorAll(x).forEach(function (e) { return privacyMap.set(e, 0 /* Privacy.None */); }); }); // Unmasked Elements
|
|
2372
2372
|
}
|
|
2373
2373
|
}
|
|
2374
2374
|
catch (e) {
|
|
2375
|
-
log$1(5 /* Selector */, 1 /* Warning */, e ? e.name : null);
|
|
2375
|
+
log$1(5 /* Code.Selector */, 1 /* Severity.Warning */, e ? e.name : null);
|
|
2376
2376
|
}
|
|
2377
2377
|
}
|
|
2378
2378
|
function getId(node, autogen) {
|
|
@@ -2395,17 +2395,18 @@ function add(node, parent, data, source) {
|
|
|
2395
2395
|
var regionId = exists(node) ? id : null;
|
|
2396
2396
|
var fragmentId = null;
|
|
2397
2397
|
var fraudId = fraudMap.has(node) ? fraudMap.get(node) : null;
|
|
2398
|
-
var privacyId = config$1.content ? 1 /* Sensitive */ : 2 /* Text */;
|
|
2398
|
+
var privacyId = config$1.content ? 1 /* Privacy.Sensitive */ : 2 /* Privacy.Text */;
|
|
2399
2399
|
if (parentId >= 0 && values[parentId]) {
|
|
2400
2400
|
parentValue = values[parentId];
|
|
2401
2401
|
parentValue.children.push(id);
|
|
2402
2402
|
regionId = regionId === null ? parentValue.region : regionId;
|
|
2403
2403
|
fragmentId = parentValue.fragment;
|
|
2404
2404
|
fraudId = fraudId === null ? parentValue.metadata.fraud : fraudId;
|
|
2405
|
+
privacyId = parentValue.metadata.privacy;
|
|
2405
2406
|
}
|
|
2406
2407
|
// If there's an explicit region attribute set on the element, use it to mark a region on the page
|
|
2407
|
-
if (data.attributes && "data-clarity-region" /* RegionData */ in data.attributes) {
|
|
2408
|
-
observe$1(node, data.attributes["data-clarity-region" /* RegionData */]);
|
|
2408
|
+
if (data.attributes && "data-clarity-region" /* Constant.RegionData */ in data.attributes) {
|
|
2409
|
+
observe$1(node, data.attributes["data-clarity-region" /* Constant.RegionData */]);
|
|
2409
2410
|
regionId = id;
|
|
2410
2411
|
}
|
|
2411
2412
|
nodes[id] = node;
|
|
@@ -2483,7 +2484,7 @@ function update$1(node, parent, data, source) {
|
|
|
2483
2484
|
}
|
|
2484
2485
|
function sameorigin(node) {
|
|
2485
2486
|
var output = false;
|
|
2486
|
-
if (node.nodeType === Node.ELEMENT_NODE && node.tagName === "IFRAME" /* IFrameTag */) {
|
|
2487
|
+
if (node.nodeType === Node.ELEMENT_NODE && node.tagName === "IFRAME" /* Constant.IFrameTag */) {
|
|
2487
2488
|
var frame = node;
|
|
2488
2489
|
// To determine if the iframe is same-origin or not, we try accessing it's contentDocument.
|
|
2489
2490
|
// If the browser throws an exception, we assume it's cross-origin and move on.
|
|
@@ -2510,11 +2511,11 @@ function privacy(node, value, parent) {
|
|
|
2510
2511
|
var attributes = data.attributes || {};
|
|
2511
2512
|
var tag = data.tag.toUpperCase();
|
|
2512
2513
|
switch (true) {
|
|
2513
|
-
case "data-clarity-mask" /* MaskData */ in attributes:
|
|
2514
|
-
metadata.privacy = 3 /* TextImage */;
|
|
2514
|
+
case "data-clarity-mask" /* Constant.MaskData */ in attributes:
|
|
2515
|
+
metadata.privacy = 3 /* Privacy.TextImage */;
|
|
2515
2516
|
break;
|
|
2516
|
-
case "data-clarity-unmask" /* UnmaskData */ in attributes:
|
|
2517
|
-
metadata.privacy = 0 /* None */;
|
|
2517
|
+
case "data-clarity-unmask" /* Constant.UnmaskData */ in attributes:
|
|
2518
|
+
metadata.privacy = 0 /* Privacy.None */;
|
|
2518
2519
|
break;
|
|
2519
2520
|
case privacyMap.has(node):
|
|
2520
2521
|
// If this node was explicitly configured to contain sensitive content, honor that privacy setting
|
|
@@ -2522,31 +2523,31 @@ function privacy(node, value, parent) {
|
|
|
2522
2523
|
break;
|
|
2523
2524
|
case fraudMap.has(node):
|
|
2524
2525
|
// If this node was explicitly configured to be evaluated for fraud, then also mask content
|
|
2525
|
-
metadata.privacy = 2 /* Text */;
|
|
2526
|
+
metadata.privacy = 2 /* Privacy.Text */;
|
|
2526
2527
|
break;
|
|
2527
|
-
case tag === "*T" /* TextTag */:
|
|
2528
|
+
case tag === "*T" /* Constant.TextTag */:
|
|
2528
2529
|
// If it's a text node belonging to a STYLE or TITLE tag or one of SCRUB_EXCEPTIONS, then capture content
|
|
2529
|
-
var pTag = parent && parent.data ? parent.data.tag : "" /* Empty */;
|
|
2530
|
-
var pSelector_1 = parent && parent.selector ? parent.selector[0 /* Stable */] : "" /* Empty */;
|
|
2531
|
-
metadata.privacy = pTag === "STYLE" /* StyleTag */ || pTag === "TITLE" /* TitleTag */ || override.some(function (x) { return pSelector_1.indexOf(x) >= 0; }) ? 0 /* None */ : current;
|
|
2530
|
+
var pTag = parent && parent.data ? parent.data.tag : "" /* Constant.Empty */;
|
|
2531
|
+
var pSelector_1 = parent && parent.selector ? parent.selector[0 /* Selector.Stable */] : "" /* Constant.Empty */;
|
|
2532
|
+
metadata.privacy = pTag === "STYLE" /* Constant.StyleTag */ || pTag === "TITLE" /* Constant.TitleTag */ || override.some(function (x) { return pSelector_1.indexOf(x) >= 0; }) ? 0 /* Privacy.None */ : current;
|
|
2532
2533
|
break;
|
|
2533
|
-
case "type" /* Type */ in attributes:
|
|
2534
|
+
case "type" /* Constant.Type */ in attributes:
|
|
2534
2535
|
// If this node has an explicit type assigned to it, go through masking rules to determine right privacy setting
|
|
2535
|
-
metadata.privacy = inspect(attributes["type" /* Type */], metadata);
|
|
2536
|
+
metadata.privacy = inspect(attributes["type" /* Constant.Type */], metadata);
|
|
2536
2537
|
break;
|
|
2537
|
-
case tag === "INPUT" /* InputTag */ && current === 0 /* None */:
|
|
2538
|
+
case tag === "INPUT" /* Constant.InputTag */ && current === 0 /* Privacy.None */:
|
|
2538
2539
|
// If even default privacy setting is to not mask, we still scan through input fields for any sensitive information
|
|
2539
|
-
var field_1 = "" /* Empty */;
|
|
2540
|
+
var field_1 = "" /* Constant.Empty */;
|
|
2540
2541
|
Object.keys(attributes).forEach(function (x) { return field_1 += attributes[x].toLowerCase(); });
|
|
2541
2542
|
metadata.privacy = inspect(field_1, metadata);
|
|
2542
2543
|
break;
|
|
2543
|
-
case current === 1 /* Sensitive */ && tag === "INPUT" /* InputTag */:
|
|
2544
|
+
case current === 1 /* Privacy.Sensitive */ && tag === "INPUT" /* Constant.InputTag */:
|
|
2544
2545
|
// If it's a button or an input option, make an exception to disable masking
|
|
2545
|
-
metadata.privacy = maskDisable.indexOf(attributes["type" /* Type */]) >= 0 ? 0 /* None */ : current;
|
|
2546
|
+
metadata.privacy = maskDisable.indexOf(attributes["type" /* Constant.Type */]) >= 0 ? 0 /* Privacy.None */ : current;
|
|
2546
2547
|
break;
|
|
2547
|
-
case current === 1 /* Sensitive */:
|
|
2548
|
+
case current === 1 /* Privacy.Sensitive */:
|
|
2548
2549
|
// In a mode where we mask sensitive information by default, look through class names to aggressively mask content
|
|
2549
|
-
metadata.privacy = inspect(attributes["class" /* Class */], metadata);
|
|
2550
|
+
metadata.privacy = inspect(attributes["class" /* Constant.Class */], metadata);
|
|
2550
2551
|
break;
|
|
2551
2552
|
default:
|
|
2552
2553
|
metadata.privacy = parent ? parent.metadata.privacy : metadata.privacy;
|
|
@@ -2555,7 +2556,7 @@ function privacy(node, value, parent) {
|
|
|
2555
2556
|
}
|
|
2556
2557
|
function inspect(input, metadata) {
|
|
2557
2558
|
if (input && maskText.some(function (x) { return input.indexOf(x) >= 0; })) {
|
|
2558
|
-
return 2 /* Text */;
|
|
2559
|
+
return 2 /* Privacy.Text */;
|
|
2559
2560
|
}
|
|
2560
2561
|
return metadata.privacy;
|
|
2561
2562
|
}
|
|
@@ -2647,7 +2648,7 @@ function remove(id, source) {
|
|
|
2647
2648
|
}
|
|
2648
2649
|
function size(value) {
|
|
2649
2650
|
// If this element is a image node, and is masked, then track box model for the current element
|
|
2650
|
-
if (value.data.tag === "IMG" /* ImageTag */ && value.metadata.privacy === 3 /* TextImage */) {
|
|
2651
|
+
if (value.data.tag === "IMG" /* Constant.ImageTag */ && value.metadata.privacy === 3 /* Privacy.TextImage */) {
|
|
2651
2652
|
value.metadata.size = [];
|
|
2652
2653
|
}
|
|
2653
2654
|
}
|
|
@@ -2682,7 +2683,7 @@ function track$4(id, source, fragment, changed, parentChanged) {
|
|
|
2682
2683
|
// Edge case: If an element is added later on, and pre-discovered element is moved as a child.
|
|
2683
2684
|
// In that case, we need to reorder the pre-discovered element in the update list to keep visualization consistent.
|
|
2684
2685
|
var uIndex = updateMap.indexOf(id);
|
|
2685
|
-
if (uIndex >= 0 && source === 1 /* ChildListAdd */ && parentChanged) {
|
|
2686
|
+
if (uIndex >= 0 && source === 1 /* Source.ChildListAdd */ && parentChanged) {
|
|
2686
2687
|
updateMap.splice(uIndex, 1);
|
|
2687
2688
|
updateMap.push(id);
|
|
2688
2689
|
}
|
|
@@ -2728,15 +2729,15 @@ function exists(node) {
|
|
|
2728
2729
|
}
|
|
2729
2730
|
function track$3(id, event) {
|
|
2730
2731
|
var node = getNode(id);
|
|
2731
|
-
var data = id in regions ? regions[id] : { id: id, visibility: 0 /* Rendered */, interaction: 16 /* None */, name: regionMap.get(node) };
|
|
2732
|
+
var data = id in regions ? regions[id] : { id: id, visibility: 0 /* RegionVisibility.Rendered */, interaction: 16 /* InteractionState.None */, name: regionMap.get(node) };
|
|
2732
2733
|
// Determine the interaction state based on incoming event
|
|
2733
|
-
var interaction = 16 /* None */;
|
|
2734
|
+
var interaction = 16 /* InteractionState.None */;
|
|
2734
2735
|
switch (event) {
|
|
2735
|
-
case 9 /* Click */:
|
|
2736
|
-
interaction = 20 /* Clicked */;
|
|
2736
|
+
case 9 /* Event.Click */:
|
|
2737
|
+
interaction = 20 /* InteractionState.Clicked */;
|
|
2737
2738
|
break;
|
|
2738
|
-
case 27 /* Input */:
|
|
2739
|
-
interaction = 30 /* Input */;
|
|
2739
|
+
case 27 /* Event.Input */:
|
|
2740
|
+
interaction = 30 /* InteractionState.Input */;
|
|
2740
2741
|
break;
|
|
2741
2742
|
}
|
|
2742
2743
|
// Process updates to this region, if applicable
|
|
@@ -2764,7 +2765,7 @@ function compute$6() {
|
|
|
2764
2765
|
queue$1 = q;
|
|
2765
2766
|
// Schedule encode only when we have at least one valid data entry
|
|
2766
2767
|
if (state$1.length > 0) {
|
|
2767
|
-
encode$4(7 /* Region */);
|
|
2768
|
+
encode$4(7 /* Event.Region */);
|
|
2768
2769
|
}
|
|
2769
2770
|
}
|
|
2770
2771
|
function handler$1(entries) {
|
|
@@ -2780,27 +2781,27 @@ function handler$1(entries) {
|
|
|
2780
2781
|
// 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
|
|
2781
2782
|
if (regionMap.has(target) && rect.width + rect.height > 0 && viewport.width > 0 && viewport.height > 0) {
|
|
2782
2783
|
var id = target ? getId(target) : null;
|
|
2783
|
-
var data = id in regions ? regions[id] : { id: id, name: regionMap.get(target), interaction: 16 /* None */, visibility: 0 /* Rendered */ };
|
|
2784
|
+
var data = id in regions ? regions[id] : { id: id, name: regionMap.get(target), interaction: 16 /* InteractionState.None */, visibility: 0 /* RegionVisibility.Rendered */ };
|
|
2784
2785
|
// For regions that have relatively smaller area, we look at intersection ratio and see the overlap relative to element's area
|
|
2785
2786
|
// However, for larger regions, area of regions could be bigger than viewport and therefore comparison is relative to visible area
|
|
2786
2787
|
var viewportRatio = overlap ? (overlap.width * overlap.height * 1.0) / (viewport.width * viewport.height) : 0;
|
|
2787
|
-
var visible = viewportRatio > 0.05 /* ViewportIntersectionRatio */ || entry.intersectionRatio > 0.8 /* IntersectionRatio */;
|
|
2788
|
+
var visible = viewportRatio > 0.05 /* Setting.ViewportIntersectionRatio */ || entry.intersectionRatio > 0.8 /* Setting.IntersectionRatio */;
|
|
2788
2789
|
// If an element is either visible or was visible and has been scrolled to the end
|
|
2789
2790
|
// 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.
|
|
2790
2791
|
// 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
|
|
2791
|
-
var scrolledToEnd = (visible || data.visibility == 10 /* Visible */) && Math.abs(rect.top) + viewport.height > rect.height;
|
|
2792
|
+
var scrolledToEnd = (visible || data.visibility == 10 /* RegionVisibility.Visible */) && Math.abs(rect.top) + viewport.height > rect.height;
|
|
2792
2793
|
// Process updates to this region, if applicable
|
|
2793
2794
|
process$1(target, data, data.interaction, (scrolledToEnd ?
|
|
2794
|
-
13 /* ScrolledToEnd */ :
|
|
2795
|
-
(visible ? 10 /* Visible */ : 0 /* Rendered */)));
|
|
2795
|
+
13 /* RegionVisibility.ScrolledToEnd */ :
|
|
2796
|
+
(visible ? 10 /* RegionVisibility.Visible */ : 0 /* RegionVisibility.Rendered */)));
|
|
2796
2797
|
// Stop observing this element now that we have already received scrolled signal
|
|
2797
|
-
if (data.visibility >= 13 /* ScrolledToEnd */ && observer$1) {
|
|
2798
|
+
if (data.visibility >= 13 /* RegionVisibility.ScrolledToEnd */ && observer$1) {
|
|
2798
2799
|
observer$1.unobserve(target);
|
|
2799
2800
|
}
|
|
2800
2801
|
}
|
|
2801
2802
|
}
|
|
2802
2803
|
if (state$1.length > 0) {
|
|
2803
|
-
encode$4(7 /* Region */);
|
|
2804
|
+
encode$4(7 /* Event.Region */);
|
|
2804
2805
|
}
|
|
2805
2806
|
}
|
|
2806
2807
|
function process$1(n, d, s, v) {
|
|
@@ -2859,7 +2860,7 @@ function link(node) {
|
|
|
2859
2860
|
function metadata$2(node, event, text) {
|
|
2860
2861
|
if (text === void 0) { text = null; }
|
|
2861
2862
|
// If the node is null, we return a reserved value for id: 0. Valid assignment of id begins from 1+.
|
|
2862
|
-
var output = { id: 0, hash: null, privacy: 2 /* Text */, node: node };
|
|
2863
|
+
var output = { id: 0, hash: null, privacy: 2 /* Privacy.Text */, node: node };
|
|
2863
2864
|
if (node) {
|
|
2864
2865
|
var value = get(node);
|
|
2865
2866
|
if (value !== null) {
|
|
@@ -2885,15 +2886,15 @@ function encode$3 (type) {
|
|
|
2885
2886
|
t = time();
|
|
2886
2887
|
tokens = [t, type];
|
|
2887
2888
|
switch (type) {
|
|
2888
|
-
case 13 /* MouseDown */:
|
|
2889
|
-
case 14 /* MouseUp */:
|
|
2890
|
-
case 12 /* MouseMove */:
|
|
2891
|
-
case 15 /* MouseWheel */:
|
|
2892
|
-
case 16 /* DoubleClick */:
|
|
2893
|
-
case 17 /* TouchStart */:
|
|
2894
|
-
case 18 /* TouchEnd */:
|
|
2895
|
-
case 19 /* TouchMove */:
|
|
2896
|
-
case 20 /* TouchCancel */:
|
|
2889
|
+
case 13 /* Event.MouseDown */:
|
|
2890
|
+
case 14 /* Event.MouseUp */:
|
|
2891
|
+
case 12 /* Event.MouseMove */:
|
|
2892
|
+
case 15 /* Event.MouseWheel */:
|
|
2893
|
+
case 16 /* Event.DoubleClick */:
|
|
2894
|
+
case 17 /* Event.TouchStart */:
|
|
2895
|
+
case 18 /* Event.TouchEnd */:
|
|
2896
|
+
case 19 /* Event.TouchMove */:
|
|
2897
|
+
case 20 /* Event.TouchCancel */:
|
|
2897
2898
|
for (_i = 0, _a = state$4; _i < _a.length; _i++) {
|
|
2898
2899
|
entry = _a[_i];
|
|
2899
2900
|
pTarget = metadata$2(entry.data.target, entry.event);
|
|
@@ -2908,12 +2909,12 @@ function encode$3 (type) {
|
|
|
2908
2909
|
}
|
|
2909
2910
|
reset$e();
|
|
2910
2911
|
break;
|
|
2911
|
-
case 9 /* Click */:
|
|
2912
|
+
case 9 /* Event.Click */:
|
|
2912
2913
|
for (_b = 0, _c = state$7; _b < _c.length; _b++) {
|
|
2913
2914
|
entry = _c[_b];
|
|
2914
2915
|
cTarget = metadata$2(entry.data.target, entry.event, entry.data.text);
|
|
2915
2916
|
tokens = [entry.time, entry.event];
|
|
2916
|
-
cHash = cTarget.hash.join("." /* Dot */);
|
|
2917
|
+
cHash = cTarget.hash.join("." /* Constant.Dot */);
|
|
2917
2918
|
tokens.push(cTarget.id);
|
|
2918
2919
|
tokens.push(entry.data.x);
|
|
2919
2920
|
tokens.push(entry.data.y);
|
|
@@ -2931,7 +2932,7 @@ function encode$3 (type) {
|
|
|
2931
2932
|
}
|
|
2932
2933
|
reset$h();
|
|
2933
2934
|
break;
|
|
2934
|
-
case 38 /* Clipboard */:
|
|
2935
|
+
case 38 /* Event.Clipboard */:
|
|
2935
2936
|
for (_d = 0, _e = state$6; _d < _e.length; _d++) {
|
|
2936
2937
|
entry = _e[_d];
|
|
2937
2938
|
tokens = [entry.time, entry.event];
|
|
@@ -2944,7 +2945,7 @@ function encode$3 (type) {
|
|
|
2944
2945
|
}
|
|
2945
2946
|
reset$g();
|
|
2946
2947
|
break;
|
|
2947
|
-
case 11 /* Resize */:
|
|
2948
|
+
case 11 /* Event.Resize */:
|
|
2948
2949
|
r = data$b;
|
|
2949
2950
|
tokens.push(r.width);
|
|
2950
2951
|
tokens.push(r.height);
|
|
@@ -2952,13 +2953,13 @@ function encode$3 (type) {
|
|
|
2952
2953
|
reset$d();
|
|
2953
2954
|
queue(tokens);
|
|
2954
2955
|
break;
|
|
2955
|
-
case 26 /* Unload */:
|
|
2956
|
+
case 26 /* Event.Unload */:
|
|
2956
2957
|
u = data$9;
|
|
2957
2958
|
tokens.push(u.name);
|
|
2958
2959
|
reset$9();
|
|
2959
2960
|
queue(tokens);
|
|
2960
2961
|
break;
|
|
2961
|
-
case 27 /* Input */:
|
|
2962
|
+
case 27 /* Event.Input */:
|
|
2962
2963
|
for (_f = 0, _g = state$5; _f < _g.length; _f++) {
|
|
2963
2964
|
entry = _g[_f];
|
|
2964
2965
|
iTarget = metadata$2(entry.data.target, entry.event, entry.data.value);
|
|
@@ -2969,7 +2970,7 @@ function encode$3 (type) {
|
|
|
2969
2970
|
}
|
|
2970
2971
|
reset$f();
|
|
2971
2972
|
break;
|
|
2972
|
-
case 21 /* Selection */:
|
|
2973
|
+
case 21 /* Event.Selection */:
|
|
2973
2974
|
s = data$a;
|
|
2974
2975
|
if (s) {
|
|
2975
2976
|
startTarget = metadata$2(s.start, type);
|
|
@@ -2982,7 +2983,7 @@ function encode$3 (type) {
|
|
|
2982
2983
|
queue(tokens);
|
|
2983
2984
|
}
|
|
2984
2985
|
break;
|
|
2985
|
-
case 10 /* Scroll */:
|
|
2986
|
+
case 10 /* Event.Scroll */:
|
|
2986
2987
|
for (_h = 0, _j = state$3; _h < _j.length; _h++) {
|
|
2987
2988
|
entry = _j[_h];
|
|
2988
2989
|
sTarget = metadata$2(entry.data.target, entry.event);
|
|
@@ -2997,7 +2998,7 @@ function encode$3 (type) {
|
|
|
2997
2998
|
}
|
|
2998
2999
|
reset$c();
|
|
2999
3000
|
break;
|
|
3000
|
-
case 39 /* Submit */:
|
|
3001
|
+
case 39 /* Event.Submit */:
|
|
3001
3002
|
for (_k = 0, _l = state$2; _k < _l.length; _k++) {
|
|
3002
3003
|
entry = _l[_k];
|
|
3003
3004
|
tokens = [entry.time, entry.event];
|
|
@@ -3009,7 +3010,7 @@ function encode$3 (type) {
|
|
|
3009
3010
|
}
|
|
3010
3011
|
reset$a();
|
|
3011
3012
|
break;
|
|
3012
|
-
case 22 /* Timeline */:
|
|
3013
|
+
case 22 /* Event.Timeline */:
|
|
3013
3014
|
for (_m = 0, _o = updates$1; _m < _o.length; _m++) {
|
|
3014
3015
|
entry = _o[_m];
|
|
3015
3016
|
tokens = [entry.time, entry.event];
|
|
@@ -3023,7 +3024,7 @@ function encode$3 (type) {
|
|
|
3023
3024
|
}
|
|
3024
3025
|
reset$5();
|
|
3025
3026
|
break;
|
|
3026
|
-
case 28 /* Visibility */:
|
|
3027
|
+
case 28 /* Event.Visibility */:
|
|
3027
3028
|
v = data$8;
|
|
3028
3029
|
tokens.push(v.visible);
|
|
3029
3030
|
queue(tokens);
|
|
@@ -3046,11 +3047,11 @@ function reset$5() {
|
|
|
3046
3047
|
updates$1 = [];
|
|
3047
3048
|
}
|
|
3048
3049
|
function track$2(time, event, hash, x, y, reaction, context) {
|
|
3049
|
-
if (reaction === void 0) { reaction = 1 /* True */; }
|
|
3050
|
-
if (context === void 0) { context = 0 /* Self */; }
|
|
3050
|
+
if (reaction === void 0) { reaction = 1 /* BooleanFlag.True */; }
|
|
3051
|
+
if (context === void 0) { context = 0 /* BrowsingContext.Self */; }
|
|
3051
3052
|
state.push({
|
|
3052
3053
|
time: time,
|
|
3053
|
-
event: 22 /* Timeline */,
|
|
3054
|
+
event: 22 /* Event.Timeline */,
|
|
3054
3055
|
data: {
|
|
3055
3056
|
type: event,
|
|
3056
3057
|
hash: hash,
|
|
@@ -3069,7 +3070,7 @@ function compute$5() {
|
|
|
3069
3070
|
var temp = [];
|
|
3070
3071
|
updates$1 = [];
|
|
3071
3072
|
var max = data$1.start + data$1.duration;
|
|
3072
|
-
var min = Math.max(max - 2000 /* TimelineSpan */, 0);
|
|
3073
|
+
var min = Math.max(max - 2000 /* Setting.TimelineSpan */, 0);
|
|
3073
3074
|
for (var _i = 0, state_1 = state; _i < state_1.length; _i++) {
|
|
3074
3075
|
var s = state_1[_i];
|
|
3075
3076
|
if (s.time >= min) {
|
|
@@ -3080,7 +3081,7 @@ function compute$5() {
|
|
|
3080
3081
|
}
|
|
3081
3082
|
}
|
|
3082
3083
|
state = temp; // Drop events less than the min time
|
|
3083
|
-
encode$3(22 /* Timeline */);
|
|
3084
|
+
encode$3(22 /* Event.Timeline */);
|
|
3084
3085
|
}
|
|
3085
3086
|
function stop$e() {
|
|
3086
3087
|
state = [];
|
|
@@ -3113,10 +3114,10 @@ function queue(tokens, transmit) {
|
|
|
3113
3114
|
var type = tokens.length > 1 ? tokens[1] : null;
|
|
3114
3115
|
var event_1 = JSON.stringify(tokens);
|
|
3115
3116
|
switch (type) {
|
|
3116
|
-
case 5 /* Discover */:
|
|
3117
|
+
case 5 /* Event.Discover */:
|
|
3117
3118
|
discoverBytes += event_1.length;
|
|
3118
|
-
case 37 /* Box */:
|
|
3119
|
-
case 6 /* Mutation */:
|
|
3119
|
+
case 37 /* Event.Box */:
|
|
3120
|
+
case 6 /* Event.Mutation */:
|
|
3120
3121
|
playbackBytes += event_1.length;
|
|
3121
3122
|
playback.push(event_1);
|
|
3122
3123
|
break;
|
|
@@ -3125,7 +3126,7 @@ function queue(tokens, transmit) {
|
|
|
3125
3126
|
break;
|
|
3126
3127
|
}
|
|
3127
3128
|
// Increment event count metric
|
|
3128
|
-
count$1(25 /* EventCount */);
|
|
3129
|
+
count$1(25 /* Metric.EventCount */);
|
|
3129
3130
|
// Following two checks are precautionary and act as a fail safe mechanism to get out of unexpected situations.
|
|
3130
3131
|
// Check 1: If for any reason the upload hasn't happened after waiting for 2x the config.delay time,
|
|
3131
3132
|
// reset the timer. This allows Clarity to attempt an upload again.
|
|
@@ -3138,7 +3139,7 @@ function queue(tokens, transmit) {
|
|
|
3138
3139
|
// However, in certain scenarios - like metric calculation - which are triggered as part of an existing upload
|
|
3139
3140
|
// We enrich the data going out with the existing upload. In these cases, call to upload comes with 'transmit' set to false.
|
|
3140
3141
|
if (transmit && timeout === null) {
|
|
3141
|
-
if (type !== 25 /* Ping */) {
|
|
3142
|
+
if (type !== 25 /* Event.Ping */) {
|
|
3142
3143
|
reset$m();
|
|
3143
3144
|
}
|
|
3144
3145
|
timeout = setTimeout(upload, gap);
|
|
@@ -3167,9 +3168,9 @@ function upload(final) {
|
|
|
3167
3168
|
switch (_b.label) {
|
|
3168
3169
|
case 0:
|
|
3169
3170
|
timeout = null;
|
|
3170
|
-
sendPlaybackBytes = config$1.lean === false && playbackBytes > 0 && (playbackBytes < 1048576 /* MaxFirstPayloadBytes */ || data$1.sequence > 0);
|
|
3171
|
+
sendPlaybackBytes = config$1.lean === false && playbackBytes > 0 && (playbackBytes < 1048576 /* Setting.MaxFirstPayloadBytes */ || data$1.sequence > 0);
|
|
3171
3172
|
if (sendPlaybackBytes) {
|
|
3172
|
-
max(1 /* Playback */, 1 /* True */);
|
|
3173
|
+
max(1 /* Metric.Playback */, 1 /* BooleanFlag.True */);
|
|
3173
3174
|
}
|
|
3174
3175
|
// CAUTION: Ensure "transmit" is set to false in the queue function for following events
|
|
3175
3176
|
// Otherwise you run a risk of infinite loop.
|
|
@@ -3178,8 +3179,8 @@ function upload(final) {
|
|
|
3178
3179
|
compute$8();
|
|
3179
3180
|
last = final === true;
|
|
3180
3181
|
e = JSON.stringify(envelope(last));
|
|
3181
|
-
a = "["
|
|
3182
|
-
p = sendPlaybackBytes ? "["
|
|
3182
|
+
a = "[".concat(analysis.join(), "]");
|
|
3183
|
+
p = sendPlaybackBytes ? "[".concat(playback.join(), "]") : "" /* Constant.Empty */;
|
|
3183
3184
|
encoded = { e: e, a: a, p: p };
|
|
3184
3185
|
payload = stringify(encoded);
|
|
3185
3186
|
if (!last) return [3 /*break*/, 1];
|
|
@@ -3191,7 +3192,7 @@ function upload(final) {
|
|
|
3191
3192
|
_b.label = 3;
|
|
3192
3193
|
case 3:
|
|
3193
3194
|
zipped = _a;
|
|
3194
|
-
sum(2 /* TotalBytes */, zipped ? zipped.length : payload.length);
|
|
3195
|
+
sum(2 /* Metric.TotalBytes */, zipped ? zipped.length : payload.length);
|
|
3195
3196
|
send(payload, zipped, data$1.sequence, last);
|
|
3196
3197
|
// Clear out events now that payload has been dispatched
|
|
3197
3198
|
analysis = [];
|
|
@@ -3206,12 +3207,12 @@ function upload(final) {
|
|
|
3206
3207
|
});
|
|
3207
3208
|
}
|
|
3208
3209
|
function stringify(encoded) {
|
|
3209
|
-
return encoded.p.length > 0 ? "{\"e\":"
|
|
3210
|
+
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, "}");
|
|
3210
3211
|
}
|
|
3211
3212
|
function send(payload, zipped, sequence, beacon) {
|
|
3212
3213
|
if (beacon === void 0) { beacon = false; }
|
|
3213
3214
|
// Upload data if a valid URL is defined in the config
|
|
3214
|
-
if (typeof config$1.upload === "string" /* String */) {
|
|
3215
|
+
if (typeof config$1.upload === "string" /* Constant.String */) {
|
|
3215
3216
|
var url = config$1.upload;
|
|
3216
3217
|
var dispatched = false;
|
|
3217
3218
|
// If it's the last payload, attempt to upload using sendBeacon first.
|
|
@@ -3250,7 +3251,7 @@ function send(payload, zipped, sequence, beacon) {
|
|
|
3250
3251
|
xhr_1.withCredentials = true;
|
|
3251
3252
|
if (zipped) {
|
|
3252
3253
|
// If we do have valid compressed array, send it with appropriate HTTP headers so server can decode it appropriately
|
|
3253
|
-
xhr_1.setRequestHeader("Accept" /* Accept */, "application/x-clarity-gzip" /* ClarityGzip */);
|
|
3254
|
+
xhr_1.setRequestHeader("Accept" /* Constant.Accept */, "application/x-clarity-gzip" /* Constant.ClarityGzip */);
|
|
3254
3255
|
xhr_1.send(zipped);
|
|
3255
3256
|
}
|
|
3256
3257
|
else {
|
|
@@ -3267,13 +3268,13 @@ function send(payload, zipped, sequence, beacon) {
|
|
|
3267
3268
|
}
|
|
3268
3269
|
function check$3(xhr, sequence) {
|
|
3269
3270
|
var transitData = transit[sequence];
|
|
3270
|
-
if (xhr && xhr.readyState === 4 /* Done */ && transitData) {
|
|
3271
|
+
if (xhr && xhr.readyState === 4 /* XMLReadyState.Done */ && transitData) {
|
|
3271
3272
|
// Attempt send payload again (as configured in settings) if we do not receive a success (2XX) response code back from the server
|
|
3272
|
-
if ((xhr.status < 200 || xhr.status > 208) && transitData.attempts <= 1 /* RetryLimit */) {
|
|
3273
|
+
if ((xhr.status < 200 || xhr.status > 208) && transitData.attempts <= 1 /* Setting.RetryLimit */) {
|
|
3273
3274
|
// We re-attempt in all cases except when server explicitly rejects our request with 4XX error
|
|
3274
3275
|
if (xhr.status >= 400 && xhr.status < 500) {
|
|
3275
3276
|
// In case of a 4XX response from the server, we bail out instead of trying again
|
|
3276
|
-
trigger(6 /* Server */);
|
|
3277
|
+
trigger(6 /* Check.Server */);
|
|
3277
3278
|
}
|
|
3278
3279
|
else {
|
|
3279
3280
|
// Browser will send status = 0 when it refuses to put network request over the wire
|
|
@@ -3294,7 +3295,7 @@ function check$3(xhr, sequence) {
|
|
|
3294
3295
|
track$1 = { sequence: sequence, attempts: transitData.attempts, status: xhr.status };
|
|
3295
3296
|
// Send back an event only if we were not successful in our first attempt
|
|
3296
3297
|
if (transitData.attempts > 1) {
|
|
3297
|
-
encode$1(2 /* Upload */);
|
|
3298
|
+
encode$1(2 /* Event.Upload */);
|
|
3298
3299
|
}
|
|
3299
3300
|
// Handle response if it was a 200 response with a valid body
|
|
3300
3301
|
if (xhr.status === 200 && xhr.responseText) {
|
|
@@ -3305,7 +3306,7 @@ function check$3(xhr, sequence) {
|
|
|
3305
3306
|
// And, right before we terminate the session, we will attempt one last time to see if we can use
|
|
3306
3307
|
// different transport option (sendBeacon vs. XHR) to get this data to the server for analysis purposes
|
|
3307
3308
|
send(transitData.data, null, sequence, true);
|
|
3308
|
-
trigger(3 /* Retry */);
|
|
3309
|
+
trigger(3 /* Check.Retry */);
|
|
3309
3310
|
}
|
|
3310
3311
|
// Signal that this request completed successfully
|
|
3311
3312
|
if (xhr.status >= 200 && xhr.status <= 208) {
|
|
@@ -3325,19 +3326,19 @@ function done(sequence) {
|
|
|
3325
3326
|
function delay() {
|
|
3326
3327
|
// Progressively increase delay as we continue to send more payloads from the client to the server
|
|
3327
3328
|
// If we are not uploading data to a server, and instead invoking UploadCallback, in that case keep returning configured value
|
|
3328
|
-
var gap = config$1.lean === false && discoverBytes > 0 ? 100 /* MinUploadDelay */ : data$1.sequence * config$1.delay;
|
|
3329
|
-
return typeof config$1.upload === "string" /* String */ ? Math.max(Math.min(gap, 30000 /* MaxUploadDelay */), 100 /* MinUploadDelay */) : config$1.delay;
|
|
3329
|
+
var gap = config$1.lean === false && discoverBytes > 0 ? 100 /* Setting.MinUploadDelay */ : data$1.sequence * config$1.delay;
|
|
3330
|
+
return typeof config$1.upload === "string" /* Constant.String */ ? Math.max(Math.min(gap, 30000 /* Setting.MaxUploadDelay */), 100 /* Setting.MinUploadDelay */) : config$1.delay;
|
|
3330
3331
|
}
|
|
3331
3332
|
function response(payload) {
|
|
3332
|
-
var key = payload && payload.length > 0 ? payload.split(" ")[0] : "" /* Empty */;
|
|
3333
|
+
var key = payload && payload.length > 0 ? payload.split(" ")[0] : "" /* Constant.Empty */;
|
|
3333
3334
|
switch (key) {
|
|
3334
|
-
case "END" /* End */:
|
|
3335
|
+
case "END" /* Constant.End */:
|
|
3335
3336
|
// Clear out session storage and end the session so we can start fresh the next time
|
|
3336
|
-
trigger(6 /* Server */);
|
|
3337
|
+
trigger(6 /* Check.Server */);
|
|
3337
3338
|
break;
|
|
3338
|
-
case "UPGRADE" /* Upgrade */:
|
|
3339
|
+
case "UPGRADE" /* Constant.Upgrade */:
|
|
3339
3340
|
// Upgrade current session to send back playback information
|
|
3340
|
-
upgrade("Auto" /* Auto */);
|
|
3341
|
+
upgrade("Auto" /* Constant.Auto */);
|
|
3341
3342
|
break;
|
|
3342
3343
|
}
|
|
3343
3344
|
}
|
|
@@ -3355,7 +3356,7 @@ function handler(error) {
|
|
|
3355
3356
|
if (!(e.message in history$3)) {
|
|
3356
3357
|
history$3[e.message] = 0;
|
|
3357
3358
|
}
|
|
3358
|
-
if (history$3[e.message]++ >= 5 /* ScriptErrorLimit */) {
|
|
3359
|
+
if (history$3[e.message]++ >= 5 /* Setting.ScriptErrorLimit */) {
|
|
3359
3360
|
return true;
|
|
3360
3361
|
}
|
|
3361
3362
|
// Send back information only if the handled error has valid information
|
|
@@ -3367,7 +3368,7 @@ function handler(error) {
|
|
|
3367
3368
|
stack: e.stack,
|
|
3368
3369
|
source: error["filename"]
|
|
3369
3370
|
};
|
|
3370
|
-
encode$2(31 /* ScriptError */);
|
|
3371
|
+
encode$2(31 /* Event.ScriptError */);
|
|
3371
3372
|
}
|
|
3372
3373
|
return true;
|
|
3373
3374
|
}
|
|
@@ -3378,7 +3379,7 @@ function encode$2 (type) {
|
|
|
3378
3379
|
return __generator(this, function (_a) {
|
|
3379
3380
|
tokens = [time(), type];
|
|
3380
3381
|
switch (type) {
|
|
3381
|
-
case 31 /* ScriptError */:
|
|
3382
|
+
case 31 /* Event.ScriptError */:
|
|
3382
3383
|
tokens.push(data$7.message);
|
|
3383
3384
|
tokens.push(data$7.line);
|
|
3384
3385
|
tokens.push(data$7.column);
|
|
@@ -3386,7 +3387,7 @@ function encode$2 (type) {
|
|
|
3386
3387
|
tokens.push(data$7.source);
|
|
3387
3388
|
queue(tokens);
|
|
3388
3389
|
break;
|
|
3389
|
-
case 33 /* Log */:
|
|
3390
|
+
case 33 /* Event.Log */:
|
|
3390
3391
|
if (data$6) {
|
|
3391
3392
|
tokens.push(data$6.code);
|
|
3392
3393
|
tokens.push(data$6.name);
|
|
@@ -3396,7 +3397,7 @@ function encode$2 (type) {
|
|
|
3396
3397
|
queue(tokens, false);
|
|
3397
3398
|
}
|
|
3398
3399
|
break;
|
|
3399
|
-
case 41 /* Fraud */:
|
|
3400
|
+
case 41 /* Event.Fraud */:
|
|
3400
3401
|
if (data$d) {
|
|
3401
3402
|
tokens.push(data$d.id);
|
|
3402
3403
|
tokens.push(data$d.target);
|
|
@@ -3419,7 +3420,7 @@ function log$1(code, severity, name, message, stack) {
|
|
|
3419
3420
|
if (name === void 0) { name = null; }
|
|
3420
3421
|
if (message === void 0) { message = null; }
|
|
3421
3422
|
if (stack === void 0) { stack = null; }
|
|
3422
|
-
var key = name ? name
|
|
3423
|
+
var key = name ? "".concat(name, "|").concat(message) : "";
|
|
3423
3424
|
// While rare, it's possible for code to fail repeatedly during the lifetime of the same page
|
|
3424
3425
|
// In those cases, we only want to log the failure once and not spam logs with redundant information.
|
|
3425
3426
|
if (code in history$2 && history$2[code].indexOf(key) >= 0) {
|
|
@@ -3433,7 +3434,7 @@ function log$1(code, severity, name, message, stack) {
|
|
|
3433
3434
|
else {
|
|
3434
3435
|
history$2[code] = [key];
|
|
3435
3436
|
}
|
|
3436
|
-
encode$2(33 /* Log */);
|
|
3437
|
+
encode$2(33 /* Event.Log */);
|
|
3437
3438
|
}
|
|
3438
3439
|
function stop$c() {
|
|
3439
3440
|
history$2 = {};
|
|
@@ -3454,25 +3455,25 @@ function start$c() {
|
|
|
3454
3455
|
var source = e[i];
|
|
3455
3456
|
var key = e[i + 1];
|
|
3456
3457
|
switch (source) {
|
|
3457
|
-
case 0 /* Javascript */:
|
|
3458
|
+
case 0 /* ExtractSource.Javascript */:
|
|
3458
3459
|
var variable = e[i + 2];
|
|
3459
3460
|
variables[key] = parse(variable);
|
|
3460
3461
|
break;
|
|
3461
|
-
case 1 /* Cookie */:
|
|
3462
|
+
case 1 /* ExtractSource.Cookie */:
|
|
3462
3463
|
/*Todo: Add cookie extract logic*/
|
|
3463
3464
|
break;
|
|
3464
|
-
case 2 /* Text */:
|
|
3465
|
+
case 2 /* ExtractSource.Text */:
|
|
3465
3466
|
var match_1 = e[i + 2];
|
|
3466
3467
|
selectors[key] = match_1;
|
|
3467
3468
|
break;
|
|
3468
|
-
case 3 /* Fragment */:
|
|
3469
|
+
case 3 /* ExtractSource.Fragment */:
|
|
3469
3470
|
fragments = e[i + 2];
|
|
3470
3471
|
break;
|
|
3471
3472
|
}
|
|
3472
3473
|
}
|
|
3473
3474
|
}
|
|
3474
3475
|
catch (e) {
|
|
3475
|
-
log$1(8 /* Config */, 1 /* Warning */, e ? e.name : null);
|
|
3476
|
+
log$1(8 /* Code.Config */, 1 /* Severity.Warning */, e ? e.name : null);
|
|
3476
3477
|
}
|
|
3477
3478
|
}
|
|
3478
3479
|
function clone(v) {
|
|
@@ -3494,9 +3495,9 @@ function compute$4() {
|
|
|
3494
3495
|
}
|
|
3495
3496
|
}
|
|
3496
3497
|
catch (e) {
|
|
3497
|
-
log$1(5 /* Selector */, 1 /* Warning */, e ? e.name : null);
|
|
3498
|
+
log$1(5 /* Code.Selector */, 1 /* Severity.Warning */, e ? e.name : null);
|
|
3498
3499
|
}
|
|
3499
|
-
encode$1(40 /* Extract */);
|
|
3500
|
+
encode$1(40 /* Event.Extract */);
|
|
3500
3501
|
}
|
|
3501
3502
|
function reset$4() {
|
|
3502
3503
|
keys = [];
|
|
@@ -3516,15 +3517,15 @@ function stop$b() {
|
|
|
3516
3517
|
}
|
|
3517
3518
|
function parse(variable) {
|
|
3518
3519
|
var syntax = [];
|
|
3519
|
-
var parts = variable.split("." /* Dot */);
|
|
3520
|
+
var parts = variable.split("." /* Constant.Dot */);
|
|
3520
3521
|
while (parts.length > 0) {
|
|
3521
3522
|
var part = parts.shift();
|
|
3522
|
-
var arrayStart = part.indexOf("[" /* ArrayStart */);
|
|
3523
|
-
var conditionStart = part.indexOf("{" /* ConditionStart */);
|
|
3524
|
-
var conditionEnd = part.indexOf("}" /* ConditionEnd */);
|
|
3523
|
+
var arrayStart = part.indexOf("[" /* Constant.ArrayStart */);
|
|
3524
|
+
var conditionStart = part.indexOf("{" /* Constant.ConditionStart */);
|
|
3525
|
+
var conditionEnd = part.indexOf("}" /* Constant.ConditionEnd */);
|
|
3525
3526
|
syntax.push({
|
|
3526
3527
|
name: arrayStart > 0 ? part.substring(0, arrayStart) : (conditionStart > 0 ? part.substring(0, conditionStart) : part),
|
|
3527
|
-
type: arrayStart > 0 ? 1 /* Array */ : (conditionStart > 0 ? 2 /* Object */ : 3 /* Simple */),
|
|
3528
|
+
type: arrayStart > 0 ? 1 /* Type.Array */ : (conditionStart > 0 ? 2 /* Type.Object */ : 3 /* Type.Simple */),
|
|
3528
3529
|
condition: conditionStart > 0 ? part.substring(conditionStart + 1, conditionEnd) : null
|
|
3529
3530
|
});
|
|
3530
3531
|
}
|
|
@@ -3542,7 +3543,7 @@ function evaluate(variable, base) {
|
|
|
3542
3543
|
var output;
|
|
3543
3544
|
if (base && base[part.name]) {
|
|
3544
3545
|
var obj = base[part.name];
|
|
3545
|
-
if (part.type !== 1 /* Array */ && match(obj, part.condition)) {
|
|
3546
|
+
if (part.type !== 1 /* Type.Array */ && match(obj, part.condition)) {
|
|
3546
3547
|
output = evaluate(variable, obj);
|
|
3547
3548
|
}
|
|
3548
3549
|
else if (Array.isArray(obj)) {
|
|
@@ -3564,7 +3565,7 @@ function evaluate(variable, base) {
|
|
|
3564
3565
|
}
|
|
3565
3566
|
function str(input) {
|
|
3566
3567
|
// Automatically trim string to max of Setting.ExtractLimit to avoid fetching long strings
|
|
3567
|
-
return input ? JSON.stringify(input).substring(0, 10000 /* ExtractLimit */) : input;
|
|
3568
|
+
return input ? JSON.stringify(input).substring(0, 10000 /* Setting.ExtractLimit */) : input;
|
|
3568
3569
|
}
|
|
3569
3570
|
function match(base, condition) {
|
|
3570
3571
|
if (condition) {
|
|
@@ -3578,7 +3579,7 @@ function encode$1 (event) {
|
|
|
3578
3579
|
var t = time();
|
|
3579
3580
|
var tokens = [t, event];
|
|
3580
3581
|
switch (event) {
|
|
3581
|
-
case 4 /* Baseline */:
|
|
3582
|
+
case 4 /* Event.Baseline */:
|
|
3582
3583
|
var b = state$9;
|
|
3583
3584
|
if (b) {
|
|
3584
3585
|
tokens = [b.time, b.event];
|
|
@@ -3596,30 +3597,30 @@ function encode$1 (event) {
|
|
|
3596
3597
|
}
|
|
3597
3598
|
reset$o();
|
|
3598
3599
|
break;
|
|
3599
|
-
case 25 /* Ping */:
|
|
3600
|
+
case 25 /* Event.Ping */:
|
|
3600
3601
|
tokens.push(data$h.gap);
|
|
3601
3602
|
queue(tokens);
|
|
3602
3603
|
break;
|
|
3603
|
-
case 35 /* Limit */:
|
|
3604
|
+
case 35 /* Event.Limit */:
|
|
3604
3605
|
tokens.push(data$4.check);
|
|
3605
3606
|
queue(tokens, false);
|
|
3606
3607
|
break;
|
|
3607
|
-
case 3 /* Upgrade */:
|
|
3608
|
+
case 3 /* Event.Upgrade */:
|
|
3608
3609
|
tokens.push(data$f.key);
|
|
3609
3610
|
queue(tokens);
|
|
3610
3611
|
break;
|
|
3611
|
-
case 2 /* Upload */:
|
|
3612
|
+
case 2 /* Event.Upload */:
|
|
3612
3613
|
tokens.push(track$1.sequence);
|
|
3613
3614
|
tokens.push(track$1.attempts);
|
|
3614
3615
|
tokens.push(track$1.status);
|
|
3615
3616
|
queue(tokens, false);
|
|
3616
3617
|
break;
|
|
3617
|
-
case 24 /* Custom */:
|
|
3618
|
+
case 24 /* Event.Custom */:
|
|
3618
3619
|
tokens.push(data$j.key);
|
|
3619
3620
|
tokens.push(data$j.value);
|
|
3620
3621
|
queue(tokens);
|
|
3621
3622
|
break;
|
|
3622
|
-
case 34 /* Variable */:
|
|
3623
|
+
case 34 /* Event.Variable */:
|
|
3623
3624
|
var variableKeys = Object.keys(data$e);
|
|
3624
3625
|
if (variableKeys.length > 0) {
|
|
3625
3626
|
for (var _i = 0, variableKeys_1 = variableKeys; _i < variableKeys_1.length; _i++) {
|
|
@@ -3631,7 +3632,7 @@ function encode$1 (event) {
|
|
|
3631
3632
|
queue(tokens, false);
|
|
3632
3633
|
}
|
|
3633
3634
|
break;
|
|
3634
|
-
case 0 /* Metric */:
|
|
3635
|
+
case 0 /* Event.Metric */:
|
|
3635
3636
|
var metricKeys = Object.keys(updates$3);
|
|
3636
3637
|
if (metricKeys.length > 0) {
|
|
3637
3638
|
for (var _a = 0, metricKeys_1 = metricKeys; _a < metricKeys_1.length; _a++) {
|
|
@@ -3646,7 +3647,7 @@ function encode$1 (event) {
|
|
|
3646
3647
|
queue(tokens, false);
|
|
3647
3648
|
}
|
|
3648
3649
|
break;
|
|
3649
|
-
case 1 /* Dimension */:
|
|
3650
|
+
case 1 /* Event.Dimension */:
|
|
3650
3651
|
var dimensionKeys = Object.keys(updates);
|
|
3651
3652
|
if (dimensionKeys.length > 0) {
|
|
3652
3653
|
for (var _b = 0, dimensionKeys_1 = dimensionKeys; _b < dimensionKeys_1.length; _b++) {
|
|
@@ -3659,7 +3660,7 @@ function encode$1 (event) {
|
|
|
3659
3660
|
queue(tokens, false);
|
|
3660
3661
|
}
|
|
3661
3662
|
break;
|
|
3662
|
-
case 36 /* Summary */:
|
|
3663
|
+
case 36 /* Event.Summary */:
|
|
3663
3664
|
var eventKeys = Object.keys(data$g);
|
|
3664
3665
|
if (eventKeys.length > 0) {
|
|
3665
3666
|
for (var _c = 0, eventKeys_1 = eventKeys; _c < eventKeys_1.length; _c++) {
|
|
@@ -3672,7 +3673,7 @@ function encode$1 (event) {
|
|
|
3672
3673
|
queue(tokens, false);
|
|
3673
3674
|
}
|
|
3674
3675
|
break;
|
|
3675
|
-
case 40 /* Extract */:
|
|
3676
|
+
case 40 /* Event.Extract */:
|
|
3676
3677
|
var extractKeys = keys;
|
|
3677
3678
|
for (var _d = 0, extractKeys_1 = extractKeys; _d < extractKeys_1.length; _d++) {
|
|
3678
3679
|
var e = extractKeys_1[_d];
|
|
@@ -3686,14 +3687,14 @@ function encode$1 (event) {
|
|
|
3686
3687
|
|
|
3687
3688
|
var data$4;
|
|
3688
3689
|
function start$b() {
|
|
3689
|
-
data$4 = { check: 0 /* None */ };
|
|
3690
|
+
data$4 = { check: 0 /* Check.None */ };
|
|
3690
3691
|
}
|
|
3691
3692
|
function check$2(bytes) {
|
|
3692
|
-
if (data$4.check === 0 /* None */) {
|
|
3693
|
+
if (data$4.check === 0 /* Check.None */) {
|
|
3693
3694
|
var reason = data$4.check;
|
|
3694
|
-
reason = data$1.sequence >= 128 /* PayloadLimit */ ? 1 /* Payload */ : reason;
|
|
3695
|
-
reason = time() > 7200000 /* ShutdownLimit */ ? 2 /* Shutdown */ : reason;
|
|
3696
|
-
reason = bytes > 10485760 /* PlaybackBytesLimit */ ? 2 /* Shutdown */ : reason;
|
|
3695
|
+
reason = data$1.sequence >= 128 /* Setting.PayloadLimit */ ? 1 /* Check.Payload */ : reason;
|
|
3696
|
+
reason = time() > 7200000 /* Setting.ShutdownLimit */ ? 2 /* Check.Shutdown */ : reason;
|
|
3697
|
+
reason = bytes > 10485760 /* Setting.PlaybackBytesLimit */ ? 2 /* Check.Shutdown */ : reason;
|
|
3697
3698
|
if (reason !== data$4.check) {
|
|
3698
3699
|
trigger(reason);
|
|
3699
3700
|
}
|
|
@@ -3705,8 +3706,8 @@ function trigger(reason) {
|
|
|
3705
3706
|
stop();
|
|
3706
3707
|
}
|
|
3707
3708
|
function compute$3() {
|
|
3708
|
-
if (data$4.check !== 0 /* None */) {
|
|
3709
|
-
encode$1(35 /* Limit */);
|
|
3709
|
+
if (data$4.check !== 0 /* Check.None */) {
|
|
3710
|
+
encode$1(35 /* Event.Limit */);
|
|
3710
3711
|
}
|
|
3711
3712
|
}
|
|
3712
3713
|
function stop$a() {
|
|
@@ -3727,7 +3728,7 @@ function log(dimension, value) {
|
|
|
3727
3728
|
// Check valid value before moving ahead
|
|
3728
3729
|
if (value) {
|
|
3729
3730
|
// Ensure received value is casted into a string if it wasn't a string to begin with
|
|
3730
|
-
value = ""
|
|
3731
|
+
value = "".concat(value);
|
|
3731
3732
|
if (!(dimension in data$3)) {
|
|
3732
3733
|
data$3[dimension] = [];
|
|
3733
3734
|
}
|
|
@@ -3740,14 +3741,14 @@ function log(dimension, value) {
|
|
|
3740
3741
|
}
|
|
3741
3742
|
updates[dimension].push(value);
|
|
3742
3743
|
// Limit check to ensure we have a cap on number of dimensions we can collect
|
|
3743
|
-
if (data$3[dimension].length > 128 /* CollectionLimit */) {
|
|
3744
|
-
trigger(5 /* Collection */);
|
|
3744
|
+
if (data$3[dimension].length > 128 /* Setting.CollectionLimit */) {
|
|
3745
|
+
trigger(5 /* Check.Collection */);
|
|
3745
3746
|
}
|
|
3746
3747
|
}
|
|
3747
3748
|
}
|
|
3748
3749
|
}
|
|
3749
3750
|
function compute$2() {
|
|
3750
|
-
encode$1(1 /* Dimension */);
|
|
3751
|
+
encode$1(1 /* Event.Dimension */);
|
|
3751
3752
|
}
|
|
3752
3753
|
function reset$3() {
|
|
3753
3754
|
updates = {};
|
|
@@ -3758,8 +3759,8 @@ var callbacks = [];
|
|
|
3758
3759
|
var rootDomain = null;
|
|
3759
3760
|
function start$9() {
|
|
3760
3761
|
rootDomain = null;
|
|
3761
|
-
var ua = navigator && "userAgent" in navigator ? navigator.userAgent : "" /* Empty */;
|
|
3762
|
-
var title = document && document.title ? document.title : "" /* Empty */;
|
|
3762
|
+
var ua = navigator && "userAgent" in navigator ? navigator.userAgent : "" /* Constant.Empty */;
|
|
3763
|
+
var title = document && document.title ? document.title : "" /* Constant.Empty */;
|
|
3763
3764
|
// Populate ids for this page
|
|
3764
3765
|
var s = session();
|
|
3765
3766
|
var u = user();
|
|
@@ -3770,27 +3771,27 @@ function start$9() {
|
|
|
3770
3771
|
pageNum: s.count
|
|
3771
3772
|
};
|
|
3772
3773
|
// Override configuration based on what's in the session storage, unless it is blank (e.g. using upload callback, like in devtools)
|
|
3773
|
-
config$1.lean = config$1.track && s.upgrade !== null ? s.upgrade === 0 /* False */ : config$1.lean;
|
|
3774
|
-
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;
|
|
3774
|
+
config$1.lean = config$1.track && s.upgrade !== null ? s.upgrade === 0 /* BooleanFlag.False */ : config$1.lean;
|
|
3775
|
+
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;
|
|
3775
3776
|
// Log dimensions
|
|
3776
|
-
log(0 /* UserAgent */, ua);
|
|
3777
|
-
log(3 /* PageTitle */, title);
|
|
3778
|
-
log(1 /* Url */, location.href);
|
|
3779
|
-
log(2 /* Referrer */, document.referrer);
|
|
3780
|
-
log(15 /* TabId */, tab());
|
|
3781
|
-
log(16 /* PageLanguage */, document.documentElement.lang);
|
|
3782
|
-
log(17 /* DocumentDirection */, document.dir);
|
|
3777
|
+
log(0 /* Dimension.UserAgent */, ua);
|
|
3778
|
+
log(3 /* Dimension.PageTitle */, title);
|
|
3779
|
+
log(1 /* Dimension.Url */, location.href);
|
|
3780
|
+
log(2 /* Dimension.Referrer */, document.referrer);
|
|
3781
|
+
log(15 /* Dimension.TabId */, tab());
|
|
3782
|
+
log(16 /* Dimension.PageLanguage */, document.documentElement.lang);
|
|
3783
|
+
log(17 /* Dimension.DocumentDirection */, document.dir);
|
|
3783
3784
|
if (navigator) {
|
|
3784
|
-
log(9 /* Language */, navigator.userLanguage || navigator.language);
|
|
3785
|
+
log(9 /* Dimension.Language */, navigator.userLanguage || navigator.language);
|
|
3785
3786
|
userAgentData();
|
|
3786
3787
|
}
|
|
3787
3788
|
// Metrics
|
|
3788
|
-
max(0 /* ClientTimestamp */, s.ts);
|
|
3789
|
-
max(1 /* Playback */, 0 /* False */);
|
|
3789
|
+
max(0 /* Metric.ClientTimestamp */, s.ts);
|
|
3790
|
+
max(1 /* Metric.Playback */, 0 /* BooleanFlag.False */);
|
|
3790
3791
|
if (screen) {
|
|
3791
|
-
max(14 /* ScreenWidth */, Math.round(screen.width));
|
|
3792
|
-
max(15 /* ScreenHeight */, Math.round(screen.height));
|
|
3793
|
-
max(16 /* ColorDepth */, Math.round(screen.colorDepth));
|
|
3792
|
+
max(14 /* Metric.ScreenWidth */, Math.round(screen.width));
|
|
3793
|
+
max(15 /* Metric.ScreenHeight */, Math.round(screen.height));
|
|
3794
|
+
max(16 /* Metric.ColorDepth */, Math.round(screen.colorDepth));
|
|
3794
3795
|
}
|
|
3795
3796
|
// Read cookies specified in configuration
|
|
3796
3797
|
for (var _i = 0, _a = config$1.cookies; _i < _a.length; _i++) {
|
|
@@ -3811,13 +3812,13 @@ function userAgentData() {
|
|
|
3811
3812
|
"uaFullVersion"])
|
|
3812
3813
|
.then(function (ua) {
|
|
3813
3814
|
var _a;
|
|
3814
|
-
log(22 /* Platform */, ua.platform);
|
|
3815
|
-
log(23 /* PlatformVersion */, ua.platformVersion);
|
|
3815
|
+
log(22 /* Dimension.Platform */, ua.platform);
|
|
3816
|
+
log(23 /* Dimension.PlatformVersion */, ua.platformVersion);
|
|
3816
3817
|
(_a = ua.brands) === null || _a === void 0 ? void 0 : _a.forEach(function (brand) {
|
|
3817
|
-
log(24 /* Brand */, brand.name + "~" /* Tilde */ + brand.version);
|
|
3818
|
+
log(24 /* Dimension.Brand */, brand.name + "~" /* Constant.Tilde */ + brand.version);
|
|
3818
3819
|
});
|
|
3819
|
-
log(25 /* Model */, ua.model);
|
|
3820
|
-
max(27 /* Mobile */, ua.mobile ? 1 /* True */ : 0 /* False */);
|
|
3820
|
+
log(25 /* Dimension.Model */, ua.model);
|
|
3821
|
+
max(27 /* Metric.Mobile */, ua.mobile ? 1 /* BooleanFlag.True */ : 0 /* BooleanFlag.False */);
|
|
3821
3822
|
});
|
|
3822
3823
|
}
|
|
3823
3824
|
}
|
|
@@ -3834,33 +3835,33 @@ function metadata(cb, wait) {
|
|
|
3834
3835
|
callbacks.push({ callback: cb, wait: wait });
|
|
3835
3836
|
}
|
|
3836
3837
|
function id() {
|
|
3837
|
-
return data$2 ? [data$2.userId, data$2.sessionId, data$2.pageNum].join("." /* Dot */) : "" /* Empty */;
|
|
3838
|
+
return data$2 ? [data$2.userId, data$2.sessionId, data$2.pageNum].join("." /* Constant.Dot */) : "" /* Constant.Empty */;
|
|
3838
3839
|
}
|
|
3839
3840
|
function consent() {
|
|
3840
3841
|
if (active()) {
|
|
3841
3842
|
config$1.track = true;
|
|
3842
|
-
track(user(), 1 /* True */);
|
|
3843
|
+
track(user(), 1 /* BooleanFlag.True */);
|
|
3843
3844
|
}
|
|
3844
3845
|
}
|
|
3845
3846
|
function clear() {
|
|
3846
3847
|
// Clear any stored information in the cookie that tracks session information so we can restart fresh the next time
|
|
3847
|
-
setCookie("_clsk" /* SessionKey */, "" /* Empty */, 0);
|
|
3848
|
+
setCookie("_clsk" /* Constant.SessionKey */, "" /* Constant.Empty */, 0);
|
|
3848
3849
|
}
|
|
3849
3850
|
function tab() {
|
|
3850
3851
|
var id = shortid();
|
|
3851
|
-
if (config$1.track && supported(window, "sessionStorage" /* SessionStorage */)) {
|
|
3852
|
-
var value = sessionStorage.getItem("_cltk" /* TabKey */);
|
|
3852
|
+
if (config$1.track && supported(window, "sessionStorage" /* Constant.SessionStorage */)) {
|
|
3853
|
+
var value = sessionStorage.getItem("_cltk" /* Constant.TabKey */);
|
|
3853
3854
|
id = value ? value : id;
|
|
3854
|
-
sessionStorage.setItem("_cltk" /* TabKey */, id);
|
|
3855
|
+
sessionStorage.setItem("_cltk" /* Constant.TabKey */, id);
|
|
3855
3856
|
}
|
|
3856
3857
|
return id;
|
|
3857
3858
|
}
|
|
3858
3859
|
function save() {
|
|
3859
3860
|
var ts = Math.round(Date.now());
|
|
3860
|
-
var upload = config$1.upload && typeof config$1.upload === "string" /* String */ ? config$1.upload.replace("https://" /* HTTPS */, "" /* Empty */) : "" /* Empty */;
|
|
3861
|
-
var upgrade = config$1.lean ? 0 /* False */ : 1 /* True */;
|
|
3861
|
+
var upload = config$1.upload && typeof config$1.upload === "string" /* Constant.String */ ? config$1.upload.replace("https://" /* Constant.HTTPS */, "" /* Constant.Empty */) : "" /* Constant.Empty */;
|
|
3862
|
+
var upgrade = config$1.lean ? 0 /* BooleanFlag.False */ : 1 /* BooleanFlag.True */;
|
|
3862
3863
|
processCallback(upgrade);
|
|
3863
|
-
setCookie("_clsk" /* SessionKey */, [data$2.sessionId, ts, data$2.pageNum, upgrade, upload].join("|" /* Pipe */), 1 /* SessionExpire */);
|
|
3864
|
+
setCookie("_clsk" /* Constant.SessionKey */, [data$2.sessionId, ts, data$2.pageNum, upgrade, upload].join("|" /* Constant.Pipe */), 1 /* Setting.SessionExpire */);
|
|
3864
3865
|
}
|
|
3865
3866
|
function processCallback(upgrade) {
|
|
3866
3867
|
if (callbacks.length > 0) {
|
|
@@ -3885,10 +3886,10 @@ function track(u, consent) {
|
|
|
3885
3886
|
consent = consent === null ? u.consent : consent;
|
|
3886
3887
|
// Convert time precision into days to reduce number of bytes we have to write in a cookie
|
|
3887
3888
|
// E.g. Math.ceil(1628735962643 / (24*60*60*1000)) => 18852 (days) => ejo in base36 (13 bytes => 3 bytes)
|
|
3888
|
-
var end = Math.ceil((Date.now() + (365 /* Expire */ * 86400000 /* Day */)) / 86400000 /* Day */);
|
|
3889
|
+
var end = Math.ceil((Date.now() + (365 /* Setting.Expire */ * 86400000 /* Time.Day */)) / 86400000 /* Time.Day */);
|
|
3889
3890
|
// To avoid cookie churn, write user id cookie only once every day
|
|
3890
|
-
if (u.expiry === null || Math.abs(end - u.expiry) >= 1 /* CookieInterval */ || u.consent !== consent) {
|
|
3891
|
-
setCookie("_clck" /* CookieKey */, [data$2.userId, 1 /* CookieVersion */, end.toString(36), consent].join("|" /* Pipe */), 365 /* Expire */);
|
|
3891
|
+
if (u.expiry === null || Math.abs(end - u.expiry) >= 1 /* Setting.CookieInterval */ || u.consent !== consent) {
|
|
3892
|
+
setCookie("_clck" /* Constant.CookieKey */, [data$2.userId, 1 /* Setting.CookieVersion */, end.toString(36), consent].join("|" /* Constant.Pipe */), 365 /* Setting.Expire */);
|
|
3892
3893
|
}
|
|
3893
3894
|
}
|
|
3894
3895
|
function shortid() {
|
|
@@ -3899,17 +3900,17 @@ function shortid() {
|
|
|
3899
3900
|
return id.toString(36);
|
|
3900
3901
|
}
|
|
3901
3902
|
function session() {
|
|
3902
|
-
var output = { session: shortid(), ts: Math.round(Date.now()), count: 1, upgrade: null, upload: "" /* Empty */ };
|
|
3903
|
-
var value = getCookie("_clsk" /* SessionKey */);
|
|
3903
|
+
var output = { session: shortid(), ts: Math.round(Date.now()), count: 1, upgrade: null, upload: "" /* Constant.Empty */ };
|
|
3904
|
+
var value = getCookie("_clsk" /* Constant.SessionKey */);
|
|
3904
3905
|
if (value) {
|
|
3905
|
-
var parts = value.split("|" /* Pipe */);
|
|
3906
|
+
var parts = value.split("|" /* Constant.Pipe */);
|
|
3906
3907
|
// Making it backward & forward compatible by using greater than comparison (v0.6.21)
|
|
3907
3908
|
// In future version, we can reduce the parts length to be 5 where the last part contains the full upload URL
|
|
3908
|
-
if (parts.length >= 5 && output.ts - num(parts[1]) < 1800000 /* SessionTimeout */) {
|
|
3909
|
+
if (parts.length >= 5 && output.ts - num(parts[1]) < 1800000 /* Setting.SessionTimeout */) {
|
|
3909
3910
|
output.session = parts[0];
|
|
3910
3911
|
output.count = num(parts[2]) + 1;
|
|
3911
3912
|
output.upgrade = num(parts[3]);
|
|
3912
|
-
output.upload = parts.length >= 6 ? ""
|
|
3913
|
+
output.upload = parts.length >= 6 ? "".concat("https://" /* Constant.HTTPS */).concat(parts[5], "/").concat(parts[4]) : "".concat("https://" /* Constant.HTTPS */).concat(parts[4]);
|
|
3913
3914
|
}
|
|
3914
3915
|
}
|
|
3915
3916
|
return output;
|
|
@@ -3919,26 +3920,26 @@ function num(string, base) {
|
|
|
3919
3920
|
return parseInt(string, base);
|
|
3920
3921
|
}
|
|
3921
3922
|
function user() {
|
|
3922
|
-
var output = { id: shortid(), expiry: null, consent: 0 /* False */ };
|
|
3923
|
-
var cookie = getCookie("_clck" /* CookieKey */);
|
|
3923
|
+
var output = { id: shortid(), expiry: null, consent: 0 /* BooleanFlag.False */ };
|
|
3924
|
+
var cookie = getCookie("_clck" /* Constant.CookieKey */);
|
|
3924
3925
|
if (cookie && cookie.length > 0) {
|
|
3925
3926
|
// Splitting and looking up first part for forward compatibility, in case we wish to store additional information in a cookie
|
|
3926
|
-
var parts = cookie.split("|" /* Pipe */);
|
|
3927
|
+
var parts = cookie.split("|" /* Constant.Pipe */);
|
|
3927
3928
|
// For backward compatibility introduced in v0.6.18; following code can be removed with future iterations
|
|
3928
3929
|
// 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)
|
|
3929
3930
|
var count = 0;
|
|
3930
|
-
for (var _i = 0, _a = document.cookie.split(";" /* Semicolon */); _i < _a.length; _i++) {
|
|
3931
|
+
for (var _i = 0, _a = document.cookie.split(";" /* Constant.Semicolon */); _i < _a.length; _i++) {
|
|
3931
3932
|
var c = _a[_i];
|
|
3932
|
-
count += c.split("=" /* Equals */)[0].trim() === "_clck" /* CookieKey */ ? 1 : 0;
|
|
3933
|
+
count += c.split("=" /* Constant.Equals */)[0].trim() === "_clck" /* Constant.CookieKey */ ? 1 : 0;
|
|
3933
3934
|
}
|
|
3934
3935
|
// Check if we either got version-less cookie value or saw multiple copies of the user cookie crumbs
|
|
3935
3936
|
// In both these cases, we go ahead and delete the existing cookie set on current domain
|
|
3936
3937
|
if (parts.length === 1 || count > 1) {
|
|
3937
|
-
var deleted = ""
|
|
3938
|
+
var deleted = "".concat(";" /* Constant.Semicolon */).concat("expires=" /* Constant.Expires */).concat((new Date(0)).toUTCString()).concat(";path=/" /* Constant.Path */);
|
|
3938
3939
|
// First, delete current user cookie which might be set on current sub-domain vs. root domain
|
|
3939
|
-
document.cookie = "_clck" /* CookieKey
|
|
3940
|
+
document.cookie = "".concat("_clck" /* Constant.CookieKey */, "=").concat(deleted);
|
|
3940
3941
|
// Second, same thing for current session cookie so it can be re-written later with the root domain
|
|
3941
|
-
document.cookie = "_clsk" /* SessionKey
|
|
3942
|
+
document.cookie = "".concat("_clsk" /* Constant.SessionKey */, "=").concat(deleted);
|
|
3942
3943
|
}
|
|
3943
3944
|
// End code for backward compatibility
|
|
3944
3945
|
// Read version information and timestamp from cookie, if available
|
|
@@ -3947,21 +3948,21 @@ function user() {
|
|
|
3947
3948
|
}
|
|
3948
3949
|
// Check if we have explicit consent to track this user
|
|
3949
3950
|
if (parts.length > 3 && num(parts[3]) === 1) {
|
|
3950
|
-
output.consent = 1 /* True */;
|
|
3951
|
+
output.consent = 1 /* BooleanFlag.True */;
|
|
3951
3952
|
}
|
|
3952
3953
|
// Set track configuration to true for this user if we have explicit consent, regardless of project setting
|
|
3953
|
-
config$1.track = config$1.track || output.consent === 1 /* True */;
|
|
3954
|
+
config$1.track = config$1.track || output.consent === 1 /* BooleanFlag.True */;
|
|
3954
3955
|
// Get user id from cookie only if we tracking is enabled, otherwise fallback to a random id
|
|
3955
3956
|
output.id = config$1.track ? parts[0] : output.id;
|
|
3956
3957
|
}
|
|
3957
3958
|
return output;
|
|
3958
3959
|
}
|
|
3959
3960
|
function getCookie(key) {
|
|
3960
|
-
if (supported(document, "cookie" /* Cookie */)) {
|
|
3961
|
-
var cookies = document.cookie.split(";" /* Semicolon */);
|
|
3961
|
+
if (supported(document, "cookie" /* Constant.Cookie */)) {
|
|
3962
|
+
var cookies = document.cookie.split(";" /* Constant.Semicolon */);
|
|
3962
3963
|
if (cookies) {
|
|
3963
3964
|
for (var i = 0; i < cookies.length; i++) {
|
|
3964
|
-
var pair = cookies[i].split("=" /* Equals */);
|
|
3965
|
+
var pair = cookies[i].split("=" /* Constant.Equals */);
|
|
3965
3966
|
if (pair.length > 1 && pair[0] && pair[0].trim() === key) {
|
|
3966
3967
|
return pair[1];
|
|
3967
3968
|
}
|
|
@@ -3971,23 +3972,23 @@ function getCookie(key) {
|
|
|
3971
3972
|
return null;
|
|
3972
3973
|
}
|
|
3973
3974
|
function setCookie(key, value, time) {
|
|
3974
|
-
if (config$1.track && ((navigator && navigator.cookieEnabled) || supported(document, "cookie" /* Cookie */))) {
|
|
3975
|
+
if (config$1.track && ((navigator && navigator.cookieEnabled) || supported(document, "cookie" /* Constant.Cookie */))) {
|
|
3975
3976
|
var expiry = new Date();
|
|
3976
3977
|
expiry.setDate(expiry.getDate() + time);
|
|
3977
|
-
var expires = expiry ? "expires=" /* Expires */ + expiry.toUTCString() : "" /* Empty */;
|
|
3978
|
-
var cookie = key
|
|
3978
|
+
var expires = expiry ? "expires=" /* Constant.Expires */ + expiry.toUTCString() : "" /* Constant.Empty */;
|
|
3979
|
+
var cookie = "".concat(key, "=").concat(value).concat(";" /* Constant.Semicolon */).concat(expires).concat(";path=/" /* Constant.Path */);
|
|
3979
3980
|
try {
|
|
3980
3981
|
// Attempt to get the root domain only once and fall back to writing cookie on the current domain.
|
|
3981
3982
|
if (rootDomain === null) {
|
|
3982
|
-
var hostname = location.hostname ? location.hostname.split("." /* Dot */) : [];
|
|
3983
|
+
var hostname = location.hostname ? location.hostname.split("." /* Constant.Dot */) : [];
|
|
3983
3984
|
// Walk backwards on a domain and attempt to set a cookie, until successful
|
|
3984
3985
|
for (var i = hostname.length - 1; i >= 0; i--) {
|
|
3985
|
-
rootDomain = "."
|
|
3986
|
+
rootDomain = ".".concat(hostname[i]).concat(rootDomain ? rootDomain : "" /* Constant.Empty */);
|
|
3986
3987
|
// We do not wish to attempt writing a cookie on the absolute last part of the domain, e.g. .com or .net.
|
|
3987
3988
|
// So we start attempting after second-last part, e.g. .domain.com (PASS) or .co.uk (FAIL)
|
|
3988
3989
|
if (i < hostname.length - 1) {
|
|
3989
3990
|
// Write the cookie on the current computed top level domain
|
|
3990
|
-
document.cookie = ""
|
|
3991
|
+
document.cookie = "".concat(cookie).concat(";" /* Constant.Semicolon */).concat("domain=" /* Constant.Domain */).concat(rootDomain);
|
|
3991
3992
|
// Once written, check if the cookie exists and its value matches exactly with what we intended to set
|
|
3992
3993
|
// Checking for exact value match helps us eliminate a corner case where the cookie may already be present with a different value
|
|
3993
3994
|
// If the check is successful, no more action is required and we can return from the function since rootDomain cookie is already set
|
|
@@ -3999,13 +4000,13 @@ function setCookie(key, value, time) {
|
|
|
3999
4000
|
}
|
|
4000
4001
|
// Finally, if we were not successful and gone through all the options, play it safe and reset rootDomain to be empty
|
|
4001
4002
|
// This forces our code to fall back to always writing cookie to the current domain
|
|
4002
|
-
rootDomain = "" /* Empty */;
|
|
4003
|
+
rootDomain = "" /* Constant.Empty */;
|
|
4003
4004
|
}
|
|
4004
4005
|
}
|
|
4005
4006
|
catch (_a) {
|
|
4006
|
-
rootDomain = "" /* Empty */;
|
|
4007
|
+
rootDomain = "" /* Constant.Empty */;
|
|
4007
4008
|
}
|
|
4008
|
-
document.cookie = rootDomain ? ""
|
|
4009
|
+
document.cookie = rootDomain ? "".concat(cookie).concat(";" /* Constant.Semicolon */).concat("domain=" /* Constant.Domain */).concat(rootDomain) : cookie;
|
|
4009
4010
|
}
|
|
4010
4011
|
}
|
|
4011
4012
|
|
|
@@ -4021,8 +4022,8 @@ function start$8() {
|
|
|
4021
4022
|
userId: m.userId,
|
|
4022
4023
|
sessionId: m.sessionId,
|
|
4023
4024
|
pageNum: m.pageNum,
|
|
4024
|
-
upload: 0 /* Async */,
|
|
4025
|
-
end: 0 /* False */
|
|
4025
|
+
upload: 0 /* Upload.Async */,
|
|
4026
|
+
end: 0 /* BooleanFlag.False */
|
|
4026
4027
|
};
|
|
4027
4028
|
}
|
|
4028
4029
|
function stop$7() {
|
|
@@ -4032,8 +4033,8 @@ function envelope(last) {
|
|
|
4032
4033
|
data$1.start = data$1.start + data$1.duration;
|
|
4033
4034
|
data$1.duration = time() - data$1.start;
|
|
4034
4035
|
data$1.sequence++;
|
|
4035
|
-
data$1.upload = last && "sendBeacon" in navigator ? 1 /* Beacon */ : 0 /* Async */;
|
|
4036
|
-
data$1.end = last ? 1 /* True */ : 0 /* False */;
|
|
4036
|
+
data$1.upload = last && "sendBeacon" in navigator ? 1 /* Upload.Beacon */ : 0 /* Upload.Async */;
|
|
4037
|
+
data$1.end = last ? 1 /* BooleanFlag.True */ : 0 /* BooleanFlag.False */;
|
|
4037
4038
|
return [
|
|
4038
4039
|
data$1.version,
|
|
4039
4040
|
data$1.sequence,
|
|
@@ -4086,10 +4087,10 @@ function measure (method) {
|
|
|
4086
4087
|
throw report(ex);
|
|
4087
4088
|
}
|
|
4088
4089
|
var duration = performance.now() - start;
|
|
4089
|
-
sum(4 /* TotalCost */, duration);
|
|
4090
|
-
if (duration > 30 /* LongTask */) {
|
|
4091
|
-
count$1(7 /* LongTaskCount */);
|
|
4092
|
-
max(6 /* ThreadBlockedTime */, duration);
|
|
4090
|
+
sum(4 /* Metric.TotalCost */, duration);
|
|
4091
|
+
if (duration > 30 /* Setting.LongTask */) {
|
|
4092
|
+
count$1(7 /* Metric.LongTaskCount */);
|
|
4093
|
+
max(6 /* Metric.ThreadBlockedTime */, duration);
|
|
4093
4094
|
}
|
|
4094
4095
|
};
|
|
4095
4096
|
}
|
|
@@ -4101,7 +4102,7 @@ function bind(target, event, listener, capture) {
|
|
|
4101
4102
|
// Wrapping following lines inside try / catch to cover edge cases where we might try to access an inaccessible element.
|
|
4102
4103
|
// E.g. Iframe may start off as same-origin but later turn into cross-origin, and the following lines will throw an exception.
|
|
4103
4104
|
try {
|
|
4104
|
-
target[api("addEventListener" /* AddEventListener */)](event, listener, capture);
|
|
4105
|
+
target[api("addEventListener" /* Constant.AddEventListener */)](event, listener, capture);
|
|
4105
4106
|
bindings.push({ event: event, target: target, listener: listener, capture: capture });
|
|
4106
4107
|
}
|
|
4107
4108
|
catch ( /* do nothing */_a) { /* do nothing */ }
|
|
@@ -4112,7 +4113,7 @@ function reset$1() {
|
|
|
4112
4113
|
var binding = bindings_1[_i];
|
|
4113
4114
|
// Wrapping inside try / catch to avoid situations where the element may be destroyed before we get a chance to unbind
|
|
4114
4115
|
try {
|
|
4115
|
-
binding.target[api("removeEventListener" /* RemoveEventListener */)](binding.event, binding.listener, binding.capture);
|
|
4116
|
+
binding.target[api("removeEventListener" /* Constant.RemoveEventListener */)](binding.event, binding.listener, binding.capture);
|
|
4116
4117
|
}
|
|
4117
4118
|
catch ( /* do nothing */_a) { /* do nothing */ }
|
|
4118
4119
|
}
|
|
@@ -4149,8 +4150,8 @@ function start$7() {
|
|
|
4149
4150
|
}
|
|
4150
4151
|
}
|
|
4151
4152
|
function check$1() {
|
|
4152
|
-
if (count++ > 20 /* CallStackDepth */) {
|
|
4153
|
-
log$1(4 /* CallStackDepth */, 0 /* Info */);
|
|
4153
|
+
if (count++ > 20 /* Setting.CallStackDepth */) {
|
|
4154
|
+
log$1(4 /* Code.CallStackDepth */, 0 /* Severity.Info */);
|
|
4154
4155
|
return false;
|
|
4155
4156
|
}
|
|
4156
4157
|
return true;
|
|
@@ -4160,15 +4161,15 @@ function compute$1() {
|
|
|
4160
4161
|
if (url !== getCurrentUrl()) {
|
|
4161
4162
|
// If the url changed, start tracking it as a new page
|
|
4162
4163
|
stop();
|
|
4163
|
-
window.setTimeout(restart$1, 250 /* RestartDelay */);
|
|
4164
|
+
window.setTimeout(restart$1, 250 /* Setting.RestartDelay */);
|
|
4164
4165
|
}
|
|
4165
4166
|
}
|
|
4166
4167
|
function restart$1() {
|
|
4167
4168
|
start();
|
|
4168
|
-
max(29 /* SinglePage */, 1 /* True */);
|
|
4169
|
+
max(29 /* Metric.SinglePage */, 1 /* BooleanFlag.True */);
|
|
4169
4170
|
}
|
|
4170
4171
|
function getCurrentUrl() {
|
|
4171
|
-
return location.href ? location.href.replace(location.hash, "" /* Empty */) : location.href;
|
|
4172
|
+
return location.href ? location.href.replace(location.hash, "" /* Constant.Empty */) : location.href;
|
|
4172
4173
|
}
|
|
4173
4174
|
function stop$6() {
|
|
4174
4175
|
url = null;
|
|
@@ -4231,7 +4232,7 @@ function config(override) {
|
|
|
4231
4232
|
// not holding the session during inactive time periods.
|
|
4232
4233
|
function suspend() {
|
|
4233
4234
|
if (status) {
|
|
4234
|
-
event("clarity" /* Clarity */, "suspend" /* Suspend */);
|
|
4235
|
+
event("clarity" /* Constant.Clarity */, "suspend" /* Constant.Suspend */);
|
|
4235
4236
|
stop();
|
|
4236
4237
|
["mousemove", "touchstart"].forEach(function (x) { return bind(document, x, restart); });
|
|
4237
4238
|
["resize", "scroll", "pageshow"].forEach(function (x) { return bind(window, x, restart); });
|
|
@@ -4239,7 +4240,7 @@ function suspend() {
|
|
|
4239
4240
|
}
|
|
4240
4241
|
function restart() {
|
|
4241
4242
|
start();
|
|
4242
|
-
event("clarity" /* Clarity */, "restart" /* Restart */);
|
|
4243
|
+
event("clarity" /* Constant.Clarity */, "restart" /* Constant.Restart */);
|
|
4243
4244
|
}
|
|
4244
4245
|
|
|
4245
4246
|
function start$5() {
|
|
@@ -4258,7 +4259,7 @@ var diagnostic = /*#__PURE__*/Object.freeze({
|
|
|
4258
4259
|
});
|
|
4259
4260
|
|
|
4260
4261
|
function start$4() {
|
|
4261
|
-
schedule$1(discover, 1 /* High */).then(function () {
|
|
4262
|
+
schedule$1(discover, 1 /* Priority.High */).then(function () {
|
|
4262
4263
|
measure(compute$7)();
|
|
4263
4264
|
measure(compute$6)();
|
|
4264
4265
|
});
|
|
@@ -4270,12 +4271,12 @@ function discover() {
|
|
|
4270
4271
|
switch (_a.label) {
|
|
4271
4272
|
case 0:
|
|
4272
4273
|
ts = time();
|
|
4273
|
-
timer = { id: id(), cost: 3 /* LayoutCost */ };
|
|
4274
|
+
timer = { id: id(), cost: 3 /* Metric.LayoutCost */ };
|
|
4274
4275
|
start$w(timer);
|
|
4275
|
-
return [4 /*yield*/, traverse(document, timer, 0 /* Discover */)];
|
|
4276
|
+
return [4 /*yield*/, traverse(document, timer, 0 /* Source.Discover */)];
|
|
4276
4277
|
case 1:
|
|
4277
4278
|
_a.sent();
|
|
4278
|
-
return [4 /*yield*/, encode$4(5 /* Discover */, timer, ts)];
|
|
4279
|
+
return [4 /*yield*/, encode$4(5 /* Event.Discover */, timer, ts)];
|
|
4279
4280
|
case 2:
|
|
4280
4281
|
_a.sent();
|
|
4281
4282
|
stop$t(timer);
|
|
@@ -4314,7 +4315,7 @@ function encode (type) {
|
|
|
4314
4315
|
t = time();
|
|
4315
4316
|
tokens = [t, type];
|
|
4316
4317
|
switch (type) {
|
|
4317
|
-
case 29 /* Navigation */:
|
|
4318
|
+
case 29 /* Event.Navigation */:
|
|
4318
4319
|
tokens.push(data.fetchStart);
|
|
4319
4320
|
tokens.push(data.connectStart);
|
|
4320
4321
|
tokens.push(data.connectEnd);
|
|
@@ -4363,11 +4364,11 @@ function compute(entry) {
|
|
|
4363
4364
|
encodedSize: entry.encodedBodySize ? entry.encodedBodySize : 0,
|
|
4364
4365
|
decodedSize: entry.decodedBodySize ? entry.decodedBodySize : 0
|
|
4365
4366
|
};
|
|
4366
|
-
encode(29 /* Navigation */);
|
|
4367
|
+
encode(29 /* Event.Navigation */);
|
|
4367
4368
|
}
|
|
4368
4369
|
|
|
4369
4370
|
var observer;
|
|
4370
|
-
var types = ["navigation" /* Navigation */, "resource" /* Resource */, "longtask" /* LongTask */, "first-input" /* FID */, "layout-shift" /* CLS */, "largest-contentful-paint" /* LCP */];
|
|
4371
|
+
var types = ["navigation" /* Constant.Navigation */, "resource" /* Constant.Resource */, "longtask" /* Constant.LongTask */, "first-input" /* Constant.FID */, "layout-shift" /* Constant.CLS */, "largest-contentful-paint" /* Constant.LCP */];
|
|
4371
4372
|
function start$2() {
|
|
4372
4373
|
// Check the browser support performance observer as a pre-requisite for any performance measurement
|
|
4373
4374
|
if (window["PerformanceObserver"] && PerformanceObserver.supportedEntryTypes) {
|
|
@@ -4382,7 +4383,7 @@ function start$2() {
|
|
|
4382
4383
|
}
|
|
4383
4384
|
}
|
|
4384
4385
|
else {
|
|
4385
|
-
log$1(3 /* PerformanceObserver */, 0 /* Info */);
|
|
4386
|
+
log$1(3 /* Code.PerformanceObserver */, 0 /* Severity.Info */);
|
|
4386
4387
|
}
|
|
4387
4388
|
}
|
|
4388
4389
|
function observe() {
|
|
@@ -4402,15 +4403,15 @@ function observe() {
|
|
|
4402
4403
|
if (PerformanceObserver.supportedEntryTypes.indexOf(x) >= 0) {
|
|
4403
4404
|
// Initialize CLS with a value of zero. It's possible (and recommended) for sites to not have any cumulative layout shift.
|
|
4404
4405
|
// In those cases, we want to still initialize the metric in Clarity
|
|
4405
|
-
if (x === "layout-shift" /* CLS */) {
|
|
4406
|
-
sum(9 /* CumulativeLayoutShift */, 0);
|
|
4406
|
+
if (x === "layout-shift" /* Constant.CLS */) {
|
|
4407
|
+
sum(9 /* Metric.CumulativeLayoutShift */, 0);
|
|
4407
4408
|
}
|
|
4408
4409
|
observer.observe({ type: x, buffered: true });
|
|
4409
4410
|
}
|
|
4410
4411
|
}
|
|
4411
4412
|
}
|
|
4412
4413
|
catch (_a) {
|
|
4413
|
-
log$1(3 /* PerformanceObserver */, 1 /* Warning */);
|
|
4414
|
+
log$1(3 /* Code.PerformanceObserver */, 1 /* Severity.Warning */);
|
|
4414
4415
|
}
|
|
4415
4416
|
}
|
|
4416
4417
|
function handle(entries) {
|
|
@@ -4421,41 +4422,41 @@ function process(entries) {
|
|
|
4421
4422
|
for (var i = 0; i < entries.length; i++) {
|
|
4422
4423
|
var entry = entries[i];
|
|
4423
4424
|
switch (entry.entryType) {
|
|
4424
|
-
case "navigation" /* Navigation */:
|
|
4425
|
+
case "navigation" /* Constant.Navigation */:
|
|
4425
4426
|
compute(entry);
|
|
4426
4427
|
break;
|
|
4427
|
-
case "resource" /* Resource */:
|
|
4428
|
+
case "resource" /* Constant.Resource */:
|
|
4428
4429
|
var name_1 = entry.name;
|
|
4429
|
-
log(4 /* NetworkHosts */, host(name_1));
|
|
4430
|
+
log(4 /* Dimension.NetworkHosts */, host(name_1));
|
|
4430
4431
|
if (name_1 === config$1.upload || name_1 === config$1.fallback) {
|
|
4431
|
-
max(28 /* UploadTime */, entry.duration);
|
|
4432
|
+
max(28 /* Metric.UploadTime */, entry.duration);
|
|
4432
4433
|
}
|
|
4433
4434
|
break;
|
|
4434
|
-
case "longtask" /* LongTask */:
|
|
4435
|
-
count$1(7 /* LongTaskCount */);
|
|
4435
|
+
case "longtask" /* Constant.LongTask */:
|
|
4436
|
+
count$1(7 /* Metric.LongTaskCount */);
|
|
4436
4437
|
break;
|
|
4437
|
-
case "first-input" /* FID */:
|
|
4438
|
+
case "first-input" /* Constant.FID */:
|
|
4438
4439
|
if (visible) {
|
|
4439
|
-
max(10 /* FirstInputDelay */, entry["processingStart"] - entry.startTime);
|
|
4440
|
+
max(10 /* Metric.FirstInputDelay */, entry["processingStart"] - entry.startTime);
|
|
4440
4441
|
}
|
|
4441
4442
|
break;
|
|
4442
|
-
case "layout-shift" /* CLS */:
|
|
4443
|
+
case "layout-shift" /* Constant.CLS */:
|
|
4443
4444
|
// Scale the value to avoid sending back floating point number
|
|
4444
4445
|
if (visible && !entry["hadRecentInput"]) {
|
|
4445
|
-
sum(9 /* CumulativeLayoutShift */, entry["value"] * 1000);
|
|
4446
|
+
sum(9 /* Metric.CumulativeLayoutShift */, entry["value"] * 1000);
|
|
4446
4447
|
}
|
|
4447
4448
|
break;
|
|
4448
|
-
case "largest-contentful-paint" /* LCP */:
|
|
4449
|
+
case "largest-contentful-paint" /* Constant.LCP */:
|
|
4449
4450
|
if (visible) {
|
|
4450
|
-
max(8 /* LargestPaint */, entry.startTime);
|
|
4451
|
+
max(8 /* Metric.LargestPaint */, entry.startTime);
|
|
4451
4452
|
}
|
|
4452
4453
|
break;
|
|
4453
4454
|
}
|
|
4454
4455
|
}
|
|
4455
|
-
if (performance && "memory" /* Memory */ in performance && performance["memory" /* Memory */].usedJSHeapSize) {
|
|
4456
|
+
if (performance && "memory" /* Constant.Memory */ in performance && performance["memory" /* Constant.Memory */].usedJSHeapSize) {
|
|
4456
4457
|
// Track consumed memory (MBs) where "memory" API is available
|
|
4457
4458
|
// Reference: https://developer.mozilla.org/en-US/docs/Web/API/Performance/memory
|
|
4458
|
-
max(30 /* UsedMemory */, Math.abs(performance["memory" /* Memory */].usedJSHeapSize / 1048576 /* MegaByte */));
|
|
4459
|
+
max(30 /* Metric.UsedMemory */, Math.abs(performance["memory" /* Constant.Memory */].usedJSHeapSize / 1048576 /* Setting.MegaByte */));
|
|
4459
4460
|
}
|
|
4460
4461
|
}
|
|
4461
4462
|
function stop$2() {
|
|
@@ -4503,7 +4504,7 @@ function start(config$1) {
|
|
|
4503
4504
|
// performance impact even further. For reference, we are talking single digit milliseconds optimization here, not seconds.
|
|
4504
4505
|
function pause() {
|
|
4505
4506
|
if (active()) {
|
|
4506
|
-
event("clarity" /* Clarity */, "pause" /* Pause */);
|
|
4507
|
+
event("clarity" /* Constant.Clarity */, "pause" /* Constant.Pause */);
|
|
4507
4508
|
pause$1();
|
|
4508
4509
|
}
|
|
4509
4510
|
}
|
|
@@ -4511,7 +4512,7 @@ function pause() {
|
|
|
4511
4512
|
function resume() {
|
|
4512
4513
|
if (active()) {
|
|
4513
4514
|
resume$1();
|
|
4514
|
-
event("clarity" /* Clarity */, "resume" /* Resume */);
|
|
4515
|
+
event("clarity" /* Constant.Clarity */, "resume" /* Constant.Resume */);
|
|
4515
4516
|
}
|
|
4516
4517
|
}
|
|
4517
4518
|
function stop() {
|