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