@appsurify-testmap/rrweb 2.1.2-alpha.2 → 2.1.2-alpha.5

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.
@@ -14810,6 +14810,7 @@ class VisibilityManager {
14810
14810
  __publicField(this, "mirror");
14811
14811
  __publicField(this, "mutationCb");
14812
14812
  __publicField(this, "rafId", null);
14813
+ __publicField(this, "intervalId", null);
14813
14814
  __publicField(this, "rafThrottle");
14814
14815
  __publicField(this, "lastFlushTime", 0);
14815
14816
  __publicField(this, "elements", /* @__PURE__ */ new Set());
@@ -14842,7 +14843,7 @@ class VisibilityManager {
14842
14843
  this.throttle = Number((_c = visibilitySampling == null ? void 0 : visibilitySampling.throttle) != null ? _c : 100);
14843
14844
  this.threshold = Number((_d = visibilitySampling == null ? void 0 : visibilitySampling.threshold) != null ? _d : 0.5);
14844
14845
  this.sensitivity = Number((_e = visibilitySampling == null ? void 0 : visibilitySampling.sensitivity) != null ? _e : 0.05);
14845
- this.rafThrottle = Number((_f = visibilitySampling == null ? void 0 : visibilitySampling.rafThrottle) != null ? _f : 100);
14846
+ this.rafThrottle = Number((_f = visibilitySampling == null ? void 0 : visibilitySampling.rafThrottle) != null ? _f : 50);
14846
14847
  doc.querySelectorAll("*").forEach((el) => this.observe(el));
14847
14848
  const mo = new MutationObserver((mutations) => {
14848
14849
  mutations.forEach((m) => {
@@ -14865,14 +14866,25 @@ class VisibilityManager {
14865
14866
  startPendingFlushLoop() {
14866
14867
  if (this.disabled)
14867
14868
  return;
14868
- const loop = (timestamp) => {
14869
- if (timestamp - this.lastFlushTime >= this.rafThrottle) {
14870
- this.lastFlushTime = timestamp;
14871
- this.flushPendingVisibilityMutations();
14872
- }
14869
+ if (typeof requestAnimationFrame === "function") {
14870
+ const loop = (timestamp) => {
14871
+ if (timestamp - this.lastFlushTime >= this.rafThrottle) {
14872
+ this.lastFlushTime = timestamp;
14873
+ this.flushPendingVisibilityMutations();
14874
+ }
14875
+ this.rafId = requestAnimationFrame(loop);
14876
+ };
14873
14877
  this.rafId = requestAnimationFrame(loop);
14874
- };
14875
- this.rafId = requestAnimationFrame(loop);
14878
+ } else {
14879
+ const loop = () => {
14880
+ const now = performance.now();
14881
+ if (now - this.lastFlushTime >= this.rafThrottle) {
14882
+ this.lastFlushTime = now;
14883
+ this.flushPendingVisibilityMutations();
14884
+ }
14885
+ };
14886
+ this.intervalId = setInterval(loop, this.rafThrottle);
14887
+ }
14876
14888
  }
14877
14889
  flushPendingVisibilityMutations() {
14878
14890
  if (this.disabled)
@@ -14947,6 +14959,7 @@ class VisibilityManager {
14947
14959
  }
14948
14960
  unfreeze() {
14949
14961
  this.frozen = false;
14962
+ this.flushPendingVisibilityMutations();
14950
14963
  }
14951
14964
  lock() {
14952
14965
  this.locked = true;
@@ -14958,11 +14971,17 @@ class VisibilityManager {
14958
14971
  this.elements.clear();
14959
14972
  this.previousState.clear();
14960
14973
  this.pending.clear();
14961
- if (this.rafId)
14974
+ if (this.rafId) {
14962
14975
  cancelAnimationFrame(this.rafId);
14976
+ this.rafId = null;
14977
+ }
14978
+ if (this.intervalId) {
14979
+ clearInterval(this.intervalId);
14980
+ this.intervalId = null;
14981
+ }
14963
14982
  }
14964
14983
  }
14965
- const version$1 = "2.1.2-alpha.2";
14984
+ const version$1 = "2.1.2-alpha.5";
14966
14985
  let wrappedEmit;
14967
14986
  let takeFullSnapshot$1;
14968
14987
  let canvasManager;
@@ -18480,7 +18499,7 @@ class Replayer {
18480
18499
  this.config.logger.log(REPLAY_CONSOLE_PREFIX, ...args);
18481
18500
  }
18482
18501
  }
18483
- const version = "2.1.2-alpha.2";
18502
+ const version = "2.1.2-alpha.5";
18484
18503
  const { getVersion } = record;
18485
18504
  const { isRecording } = record;
18486
18505
  const { flushCustomEventQueue } = record;