@screeb/rrweb 1.0.6 → 1.0.8
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 +124 -72
- 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 +124 -72
- package/dist/rrweb.js.map +1 -1
- package/dist/rrweb.umd.cjs +124 -72
- 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
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"image-bitmap-data-url-worker-IJpC7g_b.js","sources":["../../../node_modules/base64-arraybuffer/dist/base64-arraybuffer.es5.js","../src/record/workers/image-bitmap-data-url-worker.ts"],"sourcesContent":["/*\n * base64-arraybuffer 1.0.2 <https://github.com/niklasvh/base64-arraybuffer>\n * Copyright (c) 2022 Niklas von Hertzen <https://hertzen.com>\n * Released under MIT License\n */\nvar chars = 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/';\n// Use a lookup table to find the index.\nvar lookup = typeof Uint8Array === 'undefined' ? [] : new Uint8Array(256);\nfor (var i = 0; i < chars.length; i++) {\n lookup[chars.charCodeAt(i)] = i;\n}\nvar encode = function (arraybuffer) {\n var bytes = new Uint8Array(arraybuffer), i, len = bytes.length, base64 = '';\n for (i = 0; i < len; i += 3) {\n base64 += chars[bytes[i] >> 2];\n base64 += chars[((bytes[i] & 3) << 4) | (bytes[i + 1] >> 4)];\n base64 += chars[((bytes[i + 1] & 15) << 2) | (bytes[i + 2] >> 6)];\n base64 += chars[bytes[i + 2] & 63];\n }\n if (len % 3 === 2) {\n base64 = base64.substring(0, base64.length - 1) + '=';\n }\n else if (len % 3 === 1) {\n base64 = base64.substring(0, base64.length - 2) + '==';\n }\n return base64;\n};\nvar decode = function (base64) {\n var bufferLength = base64.length * 0.75, len = base64.length, i, p = 0, encoded1, encoded2, encoded3, encoded4;\n if (base64[base64.length - 1] === '=') {\n bufferLength--;\n if (base64[base64.length - 2] === '=') {\n bufferLength--;\n }\n }\n var arraybuffer = new ArrayBuffer(bufferLength), bytes = new Uint8Array(arraybuffer);\n for (i = 0; i < len; i += 4) {\n encoded1 = lookup[base64.charCodeAt(i)];\n encoded2 = lookup[base64.charCodeAt(i + 1)];\n encoded3 = lookup[base64.charCodeAt(i + 2)];\n encoded4 = lookup[base64.charCodeAt(i + 3)];\n bytes[p++] = (encoded1 << 2) | (encoded2 >> 4);\n bytes[p++] = ((encoded2 & 15) << 4) | (encoded3 >> 2);\n bytes[p++] = ((encoded3 & 3) << 6) | (encoded4 & 63);\n }\n return arraybuffer;\n};\n\nexport { decode, encode };\n//# sourceMappingURL=base64-arraybuffer.es5.js.map\n","import { encode } from 'base64-arraybuffer';\nimport type {
|
|
1
|
+
{"version":3,"file":"image-bitmap-data-url-worker-IJpC7g_b.js","sources":["../../../node_modules/base64-arraybuffer/dist/base64-arraybuffer.es5.js","../src/record/workers/image-bitmap-data-url-worker.ts"],"sourcesContent":["/*\n * base64-arraybuffer 1.0.2 <https://github.com/niklasvh/base64-arraybuffer>\n * Copyright (c) 2022 Niklas von Hertzen <https://hertzen.com>\n * Released under MIT License\n */\nvar chars = 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/';\n// Use a lookup table to find the index.\nvar lookup = typeof Uint8Array === 'undefined' ? [] : new Uint8Array(256);\nfor (var i = 0; i < chars.length; i++) {\n lookup[chars.charCodeAt(i)] = i;\n}\nvar encode = function (arraybuffer) {\n var bytes = new Uint8Array(arraybuffer), i, len = bytes.length, base64 = '';\n for (i = 0; i < len; i += 3) {\n base64 += chars[bytes[i] >> 2];\n base64 += chars[((bytes[i] & 3) << 4) | (bytes[i + 1] >> 4)];\n base64 += chars[((bytes[i + 1] & 15) << 2) | (bytes[i + 2] >> 6)];\n base64 += chars[bytes[i + 2] & 63];\n }\n if (len % 3 === 2) {\n base64 = base64.substring(0, base64.length - 1) + '=';\n }\n else if (len % 3 === 1) {\n base64 = base64.substring(0, base64.length - 2) + '==';\n }\n return base64;\n};\nvar decode = function (base64) {\n var bufferLength = base64.length * 0.75, len = base64.length, i, p = 0, encoded1, encoded2, encoded3, encoded4;\n if (base64[base64.length - 1] === '=') {\n bufferLength--;\n if (base64[base64.length - 2] === '=') {\n bufferLength--;\n }\n }\n var arraybuffer = new ArrayBuffer(bufferLength), bytes = new Uint8Array(arraybuffer);\n for (i = 0; i < len; i += 4) {\n encoded1 = lookup[base64.charCodeAt(i)];\n encoded2 = lookup[base64.charCodeAt(i + 1)];\n encoded3 = lookup[base64.charCodeAt(i + 2)];\n encoded4 = lookup[base64.charCodeAt(i + 3)];\n bytes[p++] = (encoded1 << 2) | (encoded2 >> 4);\n bytes[p++] = ((encoded2 & 15) << 4) | (encoded3 >> 2);\n bytes[p++] = ((encoded3 & 3) << 6) | (encoded4 & 63);\n }\n return arraybuffer;\n};\n\nexport { decode, encode };\n//# sourceMappingURL=base64-arraybuffer.es5.js.map\n","import { encode } from 'base64-arraybuffer';\nimport type {\n DataURLOptions,\n ImageBitmapDataURLWorkerParams,\n ImageBitmapDataURLWorkerResponse,\n} from '@rrweb/types';\n\nconst lastBlobMap: Map<number, string> = new Map();\nconst transparentBlobMap: Map<string, string> = new Map();\n\nexport interface ImageBitmapDataURLRequestWorker {\n postMessage: (\n message: ImageBitmapDataURLWorkerParams,\n transfer?: [ImageBitmap],\n ) => void;\n onmessage: (message: MessageEvent<ImageBitmapDataURLWorkerResponse>) => void;\n}\n\ninterface ImageBitmapDataURLResponseWorker {\n onmessage:\n | null\n | ((message: MessageEvent<ImageBitmapDataURLWorkerParams>) => void);\n postMessage(e: ImageBitmapDataURLWorkerResponse): void;\n}\n\nasync function getTransparentBlobFor(\n width: number,\n height: number,\n dataURLOptions: DataURLOptions,\n): Promise<string> {\n const id = `${width}-${height}`;\n if ('OffscreenCanvas' in globalThis) {\n if (transparentBlobMap.has(id)) return transparentBlobMap.get(id)!;\n const offscreen = new OffscreenCanvas(width, height);\n offscreen.getContext('2d'); // creates rendering context for `converToBlob`\n const blob = await offscreen.convertToBlob(dataURLOptions); // takes a while\n const arrayBuffer = await blob.arrayBuffer();\n const base64 = encode(arrayBuffer); // cpu intensive\n transparentBlobMap.set(id, base64);\n return base64;\n } else {\n return '';\n }\n}\n\n// `as any` because: https://github.com/Microsoft/TypeScript/issues/20595\nconst worker: ImageBitmapDataURLResponseWorker = self;\n\n// eslint-disable-next-line @typescript-eslint/no-misused-promises\nworker.onmessage = async function (e) {\n if ('OffscreenCanvas' in globalThis) {\n const { id, bitmap, width, height, dataURLOptions } = e.data;\n\n const transparentBase64 = getTransparentBlobFor(\n width,\n height,\n dataURLOptions,\n );\n\n const offscreen = new OffscreenCanvas(width, height);\n const ctx = offscreen.getContext('2d')!;\n\n ctx.drawImage(bitmap, 0, 0);\n bitmap.close();\n const blob = await offscreen.convertToBlob(dataURLOptions); // takes a while\n const type = blob.type;\n const arrayBuffer = await blob.arrayBuffer();\n const base64 = encode(arrayBuffer); // cpu intensive\n\n // on first try we should check if canvas is transparent,\n // no need to save it's contents in that case\n if (!lastBlobMap.has(id) && (await transparentBase64) === base64) {\n lastBlobMap.set(id, base64);\n return worker.postMessage({ id });\n }\n\n if (lastBlobMap.get(id) === base64) return worker.postMessage({ id }); // unchanged\n worker.postMessage({\n id,\n type,\n base64,\n width,\n height,\n });\n lastBlobMap.set(id, base64);\n } else {\n return worker.postMessage({ id: e.data.id });\n }\n};\n"],"names":["i"],"mappings":";;AAKA,MAAI,QAAQ;AAEZ,MAAI,SAAS,OAAO,eAAe,cAAc,CAAE,IAAG,IAAI,WAAW,GAAG;AACxE,WAAS,IAAI,GAAG,IAAI,MAAM,QAAQ,KAAK;AACnC,WAAO,MAAM,WAAW,CAAC,CAAC,IAAI;AAAA,EAClC;AACA,MAAI,SAAS,SAAU,aAAa;AAChC,QAAI,QAAQ,IAAI,WAAW,WAAW,GAAGA,IAAG,MAAM,MAAM,QAAQ,SAAS;AACzE,SAAKA,KAAI,GAAGA,KAAI,KAAKA,MAAK,GAAG;AACzB,gBAAU,MAAM,MAAMA,EAAC,KAAK,CAAC;AAC7B,gBAAU,OAAQ,MAAMA,EAAC,IAAI,MAAM,IAAM,MAAMA,KAAI,CAAC,KAAK,CAAE;AAC3D,gBAAU,OAAQ,MAAMA,KAAI,CAAC,IAAI,OAAO,IAAM,MAAMA,KAAI,CAAC,KAAK,CAAE;AAChE,gBAAU,MAAM,MAAMA,KAAI,CAAC,IAAI,EAAE;AAAA,IACpC;AACD,QAAI,MAAM,MAAM,GAAG;AACf,eAAS,OAAO,UAAU,GAAG,OAAO,SAAS,CAAC,IAAI;AAAA,IACrD,WACQ,MAAM,MAAM,GAAG;AACpB,eAAS,OAAO,UAAU,GAAG,OAAO,SAAS,CAAC,IAAI;AAAA,IACrD;AACD,WAAO;AAAA,EACX;ACnBA,QAAM,kCAAuC;AAC7C,QAAM,yCAA8C;AAiBpD,iBAAe,sBACb,OACA,QACA,gBACiB;AACjB,UAAM,KAAK,GAAG,KAAK,IAAI,MAAM;AAC7B,QAAI,qBAAqB,YAAY;AACnC,UAAI,mBAAmB,IAAI,EAAE,EAAU,QAAA,mBAAmB,IAAI,EAAE;AAChE,YAAM,YAAY,IAAI,gBAAgB,OAAO,MAAM;AACnD,gBAAU,WAAW,IAAI;AACzB,YAAM,OAAO,MAAM,UAAU,cAAc,cAAc;AACnD,YAAA,cAAc,MAAM,KAAK;AACzB,YAAA,SAAS,OAAO,WAAW;AACd,yBAAA,IAAI,IAAI,MAAM;AAC1B,aAAA;AAAA,IAAA,OACF;AACE,aAAA;AAAA,IACT;AAAA,EACF;AAGA,QAAM,SAA2C;AAGjD,SAAO,YAAY,eAAgB,GAAG;AACpC,QAAI,qBAAqB,YAAY;AACnC,YAAM,EAAE,IAAI,QAAQ,OAAO,QAAQ,mBAAmB,EAAE;AAExD,YAAM,oBAAoB;AAAA,QACxB;AAAA,QACA;AAAA,QACA;AAAA,MAAA;AAGF,YAAM,YAAY,IAAI,gBAAgB,OAAO,MAAM;AAC7C,YAAA,MAAM,UAAU,WAAW,IAAI;AAEjC,UAAA,UAAU,QAAQ,GAAG,CAAC;AAC1B,aAAO,MAAM;AACb,YAAM,OAAO,MAAM,UAAU,cAAc,cAAc;AACzD,YAAM,OAAO,KAAK;AACZ,YAAA,cAAc,MAAM,KAAK;AACzB,YAAA,SAAS,OAAO,WAAW;AAIjC,UAAI,CAAC,YAAY,IAAI,EAAE,KAAM,MAAM,sBAAuB,QAAQ;AACpD,oBAAA,IAAI,IAAI,MAAM;AAC1B,eAAO,OAAO,YAAY,EAAE,GAAI,CAAA;AAAA,MAClC;AAEI,UAAA,YAAY,IAAI,EAAE,MAAM,eAAe,OAAO,YAAY,EAAE,GAAA,CAAI;AACpE,aAAO,YAAY;AAAA,QACjB;AAAA,QACA;AAAA,QACA;AAAA,QACA;AAAA,QACA;AAAA,MAAA,CACD;AACW,kBAAA,IAAI,IAAI,MAAM;AAAA,IAAA,OACrB;AACL,aAAO,OAAO,YAAY,EAAE,IAAI,EAAE,KAAK,IAAI;AAAA,IAC7C;AAAA,EACF;;","x_google_ignoreList":[0]}
|
package/dist/rrweb.cjs
CHANGED
|
@@ -7,7 +7,7 @@ Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
|
7
7
|
var __defProp$1 = Object.defineProperty;
|
|
8
8
|
var __defNormalProp$1 = (obj, key, value) => key in obj ? __defProp$1(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
|
|
9
9
|
var __publicField$1 = (obj, key, value) => __defNormalProp$1(obj, typeof key !== "symbol" ? key + "" : key, value);
|
|
10
|
-
var NodeType$
|
|
10
|
+
var NodeType$3 = /* @__PURE__ */ ((NodeType2) => {
|
|
11
11
|
NodeType2[NodeType2["Document"] = 0] = "Document";
|
|
12
12
|
NodeType2[NodeType2["DocumentType"] = 1] = "DocumentType";
|
|
13
13
|
NodeType2[NodeType2["Element"] = 2] = "Element";
|
|
@@ -15,7 +15,7 @@ var NodeType$2 = /* @__PURE__ */ ((NodeType2) => {
|
|
|
15
15
|
NodeType2[NodeType2["CDATA"] = 4] = "CDATA";
|
|
16
16
|
NodeType2[NodeType2["Comment"] = 5] = "Comment";
|
|
17
17
|
return NodeType2;
|
|
18
|
-
})(NodeType$
|
|
18
|
+
})(NodeType$3 || {});
|
|
19
19
|
const testableAccessors$1 = {
|
|
20
20
|
Node: ["childNodes", "parentNode", "parentElement", "textContent"],
|
|
21
21
|
ShadowRoot: ["host", "styleSheets"],
|
|
@@ -29,6 +29,9 @@ const testableMethods$1 = {
|
|
|
29
29
|
MutationObserver: ["constructor"]
|
|
30
30
|
};
|
|
31
31
|
const untaintedBasePrototype$1 = {};
|
|
32
|
+
const isAngularZonePresent$1 = () => {
|
|
33
|
+
return !!globalThis.Zone;
|
|
34
|
+
};
|
|
32
35
|
function getUntaintedPrototype$1(key) {
|
|
33
36
|
if (untaintedBasePrototype$1[key])
|
|
34
37
|
return untaintedBasePrototype$1[key];
|
|
@@ -56,7 +59,7 @@ function getUntaintedPrototype$1(key) {
|
|
|
56
59
|
}
|
|
57
60
|
)
|
|
58
61
|
);
|
|
59
|
-
if (isUntaintedAccessors && isUntaintedMethods) {
|
|
62
|
+
if (isUntaintedAccessors && isUntaintedMethods && !isAngularZonePresent$1()) {
|
|
60
63
|
untaintedBasePrototype$1[key] = defaultObj.prototype;
|
|
61
64
|
return defaultObj.prototype;
|
|
62
65
|
}
|
|
@@ -358,13 +361,13 @@ function is2DCanvasBlank(canvas) {
|
|
|
358
361
|
}
|
|
359
362
|
function isNodeMetaEqual(a2, b) {
|
|
360
363
|
if (!a2 || !b || a2.type !== b.type) return false;
|
|
361
|
-
if (a2.type === NodeType$
|
|
364
|
+
if (a2.type === NodeType$3.Document)
|
|
362
365
|
return a2.compatMode === b.compatMode;
|
|
363
|
-
else if (a2.type === NodeType$
|
|
366
|
+
else if (a2.type === NodeType$3.DocumentType)
|
|
364
367
|
return a2.name === b.name && a2.publicId === b.publicId && a2.systemId === b.systemId;
|
|
365
|
-
else if (a2.type === NodeType$
|
|
368
|
+
else if (a2.type === NodeType$3.Comment || a2.type === NodeType$3.Text || a2.type === NodeType$3.CDATA)
|
|
366
369
|
return a2.textContent === b.textContent;
|
|
367
|
-
else if (a2.type === NodeType$
|
|
370
|
+
else if (a2.type === NodeType$3.Element)
|
|
368
371
|
return a2.tagName === b.tagName && JSON.stringify(a2.attributes) === JSON.stringify(b.attributes) && a2.isSVG === b.isSVG && a2.needBlock === b.needBlock;
|
|
369
372
|
return false;
|
|
370
373
|
}
|
|
@@ -440,20 +443,57 @@ function normalizeCssString(cssText) {
|
|
|
440
443
|
function splitCssText(cssText, style) {
|
|
441
444
|
const childNodes2 = Array.from(style.childNodes);
|
|
442
445
|
const splits = [];
|
|
446
|
+
let iterLimit = 0;
|
|
443
447
|
if (childNodes2.length > 1 && cssText && typeof cssText === "string") {
|
|
444
|
-
|
|
448
|
+
let cssTextNorm = normalizeCssString(cssText);
|
|
449
|
+
const normFactor = cssTextNorm.length / cssText.length;
|
|
445
450
|
for (let i2 = 1; i2 < childNodes2.length; i2++) {
|
|
446
451
|
if (childNodes2[i2].textContent && typeof childNodes2[i2].textContent === "string") {
|
|
447
452
|
const textContentNorm = normalizeCssString(childNodes2[i2].textContent);
|
|
448
|
-
|
|
453
|
+
let j = 3;
|
|
454
|
+
for (; j < textContentNorm.length; j++) {
|
|
455
|
+
if (
|
|
456
|
+
// keep consuming css identifiers (to get a decent chunk more quickly)
|
|
457
|
+
textContentNorm[j].match(/[a-zA-Z0-9]/) || // substring needs to be unique to this section
|
|
458
|
+
textContentNorm.indexOf(textContentNorm.substring(0, j), 1) !== -1
|
|
459
|
+
) {
|
|
460
|
+
continue;
|
|
461
|
+
}
|
|
462
|
+
break;
|
|
463
|
+
}
|
|
464
|
+
for (; j < textContentNorm.length; j++) {
|
|
449
465
|
const bit = textContentNorm.substring(0, j);
|
|
450
|
-
|
|
451
|
-
|
|
452
|
-
|
|
453
|
-
|
|
466
|
+
const bits = cssTextNorm.split(bit);
|
|
467
|
+
let splitNorm = -1;
|
|
468
|
+
if (bits.length === 2) {
|
|
469
|
+
splitNorm = cssTextNorm.indexOf(bit);
|
|
470
|
+
} else if (bits.length > 2 && bits[0] === "" && childNodes2[i2 - 1].textContent !== "") {
|
|
471
|
+
splitNorm = cssTextNorm.indexOf(bit, 1);
|
|
472
|
+
}
|
|
473
|
+
if (splitNorm !== -1) {
|
|
474
|
+
let k = Math.floor(splitNorm / normFactor);
|
|
475
|
+
for (; k > 0 && k < cssText.length; ) {
|
|
476
|
+
iterLimit += 1;
|
|
477
|
+
if (iterLimit > 50 * childNodes2.length) {
|
|
478
|
+
splits.push(cssText);
|
|
479
|
+
return splits;
|
|
480
|
+
}
|
|
481
|
+
const normPart = normalizeCssString(cssText.substring(0, k));
|
|
482
|
+
if (normPart.length === splitNorm) {
|
|
454
483
|
splits.push(cssText.substring(0, k));
|
|
455
484
|
cssText = cssText.substring(k);
|
|
485
|
+
cssTextNorm = cssTextNorm.substring(splitNorm);
|
|
456
486
|
break;
|
|
487
|
+
} else if (normPart.length < splitNorm) {
|
|
488
|
+
k += Math.max(
|
|
489
|
+
1,
|
|
490
|
+
Math.floor((splitNorm - normPart.length) / normFactor)
|
|
491
|
+
);
|
|
492
|
+
} else {
|
|
493
|
+
k -= Math.max(
|
|
494
|
+
1,
|
|
495
|
+
Math.floor((normPart.length - splitNorm) * normFactor)
|
|
496
|
+
);
|
|
457
497
|
}
|
|
458
498
|
}
|
|
459
499
|
break;
|
|
@@ -749,20 +789,20 @@ function serializeNode(n2, options) {
|
|
|
749
789
|
case n2.DOCUMENT_NODE:
|
|
750
790
|
if (n2.compatMode !== "CSS1Compat") {
|
|
751
791
|
return {
|
|
752
|
-
type: NodeType$
|
|
792
|
+
type: NodeType$3.Document,
|
|
753
793
|
childNodes: [],
|
|
754
794
|
compatMode: n2.compatMode
|
|
755
795
|
// probably "BackCompat"
|
|
756
796
|
};
|
|
757
797
|
} else {
|
|
758
798
|
return {
|
|
759
|
-
type: NodeType$
|
|
799
|
+
type: NodeType$3.Document,
|
|
760
800
|
childNodes: []
|
|
761
801
|
};
|
|
762
802
|
}
|
|
763
803
|
case n2.DOCUMENT_TYPE_NODE:
|
|
764
804
|
return {
|
|
765
|
-
type: NodeType$
|
|
805
|
+
type: NodeType$3.DocumentType,
|
|
766
806
|
name: n2.name,
|
|
767
807
|
publicId: n2.publicId,
|
|
768
808
|
systemId: n2.systemId,
|
|
@@ -793,13 +833,13 @@ function serializeNode(n2, options) {
|
|
|
793
833
|
});
|
|
794
834
|
case n2.CDATA_SECTION_NODE:
|
|
795
835
|
return {
|
|
796
|
-
type: NodeType$
|
|
836
|
+
type: NodeType$3.CDATA,
|
|
797
837
|
textContent: "",
|
|
798
838
|
rootId
|
|
799
839
|
};
|
|
800
840
|
case n2.COMMENT_NODE:
|
|
801
841
|
return {
|
|
802
|
-
type: NodeType$
|
|
842
|
+
type: NodeType$3.Comment,
|
|
803
843
|
textContent: index$1.textContent(n2) || "",
|
|
804
844
|
rootId
|
|
805
845
|
};
|
|
@@ -831,7 +871,7 @@ function serializeTextNode(n2, options) {
|
|
|
831
871
|
textContent2 = maskTextFn ? maskTextFn(textContent2, index$1.parentElement(n2)) : textContent2.replace(/[\S]/g, "*");
|
|
832
872
|
}
|
|
833
873
|
return {
|
|
834
|
-
type: NodeType$
|
|
874
|
+
type: NodeType$3.Text,
|
|
835
875
|
textContent: textContent2 || "",
|
|
836
876
|
rootId
|
|
837
877
|
};
|
|
@@ -1017,7 +1057,7 @@ function serializeElementNode(n2, options) {
|
|
|
1017
1057
|
} catch (e2) {
|
|
1018
1058
|
}
|
|
1019
1059
|
return {
|
|
1020
|
-
type: NodeType$
|
|
1060
|
+
type: NodeType$3.Element,
|
|
1021
1061
|
tagName,
|
|
1022
1062
|
attributes,
|
|
1023
1063
|
childNodes: [],
|
|
@@ -1035,9 +1075,9 @@ function lowerIfExists(maybeAttr) {
|
|
|
1035
1075
|
}
|
|
1036
1076
|
}
|
|
1037
1077
|
function slimDOMExcluded(sn, slimDOMOptions) {
|
|
1038
|
-
if (slimDOMOptions.comment && sn.type === NodeType$
|
|
1078
|
+
if (slimDOMOptions.comment && sn.type === NodeType$3.Comment) {
|
|
1039
1079
|
return true;
|
|
1040
|
-
} else if (sn.type === NodeType$
|
|
1080
|
+
} else if (sn.type === NodeType$3.Element) {
|
|
1041
1081
|
if (slimDOMOptions.script && // script tag
|
|
1042
1082
|
(sn.tagName === "script" || // (module)preload link
|
|
1043
1083
|
sn.tagName === "link" && (sn.attributes.rel === "preload" || sn.attributes.rel === "modulepreload") && sn.attributes.as === "script" || // prefetch link
|
|
@@ -1127,7 +1167,7 @@ function serializeNodeWithId(n2, options) {
|
|
|
1127
1167
|
let id;
|
|
1128
1168
|
if (mirror2.hasNode(n2)) {
|
|
1129
1169
|
id = mirror2.getId(n2);
|
|
1130
|
-
} else if (slimDOMExcluded(_serializedNode, slimDOMOptions) || !preserveWhiteSpace && _serializedNode.type === NodeType$
|
|
1170
|
+
} else if (slimDOMExcluded(_serializedNode, slimDOMOptions) || !preserveWhiteSpace && _serializedNode.type === NodeType$3.Text && !_serializedNode.textContent.replace(/^\s+|\s+$/gm, "").length) {
|
|
1131
1171
|
id = IGNORED_NODE;
|
|
1132
1172
|
} else {
|
|
1133
1173
|
id = genId();
|
|
@@ -1141,15 +1181,15 @@ function serializeNodeWithId(n2, options) {
|
|
|
1141
1181
|
onSerialize(n2);
|
|
1142
1182
|
}
|
|
1143
1183
|
let recordChild = !skipChild;
|
|
1144
|
-
if (serializedNode.type === NodeType$
|
|
1184
|
+
if (serializedNode.type === NodeType$3.Element) {
|
|
1145
1185
|
recordChild = recordChild && !serializedNode.needBlock;
|
|
1146
1186
|
delete serializedNode.needBlock;
|
|
1147
1187
|
const shadowRootEl = index$1.shadowRoot(n2);
|
|
1148
1188
|
if (shadowRootEl && isNativeShadowDom(shadowRootEl))
|
|
1149
1189
|
serializedNode.isShadowHost = true;
|
|
1150
1190
|
}
|
|
1151
|
-
if ((serializedNode.type === NodeType$
|
|
1152
|
-
if (slimDOMOptions.headWhitespace && serializedNode.type === NodeType$
|
|
1191
|
+
if ((serializedNode.type === NodeType$3.Document || serializedNode.type === NodeType$3.Element) && recordChild) {
|
|
1192
|
+
if (slimDOMOptions.headWhitespace && serializedNode.type === NodeType$3.Element && serializedNode.tagName === "head") {
|
|
1153
1193
|
preserveWhiteSpace = false;
|
|
1154
1194
|
}
|
|
1155
1195
|
const bypassOptions = {
|
|
@@ -1178,9 +1218,9 @@ function serializeNodeWithId(n2, options) {
|
|
|
1178
1218
|
keepIframeSrcFn,
|
|
1179
1219
|
cssCaptured: false
|
|
1180
1220
|
};
|
|
1181
|
-
if (serializedNode.type === NodeType$
|
|
1221
|
+
if (serializedNode.type === NodeType$3.Element && serializedNode.tagName === "textarea" && serializedNode.attributes.value !== void 0) ;
|
|
1182
1222
|
else {
|
|
1183
|
-
if (serializedNode.type === NodeType$
|
|
1223
|
+
if (serializedNode.type === NodeType$3.Element && serializedNode.attributes._cssText !== void 0 && typeof serializedNode.attributes._cssText === "string") {
|
|
1184
1224
|
bypassOptions.cssCaptured = true;
|
|
1185
1225
|
}
|
|
1186
1226
|
for (const childN of Array.from(index$1.childNodes(n2))) {
|
|
@@ -1205,7 +1245,7 @@ function serializeNodeWithId(n2, options) {
|
|
|
1205
1245
|
if (parent && isShadowRoot(parent) && isNativeShadowDom(parent)) {
|
|
1206
1246
|
serializedNode.isShadow = true;
|
|
1207
1247
|
}
|
|
1208
|
-
if (serializedNode.type === NodeType$
|
|
1248
|
+
if (serializedNode.type === NodeType$3.Element && serializedNode.tagName === "iframe") {
|
|
1209
1249
|
onceIframeLoaded(
|
|
1210
1250
|
n2,
|
|
1211
1251
|
() => {
|
|
@@ -1247,7 +1287,7 @@ function serializeNodeWithId(n2, options) {
|
|
|
1247
1287
|
iframeLoadTimeout
|
|
1248
1288
|
);
|
|
1249
1289
|
}
|
|
1250
|
-
if (serializedNode.type === NodeType$
|
|
1290
|
+
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")) {
|
|
1251
1291
|
onceStylesheetLoaded(
|
|
1252
1292
|
n2,
|
|
1253
1293
|
() => {
|
|
@@ -5025,7 +5065,7 @@ function createCache() {
|
|
|
5025
5065
|
function applyCssSplits(n2, cssText, hackCss, cache) {
|
|
5026
5066
|
const childTextNodes = [];
|
|
5027
5067
|
for (const scn of n2.childNodes) {
|
|
5028
|
-
if (scn.type === NodeType$
|
|
5068
|
+
if (scn.type === NodeType$3.Text) {
|
|
5029
5069
|
childTextNodes.push(scn);
|
|
5030
5070
|
}
|
|
5031
5071
|
}
|
|
@@ -5056,15 +5096,15 @@ function buildNode(n2, options) {
|
|
|
5056
5096
|
var _a2;
|
|
5057
5097
|
const { doc, hackCss, cache } = options;
|
|
5058
5098
|
switch (n2.type) {
|
|
5059
|
-
case NodeType$
|
|
5099
|
+
case NodeType$3.Document:
|
|
5060
5100
|
return doc.implementation.createDocument(null, "", null);
|
|
5061
|
-
case NodeType$
|
|
5101
|
+
case NodeType$3.DocumentType:
|
|
5062
5102
|
return doc.implementation.createDocumentType(
|
|
5063
5103
|
n2.name || "html",
|
|
5064
5104
|
n2.publicId,
|
|
5065
5105
|
n2.systemId
|
|
5066
5106
|
);
|
|
5067
|
-
case NodeType$
|
|
5107
|
+
case NodeType$3.Element: {
|
|
5068
5108
|
const tagName = getTagName(n2);
|
|
5069
5109
|
let node2;
|
|
5070
5110
|
if (n2.isSVG) {
|
|
@@ -5198,14 +5238,14 @@ function buildNode(n2, options) {
|
|
|
5198
5238
|
}
|
|
5199
5239
|
return node2;
|
|
5200
5240
|
}
|
|
5201
|
-
case NodeType$
|
|
5241
|
+
case NodeType$3.Text:
|
|
5202
5242
|
if (n2.isStyle && hackCss) {
|
|
5203
5243
|
return doc.createTextNode(adaptCssForReplay(n2.textContent, cache));
|
|
5204
5244
|
}
|
|
5205
5245
|
return doc.createTextNode(n2.textContent);
|
|
5206
|
-
case NodeType$
|
|
5246
|
+
case NodeType$3.CDATA:
|
|
5207
5247
|
return doc.createCDATASection(n2.textContent);
|
|
5208
|
-
case NodeType$
|
|
5248
|
+
case NodeType$3.Comment:
|
|
5209
5249
|
return doc.createComment(n2.textContent);
|
|
5210
5250
|
default:
|
|
5211
5251
|
return null;
|
|
@@ -5232,11 +5272,11 @@ function buildNodeWithSN(n2, options) {
|
|
|
5232
5272
|
if (n2.rootId && mirror2.getNode(n2.rootId) !== doc) {
|
|
5233
5273
|
mirror2.replace(n2.rootId, doc);
|
|
5234
5274
|
}
|
|
5235
|
-
if (n2.type === NodeType$
|
|
5275
|
+
if (n2.type === NodeType$3.Document) {
|
|
5236
5276
|
doc.close();
|
|
5237
5277
|
doc.open();
|
|
5238
|
-
if (n2.compatMode === "BackCompat" && n2.childNodes && n2.childNodes[0].type !== NodeType$
|
|
5239
|
-
if (n2.childNodes[0].type === NodeType$
|
|
5278
|
+
if (n2.compatMode === "BackCompat" && n2.childNodes && n2.childNodes[0].type !== NodeType$3.DocumentType) {
|
|
5279
|
+
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") {
|
|
5240
5280
|
doc.write(
|
|
5241
5281
|
'<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "">'
|
|
5242
5282
|
);
|
|
@@ -5249,7 +5289,7 @@ function buildNodeWithSN(n2, options) {
|
|
|
5249
5289
|
node2 = doc;
|
|
5250
5290
|
}
|
|
5251
5291
|
mirror2.add(node2, n2);
|
|
5252
|
-
if ((n2.type === NodeType$
|
|
5292
|
+
if ((n2.type === NodeType$3.Document || n2.type === NodeType$3.Element) && !skipChild) {
|
|
5253
5293
|
for (const childN of n2.childNodes) {
|
|
5254
5294
|
const childNode = buildNodeWithSN(childN, {
|
|
5255
5295
|
doc,
|
|
@@ -5265,7 +5305,7 @@ function buildNodeWithSN(n2, options) {
|
|
|
5265
5305
|
}
|
|
5266
5306
|
if (childN.isShadow && isElement(node2) && node2.shadowRoot) {
|
|
5267
5307
|
node2.shadowRoot.appendChild(childNode);
|
|
5268
|
-
} else if (n2.type === NodeType$
|
|
5308
|
+
} else if (n2.type === NodeType$3.Document && childN.type == NodeType$3.Element) {
|
|
5269
5309
|
const htmlElement = childNode;
|
|
5270
5310
|
let body = null;
|
|
5271
5311
|
htmlElement.childNodes.forEach((child) => {
|
|
@@ -5300,7 +5340,7 @@ function visit(mirror2, onVisit) {
|
|
|
5300
5340
|
}
|
|
5301
5341
|
function handleScroll(node2, mirror2) {
|
|
5302
5342
|
const n2 = mirror2.getMeta(node2);
|
|
5303
|
-
if ((n2 == null ? void 0 : n2.type) !== NodeType$
|
|
5343
|
+
if ((n2 == null ? void 0 : n2.type) !== NodeType$3.Element) {
|
|
5304
5344
|
return;
|
|
5305
5345
|
}
|
|
5306
5346
|
const el = node2;
|
|
@@ -5348,15 +5388,6 @@ var __publicField2 = (obj, key, value) => __defNormalProp2(obj, typeof key !== "
|
|
|
5348
5388
|
var __defProp22 = Object.defineProperty;
|
|
5349
5389
|
var __defNormalProp22 = (obj, key, value) => key in obj ? __defProp22(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
|
|
5350
5390
|
var __publicField22 = (obj, key, value) => __defNormalProp22(obj, typeof key !== "symbol" ? key + "" : key, value);
|
|
5351
|
-
var NodeType$1 = /* @__PURE__ */ ((NodeType2) => {
|
|
5352
|
-
NodeType2[NodeType2["Document"] = 0] = "Document";
|
|
5353
|
-
NodeType2[NodeType2["DocumentType"] = 1] = "DocumentType";
|
|
5354
|
-
NodeType2[NodeType2["Element"] = 2] = "Element";
|
|
5355
|
-
NodeType2[NodeType2["Text"] = 3] = "Text";
|
|
5356
|
-
NodeType2[NodeType2["CDATA"] = 4] = "CDATA";
|
|
5357
|
-
NodeType2[NodeType2["Comment"] = 5] = "Comment";
|
|
5358
|
-
return NodeType2;
|
|
5359
|
-
})(NodeType$1 || {});
|
|
5360
5391
|
let Mirror$1 = class Mirror2 {
|
|
5361
5392
|
constructor() {
|
|
5362
5393
|
__publicField22(this, "idNodeMap", /* @__PURE__ */ new Map());
|
|
@@ -8964,6 +8995,15 @@ postcss$1.Input;
|
|
|
8964
8995
|
postcss$1.Rule;
|
|
8965
8996
|
postcss$1.Root;
|
|
8966
8997
|
postcss$1.Node;
|
|
8998
|
+
var NodeType$1 = /* @__PURE__ */ ((NodeType2) => {
|
|
8999
|
+
NodeType2[NodeType2["Document"] = 0] = "Document";
|
|
9000
|
+
NodeType2[NodeType2["DocumentType"] = 1] = "DocumentType";
|
|
9001
|
+
NodeType2[NodeType2["Element"] = 2] = "Element";
|
|
9002
|
+
NodeType2[NodeType2["Text"] = 3] = "Text";
|
|
9003
|
+
NodeType2[NodeType2["CDATA"] = 4] = "CDATA";
|
|
9004
|
+
NodeType2[NodeType2["Comment"] = 5] = "Comment";
|
|
9005
|
+
return NodeType2;
|
|
9006
|
+
})(NodeType$1 || {});
|
|
8967
9007
|
function parseCSSText(cssText) {
|
|
8968
9008
|
const res = {};
|
|
8969
9009
|
const listDelimiter = /;(?![^(]*\))/g;
|
|
@@ -9473,7 +9513,7 @@ function removeChild(parent, child) {
|
|
|
9473
9513
|
child.parentNode = null;
|
|
9474
9514
|
return child;
|
|
9475
9515
|
}
|
|
9476
|
-
var NodeType = /* @__PURE__ */ ((NodeType2) => {
|
|
9516
|
+
var NodeType$2 = /* @__PURE__ */ ((NodeType2) => {
|
|
9477
9517
|
NodeType2[NodeType2["PLACEHOLDER"] = 0] = "PLACEHOLDER";
|
|
9478
9518
|
NodeType2[NodeType2["ELEMENT_NODE"] = 1] = "ELEMENT_NODE";
|
|
9479
9519
|
NodeType2[NodeType2["ATTRIBUTE_NODE"] = 2] = "ATTRIBUTE_NODE";
|
|
@@ -9487,7 +9527,7 @@ var NodeType = /* @__PURE__ */ ((NodeType2) => {
|
|
|
9487
9527
|
NodeType2[NodeType2["DOCUMENT_TYPE_NODE"] = 10] = "DOCUMENT_TYPE_NODE";
|
|
9488
9528
|
NodeType2[NodeType2["DOCUMENT_FRAGMENT_NODE"] = 11] = "DOCUMENT_FRAGMENT_NODE";
|
|
9489
9529
|
return NodeType2;
|
|
9490
|
-
})(NodeType || {});
|
|
9530
|
+
})(NodeType$2 || {});
|
|
9491
9531
|
const NAMESPACES = {
|
|
9492
9532
|
svg: "http://www.w3.org/2000/svg",
|
|
9493
9533
|
"xlink:href": "http://www.w3.org/1999/xlink",
|
|
@@ -10046,7 +10086,7 @@ function getValidTagName(element) {
|
|
|
10046
10086
|
function buildFromNode(node2, rrdom, domMirror, parentRRNode) {
|
|
10047
10087
|
let rrNode;
|
|
10048
10088
|
switch (node2.nodeType) {
|
|
10049
|
-
case NodeType.DOCUMENT_NODE:
|
|
10089
|
+
case NodeType$2.DOCUMENT_NODE:
|
|
10050
10090
|
if (parentRRNode && parentRRNode.nodeName === "IFRAME")
|
|
10051
10091
|
rrNode = parentRRNode.contentDocument;
|
|
10052
10092
|
else {
|
|
@@ -10054,7 +10094,7 @@ function buildFromNode(node2, rrdom, domMirror, parentRRNode) {
|
|
|
10054
10094
|
rrNode.compatMode = node2.compatMode;
|
|
10055
10095
|
}
|
|
10056
10096
|
break;
|
|
10057
|
-
case NodeType.DOCUMENT_TYPE_NODE: {
|
|
10097
|
+
case NodeType$2.DOCUMENT_TYPE_NODE: {
|
|
10058
10098
|
const documentType = node2;
|
|
10059
10099
|
rrNode = rrdom.createDocumentType(
|
|
10060
10100
|
documentType.name,
|
|
@@ -10063,7 +10103,7 @@ function buildFromNode(node2, rrdom, domMirror, parentRRNode) {
|
|
|
10063
10103
|
);
|
|
10064
10104
|
break;
|
|
10065
10105
|
}
|
|
10066
|
-
case NodeType.ELEMENT_NODE: {
|
|
10106
|
+
case NodeType$2.ELEMENT_NODE: {
|
|
10067
10107
|
const elementNode = node2;
|
|
10068
10108
|
const tagName = getValidTagName(elementNode);
|
|
10069
10109
|
rrNode = rrdom.createElement(tagName);
|
|
@@ -10075,16 +10115,16 @@ function buildFromNode(node2, rrdom, domMirror, parentRRNode) {
|
|
|
10075
10115
|
elementNode.scrollTop && (rrElement.scrollTop = elementNode.scrollTop);
|
|
10076
10116
|
break;
|
|
10077
10117
|
}
|
|
10078
|
-
case NodeType.TEXT_NODE:
|
|
10118
|
+
case NodeType$2.TEXT_NODE:
|
|
10079
10119
|
rrNode = rrdom.createTextNode(node2.textContent || "");
|
|
10080
10120
|
break;
|
|
10081
|
-
case NodeType.CDATA_SECTION_NODE:
|
|
10121
|
+
case NodeType$2.CDATA_SECTION_NODE:
|
|
10082
10122
|
rrNode = rrdom.createCDATASection(node2.data);
|
|
10083
10123
|
break;
|
|
10084
|
-
case NodeType.COMMENT_NODE:
|
|
10124
|
+
case NodeType$2.COMMENT_NODE:
|
|
10085
10125
|
rrNode = rrdom.createComment(node2.textContent || "");
|
|
10086
10126
|
break;
|
|
10087
|
-
case NodeType.DOCUMENT_FRAGMENT_NODE:
|
|
10127
|
+
case NodeType$2.DOCUMENT_FRAGMENT_NODE:
|
|
10088
10128
|
rrNode = parentRRNode.attachShadow({ mode: "open" });
|
|
10089
10129
|
break;
|
|
10090
10130
|
default:
|
|
@@ -10107,7 +10147,7 @@ function buildFromDom(dom, domMirror = createMirror$1(), rrdom = new RRDocument(
|
|
|
10107
10147
|
if (
|
|
10108
10148
|
// if the parentRRNode isn't a RRIFrameElement
|
|
10109
10149
|
(parentRRNode == null ? void 0 : parentRRNode.nodeName) !== "IFRAME" && // if node isn't a shadow root
|
|
10110
|
-
node2.nodeType !== NodeType.DOCUMENT_FRAGMENT_NODE
|
|
10150
|
+
node2.nodeType !== NodeType$2.DOCUMENT_FRAGMENT_NODE
|
|
10111
10151
|
) {
|
|
10112
10152
|
parentRRNode == null ? void 0 : parentRRNode.appendChild(rrNode);
|
|
10113
10153
|
rrNode.parentNode = parentRRNode;
|
|
@@ -10116,8 +10156,8 @@ function buildFromDom(dom, domMirror = createMirror$1(), rrdom = new RRDocument(
|
|
|
10116
10156
|
if (node2.nodeName === "IFRAME") {
|
|
10117
10157
|
const iframeDoc = node2.contentDocument;
|
|
10118
10158
|
iframeDoc && walk2(iframeDoc, rrNode);
|
|
10119
|
-
} else if (node2.nodeType === NodeType.DOCUMENT_NODE || node2.nodeType === NodeType.ELEMENT_NODE || node2.nodeType === NodeType.DOCUMENT_FRAGMENT_NODE) {
|
|
10120
|
-
if (node2.nodeType === NodeType.ELEMENT_NODE && node2.shadowRoot)
|
|
10159
|
+
} else if (node2.nodeType === NodeType$2.DOCUMENT_NODE || node2.nodeType === NodeType$2.ELEMENT_NODE || node2.nodeType === NodeType$2.DOCUMENT_FRAGMENT_NODE) {
|
|
10160
|
+
if (node2.nodeType === NodeType$2.ELEMENT_NODE && node2.shadowRoot)
|
|
10121
10161
|
walk2(node2.shadowRoot, rrNode);
|
|
10122
10162
|
node2.childNodes.forEach((childNode) => walk2(childNode, rrNode));
|
|
10123
10163
|
}
|
|
@@ -10241,6 +10281,9 @@ const testableMethods = {
|
|
|
10241
10281
|
MutationObserver: ["constructor"]
|
|
10242
10282
|
};
|
|
10243
10283
|
const untaintedBasePrototype = {};
|
|
10284
|
+
const isAngularZonePresent = () => {
|
|
10285
|
+
return !!globalThis.Zone;
|
|
10286
|
+
};
|
|
10244
10287
|
function getUntaintedPrototype(key) {
|
|
10245
10288
|
if (untaintedBasePrototype[key])
|
|
10246
10289
|
return untaintedBasePrototype[key];
|
|
@@ -10268,7 +10311,7 @@ function getUntaintedPrototype(key) {
|
|
|
10268
10311
|
}
|
|
10269
10312
|
)
|
|
10270
10313
|
);
|
|
10271
|
-
if (isUntaintedAccessors && isUntaintedMethods) {
|
|
10314
|
+
if (isUntaintedAccessors && isUntaintedMethods && !isAngularZonePresent()) {
|
|
10272
10315
|
untaintedBasePrototype[key] = defaultObj.prototype;
|
|
10273
10316
|
return defaultObj.prototype;
|
|
10274
10317
|
}
|
|
@@ -10850,6 +10893,15 @@ var ReplayerEvents = /* @__PURE__ */ ((ReplayerEvents2) => {
|
|
|
10850
10893
|
ReplayerEvents2["Destroy"] = "destroy";
|
|
10851
10894
|
return ReplayerEvents2;
|
|
10852
10895
|
})(ReplayerEvents || {});
|
|
10896
|
+
var NodeType = /* @__PURE__ */ ((NodeType2) => {
|
|
10897
|
+
NodeType2[NodeType2["Document"] = 0] = "Document";
|
|
10898
|
+
NodeType2[NodeType2["DocumentType"] = 1] = "DocumentType";
|
|
10899
|
+
NodeType2[NodeType2["Element"] = 2] = "Element";
|
|
10900
|
+
NodeType2[NodeType2["Text"] = 3] = "Text";
|
|
10901
|
+
NodeType2[NodeType2["CDATA"] = 4] = "CDATA";
|
|
10902
|
+
NodeType2[NodeType2["Comment"] = 5] = "Comment";
|
|
10903
|
+
return NodeType2;
|
|
10904
|
+
})(NodeType || {});
|
|
10853
10905
|
function isNodeInLinkedList(n2) {
|
|
10854
10906
|
return "__ln" in n2;
|
|
10855
10907
|
}
|
|
@@ -12786,7 +12838,7 @@ class IframeManager {
|
|
|
12786
12838
|
}
|
|
12787
12839
|
}
|
|
12788
12840
|
patchRootIdOnNode(node2, rootId) {
|
|
12789
|
-
if (node2.type !== NodeType
|
|
12841
|
+
if (node2.type !== NodeType.Document && !node2.rootId) node2.rootId = rootId;
|
|
12790
12842
|
if ("childNodes" in node2) {
|
|
12791
12843
|
node2.childNodes.forEach((child) => {
|
|
12792
12844
|
this.patchRootIdOnNode(child, rootId);
|
|
@@ -15873,7 +15925,7 @@ class Replayer {
|
|
|
15873
15925
|
collectedDialogs.add(builtNode);
|
|
15874
15926
|
this.collectIframeAndAttachDocument(collectedIframes, builtNode);
|
|
15875
15927
|
const sn = mirror2.getMeta(builtNode);
|
|
15876
|
-
if ((sn == null ? void 0 : sn.type) === NodeType
|
|
15928
|
+
if ((sn == null ? void 0 : sn.type) === NodeType.Element && (sn == null ? void 0 : sn.tagName.toUpperCase()) === "HTML") {
|
|
15877
15929
|
const { documentElement, head } = iframeEl.contentDocument;
|
|
15878
15930
|
this.insertStyleRules(
|
|
15879
15931
|
documentElement,
|
|
@@ -16349,7 +16401,7 @@ class Replayer {
|
|
|
16349
16401
|
mutation.parentId
|
|
16350
16402
|
);
|
|
16351
16403
|
if (!parent) {
|
|
16352
|
-
if (mutation.node.type === NodeType
|
|
16404
|
+
if (mutation.node.type === NodeType.Document) {
|
|
16353
16405
|
return this.newDocumentQueue.push(mutation);
|
|
16354
16406
|
}
|
|
16355
16407
|
return queue.push(mutation);
|
|
@@ -16411,7 +16463,7 @@ class Replayer {
|
|
|
16411
16463
|
return;
|
|
16412
16464
|
}
|
|
16413
16465
|
const parentSn = mirror2.getMeta(parent);
|
|
16414
|
-
if (parentSn && parentSn.type === NodeType
|
|
16466
|
+
if (parentSn && parentSn.type === NodeType.Element && mutation.node.type === NodeType.Text) {
|
|
16415
16467
|
const prospectiveSiblings = Array.isArray(parent.childNodes) ? parent.childNodes : Array.from(parent.childNodes);
|
|
16416
16468
|
if (parentSn.tagName === "textarea") {
|
|
16417
16469
|
for (const c2 of prospectiveSiblings) {
|
|
@@ -16427,9 +16479,9 @@ class Replayer {
|
|
|
16427
16479
|
}
|
|
16428
16480
|
}
|
|
16429
16481
|
}
|
|
16430
|
-
} else if ((parentSn == null ? void 0 : parentSn.type) === NodeType
|
|
16482
|
+
} else if ((parentSn == null ? void 0 : parentSn.type) === NodeType.Document) {
|
|
16431
16483
|
const parentDoc = parent;
|
|
16432
|
-
if (mutation.node.type === NodeType
|
|
16484
|
+
if (mutation.node.type === NodeType.DocumentType && ((_a2 = parentDoc.childNodes[0]) == null ? void 0 : _a2.nodeType) === Node.DOCUMENT_TYPE_NODE)
|
|
16433
16485
|
parentDoc.removeChild(parentDoc.childNodes[0]);
|
|
16434
16486
|
if (target.nodeName === "HTML" && parentDoc.documentElement)
|
|
16435
16487
|
parentDoc.removeChild(
|
|
@@ -16635,7 +16687,7 @@ class Replayer {
|
|
|
16635
16687
|
left: d.x,
|
|
16636
16688
|
behavior: isSync ? "auto" : "smooth"
|
|
16637
16689
|
});
|
|
16638
|
-
} else if ((sn == null ? void 0 : sn.type) === NodeType
|
|
16690
|
+
} else if ((sn == null ? void 0 : sn.type) === NodeType.Document) {
|
|
16639
16691
|
(_b = target.defaultView) == null ? void 0 : _b.scrollTo({
|
|
16640
16692
|
top: d.y,
|
|
16641
16693
|
left: d.x,
|