@pendo/agent 2.344.1 → 2.345.0

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.
@@ -4129,8 +4129,8 @@ let SERVER = '';
4129
4129
  let ASSET_HOST = '';
4130
4130
  let ASSET_PATH = '';
4131
4131
  let DESIGNER_SERVER = '';
4132
- let VERSION = '2.344.1_';
4133
- let PACKAGE_VERSION = '2.344.1';
4132
+ let VERSION = '2.345.0_';
4133
+ let PACKAGE_VERSION = '2.345.0';
4134
4134
  let LOADER = 'xhr';
4135
4135
  /* eslint-enable web-sdk-eslint-rules/no-gulp-env-references */
4136
4136
  /**
@@ -10113,6 +10113,16 @@ function getFontBaseUrl() {
10113
10113
  return `${FONT_HOST}/fonts`;
10114
10114
  }
10115
10115
 
10116
+ // Despite the name, this is a behavioral gate rather than an identity check: it is true whenever
10117
+ // the agent is in a parent-child sub relationship where another subscription owns this agent's
10118
+ // content and event attribution. That covers traditional Adopt training partners and, as a subtype,
10119
+ // partner-analytics-forwarding subs. Call sites rely on that meaning - the acc/oemAccountId event
10120
+ // attribution, the trusted-origin bypass, and skipping the contentHost rewrite - not on the sub
10121
+ // literally being an Adopt partner.
10122
+ // This assumes those subs only ever serve the partner's own content. If Pendo sub analytics is ever
10123
+ // turned on with guides - so a forwarding sub delivers Pendo-origin guide content - the call sites
10124
+ // that treat "partner" as "another sub owns all content" (the contentHost skip in particular) will
10125
+ // need to be revisited, likely as a per-url decision rather than this all-or-nothing gate.
10116
10126
  function treatAsAdoptPartner() {
10117
10127
  // allowPartnerAnalyticsForwarding is set on the snippet in Adopt UI to block based on the environment of the app.
10118
10128
  // adoptAnalyticsForwarding is set in pendoConfig, based on the app flag.
@@ -12592,10 +12602,10 @@ var getDesignerWindow = function () {
12592
12602
  // directly to the top window.
12593
12603
  return isPendo.test(location.href) ? window.parent : window.top;
12594
12604
  };
12595
- var announceAgentLoaded = function () {
12605
+ var announceAgentLoaded = function (url) {
12596
12606
  if (detectMaster()) {
12597
12607
  var win = getDesignerWindow();
12598
- tellMaster(win, { type: 'load', url: location.toString() }, '*');
12608
+ tellMaster(win, { type: 'load', url: url || location.toString() }, '*');
12599
12609
  }
12600
12610
  };
12601
12611
  var addSafeWindowMessageListener = function (cb) {
@@ -13930,7 +13940,7 @@ var pageLoad = makeSafe(function (url) {
13930
13940
  pageLoad.lastUrl = url;
13931
13941
  var loadTime = -1;
13932
13942
  if (!restrictP1Access()) {
13933
- announceAgentLoaded();
13943
+ announceAgentLoaded(url);
13934
13944
  }
13935
13945
  log.debug('sending load event for url ' + url);
13936
13946
  if (typeof performance !== 'undefined' &&
@@ -14557,6 +14567,14 @@ function getPendoCdnHost() {
14557
14567
  // A contentHost set up as a CNAME in app settings is delivered in the hosted config, while a
14558
14568
  // snippet value is the customer's own override of it. Same precedence getDataHost uses.
14559
14569
  function getConfiguredContentHost() {
14570
+ // Partner/OEM guide content lives in the partner's own storage buckets, so we
14571
+ // must not rewrite those urls away from the partner. This is an all-or-nothing skip that
14572
+ // assumes a partner sub never serves Pendo-origin guide content that a contentHost should
14573
+ // apply to - true while only the partner's own guides are delivered. If guides are ever
14574
+ // enabled for partner-analytics subs with content on a Pendo host, this needs to become a
14575
+ // per-url decision (skip partner-bucket urls, still rewrite Pendo-origin ones) instead.
14576
+ if (treatAsAdoptPartner())
14577
+ return undefined;
14560
14578
  return ConfigReader.getLocalConfig('contentHost') || ConfigReader.getHostedConfig('contentHost');
14561
14579
  }
14562
14580
  function replaceWithContentHost(str) {
@@ -36357,6 +36375,12 @@ const DebuggerModule = (() => {
36357
36375
  identity: { type: SYNC_TYPES.BOTTOM_UP, defaultValue: {} },
36358
36376
  location: { type: SYNC_TYPES.BOTTOM_UP, defaultValue: {} }
36359
36377
  };
36378
+ // frameId comes off the cross-frame channel and keys state.frames, so a key like
36379
+ // __proto__ would resolve to Object.prototype and the sync would write onto it
36380
+ const UNSAFE_FRAME_IDS = ['__proto__', 'constructor', 'prototype'];
36381
+ function isSafeFrameId(frameId) {
36382
+ return _.isString(frameId) && !_.contains(UNSAFE_FRAME_IDS, frameId);
36383
+ }
36360
36384
  const actions = {
36361
36385
  init: (context, buffer) => {
36362
36386
  context.commit('setFrameId', EventTracer.getFrameId());
@@ -36720,6 +36744,8 @@ const DebuggerModule = (() => {
36720
36744
  });
36721
36745
  setter = mutations[`_sync_${fieldName}`] || setter;
36722
36746
  mutations[`_sync_${fieldName}`] = (state, { value, frameId }) => {
36747
+ if (!isSafeFrameId(frameId))
36748
+ return;
36723
36749
  if (!state.frames[frameId]) {
36724
36750
  state.frames[frameId] = {};
36725
36751
  }
@@ -41982,11 +42008,20 @@ class DOMPrompt {
41982
42008
  }
41983
42009
  return tmp;
41984
42010
  }
42011
+ isPasswordInput(elem) {
42012
+ return !!elem && !!elem.tagName && elem.tagName.toLowerCase() === 'input' && elem.type === 'password';
42013
+ }
42014
+ getInputText(inputEl) {
42015
+ if (this.isPasswordInput(inputEl.get())) {
42016
+ return '';
42017
+ }
42018
+ return inputEl.getText();
42019
+ }
41985
42020
  getPromptValue() {
41986
42021
  const elementWithValue = this._.find(this.inputEls, (el) => {
41987
42022
  if (el) {
41988
42023
  try {
41989
- const value = el.getText();
42024
+ const value = this.getInputText(el);
41990
42025
  return value && value.trim();
41991
42026
  }
41992
42027
  catch (err) {
@@ -41997,7 +42032,7 @@ class DOMPrompt {
41997
42032
  });
41998
42033
  if (elementWithValue) {
41999
42034
  try {
42000
- const value = elementWithValue.getText();
42035
+ const value = this.getInputText(elementWithValue);
42001
42036
  return value.trim();
42002
42037
  }
42003
42038
  catch (err) { }
@@ -43077,11 +43112,28 @@ function lookupGuideButtons(domJson, buttons = []) {
43077
43112
  }
43078
43113
  return buttons;
43079
43114
  }
43115
+ function replaceFirstInTextNodes(node, textToReplace, replacementText) {
43116
+ for (let i = 0; i < node.childNodes.length; i++) {
43117
+ const child = node.childNodes[i];
43118
+ if (child.nodeType === 3) {
43119
+ const replaced = child.nodeValue.replace(textToReplace, replacementText);
43120
+ if (replaced !== child.nodeValue) {
43121
+ child.nodeValue = replaced;
43122
+ return true;
43123
+ }
43124
+ }
43125
+ else if (replaceFirstInTextNodes(child, textToReplace, replacementText)) {
43126
+ return true;
43127
+ }
43128
+ }
43129
+ return false;
43130
+ }
43080
43131
  function removeMarkdownSyntax(element, textToReplace, replacementText, pendo) {
43081
- var _a;
43082
43132
  if (pendo.dom(element).hasClass('_pendo-nps-open-text-poll-question')) {
43083
- // This prevents us from removing the message for the conditionally rendered elements
43084
- element.innerHTML = (_a = element.innerHTML) === null || _a === void 0 ? void 0 : _a.replace(textToReplace, replacementText);
43133
+ // Edit text nodes in place rather than round-tripping innerHTML: re-parsing serialized
43134
+ // guide markup can mutate it into live elements (mXSS). This also keeps child elements intact.
43135
+ element.normalize();
43136
+ replaceFirstInTextNodes(element, textToReplace, replacementText);
43085
43137
  }
43086
43138
  if (element.localName === 'button' ||
43087
43139
  element.localName === 'label' ||
@@ -46408,10 +46460,72 @@ function record() { var __defProp = Object.defineProperty;
46408
46460
  var __defNormalProp = (obj, key, value) => key in obj ? __defProp(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
46409
46461
  var __publicField = (obj, key, value) => __defNormalProp(obj, typeof key !== "symbol" ? key + "" : key, value);
46410
46462
  var _a;
46411
- var __defProp$1 = Object.defineProperty;
46412
- var __defNormalProp$1 = (obj, key, value) => key in obj ? __defProp$1(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
46413
- var __publicField$1 = (obj, key, value) => __defNormalProp$1(obj, typeof key !== "symbol" ? key + "" : key, value);
46414
- var NodeType$3 = /* @__PURE__ */ ((NodeType2) => {
46463
+ var EventType = /* @__PURE__ */ ((EventType2) => {
46464
+ EventType2[EventType2["DomContentLoaded"] = 0] = "DomContentLoaded";
46465
+ EventType2[EventType2["Load"] = 1] = "Load";
46466
+ EventType2[EventType2["FullSnapshot"] = 2] = "FullSnapshot";
46467
+ EventType2[EventType2["IncrementalSnapshot"] = 3] = "IncrementalSnapshot";
46468
+ EventType2[EventType2["Meta"] = 4] = "Meta";
46469
+ EventType2[EventType2["Custom"] = 5] = "Custom";
46470
+ EventType2[EventType2["Plugin"] = 6] = "Plugin";
46471
+ EventType2[EventType2["Asset"] = 7] = "Asset";
46472
+ return EventType2;
46473
+ })(EventType || {});
46474
+ var IncrementalSource = /* @__PURE__ */ ((IncrementalSource2) => {
46475
+ IncrementalSource2[IncrementalSource2["Mutation"] = 0] = "Mutation";
46476
+ IncrementalSource2[IncrementalSource2["MouseMove"] = 1] = "MouseMove";
46477
+ IncrementalSource2[IncrementalSource2["MouseInteraction"] = 2] = "MouseInteraction";
46478
+ IncrementalSource2[IncrementalSource2["Scroll"] = 3] = "Scroll";
46479
+ IncrementalSource2[IncrementalSource2["ViewportResize"] = 4] = "ViewportResize";
46480
+ IncrementalSource2[IncrementalSource2["Input"] = 5] = "Input";
46481
+ IncrementalSource2[IncrementalSource2["TouchMove"] = 6] = "TouchMove";
46482
+ IncrementalSource2[IncrementalSource2["MediaInteraction"] = 7] = "MediaInteraction";
46483
+ IncrementalSource2[IncrementalSource2["StyleSheetRule"] = 8] = "StyleSheetRule";
46484
+ IncrementalSource2[IncrementalSource2["CanvasMutation"] = 9] = "CanvasMutation";
46485
+ IncrementalSource2[IncrementalSource2["Font"] = 10] = "Font";
46486
+ IncrementalSource2[IncrementalSource2["Log"] = 11] = "Log";
46487
+ IncrementalSource2[IncrementalSource2["Drag"] = 12] = "Drag";
46488
+ IncrementalSource2[IncrementalSource2["StyleDeclaration"] = 13] = "StyleDeclaration";
46489
+ IncrementalSource2[IncrementalSource2["Selection"] = 14] = "Selection";
46490
+ IncrementalSource2[IncrementalSource2["AdoptedStyleSheet"] = 15] = "AdoptedStyleSheet";
46491
+ IncrementalSource2[IncrementalSource2["CustomElement"] = 16] = "CustomElement";
46492
+ return IncrementalSource2;
46493
+ })(IncrementalSource || {});
46494
+ var MouseInteractions = /* @__PURE__ */ ((MouseInteractions2) => {
46495
+ MouseInteractions2[MouseInteractions2["MouseUp"] = 0] = "MouseUp";
46496
+ MouseInteractions2[MouseInteractions2["MouseDown"] = 1] = "MouseDown";
46497
+ MouseInteractions2[MouseInteractions2["Click"] = 2] = "Click";
46498
+ MouseInteractions2[MouseInteractions2["ContextMenu"] = 3] = "ContextMenu";
46499
+ MouseInteractions2[MouseInteractions2["DblClick"] = 4] = "DblClick";
46500
+ MouseInteractions2[MouseInteractions2["Focus"] = 5] = "Focus";
46501
+ MouseInteractions2[MouseInteractions2["Blur"] = 6] = "Blur";
46502
+ MouseInteractions2[MouseInteractions2["TouchStart"] = 7] = "TouchStart";
46503
+ MouseInteractions2[MouseInteractions2["TouchMove_Departed"] = 8] = "TouchMove_Departed";
46504
+ MouseInteractions2[MouseInteractions2["TouchEnd"] = 9] = "TouchEnd";
46505
+ MouseInteractions2[MouseInteractions2["TouchCancel"] = 10] = "TouchCancel";
46506
+ return MouseInteractions2;
46507
+ })(MouseInteractions || {});
46508
+ var PointerTypes = /* @__PURE__ */ ((PointerTypes2) => {
46509
+ PointerTypes2[PointerTypes2["Mouse"] = 0] = "Mouse";
46510
+ PointerTypes2[PointerTypes2["Pen"] = 1] = "Pen";
46511
+ PointerTypes2[PointerTypes2["Touch"] = 2] = "Touch";
46512
+ return PointerTypes2;
46513
+ })(PointerTypes || {});
46514
+ var CanvasContext = /* @__PURE__ */ ((CanvasContext2) => {
46515
+ CanvasContext2[CanvasContext2["2D"] = 0] = "2D";
46516
+ CanvasContext2[CanvasContext2["WebGL"] = 1] = "WebGL";
46517
+ CanvasContext2[CanvasContext2["WebGL2"] = 2] = "WebGL2";
46518
+ return CanvasContext2;
46519
+ })(CanvasContext || {});
46520
+ var MediaInteractions = /* @__PURE__ */ ((MediaInteractions2) => {
46521
+ MediaInteractions2[MediaInteractions2["Play"] = 0] = "Play";
46522
+ MediaInteractions2[MediaInteractions2["Pause"] = 1] = "Pause";
46523
+ MediaInteractions2[MediaInteractions2["Seeked"] = 2] = "Seeked";
46524
+ MediaInteractions2[MediaInteractions2["VolumeChange"] = 3] = "VolumeChange";
46525
+ MediaInteractions2[MediaInteractions2["RateChange"] = 4] = "RateChange";
46526
+ return MediaInteractions2;
46527
+ })(MediaInteractions || {});
46528
+ var NodeType = /* @__PURE__ */ ((NodeType2) => {
46415
46529
  NodeType2[NodeType2["Document"] = 0] = "Document";
46416
46530
  NodeType2[NodeType2["DocumentType"] = 1] = "DocumentType";
46417
46531
  NodeType2[NodeType2["Element"] = 2] = "Element";
@@ -46419,23 +46533,34 @@ var NodeType$3 = /* @__PURE__ */ ((NodeType2) => {
46419
46533
  NodeType2[NodeType2["CDATA"] = 4] = "CDATA";
46420
46534
  NodeType2[NodeType2["Comment"] = 5] = "Comment";
46421
46535
  return NodeType2;
46422
- })(NodeType$3 || {});
46423
- const testableAccessors$1 = {
46424
- Node: ["childNodes", "parentNode", "parentElement", "textContent"],
46536
+ })(NodeType || {});
46537
+ const testableAccessors = {
46538
+ Node: [
46539
+ "childNodes",
46540
+ "parentNode",
46541
+ "parentElement",
46542
+ "textContent",
46543
+ "ownerDocument",
46544
+ "firstChild",
46545
+ "lastChild",
46546
+ "nextSibling",
46547
+ "previousSibling"
46548
+ ],
46425
46549
  ShadowRoot: ["host", "styleSheets"],
46426
46550
  Element: ["shadowRoot"],
46427
46551
  MutationObserver: [],
46428
46552
  EventTarget: []
46429
46553
  };
46430
- const testableMethods$1 = {
46554
+ const testableMethods = {
46431
46555
  Node: ["contains", "getRootNode"],
46432
46556
  ShadowRoot: ["getSelection"],
46433
46557
  Element: ["querySelector", "querySelectorAll"],
46434
46558
  MutationObserver: ["constructor"],
46435
46559
  EventTarget: ["addEventListener", "removeEventListener"]
46436
46560
  };
46437
- const untaintedBasePrototype$1 = {};
46438
- function angularZoneUnpatchedAlternative$1(key) {
46561
+ const untaintedBasePrototype = {};
46562
+ const untaintedBaseIframeCleanup = {};
46563
+ function angularZoneUnpatchedAlternative(key) {
46439
46564
  var _a2, _b;
46440
46565
  const angularUnpatchedVersionSymbol = (_b = (_a2 = globalThis == null ? void 0 : globalThis.Zone) == null ? void 0 : _a2.__symbol__) == null ? void 0 : _b.call(_a2, key);
46441
46566
  if (angularUnpatchedVersionSymbol && globalThis[angularUnpatchedVersionSymbol]) {
@@ -46444,12 +46569,12 @@ function angularZoneUnpatchedAlternative$1(key) {
46444
46569
  return void 0;
46445
46570
  }
46446
46571
  }
46447
- function getUntaintedPrototype$1(key) {
46448
- if (untaintedBasePrototype$1[key])
46449
- return untaintedBasePrototype$1[key];
46450
- const candidate = angularZoneUnpatchedAlternative$1(key) || globalThis[key];
46572
+ function getUntaintedPrototype(key) {
46573
+ if (untaintedBasePrototype[key])
46574
+ return untaintedBasePrototype[key];
46575
+ const candidate = angularZoneUnpatchedAlternative(key) || globalThis[key];
46451
46576
  const defaultPrototype = candidate.prototype;
46452
- const accessorNames = key in testableAccessors$1 ? testableAccessors$1[key] : void 0;
46577
+ const accessorNames = key in testableAccessors ? testableAccessors[key] : void 0;
46453
46578
  const isUntaintedAccessors = Boolean(
46454
46579
  accessorNames && // @ts-expect-error 2345
46455
46580
  accessorNames.every(
@@ -46461,7 +46586,7 @@ function getUntaintedPrototype$1(key) {
46461
46586
  }
46462
46587
  )
46463
46588
  );
46464
- const methodNames = key in testableMethods$1 ? testableMethods$1[key] : void 0;
46589
+ const methodNames = key in testableMethods ? testableMethods[key] : void 0;
46465
46590
  const isUntaintedMethods = Boolean(
46466
46591
  methodNames && methodNames.every(
46467
46592
  // @ts-expect-error 2345
@@ -46472,45 +46597,53 @@ function getUntaintedPrototype$1(key) {
46472
46597
  )
46473
46598
  );
46474
46599
  if (isUntaintedAccessors && isUntaintedMethods) {
46475
- untaintedBasePrototype$1[key] = candidate.prototype;
46600
+ untaintedBasePrototype[key] = candidate.prototype;
46476
46601
  return candidate.prototype;
46477
46602
  }
46478
46603
  try {
46479
46604
  const iframeEl = document.createElement("iframe");
46605
+ iframeEl.style.display = "none";
46480
46606
  document.body.appendChild(iframeEl);
46481
46607
  const win = iframeEl.contentWindow;
46482
46608
  if (!win) return candidate.prototype;
46483
46609
  const untaintedObject = win[key].prototype;
46484
- document.body.removeChild(iframeEl);
46485
- if (!untaintedObject) return defaultPrototype;
46486
- return untaintedBasePrototype$1[key] = untaintedObject;
46610
+ if (!untaintedObject) {
46611
+ iframeEl.remove();
46612
+ return defaultPrototype;
46613
+ }
46614
+ const ua = navigator.userAgent;
46615
+ if (ua.includes("Safari") && !ua.includes("Chrome")) {
46616
+ iframeEl.classList.add("rr-block");
46617
+ iframeEl.setAttribute("__rrwebUntaintedMutationObserver", "");
46618
+ untaintedBaseIframeCleanup[key] = () => iframeEl.remove();
46619
+ } else {
46620
+ iframeEl.remove();
46621
+ }
46622
+ return untaintedBasePrototype[key] = untaintedObject;
46487
46623
  } catch {
46488
46624
  return defaultPrototype;
46489
46625
  }
46490
46626
  }
46491
- const untaintedAccessorCache$1 = {};
46492
- function getUntaintedAccessor$1(key, instance, accessor) {
46493
- var _a2;
46494
- const cacheKey = `${key}.${String(accessor)}`;
46495
- if (untaintedAccessorCache$1[cacheKey])
46496
- return untaintedAccessorCache$1[cacheKey].call(
46497
- instance
46498
- );
46499
- const untaintedPrototype = getUntaintedPrototype$1(key);
46500
- const untaintedAccessor = (_a2 = Object.getOwnPropertyDescriptor(
46627
+ const untaintedAccessorCache = {};
46628
+ function getUntaintedAccessor(key, instance, accessor) {
46629
+ var _a2, _b;
46630
+ const cached = (_a2 = untaintedAccessorCache[key]) == null ? void 0 : _a2[accessor];
46631
+ if (cached) return cached.call(instance);
46632
+ const untaintedPrototype = getUntaintedPrototype(key);
46633
+ const untaintedAccessor = (_b = Object.getOwnPropertyDescriptor(
46501
46634
  untaintedPrototype,
46502
46635
  accessor
46503
- )) == null ? void 0 : _a2.get;
46636
+ )) == null ? void 0 : _b.get;
46504
46637
  if (!untaintedAccessor) return instance[accessor];
46505
- untaintedAccessorCache$1[cacheKey] = untaintedAccessor;
46638
+ (untaintedAccessorCache[key] || (untaintedAccessorCache[key] = {}))[accessor] = untaintedAccessor;
46506
46639
  return untaintedAccessor.call(instance);
46507
46640
  }
46508
- const untaintedMethodCache$1 = {};
46509
- function getUntaintedMethod$1(key, instance, method) {
46641
+ const untaintedMethodCache = {};
46642
+ function getUntaintedMethod(key, instance, method) {
46510
46643
  var _a2, _b, _c;
46511
46644
  const cacheKey = `${key}.${String(method)}`;
46512
- if (untaintedMethodCache$1[cacheKey])
46513
- return untaintedMethodCache$1[cacheKey].bind(
46645
+ if (untaintedMethodCache[cacheKey])
46646
+ return untaintedMethodCache[cacheKey].bind(
46514
46647
  instance
46515
46648
  );
46516
46649
  const zoneSymbol = (_b = (_a2 = globalThis == null ? void 0 : globalThis.Zone) == null ? void 0 : _a2.__symbol__) == null ? void 0 : _b.call(
@@ -46521,67 +46654,106 @@ function getUntaintedMethod$1(key, instance, method) {
46521
46654
  const classProto = (_c = globalThis[key]) == null ? void 0 : _c.prototype;
46522
46655
  const nativeFromZone = globalThis[zoneSymbol] ?? (classProto == null ? void 0 : classProto[zoneSymbol]);
46523
46656
  if (typeof nativeFromZone === "function") {
46524
- untaintedMethodCache$1[cacheKey] = nativeFromZone;
46657
+ untaintedMethodCache[cacheKey] = nativeFromZone;
46525
46658
  return nativeFromZone.bind(
46526
46659
  instance
46527
46660
  );
46528
46661
  }
46529
46662
  }
46530
- const untaintedPrototype = getUntaintedPrototype$1(key);
46663
+ const untaintedPrototype = getUntaintedPrototype(key);
46531
46664
  const untaintedMethod = untaintedPrototype[method];
46532
46665
  if (typeof untaintedMethod !== "function") return instance[method];
46533
- untaintedMethodCache$1[cacheKey] = untaintedMethod;
46666
+ untaintedMethodCache[cacheKey] = untaintedMethod;
46534
46667
  return untaintedMethod.bind(instance);
46535
46668
  }
46536
- function childNodes$1(n2) {
46537
- return getUntaintedAccessor$1("Node", n2, "childNodes");
46669
+ function ownerDocument(n) {
46670
+ return getUntaintedAccessor("Node", n, "ownerDocument");
46671
+ }
46672
+ function childNodes(n) {
46673
+ return getUntaintedAccessor("Node", n, "childNodes");
46538
46674
  }
46539
- function parentNode$1(n2) {
46540
- return getUntaintedAccessor$1("Node", n2, "parentNode");
46675
+ function parentNode(n) {
46676
+ return getUntaintedAccessor("Node", n, "parentNode");
46541
46677
  }
46542
- function parentElement$1(n2) {
46543
- return getUntaintedAccessor$1("Node", n2, "parentElement");
46678
+ function parentElement(n) {
46679
+ return getUntaintedAccessor("Node", n, "parentElement");
46544
46680
  }
46545
- function textContent$1(n2) {
46546
- return getUntaintedAccessor$1("Node", n2, "textContent");
46681
+ function textContent(n) {
46682
+ return getUntaintedAccessor("Node", n, "textContent");
46547
46683
  }
46548
- function contains$1(n2, other) {
46549
- return getUntaintedMethod$1("Node", n2, "contains")(other);
46684
+ function firstChild(n) {
46685
+ return getUntaintedAccessor("Node", n, "firstChild");
46550
46686
  }
46551
- function getRootNode$1(n2) {
46552
- return getUntaintedMethod$1("Node", n2, "getRootNode")();
46687
+ function lastChild(n) {
46688
+ return getUntaintedAccessor("Node", n, "lastChild");
46553
46689
  }
46554
- function host$1(n2) {
46555
- if (!n2 || !("host" in n2)) return null;
46556
- return getUntaintedAccessor$1("ShadowRoot", n2, "host");
46690
+ function nextSibling(n) {
46691
+ return getUntaintedAccessor("Node", n, "nextSibling");
46557
46692
  }
46558
- function styleSheets$1(n2) {
46559
- return n2.styleSheets;
46693
+ function previousSibling(n) {
46694
+ return getUntaintedAccessor("Node", n, "previousSibling");
46560
46695
  }
46561
- function shadowRoot$1(n2) {
46562
- if (!n2 || !("shadowRoot" in n2)) return null;
46563
- return getUntaintedAccessor$1("Element", n2, "shadowRoot");
46696
+ function contains(n, other) {
46697
+ return getUntaintedMethod("Node", n, "contains")(other);
46564
46698
  }
46565
- function querySelector$1(n2, selectors) {
46566
- return getUntaintedMethod$1("Element", n2, "querySelector")(selectors);
46699
+ function getRootNode(n) {
46700
+ return getUntaintedMethod("Node", n, "getRootNode")();
46567
46701
  }
46568
- function querySelectorAll$1(n2, selectors) {
46569
- return getUntaintedMethod$1("Element", n2, "querySelectorAll")(selectors);
46702
+ function host(n) {
46703
+ if (!n || !("host" in n)) return null;
46704
+ return getUntaintedAccessor("ShadowRoot", n, "host");
46570
46705
  }
46571
- function addEventListener$1(n2, type, listener, options) {
46572
- getUntaintedMethod$1("EventTarget", n2, "addEventListener")(type, listener, options);
46706
+ function styleSheets(n) {
46707
+ return n.styleSheets;
46573
46708
  }
46574
- function removeEventListener$1(n2, type, listener, options) {
46575
- getUntaintedMethod$1("EventTarget", n2, "removeEventListener")(
46709
+ function shadowRoot(n) {
46710
+ if (!n || !("shadowRoot" in n)) return null;
46711
+ return getUntaintedAccessor("Element", n, "shadowRoot");
46712
+ }
46713
+ function querySelector(n, selectors) {
46714
+ return getUntaintedMethod("Element", n, "querySelector")(selectors);
46715
+ }
46716
+ function querySelectorAll(n, selectors) {
46717
+ return getUntaintedMethod("Element", n, "querySelectorAll")(selectors);
46718
+ }
46719
+ function addEventListener(n, type, listener, options) {
46720
+ getUntaintedMethod("EventTarget", n, "addEventListener")(type, listener, options);
46721
+ }
46722
+ function removeEventListener(n, type, listener, options) {
46723
+ getUntaintedMethod("EventTarget", n, "removeEventListener")(
46576
46724
  type,
46577
46725
  listener,
46578
46726
  options
46579
46727
  );
46580
46728
  }
46581
- function mutationObserverCtor$1() {
46582
- return getUntaintedPrototype$1("MutationObserver").constructor;
46729
+ function mutationObserverCtor() {
46730
+ return [
46731
+ getUntaintedPrototype("MutationObserver").constructor,
46732
+ untaintedBaseIframeCleanup["MutationObserver"] ?? (() => {
46733
+ })
46734
+ ];
46583
46735
  }
46584
- function patch$1(source, name, replacement) {
46736
+ function getUntaintedProxy() {
46737
+ var _a2, _b;
46738
+ let Proxy3 = window.Proxy;
46739
+ try {
46740
+ if (typeof window.Proxy !== "function" || !((_a2 = window.Proxy) == null ? void 0 : _a2.toString().includes("[native code]"))) {
46741
+ const cleanFrame = document.createElement("iframe");
46742
+ cleanFrame.style.display = "none";
46743
+ document.documentElement.appendChild(cleanFrame);
46744
+ Proxy3 = ((_b = cleanFrame.contentWindow) == null ? void 0 : _b.Proxy) || window.Proxy;
46745
+ document.documentElement.removeChild(cleanFrame);
46746
+ }
46747
+ } catch (err) {
46748
+ console.debug("Unable to get untainted Proxy from iframe", err);
46749
+ }
46750
+ return Proxy3;
46751
+ }
46752
+ let nowTimestamp = Date.now;
46753
+ if (!/* @__PURE__ */ /[1-9][0-9]{12}/.test(Date.now().toString())) {
46754
+ nowTimestamp = () => (/* @__PURE__ */ new Date()).getTime();
46755
+ }
46756
+ function patch(source, name, replacement) {
46585
46757
  try {
46586
46758
  if (!(name in source)) {
46587
46759
  return () => {
@@ -46607,40 +46779,46 @@ function patch$1(source, name, replacement) {
46607
46779
  };
46608
46780
  }
46609
46781
  }
46610
- const index$1 = {
46611
- childNodes: childNodes$1,
46612
- parentNode: parentNode$1,
46613
- parentElement: parentElement$1,
46614
- textContent: textContent$1,
46615
- contains: contains$1,
46616
- getRootNode: getRootNode$1,
46617
- host: host$1,
46618
- styleSheets: styleSheets$1,
46619
- shadowRoot: shadowRoot$1,
46620
- querySelector: querySelector$1,
46621
- querySelectorAll: querySelectorAll$1,
46622
- addEventListener: addEventListener$1,
46623
- removeEventListener: removeEventListener$1,
46624
- mutationObserver: mutationObserverCtor$1,
46625
- patch: patch$1
46626
- };
46627
- function isElement(n2) {
46628
- return n2.nodeType === n2.ELEMENT_NODE;
46629
- }
46630
- function isShadowRoot(n2) {
46782
+ const index = {
46783
+ ownerDocument,
46784
+ childNodes,
46785
+ parentNode,
46786
+ parentElement,
46787
+ textContent,
46788
+ firstChild,
46789
+ lastChild,
46790
+ nextSibling,
46791
+ previousSibling,
46792
+ contains,
46793
+ getRootNode,
46794
+ host,
46795
+ styleSheets,
46796
+ shadowRoot,
46797
+ querySelector,
46798
+ querySelectorAll,
46799
+ addEventListener,
46800
+ removeEventListener,
46801
+ nowTimestamp,
46802
+ mutationObserverCtor,
46803
+ patch
46804
+ };
46805
+ function isElement(n) {
46806
+ return n.nodeType === n.ELEMENT_NODE;
46807
+ }
46808
+ function isShadowRoot(n) {
46631
46809
  const hostEl = (
46632
46810
  // anchor and textarea elements also have a `host` property
46633
46811
  // but only shadow roots have a `mode` property
46634
- n2 && "host" in n2 && "mode" in n2 && index$1.host(n2) || null
46812
+ n && "host" in n && "mode" in n && index.host(n) || null
46635
46813
  );
46636
46814
  return Boolean(
46637
- hostEl && "shadowRoot" in hostEl && index$1.shadowRoot(hostEl) === n2
46815
+ hostEl && "shadowRoot" in hostEl && index.shadowRoot(hostEl) === n
46638
46816
  );
46639
46817
  }
46640
46818
  function isNativeShadowDom(shadowRoot2) {
46641
46819
  return Object.prototype.toString.call(shadowRoot2) === "[object ShadowRoot]";
46642
46820
  }
46643
- function getNative$1(symbolName, windowObj = window) {
46821
+ function getNative(symbolName, windowObj = window) {
46644
46822
  var _a2, _b;
46645
46823
  const windowWithZone = windowObj;
46646
46824
  const angularZoneSymbol = (_b = (_a2 = windowWithZone == null ? void 0 : windowWithZone.Zone) == null ? void 0 : _a2.__symbol__) == null ? void 0 : _b.call(_a2, symbolName);
@@ -46652,7 +46830,7 @@ function getNative$1(symbolName, windowObj = window) {
46652
46830
  }
46653
46831
  return windowWithZone[symbolName];
46654
46832
  }
46655
- const nativeSetTimeout = typeof window !== "undefined" ? getNative$1("setTimeout").bind(window) : global.setTimeout;
46833
+ const nativeSetTimeout = typeof window !== "undefined" ? getNative("setTimeout").bind(window) : global.setTimeout;
46656
46834
  function fixBrowserCompatibilityIssuesInCSS(cssText) {
46657
46835
  if (cssText.includes(" background-clip: text;") && !cssText.includes(" -webkit-background-clip: text;")) {
46658
46836
  cssText = cssText.replace(
@@ -46679,18 +46857,18 @@ function escapeImportStatement(rule) {
46679
46857
  }
46680
46858
  return statement.join(" ") + ";";
46681
46859
  }
46682
- function stringifyStylesheet(s2) {
46860
+ function stringifyStylesheet(s) {
46683
46861
  try {
46684
- const rules2 = s2.rules || s2.cssRules;
46685
- if (!rules2) {
46862
+ const rules = s.rules || s.cssRules;
46863
+ if (!rules) {
46686
46864
  return null;
46687
46865
  }
46688
- let sheetHref = s2.href;
46689
- if (!sheetHref && s2.ownerNode) {
46690
- sheetHref = s2.ownerNode.baseURI;
46866
+ let sheetHref = s.href;
46867
+ if (!sheetHref && s.ownerNode) {
46868
+ sheetHref = s.ownerNode.baseURI;
46691
46869
  }
46692
46870
  const stringifiedRules = Array.from(
46693
- rules2,
46871
+ rules,
46694
46872
  (rule) => stringifyRule(rule, sheetHref)
46695
46873
  ).join("");
46696
46874
  return fixBrowserCompatibilityIssuesInCSS(stringifiedRules);
@@ -46736,8 +46914,8 @@ function replaceChromeGridTemplateAreas(rule) {
46736
46914
  );
46737
46915
  if (hasGridTemplateInCSSText && hasGridTemplateAreaInStyleRules && !hasGridTemplateAreaInCSSText) {
46738
46916
  const styleDeclarations = [];
46739
- for (let i2 = 0; i2 < rule.style.length; i2++) {
46740
- const styleName = rule.style[i2];
46917
+ for (let i = 0; i < rule.style.length; i++) {
46918
+ const styleName = rule.style[i];
46741
46919
  const styleValue = rule.style.getPropertyValue(styleName);
46742
46920
  styleDeclarations.push(`${styleName}: ${styleValue}`);
46743
46921
  }
@@ -46757,13 +46935,13 @@ function isCSSStyleRule(rule) {
46757
46935
  }
46758
46936
  class Mirror {
46759
46937
  constructor() {
46760
- __publicField$1(this, "idNodeMap", /* @__PURE__ */ new Map());
46761
- __publicField$1(this, "nodeMetaMap", /* @__PURE__ */ new WeakMap());
46938
+ __publicField(this, "idNodeMap", /* @__PURE__ */ new Map());
46939
+ __publicField(this, "nodeMetaMap", /* @__PURE__ */ new WeakMap());
46762
46940
  }
46763
- getId(n2) {
46941
+ getId(n) {
46764
46942
  var _a2;
46765
- if (!n2) return -1;
46766
- const id = (_a2 = this.getMeta(n2)) == null ? void 0 : _a2.id;
46943
+ if (!n) return -1;
46944
+ const id = (_a2 = this.getMeta(n)) == null ? void 0 : _a2.id;
46767
46945
  return id ?? -1;
46768
46946
  }
46769
46947
  getNode(id) {
@@ -46772,16 +46950,16 @@ class Mirror {
46772
46950
  getIds() {
46773
46951
  return Array.from(this.idNodeMap.keys());
46774
46952
  }
46775
- getMeta(n2) {
46776
- return this.nodeMetaMap.get(n2) || null;
46953
+ getMeta(n) {
46954
+ return this.nodeMetaMap.get(n) || null;
46777
46955
  }
46778
46956
  // removes the node from idNodeMap
46779
46957
  // doesn't remove the node from nodeMetaMap
46780
- removeNodeFromMap(n2) {
46781
- const id = this.getId(n2);
46958
+ removeNodeFromMap(n) {
46959
+ const id = this.getId(n);
46782
46960
  this.idNodeMap.delete(id);
46783
- if (n2.childNodes) {
46784
- n2.childNodes.forEach(
46961
+ if (n.childNodes) {
46962
+ n.childNodes.forEach(
46785
46963
  (childNode) => this.removeNodeFromMap(childNode)
46786
46964
  );
46787
46965
  }
@@ -46792,25 +46970,25 @@ class Mirror {
46792
46970
  hasNode(node) {
46793
46971
  return this.nodeMetaMap.has(node);
46794
46972
  }
46795
- add(n2, meta) {
46973
+ add(n, meta) {
46796
46974
  const id = meta.id;
46797
- this.idNodeMap.set(id, n2);
46798
- this.nodeMetaMap.set(n2, meta);
46975
+ this.idNodeMap.set(id, n);
46976
+ this.nodeMetaMap.set(n, meta);
46799
46977
  }
46800
- replace(id, n2) {
46978
+ replace(id, n) {
46801
46979
  const oldNode = this.getNode(id);
46802
46980
  if (oldNode) {
46803
46981
  const meta = this.nodeMetaMap.get(oldNode);
46804
- if (meta) this.nodeMetaMap.set(n2, meta);
46982
+ if (meta) this.nodeMetaMap.set(n, meta);
46805
46983
  }
46806
- this.idNodeMap.set(id, n2);
46984
+ this.idNodeMap.set(id, n);
46807
46985
  }
46808
46986
  reset() {
46809
46987
  this.idNodeMap = /* @__PURE__ */ new Map();
46810
46988
  this.nodeMetaMap = /* @__PURE__ */ new WeakMap();
46811
46989
  }
46812
46990
  }
46813
- function createMirror$2() {
46991
+ function createMirror() {
46814
46992
  return new Mirror();
46815
46993
  }
46816
46994
  function maskInputValue({
@@ -46910,8 +47088,10 @@ function absolutifyURLs(cssText, href) {
46910
47088
  if (filePath[0] === "/") {
46911
47089
  return `url(${maybeQuote}${extractOrigin(href) + filePath}${maybeQuote})`;
46912
47090
  }
46913
- const stack = href.split("/");
46914
- const parts = filePath.split("/");
47091
+ const filePathNoHash = filePath.split("#")[0];
47092
+ const maybeHash = filePath.substring(filePathNoHash.length);
47093
+ const stack = href.split("#")[0].split("/");
47094
+ const parts = filePathNoHash.split("/");
46915
47095
  stack.pop();
46916
47096
  for (const part of parts) {
46917
47097
  if (part === ".") {
@@ -46922,7 +47102,7 @@ function absolutifyURLs(cssText, href) {
46922
47102
  stack.push(part);
46923
47103
  }
46924
47104
  }
46925
- return `url(${maybeQuote}${stack.join("/")}${maybeQuote})`;
47105
+ return `url(${maybeQuote}${stack.join("/")}${maybeHash}${maybeQuote})`;
46926
47106
  }
46927
47107
  );
46928
47108
  }
@@ -46940,10 +47120,10 @@ function splitCssText(cssText, style, _testNoPxNorm = false) {
46940
47120
  if (childNodes2.length > 1 && cssText && typeof cssText === "string") {
46941
47121
  let cssTextNorm = normalizeCssString(cssText, _testNoPxNorm);
46942
47122
  const normFactor = cssTextNorm.length / cssText.length;
46943
- for (let i2 = 1; i2 < childNodes2.length; i2++) {
46944
- if (childNodes2[i2].textContent && typeof childNodes2[i2].textContent === "string") {
47123
+ for (let i = 1; i < childNodes2.length; i++) {
47124
+ if (childNodes2[i].textContent && typeof childNodes2[i].textContent === "string") {
46945
47125
  const textContentNorm = normalizeCssString(
46946
- childNodes2[i2].textContent,
47126
+ childNodes2[i].textContent,
46947
47127
  _testNoPxNorm
46948
47128
  );
46949
47129
  const jLimit = 100;
@@ -46964,7 +47144,7 @@ function splitCssText(cssText, style, _testNoPxNorm = false) {
46964
47144
  let splitNorm = -1;
46965
47145
  if (cssNormSplits.length === 2) {
46966
47146
  splitNorm = cssNormSplits[0].length;
46967
- } else if (cssNormSplits.length > 2 && cssNormSplits[0] === "" && childNodes2[i2 - 1].textContent !== "") {
47147
+ } else if (cssNormSplits.length > 2 && cssNormSplits[0] === "" && childNodes2[i - 1].textContent !== "") {
46968
47148
  splitNorm = cssTextNorm.indexOf(startSubstring, 1);
46969
47149
  } else if (cssNormSplits.length === 1) {
46970
47150
  startSubstring = startSubstring.substring(
@@ -46981,7 +47161,7 @@ function splitCssText(cssText, style, _testNoPxNorm = false) {
46981
47161
  splitNorm = cssTextNorm.indexOf(startSubstring);
46982
47162
  }
46983
47163
  if (cssNormSplits.length >= 2 && j > jLimit) {
46984
- const prevTextContent = childNodes2[i2 - 1].textContent;
47164
+ const prevTextContent = childNodes2[i - 1].textContent;
46985
47165
  if (prevTextContent && typeof prevTextContent === "string") {
46986
47166
  const prevMinLength = normalizeCssString(prevTextContent).length;
46987
47167
  splitNorm = cssTextNorm.indexOf(startSubstring, prevMinLength);
@@ -47037,7 +47217,7 @@ const IGNORED_NODE = -2;
47037
47217
  function genId() {
47038
47218
  return _id++;
47039
47219
  }
47040
- function getValidTagName$1(element) {
47220
+ function getValidTagName(element) {
47041
47221
  if (element instanceof HTMLFormElement) {
47042
47222
  return "form";
47043
47223
  }
@@ -47081,24 +47261,24 @@ function getAbsoluteSrcsetString(doc, attributeValue) {
47081
47261
  url = absoluteToDoc(doc, url);
47082
47262
  let inParens = false;
47083
47263
  while (true) {
47084
- const c2 = attributeValue.charAt(pos);
47085
- if (c2 === "") {
47264
+ const c = attributeValue.charAt(pos);
47265
+ if (c === "") {
47086
47266
  output.push((url + descriptorsStr).trim());
47087
47267
  break;
47088
47268
  } else if (!inParens) {
47089
- if (c2 === ",") {
47269
+ if (c === ",") {
47090
47270
  pos += 1;
47091
47271
  output.push((url + descriptorsStr).trim());
47092
47272
  break;
47093
- } else if (c2 === "(") {
47273
+ } else if (c === "(") {
47094
47274
  inParens = true;
47095
47275
  }
47096
47276
  } else {
47097
- if (c2 === ")") {
47277
+ if (c === ")") {
47098
47278
  inParens = false;
47099
47279
  }
47100
47280
  }
47101
- descriptorsStr += c2;
47281
+ descriptorsStr += c;
47102
47282
  pos += 1;
47103
47283
  }
47104
47284
  }
@@ -47116,18 +47296,18 @@ function isSVGElement(el) {
47116
47296
  return Boolean(el.tagName === "svg" || el.ownerSVGElement);
47117
47297
  }
47118
47298
  function getHref(doc, customHref) {
47119
- let a2 = cachedDocument.get(doc);
47120
- if (!a2) {
47121
- a2 = doc.createElement("a");
47122
- cachedDocument.set(doc, a2);
47299
+ let a = cachedDocument.get(doc);
47300
+ if (!a) {
47301
+ a = doc.createElement("a");
47302
+ cachedDocument.set(doc, a);
47123
47303
  }
47124
47304
  if (!customHref) {
47125
47305
  customHref = "";
47126
47306
  } else if (customHref.startsWith("blob:") || customHref.startsWith("data:")) {
47127
47307
  return customHref;
47128
47308
  }
47129
- a2.setAttribute("href", customHref);
47130
- return a2.href;
47309
+ a.setAttribute("href", customHref);
47310
+ return a.href;
47131
47311
  }
47132
47312
  function transformAttribute(doc, tagName, name, value) {
47133
47313
  if (!value) {
@@ -47137,7 +47317,7 @@ function transformAttribute(doc, tagName, name, value) {
47137
47317
  return absoluteToDoc(doc, value);
47138
47318
  } else if (name === "xlink:href" && value[0] !== "#") {
47139
47319
  return absoluteToDoc(doc, value);
47140
- } else if (name === "background" && (tagName === "table" || tagName === "td" || tagName === "th")) {
47320
+ } else if (name === "background" && ["table", "td", "th"].includes(tagName)) {
47141
47321
  return absoluteToDoc(doc, value);
47142
47322
  } else if (name === "srcset") {
47143
47323
  return getAbsoluteSrcsetString(doc, value);
@@ -47149,7 +47329,7 @@ function transformAttribute(doc, tagName, name, value) {
47149
47329
  return value;
47150
47330
  }
47151
47331
  function ignoreAttribute(tagName, name, _value) {
47152
- return (tagName === "video" || tagName === "audio") && name === "autoplay";
47332
+ return ["video", "audio"].includes(tagName) && toLowerCase(name) === "autoplay";
47153
47333
  }
47154
47334
  function _isBlockedElement(element, blockClass, blockSelector) {
47155
47335
  try {
@@ -47168,7 +47348,7 @@ function _isBlockedElement(element, blockClass, blockSelector) {
47168
47348
  if (blockSelector) {
47169
47349
  return element.matches(blockSelector);
47170
47350
  }
47171
- } catch (e2) {
47351
+ } catch (e) {
47172
47352
  }
47173
47353
  return false;
47174
47354
  }
@@ -47177,7 +47357,7 @@ function classMatchesRegex(node, regex, checkAncestors) {
47177
47357
  if (!regex) return false;
47178
47358
  if (node.nodeType !== node.ELEMENT_NODE) {
47179
47359
  if (!checkAncestors) return false;
47180
- return classMatchesRegex(index$1.parentNode(node), regex, checkAncestors);
47360
+ return classMatchesRegex(index.parentNode(node), regex, checkAncestors);
47181
47361
  }
47182
47362
  for (let eIndex = node.classList.length; eIndex--; ) {
47183
47363
  const className = node.classList[eIndex];
@@ -47186,20 +47366,20 @@ function classMatchesRegex(node, regex, checkAncestors) {
47186
47366
  }
47187
47367
  }
47188
47368
  if (!checkAncestors) return false;
47189
- return classMatchesRegex(index$1.parentNode(node), regex, checkAncestors);
47369
+ return classMatchesRegex(index.parentNode(node), regex, checkAncestors);
47190
47370
  }
47191
47371
  function needMaskingText(node, maskTextClass, maskTextSelector, checkAncestors) {
47192
47372
  let el;
47193
47373
  if (isElement(node)) {
47194
47374
  el = node;
47195
47375
  if (maskTextSelector === "*") return true;
47196
- if (!index$1.childNodes(el).length) {
47376
+ if (!index.childNodes(el).length) {
47197
47377
  return false;
47198
47378
  }
47199
- } else if (index$1.parentElement(node) === null) {
47379
+ } else if (index.parentElement(node) === null) {
47200
47380
  return false;
47201
47381
  } else {
47202
- el = index$1.parentElement(node);
47382
+ el = index.parentElement(node);
47203
47383
  }
47204
47384
  try {
47205
47385
  if (typeof maskTextClass === "string") {
@@ -47218,7 +47398,7 @@ function needMaskingText(node, maskTextClass, maskTextSelector, checkAncestors)
47218
47398
  if (el.matches(maskTextSelector)) return true;
47219
47399
  }
47220
47400
  }
47221
- } catch (e2) {
47401
+ } catch (e) {
47222
47402
  }
47223
47403
  return false;
47224
47404
  }
@@ -47276,7 +47456,7 @@ function onceStylesheetLoaded(link, listener, styleSheetLoadTimeout) {
47276
47456
  listener();
47277
47457
  });
47278
47458
  }
47279
- function serializeNode(n2, options) {
47459
+ function serializeNode(n, options) {
47280
47460
  const {
47281
47461
  doc,
47282
47462
  mirror: mirror2,
@@ -47296,31 +47476,31 @@ function serializeNode(n2, options) {
47296
47476
  cssCaptured = false
47297
47477
  } = options;
47298
47478
  const rootId = getRootId(doc, mirror2);
47299
- switch (n2.nodeType) {
47300
- case n2.DOCUMENT_NODE:
47301
- if (n2.compatMode !== "CSS1Compat") {
47479
+ switch (n.nodeType) {
47480
+ case n.DOCUMENT_NODE:
47481
+ if (n.compatMode !== "CSS1Compat") {
47302
47482
  return {
47303
- type: NodeType$3.Document,
47483
+ type: NodeType.Document,
47304
47484
  childNodes: [],
47305
- compatMode: n2.compatMode
47485
+ compatMode: n.compatMode
47306
47486
  // probably "BackCompat"
47307
47487
  };
47308
47488
  } else {
47309
47489
  return {
47310
- type: NodeType$3.Document,
47490
+ type: NodeType.Document,
47311
47491
  childNodes: []
47312
47492
  };
47313
47493
  }
47314
- case n2.DOCUMENT_TYPE_NODE:
47494
+ case n.DOCUMENT_TYPE_NODE:
47315
47495
  return {
47316
- type: NodeType$3.DocumentType,
47317
- name: n2.name,
47318
- publicId: n2.publicId,
47319
- systemId: n2.systemId,
47496
+ type: NodeType.DocumentType,
47497
+ name: n.name,
47498
+ publicId: n.publicId,
47499
+ systemId: n.systemId,
47320
47500
  rootId
47321
47501
  };
47322
- case n2.ELEMENT_NODE:
47323
- return serializeElementNode(n2, {
47502
+ case n.ELEMENT_NODE:
47503
+ return serializeElementNode(n, {
47324
47504
  doc,
47325
47505
  blockClass,
47326
47506
  blockSelector,
@@ -47336,8 +47516,8 @@ function serializeNode(n2, options) {
47336
47516
  rootId,
47337
47517
  needsMask
47338
47518
  });
47339
- case n2.TEXT_NODE:
47340
- return serializeTextNode(n2, {
47519
+ case n.TEXT_NODE:
47520
+ return serializeTextNode(n, {
47341
47521
  doc,
47342
47522
  needsMask,
47343
47523
  maskTextFn,
@@ -47346,16 +47526,16 @@ function serializeNode(n2, options) {
47346
47526
  rootId,
47347
47527
  cssCaptured
47348
47528
  });
47349
- case n2.CDATA_SECTION_NODE:
47529
+ case n.CDATA_SECTION_NODE:
47350
47530
  return {
47351
- type: NodeType$3.CDATA,
47531
+ type: NodeType.CDATA,
47352
47532
  textContent: "",
47353
47533
  rootId
47354
47534
  };
47355
- case n2.COMMENT_NODE:
47535
+ case n.COMMENT_NODE:
47356
47536
  return {
47357
- type: NodeType$3.Comment,
47358
- textContent: index$1.textContent(n2) || "",
47537
+ type: NodeType.Comment,
47538
+ textContent: index.textContent(n) || "",
47359
47539
  rootId
47360
47540
  };
47361
47541
  default:
@@ -47367,7 +47547,7 @@ function getRootId(doc, mirror2) {
47367
47547
  const docId = mirror2.getId(doc);
47368
47548
  return docId === 1 ? void 0 : docId;
47369
47549
  }
47370
- function serializeTextNode(n2, options) {
47550
+ function serializeTextNode(n, options) {
47371
47551
  var _a2;
47372
47552
  const {
47373
47553
  needsMask,
@@ -47377,23 +47557,23 @@ function serializeTextNode(n2, options) {
47377
47557
  rootId,
47378
47558
  cssCaptured
47379
47559
  } = options;
47380
- const parentTagName = n2.parentNode && n2.parentNode.tagName;
47560
+ const parentTagName = n.parentNode && n.parentNode.tagName;
47381
47561
  let textContent2 = "";
47382
47562
  const isStyle = parentTagName === "STYLE" ? true : void 0;
47383
47563
  const isScript = parentTagName === "SCRIPT" ? true : void 0;
47384
47564
  const isTextarea = parentTagName === "TEXTAREA" ? true : void 0;
47385
47565
  if (isStyle && textContent2) {
47386
47566
  try {
47387
- if (n2.nextSibling || n2.previousSibling) {
47388
- } else if ((_a2 = n2.parentNode.sheet) == null ? void 0 : _a2.cssRules) {
47567
+ if (n.nextSibling || n.previousSibling) {
47568
+ } else if ((_a2 = n.parentNode.sheet) == null ? void 0 : _a2.cssRules) {
47389
47569
  textContent2 = stringifyStylesheet(
47390
- n2.parentNode.sheet
47570
+ n.parentNode.sheet
47391
47571
  );
47392
47572
  }
47393
47573
  } catch (err) {
47394
47574
  console.warn(
47395
47575
  `Cannot get CSS styles from text's parentNode. Error: ${err}`,
47396
- n2
47576
+ n
47397
47577
  );
47398
47578
  }
47399
47579
  textContent2 = absolutifyURLs(textContent2, getHref(options.doc));
@@ -47401,24 +47581,24 @@ function serializeTextNode(n2, options) {
47401
47581
  if (isScript) {
47402
47582
  textContent2 = "SCRIPT_PLACEHOLDER";
47403
47583
  } else if (!cssCaptured) {
47404
- textContent2 = index$1.textContent(n2);
47584
+ textContent2 = index.textContent(n);
47405
47585
  if (isStyle && textContent2) {
47406
47586
  textContent2 = absolutifyURLs(textContent2, getHref(options.doc));
47407
47587
  }
47408
47588
  }
47409
47589
  if (!isStyle && !isScript && textContent2 && needsMask) {
47410
- textContent2 = maskTextFn ? maskTextFn(textContent2, index$1.parentElement(n2)) : textContent2.replace(/[\S]/g, "*");
47590
+ textContent2 = maskTextFn ? maskTextFn(textContent2, index.parentElement(n)) : textContent2.replace(/[\S]/g, "*");
47411
47591
  }
47412
47592
  if (isTextarea && textContent2 && maskInputOptions.textarea) {
47413
- textContent2 = maskInputFn ? maskInputFn(textContent2, n2.parentNode) : textContent2.replace(/[\S]/g, "*");
47593
+ textContent2 = maskInputFn ? maskInputFn(textContent2, n.parentNode) : textContent2.replace(/[\S]/g, "*");
47414
47594
  }
47415
47595
  return {
47416
- type: NodeType$3.Text,
47596
+ type: NodeType.Text,
47417
47597
  textContent: textContent2 || "",
47418
47598
  rootId
47419
47599
  };
47420
47600
  }
47421
- function serializeElementNode(n2, options) {
47601
+ function serializeElementNode(n, options) {
47422
47602
  const {
47423
47603
  doc,
47424
47604
  blockClass,
@@ -47435,13 +47615,13 @@ function serializeElementNode(n2, options) {
47435
47615
  rootId,
47436
47616
  needsMask
47437
47617
  } = options;
47438
- const needBlock = _isBlockedElement(n2, blockClass, blockSelector);
47439
- const needHide = needBlock && hideSelector ? _isBlockedElement(n2, "", hideSelector) : false;
47440
- const tagName = getValidTagName$1(n2);
47618
+ const needBlock = _isBlockedElement(n, blockClass, blockSelector);
47619
+ const needHide = needBlock && hideSelector ? _isBlockedElement(n, "", hideSelector) : false;
47620
+ const tagName = getValidTagName(n);
47441
47621
  let attributes = {};
47442
- const len = n2.attributes.length;
47443
- for (let i2 = 0; i2 < len; i2++) {
47444
- const attr = n2.attributes[i2];
47622
+ const len = n.attributes.length;
47623
+ for (let i = 0; i < len; i++) {
47624
+ const attr = n.attributes[i];
47445
47625
  if (!ignoreAttribute(tagName, attr.name, attr.value)) {
47446
47626
  attributes[attr.name] = transformAttribute(
47447
47627
  doc,
@@ -47452,8 +47632,8 @@ function serializeElementNode(n2, options) {
47452
47632
  }
47453
47633
  }
47454
47634
  if (tagName === "link" && inlineStylesheet) {
47455
- const stylesheet = Array.from(doc.styleSheets).find((s2) => {
47456
- return s2.href === n2.href;
47635
+ const stylesheet = Array.from(doc.styleSheets).find((s) => {
47636
+ return s.href === n.href;
47457
47637
  });
47458
47638
  let cssText = null;
47459
47639
  if (stylesheet) {
@@ -47465,24 +47645,24 @@ function serializeElementNode(n2, options) {
47465
47645
  attributes._cssText = cssText;
47466
47646
  }
47467
47647
  }
47468
- if (tagName === "style" && n2.sheet) {
47648
+ if (tagName === "style" && n.sheet) {
47469
47649
  let cssText = stringifyStylesheet(
47470
- n2.sheet
47650
+ n.sheet
47471
47651
  );
47472
47652
  if (cssText) {
47473
- if (n2.childNodes.length > 1) {
47474
- cssText = markCssSplits(cssText, n2);
47653
+ if (n.childNodes.length > 1) {
47654
+ cssText = markCssSplits(cssText, n);
47475
47655
  }
47476
47656
  attributes._cssText = cssText;
47477
47657
  }
47478
47658
  }
47479
- if (tagName === "input" || tagName === "textarea" || tagName === "select") {
47480
- const value = n2.value;
47481
- const checked = n2.checked;
47659
+ if (["input", "textarea", "select"].includes(tagName)) {
47660
+ const value = n.value;
47661
+ const checked = n.checked;
47482
47662
  if (attributes.type !== "radio" && attributes.type !== "checkbox" && attributes.type !== "submit" && attributes.type !== "button" && value) {
47483
47663
  attributes.value = maskInputValue({
47484
- element: n2,
47485
- type: getInputType(n2),
47664
+ element: n,
47665
+ type: getInputType(n),
47486
47666
  tagName,
47487
47667
  value,
47488
47668
  maskInputOptions,
@@ -47494,31 +47674,31 @@ function serializeElementNode(n2, options) {
47494
47674
  }
47495
47675
  }
47496
47676
  if (tagName === "option") {
47497
- if (n2.selected && !maskInputOptions["select"]) {
47677
+ if (n.selected && !maskInputOptions["select"]) {
47498
47678
  attributes.selected = true;
47499
47679
  } else {
47500
47680
  delete attributes.selected;
47501
47681
  }
47502
47682
  }
47503
- if (tagName === "dialog" && n2.open) {
47504
- attributes.rr_open_mode = n2.matches("dialog:modal") ? "modal" : "non-modal";
47683
+ if (tagName === "dialog" && n.open) {
47684
+ attributes.rr_open_mode = n.matches("dialog:modal") ? "modal" : "non-modal";
47505
47685
  }
47506
47686
  if (tagName === "canvas" && recordCanvas) {
47507
- if (n2.__context === "2d") {
47508
- if (!is2DCanvasBlank(n2)) {
47509
- attributes.rr_dataURL = n2.toDataURL(
47687
+ if (n.__context === "2d") {
47688
+ if (!is2DCanvasBlank(n)) {
47689
+ attributes.rr_dataURL = n.toDataURL(
47510
47690
  dataURLOptions.type,
47511
47691
  dataURLOptions.quality
47512
47692
  );
47513
47693
  }
47514
- } else if (!("__context" in n2)) {
47515
- const canvasDataURL = n2.toDataURL(
47694
+ } else if (!("__context" in n)) {
47695
+ const canvasDataURL = n.toDataURL(
47516
47696
  dataURLOptions.type,
47517
47697
  dataURLOptions.quality
47518
47698
  );
47519
47699
  const blankCanvas = doc.createElement("canvas");
47520
- blankCanvas.width = n2.width;
47521
- blankCanvas.height = n2.height;
47700
+ blankCanvas.width = n.width;
47701
+ blankCanvas.height = n.height;
47522
47702
  const blankCanvasDataURL = blankCanvas.toDataURL(
47523
47703
  dataURLOptions.type,
47524
47704
  dataURLOptions.quality
@@ -47533,7 +47713,7 @@ function serializeElementNode(n2, options) {
47533
47713
  canvasService = doc.createElement("canvas");
47534
47714
  canvasCtx = canvasService.getContext("2d");
47535
47715
  }
47536
- const image = n2;
47716
+ const image = n;
47537
47717
  const imageSrc = image.currentSrc || image.getAttribute("src") || "<unknown-src>";
47538
47718
  const priorCrossOrigin = image.crossOrigin;
47539
47719
  const recordInlineImage = () => {
@@ -47566,21 +47746,21 @@ function serializeElementNode(n2, options) {
47566
47746
  if (image.complete && image.naturalWidth !== 0) recordInlineImage();
47567
47747
  else image.addEventListener("load", recordInlineImage);
47568
47748
  }
47569
- if (tagName === "audio" || tagName === "video") {
47749
+ if (["audio", "video"].includes(tagName)) {
47570
47750
  const mediaAttributes = attributes;
47571
- mediaAttributes.rr_mediaState = n2.paused ? "paused" : "played";
47572
- mediaAttributes.rr_mediaCurrentTime = n2.currentTime;
47573
- mediaAttributes.rr_mediaPlaybackRate = n2.playbackRate;
47574
- mediaAttributes.rr_mediaMuted = n2.muted;
47575
- mediaAttributes.rr_mediaLoop = n2.loop;
47576
- mediaAttributes.rr_mediaVolume = n2.volume;
47751
+ mediaAttributes.rr_mediaState = n.paused ? "paused" : "played";
47752
+ mediaAttributes.rr_mediaCurrentTime = n.currentTime;
47753
+ mediaAttributes.rr_mediaPlaybackRate = n.playbackRate;
47754
+ mediaAttributes.rr_mediaMuted = n.muted;
47755
+ mediaAttributes.rr_mediaLoop = n.loop;
47756
+ mediaAttributes.rr_mediaVolume = n.volume;
47577
47757
  }
47578
47758
  if (!newlyAddedElement) {
47579
- if (n2.scrollLeft) {
47580
- attributes.rr_scrollLeft = n2.scrollLeft;
47759
+ if (n.scrollLeft) {
47760
+ attributes.rr_scrollLeft = n.scrollLeft;
47581
47761
  }
47582
- if (n2.scrollTop) {
47583
- attributes.rr_scrollTop = n2.scrollTop;
47762
+ if (n.scrollTop) {
47763
+ attributes.rr_scrollTop = n.scrollTop;
47584
47764
  }
47585
47765
  }
47586
47766
  if (needHide) {
@@ -47589,7 +47769,7 @@ function serializeElementNode(n2, options) {
47589
47769
  rr_display: "none"
47590
47770
  };
47591
47771
  } else if (needBlock) {
47592
- const { width, height } = n2.getBoundingClientRect();
47772
+ const { width, height } = n.getBoundingClientRect();
47593
47773
  attributes = {
47594
47774
  class: attributes.class,
47595
47775
  rr_width: `${width}px`,
@@ -47597,7 +47777,7 @@ function serializeElementNode(n2, options) {
47597
47777
  };
47598
47778
  }
47599
47779
  if (tagName === "iframe" && !keepIframeSrcFn(attributes.src)) {
47600
- if (!n2.contentDocument) {
47780
+ if (!n.contentDocument) {
47601
47781
  attributes.rr_src = attributes.src;
47602
47782
  }
47603
47783
  delete attributes.src;
@@ -47605,14 +47785,14 @@ function serializeElementNode(n2, options) {
47605
47785
  let isCustomElement;
47606
47786
  try {
47607
47787
  if (customElements.get(tagName)) isCustomElement = true;
47608
- } catch (e2) {
47788
+ } catch (e) {
47609
47789
  }
47610
47790
  return {
47611
- type: NodeType$3.Element,
47791
+ type: NodeType.Element,
47612
47792
  tagName,
47613
47793
  attributes,
47614
47794
  childNodes: [],
47615
- isSVG: isSVGElement(n2) || void 0,
47795
+ isSVG: isSVGElement(n) || void 0,
47616
47796
  needBlock,
47617
47797
  rootId,
47618
47798
  isCustom: isCustomElement
@@ -47625,10 +47805,32 @@ function lowerIfExists(maybeAttr) {
47625
47805
  return maybeAttr.toLowerCase();
47626
47806
  }
47627
47807
  }
47808
+ function slimDOMDefaults(_slimDOMOptions) {
47809
+ if (_slimDOMOptions === true || _slimDOMOptions === "all") {
47810
+ return {
47811
+ script: true,
47812
+ comment: true,
47813
+ headFavicon: true,
47814
+ headWhitespace: true,
47815
+ headMetaSocial: true,
47816
+ headMetaRobots: true,
47817
+ headMetaHttpEquiv: true,
47818
+ headMetaVerification: true,
47819
+ // the following are off for slimDOMOptions === true,
47820
+ // as they destroy some (hidden) info:
47821
+ headMetaAuthorship: _slimDOMOptions === "all",
47822
+ headMetaDescKeywords: _slimDOMOptions === "all",
47823
+ headTitleMutations: _slimDOMOptions === "all"
47824
+ };
47825
+ } else if (_slimDOMOptions) {
47826
+ return _slimDOMOptions;
47827
+ }
47828
+ return {};
47829
+ }
47628
47830
  function slimDOMExcluded(sn, slimDOMOptions) {
47629
- if (slimDOMOptions.comment && sn.type === NodeType$3.Comment) {
47831
+ if (slimDOMOptions.comment && sn.type === NodeType.Comment) {
47630
47832
  return true;
47631
- } else if (sn.type === NodeType$3.Element) {
47833
+ } else if (sn.type === NodeType.Element) {
47632
47834
  if (slimDOMOptions.script && // script tag
47633
47835
  (sn.tagName === "script" || // (module)preload link
47634
47836
  sn.tagName === "link" && (sn.attributes.rel === "preload" && sn.attributes.as === "script" || sn.attributes.rel === "modulepreload") || // prefetch link
@@ -47657,7 +47859,7 @@ function slimDOMExcluded(sn, slimDOMOptions) {
47657
47859
  }
47658
47860
  return false;
47659
47861
  }
47660
- function serializeNodeWithId(n2, options) {
47862
+ function serializeNodeWithId(n, options) {
47661
47863
  const {
47662
47864
  doc,
47663
47865
  mirror: mirror2,
@@ -47689,13 +47891,13 @@ function serializeNodeWithId(n2, options) {
47689
47891
  if (!needsMask) {
47690
47892
  const checkAncestors = needsMask === void 0;
47691
47893
  needsMask = needMaskingText(
47692
- n2,
47894
+ n,
47693
47895
  maskTextClass,
47694
47896
  maskTextSelector,
47695
47897
  checkAncestors
47696
47898
  );
47697
47899
  }
47698
- const _serializedNode = serializeNode(n2, {
47900
+ const _serializedNode = serializeNode(n, {
47699
47901
  doc,
47700
47902
  mirror: mirror2,
47701
47903
  blockClass,
@@ -47714,35 +47916,35 @@ function serializeNodeWithId(n2, options) {
47714
47916
  cssCaptured
47715
47917
  });
47716
47918
  if (!_serializedNode) {
47717
- console.warn(n2, "not serialized");
47919
+ console.warn(n, "not serialized");
47718
47920
  return null;
47719
47921
  }
47720
47922
  let id;
47721
- if (mirror2.hasNode(n2)) {
47722
- id = mirror2.getId(n2);
47723
- } else if (slimDOMExcluded(_serializedNode, slimDOMOptions) || !preserveWhiteSpace && _serializedNode.type === NodeType$3.Text && !_serializedNode.textContent.replace(/^\s+|\s+$/gm, "").length) {
47923
+ if (mirror2.hasNode(n)) {
47924
+ id = mirror2.getId(n);
47925
+ } else if (slimDOMExcluded(_serializedNode, slimDOMOptions) || !preserveWhiteSpace && _serializedNode.type === NodeType.Text && !_serializedNode.textContent.replace(/^\s+|\s+$/gm, "").length) {
47724
47926
  id = IGNORED_NODE;
47725
47927
  } else {
47726
47928
  id = genId();
47727
47929
  }
47728
47930
  const serializedNode = Object.assign(_serializedNode, { id });
47729
- mirror2.add(n2, serializedNode);
47931
+ mirror2.add(n, serializedNode);
47730
47932
  if (id === IGNORED_NODE) {
47731
47933
  return null;
47732
47934
  }
47733
47935
  if (onSerialize) {
47734
- onSerialize(n2);
47936
+ onSerialize(n);
47735
47937
  }
47736
47938
  let recordChild = !skipChild;
47737
- if (serializedNode.type === NodeType$3.Element) {
47939
+ if (serializedNode.type === NodeType.Element) {
47738
47940
  recordChild = recordChild && !serializedNode.needBlock;
47739
47941
  delete serializedNode.needBlock;
47740
- const shadowRootEl = index$1.shadowRoot(n2);
47942
+ const shadowRootEl = index.shadowRoot(n);
47741
47943
  if (shadowRootEl && isNativeShadowDom(shadowRootEl))
47742
47944
  serializedNode.isShadowHost = true;
47743
47945
  }
47744
- if ((serializedNode.type === NodeType$3.Document || serializedNode.type === NodeType$3.Element) && recordChild) {
47745
- if (slimDOMOptions.headWhitespace && serializedNode.type === NodeType$3.Element && serializedNode.tagName === "head") {
47946
+ if ((serializedNode.type === NodeType.Document || serializedNode.type === NodeType.Element) && recordChild) {
47947
+ if (slimDOMOptions.headWhitespace && serializedNode.type === NodeType.Element && serializedNode.tagName === "head") {
47746
47948
  preserveWhiteSpace = false;
47747
47949
  }
47748
47950
  const bypassOptions = {
@@ -47772,12 +47974,12 @@ function serializeNodeWithId(n2, options) {
47772
47974
  keepIframeSrcFn,
47773
47975
  cssCaptured: false
47774
47976
  };
47775
- if (serializedNode.type === NodeType$3.Element && serializedNode.tagName === "textarea" && serializedNode.attributes.value !== void 0) ;
47977
+ if (serializedNode.type === NodeType.Element && serializedNode.tagName === "textarea" && serializedNode.attributes.value !== void 0) ;
47776
47978
  else {
47777
- if (serializedNode.type === NodeType$3.Element && serializedNode.attributes._cssText !== void 0 && typeof serializedNode.attributes._cssText === "string") {
47979
+ if (serializedNode.type === NodeType.Element && serializedNode.attributes._cssText !== void 0 && typeof serializedNode.attributes._cssText === "string") {
47778
47980
  bypassOptions.cssCaptured = true;
47779
47981
  }
47780
- for (const childN of Array.from(index$1.childNodes(n2))) {
47982
+ for (const childN of Array.from(index.childNodes(n))) {
47781
47983
  const serializedChildNode = serializeNodeWithId(childN, bypassOptions);
47782
47984
  if (serializedChildNode) {
47783
47985
  serializedNode.childNodes.push(serializedChildNode);
@@ -47785,8 +47987,8 @@ function serializeNodeWithId(n2, options) {
47785
47987
  }
47786
47988
  }
47787
47989
  let shadowRootEl = null;
47788
- if (isElement(n2) && (shadowRootEl = index$1.shadowRoot(n2))) {
47789
- for (const childN of Array.from(index$1.childNodes(shadowRootEl))) {
47990
+ if (isElement(n) && (shadowRootEl = index.shadowRoot(n))) {
47991
+ for (const childN of Array.from(index.childNodes(shadowRootEl))) {
47790
47992
  const serializedChildNode = serializeNodeWithId(childN, bypassOptions);
47791
47993
  if (serializedChildNode) {
47792
47994
  isNativeShadowDom(shadowRootEl) && (serializedChildNode.isShadow = true);
@@ -47795,15 +47997,15 @@ function serializeNodeWithId(n2, options) {
47795
47997
  }
47796
47998
  }
47797
47999
  }
47798
- const parent = index$1.parentNode(n2);
48000
+ const parent = index.parentNode(n);
47799
48001
  if (parent && isShadowRoot(parent) && isNativeShadowDom(parent)) {
47800
48002
  serializedNode.isShadow = true;
47801
48003
  }
47802
- if (serializedNode.type === NodeType$3.Element && serializedNode.tagName === "iframe") {
48004
+ if (serializedNode.type === NodeType.Element && serializedNode.tagName === "iframe") {
47803
48005
  onceIframeLoaded(
47804
- n2,
48006
+ n,
47805
48007
  () => {
47806
- const iframeDoc = n2.contentDocument;
48008
+ const iframeDoc = n.contentDocument;
47807
48009
  if (iframeDoc && onIframeLoad) {
47808
48010
  const serializedIframeNode = serializeNodeWithId(iframeDoc, {
47809
48011
  doc: iframeDoc,
@@ -47833,7 +48035,7 @@ function serializeNodeWithId(n2, options) {
47833
48035
  });
47834
48036
  if (serializedIframeNode) {
47835
48037
  onIframeLoad(
47836
- n2,
48038
+ n,
47837
48039
  serializedIframeNode
47838
48040
  );
47839
48041
  }
@@ -47842,12 +48044,12 @@ function serializeNodeWithId(n2, options) {
47842
48044
  iframeLoadTimeout
47843
48045
  );
47844
48046
  }
47845
- 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")) {
48047
+ if (serializedNode.type === NodeType.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")) {
47846
48048
  onceStylesheetLoaded(
47847
- n2,
48049
+ n,
47848
48050
  () => {
47849
48051
  if (onStylesheetLoad) {
47850
- const serializedLinkNode = serializeNodeWithId(n2, {
48052
+ const serializedLinkNode = serializeNodeWithId(n, {
47851
48053
  doc,
47852
48054
  mirror: mirror2,
47853
48055
  blockClass,
@@ -47875,7 +48077,7 @@ function serializeNodeWithId(n2, options) {
47875
48077
  });
47876
48078
  if (serializedLinkNode) {
47877
48079
  onStylesheetLoad(
47878
- n2,
48080
+ n,
47879
48081
  serializedLinkNode
47880
48082
  );
47881
48083
  }
@@ -47886,7 +48088,7 @@ function serializeNodeWithId(n2, options) {
47886
48088
  }
47887
48089
  return serializedNode;
47888
48090
  }
47889
- function snapshot(n2, options) {
48091
+ function snapshot(n, options) {
47890
48092
  const {
47891
48093
  mirror: mirror2 = new Mirror(),
47892
48094
  blockClass = "rr-block",
@@ -47909,7 +48111,7 @@ function snapshot(n2, options) {
47909
48111
  onStylesheetLoad,
47910
48112
  stylesheetLoadTimeout,
47911
48113
  keepIframeSrcFn = () => false
47912
- } = options || {};
48114
+ } = options;
47913
48115
  const maskInputOptions = maskAllInputs === true ? {
47914
48116
  color: true,
47915
48117
  date: true,
@@ -47930,24 +48132,9 @@ function snapshot(n2, options) {
47930
48132
  } : maskAllInputs === false ? {
47931
48133
  password: true
47932
48134
  } : maskAllInputs;
47933
- const slimDOMOptions = slimDOM === true || slimDOM === "all" ? (
47934
- // if true: set of sensible options that should not throw away any information
47935
- {
47936
- script: true,
47937
- comment: true,
47938
- headFavicon: true,
47939
- headWhitespace: true,
47940
- headMetaDescKeywords: slimDOM === "all",
47941
- // destructive
47942
- headMetaSocial: true,
47943
- headMetaRobots: true,
47944
- headMetaHttpEquiv: true,
47945
- headMetaAuthorship: true,
47946
- headMetaVerification: true
47947
- }
47948
- ) : slimDOM === false ? {} : slimDOM;
47949
- return serializeNodeWithId(n2, {
47950
- doc: n2,
48135
+ const slimDOMOptions = slimDOMDefaults(slimDOM);
48136
+ return serializeNodeWithId(n, {
48137
+ doc: n,
47951
48138
  mirror: mirror2,
47952
48139
  blockClass,
47953
48140
  blockSelector,
@@ -47973,37 +48160,22 @@ function snapshot(n2, options) {
47973
48160
  newlyAddedElement: false
47974
48161
  });
47975
48162
  }
47976
- var __defProp2 = Object.defineProperty;
47977
- var __defNormalProp2 = (obj, key, value) => key in obj ? __defProp2(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
47978
- var __publicField2 = (obj, key, value) => __defNormalProp2(obj, typeof key !== "symbol" ? key + "" : key, value);
47979
- function getNative(symbolName, windowObj = window) {
47980
- var _a2, _b;
47981
- const windowWithZone = windowObj;
47982
- const angularZoneSymbol = (_b = (_a2 = windowWithZone == null ? void 0 : windowWithZone.Zone) == null ? void 0 : _a2.__symbol__) == null ? void 0 : _b.call(_a2, symbolName);
47983
- if (angularZoneSymbol) {
47984
- const zonelessImpl = windowWithZone[angularZoneSymbol];
47985
- if (zonelessImpl) {
47986
- return zonelessImpl;
47987
- }
47988
- }
47989
- return windowWithZone[symbolName];
47990
- }
47991
- typeof window !== "undefined" ? getNative("setTimeout").bind(window) : global.setTimeout;
47992
48163
  class BaseRRNode {
47993
48164
  // eslint-disable-next-line @typescript-eslint/no-unused-vars, @typescript-eslint/no-explicit-any
47994
48165
  constructor(..._args) {
47995
- __publicField2(this, "parentElement", null);
47996
- __publicField2(this, "parentNode", null);
47997
- __publicField2(this, "ownerDocument");
47998
- __publicField2(this, "firstChild", null);
47999
- __publicField2(this, "lastChild", null);
48000
- __publicField2(this, "previousSibling", null);
48001
- __publicField2(this, "nextSibling", null);
48002
- __publicField2(this, "ELEMENT_NODE", 1);
48003
- __publicField2(this, "TEXT_NODE", 3);
48004
- __publicField2(this, "nodeType");
48005
- __publicField2(this, "nodeName");
48006
- __publicField2(this, "RRNodeType");
48166
+ __publicField(this, "parentElement", null);
48167
+ __publicField(this, "parentNode", null);
48168
+ __publicField(this, "ownerDocument");
48169
+ __publicField(this, "firstChild", null);
48170
+ __publicField(this, "lastChild", null);
48171
+ __publicField(this, "previousSibling", null);
48172
+ __publicField(this, "nextSibling", null);
48173
+ __publicField(this, "ELEMENT_NODE", 1);
48174
+ __publicField(this, "TEXT_NODE", 3);
48175
+ // corresponding nodeType value of standard HTML Node
48176
+ __publicField(this, "nodeType");
48177
+ __publicField(this, "nodeName");
48178
+ __publicField(this, "RRNodeType");
48007
48179
  }
48008
48180
  get childNodes() {
48009
48181
  const childNodes2 = [];
@@ -48046,226 +48218,6 @@ class BaseRRNode {
48046
48218
  return "RRNode";
48047
48219
  }
48048
48220
  }
48049
- const testableAccessors = {
48050
- Node: ["childNodes", "parentNode", "parentElement", "textContent"],
48051
- ShadowRoot: ["host", "styleSheets"],
48052
- Element: ["shadowRoot"],
48053
- MutationObserver: [],
48054
- EventTarget: []
48055
- };
48056
- const testableMethods = {
48057
- Node: ["contains", "getRootNode"],
48058
- ShadowRoot: ["getSelection"],
48059
- Element: ["querySelector", "querySelectorAll"],
48060
- MutationObserver: ["constructor"],
48061
- EventTarget: ["addEventListener", "removeEventListener"]
48062
- };
48063
- const untaintedBasePrototype = {};
48064
- function angularZoneUnpatchedAlternative(key) {
48065
- var _a2, _b;
48066
- const angularUnpatchedVersionSymbol = (_b = (_a2 = globalThis == null ? void 0 : globalThis.Zone) == null ? void 0 : _a2.__symbol__) == null ? void 0 : _b.call(_a2, key);
48067
- if (angularUnpatchedVersionSymbol && globalThis[angularUnpatchedVersionSymbol]) {
48068
- return globalThis[angularUnpatchedVersionSymbol];
48069
- } else {
48070
- return void 0;
48071
- }
48072
- }
48073
- function getUntaintedPrototype(key) {
48074
- if (untaintedBasePrototype[key])
48075
- return untaintedBasePrototype[key];
48076
- const candidate = angularZoneUnpatchedAlternative(key) || globalThis[key];
48077
- const defaultPrototype = candidate.prototype;
48078
- const accessorNames = key in testableAccessors ? testableAccessors[key] : void 0;
48079
- const isUntaintedAccessors = Boolean(
48080
- accessorNames && // @ts-expect-error 2345
48081
- accessorNames.every(
48082
- (accessor) => {
48083
- var _a2, _b;
48084
- return Boolean(
48085
- (_b = (_a2 = Object.getOwnPropertyDescriptor(defaultPrototype, accessor)) == null ? void 0 : _a2.get) == null ? void 0 : _b.toString().includes("[native code]")
48086
- );
48087
- }
48088
- )
48089
- );
48090
- const methodNames = key in testableMethods ? testableMethods[key] : void 0;
48091
- const isUntaintedMethods = Boolean(
48092
- methodNames && methodNames.every(
48093
- // @ts-expect-error 2345
48094
- (method) => {
48095
- var _a2;
48096
- return typeof defaultPrototype[method] === "function" && ((_a2 = defaultPrototype[method]) == null ? void 0 : _a2.toString().includes("[native code]"));
48097
- }
48098
- )
48099
- );
48100
- if (isUntaintedAccessors && isUntaintedMethods) {
48101
- untaintedBasePrototype[key] = candidate.prototype;
48102
- return candidate.prototype;
48103
- }
48104
- try {
48105
- const iframeEl = document.createElement("iframe");
48106
- document.body.appendChild(iframeEl);
48107
- const win = iframeEl.contentWindow;
48108
- if (!win) return candidate.prototype;
48109
- const untaintedObject = win[key].prototype;
48110
- document.body.removeChild(iframeEl);
48111
- if (!untaintedObject) return defaultPrototype;
48112
- return untaintedBasePrototype[key] = untaintedObject;
48113
- } catch {
48114
- return defaultPrototype;
48115
- }
48116
- }
48117
- const untaintedAccessorCache = {};
48118
- function getUntaintedAccessor(key, instance, accessor) {
48119
- var _a2;
48120
- const cacheKey = `${key}.${String(accessor)}`;
48121
- if (untaintedAccessorCache[cacheKey])
48122
- return untaintedAccessorCache[cacheKey].call(
48123
- instance
48124
- );
48125
- const untaintedPrototype = getUntaintedPrototype(key);
48126
- const untaintedAccessor = (_a2 = Object.getOwnPropertyDescriptor(
48127
- untaintedPrototype,
48128
- accessor
48129
- )) == null ? void 0 : _a2.get;
48130
- if (!untaintedAccessor) return instance[accessor];
48131
- untaintedAccessorCache[cacheKey] = untaintedAccessor;
48132
- return untaintedAccessor.call(instance);
48133
- }
48134
- const untaintedMethodCache = {};
48135
- function getUntaintedMethod(key, instance, method) {
48136
- var _a2, _b, _c;
48137
- const cacheKey = `${key}.${String(method)}`;
48138
- if (untaintedMethodCache[cacheKey])
48139
- return untaintedMethodCache[cacheKey].bind(
48140
- instance
48141
- );
48142
- const zoneSymbol = (_b = (_a2 = globalThis == null ? void 0 : globalThis.Zone) == null ? void 0 : _a2.__symbol__) == null ? void 0 : _b.call(
48143
- _a2,
48144
- String(method)
48145
- );
48146
- if (zoneSymbol) {
48147
- const classProto = (_c = globalThis[key]) == null ? void 0 : _c.prototype;
48148
- const nativeFromZone = globalThis[zoneSymbol] ?? (classProto == null ? void 0 : classProto[zoneSymbol]);
48149
- if (typeof nativeFromZone === "function") {
48150
- untaintedMethodCache[cacheKey] = nativeFromZone;
48151
- return nativeFromZone.bind(
48152
- instance
48153
- );
48154
- }
48155
- }
48156
- const untaintedPrototype = getUntaintedPrototype(key);
48157
- const untaintedMethod = untaintedPrototype[method];
48158
- if (typeof untaintedMethod !== "function") return instance[method];
48159
- untaintedMethodCache[cacheKey] = untaintedMethod;
48160
- return untaintedMethod.bind(instance);
48161
- }
48162
- function childNodes(n2) {
48163
- return getUntaintedAccessor("Node", n2, "childNodes");
48164
- }
48165
- function parentNode(n2) {
48166
- return getUntaintedAccessor("Node", n2, "parentNode");
48167
- }
48168
- function parentElement(n2) {
48169
- return getUntaintedAccessor("Node", n2, "parentElement");
48170
- }
48171
- function textContent(n2) {
48172
- return getUntaintedAccessor("Node", n2, "textContent");
48173
- }
48174
- function contains(n2, other) {
48175
- return getUntaintedMethod("Node", n2, "contains")(other);
48176
- }
48177
- function getRootNode(n2) {
48178
- return getUntaintedMethod("Node", n2, "getRootNode")();
48179
- }
48180
- function host(n2) {
48181
- if (!n2 || !("host" in n2)) return null;
48182
- return getUntaintedAccessor("ShadowRoot", n2, "host");
48183
- }
48184
- function styleSheets(n2) {
48185
- return n2.styleSheets;
48186
- }
48187
- function shadowRoot(n2) {
48188
- if (!n2 || !("shadowRoot" in n2)) return null;
48189
- return getUntaintedAccessor("Element", n2, "shadowRoot");
48190
- }
48191
- function querySelector(n2, selectors) {
48192
- return getUntaintedMethod("Element", n2, "querySelector")(selectors);
48193
- }
48194
- function querySelectorAll(n2, selectors) {
48195
- return getUntaintedMethod("Element", n2, "querySelectorAll")(selectors);
48196
- }
48197
- function addEventListener(n2, type, listener, options) {
48198
- getUntaintedMethod("EventTarget", n2, "addEventListener")(type, listener, options);
48199
- }
48200
- function removeEventListener(n2, type, listener, options) {
48201
- getUntaintedMethod("EventTarget", n2, "removeEventListener")(
48202
- type,
48203
- listener,
48204
- options
48205
- );
48206
- }
48207
- function mutationObserverCtor() {
48208
- return getUntaintedPrototype("MutationObserver").constructor;
48209
- }
48210
- function getUntaintedProxy() {
48211
- var _a2, _b;
48212
- let Proxy3 = window.Proxy;
48213
- try {
48214
- if (typeof window.Proxy !== "function" || !((_a2 = window.Proxy) == null ? void 0 : _a2.toString().includes("[native code]"))) {
48215
- const cleanFrame = document.createElement("iframe");
48216
- cleanFrame.style.display = "none";
48217
- document.documentElement.appendChild(cleanFrame);
48218
- Proxy3 = ((_b = cleanFrame.contentWindow) == null ? void 0 : _b.Proxy) || window.Proxy;
48219
- document.documentElement.removeChild(cleanFrame);
48220
- }
48221
- } catch (err) {
48222
- console.debug("Unable to get untainted Proxy from iframe", err);
48223
- }
48224
- return Proxy3;
48225
- }
48226
- function patch(source, name, replacement) {
48227
- try {
48228
- if (!(name in source)) {
48229
- return () => {
48230
- };
48231
- }
48232
- const original = source[name];
48233
- const wrapped = replacement(original);
48234
- if (typeof wrapped === "function") {
48235
- wrapped.prototype = wrapped.prototype || {};
48236
- Object.defineProperties(wrapped, {
48237
- __rrweb_original__: {
48238
- enumerable: false,
48239
- value: original
48240
- }
48241
- });
48242
- }
48243
- source[name] = wrapped;
48244
- return () => {
48245
- source[name] = original;
48246
- };
48247
- } catch {
48248
- return () => {
48249
- };
48250
- }
48251
- }
48252
- const index = {
48253
- childNodes,
48254
- parentNode,
48255
- parentElement,
48256
- textContent,
48257
- contains,
48258
- getRootNode,
48259
- host,
48260
- styleSheets,
48261
- shadowRoot,
48262
- querySelector,
48263
- querySelectorAll,
48264
- addEventListener,
48265
- removeEventListener,
48266
- mutationObserver: mutationObserverCtor,
48267
- patch
48268
- };
48269
48221
  function on(type, fn, target = document) {
48270
48222
  const options = { capture: true, passive: true };
48271
48223
  index.addEventListener(target, type, fn, options);
@@ -48348,10 +48300,6 @@ function hookSetter(target, key, d, isRevoked, win = window) {
48348
48300
  );
48349
48301
  return () => hookSetter(target, key, original || {}, true);
48350
48302
  }
48351
- let nowTimestamp = Date.now;
48352
- if (!/* @__PURE__ */ /[1-9][0-9]{12}/.test(Date.now().toString())) {
48353
- nowTimestamp = () => (/* @__PURE__ */ new Date()).getTime();
48354
- }
48355
48303
  function getWindowScroll(win) {
48356
48304
  var _a2, _b, _c, _d;
48357
48305
  const doc = win.document;
@@ -48388,7 +48336,7 @@ function isBlocked(node, blockClass, blockSelector, checkAncestors) {
48388
48336
  } else {
48389
48337
  if (classMatchesRegex(el, blockClass, checkAncestors)) return true;
48390
48338
  }
48391
- } catch (e2) {
48339
+ } catch (e) {
48392
48340
  }
48393
48341
  if (blockSelector) {
48394
48342
  if (el.matches(blockSelector)) return true;
@@ -48396,14 +48344,14 @@ function isBlocked(node, blockClass, blockSelector, checkAncestors) {
48396
48344
  }
48397
48345
  return false;
48398
48346
  }
48399
- function isSerialized(n2, mirror2) {
48400
- return mirror2.getId(n2) !== -1;
48347
+ function isSerialized(n, mirror2) {
48348
+ return mirror2.getId(n) !== -1;
48401
48349
  }
48402
- function isIgnored(n2, mirror2, slimDOMOptions) {
48403
- if (n2.tagName === "TITLE" && slimDOMOptions.headTitleMutations) {
48350
+ function isIgnored(n, mirror2, slimDOMOptions) {
48351
+ if (n.tagName === "TITLE" && slimDOMOptions.headTitleMutations) {
48404
48352
  return true;
48405
48353
  }
48406
- return mirror2.getId(n2) === IGNORED_NODE;
48354
+ return mirror2.getId(n) === IGNORED_NODE;
48407
48355
  }
48408
48356
  function isAncestorRemoved(target, mirror2) {
48409
48357
  if (isShadowRoot(target)) {
@@ -48425,7 +48373,7 @@ function isAncestorRemoved(target, mirror2) {
48425
48373
  function legacy_isTouchEvent(event) {
48426
48374
  return Boolean(event.changedTouches);
48427
48375
  }
48428
- function polyfill$1(win = window) {
48376
+ function polyfill(win = window) {
48429
48377
  if ("NodeList" in win && !win.NodeList.prototype.forEach) {
48430
48378
  win.NodeList.prototype.forEach = Array.prototype.forEach;
48431
48379
  }
@@ -48433,20 +48381,20 @@ function polyfill$1(win = window) {
48433
48381
  win.DOMTokenList.prototype.forEach = Array.prototype.forEach;
48434
48382
  }
48435
48383
  }
48436
- function isSerializedIframe(n2, mirror2) {
48437
- return Boolean(n2.nodeName === "IFRAME" && mirror2.getMeta(n2));
48384
+ function isSerializedIframe(n, mirror2) {
48385
+ return Boolean(n.nodeName === "IFRAME" && mirror2.getMeta(n));
48438
48386
  }
48439
- function isSerializedStylesheet(n2, mirror2) {
48387
+ function isSerializedStylesheet(n, mirror2) {
48440
48388
  return Boolean(
48441
- n2.nodeName === "LINK" && n2.nodeType === n2.ELEMENT_NODE && n2.getAttribute && n2.getAttribute("rel") === "stylesheet" && mirror2.getMeta(n2)
48389
+ n.nodeName === "LINK" && n.nodeType === n.ELEMENT_NODE && n.getAttribute && n.getAttribute("rel") === "stylesheet" && mirror2.getMeta(n)
48442
48390
  );
48443
48391
  }
48444
- function hasShadowRoot(n2) {
48445
- if (!n2) return false;
48446
- if (n2 instanceof BaseRRNode && "shadowRoot" in n2) {
48447
- return Boolean(n2.shadowRoot);
48392
+ function hasShadowRoot(n) {
48393
+ if (!n) return false;
48394
+ if (n instanceof BaseRRNode && "shadowRoot" in n) {
48395
+ return Boolean(n.shadowRoot);
48448
48396
  }
48449
- return Boolean(index.shadowRoot(n2));
48397
+ return Boolean(index.shadowRoot(n));
48450
48398
  }
48451
48399
  class StyleSheetMirror {
48452
48400
  constructor() {
@@ -48485,206 +48433,30 @@ class StyleSheetMirror {
48485
48433
  return this.id++;
48486
48434
  }
48487
48435
  }
48488
- function getShadowHost(n2) {
48436
+ function getShadowHost(n) {
48489
48437
  var _a2;
48490
48438
  let shadowHost = null;
48491
- if ("getRootNode" in n2 && ((_a2 = index.getRootNode(n2)) == null ? void 0 : _a2.nodeType) === Node.DOCUMENT_FRAGMENT_NODE && index.host(index.getRootNode(n2)))
48492
- shadowHost = index.host(index.getRootNode(n2));
48439
+ if ("getRootNode" in n && ((_a2 = index.getRootNode(n)) == null ? void 0 : _a2.nodeType) === Node.DOCUMENT_FRAGMENT_NODE && index.host(index.getRootNode(n)))
48440
+ shadowHost = index.host(index.getRootNode(n));
48493
48441
  return shadowHost;
48494
48442
  }
48495
- function getRootShadowHost(n2) {
48496
- let rootShadowHost = n2;
48443
+ function getRootShadowHost(n) {
48444
+ let rootShadowHost = n;
48497
48445
  let shadowHost;
48498
48446
  while (shadowHost = getShadowHost(rootShadowHost))
48499
48447
  rootShadowHost = shadowHost;
48500
48448
  return rootShadowHost;
48501
48449
  }
48502
- function shadowHostInDom(n2) {
48503
- const doc = n2.ownerDocument;
48450
+ function shadowHostInDom(n) {
48451
+ const doc = index.ownerDocument(n);
48504
48452
  if (!doc) return false;
48505
- const shadowHost = getRootShadowHost(n2);
48453
+ const shadowHost = getRootShadowHost(n);
48506
48454
  return index.contains(doc, shadowHost);
48507
48455
  }
48508
- function inDom(n2) {
48509
- const doc = n2.ownerDocument;
48456
+ function inDom(n) {
48457
+ const doc = index.ownerDocument(n);
48510
48458
  if (!doc) return false;
48511
- return index.contains(doc, n2) || shadowHostInDom(n2);
48512
- }
48513
- var EventType = /* @__PURE__ */ ((EventType2) => {
48514
- EventType2[EventType2["DomContentLoaded"] = 0] = "DomContentLoaded";
48515
- EventType2[EventType2["Load"] = 1] = "Load";
48516
- EventType2[EventType2["FullSnapshot"] = 2] = "FullSnapshot";
48517
- EventType2[EventType2["IncrementalSnapshot"] = 3] = "IncrementalSnapshot";
48518
- EventType2[EventType2["Meta"] = 4] = "Meta";
48519
- EventType2[EventType2["Custom"] = 5] = "Custom";
48520
- EventType2[EventType2["Plugin"] = 6] = "Plugin";
48521
- return EventType2;
48522
- })(EventType || {});
48523
- var IncrementalSource = /* @__PURE__ */ ((IncrementalSource2) => {
48524
- IncrementalSource2[IncrementalSource2["Mutation"] = 0] = "Mutation";
48525
- IncrementalSource2[IncrementalSource2["MouseMove"] = 1] = "MouseMove";
48526
- IncrementalSource2[IncrementalSource2["MouseInteraction"] = 2] = "MouseInteraction";
48527
- IncrementalSource2[IncrementalSource2["Scroll"] = 3] = "Scroll";
48528
- IncrementalSource2[IncrementalSource2["ViewportResize"] = 4] = "ViewportResize";
48529
- IncrementalSource2[IncrementalSource2["Input"] = 5] = "Input";
48530
- IncrementalSource2[IncrementalSource2["TouchMove"] = 6] = "TouchMove";
48531
- IncrementalSource2[IncrementalSource2["MediaInteraction"] = 7] = "MediaInteraction";
48532
- IncrementalSource2[IncrementalSource2["StyleSheetRule"] = 8] = "StyleSheetRule";
48533
- IncrementalSource2[IncrementalSource2["CanvasMutation"] = 9] = "CanvasMutation";
48534
- IncrementalSource2[IncrementalSource2["Font"] = 10] = "Font";
48535
- IncrementalSource2[IncrementalSource2["Log"] = 11] = "Log";
48536
- IncrementalSource2[IncrementalSource2["Drag"] = 12] = "Drag";
48537
- IncrementalSource2[IncrementalSource2["StyleDeclaration"] = 13] = "StyleDeclaration";
48538
- IncrementalSource2[IncrementalSource2["Selection"] = 14] = "Selection";
48539
- IncrementalSource2[IncrementalSource2["AdoptedStyleSheet"] = 15] = "AdoptedStyleSheet";
48540
- IncrementalSource2[IncrementalSource2["CustomElement"] = 16] = "CustomElement";
48541
- return IncrementalSource2;
48542
- })(IncrementalSource || {});
48543
- var MouseInteractions = /* @__PURE__ */ ((MouseInteractions2) => {
48544
- MouseInteractions2[MouseInteractions2["MouseUp"] = 0] = "MouseUp";
48545
- MouseInteractions2[MouseInteractions2["MouseDown"] = 1] = "MouseDown";
48546
- MouseInteractions2[MouseInteractions2["Click"] = 2] = "Click";
48547
- MouseInteractions2[MouseInteractions2["ContextMenu"] = 3] = "ContextMenu";
48548
- MouseInteractions2[MouseInteractions2["DblClick"] = 4] = "DblClick";
48549
- MouseInteractions2[MouseInteractions2["Focus"] = 5] = "Focus";
48550
- MouseInteractions2[MouseInteractions2["Blur"] = 6] = "Blur";
48551
- MouseInteractions2[MouseInteractions2["TouchStart"] = 7] = "TouchStart";
48552
- MouseInteractions2[MouseInteractions2["TouchMove_Departed"] = 8] = "TouchMove_Departed";
48553
- MouseInteractions2[MouseInteractions2["TouchEnd"] = 9] = "TouchEnd";
48554
- MouseInteractions2[MouseInteractions2["TouchCancel"] = 10] = "TouchCancel";
48555
- return MouseInteractions2;
48556
- })(MouseInteractions || {});
48557
- var PointerTypes = /* @__PURE__ */ ((PointerTypes2) => {
48558
- PointerTypes2[PointerTypes2["Mouse"] = 0] = "Mouse";
48559
- PointerTypes2[PointerTypes2["Pen"] = 1] = "Pen";
48560
- PointerTypes2[PointerTypes2["Touch"] = 2] = "Touch";
48561
- return PointerTypes2;
48562
- })(PointerTypes || {});
48563
- var CanvasContext = /* @__PURE__ */ ((CanvasContext2) => {
48564
- CanvasContext2[CanvasContext2["2D"] = 0] = "2D";
48565
- CanvasContext2[CanvasContext2["WebGL"] = 1] = "WebGL";
48566
- CanvasContext2[CanvasContext2["WebGL2"] = 2] = "WebGL2";
48567
- return CanvasContext2;
48568
- })(CanvasContext || {});
48569
- var MediaInteractions = /* @__PURE__ */ ((MediaInteractions2) => {
48570
- MediaInteractions2[MediaInteractions2["Play"] = 0] = "Play";
48571
- MediaInteractions2[MediaInteractions2["Pause"] = 1] = "Pause";
48572
- MediaInteractions2[MediaInteractions2["Seeked"] = 2] = "Seeked";
48573
- MediaInteractions2[MediaInteractions2["VolumeChange"] = 3] = "VolumeChange";
48574
- MediaInteractions2[MediaInteractions2["RateChange"] = 4] = "RateChange";
48575
- return MediaInteractions2;
48576
- })(MediaInteractions || {});
48577
- var NodeType = /* @__PURE__ */ ((NodeType2) => {
48578
- NodeType2[NodeType2["Document"] = 0] = "Document";
48579
- NodeType2[NodeType2["DocumentType"] = 1] = "DocumentType";
48580
- NodeType2[NodeType2["Element"] = 2] = "Element";
48581
- NodeType2[NodeType2["Text"] = 3] = "Text";
48582
- NodeType2[NodeType2["CDATA"] = 4] = "CDATA";
48583
- NodeType2[NodeType2["Comment"] = 5] = "Comment";
48584
- return NodeType2;
48585
- })(NodeType || {});
48586
- function isNodeInLinkedList(n2) {
48587
- return "__ln" in n2;
48588
- }
48589
- class DoubleLinkedList {
48590
- constructor() {
48591
- __publicField(this, "length", 0);
48592
- __publicField(this, "head", null);
48593
- __publicField(this, "tail", null);
48594
- __publicField(this, "reordered", false);
48595
- }
48596
- get(position) {
48597
- if (position >= this.length) {
48598
- throw new Error("Position outside of list range");
48599
- }
48600
- let current = this.head;
48601
- for (let index2 = 0; index2 < position; index2++) {
48602
- current = (current == null ? void 0 : current.next) || null;
48603
- }
48604
- return current;
48605
- }
48606
- addNode(n2) {
48607
- const node = {
48608
- value: n2,
48609
- previous: null,
48610
- next: null
48611
- };
48612
- n2.__ln = node;
48613
- if (n2.previousSibling && isNodeInLinkedList(n2.previousSibling)) {
48614
- const current = n2.previousSibling.__ln.next;
48615
- node.next = current;
48616
- node.previous = n2.previousSibling.__ln;
48617
- n2.previousSibling.__ln.next = node;
48618
- if (current) {
48619
- current.previous = node;
48620
- }
48621
- } else if (n2.nextSibling && isNodeInLinkedList(n2.nextSibling) && n2.nextSibling.__ln.previous) {
48622
- const current = n2.nextSibling.__ln.previous;
48623
- node.previous = current;
48624
- node.next = n2.nextSibling.__ln;
48625
- n2.nextSibling.__ln.previous = node;
48626
- if (current) {
48627
- current.next = node;
48628
- }
48629
- } else {
48630
- if (this.head) {
48631
- this.head.previous = node;
48632
- }
48633
- node.next = this.head;
48634
- this.head = node;
48635
- }
48636
- if (node.next === null) {
48637
- this.tail = node;
48638
- }
48639
- this.length++;
48640
- }
48641
- removeNode(n2) {
48642
- const current = n2.__ln;
48643
- if (!this.head) {
48644
- return;
48645
- }
48646
- if (!current.previous) {
48647
- this.head = current.next;
48648
- if (this.head) {
48649
- this.head.previous = null;
48650
- } else {
48651
- this.tail = null;
48652
- }
48653
- } else {
48654
- current.previous.next = current.next;
48655
- if (current.next) {
48656
- current.next.previous = current.previous;
48657
- } else {
48658
- this.tail = current.previous;
48659
- }
48660
- }
48661
- if (n2.__ln) {
48662
- delete n2.__ln;
48663
- }
48664
- this.length--;
48665
- }
48666
- needsReorder(_node) {
48667
- if (!this.reordered && _node.value.previousSibling && isNodeInLinkedList(_node.value.previousSibling) && _node.previous && _node.previous.value !== _node.value.previousSibling) {
48668
- return true;
48669
- }
48670
- return false;
48671
- }
48672
- reorder() {
48673
- if (this.reordered) return false;
48674
- let current = this.tail;
48675
- const head = this.head;
48676
- while (current) {
48677
- const prev = current.previous;
48678
- this.removeNode(current.value);
48679
- this.addNode(current.value);
48680
- if (current === head) {
48681
- break;
48682
- }
48683
- current = prev;
48684
- }
48685
- this.reordered = true;
48686
- return true;
48687
- }
48459
+ return index.contains(doc, n) || shadowHostInDom(n);
48688
48460
  }
48689
48461
  const moveKey = (id, parentId) => `${id}@${parentId}`;
48690
48462
  class MutationBuffer {
@@ -48697,6 +48469,23 @@ class MutationBuffer {
48697
48469
  __publicField(this, "removes", []);
48698
48470
  __publicField(this, "mapRemoves", []);
48699
48471
  __publicField(this, "movedMap", {});
48472
+ /**
48473
+ * the browser MutationObserver emits multiple mutations after
48474
+ * a delay for performance reasons, making tracing added nodes hard
48475
+ * in our `processMutations` callback function.
48476
+ * For example, if we append an element el_1 into body, and then append
48477
+ * another element el_2 into el_1, these two mutations may be passed to the
48478
+ * callback function together when the two operations were done.
48479
+ * Generally we need to trace child nodes of newly added nodes, but in this
48480
+ * case if we count el_2 as el_1's child node in the first mutation record,
48481
+ * then we will count el_2 again in the second mutation record which was
48482
+ * duplicated.
48483
+ * To avoid of duplicate counting added nodes, we use a Set to store
48484
+ * added nodes and its child nodes during iterate mutation records. Then
48485
+ * collect added nodes from the Set which have no duplicate copy. But
48486
+ * this also causes newly added nodes will not be serialized with id ASAP,
48487
+ * which means all the id related calculation should be lazy too.
48488
+ */
48700
48489
  __publicField(this, "addedSet", /* @__PURE__ */ new Set());
48701
48490
  __publicField(this, "movedSet", /* @__PURE__ */ new Set());
48702
48491
  __publicField(this, "droppedSet", /* @__PURE__ */ new Set());
@@ -48734,36 +48523,103 @@ class MutationBuffer {
48734
48523
  }
48735
48524
  const adds = [];
48736
48525
  const addedIds = /* @__PURE__ */ new Set();
48737
- const addList = new DoubleLinkedList();
48738
- const getNextId = (n2) => {
48739
- let ns = n2;
48740
- let nextId = IGNORED_NODE;
48741
- while (nextId === IGNORED_NODE) {
48742
- ns = ns && ns.nextSibling;
48743
- nextId = ns && this.mirror.getId(ns);
48526
+ while (this.mapRemoves.length) {
48527
+ this.mirror.removeNodeFromMap(this.mapRemoves.shift());
48528
+ }
48529
+ for (const n2 of this.movedSet) {
48530
+ const parentNode22 = index.parentNode(n2);
48531
+ if (this.removesSubTreeCache.has(parentNode22) && !this.movedSet.has(parentNode22)) {
48532
+ continue;
48744
48533
  }
48745
- return nextId;
48746
- };
48747
- const pushAdd = (n2) => {
48748
- const parent = index.parentNode(n2);
48749
- if (!parent || !inDom(n2)) {
48750
- return;
48534
+ this.addedSet.add(n2);
48535
+ }
48536
+ let n = null;
48537
+ let parentNode2 = null;
48538
+ let parentId = -1;
48539
+ let nextSibling2 = null;
48540
+ let ancestorBad = false;
48541
+ const missingParents = /* @__PURE__ */ new Set();
48542
+ const iter = this.addedSet.values();
48543
+ let curr = iter.next();
48544
+ while (this.addedSet.size) {
48545
+ if (n !== null && this.addedSet.has(index.previousSibling(n))) {
48546
+ nextSibling2 = n;
48547
+ n = index.previousSibling(n);
48548
+ } else {
48549
+ if (!this.addedSet.has(curr.value)) {
48550
+ curr = iter.next();
48551
+ }
48552
+ n = curr.value;
48553
+ while (true) {
48554
+ parentNode2 = index.parentNode(n);
48555
+ if (this.addedSet.has(parentNode2)) {
48556
+ n = parentNode2;
48557
+ continue;
48558
+ }
48559
+ break;
48560
+ }
48561
+ if (missingParents.has(parentNode2)) {
48562
+ parentNode2 = null;
48563
+ } else if (parentNode2) {
48564
+ if (!inDom(parentNode2)) {
48565
+ ancestorBad = true;
48566
+ } else {
48567
+ ancestorBad = isSelfOrAncestorInSet(this.droppedSet, parentNode2) || this.removesSubTreeCache.has(parentNode2);
48568
+ if (ancestorBad && isSelfOrAncestorInSet(this.movedSet, n)) {
48569
+ ancestorBad = false;
48570
+ }
48571
+ }
48572
+ if (this.addedSet.has(index.lastChild(parentNode2))) {
48573
+ n = index.lastChild(parentNode2);
48574
+ nextSibling2 = null;
48575
+ } else {
48576
+ while (true) {
48577
+ nextSibling2 = index.nextSibling(n);
48578
+ if (this.addedSet.has(nextSibling2)) {
48579
+ n = nextSibling2;
48580
+ continue;
48581
+ }
48582
+ break;
48583
+ }
48584
+ }
48585
+ parentId = isShadowRoot(parentNode2) ? this.mirror.getId(getShadowHost(n)) : this.mirror.getId(parentNode2);
48586
+ if (parentId === -1 && parentNode2.nodeType === Node.DOCUMENT_FRAGMENT_NODE) {
48587
+ const shadowHost = index.host(parentNode2);
48588
+ parentId = this.mirror.getId(shadowHost);
48589
+ }
48590
+ }
48591
+ }
48592
+ this.addedSet.delete(n);
48593
+ if (!parentNode2 || parentId === -1) {
48594
+ missingParents.add(n);
48595
+ continue;
48596
+ } else if (ancestorBad) {
48597
+ this.droppedSet.add(n);
48598
+ continue;
48751
48599
  }
48752
48600
  let cssCaptured = false;
48753
- if (n2.nodeType === Node.TEXT_NODE) {
48754
- const parentTag = parent.tagName;
48601
+ if (n.nodeType === Node.TEXT_NODE) {
48602
+ const parentTag = parentNode2.tagName;
48755
48603
  if (parentTag === "TEXTAREA") {
48756
- return;
48757
- } else if (parentTag === "STYLE" && this.addedSet.has(parent)) {
48604
+ continue;
48605
+ } else if (parentTag === "STYLE" && addedIds.has(parentId)) {
48758
48606
  cssCaptured = true;
48759
48607
  }
48760
48608
  }
48761
- const parentId = isShadowRoot(parent) ? this.mirror.getId(getShadowHost(n2)) : this.mirror.getId(parent);
48762
- const nextId = getNextId(n2);
48763
- if (parentId === -1 || nextId === -1) {
48764
- return addList.addNode(n2);
48609
+ let nextId = nextSibling2 ? this.mirror.getId(nextSibling2) : null;
48610
+ while (nextId === IGNORED_NODE) {
48611
+ nextSibling2 = nextSibling2 && index.nextSibling(nextSibling2);
48612
+ nextId = nextSibling2 && this.mirror.getId(nextSibling2);
48765
48613
  }
48766
- const sn = serializeNodeWithId(n2, {
48614
+ if (nextId === -1) {
48615
+ console.warn(
48616
+ "Couldn't record new node. Couldn't find mirror id for nextSibling:",
48617
+ nextSibling2
48618
+ );
48619
+ n = null;
48620
+ continue;
48621
+ }
48622
+ const sn = serializeNodeWithId(n, {
48767
48623
  doc: this.doc,
48768
48624
  mirror: this.mirror,
48769
48625
  blockClass: this.blockClass,
@@ -48790,8 +48646,11 @@ class MutationBuffer {
48790
48646
  currentN
48791
48647
  );
48792
48648
  }
48793
- if (hasShadowRoot(n2)) {
48794
- this.shadowDomManager.addShadowRoot(index.shadowRoot(n2), this.doc);
48649
+ if (hasShadowRoot(n)) {
48650
+ this.shadowDomManager.addShadowRoot(
48651
+ index.shadowRoot(n),
48652
+ this.doc
48653
+ );
48795
48654
  }
48796
48655
  },
48797
48656
  onIframeLoad: (iframe, childSn) => {
@@ -48811,76 +48670,6 @@ class MutationBuffer {
48811
48670
  });
48812
48671
  addedIds.add(sn.id);
48813
48672
  }
48814
- };
48815
- while (this.mapRemoves.length) {
48816
- this.mirror.removeNodeFromMap(this.mapRemoves.shift());
48817
- }
48818
- for (const n2 of this.movedSet) {
48819
- const parentNode2 = index.parentNode(n2);
48820
- if (isParentRemoved(this.removesSubTreeCache, n2, this.mirror) && !this.movedSet.has(parentNode2) && !this.addedSet.has(parentNode2)) {
48821
- continue;
48822
- }
48823
- pushAdd(n2);
48824
- }
48825
- for (const n2 of this.addedSet) {
48826
- if (!isAncestorInSet(this.droppedSet, n2) && !isParentRemoved(this.removesSubTreeCache, n2, this.mirror)) {
48827
- pushAdd(n2);
48828
- } else if (isAncestorInSet(this.movedSet, n2)) {
48829
- pushAdd(n2);
48830
- } else {
48831
- this.droppedSet.add(n2);
48832
- }
48833
- }
48834
- let candidate = null;
48835
- while (addList.length) {
48836
- let node = null;
48837
- if (candidate) {
48838
- const parentId = this.mirror.getId(index.parentNode(candidate.value));
48839
- const nextId = getNextId(candidate.value);
48840
- if (parentId !== -1 && nextId !== -1) {
48841
- node = candidate;
48842
- }
48843
- }
48844
- if (!node) {
48845
- let tailNode = addList.tail;
48846
- while (tailNode) {
48847
- const _node = tailNode;
48848
- tailNode = tailNode.previous;
48849
- if (_node) {
48850
- const parentId = this.mirror.getId(index.parentNode(_node.value));
48851
- const nextId = getNextId(_node.value);
48852
- if (nextId === -1) {
48853
- if (addList.needsReorder(_node) && addList.reorder()) {
48854
- tailNode = addList.tail;
48855
- }
48856
- continue;
48857
- } else if (parentId !== -1) {
48858
- node = _node;
48859
- break;
48860
- } else {
48861
- const unhandledNode = _node.value;
48862
- const parent = index.parentNode(unhandledNode);
48863
- if (parent && parent.nodeType === Node.DOCUMENT_FRAGMENT_NODE) {
48864
- const shadowHost = index.host(parent);
48865
- const parentId2 = this.mirror.getId(shadowHost);
48866
- if (parentId2 !== -1) {
48867
- node = _node;
48868
- break;
48869
- }
48870
- }
48871
- }
48872
- }
48873
- }
48874
- }
48875
- if (!node) {
48876
- while (addList.head) {
48877
- addList.removeNode(addList.head.value);
48878
- }
48879
- break;
48880
- }
48881
- candidate = node.previous;
48882
- addList.removeNode(node.value);
48883
- pushAdd(node.value);
48884
48673
  }
48885
48674
  const payload = {
48886
48675
  texts: this.texts.map((text) => {
@@ -48985,6 +48774,7 @@ class MutationBuffer {
48985
48774
  }
48986
48775
  case "attributes": {
48987
48776
  const target = m.target;
48777
+ const tagNameLower = toLowerCase(target.tagName);
48988
48778
  let attributeName = m.attributeName;
48989
48779
  let value = m.target.getAttribute(attributeName);
48990
48780
  if (attributeName === "value") {
@@ -49009,7 +48799,7 @@ class MutationBuffer {
49009
48799
  return;
49010
48800
  }
49011
48801
  let item = this.attributeMap.get(m.target);
49012
- if (target.tagName === "IFRAME" && attributeName === "src" && !this.keepIframeSrcFn(value)) {
48802
+ if (tagNameLower === "iframe" && attributeName === "src" && !this.keepIframeSrcFn(value)) {
49013
48803
  if (!target.contentDocument) {
49014
48804
  attributeName = "rr_src";
49015
48805
  } else {
@@ -49026,13 +48816,13 @@ class MutationBuffer {
49026
48816
  this.attributes.push(item);
49027
48817
  this.attributeMap.set(m.target, item);
49028
48818
  }
49029
- if (attributeName === "type" && target.tagName === "INPUT" && (m.oldValue || "").toLowerCase() === "password") {
48819
+ if (attributeName === "type" && tagNameLower === "input" && (m.oldValue || "").toLowerCase() === "password") {
49030
48820
  target.setAttribute("data-rr-is-password", "true");
49031
48821
  }
49032
- if (!ignoreAttribute(target.tagName, attributeName)) {
48822
+ if (!ignoreAttribute(tagNameLower, attributeName)) {
49033
48823
  item.attributes[attributeName] = transformAttribute(
49034
48824
  this.doc,
49035
- toLowerCase(target.tagName),
48825
+ tagNameLower,
49036
48826
  toLowerCase(attributeName),
49037
48827
  value
49038
48828
  );
@@ -49040,7 +48830,7 @@ class MutationBuffer {
49040
48830
  if (!this.unattachedDoc) {
49041
48831
  try {
49042
48832
  this.unattachedDoc = document.implementation.createHTMLDocument();
49043
- } catch (e2) {
48833
+ } catch (e) {
49044
48834
  this.unattachedDoc = this.doc;
49045
48835
  }
49046
48836
  }
@@ -49083,59 +48873,62 @@ class MutationBuffer {
49083
48873
  this.genTextAreaValueMutation(m.target);
49084
48874
  return;
49085
48875
  }
49086
- m.addedNodes.forEach((n2) => this.genAdds(n2, m.target));
49087
- m.removedNodes.forEach((n2) => {
49088
- const nodeId = this.mirror.getId(n2);
48876
+ m.addedNodes.forEach((n) => this.genAdds(n, m.target));
48877
+ m.removedNodes.forEach((n) => {
48878
+ const nodeId = this.mirror.getId(n);
49089
48879
  const parentId = isShadowRoot(m.target) ? this.mirror.getId(index.host(m.target)) : this.mirror.getId(m.target);
49090
- if (isBlocked(m.target, this.blockClass, this.blockSelector, false) || isIgnored(n2, this.mirror, this.slimDOMOptions) || !isSerialized(n2, this.mirror)) {
48880
+ if (isBlocked(m.target, this.blockClass, this.blockSelector, false) || isIgnored(n, this.mirror, this.slimDOMOptions) || !isSerialized(n, this.mirror)) {
49091
48881
  return;
49092
48882
  }
49093
- if (this.addedSet.has(n2)) {
49094
- deepDelete(this.addedSet, n2);
49095
- this.droppedSet.add(n2);
48883
+ if (this.addedSet.has(n)) {
48884
+ deepDelete(this.addedSet, n);
48885
+ this.droppedSet.add(n);
49096
48886
  } else if (this.addedSet.has(m.target) && nodeId === -1) ;
49097
48887
  else if (isAncestorRemoved(m.target, this.mirror)) ;
49098
- else if (this.movedSet.has(n2) && this.movedMap[moveKey(nodeId, parentId)]) {
49099
- deepDelete(this.movedSet, n2);
48888
+ else if (this.movedSet.has(n) && this.movedMap[moveKey(nodeId, parentId)]) {
48889
+ deepDelete(this.movedSet, n);
49100
48890
  } else {
49101
48891
  this.removes.push({
49102
48892
  parentId,
49103
48893
  id: nodeId,
49104
48894
  isShadow: isShadowRoot(m.target) && isNativeShadowDom(m.target) ? true : void 0
49105
48895
  });
49106
- processRemoves(n2, this.removesSubTreeCache);
48896
+ processRemoves(n, this.removesSubTreeCache);
49107
48897
  }
49108
- this.mapRemoves.push(n2);
48898
+ this.mapRemoves.push(n);
49109
48899
  });
49110
48900
  break;
49111
48901
  }
49112
48902
  }
49113
48903
  });
49114
- __publicField(this, "genAdds", (n2, target) => {
49115
- if (this.processedNodeManager.inOtherBuffer(n2, this)) return;
49116
- if (this.addedSet.has(n2) || this.movedSet.has(n2)) return;
49117
- if (this.mirror.hasNode(n2)) {
49118
- if (isIgnored(n2, this.mirror, this.slimDOMOptions)) {
48904
+ /**
48905
+ * Make sure you check if `n`'s parent is blocked before calling this function
48906
+ * */
48907
+ __publicField(this, "genAdds", (n, target) => {
48908
+ if (this.processedNodeManager.inOtherBuffer(n, this)) return;
48909
+ if (this.addedSet.has(n) || this.movedSet.has(n)) return;
48910
+ if (this.mirror.hasNode(n)) {
48911
+ if (isIgnored(n, this.mirror, this.slimDOMOptions)) {
49119
48912
  return;
49120
48913
  }
49121
- this.movedSet.add(n2);
48914
+ this.movedSet.add(n);
49122
48915
  let targetId = null;
49123
48916
  if (target && this.mirror.hasNode(target)) {
49124
48917
  targetId = this.mirror.getId(target);
49125
48918
  }
49126
48919
  if (targetId && targetId !== -1) {
49127
- this.movedMap[moveKey(this.mirror.getId(n2), targetId)] = true;
48920
+ this.movedMap[moveKey(this.mirror.getId(n), targetId)] = true;
49128
48921
  }
49129
48922
  } else {
49130
- this.addedSet.add(n2);
49131
- this.droppedSet.delete(n2);
48923
+ this.addedSet.add(n);
48924
+ this.droppedSet.delete(n);
49132
48925
  }
49133
- if (!isBlocked(n2, this.blockClass, this.blockSelector, false)) {
49134
- index.childNodes(n2).forEach((childN) => this.genAdds(childN));
49135
- if (hasShadowRoot(n2)) {
49136
- index.childNodes(index.shadowRoot(n2)).forEach((childN) => {
48926
+ if (!isBlocked(n, this.blockClass, this.blockSelector, false)) {
48927
+ index.childNodes(n).forEach((childN) => this.genAdds(childN));
48928
+ if (hasShadowRoot(n)) {
48929
+ index.childNodes(index.shadowRoot(n)).forEach((childN) => {
49137
48930
  this.processedNodeManager.add(childN, this);
49138
- this.genAdds(childN, n2);
48931
+ this.genAdds(childN, n);
49139
48932
  });
49140
48933
  }
49141
48934
  }
@@ -49195,42 +48988,33 @@ class MutationBuffer {
49195
48988
  this.canvasManager.reset();
49196
48989
  }
49197
48990
  }
49198
- function deepDelete(addsSet, n2) {
49199
- addsSet.delete(n2);
49200
- index.childNodes(n2).forEach((childN) => deepDelete(addsSet, childN));
48991
+ function deepDelete(addsSet, n) {
48992
+ addsSet.delete(n);
48993
+ index.childNodes(n).forEach((childN) => deepDelete(addsSet, childN));
49201
48994
  }
49202
- function processRemoves(n2, cache) {
49203
- const queue = [n2];
48995
+ function processRemoves(n, cache) {
48996
+ const queue = [n];
49204
48997
  while (queue.length) {
49205
48998
  const next = queue.pop();
49206
48999
  if (cache.has(next)) continue;
49207
49000
  cache.add(next);
49208
- index.childNodes(next).forEach((n22) => queue.push(n22));
49001
+ index.childNodes(next).forEach((n2) => queue.push(n2));
49209
49002
  }
49210
49003
  return;
49211
49004
  }
49212
- function isParentRemoved(removes, n2, mirror2) {
49213
- if (removes.size === 0) return false;
49214
- return _isParentRemoved(removes, n2);
49215
- }
49216
- function _isParentRemoved(removes, n2, _mirror2) {
49217
- const node = index.parentNode(n2);
49218
- if (!node) return false;
49219
- return removes.has(node);
49220
- }
49221
- function isAncestorInSet(set, n2) {
49005
+ function isSelfOrAncestorInSet(set, n) {
49222
49006
  if (set.size === 0) return false;
49223
- return _isAncestorInSet(set, n2);
49007
+ return _isSelfOrAncestorInSet(set, n);
49224
49008
  }
49225
- function _isAncestorInSet(set, n2) {
49226
- const parent = index.parentNode(n2);
49009
+ function _isSelfOrAncestorInSet(set, n) {
49010
+ if (set.has(n)) {
49011
+ return true;
49012
+ }
49013
+ const parent = index.parentNode(n);
49227
49014
  if (!parent) {
49228
49015
  return false;
49229
49016
  }
49230
- if (set.has(parent)) {
49231
- return true;
49232
- }
49233
- return _isAncestorInSet(set, parent);
49017
+ return _isSelfOrAncestorInSet(set, parent);
49234
49018
  }
49235
49019
  let errorHandler;
49236
49020
  function registerErrorHandler(handler) {
@@ -49275,7 +49059,8 @@ function initMutationObserver(options, rootEl) {
49275
49059
  const mutationBuffer = new MutationBuffer();
49276
49060
  mutationBuffers.push(mutationBuffer);
49277
49061
  mutationBuffer.init(options);
49278
- const observer = new (mutationObserverCtor())(
49062
+ const [ObserverCtor, iframeCleanup] = mutationObserverCtor();
49063
+ const observer = new ObserverCtor(
49279
49064
  callbackWrapper(mutationBuffer.processMutations.bind(mutationBuffer))
49280
49065
  );
49281
49066
  observer.observe(rootEl, {
@@ -49286,7 +49071,7 @@ function initMutationObserver(options, rootEl) {
49286
49071
  childList: true,
49287
49072
  subtree: true
49288
49073
  });
49289
- return observer;
49074
+ return [observer, iframeCleanup];
49290
49075
  }
49291
49076
  function initMoveObserver({
49292
49077
  mousemoveCb,
@@ -49406,12 +49191,12 @@ function initMouseInteractionObserver({
49406
49191
  pointerType = currentPointerType;
49407
49192
  currentPointerType = null;
49408
49193
  }
49409
- const e2 = legacy_isTouchEvent(event) ? event.changedTouches[0] : event;
49410
- if (!e2) {
49194
+ const e = legacy_isTouchEvent(event) ? event.changedTouches[0] : event;
49195
+ if (!e) {
49411
49196
  return;
49412
49197
  }
49413
49198
  const id = mirror2.getId(target);
49414
- const { clientX, clientY } = e2;
49199
+ const { clientX, clientY } = e;
49415
49200
  callbackWrapper(mouseInteractionCb)({
49416
49201
  type: MouseInteractions[thisEventKey],
49417
49202
  id,
@@ -49505,11 +49290,11 @@ function initViewportResizeObserver({ viewportResizeCb }, { win }) {
49505
49290
  return on("resize", updateDimension, win);
49506
49291
  }
49507
49292
  function findAndRemoveIframeBuffer(iframeEl) {
49508
- for (let i2 = mutationBuffers.length - 1; i2 >= 0; i2--) {
49509
- const buf = mutationBuffers[i2];
49293
+ for (let i = mutationBuffers.length - 1; i >= 0; i--) {
49294
+ const buf = mutationBuffers[i];
49510
49295
  if (buf.bufferBelongsToIframe(iframeEl)) {
49511
49296
  buf.reset();
49512
- mutationBuffers.splice(i2, 1);
49297
+ mutationBuffers.splice(i, 1);
49513
49298
  }
49514
49299
  }
49515
49300
  }
@@ -49582,13 +49367,13 @@ function initInputObserver({
49582
49367
  });
49583
49368
  }
49584
49369
  }
49585
- function cbWithDedup(target, v2) {
49370
+ function cbWithDedup(target, v) {
49586
49371
  const lastInputValue = lastInputValueMap.get(target);
49587
- if (!lastInputValue || lastInputValue.text !== v2.text || lastInputValue.isChecked !== v2.isChecked) {
49588
- lastInputValueMap.set(target, v2);
49372
+ if (!lastInputValue || lastInputValue.text !== v.text || lastInputValue.isChecked !== v.isChecked) {
49373
+ lastInputValueMap.set(target, v);
49589
49374
  const id = mirror2.getId(target);
49590
49375
  callbackWrapper(inputCb)({
49591
- ...v2,
49376
+ ...v,
49592
49377
  id
49593
49378
  });
49594
49379
  }
@@ -49645,15 +49430,15 @@ function getNestedCSSRulePositions(rule) {
49645
49430
  const positions = [];
49646
49431
  function recurse(childRule, pos) {
49647
49432
  if (hasNestedCSSRule("CSSGroupingRule") && childRule.parentRule instanceof CSSGroupingRule || hasNestedCSSRule("CSSMediaRule") && childRule.parentRule instanceof CSSMediaRule || hasNestedCSSRule("CSSSupportsRule") && childRule.parentRule instanceof CSSSupportsRule || hasNestedCSSRule("CSSConditionRule") && childRule.parentRule instanceof CSSConditionRule) {
49648
- const rules2 = Array.from(
49433
+ const rules = Array.from(
49649
49434
  childRule.parentRule.cssRules
49650
49435
  );
49651
- const index2 = rules2.indexOf(childRule);
49436
+ const index2 = rules.indexOf(childRule);
49652
49437
  pos.unshift(index2);
49653
49438
  return recurse(childRule.parentRule, pos);
49654
49439
  } else if (childRule.parentStyleSheet) {
49655
- const rules2 = Array.from(childRule.parentStyleSheet.cssRules);
49656
- const index2 = rules2.indexOf(childRule);
49440
+ const rules = Array.from(childRule.parentStyleSheet.cssRules);
49441
+ const index2 = rules.indexOf(childRule);
49657
49442
  pos.unshift(index2);
49658
49443
  }
49659
49444
  return pos;
@@ -49892,7 +49677,7 @@ function initAdoptedStyleSheetObserver({
49892
49677
  if (hostId !== null && hostId !== -1) {
49893
49678
  try {
49894
49679
  stylesheetManager.adoptStyleSheets(sheets, hostId);
49895
- } catch (e2) {
49680
+ } catch (e) {
49896
49681
  }
49897
49682
  }
49898
49683
  return result;
@@ -50029,7 +49814,7 @@ function initFontObserver({ fontCb, doc }) {
50029
49814
  const handlers = [];
50030
49815
  const fontMap = /* @__PURE__ */ new WeakMap();
50031
49816
  const originalFontFace = win.FontFace;
50032
- win.FontFace = function FontFace2(family, source, descriptors) {
49817
+ win.FontFace = function FontFace(family, source, descriptors) {
50033
49818
  const fontFace = new originalFontFace(family, source, descriptors);
50034
49819
  fontMap.set(fontFace, {
50035
49820
  family,
@@ -50075,8 +49860,8 @@ function initSelectionObserver(param) {
50075
49860
  collapsed = selection.isCollapsed || false;
50076
49861
  const ranges = [];
50077
49862
  const count = selection.rangeCount || 0;
50078
- for (let i2 = 0; i2 < count; i2++) {
50079
- const range = selection.getRangeAt(i2);
49863
+ for (let i = 0; i < count; i++) {
49864
+ const range = selection.getRangeAt(i);
50080
49865
  const { startContainer, startOffset, endContainer, endOffset } = range;
50081
49866
  const blocked = isBlocked(startContainer, blockClass, blockSelector, true) || isBlocked(endContainer, blockClass, blockSelector, true);
50082
49867
  if (blocked) continue;
@@ -50110,7 +49895,7 @@ function initCustomElementObserver({
50110
49895
  name
50111
49896
  }
50112
49897
  });
50113
- } catch (e2) {
49898
+ } catch (e) {
50114
49899
  console.warn(`Custom element callback failed for ${name}`);
50115
49900
  }
50116
49901
  return original.apply(this, [name, constructor, options]);
@@ -50119,7 +49904,7 @@ function initCustomElementObserver({
50119
49904
  );
50120
49905
  return restoreHandler;
50121
49906
  }
50122
- function mergeHooks(o2, hooks) {
49907
+ function mergeHooks(o, hooks) {
50123
49908
  const {
50124
49909
  mutationCb,
50125
49910
  mousemoveCb,
@@ -50134,105 +49919,107 @@ function mergeHooks(o2, hooks) {
50134
49919
  fontCb,
50135
49920
  selectionCb,
50136
49921
  customElementCb
50137
- } = o2;
50138
- o2.mutationCb = (...p) => {
49922
+ } = o;
49923
+ o.mutationCb = (...p) => {
50139
49924
  if (hooks.mutation) {
50140
49925
  hooks.mutation(...p);
50141
49926
  }
50142
49927
  mutationCb(...p);
50143
49928
  };
50144
- o2.mousemoveCb = (...p) => {
49929
+ o.mousemoveCb = (...p) => {
50145
49930
  if (hooks.mousemove) {
50146
49931
  hooks.mousemove(...p);
50147
49932
  }
50148
49933
  mousemoveCb(...p);
50149
49934
  };
50150
- o2.mouseInteractionCb = (...p) => {
49935
+ o.mouseInteractionCb = (...p) => {
50151
49936
  if (hooks.mouseInteraction) {
50152
49937
  hooks.mouseInteraction(...p);
50153
49938
  }
50154
49939
  mouseInteractionCb(...p);
50155
49940
  };
50156
- o2.scrollCb = (...p) => {
49941
+ o.scrollCb = (...p) => {
50157
49942
  if (hooks.scroll) {
50158
49943
  hooks.scroll(...p);
50159
49944
  }
50160
49945
  scrollCb(...p);
50161
49946
  };
50162
- o2.viewportResizeCb = (...p) => {
49947
+ o.viewportResizeCb = (...p) => {
50163
49948
  if (hooks.viewportResize) {
50164
49949
  hooks.viewportResize(...p);
50165
49950
  }
50166
49951
  viewportResizeCb(...p);
50167
49952
  };
50168
- o2.inputCb = (...p) => {
49953
+ o.inputCb = (...p) => {
50169
49954
  if (hooks.input) {
50170
49955
  hooks.input(...p);
50171
49956
  }
50172
49957
  inputCb(...p);
50173
49958
  };
50174
- o2.mediaInteractionCb = (...p) => {
49959
+ o.mediaInteractionCb = (...p) => {
50175
49960
  if (hooks.mediaInteaction) {
50176
49961
  hooks.mediaInteaction(...p);
50177
49962
  }
50178
49963
  mediaInteractionCb(...p);
50179
49964
  };
50180
- o2.styleSheetRuleCb = (...p) => {
49965
+ o.styleSheetRuleCb = (...p) => {
50181
49966
  if (hooks.styleSheetRule) {
50182
49967
  hooks.styleSheetRule(...p);
50183
49968
  }
50184
49969
  styleSheetRuleCb(...p);
50185
49970
  };
50186
- o2.styleDeclarationCb = (...p) => {
49971
+ o.styleDeclarationCb = (...p) => {
50187
49972
  if (hooks.styleDeclaration) {
50188
49973
  hooks.styleDeclaration(...p);
50189
49974
  }
50190
49975
  styleDeclarationCb(...p);
50191
49976
  };
50192
- o2.canvasMutationCb = (...p) => {
49977
+ o.canvasMutationCb = (...p) => {
50193
49978
  if (hooks.canvasMutation) {
50194
49979
  hooks.canvasMutation(...p);
50195
49980
  }
50196
49981
  canvasMutationCb(...p);
50197
49982
  };
50198
- o2.fontCb = (...p) => {
49983
+ o.fontCb = (...p) => {
50199
49984
  if (hooks.font) {
50200
49985
  hooks.font(...p);
50201
49986
  }
50202
49987
  fontCb(...p);
50203
49988
  };
50204
- o2.selectionCb = (...p) => {
49989
+ o.selectionCb = (...p) => {
50205
49990
  if (hooks.selection) {
50206
49991
  hooks.selection(...p);
50207
49992
  }
50208
49993
  selectionCb(...p);
50209
49994
  };
50210
- o2.customElementCb = (...c2) => {
49995
+ o.customElementCb = (...c) => {
50211
49996
  if (hooks.customElement) {
50212
- hooks.customElement(...c2);
49997
+ hooks.customElement(...c);
50213
49998
  }
50214
- customElementCb(...c2);
49999
+ customElementCb(...c);
50215
50000
  };
50216
50001
  }
50217
- function initObservers(o2, hooks = {}) {
50218
- const currentWindow = o2.doc.defaultView;
50002
+ function initObservers(o, hooks = {}) {
50003
+ const currentWindow = o.doc.defaultView;
50219
50004
  if (!currentWindow) {
50220
50005
  return () => {
50221
50006
  };
50222
50007
  }
50223
- mergeHooks(o2, hooks);
50008
+ mergeHooks(o, hooks);
50224
50009
  let mutationObserver;
50225
- if (o2.recordDOM) {
50226
- mutationObserver = initMutationObserver(o2, o2.doc);
50010
+ let cleanupMutationIframe = () => {
50011
+ };
50012
+ if (o.recordDOM) {
50013
+ [mutationObserver, cleanupMutationIframe] = initMutationObserver(o, o.doc);
50227
50014
  }
50228
- const mousemoveHandler = initMoveObserver(o2);
50229
- const mouseInteractionHandler = initMouseInteractionObserver(o2);
50230
- const scrollHandler = initScrollObserver(o2);
50231
- const viewportResizeHandler = initViewportResizeObserver(o2, {
50015
+ const mousemoveHandler = initMoveObserver(o);
50016
+ const mouseInteractionHandler = initMouseInteractionObserver(o);
50017
+ const scrollHandler = initScrollObserver(o);
50018
+ const viewportResizeHandler = initViewportResizeObserver(o, {
50232
50019
  win: currentWindow
50233
50020
  });
50234
- const inputHandler = initInputObserver(o2);
50235
- const mediaInteractionHandler = initMediaInteractionObserver(o2);
50021
+ const inputHandler = initInputObserver(o);
50022
+ const mediaInteractionHandler = initMediaInteractionObserver(o);
50236
50023
  let styleSheetObserver = () => {
50237
50024
  };
50238
50025
  let adoptedStyleSheetObserver = () => {
@@ -50241,20 +50028,20 @@ function initObservers(o2, hooks = {}) {
50241
50028
  };
50242
50029
  let fontObserver = () => {
50243
50030
  };
50244
- if (o2.recordDOM) {
50245
- styleSheetObserver = initStyleSheetObserver(o2, { win: currentWindow });
50246
- adoptedStyleSheetObserver = initAdoptedStyleSheetObserver(o2, o2.doc);
50247
- styleDeclarationObserver = initStyleDeclarationObserver(o2, {
50031
+ if (o.recordDOM) {
50032
+ styleSheetObserver = initStyleSheetObserver(o, { win: currentWindow });
50033
+ adoptedStyleSheetObserver = initAdoptedStyleSheetObserver(o, o.doc);
50034
+ styleDeclarationObserver = initStyleDeclarationObserver(o, {
50248
50035
  win: currentWindow
50249
50036
  });
50250
- if (o2.collectFonts) {
50251
- fontObserver = initFontObserver(o2);
50037
+ if (o.collectFonts) {
50038
+ fontObserver = initFontObserver(o);
50252
50039
  }
50253
50040
  }
50254
- const selectionObserver = initSelectionObserver(o2);
50255
- const customElementObserver = initCustomElementObserver(o2);
50041
+ const selectionObserver = initSelectionObserver(o);
50042
+ const customElementObserver = initCustomElementObserver(o);
50256
50043
  const pluginHandlers = [];
50257
- for (const plugin of o2.plugins) {
50044
+ for (const plugin of o.plugins) {
50258
50045
  pluginHandlers.push(
50259
50046
  plugin.observer(plugin.callback, currentWindow, plugin.options)
50260
50047
  );
@@ -50262,6 +50049,7 @@ function initObservers(o2, hooks = {}) {
50262
50049
  return callbackWrapper(() => {
50263
50050
  mutationBuffers.forEach((b) => b.reset());
50264
50051
  mutationObserver == null ? void 0 : mutationObserver.disconnect();
50052
+ cleanupMutationIframe();
50265
50053
  mousemoveHandler();
50266
50054
  mouseInteractionHandler();
50267
50055
  scrollHandler();
@@ -50385,7 +50173,7 @@ class IframeManager {
50385
50173
  this.iframes.set(iframeEl, true);
50386
50174
  if (iframeEl.contentWindow)
50387
50175
  this.crossOriginIframeMap.set(iframeEl.contentWindow, iframeEl);
50388
- if (!iframeEl.contentDocument && iframeEl.contentWindow)
50176
+ if (this.recordCrossOriginIframes && !iframeEl.contentDocument && iframeEl.contentWindow)
50389
50177
  iframeEl.contentWindow.postMessage(
50390
50178
  {
50391
50179
  type: "rrweb",
@@ -50458,18 +50246,18 @@ class IframeManager {
50458
50246
  crossOriginMessageEvent.data.isCheckout
50459
50247
  );
50460
50248
  }
50461
- transformCrossOriginEvent(iframeEl, e2) {
50249
+ transformCrossOriginEvent(iframeEl, e) {
50462
50250
  var _a2;
50463
- switch (e2.type) {
50251
+ switch (e.type) {
50464
50252
  case EventType.FullSnapshot: {
50465
50253
  this.crossOriginIframeMirror.reset(iframeEl);
50466
50254
  this.crossOriginIframeStyleMirror.reset(iframeEl);
50467
- this.replaceIdOnNode(e2.data.node, iframeEl);
50468
- const rootId = e2.data.node.id;
50255
+ this.replaceIdOnNode(e.data.node, iframeEl);
50256
+ const rootId = e.data.node.id;
50469
50257
  this.crossOriginIframeRootIdMap.set(iframeEl, rootId);
50470
- this.patchRootIdOnNode(e2.data.node, rootId);
50258
+ this.patchRootIdOnNode(e.data.node, rootId);
50471
50259
  return {
50472
- timestamp: e2.timestamp,
50260
+ timestamp: e.timestamp,
50473
50261
  type: EventType.IncrementalSnapshot,
50474
50262
  data: {
50475
50263
  source: IncrementalSource.Mutation,
@@ -50477,7 +50265,7 @@ class IframeManager {
50477
50265
  {
50478
50266
  parentId: this.mirror.getId(iframeEl),
50479
50267
  nextId: null,
50480
- node: e2.data.node
50268
+ node: e.data.node
50481
50269
  }
50482
50270
  ],
50483
50271
  removes: [],
@@ -50493,47 +50281,47 @@ class IframeManager {
50493
50281
  return false;
50494
50282
  }
50495
50283
  case EventType.Plugin: {
50496
- return e2;
50284
+ return e;
50497
50285
  }
50498
50286
  case EventType.Custom: {
50499
50287
  this.replaceIds(
50500
- e2.data.payload,
50288
+ e.data.payload,
50501
50289
  iframeEl,
50502
50290
  ["id", "parentId", "previousId", "nextId"]
50503
50291
  );
50504
- return e2;
50292
+ return e;
50505
50293
  }
50506
50294
  case EventType.IncrementalSnapshot: {
50507
- switch (e2.data.source) {
50295
+ switch (e.data.source) {
50508
50296
  case IncrementalSource.Mutation: {
50509
- e2.data.adds.forEach((n2) => {
50510
- this.replaceIds(n2, iframeEl, [
50297
+ e.data.adds.forEach((n) => {
50298
+ this.replaceIds(n, iframeEl, [
50511
50299
  "parentId",
50512
50300
  "nextId",
50513
50301
  "previousId"
50514
50302
  ]);
50515
- this.replaceIdOnNode(n2.node, iframeEl);
50303
+ this.replaceIdOnNode(n.node, iframeEl);
50516
50304
  const rootId = this.crossOriginIframeRootIdMap.get(iframeEl);
50517
- rootId && this.patchRootIdOnNode(n2.node, rootId);
50305
+ rootId && this.patchRootIdOnNode(n.node, rootId);
50518
50306
  });
50519
- e2.data.removes.forEach((n2) => {
50520
- this.replaceIds(n2, iframeEl, ["parentId", "id"]);
50307
+ e.data.removes.forEach((n) => {
50308
+ this.replaceIds(n, iframeEl, ["parentId", "id"]);
50521
50309
  });
50522
- e2.data.attributes.forEach((n2) => {
50523
- this.replaceIds(n2, iframeEl, ["id"]);
50310
+ e.data.attributes.forEach((n) => {
50311
+ this.replaceIds(n, iframeEl, ["id"]);
50524
50312
  });
50525
- e2.data.texts.forEach((n2) => {
50526
- this.replaceIds(n2, iframeEl, ["id"]);
50313
+ e.data.texts.forEach((n) => {
50314
+ this.replaceIds(n, iframeEl, ["id"]);
50527
50315
  });
50528
- return e2;
50316
+ return e;
50529
50317
  }
50530
50318
  case IncrementalSource.Drag:
50531
50319
  case IncrementalSource.TouchMove:
50532
50320
  case IncrementalSource.MouseMove: {
50533
- e2.data.positions.forEach((p) => {
50321
+ e.data.positions.forEach((p) => {
50534
50322
  this.replaceIds(p, iframeEl, ["id"]);
50535
50323
  });
50536
- return e2;
50324
+ return e;
50537
50325
  }
50538
50326
  case IncrementalSource.ViewportResize: {
50539
50327
  return false;
@@ -50543,31 +50331,31 @@ class IframeManager {
50543
50331
  case IncrementalSource.Scroll:
50544
50332
  case IncrementalSource.CanvasMutation:
50545
50333
  case IncrementalSource.Input: {
50546
- this.replaceIds(e2.data, iframeEl, ["id"]);
50547
- return e2;
50334
+ this.replaceIds(e.data, iframeEl, ["id"]);
50335
+ return e;
50548
50336
  }
50549
50337
  case IncrementalSource.StyleSheetRule:
50550
50338
  case IncrementalSource.StyleDeclaration: {
50551
- this.replaceIds(e2.data, iframeEl, ["id"]);
50552
- this.replaceStyleIds(e2.data, iframeEl, ["styleId"]);
50553
- return e2;
50339
+ this.replaceIds(e.data, iframeEl, ["id"]);
50340
+ this.replaceStyleIds(e.data, iframeEl, ["styleId"]);
50341
+ return e;
50554
50342
  }
50555
50343
  case IncrementalSource.Font: {
50556
- return e2;
50344
+ return e;
50557
50345
  }
50558
50346
  case IncrementalSource.Selection: {
50559
- e2.data.ranges.forEach((range) => {
50347
+ e.data.ranges.forEach((range) => {
50560
50348
  this.replaceIds(range, iframeEl, ["start", "end"]);
50561
50349
  });
50562
- return e2;
50350
+ return e;
50563
50351
  }
50564
50352
  case IncrementalSource.AdoptedStyleSheet: {
50565
- this.replaceIds(e2.data, iframeEl, ["id"]);
50566
- this.replaceStyleIds(e2.data, iframeEl, ["styleIds"]);
50567
- (_a2 = e2.data.styles) == null ? void 0 : _a2.forEach((style) => {
50353
+ this.replaceIds(e.data, iframeEl, ["id"]);
50354
+ this.replaceStyleIds(e.data, iframeEl, ["styleIds"]);
50355
+ (_a2 = e.data.styles) == null ? void 0 : _a2.forEach((style) => {
50568
50356
  this.replaceStyleIds(style, iframeEl, ["styleId"]);
50569
50357
  });
50570
- return e2;
50358
+ return e;
50571
50359
  }
50572
50360
  }
50573
50361
  }
@@ -50633,7 +50421,7 @@ class ShadowDomManager {
50633
50421
  if (!isNativeShadowDom(shadowRoot2)) return;
50634
50422
  if (this.shadowDoms.has(shadowRoot2)) return;
50635
50423
  this.shadowDoms.add(shadowRoot2);
50636
- const observer = initMutationObserver(
50424
+ const [observer] = initMutationObserver(
50637
50425
  {
50638
50426
  ...this.bypassOptions,
50639
50427
  doc,
@@ -50706,7 +50494,7 @@ class ShadowDomManager {
50706
50494
  this.restoreHandlers.forEach((handler) => {
50707
50495
  try {
50708
50496
  handler();
50709
- } catch (e2) {
50497
+ } catch (e) {
50710
50498
  }
50711
50499
  });
50712
50500
  this.restoreHandlers = [];
@@ -50715,16 +50503,16 @@ class ShadowDomManager {
50715
50503
  }
50716
50504
  var chars = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/";
50717
50505
  var lookup = typeof Uint8Array === "undefined" ? [] : new Uint8Array(256);
50718
- for (var i$1 = 0; i$1 < chars.length; i$1++) {
50719
- lookup[chars.charCodeAt(i$1)] = i$1;
50506
+ for (var i = 0; i < chars.length; i++) {
50507
+ lookup[chars.charCodeAt(i)] = i;
50720
50508
  }
50721
50509
  var encode = function(arraybuffer) {
50722
- var bytes = new Uint8Array(arraybuffer), i2, len = bytes.length, base64 = "";
50723
- for (i2 = 0; i2 < len; i2 += 3) {
50724
- base64 += chars[bytes[i2] >> 2];
50725
- base64 += chars[(bytes[i2] & 3) << 4 | bytes[i2 + 1] >> 4];
50726
- base64 += chars[(bytes[i2 + 1] & 15) << 2 | bytes[i2 + 2] >> 6];
50727
- base64 += chars[bytes[i2 + 2] & 63];
50510
+ var bytes = new Uint8Array(arraybuffer), i, len = bytes.length, base64 = "";
50511
+ for (i = 0; i < len; i += 3) {
50512
+ base64 += chars[bytes[i] >> 2];
50513
+ base64 += chars[(bytes[i] & 3) << 4 | bytes[i + 1] >> 4];
50514
+ base64 += chars[(bytes[i + 1] & 15) << 2 | bytes[i + 2] >> 6];
50515
+ base64 += chars[bytes[i + 2] & 63];
50728
50516
  }
50729
50517
  if (len % 3 === 2) {
50730
50518
  base64 = base64.substring(0, base64.length - 1) + "=";
@@ -50734,7 +50522,7 @@ var encode = function(arraybuffer) {
50734
50522
  return base64;
50735
50523
  };
50736
50524
  const canvasVarMap = /* @__PURE__ */ new Map();
50737
- function variableListFor$1(ctx, ctor) {
50525
+ function variableListFor(ctx, ctor) {
50738
50526
  let contextMap = canvasVarMap.get(ctx);
50739
50527
  if (!contextMap) {
50740
50528
  contextMap = /* @__PURE__ */ new Map();
@@ -50749,7 +50537,7 @@ const saveWebGLVar = (value, win, ctx) => {
50749
50537
  if (!value || !(isInstanceOfWebGLObject(value, win) || typeof value === "object"))
50750
50538
  return;
50751
50539
  const name = value.constructor.name;
50752
- const list = variableListFor$1(ctx, name);
50540
+ const list = variableListFor(ctx, name);
50753
50541
  let index2 = list.indexOf(value);
50754
50542
  if (index2 === -1) {
50755
50543
  index2 = list.length;
@@ -50882,11 +50670,11 @@ function initCanvas2DMutationObserver(cb, win, blockClass, blockSelector) {
50882
50670
  win.CanvasRenderingContext2D.prototype,
50883
50671
  prop,
50884
50672
  {
50885
- set(v2) {
50673
+ set(v) {
50886
50674
  cb(this.canvas, {
50887
50675
  type: CanvasContext["2D"],
50888
50676
  property: prop,
50889
- args: [v2],
50677
+ args: [v],
50890
50678
  setter: true
50891
50679
  });
50892
50680
  }
@@ -50980,11 +50768,11 @@ function patchGLPrototype(prototype, type, cb, blockClass, blockSelector, win) {
50980
50768
  handlers.push(restoreHandler);
50981
50769
  } catch {
50982
50770
  const hookHandler = hookSetter(prototype, prop, {
50983
- set(v2) {
50771
+ set(v) {
50984
50772
  cb(this.canvas, {
50985
50773
  type,
50986
50774
  property: prop,
50987
- args: [v2],
50775
+ args: [v],
50988
50776
  setter: true
50989
50777
  });
50990
50778
  }
@@ -50996,16 +50784,18 @@ function patchGLPrototype(prototype, type, cb, blockClass, blockSelector, win) {
50996
50784
  }
50997
50785
  function initCanvasWebGLMutationObserver(cb, win, blockClass, blockSelector) {
50998
50786
  const handlers = [];
50999
- handlers.push(
51000
- ...patchGLPrototype(
51001
- win.WebGLRenderingContext.prototype,
51002
- CanvasContext.WebGL,
51003
- cb,
51004
- blockClass,
51005
- blockSelector,
51006
- win
51007
- )
51008
- );
50787
+ if (typeof win.WebGLRenderingContext !== "undefined") {
50788
+ handlers.push(
50789
+ ...patchGLPrototype(
50790
+ win.WebGLRenderingContext.prototype,
50791
+ CanvasContext.WebGL,
50792
+ cb,
50793
+ blockClass,
50794
+ blockSelector,
50795
+ win
50796
+ )
50797
+ );
50798
+ }
51009
50799
  if (typeof win.WebGL2RenderingContext !== "undefined") {
51010
50800
  handlers.push(
51011
50801
  ...patchGLPrototype(
@@ -51087,11 +50877,11 @@ class CanvasManager {
51087
50877
  );
51088
50878
  const snapshotInProgressMap = /* @__PURE__ */ new Map();
51089
50879
  const worker = new WorkerWrapper();
51090
- worker.onmessage = (e2) => {
51091
- const { id } = e2.data;
50880
+ worker.onmessage = (e) => {
50881
+ const { id } = e.data;
51092
50882
  snapshotInProgressMap.set(id, false);
51093
- if (!("base64" in e2.data)) return;
51094
- const { base64, type, width, height } = e2.data;
50883
+ if (!("base64" in e.data)) return;
50884
+ const { base64, type, width, height } = e.data;
51095
50885
  this.mutationCb({
51096
50886
  id,
51097
50887
  type: CanvasContext["2D"],
@@ -51273,17 +51063,17 @@ class StylesheetManager {
51273
51063
  let styleId;
51274
51064
  if (!this.styleMirror.has(sheet)) {
51275
51065
  styleId = this.styleMirror.add(sheet);
51276
- const rules2 = [];
51277
- for (let i2 = 0; i2 < sheet.rules.length; ++i2) {
51278
- rules2.push({
51279
- rule: stringifyRule(sheet.rules[i2], sheet.href),
51280
- index: i2
51066
+ const rules = [];
51067
+ for (let i = 0; i < sheet.rules.length; ++i) {
51068
+ rules.push({
51069
+ rule: stringifyRule(sheet.rules[i], sheet.href),
51070
+ index: i
51281
51071
  });
51282
51072
  }
51283
51073
  styles.push({
51284
51074
  styleId,
51285
- rules: Array.from(sheet.rules || CSSRule, (r2, index2) => ({
51286
- rule: stringifyRule(r2, sheet.href),
51075
+ rules: Array.from(sheet.rules || CSSRule, (r, index2) => ({
51076
+ rule: stringifyRule(r, sheet.href),
51287
51077
  index: index2
51288
51078
  }))
51289
51079
  });
@@ -51324,7 +51114,7 @@ class ProcessedNodeManager {
51324
51114
  }
51325
51115
  }
51326
51116
  let wrappedEmit;
51327
- let takeFullSnapshot$1 = () => {
51117
+ let takeFullSnapshot = () => {
51328
51118
  };
51329
51119
  let canvasManager;
51330
51120
  let recording = false;
@@ -51338,7 +51128,7 @@ try {
51338
51128
  } catch (err) {
51339
51129
  console.debug("Unable to override Array.from", err);
51340
51130
  }
51341
- const mirror = createMirror$2();
51131
+ const mirror = createMirror();
51342
51132
  function record(options = {}) {
51343
51133
  const {
51344
51134
  emit,
@@ -51383,7 +51173,7 @@ function record(options = {}) {
51383
51173
  if (window.parent.document) {
51384
51174
  passEmitsToParent = false;
51385
51175
  }
51386
- } catch (e2) {
51176
+ } catch (e) {
51387
51177
  passEmitsToParent = true;
51388
51178
  }
51389
51179
  }
@@ -51416,66 +51206,52 @@ function record(options = {}) {
51416
51206
  select: true,
51417
51207
  password: true
51418
51208
  } : _maskInputOptions !== void 0 ? _maskInputOptions : { password: true };
51419
- const slimDOMOptions = _slimDOMOptions === true || _slimDOMOptions === "all" ? {
51420
- script: true,
51421
- comment: true,
51422
- headFavicon: true,
51423
- headWhitespace: true,
51424
- headMetaSocial: true,
51425
- headMetaRobots: true,
51426
- headMetaHttpEquiv: true,
51427
- headMetaVerification: true,
51428
- // the following are off for slimDOMOptions === true,
51429
- // as they destroy some (hidden) info:
51430
- headMetaAuthorship: _slimDOMOptions === "all",
51431
- headMetaDescKeywords: _slimDOMOptions === "all",
51432
- headTitleMutations: _slimDOMOptions === "all"
51433
- } : _slimDOMOptions ? _slimDOMOptions : {};
51434
- polyfill$1();
51209
+ const slimDOMOptions = slimDOMDefaults(_slimDOMOptions);
51210
+ polyfill();
51435
51211
  let lastFullSnapshotEvent;
51436
51212
  let incrementalSnapshotCount = 0;
51437
- const eventProcessor = (e2) => {
51213
+ const eventProcessor = (e) => {
51438
51214
  for (const plugin of plugins || []) {
51439
51215
  if (plugin.eventProcessor) {
51440
- e2 = plugin.eventProcessor(e2);
51216
+ e = plugin.eventProcessor(e);
51441
51217
  }
51442
51218
  }
51443
51219
  if (packFn && // Disable packing events which will be emitted to parent frames.
51444
51220
  !passEmitsToParent) {
51445
- e2 = packFn(e2);
51221
+ e = packFn(e);
51446
51222
  }
51447
- return e2;
51223
+ return e;
51448
51224
  };
51449
- wrappedEmit = (r2, isCheckout) => {
51225
+ wrappedEmit = (r, isCheckout) => {
51450
51226
  var _a2;
51451
- const e2 = r2;
51452
- e2.timestamp = nowTimestamp();
51453
- if (((_a2 = mutationBuffers[0]) == null ? void 0 : _a2.isFrozen()) && e2.type !== EventType.FullSnapshot && !(e2.type === EventType.IncrementalSnapshot && e2.data.source === IncrementalSource.Mutation)) {
51227
+ const e = r;
51228
+ e.timestamp = nowTimestamp();
51229
+ if (((_a2 = mutationBuffers[0]) == null ? void 0 : _a2.isFrozen()) && e.type !== EventType.FullSnapshot && !(e.type === EventType.IncrementalSnapshot && e.data.source === IncrementalSource.Mutation)) {
51454
51230
  mutationBuffers.forEach((buf) => buf.unfreeze());
51455
51231
  }
51456
51232
  if (inEmittingFrame) {
51457
- emit == null ? void 0 : emit(eventProcessor(e2), isCheckout);
51233
+ emit == null ? void 0 : emit(eventProcessor(e), isCheckout);
51458
51234
  } else if (passEmitsToParent) {
51459
51235
  const message = {
51460
51236
  type: "rrweb",
51461
- event: eventProcessor(e2),
51237
+ event: eventProcessor(e),
51462
51238
  origin: window.location.origin,
51463
51239
  isCheckout
51464
51240
  };
51465
51241
  window.parent.postMessage(message, "*");
51466
51242
  }
51467
- if (e2.type === EventType.FullSnapshot) {
51468
- lastFullSnapshotEvent = e2;
51243
+ if (e.type === EventType.FullSnapshot) {
51244
+ lastFullSnapshotEvent = e;
51469
51245
  incrementalSnapshotCount = 0;
51470
- } else if (e2.type === EventType.IncrementalSnapshot) {
51471
- if (e2.data.source === IncrementalSource.Mutation && e2.data.isAttachIframe) {
51246
+ } else if (e.type === EventType.IncrementalSnapshot) {
51247
+ if (e.data.source === IncrementalSource.Mutation && e.data.isAttachIframe) {
51472
51248
  return;
51473
51249
  }
51474
51250
  incrementalSnapshotCount++;
51475
51251
  const exceedCount = checkoutEveryNth && incrementalSnapshotCount >= checkoutEveryNth;
51476
- const exceedTime = checkoutEveryNms && e2.timestamp - lastFullSnapshotEvent.timestamp > checkoutEveryNms;
51252
+ const exceedTime = checkoutEveryNms && e.timestamp - lastFullSnapshotEvent.timestamp > checkoutEveryNms;
51477
51253
  if (exceedCount || exceedTime) {
51478
- takeFullSnapshot$1(true);
51254
+ takeFullSnapshot(true);
51479
51255
  }
51480
51256
  }
51481
51257
  };
@@ -51502,11 +51278,11 @@ function record(options = {}) {
51502
51278
  ...p
51503
51279
  }
51504
51280
  });
51505
- const wrappedAdoptedStyleSheetEmit = (a2) => wrappedEmit({
51281
+ const wrappedAdoptedStyleSheetEmit = (a) => wrappedEmit({
51506
51282
  type: EventType.IncrementalSnapshot,
51507
51283
  data: {
51508
51284
  source: IncrementalSource.AdoptedStyleSheet,
51509
- ...a2
51285
+ ...a
51510
51286
  }
51511
51287
  });
51512
51288
  const stylesheetManager = new StylesheetManager({
@@ -51519,7 +51295,7 @@ function record(options = {}) {
51519
51295
  stylesheetManager,
51520
51296
  recordCrossOriginIframes,
51521
51297
  wrappedEmit,
51522
- takeFullSnapshot: takeFullSnapshot$1
51298
+ takeFullSnapshot
51523
51299
  });
51524
51300
  for (const plugin of plugins || []) {
51525
51301
  if (plugin.getMirror)
@@ -51566,7 +51342,7 @@ function record(options = {}) {
51566
51342
  },
51567
51343
  mirror
51568
51344
  });
51569
- takeFullSnapshot$1 = (isCheckout = false) => {
51345
+ takeFullSnapshot = (isCheckout = false) => {
51570
51346
  if (!recordDOM) {
51571
51347
  return;
51572
51348
  }
@@ -51599,15 +51375,15 @@ function record(options = {}) {
51599
51375
  dataURLOptions,
51600
51376
  recordCanvas,
51601
51377
  inlineImages,
51602
- onSerialize: (n2) => {
51603
- if (isSerializedIframe(n2, mirror)) {
51604
- iframeManager.addIframe(n2);
51378
+ onSerialize: (n) => {
51379
+ if (isSerializedIframe(n, mirror)) {
51380
+ iframeManager.addIframe(n);
51605
51381
  }
51606
- if (isSerializedStylesheet(n2, mirror)) {
51607
- stylesheetManager.trackLinkElement(n2);
51382
+ if (isSerializedStylesheet(n, mirror)) {
51383
+ stylesheetManager.trackLinkElement(n);
51608
51384
  }
51609
- if (hasShadowRoot(n2)) {
51610
- shadowDomManager.addShadowRoot(index.shadowRoot(n2), document);
51385
+ if (hasShadowRoot(n)) {
51386
+ shadowDomManager.addShadowRoot(index.shadowRoot(n), document);
51611
51387
  }
51612
51388
  },
51613
51389
  onIframeLoad: (iframe, childSn) => {
@@ -51639,7 +51415,7 @@ function record(options = {}) {
51639
51415
  mirror.getId(document)
51640
51416
  );
51641
51417
  };
51642
- iframeManager.setTakeFullSnapshot(takeFullSnapshot$1);
51418
+ iframeManager.setTakeFullSnapshot(takeFullSnapshot);
51643
51419
  try {
51644
51420
  const handlers = [];
51645
51421
  const iframeHandlersMap = /* @__PURE__ */ new Map();
@@ -51670,11 +51446,11 @@ function record(options = {}) {
51670
51446
  ...d
51671
51447
  }
51672
51448
  }),
51673
- inputCb: (v2) => wrappedEmit({
51449
+ inputCb: (v) => wrappedEmit({
51674
51450
  type: EventType.IncrementalSnapshot,
51675
51451
  data: {
51676
51452
  source: IncrementalSource.Input,
51677
- ...v2
51453
+ ...v
51678
51454
  }
51679
51455
  }),
51680
51456
  mediaInteractionCb: (p) => wrappedEmit({
@@ -51684,18 +51460,18 @@ function record(options = {}) {
51684
51460
  ...p
51685
51461
  }
51686
51462
  }),
51687
- styleSheetRuleCb: (r2) => wrappedEmit({
51463
+ styleSheetRuleCb: (r) => wrappedEmit({
51688
51464
  type: EventType.IncrementalSnapshot,
51689
51465
  data: {
51690
51466
  source: IncrementalSource.StyleSheetRule,
51691
- ...r2
51467
+ ...r
51692
51468
  }
51693
51469
  }),
51694
- styleDeclarationCb: (r2) => wrappedEmit({
51470
+ styleDeclarationCb: (r) => wrappedEmit({
51695
51471
  type: EventType.IncrementalSnapshot,
51696
51472
  data: {
51697
51473
  source: IncrementalSource.StyleDeclaration,
51698
- ...r2
51474
+ ...r
51699
51475
  }
51700
51476
  }),
51701
51477
  canvasMutationCb: wrappedCanvasMutationEmit,
@@ -51715,12 +51491,12 @@ function record(options = {}) {
51715
51491
  }
51716
51492
  });
51717
51493
  },
51718
- customElementCb: (c2) => {
51494
+ customElementCb: (c) => {
51719
51495
  wrappedEmit({
51720
51496
  type: EventType.IncrementalSnapshot,
51721
51497
  data: {
51722
51498
  source: IncrementalSource.CustomElement,
51723
- ...c2
51499
+ ...c
51724
51500
  }
51725
51501
  });
51726
51502
  },
@@ -51783,11 +51559,11 @@ function record(options = {}) {
51783
51559
  findAndRemoveIframeBuffer(iframeEl);
51784
51560
  });
51785
51561
  const init = () => {
51786
- takeFullSnapshot$1();
51562
+ takeFullSnapshot();
51787
51563
  handlers.push(observe(document));
51788
51564
  recording = true;
51789
51565
  };
51790
- if (document.readyState === "interactive" || document.readyState === "complete") {
51566
+ if (["interactive", "complete"].includes(document.readyState)) {
51791
51567
  init();
51792
51568
  } else {
51793
51569
  handlers.push(
@@ -51814,7 +51590,16 @@ function record(options = {}) {
51814
51590
  );
51815
51591
  }
51816
51592
  return () => {
51817
- handlers.forEach((h) => h());
51593
+ handlers.forEach((handler) => {
51594
+ try {
51595
+ handler();
51596
+ } catch (error) {
51597
+ const msg = String(error).toLowerCase();
51598
+ if (!msg.includes("cross-origin")) {
51599
+ console.warn(error);
51600
+ }
51601
+ }
51602
+ });
51818
51603
  iframeHandlersMap.forEach((h) => h());
51819
51604
  processedNodeManager.destroy();
51820
51605
  recording = false;
@@ -51843,13 +51628,9 @@ record.takeFullSnapshot = (isCheckout) => {
51843
51628
  if (!recording) {
51844
51629
  throw new Error("please take full snapshot after start recording");
51845
51630
  }
51846
- takeFullSnapshot$1(isCheckout);
51631
+ takeFullSnapshot(isCheckout);
51847
51632
  };
51848
51633
  record.mirror = mirror;
51849
- var n;
51850
- !function(t2) {
51851
- t2[t2.NotStarted = 0] = "NotStarted", t2[t2.Running = 1] = "Running", t2[t2.Stopped = 2] = "Stopped";
51852
- }(n || (n = {}));
51853
51634
  return record; }
51854
51635
 
51855
51636
  class SessionRecorderBuffer {
@@ -52617,7 +52398,7 @@ class SessionRecorder {
52617
52398
  this.stop();
52618
52399
  }
52619
52400
  if (visitorConfig && visitorConfig.enable && this.isRecording()) {
52620
- this.liveReplayClient.onLiveFlag(visitorConfig.live, this.visitorId, () => this.snapshot());
52401
+ this.liveReplayClient.onLiveFlag(visitorConfig.live, this.visitorId, () => this._snapshotForLiveReplay());
52621
52402
  if (continuationCallback) {
52622
52403
  continuationCallback.call(this);
52623
52404
  }
@@ -52639,6 +52420,11 @@ class SessionRecorder {
52639
52420
  this.send();
52640
52421
  this.record.takeFullSnapshot();
52641
52422
  }
52423
+ _snapshotForLiveReplay() {
52424
+ if (!this._recordsInThisFrame())
52425
+ return;
52426
+ this.snapshot();
52427
+ }
52642
52428
  isRecording() {
52643
52429
  return this.interval != null;
52644
52430
  }
@@ -52675,7 +52461,7 @@ class SessionRecorder {
52675
52461
  blockSelector: blockedSelectors.concat(hiddenSelectors).join(','),
52676
52462
  hideSelector: hiddenSelectors.join(','),
52677
52463
  recordCrossOriginIframes: recordCrossOriginIframes != null ? recordCrossOriginIframes : true,
52678
- emitFromIframe: !!this.api.ConfigReader.get(RECORDING_CONFIG_TREAT_IFRAME_AS_ROOT)
52464
+ emitFromIframe: this._treatIframeAsRoot()
52679
52465
  };
52680
52466
  return config;
52681
52467
  }
@@ -52779,7 +52565,7 @@ class SessionRecorder {
52779
52565
  errorHandler: this.errorHandler
52780
52566
  }, config));
52781
52567
  this._refreshIds();
52782
- this.liveReplayClient.onLiveFlag(visitorConfig.live, this.visitorId, () => this.snapshot());
52568
+ this.liveReplayClient.onLiveFlag(visitorConfig.live, this.visitorId, () => this._snapshotForLiveReplay());
52783
52569
  this.onRecordingStart();
52784
52570
  }
52785
52571
  catch (e) {
@@ -52797,6 +52583,21 @@ class SessionRecorder {
52797
52583
  topId: this.api.store.state.frames.topId
52798
52584
  });
52799
52585
  }
52586
+ _recordsInThisFrame() {
52587
+ if (window == window.top || this._treatIframeAsRoot())
52588
+ return true;
52589
+ if (!this.recordingConfig(this.visitorConfig).recordCrossOriginIframes)
52590
+ return true;
52591
+ try {
52592
+ return !window.parent.document;
52593
+ }
52594
+ catch (e) {
52595
+ return true;
52596
+ }
52597
+ }
52598
+ _treatIframeAsRoot() {
52599
+ return !!this.api.ConfigReader.get(RECORDING_CONFIG_TREAT_IFRAME_AS_ROOT);
52600
+ }
52800
52601
  _refreshIds() {
52801
52602
  if (window == window.top)
52802
52603
  return;
@@ -53049,7 +52850,7 @@ class SessionRecorder {
53049
52850
  // ignore stale responses from a since-changed identity
53050
52851
  if (messageData.visitorId !== this.visitorId)
53051
52852
  break;
53052
- this.liveReplayClient.onLiveFlag(messageData.live, this.visitorId, () => this.snapshot());
52853
+ this.liveReplayClient.onLiveFlag(messageData.live, this.visitorId, () => this._snapshotForLiveReplay());
53053
52854
  break;
53054
52855
  }
53055
52856
  }