@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.d.cts
CHANGED
|
@@ -2,7 +2,7 @@ import { actionWithDelay } from '@rrweb/types';
|
|
|
2
2
|
import { addedNodeMutation } from '@rrweb/types';
|
|
3
3
|
import { blockClass } from '@rrweb/types';
|
|
4
4
|
import { canvasMutationData } from '@rrweb/types';
|
|
5
|
-
import { DataURLOptions } from 'rrweb
|
|
5
|
+
import { DataURLOptions } from '@rrweb/types';
|
|
6
6
|
import { DeprecatedMirror } from '@rrweb/types';
|
|
7
7
|
import { DocumentDimension } from '@rrweb/types';
|
|
8
8
|
import { Emitter } from '@rrweb/types';
|
|
@@ -11,7 +11,7 @@ import { eventWithTime } from '@rrweb/types';
|
|
|
11
11
|
import { Handler } from '@rrweb/types';
|
|
12
12
|
import { hookResetter } from '@rrweb/types';
|
|
13
13
|
import { hooksParam } from '@rrweb/types';
|
|
14
|
-
import { IMirror } from 'rrweb
|
|
14
|
+
import { IMirror } from '@rrweb/types';
|
|
15
15
|
import { IncrementalSource } from '@rrweb/types';
|
|
16
16
|
import { IWindow } from '@rrweb/types';
|
|
17
17
|
import { KeepIframeSrcFn } from '@rrweb/types';
|
package/dist/rrweb.d.ts
CHANGED
|
@@ -2,7 +2,7 @@ import { actionWithDelay } from '@rrweb/types';
|
|
|
2
2
|
import { addedNodeMutation } from '@rrweb/types';
|
|
3
3
|
import { blockClass } from '@rrweb/types';
|
|
4
4
|
import { canvasMutationData } from '@rrweb/types';
|
|
5
|
-
import { DataURLOptions } from 'rrweb
|
|
5
|
+
import { DataURLOptions } from '@rrweb/types';
|
|
6
6
|
import { DeprecatedMirror } from '@rrweb/types';
|
|
7
7
|
import { DocumentDimension } from '@rrweb/types';
|
|
8
8
|
import { Emitter } from '@rrweb/types';
|
|
@@ -11,7 +11,7 @@ import { eventWithTime } from '@rrweb/types';
|
|
|
11
11
|
import { Handler } from '@rrweb/types';
|
|
12
12
|
import { hookResetter } from '@rrweb/types';
|
|
13
13
|
import { hooksParam } from '@rrweb/types';
|
|
14
|
-
import { IMirror } from 'rrweb
|
|
14
|
+
import { IMirror } from '@rrweb/types';
|
|
15
15
|
import { IncrementalSource } from '@rrweb/types';
|
|
16
16
|
import { IWindow } from '@rrweb/types';
|
|
17
17
|
import { KeepIframeSrcFn } from '@rrweb/types';
|
package/dist/rrweb.js
CHANGED
|
@@ -5,7 +5,7 @@ var _a;
|
|
|
5
5
|
var __defProp$1 = Object.defineProperty;
|
|
6
6
|
var __defNormalProp$1 = (obj, key, value) => key in obj ? __defProp$1(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
|
|
7
7
|
var __publicField$1 = (obj, key, value) => __defNormalProp$1(obj, typeof key !== "symbol" ? key + "" : key, value);
|
|
8
|
-
var NodeType$
|
|
8
|
+
var NodeType$3 = /* @__PURE__ */ ((NodeType2) => {
|
|
9
9
|
NodeType2[NodeType2["Document"] = 0] = "Document";
|
|
10
10
|
NodeType2[NodeType2["DocumentType"] = 1] = "DocumentType";
|
|
11
11
|
NodeType2[NodeType2["Element"] = 2] = "Element";
|
|
@@ -13,7 +13,7 @@ var NodeType$2 = /* @__PURE__ */ ((NodeType2) => {
|
|
|
13
13
|
NodeType2[NodeType2["CDATA"] = 4] = "CDATA";
|
|
14
14
|
NodeType2[NodeType2["Comment"] = 5] = "Comment";
|
|
15
15
|
return NodeType2;
|
|
16
|
-
})(NodeType$
|
|
16
|
+
})(NodeType$3 || {});
|
|
17
17
|
const testableAccessors$1 = {
|
|
18
18
|
Node: ["childNodes", "parentNode", "parentElement", "textContent"],
|
|
19
19
|
ShadowRoot: ["host", "styleSheets"],
|
|
@@ -27,6 +27,9 @@ const testableMethods$1 = {
|
|
|
27
27
|
MutationObserver: ["constructor"]
|
|
28
28
|
};
|
|
29
29
|
const untaintedBasePrototype$1 = {};
|
|
30
|
+
const isAngularZonePresent$1 = () => {
|
|
31
|
+
return !!globalThis.Zone;
|
|
32
|
+
};
|
|
30
33
|
function getUntaintedPrototype$1(key) {
|
|
31
34
|
if (untaintedBasePrototype$1[key])
|
|
32
35
|
return untaintedBasePrototype$1[key];
|
|
@@ -54,7 +57,7 @@ function getUntaintedPrototype$1(key) {
|
|
|
54
57
|
}
|
|
55
58
|
)
|
|
56
59
|
);
|
|
57
|
-
if (isUntaintedAccessors && isUntaintedMethods) {
|
|
60
|
+
if (isUntaintedAccessors && isUntaintedMethods && !isAngularZonePresent$1()) {
|
|
58
61
|
untaintedBasePrototype$1[key] = defaultObj.prototype;
|
|
59
62
|
return defaultObj.prototype;
|
|
60
63
|
}
|
|
@@ -356,13 +359,13 @@ function is2DCanvasBlank(canvas) {
|
|
|
356
359
|
}
|
|
357
360
|
function isNodeMetaEqual(a2, b) {
|
|
358
361
|
if (!a2 || !b || a2.type !== b.type) return false;
|
|
359
|
-
if (a2.type === NodeType$
|
|
362
|
+
if (a2.type === NodeType$3.Document)
|
|
360
363
|
return a2.compatMode === b.compatMode;
|
|
361
|
-
else if (a2.type === NodeType$
|
|
364
|
+
else if (a2.type === NodeType$3.DocumentType)
|
|
362
365
|
return a2.name === b.name && a2.publicId === b.publicId && a2.systemId === b.systemId;
|
|
363
|
-
else if (a2.type === NodeType$
|
|
366
|
+
else if (a2.type === NodeType$3.Comment || a2.type === NodeType$3.Text || a2.type === NodeType$3.CDATA)
|
|
364
367
|
return a2.textContent === b.textContent;
|
|
365
|
-
else if (a2.type === NodeType$
|
|
368
|
+
else if (a2.type === NodeType$3.Element)
|
|
366
369
|
return a2.tagName === b.tagName && JSON.stringify(a2.attributes) === JSON.stringify(b.attributes) && a2.isSVG === b.isSVG && a2.needBlock === b.needBlock;
|
|
367
370
|
return false;
|
|
368
371
|
}
|
|
@@ -635,6 +638,21 @@ function needMaskingText(node2, maskTextClass, maskTextSelector, checkAncestors)
|
|
|
635
638
|
el = index$1.parentElement(node2);
|
|
636
639
|
}
|
|
637
640
|
try {
|
|
641
|
+
if (el.tagName === "INPUT") {
|
|
642
|
+
const autocomplete = el.getAttribute("autocomplete");
|
|
643
|
+
const disallowedAutocompleteValues = [
|
|
644
|
+
"current-password",
|
|
645
|
+
"new-password",
|
|
646
|
+
"cc-number",
|
|
647
|
+
"cc-exp",
|
|
648
|
+
"cc-exp-month",
|
|
649
|
+
"cc-exp-year",
|
|
650
|
+
"cc-csc"
|
|
651
|
+
];
|
|
652
|
+
if (disallowedAutocompleteValues.includes(autocomplete)) {
|
|
653
|
+
return true;
|
|
654
|
+
}
|
|
655
|
+
}
|
|
638
656
|
if (typeof maskTextClass === "string") {
|
|
639
657
|
if (checkAncestors) {
|
|
640
658
|
if (el.closest(`.${maskTextClass}`)) return true;
|
|
@@ -732,20 +750,20 @@ function serializeNode(n2, options) {
|
|
|
732
750
|
case n2.DOCUMENT_NODE:
|
|
733
751
|
if (n2.compatMode !== "CSS1Compat") {
|
|
734
752
|
return {
|
|
735
|
-
type: NodeType$
|
|
753
|
+
type: NodeType$3.Document,
|
|
736
754
|
childNodes: [],
|
|
737
755
|
compatMode: n2.compatMode
|
|
738
756
|
// probably "BackCompat"
|
|
739
757
|
};
|
|
740
758
|
} else {
|
|
741
759
|
return {
|
|
742
|
-
type: NodeType$
|
|
760
|
+
type: NodeType$3.Document,
|
|
743
761
|
childNodes: []
|
|
744
762
|
};
|
|
745
763
|
}
|
|
746
764
|
case n2.DOCUMENT_TYPE_NODE:
|
|
747
765
|
return {
|
|
748
|
-
type: NodeType$
|
|
766
|
+
type: NodeType$3.DocumentType,
|
|
749
767
|
name: n2.name,
|
|
750
768
|
publicId: n2.publicId,
|
|
751
769
|
systemId: n2.systemId,
|
|
@@ -776,13 +794,13 @@ function serializeNode(n2, options) {
|
|
|
776
794
|
});
|
|
777
795
|
case n2.CDATA_SECTION_NODE:
|
|
778
796
|
return {
|
|
779
|
-
type: NodeType$
|
|
797
|
+
type: NodeType$3.CDATA,
|
|
780
798
|
textContent: "",
|
|
781
799
|
rootId
|
|
782
800
|
};
|
|
783
801
|
case n2.COMMENT_NODE:
|
|
784
802
|
return {
|
|
785
|
-
type: NodeType$
|
|
803
|
+
type: NodeType$3.Comment,
|
|
786
804
|
textContent: index$1.textContent(n2) || "",
|
|
787
805
|
rootId
|
|
788
806
|
};
|
|
@@ -814,7 +832,7 @@ function serializeTextNode(n2, options) {
|
|
|
814
832
|
textContent2 = maskTextFn ? maskTextFn(textContent2, index$1.parentElement(n2)) : textContent2.replace(/[\S]/g, "*");
|
|
815
833
|
}
|
|
816
834
|
return {
|
|
817
|
-
type: NodeType$
|
|
835
|
+
type: NodeType$3.Text,
|
|
818
836
|
textContent: textContent2 || "",
|
|
819
837
|
rootId
|
|
820
838
|
};
|
|
@@ -1000,7 +1018,7 @@ function serializeElementNode(n2, options) {
|
|
|
1000
1018
|
} catch (e2) {
|
|
1001
1019
|
}
|
|
1002
1020
|
return {
|
|
1003
|
-
type: NodeType$
|
|
1021
|
+
type: NodeType$3.Element,
|
|
1004
1022
|
tagName,
|
|
1005
1023
|
attributes,
|
|
1006
1024
|
childNodes: [],
|
|
@@ -1018,9 +1036,9 @@ function lowerIfExists(maybeAttr) {
|
|
|
1018
1036
|
}
|
|
1019
1037
|
}
|
|
1020
1038
|
function slimDOMExcluded(sn, slimDOMOptions) {
|
|
1021
|
-
if (slimDOMOptions.comment && sn.type === NodeType$
|
|
1039
|
+
if (slimDOMOptions.comment && sn.type === NodeType$3.Comment) {
|
|
1022
1040
|
return true;
|
|
1023
|
-
} else if (sn.type === NodeType$
|
|
1041
|
+
} else if (sn.type === NodeType$3.Element) {
|
|
1024
1042
|
if (slimDOMOptions.script && // script tag
|
|
1025
1043
|
(sn.tagName === "script" || // (module)preload link
|
|
1026
1044
|
sn.tagName === "link" && (sn.attributes.rel === "preload" || sn.attributes.rel === "modulepreload") && sn.attributes.as === "script" || // prefetch link
|
|
@@ -1110,7 +1128,7 @@ function serializeNodeWithId(n2, options) {
|
|
|
1110
1128
|
let id;
|
|
1111
1129
|
if (mirror2.hasNode(n2)) {
|
|
1112
1130
|
id = mirror2.getId(n2);
|
|
1113
|
-
} else if (slimDOMExcluded(_serializedNode, slimDOMOptions) || !preserveWhiteSpace && _serializedNode.type === NodeType$
|
|
1131
|
+
} else if (slimDOMExcluded(_serializedNode, slimDOMOptions) || !preserveWhiteSpace && _serializedNode.type === NodeType$3.Text && !_serializedNode.textContent.replace(/^\s+|\s+$/gm, "").length) {
|
|
1114
1132
|
id = IGNORED_NODE;
|
|
1115
1133
|
} else {
|
|
1116
1134
|
id = genId();
|
|
@@ -1124,15 +1142,15 @@ function serializeNodeWithId(n2, options) {
|
|
|
1124
1142
|
onSerialize(n2);
|
|
1125
1143
|
}
|
|
1126
1144
|
let recordChild = !skipChild;
|
|
1127
|
-
if (serializedNode.type === NodeType$
|
|
1145
|
+
if (serializedNode.type === NodeType$3.Element) {
|
|
1128
1146
|
recordChild = recordChild && !serializedNode.needBlock;
|
|
1129
1147
|
delete serializedNode.needBlock;
|
|
1130
1148
|
const shadowRootEl = index$1.shadowRoot(n2);
|
|
1131
1149
|
if (shadowRootEl && isNativeShadowDom(shadowRootEl))
|
|
1132
1150
|
serializedNode.isShadowHost = true;
|
|
1133
1151
|
}
|
|
1134
|
-
if ((serializedNode.type === NodeType$
|
|
1135
|
-
if (slimDOMOptions.headWhitespace && serializedNode.type === NodeType$
|
|
1152
|
+
if ((serializedNode.type === NodeType$3.Document || serializedNode.type === NodeType$3.Element) && recordChild) {
|
|
1153
|
+
if (slimDOMOptions.headWhitespace && serializedNode.type === NodeType$3.Element && serializedNode.tagName === "head") {
|
|
1136
1154
|
preserveWhiteSpace = false;
|
|
1137
1155
|
}
|
|
1138
1156
|
const bypassOptions = {
|
|
@@ -1161,9 +1179,9 @@ function serializeNodeWithId(n2, options) {
|
|
|
1161
1179
|
keepIframeSrcFn,
|
|
1162
1180
|
cssCaptured: false
|
|
1163
1181
|
};
|
|
1164
|
-
if (serializedNode.type === NodeType$
|
|
1182
|
+
if (serializedNode.type === NodeType$3.Element && serializedNode.tagName === "textarea" && serializedNode.attributes.value !== void 0) ;
|
|
1165
1183
|
else {
|
|
1166
|
-
if (serializedNode.type === NodeType$
|
|
1184
|
+
if (serializedNode.type === NodeType$3.Element && serializedNode.attributes._cssText !== void 0 && typeof serializedNode.attributes._cssText === "string") {
|
|
1167
1185
|
bypassOptions.cssCaptured = true;
|
|
1168
1186
|
}
|
|
1169
1187
|
for (const childN of Array.from(index$1.childNodes(n2))) {
|
|
@@ -1188,7 +1206,7 @@ function serializeNodeWithId(n2, options) {
|
|
|
1188
1206
|
if (parent && isShadowRoot(parent) && isNativeShadowDom(parent)) {
|
|
1189
1207
|
serializedNode.isShadow = true;
|
|
1190
1208
|
}
|
|
1191
|
-
if (serializedNode.type === NodeType$
|
|
1209
|
+
if (serializedNode.type === NodeType$3.Element && serializedNode.tagName === "iframe") {
|
|
1192
1210
|
onceIframeLoaded(
|
|
1193
1211
|
n2,
|
|
1194
1212
|
() => {
|
|
@@ -1230,7 +1248,7 @@ function serializeNodeWithId(n2, options) {
|
|
|
1230
1248
|
iframeLoadTimeout
|
|
1231
1249
|
);
|
|
1232
1250
|
}
|
|
1233
|
-
if (serializedNode.type === NodeType$
|
|
1251
|
+
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")) {
|
|
1234
1252
|
onceStylesheetLoaded(
|
|
1235
1253
|
n2,
|
|
1236
1254
|
() => {
|
|
@@ -5008,7 +5026,7 @@ function createCache() {
|
|
|
5008
5026
|
function applyCssSplits(n2, cssText, hackCss, cache) {
|
|
5009
5027
|
const childTextNodes = [];
|
|
5010
5028
|
for (const scn of n2.childNodes) {
|
|
5011
|
-
if (scn.type === NodeType$
|
|
5029
|
+
if (scn.type === NodeType$3.Text) {
|
|
5012
5030
|
childTextNodes.push(scn);
|
|
5013
5031
|
}
|
|
5014
5032
|
}
|
|
@@ -5039,15 +5057,15 @@ function buildNode(n2, options) {
|
|
|
5039
5057
|
var _a2;
|
|
5040
5058
|
const { doc, hackCss, cache } = options;
|
|
5041
5059
|
switch (n2.type) {
|
|
5042
|
-
case NodeType$
|
|
5060
|
+
case NodeType$3.Document:
|
|
5043
5061
|
return doc.implementation.createDocument(null, "", null);
|
|
5044
|
-
case NodeType$
|
|
5062
|
+
case NodeType$3.DocumentType:
|
|
5045
5063
|
return doc.implementation.createDocumentType(
|
|
5046
5064
|
n2.name || "html",
|
|
5047
5065
|
n2.publicId,
|
|
5048
5066
|
n2.systemId
|
|
5049
5067
|
);
|
|
5050
|
-
case NodeType$
|
|
5068
|
+
case NodeType$3.Element: {
|
|
5051
5069
|
const tagName = getTagName(n2);
|
|
5052
5070
|
let node2;
|
|
5053
5071
|
if (n2.isSVG) {
|
|
@@ -5181,14 +5199,14 @@ function buildNode(n2, options) {
|
|
|
5181
5199
|
}
|
|
5182
5200
|
return node2;
|
|
5183
5201
|
}
|
|
5184
|
-
case NodeType$
|
|
5202
|
+
case NodeType$3.Text:
|
|
5185
5203
|
if (n2.isStyle && hackCss) {
|
|
5186
5204
|
return doc.createTextNode(adaptCssForReplay(n2.textContent, cache));
|
|
5187
5205
|
}
|
|
5188
5206
|
return doc.createTextNode(n2.textContent);
|
|
5189
|
-
case NodeType$
|
|
5207
|
+
case NodeType$3.CDATA:
|
|
5190
5208
|
return doc.createCDATASection(n2.textContent);
|
|
5191
|
-
case NodeType$
|
|
5209
|
+
case NodeType$3.Comment:
|
|
5192
5210
|
return doc.createComment(n2.textContent);
|
|
5193
5211
|
default:
|
|
5194
5212
|
return null;
|
|
@@ -5215,11 +5233,11 @@ function buildNodeWithSN(n2, options) {
|
|
|
5215
5233
|
if (n2.rootId && mirror2.getNode(n2.rootId) !== doc) {
|
|
5216
5234
|
mirror2.replace(n2.rootId, doc);
|
|
5217
5235
|
}
|
|
5218
|
-
if (n2.type === NodeType$
|
|
5236
|
+
if (n2.type === NodeType$3.Document) {
|
|
5219
5237
|
doc.close();
|
|
5220
5238
|
doc.open();
|
|
5221
|
-
if (n2.compatMode === "BackCompat" && n2.childNodes && n2.childNodes[0].type !== NodeType$
|
|
5222
|
-
if (n2.childNodes[0].type === NodeType$
|
|
5239
|
+
if (n2.compatMode === "BackCompat" && n2.childNodes && n2.childNodes[0].type !== NodeType$3.DocumentType) {
|
|
5240
|
+
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") {
|
|
5223
5241
|
doc.write(
|
|
5224
5242
|
'<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "">'
|
|
5225
5243
|
);
|
|
@@ -5232,7 +5250,7 @@ function buildNodeWithSN(n2, options) {
|
|
|
5232
5250
|
node2 = doc;
|
|
5233
5251
|
}
|
|
5234
5252
|
mirror2.add(node2, n2);
|
|
5235
|
-
if ((n2.type === NodeType$
|
|
5253
|
+
if ((n2.type === NodeType$3.Document || n2.type === NodeType$3.Element) && !skipChild) {
|
|
5236
5254
|
for (const childN of n2.childNodes) {
|
|
5237
5255
|
const childNode = buildNodeWithSN(childN, {
|
|
5238
5256
|
doc,
|
|
@@ -5248,7 +5266,7 @@ function buildNodeWithSN(n2, options) {
|
|
|
5248
5266
|
}
|
|
5249
5267
|
if (childN.isShadow && isElement(node2) && node2.shadowRoot) {
|
|
5250
5268
|
node2.shadowRoot.appendChild(childNode);
|
|
5251
|
-
} else if (n2.type === NodeType$
|
|
5269
|
+
} else if (n2.type === NodeType$3.Document && childN.type == NodeType$3.Element) {
|
|
5252
5270
|
const htmlElement = childNode;
|
|
5253
5271
|
let body = null;
|
|
5254
5272
|
htmlElement.childNodes.forEach((child) => {
|
|
@@ -5283,7 +5301,7 @@ function visit(mirror2, onVisit) {
|
|
|
5283
5301
|
}
|
|
5284
5302
|
function handleScroll(node2, mirror2) {
|
|
5285
5303
|
const n2 = mirror2.getMeta(node2);
|
|
5286
|
-
if ((n2 == null ? void 0 : n2.type) !== NodeType$
|
|
5304
|
+
if ((n2 == null ? void 0 : n2.type) !== NodeType$3.Element) {
|
|
5287
5305
|
return;
|
|
5288
5306
|
}
|
|
5289
5307
|
const el = node2;
|
|
@@ -5331,15 +5349,6 @@ var __publicField2 = (obj, key, value) => __defNormalProp2(obj, typeof key !== "
|
|
|
5331
5349
|
var __defProp22 = Object.defineProperty;
|
|
5332
5350
|
var __defNormalProp22 = (obj, key, value) => key in obj ? __defProp22(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
|
|
5333
5351
|
var __publicField22 = (obj, key, value) => __defNormalProp22(obj, typeof key !== "symbol" ? key + "" : key, value);
|
|
5334
|
-
var NodeType$1 = /* @__PURE__ */ ((NodeType2) => {
|
|
5335
|
-
NodeType2[NodeType2["Document"] = 0] = "Document";
|
|
5336
|
-
NodeType2[NodeType2["DocumentType"] = 1] = "DocumentType";
|
|
5337
|
-
NodeType2[NodeType2["Element"] = 2] = "Element";
|
|
5338
|
-
NodeType2[NodeType2["Text"] = 3] = "Text";
|
|
5339
|
-
NodeType2[NodeType2["CDATA"] = 4] = "CDATA";
|
|
5340
|
-
NodeType2[NodeType2["Comment"] = 5] = "Comment";
|
|
5341
|
-
return NodeType2;
|
|
5342
|
-
})(NodeType$1 || {});
|
|
5343
5352
|
let Mirror$1 = class Mirror2 {
|
|
5344
5353
|
constructor() {
|
|
5345
5354
|
__publicField22(this, "idNodeMap", /* @__PURE__ */ new Map());
|
|
@@ -8947,6 +8956,15 @@ postcss$1.Input;
|
|
|
8947
8956
|
postcss$1.Rule;
|
|
8948
8957
|
postcss$1.Root;
|
|
8949
8958
|
postcss$1.Node;
|
|
8959
|
+
var NodeType$1 = /* @__PURE__ */ ((NodeType2) => {
|
|
8960
|
+
NodeType2[NodeType2["Document"] = 0] = "Document";
|
|
8961
|
+
NodeType2[NodeType2["DocumentType"] = 1] = "DocumentType";
|
|
8962
|
+
NodeType2[NodeType2["Element"] = 2] = "Element";
|
|
8963
|
+
NodeType2[NodeType2["Text"] = 3] = "Text";
|
|
8964
|
+
NodeType2[NodeType2["CDATA"] = 4] = "CDATA";
|
|
8965
|
+
NodeType2[NodeType2["Comment"] = 5] = "Comment";
|
|
8966
|
+
return NodeType2;
|
|
8967
|
+
})(NodeType$1 || {});
|
|
8950
8968
|
function parseCSSText(cssText) {
|
|
8951
8969
|
const res = {};
|
|
8952
8970
|
const listDelimiter = /;(?![^(]*\))/g;
|
|
@@ -9456,7 +9474,7 @@ function removeChild(parent, child) {
|
|
|
9456
9474
|
child.parentNode = null;
|
|
9457
9475
|
return child;
|
|
9458
9476
|
}
|
|
9459
|
-
var NodeType = /* @__PURE__ */ ((NodeType2) => {
|
|
9477
|
+
var NodeType$2 = /* @__PURE__ */ ((NodeType2) => {
|
|
9460
9478
|
NodeType2[NodeType2["PLACEHOLDER"] = 0] = "PLACEHOLDER";
|
|
9461
9479
|
NodeType2[NodeType2["ELEMENT_NODE"] = 1] = "ELEMENT_NODE";
|
|
9462
9480
|
NodeType2[NodeType2["ATTRIBUTE_NODE"] = 2] = "ATTRIBUTE_NODE";
|
|
@@ -9470,7 +9488,7 @@ var NodeType = /* @__PURE__ */ ((NodeType2) => {
|
|
|
9470
9488
|
NodeType2[NodeType2["DOCUMENT_TYPE_NODE"] = 10] = "DOCUMENT_TYPE_NODE";
|
|
9471
9489
|
NodeType2[NodeType2["DOCUMENT_FRAGMENT_NODE"] = 11] = "DOCUMENT_FRAGMENT_NODE";
|
|
9472
9490
|
return NodeType2;
|
|
9473
|
-
})(NodeType || {});
|
|
9491
|
+
})(NodeType$2 || {});
|
|
9474
9492
|
const NAMESPACES = {
|
|
9475
9493
|
svg: "http://www.w3.org/2000/svg",
|
|
9476
9494
|
"xlink:href": "http://www.w3.org/1999/xlink",
|
|
@@ -10029,7 +10047,7 @@ function getValidTagName(element) {
|
|
|
10029
10047
|
function buildFromNode(node2, rrdom, domMirror, parentRRNode) {
|
|
10030
10048
|
let rrNode;
|
|
10031
10049
|
switch (node2.nodeType) {
|
|
10032
|
-
case NodeType.DOCUMENT_NODE:
|
|
10050
|
+
case NodeType$2.DOCUMENT_NODE:
|
|
10033
10051
|
if (parentRRNode && parentRRNode.nodeName === "IFRAME")
|
|
10034
10052
|
rrNode = parentRRNode.contentDocument;
|
|
10035
10053
|
else {
|
|
@@ -10037,7 +10055,7 @@ function buildFromNode(node2, rrdom, domMirror, parentRRNode) {
|
|
|
10037
10055
|
rrNode.compatMode = node2.compatMode;
|
|
10038
10056
|
}
|
|
10039
10057
|
break;
|
|
10040
|
-
case NodeType.DOCUMENT_TYPE_NODE: {
|
|
10058
|
+
case NodeType$2.DOCUMENT_TYPE_NODE: {
|
|
10041
10059
|
const documentType = node2;
|
|
10042
10060
|
rrNode = rrdom.createDocumentType(
|
|
10043
10061
|
documentType.name,
|
|
@@ -10046,7 +10064,7 @@ function buildFromNode(node2, rrdom, domMirror, parentRRNode) {
|
|
|
10046
10064
|
);
|
|
10047
10065
|
break;
|
|
10048
10066
|
}
|
|
10049
|
-
case NodeType.ELEMENT_NODE: {
|
|
10067
|
+
case NodeType$2.ELEMENT_NODE: {
|
|
10050
10068
|
const elementNode = node2;
|
|
10051
10069
|
const tagName = getValidTagName(elementNode);
|
|
10052
10070
|
rrNode = rrdom.createElement(tagName);
|
|
@@ -10058,16 +10076,16 @@ function buildFromNode(node2, rrdom, domMirror, parentRRNode) {
|
|
|
10058
10076
|
elementNode.scrollTop && (rrElement.scrollTop = elementNode.scrollTop);
|
|
10059
10077
|
break;
|
|
10060
10078
|
}
|
|
10061
|
-
case NodeType.TEXT_NODE:
|
|
10079
|
+
case NodeType$2.TEXT_NODE:
|
|
10062
10080
|
rrNode = rrdom.createTextNode(node2.textContent || "");
|
|
10063
10081
|
break;
|
|
10064
|
-
case NodeType.CDATA_SECTION_NODE:
|
|
10082
|
+
case NodeType$2.CDATA_SECTION_NODE:
|
|
10065
10083
|
rrNode = rrdom.createCDATASection(node2.data);
|
|
10066
10084
|
break;
|
|
10067
|
-
case NodeType.COMMENT_NODE:
|
|
10085
|
+
case NodeType$2.COMMENT_NODE:
|
|
10068
10086
|
rrNode = rrdom.createComment(node2.textContent || "");
|
|
10069
10087
|
break;
|
|
10070
|
-
case NodeType.DOCUMENT_FRAGMENT_NODE:
|
|
10088
|
+
case NodeType$2.DOCUMENT_FRAGMENT_NODE:
|
|
10071
10089
|
rrNode = parentRRNode.attachShadow({ mode: "open" });
|
|
10072
10090
|
break;
|
|
10073
10091
|
default:
|
|
@@ -10090,7 +10108,7 @@ function buildFromDom(dom, domMirror = createMirror$1(), rrdom = new RRDocument(
|
|
|
10090
10108
|
if (
|
|
10091
10109
|
// if the parentRRNode isn't a RRIFrameElement
|
|
10092
10110
|
(parentRRNode == null ? void 0 : parentRRNode.nodeName) !== "IFRAME" && // if node isn't a shadow root
|
|
10093
|
-
node2.nodeType !== NodeType.DOCUMENT_FRAGMENT_NODE
|
|
10111
|
+
node2.nodeType !== NodeType$2.DOCUMENT_FRAGMENT_NODE
|
|
10094
10112
|
) {
|
|
10095
10113
|
parentRRNode == null ? void 0 : parentRRNode.appendChild(rrNode);
|
|
10096
10114
|
rrNode.parentNode = parentRRNode;
|
|
@@ -10099,8 +10117,8 @@ function buildFromDom(dom, domMirror = createMirror$1(), rrdom = new RRDocument(
|
|
|
10099
10117
|
if (node2.nodeName === "IFRAME") {
|
|
10100
10118
|
const iframeDoc = node2.contentDocument;
|
|
10101
10119
|
iframeDoc && walk2(iframeDoc, rrNode);
|
|
10102
|
-
} else if (node2.nodeType === NodeType.DOCUMENT_NODE || node2.nodeType === NodeType.ELEMENT_NODE || node2.nodeType === NodeType.DOCUMENT_FRAGMENT_NODE) {
|
|
10103
|
-
if (node2.nodeType === NodeType.ELEMENT_NODE && node2.shadowRoot)
|
|
10120
|
+
} else if (node2.nodeType === NodeType$2.DOCUMENT_NODE || node2.nodeType === NodeType$2.ELEMENT_NODE || node2.nodeType === NodeType$2.DOCUMENT_FRAGMENT_NODE) {
|
|
10121
|
+
if (node2.nodeType === NodeType$2.ELEMENT_NODE && node2.shadowRoot)
|
|
10104
10122
|
walk2(node2.shadowRoot, rrNode);
|
|
10105
10123
|
node2.childNodes.forEach((childNode) => walk2(childNode, rrNode));
|
|
10106
10124
|
}
|
|
@@ -10224,6 +10242,9 @@ const testableMethods = {
|
|
|
10224
10242
|
MutationObserver: ["constructor"]
|
|
10225
10243
|
};
|
|
10226
10244
|
const untaintedBasePrototype = {};
|
|
10245
|
+
const isAngularZonePresent = () => {
|
|
10246
|
+
return !!globalThis.Zone;
|
|
10247
|
+
};
|
|
10227
10248
|
function getUntaintedPrototype(key) {
|
|
10228
10249
|
if (untaintedBasePrototype[key])
|
|
10229
10250
|
return untaintedBasePrototype[key];
|
|
@@ -10251,7 +10272,7 @@ function getUntaintedPrototype(key) {
|
|
|
10251
10272
|
}
|
|
10252
10273
|
)
|
|
10253
10274
|
);
|
|
10254
|
-
if (isUntaintedAccessors && isUntaintedMethods) {
|
|
10275
|
+
if (isUntaintedAccessors && isUntaintedMethods && !isAngularZonePresent()) {
|
|
10255
10276
|
untaintedBasePrototype[key] = defaultObj.prototype;
|
|
10256
10277
|
return defaultObj.prototype;
|
|
10257
10278
|
}
|
|
@@ -10833,6 +10854,15 @@ var ReplayerEvents = /* @__PURE__ */ ((ReplayerEvents2) => {
|
|
|
10833
10854
|
ReplayerEvents2["Destroy"] = "destroy";
|
|
10834
10855
|
return ReplayerEvents2;
|
|
10835
10856
|
})(ReplayerEvents || {});
|
|
10857
|
+
var NodeType = /* @__PURE__ */ ((NodeType2) => {
|
|
10858
|
+
NodeType2[NodeType2["Document"] = 0] = "Document";
|
|
10859
|
+
NodeType2[NodeType2["DocumentType"] = 1] = "DocumentType";
|
|
10860
|
+
NodeType2[NodeType2["Element"] = 2] = "Element";
|
|
10861
|
+
NodeType2[NodeType2["Text"] = 3] = "Text";
|
|
10862
|
+
NodeType2[NodeType2["CDATA"] = 4] = "CDATA";
|
|
10863
|
+
NodeType2[NodeType2["Comment"] = 5] = "Comment";
|
|
10864
|
+
return NodeType2;
|
|
10865
|
+
})(NodeType || {});
|
|
10836
10866
|
function isNodeInLinkedList(n2) {
|
|
10837
10867
|
return "__ln" in n2;
|
|
10838
10868
|
}
|
|
@@ -12769,7 +12799,7 @@ class IframeManager {
|
|
|
12769
12799
|
}
|
|
12770
12800
|
}
|
|
12771
12801
|
patchRootIdOnNode(node2, rootId) {
|
|
12772
|
-
if (node2.type !== NodeType
|
|
12802
|
+
if (node2.type !== NodeType.Document && !node2.rootId) node2.rootId = rootId;
|
|
12773
12803
|
if ("childNodes" in node2) {
|
|
12774
12804
|
node2.childNodes.forEach((child) => {
|
|
12775
12805
|
this.patchRootIdOnNode(child, rootId);
|
|
@@ -15856,7 +15886,7 @@ class Replayer {
|
|
|
15856
15886
|
collectedDialogs.add(builtNode);
|
|
15857
15887
|
this.collectIframeAndAttachDocument(collectedIframes, builtNode);
|
|
15858
15888
|
const sn = mirror2.getMeta(builtNode);
|
|
15859
|
-
if ((sn == null ? void 0 : sn.type) === NodeType
|
|
15889
|
+
if ((sn == null ? void 0 : sn.type) === NodeType.Element && (sn == null ? void 0 : sn.tagName.toUpperCase()) === "HTML") {
|
|
15860
15890
|
const { documentElement, head } = iframeEl.contentDocument;
|
|
15861
15891
|
this.insertStyleRules(
|
|
15862
15892
|
documentElement,
|
|
@@ -16332,7 +16362,7 @@ class Replayer {
|
|
|
16332
16362
|
mutation.parentId
|
|
16333
16363
|
);
|
|
16334
16364
|
if (!parent) {
|
|
16335
|
-
if (mutation.node.type === NodeType
|
|
16365
|
+
if (mutation.node.type === NodeType.Document) {
|
|
16336
16366
|
return this.newDocumentQueue.push(mutation);
|
|
16337
16367
|
}
|
|
16338
16368
|
return queue.push(mutation);
|
|
@@ -16394,7 +16424,7 @@ class Replayer {
|
|
|
16394
16424
|
return;
|
|
16395
16425
|
}
|
|
16396
16426
|
const parentSn = mirror2.getMeta(parent);
|
|
16397
|
-
if (parentSn && parentSn.type === NodeType
|
|
16427
|
+
if (parentSn && parentSn.type === NodeType.Element && mutation.node.type === NodeType.Text) {
|
|
16398
16428
|
const prospectiveSiblings = Array.isArray(parent.childNodes) ? parent.childNodes : Array.from(parent.childNodes);
|
|
16399
16429
|
if (parentSn.tagName === "textarea") {
|
|
16400
16430
|
for (const c2 of prospectiveSiblings) {
|
|
@@ -16410,9 +16440,9 @@ class Replayer {
|
|
|
16410
16440
|
}
|
|
16411
16441
|
}
|
|
16412
16442
|
}
|
|
16413
|
-
} else if ((parentSn == null ? void 0 : parentSn.type) === NodeType
|
|
16443
|
+
} else if ((parentSn == null ? void 0 : parentSn.type) === NodeType.Document) {
|
|
16414
16444
|
const parentDoc = parent;
|
|
16415
|
-
if (mutation.node.type === NodeType
|
|
16445
|
+
if (mutation.node.type === NodeType.DocumentType && ((_a2 = parentDoc.childNodes[0]) == null ? void 0 : _a2.nodeType) === Node.DOCUMENT_TYPE_NODE)
|
|
16416
16446
|
parentDoc.removeChild(parentDoc.childNodes[0]);
|
|
16417
16447
|
if (target.nodeName === "HTML" && parentDoc.documentElement)
|
|
16418
16448
|
parentDoc.removeChild(
|
|
@@ -16618,7 +16648,7 @@ class Replayer {
|
|
|
16618
16648
|
left: d.x,
|
|
16619
16649
|
behavior: isSync ? "auto" : "smooth"
|
|
16620
16650
|
});
|
|
16621
|
-
} else if ((sn == null ? void 0 : sn.type) === NodeType
|
|
16651
|
+
} else if ((sn == null ? void 0 : sn.type) === NodeType.Document) {
|
|
16622
16652
|
(_b = target.defaultView) == null ? void 0 : _b.scrollTo({
|
|
16623
16653
|
top: d.y,
|
|
16624
16654
|
left: d.x,
|