@appsurify-testmap/rrweb-cypress-plugin 2.1.1-alpha.6 → 2.1.1-alpha.7

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,17 +1,4 @@
1
- (function (g, f) {
2
- if ("object" == typeof exports && "object" == typeof module) {
3
- module.exports = f();
4
- } else if ("function" == typeof define && define.amd) {
5
- define("rrweb-cypress-plugin", [], f);
6
- } else if ("object" == typeof exports) {
7
- exports["rrweb-cypress-plugin"] = f();
8
- } else {
9
- g["rrweb-cypress-plugin"] = f();
10
- }
11
- }(this, () => {
12
- var exports = {};
13
- var module = { exports };
14
- "use strict";var S=Object.defineProperty,x=Object.defineProperties;var $=Object.getOwnPropertyDescriptors;var g=Object.getOwnPropertySymbols;var C=Object.prototype.hasOwnProperty,I=Object.prototype.propertyIsEnumerable;var y=(n,e,s)=>e in n?S(n,e,{enumerable:!0,configurable:!0,writable:!0,value:s}):n[e]=s,f=(n,e)=>{for(var s in e||(e={}))C.call(e,s)&&y(n,s,e[s]);if(g)for(var s of g(e))I.call(e,s)&&y(n,s,e[s]);return n},b=(n,e)=>x(n,$(e));var _=Object.defineProperty,E=(n,e,s)=>e in n?_(n,e,{enumerable:!0,configurable:!0,writable:!0,value:s}):n[e]=s,d=(n,e,s)=>E(n,typeof e!="symbol"?e+"":e,s);Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const v=new Map;function R(n,e){v.set(n,e)}function h(n){return v.get(n)}function m(n){return n.filter(e=>typeof e=="object"&&e!==null&&"log"in e&&e.log===!1?!1:typeof e=="string"||typeof e=="number"||typeof e=="boolean"||e===null)}function M(n){const e=n==null?void 0:n[0];if(!e)return null;const s=e.tagName.toLowerCase(),r=e.id?`#${e.id}`:"",o=Array.from(e.classList).map(t=>`.${t}`).join("");return`${s}${r}${o}`}function p(n){return n.titlePath().join(" > ")}function N(n){if(n)return{id:n.id,file:n.file,invocationDetails:w(n.invocationDetails),pending:n.pending,root:n.root,title:n.title,type:n.type}}function w(n){var e,s,r,o,t,a,i;return{absoluteFile:(e=n==null?void 0:n.absoluteFile)!=null?e:"",column:(s=n==null?void 0:n.column)!=null?s:0,fileUrl:(r=n==null?void 0:n.fileUrl)!=null?r:"",function:(o=n==null?void 0:n.function)!=null?o:"",line:(t=n==null?void 0:n.line)!=null?t:0,originalFile:(a=n==null?void 0:n.originalFile)!=null?a:"",relativeFile:(i=n==null?void 0:n.relativeFile)!=null?i:""}}function A(n){return{spec:T(n.spec),browser:O(n.browser),test:P(n.test),recorderEvents:Array.isArray(n.recorderEvents)?n.recorderEvents:[]}}function T(n){var e,s,r,o,t,a,i,l,c;return{name:(e=n.name)!=null?e:"",absolute:(s=n.absolute)!=null?s:"",relative:(r=n.relative)!=null?r:"",specFilter:(o=n.specFilter)!=null?o:"",specType:(t=n.specType)!=null?t:"integration",baseName:(a=n.baseName)!=null?a:"",fileExtension:(i=n.fileExtension)!=null?i:"",fileName:(l=n.fileName)!=null?l:"",id:(c=n.id)!=null?c:""}}function O(n){var e,s,r,o,t,a,i;return{name:(e=n.name)!=null?e:"",version:(s=n.version)!=null?s:"",displayName:(r=n.displayName)!=null?r:"",family:(o=n.family)!=null?o:"",majorVersion:(t=n.majorVersion)!=null?t:"",channel:(a=n.channel)!=null?a:"",path:(i=n.path)!=null?i:""}}function P(n){var e,s,r,o,t,a,i,l,c;return{suite:N(n.parent),file:(e=n.file)!=null?e:"",duration:(s=n.duration)!=null?s:0,id:(r=n.id)!=null?r:"",invocationDetails:w(n.invocationDetails),pending:(o=n.pending)!=null?o:!1,state:(t=n.state)!=null?t:"unknown",sync:(a=n.sync)!=null?a:!1,timedOut:(i=n.timedOut)!=null?i:!1,title:(l=n.title)!=null?l:"",titlePath:typeof n.titlePath=="function"?n.titlePath():[],fullTitle:typeof n.fullTitle=="function"?n.fullTitle():"",type:(c=n.type)!=null?c:"test"}}const L={key:"id"},D="rrweb/sequential-id@1",F=n=>{const e=Object.assign({},L,n);let s=0;return{name:D,eventProcessor(r){const o=e.getId?e.getId():++s;return Object.assign(r,{[e.key]:o}),r},options:e}},U=`(function (g, f) {
1
+ var m=new Map;function g(e,t){m.set(e,t)}function c(e){return m.get(e)}function p(e){return e.filter(t=>typeof t=="object"&&t!==null&&"log"in t&&t.log===!1?!1:typeof t=="string"||typeof t=="number"||typeof t=="boolean"||t===null)}function y(e){let t=e?.[0];if(!t)return null;let s=t.tagName.toLowerCase(),n=t.id?`#${t.id}`:"",r=Array.from(t.classList).map(o=>`.${o}`).join("");return`${s}${n}${r}`}function a(e){return e.titlePath().join(" > ")}function I(e){if(e)return{id:e.id,file:e.file,invocationDetails:b(e.invocationDetails),pending:e.pending,root:e.root,title:e.title,type:e.type}}function b(e){return{absoluteFile:e?.absoluteFile??"",column:e?.column??0,fileUrl:e?.fileUrl??"",function:e?.function??"",line:e?.line??0,originalFile:e?.originalFile??"",relativeFile:e?.relativeFile??""}}function v(e){return{spec:E(e.spec),browser:_(e.browser),test:R(e.test),recorderEvents:Array.isArray(e.recorderEvents)?e.recorderEvents:[]}}function E(e){return{name:e.name??"",absolute:e.absolute??"",relative:e.relative??"",specFilter:e.specFilter??"",specType:e.specType??"integration",baseName:e.baseName??"",fileExtension:e.fileExtension??"",fileName:e.fileName??"",id:e.id??""}}function _(e){return{name:e.name??"",version:e.version??"",displayName:e.displayName??"",family:e.family??"",majorVersion:e.majorVersion??"",channel:e.channel??"",path:e.path??""}}function R(e){return{suite:I(e.parent),file:e.file??"",duration:e.duration??0,id:e.id??"",invocationDetails:b(e.invocationDetails),pending:e.pending??!1,state:e.state??"unknown",sync:e.sync??!1,timedOut:e.timedOut??!1,title:e.title??"",titlePath:typeof e.titlePath=="function"?e.titlePath():[],fullTitle:typeof e.fullTitle=="function"?e.fullTitle():"",type:e.type??"test"}}import{getRecordSequentialIdPlugin as T}from"@appsurify-testmap/rrweb-plugin-sequential-id-record";var w=`(function (g, f) {
15
2
  if ("object" == typeof exports && "object" == typeof module) {
16
3
  module.exports = f();
17
4
  } else if ("function" == typeof define && define.amd) {
@@ -124,10 +111,12 @@ function getUntaintedPrototype$1(key) {
124
111
  const iframeEl = document.createElement("iframe");
125
112
  document.body.appendChild(iframeEl);
126
113
  const win = iframeEl.contentWindow;
127
- if (!win) return defaultObj.prototype;
114
+ if (!win)
115
+ return defaultObj.prototype;
128
116
  const untaintedObject = win[key].prototype;
129
117
  document.body.removeChild(iframeEl);
130
- if (!untaintedObject) return defaultPrototype;
118
+ if (!untaintedObject)
119
+ return defaultPrototype;
131
120
  return untaintedBasePrototype$1[key] = untaintedObject;
132
121
  } catch (e) {
133
122
  return defaultPrototype;
@@ -146,7 +135,8 @@ function getUntaintedAccessor$1(key, instance, accessor) {
146
135
  untaintedPrototype,
147
136
  accessor
148
137
  )) == null ? void 0 : _a2.get;
149
- if (!untaintedAccessor) return instance[accessor];
138
+ if (!untaintedAccessor)
139
+ return instance[accessor];
150
140
  untaintedAccessorCache$1[cacheKey] = untaintedAccessor;
151
141
  return untaintedAccessor.call(instance);
152
142
  }
@@ -159,7 +149,8 @@ function getUntaintedMethod$1(key, instance, method) {
159
149
  );
160
150
  const untaintedPrototype = getUntaintedPrototype$1(key);
161
151
  const untaintedMethod = untaintedPrototype[method];
162
- if (typeof untaintedMethod !== "function") return instance[method];
152
+ if (typeof untaintedMethod !== "function")
153
+ return instance[method];
163
154
  untaintedMethodCache$1[cacheKey] = untaintedMethod;
164
155
  return untaintedMethod.bind(instance);
165
156
  }
@@ -182,14 +173,16 @@ function getRootNode$1(n2) {
182
173
  return getUntaintedMethod$1("Node", n2, "getRootNode")();
183
174
  }
184
175
  function host$1(n2) {
185
- if (!n2 || !("host" in n2)) return null;
176
+ if (!n2 || !("host" in n2))
177
+ return null;
186
178
  return getUntaintedAccessor$1("ShadowRoot", n2, "host");
187
179
  }
188
180
  function styleSheets$1(n2) {
189
181
  return n2.styleSheets;
190
182
  }
191
183
  function shadowRoot$1(n2) {
192
- if (!n2 || !("shadowRoot" in n2)) return null;
184
+ if (!n2 || !("shadowRoot" in n2))
185
+ return null;
193
186
  return getUntaintedAccessor$1("Element", n2, "shadowRoot");
194
187
  }
195
188
  function querySelector$1(n2, selectors) {
@@ -307,7 +300,8 @@ function fixBrowserCompatibilityIssuesInCSS(cssText) {
307
300
  }
308
301
  function escapeImportStatement(rule2) {
309
302
  const { cssText } = rule2;
310
- if (cssText.split('"').length < 3) return cssText;
303
+ if (cssText.split('"').length < 3)
304
+ return cssText;
311
305
  const statement = ["@import", \`url(\${JSON.stringify(rule2.href)})\`];
312
306
  if (rule2.layerName === "") {
313
307
  statement.push(\`layer\`);
@@ -384,7 +378,8 @@ class Mirror {
384
378
  }
385
379
  getId(n2) {
386
380
  var _a2;
387
- if (!n2) return -1;
381
+ if (!n2)
382
+ return -1;
388
383
  const id = (_a2 = this.getMeta(n2)) == null ? void 0 : _a2.id;
389
384
  return id != null ? id : -1;
390
385
  }
@@ -423,7 +418,8 @@ class Mirror {
423
418
  const oldNode = this.getNode(id);
424
419
  if (oldNode) {
425
420
  const meta = this.nodeMetaMap.get(oldNode);
426
- if (meta) this.nodeMetaMap.set(n2, meta);
421
+ if (meta)
422
+ this.nodeMetaMap.set(n2, meta);
427
423
  }
428
424
  this.idNodeMap.set(id, n2);
429
425
  }
@@ -460,7 +456,8 @@ function toLowerCase(str) {
460
456
  const ORIGINAL_ATTRIBUTE_NAME = "__rrweb_original__";
461
457
  function is2DCanvasBlank(canvas) {
462
458
  const ctx = canvas.getContext("2d");
463
- if (!ctx) return true;
459
+ if (!ctx)
460
+ return true;
464
461
  const chunkSize = 50;
465
462
  for (let x2 = 0; x2 < canvas.width; x2 += chunkSize) {
466
463
  for (let y = 0; y < canvas.height; y += chunkSize) {
@@ -476,7 +473,8 @@ function is2DCanvasBlank(canvas) {
476
473
  Math.min(chunkSize, canvas.height - y)
477
474
  ).data.buffer
478
475
  );
479
- if (pixelBuffer.some((pixel) => pixel !== 0)) return false;
476
+ if (pixelBuffer.some((pixel) => pixel !== 0))
477
+ return false;
480
478
  }
481
479
  }
482
480
  return true;
@@ -662,7 +660,8 @@ function isSelectorUnique(selector, target) {
662
660
  }
663
661
  }
664
662
  function buildSelector(node2) {
665
- if (!(node2 instanceof Element)) return null;
663
+ if (!(node2 instanceof Element))
664
+ return null;
666
665
  if (node2.id) {
667
666
  return \`#\${CSS.escape(node2.id)}\`;
668
667
  }
@@ -710,11 +709,15 @@ function buildXPath(node2) {
710
709
  if (element.id) {
711
710
  return \`//*[@id="\${CSS.escape(element.id)}"]\`;
712
711
  }
713
- if (element.tagName.toLowerCase() === "html") return "/html";
714
- if (element === document.head) return "/html/head";
715
- if (element === document.body) return "/html/body";
712
+ if (element.tagName.toLowerCase() === "html")
713
+ return "/html";
714
+ if (element === document.head)
715
+ return "/html/head";
716
+ if (element === document.body)
717
+ return "/html/body";
716
718
  const parent = element.parentNode;
717
- if (!parent) return "";
719
+ if (!parent)
720
+ return "";
718
721
  const tag = element.tagName.toLowerCase();
719
722
  const siblings = Array.from(parent.children).filter(
720
723
  (el) => el.tagName.toLowerCase() === tag
@@ -726,7 +729,8 @@ function buildXPath(node2) {
726
729
  case Node.CDATA_SECTION_NODE:
727
730
  case Node.COMMENT_NODE: {
728
731
  const parent = node2.parentNode;
729
- if (!parent) return "";
732
+ if (!parent)
733
+ return "";
730
734
  const typeMap = {
731
735
  [Node.TEXT_NODE]: "text()",
732
736
  [Node.CDATA_SECTION_NODE]: "text()",
@@ -1017,9 +1021,11 @@ function _isBlockedElement(element, blockClass, blockSelector) {
1017
1021
  return false;
1018
1022
  }
1019
1023
  function classMatchesRegex(node2, regex, checkAncestors) {
1020
- if (!node2) return false;
1024
+ if (!node2)
1025
+ return false;
1021
1026
  if (node2.nodeType !== node2.ELEMENT_NODE) {
1022
- if (!checkAncestors) return false;
1027
+ if (!checkAncestors)
1028
+ return false;
1023
1029
  return classMatchesRegex(index$1.parentNode(node2), regex, checkAncestors);
1024
1030
  }
1025
1031
  for (let eIndex = node2.classList.length; eIndex--; ) {
@@ -1028,7 +1034,8 @@ function classMatchesRegex(node2, regex, checkAncestors) {
1028
1034
  return true;
1029
1035
  }
1030
1036
  }
1031
- if (!checkAncestors) return false;
1037
+ if (!checkAncestors)
1038
+ return false;
1032
1039
  return classMatchesRegex(index$1.parentNode(node2), regex, checkAncestors);
1033
1040
  }
1034
1041
  function needMaskingText(node2, maskTextClass, maskTextSelector, checkAncestors) {
@@ -1046,18 +1053,23 @@ function needMaskingText(node2, maskTextClass, maskTextSelector, checkAncestors)
1046
1053
  try {
1047
1054
  if (typeof maskTextClass === "string") {
1048
1055
  if (checkAncestors) {
1049
- if (el.closest(\`.\${maskTextClass}\`)) return true;
1056
+ if (el.closest(\`.\${maskTextClass}\`))
1057
+ return true;
1050
1058
  } else {
1051
- if (el.classList.contains(maskTextClass)) return true;
1059
+ if (el.classList.contains(maskTextClass))
1060
+ return true;
1052
1061
  }
1053
1062
  } else {
1054
- if (classMatchesRegex(el, maskTextClass, checkAncestors)) return true;
1063
+ if (classMatchesRegex(el, maskTextClass, checkAncestors))
1064
+ return true;
1055
1065
  }
1056
1066
  if (maskTextSelector) {
1057
1067
  if (checkAncestors) {
1058
- if (el.closest(maskTextSelector)) return true;
1068
+ if (el.closest(maskTextSelector))
1069
+ return true;
1059
1070
  } else {
1060
- if (el.matches(maskTextSelector)) return true;
1071
+ if (el.matches(maskTextSelector))
1072
+ return true;
1061
1073
  }
1062
1074
  }
1063
1075
  } catch (e2) {
@@ -1105,7 +1117,8 @@ function onceStylesheetLoaded(link, listener, styleSheetLoadTimeout) {
1105
1117
  } catch (error) {
1106
1118
  return;
1107
1119
  }
1108
- if (styleSheetLoaded) return;
1120
+ if (styleSheetLoaded)
1121
+ return;
1109
1122
  const timer = setTimeout(() => {
1110
1123
  if (!fired) {
1111
1124
  listener();
@@ -1202,7 +1215,8 @@ function serializeNode(n2, options) {
1202
1215
  }
1203
1216
  }
1204
1217
  function getRootId(doc, mirror2) {
1205
- if (!mirror2.hasNode(doc)) return void 0;
1218
+ if (!mirror2.hasNode(doc))
1219
+ return void 0;
1206
1220
  const docId = mirror2.getId(doc);
1207
1221
  return docId === 1 ? void 0 : docId;
1208
1222
  }
@@ -1363,7 +1377,8 @@ function serializeElementNode(n2, options) {
1363
1377
  image.crossOrigin = "anonymous";
1364
1378
  if (image.complete && image.naturalWidth !== 0)
1365
1379
  recordInlineImage();
1366
- else image.addEventListener("load", recordInlineImage);
1380
+ else
1381
+ image.addEventListener("load", recordInlineImage);
1367
1382
  return;
1368
1383
  } else {
1369
1384
  console.warn(
@@ -1375,8 +1390,10 @@ function serializeElementNode(n2, options) {
1375
1390
  priorCrossOrigin ? attributes.crossOrigin = priorCrossOrigin : image.removeAttribute("crossorigin");
1376
1391
  }
1377
1392
  };
1378
- if (image.complete && image.naturalWidth !== 0) recordInlineImage();
1379
- else image.addEventListener("load", recordInlineImage);
1393
+ if (image.complete && image.naturalWidth !== 0)
1394
+ recordInlineImage();
1395
+ else
1396
+ image.addEventListener("load", recordInlineImage);
1380
1397
  }
1381
1398
  if (tagName === "audio" || tagName === "video") {
1382
1399
  const mediaAttributes = attributes;
@@ -1411,7 +1428,8 @@ function serializeElementNode(n2, options) {
1411
1428
  }
1412
1429
  let isCustomElement;
1413
1430
  try {
1414
- if (customElements.get(tagName)) isCustomElement = true;
1431
+ if (customElements.get(tagName))
1432
+ isCustomElement = true;
1415
1433
  } catch (e2) {
1416
1434
  }
1417
1435
  return {
@@ -1595,7 +1613,8 @@ function serializeNodeWithId(n2, options) {
1595
1613
  keepIframeSrcFn,
1596
1614
  cssCaptured: false
1597
1615
  };
1598
- if (serializedNode.type === NodeType$3.Element && serializedNode.tagName === "textarea" && serializedNode.attributes.value !== void 0) ;
1616
+ if (serializedNode.type === NodeType$3.Element && serializedNode.tagName === "textarea" && serializedNode.attributes.value !== void 0)
1617
+ ;
1599
1618
  else {
1600
1619
  if (serializedNode.type === NodeType$3.Element && serializedNode.attributes._cssText !== void 0 && typeof serializedNode.attributes._cssText === "string") {
1601
1620
  bypassOptions.cssCaptured = true;
@@ -1800,7 +1819,8 @@ function getDefaultExportFromCjs$1(x2) {
1800
1819
  return x2 && x2.__esModule && Object.prototype.hasOwnProperty.call(x2, "default") ? x2["default"] : x2;
1801
1820
  }
1802
1821
  function getAugmentedNamespace$1(n2) {
1803
- if (n2.__esModule) return n2;
1822
+ if (n2.__esModule)
1823
+ return n2;
1804
1824
  var f2 = n2.default;
1805
1825
  if (typeof f2 == "function") {
1806
1826
  var a2 = function a22() {
@@ -1810,7 +1830,8 @@ function getAugmentedNamespace$1(n2) {
1810
1830
  return f2.apply(this, arguments);
1811
1831
  };
1812
1832
  a2.prototype = f2.prototype;
1813
- } else a2 = {};
1833
+ } else
1834
+ a2 = {};
1814
1835
  Object.defineProperty(a2, "__esModule", { value: true });
1815
1836
  Object.keys(n2).forEach(function(k) {
1816
1837
  var d = Object.getOwnPropertyDescriptor(n2, k);
@@ -1878,11 +1899,14 @@ let CssSyntaxError$3$1 = class CssSyntaxError extends Error {
1878
1899
  this.message += ": " + this.reason;
1879
1900
  }
1880
1901
  showSourceCode(color) {
1881
- if (!this.source) return "";
1902
+ if (!this.source)
1903
+ return "";
1882
1904
  let css = this.source;
1883
- if (color == null) color = pico$1.isColorSupported;
1905
+ if (color == null)
1906
+ color = pico$1.isColorSupported;
1884
1907
  if (terminalHighlight$1$1) {
1885
- if (color) css = terminalHighlight$1$1(css);
1908
+ if (color)
1909
+ css = terminalHighlight$1$1(css);
1886
1910
  }
1887
1911
  let lines = css.split(/\\r?\\n/);
1888
1912
  let start = Math.max(this.line - 3, 0);
@@ -1975,7 +1999,8 @@ let Stringifier$2$1 = class Stringifier {
1975
1999
  if (value.includes("\\n")) {
1976
2000
  let indent = this.raw(node2, null, "indent");
1977
2001
  if (indent.length) {
1978
- for (let step = 0; step < depth; step++) value += indent;
2002
+ for (let step = 0; step < depth; step++)
2003
+ value += indent;
1979
2004
  }
1980
2005
  }
1981
2006
  return value;
@@ -1990,20 +2015,23 @@ let Stringifier$2$1 = class Stringifier {
1990
2015
  } else {
1991
2016
  after = this.raw(node2, "after", "emptyBody");
1992
2017
  }
1993
- if (after) this.builder(after);
2018
+ if (after)
2019
+ this.builder(after);
1994
2020
  this.builder("}", node2, "end");
1995
2021
  }
1996
2022
  body(node2) {
1997
2023
  let last = node2.nodes.length - 1;
1998
2024
  while (last > 0) {
1999
- if (node2.nodes[last].type !== "comment") break;
2025
+ if (node2.nodes[last].type !== "comment")
2026
+ break;
2000
2027
  last -= 1;
2001
2028
  }
2002
2029
  let semicolon = this.raw(node2, "semicolon");
2003
2030
  for (let i2 = 0; i2 < node2.nodes.length; i2++) {
2004
2031
  let child = node2.nodes[i2];
2005
2032
  let before = this.raw(child, "before");
2006
- if (before) this.builder(before);
2033
+ if (before)
2034
+ this.builder(before);
2007
2035
  this.stringify(child, last !== i2 || semicolon);
2008
2036
  }
2009
2037
  }
@@ -2018,7 +2046,8 @@ let Stringifier$2$1 = class Stringifier {
2018
2046
  if (node2.important) {
2019
2047
  string += node2.raws.important || " !important";
2020
2048
  }
2021
- if (semicolon) string += ";";
2049
+ if (semicolon)
2050
+ string += ";";
2022
2051
  this.builder(string, node2);
2023
2052
  }
2024
2053
  document(node2) {
@@ -2026,10 +2055,12 @@ let Stringifier$2$1 = class Stringifier {
2026
2055
  }
2027
2056
  raw(node2, own, detect) {
2028
2057
  let value;
2029
- if (!detect) detect = own;
2058
+ if (!detect)
2059
+ detect = own;
2030
2060
  if (own) {
2031
2061
  value = node2.raws[own];
2032
- if (typeof value !== "undefined") return value;
2062
+ if (typeof value !== "undefined")
2063
+ return value;
2033
2064
  }
2034
2065
  let parent = node2.parent;
2035
2066
  if (detect === "before") {
@@ -2040,9 +2071,11 @@ let Stringifier$2$1 = class Stringifier {
2040
2071
  return "";
2041
2072
  }
2042
2073
  }
2043
- if (!parent) return DEFAULT_RAW$1[detect];
2074
+ if (!parent)
2075
+ return DEFAULT_RAW$1[detect];
2044
2076
  let root2 = node2.root();
2045
- if (!root2.rawCache) root2.rawCache = {};
2077
+ if (!root2.rawCache)
2078
+ root2.rawCache = {};
2046
2079
  if (typeof root2.rawCache[detect] !== "undefined") {
2047
2080
  return root2.rawCache[detect];
2048
2081
  }
@@ -2055,11 +2088,13 @@ let Stringifier$2$1 = class Stringifier {
2055
2088
  } else {
2056
2089
  root2.walk((i2) => {
2057
2090
  value = i2.raws[own];
2058
- if (typeof value !== "undefined") return false;
2091
+ if (typeof value !== "undefined")
2092
+ return false;
2059
2093
  });
2060
2094
  }
2061
2095
  }
2062
- if (typeof value === "undefined") value = DEFAULT_RAW$1[detect];
2096
+ if (typeof value === "undefined")
2097
+ value = DEFAULT_RAW$1[detect];
2063
2098
  root2.rawCache[detect] = value;
2064
2099
  return value;
2065
2100
  }
@@ -2076,7 +2111,8 @@ let Stringifier$2$1 = class Stringifier {
2076
2111
  }
2077
2112
  }
2078
2113
  });
2079
- if (value) value = value.replace(/\\S/g, "");
2114
+ if (value)
2115
+ value = value.replace(/\\S/g, "");
2080
2116
  return value;
2081
2117
  }
2082
2118
  rawBeforeComment(root2, node2) {
@@ -2120,7 +2156,8 @@ let Stringifier$2$1 = class Stringifier {
2120
2156
  root2.walk((i2) => {
2121
2157
  if (i2.type !== "decl") {
2122
2158
  value = i2.raws.between;
2123
- if (typeof value !== "undefined") return false;
2159
+ if (typeof value !== "undefined")
2160
+ return false;
2124
2161
  }
2125
2162
  });
2126
2163
  return value;
@@ -2138,7 +2175,8 @@ let Stringifier$2$1 = class Stringifier {
2138
2175
  }
2139
2176
  }
2140
2177
  });
2141
- if (value) value = value.replace(/\\S/g, "");
2178
+ if (value)
2179
+ value = value.replace(/\\S/g, "");
2142
2180
  return value;
2143
2181
  }
2144
2182
  rawColon(root2) {
@@ -2156,13 +2194,15 @@ let Stringifier$2$1 = class Stringifier {
2156
2194
  root2.walk((i2) => {
2157
2195
  if (i2.nodes && i2.nodes.length === 0) {
2158
2196
  value = i2.raws.after;
2159
- if (typeof value !== "undefined") return false;
2197
+ if (typeof value !== "undefined")
2198
+ return false;
2160
2199
  }
2161
2200
  });
2162
2201
  return value;
2163
2202
  }
2164
2203
  rawIndent(root2) {
2165
- if (root2.raws.indent) return root2.raws.indent;
2204
+ if (root2.raws.indent)
2205
+ return root2.raws.indent;
2166
2206
  let value;
2167
2207
  root2.walk((i2) => {
2168
2208
  let p = i2.parent;
@@ -2182,7 +2222,8 @@ let Stringifier$2$1 = class Stringifier {
2182
2222
  root2.walk((i2) => {
2183
2223
  if (i2.nodes && i2.nodes.length && i2.last.type === "decl") {
2184
2224
  value = i2.raws.semicolon;
2185
- if (typeof value !== "undefined") return false;
2225
+ if (typeof value !== "undefined")
2226
+ return false;
2186
2227
  }
2187
2228
  });
2188
2229
  return value;
@@ -2197,7 +2238,8 @@ let Stringifier$2$1 = class Stringifier {
2197
2238
  }
2198
2239
  root(node2) {
2199
2240
  this.body(node2);
2200
- if (node2.raws.after) this.builder(node2.raws.after);
2241
+ if (node2.raws.after)
2242
+ this.builder(node2.raws.after);
2201
2243
  }
2202
2244
  rule(node2) {
2203
2245
  this.block(node2, this.rawValue(node2, "selector"));
@@ -2233,17 +2275,20 @@ function cloneNode$1(obj, parent) {
2233
2275
  if (!Object.prototype.hasOwnProperty.call(obj, i2)) {
2234
2276
  continue;
2235
2277
  }
2236
- if (i2 === "proxyCache") continue;
2278
+ if (i2 === "proxyCache")
2279
+ continue;
2237
2280
  let value = obj[i2];
2238
2281
  let type = typeof value;
2239
2282
  if (i2 === "parent" && type === "object") {
2240
- if (parent) cloned[i2] = parent;
2283
+ if (parent)
2284
+ cloned[i2] = parent;
2241
2285
  } else if (i2 === "source") {
2242
2286
  cloned[i2] = value;
2243
2287
  } else if (Array.isArray(value)) {
2244
2288
  cloned[i2] = value.map((j) => cloneNode$1(j, cloned));
2245
2289
  } else {
2246
- if (type === "object" && value !== null) value = cloneNode$1(value);
2290
+ if (type === "object" && value !== null)
2291
+ value = cloneNode$1(value);
2247
2292
  cloned[i2] = value;
2248
2293
  }
2249
2294
  }
@@ -2297,7 +2342,8 @@ let Node$5$1 = class Node2 {
2297
2342
  cleanRaws(keepBetween) {
2298
2343
  delete this.raws.before;
2299
2344
  delete this.raws.after;
2300
- if (!keepBetween) delete this.raws.between;
2345
+ if (!keepBetween)
2346
+ delete this.raws.between;
2301
2347
  }
2302
2348
  clone(overrides = {}) {
2303
2349
  let cloned = cloneNode$1(this);
@@ -2340,7 +2386,8 @@ let Node$5$1 = class Node2 {
2340
2386
  }
2341
2387
  },
2342
2388
  set(node2, prop, value) {
2343
- if (node2[prop] === value) return true;
2389
+ if (node2[prop] === value)
2390
+ return true;
2344
2391
  node2[prop] = value;
2345
2392
  if (prop === "prop" || prop === "value" || prop === "name" || prop === "params" || prop === "important" || /* c8 ignore next */
2346
2393
  prop === "text") {
@@ -2360,7 +2407,8 @@ let Node$5$1 = class Node2 {
2360
2407
  }
2361
2408
  }
2362
2409
  next() {
2363
- if (!this.parent) return void 0;
2410
+ if (!this.parent)
2411
+ return void 0;
2364
2412
  let index2 = this.parent.index(this);
2365
2413
  return this.parent.nodes[index2 + 1];
2366
2414
  }
@@ -2371,7 +2419,8 @@ let Node$5$1 = class Node2 {
2371
2419
  } else if (opts.word) {
2372
2420
  stringRepresentation = this.toString();
2373
2421
  let index2 = stringRepresentation.indexOf(opts.word);
2374
- if (index2 !== -1) pos = this.positionInside(index2, stringRepresentation);
2422
+ if (index2 !== -1)
2423
+ pos = this.positionInside(index2, stringRepresentation);
2375
2424
  }
2376
2425
  return pos;
2377
2426
  }
@@ -2390,7 +2439,8 @@ let Node$5$1 = class Node2 {
2390
2439
  return { column, line };
2391
2440
  }
2392
2441
  prev() {
2393
- if (!this.parent) return void 0;
2442
+ if (!this.parent)
2443
+ return void 0;
2394
2444
  let index2 = this.parent.index(this);
2395
2445
  return this.parent.nodes[index2 - 1];
2396
2446
  }
@@ -2485,7 +2535,8 @@ let Node$5$1 = class Node2 {
2485
2535
  if (!Object.prototype.hasOwnProperty.call(this, name)) {
2486
2536
  continue;
2487
2537
  }
2488
- if (name === "parent" || name === "proxyCache") continue;
2538
+ if (name === "parent" || name === "proxyCache")
2539
+ continue;
2489
2540
  let value = this[name];
2490
2541
  if (Array.isArray(value)) {
2491
2542
  fixed[name] = value.map((i2) => {
@@ -2525,7 +2576,8 @@ let Node$5$1 = class Node2 {
2525
2576
  return this.proxyCache;
2526
2577
  }
2527
2578
  toString(stringifier2 = stringify$3$1) {
2528
- if (stringifier2.stringify) stringifier2 = stringifier2.stringify;
2579
+ if (stringifier2.stringify)
2580
+ stringifier2 = stringifier2.stringify;
2529
2581
  let result2 = "";
2530
2582
  stringifier2(this, (i2) => {
2531
2583
  result2 += i2;
@@ -2534,7 +2586,8 @@ let Node$5$1 = class Node2 {
2534
2586
  }
2535
2587
  warn(result2, text, opts) {
2536
2588
  let data = { node: this };
2537
- for (let i2 in opts) data[i2] = opts[i2];
2589
+ for (let i2 in opts)
2590
+ data[i2] = opts[i2];
2538
2591
  return result2.warn(text, data);
2539
2592
  }
2540
2593
  get proxyOf() {
@@ -2590,7 +2643,8 @@ function fromBase64$1(str) {
2590
2643
  }
2591
2644
  let PreviousMap$2$1 = class PreviousMap {
2592
2645
  constructor(css, opts) {
2593
- if (opts.map === false) return;
2646
+ if (opts.map === false)
2647
+ return;
2594
2648
  this.loadAnnotation(css);
2595
2649
  this.inline = this.startWith(this.annotation, "data:");
2596
2650
  let prev = opts.map ? opts.map.prev : void 0;
@@ -2598,8 +2652,10 @@ let PreviousMap$2$1 = class PreviousMap {
2598
2652
  if (!this.mapFile && opts.from) {
2599
2653
  this.mapFile = opts.from;
2600
2654
  }
2601
- if (this.mapFile) this.root = dirname$1$1(this.mapFile);
2602
- if (text) this.text = text;
2655
+ if (this.mapFile)
2656
+ this.root = dirname$1$1(this.mapFile);
2657
+ if (text)
2658
+ this.text = text;
2603
2659
  }
2604
2660
  consumer() {
2605
2661
  if (!this.consumerCache) {
@@ -2625,12 +2681,14 @@ let PreviousMap$2$1 = class PreviousMap {
2625
2681
  return sourceMapString.replace(/^\\/\\*\\s*# sourceMappingURL=/, "").trim();
2626
2682
  }
2627
2683
  isMap(map) {
2628
- if (typeof map !== "object") return false;
2684
+ if (typeof map !== "object")
2685
+ return false;
2629
2686
  return typeof map.mappings === "string" || typeof map._mappings === "string" || Array.isArray(map.sections);
2630
2687
  }
2631
2688
  loadAnnotation(css) {
2632
2689
  let comments = css.match(/\\/\\*\\s*# sourceMappingURL=/gm);
2633
- if (!comments) return;
2690
+ if (!comments)
2691
+ return;
2634
2692
  let start = css.lastIndexOf(comments.pop());
2635
2693
  let end = css.indexOf("*/", start);
2636
2694
  if (start > -1 && end > -1) {
@@ -2645,7 +2703,8 @@ let PreviousMap$2$1 = class PreviousMap {
2645
2703
  }
2646
2704
  }
2647
2705
  loadMap(file, prev) {
2648
- if (prev === false) return false;
2706
+ if (prev === false)
2707
+ return false;
2649
2708
  if (prev) {
2650
2709
  if (typeof prev === "string") {
2651
2710
  return prev;
@@ -2675,12 +2734,14 @@ let PreviousMap$2$1 = class PreviousMap {
2675
2734
  return this.decodeInline(this.annotation);
2676
2735
  } else if (this.annotation) {
2677
2736
  let map = this.annotation;
2678
- if (file) map = join$1(dirname$1$1(file), map);
2737
+ if (file)
2738
+ map = join$1(dirname$1$1(file), map);
2679
2739
  return this.loadFile(map);
2680
2740
  }
2681
2741
  }
2682
2742
  startWith(string, start) {
2683
- if (!string) return false;
2743
+ if (!string)
2744
+ return false;
2684
2745
  return string.substr(0, start.length) === start;
2685
2746
  }
2686
2747
  withContent() {
@@ -2723,13 +2784,15 @@ let Input$4$1 = class Input {
2723
2784
  if (map.text) {
2724
2785
  this.map = map;
2725
2786
  let file = map.consumer().file;
2726
- if (!this.file && file) this.file = this.mapResolve(file);
2787
+ if (!this.file && file)
2788
+ this.file = this.mapResolve(file);
2727
2789
  }
2728
2790
  }
2729
2791
  if (!this.file) {
2730
2792
  this.id = "<input css " + nanoid$2(6) + ">";
2731
2793
  }
2732
- if (this.map) this.map.file = this.from;
2794
+ if (this.map)
2795
+ this.map.file = this.from;
2733
2796
  }
2734
2797
  error(message, line, column, opts = {}) {
2735
2798
  let result2, endLine, endColumn;
@@ -2831,10 +2894,12 @@ let Input$4$1 = class Input {
2831
2894
  return resolve$1$1(this.map.consumer().sourceRoot || this.map.root || ".", file);
2832
2895
  }
2833
2896
  origin(line, column, endLine, endColumn) {
2834
- if (!this.map) return false;
2897
+ if (!this.map)
2898
+ return false;
2835
2899
  let consumer = this.map.consumer();
2836
2900
  let from = consumer.originalPositionFor({ column, line });
2837
- if (!from.source) return false;
2901
+ if (!from.source)
2902
+ return false;
2838
2903
  let to;
2839
2904
  if (typeof endLine === "number") {
2840
2905
  to = consumer.originalPositionFor({ column: endColumn, line: endLine });
@@ -2863,7 +2928,8 @@ let Input$4$1 = class Input {
2863
2928
  }
2864
2929
  }
2865
2930
  let source = consumer.sourceContentFor(from.source);
2866
- if (source) result2.source = source;
2931
+ if (source)
2932
+ result2.source = source;
2867
2933
  return result2;
2868
2934
  }
2869
2935
  toJSON() {
@@ -2921,7 +2987,8 @@ let MapGenerator$2$1 = class MapGenerator {
2921
2987
  content = this.outputFile() + ".map";
2922
2988
  }
2923
2989
  let eol = "\\n";
2924
- if (this.css.includes("\\r\\n")) eol = "\\r\\n";
2990
+ if (this.css.includes("\\r\\n"))
2991
+ eol = "\\r\\n";
2925
2992
  this.css += eol + "/*# sourceMappingURL=" + content + " */";
2926
2993
  }
2927
2994
  applyPrevMaps() {
@@ -2941,12 +3008,14 @@ let MapGenerator$2$1 = class MapGenerator {
2941
3008
  }
2942
3009
  }
2943
3010
  clearAnnotation() {
2944
- if (this.mapOpts.annotation === false) return;
3011
+ if (this.mapOpts.annotation === false)
3012
+ return;
2945
3013
  if (this.root) {
2946
3014
  let node2;
2947
3015
  for (let i2 = this.root.nodes.length - 1; i2 >= 0; i2--) {
2948
3016
  node2 = this.root.nodes[i2];
2949
- if (node2.type !== "comment") continue;
3017
+ if (node2.type !== "comment")
3018
+ continue;
2950
3019
  if (node2.text.indexOf("# sourceMappingURL=") === 0) {
2951
3020
  this.root.removeChild(i2);
2952
3021
  }
@@ -2987,9 +3056,12 @@ let MapGenerator$2$1 = class MapGenerator {
2987
3056
  source: this.opts.from ? this.toUrl(this.path(this.opts.from)) : "<no source>"
2988
3057
  });
2989
3058
  }
2990
- if (this.isSourcesContent()) this.setSourcesContent();
2991
- if (this.root && this.previous().length > 0) this.applyPrevMaps();
2992
- if (this.isAnnotation()) this.addAnnotation();
3059
+ if (this.isSourcesContent())
3060
+ this.setSourcesContent();
3061
+ if (this.root && this.previous().length > 0)
3062
+ this.applyPrevMaps();
3063
+ if (this.isAnnotation())
3064
+ this.addAnnotation();
2993
3065
  if (this.isInline()) {
2994
3066
  return [this.css];
2995
3067
  } else {
@@ -3109,11 +3181,15 @@ let MapGenerator$2$1 = class MapGenerator {
3109
3181
  }
3110
3182
  }
3111
3183
  path(file) {
3112
- if (this.mapOpts.absolute) return file;
3113
- if (file.charCodeAt(0) === 60) return file;
3114
- if (/^\\w+:\\/\\//.test(file)) return file;
3184
+ if (this.mapOpts.absolute)
3185
+ return file;
3186
+ if (file.charCodeAt(0) === 60)
3187
+ return file;
3188
+ if (/^\\w+:\\/\\//.test(file))
3189
+ return file;
3115
3190
  let cached = this.memoizedPaths.get(file);
3116
- if (cached) return cached;
3191
+ if (cached)
3192
+ return cached;
3117
3193
  let from = this.opts.to ? dirname$2(this.opts.to) : ".";
3118
3194
  if (typeof this.mapOpts.annotation === "string") {
3119
3195
  from = dirname$2(resolve$2(from, this.mapOpts.annotation));
@@ -3136,7 +3212,8 @@ let MapGenerator$2$1 = class MapGenerator {
3136
3212
  });
3137
3213
  } else {
3138
3214
  let input2 = new Input$3$1(this.originalCSS, this.opts);
3139
- if (input2.map) this.previousMaps.push(input2.map);
3215
+ if (input2.map)
3216
+ this.previousMaps.push(input2.map);
3140
3217
  }
3141
3218
  }
3142
3219
  return this.previousMaps;
@@ -3177,7 +3254,8 @@ let MapGenerator$2$1 = class MapGenerator {
3177
3254
  }
3178
3255
  toFileUrl(path) {
3179
3256
  let cached = this.memoizedFileURLs.get(path);
3180
- if (cached) return cached;
3257
+ if (cached)
3258
+ return cached;
3181
3259
  if (pathToFileURL$2) {
3182
3260
  let fileURL = pathToFileURL$2(path).toString();
3183
3261
  this.memoizedFileURLs.set(path, fileURL);
@@ -3190,7 +3268,8 @@ let MapGenerator$2$1 = class MapGenerator {
3190
3268
  }
3191
3269
  toUrl(path) {
3192
3270
  let cached = this.memoizedURLs.get(path);
3193
- if (cached) return cached;
3271
+ if (cached)
3272
+ return cached;
3194
3273
  if (sep$1 === "\\\\") {
3195
3274
  path = path.replace(/\\\\/g, "/");
3196
3275
  }
@@ -3219,7 +3298,8 @@ let AtRule$4$1;
3219
3298
  let Root$6$1;
3220
3299
  function cleanSource$1(nodes) {
3221
3300
  return nodes.map((i2) => {
3222
- if (i2.nodes) i2.nodes = cleanSource$1(i2.nodes);
3301
+ if (i2.nodes)
3302
+ i2.nodes = cleanSource$1(i2.nodes);
3223
3303
  delete i2.source;
3224
3304
  return i2;
3225
3305
  });
@@ -3236,7 +3316,8 @@ let Container$7$1 = class Container extends Node$2$1 {
3236
3316
  append(...children) {
3237
3317
  for (let child of children) {
3238
3318
  let nodes = this.normalize(child, this.last);
3239
- for (let node2 of nodes) this.proxyOf.nodes.push(node2);
3319
+ for (let node2 of nodes)
3320
+ this.proxyOf.nodes.push(node2);
3240
3321
  }
3241
3322
  this.markDirty();
3242
3323
  return this;
@@ -3244,17 +3325,20 @@ let Container$7$1 = class Container extends Node$2$1 {
3244
3325
  cleanRaws(keepBetween) {
3245
3326
  super.cleanRaws(keepBetween);
3246
3327
  if (this.nodes) {
3247
- for (let node2 of this.nodes) node2.cleanRaws(keepBetween);
3328
+ for (let node2 of this.nodes)
3329
+ node2.cleanRaws(keepBetween);
3248
3330
  }
3249
3331
  }
3250
3332
  each(callback) {
3251
- if (!this.proxyOf.nodes) return void 0;
3333
+ if (!this.proxyOf.nodes)
3334
+ return void 0;
3252
3335
  let iterator = this.getIterator();
3253
3336
  let index2, result2;
3254
3337
  while (this.indexes[iterator] < this.proxyOf.nodes.length) {
3255
3338
  index2 = this.indexes[iterator];
3256
3339
  result2 = callback(this.proxyOf.nodes[index2], index2);
3257
- if (result2 === false) break;
3340
+ if (result2 === false)
3341
+ break;
3258
3342
  this.indexes[iterator] += 1;
3259
3343
  }
3260
3344
  delete this.indexes[iterator];
@@ -3264,8 +3348,10 @@ let Container$7$1 = class Container extends Node$2$1 {
3264
3348
  return this.nodes.every(condition);
3265
3349
  }
3266
3350
  getIterator() {
3267
- if (!this.lastEach) this.lastEach = 0;
3268
- if (!this.indexes) this.indexes = {};
3351
+ if (!this.lastEach)
3352
+ this.lastEach = 0;
3353
+ if (!this.indexes)
3354
+ this.indexes = {};
3269
3355
  this.lastEach += 1;
3270
3356
  let iterator = this.lastEach;
3271
3357
  this.indexes[iterator] = 0;
@@ -3307,7 +3393,8 @@ let Container$7$1 = class Container extends Node$2$1 {
3307
3393
  }
3308
3394
  },
3309
3395
  set(node2, prop, value) {
3310
- if (node2[prop] === value) return true;
3396
+ if (node2[prop] === value)
3397
+ return true;
3311
3398
  node2[prop] = value;
3312
3399
  if (prop === "name" || prop === "params" || prop === "selector") {
3313
3400
  node2.markDirty();
@@ -3317,15 +3404,18 @@ let Container$7$1 = class Container extends Node$2$1 {
3317
3404
  };
3318
3405
  }
3319
3406
  index(child) {
3320
- if (typeof child === "number") return child;
3321
- if (child.proxyOf) child = child.proxyOf;
3407
+ if (typeof child === "number")
3408
+ return child;
3409
+ if (child.proxyOf)
3410
+ child = child.proxyOf;
3322
3411
  return this.proxyOf.nodes.indexOf(child);
3323
3412
  }
3324
3413
  insertAfter(exist, add) {
3325
3414
  let existIndex = this.index(exist);
3326
3415
  let nodes = this.normalize(add, this.proxyOf.nodes[existIndex]).reverse();
3327
3416
  existIndex = this.index(exist);
3328
- for (let node2 of nodes) this.proxyOf.nodes.splice(existIndex + 1, 0, node2);
3417
+ for (let node2 of nodes)
3418
+ this.proxyOf.nodes.splice(existIndex + 1, 0, node2);
3329
3419
  let index2;
3330
3420
  for (let id in this.indexes) {
3331
3421
  index2 = this.indexes[id];
@@ -3341,7 +3431,8 @@ let Container$7$1 = class Container extends Node$2$1 {
3341
3431
  let type = existIndex === 0 ? "prepend" : false;
3342
3432
  let nodes = this.normalize(add, this.proxyOf.nodes[existIndex], type).reverse();
3343
3433
  existIndex = this.index(exist);
3344
- for (let node2 of nodes) this.proxyOf.nodes.splice(existIndex, 0, node2);
3434
+ for (let node2 of nodes)
3435
+ this.proxyOf.nodes.splice(existIndex, 0, node2);
3345
3436
  let index2;
3346
3437
  for (let id in this.indexes) {
3347
3438
  index2 = this.indexes[id];
@@ -3360,12 +3451,14 @@ let Container$7$1 = class Container extends Node$2$1 {
3360
3451
  } else if (Array.isArray(nodes)) {
3361
3452
  nodes = nodes.slice(0);
3362
3453
  for (let i2 of nodes) {
3363
- if (i2.parent) i2.parent.removeChild(i2, "ignore");
3454
+ if (i2.parent)
3455
+ i2.parent.removeChild(i2, "ignore");
3364
3456
  }
3365
3457
  } else if (nodes.type === "root" && this.type !== "document") {
3366
3458
  nodes = nodes.nodes.slice(0);
3367
3459
  for (let i2 of nodes) {
3368
- if (i2.parent) i2.parent.removeChild(i2, "ignore");
3460
+ if (i2.parent)
3461
+ i2.parent.removeChild(i2, "ignore");
3369
3462
  }
3370
3463
  } else if (nodes.type) {
3371
3464
  nodes = [nodes];
@@ -3386,10 +3479,13 @@ let Container$7$1 = class Container extends Node$2$1 {
3386
3479
  throw new Error("Unknown node type in node creation");
3387
3480
  }
3388
3481
  let processed = nodes.map((i2) => {
3389
- if (!i2[my$1$1]) Container.rebuild(i2);
3482
+ if (!i2[my$1$1])
3483
+ Container.rebuild(i2);
3390
3484
  i2 = i2.proxyOf;
3391
- if (i2.parent) i2.parent.removeChild(i2);
3392
- if (i2[isClean$1$1]) markDirtyUp$1(i2);
3485
+ if (i2.parent)
3486
+ i2.parent.removeChild(i2);
3487
+ if (i2[isClean$1$1])
3488
+ markDirtyUp$1(i2);
3393
3489
  if (typeof i2.raws.before === "undefined") {
3394
3490
  if (sample && typeof sample.raws.before !== "undefined") {
3395
3491
  i2.raws.before = sample.raws.before.replace(/\\S/g, "");
@@ -3404,7 +3500,8 @@ let Container$7$1 = class Container extends Node$2$1 {
3404
3500
  children = children.reverse();
3405
3501
  for (let child of children) {
3406
3502
  let nodes = this.normalize(child, this.first, "prepend").reverse();
3407
- for (let node2 of nodes) this.proxyOf.nodes.unshift(node2);
3503
+ for (let node2 of nodes)
3504
+ this.proxyOf.nodes.unshift(node2);
3408
3505
  for (let id in this.indexes) {
3409
3506
  this.indexes[id] = this.indexes[id] + nodes.length;
3410
3507
  }
@@ -3418,7 +3515,8 @@ let Container$7$1 = class Container extends Node$2$1 {
3418
3515
  return this;
3419
3516
  }
3420
3517
  removeAll() {
3421
- for (let node2 of this.proxyOf.nodes) node2.parent = void 0;
3518
+ for (let node2 of this.proxyOf.nodes)
3519
+ node2.parent = void 0;
3422
3520
  this.proxyOf.nodes = [];
3423
3521
  this.markDirty();
3424
3522
  return this;
@@ -3443,8 +3541,10 @@ let Container$7$1 = class Container extends Node$2$1 {
3443
3541
  opts = {};
3444
3542
  }
3445
3543
  this.walkDecls((decl) => {
3446
- if (opts.props && !opts.props.includes(decl.prop)) return;
3447
- if (opts.fast && !decl.value.includes(opts.fast)) return;
3544
+ if (opts.props && !opts.props.includes(decl.prop))
3545
+ return;
3546
+ if (opts.fast && !decl.value.includes(opts.fast))
3547
+ return;
3448
3548
  decl.value = decl.value.replace(pattern, callback);
3449
3549
  });
3450
3550
  this.markDirty();
@@ -3541,11 +3641,13 @@ let Container$7$1 = class Container extends Node$2$1 {
3541
3641
  });
3542
3642
  }
3543
3643
  get first() {
3544
- if (!this.proxyOf.nodes) return void 0;
3644
+ if (!this.proxyOf.nodes)
3645
+ return void 0;
3545
3646
  return this.proxyOf.nodes[0];
3546
3647
  }
3547
3648
  get last() {
3548
- if (!this.proxyOf.nodes) return void 0;
3649
+ if (!this.proxyOf.nodes)
3650
+ return void 0;
3549
3651
  return this.proxyOf.nodes[this.proxyOf.nodes.length - 1];
3550
3652
  }
3551
3653
  };
@@ -3607,7 +3709,8 @@ var document$1$1 = Document$3$1;
3607
3709
  Document$3$1.default = Document$3$1;
3608
3710
  let printed$1 = {};
3609
3711
  var warnOnce$2$1 = function warnOnce(message) {
3610
- if (printed$1[message]) return;
3712
+ if (printed$1[message])
3713
+ return;
3611
3714
  printed$1[message] = true;
3612
3715
  if (typeof console !== "undefined" && console.warn) {
3613
3716
  console.warn(message);
@@ -3624,7 +3727,8 @@ let Warning$2$1 = class Warning {
3624
3727
  this.endLine = range.end.line;
3625
3728
  this.endColumn = range.end.column;
3626
3729
  }
3627
- for (let opt in opts) this[opt] = opts[opt];
3730
+ for (let opt in opts)
3731
+ this[opt] = opts[opt];
3628
3732
  }
3629
3733
  toString() {
3630
3734
  if (this.node) {
@@ -3716,8 +3820,10 @@ var tokenize$1 = function tokenizer(input2, options = {}) {
3716
3820
  return returned.length === 0 && pos >= length;
3717
3821
  }
3718
3822
  function nextToken(opts) {
3719
- if (returned.length) return returned.pop();
3720
- if (pos >= length) return;
3823
+ if (returned.length)
3824
+ return returned.pop();
3825
+ if (pos >= length)
3826
+ return;
3721
3827
  let ignoreUnclosed = opts ? opts.ignoreUnclosed : false;
3722
3828
  code = css.charCodeAt(pos);
3723
3829
  switch (code) {
@@ -3889,11 +3995,13 @@ let AtRule$3$1 = class AtRule extends Container$5$1 {
3889
3995
  this.type = "atrule";
3890
3996
  }
3891
3997
  append(...children) {
3892
- if (!this.proxyOf.nodes) this.nodes = [];
3998
+ if (!this.proxyOf.nodes)
3999
+ this.nodes = [];
3893
4000
  return super.append(...children);
3894
4001
  }
3895
4002
  prepend(...children) {
3896
- if (!this.proxyOf.nodes) this.nodes = [];
4003
+ if (!this.proxyOf.nodes)
4004
+ this.nodes = [];
3897
4005
  return super.prepend(...children);
3898
4006
  }
3899
4007
  };
@@ -3907,7 +4015,8 @@ let Root$5$1 = class Root extends Container$4$1 {
3907
4015
  constructor(defaults) {
3908
4016
  super(defaults);
3909
4017
  this.type = "root";
3910
- if (!this.nodes) this.nodes = [];
4018
+ if (!this.nodes)
4019
+ this.nodes = [];
3911
4020
  }
3912
4021
  normalize(child, sample, type) {
3913
4022
  let nodes = super.normalize(child);
@@ -3978,19 +4087,23 @@ let list$2$1 = {
3978
4087
  } else if (letter === "(") {
3979
4088
  func += 1;
3980
4089
  } else if (letter === ")") {
3981
- if (func > 0) func -= 1;
4090
+ if (func > 0)
4091
+ func -= 1;
3982
4092
  } else if (func === 0) {
3983
- if (separators.includes(letter)) split = true;
4093
+ if (separators.includes(letter))
4094
+ split = true;
3984
4095
  }
3985
4096
  if (split) {
3986
- if (current !== "") array.push(current.trim());
4097
+ if (current !== "")
4098
+ array.push(current.trim());
3987
4099
  current = "";
3988
4100
  split = false;
3989
4101
  } else {
3990
4102
  current += letter;
3991
4103
  }
3992
4104
  }
3993
- if (last || current !== "") array.push(current.trim());
4105
+ if (last || current !== "")
4106
+ array.push(current.trim());
3994
4107
  return array;
3995
4108
  }
3996
4109
  };
@@ -4002,7 +4115,8 @@ let Rule$3$1 = class Rule extends Container$3$1 {
4002
4115
  constructor(defaults) {
4003
4116
  super(defaults);
4004
4117
  this.type = "rule";
4005
- if (!this.nodes) this.nodes = [];
4118
+ if (!this.nodes)
4119
+ this.nodes = [];
4006
4120
  }
4007
4121
  get selectors() {
4008
4122
  return list$1$1.comma(this.selector);
@@ -4030,7 +4144,8 @@ function findLastWithPosition$1(tokens) {
4030
4144
  for (let i2 = tokens.length - 1; i2 >= 0; i2--) {
4031
4145
  let token = tokens[i2];
4032
4146
  let pos = token[3] || token[2];
4033
- if (pos) return pos;
4147
+ if (pos)
4148
+ return pos;
4034
4149
  }
4035
4150
  }
4036
4151
  let Parser$1$1 = class Parser {
@@ -4123,14 +4238,16 @@ let Parser$1$1 = class Parser {
4123
4238
  }
4124
4239
  checkMissedSemicolon(tokens) {
4125
4240
  let colon = this.colon(tokens);
4126
- if (colon === false) return;
4241
+ if (colon === false)
4242
+ return;
4127
4243
  let founded = 0;
4128
4244
  let token;
4129
4245
  for (let j = colon - 1; j >= 0; j--) {
4130
4246
  token = tokens[j];
4131
4247
  if (token[0] !== "space") {
4132
4248
  founded += 1;
4133
- if (founded === 2) break;
4249
+ if (founded === 2)
4250
+ break;
4134
4251
  }
4135
4252
  }
4136
4253
  throw this.input.error(
@@ -4196,7 +4313,8 @@ let Parser$1$1 = class Parser {
4196
4313
  );
4197
4314
  node2.source.end.offset++;
4198
4315
  while (tokens[0][0] !== "word") {
4199
- if (tokens.length === 1) this.unknownWord(tokens);
4316
+ if (tokens.length === 1)
4317
+ this.unknownWord(tokens);
4200
4318
  node2.raws.before += tokens.shift()[1];
4201
4319
  }
4202
4320
  node2.source.start = this.getPosition(tokens[0][2]);
@@ -4230,7 +4348,8 @@ let Parser$1$1 = class Parser {
4230
4348
  let next;
4231
4349
  while (tokens.length) {
4232
4350
  next = tokens[0][0];
4233
- if (next !== "space" && next !== "comment") break;
4351
+ if (next !== "space" && next !== "comment")
4352
+ break;
4234
4353
  firstSpaces.push(tokens.shift());
4235
4354
  }
4236
4355
  this.precheckMissedSemicolon(tokens);
@@ -4240,7 +4359,8 @@ let Parser$1$1 = class Parser {
4240
4359
  node2.important = true;
4241
4360
  let string = this.stringFrom(tokens, i2);
4242
4361
  string = this.spacesFromEnd(tokens) + string;
4243
- if (string !== " !important") node2.raws.important = string;
4362
+ if (string !== " !important")
4363
+ node2.raws.important = string;
4244
4364
  break;
4245
4365
  } else if (token[1].toLowerCase() === "important") {
4246
4366
  let cache = tokens.slice(0);
@@ -4302,7 +4422,8 @@ let Parser$1$1 = class Parser {
4302
4422
  }
4303
4423
  }
4304
4424
  endFile() {
4305
- if (this.current.parent) this.unclosedBlock();
4425
+ if (this.current.parent)
4426
+ this.unclosedBlock();
4306
4427
  if (this.current.nodes && this.current.nodes.length) {
4307
4428
  this.current.raws.semicolon = this.semicolon;
4308
4429
  }
@@ -4336,7 +4457,8 @@ let Parser$1$1 = class Parser {
4336
4457
  };
4337
4458
  node2.raws.before = this.spaces;
4338
4459
  this.spaces = "";
4339
- if (node2.type !== "comment") this.semicolon = false;
4460
+ if (node2.type !== "comment")
4461
+ this.semicolon = false;
4340
4462
  }
4341
4463
  other(start) {
4342
4464
  let end = false;
@@ -4351,10 +4473,12 @@ let Parser$1$1 = class Parser {
4351
4473
  type = token[0];
4352
4474
  tokens.push(token);
4353
4475
  if (type === "(" || type === "[") {
4354
- if (!bracket) bracket = token;
4476
+ if (!bracket)
4477
+ bracket = token;
4355
4478
  brackets.push(type === "(" ? ")" : "]");
4356
4479
  } else if (customProperty && colon && type === "{") {
4357
- if (!bracket) bracket = token;
4480
+ if (!bracket)
4481
+ bracket = token;
4358
4482
  brackets.push("}");
4359
4483
  } else if (brackets.length === 0) {
4360
4484
  if (type === ";") {
@@ -4376,17 +4500,21 @@ let Parser$1$1 = class Parser {
4376
4500
  }
4377
4501
  } else if (type === brackets[brackets.length - 1]) {
4378
4502
  brackets.pop();
4379
- if (brackets.length === 0) bracket = null;
4503
+ if (brackets.length === 0)
4504
+ bracket = null;
4380
4505
  }
4381
4506
  token = this.tokenizer.nextToken();
4382
4507
  }
4383
- if (this.tokenizer.endOfFile()) end = true;
4384
- if (brackets.length > 0) this.unclosedBracket(bracket);
4508
+ if (this.tokenizer.endOfFile())
4509
+ end = true;
4510
+ if (brackets.length > 0)
4511
+ this.unclosedBracket(bracket);
4385
4512
  if (end && colon) {
4386
4513
  if (!customProperty) {
4387
4514
  while (tokens.length) {
4388
4515
  token = tokens[tokens.length - 1][0];
4389
- if (token !== "space" && token !== "comment") break;
4516
+ if (token !== "space" && token !== "comment")
4517
+ break;
4390
4518
  this.tokenizer.back(tokens.pop());
4391
4519
  }
4392
4520
  }
@@ -4473,7 +4601,8 @@ let Parser$1$1 = class Parser {
4473
4601
  let spaces = "";
4474
4602
  while (tokens.length) {
4475
4603
  lastTokenType = tokens[tokens.length - 1][0];
4476
- if (lastTokenType !== "space" && lastTokenType !== "comment") break;
4604
+ if (lastTokenType !== "space" && lastTokenType !== "comment")
4605
+ break;
4477
4606
  spaces = tokens.pop()[1] + spaces;
4478
4607
  }
4479
4608
  return spaces;
@@ -4484,7 +4613,8 @@ let Parser$1$1 = class Parser {
4484
4613
  let spaces = "";
4485
4614
  while (tokens.length) {
4486
4615
  next = tokens[0][0];
4487
- if (next !== "space" && next !== "comment") break;
4616
+ if (next !== "space" && next !== "comment")
4617
+ break;
4488
4618
  spaces += tokens.shift()[1];
4489
4619
  }
4490
4620
  return spaces;
@@ -4494,7 +4624,8 @@ let Parser$1$1 = class Parser {
4494
4624
  let spaces = "";
4495
4625
  while (tokens.length) {
4496
4626
  lastTokenType = tokens[tokens.length - 1][0];
4497
- if (lastTokenType !== "space") break;
4627
+ if (lastTokenType !== "space")
4628
+ break;
4498
4629
  spaces = tokens.pop()[1] + spaces;
4499
4630
  }
4500
4631
  return spaces;
@@ -4656,7 +4787,8 @@ function toStack$1(node2) {
4656
4787
  }
4657
4788
  function cleanMarks$1(node2) {
4658
4789
  node2[isClean$3] = false;
4659
- if (node2.nodes) node2.nodes.forEach((i2) => cleanMarks$1(i2));
4790
+ if (node2.nodes)
4791
+ node2.nodes.forEach((i2) => cleanMarks$1(i2));
4660
4792
  return node2;
4661
4793
  }
4662
4794
  let postcss$2$1 = {};
@@ -4670,15 +4802,20 @@ let LazyResult$2$1 = class LazyResult {
4670
4802
  } else if (css instanceof LazyResult || css instanceof Result$2$1) {
4671
4803
  root2 = cleanMarks$1(css.root);
4672
4804
  if (css.map) {
4673
- if (typeof opts.map === "undefined") opts.map = {};
4674
- if (!opts.map.inline) opts.map.inline = false;
4805
+ if (typeof opts.map === "undefined")
4806
+ opts.map = {};
4807
+ if (!opts.map.inline)
4808
+ opts.map.inline = false;
4675
4809
  opts.map.prev = css.map;
4676
4810
  }
4677
4811
  } else {
4678
4812
  let parser2 = parse$2$1;
4679
- if (opts.syntax) parser2 = opts.syntax.parse;
4680
- if (opts.parser) parser2 = opts.parser;
4681
- if (parser2.parse) parser2 = parser2.parse;
4813
+ if (opts.syntax)
4814
+ parser2 = opts.syntax.parse;
4815
+ if (opts.parser)
4816
+ parser2 = opts.parser;
4817
+ if (parser2.parse)
4818
+ parser2 = parser2.parse;
4682
4819
  try {
4683
4820
  root2 = parser2(css, opts);
4684
4821
  } catch (error) {
@@ -4700,8 +4837,10 @@ let LazyResult$2$1 = class LazyResult {
4700
4837
  });
4701
4838
  }
4702
4839
  async() {
4703
- if (this.error) return Promise.reject(this.error);
4704
- if (this.processed) return Promise.resolve(this.result);
4840
+ if (this.error)
4841
+ return Promise.reject(this.error);
4842
+ if (this.processed)
4843
+ return Promise.resolve(this.result);
4705
4844
  if (!this.processing) {
4706
4845
  this.processing = this.runAsync();
4707
4846
  }
@@ -4719,7 +4858,8 @@ let LazyResult$2$1 = class LazyResult {
4719
4858
  handleError(error, node2) {
4720
4859
  let plugin22 = this.result.lastPlugin;
4721
4860
  try {
4722
- if (node2) node2.addToError(error);
4861
+ if (node2)
4862
+ node2.addToError(error);
4723
4863
  this.error = error;
4724
4864
  if (error.name === "CssSyntaxError" && !error.plugin) {
4725
4865
  error.plugin = plugin22.postcssPlugin;
@@ -4739,14 +4879,16 @@ let LazyResult$2$1 = class LazyResult {
4739
4879
  }
4740
4880
  }
4741
4881
  } catch (err) {
4742
- if (console && console.error) console.error(err);
4882
+ if (console && console.error)
4883
+ console.error(err);
4743
4884
  }
4744
4885
  return error;
4745
4886
  }
4746
4887
  prepareVisitors() {
4747
4888
  this.listeners = {};
4748
4889
  let add = (plugin22, type, cb) => {
4749
- if (!this.listeners[type]) this.listeners[type] = [];
4890
+ if (!this.listeners[type])
4891
+ this.listeners[type] = [];
4750
4892
  this.listeners[type].push([plugin22, cb]);
4751
4893
  };
4752
4894
  for (let plugin22 of this.plugins) {
@@ -4853,15 +4995,20 @@ let LazyResult$2$1 = class LazyResult {
4853
4995
  }
4854
4996
  }
4855
4997
  stringify() {
4856
- if (this.error) throw this.error;
4857
- if (this.stringified) return this.result;
4998
+ if (this.error)
4999
+ throw this.error;
5000
+ if (this.stringified)
5001
+ return this.result;
4858
5002
  this.stringified = true;
4859
5003
  this.sync();
4860
5004
  let opts = this.result.opts;
4861
5005
  let str = stringify$2$1;
4862
- if (opts.syntax) str = opts.syntax.stringify;
4863
- if (opts.stringifier) str = opts.stringifier;
4864
- if (str.stringify) str = str.stringify;
5006
+ if (opts.syntax)
5007
+ str = opts.syntax.stringify;
5008
+ if (opts.stringifier)
5009
+ str = opts.stringifier;
5010
+ if (str.stringify)
5011
+ str = str.stringify;
4865
5012
  let map = new MapGenerator$1$1(str, this.result.root, this.result.opts);
4866
5013
  let data = map.generate();
4867
5014
  this.result.css = data[0];
@@ -4869,8 +5016,10 @@ let LazyResult$2$1 = class LazyResult {
4869
5016
  return this.result;
4870
5017
  }
4871
5018
  sync() {
4872
- if (this.error) throw this.error;
4873
- if (this.processed) return this.result;
5019
+ if (this.error)
5020
+ throw this.error;
5021
+ if (this.processed)
5022
+ return this.result;
4874
5023
  this.processed = true;
4875
5024
  if (this.processing) {
4876
5025
  throw this.getAsyncError();
@@ -4989,13 +5138,15 @@ let LazyResult$2$1 = class LazyResult {
4989
5138
  if (event === CHILDREN$1) {
4990
5139
  if (node2.nodes) {
4991
5140
  node2.each((child) => {
4992
- if (!child[isClean$3]) this.walkSync(child);
5141
+ if (!child[isClean$3])
5142
+ this.walkSync(child);
4993
5143
  });
4994
5144
  }
4995
5145
  } else {
4996
5146
  let visitors = this.listeners[event];
4997
5147
  if (visitors) {
4998
- if (this.visitSync(visitors, node2.toProxy())) return;
5148
+ if (this.visitSync(visitors, node2.toProxy()))
5149
+ return;
4999
5150
  }
5000
5151
  }
5001
5152
  }
@@ -5073,7 +5224,8 @@ let NoWorkResult$1$1 = class NoWorkResult {
5073
5224
  }
5074
5225
  }
5075
5226
  async() {
5076
- if (this.error) return Promise.reject(this.error);
5227
+ if (this.error)
5228
+ return Promise.reject(this.error);
5077
5229
  return Promise.resolve(this.result);
5078
5230
  }
5079
5231
  catch(onRejected) {
@@ -5083,7 +5235,8 @@ let NoWorkResult$1$1 = class NoWorkResult {
5083
5235
  return this.async().then(onFinally, onFinally);
5084
5236
  }
5085
5237
  sync() {
5086
- if (this.error) throw this.error;
5238
+ if (this.error)
5239
+ throw this.error;
5087
5240
  return this.result;
5088
5241
  }
5089
5242
  then(onFulfilled, onRejected) {
@@ -5203,7 +5356,8 @@ let Input$1$1 = input$1;
5203
5356
  let Root$1$1 = root$1;
5204
5357
  let Rule$1$1 = rule$1;
5205
5358
  function fromJSON$1$1(json, inputs) {
5206
- if (Array.isArray(json)) return json.map((n2) => fromJSON$1$1(n2));
5359
+ if (Array.isArray(json))
5360
+ return json.map((n2) => fromJSON$1$1(n2));
5207
5361
  let _a2 = json, { inputs: ownInputs } = _a2, defaults = __objRest(_a2, ["inputs"]);
5208
5362
  if (ownInputs) {
5209
5363
  inputs = [];
@@ -5289,7 +5443,8 @@ postcss$3.plugin = function plugin(name, initializer) {
5289
5443
  let cache;
5290
5444
  Object.defineProperty(creator, "postcss", {
5291
5445
  get() {
5292
- if (!cache) cache = creator();
5446
+ if (!cache)
5447
+ cache = creator();
5293
5448
  return cache;
5294
5449
  }
5295
5450
  });
@@ -5435,7 +5590,8 @@ function getDefaultExportFromCjs(x2) {
5435
5590
  return x2 && x2.__esModule && Object.prototype.hasOwnProperty.call(x2, "default") ? x2["default"] : x2;
5436
5591
  }
5437
5592
  function getAugmentedNamespace(n2) {
5438
- if (n2.__esModule) return n2;
5593
+ if (n2.__esModule)
5594
+ return n2;
5439
5595
  var f2 = n2.default;
5440
5596
  if (typeof f2 == "function") {
5441
5597
  var a2 = function a22() {
@@ -5445,7 +5601,8 @@ function getAugmentedNamespace(n2) {
5445
5601
  return f2.apply(this, arguments);
5446
5602
  };
5447
5603
  a2.prototype = f2.prototype;
5448
- } else a2 = {};
5604
+ } else
5605
+ a2 = {};
5449
5606
  Object.defineProperty(a2, "__esModule", { value: true });
5450
5607
  Object.keys(n2).forEach(function(k) {
5451
5608
  var d = Object.getOwnPropertyDescriptor(n2, k);
@@ -5513,11 +5670,14 @@ let CssSyntaxError$3 = class CssSyntaxError2 extends Error {
5513
5670
  this.message += ": " + this.reason;
5514
5671
  }
5515
5672
  showSourceCode(color) {
5516
- if (!this.source) return "";
5673
+ if (!this.source)
5674
+ return "";
5517
5675
  let css = this.source;
5518
- if (color == null) color = pico.isColorSupported;
5676
+ if (color == null)
5677
+ color = pico.isColorSupported;
5519
5678
  if (terminalHighlight$1) {
5520
- if (color) css = terminalHighlight$1(css);
5679
+ if (color)
5680
+ css = terminalHighlight$1(css);
5521
5681
  }
5522
5682
  let lines = css.split(/\\r?\\n/);
5523
5683
  let start = Math.max(this.line - 3, 0);
@@ -5610,7 +5770,8 @@ let Stringifier$2 = class Stringifier2 {
5610
5770
  if (value.includes("\\n")) {
5611
5771
  let indent = this.raw(node2, null, "indent");
5612
5772
  if (indent.length) {
5613
- for (let step = 0; step < depth; step++) value += indent;
5773
+ for (let step = 0; step < depth; step++)
5774
+ value += indent;
5614
5775
  }
5615
5776
  }
5616
5777
  return value;
@@ -5625,20 +5786,23 @@ let Stringifier$2 = class Stringifier2 {
5625
5786
  } else {
5626
5787
  after = this.raw(node2, "after", "emptyBody");
5627
5788
  }
5628
- if (after) this.builder(after);
5789
+ if (after)
5790
+ this.builder(after);
5629
5791
  this.builder("}", node2, "end");
5630
5792
  }
5631
5793
  body(node2) {
5632
5794
  let last = node2.nodes.length - 1;
5633
5795
  while (last > 0) {
5634
- if (node2.nodes[last].type !== "comment") break;
5796
+ if (node2.nodes[last].type !== "comment")
5797
+ break;
5635
5798
  last -= 1;
5636
5799
  }
5637
5800
  let semicolon = this.raw(node2, "semicolon");
5638
5801
  for (let i2 = 0; i2 < node2.nodes.length; i2++) {
5639
5802
  let child = node2.nodes[i2];
5640
5803
  let before = this.raw(child, "before");
5641
- if (before) this.builder(before);
5804
+ if (before)
5805
+ this.builder(before);
5642
5806
  this.stringify(child, last !== i2 || semicolon);
5643
5807
  }
5644
5808
  }
@@ -5653,7 +5817,8 @@ let Stringifier$2 = class Stringifier2 {
5653
5817
  if (node2.important) {
5654
5818
  string += node2.raws.important || " !important";
5655
5819
  }
5656
- if (semicolon) string += ";";
5820
+ if (semicolon)
5821
+ string += ";";
5657
5822
  this.builder(string, node2);
5658
5823
  }
5659
5824
  document(node2) {
@@ -5661,10 +5826,12 @@ let Stringifier$2 = class Stringifier2 {
5661
5826
  }
5662
5827
  raw(node2, own, detect) {
5663
5828
  let value;
5664
- if (!detect) detect = own;
5829
+ if (!detect)
5830
+ detect = own;
5665
5831
  if (own) {
5666
5832
  value = node2.raws[own];
5667
- if (typeof value !== "undefined") return value;
5833
+ if (typeof value !== "undefined")
5834
+ return value;
5668
5835
  }
5669
5836
  let parent = node2.parent;
5670
5837
  if (detect === "before") {
@@ -5675,9 +5842,11 @@ let Stringifier$2 = class Stringifier2 {
5675
5842
  return "";
5676
5843
  }
5677
5844
  }
5678
- if (!parent) return DEFAULT_RAW[detect];
5845
+ if (!parent)
5846
+ return DEFAULT_RAW[detect];
5679
5847
  let root2 = node2.root();
5680
- if (!root2.rawCache) root2.rawCache = {};
5848
+ if (!root2.rawCache)
5849
+ root2.rawCache = {};
5681
5850
  if (typeof root2.rawCache[detect] !== "undefined") {
5682
5851
  return root2.rawCache[detect];
5683
5852
  }
@@ -5690,11 +5859,13 @@ let Stringifier$2 = class Stringifier2 {
5690
5859
  } else {
5691
5860
  root2.walk((i2) => {
5692
5861
  value = i2.raws[own];
5693
- if (typeof value !== "undefined") return false;
5862
+ if (typeof value !== "undefined")
5863
+ return false;
5694
5864
  });
5695
5865
  }
5696
5866
  }
5697
- if (typeof value === "undefined") value = DEFAULT_RAW[detect];
5867
+ if (typeof value === "undefined")
5868
+ value = DEFAULT_RAW[detect];
5698
5869
  root2.rawCache[detect] = value;
5699
5870
  return value;
5700
5871
  }
@@ -5711,7 +5882,8 @@ let Stringifier$2 = class Stringifier2 {
5711
5882
  }
5712
5883
  }
5713
5884
  });
5714
- if (value) value = value.replace(/\\S/g, "");
5885
+ if (value)
5886
+ value = value.replace(/\\S/g, "");
5715
5887
  return value;
5716
5888
  }
5717
5889
  rawBeforeComment(root2, node2) {
@@ -5755,7 +5927,8 @@ let Stringifier$2 = class Stringifier2 {
5755
5927
  root2.walk((i2) => {
5756
5928
  if (i2.type !== "decl") {
5757
5929
  value = i2.raws.between;
5758
- if (typeof value !== "undefined") return false;
5930
+ if (typeof value !== "undefined")
5931
+ return false;
5759
5932
  }
5760
5933
  });
5761
5934
  return value;
@@ -5773,7 +5946,8 @@ let Stringifier$2 = class Stringifier2 {
5773
5946
  }
5774
5947
  }
5775
5948
  });
5776
- if (value) value = value.replace(/\\S/g, "");
5949
+ if (value)
5950
+ value = value.replace(/\\S/g, "");
5777
5951
  return value;
5778
5952
  }
5779
5953
  rawColon(root2) {
@@ -5791,13 +5965,15 @@ let Stringifier$2 = class Stringifier2 {
5791
5965
  root2.walk((i2) => {
5792
5966
  if (i2.nodes && i2.nodes.length === 0) {
5793
5967
  value = i2.raws.after;
5794
- if (typeof value !== "undefined") return false;
5968
+ if (typeof value !== "undefined")
5969
+ return false;
5795
5970
  }
5796
5971
  });
5797
5972
  return value;
5798
5973
  }
5799
5974
  rawIndent(root2) {
5800
- if (root2.raws.indent) return root2.raws.indent;
5975
+ if (root2.raws.indent)
5976
+ return root2.raws.indent;
5801
5977
  let value;
5802
5978
  root2.walk((i2) => {
5803
5979
  let p = i2.parent;
@@ -5817,7 +5993,8 @@ let Stringifier$2 = class Stringifier2 {
5817
5993
  root2.walk((i2) => {
5818
5994
  if (i2.nodes && i2.nodes.length && i2.last.type === "decl") {
5819
5995
  value = i2.raws.semicolon;
5820
- if (typeof value !== "undefined") return false;
5996
+ if (typeof value !== "undefined")
5997
+ return false;
5821
5998
  }
5822
5999
  });
5823
6000
  return value;
@@ -5832,7 +6009,8 @@ let Stringifier$2 = class Stringifier2 {
5832
6009
  }
5833
6010
  root(node2) {
5834
6011
  this.body(node2);
5835
- if (node2.raws.after) this.builder(node2.raws.after);
6012
+ if (node2.raws.after)
6013
+ this.builder(node2.raws.after);
5836
6014
  }
5837
6015
  rule(node2) {
5838
6016
  this.block(node2, this.rawValue(node2, "selector"));
@@ -5868,17 +6046,20 @@ function cloneNode(obj, parent) {
5868
6046
  if (!Object.prototype.hasOwnProperty.call(obj, i2)) {
5869
6047
  continue;
5870
6048
  }
5871
- if (i2 === "proxyCache") continue;
6049
+ if (i2 === "proxyCache")
6050
+ continue;
5872
6051
  let value = obj[i2];
5873
6052
  let type = typeof value;
5874
6053
  if (i2 === "parent" && type === "object") {
5875
- if (parent) cloned[i2] = parent;
6054
+ if (parent)
6055
+ cloned[i2] = parent;
5876
6056
  } else if (i2 === "source") {
5877
6057
  cloned[i2] = value;
5878
6058
  } else if (Array.isArray(value)) {
5879
6059
  cloned[i2] = value.map((j) => cloneNode(j, cloned));
5880
6060
  } else {
5881
- if (type === "object" && value !== null) value = cloneNode(value);
6061
+ if (type === "object" && value !== null)
6062
+ value = cloneNode(value);
5882
6063
  cloned[i2] = value;
5883
6064
  }
5884
6065
  }
@@ -5932,7 +6113,8 @@ let Node$5 = class Node22 {
5932
6113
  cleanRaws(keepBetween) {
5933
6114
  delete this.raws.before;
5934
6115
  delete this.raws.after;
5935
- if (!keepBetween) delete this.raws.between;
6116
+ if (!keepBetween)
6117
+ delete this.raws.between;
5936
6118
  }
5937
6119
  clone(overrides = {}) {
5938
6120
  let cloned = cloneNode(this);
@@ -5975,7 +6157,8 @@ let Node$5 = class Node22 {
5975
6157
  }
5976
6158
  },
5977
6159
  set(node2, prop, value) {
5978
- if (node2[prop] === value) return true;
6160
+ if (node2[prop] === value)
6161
+ return true;
5979
6162
  node2[prop] = value;
5980
6163
  if (prop === "prop" || prop === "value" || prop === "name" || prop === "params" || prop === "important" || /* c8 ignore next */
5981
6164
  prop === "text") {
@@ -5995,7 +6178,8 @@ let Node$5 = class Node22 {
5995
6178
  }
5996
6179
  }
5997
6180
  next() {
5998
- if (!this.parent) return void 0;
6181
+ if (!this.parent)
6182
+ return void 0;
5999
6183
  let index2 = this.parent.index(this);
6000
6184
  return this.parent.nodes[index2 + 1];
6001
6185
  }
@@ -6006,7 +6190,8 @@ let Node$5 = class Node22 {
6006
6190
  } else if (opts.word) {
6007
6191
  stringRepresentation = this.toString();
6008
6192
  let index2 = stringRepresentation.indexOf(opts.word);
6009
- if (index2 !== -1) pos = this.positionInside(index2, stringRepresentation);
6193
+ if (index2 !== -1)
6194
+ pos = this.positionInside(index2, stringRepresentation);
6010
6195
  }
6011
6196
  return pos;
6012
6197
  }
@@ -6025,7 +6210,8 @@ let Node$5 = class Node22 {
6025
6210
  return { column, line };
6026
6211
  }
6027
6212
  prev() {
6028
- if (!this.parent) return void 0;
6213
+ if (!this.parent)
6214
+ return void 0;
6029
6215
  let index2 = this.parent.index(this);
6030
6216
  return this.parent.nodes[index2 - 1];
6031
6217
  }
@@ -6120,7 +6306,8 @@ let Node$5 = class Node22 {
6120
6306
  if (!Object.prototype.hasOwnProperty.call(this, name)) {
6121
6307
  continue;
6122
6308
  }
6123
- if (name === "parent" || name === "proxyCache") continue;
6309
+ if (name === "parent" || name === "proxyCache")
6310
+ continue;
6124
6311
  let value = this[name];
6125
6312
  if (Array.isArray(value)) {
6126
6313
  fixed[name] = value.map((i2) => {
@@ -6160,7 +6347,8 @@ let Node$5 = class Node22 {
6160
6347
  return this.proxyCache;
6161
6348
  }
6162
6349
  toString(stringifier2 = stringify$3) {
6163
- if (stringifier2.stringify) stringifier2 = stringifier2.stringify;
6350
+ if (stringifier2.stringify)
6351
+ stringifier2 = stringifier2.stringify;
6164
6352
  let result2 = "";
6165
6353
  stringifier2(this, (i2) => {
6166
6354
  result2 += i2;
@@ -6169,7 +6357,8 @@ let Node$5 = class Node22 {
6169
6357
  }
6170
6358
  warn(result2, text, opts) {
6171
6359
  let data = { node: this };
6172
- for (let i2 in opts) data[i2] = opts[i2];
6360
+ for (let i2 in opts)
6361
+ data[i2] = opts[i2];
6173
6362
  return result2.warn(text, data);
6174
6363
  }
6175
6364
  get proxyOf() {
@@ -6225,7 +6414,8 @@ function fromBase64(str) {
6225
6414
  }
6226
6415
  let PreviousMap$2 = class PreviousMap2 {
6227
6416
  constructor(css, opts) {
6228
- if (opts.map === false) return;
6417
+ if (opts.map === false)
6418
+ return;
6229
6419
  this.loadAnnotation(css);
6230
6420
  this.inline = this.startWith(this.annotation, "data:");
6231
6421
  let prev = opts.map ? opts.map.prev : void 0;
@@ -6233,8 +6423,10 @@ let PreviousMap$2 = class PreviousMap2 {
6233
6423
  if (!this.mapFile && opts.from) {
6234
6424
  this.mapFile = opts.from;
6235
6425
  }
6236
- if (this.mapFile) this.root = dirname$1(this.mapFile);
6237
- if (text) this.text = text;
6426
+ if (this.mapFile)
6427
+ this.root = dirname$1(this.mapFile);
6428
+ if (text)
6429
+ this.text = text;
6238
6430
  }
6239
6431
  consumer() {
6240
6432
  if (!this.consumerCache) {
@@ -6260,12 +6452,14 @@ let PreviousMap$2 = class PreviousMap2 {
6260
6452
  return sourceMapString.replace(/^\\/\\*\\s*# sourceMappingURL=/, "").trim();
6261
6453
  }
6262
6454
  isMap(map) {
6263
- if (typeof map !== "object") return false;
6455
+ if (typeof map !== "object")
6456
+ return false;
6264
6457
  return typeof map.mappings === "string" || typeof map._mappings === "string" || Array.isArray(map.sections);
6265
6458
  }
6266
6459
  loadAnnotation(css) {
6267
6460
  let comments = css.match(/\\/\\*\\s*# sourceMappingURL=/gm);
6268
- if (!comments) return;
6461
+ if (!comments)
6462
+ return;
6269
6463
  let start = css.lastIndexOf(comments.pop());
6270
6464
  let end = css.indexOf("*/", start);
6271
6465
  if (start > -1 && end > -1) {
@@ -6280,7 +6474,8 @@ let PreviousMap$2 = class PreviousMap2 {
6280
6474
  }
6281
6475
  }
6282
6476
  loadMap(file, prev) {
6283
- if (prev === false) return false;
6477
+ if (prev === false)
6478
+ return false;
6284
6479
  if (prev) {
6285
6480
  if (typeof prev === "string") {
6286
6481
  return prev;
@@ -6310,12 +6505,14 @@ let PreviousMap$2 = class PreviousMap2 {
6310
6505
  return this.decodeInline(this.annotation);
6311
6506
  } else if (this.annotation) {
6312
6507
  let map = this.annotation;
6313
- if (file) map = join(dirname$1(file), map);
6508
+ if (file)
6509
+ map = join(dirname$1(file), map);
6314
6510
  return this.loadFile(map);
6315
6511
  }
6316
6512
  }
6317
6513
  startWith(string, start) {
6318
- if (!string) return false;
6514
+ if (!string)
6515
+ return false;
6319
6516
  return string.substr(0, start.length) === start;
6320
6517
  }
6321
6518
  withContent() {
@@ -6358,13 +6555,15 @@ let Input$4 = class Input2 {
6358
6555
  if (map.text) {
6359
6556
  this.map = map;
6360
6557
  let file = map.consumer().file;
6361
- if (!this.file && file) this.file = this.mapResolve(file);
6558
+ if (!this.file && file)
6559
+ this.file = this.mapResolve(file);
6362
6560
  }
6363
6561
  }
6364
6562
  if (!this.file) {
6365
6563
  this.id = "<input css " + nanoid(6) + ">";
6366
6564
  }
6367
- if (this.map) this.map.file = this.from;
6565
+ if (this.map)
6566
+ this.map.file = this.from;
6368
6567
  }
6369
6568
  error(message, line, column, opts = {}) {
6370
6569
  let result2, endLine, endColumn;
@@ -6466,10 +6665,12 @@ let Input$4 = class Input2 {
6466
6665
  return resolve$1(this.map.consumer().sourceRoot || this.map.root || ".", file);
6467
6666
  }
6468
6667
  origin(line, column, endLine, endColumn) {
6469
- if (!this.map) return false;
6668
+ if (!this.map)
6669
+ return false;
6470
6670
  let consumer = this.map.consumer();
6471
6671
  let from = consumer.originalPositionFor({ column, line });
6472
- if (!from.source) return false;
6672
+ if (!from.source)
6673
+ return false;
6473
6674
  let to;
6474
6675
  if (typeof endLine === "number") {
6475
6676
  to = consumer.originalPositionFor({ column: endColumn, line: endLine });
@@ -6498,7 +6699,8 @@ let Input$4 = class Input2 {
6498
6699
  }
6499
6700
  }
6500
6701
  let source = consumer.sourceContentFor(from.source);
6501
- if (source) result2.source = source;
6702
+ if (source)
6703
+ result2.source = source;
6502
6704
  return result2;
6503
6705
  }
6504
6706
  toJSON() {
@@ -6556,7 +6758,8 @@ let MapGenerator$2 = class MapGenerator2 {
6556
6758
  content = this.outputFile() + ".map";
6557
6759
  }
6558
6760
  let eol = "\\n";
6559
- if (this.css.includes("\\r\\n")) eol = "\\r\\n";
6761
+ if (this.css.includes("\\r\\n"))
6762
+ eol = "\\r\\n";
6560
6763
  this.css += eol + "/*# sourceMappingURL=" + content + " */";
6561
6764
  }
6562
6765
  applyPrevMaps() {
@@ -6576,12 +6779,14 @@ let MapGenerator$2 = class MapGenerator2 {
6576
6779
  }
6577
6780
  }
6578
6781
  clearAnnotation() {
6579
- if (this.mapOpts.annotation === false) return;
6782
+ if (this.mapOpts.annotation === false)
6783
+ return;
6580
6784
  if (this.root) {
6581
6785
  let node2;
6582
6786
  for (let i2 = this.root.nodes.length - 1; i2 >= 0; i2--) {
6583
6787
  node2 = this.root.nodes[i2];
6584
- if (node2.type !== "comment") continue;
6788
+ if (node2.type !== "comment")
6789
+ continue;
6585
6790
  if (node2.text.indexOf("# sourceMappingURL=") === 0) {
6586
6791
  this.root.removeChild(i2);
6587
6792
  }
@@ -6622,9 +6827,12 @@ let MapGenerator$2 = class MapGenerator2 {
6622
6827
  source: this.opts.from ? this.toUrl(this.path(this.opts.from)) : "<no source>"
6623
6828
  });
6624
6829
  }
6625
- if (this.isSourcesContent()) this.setSourcesContent();
6626
- if (this.root && this.previous().length > 0) this.applyPrevMaps();
6627
- if (this.isAnnotation()) this.addAnnotation();
6830
+ if (this.isSourcesContent())
6831
+ this.setSourcesContent();
6832
+ if (this.root && this.previous().length > 0)
6833
+ this.applyPrevMaps();
6834
+ if (this.isAnnotation())
6835
+ this.addAnnotation();
6628
6836
  if (this.isInline()) {
6629
6837
  return [this.css];
6630
6838
  } else {
@@ -6744,11 +6952,15 @@ let MapGenerator$2 = class MapGenerator2 {
6744
6952
  }
6745
6953
  }
6746
6954
  path(file) {
6747
- if (this.mapOpts.absolute) return file;
6748
- if (file.charCodeAt(0) === 60) return file;
6749
- if (/^\\w+:\\/\\//.test(file)) return file;
6955
+ if (this.mapOpts.absolute)
6956
+ return file;
6957
+ if (file.charCodeAt(0) === 60)
6958
+ return file;
6959
+ if (/^\\w+:\\/\\//.test(file))
6960
+ return file;
6750
6961
  let cached = this.memoizedPaths.get(file);
6751
- if (cached) return cached;
6962
+ if (cached)
6963
+ return cached;
6752
6964
  let from = this.opts.to ? dirname(this.opts.to) : ".";
6753
6965
  if (typeof this.mapOpts.annotation === "string") {
6754
6966
  from = dirname(resolve(from, this.mapOpts.annotation));
@@ -6771,7 +6983,8 @@ let MapGenerator$2 = class MapGenerator2 {
6771
6983
  });
6772
6984
  } else {
6773
6985
  let input2 = new Input$3(this.originalCSS, this.opts);
6774
- if (input2.map) this.previousMaps.push(input2.map);
6986
+ if (input2.map)
6987
+ this.previousMaps.push(input2.map);
6775
6988
  }
6776
6989
  }
6777
6990
  return this.previousMaps;
@@ -6812,7 +7025,8 @@ let MapGenerator$2 = class MapGenerator2 {
6812
7025
  }
6813
7026
  toFileUrl(path) {
6814
7027
  let cached = this.memoizedFileURLs.get(path);
6815
- if (cached) return cached;
7028
+ if (cached)
7029
+ return cached;
6816
7030
  if (pathToFileURL) {
6817
7031
  let fileURL = pathToFileURL(path).toString();
6818
7032
  this.memoizedFileURLs.set(path, fileURL);
@@ -6825,7 +7039,8 @@ let MapGenerator$2 = class MapGenerator2 {
6825
7039
  }
6826
7040
  toUrl(path) {
6827
7041
  let cached = this.memoizedURLs.get(path);
6828
- if (cached) return cached;
7042
+ if (cached)
7043
+ return cached;
6829
7044
  if (sep === "\\\\") {
6830
7045
  path = path.replace(/\\\\/g, "/");
6831
7046
  }
@@ -6854,7 +7069,8 @@ let AtRule$4;
6854
7069
  let Root$6;
6855
7070
  function cleanSource(nodes) {
6856
7071
  return nodes.map((i2) => {
6857
- if (i2.nodes) i2.nodes = cleanSource(i2.nodes);
7072
+ if (i2.nodes)
7073
+ i2.nodes = cleanSource(i2.nodes);
6858
7074
  delete i2.source;
6859
7075
  return i2;
6860
7076
  });
@@ -6871,7 +7087,8 @@ let Container$7 = class Container2 extends Node$2 {
6871
7087
  append(...children) {
6872
7088
  for (let child of children) {
6873
7089
  let nodes = this.normalize(child, this.last);
6874
- for (let node2 of nodes) this.proxyOf.nodes.push(node2);
7090
+ for (let node2 of nodes)
7091
+ this.proxyOf.nodes.push(node2);
6875
7092
  }
6876
7093
  this.markDirty();
6877
7094
  return this;
@@ -6879,17 +7096,20 @@ let Container$7 = class Container2 extends Node$2 {
6879
7096
  cleanRaws(keepBetween) {
6880
7097
  super.cleanRaws(keepBetween);
6881
7098
  if (this.nodes) {
6882
- for (let node2 of this.nodes) node2.cleanRaws(keepBetween);
7099
+ for (let node2 of this.nodes)
7100
+ node2.cleanRaws(keepBetween);
6883
7101
  }
6884
7102
  }
6885
7103
  each(callback) {
6886
- if (!this.proxyOf.nodes) return void 0;
7104
+ if (!this.proxyOf.nodes)
7105
+ return void 0;
6887
7106
  let iterator = this.getIterator();
6888
7107
  let index2, result2;
6889
7108
  while (this.indexes[iterator] < this.proxyOf.nodes.length) {
6890
7109
  index2 = this.indexes[iterator];
6891
7110
  result2 = callback(this.proxyOf.nodes[index2], index2);
6892
- if (result2 === false) break;
7111
+ if (result2 === false)
7112
+ break;
6893
7113
  this.indexes[iterator] += 1;
6894
7114
  }
6895
7115
  delete this.indexes[iterator];
@@ -6899,8 +7119,10 @@ let Container$7 = class Container2 extends Node$2 {
6899
7119
  return this.nodes.every(condition);
6900
7120
  }
6901
7121
  getIterator() {
6902
- if (!this.lastEach) this.lastEach = 0;
6903
- if (!this.indexes) this.indexes = {};
7122
+ if (!this.lastEach)
7123
+ this.lastEach = 0;
7124
+ if (!this.indexes)
7125
+ this.indexes = {};
6904
7126
  this.lastEach += 1;
6905
7127
  let iterator = this.lastEach;
6906
7128
  this.indexes[iterator] = 0;
@@ -6942,7 +7164,8 @@ let Container$7 = class Container2 extends Node$2 {
6942
7164
  }
6943
7165
  },
6944
7166
  set(node2, prop, value) {
6945
- if (node2[prop] === value) return true;
7167
+ if (node2[prop] === value)
7168
+ return true;
6946
7169
  node2[prop] = value;
6947
7170
  if (prop === "name" || prop === "params" || prop === "selector") {
6948
7171
  node2.markDirty();
@@ -6952,15 +7175,18 @@ let Container$7 = class Container2 extends Node$2 {
6952
7175
  };
6953
7176
  }
6954
7177
  index(child) {
6955
- if (typeof child === "number") return child;
6956
- if (child.proxyOf) child = child.proxyOf;
7178
+ if (typeof child === "number")
7179
+ return child;
7180
+ if (child.proxyOf)
7181
+ child = child.proxyOf;
6957
7182
  return this.proxyOf.nodes.indexOf(child);
6958
7183
  }
6959
7184
  insertAfter(exist, add) {
6960
7185
  let existIndex = this.index(exist);
6961
7186
  let nodes = this.normalize(add, this.proxyOf.nodes[existIndex]).reverse();
6962
7187
  existIndex = this.index(exist);
6963
- for (let node2 of nodes) this.proxyOf.nodes.splice(existIndex + 1, 0, node2);
7188
+ for (let node2 of nodes)
7189
+ this.proxyOf.nodes.splice(existIndex + 1, 0, node2);
6964
7190
  let index2;
6965
7191
  for (let id in this.indexes) {
6966
7192
  index2 = this.indexes[id];
@@ -6976,7 +7202,8 @@ let Container$7 = class Container2 extends Node$2 {
6976
7202
  let type = existIndex === 0 ? "prepend" : false;
6977
7203
  let nodes = this.normalize(add, this.proxyOf.nodes[existIndex], type).reverse();
6978
7204
  existIndex = this.index(exist);
6979
- for (let node2 of nodes) this.proxyOf.nodes.splice(existIndex, 0, node2);
7205
+ for (let node2 of nodes)
7206
+ this.proxyOf.nodes.splice(existIndex, 0, node2);
6980
7207
  let index2;
6981
7208
  for (let id in this.indexes) {
6982
7209
  index2 = this.indexes[id];
@@ -6995,12 +7222,14 @@ let Container$7 = class Container2 extends Node$2 {
6995
7222
  } else if (Array.isArray(nodes)) {
6996
7223
  nodes = nodes.slice(0);
6997
7224
  for (let i2 of nodes) {
6998
- if (i2.parent) i2.parent.removeChild(i2, "ignore");
7225
+ if (i2.parent)
7226
+ i2.parent.removeChild(i2, "ignore");
6999
7227
  }
7000
7228
  } else if (nodes.type === "root" && this.type !== "document") {
7001
7229
  nodes = nodes.nodes.slice(0);
7002
7230
  for (let i2 of nodes) {
7003
- if (i2.parent) i2.parent.removeChild(i2, "ignore");
7231
+ if (i2.parent)
7232
+ i2.parent.removeChild(i2, "ignore");
7004
7233
  }
7005
7234
  } else if (nodes.type) {
7006
7235
  nodes = [nodes];
@@ -7021,10 +7250,13 @@ let Container$7 = class Container2 extends Node$2 {
7021
7250
  throw new Error("Unknown node type in node creation");
7022
7251
  }
7023
7252
  let processed = nodes.map((i2) => {
7024
- if (!i2[my$1]) Container2.rebuild(i2);
7253
+ if (!i2[my$1])
7254
+ Container2.rebuild(i2);
7025
7255
  i2 = i2.proxyOf;
7026
- if (i2.parent) i2.parent.removeChild(i2);
7027
- if (i2[isClean$1]) markDirtyUp(i2);
7256
+ if (i2.parent)
7257
+ i2.parent.removeChild(i2);
7258
+ if (i2[isClean$1])
7259
+ markDirtyUp(i2);
7028
7260
  if (typeof i2.raws.before === "undefined") {
7029
7261
  if (sample && typeof sample.raws.before !== "undefined") {
7030
7262
  i2.raws.before = sample.raws.before.replace(/\\S/g, "");
@@ -7039,7 +7271,8 @@ let Container$7 = class Container2 extends Node$2 {
7039
7271
  children = children.reverse();
7040
7272
  for (let child of children) {
7041
7273
  let nodes = this.normalize(child, this.first, "prepend").reverse();
7042
- for (let node2 of nodes) this.proxyOf.nodes.unshift(node2);
7274
+ for (let node2 of nodes)
7275
+ this.proxyOf.nodes.unshift(node2);
7043
7276
  for (let id in this.indexes) {
7044
7277
  this.indexes[id] = this.indexes[id] + nodes.length;
7045
7278
  }
@@ -7053,7 +7286,8 @@ let Container$7 = class Container2 extends Node$2 {
7053
7286
  return this;
7054
7287
  }
7055
7288
  removeAll() {
7056
- for (let node2 of this.proxyOf.nodes) node2.parent = void 0;
7289
+ for (let node2 of this.proxyOf.nodes)
7290
+ node2.parent = void 0;
7057
7291
  this.proxyOf.nodes = [];
7058
7292
  this.markDirty();
7059
7293
  return this;
@@ -7078,8 +7312,10 @@ let Container$7 = class Container2 extends Node$2 {
7078
7312
  opts = {};
7079
7313
  }
7080
7314
  this.walkDecls((decl) => {
7081
- if (opts.props && !opts.props.includes(decl.prop)) return;
7082
- if (opts.fast && !decl.value.includes(opts.fast)) return;
7315
+ if (opts.props && !opts.props.includes(decl.prop))
7316
+ return;
7317
+ if (opts.fast && !decl.value.includes(opts.fast))
7318
+ return;
7083
7319
  decl.value = decl.value.replace(pattern, callback);
7084
7320
  });
7085
7321
  this.markDirty();
@@ -7176,11 +7412,13 @@ let Container$7 = class Container2 extends Node$2 {
7176
7412
  });
7177
7413
  }
7178
7414
  get first() {
7179
- if (!this.proxyOf.nodes) return void 0;
7415
+ if (!this.proxyOf.nodes)
7416
+ return void 0;
7180
7417
  return this.proxyOf.nodes[0];
7181
7418
  }
7182
7419
  get last() {
7183
- if (!this.proxyOf.nodes) return void 0;
7420
+ if (!this.proxyOf.nodes)
7421
+ return void 0;
7184
7422
  return this.proxyOf.nodes[this.proxyOf.nodes.length - 1];
7185
7423
  }
7186
7424
  };
@@ -7242,7 +7480,8 @@ var document$1 = Document$3;
7242
7480
  Document$3.default = Document$3;
7243
7481
  let printed = {};
7244
7482
  var warnOnce$2 = function warnOnce2(message) {
7245
- if (printed[message]) return;
7483
+ if (printed[message])
7484
+ return;
7246
7485
  printed[message] = true;
7247
7486
  if (typeof console !== "undefined" && console.warn) {
7248
7487
  console.warn(message);
@@ -7259,7 +7498,8 @@ let Warning$2 = class Warning2 {
7259
7498
  this.endLine = range.end.line;
7260
7499
  this.endColumn = range.end.column;
7261
7500
  }
7262
- for (let opt in opts) this[opt] = opts[opt];
7501
+ for (let opt in opts)
7502
+ this[opt] = opts[opt];
7263
7503
  }
7264
7504
  toString() {
7265
7505
  if (this.node) {
@@ -7351,8 +7591,10 @@ var tokenize = function tokenizer2(input2, options = {}) {
7351
7591
  return returned.length === 0 && pos >= length;
7352
7592
  }
7353
7593
  function nextToken(opts) {
7354
- if (returned.length) return returned.pop();
7355
- if (pos >= length) return;
7594
+ if (returned.length)
7595
+ return returned.pop();
7596
+ if (pos >= length)
7597
+ return;
7356
7598
  let ignoreUnclosed = opts ? opts.ignoreUnclosed : false;
7357
7599
  code = css.charCodeAt(pos);
7358
7600
  switch (code) {
@@ -7524,11 +7766,13 @@ let AtRule$3 = class AtRule2 extends Container$5 {
7524
7766
  this.type = "atrule";
7525
7767
  }
7526
7768
  append(...children) {
7527
- if (!this.proxyOf.nodes) this.nodes = [];
7769
+ if (!this.proxyOf.nodes)
7770
+ this.nodes = [];
7528
7771
  return super.append(...children);
7529
7772
  }
7530
7773
  prepend(...children) {
7531
- if (!this.proxyOf.nodes) this.nodes = [];
7774
+ if (!this.proxyOf.nodes)
7775
+ this.nodes = [];
7532
7776
  return super.prepend(...children);
7533
7777
  }
7534
7778
  };
@@ -7542,7 +7786,8 @@ let Root$5 = class Root2 extends Container$4 {
7542
7786
  constructor(defaults) {
7543
7787
  super(defaults);
7544
7788
  this.type = "root";
7545
- if (!this.nodes) this.nodes = [];
7789
+ if (!this.nodes)
7790
+ this.nodes = [];
7546
7791
  }
7547
7792
  normalize(child, sample, type) {
7548
7793
  let nodes = super.normalize(child);
@@ -7613,19 +7858,23 @@ let list$2 = {
7613
7858
  } else if (letter === "(") {
7614
7859
  func += 1;
7615
7860
  } else if (letter === ")") {
7616
- if (func > 0) func -= 1;
7861
+ if (func > 0)
7862
+ func -= 1;
7617
7863
  } else if (func === 0) {
7618
- if (separators.includes(letter)) split = true;
7864
+ if (separators.includes(letter))
7865
+ split = true;
7619
7866
  }
7620
7867
  if (split) {
7621
- if (current !== "") array.push(current.trim());
7868
+ if (current !== "")
7869
+ array.push(current.trim());
7622
7870
  current = "";
7623
7871
  split = false;
7624
7872
  } else {
7625
7873
  current += letter;
7626
7874
  }
7627
7875
  }
7628
- if (last || current !== "") array.push(current.trim());
7876
+ if (last || current !== "")
7877
+ array.push(current.trim());
7629
7878
  return array;
7630
7879
  }
7631
7880
  };
@@ -7637,7 +7886,8 @@ let Rule$3 = class Rule2 extends Container$3 {
7637
7886
  constructor(defaults) {
7638
7887
  super(defaults);
7639
7888
  this.type = "rule";
7640
- if (!this.nodes) this.nodes = [];
7889
+ if (!this.nodes)
7890
+ this.nodes = [];
7641
7891
  }
7642
7892
  get selectors() {
7643
7893
  return list$1.comma(this.selector);
@@ -7665,7 +7915,8 @@ function findLastWithPosition(tokens) {
7665
7915
  for (let i2 = tokens.length - 1; i2 >= 0; i2--) {
7666
7916
  let token = tokens[i2];
7667
7917
  let pos = token[3] || token[2];
7668
- if (pos) return pos;
7918
+ if (pos)
7919
+ return pos;
7669
7920
  }
7670
7921
  }
7671
7922
  let Parser$1 = class Parser2 {
@@ -7758,14 +8009,16 @@ let Parser$1 = class Parser2 {
7758
8009
  }
7759
8010
  checkMissedSemicolon(tokens) {
7760
8011
  let colon = this.colon(tokens);
7761
- if (colon === false) return;
8012
+ if (colon === false)
8013
+ return;
7762
8014
  let founded = 0;
7763
8015
  let token;
7764
8016
  for (let j = colon - 1; j >= 0; j--) {
7765
8017
  token = tokens[j];
7766
8018
  if (token[0] !== "space") {
7767
8019
  founded += 1;
7768
- if (founded === 2) break;
8020
+ if (founded === 2)
8021
+ break;
7769
8022
  }
7770
8023
  }
7771
8024
  throw this.input.error(
@@ -7831,7 +8084,8 @@ let Parser$1 = class Parser2 {
7831
8084
  );
7832
8085
  node2.source.end.offset++;
7833
8086
  while (tokens[0][0] !== "word") {
7834
- if (tokens.length === 1) this.unknownWord(tokens);
8087
+ if (tokens.length === 1)
8088
+ this.unknownWord(tokens);
7835
8089
  node2.raws.before += tokens.shift()[1];
7836
8090
  }
7837
8091
  node2.source.start = this.getPosition(tokens[0][2]);
@@ -7865,7 +8119,8 @@ let Parser$1 = class Parser2 {
7865
8119
  let next;
7866
8120
  while (tokens.length) {
7867
8121
  next = tokens[0][0];
7868
- if (next !== "space" && next !== "comment") break;
8122
+ if (next !== "space" && next !== "comment")
8123
+ break;
7869
8124
  firstSpaces.push(tokens.shift());
7870
8125
  }
7871
8126
  this.precheckMissedSemicolon(tokens);
@@ -7875,7 +8130,8 @@ let Parser$1 = class Parser2 {
7875
8130
  node2.important = true;
7876
8131
  let string = this.stringFrom(tokens, i2);
7877
8132
  string = this.spacesFromEnd(tokens) + string;
7878
- if (string !== " !important") node2.raws.important = string;
8133
+ if (string !== " !important")
8134
+ node2.raws.important = string;
7879
8135
  break;
7880
8136
  } else if (token[1].toLowerCase() === "important") {
7881
8137
  let cache = tokens.slice(0);
@@ -7937,7 +8193,8 @@ let Parser$1 = class Parser2 {
7937
8193
  }
7938
8194
  }
7939
8195
  endFile() {
7940
- if (this.current.parent) this.unclosedBlock();
8196
+ if (this.current.parent)
8197
+ this.unclosedBlock();
7941
8198
  if (this.current.nodes && this.current.nodes.length) {
7942
8199
  this.current.raws.semicolon = this.semicolon;
7943
8200
  }
@@ -7971,7 +8228,8 @@ let Parser$1 = class Parser2 {
7971
8228
  };
7972
8229
  node2.raws.before = this.spaces;
7973
8230
  this.spaces = "";
7974
- if (node2.type !== "comment") this.semicolon = false;
8231
+ if (node2.type !== "comment")
8232
+ this.semicolon = false;
7975
8233
  }
7976
8234
  other(start) {
7977
8235
  let end = false;
@@ -7986,10 +8244,12 @@ let Parser$1 = class Parser2 {
7986
8244
  type = token[0];
7987
8245
  tokens.push(token);
7988
8246
  if (type === "(" || type === "[") {
7989
- if (!bracket) bracket = token;
8247
+ if (!bracket)
8248
+ bracket = token;
7990
8249
  brackets.push(type === "(" ? ")" : "]");
7991
8250
  } else if (customProperty && colon && type === "{") {
7992
- if (!bracket) bracket = token;
8251
+ if (!bracket)
8252
+ bracket = token;
7993
8253
  brackets.push("}");
7994
8254
  } else if (brackets.length === 0) {
7995
8255
  if (type === ";") {
@@ -8011,17 +8271,21 @@ let Parser$1 = class Parser2 {
8011
8271
  }
8012
8272
  } else if (type === brackets[brackets.length - 1]) {
8013
8273
  brackets.pop();
8014
- if (brackets.length === 0) bracket = null;
8274
+ if (brackets.length === 0)
8275
+ bracket = null;
8015
8276
  }
8016
8277
  token = this.tokenizer.nextToken();
8017
8278
  }
8018
- if (this.tokenizer.endOfFile()) end = true;
8019
- if (brackets.length > 0) this.unclosedBracket(bracket);
8279
+ if (this.tokenizer.endOfFile())
8280
+ end = true;
8281
+ if (brackets.length > 0)
8282
+ this.unclosedBracket(bracket);
8020
8283
  if (end && colon) {
8021
8284
  if (!customProperty) {
8022
8285
  while (tokens.length) {
8023
8286
  token = tokens[tokens.length - 1][0];
8024
- if (token !== "space" && token !== "comment") break;
8287
+ if (token !== "space" && token !== "comment")
8288
+ break;
8025
8289
  this.tokenizer.back(tokens.pop());
8026
8290
  }
8027
8291
  }
@@ -8108,7 +8372,8 @@ let Parser$1 = class Parser2 {
8108
8372
  let spaces = "";
8109
8373
  while (tokens.length) {
8110
8374
  lastTokenType = tokens[tokens.length - 1][0];
8111
- if (lastTokenType !== "space" && lastTokenType !== "comment") break;
8375
+ if (lastTokenType !== "space" && lastTokenType !== "comment")
8376
+ break;
8112
8377
  spaces = tokens.pop()[1] + spaces;
8113
8378
  }
8114
8379
  return spaces;
@@ -8119,7 +8384,8 @@ let Parser$1 = class Parser2 {
8119
8384
  let spaces = "";
8120
8385
  while (tokens.length) {
8121
8386
  next = tokens[0][0];
8122
- if (next !== "space" && next !== "comment") break;
8387
+ if (next !== "space" && next !== "comment")
8388
+ break;
8123
8389
  spaces += tokens.shift()[1];
8124
8390
  }
8125
8391
  return spaces;
@@ -8129,7 +8395,8 @@ let Parser$1 = class Parser2 {
8129
8395
  let spaces = "";
8130
8396
  while (tokens.length) {
8131
8397
  lastTokenType = tokens[tokens.length - 1][0];
8132
- if (lastTokenType !== "space") break;
8398
+ if (lastTokenType !== "space")
8399
+ break;
8133
8400
  spaces = tokens.pop()[1] + spaces;
8134
8401
  }
8135
8402
  return spaces;
@@ -8291,7 +8558,8 @@ function toStack(node2) {
8291
8558
  }
8292
8559
  function cleanMarks(node2) {
8293
8560
  node2[isClean] = false;
8294
- if (node2.nodes) node2.nodes.forEach((i2) => cleanMarks(i2));
8561
+ if (node2.nodes)
8562
+ node2.nodes.forEach((i2) => cleanMarks(i2));
8295
8563
  return node2;
8296
8564
  }
8297
8565
  let postcss$2 = {};
@@ -8305,15 +8573,20 @@ let LazyResult$2 = class LazyResult2 {
8305
8573
  } else if (css instanceof LazyResult2 || css instanceof Result$2) {
8306
8574
  root2 = cleanMarks(css.root);
8307
8575
  if (css.map) {
8308
- if (typeof opts.map === "undefined") opts.map = {};
8309
- if (!opts.map.inline) opts.map.inline = false;
8576
+ if (typeof opts.map === "undefined")
8577
+ opts.map = {};
8578
+ if (!opts.map.inline)
8579
+ opts.map.inline = false;
8310
8580
  opts.map.prev = css.map;
8311
8581
  }
8312
8582
  } else {
8313
8583
  let parser2 = parse$2;
8314
- if (opts.syntax) parser2 = opts.syntax.parse;
8315
- if (opts.parser) parser2 = opts.parser;
8316
- if (parser2.parse) parser2 = parser2.parse;
8584
+ if (opts.syntax)
8585
+ parser2 = opts.syntax.parse;
8586
+ if (opts.parser)
8587
+ parser2 = opts.parser;
8588
+ if (parser2.parse)
8589
+ parser2 = parser2.parse;
8317
8590
  try {
8318
8591
  root2 = parser2(css, opts);
8319
8592
  } catch (error) {
@@ -8335,8 +8608,10 @@ let LazyResult$2 = class LazyResult2 {
8335
8608
  });
8336
8609
  }
8337
8610
  async() {
8338
- if (this.error) return Promise.reject(this.error);
8339
- if (this.processed) return Promise.resolve(this.result);
8611
+ if (this.error)
8612
+ return Promise.reject(this.error);
8613
+ if (this.processed)
8614
+ return Promise.resolve(this.result);
8340
8615
  if (!this.processing) {
8341
8616
  this.processing = this.runAsync();
8342
8617
  }
@@ -8354,7 +8629,8 @@ let LazyResult$2 = class LazyResult2 {
8354
8629
  handleError(error, node2) {
8355
8630
  let plugin22 = this.result.lastPlugin;
8356
8631
  try {
8357
- if (node2) node2.addToError(error);
8632
+ if (node2)
8633
+ node2.addToError(error);
8358
8634
  this.error = error;
8359
8635
  if (error.name === "CssSyntaxError" && !error.plugin) {
8360
8636
  error.plugin = plugin22.postcssPlugin;
@@ -8374,14 +8650,16 @@ let LazyResult$2 = class LazyResult2 {
8374
8650
  }
8375
8651
  }
8376
8652
  } catch (err) {
8377
- if (console && console.error) console.error(err);
8653
+ if (console && console.error)
8654
+ console.error(err);
8378
8655
  }
8379
8656
  return error;
8380
8657
  }
8381
8658
  prepareVisitors() {
8382
8659
  this.listeners = {};
8383
8660
  let add = (plugin22, type, cb) => {
8384
- if (!this.listeners[type]) this.listeners[type] = [];
8661
+ if (!this.listeners[type])
8662
+ this.listeners[type] = [];
8385
8663
  this.listeners[type].push([plugin22, cb]);
8386
8664
  };
8387
8665
  for (let plugin22 of this.plugins) {
@@ -8488,15 +8766,20 @@ let LazyResult$2 = class LazyResult2 {
8488
8766
  }
8489
8767
  }
8490
8768
  stringify() {
8491
- if (this.error) throw this.error;
8492
- if (this.stringified) return this.result;
8769
+ if (this.error)
8770
+ throw this.error;
8771
+ if (this.stringified)
8772
+ return this.result;
8493
8773
  this.stringified = true;
8494
8774
  this.sync();
8495
8775
  let opts = this.result.opts;
8496
8776
  let str = stringify$2;
8497
- if (opts.syntax) str = opts.syntax.stringify;
8498
- if (opts.stringifier) str = opts.stringifier;
8499
- if (str.stringify) str = str.stringify;
8777
+ if (opts.syntax)
8778
+ str = opts.syntax.stringify;
8779
+ if (opts.stringifier)
8780
+ str = opts.stringifier;
8781
+ if (str.stringify)
8782
+ str = str.stringify;
8500
8783
  let map = new MapGenerator$1(str, this.result.root, this.result.opts);
8501
8784
  let data = map.generate();
8502
8785
  this.result.css = data[0];
@@ -8504,8 +8787,10 @@ let LazyResult$2 = class LazyResult2 {
8504
8787
  return this.result;
8505
8788
  }
8506
8789
  sync() {
8507
- if (this.error) throw this.error;
8508
- if (this.processed) return this.result;
8790
+ if (this.error)
8791
+ throw this.error;
8792
+ if (this.processed)
8793
+ return this.result;
8509
8794
  this.processed = true;
8510
8795
  if (this.processing) {
8511
8796
  throw this.getAsyncError();
@@ -8624,13 +8909,15 @@ let LazyResult$2 = class LazyResult2 {
8624
8909
  if (event === CHILDREN) {
8625
8910
  if (node2.nodes) {
8626
8911
  node2.each((child) => {
8627
- if (!child[isClean]) this.walkSync(child);
8912
+ if (!child[isClean])
8913
+ this.walkSync(child);
8628
8914
  });
8629
8915
  }
8630
8916
  } else {
8631
8917
  let visitors = this.listeners[event];
8632
8918
  if (visitors) {
8633
- if (this.visitSync(visitors, node2.toProxy())) return;
8919
+ if (this.visitSync(visitors, node2.toProxy()))
8920
+ return;
8634
8921
  }
8635
8922
  }
8636
8923
  }
@@ -8708,7 +8995,8 @@ let NoWorkResult$1 = class NoWorkResult2 {
8708
8995
  }
8709
8996
  }
8710
8997
  async() {
8711
- if (this.error) return Promise.reject(this.error);
8998
+ if (this.error)
8999
+ return Promise.reject(this.error);
8712
9000
  return Promise.resolve(this.result);
8713
9001
  }
8714
9002
  catch(onRejected) {
@@ -8718,7 +9006,8 @@ let NoWorkResult$1 = class NoWorkResult2 {
8718
9006
  return this.async().then(onFinally, onFinally);
8719
9007
  }
8720
9008
  sync() {
8721
- if (this.error) throw this.error;
9009
+ if (this.error)
9010
+ throw this.error;
8722
9011
  return this.result;
8723
9012
  }
8724
9013
  then(onFulfilled, onRejected) {
@@ -8838,7 +9127,8 @@ let Input$1 = input;
8838
9127
  let Root$1 = root;
8839
9128
  let Rule$1 = rule;
8840
9129
  function fromJSON$1(json, inputs) {
8841
- if (Array.isArray(json)) return json.map((n2) => fromJSON$1(n2));
9130
+ if (Array.isArray(json))
9131
+ return json.map((n2) => fromJSON$1(n2));
8842
9132
  let _a2 = json, { inputs: ownInputs } = _a2, defaults = __objRest(_a2, ["inputs"]);
8843
9133
  if (ownInputs) {
8844
9134
  inputs = [];
@@ -8924,7 +9214,8 @@ postcss.plugin = function plugin2(name, initializer) {
8924
9214
  let cache;
8925
9215
  Object.defineProperty(creator, "postcss", {
8926
9216
  get() {
8927
- if (!cache) cache = creator();
9217
+ if (!cache)
9218
+ cache = creator();
8928
9219
  return cache;
8929
9220
  }
8930
9221
  });
@@ -9010,11 +9301,15 @@ class BaseRRNode {
9010
9301
  return childNodes2;
9011
9302
  }
9012
9303
  contains(node2) {
9013
- if (!(node2 instanceof BaseRRNode)) return false;
9014
- else if (node2.ownerDocument !== this.ownerDocument) return false;
9015
- else if (node2 === this) return true;
9304
+ if (!(node2 instanceof BaseRRNode))
9305
+ return false;
9306
+ else if (node2.ownerDocument !== this.ownerDocument)
9307
+ return false;
9308
+ else if (node2 === this)
9309
+ return true;
9016
9310
  while (node2.parentNode) {
9017
- if (node2.parentNode === this) return true;
9311
+ if (node2.parentNode === this)
9312
+ return true;
9018
9313
  node2 = node2.parentNode;
9019
9314
  }
9020
9315
  return false;
@@ -9092,10 +9387,12 @@ function getUntaintedPrototype(key) {
9092
9387
  const iframeEl = document.createElement("iframe");
9093
9388
  document.body.appendChild(iframeEl);
9094
9389
  const win = iframeEl.contentWindow;
9095
- if (!win) return defaultObj.prototype;
9390
+ if (!win)
9391
+ return defaultObj.prototype;
9096
9392
  const untaintedObject = win[key].prototype;
9097
9393
  document.body.removeChild(iframeEl);
9098
- if (!untaintedObject) return defaultPrototype;
9394
+ if (!untaintedObject)
9395
+ return defaultPrototype;
9099
9396
  return untaintedBasePrototype[key] = untaintedObject;
9100
9397
  } catch (e) {
9101
9398
  return defaultPrototype;
@@ -9114,7 +9411,8 @@ function getUntaintedAccessor(key, instance, accessor) {
9114
9411
  untaintedPrototype,
9115
9412
  accessor
9116
9413
  )) == null ? void 0 : _a2.get;
9117
- if (!untaintedAccessor) return instance[accessor];
9414
+ if (!untaintedAccessor)
9415
+ return instance[accessor];
9118
9416
  untaintedAccessorCache[cacheKey] = untaintedAccessor;
9119
9417
  return untaintedAccessor.call(instance);
9120
9418
  }
@@ -9127,7 +9425,8 @@ function getUntaintedMethod(key, instance, method) {
9127
9425
  );
9128
9426
  const untaintedPrototype = getUntaintedPrototype(key);
9129
9427
  const untaintedMethod = untaintedPrototype[method];
9130
- if (typeof untaintedMethod !== "function") return instance[method];
9428
+ if (typeof untaintedMethod !== "function")
9429
+ return instance[method];
9131
9430
  untaintedMethodCache[cacheKey] = untaintedMethod;
9132
9431
  return untaintedMethod.bind(instance);
9133
9432
  }
@@ -9150,14 +9449,16 @@ function getRootNode(n2) {
9150
9449
  return getUntaintedMethod("Node", n2, "getRootNode")();
9151
9450
  }
9152
9451
  function host(n2) {
9153
- if (!n2 || !("host" in n2)) return null;
9452
+ if (!n2 || !("host" in n2))
9453
+ return null;
9154
9454
  return getUntaintedAccessor("ShadowRoot", n2, "host");
9155
9455
  }
9156
9456
  function styleSheets(n2) {
9157
9457
  return n2.styleSheets;
9158
9458
  }
9159
9459
  function shadowRoot(n2) {
9160
- if (!n2 || !("shadowRoot" in n2)) return null;
9460
+ if (!n2 || !("shadowRoot" in n2))
9461
+ return null;
9161
9462
  return getUntaintedAccessor("Element", n2, "shadowRoot");
9162
9463
  }
9163
9464
  function querySelector(n2, selectors) {
@@ -9365,16 +9666,21 @@ function isBlocked(node2, blockClass, blockSelector, checkAncestors) {
9365
9666
  }
9366
9667
  try {
9367
9668
  if (typeof blockClass === "string") {
9368
- if (el.classList.contains(blockClass)) return true;
9369
- if (checkAncestors && el.closest("." + blockClass) !== null) return true;
9669
+ if (el.classList.contains(blockClass))
9670
+ return true;
9671
+ if (checkAncestors && el.closest("." + blockClass) !== null)
9672
+ return true;
9370
9673
  } else {
9371
- if (classMatchesRegex(el, blockClass, checkAncestors)) return true;
9674
+ if (classMatchesRegex(el, blockClass, checkAncestors))
9675
+ return true;
9372
9676
  }
9373
9677
  } catch (e2) {
9374
9678
  }
9375
9679
  if (blockSelector) {
9376
- if (el.matches(blockSelector)) return true;
9377
- if (checkAncestors && el.closest(blockSelector) !== null) return true;
9680
+ if (el.matches(blockSelector))
9681
+ return true;
9682
+ if (checkAncestors && el.closest(blockSelector) !== null)
9683
+ return true;
9378
9684
  }
9379
9685
  return false;
9380
9686
  }
@@ -9424,7 +9730,8 @@ function isSerializedStylesheet(n2, mirror2) {
9424
9730
  );
9425
9731
  }
9426
9732
  function hasShadowRoot(n2) {
9427
- if (!n2) return false;
9733
+ if (!n2)
9734
+ return false;
9428
9735
  if (n2 instanceof BaseRRNode && "shadowRoot" in n2) {
9429
9736
  return Boolean(n2.shadowRoot);
9430
9737
  }
@@ -9447,11 +9754,13 @@ class StyleSheetMirror {
9447
9754
  * @returns If the stylesheet is in the mirror, returns the id of the stylesheet. If not, return the new assigned id.
9448
9755
  */
9449
9756
  add(stylesheet, id) {
9450
- if (this.has(stylesheet)) return this.getId(stylesheet);
9757
+ if (this.has(stylesheet))
9758
+ return this.getId(stylesheet);
9451
9759
  let newId;
9452
9760
  if (id === void 0) {
9453
9761
  newId = this.id++;
9454
- } else newId = id;
9762
+ } else
9763
+ newId = id;
9455
9764
  this.styleIDMap.set(stylesheet, newId);
9456
9765
  this.idStyleMap.set(newId, stylesheet);
9457
9766
  return newId;
@@ -9484,13 +9793,15 @@ function getRootShadowHost(n2) {
9484
9793
  }
9485
9794
  function shadowHostInDom(n2) {
9486
9795
  const doc = n2.ownerDocument;
9487
- if (!doc) return false;
9796
+ if (!doc)
9797
+ return false;
9488
9798
  const shadowHost = getRootShadowHost(n2);
9489
9799
  return index.contains(doc, shadowHost);
9490
9800
  }
9491
9801
  function inDom(n2) {
9492
9802
  const doc = n2.ownerDocument;
9493
- if (!doc) return false;
9803
+ if (!doc)
9804
+ return false;
9494
9805
  return index.contains(doc, n2) || shadowHostInDom(n2);
9495
9806
  }
9496
9807
  var EventType = /* @__PURE__ */ ((EventType2) => {
@@ -9811,7 +10122,8 @@ class MutationBuffer {
9811
10122
  if (_node) {
9812
10123
  const parentId = this.mirror.getId(index.parentNode(_node.value));
9813
10124
  const nextId = getNextId(_node.value);
9814
- if (nextId === -1) continue;
10125
+ if (nextId === -1)
10126
+ continue;
9815
10127
  else if (parentId !== -1) {
9816
10128
  node2 = _node;
9817
10129
  break;
@@ -10120,8 +10432,10 @@ class MutationBuffer {
10120
10432
  if (this.addedSet.has(n2)) {
10121
10433
  deepDelete(this.addedSet, n2);
10122
10434
  this.droppedSet.add(n2);
10123
- } else if (this.addedSet.has(m.target) && nodeId === -1) ;
10124
- else if (isAncestorRemoved(m.target, this.mirror)) ;
10435
+ } else if (this.addedSet.has(m.target) && nodeId === -1)
10436
+ ;
10437
+ else if (isAncestorRemoved(m.target, this.mirror))
10438
+ ;
10125
10439
  else if (this.movedSet.has(n2) && this.movedMap[moveKey(nodeId, parentId)]) {
10126
10440
  deepDelete(this.movedSet, n2);
10127
10441
  } else {
@@ -10139,8 +10453,10 @@ class MutationBuffer {
10139
10453
  }
10140
10454
  });
10141
10455
  __publicField(this, "genAdds", (n2, target) => {
10142
- if (this.processedNodeManager.inOtherBuffer(n2, this)) return;
10143
- if (this.addedSet.has(n2) || this.movedSet.has(n2)) return;
10456
+ if (this.processedNodeManager.inOtherBuffer(n2, this))
10457
+ return;
10458
+ if (this.addedSet.has(n2) || this.movedSet.has(n2))
10459
+ return;
10144
10460
  if (this.mirror.hasNode(n2)) {
10145
10461
  if (isIgnored(n2, this.mirror, this.slimDOMOptions)) {
10146
10462
  return;
@@ -10236,23 +10552,27 @@ function processRemoves(n2, cache) {
10236
10552
  const queue = [n2];
10237
10553
  while (queue.length) {
10238
10554
  const next = queue.pop();
10239
- if (cache.has(next)) continue;
10555
+ if (cache.has(next))
10556
+ continue;
10240
10557
  cache.add(next);
10241
10558
  index.childNodes(next).forEach((n22) => queue.push(n22));
10242
10559
  }
10243
10560
  return;
10244
10561
  }
10245
10562
  function isParentRemoved(removes, n2, mirror2) {
10246
- if (removes.size === 0) return false;
10563
+ if (removes.size === 0)
10564
+ return false;
10247
10565
  return _isParentRemoved(removes, n2);
10248
10566
  }
10249
10567
  function _isParentRemoved(removes, n2, _mirror2) {
10250
10568
  const node2 = index.parentNode(n2);
10251
- if (!node2) return false;
10569
+ if (!node2)
10570
+ return false;
10252
10571
  return removes.has(node2);
10253
10572
  }
10254
10573
  function isAncestorInSet(set, n2) {
10255
- if (set.size === 0) return false;
10574
+ if (set.size === 0)
10575
+ return false;
10256
10576
  return _isAncestorInSet(set, n2);
10257
10577
  }
10258
10578
  function _isAncestorInSet(set, n2) {
@@ -10426,7 +10746,8 @@ function initMouseInteractionObserver({
10426
10746
  } else if (MouseInteractions[eventKey] === MouseInteractions.MouseUp) {
10427
10747
  thisEventKey = "TouchEnd";
10428
10748
  }
10429
- } else if (pointerType === PointerTypes.Pen) ;
10749
+ } else if (pointerType === PointerTypes.Pen)
10750
+ ;
10430
10751
  } else if (legacy_isTouchEvent(event)) {
10431
10752
  pointerType = PointerTypes.Touch;
10432
10753
  }
@@ -10688,9 +11009,12 @@ function getNestedCSSRulePositions(rule2) {
10688
11009
  }
10689
11010
  function getIdAndStyleId(sheet, mirror2, styleMirror) {
10690
11011
  let id, styleId;
10691
- if (!sheet) return {};
10692
- if (sheet.ownerNode) id = mirror2.getId(sheet.ownerNode);
10693
- else styleId = styleMirror.getId(sheet);
11012
+ if (!sheet)
11013
+ return {};
11014
+ if (sheet.ownerNode)
11015
+ id = mirror2.getId(sheet.ownerNode);
11016
+ else
11017
+ styleId = styleMirror.getId(sheet);
10694
11018
  return {
10695
11019
  styleId,
10696
11020
  id
@@ -10895,8 +11219,10 @@ function initAdoptedStyleSheetObserver({
10895
11219
  }, host2) {
10896
11220
  var _a2, _b, _c;
10897
11221
  let hostId = null;
10898
- if (host2.nodeName === "#document") hostId = mirror2.getId(host2);
10899
- else hostId = mirror2.getId(index.host(host2));
11222
+ if (host2.nodeName === "#document")
11223
+ hostId = mirror2.getId(host2);
11224
+ else
11225
+ hostId = mirror2.getId(index.host(host2));
10900
11226
  const patchTarget = host2.nodeName === "#document" ? (_a2 = host2.defaultView) == null ? void 0 : _a2.Document : (_c = (_b = host2.ownerDocument) == null ? void 0 : _b.defaultView) == null ? void 0 : _c.ShadowRoot;
10901
11227
  const originalPropertyDescriptor = (patchTarget == null ? void 0 : patchTarget.prototype) ? Object.getOwnPropertyDescriptor(
10902
11228
  patchTarget == null ? void 0 : patchTarget.prototype,
@@ -11097,7 +11423,8 @@ function initSelectionObserver(param) {
11097
11423
  let collapsed = true;
11098
11424
  const updateSelection = callbackWrapper(() => {
11099
11425
  const selection = doc.getSelection();
11100
- if (!selection || collapsed && (selection == null ? void 0 : selection.isCollapsed)) return;
11426
+ if (!selection || collapsed && (selection == null ? void 0 : selection.isCollapsed))
11427
+ return;
11101
11428
  collapsed = selection.isCollapsed || false;
11102
11429
  const ranges = [];
11103
11430
  const count = selection.rangeCount || 0;
@@ -11105,7 +11432,8 @@ function initSelectionObserver(param) {
11105
11432
  const range = selection.getRangeAt(i2);
11106
11433
  const { startContainer, startOffset, endContainer, endOffset } = range;
11107
11434
  const blocked = isBlocked(startContainer, blockClass, blockSelector, true) || isBlocked(endContainer, blockClass, blockSelector, true);
11108
- if (blocked) continue;
11435
+ if (blocked)
11436
+ continue;
11109
11437
  ranges.push({
11110
11438
  start: mirror2.getId(startContainer),
11111
11439
  startOffset,
@@ -11123,8 +11451,9 @@ function initCustomElementObserver({
11123
11451
  customElementCb
11124
11452
  }) {
11125
11453
  const win = doc.defaultView;
11126
- if (!win || !win.customElements) return () => {
11127
- };
11454
+ if (!win || !win.customElements)
11455
+ return () => {
11456
+ };
11128
11457
  const restoreHandler = patch(
11129
11458
  win.customElements,
11130
11459
  "define",
@@ -11346,9 +11675,11 @@ class CrossOriginIframeMirror {
11346
11675
  }
11347
11676
  getRemoteId(iframe, id, map) {
11348
11677
  const remoteIdToIdMap = map || this.getRemoteIdToIdMap(iframe);
11349
- if (typeof id !== "number") return id;
11678
+ if (typeof id !== "number")
11679
+ return id;
11350
11680
  const remoteId = remoteIdToIdMap.get(id);
11351
- if (!remoteId) return -1;
11681
+ if (!remoteId)
11682
+ return -1;
11352
11683
  return remoteId;
11353
11684
  }
11354
11685
  getRemoteIds(iframe, ids) {
@@ -11449,9 +11780,11 @@ class IframeManager {
11449
11780
  crossOriginMessageEvent.origin !== crossOriginMessageEvent.data.origin)
11450
11781
  return;
11451
11782
  const iframeSourceWindow = message.source;
11452
- if (!iframeSourceWindow) return;
11783
+ if (!iframeSourceWindow)
11784
+ return;
11453
11785
  const iframeEl = this.crossOriginIframeMap.get(message.source);
11454
- if (!iframeEl) return;
11786
+ if (!iframeEl)
11787
+ return;
11455
11788
  const transformedEvent = this.transformCrossOriginEvent(
11456
11789
  iframeEl,
11457
11790
  crossOriginMessageEvent.data.event
@@ -11580,7 +11913,8 @@ class IframeManager {
11580
11913
  }
11581
11914
  replace(iframeMirror, obj, iframeEl, keys) {
11582
11915
  for (const key of keys) {
11583
- if (!Array.isArray(obj[key]) && typeof obj[key] !== "number") continue;
11916
+ if (!Array.isArray(obj[key]) && typeof obj[key] !== "number")
11917
+ continue;
11584
11918
  if (Array.isArray(obj[key])) {
11585
11919
  obj[key] = iframeMirror.getIds(
11586
11920
  iframeEl,
@@ -11607,7 +11941,8 @@ class IframeManager {
11607
11941
  }
11608
11942
  }
11609
11943
  patchRootIdOnNode(node2, rootId) {
11610
- if (node2.type !== NodeType.Document && !node2.rootId) node2.rootId = rootId;
11944
+ if (node2.type !== NodeType.Document && !node2.rootId)
11945
+ node2.rootId = rootId;
11611
11946
  if ("childNodes" in node2) {
11612
11947
  node2.childNodes.forEach((child) => {
11613
11948
  this.patchRootIdOnNode(child, rootId);
@@ -11634,8 +11969,10 @@ class ShadowDomManager {
11634
11969
  this.patchAttachShadow(Element, document);
11635
11970
  }
11636
11971
  addShadowRoot(shadowRoot2, doc) {
11637
- if (!isNativeShadowDom(shadowRoot2)) return;
11638
- if (this.shadowDoms.has(shadowRoot2)) return;
11972
+ if (!isNativeShadowDom(shadowRoot2))
11973
+ return;
11974
+ if (this.shadowDoms.has(shadowRoot2))
11975
+ return;
11639
11976
  this.shadowDoms.add(shadowRoot2);
11640
11977
  const observer = initMutationObserver(
11641
11978
  __spreadProps(__spreadValues({}, this.bypassOptions), {
@@ -11677,7 +12014,8 @@ class ShadowDomManager {
11677
12014
  * Monkey patch 'attachShadow' of an IFrameElement to observe newly added shadow doms.
11678
12015
  */
11679
12016
  observeAttachShadow(iframeElement) {
11680
- if (!iframeElement.contentWindow || !iframeElement.contentDocument) return;
12017
+ if (!iframeElement.contentWindow || !iframeElement.contentDocument)
12018
+ return;
11681
12019
  this.patchAttachShadow(
11682
12020
  iframeElement.contentWindow.Element,
11683
12021
  iframeElement.contentDocument
@@ -11914,7 +12252,8 @@ function initCanvasContextObserver(win, blockClass, blockSelector, setPreserveDr
11914
12252
  return function(contextType, ...args) {
11915
12253
  if (!isBlocked(this, blockClass, blockSelector, true)) {
11916
12254
  const ctxName = getNormalizedContextName(contextType);
11917
- if (!("__context" in this)) this.__context = ctxName;
12255
+ if (!("__context" in this))
12256
+ this.__context = ctxName;
11918
12257
  if (setPreserveDrawingBufferToTrue && ["webgl", "webgl2"].includes(ctxName)) {
11919
12258
  if (args[0] && typeof args[0] === "object") {
11920
12259
  const contextAttributes = args[0];
@@ -12031,7 +12370,8 @@ function WorkerWrapper(options) {
12031
12370
  let objURL;
12032
12371
  try {
12033
12372
  objURL = blob && (window.URL || window.webkitURL).createObjectURL(blob);
12034
- if (!objURL) throw "";
12373
+ if (!objURL)
12374
+ throw "";
12035
12375
  const worker = new Worker(objURL, {
12036
12376
  name: options == null ? void 0 : options.name
12037
12377
  });
@@ -12113,7 +12453,8 @@ class CanvasManager {
12113
12453
  worker.onmessage = (e2) => {
12114
12454
  const { id } = e2.data;
12115
12455
  snapshotInProgressMap.set(id, false);
12116
- if (!("base64" in e2.data)) return;
12456
+ if (!("base64" in e2.data))
12457
+ return;
12117
12458
  const { base64, type, width, height } = e2.data;
12118
12459
  this.mutationCb({
12119
12460
  id,
@@ -12166,8 +12507,10 @@ class CanvasManager {
12166
12507
  getCanvas().forEach(async (canvas) => {
12167
12508
  var _a2;
12168
12509
  const id = this.mirror.getId(canvas);
12169
- if (snapshotInProgressMap.get(id)) return;
12170
- if (canvas.width === 0 || canvas.height === 0) return;
12510
+ if (snapshotInProgressMap.get(id))
12511
+ return;
12512
+ if (canvas.width === 0 || canvas.height === 0)
12513
+ return;
12171
12514
  snapshotInProgressMap.set(id, true);
12172
12515
  if (["webgl", "webgl2"].includes(canvas.__context)) {
12173
12516
  const context = canvas.getContext(canvas.__context);
@@ -12246,7 +12589,8 @@ class CanvasManager {
12246
12589
  return;
12247
12590
  }
12248
12591
  const valuesWithType = this.pendingCanvasMutations.get(canvas);
12249
- if (!valuesWithType || id === -1) return;
12592
+ if (!valuesWithType || id === -1)
12593
+ return;
12250
12594
  const values = valuesWithType.map((value) => {
12251
12595
  const _a2 = value, { type: type2 } = _a2, rest = __objRest(_a2, ["type"]);
12252
12596
  return rest;
@@ -12281,12 +12625,14 @@ class StylesheetManager {
12281
12625
  this.trackLinkElement(linkEl);
12282
12626
  }
12283
12627
  trackLinkElement(linkEl) {
12284
- if (this.trackedLinkElements.has(linkEl)) return;
12628
+ if (this.trackedLinkElements.has(linkEl))
12629
+ return;
12285
12630
  this.trackedLinkElements.add(linkEl);
12286
12631
  this.trackStylesheetInLinkElement(linkEl);
12287
12632
  }
12288
12633
  adoptStyleSheets(sheets, hostId) {
12289
- if (sheets.length === 0) return;
12634
+ if (sheets.length === 0)
12635
+ return;
12290
12636
  const adoptedStyleSheetData = {
12291
12637
  id: hostId,
12292
12638
  styleIds: []
@@ -12303,10 +12649,12 @@ class StylesheetManager {
12303
12649
  index: index2
12304
12650
  }))
12305
12651
  });
12306
- } else styleId = this.styleMirror.getId(sheet);
12652
+ } else
12653
+ styleId = this.styleMirror.getId(sheet);
12307
12654
  adoptedStyleSheetData.styleIds.push(styleId);
12308
12655
  }
12309
- if (styles.length > 0) adoptedStyleSheetData.styles = styles;
12656
+ if (styles.length > 0)
12657
+ adoptedStyleSheetData.styles = styles;
12310
12658
  this.adoptedStyleSheetCb(adoptedStyleSheetData);
12311
12659
  }
12312
12660
  reset() {
@@ -12485,7 +12833,8 @@ class VisibilityManager {
12485
12833
  this.startPendingFlushLoop();
12486
12834
  }
12487
12835
  startPendingFlushLoop() {
12488
- if (this.disabled) return;
12836
+ if (this.disabled)
12837
+ return;
12489
12838
  const loop = (timestamp) => {
12490
12839
  if (timestamp - this.lastFlushTime >= this.rafThrottle) {
12491
12840
  this.lastFlushTime = timestamp;
@@ -12496,8 +12845,10 @@ class VisibilityManager {
12496
12845
  this.rafId = requestAnimationFrame(loop);
12497
12846
  }
12498
12847
  flushPendingVisibilityMutations() {
12499
- if (this.disabled) return;
12500
- if (this.frozen || this.locked || this.elements.size === 0) return;
12848
+ if (this.disabled)
12849
+ return;
12850
+ if (this.frozen || this.locked || this.elements.size === 0)
12851
+ return;
12501
12852
  const state = computeVisibility(this.elements, this.previousState, {
12502
12853
  root: this.root,
12503
12854
  threshold: this.threshold,
@@ -12543,17 +12894,20 @@ class VisibilityManager {
12543
12894
  }
12544
12895
  flushBuffer() {
12545
12896
  var _a2;
12546
- if (this.buffer.size === 0) return;
12897
+ if (this.buffer.size === 0)
12898
+ return;
12547
12899
  (_a2 = this.notifyActivity) == null ? void 0 : _a2.call(this, this.buffer.size);
12548
12900
  this.mutationCb({ mutations: Array.from(this.buffer.values()) });
12549
12901
  this.buffer.clear();
12550
12902
  }
12551
12903
  observe(el) {
12552
- if (this.disabled) return;
12904
+ if (this.disabled)
12905
+ return;
12553
12906
  this.elements.add(el);
12554
12907
  }
12555
12908
  unobserve(el) {
12556
- if (this.disabled) return;
12909
+ if (this.disabled)
12910
+ return;
12557
12911
  this.elements.delete(el);
12558
12912
  this.previousState.delete(el);
12559
12913
  this.pending.delete(el);
@@ -12574,7 +12928,8 @@ class VisibilityManager {
12574
12928
  this.elements.clear();
12575
12929
  this.previousState.clear();
12576
12930
  this.pending.clear();
12577
- if (this.rafId) cancelAnimationFrame(this.rafId);
12931
+ if (this.rafId)
12932
+ cancelAnimationFrame(this.rafId);
12578
12933
  }
12579
12934
  }
12580
12935
  let wrappedEmit;
@@ -12584,6 +12939,36 @@ let visibilityManager;
12584
12939
  let recording = false;
12585
12940
  const customEventQueue = [];
12586
12941
  let flushCustomEventQueue;
12942
+ function waitForDOMStabilization(win) {
12943
+ const maxWaitMs = 5e3;
12944
+ return new Promise((resolve2) => {
12945
+ const captureAfterPaint = () => {
12946
+ requestAnimationFrame(() => {
12947
+ requestAnimationFrame(() => {
12948
+ resolve2();
12949
+ });
12950
+ });
12951
+ };
12952
+ const safeResolve = /* @__PURE__ */ (() => {
12953
+ let called = false;
12954
+ return () => {
12955
+ if (!called) {
12956
+ called = true;
12957
+ captureAfterPaint();
12958
+ }
12959
+ };
12960
+ })();
12961
+ if (["interactive", "complete"].includes(win.document.readyState)) {
12962
+ safeResolve();
12963
+ } else {
12964
+ win.addEventListener("DOMContentLoaded", safeResolve, { once: true });
12965
+ win.addEventListener("load", safeResolve, { once: true });
12966
+ setTimeout(() => {
12967
+ safeResolve();
12968
+ }, maxWaitMs);
12969
+ }
12970
+ });
12971
+ }
12587
12972
  try {
12588
12973
  if (Array.from([1], (x2) => x2 * 2)[0] !== 2) {
12589
12974
  const cleanFrame = document.createElement("iframe");
@@ -13061,8 +13446,28 @@ function record(options = {}) {
13061
13446
  flushCustomEventQueue();
13062
13447
  }
13063
13448
  };
13449
+ const runInit = async () => {
13450
+ if (flushCustomEvent === "before") {
13451
+ flushCustomEventQueue();
13452
+ }
13453
+ if (recordAfter === "DOMContentStabilized") {
13454
+ console.log(\`[rrweb] \\u{1F7E2} Waiting for DOM stabilization...\`);
13455
+ await waitForDOMStabilization(window);
13456
+ console.log(\`[rrweb] \\u2705 DOM stabilized, starting recording\`);
13457
+ }
13458
+ takeFullSnapshot$1();
13459
+ handlers.push(observe(document));
13460
+ recording = true;
13461
+ if (flushCustomEvent === "after") {
13462
+ flushCustomEventQueue();
13463
+ }
13464
+ };
13064
13465
  if (document.readyState === "interactive" || document.readyState === "complete") {
13065
- init();
13466
+ if (recordAfter === "DOMContentStabilized") {
13467
+ void runInit();
13468
+ } else {
13469
+ init();
13470
+ }
13066
13471
  } else {
13067
13472
  handlers.push(
13068
13473
  on("DOMContentLoaded", () => {
@@ -13070,7 +13475,9 @@ function record(options = {}) {
13070
13475
  type: EventType.DomContentLoaded,
13071
13476
  data: {}
13072
13477
  });
13073
- if (recordAfter === "DOMContentLoaded") init();
13478
+ if (recordAfter === "DOMContentLoaded" || recordAfter === "DOMContentStabilized") {
13479
+ void runInit();
13480
+ }
13074
13481
  })
13075
13482
  );
13076
13483
  handlers.push(
@@ -13081,7 +13488,8 @@ function record(options = {}) {
13081
13488
  type: EventType.Load,
13082
13489
  data: {}
13083
13490
  });
13084
- if (recordAfter === "load") init();
13491
+ if (recordAfter === "load")
13492
+ void runInit();
13085
13493
  },
13086
13494
  window
13087
13495
  )
@@ -13098,6 +13506,7 @@ function record(options = {}) {
13098
13506
  console.warn(error);
13099
13507
  }
13100
13508
  }
13509
+ record.isRecording = () => recording;
13101
13510
  record.flushCustomEventQueue = () => {
13102
13511
  console.warn(\`[rrweb] CustomEvent flushing: \${customEventQueue.length} events\`);
13103
13512
  flushCustomEventQueue();
@@ -13150,22 +13559,5 @@ if (typeof module.exports == "object" && typeof exports == "object") {
13150
13559
  return module.exports;
13151
13560
  }))
13152
13561
  //# sourceMappingURL=rrweb-record.umd.cjs.map
13153
- `;class W{constructor(){d(this,"recordFn",null),d(this,"stopFn",null),d(this,"targetWindow",null),d(this,"context"),d(this,"eventCounter",0),d(this,"events",[]),d(this,"pendingEvents",[]),this.context={pushEvent:e=>this.events.push(e)}}handleEmit(e){if(e.type===0||e.type===1)return;const s=f({},e);this.context.pushEvent(s)}inject(e){var t;const s=e;if(this.targetWindow=e,s.rrweb){this.recordFn=(t=s.rrweb.record)!=null?t:null;return}const r=e.document.createElement("script");r.type="text/javascript",r.innerHTML=U,e.document.head.appendChild(r);const o=e.rrweb;if(!o||!o.record){console.error("\u{1F7E1} [rrweb] Failed to load rrweb.record");return}this.recordFn=o.record}start(){if(!this.targetWindow||!this.recordFn){console.warn("\u{1F7E1} [rrweb] Not ready to start");return}if(this.stopFn){console.warn("\u{1F7E1} [rrweb] Already recording");return}this.stopFn=this.recordFn({emit:e=>this.handleEmit(e),checkoutEveryNvm:10,plugins:[F({key:"id",getId:()=>++this.eventCounter})],maskInputOptions:{password:!0},slimDOMOptions:"all",inlineStylesheet:!0,sampling:{mousemove:!1,mouseInteraction:{MouseUp:!1,MouseDown:!1,Click:!0,ContextMenu:!0,DblClick:!0,Focus:!0,Blur:!0,TouchStart:!1,TouchEnd:!1},scroll:1e3,media:1e3,input:"last",canvas:"all",visibility:{mode:"debounce",debounce:100,threshold:.5,sensitivity:.05,rafThrottle:50}},recordDOM:!0,recordCanvas:!0,collectFonts:!0,inlineImages:!0,flushCustomEvent:"after",recordAfter:"DOMContentLoaded"}),this.flush()}stop(){var e;this.flush(),(e=this.stopFn)==null||e.call(this),this.stopFn=null}reset(){this.eventCounter=0,this.events=[],this.stop(),this.context={pushEvent:e=>this.events.push(e)}}flush(){if(!this.recordFn)return;const e=[];for(const s of this.pendingEvents)try{this.recordFn.addCustomEvent(s.tag,s.payload)}catch(r){console.warn(`[rrweb] flush failed for custom event: ${s.tag}`),e.push(s)}this.pendingEvents=e}addCustomEvent(e,s){const r={tag:e,payload:s};if(!this.recordFn||!this.stopFn){console.warn(`[rrweb] queued custom event (recorder not ready): ${e}`),this.pendingEvents.push(r);return}try{this.recordFn.addCustomEvent(e,s)}catch(o){console.warn(`[rrweb] error adding custom event: ${e}`,o),this.pendingEvents.push(r)}}isRecordingReady(){return!!this.recordFn&&!!this.stopFn}getEvents(){return this.events}getMirror(){var e;return(e=this.recordFn)==null?void 0:e.mirror}bind(e){this.context=e}setEventCounter(e){this.eventCounter=e}}const u=new W,z=()=>{Cypress.on("test:before:run",B).on("log:added",j).on("log:changed",V).on("window:before:load",K).on("window:before:unload",H).on("window:unload",G).on("window:load",Y).on("command:enqueued",Z).on("command:start",X).on("command:end",q).on("command:retry",J).on("skipped:command:end",nn).on("test:after:run",sn).on("command:failed",Q).on("command:queue:end",en).on("fail",tn),afterEach(()=>{const n=Cypress.currentTest;if(!n)return;const e=p({titlePath:()=>n.titlePath}),s=h(e);if(!s)return;s.recorderEvents.map(o=>{var a;if(o.type!==5)return o;const t=s.commandLiveRefs.get(o.data.payload.id);return o.data.payload.state=(a=t==null?void 0:t.state)!=null?a:"unknown",o.data.payload.args=m(t==null?void 0:t.get("args")),o.data.payload.query=t==null?void 0:t.get("query"),o.data.payload.timeout=t==null?void 0:t.get("timeout"),o.data.payload.name=t==null?void 0:t.get("name"),o.data.payload.type=t==null?void 0:t.get("type"),t!=null&&t.get("prev")&&(o.data.payload.prev={state:t==null?void 0:t.get("prev").state,name:t==null?void 0:t.get("prev").get("name"),args:m(t==null?void 0:t.get("prev").get("args")),type:t==null?void 0:t.get("prev").get("type"),query:t==null?void 0:t.get("prev").get("query"),id:t==null?void 0:t.get("prev").get("id")}),t!=null&&t.get("next")&&(o.data.payload.next={state:t==null?void 0:t.get("next").state,name:t==null?void 0:t.get("next").get("name"),args:m(t==null?void 0:t.get("next").get("args")),type:t==null?void 0:t.get("next").get("type"),query:t==null?void 0:t.get("next").get("query"),id:t==null?void 0:t.get("next").get("id")}),o}),console.debug(`\u{1F7E1} [${Date.now()}] [cypress] afterEach:`,s.recorderEvents);const r=A(s);cy.task("saveRRWebReport",r,{log:!1})}),Cypress.Commands.overwrite("type",(n,e,s,r)=>n(e,s,r).then(()=>{if(Cypress.dom.isElement(e[0])){const o=e[0];o&&(o.dispatchEvent(new Event("input",{bubbles:!0})),o.dispatchEvent(new Event("change",{bubbles:!0})))}}))},B=(n,e)=>{const s=p(e),r={spec:Cypress.spec,test:e,browser:Cypress.browser,autWindow:null,waitForPaint:()=>Promise.resolve(void 0),paintComplete:!1,recorderEvents:[],commandLiveRefs:new Map};R(s,r),u.bind({pushEvent:o=>{var t;if(console.debug(`\u{1F7E1} [${Date.now()}] [cypress] pushEvent`,o),r.recorderEvents.push(o),o.type===5){const a=r.commandLiveRefs.get(o.data.payload.id),i=a==null?void 0:a.get("subject"),l=(t=i==null?void 0:i.selector)!=null?t:M(i),c=u.getMirror(),k=c==null?void 0:c.getMeta(i==null?void 0:i[0]);o.data.payload.element=b(f({},k),{selector:l,childNodes:[]})}}})},j=(n,e)=>{},V=(n,e)=>{},H=n=>{},G=n=>{try{u.stop()}catch(e){}},K=n=>{u.inject(n);const e=Cypress.currentTest;if(!e)return;const s=p({titlePath:()=>e.titlePath}),r=h(s);r&&(r.autWindow=n,r.paintComplete=!1)},Y=n=>{u.inject(n);const e=Cypress.currentTest;if(!e)return;const s=p({titlePath:()=>e.titlePath}),r=h(s);r&&(r.autWindow||(r.autWindow=n,r.paintComplete=!1),r.waitForPaint=o=>new Promise(t=>{const i=()=>{requestAnimationFrame(()=>{requestAnimationFrame(()=>{t(o)})})},l=(()=>{let c=!1;return()=>{c||(c=!0,i())}})();["interactive","complete"].includes(n.document.readyState)?l():(n.addEventListener("DOMContentLoaded",l,{once:!0}),n.addEventListener("load",l,{once:!0}),setTimeout(()=>{console.warn("\u23F3 Timeout: forcing resolution"),l()},5e3))}),r.waitForPaint().then(async()=>{r.paintComplete=!0,u.start()}))},Z=n=>{},J=n=>{},X=n=>{const e=Cypress.currentTest;if(!e)return;const s=p({titlePath:()=>e.titlePath}),r=h(s);r&&r.commandLiveRefs.set(n.attributes.id,n)},q=n=>{console.debug(`\u{1F7E1} [${Date.now()}] [cypress] onCommandEnd`,n),u.addCustomEvent(`${n.attributes.name}`,{id:n.attributes.id})},Q=(n,e)=>{u.addCustomEvent(`${n.attributes.name}`,{id:n.attributes.id})},nn=n=>{},en=()=>{},tn=(n,e)=>{throw n},sn=async(n,e)=>{u.stop()},rn=()=>{Cypress.mocha.getRunner().on("hook",on)},on=()=>{},an=()=>{beforeEach("",()=>{}),afterEach("",()=>{})},ln=()=>{z(),rn(),an()},cn=()=>{ln()};exports.initializeTestmap=cn;
13154
- if (typeof module.exports == "object" && typeof exports == "object") {
13155
- var __cp = (to, from, except, desc) => {
13156
- if ((from && typeof from === "object") || typeof from === "function") {
13157
- for (let key of Object.getOwnPropertyNames(from)) {
13158
- if (!Object.prototype.hasOwnProperty.call(to, key) && key !== except)
13159
- Object.defineProperty(to, key, {
13160
- get: () => from[key],
13161
- enumerable: !(desc = Object.getOwnPropertyDescriptor(from, key)) || desc.enumerable,
13162
- });
13163
- }
13164
- }
13165
- return to;
13166
- };
13167
- module.exports = __cp(module.exports, exports);
13168
- }
13169
- return module.exports;
13170
- }))
13171
- //# sourceMappingURL=rrweb-cypress-plugin.umd.min.cjs.map
13562
+ `;var h=class{recordFn=null;stopFn=null;targetWindow=null;context;eventCounter=0;events=[];pendingEvents=[];constructor(){this.context={pushEvent:t=>this.events.push(t)}}handleEmit(t){if(t.type===0||t.type===1)return;let s={...t};this.context.pushEvent(s)}inject(t){let s=t;if(this.targetWindow=t,s.rrweb){this.recordFn=s.rrweb.record??null;return}let n=t.document.createElement("script");n.type="text/javascript",n.innerHTML=w,t.document.head.appendChild(n);let r=t.rrweb;if(!r||!r.record){console.error("\u{1F7E1} [rrweb] Failed to load rrweb.record");return}this.recordFn=r.record}start(){if(!this.targetWindow||!this.recordFn){console.warn("\u{1F7E1} [rrweb] Not ready to start");return}if(this.stopFn){console.warn("\u{1F7E1} [rrweb] Already recording");return}this.stopFn=this.recordFn({emit:t=>this.handleEmit(t),checkoutEveryNvm:10,plugins:[T({key:"id",getId:()=>++this.eventCounter})],maskInputOptions:{password:!0},slimDOMOptions:"all",inlineStylesheet:!0,sampling:{mousemove:!1,mouseInteraction:{MouseUp:!1,MouseDown:!1,Click:!0,ContextMenu:!0,DblClick:!0,Focus:!0,Blur:!0,TouchStart:!1,TouchEnd:!1},scroll:100,media:100,input:"last",canvas:"all",visibility:{mode:"debounce",debounce:50,threshold:.5,sensitivity:.05,rafThrottle:50}},recordDOM:!0,recordCanvas:!0,collectFonts:!0,inlineImages:!0,flushCustomEvent:"after",recordAfter:"DOMContentLoaded"}),this.flush()}stop(){this.flush(),this.stopFn?.(),this.stopFn=null}reset(){this.eventCounter=0,this.events=[],this.stop(),this.context={pushEvent:t=>this.events.push(t)}}flush(){if(!this.recordFn)return;let t=[];for(let s of this.pendingEvents)try{this.recordFn.addCustomEvent(s.tag,s.payload)}catch{console.warn(`[rrweb] flush failed for custom event: ${s.tag}`),t.push(s)}this.pendingEvents=t}addCustomEvent(t,s){let n={tag:t,payload:s};if(!this.recordFn||!this.stopFn){console.warn(`[rrweb] queued custom event (recorder not ready): ${t}`),this.pendingEvents.push(n);return}try{this.recordFn.addCustomEvent(t,s)}catch(r){console.warn(`[rrweb] error adding custom event: ${t}`,r),this.pendingEvents.push(n)}}isRecordingReady(){return!!this.recordFn&&!!this.stopFn}getEvents(){return this.events}getMirror(){return this.recordFn?.mirror}bind(t){this.context=t}setEventCounter(t){this.eventCounter=t}};var k=h;var i=new k,S=()=>{Cypress.on("test:before:run",N).on("log:added",A).on("log:changed",O).on("window:before:load",D).on("window:before:unload",P).on("window:unload",L).on("window:load",F).on("command:enqueued",U).on("command:start",z).on("command:end",B).on("command:retry",W).on("skipped:command:end",V).on("test:after:run",K).on("command:failed",j).on("command:queue:end",H).on("fail",G),afterEach(()=>{let e=Cypress.currentTest;if(!e)return;let t=a({titlePath:()=>e.titlePath}),s=c(t);if(!s)return;s.recorderEvents.map(r=>{if(r.type!==5)return r;let o=s.commandLiveRefs.get(r.data.payload.id);return r.data.payload.state=o?.state??"unknown",r.data.payload.args=p(o?.get("args")),r.data.payload.query=o?.get("query"),r.data.payload.timeout=o?.get("timeout"),r.data.payload.name=o?.get("name"),r.data.payload.type=o?.get("type"),o?.get("prev")&&(r.data.payload.prev={state:o?.get("prev").state,name:o?.get("prev").get("name"),args:p(o?.get("prev").get("args")),type:o?.get("prev").get("type"),query:o?.get("prev").get("query"),id:o?.get("prev").get("id")}),o?.get("next")&&(r.data.payload.next={state:o?.get("next").state,name:o?.get("next").get("name"),args:p(o?.get("next").get("args")),type:o?.get("next").get("type"),query:o?.get("next").get("query"),id:o?.get("next").get("id")}),r}),console.debug(`\u{1F7E1} [${Date.now()}] [cypress] afterEach:`,s.recorderEvents);let n=v(s);try{cy.task("saveRRWebReport",n,{log:!1})}catch(r){console.error(`\u{1F7E1} [${Date.now()}] [cypress] afterEach:saveRRWebReport`,r)}})},N=(e,t)=>{let s=a(t),n={spec:Cypress.spec,test:t,browser:Cypress.browser,autWindow:null,waitForPaint:()=>Promise.resolve(void 0),paintComplete:!1,recorderEvents:[],commandLiveRefs:new Map};g(s,n),i.bind({pushEvent:r=>{if(console.debug(`\u{1F7E1} [${Date.now()}] [cypress] pushEvent`,r),n.recorderEvents.push(r),r.type===5){let u=n.commandLiveRefs.get(r.data.payload.id)?.get("subject"),f=u?.selector??y(u),d=i.getMirror()?.getMeta(u?.[0]);r.data.payload.element={...d,selector:f,childNodes:[]}}}})},A=(e,t)=>{},O=(e,t)=>{},P=e=>{},L=e=>{try{i.stop()}catch{}},D=e=>{i.inject(e);let t=Cypress.currentTest;if(!t)return;let s=a({titlePath:()=>t.titlePath}),n=c(s);n&&(n.autWindow=e,n.paintComplete=!1)},F=e=>{i.inject(e),i.start();let t=Cypress.currentTest;if(!t)return;let s=a({titlePath:()=>t.titlePath}),n=c(s);n&&(n.autWindow||(n.autWindow=e,n.paintComplete=!1),n.waitForPaint=r=>new Promise(o=>{let f=()=>{requestAnimationFrame(()=>{requestAnimationFrame(()=>{o(r)})})},l=(()=>{let d=!1;return()=>{d||(d=!0,f())}})();["interactive","complete"].includes(e.document.readyState)?l():(e.addEventListener("DOMContentLoaded",l,{once:!0}),e.addEventListener("load",l,{once:!0}),setTimeout(()=>{console.warn("\u23F3 Timeout: forcing resolution"),l()},5e3))}),n.waitForPaint().then(async()=>{n.paintComplete=!0}))},U=e=>{},W=e=>{},z=e=>{let t=Cypress.currentTest;if(!t)return;let s=a({titlePath:()=>t.titlePath}),n=c(s);n&&n.commandLiveRefs.set(e.attributes.id,e)},B=e=>{console.debug(`\u{1F7E1} [${Date.now()}] [cypress] onCommandEnd`,e),i.addCustomEvent(`${e.attributes.name}`,{id:e.attributes.id})},j=(e,t)=>{i.addCustomEvent(`${e.attributes.name}`,{id:e.attributes.id})},V=e=>{},H=()=>{},G=(e,t)=>{throw e},K=async(e,t)=>{i.stop()};var x=()=>{Cypress.mocha.getRunner().on("hook",Y)},Y=()=>{},$=()=>{beforeEach("",()=>{}),afterEach("",()=>{})};var C=()=>{S(),x(),$()};var Z=()=>{C()};export{Z as initializeTestmap};
13563
+ //# sourceMappingURL=index.mjs.map