@appsurify-testmap/rrweb-all 3.1.1-alpha.3 → 3.3.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.
- package/dist/rrweb-all.cjs +350 -62
- package/dist/rrweb-all.cjs.map +1 -1
- package/dist/rrweb-all.js +350 -62
- package/dist/rrweb-all.js.map +1 -1
- package/dist/rrweb-all.umd.cjs +358 -62
- package/dist/rrweb-all.umd.cjs.map +3 -3
- package/dist/rrweb-all.umd.min.cjs +44 -44
- package/dist/rrweb-all.umd.min.cjs.map +3 -3
- package/package.json +4 -4
package/dist/rrweb-all.js
CHANGED
|
@@ -15468,6 +15468,30 @@ class MutationBuffer {
|
|
|
15468
15468
|
this.shadowDomManager.reset();
|
|
15469
15469
|
this.canvasManager.reset();
|
|
15470
15470
|
}
|
|
15471
|
+
/**
|
|
15472
|
+
* Clear all accumulated mutation data without emitting.
|
|
15473
|
+
* Used after freeze+debounce checkout — FullSnapshot already captured the state.
|
|
15474
|
+
*/
|
|
15475
|
+
resetBuffers() {
|
|
15476
|
+
this.addedSet = /* @__PURE__ */ new Set();
|
|
15477
|
+
this.movedSet = /* @__PURE__ */ new Set();
|
|
15478
|
+
this.droppedSet = /* @__PURE__ */ new Set();
|
|
15479
|
+
this.removesSubTreeCache = /* @__PURE__ */ new Set();
|
|
15480
|
+
this.mapRemoves = [];
|
|
15481
|
+
this.movedMap = {};
|
|
15482
|
+
this.attributes = [];
|
|
15483
|
+
this.texts = [];
|
|
15484
|
+
this.attributeMap = /* @__PURE__ */ new WeakMap();
|
|
15485
|
+
this.removes = [];
|
|
15486
|
+
}
|
|
15487
|
+
/**
|
|
15488
|
+
* Clear frozen flag without triggering emit.
|
|
15489
|
+
* Used after freeze+debounce checkout — buffers already cleared by resetBuffers().
|
|
15490
|
+
*/
|
|
15491
|
+
unsetFrozen() {
|
|
15492
|
+
this.frozen = false;
|
|
15493
|
+
this.canvasManager.unfreeze();
|
|
15494
|
+
}
|
|
15471
15495
|
}
|
|
15472
15496
|
function deepDelete(addsSet, n2) {
|
|
15473
15497
|
addsSet.delete(n2);
|
|
@@ -15833,6 +15857,30 @@ function initNavigationObserver({
|
|
|
15833
15857
|
handlers.push(restoreReplaceState);
|
|
15834
15858
|
handlers.push(on("popstate", () => emitNavigation("popstate"), win));
|
|
15835
15859
|
handlers.push(on("hashchange", () => emitNavigation("hashchange"), win));
|
|
15860
|
+
const useNavigationAPI = typeof sampling.navigation === "object" ? sampling.navigation.useNavigationAPI ?? true : true;
|
|
15861
|
+
if (useNavigationAPI && "navigation" in win) {
|
|
15862
|
+
try {
|
|
15863
|
+
const nav = win.navigation;
|
|
15864
|
+
const handler = (event) => {
|
|
15865
|
+
var _a2;
|
|
15866
|
+
const navEvent = event;
|
|
15867
|
+
if (navEvent.navigationType === "push" || navEvent.navigationType === "replace") {
|
|
15868
|
+
const destUrl = (_a2 = navEvent.destination) == null ? void 0 : _a2.url;
|
|
15869
|
+
if (destUrl && destUrl !== lastHref) {
|
|
15870
|
+
navigationCb({
|
|
15871
|
+
href: destUrl,
|
|
15872
|
+
oldHref: lastHref,
|
|
15873
|
+
navigationType: "navigate"
|
|
15874
|
+
});
|
|
15875
|
+
lastHref = destUrl;
|
|
15876
|
+
}
|
|
15877
|
+
}
|
|
15878
|
+
};
|
|
15879
|
+
nav.addEventListener("navigate", handler);
|
|
15880
|
+
handlers.push(() => nav.removeEventListener("navigate", handler));
|
|
15881
|
+
} catch {
|
|
15882
|
+
}
|
|
15883
|
+
}
|
|
15836
15884
|
return callbackWrapper(() => {
|
|
15837
15885
|
handlers.forEach((h) => h());
|
|
15838
15886
|
});
|
|
@@ -17878,10 +17926,13 @@ class VisibilityManager {
|
|
|
17878
17926
|
}
|
|
17879
17927
|
flushBuffer() {
|
|
17880
17928
|
var _a2;
|
|
17929
|
+
if (this.frozen || this.locked) return;
|
|
17881
17930
|
if (this.buffer.size === 0) return;
|
|
17882
|
-
|
|
17883
|
-
|
|
17931
|
+
const mutations = Array.from(this.buffer.values());
|
|
17932
|
+
const count = mutations.length;
|
|
17884
17933
|
this.buffer.clear();
|
|
17934
|
+
this.mutationCb({ mutations });
|
|
17935
|
+
(_a2 = this.notifyActivity) == null ? void 0 : _a2.call(this, count);
|
|
17885
17936
|
}
|
|
17886
17937
|
observe(el) {
|
|
17887
17938
|
if (this.disabled) return;
|
|
@@ -17895,6 +17946,10 @@ class VisibilityManager {
|
|
|
17895
17946
|
}
|
|
17896
17947
|
freeze() {
|
|
17897
17948
|
this.frozen = true;
|
|
17949
|
+
if (this.debounceTimer) {
|
|
17950
|
+
clearTimeout(this.debounceTimer);
|
|
17951
|
+
this.debounceTimer = null;
|
|
17952
|
+
}
|
|
17898
17953
|
}
|
|
17899
17954
|
unfreeze() {
|
|
17900
17955
|
this.frozen = false;
|
|
@@ -17902,9 +17957,33 @@ class VisibilityManager {
|
|
|
17902
17957
|
}
|
|
17903
17958
|
lock() {
|
|
17904
17959
|
this.locked = true;
|
|
17960
|
+
if (this.debounceTimer) {
|
|
17961
|
+
clearTimeout(this.debounceTimer);
|
|
17962
|
+
this.debounceTimer = null;
|
|
17963
|
+
}
|
|
17905
17964
|
}
|
|
17906
17965
|
unlock() {
|
|
17907
17966
|
this.locked = false;
|
|
17967
|
+
this.buffer.clear();
|
|
17968
|
+
if (this.debounceTimer) {
|
|
17969
|
+
clearTimeout(this.debounceTimer);
|
|
17970
|
+
this.debounceTimer = null;
|
|
17971
|
+
}
|
|
17972
|
+
if (!this.disabled && this.elements.size > 0) {
|
|
17973
|
+
this.previousState = computeVisibility(this.elements, /* @__PURE__ */ new Map(), {
|
|
17974
|
+
root: this.root,
|
|
17975
|
+
threshold: this.threshold,
|
|
17976
|
+
sensitivity: this.sensitivity,
|
|
17977
|
+
rootMargin: this.rootMargin
|
|
17978
|
+
});
|
|
17979
|
+
}
|
|
17980
|
+
}
|
|
17981
|
+
/**
|
|
17982
|
+
* Clear frozen flag without triggering flush.
|
|
17983
|
+
* Used after freeze+debounce checkout — buffer already cleared by unlock().
|
|
17984
|
+
*/
|
|
17985
|
+
unsetFrozen() {
|
|
17986
|
+
this.frozen = false;
|
|
17908
17987
|
}
|
|
17909
17988
|
reset() {
|
|
17910
17989
|
this.elements.clear();
|
|
@@ -17920,6 +17999,164 @@ class VisibilityManager {
|
|
|
17920
17999
|
}
|
|
17921
18000
|
}
|
|
17922
18001
|
}
|
|
18002
|
+
const DEFAULT_SETTLE_TIMEOUT = 150;
|
|
18003
|
+
const DEFAULT_MAX_WAIT = 5e3;
|
|
18004
|
+
const DEFAULT_DEBOUNCE = 100;
|
|
18005
|
+
class NavigationManager {
|
|
18006
|
+
constructor(options) {
|
|
18007
|
+
__publicField(this, "frozen", false);
|
|
18008
|
+
__publicField(this, "locked", false);
|
|
18009
|
+
__publicField(this, "disabled", false);
|
|
18010
|
+
__publicField(this, "settleTimeout");
|
|
18011
|
+
__publicField(this, "maxWait");
|
|
18012
|
+
__publicField(this, "debounceMs");
|
|
18013
|
+
__publicField(this, "settlingObserver", null);
|
|
18014
|
+
__publicField(this, "debounceTimer", null);
|
|
18015
|
+
__publicField(this, "settleCheckTimer", null);
|
|
18016
|
+
__publicField(this, "maxWaitTimer", null);
|
|
18017
|
+
__publicField(this, "lastMutationTime", 0);
|
|
18018
|
+
__publicField(this, "pendingNavigation", null);
|
|
18019
|
+
__publicField(this, "doc");
|
|
18020
|
+
__publicField(this, "onSnapshot");
|
|
18021
|
+
const { doc, config, onSnapshot } = options;
|
|
18022
|
+
this.doc = doc;
|
|
18023
|
+
this.onSnapshot = callbackWrapper(onSnapshot);
|
|
18024
|
+
this.settleTimeout = config.settleTimeout ?? DEFAULT_SETTLE_TIMEOUT;
|
|
18025
|
+
this.maxWait = config.maxWait ?? DEFAULT_MAX_WAIT;
|
|
18026
|
+
this.debounceMs = config.debounce ?? DEFAULT_DEBOUNCE;
|
|
18027
|
+
}
|
|
18028
|
+
handleNavigation(data) {
|
|
18029
|
+
if (this.disabled) return;
|
|
18030
|
+
if (this.locked) return;
|
|
18031
|
+
this.cancelTimers();
|
|
18032
|
+
this.disconnectSettlingObserver();
|
|
18033
|
+
this.pendingNavigation = data;
|
|
18034
|
+
if (this.frozen) {
|
|
18035
|
+
return;
|
|
18036
|
+
}
|
|
18037
|
+
this.startDebounce();
|
|
18038
|
+
}
|
|
18039
|
+
cancelPending() {
|
|
18040
|
+
this.cancelTimers();
|
|
18041
|
+
this.disconnectSettlingObserver();
|
|
18042
|
+
this.pendingNavigation = null;
|
|
18043
|
+
}
|
|
18044
|
+
freeze() {
|
|
18045
|
+
this.frozen = true;
|
|
18046
|
+
this.cancelTimers();
|
|
18047
|
+
this.disconnectSettlingObserver();
|
|
18048
|
+
}
|
|
18049
|
+
unfreeze() {
|
|
18050
|
+
this.frozen = false;
|
|
18051
|
+
if (this.pendingNavigation && !this.locked && !this.disabled) {
|
|
18052
|
+
this.startDebounce();
|
|
18053
|
+
}
|
|
18054
|
+
}
|
|
18055
|
+
lock() {
|
|
18056
|
+
this.locked = true;
|
|
18057
|
+
this.cancelTimers();
|
|
18058
|
+
this.disconnectSettlingObserver();
|
|
18059
|
+
}
|
|
18060
|
+
unlock() {
|
|
18061
|
+
this.locked = false;
|
|
18062
|
+
this.pendingNavigation = null;
|
|
18063
|
+
}
|
|
18064
|
+
unsetFrozen() {
|
|
18065
|
+
this.frozen = false;
|
|
18066
|
+
}
|
|
18067
|
+
reset() {
|
|
18068
|
+
this.cancelTimers();
|
|
18069
|
+
this.disconnectSettlingObserver();
|
|
18070
|
+
this.pendingNavigation = null;
|
|
18071
|
+
this.frozen = false;
|
|
18072
|
+
this.locked = false;
|
|
18073
|
+
}
|
|
18074
|
+
destroy() {
|
|
18075
|
+
this.reset();
|
|
18076
|
+
this.disabled = true;
|
|
18077
|
+
}
|
|
18078
|
+
startDebounce() {
|
|
18079
|
+
this.debounceTimer = setTimeout(() => {
|
|
18080
|
+
this.debounceTimer = null;
|
|
18081
|
+
this.startDOMSettling();
|
|
18082
|
+
}, this.debounceMs);
|
|
18083
|
+
}
|
|
18084
|
+
startDOMSettling() {
|
|
18085
|
+
if (this.frozen || this.locked || this.disabled) return;
|
|
18086
|
+
this.lastMutationTime = performance.now();
|
|
18087
|
+
const ObserverCtor = mutationObserverCtor();
|
|
18088
|
+
this.settlingObserver = new ObserverCtor(() => {
|
|
18089
|
+
this.lastMutationTime = performance.now();
|
|
18090
|
+
if (this.settleCheckTimer !== null) {
|
|
18091
|
+
clearTimeout(this.settleCheckTimer);
|
|
18092
|
+
}
|
|
18093
|
+
this.settleCheckTimer = setTimeout(
|
|
18094
|
+
() => this.checkSettled(),
|
|
18095
|
+
this.settleTimeout
|
|
18096
|
+
);
|
|
18097
|
+
});
|
|
18098
|
+
this.settlingObserver.observe(this.doc, {
|
|
18099
|
+
childList: true,
|
|
18100
|
+
subtree: true,
|
|
18101
|
+
attributes: true,
|
|
18102
|
+
characterData: true
|
|
18103
|
+
});
|
|
18104
|
+
this.settleCheckTimer = setTimeout(
|
|
18105
|
+
() => this.checkSettled(),
|
|
18106
|
+
this.settleTimeout
|
|
18107
|
+
);
|
|
18108
|
+
this.maxWaitTimer = setTimeout(() => {
|
|
18109
|
+
this.maxWaitTimer = null;
|
|
18110
|
+
this.completeSettling();
|
|
18111
|
+
}, this.maxWait);
|
|
18112
|
+
}
|
|
18113
|
+
checkSettled() {
|
|
18114
|
+
this.settleCheckTimer = null;
|
|
18115
|
+
const elapsed = performance.now() - this.lastMutationTime;
|
|
18116
|
+
if (elapsed >= this.settleTimeout) {
|
|
18117
|
+
this.completeSettling();
|
|
18118
|
+
} else {
|
|
18119
|
+
this.settleCheckTimer = setTimeout(
|
|
18120
|
+
() => this.checkSettled(),
|
|
18121
|
+
this.settleTimeout - elapsed
|
|
18122
|
+
);
|
|
18123
|
+
}
|
|
18124
|
+
}
|
|
18125
|
+
completeSettling() {
|
|
18126
|
+
if (this.frozen || this.locked || this.disabled) return;
|
|
18127
|
+
if (!this.pendingNavigation) return;
|
|
18128
|
+
this.cancelTimers();
|
|
18129
|
+
this.disconnectSettlingObserver();
|
|
18130
|
+
this.pendingNavigation = null;
|
|
18131
|
+
requestAnimationFrame(() => {
|
|
18132
|
+
requestAnimationFrame(() => {
|
|
18133
|
+
if (!this.frozen && !this.locked && !this.disabled) {
|
|
18134
|
+
this.onSnapshot(true);
|
|
18135
|
+
}
|
|
18136
|
+
});
|
|
18137
|
+
});
|
|
18138
|
+
}
|
|
18139
|
+
cancelTimers() {
|
|
18140
|
+
if (this.debounceTimer !== null) {
|
|
18141
|
+
clearTimeout(this.debounceTimer);
|
|
18142
|
+
this.debounceTimer = null;
|
|
18143
|
+
}
|
|
18144
|
+
if (this.settleCheckTimer !== null) {
|
|
18145
|
+
clearTimeout(this.settleCheckTimer);
|
|
18146
|
+
this.settleCheckTimer = null;
|
|
18147
|
+
}
|
|
18148
|
+
if (this.maxWaitTimer !== null) {
|
|
18149
|
+
clearTimeout(this.maxWaitTimer);
|
|
18150
|
+
this.maxWaitTimer = null;
|
|
18151
|
+
}
|
|
18152
|
+
}
|
|
18153
|
+
disconnectSettlingObserver() {
|
|
18154
|
+
if (this.settlingObserver) {
|
|
18155
|
+
this.settlingObserver.disconnect();
|
|
18156
|
+
this.settlingObserver = null;
|
|
18157
|
+
}
|
|
18158
|
+
}
|
|
18159
|
+
}
|
|
17923
18160
|
class StylesheetManager {
|
|
17924
18161
|
constructor(options) {
|
|
17925
18162
|
__publicField(this, "trackedLinkElements", /* @__PURE__ */ new WeakSet());
|
|
@@ -18003,43 +18240,13 @@ class ProcessedNodeManager {
|
|
|
18003
18240
|
destroy() {
|
|
18004
18241
|
}
|
|
18005
18242
|
}
|
|
18006
|
-
const version$1 = "3.
|
|
18243
|
+
const version$1 = "3.3.0-alpha.1";
|
|
18007
18244
|
let wrappedEmit;
|
|
18008
18245
|
let takeFullSnapshot$1;
|
|
18009
18246
|
let canvasManager;
|
|
18010
18247
|
let recording = false;
|
|
18011
18248
|
const customEventQueue = [];
|
|
18012
18249
|
let flushCustomEventQueue$1;
|
|
18013
|
-
function waitForDOMStabilization(win) {
|
|
18014
|
-
const maxWaitMs = 5e3;
|
|
18015
|
-
return new Promise((resolve2) => {
|
|
18016
|
-
const captureAfterPaint = () => {
|
|
18017
|
-
requestAnimationFrame(() => {
|
|
18018
|
-
requestAnimationFrame(() => {
|
|
18019
|
-
resolve2();
|
|
18020
|
-
});
|
|
18021
|
-
});
|
|
18022
|
-
};
|
|
18023
|
-
const safeResolve = /* @__PURE__ */ (() => {
|
|
18024
|
-
let called = false;
|
|
18025
|
-
return () => {
|
|
18026
|
-
if (!called) {
|
|
18027
|
-
called = true;
|
|
18028
|
-
captureAfterPaint();
|
|
18029
|
-
}
|
|
18030
|
-
};
|
|
18031
|
-
})();
|
|
18032
|
-
if (["interactive", "complete"].includes(win.document.readyState)) {
|
|
18033
|
-
safeResolve();
|
|
18034
|
-
} else {
|
|
18035
|
-
win.addEventListener("DOMContentLoaded", safeResolve, { once: true });
|
|
18036
|
-
win.addEventListener("load", safeResolve, { once: true });
|
|
18037
|
-
setTimeout(() => {
|
|
18038
|
-
safeResolve();
|
|
18039
|
-
}, maxWaitMs);
|
|
18040
|
-
}
|
|
18041
|
-
});
|
|
18042
|
-
}
|
|
18043
18250
|
try {
|
|
18044
18251
|
if (Array.from([1], (x2) => x2 * 2)[0] !== 2) {
|
|
18045
18252
|
const cleanFrame = document.createElement("iframe");
|
|
@@ -18057,6 +18264,7 @@ function record(options = {}) {
|
|
|
18057
18264
|
checkoutEveryNms,
|
|
18058
18265
|
checkoutEveryNth,
|
|
18059
18266
|
checkoutEveryNvm,
|
|
18267
|
+
checkoutDebounce,
|
|
18060
18268
|
blockClass = "rr-block",
|
|
18061
18269
|
blockSelector = null,
|
|
18062
18270
|
ignoreClass = "rr-ignore",
|
|
@@ -18151,6 +18359,10 @@ function record(options = {}) {
|
|
|
18151
18359
|
let lastFullSnapshotEvent;
|
|
18152
18360
|
let incrementalSnapshotCount = 0;
|
|
18153
18361
|
let visibilityMutationCount = 0;
|
|
18362
|
+
let checkoutId = 0;
|
|
18363
|
+
let checkoutPending = false;
|
|
18364
|
+
let checkoutDebounceTimer = null;
|
|
18365
|
+
let checkoutFreezeTimestamp = null;
|
|
18154
18366
|
const eventProcessor = (e2) => {
|
|
18155
18367
|
for (const plugin3 of plugins || []) {
|
|
18156
18368
|
if (plugin3.eventProcessor) {
|
|
@@ -18163,13 +18375,32 @@ function record(options = {}) {
|
|
|
18163
18375
|
}
|
|
18164
18376
|
return e2;
|
|
18165
18377
|
};
|
|
18378
|
+
const executeCheckout = () => {
|
|
18379
|
+
checkoutDebounceTimer = null;
|
|
18380
|
+
checkoutPending = false;
|
|
18381
|
+
checkoutFreezeTimestamp = null;
|
|
18382
|
+
navigationManager == null ? void 0 : navigationManager.cancelPending();
|
|
18383
|
+
takeFullSnapshot$1(true);
|
|
18384
|
+
mutationBuffers.forEach((buf) => {
|
|
18385
|
+
buf.resetBuffers();
|
|
18386
|
+
buf.unsetFrozen();
|
|
18387
|
+
});
|
|
18388
|
+
if (visibilityManager) {
|
|
18389
|
+
visibilityManager.unsetFrozen();
|
|
18390
|
+
}
|
|
18391
|
+
if (navigationManager) {
|
|
18392
|
+
navigationManager.unsetFrozen();
|
|
18393
|
+
}
|
|
18394
|
+
};
|
|
18166
18395
|
wrappedEmit = (r2, isCheckout) => {
|
|
18167
18396
|
var _a2;
|
|
18168
18397
|
const e2 = r2;
|
|
18169
18398
|
e2.timestamp = nowTimestamp();
|
|
18170
|
-
|
|
18399
|
+
e2.checkoutId = checkoutId;
|
|
18400
|
+
if (((_a2 = mutationBuffers[0]) == null ? void 0 : _a2.isFrozen()) && !checkoutPending && e2.type !== EventType.FullSnapshot && !(e2.type === EventType.IncrementalSnapshot && e2.data.source === IncrementalSource.Mutation)) {
|
|
18171
18401
|
mutationBuffers.forEach((buf) => buf.unfreeze());
|
|
18172
18402
|
visibilityManager == null ? void 0 : visibilityManager.unfreeze();
|
|
18403
|
+
navigationManager == null ? void 0 : navigationManager.unfreeze();
|
|
18173
18404
|
}
|
|
18174
18405
|
if (inEmittingFrame) {
|
|
18175
18406
|
emit == null ? void 0 : emit(eventProcessor(e2), isCheckout);
|
|
@@ -18194,7 +18425,29 @@ function record(options = {}) {
|
|
|
18194
18425
|
const exceedCount = checkoutEveryNth && incrementalSnapshotCount >= checkoutEveryNth;
|
|
18195
18426
|
const exceedTime = checkoutEveryNms && e2.timestamp - lastFullSnapshotEvent.timestamp > checkoutEveryNms;
|
|
18196
18427
|
if (exceedCount || exceedTime) {
|
|
18197
|
-
|
|
18428
|
+
if (checkoutDebounce) {
|
|
18429
|
+
if (!checkoutPending) {
|
|
18430
|
+
checkoutPending = true;
|
|
18431
|
+
checkoutFreezeTimestamp = nowTimestamp();
|
|
18432
|
+
mutationBuffers.forEach((buf) => buf.freeze());
|
|
18433
|
+
visibilityManager == null ? void 0 : visibilityManager.freeze();
|
|
18434
|
+
}
|
|
18435
|
+
if (checkoutDebounceTimer) {
|
|
18436
|
+
clearTimeout(checkoutDebounceTimer);
|
|
18437
|
+
}
|
|
18438
|
+
const frozenDuration = nowTimestamp() - checkoutFreezeTimestamp;
|
|
18439
|
+
const maxFreeze = checkoutDebounce * 3;
|
|
18440
|
+
if (frozenDuration >= maxFreeze) {
|
|
18441
|
+
executeCheckout();
|
|
18442
|
+
} else {
|
|
18443
|
+
checkoutDebounceTimer = setTimeout(
|
|
18444
|
+
() => executeCheckout(),
|
|
18445
|
+
checkoutDebounce
|
|
18446
|
+
);
|
|
18447
|
+
}
|
|
18448
|
+
} else {
|
|
18449
|
+
takeFullSnapshot$1(true);
|
|
18450
|
+
}
|
|
18198
18451
|
}
|
|
18199
18452
|
}
|
|
18200
18453
|
}
|
|
@@ -18309,8 +18562,30 @@ function record(options = {}) {
|
|
|
18309
18562
|
notifyActivity: checkoutEveryNvm != null ? (count) => {
|
|
18310
18563
|
visibilityMutationCount += count;
|
|
18311
18564
|
if (visibilityMutationCount >= checkoutEveryNvm) {
|
|
18312
|
-
takeFullSnapshot$1(true);
|
|
18313
18565
|
visibilityMutationCount = 0;
|
|
18566
|
+
if (checkoutDebounce) {
|
|
18567
|
+
if (!checkoutPending) {
|
|
18568
|
+
checkoutPending = true;
|
|
18569
|
+
checkoutFreezeTimestamp = nowTimestamp();
|
|
18570
|
+
mutationBuffers.forEach((buf) => buf.freeze());
|
|
18571
|
+
visibilityManager == null ? void 0 : visibilityManager.freeze();
|
|
18572
|
+
}
|
|
18573
|
+
if (checkoutDebounceTimer) {
|
|
18574
|
+
clearTimeout(checkoutDebounceTimer);
|
|
18575
|
+
}
|
|
18576
|
+
const frozenDuration = nowTimestamp() - checkoutFreezeTimestamp;
|
|
18577
|
+
const maxFreeze = checkoutDebounce * 3;
|
|
18578
|
+
if (frozenDuration >= maxFreeze) {
|
|
18579
|
+
executeCheckout();
|
|
18580
|
+
} else {
|
|
18581
|
+
checkoutDebounceTimer = setTimeout(
|
|
18582
|
+
() => executeCheckout(),
|
|
18583
|
+
checkoutDebounce
|
|
18584
|
+
);
|
|
18585
|
+
}
|
|
18586
|
+
} else {
|
|
18587
|
+
takeFullSnapshot$1(true);
|
|
18588
|
+
}
|
|
18314
18589
|
}
|
|
18315
18590
|
} : void 0
|
|
18316
18591
|
});
|
|
@@ -18319,6 +18594,7 @@ function record(options = {}) {
|
|
|
18319
18594
|
if (!recordDOM) {
|
|
18320
18595
|
return;
|
|
18321
18596
|
}
|
|
18597
|
+
checkoutId++;
|
|
18322
18598
|
wrappedEmit(
|
|
18323
18599
|
{
|
|
18324
18600
|
type: EventType.Meta,
|
|
@@ -18334,6 +18610,7 @@ function record(options = {}) {
|
|
|
18334
18610
|
shadowDomManager.init();
|
|
18335
18611
|
mutationBuffers.forEach((buf) => buf.lock());
|
|
18336
18612
|
visibilityManager == null ? void 0 : visibilityManager.lock();
|
|
18613
|
+
navigationManager == null ? void 0 : navigationManager.lock();
|
|
18337
18614
|
const node2 = snapshot(document, {
|
|
18338
18615
|
mirror,
|
|
18339
18616
|
blockClass,
|
|
@@ -18385,6 +18662,7 @@ function record(options = {}) {
|
|
|
18385
18662
|
);
|
|
18386
18663
|
mutationBuffers.forEach((buf) => buf.unlock());
|
|
18387
18664
|
visibilityManager == null ? void 0 : visibilityManager.unlock();
|
|
18665
|
+
navigationManager == null ? void 0 : navigationManager.unlock();
|
|
18388
18666
|
if (document.adoptedStyleSheets && document.adoptedStyleSheets.length > 0)
|
|
18389
18667
|
stylesheetManager.adoptStyleSheets(
|
|
18390
18668
|
document.adoptedStyleSheets,
|
|
@@ -18397,6 +18675,31 @@ function record(options = {}) {
|
|
|
18397
18675
|
}
|
|
18398
18676
|
customEventQueue.length = 0;
|
|
18399
18677
|
};
|
|
18678
|
+
let navigationManager;
|
|
18679
|
+
const navigationSampling = sampling.navigation;
|
|
18680
|
+
if (navigationSampling !== false) {
|
|
18681
|
+
const navConfig = typeof navigationSampling === "object" ? navigationSampling : {};
|
|
18682
|
+
navigationManager = new NavigationManager({
|
|
18683
|
+
doc: document,
|
|
18684
|
+
config: navConfig,
|
|
18685
|
+
onSnapshot: (isCheckout) => {
|
|
18686
|
+
if (checkoutPending) {
|
|
18687
|
+
if (checkoutDebounceTimer) {
|
|
18688
|
+
clearTimeout(checkoutDebounceTimer);
|
|
18689
|
+
checkoutDebounceTimer = null;
|
|
18690
|
+
}
|
|
18691
|
+
checkoutPending = false;
|
|
18692
|
+
checkoutFreezeTimestamp = null;
|
|
18693
|
+
mutationBuffers.forEach((buf) => {
|
|
18694
|
+
buf.resetBuffers();
|
|
18695
|
+
buf.unsetFrozen();
|
|
18696
|
+
});
|
|
18697
|
+
visibilityManager == null ? void 0 : visibilityManager.unsetFrozen();
|
|
18698
|
+
}
|
|
18699
|
+
takeFullSnapshot$1(isCheckout);
|
|
18700
|
+
}
|
|
18701
|
+
});
|
|
18702
|
+
}
|
|
18400
18703
|
try {
|
|
18401
18704
|
const handlers = [];
|
|
18402
18705
|
const observe = (doc) => {
|
|
@@ -18427,14 +18730,11 @@ function record(options = {}) {
|
|
|
18427
18730
|
}
|
|
18428
18731
|
}),
|
|
18429
18732
|
navigationCb: (navData) => {
|
|
18430
|
-
|
|
18431
|
-
|
|
18432
|
-
|
|
18433
|
-
|
|
18434
|
-
|
|
18435
|
-
navData.href
|
|
18436
|
-
);
|
|
18437
|
-
takeFullSnapshot$1(true);
|
|
18733
|
+
if (navigationManager) {
|
|
18734
|
+
navigationManager.handleNavigation(navData);
|
|
18735
|
+
} else {
|
|
18736
|
+
takeFullSnapshot$1(true);
|
|
18737
|
+
}
|
|
18438
18738
|
},
|
|
18439
18739
|
inputCb: (v2) => wrappedEmit({
|
|
18440
18740
|
type: EventType.IncrementalSnapshot,
|
|
@@ -18553,23 +18853,6 @@ function record(options = {}) {
|
|
|
18553
18853
|
flushCustomEventQueue$1();
|
|
18554
18854
|
}
|
|
18555
18855
|
};
|
|
18556
|
-
const runInit = async () => {
|
|
18557
|
-
if (flushCustomEvent === "before") {
|
|
18558
|
-
flushCustomEventQueue$1();
|
|
18559
|
-
}
|
|
18560
|
-
if (recordAfter === "DOMContentStabilized") {
|
|
18561
|
-
console.debug(`[${nowTimestamp()}] [rrweb:record] 🟢 Waiting for DOM stabilization...`);
|
|
18562
|
-
await waitForDOMStabilization(window);
|
|
18563
|
-
console.debug(`[${nowTimestamp()}] [rrweb:record] ✅ DOM stabilized, starting recording`);
|
|
18564
|
-
}
|
|
18565
|
-
console.debug(`[${nowTimestamp()}] [rrweb:record] ✅ Init dom and takeFullSnapshot `);
|
|
18566
|
-
takeFullSnapshot$1();
|
|
18567
|
-
handlers.push(observe(document));
|
|
18568
|
-
recording = true;
|
|
18569
|
-
if (flushCustomEvent === "after") {
|
|
18570
|
-
flushCustomEventQueue$1();
|
|
18571
|
-
}
|
|
18572
|
-
};
|
|
18573
18856
|
if (document.readyState === "interactive" || document.readyState === "complete") {
|
|
18574
18857
|
init();
|
|
18575
18858
|
} else {
|
|
@@ -18597,8 +18880,13 @@ function record(options = {}) {
|
|
|
18597
18880
|
);
|
|
18598
18881
|
}
|
|
18599
18882
|
return () => {
|
|
18883
|
+
if (checkoutDebounceTimer) {
|
|
18884
|
+
clearTimeout(checkoutDebounceTimer);
|
|
18885
|
+
checkoutDebounceTimer = null;
|
|
18886
|
+
}
|
|
18600
18887
|
flushCustomEventQueue$1();
|
|
18601
18888
|
handlers.forEach((h) => h());
|
|
18889
|
+
navigationManager == null ? void 0 : navigationManager.destroy();
|
|
18602
18890
|
processedNodeManager.destroy();
|
|
18603
18891
|
recording = false;
|
|
18604
18892
|
unregisterErrorHandler();
|
|
@@ -21523,7 +21811,7 @@ class Replayer {
|
|
|
21523
21811
|
this.config.logger.log(REPLAY_CONSOLE_PREFIX, ...args);
|
|
21524
21812
|
}
|
|
21525
21813
|
}
|
|
21526
|
-
const version = "3.
|
|
21814
|
+
const version = "3.3.0-alpha.1";
|
|
21527
21815
|
const { getVersion } = record;
|
|
21528
21816
|
const { isRecording } = record;
|
|
21529
21817
|
const { flushCustomEventQueue } = record;
|