clarity-js 0.8.23 → 0.8.25

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.
@@ -13,8 +13,8 @@ var dom = /*#__PURE__*/Object.freeze({
13
13
  get parse () { return parse; },
14
14
  get removeIFrame () { return removeIFrame; },
15
15
  get sameorigin () { return sameorigin; },
16
- get start () { return start$j; },
17
- get stop () { return stop$h; },
16
+ get start () { return start$k; },
17
+ get stop () { return stop$i; },
18
18
  get update () { return update; },
19
19
  get updates () { return updates$2; }
20
20
  });
@@ -83,11 +83,14 @@ var clarity = /*#__PURE__*/Object.freeze({
83
83
  get identify () { return identify; },
84
84
  get metadata () { return metadata; },
85
85
  get pause () { return pause; },
86
+ get queue () { return queue; },
87
+ get register () { return register; },
86
88
  get resume () { return resume; },
87
89
  get set () { return set; },
88
90
  get signal () { return signal; },
89
91
  get start () { return start; },
90
92
  get stop () { return stop; },
93
+ get time () { return time; },
91
94
  get upgrade () { return upgrade; },
92
95
  get version () { return version$1; }
93
96
  });
@@ -167,7 +170,7 @@ var startTime = 0;
167
170
  function computeStartTime() {
168
171
  return performance.now() + performance.timeOrigin;
169
172
  }
170
- function start$J() {
173
+ function start$K() {
171
174
  startTime = computeStartTime();
172
175
  }
173
176
  // event.timestamp is number of milliseconds elapsed since the document was loaded
@@ -183,11 +186,11 @@ function time(event) {
183
186
  var origin = event && event.view ? event.view.performance.timeOrigin : performance.timeOrigin;
184
187
  return Math.max(Math.round(ts + origin - baseline), 0);
185
188
  }
186
- function stop$G() {
189
+ function stop$H() {
187
190
  startTime = 0;
188
191
  }
189
192
 
190
- var version$1 = "0.8.23";
193
+ var version$1 = "0.8.25";
191
194
 
192
195
  // tslint:disable: no-bitwise
193
196
  function hash (input, precision) {
@@ -408,7 +411,7 @@ function redact$1(value) {
408
411
  var state$b = null;
409
412
  var buffer = null;
410
413
  var update$2 = false;
411
- function start$I() {
414
+ function start$J() {
412
415
  update$2 = false;
413
416
  reset$s();
414
417
  }
@@ -545,7 +548,7 @@ function compute$f() {
545
548
  encode$1(4 /* Event.Baseline */);
546
549
  }
547
550
  }
548
- function stop$F() {
551
+ function stop$G() {
549
552
  reset$s();
550
553
  }
551
554
 
@@ -554,19 +557,19 @@ var baseline = /*#__PURE__*/Object.freeze({
554
557
  activity: activity,
555
558
  compute: compute$f,
556
559
  reset: reset$s,
557
- start: start$I,
560
+ start: start$J,
558
561
  get state () { return state$b; },
559
- stop: stop$F,
562
+ stop: stop$G,
560
563
  track: track$8,
561
564
  visibility: visibility
562
565
  });
563
566
 
564
567
  var data$k = null;
565
568
  var updateConsent = true;
566
- function start$H() {
569
+ function start$I() {
567
570
  updateConsent = true;
568
571
  }
569
- function stop$E() {
572
+ function stop$F() {
570
573
  updateConsent = true;
571
574
  }
572
575
  function config$1(consent) {
@@ -599,8 +602,8 @@ var consent$2 = /*#__PURE__*/Object.freeze({
599
602
  consent: consent$1,
600
603
  consentv2: consentv2$1,
601
604
  get data () { return data$k; },
602
- start: start$H,
603
- stop: stop$E
605
+ start: start$I,
606
+ stop: stop$F
604
607
  });
605
608
 
606
609
  var data$j = null;
@@ -623,12 +626,12 @@ function event(a, b) {
623
626
 
624
627
  var data$i = null;
625
628
  var updates$3 = null;
626
- function start$G() {
629
+ function start$H() {
627
630
  data$i = {};
628
631
  updates$3 = {};
629
632
  count$1(5 /* Metric.InvokeCount */);
630
633
  }
631
- function stop$D() {
634
+ function stop$E() {
632
635
  data$i = {};
633
636
  updates$3 = {};
634
637
  }
@@ -684,7 +687,7 @@ var data$h;
684
687
  var last = 0;
685
688
  var interval = 0;
686
689
  var timeout$7 = null;
687
- function start$F() {
690
+ function start$G() {
688
691
  interval = 60000 /* Setting.PingInterval */;
689
692
  last = 0;
690
693
  }
@@ -706,7 +709,7 @@ function ping() {
706
709
  suspend();
707
710
  }
708
711
  }
709
- function stop$C() {
712
+ function stop$D() {
710
713
  clearTimeout$1(timeout$7);
711
714
  last = 0;
712
715
  interval = 0;
@@ -716,15 +719,15 @@ var ping$1 = /*#__PURE__*/Object.freeze({
716
719
  __proto__: null,
717
720
  get data () { return data$h; },
718
721
  reset: reset$q,
719
- start: start$F,
720
- stop: stop$C
722
+ start: start$G,
723
+ stop: stop$D
721
724
  });
722
725
 
723
726
  var data$g = null;
724
- function start$E() {
727
+ function start$F() {
725
728
  data$g = {};
726
729
  }
727
- function stop$B() {
730
+ function stop$C() {
728
731
  data$g = {};
729
732
  }
730
733
  function track$7(event, time) {
@@ -756,8 +759,8 @@ var summary = /*#__PURE__*/Object.freeze({
756
759
  compute: compute$c,
757
760
  get data () { return data$g; },
758
761
  reset: reset$p,
759
- start: start$E,
760
- stop: stop$B,
762
+ start: start$F,
763
+ stop: stop$C,
761
764
  track: track$7
762
765
  });
763
766
 
@@ -875,7 +878,7 @@ function read(stream) {
875
878
  }
876
879
 
877
880
  var data$f = null;
878
- function start$D() {
881
+ function start$E() {
879
882
  reset$o();
880
883
  }
881
884
  function set(variable, value) {
@@ -937,7 +940,7 @@ function compute$b() {
937
940
  function reset$o() {
938
941
  data$f = {};
939
942
  }
940
- function stop$A() {
943
+ function stop$B() {
941
944
  reset$o();
942
945
  }
943
946
  function redact(input) {
@@ -977,8 +980,8 @@ var variable = /*#__PURE__*/Object.freeze({
977
980
  identify: identify,
978
981
  reset: reset$o,
979
982
  set: set,
980
- start: start$D,
981
- stop: stop$A
983
+ start: start$E,
984
+ stop: stop$B
982
985
  });
983
986
 
984
987
  var data$e = {};
@@ -987,7 +990,7 @@ var variables = {};
987
990
  var selectors = {};
988
991
  var hashes = {};
989
992
  var validation = {};
990
- function start$C() {
993
+ function start$D() {
991
994
  reset$n();
992
995
  }
993
996
  // Input string is of the following form:
@@ -1103,7 +1106,7 @@ function update$1(key, subkey, value) {
1103
1106
  }
1104
1107
  return;
1105
1108
  }
1106
- function stop$z() {
1109
+ function stop$A() {
1107
1110
  reset$n();
1108
1111
  }
1109
1112
  function parse$1(variable) {
@@ -1176,8 +1179,8 @@ var extract = /*#__PURE__*/Object.freeze({
1176
1179
  data: data$e,
1177
1180
  keys: keys,
1178
1181
  reset: reset$n,
1179
- start: start$C,
1180
- stop: stop$z,
1182
+ start: start$D,
1183
+ stop: stop$A,
1181
1184
  trigger: trigger$2,
1182
1185
  update: update$1
1183
1186
  });
@@ -1211,18 +1214,18 @@ function signalsEvent(signalsPayload) {
1211
1214
  }
1212
1215
 
1213
1216
  var modules$1 = [baseline, dimension, variable, limit, summary, consent$2, metadata$1, envelope$1, upload$1, ping$1, upgrade$1, extract];
1214
- function start$B() {
1217
+ function start$C() {
1215
1218
  // Metric needs to be initialized before we can start measuring. so metric is not wrapped in measure
1216
- start$G();
1219
+ start$H();
1217
1220
  modules$1.forEach(function (x) { return measure(x.start)(); });
1218
1221
  }
1219
- function stop$y() {
1222
+ function stop$z() {
1220
1223
  // Stop modules in the reverse order of their initialization
1221
1224
  // The ordering below should respect inter-module dependency.
1222
1225
  // E.g. if upgrade depends on upload, then upgrade needs to end before upload.
1223
1226
  // Similarly, if upload depends on metadata, upload needs to end before metadata.
1224
1227
  modules$1.slice().reverse().forEach(function (x) { return measure(x.stop)(); });
1225
- stop$D();
1228
+ stop$E();
1226
1229
  }
1227
1230
  function compute$9() {
1228
1231
  compute$b();
@@ -1237,7 +1240,7 @@ function compute$9() {
1237
1240
 
1238
1241
  var history$5 = [];
1239
1242
  var data$d;
1240
- function start$A() {
1243
+ function start$B() {
1241
1244
  history$5 = [];
1242
1245
  max(26 /* Metric.Automation */, navigator.webdriver ? 1 /* BooleanFlag.True */ : 0 /* BooleanFlag.False */);
1243
1246
  try {
@@ -1261,14 +1264,13 @@ function check$4(id, target, input) {
1261
1264
  }
1262
1265
 
1263
1266
  var state$a = [];
1264
- function start$z() {
1267
+ function start$A() {
1265
1268
  reset$m();
1266
1269
  }
1267
1270
  function observe$c(root) {
1268
1271
  bind(root, "change", recompute$8, true);
1269
1272
  }
1270
1273
  function recompute$8(evt) {
1271
- recompute$8.dn = 5 /* FunctionNames.ChangeRecompute */;
1272
1274
  var element = target(evt);
1273
1275
  if (element) {
1274
1276
  var value = element.value;
@@ -1280,7 +1282,7 @@ function recompute$8(evt) {
1280
1282
  function reset$m() {
1281
1283
  state$a = [];
1282
1284
  }
1283
- function stop$x() {
1285
+ function stop$y() {
1284
1286
  reset$m();
1285
1287
  }
1286
1288
 
@@ -1302,7 +1304,7 @@ function offset(element) {
1302
1304
 
1303
1305
  var UserInputTags = ["input", "textarea", "radio", "button", "canvas", "select"];
1304
1306
  var state$9 = [];
1305
- function start$y() {
1307
+ function start$z() {
1306
1308
  reset$l();
1307
1309
  }
1308
1310
  function observe$b(root) {
@@ -1310,7 +1312,6 @@ function observe$b(root) {
1310
1312
  bind(root, "contextmenu", handler$3.bind(this, 48 /* Event.ContextMenu */, root), true);
1311
1313
  }
1312
1314
  function handler$3(event, root, evt) {
1313
- handler$3.dn = 6 /* FunctionNames.ClickHandler */;
1314
1315
  var frame = iframe(root);
1315
1316
  var d = frame && frame.contentDocument ? frame.contentDocument.documentElement : document.documentElement;
1316
1317
  var x = "pageX" in evt ? Math.round(evt.pageX) : ("clientX" in evt ? Math.round(evt["clientX"] + d.scrollLeft) : null);
@@ -1433,12 +1434,12 @@ function context(a) {
1433
1434
  function reset$l() {
1434
1435
  state$9 = [];
1435
1436
  }
1436
- function stop$w() {
1437
+ function stop$x() {
1437
1438
  reset$l();
1438
1439
  }
1439
1440
 
1440
1441
  var state$8 = [];
1441
- function start$x() {
1442
+ function start$y() {
1442
1443
  reset$k();
1443
1444
  }
1444
1445
  function observe$a(root) {
@@ -1447,27 +1448,25 @@ function observe$a(root) {
1447
1448
  bind(root, "paste", recompute$7.bind(this, 2 /* Clipboard.Paste */), true);
1448
1449
  }
1449
1450
  function recompute$7(action, evt) {
1450
- recompute$7.dn = 7 /* FunctionNames.ClipboardRecompute */;
1451
1451
  state$8.push({ time: time(evt), event: 38 /* Event.Clipboard */, data: { target: target(evt), action: action } });
1452
1452
  schedule(encode$4.bind(this, 38 /* Event.Clipboard */));
1453
1453
  }
1454
1454
  function reset$k() {
1455
1455
  state$8 = [];
1456
1456
  }
1457
- function stop$v() {
1457
+ function stop$w() {
1458
1458
  reset$k();
1459
1459
  }
1460
1460
 
1461
1461
  var timeout$6 = null;
1462
1462
  var state$7 = [];
1463
- function start$w() {
1463
+ function start$x() {
1464
1464
  reset$j();
1465
1465
  }
1466
1466
  function observe$9(root) {
1467
1467
  bind(root, "input", recompute$6, true);
1468
1468
  }
1469
1469
  function recompute$6(evt) {
1470
- recompute$6.dn = 9 /* FunctionNames.InputRecompute */;
1471
1470
  var input = target(evt);
1472
1471
  var value = get(input);
1473
1472
  if (input && input.type && value) {
@@ -1479,7 +1478,7 @@ function recompute$6(evt) {
1479
1478
  v = input.checked ? "true" : "false";
1480
1479
  break;
1481
1480
  }
1482
- var data = { target: input, value: v, type: t };
1481
+ var data = { target: input, value: v, type: t, trust: evt.isTrusted ? 1 /* BooleanFlag.True */ : 0 /* BooleanFlag.False */ };
1483
1482
  // If last entry in the queue is for the same target node as the current one, remove it so we can later swap it with current data.
1484
1483
  if (state$7.length > 0 && (state$7[state$7.length - 1].data.target === data.target)) {
1485
1484
  state$7.pop();
@@ -1495,7 +1494,7 @@ function process$7(event) {
1495
1494
  function reset$j() {
1496
1495
  state$7 = [];
1497
1496
  }
1498
- function stop$u() {
1497
+ function stop$v() {
1499
1498
  clearTimeout$1(timeout$6);
1500
1499
  reset$j();
1501
1500
  }
@@ -1505,7 +1504,7 @@ var timeout$5 = null;
1505
1504
  var hasPrimaryTouch = false;
1506
1505
  var primaryTouchId = 0;
1507
1506
  var activeTouchPointIds = new Set();
1508
- function start$v() {
1507
+ function start$w() {
1509
1508
  reset$i();
1510
1509
  }
1511
1510
  function observe$8(root) {
@@ -1520,7 +1519,6 @@ function observe$8(root) {
1520
1519
  bind(root, "touchcancel", touch.bind(this, 20 /* Event.TouchCancel */, root), true);
1521
1520
  }
1522
1521
  function mouse(event, root, evt) {
1523
- mouse.dn = 10 /* FunctionNames.PointerMouse */;
1524
1522
  var frame = iframe(root);
1525
1523
  var d = frame && frame.contentDocument ? frame.contentDocument.documentElement : document.documentElement;
1526
1524
  var x = "pageX" in evt ? Math.round(evt.pageX) : ("clientX" in evt ? Math.round(evt["clientX"] + d.scrollLeft) : null);
@@ -1537,7 +1535,6 @@ function mouse(event, root, evt) {
1537
1535
  }
1538
1536
  }
1539
1537
  function touch(event, root, evt) {
1540
- touch.dn = 11 /* FunctionNames.PointerTouch */;
1541
1538
  var frame = iframe(root);
1542
1539
  var d = frame && frame.contentDocument ? frame.contentDocument.documentElement : document.documentElement;
1543
1540
  var touches = evt.changedTouches;
@@ -1615,7 +1612,7 @@ function similar$1(last, current) {
1615
1612
  var sameId = current.data.id !== undefined ? current.data.id === last.data.id : true;
1616
1613
  return current.event === last.event && match && distance < 20 /* Setting.Distance */ && gap < 25 /* Setting.PointerInterval */ && sameId;
1617
1614
  }
1618
- function stop$t() {
1615
+ function stop$u() {
1619
1616
  clearTimeout$1(timeout$5);
1620
1617
  // Send out any pending pointer events in the pipeline
1621
1618
  if (state$6.length > 0) {
@@ -1675,13 +1672,12 @@ var data$c;
1675
1672
  var timeout$4 = null;
1676
1673
  var initialStateLogged = false;
1677
1674
  var throttledRecompute$1 = throttle(recompute$5, 500 /* Setting.LookAhead */);
1678
- function start$u() {
1675
+ function start$v() {
1679
1676
  initialStateLogged = false;
1680
1677
  bind(window, "resize", throttledRecompute$1);
1681
1678
  recompute$5();
1682
1679
  }
1683
1680
  function recompute$5() {
1684
- recompute$5.dn = 12 /* FunctionNames.ResizeRecompute */;
1685
1681
  var de = document.documentElement;
1686
1682
  // window.innerWidth includes width of the scrollbar and is not a true representation of the viewport width.
1687
1683
  // Therefore, when possible, use documentElement's clientWidth property.
@@ -1706,7 +1702,7 @@ function reset$h() {
1706
1702
  clearTimeout$1(timeout$4);
1707
1703
  throttledRecompute$1.cleanup();
1708
1704
  }
1709
- function stop$s() {
1705
+ function stop$t() {
1710
1706
  reset$h();
1711
1707
  }
1712
1708
 
@@ -1714,7 +1710,7 @@ var state$5 = [];
1714
1710
  var initialTop = null;
1715
1711
  var initialBottom = null;
1716
1712
  var timeout$3 = null;
1717
- function start$t() {
1713
+ function start$u() {
1718
1714
  state$5 = [];
1719
1715
  recompute$4();
1720
1716
  }
@@ -1725,7 +1721,6 @@ function observe$7(root) {
1725
1721
  }
1726
1722
  function recompute$4(event) {
1727
1723
  if (event === void 0) { event = null; }
1728
- recompute$4.dn = 13 /* FunctionNames.ScrollRecompute */;
1729
1724
  var w = window;
1730
1725
  var de = document.documentElement;
1731
1726
  var element = event ? target(event) : de;
@@ -1802,7 +1797,6 @@ function similar(last, current) {
1802
1797
  }
1803
1798
  function compute$8() {
1804
1799
  var _a, _b;
1805
- compute$8.dn = 14 /* FunctionNames.ScrollCompute */;
1806
1800
  if (initialTop) {
1807
1801
  var top_1 = metadata$2(initialTop, null);
1808
1802
  log(31 /* Dimension.InitialScrollTop */, (_a = top_1 === null || top_1 === void 0 ? void 0 : top_1.hash) === null || _a === void 0 ? void 0 : _a.join("." /* Constant.Dot */));
@@ -1812,7 +1806,7 @@ function compute$8() {
1812
1806
  log(32 /* Dimension.InitialScrollBottom */, (_b = bottom === null || bottom === void 0 ? void 0 : bottom.hash) === null || _b === void 0 ? void 0 : _b.join("." /* Constant.Dot */));
1813
1807
  }
1814
1808
  }
1815
- function stop$r() {
1809
+ function stop$s() {
1816
1810
  clearTimeout$1(timeout$3);
1817
1811
  throttledRecompute.cleanup();
1818
1812
  state$5 = [];
@@ -1823,7 +1817,7 @@ function stop$r() {
1823
1817
  var data$b = null;
1824
1818
  var previous = null;
1825
1819
  var timeout$2 = null;
1826
- function start$s() {
1820
+ function start$t() {
1827
1821
  reset$f();
1828
1822
  }
1829
1823
  function observe$6(root) {
@@ -1831,7 +1825,6 @@ function observe$6(root) {
1831
1825
  bind(root, "selectionchange", recompute$3.bind(this, root), true);
1832
1826
  }
1833
1827
  function recompute$3(root) {
1834
- recompute$3.dn = 15 /* FunctionNames.SelectionRecompute */;
1835
1828
  var doc = root.nodeType === Node.DOCUMENT_NODE ? root : document;
1836
1829
  var current = doc.getSelection();
1837
1830
  // Bail out if we don't have a valid selection
@@ -1868,36 +1861,34 @@ function reset$f() {
1868
1861
  previous = null;
1869
1862
  data$b = { start: 0, startOffset: 0, end: 0, endOffset: 0 };
1870
1863
  }
1871
- function stop$q() {
1864
+ function stop$r() {
1872
1865
  reset$f();
1873
1866
  clearTimeout$1(timeout$2);
1874
1867
  }
1875
1868
 
1876
1869
  var state$4 = [];
1877
- function start$r() {
1870
+ function start$s() {
1878
1871
  reset$e();
1879
1872
  }
1880
1873
  function observe$5(root) {
1881
1874
  bind(root, "submit", recompute$2, true);
1882
1875
  }
1883
1876
  function recompute$2(evt) {
1884
- recompute$2.dn = 16 /* FunctionNames.SubmitRecompute */;
1885
1877
  state$4.push({ time: time(evt), event: 39 /* Event.Submit */, data: { target: target(evt) } });
1886
1878
  schedule(encode$4.bind(this, 39 /* Event.Submit */));
1887
1879
  }
1888
1880
  function reset$e() {
1889
1881
  state$4 = [];
1890
1882
  }
1891
- function stop$p() {
1883
+ function stop$q() {
1892
1884
  reset$e();
1893
1885
  }
1894
1886
 
1895
1887
  var data$a;
1896
- function start$q() {
1888
+ function start$r() {
1897
1889
  bind(window, "pagehide", recompute$1);
1898
1890
  }
1899
1891
  function recompute$1(evt) {
1900
- recompute$1.dn = 17 /* FunctionNames.UnloadRecompute */;
1901
1892
  data$a = { name: evt.type, persisted: evt.persisted ? 1 /* BooleanFlag.True */ : 0 /* BooleanFlag.False */ };
1902
1893
  encode$4(26 /* Event.Unload */, time(evt));
1903
1894
  stop();
@@ -1905,56 +1896,54 @@ function recompute$1(evt) {
1905
1896
  function reset$d() {
1906
1897
  data$a = null;
1907
1898
  }
1908
- function stop$o() {
1899
+ function stop$p() {
1909
1900
  reset$d();
1910
1901
  }
1911
1902
 
1912
1903
  var data$9;
1913
- function start$p() {
1904
+ function start$q() {
1914
1905
  bind(document, "visibilitychange", recompute);
1915
1906
  recompute();
1916
1907
  }
1917
1908
  function recompute(evt) {
1918
1909
  if (evt === void 0) { evt = null; }
1919
- recompute.dn = 18 /* FunctionNames.VisibilityRecompute */;
1920
1910
  data$9 = { visible: "visibilityState" in document ? document.visibilityState : "default" };
1921
1911
  encode$4(28 /* Event.Visibility */, time(evt));
1922
1912
  }
1923
1913
  function reset$c() {
1924
1914
  data$9 = null;
1925
1915
  }
1926
- function stop$n() {
1916
+ function stop$o() {
1927
1917
  reset$c();
1928
1918
  }
1929
1919
 
1930
- function start$o() {
1931
- start$o.dn = 8 /* FunctionNames.InteractionStart */;
1932
- start$h();
1920
+ function start$p() {
1921
+ start$i();
1922
+ start$z();
1933
1923
  start$y();
1924
+ start$w();
1934
1925
  start$x();
1935
1926
  start$v();
1936
- start$w();
1927
+ start$q();
1937
1928
  start$u();
1938
- start$p();
1939
1929
  start$t();
1930
+ start$A();
1940
1931
  start$s();
1941
- start$z();
1942
1932
  start$r();
1943
- start$q();
1944
1933
  }
1945
- function stop$m() {
1946
- stop$f();
1934
+ function stop$n() {
1935
+ stop$g();
1936
+ stop$x();
1947
1937
  stop$w();
1938
+ stop$u();
1948
1939
  stop$v();
1949
1940
  stop$t();
1950
- stop$u();
1941
+ stop$o();
1951
1942
  stop$s();
1952
- stop$n();
1953
1943
  stop$r();
1944
+ stop$y();
1954
1945
  stop$q();
1955
- stop$x();
1956
1946
  stop$p();
1957
- stop$o();
1958
1947
  }
1959
1948
  function observe$4(root) {
1960
1949
  observe$7(root);
@@ -1974,8 +1963,8 @@ function observe$4(root) {
1974
1963
  var interaction = /*#__PURE__*/Object.freeze({
1975
1964
  __proto__: null,
1976
1965
  observe: observe$4,
1977
- start: start$o,
1978
- stop: stop$m
1966
+ start: start$p,
1967
+ stop: stop$n
1979
1968
  });
1980
1969
 
1981
1970
  // Following code takes an array of tokens and transforms it to optimize for repeating tokens and make it efficient to send over the wire
@@ -2064,7 +2053,7 @@ function proxyStyleRules$1(win) {
2064
2053
  }
2065
2054
  }
2066
2055
  }
2067
- function start$n() {
2056
+ function start$o() {
2068
2057
  proxyStyleRules$1(window);
2069
2058
  }
2070
2059
  function checkDocumentStyles(documentNode, timestamp) {
@@ -2120,7 +2109,7 @@ function reset$b() {
2120
2109
  sheetAdoptionState = [];
2121
2110
  sheetUpdateState = [];
2122
2111
  }
2123
- function stop$l() {
2112
+ function stop$m() {
2124
2113
  styleSheetMap = {};
2125
2114
  styleTimeMap = {};
2126
2115
  documentNodes = [];
@@ -2168,7 +2157,7 @@ var animationFinish = null;
2168
2157
  var animationId = 'clarityAnimationId';
2169
2158
  var operationCount = 'clarityOperationCount';
2170
2159
  var maxOperations = 20;
2171
- function start$m() {
2160
+ function start$n() {
2172
2161
  if (window["Animation"] &&
2173
2162
  window["Animation"].prototype &&
2174
2163
  window["KeyframeEffect"] &&
@@ -2223,7 +2212,7 @@ function track$6(time, id, operation, keyFrames, timing, targetId, timeline) {
2223
2212
  });
2224
2213
  encode$5(44 /* Event.Animation */);
2225
2214
  }
2226
- function stop$k() {
2215
+ function stop$l() {
2227
2216
  reset$a();
2228
2217
  }
2229
2218
  function overrideAnimationHelper(functionToOverride, name) {
@@ -2450,12 +2439,11 @@ var data$8;
2450
2439
  function reset$9() {
2451
2440
  data$8 = null;
2452
2441
  }
2453
- function start$l() {
2442
+ function start$m() {
2454
2443
  reset$9();
2455
2444
  compute$6();
2456
2445
  }
2457
2446
  function compute$6() {
2458
- compute$6.dn = 19 /* FunctionNames.DocumentCompute */;
2459
2447
  var body = document.body;
2460
2448
  var d = document.documentElement;
2461
2449
  var bodyClientWidth = body ? body.clientWidth : null;
@@ -2478,7 +2466,7 @@ function compute$6() {
2478
2466
  encode$5(8 /* Event.Document */);
2479
2467
  }
2480
2468
  }
2481
- function stop$j() {
2469
+ function stop$k() {
2482
2470
  reset$9();
2483
2471
  }
2484
2472
 
@@ -2530,8 +2518,7 @@ var history$4 = {};
2530
2518
  var observedNodes = new WeakMap();
2531
2519
  // We ignore mutations if these attributes are updated
2532
2520
  var IGNORED_ATTRIBUTES = ["data-google-query-id", "data-load-complete", "data-google-container-id"];
2533
- function start$k() {
2534
- start$k.dn = 21 /* FunctionNames.MutationStart */;
2521
+ function start$l() {
2535
2522
  observers = new Set();
2536
2523
  queue$2 = [];
2537
2524
  timeout$1 = null;
@@ -2569,7 +2556,7 @@ function monitor(frame) {
2569
2556
  bind(frame, "load" /* Constant.LoadEvent */, generate.bind(this, frame, "childList" /* Constant.ChildList */), true);
2570
2557
  }
2571
2558
  }
2572
- function stop$i() {
2559
+ function stop$j() {
2573
2560
  for (var _i = 0, _a = Array.from(observers); _i < _a.length; _i++) {
2574
2561
  var observer = _a[_i];
2575
2562
  if (observer) {
@@ -2585,7 +2572,7 @@ function stop$i() {
2585
2572
  timeout$1 = null;
2586
2573
  observedNodes = new WeakMap();
2587
2574
  }
2588
- function active$2() {
2575
+ function active$3() {
2589
2576
  activePeriod = time() + 3000 /* Setting.MutationActivePeriod */;
2590
2577
  }
2591
2578
  function disconnect(n) {
@@ -2597,7 +2584,6 @@ function disconnect(n) {
2597
2584
  }
2598
2585
  }
2599
2586
  function handle$1(m) {
2600
- handle$1.dn = 22 /* FunctionNames.MutationHandle */;
2601
2587
  // Queue up mutation records for asynchronous processing
2602
2588
  var now = time();
2603
2589
  track$7(6 /* Event.Mutation */, now);
@@ -2851,7 +2837,6 @@ function trigger$1() {
2851
2837
  queue$2 = [];
2852
2838
  }
2853
2839
  function generate(target, type) {
2854
- generate.dn = 23 /* FunctionNames.MutationGenerate */;
2855
2840
  measure(handle$1)([
2856
2841
  {
2857
2842
  addedNodes: [target],
@@ -3383,11 +3368,11 @@ var iframeMap = null; // Maps iframe's contentDocument => parent iframe element
3383
3368
  var iframeContentMap = null; // Maps parent iframe element => iframe's contentDocument & contentWindow
3384
3369
  var privacyMap = null; // Maps node => Privacy (enum)
3385
3370
  var fraudMap = null; // Maps node => FraudId (number)
3386
- function start$j() {
3371
+ function start$k() {
3387
3372
  reset$7();
3388
3373
  parse(document, true);
3389
3374
  }
3390
- function stop$h() {
3375
+ function stop$i() {
3391
3376
  reset$7();
3392
3377
  }
3393
3378
  function reset$7() {
@@ -3782,7 +3767,7 @@ var regions = {};
3782
3767
  var queue$1 = [];
3783
3768
  var watch = false;
3784
3769
  var observer$1 = null;
3785
- function start$i() {
3770
+ function start$j() {
3786
3771
  reset$6();
3787
3772
  observer$1 = null;
3788
3773
  regionMap = new WeakMap();
@@ -3828,7 +3813,6 @@ function track$3(id, event) {
3828
3813
  process$1(node, data, interaction, data.visibility);
3829
3814
  }
3830
3815
  function compute$5() {
3831
- compute$5.dn = 24 /* FunctionNames.RegionCompute */;
3832
3816
  // Process any regions where we couldn't resolve an "id" for at the time of last intersection observer event
3833
3817
  // This could happen in cases where elements are not yet processed by Clarity's virtual DOM but browser reports a change, regardless.
3834
3818
  // For those cases we add them to the queue and re-process them below
@@ -3911,7 +3895,7 @@ function clone(r) {
3911
3895
  function reset$6() {
3912
3896
  state$2 = [];
3913
3897
  }
3914
- function stop$g() {
3898
+ function stop$h() {
3915
3899
  reset$6();
3916
3900
  regionMap = null;
3917
3901
  regions = {};
@@ -3926,7 +3910,7 @@ function stop$g() {
3926
3910
  function target(evt) {
3927
3911
  var path = evt.composed && evt.composedPath ? evt.composedPath() : null;
3928
3912
  var node = (path && path.length > 0 ? path[0] : evt.target);
3929
- active$2(); // Mark active periods of time so mutations can continue uninterrupted
3913
+ active$3(); // Mark active periods of time so mutations can continue uninterrupted
3930
3914
  return node && node.nodeType === Node.DOCUMENT_NODE ? node.documentElement : node;
3931
3915
  }
3932
3916
  function metadata$2(node, event, text) {
@@ -4050,6 +4034,7 @@ function encode$4 (type, ts) {
4050
4034
  tokens = [entry.time, entry.event];
4051
4035
  tokens.push(iTarget.id);
4052
4036
  tokens.push(text$1(entry.data.value, "input", iTarget.privacy, false, entry.data.type));
4037
+ tokens.push(entry.data.trust);
4053
4038
  queue(tokens);
4054
4039
  }
4055
4040
  reset$j();
@@ -4145,7 +4130,7 @@ function encode$4 (type, ts) {
4145
4130
 
4146
4131
  var state$1 = [];
4147
4132
  var updates$1 = [];
4148
- function start$h() {
4133
+ function start$i() {
4149
4134
  state$1 = [];
4150
4135
  reset$5();
4151
4136
  }
@@ -4192,7 +4177,7 @@ function compute$4() {
4192
4177
  state$1 = temp; // Drop events less than the min time
4193
4178
  encode$4(22 /* Event.Timeline */);
4194
4179
  }
4195
- function stop$f() {
4180
+ function stop$g() {
4196
4181
  state$1 = [];
4197
4182
  reset$5();
4198
4183
  }
@@ -4330,6 +4315,53 @@ function add(node, parent, data) {
4330
4315
  }
4331
4316
  }
4332
4317
 
4318
+ var stopCallbacks = [];
4319
+ var active$2 = false;
4320
+ function start$h() {
4321
+ active$2 = true;
4322
+ }
4323
+ function stop$f() {
4324
+ stopCallbacks.reverse().forEach(function (callback) {
4325
+ try {
4326
+ callback();
4327
+ }
4328
+ catch (error) {
4329
+ // Do nothing
4330
+ }
4331
+ });
4332
+ stopCallbacks = [];
4333
+ active$2 = false;
4334
+ }
4335
+ function register(stopCallback) {
4336
+ if (active$2 && typeof stopCallback === "function") {
4337
+ stopCallbacks.push(stopCallback);
4338
+ }
4339
+ }
4340
+ function dynamicEvent(url) {
4341
+ load(url);
4342
+ }
4343
+ function load(url) {
4344
+ if (!active$2)
4345
+ return;
4346
+ try {
4347
+ var script = document.createElement("script");
4348
+ script.src = url;
4349
+ script.async = true;
4350
+ document.head.appendChild(script);
4351
+ }
4352
+ catch (error) {
4353
+ // Do nothing
4354
+ }
4355
+ }
4356
+
4357
+ var dynamic = /*#__PURE__*/Object.freeze({
4358
+ __proto__: null,
4359
+ dynamicEvent: dynamicEvent,
4360
+ register: register,
4361
+ start: start$h,
4362
+ stop: stop$f
4363
+ });
4364
+
4333
4365
  var discoverBytes = 0;
4334
4366
  var playbackBytes = 0;
4335
4367
  var playback;
@@ -4480,7 +4512,6 @@ function stringify(encoded) {
4480
4512
  return encoded.p.length > 0 ? "{\"e\":".concat(encoded.e, ",\"a\":").concat(encoded.a, ",\"p\":").concat(encoded.p, "}") : "{\"e\":".concat(encoded.e, ",\"a\":").concat(encoded.a, "}");
4481
4513
  }
4482
4514
  function send(payload, zipped, sequence, beacon) {
4483
- var _a;
4484
4515
  if (beacon === void 0) { beacon = false; }
4485
4516
  // Upload data if a valid URL is defined in the config
4486
4517
  if (typeof config$2.upload === "string" /* Constant.String */) {
@@ -4497,14 +4528,9 @@ function send(payload, zipped, sequence, beacon) {
4497
4528
  if (dispatched) {
4498
4529
  done(sequence);
4499
4530
  }
4500
- else {
4501
- // If sendBeacon fails, we report the error and continue with XHR upload
4502
- report(new Error("".concat("BeaconError" /* Constant.BeaconError */, ": ").concat(payload.length)));
4503
- }
4504
4531
  }
4505
4532
  catch (error) {
4506
- // If sendBeacon fails, we report the error and continue with XHR upload
4507
- report(new Error("".concat("BeaconError" /* Constant.BeaconError */, ": ").concat((_a = error === null || error === void 0 ? void 0 : error.message) === null || _a === void 0 ? void 0 : _a.substring(0, 50), " : ").concat(payload.length)));
4533
+ // If sendBeacon fails, we do nothing and continue with XHR upload
4508
4534
  }
4509
4535
  }
4510
4536
  // Before initiating XHR upload, we check if the data has already been uploaded using sendBeacon
@@ -4643,6 +4669,11 @@ function response(payload) {
4643
4669
  signalsEvent(parts[1]);
4644
4670
  }
4645
4671
  break;
4672
+ case "MODULE" /* Constant.Module */:
4673
+ if (parts.length > 1) {
4674
+ dynamicEvent(parts[1]);
4675
+ }
4676
+ break;
4646
4677
  case "SNAPSHOT" /* Constant.Snapshot */:
4647
4678
  config$2.lean = false; // Disable lean mode to ensure we can send playback information to server.
4648
4679
  snapshot();
@@ -4658,7 +4689,6 @@ function start$f() {
4658
4689
  history$3 = {};
4659
4690
  }
4660
4691
  function handler(error) {
4661
- handler.dn = 4 /* FunctionNames.ScriptHandler */;
4662
4692
  var e = error["error"] || error;
4663
4693
  // While rare, it's possible for code to fail repeatedly during the lifetime of the same page
4664
4694
  // In those cases, we only want to log the failure first few times and not spam logs with redundant information.
@@ -5003,7 +5033,7 @@ function upgrade(key) {
5003
5033
  encode$1(3 /* Event.Upgrade */);
5004
5034
  if (config$2.lite) {
5005
5035
  start$c();
5006
- start$n();
5036
+ start$o();
5007
5037
  }
5008
5038
  }
5009
5039
  }
@@ -5425,7 +5455,7 @@ function save() {
5425
5455
  var ts = Math.round(Date.now());
5426
5456
  var upload = config$2.upload && typeof config$2.upload === "string" /* Constant.String */ ? config$2.upload.replace("https://" /* Constant.HTTPS */, "" /* Constant.Empty */) : "" /* Constant.Empty */;
5427
5457
  var upgrade = config$2.lean ? 0 /* BooleanFlag.False */ : 1 /* BooleanFlag.True */;
5428
- setCookie("_clsk" /* Constant.SessionKey */, [data$2.sessionId, ts, data$2.pageNum, upgrade, upload].join("|" /* Constant.Pipe */), 1 /* Setting.SessionExpire */);
5458
+ setCookie("_clsk" /* Constant.SessionKey */, [data$2.sessionId, ts, data$2.pageNum, upgrade, upload].join("^" /* Constant.Caret */), 1 /* Setting.SessionExpire */);
5429
5459
  }
5430
5460
  function processCallback(upgrade, consentUpdate) {
5431
5461
  if (consentUpdate === void 0) { consentUpdate = false; }
@@ -5465,7 +5495,7 @@ function track(u, consent) {
5465
5495
  // To avoid cookie churn, write user id cookie only once every day
5466
5496
  if (u.expiry === null || Math.abs(end - u.expiry) >= 1 /* Setting.CookieInterval */ || u.consent !== consent || u.dob !== dob) {
5467
5497
  var cookieParts = [data$2.userId, 2 /* Setting.CookieVersion */, end.toString(36), consent, dob];
5468
- setCookie("_clck" /* Constant.CookieKey */, cookieParts.join("|" /* Constant.Pipe */), 365 /* Setting.Expire */);
5498
+ setCookie("_clck" /* Constant.CookieKey */, cookieParts.join("^" /* Constant.Caret */), 365 /* Setting.Expire */);
5469
5499
  }
5470
5500
  }
5471
5501
  function shortid() {
@@ -5699,7 +5729,6 @@ function measure (method) {
5699
5729
  if (duration > 30 /* Setting.LongTask */) {
5700
5730
  count$1(7 /* Metric.LongTaskCount */);
5701
5731
  max(6 /* Metric.ThreadBlockedTime */, duration);
5702
- log$1(9 /* Code.FunctionExecutionTime */, 0 /* Severity.Info */, "".concat(method.dn || method.name, "-").concat(duration));
5703
5732
  }
5704
5733
  };
5705
5734
  }
@@ -5788,7 +5817,6 @@ function check$1() {
5788
5817
  return true;
5789
5818
  }
5790
5819
  function compute$1() {
5791
- compute$1.dn = 1 /* FunctionNames.HistoryCompute */;
5792
5820
  count = 0; // Reset the counter
5793
5821
  if (url !== getCurrentUrl()) {
5794
5822
  // If the url changed, start tracking it as a new page
@@ -5811,7 +5839,7 @@ function stop$6() {
5811
5839
  var status = false;
5812
5840
  function start$5() {
5813
5841
  status = true;
5814
- start$J();
5842
+ start$K();
5815
5843
  reset$4();
5816
5844
  reset$1();
5817
5845
  reset$2();
@@ -5822,7 +5850,7 @@ function stop$5() {
5822
5850
  reset$2();
5823
5851
  reset$1();
5824
5852
  reset$4();
5825
- stop$G();
5853
+ stop$H();
5826
5854
  status = false;
5827
5855
  }
5828
5856
  function active() {
@@ -5873,14 +5901,12 @@ function suspend() {
5873
5901
  }
5874
5902
  }
5875
5903
  function restart() {
5876
- restart.dn = 2 /* FunctionNames.Restart */;
5877
5904
  start();
5878
5905
  event("clarity" /* Constant.Clarity */, "restart" /* Constant.Restart */);
5879
5906
  }
5880
5907
 
5881
5908
  function start$4() {
5882
- start$4.dn = 3 /* FunctionNames.DiagnosticStart */;
5883
- start$A();
5909
+ start$B();
5884
5910
  start$f();
5885
5911
  start$e();
5886
5912
  }
@@ -5895,32 +5921,31 @@ var diagnostic = /*#__PURE__*/Object.freeze({
5895
5921
  });
5896
5922
 
5897
5923
  function start$3() {
5898
- start$3.dn = 20 /* FunctionNames.LayoutStart */;
5899
5924
  // The order below is important
5900
5925
  // and is determined by interdependencies of modules
5901
- start$l();
5902
- start$i();
5926
+ start$m();
5903
5927
  start$j();
5928
+ start$k();
5904
5929
  if (config$2.delayDom) {
5905
5930
  // Lazy load layout module as part of page load time performance improvements experiment
5906
5931
  bind(window, 'load', function () {
5907
- start$k();
5932
+ start$l();
5908
5933
  });
5909
5934
  }
5910
5935
  else {
5911
- start$k();
5936
+ start$l();
5912
5937
  }
5913
5938
  start$c();
5939
+ start$o();
5914
5940
  start$n();
5915
- start$m();
5916
5941
  }
5917
5942
  function stop$3() {
5918
- stop$g();
5919
5943
  stop$h();
5920
5944
  stop$i();
5921
5945
  stop$j();
5922
- stop$l();
5923
5946
  stop$k();
5947
+ stop$m();
5948
+ stop$l();
5924
5949
  }
5925
5950
 
5926
5951
  var layout = /*#__PURE__*/Object.freeze({
@@ -6107,7 +6132,6 @@ function start$2() {
6107
6132
  }
6108
6133
  }
6109
6134
  function observe() {
6110
- observe.dn = 26 /* FunctionNames.ObserverObserve */;
6111
6135
  // Some browsers will throw an error for unsupported entryType, e.g. "layout-shift"
6112
6136
  // In those cases, we log it as a warning and continue with rest of the Clarity processing
6113
6137
  try {
@@ -6136,7 +6160,6 @@ function observe() {
6136
6160
  }
6137
6161
  }
6138
6162
  function handle(entries) {
6139
- handle.dn = 27 /* FunctionNames.ObserverHandle */;
6140
6163
  process(entries.getEntries());
6141
6164
  }
6142
6165
  function process(entries) {
@@ -6202,7 +6225,6 @@ function host(url) {
6202
6225
  }
6203
6226
 
6204
6227
  function start$1() {
6205
- start$1.dn = 25 /* FunctionNames.PerformanceStart */;
6206
6228
  reset();
6207
6229
  start$2();
6208
6230
  }
@@ -6217,14 +6239,14 @@ var performance$1 = /*#__PURE__*/Object.freeze({
6217
6239
  stop: stop$1
6218
6240
  });
6219
6241
 
6220
- var modules = [diagnostic, layout, interaction, performance$1];
6242
+ var modules = [diagnostic, layout, interaction, performance$1, dynamic];
6221
6243
  function start(config$1) {
6222
6244
  if (config$1 === void 0) { config$1 = null; }
6223
6245
  // Check that browser supports required APIs and we do not attempt to start Clarity multiple times
6224
6246
  if (check()) {
6225
6247
  config(config$1);
6226
6248
  start$5();
6227
- start$B();
6249
+ start$C();
6228
6250
  modules.forEach(function (x) { return measure(x.start)(); });
6229
6251
  // If it's an internal call to start, without explicit configuration,
6230
6252
  // re-process any newly accumulated items in the queue
@@ -6255,7 +6277,7 @@ function stop() {
6255
6277
  if (active()) {
6256
6278
  // Stop modules in the reverse order of their initialization and start queuing up items again
6257
6279
  modules.slice().reverse().forEach(function (x) { return measure(x.stop)(); });
6258
- stop$y();
6280
+ stop$z();
6259
6281
  stop$5();
6260
6282
  setup();
6261
6283
  }