@appsurify-testmap/rrweb-all 2.1.2-alpha.2 → 2.1.3-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.
package/dist/rrweb-all.js CHANGED
@@ -14349,6 +14349,7 @@ class VisibilityManager {
14349
14349
  __publicField(this, "mirror");
14350
14350
  __publicField(this, "mutationCb");
14351
14351
  __publicField(this, "rafId", null);
14352
+ __publicField(this, "intervalId", null);
14352
14353
  __publicField(this, "rafThrottle");
14353
14354
  __publicField(this, "lastFlushTime", 0);
14354
14355
  __publicField(this, "elements", /* @__PURE__ */ new Set());
@@ -14381,7 +14382,7 @@ class VisibilityManager {
14381
14382
  this.throttle = Number((visibilitySampling == null ? void 0 : visibilitySampling.throttle) ?? 100);
14382
14383
  this.threshold = Number((visibilitySampling == null ? void 0 : visibilitySampling.threshold) ?? 0.5);
14383
14384
  this.sensitivity = Number((visibilitySampling == null ? void 0 : visibilitySampling.sensitivity) ?? 0.05);
14384
- this.rafThrottle = Number((visibilitySampling == null ? void 0 : visibilitySampling.rafThrottle) ?? 100);
14385
+ this.rafThrottle = Number((visibilitySampling == null ? void 0 : visibilitySampling.rafThrottle) ?? 50);
14385
14386
  doc.querySelectorAll("*").forEach((el) => this.observe(el));
14386
14387
  const mo = new MutationObserver((mutations) => {
14387
14388
  mutations.forEach((m) => {
@@ -14403,14 +14404,25 @@ class VisibilityManager {
14403
14404
  }
14404
14405
  startPendingFlushLoop() {
14405
14406
  if (this.disabled) return;
14406
- const loop = (timestamp) => {
14407
- if (timestamp - this.lastFlushTime >= this.rafThrottle) {
14408
- this.lastFlushTime = timestamp;
14409
- this.flushPendingVisibilityMutations();
14410
- }
14407
+ if (typeof requestAnimationFrame === "function") {
14408
+ const loop = (timestamp) => {
14409
+ if (timestamp - this.lastFlushTime >= this.rafThrottle) {
14410
+ this.lastFlushTime = timestamp;
14411
+ this.flushPendingVisibilityMutations();
14412
+ }
14413
+ this.rafId = requestAnimationFrame(loop);
14414
+ };
14411
14415
  this.rafId = requestAnimationFrame(loop);
14412
- };
14413
- this.rafId = requestAnimationFrame(loop);
14416
+ } else {
14417
+ const loop = () => {
14418
+ const now = performance.now();
14419
+ if (now - this.lastFlushTime >= this.rafThrottle) {
14420
+ this.lastFlushTime = now;
14421
+ this.flushPendingVisibilityMutations();
14422
+ }
14423
+ };
14424
+ this.intervalId = setInterval(loop, this.rafThrottle);
14425
+ }
14414
14426
  }
14415
14427
  flushPendingVisibilityMutations() {
14416
14428
  if (this.disabled) return;
@@ -14480,6 +14492,7 @@ class VisibilityManager {
14480
14492
  }
14481
14493
  unfreeze() {
14482
14494
  this.frozen = false;
14495
+ this.flushPendingVisibilityMutations();
14483
14496
  }
14484
14497
  lock() {
14485
14498
  this.locked = true;
@@ -14491,10 +14504,17 @@ class VisibilityManager {
14491
14504
  this.elements.clear();
14492
14505
  this.previousState.clear();
14493
14506
  this.pending.clear();
14494
- if (this.rafId) cancelAnimationFrame(this.rafId);
14507
+ if (this.rafId) {
14508
+ cancelAnimationFrame(this.rafId);
14509
+ this.rafId = null;
14510
+ }
14511
+ if (this.intervalId) {
14512
+ clearInterval(this.intervalId);
14513
+ this.intervalId = null;
14514
+ }
14495
14515
  }
14496
14516
  }
14497
- const version$1 = "2.1.2-alpha.2";
14517
+ const version$1 = "2.1.3-alpha.1";
14498
14518
  let wrappedEmit;
14499
14519
  let takeFullSnapshot$1;
14500
14520
  let canvasManager;
@@ -17985,7 +18005,7 @@ class Replayer {
17985
18005
  this.config.logger.log(REPLAY_CONSOLE_PREFIX, ...args);
17986
18006
  }
17987
18007
  }
17988
- const version = "2.1.2-alpha.2";
18008
+ const version = "2.1.3-alpha.1";
17989
18009
  const { getVersion } = record;
17990
18010
  const { isRecording } = record;
17991
18011
  const { flushCustomEventQueue } = record;