@gemx-dev/clarity-js 0.8.62 → 0.8.64
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.extended.js +1 -1
- package/build/clarity.insight.js +1 -1
- package/build/clarity.js +112 -70
- package/build/clarity.min.js +1 -1
- package/build/clarity.module.js +112 -70
- package/build/clarity.performance.js +1 -1
- package/package.json +1 -1
- package/src/core/config.ts +4 -0
- package/src/core/version.ts +1 -1
- package/src/data/metadata.ts +6 -4
- package/src/layout/index.ts +4 -1
- package/src/layout/selector.ts +27 -1
- package/types/core.d.ts +4 -0
- package/types/index.d.ts +1 -0
package/build/clarity.module.js
CHANGED
|
@@ -147,7 +147,7 @@ function process$8() {
|
|
|
147
147
|
}
|
|
148
148
|
}
|
|
149
149
|
|
|
150
|
-
var config$
|
|
150
|
+
var config$3 = {
|
|
151
151
|
projectId: null,
|
|
152
152
|
delay: 1 * 1000 /* Time.Second */,
|
|
153
153
|
lean: false,
|
|
@@ -172,6 +172,10 @@ var config$2 = {
|
|
|
172
172
|
conversions: false,
|
|
173
173
|
includeSubdomains: true,
|
|
174
174
|
modules: [],
|
|
175
|
+
excludeClassNames: [],
|
|
176
|
+
externalSession: false,
|
|
177
|
+
userId: null,
|
|
178
|
+
sessionId: null,
|
|
175
179
|
};
|
|
176
180
|
|
|
177
181
|
function api(method) {
|
|
@@ -205,7 +209,7 @@ function stop$K() {
|
|
|
205
209
|
startTime = 0;
|
|
206
210
|
}
|
|
207
211
|
|
|
208
|
-
var version$1 = "0.8.
|
|
212
|
+
var version$1 = "0.8.63";
|
|
209
213
|
|
|
210
214
|
// tslint:disable: no-bitwise
|
|
211
215
|
function hash (input, precision) {
|
|
@@ -328,7 +332,7 @@ function url$1(input, electron, truncate) {
|
|
|
328
332
|
result = "".concat("https://" /* Data.Constant.HTTPS */).concat("Electron" /* Data.Constant.Electron */);
|
|
329
333
|
}
|
|
330
334
|
else {
|
|
331
|
-
var drop_1 = config$
|
|
335
|
+
var drop_1 = config$3.drop;
|
|
332
336
|
if (drop_1 && drop_1.length > 0 && input && input.indexOf("?") > 0) {
|
|
333
337
|
var _a = input.split("?"), path = _a[0], query = _a[1];
|
|
334
338
|
var swap_1 = "*na*" /* Data.Constant.Dropped */;
|
|
@@ -810,6 +814,16 @@ function __generator(thisArg, body) {
|
|
|
810
814
|
} catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; }
|
|
811
815
|
if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true };
|
|
812
816
|
}
|
|
817
|
+
}
|
|
818
|
+
|
|
819
|
+
function __spreadArray(to, from, pack) {
|
|
820
|
+
if (pack || arguments.length === 2) for (var i = 0, l = from.length, ar; i < l; i++) {
|
|
821
|
+
if (ar || !(i in from)) {
|
|
822
|
+
if (!ar) ar = Array.prototype.slice.call(from, 0, i);
|
|
823
|
+
ar[i] = from[i];
|
|
824
|
+
}
|
|
825
|
+
}
|
|
826
|
+
return to.concat(ar || Array.prototype.slice.call(from));
|
|
813
827
|
}
|
|
814
828
|
|
|
815
829
|
var supported$1 = "CompressionStream" /* Constant.CompressionStream */ in window;
|
|
@@ -1240,7 +1254,7 @@ function getCookie(key, limit) {
|
|
|
1240
1254
|
function setCookie(key, value, time) {
|
|
1241
1255
|
// only write cookies if we are currently in a cookie writing mode (and they are supported)
|
|
1242
1256
|
// OR if we are trying to write an empty cookie (i.e. clear the cookie value out)
|
|
1243
|
-
if ((config$
|
|
1257
|
+
if ((config$3.track || value == "" /* Constant.Empty */) && ((navigator && navigator.cookieEnabled) || supported(document, "cookie" /* Constant.Cookie */))) {
|
|
1244
1258
|
// Some browsers automatically url encode cookie values if they are not url encoded.
|
|
1245
1259
|
// We therefore encode and decode cookie values ourselves.
|
|
1246
1260
|
var encodedValue = encodeCookieValue(value);
|
|
@@ -1358,7 +1372,7 @@ function start$F() {
|
|
|
1358
1372
|
}
|
|
1359
1373
|
function check$5(id, target, input) {
|
|
1360
1374
|
// Compute hash for fraud detection, if enabled. Hash is computed only if input meets the minimum length criteria
|
|
1361
|
-
if (config$
|
|
1375
|
+
if (config$3.fraud && id !== null && input && input.length >= 5 /* Setting.WordLength */) {
|
|
1362
1376
|
data$f = { id: id, target: target, checksum: hash(input, 28 /* Setting.ChecksumPrecision */) };
|
|
1363
1377
|
// Only encode this event if we haven't already reported this hash
|
|
1364
1378
|
if (history$5.indexOf(data$f.checksum) < 0) {
|
|
@@ -1379,7 +1393,7 @@ function recompute$8(evt) {
|
|
|
1379
1393
|
var element = target(evt);
|
|
1380
1394
|
if (element) {
|
|
1381
1395
|
var value = element.value;
|
|
1382
|
-
var checksum = value && value.length >= 5 /* Setting.WordLength */ && config$
|
|
1396
|
+
var checksum = value && value.length >= 5 /* Setting.WordLength */ && config$3.fraud && "password,secret,pass,social,ssn,code,hidden" /* Mask.Exclude */.indexOf(element.type) === -1 ? hash(value, 28 /* Setting.ChecksumPrecision */) : "" /* Constant.Empty */;
|
|
1383
1397
|
state$a.push({ time: time(evt), event: 42 /* Event.Change */, data: { target: target(evt), type: element.type, value: value, checksum: checksum } });
|
|
1384
1398
|
schedule(encode$4.bind(this, 42 /* Event.Change */));
|
|
1385
1399
|
}
|
|
@@ -2180,7 +2194,7 @@ var styleTimeMap = {};
|
|
|
2180
2194
|
var documentNodes = [];
|
|
2181
2195
|
var createdSheetIds = [];
|
|
2182
2196
|
function proxyStyleRules$1(win) {
|
|
2183
|
-
if ((config$
|
|
2197
|
+
if ((config$3.lean && config$3.lite) || win === null || win === undefined) {
|
|
2184
2198
|
return;
|
|
2185
2199
|
}
|
|
2186
2200
|
win.clarityOverrides = win.clarityOverrides || {};
|
|
@@ -2219,7 +2233,7 @@ function start$q() {
|
|
|
2219
2233
|
proxyStyleRules$1(window);
|
|
2220
2234
|
}
|
|
2221
2235
|
function checkDocumentStyles(documentNode, timestamp) {
|
|
2222
|
-
if (config$
|
|
2236
|
+
if (config$3.lean && config$3.lite) {
|
|
2223
2237
|
return;
|
|
2224
2238
|
}
|
|
2225
2239
|
if (documentNodes.indexOf(documentNode) === -1) {
|
|
@@ -2606,7 +2620,7 @@ function encode$5 (type, timer, ts) {
|
|
|
2606
2620
|
if (type === 6 /* Event.Mutation */) {
|
|
2607
2621
|
activity(eventTime);
|
|
2608
2622
|
}
|
|
2609
|
-
queue(tokenize(tokens), !config$
|
|
2623
|
+
queue(tokenize(tokens), !config$3.lean);
|
|
2610
2624
|
_o.label = 11;
|
|
2611
2625
|
case 11: return [3 /*break*/, 13];
|
|
2612
2626
|
case 12:
|
|
@@ -2816,7 +2830,7 @@ function processMutation(timer, mutation, instance, timestamp) {
|
|
|
2816
2830
|
return [2 /*return*/];
|
|
2817
2831
|
}
|
|
2818
2832
|
target = mutation.target;
|
|
2819
|
-
type = config$
|
|
2833
|
+
type = config$3.throttleDom ? track$5(mutation, timer, instance, timestamp) : mutation.type;
|
|
2820
2834
|
if (type && target && target.ownerDocument) {
|
|
2821
2835
|
parse(target.ownerDocument);
|
|
2822
2836
|
}
|
|
@@ -3520,10 +3534,15 @@ function getAttributes$1(element) {
|
|
|
3520
3534
|
}
|
|
3521
3535
|
|
|
3522
3536
|
var excludeClassNames = "load,active,fixed,visible,focus,show,collaps,animat" /* Constant.ExcludeClassNames */.split("," /* Constant.Comma */);
|
|
3537
|
+
var extraExcludeClassNames = [];
|
|
3523
3538
|
var selectorMap = {};
|
|
3524
3539
|
function reset$8() {
|
|
3525
3540
|
selectorMap = {};
|
|
3526
3541
|
}
|
|
3542
|
+
function config$2(classNames) {
|
|
3543
|
+
extraExcludeClassNames = classNames || [];
|
|
3544
|
+
console.log("[Selector] config called \u2014 extraExcludeClassNames set to: [".concat(extraExcludeClassNames.join(', '), "]"));
|
|
3545
|
+
}
|
|
3527
3546
|
function get$1(input, type) {
|
|
3528
3547
|
var a = input.attributes;
|
|
3529
3548
|
var prefix = input.prefix ? input.prefix[type] : null;
|
|
@@ -3546,7 +3565,13 @@ function get$1(input, type) {
|
|
|
3546
3565
|
input.tag = input.tag.indexOf("svg:" /* Constant.SvgPrefix */) === 0 ? input.tag.substr("svg:" /* Constant.SvgPrefix */.length) : input.tag;
|
|
3547
3566
|
var selector = "".concat(prefix).concat(input.tag).concat(suffix);
|
|
3548
3567
|
var id = "id" /* Constant.Id */ in a && a["id" /* Constant.Id */].length > 0 ? a["id" /* Constant.Id */] : null;
|
|
3549
|
-
var
|
|
3568
|
+
var rawClasses = "class" /* Constant.Class */ in a ? a["class" /* Constant.Class */].trim().split(/\s+/) : [];
|
|
3569
|
+
var filteredClasses = rawClasses.filter(function (c) { return filter(c); });
|
|
3570
|
+
var removedClasses = rawClasses.filter(function (c) { return !filter(c); });
|
|
3571
|
+
if (removedClasses.length > 0) {
|
|
3572
|
+
console.log("[Selector] tag=\"".concat(input.tag, "\" id=\"").concat(input.id, "\" \u2014 removed classes: [").concat(removedClasses.join(', '), "] | kept: [").concat(filteredClasses.join(', '), "] | extraExclude: [").concat(extraExcludeClassNames.join(', '), "]"));
|
|
3573
|
+
}
|
|
3574
|
+
var classes = input.tag !== "BODY" /* Constant.BodyTag */ && filteredClasses.length > 0 ? filteredClasses.join("." /* Constant.Period */) : null;
|
|
3550
3575
|
if (classes && classes.length > 0) {
|
|
3551
3576
|
if (type === 0 /* Selector.Alpha */) {
|
|
3552
3577
|
// In Alpha mode, update selector to use class names, with relative positioning within the parent id container.
|
|
@@ -3559,16 +3584,19 @@ function get$1(input, type) {
|
|
|
3559
3584
|
selectorMap[key].push(input.id);
|
|
3560
3585
|
}
|
|
3561
3586
|
selector = "".concat(key).concat("~" /* Constant.Tilde */).concat(selectorMap[key].indexOf(input.id));
|
|
3587
|
+
console.log("\uD83D\uDE80 \uD83D\uDC25 ~ get ~ selector:", selector);
|
|
3562
3588
|
}
|
|
3563
3589
|
else {
|
|
3564
3590
|
// In Beta mode, we continue to look at query selectors in context of the full page
|
|
3565
3591
|
selector = "".concat(prefix).concat(input.tag, ".").concat(classes).concat(suffix);
|
|
3592
|
+
console.log("\uD83D\uDE80 \uD83D\uDC25 ~ get ~ selector:", selector);
|
|
3566
3593
|
}
|
|
3567
3594
|
}
|
|
3568
3595
|
// Update selector to use "id" field when available. There are two exceptions:
|
|
3569
3596
|
// (1) if "id" appears to be an auto generated string token, e.g. guid or a random id containing digits
|
|
3570
3597
|
// (2) if "id" appears inside a shadow DOM, in which case we continue to prefix up to shadow DOM to prevent conflicts
|
|
3571
3598
|
selector = id && filter(id) ? "".concat(getDomPrefix(prefix)).concat("#" /* Constant.Hash */).concat(id) : selector;
|
|
3599
|
+
console.log("\uD83D\uDE80 \uD83D\uDC25 ~ get ~ selector:", selector);
|
|
3572
3600
|
return selector;
|
|
3573
3601
|
}
|
|
3574
3602
|
}
|
|
@@ -3595,6 +3623,8 @@ function filter(value) {
|
|
|
3595
3623
|
if (!value) {
|
|
3596
3624
|
return false;
|
|
3597
3625
|
} // Do not process empty strings
|
|
3626
|
+
var excludeClassNames = getExcludeClassNames();
|
|
3627
|
+
console.log("\uD83D\uDE80 \uD83D\uDC25 ~ filter ~ excludeClassNames:", excludeClassNames);
|
|
3598
3628
|
if (excludeClassNames.some(function (x) { return value.toLowerCase().indexOf(x) >= 0; })) {
|
|
3599
3629
|
return false;
|
|
3600
3630
|
}
|
|
@@ -3606,9 +3636,15 @@ function filter(value) {
|
|
|
3606
3636
|
}
|
|
3607
3637
|
return true;
|
|
3608
3638
|
}
|
|
3639
|
+
function getExcludeClassNames() {
|
|
3640
|
+
console.log("\uD83D\uDE80 \uD83D\uDC25 ~ getExcludeClassNames ~ extraExcludeClassNames:", extraExcludeClassNames);
|
|
3641
|
+
console.log("\uD83D\uDE80 \uD83D\uDC25 ~ getExcludeClassNames ~ excludeClassNames:", excludeClassNames);
|
|
3642
|
+
return __spreadArray(__spreadArray([], excludeClassNames, true), extraExcludeClassNames, true);
|
|
3643
|
+
}
|
|
3609
3644
|
|
|
3610
3645
|
var selector = /*#__PURE__*/Object.freeze({
|
|
3611
3646
|
__proto__: null,
|
|
3647
|
+
config: config$2,
|
|
3612
3648
|
get: get$1,
|
|
3613
3649
|
reset: reset$8
|
|
3614
3650
|
});
|
|
@@ -3665,14 +3701,14 @@ function parse(root, init) {
|
|
|
3665
3701
|
try {
|
|
3666
3702
|
// Parse unmask configuration into separate query selectors and override tokens as part of initialization
|
|
3667
3703
|
if (init) {
|
|
3668
|
-
config$
|
|
3704
|
+
config$3.unmask.forEach(function (x) { return x.indexOf("!" /* Constant.Bang */) < 0 ? unmask.push(x) : override.push(x.substr(1)); });
|
|
3669
3705
|
}
|
|
3670
3706
|
// Since mutations may happen on leaf nodes too, e.g. text nodes, which may not support all selector APIs.
|
|
3671
3707
|
// We ensure that the root note supports querySelectorAll API before executing the code below to identify new regions.
|
|
3672
3708
|
if ("querySelectorAll" in root) {
|
|
3673
|
-
config$
|
|
3674
|
-
config$
|
|
3675
|
-
config$
|
|
3709
|
+
config$3.regions.forEach(function (x) { return root.querySelectorAll(x[1]).forEach(function (e) { return observe$1(e, "".concat(x[0])); }); }); // Regions
|
|
3710
|
+
config$3.mask.forEach(function (x) { return root.querySelectorAll(x).forEach(function (e) { return privacyMap.set(e, 3 /* Privacy.TextImage */); }); }); // Masked Elements
|
|
3711
|
+
config$3.checksum.forEach(function (x) { return root.querySelectorAll(x[1]).forEach(function (e) { return fraudMap.set(e, x[0]); }); }); // Fraud Checksum Check
|
|
3676
3712
|
unmask.forEach(function (x) { return root.querySelectorAll(x).forEach(function (e) { return privacyMap.set(e, 0 /* Privacy.None */); }); }); // Unmasked Elements
|
|
3677
3713
|
}
|
|
3678
3714
|
}
|
|
@@ -3703,7 +3739,7 @@ function add$1(node, parent, data, source) {
|
|
|
3703
3739
|
var parentValue = null;
|
|
3704
3740
|
var regionId = exists(node) ? id : null;
|
|
3705
3741
|
var fraudId = fraudMap.has(node) ? fraudMap.get(node) : null;
|
|
3706
|
-
var privacyId = config$
|
|
3742
|
+
var privacyId = config$3.content ? 1 /* Privacy.Sensitive */ : 3 /* Privacy.TextImage */;
|
|
3707
3743
|
if (parentId >= 0 && values$1[parentId]) {
|
|
3708
3744
|
parentValue = values$1[parentId];
|
|
3709
3745
|
parentValue.children.push(id);
|
|
@@ -4007,7 +4043,7 @@ function getPreviousId(node) {
|
|
|
4007
4043
|
function track$4(id, source, changed, parentChanged) {
|
|
4008
4044
|
if (changed === void 0) { changed = true; }
|
|
4009
4045
|
if (parentChanged === void 0) { parentChanged = false; }
|
|
4010
|
-
if (config$
|
|
4046
|
+
if (config$3.lean && config$3.lite) {
|
|
4011
4047
|
return;
|
|
4012
4048
|
}
|
|
4013
4049
|
// Keep track of the order in which mutations happened, they may not be sequential
|
|
@@ -4596,8 +4632,8 @@ var modules$1 = null;
|
|
|
4596
4632
|
function start$i() {
|
|
4597
4633
|
active$2 = true;
|
|
4598
4634
|
modules$1 = new Set();
|
|
4599
|
-
if (config$
|
|
4600
|
-
config$
|
|
4635
|
+
if (config$3.modules && config$3.modules.length > 0) {
|
|
4636
|
+
config$3.modules.forEach(function (m) { event(m); });
|
|
4601
4637
|
}
|
|
4602
4638
|
}
|
|
4603
4639
|
function stop$g() {
|
|
@@ -4685,7 +4721,7 @@ function queue(tokens, transmit) {
|
|
|
4685
4721
|
var now = time();
|
|
4686
4722
|
var type = tokens.length > 1 ? tokens[1] : null;
|
|
4687
4723
|
var event = JSON.stringify(tokens);
|
|
4688
|
-
if (!config$
|
|
4724
|
+
if (!config$3.lean) {
|
|
4689
4725
|
leanLimit = false;
|
|
4690
4726
|
}
|
|
4691
4727
|
else if (!leanLimit && playbackBytes + event.length > 10485760 /* Setting.PlaybackBytesLimit */) {
|
|
@@ -4761,7 +4797,7 @@ function upload(final) {
|
|
|
4761
4797
|
return [2 /*return*/];
|
|
4762
4798
|
}
|
|
4763
4799
|
timeout = null;
|
|
4764
|
-
sendPlaybackBytes = config$
|
|
4800
|
+
sendPlaybackBytes = config$3.lean === false && playbackBytes > 0 && (playbackBytes < 1048576 /* Setting.MaxFirstPayloadBytes */ || data$1.sequence > 0);
|
|
4765
4801
|
if (sendPlaybackBytes) {
|
|
4766
4802
|
max(1 /* Metric.Playback */, 1 /* BooleanFlag.True */);
|
|
4767
4803
|
}
|
|
@@ -4814,8 +4850,8 @@ function stringify(encoded) {
|
|
|
4814
4850
|
function send(payload, zipped, sequence, beacon) {
|
|
4815
4851
|
if (beacon === void 0) { beacon = false; }
|
|
4816
4852
|
// Upload data if a valid URL is defined in the config
|
|
4817
|
-
if (typeof config$
|
|
4818
|
-
var url_1 = config$
|
|
4853
|
+
if (typeof config$3.upload === "string" /* Constant.String */) {
|
|
4854
|
+
var url_1 = config$3.upload;
|
|
4819
4855
|
var dispatched = false;
|
|
4820
4856
|
// If it's the last payload, attempt to upload using sendBeacon first.
|
|
4821
4857
|
// The advantage to using sendBeacon is that browser can decide to upload asynchronously, improving chances of success
|
|
@@ -4866,8 +4902,8 @@ function send(payload, zipped, sequence, beacon) {
|
|
|
4866
4902
|
}
|
|
4867
4903
|
}
|
|
4868
4904
|
}
|
|
4869
|
-
else if (config$
|
|
4870
|
-
var callback = config$
|
|
4905
|
+
else if (config$3.upload) {
|
|
4906
|
+
var callback = config$3.upload;
|
|
4871
4907
|
callback(payload);
|
|
4872
4908
|
done(sequence);
|
|
4873
4909
|
}
|
|
@@ -4889,7 +4925,7 @@ function check$3(xhr, sequence) {
|
|
|
4889
4925
|
// 2: Safari will terminate pending XHR requests with status code 0 if the user navigates away from the page
|
|
4890
4926
|
// In any case, we switch the upload URL to fallback configuration (if available) before re-trying one more time
|
|
4891
4927
|
if (xhr.status === 0) {
|
|
4892
|
-
config$
|
|
4928
|
+
config$3.upload = config$3.fallback ? config$3.fallback : config$3.upload;
|
|
4893
4929
|
}
|
|
4894
4930
|
// Capture the status code and number of attempts so we can report it back to the server
|
|
4895
4931
|
track$1 = { sequence: sequence, attempts: transitData.attempts, status: xhr.status };
|
|
@@ -4936,8 +4972,8 @@ function done(sequence) {
|
|
|
4936
4972
|
function delay() {
|
|
4937
4973
|
// Progressively increase delay as we continue to send more payloads from the client to the server
|
|
4938
4974
|
// If we are not uploading data to a server, and instead invoking UploadCallback, in that case keep returning configured value
|
|
4939
|
-
var gap = config$
|
|
4940
|
-
return typeof config$
|
|
4975
|
+
var gap = config$3.lean === false && discoverBytes > 0 ? 100 /* Setting.MinUploadDelay */ : data$1.sequence * config$3.delay;
|
|
4976
|
+
return typeof config$3.upload === "string" /* Constant.String */ ? Math.max(Math.min(gap, 30000 /* Setting.MaxUploadDelay */), 100 /* Setting.MinUploadDelay */) : config$3.delay;
|
|
4941
4977
|
}
|
|
4942
4978
|
function response(payload) {
|
|
4943
4979
|
var lines = payload && payload.length > 0 ? payload.split("\n") : [];
|
|
@@ -4955,8 +4991,8 @@ function response(payload) {
|
|
|
4955
4991
|
break;
|
|
4956
4992
|
case "ACTION" /* Constant.Action */:
|
|
4957
4993
|
// Invoke action callback, if configured and has a valid value
|
|
4958
|
-
if (config$
|
|
4959
|
-
config$
|
|
4994
|
+
if (config$3.action && parts.length > 1) {
|
|
4995
|
+
config$3.action(parts[1]);
|
|
4960
4996
|
}
|
|
4961
4997
|
break;
|
|
4962
4998
|
case "EXTRACT" /* Constant.Extract */:
|
|
@@ -4975,7 +5011,7 @@ function response(payload) {
|
|
|
4975
5011
|
}
|
|
4976
5012
|
break;
|
|
4977
5013
|
case "SNAPSHOT" /* Constant.Snapshot */:
|
|
4978
|
-
config$
|
|
5014
|
+
config$3.lean = false; // Disable lean mode to ensure we can send playback information to server.
|
|
4979
5015
|
snapshot();
|
|
4980
5016
|
break;
|
|
4981
5017
|
}
|
|
@@ -5309,8 +5345,8 @@ function discover() {
|
|
|
5309
5345
|
|
|
5310
5346
|
var data$6 = null;
|
|
5311
5347
|
function start$c() {
|
|
5312
|
-
if (!config$
|
|
5313
|
-
config$
|
|
5348
|
+
if (!config$3.lean && config$3.upgrade) {
|
|
5349
|
+
config$3.upgrade("Config" /* Constant.Config */);
|
|
5314
5350
|
}
|
|
5315
5351
|
data$6 = null;
|
|
5316
5352
|
}
|
|
@@ -5320,18 +5356,18 @@ function start$c() {
|
|
|
5320
5356
|
// and send all backed up layout events to the server.
|
|
5321
5357
|
function upgrade(key) {
|
|
5322
5358
|
// Upgrade only if Clarity was successfully activated on the page
|
|
5323
|
-
if (active() && config$
|
|
5324
|
-
config$
|
|
5359
|
+
if (active() && config$3.lean) {
|
|
5360
|
+
config$3.lean = false;
|
|
5325
5361
|
data$6 = { key: key };
|
|
5326
5362
|
// Update metadata to track we have upgraded this session
|
|
5327
5363
|
callback();
|
|
5328
5364
|
save();
|
|
5329
5365
|
// Callback upgrade handler, if configured
|
|
5330
|
-
if (config$
|
|
5331
|
-
config$
|
|
5366
|
+
if (config$3.upgrade) {
|
|
5367
|
+
config$3.upgrade(key);
|
|
5332
5368
|
}
|
|
5333
5369
|
encode$1(3 /* Event.Upgrade */);
|
|
5334
|
-
if (config$
|
|
5370
|
+
if (config$3.lite) {
|
|
5335
5371
|
start$d();
|
|
5336
5372
|
start$q();
|
|
5337
5373
|
}
|
|
@@ -5619,7 +5655,7 @@ function compute$2() {
|
|
|
5619
5655
|
if (updateConsent) {
|
|
5620
5656
|
encode$1(47 /* Event.Consent */);
|
|
5621
5657
|
updateConsent = false;
|
|
5622
|
-
if (!config$
|
|
5658
|
+
if (!config$3.track) {
|
|
5623
5659
|
var ics = (_a = window.google_tag_data) === null || _a === void 0 ? void 0 : _a.ics;
|
|
5624
5660
|
if (ics === null || ics === void 0 ? void 0 : ics.usedUpdate) {
|
|
5625
5661
|
processConsent();
|
|
@@ -5644,11 +5680,13 @@ function start$8() {
|
|
|
5644
5680
|
// Populate ids for this page
|
|
5645
5681
|
var s = session();
|
|
5646
5682
|
var u = user();
|
|
5647
|
-
var projectId = config$
|
|
5648
|
-
|
|
5683
|
+
var projectId = config$3.projectId || hash(location.host);
|
|
5684
|
+
var userId = config$3.externalSession && config$3.userId ? config$3.userId : u.id;
|
|
5685
|
+
var sessionId = config$3.externalSession && config$3.sessionId ? config$3.sessionId : s.session;
|
|
5686
|
+
data$2 = { projectId: projectId, userId: userId, sessionId: sessionId, pageNum: s.count };
|
|
5649
5687
|
// Override configuration based on what's in the session storage, unless it is blank (e.g. using upload callback, like in devtools)
|
|
5650
|
-
config$
|
|
5651
|
-
config$
|
|
5688
|
+
config$3.lean = config$3.track && s.upgrade !== null ? s.upgrade === 0 /* BooleanFlag.False */ : config$3.lean;
|
|
5689
|
+
config$3.upload = config$3.track && typeof config$3.upload === "string" /* Constant.String */ && s.upload && s.upload.length > "https://" /* Constant.HTTPS */.length ? s.upload : config$3.upload;
|
|
5652
5690
|
// Log page metadata as dimensions
|
|
5653
5691
|
log(0 /* Dimension.UserAgent */, ua);
|
|
5654
5692
|
log(3 /* Dimension.PageTitle */, title);
|
|
@@ -5686,7 +5724,7 @@ function start$8() {
|
|
|
5686
5724
|
max(16 /* Metric.ColorDepth */, Math.round(screen.colorDepth));
|
|
5687
5725
|
}
|
|
5688
5726
|
// Read cookies specified in configuration
|
|
5689
|
-
for (var _i = 0, _d = config$
|
|
5727
|
+
for (var _i = 0, _d = config$3.cookies; _i < _d.length; _i++) {
|
|
5690
5728
|
var key = _d[_i];
|
|
5691
5729
|
var value = getCookie(key);
|
|
5692
5730
|
if (value) {
|
|
@@ -5698,14 +5736,16 @@ function start$8() {
|
|
|
5698
5736
|
if (consentStatus === null) {
|
|
5699
5737
|
consentStatus = {
|
|
5700
5738
|
source: u.consent ? 6 /* ConsentSource.Cookie */ : 0 /* ConsentSource.Implicit */,
|
|
5701
|
-
ad_Storage: config$
|
|
5702
|
-
analytics_Storage: config$
|
|
5739
|
+
ad_Storage: config$3.track ? "granted" /* Constant.Granted */ : "denied" /* Constant.Denied */,
|
|
5740
|
+
analytics_Storage: config$3.track ? "granted" /* Constant.Granted */ : "denied" /* Constant.Denied */,
|
|
5703
5741
|
};
|
|
5704
5742
|
}
|
|
5705
5743
|
var consent = getConsentData(consentStatus);
|
|
5706
5744
|
config$1(consent);
|
|
5707
|
-
// Track ids using a cookie if configuration allows it
|
|
5708
|
-
|
|
5745
|
+
// Track ids using a cookie if configuration allows it, skip if using external session
|
|
5746
|
+
if (!config$3.externalSession) {
|
|
5747
|
+
track(u);
|
|
5748
|
+
}
|
|
5709
5749
|
}
|
|
5710
5750
|
function userAgentData() {
|
|
5711
5751
|
var uaData = navigator["userAgentData"];
|
|
@@ -5731,14 +5771,14 @@ function metadata(cb, wait, recall, consentInfo) {
|
|
|
5731
5771
|
if (wait === void 0) { wait = true; }
|
|
5732
5772
|
if (recall === void 0) { recall = false; }
|
|
5733
5773
|
if (consentInfo === void 0) { consentInfo = false; }
|
|
5734
|
-
var upgraded = config$
|
|
5774
|
+
var upgraded = config$3.lean ? 0 /* BooleanFlag.False */ : 1 /* BooleanFlag.True */;
|
|
5735
5775
|
var called = false;
|
|
5736
5776
|
// if caller hasn't specified that they want to skip waiting for upgrade but we've already upgraded, we need to
|
|
5737
5777
|
// directly execute the callback in addition to adding to our list as we only process callbacks at the moment
|
|
5738
5778
|
// we go through the upgrading flow.
|
|
5739
5779
|
if (data$2 && (upgraded || wait === false)) {
|
|
5740
5780
|
// Immediately invoke the callback if the caller explicitly doesn't want to wait for the upgrade confirmation
|
|
5741
|
-
cb(data$2, !config$
|
|
5781
|
+
cb(data$2, !config$3.lean, consentInfo ? consentStatus : undefined);
|
|
5742
5782
|
called = true;
|
|
5743
5783
|
}
|
|
5744
5784
|
if (recall || !called) {
|
|
@@ -5778,15 +5818,15 @@ function consentv2(consentState, source) {
|
|
|
5778
5818
|
consentStatus = updatedStatus;
|
|
5779
5819
|
callback(true);
|
|
5780
5820
|
var consentData = getConsentData(consentStatus);
|
|
5781
|
-
if (!consentData.analytics_Storage && config$
|
|
5782
|
-
config$
|
|
5821
|
+
if (!consentData.analytics_Storage && config$3.track) {
|
|
5822
|
+
config$3.track = false;
|
|
5783
5823
|
clear(true);
|
|
5784
5824
|
stop();
|
|
5785
5825
|
window.setTimeout(start, 250 /* Setting.RestartDelay */);
|
|
5786
5826
|
return;
|
|
5787
5827
|
}
|
|
5788
5828
|
if (active() && consentData.analytics_Storage) {
|
|
5789
|
-
config$
|
|
5829
|
+
config$3.track = true;
|
|
5790
5830
|
track(user(), 1 /* BooleanFlag.True */);
|
|
5791
5831
|
save();
|
|
5792
5832
|
}
|
|
@@ -5817,7 +5857,7 @@ function clear(all) {
|
|
|
5817
5857
|
}
|
|
5818
5858
|
function tab() {
|
|
5819
5859
|
var id = shortid();
|
|
5820
|
-
if (config$
|
|
5860
|
+
if (config$3.track && supported(window, "sessionStorage" /* Constant.SessionStorage */)) {
|
|
5821
5861
|
var value = sessionStorage.getItem("_cltk" /* Constant.TabKey */);
|
|
5822
5862
|
id = value ? value : id;
|
|
5823
5863
|
sessionStorage.setItem("_cltk" /* Constant.TabKey */, id);
|
|
@@ -5826,15 +5866,15 @@ function tab() {
|
|
|
5826
5866
|
}
|
|
5827
5867
|
function callback(consentUpdate) {
|
|
5828
5868
|
if (consentUpdate === void 0) { consentUpdate = false; }
|
|
5829
|
-
var upgrade = config$
|
|
5869
|
+
var upgrade = config$3.lean ? 0 /* BooleanFlag.False */ : 1 /* BooleanFlag.True */;
|
|
5830
5870
|
processCallback(upgrade, consentUpdate);
|
|
5831
5871
|
}
|
|
5832
5872
|
function save() {
|
|
5833
|
-
if (!data$2 || !config$
|
|
5873
|
+
if (!data$2 || !config$3.track || config$3.externalSession)
|
|
5834
5874
|
return;
|
|
5835
5875
|
var ts = Math.round(Date.now());
|
|
5836
|
-
var upload = config$
|
|
5837
|
-
var upgrade = config$
|
|
5876
|
+
var upload = config$3.upload && typeof config$3.upload === "string" /* Constant.String */ ? config$3.upload.replace("https://" /* Constant.HTTPS */, "" /* Constant.Empty */) : "" /* Constant.Empty */;
|
|
5877
|
+
var upgrade = config$3.lean ? 0 /* BooleanFlag.False */ : 1 /* BooleanFlag.True */;
|
|
5838
5878
|
setCookie("_clsk" /* Constant.SessionKey */, [data$2.sessionId, ts, data$2.pageNum, upgrade, upload].join(COOKIE_SEP), 1 /* Setting.SessionExpire */);
|
|
5839
5879
|
}
|
|
5840
5880
|
function processCallback(upgrade, consentUpdate) {
|
|
@@ -5845,7 +5885,7 @@ function processCallback(upgrade, consentUpdate) {
|
|
|
5845
5885
|
if (cb.callback &&
|
|
5846
5886
|
((!cb.called && !consentUpdate) || (cb.consentInfo && consentUpdate)) && //If consentUpdate is true, we only call the callback if it has consentInfo
|
|
5847
5887
|
(!cb.wait || upgrade)) {
|
|
5848
|
-
cb.callback(data$2, !config$
|
|
5888
|
+
cb.callback(data$2, !config$3.lean, cb.consentInfo ? consentStatus : undefined);
|
|
5849
5889
|
cb.called = true;
|
|
5850
5890
|
if (!cb.recall) {
|
|
5851
5891
|
callbacks.splice(i, 1);
|
|
@@ -5863,7 +5903,7 @@ function track(u, consent) {
|
|
|
5863
5903
|
// E.g. Math.ceil(1628735962643 / (24*60*60*1000)) => 18852 (days) => ejo in base36 (13 bytes => 3 bytes)
|
|
5864
5904
|
var end = Math.ceil((Date.now() + (365 /* Setting.Expire */ * 86400000 /* Time.Day */)) / 86400000 /* Time.Day */);
|
|
5865
5905
|
// If DOB is not set in the user object, use the date set in the config as a DOB
|
|
5866
|
-
var dob = u.dob === 0 ? (config$
|
|
5906
|
+
var dob = u.dob === 0 ? (config$3.dob === null ? 0 : config$3.dob) : u.dob;
|
|
5867
5907
|
// To avoid cookie churn, write user id cookie only once every day
|
|
5868
5908
|
if (u.expiry === null || Math.abs(end - u.expiry) >= 1 /* Setting.CookieInterval */ || u.consent !== consent || u.dob !== dob) {
|
|
5869
5909
|
var cookieParts = [data$2.userId, 2 /* Setting.CookieVersion */, end.toString(36), consent, dob];
|
|
@@ -5879,7 +5919,7 @@ function shortid() {
|
|
|
5879
5919
|
}
|
|
5880
5920
|
function session() {
|
|
5881
5921
|
var output = { session: shortid(), ts: Math.round(Date.now()), count: 1, upgrade: null, upload: "" /* Constant.Empty */ };
|
|
5882
|
-
var value = getCookie("_clsk" /* Constant.SessionKey */, !config$
|
|
5922
|
+
var value = getCookie("_clsk" /* Constant.SessionKey */, !config$3.includeSubdomains);
|
|
5883
5923
|
if (value) {
|
|
5884
5924
|
// Maintaining support for pipe separator for backward compatibility, this can be removed in future releases
|
|
5885
5925
|
var parts = value.includes("^" /* Constant.Caret */) ? value.split("^" /* Constant.Caret */) : value.split("|" /* Constant.Pipe */);
|
|
@@ -5900,7 +5940,7 @@ function num(string, base) {
|
|
|
5900
5940
|
}
|
|
5901
5941
|
function user() {
|
|
5902
5942
|
var output = { id: shortid(), version: 0, expiry: null, consent: 0 /* BooleanFlag.False */, dob: 0 };
|
|
5903
|
-
var cookie = getCookie("_clck" /* Constant.CookieKey */, !config$
|
|
5943
|
+
var cookie = getCookie("_clck" /* Constant.CookieKey */, !config$3.includeSubdomains);
|
|
5904
5944
|
if (cookie && cookie.length > 0) {
|
|
5905
5945
|
// Splitting and looking up first part for forward compatibility, in case we wish to store additional information in a cookie
|
|
5906
5946
|
// Maintaining support for pipe separator for backward compatibility, this can be removed in future releases
|
|
@@ -5920,9 +5960,9 @@ function user() {
|
|
|
5920
5960
|
output.dob = num(parts[4]);
|
|
5921
5961
|
}
|
|
5922
5962
|
// Set track configuration to true for this user if we have explicit consent, regardless of project setting
|
|
5923
|
-
config$
|
|
5963
|
+
config$3.track = config$3.track || output.consent === 1 /* BooleanFlag.True */;
|
|
5924
5964
|
// Get user id from cookie only if we tracking is enabled, otherwise fallback to a random id
|
|
5925
|
-
output.id = config$
|
|
5965
|
+
output.id = config$3.track ? parts[0] : output.id;
|
|
5926
5966
|
}
|
|
5927
5967
|
return output;
|
|
5928
5968
|
}
|
|
@@ -5979,7 +6019,7 @@ function reset$2() {
|
|
|
5979
6019
|
function report(e) {
|
|
5980
6020
|
// Do not report the same message twice for the same page
|
|
5981
6021
|
if (history$1 && history$1.indexOf(e.message) === -1) {
|
|
5982
|
-
var url = config$
|
|
6022
|
+
var url = config$3.report;
|
|
5983
6023
|
if (url && url.length > 0 && data$1) {
|
|
5984
6024
|
var payload = { v: data$1.version, p: data$1.projectId, u: data$1.userId, s: data$1.sessionId, n: data$1.pageNum };
|
|
5985
6025
|
if (e.message) {
|
|
@@ -6164,8 +6204,8 @@ function config(override) {
|
|
|
6164
6204
|
return false;
|
|
6165
6205
|
}
|
|
6166
6206
|
for (var key in override) {
|
|
6167
|
-
if (key in config$
|
|
6168
|
-
config$
|
|
6207
|
+
if (key in config$3) {
|
|
6208
|
+
config$3[key] = override[key];
|
|
6169
6209
|
}
|
|
6170
6210
|
}
|
|
6171
6211
|
return true;
|
|
@@ -6207,12 +6247,14 @@ var diagnostic = /*#__PURE__*/Object.freeze({
|
|
|
6207
6247
|
});
|
|
6208
6248
|
|
|
6209
6249
|
function start$3() {
|
|
6210
|
-
// The order below is important
|
|
6250
|
+
// The order below is important
|
|
6211
6251
|
// and is determined by interdependencies of modules
|
|
6252
|
+
config$2(config$3.excludeClassNames || []);
|
|
6253
|
+
console.log("\uD83D\uDE80 \uD83D\uDC25 ~ start ~ config:", config$3);
|
|
6212
6254
|
start$n();
|
|
6213
6255
|
start$k();
|
|
6214
6256
|
start$l();
|
|
6215
|
-
if (config$
|
|
6257
|
+
if (config$3.delayDom) {
|
|
6216
6258
|
// Lazy load layout module as part of page load time performance improvements experiment
|
|
6217
6259
|
bind(window, 'load', function () {
|
|
6218
6260
|
start$m();
|
|
@@ -6461,7 +6503,7 @@ function process(entries) {
|
|
|
6461
6503
|
case "resource" /* Constant.Resource */:
|
|
6462
6504
|
var name_1 = entry.name;
|
|
6463
6505
|
log(4 /* Dimension.NetworkHosts */, host(name_1));
|
|
6464
|
-
if (name_1 === config$
|
|
6506
|
+
if (name_1 === config$3.upload || name_1 === config$3.fallback) {
|
|
6465
6507
|
max(28 /* Metric.UploadTime */, entry.duration);
|
|
6466
6508
|
}
|
|
6467
6509
|
break;
|