@appsurify-testmap/rrweb-record 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-record.cjs +349 -61
- package/dist/rrweb-record.cjs.map +1 -1
- package/dist/rrweb-record.js +349 -61
- package/dist/rrweb-record.js.map +1 -1
- package/dist/rrweb-record.umd.cjs +357 -61
- package/dist/rrweb-record.umd.cjs.map +3 -3
- package/dist/rrweb-record.umd.min.cjs +32 -32
- package/dist/rrweb-record.umd.min.cjs.map +3 -3
- package/package.json +4 -4
package/dist/rrweb-record.cjs
CHANGED
|
@@ -13471,6 +13471,30 @@ class MutationBuffer {
|
|
|
13471
13471
|
this.shadowDomManager.reset();
|
|
13472
13472
|
this.canvasManager.reset();
|
|
13473
13473
|
}
|
|
13474
|
+
/**
|
|
13475
|
+
* Clear all accumulated mutation data without emitting.
|
|
13476
|
+
* Used after freeze+debounce checkout — FullSnapshot already captured the state.
|
|
13477
|
+
*/
|
|
13478
|
+
resetBuffers() {
|
|
13479
|
+
this.addedSet = /* @__PURE__ */ new Set();
|
|
13480
|
+
this.movedSet = /* @__PURE__ */ new Set();
|
|
13481
|
+
this.droppedSet = /* @__PURE__ */ new Set();
|
|
13482
|
+
this.removesSubTreeCache = /* @__PURE__ */ new Set();
|
|
13483
|
+
this.mapRemoves = [];
|
|
13484
|
+
this.movedMap = {};
|
|
13485
|
+
this.attributes = [];
|
|
13486
|
+
this.texts = [];
|
|
13487
|
+
this.attributeMap = /* @__PURE__ */ new WeakMap();
|
|
13488
|
+
this.removes = [];
|
|
13489
|
+
}
|
|
13490
|
+
/**
|
|
13491
|
+
* Clear frozen flag without triggering emit.
|
|
13492
|
+
* Used after freeze+debounce checkout — buffers already cleared by resetBuffers().
|
|
13493
|
+
*/
|
|
13494
|
+
unsetFrozen() {
|
|
13495
|
+
this.frozen = false;
|
|
13496
|
+
this.canvasManager.unfreeze();
|
|
13497
|
+
}
|
|
13474
13498
|
}
|
|
13475
13499
|
function deepDelete(addsSet, n2) {
|
|
13476
13500
|
addsSet.delete(n2);
|
|
@@ -13836,6 +13860,30 @@ function initNavigationObserver({
|
|
|
13836
13860
|
handlers.push(restoreReplaceState);
|
|
13837
13861
|
handlers.push(on("popstate", () => emitNavigation("popstate"), win));
|
|
13838
13862
|
handlers.push(on("hashchange", () => emitNavigation("hashchange"), win));
|
|
13863
|
+
const useNavigationAPI = typeof sampling.navigation === "object" ? sampling.navigation.useNavigationAPI ?? true : true;
|
|
13864
|
+
if (useNavigationAPI && "navigation" in win) {
|
|
13865
|
+
try {
|
|
13866
|
+
const nav = win.navigation;
|
|
13867
|
+
const handler = (event) => {
|
|
13868
|
+
var _a2;
|
|
13869
|
+
const navEvent = event;
|
|
13870
|
+
if (navEvent.navigationType === "push" || navEvent.navigationType === "replace") {
|
|
13871
|
+
const destUrl = (_a2 = navEvent.destination) == null ? void 0 : _a2.url;
|
|
13872
|
+
if (destUrl && destUrl !== lastHref) {
|
|
13873
|
+
navigationCb({
|
|
13874
|
+
href: destUrl,
|
|
13875
|
+
oldHref: lastHref,
|
|
13876
|
+
navigationType: "navigate"
|
|
13877
|
+
});
|
|
13878
|
+
lastHref = destUrl;
|
|
13879
|
+
}
|
|
13880
|
+
}
|
|
13881
|
+
};
|
|
13882
|
+
nav.addEventListener("navigate", handler);
|
|
13883
|
+
handlers.push(() => nav.removeEventListener("navigate", handler));
|
|
13884
|
+
} catch {
|
|
13885
|
+
}
|
|
13886
|
+
}
|
|
13839
13887
|
return callbackWrapper(() => {
|
|
13840
13888
|
handlers.forEach((h) => h());
|
|
13841
13889
|
});
|
|
@@ -15861,10 +15909,13 @@ class VisibilityManager {
|
|
|
15861
15909
|
}
|
|
15862
15910
|
flushBuffer() {
|
|
15863
15911
|
var _a2;
|
|
15912
|
+
if (this.frozen || this.locked) return;
|
|
15864
15913
|
if (this.buffer.size === 0) return;
|
|
15865
|
-
|
|
15866
|
-
|
|
15914
|
+
const mutations = Array.from(this.buffer.values());
|
|
15915
|
+
const count = mutations.length;
|
|
15867
15916
|
this.buffer.clear();
|
|
15917
|
+
this.mutationCb({ mutations });
|
|
15918
|
+
(_a2 = this.notifyActivity) == null ? void 0 : _a2.call(this, count);
|
|
15868
15919
|
}
|
|
15869
15920
|
observe(el) {
|
|
15870
15921
|
if (this.disabled) return;
|
|
@@ -15878,6 +15929,10 @@ class VisibilityManager {
|
|
|
15878
15929
|
}
|
|
15879
15930
|
freeze() {
|
|
15880
15931
|
this.frozen = true;
|
|
15932
|
+
if (this.debounceTimer) {
|
|
15933
|
+
clearTimeout(this.debounceTimer);
|
|
15934
|
+
this.debounceTimer = null;
|
|
15935
|
+
}
|
|
15881
15936
|
}
|
|
15882
15937
|
unfreeze() {
|
|
15883
15938
|
this.frozen = false;
|
|
@@ -15885,9 +15940,33 @@ class VisibilityManager {
|
|
|
15885
15940
|
}
|
|
15886
15941
|
lock() {
|
|
15887
15942
|
this.locked = true;
|
|
15943
|
+
if (this.debounceTimer) {
|
|
15944
|
+
clearTimeout(this.debounceTimer);
|
|
15945
|
+
this.debounceTimer = null;
|
|
15946
|
+
}
|
|
15888
15947
|
}
|
|
15889
15948
|
unlock() {
|
|
15890
15949
|
this.locked = false;
|
|
15950
|
+
this.buffer.clear();
|
|
15951
|
+
if (this.debounceTimer) {
|
|
15952
|
+
clearTimeout(this.debounceTimer);
|
|
15953
|
+
this.debounceTimer = null;
|
|
15954
|
+
}
|
|
15955
|
+
if (!this.disabled && this.elements.size > 0) {
|
|
15956
|
+
this.previousState = computeVisibility(this.elements, /* @__PURE__ */ new Map(), {
|
|
15957
|
+
root: this.root,
|
|
15958
|
+
threshold: this.threshold,
|
|
15959
|
+
sensitivity: this.sensitivity,
|
|
15960
|
+
rootMargin: this.rootMargin
|
|
15961
|
+
});
|
|
15962
|
+
}
|
|
15963
|
+
}
|
|
15964
|
+
/**
|
|
15965
|
+
* Clear frozen flag without triggering flush.
|
|
15966
|
+
* Used after freeze+debounce checkout — buffer already cleared by unlock().
|
|
15967
|
+
*/
|
|
15968
|
+
unsetFrozen() {
|
|
15969
|
+
this.frozen = false;
|
|
15891
15970
|
}
|
|
15892
15971
|
reset() {
|
|
15893
15972
|
this.elements.clear();
|
|
@@ -15903,6 +15982,164 @@ class VisibilityManager {
|
|
|
15903
15982
|
}
|
|
15904
15983
|
}
|
|
15905
15984
|
}
|
|
15985
|
+
const DEFAULT_SETTLE_TIMEOUT = 150;
|
|
15986
|
+
const DEFAULT_MAX_WAIT = 5e3;
|
|
15987
|
+
const DEFAULT_DEBOUNCE = 100;
|
|
15988
|
+
class NavigationManager {
|
|
15989
|
+
constructor(options) {
|
|
15990
|
+
__publicField(this, "frozen", false);
|
|
15991
|
+
__publicField(this, "locked", false);
|
|
15992
|
+
__publicField(this, "disabled", false);
|
|
15993
|
+
__publicField(this, "settleTimeout");
|
|
15994
|
+
__publicField(this, "maxWait");
|
|
15995
|
+
__publicField(this, "debounceMs");
|
|
15996
|
+
__publicField(this, "settlingObserver", null);
|
|
15997
|
+
__publicField(this, "debounceTimer", null);
|
|
15998
|
+
__publicField(this, "settleCheckTimer", null);
|
|
15999
|
+
__publicField(this, "maxWaitTimer", null);
|
|
16000
|
+
__publicField(this, "lastMutationTime", 0);
|
|
16001
|
+
__publicField(this, "pendingNavigation", null);
|
|
16002
|
+
__publicField(this, "doc");
|
|
16003
|
+
__publicField(this, "onSnapshot");
|
|
16004
|
+
const { doc, config, onSnapshot } = options;
|
|
16005
|
+
this.doc = doc;
|
|
16006
|
+
this.onSnapshot = callbackWrapper(onSnapshot);
|
|
16007
|
+
this.settleTimeout = config.settleTimeout ?? DEFAULT_SETTLE_TIMEOUT;
|
|
16008
|
+
this.maxWait = config.maxWait ?? DEFAULT_MAX_WAIT;
|
|
16009
|
+
this.debounceMs = config.debounce ?? DEFAULT_DEBOUNCE;
|
|
16010
|
+
}
|
|
16011
|
+
handleNavigation(data) {
|
|
16012
|
+
if (this.disabled) return;
|
|
16013
|
+
if (this.locked) return;
|
|
16014
|
+
this.cancelTimers();
|
|
16015
|
+
this.disconnectSettlingObserver();
|
|
16016
|
+
this.pendingNavigation = data;
|
|
16017
|
+
if (this.frozen) {
|
|
16018
|
+
return;
|
|
16019
|
+
}
|
|
16020
|
+
this.startDebounce();
|
|
16021
|
+
}
|
|
16022
|
+
cancelPending() {
|
|
16023
|
+
this.cancelTimers();
|
|
16024
|
+
this.disconnectSettlingObserver();
|
|
16025
|
+
this.pendingNavigation = null;
|
|
16026
|
+
}
|
|
16027
|
+
freeze() {
|
|
16028
|
+
this.frozen = true;
|
|
16029
|
+
this.cancelTimers();
|
|
16030
|
+
this.disconnectSettlingObserver();
|
|
16031
|
+
}
|
|
16032
|
+
unfreeze() {
|
|
16033
|
+
this.frozen = false;
|
|
16034
|
+
if (this.pendingNavigation && !this.locked && !this.disabled) {
|
|
16035
|
+
this.startDebounce();
|
|
16036
|
+
}
|
|
16037
|
+
}
|
|
16038
|
+
lock() {
|
|
16039
|
+
this.locked = true;
|
|
16040
|
+
this.cancelTimers();
|
|
16041
|
+
this.disconnectSettlingObserver();
|
|
16042
|
+
}
|
|
16043
|
+
unlock() {
|
|
16044
|
+
this.locked = false;
|
|
16045
|
+
this.pendingNavigation = null;
|
|
16046
|
+
}
|
|
16047
|
+
unsetFrozen() {
|
|
16048
|
+
this.frozen = false;
|
|
16049
|
+
}
|
|
16050
|
+
reset() {
|
|
16051
|
+
this.cancelTimers();
|
|
16052
|
+
this.disconnectSettlingObserver();
|
|
16053
|
+
this.pendingNavigation = null;
|
|
16054
|
+
this.frozen = false;
|
|
16055
|
+
this.locked = false;
|
|
16056
|
+
}
|
|
16057
|
+
destroy() {
|
|
16058
|
+
this.reset();
|
|
16059
|
+
this.disabled = true;
|
|
16060
|
+
}
|
|
16061
|
+
startDebounce() {
|
|
16062
|
+
this.debounceTimer = setTimeout(() => {
|
|
16063
|
+
this.debounceTimer = null;
|
|
16064
|
+
this.startDOMSettling();
|
|
16065
|
+
}, this.debounceMs);
|
|
16066
|
+
}
|
|
16067
|
+
startDOMSettling() {
|
|
16068
|
+
if (this.frozen || this.locked || this.disabled) return;
|
|
16069
|
+
this.lastMutationTime = performance.now();
|
|
16070
|
+
const ObserverCtor = mutationObserverCtor();
|
|
16071
|
+
this.settlingObserver = new ObserverCtor(() => {
|
|
16072
|
+
this.lastMutationTime = performance.now();
|
|
16073
|
+
if (this.settleCheckTimer !== null) {
|
|
16074
|
+
clearTimeout(this.settleCheckTimer);
|
|
16075
|
+
}
|
|
16076
|
+
this.settleCheckTimer = setTimeout(
|
|
16077
|
+
() => this.checkSettled(),
|
|
16078
|
+
this.settleTimeout
|
|
16079
|
+
);
|
|
16080
|
+
});
|
|
16081
|
+
this.settlingObserver.observe(this.doc, {
|
|
16082
|
+
childList: true,
|
|
16083
|
+
subtree: true,
|
|
16084
|
+
attributes: true,
|
|
16085
|
+
characterData: true
|
|
16086
|
+
});
|
|
16087
|
+
this.settleCheckTimer = setTimeout(
|
|
16088
|
+
() => this.checkSettled(),
|
|
16089
|
+
this.settleTimeout
|
|
16090
|
+
);
|
|
16091
|
+
this.maxWaitTimer = setTimeout(() => {
|
|
16092
|
+
this.maxWaitTimer = null;
|
|
16093
|
+
this.completeSettling();
|
|
16094
|
+
}, this.maxWait);
|
|
16095
|
+
}
|
|
16096
|
+
checkSettled() {
|
|
16097
|
+
this.settleCheckTimer = null;
|
|
16098
|
+
const elapsed = performance.now() - this.lastMutationTime;
|
|
16099
|
+
if (elapsed >= this.settleTimeout) {
|
|
16100
|
+
this.completeSettling();
|
|
16101
|
+
} else {
|
|
16102
|
+
this.settleCheckTimer = setTimeout(
|
|
16103
|
+
() => this.checkSettled(),
|
|
16104
|
+
this.settleTimeout - elapsed
|
|
16105
|
+
);
|
|
16106
|
+
}
|
|
16107
|
+
}
|
|
16108
|
+
completeSettling() {
|
|
16109
|
+
if (this.frozen || this.locked || this.disabled) return;
|
|
16110
|
+
if (!this.pendingNavigation) return;
|
|
16111
|
+
this.cancelTimers();
|
|
16112
|
+
this.disconnectSettlingObserver();
|
|
16113
|
+
this.pendingNavigation = null;
|
|
16114
|
+
requestAnimationFrame(() => {
|
|
16115
|
+
requestAnimationFrame(() => {
|
|
16116
|
+
if (!this.frozen && !this.locked && !this.disabled) {
|
|
16117
|
+
this.onSnapshot(true);
|
|
16118
|
+
}
|
|
16119
|
+
});
|
|
16120
|
+
});
|
|
16121
|
+
}
|
|
16122
|
+
cancelTimers() {
|
|
16123
|
+
if (this.debounceTimer !== null) {
|
|
16124
|
+
clearTimeout(this.debounceTimer);
|
|
16125
|
+
this.debounceTimer = null;
|
|
16126
|
+
}
|
|
16127
|
+
if (this.settleCheckTimer !== null) {
|
|
16128
|
+
clearTimeout(this.settleCheckTimer);
|
|
16129
|
+
this.settleCheckTimer = null;
|
|
16130
|
+
}
|
|
16131
|
+
if (this.maxWaitTimer !== null) {
|
|
16132
|
+
clearTimeout(this.maxWaitTimer);
|
|
16133
|
+
this.maxWaitTimer = null;
|
|
16134
|
+
}
|
|
16135
|
+
}
|
|
16136
|
+
disconnectSettlingObserver() {
|
|
16137
|
+
if (this.settlingObserver) {
|
|
16138
|
+
this.settlingObserver.disconnect();
|
|
16139
|
+
this.settlingObserver = null;
|
|
16140
|
+
}
|
|
16141
|
+
}
|
|
16142
|
+
}
|
|
15906
16143
|
class StylesheetManager {
|
|
15907
16144
|
constructor(options) {
|
|
15908
16145
|
__publicField(this, "trackedLinkElements", /* @__PURE__ */ new WeakSet());
|
|
@@ -15986,43 +16223,13 @@ class ProcessedNodeManager {
|
|
|
15986
16223
|
destroy() {
|
|
15987
16224
|
}
|
|
15988
16225
|
}
|
|
15989
|
-
const version$1 = "3.
|
|
16226
|
+
const version$1 = "3.3.0-alpha.1";
|
|
15990
16227
|
let wrappedEmit;
|
|
15991
16228
|
let takeFullSnapshot$1;
|
|
15992
16229
|
let canvasManager;
|
|
15993
16230
|
let recording = false;
|
|
15994
16231
|
const customEventQueue = [];
|
|
15995
16232
|
let flushCustomEventQueue$1;
|
|
15996
|
-
function waitForDOMStabilization(win) {
|
|
15997
|
-
const maxWaitMs = 5e3;
|
|
15998
|
-
return new Promise((resolve2) => {
|
|
15999
|
-
const captureAfterPaint = () => {
|
|
16000
|
-
requestAnimationFrame(() => {
|
|
16001
|
-
requestAnimationFrame(() => {
|
|
16002
|
-
resolve2();
|
|
16003
|
-
});
|
|
16004
|
-
});
|
|
16005
|
-
};
|
|
16006
|
-
const safeResolve = /* @__PURE__ */ (() => {
|
|
16007
|
-
let called = false;
|
|
16008
|
-
return () => {
|
|
16009
|
-
if (!called) {
|
|
16010
|
-
called = true;
|
|
16011
|
-
captureAfterPaint();
|
|
16012
|
-
}
|
|
16013
|
-
};
|
|
16014
|
-
})();
|
|
16015
|
-
if (["interactive", "complete"].includes(win.document.readyState)) {
|
|
16016
|
-
safeResolve();
|
|
16017
|
-
} else {
|
|
16018
|
-
win.addEventListener("DOMContentLoaded", safeResolve, { once: true });
|
|
16019
|
-
win.addEventListener("load", safeResolve, { once: true });
|
|
16020
|
-
setTimeout(() => {
|
|
16021
|
-
safeResolve();
|
|
16022
|
-
}, maxWaitMs);
|
|
16023
|
-
}
|
|
16024
|
-
});
|
|
16025
|
-
}
|
|
16026
16233
|
try {
|
|
16027
16234
|
if (Array.from([1], (x2) => x2 * 2)[0] !== 2) {
|
|
16028
16235
|
const cleanFrame = document.createElement("iframe");
|
|
@@ -16040,6 +16247,7 @@ function record(options = {}) {
|
|
|
16040
16247
|
checkoutEveryNms,
|
|
16041
16248
|
checkoutEveryNth,
|
|
16042
16249
|
checkoutEveryNvm,
|
|
16250
|
+
checkoutDebounce,
|
|
16043
16251
|
blockClass = "rr-block",
|
|
16044
16252
|
blockSelector = null,
|
|
16045
16253
|
ignoreClass = "rr-ignore",
|
|
@@ -16134,6 +16342,10 @@ function record(options = {}) {
|
|
|
16134
16342
|
let lastFullSnapshotEvent;
|
|
16135
16343
|
let incrementalSnapshotCount = 0;
|
|
16136
16344
|
let visibilityMutationCount = 0;
|
|
16345
|
+
let checkoutId = 0;
|
|
16346
|
+
let checkoutPending = false;
|
|
16347
|
+
let checkoutDebounceTimer = null;
|
|
16348
|
+
let checkoutFreezeTimestamp = null;
|
|
16137
16349
|
const eventProcessor = (e2) => {
|
|
16138
16350
|
for (const plugin3 of plugins || []) {
|
|
16139
16351
|
if (plugin3.eventProcessor) {
|
|
@@ -16146,13 +16358,32 @@ function record(options = {}) {
|
|
|
16146
16358
|
}
|
|
16147
16359
|
return e2;
|
|
16148
16360
|
};
|
|
16361
|
+
const executeCheckout = () => {
|
|
16362
|
+
checkoutDebounceTimer = null;
|
|
16363
|
+
checkoutPending = false;
|
|
16364
|
+
checkoutFreezeTimestamp = null;
|
|
16365
|
+
navigationManager == null ? void 0 : navigationManager.cancelPending();
|
|
16366
|
+
takeFullSnapshot$1(true);
|
|
16367
|
+
mutationBuffers.forEach((buf) => {
|
|
16368
|
+
buf.resetBuffers();
|
|
16369
|
+
buf.unsetFrozen();
|
|
16370
|
+
});
|
|
16371
|
+
if (visibilityManager) {
|
|
16372
|
+
visibilityManager.unsetFrozen();
|
|
16373
|
+
}
|
|
16374
|
+
if (navigationManager) {
|
|
16375
|
+
navigationManager.unsetFrozen();
|
|
16376
|
+
}
|
|
16377
|
+
};
|
|
16149
16378
|
wrappedEmit = (r2, isCheckout) => {
|
|
16150
16379
|
var _a2;
|
|
16151
16380
|
const e2 = r2;
|
|
16152
16381
|
e2.timestamp = nowTimestamp();
|
|
16153
|
-
|
|
16382
|
+
e2.checkoutId = checkoutId;
|
|
16383
|
+
if (((_a2 = mutationBuffers[0]) == null ? void 0 : _a2.isFrozen()) && !checkoutPending && e2.type !== EventType.FullSnapshot && !(e2.type === EventType.IncrementalSnapshot && e2.data.source === IncrementalSource.Mutation)) {
|
|
16154
16384
|
mutationBuffers.forEach((buf) => buf.unfreeze());
|
|
16155
16385
|
visibilityManager == null ? void 0 : visibilityManager.unfreeze();
|
|
16386
|
+
navigationManager == null ? void 0 : navigationManager.unfreeze();
|
|
16156
16387
|
}
|
|
16157
16388
|
if (inEmittingFrame) {
|
|
16158
16389
|
emit == null ? void 0 : emit(eventProcessor(e2), isCheckout);
|
|
@@ -16177,7 +16408,29 @@ function record(options = {}) {
|
|
|
16177
16408
|
const exceedCount = checkoutEveryNth && incrementalSnapshotCount >= checkoutEveryNth;
|
|
16178
16409
|
const exceedTime = checkoutEveryNms && e2.timestamp - lastFullSnapshotEvent.timestamp > checkoutEveryNms;
|
|
16179
16410
|
if (exceedCount || exceedTime) {
|
|
16180
|
-
|
|
16411
|
+
if (checkoutDebounce) {
|
|
16412
|
+
if (!checkoutPending) {
|
|
16413
|
+
checkoutPending = true;
|
|
16414
|
+
checkoutFreezeTimestamp = nowTimestamp();
|
|
16415
|
+
mutationBuffers.forEach((buf) => buf.freeze());
|
|
16416
|
+
visibilityManager == null ? void 0 : visibilityManager.freeze();
|
|
16417
|
+
}
|
|
16418
|
+
if (checkoutDebounceTimer) {
|
|
16419
|
+
clearTimeout(checkoutDebounceTimer);
|
|
16420
|
+
}
|
|
16421
|
+
const frozenDuration = nowTimestamp() - checkoutFreezeTimestamp;
|
|
16422
|
+
const maxFreeze = checkoutDebounce * 3;
|
|
16423
|
+
if (frozenDuration >= maxFreeze) {
|
|
16424
|
+
executeCheckout();
|
|
16425
|
+
} else {
|
|
16426
|
+
checkoutDebounceTimer = setTimeout(
|
|
16427
|
+
() => executeCheckout(),
|
|
16428
|
+
checkoutDebounce
|
|
16429
|
+
);
|
|
16430
|
+
}
|
|
16431
|
+
} else {
|
|
16432
|
+
takeFullSnapshot$1(true);
|
|
16433
|
+
}
|
|
16181
16434
|
}
|
|
16182
16435
|
}
|
|
16183
16436
|
}
|
|
@@ -16292,8 +16545,30 @@ function record(options = {}) {
|
|
|
16292
16545
|
notifyActivity: checkoutEveryNvm != null ? (count) => {
|
|
16293
16546
|
visibilityMutationCount += count;
|
|
16294
16547
|
if (visibilityMutationCount >= checkoutEveryNvm) {
|
|
16295
|
-
takeFullSnapshot$1(true);
|
|
16296
16548
|
visibilityMutationCount = 0;
|
|
16549
|
+
if (checkoutDebounce) {
|
|
16550
|
+
if (!checkoutPending) {
|
|
16551
|
+
checkoutPending = true;
|
|
16552
|
+
checkoutFreezeTimestamp = nowTimestamp();
|
|
16553
|
+
mutationBuffers.forEach((buf) => buf.freeze());
|
|
16554
|
+
visibilityManager == null ? void 0 : visibilityManager.freeze();
|
|
16555
|
+
}
|
|
16556
|
+
if (checkoutDebounceTimer) {
|
|
16557
|
+
clearTimeout(checkoutDebounceTimer);
|
|
16558
|
+
}
|
|
16559
|
+
const frozenDuration = nowTimestamp() - checkoutFreezeTimestamp;
|
|
16560
|
+
const maxFreeze = checkoutDebounce * 3;
|
|
16561
|
+
if (frozenDuration >= maxFreeze) {
|
|
16562
|
+
executeCheckout();
|
|
16563
|
+
} else {
|
|
16564
|
+
checkoutDebounceTimer = setTimeout(
|
|
16565
|
+
() => executeCheckout(),
|
|
16566
|
+
checkoutDebounce
|
|
16567
|
+
);
|
|
16568
|
+
}
|
|
16569
|
+
} else {
|
|
16570
|
+
takeFullSnapshot$1(true);
|
|
16571
|
+
}
|
|
16297
16572
|
}
|
|
16298
16573
|
} : void 0
|
|
16299
16574
|
});
|
|
@@ -16302,6 +16577,7 @@ function record(options = {}) {
|
|
|
16302
16577
|
if (!recordDOM) {
|
|
16303
16578
|
return;
|
|
16304
16579
|
}
|
|
16580
|
+
checkoutId++;
|
|
16305
16581
|
wrappedEmit(
|
|
16306
16582
|
{
|
|
16307
16583
|
type: EventType.Meta,
|
|
@@ -16317,6 +16593,7 @@ function record(options = {}) {
|
|
|
16317
16593
|
shadowDomManager.init();
|
|
16318
16594
|
mutationBuffers.forEach((buf) => buf.lock());
|
|
16319
16595
|
visibilityManager == null ? void 0 : visibilityManager.lock();
|
|
16596
|
+
navigationManager == null ? void 0 : navigationManager.lock();
|
|
16320
16597
|
const node2 = snapshot(document, {
|
|
16321
16598
|
mirror,
|
|
16322
16599
|
blockClass,
|
|
@@ -16368,6 +16645,7 @@ function record(options = {}) {
|
|
|
16368
16645
|
);
|
|
16369
16646
|
mutationBuffers.forEach((buf) => buf.unlock());
|
|
16370
16647
|
visibilityManager == null ? void 0 : visibilityManager.unlock();
|
|
16648
|
+
navigationManager == null ? void 0 : navigationManager.unlock();
|
|
16371
16649
|
if (document.adoptedStyleSheets && document.adoptedStyleSheets.length > 0)
|
|
16372
16650
|
stylesheetManager.adoptStyleSheets(
|
|
16373
16651
|
document.adoptedStyleSheets,
|
|
@@ -16380,6 +16658,31 @@ function record(options = {}) {
|
|
|
16380
16658
|
}
|
|
16381
16659
|
customEventQueue.length = 0;
|
|
16382
16660
|
};
|
|
16661
|
+
let navigationManager;
|
|
16662
|
+
const navigationSampling = sampling.navigation;
|
|
16663
|
+
if (navigationSampling !== false) {
|
|
16664
|
+
const navConfig = typeof navigationSampling === "object" ? navigationSampling : {};
|
|
16665
|
+
navigationManager = new NavigationManager({
|
|
16666
|
+
doc: document,
|
|
16667
|
+
config: navConfig,
|
|
16668
|
+
onSnapshot: (isCheckout) => {
|
|
16669
|
+
if (checkoutPending) {
|
|
16670
|
+
if (checkoutDebounceTimer) {
|
|
16671
|
+
clearTimeout(checkoutDebounceTimer);
|
|
16672
|
+
checkoutDebounceTimer = null;
|
|
16673
|
+
}
|
|
16674
|
+
checkoutPending = false;
|
|
16675
|
+
checkoutFreezeTimestamp = null;
|
|
16676
|
+
mutationBuffers.forEach((buf) => {
|
|
16677
|
+
buf.resetBuffers();
|
|
16678
|
+
buf.unsetFrozen();
|
|
16679
|
+
});
|
|
16680
|
+
visibilityManager == null ? void 0 : visibilityManager.unsetFrozen();
|
|
16681
|
+
}
|
|
16682
|
+
takeFullSnapshot$1(isCheckout);
|
|
16683
|
+
}
|
|
16684
|
+
});
|
|
16685
|
+
}
|
|
16383
16686
|
try {
|
|
16384
16687
|
const handlers = [];
|
|
16385
16688
|
const observe = (doc) => {
|
|
@@ -16410,14 +16713,11 @@ function record(options = {}) {
|
|
|
16410
16713
|
}
|
|
16411
16714
|
}),
|
|
16412
16715
|
navigationCb: (navData) => {
|
|
16413
|
-
|
|
16414
|
-
|
|
16415
|
-
|
|
16416
|
-
|
|
16417
|
-
|
|
16418
|
-
navData.href
|
|
16419
|
-
);
|
|
16420
|
-
takeFullSnapshot$1(true);
|
|
16716
|
+
if (navigationManager) {
|
|
16717
|
+
navigationManager.handleNavigation(navData);
|
|
16718
|
+
} else {
|
|
16719
|
+
takeFullSnapshot$1(true);
|
|
16720
|
+
}
|
|
16421
16721
|
},
|
|
16422
16722
|
inputCb: (v2) => wrappedEmit({
|
|
16423
16723
|
type: EventType.IncrementalSnapshot,
|
|
@@ -16536,23 +16836,6 @@ function record(options = {}) {
|
|
|
16536
16836
|
flushCustomEventQueue$1();
|
|
16537
16837
|
}
|
|
16538
16838
|
};
|
|
16539
|
-
const runInit = async () => {
|
|
16540
|
-
if (flushCustomEvent === "before") {
|
|
16541
|
-
flushCustomEventQueue$1();
|
|
16542
|
-
}
|
|
16543
|
-
if (recordAfter === "DOMContentStabilized") {
|
|
16544
|
-
console.debug(`[${nowTimestamp()}] [rrweb:record] 🟢 Waiting for DOM stabilization...`);
|
|
16545
|
-
await waitForDOMStabilization(window);
|
|
16546
|
-
console.debug(`[${nowTimestamp()}] [rrweb:record] ✅ DOM stabilized, starting recording`);
|
|
16547
|
-
}
|
|
16548
|
-
console.debug(`[${nowTimestamp()}] [rrweb:record] ✅ Init dom and takeFullSnapshot `);
|
|
16549
|
-
takeFullSnapshot$1();
|
|
16550
|
-
handlers.push(observe(document));
|
|
16551
|
-
recording = true;
|
|
16552
|
-
if (flushCustomEvent === "after") {
|
|
16553
|
-
flushCustomEventQueue$1();
|
|
16554
|
-
}
|
|
16555
|
-
};
|
|
16556
16839
|
if (document.readyState === "interactive" || document.readyState === "complete") {
|
|
16557
16840
|
init();
|
|
16558
16841
|
} else {
|
|
@@ -16580,8 +16863,13 @@ function record(options = {}) {
|
|
|
16580
16863
|
);
|
|
16581
16864
|
}
|
|
16582
16865
|
return () => {
|
|
16866
|
+
if (checkoutDebounceTimer) {
|
|
16867
|
+
clearTimeout(checkoutDebounceTimer);
|
|
16868
|
+
checkoutDebounceTimer = null;
|
|
16869
|
+
}
|
|
16583
16870
|
flushCustomEventQueue$1();
|
|
16584
16871
|
handlers.forEach((h) => h());
|
|
16872
|
+
navigationManager == null ? void 0 : navigationManager.destroy();
|
|
16585
16873
|
processedNodeManager.destroy();
|
|
16586
16874
|
recording = false;
|
|
16587
16875
|
unregisterErrorHandler();
|