@appsurify-testmap/rrweb-all 3.1.1-alpha.2 → 3.2.0-alpha.1

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.
@@ -939,7 +939,14 @@ const U$1 = {
939
939
  source: "dom-dsl"
940
940
  };
941
941
  function P$1(r2) {
942
- return !!(/^[a-z]+-\d+$/i.test(r2) || /^[a-z]+(-[a-z]+)+-\d+$/i.test(r2) || /^[a-z]+(_[a-z]+)*_\d+$/i.test(r2) || /^\d+$/.test(r2) || /^:[a-z0-9]+:$/i.test(r2) || /^[a-f0-9]{8}-[a-f0-9]{4}-[a-f0-9]{4}-[a-f0-9]{4}-[a-f0-9]{12}$/i.test(r2) || /^[a-z]{1,3}[A-Za-z0-9]{8,}$/.test(r2) && (/\d/.test(r2) || /[A-Z]/.test(r2)) || /^radix-/.test(r2) || /^mui-\d+$/.test(r2));
942
+ if (/^[a-z]+-\d+$/i.test(r2) || /^[a-z]+(-[a-z]+)+-\d+$/i.test(r2) || /^[a-z]+(_[a-z]+)*_\d+$/i.test(r2) || /^\d+$/.test(r2) || /^:[a-z0-9]+:$/i.test(r2) || /^[a-f0-9]{8}-[a-f0-9]{4}-[a-f0-9]{4}-[a-f0-9]{4}-[a-f0-9]{12}$/i.test(r2))
943
+ return true;
944
+ if (/^[a-z]{1,3}[A-Za-z0-9]{8,}$/.test(r2)) {
945
+ const t2 = /\d/.test(r2), e2 = /[A-Z]/.test(r2), s2 = r2.length >= 20;
946
+ if (t2 && e2 || s2)
947
+ return true;
948
+ }
949
+ return !!(/^radix-/.test(r2) || /^mui-\d+$/.test(r2));
943
950
  }
944
951
  const Q$1 = /* @__PURE__ */ new Set([
945
952
  "aria-labelledby",
@@ -1136,6 +1143,11 @@ const At$1 = [
1136
1143
  /^(rtl|ltr):/,
1137
1144
  // === FIX 4: Group and peer variants ===
1138
1145
  /^(group|peer)(-hover|-focus|-active)?:/,
1146
+ // === Arbitrary pseudo-class/modifier variants (catch-all) ===
1147
+ // Matches any lowercase/hyphenated prefix followed by colon
1148
+ // e.g., file:bg-transparent, placeholder:text-gray, invalid:border-red, accept:text-primary
1149
+ // Must come AFTER semantic pattern checks to avoid false positives
1150
+ /^[a-z][a-z-]*:/,
1139
1151
  // === FIX 4: Tailwind utilities with fraction values ===
1140
1152
  /\/([\d.]+|full|auto|screen)$/,
1141
1153
  // /50, /100, /full, /auto, /screen
@@ -13331,7 +13343,14 @@ const U = {
13331
13343
  source: "dom-dsl"
13332
13344
  };
13333
13345
  function P(r2) {
13334
- return !!(/^[a-z]+-\d+$/i.test(r2) || /^[a-z]+(-[a-z]+)+-\d+$/i.test(r2) || /^[a-z]+(_[a-z]+)*_\d+$/i.test(r2) || /^\d+$/.test(r2) || /^:[a-z0-9]+:$/i.test(r2) || /^[a-f0-9]{8}-[a-f0-9]{4}-[a-f0-9]{4}-[a-f0-9]{4}-[a-f0-9]{12}$/i.test(r2) || /^[a-z]{1,3}[A-Za-z0-9]{8,}$/.test(r2) && (/\d/.test(r2) || /[A-Z]/.test(r2)) || /^radix-/.test(r2) || /^mui-\d+$/.test(r2));
13346
+ if (/^[a-z]+-\d+$/i.test(r2) || /^[a-z]+(-[a-z]+)+-\d+$/i.test(r2) || /^[a-z]+(_[a-z]+)*_\d+$/i.test(r2) || /^\d+$/.test(r2) || /^:[a-z0-9]+:$/i.test(r2) || /^[a-f0-9]{8}-[a-f0-9]{4}-[a-f0-9]{4}-[a-f0-9]{4}-[a-f0-9]{12}$/i.test(r2))
13347
+ return true;
13348
+ if (/^[a-z]{1,3}[A-Za-z0-9]{8,}$/.test(r2)) {
13349
+ const t2 = /\d/.test(r2), e2 = /[A-Z]/.test(r2), s2 = r2.length >= 20;
13350
+ if (t2 && e2 || s2)
13351
+ return true;
13352
+ }
13353
+ return !!(/^radix-/.test(r2) || /^mui-\d+$/.test(r2));
13335
13354
  }
13336
13355
  const Q = /* @__PURE__ */ new Set([
13337
13356
  "aria-labelledby",
@@ -13528,6 +13547,11 @@ const At = [
13528
13547
  /^(rtl|ltr):/,
13529
13548
  // === FIX 4: Group and peer variants ===
13530
13549
  /^(group|peer)(-hover|-focus|-active)?:/,
13550
+ // === Arbitrary pseudo-class/modifier variants (catch-all) ===
13551
+ // Matches any lowercase/hyphenated prefix followed by colon
13552
+ // e.g., file:bg-transparent, placeholder:text-gray, invalid:border-red, accept:text-primary
13553
+ // Must come AFTER semantic pattern checks to avoid false positives
13554
+ /^[a-z][a-z-]*:/,
13531
13555
  // === FIX 4: Tailwind utilities with fraction values ===
13532
13556
  /\/([\d.]+|full|auto|screen)$/,
13533
13557
  // /50, /100, /full, /auto, /screen
@@ -15446,6 +15470,30 @@ class MutationBuffer {
15446
15470
  this.shadowDomManager.reset();
15447
15471
  this.canvasManager.reset();
15448
15472
  }
15473
+ /**
15474
+ * Clear all accumulated mutation data without emitting.
15475
+ * Used after freeze+debounce checkout — FullSnapshot already captured the state.
15476
+ */
15477
+ resetBuffers() {
15478
+ this.addedSet = /* @__PURE__ */ new Set();
15479
+ this.movedSet = /* @__PURE__ */ new Set();
15480
+ this.droppedSet = /* @__PURE__ */ new Set();
15481
+ this.removesSubTreeCache = /* @__PURE__ */ new Set();
15482
+ this.mapRemoves = [];
15483
+ this.movedMap = {};
15484
+ this.attributes = [];
15485
+ this.texts = [];
15486
+ this.attributeMap = /* @__PURE__ */ new WeakMap();
15487
+ this.removes = [];
15488
+ }
15489
+ /**
15490
+ * Clear frozen flag without triggering emit.
15491
+ * Used after freeze+debounce checkout — buffers already cleared by resetBuffers().
15492
+ */
15493
+ unsetFrozen() {
15494
+ this.frozen = false;
15495
+ this.canvasManager.unfreeze();
15496
+ }
15449
15497
  }
15450
15498
  function deepDelete(addsSet, n2) {
15451
15499
  addsSet.delete(n2);
@@ -17856,10 +17904,13 @@ class VisibilityManager {
17856
17904
  }
17857
17905
  flushBuffer() {
17858
17906
  var _a2;
17907
+ if (this.frozen || this.locked) return;
17859
17908
  if (this.buffer.size === 0) return;
17860
- (_a2 = this.notifyActivity) == null ? void 0 : _a2.call(this, this.buffer.size);
17861
- this.mutationCb({ mutations: Array.from(this.buffer.values()) });
17909
+ const mutations = Array.from(this.buffer.values());
17910
+ const count = mutations.length;
17862
17911
  this.buffer.clear();
17912
+ this.mutationCb({ mutations });
17913
+ (_a2 = this.notifyActivity) == null ? void 0 : _a2.call(this, count);
17863
17914
  }
17864
17915
  observe(el) {
17865
17916
  if (this.disabled) return;
@@ -17873,6 +17924,10 @@ class VisibilityManager {
17873
17924
  }
17874
17925
  freeze() {
17875
17926
  this.frozen = true;
17927
+ if (this.debounceTimer) {
17928
+ clearTimeout(this.debounceTimer);
17929
+ this.debounceTimer = null;
17930
+ }
17876
17931
  }
17877
17932
  unfreeze() {
17878
17933
  this.frozen = false;
@@ -17880,9 +17935,33 @@ class VisibilityManager {
17880
17935
  }
17881
17936
  lock() {
17882
17937
  this.locked = true;
17938
+ if (this.debounceTimer) {
17939
+ clearTimeout(this.debounceTimer);
17940
+ this.debounceTimer = null;
17941
+ }
17883
17942
  }
17884
17943
  unlock() {
17885
17944
  this.locked = false;
17945
+ this.buffer.clear();
17946
+ if (this.debounceTimer) {
17947
+ clearTimeout(this.debounceTimer);
17948
+ this.debounceTimer = null;
17949
+ }
17950
+ if (!this.disabled && this.elements.size > 0) {
17951
+ this.previousState = computeVisibility(this.elements, /* @__PURE__ */ new Map(), {
17952
+ root: this.root,
17953
+ threshold: this.threshold,
17954
+ sensitivity: this.sensitivity,
17955
+ rootMargin: this.rootMargin
17956
+ });
17957
+ }
17958
+ }
17959
+ /**
17960
+ * Clear frozen flag without triggering flush.
17961
+ * Used after freeze+debounce checkout — buffer already cleared by unlock().
17962
+ */
17963
+ unsetFrozen() {
17964
+ this.frozen = false;
17886
17965
  }
17887
17966
  reset() {
17888
17967
  this.elements.clear();
@@ -17981,7 +18060,7 @@ class ProcessedNodeManager {
17981
18060
  destroy() {
17982
18061
  }
17983
18062
  }
17984
- const version$1 = "3.1.1-alpha.2";
18063
+ const version$1 = "3.1.1-alpha.3";
17985
18064
  let wrappedEmit;
17986
18065
  let takeFullSnapshot$1;
17987
18066
  let canvasManager;
@@ -18035,6 +18114,7 @@ function record(options = {}) {
18035
18114
  checkoutEveryNms,
18036
18115
  checkoutEveryNth,
18037
18116
  checkoutEveryNvm,
18117
+ checkoutDebounce,
18038
18118
  blockClass = "rr-block",
18039
18119
  blockSelector = null,
18040
18120
  ignoreClass = "rr-ignore",
@@ -18129,6 +18209,10 @@ function record(options = {}) {
18129
18209
  let lastFullSnapshotEvent;
18130
18210
  let incrementalSnapshotCount = 0;
18131
18211
  let visibilityMutationCount = 0;
18212
+ let checkoutId = 0;
18213
+ let checkoutPending = false;
18214
+ let checkoutDebounceTimer = null;
18215
+ let checkoutFreezeTimestamp = null;
18132
18216
  const eventProcessor = (e2) => {
18133
18217
  for (const plugin3 of plugins || []) {
18134
18218
  if (plugin3.eventProcessor) {
@@ -18141,11 +18225,25 @@ function record(options = {}) {
18141
18225
  }
18142
18226
  return e2;
18143
18227
  };
18228
+ const executeCheckout = () => {
18229
+ checkoutDebounceTimer = null;
18230
+ checkoutPending = false;
18231
+ checkoutFreezeTimestamp = null;
18232
+ takeFullSnapshot$1(true);
18233
+ mutationBuffers.forEach((buf) => {
18234
+ buf.resetBuffers();
18235
+ buf.unsetFrozen();
18236
+ });
18237
+ if (visibilityManager) {
18238
+ visibilityManager.unsetFrozen();
18239
+ }
18240
+ };
18144
18241
  wrappedEmit = (r2, isCheckout) => {
18145
18242
  var _a2;
18146
18243
  const e2 = r2;
18147
18244
  e2.timestamp = nowTimestamp();
18148
- if (((_a2 = mutationBuffers[0]) == null ? void 0 : _a2.isFrozen()) && e2.type !== EventType.FullSnapshot && !(e2.type === EventType.IncrementalSnapshot && e2.data.source === IncrementalSource.Mutation)) {
18245
+ e2.checkoutId = checkoutId;
18246
+ if (((_a2 = mutationBuffers[0]) == null ? void 0 : _a2.isFrozen()) && !checkoutPending && e2.type !== EventType.FullSnapshot && !(e2.type === EventType.IncrementalSnapshot && e2.data.source === IncrementalSource.Mutation)) {
18149
18247
  mutationBuffers.forEach((buf) => buf.unfreeze());
18150
18248
  visibilityManager == null ? void 0 : visibilityManager.unfreeze();
18151
18249
  }
@@ -18172,7 +18270,29 @@ function record(options = {}) {
18172
18270
  const exceedCount = checkoutEveryNth && incrementalSnapshotCount >= checkoutEveryNth;
18173
18271
  const exceedTime = checkoutEveryNms && e2.timestamp - lastFullSnapshotEvent.timestamp > checkoutEveryNms;
18174
18272
  if (exceedCount || exceedTime) {
18175
- takeFullSnapshot$1(true);
18273
+ if (checkoutDebounce) {
18274
+ if (!checkoutPending) {
18275
+ checkoutPending = true;
18276
+ checkoutFreezeTimestamp = nowTimestamp();
18277
+ mutationBuffers.forEach((buf) => buf.freeze());
18278
+ visibilityManager == null ? void 0 : visibilityManager.freeze();
18279
+ }
18280
+ if (checkoutDebounceTimer) {
18281
+ clearTimeout(checkoutDebounceTimer);
18282
+ }
18283
+ const frozenDuration = nowTimestamp() - checkoutFreezeTimestamp;
18284
+ const maxFreeze = checkoutDebounce * 3;
18285
+ if (frozenDuration >= maxFreeze) {
18286
+ executeCheckout();
18287
+ } else {
18288
+ checkoutDebounceTimer = setTimeout(
18289
+ () => executeCheckout(),
18290
+ checkoutDebounce
18291
+ );
18292
+ }
18293
+ } else {
18294
+ takeFullSnapshot$1(true);
18295
+ }
18176
18296
  }
18177
18297
  }
18178
18298
  }
@@ -18287,8 +18407,30 @@ function record(options = {}) {
18287
18407
  notifyActivity: checkoutEveryNvm != null ? (count) => {
18288
18408
  visibilityMutationCount += count;
18289
18409
  if (visibilityMutationCount >= checkoutEveryNvm) {
18290
- takeFullSnapshot$1(true);
18291
18410
  visibilityMutationCount = 0;
18411
+ if (checkoutDebounce) {
18412
+ if (!checkoutPending) {
18413
+ checkoutPending = true;
18414
+ checkoutFreezeTimestamp = nowTimestamp();
18415
+ mutationBuffers.forEach((buf) => buf.freeze());
18416
+ visibilityManager == null ? void 0 : visibilityManager.freeze();
18417
+ }
18418
+ if (checkoutDebounceTimer) {
18419
+ clearTimeout(checkoutDebounceTimer);
18420
+ }
18421
+ const frozenDuration = nowTimestamp() - checkoutFreezeTimestamp;
18422
+ const maxFreeze = checkoutDebounce * 3;
18423
+ if (frozenDuration >= maxFreeze) {
18424
+ executeCheckout();
18425
+ } else {
18426
+ checkoutDebounceTimer = setTimeout(
18427
+ () => executeCheckout(),
18428
+ checkoutDebounce
18429
+ );
18430
+ }
18431
+ } else {
18432
+ takeFullSnapshot$1(true);
18433
+ }
18292
18434
  }
18293
18435
  } : void 0
18294
18436
  });
@@ -18297,6 +18439,7 @@ function record(options = {}) {
18297
18439
  if (!recordDOM) {
18298
18440
  return;
18299
18441
  }
18442
+ checkoutId++;
18300
18443
  wrappedEmit(
18301
18444
  {
18302
18445
  type: EventType.Meta,
@@ -18575,6 +18718,10 @@ function record(options = {}) {
18575
18718
  );
18576
18719
  }
18577
18720
  return () => {
18721
+ if (checkoutDebounceTimer) {
18722
+ clearTimeout(checkoutDebounceTimer);
18723
+ checkoutDebounceTimer = null;
18724
+ }
18578
18725
  flushCustomEventQueue$1();
18579
18726
  handlers.forEach((h) => h());
18580
18727
  processedNodeManager.destroy();
@@ -20304,10 +20451,8 @@ class Replayer {
20304
20451
  this.wrapper.appendChild(this.mouseTail);
20305
20452
  }
20306
20453
  this.iframe = document.createElement("iframe");
20307
- const attributes = ["allow-same-origin"];
20308
- if (this.config.UNSAFE_replayCanvas) {
20309
- attributes.push("allow-scripts");
20310
- }
20454
+ const attributes = ["allow-same-origin", "allow-scripts"];
20455
+ if (this.config.UNSAFE_replayCanvas) ;
20311
20456
  this.iframe.style.display = "none";
20312
20457
  this.iframe.setAttribute("sandbox", attributes.join(" "));
20313
20458
  this.disableInteract();
@@ -21503,7 +21648,7 @@ class Replayer {
21503
21648
  this.config.logger.log(REPLAY_CONSOLE_PREFIX, ...args);
21504
21649
  }
21505
21650
  }
21506
- const version = "3.1.1-alpha.2";
21651
+ const version = "3.1.1-alpha.3";
21507
21652
  const { getVersion } = record;
21508
21653
  const { isRecording } = record;
21509
21654
  const { flushCustomEventQueue } = record;