@screeb/rrweb 1.0.5 → 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 +96 -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 +96 -66
- package/dist/rrweb.js.map +1 -1
- package/dist/rrweb.umd.cjs +96 -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
|
}
|
|
@@ -682,6 +685,21 @@ function needMaskingText(node2, maskTextClass, maskTextSelector, checkAncestors)
|
|
|
682
685
|
el = index$1.parentElement(node2);
|
|
683
686
|
}
|
|
684
687
|
try {
|
|
688
|
+
if (el.tagName === "INPUT") {
|
|
689
|
+
const autocomplete = el.getAttribute("autocomplete");
|
|
690
|
+
const disallowedAutocompleteValues = [
|
|
691
|
+
"current-password",
|
|
692
|
+
"new-password",
|
|
693
|
+
"cc-number",
|
|
694
|
+
"cc-exp",
|
|
695
|
+
"cc-exp-month",
|
|
696
|
+
"cc-exp-year",
|
|
697
|
+
"cc-csc"
|
|
698
|
+
];
|
|
699
|
+
if (disallowedAutocompleteValues.includes(autocomplete)) {
|
|
700
|
+
return true;
|
|
701
|
+
}
|
|
702
|
+
}
|
|
685
703
|
if (typeof maskTextClass === "string") {
|
|
686
704
|
if (checkAncestors) {
|
|
687
705
|
if (el.closest(`.${maskTextClass}`)) return true;
|
|
@@ -779,20 +797,20 @@ function serializeNode(n2, options) {
|
|
|
779
797
|
case n2.DOCUMENT_NODE:
|
|
780
798
|
if (n2.compatMode !== "CSS1Compat") {
|
|
781
799
|
return {
|
|
782
|
-
type: NodeType$
|
|
800
|
+
type: NodeType$3.Document,
|
|
783
801
|
childNodes: [],
|
|
784
802
|
compatMode: n2.compatMode
|
|
785
803
|
// probably "BackCompat"
|
|
786
804
|
};
|
|
787
805
|
} else {
|
|
788
806
|
return {
|
|
789
|
-
type: NodeType$
|
|
807
|
+
type: NodeType$3.Document,
|
|
790
808
|
childNodes: []
|
|
791
809
|
};
|
|
792
810
|
}
|
|
793
811
|
case n2.DOCUMENT_TYPE_NODE:
|
|
794
812
|
return {
|
|
795
|
-
type: NodeType$
|
|
813
|
+
type: NodeType$3.DocumentType,
|
|
796
814
|
name: n2.name,
|
|
797
815
|
publicId: n2.publicId,
|
|
798
816
|
systemId: n2.systemId,
|
|
@@ -823,13 +841,13 @@ function serializeNode(n2, options) {
|
|
|
823
841
|
});
|
|
824
842
|
case n2.CDATA_SECTION_NODE:
|
|
825
843
|
return {
|
|
826
|
-
type: NodeType$
|
|
844
|
+
type: NodeType$3.CDATA,
|
|
827
845
|
textContent: "",
|
|
828
846
|
rootId
|
|
829
847
|
};
|
|
830
848
|
case n2.COMMENT_NODE:
|
|
831
849
|
return {
|
|
832
|
-
type: NodeType$
|
|
850
|
+
type: NodeType$3.Comment,
|
|
833
851
|
textContent: index$1.textContent(n2) || "",
|
|
834
852
|
rootId
|
|
835
853
|
};
|
|
@@ -861,7 +879,7 @@ function serializeTextNode(n2, options) {
|
|
|
861
879
|
textContent2 = maskTextFn ? maskTextFn(textContent2, index$1.parentElement(n2)) : textContent2.replace(/[\S]/g, "*");
|
|
862
880
|
}
|
|
863
881
|
return {
|
|
864
|
-
type: NodeType$
|
|
882
|
+
type: NodeType$3.Text,
|
|
865
883
|
textContent: textContent2 || "",
|
|
866
884
|
rootId
|
|
867
885
|
};
|
|
@@ -1047,7 +1065,7 @@ function serializeElementNode(n2, options) {
|
|
|
1047
1065
|
} catch (e2) {
|
|
1048
1066
|
}
|
|
1049
1067
|
return {
|
|
1050
|
-
type: NodeType$
|
|
1068
|
+
type: NodeType$3.Element,
|
|
1051
1069
|
tagName,
|
|
1052
1070
|
attributes,
|
|
1053
1071
|
childNodes: [],
|
|
@@ -1065,9 +1083,9 @@ function lowerIfExists(maybeAttr) {
|
|
|
1065
1083
|
}
|
|
1066
1084
|
}
|
|
1067
1085
|
function slimDOMExcluded(sn, slimDOMOptions) {
|
|
1068
|
-
if (slimDOMOptions.comment && sn.type === NodeType$
|
|
1086
|
+
if (slimDOMOptions.comment && sn.type === NodeType$3.Comment) {
|
|
1069
1087
|
return true;
|
|
1070
|
-
} else if (sn.type === NodeType$
|
|
1088
|
+
} else if (sn.type === NodeType$3.Element) {
|
|
1071
1089
|
if (slimDOMOptions.script && // script tag
|
|
1072
1090
|
(sn.tagName === "script" || // (module)preload link
|
|
1073
1091
|
sn.tagName === "link" && (sn.attributes.rel === "preload" || sn.attributes.rel === "modulepreload") && sn.attributes.as === "script" || // prefetch link
|
|
@@ -1157,7 +1175,7 @@ function serializeNodeWithId(n2, options) {
|
|
|
1157
1175
|
let id;
|
|
1158
1176
|
if (mirror2.hasNode(n2)) {
|
|
1159
1177
|
id = mirror2.getId(n2);
|
|
1160
|
-
} 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) {
|
|
1161
1179
|
id = IGNORED_NODE;
|
|
1162
1180
|
} else {
|
|
1163
1181
|
id = genId();
|
|
@@ -1171,15 +1189,15 @@ function serializeNodeWithId(n2, options) {
|
|
|
1171
1189
|
onSerialize(n2);
|
|
1172
1190
|
}
|
|
1173
1191
|
let recordChild = !skipChild;
|
|
1174
|
-
if (serializedNode.type === NodeType$
|
|
1192
|
+
if (serializedNode.type === NodeType$3.Element) {
|
|
1175
1193
|
recordChild = recordChild && !serializedNode.needBlock;
|
|
1176
1194
|
delete serializedNode.needBlock;
|
|
1177
1195
|
const shadowRootEl = index$1.shadowRoot(n2);
|
|
1178
1196
|
if (shadowRootEl && isNativeShadowDom(shadowRootEl))
|
|
1179
1197
|
serializedNode.isShadowHost = true;
|
|
1180
1198
|
}
|
|
1181
|
-
if ((serializedNode.type === NodeType$
|
|
1182
|
-
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") {
|
|
1183
1201
|
preserveWhiteSpace = false;
|
|
1184
1202
|
}
|
|
1185
1203
|
const bypassOptions = {
|
|
@@ -1208,9 +1226,9 @@ function serializeNodeWithId(n2, options) {
|
|
|
1208
1226
|
keepIframeSrcFn,
|
|
1209
1227
|
cssCaptured: false
|
|
1210
1228
|
};
|
|
1211
|
-
if (serializedNode.type === NodeType$
|
|
1229
|
+
if (serializedNode.type === NodeType$3.Element && serializedNode.tagName === "textarea" && serializedNode.attributes.value !== void 0) ;
|
|
1212
1230
|
else {
|
|
1213
|
-
if (serializedNode.type === NodeType$
|
|
1231
|
+
if (serializedNode.type === NodeType$3.Element && serializedNode.attributes._cssText !== void 0 && typeof serializedNode.attributes._cssText === "string") {
|
|
1214
1232
|
bypassOptions.cssCaptured = true;
|
|
1215
1233
|
}
|
|
1216
1234
|
for (const childN of Array.from(index$1.childNodes(n2))) {
|
|
@@ -1235,7 +1253,7 @@ function serializeNodeWithId(n2, options) {
|
|
|
1235
1253
|
if (parent && isShadowRoot(parent) && isNativeShadowDom(parent)) {
|
|
1236
1254
|
serializedNode.isShadow = true;
|
|
1237
1255
|
}
|
|
1238
|
-
if (serializedNode.type === NodeType$
|
|
1256
|
+
if (serializedNode.type === NodeType$3.Element && serializedNode.tagName === "iframe") {
|
|
1239
1257
|
onceIframeLoaded(
|
|
1240
1258
|
n2,
|
|
1241
1259
|
() => {
|
|
@@ -1277,7 +1295,7 @@ function serializeNodeWithId(n2, options) {
|
|
|
1277
1295
|
iframeLoadTimeout
|
|
1278
1296
|
);
|
|
1279
1297
|
}
|
|
1280
|
-
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")) {
|
|
1281
1299
|
onceStylesheetLoaded(
|
|
1282
1300
|
n2,
|
|
1283
1301
|
() => {
|
|
@@ -5059,7 +5077,7 @@ function createCache() {
|
|
|
5059
5077
|
function applyCssSplits(n2, cssText, hackCss, cache) {
|
|
5060
5078
|
const childTextNodes = [];
|
|
5061
5079
|
for (const scn of n2.childNodes) {
|
|
5062
|
-
if (scn.type === NodeType$
|
|
5080
|
+
if (scn.type === NodeType$3.Text) {
|
|
5063
5081
|
childTextNodes.push(scn);
|
|
5064
5082
|
}
|
|
5065
5083
|
}
|
|
@@ -5090,15 +5108,15 @@ function buildNode(n2, options) {
|
|
|
5090
5108
|
var _a2;
|
|
5091
5109
|
const { doc, hackCss, cache } = options;
|
|
5092
5110
|
switch (n2.type) {
|
|
5093
|
-
case NodeType$
|
|
5111
|
+
case NodeType$3.Document:
|
|
5094
5112
|
return doc.implementation.createDocument(null, "", null);
|
|
5095
|
-
case NodeType$
|
|
5113
|
+
case NodeType$3.DocumentType:
|
|
5096
5114
|
return doc.implementation.createDocumentType(
|
|
5097
5115
|
n2.name || "html",
|
|
5098
5116
|
n2.publicId,
|
|
5099
5117
|
n2.systemId
|
|
5100
5118
|
);
|
|
5101
|
-
case NodeType$
|
|
5119
|
+
case NodeType$3.Element: {
|
|
5102
5120
|
const tagName = getTagName(n2);
|
|
5103
5121
|
let node2;
|
|
5104
5122
|
if (n2.isSVG) {
|
|
@@ -5232,14 +5250,14 @@ function buildNode(n2, options) {
|
|
|
5232
5250
|
}
|
|
5233
5251
|
return node2;
|
|
5234
5252
|
}
|
|
5235
|
-
case NodeType$
|
|
5253
|
+
case NodeType$3.Text:
|
|
5236
5254
|
if (n2.isStyle && hackCss) {
|
|
5237
5255
|
return doc.createTextNode(adaptCssForReplay(n2.textContent, cache));
|
|
5238
5256
|
}
|
|
5239
5257
|
return doc.createTextNode(n2.textContent);
|
|
5240
|
-
case NodeType$
|
|
5258
|
+
case NodeType$3.CDATA:
|
|
5241
5259
|
return doc.createCDATASection(n2.textContent);
|
|
5242
|
-
case NodeType$
|
|
5260
|
+
case NodeType$3.Comment:
|
|
5243
5261
|
return doc.createComment(n2.textContent);
|
|
5244
5262
|
default:
|
|
5245
5263
|
return null;
|
|
@@ -5266,11 +5284,11 @@ function buildNodeWithSN(n2, options) {
|
|
|
5266
5284
|
if (n2.rootId && mirror2.getNode(n2.rootId) !== doc) {
|
|
5267
5285
|
mirror2.replace(n2.rootId, doc);
|
|
5268
5286
|
}
|
|
5269
|
-
if (n2.type === NodeType$
|
|
5287
|
+
if (n2.type === NodeType$3.Document) {
|
|
5270
5288
|
doc.close();
|
|
5271
5289
|
doc.open();
|
|
5272
|
-
if (n2.compatMode === "BackCompat" && n2.childNodes && n2.childNodes[0].type !== NodeType$
|
|
5273
|
-
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") {
|
|
5274
5292
|
doc.write(
|
|
5275
5293
|
'<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "">'
|
|
5276
5294
|
);
|
|
@@ -5283,7 +5301,7 @@ function buildNodeWithSN(n2, options) {
|
|
|
5283
5301
|
node2 = doc;
|
|
5284
5302
|
}
|
|
5285
5303
|
mirror2.add(node2, n2);
|
|
5286
|
-
if ((n2.type === NodeType$
|
|
5304
|
+
if ((n2.type === NodeType$3.Document || n2.type === NodeType$3.Element) && !skipChild) {
|
|
5287
5305
|
for (const childN of n2.childNodes) {
|
|
5288
5306
|
const childNode = buildNodeWithSN(childN, {
|
|
5289
5307
|
doc,
|
|
@@ -5299,7 +5317,7 @@ function buildNodeWithSN(n2, options) {
|
|
|
5299
5317
|
}
|
|
5300
5318
|
if (childN.isShadow && isElement(node2) && node2.shadowRoot) {
|
|
5301
5319
|
node2.shadowRoot.appendChild(childNode);
|
|
5302
|
-
} else if (n2.type === NodeType$
|
|
5320
|
+
} else if (n2.type === NodeType$3.Document && childN.type == NodeType$3.Element) {
|
|
5303
5321
|
const htmlElement = childNode;
|
|
5304
5322
|
let body = null;
|
|
5305
5323
|
htmlElement.childNodes.forEach((child) => {
|
|
@@ -5334,7 +5352,7 @@ function visit(mirror2, onVisit) {
|
|
|
5334
5352
|
}
|
|
5335
5353
|
function handleScroll(node2, mirror2) {
|
|
5336
5354
|
const n2 = mirror2.getMeta(node2);
|
|
5337
|
-
if ((n2 == null ? void 0 : n2.type) !== NodeType$
|
|
5355
|
+
if ((n2 == null ? void 0 : n2.type) !== NodeType$3.Element) {
|
|
5338
5356
|
return;
|
|
5339
5357
|
}
|
|
5340
5358
|
const el = node2;
|
|
@@ -5382,15 +5400,6 @@ var __publicField2 = (obj, key, value) => __defNormalProp22(obj, typeof key !==
|
|
|
5382
5400
|
var __defProp222 = Object.defineProperty;
|
|
5383
5401
|
var __defNormalProp222 = (obj, key, value) => key in obj ? __defProp222(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
|
|
5384
5402
|
var __publicField22 = (obj, key, value) => __defNormalProp222(obj, typeof key !== "symbol" ? key + "" : key, value);
|
|
5385
|
-
var NodeType$1 = /* @__PURE__ */ ((NodeType2) => {
|
|
5386
|
-
NodeType2[NodeType2["Document"] = 0] = "Document";
|
|
5387
|
-
NodeType2[NodeType2["DocumentType"] = 1] = "DocumentType";
|
|
5388
|
-
NodeType2[NodeType2["Element"] = 2] = "Element";
|
|
5389
|
-
NodeType2[NodeType2["Text"] = 3] = "Text";
|
|
5390
|
-
NodeType2[NodeType2["CDATA"] = 4] = "CDATA";
|
|
5391
|
-
NodeType2[NodeType2["Comment"] = 5] = "Comment";
|
|
5392
|
-
return NodeType2;
|
|
5393
|
-
})(NodeType$1 || {});
|
|
5394
5403
|
let Mirror$1 = class Mirror2 {
|
|
5395
5404
|
constructor() {
|
|
5396
5405
|
__publicField22(this, "idNodeMap", /* @__PURE__ */ new Map());
|
|
@@ -9002,6 +9011,15 @@ postcss$1.Input;
|
|
|
9002
9011
|
postcss$1.Rule;
|
|
9003
9012
|
postcss$1.Root;
|
|
9004
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 || {});
|
|
9005
9023
|
function parseCSSText(cssText) {
|
|
9006
9024
|
const res = {};
|
|
9007
9025
|
const listDelimiter = /;(?![^(]*\))/g;
|
|
@@ -9511,7 +9529,7 @@ function removeChild(parent, child) {
|
|
|
9511
9529
|
child.parentNode = null;
|
|
9512
9530
|
return child;
|
|
9513
9531
|
}
|
|
9514
|
-
var NodeType = /* @__PURE__ */ ((NodeType2) => {
|
|
9532
|
+
var NodeType$2 = /* @__PURE__ */ ((NodeType2) => {
|
|
9515
9533
|
NodeType2[NodeType2["PLACEHOLDER"] = 0] = "PLACEHOLDER";
|
|
9516
9534
|
NodeType2[NodeType2["ELEMENT_NODE"] = 1] = "ELEMENT_NODE";
|
|
9517
9535
|
NodeType2[NodeType2["ATTRIBUTE_NODE"] = 2] = "ATTRIBUTE_NODE";
|
|
@@ -9525,7 +9543,7 @@ var NodeType = /* @__PURE__ */ ((NodeType2) => {
|
|
|
9525
9543
|
NodeType2[NodeType2["DOCUMENT_TYPE_NODE"] = 10] = "DOCUMENT_TYPE_NODE";
|
|
9526
9544
|
NodeType2[NodeType2["DOCUMENT_FRAGMENT_NODE"] = 11] = "DOCUMENT_FRAGMENT_NODE";
|
|
9527
9545
|
return NodeType2;
|
|
9528
|
-
})(NodeType || {});
|
|
9546
|
+
})(NodeType$2 || {});
|
|
9529
9547
|
const NAMESPACES = {
|
|
9530
9548
|
svg: "http://www.w3.org/2000/svg",
|
|
9531
9549
|
"xlink:href": "http://www.w3.org/1999/xlink",
|
|
@@ -10084,7 +10102,7 @@ function getValidTagName(element) {
|
|
|
10084
10102
|
function buildFromNode(node2, rrdom, domMirror, parentRRNode) {
|
|
10085
10103
|
let rrNode;
|
|
10086
10104
|
switch (node2.nodeType) {
|
|
10087
|
-
case NodeType.DOCUMENT_NODE:
|
|
10105
|
+
case NodeType$2.DOCUMENT_NODE:
|
|
10088
10106
|
if (parentRRNode && parentRRNode.nodeName === "IFRAME")
|
|
10089
10107
|
rrNode = parentRRNode.contentDocument;
|
|
10090
10108
|
else {
|
|
@@ -10092,7 +10110,7 @@ function buildFromNode(node2, rrdom, domMirror, parentRRNode) {
|
|
|
10092
10110
|
rrNode.compatMode = node2.compatMode;
|
|
10093
10111
|
}
|
|
10094
10112
|
break;
|
|
10095
|
-
case NodeType.DOCUMENT_TYPE_NODE: {
|
|
10113
|
+
case NodeType$2.DOCUMENT_TYPE_NODE: {
|
|
10096
10114
|
const documentType = node2;
|
|
10097
10115
|
rrNode = rrdom.createDocumentType(
|
|
10098
10116
|
documentType.name,
|
|
@@ -10101,7 +10119,7 @@ function buildFromNode(node2, rrdom, domMirror, parentRRNode) {
|
|
|
10101
10119
|
);
|
|
10102
10120
|
break;
|
|
10103
10121
|
}
|
|
10104
|
-
case NodeType.ELEMENT_NODE: {
|
|
10122
|
+
case NodeType$2.ELEMENT_NODE: {
|
|
10105
10123
|
const elementNode = node2;
|
|
10106
10124
|
const tagName = getValidTagName(elementNode);
|
|
10107
10125
|
rrNode = rrdom.createElement(tagName);
|
|
@@ -10113,16 +10131,16 @@ function buildFromNode(node2, rrdom, domMirror, parentRRNode) {
|
|
|
10113
10131
|
elementNode.scrollTop && (rrElement.scrollTop = elementNode.scrollTop);
|
|
10114
10132
|
break;
|
|
10115
10133
|
}
|
|
10116
|
-
case NodeType.TEXT_NODE:
|
|
10134
|
+
case NodeType$2.TEXT_NODE:
|
|
10117
10135
|
rrNode = rrdom.createTextNode(node2.textContent || "");
|
|
10118
10136
|
break;
|
|
10119
|
-
case NodeType.CDATA_SECTION_NODE:
|
|
10137
|
+
case NodeType$2.CDATA_SECTION_NODE:
|
|
10120
10138
|
rrNode = rrdom.createCDATASection(node2.data);
|
|
10121
10139
|
break;
|
|
10122
|
-
case NodeType.COMMENT_NODE:
|
|
10140
|
+
case NodeType$2.COMMENT_NODE:
|
|
10123
10141
|
rrNode = rrdom.createComment(node2.textContent || "");
|
|
10124
10142
|
break;
|
|
10125
|
-
case NodeType.DOCUMENT_FRAGMENT_NODE:
|
|
10143
|
+
case NodeType$2.DOCUMENT_FRAGMENT_NODE:
|
|
10126
10144
|
rrNode = parentRRNode.attachShadow({ mode: "open" });
|
|
10127
10145
|
break;
|
|
10128
10146
|
default:
|
|
@@ -10145,7 +10163,7 @@ function buildFromDom(dom, domMirror = createMirror$1(), rrdom = new RRDocument(
|
|
|
10145
10163
|
if (
|
|
10146
10164
|
// if the parentRRNode isn't a RRIFrameElement
|
|
10147
10165
|
(parentRRNode == null ? void 0 : parentRRNode.nodeName) !== "IFRAME" && // if node isn't a shadow root
|
|
10148
|
-
node2.nodeType !== NodeType.DOCUMENT_FRAGMENT_NODE
|
|
10166
|
+
node2.nodeType !== NodeType$2.DOCUMENT_FRAGMENT_NODE
|
|
10149
10167
|
) {
|
|
10150
10168
|
parentRRNode == null ? void 0 : parentRRNode.appendChild(rrNode);
|
|
10151
10169
|
rrNode.parentNode = parentRRNode;
|
|
@@ -10154,8 +10172,8 @@ function buildFromDom(dom, domMirror = createMirror$1(), rrdom = new RRDocument(
|
|
|
10154
10172
|
if (node2.nodeName === "IFRAME") {
|
|
10155
10173
|
const iframeDoc = node2.contentDocument;
|
|
10156
10174
|
iframeDoc && walk2(iframeDoc, rrNode);
|
|
10157
|
-
} else if (node2.nodeType === NodeType.DOCUMENT_NODE || node2.nodeType === NodeType.ELEMENT_NODE || node2.nodeType === NodeType.DOCUMENT_FRAGMENT_NODE) {
|
|
10158
|
-
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)
|
|
10159
10177
|
walk2(node2.shadowRoot, rrNode);
|
|
10160
10178
|
node2.childNodes.forEach((childNode) => walk2(childNode, rrNode));
|
|
10161
10179
|
}
|
|
@@ -10279,6 +10297,9 @@ const testableMethods = {
|
|
|
10279
10297
|
MutationObserver: ["constructor"]
|
|
10280
10298
|
};
|
|
10281
10299
|
const untaintedBasePrototype = {};
|
|
10300
|
+
const isAngularZonePresent = () => {
|
|
10301
|
+
return !!globalThis.Zone;
|
|
10302
|
+
};
|
|
10282
10303
|
function getUntaintedPrototype(key) {
|
|
10283
10304
|
if (untaintedBasePrototype[key])
|
|
10284
10305
|
return untaintedBasePrototype[key];
|
|
@@ -10306,7 +10327,7 @@ function getUntaintedPrototype(key) {
|
|
|
10306
10327
|
}
|
|
10307
10328
|
)
|
|
10308
10329
|
);
|
|
10309
|
-
if (isUntaintedAccessors && isUntaintedMethods) {
|
|
10330
|
+
if (isUntaintedAccessors && isUntaintedMethods && !isAngularZonePresent()) {
|
|
10310
10331
|
untaintedBasePrototype[key] = defaultObj.prototype;
|
|
10311
10332
|
return defaultObj.prototype;
|
|
10312
10333
|
}
|
|
@@ -10889,6 +10910,15 @@ var ReplayerEvents = /* @__PURE__ */ ((ReplayerEvents2) => {
|
|
|
10889
10910
|
ReplayerEvents2["Destroy"] = "destroy";
|
|
10890
10911
|
return ReplayerEvents2;
|
|
10891
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 || {});
|
|
10892
10922
|
function isNodeInLinkedList(n2) {
|
|
10893
10923
|
return "__ln" in n2;
|
|
10894
10924
|
}
|
|
@@ -12803,7 +12833,7 @@ class IframeManager {
|
|
|
12803
12833
|
}
|
|
12804
12834
|
}
|
|
12805
12835
|
patchRootIdOnNode(node2, rootId) {
|
|
12806
|
-
if (node2.type !== NodeType
|
|
12836
|
+
if (node2.type !== NodeType.Document && !node2.rootId) node2.rootId = rootId;
|
|
12807
12837
|
if ("childNodes" in node2) {
|
|
12808
12838
|
node2.childNodes.forEach((child) => {
|
|
12809
12839
|
this.patchRootIdOnNode(child, rootId);
|
|
@@ -15866,7 +15896,7 @@ class Replayer {
|
|
|
15866
15896
|
collectedDialogs.add(builtNode);
|
|
15867
15897
|
this.collectIframeAndAttachDocument(collectedIframes, builtNode);
|
|
15868
15898
|
const sn = mirror2.getMeta(builtNode);
|
|
15869
|
-
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") {
|
|
15870
15900
|
const { documentElement, head } = iframeEl.contentDocument;
|
|
15871
15901
|
this.insertStyleRules(
|
|
15872
15902
|
documentElement,
|
|
@@ -16340,7 +16370,7 @@ class Replayer {
|
|
|
16340
16370
|
mutation.parentId
|
|
16341
16371
|
);
|
|
16342
16372
|
if (!parent) {
|
|
16343
|
-
if (mutation.node.type === NodeType
|
|
16373
|
+
if (mutation.node.type === NodeType.Document) {
|
|
16344
16374
|
return this.newDocumentQueue.push(mutation);
|
|
16345
16375
|
}
|
|
16346
16376
|
return queue.push(mutation);
|
|
@@ -16402,7 +16432,7 @@ class Replayer {
|
|
|
16402
16432
|
return;
|
|
16403
16433
|
}
|
|
16404
16434
|
const parentSn = mirror2.getMeta(parent);
|
|
16405
|
-
if (parentSn && parentSn.type === NodeType
|
|
16435
|
+
if (parentSn && parentSn.type === NodeType.Element && mutation.node.type === NodeType.Text) {
|
|
16406
16436
|
const prospectiveSiblings = Array.isArray(parent.childNodes) ? parent.childNodes : Array.from(parent.childNodes);
|
|
16407
16437
|
if (parentSn.tagName === "textarea") {
|
|
16408
16438
|
for (const c2 of prospectiveSiblings) {
|
|
@@ -16418,9 +16448,9 @@ class Replayer {
|
|
|
16418
16448
|
}
|
|
16419
16449
|
}
|
|
16420
16450
|
}
|
|
16421
|
-
} else if ((parentSn == null ? void 0 : parentSn.type) === NodeType
|
|
16451
|
+
} else if ((parentSn == null ? void 0 : parentSn.type) === NodeType.Document) {
|
|
16422
16452
|
const parentDoc = parent;
|
|
16423
|
-
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)
|
|
16424
16454
|
parentDoc.removeChild(parentDoc.childNodes[0]);
|
|
16425
16455
|
if (target.nodeName === "HTML" && parentDoc.documentElement)
|
|
16426
16456
|
parentDoc.removeChild(
|
|
@@ -16626,7 +16656,7 @@ class Replayer {
|
|
|
16626
16656
|
left: d.x,
|
|
16627
16657
|
behavior: isSync ? "auto" : "smooth"
|
|
16628
16658
|
});
|
|
16629
|
-
} else if ((sn == null ? void 0 : sn.type) === NodeType
|
|
16659
|
+
} else if ((sn == null ? void 0 : sn.type) === NodeType.Document) {
|
|
16630
16660
|
(_b = target.defaultView) == null ? void 0 : _b.scrollTo({
|
|
16631
16661
|
top: d.y,
|
|
16632
16662
|
left: d.x,
|