@screeb/rrweb 1.0.6 → 1.0.7
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/assets/image-bitmap-data-url-worker-IJpC7g_b.js.map +1 -1
- package/dist/rrweb.cjs +81 -66
- package/dist/rrweb.cjs.map +1 -1
- package/dist/rrweb.d.cts +2 -2
- package/dist/rrweb.d.ts +2 -2
- package/dist/rrweb.js +81 -66
- package/dist/rrweb.js.map +1 -1
- package/dist/rrweb.umd.cjs +81 -66
- package/dist/rrweb.umd.cjs.map +3 -3
- package/dist/rrweb.umd.min.cjs +24 -24
- package/dist/rrweb.umd.min.cjs.map +3 -3
- package/package.json +5 -5
package/dist/rrweb.umd.cjs
CHANGED
|
@@ -51,7 +51,7 @@ Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
|
51
51
|
var __defProp$1 = Object.defineProperty;
|
|
52
52
|
var __defNormalProp$1 = (obj, key, value) => key in obj ? __defProp$1(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
|
|
53
53
|
var __publicField$1 = (obj, key, value) => __defNormalProp$1(obj, typeof key !== "symbol" ? key + "" : key, value);
|
|
54
|
-
var NodeType$
|
|
54
|
+
var NodeType$3 = /* @__PURE__ */ ((NodeType2) => {
|
|
55
55
|
NodeType2[NodeType2["Document"] = 0] = "Document";
|
|
56
56
|
NodeType2[NodeType2["DocumentType"] = 1] = "DocumentType";
|
|
57
57
|
NodeType2[NodeType2["Element"] = 2] = "Element";
|
|
@@ -59,7 +59,7 @@ var NodeType$2 = /* @__PURE__ */ ((NodeType2) => {
|
|
|
59
59
|
NodeType2[NodeType2["CDATA"] = 4] = "CDATA";
|
|
60
60
|
NodeType2[NodeType2["Comment"] = 5] = "Comment";
|
|
61
61
|
return NodeType2;
|
|
62
|
-
})(NodeType$
|
|
62
|
+
})(NodeType$3 || {});
|
|
63
63
|
const testableAccessors$1 = {
|
|
64
64
|
Node: ["childNodes", "parentNode", "parentElement", "textContent"],
|
|
65
65
|
ShadowRoot: ["host", "styleSheets"],
|
|
@@ -73,6 +73,9 @@ const testableMethods$1 = {
|
|
|
73
73
|
MutationObserver: ["constructor"]
|
|
74
74
|
};
|
|
75
75
|
const untaintedBasePrototype$1 = {};
|
|
76
|
+
const isAngularZonePresent$1 = () => {
|
|
77
|
+
return !!globalThis.Zone;
|
|
78
|
+
};
|
|
76
79
|
function getUntaintedPrototype$1(key) {
|
|
77
80
|
if (untaintedBasePrototype$1[key])
|
|
78
81
|
return untaintedBasePrototype$1[key];
|
|
@@ -100,7 +103,7 @@ function getUntaintedPrototype$1(key) {
|
|
|
100
103
|
}
|
|
101
104
|
)
|
|
102
105
|
);
|
|
103
|
-
if (isUntaintedAccessors && isUntaintedMethods) {
|
|
106
|
+
if (isUntaintedAccessors && isUntaintedMethods && !isAngularZonePresent$1()) {
|
|
104
107
|
untaintedBasePrototype$1[key] = defaultObj.prototype;
|
|
105
108
|
return defaultObj.prototype;
|
|
106
109
|
}
|
|
@@ -402,13 +405,13 @@ function is2DCanvasBlank(canvas) {
|
|
|
402
405
|
}
|
|
403
406
|
function isNodeMetaEqual(a2, b) {
|
|
404
407
|
if (!a2 || !b || a2.type !== b.type) return false;
|
|
405
|
-
if (a2.type === NodeType$
|
|
408
|
+
if (a2.type === NodeType$3.Document)
|
|
406
409
|
return a2.compatMode === b.compatMode;
|
|
407
|
-
else if (a2.type === NodeType$
|
|
410
|
+
else if (a2.type === NodeType$3.DocumentType)
|
|
408
411
|
return a2.name === b.name && a2.publicId === b.publicId && a2.systemId === b.systemId;
|
|
409
|
-
else if (a2.type === NodeType$
|
|
412
|
+
else if (a2.type === NodeType$3.Comment || a2.type === NodeType$3.Text || a2.type === NodeType$3.CDATA)
|
|
410
413
|
return a2.textContent === b.textContent;
|
|
411
|
-
else if (a2.type === NodeType$
|
|
414
|
+
else if (a2.type === NodeType$3.Element)
|
|
412
415
|
return a2.tagName === b.tagName && JSON.stringify(a2.attributes) === JSON.stringify(b.attributes) && a2.isSVG === b.isSVG && a2.needBlock === b.needBlock;
|
|
413
416
|
return false;
|
|
414
417
|
}
|
|
@@ -794,20 +797,20 @@ function serializeNode(n2, options) {
|
|
|
794
797
|
case n2.DOCUMENT_NODE:
|
|
795
798
|
if (n2.compatMode !== "CSS1Compat") {
|
|
796
799
|
return {
|
|
797
|
-
type: NodeType$
|
|
800
|
+
type: NodeType$3.Document,
|
|
798
801
|
childNodes: [],
|
|
799
802
|
compatMode: n2.compatMode
|
|
800
803
|
// probably "BackCompat"
|
|
801
804
|
};
|
|
802
805
|
} else {
|
|
803
806
|
return {
|
|
804
|
-
type: NodeType$
|
|
807
|
+
type: NodeType$3.Document,
|
|
805
808
|
childNodes: []
|
|
806
809
|
};
|
|
807
810
|
}
|
|
808
811
|
case n2.DOCUMENT_TYPE_NODE:
|
|
809
812
|
return {
|
|
810
|
-
type: NodeType$
|
|
813
|
+
type: NodeType$3.DocumentType,
|
|
811
814
|
name: n2.name,
|
|
812
815
|
publicId: n2.publicId,
|
|
813
816
|
systemId: n2.systemId,
|
|
@@ -838,13 +841,13 @@ function serializeNode(n2, options) {
|
|
|
838
841
|
});
|
|
839
842
|
case n2.CDATA_SECTION_NODE:
|
|
840
843
|
return {
|
|
841
|
-
type: NodeType$
|
|
844
|
+
type: NodeType$3.CDATA,
|
|
842
845
|
textContent: "",
|
|
843
846
|
rootId
|
|
844
847
|
};
|
|
845
848
|
case n2.COMMENT_NODE:
|
|
846
849
|
return {
|
|
847
|
-
type: NodeType$
|
|
850
|
+
type: NodeType$3.Comment,
|
|
848
851
|
textContent: index$1.textContent(n2) || "",
|
|
849
852
|
rootId
|
|
850
853
|
};
|
|
@@ -876,7 +879,7 @@ function serializeTextNode(n2, options) {
|
|
|
876
879
|
textContent2 = maskTextFn ? maskTextFn(textContent2, index$1.parentElement(n2)) : textContent2.replace(/[\S]/g, "*");
|
|
877
880
|
}
|
|
878
881
|
return {
|
|
879
|
-
type: NodeType$
|
|
882
|
+
type: NodeType$3.Text,
|
|
880
883
|
textContent: textContent2 || "",
|
|
881
884
|
rootId
|
|
882
885
|
};
|
|
@@ -1062,7 +1065,7 @@ function serializeElementNode(n2, options) {
|
|
|
1062
1065
|
} catch (e2) {
|
|
1063
1066
|
}
|
|
1064
1067
|
return {
|
|
1065
|
-
type: NodeType$
|
|
1068
|
+
type: NodeType$3.Element,
|
|
1066
1069
|
tagName,
|
|
1067
1070
|
attributes,
|
|
1068
1071
|
childNodes: [],
|
|
@@ -1080,9 +1083,9 @@ function lowerIfExists(maybeAttr) {
|
|
|
1080
1083
|
}
|
|
1081
1084
|
}
|
|
1082
1085
|
function slimDOMExcluded(sn, slimDOMOptions) {
|
|
1083
|
-
if (slimDOMOptions.comment && sn.type === NodeType$
|
|
1086
|
+
if (slimDOMOptions.comment && sn.type === NodeType$3.Comment) {
|
|
1084
1087
|
return true;
|
|
1085
|
-
} else if (sn.type === NodeType$
|
|
1088
|
+
} else if (sn.type === NodeType$3.Element) {
|
|
1086
1089
|
if (slimDOMOptions.script && // script tag
|
|
1087
1090
|
(sn.tagName === "script" || // (module)preload link
|
|
1088
1091
|
sn.tagName === "link" && (sn.attributes.rel === "preload" || sn.attributes.rel === "modulepreload") && sn.attributes.as === "script" || // prefetch link
|
|
@@ -1172,7 +1175,7 @@ function serializeNodeWithId(n2, options) {
|
|
|
1172
1175
|
let id;
|
|
1173
1176
|
if (mirror2.hasNode(n2)) {
|
|
1174
1177
|
id = mirror2.getId(n2);
|
|
1175
|
-
} else if (slimDOMExcluded(_serializedNode, slimDOMOptions) || !preserveWhiteSpace && _serializedNode.type === NodeType$
|
|
1178
|
+
} else if (slimDOMExcluded(_serializedNode, slimDOMOptions) || !preserveWhiteSpace && _serializedNode.type === NodeType$3.Text && !_serializedNode.textContent.replace(/^\s+|\s+$/gm, "").length) {
|
|
1176
1179
|
id = IGNORED_NODE;
|
|
1177
1180
|
} else {
|
|
1178
1181
|
id = genId();
|
|
@@ -1186,15 +1189,15 @@ function serializeNodeWithId(n2, options) {
|
|
|
1186
1189
|
onSerialize(n2);
|
|
1187
1190
|
}
|
|
1188
1191
|
let recordChild = !skipChild;
|
|
1189
|
-
if (serializedNode.type === NodeType$
|
|
1192
|
+
if (serializedNode.type === NodeType$3.Element) {
|
|
1190
1193
|
recordChild = recordChild && !serializedNode.needBlock;
|
|
1191
1194
|
delete serializedNode.needBlock;
|
|
1192
1195
|
const shadowRootEl = index$1.shadowRoot(n2);
|
|
1193
1196
|
if (shadowRootEl && isNativeShadowDom(shadowRootEl))
|
|
1194
1197
|
serializedNode.isShadowHost = true;
|
|
1195
1198
|
}
|
|
1196
|
-
if ((serializedNode.type === NodeType$
|
|
1197
|
-
if (slimDOMOptions.headWhitespace && serializedNode.type === NodeType$
|
|
1199
|
+
if ((serializedNode.type === NodeType$3.Document || serializedNode.type === NodeType$3.Element) && recordChild) {
|
|
1200
|
+
if (slimDOMOptions.headWhitespace && serializedNode.type === NodeType$3.Element && serializedNode.tagName === "head") {
|
|
1198
1201
|
preserveWhiteSpace = false;
|
|
1199
1202
|
}
|
|
1200
1203
|
const bypassOptions = {
|
|
@@ -1223,9 +1226,9 @@ function serializeNodeWithId(n2, options) {
|
|
|
1223
1226
|
keepIframeSrcFn,
|
|
1224
1227
|
cssCaptured: false
|
|
1225
1228
|
};
|
|
1226
|
-
if (serializedNode.type === NodeType$
|
|
1229
|
+
if (serializedNode.type === NodeType$3.Element && serializedNode.tagName === "textarea" && serializedNode.attributes.value !== void 0) ;
|
|
1227
1230
|
else {
|
|
1228
|
-
if (serializedNode.type === NodeType$
|
|
1231
|
+
if (serializedNode.type === NodeType$3.Element && serializedNode.attributes._cssText !== void 0 && typeof serializedNode.attributes._cssText === "string") {
|
|
1229
1232
|
bypassOptions.cssCaptured = true;
|
|
1230
1233
|
}
|
|
1231
1234
|
for (const childN of Array.from(index$1.childNodes(n2))) {
|
|
@@ -1250,7 +1253,7 @@ function serializeNodeWithId(n2, options) {
|
|
|
1250
1253
|
if (parent && isShadowRoot(parent) && isNativeShadowDom(parent)) {
|
|
1251
1254
|
serializedNode.isShadow = true;
|
|
1252
1255
|
}
|
|
1253
|
-
if (serializedNode.type === NodeType$
|
|
1256
|
+
if (serializedNode.type === NodeType$3.Element && serializedNode.tagName === "iframe") {
|
|
1254
1257
|
onceIframeLoaded(
|
|
1255
1258
|
n2,
|
|
1256
1259
|
() => {
|
|
@@ -1292,7 +1295,7 @@ function serializeNodeWithId(n2, options) {
|
|
|
1292
1295
|
iframeLoadTimeout
|
|
1293
1296
|
);
|
|
1294
1297
|
}
|
|
1295
|
-
if (serializedNode.type === NodeType$
|
|
1298
|
+
if (serializedNode.type === NodeType$3.Element && serializedNode.tagName === "link" && typeof serializedNode.attributes.rel === "string" && (serializedNode.attributes.rel === "stylesheet" || serializedNode.attributes.rel === "preload" && typeof serializedNode.attributes.href === "string" && extractFileExtension(serializedNode.attributes.href) === "css")) {
|
|
1296
1299
|
onceStylesheetLoaded(
|
|
1297
1300
|
n2,
|
|
1298
1301
|
() => {
|
|
@@ -5074,7 +5077,7 @@ function createCache() {
|
|
|
5074
5077
|
function applyCssSplits(n2, cssText, hackCss, cache) {
|
|
5075
5078
|
const childTextNodes = [];
|
|
5076
5079
|
for (const scn of n2.childNodes) {
|
|
5077
|
-
if (scn.type === NodeType$
|
|
5080
|
+
if (scn.type === NodeType$3.Text) {
|
|
5078
5081
|
childTextNodes.push(scn);
|
|
5079
5082
|
}
|
|
5080
5083
|
}
|
|
@@ -5105,15 +5108,15 @@ function buildNode(n2, options) {
|
|
|
5105
5108
|
var _a2;
|
|
5106
5109
|
const { doc, hackCss, cache } = options;
|
|
5107
5110
|
switch (n2.type) {
|
|
5108
|
-
case NodeType$
|
|
5111
|
+
case NodeType$3.Document:
|
|
5109
5112
|
return doc.implementation.createDocument(null, "", null);
|
|
5110
|
-
case NodeType$
|
|
5113
|
+
case NodeType$3.DocumentType:
|
|
5111
5114
|
return doc.implementation.createDocumentType(
|
|
5112
5115
|
n2.name || "html",
|
|
5113
5116
|
n2.publicId,
|
|
5114
5117
|
n2.systemId
|
|
5115
5118
|
);
|
|
5116
|
-
case NodeType$
|
|
5119
|
+
case NodeType$3.Element: {
|
|
5117
5120
|
const tagName = getTagName(n2);
|
|
5118
5121
|
let node2;
|
|
5119
5122
|
if (n2.isSVG) {
|
|
@@ -5247,14 +5250,14 @@ function buildNode(n2, options) {
|
|
|
5247
5250
|
}
|
|
5248
5251
|
return node2;
|
|
5249
5252
|
}
|
|
5250
|
-
case NodeType$
|
|
5253
|
+
case NodeType$3.Text:
|
|
5251
5254
|
if (n2.isStyle && hackCss) {
|
|
5252
5255
|
return doc.createTextNode(adaptCssForReplay(n2.textContent, cache));
|
|
5253
5256
|
}
|
|
5254
5257
|
return doc.createTextNode(n2.textContent);
|
|
5255
|
-
case NodeType$
|
|
5258
|
+
case NodeType$3.CDATA:
|
|
5256
5259
|
return doc.createCDATASection(n2.textContent);
|
|
5257
|
-
case NodeType$
|
|
5260
|
+
case NodeType$3.Comment:
|
|
5258
5261
|
return doc.createComment(n2.textContent);
|
|
5259
5262
|
default:
|
|
5260
5263
|
return null;
|
|
@@ -5281,11 +5284,11 @@ function buildNodeWithSN(n2, options) {
|
|
|
5281
5284
|
if (n2.rootId && mirror2.getNode(n2.rootId) !== doc) {
|
|
5282
5285
|
mirror2.replace(n2.rootId, doc);
|
|
5283
5286
|
}
|
|
5284
|
-
if (n2.type === NodeType$
|
|
5287
|
+
if (n2.type === NodeType$3.Document) {
|
|
5285
5288
|
doc.close();
|
|
5286
5289
|
doc.open();
|
|
5287
|
-
if (n2.compatMode === "BackCompat" && n2.childNodes && n2.childNodes[0].type !== NodeType$
|
|
5288
|
-
if (n2.childNodes[0].type === NodeType$
|
|
5290
|
+
if (n2.compatMode === "BackCompat" && n2.childNodes && n2.childNodes[0].type !== NodeType$3.DocumentType) {
|
|
5291
|
+
if (n2.childNodes[0].type === NodeType$3.Element && "xmlns" in n2.childNodes[0].attributes && n2.childNodes[0].attributes.xmlns === "http://www.w3.org/1999/xhtml") {
|
|
5289
5292
|
doc.write(
|
|
5290
5293
|
'<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "">'
|
|
5291
5294
|
);
|
|
@@ -5298,7 +5301,7 @@ function buildNodeWithSN(n2, options) {
|
|
|
5298
5301
|
node2 = doc;
|
|
5299
5302
|
}
|
|
5300
5303
|
mirror2.add(node2, n2);
|
|
5301
|
-
if ((n2.type === NodeType$
|
|
5304
|
+
if ((n2.type === NodeType$3.Document || n2.type === NodeType$3.Element) && !skipChild) {
|
|
5302
5305
|
for (const childN of n2.childNodes) {
|
|
5303
5306
|
const childNode = buildNodeWithSN(childN, {
|
|
5304
5307
|
doc,
|
|
@@ -5314,7 +5317,7 @@ function buildNodeWithSN(n2, options) {
|
|
|
5314
5317
|
}
|
|
5315
5318
|
if (childN.isShadow && isElement(node2) && node2.shadowRoot) {
|
|
5316
5319
|
node2.shadowRoot.appendChild(childNode);
|
|
5317
|
-
} else if (n2.type === NodeType$
|
|
5320
|
+
} else if (n2.type === NodeType$3.Document && childN.type == NodeType$3.Element) {
|
|
5318
5321
|
const htmlElement = childNode;
|
|
5319
5322
|
let body = null;
|
|
5320
5323
|
htmlElement.childNodes.forEach((child) => {
|
|
@@ -5349,7 +5352,7 @@ function visit(mirror2, onVisit) {
|
|
|
5349
5352
|
}
|
|
5350
5353
|
function handleScroll(node2, mirror2) {
|
|
5351
5354
|
const n2 = mirror2.getMeta(node2);
|
|
5352
|
-
if ((n2 == null ? void 0 : n2.type) !== NodeType$
|
|
5355
|
+
if ((n2 == null ? void 0 : n2.type) !== NodeType$3.Element) {
|
|
5353
5356
|
return;
|
|
5354
5357
|
}
|
|
5355
5358
|
const el = node2;
|
|
@@ -5397,15 +5400,6 @@ var __publicField2 = (obj, key, value) => __defNormalProp22(obj, typeof key !==
|
|
|
5397
5400
|
var __defProp222 = Object.defineProperty;
|
|
5398
5401
|
var __defNormalProp222 = (obj, key, value) => key in obj ? __defProp222(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
|
|
5399
5402
|
var __publicField22 = (obj, key, value) => __defNormalProp222(obj, typeof key !== "symbol" ? key + "" : key, value);
|
|
5400
|
-
var NodeType$1 = /* @__PURE__ */ ((NodeType2) => {
|
|
5401
|
-
NodeType2[NodeType2["Document"] = 0] = "Document";
|
|
5402
|
-
NodeType2[NodeType2["DocumentType"] = 1] = "DocumentType";
|
|
5403
|
-
NodeType2[NodeType2["Element"] = 2] = "Element";
|
|
5404
|
-
NodeType2[NodeType2["Text"] = 3] = "Text";
|
|
5405
|
-
NodeType2[NodeType2["CDATA"] = 4] = "CDATA";
|
|
5406
|
-
NodeType2[NodeType2["Comment"] = 5] = "Comment";
|
|
5407
|
-
return NodeType2;
|
|
5408
|
-
})(NodeType$1 || {});
|
|
5409
5403
|
let Mirror$1 = class Mirror2 {
|
|
5410
5404
|
constructor() {
|
|
5411
5405
|
__publicField22(this, "idNodeMap", /* @__PURE__ */ new Map());
|
|
@@ -9017,6 +9011,15 @@ postcss$1.Input;
|
|
|
9017
9011
|
postcss$1.Rule;
|
|
9018
9012
|
postcss$1.Root;
|
|
9019
9013
|
postcss$1.Node;
|
|
9014
|
+
var NodeType$1 = /* @__PURE__ */ ((NodeType2) => {
|
|
9015
|
+
NodeType2[NodeType2["Document"] = 0] = "Document";
|
|
9016
|
+
NodeType2[NodeType2["DocumentType"] = 1] = "DocumentType";
|
|
9017
|
+
NodeType2[NodeType2["Element"] = 2] = "Element";
|
|
9018
|
+
NodeType2[NodeType2["Text"] = 3] = "Text";
|
|
9019
|
+
NodeType2[NodeType2["CDATA"] = 4] = "CDATA";
|
|
9020
|
+
NodeType2[NodeType2["Comment"] = 5] = "Comment";
|
|
9021
|
+
return NodeType2;
|
|
9022
|
+
})(NodeType$1 || {});
|
|
9020
9023
|
function parseCSSText(cssText) {
|
|
9021
9024
|
const res = {};
|
|
9022
9025
|
const listDelimiter = /;(?![^(]*\))/g;
|
|
@@ -9526,7 +9529,7 @@ function removeChild(parent, child) {
|
|
|
9526
9529
|
child.parentNode = null;
|
|
9527
9530
|
return child;
|
|
9528
9531
|
}
|
|
9529
|
-
var NodeType = /* @__PURE__ */ ((NodeType2) => {
|
|
9532
|
+
var NodeType$2 = /* @__PURE__ */ ((NodeType2) => {
|
|
9530
9533
|
NodeType2[NodeType2["PLACEHOLDER"] = 0] = "PLACEHOLDER";
|
|
9531
9534
|
NodeType2[NodeType2["ELEMENT_NODE"] = 1] = "ELEMENT_NODE";
|
|
9532
9535
|
NodeType2[NodeType2["ATTRIBUTE_NODE"] = 2] = "ATTRIBUTE_NODE";
|
|
@@ -9540,7 +9543,7 @@ var NodeType = /* @__PURE__ */ ((NodeType2) => {
|
|
|
9540
9543
|
NodeType2[NodeType2["DOCUMENT_TYPE_NODE"] = 10] = "DOCUMENT_TYPE_NODE";
|
|
9541
9544
|
NodeType2[NodeType2["DOCUMENT_FRAGMENT_NODE"] = 11] = "DOCUMENT_FRAGMENT_NODE";
|
|
9542
9545
|
return NodeType2;
|
|
9543
|
-
})(NodeType || {});
|
|
9546
|
+
})(NodeType$2 || {});
|
|
9544
9547
|
const NAMESPACES = {
|
|
9545
9548
|
svg: "http://www.w3.org/2000/svg",
|
|
9546
9549
|
"xlink:href": "http://www.w3.org/1999/xlink",
|
|
@@ -10099,7 +10102,7 @@ function getValidTagName(element) {
|
|
|
10099
10102
|
function buildFromNode(node2, rrdom, domMirror, parentRRNode) {
|
|
10100
10103
|
let rrNode;
|
|
10101
10104
|
switch (node2.nodeType) {
|
|
10102
|
-
case NodeType.DOCUMENT_NODE:
|
|
10105
|
+
case NodeType$2.DOCUMENT_NODE:
|
|
10103
10106
|
if (parentRRNode && parentRRNode.nodeName === "IFRAME")
|
|
10104
10107
|
rrNode = parentRRNode.contentDocument;
|
|
10105
10108
|
else {
|
|
@@ -10107,7 +10110,7 @@ function buildFromNode(node2, rrdom, domMirror, parentRRNode) {
|
|
|
10107
10110
|
rrNode.compatMode = node2.compatMode;
|
|
10108
10111
|
}
|
|
10109
10112
|
break;
|
|
10110
|
-
case NodeType.DOCUMENT_TYPE_NODE: {
|
|
10113
|
+
case NodeType$2.DOCUMENT_TYPE_NODE: {
|
|
10111
10114
|
const documentType = node2;
|
|
10112
10115
|
rrNode = rrdom.createDocumentType(
|
|
10113
10116
|
documentType.name,
|
|
@@ -10116,7 +10119,7 @@ function buildFromNode(node2, rrdom, domMirror, parentRRNode) {
|
|
|
10116
10119
|
);
|
|
10117
10120
|
break;
|
|
10118
10121
|
}
|
|
10119
|
-
case NodeType.ELEMENT_NODE: {
|
|
10122
|
+
case NodeType$2.ELEMENT_NODE: {
|
|
10120
10123
|
const elementNode = node2;
|
|
10121
10124
|
const tagName = getValidTagName(elementNode);
|
|
10122
10125
|
rrNode = rrdom.createElement(tagName);
|
|
@@ -10128,16 +10131,16 @@ function buildFromNode(node2, rrdom, domMirror, parentRRNode) {
|
|
|
10128
10131
|
elementNode.scrollTop && (rrElement.scrollTop = elementNode.scrollTop);
|
|
10129
10132
|
break;
|
|
10130
10133
|
}
|
|
10131
|
-
case NodeType.TEXT_NODE:
|
|
10134
|
+
case NodeType$2.TEXT_NODE:
|
|
10132
10135
|
rrNode = rrdom.createTextNode(node2.textContent || "");
|
|
10133
10136
|
break;
|
|
10134
|
-
case NodeType.CDATA_SECTION_NODE:
|
|
10137
|
+
case NodeType$2.CDATA_SECTION_NODE:
|
|
10135
10138
|
rrNode = rrdom.createCDATASection(node2.data);
|
|
10136
10139
|
break;
|
|
10137
|
-
case NodeType.COMMENT_NODE:
|
|
10140
|
+
case NodeType$2.COMMENT_NODE:
|
|
10138
10141
|
rrNode = rrdom.createComment(node2.textContent || "");
|
|
10139
10142
|
break;
|
|
10140
|
-
case NodeType.DOCUMENT_FRAGMENT_NODE:
|
|
10143
|
+
case NodeType$2.DOCUMENT_FRAGMENT_NODE:
|
|
10141
10144
|
rrNode = parentRRNode.attachShadow({ mode: "open" });
|
|
10142
10145
|
break;
|
|
10143
10146
|
default:
|
|
@@ -10160,7 +10163,7 @@ function buildFromDom(dom, domMirror = createMirror$1(), rrdom = new RRDocument(
|
|
|
10160
10163
|
if (
|
|
10161
10164
|
// if the parentRRNode isn't a RRIFrameElement
|
|
10162
10165
|
(parentRRNode == null ? void 0 : parentRRNode.nodeName) !== "IFRAME" && // if node isn't a shadow root
|
|
10163
|
-
node2.nodeType !== NodeType.DOCUMENT_FRAGMENT_NODE
|
|
10166
|
+
node2.nodeType !== NodeType$2.DOCUMENT_FRAGMENT_NODE
|
|
10164
10167
|
) {
|
|
10165
10168
|
parentRRNode == null ? void 0 : parentRRNode.appendChild(rrNode);
|
|
10166
10169
|
rrNode.parentNode = parentRRNode;
|
|
@@ -10169,8 +10172,8 @@ function buildFromDom(dom, domMirror = createMirror$1(), rrdom = new RRDocument(
|
|
|
10169
10172
|
if (node2.nodeName === "IFRAME") {
|
|
10170
10173
|
const iframeDoc = node2.contentDocument;
|
|
10171
10174
|
iframeDoc && walk2(iframeDoc, rrNode);
|
|
10172
|
-
} else if (node2.nodeType === NodeType.DOCUMENT_NODE || node2.nodeType === NodeType.ELEMENT_NODE || node2.nodeType === NodeType.DOCUMENT_FRAGMENT_NODE) {
|
|
10173
|
-
if (node2.nodeType === NodeType.ELEMENT_NODE && node2.shadowRoot)
|
|
10175
|
+
} else if (node2.nodeType === NodeType$2.DOCUMENT_NODE || node2.nodeType === NodeType$2.ELEMENT_NODE || node2.nodeType === NodeType$2.DOCUMENT_FRAGMENT_NODE) {
|
|
10176
|
+
if (node2.nodeType === NodeType$2.ELEMENT_NODE && node2.shadowRoot)
|
|
10174
10177
|
walk2(node2.shadowRoot, rrNode);
|
|
10175
10178
|
node2.childNodes.forEach((childNode) => walk2(childNode, rrNode));
|
|
10176
10179
|
}
|
|
@@ -10294,6 +10297,9 @@ const testableMethods = {
|
|
|
10294
10297
|
MutationObserver: ["constructor"]
|
|
10295
10298
|
};
|
|
10296
10299
|
const untaintedBasePrototype = {};
|
|
10300
|
+
const isAngularZonePresent = () => {
|
|
10301
|
+
return !!globalThis.Zone;
|
|
10302
|
+
};
|
|
10297
10303
|
function getUntaintedPrototype(key) {
|
|
10298
10304
|
if (untaintedBasePrototype[key])
|
|
10299
10305
|
return untaintedBasePrototype[key];
|
|
@@ -10321,7 +10327,7 @@ function getUntaintedPrototype(key) {
|
|
|
10321
10327
|
}
|
|
10322
10328
|
)
|
|
10323
10329
|
);
|
|
10324
|
-
if (isUntaintedAccessors && isUntaintedMethods) {
|
|
10330
|
+
if (isUntaintedAccessors && isUntaintedMethods && !isAngularZonePresent()) {
|
|
10325
10331
|
untaintedBasePrototype[key] = defaultObj.prototype;
|
|
10326
10332
|
return defaultObj.prototype;
|
|
10327
10333
|
}
|
|
@@ -10904,6 +10910,15 @@ var ReplayerEvents = /* @__PURE__ */ ((ReplayerEvents2) => {
|
|
|
10904
10910
|
ReplayerEvents2["Destroy"] = "destroy";
|
|
10905
10911
|
return ReplayerEvents2;
|
|
10906
10912
|
})(ReplayerEvents || {});
|
|
10913
|
+
var NodeType = /* @__PURE__ */ ((NodeType2) => {
|
|
10914
|
+
NodeType2[NodeType2["Document"] = 0] = "Document";
|
|
10915
|
+
NodeType2[NodeType2["DocumentType"] = 1] = "DocumentType";
|
|
10916
|
+
NodeType2[NodeType2["Element"] = 2] = "Element";
|
|
10917
|
+
NodeType2[NodeType2["Text"] = 3] = "Text";
|
|
10918
|
+
NodeType2[NodeType2["CDATA"] = 4] = "CDATA";
|
|
10919
|
+
NodeType2[NodeType2["Comment"] = 5] = "Comment";
|
|
10920
|
+
return NodeType2;
|
|
10921
|
+
})(NodeType || {});
|
|
10907
10922
|
function isNodeInLinkedList(n2) {
|
|
10908
10923
|
return "__ln" in n2;
|
|
10909
10924
|
}
|
|
@@ -12818,7 +12833,7 @@ class IframeManager {
|
|
|
12818
12833
|
}
|
|
12819
12834
|
}
|
|
12820
12835
|
patchRootIdOnNode(node2, rootId) {
|
|
12821
|
-
if (node2.type !== NodeType
|
|
12836
|
+
if (node2.type !== NodeType.Document && !node2.rootId) node2.rootId = rootId;
|
|
12822
12837
|
if ("childNodes" in node2) {
|
|
12823
12838
|
node2.childNodes.forEach((child) => {
|
|
12824
12839
|
this.patchRootIdOnNode(child, rootId);
|
|
@@ -15881,7 +15896,7 @@ class Replayer {
|
|
|
15881
15896
|
collectedDialogs.add(builtNode);
|
|
15882
15897
|
this.collectIframeAndAttachDocument(collectedIframes, builtNode);
|
|
15883
15898
|
const sn = mirror2.getMeta(builtNode);
|
|
15884
|
-
if ((sn == null ? void 0 : sn.type) === NodeType
|
|
15899
|
+
if ((sn == null ? void 0 : sn.type) === NodeType.Element && (sn == null ? void 0 : sn.tagName.toUpperCase()) === "HTML") {
|
|
15885
15900
|
const { documentElement, head } = iframeEl.contentDocument;
|
|
15886
15901
|
this.insertStyleRules(
|
|
15887
15902
|
documentElement,
|
|
@@ -16355,7 +16370,7 @@ class Replayer {
|
|
|
16355
16370
|
mutation.parentId
|
|
16356
16371
|
);
|
|
16357
16372
|
if (!parent) {
|
|
16358
|
-
if (mutation.node.type === NodeType
|
|
16373
|
+
if (mutation.node.type === NodeType.Document) {
|
|
16359
16374
|
return this.newDocumentQueue.push(mutation);
|
|
16360
16375
|
}
|
|
16361
16376
|
return queue.push(mutation);
|
|
@@ -16417,7 +16432,7 @@ class Replayer {
|
|
|
16417
16432
|
return;
|
|
16418
16433
|
}
|
|
16419
16434
|
const parentSn = mirror2.getMeta(parent);
|
|
16420
|
-
if (parentSn && parentSn.type === NodeType
|
|
16435
|
+
if (parentSn && parentSn.type === NodeType.Element && mutation.node.type === NodeType.Text) {
|
|
16421
16436
|
const prospectiveSiblings = Array.isArray(parent.childNodes) ? parent.childNodes : Array.from(parent.childNodes);
|
|
16422
16437
|
if (parentSn.tagName === "textarea") {
|
|
16423
16438
|
for (const c2 of prospectiveSiblings) {
|
|
@@ -16433,9 +16448,9 @@ class Replayer {
|
|
|
16433
16448
|
}
|
|
16434
16449
|
}
|
|
16435
16450
|
}
|
|
16436
|
-
} else if ((parentSn == null ? void 0 : parentSn.type) === NodeType
|
|
16451
|
+
} else if ((parentSn == null ? void 0 : parentSn.type) === NodeType.Document) {
|
|
16437
16452
|
const parentDoc = parent;
|
|
16438
|
-
if (mutation.node.type === NodeType
|
|
16453
|
+
if (mutation.node.type === NodeType.DocumentType && ((_a2 = parentDoc.childNodes[0]) == null ? void 0 : _a2.nodeType) === Node.DOCUMENT_TYPE_NODE)
|
|
16439
16454
|
parentDoc.removeChild(parentDoc.childNodes[0]);
|
|
16440
16455
|
if (target.nodeName === "HTML" && parentDoc.documentElement)
|
|
16441
16456
|
parentDoc.removeChild(
|
|
@@ -16641,7 +16656,7 @@ class Replayer {
|
|
|
16641
16656
|
left: d.x,
|
|
16642
16657
|
behavior: isSync ? "auto" : "smooth"
|
|
16643
16658
|
});
|
|
16644
|
-
} else if ((sn == null ? void 0 : sn.type) === NodeType
|
|
16659
|
+
} else if ((sn == null ? void 0 : sn.type) === NodeType.Document) {
|
|
16645
16660
|
(_b = target.defaultView) == null ? void 0 : _b.scrollTo({
|
|
16646
16661
|
top: d.y,
|
|
16647
16662
|
left: d.x,
|