css-has-pseudo 3.0.0 → 3.0.4
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +20 -0
- package/README.md +2 -3
- package/browser.js +1 -116
- package/dist/browser-global.js +1 -116
- package/dist/browser-global.js.map +1 -1
- package/dist/browser.cjs +1 -111
- package/dist/browser.cjs.map +1 -1
- package/dist/browser.mjs +2 -0
- package/dist/browser.mjs.map +1 -0
- package/dist/cli.cjs +3 -0
- package/dist/index.cjs +1 -2
- package/dist/index.mjs +1 -2
- package/package.json +12 -7
- package/dist/cli.mjs +0 -3
- package/dist/index.cjs.map +0 -1
- package/dist/index.mjs.map +0 -1
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,25 @@
|
|
|
1
1
|
# Changes to CSS Has Pseudo
|
|
2
2
|
|
|
3
|
+
### 3.0.4 (February 5, 2022)
|
|
4
|
+
|
|
5
|
+
- Rebuild of browser polyfills
|
|
6
|
+
|
|
7
|
+
### 3.0.3 (January 12, 2022)
|
|
8
|
+
|
|
9
|
+
- Fix compatibility with PostCSS `v8.2.x` [#147](https://github.com/csstools/postcss-plugins/issues/147)
|
|
10
|
+
|
|
11
|
+
This version is not officially supported but some tool providers pinned PostCSS to `v8.2.x`,
|
|
12
|
+
making it impossible for end users to have a working setup.
|
|
13
|
+
|
|
14
|
+
### 3.0.2 (January 2, 2022)
|
|
15
|
+
|
|
16
|
+
- Removed Sourcemaps from package tarball.
|
|
17
|
+
- Moved CLI to CLI Package. See [announcement](https://github.com/csstools/postcss-plugins/discussions/121).
|
|
18
|
+
|
|
19
|
+
### 3.0.1 (December 27, 2021)
|
|
20
|
+
|
|
21
|
+
- Fixed: require/import paths for browser script
|
|
22
|
+
|
|
3
23
|
### 3.0.0 (December 13, 2021)
|
|
4
24
|
|
|
5
25
|
- Breaking: require/import paths have changed
|
package/README.md
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
# CSS Has Pseudo [<img src="http://jonathantneal.github.io/js-logo.svg" alt="" width="90" height="90" align="right">][CSS Has Pseudo]
|
|
2
2
|
|
|
3
3
|
[![NPM Version][npm-img]][npm-url]
|
|
4
|
-
[
|
|
4
|
+
[<img alt="Discord" src="https://shields.io/badge/Discord-5865F2?logo=discord&logoColor=white">][discord]
|
|
5
5
|
|
|
6
6
|
[CSS Has Pseudo] lets you style elements relative to other elements in CSS,
|
|
7
7
|
following the [Selectors Level 4] specification.
|
|
@@ -96,8 +96,7 @@ elements otherwise matching `:has` natively.
|
|
|
96
96
|
</body>
|
|
97
97
|
```
|
|
98
98
|
|
|
99
|
-
[
|
|
100
|
-
[git-url]: https://gitter.im/postcss/postcss
|
|
99
|
+
[discord]: https://discord.gg/bUadyRwkJS
|
|
101
100
|
[npm-img]: https://img.shields.io/npm/v/css-has-pseudo.svg
|
|
102
101
|
[npm-url]: https://www.npmjs.com/package/css-has-pseudo
|
|
103
102
|
|
package/browser.js
CHANGED
|
@@ -1,117 +1,2 @@
|
|
|
1
|
-
(function () {
|
|
2
|
-
|
|
3
|
-
/* global MutationObserver,requestAnimationFrame */
|
|
4
|
-
function cssHasPseudo(document) {
|
|
5
|
-
var observedItems = []; // document.createAttribute() doesn't support `:` in the name. innerHTML does
|
|
6
|
-
|
|
7
|
-
var attributeElement = document.createElement('x'); // walk all stylesheets to collect observed css rules
|
|
8
|
-
|
|
9
|
-
[].forEach.call(document.styleSheets, walkStyleSheet);
|
|
10
|
-
transformObservedItems(); // observe DOM modifications that affect selectors
|
|
11
|
-
|
|
12
|
-
var mutationObserver = new MutationObserver(function (mutationsList) {
|
|
13
|
-
mutationsList.forEach(function (mutation) {
|
|
14
|
-
[].forEach.call(mutation.addedNodes || [], function (node) {
|
|
15
|
-
// walk stylesheets to collect observed css rules
|
|
16
|
-
if (node.nodeType === 1 && node.sheet) {
|
|
17
|
-
walkStyleSheet(node.sheet);
|
|
18
|
-
}
|
|
19
|
-
}); // transform observed css rules
|
|
20
|
-
|
|
21
|
-
cleanupObservedCssRules();
|
|
22
|
-
transformObservedItems();
|
|
23
|
-
});
|
|
24
|
-
});
|
|
25
|
-
mutationObserver.observe(document, {
|
|
26
|
-
childList: true,
|
|
27
|
-
subtree: true
|
|
28
|
-
}); // observe DOM events that affect pseudo-selectors
|
|
29
|
-
|
|
30
|
-
document.addEventListener('focus', transformObservedItems, true);
|
|
31
|
-
document.addEventListener('blur', transformObservedItems, true);
|
|
32
|
-
document.addEventListener('input', transformObservedItems); // transform observed css rules
|
|
33
|
-
|
|
34
|
-
function transformObservedItems() {
|
|
35
|
-
requestAnimationFrame(function () {
|
|
36
|
-
observedItems.forEach(function (item) {
|
|
37
|
-
var nodes = [];
|
|
38
|
-
[].forEach.call(document.querySelectorAll(item.scopeSelector), function (element) {
|
|
39
|
-
var nthChild = [].indexOf.call(element.parentNode.children, element) + 1;
|
|
40
|
-
var relativeSelectors = item.relativeSelectors.map(function (relativeSelector) {
|
|
41
|
-
return item.scopeSelector + ':nth-child(' + nthChild + ') ' + relativeSelector;
|
|
42
|
-
}).join(); // find any relative :has element from the :scope element
|
|
43
|
-
|
|
44
|
-
var relativeElement = element.parentNode.querySelector(relativeSelectors);
|
|
45
|
-
var shouldElementMatch = item.isNot ? !relativeElement : relativeElement;
|
|
46
|
-
|
|
47
|
-
if (shouldElementMatch) {
|
|
48
|
-
// memorize the node
|
|
49
|
-
nodes.push(element); // set an attribute with an irregular attribute name
|
|
50
|
-
// document.createAttribute() doesn't support special characters
|
|
51
|
-
|
|
52
|
-
attributeElement.innerHTML = '<x ' + item.attributeName + '>';
|
|
53
|
-
element.setAttributeNode(attributeElement.children[0].attributes[0].cloneNode()); // trigger a style refresh in IE and Edge
|
|
54
|
-
|
|
55
|
-
document.documentElement.style.zoom = 1;
|
|
56
|
-
document.documentElement.style.zoom = null;
|
|
57
|
-
}
|
|
58
|
-
}); // remove the encoded attribute from all nodes that no longer match them
|
|
59
|
-
|
|
60
|
-
item.nodes.forEach(function (node) {
|
|
61
|
-
if (nodes.indexOf(node) === -1) {
|
|
62
|
-
node.removeAttribute(item.attributeName); // trigger a style refresh in IE and Edge
|
|
63
|
-
|
|
64
|
-
document.documentElement.style.zoom = 1;
|
|
65
|
-
document.documentElement.style.zoom = null;
|
|
66
|
-
}
|
|
67
|
-
}); // update the
|
|
68
|
-
|
|
69
|
-
item.nodes = nodes;
|
|
70
|
-
});
|
|
71
|
-
});
|
|
72
|
-
} // remove any observed cssrules that no longer apply
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
function cleanupObservedCssRules() {
|
|
76
|
-
[].push.apply(observedItems, observedItems.splice(0).filter(function (item) {
|
|
77
|
-
return item.rule.parentStyleSheet && item.rule.parentStyleSheet.ownerNode && document.documentElement.contains(item.rule.parentStyleSheet.ownerNode);
|
|
78
|
-
}));
|
|
79
|
-
} // walk a stylesheet to collect observed css rules
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
function walkStyleSheet(styleSheet) {
|
|
83
|
-
try {
|
|
84
|
-
// walk a css rule to collect observed css rules
|
|
85
|
-
[].forEach.call(styleSheet.cssRules || [], function (rule) {
|
|
86
|
-
if (rule.selectorText) {
|
|
87
|
-
// decode the selector text in all browsers to:
|
|
88
|
-
// [1] = :scope, [2] = :not(:has), [3] = :has relative, [4] = :scope relative
|
|
89
|
-
var selectors = decodeURIComponent(rule.selectorText.replace(/\\(.)/g, '$1')).match(/^(.*?)\[:(not-)?has\((.+?)\)\](.*?)$/);
|
|
90
|
-
|
|
91
|
-
if (selectors) {
|
|
92
|
-
var attributeName = ':' + (selectors[2] ? 'not-' : '') + 'has(' + // encode a :has() pseudo selector as an attribute name
|
|
93
|
-
encodeURIComponent(selectors[3]).replace(/%3A/g, ':').replace(/%5B/g, '[').replace(/%5D/g, ']').replace(/%2C/g, ',') + ')';
|
|
94
|
-
observedItems.push({
|
|
95
|
-
rule: rule,
|
|
96
|
-
scopeSelector: selectors[1],
|
|
97
|
-
isNot: selectors[2],
|
|
98
|
-
relativeSelectors: selectors[3].split(/\s*,\s*/),
|
|
99
|
-
attributeName: attributeName,
|
|
100
|
-
nodes: []
|
|
101
|
-
});
|
|
102
|
-
}
|
|
103
|
-
} else {
|
|
104
|
-
walkStyleSheet(rule);
|
|
105
|
-
}
|
|
106
|
-
});
|
|
107
|
-
} catch (error) {
|
|
108
|
-
/* do nothing and continue */
|
|
109
|
-
}
|
|
110
|
-
}
|
|
111
|
-
}
|
|
112
|
-
|
|
113
|
-
/* global self */
|
|
114
|
-
self.cssHasPseudo = cssHasPseudo;
|
|
115
|
-
|
|
116
|
-
})();
|
|
1
|
+
self.cssHasPseudo=function(e){var t=[],n=e.createElement("x");function o(){requestAnimationFrame((function(){t.forEach((function(t){var o=[];[].forEach.call(e.querySelectorAll(t.scopeSelector),(function(r){var c=[].indexOf.call(r.parentNode.children,r)+1,l=t.relativeSelectors.map((function(e){return t.scopeSelector+":nth-child("+c+") "+e})).join(),a=r.parentNode.querySelector(l);(t.isNot?!a:a)&&(o.push(r),n.innerHTML="<x "+t.attributeName+">",r.setAttributeNode(n.children[0].attributes[0].cloneNode()),e.documentElement.style.zoom=1,e.documentElement.style.zoom=null)})),t.nodes.forEach((function(n){-1===o.indexOf(n)&&(n.removeAttribute(t.attributeName),e.documentElement.style.zoom=1,e.documentElement.style.zoom=null)})),t.nodes=o}))}))}function r(e){try{[].forEach.call(e.cssRules||[],(function(e){if(e.selectorText){var n=decodeURIComponent(e.selectorText.replace(/\\(.)/g,"$1")).match(/^(.*?)\[:(not-)?has\((.+?)\)\](.*?)$/);if(n){var o=":"+(n[2]?"not-":"")+"has("+encodeURIComponent(n[3]).replace(/%3A/g,":").replace(/%5B/g,"[").replace(/%5D/g,"]").replace(/%2C/g,",")+")";t.push({rule:e,scopeSelector:n[1],isNot:n[2],relativeSelectors:n[3].split(/\s*,\s*/),attributeName:o,nodes:[]})}}else r(e)}))}catch(e){}}[].forEach.call(e.styleSheets,r),o(),new MutationObserver((function(n){n.forEach((function(n){[].forEach.call(n.addedNodes||[],(function(e){1===e.nodeType&&e.sheet&&r(e.sheet)})),[].push.apply(t,t.splice(0).filter((function(t){return t.rule.parentStyleSheet&&t.rule.parentStyleSheet.ownerNode&&e.documentElement.contains(t.rule.parentStyleSheet.ownerNode)}))),o()}))})).observe(e,{childList:!0,subtree:!0}),e.addEventListener("focus",o,!0),e.addEventListener("blur",o,!0),e.addEventListener("input",o)};
|
|
117
2
|
//# sourceMappingURL=browser-global.js.map
|
package/dist/browser-global.js
CHANGED
|
@@ -1,117 +1,2 @@
|
|
|
1
|
-
(function () {
|
|
2
|
-
|
|
3
|
-
/* global MutationObserver,requestAnimationFrame */
|
|
4
|
-
function cssHasPseudo(document) {
|
|
5
|
-
var observedItems = []; // document.createAttribute() doesn't support `:` in the name. innerHTML does
|
|
6
|
-
|
|
7
|
-
var attributeElement = document.createElement('x'); // walk all stylesheets to collect observed css rules
|
|
8
|
-
|
|
9
|
-
[].forEach.call(document.styleSheets, walkStyleSheet);
|
|
10
|
-
transformObservedItems(); // observe DOM modifications that affect selectors
|
|
11
|
-
|
|
12
|
-
var mutationObserver = new MutationObserver(function (mutationsList) {
|
|
13
|
-
mutationsList.forEach(function (mutation) {
|
|
14
|
-
[].forEach.call(mutation.addedNodes || [], function (node) {
|
|
15
|
-
// walk stylesheets to collect observed css rules
|
|
16
|
-
if (node.nodeType === 1 && node.sheet) {
|
|
17
|
-
walkStyleSheet(node.sheet);
|
|
18
|
-
}
|
|
19
|
-
}); // transform observed css rules
|
|
20
|
-
|
|
21
|
-
cleanupObservedCssRules();
|
|
22
|
-
transformObservedItems();
|
|
23
|
-
});
|
|
24
|
-
});
|
|
25
|
-
mutationObserver.observe(document, {
|
|
26
|
-
childList: true,
|
|
27
|
-
subtree: true
|
|
28
|
-
}); // observe DOM events that affect pseudo-selectors
|
|
29
|
-
|
|
30
|
-
document.addEventListener('focus', transformObservedItems, true);
|
|
31
|
-
document.addEventListener('blur', transformObservedItems, true);
|
|
32
|
-
document.addEventListener('input', transformObservedItems); // transform observed css rules
|
|
33
|
-
|
|
34
|
-
function transformObservedItems() {
|
|
35
|
-
requestAnimationFrame(function () {
|
|
36
|
-
observedItems.forEach(function (item) {
|
|
37
|
-
var nodes = [];
|
|
38
|
-
[].forEach.call(document.querySelectorAll(item.scopeSelector), function (element) {
|
|
39
|
-
var nthChild = [].indexOf.call(element.parentNode.children, element) + 1;
|
|
40
|
-
var relativeSelectors = item.relativeSelectors.map(function (relativeSelector) {
|
|
41
|
-
return item.scopeSelector + ':nth-child(' + nthChild + ') ' + relativeSelector;
|
|
42
|
-
}).join(); // find any relative :has element from the :scope element
|
|
43
|
-
|
|
44
|
-
var relativeElement = element.parentNode.querySelector(relativeSelectors);
|
|
45
|
-
var shouldElementMatch = item.isNot ? !relativeElement : relativeElement;
|
|
46
|
-
|
|
47
|
-
if (shouldElementMatch) {
|
|
48
|
-
// memorize the node
|
|
49
|
-
nodes.push(element); // set an attribute with an irregular attribute name
|
|
50
|
-
// document.createAttribute() doesn't support special characters
|
|
51
|
-
|
|
52
|
-
attributeElement.innerHTML = '<x ' + item.attributeName + '>';
|
|
53
|
-
element.setAttributeNode(attributeElement.children[0].attributes[0].cloneNode()); // trigger a style refresh in IE and Edge
|
|
54
|
-
|
|
55
|
-
document.documentElement.style.zoom = 1;
|
|
56
|
-
document.documentElement.style.zoom = null;
|
|
57
|
-
}
|
|
58
|
-
}); // remove the encoded attribute from all nodes that no longer match them
|
|
59
|
-
|
|
60
|
-
item.nodes.forEach(function (node) {
|
|
61
|
-
if (nodes.indexOf(node) === -1) {
|
|
62
|
-
node.removeAttribute(item.attributeName); // trigger a style refresh in IE and Edge
|
|
63
|
-
|
|
64
|
-
document.documentElement.style.zoom = 1;
|
|
65
|
-
document.documentElement.style.zoom = null;
|
|
66
|
-
}
|
|
67
|
-
}); // update the
|
|
68
|
-
|
|
69
|
-
item.nodes = nodes;
|
|
70
|
-
});
|
|
71
|
-
});
|
|
72
|
-
} // remove any observed cssrules that no longer apply
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
function cleanupObservedCssRules() {
|
|
76
|
-
[].push.apply(observedItems, observedItems.splice(0).filter(function (item) {
|
|
77
|
-
return item.rule.parentStyleSheet && item.rule.parentStyleSheet.ownerNode && document.documentElement.contains(item.rule.parentStyleSheet.ownerNode);
|
|
78
|
-
}));
|
|
79
|
-
} // walk a stylesheet to collect observed css rules
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
function walkStyleSheet(styleSheet) {
|
|
83
|
-
try {
|
|
84
|
-
// walk a css rule to collect observed css rules
|
|
85
|
-
[].forEach.call(styleSheet.cssRules || [], function (rule) {
|
|
86
|
-
if (rule.selectorText) {
|
|
87
|
-
// decode the selector text in all browsers to:
|
|
88
|
-
// [1] = :scope, [2] = :not(:has), [3] = :has relative, [4] = :scope relative
|
|
89
|
-
var selectors = decodeURIComponent(rule.selectorText.replace(/\\(.)/g, '$1')).match(/^(.*?)\[:(not-)?has\((.+?)\)\](.*?)$/);
|
|
90
|
-
|
|
91
|
-
if (selectors) {
|
|
92
|
-
var attributeName = ':' + (selectors[2] ? 'not-' : '') + 'has(' + // encode a :has() pseudo selector as an attribute name
|
|
93
|
-
encodeURIComponent(selectors[3]).replace(/%3A/g, ':').replace(/%5B/g, '[').replace(/%5D/g, ']').replace(/%2C/g, ',') + ')';
|
|
94
|
-
observedItems.push({
|
|
95
|
-
rule: rule,
|
|
96
|
-
scopeSelector: selectors[1],
|
|
97
|
-
isNot: selectors[2],
|
|
98
|
-
relativeSelectors: selectors[3].split(/\s*,\s*/),
|
|
99
|
-
attributeName: attributeName,
|
|
100
|
-
nodes: []
|
|
101
|
-
});
|
|
102
|
-
}
|
|
103
|
-
} else {
|
|
104
|
-
walkStyleSheet(rule);
|
|
105
|
-
}
|
|
106
|
-
});
|
|
107
|
-
} catch (error) {
|
|
108
|
-
/* do nothing and continue */
|
|
109
|
-
}
|
|
110
|
-
}
|
|
111
|
-
}
|
|
112
|
-
|
|
113
|
-
/* global self */
|
|
114
|
-
self.cssHasPseudo = cssHasPseudo;
|
|
115
|
-
|
|
116
|
-
})();
|
|
1
|
+
self.cssHasPseudo=function(e){var t=[],n=e.createElement("x");function o(){requestAnimationFrame((function(){t.forEach((function(t){var o=[];[].forEach.call(e.querySelectorAll(t.scopeSelector),(function(r){var c=[].indexOf.call(r.parentNode.children,r)+1,l=t.relativeSelectors.map((function(e){return t.scopeSelector+":nth-child("+c+") "+e})).join(),a=r.parentNode.querySelector(l);(t.isNot?!a:a)&&(o.push(r),n.innerHTML="<x "+t.attributeName+">",r.setAttributeNode(n.children[0].attributes[0].cloneNode()),e.documentElement.style.zoom=1,e.documentElement.style.zoom=null)})),t.nodes.forEach((function(n){-1===o.indexOf(n)&&(n.removeAttribute(t.attributeName),e.documentElement.style.zoom=1,e.documentElement.style.zoom=null)})),t.nodes=o}))}))}function r(e){try{[].forEach.call(e.cssRules||[],(function(e){if(e.selectorText){var n=decodeURIComponent(e.selectorText.replace(/\\(.)/g,"$1")).match(/^(.*?)\[:(not-)?has\((.+?)\)\](.*?)$/);if(n){var o=":"+(n[2]?"not-":"")+"has("+encodeURIComponent(n[3]).replace(/%3A/g,":").replace(/%5B/g,"[").replace(/%5D/g,"]").replace(/%2C/g,",")+")";t.push({rule:e,scopeSelector:n[1],isNot:n[2],relativeSelectors:n[3].split(/\s*,\s*/),attributeName:o,nodes:[]})}}else r(e)}))}catch(e){}}[].forEach.call(e.styleSheets,r),o(),new MutationObserver((function(n){n.forEach((function(n){[].forEach.call(n.addedNodes||[],(function(e){1===e.nodeType&&e.sheet&&r(e.sheet)})),[].push.apply(t,t.splice(0).filter((function(t){return t.rule.parentStyleSheet&&t.rule.parentStyleSheet.ownerNode&&e.documentElement.contains(t.rule.parentStyleSheet.ownerNode)}))),o()}))})).observe(e,{childList:!0,subtree:!0}),e.addEventListener("focus",o,!0),e.addEventListener("blur",o,!0),e.addEventListener("input",o)};
|
|
117
2
|
//# sourceMappingURL=browser-global.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"browser-global.js","sources":["../src/browser.js","../src/browser-global.js"],"sourcesContent":["/* global MutationObserver,requestAnimationFrame */\nexport default function cssHasPseudo(document) {\n\tconst observedItems = [];\n\n\t// document.createAttribute() doesn't support `:` in the name. innerHTML does\n\tconst attributeElement = document.createElement('x');\n\n\t// walk all stylesheets to collect observed css rules\n\t[].forEach.call(document.styleSheets, walkStyleSheet);\n\ttransformObservedItems();\n\n\t// observe DOM modifications that affect selectors\n\tconst mutationObserver = new MutationObserver(mutationsList => {\n\t\tmutationsList.forEach(mutation => {\n\t\t\t[].forEach.call(mutation.addedNodes || [], node => {\n\t\t\t\t// walk stylesheets to collect observed css rules\n\t\t\t\tif (node.nodeType === 1 && node.sheet) {\n\t\t\t\t\twalkStyleSheet(node.sheet);\n\t\t\t\t}\n\t\t\t});\n\n\t\t\t// transform observed css rules\n\t\t\tcleanupObservedCssRules();\n\t\t\ttransformObservedItems();\n\t\t});\n\t});\n\n\tmutationObserver.observe(document, { childList: true, subtree: true });\n\n\t// observe DOM events that affect pseudo-selectors\n\tdocument.addEventListener('focus', transformObservedItems, true);\n\tdocument.addEventListener('blur', transformObservedItems, true);\n\tdocument.addEventListener('input', transformObservedItems);\n\n\t// transform observed css rules\n\tfunction transformObservedItems () {\n\t\trequestAnimationFrame(() => {\n\t\t\tobservedItems.forEach(\n\t\t\t\titem => {\n\t\t\t\t\tconst nodes = [];\n\n\t\t\t\t\t[].forEach.call(\n\t\t\t\t\t\tdocument.querySelectorAll(item.scopeSelector),\n\t\t\t\t\t\telement => {\n\t\t\t\t\t\t\tconst nthChild = [].indexOf.call(element.parentNode.children, element) + 1;\n\t\t\t\t\t\t\tconst relativeSelectors = item.relativeSelectors.map(\n\t\t\t\t\t\t\t\trelativeSelector => item.scopeSelector + ':nth-child(' + nthChild + ') ' + relativeSelector,\n\t\t\t\t\t\t\t).join();\n\n\t\t\t\t\t\t\t// find any relative :has element from the :scope element\n\t\t\t\t\t\t\tconst relativeElement = element.parentNode.querySelector(relativeSelectors);\n\n\t\t\t\t\t\t\tconst shouldElementMatch = item.isNot ? !relativeElement : relativeElement;\n\n\t\t\t\t\t\t\tif (shouldElementMatch) {\n\t\t\t\t\t\t\t\t// memorize the node\n\t\t\t\t\t\t\t\tnodes.push(element);\n\n\t\t\t\t\t\t\t\t// set an attribute with an irregular attribute name\n\t\t\t\t\t\t\t\t// document.createAttribute() doesn't support special characters\n\t\t\t\t\t\t\t\tattributeElement.innerHTML = '<x ' + item.attributeName + '>';\n\n\t\t\t\t\t\t\t\telement.setAttributeNode(attributeElement.children[0].attributes[0].cloneNode());\n\n\t\t\t\t\t\t\t\t// trigger a style refresh in IE and Edge\n\t\t\t\t\t\t\t\tdocument.documentElement.style.zoom = 1; document.documentElement.style.zoom = null;\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t},\n\t\t\t\t\t);\n\n\t\t\t\t\t// remove the encoded attribute from all nodes that no longer match them\n\t\t\t\t\titem.nodes.forEach(node => {\n\t\t\t\t\t\tif (nodes.indexOf(node) === -1) {\n\t\t\t\t\t\t\tnode.removeAttribute(item.attributeName);\n\n\t\t\t\t\t\t\t// trigger a style refresh in IE and Edge\n\t\t\t\t\t\t\tdocument.documentElement.style.zoom = 1; document.documentElement.style.zoom = null;\n\t\t\t\t\t\t}\n\t\t\t\t\t});\n\n\t\t\t\t\t// update the\n\t\t\t\t\titem.nodes = nodes;\n\t\t\t\t},\n\t\t\t);\n\t\t});\n\t}\n\n\t// remove any observed cssrules that no longer apply\n\tfunction cleanupObservedCssRules () {\n\t\t[].push.apply(\n\t\t\tobservedItems,\n\t\t\tobservedItems.splice(0).filter(\n\t\t\t\titem => item.rule.parentStyleSheet &&\n\t\t\t\t\titem.rule.parentStyleSheet.ownerNode &&\n\t\t\t\t\tdocument.documentElement.contains(item.rule.parentStyleSheet.ownerNode),\n\t\t\t),\n\t\t);\n\t}\n\n\t// walk a stylesheet to collect observed css rules\n\tfunction walkStyleSheet (styleSheet) {\n\t\ttry {\n\t\t\t// walk a css rule to collect observed css rules\n\t\t\t[].forEach.call(styleSheet.cssRules || [], rule => {\n\t\t\t\tif (rule.selectorText) {\n\t\t\t\t\t// decode the selector text in all browsers to:\n\t\t\t\t\t// [1] = :scope, [2] = :not(:has), [3] = :has relative, [4] = :scope relative\n\t\t\t\t\tconst selectors = decodeURIComponent(rule.selectorText.replace(/\\\\(.)/g, '$1')).match(/^(.*?)\\[:(not-)?has\\((.+?)\\)\\](.*?)$/);\n\n\t\t\t\t\tif (selectors) {\n\t\t\t\t\t\tconst attributeName = ':' + (selectors[2] ? 'not-' : '') + 'has(' +\n\t\t\t\t\t\t\t// encode a :has() pseudo selector as an attribute name\n\t\t\t\t\t\t\tencodeURIComponent(selectors[3]).replace(/%3A/g, ':').replace(/%5B/g, '[').replace(/%5D/g, ']').replace(/%2C/g, ',') +\n\t\t\t\t\t\t')';\n\n\t\t\t\t\t\tobservedItems.push({\n\t\t\t\t\t\t\trule,\n\t\t\t\t\t\t\tscopeSelector: selectors[1],\n\t\t\t\t\t\t\tisNot: selectors[2],\n\t\t\t\t\t\t\trelativeSelectors: selectors[3].split(/\\s*,\\s*/),\n\t\t\t\t\t\t\tattributeName,\n\t\t\t\t\t\t\tnodes: [],\n\t\t\t\t\t\t});\n\t\t\t\t\t}\n\t\t\t\t} else {\n\t\t\t\t\twalkStyleSheet(rule);\n\t\t\t\t}\n\t\t\t});\n\t\t} catch (error) {\n\t\t\t/* do nothing and continue */\n\t\t}\n\t}\n}\n","/* global self */\nimport { default as cssHasPseudo } from './browser';\nself.cssHasPseudo = cssHasPseudo;\n"],"names":["cssHasPseudo","document","observedItems","attributeElement","createElement","forEach","call","styleSheets","walkStyleSheet","transformObservedItems","mutationObserver","MutationObserver","mutationsList","mutation","addedNodes","node","nodeType","sheet","cleanupObservedCssRules","observe","childList","subtree","addEventListener","requestAnimationFrame","item","nodes","querySelectorAll","scopeSelector","element","nthChild","indexOf","parentNode","children","relativeSelectors","map","relativeSelector","join","relativeElement","querySelector","shouldElementMatch","isNot","push","innerHTML","attributeName","setAttributeNode","attributes","cloneNode","documentElement","style","zoom","removeAttribute","apply","splice","filter","rule","parentStyleSheet","ownerNode","contains","styleSheet","cssRules","selectorText","selectors","decodeURIComponent","replace","match","encodeURIComponent","split","error","self"],"mappings":";;CAAA;CACe,SAASA,YAAT,CAAsBC,QAAtB,EAAgC;CAC9C,MAAMC,aAAa,GAAG,EAAtB,CAD8C;;CAI9C,MAAMC,gBAAgB,GAAGF,QAAQ,CAACG,aAAT,CAAuB,GAAvB,CAAzB,CAJ8C;;CAO9C,KAAGC,OAAH,CAAWC,IAAX,CAAgBL,QAAQ,CAACM,WAAzB,EAAsCC,cAAtC;CACAC,EAAAA,sBAAsB,GARwB;;CAW9C,MAAMC,gBAAgB,GAAG,IAAIC,gBAAJ,CAAqB,UAAAC,aAAa,EAAI;CAC9DA,IAAAA,aAAa,CAACP,OAAd,CAAsB,UAAAQ,QAAQ,EAAI;CACjC,SAAGR,OAAH,CAAWC,IAAX,CAAgBO,QAAQ,CAACC,UAAT,IAAuB,EAAvC,EAA2C,UAAAC,IAAI,EAAI;CAClD;CACA,YAAIA,IAAI,CAACC,QAAL,KAAkB,CAAlB,IAAuBD,IAAI,CAACE,KAAhC,EAAuC;CACtCT,UAAAA,cAAc,CAACO,IAAI,CAACE,KAAN,CAAd;CACA;CACD,OALD,EADiC;;CASjCC,MAAAA,uBAAuB;CACvBT,MAAAA,sBAAsB;CACtB,KAXD;CAYA,GAbwB,CAAzB;CAeAC,EAAAA,gBAAgB,CAACS,OAAjB,CAAyBlB,QAAzB,EAAmC;CAAEmB,IAAAA,SAAS,EAAE,IAAb;CAAmBC,IAAAA,OAAO,EAAE;CAA5B,GAAnC,EA1B8C;;CA6B9CpB,EAAAA,QAAQ,CAACqB,gBAAT,CAA0B,OAA1B,EAAmCb,sBAAnC,EAA2D,IAA3D;CACAR,EAAAA,QAAQ,CAACqB,gBAAT,CAA0B,MAA1B,EAAkCb,sBAAlC,EAA0D,IAA1D;CACAR,EAAAA,QAAQ,CAACqB,gBAAT,CAA0B,OAA1B,EAAmCb,sBAAnC,EA/B8C;;CAkC9C,WAASA,sBAAT,GAAmC;CAClCc,IAAAA,qBAAqB,CAAC,YAAM;CAC3BrB,MAAAA,aAAa,CAACG,OAAd,CACC,UAAAmB,IAAI,EAAI;CACP,YAAMC,KAAK,GAAG,EAAd;CAEA,WAAGpB,OAAH,CAAWC,IAAX,CACCL,QAAQ,CAACyB,gBAAT,CAA0BF,IAAI,CAACG,aAA/B,CADD,EAEC,UAAAC,OAAO,EAAI;CACV,cAAMC,QAAQ,GAAG,GAAGC,OAAH,CAAWxB,IAAX,CAAgBsB,OAAO,CAACG,UAAR,CAAmBC,QAAnC,EAA6CJ,OAA7C,IAAwD,CAAzE;CACA,cAAMK,iBAAiB,GAAGT,IAAI,CAACS,iBAAL,CAAuBC,GAAvB,CACzB,UAAAC,gBAAgB;CAAA,mBAAIX,IAAI,CAACG,aAAL,GAAqB,aAArB,GAAqCE,QAArC,GAAgD,IAAhD,GAAuDM,gBAA3D;CAAA,WADS,EAExBC,IAFwB,EAA1B,CAFU;;CAOV,cAAMC,eAAe,GAAGT,OAAO,CAACG,UAAR,CAAmBO,aAAnB,CAAiCL,iBAAjC,CAAxB;CAEA,cAAMM,kBAAkB,GAAGf,IAAI,CAACgB,KAAL,GAAa,CAACH,eAAd,GAAgCA,eAA3D;;CAEA,cAAIE,kBAAJ,EAAwB;CACvB;CACAd,YAAAA,KAAK,CAACgB,IAAN,CAAWb,OAAX,EAFuB;CAKvB;;CACAzB,YAAAA,gBAAgB,CAACuC,SAAjB,GAA6B,QAAQlB,IAAI,CAACmB,aAAb,GAA6B,GAA1D;CAEAf,YAAAA,OAAO,CAACgB,gBAAR,CAAyBzC,gBAAgB,CAAC6B,QAAjB,CAA0B,CAA1B,EAA6Ba,UAA7B,CAAwC,CAAxC,EAA2CC,SAA3C,EAAzB,EARuB;;CAWvB7C,YAAAA,QAAQ,CAAC8C,eAAT,CAAyBC,KAAzB,CAA+BC,IAA/B,GAAsC,CAAtC;CAAyChD,YAAAA,QAAQ,CAAC8C,eAAT,CAAyBC,KAAzB,CAA+BC,IAA/B,GAAsC,IAAtC;CACzC;CACD,SA1BF,EAHO;;CAiCPzB,QAAAA,IAAI,CAACC,KAAL,CAAWpB,OAAX,CAAmB,UAAAU,IAAI,EAAI;CAC1B,cAAIU,KAAK,CAACK,OAAN,CAAcf,IAAd,MAAwB,CAAC,CAA7B,EAAgC;CAC/BA,YAAAA,IAAI,CAACmC,eAAL,CAAqB1B,IAAI,CAACmB,aAA1B,EAD+B;;CAI/B1C,YAAAA,QAAQ,CAAC8C,eAAT,CAAyBC,KAAzB,CAA+BC,IAA/B,GAAsC,CAAtC;CAAyChD,YAAAA,QAAQ,CAAC8C,eAAT,CAAyBC,KAAzB,CAA+BC,IAA/B,GAAsC,IAAtC;CACzC;CACD,SAPD,EAjCO;;CA2CPzB,QAAAA,IAAI,CAACC,KAAL,GAAaA,KAAb;CACA,OA7CF;CA+CA,KAhDoB,CAArB;CAiDA,GApF6C;;;CAuF9C,WAASP,uBAAT,GAAoC;CACnC,OAAGuB,IAAH,CAAQU,KAAR,CACCjD,aADD,EAECA,aAAa,CAACkD,MAAd,CAAqB,CAArB,EAAwBC,MAAxB,CACC,UAAA7B,IAAI;CAAA,aAAIA,IAAI,CAAC8B,IAAL,CAAUC,gBAAV,IACP/B,IAAI,CAAC8B,IAAL,CAAUC,gBAAV,CAA2BC,SADpB,IAEPvD,QAAQ,CAAC8C,eAAT,CAAyBU,QAAzB,CAAkCjC,IAAI,CAAC8B,IAAL,CAAUC,gBAAV,CAA2BC,SAA7D,CAFG;CAAA,KADL,CAFD;CAQA,GAhG6C;;;CAmG9C,WAAShD,cAAT,CAAyBkD,UAAzB,EAAqC;CACpC,QAAI;CACH;CACA,SAAGrD,OAAH,CAAWC,IAAX,CAAgBoD,UAAU,CAACC,QAAX,IAAuB,EAAvC,EAA2C,UAAAL,IAAI,EAAI;CAClD,YAAIA,IAAI,CAACM,YAAT,EAAuB;CACtB;CACA;CACA,cAAMC,SAAS,GAAGC,kBAAkB,CAACR,IAAI,CAACM,YAAL,CAAkBG,OAAlB,CAA0B,QAA1B,EAAoC,IAApC,CAAD,CAAlB,CAA8DC,KAA9D,CAAoE,sCAApE,CAAlB;;CAEA,cAAIH,SAAJ,EAAe;CACd,gBAAMlB,aAAa,GAAG,OAAOkB,SAAS,CAAC,CAAD,CAAT,GAAe,MAAf,GAAwB,EAA/B,IAAqC,MAArC;CAErBI,YAAAA,kBAAkB,CAACJ,SAAS,CAAC,CAAD,CAAV,CAAlB,CAAiCE,OAAjC,CAAyC,MAAzC,EAAiD,GAAjD,EAAsDA,OAAtD,CAA8D,MAA9D,EAAsE,GAAtE,EAA2EA,OAA3E,CAAmF,MAAnF,EAA2F,GAA3F,EAAgGA,OAAhG,CAAwG,MAAxG,EAAgH,GAAhH,CAFqB,GAGtB,GAHA;CAKA7D,YAAAA,aAAa,CAACuC,IAAd,CAAmB;CAClBa,cAAAA,IAAI,EAAJA,IADkB;CAElB3B,cAAAA,aAAa,EAAEkC,SAAS,CAAC,CAAD,CAFN;CAGlBrB,cAAAA,KAAK,EAAEqB,SAAS,CAAC,CAAD,CAHE;CAIlB5B,cAAAA,iBAAiB,EAAE4B,SAAS,CAAC,CAAD,CAAT,CAAaK,KAAb,CAAmB,SAAnB,CAJD;CAKlBvB,cAAAA,aAAa,EAAbA,aALkB;CAMlBlB,cAAAA,KAAK,EAAE;CANW,aAAnB;CAQA;CACD,SApBD,MAoBO;CACNjB,UAAAA,cAAc,CAAC8C,IAAD,CAAd;CACA;CACD,OAxBD;CAyBA,KA3BD,CA2BE,OAAOa,KAAP,EAAc;CACf;CACA;CACD;CACD;;CCpID;CAEAC,IAAI,CAACpE,YAAL,GAAoBA,YAApB;;;;;;"}
|
|
1
|
+
{"version":3,"file":"browser-global.js","sources":["../src/browser-global.js","../src/browser.js"],"sourcesContent":["/* global self */\nimport { default as cssHasPseudo } from './browser';\nself.cssHasPseudo = cssHasPseudo;\n","/* global MutationObserver,requestAnimationFrame */\nexport default function cssHasPseudo(document) {\n\tconst observedItems = [];\n\n\t// document.createAttribute() doesn't support `:` in the name. innerHTML does\n\tconst attributeElement = document.createElement('x');\n\n\t// walk all stylesheets to collect observed css rules\n\t[].forEach.call(document.styleSheets, walkStyleSheet);\n\ttransformObservedItems();\n\n\t// observe DOM modifications that affect selectors\n\tconst mutationObserver = new MutationObserver(mutationsList => {\n\t\tmutationsList.forEach(mutation => {\n\t\t\t[].forEach.call(mutation.addedNodes || [], node => {\n\t\t\t\t// walk stylesheets to collect observed css rules\n\t\t\t\tif (node.nodeType === 1 && node.sheet) {\n\t\t\t\t\twalkStyleSheet(node.sheet);\n\t\t\t\t}\n\t\t\t});\n\n\t\t\t// transform observed css rules\n\t\t\tcleanupObservedCssRules();\n\t\t\ttransformObservedItems();\n\t\t});\n\t});\n\n\tmutationObserver.observe(document, { childList: true, subtree: true });\n\n\t// observe DOM events that affect pseudo-selectors\n\tdocument.addEventListener('focus', transformObservedItems, true);\n\tdocument.addEventListener('blur', transformObservedItems, true);\n\tdocument.addEventListener('input', transformObservedItems);\n\n\t// transform observed css rules\n\tfunction transformObservedItems () {\n\t\trequestAnimationFrame(() => {\n\t\t\tobservedItems.forEach(\n\t\t\t\titem => {\n\t\t\t\t\tconst nodes = [];\n\n\t\t\t\t\t[].forEach.call(\n\t\t\t\t\t\tdocument.querySelectorAll(item.scopeSelector),\n\t\t\t\t\t\telement => {\n\t\t\t\t\t\t\tconst nthChild = [].indexOf.call(element.parentNode.children, element) + 1;\n\t\t\t\t\t\t\tconst relativeSelectors = item.relativeSelectors.map(\n\t\t\t\t\t\t\t\trelativeSelector => item.scopeSelector + ':nth-child(' + nthChild + ') ' + relativeSelector,\n\t\t\t\t\t\t\t).join();\n\n\t\t\t\t\t\t\t// find any relative :has element from the :scope element\n\t\t\t\t\t\t\tconst relativeElement = element.parentNode.querySelector(relativeSelectors);\n\n\t\t\t\t\t\t\tconst shouldElementMatch = item.isNot ? !relativeElement : relativeElement;\n\n\t\t\t\t\t\t\tif (shouldElementMatch) {\n\t\t\t\t\t\t\t\t// memorize the node\n\t\t\t\t\t\t\t\tnodes.push(element);\n\n\t\t\t\t\t\t\t\t// set an attribute with an irregular attribute name\n\t\t\t\t\t\t\t\t// document.createAttribute() doesn't support special characters\n\t\t\t\t\t\t\t\tattributeElement.innerHTML = '<x ' + item.attributeName + '>';\n\n\t\t\t\t\t\t\t\telement.setAttributeNode(attributeElement.children[0].attributes[0].cloneNode());\n\n\t\t\t\t\t\t\t\t// trigger a style refresh in IE and Edge\n\t\t\t\t\t\t\t\tdocument.documentElement.style.zoom = 1; document.documentElement.style.zoom = null;\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t},\n\t\t\t\t\t);\n\n\t\t\t\t\t// remove the encoded attribute from all nodes that no longer match them\n\t\t\t\t\titem.nodes.forEach(node => {\n\t\t\t\t\t\tif (nodes.indexOf(node) === -1) {\n\t\t\t\t\t\t\tnode.removeAttribute(item.attributeName);\n\n\t\t\t\t\t\t\t// trigger a style refresh in IE and Edge\n\t\t\t\t\t\t\tdocument.documentElement.style.zoom = 1; document.documentElement.style.zoom = null;\n\t\t\t\t\t\t}\n\t\t\t\t\t});\n\n\t\t\t\t\t// update the\n\t\t\t\t\titem.nodes = nodes;\n\t\t\t\t},\n\t\t\t);\n\t\t});\n\t}\n\n\t// remove any observed cssrules that no longer apply\n\tfunction cleanupObservedCssRules () {\n\t\t[].push.apply(\n\t\t\tobservedItems,\n\t\t\tobservedItems.splice(0).filter(\n\t\t\t\titem => item.rule.parentStyleSheet &&\n\t\t\t\t\titem.rule.parentStyleSheet.ownerNode &&\n\t\t\t\t\tdocument.documentElement.contains(item.rule.parentStyleSheet.ownerNode),\n\t\t\t),\n\t\t);\n\t}\n\n\t// walk a stylesheet to collect observed css rules\n\tfunction walkStyleSheet (styleSheet) {\n\t\ttry {\n\t\t\t// walk a css rule to collect observed css rules\n\t\t\t[].forEach.call(styleSheet.cssRules || [], rule => {\n\t\t\t\tif (rule.selectorText) {\n\t\t\t\t\t// decode the selector text in all browsers to:\n\t\t\t\t\t// [1] = :scope, [2] = :not(:has), [3] = :has relative, [4] = :scope relative\n\t\t\t\t\tconst selectors = decodeURIComponent(rule.selectorText.replace(/\\\\(.)/g, '$1')).match(/^(.*?)\\[:(not-)?has\\((.+?)\\)\\](.*?)$/);\n\n\t\t\t\t\tif (selectors) {\n\t\t\t\t\t\tconst attributeName = ':' + (selectors[2] ? 'not-' : '') + 'has(' +\n\t\t\t\t\t\t\t// encode a :has() pseudo selector as an attribute name\n\t\t\t\t\t\t\tencodeURIComponent(selectors[3]).replace(/%3A/g, ':').replace(/%5B/g, '[').replace(/%5D/g, ']').replace(/%2C/g, ',') +\n\t\t\t\t\t\t')';\n\n\t\t\t\t\t\tobservedItems.push({\n\t\t\t\t\t\t\trule,\n\t\t\t\t\t\t\tscopeSelector: selectors[1],\n\t\t\t\t\t\t\tisNot: selectors[2],\n\t\t\t\t\t\t\trelativeSelectors: selectors[3].split(/\\s*,\\s*/),\n\t\t\t\t\t\t\tattributeName,\n\t\t\t\t\t\t\tnodes: [],\n\t\t\t\t\t\t});\n\t\t\t\t\t}\n\t\t\t\t} else {\n\t\t\t\t\twalkStyleSheet(rule);\n\t\t\t\t}\n\t\t\t});\n\t\t} catch (error) {\n\t\t\t/* do nothing and continue */\n\t\t}\n\t}\n}\n"],"names":["self","cssHasPseudo","document","observedItems","attributeElement","createElement","transformObservedItems","requestAnimationFrame","forEach","item","nodes","call","querySelectorAll","scopeSelector","element","nthChild","indexOf","parentNode","children","relativeSelectors","map","relativeSelector","join","relativeElement","querySelector","isNot","push","innerHTML","attributeName","setAttributeNode","attributes","cloneNode","documentElement","style","zoom","node","removeAttribute","walkStyleSheet","styleSheet","cssRules","rule","selectorText","selectors","decodeURIComponent","replace","match","encodeURIComponent","split","error","styleSheets","MutationObserver","mutationsList","mutation","addedNodes","nodeType","sheet","apply","splice","filter","parentStyleSheet","ownerNode","contains","observe","childList","subtree","addEventListener"],"mappings":"AAEAA,KAAKC,aCDU,SAAsBC,OAC9BC,EAAgB,GAGhBC,EAAmBF,EAASG,cAAc,cA8BvCC,IACRC,uBAAsB,WACrBJ,EAAcK,SACb,SAAAC,OACOC,EAAQ,MAEXF,QAAQG,KACVT,EAASU,iBAAiBH,EAAKI,gBAC/B,SAAAC,OACOC,EAAW,GAAGC,QAAQL,KAAKG,EAAQG,WAAWC,SAAUJ,GAAW,EACnEK,EAAoBV,EAAKU,kBAAkBC,KAChD,SAAAC,UAAoBZ,EAAKI,cAAgB,cAAgBE,EAAW,KAAOM,KAC1EC,OAGIC,EAAkBT,EAAQG,WAAWO,cAAcL,IAE9BV,EAAKgB,OAASF,EAAkBA,KAI1Db,EAAMgB,KAAKZ,GAIXV,EAAiBuB,UAAY,MAAQlB,EAAKmB,cAAgB,IAE1Dd,EAAQe,iBAAiBzB,EAAiBc,SAAS,GAAGY,WAAW,GAAGC,aAGpE7B,EAAS8B,gBAAgBC,MAAMC,KAAO,EAAGhC,EAAS8B,gBAAgBC,MAAMC,KAAO,SAMlFzB,EAAKC,MAAMF,SAAQ,SAAA2B,IACW,IAAzBzB,EAAMM,QAAQmB,KACjBA,EAAKC,gBAAgB3B,EAAKmB,eAG1B1B,EAAS8B,gBAAgBC,MAAMC,KAAO,EAAGhC,EAAS8B,gBAAgBC,MAAMC,KAAO,SAKjFzB,EAAKC,MAAQA,iBAmBR2B,EAAgBC,UAGpB9B,QAAQG,KAAK2B,EAAWC,UAAY,IAAI,SAAAC,MACtCA,EAAKC,aAAc,KAGhBC,EAAYC,mBAAmBH,EAAKC,aAAaG,QAAQ,SAAU,OAAOC,MAAM,2CAElFH,EAAW,KACRd,EAAgB,KAAOc,EAAU,GAAK,OAAS,IAAM,OAE1DI,mBAAmBJ,EAAU,IAAIE,QAAQ,OAAQ,KAAKA,QAAQ,OAAQ,KAAKA,QAAQ,OAAQ,KAAKA,QAAQ,OAAQ,KACjH,IAEAzC,EAAcuB,KAAK,CAClBc,KAAAA,EACA3B,cAAe6B,EAAU,GACzBjB,MAAOiB,EAAU,GACjBvB,kBAAmBuB,EAAU,GAAGK,MAAM,WACtCnB,cAAAA,EACAlB,MAAO,WAIT2B,EAAeG,MAGhB,MAAOQ,QAxHPxC,QAAQG,KAAKT,EAAS+C,YAAaZ,GACtC/B,IAGyB,IAAI4C,kBAAiB,SAAAC,GAC7CA,EAAc3C,SAAQ,SAAA4C,MAClB5C,QAAQG,KAAKyC,EAASC,YAAc,IAAI,SAAAlB,GAEpB,IAAlBA,EAAKmB,UAAkBnB,EAAKoB,OAC/BlB,EAAeF,EAAKoB,aAwEpB7B,KAAK8B,MACPrD,EACAA,EAAcsD,OAAO,GAAGC,QACvB,SAAAjD,UAAQA,EAAK+B,KAAKmB,kBACjBlD,EAAK+B,KAAKmB,iBAAiBC,WAC3B1D,EAAS8B,gBAAgB6B,SAASpD,EAAK+B,KAAKmB,iBAAiBC,eAvE/DtD,UAIewD,QAAQ5D,EAAU,CAAE6D,WAAW,EAAMC,SAAS,IAG/D9D,EAAS+D,iBAAiB,QAAS3D,GAAwB,GAC3DJ,EAAS+D,iBAAiB,OAAQ3D,GAAwB,GAC1DJ,EAAS+D,iBAAiB,QAAS3D"}
|
package/dist/browser.cjs
CHANGED
|
@@ -1,112 +1,2 @@
|
|
|
1
|
-
|
|
2
|
-
function cssHasPseudo(document) {
|
|
3
|
-
var observedItems = []; // document.createAttribute() doesn't support `:` in the name. innerHTML does
|
|
4
|
-
|
|
5
|
-
var attributeElement = document.createElement('x'); // walk all stylesheets to collect observed css rules
|
|
6
|
-
|
|
7
|
-
[].forEach.call(document.styleSheets, walkStyleSheet);
|
|
8
|
-
transformObservedItems(); // observe DOM modifications that affect selectors
|
|
9
|
-
|
|
10
|
-
var mutationObserver = new MutationObserver(function (mutationsList) {
|
|
11
|
-
mutationsList.forEach(function (mutation) {
|
|
12
|
-
[].forEach.call(mutation.addedNodes || [], function (node) {
|
|
13
|
-
// walk stylesheets to collect observed css rules
|
|
14
|
-
if (node.nodeType === 1 && node.sheet) {
|
|
15
|
-
walkStyleSheet(node.sheet);
|
|
16
|
-
}
|
|
17
|
-
}); // transform observed css rules
|
|
18
|
-
|
|
19
|
-
cleanupObservedCssRules();
|
|
20
|
-
transformObservedItems();
|
|
21
|
-
});
|
|
22
|
-
});
|
|
23
|
-
mutationObserver.observe(document, {
|
|
24
|
-
childList: true,
|
|
25
|
-
subtree: true
|
|
26
|
-
}); // observe DOM events that affect pseudo-selectors
|
|
27
|
-
|
|
28
|
-
document.addEventListener('focus', transformObservedItems, true);
|
|
29
|
-
document.addEventListener('blur', transformObservedItems, true);
|
|
30
|
-
document.addEventListener('input', transformObservedItems); // transform observed css rules
|
|
31
|
-
|
|
32
|
-
function transformObservedItems() {
|
|
33
|
-
requestAnimationFrame(function () {
|
|
34
|
-
observedItems.forEach(function (item) {
|
|
35
|
-
var nodes = [];
|
|
36
|
-
[].forEach.call(document.querySelectorAll(item.scopeSelector), function (element) {
|
|
37
|
-
var nthChild = [].indexOf.call(element.parentNode.children, element) + 1;
|
|
38
|
-
var relativeSelectors = item.relativeSelectors.map(function (relativeSelector) {
|
|
39
|
-
return item.scopeSelector + ':nth-child(' + nthChild + ') ' + relativeSelector;
|
|
40
|
-
}).join(); // find any relative :has element from the :scope element
|
|
41
|
-
|
|
42
|
-
var relativeElement = element.parentNode.querySelector(relativeSelectors);
|
|
43
|
-
var shouldElementMatch = item.isNot ? !relativeElement : relativeElement;
|
|
44
|
-
|
|
45
|
-
if (shouldElementMatch) {
|
|
46
|
-
// memorize the node
|
|
47
|
-
nodes.push(element); // set an attribute with an irregular attribute name
|
|
48
|
-
// document.createAttribute() doesn't support special characters
|
|
49
|
-
|
|
50
|
-
attributeElement.innerHTML = '<x ' + item.attributeName + '>';
|
|
51
|
-
element.setAttributeNode(attributeElement.children[0].attributes[0].cloneNode()); // trigger a style refresh in IE and Edge
|
|
52
|
-
|
|
53
|
-
document.documentElement.style.zoom = 1;
|
|
54
|
-
document.documentElement.style.zoom = null;
|
|
55
|
-
}
|
|
56
|
-
}); // remove the encoded attribute from all nodes that no longer match them
|
|
57
|
-
|
|
58
|
-
item.nodes.forEach(function (node) {
|
|
59
|
-
if (nodes.indexOf(node) === -1) {
|
|
60
|
-
node.removeAttribute(item.attributeName); // trigger a style refresh in IE and Edge
|
|
61
|
-
|
|
62
|
-
document.documentElement.style.zoom = 1;
|
|
63
|
-
document.documentElement.style.zoom = null;
|
|
64
|
-
}
|
|
65
|
-
}); // update the
|
|
66
|
-
|
|
67
|
-
item.nodes = nodes;
|
|
68
|
-
});
|
|
69
|
-
});
|
|
70
|
-
} // remove any observed cssrules that no longer apply
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
function cleanupObservedCssRules() {
|
|
74
|
-
[].push.apply(observedItems, observedItems.splice(0).filter(function (item) {
|
|
75
|
-
return item.rule.parentStyleSheet && item.rule.parentStyleSheet.ownerNode && document.documentElement.contains(item.rule.parentStyleSheet.ownerNode);
|
|
76
|
-
}));
|
|
77
|
-
} // walk a stylesheet to collect observed css rules
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
function walkStyleSheet(styleSheet) {
|
|
81
|
-
try {
|
|
82
|
-
// walk a css rule to collect observed css rules
|
|
83
|
-
[].forEach.call(styleSheet.cssRules || [], function (rule) {
|
|
84
|
-
if (rule.selectorText) {
|
|
85
|
-
// decode the selector text in all browsers to:
|
|
86
|
-
// [1] = :scope, [2] = :not(:has), [3] = :has relative, [4] = :scope relative
|
|
87
|
-
var selectors = decodeURIComponent(rule.selectorText.replace(/\\(.)/g, '$1')).match(/^(.*?)\[:(not-)?has\((.+?)\)\](.*?)$/);
|
|
88
|
-
|
|
89
|
-
if (selectors) {
|
|
90
|
-
var attributeName = ':' + (selectors[2] ? 'not-' : '') + 'has(' + // encode a :has() pseudo selector as an attribute name
|
|
91
|
-
encodeURIComponent(selectors[3]).replace(/%3A/g, ':').replace(/%5B/g, '[').replace(/%5D/g, ']').replace(/%2C/g, ',') + ')';
|
|
92
|
-
observedItems.push({
|
|
93
|
-
rule: rule,
|
|
94
|
-
scopeSelector: selectors[1],
|
|
95
|
-
isNot: selectors[2],
|
|
96
|
-
relativeSelectors: selectors[3].split(/\s*,\s*/),
|
|
97
|
-
attributeName: attributeName,
|
|
98
|
-
nodes: []
|
|
99
|
-
});
|
|
100
|
-
}
|
|
101
|
-
} else {
|
|
102
|
-
walkStyleSheet(rule);
|
|
103
|
-
}
|
|
104
|
-
});
|
|
105
|
-
} catch (error) {
|
|
106
|
-
/* do nothing and continue */
|
|
107
|
-
}
|
|
108
|
-
}
|
|
109
|
-
}
|
|
110
|
-
|
|
111
|
-
module.exports = cssHasPseudo;
|
|
1
|
+
module.exports=function(e){var t=[],n=e.createElement("x");function o(){requestAnimationFrame((function(){t.forEach((function(t){var o=[];[].forEach.call(e.querySelectorAll(t.scopeSelector),(function(r){var l=[].indexOf.call(r.parentNode.children,r)+1,c=t.relativeSelectors.map((function(e){return t.scopeSelector+":nth-child("+l+") "+e})).join(),a=r.parentNode.querySelector(c);(t.isNot?!a:a)&&(o.push(r),n.innerHTML="<x "+t.attributeName+">",r.setAttributeNode(n.children[0].attributes[0].cloneNode()),e.documentElement.style.zoom=1,e.documentElement.style.zoom=null)})),t.nodes.forEach((function(n){-1===o.indexOf(n)&&(n.removeAttribute(t.attributeName),e.documentElement.style.zoom=1,e.documentElement.style.zoom=null)})),t.nodes=o}))}))}function r(e){try{[].forEach.call(e.cssRules||[],(function(e){if(e.selectorText){var n=decodeURIComponent(e.selectorText.replace(/\\(.)/g,"$1")).match(/^(.*?)\[:(not-)?has\((.+?)\)\](.*?)$/);if(n){var o=":"+(n[2]?"not-":"")+"has("+encodeURIComponent(n[3]).replace(/%3A/g,":").replace(/%5B/g,"[").replace(/%5D/g,"]").replace(/%2C/g,",")+")";t.push({rule:e,scopeSelector:n[1],isNot:n[2],relativeSelectors:n[3].split(/\s*,\s*/),attributeName:o,nodes:[]})}}else r(e)}))}catch(e){}}[].forEach.call(e.styleSheets,r),o(),new MutationObserver((function(n){n.forEach((function(n){[].forEach.call(n.addedNodes||[],(function(e){1===e.nodeType&&e.sheet&&r(e.sheet)})),[].push.apply(t,t.splice(0).filter((function(t){return t.rule.parentStyleSheet&&t.rule.parentStyleSheet.ownerNode&&e.documentElement.contains(t.rule.parentStyleSheet.ownerNode)}))),o()}))})).observe(e,{childList:!0,subtree:!0}),e.addEventListener("focus",o,!0),e.addEventListener("blur",o,!0),e.addEventListener("input",o)};
|
|
112
2
|
//# sourceMappingURL=browser.cjs.map
|
package/dist/browser.cjs.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"browser.cjs","sources":["../src/browser.js"],"sourcesContent":["/* global MutationObserver,requestAnimationFrame */\nexport default function cssHasPseudo(document) {\n\tconst observedItems = [];\n\n\t// document.createAttribute() doesn't support `:` in the name. innerHTML does\n\tconst attributeElement = document.createElement('x');\n\n\t// walk all stylesheets to collect observed css rules\n\t[].forEach.call(document.styleSheets, walkStyleSheet);\n\ttransformObservedItems();\n\n\t// observe DOM modifications that affect selectors\n\tconst mutationObserver = new MutationObserver(mutationsList => {\n\t\tmutationsList.forEach(mutation => {\n\t\t\t[].forEach.call(mutation.addedNodes || [], node => {\n\t\t\t\t// walk stylesheets to collect observed css rules\n\t\t\t\tif (node.nodeType === 1 && node.sheet) {\n\t\t\t\t\twalkStyleSheet(node.sheet);\n\t\t\t\t}\n\t\t\t});\n\n\t\t\t// transform observed css rules\n\t\t\tcleanupObservedCssRules();\n\t\t\ttransformObservedItems();\n\t\t});\n\t});\n\n\tmutationObserver.observe(document, { childList: true, subtree: true });\n\n\t// observe DOM events that affect pseudo-selectors\n\tdocument.addEventListener('focus', transformObservedItems, true);\n\tdocument.addEventListener('blur', transformObservedItems, true);\n\tdocument.addEventListener('input', transformObservedItems);\n\n\t// transform observed css rules\n\tfunction transformObservedItems () {\n\t\trequestAnimationFrame(() => {\n\t\t\tobservedItems.forEach(\n\t\t\t\titem => {\n\t\t\t\t\tconst nodes = [];\n\n\t\t\t\t\t[].forEach.call(\n\t\t\t\t\t\tdocument.querySelectorAll(item.scopeSelector),\n\t\t\t\t\t\telement => {\n\t\t\t\t\t\t\tconst nthChild = [].indexOf.call(element.parentNode.children, element) + 1;\n\t\t\t\t\t\t\tconst relativeSelectors = item.relativeSelectors.map(\n\t\t\t\t\t\t\t\trelativeSelector => item.scopeSelector + ':nth-child(' + nthChild + ') ' + relativeSelector,\n\t\t\t\t\t\t\t).join();\n\n\t\t\t\t\t\t\t// find any relative :has element from the :scope element\n\t\t\t\t\t\t\tconst relativeElement = element.parentNode.querySelector(relativeSelectors);\n\n\t\t\t\t\t\t\tconst shouldElementMatch = item.isNot ? !relativeElement : relativeElement;\n\n\t\t\t\t\t\t\tif (shouldElementMatch) {\n\t\t\t\t\t\t\t\t// memorize the node\n\t\t\t\t\t\t\t\tnodes.push(element);\n\n\t\t\t\t\t\t\t\t// set an attribute with an irregular attribute name\n\t\t\t\t\t\t\t\t// document.createAttribute() doesn't support special characters\n\t\t\t\t\t\t\t\tattributeElement.innerHTML = '<x ' + item.attributeName + '>';\n\n\t\t\t\t\t\t\t\telement.setAttributeNode(attributeElement.children[0].attributes[0].cloneNode());\n\n\t\t\t\t\t\t\t\t// trigger a style refresh in IE and Edge\n\t\t\t\t\t\t\t\tdocument.documentElement.style.zoom = 1; document.documentElement.style.zoom = null;\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t},\n\t\t\t\t\t);\n\n\t\t\t\t\t// remove the encoded attribute from all nodes that no longer match them\n\t\t\t\t\titem.nodes.forEach(node => {\n\t\t\t\t\t\tif (nodes.indexOf(node) === -1) {\n\t\t\t\t\t\t\tnode.removeAttribute(item.attributeName);\n\n\t\t\t\t\t\t\t// trigger a style refresh in IE and Edge\n\t\t\t\t\t\t\tdocument.documentElement.style.zoom = 1; document.documentElement.style.zoom = null;\n\t\t\t\t\t\t}\n\t\t\t\t\t});\n\n\t\t\t\t\t// update the\n\t\t\t\t\titem.nodes = nodes;\n\t\t\t\t},\n\t\t\t);\n\t\t});\n\t}\n\n\t// remove any observed cssrules that no longer apply\n\tfunction cleanupObservedCssRules () {\n\t\t[].push.apply(\n\t\t\tobservedItems,\n\t\t\tobservedItems.splice(0).filter(\n\t\t\t\titem => item.rule.parentStyleSheet &&\n\t\t\t\t\titem.rule.parentStyleSheet.ownerNode &&\n\t\t\t\t\tdocument.documentElement.contains(item.rule.parentStyleSheet.ownerNode),\n\t\t\t),\n\t\t);\n\t}\n\n\t// walk a stylesheet to collect observed css rules\n\tfunction walkStyleSheet (styleSheet) {\n\t\ttry {\n\t\t\t// walk a css rule to collect observed css rules\n\t\t\t[].forEach.call(styleSheet.cssRules || [], rule => {\n\t\t\t\tif (rule.selectorText) {\n\t\t\t\t\t// decode the selector text in all browsers to:\n\t\t\t\t\t// [1] = :scope, [2] = :not(:has), [3] = :has relative, [4] = :scope relative\n\t\t\t\t\tconst selectors = decodeURIComponent(rule.selectorText.replace(/\\\\(.)/g, '$1')).match(/^(.*?)\\[:(not-)?has\\((.+?)\\)\\](.*?)$/);\n\n\t\t\t\t\tif (selectors) {\n\t\t\t\t\t\tconst attributeName = ':' + (selectors[2] ? 'not-' : '') + 'has(' +\n\t\t\t\t\t\t\t// encode a :has() pseudo selector as an attribute name\n\t\t\t\t\t\t\tencodeURIComponent(selectors[3]).replace(/%3A/g, ':').replace(/%5B/g, '[').replace(/%5D/g, ']').replace(/%2C/g, ',') +\n\t\t\t\t\t\t')';\n\n\t\t\t\t\t\tobservedItems.push({\n\t\t\t\t\t\t\trule,\n\t\t\t\t\t\t\tscopeSelector: selectors[1],\n\t\t\t\t\t\t\tisNot: selectors[2],\n\t\t\t\t\t\t\trelativeSelectors: selectors[3].split(/\\s*,\\s*/),\n\t\t\t\t\t\t\tattributeName,\n\t\t\t\t\t\t\tnodes: [],\n\t\t\t\t\t\t});\n\t\t\t\t\t}\n\t\t\t\t} else {\n\t\t\t\t\twalkStyleSheet(rule);\n\t\t\t\t}\n\t\t\t});\n\t\t} catch (error) {\n\t\t\t/* do nothing and continue */\n\t\t}\n\t}\n}\n"],"names":["
|
|
1
|
+
{"version":3,"file":"browser.cjs","sources":["../src/browser.js"],"sourcesContent":["/* global MutationObserver,requestAnimationFrame */\nexport default function cssHasPseudo(document) {\n\tconst observedItems = [];\n\n\t// document.createAttribute() doesn't support `:` in the name. innerHTML does\n\tconst attributeElement = document.createElement('x');\n\n\t// walk all stylesheets to collect observed css rules\n\t[].forEach.call(document.styleSheets, walkStyleSheet);\n\ttransformObservedItems();\n\n\t// observe DOM modifications that affect selectors\n\tconst mutationObserver = new MutationObserver(mutationsList => {\n\t\tmutationsList.forEach(mutation => {\n\t\t\t[].forEach.call(mutation.addedNodes || [], node => {\n\t\t\t\t// walk stylesheets to collect observed css rules\n\t\t\t\tif (node.nodeType === 1 && node.sheet) {\n\t\t\t\t\twalkStyleSheet(node.sheet);\n\t\t\t\t}\n\t\t\t});\n\n\t\t\t// transform observed css rules\n\t\t\tcleanupObservedCssRules();\n\t\t\ttransformObservedItems();\n\t\t});\n\t});\n\n\tmutationObserver.observe(document, { childList: true, subtree: true });\n\n\t// observe DOM events that affect pseudo-selectors\n\tdocument.addEventListener('focus', transformObservedItems, true);\n\tdocument.addEventListener('blur', transformObservedItems, true);\n\tdocument.addEventListener('input', transformObservedItems);\n\n\t// transform observed css rules\n\tfunction transformObservedItems () {\n\t\trequestAnimationFrame(() => {\n\t\t\tobservedItems.forEach(\n\t\t\t\titem => {\n\t\t\t\t\tconst nodes = [];\n\n\t\t\t\t\t[].forEach.call(\n\t\t\t\t\t\tdocument.querySelectorAll(item.scopeSelector),\n\t\t\t\t\t\telement => {\n\t\t\t\t\t\t\tconst nthChild = [].indexOf.call(element.parentNode.children, element) + 1;\n\t\t\t\t\t\t\tconst relativeSelectors = item.relativeSelectors.map(\n\t\t\t\t\t\t\t\trelativeSelector => item.scopeSelector + ':nth-child(' + nthChild + ') ' + relativeSelector,\n\t\t\t\t\t\t\t).join();\n\n\t\t\t\t\t\t\t// find any relative :has element from the :scope element\n\t\t\t\t\t\t\tconst relativeElement = element.parentNode.querySelector(relativeSelectors);\n\n\t\t\t\t\t\t\tconst shouldElementMatch = item.isNot ? !relativeElement : relativeElement;\n\n\t\t\t\t\t\t\tif (shouldElementMatch) {\n\t\t\t\t\t\t\t\t// memorize the node\n\t\t\t\t\t\t\t\tnodes.push(element);\n\n\t\t\t\t\t\t\t\t// set an attribute with an irregular attribute name\n\t\t\t\t\t\t\t\t// document.createAttribute() doesn't support special characters\n\t\t\t\t\t\t\t\tattributeElement.innerHTML = '<x ' + item.attributeName + '>';\n\n\t\t\t\t\t\t\t\telement.setAttributeNode(attributeElement.children[0].attributes[0].cloneNode());\n\n\t\t\t\t\t\t\t\t// trigger a style refresh in IE and Edge\n\t\t\t\t\t\t\t\tdocument.documentElement.style.zoom = 1; document.documentElement.style.zoom = null;\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t},\n\t\t\t\t\t);\n\n\t\t\t\t\t// remove the encoded attribute from all nodes that no longer match them\n\t\t\t\t\titem.nodes.forEach(node => {\n\t\t\t\t\t\tif (nodes.indexOf(node) === -1) {\n\t\t\t\t\t\t\tnode.removeAttribute(item.attributeName);\n\n\t\t\t\t\t\t\t// trigger a style refresh in IE and Edge\n\t\t\t\t\t\t\tdocument.documentElement.style.zoom = 1; document.documentElement.style.zoom = null;\n\t\t\t\t\t\t}\n\t\t\t\t\t});\n\n\t\t\t\t\t// update the\n\t\t\t\t\titem.nodes = nodes;\n\t\t\t\t},\n\t\t\t);\n\t\t});\n\t}\n\n\t// remove any observed cssrules that no longer apply\n\tfunction cleanupObservedCssRules () {\n\t\t[].push.apply(\n\t\t\tobservedItems,\n\t\t\tobservedItems.splice(0).filter(\n\t\t\t\titem => item.rule.parentStyleSheet &&\n\t\t\t\t\titem.rule.parentStyleSheet.ownerNode &&\n\t\t\t\t\tdocument.documentElement.contains(item.rule.parentStyleSheet.ownerNode),\n\t\t\t),\n\t\t);\n\t}\n\n\t// walk a stylesheet to collect observed css rules\n\tfunction walkStyleSheet (styleSheet) {\n\t\ttry {\n\t\t\t// walk a css rule to collect observed css rules\n\t\t\t[].forEach.call(styleSheet.cssRules || [], rule => {\n\t\t\t\tif (rule.selectorText) {\n\t\t\t\t\t// decode the selector text in all browsers to:\n\t\t\t\t\t// [1] = :scope, [2] = :not(:has), [3] = :has relative, [4] = :scope relative\n\t\t\t\t\tconst selectors = decodeURIComponent(rule.selectorText.replace(/\\\\(.)/g, '$1')).match(/^(.*?)\\[:(not-)?has\\((.+?)\\)\\](.*?)$/);\n\n\t\t\t\t\tif (selectors) {\n\t\t\t\t\t\tconst attributeName = ':' + (selectors[2] ? 'not-' : '') + 'has(' +\n\t\t\t\t\t\t\t// encode a :has() pseudo selector as an attribute name\n\t\t\t\t\t\t\tencodeURIComponent(selectors[3]).replace(/%3A/g, ':').replace(/%5B/g, '[').replace(/%5D/g, ']').replace(/%2C/g, ',') +\n\t\t\t\t\t\t')';\n\n\t\t\t\t\t\tobservedItems.push({\n\t\t\t\t\t\t\trule,\n\t\t\t\t\t\t\tscopeSelector: selectors[1],\n\t\t\t\t\t\t\tisNot: selectors[2],\n\t\t\t\t\t\t\trelativeSelectors: selectors[3].split(/\\s*,\\s*/),\n\t\t\t\t\t\t\tattributeName,\n\t\t\t\t\t\t\tnodes: [],\n\t\t\t\t\t\t});\n\t\t\t\t\t}\n\t\t\t\t} else {\n\t\t\t\t\twalkStyleSheet(rule);\n\t\t\t\t}\n\t\t\t});\n\t\t} catch (error) {\n\t\t\t/* do nothing and continue */\n\t\t}\n\t}\n}\n"],"names":["document","observedItems","attributeElement","createElement","transformObservedItems","requestAnimationFrame","forEach","item","nodes","call","querySelectorAll","scopeSelector","element","nthChild","indexOf","parentNode","children","relativeSelectors","map","relativeSelector","join","relativeElement","querySelector","isNot","push","innerHTML","attributeName","setAttributeNode","attributes","cloneNode","documentElement","style","zoom","node","removeAttribute","walkStyleSheet","styleSheet","cssRules","rule","selectorText","selectors","decodeURIComponent","replace","match","encodeURIComponent","split","error","styleSheets","MutationObserver","mutationsList","mutation","addedNodes","nodeType","sheet","apply","splice","filter","parentStyleSheet","ownerNode","contains","observe","childList","subtree","addEventListener"],"mappings":"eACe,SAAsBA,OAC9BC,EAAgB,GAGhBC,EAAmBF,EAASG,cAAc,cA8BvCC,IACRC,uBAAsB,WACrBJ,EAAcK,SACb,SAAAC,OACOC,EAAQ,MAEXF,QAAQG,KACVT,EAASU,iBAAiBH,EAAKI,gBAC/B,SAAAC,OACOC,EAAW,GAAGC,QAAQL,KAAKG,EAAQG,WAAWC,SAAUJ,GAAW,EACnEK,EAAoBV,EAAKU,kBAAkBC,KAChD,SAAAC,UAAoBZ,EAAKI,cAAgB,cAAgBE,EAAW,KAAOM,KAC1EC,OAGIC,EAAkBT,EAAQG,WAAWO,cAAcL,IAE9BV,EAAKgB,OAASF,EAAkBA,KAI1Db,EAAMgB,KAAKZ,GAIXV,EAAiBuB,UAAY,MAAQlB,EAAKmB,cAAgB,IAE1Dd,EAAQe,iBAAiBzB,EAAiBc,SAAS,GAAGY,WAAW,GAAGC,aAGpE7B,EAAS8B,gBAAgBC,MAAMC,KAAO,EAAGhC,EAAS8B,gBAAgBC,MAAMC,KAAO,SAMlFzB,EAAKC,MAAMF,SAAQ,SAAA2B,IACW,IAAzBzB,EAAMM,QAAQmB,KACjBA,EAAKC,gBAAgB3B,EAAKmB,eAG1B1B,EAAS8B,gBAAgBC,MAAMC,KAAO,EAAGhC,EAAS8B,gBAAgBC,MAAMC,KAAO,SAKjFzB,EAAKC,MAAQA,iBAmBR2B,EAAgBC,UAGpB9B,QAAQG,KAAK2B,EAAWC,UAAY,IAAI,SAAAC,MACtCA,EAAKC,aAAc,KAGhBC,EAAYC,mBAAmBH,EAAKC,aAAaG,QAAQ,SAAU,OAAOC,MAAM,2CAElFH,EAAW,KACRd,EAAgB,KAAOc,EAAU,GAAK,OAAS,IAAM,OAE1DI,mBAAmBJ,EAAU,IAAIE,QAAQ,OAAQ,KAAKA,QAAQ,OAAQ,KAAKA,QAAQ,OAAQ,KAAKA,QAAQ,OAAQ,KACjH,IAEAzC,EAAcuB,KAAK,CAClBc,KAAAA,EACA3B,cAAe6B,EAAU,GACzBjB,MAAOiB,EAAU,GACjBvB,kBAAmBuB,EAAU,GAAGK,MAAM,WACtCnB,cAAAA,EACAlB,MAAO,WAIT2B,EAAeG,MAGhB,MAAOQ,QAxHPxC,QAAQG,KAAKT,EAAS+C,YAAaZ,GACtC/B,IAGyB,IAAI4C,kBAAiB,SAAAC,GAC7CA,EAAc3C,SAAQ,SAAA4C,MAClB5C,QAAQG,KAAKyC,EAASC,YAAc,IAAI,SAAAlB,GAEpB,IAAlBA,EAAKmB,UAAkBnB,EAAKoB,OAC/BlB,EAAeF,EAAKoB,aAwEpB7B,KAAK8B,MACPrD,EACAA,EAAcsD,OAAO,GAAGC,QACvB,SAAAjD,UAAQA,EAAK+B,KAAKmB,kBACjBlD,EAAK+B,KAAKmB,iBAAiBC,WAC3B1D,EAAS8B,gBAAgB6B,SAASpD,EAAK+B,KAAKmB,iBAAiBC,eAvE/DtD,UAIewD,QAAQ5D,EAAU,CAAE6D,WAAW,EAAMC,SAAS,IAG/D9D,EAAS+D,iBAAiB,QAAS3D,GAAwB,GAC3DJ,EAAS+D,iBAAiB,OAAQ3D,GAAwB,GAC1DJ,EAAS+D,iBAAiB,QAAS3D"}
|
package/dist/browser.mjs
ADDED
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
function e(e){var t=[],n=e.createElement("x");function o(){requestAnimationFrame((function(){t.forEach((function(t){var o=[];[].forEach.call(e.querySelectorAll(t.scopeSelector),(function(r){var l=[].indexOf.call(r.parentNode.children,r)+1,c=t.relativeSelectors.map((function(e){return t.scopeSelector+":nth-child("+l+") "+e})).join(),a=r.parentNode.querySelector(c);(t.isNot?!a:a)&&(o.push(r),n.innerHTML="<x "+t.attributeName+">",r.setAttributeNode(n.children[0].attributes[0].cloneNode()),e.documentElement.style.zoom=1,e.documentElement.style.zoom=null)})),t.nodes.forEach((function(n){-1===o.indexOf(n)&&(n.removeAttribute(t.attributeName),e.documentElement.style.zoom=1,e.documentElement.style.zoom=null)})),t.nodes=o}))}))}function r(e){try{[].forEach.call(e.cssRules||[],(function(e){if(e.selectorText){var n=decodeURIComponent(e.selectorText.replace(/\\(.)/g,"$1")).match(/^(.*?)\[:(not-)?has\((.+?)\)\](.*?)$/);if(n){var o=":"+(n[2]?"not-":"")+"has("+encodeURIComponent(n[3]).replace(/%3A/g,":").replace(/%5B/g,"[").replace(/%5D/g,"]").replace(/%2C/g,",")+")";t.push({rule:e,scopeSelector:n[1],isNot:n[2],relativeSelectors:n[3].split(/\s*,\s*/),attributeName:o,nodes:[]})}}else r(e)}))}catch(e){}}[].forEach.call(e.styleSheets,r),o(),new MutationObserver((function(n){n.forEach((function(n){[].forEach.call(n.addedNodes||[],(function(e){1===e.nodeType&&e.sheet&&r(e.sheet)})),[].push.apply(t,t.splice(0).filter((function(t){return t.rule.parentStyleSheet&&t.rule.parentStyleSheet.ownerNode&&e.documentElement.contains(t.rule.parentStyleSheet.ownerNode)}))),o()}))})).observe(e,{childList:!0,subtree:!0}),e.addEventListener("focus",o,!0),e.addEventListener("blur",o,!0),e.addEventListener("input",o)}export{e as default};
|
|
2
|
+
//# sourceMappingURL=browser.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"browser.mjs","sources":["../src/browser.js"],"sourcesContent":["/* global MutationObserver,requestAnimationFrame */\nexport default function cssHasPseudo(document) {\n\tconst observedItems = [];\n\n\t// document.createAttribute() doesn't support `:` in the name. innerHTML does\n\tconst attributeElement = document.createElement('x');\n\n\t// walk all stylesheets to collect observed css rules\n\t[].forEach.call(document.styleSheets, walkStyleSheet);\n\ttransformObservedItems();\n\n\t// observe DOM modifications that affect selectors\n\tconst mutationObserver = new MutationObserver(mutationsList => {\n\t\tmutationsList.forEach(mutation => {\n\t\t\t[].forEach.call(mutation.addedNodes || [], node => {\n\t\t\t\t// walk stylesheets to collect observed css rules\n\t\t\t\tif (node.nodeType === 1 && node.sheet) {\n\t\t\t\t\twalkStyleSheet(node.sheet);\n\t\t\t\t}\n\t\t\t});\n\n\t\t\t// transform observed css rules\n\t\t\tcleanupObservedCssRules();\n\t\t\ttransformObservedItems();\n\t\t});\n\t});\n\n\tmutationObserver.observe(document, { childList: true, subtree: true });\n\n\t// observe DOM events that affect pseudo-selectors\n\tdocument.addEventListener('focus', transformObservedItems, true);\n\tdocument.addEventListener('blur', transformObservedItems, true);\n\tdocument.addEventListener('input', transformObservedItems);\n\n\t// transform observed css rules\n\tfunction transformObservedItems () {\n\t\trequestAnimationFrame(() => {\n\t\t\tobservedItems.forEach(\n\t\t\t\titem => {\n\t\t\t\t\tconst nodes = [];\n\n\t\t\t\t\t[].forEach.call(\n\t\t\t\t\t\tdocument.querySelectorAll(item.scopeSelector),\n\t\t\t\t\t\telement => {\n\t\t\t\t\t\t\tconst nthChild = [].indexOf.call(element.parentNode.children, element) + 1;\n\t\t\t\t\t\t\tconst relativeSelectors = item.relativeSelectors.map(\n\t\t\t\t\t\t\t\trelativeSelector => item.scopeSelector + ':nth-child(' + nthChild + ') ' + relativeSelector,\n\t\t\t\t\t\t\t).join();\n\n\t\t\t\t\t\t\t// find any relative :has element from the :scope element\n\t\t\t\t\t\t\tconst relativeElement = element.parentNode.querySelector(relativeSelectors);\n\n\t\t\t\t\t\t\tconst shouldElementMatch = item.isNot ? !relativeElement : relativeElement;\n\n\t\t\t\t\t\t\tif (shouldElementMatch) {\n\t\t\t\t\t\t\t\t// memorize the node\n\t\t\t\t\t\t\t\tnodes.push(element);\n\n\t\t\t\t\t\t\t\t// set an attribute with an irregular attribute name\n\t\t\t\t\t\t\t\t// document.createAttribute() doesn't support special characters\n\t\t\t\t\t\t\t\tattributeElement.innerHTML = '<x ' + item.attributeName + '>';\n\n\t\t\t\t\t\t\t\telement.setAttributeNode(attributeElement.children[0].attributes[0].cloneNode());\n\n\t\t\t\t\t\t\t\t// trigger a style refresh in IE and Edge\n\t\t\t\t\t\t\t\tdocument.documentElement.style.zoom = 1; document.documentElement.style.zoom = null;\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t},\n\t\t\t\t\t);\n\n\t\t\t\t\t// remove the encoded attribute from all nodes that no longer match them\n\t\t\t\t\titem.nodes.forEach(node => {\n\t\t\t\t\t\tif (nodes.indexOf(node) === -1) {\n\t\t\t\t\t\t\tnode.removeAttribute(item.attributeName);\n\n\t\t\t\t\t\t\t// trigger a style refresh in IE and Edge\n\t\t\t\t\t\t\tdocument.documentElement.style.zoom = 1; document.documentElement.style.zoom = null;\n\t\t\t\t\t\t}\n\t\t\t\t\t});\n\n\t\t\t\t\t// update the\n\t\t\t\t\titem.nodes = nodes;\n\t\t\t\t},\n\t\t\t);\n\t\t});\n\t}\n\n\t// remove any observed cssrules that no longer apply\n\tfunction cleanupObservedCssRules () {\n\t\t[].push.apply(\n\t\t\tobservedItems,\n\t\t\tobservedItems.splice(0).filter(\n\t\t\t\titem => item.rule.parentStyleSheet &&\n\t\t\t\t\titem.rule.parentStyleSheet.ownerNode &&\n\t\t\t\t\tdocument.documentElement.contains(item.rule.parentStyleSheet.ownerNode),\n\t\t\t),\n\t\t);\n\t}\n\n\t// walk a stylesheet to collect observed css rules\n\tfunction walkStyleSheet (styleSheet) {\n\t\ttry {\n\t\t\t// walk a css rule to collect observed css rules\n\t\t\t[].forEach.call(styleSheet.cssRules || [], rule => {\n\t\t\t\tif (rule.selectorText) {\n\t\t\t\t\t// decode the selector text in all browsers to:\n\t\t\t\t\t// [1] = :scope, [2] = :not(:has), [3] = :has relative, [4] = :scope relative\n\t\t\t\t\tconst selectors = decodeURIComponent(rule.selectorText.replace(/\\\\(.)/g, '$1')).match(/^(.*?)\\[:(not-)?has\\((.+?)\\)\\](.*?)$/);\n\n\t\t\t\t\tif (selectors) {\n\t\t\t\t\t\tconst attributeName = ':' + (selectors[2] ? 'not-' : '') + 'has(' +\n\t\t\t\t\t\t\t// encode a :has() pseudo selector as an attribute name\n\t\t\t\t\t\t\tencodeURIComponent(selectors[3]).replace(/%3A/g, ':').replace(/%5B/g, '[').replace(/%5D/g, ']').replace(/%2C/g, ',') +\n\t\t\t\t\t\t')';\n\n\t\t\t\t\t\tobservedItems.push({\n\t\t\t\t\t\t\trule,\n\t\t\t\t\t\t\tscopeSelector: selectors[1],\n\t\t\t\t\t\t\tisNot: selectors[2],\n\t\t\t\t\t\t\trelativeSelectors: selectors[3].split(/\\s*,\\s*/),\n\t\t\t\t\t\t\tattributeName,\n\t\t\t\t\t\t\tnodes: [],\n\t\t\t\t\t\t});\n\t\t\t\t\t}\n\t\t\t\t} else {\n\t\t\t\t\twalkStyleSheet(rule);\n\t\t\t\t}\n\t\t\t});\n\t\t} catch (error) {\n\t\t\t/* do nothing and continue */\n\t\t}\n\t}\n}\n"],"names":["cssHasPseudo","document","observedItems","attributeElement","createElement","transformObservedItems","requestAnimationFrame","forEach","item","nodes","call","querySelectorAll","scopeSelector","element","nthChild","indexOf","parentNode","children","relativeSelectors","map","relativeSelector","join","relativeElement","querySelector","isNot","push","innerHTML","attributeName","setAttributeNode","attributes","cloneNode","documentElement","style","zoom","node","removeAttribute","walkStyleSheet","styleSheet","cssRules","rule","selectorText","selectors","decodeURIComponent","replace","match","encodeURIComponent","split","error","styleSheets","MutationObserver","mutationsList","mutation","addedNodes","nodeType","sheet","apply","splice","filter","parentStyleSheet","ownerNode","contains","observe","childList","subtree","addEventListener"],"mappings":"AACe,SAASA,EAAaC,OAC9BC,EAAgB,GAGhBC,EAAmBF,EAASG,cAAc,cA8BvCC,IACRC,uBAAsB,WACrBJ,EAAcK,SACb,SAAAC,OACOC,EAAQ,MAEXF,QAAQG,KACVT,EAASU,iBAAiBH,EAAKI,gBAC/B,SAAAC,OACOC,EAAW,GAAGC,QAAQL,KAAKG,EAAQG,WAAWC,SAAUJ,GAAW,EACnEK,EAAoBV,EAAKU,kBAAkBC,KAChD,SAAAC,UAAoBZ,EAAKI,cAAgB,cAAgBE,EAAW,KAAOM,KAC1EC,OAGIC,EAAkBT,EAAQG,WAAWO,cAAcL,IAE9BV,EAAKgB,OAASF,EAAkBA,KAI1Db,EAAMgB,KAAKZ,GAIXV,EAAiBuB,UAAY,MAAQlB,EAAKmB,cAAgB,IAE1Dd,EAAQe,iBAAiBzB,EAAiBc,SAAS,GAAGY,WAAW,GAAGC,aAGpE7B,EAAS8B,gBAAgBC,MAAMC,KAAO,EAAGhC,EAAS8B,gBAAgBC,MAAMC,KAAO,SAMlFzB,EAAKC,MAAMF,SAAQ,SAAA2B,IACW,IAAzBzB,EAAMM,QAAQmB,KACjBA,EAAKC,gBAAgB3B,EAAKmB,eAG1B1B,EAAS8B,gBAAgBC,MAAMC,KAAO,EAAGhC,EAAS8B,gBAAgBC,MAAMC,KAAO,SAKjFzB,EAAKC,MAAQA,iBAmBR2B,EAAgBC,UAGpB9B,QAAQG,KAAK2B,EAAWC,UAAY,IAAI,SAAAC,MACtCA,EAAKC,aAAc,KAGhBC,EAAYC,mBAAmBH,EAAKC,aAAaG,QAAQ,SAAU,OAAOC,MAAM,2CAElFH,EAAW,KACRd,EAAgB,KAAOc,EAAU,GAAK,OAAS,IAAM,OAE1DI,mBAAmBJ,EAAU,IAAIE,QAAQ,OAAQ,KAAKA,QAAQ,OAAQ,KAAKA,QAAQ,OAAQ,KAAKA,QAAQ,OAAQ,KACjH,IAEAzC,EAAcuB,KAAK,CAClBc,KAAAA,EACA3B,cAAe6B,EAAU,GACzBjB,MAAOiB,EAAU,GACjBvB,kBAAmBuB,EAAU,GAAGK,MAAM,WACtCnB,cAAAA,EACAlB,MAAO,WAIT2B,EAAeG,MAGhB,MAAOQ,QAxHPxC,QAAQG,KAAKT,EAAS+C,YAAaZ,GACtC/B,IAGyB,IAAI4C,kBAAiB,SAAAC,GAC7CA,EAAc3C,SAAQ,SAAA4C,MAClB5C,QAAQG,KAAKyC,EAASC,YAAc,IAAI,SAAAlB,GAEpB,IAAlBA,EAAKmB,UAAkBnB,EAAKoB,OAC/BlB,EAAeF,EAAKoB,aAwEpB7B,KAAK8B,MACPrD,EACAA,EAAcsD,OAAO,GAAGC,QACvB,SAAAjD,UAAQA,EAAK+B,KAAKmB,kBACjBlD,EAAK+B,KAAKmB,iBAAiBC,WAC3B1D,EAAS8B,gBAAgB6B,SAASpD,EAAK+B,KAAKmB,iBAAiBC,eAvE/DtD,UAIewD,QAAQ5D,EAAU,CAAE6D,WAAW,EAAMC,SAAS,IAG/D9D,EAAS+D,iBAAiB,QAAS3D,GAAwB,GAC3DJ,EAAS+D,iBAAiB,OAAQ3D,GAAwB,GAC1DJ,EAAS+D,iBAAiB,QAAS3D"}
|
package/dist/cli.cjs
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
|
|
3
|
+
"use strict";var e=require("postcss-selector-parser"),t=require("tty"),r=require("path"),n=require("url"),s=require("fs");function i(e){return e&&"object"==typeof e&&"default"in e?e:{default:e}}var o=i(e),a=i(t),l=i(r),u=i(n),c=i(s);const h=e=>{e="object"==typeof e&&e||p;const t=Boolean(!("preserve"in e)||e.preserve);return{postcssPlugin:"css-has-pseudo",Rule:(e,{result:r})=>{if(!e.selector.includes(":has("))return;let n;try{const t=o.default((e=>{e.walkPseudos((e=>{if(":has"===e.value&&e.nodes){const t=d(e);e.value=t?":not-has":":has";const r=o.default.attribute({attribute:f(String(e))});t?e.parent.parent.replaceWith(r):e.replaceWith(r)}}))})).processSync(e.selector);n=String(t)}catch(t){return void e.warn(r,`Failed to parse selector : ${e.selector}`)}void 0!==n&&n!==e.selector&&(t?e.cloneBefore({selector:n}):e.selector=n)}}};h.postcss=!0;const p={preserve:!0},f=e=>{let t="",r="";const n=()=>{if(r){const e=encodeURIComponent(r);let n="",s="";const i=()=>{n&&(s+=n,n="")};let o=!1;for(let t=0;t<e.length;t++){const r=e[t];if(o)n+=r,o=!1;else switch(r){case"%":i(),s+="\\"+r;continue;case"\\":n+=r,o=!0;continue;default:n+=r;continue}}i(),t+=s,r=""}};let s=!1;for(let i=0;i<e.length;i++){const o=e[i];if(s)r+=o,s=!1;else switch(o){case":":case"[":case"]":case",":case"(":case")":n(),t+="\\"+o;continue;case"\\":r+=o,s=!0;continue;default:r+=o;continue}}return n(),t},d=e=>{var t,r;return"pseudo"===(null==(t=e.parent)||null==(r=t.parent)?void 0:r.type)&&":not"===e.parent.parent.value};var g;!function(e){e.InvalidArguments="INVALID_ARGUMENTS"}(g||(g={}));var m={exports:{}};let w=a.default,y=!("NO_COLOR"in process.env||process.argv.includes("--no-color"))&&("FORCE_COLOR"in process.env||process.argv.includes("--color")||"win32"===process.platform||w.isatty(1)&&"dumb"!==process.env.TERM||"CI"in process.env),v=(e,t,r=e)=>n=>{let s=""+n,i=s.indexOf(t,e.length);return~i?e+S(s,t,r,i)+t:e+s+t},S=(e,t,r,n)=>{let s=e.substring(0,n)+r,i=e.substring(n+t.length),o=i.indexOf(t);return~o?s+S(i,t,r,o):s+i},C=(e=y)=>({isColorSupported:e,reset:e?e=>`[0m${e}[0m`:String,bold:e?v("[1m","[22m","[22m[1m"):String,dim:e?v("[2m","[22m","[22m[2m"):String,italic:e?v("[3m","[23m"):String,underline:e?v("[4m","[24m"):String,inverse:e?v("[7m","[27m"):String,hidden:e?v("[8m","[28m"):String,strikethrough:e?v("[9m","[29m"):String,black:e?v("[30m","[39m"):String,red:e?v("[31m","[39m"):String,green:e?v("[32m","[39m"):String,yellow:e?v("[33m","[39m"):String,blue:e?v("[34m","[39m"):String,magenta:e?v("[35m","[39m"):String,cyan:e?v("[36m","[39m"):String,white:e?v("[37m","[39m"):String,gray:e?v("[90m","[39m"):String,bgBlack:e?v("[40m","[49m"):String,bgRed:e?v("[41m","[49m"):String,bgGreen:e?v("[42m","[49m"):String,bgYellow:e?v("[43m","[49m"):String,bgBlue:e?v("[44m","[49m"):String,bgMagenta:e?v("[45m","[49m"):String,bgCyan:e?v("[46m","[49m"):String,bgWhite:e?v("[47m","[49m"):String});m.exports=C(),m.exports.createColors=C;const b="'".charCodeAt(0),_='"'.charCodeAt(0),x="\\".charCodeAt(0),O="/".charCodeAt(0),A="\n".charCodeAt(0),M=" ".charCodeAt(0),k="\f".charCodeAt(0),E="\t".charCodeAt(0),L="\r".charCodeAt(0),R="[".charCodeAt(0),P="]".charCodeAt(0),I="(".charCodeAt(0),j=")".charCodeAt(0),N="{".charCodeAt(0),U="}".charCodeAt(0),B=";".charCodeAt(0),D="*".charCodeAt(0),F=":".charCodeAt(0),T="@".charCodeAt(0),$=/[\t\n\f\r "#'()/;[\\\]{}]/g,G=/[\t\n\f\r !"#'():;@[\\\]{}]|\/(?=\*)/g,z=/.[\n"'(/\\]/,W=/[\da-f]/i;var V=function(e,t={}){let r,n,s,i,o,a,l,u,c,h,p=e.css.valueOf(),f=t.ignoreErrors,d=p.length,g=0,m=[],w=[];function y(t){throw e.error("Unclosed "+t,g)}return{back:function(e){w.push(e)},nextToken:function(e){if(w.length)return w.pop();if(g>=d)return;let t=!!e&&e.ignoreUnclosed;switch(r=p.charCodeAt(g),r){case A:case M:case E:case L:case k:n=g;do{n+=1,r=p.charCodeAt(n)}while(r===M||r===A||r===E||r===L||r===k);h=["space",p.slice(g,n)],g=n-1;break;case R:case P:case N:case U:case F:case B:case j:{let e=String.fromCharCode(r);h=[e,e,g];break}case I:if(u=m.length?m.pop()[1]:"",c=p.charCodeAt(g+1),"url"===u&&c!==b&&c!==_&&c!==M&&c!==A&&c!==E&&c!==k&&c!==L){n=g;do{if(a=!1,n=p.indexOf(")",n+1),-1===n){if(f||t){n=g;break}y("bracket")}for(l=n;p.charCodeAt(l-1)===x;)l-=1,a=!a}while(a);h=["brackets",p.slice(g,n+1),g,n],g=n}else n=p.indexOf(")",g+1),i=p.slice(g,n+1),-1===n||z.test(i)?h=["(","(",g]:(h=["brackets",i,g,n],g=n);break;case b:case _:s=r===b?"'":'"',n=g;do{if(a=!1,n=p.indexOf(s,n+1),-1===n){if(f||t){n=g+1;break}y("string")}for(l=n;p.charCodeAt(l-1)===x;)l-=1,a=!a}while(a);h=["string",p.slice(g,n+1),g,n],g=n;break;case T:$.lastIndex=g+1,$.test(p),n=0===$.lastIndex?p.length-1:$.lastIndex-2,h=["at-word",p.slice(g,n+1),g,n],g=n;break;case x:for(n=g,o=!0;p.charCodeAt(n+1)===x;)n+=1,o=!o;if(r=p.charCodeAt(n+1),o&&r!==O&&r!==M&&r!==A&&r!==E&&r!==L&&r!==k&&(n+=1,W.test(p.charAt(n)))){for(;W.test(p.charAt(n+1));)n+=1;p.charCodeAt(n+1)===M&&(n+=1)}h=["word",p.slice(g,n+1),g,n],g=n;break;default:r===O&&p.charCodeAt(g+1)===D?(n=p.indexOf("*/",g+2)+1,0===n&&(f||t?n=p.length:y("comment")),h=["comment",p.slice(g,n+1),g,n],g=n):(G.lastIndex=g+1,G.test(p),n=0===G.lastIndex?p.length-1:G.lastIndex-2,h=["word",p.slice(g,n+1),g,n],m.push(h),g=n)}return g++,h},endOfFile:function(){return 0===w.length&&g>=d},position:function(){return g}}};let J,q=m.exports,Y=V;const H={brackets:q.cyan,"at-word":q.cyan,comment:q.gray,string:q.green,class:q.yellow,hash:q.magenta,call:q.cyan,"(":q.cyan,")":q.cyan,"{":q.yellow,"}":q.yellow,"[":q.yellow,"]":q.yellow,":":q.yellow,";":q.yellow};function Q([e,t],r){if("word"===e){if("."===t[0])return"class";if("#"===t[0])return"hash"}if(!r.endOfFile()){let e=r.nextToken();if(r.back(e),"brackets"===e[0]||"("===e[0])return"call"}return e}function Z(e){let t=Y(new J(e),{ignoreErrors:!0}),r="";for(;!t.endOfFile();){let e=t.nextToken(),n=H[Q(e,t)];r+=n?e[1].split(/\r?\n/).map((e=>n(e))).join("\n"):e[1]}return r}Z.registerInput=function(e){J=e};var K=Z;let X=m.exports,ee=K;class te extends Error{constructor(e,t,r,n,s,i){super(e),this.name="CssSyntaxError",this.reason=e,s&&(this.file=s),n&&(this.source=n),i&&(this.plugin=i),void 0!==t&&void 0!==r&&("number"==typeof t?(this.line=t,this.column=r):(this.line=t.line,this.column=t.column,this.endLine=r.line,this.endColumn=r.column)),this.setMessage(),Error.captureStackTrace&&Error.captureStackTrace(this,te)}setMessage(){this.message=this.plugin?this.plugin+": ":"",this.message+=this.file?this.file:"<css input>",void 0!==this.line&&(this.message+=":"+this.line+":"+this.column),this.message+=": "+this.reason}showSourceCode(e){if(!this.source)return"";let t=this.source;null==e&&(e=X.isColorSupported),ee&&e&&(t=ee(t));let r,n,s=t.split(/\r?\n/),i=Math.max(this.line-3,0),o=Math.min(this.line+2,s.length),a=String(o).length;if(e){let{bold:e,red:t,gray:s}=X.createColors(!0);r=r=>e(t(r)),n=e=>s(e)}else r=n=e=>e;return s.slice(i,o).map(((e,t)=>{let s=i+1+t,o=" "+(" "+s).slice(-a)+" | ";if(s===this.line){let t=n(o.replace(/\d/g," "))+e.slice(0,this.column-1).replace(/[^\t]/g," ");return r(">")+n(o)+e+"\n "+t+r("^")}return" "+n(o)+e})).join("\n")}toString(){let e=this.showSourceCode();return e&&(e="\n\n"+e+"\n"),this.name+": "+this.message+e}}var re=te;te.default=te;var ne={};ne.isClean=Symbol("isClean"),ne.my=Symbol("my");const se={colon:": ",indent:" ",beforeDecl:"\n",beforeRule:"\n",beforeOpen:" ",beforeClose:"\n",beforeComment:"\n",after:"\n",emptyBody:"",commentLeft:" ",commentRight:" ",semicolon:!1};class ie{constructor(e){this.builder=e}stringify(e,t){if(!this[e.type])throw new Error("Unknown AST node type "+e.type+". Maybe you need to change PostCSS stringifier.");this[e.type](e,t)}document(e){this.body(e)}root(e){this.body(e),e.raws.after&&this.builder(e.raws.after)}comment(e){let t=this.raw(e,"left","commentLeft"),r=this.raw(e,"right","commentRight");this.builder("/*"+t+e.text+r+"*/",e)}decl(e,t){let r=this.raw(e,"between","colon"),n=e.prop+r+this.rawValue(e,"value");e.important&&(n+=e.raws.important||" !important"),t&&(n+=";"),this.builder(n,e)}rule(e){this.block(e,this.rawValue(e,"selector")),e.raws.ownSemicolon&&this.builder(e.raws.ownSemicolon,e,"end")}atrule(e,t){let r="@"+e.name,n=e.params?this.rawValue(e,"params"):"";if(void 0!==e.raws.afterName?r+=e.raws.afterName:n&&(r+=" "),e.nodes)this.block(e,r+n);else{let s=(e.raws.between||"")+(t?";":"");this.builder(r+n+s,e)}}body(e){let t=e.nodes.length-1;for(;t>0&&"comment"===e.nodes[t].type;)t-=1;let r=this.raw(e,"semicolon");for(let n=0;n<e.nodes.length;n++){let s=e.nodes[n],i=this.raw(s,"before");i&&this.builder(i),this.stringify(s,t!==n||r)}}block(e,t){let r,n=this.raw(e,"between","beforeOpen");this.builder(t+n+"{",e,"start"),e.nodes&&e.nodes.length?(this.body(e),r=this.raw(e,"after")):r=this.raw(e,"after","emptyBody"),r&&this.builder(r),this.builder("}",e,"end")}raw(e,t,r){let n;if(r||(r=t),t&&(n=e.raws[t],void 0!==n))return n;let s=e.parent;if("before"===r){if(!s||"root"===s.type&&s.first===e)return"";if(s&&"document"===s.type)return""}if(!s)return se[r];let i=e.root();if(i.rawCache||(i.rawCache={}),void 0!==i.rawCache[r])return i.rawCache[r];if("before"===r||"after"===r)return this.beforeAfter(e,r);{let s="raw"+((o=r)[0].toUpperCase()+o.slice(1));this[s]?n=this[s](i,e):i.walk((e=>{if(n=e.raws[t],void 0!==n)return!1}))}var o;return void 0===n&&(n=se[r]),i.rawCache[r]=n,n}rawSemicolon(e){let t;return e.walk((e=>{if(e.nodes&&e.nodes.length&&"decl"===e.last.type&&(t=e.raws.semicolon,void 0!==t))return!1})),t}rawEmptyBody(e){let t;return e.walk((e=>{if(e.nodes&&0===e.nodes.length&&(t=e.raws.after,void 0!==t))return!1})),t}rawIndent(e){if(e.raws.indent)return e.raws.indent;let t;return e.walk((r=>{let n=r.parent;if(n&&n!==e&&n.parent&&n.parent===e&&void 0!==r.raws.before){let e=r.raws.before.split("\n");return t=e[e.length-1],t=t.replace(/\S/g,""),!1}})),t}rawBeforeComment(e,t){let r;return e.walkComments((e=>{if(void 0!==e.raws.before)return r=e.raws.before,r.includes("\n")&&(r=r.replace(/[^\n]+$/,"")),!1})),void 0===r?r=this.raw(t,null,"beforeDecl"):r&&(r=r.replace(/\S/g,"")),r}rawBeforeDecl(e,t){let r;return e.walkDecls((e=>{if(void 0!==e.raws.before)return r=e.raws.before,r.includes("\n")&&(r=r.replace(/[^\n]+$/,"")),!1})),void 0===r?r=this.raw(t,null,"beforeRule"):r&&(r=r.replace(/\S/g,"")),r}rawBeforeRule(e){let t;return e.walk((r=>{if(r.nodes&&(r.parent!==e||e.first!==r)&&void 0!==r.raws.before)return t=r.raws.before,t.includes("\n")&&(t=t.replace(/[^\n]+$/,"")),!1})),t&&(t=t.replace(/\S/g,"")),t}rawBeforeClose(e){let t;return e.walk((e=>{if(e.nodes&&e.nodes.length>0&&void 0!==e.raws.after)return t=e.raws.after,t.includes("\n")&&(t=t.replace(/[^\n]+$/,"")),!1})),t&&(t=t.replace(/\S/g,"")),t}rawBeforeOpen(e){let t;return e.walk((e=>{if("decl"!==e.type&&(t=e.raws.between,void 0!==t))return!1})),t}rawColon(e){let t;return e.walkDecls((e=>{if(void 0!==e.raws.between)return t=e.raws.between.replace(/[^\s:]/g,""),!1})),t}beforeAfter(e,t){let r;r="decl"===e.type?this.raw(e,null,"beforeDecl"):"comment"===e.type?this.raw(e,null,"beforeComment"):"before"===t?this.raw(e,null,"beforeRule"):this.raw(e,null,"beforeClose");let n=e.parent,s=0;for(;n&&"root"!==n.type;)s+=1,n=n.parent;if(r.includes("\n")){let t=this.raw(e,null,"indent");if(t.length)for(let e=0;e<s;e++)r+=t}return r}rawValue(e,t){let r=e[t],n=e.raws[t];return n&&n.value===r?n.raw:r}}var oe=ie;ie.default=ie;let ae=oe;function le(e,t){new ae(t).stringify(e)}var ue=le;le.default=le;let{isClean:ce,my:he}=ne,pe=re,fe=oe,de=ue;function ge(e,t){let r=new e.constructor;for(let n in e){if(!Object.prototype.hasOwnProperty.call(e,n))continue;if("proxyCache"===n)continue;let s=e[n],i=typeof s;"parent"===n&&"object"===i?t&&(r[n]=t):"source"===n?r[n]=s:Array.isArray(s)?r[n]=s.map((e=>ge(e,r))):("object"===i&&null!==s&&(s=ge(s)),r[n]=s)}return r}class me{constructor(e={}){this.raws={},this[ce]=!1,this[he]=!0;for(let t in e)if("nodes"===t){this.nodes=[];for(let r of e[t])"function"==typeof r.clone?this.append(r.clone()):this.append(r)}else this[t]=e[t]}error(e,t={}){if(this.source){let{start:r,end:n}=this.rangeBy(t);return this.source.input.error(e,{line:r.line,column:r.column},{line:n.line,column:n.column},t)}return new pe(e)}warn(e,t,r){let n={node:this};for(let e in r)n[e]=r[e];return e.warn(t,n)}remove(){return this.parent&&this.parent.removeChild(this),this.parent=void 0,this}toString(e=de){e.stringify&&(e=e.stringify);let t="";return e(this,(e=>{t+=e})),t}assign(e={}){for(let t in e)this[t]=e[t];return this}clone(e={}){let t=ge(this);for(let r in e)t[r]=e[r];return t}cloneBefore(e={}){let t=this.clone(e);return this.parent.insertBefore(this,t),t}cloneAfter(e={}){let t=this.clone(e);return this.parent.insertAfter(this,t),t}replaceWith(...e){if(this.parent){let t=this,r=!1;for(let n of e)n===this?r=!0:r?(this.parent.insertAfter(t,n),t=n):this.parent.insertBefore(t,n);r||this.remove()}return this}next(){if(!this.parent)return;let e=this.parent.index(this);return this.parent.nodes[e+1]}prev(){if(!this.parent)return;let e=this.parent.index(this);return this.parent.nodes[e-1]}before(e){return this.parent.insertBefore(this,e),this}after(e){return this.parent.insertAfter(this,e),this}root(){let e=this;for(;e.parent&&"document"!==e.parent.type;)e=e.parent;return e}raw(e,t){return(new fe).raw(this,e,t)}cleanRaws(e){delete this.raws.before,delete this.raws.after,e||delete this.raws.between}toJSON(e,t){let r={},n=null==t;t=t||new Map;let s=0;for(let e in this){if(!Object.prototype.hasOwnProperty.call(this,e))continue;if("parent"===e||"proxyCache"===e)continue;let n=this[e];if(Array.isArray(n))r[e]=n.map((e=>"object"==typeof e&&e.toJSON?e.toJSON(null,t):e));else if("object"==typeof n&&n.toJSON)r[e]=n.toJSON(null,t);else if("source"===e){let i=t.get(n.input);null==i&&(i=s,t.set(n.input,s),s++),r[e]={inputId:i,start:n.start,end:n.end}}else r[e]=n}return n&&(r.inputs=[...t.keys()].map((e=>e.toJSON()))),r}positionInside(e){let t=this.toString(),r=this.source.start.column,n=this.source.start.line;for(let s=0;s<e;s++)"\n"===t[s]?(r=1,n+=1):r+=1;return{line:n,column:r}}positionBy(e){let t=this.source.start;if(e.index)t=this.positionInside(e.index);else if(e.word){let r=this.toString().indexOf(e.word);-1!==r&&(t=this.positionInside(r))}return t}rangeBy(e){let t={line:this.source.start.line,column:this.source.start.column},r=this.source.end?{line:this.source.end.line,column:this.source.end.column+1}:{line:t.line,column:t.column+1};if(e.word){let n=this.toString().indexOf(e.word);-1!==n&&(t=this.positionInside(n),r=this.positionInside(n+e.word.length))}else e.start?t={line:e.start.line,column:e.start.column}:e.index&&(t=this.positionInside(e.index)),e.end?r={line:e.end.line,column:e.end.column}:e.endIndex?r=this.positionInside(e.endIndex):e.index&&(r=this.positionInside(e.index+1));return(r.line<t.line||r.line===t.line&&r.column<=t.column)&&(r={line:t.line,column:t.column+1}),{start:t,end:r}}getProxyProcessor(){return{set:(e,t,r)=>(e[t]===r||(e[t]=r,"prop"!==t&&"value"!==t&&"name"!==t&&"params"!==t&&"important"!==t&&"text"!==t||e.markDirty()),!0),get:(e,t)=>"proxyOf"===t?e:"root"===t?()=>e.root().toProxy():e[t]}}toProxy(){return this.proxyCache||(this.proxyCache=new Proxy(this,this.getProxyProcessor())),this.proxyCache}addToError(e){if(e.postcssNode=this,e.stack&&this.source&&/\n\s{4}at /.test(e.stack)){let t=this.source;e.stack=e.stack.replace(/\n\s{4}at /,`$&${t.input.from}:${t.start.line}:${t.start.column}$&`)}return e}markDirty(){if(this[ce]){this[ce]=!1;let e=this;for(;e=e.parent;)e[ce]=!1}}get proxyOf(){return this}}var we=me;me.default=me;let ye=we;class ve extends ye{constructor(e){e&&void 0!==e.value&&"string"!=typeof e.value&&(e={...e,value:String(e.value)}),super(e),this.type="decl"}get variable(){return this.prop.startsWith("--")||"$"===this.prop[0]}}var Se=ve;ve.default=ve;var Ce={},be={},_e={},xe={},Oe="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/".split("");xe.encode=function(e){if(0<=e&&e<Oe.length)return Oe[e];throw new TypeError("Must be between 0 and 63: "+e)},xe.decode=function(e){return 65<=e&&e<=90?e-65:97<=e&&e<=122?e-97+26:48<=e&&e<=57?e-48+52:43==e?62:47==e?63:-1};var Ae=xe;_e.encode=function(e){var t,r="",n=function(e){return e<0?1+(-e<<1):0+(e<<1)}(e);do{t=31&n,(n>>>=5)>0&&(t|=32),r+=Ae.encode(t)}while(n>0);return r},_e.decode=function(e,t,r){var n,s,i,o,a=e.length,l=0,u=0;do{if(t>=a)throw new Error("Expected more digits in base 64 VLQ value.");if(-1===(s=Ae.decode(e.charCodeAt(t++))))throw new Error("Invalid base64 digit: "+e.charAt(t-1));n=!!(32&s),l+=(s&=31)<<u,u+=5}while(n);r.value=(o=(i=l)>>1,1==(1&i)?-o:o),r.rest=t};var Me={};!function(e){e.getArg=function(e,t,r){if(t in e)return e[t];if(3===arguments.length)return r;throw new Error('"'+t+'" is a required argument.')};var t=/^(?:([\w+\-.]+):)?\/\/(?:(\w+:\w+)@)?([\w.-]*)(?::(\d+))?(.*)$/,r=/^data:.+\,.+$/;function n(e){var r=e.match(t);return r?{scheme:r[1],auth:r[2],host:r[3],port:r[4],path:r[5]}:null}function s(e){var t="";return e.scheme&&(t+=e.scheme+":"),t+="//",e.auth&&(t+=e.auth+"@"),e.host&&(t+=e.host),e.port&&(t+=":"+e.port),e.path&&(t+=e.path),t}e.urlParse=n,e.urlGenerate=s;var i,o,a=(i=function(t){var r=t,i=n(t);if(i){if(!i.path)return t;r=i.path}for(var o=e.isAbsolute(r),a=[],l=0,u=0;;){if(l=u,-1===(u=r.indexOf("/",l))){a.push(r.slice(l));break}for(a.push(r.slice(l,u));u<r.length&&"/"===r[u];)u++}var c,h=0;for(u=a.length-1;u>=0;u--)"."===(c=a[u])?a.splice(u,1):".."===c?h++:h>0&&(""===c?(a.splice(u+1,h),h=0):(a.splice(u,2),h--));return""===(r=a.join("/"))&&(r=o?"/":"."),i?(i.path=r,s(i)):r},o=[],function(e){for(var t=0;t<o.length;t++)if(o[t].input===e){var r=o[0];return o[0]=o[t],o[t]=r,o[0].result}var n=i(e);return o.unshift({input:e,result:n}),o.length>32&&o.pop(),n});function l(e,t){""===e&&(e="."),""===t&&(t=".");var i=n(t),o=n(e);if(o&&(e=o.path||"/"),i&&!i.scheme)return o&&(i.scheme=o.scheme),s(i);if(i||t.match(r))return t;if(o&&!o.host&&!o.path)return o.host=t,s(o);var l="/"===t.charAt(0)?t:a(e.replace(/\/+$/,"")+"/"+t);return o?(o.path=l,s(o)):l}e.normalize=a,e.join=l,e.isAbsolute=function(e){return"/"===e.charAt(0)||t.test(e)},e.relative=function(e,t){""===e&&(e="."),e=e.replace(/\/$/,"");for(var r=0;0!==t.indexOf(e+"/");){var n=e.lastIndexOf("/");if(n<0)return t;if((e=e.slice(0,n)).match(/^([^\/]+:\/)?\/*$/))return t;++r}return Array(r+1).join("../")+t.substr(e.length+1)};var u=!("__proto__"in Object.create(null));function c(e){return e}function h(e){if(!e)return!1;var t=e.length;if(t<9)return!1;if(95!==e.charCodeAt(t-1)||95!==e.charCodeAt(t-2)||111!==e.charCodeAt(t-3)||116!==e.charCodeAt(t-4)||111!==e.charCodeAt(t-5)||114!==e.charCodeAt(t-6)||112!==e.charCodeAt(t-7)||95!==e.charCodeAt(t-8)||95!==e.charCodeAt(t-9))return!1;for(var r=t-10;r>=0;r--)if(36!==e.charCodeAt(r))return!1;return!0}function p(e,t){return e===t?0:null===e?1:null===t?-1:e>t?1:-1}e.toSetString=u?c:function(e){return h(e)?"$"+e:e},e.fromSetString=u?c:function(e){return h(e)?e.slice(1):e},e.compareByOriginalPositions=function(e,t,r){var n=p(e.source,t.source);return 0!==n||0!==(n=e.originalLine-t.originalLine)||0!==(n=e.originalColumn-t.originalColumn)||r||0!==(n=e.generatedColumn-t.generatedColumn)||0!==(n=e.generatedLine-t.generatedLine)?n:p(e.name,t.name)},e.compareByOriginalPositionsNoSource=function(e,t,r){var n;return 0!==(n=e.originalLine-t.originalLine)||0!==(n=e.originalColumn-t.originalColumn)||r||0!==(n=e.generatedColumn-t.generatedColumn)||0!==(n=e.generatedLine-t.generatedLine)?n:p(e.name,t.name)},e.compareByGeneratedPositionsDeflated=function(e,t,r){var n=e.generatedLine-t.generatedLine;return 0!==n||0!==(n=e.generatedColumn-t.generatedColumn)||r||0!==(n=p(e.source,t.source))||0!==(n=e.originalLine-t.originalLine)||0!==(n=e.originalColumn-t.originalColumn)?n:p(e.name,t.name)},e.compareByGeneratedPositionsDeflatedNoLine=function(e,t,r){var n=e.generatedColumn-t.generatedColumn;return 0!==n||r||0!==(n=p(e.source,t.source))||0!==(n=e.originalLine-t.originalLine)||0!==(n=e.originalColumn-t.originalColumn)?n:p(e.name,t.name)},e.compareByGeneratedPositionsInflated=function(e,t){var r=e.generatedLine-t.generatedLine;return 0!==r||0!==(r=e.generatedColumn-t.generatedColumn)||0!==(r=p(e.source,t.source))||0!==(r=e.originalLine-t.originalLine)||0!==(r=e.originalColumn-t.originalColumn)?r:p(e.name,t.name)},e.parseSourceMapInput=function(e){return JSON.parse(e.replace(/^\)]}'[^\n]*\n/,""))},e.computeSourceURL=function(e,t,r){if(t=t||"",e&&("/"!==e[e.length-1]&&"/"!==t[0]&&(e+="/"),t=e+t),r){var i=n(r);if(!i)throw new Error("sourceMapURL could not be parsed");if(i.path){var o=i.path.lastIndexOf("/");o>=0&&(i.path=i.path.substring(0,o+1))}t=l(s(i),t)}return a(t)}}(Me);var ke={},Ee=Me,Le=Object.prototype.hasOwnProperty,Re="undefined"!=typeof Map;function Pe(){this._array=[],this._set=Re?new Map:Object.create(null)}Pe.fromArray=function(e,t){for(var r=new Pe,n=0,s=e.length;n<s;n++)r.add(e[n],t);return r},Pe.prototype.size=function(){return Re?this._set.size:Object.getOwnPropertyNames(this._set).length},Pe.prototype.add=function(e,t){var r=Re?e:Ee.toSetString(e),n=Re?this.has(e):Le.call(this._set,r),s=this._array.length;n&&!t||this._array.push(e),n||(Re?this._set.set(e,s):this._set[r]=s)},Pe.prototype.has=function(e){if(Re)return this._set.has(e);var t=Ee.toSetString(e);return Le.call(this._set,t)},Pe.prototype.indexOf=function(e){if(Re){var t=this._set.get(e);if(t>=0)return t}else{var r=Ee.toSetString(e);if(Le.call(this._set,r))return this._set[r]}throw new Error('"'+e+'" is not in the set.')},Pe.prototype.at=function(e){if(e>=0&&e<this._array.length)return this._array[e];throw new Error("No element indexed by "+e)},Pe.prototype.toArray=function(){return this._array.slice()},ke.ArraySet=Pe;var Ie={},je=Me;function Ne(){this._array=[],this._sorted=!0,this._last={generatedLine:-1,generatedColumn:0}}Ne.prototype.unsortedForEach=function(e,t){this._array.forEach(e,t)},Ne.prototype.add=function(e){var t,r,n,s,i,o;t=this._last,r=e,n=t.generatedLine,s=r.generatedLine,i=t.generatedColumn,o=r.generatedColumn,s>n||s==n&&o>=i||je.compareByGeneratedPositionsInflated(t,r)<=0?(this._last=e,this._array.push(e)):(this._sorted=!1,this._array.push(e))},Ne.prototype.toArray=function(){return this._sorted||(this._array.sort(je.compareByGeneratedPositionsInflated),this._sorted=!0),this._array},Ie.MappingList=Ne;var Ue=_e,Be=Me,De=ke.ArraySet,Fe=Ie.MappingList;function Te(e){e||(e={}),this._file=Be.getArg(e,"file",null),this._sourceRoot=Be.getArg(e,"sourceRoot",null),this._skipValidation=Be.getArg(e,"skipValidation",!1),this._sources=new De,this._names=new De,this._mappings=new Fe,this._sourcesContents=null}Te.prototype._version=3,Te.fromSourceMap=function(e){var t=e.sourceRoot,r=new Te({file:e.file,sourceRoot:t});return e.eachMapping((function(e){var n={generated:{line:e.generatedLine,column:e.generatedColumn}};null!=e.source&&(n.source=e.source,null!=t&&(n.source=Be.relative(t,n.source)),n.original={line:e.originalLine,column:e.originalColumn},null!=e.name&&(n.name=e.name)),r.addMapping(n)})),e.sources.forEach((function(n){var s=n;null!==t&&(s=Be.relative(t,n)),r._sources.has(s)||r._sources.add(s);var i=e.sourceContentFor(n);null!=i&&r.setSourceContent(n,i)})),r},Te.prototype.addMapping=function(e){var t=Be.getArg(e,"generated"),r=Be.getArg(e,"original",null),n=Be.getArg(e,"source",null),s=Be.getArg(e,"name",null);this._skipValidation||this._validateMapping(t,r,n,s),null!=n&&(n=String(n),this._sources.has(n)||this._sources.add(n)),null!=s&&(s=String(s),this._names.has(s)||this._names.add(s)),this._mappings.add({generatedLine:t.line,generatedColumn:t.column,originalLine:null!=r&&r.line,originalColumn:null!=r&&r.column,source:n,name:s})},Te.prototype.setSourceContent=function(e,t){var r=e;null!=this._sourceRoot&&(r=Be.relative(this._sourceRoot,r)),null!=t?(this._sourcesContents||(this._sourcesContents=Object.create(null)),this._sourcesContents[Be.toSetString(r)]=t):this._sourcesContents&&(delete this._sourcesContents[Be.toSetString(r)],0===Object.keys(this._sourcesContents).length&&(this._sourcesContents=null))},Te.prototype.applySourceMap=function(e,t,r){var n=t;if(null==t){if(null==e.file)throw new Error('SourceMapGenerator.prototype.applySourceMap requires either an explicit source file, or the source map\'s "file" property. Both were omitted.');n=e.file}var s=this._sourceRoot;null!=s&&(n=Be.relative(s,n));var i=new De,o=new De;this._mappings.unsortedForEach((function(t){if(t.source===n&&null!=t.originalLine){var a=e.originalPositionFor({line:t.originalLine,column:t.originalColumn});null!=a.source&&(t.source=a.source,null!=r&&(t.source=Be.join(r,t.source)),null!=s&&(t.source=Be.relative(s,t.source)),t.originalLine=a.line,t.originalColumn=a.column,null!=a.name&&(t.name=a.name))}var l=t.source;null==l||i.has(l)||i.add(l);var u=t.name;null==u||o.has(u)||o.add(u)}),this),this._sources=i,this._names=o,e.sources.forEach((function(t){var n=e.sourceContentFor(t);null!=n&&(null!=r&&(t=Be.join(r,t)),null!=s&&(t=Be.relative(s,t)),this.setSourceContent(t,n))}),this)},Te.prototype._validateMapping=function(e,t,r,n){if(t&&"number"!=typeof t.line&&"number"!=typeof t.column)throw new Error("original.line and original.column are not numbers -- you probably meant to omit the original mapping entirely and only map the generated position. If so, pass null for the original mapping instead of an object with empty or null values.");if((!(e&&"line"in e&&"column"in e&&e.line>0&&e.column>=0)||t||r||n)&&!(e&&"line"in e&&"column"in e&&t&&"line"in t&&"column"in t&&e.line>0&&e.column>=0&&t.line>0&&t.column>=0&&r))throw new Error("Invalid mapping: "+JSON.stringify({generated:e,source:r,original:t,name:n}))},Te.prototype._serializeMappings=function(){for(var e,t,r,n,s=0,i=1,o=0,a=0,l=0,u=0,c="",h=this._mappings.toArray(),p=0,f=h.length;p<f;p++){if(e="",(t=h[p]).generatedLine!==i)for(s=0;t.generatedLine!==i;)e+=";",i++;else if(p>0){if(!Be.compareByGeneratedPositionsInflated(t,h[p-1]))continue;e+=","}e+=Ue.encode(t.generatedColumn-s),s=t.generatedColumn,null!=t.source&&(n=this._sources.indexOf(t.source),e+=Ue.encode(n-u),u=n,e+=Ue.encode(t.originalLine-1-a),a=t.originalLine-1,e+=Ue.encode(t.originalColumn-o),o=t.originalColumn,null!=t.name&&(r=this._names.indexOf(t.name),e+=Ue.encode(r-l),l=r)),c+=e}return c},Te.prototype._generateSourcesContent=function(e,t){return e.map((function(e){if(!this._sourcesContents)return null;null!=t&&(e=Be.relative(t,e));var r=Be.toSetString(e);return Object.prototype.hasOwnProperty.call(this._sourcesContents,r)?this._sourcesContents[r]:null}),this)},Te.prototype.toJSON=function(){var e={version:this._version,sources:this._sources.toArray(),names:this._names.toArray(),mappings:this._serializeMappings()};return null!=this._file&&(e.file=this._file),null!=this._sourceRoot&&(e.sourceRoot=this._sourceRoot),this._sourcesContents&&(e.sourcesContent=this._generateSourcesContent(e.sources,e.sourceRoot)),e},Te.prototype.toString=function(){return JSON.stringify(this.toJSON())},be.SourceMapGenerator=Te;var $e={},Ge={};!function(e){function t(r,n,s,i,o,a){var l=Math.floor((n-r)/2)+r,u=o(s,i[l],!0);return 0===u?l:u>0?n-l>1?t(l,n,s,i,o,a):a==e.LEAST_UPPER_BOUND?n<i.length?n:-1:l:l-r>1?t(r,l,s,i,o,a):a==e.LEAST_UPPER_BOUND?l:r<0?-1:r}e.GREATEST_LOWER_BOUND=1,e.LEAST_UPPER_BOUND=2,e.search=function(r,n,s,i){if(0===n.length)return-1;var o=t(-1,n.length,r,n,s,i||e.GREATEST_LOWER_BOUND);if(o<0)return-1;for(;o-1>=0&&0===s(n[o],n[o-1],!0);)--o;return o}}(Ge);var ze={};function We(e){function t(e,t,r){var n=e[t];e[t]=e[r],e[r]=n}return function e(r,n,s,i){if(s<i){var o=s-1;t(r,(c=s,h=i,Math.round(c+Math.random()*(h-c))),i);for(var a=r[i],l=s;l<i;l++)n(r[l],a,!1)<=0&&t(r,o+=1,l);t(r,o+1,l);var u=o+1;e(r,n,s,u-1),e(r,n,u+1,i)}var c,h}}let Ve=new WeakMap;ze.quickSort=function(e,t,r=0){let n=Ve.get(t);void 0===n&&(n=function(e){let t=We.toString();return new Function(`return ${t}`)()(e)}(t),Ve.set(t,n)),n(e,t,r,e.length-1)};var Je=Me,qe=Ge,Ye=ke.ArraySet,He=_e,Qe=ze.quickSort;function Ze(e,t){var r=e;return"string"==typeof e&&(r=Je.parseSourceMapInput(e)),null!=r.sections?new rt(r,t):new Ke(r,t)}function Ke(e,t){var r=e;"string"==typeof e&&(r=Je.parseSourceMapInput(e));var n=Je.getArg(r,"version"),s=Je.getArg(r,"sources"),i=Je.getArg(r,"names",[]),o=Je.getArg(r,"sourceRoot",null),a=Je.getArg(r,"sourcesContent",null),l=Je.getArg(r,"mappings"),u=Je.getArg(r,"file",null);if(n!=this._version)throw new Error("Unsupported version: "+n);o&&(o=Je.normalize(o)),s=s.map(String).map(Je.normalize).map((function(e){return o&&Je.isAbsolute(o)&&Je.isAbsolute(e)?Je.relative(o,e):e})),this._names=Ye.fromArray(i.map(String),!0),this._sources=Ye.fromArray(s,!0),this._absoluteSources=this._sources.toArray().map((function(e){return Je.computeSourceURL(o,e,t)})),this.sourceRoot=o,this.sourcesContent=a,this._mappings=l,this._sourceMapURL=t,this.file=u}function Xe(){this.generatedLine=0,this.generatedColumn=0,this.source=null,this.originalLine=null,this.originalColumn=null,this.name=null}Ze.fromSourceMap=function(e,t){return Ke.fromSourceMap(e,t)},Ze.prototype._version=3,Ze.prototype.__generatedMappings=null,Object.defineProperty(Ze.prototype,"_generatedMappings",{configurable:!0,enumerable:!0,get:function(){return this.__generatedMappings||this._parseMappings(this._mappings,this.sourceRoot),this.__generatedMappings}}),Ze.prototype.__originalMappings=null,Object.defineProperty(Ze.prototype,"_originalMappings",{configurable:!0,enumerable:!0,get:function(){return this.__originalMappings||this._parseMappings(this._mappings,this.sourceRoot),this.__originalMappings}}),Ze.prototype._charIsMappingSeparator=function(e,t){var r=e.charAt(t);return";"===r||","===r},Ze.prototype._parseMappings=function(e,t){throw new Error("Subclasses must implement _parseMappings")},Ze.GENERATED_ORDER=1,Ze.ORIGINAL_ORDER=2,Ze.GREATEST_LOWER_BOUND=1,Ze.LEAST_UPPER_BOUND=2,Ze.prototype.eachMapping=function(e,t,r){var n,s=t||null;switch(r||Ze.GENERATED_ORDER){case Ze.GENERATED_ORDER:n=this._generatedMappings;break;case Ze.ORIGINAL_ORDER:n=this._originalMappings;break;default:throw new Error("Unknown order of iteration.")}for(var i=this.sourceRoot,o=e.bind(s),a=this._names,l=this._sources,u=this._sourceMapURL,c=0,h=n.length;c<h;c++){var p=n[c],f=null===p.source?null:l.at(p.source);o({source:f=Je.computeSourceURL(i,f,u),generatedLine:p.generatedLine,generatedColumn:p.generatedColumn,originalLine:p.originalLine,originalColumn:p.originalColumn,name:null===p.name?null:a.at(p.name)})}},Ze.prototype.allGeneratedPositionsFor=function(e){var t=Je.getArg(e,"line"),r={source:Je.getArg(e,"source"),originalLine:t,originalColumn:Je.getArg(e,"column",0)};if(r.source=this._findSourceIndex(r.source),r.source<0)return[];var n=[],s=this._findMapping(r,this._originalMappings,"originalLine","originalColumn",Je.compareByOriginalPositions,qe.LEAST_UPPER_BOUND);if(s>=0){var i=this._originalMappings[s];if(void 0===e.column)for(var o=i.originalLine;i&&i.originalLine===o;)n.push({line:Je.getArg(i,"generatedLine",null),column:Je.getArg(i,"generatedColumn",null),lastColumn:Je.getArg(i,"lastGeneratedColumn",null)}),i=this._originalMappings[++s];else for(var a=i.originalColumn;i&&i.originalLine===t&&i.originalColumn==a;)n.push({line:Je.getArg(i,"generatedLine",null),column:Je.getArg(i,"generatedColumn",null),lastColumn:Je.getArg(i,"lastGeneratedColumn",null)}),i=this._originalMappings[++s]}return n},$e.SourceMapConsumer=Ze,Ke.prototype=Object.create(Ze.prototype),Ke.prototype.consumer=Ze,Ke.prototype._findSourceIndex=function(e){var t,r=e;if(null!=this.sourceRoot&&(r=Je.relative(this.sourceRoot,r)),this._sources.has(r))return this._sources.indexOf(r);for(t=0;t<this._absoluteSources.length;++t)if(this._absoluteSources[t]==e)return t;return-1},Ke.fromSourceMap=function(e,t){var r=Object.create(Ke.prototype),n=r._names=Ye.fromArray(e._names.toArray(),!0),s=r._sources=Ye.fromArray(e._sources.toArray(),!0);r.sourceRoot=e._sourceRoot,r.sourcesContent=e._generateSourcesContent(r._sources.toArray(),r.sourceRoot),r.file=e._file,r._sourceMapURL=t,r._absoluteSources=r._sources.toArray().map((function(e){return Je.computeSourceURL(r.sourceRoot,e,t)}));for(var i=e._mappings.toArray().slice(),o=r.__generatedMappings=[],a=r.__originalMappings=[],l=0,u=i.length;l<u;l++){var c=i[l],h=new Xe;h.generatedLine=c.generatedLine,h.generatedColumn=c.generatedColumn,c.source&&(h.source=s.indexOf(c.source),h.originalLine=c.originalLine,h.originalColumn=c.originalColumn,c.name&&(h.name=n.indexOf(c.name)),a.push(h)),o.push(h)}return Qe(r.__originalMappings,Je.compareByOriginalPositions),r},Ke.prototype._version=3,Object.defineProperty(Ke.prototype,"sources",{get:function(){return this._absoluteSources.slice()}});const et=Je.compareByGeneratedPositionsDeflatedNoLine;function tt(e,t){let r=e.length,n=e.length-t;if(!(n<=1))if(2==n){let r=e[t],n=e[t+1];et(r,n)>0&&(e[t]=n,e[t+1]=r)}else if(n<20)for(let n=t;n<r;n++)for(let r=n;r>t;r--){let t=e[r-1],n=e[r];if(et(t,n)<=0)break;e[r-1]=n,e[r]=t}else Qe(e,et,t)}function rt(e,t){var r=e;"string"==typeof e&&(r=Je.parseSourceMapInput(e));var n=Je.getArg(r,"version"),s=Je.getArg(r,"sections");if(n!=this._version)throw new Error("Unsupported version: "+n);this._sources=new Ye,this._names=new Ye;var i={line:-1,column:0};this._sections=s.map((function(e){if(e.url)throw new Error("Support for url field in sections not implemented.");var r=Je.getArg(e,"offset"),n=Je.getArg(r,"line"),s=Je.getArg(r,"column");if(n<i.line||n===i.line&&s<i.column)throw new Error("Section offsets must be ordered and non-overlapping.");return i=r,{generatedOffset:{generatedLine:n+1,generatedColumn:s+1},consumer:new Ze(Je.getArg(e,"map"),t)}}))}Ke.prototype._parseMappings=function(e,t){var r,n,s,i,o=1,a=0,l=0,u=0,c=0,h=0,p=e.length,f=0,d={},g=[],m=[];let w=0;for(;f<p;)if(";"===e.charAt(f))o++,f++,a=0,tt(m,w),w=m.length;else if(","===e.charAt(f))f++;else{for((r=new Xe).generatedLine=o,s=f;s<p&&!this._charIsMappingSeparator(e,s);s++);for(e.slice(f,s),n=[];f<s;)He.decode(e,f,d),i=d.value,f=d.rest,n.push(i);if(2===n.length)throw new Error("Found a source, but no line and column");if(3===n.length)throw new Error("Found a source and line, but no column");if(r.generatedColumn=a+n[0],a=r.generatedColumn,n.length>1&&(r.source=c+n[1],c+=n[1],r.originalLine=l+n[2],l=r.originalLine,r.originalLine+=1,r.originalColumn=u+n[3],u=r.originalColumn,n.length>4&&(r.name=h+n[4],h+=n[4])),m.push(r),"number"==typeof r.originalLine){let e=r.source;for(;g.length<=e;)g.push(null);null===g[e]&&(g[e]=[]),g[e].push(r)}}tt(m,w),this.__generatedMappings=m;for(var y=0;y<g.length;y++)null!=g[y]&&Qe(g[y],Je.compareByOriginalPositionsNoSource);this.__originalMappings=[].concat(...g)},Ke.prototype._findMapping=function(e,t,r,n,s,i){if(e[r]<=0)throw new TypeError("Line must be greater than or equal to 1, got "+e[r]);if(e[n]<0)throw new TypeError("Column must be greater than or equal to 0, got "+e[n]);return qe.search(e,t,s,i)},Ke.prototype.computeColumnSpans=function(){for(var e=0;e<this._generatedMappings.length;++e){var t=this._generatedMappings[e];if(e+1<this._generatedMappings.length){var r=this._generatedMappings[e+1];if(t.generatedLine===r.generatedLine){t.lastGeneratedColumn=r.generatedColumn-1;continue}}t.lastGeneratedColumn=1/0}},Ke.prototype.originalPositionFor=function(e){var t={generatedLine:Je.getArg(e,"line"),generatedColumn:Je.getArg(e,"column")},r=this._findMapping(t,this._generatedMappings,"generatedLine","generatedColumn",Je.compareByGeneratedPositionsDeflated,Je.getArg(e,"bias",Ze.GREATEST_LOWER_BOUND));if(r>=0){var n=this._generatedMappings[r];if(n.generatedLine===t.generatedLine){var s=Je.getArg(n,"source",null);null!==s&&(s=this._sources.at(s),s=Je.computeSourceURL(this.sourceRoot,s,this._sourceMapURL));var i=Je.getArg(n,"name",null);return null!==i&&(i=this._names.at(i)),{source:s,line:Je.getArg(n,"originalLine",null),column:Je.getArg(n,"originalColumn",null),name:i}}}return{source:null,line:null,column:null,name:null}},Ke.prototype.hasContentsOfAllSources=function(){return!!this.sourcesContent&&(this.sourcesContent.length>=this._sources.size()&&!this.sourcesContent.some((function(e){return null==e})))},Ke.prototype.sourceContentFor=function(e,t){if(!this.sourcesContent)return null;var r=this._findSourceIndex(e);if(r>=0)return this.sourcesContent[r];var n,s=e;if(null!=this.sourceRoot&&(s=Je.relative(this.sourceRoot,s)),null!=this.sourceRoot&&(n=Je.urlParse(this.sourceRoot))){var i=s.replace(/^file:\/\//,"");if("file"==n.scheme&&this._sources.has(i))return this.sourcesContent[this._sources.indexOf(i)];if((!n.path||"/"==n.path)&&this._sources.has("/"+s))return this.sourcesContent[this._sources.indexOf("/"+s)]}if(t)return null;throw new Error('"'+s+'" is not in the SourceMap.')},Ke.prototype.generatedPositionFor=function(e){var t=Je.getArg(e,"source");if((t=this._findSourceIndex(t))<0)return{line:null,column:null,lastColumn:null};var r={source:t,originalLine:Je.getArg(e,"line"),originalColumn:Je.getArg(e,"column")},n=this._findMapping(r,this._originalMappings,"originalLine","originalColumn",Je.compareByOriginalPositions,Je.getArg(e,"bias",Ze.GREATEST_LOWER_BOUND));if(n>=0){var s=this._originalMappings[n];if(s.source===r.source)return{line:Je.getArg(s,"generatedLine",null),column:Je.getArg(s,"generatedColumn",null),lastColumn:Je.getArg(s,"lastGeneratedColumn",null)}}return{line:null,column:null,lastColumn:null}},$e.BasicSourceMapConsumer=Ke,rt.prototype=Object.create(Ze.prototype),rt.prototype.constructor=Ze,rt.prototype._version=3,Object.defineProperty(rt.prototype,"sources",{get:function(){for(var e=[],t=0;t<this._sections.length;t++)for(var r=0;r<this._sections[t].consumer.sources.length;r++)e.push(this._sections[t].consumer.sources[r]);return e}}),rt.prototype.originalPositionFor=function(e){var t={generatedLine:Je.getArg(e,"line"),generatedColumn:Je.getArg(e,"column")},r=qe.search(t,this._sections,(function(e,t){var r=e.generatedLine-t.generatedOffset.generatedLine;return r||e.generatedColumn-t.generatedOffset.generatedColumn})),n=this._sections[r];return n?n.consumer.originalPositionFor({line:t.generatedLine-(n.generatedOffset.generatedLine-1),column:t.generatedColumn-(n.generatedOffset.generatedLine===t.generatedLine?n.generatedOffset.generatedColumn-1:0),bias:e.bias}):{source:null,line:null,column:null,name:null}},rt.prototype.hasContentsOfAllSources=function(){return this._sections.every((function(e){return e.consumer.hasContentsOfAllSources()}))},rt.prototype.sourceContentFor=function(e,t){for(var r=0;r<this._sections.length;r++){var n=this._sections[r].consumer.sourceContentFor(e,!0);if(n)return n}if(t)return null;throw new Error('"'+e+'" is not in the SourceMap.')},rt.prototype.generatedPositionFor=function(e){for(var t=0;t<this._sections.length;t++){var r=this._sections[t];if(-1!==r.consumer._findSourceIndex(Je.getArg(e,"source"))){var n=r.consumer.generatedPositionFor(e);if(n)return{line:n.line+(r.generatedOffset.generatedLine-1),column:n.column+(r.generatedOffset.generatedLine===n.line?r.generatedOffset.generatedColumn-1:0)}}}return{line:null,column:null}},rt.prototype._parseMappings=function(e,t){this.__generatedMappings=[],this.__originalMappings=[];for(var r=0;r<this._sections.length;r++)for(var n=this._sections[r],s=n.consumer._generatedMappings,i=0;i<s.length;i++){var o=s[i],a=n.consumer._sources.at(o.source);a=Je.computeSourceURL(n.consumer.sourceRoot,a,this._sourceMapURL),this._sources.add(a),a=this._sources.indexOf(a);var l=null;o.name&&(l=n.consumer._names.at(o.name),this._names.add(l),l=this._names.indexOf(l));var u={source:a,generatedLine:o.generatedLine+(n.generatedOffset.generatedLine-1),generatedColumn:o.generatedColumn+(n.generatedOffset.generatedLine===o.generatedLine?n.generatedOffset.generatedColumn-1:0),originalLine:o.originalLine,originalColumn:o.originalColumn,name:l};this.__generatedMappings.push(u),"number"==typeof u.originalLine&&this.__originalMappings.push(u)}Qe(this.__generatedMappings,Je.compareByGeneratedPositionsDeflated),Qe(this.__originalMappings,Je.compareByOriginalPositions)},$e.IndexedSourceMapConsumer=rt;var nt={},st=be.SourceMapGenerator,it=Me,ot=/(\r?\n)/,at="$$$isSourceNode$$$";function lt(e,t,r,n,s){this.children=[],this.sourceContents={},this.line=null==e?null:e,this.column=null==t?null:t,this.source=null==r?null:r,this.name=null==s?null:s,this[at]=!0,null!=n&&this.add(n)}lt.fromStringWithSourceMap=function(e,t,r){var n=new lt,s=e.split(ot),i=0,o=function(){return e()+(e()||"");function e(){return i<s.length?s[i++]:void 0}},a=1,l=0,u=null;return t.eachMapping((function(e){if(null!==u){if(!(a<e.generatedLine)){var t=(r=s[i]||"").substr(0,e.generatedColumn-l);return s[i]=r.substr(e.generatedColumn-l),l=e.generatedColumn,c(u,t),void(u=e)}c(u,o()),a++,l=0}for(;a<e.generatedLine;)n.add(o()),a++;if(l<e.generatedColumn){var r=s[i]||"";n.add(r.substr(0,e.generatedColumn)),s[i]=r.substr(e.generatedColumn),l=e.generatedColumn}u=e}),this),i<s.length&&(u&&c(u,o()),n.add(s.splice(i).join(""))),t.sources.forEach((function(e){var s=t.sourceContentFor(e);null!=s&&(null!=r&&(e=it.join(r,e)),n.setSourceContent(e,s))})),n;function c(e,t){if(null===e||void 0===e.source)n.add(t);else{var s=r?it.join(r,e.source):e.source;n.add(new lt(e.originalLine,e.originalColumn,s,t,e.name))}}},lt.prototype.add=function(e){if(Array.isArray(e))e.forEach((function(e){this.add(e)}),this);else{if(!e[at]&&"string"!=typeof e)throw new TypeError("Expected a SourceNode, string, or an array of SourceNodes and strings. Got "+e);e&&this.children.push(e)}return this},lt.prototype.prepend=function(e){if(Array.isArray(e))for(var t=e.length-1;t>=0;t--)this.prepend(e[t]);else{if(!e[at]&&"string"!=typeof e)throw new TypeError("Expected a SourceNode, string, or an array of SourceNodes and strings. Got "+e);this.children.unshift(e)}return this},lt.prototype.walk=function(e){for(var t,r=0,n=this.children.length;r<n;r++)(t=this.children[r])[at]?t.walk(e):""!==t&&e(t,{source:this.source,line:this.line,column:this.column,name:this.name})},lt.prototype.join=function(e){var t,r,n=this.children.length;if(n>0){for(t=[],r=0;r<n-1;r++)t.push(this.children[r]),t.push(e);t.push(this.children[r]),this.children=t}return this},lt.prototype.replaceRight=function(e,t){var r=this.children[this.children.length-1];return r[at]?r.replaceRight(e,t):"string"==typeof r?this.children[this.children.length-1]=r.replace(e,t):this.children.push("".replace(e,t)),this},lt.prototype.setSourceContent=function(e,t){this.sourceContents[it.toSetString(e)]=t},lt.prototype.walkSourceContents=function(e){for(var t=0,r=this.children.length;t<r;t++)this.children[t][at]&&this.children[t].walkSourceContents(e);var n=Object.keys(this.sourceContents);for(t=0,r=n.length;t<r;t++)e(it.fromSetString(n[t]),this.sourceContents[n[t]])},lt.prototype.toString=function(){var e="";return this.walk((function(t){e+=t})),e},lt.prototype.toStringWithSourceMap=function(e){var t={code:"",line:1,column:0},r=new st(e),n=!1,s=null,i=null,o=null,a=null;return this.walk((function(e,l){t.code+=e,null!==l.source&&null!==l.line&&null!==l.column?(s===l.source&&i===l.line&&o===l.column&&a===l.name||r.addMapping({source:l.source,original:{line:l.line,column:l.column},generated:{line:t.line,column:t.column},name:l.name}),s=l.source,i=l.line,o=l.column,a=l.name,n=!0):n&&(r.addMapping({generated:{line:t.line,column:t.column}}),s=null,n=!1);for(var u=0,c=e.length;u<c;u++)10===e.charCodeAt(u)?(t.line++,t.column=0,u+1===c?(s=null,n=!1):n&&r.addMapping({source:l.source,original:{line:l.line,column:l.column},generated:{line:t.line,column:t.column},name:l.name})):t.column++})),this.walkSourceContents((function(e,t){r.setSourceContent(e,t)})),{code:t.code,map:r}},nt.SourceNode=lt,Ce.SourceMapGenerator=be.SourceMapGenerator,Ce.SourceMapConsumer=$e.SourceMapConsumer,Ce.SourceNode=nt.SourceNode;var ut={nanoid:(e=21)=>{let t="",r=e;for(;r--;)t+="useandom-26T198340PX75pxJACKVERYMINDBUSHWOLF_GQZbfghjklqvwyzrict"[64*Math.random()|0];return t},customAlphabet:(e,t)=>()=>{let r="",n=t;for(;n--;)r+=e[Math.random()*e.length|0];return r}};let{SourceMapConsumer:ct,SourceMapGenerator:ht}=Ce,{existsSync:pt,readFileSync:ft}=c.default,{dirname:dt,join:gt}=l.default;class mt{constructor(e,t){if(!1===t.map)return;this.loadAnnotation(e),this.inline=this.startWith(this.annotation,"data:");let r=t.map?t.map.prev:void 0,n=this.loadMap(t.from,r);!this.mapFile&&t.from&&(this.mapFile=t.from),this.mapFile&&(this.root=dt(this.mapFile)),n&&(this.text=n)}consumer(){return this.consumerCache||(this.consumerCache=new ct(this.text)),this.consumerCache}withContent(){return!!(this.consumer().sourcesContent&&this.consumer().sourcesContent.length>0)}startWith(e,t){return!!e&&e.substr(0,t.length)===t}getAnnotationURL(e){return e.replace(/^\/\*\s*# sourceMappingURL=/,"").trim()}loadAnnotation(e){let t=e.match(/\/\*\s*# sourceMappingURL=/gm);if(!t)return;let r=e.lastIndexOf(t.pop()),n=e.indexOf("*/",r);r>-1&&n>-1&&(this.annotation=this.getAnnotationURL(e.substring(r,n)))}decodeInline(e){if(/^data:application\/json;charset=utf-?8,/.test(e)||/^data:application\/json,/.test(e))return decodeURIComponent(e.substr(RegExp.lastMatch.length));if(/^data:application\/json;charset=utf-?8;base64,/.test(e)||/^data:application\/json;base64,/.test(e))return t=e.substr(RegExp.lastMatch.length),Buffer?Buffer.from(t,"base64").toString():window.atob(t);var t;let r=e.match(/data:application\/json;([^,]+),/)[1];throw new Error("Unsupported source map encoding "+r)}loadFile(e){if(this.root=dt(e),pt(e))return this.mapFile=e,ft(e,"utf-8").toString().trim()}loadMap(e,t){if(!1===t)return!1;if(t){if("string"==typeof t)return t;if("function"!=typeof t){if(t instanceof ct)return ht.fromSourceMap(t).toString();if(t instanceof ht)return t.toString();if(this.isMap(t))return JSON.stringify(t);throw new Error("Unsupported previous source map format: "+t.toString())}{let r=t(e);if(r){let e=this.loadFile(r);if(!e)throw new Error("Unable to load previous source map: "+r.toString());return e}}}else{if(this.inline)return this.decodeInline(this.annotation);if(this.annotation){let t=this.annotation;return e&&(t=gt(dt(e),t)),this.loadFile(t)}}}isMap(e){return"object"==typeof e&&("string"==typeof e.mappings||"string"==typeof e._mappings||Array.isArray(e.sections))}}var wt=mt;mt.default=mt;let{SourceMapConsumer:yt,SourceMapGenerator:vt}=Ce,{fileURLToPath:St,pathToFileURL:Ct}=u.default,{resolve:bt,isAbsolute:_t}=l.default,{nanoid:xt}=ut,Ot=K,At=re,Mt=wt,kt=Symbol("fromOffsetCache"),Et=Boolean(yt&&vt),Lt=Boolean(bt&&_t);class Rt{constructor(e,t={}){if(null==e||"object"==typeof e&&!e.toString)throw new Error(`PostCSS received ${e} instead of CSS string`);if(this.css=e.toString(),"\ufeff"===this.css[0]||""===this.css[0]?(this.hasBOM=!0,this.css=this.css.slice(1)):this.hasBOM=!1,t.from&&(!Lt||/^\w+:\/\//.test(t.from)||_t(t.from)?this.file=t.from:this.file=bt(t.from)),Lt&&Et){let e=new Mt(this.css,t);if(e.text){this.map=e;let t=e.consumer().file;!this.file&&t&&(this.file=this.mapResolve(t))}}this.file||(this.id="<input css "+xt(6)+">"),this.map&&(this.map.file=this.from)}fromOffset(e){let t,r;if(this[kt])r=this[kt];else{let e=this.css.split("\n");r=new Array(e.length);let t=0;for(let n=0,s=e.length;n<s;n++)r[n]=t,t+=e[n].length+1;this[kt]=r}t=r[r.length-1];let n=0;if(e>=t)n=r.length-1;else{let t,s=r.length-2;for(;n<s;)if(t=n+(s-n>>1),e<r[t])s=t-1;else{if(!(e>=r[t+1])){n=t;break}n=t+1}}return{line:n+1,col:e-r[n]+1}}error(e,t,r,n={}){let s,i,o;if(t&&"object"==typeof t){let e=t,n=r;if("number"==typeof t.offset){let n=this.fromOffset(e.offset);t=n.line,r=n.col}else t=e.line,r=e.column;if("number"==typeof n.offset){let e=this.fromOffset(n.offset);i=e.line,o=e.col}else i=n.line,o=n.column}else if(!r){let e=this.fromOffset(t);t=e.line,r=e.col}let a=this.origin(t,r,i,o);return s=a?new At(e,void 0===a.endLine?a.line:{line:a.line,column:a.column},void 0===a.endLine?a.column:{line:a.endLine,column:a.endColumn},a.source,a.file,n.plugin):new At(e,void 0===i?t:{line:t,column:r},void 0===i?r:{line:i,column:o},this.css,this.file,n.plugin),s.input={line:t,column:r,endLine:i,endColumn:o,source:this.css},this.file&&(Ct&&(s.input.url=Ct(this.file).toString()),s.input.file=this.file),s}origin(e,t,r,n){if(!this.map)return!1;let s,i,o=this.map.consumer(),a=o.originalPositionFor({line:e,column:t});if(!a.source)return!1;"number"==typeof r&&(s=o.originalPositionFor({line:r,column:n})),i=_t(a.source)?Ct(a.source):new URL(a.source,this.map.consumer().sourceRoot||Ct(this.map.mapFile));let l={url:i.toString(),line:a.line,column:a.column,endLine:s&&s.line,endColumn:s&&s.column};if("file:"===i.protocol){if(!St)throw new Error("file: protocol is not available in this PostCSS build");l.file=St(i)}let u=o.sourceContentFor(a.source);return u&&(l.source=u),l}mapResolve(e){return/^\w+:\/\//.test(e)?e:bt(this.map.consumer().sourceRoot||this.map.root||".",e)}get from(){return this.file||this.id}toJSON(){let e={};for(let t of["hasBOM","css","file","id"])null!=this[t]&&(e[t]=this[t]);return this.map&&(e.map={...this.map},e.map.consumerCache&&(e.map.consumerCache=void 0)),e}}var Pt=Rt;Rt.default=Rt,Ot&&Ot.registerInput&&Ot.registerInput(Rt);let{SourceMapConsumer:It,SourceMapGenerator:jt}=Ce,{dirname:Nt,resolve:Ut,relative:Bt,sep:Dt}=l.default,{pathToFileURL:Ft}=u.default,Tt=Pt,$t=Boolean(It&&jt),Gt=Boolean(Nt&&Ut&&Bt&&Dt);var zt=class{constructor(e,t,r,n){this.stringify=e,this.mapOpts=r.map||{},this.root=t,this.opts=r,this.css=n}isMap(){return void 0!==this.opts.map?!!this.opts.map:this.previous().length>0}previous(){if(!this.previousMaps)if(this.previousMaps=[],this.root)this.root.walk((e=>{if(e.source&&e.source.input.map){let t=e.source.input.map;this.previousMaps.includes(t)||this.previousMaps.push(t)}}));else{let e=new Tt(this.css,this.opts);e.map&&this.previousMaps.push(e.map)}return this.previousMaps}isInline(){if(void 0!==this.mapOpts.inline)return this.mapOpts.inline;let e=this.mapOpts.annotation;return(void 0===e||!0===e)&&(!this.previous().length||this.previous().some((e=>e.inline)))}isSourcesContent(){return void 0!==this.mapOpts.sourcesContent?this.mapOpts.sourcesContent:!this.previous().length||this.previous().some((e=>e.withContent()))}clearAnnotation(){if(!1!==this.mapOpts.annotation)if(this.root){let e;for(let t=this.root.nodes.length-1;t>=0;t--)e=this.root.nodes[t],"comment"===e.type&&0===e.text.indexOf("# sourceMappingURL=")&&this.root.removeChild(t)}else this.css&&(this.css=this.css.replace(/(\n)?\/\*#[\S\s]*?\*\/$/gm,""))}setSourcesContent(){let e={};if(this.root)this.root.walk((t=>{if(t.source){let r=t.source.input.from;r&&!e[r]&&(e[r]=!0,this.map.setSourceContent(this.toUrl(this.path(r)),t.source.input.css))}}));else if(this.css){let e=this.opts.from?this.toUrl(this.path(this.opts.from)):"<no source>";this.map.setSourceContent(e,this.css)}}applyPrevMaps(){for(let e of this.previous()){let t,r=this.toUrl(this.path(e.file)),n=e.root||Nt(e.file);!1===this.mapOpts.sourcesContent?(t=new It(e.text),t.sourcesContent&&(t.sourcesContent=t.sourcesContent.map((()=>null)))):t=e.consumer(),this.map.applySourceMap(t,r,this.toUrl(this.path(n)))}}isAnnotation(){return!!this.isInline()||(void 0!==this.mapOpts.annotation?this.mapOpts.annotation:!this.previous().length||this.previous().some((e=>e.annotation)))}toBase64(e){return Buffer?Buffer.from(e).toString("base64"):window.btoa(unescape(encodeURIComponent(e)))}addAnnotation(){let e;e=this.isInline()?"data:application/json;base64,"+this.toBase64(this.map.toString()):"string"==typeof this.mapOpts.annotation?this.mapOpts.annotation:"function"==typeof this.mapOpts.annotation?this.mapOpts.annotation(this.opts.to,this.root):this.outputFile()+".map";let t="\n";this.css.includes("\r\n")&&(t="\r\n"),this.css+=t+"/*# sourceMappingURL="+e+" */"}outputFile(){return this.opts.to?this.path(this.opts.to):this.opts.from?this.path(this.opts.from):"to.css"}generateMap(){if(this.root)this.generateString();else if(1===this.previous().length){let e=this.previous()[0].consumer();e.file=this.outputFile(),this.map=jt.fromSourceMap(e)}else this.map=new jt({file:this.outputFile()}),this.map.addMapping({source:this.opts.from?this.toUrl(this.path(this.opts.from)):"<no source>",generated:{line:1,column:0},original:{line:1,column:0}});return this.isSourcesContent()&&this.setSourcesContent(),this.root&&this.previous().length>0&&this.applyPrevMaps(),this.isAnnotation()&&this.addAnnotation(),this.isInline()?[this.css]:[this.css,this.map]}path(e){if(0===e.indexOf("<"))return e;if(/^\w+:\/\//.test(e))return e;if(this.mapOpts.absolute)return e;let t=this.opts.to?Nt(this.opts.to):".";return"string"==typeof this.mapOpts.annotation&&(t=Nt(Ut(t,this.mapOpts.annotation))),e=Bt(t,e)}toUrl(e){return"\\"===Dt&&(e=e.replace(/\\/g,"/")),encodeURI(e).replace(/[#?]/g,encodeURIComponent)}sourcePath(e){if(this.mapOpts.from)return this.toUrl(this.mapOpts.from);if(this.mapOpts.absolute){if(Ft)return Ft(e.source.input.from).toString();throw new Error("`map.absolute` option is not available in this PostCSS build")}return this.toUrl(this.path(e.source.input.from))}generateString(){this.css="",this.map=new jt({file:this.outputFile()});let e,t,r=1,n=1,s="<no source>",i={source:"",generated:{line:0,column:0},original:{line:0,column:0}};this.stringify(this.root,((o,a,l)=>{if(this.css+=o,a&&"end"!==l&&(i.generated.line=r,i.generated.column=n-1,a.source&&a.source.start?(i.source=this.sourcePath(a),i.original.line=a.source.start.line,i.original.column=a.source.start.column-1,this.map.addMapping(i)):(i.source=s,i.original.line=1,i.original.column=0,this.map.addMapping(i))),e=o.match(/\n/g),e?(r+=e.length,t=o.lastIndexOf("\n"),n=o.length-t):n+=o.length,a&&"start"!==l){let e=a.parent||{raws:{}};("decl"!==a.type||a!==e.last||e.raws.semicolon)&&(a.source&&a.source.end?(i.source=this.sourcePath(a),i.original.line=a.source.end.line,i.original.column=a.source.end.column-1,i.generated.line=r,i.generated.column=n-2,this.map.addMapping(i)):(i.source=s,i.original.line=1,i.original.column=0,i.generated.line=r,i.generated.column=n-1,this.map.addMapping(i)))}}))}generate(){if(this.clearAnnotation(),Gt&&$t&&this.isMap())return this.generateMap();{let e="";return this.stringify(this.root,(t=>{e+=t})),[e]}}};let Wt=we;class Vt extends Wt{constructor(e){super(e),this.type="comment"}}var Jt=Vt;Vt.default=Vt;let qt,Yt,Ht,{isClean:Qt,my:Zt}=ne,Kt=Se,Xt=Jt,er=we;function tr(e){return e.map((e=>(e.nodes&&(e.nodes=tr(e.nodes)),delete e.source,e)))}function rr(e){if(e[Qt]=!1,e.proxyOf.nodes)for(let t of e.proxyOf.nodes)rr(t)}class nr extends er{push(e){return e.parent=this,this.proxyOf.nodes.push(e),this}each(e){if(!this.proxyOf.nodes)return;let t,r,n=this.getIterator();for(;this.indexes[n]<this.proxyOf.nodes.length&&(t=this.indexes[n],r=e(this.proxyOf.nodes[t],t),!1!==r);)this.indexes[n]+=1;return delete this.indexes[n],r}walk(e){return this.each(((t,r)=>{let n;try{n=e(t,r)}catch(e){throw t.addToError(e)}return!1!==n&&t.walk&&(n=t.walk(e)),n}))}walkDecls(e,t){return t?e instanceof RegExp?this.walk(((r,n)=>{if("decl"===r.type&&e.test(r.prop))return t(r,n)})):this.walk(((r,n)=>{if("decl"===r.type&&r.prop===e)return t(r,n)})):(t=e,this.walk(((e,r)=>{if("decl"===e.type)return t(e,r)})))}walkRules(e,t){return t?e instanceof RegExp?this.walk(((r,n)=>{if("rule"===r.type&&e.test(r.selector))return t(r,n)})):this.walk(((r,n)=>{if("rule"===r.type&&r.selector===e)return t(r,n)})):(t=e,this.walk(((e,r)=>{if("rule"===e.type)return t(e,r)})))}walkAtRules(e,t){return t?e instanceof RegExp?this.walk(((r,n)=>{if("atrule"===r.type&&e.test(r.name))return t(r,n)})):this.walk(((r,n)=>{if("atrule"===r.type&&r.name===e)return t(r,n)})):(t=e,this.walk(((e,r)=>{if("atrule"===e.type)return t(e,r)})))}walkComments(e){return this.walk(((t,r)=>{if("comment"===t.type)return e(t,r)}))}append(...e){for(let t of e){let e=this.normalize(t,this.last);for(let t of e)this.proxyOf.nodes.push(t)}return this.markDirty(),this}prepend(...e){e=e.reverse();for(let t of e){let e=this.normalize(t,this.first,"prepend").reverse();for(let t of e)this.proxyOf.nodes.unshift(t);for(let t in this.indexes)this.indexes[t]=this.indexes[t]+e.length}return this.markDirty(),this}cleanRaws(e){if(super.cleanRaws(e),this.nodes)for(let t of this.nodes)t.cleanRaws(e)}insertBefore(e,t){let r,n=0===(e=this.index(e))&&"prepend",s=this.normalize(t,this.proxyOf.nodes[e],n).reverse();for(let t of s)this.proxyOf.nodes.splice(e,0,t);for(let t in this.indexes)r=this.indexes[t],e<=r&&(this.indexes[t]=r+s.length);return this.markDirty(),this}insertAfter(e,t){e=this.index(e);let r,n=this.normalize(t,this.proxyOf.nodes[e]).reverse();for(let t of n)this.proxyOf.nodes.splice(e+1,0,t);for(let t in this.indexes)r=this.indexes[t],e<r&&(this.indexes[t]=r+n.length);return this.markDirty(),this}removeChild(e){let t;e=this.index(e),this.proxyOf.nodes[e].parent=void 0,this.proxyOf.nodes.splice(e,1);for(let r in this.indexes)t=this.indexes[r],t>=e&&(this.indexes[r]=t-1);return this.markDirty(),this}removeAll(){for(let e of this.proxyOf.nodes)e.parent=void 0;return this.proxyOf.nodes=[],this.markDirty(),this}replaceValues(e,t,r){return r||(r=t,t={}),this.walkDecls((n=>{t.props&&!t.props.includes(n.prop)||t.fast&&!n.value.includes(t.fast)||(n.value=n.value.replace(e,r))})),this.markDirty(),this}every(e){return this.nodes.every(e)}some(e){return this.nodes.some(e)}index(e){return"number"==typeof e?e:(e.proxyOf&&(e=e.proxyOf),this.proxyOf.nodes.indexOf(e))}get first(){if(this.proxyOf.nodes)return this.proxyOf.nodes[0]}get last(){if(this.proxyOf.nodes)return this.proxyOf.nodes[this.proxyOf.nodes.length-1]}normalize(e,t){if("string"==typeof e)e=tr(qt(e).nodes);else if(Array.isArray(e)){e=e.slice(0);for(let t of e)t.parent&&t.parent.removeChild(t,"ignore")}else if("root"===e.type&&"document"!==this.type){e=e.nodes.slice(0);for(let t of e)t.parent&&t.parent.removeChild(t,"ignore")}else if(e.type)e=[e];else if(e.prop){if(void 0===e.value)throw new Error("Value field is missed in node creation");"string"!=typeof e.value&&(e.value=String(e.value)),e=[new Kt(e)]}else if(e.selector)e=[new Yt(e)];else if(e.name)e=[new Ht(e)];else{if(!e.text)throw new Error("Unknown node type in node creation");e=[new Xt(e)]}return e.map((e=>(e[Zt]||nr.rebuild(e),(e=e.proxyOf).parent&&e.parent.removeChild(e),e[Qt]&&rr(e),void 0===e.raws.before&&t&&void 0!==t.raws.before&&(e.raws.before=t.raws.before.replace(/\S/g,"")),e.parent=this,e)))}getProxyProcessor(){return{set:(e,t,r)=>(e[t]===r||(e[t]=r,"name"!==t&&"params"!==t&&"selector"!==t||e.markDirty()),!0),get:(e,t)=>"proxyOf"===t?e:e[t]?"each"===t||"string"==typeof t&&t.startsWith("walk")?(...r)=>e[t](...r.map((e=>"function"==typeof e?(t,r)=>e(t.toProxy(),r):e))):"every"===t||"some"===t?r=>e[t](((e,...t)=>r(e.toProxy(),...t))):"root"===t?()=>e.root().toProxy():"nodes"===t?e.nodes.map((e=>e.toProxy())):"first"===t||"last"===t?e[t].toProxy():e[t]:e[t]}}getIterator(){this.lastEach||(this.lastEach=0),this.indexes||(this.indexes={}),this.lastEach+=1;let e=this.lastEach;return this.indexes[e]=0,e}}nr.registerParse=e=>{qt=e},nr.registerRule=e=>{Yt=e},nr.registerAtRule=e=>{Ht=e};var sr=nr;nr.default=nr,nr.rebuild=e=>{"atrule"===e.type?Object.setPrototypeOf(e,Ht.prototype):"rule"===e.type?Object.setPrototypeOf(e,Yt.prototype):"decl"===e.type?Object.setPrototypeOf(e,Kt.prototype):"comment"===e.type&&Object.setPrototypeOf(e,Xt.prototype),e[Zt]=!0,e.nodes&&e.nodes.forEach((e=>{nr.rebuild(e)}))};let ir,or,ar=sr;class lr extends ar{constructor(e){super({type:"document",...e}),this.nodes||(this.nodes=[])}toResult(e={}){return new ir(new or,this,e).stringify()}}lr.registerLazyResult=e=>{ir=e},lr.registerProcessor=e=>{or=e};var ur=lr;lr.default=lr;let cr={};var hr=function(e){cr[e]||(cr[e]=!0,"undefined"!=typeof console&&console.warn&&console.warn(e))};class pr{constructor(e,t={}){if(this.type="warning",this.text=e,t.node&&t.node.source){let e=t.node.rangeBy(t);this.line=e.start.line,this.column=e.start.column,this.endLine=e.end.line,this.endColumn=e.end.column}for(let e in t)this[e]=t[e]}toString(){return this.node?this.node.error(this.text,{plugin:this.plugin,index:this.index,word:this.word}).message:this.plugin?this.plugin+": "+this.text:this.text}}var fr=pr;pr.default=pr;let dr=fr;class gr{constructor(e,t,r){this.processor=e,this.messages=[],this.root=t,this.opts=r,this.css=void 0,this.map=void 0}toString(){return this.css}warn(e,t={}){t.plugin||this.lastPlugin&&this.lastPlugin.postcssPlugin&&(t.plugin=this.lastPlugin.postcssPlugin);let r=new dr(e,t);return this.messages.push(r),r}warnings(){return this.messages.filter((e=>"warning"===e.type))}get content(){return this.css}}var mr=gr;gr.default=gr;let wr=sr;class yr extends wr{constructor(e){super(e),this.type="atrule"}append(...e){return this.proxyOf.nodes||(this.nodes=[]),super.append(...e)}prepend(...e){return this.proxyOf.nodes||(this.nodes=[]),super.prepend(...e)}}var vr=yr;yr.default=yr,wr.registerAtRule(yr);let Sr,Cr,br=sr;class _r extends br{constructor(e){super(e),this.type="root",this.nodes||(this.nodes=[])}removeChild(e,t){let r=this.index(e);return!t&&0===r&&this.nodes.length>1&&(this.nodes[1].raws.before=this.nodes[r].raws.before),super.removeChild(e)}normalize(e,t,r){let n=super.normalize(e);if(t)if("prepend"===r)this.nodes.length>1?t.raws.before=this.nodes[1].raws.before:delete t.raws.before;else if(this.first!==t)for(let e of n)e.raws.before=t.raws.before;return n}toResult(e={}){return new Sr(new Cr,this,e).stringify()}}_r.registerLazyResult=e=>{Sr=e},_r.registerProcessor=e=>{Cr=e};var xr=_r;_r.default=_r;let Or={split(e,t,r){let n=[],s="",i=!1,o=0,a=!1,l=!1;for(let r of e)l?l=!1:"\\"===r?l=!0:a?r===a&&(a=!1):'"'===r||"'"===r?a=r:"("===r?o+=1:")"===r?o>0&&(o-=1):0===o&&t.includes(r)&&(i=!0),i?(""!==s&&n.push(s.trim()),s="",i=!1):s+=r;return(r||""!==s)&&n.push(s.trim()),n},space:e=>Or.split(e,[" ","\n","\t"]),comma:e=>Or.split(e,[","],!0)};var Ar=Or;Or.default=Or;let Mr=sr,kr=Ar;class Er extends Mr{constructor(e){super(e),this.type="rule",this.nodes||(this.nodes=[])}get selectors(){return kr.comma(this.selector)}set selectors(e){let t=this.selector?this.selector.match(/,\s*/):null,r=t?t[0]:","+this.raw("between","beforeOpen");this.selector=e.join(r)}}var Lr=Er;Er.default=Er,Mr.registerRule(Er);let Rr=Se,Pr=V,Ir=Jt,jr=vr,Nr=xr,Ur=Lr;var Br=class{constructor(e){this.input=e,this.root=new Nr,this.current=this.root,this.spaces="",this.semicolon=!1,this.customProperty=!1,this.createTokenizer(),this.root.source={input:e,start:{offset:0,line:1,column:1}}}createTokenizer(){this.tokenizer=Pr(this.input)}parse(){let e;for(;!this.tokenizer.endOfFile();)switch(e=this.tokenizer.nextToken(),e[0]){case"space":this.spaces+=e[1];break;case";":this.freeSemicolon(e);break;case"}":this.end(e);break;case"comment":this.comment(e);break;case"at-word":this.atrule(e);break;case"{":this.emptyRule(e);break;default:this.other(e)}this.endFile()}comment(e){let t=new Ir;this.init(t,e[2]),t.source.end=this.getPosition(e[3]||e[2]);let r=e[1].slice(2,-2);if(/^\s*$/.test(r))t.text="",t.raws.left=r,t.raws.right="";else{let e=r.match(/^(\s*)([^]*\S)(\s*)$/);t.text=e[2],t.raws.left=e[1],t.raws.right=e[3]}}emptyRule(e){let t=new Ur;this.init(t,e[2]),t.selector="",t.raws.between="",this.current=t}other(e){let t=!1,r=null,n=!1,s=null,i=[],o=e[1].startsWith("--"),a=[],l=e;for(;l;){if(r=l[0],a.push(l),"("===r||"["===r)s||(s=l),i.push("("===r?")":"]");else if(o&&n&&"{"===r)s||(s=l),i.push("}");else if(0===i.length){if(";"===r){if(n)return void this.decl(a,o);break}if("{"===r)return void this.rule(a);if("}"===r){this.tokenizer.back(a.pop()),t=!0;break}":"===r&&(n=!0)}else r===i[i.length-1]&&(i.pop(),0===i.length&&(s=null));l=this.tokenizer.nextToken()}if(this.tokenizer.endOfFile()&&(t=!0),i.length>0&&this.unclosedBracket(s),t&&n){if(!o)for(;a.length&&(l=a[a.length-1][0],"space"===l||"comment"===l);)this.tokenizer.back(a.pop());this.decl(a,o)}else this.unknownWord(a)}rule(e){e.pop();let t=new Ur;this.init(t,e[0][2]),t.raws.between=this.spacesAndCommentsFromEnd(e),this.raw(t,"selector",e),this.current=t}decl(e,t){let r=new Rr;this.init(r,e[0][2]);let n,s=e[e.length-1];for(";"===s[0]&&(this.semicolon=!0,e.pop()),r.source.end=this.getPosition(s[3]||s[2]);"word"!==e[0][0];)1===e.length&&this.unknownWord(e),r.raws.before+=e.shift()[1];for(r.source.start=this.getPosition(e[0][2]),r.prop="";e.length;){let t=e[0][0];if(":"===t||"space"===t||"comment"===t)break;r.prop+=e.shift()[1]}for(r.raws.between="";e.length;){if(n=e.shift(),":"===n[0]){r.raws.between+=n[1];break}"word"===n[0]&&/\w/.test(n[1])&&this.unknownWord([n]),r.raws.between+=n[1]}"_"!==r.prop[0]&&"*"!==r.prop[0]||(r.raws.before+=r.prop[0],r.prop=r.prop.slice(1));let i,o=[];for(;e.length&&(i=e[0][0],"space"===i||"comment"===i);)o.push(e.shift());this.precheckMissedSemicolon(e);for(let t=e.length-1;t>=0;t--){if(n=e[t],"!important"===n[1].toLowerCase()){r.important=!0;let n=this.stringFrom(e,t);n=this.spacesFromEnd(e)+n," !important"!==n&&(r.raws.important=n);break}if("important"===n[1].toLowerCase()){let n=e.slice(0),s="";for(let e=t;e>0;e--){let t=n[e][0];if(0===s.trim().indexOf("!")&&"space"!==t)break;s=n.pop()[1]+s}0===s.trim().indexOf("!")&&(r.important=!0,r.raws.important=s,e=n)}if("space"!==n[0]&&"comment"!==n[0])break}e.some((e=>"space"!==e[0]&&"comment"!==e[0]))&&(r.raws.between+=o.map((e=>e[1])).join(""),o=[]),this.raw(r,"value",o.concat(e),t),r.value.includes(":")&&!t&&this.checkMissedSemicolon(e)}atrule(e){let t,r,n,s=new jr;s.name=e[1].slice(1),""===s.name&&this.unnamedAtrule(s,e),this.init(s,e[2]);let i=!1,o=!1,a=[],l=[];for(;!this.tokenizer.endOfFile();){if(t=(e=this.tokenizer.nextToken())[0],"("===t||"["===t?l.push("("===t?")":"]"):"{"===t&&l.length>0?l.push("}"):t===l[l.length-1]&&l.pop(),0===l.length){if(";"===t){s.source.end=this.getPosition(e[2]),this.semicolon=!0;break}if("{"===t){o=!0;break}if("}"===t){if(a.length>0){for(n=a.length-1,r=a[n];r&&"space"===r[0];)r=a[--n];r&&(s.source.end=this.getPosition(r[3]||r[2]))}this.end(e);break}a.push(e)}else a.push(e);if(this.tokenizer.endOfFile()){i=!0;break}}s.raws.between=this.spacesAndCommentsFromEnd(a),a.length?(s.raws.afterName=this.spacesAndCommentsFromStart(a),this.raw(s,"params",a),i&&(e=a[a.length-1],s.source.end=this.getPosition(e[3]||e[2]),this.spaces=s.raws.between,s.raws.between="")):(s.raws.afterName="",s.params=""),o&&(s.nodes=[],this.current=s)}end(e){this.current.nodes&&this.current.nodes.length&&(this.current.raws.semicolon=this.semicolon),this.semicolon=!1,this.current.raws.after=(this.current.raws.after||"")+this.spaces,this.spaces="",this.current.parent?(this.current.source.end=this.getPosition(e[2]),this.current=this.current.parent):this.unexpectedClose(e)}endFile(){this.current.parent&&this.unclosedBlock(),this.current.nodes&&this.current.nodes.length&&(this.current.raws.semicolon=this.semicolon),this.current.raws.after=(this.current.raws.after||"")+this.spaces}freeSemicolon(e){if(this.spaces+=e[1],this.current.nodes){let e=this.current.nodes[this.current.nodes.length-1];e&&"rule"===e.type&&!e.raws.ownSemicolon&&(e.raws.ownSemicolon=this.spaces,this.spaces="")}}getPosition(e){let t=this.input.fromOffset(e);return{offset:e,line:t.line,column:t.col}}init(e,t){this.current.push(e),e.source={start:this.getPosition(t),input:this.input},e.raws.before=this.spaces,this.spaces="","comment"!==e.type&&(this.semicolon=!1)}raw(e,t,r,n){let s,i,o,a,l=r.length,u="",c=!0;for(let e=0;e<l;e+=1)s=r[e],i=s[0],"space"!==i||e!==l-1||n?"comment"===i?(a=r[e-1],o=r[e+1],a&&o&&"space"!==a[0]&&"space"!==o[0]?u+=s[1]:c=!1):u+=s[1]:c=!1;if(!c){let n=r.reduce(((e,t)=>e+t[1]),"");e.raws[t]={value:u,raw:n}}e[t]=u}spacesAndCommentsFromEnd(e){let t,r="";for(;e.length&&(t=e[e.length-1][0],"space"===t||"comment"===t);)r=e.pop()[1]+r;return r}spacesAndCommentsFromStart(e){let t,r="";for(;e.length&&(t=e[0][0],"space"===t||"comment"===t);)r+=e.shift()[1];return r}spacesFromEnd(e){let t,r="";for(;e.length&&(t=e[e.length-1][0],"space"===t);)r=e.pop()[1]+r;return r}stringFrom(e,t){let r="";for(let n=t;n<e.length;n++)r+=e[n][1];return e.splice(t,e.length-t),r}colon(e){let t,r,n,s=0;for(let[i,o]of e.entries()){if(t=o,r=t[0],"("===r&&(s+=1),")"===r&&(s-=1),0===s&&":"===r){if(n){if("word"===n[0]&&"progid"===n[1])continue;return i}this.doubleColon(t)}n=t}return!1}unclosedBracket(e){throw this.input.error("Unclosed bracket",{offset:e[2]},{offset:e[2]+1})}unknownWord(e){throw this.input.error("Unknown word",{offset:e[0][2]},{offset:e[0][2]+e[0][1].length})}unexpectedClose(e){throw this.input.error("Unexpected }",{offset:e[2]},{offset:e[2]+1})}unclosedBlock(){let e=this.current.source.start;throw this.input.error("Unclosed block",e.line,e.column)}doubleColon(e){throw this.input.error("Double colon",{offset:e[2]},{offset:e[2]+e[1].length})}unnamedAtrule(e,t){throw this.input.error("At-rule without name",{offset:t[2]},{offset:t[2]+t[1].length})}precheckMissedSemicolon(){}checkMissedSemicolon(e){let t=this.colon(e);if(!1===t)return;let r,n=0;for(let s=t-1;s>=0&&(r=e[s],"space"===r[0]||(n+=1,2!==n));s--);throw this.input.error("Missed semicolon","word"===r[0]?r[3]+1:r[2])}};let Dr=sr,Fr=Br,Tr=Pt;function $r(e,t){let r=new Tr(e,t),n=new Fr(r);try{n.parse()}catch(e){throw"production"!==process.env.NODE_ENV&&"CssSyntaxError"===e.name&&t&&t.from&&(/\.scss$/i.test(t.from)?e.message+="\nYou tried to parse SCSS with the standard CSS parser; try again with the postcss-scss parser":/\.sass/i.test(t.from)?e.message+="\nYou tried to parse Sass with the standard CSS parser; try again with the postcss-sass parser":/\.less$/i.test(t.from)&&(e.message+="\nYou tried to parse Less with the standard CSS parser; try again with the postcss-less parser")),e}return n.root}var Gr=$r;$r.default=$r,Dr.registerParse($r);let{isClean:zr,my:Wr}=ne,Vr=zt,Jr=ue,qr=sr,Yr=ur,Hr=hr,Qr=mr,Zr=Gr,Kr=xr;const Xr={document:"Document",root:"Root",atrule:"AtRule",rule:"Rule",decl:"Declaration",comment:"Comment"},en={postcssPlugin:!0,prepare:!0,Once:!0,Document:!0,Root:!0,Declaration:!0,Rule:!0,AtRule:!0,Comment:!0,DeclarationExit:!0,RuleExit:!0,AtRuleExit:!0,CommentExit:!0,RootExit:!0,DocumentExit:!0,OnceExit:!0},tn={postcssPlugin:!0,prepare:!0,Once:!0};function rn(e){return"object"==typeof e&&"function"==typeof e.then}function nn(e){let t=!1,r=Xr[e.type];return"decl"===e.type?t=e.prop.toLowerCase():"atrule"===e.type&&(t=e.name.toLowerCase()),t&&e.append?[r,r+"-"+t,0,r+"Exit",r+"Exit-"+t]:t?[r,r+"-"+t,r+"Exit",r+"Exit-"+t]:e.append?[r,0,r+"Exit"]:[r,r+"Exit"]}function sn(e){let t;return t="document"===e.type?["Document",0,"DocumentExit"]:"root"===e.type?["Root",0,"RootExit"]:nn(e),{node:e,events:t,eventIndex:0,visitors:[],visitorIndex:0,iterator:0}}function on(e){return e[zr]=!1,e.nodes&&e.nodes.forEach((e=>on(e))),e}let an={};class ln{constructor(e,t,r){let n;if(this.stringified=!1,this.processed=!1,"object"!=typeof t||null===t||"root"!==t.type&&"document"!==t.type)if(t instanceof ln||t instanceof Qr)n=on(t.root),t.map&&(void 0===r.map&&(r.map={}),r.map.inline||(r.map.inline=!1),r.map.prev=t.map);else{let e=Zr;r.syntax&&(e=r.syntax.parse),r.parser&&(e=r.parser),e.parse&&(e=e.parse);try{n=e(t,r)}catch(e){this.processed=!0,this.error=e}n&&!n[Wr]&&qr.rebuild(n)}else n=on(t);this.result=new Qr(e,n,r),this.helpers={...an,result:this.result,postcss:an},this.plugins=this.processor.plugins.map((e=>"object"==typeof e&&e.prepare?{...e,...e.prepare(this.result)}:e))}get[Symbol.toStringTag](){return"LazyResult"}get processor(){return this.result.processor}get opts(){return this.result.opts}get css(){return this.stringify().css}get content(){return this.stringify().content}get map(){return this.stringify().map}get root(){return this.sync().root}get messages(){return this.sync().messages}warnings(){return this.sync().warnings()}toString(){return this.css}then(e,t){return"production"!==process.env.NODE_ENV&&("from"in this.opts||Hr("Without `from` option PostCSS could generate wrong source map and will not find Browserslist config. Set it to CSS file path or to `undefined` to prevent this warning.")),this.async().then(e,t)}catch(e){return this.async().catch(e)}finally(e){return this.async().then(e,e)}async(){return this.error?Promise.reject(this.error):this.processed?Promise.resolve(this.result):(this.processing||(this.processing=this.runAsync()),this.processing)}sync(){if(this.error)throw this.error;if(this.processed)return this.result;if(this.processed=!0,this.processing)throw this.getAsyncError();for(let e of this.plugins){if(rn(this.runOnRoot(e)))throw this.getAsyncError()}if(this.prepareVisitors(),this.hasListener){let e=this.result.root;for(;!e[zr];)e[zr]=!0,this.walkSync(e);if(this.listeners.OnceExit)if("document"===e.type)for(let t of e.nodes)this.visitSync(this.listeners.OnceExit,t);else this.visitSync(this.listeners.OnceExit,e)}return this.result}stringify(){if(this.error)throw this.error;if(this.stringified)return this.result;this.stringified=!0,this.sync();let e=this.result.opts,t=Jr;e.syntax&&(t=e.syntax.stringify),e.stringifier&&(t=e.stringifier),t.stringify&&(t=t.stringify);let r=new Vr(t,this.result.root,this.result.opts).generate();return this.result.css=r[0],this.result.map=r[1],this.result}walkSync(e){e[zr]=!0;let t=nn(e);for(let r of t)if(0===r)e.nodes&&e.each((e=>{e[zr]||this.walkSync(e)}));else{let t=this.listeners[r];if(t&&this.visitSync(t,e.toProxy()))return}}visitSync(e,t){for(let[r,n]of e){let e;this.result.lastPlugin=r;try{e=n(t,this.helpers)}catch(e){throw this.handleError(e,t.proxyOf)}if("root"!==t.type&&"document"!==t.type&&!t.parent)return!0;if(rn(e))throw this.getAsyncError()}}runOnRoot(e){this.result.lastPlugin=e;try{if("object"==typeof e&&e.Once){if("document"===this.result.root.type){let t=this.result.root.nodes.map((t=>e.Once(t,this.helpers)));return rn(t[0])?Promise.all(t):t}return e.Once(this.result.root,this.helpers)}if("function"==typeof e)return e(this.result.root,this.result)}catch(e){throw this.handleError(e)}}getAsyncError(){throw new Error("Use process(css).then(cb) to work with async plugins")}handleError(e,t){let r=this.result.lastPlugin;try{if(t&&t.addToError(e),this.error=e,"CssSyntaxError"!==e.name||e.plugin){if(r.postcssVersion&&"production"!==process.env.NODE_ENV){let e=r.postcssPlugin,t=r.postcssVersion,n=this.result.processor.version,s=t.split("."),i=n.split(".");(s[0]!==i[0]||parseInt(s[1])>parseInt(i[1]))&&console.error("Unknown error from PostCSS plugin. Your current PostCSS version is "+n+", but "+e+" uses "+t+". Perhaps this is the source of the error below.")}}else e.plugin=r.postcssPlugin,e.setMessage()}catch(e){console&&console.error&&console.error(e)}return e}async runAsync(){this.plugin=0;for(let e=0;e<this.plugins.length;e++){let t=this.plugins[e],r=this.runOnRoot(t);if(rn(r))try{await r}catch(e){throw this.handleError(e)}}if(this.prepareVisitors(),this.hasListener){let e=this.result.root;for(;!e[zr];){e[zr]=!0;let t=[sn(e)];for(;t.length>0;){let e=this.visitTick(t);if(rn(e))try{await e}catch(e){let r=t[t.length-1].node;throw this.handleError(e,r)}}}if(this.listeners.OnceExit)for(let[t,r]of this.listeners.OnceExit){this.result.lastPlugin=t;try{if("document"===e.type){let t=e.nodes.map((e=>r(e,this.helpers)));await Promise.all(t)}else await r(e,this.helpers)}catch(e){throw this.handleError(e)}}}return this.processed=!0,this.stringify()}prepareVisitors(){this.listeners={};let e=(e,t,r)=>{this.listeners[t]||(this.listeners[t]=[]),this.listeners[t].push([e,r])};for(let t of this.plugins)if("object"==typeof t)for(let r in t){if(!en[r]&&/^[A-Z]/.test(r))throw new Error(`Unknown event ${r} in ${t.postcssPlugin}. Try to update PostCSS (${this.processor.version} now).`);if(!tn[r])if("object"==typeof t[r])for(let n in t[r])e(t,"*"===n?r:r+"-"+n.toLowerCase(),t[r][n]);else"function"==typeof t[r]&&e(t,r,t[r])}this.hasListener=Object.keys(this.listeners).length>0}visitTick(e){let t=e[e.length-1],{node:r,visitors:n}=t;if("root"!==r.type&&"document"!==r.type&&!r.parent)return void e.pop();if(n.length>0&&t.visitorIndex<n.length){let[e,s]=n[t.visitorIndex];t.visitorIndex+=1,t.visitorIndex===n.length&&(t.visitors=[],t.visitorIndex=0),this.result.lastPlugin=e;try{return s(r.toProxy(),this.helpers)}catch(e){throw this.handleError(e,r)}}if(0!==t.iterator){let n,s=t.iterator;for(;n=r.nodes[r.indexes[s]];)if(r.indexes[s]+=1,!n[zr])return n[zr]=!0,void e.push(sn(n));t.iterator=0,delete r.indexes[s]}let s=t.events;for(;t.eventIndex<s.length;){let e=s[t.eventIndex];if(t.eventIndex+=1,0===e)return void(r.nodes&&r.nodes.length&&(r[zr]=!0,t.iterator=r.getIterator()));if(this.listeners[e])return void(t.visitors=this.listeners[e])}e.pop()}}ln.registerPostcss=e=>{an=e};var un=ln;ln.default=ln,Kr.registerLazyResult(ln),Yr.registerLazyResult(ln);let cn=zt,hn=ue,pn=hr,fn=Gr;const dn=mr;class gn{constructor(e,t,r){let n;t=t.toString(),this.stringified=!1,this._processor=e,this._css=t,this._opts=r,this._map=void 0;let s=hn;this.result=new dn(this._processor,n,this._opts),this.result.css=t;let i=this;Object.defineProperty(this.result,"root",{get:()=>i.root});let o=new cn(s,n,this._opts,t);if(o.isMap()){let[e,t]=o.generate();e&&(this.result.css=e),t&&(this.result.map=t)}}get[Symbol.toStringTag](){return"NoWorkResult"}get processor(){return this.result.processor}get opts(){return this.result.opts}get css(){return this.result.css}get content(){return this.result.css}get map(){return this.result.map}get root(){if(this._root)return this._root;let e,t=fn;try{e=t(this._css,this._opts)}catch(e){this.error=e}if(this.error)throw this.error;return this._root=e,e}get messages(){return[]}warnings(){return[]}toString(){return this._css}then(e,t){return"production"!==process.env.NODE_ENV&&("from"in this._opts||pn("Without `from` option PostCSS could generate wrong source map and will not find Browserslist config. Set it to CSS file path or to `undefined` to prevent this warning.")),this.async().then(e,t)}catch(e){return this.async().catch(e)}finally(e){return this.async().then(e,e)}async(){return this.error?Promise.reject(this.error):Promise.resolve(this.result)}sync(){if(this.error)throw this.error;return this.result}}var mn=gn;gn.default=gn;let wn=mn,yn=un,vn=ur,Sn=xr;class Cn{constructor(e=[]){this.version="8.4.6",this.plugins=this.normalize(e)}use(e){return this.plugins=this.plugins.concat(this.normalize([e])),this}process(e,t={}){return 0===this.plugins.length&&void 0===t.parser&&void 0===t.stringifier&&void 0===t.syntax?new wn(this,e,t):new yn(this,e,t)}normalize(e){let t=[];for(let r of e)if(!0===r.postcss?r=r():r.postcss&&(r=r.postcss),"object"==typeof r&&Array.isArray(r.plugins))t=t.concat(r.plugins);else if("object"==typeof r&&r.postcssPlugin)t.push(r);else if("function"==typeof r)t.push(r);else{if("object"!=typeof r||!r.parse&&!r.stringify)throw new Error(r+" is not a PostCSS plugin");if("production"!==process.env.NODE_ENV)throw new Error("PostCSS syntaxes cannot be used as plugins. Instead, please use one of the syntax/parser/stringifier options as outlined in your PostCSS runner documentation.")}return t}}var bn=Cn;Cn.default=Cn,Sn.registerProcessor(Cn),vn.registerProcessor(Cn);let _n=Se,xn=wt,On=Jt,An=vr,Mn=Pt,kn=xr,En=Lr;function Ln(e,t){if(Array.isArray(e))return e.map((e=>Ln(e)));let{inputs:r,...n}=e;if(r){t=[];for(let e of r){let r={...e,__proto__:Mn.prototype};r.map&&(r.map={...r.map,__proto__:xn.prototype}),t.push(r)}}if(n.nodes&&(n.nodes=e.nodes.map((e=>Ln(e,t)))),n.source){let{inputId:e,...r}=n.source;n.source=r,null!=e&&(n.source.input=t[e])}if("root"===n.type)return new kn(n);if("decl"===n.type)return new _n(n);if("rule"===n.type)return new En(n);if("comment"===n.type)return new On(n);if("atrule"===n.type)return new An(n);throw new Error("Unknown node type: "+e.type)}var Rn=Ln;Ln.default=Ln;let Pn=re,In=Se,jn=un,Nn=sr,Un=bn,Bn=ue,Dn=Rn,Fn=ur,Tn=fr,$n=Jt,Gn=vr,zn=mr,Wn=Pt,Vn=Gr,Jn=Ar,qn=Lr,Yn=xr,Hn=we;function Qn(...e){return 1===e.length&&Array.isArray(e[0])&&(e=e[0]),new Un(e)}Qn.plugin=function(e,t){function r(...r){let n=t(...r);return n.postcssPlugin=e,n.postcssVersion=(new Un).version,n}let n;return console&&console.warn&&(console.warn(e+": postcss.plugin was deprecated. Migration guide:\nhttps://evilmartians.com/chronicles/postcss-8-plugin-migration"),process.env.LANG&&process.env.LANG.startsWith("cn")&&console.warn(e+": 里面 postcss.plugin 被弃用. 迁移指南:\nhttps://www.w3ctech.com/topic/2226")),Object.defineProperty(r,"postcss",{get:()=>(n||(n=r()),n)}),r.process=function(e,t,n){return Qn([r(n)]).process(e,t)},r},Qn.stringify=Bn,Qn.parse=Vn,Qn.fromJSON=Dn,Qn.list=Jn,Qn.comment=e=>new $n(e),Qn.atRule=e=>new Gn(e),Qn.decl=e=>new In(e),Qn.rule=e=>new qn(e),Qn.root=e=>new Yn(e),Qn.document=e=>new Fn(e),Qn.CssSyntaxError=Pn,Qn.Declaration=In,Qn.Container=Nn,Qn.Processor=Un,Qn.Document=Fn,Qn.Comment=$n,Qn.Warning=Tn,Qn.AtRule=Gn,Qn.Result=zn,Qn.Input=Wn,Qn.Rule=qn,Qn.Root=Yn,Qn.Node=Hn,jn.registerPostcss(Qn);var Zn=Qn;async function Kn(){return new Promise((e=>{let t="",r=!1;if(setTimeout((()=>{r=!0,e("")}),1e4),process.stdin.isTTY){if(r)return;e(t)}else process.stdin.setEncoding("utf8"),process.stdin.on("readable",(()=>{let e;for(;e=process.stdin.read();)t+=e})),process.stdin.on("end",(()=>{r||e(t)}))}))}Qn.default=Qn,async function(e,t,r,n=!0){const i=function(e,t,r){const n=e.map((e=>e.trim())).filter((e=>!!e)),s={stdin:!1,stdout:!1,output:null,outputDir:null,inputs:[],inlineMap:!0,externalMap:!1,replace:!1,pluginOptions:{},debug:!1};let i=null,o=!1;for(let e=0;e<n.length;e++){const t=n[e];switch(t){case"-o":case"--output":s.output=n[e+1],e++,o=!0;break;case"-m":case"--map":s.externalMap=!0,s.inlineMap=!1,o=!0;break;case"--no-map":s.externalMap=!1,s.inlineMap=!1,o=!0;break;case"-r":case"--replace":s.replace=!0,o=!0;break;case"--debug":s.debug=!0,o=!0;break;case"-d":case"--dir":s.outputDir=n[e+1],e++,o=!0;break;case"-p":case"--plugin-options":i=n[e+1],e++,o=!0;break;default:if(0===t.indexOf("-"))return console.warn(`[error] unknown argument : ${t}\n`),r(),g.InvalidArguments;if(!o){s.inputs.push(t);break}return r(),g.InvalidArguments}}if(s.replace&&(s.output=null,s.outputDir=null),s.outputDir&&(s.output=null),s.inputs.length>1&&s.output)return console.warn('[error] omit "--output" when processing multiple inputs\n'),r(),g.InvalidArguments;0===s.inputs.length&&(s.stdin=!0),s.output||s.outputDir||s.replace||(s.stdout=!0),s.stdout&&(s.externalMap=!1);let a={};if(i)try{a=JSON.parse(i)}catch(e){return console.warn("[error] plugin options must be valid JSON\n"),r(),g.InvalidArguments}for(const e in a){const n=a[e];if(!t.includes(e))return console.warn(`[error] unknown plugin option: ${e}\n`),r(),g.InvalidArguments;s.pluginOptions[e]=n}return s}(process.argv.slice(n?2:3),t,r);i===g.InvalidArguments&&process.exit(1);const o=e(i.pluginOptions);i.stdin&&i.stdout?await async function(e,t,r){let n="";try{const s=await Kn();s||(r(),process.exit(1));const i=await Zn([e]).process(s,{from:"stdin",to:"stdout",map:!!t.inlineMap&&{inline:!0}});i.warnings().forEach((e=>{console.warn(e.toString())})),n=i.css}catch(e){console.error(t.debug?e:e.message),process.exit(1)}process.stdout.write(n+(t.inlineMap?"\n":"")),process.exit(0)}(o,i,r):i.stdin?await async function(e,t,r){let n=t.output;!n&&t.outputDir&&(n=l.default.join(t.outputDir,"output.css"));try{const i=await Kn();i||(r(),process.exit(1));const o=await Zn([e]).process(i,{from:"stdin",to:n,map:!(!t.inlineMap&&!t.externalMap)&&{inline:t.inlineMap}});o.warnings().forEach((e=>{console.warn(e.toString())})),t.externalMap&&o.map?await Promise.all([await s.promises.writeFile(n,o.css+(t.inlineMap?"\n":"")),await s.promises.writeFile(`${n}.map`,o.map.toString())]):await s.promises.writeFile(n,o.css+(t.inlineMap?"\n":""))}catch(e){console.error(t.debug?e:e.message),process.exit(1)}console.log(`CSS was written to "${l.default.normalize(n)}"`),process.exit(0)}(o,i,r):i.stdout?await async function(e,t){let r=[];try{r=await Promise.all(t.inputs.map((async t=>{const r=await s.promises.readFile(t),n=await Zn([e]).process(r,{from:t,to:"stdout",map:!1});return n.warnings().forEach((e=>{console.warn(e.toString())})),n.css})))}catch(e){console.error(t.debug?e:e.message),process.exit(1)}for(const e of r)process.stdout.write(e);process.exit(0)}(o,i):await async function(e,t){try{await Promise.all(t.inputs.map((async r=>{let n=t.output;t.outputDir&&(n=l.default.join(t.outputDir,l.default.basename(r))),t.replace&&(n=r);const i=await s.promises.readFile(r),o=await Zn([e]).process(i,{from:r,to:n,map:!(!t.inlineMap&&!t.externalMap)&&{inline:t.inlineMap}});o.warnings().forEach((e=>{console.warn(e.toString())})),t.externalMap&&o.map?await Promise.all([await s.promises.writeFile(n,o.css+(t.inlineMap?"\n":"")),await s.promises.writeFile(`${n}.map`,o.map.toString())]):await s.promises.writeFile(n,o.css+(t.inlineMap?"\n":"")),console.log(`CSS was written to "${l.default.normalize(n)}"`)})))}catch(e){console.error(t.debug?e:e.message),process.exit(1)}process.exit(0)}(o,i)}(h,["preserve"],function(e,t,r,n=null){let s=[];if(n){const e=Math.max(...Object.keys(n).map((e=>e.length))),t=new Array(e).fill(" ").join("");t.length&&(s=["\nPlugin Options:",...Object.keys(n).map((e=>` ${(e+t).slice(0,t.length)} ${typeof n[e]}`))],s.push(`\n ${JSON.stringify(n,null,2).split("\n").join("\n ")}`))}const i=[`${t}\n`,` ${r}\n`,"Usage:",` ${e} [input.css] [OPTIONS] [-o|--output output.css]`,` ${e} <input.css>... [OPTIONS] --dir <output-directory>`,` ${e} <input.css>... [OPTIONS] --replace`,"\nOptions:"," -o, --output Output file"," -d, --dir Output directory"," -r, --replace Replace (overwrite) the input file"," -m, --map Create an external sourcemap"," --no-map Disable the default inline sourcemaps"," -p, --plugin-options Stringified JSON object with plugin options"];return s.length>0&&i.push(...s),()=>{console.warn(i.join("\n"))}}("css-has-pseudo","PostCSS Has Pseudo","Transforms CSS with :has {}",{preserve:!0}));
|
package/dist/index.cjs
CHANGED
|
@@ -1,2 +1 @@
|
|
|
1
|
-
"use strict";function e(e){return e&&"object"==typeof e&&"default"in e?e:{default:e}}var t=e(require("postcss-selector-parser"));const
|
|
2
|
-
//# sourceMappingURL=index.cjs.map
|
|
1
|
+
"use strict";function e(e){return e&&"object"==typeof e&&"default"in e?e:{default:e}}var t=e(require("postcss-selector-parser"));const s=e=>{e="object"==typeof e&&e||n;const s=Boolean(!("preserve"in e)||e.preserve);return{postcssPlugin:"css-has-pseudo",Rule:(e,{result:n})=>{if(!e.selector.includes(":has("))return;let c;try{const s=t.default((e=>{e.walkPseudos((e=>{if(":has"===e.value&&e.nodes){const s=r(e);e.value=s?":not-has":":has";const n=t.default.attribute({attribute:o(String(e))});s?e.parent.parent.replaceWith(n):e.replaceWith(n)}}))})).processSync(e.selector);c=String(s)}catch(t){return void e.warn(n,`Failed to parse selector : ${e.selector}`)}void 0!==c&&c!==e.selector&&(s?e.cloneBefore({selector:c}):e.selector=c)}}};s.postcss=!0;const n={preserve:!0},o=e=>{let t="",s="";const n=()=>{if(s){const e=encodeURIComponent(s);let n="",o="";const r=()=>{n&&(o+=n,n="")};let c=!1;for(let t=0;t<e.length;t++){const s=e[t];if(c)n+=s,c=!1;else switch(s){case"%":r(),o+="\\"+s;continue;case"\\":n+=s,c=!0;continue;default:n+=s;continue}}r(),t+=o,s=""}};let o=!1;for(let r=0;r<e.length;r++){const c=e[r];if(o)s+=c,o=!1;else switch(c){case":":case"[":case"]":case",":case"(":case")":n(),t+="\\"+c;continue;case"\\":s+=c,o=!0;continue;default:s+=c;continue}}return n(),t},r=e=>{var t,s;return"pseudo"===(null==(t=e.parent)||null==(s=t.parent)?void 0:s.type)&&":not"===e.parent.parent.value};module.exports=s;
|
package/dist/index.mjs
CHANGED
|
@@ -1,2 +1 @@
|
|
|
1
|
-
import e from"postcss-selector-parser";const
|
|
2
|
-
//# sourceMappingURL=index.mjs.map
|
|
1
|
+
import e from"postcss-selector-parser";const t=t=>{t="object"==typeof t&&t||s;const c=Boolean(!("preserve"in t)||t.preserve);return{postcssPlugin:"css-has-pseudo",Rule:(t,{result:s})=>{if(!t.selector.includes(":has("))return;let r;try{const s=e((t=>{t.walkPseudos((t=>{if(":has"===t.value&&t.nodes){const s=o(t);t.value=s?":not-has":":has";const c=e.attribute({attribute:n(String(t))});s?t.parent.parent.replaceWith(c):t.replaceWith(c)}}))})).processSync(t.selector);r=String(s)}catch(e){return void t.warn(s,`Failed to parse selector : ${t.selector}`)}void 0!==r&&r!==t.selector&&(c?t.cloneBefore({selector:r}):t.selector=r)}}};t.postcss=!0;const s={preserve:!0},n=e=>{let t="",s="";const n=()=>{if(s){const e=encodeURIComponent(s);let n="",o="";const c=()=>{n&&(o+=n,n="")};let r=!1;for(let t=0;t<e.length;t++){const s=e[t];if(r)n+=s,r=!1;else switch(s){case"%":c(),o+="\\"+s;continue;case"\\":n+=s,r=!0;continue;default:n+=s;continue}}c(),t+=o,s=""}};let o=!1;for(let c=0;c<e.length;c++){const r=e[c];if(o)s+=r,o=!1;else switch(r){case":":case"[":case"]":case",":case"(":case")":n(),t+="\\"+r;continue;case"\\":s+=r,o=!0;continue;default:s+=r;continue}}return n(),t},o=e=>{var t,s;return"pseudo"===(null==(t=e.parent)||null==(s=t.parent)?void 0:s.type)&&":not"===e.parent.parent.value};export{t as default};
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "css-has-pseudo",
|
|
3
|
-
"version": "3.0.
|
|
3
|
+
"version": "3.0.4",
|
|
4
4
|
"description": "Style elements relative to other elements in CSS",
|
|
5
5
|
"author": "Jonathan Neal <jonathantneal@hotmail.com>",
|
|
6
6
|
"license": "CC0-1.0",
|
|
@@ -15,7 +15,9 @@
|
|
|
15
15
|
"default": "./dist/index.mjs"
|
|
16
16
|
},
|
|
17
17
|
"./browser": {
|
|
18
|
-
"
|
|
18
|
+
"import": "./dist/browser.mjs",
|
|
19
|
+
"require": "./dist/browser.cjs",
|
|
20
|
+
"default": "./dist/browser.mjs"
|
|
19
21
|
},
|
|
20
22
|
"./browser-global": {
|
|
21
23
|
"default": "./dist/browser-global.js"
|
|
@@ -23,14 +25,13 @@
|
|
|
23
25
|
},
|
|
24
26
|
"files": [
|
|
25
27
|
"CHANGELOG.md",
|
|
26
|
-
"INSTALL.md",
|
|
27
28
|
"LICENSE.md",
|
|
28
29
|
"README.md",
|
|
29
30
|
"dist",
|
|
30
31
|
"browser.js"
|
|
31
32
|
],
|
|
32
33
|
"bin": {
|
|
33
|
-
"css-has-pseudo": "dist/cli.
|
|
34
|
+
"css-has-pseudo": "dist/cli.cjs"
|
|
34
35
|
},
|
|
35
36
|
"scripts": {
|
|
36
37
|
"build": "rollup -c ../../rollup/default.js && npm run copy-browser-scripts-to-old-location",
|
|
@@ -39,20 +40,21 @@
|
|
|
39
40
|
"lint": "eslint ./src --ext .js --ext .ts --ext .mjs --no-error-on-unmatched-pattern",
|
|
40
41
|
"prepublishOnly": "npm run clean && npm run build && npm run test",
|
|
41
42
|
"stryker": "stryker run --logLevel error",
|
|
42
|
-
"test": "postcss-tape --ci"
|
|
43
|
+
"test": "postcss-tape --ci && npm run test:exports",
|
|
44
|
+
"test:exports": "node ./test/_import.mjs && node ./test/_require.cjs"
|
|
43
45
|
},
|
|
44
46
|
"engines": {
|
|
45
47
|
"node": "^12 || ^14 || >=16"
|
|
46
48
|
},
|
|
47
49
|
"dependencies": {
|
|
48
|
-
"postcss-selector-parser": "^6.0.
|
|
50
|
+
"postcss-selector-parser": "^6.0.9"
|
|
49
51
|
},
|
|
50
52
|
"devDependencies": {
|
|
51
53
|
"postcss": "^8.3.6",
|
|
52
54
|
"postcss-tape": "^6.0.1"
|
|
53
55
|
},
|
|
54
56
|
"peerDependencies": {
|
|
55
|
-
"postcss": "^8.
|
|
57
|
+
"postcss": "^8.4"
|
|
56
58
|
},
|
|
57
59
|
"keywords": [
|
|
58
60
|
"postcss",
|
|
@@ -71,5 +73,8 @@
|
|
|
71
73
|
"type": "git",
|
|
72
74
|
"url": "https://github.com/csstools/postcss-plugins.git",
|
|
73
75
|
"directory": "plugins/css-has-pseudo"
|
|
76
|
+
},
|
|
77
|
+
"volta": {
|
|
78
|
+
"extends": "../../package.json"
|
|
74
79
|
}
|
|
75
80
|
}
|
package/dist/cli.mjs
DELETED
|
@@ -1,3 +0,0 @@
|
|
|
1
|
-
#!/usr/bin/env node
|
|
2
|
-
|
|
3
|
-
import e from"postcss-selector-parser";import t from"tty";import r from"path";import n from"url";import s,{promises as i}from"fs";const o=t=>{t="object"==typeof t&&t||a;const r=Boolean(!("preserve"in t)||t.preserve);return{postcssPlugin:"css-has-pseudo",Rule:(t,{result:n})=>{if(!t.selector.includes(":has("))return;let s;try{const r=e((t=>{t.walkPseudos((t=>{if(":has"===t.value&&t.nodes){const r=u(t);t.value=r?":not-has":":has";const n=e.attribute({attribute:l(String(t))});r?t.parent.parent.replaceWith(n):t.replaceWith(n)}}))})).processSync(t.selector);s=String(r)}catch(e){return void t.warn(n,`Failed to parse selector : ${t.selector}`)}void 0!==s&&s!==t.selector&&(r?t.cloneBefore({selector:s}):t.assign({selector:s}))}}};o.postcss=!0;const a={preserve:!0},l=e=>encodeURIComponent(e).replace(/%3A/g,":").replace(/%5B/g,"[").replace(/%5D/g,"]").replace(/%2C/g,",").replace(/[():%[\],]/g,"\\$&"),u=e=>{var t,r;return"pseudo"===(null==(t=e.parent)||null==(r=t.parent)?void 0:r.type)&&":not"===e.parent.parent.value};var c;!function(e){e.InvalidArguments="INVALID_ARGUMENTS"}(c||(c={}));var h={exports:{}};let p=t,f=!("NO_COLOR"in process.env||process.argv.includes("--no-color"))&&("FORCE_COLOR"in process.env||process.argv.includes("--color")||"win32"===process.platform||p.isatty(1)&&"dumb"!==process.env.TERM||"CI"in process.env),d=(e,t,r=e)=>n=>{let s=""+n,i=s.indexOf(t,e.length);return~i?e+g(s,t,r,i)+t:e+s+t},g=(e,t,r,n)=>{let s=e.substring(0,n)+r,i=e.substring(n+t.length),o=i.indexOf(t);return~o?s+g(i,t,r,o):s+i},m=(e=f)=>({isColorSupported:e,reset:e?e=>`[0m${e}[0m`:String,bold:e?d("[1m","[22m","[22m[1m"):String,dim:e?d("[2m","[22m","[22m[2m"):String,italic:e?d("[3m","[23m"):String,underline:e?d("[4m","[24m"):String,inverse:e?d("[7m","[27m"):String,hidden:e?d("[8m","[28m"):String,strikethrough:e?d("[9m","[29m"):String,black:e?d("[30m","[39m"):String,red:e?d("[31m","[39m"):String,green:e?d("[32m","[39m"):String,yellow:e?d("[33m","[39m"):String,blue:e?d("[34m","[39m"):String,magenta:e?d("[35m","[39m"):String,cyan:e?d("[36m","[39m"):String,white:e?d("[37m","[39m"):String,gray:e?d("[90m","[39m"):String,bgBlack:e?d("[40m","[49m"):String,bgRed:e?d("[41m","[49m"):String,bgGreen:e?d("[42m","[49m"):String,bgYellow:e?d("[43m","[49m"):String,bgBlue:e?d("[44m","[49m"):String,bgMagenta:e?d("[45m","[49m"):String,bgCyan:e?d("[46m","[49m"):String,bgWhite:e?d("[47m","[49m"):String});h.exports=m(),h.exports.createColors=m;const w="'".charCodeAt(0),y='"'.charCodeAt(0),v="\\".charCodeAt(0),C="/".charCodeAt(0),S="\n".charCodeAt(0),b=" ".charCodeAt(0),_="\f".charCodeAt(0),x="\t".charCodeAt(0),O="\r".charCodeAt(0),A="[".charCodeAt(0),M="]".charCodeAt(0),k="(".charCodeAt(0),E=")".charCodeAt(0),L="{".charCodeAt(0),R="}".charCodeAt(0),P=";".charCodeAt(0),I="*".charCodeAt(0),N=":".charCodeAt(0),j="@".charCodeAt(0),U=/[\t\n\f\r "#'()/;[\\\]{}]/g,B=/[\t\n\f\r !"#'():;@[\\\]{}]|\/(?=\*)/g,D=/.[\n"'(/\\]/,F=/[\da-f]/i;var T=function(e,t={}){let r,n,s,i,o,a,l,u,c,h,p=e.css.valueOf(),f=t.ignoreErrors,d=p.length,g=0,m=[],T=[];function $(t){throw e.error("Unclosed "+t,g)}return{back:function(e){T.push(e)},nextToken:function(e){if(T.length)return T.pop();if(g>=d)return;let t=!!e&&e.ignoreUnclosed;switch(r=p.charCodeAt(g),r){case S:case b:case x:case O:case _:n=g;do{n+=1,r=p.charCodeAt(n)}while(r===b||r===S||r===x||r===O||r===_);h=["space",p.slice(g,n)],g=n-1;break;case A:case M:case L:case R:case N:case P:case E:{let e=String.fromCharCode(r);h=[e,e,g];break}case k:if(u=m.length?m.pop()[1]:"",c=p.charCodeAt(g+1),"url"===u&&c!==w&&c!==y&&c!==b&&c!==S&&c!==x&&c!==_&&c!==O){n=g;do{if(a=!1,n=p.indexOf(")",n+1),-1===n){if(f||t){n=g;break}$("bracket")}for(l=n;p.charCodeAt(l-1)===v;)l-=1,a=!a}while(a);h=["brackets",p.slice(g,n+1),g,n],g=n}else n=p.indexOf(")",g+1),i=p.slice(g,n+1),-1===n||D.test(i)?h=["(","(",g]:(h=["brackets",i,g,n],g=n);break;case w:case y:s=r===w?"'":'"',n=g;do{if(a=!1,n=p.indexOf(s,n+1),-1===n){if(f||t){n=g+1;break}$("string")}for(l=n;p.charCodeAt(l-1)===v;)l-=1,a=!a}while(a);h=["string",p.slice(g,n+1),g,n],g=n;break;case j:U.lastIndex=g+1,U.test(p),n=0===U.lastIndex?p.length-1:U.lastIndex-2,h=["at-word",p.slice(g,n+1),g,n],g=n;break;case v:for(n=g,o=!0;p.charCodeAt(n+1)===v;)n+=1,o=!o;if(r=p.charCodeAt(n+1),o&&r!==C&&r!==b&&r!==S&&r!==x&&r!==O&&r!==_&&(n+=1,F.test(p.charAt(n)))){for(;F.test(p.charAt(n+1));)n+=1;p.charCodeAt(n+1)===b&&(n+=1)}h=["word",p.slice(g,n+1),g,n],g=n;break;default:r===C&&p.charCodeAt(g+1)===I?(n=p.indexOf("*/",g+2)+1,0===n&&(f||t?n=p.length:$("comment")),h=["comment",p.slice(g,n+1),g,n],g=n):(B.lastIndex=g+1,B.test(p),n=0===B.lastIndex?p.length-1:B.lastIndex-2,h=["word",p.slice(g,n+1),g,n],m.push(h),g=n)}return g++,h},endOfFile:function(){return 0===T.length&&g>=d},position:function(){return g}}};let $,G=h.exports,z=T;const W={brackets:G.cyan,"at-word":G.cyan,comment:G.gray,string:G.green,class:G.yellow,hash:G.magenta,call:G.cyan,"(":G.cyan,")":G.cyan,"{":G.yellow,"}":G.yellow,"[":G.yellow,"]":G.yellow,":":G.yellow,";":G.yellow};function V([e,t],r){if("word"===e){if("."===t[0])return"class";if("#"===t[0])return"hash"}if(!r.endOfFile()){let e=r.nextToken();if(r.back(e),"brackets"===e[0]||"("===e[0])return"call"}return e}function J(e){let t=z(new $(e),{ignoreErrors:!0}),r="";for(;!t.endOfFile();){let e=t.nextToken(),n=W[V(e,t)];r+=n?e[1].split(/\r?\n/).map((e=>n(e))).join("\n"):e[1]}return r}J.registerInput=function(e){$=e};var q=J;let Y=h.exports,H=q;class Q extends Error{constructor(e,t,r,n,s,i){super(e),this.name="CssSyntaxError",this.reason=e,s&&(this.file=s),n&&(this.source=n),i&&(this.plugin=i),void 0!==t&&void 0!==r&&("number"==typeof t?(this.line=t,this.column=r):(this.line=t.line,this.column=t.column,this.endLine=r.line,this.endColumn=r.column)),this.setMessage(),Error.captureStackTrace&&Error.captureStackTrace(this,Q)}setMessage(){this.message=this.plugin?this.plugin+": ":"",this.message+=this.file?this.file:"<css input>",void 0!==this.line&&(this.message+=":"+this.line+":"+this.column),this.message+=": "+this.reason}showSourceCode(e){if(!this.source)return"";let t=this.source;null==e&&(e=Y.isColorSupported),H&&e&&(t=H(t));let r,n,s=t.split(/\r?\n/),i=Math.max(this.line-3,0),o=Math.min(this.line+2,s.length),a=String(o).length;if(e){let{bold:e,red:t,gray:s}=Y.createColors(!0);r=r=>e(t(r)),n=e=>s(e)}else r=n=e=>e;return s.slice(i,o).map(((e,t)=>{let s=i+1+t,o=" "+(" "+s).slice(-a)+" | ";if(s===this.line){let t=n(o.replace(/\d/g," "))+e.slice(0,this.column-1).replace(/[^\t]/g," ");return r(">")+n(o)+e+"\n "+t+r("^")}return" "+n(o)+e})).join("\n")}toString(){let e=this.showSourceCode();return e&&(e="\n\n"+e+"\n"),this.name+": "+this.message+e}}var Z=Q;Q.default=Q;var K={};K.isClean=Symbol("isClean"),K.my=Symbol("my");const X={colon:": ",indent:" ",beforeDecl:"\n",beforeRule:"\n",beforeOpen:" ",beforeClose:"\n",beforeComment:"\n",after:"\n",emptyBody:"",commentLeft:" ",commentRight:" ",semicolon:!1};class ee{constructor(e){this.builder=e}stringify(e,t){if(!this[e.type])throw new Error("Unknown AST node type "+e.type+". Maybe you need to change PostCSS stringifier.");this[e.type](e,t)}document(e){this.body(e)}root(e){this.body(e),e.raws.after&&this.builder(e.raws.after)}comment(e){let t=this.raw(e,"left","commentLeft"),r=this.raw(e,"right","commentRight");this.builder("/*"+t+e.text+r+"*/",e)}decl(e,t){let r=this.raw(e,"between","colon"),n=e.prop+r+this.rawValue(e,"value");e.important&&(n+=e.raws.important||" !important"),t&&(n+=";"),this.builder(n,e)}rule(e){this.block(e,this.rawValue(e,"selector")),e.raws.ownSemicolon&&this.builder(e.raws.ownSemicolon,e,"end")}atrule(e,t){let r="@"+e.name,n=e.params?this.rawValue(e,"params"):"";if(void 0!==e.raws.afterName?r+=e.raws.afterName:n&&(r+=" "),e.nodes)this.block(e,r+n);else{let s=(e.raws.between||"")+(t?";":"");this.builder(r+n+s,e)}}body(e){let t=e.nodes.length-1;for(;t>0&&"comment"===e.nodes[t].type;)t-=1;let r=this.raw(e,"semicolon");for(let n=0;n<e.nodes.length;n++){let s=e.nodes[n],i=this.raw(s,"before");i&&this.builder(i),this.stringify(s,t!==n||r)}}block(e,t){let r,n=this.raw(e,"between","beforeOpen");this.builder(t+n+"{",e,"start"),e.nodes&&e.nodes.length?(this.body(e),r=this.raw(e,"after")):r=this.raw(e,"after","emptyBody"),r&&this.builder(r),this.builder("}",e,"end")}raw(e,t,r){let n;if(r||(r=t),t&&(n=e.raws[t],void 0!==n))return n;let s=e.parent;if("before"===r){if(!s||"root"===s.type&&s.first===e)return"";if(s&&"document"===s.type)return""}if(!s)return X[r];let i=e.root();if(i.rawCache||(i.rawCache={}),void 0!==i.rawCache[r])return i.rawCache[r];if("before"===r||"after"===r)return this.beforeAfter(e,r);{let s="raw"+((o=r)[0].toUpperCase()+o.slice(1));this[s]?n=this[s](i,e):i.walk((e=>{if(n=e.raws[t],void 0!==n)return!1}))}var o;return void 0===n&&(n=X[r]),i.rawCache[r]=n,n}rawSemicolon(e){let t;return e.walk((e=>{if(e.nodes&&e.nodes.length&&"decl"===e.last.type&&(t=e.raws.semicolon,void 0!==t))return!1})),t}rawEmptyBody(e){let t;return e.walk((e=>{if(e.nodes&&0===e.nodes.length&&(t=e.raws.after,void 0!==t))return!1})),t}rawIndent(e){if(e.raws.indent)return e.raws.indent;let t;return e.walk((r=>{let n=r.parent;if(n&&n!==e&&n.parent&&n.parent===e&&void 0!==r.raws.before){let e=r.raws.before.split("\n");return t=e[e.length-1],t=t.replace(/\S/g,""),!1}})),t}rawBeforeComment(e,t){let r;return e.walkComments((e=>{if(void 0!==e.raws.before)return r=e.raws.before,r.includes("\n")&&(r=r.replace(/[^\n]+$/,"")),!1})),void 0===r?r=this.raw(t,null,"beforeDecl"):r&&(r=r.replace(/\S/g,"")),r}rawBeforeDecl(e,t){let r;return e.walkDecls((e=>{if(void 0!==e.raws.before)return r=e.raws.before,r.includes("\n")&&(r=r.replace(/[^\n]+$/,"")),!1})),void 0===r?r=this.raw(t,null,"beforeRule"):r&&(r=r.replace(/\S/g,"")),r}rawBeforeRule(e){let t;return e.walk((r=>{if(r.nodes&&(r.parent!==e||e.first!==r)&&void 0!==r.raws.before)return t=r.raws.before,t.includes("\n")&&(t=t.replace(/[^\n]+$/,"")),!1})),t&&(t=t.replace(/\S/g,"")),t}rawBeforeClose(e){let t;return e.walk((e=>{if(e.nodes&&e.nodes.length>0&&void 0!==e.raws.after)return t=e.raws.after,t.includes("\n")&&(t=t.replace(/[^\n]+$/,"")),!1})),t&&(t=t.replace(/\S/g,"")),t}rawBeforeOpen(e){let t;return e.walk((e=>{if("decl"!==e.type&&(t=e.raws.between,void 0!==t))return!1})),t}rawColon(e){let t;return e.walkDecls((e=>{if(void 0!==e.raws.between)return t=e.raws.between.replace(/[^\s:]/g,""),!1})),t}beforeAfter(e,t){let r;r="decl"===e.type?this.raw(e,null,"beforeDecl"):"comment"===e.type?this.raw(e,null,"beforeComment"):"before"===t?this.raw(e,null,"beforeRule"):this.raw(e,null,"beforeClose");let n=e.parent,s=0;for(;n&&"root"!==n.type;)s+=1,n=n.parent;if(r.includes("\n")){let t=this.raw(e,null,"indent");if(t.length)for(let e=0;e<s;e++)r+=t}return r}rawValue(e,t){let r=e[t],n=e.raws[t];return n&&n.value===r?n.raw:r}}var te=ee;ee.default=ee;let re=te;function ne(e,t){new re(t).stringify(e)}var se=ne;ne.default=ne;let{isClean:ie,my:oe}=K,ae=Z,le=te,ue=se;function ce(e,t){let r=new e.constructor;for(let n in e){if(!Object.prototype.hasOwnProperty.call(e,n))continue;if("proxyCache"===n)continue;let s=e[n],i=typeof s;"parent"===n&&"object"===i?t&&(r[n]=t):"source"===n?r[n]=s:Array.isArray(s)?r[n]=s.map((e=>ce(e,r))):("object"===i&&null!==s&&(s=ce(s)),r[n]=s)}return r}class he{constructor(e={}){this.raws={},this[ie]=!1,this[oe]=!0;for(let t in e)if("nodes"===t){this.nodes=[];for(let r of e[t])"function"==typeof r.clone?this.append(r.clone()):this.append(r)}else this[t]=e[t]}error(e,t={}){if(this.source){let{start:r,end:n}=this.rangeBy(t);return this.source.input.error(e,{line:r.line,column:r.column},{line:n.line,column:n.column},t)}return new ae(e)}warn(e,t,r){let n={node:this};for(let e in r)n[e]=r[e];return e.warn(t,n)}remove(){return this.parent&&this.parent.removeChild(this),this.parent=void 0,this}toString(e=ue){e.stringify&&(e=e.stringify);let t="";return e(this,(e=>{t+=e})),t}assign(e={}){for(let t in e)this[t]=e[t];return this}clone(e={}){let t=ce(this);for(let r in e)t[r]=e[r];return t}cloneBefore(e={}){let t=this.clone(e);return this.parent.insertBefore(this,t),t}cloneAfter(e={}){let t=this.clone(e);return this.parent.insertAfter(this,t),t}replaceWith(...e){if(this.parent){let t=this,r=!1;for(let n of e)n===this?r=!0:r?(this.parent.insertAfter(t,n),t=n):this.parent.insertBefore(t,n);r||this.remove()}return this}next(){if(!this.parent)return;let e=this.parent.index(this);return this.parent.nodes[e+1]}prev(){if(!this.parent)return;let e=this.parent.index(this);return this.parent.nodes[e-1]}before(e){return this.parent.insertBefore(this,e),this}after(e){return this.parent.insertAfter(this,e),this}root(){let e=this;for(;e.parent&&"document"!==e.parent.type;)e=e.parent;return e}raw(e,t){return(new le).raw(this,e,t)}cleanRaws(e){delete this.raws.before,delete this.raws.after,e||delete this.raws.between}toJSON(e,t){let r={},n=null==t;t=t||new Map;let s=0;for(let e in this){if(!Object.prototype.hasOwnProperty.call(this,e))continue;if("parent"===e||"proxyCache"===e)continue;let n=this[e];if(Array.isArray(n))r[e]=n.map((e=>"object"==typeof e&&e.toJSON?e.toJSON(null,t):e));else if("object"==typeof n&&n.toJSON)r[e]=n.toJSON(null,t);else if("source"===e){let i=t.get(n.input);null==i&&(i=s,t.set(n.input,s),s++),r[e]={inputId:i,start:n.start,end:n.end}}else r[e]=n}return n&&(r.inputs=[...t.keys()].map((e=>e.toJSON()))),r}positionInside(e){let t=this.toString(),r=this.source.start.column,n=this.source.start.line;for(let s=0;s<e;s++)"\n"===t[s]?(r=1,n+=1):r+=1;return{line:n,column:r}}positionBy(e){let t=this.source.start;if(e.index)t=this.positionInside(e.index);else if(e.word){let r=this.toString().indexOf(e.word);-1!==r&&(t=this.positionInside(r))}return t}rangeBy(e){let t={line:this.source.start.line,column:this.source.start.column},r=this.source.end?{line:this.source.end.line,column:this.source.end.column+1}:{line:t.line,column:t.column+1};if(e.word){let n=this.toString().indexOf(e.word);-1!==n&&(t=this.positionInside(n),r=this.positionInside(n+e.word.length))}else e.start?t={line:e.start.line,column:e.start.column}:e.index&&(t=this.positionInside(e.index)),e.end?r={line:e.end.line,column:e.end.column}:e.endIndex?r=this.positionInside(e.endIndex):e.index&&(r=this.positionInside(e.index+1));return(r.line<t.line||r.line===t.line&&r.column<=t.column)&&(r={line:t.line,column:t.column+1}),{start:t,end:r}}getProxyProcessor(){return{set:(e,t,r)=>(e[t]===r||(e[t]=r,"prop"!==t&&"value"!==t&&"name"!==t&&"params"!==t&&"important"!==t&&"text"!==t||e.markDirty()),!0),get:(e,t)=>"proxyOf"===t?e:"root"===t?()=>e.root().toProxy():e[t]}}toProxy(){return this.proxyCache||(this.proxyCache=new Proxy(this,this.getProxyProcessor())),this.proxyCache}addToError(e){if(e.postcssNode=this,e.stack&&this.source&&/\n\s{4}at /.test(e.stack)){let t=this.source;e.stack=e.stack.replace(/\n\s{4}at /,`$&${t.input.from}:${t.start.line}:${t.start.column}$&`)}return e}markDirty(){if(this[ie]){this[ie]=!1;let e=this;for(;e=e.parent;)e[ie]=!1}}get proxyOf(){return this}}var pe=he;he.default=he;let fe=pe;class de extends fe{constructor(e){e&&void 0!==e.value&&"string"!=typeof e.value&&(e={...e,value:String(e.value)}),super(e),this.type="decl"}get variable(){return this.prop.startsWith("--")||"$"===this.prop[0]}}var ge=de;de.default=de;var me={},we={},ye={},ve={},Ce="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/".split("");ve.encode=function(e){if(0<=e&&e<Ce.length)return Ce[e];throw new TypeError("Must be between 0 and 63: "+e)},ve.decode=function(e){return 65<=e&&e<=90?e-65:97<=e&&e<=122?e-97+26:48<=e&&e<=57?e-48+52:43==e?62:47==e?63:-1};var Se=ve;ye.encode=function(e){var t,r="",n=function(e){return e<0?1+(-e<<1):0+(e<<1)}(e);do{t=31&n,(n>>>=5)>0&&(t|=32),r+=Se.encode(t)}while(n>0);return r},ye.decode=function(e,t,r){var n,s,i,o,a=e.length,l=0,u=0;do{if(t>=a)throw new Error("Expected more digits in base 64 VLQ value.");if(-1===(s=Se.decode(e.charCodeAt(t++))))throw new Error("Invalid base64 digit: "+e.charAt(t-1));n=!!(32&s),l+=(s&=31)<<u,u+=5}while(n);r.value=(o=(i=l)>>1,1==(1&i)?-o:o),r.rest=t};var be={};!function(e){e.getArg=function(e,t,r){if(t in e)return e[t];if(3===arguments.length)return r;throw new Error('"'+t+'" is a required argument.')};var t=/^(?:([\w+\-.]+):)?\/\/(?:(\w+:\w+)@)?([\w.-]*)(?::(\d+))?(.*)$/,r=/^data:.+\,.+$/;function n(e){var r=e.match(t);return r?{scheme:r[1],auth:r[2],host:r[3],port:r[4],path:r[5]}:null}function s(e){var t="";return e.scheme&&(t+=e.scheme+":"),t+="//",e.auth&&(t+=e.auth+"@"),e.host&&(t+=e.host),e.port&&(t+=":"+e.port),e.path&&(t+=e.path),t}e.urlParse=n,e.urlGenerate=s;var i,o,a=(i=function(t){var r=t,i=n(t);if(i){if(!i.path)return t;r=i.path}for(var o=e.isAbsolute(r),a=[],l=0,u=0;;){if(l=u,-1===(u=r.indexOf("/",l))){a.push(r.slice(l));break}for(a.push(r.slice(l,u));u<r.length&&"/"===r[u];)u++}var c,h=0;for(u=a.length-1;u>=0;u--)"."===(c=a[u])?a.splice(u,1):".."===c?h++:h>0&&(""===c?(a.splice(u+1,h),h=0):(a.splice(u,2),h--));return""===(r=a.join("/"))&&(r=o?"/":"."),i?(i.path=r,s(i)):r},o=[],function(e){for(var t=0;t<o.length;t++)if(o[t].input===e){var r=o[0];return o[0]=o[t],o[t]=r,o[0].result}var n=i(e);return o.unshift({input:e,result:n}),o.length>32&&o.pop(),n});function l(e,t){""===e&&(e="."),""===t&&(t=".");var i=n(t),o=n(e);if(o&&(e=o.path||"/"),i&&!i.scheme)return o&&(i.scheme=o.scheme),s(i);if(i||t.match(r))return t;if(o&&!o.host&&!o.path)return o.host=t,s(o);var l="/"===t.charAt(0)?t:a(e.replace(/\/+$/,"")+"/"+t);return o?(o.path=l,s(o)):l}e.normalize=a,e.join=l,e.isAbsolute=function(e){return"/"===e.charAt(0)||t.test(e)},e.relative=function(e,t){""===e&&(e="."),e=e.replace(/\/$/,"");for(var r=0;0!==t.indexOf(e+"/");){var n=e.lastIndexOf("/");if(n<0)return t;if((e=e.slice(0,n)).match(/^([^\/]+:\/)?\/*$/))return t;++r}return Array(r+1).join("../")+t.substr(e.length+1)};var u=!("__proto__"in Object.create(null));function c(e){return e}function h(e){if(!e)return!1;var t=e.length;if(t<9)return!1;if(95!==e.charCodeAt(t-1)||95!==e.charCodeAt(t-2)||111!==e.charCodeAt(t-3)||116!==e.charCodeAt(t-4)||111!==e.charCodeAt(t-5)||114!==e.charCodeAt(t-6)||112!==e.charCodeAt(t-7)||95!==e.charCodeAt(t-8)||95!==e.charCodeAt(t-9))return!1;for(var r=t-10;r>=0;r--)if(36!==e.charCodeAt(r))return!1;return!0}function p(e,t){return e===t?0:null===e?1:null===t?-1:e>t?1:-1}e.toSetString=u?c:function(e){return h(e)?"$"+e:e},e.fromSetString=u?c:function(e){return h(e)?e.slice(1):e},e.compareByOriginalPositions=function(e,t,r){var n=p(e.source,t.source);return 0!==n||0!==(n=e.originalLine-t.originalLine)||0!==(n=e.originalColumn-t.originalColumn)||r||0!==(n=e.generatedColumn-t.generatedColumn)||0!==(n=e.generatedLine-t.generatedLine)?n:p(e.name,t.name)},e.compareByOriginalPositionsNoSource=function(e,t,r){var n;return 0!==(n=e.originalLine-t.originalLine)||0!==(n=e.originalColumn-t.originalColumn)||r||0!==(n=e.generatedColumn-t.generatedColumn)||0!==(n=e.generatedLine-t.generatedLine)?n:p(e.name,t.name)},e.compareByGeneratedPositionsDeflated=function(e,t,r){var n=e.generatedLine-t.generatedLine;return 0!==n||0!==(n=e.generatedColumn-t.generatedColumn)||r||0!==(n=p(e.source,t.source))||0!==(n=e.originalLine-t.originalLine)||0!==(n=e.originalColumn-t.originalColumn)?n:p(e.name,t.name)},e.compareByGeneratedPositionsDeflatedNoLine=function(e,t,r){var n=e.generatedColumn-t.generatedColumn;return 0!==n||r||0!==(n=p(e.source,t.source))||0!==(n=e.originalLine-t.originalLine)||0!==(n=e.originalColumn-t.originalColumn)?n:p(e.name,t.name)},e.compareByGeneratedPositionsInflated=function(e,t){var r=e.generatedLine-t.generatedLine;return 0!==r||0!==(r=e.generatedColumn-t.generatedColumn)||0!==(r=p(e.source,t.source))||0!==(r=e.originalLine-t.originalLine)||0!==(r=e.originalColumn-t.originalColumn)?r:p(e.name,t.name)},e.parseSourceMapInput=function(e){return JSON.parse(e.replace(/^\)]}'[^\n]*\n/,""))},e.computeSourceURL=function(e,t,r){if(t=t||"",e&&("/"!==e[e.length-1]&&"/"!==t[0]&&(e+="/"),t=e+t),r){var i=n(r);if(!i)throw new Error("sourceMapURL could not be parsed");if(i.path){var o=i.path.lastIndexOf("/");o>=0&&(i.path=i.path.substring(0,o+1))}t=l(s(i),t)}return a(t)}}(be);var _e={},xe=be,Oe=Object.prototype.hasOwnProperty,Ae="undefined"!=typeof Map;function Me(){this._array=[],this._set=Ae?new Map:Object.create(null)}Me.fromArray=function(e,t){for(var r=new Me,n=0,s=e.length;n<s;n++)r.add(e[n],t);return r},Me.prototype.size=function(){return Ae?this._set.size:Object.getOwnPropertyNames(this._set).length},Me.prototype.add=function(e,t){var r=Ae?e:xe.toSetString(e),n=Ae?this.has(e):Oe.call(this._set,r),s=this._array.length;n&&!t||this._array.push(e),n||(Ae?this._set.set(e,s):this._set[r]=s)},Me.prototype.has=function(e){if(Ae)return this._set.has(e);var t=xe.toSetString(e);return Oe.call(this._set,t)},Me.prototype.indexOf=function(e){if(Ae){var t=this._set.get(e);if(t>=0)return t}else{var r=xe.toSetString(e);if(Oe.call(this._set,r))return this._set[r]}throw new Error('"'+e+'" is not in the set.')},Me.prototype.at=function(e){if(e>=0&&e<this._array.length)return this._array[e];throw new Error("No element indexed by "+e)},Me.prototype.toArray=function(){return this._array.slice()},_e.ArraySet=Me;var ke={},Ee=be;function Le(){this._array=[],this._sorted=!0,this._last={generatedLine:-1,generatedColumn:0}}Le.prototype.unsortedForEach=function(e,t){this._array.forEach(e,t)},Le.prototype.add=function(e){var t,r,n,s,i,o;t=this._last,r=e,n=t.generatedLine,s=r.generatedLine,i=t.generatedColumn,o=r.generatedColumn,s>n||s==n&&o>=i||Ee.compareByGeneratedPositionsInflated(t,r)<=0?(this._last=e,this._array.push(e)):(this._sorted=!1,this._array.push(e))},Le.prototype.toArray=function(){return this._sorted||(this._array.sort(Ee.compareByGeneratedPositionsInflated),this._sorted=!0),this._array},ke.MappingList=Le;var Re=ye,Pe=be,Ie=_e.ArraySet,Ne=ke.MappingList;function je(e){e||(e={}),this._file=Pe.getArg(e,"file",null),this._sourceRoot=Pe.getArg(e,"sourceRoot",null),this._skipValidation=Pe.getArg(e,"skipValidation",!1),this._sources=new Ie,this._names=new Ie,this._mappings=new Ne,this._sourcesContents=null}je.prototype._version=3,je.fromSourceMap=function(e){var t=e.sourceRoot,r=new je({file:e.file,sourceRoot:t});return e.eachMapping((function(e){var n={generated:{line:e.generatedLine,column:e.generatedColumn}};null!=e.source&&(n.source=e.source,null!=t&&(n.source=Pe.relative(t,n.source)),n.original={line:e.originalLine,column:e.originalColumn},null!=e.name&&(n.name=e.name)),r.addMapping(n)})),e.sources.forEach((function(n){var s=n;null!==t&&(s=Pe.relative(t,n)),r._sources.has(s)||r._sources.add(s);var i=e.sourceContentFor(n);null!=i&&r.setSourceContent(n,i)})),r},je.prototype.addMapping=function(e){var t=Pe.getArg(e,"generated"),r=Pe.getArg(e,"original",null),n=Pe.getArg(e,"source",null),s=Pe.getArg(e,"name",null);this._skipValidation||this._validateMapping(t,r,n,s),null!=n&&(n=String(n),this._sources.has(n)||this._sources.add(n)),null!=s&&(s=String(s),this._names.has(s)||this._names.add(s)),this._mappings.add({generatedLine:t.line,generatedColumn:t.column,originalLine:null!=r&&r.line,originalColumn:null!=r&&r.column,source:n,name:s})},je.prototype.setSourceContent=function(e,t){var r=e;null!=this._sourceRoot&&(r=Pe.relative(this._sourceRoot,r)),null!=t?(this._sourcesContents||(this._sourcesContents=Object.create(null)),this._sourcesContents[Pe.toSetString(r)]=t):this._sourcesContents&&(delete this._sourcesContents[Pe.toSetString(r)],0===Object.keys(this._sourcesContents).length&&(this._sourcesContents=null))},je.prototype.applySourceMap=function(e,t,r){var n=t;if(null==t){if(null==e.file)throw new Error('SourceMapGenerator.prototype.applySourceMap requires either an explicit source file, or the source map\'s "file" property. Both were omitted.');n=e.file}var s=this._sourceRoot;null!=s&&(n=Pe.relative(s,n));var i=new Ie,o=new Ie;this._mappings.unsortedForEach((function(t){if(t.source===n&&null!=t.originalLine){var a=e.originalPositionFor({line:t.originalLine,column:t.originalColumn});null!=a.source&&(t.source=a.source,null!=r&&(t.source=Pe.join(r,t.source)),null!=s&&(t.source=Pe.relative(s,t.source)),t.originalLine=a.line,t.originalColumn=a.column,null!=a.name&&(t.name=a.name))}var l=t.source;null==l||i.has(l)||i.add(l);var u=t.name;null==u||o.has(u)||o.add(u)}),this),this._sources=i,this._names=o,e.sources.forEach((function(t){var n=e.sourceContentFor(t);null!=n&&(null!=r&&(t=Pe.join(r,t)),null!=s&&(t=Pe.relative(s,t)),this.setSourceContent(t,n))}),this)},je.prototype._validateMapping=function(e,t,r,n){if(t&&"number"!=typeof t.line&&"number"!=typeof t.column)throw new Error("original.line and original.column are not numbers -- you probably meant to omit the original mapping entirely and only map the generated position. If so, pass null for the original mapping instead of an object with empty or null values.");if((!(e&&"line"in e&&"column"in e&&e.line>0&&e.column>=0)||t||r||n)&&!(e&&"line"in e&&"column"in e&&t&&"line"in t&&"column"in t&&e.line>0&&e.column>=0&&t.line>0&&t.column>=0&&r))throw new Error("Invalid mapping: "+JSON.stringify({generated:e,source:r,original:t,name:n}))},je.prototype._serializeMappings=function(){for(var e,t,r,n,s=0,i=1,o=0,a=0,l=0,u=0,c="",h=this._mappings.toArray(),p=0,f=h.length;p<f;p++){if(e="",(t=h[p]).generatedLine!==i)for(s=0;t.generatedLine!==i;)e+=";",i++;else if(p>0){if(!Pe.compareByGeneratedPositionsInflated(t,h[p-1]))continue;e+=","}e+=Re.encode(t.generatedColumn-s),s=t.generatedColumn,null!=t.source&&(n=this._sources.indexOf(t.source),e+=Re.encode(n-u),u=n,e+=Re.encode(t.originalLine-1-a),a=t.originalLine-1,e+=Re.encode(t.originalColumn-o),o=t.originalColumn,null!=t.name&&(r=this._names.indexOf(t.name),e+=Re.encode(r-l),l=r)),c+=e}return c},je.prototype._generateSourcesContent=function(e,t){return e.map((function(e){if(!this._sourcesContents)return null;null!=t&&(e=Pe.relative(t,e));var r=Pe.toSetString(e);return Object.prototype.hasOwnProperty.call(this._sourcesContents,r)?this._sourcesContents[r]:null}),this)},je.prototype.toJSON=function(){var e={version:this._version,sources:this._sources.toArray(),names:this._names.toArray(),mappings:this._serializeMappings()};return null!=this._file&&(e.file=this._file),null!=this._sourceRoot&&(e.sourceRoot=this._sourceRoot),this._sourcesContents&&(e.sourcesContent=this._generateSourcesContent(e.sources,e.sourceRoot)),e},je.prototype.toString=function(){return JSON.stringify(this.toJSON())},we.SourceMapGenerator=je;var Ue={},Be={};!function(e){function t(r,n,s,i,o,a){var l=Math.floor((n-r)/2)+r,u=o(s,i[l],!0);return 0===u?l:u>0?n-l>1?t(l,n,s,i,o,a):a==e.LEAST_UPPER_BOUND?n<i.length?n:-1:l:l-r>1?t(r,l,s,i,o,a):a==e.LEAST_UPPER_BOUND?l:r<0?-1:r}e.GREATEST_LOWER_BOUND=1,e.LEAST_UPPER_BOUND=2,e.search=function(r,n,s,i){if(0===n.length)return-1;var o=t(-1,n.length,r,n,s,i||e.GREATEST_LOWER_BOUND);if(o<0)return-1;for(;o-1>=0&&0===s(n[o],n[o-1],!0);)--o;return o}}(Be);var De={};function Fe(e){function t(e,t,r){var n=e[t];e[t]=e[r],e[r]=n}return function e(r,n,s,i){if(s<i){var o=s-1;t(r,(c=s,h=i,Math.round(c+Math.random()*(h-c))),i);for(var a=r[i],l=s;l<i;l++)n(r[l],a,!1)<=0&&t(r,o+=1,l);t(r,o+1,l);var u=o+1;e(r,n,s,u-1),e(r,n,u+1,i)}var c,h}}let Te=new WeakMap;De.quickSort=function(e,t,r=0){let n=Te.get(t);void 0===n&&(n=function(e){let t=Fe.toString();return new Function(`return ${t}`)()(e)}(t),Te.set(t,n)),n(e,t,r,e.length-1)};var $e=be,Ge=Be,ze=_e.ArraySet,We=ye,Ve=De.quickSort;function Je(e,t){var r=e;return"string"==typeof e&&(r=$e.parseSourceMapInput(e)),null!=r.sections?new Ze(r,t):new qe(r,t)}function qe(e,t){var r=e;"string"==typeof e&&(r=$e.parseSourceMapInput(e));var n=$e.getArg(r,"version"),s=$e.getArg(r,"sources"),i=$e.getArg(r,"names",[]),o=$e.getArg(r,"sourceRoot",null),a=$e.getArg(r,"sourcesContent",null),l=$e.getArg(r,"mappings"),u=$e.getArg(r,"file",null);if(n!=this._version)throw new Error("Unsupported version: "+n);o&&(o=$e.normalize(o)),s=s.map(String).map($e.normalize).map((function(e){return o&&$e.isAbsolute(o)&&$e.isAbsolute(e)?$e.relative(o,e):e})),this._names=ze.fromArray(i.map(String),!0),this._sources=ze.fromArray(s,!0),this._absoluteSources=this._sources.toArray().map((function(e){return $e.computeSourceURL(o,e,t)})),this.sourceRoot=o,this.sourcesContent=a,this._mappings=l,this._sourceMapURL=t,this.file=u}function Ye(){this.generatedLine=0,this.generatedColumn=0,this.source=null,this.originalLine=null,this.originalColumn=null,this.name=null}Je.fromSourceMap=function(e,t){return qe.fromSourceMap(e,t)},Je.prototype._version=3,Je.prototype.__generatedMappings=null,Object.defineProperty(Je.prototype,"_generatedMappings",{configurable:!0,enumerable:!0,get:function(){return this.__generatedMappings||this._parseMappings(this._mappings,this.sourceRoot),this.__generatedMappings}}),Je.prototype.__originalMappings=null,Object.defineProperty(Je.prototype,"_originalMappings",{configurable:!0,enumerable:!0,get:function(){return this.__originalMappings||this._parseMappings(this._mappings,this.sourceRoot),this.__originalMappings}}),Je.prototype._charIsMappingSeparator=function(e,t){var r=e.charAt(t);return";"===r||","===r},Je.prototype._parseMappings=function(e,t){throw new Error("Subclasses must implement _parseMappings")},Je.GENERATED_ORDER=1,Je.ORIGINAL_ORDER=2,Je.GREATEST_LOWER_BOUND=1,Je.LEAST_UPPER_BOUND=2,Je.prototype.eachMapping=function(e,t,r){var n,s=t||null;switch(r||Je.GENERATED_ORDER){case Je.GENERATED_ORDER:n=this._generatedMappings;break;case Je.ORIGINAL_ORDER:n=this._originalMappings;break;default:throw new Error("Unknown order of iteration.")}for(var i=this.sourceRoot,o=e.bind(s),a=this._names,l=this._sources,u=this._sourceMapURL,c=0,h=n.length;c<h;c++){var p=n[c],f=null===p.source?null:l.at(p.source);o({source:f=$e.computeSourceURL(i,f,u),generatedLine:p.generatedLine,generatedColumn:p.generatedColumn,originalLine:p.originalLine,originalColumn:p.originalColumn,name:null===p.name?null:a.at(p.name)})}},Je.prototype.allGeneratedPositionsFor=function(e){var t=$e.getArg(e,"line"),r={source:$e.getArg(e,"source"),originalLine:t,originalColumn:$e.getArg(e,"column",0)};if(r.source=this._findSourceIndex(r.source),r.source<0)return[];var n=[],s=this._findMapping(r,this._originalMappings,"originalLine","originalColumn",$e.compareByOriginalPositions,Ge.LEAST_UPPER_BOUND);if(s>=0){var i=this._originalMappings[s];if(void 0===e.column)for(var o=i.originalLine;i&&i.originalLine===o;)n.push({line:$e.getArg(i,"generatedLine",null),column:$e.getArg(i,"generatedColumn",null),lastColumn:$e.getArg(i,"lastGeneratedColumn",null)}),i=this._originalMappings[++s];else for(var a=i.originalColumn;i&&i.originalLine===t&&i.originalColumn==a;)n.push({line:$e.getArg(i,"generatedLine",null),column:$e.getArg(i,"generatedColumn",null),lastColumn:$e.getArg(i,"lastGeneratedColumn",null)}),i=this._originalMappings[++s]}return n},Ue.SourceMapConsumer=Je,qe.prototype=Object.create(Je.prototype),qe.prototype.consumer=Je,qe.prototype._findSourceIndex=function(e){var t,r=e;if(null!=this.sourceRoot&&(r=$e.relative(this.sourceRoot,r)),this._sources.has(r))return this._sources.indexOf(r);for(t=0;t<this._absoluteSources.length;++t)if(this._absoluteSources[t]==e)return t;return-1},qe.fromSourceMap=function(e,t){var r=Object.create(qe.prototype),n=r._names=ze.fromArray(e._names.toArray(),!0),s=r._sources=ze.fromArray(e._sources.toArray(),!0);r.sourceRoot=e._sourceRoot,r.sourcesContent=e._generateSourcesContent(r._sources.toArray(),r.sourceRoot),r.file=e._file,r._sourceMapURL=t,r._absoluteSources=r._sources.toArray().map((function(e){return $e.computeSourceURL(r.sourceRoot,e,t)}));for(var i=e._mappings.toArray().slice(),o=r.__generatedMappings=[],a=r.__originalMappings=[],l=0,u=i.length;l<u;l++){var c=i[l],h=new Ye;h.generatedLine=c.generatedLine,h.generatedColumn=c.generatedColumn,c.source&&(h.source=s.indexOf(c.source),h.originalLine=c.originalLine,h.originalColumn=c.originalColumn,c.name&&(h.name=n.indexOf(c.name)),a.push(h)),o.push(h)}return Ve(r.__originalMappings,$e.compareByOriginalPositions),r},qe.prototype._version=3,Object.defineProperty(qe.prototype,"sources",{get:function(){return this._absoluteSources.slice()}});const He=$e.compareByGeneratedPositionsDeflatedNoLine;function Qe(e,t){let r=e.length,n=e.length-t;if(!(n<=1))if(2==n){let r=e[t],n=e[t+1];He(r,n)>0&&(e[t]=n,e[t+1]=r)}else if(n<20)for(let n=t;n<r;n++)for(let r=n;r>t;r--){let t=e[r-1],n=e[r];if(He(t,n)<=0)break;e[r-1]=n,e[r]=t}else Ve(e,He,t)}function Ze(e,t){var r=e;"string"==typeof e&&(r=$e.parseSourceMapInput(e));var n=$e.getArg(r,"version"),s=$e.getArg(r,"sections");if(n!=this._version)throw new Error("Unsupported version: "+n);this._sources=new ze,this._names=new ze;var i={line:-1,column:0};this._sections=s.map((function(e){if(e.url)throw new Error("Support for url field in sections not implemented.");var r=$e.getArg(e,"offset"),n=$e.getArg(r,"line"),s=$e.getArg(r,"column");if(n<i.line||n===i.line&&s<i.column)throw new Error("Section offsets must be ordered and non-overlapping.");return i=r,{generatedOffset:{generatedLine:n+1,generatedColumn:s+1},consumer:new Je($e.getArg(e,"map"),t)}}))}qe.prototype._parseMappings=function(e,t){var r,n,s,i,o=1,a=0,l=0,u=0,c=0,h=0,p=e.length,f=0,d={},g=[],m=[];let w=0;for(;f<p;)if(";"===e.charAt(f))o++,f++,a=0,Qe(m,w),w=m.length;else if(","===e.charAt(f))f++;else{for((r=new Ye).generatedLine=o,s=f;s<p&&!this._charIsMappingSeparator(e,s);s++);for(e.slice(f,s),n=[];f<s;)We.decode(e,f,d),i=d.value,f=d.rest,n.push(i);if(2===n.length)throw new Error("Found a source, but no line and column");if(3===n.length)throw new Error("Found a source and line, but no column");if(r.generatedColumn=a+n[0],a=r.generatedColumn,n.length>1&&(r.source=c+n[1],c+=n[1],r.originalLine=l+n[2],l=r.originalLine,r.originalLine+=1,r.originalColumn=u+n[3],u=r.originalColumn,n.length>4&&(r.name=h+n[4],h+=n[4])),m.push(r),"number"==typeof r.originalLine){let e=r.source;for(;g.length<=e;)g.push(null);null===g[e]&&(g[e]=[]),g[e].push(r)}}Qe(m,w),this.__generatedMappings=m;for(var y=0;y<g.length;y++)null!=g[y]&&Ve(g[y],$e.compareByOriginalPositionsNoSource);this.__originalMappings=[].concat(...g)},qe.prototype._findMapping=function(e,t,r,n,s,i){if(e[r]<=0)throw new TypeError("Line must be greater than or equal to 1, got "+e[r]);if(e[n]<0)throw new TypeError("Column must be greater than or equal to 0, got "+e[n]);return Ge.search(e,t,s,i)},qe.prototype.computeColumnSpans=function(){for(var e=0;e<this._generatedMappings.length;++e){var t=this._generatedMappings[e];if(e+1<this._generatedMappings.length){var r=this._generatedMappings[e+1];if(t.generatedLine===r.generatedLine){t.lastGeneratedColumn=r.generatedColumn-1;continue}}t.lastGeneratedColumn=1/0}},qe.prototype.originalPositionFor=function(e){var t={generatedLine:$e.getArg(e,"line"),generatedColumn:$e.getArg(e,"column")},r=this._findMapping(t,this._generatedMappings,"generatedLine","generatedColumn",$e.compareByGeneratedPositionsDeflated,$e.getArg(e,"bias",Je.GREATEST_LOWER_BOUND));if(r>=0){var n=this._generatedMappings[r];if(n.generatedLine===t.generatedLine){var s=$e.getArg(n,"source",null);null!==s&&(s=this._sources.at(s),s=$e.computeSourceURL(this.sourceRoot,s,this._sourceMapURL));var i=$e.getArg(n,"name",null);return null!==i&&(i=this._names.at(i)),{source:s,line:$e.getArg(n,"originalLine",null),column:$e.getArg(n,"originalColumn",null),name:i}}}return{source:null,line:null,column:null,name:null}},qe.prototype.hasContentsOfAllSources=function(){return!!this.sourcesContent&&(this.sourcesContent.length>=this._sources.size()&&!this.sourcesContent.some((function(e){return null==e})))},qe.prototype.sourceContentFor=function(e,t){if(!this.sourcesContent)return null;var r=this._findSourceIndex(e);if(r>=0)return this.sourcesContent[r];var n,s=e;if(null!=this.sourceRoot&&(s=$e.relative(this.sourceRoot,s)),null!=this.sourceRoot&&(n=$e.urlParse(this.sourceRoot))){var i=s.replace(/^file:\/\//,"");if("file"==n.scheme&&this._sources.has(i))return this.sourcesContent[this._sources.indexOf(i)];if((!n.path||"/"==n.path)&&this._sources.has("/"+s))return this.sourcesContent[this._sources.indexOf("/"+s)]}if(t)return null;throw new Error('"'+s+'" is not in the SourceMap.')},qe.prototype.generatedPositionFor=function(e){var t=$e.getArg(e,"source");if((t=this._findSourceIndex(t))<0)return{line:null,column:null,lastColumn:null};var r={source:t,originalLine:$e.getArg(e,"line"),originalColumn:$e.getArg(e,"column")},n=this._findMapping(r,this._originalMappings,"originalLine","originalColumn",$e.compareByOriginalPositions,$e.getArg(e,"bias",Je.GREATEST_LOWER_BOUND));if(n>=0){var s=this._originalMappings[n];if(s.source===r.source)return{line:$e.getArg(s,"generatedLine",null),column:$e.getArg(s,"generatedColumn",null),lastColumn:$e.getArg(s,"lastGeneratedColumn",null)}}return{line:null,column:null,lastColumn:null}},Ue.BasicSourceMapConsumer=qe,Ze.prototype=Object.create(Je.prototype),Ze.prototype.constructor=Je,Ze.prototype._version=3,Object.defineProperty(Ze.prototype,"sources",{get:function(){for(var e=[],t=0;t<this._sections.length;t++)for(var r=0;r<this._sections[t].consumer.sources.length;r++)e.push(this._sections[t].consumer.sources[r]);return e}}),Ze.prototype.originalPositionFor=function(e){var t={generatedLine:$e.getArg(e,"line"),generatedColumn:$e.getArg(e,"column")},r=Ge.search(t,this._sections,(function(e,t){var r=e.generatedLine-t.generatedOffset.generatedLine;return r||e.generatedColumn-t.generatedOffset.generatedColumn})),n=this._sections[r];return n?n.consumer.originalPositionFor({line:t.generatedLine-(n.generatedOffset.generatedLine-1),column:t.generatedColumn-(n.generatedOffset.generatedLine===t.generatedLine?n.generatedOffset.generatedColumn-1:0),bias:e.bias}):{source:null,line:null,column:null,name:null}},Ze.prototype.hasContentsOfAllSources=function(){return this._sections.every((function(e){return e.consumer.hasContentsOfAllSources()}))},Ze.prototype.sourceContentFor=function(e,t){for(var r=0;r<this._sections.length;r++){var n=this._sections[r].consumer.sourceContentFor(e,!0);if(n)return n}if(t)return null;throw new Error('"'+e+'" is not in the SourceMap.')},Ze.prototype.generatedPositionFor=function(e){for(var t=0;t<this._sections.length;t++){var r=this._sections[t];if(-1!==r.consumer._findSourceIndex($e.getArg(e,"source"))){var n=r.consumer.generatedPositionFor(e);if(n)return{line:n.line+(r.generatedOffset.generatedLine-1),column:n.column+(r.generatedOffset.generatedLine===n.line?r.generatedOffset.generatedColumn-1:0)}}}return{line:null,column:null}},Ze.prototype._parseMappings=function(e,t){this.__generatedMappings=[],this.__originalMappings=[];for(var r=0;r<this._sections.length;r++)for(var n=this._sections[r],s=n.consumer._generatedMappings,i=0;i<s.length;i++){var o=s[i],a=n.consumer._sources.at(o.source);a=$e.computeSourceURL(n.consumer.sourceRoot,a,this._sourceMapURL),this._sources.add(a),a=this._sources.indexOf(a);var l=null;o.name&&(l=n.consumer._names.at(o.name),this._names.add(l),l=this._names.indexOf(l));var u={source:a,generatedLine:o.generatedLine+(n.generatedOffset.generatedLine-1),generatedColumn:o.generatedColumn+(n.generatedOffset.generatedLine===o.generatedLine?n.generatedOffset.generatedColumn-1:0),originalLine:o.originalLine,originalColumn:o.originalColumn,name:l};this.__generatedMappings.push(u),"number"==typeof u.originalLine&&this.__originalMappings.push(u)}Ve(this.__generatedMappings,$e.compareByGeneratedPositionsDeflated),Ve(this.__originalMappings,$e.compareByOriginalPositions)},Ue.IndexedSourceMapConsumer=Ze;var Ke={},Xe=we.SourceMapGenerator,et=be,tt=/(\r?\n)/,rt="$$$isSourceNode$$$";function nt(e,t,r,n,s){this.children=[],this.sourceContents={},this.line=null==e?null:e,this.column=null==t?null:t,this.source=null==r?null:r,this.name=null==s?null:s,this[rt]=!0,null!=n&&this.add(n)}nt.fromStringWithSourceMap=function(e,t,r){var n=new nt,s=e.split(tt),i=0,o=function(){return e()+(e()||"");function e(){return i<s.length?s[i++]:void 0}},a=1,l=0,u=null;return t.eachMapping((function(e){if(null!==u){if(!(a<e.generatedLine)){var t=(r=s[i]||"").substr(0,e.generatedColumn-l);return s[i]=r.substr(e.generatedColumn-l),l=e.generatedColumn,c(u,t),void(u=e)}c(u,o()),a++,l=0}for(;a<e.generatedLine;)n.add(o()),a++;if(l<e.generatedColumn){var r=s[i]||"";n.add(r.substr(0,e.generatedColumn)),s[i]=r.substr(e.generatedColumn),l=e.generatedColumn}u=e}),this),i<s.length&&(u&&c(u,o()),n.add(s.splice(i).join(""))),t.sources.forEach((function(e){var s=t.sourceContentFor(e);null!=s&&(null!=r&&(e=et.join(r,e)),n.setSourceContent(e,s))})),n;function c(e,t){if(null===e||void 0===e.source)n.add(t);else{var s=r?et.join(r,e.source):e.source;n.add(new nt(e.originalLine,e.originalColumn,s,t,e.name))}}},nt.prototype.add=function(e){if(Array.isArray(e))e.forEach((function(e){this.add(e)}),this);else{if(!e[rt]&&"string"!=typeof e)throw new TypeError("Expected a SourceNode, string, or an array of SourceNodes and strings. Got "+e);e&&this.children.push(e)}return this},nt.prototype.prepend=function(e){if(Array.isArray(e))for(var t=e.length-1;t>=0;t--)this.prepend(e[t]);else{if(!e[rt]&&"string"!=typeof e)throw new TypeError("Expected a SourceNode, string, or an array of SourceNodes and strings. Got "+e);this.children.unshift(e)}return this},nt.prototype.walk=function(e){for(var t,r=0,n=this.children.length;r<n;r++)(t=this.children[r])[rt]?t.walk(e):""!==t&&e(t,{source:this.source,line:this.line,column:this.column,name:this.name})},nt.prototype.join=function(e){var t,r,n=this.children.length;if(n>0){for(t=[],r=0;r<n-1;r++)t.push(this.children[r]),t.push(e);t.push(this.children[r]),this.children=t}return this},nt.prototype.replaceRight=function(e,t){var r=this.children[this.children.length-1];return r[rt]?r.replaceRight(e,t):"string"==typeof r?this.children[this.children.length-1]=r.replace(e,t):this.children.push("".replace(e,t)),this},nt.prototype.setSourceContent=function(e,t){this.sourceContents[et.toSetString(e)]=t},nt.prototype.walkSourceContents=function(e){for(var t=0,r=this.children.length;t<r;t++)this.children[t][rt]&&this.children[t].walkSourceContents(e);var n=Object.keys(this.sourceContents);for(t=0,r=n.length;t<r;t++)e(et.fromSetString(n[t]),this.sourceContents[n[t]])},nt.prototype.toString=function(){var e="";return this.walk((function(t){e+=t})),e},nt.prototype.toStringWithSourceMap=function(e){var t={code:"",line:1,column:0},r=new Xe(e),n=!1,s=null,i=null,o=null,a=null;return this.walk((function(e,l){t.code+=e,null!==l.source&&null!==l.line&&null!==l.column?(s===l.source&&i===l.line&&o===l.column&&a===l.name||r.addMapping({source:l.source,original:{line:l.line,column:l.column},generated:{line:t.line,column:t.column},name:l.name}),s=l.source,i=l.line,o=l.column,a=l.name,n=!0):n&&(r.addMapping({generated:{line:t.line,column:t.column}}),s=null,n=!1);for(var u=0,c=e.length;u<c;u++)10===e.charCodeAt(u)?(t.line++,t.column=0,u+1===c?(s=null,n=!1):n&&r.addMapping({source:l.source,original:{line:l.line,column:l.column},generated:{line:t.line,column:t.column},name:l.name})):t.column++})),this.walkSourceContents((function(e,t){r.setSourceContent(e,t)})),{code:t.code,map:r}},Ke.SourceNode=nt,me.SourceMapGenerator=we.SourceMapGenerator,me.SourceMapConsumer=Ue.SourceMapConsumer,me.SourceNode=Ke.SourceNode;var st={nanoid:(e=21)=>{let t="",r=e;for(;r--;)t+="useandom-26T198340PX75pxJACKVERYMINDBUSHWOLF_GQZbfghjklqvwyzrict"[64*Math.random()|0];return t},customAlphabet:(e,t)=>()=>{let r="",n=t;for(;n--;)r+=e[Math.random()*e.length|0];return r}};let{SourceMapConsumer:it,SourceMapGenerator:ot}=me,{existsSync:at,readFileSync:lt}=s,{dirname:ut,join:ct}=r;class ht{constructor(e,t){if(!1===t.map)return;this.loadAnnotation(e),this.inline=this.startWith(this.annotation,"data:");let r=t.map?t.map.prev:void 0,n=this.loadMap(t.from,r);!this.mapFile&&t.from&&(this.mapFile=t.from),this.mapFile&&(this.root=ut(this.mapFile)),n&&(this.text=n)}consumer(){return this.consumerCache||(this.consumerCache=new it(this.text)),this.consumerCache}withContent(){return!!(this.consumer().sourcesContent&&this.consumer().sourcesContent.length>0)}startWith(e,t){return!!e&&e.substr(0,t.length)===t}getAnnotationURL(e){return e.replace(/^\/\*\s*# sourceMappingURL=/,"").trim()}loadAnnotation(e){let t=e.match(/\/\*\s*# sourceMappingURL=/gm);if(!t)return;let r=e.lastIndexOf(t.pop()),n=e.indexOf("*/",r);r>-1&&n>-1&&(this.annotation=this.getAnnotationURL(e.substring(r,n)))}decodeInline(e){if(/^data:application\/json;charset=utf-?8,/.test(e)||/^data:application\/json,/.test(e))return decodeURIComponent(e.substr(RegExp.lastMatch.length));if(/^data:application\/json;charset=utf-?8;base64,/.test(e)||/^data:application\/json;base64,/.test(e))return t=e.substr(RegExp.lastMatch.length),Buffer?Buffer.from(t,"base64").toString():window.atob(t);var t;let r=e.match(/data:application\/json;([^,]+),/)[1];throw new Error("Unsupported source map encoding "+r)}loadFile(e){if(this.root=ut(e),at(e))return this.mapFile=e,lt(e,"utf-8").toString().trim()}loadMap(e,t){if(!1===t)return!1;if(t){if("string"==typeof t)return t;if("function"!=typeof t){if(t instanceof it)return ot.fromSourceMap(t).toString();if(t instanceof ot)return t.toString();if(this.isMap(t))return JSON.stringify(t);throw new Error("Unsupported previous source map format: "+t.toString())}{let r=t(e);if(r){let e=this.loadFile(r);if(!e)throw new Error("Unable to load previous source map: "+r.toString());return e}}}else{if(this.inline)return this.decodeInline(this.annotation);if(this.annotation){let t=this.annotation;return e&&(t=ct(ut(e),t)),this.loadFile(t)}}}isMap(e){return"object"==typeof e&&("string"==typeof e.mappings||"string"==typeof e._mappings||Array.isArray(e.sections))}}var pt=ht;ht.default=ht;let{SourceMapConsumer:ft,SourceMapGenerator:dt}=me,{fileURLToPath:gt,pathToFileURL:mt}=n,{resolve:wt,isAbsolute:yt}=r,{nanoid:vt}=st,Ct=q,St=Z,bt=pt,_t=Symbol("fromOffsetCache"),xt=Boolean(ft&&dt),Ot=Boolean(wt&&yt);class At{constructor(e,t={}){if(null==e||"object"==typeof e&&!e.toString)throw new Error(`PostCSS received ${e} instead of CSS string`);if(this.css=e.toString(),"\ufeff"===this.css[0]||""===this.css[0]?(this.hasBOM=!0,this.css=this.css.slice(1)):this.hasBOM=!1,t.from&&(!Ot||/^\w+:\/\//.test(t.from)||yt(t.from)?this.file=t.from:this.file=wt(t.from)),Ot&&xt){let e=new bt(this.css,t);if(e.text){this.map=e;let t=e.consumer().file;!this.file&&t&&(this.file=this.mapResolve(t))}}this.file||(this.id="<input css "+vt(6)+">"),this.map&&(this.map.file=this.from)}fromOffset(e){let t,r;if(this[_t])r=this[_t];else{let e=this.css.split("\n");r=new Array(e.length);let t=0;for(let n=0,s=e.length;n<s;n++)r[n]=t,t+=e[n].length+1;this[_t]=r}t=r[r.length-1];let n=0;if(e>=t)n=r.length-1;else{let t,s=r.length-2;for(;n<s;)if(t=n+(s-n>>1),e<r[t])s=t-1;else{if(!(e>=r[t+1])){n=t;break}n=t+1}}return{line:n+1,col:e-r[n]+1}}error(e,t,r,n={}){let s,i,o;if(t&&"object"==typeof t){let e=t,n=r;if("number"==typeof t.offset){let n=this.fromOffset(e.offset);t=n.line,r=n.col}else t=e.line,r=e.column;if("number"==typeof n.offset){let e=this.fromOffset(n.offset);i=e.line,o=e.col}else i=n.line,o=n.column}else if(!r){let e=this.fromOffset(t);t=e.line,r=e.col}let a=this.origin(t,r,i,o);return s=a?new St(e,void 0===a.endLine?a.line:{line:a.line,column:a.column},void 0===a.endLine?a.column:{line:a.endLine,column:a.endColumn},a.source,a.file,n.plugin):new St(e,void 0===i?t:{line:t,column:r},void 0===i?r:{line:i,column:o},this.css,this.file,n.plugin),s.input={line:t,column:r,endLine:i,endColumn:o,source:this.css},this.file&&(mt&&(s.input.url=mt(this.file).toString()),s.input.file=this.file),s}origin(e,t,r,n){if(!this.map)return!1;let s,i,o=this.map.consumer(),a=o.originalPositionFor({line:e,column:t});if(!a.source)return!1;"number"==typeof r&&(s=o.originalPositionFor({line:r,column:n})),i=yt(a.source)?mt(a.source):new URL(a.source,this.map.consumer().sourceRoot||mt(this.map.mapFile));let l={url:i.toString(),line:a.line,column:a.column,endLine:s&&s.line,endColumn:s&&s.column};if("file:"===i.protocol){if(!gt)throw new Error("file: protocol is not available in this PostCSS build");l.file=gt(i)}let u=o.sourceContentFor(a.source);return u&&(l.source=u),l}mapResolve(e){return/^\w+:\/\//.test(e)?e:wt(this.map.consumer().sourceRoot||this.map.root||".",e)}get from(){return this.file||this.id}toJSON(){let e={};for(let t of["hasBOM","css","file","id"])null!=this[t]&&(e[t]=this[t]);return this.map&&(e.map={...this.map},e.map.consumerCache&&(e.map.consumerCache=void 0)),e}}var Mt=At;At.default=At,Ct&&Ct.registerInput&&Ct.registerInput(At);let{SourceMapConsumer:kt,SourceMapGenerator:Et}=me,{dirname:Lt,resolve:Rt,relative:Pt,sep:It}=r,{pathToFileURL:Nt}=n,jt=Mt,Ut=Boolean(kt&&Et),Bt=Boolean(Lt&&Rt&&Pt&&It);var Dt=class{constructor(e,t,r,n){this.stringify=e,this.mapOpts=r.map||{},this.root=t,this.opts=r,this.css=n}isMap(){return void 0!==this.opts.map?!!this.opts.map:this.previous().length>0}previous(){if(!this.previousMaps)if(this.previousMaps=[],this.root)this.root.walk((e=>{if(e.source&&e.source.input.map){let t=e.source.input.map;this.previousMaps.includes(t)||this.previousMaps.push(t)}}));else{let e=new jt(this.css,this.opts);e.map&&this.previousMaps.push(e.map)}return this.previousMaps}isInline(){if(void 0!==this.mapOpts.inline)return this.mapOpts.inline;let e=this.mapOpts.annotation;return(void 0===e||!0===e)&&(!this.previous().length||this.previous().some((e=>e.inline)))}isSourcesContent(){return void 0!==this.mapOpts.sourcesContent?this.mapOpts.sourcesContent:!this.previous().length||this.previous().some((e=>e.withContent()))}clearAnnotation(){if(!1!==this.mapOpts.annotation)if(this.root){let e;for(let t=this.root.nodes.length-1;t>=0;t--)e=this.root.nodes[t],"comment"===e.type&&0===e.text.indexOf("# sourceMappingURL=")&&this.root.removeChild(t)}else this.css&&(this.css=this.css.replace(/(\n)?\/\*#[\S\s]*?\*\/$/gm,""))}setSourcesContent(){let e={};if(this.root)this.root.walk((t=>{if(t.source){let r=t.source.input.from;r&&!e[r]&&(e[r]=!0,this.map.setSourceContent(this.toUrl(this.path(r)),t.source.input.css))}}));else if(this.css){let e=this.opts.from?this.toUrl(this.path(this.opts.from)):"<no source>";this.map.setSourceContent(e,this.css)}}applyPrevMaps(){for(let e of this.previous()){let t,r=this.toUrl(this.path(e.file)),n=e.root||Lt(e.file);!1===this.mapOpts.sourcesContent?(t=new kt(e.text),t.sourcesContent&&(t.sourcesContent=t.sourcesContent.map((()=>null)))):t=e.consumer(),this.map.applySourceMap(t,r,this.toUrl(this.path(n)))}}isAnnotation(){return!!this.isInline()||(void 0!==this.mapOpts.annotation?this.mapOpts.annotation:!this.previous().length||this.previous().some((e=>e.annotation)))}toBase64(e){return Buffer?Buffer.from(e).toString("base64"):window.btoa(unescape(encodeURIComponent(e)))}addAnnotation(){let e;e=this.isInline()?"data:application/json;base64,"+this.toBase64(this.map.toString()):"string"==typeof this.mapOpts.annotation?this.mapOpts.annotation:"function"==typeof this.mapOpts.annotation?this.mapOpts.annotation(this.opts.to,this.root):this.outputFile()+".map";let t="\n";this.css.includes("\r\n")&&(t="\r\n"),this.css+=t+"/*# sourceMappingURL="+e+" */"}outputFile(){return this.opts.to?this.path(this.opts.to):this.opts.from?this.path(this.opts.from):"to.css"}generateMap(){if(this.root)this.generateString();else if(1===this.previous().length){let e=this.previous()[0].consumer();e.file=this.outputFile(),this.map=Et.fromSourceMap(e)}else this.map=new Et({file:this.outputFile()}),this.map.addMapping({source:this.opts.from?this.toUrl(this.path(this.opts.from)):"<no source>",generated:{line:1,column:0},original:{line:1,column:0}});return this.isSourcesContent()&&this.setSourcesContent(),this.root&&this.previous().length>0&&this.applyPrevMaps(),this.isAnnotation()&&this.addAnnotation(),this.isInline()?[this.css]:[this.css,this.map]}path(e){if(0===e.indexOf("<"))return e;if(/^\w+:\/\//.test(e))return e;if(this.mapOpts.absolute)return e;let t=this.opts.to?Lt(this.opts.to):".";return"string"==typeof this.mapOpts.annotation&&(t=Lt(Rt(t,this.mapOpts.annotation))),e=Pt(t,e)}toUrl(e){return"\\"===It&&(e=e.replace(/\\/g,"/")),encodeURI(e).replace(/[#?]/g,encodeURIComponent)}sourcePath(e){if(this.mapOpts.from)return this.toUrl(this.mapOpts.from);if(this.mapOpts.absolute){if(Nt)return Nt(e.source.input.from).toString();throw new Error("`map.absolute` option is not available in this PostCSS build")}return this.toUrl(this.path(e.source.input.from))}generateString(){this.css="",this.map=new Et({file:this.outputFile()});let e,t,r=1,n=1,s="<no source>",i={source:"",generated:{line:0,column:0},original:{line:0,column:0}};this.stringify(this.root,((o,a,l)=>{if(this.css+=o,a&&"end"!==l&&(i.generated.line=r,i.generated.column=n-1,a.source&&a.source.start?(i.source=this.sourcePath(a),i.original.line=a.source.start.line,i.original.column=a.source.start.column-1,this.map.addMapping(i)):(i.source=s,i.original.line=1,i.original.column=0,this.map.addMapping(i))),e=o.match(/\n/g),e?(r+=e.length,t=o.lastIndexOf("\n"),n=o.length-t):n+=o.length,a&&"start"!==l){let e=a.parent||{raws:{}};("decl"!==a.type||a!==e.last||e.raws.semicolon)&&(a.source&&a.source.end?(i.source=this.sourcePath(a),i.original.line=a.source.end.line,i.original.column=a.source.end.column-1,i.generated.line=r,i.generated.column=n-2,this.map.addMapping(i)):(i.source=s,i.original.line=1,i.original.column=0,i.generated.line=r,i.generated.column=n-1,this.map.addMapping(i)))}}))}generate(){if(this.clearAnnotation(),Bt&&Ut&&this.isMap())return this.generateMap();{let e="";return this.stringify(this.root,(t=>{e+=t})),[e]}}};let Ft=pe;class Tt extends Ft{constructor(e){super(e),this.type="comment"}}var $t=Tt;Tt.default=Tt;let Gt,zt,Wt,{isClean:Vt,my:Jt}=K,qt=ge,Yt=$t,Ht=pe;function Qt(e){return e.map((e=>(e.nodes&&(e.nodes=Qt(e.nodes)),delete e.source,e)))}function Zt(e){if(e[Vt]=!1,e.proxyOf.nodes)for(let t of e.proxyOf.nodes)Zt(t)}class Kt extends Ht{push(e){return e.parent=this,this.proxyOf.nodes.push(e),this}each(e){if(!this.proxyOf.nodes)return;let t,r,n=this.getIterator();for(;this.indexes[n]<this.proxyOf.nodes.length&&(t=this.indexes[n],r=e(this.proxyOf.nodes[t],t),!1!==r);)this.indexes[n]+=1;return delete this.indexes[n],r}walk(e){return this.each(((t,r)=>{let n;try{n=e(t,r)}catch(e){throw t.addToError(e)}return!1!==n&&t.walk&&(n=t.walk(e)),n}))}walkDecls(e,t){return t?e instanceof RegExp?this.walk(((r,n)=>{if("decl"===r.type&&e.test(r.prop))return t(r,n)})):this.walk(((r,n)=>{if("decl"===r.type&&r.prop===e)return t(r,n)})):(t=e,this.walk(((e,r)=>{if("decl"===e.type)return t(e,r)})))}walkRules(e,t){return t?e instanceof RegExp?this.walk(((r,n)=>{if("rule"===r.type&&e.test(r.selector))return t(r,n)})):this.walk(((r,n)=>{if("rule"===r.type&&r.selector===e)return t(r,n)})):(t=e,this.walk(((e,r)=>{if("rule"===e.type)return t(e,r)})))}walkAtRules(e,t){return t?e instanceof RegExp?this.walk(((r,n)=>{if("atrule"===r.type&&e.test(r.name))return t(r,n)})):this.walk(((r,n)=>{if("atrule"===r.type&&r.name===e)return t(r,n)})):(t=e,this.walk(((e,r)=>{if("atrule"===e.type)return t(e,r)})))}walkComments(e){return this.walk(((t,r)=>{if("comment"===t.type)return e(t,r)}))}append(...e){for(let t of e){let e=this.normalize(t,this.last);for(let t of e)this.proxyOf.nodes.push(t)}return this.markDirty(),this}prepend(...e){e=e.reverse();for(let t of e){let e=this.normalize(t,this.first,"prepend").reverse();for(let t of e)this.proxyOf.nodes.unshift(t);for(let t in this.indexes)this.indexes[t]=this.indexes[t]+e.length}return this.markDirty(),this}cleanRaws(e){if(super.cleanRaws(e),this.nodes)for(let t of this.nodes)t.cleanRaws(e)}insertBefore(e,t){let r,n=0===(e=this.index(e))&&"prepend",s=this.normalize(t,this.proxyOf.nodes[e],n).reverse();for(let t of s)this.proxyOf.nodes.splice(e,0,t);for(let t in this.indexes)r=this.indexes[t],e<=r&&(this.indexes[t]=r+s.length);return this.markDirty(),this}insertAfter(e,t){e=this.index(e);let r,n=this.normalize(t,this.proxyOf.nodes[e]).reverse();for(let t of n)this.proxyOf.nodes.splice(e+1,0,t);for(let t in this.indexes)r=this.indexes[t],e<r&&(this.indexes[t]=r+n.length);return this.markDirty(),this}removeChild(e){let t;e=this.index(e),this.proxyOf.nodes[e].parent=void 0,this.proxyOf.nodes.splice(e,1);for(let r in this.indexes)t=this.indexes[r],t>=e&&(this.indexes[r]=t-1);return this.markDirty(),this}removeAll(){for(let e of this.proxyOf.nodes)e.parent=void 0;return this.proxyOf.nodes=[],this.markDirty(),this}replaceValues(e,t,r){return r||(r=t,t={}),this.walkDecls((n=>{t.props&&!t.props.includes(n.prop)||t.fast&&!n.value.includes(t.fast)||(n.value=n.value.replace(e,r))})),this.markDirty(),this}every(e){return this.nodes.every(e)}some(e){return this.nodes.some(e)}index(e){return"number"==typeof e?e:(e.proxyOf&&(e=e.proxyOf),this.proxyOf.nodes.indexOf(e))}get first(){if(this.proxyOf.nodes)return this.proxyOf.nodes[0]}get last(){if(this.proxyOf.nodes)return this.proxyOf.nodes[this.proxyOf.nodes.length-1]}normalize(e,t){if("string"==typeof e)e=Qt(Gt(e).nodes);else if(Array.isArray(e)){e=e.slice(0);for(let t of e)t.parent&&t.parent.removeChild(t,"ignore")}else if("root"===e.type&&"document"!==this.type){e=e.nodes.slice(0);for(let t of e)t.parent&&t.parent.removeChild(t,"ignore")}else if(e.type)e=[e];else if(e.prop){if(void 0===e.value)throw new Error("Value field is missed in node creation");"string"!=typeof e.value&&(e.value=String(e.value)),e=[new qt(e)]}else if(e.selector)e=[new zt(e)];else if(e.name)e=[new Wt(e)];else{if(!e.text)throw new Error("Unknown node type in node creation");e=[new Yt(e)]}return e.map((e=>(e[Jt]||Kt.rebuild(e),(e=e.proxyOf).parent&&e.parent.removeChild(e),e[Vt]&&Zt(e),void 0===e.raws.before&&t&&void 0!==t.raws.before&&(e.raws.before=t.raws.before.replace(/\S/g,"")),e.parent=this,e)))}getProxyProcessor(){return{set:(e,t,r)=>(e[t]===r||(e[t]=r,"name"!==t&&"params"!==t&&"selector"!==t||e.markDirty()),!0),get:(e,t)=>"proxyOf"===t?e:e[t]?"each"===t||"string"==typeof t&&t.startsWith("walk")?(...r)=>e[t](...r.map((e=>"function"==typeof e?(t,r)=>e(t.toProxy(),r):e))):"every"===t||"some"===t?r=>e[t](((e,...t)=>r(e.toProxy(),...t))):"root"===t?()=>e.root().toProxy():"nodes"===t?e.nodes.map((e=>e.toProxy())):"first"===t||"last"===t?e[t].toProxy():e[t]:e[t]}}getIterator(){this.lastEach||(this.lastEach=0),this.indexes||(this.indexes={}),this.lastEach+=1;let e=this.lastEach;return this.indexes[e]=0,e}}Kt.registerParse=e=>{Gt=e},Kt.registerRule=e=>{zt=e},Kt.registerAtRule=e=>{Wt=e};var Xt=Kt;Kt.default=Kt,Kt.rebuild=e=>{"atrule"===e.type?Object.setPrototypeOf(e,Wt.prototype):"rule"===e.type?Object.setPrototypeOf(e,zt.prototype):"decl"===e.type?Object.setPrototypeOf(e,qt.prototype):"comment"===e.type&&Object.setPrototypeOf(e,Yt.prototype),e[Jt]=!0,e.nodes&&e.nodes.forEach((e=>{Kt.rebuild(e)}))};let er,tr,rr=Xt;class nr extends rr{constructor(e){super({type:"document",...e}),this.nodes||(this.nodes=[])}toResult(e={}){return new er(new tr,this,e).stringify()}}nr.registerLazyResult=e=>{er=e},nr.registerProcessor=e=>{tr=e};var sr=nr;nr.default=nr;let ir={};var or=function(e){ir[e]||(ir[e]=!0,"undefined"!=typeof console&&console.warn&&console.warn(e))};class ar{constructor(e,t={}){if(this.type="warning",this.text=e,t.node&&t.node.source){let e=t.node.rangeBy(t);this.line=e.start.line,this.column=e.start.column,this.endLine=e.end.line,this.endColumn=e.end.column}for(let e in t)this[e]=t[e]}toString(){return this.node?this.node.error(this.text,{plugin:this.plugin,index:this.index,word:this.word}).message:this.plugin?this.plugin+": "+this.text:this.text}}var lr=ar;ar.default=ar;let ur=lr;class cr{constructor(e,t,r){this.processor=e,this.messages=[],this.root=t,this.opts=r,this.css=void 0,this.map=void 0}toString(){return this.css}warn(e,t={}){t.plugin||this.lastPlugin&&this.lastPlugin.postcssPlugin&&(t.plugin=this.lastPlugin.postcssPlugin);let r=new ur(e,t);return this.messages.push(r),r}warnings(){return this.messages.filter((e=>"warning"===e.type))}get content(){return this.css}}var hr=cr;cr.default=cr;let pr=Xt;class fr extends pr{constructor(e){super(e),this.type="atrule"}append(...e){return this.proxyOf.nodes||(this.nodes=[]),super.append(...e)}prepend(...e){return this.proxyOf.nodes||(this.nodes=[]),super.prepend(...e)}}var dr=fr;fr.default=fr,pr.registerAtRule(fr);let gr,mr,wr=Xt;class yr extends wr{constructor(e){super(e),this.type="root",this.nodes||(this.nodes=[])}removeChild(e,t){let r=this.index(e);return!t&&0===r&&this.nodes.length>1&&(this.nodes[1].raws.before=this.nodes[r].raws.before),super.removeChild(e)}normalize(e,t,r){let n=super.normalize(e);if(t)if("prepend"===r)this.nodes.length>1?t.raws.before=this.nodes[1].raws.before:delete t.raws.before;else if(this.first!==t)for(let e of n)e.raws.before=t.raws.before;return n}toResult(e={}){return new gr(new mr,this,e).stringify()}}yr.registerLazyResult=e=>{gr=e},yr.registerProcessor=e=>{mr=e};var vr=yr;yr.default=yr;let Cr={split(e,t,r){let n=[],s="",i=!1,o=0,a=!1,l=!1;for(let r of e)l?l=!1:"\\"===r?l=!0:a?r===a&&(a=!1):'"'===r||"'"===r?a=r:"("===r?o+=1:")"===r?o>0&&(o-=1):0===o&&t.includes(r)&&(i=!0),i?(""!==s&&n.push(s.trim()),s="",i=!1):s+=r;return(r||""!==s)&&n.push(s.trim()),n},space:e=>Cr.split(e,[" ","\n","\t"]),comma:e=>Cr.split(e,[","],!0)};var Sr=Cr;Cr.default=Cr;let br=Xt,_r=Sr;class xr extends br{constructor(e){super(e),this.type="rule",this.nodes||(this.nodes=[])}get selectors(){return _r.comma(this.selector)}set selectors(e){let t=this.selector?this.selector.match(/,\s*/):null,r=t?t[0]:","+this.raw("between","beforeOpen");this.selector=e.join(r)}}var Or=xr;xr.default=xr,br.registerRule(xr);let Ar=ge,Mr=T,kr=$t,Er=dr,Lr=vr,Rr=Or;var Pr=class{constructor(e){this.input=e,this.root=new Lr,this.current=this.root,this.spaces="",this.semicolon=!1,this.customProperty=!1,this.createTokenizer(),this.root.source={input:e,start:{offset:0,line:1,column:1}}}createTokenizer(){this.tokenizer=Mr(this.input)}parse(){let e;for(;!this.tokenizer.endOfFile();)switch(e=this.tokenizer.nextToken(),e[0]){case"space":this.spaces+=e[1];break;case";":this.freeSemicolon(e);break;case"}":this.end(e);break;case"comment":this.comment(e);break;case"at-word":this.atrule(e);break;case"{":this.emptyRule(e);break;default:this.other(e)}this.endFile()}comment(e){let t=new kr;this.init(t,e[2]),t.source.end=this.getPosition(e[3]||e[2]);let r=e[1].slice(2,-2);if(/^\s*$/.test(r))t.text="",t.raws.left=r,t.raws.right="";else{let e=r.match(/^(\s*)([^]*\S)(\s*)$/);t.text=e[2],t.raws.left=e[1],t.raws.right=e[3]}}emptyRule(e){let t=new Rr;this.init(t,e[2]),t.selector="",t.raws.between="",this.current=t}other(e){let t=!1,r=null,n=!1,s=null,i=[],o=e[1].startsWith("--"),a=[],l=e;for(;l;){if(r=l[0],a.push(l),"("===r||"["===r)s||(s=l),i.push("("===r?")":"]");else if(o&&n&&"{"===r)s||(s=l),i.push("}");else if(0===i.length){if(";"===r){if(n)return void this.decl(a,o);break}if("{"===r)return void this.rule(a);if("}"===r){this.tokenizer.back(a.pop()),t=!0;break}":"===r&&(n=!0)}else r===i[i.length-1]&&(i.pop(),0===i.length&&(s=null));l=this.tokenizer.nextToken()}if(this.tokenizer.endOfFile()&&(t=!0),i.length>0&&this.unclosedBracket(s),t&&n){for(;a.length&&(l=a[a.length-1][0],"space"===l||"comment"===l);)this.tokenizer.back(a.pop());this.decl(a,o)}else this.unknownWord(a)}rule(e){e.pop();let t=new Rr;this.init(t,e[0][2]),t.raws.between=this.spacesAndCommentsFromEnd(e),this.raw(t,"selector",e),this.current=t}decl(e,t){let r=new Ar;this.init(r,e[0][2]);let n,s=e[e.length-1];for(";"===s[0]&&(this.semicolon=!0,e.pop()),r.source.end=this.getPosition(s[3]||s[2]);"word"!==e[0][0];)1===e.length&&this.unknownWord(e),r.raws.before+=e.shift()[1];for(r.source.start=this.getPosition(e[0][2]),r.prop="";e.length;){let t=e[0][0];if(":"===t||"space"===t||"comment"===t)break;r.prop+=e.shift()[1]}for(r.raws.between="";e.length;){if(n=e.shift(),":"===n[0]){r.raws.between+=n[1];break}"word"===n[0]&&/\w/.test(n[1])&&this.unknownWord([n]),r.raws.between+=n[1]}"_"!==r.prop[0]&&"*"!==r.prop[0]||(r.raws.before+=r.prop[0],r.prop=r.prop.slice(1));let i=this.spacesAndCommentsFromStart(e);this.precheckMissedSemicolon(e);for(let t=e.length-1;t>=0;t--){if(n=e[t],"!important"===n[1].toLowerCase()){r.important=!0;let n=this.stringFrom(e,t);n=this.spacesFromEnd(e)+n," !important"!==n&&(r.raws.important=n);break}if("important"===n[1].toLowerCase()){let n=e.slice(0),s="";for(let e=t;e>0;e--){let t=n[e][0];if(0===s.trim().indexOf("!")&&"space"!==t)break;s=n.pop()[1]+s}0===s.trim().indexOf("!")&&(r.important=!0,r.raws.important=s,e=n)}if("space"!==n[0]&&"comment"!==n[0])break}let o=e.some((e=>"space"!==e[0]&&"comment"!==e[0]));this.raw(r,"value",e),o?r.raws.between+=i:r.value=i+r.value,r.value.includes(":")&&!t&&this.checkMissedSemicolon(e)}atrule(e){let t,r,n,s=new Er;s.name=e[1].slice(1),""===s.name&&this.unnamedAtrule(s,e),this.init(s,e[2]);let i=!1,o=!1,a=[],l=[];for(;!this.tokenizer.endOfFile();){if(t=(e=this.tokenizer.nextToken())[0],"("===t||"["===t?l.push("("===t?")":"]"):"{"===t&&l.length>0?l.push("}"):t===l[l.length-1]&&l.pop(),0===l.length){if(";"===t){s.source.end=this.getPosition(e[2]),this.semicolon=!0;break}if("{"===t){o=!0;break}if("}"===t){if(a.length>0){for(n=a.length-1,r=a[n];r&&"space"===r[0];)r=a[--n];r&&(s.source.end=this.getPosition(r[3]||r[2]))}this.end(e);break}a.push(e)}else a.push(e);if(this.tokenizer.endOfFile()){i=!0;break}}s.raws.between=this.spacesAndCommentsFromEnd(a),a.length?(s.raws.afterName=this.spacesAndCommentsFromStart(a),this.raw(s,"params",a),i&&(e=a[a.length-1],s.source.end=this.getPosition(e[3]||e[2]),this.spaces=s.raws.between,s.raws.between="")):(s.raws.afterName="",s.params=""),o&&(s.nodes=[],this.current=s)}end(e){this.current.nodes&&this.current.nodes.length&&(this.current.raws.semicolon=this.semicolon),this.semicolon=!1,this.current.raws.after=(this.current.raws.after||"")+this.spaces,this.spaces="",this.current.parent?(this.current.source.end=this.getPosition(e[2]),this.current=this.current.parent):this.unexpectedClose(e)}endFile(){this.current.parent&&this.unclosedBlock(),this.current.nodes&&this.current.nodes.length&&(this.current.raws.semicolon=this.semicolon),this.current.raws.after=(this.current.raws.after||"")+this.spaces}freeSemicolon(e){if(this.spaces+=e[1],this.current.nodes){let e=this.current.nodes[this.current.nodes.length-1];e&&"rule"===e.type&&!e.raws.ownSemicolon&&(e.raws.ownSemicolon=this.spaces,this.spaces="")}}getPosition(e){let t=this.input.fromOffset(e);return{offset:e,line:t.line,column:t.col}}init(e,t){this.current.push(e),e.source={start:this.getPosition(t),input:this.input},e.raws.before=this.spaces,this.spaces="","comment"!==e.type&&(this.semicolon=!1)}raw(e,t,r){let n,s,i,o,a=r.length,l="",u=!0,c=/^([#.|])?(\w)+/i;for(let t=0;t<a;t+=1)n=r[t],s=n[0],"comment"!==s||"rule"!==e.type?"comment"===s||"space"===s&&t===a-1?u=!1:l+=n[1]:(o=r[t-1],i=r[t+1],"space"!==o[0]&&"space"!==i[0]&&c.test(o[1])&&c.test(i[1])?l+=n[1]:u=!1);if(!u){let n=r.reduce(((e,t)=>e+t[1]),"");e.raws[t]={value:l,raw:n}}e[t]=l}spacesAndCommentsFromEnd(e){let t,r="";for(;e.length&&(t=e[e.length-1][0],"space"===t||"comment"===t);)r=e.pop()[1]+r;return r}spacesAndCommentsFromStart(e){let t,r="";for(;e.length&&(t=e[0][0],"space"===t||"comment"===t);)r+=e.shift()[1];return r}spacesFromEnd(e){let t,r="";for(;e.length&&(t=e[e.length-1][0],"space"===t);)r=e.pop()[1]+r;return r}stringFrom(e,t){let r="";for(let n=t;n<e.length;n++)r+=e[n][1];return e.splice(t,e.length-t),r}colon(e){let t,r,n,s=0;for(let[i,o]of e.entries()){if(t=o,r=t[0],"("===r&&(s+=1),")"===r&&(s-=1),0===s&&":"===r){if(n){if("word"===n[0]&&"progid"===n[1])continue;return i}this.doubleColon(t)}n=t}return!1}unclosedBracket(e){throw this.input.error("Unclosed bracket",{offset:e[2]},{offset:e[2]+1})}unknownWord(e){throw this.input.error("Unknown word",{offset:e[0][2]},{offset:e[0][2]+e[0][1].length})}unexpectedClose(e){throw this.input.error("Unexpected }",{offset:e[2]},{offset:e[2]+1})}unclosedBlock(){let e=this.current.source.start;throw this.input.error("Unclosed block",e.line,e.column)}doubleColon(e){throw this.input.error("Double colon",{offset:e[2]},{offset:e[2]+e[1].length})}unnamedAtrule(e,t){throw this.input.error("At-rule without name",{offset:t[2]},{offset:t[2]+t[1].length})}precheckMissedSemicolon(){}checkMissedSemicolon(e){let t=this.colon(e);if(!1===t)return;let r,n=0;for(let s=t-1;s>=0&&(r=e[s],"space"===r[0]||(n+=1,2!==n));s--);throw this.input.error("Missed semicolon","word"===r[0]?r[3]+1:r[2])}};let Ir=Xt,Nr=Pr,jr=Mt;function Ur(e,t){let r=new jr(e,t),n=new Nr(r);try{n.parse()}catch(e){throw"production"!==process.env.NODE_ENV&&"CssSyntaxError"===e.name&&t&&t.from&&(/\.scss$/i.test(t.from)?e.message+="\nYou tried to parse SCSS with the standard CSS parser; try again with the postcss-scss parser":/\.sass/i.test(t.from)?e.message+="\nYou tried to parse Sass with the standard CSS parser; try again with the postcss-sass parser":/\.less$/i.test(t.from)&&(e.message+="\nYou tried to parse Less with the standard CSS parser; try again with the postcss-less parser")),e}return n.root}var Br=Ur;Ur.default=Ur,Ir.registerParse(Ur);let{isClean:Dr,my:Fr}=K,Tr=Dt,$r=se,Gr=Xt,zr=sr,Wr=or,Vr=hr,Jr=Br,qr=vr;const Yr={document:"Document",root:"Root",atrule:"AtRule",rule:"Rule",decl:"Declaration",comment:"Comment"},Hr={postcssPlugin:!0,prepare:!0,Once:!0,Document:!0,Root:!0,Declaration:!0,Rule:!0,AtRule:!0,Comment:!0,DeclarationExit:!0,RuleExit:!0,AtRuleExit:!0,CommentExit:!0,RootExit:!0,DocumentExit:!0,OnceExit:!0},Qr={postcssPlugin:!0,prepare:!0,Once:!0};function Zr(e){return"object"==typeof e&&"function"==typeof e.then}function Kr(e){let t=!1,r=Yr[e.type];return"decl"===e.type?t=e.prop.toLowerCase():"atrule"===e.type&&(t=e.name.toLowerCase()),t&&e.append?[r,r+"-"+t,0,r+"Exit",r+"Exit-"+t]:t?[r,r+"-"+t,r+"Exit",r+"Exit-"+t]:e.append?[r,0,r+"Exit"]:[r,r+"Exit"]}function Xr(e){let t;return t="document"===e.type?["Document",0,"DocumentExit"]:"root"===e.type?["Root",0,"RootExit"]:Kr(e),{node:e,events:t,eventIndex:0,visitors:[],visitorIndex:0,iterator:0}}function en(e){return e[Dr]=!1,e.nodes&&e.nodes.forEach((e=>en(e))),e}let tn={};class rn{constructor(e,t,r){let n;if(this.stringified=!1,this.processed=!1,"object"!=typeof t||null===t||"root"!==t.type&&"document"!==t.type)if(t instanceof rn||t instanceof Vr)n=en(t.root),t.map&&(void 0===r.map&&(r.map={}),r.map.inline||(r.map.inline=!1),r.map.prev=t.map);else{let e=Jr;r.syntax&&(e=r.syntax.parse),r.parser&&(e=r.parser),e.parse&&(e=e.parse);try{n=e(t,r)}catch(e){this.processed=!0,this.error=e}n&&!n[Fr]&&Gr.rebuild(n)}else n=en(t);this.result=new Vr(e,n,r),this.helpers={...tn,result:this.result,postcss:tn},this.plugins=this.processor.plugins.map((e=>"object"==typeof e&&e.prepare?{...e,...e.prepare(this.result)}:e))}get[Symbol.toStringTag](){return"LazyResult"}get processor(){return this.result.processor}get opts(){return this.result.opts}get css(){return this.stringify().css}get content(){return this.stringify().content}get map(){return this.stringify().map}get root(){return this.sync().root}get messages(){return this.sync().messages}warnings(){return this.sync().warnings()}toString(){return this.css}then(e,t){return"production"!==process.env.NODE_ENV&&("from"in this.opts||Wr("Without `from` option PostCSS could generate wrong source map and will not find Browserslist config. Set it to CSS file path or to `undefined` to prevent this warning.")),this.async().then(e,t)}catch(e){return this.async().catch(e)}finally(e){return this.async().then(e,e)}async(){return this.error?Promise.reject(this.error):this.processed?Promise.resolve(this.result):(this.processing||(this.processing=this.runAsync()),this.processing)}sync(){if(this.error)throw this.error;if(this.processed)return this.result;if(this.processed=!0,this.processing)throw this.getAsyncError();for(let e of this.plugins){if(Zr(this.runOnRoot(e)))throw this.getAsyncError()}if(this.prepareVisitors(),this.hasListener){let e=this.result.root;for(;!e[Dr];)e[Dr]=!0,this.walkSync(e);if(this.listeners.OnceExit)if("document"===e.type)for(let t of e.nodes)this.visitSync(this.listeners.OnceExit,t);else this.visitSync(this.listeners.OnceExit,e)}return this.result}stringify(){if(this.error)throw this.error;if(this.stringified)return this.result;this.stringified=!0,this.sync();let e=this.result.opts,t=$r;e.syntax&&(t=e.syntax.stringify),e.stringifier&&(t=e.stringifier),t.stringify&&(t=t.stringify);let r=new Tr(t,this.result.root,this.result.opts).generate();return this.result.css=r[0],this.result.map=r[1],this.result}walkSync(e){e[Dr]=!0;let t=Kr(e);for(let r of t)if(0===r)e.nodes&&e.each((e=>{e[Dr]||this.walkSync(e)}));else{let t=this.listeners[r];if(t&&this.visitSync(t,e.toProxy()))return}}visitSync(e,t){for(let[r,n]of e){let e;this.result.lastPlugin=r;try{e=n(t,this.helpers)}catch(e){throw this.handleError(e,t.proxyOf)}if("root"!==t.type&&"document"!==t.type&&!t.parent)return!0;if(Zr(e))throw this.getAsyncError()}}runOnRoot(e){this.result.lastPlugin=e;try{if("object"==typeof e&&e.Once){if("document"===this.result.root.type){let t=this.result.root.nodes.map((t=>e.Once(t,this.helpers)));return Zr(t[0])?Promise.all(t):t}return e.Once(this.result.root,this.helpers)}if("function"==typeof e)return e(this.result.root,this.result)}catch(e){throw this.handleError(e)}}getAsyncError(){throw new Error("Use process(css).then(cb) to work with async plugins")}handleError(e,t){let r=this.result.lastPlugin;try{if(t&&t.addToError(e),this.error=e,"CssSyntaxError"!==e.name||e.plugin){if(r.postcssVersion&&"production"!==process.env.NODE_ENV){let e=r.postcssPlugin,t=r.postcssVersion,n=this.result.processor.version,s=t.split("."),i=n.split(".");(s[0]!==i[0]||parseInt(s[1])>parseInt(i[1]))&&console.error("Unknown error from PostCSS plugin. Your current PostCSS version is "+n+", but "+e+" uses "+t+". Perhaps this is the source of the error below.")}}else e.plugin=r.postcssPlugin,e.setMessage()}catch(e){console&&console.error&&console.error(e)}return e}async runAsync(){this.plugin=0;for(let e=0;e<this.plugins.length;e++){let t=this.plugins[e],r=this.runOnRoot(t);if(Zr(r))try{await r}catch(e){throw this.handleError(e)}}if(this.prepareVisitors(),this.hasListener){let e=this.result.root;for(;!e[Dr];){e[Dr]=!0;let t=[Xr(e)];for(;t.length>0;){let e=this.visitTick(t);if(Zr(e))try{await e}catch(e){let r=t[t.length-1].node;throw this.handleError(e,r)}}}if(this.listeners.OnceExit)for(let[t,r]of this.listeners.OnceExit){this.result.lastPlugin=t;try{if("document"===e.type){let t=e.nodes.map((e=>r(e,this.helpers)));await Promise.all(t)}else await r(e,this.helpers)}catch(e){throw this.handleError(e)}}}return this.processed=!0,this.stringify()}prepareVisitors(){this.listeners={};let e=(e,t,r)=>{this.listeners[t]||(this.listeners[t]=[]),this.listeners[t].push([e,r])};for(let t of this.plugins)if("object"==typeof t)for(let r in t){if(!Hr[r]&&/^[A-Z]/.test(r))throw new Error(`Unknown event ${r} in ${t.postcssPlugin}. Try to update PostCSS (${this.processor.version} now).`);if(!Qr[r])if("object"==typeof t[r])for(let n in t[r])e(t,"*"===n?r:r+"-"+n.toLowerCase(),t[r][n]);else"function"==typeof t[r]&&e(t,r,t[r])}this.hasListener=Object.keys(this.listeners).length>0}visitTick(e){let t=e[e.length-1],{node:r,visitors:n}=t;if("root"!==r.type&&"document"!==r.type&&!r.parent)return void e.pop();if(n.length>0&&t.visitorIndex<n.length){let[e,s]=n[t.visitorIndex];t.visitorIndex+=1,t.visitorIndex===n.length&&(t.visitors=[],t.visitorIndex=0),this.result.lastPlugin=e;try{return s(r.toProxy(),this.helpers)}catch(e){throw this.handleError(e,r)}}if(0!==t.iterator){let n,s=t.iterator;for(;n=r.nodes[r.indexes[s]];)if(r.indexes[s]+=1,!n[Dr])return n[Dr]=!0,void e.push(Xr(n));t.iterator=0,delete r.indexes[s]}let s=t.events;for(;t.eventIndex<s.length;){let e=s[t.eventIndex];if(t.eventIndex+=1,0===e)return void(r.nodes&&r.nodes.length&&(r[Dr]=!0,t.iterator=r.getIterator()));if(this.listeners[e])return void(t.visitors=this.listeners[e])}e.pop()}}rn.registerPostcss=e=>{tn=e};var nn=rn;rn.default=rn,qr.registerLazyResult(rn),zr.registerLazyResult(rn);let sn=Dt,on=se,an=or,ln=Br;const un=hr;class cn{constructor(e,t,r){let n;t=t.toString(),this.stringified=!1,this._processor=e,this._css=t,this._opts=r,this._map=void 0;let s=on;this.result=new un(this._processor,n,this._opts),this.result.css=t;let i=this;Object.defineProperty(this.result,"root",{get:()=>i.root});let o=new sn(s,n,this._opts,t);if(o.isMap()){let[e,t]=o.generate();e&&(this.result.css=e),t&&(this.result.map=t)}}get[Symbol.toStringTag](){return"NoWorkResult"}get processor(){return this.result.processor}get opts(){return this.result.opts}get css(){return this.result.css}get content(){return this.result.css}get map(){return this.result.map}get root(){if(this._root)return this._root;let e,t=ln;try{e=t(this._css,this._opts)}catch(e){this.error=e}return this._root=e,e}get messages(){return[]}warnings(){return[]}toString(){return this._css}then(e,t){return"production"!==process.env.NODE_ENV&&("from"in this._opts||an("Without `from` option PostCSS could generate wrong source map and will not find Browserslist config. Set it to CSS file path or to `undefined` to prevent this warning.")),this.async().then(e,t)}catch(e){return this.async().catch(e)}finally(e){return this.async().then(e,e)}async(){return this.error?Promise.reject(this.error):Promise.resolve(this.result)}sync(){if(this.error)throw this.error;return this.result}}var hn=cn;cn.default=cn;let pn=hn,fn=nn,dn=sr,gn=vr;class mn{constructor(e=[]){this.version="8.4.4",this.plugins=this.normalize(e)}use(e){return this.plugins=this.plugins.concat(this.normalize([e])),this}process(e,t={}){return 0===this.plugins.length&&void 0===t.parser&&void 0===t.stringifier&&void 0===t.syntax?new pn(this,e,t):new fn(this,e,t)}normalize(e){let t=[];for(let r of e)if(!0===r.postcss?r=r():r.postcss&&(r=r.postcss),"object"==typeof r&&Array.isArray(r.plugins))t=t.concat(r.plugins);else if("object"==typeof r&&r.postcssPlugin)t.push(r);else if("function"==typeof r)t.push(r);else{if("object"!=typeof r||!r.parse&&!r.stringify)throw new Error(r+" is not a PostCSS plugin");if("production"!==process.env.NODE_ENV)throw new Error("PostCSS syntaxes cannot be used as plugins. Instead, please use one of the syntax/parser/stringifier options as outlined in your PostCSS runner documentation.")}return t}}var wn=mn;mn.default=mn,gn.registerProcessor(mn),dn.registerProcessor(mn);let yn=ge,vn=pt,Cn=$t,Sn=dr,bn=Mt,_n=vr,xn=Or;function On(e,t){if(Array.isArray(e))return e.map((e=>On(e)));let{inputs:r,...n}=e;if(r){t=[];for(let e of r){let r={...e,__proto__:bn.prototype};r.map&&(r.map={...r.map,__proto__:vn.prototype}),t.push(r)}}if(n.nodes&&(n.nodes=e.nodes.map((e=>On(e,t)))),n.source){let{inputId:e,...r}=n.source;n.source=r,null!=e&&(n.source.input=t[e])}if("root"===n.type)return new _n(n);if("decl"===n.type)return new yn(n);if("rule"===n.type)return new xn(n);if("comment"===n.type)return new Cn(n);if("atrule"===n.type)return new Sn(n);throw new Error("Unknown node type: "+e.type)}var An=On;On.default=On;let Mn=Z,kn=ge,En=nn,Ln=Xt,Rn=wn,Pn=se,In=An,Nn=sr,jn=lr,Un=$t,Bn=dr,Dn=hr,Fn=Mt,Tn=Br,$n=Sr,Gn=Or,zn=vr,Wn=pe;function Vn(...e){return 1===e.length&&Array.isArray(e[0])&&(e=e[0]),new Rn(e)}Vn.plugin=function(e,t){function r(...r){let n=t(...r);return n.postcssPlugin=e,n.postcssVersion=(new Rn).version,n}let n;return console&&console.warn&&(console.warn(e+": postcss.plugin was deprecated. Migration guide:\nhttps://evilmartians.com/chronicles/postcss-8-plugin-migration"),process.env.LANG&&process.env.LANG.startsWith("cn")&&console.warn(e+": 里面 postcss.plugin 被弃用. 迁移指南:\nhttps://www.w3ctech.com/topic/2226")),Object.defineProperty(r,"postcss",{get:()=>(n||(n=r()),n)}),r.process=function(e,t,n){return Vn([r(n)]).process(e,t)},r},Vn.stringify=Pn,Vn.parse=Tn,Vn.fromJSON=In,Vn.list=$n,Vn.comment=e=>new Un(e),Vn.atRule=e=>new Bn(e),Vn.decl=e=>new kn(e),Vn.rule=e=>new Gn(e),Vn.root=e=>new zn(e),Vn.document=e=>new Nn(e),Vn.CssSyntaxError=Mn,Vn.Declaration=kn,Vn.Container=Ln,Vn.Processor=Rn,Vn.Document=Nn,Vn.Comment=Un,Vn.Warning=jn,Vn.AtRule=Bn,Vn.Result=Dn,Vn.Input=Fn,Vn.Rule=Gn,Vn.Root=zn,Vn.Node=Wn,En.registerPostcss(Vn);var Jn=Vn;async function qn(){return new Promise((e=>{let t="",r=!1;if(setTimeout((()=>{r=!0,e("")}),1e4),process.stdin.isTTY){if(r)return;e(t)}else process.stdin.setEncoding("utf8"),process.stdin.on("readable",(()=>{let e;for(;e=process.stdin.read();)t+=e})),process.stdin.on("end",(()=>{r||e(t)}))}))}Vn.default=Vn,async function(e,t,n){const s=function(e,t,r){const n=e.map((e=>e.trim())).filter((e=>!!e)),s={stdin:!1,stdout:!1,output:null,outputDir:null,inputs:[],inlineMap:!0,externalMap:!1,replace:!1,pluginOptions:{},debug:!1};let i=null,o=!1;for(let e=0;e<n.length;e++){const t=n[e];switch(t){case"-o":case"--output":s.output=n[e+1],e++,o=!0;break;case"-m":case"--map":s.externalMap=!0,s.inlineMap=!1,o=!0;break;case"--no-map":s.externalMap=!1,s.inlineMap=!1,o=!0;break;case"-r":case"--replace":s.replace=!0,o=!0;break;case"--debug":s.debug=!0,o=!0;break;case"-d":case"--dir":s.outputDir=n[e+1],e++,o=!0;break;case"-p":case"--plugin-options":i=n[e+1],e++,o=!0;break;default:if(0===t.indexOf("-"))return console.warn(`[error] unknown argument : ${t}\n`),r(),c.InvalidArguments;if(!o){s.inputs.push(t);break}return r(),c.InvalidArguments}}if(s.replace&&(s.output=null,s.outputDir=null),s.outputDir&&(s.output=null),s.inputs.length>1&&s.output)return console.warn('[error] omit "--output" when processing multiple inputs\n'),r(),c.InvalidArguments;0===s.inputs.length&&(s.stdin=!0),s.output||s.outputDir||s.replace||(s.stdout=!0),s.stdout&&(s.externalMap=!1);let a={};if(i)try{a=JSON.parse(i)}catch(e){return console.warn("[error] plugin options must be valid JSON\n"),r(),c.InvalidArguments}for(const e in a){const n=a[e];if(!t.includes(e))return console.warn(`[error] unknown plugin option: ${e}\n`),r(),c.InvalidArguments;s.pluginOptions[e]=n}return s}(process.argv.slice(2),t,n);s===c.InvalidArguments&&process.exit(1);const o=e(s.pluginOptions);s.stdin&&s.stdout?await async function(e,t,r){let n="";try{const s=await qn();s||(r(),process.exit(1)),n=(await Jn([e]).process(s,{from:"stdin",to:"stdout",map:!!t.inlineMap&&{inline:!0}})).css}catch(e){console.error(t.debug?e:e.message),process.exit(1)}process.stdout.write(n+(t.inlineMap?"\n":"")),process.exit(0)}(o,s,n):s.stdin?await async function(e,t,n){let s=t.output;!s&&t.outputDir&&(s=r.join(t.outputDir,"output.css"));try{const r=await qn();r||(n(),process.exit(1));const o=await Jn([e]).process(r,{from:"stdin",to:s,map:!(!t.inlineMap&&!t.externalMap)&&{inline:t.inlineMap}});t.externalMap&&o.map?await Promise.all([await i.writeFile(s,o.css+(t.inlineMap?"\n":"")),await i.writeFile(`${s}.map`,o.map.toString())]):await i.writeFile(s,o.css+(t.inlineMap?"\n":""))}catch(e){console.error(t.debug?e:e.message),process.exit(1)}console.log(`CSS was written to "${r.normalize(s)}"`),process.exit(0)}(o,s,n):s.stdout?await async function(e,t){let r=[];try{r=await Promise.all(t.inputs.map((async t=>{const r=await i.readFile(t);return(await Jn([e]).process(r,{from:t,to:"stdout",map:!1})).css})))}catch(e){console.error(t.debug?e:e.message),process.exit(1)}for(const e of r)process.stdout.write(e);process.exit(0)}(o,s):await async function(e,t){try{await Promise.all(t.inputs.map((async n=>{let s=t.output;t.outputDir&&(s=r.join(t.outputDir,r.basename(n))),t.replace&&(s=n);const o=await i.readFile(n),a=await Jn([e]).process(o,{from:n,to:s,map:!(!t.inlineMap&&!t.externalMap)&&{inline:t.inlineMap}});t.externalMap&&a.map?await Promise.all([await i.writeFile(s,a.css+(t.inlineMap?"\n":"")),await i.writeFile(`${s}.map`,a.map.toString())]):await i.writeFile(s,a.css+(t.inlineMap?"\n":"")),console.log(`CSS was written to "${r.normalize(s)}"`)})))}catch(e){console.error(t.debug?e:e.message),process.exit(1)}process.exit(0)}(o,s)}(o,["preserve"],function(e,t,r,n=null){let s=[];if(n){const e=Math.max(...Object.keys(n).map((e=>e.length))),t=new Array(e).fill(" ").join("");t.length&&(s=["\nPlugin Options:",...Object.keys(n).map((e=>` ${(e+t).slice(0,t.length)} ${typeof n[e]}`))],s.push(`\n ${JSON.stringify(n,null,2).split("\n").join("\n ")}`))}const i=[`${t}\n`,` ${r}\n`,"Usage:",` ${e} [input.css] [OPTIONS] [-o|--output output.css]`,` ${e} <input.css>... [OPTIONS] --dir <output-directory>`,` ${e} <input.css>... [OPTIONS] --replace`,"\nOptions:"," -o, --output Output file"," -d, --dir Output directory"," -r, --replace Replace (overwrite) the input file"," -m, --map Create an external sourcemap"," --no-map Disable the default inline sourcemaps"," -p, --plugin-options Stringified JSON object with plugin options"];return s.length>0&&i.push(...s),()=>{console.warn(i.join("\n"))}}("css-has-pseudo","PostCSS Has Pseudo","Transforms CSS with :has {}",{preserve:!0}));
|
package/dist/index.cjs.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"index.cjs","sources":["../src/index.js"],"sourcesContent":["import parser from 'postcss-selector-parser';\n\nconst creator = (/** @type {{ preserve: true | false }} */ opts) => {\n\topts = typeof opts === 'object' && opts || defaultOptions;\n\n\t/** Whether the original rule should be preserved. */\n\tconst shouldPreserve = Boolean('preserve' in opts ? opts.preserve : true);\n\n\treturn {\n\t\tpostcssPlugin: 'css-has-pseudo',\n\t\tRule: (rule, { result }) => {\n\t\t\tif (!rule.selector.includes(':has(')) {\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\tlet modifiedSelector;\n\n\t\t\ttry {\n\t\t\t\tconst modifiedSelectorAST = parser((selectors) => {\n\t\t\t\t\tselectors.walkPseudos(selector => {\n\t\t\t\t\t\tif (selector.value === ':has' && selector.nodes) {\n\t\t\t\t\t\t\tconst isNotHas = isParentInNotPseudo(selector);\n\n\t\t\t\t\t\t\tselector.value = isNotHas ? ':not-has' : ':has';\n\n\t\t\t\t\t\t\tconst attribute = parser.attribute({\n\t\t\t\t\t\t\t\tattribute: getEscapedCss(String(selector)),\n\t\t\t\t\t\t\t});\n\n\t\t\t\t\t\t\tif (isNotHas) {\n\t\t\t\t\t\t\t\tselector.parent.parent.replaceWith(attribute);\n\t\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t\tselector.replaceWith(attribute);\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t});\n\t\t\t\t}).processSync(rule.selector);\n\n\t\t\t\tmodifiedSelector = String(modifiedSelectorAST);\n\t\t\t} catch (_) {\n\t\t\t\trule.warn(result, `Failed to parse selector : ${rule.selector}`);\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\tif (typeof modifiedSelector === 'undefined') {\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\tif (modifiedSelector === rule.selector) {\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\tif (shouldPreserve) {\n\t\t\t\trule.cloneBefore({ selector: modifiedSelector });\n\t\t\t} else {\n\t\t\t\trule.assign({ selector: modifiedSelector });\n\t\t\t}\n\t\t},\n\t};\n};\n\ncreator.postcss = true;\n\n/** Default options. */\nconst defaultOptions = { preserve: true };\n\n/** Returns the string as an escaped CSS identifier. */\nconst getEscapedCss = (/** @type {string} */ value) => encodeURIComponent(value).replace(/%3A/g, ':').replace(/%5B/g, '[').replace(/%5D/g, ']').replace(/%2C/g, ',').replace(/[():%[\\],]/g, '\\\\$&');\n\n/** Returns whether the selector is within a `:not` pseudo-class. */\nconst isParentInNotPseudo = (selector) => selector.parent?.parent?.type === 'pseudo' && selector.parent.parent.value === ':not';\n\nexport default creator;\n"],"names":["creator","opts","defaultOptions","shouldPreserve","Boolean","preserve","postcssPlugin","Rule","rule","result","selector","includes","modifiedSelector","modifiedSelectorAST","parser","selectors","walkPseudos","value","nodes","isNotHas","isParentInNotPseudo","attribute","getEscapedCss","String","parent","replaceWith","processSync","_","warn","cloneBefore","assign","postcss","encodeURIComponent","replace","type"],"mappings":"uIAEMA,EAAqDC,IAC1DA,EAAuB,iBAATA,GAAqBA,GAAQC,QAGrCC,EAAiBC,UAAQ,aAAcH,IAAOA,EAAKI,gBAElD,CACNC,cAAe,iBACfC,KAAM,CAACC,GAAQC,OAAAA,UACTD,EAAKE,SAASC,SAAS,oBAIxBC,YAGGC,EAAsBC,WAAQC,IACnCA,EAAUC,aAAYN,OACE,SAAnBA,EAASO,OAAoBP,EAASQ,MAAO,OAC1CC,EAAWC,EAAoBV,GAErCA,EAASO,MAAQE,EAAW,WAAa,aAEnCE,EAAYP,UAAOO,UAAU,CAClCA,UAAWC,EAAcC,OAAOb,MAG7BS,EACHT,EAASc,OAAOA,OAAOC,YAAYJ,GAEnCX,EAASe,YAAYJ,UAItBK,YAAYlB,EAAKE,UAEpBE,EAAmBW,OAAOV,GACzB,MAAOc,eACRnB,EAAKoB,KAAKnB,EAAS,8BAA6BD,EAAKE,iBAItB,IAArBE,GAIPA,IAAqBJ,EAAKE,WAI1BP,EACHK,EAAKqB,YAAY,CAAEnB,SAAUE,IAE7BJ,EAAKsB,OAAO,CAAEpB,SAAUE,QAM5BZ,EAAQ+B,SAAU,EAGlB,MAAM7B,EAAiB,CAAEG,UAAU,GAG7BiB,EAAuCL,GAAUe,mBAAmBf,GAAOgB,QAAQ,OAAQ,KAAKA,QAAQ,OAAQ,KAAKA,QAAQ,OAAQ,KAAKA,QAAQ,OAAQ,KAAKA,QAAQ,cAAe,QAGtLb,EAAuBV,kBAA+C,qBAAlCA,EAASc,oBAAQA,iBAAQU,OAAsD,SAAjCxB,EAASc,OAAOA,OAAOP"}
|
package/dist/index.mjs.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"index.mjs","sources":["../src/index.js"],"sourcesContent":["import parser from 'postcss-selector-parser';\n\nconst creator = (/** @type {{ preserve: true | false }} */ opts) => {\n\topts = typeof opts === 'object' && opts || defaultOptions;\n\n\t/** Whether the original rule should be preserved. */\n\tconst shouldPreserve = Boolean('preserve' in opts ? opts.preserve : true);\n\n\treturn {\n\t\tpostcssPlugin: 'css-has-pseudo',\n\t\tRule: (rule, { result }) => {\n\t\t\tif (!rule.selector.includes(':has(')) {\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\tlet modifiedSelector;\n\n\t\t\ttry {\n\t\t\t\tconst modifiedSelectorAST = parser((selectors) => {\n\t\t\t\t\tselectors.walkPseudos(selector => {\n\t\t\t\t\t\tif (selector.value === ':has' && selector.nodes) {\n\t\t\t\t\t\t\tconst isNotHas = isParentInNotPseudo(selector);\n\n\t\t\t\t\t\t\tselector.value = isNotHas ? ':not-has' : ':has';\n\n\t\t\t\t\t\t\tconst attribute = parser.attribute({\n\t\t\t\t\t\t\t\tattribute: getEscapedCss(String(selector)),\n\t\t\t\t\t\t\t});\n\n\t\t\t\t\t\t\tif (isNotHas) {\n\t\t\t\t\t\t\t\tselector.parent.parent.replaceWith(attribute);\n\t\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t\tselector.replaceWith(attribute);\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t});\n\t\t\t\t}).processSync(rule.selector);\n\n\t\t\t\tmodifiedSelector = String(modifiedSelectorAST);\n\t\t\t} catch (_) {\n\t\t\t\trule.warn(result, `Failed to parse selector : ${rule.selector}`);\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\tif (typeof modifiedSelector === 'undefined') {\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\tif (modifiedSelector === rule.selector) {\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\tif (shouldPreserve) {\n\t\t\t\trule.cloneBefore({ selector: modifiedSelector });\n\t\t\t} else {\n\t\t\t\trule.assign({ selector: modifiedSelector });\n\t\t\t}\n\t\t},\n\t};\n};\n\ncreator.postcss = true;\n\n/** Default options. */\nconst defaultOptions = { preserve: true };\n\n/** Returns the string as an escaped CSS identifier. */\nconst getEscapedCss = (/** @type {string} */ value) => encodeURIComponent(value).replace(/%3A/g, ':').replace(/%5B/g, '[').replace(/%5D/g, ']').replace(/%2C/g, ',').replace(/[():%[\\],]/g, '\\\\$&');\n\n/** Returns whether the selector is within a `:not` pseudo-class. */\nconst isParentInNotPseudo = (selector) => selector.parent?.parent?.type === 'pseudo' && selector.parent.parent.value === ':not';\n\nexport default creator;\n"],"names":["creator","opts","defaultOptions","shouldPreserve","Boolean","preserve","postcssPlugin","Rule","rule","result","selector","includes","modifiedSelector","modifiedSelectorAST","parser","selectors","walkPseudos","value","nodes","isNotHas","isParentInNotPseudo","attribute","getEscapedCss","String","parent","replaceWith","processSync","_","warn","cloneBefore","assign","postcss","encodeURIComponent","replace","type"],"mappings":"6CAEMA,EAAqDC,IAC1DA,EAAuB,iBAATA,GAAqBA,GAAQC,QAGrCC,EAAiBC,UAAQ,aAAcH,IAAOA,EAAKI,gBAElD,CACNC,cAAe,iBACfC,KAAM,CAACC,GAAQC,OAAAA,UACTD,EAAKE,SAASC,SAAS,oBAIxBC,YAGGC,EAAsBC,GAAQC,IACnCA,EAAUC,aAAYN,OACE,SAAnBA,EAASO,OAAoBP,EAASQ,MAAO,OAC1CC,EAAWC,EAAoBV,GAErCA,EAASO,MAAQE,EAAW,WAAa,aAEnCE,EAAYP,EAAOO,UAAU,CAClCA,UAAWC,EAAcC,OAAOb,MAG7BS,EACHT,EAASc,OAAOA,OAAOC,YAAYJ,GAEnCX,EAASe,YAAYJ,UAItBK,YAAYlB,EAAKE,UAEpBE,EAAmBW,OAAOV,GACzB,MAAOc,eACRnB,EAAKoB,KAAKnB,EAAS,8BAA6BD,EAAKE,iBAItB,IAArBE,GAIPA,IAAqBJ,EAAKE,WAI1BP,EACHK,EAAKqB,YAAY,CAAEnB,SAAUE,IAE7BJ,EAAKsB,OAAO,CAAEpB,SAAUE,QAM5BZ,EAAQ+B,SAAU,EAGlB,MAAM7B,EAAiB,CAAEG,UAAU,GAG7BiB,EAAuCL,GAAUe,mBAAmBf,GAAOgB,QAAQ,OAAQ,KAAKA,QAAQ,OAAQ,KAAKA,QAAQ,OAAQ,KAAKA,QAAQ,OAAQ,KAAKA,QAAQ,cAAe,QAGtLb,EAAuBV,kBAA+C,qBAAlCA,EAASc,oBAAQA,iBAAQU,OAAsD,SAAjCxB,EAASc,OAAOA,OAAOP"}
|