clarity-js 0.6.41 → 0.6.42
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 +498 -499
- package/build/clarity.min.js +1 -1
- package/build/clarity.module.js +498 -499
- package/package.json +1 -1
- package/src/core/version.ts +1 -1
- package/src/layout/dom.ts +1 -2
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 /*
|
|
82
|
+
delay: 1 * 1000 /* Second */,
|
|
83
83
|
lean: false,
|
|
84
84
|
track: true,
|
|
85
85
|
content: true,
|
|
@@ -100,7 +100,7 @@ function api(method) {
|
|
|
100
100
|
// Zone.js, a popular package for Angular, overrides native browser APIs which can lead to inconsistent state for single page applications.
|
|
101
101
|
// Example issue: https://github.com/angular/angular/issues/31712
|
|
102
102
|
// As a work around, we ensuring Clarity access APIs outside of Zone (and use native implementation instead)
|
|
103
|
-
return window["Zone" /*
|
|
103
|
+
return window["Zone" /* Zone */] && "__symbol__" /* Symbol */ in window["Zone" /* Zone */] ? window["Zone" /* Zone */]["__symbol__" /* Symbol */](method) : method;
|
|
104
104
|
}
|
|
105
105
|
|
|
106
106
|
var startTime = 0;
|
|
@@ -116,7 +116,7 @@ function stop$B() {
|
|
|
116
116
|
startTime = 0;
|
|
117
117
|
}
|
|
118
118
|
|
|
119
|
-
var version$1 = "0.6.
|
|
119
|
+
var version$1 = "0.6.42";
|
|
120
120
|
|
|
121
121
|
// tslint:disable: no-bitwise
|
|
122
122
|
function hash (input) {
|
|
@@ -149,7 +149,7 @@ function reset$p() {
|
|
|
149
149
|
// Baseline state holds the previous values - if it is updated in the current payload,
|
|
150
150
|
// reset the state to current value after sending the previous state
|
|
151
151
|
if (update$2) {
|
|
152
|
-
state$9 = { time: time(), event: 4 /*
|
|
152
|
+
state$9 = { time: time(), event: 4 /* Baseline */, data: {
|
|
153
153
|
visible: buffer.visible,
|
|
154
154
|
docWidth: buffer.docWidth,
|
|
155
155
|
docHeight: buffer.docHeight,
|
|
@@ -164,7 +164,7 @@ function reset$p() {
|
|
|
164
164
|
};
|
|
165
165
|
}
|
|
166
166
|
buffer = buffer ? buffer : {
|
|
167
|
-
visible: 1 /*
|
|
167
|
+
visible: 1 /* True */,
|
|
168
168
|
docWidth: 0,
|
|
169
169
|
docHeight: 0,
|
|
170
170
|
screenWidth: 0,
|
|
@@ -178,15 +178,15 @@ function reset$p() {
|
|
|
178
178
|
}
|
|
179
179
|
function track$7(event, x, y) {
|
|
180
180
|
switch (event) {
|
|
181
|
-
case 8 /*
|
|
181
|
+
case 8 /* Document */:
|
|
182
182
|
buffer.docWidth = x;
|
|
183
183
|
buffer.docHeight = y;
|
|
184
184
|
break;
|
|
185
|
-
case 11 /*
|
|
185
|
+
case 11 /* Resize */:
|
|
186
186
|
buffer.screenWidth = x;
|
|
187
187
|
buffer.screenHeight = y;
|
|
188
188
|
break;
|
|
189
|
-
case 10 /*
|
|
189
|
+
case 10 /* Scroll */:
|
|
190
190
|
buffer.scrollX = x;
|
|
191
191
|
buffer.scrollY = y;
|
|
192
192
|
break;
|
|
@@ -201,7 +201,7 @@ function activity(t) {
|
|
|
201
201
|
buffer.activityTime = t;
|
|
202
202
|
}
|
|
203
203
|
function visibility(t, visible) {
|
|
204
|
-
buffer.visible = visible === "visible" ? 1 /*
|
|
204
|
+
buffer.visible = visible === "visible" ? 1 /* True */ : 0 /* False */;
|
|
205
205
|
if (!buffer.visible) {
|
|
206
206
|
activity(t);
|
|
207
207
|
}
|
|
@@ -209,7 +209,7 @@ function visibility(t, visible) {
|
|
|
209
209
|
}
|
|
210
210
|
function compute$c() {
|
|
211
211
|
if (update$2) {
|
|
212
|
-
encode$1(4 /*
|
|
212
|
+
encode$1(4 /* Baseline */);
|
|
213
213
|
}
|
|
214
214
|
}
|
|
215
215
|
function stop$A() {
|
|
@@ -233,12 +233,12 @@ function event(key, value) {
|
|
|
233
233
|
if (active() &&
|
|
234
234
|
key &&
|
|
235
235
|
value &&
|
|
236
|
-
typeof key === "string" /*
|
|
237
|
-
typeof value === "string" /*
|
|
236
|
+
typeof key === "string" /* String */ &&
|
|
237
|
+
typeof value === "string" /* String */ &&
|
|
238
238
|
key.length < 255 &&
|
|
239
239
|
value.length < 255) {
|
|
240
240
|
data$j = { key: key, value: value };
|
|
241
|
-
encode$1(24 /*
|
|
241
|
+
encode$1(24 /* Custom */);
|
|
242
242
|
}
|
|
243
243
|
}
|
|
244
244
|
|
|
@@ -247,7 +247,7 @@ var updates$3 = null;
|
|
|
247
247
|
function start$D() {
|
|
248
248
|
data$i = {};
|
|
249
249
|
updates$3 = {};
|
|
250
|
-
count$1(5 /*
|
|
250
|
+
count$1(5 /* InvokeCount */);
|
|
251
251
|
}
|
|
252
252
|
function stop$z() {
|
|
253
253
|
data$i = {};
|
|
@@ -288,7 +288,7 @@ function max(metric, value) {
|
|
|
288
288
|
}
|
|
289
289
|
}
|
|
290
290
|
function compute$b() {
|
|
291
|
-
encode$1(0 /*
|
|
291
|
+
encode$1(0 /* Metric */);
|
|
292
292
|
}
|
|
293
293
|
function reset$o() {
|
|
294
294
|
updates$3 = {};
|
|
@@ -306,7 +306,7 @@ var last = 0;
|
|
|
306
306
|
var interval = 0;
|
|
307
307
|
var timeout$6 = null;
|
|
308
308
|
function start$C() {
|
|
309
|
-
interval = 60000 /*
|
|
309
|
+
interval = 60000 /* PingInterval */;
|
|
310
310
|
last = 0;
|
|
311
311
|
}
|
|
312
312
|
function reset$n() {
|
|
@@ -319,8 +319,8 @@ function reset$n() {
|
|
|
319
319
|
function ping() {
|
|
320
320
|
var now = time();
|
|
321
321
|
data$h = { gap: now - last };
|
|
322
|
-
encode$1(25 /*
|
|
323
|
-
if (data$h.gap < 300000 /*
|
|
322
|
+
encode$1(25 /* Ping */);
|
|
323
|
+
if (data$h.gap < 300000 /* PingTimeout */) {
|
|
324
324
|
timeout$6 = setTimeout(ping, interval);
|
|
325
325
|
}
|
|
326
326
|
else {
|
|
@@ -357,7 +357,7 @@ function track$6(event, time) {
|
|
|
357
357
|
var last = e[e.length - 1];
|
|
358
358
|
// Add a new entry only if the new event occurs after configured interval
|
|
359
359
|
// Otherwise, extend the duration of the previous entry
|
|
360
|
-
if (time - last[0] > 100 /*
|
|
360
|
+
if (time - last[0] > 100 /* SummaryInterval */) {
|
|
361
361
|
data$g[event].push([time, 0]);
|
|
362
362
|
}
|
|
363
363
|
else {
|
|
@@ -366,7 +366,7 @@ function track$6(event, time) {
|
|
|
366
366
|
}
|
|
367
367
|
}
|
|
368
368
|
function compute$a() {
|
|
369
|
-
encode$1(36 /*
|
|
369
|
+
encode$1(36 /* Summary */);
|
|
370
370
|
}
|
|
371
371
|
function reset$m() {
|
|
372
372
|
data$g = {};
|
|
@@ -385,7 +385,7 @@ var summary = /*#__PURE__*/Object.freeze({
|
|
|
385
385
|
var data$f = null;
|
|
386
386
|
function start$A() {
|
|
387
387
|
if (!config$1.lean && config$1.upgrade) {
|
|
388
|
-
config$1.upgrade("Config" /*
|
|
388
|
+
config$1.upgrade("Config" /* Config */);
|
|
389
389
|
}
|
|
390
390
|
data$f = null;
|
|
391
391
|
}
|
|
@@ -404,7 +404,7 @@ function upgrade(key) {
|
|
|
404
404
|
if (config$1.upgrade) {
|
|
405
405
|
config$1.upgrade(key);
|
|
406
406
|
}
|
|
407
|
-
encode$1(3 /*
|
|
407
|
+
encode$1(3 /* Upgrade */);
|
|
408
408
|
}
|
|
409
409
|
}
|
|
410
410
|
function stop$w() {
|
|
@@ -424,25 +424,25 @@ function start$z() {
|
|
|
424
424
|
reset$l();
|
|
425
425
|
}
|
|
426
426
|
function set(variable, value) {
|
|
427
|
-
var values = typeof value === "string" /*
|
|
427
|
+
var values = typeof value === "string" /* String */ ? [value] : value;
|
|
428
428
|
log$2(variable, values);
|
|
429
429
|
}
|
|
430
430
|
function identify(userId, sessionId, pageId) {
|
|
431
431
|
if (sessionId === void 0) { sessionId = null; }
|
|
432
432
|
if (pageId === void 0) { pageId = null; }
|
|
433
|
-
log$2("userId" /*
|
|
434
|
-
log$2("sessionId" /*
|
|
435
|
-
log$2("pageId" /*
|
|
433
|
+
log$2("userId" /* UserId */, [userId]);
|
|
434
|
+
log$2("sessionId" /* SessionId */, [sessionId]);
|
|
435
|
+
log$2("pageId" /* PageId */, [pageId]);
|
|
436
436
|
}
|
|
437
437
|
function log$2(variable, value) {
|
|
438
438
|
if (active() &&
|
|
439
439
|
variable &&
|
|
440
440
|
value &&
|
|
441
|
-
typeof variable === "string" /*
|
|
441
|
+
typeof variable === "string" /* String */ &&
|
|
442
442
|
variable.length < 255) {
|
|
443
443
|
var validValues = variable in data$e ? data$e[variable] : [];
|
|
444
444
|
for (var i = 0; i < value.length; i++) {
|
|
445
|
-
if (typeof value[i] === "string" /*
|
|
445
|
+
if (typeof value[i] === "string" /* String */ && value[i].length < 255) {
|
|
446
446
|
validValues.push(value[i]);
|
|
447
447
|
}
|
|
448
448
|
}
|
|
@@ -450,7 +450,7 @@ function log$2(variable, value) {
|
|
|
450
450
|
}
|
|
451
451
|
}
|
|
452
452
|
function compute$9() {
|
|
453
|
-
encode$1(34 /*
|
|
453
|
+
encode$1(34 /* Variable */);
|
|
454
454
|
}
|
|
455
455
|
function reset$l() {
|
|
456
456
|
data$e = {};
|
|
@@ -470,7 +470,7 @@ var variable = /*#__PURE__*/Object.freeze({
|
|
|
470
470
|
stop: stop$v
|
|
471
471
|
});
|
|
472
472
|
|
|
473
|
-
|
|
473
|
+
/*! *****************************************************************************
|
|
474
474
|
Copyright (c) Microsoft Corporation.
|
|
475
475
|
|
|
476
476
|
Permission to use, copy, modify, and/or distribute this software for any
|
|
@@ -523,7 +523,7 @@ function __generator(thisArg, body) {
|
|
|
523
523
|
}
|
|
524
524
|
}
|
|
525
525
|
|
|
526
|
-
var supported$1 = "CompressionStream" /*
|
|
526
|
+
var supported$1 = "CompressionStream" /* CompressionStream */ in window;
|
|
527
527
|
function compress (input) {
|
|
528
528
|
return __awaiter(this, void 0, void 0, function () {
|
|
529
529
|
var stream, _a;
|
|
@@ -540,7 +540,7 @@ function compress (input) {
|
|
|
540
540
|
return [2 /*return*/];
|
|
541
541
|
});
|
|
542
542
|
});
|
|
543
|
-
} }).pipeThrough(new TextEncoderStream()).pipeThrough(new window["CompressionStream" /*
|
|
543
|
+
} }).pipeThrough(new TextEncoderStream()).pipeThrough(new window["CompressionStream" /* CompressionStream */]("gzip"));
|
|
544
544
|
_a = Uint8Array.bind;
|
|
545
545
|
return [4 /*yield*/, read(stream)];
|
|
546
546
|
case 1: return [2 /*return*/, new (_a.apply(Uint8Array, [void 0, _c.sent()]))()];
|
|
@@ -614,11 +614,11 @@ function scrub (value, hint, privacy, mangle) {
|
|
|
614
614
|
if (mangle === void 0) { mangle = false; }
|
|
615
615
|
if (value) {
|
|
616
616
|
switch (privacy) {
|
|
617
|
-
case 0 /*
|
|
617
|
+
case 0 /* None */:
|
|
618
618
|
return value;
|
|
619
|
-
case 1 /*
|
|
619
|
+
case 1 /* Sensitive */:
|
|
620
620
|
switch (hint) {
|
|
621
|
-
case "*T" /*
|
|
621
|
+
case "*T" /* TextTag */:
|
|
622
622
|
case "value":
|
|
623
623
|
case "placeholder":
|
|
624
624
|
case "click":
|
|
@@ -626,16 +626,16 @@ function scrub (value, hint, privacy, mangle) {
|
|
|
626
626
|
return redact(value);
|
|
627
627
|
}
|
|
628
628
|
return value;
|
|
629
|
-
case 2 /*
|
|
630
|
-
case 3 /*
|
|
629
|
+
case 2 /* Text */:
|
|
630
|
+
case 3 /* TextImage */:
|
|
631
631
|
switch (hint) {
|
|
632
|
-
case "*T" /*
|
|
632
|
+
case "*T" /* TextTag */:
|
|
633
633
|
return mangle ? mangleText(value) : mask(value);
|
|
634
634
|
case "src":
|
|
635
635
|
case "srcset":
|
|
636
636
|
case "title":
|
|
637
637
|
case "alt":
|
|
638
|
-
return privacy === 3 /*
|
|
638
|
+
return privacy === 3 /* TextImage */ ? "" /* Empty */ : value;
|
|
639
639
|
case "value":
|
|
640
640
|
case "click":
|
|
641
641
|
case "input":
|
|
@@ -655,18 +655,18 @@ function mangleText(value) {
|
|
|
655
655
|
var index = value.indexOf(first);
|
|
656
656
|
var prefix = value.substr(0, index);
|
|
657
657
|
var suffix = value.substr(index + trimmed.length);
|
|
658
|
-
return ""
|
|
658
|
+
return "" + prefix + trimmed.length.toString(36) + suffix;
|
|
659
659
|
}
|
|
660
660
|
return value;
|
|
661
661
|
}
|
|
662
662
|
function mask(value) {
|
|
663
|
-
return value.replace(catchallRegex, "\u2022" /*
|
|
663
|
+
return value.replace(catchallRegex, "\u2022" /* Mask */);
|
|
664
664
|
}
|
|
665
665
|
function mangleToken(value) {
|
|
666
|
-
var length = ((Math.floor(value.length / 5 /*
|
|
667
|
-
var output = "" /*
|
|
666
|
+
var length = ((Math.floor(value.length / 5 /* WordLength */) + 1) * 5 /* WordLength */);
|
|
667
|
+
var output = "" /* Empty */;
|
|
668
668
|
for (var i = 0; i < length; i++) {
|
|
669
|
-
output += i > 0 && i % 5 /*
|
|
669
|
+
output += i > 0 && i % 5 /* WordLength */ === 0 ? " " /* Space */ : "\u2022" /* Mask */;
|
|
670
670
|
}
|
|
671
671
|
return output;
|
|
672
672
|
}
|
|
@@ -691,22 +691,22 @@ function redact(value) {
|
|
|
691
691
|
}
|
|
692
692
|
for (var i = 0; i < value.length; i++) {
|
|
693
693
|
var c = value.charCodeAt(i);
|
|
694
|
-
hasDigit = hasDigit || (c >= 48 /*
|
|
695
|
-
hasEmail = hasEmail || c === 64 /*
|
|
696
|
-
hasWhitespace = c === 9 /*
|
|
694
|
+
hasDigit = hasDigit || (c >= 48 /* Zero */ && c <= 57 /* Nine */); // Check for digits in the current word
|
|
695
|
+
hasEmail = hasEmail || c === 64 /* At */; // Check for @ sign anywhere within the current word
|
|
696
|
+
hasWhitespace = c === 9 /* Tab */ || c === 10 /* NewLine */ || c === 13 /* Return */ || c === 32 /* Blank */;
|
|
697
697
|
// Process each word as an individual token to redact any sensitive information
|
|
698
698
|
if (i === 0 || i === value.length - 1 || hasWhitespace) {
|
|
699
699
|
// Performance optimization: Lazy load string -> array conversion only when required
|
|
700
700
|
if (hasDigit || hasEmail) {
|
|
701
701
|
if (array === null) {
|
|
702
|
-
array = value.split("" /*
|
|
702
|
+
array = value.split("" /* Empty */);
|
|
703
703
|
}
|
|
704
704
|
// Work on a token at a time so we don't have to apply regex to a larger string
|
|
705
705
|
var token = value.substring(spaceIndex + 1, hasWhitespace ? i : i + 1);
|
|
706
706
|
// Check if unicode regex is supported, otherwise fallback to calling mask function on this token
|
|
707
707
|
if (unicodeRegex && currencyRegex !== null) {
|
|
708
708
|
// Do not redact information if the token contains a currency symbol
|
|
709
|
-
token = token.match(currencyRegex) ? token : token.replace(letterRegex, "\u25AA" /*
|
|
709
|
+
token = token.match(currencyRegex) ? token : token.replace(letterRegex, "\u25AA" /* Letter */).replace(digitRegex, "\u25AB" /* Digit */);
|
|
710
710
|
}
|
|
711
711
|
else {
|
|
712
712
|
token = mask(token);
|
|
@@ -723,28 +723,28 @@ function redact(value) {
|
|
|
723
723
|
}
|
|
724
724
|
}
|
|
725
725
|
}
|
|
726
|
-
return array ? array.join("" /*
|
|
726
|
+
return array ? array.join("" /* Empty */) : value;
|
|
727
727
|
}
|
|
728
728
|
|
|
729
729
|
var history$5 = [];
|
|
730
730
|
var data$d;
|
|
731
731
|
function start$x() {
|
|
732
732
|
history$5 = [];
|
|
733
|
-
max(26 /*
|
|
733
|
+
max(26 /* Automation */, navigator.webdriver ? 1 /* True */ : 0 /* False */);
|
|
734
734
|
}
|
|
735
735
|
function check$4(id, target, input) {
|
|
736
736
|
// Compute hash for fraud detection. Hash is computed only if input meets the minimum length criteria
|
|
737
|
-
if (id !== null && input && input.length >= 5 /*
|
|
737
|
+
if (id !== null && input && input.length >= 5 /* WordLength */) {
|
|
738
738
|
data$d = { id: id, target: target, hash: hash(input) };
|
|
739
739
|
// Only encode this event if we haven't already reported this hash
|
|
740
740
|
if (history$5.indexOf(data$d.hash) < 0) {
|
|
741
741
|
history$5.push(data$d.hash);
|
|
742
|
-
encode$2(41 /*
|
|
742
|
+
encode$2(41 /* Fraud */);
|
|
743
743
|
}
|
|
744
744
|
}
|
|
745
745
|
}
|
|
746
746
|
|
|
747
|
-
var excludeClassNames = "load,active,fixed,visible,focus,show,collaps,animat" /*
|
|
747
|
+
var excludeClassNames = "load,active,fixed,visible,focus,show,collaps,animat" /* ExcludeClassNames */.split("," /* Comma */);
|
|
748
748
|
var selectorMap = {};
|
|
749
749
|
function reset$k() {
|
|
750
750
|
selectorMap = {};
|
|
@@ -752,68 +752,68 @@ function reset$k() {
|
|
|
752
752
|
function get$1(input, type) {
|
|
753
753
|
var a = input.attributes;
|
|
754
754
|
var prefix = input.prefix ? input.prefix[type] : null;
|
|
755
|
-
var suffix = type === 0 /*
|
|
755
|
+
var suffix = type === 0 /* Alpha */ ? "" + "~" /* Tilde */ + (input.position - 1) : ":nth-of-type(" + input.position + ")";
|
|
756
756
|
switch (input.tag) {
|
|
757
757
|
case "STYLE":
|
|
758
758
|
case "TITLE":
|
|
759
759
|
case "LINK":
|
|
760
760
|
case "META":
|
|
761
|
-
case "*T" /*
|
|
762
|
-
case "*D" /*
|
|
763
|
-
return "" /*
|
|
761
|
+
case "*T" /* TextTag */:
|
|
762
|
+
case "*D" /* DocumentTag */:
|
|
763
|
+
return "" /* Empty */;
|
|
764
764
|
case "HTML":
|
|
765
|
-
return "HTML" /*
|
|
765
|
+
return "HTML" /* HTML */;
|
|
766
766
|
default:
|
|
767
767
|
if (prefix === null) {
|
|
768
|
-
return "" /*
|
|
768
|
+
return "" /* Empty */;
|
|
769
769
|
}
|
|
770
|
-
prefix = ""
|
|
771
|
-
input.tag = input.tag.indexOf("svg:" /*
|
|
772
|
-
var selector = ""
|
|
773
|
-
var id = "id" /*
|
|
774
|
-
var classes = input.tag !== "BODY" /*
|
|
770
|
+
prefix = "" + prefix + ">" /* Separator */;
|
|
771
|
+
input.tag = input.tag.indexOf("svg:" /* SvgPrefix */) === 0 ? input.tag.substr("svg:" /* SvgPrefix */.length) : input.tag;
|
|
772
|
+
var selector = "" + prefix + input.tag + suffix;
|
|
773
|
+
var id = "id" /* Id */ in a && a["id" /* Id */].length > 0 ? a["id" /* Id */] : null;
|
|
774
|
+
var classes = input.tag !== "BODY" /* BodyTag */ && "class" /* Class */ in a && a["class" /* Class */].length > 0 ? a["class" /* Class */].trim().split(/\s+/).filter(function (c) { return filter(c); }).join("." /* Period */) : null;
|
|
775
775
|
if (classes && classes.length > 0) {
|
|
776
|
-
if (type === 0 /*
|
|
776
|
+
if (type === 0 /* Alpha */) {
|
|
777
777
|
// In Alpha mode, update selector to use class names, with relative positioning within the parent id container.
|
|
778
778
|
// If the node has valid class name(s) then drop relative positioning within the parent path to keep things simple.
|
|
779
|
-
var key = ""
|
|
779
|
+
var key = "" + getDomPath(prefix) + input.tag + "." /* Dot */ + classes;
|
|
780
780
|
if (!(key in selectorMap)) {
|
|
781
781
|
selectorMap[key] = [];
|
|
782
782
|
}
|
|
783
783
|
if (selectorMap[key].indexOf(input.id) < 0) {
|
|
784
784
|
selectorMap[key].push(input.id);
|
|
785
785
|
}
|
|
786
|
-
selector = ""
|
|
786
|
+
selector = "" + key + "~" /* Tilde */ + selectorMap[key].indexOf(input.id);
|
|
787
787
|
}
|
|
788
788
|
else {
|
|
789
789
|
// In Beta mode, we continue to look at query selectors in context of the full page
|
|
790
|
-
selector = ""
|
|
790
|
+
selector = "" + prefix + input.tag + "." + classes + suffix;
|
|
791
791
|
}
|
|
792
792
|
}
|
|
793
793
|
// Update selector to use "id" field when available. There are two exceptions:
|
|
794
794
|
// (1) if "id" appears to be an auto generated string token, e.g. guid or a random id containing digits
|
|
795
795
|
// (2) if "id" appears inside a shadow DOM, in which case we continue to prefix up to shadow DOM to prevent conflicts
|
|
796
|
-
selector = id && filter(id) ? ""
|
|
796
|
+
selector = id && filter(id) ? "" + getDomPrefix(prefix) + "#" /* Hash */ + id : selector;
|
|
797
797
|
return selector;
|
|
798
798
|
}
|
|
799
799
|
}
|
|
800
800
|
function getDomPrefix(prefix) {
|
|
801
|
-
var shadowDomStart = prefix.lastIndexOf("*S" /*
|
|
802
|
-
var iframeDomStart = prefix.lastIndexOf(""
|
|
801
|
+
var shadowDomStart = prefix.lastIndexOf("*S" /* ShadowDomTag */);
|
|
802
|
+
var iframeDomStart = prefix.lastIndexOf("" + "iframe:" /* IFramePrefix */ + "HTML" /* HTML */);
|
|
803
803
|
var domStart = Math.max(shadowDomStart, iframeDomStart);
|
|
804
804
|
if (domStart < 0) {
|
|
805
|
-
return "" /*
|
|
805
|
+
return "" /* Empty */;
|
|
806
806
|
}
|
|
807
|
-
return prefix.substring(0, prefix.indexOf(">" /*
|
|
807
|
+
return prefix.substring(0, prefix.indexOf(">" /* Separator */, domStart) + 1);
|
|
808
808
|
}
|
|
809
809
|
function getDomPath(input) {
|
|
810
|
-
var parts = input.split(">" /*
|
|
810
|
+
var parts = input.split(">" /* Separator */);
|
|
811
811
|
for (var i = 0; i < parts.length; i++) {
|
|
812
|
-
var tIndex = parts[i].indexOf("~" /*
|
|
813
|
-
var dIndex = parts[i].indexOf("." /*
|
|
812
|
+
var tIndex = parts[i].indexOf("~" /* Tilde */);
|
|
813
|
+
var dIndex = parts[i].indexOf("." /* Dot */);
|
|
814
814
|
parts[i] = parts[i].substring(0, dIndex > 0 ? dIndex : (tIndex > 0 ? tIndex : parts[i].length));
|
|
815
815
|
}
|
|
816
|
-
return parts.join(">" /*
|
|
816
|
+
return parts.join(">" /* Separator */);
|
|
817
817
|
}
|
|
818
818
|
// Check if the given input string has digits or excluded class names
|
|
819
819
|
function filter(value) {
|
|
@@ -825,7 +825,7 @@ function filter(value) {
|
|
|
825
825
|
}
|
|
826
826
|
for (var i = 0; i < value.length; i++) {
|
|
827
827
|
var c = value.charCodeAt(i);
|
|
828
|
-
if (c >= 48 /*
|
|
828
|
+
if (c >= 48 /* Zero */ && c <= 57 /* Nine */) {
|
|
829
829
|
return false;
|
|
830
830
|
}
|
|
831
831
|
}
|
|
@@ -868,7 +868,7 @@ function reset$j() {
|
|
|
868
868
|
pauseTask = null;
|
|
869
869
|
}
|
|
870
870
|
function schedule$1(task, priority) {
|
|
871
|
-
if (priority === void 0) { priority = 0 /*
|
|
871
|
+
if (priority === void 0) { priority = 0 /* Normal */; }
|
|
872
872
|
return __awaiter(this, void 0, void 0, function () {
|
|
873
873
|
var _i, queuedTasks_1, q, promise;
|
|
874
874
|
return __generator(this, function (_a) {
|
|
@@ -880,7 +880,7 @@ function schedule$1(task, priority) {
|
|
|
880
880
|
}
|
|
881
881
|
}
|
|
882
882
|
promise = new Promise(function (resolve) {
|
|
883
|
-
var insert = priority === 1 /*
|
|
883
|
+
var insert = priority === 1 /* High */ ? "unshift" : "push";
|
|
884
884
|
// Queue this task for asynchronous execution later
|
|
885
885
|
// We also store a unique page identifier (id) along with the task to ensure
|
|
886
886
|
// ensure that we do not accidentally execute this task in context of a different page
|
|
@@ -915,7 +915,7 @@ function run() {
|
|
|
915
915
|
return;
|
|
916
916
|
}
|
|
917
917
|
if (error) {
|
|
918
|
-
log$1(0 /*
|
|
918
|
+
log$1(0 /* RunTask */, 1 /* Warning */, error.name, error.message, error.stack);
|
|
919
919
|
}
|
|
920
920
|
activeTask = null;
|
|
921
921
|
run();
|
|
@@ -926,13 +926,13 @@ function state$8(timer) {
|
|
|
926
926
|
var id = key(timer);
|
|
927
927
|
if (id in tracker) {
|
|
928
928
|
var elapsed = performance.now() - tracker[id].start;
|
|
929
|
-
return (elapsed > tracker[id].yield) ? 0 /*
|
|
929
|
+
return (elapsed > tracker[id].yield) ? 0 /* Wait */ : 1 /* Run */;
|
|
930
930
|
}
|
|
931
931
|
// If this task is no longer being tracked, send stop message to the caller
|
|
932
|
-
return 2 /*
|
|
932
|
+
return 2 /* Stop */;
|
|
933
933
|
}
|
|
934
934
|
function start$w(timer) {
|
|
935
|
-
tracker[key(timer)] = { start: performance.now(), calls: 0, yield: 30 /*
|
|
935
|
+
tracker[key(timer)] = { start: performance.now(), calls: 0, yield: 30 /* LongTask */ };
|
|
936
936
|
}
|
|
937
937
|
function restart$2(timer) {
|
|
938
938
|
var id = key(timer);
|
|
@@ -949,11 +949,11 @@ function stop$t(timer) {
|
|
|
949
949
|
var id = key(timer);
|
|
950
950
|
var duration = end - tracker[id].start;
|
|
951
951
|
sum(timer.cost, duration);
|
|
952
|
-
count$1(5 /*
|
|
952
|
+
count$1(5 /* InvokeCount */);
|
|
953
953
|
// For the first execution, which is synchronous, time is automatically counted towards TotalDuration.
|
|
954
954
|
// However, for subsequent asynchronous runs, we need to manually update TotalDuration metric.
|
|
955
955
|
if (tracker[id].calls > 0) {
|
|
956
|
-
sum(4 /*
|
|
956
|
+
sum(4 /* TotalCost */, duration);
|
|
957
957
|
}
|
|
958
958
|
}
|
|
959
959
|
function suspend$1(timer) {
|
|
@@ -974,13 +974,13 @@ function suspend$1(timer) {
|
|
|
974
974
|
case 2:
|
|
975
975
|
// After we are done with suspending task, ensure that we are still operating in the right context
|
|
976
976
|
// If the task is still being tracked, continue running the task, otherwise ask caller to stop execution
|
|
977
|
-
return [2 /*return*/, id in tracker ? 1 /*
|
|
977
|
+
return [2 /*return*/, id in tracker ? 1 /* Run */ : 2 /* Stop */];
|
|
978
978
|
}
|
|
979
979
|
});
|
|
980
980
|
});
|
|
981
981
|
}
|
|
982
982
|
function key(timer) {
|
|
983
|
-
return
|
|
983
|
+
return timer.id + "." + timer.cost;
|
|
984
984
|
}
|
|
985
985
|
function wait() {
|
|
986
986
|
return __awaiter(this, void 0, void 0, function () {
|
|
@@ -1018,14 +1018,14 @@ function requestIdleCallbackPolyfill(callback, options) {
|
|
|
1018
1018
|
var currentTime = performance.now();
|
|
1019
1019
|
var elapsed = currentTime - startTime;
|
|
1020
1020
|
var duration = currentTime - event.data;
|
|
1021
|
-
if (duration > 30 /*
|
|
1021
|
+
if (duration > 30 /* LongTask */ && elapsed < options.timeout) {
|
|
1022
1022
|
requestAnimationFrame(function () { outgoing.postMessage(currentTime); });
|
|
1023
1023
|
}
|
|
1024
1024
|
else {
|
|
1025
1025
|
var didTimeout_1 = elapsed > options.timeout;
|
|
1026
1026
|
callback({
|
|
1027
1027
|
didTimeout: didTimeout_1,
|
|
1028
|
-
timeRemaining: function () { return didTimeout_1 ? 30 /*
|
|
1028
|
+
timeRemaining: function () { return didTimeout_1 ? 30 /* LongTask */ : Math.max(0, 30 /* LongTask */ - duration); }
|
|
1029
1029
|
});
|
|
1030
1030
|
}
|
|
1031
1031
|
};
|
|
@@ -1046,7 +1046,7 @@ function tokenize (tokens) {
|
|
|
1046
1046
|
var reference = null;
|
|
1047
1047
|
for (var i = 0; i < tokens.length; i++) {
|
|
1048
1048
|
// Only optimize for string values
|
|
1049
|
-
if (typeof tokens[i] === "string" /*
|
|
1049
|
+
if (typeof tokens[i] === "string" /* String */) {
|
|
1050
1050
|
var token = tokens[i];
|
|
1051
1051
|
var index = lookup[token] || -1;
|
|
1052
1052
|
if (index >= 0) {
|
|
@@ -1088,10 +1088,10 @@ function encode$4 (type, timer, ts) {
|
|
|
1088
1088
|
tokens = [eventTime, type];
|
|
1089
1089
|
_a = type;
|
|
1090
1090
|
switch (_a) {
|
|
1091
|
-
case 8 /*
|
|
1092
|
-
case 7 /*
|
|
1093
|
-
case 5 /*
|
|
1094
|
-
case 6 /*
|
|
1091
|
+
case 8 /* Document */: return [3 /*break*/, 1];
|
|
1092
|
+
case 7 /* Region */: return [3 /*break*/, 2];
|
|
1093
|
+
case 5 /* Discover */: return [3 /*break*/, 3];
|
|
1094
|
+
case 6 /* Mutation */: return [3 /*break*/, 3];
|
|
1095
1095
|
}
|
|
1096
1096
|
return [3 /*break*/, 10];
|
|
1097
1097
|
case 1:
|
|
@@ -1104,7 +1104,7 @@ function encode$4 (type, timer, ts) {
|
|
|
1104
1104
|
case 2:
|
|
1105
1105
|
for (_i = 0, _b = state$1; _i < _b.length; _i++) {
|
|
1106
1106
|
r = _b[_i];
|
|
1107
|
-
tokens = [r.time, 7 /*
|
|
1107
|
+
tokens = [r.time, 7 /* Region */];
|
|
1108
1108
|
tokens.push(r.data.id);
|
|
1109
1109
|
tokens.push(r.data.interaction);
|
|
1110
1110
|
tokens.push(r.data.visibility);
|
|
@@ -1115,7 +1115,7 @@ function encode$4 (type, timer, ts) {
|
|
|
1115
1115
|
return [3 /*break*/, 10];
|
|
1116
1116
|
case 3:
|
|
1117
1117
|
// Check if we are operating within the context of the current page
|
|
1118
|
-
if (state$8(timer) === 2 /*
|
|
1118
|
+
if (state$8(timer) === 2 /* Stop */) {
|
|
1119
1119
|
return [3 /*break*/, 10];
|
|
1120
1120
|
}
|
|
1121
1121
|
values = updates$2();
|
|
@@ -1126,13 +1126,13 @@ function encode$4 (type, timer, ts) {
|
|
|
1126
1126
|
if (!(_c < values_1.length)) return [3 /*break*/, 8];
|
|
1127
1127
|
value = values_1[_c];
|
|
1128
1128
|
state = state$8(timer);
|
|
1129
|
-
if (!(state === 0 /*
|
|
1129
|
+
if (!(state === 0 /* Wait */)) return [3 /*break*/, 6];
|
|
1130
1130
|
return [4 /*yield*/, suspend$1(timer)];
|
|
1131
1131
|
case 5:
|
|
1132
1132
|
state = _e.sent();
|
|
1133
1133
|
_e.label = 6;
|
|
1134
1134
|
case 6:
|
|
1135
|
-
if (state === 2 /*
|
|
1135
|
+
if (state === 2 /* Stop */) {
|
|
1136
1136
|
return [3 /*break*/, 8];
|
|
1137
1137
|
}
|
|
1138
1138
|
data = value.data;
|
|
@@ -1155,9 +1155,9 @@ function encode$4 (type, timer, ts) {
|
|
|
1155
1155
|
if (value.previous && active) {
|
|
1156
1156
|
tokens.push(value.previous);
|
|
1157
1157
|
}
|
|
1158
|
-
tokens.push(suspend ? "*M" /*
|
|
1158
|
+
tokens.push(suspend ? "*M" /* SuspendMutationTag */ : data[key]);
|
|
1159
1159
|
if (box && box.length === 2) {
|
|
1160
|
-
tokens.push(""
|
|
1160
|
+
tokens.push("" + "#" /* Hash */ + str$1(box[0]) + "." + str$1(box[1]));
|
|
1161
1161
|
}
|
|
1162
1162
|
break;
|
|
1163
1163
|
case "attributes":
|
|
@@ -1179,7 +1179,7 @@ function encode$4 (type, timer, ts) {
|
|
|
1179
1179
|
_c++;
|
|
1180
1180
|
return [3 /*break*/, 4];
|
|
1181
1181
|
case 8:
|
|
1182
|
-
if (type === 6 /*
|
|
1182
|
+
if (type === 6 /* Mutation */) {
|
|
1183
1183
|
activity(eventTime);
|
|
1184
1184
|
}
|
|
1185
1185
|
queue(tokenize(tokens), !config$1.lean);
|
|
@@ -1192,13 +1192,13 @@ function encode$4 (type, timer, ts) {
|
|
|
1192
1192
|
}
|
|
1193
1193
|
function shouldMangle(value) {
|
|
1194
1194
|
var privacy = value.metadata.privacy;
|
|
1195
|
-
return value.data.tag === "*T" /*
|
|
1195
|
+
return value.data.tag === "*T" /* TextTag */ && !(privacy === 0 /* None */ || privacy === 1 /* Sensitive */);
|
|
1196
1196
|
}
|
|
1197
1197
|
function size$1(value) {
|
|
1198
1198
|
if (value.metadata.size !== null && value.metadata.size.length === 0) {
|
|
1199
1199
|
var img = getNode(value.id);
|
|
1200
1200
|
if (img) {
|
|
1201
|
-
return [Math.floor(img.offsetWidth * 100 /*
|
|
1201
|
+
return [Math.floor(img.offsetWidth * 100 /* BoxPrecision */), Math.floor(img.offsetHeight * 100 /* BoxPrecision */)];
|
|
1202
1202
|
}
|
|
1203
1203
|
}
|
|
1204
1204
|
return value.metadata.size;
|
|
@@ -1207,7 +1207,7 @@ function str$1(input) {
|
|
|
1207
1207
|
return input.toString(36);
|
|
1208
1208
|
}
|
|
1209
1209
|
function attribute(key, value, privacy) {
|
|
1210
|
-
return
|
|
1210
|
+
return key + "=" + scrub(value, key, privacy);
|
|
1211
1211
|
}
|
|
1212
1212
|
|
|
1213
1213
|
var data$c;
|
|
@@ -1238,7 +1238,7 @@ function compute$7() {
|
|
|
1238
1238
|
// Check that width or height has changed from before, and also that width & height are not null values
|
|
1239
1239
|
if ((data$c === null || width !== data$c.width || height !== data$c.height) && width !== null && height !== null) {
|
|
1240
1240
|
data$c = { width: width, height: height };
|
|
1241
|
-
encode$4(8 /*
|
|
1241
|
+
encode$4(8 /* Document */);
|
|
1242
1242
|
}
|
|
1243
1243
|
}
|
|
1244
1244
|
function end() {
|
|
@@ -1267,7 +1267,7 @@ function start$u() {
|
|
|
1267
1267
|
reset$h();
|
|
1268
1268
|
}
|
|
1269
1269
|
function observe$b(root) {
|
|
1270
|
-
bind(root, "click", handler$3.bind(this, 9 /*
|
|
1270
|
+
bind(root, "click", handler$3.bind(this, 9 /* Click */, root), true);
|
|
1271
1271
|
}
|
|
1272
1272
|
function handler$3(event, root, evt) {
|
|
1273
1273
|
var frame = iframe(root);
|
|
@@ -1293,14 +1293,13 @@ function handler$3(event, root, evt) {
|
|
|
1293
1293
|
x = Math.round(l.x + (l.w / 2));
|
|
1294
1294
|
y = Math.round(l.y + (l.h / 2));
|
|
1295
1295
|
}
|
|
1296
|
-
var eX = l ? Math.max(Math.floor(((x - l.x) / l.w) * 32767 /*
|
|
1297
|
-
var eY = l ? Math.max(Math.floor(((y - l.y) / l.h) * 32767 /*
|
|
1296
|
+
var eX = l ? Math.max(Math.floor(((x - l.x) / l.w) * 32767 /* ClickPrecision */), 0) : 0;
|
|
1297
|
+
var eY = l ? Math.max(Math.floor(((y - l.y) / l.h) * 32767 /* ClickPrecision */), 0) : 0;
|
|
1298
1298
|
// Check for null values before processing this event
|
|
1299
1299
|
if (x !== null && y !== null) {
|
|
1300
1300
|
state$7.push({
|
|
1301
1301
|
time: time(),
|
|
1302
|
-
event: event,
|
|
1303
|
-
data: {
|
|
1302
|
+
event: event, data: {
|
|
1304
1303
|
target: t,
|
|
1305
1304
|
x: x,
|
|
1306
1305
|
y: y,
|
|
@@ -1312,7 +1311,7 @@ function handler$3(event, root, evt) {
|
|
|
1312
1311
|
text: text(t),
|
|
1313
1312
|
link: a ? a.href : null,
|
|
1314
1313
|
hash: null,
|
|
1315
|
-
trust: evt.isTrusted ? 1 /*
|
|
1314
|
+
trust: evt.isTrusted ? 1 /* True */ : 0 /* False */
|
|
1316
1315
|
}
|
|
1317
1316
|
});
|
|
1318
1317
|
schedule$1(encode$3.bind(this, event));
|
|
@@ -1327,7 +1326,7 @@ function text(element) {
|
|
|
1327
1326
|
// Trim any spaces at the beginning or at the end of string
|
|
1328
1327
|
// Also, replace multiple occurrence of space characters with a single white space
|
|
1329
1328
|
// Finally, send only first few characters as specified by the Setting
|
|
1330
|
-
output = t.trim().replace(/\s+/g, " " /*
|
|
1329
|
+
output = t.trim().replace(/\s+/g, " " /* Space */).substr(0, 25 /* ClickText */);
|
|
1331
1330
|
}
|
|
1332
1331
|
}
|
|
1333
1332
|
return output;
|
|
@@ -1336,10 +1335,10 @@ function reaction(element) {
|
|
|
1336
1335
|
if (element.nodeType === Node.ELEMENT_NODE) {
|
|
1337
1336
|
var tag = element.tagName.toLowerCase();
|
|
1338
1337
|
if (UserInputTags.indexOf(tag) >= 0) {
|
|
1339
|
-
return 0 /*
|
|
1338
|
+
return 0 /* False */;
|
|
1340
1339
|
}
|
|
1341
1340
|
}
|
|
1342
|
-
return 1 /*
|
|
1341
|
+
return 1 /* True */;
|
|
1343
1342
|
}
|
|
1344
1343
|
function layout$1(element) {
|
|
1345
1344
|
var box = null;
|
|
@@ -1363,14 +1362,14 @@ function layout$1(element) {
|
|
|
1363
1362
|
return box;
|
|
1364
1363
|
}
|
|
1365
1364
|
function context(a) {
|
|
1366
|
-
if (a && a.hasAttribute("target" /*
|
|
1367
|
-
switch (a.getAttribute("target" /*
|
|
1368
|
-
case "_blank" /*
|
|
1369
|
-
case "_parent" /*
|
|
1370
|
-
case "_top" /*
|
|
1365
|
+
if (a && a.hasAttribute("target" /* Target */)) {
|
|
1366
|
+
switch (a.getAttribute("target" /* Target */)) {
|
|
1367
|
+
case "_blank" /* Blank */: return 1 /* Blank */;
|
|
1368
|
+
case "_parent" /* Parent */: return 2 /* Parent */;
|
|
1369
|
+
case "_top" /* Top */: return 3 /* Top */;
|
|
1371
1370
|
}
|
|
1372
1371
|
}
|
|
1373
|
-
return 0 /*
|
|
1372
|
+
return 0 /* Self */;
|
|
1374
1373
|
}
|
|
1375
1374
|
function reset$h() {
|
|
1376
1375
|
state$7 = [];
|
|
@@ -1384,13 +1383,13 @@ function start$t() {
|
|
|
1384
1383
|
reset$g();
|
|
1385
1384
|
}
|
|
1386
1385
|
function observe$a(root) {
|
|
1387
|
-
bind(root, "cut", recompute$7.bind(this, 0 /*
|
|
1388
|
-
bind(root, "copy", recompute$7.bind(this, 1 /*
|
|
1389
|
-
bind(root, "paste", recompute$7.bind(this, 2 /*
|
|
1386
|
+
bind(root, "cut", recompute$7.bind(this, 0 /* Cut */), true);
|
|
1387
|
+
bind(root, "copy", recompute$7.bind(this, 1 /* Copy */), true);
|
|
1388
|
+
bind(root, "paste", recompute$7.bind(this, 2 /* Paste */), true);
|
|
1390
1389
|
}
|
|
1391
1390
|
function recompute$7(action, evt) {
|
|
1392
|
-
state$6.push({ time: time(), event: 38 /*
|
|
1393
|
-
schedule$1(encode$3.bind(this, 38 /*
|
|
1391
|
+
state$6.push({ time: time(), event: 38 /* Clipboard */, data: { target: target(evt), action: action } });
|
|
1392
|
+
schedule$1(encode$3.bind(this, 38 /* Clipboard */));
|
|
1394
1393
|
}
|
|
1395
1394
|
function reset$g() {
|
|
1396
1395
|
state$6 = [];
|
|
@@ -1423,9 +1422,9 @@ function recompute$6(evt) {
|
|
|
1423
1422
|
if (state$5.length > 0 && (state$5[state$5.length - 1].data.target === data.target)) {
|
|
1424
1423
|
state$5.pop();
|
|
1425
1424
|
}
|
|
1426
|
-
state$5.push({ time: time(), event: 27 /*
|
|
1425
|
+
state$5.push({ time: time(), event: 27 /* Input */, data: data });
|
|
1427
1426
|
clearTimeout(timeout$5);
|
|
1428
|
-
timeout$5 = setTimeout(process$6, 500 /*
|
|
1427
|
+
timeout$5 = setTimeout(process$6, 500 /* LookAhead */, 27 /* Input */);
|
|
1429
1428
|
}
|
|
1430
1429
|
}
|
|
1431
1430
|
function process$6(event) {
|
|
@@ -1445,15 +1444,15 @@ function start$r() {
|
|
|
1445
1444
|
reset$e();
|
|
1446
1445
|
}
|
|
1447
1446
|
function observe$8(root) {
|
|
1448
|
-
bind(root, "mousedown", mouse.bind(this, 13 /*
|
|
1449
|
-
bind(root, "mouseup", mouse.bind(this, 14 /*
|
|
1450
|
-
bind(root, "mousemove", mouse.bind(this, 12 /*
|
|
1451
|
-
bind(root, "wheel", mouse.bind(this, 15 /*
|
|
1452
|
-
bind(root, "dblclick", mouse.bind(this, 16 /*
|
|
1453
|
-
bind(root, "touchstart", touch.bind(this, 17 /*
|
|
1454
|
-
bind(root, "touchend", touch.bind(this, 18 /*
|
|
1455
|
-
bind(root, "touchmove", touch.bind(this, 19 /*
|
|
1456
|
-
bind(root, "touchcancel", touch.bind(this, 20 /*
|
|
1447
|
+
bind(root, "mousedown", mouse.bind(this, 13 /* MouseDown */, root), true);
|
|
1448
|
+
bind(root, "mouseup", mouse.bind(this, 14 /* MouseUp */, root), true);
|
|
1449
|
+
bind(root, "mousemove", mouse.bind(this, 12 /* MouseMove */, root), true);
|
|
1450
|
+
bind(root, "wheel", mouse.bind(this, 15 /* MouseWheel */, root), true);
|
|
1451
|
+
bind(root, "dblclick", mouse.bind(this, 16 /* DoubleClick */, root), true);
|
|
1452
|
+
bind(root, "touchstart", touch.bind(this, 17 /* TouchStart */, root), true);
|
|
1453
|
+
bind(root, "touchend", touch.bind(this, 18 /* TouchEnd */, root), true);
|
|
1454
|
+
bind(root, "touchmove", touch.bind(this, 19 /* TouchMove */, root), true);
|
|
1455
|
+
bind(root, "touchcancel", touch.bind(this, 20 /* TouchCancel */, root), true);
|
|
1457
1456
|
}
|
|
1458
1457
|
function mouse(event, root, evt) {
|
|
1459
1458
|
var frame = iframe(root);
|
|
@@ -1492,9 +1491,9 @@ function touch(event, root, evt) {
|
|
|
1492
1491
|
}
|
|
1493
1492
|
function handler$2(current) {
|
|
1494
1493
|
switch (current.event) {
|
|
1495
|
-
case 12 /*
|
|
1496
|
-
case 15 /*
|
|
1497
|
-
case 19 /*
|
|
1494
|
+
case 12 /* MouseMove */:
|
|
1495
|
+
case 15 /* MouseWheel */:
|
|
1496
|
+
case 19 /* TouchMove */:
|
|
1498
1497
|
var length_1 = state$4.length;
|
|
1499
1498
|
var last = length_1 > 1 ? state$4[length_1 - 2] : null;
|
|
1500
1499
|
if (last && similar$1(last, current)) {
|
|
@@ -1502,7 +1501,7 @@ function handler$2(current) {
|
|
|
1502
1501
|
}
|
|
1503
1502
|
state$4.push(current);
|
|
1504
1503
|
clearTimeout(timeout$4);
|
|
1505
|
-
timeout$4 = setTimeout(process$5, 500 /*
|
|
1504
|
+
timeout$4 = setTimeout(process$5, 500 /* LookAhead */, current.event);
|
|
1506
1505
|
break;
|
|
1507
1506
|
default:
|
|
1508
1507
|
state$4.push(current);
|
|
@@ -1522,7 +1521,7 @@ function similar$1(last, current) {
|
|
|
1522
1521
|
var distance = Math.sqrt(dx * dx + dy * dy);
|
|
1523
1522
|
var gap = current.time - last.time;
|
|
1524
1523
|
var match = current.data.target === last.data.target;
|
|
1525
|
-
return current.event === last.event && match && distance < 20 /*
|
|
1524
|
+
return current.event === last.event && match && distance < 20 /* Distance */ && gap < 25 /* Interval */;
|
|
1526
1525
|
}
|
|
1527
1526
|
function stop$p() {
|
|
1528
1527
|
clearTimeout(timeout$4);
|
|
@@ -1545,7 +1544,7 @@ function recompute$5() {
|
|
|
1545
1544
|
width: de && "clientWidth" in de ? Math.min(de.clientWidth, window.innerWidth) : window.innerWidth,
|
|
1546
1545
|
height: de && "clientHeight" in de ? Math.min(de.clientHeight, window.innerHeight) : window.innerHeight,
|
|
1547
1546
|
};
|
|
1548
|
-
encode$3(11 /*
|
|
1547
|
+
encode$3(11 /* Resize */);
|
|
1549
1548
|
}
|
|
1550
1549
|
function reset$d() {
|
|
1551
1550
|
data$b = null;
|
|
@@ -1581,7 +1580,7 @@ function recompute$4(event) {
|
|
|
1581
1580
|
// And, if for some reason that is not available, fall back to looking up scrollTop on document.documentElement.
|
|
1582
1581
|
var x = element === de && "pageXOffset" in w ? Math.round(w.pageXOffset) : Math.round(element.scrollLeft);
|
|
1583
1582
|
var y = element === de && "pageYOffset" in w ? Math.round(w.pageYOffset) : Math.round(element.scrollTop);
|
|
1584
|
-
var current = { time: time(), event: 10 /*
|
|
1583
|
+
var current = { time: time(), event: 10 /* Scroll */, data: { target: element, x: x, y: y } };
|
|
1585
1584
|
// We don't send any scroll events if this is the first event and the current position is top (0,0)
|
|
1586
1585
|
if ((event === null && x === 0 && y === 0) || (x === null || y === null)) {
|
|
1587
1586
|
return;
|
|
@@ -1593,7 +1592,7 @@ function recompute$4(event) {
|
|
|
1593
1592
|
}
|
|
1594
1593
|
state$3.push(current);
|
|
1595
1594
|
clearTimeout(timeout$3);
|
|
1596
|
-
timeout$3 = setTimeout(process$4, 500 /*
|
|
1595
|
+
timeout$3 = setTimeout(process$4, 500 /* LookAhead */, 10 /* Scroll */);
|
|
1597
1596
|
}
|
|
1598
1597
|
function reset$c() {
|
|
1599
1598
|
state$3 = [];
|
|
@@ -1604,7 +1603,7 @@ function process$4(event) {
|
|
|
1604
1603
|
function similar(last, current) {
|
|
1605
1604
|
var dx = last.data.x - current.data.x;
|
|
1606
1605
|
var dy = last.data.y - current.data.y;
|
|
1607
|
-
return (dx * dx + dy * dy < 20 /*
|
|
1606
|
+
return (dx * dx + dy * dy < 20 /* Distance */ * 20 /* Distance */) && (current.time - last.time < 25 /* Interval */);
|
|
1608
1607
|
}
|
|
1609
1608
|
function stop$n() {
|
|
1610
1609
|
clearTimeout(timeout$3);
|
|
@@ -1639,7 +1638,7 @@ function recompute$3(root) {
|
|
|
1639
1638
|
var startNode = data$a.start ? data$a.start : null;
|
|
1640
1639
|
if (previous !== null && data$a.start !== null && startNode !== current.anchorNode) {
|
|
1641
1640
|
clearTimeout(timeout$2);
|
|
1642
|
-
process$3(21 /*
|
|
1641
|
+
process$3(21 /* Selection */);
|
|
1643
1642
|
}
|
|
1644
1643
|
data$a = {
|
|
1645
1644
|
start: current.anchorNode,
|
|
@@ -1649,7 +1648,7 @@ function recompute$3(root) {
|
|
|
1649
1648
|
};
|
|
1650
1649
|
previous = current;
|
|
1651
1650
|
clearTimeout(timeout$2);
|
|
1652
|
-
timeout$2 = setTimeout(process$3, 500 /*
|
|
1651
|
+
timeout$2 = setTimeout(process$3, 500 /* LookAhead */, 21 /* Selection */);
|
|
1653
1652
|
}
|
|
1654
1653
|
function process$3(event) {
|
|
1655
1654
|
schedule$1(encode$3.bind(this, event));
|
|
@@ -1671,8 +1670,8 @@ function observe$5(root) {
|
|
|
1671
1670
|
bind(root, "submit", recompute$2, true);
|
|
1672
1671
|
}
|
|
1673
1672
|
function recompute$2(evt) {
|
|
1674
|
-
state$2.push({ time: time(), event: 39 /*
|
|
1675
|
-
schedule$1(encode$3.bind(this, 39 /*
|
|
1673
|
+
state$2.push({ time: time(), event: 39 /* Submit */, data: { target: target(evt) } });
|
|
1674
|
+
schedule$1(encode$3.bind(this, 39 /* Submit */));
|
|
1676
1675
|
}
|
|
1677
1676
|
function reset$a() {
|
|
1678
1677
|
state$2 = [];
|
|
@@ -1687,7 +1686,7 @@ function start$m() {
|
|
|
1687
1686
|
}
|
|
1688
1687
|
function recompute$1(evt) {
|
|
1689
1688
|
data$9 = { name: evt.type };
|
|
1690
|
-
encode$3(26 /*
|
|
1689
|
+
encode$3(26 /* Unload */);
|
|
1691
1690
|
stop();
|
|
1692
1691
|
}
|
|
1693
1692
|
function reset$9() {
|
|
@@ -1704,7 +1703,7 @@ function start$l() {
|
|
|
1704
1703
|
}
|
|
1705
1704
|
function recompute() {
|
|
1706
1705
|
data$8 = { visible: "visibilityState" in document ? document.visibilityState : "default" };
|
|
1707
|
-
encode$3(28 /*
|
|
1706
|
+
encode$3(28 /* Visibility */);
|
|
1708
1707
|
}
|
|
1709
1708
|
function reset$8() {
|
|
1710
1709
|
data$8 = null;
|
|
@@ -1766,51 +1765,51 @@ function ld(json) {
|
|
|
1766
1765
|
for (var _i = 0, _a = Object.keys(json); _i < _a.length; _i++) {
|
|
1767
1766
|
var key = _a[_i];
|
|
1768
1767
|
var value = json[key];
|
|
1769
|
-
if (key === "@type" /*
|
|
1768
|
+
if (key === "@type" /* Type */ && typeof value === "string") {
|
|
1770
1769
|
value = value.toLowerCase();
|
|
1771
1770
|
/* Normalizations */
|
|
1772
|
-
value = value.indexOf("article" /*
|
|
1771
|
+
value = value.indexOf("article" /* Article */) >= 0 || value.indexOf("posting" /* Posting */) >= 0 ? "article" /* Article */ : value;
|
|
1773
1772
|
switch (value) {
|
|
1774
|
-
case "article" /*
|
|
1775
|
-
case "recipe" /*
|
|
1776
|
-
log(5 /*
|
|
1777
|
-
log(8 /*
|
|
1778
|
-
log(18 /*
|
|
1773
|
+
case "article" /* Article */:
|
|
1774
|
+
case "recipe" /* Recipe */:
|
|
1775
|
+
log(5 /* SchemaType */, json[key]);
|
|
1776
|
+
log(8 /* AuthorName */, json["creator" /* Creator */]);
|
|
1777
|
+
log(18 /* Headline */, json["headline" /* Headline */]);
|
|
1779
1778
|
break;
|
|
1780
|
-
case "product" /*
|
|
1781
|
-
log(5 /*
|
|
1782
|
-
log(10 /*
|
|
1783
|
-
log(12 /*
|
|
1784
|
-
if (json["brand" /*
|
|
1785
|
-
log(6 /*
|
|
1779
|
+
case "product" /* Product */:
|
|
1780
|
+
log(5 /* SchemaType */, json[key]);
|
|
1781
|
+
log(10 /* ProductName */, json["name" /* Name */]);
|
|
1782
|
+
log(12 /* ProductSku */, json["sku" /* Sku */]);
|
|
1783
|
+
if (json["brand" /* Brand */]) {
|
|
1784
|
+
log(6 /* ProductBrand */, json["brand" /* Brand */]["name" /* Name */]);
|
|
1786
1785
|
}
|
|
1787
1786
|
break;
|
|
1788
|
-
case "aggregaterating" /*
|
|
1789
|
-
if (json["ratingValue" /*
|
|
1790
|
-
max(11 /*
|
|
1791
|
-
max(18 /*
|
|
1792
|
-
max(19 /*
|
|
1787
|
+
case "aggregaterating" /* AggregateRating */:
|
|
1788
|
+
if (json["ratingValue" /* RatingValue */]) {
|
|
1789
|
+
max(11 /* RatingValue */, num$1(json["ratingValue" /* RatingValue */], 100 /* RatingScale */));
|
|
1790
|
+
max(18 /* BestRating */, num$1(json["bestRating" /* BestRating */]));
|
|
1791
|
+
max(19 /* WorstRating */, num$1(json["worstRating" /* WorstRating */]));
|
|
1793
1792
|
}
|
|
1794
|
-
max(12 /*
|
|
1795
|
-
max(17 /*
|
|
1793
|
+
max(12 /* RatingCount */, num$1(json["ratingCount" /* RatingCount */]));
|
|
1794
|
+
max(17 /* ReviewCount */, num$1(json["reviewCount" /* ReviewCount */]));
|
|
1796
1795
|
break;
|
|
1797
|
-
case "person" /*
|
|
1798
|
-
log(8 /*
|
|
1796
|
+
case "person" /* Author */:
|
|
1797
|
+
log(8 /* AuthorName */, json["name" /* Name */]);
|
|
1799
1798
|
break;
|
|
1800
|
-
case "offer" /*
|
|
1801
|
-
log(7 /*
|
|
1802
|
-
log(14 /*
|
|
1803
|
-
log(13 /*
|
|
1804
|
-
log(12 /*
|
|
1805
|
-
max(13 /*
|
|
1799
|
+
case "offer" /* Offer */:
|
|
1800
|
+
log(7 /* ProductAvailability */, json["availability" /* Availability */]);
|
|
1801
|
+
log(14 /* ProductCondition */, json["itemCondition" /* ItemCondition */]);
|
|
1802
|
+
log(13 /* ProductCurrency */, json["priceCurrency" /* PriceCurrency */]);
|
|
1803
|
+
log(12 /* ProductSku */, json["sku" /* Sku */]);
|
|
1804
|
+
max(13 /* ProductPrice */, num$1(json["price" /* Price */]));
|
|
1806
1805
|
break;
|
|
1807
|
-
case "brand" /*
|
|
1808
|
-
log(6 /*
|
|
1806
|
+
case "brand" /* Brand */:
|
|
1807
|
+
log(6 /* ProductBrand */, json["name" /* Name */]);
|
|
1809
1808
|
break;
|
|
1810
1809
|
}
|
|
1811
1810
|
}
|
|
1812
1811
|
// Continue parsing nested objects
|
|
1813
|
-
if (value !== null && typeof (value) === "object" /*
|
|
1812
|
+
if (value !== null && typeof (value) === "object" /* Object */) {
|
|
1814
1813
|
ld(value);
|
|
1815
1814
|
}
|
|
1816
1815
|
}
|
|
@@ -1819,8 +1818,8 @@ function num$1(input, scale) {
|
|
|
1819
1818
|
if (scale === void 0) { scale = 1; }
|
|
1820
1819
|
if (input !== null) {
|
|
1821
1820
|
switch (typeof input) {
|
|
1822
|
-
case "number" /*
|
|
1823
|
-
case "string" /*
|
|
1821
|
+
case "number" /* Number */: return Math.round(input * scale);
|
|
1822
|
+
case "string" /* String */: return Math.round(parseFloat(input.replace(digitsRegex, "" /* Empty */)) * scale);
|
|
1824
1823
|
}
|
|
1825
1824
|
}
|
|
1826
1825
|
return null;
|
|
@@ -1831,11 +1830,11 @@ var newlineRegex = /[\r\n]+/g;
|
|
|
1831
1830
|
function processNode (node, source) {
|
|
1832
1831
|
var child = null;
|
|
1833
1832
|
// Do not track this change if we are attempting to remove a node before discovering it
|
|
1834
|
-
if (source === 2 /*
|
|
1833
|
+
if (source === 2 /* ChildListRemove */ && has(node) === false) {
|
|
1835
1834
|
return child;
|
|
1836
1835
|
}
|
|
1837
1836
|
// Special handling for text nodes that belong to style nodes
|
|
1838
|
-
if (source !== 0 /*
|
|
1837
|
+
if (source !== 0 /* Discover */ &&
|
|
1839
1838
|
node.nodeType === Node.TEXT_NODE &&
|
|
1840
1839
|
node.parentElement &&
|
|
1841
1840
|
node.parentElement.tagName === "STYLE") {
|
|
@@ -1848,10 +1847,10 @@ function processNode (node, source) {
|
|
|
1848
1847
|
switch (node.nodeType) {
|
|
1849
1848
|
case Node.DOCUMENT_TYPE_NODE:
|
|
1850
1849
|
parent = insideFrame && node.parentNode ? iframe(node.parentNode) : parent;
|
|
1851
|
-
var docTypePrefix = insideFrame ? "iframe:" /*
|
|
1850
|
+
var docTypePrefix = insideFrame ? "iframe:" /* IFramePrefix */ : "" /* Empty */;
|
|
1852
1851
|
var doctype = node;
|
|
1853
1852
|
var docAttributes = { name: doctype.name, publicId: doctype.publicId, systemId: doctype.systemId };
|
|
1854
|
-
var docData = { tag: docTypePrefix + "*D" /*
|
|
1853
|
+
var docData = { tag: docTypePrefix + "*D" /* DocumentTag */, attributes: docAttributes };
|
|
1855
1854
|
dom[call](node, parent, docData, source);
|
|
1856
1855
|
break;
|
|
1857
1856
|
case Node.DOCUMENT_NODE:
|
|
@@ -1866,26 +1865,26 @@ function processNode (node, source) {
|
|
|
1866
1865
|
if (shadowRoot.host) {
|
|
1867
1866
|
parse$1(shadowRoot);
|
|
1868
1867
|
var type = typeof (shadowRoot.constructor);
|
|
1869
|
-
if (type === "function" /*
|
|
1868
|
+
if (type === "function" /* Function */ && shadowRoot.constructor.toString().indexOf("[native code]" /* NativeCode */) >= 0) {
|
|
1870
1869
|
observe$3(shadowRoot);
|
|
1871
1870
|
// See: https://wicg.github.io/construct-stylesheets/ for more details on adoptedStyleSheets.
|
|
1872
1871
|
// At the moment, we are only able to capture "open" shadow DOM nodes. If they are closed, they are not accessible.
|
|
1873
1872
|
// In future we may decide to proxy "attachShadow" call to gain access, but at the moment, we don't want to
|
|
1874
1873
|
// cause any unintended side effect to the page. We will re-evaluate after we gather more real world data on this.
|
|
1875
|
-
var style = "" /*
|
|
1874
|
+
var style = "" /* Empty */;
|
|
1876
1875
|
var adoptedStyleSheets = "adoptedStyleSheets" in shadowRoot ? shadowRoot["adoptedStyleSheets"] : [];
|
|
1877
1876
|
for (var _i = 0, adoptedStyleSheets_1 = adoptedStyleSheets; _i < adoptedStyleSheets_1.length; _i++) {
|
|
1878
1877
|
var styleSheet = adoptedStyleSheets_1[_i];
|
|
1879
1878
|
style += getCssRules(styleSheet);
|
|
1880
1879
|
}
|
|
1881
|
-
var fragementData = { tag: "*S" /*
|
|
1880
|
+
var fragementData = { tag: "*S" /* ShadowDomTag */, attributes: { style: style } };
|
|
1882
1881
|
dom[call](node, shadowRoot.host, fragementData, source);
|
|
1883
1882
|
}
|
|
1884
1883
|
else {
|
|
1885
1884
|
// If the browser doesn't support shadow DOM natively, we detect that, and send appropriate tag back.
|
|
1886
1885
|
// The differentiation is important because we don't have to observe pollyfill shadow DOM nodes,
|
|
1887
1886
|
// the same way we observe real shadow DOM nodes (encapsulation provided by the browser).
|
|
1888
|
-
dom[call](node, shadowRoot.host, { tag: "*P" /*
|
|
1887
|
+
dom[call](node, shadowRoot.host, { tag: "*P" /* PolyfillShadowDomTag */, attributes: {} }, source);
|
|
1889
1888
|
}
|
|
1890
1889
|
}
|
|
1891
1890
|
break;
|
|
@@ -1898,7 +1897,7 @@ function processNode (node, source) {
|
|
|
1898
1897
|
// The only exception is when we receive a mutation to remove the text node, in that case
|
|
1899
1898
|
// parent will be null, but we can still process the node by checking it's an update call.
|
|
1900
1899
|
if (call === "update" || (parent && has(parent) && parent.tagName !== "STYLE")) {
|
|
1901
|
-
var textData = { tag: "*T" /*
|
|
1900
|
+
var textData = { tag: "*T" /* TextTag */, value: node.nodeValue };
|
|
1902
1901
|
dom[call](node, parent, textData, source);
|
|
1903
1902
|
}
|
|
1904
1903
|
break;
|
|
@@ -1910,20 +1909,20 @@ function processNode (node, source) {
|
|
|
1910
1909
|
// For correctness, we first look at parentElement and if it not present then fall back to using parentNode
|
|
1911
1910
|
parent = node.parentElement ? node.parentElement : (node.parentNode ? node.parentNode : null);
|
|
1912
1911
|
// If we encounter a node that is part of SVG namespace, prefix the tag with SVG_PREFIX
|
|
1913
|
-
if (element.namespaceURI === "http://www.w3.org/2000/svg" /*
|
|
1914
|
-
tag = "svg:" /*
|
|
1912
|
+
if (element.namespaceURI === "http://www.w3.org/2000/svg" /* SvgNamespace */) {
|
|
1913
|
+
tag = "svg:" /* SvgPrefix */ + tag;
|
|
1915
1914
|
}
|
|
1916
1915
|
switch (tag) {
|
|
1917
1916
|
case "HTML":
|
|
1918
1917
|
parent = insideFrame && parent ? iframe(parent) : null;
|
|
1919
|
-
var htmlPrefix = insideFrame ? "iframe:" /*
|
|
1918
|
+
var htmlPrefix = insideFrame ? "iframe:" /* IFramePrefix */ : "" /* Empty */;
|
|
1920
1919
|
var htmlData = { tag: htmlPrefix + tag, attributes: attributes };
|
|
1921
1920
|
dom[call](node, parent, htmlData, source);
|
|
1922
1921
|
break;
|
|
1923
1922
|
case "SCRIPT":
|
|
1924
|
-
if ("type" /*
|
|
1923
|
+
if ("type" /* Type */ in attributes && attributes["type" /* Type */] === "application/ld+json" /* JsonLD */) {
|
|
1925
1924
|
try {
|
|
1926
|
-
ld(JSON.parse(element.text.replace(newlineRegex, "" /*
|
|
1925
|
+
ld(JSON.parse(element.text.replace(newlineRegex, "" /* Empty */)));
|
|
1927
1926
|
}
|
|
1928
1927
|
catch ( /* do nothing */_a) { /* do nothing */ }
|
|
1929
1928
|
}
|
|
@@ -1931,20 +1930,20 @@ function processNode (node, source) {
|
|
|
1931
1930
|
case "NOSCRIPT":
|
|
1932
1931
|
break;
|
|
1933
1932
|
case "META":
|
|
1934
|
-
var key = ("property" /*
|
|
1935
|
-
"property" /*
|
|
1936
|
-
("name" /*
|
|
1937
|
-
if (key && "content" /*
|
|
1938
|
-
var content = attributes["content" /*
|
|
1933
|
+
var key = ("property" /* Property */ in attributes ?
|
|
1934
|
+
"property" /* Property */ :
|
|
1935
|
+
("name" /* Name */ in attributes ? "name" /* Name */ : null));
|
|
1936
|
+
if (key && "content" /* Content */ in attributes) {
|
|
1937
|
+
var content = attributes["content" /* Content */];
|
|
1939
1938
|
switch (attributes[key]) {
|
|
1940
|
-
case "og:title" /*
|
|
1941
|
-
log(20 /*
|
|
1939
|
+
case "og:title" /* ogTitle */:
|
|
1940
|
+
log(20 /* MetaTitle */, content);
|
|
1942
1941
|
break;
|
|
1943
|
-
case "og:type" /*
|
|
1944
|
-
log(19 /*
|
|
1942
|
+
case "og:type" /* ogType */:
|
|
1943
|
+
log(19 /* MetaType */, content);
|
|
1945
1944
|
break;
|
|
1946
|
-
case "generator" /*
|
|
1947
|
-
log(21 /*
|
|
1945
|
+
case "generator" /* Generator */:
|
|
1946
|
+
log(21 /* Generator */, content);
|
|
1948
1947
|
break;
|
|
1949
1948
|
}
|
|
1950
1949
|
}
|
|
@@ -1952,7 +1951,7 @@ function processNode (node, source) {
|
|
|
1952
1951
|
case "HEAD":
|
|
1953
1952
|
var head = { tag: tag, attributes: attributes };
|
|
1954
1953
|
if (location) {
|
|
1955
|
-
head.attributes["*B" /*
|
|
1954
|
+
head.attributes["*B" /* Base */] = location.protocol + "//" + location.hostname;
|
|
1956
1955
|
}
|
|
1957
1956
|
dom[call](node, parent, head, source);
|
|
1958
1957
|
break;
|
|
@@ -1965,7 +1964,7 @@ function processNode (node, source) {
|
|
|
1965
1964
|
var frameData = { tag: tag, attributes: attributes };
|
|
1966
1965
|
if (sameorigin(iframe$1)) {
|
|
1967
1966
|
monitor(iframe$1);
|
|
1968
|
-
frameData.attributes["*O" /*
|
|
1967
|
+
frameData.attributes["*O" /* SameOrigin */] = "true";
|
|
1969
1968
|
if (iframe$1.contentDocument && iframe$1.contentWindow && iframe$1.contentDocument.readyState !== "loading") {
|
|
1970
1969
|
child = iframe$1.contentDocument;
|
|
1971
1970
|
}
|
|
@@ -1994,7 +1993,7 @@ function observe$3(root) {
|
|
|
1994
1993
|
function getStyleValue(style) {
|
|
1995
1994
|
// Call trim on the text content to ensure we do not process white spaces ( , \n, \r\n, \t, etc.)
|
|
1996
1995
|
// Also, check if stylesheet has any data-* attribute, if so process rules instead of looking up text
|
|
1997
|
-
var value = style.textContent ? style.textContent.trim() : "" /*
|
|
1996
|
+
var value = style.textContent ? style.textContent.trim() : "" /* Empty */;
|
|
1998
1997
|
var dataset = style.dataset ? Object.keys(style.dataset).length : 0;
|
|
1999
1998
|
if (value.length === 0 || dataset > 0) {
|
|
2000
1999
|
value = getCssRules(style.sheet);
|
|
@@ -2002,14 +2001,14 @@ function getStyleValue(style) {
|
|
|
2002
2001
|
return value;
|
|
2003
2002
|
}
|
|
2004
2003
|
function getCssRules(sheet) {
|
|
2005
|
-
var value = "" /*
|
|
2004
|
+
var value = "" /* Empty */;
|
|
2006
2005
|
var cssRules = null;
|
|
2007
2006
|
// Firefox throws a SecurityError when trying to access cssRules of a stylesheet from a different domain
|
|
2008
2007
|
try {
|
|
2009
2008
|
cssRules = sheet ? sheet.cssRules : [];
|
|
2010
2009
|
}
|
|
2011
2010
|
catch (e) {
|
|
2012
|
-
log$1(1 /*
|
|
2011
|
+
log$1(1 /* CssRules */, 1 /* Warning */, e ? e.name : null);
|
|
2013
2012
|
if (e && e.name !== "SecurityError") {
|
|
2014
2013
|
throw e;
|
|
2015
2014
|
}
|
|
@@ -2033,8 +2032,8 @@ function getAttributes(element) {
|
|
|
2033
2032
|
}
|
|
2034
2033
|
}
|
|
2035
2034
|
// For INPUT tags read the dynamic "value" property if an explicit "value" attribute is not set
|
|
2036
|
-
if (element.tagName === "INPUT" /*
|
|
2037
|
-
output["value" /*
|
|
2035
|
+
if (element.tagName === "INPUT" /* InputTag */ && !("value" /* Value */ in output) && element.value) {
|
|
2036
|
+
output["value" /* Value */] = element.value;
|
|
2038
2037
|
}
|
|
2039
2038
|
return output;
|
|
2040
2039
|
}
|
|
@@ -2056,13 +2055,13 @@ function traverse (root, timer, source) {
|
|
|
2056
2055
|
next = next.nextSibling;
|
|
2057
2056
|
}
|
|
2058
2057
|
state = state$8(timer);
|
|
2059
|
-
if (!(state === 0 /*
|
|
2058
|
+
if (!(state === 0 /* Wait */)) return [3 /*break*/, 3];
|
|
2060
2059
|
return [4 /*yield*/, suspend$1(timer)];
|
|
2061
2060
|
case 2:
|
|
2062
2061
|
state = _a.sent();
|
|
2063
2062
|
_a.label = 3;
|
|
2064
2063
|
case 3:
|
|
2065
|
-
if (state === 2 /*
|
|
2064
|
+
if (state === 2 /* Stop */) {
|
|
2066
2065
|
return [3 /*break*/, 4];
|
|
2067
2066
|
}
|
|
2068
2067
|
subnode = processNode(node, source);
|
|
@@ -2139,7 +2138,7 @@ function observe$2(node) {
|
|
|
2139
2138
|
// For this reason, we need to wire up mutations every time we see a new shadow dom.
|
|
2140
2139
|
// Also, wrap it inside a try / catch. In certain browsers (e.g. legacy Edge), observer on shadow dom can throw errors
|
|
2141
2140
|
try {
|
|
2142
|
-
var m = api("MutationObserver" /*
|
|
2141
|
+
var m = api("MutationObserver" /* MutationObserver */);
|
|
2143
2142
|
var observer = m in window ? new window[m](measure(handle$1)) : null;
|
|
2144
2143
|
if (observer) {
|
|
2145
2144
|
observer.observe(node, { attributes: true, childList: true, characterData: true, subtree: true });
|
|
@@ -2147,7 +2146,7 @@ function observe$2(node) {
|
|
|
2147
2146
|
}
|
|
2148
2147
|
}
|
|
2149
2148
|
catch (e) {
|
|
2150
|
-
log$1(2 /*
|
|
2149
|
+
log$1(2 /* MutationObserver */, 0 /* Info */, e ? e.name : null);
|
|
2151
2150
|
}
|
|
2152
2151
|
}
|
|
2153
2152
|
function monitor(frame) {
|
|
@@ -2155,7 +2154,7 @@ function monitor(frame) {
|
|
|
2155
2154
|
// This includes cases where iframe location is updated without explicitly updating src attribute
|
|
2156
2155
|
// E.g. iframe.contentWindow.location.href = "new-location";
|
|
2157
2156
|
if (has(frame) === false) {
|
|
2158
|
-
bind(frame, "load" /*
|
|
2157
|
+
bind(frame, "load" /* LoadEvent */, generate.bind(this, frame, "childList" /* ChildList */), true);
|
|
2159
2158
|
}
|
|
2160
2159
|
}
|
|
2161
2160
|
function stop$h() {
|
|
@@ -2173,14 +2172,14 @@ function stop$h() {
|
|
|
2173
2172
|
timeout$1 = null;
|
|
2174
2173
|
}
|
|
2175
2174
|
function active$2() {
|
|
2176
|
-
activePeriod = time() + 3000 /*
|
|
2175
|
+
activePeriod = time() + 3000 /* MutationActivePeriod */;
|
|
2177
2176
|
}
|
|
2178
2177
|
function handle$1(m) {
|
|
2179
2178
|
// Queue up mutation records for asynchronous processing
|
|
2180
2179
|
var now = time();
|
|
2181
|
-
track$6(6 /*
|
|
2180
|
+
track$6(6 /* Mutation */, now);
|
|
2182
2181
|
mutations.push({ time: now, mutations: m });
|
|
2183
|
-
schedule$1(process$2, 1 /*
|
|
2182
|
+
schedule$1(process$2, 1 /* High */).then(function () {
|
|
2184
2183
|
setTimeout(compute$7);
|
|
2185
2184
|
measure(compute$6)();
|
|
2186
2185
|
});
|
|
@@ -2191,7 +2190,7 @@ function process$2() {
|
|
|
2191
2190
|
return __generator(this, function (_b) {
|
|
2192
2191
|
switch (_b.label) {
|
|
2193
2192
|
case 0:
|
|
2194
|
-
timer = { id: id(), cost: 3 /*
|
|
2193
|
+
timer = { id: id(), cost: 3 /* LayoutCost */ };
|
|
2195
2194
|
start$w(timer);
|
|
2196
2195
|
_b.label = 1;
|
|
2197
2196
|
case 1:
|
|
@@ -2203,13 +2202,13 @@ function process$2() {
|
|
|
2203
2202
|
if (!(_i < _a.length)) return [3 /*break*/, 6];
|
|
2204
2203
|
mutation = _a[_i];
|
|
2205
2204
|
state = state$8(timer);
|
|
2206
|
-
if (!(state === 0 /*
|
|
2205
|
+
if (!(state === 0 /* Wait */)) return [3 /*break*/, 4];
|
|
2207
2206
|
return [4 /*yield*/, suspend$1(timer)];
|
|
2208
2207
|
case 3:
|
|
2209
2208
|
state = _b.sent();
|
|
2210
2209
|
_b.label = 4;
|
|
2211
2210
|
case 4:
|
|
2212
|
-
if (state === 2 /*
|
|
2211
|
+
if (state === 2 /* Stop */) {
|
|
2213
2212
|
return [3 /*break*/, 6];
|
|
2214
2213
|
}
|
|
2215
2214
|
target = mutation.target;
|
|
@@ -2221,17 +2220,17 @@ function process$2() {
|
|
|
2221
2220
|
parse$1(target);
|
|
2222
2221
|
}
|
|
2223
2222
|
switch (type) {
|
|
2224
|
-
case "attributes" /*
|
|
2225
|
-
processNode(target, 3 /*
|
|
2223
|
+
case "attributes" /* Attributes */:
|
|
2224
|
+
processNode(target, 3 /* Attributes */);
|
|
2226
2225
|
break;
|
|
2227
|
-
case "characterData" /*
|
|
2228
|
-
processNode(target, 4 /*
|
|
2226
|
+
case "characterData" /* CharacterData */:
|
|
2227
|
+
processNode(target, 4 /* CharacterData */);
|
|
2229
2228
|
break;
|
|
2230
|
-
case "childList" /*
|
|
2231
|
-
processNodeList(mutation.addedNodes, 1 /*
|
|
2232
|
-
processNodeList(mutation.removedNodes, 2 /*
|
|
2229
|
+
case "childList" /* ChildList */:
|
|
2230
|
+
processNodeList(mutation.addedNodes, 1 /* ChildListAdd */, timer);
|
|
2231
|
+
processNodeList(mutation.removedNodes, 2 /* ChildListRemove */, timer);
|
|
2233
2232
|
break;
|
|
2234
|
-
case "suspend" /*
|
|
2233
|
+
case "suspend" /* Suspend */:
|
|
2235
2234
|
value = get(target);
|
|
2236
2235
|
if (value) {
|
|
2237
2236
|
value.metadata.suspend = true;
|
|
@@ -2242,7 +2241,7 @@ function process$2() {
|
|
|
2242
2241
|
case 5:
|
|
2243
2242
|
_i++;
|
|
2244
2243
|
return [3 /*break*/, 2];
|
|
2245
|
-
case 6: return [4 /*yield*/, encode$4(6 /*
|
|
2244
|
+
case 6: return [4 /*yield*/, encode$4(6 /* Mutation */, timer, record.time)];
|
|
2246
2245
|
case 7:
|
|
2247
2246
|
_b.sent();
|
|
2248
2247
|
return [3 /*break*/, 1];
|
|
@@ -2256,11 +2255,11 @@ function process$2() {
|
|
|
2256
2255
|
function track$5(m, timer) {
|
|
2257
2256
|
var value = m.target ? get(m.target.parentNode) : null;
|
|
2258
2257
|
// Check if the parent is already discovered and that the parent is not the document root
|
|
2259
|
-
if (value && value.data.tag !== "HTML" /*
|
|
2258
|
+
if (value && value.data.tag !== "HTML" /* HTML */) {
|
|
2260
2259
|
var inactive = time() > activePeriod;
|
|
2261
2260
|
var target = get(m.target);
|
|
2262
2261
|
var element = target && target.selector ? target.selector.join() : m.target.nodeName;
|
|
2263
|
-
var parent_1 = value.selector ? value.selector.join() : "" /*
|
|
2262
|
+
var parent_1 = value.selector ? value.selector.join() : "" /* Empty */;
|
|
2264
2263
|
// We use selector, instead of id, to determine the key (signature for the mutation) because in some cases
|
|
2265
2264
|
// repeated mutations can cause elements to be destroyed and then recreated as new DOM nodes
|
|
2266
2265
|
// In those cases, IDs will change however the selector (which is relative to DOM xPath) remains the same
|
|
@@ -2269,20 +2268,20 @@ function track$5(m, timer) {
|
|
|
2269
2268
|
history$4[key] = key in history$4 ? history$4[key] : [0];
|
|
2270
2269
|
var h = history$4[key];
|
|
2271
2270
|
// Lookup any pending nodes queued up for removal, and process them now if we suspended a mutation before
|
|
2272
|
-
if (inactive === false && h[0] >= 10 /*
|
|
2273
|
-
processNodeList(h[1], 2 /*
|
|
2271
|
+
if (inactive === false && h[0] >= 10 /* MutationSuspendThreshold */) {
|
|
2272
|
+
processNodeList(h[1], 2 /* ChildListRemove */, timer);
|
|
2274
2273
|
}
|
|
2275
2274
|
// Update the counter
|
|
2276
2275
|
h[0] = inactive ? h[0] + 1 : 1;
|
|
2277
2276
|
// Return updated mutation type based on if we have already hit the threshold or not
|
|
2278
|
-
if (h[0] === 10 /*
|
|
2277
|
+
if (h[0] === 10 /* MutationSuspendThreshold */) {
|
|
2279
2278
|
// Store a reference to removedNodes so we can process them later
|
|
2280
2279
|
// when we resume mutations again on user interactions
|
|
2281
2280
|
h[1] = m.removedNodes;
|
|
2282
|
-
return "suspend" /*
|
|
2281
|
+
return "suspend" /* Suspend */;
|
|
2283
2282
|
}
|
|
2284
|
-
else if (h[0] > 10 /*
|
|
2285
|
-
return "" /*
|
|
2283
|
+
else if (h[0] > 10 /* MutationSuspendThreshold */) {
|
|
2284
|
+
return "" /* Empty */;
|
|
2286
2285
|
}
|
|
2287
2286
|
}
|
|
2288
2287
|
return m.type;
|
|
@@ -2305,18 +2304,18 @@ function processNodeList(list, source, timer) {
|
|
|
2305
2304
|
_a.label = 1;
|
|
2306
2305
|
case 1:
|
|
2307
2306
|
if (!(i < length)) return [3 /*break*/, 6];
|
|
2308
|
-
if (!(source === 1 /*
|
|
2307
|
+
if (!(source === 1 /* ChildListAdd */)) return [3 /*break*/, 2];
|
|
2309
2308
|
traverse(list[i], timer, source);
|
|
2310
2309
|
return [3 /*break*/, 5];
|
|
2311
2310
|
case 2:
|
|
2312
2311
|
state = state$8(timer);
|
|
2313
|
-
if (!(state === 0 /*
|
|
2312
|
+
if (!(state === 0 /* Wait */)) return [3 /*break*/, 4];
|
|
2314
2313
|
return [4 /*yield*/, suspend$1(timer)];
|
|
2315
2314
|
case 3:
|
|
2316
2315
|
state = _a.sent();
|
|
2317
2316
|
_a.label = 4;
|
|
2318
2317
|
case 4:
|
|
2319
|
-
if (state === 2 /*
|
|
2318
|
+
if (state === 2 /* Stop */) {
|
|
2320
2319
|
return [3 /*break*/, 6];
|
|
2321
2320
|
}
|
|
2322
2321
|
processNode(list[i], source);
|
|
@@ -2341,7 +2340,7 @@ function schedule(node, fragment) {
|
|
|
2341
2340
|
if (timeout$1) {
|
|
2342
2341
|
clearTimeout(timeout$1);
|
|
2343
2342
|
}
|
|
2344
|
-
timeout$1 = setTimeout(function () { trigger$1(fragment); }, 33 /*
|
|
2343
|
+
timeout$1 = setTimeout(function () { trigger$1(fragment); }, 33 /* LookAhead */);
|
|
2345
2344
|
return node;
|
|
2346
2345
|
}
|
|
2347
2346
|
function trigger$1(fragment) {
|
|
@@ -2354,7 +2353,7 @@ function trigger$1(fragment) {
|
|
|
2354
2353
|
if (shadowRoot && has(node)) {
|
|
2355
2354
|
continue;
|
|
2356
2355
|
}
|
|
2357
|
-
generate(node, shadowRoot || fragment ? "childList" /*
|
|
2356
|
+
generate(node, shadowRoot || fragment ? "childList" /* ChildList */ : "characterData" /* CharacterData */);
|
|
2358
2357
|
}
|
|
2359
2358
|
}
|
|
2360
2359
|
queue$2 = [];
|
|
@@ -2404,9 +2403,9 @@ function reset$7() {
|
|
|
2404
2403
|
hashMap = {};
|
|
2405
2404
|
override = [];
|
|
2406
2405
|
unmask = [];
|
|
2407
|
-
maskText = "address,password,contact" /*
|
|
2408
|
-
maskInput = "password,secret,pass,social,ssn,name,code,dob,cell,mob,contact,hidden,account,cvv,ccv,email,tel,phone,address,addr,card,zip" /*
|
|
2409
|
-
maskDisable = "radio,checkbox,range,button,reset,submit" /*
|
|
2406
|
+
maskText = "address,password,contact" /* Text */.split("," /* Comma */);
|
|
2407
|
+
maskInput = "password,secret,pass,social,ssn,name,code,dob,cell,mob,contact,hidden,account,cvv,ccv,email,tel,phone,address,addr,card,zip" /* Input */.split("," /* Comma */);
|
|
2408
|
+
maskDisable = "radio,checkbox,range,button,reset,submit" /* Disable */.split("," /* Comma */);
|
|
2410
2409
|
idMap = new WeakMap();
|
|
2411
2410
|
iframeMap = new WeakMap();
|
|
2412
2411
|
privacyMap = new WeakMap();
|
|
@@ -2422,19 +2421,19 @@ function parse$1(root, init) {
|
|
|
2422
2421
|
try {
|
|
2423
2422
|
// Parse unmask configuration into separate query selectors and override tokens as part of initialization
|
|
2424
2423
|
if (init) {
|
|
2425
|
-
config$1.unmask.forEach(function (x) { return x.indexOf("!" /*
|
|
2424
|
+
config$1.unmask.forEach(function (x) { return x.indexOf("!" /* Bang */) < 0 ? unmask.push(x) : override.push(x.substr(1)); });
|
|
2426
2425
|
}
|
|
2427
2426
|
// Since mutations may happen on leaf nodes too, e.g. text nodes, which may not support all selector APIs.
|
|
2428
2427
|
// We ensure that the root note supports querySelectorAll API before executing the code below to identify new regions.
|
|
2429
2428
|
if ("querySelectorAll" in root) {
|
|
2430
|
-
config$1.regions.forEach(function (x) { return root.querySelectorAll(x[1]).forEach(function (e) { return observe$1(e, ""
|
|
2431
|
-
config$1.mask.forEach(function (x) { return root.querySelectorAll(x).forEach(function (e) { return privacyMap.set(e, 3 /*
|
|
2429
|
+
config$1.regions.forEach(function (x) { return root.querySelectorAll(x[1]).forEach(function (e) { return observe$1(e, "" + x[0]); }); }); // Regions
|
|
2430
|
+
config$1.mask.forEach(function (x) { return root.querySelectorAll(x).forEach(function (e) { return privacyMap.set(e, 3 /* TextImage */); }); }); // Masked Elements
|
|
2432
2431
|
config$1.fraud.forEach(function (x) { return root.querySelectorAll(x[1]).forEach(function (e) { return fraudMap.set(e, x[0]); }); }); // Fraud Check
|
|
2433
|
-
unmask.forEach(function (x) { return root.querySelectorAll(x).forEach(function (e) { return privacyMap.set(e, 0 /*
|
|
2432
|
+
unmask.forEach(function (x) { return root.querySelectorAll(x).forEach(function (e) { return privacyMap.set(e, 0 /* None */); }); }); // Unmasked Elements
|
|
2434
2433
|
}
|
|
2435
2434
|
}
|
|
2436
2435
|
catch (e) {
|
|
2437
|
-
log$1(5 /*
|
|
2436
|
+
log$1(5 /* Selector */, 1 /* Warning */, e ? e.name : null);
|
|
2438
2437
|
}
|
|
2439
2438
|
}
|
|
2440
2439
|
function getId(node, autogen) {
|
|
@@ -2457,7 +2456,7 @@ function add(node, parent, data, source) {
|
|
|
2457
2456
|
var regionId = exists(node) ? id : null;
|
|
2458
2457
|
var fragmentId = null;
|
|
2459
2458
|
var fraudId = fraudMap.has(node) ? fraudMap.get(node) : null;
|
|
2460
|
-
var privacyId = config$1.content ? 1 /*
|
|
2459
|
+
var privacyId = config$1.content ? 1 /* Sensitive */ : 3 /* TextImage */;
|
|
2461
2460
|
if (parentId >= 0 && values[parentId]) {
|
|
2462
2461
|
parentValue = values[parentId];
|
|
2463
2462
|
parentValue.children.push(id);
|
|
@@ -2467,8 +2466,8 @@ function add(node, parent, data, source) {
|
|
|
2467
2466
|
privacyId = parentValue.metadata.privacy;
|
|
2468
2467
|
}
|
|
2469
2468
|
// If there's an explicit region attribute set on the element, use it to mark a region on the page
|
|
2470
|
-
if (data.attributes && "data-clarity-region" /*
|
|
2471
|
-
observe$1(node, data.attributes["data-clarity-region" /*
|
|
2469
|
+
if (data.attributes && "data-clarity-region" /* RegionData */ in data.attributes) {
|
|
2470
|
+
observe$1(node, data.attributes["data-clarity-region" /* RegionData */]);
|
|
2472
2471
|
regionId = id;
|
|
2473
2472
|
}
|
|
2474
2473
|
nodes[id] = node;
|
|
@@ -2546,7 +2545,7 @@ function update$1(node, parent, data, source) {
|
|
|
2546
2545
|
}
|
|
2547
2546
|
function sameorigin(node) {
|
|
2548
2547
|
var output = false;
|
|
2549
|
-
if (node.nodeType === Node.ELEMENT_NODE && node.tagName === "IFRAME" /*
|
|
2548
|
+
if (node.nodeType === Node.ELEMENT_NODE && node.tagName === "IFRAME" /* IFrameTag */) {
|
|
2550
2549
|
var frame = node;
|
|
2551
2550
|
// To determine if the iframe is same-origin or not, we try accessing it's contentDocument.
|
|
2552
2551
|
// If the browser throws an exception, we assume it's cross-origin and move on.
|
|
@@ -2573,11 +2572,11 @@ function privacy(node, value, parent) {
|
|
|
2573
2572
|
var attributes = data.attributes || {};
|
|
2574
2573
|
var tag = data.tag.toUpperCase();
|
|
2575
2574
|
switch (true) {
|
|
2576
|
-
case "data-clarity-mask" /*
|
|
2577
|
-
metadata.privacy = 3 /*
|
|
2575
|
+
case "data-clarity-mask" /* MaskData */ in attributes:
|
|
2576
|
+
metadata.privacy = 3 /* TextImage */;
|
|
2578
2577
|
break;
|
|
2579
|
-
case "data-clarity-unmask" /*
|
|
2580
|
-
metadata.privacy = 0 /*
|
|
2578
|
+
case "data-clarity-unmask" /* UnmaskData */ in attributes:
|
|
2579
|
+
metadata.privacy = 0 /* None */;
|
|
2581
2580
|
break;
|
|
2582
2581
|
case privacyMap.has(node):
|
|
2583
2582
|
// If this node was explicitly configured to contain sensitive content, honor that privacy setting
|
|
@@ -2585,38 +2584,38 @@ function privacy(node, value, parent) {
|
|
|
2585
2584
|
break;
|
|
2586
2585
|
case fraudMap.has(node):
|
|
2587
2586
|
// If this node was explicitly configured to be evaluated for fraud, then also mask content
|
|
2588
|
-
metadata.privacy = 2 /*
|
|
2587
|
+
metadata.privacy = 2 /* Text */;
|
|
2589
2588
|
break;
|
|
2590
|
-
case tag === "*T" /*
|
|
2589
|
+
case tag === "*T" /* TextTag */:
|
|
2591
2590
|
// If it's a text node belonging to a STYLE or TITLE tag or one of scrub exceptions, then capture content
|
|
2592
|
-
var pTag = parent && parent.data ? parent.data.tag : "" /*
|
|
2593
|
-
var pSelector_1 = parent && parent.selector ? parent.selector[1 /*
|
|
2594
|
-
var tags = ["STYLE" /*
|
|
2595
|
-
metadata.privacy = tags.includes(pTag) || override.some(function (x) { return pSelector_1.indexOf(x) >= 0; }) ? 0 /*
|
|
2591
|
+
var pTag = parent && parent.data ? parent.data.tag : "" /* Empty */;
|
|
2592
|
+
var pSelector_1 = parent && parent.selector ? parent.selector[1 /* Default */] : "" /* Empty */;
|
|
2593
|
+
var tags = ["STYLE" /* StyleTag */, "TITLE" /* TitleTag */, "svg:style" /* SvgStyle */];
|
|
2594
|
+
metadata.privacy = tags.includes(pTag) || override.some(function (x) { return pSelector_1.indexOf(x) >= 0; }) ? 0 /* None */ : current;
|
|
2596
2595
|
break;
|
|
2597
|
-
case tag === "INPUT" /*
|
|
2596
|
+
case tag === "INPUT" /* InputTag */ && current === 0 /* None */:
|
|
2598
2597
|
// If even default privacy setting is to not mask, we still scan through input fields for any sensitive information
|
|
2599
|
-
var field_1 = "" /*
|
|
2598
|
+
var field_1 = "" /* Empty */;
|
|
2600
2599
|
Object.keys(attributes).forEach(function (x) { return field_1 += attributes[x].toLowerCase(); });
|
|
2601
2600
|
metadata.privacy = inspect(field_1, maskInput, metadata);
|
|
2602
2601
|
break;
|
|
2603
|
-
case tag === "INPUT" /*
|
|
2602
|
+
case tag === "INPUT" /* InputTag */ && current === 1 /* Sensitive */:
|
|
2604
2603
|
// Look through class names to aggressively mask content
|
|
2605
|
-
metadata.privacy = inspect(attributes["class" /*
|
|
2604
|
+
metadata.privacy = inspect(attributes["class" /* Class */], maskText, metadata);
|
|
2606
2605
|
// If this node has an explicit type assigned to it, go through masking rules to determine right privacy setting
|
|
2607
|
-
metadata.privacy = inspect(attributes["type" /*
|
|
2606
|
+
metadata.privacy = inspect(attributes["type" /* Type */], maskInput, metadata);
|
|
2608
2607
|
// If it's a button or an input option, make an exception to disable masking in sensitive mode
|
|
2609
|
-
metadata.privacy = maskDisable.indexOf(attributes["type" /*
|
|
2608
|
+
metadata.privacy = maskDisable.indexOf(attributes["type" /* Type */]) >= 0 ? 0 /* None */ : metadata.privacy;
|
|
2610
2609
|
break;
|
|
2611
|
-
case current === 1 /*
|
|
2610
|
+
case current === 1 /* Sensitive */:
|
|
2612
2611
|
// In a mode where we mask sensitive information by default, look through class names to aggressively mask content
|
|
2613
|
-
metadata.privacy = inspect(attributes["class" /*
|
|
2612
|
+
metadata.privacy = inspect(attributes["class" /* Class */], maskText, metadata);
|
|
2614
2613
|
break;
|
|
2615
2614
|
}
|
|
2616
2615
|
}
|
|
2617
2616
|
function inspect(input, lookup, metadata) {
|
|
2618
2617
|
if (input && lookup.some(function (x) { return input.indexOf(x) >= 0; })) {
|
|
2619
|
-
return 2 /*
|
|
2618
|
+
return 2 /* Text */;
|
|
2620
2619
|
}
|
|
2621
2620
|
return metadata.privacy;
|
|
2622
2621
|
}
|
|
@@ -2654,7 +2653,7 @@ function updateSelector(value) {
|
|
|
2654
2653
|
var d = value.data;
|
|
2655
2654
|
var p = position(parent, value);
|
|
2656
2655
|
var s = { id: value.id, tag: d.tag, prefix: prefix, position: p, attributes: d.attributes };
|
|
2657
|
-
value.selector = [get$1(s, 0 /*
|
|
2656
|
+
value.selector = [get$1(s, 0 /* Alpha */), get$1(s, 1 /* Beta */)];
|
|
2658
2657
|
value.hash = value.selector.map(function (x) { return x ? hash(x) : null; });
|
|
2659
2658
|
value.hash.forEach(function (h) { return hashMap[h] = value.id; });
|
|
2660
2659
|
// Match fragment configuration against both alpha and beta hash
|
|
@@ -2709,7 +2708,7 @@ function remove(id, source) {
|
|
|
2709
2708
|
}
|
|
2710
2709
|
function size(value) {
|
|
2711
2710
|
// If this element is a image node, and is masked, then track box model for the current element
|
|
2712
|
-
if (value.data.tag === "IMG" /*
|
|
2711
|
+
if (value.data.tag === "IMG" /* ImageTag */ && value.metadata.privacy === 3 /* TextImage */) {
|
|
2713
2712
|
value.metadata.size = [];
|
|
2714
2713
|
}
|
|
2715
2714
|
}
|
|
@@ -2744,7 +2743,7 @@ function track$4(id, source, fragment, changed, parentChanged) {
|
|
|
2744
2743
|
// Edge case: If an element is added later on, and pre-discovered element is moved as a child.
|
|
2745
2744
|
// In that case, we need to reorder the pre-discovered element in the update list to keep visualization consistent.
|
|
2746
2745
|
var uIndex = updateMap.indexOf(id);
|
|
2747
|
-
if (uIndex >= 0 && source === 1 /*
|
|
2746
|
+
if (uIndex >= 0 && source === 1 /* ChildListAdd */ && parentChanged) {
|
|
2748
2747
|
updateMap.splice(uIndex, 1);
|
|
2749
2748
|
updateMap.push(id);
|
|
2750
2749
|
}
|
|
@@ -2790,15 +2789,15 @@ function exists(node) {
|
|
|
2790
2789
|
}
|
|
2791
2790
|
function track$3(id, event) {
|
|
2792
2791
|
var node = getNode(id);
|
|
2793
|
-
var data = id in regions ? regions[id] : { id: id, visibility: 0 /*
|
|
2792
|
+
var data = id in regions ? regions[id] : { id: id, visibility: 0 /* Rendered */, interaction: 16 /* None */, name: regionMap.get(node) };
|
|
2794
2793
|
// Determine the interaction state based on incoming event
|
|
2795
|
-
var interaction = 16 /*
|
|
2794
|
+
var interaction = 16 /* None */;
|
|
2796
2795
|
switch (event) {
|
|
2797
|
-
case 9 /*
|
|
2798
|
-
interaction = 20 /*
|
|
2796
|
+
case 9 /* Click */:
|
|
2797
|
+
interaction = 20 /* Clicked */;
|
|
2799
2798
|
break;
|
|
2800
|
-
case 27 /*
|
|
2801
|
-
interaction = 30 /*
|
|
2799
|
+
case 27 /* Input */:
|
|
2800
|
+
interaction = 30 /* Input */;
|
|
2802
2801
|
break;
|
|
2803
2802
|
}
|
|
2804
2803
|
// Process updates to this region, if applicable
|
|
@@ -2826,7 +2825,7 @@ function compute$6() {
|
|
|
2826
2825
|
queue$1 = q;
|
|
2827
2826
|
// Schedule encode only when we have at least one valid data entry
|
|
2828
2827
|
if (state$1.length > 0) {
|
|
2829
|
-
encode$4(7 /*
|
|
2828
|
+
encode$4(7 /* Region */);
|
|
2830
2829
|
}
|
|
2831
2830
|
}
|
|
2832
2831
|
function handler$1(entries) {
|
|
@@ -2842,27 +2841,27 @@ function handler$1(entries) {
|
|
|
2842
2841
|
// 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
|
|
2843
2842
|
if (regionMap.has(target) && rect.width + rect.height > 0 && viewport.width > 0 && viewport.height > 0) {
|
|
2844
2843
|
var id = target ? getId(target) : null;
|
|
2845
|
-
var data = id in regions ? regions[id] : { id: id, name: regionMap.get(target), interaction: 16 /*
|
|
2844
|
+
var data = id in regions ? regions[id] : { id: id, name: regionMap.get(target), interaction: 16 /* None */, visibility: 0 /* Rendered */ };
|
|
2846
2845
|
// For regions that have relatively smaller area, we look at intersection ratio and see the overlap relative to element's area
|
|
2847
2846
|
// However, for larger regions, area of regions could be bigger than viewport and therefore comparison is relative to visible area
|
|
2848
2847
|
var viewportRatio = overlap ? (overlap.width * overlap.height * 1.0) / (viewport.width * viewport.height) : 0;
|
|
2849
|
-
var visible = viewportRatio > 0.05 /*
|
|
2848
|
+
var visible = viewportRatio > 0.05 /* ViewportIntersectionRatio */ || entry.intersectionRatio > 0.8 /* IntersectionRatio */;
|
|
2850
2849
|
// If an element is either visible or was visible and has been scrolled to the end
|
|
2851
2850
|
// 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.
|
|
2852
2851
|
// 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
|
|
2853
|
-
var scrolledToEnd = (visible || data.visibility == 10 /*
|
|
2852
|
+
var scrolledToEnd = (visible || data.visibility == 10 /* Visible */) && Math.abs(rect.top) + viewport.height > rect.height;
|
|
2854
2853
|
// Process updates to this region, if applicable
|
|
2855
2854
|
process$1(target, data, data.interaction, (scrolledToEnd ?
|
|
2856
|
-
13 /*
|
|
2857
|
-
(visible ? 10 /*
|
|
2855
|
+
13 /* ScrolledToEnd */ :
|
|
2856
|
+
(visible ? 10 /* Visible */ : 0 /* Rendered */)));
|
|
2858
2857
|
// Stop observing this element now that we have already received scrolled signal
|
|
2859
|
-
if (data.visibility >= 13 /*
|
|
2858
|
+
if (data.visibility >= 13 /* ScrolledToEnd */ && observer$1) {
|
|
2860
2859
|
observer$1.unobserve(target);
|
|
2861
2860
|
}
|
|
2862
2861
|
}
|
|
2863
2862
|
}
|
|
2864
2863
|
if (state$1.length > 0) {
|
|
2865
|
-
encode$4(7 /*
|
|
2864
|
+
encode$4(7 /* Region */);
|
|
2866
2865
|
}
|
|
2867
2866
|
}
|
|
2868
2867
|
function process$1(n, d, s, v) {
|
|
@@ -2921,7 +2920,7 @@ function link(node) {
|
|
|
2921
2920
|
function metadata$2(node, event, text) {
|
|
2922
2921
|
if (text === void 0) { text = null; }
|
|
2923
2922
|
// If the node is null, we return a reserved value for id: 0. Valid assignment of id begins from 1+.
|
|
2924
|
-
var output = { id: 0, hash: null, privacy: 2 /*
|
|
2923
|
+
var output = { id: 0, hash: null, privacy: 2 /* Text */, node: node };
|
|
2925
2924
|
if (node) {
|
|
2926
2925
|
var value = get(node);
|
|
2927
2926
|
if (value !== null) {
|
|
@@ -2947,15 +2946,15 @@ function encode$3 (type) {
|
|
|
2947
2946
|
t = time();
|
|
2948
2947
|
tokens = [t, type];
|
|
2949
2948
|
switch (type) {
|
|
2950
|
-
case 13 /*
|
|
2951
|
-
case 14 /*
|
|
2952
|
-
case 12 /*
|
|
2953
|
-
case 15 /*
|
|
2954
|
-
case 16 /*
|
|
2955
|
-
case 17 /*
|
|
2956
|
-
case 18 /*
|
|
2957
|
-
case 19 /*
|
|
2958
|
-
case 20 /*
|
|
2949
|
+
case 13 /* MouseDown */:
|
|
2950
|
+
case 14 /* MouseUp */:
|
|
2951
|
+
case 12 /* MouseMove */:
|
|
2952
|
+
case 15 /* MouseWheel */:
|
|
2953
|
+
case 16 /* DoubleClick */:
|
|
2954
|
+
case 17 /* TouchStart */:
|
|
2955
|
+
case 18 /* TouchEnd */:
|
|
2956
|
+
case 19 /* TouchMove */:
|
|
2957
|
+
case 20 /* TouchCancel */:
|
|
2959
2958
|
for (_i = 0, _a = state$4; _i < _a.length; _i++) {
|
|
2960
2959
|
entry = _a[_i];
|
|
2961
2960
|
pTarget = metadata$2(entry.data.target, entry.event);
|
|
@@ -2970,12 +2969,12 @@ function encode$3 (type) {
|
|
|
2970
2969
|
}
|
|
2971
2970
|
reset$e();
|
|
2972
2971
|
break;
|
|
2973
|
-
case 9 /*
|
|
2972
|
+
case 9 /* Click */:
|
|
2974
2973
|
for (_b = 0, _c = state$7; _b < _c.length; _b++) {
|
|
2975
2974
|
entry = _c[_b];
|
|
2976
2975
|
cTarget = metadata$2(entry.data.target, entry.event, entry.data.text);
|
|
2977
2976
|
tokens = [entry.time, entry.event];
|
|
2978
|
-
cHash = cTarget.hash.join("." /*
|
|
2977
|
+
cHash = cTarget.hash.join("." /* Dot */);
|
|
2979
2978
|
tokens.push(cTarget.id);
|
|
2980
2979
|
tokens.push(entry.data.x);
|
|
2981
2980
|
tokens.push(entry.data.y);
|
|
@@ -2993,7 +2992,7 @@ function encode$3 (type) {
|
|
|
2993
2992
|
}
|
|
2994
2993
|
reset$h();
|
|
2995
2994
|
break;
|
|
2996
|
-
case 38 /*
|
|
2995
|
+
case 38 /* Clipboard */:
|
|
2997
2996
|
for (_d = 0, _e = state$6; _d < _e.length; _d++) {
|
|
2998
2997
|
entry = _e[_d];
|
|
2999
2998
|
tokens = [entry.time, entry.event];
|
|
@@ -3006,7 +3005,7 @@ function encode$3 (type) {
|
|
|
3006
3005
|
}
|
|
3007
3006
|
reset$g();
|
|
3008
3007
|
break;
|
|
3009
|
-
case 11 /*
|
|
3008
|
+
case 11 /* Resize */:
|
|
3010
3009
|
r = data$b;
|
|
3011
3010
|
tokens.push(r.width);
|
|
3012
3011
|
tokens.push(r.height);
|
|
@@ -3014,13 +3013,13 @@ function encode$3 (type) {
|
|
|
3014
3013
|
reset$d();
|
|
3015
3014
|
queue(tokens);
|
|
3016
3015
|
break;
|
|
3017
|
-
case 26 /*
|
|
3016
|
+
case 26 /* Unload */:
|
|
3018
3017
|
u = data$9;
|
|
3019
3018
|
tokens.push(u.name);
|
|
3020
3019
|
reset$9();
|
|
3021
3020
|
queue(tokens);
|
|
3022
3021
|
break;
|
|
3023
|
-
case 27 /*
|
|
3022
|
+
case 27 /* Input */:
|
|
3024
3023
|
for (_f = 0, _g = state$5; _f < _g.length; _f++) {
|
|
3025
3024
|
entry = _g[_f];
|
|
3026
3025
|
iTarget = metadata$2(entry.data.target, entry.event, entry.data.value);
|
|
@@ -3031,7 +3030,7 @@ function encode$3 (type) {
|
|
|
3031
3030
|
}
|
|
3032
3031
|
reset$f();
|
|
3033
3032
|
break;
|
|
3034
|
-
case 21 /*
|
|
3033
|
+
case 21 /* Selection */:
|
|
3035
3034
|
s = data$a;
|
|
3036
3035
|
if (s) {
|
|
3037
3036
|
startTarget = metadata$2(s.start, type);
|
|
@@ -3044,7 +3043,7 @@ function encode$3 (type) {
|
|
|
3044
3043
|
queue(tokens);
|
|
3045
3044
|
}
|
|
3046
3045
|
break;
|
|
3047
|
-
case 10 /*
|
|
3046
|
+
case 10 /* Scroll */:
|
|
3048
3047
|
for (_h = 0, _j = state$3; _h < _j.length; _h++) {
|
|
3049
3048
|
entry = _j[_h];
|
|
3050
3049
|
sTarget = metadata$2(entry.data.target, entry.event);
|
|
@@ -3059,7 +3058,7 @@ function encode$3 (type) {
|
|
|
3059
3058
|
}
|
|
3060
3059
|
reset$c();
|
|
3061
3060
|
break;
|
|
3062
|
-
case 39 /*
|
|
3061
|
+
case 39 /* Submit */:
|
|
3063
3062
|
for (_k = 0, _l = state$2; _k < _l.length; _k++) {
|
|
3064
3063
|
entry = _l[_k];
|
|
3065
3064
|
tokens = [entry.time, entry.event];
|
|
@@ -3071,7 +3070,7 @@ function encode$3 (type) {
|
|
|
3071
3070
|
}
|
|
3072
3071
|
reset$a();
|
|
3073
3072
|
break;
|
|
3074
|
-
case 22 /*
|
|
3073
|
+
case 22 /* Timeline */:
|
|
3075
3074
|
for (_m = 0, _o = updates$1; _m < _o.length; _m++) {
|
|
3076
3075
|
entry = _o[_m];
|
|
3077
3076
|
tokens = [entry.time, entry.event];
|
|
@@ -3085,7 +3084,7 @@ function encode$3 (type) {
|
|
|
3085
3084
|
}
|
|
3086
3085
|
reset$5();
|
|
3087
3086
|
break;
|
|
3088
|
-
case 28 /*
|
|
3087
|
+
case 28 /* Visibility */:
|
|
3089
3088
|
v = data$8;
|
|
3090
3089
|
tokens.push(v.visible);
|
|
3091
3090
|
queue(tokens);
|
|
@@ -3108,11 +3107,11 @@ function reset$5() {
|
|
|
3108
3107
|
updates$1 = [];
|
|
3109
3108
|
}
|
|
3110
3109
|
function track$2(time, event, hash, x, y, reaction, context) {
|
|
3111
|
-
if (reaction === void 0) { reaction = 1 /*
|
|
3112
|
-
if (context === void 0) { context = 0 /*
|
|
3110
|
+
if (reaction === void 0) { reaction = 1 /* True */; }
|
|
3111
|
+
if (context === void 0) { context = 0 /* Self */; }
|
|
3113
3112
|
state.push({
|
|
3114
3113
|
time: time,
|
|
3115
|
-
event: 22 /*
|
|
3114
|
+
event: 22 /* Timeline */,
|
|
3116
3115
|
data: {
|
|
3117
3116
|
type: event,
|
|
3118
3117
|
hash: hash,
|
|
@@ -3131,7 +3130,7 @@ function compute$5() {
|
|
|
3131
3130
|
var temp = [];
|
|
3132
3131
|
updates$1 = [];
|
|
3133
3132
|
var max = data$1.start + data$1.duration;
|
|
3134
|
-
var min = Math.max(max - 2000 /*
|
|
3133
|
+
var min = Math.max(max - 2000 /* TimelineSpan */, 0);
|
|
3135
3134
|
for (var _i = 0, state_1 = state; _i < state_1.length; _i++) {
|
|
3136
3135
|
var s = state_1[_i];
|
|
3137
3136
|
if (s.time >= min) {
|
|
@@ -3142,7 +3141,7 @@ function compute$5() {
|
|
|
3142
3141
|
}
|
|
3143
3142
|
}
|
|
3144
3143
|
state = temp; // Drop events less than the min time
|
|
3145
|
-
encode$3(22 /*
|
|
3144
|
+
encode$3(22 /* Timeline */);
|
|
3146
3145
|
}
|
|
3147
3146
|
function stop$e() {
|
|
3148
3147
|
state = [];
|
|
@@ -3175,10 +3174,10 @@ function queue(tokens, transmit) {
|
|
|
3175
3174
|
var type = tokens.length > 1 ? tokens[1] : null;
|
|
3176
3175
|
var event_1 = JSON.stringify(tokens);
|
|
3177
3176
|
switch (type) {
|
|
3178
|
-
case 5 /*
|
|
3177
|
+
case 5 /* Discover */:
|
|
3179
3178
|
discoverBytes += event_1.length;
|
|
3180
|
-
case 37 /*
|
|
3181
|
-
case 6 /*
|
|
3179
|
+
case 37 /* Box */:
|
|
3180
|
+
case 6 /* Mutation */:
|
|
3182
3181
|
playbackBytes += event_1.length;
|
|
3183
3182
|
playback.push(event_1);
|
|
3184
3183
|
break;
|
|
@@ -3187,7 +3186,7 @@ function queue(tokens, transmit) {
|
|
|
3187
3186
|
break;
|
|
3188
3187
|
}
|
|
3189
3188
|
// Increment event count metric
|
|
3190
|
-
count$1(25 /*
|
|
3189
|
+
count$1(25 /* EventCount */);
|
|
3191
3190
|
// Following two checks are precautionary and act as a fail safe mechanism to get out of unexpected situations.
|
|
3192
3191
|
// Check 1: If for any reason the upload hasn't happened after waiting for 2x the config.delay time,
|
|
3193
3192
|
// reset the timer. This allows Clarity to attempt an upload again.
|
|
@@ -3200,7 +3199,7 @@ function queue(tokens, transmit) {
|
|
|
3200
3199
|
// However, in certain scenarios - like metric calculation - which are triggered as part of an existing upload
|
|
3201
3200
|
// We enrich the data going out with the existing upload. In these cases, call to upload comes with 'transmit' set to false.
|
|
3202
3201
|
if (transmit && timeout === null) {
|
|
3203
|
-
if (type !== 25 /*
|
|
3202
|
+
if (type !== 25 /* Ping */) {
|
|
3204
3203
|
reset$n();
|
|
3205
3204
|
}
|
|
3206
3205
|
timeout = setTimeout(upload, gap);
|
|
@@ -3229,9 +3228,9 @@ function upload(final) {
|
|
|
3229
3228
|
switch (_b.label) {
|
|
3230
3229
|
case 0:
|
|
3231
3230
|
timeout = null;
|
|
3232
|
-
sendPlaybackBytes = config$1.lean === false && playbackBytes > 0 && (playbackBytes < 1048576 /*
|
|
3231
|
+
sendPlaybackBytes = config$1.lean === false && playbackBytes > 0 && (playbackBytes < 1048576 /* MaxFirstPayloadBytes */ || data$1.sequence > 0);
|
|
3233
3232
|
if (sendPlaybackBytes) {
|
|
3234
|
-
max(1 /*
|
|
3233
|
+
max(1 /* Playback */, 1 /* True */);
|
|
3235
3234
|
}
|
|
3236
3235
|
// CAUTION: Ensure "transmit" is set to false in the queue function for following events
|
|
3237
3236
|
// Otherwise you run a risk of infinite loop.
|
|
@@ -3240,8 +3239,8 @@ function upload(final) {
|
|
|
3240
3239
|
compute$8();
|
|
3241
3240
|
last = final === true;
|
|
3242
3241
|
e = JSON.stringify(envelope(last));
|
|
3243
|
-
a = "["
|
|
3244
|
-
p = sendPlaybackBytes ? "["
|
|
3242
|
+
a = "[" + analysis.join() + "]";
|
|
3243
|
+
p = sendPlaybackBytes ? "[" + playback.join() + "]" : "" /* Empty */;
|
|
3245
3244
|
encoded = { e: e, a: a, p: p };
|
|
3246
3245
|
payload = stringify(encoded);
|
|
3247
3246
|
if (!last) return [3 /*break*/, 1];
|
|
@@ -3253,7 +3252,7 @@ function upload(final) {
|
|
|
3253
3252
|
_b.label = 3;
|
|
3254
3253
|
case 3:
|
|
3255
3254
|
zipped = _a;
|
|
3256
|
-
sum(2 /*
|
|
3255
|
+
sum(2 /* TotalBytes */, zipped ? zipped.length : payload.length);
|
|
3257
3256
|
send(payload, zipped, data$1.sequence, last);
|
|
3258
3257
|
// Clear out events now that payload has been dispatched
|
|
3259
3258
|
analysis = [];
|
|
@@ -3268,12 +3267,12 @@ function upload(final) {
|
|
|
3268
3267
|
});
|
|
3269
3268
|
}
|
|
3270
3269
|
function stringify(encoded) {
|
|
3271
|
-
return encoded.p.length > 0 ? "{\"e\":"
|
|
3270
|
+
return encoded.p.length > 0 ? "{\"e\":" + encoded.e + ",\"a\":" + encoded.a + ",\"p\":" + encoded.p + "}" : "{\"e\":" + encoded.e + ",\"a\":" + encoded.a + "}";
|
|
3272
3271
|
}
|
|
3273
3272
|
function send(payload, zipped, sequence, beacon) {
|
|
3274
3273
|
if (beacon === void 0) { beacon = false; }
|
|
3275
3274
|
// Upload data if a valid URL is defined in the config
|
|
3276
|
-
if (typeof config$1.upload === "string" /*
|
|
3275
|
+
if (typeof config$1.upload === "string" /* String */) {
|
|
3277
3276
|
var url = config$1.upload;
|
|
3278
3277
|
var dispatched = false;
|
|
3279
3278
|
// If it's the last payload, attempt to upload using sendBeacon first.
|
|
@@ -3312,7 +3311,7 @@ function send(payload, zipped, sequence, beacon) {
|
|
|
3312
3311
|
xhr_1.withCredentials = true;
|
|
3313
3312
|
if (zipped) {
|
|
3314
3313
|
// If we do have valid compressed array, send it with appropriate HTTP headers so server can decode it appropriately
|
|
3315
|
-
xhr_1.setRequestHeader("Accept" /*
|
|
3314
|
+
xhr_1.setRequestHeader("Accept" /* Accept */, "application/x-clarity-gzip" /* ClarityGzip */);
|
|
3316
3315
|
xhr_1.send(zipped);
|
|
3317
3316
|
}
|
|
3318
3317
|
else {
|
|
@@ -3329,13 +3328,13 @@ function send(payload, zipped, sequence, beacon) {
|
|
|
3329
3328
|
}
|
|
3330
3329
|
function check$3(xhr, sequence) {
|
|
3331
3330
|
var transitData = transit[sequence];
|
|
3332
|
-
if (xhr && xhr.readyState === 4 /*
|
|
3331
|
+
if (xhr && xhr.readyState === 4 /* Done */ && transitData) {
|
|
3333
3332
|
// Attempt send payload again (as configured in settings) if we do not receive a success (2XX) response code back from the server
|
|
3334
|
-
if ((xhr.status < 200 || xhr.status > 208) && transitData.attempts <= 1 /*
|
|
3333
|
+
if ((xhr.status < 200 || xhr.status > 208) && transitData.attempts <= 1 /* RetryLimit */) {
|
|
3335
3334
|
// We re-attempt in all cases except when server explicitly rejects our request with 4XX error
|
|
3336
3335
|
if (xhr.status >= 400 && xhr.status < 500) {
|
|
3337
3336
|
// In case of a 4XX response from the server, we bail out instead of trying again
|
|
3338
|
-
trigger(6 /*
|
|
3337
|
+
trigger(6 /* Server */);
|
|
3339
3338
|
}
|
|
3340
3339
|
else {
|
|
3341
3340
|
// Browser will send status = 0 when it refuses to put network request over the wire
|
|
@@ -3356,7 +3355,7 @@ function check$3(xhr, sequence) {
|
|
|
3356
3355
|
track$1 = { sequence: sequence, attempts: transitData.attempts, status: xhr.status };
|
|
3357
3356
|
// Send back an event only if we were not successful in our first attempt
|
|
3358
3357
|
if (transitData.attempts > 1) {
|
|
3359
|
-
encode$1(2 /*
|
|
3358
|
+
encode$1(2 /* Upload */);
|
|
3360
3359
|
}
|
|
3361
3360
|
// Handle response if it was a 200 response with a valid body
|
|
3362
3361
|
if (xhr.status === 200 && xhr.responseText) {
|
|
@@ -3367,7 +3366,7 @@ function check$3(xhr, sequence) {
|
|
|
3367
3366
|
// And, right before we terminate the session, we will attempt one last time to see if we can use
|
|
3368
3367
|
// different transport option (sendBeacon vs. XHR) to get this data to the server for analysis purposes
|
|
3369
3368
|
send(transitData.data, null, sequence, true);
|
|
3370
|
-
trigger(3 /*
|
|
3369
|
+
trigger(3 /* Retry */);
|
|
3371
3370
|
}
|
|
3372
3371
|
// Signal that this request completed successfully
|
|
3373
3372
|
if (xhr.status >= 200 && xhr.status <= 208) {
|
|
@@ -3387,21 +3386,21 @@ function done(sequence) {
|
|
|
3387
3386
|
function delay() {
|
|
3388
3387
|
// Progressively increase delay as we continue to send more payloads from the client to the server
|
|
3389
3388
|
// If we are not uploading data to a server, and instead invoking UploadCallback, in that case keep returning configured value
|
|
3390
|
-
var gap = config$1.lean === false && discoverBytes > 0 ? 100 /*
|
|
3391
|
-
return typeof config$1.upload === "string" /*
|
|
3389
|
+
var gap = config$1.lean === false && discoverBytes > 0 ? 100 /* MinUploadDelay */ : data$1.sequence * config$1.delay;
|
|
3390
|
+
return typeof config$1.upload === "string" /* String */ ? Math.max(Math.min(gap, 30000 /* MaxUploadDelay */), 100 /* MinUploadDelay */) : config$1.delay;
|
|
3392
3391
|
}
|
|
3393
3392
|
function response(payload) {
|
|
3394
|
-
var parts = payload && payload.length > 0 ? payload.split(" ") : ["" /*
|
|
3393
|
+
var parts = payload && payload.length > 0 ? payload.split(" ") : ["" /* Empty */];
|
|
3395
3394
|
switch (parts[0]) {
|
|
3396
|
-
case "END" /*
|
|
3395
|
+
case "END" /* End */:
|
|
3397
3396
|
// Clear out session storage and end the session so we can start fresh the next time
|
|
3398
|
-
trigger(6 /*
|
|
3397
|
+
trigger(6 /* Server */);
|
|
3399
3398
|
break;
|
|
3400
|
-
case "UPGRADE" /*
|
|
3399
|
+
case "UPGRADE" /* Upgrade */:
|
|
3401
3400
|
// Upgrade current session to send back playback information
|
|
3402
|
-
upgrade("Auto" /*
|
|
3401
|
+
upgrade("Auto" /* Auto */);
|
|
3403
3402
|
break;
|
|
3404
|
-
case "ACTION" /*
|
|
3403
|
+
case "ACTION" /* Action */:
|
|
3405
3404
|
// Invoke action callback, if configured and has a valid value
|
|
3406
3405
|
if (config$1.action && parts.length > 1) {
|
|
3407
3406
|
config$1.action(parts[1]);
|
|
@@ -3423,7 +3422,7 @@ function handler(error) {
|
|
|
3423
3422
|
if (!(e.message in history$3)) {
|
|
3424
3423
|
history$3[e.message] = 0;
|
|
3425
3424
|
}
|
|
3426
|
-
if (history$3[e.message]++ >= 5 /*
|
|
3425
|
+
if (history$3[e.message]++ >= 5 /* ScriptErrorLimit */) {
|
|
3427
3426
|
return true;
|
|
3428
3427
|
}
|
|
3429
3428
|
// Send back information only if the handled error has valid information
|
|
@@ -3435,7 +3434,7 @@ function handler(error) {
|
|
|
3435
3434
|
stack: e.stack,
|
|
3436
3435
|
source: error["filename"]
|
|
3437
3436
|
};
|
|
3438
|
-
encode$2(31 /*
|
|
3437
|
+
encode$2(31 /* ScriptError */);
|
|
3439
3438
|
}
|
|
3440
3439
|
return true;
|
|
3441
3440
|
}
|
|
@@ -3446,7 +3445,7 @@ function encode$2 (type) {
|
|
|
3446
3445
|
return __generator(this, function (_a) {
|
|
3447
3446
|
tokens = [time(), type];
|
|
3448
3447
|
switch (type) {
|
|
3449
|
-
case 31 /*
|
|
3448
|
+
case 31 /* ScriptError */:
|
|
3450
3449
|
tokens.push(data$7.message);
|
|
3451
3450
|
tokens.push(data$7.line);
|
|
3452
3451
|
tokens.push(data$7.column);
|
|
@@ -3454,7 +3453,7 @@ function encode$2 (type) {
|
|
|
3454
3453
|
tokens.push(data$7.source);
|
|
3455
3454
|
queue(tokens);
|
|
3456
3455
|
break;
|
|
3457
|
-
case 33 /*
|
|
3456
|
+
case 33 /* Log */:
|
|
3458
3457
|
if (data$6) {
|
|
3459
3458
|
tokens.push(data$6.code);
|
|
3460
3459
|
tokens.push(data$6.name);
|
|
@@ -3464,7 +3463,7 @@ function encode$2 (type) {
|
|
|
3464
3463
|
queue(tokens, false);
|
|
3465
3464
|
}
|
|
3466
3465
|
break;
|
|
3467
|
-
case 41 /*
|
|
3466
|
+
case 41 /* Fraud */:
|
|
3468
3467
|
if (data$d) {
|
|
3469
3468
|
tokens.push(data$d.id);
|
|
3470
3469
|
tokens.push(data$d.target);
|
|
@@ -3487,7 +3486,7 @@ function log$1(code, severity, name, message, stack) {
|
|
|
3487
3486
|
if (name === void 0) { name = null; }
|
|
3488
3487
|
if (message === void 0) { message = null; }
|
|
3489
3488
|
if (stack === void 0) { stack = null; }
|
|
3490
|
-
var key = name ?
|
|
3489
|
+
var key = name ? name + "|" + message : "";
|
|
3491
3490
|
// While rare, it's possible for code to fail repeatedly during the lifetime of the same page
|
|
3492
3491
|
// In those cases, we only want to log the failure once and not spam logs with redundant information.
|
|
3493
3492
|
if (code in history$2 && history$2[code].indexOf(key) >= 0) {
|
|
@@ -3501,7 +3500,7 @@ function log$1(code, severity, name, message, stack) {
|
|
|
3501
3500
|
else {
|
|
3502
3501
|
history$2[code] = [key];
|
|
3503
3502
|
}
|
|
3504
|
-
encode$2(33 /*
|
|
3503
|
+
encode$2(33 /* Log */);
|
|
3505
3504
|
}
|
|
3506
3505
|
function stop$c() {
|
|
3507
3506
|
history$2 = {};
|
|
@@ -3522,25 +3521,25 @@ function start$c() {
|
|
|
3522
3521
|
var source = e[i];
|
|
3523
3522
|
var key = e[i + 1];
|
|
3524
3523
|
switch (source) {
|
|
3525
|
-
case 0 /*
|
|
3524
|
+
case 0 /* Javascript */:
|
|
3526
3525
|
var variable = e[i + 2];
|
|
3527
3526
|
variables[key] = parse(variable);
|
|
3528
3527
|
break;
|
|
3529
|
-
case 1 /*
|
|
3528
|
+
case 1 /* Cookie */:
|
|
3530
3529
|
/*Todo: Add cookie extract logic*/
|
|
3531
3530
|
break;
|
|
3532
|
-
case 2 /*
|
|
3531
|
+
case 2 /* Text */:
|
|
3533
3532
|
var match_1 = e[i + 2];
|
|
3534
3533
|
selectors[key] = match_1;
|
|
3535
3534
|
break;
|
|
3536
|
-
case 3 /*
|
|
3535
|
+
case 3 /* Fragment */:
|
|
3537
3536
|
fragments = e[i + 2];
|
|
3538
3537
|
break;
|
|
3539
3538
|
}
|
|
3540
3539
|
}
|
|
3541
3540
|
}
|
|
3542
3541
|
catch (e) {
|
|
3543
|
-
log$1(8 /*
|
|
3542
|
+
log$1(8 /* Config */, 1 /* Warning */, e ? e.name : null);
|
|
3544
3543
|
}
|
|
3545
3544
|
}
|
|
3546
3545
|
function clone(v) {
|
|
@@ -3562,9 +3561,9 @@ function compute$4() {
|
|
|
3562
3561
|
}
|
|
3563
3562
|
}
|
|
3564
3563
|
catch (e) {
|
|
3565
|
-
log$1(5 /*
|
|
3564
|
+
log$1(5 /* Selector */, 1 /* Warning */, e ? e.name : null);
|
|
3566
3565
|
}
|
|
3567
|
-
encode$1(40 /*
|
|
3566
|
+
encode$1(40 /* Extract */);
|
|
3568
3567
|
}
|
|
3569
3568
|
function reset$4() {
|
|
3570
3569
|
keys = [];
|
|
@@ -3584,15 +3583,15 @@ function stop$b() {
|
|
|
3584
3583
|
}
|
|
3585
3584
|
function parse(variable) {
|
|
3586
3585
|
var syntax = [];
|
|
3587
|
-
var parts = variable.split("." /*
|
|
3586
|
+
var parts = variable.split("." /* Dot */);
|
|
3588
3587
|
while (parts.length > 0) {
|
|
3589
3588
|
var part = parts.shift();
|
|
3590
|
-
var arrayStart = part.indexOf("[" /*
|
|
3591
|
-
var conditionStart = part.indexOf("{" /*
|
|
3592
|
-
var conditionEnd = part.indexOf("}" /*
|
|
3589
|
+
var arrayStart = part.indexOf("[" /* ArrayStart */);
|
|
3590
|
+
var conditionStart = part.indexOf("{" /* ConditionStart */);
|
|
3591
|
+
var conditionEnd = part.indexOf("}" /* ConditionEnd */);
|
|
3593
3592
|
syntax.push({
|
|
3594
3593
|
name: arrayStart > 0 ? part.substring(0, arrayStart) : (conditionStart > 0 ? part.substring(0, conditionStart) : part),
|
|
3595
|
-
type: arrayStart > 0 ? 1 /*
|
|
3594
|
+
type: arrayStart > 0 ? 1 /* Array */ : (conditionStart > 0 ? 2 /* Object */ : 3 /* Simple */),
|
|
3596
3595
|
condition: conditionStart > 0 ? part.substring(conditionStart + 1, conditionEnd) : null
|
|
3597
3596
|
});
|
|
3598
3597
|
}
|
|
@@ -3610,7 +3609,7 @@ function evaluate(variable, base) {
|
|
|
3610
3609
|
var output;
|
|
3611
3610
|
if (base && base[part.name]) {
|
|
3612
3611
|
var obj = base[part.name];
|
|
3613
|
-
if (part.type !== 1 /*
|
|
3612
|
+
if (part.type !== 1 /* Array */ && match(obj, part.condition)) {
|
|
3614
3613
|
output = evaluate(variable, obj);
|
|
3615
3614
|
}
|
|
3616
3615
|
else if (Array.isArray(obj)) {
|
|
@@ -3632,7 +3631,7 @@ function evaluate(variable, base) {
|
|
|
3632
3631
|
}
|
|
3633
3632
|
function str(input) {
|
|
3634
3633
|
// Automatically trim string to max of Setting.ExtractLimit to avoid fetching long strings
|
|
3635
|
-
return input ? JSON.stringify(input).substring(0, 10000 /*
|
|
3634
|
+
return input ? JSON.stringify(input).substring(0, 10000 /* ExtractLimit */) : input;
|
|
3636
3635
|
}
|
|
3637
3636
|
function match(base, condition) {
|
|
3638
3637
|
if (condition) {
|
|
@@ -3646,7 +3645,7 @@ function encode$1 (event) {
|
|
|
3646
3645
|
var t = time();
|
|
3647
3646
|
var tokens = [t, event];
|
|
3648
3647
|
switch (event) {
|
|
3649
|
-
case 4 /*
|
|
3648
|
+
case 4 /* Baseline */:
|
|
3650
3649
|
var b = state$9;
|
|
3651
3650
|
if (b) {
|
|
3652
3651
|
tokens = [b.time, b.event];
|
|
@@ -3664,30 +3663,30 @@ function encode$1 (event) {
|
|
|
3664
3663
|
}
|
|
3665
3664
|
reset$p();
|
|
3666
3665
|
break;
|
|
3667
|
-
case 25 /*
|
|
3666
|
+
case 25 /* Ping */:
|
|
3668
3667
|
tokens.push(data$h.gap);
|
|
3669
3668
|
queue(tokens);
|
|
3670
3669
|
break;
|
|
3671
|
-
case 35 /*
|
|
3670
|
+
case 35 /* Limit */:
|
|
3672
3671
|
tokens.push(data$4.check);
|
|
3673
3672
|
queue(tokens, false);
|
|
3674
3673
|
break;
|
|
3675
|
-
case 3 /*
|
|
3674
|
+
case 3 /* Upgrade */:
|
|
3676
3675
|
tokens.push(data$f.key);
|
|
3677
3676
|
queue(tokens);
|
|
3678
3677
|
break;
|
|
3679
|
-
case 2 /*
|
|
3678
|
+
case 2 /* Upload */:
|
|
3680
3679
|
tokens.push(track$1.sequence);
|
|
3681
3680
|
tokens.push(track$1.attempts);
|
|
3682
3681
|
tokens.push(track$1.status);
|
|
3683
3682
|
queue(tokens, false);
|
|
3684
3683
|
break;
|
|
3685
|
-
case 24 /*
|
|
3684
|
+
case 24 /* Custom */:
|
|
3686
3685
|
tokens.push(data$j.key);
|
|
3687
3686
|
tokens.push(data$j.value);
|
|
3688
3687
|
queue(tokens);
|
|
3689
3688
|
break;
|
|
3690
|
-
case 34 /*
|
|
3689
|
+
case 34 /* Variable */:
|
|
3691
3690
|
var variableKeys = Object.keys(data$e);
|
|
3692
3691
|
if (variableKeys.length > 0) {
|
|
3693
3692
|
for (var _i = 0, variableKeys_1 = variableKeys; _i < variableKeys_1.length; _i++) {
|
|
@@ -3699,7 +3698,7 @@ function encode$1 (event) {
|
|
|
3699
3698
|
queue(tokens, false);
|
|
3700
3699
|
}
|
|
3701
3700
|
break;
|
|
3702
|
-
case 0 /*
|
|
3701
|
+
case 0 /* Metric */:
|
|
3703
3702
|
var metricKeys = Object.keys(updates$3);
|
|
3704
3703
|
if (metricKeys.length > 0) {
|
|
3705
3704
|
for (var _a = 0, metricKeys_1 = metricKeys; _a < metricKeys_1.length; _a++) {
|
|
@@ -3714,7 +3713,7 @@ function encode$1 (event) {
|
|
|
3714
3713
|
queue(tokens, false);
|
|
3715
3714
|
}
|
|
3716
3715
|
break;
|
|
3717
|
-
case 1 /*
|
|
3716
|
+
case 1 /* Dimension */:
|
|
3718
3717
|
var dimensionKeys = Object.keys(updates);
|
|
3719
3718
|
if (dimensionKeys.length > 0) {
|
|
3720
3719
|
for (var _b = 0, dimensionKeys_1 = dimensionKeys; _b < dimensionKeys_1.length; _b++) {
|
|
@@ -3727,7 +3726,7 @@ function encode$1 (event) {
|
|
|
3727
3726
|
queue(tokens, false);
|
|
3728
3727
|
}
|
|
3729
3728
|
break;
|
|
3730
|
-
case 36 /*
|
|
3729
|
+
case 36 /* Summary */:
|
|
3731
3730
|
var eventKeys = Object.keys(data$g);
|
|
3732
3731
|
if (eventKeys.length > 0) {
|
|
3733
3732
|
for (var _c = 0, eventKeys_1 = eventKeys; _c < eventKeys_1.length; _c++) {
|
|
@@ -3740,7 +3739,7 @@ function encode$1 (event) {
|
|
|
3740
3739
|
queue(tokens, false);
|
|
3741
3740
|
}
|
|
3742
3741
|
break;
|
|
3743
|
-
case 40 /*
|
|
3742
|
+
case 40 /* Extract */:
|
|
3744
3743
|
var extractKeys = keys;
|
|
3745
3744
|
for (var _d = 0, extractKeys_1 = extractKeys; _d < extractKeys_1.length; _d++) {
|
|
3746
3745
|
var e = extractKeys_1[_d];
|
|
@@ -3754,14 +3753,14 @@ function encode$1 (event) {
|
|
|
3754
3753
|
|
|
3755
3754
|
var data$4;
|
|
3756
3755
|
function start$b() {
|
|
3757
|
-
data$4 = { check: 0 /*
|
|
3756
|
+
data$4 = { check: 0 /* None */ };
|
|
3758
3757
|
}
|
|
3759
3758
|
function check$2(bytes) {
|
|
3760
|
-
if (data$4.check === 0 /*
|
|
3759
|
+
if (data$4.check === 0 /* None */) {
|
|
3761
3760
|
var reason = data$4.check;
|
|
3762
|
-
reason = data$1.sequence >= 128 /*
|
|
3763
|
-
reason = time() > 7200000 /*
|
|
3764
|
-
reason = bytes > 10485760 /*
|
|
3761
|
+
reason = data$1.sequence >= 128 /* PayloadLimit */ ? 1 /* Payload */ : reason;
|
|
3762
|
+
reason = time() > 7200000 /* ShutdownLimit */ ? 2 /* Shutdown */ : reason;
|
|
3763
|
+
reason = bytes > 10485760 /* PlaybackBytesLimit */ ? 2 /* Shutdown */ : reason;
|
|
3765
3764
|
if (reason !== data$4.check) {
|
|
3766
3765
|
trigger(reason);
|
|
3767
3766
|
}
|
|
@@ -3773,8 +3772,8 @@ function trigger(reason) {
|
|
|
3773
3772
|
stop();
|
|
3774
3773
|
}
|
|
3775
3774
|
function compute$3() {
|
|
3776
|
-
if (data$4.check !== 0 /*
|
|
3777
|
-
encode$1(35 /*
|
|
3775
|
+
if (data$4.check !== 0 /* None */) {
|
|
3776
|
+
encode$1(35 /* Limit */);
|
|
3778
3777
|
}
|
|
3779
3778
|
}
|
|
3780
3779
|
function stop$a() {
|
|
@@ -3795,7 +3794,7 @@ function log(dimension, value) {
|
|
|
3795
3794
|
// Check valid value before moving ahead
|
|
3796
3795
|
if (value) {
|
|
3797
3796
|
// Ensure received value is casted into a string if it wasn't a string to begin with
|
|
3798
|
-
value = ""
|
|
3797
|
+
value = "" + value;
|
|
3799
3798
|
if (!(dimension in data$3)) {
|
|
3800
3799
|
data$3[dimension] = [];
|
|
3801
3800
|
}
|
|
@@ -3808,14 +3807,14 @@ function log(dimension, value) {
|
|
|
3808
3807
|
}
|
|
3809
3808
|
updates[dimension].push(value);
|
|
3810
3809
|
// Limit check to ensure we have a cap on number of dimensions we can collect
|
|
3811
|
-
if (data$3[dimension].length > 128 /*
|
|
3812
|
-
trigger(5 /*
|
|
3810
|
+
if (data$3[dimension].length > 128 /* CollectionLimit */) {
|
|
3811
|
+
trigger(5 /* Collection */);
|
|
3813
3812
|
}
|
|
3814
3813
|
}
|
|
3815
3814
|
}
|
|
3816
3815
|
}
|
|
3817
3816
|
function compute$2() {
|
|
3818
|
-
encode$1(1 /*
|
|
3817
|
+
encode$1(1 /* Dimension */);
|
|
3819
3818
|
}
|
|
3820
3819
|
function reset$3() {
|
|
3821
3820
|
updates = {};
|
|
@@ -3826,8 +3825,8 @@ var callbacks = [];
|
|
|
3826
3825
|
var rootDomain = null;
|
|
3827
3826
|
function start$9() {
|
|
3828
3827
|
rootDomain = null;
|
|
3829
|
-
var ua = navigator && "userAgent" in navigator ? navigator.userAgent : "" /*
|
|
3830
|
-
var title = document && document.title ? document.title : "" /*
|
|
3828
|
+
var ua = navigator && "userAgent" in navigator ? navigator.userAgent : "" /* Empty */;
|
|
3829
|
+
var title = document && document.title ? document.title : "" /* Empty */;
|
|
3831
3830
|
// Populate ids for this page
|
|
3832
3831
|
var s = session();
|
|
3833
3832
|
var u = user();
|
|
@@ -3838,27 +3837,27 @@ function start$9() {
|
|
|
3838
3837
|
pageNum: s.count
|
|
3839
3838
|
};
|
|
3840
3839
|
// Override configuration based on what's in the session storage, unless it is blank (e.g. using upload callback, like in devtools)
|
|
3841
|
-
config$1.lean = config$1.track && s.upgrade !== null ? s.upgrade === 0 /*
|
|
3842
|
-
config$1.upload = config$1.track && typeof config$1.upload === "string" /*
|
|
3840
|
+
config$1.lean = config$1.track && s.upgrade !== null ? s.upgrade === 0 /* False */ : config$1.lean;
|
|
3841
|
+
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;
|
|
3843
3842
|
// Log dimensions
|
|
3844
|
-
log(0 /*
|
|
3845
|
-
log(3 /*
|
|
3846
|
-
log(1 /*
|
|
3847
|
-
log(2 /*
|
|
3848
|
-
log(15 /*
|
|
3849
|
-
log(16 /*
|
|
3850
|
-
log(17 /*
|
|
3843
|
+
log(0 /* UserAgent */, ua);
|
|
3844
|
+
log(3 /* PageTitle */, title);
|
|
3845
|
+
log(1 /* Url */, location.href);
|
|
3846
|
+
log(2 /* Referrer */, document.referrer);
|
|
3847
|
+
log(15 /* TabId */, tab());
|
|
3848
|
+
log(16 /* PageLanguage */, document.documentElement.lang);
|
|
3849
|
+
log(17 /* DocumentDirection */, document.dir);
|
|
3851
3850
|
if (navigator) {
|
|
3852
|
-
log(9 /*
|
|
3851
|
+
log(9 /* Language */, navigator.userLanguage || navigator.language);
|
|
3853
3852
|
userAgentData();
|
|
3854
3853
|
}
|
|
3855
3854
|
// Metrics
|
|
3856
|
-
max(0 /*
|
|
3857
|
-
max(1 /*
|
|
3855
|
+
max(0 /* ClientTimestamp */, s.ts);
|
|
3856
|
+
max(1 /* Playback */, 0 /* False */);
|
|
3858
3857
|
if (screen) {
|
|
3859
|
-
max(14 /*
|
|
3860
|
-
max(15 /*
|
|
3861
|
-
max(16 /*
|
|
3858
|
+
max(14 /* ScreenWidth */, Math.round(screen.width));
|
|
3859
|
+
max(15 /* ScreenHeight */, Math.round(screen.height));
|
|
3860
|
+
max(16 /* ColorDepth */, Math.round(screen.colorDepth));
|
|
3862
3861
|
}
|
|
3863
3862
|
// Read cookies specified in configuration
|
|
3864
3863
|
for (var _i = 0, _a = config$1.cookies; _i < _a.length; _i++) {
|
|
@@ -3879,13 +3878,13 @@ function userAgentData() {
|
|
|
3879
3878
|
"uaFullVersion"])
|
|
3880
3879
|
.then(function (ua) {
|
|
3881
3880
|
var _a;
|
|
3882
|
-
log(22 /*
|
|
3883
|
-
log(23 /*
|
|
3881
|
+
log(22 /* Platform */, ua.platform);
|
|
3882
|
+
log(23 /* PlatformVersion */, ua.platformVersion);
|
|
3884
3883
|
(_a = ua.brands) === null || _a === void 0 ? void 0 : _a.forEach(function (brand) {
|
|
3885
|
-
log(24 /*
|
|
3884
|
+
log(24 /* Brand */, brand.name + "~" /* Tilde */ + brand.version);
|
|
3886
3885
|
});
|
|
3887
|
-
log(25 /*
|
|
3888
|
-
max(27 /*
|
|
3886
|
+
log(25 /* Model */, ua.model);
|
|
3887
|
+
max(27 /* Mobile */, ua.mobile ? 1 /* True */ : 0 /* False */);
|
|
3889
3888
|
});
|
|
3890
3889
|
}
|
|
3891
3890
|
}
|
|
@@ -3902,33 +3901,33 @@ function metadata(cb, wait) {
|
|
|
3902
3901
|
callbacks.push({ callback: cb, wait: wait });
|
|
3903
3902
|
}
|
|
3904
3903
|
function id() {
|
|
3905
|
-
return data$2 ? [data$2.userId, data$2.sessionId, data$2.pageNum].join("." /*
|
|
3904
|
+
return data$2 ? [data$2.userId, data$2.sessionId, data$2.pageNum].join("." /* Dot */) : "" /* Empty */;
|
|
3906
3905
|
}
|
|
3907
3906
|
function consent() {
|
|
3908
3907
|
if (active()) {
|
|
3909
3908
|
config$1.track = true;
|
|
3910
|
-
track(user(), 1 /*
|
|
3909
|
+
track(user(), 1 /* True */);
|
|
3911
3910
|
}
|
|
3912
3911
|
}
|
|
3913
3912
|
function clear() {
|
|
3914
3913
|
// Clear any stored information in the cookie that tracks session information so we can restart fresh the next time
|
|
3915
|
-
setCookie("_clsk" /*
|
|
3914
|
+
setCookie("_clsk" /* SessionKey */, "" /* Empty */, 0);
|
|
3916
3915
|
}
|
|
3917
3916
|
function tab() {
|
|
3918
3917
|
var id = shortid();
|
|
3919
|
-
if (config$1.track && supported(window, "sessionStorage" /*
|
|
3920
|
-
var value = sessionStorage.getItem("_cltk" /*
|
|
3918
|
+
if (config$1.track && supported(window, "sessionStorage" /* SessionStorage */)) {
|
|
3919
|
+
var value = sessionStorage.getItem("_cltk" /* TabKey */);
|
|
3921
3920
|
id = value ? value : id;
|
|
3922
|
-
sessionStorage.setItem("_cltk" /*
|
|
3921
|
+
sessionStorage.setItem("_cltk" /* TabKey */, id);
|
|
3923
3922
|
}
|
|
3924
3923
|
return id;
|
|
3925
3924
|
}
|
|
3926
3925
|
function save() {
|
|
3927
3926
|
var ts = Math.round(Date.now());
|
|
3928
|
-
var upload = config$1.upload && typeof config$1.upload === "string" /*
|
|
3929
|
-
var upgrade = config$1.lean ? 0 /*
|
|
3927
|
+
var upload = config$1.upload && typeof config$1.upload === "string" /* String */ ? config$1.upload.replace("https://" /* HTTPS */, "" /* Empty */) : "" /* Empty */;
|
|
3928
|
+
var upgrade = config$1.lean ? 0 /* False */ : 1 /* True */;
|
|
3930
3929
|
processCallback(upgrade);
|
|
3931
|
-
setCookie("_clsk" /*
|
|
3930
|
+
setCookie("_clsk" /* SessionKey */, [data$2.sessionId, ts, data$2.pageNum, upgrade, upload].join("|" /* Pipe */), 1 /* SessionExpire */);
|
|
3932
3931
|
}
|
|
3933
3932
|
function processCallback(upgrade) {
|
|
3934
3933
|
if (callbacks.length > 0) {
|
|
@@ -3953,10 +3952,10 @@ function track(u, consent) {
|
|
|
3953
3952
|
consent = consent === null ? u.consent : consent;
|
|
3954
3953
|
// Convert time precision into days to reduce number of bytes we have to write in a cookie
|
|
3955
3954
|
// E.g. Math.ceil(1628735962643 / (24*60*60*1000)) => 18852 (days) => ejo in base36 (13 bytes => 3 bytes)
|
|
3956
|
-
var end = Math.ceil((Date.now() + (365 /*
|
|
3955
|
+
var end = Math.ceil((Date.now() + (365 /* Expire */ * 86400000 /* Day */)) / 86400000 /* Day */);
|
|
3957
3956
|
// To avoid cookie churn, write user id cookie only once every day
|
|
3958
|
-
if (u.expiry === null || Math.abs(end - u.expiry) >= 1 /*
|
|
3959
|
-
setCookie("_clck" /*
|
|
3957
|
+
if (u.expiry === null || Math.abs(end - u.expiry) >= 1 /* CookieInterval */ || u.consent !== consent) {
|
|
3958
|
+
setCookie("_clck" /* CookieKey */, [data$2.userId, 1 /* CookieVersion */, end.toString(36), consent].join("|" /* Pipe */), 365 /* Expire */);
|
|
3960
3959
|
}
|
|
3961
3960
|
}
|
|
3962
3961
|
function shortid() {
|
|
@@ -3967,17 +3966,17 @@ function shortid() {
|
|
|
3967
3966
|
return id.toString(36);
|
|
3968
3967
|
}
|
|
3969
3968
|
function session() {
|
|
3970
|
-
var output = { session: shortid(), ts: Math.round(Date.now()), count: 1, upgrade: null, upload: "" /*
|
|
3971
|
-
var value = getCookie("_clsk" /*
|
|
3969
|
+
var output = { session: shortid(), ts: Math.round(Date.now()), count: 1, upgrade: null, upload: "" /* Empty */ };
|
|
3970
|
+
var value = getCookie("_clsk" /* SessionKey */);
|
|
3972
3971
|
if (value) {
|
|
3973
|
-
var parts = value.split("|" /*
|
|
3972
|
+
var parts = value.split("|" /* Pipe */);
|
|
3974
3973
|
// Making it backward & forward compatible by using greater than comparison (v0.6.21)
|
|
3975
3974
|
// In future version, we can reduce the parts length to be 5 where the last part contains the full upload URL
|
|
3976
|
-
if (parts.length >= 5 && output.ts - num(parts[1]) < 1800000 /*
|
|
3975
|
+
if (parts.length >= 5 && output.ts - num(parts[1]) < 1800000 /* SessionTimeout */) {
|
|
3977
3976
|
output.session = parts[0];
|
|
3978
3977
|
output.count = num(parts[2]) + 1;
|
|
3979
3978
|
output.upgrade = num(parts[3]);
|
|
3980
|
-
output.upload = parts.length >= 6 ? ""
|
|
3979
|
+
output.upload = parts.length >= 6 ? "" + "https://" /* HTTPS */ + parts[5] + "/" + parts[4] : "" + "https://" /* HTTPS */ + parts[4];
|
|
3981
3980
|
}
|
|
3982
3981
|
}
|
|
3983
3982
|
return output;
|
|
@@ -3987,26 +3986,26 @@ function num(string, base) {
|
|
|
3987
3986
|
return parseInt(string, base);
|
|
3988
3987
|
}
|
|
3989
3988
|
function user() {
|
|
3990
|
-
var output = { id: shortid(), expiry: null, consent: 0 /*
|
|
3991
|
-
var cookie = getCookie("_clck" /*
|
|
3989
|
+
var output = { id: shortid(), expiry: null, consent: 0 /* False */ };
|
|
3990
|
+
var cookie = getCookie("_clck" /* CookieKey */);
|
|
3992
3991
|
if (cookie && cookie.length > 0) {
|
|
3993
3992
|
// Splitting and looking up first part for forward compatibility, in case we wish to store additional information in a cookie
|
|
3994
|
-
var parts = cookie.split("|" /*
|
|
3993
|
+
var parts = cookie.split("|" /* Pipe */);
|
|
3995
3994
|
// For backward compatibility introduced in v0.6.18; following code can be removed with future iterations
|
|
3996
3995
|
// 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)
|
|
3997
3996
|
var count = 0;
|
|
3998
|
-
for (var _i = 0, _a = document.cookie.split(";" /*
|
|
3997
|
+
for (var _i = 0, _a = document.cookie.split(";" /* Semicolon */); _i < _a.length; _i++) {
|
|
3999
3998
|
var c = _a[_i];
|
|
4000
|
-
count += c.split("=" /*
|
|
3999
|
+
count += c.split("=" /* Equals */)[0].trim() === "_clck" /* CookieKey */ ? 1 : 0;
|
|
4001
4000
|
}
|
|
4002
4001
|
// Check if we either got version-less cookie value or saw multiple copies of the user cookie crumbs
|
|
4003
4002
|
// In both these cases, we go ahead and delete the existing cookie set on current domain
|
|
4004
4003
|
if (parts.length === 1 || count > 1) {
|
|
4005
|
-
var deleted = ""
|
|
4004
|
+
var deleted = "" + ";" /* Semicolon */ + "expires=" /* Expires */ + (new Date(0)).toUTCString() + ";path=/" /* Path */;
|
|
4006
4005
|
// First, delete current user cookie which might be set on current sub-domain vs. root domain
|
|
4007
|
-
document.cookie = "
|
|
4006
|
+
document.cookie = "_clck" /* CookieKey */ + "=" + deleted;
|
|
4008
4007
|
// Second, same thing for current session cookie so it can be re-written later with the root domain
|
|
4009
|
-
document.cookie = "
|
|
4008
|
+
document.cookie = "_clsk" /* SessionKey */ + "=" + deleted;
|
|
4010
4009
|
}
|
|
4011
4010
|
// End code for backward compatibility
|
|
4012
4011
|
// Read version information and timestamp from cookie, if available
|
|
@@ -4015,21 +4014,21 @@ function user() {
|
|
|
4015
4014
|
}
|
|
4016
4015
|
// Check if we have explicit consent to track this user
|
|
4017
4016
|
if (parts.length > 3 && num(parts[3]) === 1) {
|
|
4018
|
-
output.consent = 1 /*
|
|
4017
|
+
output.consent = 1 /* True */;
|
|
4019
4018
|
}
|
|
4020
4019
|
// Set track configuration to true for this user if we have explicit consent, regardless of project setting
|
|
4021
|
-
config$1.track = config$1.track || output.consent === 1 /*
|
|
4020
|
+
config$1.track = config$1.track || output.consent === 1 /* True */;
|
|
4022
4021
|
// Get user id from cookie only if we tracking is enabled, otherwise fallback to a random id
|
|
4023
4022
|
output.id = config$1.track ? parts[0] : output.id;
|
|
4024
4023
|
}
|
|
4025
4024
|
return output;
|
|
4026
4025
|
}
|
|
4027
4026
|
function getCookie(key) {
|
|
4028
|
-
if (supported(document, "cookie" /*
|
|
4029
|
-
var cookies = document.cookie.split(";" /*
|
|
4027
|
+
if (supported(document, "cookie" /* Cookie */)) {
|
|
4028
|
+
var cookies = document.cookie.split(";" /* Semicolon */);
|
|
4030
4029
|
if (cookies) {
|
|
4031
4030
|
for (var i = 0; i < cookies.length; i++) {
|
|
4032
|
-
var pair = cookies[i].split("=" /*
|
|
4031
|
+
var pair = cookies[i].split("=" /* Equals */);
|
|
4033
4032
|
if (pair.length > 1 && pair[0] && pair[0].trim() === key) {
|
|
4034
4033
|
return pair[1];
|
|
4035
4034
|
}
|
|
@@ -4039,23 +4038,23 @@ function getCookie(key) {
|
|
|
4039
4038
|
return null;
|
|
4040
4039
|
}
|
|
4041
4040
|
function setCookie(key, value, time) {
|
|
4042
|
-
if (config$1.track && ((navigator && navigator.cookieEnabled) || supported(document, "cookie" /*
|
|
4041
|
+
if (config$1.track && ((navigator && navigator.cookieEnabled) || supported(document, "cookie" /* Cookie */))) {
|
|
4043
4042
|
var expiry = new Date();
|
|
4044
4043
|
expiry.setDate(expiry.getDate() + time);
|
|
4045
|
-
var expires = expiry ? "expires=" /*
|
|
4046
|
-
var cookie =
|
|
4044
|
+
var expires = expiry ? "expires=" /* Expires */ + expiry.toUTCString() : "" /* Empty */;
|
|
4045
|
+
var cookie = key + "=" + value + ";" /* Semicolon */ + expires + ";path=/" /* Path */;
|
|
4047
4046
|
try {
|
|
4048
4047
|
// Attempt to get the root domain only once and fall back to writing cookie on the current domain.
|
|
4049
4048
|
if (rootDomain === null) {
|
|
4050
|
-
var hostname = location.hostname ? location.hostname.split("." /*
|
|
4049
|
+
var hostname = location.hostname ? location.hostname.split("." /* Dot */) : [];
|
|
4051
4050
|
// Walk backwards on a domain and attempt to set a cookie, until successful
|
|
4052
4051
|
for (var i = hostname.length - 1; i >= 0; i--) {
|
|
4053
|
-
rootDomain = "."
|
|
4052
|
+
rootDomain = "." + hostname[i] + (rootDomain ? rootDomain : "" /* Empty */);
|
|
4054
4053
|
// We do not wish to attempt writing a cookie on the absolute last part of the domain, e.g. .com or .net.
|
|
4055
4054
|
// So we start attempting after second-last part, e.g. .domain.com (PASS) or .co.uk (FAIL)
|
|
4056
4055
|
if (i < hostname.length - 1) {
|
|
4057
4056
|
// Write the cookie on the current computed top level domain
|
|
4058
|
-
document.cookie = ""
|
|
4057
|
+
document.cookie = "" + cookie + ";" /* Semicolon */ + "domain=" /* Domain */ + rootDomain;
|
|
4059
4058
|
// Once written, check if the cookie exists and its value matches exactly with what we intended to set
|
|
4060
4059
|
// Checking for exact value match helps us eliminate a corner case where the cookie may already be present with a different value
|
|
4061
4060
|
// If the check is successful, no more action is required and we can return from the function since rootDomain cookie is already set
|
|
@@ -4067,13 +4066,13 @@ function setCookie(key, value, time) {
|
|
|
4067
4066
|
}
|
|
4068
4067
|
// Finally, if we were not successful and gone through all the options, play it safe and reset rootDomain to be empty
|
|
4069
4068
|
// This forces our code to fall back to always writing cookie to the current domain
|
|
4070
|
-
rootDomain = "" /*
|
|
4069
|
+
rootDomain = "" /* Empty */;
|
|
4071
4070
|
}
|
|
4072
4071
|
}
|
|
4073
4072
|
catch (_a) {
|
|
4074
|
-
rootDomain = "" /*
|
|
4073
|
+
rootDomain = "" /* Empty */;
|
|
4075
4074
|
}
|
|
4076
|
-
document.cookie = rootDomain ? ""
|
|
4075
|
+
document.cookie = rootDomain ? "" + cookie + ";" /* Semicolon */ + "domain=" /* Domain */ + rootDomain : cookie;
|
|
4077
4076
|
}
|
|
4078
4077
|
}
|
|
4079
4078
|
|
|
@@ -4089,8 +4088,8 @@ function start$8() {
|
|
|
4089
4088
|
userId: m.userId,
|
|
4090
4089
|
sessionId: m.sessionId,
|
|
4091
4090
|
pageNum: m.pageNum,
|
|
4092
|
-
upload: 0 /*
|
|
4093
|
-
end: 0 /*
|
|
4091
|
+
upload: 0 /* Async */,
|
|
4092
|
+
end: 0 /* False */
|
|
4094
4093
|
};
|
|
4095
4094
|
}
|
|
4096
4095
|
function stop$7() {
|
|
@@ -4100,8 +4099,8 @@ function envelope(last) {
|
|
|
4100
4099
|
data$1.start = data$1.start + data$1.duration;
|
|
4101
4100
|
data$1.duration = time() - data$1.start;
|
|
4102
4101
|
data$1.sequence++;
|
|
4103
|
-
data$1.upload = last && "sendBeacon" in navigator ? 1 /*
|
|
4104
|
-
data$1.end = last ? 1 /*
|
|
4102
|
+
data$1.upload = last && "sendBeacon" in navigator ? 1 /* Beacon */ : 0 /* Async */;
|
|
4103
|
+
data$1.end = last ? 1 /* True */ : 0 /* False */;
|
|
4105
4104
|
return [
|
|
4106
4105
|
data$1.version,
|
|
4107
4106
|
data$1.sequence,
|
|
@@ -4154,10 +4153,10 @@ function measure (method) {
|
|
|
4154
4153
|
throw report(ex);
|
|
4155
4154
|
}
|
|
4156
4155
|
var duration = performance.now() - start;
|
|
4157
|
-
sum(4 /*
|
|
4158
|
-
if (duration > 30 /*
|
|
4159
|
-
count$1(7 /*
|
|
4160
|
-
max(6 /*
|
|
4156
|
+
sum(4 /* TotalCost */, duration);
|
|
4157
|
+
if (duration > 30 /* LongTask */) {
|
|
4158
|
+
count$1(7 /* LongTaskCount */);
|
|
4159
|
+
max(6 /* ThreadBlockedTime */, duration);
|
|
4161
4160
|
}
|
|
4162
4161
|
};
|
|
4163
4162
|
}
|
|
@@ -4169,7 +4168,7 @@ function bind(target, event, listener, capture) {
|
|
|
4169
4168
|
// Wrapping following lines inside try / catch to cover edge cases where we might try to access an inaccessible element.
|
|
4170
4169
|
// E.g. Iframe may start off as same-origin but later turn into cross-origin, and the following lines will throw an exception.
|
|
4171
4170
|
try {
|
|
4172
|
-
target[api("addEventListener" /*
|
|
4171
|
+
target[api("addEventListener" /* AddEventListener */)](event, listener, capture);
|
|
4173
4172
|
bindings.push({ event: event, target: target, listener: listener, capture: capture });
|
|
4174
4173
|
}
|
|
4175
4174
|
catch ( /* do nothing */_a) { /* do nothing */ }
|
|
@@ -4180,7 +4179,7 @@ function reset$1() {
|
|
|
4180
4179
|
var binding = bindings_1[_i];
|
|
4181
4180
|
// Wrapping inside try / catch to avoid situations where the element may be destroyed before we get a chance to unbind
|
|
4182
4181
|
try {
|
|
4183
|
-
binding.target[api("removeEventListener" /*
|
|
4182
|
+
binding.target[api("removeEventListener" /* RemoveEventListener */)](binding.event, binding.listener, binding.capture);
|
|
4184
4183
|
}
|
|
4185
4184
|
catch ( /* do nothing */_a) { /* do nothing */ }
|
|
4186
4185
|
}
|
|
@@ -4217,8 +4216,8 @@ function start$7() {
|
|
|
4217
4216
|
}
|
|
4218
4217
|
}
|
|
4219
4218
|
function check$1() {
|
|
4220
|
-
if (count++ > 20 /*
|
|
4221
|
-
log$1(4 /*
|
|
4219
|
+
if (count++ > 20 /* CallStackDepth */) {
|
|
4220
|
+
log$1(4 /* CallStackDepth */, 0 /* Info */);
|
|
4222
4221
|
return false;
|
|
4223
4222
|
}
|
|
4224
4223
|
return true;
|
|
@@ -4228,15 +4227,15 @@ function compute$1() {
|
|
|
4228
4227
|
if (url !== getCurrentUrl()) {
|
|
4229
4228
|
// If the url changed, start tracking it as a new page
|
|
4230
4229
|
stop();
|
|
4231
|
-
window.setTimeout(restart$1, 250 /*
|
|
4230
|
+
window.setTimeout(restart$1, 250 /* RestartDelay */);
|
|
4232
4231
|
}
|
|
4233
4232
|
}
|
|
4234
4233
|
function restart$1() {
|
|
4235
4234
|
start();
|
|
4236
|
-
max(29 /*
|
|
4235
|
+
max(29 /* SinglePage */, 1 /* True */);
|
|
4237
4236
|
}
|
|
4238
4237
|
function getCurrentUrl() {
|
|
4239
|
-
return location.href ? location.href.replace(location.hash, "" /*
|
|
4238
|
+
return location.href ? location.href.replace(location.hash, "" /* Empty */) : location.href;
|
|
4240
4239
|
}
|
|
4241
4240
|
function stop$6() {
|
|
4242
4241
|
url = null;
|
|
@@ -4299,7 +4298,7 @@ function config(override) {
|
|
|
4299
4298
|
// not holding the session during inactive time periods.
|
|
4300
4299
|
function suspend() {
|
|
4301
4300
|
if (status) {
|
|
4302
|
-
event("clarity" /*
|
|
4301
|
+
event("clarity" /* Clarity */, "suspend" /* Suspend */);
|
|
4303
4302
|
stop();
|
|
4304
4303
|
["mousemove", "touchstart"].forEach(function (x) { return bind(document, x, restart); });
|
|
4305
4304
|
["resize", "scroll", "pageshow"].forEach(function (x) { return bind(window, x, restart); });
|
|
@@ -4307,7 +4306,7 @@ function suspend() {
|
|
|
4307
4306
|
}
|
|
4308
4307
|
function restart() {
|
|
4309
4308
|
start();
|
|
4310
|
-
event("clarity" /*
|
|
4309
|
+
event("clarity" /* Clarity */, "restart" /* Restart */);
|
|
4311
4310
|
}
|
|
4312
4311
|
|
|
4313
4312
|
function start$5() {
|
|
@@ -4326,7 +4325,7 @@ var diagnostic = /*#__PURE__*/Object.freeze({
|
|
|
4326
4325
|
});
|
|
4327
4326
|
|
|
4328
4327
|
function start$4() {
|
|
4329
|
-
schedule$1(discover, 1 /*
|
|
4328
|
+
schedule$1(discover, 1 /* High */).then(function () {
|
|
4330
4329
|
measure(compute$7)();
|
|
4331
4330
|
measure(compute$6)();
|
|
4332
4331
|
});
|
|
@@ -4338,12 +4337,12 @@ function discover() {
|
|
|
4338
4337
|
switch (_a.label) {
|
|
4339
4338
|
case 0:
|
|
4340
4339
|
ts = time();
|
|
4341
|
-
timer = { id: id(), cost: 3 /*
|
|
4340
|
+
timer = { id: id(), cost: 3 /* LayoutCost */ };
|
|
4342
4341
|
start$w(timer);
|
|
4343
|
-
return [4 /*yield*/, traverse(document, timer, 0 /*
|
|
4342
|
+
return [4 /*yield*/, traverse(document, timer, 0 /* Discover */)];
|
|
4344
4343
|
case 1:
|
|
4345
4344
|
_a.sent();
|
|
4346
|
-
return [4 /*yield*/, encode$4(5 /*
|
|
4345
|
+
return [4 /*yield*/, encode$4(5 /* Discover */, timer, ts)];
|
|
4347
4346
|
case 2:
|
|
4348
4347
|
_a.sent();
|
|
4349
4348
|
stop$t(timer);
|
|
@@ -4382,7 +4381,7 @@ function encode (type) {
|
|
|
4382
4381
|
t = time();
|
|
4383
4382
|
tokens = [t, type];
|
|
4384
4383
|
switch (type) {
|
|
4385
|
-
case 29 /*
|
|
4384
|
+
case 29 /* Navigation */:
|
|
4386
4385
|
tokens.push(data.fetchStart);
|
|
4387
4386
|
tokens.push(data.connectStart);
|
|
4388
4387
|
tokens.push(data.connectEnd);
|
|
@@ -4431,11 +4430,11 @@ function compute(entry) {
|
|
|
4431
4430
|
encodedSize: entry.encodedBodySize ? entry.encodedBodySize : 0,
|
|
4432
4431
|
decodedSize: entry.decodedBodySize ? entry.decodedBodySize : 0
|
|
4433
4432
|
};
|
|
4434
|
-
encode(29 /*
|
|
4433
|
+
encode(29 /* Navigation */);
|
|
4435
4434
|
}
|
|
4436
4435
|
|
|
4437
4436
|
var observer;
|
|
4438
|
-
var types = ["navigation" /*
|
|
4437
|
+
var types = ["navigation" /* Navigation */, "resource" /* Resource */, "longtask" /* LongTask */, "first-input" /* FID */, "layout-shift" /* CLS */, "largest-contentful-paint" /* LCP */];
|
|
4439
4438
|
function start$2() {
|
|
4440
4439
|
// Check the browser support performance observer as a pre-requisite for any performance measurement
|
|
4441
4440
|
if (window["PerformanceObserver"] && PerformanceObserver.supportedEntryTypes) {
|
|
@@ -4450,7 +4449,7 @@ function start$2() {
|
|
|
4450
4449
|
}
|
|
4451
4450
|
}
|
|
4452
4451
|
else {
|
|
4453
|
-
log$1(3 /*
|
|
4452
|
+
log$1(3 /* PerformanceObserver */, 0 /* Info */);
|
|
4454
4453
|
}
|
|
4455
4454
|
}
|
|
4456
4455
|
function observe() {
|
|
@@ -4470,15 +4469,15 @@ function observe() {
|
|
|
4470
4469
|
if (PerformanceObserver.supportedEntryTypes.indexOf(x) >= 0) {
|
|
4471
4470
|
// Initialize CLS with a value of zero. It's possible (and recommended) for sites to not have any cumulative layout shift.
|
|
4472
4471
|
// In those cases, we want to still initialize the metric in Clarity
|
|
4473
|
-
if (x === "layout-shift" /*
|
|
4474
|
-
sum(9 /*
|
|
4472
|
+
if (x === "layout-shift" /* CLS */) {
|
|
4473
|
+
sum(9 /* CumulativeLayoutShift */, 0);
|
|
4475
4474
|
}
|
|
4476
4475
|
observer.observe({ type: x, buffered: true });
|
|
4477
4476
|
}
|
|
4478
4477
|
}
|
|
4479
4478
|
}
|
|
4480
4479
|
catch (_a) {
|
|
4481
|
-
log$1(3 /*
|
|
4480
|
+
log$1(3 /* PerformanceObserver */, 1 /* Warning */);
|
|
4482
4481
|
}
|
|
4483
4482
|
}
|
|
4484
4483
|
function handle(entries) {
|
|
@@ -4489,41 +4488,41 @@ function process(entries) {
|
|
|
4489
4488
|
for (var i = 0; i < entries.length; i++) {
|
|
4490
4489
|
var entry = entries[i];
|
|
4491
4490
|
switch (entry.entryType) {
|
|
4492
|
-
case "navigation" /*
|
|
4491
|
+
case "navigation" /* Navigation */:
|
|
4493
4492
|
compute(entry);
|
|
4494
4493
|
break;
|
|
4495
|
-
case "resource" /*
|
|
4494
|
+
case "resource" /* Resource */:
|
|
4496
4495
|
var name_1 = entry.name;
|
|
4497
|
-
log(4 /*
|
|
4496
|
+
log(4 /* NetworkHosts */, host(name_1));
|
|
4498
4497
|
if (name_1 === config$1.upload || name_1 === config$1.fallback) {
|
|
4499
|
-
max(28 /*
|
|
4498
|
+
max(28 /* UploadTime */, entry.duration);
|
|
4500
4499
|
}
|
|
4501
4500
|
break;
|
|
4502
|
-
case "longtask" /*
|
|
4503
|
-
count$1(7 /*
|
|
4501
|
+
case "longtask" /* LongTask */:
|
|
4502
|
+
count$1(7 /* LongTaskCount */);
|
|
4504
4503
|
break;
|
|
4505
|
-
case "first-input" /*
|
|
4504
|
+
case "first-input" /* FID */:
|
|
4506
4505
|
if (visible) {
|
|
4507
|
-
max(10 /*
|
|
4506
|
+
max(10 /* FirstInputDelay */, entry["processingStart"] - entry.startTime);
|
|
4508
4507
|
}
|
|
4509
4508
|
break;
|
|
4510
|
-
case "layout-shift" /*
|
|
4509
|
+
case "layout-shift" /* CLS */:
|
|
4511
4510
|
// Scale the value to avoid sending back floating point number
|
|
4512
4511
|
if (visible && !entry["hadRecentInput"]) {
|
|
4513
|
-
sum(9 /*
|
|
4512
|
+
sum(9 /* CumulativeLayoutShift */, entry["value"] * 1000);
|
|
4514
4513
|
}
|
|
4515
4514
|
break;
|
|
4516
|
-
case "largest-contentful-paint" /*
|
|
4515
|
+
case "largest-contentful-paint" /* LCP */:
|
|
4517
4516
|
if (visible) {
|
|
4518
|
-
max(8 /*
|
|
4517
|
+
max(8 /* LargestPaint */, entry.startTime);
|
|
4519
4518
|
}
|
|
4520
4519
|
break;
|
|
4521
4520
|
}
|
|
4522
4521
|
}
|
|
4523
|
-
if (performance && "memory" /*
|
|
4522
|
+
if (performance && "memory" /* Memory */ in performance && performance["memory" /* Memory */].usedJSHeapSize) {
|
|
4524
4523
|
// Track consumed memory (MBs) where "memory" API is available
|
|
4525
4524
|
// Reference: https://developer.mozilla.org/en-US/docs/Web/API/Performance/memory
|
|
4526
|
-
max(30 /*
|
|
4525
|
+
max(30 /* UsedMemory */, Math.abs(performance["memory" /* Memory */].usedJSHeapSize / 1048576 /* MegaByte */));
|
|
4527
4526
|
}
|
|
4528
4527
|
}
|
|
4529
4528
|
function stop$2() {
|
|
@@ -4571,7 +4570,7 @@ function start(config$1) {
|
|
|
4571
4570
|
// performance impact even further. For reference, we are talking single digit milliseconds optimization here, not seconds.
|
|
4572
4571
|
function pause() {
|
|
4573
4572
|
if (active()) {
|
|
4574
|
-
event("clarity" /*
|
|
4573
|
+
event("clarity" /* Clarity */, "pause" /* Pause */);
|
|
4575
4574
|
pause$1();
|
|
4576
4575
|
}
|
|
4577
4576
|
}
|
|
@@ -4579,7 +4578,7 @@ function pause() {
|
|
|
4579
4578
|
function resume() {
|
|
4580
4579
|
if (active()) {
|
|
4581
4580
|
resume$1();
|
|
4582
|
-
event("clarity" /*
|
|
4581
|
+
event("clarity" /* Clarity */, "resume" /* Resume */);
|
|
4583
4582
|
}
|
|
4584
4583
|
}
|
|
4585
4584
|
function stop() {
|