clarity-js 0.8.24 → 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.24";
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,7 +1266,7 @@ 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) {
@@ -1281,7 +1284,7 @@ function recompute$8(evt) {
1281
1284
  function reset$m() {
1282
1285
  state$a = [];
1283
1286
  }
1284
- function stop$x() {
1287
+ function stop$y() {
1285
1288
  reset$m();
1286
1289
  }
1287
1290
 
@@ -1303,7 +1306,7 @@ function offset(element) {
1303
1306
 
1304
1307
  var UserInputTags = ["input", "textarea", "radio", "button", "canvas", "select"];
1305
1308
  var state$9 = [];
1306
- function start$y() {
1309
+ function start$z() {
1307
1310
  reset$l();
1308
1311
  }
1309
1312
  function observe$b(root) {
@@ -1433,12 +1436,12 @@ function context(a) {
1433
1436
  function reset$l() {
1434
1437
  state$9 = [];
1435
1438
  }
1436
- function stop$w() {
1439
+ function stop$x() {
1437
1440
  reset$l();
1438
1441
  }
1439
1442
 
1440
1443
  var state$8 = [];
1441
- function start$x() {
1444
+ function start$y() {
1442
1445
  reset$k();
1443
1446
  }
1444
1447
  function observe$a(root) {
@@ -1453,13 +1456,13 @@ function recompute$7(action, evt) {
1453
1456
  function reset$k() {
1454
1457
  state$8 = [];
1455
1458
  }
1456
- function stop$v() {
1459
+ function stop$w() {
1457
1460
  reset$k();
1458
1461
  }
1459
1462
 
1460
1463
  var timeout$6 = null;
1461
1464
  var state$7 = [];
1462
- function start$w() {
1465
+ function start$x() {
1463
1466
  reset$j();
1464
1467
  }
1465
1468
  function observe$9(root) {
@@ -1493,7 +1496,7 @@ function process$7(event) {
1493
1496
  function reset$j() {
1494
1497
  state$7 = [];
1495
1498
  }
1496
- function stop$u() {
1499
+ function stop$v() {
1497
1500
  clearTimeout$1(timeout$6);
1498
1501
  reset$j();
1499
1502
  }
@@ -1503,7 +1506,7 @@ var timeout$5 = null;
1503
1506
  var hasPrimaryTouch = false;
1504
1507
  var primaryTouchId = 0;
1505
1508
  var activeTouchPointIds = new Set();
1506
- function start$v() {
1509
+ function start$w() {
1507
1510
  reset$i();
1508
1511
  }
1509
1512
  function observe$8(root) {
@@ -1611,7 +1614,7 @@ function similar$1(last, current) {
1611
1614
  var sameId = current.data.id !== undefined ? current.data.id === last.data.id : true;
1612
1615
  return current.event === last.event && match && distance < 20 /* Setting.Distance */ && gap < 25 /* Setting.PointerInterval */ && sameId;
1613
1616
  }
1614
- function stop$t() {
1617
+ function stop$u() {
1615
1618
  clearTimeout$1(timeout$5);
1616
1619
  // Send out any pending pointer events in the pipeline
1617
1620
  if (state$6.length > 0) {
@@ -1671,7 +1674,7 @@ var data$c;
1671
1674
  var timeout$4 = null;
1672
1675
  var initialStateLogged = false;
1673
1676
  var throttledRecompute$1 = throttle(recompute$5, 500 /* Setting.LookAhead */);
1674
- function start$u() {
1677
+ function start$v() {
1675
1678
  initialStateLogged = false;
1676
1679
  bind(window, "resize", throttledRecompute$1);
1677
1680
  recompute$5();
@@ -1701,7 +1704,7 @@ function reset$h() {
1701
1704
  clearTimeout$1(timeout$4);
1702
1705
  throttledRecompute$1.cleanup();
1703
1706
  }
1704
- function stop$s() {
1707
+ function stop$t() {
1705
1708
  reset$h();
1706
1709
  }
1707
1710
 
@@ -1709,7 +1712,7 @@ var state$5 = [];
1709
1712
  var initialTop = null;
1710
1713
  var initialBottom = null;
1711
1714
  var timeout$3 = null;
1712
- function start$t() {
1715
+ function start$u() {
1713
1716
  state$5 = [];
1714
1717
  recompute$4();
1715
1718
  }
@@ -1805,7 +1808,7 @@ function compute$8() {
1805
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 */));
1806
1809
  }
1807
1810
  }
1808
- function stop$r() {
1811
+ function stop$s() {
1809
1812
  clearTimeout$1(timeout$3);
1810
1813
  throttledRecompute.cleanup();
1811
1814
  state$5 = [];
@@ -1816,7 +1819,7 @@ function stop$r() {
1816
1819
  var data$b = null;
1817
1820
  var previous = null;
1818
1821
  var timeout$2 = null;
1819
- function start$s() {
1822
+ function start$t() {
1820
1823
  reset$f();
1821
1824
  }
1822
1825
  function observe$6(root) {
@@ -1860,13 +1863,13 @@ function reset$f() {
1860
1863
  previous = null;
1861
1864
  data$b = { start: 0, startOffset: 0, end: 0, endOffset: 0 };
1862
1865
  }
1863
- function stop$q() {
1866
+ function stop$r() {
1864
1867
  reset$f();
1865
1868
  clearTimeout$1(timeout$2);
1866
1869
  }
1867
1870
 
1868
1871
  var state$4 = [];
1869
- function start$r() {
1872
+ function start$s() {
1870
1873
  reset$e();
1871
1874
  }
1872
1875
  function observe$5(root) {
@@ -1879,12 +1882,12 @@ function recompute$2(evt) {
1879
1882
  function reset$e() {
1880
1883
  state$4 = [];
1881
1884
  }
1882
- function stop$p() {
1885
+ function stop$q() {
1883
1886
  reset$e();
1884
1887
  }
1885
1888
 
1886
1889
  var data$a;
1887
- function start$q() {
1890
+ function start$r() {
1888
1891
  bind(window, "pagehide", recompute$1);
1889
1892
  }
1890
1893
  function recompute$1(evt) {
@@ -1895,12 +1898,12 @@ function recompute$1(evt) {
1895
1898
  function reset$d() {
1896
1899
  data$a = null;
1897
1900
  }
1898
- function stop$o() {
1901
+ function stop$p() {
1899
1902
  reset$d();
1900
1903
  }
1901
1904
 
1902
1905
  var data$9;
1903
- function start$p() {
1906
+ function start$q() {
1904
1907
  bind(document, "visibilitychange", recompute);
1905
1908
  recompute();
1906
1909
  }
@@ -1912,37 +1915,37 @@ function recompute(evt) {
1912
1915
  function reset$c() {
1913
1916
  data$9 = null;
1914
1917
  }
1915
- function stop$n() {
1918
+ function stop$o() {
1916
1919
  reset$c();
1917
1920
  }
1918
1921
 
1919
- function start$o() {
1920
- start$h();
1922
+ function start$p() {
1923
+ start$i();
1924
+ start$z();
1921
1925
  start$y();
1926
+ start$w();
1922
1927
  start$x();
1923
1928
  start$v();
1924
- start$w();
1929
+ start$q();
1925
1930
  start$u();
1926
- start$p();
1927
1931
  start$t();
1932
+ start$A();
1928
1933
  start$s();
1929
- start$z();
1930
1934
  start$r();
1931
- start$q();
1932
1935
  }
1933
- function stop$m() {
1934
- stop$f();
1936
+ function stop$n() {
1937
+ stop$g();
1938
+ stop$x();
1935
1939
  stop$w();
1940
+ stop$u();
1936
1941
  stop$v();
1937
1942
  stop$t();
1938
- stop$u();
1943
+ stop$o();
1939
1944
  stop$s();
1940
- stop$n();
1941
1945
  stop$r();
1946
+ stop$y();
1942
1947
  stop$q();
1943
- stop$x();
1944
1948
  stop$p();
1945
- stop$o();
1946
1949
  }
1947
1950
  function observe$4(root) {
1948
1951
  observe$7(root);
@@ -1962,8 +1965,8 @@ function observe$4(root) {
1962
1965
  var interaction = /*#__PURE__*/Object.freeze({
1963
1966
  __proto__: null,
1964
1967
  observe: observe$4,
1965
- start: start$o,
1966
- stop: stop$m
1968
+ start: start$p,
1969
+ stop: stop$n
1967
1970
  });
1968
1971
 
1969
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
@@ -2052,7 +2055,7 @@ function proxyStyleRules$1(win) {
2052
2055
  }
2053
2056
  }
2054
2057
  }
2055
- function start$n() {
2058
+ function start$o() {
2056
2059
  proxyStyleRules$1(window);
2057
2060
  }
2058
2061
  function checkDocumentStyles(documentNode, timestamp) {
@@ -2108,7 +2111,7 @@ function reset$b() {
2108
2111
  sheetAdoptionState = [];
2109
2112
  sheetUpdateState = [];
2110
2113
  }
2111
- function stop$l() {
2114
+ function stop$m() {
2112
2115
  styleSheetMap = {};
2113
2116
  styleTimeMap = {};
2114
2117
  documentNodes = [];
@@ -2156,7 +2159,7 @@ var animationFinish = null;
2156
2159
  var animationId = 'clarityAnimationId';
2157
2160
  var operationCount = 'clarityOperationCount';
2158
2161
  var maxOperations = 20;
2159
- function start$m() {
2162
+ function start$n() {
2160
2163
  if (window["Animation"] &&
2161
2164
  window["Animation"].prototype &&
2162
2165
  window["KeyframeEffect"] &&
@@ -2211,7 +2214,7 @@ function track$6(time, id, operation, keyFrames, timing, targetId, timeline) {
2211
2214
  });
2212
2215
  encode$5(44 /* Event.Animation */);
2213
2216
  }
2214
- function stop$k() {
2217
+ function stop$l() {
2215
2218
  reset$a();
2216
2219
  }
2217
2220
  function overrideAnimationHelper(functionToOverride, name) {
@@ -2438,7 +2441,7 @@ var data$8;
2438
2441
  function reset$9() {
2439
2442
  data$8 = null;
2440
2443
  }
2441
- function start$l() {
2444
+ function start$m() {
2442
2445
  reset$9();
2443
2446
  compute$6();
2444
2447
  }
@@ -2465,7 +2468,7 @@ function compute$6() {
2465
2468
  encode$5(8 /* Event.Document */);
2466
2469
  }
2467
2470
  }
2468
- function stop$j() {
2471
+ function stop$k() {
2469
2472
  reset$9();
2470
2473
  }
2471
2474
 
@@ -2517,7 +2520,7 @@ var history$4 = {};
2517
2520
  var observedNodes = new WeakMap();
2518
2521
  // We ignore mutations if these attributes are updated
2519
2522
  var IGNORED_ATTRIBUTES = ["data-google-query-id", "data-load-complete", "data-google-container-id"];
2520
- function start$k() {
2523
+ function start$l() {
2521
2524
  observers = new Set();
2522
2525
  queue$2 = [];
2523
2526
  timeout$1 = null;
@@ -2555,7 +2558,7 @@ function monitor(frame) {
2555
2558
  bind(frame, "load" /* Constant.LoadEvent */, generate.bind(this, frame, "childList" /* Constant.ChildList */), true);
2556
2559
  }
2557
2560
  }
2558
- function stop$i() {
2561
+ function stop$j() {
2559
2562
  for (var _i = 0, _a = Array.from(observers); _i < _a.length; _i++) {
2560
2563
  var observer = _a[_i];
2561
2564
  if (observer) {
@@ -2571,7 +2574,7 @@ function stop$i() {
2571
2574
  timeout$1 = null;
2572
2575
  observedNodes = new WeakMap();
2573
2576
  }
2574
- function active$2() {
2577
+ function active$3() {
2575
2578
  activePeriod = time() + 3000 /* Setting.MutationActivePeriod */;
2576
2579
  }
2577
2580
  function disconnect(n) {
@@ -3367,11 +3370,11 @@ var iframeMap = null; // Maps iframe's contentDocument => parent iframe element
3367
3370
  var iframeContentMap = null; // Maps parent iframe element => iframe's contentDocument & contentWindow
3368
3371
  var privacyMap = null; // Maps node => Privacy (enum)
3369
3372
  var fraudMap = null; // Maps node => FraudId (number)
3370
- function start$j() {
3373
+ function start$k() {
3371
3374
  reset$7();
3372
3375
  parse(document, true);
3373
3376
  }
3374
- function stop$h() {
3377
+ function stop$i() {
3375
3378
  reset$7();
3376
3379
  }
3377
3380
  function reset$7() {
@@ -3766,7 +3769,7 @@ var regions = {};
3766
3769
  var queue$1 = [];
3767
3770
  var watch = false;
3768
3771
  var observer$1 = null;
3769
- function start$i() {
3772
+ function start$j() {
3770
3773
  reset$6();
3771
3774
  observer$1 = null;
3772
3775
  regionMap = new WeakMap();
@@ -3894,7 +3897,7 @@ function clone(r) {
3894
3897
  function reset$6() {
3895
3898
  state$2 = [];
3896
3899
  }
3897
- function stop$g() {
3900
+ function stop$h() {
3898
3901
  reset$6();
3899
3902
  regionMap = null;
3900
3903
  regions = {};
@@ -3909,7 +3912,7 @@ function stop$g() {
3909
3912
  function target(evt) {
3910
3913
  var path = evt.composed && evt.composedPath ? evt.composedPath() : null;
3911
3914
  var node = (path && path.length > 0 ? path[0] : evt.target);
3912
- 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
3913
3916
  return node && node.nodeType === Node.DOCUMENT_NODE ? node.documentElement : node;
3914
3917
  }
3915
3918
  function metadata$2(node, event, text) {
@@ -4129,7 +4132,7 @@ function encode$4 (type, ts) {
4129
4132
 
4130
4133
  var state$1 = [];
4131
4134
  var updates$1 = [];
4132
- function start$h() {
4135
+ function start$i() {
4133
4136
  state$1 = [];
4134
4137
  reset$5();
4135
4138
  }
@@ -4176,7 +4179,7 @@ function compute$4() {
4176
4179
  state$1 = temp; // Drop events less than the min time
4177
4180
  encode$4(22 /* Event.Timeline */);
4178
4181
  }
4179
- function stop$f() {
4182
+ function stop$g() {
4180
4183
  state$1 = [];
4181
4184
  reset$5();
4182
4185
  }
@@ -4314,6 +4317,53 @@ function add(node, parent, data) {
4314
4317
  }
4315
4318
  }
4316
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
+
4317
4367
  var discoverBytes = 0;
4318
4368
  var playbackBytes = 0;
4319
4369
  var playback;
@@ -4621,6 +4671,11 @@ function response(payload) {
4621
4671
  signalsEvent(parts[1]);
4622
4672
  }
4623
4673
  break;
4674
+ case "MODULE" /* Constant.Module */:
4675
+ if (parts.length > 1) {
4676
+ dynamicEvent(parts[1]);
4677
+ }
4678
+ break;
4624
4679
  case "SNAPSHOT" /* Constant.Snapshot */:
4625
4680
  config$2.lean = false; // Disable lean mode to ensure we can send playback information to server.
4626
4681
  snapshot();
@@ -4980,7 +5035,7 @@ function upgrade(key) {
4980
5035
  encode$1(3 /* Event.Upgrade */);
4981
5036
  if (config$2.lite) {
4982
5037
  start$c();
4983
- start$n();
5038
+ start$o();
4984
5039
  }
4985
5040
  }
4986
5041
  }
@@ -5402,7 +5457,7 @@ function save() {
5402
5457
  var ts = Math.round(Date.now());
5403
5458
  var upload = config$2.upload && typeof config$2.upload === "string" /* Constant.String */ ? config$2.upload.replace("https://" /* Constant.HTTPS */, "" /* Constant.Empty */) : "" /* Constant.Empty */;
5404
5459
  var upgrade = config$2.lean ? 0 /* BooleanFlag.False */ : 1 /* BooleanFlag.True */;
5405
- 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 */);
5406
5461
  }
5407
5462
  function processCallback(upgrade, consentUpdate) {
5408
5463
  if (consentUpdate === void 0) { consentUpdate = false; }
@@ -5442,7 +5497,7 @@ function track(u, consent) {
5442
5497
  // To avoid cookie churn, write user id cookie only once every day
5443
5498
  if (u.expiry === null || Math.abs(end - u.expiry) >= 1 /* Setting.CookieInterval */ || u.consent !== consent || u.dob !== dob) {
5444
5499
  var cookieParts = [data$2.userId, 2 /* Setting.CookieVersion */, end.toString(36), consent, dob];
5445
- setCookie("_clck" /* Constant.CookieKey */, cookieParts.join("|" /* Constant.Pipe */), 365 /* Setting.Expire */);
5500
+ setCookie("_clck" /* Constant.CookieKey */, cookieParts.join("^" /* Constant.Caret */), 365 /* Setting.Expire */);
5446
5501
  }
5447
5502
  }
5448
5503
  function shortid() {
@@ -5786,7 +5841,7 @@ function stop$6() {
5786
5841
  var status = false;
5787
5842
  function start$5() {
5788
5843
  status = true;
5789
- start$J();
5844
+ start$K();
5790
5845
  reset$4();
5791
5846
  reset$1();
5792
5847
  reset$2();
@@ -5797,7 +5852,7 @@ function stop$5() {
5797
5852
  reset$2();
5798
5853
  reset$1();
5799
5854
  reset$4();
5800
- stop$G();
5855
+ stop$H();
5801
5856
  status = false;
5802
5857
  }
5803
5858
  function active() {
@@ -5853,7 +5908,7 @@ function restart() {
5853
5908
  }
5854
5909
 
5855
5910
  function start$4() {
5856
- start$A();
5911
+ start$B();
5857
5912
  start$f();
5858
5913
  start$e();
5859
5914
  }
@@ -5870,29 +5925,29 @@ var diagnostic = /*#__PURE__*/Object.freeze({
5870
5925
  function start$3() {
5871
5926
  // The order below is important
5872
5927
  // and is determined by interdependencies of modules
5873
- start$l();
5874
- start$i();
5928
+ start$m();
5875
5929
  start$j();
5930
+ start$k();
5876
5931
  if (config$2.delayDom) {
5877
5932
  // Lazy load layout module as part of page load time performance improvements experiment
5878
5933
  bind(window, 'load', function () {
5879
- start$k();
5934
+ start$l();
5880
5935
  });
5881
5936
  }
5882
5937
  else {
5883
- start$k();
5938
+ start$l();
5884
5939
  }
5885
5940
  start$c();
5941
+ start$o();
5886
5942
  start$n();
5887
- start$m();
5888
5943
  }
5889
5944
  function stop$3() {
5890
- stop$g();
5891
5945
  stop$h();
5892
5946
  stop$i();
5893
5947
  stop$j();
5894
- stop$l();
5895
5948
  stop$k();
5949
+ stop$m();
5950
+ stop$l();
5896
5951
  }
5897
5952
 
5898
5953
  var layout = /*#__PURE__*/Object.freeze({
@@ -6186,14 +6241,14 @@ var performance$1 = /*#__PURE__*/Object.freeze({
6186
6241
  stop: stop$1
6187
6242
  });
6188
6243
 
6189
- var modules = [diagnostic, layout, interaction, performance$1];
6244
+ var modules = [diagnostic, layout, interaction, performance$1, dynamic];
6190
6245
  function start(config$1) {
6191
6246
  if (config$1 === void 0) { config$1 = null; }
6192
6247
  // Check that browser supports required APIs and we do not attempt to start Clarity multiple times
6193
6248
  if (check()) {
6194
6249
  config(config$1);
6195
6250
  start$5();
6196
- start$B();
6251
+ start$C();
6197
6252
  modules.forEach(function (x) { return measure(x.start)(); });
6198
6253
  // If it's an internal call to start, without explicit configuration,
6199
6254
  // re-process any newly accumulated items in the queue
@@ -6224,7 +6279,7 @@ function stop() {
6224
6279
  if (active()) {
6225
6280
  // Stop modules in the reverse order of their initialization and start queuing up items again
6226
6281
  modules.slice().reverse().forEach(function (x) { return measure(x.stop)(); });
6227
- stop$y();
6282
+ stop$z();
6228
6283
  stop$5();
6229
6284
  setup();
6230
6285
  }