diff --git a/.github/bin/detect-executable-files/to-github-annotations.mjs b/.github/bin/detect-executable-files/to-github-annotations.mjs
index 5add43c96..ed92cea40 100644
--- a/.github/bin/detect-executable-files/to-github-annotations.mjs
+++ b/.github/bin/detect-executable-files/to-github-annotations.mjs
@@ -1,4 +1,4 @@
-import fs from 'fs';
+import fs from 'node:fs';
const data = fs.readFileSync(0, 'utf-8');
let fileNames = data.split(/\r?\n/);
diff --git a/.github/bin/format-package-json.mjs b/.github/bin/format-package-json.mjs
index 1428698df..bf04e59c5 100644
--- a/.github/bin/format-package-json.mjs
+++ b/.github/bin/format-package-json.mjs
@@ -1,5 +1,5 @@
-import fs from 'fs';
-import path from 'path';
+import fs from 'node:fs';
+import path from 'node:path';
function postcssPeerDependencyVersion() {
// "postcss-tape" is our reference for PostCSS versions.
@@ -75,7 +75,7 @@ const formatted = {};
delete packageJSONInfo.private;
formatted.engines = {
- node: '^14 || ^16 || >=18',
+ node: '>=18',
};
delete packageJSONInfo.engines;
diff --git a/.github/bin/generate-docs/api-documenter.mjs b/.github/bin/generate-docs/api-documenter.mjs
index 7199c98dd..de42513f1 100644
--- a/.github/bin/generate-docs/api-documenter.mjs
+++ b/.github/bin/generate-docs/api-documenter.mjs
@@ -1,7 +1,7 @@
-import { spawn } from 'child_process';
-import { platform } from 'process';
-import path from 'path';
-import fs from 'fs';
+import { spawn } from 'node:child_process';
+import { platform } from 'node:process';
+import path from 'node:path';
+import fs from 'node:fs';
import { getFiles } from '../util/get-files.mjs';
const packageJSONInfo = JSON.parse(fs.readFileSync('./package.json', 'utf8'));
diff --git a/.github/bin/generate-docs/install.mjs b/.github/bin/generate-docs/install.mjs
index a262ed2ed..bc3378b42 100644
--- a/.github/bin/generate-docs/install.mjs
+++ b/.github/bin/generate-docs/install.mjs
@@ -1,6 +1,6 @@
-import fs from 'fs';
-import path from 'path';
-import { fileURLToPath } from 'url';
+import fs from 'node:fs';
+import path from 'node:path';
+import { fileURLToPath } from 'node:url';
import { parallelBuildsNotice } from './parallel-builds-notice.mjs';
const template = fs.readFileSync(path.join(path.dirname(fileURLToPath(import.meta.url)), './install-template.md'), 'utf8');
diff --git a/.github/bin/generate-docs/readme.mjs b/.github/bin/generate-docs/readme.mjs
index 30a037e3e..da7649495 100644
--- a/.github/bin/generate-docs/readme.mjs
+++ b/.github/bin/generate-docs/readme.mjs
@@ -1,6 +1,8 @@
-import fs from 'fs';
-import path from 'path';
-import { fileURLToPath } from 'url';
+import fs from 'node:fs';
+import path from 'node:path';
+import { fileURLToPath } from 'node:url';
+import process from 'node:process';
+
import { parallelBuildsNotice } from './parallel-builds-notice.mjs';
const template = fs.readFileSync(path.join('docs', './README.md'), 'utf8');
@@ -43,25 +45,38 @@ readmeDoc = readmeDoc.replace(`
readmeDoc = readmeDoc.replaceAll('', corsTemplate);
// Insert "Header" section
-readmeDoc = readmeDoc.replace('', `# [
][PostCSS]
+function headerText() {
+ const baselineBadge = packageJSONInfo.csstools?.cssdbId ?
+ '
[
][css-url] ' :
+ '';
+
+ const cssdbBadge = packageJSONInfo.csstools?.cssdbId ?
+ '[
][css-url] ' :
+ '';
+
+ if (process.env.MINIMAL) {
+ return `# [
][PostCSS]
+
+\`\`\`bash
+npm install --save-dev
+\`\`\``;
+ }
+
+ return `# [
][PostCSS]
` +
'[
][npm-url] ' +
'[
][cli-url] ' +
'[
][discord]' +
-`${packageJSONInfo.csstools?.cssdbId ?
- '
[
][css-url] ' :
- ''
-}` +
-`${packageJSONInfo.csstools?.cssdbId ?
- '[
][css-url] ' :
- ''
-}` +
+baselineBadge +
+cssdbBadge +
`\n
\`\`\`bash
npm install --save-dev
-\`\`\``,
-);
+\`\`\``;
+}
+
+readmeDoc = readmeDoc.replace('', headerText());
// Insert "Usage" section
readmeDoc = readmeDoc.replace('', `## Usage
@@ -83,8 +98,12 @@ postcss([
]).process(YOUR_CSS /*, processOptions */);
\`\`\``);
-// Insert "Env Support" section
-readmeDoc = readmeDoc.replace('', `[] runs in all Node environments, with special
+function envSupport() {
+ if (process.env.MINIMAL) {
+ return '';
+ }
+
+ return `[] runs in all Node environments, with special
instructions for:
- [Node](INSTALL.md#node)
@@ -93,7 +112,11 @@ instructions for:
- [Webpack](INSTALL.md#webpack)
- [Next.js](INSTALL.md#nextjs)
- [Gulp](INSTALL.md#gulp)
-- [Grunt](INSTALL.md#grunt)`);
+- [Grunt](INSTALL.md#grunt)`;
+}
+
+// Insert "Env Support" section
+readmeDoc = readmeDoc.replace('', envSupport());
// Insert "Link List" section
readmeDoc = readmeDoc.replace('', `[cli-url]: https://github.com/csstools/postcss-plugins/actions/workflows/test.yml?query=workflow/test
diff --git a/.github/bin/license/check-license.mjs b/.github/bin/license/check-license.mjs
index ef2b4906c..3ec0cafdb 100644
--- a/.github/bin/license/check-license.mjs
+++ b/.github/bin/license/check-license.mjs
@@ -1,5 +1,5 @@
-import path from 'path';
-import fs from 'fs';
+import path from 'node:path';
+import fs from 'node:fs';
import { getFiles } from '../util/get-files.mjs';
import { parseLicenseField } from './parse-license-field.mjs';
import { licenseIsOkByException, missingLicenseIsOkByException, osiApprovedWithCCO } from './allowed.mjs';
diff --git a/.github/bin/list-workspaces/list-workspaces.mjs b/.github/bin/list-workspaces/list-workspaces.mjs
index 683ba8ae4..2cf45a17f 100644
--- a/.github/bin/list-workspaces/list-workspaces.mjs
+++ b/.github/bin/list-workspaces/list-workspaces.mjs
@@ -1,11 +1,11 @@
-import path from 'path';
+import path from 'node:path';
import { getFiles } from '../util/get-files.mjs';
-import fs, { promises as fsp } from 'fs';
+import fs from 'node:fs';
import { toposort } from '../util/toposort.mjs';
export async function listWorkspaces() {
try {
- const rootPackageJSON = JSON.parse(await fsp.readFile('package.json'));
+ const rootPackageJSON = JSON.parse(await fs.promises.readFile('package.json'));
const workspaces = rootPackageJSON.workspaces;
const packages = new Set();
@@ -33,7 +33,7 @@ export async function listWorkspaces() {
const result = [];
for (const packageJSONPath of Array.from(packages)) {
- const packageJSON = JSON.parse(await fsp.readFile(packageJSONPath));
+ const packageJSON = JSON.parse(await fs.promises.readFile(packageJSONPath));
const packagePath = path.relative(process.cwd(), path.dirname(packageJSONPath));
result.push({
diff --git a/.github/bin/modified-workspaces/list-modified-files.mjs b/.github/bin/modified-workspaces/list-modified-files.mjs
index 6e857e8c7..413013727 100644
--- a/.github/bin/modified-workspaces/list-modified-files.mjs
+++ b/.github/bin/modified-workspaces/list-modified-files.mjs
@@ -1,4 +1,4 @@
-import https from 'https';
+import https from 'node:https';
export async function listModifiedFilesInPullRequest(repository, pullRequestNumber) {
const allFiles = [];
diff --git a/.github/bin/modified-workspaces/log-modified-workspaces.mjs b/.github/bin/modified-workspaces/log-modified-workspaces.mjs
index 41fb60abf..1828708d7 100644
--- a/.github/bin/modified-workspaces/log-modified-workspaces.mjs
+++ b/.github/bin/modified-workspaces/log-modified-workspaces.mjs
@@ -1,5 +1,5 @@
import { listModifiedWorkspaces } from './modified-workspaces.mjs';
-import { promises as fsp } from 'fs';
+import fs from 'node:fs/promises';
const modifiedWorkspaces = await listModifiedWorkspaces();
@@ -27,7 +27,7 @@ if (process.env.GITHUB_STEP_SUMMARY) {
`;
}
- await fsp.appendFile(
+ await fs.appendFile(
process.env.GITHUB_STEP_SUMMARY,
summary,
);
diff --git a/.github/bin/modified-workspaces/modified-workspaces.mjs b/.github/bin/modified-workspaces/modified-workspaces.mjs
index 44bf07a2f..20e79089d 100644
--- a/.github/bin/modified-workspaces/modified-workspaces.mjs
+++ b/.github/bin/modified-workspaces/modified-workspaces.mjs
@@ -1,6 +1,6 @@
import { listModifiedFilesInPullRequest } from './list-modified-files.mjs';
import { listWorkspaces } from '../list-workspaces/list-workspaces.mjs';
-import path from 'path';
+import path from 'node:path';
const internalDependencies = [
path.relative(process.cwd(), path.resolve('.github')),
diff --git a/.github/bin/new-plugin.mjs b/.github/bin/new-plugin.mjs
index ee5fee3e7..7dcd1489f 100644
--- a/.github/bin/new-plugin.mjs
+++ b/.github/bin/new-plugin.mjs
@@ -1,5 +1,5 @@
-import { promises as fsp } from 'fs';
-import path from 'path';
+import fs from 'node:fs/promises';
+import path from 'node:path';
const pluginName = process.argv.slice(2).join(' ');
@@ -33,16 +33,16 @@ console.log(`- Creating new plugin ${pluginName}`);
// Copy base plugin
{
- await fsp.rm(pluginDir, { recursive: true, force: true });
- await fsp.cp(basePluginDir, pluginDir, { recursive: true });
+ await fs.rm(pluginDir, { recursive: true, force: true });
+ await fs.cp(basePluginDir, pluginDir, { recursive: true });
console.log('- Copied base plugin to', pluginDir);
}
// Remove unnecessary files
{
- await fsp.rm(path.join(pluginDir, 'dist'), { recursive: true, force: true });
- await fsp.rm(path.join(pluginDir, 'node_modules'), { recursive: true, force: true });
+ await fs.rm(path.join(pluginDir, 'dist'), { recursive: true, force: true });
+ await fs.rm(path.join(pluginDir, 'node_modules'), { recursive: true, force: true });
console.log('- Cleaned up files and directories not required in a new plugin');
}
@@ -55,7 +55,7 @@ console.log(`- Creating new plugin ${pluginName}`);
await replaceBasePluginReferencesForFilePath(path.join(pluginDir, 'test', '_tape.mjs'));
await replaceBasePluginReferencesForFilePath(path.join(pluginDir, 'README.md'));
await replaceBasePluginReferencesForFilePath(path.join(pluginDir, 'INSTALL.md'));
- await fsp.writeFile(
+ await fs.writeFile(
path.join(pluginDir, 'CHANGELOG.md'),
`# Changes to PostCSS ${pluginName}
@@ -70,7 +70,7 @@ console.log(`- Creating new plugin ${pluginName}`);
// Update package.json
{
- const packageInfo = JSON.parse(await fsp.readFile(path.join(pluginDir, 'package.json'), 'utf8'));
+ const packageInfo = JSON.parse(await fs.readFile(path.join(pluginDir, 'package.json'), 'utf8'));
packageInfo.name = packageName;
packageInfo.description = `TODO: Add description for ${pluginName}`;
packageInfo.version = '0.0.0';
@@ -83,7 +83,7 @@ console.log(`- Creating new plugin ${pluginName}`);
packageInfo.repository.directory = `plugins/${pluginSlug}`;
- await fsp.writeFile(path.join(pluginDir, 'package.json'), JSON.stringify(packageInfo, null, '\t'));
+ await fs.writeFile(path.join(pluginDir, 'package.json'), JSON.stringify(packageInfo, null, '\t'));
console.log('- Updated "package.json"');
}
@@ -104,10 +104,10 @@ console.log('\nDone! 🎉');
// Helpers
async function replaceBasePluginReferencesForFilePath(filePath) {
- await fsp.writeFile(
+ await fs.writeFile(
filePath,
replaceBasePluginReferences(
- (await fsp.readFile(filePath, 'utf8')).toString(),
+ (await fs.readFile(filePath, 'utf8')).toString(),
),
);
}
diff --git a/.github/bin/release-plan/commit.mjs b/.github/bin/release-plan/commit.mjs
index 625a07560..f7a71ebf8 100644
--- a/.github/bin/release-plan/commit.mjs
+++ b/.github/bin/release-plan/commit.mjs
@@ -1,4 +1,4 @@
-import { spawn } from 'child_process';
+import { spawn } from 'node:child_process';
export async function commitSingleDirectory(commitMessage, dir) {
await new Promise((resolve, reject) => {
diff --git a/.github/bin/release-plan/current-version.mjs b/.github/bin/release-plan/current-version.mjs
index 540f834a9..1f281333c 100644
--- a/.github/bin/release-plan/current-version.mjs
+++ b/.github/bin/release-plan/current-version.mjs
@@ -1,5 +1,5 @@
-import fs from 'fs/promises';
-import path from 'path';
+import fs from 'node:fs/promises';
+import path from 'node:path';
export async function currentVersion(packageDirectory) {
return JSON.parse(await fs.readFile(path.join(packageDirectory, 'package.json'))).version;
diff --git a/.github/bin/release-plan/docs.mjs b/.github/bin/release-plan/docs.mjs
index e98df6d8a..097627f22 100644
--- a/.github/bin/release-plan/docs.mjs
+++ b/.github/bin/release-plan/docs.mjs
@@ -1,7 +1,7 @@
-import { spawn } from 'child_process';
-import { platform } from 'process';
+import { spawn } from 'node:child_process';
+import { platform } from 'node:process';
-export async function updateDocumentation(packageDirectory) {
+export async function updateDocumentation(packageDirectory, minimal = false) {
await new Promise((resolve, reject) => {
const docsCmd = spawn(
'npm',
@@ -11,6 +11,10 @@ export async function updateDocumentation(packageDirectory) {
'--if-present',
],
{
+ env: {
+ ...process.env,
+ MINIMAL: minimal ? 'true': null,
+ },
cwd: packageDirectory,
shell: platform === 'win32',
},
diff --git a/.github/bin/release-plan/minify-changelog-and-package-json.mjs b/.github/bin/release-plan/minify-context-files.mjs
similarity index 80%
rename from .github/bin/release-plan/minify-changelog-and-package-json.mjs
rename to .github/bin/release-plan/minify-context-files.mjs
index 45042cc90..f813535f1 100644
--- a/.github/bin/release-plan/minify-changelog-and-package-json.mjs
+++ b/.github/bin/release-plan/minify-context-files.mjs
@@ -1,7 +1,8 @@
-import fs from 'fs/promises';
-import path from 'path';
+import fs from 'node:fs/promises';
+import path from 'node:path';
+import { updateDocumentation } from './docs.mjs';
-export async function minifyChangelogAndPackageJSON(workspace) {
+export async function minifyContextFiles(workspace) {
const originalPackageInfo = JSON.parse(await fs.readFile(path.join(workspace.path, 'package.json')));
const originalChangelog = (await fs.readFile(path.join(workspace.path, 'CHANGELOG.md'))).toString();
@@ -22,11 +23,11 @@ export async function minifyChangelogAndPackageJSON(workspace) {
// CHANGELOG.md
// - remove some older entries
- // - keep the last 3 entries
+ // - keep the last 2 entries
// - add a link to the full changelog
{
let headingIndex = -1;
- for (let i = 0; i < 4; i++) {
+ for (let i = 0; i < 2; i++) {
headingIndex = minifiedChangelog.indexOf('\n### ', headingIndex + 1);
if (headingIndex === -1) {
@@ -46,8 +47,14 @@ export async function minifyChangelogAndPackageJSON(workspace) {
await fs.writeFile(path.join(workspace.path, 'package.json'), JSON.stringify(minifiedPackageInfo, null, '\t') + '\n');
await fs.writeFile(path.join(workspace.path, 'CHANGELOG.md'), minifiedChangelog);
+ // Render a smaller `README.md` file
+ await updateDocumentation(workspace.path, true);
+
return async () => {
await fs.writeFile(path.join(workspace.path, 'package.json'), JSON.stringify(originalPackageInfo, null, '\t') + '\n');
await fs.writeFile(path.join(workspace.path, 'CHANGELOG.md'), originalChangelog);
+
+ // Render the full `README.md` file
+ await updateDocumentation(workspace.path);
};
}
diff --git a/.github/bin/release-plan/npm-can-publish.mjs b/.github/bin/release-plan/npm-can-publish.mjs
index 6a6845081..5f47f2bc2 100644
--- a/.github/bin/release-plan/npm-can-publish.mjs
+++ b/.github/bin/release-plan/npm-can-publish.mjs
@@ -1,5 +1,5 @@
-import { spawn } from 'child_process';
-import { platform } from 'process';
+import { spawn } from 'node:child_process';
+import { platform } from 'node:process';
export async function canPublish(packageName, myName) {
return new Promise((resolve, reject) => {
diff --git a/.github/bin/release-plan/npm-install.mjs b/.github/bin/release-plan/npm-install.mjs
index 1c3c44545..695f2d888 100644
--- a/.github/bin/release-plan/npm-install.mjs
+++ b/.github/bin/release-plan/npm-install.mjs
@@ -1,5 +1,5 @@
-import { spawn } from 'child_process';
-import { platform } from 'process';
+import { spawn } from 'node:child_process';
+import { platform } from 'node:process';
export async function npmInstall() {
await new Promise((resolve, reject) => {
diff --git a/.github/bin/release-plan/npm-prepublish-scripts.mjs b/.github/bin/release-plan/npm-prepublish-scripts.mjs
index 2e1f65aba..f8aca18d9 100644
--- a/.github/bin/release-plan/npm-prepublish-scripts.mjs
+++ b/.github/bin/release-plan/npm-prepublish-scripts.mjs
@@ -1,5 +1,5 @@
-import { spawn } from 'child_process';
-import { platform } from 'process';
+import { spawn } from 'node:child_process';
+import { platform } from 'node:process';
export async function npmPrepublishScripts(packageDirectory, packageName) {
await new Promise((resolve, reject) => {
diff --git a/.github/bin/release-plan/npm-publish.mjs b/.github/bin/release-plan/npm-publish.mjs
index c56a5102b..568b450be 100644
--- a/.github/bin/release-plan/npm-publish.mjs
+++ b/.github/bin/release-plan/npm-publish.mjs
@@ -1,5 +1,5 @@
-import { spawn } from 'child_process';
-import { platform } from 'process';
+import { spawn } from 'node:child_process';
+import { platform } from 'node:process';
export async function npmPublish(packageDirectory, packageName) {
await new Promise((resolve, reject) => {
diff --git a/.github/bin/release-plan/npm-version.mjs b/.github/bin/release-plan/npm-version.mjs
index 827c7f6c6..6c54a3074 100644
--- a/.github/bin/release-plan/npm-version.mjs
+++ b/.github/bin/release-plan/npm-version.mjs
@@ -1,7 +1,7 @@
-import { spawn } from 'child_process';
-import { platform } from 'process';
-import fs from 'fs/promises';
-import path from 'path';
+import { spawn } from 'node:child_process';
+import { platform } from 'node:process';
+import fs from 'node:fs/promises';
+import path from 'node:path';
export async function npmVersion(increment, packageDirectory) {
{
diff --git a/.github/bin/release-plan/npm-whoami.mjs b/.github/bin/release-plan/npm-whoami.mjs
index a9f171741..8dfb579b3 100644
--- a/.github/bin/release-plan/npm-whoami.mjs
+++ b/.github/bin/release-plan/npm-whoami.mjs
@@ -1,5 +1,5 @@
-import { spawn } from 'child_process';
-import { platform } from 'process';
+import { spawn } from 'node:child_process';
+import { platform } from 'node:process';
export async function whoami() {
return await new Promise((resolve, reject) => {
diff --git a/.github/bin/release-plan/prepare-current-release-plan.mjs b/.github/bin/release-plan/prepare-current-release-plan.mjs
index 48d7996e1..419cdf0b2 100644
--- a/.github/bin/release-plan/prepare-current-release-plan.mjs
+++ b/.github/bin/release-plan/prepare-current-release-plan.mjs
@@ -1,6 +1,6 @@
import { listWorkspaces } from '../list-workspaces/list-workspaces.mjs';
-import fs from 'fs/promises';
-import path from 'path';
+import fs from 'node:fs/promises';
+import path from 'node:path';
import { currentVersion } from './current-version.mjs';
import { canPublish } from './npm-can-publish.mjs';
import { whoami } from './npm-whoami.mjs';
diff --git a/.github/bin/release-plan/prepare-next-release-plan.mjs b/.github/bin/release-plan/prepare-next-release-plan.mjs
index abc00df3b..f633674be 100644
--- a/.github/bin/release-plan/prepare-next-release-plan.mjs
+++ b/.github/bin/release-plan/prepare-next-release-plan.mjs
@@ -1,5 +1,5 @@
-import fs from 'fs/promises';
-import path from 'path';
+import fs from 'node:fs/promises';
+import path from 'node:path';
import { addUpdatedPackagesToChangelog } from './add-to-changelog.mjs';
export async function prepareNextReleasePlan(needsRelease, notReleasableNow) {
diff --git a/.github/bin/release-plan/release-plan.mjs b/.github/bin/release-plan/release-plan.mjs
index a78605256..c4ea61b8a 100644
--- a/.github/bin/release-plan/release-plan.mjs
+++ b/.github/bin/release-plan/release-plan.mjs
@@ -1,5 +1,5 @@
-import fs from 'fs/promises';
-import path from 'path';
+import fs from 'node:fs/promises';
+import path from 'node:path';
import { commitAfterDependencyUpdates, commitSingleDirectory } from './commit.mjs';
import { discordAnnounce, discordAnnounceDryRun } from './discord-announce.mjs';
import { nowFormatted } from './date-format.mjs';
@@ -11,7 +11,7 @@ import { prepareCurrentReleasePlan } from './prepare-current-release-plan.mjs';
import { prepareNextReleasePlan } from './prepare-next-release-plan.mjs';
import { runAndPrintDebugOnFail } from './run-and-print-debug-on-fail.mjs';
import { npmPrepublishScripts } from './npm-prepublish-scripts.mjs';
-import { minifyChangelogAndPackageJSON } from './minify-changelog-and-package-json.mjs';
+import { minifyContextFiles } from './minify-context-files.mjs';
const {
needsRelease,
@@ -62,7 +62,7 @@ for (const workspace of needsRelease.values()) {
'Please fix the error and try again.',
);
- const restoreChangelogAndPackageJSON = await minifyChangelogAndPackageJSON(workspace);
+ const restoreContextFiles = await minifyContextFiles(workspace);
// Publish to npm
await runAndPrintDebugOnFail(
@@ -73,7 +73,7 @@ for (const workspace of needsRelease.values()) {
'Please fix the error and try again.',
);
- await restoreChangelogAndPackageJSON();
+ await restoreContextFiles();
// Announce on discord
await runAndPrintDebugOnFail(
diff --git a/.github/bin/util/get-files.mjs b/.github/bin/util/get-files.mjs
index 119410a34..94e35b9a7 100644
--- a/.github/bin/util/get-files.mjs
+++ b/.github/bin/util/get-files.mjs
@@ -1,5 +1,5 @@
-import path from 'path';
-import { promises as fsp } from 'fs';
+import path from 'node:path';
+import fs from 'node:fs/promises';
// Recursively find all files in the given directory
// - skip directories
@@ -7,7 +7,7 @@ import { promises as fsp } from 'fs';
// - do not follow links outside of the start dir
export async function getFiles(dir, recursive = true) {
dir = path.resolve(dir);
- const dirents = await fsp.readdir(dir, { withFileTypes: true });
+ const dirents = await fs.readdir(dir, { withFileTypes: true });
const files = await Promise.all(dirents.map((dirent) => {
const res = path.resolve(dir, dirent.name);
if (!res.startsWith(dir)) {
diff --git a/.github/workflows/lint.yml b/.github/workflows/lint.yml
index 6f8dbd9d7..a25b1ef95 100644
--- a/.github/workflows/lint.yml
+++ b/.github/workflows/lint.yml
@@ -28,5 +28,12 @@ jobs:
- name: lint
run: npm run lint
+ - name: docs
+ run: npm run docs
+
- name: knip
run: npm run knip
+
+ - name: repo is clean after "build", "lint" and "docs" steps
+ run: |
+ git diff --name-only --exit-code
diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml
index 9b59f1281..0ce001927 100644
--- a/.github/workflows/test.yml
+++ b/.github/workflows/test.yml
@@ -15,12 +15,12 @@ jobs:
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
- # Test node 14/16/18/20/22 on ubuntu
- # Test node 20 on macos/windows
- # Enable annotations only for node 20 + ubuntu
+ # Test node 18/20/22 on ubuntu
+ # Test node 22 on macos/windows
+ # Enable annotations only for node 22 + ubuntu
matrix:
os: [ubuntu-latest]
- node: [16, 18, 20, 22]
+ node: [18, 20, 22]
include:
- os: macos-latest
node: 22
@@ -41,10 +41,7 @@ jobs:
- name: npm ci
run: |
npm ci
- env:
- BROWSER_TESTS: true
if: ${{ (matrix.is_base_node_version && matrix.is_base_os_version) }}
-
- name: npm ci
run: |
NPM_CONFIG_ENGINE_STRICT=false npm ci --ignore-scripts
@@ -64,10 +61,8 @@ jobs:
run: |
npm run build --if-present $MODIFIED_WORKSPACES
if: matrix.is_base_node_version && matrix.is_base_os_version
-
- - name: docs
- run: npm run docs
- if: matrix.is_base_node_version && matrix.is_base_os_version
+ env:
+ NODE_COMPILE_CACHE: '.cache/v8'
- name: repo is clean after "build", "lint" and "docs" steps
run: |
@@ -77,6 +72,7 @@ jobs:
- name: test
run: npm run test --if-present $MODIFIED_WORKSPACES
env:
+ BROWSER_TESTS: ${{ (matrix.is_base_node_version && matrix.is_base_os_version) }}
ENABLE_ANNOTATIONS_FOR_NODE: ${{ matrix.is_base_node_version }}
ENABLE_ANNOTATIONS_FOR_OS: ${{ matrix.is_base_os_version }}
@@ -84,7 +80,7 @@ jobs:
# running "npm install" places the cli in node_modules/bin
- name: test:cli
run: |
- NPM_CONFIG_ENGINE_STRICT=false npm install --ignore-scripts
+ NPM_CONFIG_ENGINE_STRICT=false npm ci --ignore-scripts
npm run test:cli --if-present $MODIFIED_WORKSPACES
# E2E Tests
diff --git a/cli/csstools-cli/CHANGELOG.md b/cli/csstools-cli/CHANGELOG.md
index f33ef1e2c..1e22ea5d3 100644
--- a/cli/csstools-cli/CHANGELOG.md
+++ b/cli/csstools-cli/CHANGELOG.md
@@ -1,5 +1,9 @@
# Changes to CSSTools CLI
+### Unreleased (major)
+
+- Updated: Support for Node v18+ (major).
+
### 3.1.0
_July 7, 2024_
diff --git a/cli/csstools-cli/dist/cli.cjs b/cli/csstools-cli/dist/cli.cjs
index 02bdc51e6..669b77cbc 100755
--- a/cli/csstools-cli/dist/cli.cjs
+++ b/cli/csstools-cli/dist/cli.cjs
@@ -1,3 +1,3 @@
#!/usr/bin/env node
-"use strict";var s,e=require("css-blank-pseudo"),o=require("postcss"),t=require("path"),i=require("fs"),c=require("css-has-pseudo"),r=require("css-prefers-color-scheme"),n=require("postcss-attribute-case-insensitive"),a=require("@csstools/postcss-cascade-layers"),l=require("@csstools/postcss-color-function"),p=require("postcss-color-functional-notation"),u=require("postcss-color-hex-alpha"),d=require("@csstools/postcss-color-mix-function"),g=require("postcss-color-rebeccapurple"),f=require("@csstools/postcss-content-alt-text"),S=require("postcss-custom-media"),v=require("postcss-custom-properties"),h=require("postcss-custom-selectors"),m=require("postcss-dir-pseudo-class"),w=require("postcss-double-position-gradients"),C=require("@csstools/postcss-exponential-functions"),y=require("postcss-focus-visible"),P=require("postcss-focus-within"),b=require("@csstools/postcss-font-format-keywords"),x=require("postcss-gap-properties"),L=require("@csstools/postcss-gradients-interpolation-method"),T=require("@csstools/postcss-hwb-function"),F=require("@csstools/postcss-ic-unit"),q=require("postcss-image-set-function"),k=require("@csstools/postcss-is-pseudo-class"),M=require("postcss-lab-function"),I=require("@csstools/postcss-light-dark-function"),D=require("postcss-logical"),A=require("@csstools/postcss-logical-float-and-clear"),N=require("@csstools/postcss-logical-resize"),O=require("@csstools/postcss-logical-viewport-units"),V=require("@csstools/postcss-media-minmax"),E=require("@csstools/postcss-media-queries-aspect-ratio-number-values"),z=require("@csstools/postcss-nested-calc"),R=require("postcss-nesting"),$=require("@csstools/postcss-normalize-display-values"),U=require("@csstools/postcss-oklab-function"),W=require("postcss-overflow-shorthand"),G=require("postcss-place"),j=require("postcss-preset-env"),H=require("postcss-pseudo-class-any-link"),B=require("@csstools/postcss-relative-color-syntax"),K=require("@csstools/postcss-scope-pseudo-class"),Q=require("postcss-selector-not"),J=require("@csstools/postcss-stepped-value-functions"),Y=require("@csstools/postcss-text-decoration-shorthand"),_=require("@csstools/postcss-trigonometric-functions"),X=require("@csstools/postcss-unset-value");function parseArguments(e,o,t){const i=e.map((s=>s.trim())).filter((s=>!!s)),c={stdin:!1,stdout:!1,output:void 0,outputDir:void 0,inputs:[],inlineMap:!0,externalMap:!1,replace:!1,pluginOptions:{},debug:!1};let r,n=!1;for(let e=0;e1&&c.output)return console.warn('[error] omit "--output" when processing multiple inputs\n'),t(),s.InvalidArguments;0===c.inputs.length&&(c.stdin=!0),c.output||c.outputDir||c.replace||(c.stdout=!0),c.stdout&&(c.externalMap=!1);let a={};if(r)try{a=JSON.parse(r)}catch{return console.warn("[error] plugin options must be valid JSON\n"),t(),s.InvalidArguments}for(const e in a){const i=a[e];if(!o.includes(e))return console.warn(`[error] unknown plugin option: ${e}\n`),t(),s.InvalidArguments;c.pluginOptions[e]=i}return c}async function getStdin(){return new Promise((s=>{let e="",o=!1;if(setTimeout((()=>{o=!0,s("")}),1e4),process.stdin.isTTY){if(o)return;s(e)}else process.stdin.setEncoding("utf8"),process.stdin.on("readable",(()=>{let s="";for(;s=process.stdin.read();)e+=s??""})),process.stdin.on("end",(()=>{o||s(e)}))}))}async function stdinToStdout(s,e,t){let i="";try{const c=await getStdin();c||(t(),process.exit(1));const r=await o([s]).process(c,{from:"stdin",to:"stdout",map:!!e.inlineMap&&{inline:!0}});r.warnings().forEach((s=>{console.warn(s.toString())})),i=r.css}catch(s){s instanceof Error?console.error(e.debug?s:s.message):console.error(s),process.exit(1)}process.stdout.write(i+(e.inlineMap?"\n":"")),process.exit(0)}async function stdinToFs(s,e,c){let r=e.output;!r&&e.outputDir&&(r=t.join(e.outputDir,"output.css")),r||process.exit(0);try{const t=await getStdin();t||(c(),process.exit(1));const n=await o([s]).process(t,{from:"stdin",to:r,map:!(!e.inlineMap&&!e.externalMap)&&{inline:e.inlineMap}});n.warnings().forEach((s=>{console.warn(s.toString())})),e.externalMap&&n.map?await Promise.all([await i.promises.writeFile(r,n.css+(e.inlineMap?"\n":"")),await i.promises.writeFile(`${r}.map`,n.map.toString())]):await i.promises.writeFile(r,n.css+(e.inlineMap?"\n":""))}catch(s){s instanceof Error?console.error(e.debug?s:s.message):console.error(s),process.exit(1)}console.log(`CSS was written to "${t.normalize(r)}"`),process.exit(0)}async function fsToStdout(s,e){let t=[];try{t=await Promise.all(e.inputs.map((async e=>{const t=await i.promises.readFile(e),c=await o([s]).process(t,{from:e,to:"stdout",map:!1});return c.warnings().forEach((s=>{console.warn(s.toString())})),c.css})))}catch(s){s instanceof Error?console.error(e.debug?s:s.message):console.error(s),process.exit(1)}for(const s of t)process.stdout.write(s);process.exit(0)}async function fsToFs(s,e){try{await Promise.all(e.inputs.map((async c=>{let r=e.output;e.outputDir&&(r=t.join(e.outputDir,t.basename(c))),e.replace&&(r=c),r||process.exit(0);const n=await i.promises.readFile(c),a=await o([s]).process(n,{from:c,to:r,map:!(!e.inlineMap&&!e.externalMap)&&{inline:e.inlineMap}});a.warnings().forEach((s=>{console.warn(s.toString())})),e.externalMap&&a.map?await Promise.all([await i.promises.writeFile(r,a.css+(e.inlineMap?"\n":"")),await i.promises.writeFile(`${r}.map`,a.map.toString())]):await i.promises.writeFile(r,a.css+(e.inlineMap?"\n":"")),console.log(`CSS was written to "${t.normalize(r)}"`)})))}catch(s){s instanceof Error?console.error(e.debug?s:s.message):console.error(s),process.exit(1)}process.exit(0)}function helpTextLogger(s,e,o,t=null){let i=[];if(t){const s=Math.max(...Object.keys(t).map((s=>s.length))),e=new Array(s).fill(" ").join("");e.length&&(i=["\nPlugin Options:",...Object.keys(t).map((s=>` ${(s+e).slice(0,e.length)} ${typeof t[s]}`))],i.push(`\n ${JSON.stringify(t,null,2).split("\n").join("\n ")}`))}const c=[`${e}\n`,` ${o}\n`,"Usage:",` ${s} [input.css] [OPTIONS] [-o|--output output.css]`,` ${s} ... [OPTIONS] --dir `,` ${s} ... [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 i.length>0&&c.push(...i),()=>{console.warn(c.join("\n"))}}async function cli(e,o,t,i=!0){const c=parseArguments(process.argv.slice(i?2:3),o,t);c===s.InvalidArguments&&process.exit(1);const r=e(c.pluginOptions);c.stdin&&c.stdout?await stdinToStdout(r,c,t):c.stdin?await stdinToFs(r,c,t):c.stdout?await fsToStdout(r,c):await fsToFs(r,c)}async function cssBlankPseudo(){await cli(e,["preserve","replaceWith"],helpTextLogger("@csstools/cli css-blank-pseudo","PostCSS Blank Pseudo","Lets you style form elements when they are empty, following the Selectors Level 4 specification.",{preserve:!0,replaceWith:".css-blank"}),!1)}async function cssHasPseudo(){await cli(c,["preserve"],helpTextLogger("@csstools/cli css-has-pseudo","PostCSS Has Pseudo","Transforms CSS with :has {}",{preserve:!0}),!1)}async function cssPrefersColorScheme(){await cli(r,["preserve","mediaQuery"],helpTextLogger("@csstools/cli css-prefers-color-scheme","Prefers Color Scheme","Lets you use light and dark color schemes in all browsers, following the Media Queries specification.",{preserve:!0,mediaQuery:"color|color-index"}),!1)}async function postcssAttributeCaseInsensitive(){await cli(n,[],helpTextLogger("@csstools/cli postcss-attribute-case-insensitive","PostCSS Attribute Case Insensitive","Enables support for Case Insensitive Attribute matching in selectors"),!1)}async function postcssCascadeLayers(){await cli(a,[],helpTextLogger("@csstools/cli postcss-cascade-layers","PostCSS Cascade Layers","Lets you use `@layer` following the Cascade Layers Specification."),!1)}async function postcssColorFunction(){await cli(l,["preserve","enableProgressiveCustomProperties"],helpTextLogger("@csstools/cli postcss-color-function","PostCSS Color Function","Lets you use the color() function in CSS.",{preserve:!0,enableProgressiveCustomProperties:!1}),!1)}async function postcssColorFunctionalNotation(){await cli(p,["preserve"],helpTextLogger("@csstools/cli postcss-color-functional-notation","PostCSS Color Functional Notation","Lets you use space and slash separated color notation in CSS, following the CSS Color specification.",{preserve:!0}),!1)}async function postcssColorHexAlpha(){await cli(u,["preserve"],helpTextLogger("@csstools/cli postcss-color-hex-alpha","PostCSS Color Hex Alpha","Lets you use 4 & 8 character hex color notation in CSS, following the CSS Color Module specification.",{preserve:!0}),!1)}async function postcssColorMixFunction(){await cli(d,["preserve","enableProgressiveCustomProperties"],helpTextLogger("@csstools/cli postcss-color-mix-function","PostCSS Color Mix Function","Lets you use the color-mix() function in CSS.",{preserve:!0,enableProgressiveCustomProperties:!1,subFeatures:{displayP3:!1}}),!1)}async function postcssColorRebeccaPurple(){await cli(g,["preserve"],helpTextLogger("@csstools/cli postcss-color-rebeccapurple","PostCSS RebeccaPurple","Lets you use the rebeccapurple color keyword in CSS.",{preserve:!0}),!1)}async function postcssContentAltText(){await cli(f,["preserve","stripAltText","enableProgressiveCustomProperties"],helpTextLogger("@csstools/cli postcss-content-alt-text","PostCSS Content Alt Text","Generate fallback values for content with alt text.",{preserve:!0,stripAltText:!1,enableProgressiveCustomProperties:!0}),!1)}async function postcssCustomMedia(){await cli(S,["preserve"],helpTextLogger("@csstools/cli postcss-custom-media","PostCSS Custom Media","Lets you define @custom-media in CSS following the Custom Media Specification",{preserve:!0}),!1)}async function postcssCustomProperties(){await cli(v,["preserve"],helpTextLogger("@csstools/cli postcss-custom-properties","PostCSS Custom Properties","Lets you use Custom Properties in CSS, following the CSS Custom Properties specification.",{preserve:!0}),!1)}async function postcssCustomSelectors(){await cli(h,["preserve"],helpTextLogger("@csstools/cli postcss-custom-selectors","PostCSS Custom Selectors","Lets you define @custom-selector in CSS following the Custom Selectors Specification",{preserve:!0}),!1)}async function postcssDirPseudoClass(){await cli(m,["dir","preserve","shadow"],helpTextLogger("@csstools/cli postcss-dir-pseudo-class","PostCSS Dir Pseudo Class","Lets you style by directionality using the `:dir()` pseudo-class in CSS",{dir:"ltr",preserve:!0,shadow:!0}),!1)}async function postcssDoublePositionGradients(){await cli(w,["preserve","enableProgressiveCustomProperties"],helpTextLogger("@csstools/cli postcss-double-position-gradients","PostCSS Double Position Gradients","Lets you use double-position gradients in CSS, following the CSS Image Values and Replaced Content specification",{preserve:!0,enableProgressiveCustomProperties:!1}),!1)}async function postcssExponentialFunctions(){await cli(C,["preserve"],helpTextLogger("@csstools/cli postcss-exponential-functions","PostCSS Exponential Functions","Lets you use the `pow()`, `sqrt()`, `hypot()`, `log()`, `exp()` functions following the CSS Values 4 Specification.",{preserve:!0}),!1)}async function postcssFocusVisible(){await cli(y,["preserve","replaceWith"],helpTextLogger("@csstools/cli postcss-focus-visible","PostCSS Focus Visible","Lets you use the `:focus-visible` pseudo-class in CSS, following the Selectors Level 4 specification.",{preserve:!0,replaceWith:".focus-visible"}),!1)}async function postcssFocusWithin(){await cli(P,["preserve","replaceWith"],helpTextLogger("@csstools/cli postcss-focus-within","PostCSS Focus Within","Lets you use the `:focus-within` pseudo-class in CSS, following the Selectors Level 4 specification.",{preserve:!0,replaceWith:".focus-within"}),!1)}async function postcssFontFormatKeywords(){await cli(b,["preserve"],helpTextLogger("@csstools/cli postcss-font-format-keywords","PostCSS Font Format Keyword","Lets you use unquoted format on @font-face CSS definitions.",{preserve:!0}),!1)}async function postcssGapProperties(){await cli(x,["preserve"],helpTextLogger("@csstools/cli postcss-gap-properties","PostCSS Gap Properties","Lets you use the gap, column-gap, and row-gap shorthand properties in CSS, following the CSS Grid Layout specification.",{preserve:!0}),!1)}async function postcssGradientsInterpolationMethod(){await cli(L,["preserve","enableProgressiveCustomProperties"],helpTextLogger("@csstools/cli postcss-gradients-interpolation-method","PostCSS Gradients Interpolation Method","Lets you use different interpolation methods in CSS gradient functions.",{preserve:!0,enableProgressiveCustomProperties:!1}),!1)}async function postcssHWBFunction(){await cli(T,["preserve"],helpTextLogger("@csstools/cli postcss-hwb-function","PostCSS HWB function","Convert hwb() to rgb()",{preserve:!0}),!1)}async function postcssICUnit(){await cli(F,["preserve","enableProgressiveCustomProperties"],helpTextLogger("@csstools/cli postcss-ic-unit","PostCSS IC Unit","Lets you use the ic length unit.",{preserve:!0,enableProgressiveCustomProperties:!1}),!1)}async function postcssImageSetFunction(){await cli(q,["oninvalid","preserve"],helpTextLogger("@csstools/cli postcss-image-set-function","PostCSS Image Set Function","Lets you display resolution-dependent images using the image-set() function in CSS, following the CSS Images specification.",{preserve:!0,oninvalid:"ignore|warn|throw"}),!1)}async function postcssIsPseudoClass(){await cli(k,["onComplexSelector","preserve","specificityMatchingName"],helpTextLogger("@csstools/cli postcss-is-pseudo-class","PostCSS Is Pseudo Class","Lets you use the :is pseudo class function, following the CSS Selector specification.",{onComplexSelector:"warning",preserve:!0,specificityMatchingName:"does-not-exist"}),!1)}async function postcssLabFunction(){await cli(M,["preserve","enableProgressiveCustomProperties","subFeatures"],helpTextLogger("@csstools/cli postcss-lab-function","PostCSS Lab function","Convert lab() to rgb()",{preserve:!0,enableProgressiveCustomProperties:!1,subFeatures:{displayP3:!1}}),!1)}async function postcssLightDarkFunction(){await cli(I,["preserve"],helpTextLogger("@csstools/cli postcss-light-dark-function","PostCSS Light Dark function","Use the light-dark() color function in CSS",{preserve:!0}),!1)}async function postcssLogical$1(){await cli(D,["inlineDirection","blockDirection"],helpTextLogger("@csstools/cli postcss-logical","PostCSS Logical","Lets you use logical, rather than physical, direction and dimension mappings in CSS, following the CSS Logical Properties and Values specification.",{inlineDirection:"left-to-right",blockDirection:"top-to-bottom"}),!1)}async function postcssLogical(){await cli(A,["inlineDirection","blockDirection"],helpTextLogger("@csstools/cli postcss-logical-float-and-clear","PostCSS Logical Float And Clear","Lets you use flow-relative (inline-start and inline-end) values for float and clear, following the CSS Logical Properties and Values specification.",{inlineDirection:"left-to-right"}),!1)}async function postcssLogicalResize(){await cli(N,["inlineDirection"],helpTextLogger("@csstools/cli postcss-logical-resize","PostCSS Logical Resize","Lets you use logical values in the resize property, following the CSS Logical Properties and Values specification.",{inlineDirection:"left-to-right"}),!1)}async function postcssLogicalViewportUnits(){await cli(O,["inlineDirection","preserve"],helpTextLogger("@csstools/cli postcss-viewport-units","PostCSS Logical Viewport Units","Lets you use vb and vi length units in CSS, following the CSS Values and Units Module Level 4 specification.",{inlineDirection:"left-to-right",preserve:!0}),!1)}async function postcssMediaMinMax(){await cli(V,[],helpTextLogger("@csstools/cli postcss-media-minmax","PostCSS Media MinMax","Lets you use the range notation in CSS media queries.",{}),!1)}async function postcssMediaQueriesAspectRatioNumberValues(){await cli(E,[],helpTextLogger("@csstools/cli postcss-media-queries-aspect-ratio-number-values","PostCSS Media Queries Aspect-Ratio Number Values","Lets you use number values in aspect-ratio media queries.",{}),!1)}async function postcssNestedCalc(){await cli(z,["preserve"],helpTextLogger("@csstools/cli postcss-nested-calc","PostCSS Nested Calc","Lets you use nested calc() expressions in CSS.",{preserve:!0}),!1)}async function postcssNesting(){await cli(R,["noIsPseudoSelector"],helpTextLogger("@csstools/cli postcss-nesting","PostCSS Nesting","Lets you nest style rules inside each other, following the CSS Nesting specification.",{noIsPseudoSelector:!0}),!1)}async function postcssNormalizeDisplayValues(){await cli($,["preserve"],helpTextLogger("@csstools/cli postcss-normalize-display-values","PostCSS Normalize Display Values","Lets you use two values display syntax for inner and outer display types.",{preserve:!0}),!1)}async function postcssOKLabFunction(){await cli(U,["preserve","enableProgressiveCustomProperties","subFeatures"],helpTextLogger("@csstools/cli postcss-oklab-function","PostCSS OKLab Function","Lets you use oklab() and oklch() color functions in CSS.",{preserve:!0,enableProgressiveCustomProperties:!1,subFeatures:{displayP3:!1}}),!1)}async function postcssOverflowShorthand(){await cli(W,["preserve"],helpTextLogger("@csstools/cli postcss-overflow-shorthand","PostCSS Overflow Shorthand","Lets you use the `overflow` shorthand in CSS, following the CSS Overflow specification.",{preserve:!0}),!1)}async function postcssPlace(){await cli(G,["preserve"],helpTextLogger("@csstools/cli postcss-place","PostCSS Place","Lets you use place-* properties as shorthands for align-* and justify-*, following the CSS Box Alignment specification.",{preserve:!0}),!1)}async function postcssPresetEnv(){await cli(j,["stage","minimumVendorImplementations","features","env","browsers","autoprefixer","preserve","logical","enableClientSidePolyfills","debug"],helpTextLogger("@csstools/cli postcss-preset-env","PostCSS Preset Env","Lets you convert modern CSS into something most browsers can understand, determining the polyfills you need based on your targeted browsers or runtime environments.",{stage:0,minimumVendorImplementations:2,features:{"blank-pseudo-class":{preserve:!1},"color-functional-notation":{preserve:!0}},env:"production",browsers:"last 2 versions",autoprefixer:{grid:!0},preserve:!1,logical:{inlineDirection:"left-to-right",blockDirection:"top-to-bottom"},enableClientSidePolyfills:!1,debug:!1}),!1)}async function postcssPseudoClassAnyLink(){await cli(H,["preserve"],helpTextLogger("@csstools/cli postcss-pseudo-class-any-link","PostCSS Pseudo Class Any Link","Lets you :any-link pseudo-class in CSS, following the Selectors specification.",{preserve:!0}),!1)}async function postcssRelativeColorSyntax(){await cli(B,["preserve","enableProgressiveCustomProperties","subFeatures"],helpTextLogger("@csstools/cli postcss-relative-color-syntax","PostCSS Relative Color Syntax","Lets you use the relative color syntax in CSS color functions.",{preserve:!0,enableProgressiveCustomProperties:!1,subFeatures:{displayP3:!1}}),!1)}async function postcssScopePseudoClass(){await cli(K,["preserve"],helpTextLogger("@csstools/cli postcss-scope-pseudo-class","PostCSS Scope Pseudo Class","Lets you use the Reference Element Pseudo-class: :scope.",{preserve:!0}),!1)}async function postcssSelectorNot(){await cli(Q,[],helpTextLogger("@csstools/cli postcss-selector-not","PostCSS Selector Not","Transforms :not() W3C CSS level 4 pseudo classes to :not() CSS level 3 selectors following the Selectors 4 Specification"),!1)}async function postcssSteppedValueFunctions(){await cli(J,["preserve","onInvalid"],helpTextLogger("@csstools/cli postcss-stepped-value-functions","PostCSS Stepped Value Functions","Lets you use round(), mod() and rem() functions.",{preserve:!1,onInvalid:"warn"}),!1)}async function postcssTextDecorationShorthand(){await cli(Y,["preserve"],helpTextLogger("@csstools/cli postcss-text-decoration-shorthand","PostCSS Text Decoration Shorthand","Lets you use text-decoration in it's shorthand form in CSS.",{preserve:!0}),!1)}async function postcssTrigonometricFunctions(){await cli(_,["preserve"],helpTextLogger("@csstools/cli postcss-trigonometric-functions","PostCSS Trigonometric Functions","Lets you use `sin`, `cos`, `tan`, `asin`, `acos`, `atan` and `atan2` to be able to compute trigonometric relationships following the CSS Values 4 specification.",{preserve:!0}),!1)}async function postcssUnsetValue(){await cli(X,["preserve"],helpTextLogger("@csstools/cli postcss-unset-value","PostCSS Stepped Unset Value","Use the unset keyword in CSS.",{preserve:!1}),!1)}(s||(s={})).InvalidArguments="INVALID_ARGUMENTS",async function main(){switch(process.argv[2]??!1){case"css-blank-pseudo":return void await cssBlankPseudo();case"css-has-pseudo":return void await cssHasPseudo();case"css-prefers-color-scheme":return void await cssPrefersColorScheme();case"postcss-attribute-case-insensitive":return void await postcssAttributeCaseInsensitive();case"postcss-cascade-layers":return void await postcssCascadeLayers();case"postcss-color-function":return void await postcssColorFunction();case"postcss-color-mix-function":return void await postcssColorMixFunction();case"postcss-color-functional-notation":return void await postcssColorFunctionalNotation();case"postcss-color-hex-alpha":return void await postcssColorHexAlpha();case"postcss-color-rebeccapurple":return void await postcssColorRebeccaPurple();case"postcss-content-alt-text":return void await postcssContentAltText();case"postcss-custom-media":return void await postcssCustomMedia();case"postcss-custom-properties":return void await postcssCustomProperties();case"postcss-custom-selectors":return void await postcssCustomSelectors();case"postcss-dir-pseudo-class":return void await postcssDirPseudoClass();case"postcss-double-position-gradients":return void await postcssDoublePositionGradients();case"postcss-exponential-functions":return void await postcssExponentialFunctions();case"postcss-focus-visible":return void await postcssFocusVisible();case"postcss-focus-within":return void await postcssFocusWithin();case"postcss-font-format-keywords":return void await postcssFontFormatKeywords();case"postcss-gap-properties":return void await postcssGapProperties();case"postcss-gradients-interpolation-method":return void await postcssGradientsInterpolationMethod();case"postcss-hwb-function":return void await postcssHWBFunction();case"postcss-ic-unit":return void await postcssICUnit();case"postcss-image-set-function":return void await postcssImageSetFunction();case"postcss-is-pseudo-class":return void await postcssIsPseudoClass();case"postcss-lab-function":return void await postcssLabFunction();case"postcss-light-dark-function":return void await postcssLightDarkFunction();case"postcss-logical":return void await postcssLogical$1();case"postcss-logical-float-and-clear":return void await postcssLogical();case"postcss-logical-resize":return void await postcssLogicalResize();case"postcss-logical-viewport-units":return void await postcssLogicalViewportUnits();case"postcss-media-minmax":return void await postcssMediaMinMax();case"postcss-media-queries-aspect-ratio-number-values":return void await postcssMediaQueriesAspectRatioNumberValues();case"postcss-nested-calc":return void await postcssNestedCalc();case"postcss-nesting":return void await postcssNesting();case"postcss-normalize-display-values":return void await postcssNormalizeDisplayValues();case"postcss-oklab-function":return void await postcssOKLabFunction();case"postcss-overflow-shorthand":return void await postcssOverflowShorthand();case"postcss-place":return void await postcssPlace();case"postcss-preset-env":return void await postcssPresetEnv();case"postcss-pseudo-class-any-link":return void await postcssPseudoClassAnyLink();case"postcss-scope-pseudo-class":return void await postcssScopePseudoClass();case"postcss-relative-color-syntax":return void await postcssRelativeColorSyntax();case"postcss-selector-not":return void await postcssSelectorNot();case"postcss-stepped-value-functions":return void await postcssSteppedValueFunctions();case"postcss-text-decoration-shorthand":return void await postcssTextDecorationShorthand();case"postcss-trigonometric-functions":return void await postcssTrigonometricFunctions();case"postcss-unset-value":return void await postcssUnsetValue();default:{const s=["CSSTools CLI\n"," Transform CSS with any plugin from https://github.com/csstools/postcss-plugins\n","Usage:"," @csstools/csstools-cli postcss-preset-env [input.css] [OPTIONS] [-o|--output output.css]"," @csstools/csstools-cli postcss-preset-env ... [OPTIONS] --dir "," @csstools/csstools-cli postcss-preset-env ... [OPTIONS] --replace","\nAvailable Plugins:"," postcss-preset-env"," css-blank-pseudo"," css-has-pseudo"," css-prefers-color-scheme"," postcss-attribute-case-insensitive"," postcss-cascade-layers"," postcss-color-function"," postcss-color-functional-notation"," postcss-color-hex-alpha"," postcss-color-mix-function"," postcss-color-rebeccapurple"," postcss-content-alt-text"," postcss-custom-media"," postcss-custom-properties"," postcss-custom-selectors"," postcss-dir-pseudo-class"," postcss-double-position-gradients"," postcss-exponential-functions"," postcss-focus-visible"," postcss-focus-within"," postcss-font-format-keywords"," postcss-gap-properties"," postcss-gradients-interpolation-method"," postcss-hwb-function"," postcss-ic-unit"," postcss-image-set-function"," postcss-is-pseudo-class"," postcss-lab-function"," postcss-light-dark-function"," postcss-logical"," postcss-logical-float-and-clear"," postcss-logical-resize"," postcss-logical-viewport-units"," postcss-media-minmax"," postcss-media-queries-aspect-ratio-number-values"," postcss-nested-calc"," postcss-nesting"," postcss-normalize-display-values"," postcss-oklab-function"," postcss-overflow-shorthand"," postcss-place"," postcss-pseudo-class-any-link"," postcss-relative-color-syntax"," postcss-scope-pseudo-class"," postcss-selector-not"," postcss-stepped-value-functions"," postcss-text-decoration-shorthand"," postcss-trigonometric-functions"," postcss-unset-value","\nPlugin Help:"," @csstools/csstools-cli "," @csstools/csstools-cli postcss-preset-env"];console.warn(s.join("\n"))}}}();
+"use strict";var s,e=require("css-blank-pseudo"),o=require("postcss"),t=require("node:path"),i=require("node:fs/promises"),c=require("css-has-pseudo"),n=require("css-prefers-color-scheme"),r=require("postcss-attribute-case-insensitive"),a=require("@csstools/postcss-cascade-layers"),l=require("@csstools/postcss-color-function"),p=require("postcss-color-functional-notation"),u=require("postcss-color-hex-alpha"),d=require("@csstools/postcss-color-mix-function"),g=require("postcss-color-rebeccapurple"),f=require("@csstools/postcss-content-alt-text"),S=require("postcss-custom-media"),v=require("postcss-custom-properties"),h=require("postcss-custom-selectors"),w=require("postcss-dir-pseudo-class"),m=require("postcss-double-position-gradients"),C=require("@csstools/postcss-exponential-functions"),y=require("postcss-focus-visible"),P=require("postcss-focus-within"),b=require("@csstools/postcss-font-format-keywords"),x=require("postcss-gap-properties"),L=require("@csstools/postcss-gradients-interpolation-method"),T=require("@csstools/postcss-hwb-function"),F=require("@csstools/postcss-ic-unit"),q=require("postcss-image-set-function"),k=require("@csstools/postcss-is-pseudo-class"),M=require("postcss-lab-function"),I=require("@csstools/postcss-light-dark-function"),D=require("postcss-logical"),A=require("@csstools/postcss-logical-float-and-clear"),N=require("@csstools/postcss-logical-resize"),O=require("@csstools/postcss-logical-viewport-units"),V=require("@csstools/postcss-media-minmax"),E=require("@csstools/postcss-media-queries-aspect-ratio-number-values"),z=require("@csstools/postcss-nested-calc"),R=require("postcss-nesting"),$=require("@csstools/postcss-normalize-display-values"),U=require("@csstools/postcss-oklab-function"),W=require("postcss-overflow-shorthand"),G=require("postcss-place"),j=require("postcss-preset-env"),H=require("postcss-pseudo-class-any-link"),B=require("@csstools/postcss-relative-color-syntax"),K=require("@csstools/postcss-scope-pseudo-class"),Q=require("postcss-selector-not"),J=require("@csstools/postcss-stepped-value-functions"),Y=require("@csstools/postcss-text-decoration-shorthand"),_=require("@csstools/postcss-trigonometric-functions"),X=require("@csstools/postcss-unset-value");function parseArguments(e,o,t){const i=e.map((s=>s.trim())).filter((s=>!!s)),c={stdin:!1,stdout:!1,output:void 0,outputDir:void 0,inputs:[],inlineMap:!0,externalMap:!1,replace:!1,pluginOptions:{},debug:!1};let n,r=!1;for(let e=0;e1&&c.output)return console.warn('[error] omit "--output" when processing multiple inputs\n'),t(),s.InvalidArguments;0===c.inputs.length&&(c.stdin=!0),c.output||c.outputDir||c.replace||(c.stdout=!0),c.stdout&&(c.externalMap=!1);let a={};if(n)try{a=JSON.parse(n)}catch{return console.warn("[error] plugin options must be valid JSON\n"),t(),s.InvalidArguments}for(const e in a){const i=a[e];if(!o.includes(e))return console.warn(`[error] unknown plugin option: ${e}\n`),t(),s.InvalidArguments;c.pluginOptions[e]=i}return c}async function getStdin(){return new Promise((s=>{let e="",o=!1;if(setTimeout((()=>{o=!0,s("")}),1e4),process.stdin.isTTY){if(o)return;s(e)}else process.stdin.setEncoding("utf8"),process.stdin.on("readable",(()=>{let s="";for(;s=process.stdin.read();)e+=s??""})),process.stdin.on("end",(()=>{o||s(e)}))}))}async function stdinToStdout(s,e,t){let i="";try{const c=await getStdin();c||(t(),process.exit(1));const n=await o([s]).process(c,{from:"stdin",to:"stdout",map:!!e.inlineMap&&{inline:!0}});n.warnings().forEach((s=>{console.warn(s.toString())})),i=n.css}catch(s){s instanceof Error?console.error(e.debug?s:s.message):console.error(s),process.exit(1)}process.stdout.write(i+(e.inlineMap?"\n":"")),process.exit(0)}async function stdinToFs(s,e,c){let n=e.output;!n&&e.outputDir&&(n=t.join(e.outputDir,"output.css")),n||process.exit(0);try{const t=await getStdin();t||(c(),process.exit(1));const r=await o([s]).process(t,{from:"stdin",to:n,map:!(!e.inlineMap&&!e.externalMap)&&{inline:e.inlineMap}});r.warnings().forEach((s=>{console.warn(s.toString())})),e.externalMap&&r.map?await Promise.all([await i.writeFile(n,r.css+(e.inlineMap?"\n":"")),await i.writeFile(`${n}.map`,r.map.toString())]):await i.writeFile(n,r.css+(e.inlineMap?"\n":""))}catch(s){s instanceof Error?console.error(e.debug?s:s.message):console.error(s),process.exit(1)}console.log(`CSS was written to "${t.normalize(n)}"`),process.exit(0)}async function fsToStdout(s,e){let t=[];try{t=await Promise.all(e.inputs.map((async e=>{const t=await i.readFile(e),c=await o([s]).process(t,{from:e,to:"stdout",map:!1});return c.warnings().forEach((s=>{console.warn(s.toString())})),c.css})))}catch(s){s instanceof Error?console.error(e.debug?s:s.message):console.error(s),process.exit(1)}for(const s of t)process.stdout.write(s);process.exit(0)}async function fsToFs(s,e){try{await Promise.all(e.inputs.map((async c=>{let n=e.output;e.outputDir&&(n=t.join(e.outputDir,t.basename(c))),e.replace&&(n=c),n||process.exit(0);const r=await i.readFile(c),a=await o([s]).process(r,{from:c,to:n,map:!(!e.inlineMap&&!e.externalMap)&&{inline:e.inlineMap}});a.warnings().forEach((s=>{console.warn(s.toString())})),e.externalMap&&a.map?await Promise.all([await i.writeFile(n,a.css+(e.inlineMap?"\n":"")),await i.writeFile(`${n}.map`,a.map.toString())]):await i.writeFile(n,a.css+(e.inlineMap?"\n":"")),console.log(`CSS was written to "${t.normalize(n)}"`)})))}catch(s){s instanceof Error?console.error(e.debug?s:s.message):console.error(s),process.exit(1)}process.exit(0)}function helpTextLogger(s,e,o,t=null){let i=[];if(t){const s=Math.max(...Object.keys(t).map((s=>s.length))),e=new Array(s).fill(" ").join("");e.length&&(i=["\nPlugin Options:",...Object.keys(t).map((s=>` ${(s+e).slice(0,e.length)} ${typeof t[s]}`))],i.push(`\n ${JSON.stringify(t,null,2).split("\n").join("\n ")}`))}const c=[`${e}\n`,` ${o}\n`,"Usage:",` ${s} [input.css] [OPTIONS] [-o|--output output.css]`,` ${s} ... [OPTIONS] --dir `,` ${s} ... [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 i.length>0&&c.push(...i),()=>{console.warn(c.join("\n"))}}async function cli(e,o,t,i=!0){const c=parseArguments(process.argv.slice(i?2:3),o,t);c===s.InvalidArguments&&process.exit(1);const n=e(c.pluginOptions);c.stdin&&c.stdout?await stdinToStdout(n,c,t):c.stdin?await stdinToFs(n,c,t):c.stdout?await fsToStdout(n,c):await fsToFs(n,c)}async function cssBlankPseudo(){await cli(e,["preserve","replaceWith"],helpTextLogger("@csstools/cli css-blank-pseudo","PostCSS Blank Pseudo","Lets you style form elements when they are empty, following the Selectors Level 4 specification.",{preserve:!0,replaceWith:".css-blank"}),!1)}async function cssHasPseudo(){await cli(c,["preserve"],helpTextLogger("@csstools/cli css-has-pseudo","PostCSS Has Pseudo","Transforms CSS with :has {}",{preserve:!0}),!1)}async function cssPrefersColorScheme(){await cli(n,["preserve","mediaQuery"],helpTextLogger("@csstools/cli css-prefers-color-scheme","Prefers Color Scheme","Lets you use light and dark color schemes in all browsers, following the Media Queries specification.",{preserve:!0,mediaQuery:"color|color-index"}),!1)}async function postcssAttributeCaseInsensitive(){await cli(r,[],helpTextLogger("@csstools/cli postcss-attribute-case-insensitive","PostCSS Attribute Case Insensitive","Enables support for Case Insensitive Attribute matching in selectors"),!1)}async function postcssCascadeLayers(){await cli(a,[],helpTextLogger("@csstools/cli postcss-cascade-layers","PostCSS Cascade Layers","Lets you use `@layer` following the Cascade Layers Specification."),!1)}async function postcssColorFunction(){await cli(l,["preserve","enableProgressiveCustomProperties"],helpTextLogger("@csstools/cli postcss-color-function","PostCSS Color Function","Lets you use the color() function in CSS.",{preserve:!0,enableProgressiveCustomProperties:!1}),!1)}async function postcssColorFunctionalNotation(){await cli(p,["preserve"],helpTextLogger("@csstools/cli postcss-color-functional-notation","PostCSS Color Functional Notation","Lets you use space and slash separated color notation in CSS, following the CSS Color specification.",{preserve:!0}),!1)}async function postcssColorHexAlpha(){await cli(u,["preserve"],helpTextLogger("@csstools/cli postcss-color-hex-alpha","PostCSS Color Hex Alpha","Lets you use 4 & 8 character hex color notation in CSS, following the CSS Color Module specification.",{preserve:!0}),!1)}async function postcssColorMixFunction(){await cli(d,["preserve","enableProgressiveCustomProperties"],helpTextLogger("@csstools/cli postcss-color-mix-function","PostCSS Color Mix Function","Lets you use the color-mix() function in CSS.",{preserve:!0,enableProgressiveCustomProperties:!1,subFeatures:{displayP3:!1}}),!1)}async function postcssColorRebeccaPurple(){await cli(g,["preserve"],helpTextLogger("@csstools/cli postcss-color-rebeccapurple","PostCSS RebeccaPurple","Lets you use the rebeccapurple color keyword in CSS.",{preserve:!0}),!1)}async function postcssContentAltText(){await cli(f,["preserve","stripAltText","enableProgressiveCustomProperties"],helpTextLogger("@csstools/cli postcss-content-alt-text","PostCSS Content Alt Text","Generate fallback values for content with alt text.",{preserve:!0,stripAltText:!1,enableProgressiveCustomProperties:!0}),!1)}async function postcssCustomMedia(){await cli(S,["preserve"],helpTextLogger("@csstools/cli postcss-custom-media","PostCSS Custom Media","Lets you define @custom-media in CSS following the Custom Media Specification",{preserve:!0}),!1)}async function postcssCustomProperties(){await cli(v,["preserve"],helpTextLogger("@csstools/cli postcss-custom-properties","PostCSS Custom Properties","Lets you use Custom Properties in CSS, following the CSS Custom Properties specification.",{preserve:!0}),!1)}async function postcssCustomSelectors(){await cli(h,["preserve"],helpTextLogger("@csstools/cli postcss-custom-selectors","PostCSS Custom Selectors","Lets you define @custom-selector in CSS following the Custom Selectors Specification",{preserve:!0}),!1)}async function postcssDirPseudoClass(){await cli(w,["dir","preserve","shadow"],helpTextLogger("@csstools/cli postcss-dir-pseudo-class","PostCSS Dir Pseudo Class","Lets you style by directionality using the `:dir()` pseudo-class in CSS",{dir:"ltr",preserve:!0,shadow:!0}),!1)}async function postcssDoublePositionGradients(){await cli(m,["preserve","enableProgressiveCustomProperties"],helpTextLogger("@csstools/cli postcss-double-position-gradients","PostCSS Double Position Gradients","Lets you use double-position gradients in CSS, following the CSS Image Values and Replaced Content specification",{preserve:!0,enableProgressiveCustomProperties:!1}),!1)}async function postcssExponentialFunctions(){await cli(C,["preserve"],helpTextLogger("@csstools/cli postcss-exponential-functions","PostCSS Exponential Functions","Lets you use the `pow()`, `sqrt()`, `hypot()`, `log()`, `exp()` functions following the CSS Values 4 Specification.",{preserve:!0}),!1)}async function postcssFocusVisible(){await cli(y,["preserve","replaceWith"],helpTextLogger("@csstools/cli postcss-focus-visible","PostCSS Focus Visible","Lets you use the `:focus-visible` pseudo-class in CSS, following the Selectors Level 4 specification.",{preserve:!0,replaceWith:".focus-visible"}),!1)}async function postcssFocusWithin(){await cli(P,["preserve","replaceWith"],helpTextLogger("@csstools/cli postcss-focus-within","PostCSS Focus Within","Lets you use the `:focus-within` pseudo-class in CSS, following the Selectors Level 4 specification.",{preserve:!0,replaceWith:".focus-within"}),!1)}async function postcssFontFormatKeywords(){await cli(b,["preserve"],helpTextLogger("@csstools/cli postcss-font-format-keywords","PostCSS Font Format Keyword","Lets you use unquoted format on @font-face CSS definitions.",{preserve:!0}),!1)}async function postcssGapProperties(){await cli(x,["preserve"],helpTextLogger("@csstools/cli postcss-gap-properties","PostCSS Gap Properties","Lets you use the gap, column-gap, and row-gap shorthand properties in CSS, following the CSS Grid Layout specification.",{preserve:!0}),!1)}async function postcssGradientsInterpolationMethod(){await cli(L,["preserve","enableProgressiveCustomProperties"],helpTextLogger("@csstools/cli postcss-gradients-interpolation-method","PostCSS Gradients Interpolation Method","Lets you use different interpolation methods in CSS gradient functions.",{preserve:!0,enableProgressiveCustomProperties:!1}),!1)}async function postcssHWBFunction(){await cli(T,["preserve"],helpTextLogger("@csstools/cli postcss-hwb-function","PostCSS HWB function","Convert hwb() to rgb()",{preserve:!0}),!1)}async function postcssICUnit(){await cli(F,["preserve","enableProgressiveCustomProperties"],helpTextLogger("@csstools/cli postcss-ic-unit","PostCSS IC Unit","Lets you use the ic length unit.",{preserve:!0,enableProgressiveCustomProperties:!1}),!1)}async function postcssImageSetFunction(){await cli(q,["oninvalid","preserve"],helpTextLogger("@csstools/cli postcss-image-set-function","PostCSS Image Set Function","Lets you display resolution-dependent images using the image-set() function in CSS, following the CSS Images specification.",{preserve:!0,oninvalid:"ignore|warn|throw"}),!1)}async function postcssIsPseudoClass(){await cli(k,["onComplexSelector","preserve","specificityMatchingName"],helpTextLogger("@csstools/cli postcss-is-pseudo-class","PostCSS Is Pseudo Class","Lets you use the :is pseudo class function, following the CSS Selector specification.",{onComplexSelector:"warning",preserve:!0,specificityMatchingName:"does-not-exist"}),!1)}async function postcssLabFunction(){await cli(M,["preserve","enableProgressiveCustomProperties","subFeatures"],helpTextLogger("@csstools/cli postcss-lab-function","PostCSS Lab function","Convert lab() to rgb()",{preserve:!0,enableProgressiveCustomProperties:!1,subFeatures:{displayP3:!1}}),!1)}async function postcssLightDarkFunction(){await cli(I,["preserve"],helpTextLogger("@csstools/cli postcss-light-dark-function","PostCSS Light Dark function","Use the light-dark() color function in CSS",{preserve:!0}),!1)}async function postcssLogical$1(){await cli(D,["inlineDirection","blockDirection"],helpTextLogger("@csstools/cli postcss-logical","PostCSS Logical","Lets you use logical, rather than physical, direction and dimension mappings in CSS, following the CSS Logical Properties and Values specification.",{inlineDirection:"left-to-right",blockDirection:"top-to-bottom"}),!1)}async function postcssLogical(){await cli(A,["inlineDirection","blockDirection"],helpTextLogger("@csstools/cli postcss-logical-float-and-clear","PostCSS Logical Float And Clear","Lets you use flow-relative (inline-start and inline-end) values for float and clear, following the CSS Logical Properties and Values specification.",{inlineDirection:"left-to-right"}),!1)}async function postcssLogicalResize(){await cli(N,["inlineDirection"],helpTextLogger("@csstools/cli postcss-logical-resize","PostCSS Logical Resize","Lets you use logical values in the resize property, following the CSS Logical Properties and Values specification.",{inlineDirection:"left-to-right"}),!1)}async function postcssLogicalViewportUnits(){await cli(O,["inlineDirection","preserve"],helpTextLogger("@csstools/cli postcss-viewport-units","PostCSS Logical Viewport Units","Lets you use vb and vi length units in CSS, following the CSS Values and Units Module Level 4 specification.",{inlineDirection:"left-to-right",preserve:!0}),!1)}async function postcssMediaMinMax(){await cli(V,[],helpTextLogger("@csstools/cli postcss-media-minmax","PostCSS Media MinMax","Lets you use the range notation in CSS media queries.",{}),!1)}async function postcssMediaQueriesAspectRatioNumberValues(){await cli(E,[],helpTextLogger("@csstools/cli postcss-media-queries-aspect-ratio-number-values","PostCSS Media Queries Aspect-Ratio Number Values","Lets you use number values in aspect-ratio media queries.",{}),!1)}async function postcssNestedCalc(){await cli(z,["preserve"],helpTextLogger("@csstools/cli postcss-nested-calc","PostCSS Nested Calc","Lets you use nested calc() expressions in CSS.",{preserve:!0}),!1)}async function postcssNesting(){await cli(R,["noIsPseudoSelector"],helpTextLogger("@csstools/cli postcss-nesting","PostCSS Nesting","Lets you nest style rules inside each other, following the CSS Nesting specification.",{noIsPseudoSelector:!0}),!1)}async function postcssNormalizeDisplayValues(){await cli($,["preserve"],helpTextLogger("@csstools/cli postcss-normalize-display-values","PostCSS Normalize Display Values","Lets you use two values display syntax for inner and outer display types.",{preserve:!0}),!1)}async function postcssOKLabFunction(){await cli(U,["preserve","enableProgressiveCustomProperties","subFeatures"],helpTextLogger("@csstools/cli postcss-oklab-function","PostCSS OKLab Function","Lets you use oklab() and oklch() color functions in CSS.",{preserve:!0,enableProgressiveCustomProperties:!1,subFeatures:{displayP3:!1}}),!1)}async function postcssOverflowShorthand(){await cli(W,["preserve"],helpTextLogger("@csstools/cli postcss-overflow-shorthand","PostCSS Overflow Shorthand","Lets you use the `overflow` shorthand in CSS, following the CSS Overflow specification.",{preserve:!0}),!1)}async function postcssPlace(){await cli(G,["preserve"],helpTextLogger("@csstools/cli postcss-place","PostCSS Place","Lets you use place-* properties as shorthands for align-* and justify-*, following the CSS Box Alignment specification.",{preserve:!0}),!1)}async function postcssPresetEnv(){await cli(j,["stage","minimumVendorImplementations","features","env","browsers","autoprefixer","preserve","logical","enableClientSidePolyfills","debug"],helpTextLogger("@csstools/cli postcss-preset-env","PostCSS Preset Env","Lets you convert modern CSS into something most browsers can understand, determining the polyfills you need based on your targeted browsers or runtime environments.",{stage:0,minimumVendorImplementations:2,features:{"blank-pseudo-class":{preserve:!1},"color-functional-notation":{preserve:!0}},env:"production",browsers:"last 2 versions",autoprefixer:{grid:!0},preserve:!1,logical:{inlineDirection:"left-to-right",blockDirection:"top-to-bottom"},enableClientSidePolyfills:!1,debug:!1}),!1)}async function postcssPseudoClassAnyLink(){await cli(H,["preserve"],helpTextLogger("@csstools/cli postcss-pseudo-class-any-link","PostCSS Pseudo Class Any Link","Lets you :any-link pseudo-class in CSS, following the Selectors specification.",{preserve:!0}),!1)}async function postcssRelativeColorSyntax(){await cli(B,["preserve","enableProgressiveCustomProperties","subFeatures"],helpTextLogger("@csstools/cli postcss-relative-color-syntax","PostCSS Relative Color Syntax","Lets you use the relative color syntax in CSS color functions.",{preserve:!0,enableProgressiveCustomProperties:!1,subFeatures:{displayP3:!1}}),!1)}async function postcssScopePseudoClass(){await cli(K,["preserve"],helpTextLogger("@csstools/cli postcss-scope-pseudo-class","PostCSS Scope Pseudo Class","Lets you use the Reference Element Pseudo-class: :scope.",{preserve:!0}),!1)}async function postcssSelectorNot(){await cli(Q,[],helpTextLogger("@csstools/cli postcss-selector-not","PostCSS Selector Not","Transforms :not() W3C CSS level 4 pseudo classes to :not() CSS level 3 selectors following the Selectors 4 Specification"),!1)}async function postcssSteppedValueFunctions(){await cli(J,["preserve","onInvalid"],helpTextLogger("@csstools/cli postcss-stepped-value-functions","PostCSS Stepped Value Functions","Lets you use round(), mod() and rem() functions.",{preserve:!1,onInvalid:"warn"}),!1)}async function postcssTextDecorationShorthand(){await cli(Y,["preserve"],helpTextLogger("@csstools/cli postcss-text-decoration-shorthand","PostCSS Text Decoration Shorthand","Lets you use text-decoration in it's shorthand form in CSS.",{preserve:!0}),!1)}async function postcssTrigonometricFunctions(){await cli(_,["preserve"],helpTextLogger("@csstools/cli postcss-trigonometric-functions","PostCSS Trigonometric Functions","Lets you use `sin`, `cos`, `tan`, `asin`, `acos`, `atan` and `atan2` to be able to compute trigonometric relationships following the CSS Values 4 specification.",{preserve:!0}),!1)}async function postcssUnsetValue(){await cli(X,["preserve"],helpTextLogger("@csstools/cli postcss-unset-value","PostCSS Stepped Unset Value","Use the unset keyword in CSS.",{preserve:!1}),!1)}(s||(s={})).InvalidArguments="INVALID_ARGUMENTS",async function main(){switch(process.argv[2]??!1){case"css-blank-pseudo":return void await cssBlankPseudo();case"css-has-pseudo":return void await cssHasPseudo();case"css-prefers-color-scheme":return void await cssPrefersColorScheme();case"postcss-attribute-case-insensitive":return void await postcssAttributeCaseInsensitive();case"postcss-cascade-layers":return void await postcssCascadeLayers();case"postcss-color-function":return void await postcssColorFunction();case"postcss-color-mix-function":return void await postcssColorMixFunction();case"postcss-color-functional-notation":return void await postcssColorFunctionalNotation();case"postcss-color-hex-alpha":return void await postcssColorHexAlpha();case"postcss-color-rebeccapurple":return void await postcssColorRebeccaPurple();case"postcss-content-alt-text":return void await postcssContentAltText();case"postcss-custom-media":return void await postcssCustomMedia();case"postcss-custom-properties":return void await postcssCustomProperties();case"postcss-custom-selectors":return void await postcssCustomSelectors();case"postcss-dir-pseudo-class":return void await postcssDirPseudoClass();case"postcss-double-position-gradients":return void await postcssDoublePositionGradients();case"postcss-exponential-functions":return void await postcssExponentialFunctions();case"postcss-focus-visible":return void await postcssFocusVisible();case"postcss-focus-within":return void await postcssFocusWithin();case"postcss-font-format-keywords":return void await postcssFontFormatKeywords();case"postcss-gap-properties":return void await postcssGapProperties();case"postcss-gradients-interpolation-method":return void await postcssGradientsInterpolationMethod();case"postcss-hwb-function":return void await postcssHWBFunction();case"postcss-ic-unit":return void await postcssICUnit();case"postcss-image-set-function":return void await postcssImageSetFunction();case"postcss-is-pseudo-class":return void await postcssIsPseudoClass();case"postcss-lab-function":return void await postcssLabFunction();case"postcss-light-dark-function":return void await postcssLightDarkFunction();case"postcss-logical":return void await postcssLogical$1();case"postcss-logical-float-and-clear":return void await postcssLogical();case"postcss-logical-resize":return void await postcssLogicalResize();case"postcss-logical-viewport-units":return void await postcssLogicalViewportUnits();case"postcss-media-minmax":return void await postcssMediaMinMax();case"postcss-media-queries-aspect-ratio-number-values":return void await postcssMediaQueriesAspectRatioNumberValues();case"postcss-nested-calc":return void await postcssNestedCalc();case"postcss-nesting":return void await postcssNesting();case"postcss-normalize-display-values":return void await postcssNormalizeDisplayValues();case"postcss-oklab-function":return void await postcssOKLabFunction();case"postcss-overflow-shorthand":return void await postcssOverflowShorthand();case"postcss-place":return void await postcssPlace();case"postcss-preset-env":return void await postcssPresetEnv();case"postcss-pseudo-class-any-link":return void await postcssPseudoClassAnyLink();case"postcss-scope-pseudo-class":return void await postcssScopePseudoClass();case"postcss-relative-color-syntax":return void await postcssRelativeColorSyntax();case"postcss-selector-not":return void await postcssSelectorNot();case"postcss-stepped-value-functions":return void await postcssSteppedValueFunctions();case"postcss-text-decoration-shorthand":return void await postcssTextDecorationShorthand();case"postcss-trigonometric-functions":return void await postcssTrigonometricFunctions();case"postcss-unset-value":return void await postcssUnsetValue();default:{const s=["CSSTools CLI\n"," Transform CSS with any plugin from https://github.com/csstools/postcss-plugins\n","Usage:"," @csstools/csstools-cli postcss-preset-env [input.css] [OPTIONS] [-o|--output output.css]"," @csstools/csstools-cli postcss-preset-env ... [OPTIONS] --dir "," @csstools/csstools-cli postcss-preset-env ... [OPTIONS] --replace","\nAvailable Plugins:"," postcss-preset-env"," css-blank-pseudo"," css-has-pseudo"," css-prefers-color-scheme"," postcss-attribute-case-insensitive"," postcss-cascade-layers"," postcss-color-function"," postcss-color-functional-notation"," postcss-color-hex-alpha"," postcss-color-mix-function"," postcss-color-rebeccapurple"," postcss-content-alt-text"," postcss-custom-media"," postcss-custom-properties"," postcss-custom-selectors"," postcss-dir-pseudo-class"," postcss-double-position-gradients"," postcss-exponential-functions"," postcss-focus-visible"," postcss-focus-within"," postcss-font-format-keywords"," postcss-gap-properties"," postcss-gradients-interpolation-method"," postcss-hwb-function"," postcss-ic-unit"," postcss-image-set-function"," postcss-is-pseudo-class"," postcss-lab-function"," postcss-light-dark-function"," postcss-logical"," postcss-logical-float-and-clear"," postcss-logical-resize"," postcss-logical-viewport-units"," postcss-media-minmax"," postcss-media-queries-aspect-ratio-number-values"," postcss-nested-calc"," postcss-nesting"," postcss-normalize-display-values"," postcss-oklab-function"," postcss-overflow-shorthand"," postcss-place"," postcss-pseudo-class-any-link"," postcss-relative-color-syntax"," postcss-scope-pseudo-class"," postcss-selector-not"," postcss-stepped-value-functions"," postcss-text-decoration-shorthand"," postcss-trigonometric-functions"," postcss-unset-value","\nPlugin Help:"," @csstools/csstools-cli "," @csstools/csstools-cli postcss-preset-env"];console.warn(s.join("\n"))}}}();
diff --git a/cli/csstools-cli/package.json b/cli/csstools-cli/package.json
index 378a5f717..ea61f6bf8 100644
--- a/cli/csstools-cli/package.json
+++ b/cli/csstools-cli/package.json
@@ -25,7 +25,7 @@
}
],
"engines": {
- "node": "^14 || ^16 || >=18"
+ "node": ">=18"
},
"bin": {
"csstools-cli": "dist/cli.cjs"
diff --git a/e2e-package-managers/yarn/test.mjs b/e2e-package-managers/yarn/test.mjs
index 398011b97..a0d689f82 100644
--- a/e2e-package-managers/yarn/test.mjs
+++ b/e2e-package-managers/yarn/test.mjs
@@ -1,6 +1,6 @@
import postcssPresetEnv from 'postcss-preset-env';
import postcss from 'postcss';
-import assert from 'assert';
+import assert from 'node:assert';
const result = await postcss([postcssPresetEnv({ browsers: 'ie 11' })]).process('a { color: oklch(50% 1% 50deg); }', { from: undefined });
diff --git a/e2e/browserslist/package-json/index.mjs b/e2e/browserslist/package-json/index.mjs
index 7765db772..288a642a9 100644
--- a/e2e/browserslist/package-json/index.mjs
+++ b/e2e/browserslist/package-json/index.mjs
@@ -1,4 +1,4 @@
-import assert from 'assert';
+import assert from 'node:assert';
import plugin from 'postcss-preset-env';
import postcss from 'postcss';
diff --git a/e2e/browserslist/package-json/use-plugin-option.mjs b/e2e/browserslist/package-json/use-plugin-option.mjs
index b6a1e4812..968009550 100644
--- a/e2e/browserslist/package-json/use-plugin-option.mjs
+++ b/e2e/browserslist/package-json/use-plugin-option.mjs
@@ -1,4 +1,4 @@
-import assert from 'assert';
+import assert from 'node:assert';
import plugin from 'postcss-preset-env';
import postcss from 'postcss';
diff --git a/e2e/interop/custom-media--design-tokens--global-data/test.mjs b/e2e/interop/custom-media--design-tokens--global-data/test.mjs
index 40fc1a2d4..af6092dd2 100644
--- a/e2e/interop/custom-media--design-tokens--global-data/test.mjs
+++ b/e2e/interop/custom-media--design-tokens--global-data/test.mjs
@@ -1,5 +1,5 @@
-import assert from 'assert';
-import fs from 'fs/promises';
+import assert from 'node:assert';
+import fs from 'node:fs/promises';
const result = await fs.readFile('./dist/result.css');
const expect = await fs.readFile('./expect.css');
diff --git a/e2e/postcss-cli/commonjs/test.mjs b/e2e/postcss-cli/commonjs/test.mjs
index 40fc1a2d4..af6092dd2 100644
--- a/e2e/postcss-cli/commonjs/test.mjs
+++ b/e2e/postcss-cli/commonjs/test.mjs
@@ -1,5 +1,5 @@
-import assert from 'assert';
-import fs from 'fs/promises';
+import assert from 'node:assert';
+import fs from 'node:fs/promises';
const result = await fs.readFile('./dist/result.css');
const expect = await fs.readFile('./expect.css');
diff --git a/e2e/postcss-cli/esm/test.mjs b/e2e/postcss-cli/esm/test.mjs
index 40fc1a2d4..af6092dd2 100644
--- a/e2e/postcss-cli/esm/test.mjs
+++ b/e2e/postcss-cli/esm/test.mjs
@@ -1,5 +1,5 @@
-import assert from 'assert';
-import fs from 'fs/promises';
+import assert from 'node:assert';
+import fs from 'node:fs/promises';
const result = await fs.readFile('./dist/result.css');
const expect = await fs.readFile('./expect.css');
diff --git a/e2e/typescript/esm--node-next/dist/index.js b/e2e/typescript/esm--node-next/dist/index.js
index 38549d61a..534ee6670 100644
--- a/e2e/typescript/esm--node-next/dist/index.js
+++ b/e2e/typescript/esm--node-next/dist/index.js
@@ -1,4 +1,4 @@
-import assert from 'assert';
+import assert from 'node:assert';
import plugin from 'postcss-preset-env';
plugin({ preserve: true });
assert.ok(plugin.postcss, 'should have "postcss flag"');
diff --git a/e2e/typescript/esm--node-next/index.ts b/e2e/typescript/esm--node-next/index.ts
index d79bc230e..7eb63256f 100644
--- a/e2e/typescript/esm--node-next/index.ts
+++ b/e2e/typescript/esm--node-next/index.ts
@@ -1,4 +1,4 @@
-import assert from 'assert';
+import assert from 'node:assert';
import plugin from 'postcss-preset-env';
plugin({
preserve: true,
diff --git a/e2e/typescript/esm/dist/index.mjs b/e2e/typescript/esm/dist/index.mjs
index 38549d61a..534ee6670 100644
--- a/e2e/typescript/esm/dist/index.mjs
+++ b/e2e/typescript/esm/dist/index.mjs
@@ -1,4 +1,4 @@
-import assert from 'assert';
+import assert from 'node:assert';
import plugin from 'postcss-preset-env';
plugin({ preserve: true });
assert.ok(plugin.postcss, 'should have "postcss flag"');
diff --git a/e2e/typescript/esm/index.mts b/e2e/typescript/esm/index.mts
index 58686e119..5ba520bcb 100644
--- a/e2e/typescript/esm/index.mts
+++ b/e2e/typescript/esm/index.mts
@@ -1,4 +1,4 @@
-import assert from 'assert';
+import assert from 'node:assert';
import plugin from 'postcss-preset-env';
plugin({ preserve: true });
diff --git a/eslint.config.mjs b/eslint.config.mjs
index c153f8f97..08aba1340 100644
--- a/eslint.config.mjs
+++ b/eslint.config.mjs
@@ -55,6 +55,8 @@ export default [
'no-empty': ['error', {
'allowEmptyCatch': true,
}],
+
+ 'no-duplicate-imports': 'error',
},
},
{
@@ -101,6 +103,7 @@ export default [
'@typescript-eslint/explicit-function-return-type': 'error',
'@typescript-eslint/no-base-to-string': 'off',
'@typescript-eslint/no-non-null-assertion': 'error',
+ '@typescript-eslint/consistent-type-imports': 'error',
},
},
];
diff --git a/experimental/css-has-pseudo/CHANGELOG.md b/experimental/css-has-pseudo/CHANGELOG.md
index f629cf6c6..9e7465691 100644
--- a/experimental/css-has-pseudo/CHANGELOG.md
+++ b/experimental/css-has-pseudo/CHANGELOG.md
@@ -1,5 +1,9 @@
# Changes to CSS Has Pseudo
+### Unreleased (major)
+
+- Updated: Support for Node v18+ (major).
+
### 0.6.1
_December 15, 2023_
diff --git a/experimental/css-has-pseudo/package.json b/experimental/css-has-pseudo/package.json
index a56e13865..ec439cf09 100644
--- a/experimental/css-has-pseudo/package.json
+++ b/experimental/css-has-pseudo/package.json
@@ -15,7 +15,7 @@
}
],
"engines": {
- "node": "^14 || ^16 || >=18"
+ "node": ">=18"
},
"type": "module",
"main": "dist/index.cjs",
diff --git a/experimental/css-has-pseudo/test/_import.mjs b/experimental/css-has-pseudo/test/_import.mjs
index 4a50e2f59..67559d662 100644
--- a/experimental/css-has-pseudo/test/_import.mjs
+++ b/experimental/css-has-pseudo/test/_import.mjs
@@ -1,4 +1,4 @@
-import assert from 'assert';
+import assert from 'node:assert';
import plugin from '@csstools/css-has-pseudo-experimental';
plugin();
diff --git a/experimental/postcss-gradient-stop-increments/CHANGELOG.md b/experimental/postcss-gradient-stop-increments/CHANGELOG.md
index 366392b2c..4b6d97d0b 100644
--- a/experimental/postcss-gradient-stop-increments/CHANGELOG.md
+++ b/experimental/postcss-gradient-stop-increments/CHANGELOG.md
@@ -1,5 +1,9 @@
# Changes to PostCSS Gradient Stop Increments
+### Unreleased (major)
+
+- Updated: Support for Node v18+ (major).
+
### 1.0.12
_July 6, 2024_
diff --git a/experimental/postcss-gradient-stop-increments/package.json b/experimental/postcss-gradient-stop-increments/package.json
index 79b9d80f7..394bbeb91 100644
--- a/experimental/postcss-gradient-stop-increments/package.json
+++ b/experimental/postcss-gradient-stop-increments/package.json
@@ -25,7 +25,7 @@
}
],
"engines": {
- "node": "^14 || ^16 || >=18"
+ "node": ">=18"
},
"type": "module",
"main": "dist/index.cjs",
diff --git a/experimental/postcss-gradient-stop-increments/src/index.ts b/experimental/postcss-gradient-stop-increments/src/index.ts
index fec152eeb..af432a345 100644
--- a/experimental/postcss-gradient-stop-increments/src/index.ts
+++ b/experimental/postcss-gradient-stop-increments/src/index.ts
@@ -1,4 +1,5 @@
-import { ComponentValue, replaceComponentValues, stringify, TokenNode } from '@csstools/css-parser-algorithms';
+import type { ComponentValue} from '@csstools/css-parser-algorithms';
+import { replaceComponentValues, stringify, TokenNode } from '@csstools/css-parser-algorithms';
import type { PluginCreator } from 'postcss';
import { FunctionNode, isCommentNode, isTokenNode, WhitespaceNode, isFunctionNode, parseCommaSeparatedListOfComponentValues } from '@csstools/css-parser-algorithms';
import { calcFromComponentValues } from '@csstools/css-calc';
diff --git a/experimental/postcss-gradient-stop-increments/test/_import.mjs b/experimental/postcss-gradient-stop-increments/test/_import.mjs
index e37e5a21f..510756059 100644
--- a/experimental/postcss-gradient-stop-increments/test/_import.mjs
+++ b/experimental/postcss-gradient-stop-increments/test/_import.mjs
@@ -1,4 +1,4 @@
-import assert from 'assert';
+import assert from 'node:assert';
import plugin from '@csstools/postcss-gradient-stop-increments-experimental';
plugin();
diff --git a/experimental/postcss-nesting/CHANGELOG.md b/experimental/postcss-nesting/CHANGELOG.md
index 48c1c7788..f83d6fd8b 100644
--- a/experimental/postcss-nesting/CHANGELOG.md
+++ b/experimental/postcss-nesting/CHANGELOG.md
@@ -1,5 +1,9 @@
# Changes to PostCSS Nesting Experimental
+### Unreleased (major)
+
+- Updated: Support for Node v18+ (major).
+
### 2.0.1
_December 15, 2023_
diff --git a/experimental/postcss-nesting/package.json b/experimental/postcss-nesting/package.json
index 65f68653a..82fdec390 100644
--- a/experimental/postcss-nesting/package.json
+++ b/experimental/postcss-nesting/package.json
@@ -15,7 +15,7 @@
}
],
"engines": {
- "node": "^14 || ^16 || >=18"
+ "node": ">=18"
},
"type": "module",
"main": "dist/index.cjs",
diff --git a/experimental/postcss-nesting/src/lib/atrule-within-rule.ts b/experimental/postcss-nesting/src/lib/atrule-within-rule.ts
index b2d7b4cd4..ebb0e2565 100644
--- a/experimental/postcss-nesting/src/lib/atrule-within-rule.ts
+++ b/experimental/postcss-nesting/src/lib/atrule-within-rule.ts
@@ -1,7 +1,7 @@
import cleanupParent from './cleanup-parent.js';
import shiftNodesBeforeParent from './shift-nodes-before-parent.js';
import validAtrules from './valid-atrules.js';
-import { walkFunc } from './walk-func.js';
+import type { walkFunc } from './walk-func.js';
import type { AtRule, Result, Rule } from 'postcss';
import groupDeclarations from './group-declarations.js';
diff --git a/experimental/postcss-nesting/test/_import.mjs b/experimental/postcss-nesting/test/_import.mjs
index eeeda3a23..a2bffabc4 100644
--- a/experimental/postcss-nesting/test/_import.mjs
+++ b/experimental/postcss-nesting/test/_import.mjs
@@ -1,4 +1,4 @@
-import assert from 'assert';
+import assert from 'node:assert';
import plugin from '@csstools/postcss-nesting-experimental';
plugin();
diff --git a/package-lock.json b/package-lock.json
index 29fdc3e9d..d1585c182 100644
--- a/package-lock.json
+++ b/package-lock.json
@@ -43,7 +43,7 @@
"rollup": "^4.19.1",
"tslib": "^2.6.3",
"typescript": "^5.5.4",
- "typescript-eslint": "^8.0.0-alpha.58"
+ "typescript-eslint": "^8.0.0"
},
"engines": {
"node": "^14 || ^16 || >=18"
@@ -122,7 +122,7 @@
"@csstools/base-cli": "0.1.0"
},
"engines": {
- "node": "^14 || ^16 || >=18"
+ "node": ">=18"
}
},
"experimental/css-has-pseudo": {
@@ -143,7 +143,7 @@
"@csstools/postcss-tape": "*"
},
"engines": {
- "node": "^14 || ^16 || >=18"
+ "node": ">=18"
},
"peerDependencies": {
"postcss": "^8.4"
@@ -172,7 +172,7 @@
"@csstools/postcss-tape": "*"
},
"engines": {
- "node": "^14 || ^16 || >=18"
+ "node": ">=18"
},
"peerDependencies": {
"postcss": "^8.4"
@@ -199,7 +199,7 @@
"@csstools/postcss-tape": "*"
},
"engines": {
- "node": "^14 || ^16 || >=18"
+ "node": ">=18"
},
"peerDependencies": {
"postcss": "^8.4"
@@ -232,30 +232,30 @@
}
},
"node_modules/@babel/compat-data": {
- "version": "7.25.0",
- "resolved": "https://registry.npmjs.org/@babel/compat-data/-/compat-data-7.25.0.tgz",
- "integrity": "sha512-P4fwKI2mjEb3ZU5cnMJzvRsRKGBUcs8jvxIoRmr6ufAY9Xk2Bz7JubRTTivkw55c7WQJfTECeqYVa+HZ0FzREg==",
+ "version": "7.25.2",
+ "resolved": "https://registry.npmjs.org/@babel/compat-data/-/compat-data-7.25.2.tgz",
+ "integrity": "sha512-bYcppcpKBvX4znYaPEeFau03bp89ShqNMLs+rmdptMw+heSZh9+z84d2YG+K7cYLbWwzdjtDoW/uqZmPjulClQ==",
"dev": true,
"engines": {
"node": ">=6.9.0"
}
},
"node_modules/@babel/core": {
- "version": "7.24.9",
- "resolved": "https://registry.npmjs.org/@babel/core/-/core-7.24.9.tgz",
- "integrity": "sha512-5e3FI4Q3M3Pbr21+5xJwCv6ZT6KmGkI0vw3Tozy5ODAQFTIWe37iT8Cr7Ice2Ntb+M3iSKCEWMB1MBgKrW3whg==",
+ "version": "7.25.2",
+ "resolved": "https://registry.npmjs.org/@babel/core/-/core-7.25.2.tgz",
+ "integrity": "sha512-BBt3opiCOxUr9euZ5/ro/Xv8/V7yJ5bjYMqG/C1YAo8MIKAnumZalCN+msbci3Pigy4lIQfPUpfMM27HMGaYEA==",
"dev": true,
"dependencies": {
"@ampproject/remapping": "^2.2.0",
"@babel/code-frame": "^7.24.7",
- "@babel/generator": "^7.24.9",
- "@babel/helper-compilation-targets": "^7.24.8",
- "@babel/helper-module-transforms": "^7.24.9",
- "@babel/helpers": "^7.24.8",
- "@babel/parser": "^7.24.8",
- "@babel/template": "^7.24.7",
- "@babel/traverse": "^7.24.8",
- "@babel/types": "^7.24.9",
+ "@babel/generator": "^7.25.0",
+ "@babel/helper-compilation-targets": "^7.25.2",
+ "@babel/helper-module-transforms": "^7.25.2",
+ "@babel/helpers": "^7.25.0",
+ "@babel/parser": "^7.25.0",
+ "@babel/template": "^7.25.0",
+ "@babel/traverse": "^7.25.2",
+ "@babel/types": "^7.25.2",
"convert-source-map": "^2.0.0",
"debug": "^4.1.0",
"gensync": "^1.0.0-beta.2",
@@ -311,12 +311,12 @@
}
},
"node_modules/@babel/helper-compilation-targets": {
- "version": "7.24.8",
- "resolved": "https://registry.npmjs.org/@babel/helper-compilation-targets/-/helper-compilation-targets-7.24.8.tgz",
- "integrity": "sha512-oU+UoqCHdp+nWVDkpldqIQL/i/bvAv53tRqLG/s+cOXxe66zOYLU7ar/Xs3LdmBihrUMEUhwu6dMZwbNOYDwvw==",
+ "version": "7.25.2",
+ "resolved": "https://registry.npmjs.org/@babel/helper-compilation-targets/-/helper-compilation-targets-7.25.2.tgz",
+ "integrity": "sha512-U2U5LsSaZ7TAt3cfaymQ8WHh0pxvdHoEk6HVpaexxixjyEquMh0L0YNJNM6CTGKMXV1iksi0iZkGw4AcFkPaaw==",
"dev": true,
"dependencies": {
- "@babel/compat-data": "^7.24.8",
+ "@babel/compat-data": "^7.25.2",
"@babel/helper-validator-option": "^7.24.8",
"browserslist": "^4.23.1",
"lru-cache": "^5.1.1",
@@ -348,9 +348,9 @@
}
},
"node_modules/@babel/helper-create-regexp-features-plugin": {
- "version": "7.25.0",
- "resolved": "https://registry.npmjs.org/@babel/helper-create-regexp-features-plugin/-/helper-create-regexp-features-plugin-7.25.0.tgz",
- "integrity": "sha512-q0T+dknZS+L5LDazIP+02gEZITG5unzvb6yIjcmj5i0eFrs5ToBV2m2JGH4EsE/gtP8ygEGLGApBgRIZkTm7zg==",
+ "version": "7.25.2",
+ "resolved": "https://registry.npmjs.org/@babel/helper-create-regexp-features-plugin/-/helper-create-regexp-features-plugin-7.25.2.tgz",
+ "integrity": "sha512-+wqVGP+DFmqwFD3EH6TMTfUNeqDehV3E/dl+Sd54eaXqm17tEUNbEIn4sVivVowbvUpOtIGxdo3GoXyDH9N/9g==",
"dev": true,
"dependencies": {
"@babel/helper-annotate-as-pure": "^7.24.7",
@@ -407,15 +407,15 @@
}
},
"node_modules/@babel/helper-module-transforms": {
- "version": "7.25.0",
- "resolved": "https://registry.npmjs.org/@babel/helper-module-transforms/-/helper-module-transforms-7.25.0.tgz",
- "integrity": "sha512-bIkOa2ZJYn7FHnepzr5iX9Kmz8FjIz4UKzJ9zhX3dnYuVW0xul9RuR3skBfoLu+FPTQw90EHW9rJsSZhyLQ3fQ==",
+ "version": "7.25.2",
+ "resolved": "https://registry.npmjs.org/@babel/helper-module-transforms/-/helper-module-transforms-7.25.2.tgz",
+ "integrity": "sha512-BjyRAbix6j/wv83ftcVJmBt72QtHI56C7JXZoG2xATiLpmoC7dpd8WnkikExHDVPpi/3qCmO6WY1EaXOluiecQ==",
"dev": true,
"dependencies": {
"@babel/helper-module-imports": "^7.24.7",
"@babel/helper-simple-access": "^7.24.7",
"@babel/helper-validator-identifier": "^7.24.7",
- "@babel/traverse": "^7.25.0"
+ "@babel/traverse": "^7.25.2"
},
"engines": {
"node": ">=6.9.0"
@@ -575,10 +575,13 @@
}
},
"node_modules/@babel/parser": {
- "version": "7.25.0",
- "resolved": "https://registry.npmjs.org/@babel/parser/-/parser-7.25.0.tgz",
- "integrity": "sha512-CzdIU9jdP0dg7HdyB+bHvDJGagUv+qtzZt5rYCWwW6tITNqV9odjp6Qu41gkG0ca5UfdDUWrKkiAnHHdGRnOrA==",
+ "version": "7.25.3",
+ "resolved": "https://registry.npmjs.org/@babel/parser/-/parser-7.25.3.tgz",
+ "integrity": "sha512-iLTJKDbJ4hMvFPgQwwsVoxtHyWpKKPBrxkANrSYewDPaPpT5py5yeVkgPIJ7XYXhndxJpaA3PyALSXQ7u8e/Dw==",
"dev": true,
+ "dependencies": {
+ "@babel/types": "^7.25.2"
+ },
"bin": {
"parser": "bin/babel-parser.js"
},
@@ -587,13 +590,13 @@
}
},
"node_modules/@babel/plugin-bugfix-firefox-class-in-computed-class-key": {
- "version": "7.25.0",
- "resolved": "https://registry.npmjs.org/@babel/plugin-bugfix-firefox-class-in-computed-class-key/-/plugin-bugfix-firefox-class-in-computed-class-key-7.25.0.tgz",
- "integrity": "sha512-dG0aApncVQwAUJa8tP1VHTnmU67BeIQvKafd3raEx315H54FfkZSz3B/TT+33ZQAjatGJA79gZqTtqL5QZUKXw==",
+ "version": "7.25.3",
+ "resolved": "https://registry.npmjs.org/@babel/plugin-bugfix-firefox-class-in-computed-class-key/-/plugin-bugfix-firefox-class-in-computed-class-key-7.25.3.tgz",
+ "integrity": "sha512-wUrcsxZg6rqBXG05HG1FPYgsP6EvwF4WpBbxIpWIIYnH8wG0gzx3yZY3dtEHas4sTAOGkbTsc9EGPxwff8lRoA==",
"dev": true,
"dependencies": {
"@babel/helper-plugin-utils": "^7.24.8",
- "@babel/traverse": "^7.25.0"
+ "@babel/traverse": "^7.25.3"
},
"engines": {
"node": ">=6.9.0"
@@ -666,14 +669,14 @@
}
},
"node_modules/@babel/plugin-proposal-decorators": {
- "version": "7.23.9",
- "resolved": "https://registry.npmjs.org/@babel/plugin-proposal-decorators/-/plugin-proposal-decorators-7.23.9.tgz",
- "integrity": "sha512-hJhBCb0+NnTWybvWq2WpbCYDOcflSbx0t+BYP65e5R9GVnukiDTi+on5bFkk4p7QGuv190H6KfNiV9Knf/3cZA==",
+ "version": "7.24.7",
+ "resolved": "https://registry.npmjs.org/@babel/plugin-proposal-decorators/-/plugin-proposal-decorators-7.24.7.tgz",
+ "integrity": "sha512-RL9GR0pUG5Kc8BUWLNDm2T5OpYwSX15r98I0IkgmRQTXuELq/OynH8xtMTMvTJFjXbMWFVTKtYkTaYQsuAwQlQ==",
"dev": true,
"dependencies": {
- "@babel/helper-create-class-features-plugin": "^7.23.9",
- "@babel/helper-plugin-utils": "^7.22.5",
- "@babel/plugin-syntax-decorators": "^7.23.3"
+ "@babel/helper-create-class-features-plugin": "^7.24.7",
+ "@babel/helper-plugin-utils": "^7.24.7",
+ "@babel/plugin-syntax-decorators": "^7.24.7"
},
"engines": {
"node": ">=6.9.0"
@@ -1292,12 +1295,12 @@
}
},
"node_modules/@babel/plugin-transform-literals": {
- "version": "7.24.7",
- "resolved": "https://registry.npmjs.org/@babel/plugin-transform-literals/-/plugin-transform-literals-7.24.7.tgz",
- "integrity": "sha512-vcwCbb4HDH+hWi8Pqenwnjy+UiklO4Kt1vfspcQYFhJdpthSnW8XvWGyDZWKNVrVbVViI/S7K9PDJZiUmP2fYQ==",
+ "version": "7.25.2",
+ "resolved": "https://registry.npmjs.org/@babel/plugin-transform-literals/-/plugin-transform-literals-7.25.2.tgz",
+ "integrity": "sha512-HQI+HcTbm9ur3Z2DkO+jgESMAMcYLuN/A7NRw9juzxAezN9AvqvUTnpKP/9kkYANz6u7dFlAyOu44ejuGySlfw==",
"dev": true,
"dependencies": {
- "@babel/helper-plugin-utils": "^7.24.7"
+ "@babel/helper-plugin-utils": "^7.24.8"
},
"engines": {
"node": ">=6.9.0"
@@ -1706,9 +1709,9 @@
}
},
"node_modules/@babel/plugin-transform-typescript": {
- "version": "7.25.0",
- "resolved": "https://registry.npmjs.org/@babel/plugin-transform-typescript/-/plugin-transform-typescript-7.25.0.tgz",
- "integrity": "sha512-LZicxFzHIw+Sa3pzgMgSz6gdpsdkfiMObHUzhSIrwKF0+/rP/nuR49u79pSS+zIFJ1FeGeqQD2Dq4QGFbOVvSw==",
+ "version": "7.25.2",
+ "resolved": "https://registry.npmjs.org/@babel/plugin-transform-typescript/-/plugin-transform-typescript-7.25.2.tgz",
+ "integrity": "sha512-lBwRvjSmqiMYe/pS0+1gggjJleUJi7NzjvQ1Fkqtt69hBa/0t1YuW/MLQMAPixfwaQOHUXsd6jeU3Z+vdGv3+A==",
"dev": true,
"dependencies": {
"@babel/helper-annotate-as-pure": "^7.24.7",
@@ -1788,16 +1791,16 @@
}
},
"node_modules/@babel/preset-env": {
- "version": "7.25.0",
- "resolved": "https://registry.npmjs.org/@babel/preset-env/-/preset-env-7.25.0.tgz",
- "integrity": "sha512-vYAA8PrCOeZfG4D87hmw1KJ1BPubghXP1e2MacRFwECGNKL76dkA38JEwYllbvQCpf/kLxsTtir0b8MtxKoVCw==",
+ "version": "7.25.3",
+ "resolved": "https://registry.npmjs.org/@babel/preset-env/-/preset-env-7.25.3.tgz",
+ "integrity": "sha512-QsYW7UeAaXvLPX9tdVliMJE7MD7M6MLYVTovRTIwhoYQVFHR1rM4wO8wqAezYi3/BpSD+NzVCZ69R6smWiIi8g==",
"dev": true,
"dependencies": {
- "@babel/compat-data": "^7.25.0",
- "@babel/helper-compilation-targets": "^7.24.8",
+ "@babel/compat-data": "^7.25.2",
+ "@babel/helper-compilation-targets": "^7.25.2",
"@babel/helper-plugin-utils": "^7.24.8",
"@babel/helper-validator-option": "^7.24.8",
- "@babel/plugin-bugfix-firefox-class-in-computed-class-key": "^7.25.0",
+ "@babel/plugin-bugfix-firefox-class-in-computed-class-key": "^7.25.3",
"@babel/plugin-bugfix-safari-class-field-initializer-scope": "^7.25.0",
"@babel/plugin-bugfix-safari-id-destructuring-collision-in-function-expression": "^7.25.0",
"@babel/plugin-bugfix-v8-spread-parameters-in-optional-chaining": "^7.24.7",
@@ -1838,9 +1841,9 @@
"@babel/plugin-transform-exponentiation-operator": "^7.24.7",
"@babel/plugin-transform-export-namespace-from": "^7.24.7",
"@babel/plugin-transform-for-of": "^7.24.7",
- "@babel/plugin-transform-function-name": "^7.25.0",
+ "@babel/plugin-transform-function-name": "^7.25.1",
"@babel/plugin-transform-json-strings": "^7.24.7",
- "@babel/plugin-transform-literals": "^7.24.7",
+ "@babel/plugin-transform-literals": "^7.25.2",
"@babel/plugin-transform-logical-assignment-operators": "^7.24.7",
"@babel/plugin-transform-member-expression-literals": "^7.24.7",
"@babel/plugin-transform-modules-amd": "^7.24.7",
@@ -1899,16 +1902,16 @@
}
},
"node_modules/@babel/preset-typescript": {
- "version": "7.23.3",
- "resolved": "https://registry.npmjs.org/@babel/preset-typescript/-/preset-typescript-7.23.3.tgz",
- "integrity": "sha512-17oIGVlqz6CchO9RFYn5U6ZpWRZIngayYCtrPRSgANSwC2V1Jb+iP74nVxzzXJte8b8BYxrL1yY96xfhTBrNNQ==",
+ "version": "7.24.7",
+ "resolved": "https://registry.npmjs.org/@babel/preset-typescript/-/preset-typescript-7.24.7.tgz",
+ "integrity": "sha512-SyXRe3OdWwIwalxDg5UtJnJQO+YPcTfwiIY2B0Xlddh9o7jpWLvv8X1RthIeDOxQ+O1ML5BLPCONToObyVQVuQ==",
"dev": true,
"dependencies": {
- "@babel/helper-plugin-utils": "^7.22.5",
- "@babel/helper-validator-option": "^7.22.15",
- "@babel/plugin-syntax-jsx": "^7.23.3",
- "@babel/plugin-transform-modules-commonjs": "^7.23.3",
- "@babel/plugin-transform-typescript": "^7.23.3"
+ "@babel/helper-plugin-utils": "^7.24.7",
+ "@babel/helper-validator-option": "^7.24.7",
+ "@babel/plugin-syntax-jsx": "^7.24.7",
+ "@babel/plugin-transform-modules-commonjs": "^7.24.7",
+ "@babel/plugin-transform-typescript": "^7.24.7"
},
"engines": {
"node": ">=6.9.0"
@@ -1950,16 +1953,16 @@
}
},
"node_modules/@babel/traverse": {
- "version": "7.25.1",
- "resolved": "https://registry.npmjs.org/@babel/traverse/-/traverse-7.25.1.tgz",
- "integrity": "sha512-LrHHoWq08ZpmmFqBAzN+hUdWwy5zt7FGa/hVwMcOqW6OVtwqaoD5utfuGYU87JYxdZgLUvktAsn37j/sYR9siA==",
+ "version": "7.25.3",
+ "resolved": "https://registry.npmjs.org/@babel/traverse/-/traverse-7.25.3.tgz",
+ "integrity": "sha512-HefgyP1x754oGCsKmV5reSmtV7IXj/kpaE1XYY+D9G5PvKKoFfSbiS4M77MdjuwlZKDIKFCffq9rPU+H/s3ZdQ==",
"dev": true,
"dependencies": {
"@babel/code-frame": "^7.24.7",
"@babel/generator": "^7.25.0",
- "@babel/parser": "^7.25.0",
+ "@babel/parser": "^7.25.3",
"@babel/template": "^7.25.0",
- "@babel/types": "^7.25.0",
+ "@babel/types": "^7.25.2",
"debug": "^4.3.1",
"globals": "^11.1.0"
},
@@ -1977,9 +1980,9 @@
}
},
"node_modules/@babel/types": {
- "version": "7.25.0",
- "resolved": "https://registry.npmjs.org/@babel/types/-/types-7.25.0.tgz",
- "integrity": "sha512-LcnxQSsd9aXOIgmmSpvZ/1yo46ra2ESYyqLcryaBZOghxy5qqOBjvCWP5JfkI8yl9rlxRgdLTTMCQQRcN2hdCg==",
+ "version": "7.25.2",
+ "resolved": "https://registry.npmjs.org/@babel/types/-/types-7.25.2.tgz",
+ "integrity": "sha512-YTnYtra7W9e6/oAZEHj0bJehPRUlLH9/fbpT5LfB0NhQXyALCRkRs3zH9v07IYhkgpqX6Z78FnuccZr/l4Fs4Q==",
"dev": true,
"dependencies": {
"@babel/helper-string-parser": "^7.24.8",
@@ -2453,6 +2456,87 @@
"url": "https://github.com/sponsors/nzakas"
}
},
+ "node_modules/@inquirer/checkbox": {
+ "version": "2.4.5",
+ "resolved": "https://registry.npmjs.org/@inquirer/checkbox/-/checkbox-2.4.5.tgz",
+ "integrity": "sha512-+YlCyS6JBWeZugIvReh/YL5HJcowlklz5RykQuYKQfgWQeCJh5Us0nWcRddvIVkjmYa0I/8bwWioSLu850J8sA==",
+ "dev": true,
+ "dependencies": {
+ "@inquirer/core": "^9.0.8",
+ "@inquirer/figures": "^1.0.5",
+ "@inquirer/type": "^1.5.1",
+ "ansi-escapes": "^4.3.2",
+ "yoctocolors-cjs": "^2.1.2"
+ },
+ "engines": {
+ "node": ">=18"
+ }
+ },
+ "node_modules/@inquirer/confirm": {
+ "version": "3.1.20",
+ "resolved": "https://registry.npmjs.org/@inquirer/confirm/-/confirm-3.1.20.tgz",
+ "integrity": "sha512-UvG5Plh0MfCqUvZB8RKzBBEWB/EeMzO59Awy/Jg4NgeSjIPqhPaQFnnmxiyWUTwZh4uENB7wCklEFUwckioXWg==",
+ "dev": true,
+ "dependencies": {
+ "@inquirer/core": "^9.0.8",
+ "@inquirer/type": "^1.5.1"
+ },
+ "engines": {
+ "node": ">=18"
+ }
+ },
+ "node_modules/@inquirer/core": {
+ "version": "9.0.8",
+ "resolved": "https://registry.npmjs.org/@inquirer/core/-/core-9.0.8.tgz",
+ "integrity": "sha512-ttnI/BGlP9SxjbQnv1nssv7dPAwiR82KmjJZx2SxSZyi2mGbaEvh4jg0I4yU/4mVQf7QvCVGGr/hGuJFEYhwnw==",
+ "dev": true,
+ "dependencies": {
+ "@inquirer/figures": "^1.0.5",
+ "@inquirer/type": "^1.5.1",
+ "@types/mute-stream": "^0.0.4",
+ "@types/node": "^22.0.0",
+ "@types/wrap-ansi": "^3.0.0",
+ "ansi-escapes": "^4.3.2",
+ "cli-spinners": "^2.9.2",
+ "cli-width": "^4.1.0",
+ "mute-stream": "^1.0.0",
+ "signal-exit": "^4.1.0",
+ "strip-ansi": "^6.0.1",
+ "wrap-ansi": "^6.2.0",
+ "yoctocolors-cjs": "^2.1.2"
+ },
+ "engines": {
+ "node": ">=18"
+ }
+ },
+ "node_modules/@inquirer/editor": {
+ "version": "2.1.20",
+ "resolved": "https://registry.npmjs.org/@inquirer/editor/-/editor-2.1.20.tgz",
+ "integrity": "sha512-vtIN9NwXldX8SWbPt5biJhnTpHJCzF5nSymcv4hcOxiCrOpXmgOvFYGpAY729KODF+5e1OLqPbJ8ApiwPu/peQ==",
+ "dev": true,
+ "dependencies": {
+ "@inquirer/core": "^9.0.8",
+ "@inquirer/type": "^1.5.1",
+ "external-editor": "^3.1.0"
+ },
+ "engines": {
+ "node": ">=18"
+ }
+ },
+ "node_modules/@inquirer/expand": {
+ "version": "2.1.20",
+ "resolved": "https://registry.npmjs.org/@inquirer/expand/-/expand-2.1.20.tgz",
+ "integrity": "sha512-ruUTCUGKhe6TvDM3/gKjX9v7D5cWbiuawFE6aF/cFmNO79R/zMjrFFVoueDM8FRw8yXqnREb0jFkYF1LUxnDNA==",
+ "dev": true,
+ "dependencies": {
+ "@inquirer/core": "^9.0.8",
+ "@inquirer/type": "^1.5.1",
+ "yoctocolors-cjs": "^2.1.2"
+ },
+ "engines": {
+ "node": ">=18"
+ }
+ },
"node_modules/@inquirer/figures": {
"version": "1.0.5",
"resolved": "https://registry.npmjs.org/@inquirer/figures/-/figures-1.0.5.tgz",
@@ -2462,6 +2546,124 @@
"node": ">=18"
}
},
+ "node_modules/@inquirer/input": {
+ "version": "2.2.7",
+ "resolved": "https://registry.npmjs.org/@inquirer/input/-/input-2.2.7.tgz",
+ "integrity": "sha512-QFk31Gq4Wr+Ve9ilMiFGGrSjGZQBilV0cgTN1zubD98Bx65fsNrh8++Biy/9mjNKRaqHFbZBw5baAcQvOmW8OQ==",
+ "dev": true,
+ "dependencies": {
+ "@inquirer/core": "^9.0.8",
+ "@inquirer/type": "^1.5.1"
+ },
+ "engines": {
+ "node": ">=18"
+ }
+ },
+ "node_modules/@inquirer/number": {
+ "version": "1.0.8",
+ "resolved": "https://registry.npmjs.org/@inquirer/number/-/number-1.0.8.tgz",
+ "integrity": "sha512-GamytM0a3fLh8xjgWbGb/DmDA1SmW6sc6ZyfiiWL1my2NAkV6mrTEKMOA4LSK2gB43uf8vcOS7Hp/LeVjIqLwg==",
+ "dev": true,
+ "dependencies": {
+ "@inquirer/core": "^9.0.8",
+ "@inquirer/type": "^1.5.1"
+ },
+ "engines": {
+ "node": ">=18"
+ }
+ },
+ "node_modules/@inquirer/password": {
+ "version": "2.1.20",
+ "resolved": "https://registry.npmjs.org/@inquirer/password/-/password-2.1.20.tgz",
+ "integrity": "sha512-il2TG7xDlfiLE3cnOCxfDfrwvsiSmXjVd26hvf4tdzHvdisgLiEjbN6mi51/TnlSQ+2Qc69+9jIq3ws93nhS2w==",
+ "dev": true,
+ "dependencies": {
+ "@inquirer/core": "^9.0.8",
+ "@inquirer/type": "^1.5.1",
+ "ansi-escapes": "^4.3.2"
+ },
+ "engines": {
+ "node": ">=18"
+ }
+ },
+ "node_modules/@inquirer/prompts": {
+ "version": "5.3.6",
+ "resolved": "https://registry.npmjs.org/@inquirer/prompts/-/prompts-5.3.6.tgz",
+ "integrity": "sha512-go5DXxasCIZvztWapYPUSFXg7GceDSQPM1ew3MahFF7degA5kfIVe5kB4KAlARXt83fApyEczvE1H4bh0HLObA==",
+ "dev": true,
+ "dependencies": {
+ "@inquirer/checkbox": "^2.4.5",
+ "@inquirer/confirm": "^3.1.20",
+ "@inquirer/editor": "^2.1.20",
+ "@inquirer/expand": "^2.1.20",
+ "@inquirer/input": "^2.2.7",
+ "@inquirer/number": "^1.0.8",
+ "@inquirer/password": "^2.1.20",
+ "@inquirer/rawlist": "^2.2.2",
+ "@inquirer/search": "^1.0.5",
+ "@inquirer/select": "^2.4.5"
+ },
+ "engines": {
+ "node": ">=18"
+ }
+ },
+ "node_modules/@inquirer/rawlist": {
+ "version": "2.2.2",
+ "resolved": "https://registry.npmjs.org/@inquirer/rawlist/-/rawlist-2.2.2.tgz",
+ "integrity": "sha512-U4OsvqjdLB6nmf5ZDshPYMq0b+qd6JWxTrvRTiMfwUY6cFxkR9YWKarLXFhndf7tawQ8f3DwU9P9wryDc2ESSA==",
+ "dev": true,
+ "dependencies": {
+ "@inquirer/core": "^9.0.8",
+ "@inquirer/type": "^1.5.1",
+ "yoctocolors-cjs": "^2.1.2"
+ },
+ "engines": {
+ "node": ">=18"
+ }
+ },
+ "node_modules/@inquirer/search": {
+ "version": "1.0.5",
+ "resolved": "https://registry.npmjs.org/@inquirer/search/-/search-1.0.5.tgz",
+ "integrity": "sha512-25nyVAbO0NwFZTXP/cW++W1QGHlHY+hmsehMM1sPKvp4wYcxMQcm6xNCor0bU2Pv/L33IkPV/NV9SuJyFC85EQ==",
+ "dev": true,
+ "dependencies": {
+ "@inquirer/core": "^9.0.8",
+ "@inquirer/figures": "^1.0.5",
+ "@inquirer/type": "^1.5.1",
+ "yoctocolors-cjs": "^2.1.2"
+ },
+ "engines": {
+ "node": ">=18"
+ }
+ },
+ "node_modules/@inquirer/select": {
+ "version": "2.4.5",
+ "resolved": "https://registry.npmjs.org/@inquirer/select/-/select-2.4.5.tgz",
+ "integrity": "sha512-DbCthH3l7vrrK+Ewll3bgzxC3dzMle8xkWYta4if31p9NOmFNhZKhSfdYMjaOtGFBCUEwo4D5LMgN6sPKgUWIw==",
+ "dev": true,
+ "dependencies": {
+ "@inquirer/core": "^9.0.8",
+ "@inquirer/figures": "^1.0.5",
+ "@inquirer/type": "^1.5.1",
+ "ansi-escapes": "^4.3.2",
+ "yoctocolors-cjs": "^2.1.2"
+ },
+ "engines": {
+ "node": ">=18"
+ }
+ },
+ "node_modules/@inquirer/type": {
+ "version": "1.5.1",
+ "resolved": "https://registry.npmjs.org/@inquirer/type/-/type-1.5.1.tgz",
+ "integrity": "sha512-m3YgGQlKNS0BM+8AFiJkCsTqHEFCWn6s/Rqye3mYwvqY6LdfUv12eSwbsgNzrYyrLXiy7IrrjDLPysaSBwEfhw==",
+ "dev": true,
+ "dependencies": {
+ "mute-stream": "^1.0.0"
+ },
+ "engines": {
+ "node": ">=18"
+ }
+ },
"node_modules/@isaacs/cliui": {
"version": "8.0.2",
"resolved": "https://registry.npmjs.org/@isaacs/cliui/-/cliui-8.0.2.tgz",
@@ -2503,29 +2705,6 @@
"url": "https://github.com/chalk/ansi-styles?sponsor=1"
}
},
- "node_modules/@isaacs/cliui/node_modules/emoji-regex": {
- "version": "9.2.2",
- "resolved": "https://registry.npmjs.org/emoji-regex/-/emoji-regex-9.2.2.tgz",
- "integrity": "sha512-L18DaJsXSUk2+42pv8mLs5jJT2hqFkFE4j21wOmgbUqsZ2hL72NsUU785g9RXgo3s0ZNgVl42TiHp3ZtOv/Vyg==",
- "dev": true
- },
- "node_modules/@isaacs/cliui/node_modules/string-width": {
- "version": "5.1.2",
- "resolved": "https://registry.npmjs.org/string-width/-/string-width-5.1.2.tgz",
- "integrity": "sha512-HnLOCR3vjcY8beoNLtcjZ5/nxn2afmME6lhrDrebokqMap+XbeW8n9TXpPDOqdGK5qcI3oT0GKTW6wC7EMiVqA==",
- "dev": true,
- "dependencies": {
- "eastasianwidth": "^0.2.0",
- "emoji-regex": "^9.2.2",
- "strip-ansi": "^7.0.1"
- },
- "engines": {
- "node": ">=12"
- },
- "funding": {
- "url": "https://github.com/sponsors/sindresorhus"
- }
- },
"node_modules/@isaacs/cliui/node_modules/strip-ansi": {
"version": "7.1.0",
"resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-7.1.0.tgz",
@@ -2616,18 +2795,6 @@
"@jridgewell/sourcemap-codec": "^1.4.14"
}
},
- "node_modules/@ljharb/through": {
- "version": "2.3.13",
- "resolved": "https://registry.npmjs.org/@ljharb/through/-/through-2.3.13.tgz",
- "integrity": "sha512-/gKJun8NNiWGZJkGzI/Ragc53cOdcLNdzjLaIa+GEjguQs0ulsurx8WN0jijdK9yPqDvziX995sMRLyLt1uZMQ==",
- "dev": true,
- "dependencies": {
- "call-bind": "^1.0.7"
- },
- "engines": {
- "node": ">= 0.4"
- }
- },
"node_modules/@microsoft/api-documenter": {
"version": "7.25.9",
"resolved": "https://registry.npmjs.org/@microsoft/api-documenter/-/api-documenter-7.25.9.tgz",
@@ -2859,9 +3026,9 @@
"dev": true
},
"node_modules/@rmenke/css-tokenizer-tests": {
- "version": "1.1.5",
- "resolved": "https://registry.npmjs.org/@rmenke/css-tokenizer-tests/-/css-tokenizer-tests-1.1.5.tgz",
- "integrity": "sha512-C+ETPdnrHwJXfaetFz3HEmIQo7ztLtlx/XfxgPE/XGFQzW9vdMOxIW0i5IxeAEdql7aguGjQSI0W7eqvS3pABQ==",
+ "version": "1.1.6",
+ "resolved": "https://registry.npmjs.org/@rmenke/css-tokenizer-tests/-/css-tokenizer-tests-1.1.6.tgz",
+ "integrity": "sha512-58z1pZzSOW1TaudB1hSQ+c17K327gC9JlQDoV1oj56M4/BdQ6euoiGdCpIAFRonf2QxjFXDwqJr07HMOM6BjGA==",
"dev": true
},
"node_modules/@rollup/plugin-babel": {
@@ -3011,9 +3178,9 @@
}
},
"node_modules/@rollup/rollup-android-arm-eabi": {
- "version": "4.19.1",
- "resolved": "https://registry.npmjs.org/@rollup/rollup-android-arm-eabi/-/rollup-android-arm-eabi-4.19.1.tgz",
- "integrity": "sha512-XzqSg714++M+FXhHfXpS1tDnNZNpgxxuGZWlRG/jSj+VEPmZ0yg6jV4E0AL3uyBKxO8mO3xtOsP5mQ+XLfrlww==",
+ "version": "4.19.2",
+ "resolved": "https://registry.npmjs.org/@rollup/rollup-android-arm-eabi/-/rollup-android-arm-eabi-4.19.2.tgz",
+ "integrity": "sha512-OHflWINKtoCFSpm/WmuQaWW4jeX+3Qt3XQDepkkiFTsoxFc5BpF3Z5aDxFZgBqRjO6ATP5+b1iilp4kGIZVWlA==",
"cpu": [
"arm"
],
@@ -3024,9 +3191,9 @@
]
},
"node_modules/@rollup/rollup-android-arm64": {
- "version": "4.19.1",
- "resolved": "https://registry.npmjs.org/@rollup/rollup-android-arm64/-/rollup-android-arm64-4.19.1.tgz",
- "integrity": "sha512-thFUbkHteM20BGShD6P08aungq4irbIZKUNbG70LN8RkO7YztcGPiKTTGZS7Kw+x5h8hOXs0i4OaHwFxlpQN6A==",
+ "version": "4.19.2",
+ "resolved": "https://registry.npmjs.org/@rollup/rollup-android-arm64/-/rollup-android-arm64-4.19.2.tgz",
+ "integrity": "sha512-k0OC/b14rNzMLDOE6QMBCjDRm3fQOHAL8Ldc9bxEWvMo4Ty9RY6rWmGetNTWhPo+/+FNd1lsQYRd0/1OSix36A==",
"cpu": [
"arm64"
],
@@ -3037,9 +3204,9 @@
]
},
"node_modules/@rollup/rollup-darwin-arm64": {
- "version": "4.19.1",
- "resolved": "https://registry.npmjs.org/@rollup/rollup-darwin-arm64/-/rollup-darwin-arm64-4.19.1.tgz",
- "integrity": "sha512-8o6eqeFZzVLia2hKPUZk4jdE3zW7LCcZr+MD18tXkgBBid3lssGVAYuox8x6YHoEPDdDa9ixTaStcmx88lio5Q==",
+ "version": "4.19.2",
+ "resolved": "https://registry.npmjs.org/@rollup/rollup-darwin-arm64/-/rollup-darwin-arm64-4.19.2.tgz",
+ "integrity": "sha512-IIARRgWCNWMTeQH+kr/gFTHJccKzwEaI0YSvtqkEBPj7AshElFq89TyreKNFAGh5frLfDCbodnq+Ye3dqGKPBw==",
"cpu": [
"arm64"
],
@@ -3050,9 +3217,9 @@
]
},
"node_modules/@rollup/rollup-darwin-x64": {
- "version": "4.19.1",
- "resolved": "https://registry.npmjs.org/@rollup/rollup-darwin-x64/-/rollup-darwin-x64-4.19.1.tgz",
- "integrity": "sha512-4T42heKsnbjkn7ovYiAdDVRRWZLU9Kmhdt6HafZxFcUdpjlBlxj4wDrt1yFWLk7G4+E+8p2C9tcmSu0KA6auGA==",
+ "version": "4.19.2",
+ "resolved": "https://registry.npmjs.org/@rollup/rollup-darwin-x64/-/rollup-darwin-x64-4.19.2.tgz",
+ "integrity": "sha512-52udDMFDv54BTAdnw+KXNF45QCvcJOcYGl3vQkp4vARyrcdI/cXH8VXTEv/8QWfd6Fru8QQuw1b2uNersXOL0g==",
"cpu": [
"x64"
],
@@ -3063,9 +3230,9 @@
]
},
"node_modules/@rollup/rollup-linux-arm-gnueabihf": {
- "version": "4.19.1",
- "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-arm-gnueabihf/-/rollup-linux-arm-gnueabihf-4.19.1.tgz",
- "integrity": "sha512-MXg1xp+e5GhZ3Vit1gGEyoC+dyQUBy2JgVQ+3hUrD9wZMkUw/ywgkpK7oZgnB6kPpGrxJ41clkPPnsknuD6M2Q==",
+ "version": "4.19.2",
+ "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-arm-gnueabihf/-/rollup-linux-arm-gnueabihf-4.19.2.tgz",
+ "integrity": "sha512-r+SI2t8srMPYZeoa1w0o/AfoVt9akI1ihgazGYPQGRilVAkuzMGiTtexNZkrPkQsyFrvqq/ni8f3zOnHw4hUbA==",
"cpu": [
"arm"
],
@@ -3076,9 +3243,9 @@
]
},
"node_modules/@rollup/rollup-linux-arm-musleabihf": {
- "version": "4.19.1",
- "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-arm-musleabihf/-/rollup-linux-arm-musleabihf-4.19.1.tgz",
- "integrity": "sha512-DZNLwIY4ftPSRVkJEaxYkq7u2zel7aah57HESuNkUnz+3bZHxwkCUkrfS2IWC1sxK6F2QNIR0Qr/YXw7nkF3Pw==",
+ "version": "4.19.2",
+ "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-arm-musleabihf/-/rollup-linux-arm-musleabihf-4.19.2.tgz",
+ "integrity": "sha512-+tYiL4QVjtI3KliKBGtUU7yhw0GMcJJuB9mLTCEauHEsqfk49gtUBXGtGP3h1LW8MbaTY6rSFIQV1XOBps1gBA==",
"cpu": [
"arm"
],
@@ -3089,9 +3256,9 @@
]
},
"node_modules/@rollup/rollup-linux-arm64-gnu": {
- "version": "4.19.1",
- "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-arm64-gnu/-/rollup-linux-arm64-gnu-4.19.1.tgz",
- "integrity": "sha512-C7evongnjyxdngSDRRSQv5GvyfISizgtk9RM+z2biV5kY6S/NF/wta7K+DanmktC5DkuaJQgoKGf7KUDmA7RUw==",
+ "version": "4.19.2",
+ "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-arm64-gnu/-/rollup-linux-arm64-gnu-4.19.2.tgz",
+ "integrity": "sha512-OR5DcvZiYN75mXDNQQxlQPTv4D+uNCUsmSCSY2FolLf9W5I4DSoJyg7z9Ea3TjKfhPSGgMJiey1aWvlWuBzMtg==",
"cpu": [
"arm64"
],
@@ -3102,9 +3269,9 @@
]
},
"node_modules/@rollup/rollup-linux-arm64-musl": {
- "version": "4.19.1",
- "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-arm64-musl/-/rollup-linux-arm64-musl-4.19.1.tgz",
- "integrity": "sha512-89tFWqxfxLLHkAthAcrTs9etAoBFRduNfWdl2xUs/yLV+7XDrJ5yuXMHptNqf1Zw0UCA3cAutkAiAokYCkaPtw==",
+ "version": "4.19.2",
+ "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-arm64-musl/-/rollup-linux-arm64-musl-4.19.2.tgz",
+ "integrity": "sha512-Hw3jSfWdUSauEYFBSFIte6I8m6jOj+3vifLg8EU3lreWulAUpch4JBjDMtlKosrBzkr0kwKgL9iCfjA8L3geoA==",
"cpu": [
"arm64"
],
@@ -3115,9 +3282,9 @@
]
},
"node_modules/@rollup/rollup-linux-powerpc64le-gnu": {
- "version": "4.19.1",
- "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-powerpc64le-gnu/-/rollup-linux-powerpc64le-gnu-4.19.1.tgz",
- "integrity": "sha512-PromGeV50sq+YfaisG8W3fd+Cl6mnOOiNv2qKKqKCpiiEke2KiKVyDqG/Mb9GWKbYMHj5a01fq/qlUR28PFhCQ==",
+ "version": "4.19.2",
+ "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-powerpc64le-gnu/-/rollup-linux-powerpc64le-gnu-4.19.2.tgz",
+ "integrity": "sha512-rhjvoPBhBwVnJRq/+hi2Q3EMiVF538/o9dBuj9TVLclo9DuONqt5xfWSaE6MYiFKpo/lFPJ/iSI72rYWw5Hc7w==",
"cpu": [
"ppc64"
],
@@ -3128,9 +3295,9 @@
]
},
"node_modules/@rollup/rollup-linux-riscv64-gnu": {
- "version": "4.19.1",
- "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-riscv64-gnu/-/rollup-linux-riscv64-gnu-4.19.1.tgz",
- "integrity": "sha512-/1BmHYh+iz0cNCP0oHCuF8CSiNj0JOGf0jRlSo3L/FAyZyG2rGBuKpkZVH9YF+x58r1jgWxvm1aRg3DHrLDt6A==",
+ "version": "4.19.2",
+ "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-riscv64-gnu/-/rollup-linux-riscv64-gnu-4.19.2.tgz",
+ "integrity": "sha512-EAz6vjPwHHs2qOCnpQkw4xs14XJq84I81sDRGPEjKPFVPBw7fwvtwhVjcZR6SLydCv8zNK8YGFblKWd/vRmP8g==",
"cpu": [
"riscv64"
],
@@ -3141,9 +3308,9 @@
]
},
"node_modules/@rollup/rollup-linux-s390x-gnu": {
- "version": "4.19.1",
- "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-s390x-gnu/-/rollup-linux-s390x-gnu-4.19.1.tgz",
- "integrity": "sha512-0cYP5rGkQWRZKy9/HtsWVStLXzCF3cCBTRI+qRL8Z+wkYlqN7zrSYm6FuY5Kd5ysS5aH0q5lVgb/WbG4jqXN1Q==",
+ "version": "4.19.2",
+ "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-s390x-gnu/-/rollup-linux-s390x-gnu-4.19.2.tgz",
+ "integrity": "sha512-IJSUX1xb8k/zN9j2I7B5Re6B0NNJDJ1+soezjNojhT8DEVeDNptq2jgycCOpRhyGj0+xBn7Cq+PK7Q+nd2hxLA==",
"cpu": [
"s390x"
],
@@ -3154,9 +3321,9 @@
]
},
"node_modules/@rollup/rollup-linux-x64-gnu": {
- "version": "4.19.1",
- "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-x64-gnu/-/rollup-linux-x64-gnu-4.19.1.tgz",
- "integrity": "sha512-XUXeI9eM8rMP8aGvii/aOOiMvTs7xlCosq9xCjcqI9+5hBxtjDpD+7Abm1ZhVIFE1J2h2VIg0t2DX/gjespC2Q==",
+ "version": "4.19.2",
+ "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-x64-gnu/-/rollup-linux-x64-gnu-4.19.2.tgz",
+ "integrity": "sha512-OgaToJ8jSxTpgGkZSkwKE+JQGihdcaqnyHEFOSAU45utQ+yLruE1dkonB2SDI8t375wOKgNn8pQvaWY9kPzxDQ==",
"cpu": [
"x64"
],
@@ -3167,9 +3334,9 @@
]
},
"node_modules/@rollup/rollup-linux-x64-musl": {
- "version": "4.19.1",
- "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-x64-musl/-/rollup-linux-x64-musl-4.19.1.tgz",
- "integrity": "sha512-V7cBw/cKXMfEVhpSvVZhC+iGifD6U1zJ4tbibjjN+Xi3blSXaj/rJynAkCFFQfoG6VZrAiP7uGVzL440Q6Me2Q==",
+ "version": "4.19.2",
+ "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-x64-musl/-/rollup-linux-x64-musl-4.19.2.tgz",
+ "integrity": "sha512-5V3mPpWkB066XZZBgSd1lwozBk7tmOkKtquyCJ6T4LN3mzKENXyBwWNQn8d0Ci81hvlBw5RoFgleVpL6aScLYg==",
"cpu": [
"x64"
],
@@ -3180,9 +3347,9 @@
]
},
"node_modules/@rollup/rollup-win32-arm64-msvc": {
- "version": "4.19.1",
- "resolved": "https://registry.npmjs.org/@rollup/rollup-win32-arm64-msvc/-/rollup-win32-arm64-msvc-4.19.1.tgz",
- "integrity": "sha512-88brja2vldW/76jWATlBqHEoGjJLRnP0WOEKAUbMcXaAZnemNhlAHSyj4jIwMoP2T750LE9lblvD4e2jXleZsA==",
+ "version": "4.19.2",
+ "resolved": "https://registry.npmjs.org/@rollup/rollup-win32-arm64-msvc/-/rollup-win32-arm64-msvc-4.19.2.tgz",
+ "integrity": "sha512-ayVstadfLeeXI9zUPiKRVT8qF55hm7hKa+0N1V6Vj+OTNFfKSoUxyZvzVvgtBxqSb5URQ8sK6fhwxr9/MLmxdA==",
"cpu": [
"arm64"
],
@@ -3193,9 +3360,9 @@
]
},
"node_modules/@rollup/rollup-win32-ia32-msvc": {
- "version": "4.19.1",
- "resolved": "https://registry.npmjs.org/@rollup/rollup-win32-ia32-msvc/-/rollup-win32-ia32-msvc-4.19.1.tgz",
- "integrity": "sha512-LdxxcqRVSXi6k6JUrTah1rHuaupoeuiv38du8Mt4r4IPer3kwlTo+RuvfE8KzZ/tL6BhaPlzJ3835i6CxrFIRQ==",
+ "version": "4.19.2",
+ "resolved": "https://registry.npmjs.org/@rollup/rollup-win32-ia32-msvc/-/rollup-win32-ia32-msvc-4.19.2.tgz",
+ "integrity": "sha512-Mda7iG4fOLHNsPqjWSjANvNZYoW034yxgrndof0DwCy0D3FvTjeNo+HGE6oGWgvcLZNLlcp0hLEFcRs+UGsMLg==",
"cpu": [
"ia32"
],
@@ -3206,9 +3373,9 @@
]
},
"node_modules/@rollup/rollup-win32-x64-msvc": {
- "version": "4.19.1",
- "resolved": "https://registry.npmjs.org/@rollup/rollup-win32-x64-msvc/-/rollup-win32-x64-msvc-4.19.1.tgz",
- "integrity": "sha512-2bIrL28PcK3YCqD9anGxDxamxdiJAxA+l7fWIwM5o8UqNy1t3d1NdAweO2XhA0KTDJ5aH1FsuiT5+7VhtHliXg==",
+ "version": "4.19.2",
+ "resolved": "https://registry.npmjs.org/@rollup/rollup-win32-x64-msvc/-/rollup-win32-x64-msvc-4.19.2.tgz",
+ "integrity": "sha512-DPi0ubYhSow/00YqmG1jWm3qt1F8aXziHc/UNy8bo9cpCacqhuWu+iSq/fp2SyEQK7iYTZ60fBU9cat3MXTjIQ==",
"cpu": [
"x64"
],
@@ -3331,6 +3498,24 @@
"string-argv": "~0.3.1"
}
},
+ "node_modules/@sec-ant/readable-stream": {
+ "version": "0.4.1",
+ "resolved": "https://registry.npmjs.org/@sec-ant/readable-stream/-/readable-stream-0.4.1.tgz",
+ "integrity": "sha512-831qok9r2t8AlxLko40y2ebgSDhenenCatLVeW/uBtnHPyhHOvG0C7TvfgecV+wHzIm5KUICgzmVpWS+IMEAeg==",
+ "dev": true
+ },
+ "node_modules/@sindresorhus/merge-streams": {
+ "version": "4.0.0",
+ "resolved": "https://registry.npmjs.org/@sindresorhus/merge-streams/-/merge-streams-4.0.0.tgz",
+ "integrity": "sha512-tlqY9xq5ukxTUZBmoOp+m61cqwQD5pHJtFY3Mn8CA8ps6yghLH/Hw8UPdqg4OLmFW3IFlcXnQNmo/dh8HzXYIQ==",
+ "dev": true,
+ "engines": {
+ "node": ">=18"
+ },
+ "funding": {
+ "url": "https://github.com/sponsors/sindresorhus"
+ }
+ },
"node_modules/@snyk/github-codeowners": {
"version": "1.1.0",
"resolved": "https://registry.npmjs.org/@snyk/github-codeowners/-/github-codeowners-1.1.0.tgz",
@@ -3358,14 +3543,14 @@
}
},
"node_modules/@stryker-mutator/api": {
- "version": "8.2.6",
- "resolved": "https://registry.npmjs.org/@stryker-mutator/api/-/api-8.2.6.tgz",
- "integrity": "sha512-ygPT37teKh2Ei3sj+cs+kNpaFiz0JyelSDEz4GiQXu8DXy79D0oglSFAKsiVBdzO6MD2eRtyclovfdr/OdPVwA==",
+ "version": "8.3.0",
+ "resolved": "https://registry.npmjs.org/@stryker-mutator/api/-/api-8.3.0.tgz",
+ "integrity": "sha512-sYCf0xgD0smLvqlMI+HJuvgMuRzSWJa8H3RIq98UwC8cBBpYVDbUw7WMunsqaSGPDuRfCMnfvpRPiGzP6UqW/A==",
"dev": true,
"dependencies": {
- "mutation-testing-metrics": "3.0.2",
- "mutation-testing-report-schema": "3.0.2",
- "tslib": "~2.6.2",
+ "mutation-testing-metrics": "3.1.1",
+ "mutation-testing-report-schema": "3.1.1",
+ "tslib": "~2.6.3",
"typed-inject": "~4.0.0"
},
"engines": {
@@ -3373,39 +3558,39 @@
}
},
"node_modules/@stryker-mutator/core": {
- "version": "8.2.6",
- "resolved": "https://registry.npmjs.org/@stryker-mutator/core/-/core-8.2.6.tgz",
- "integrity": "sha512-F3JaVOJn+m2xEzNXFrdWl0/34WOnnqjrBADyvxTfoejP8k/oz6R89+QPrR8RwuhTVZUdrmakNkHRPXh9CsaWkw==",
+ "version": "8.3.0",
+ "resolved": "https://registry.npmjs.org/@stryker-mutator/core/-/core-8.3.0.tgz",
+ "integrity": "sha512-GF02YcEQ1ErHKCSwG2pEt1e8K6YQOsOEBcuBW3ZONeqZ55qoRtL6tisVuz82gHDaBR4DXctSKPjAVB5VLSY2vw==",
"dev": true,
"dependencies": {
- "@stryker-mutator/api": "8.2.6",
- "@stryker-mutator/instrumenter": "8.2.6",
- "@stryker-mutator/util": "8.2.6",
- "ajv": "~8.12.0",
+ "@inquirer/prompts": "^5.3.6",
+ "@stryker-mutator/api": "8.3.0",
+ "@stryker-mutator/instrumenter": "8.3.0",
+ "@stryker-mutator/util": "8.3.0",
+ "ajv": "~8.17.1",
"chalk": "~5.3.0",
- "commander": "~12.0.0",
+ "commander": "~12.1.0",
"diff-match-patch": "1.0.5",
"emoji-regex": "~10.3.0",
- "execa": "~8.0.1",
+ "execa": "~9.3.0",
"file-url": "~4.0.0",
- "get-port": "~7.0.0",
- "glob": "~10.3.10",
- "inquirer": "~9.2.13",
+ "get-port": "~7.1.0",
+ "glob": "~11.0.0",
"lodash.groupby": "~4.6.0",
"log4js": "~6.9.1",
- "minimatch": "~9.0.3",
- "mutation-testing-elements": "3.0.2",
- "mutation-testing-metrics": "3.0.2",
- "mutation-testing-report-schema": "3.0.2",
+ "minimatch": "~10.0.1",
+ "mutation-testing-elements": "3.1.1",
+ "mutation-testing-metrics": "3.1.1",
+ "mutation-testing-report-schema": "3.1.1",
"npm-run-path": "~5.3.0",
"progress": "~2.0.3",
"rxjs": "~7.8.1",
- "semver": "^7.5.4",
+ "semver": "^7.6.3",
"source-map": "~0.7.4",
"tree-kill": "~1.2.2",
- "tslib": "2.6.2",
+ "tslib": "2.6.3",
"typed-inject": "~4.0.0",
- "typed-rest-client": "~1.8.11"
+ "typed-rest-client": "~2.0.2"
},
"bin": {
"stryker": "bin/stryker.js"
@@ -3414,6 +3599,22 @@
"node": ">=18.0.0"
}
},
+ "node_modules/@stryker-mutator/core/node_modules/ajv": {
+ "version": "8.17.1",
+ "resolved": "https://registry.npmjs.org/ajv/-/ajv-8.17.1.tgz",
+ "integrity": "sha512-B/gBuNg5SiMTrPkC+A2+cW0RszwxYmn6VYxB/inlBStS5nx6xHIt/ehKRhIMhqusl7a8LjQoZnjCs5vhwxOQ1g==",
+ "dev": true,
+ "dependencies": {
+ "fast-deep-equal": "^3.1.3",
+ "fast-uri": "^3.0.1",
+ "json-schema-traverse": "^1.0.0",
+ "require-from-string": "^2.0.2"
+ },
+ "funding": {
+ "type": "github",
+ "url": "https://github.com/sponsors/epoberezkin"
+ }
+ },
"node_modules/@stryker-mutator/core/node_modules/brace-expansion": {
"version": "2.0.1",
"resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-2.0.1.tgz",
@@ -3436,37 +3637,81 @@
}
},
"node_modules/@stryker-mutator/core/node_modules/glob": {
- "version": "10.3.16",
- "resolved": "https://registry.npmjs.org/glob/-/glob-10.3.16.tgz",
- "integrity": "sha512-JDKXl1DiuuHJ6fVS2FXjownaavciiHNUU4mOvV/B793RLh05vZL1rcPnCSaOgv1hDT6RDlY7AB7ZUvFYAtPgAw==",
+ "version": "11.0.0",
+ "resolved": "https://registry.npmjs.org/glob/-/glob-11.0.0.tgz",
+ "integrity": "sha512-9UiX/Bl6J2yaBbxKoEBRm4Cipxgok8kQYcOPEhScPwebu2I0HoQOuYdIO6S3hLuWoZgpDpwQZMzTFxgpkyT76g==",
"dev": true,
"dependencies": {
"foreground-child": "^3.1.0",
- "jackspeak": "^3.1.2",
- "minimatch": "^9.0.1",
- "minipass": "^7.0.4",
- "path-scurry": "^1.11.0"
+ "jackspeak": "^4.0.1",
+ "minimatch": "^10.0.0",
+ "minipass": "^7.1.2",
+ "package-json-from-dist": "^1.0.0",
+ "path-scurry": "^2.0.0"
},
"bin": {
"glob": "dist/esm/bin.mjs"
},
"engines": {
- "node": ">=16 || 14 >=14.18"
+ "node": "20 || >=22"
+ },
+ "funding": {
+ "url": "https://github.com/sponsors/isaacs"
+ }
+ },
+ "node_modules/@stryker-mutator/core/node_modules/jackspeak": {
+ "version": "4.0.1",
+ "resolved": "https://registry.npmjs.org/jackspeak/-/jackspeak-4.0.1.tgz",
+ "integrity": "sha512-cub8rahkh0Q/bw1+GxP7aeSe29hHHn2V4m29nnDlvCdlgU+3UGxkZp7Z53jLUdpX3jdTO0nJZUDl3xvbWc2Xog==",
+ "dev": true,
+ "dependencies": {
+ "@isaacs/cliui": "^8.0.2"
+ },
+ "engines": {
+ "node": "20 || >=22"
},
"funding": {
"url": "https://github.com/sponsors/isaacs"
+ },
+ "optionalDependencies": {
+ "@pkgjs/parseargs": "^0.11.0"
+ }
+ },
+ "node_modules/@stryker-mutator/core/node_modules/lru-cache": {
+ "version": "11.0.0",
+ "resolved": "https://registry.npmjs.org/lru-cache/-/lru-cache-11.0.0.tgz",
+ "integrity": "sha512-Qv32eSV1RSCfhY3fpPE2GNZ8jgM9X7rdAfemLWqTUxwiyIC4jJ6Sy0fZ8H+oLWevO6i4/bizg7c8d8i6bxrzbA==",
+ "dev": true,
+ "engines": {
+ "node": "20 || >=22"
}
},
"node_modules/@stryker-mutator/core/node_modules/minimatch": {
- "version": "9.0.5",
- "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-9.0.5.tgz",
- "integrity": "sha512-G6T0ZX48xgozx7587koeX9Ys2NYy6Gmv//P89sEte9V9whIapMNF4idKxnW2QtCcLiTWlb/wfCabAtAFWhhBow==",
+ "version": "10.0.1",
+ "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-10.0.1.tgz",
+ "integrity": "sha512-ethXTt3SGGR+95gudmqJ1eNhRO7eGEGIgYA9vnPatK4/etz2MEVDno5GMCibdMTuBMyElzIlgxMna3K94XDIDQ==",
"dev": true,
"dependencies": {
"brace-expansion": "^2.0.1"
},
"engines": {
- "node": ">=16 || 14 >=14.17"
+ "node": "20 || >=22"
+ },
+ "funding": {
+ "url": "https://github.com/sponsors/isaacs"
+ }
+ },
+ "node_modules/@stryker-mutator/core/node_modules/path-scurry": {
+ "version": "2.0.0",
+ "resolved": "https://registry.npmjs.org/path-scurry/-/path-scurry-2.0.0.tgz",
+ "integrity": "sha512-ypGJsmGtdXUOeM5u93TyeIEfEhM6s+ljAhrk5vAvSx8uyY/02OvrZnA0YNGUrPXfpJMgI1ODd3nwz8Npx4O4cg==",
+ "dev": true,
+ "dependencies": {
+ "lru-cache": "^11.0.0",
+ "minipass": "^7.1.2"
+ },
+ "engines": {
+ "node": "20 || >=22"
},
"funding": {
"url": "https://github.com/sponsors/isaacs"
@@ -3493,115 +3738,43 @@
"node": ">= 8"
}
},
- "node_modules/@stryker-mutator/core/node_modules/tslib": {
- "version": "2.6.2",
- "resolved": "https://registry.npmjs.org/tslib/-/tslib-2.6.2.tgz",
- "integrity": "sha512-AEYxH93jGFPn/a2iVAwW87VuUIkR1FVUKB77NwMF7nBTDkDrrT/Hpt/IrCJ0QXhW27jTBDcf5ZY7w6RiqTMw2Q==",
- "dev": true
- },
"node_modules/@stryker-mutator/instrumenter": {
- "version": "8.2.6",
- "resolved": "https://registry.npmjs.org/@stryker-mutator/instrumenter/-/instrumenter-8.2.6.tgz",
- "integrity": "sha512-2o9ffO4yBxAtCbnOsOAojQmBI4IZcFTCMW9o7CaTThNTQ6j/8gLaU1suxt3IPCRGl30rph0skBAyKiiWaUVhMw==",
+ "version": "8.3.0",
+ "resolved": "https://registry.npmjs.org/@stryker-mutator/instrumenter/-/instrumenter-8.3.0.tgz",
+ "integrity": "sha512-EdXCD7KPaNBaqnX0+GTaTFcUDJPtAo2kBaUjz+pVZlMXLHiUtLSuVQjbl0kjC5pyV3olU5P3kapCn3DNaG1Cwg==",
"dev": true,
"dependencies": {
- "@babel/core": "~7.23.9",
- "@babel/generator": "~7.23.6",
- "@babel/parser": "~7.23.9",
- "@babel/plugin-proposal-decorators": "~7.23.9",
- "@babel/preset-typescript": "~7.23.3",
- "@stryker-mutator/api": "8.2.6",
- "@stryker-mutator/util": "8.2.6",
- "angular-html-parser": "~5.2.0",
- "semver": "~7.6.0",
- "weapon-regex": "~1.3.0"
+ "@babel/core": "~7.25.2",
+ "@babel/generator": "~7.25.0",
+ "@babel/parser": "~7.25.0",
+ "@babel/plugin-proposal-decorators": "~7.24.7",
+ "@babel/preset-typescript": "~7.24.7",
+ "@stryker-mutator/api": "8.3.0",
+ "@stryker-mutator/util": "8.3.0",
+ "angular-html-parser": "~6.0.2",
+ "semver": "~7.6.3",
+ "weapon-regex": "~1.3.2"
},
"engines": {
"node": ">=18.0.0"
}
},
- "node_modules/@stryker-mutator/instrumenter/node_modules/@babel/core": {
- "version": "7.23.9",
- "resolved": "https://registry.npmjs.org/@babel/core/-/core-7.23.9.tgz",
- "integrity": "sha512-5q0175NOjddqpvvzU+kDiSOAk4PfdO6FvwCWoQ6RO7rTzEe8vlo+4HVfcnAREhD4npMs0e9uZypjTwzZPCf/cw==",
+ "node_modules/@stryker-mutator/instrumenter/node_modules/semver": {
+ "version": "7.6.3",
+ "resolved": "https://registry.npmjs.org/semver/-/semver-7.6.3.tgz",
+ "integrity": "sha512-oVekP1cKtI+CTDvHWYFUcMtsK/00wmAEfyqKfNdARm8u1wNVhSgaX7A8d4UuIlUI5e84iEwOhs7ZPYRmzU9U6A==",
"dev": true,
- "dependencies": {
- "@ampproject/remapping": "^2.2.0",
- "@babel/code-frame": "^7.23.5",
- "@babel/generator": "^7.23.6",
- "@babel/helper-compilation-targets": "^7.23.6",
- "@babel/helper-module-transforms": "^7.23.3",
- "@babel/helpers": "^7.23.9",
- "@babel/parser": "^7.23.9",
- "@babel/template": "^7.23.9",
- "@babel/traverse": "^7.23.9",
- "@babel/types": "^7.23.9",
- "convert-source-map": "^2.0.0",
- "debug": "^4.1.0",
- "gensync": "^1.0.0-beta.2",
- "json5": "^2.2.3",
- "semver": "^6.3.1"
+ "bin": {
+ "semver": "bin/semver.js"
},
"engines": {
- "node": ">=6.9.0"
- },
- "funding": {
- "type": "opencollective",
- "url": "https://opencollective.com/babel"
- }
- },
- "node_modules/@stryker-mutator/instrumenter/node_modules/@babel/core/node_modules/semver": {
- "version": "6.3.1",
- "resolved": "https://registry.npmjs.org/semver/-/semver-6.3.1.tgz",
- "integrity": "sha512-BR7VvDCVHO+q2xBEWskxS6DJE1qRnb7DxzUrogb71CWoSficBxYsiAGd+Kl0mmq/MprG9yArRkyrQxTO6XjMzA==",
- "dev": true,
- "bin": {
- "semver": "bin/semver.js"
- }
- },
- "node_modules/@stryker-mutator/instrumenter/node_modules/@babel/generator": {
- "version": "7.23.6",
- "resolved": "https://registry.npmjs.org/@babel/generator/-/generator-7.23.6.tgz",
- "integrity": "sha512-qrSfCYxYQB5owCmGLbl8XRpX1ytXlpueOb0N0UmQwA073KZxejgQTzAmJezxvpwQD9uGtK2shHdi55QT+MbjIw==",
- "dev": true,
- "dependencies": {
- "@babel/types": "^7.23.6",
- "@jridgewell/gen-mapping": "^0.3.2",
- "@jridgewell/trace-mapping": "^0.3.17",
- "jsesc": "^2.5.1"
- },
- "engines": {
- "node": ">=6.9.0"
- }
- },
- "node_modules/@stryker-mutator/instrumenter/node_modules/@babel/parser": {
- "version": "7.23.9",
- "resolved": "https://registry.npmjs.org/@babel/parser/-/parser-7.23.9.tgz",
- "integrity": "sha512-9tcKgqKbs3xGJ+NtKF2ndOBBLVwPjl1SHxPQkd36r3Dlirw3xWUeGaTbqr7uGZcTaxkVNwc+03SVP7aCdWrTlA==",
- "dev": true,
- "bin": {
- "parser": "bin/babel-parser.js"
- },
- "engines": {
- "node": ">=6.0.0"
- }
- },
- "node_modules/@stryker-mutator/instrumenter/node_modules/semver": {
- "version": "7.6.3",
- "resolved": "https://registry.npmjs.org/semver/-/semver-7.6.3.tgz",
- "integrity": "sha512-oVekP1cKtI+CTDvHWYFUcMtsK/00wmAEfyqKfNdARm8u1wNVhSgaX7A8d4UuIlUI5e84iEwOhs7ZPYRmzU9U6A==",
- "dev": true,
- "bin": {
- "semver": "bin/semver.js"
- },
- "engines": {
- "node": ">=10"
+ "node": ">=10"
}
},
"node_modules/@stryker-mutator/util": {
- "version": "8.2.6",
- "resolved": "https://registry.npmjs.org/@stryker-mutator/util/-/util-8.2.6.tgz",
- "integrity": "sha512-2jmSYmrbGqt59JBkv1TvoOwQpUccCL3c90FLZIWg1zBNwj6zeOrwh734E5dKswDaC+BudQ3FtwlWB5augSuo1w==",
+ "version": "8.3.0",
+ "resolved": "https://registry.npmjs.org/@stryker-mutator/util/-/util-8.3.0.tgz",
+ "integrity": "sha512-750ldEV3CRdDuBhxD1c2HEY4CYW4oz45u6Hm0Ca/FVefU4tCWYwf9kS87khw3FZGZC/gbkI6Xn3fGnXYyHa+cA==",
"dev": true
},
"node_modules/@tootallnate/quickjs-emscripten": {
@@ -3622,13 +3795,22 @@
"integrity": "sha512-/kYRxGDLWzHOB7q+wtSUQlFrtcdUccpfy+X+9iMBpHK8QLLhx2wIPYuS5DYtR9Wa/YlZAbIovy7qVdB1Aq6Lyw==",
"dev": true
},
+ "node_modules/@types/mute-stream": {
+ "version": "0.0.4",
+ "resolved": "https://registry.npmjs.org/@types/mute-stream/-/mute-stream-0.0.4.tgz",
+ "integrity": "sha512-CPM9nzrCPPJHQNA9keH9CVkVI+WR5kMa+7XEs5jcGQ0VoAGnLv242w8lIVgwAEfmE4oufJRaTc9PNLQl0ioAow==",
+ "dev": true,
+ "dependencies": {
+ "@types/node": "*"
+ }
+ },
"node_modules/@types/node": {
- "version": "22.0.0",
- "resolved": "https://registry.npmjs.org/@types/node/-/node-22.0.0.tgz",
- "integrity": "sha512-VT7KSYudcPOzP5Q0wfbowyNLaVR8QWUdw+088uFWwfvpY6uCWaXpqV6ieLAu9WBcnTa7H4Z5RLK8I5t2FuOcqw==",
+ "version": "22.1.0",
+ "resolved": "https://registry.npmjs.org/@types/node/-/node-22.1.0.tgz",
+ "integrity": "sha512-AOmuRF0R2/5j1knA3c6G3HOk523Ga+l+ZXltX8SF1+5oqcXijjfTd8fY3XRZqSihEu9XhtQnKYLmkFaoxgsJHw==",
"dev": true,
"dependencies": {
- "undici-types": "~6.11.1"
+ "undici-types": "~6.13.0"
}
},
"node_modules/@types/resolve": {
@@ -3637,6 +3819,12 @@
"integrity": "sha512-60BCwRFOZCQhDncwQdxxeOEEkbc5dIMccYLwbxsS4TUNeVECQ/pBJ0j09mrHOl/JJvpRPGwO9SvE4nR2Nb/a4Q==",
"dev": true
},
+ "node_modules/@types/wrap-ansi": {
+ "version": "3.0.0",
+ "resolved": "https://registry.npmjs.org/@types/wrap-ansi/-/wrap-ansi-3.0.0.tgz",
+ "integrity": "sha512-ltIpx+kM7g/MLRZfkbL7EsCEjfzCcScLpkg37eXEtx5kmrAKBkTJwd1GIAjDSL8wTpM6Hzn5YO4pSb91BEwu1g==",
+ "dev": true
+ },
"node_modules/@types/yauzl": {
"version": "2.10.3",
"resolved": "https://registry.npmjs.org/@types/yauzl/-/yauzl-2.10.3.tgz",
@@ -3648,16 +3836,16 @@
}
},
"node_modules/@typescript-eslint/eslint-plugin": {
- "version": "8.0.0-alpha.58",
- "resolved": "https://registry.npmjs.org/@typescript-eslint/eslint-plugin/-/eslint-plugin-8.0.0-alpha.58.tgz",
- "integrity": "sha512-5G9oIj8jvosj8RTa0VDFXvRmUg1U6FxXJu7ZEfyJYMvFkdMJoY5YnzFvgAvHbYsXOj+YgXZu81fNOTRWQzwk5A==",
+ "version": "8.0.0",
+ "resolved": "https://registry.npmjs.org/@typescript-eslint/eslint-plugin/-/eslint-plugin-8.0.0.tgz",
+ "integrity": "sha512-STIZdwEQRXAHvNUS6ILDf5z3u95Gc8jzywunxSNqX00OooIemaaNIA0vEgynJlycL5AjabYLLrIyHd4iazyvtg==",
"dev": true,
"dependencies": {
"@eslint-community/regexpp": "^4.10.0",
- "@typescript-eslint/scope-manager": "8.0.0-alpha.58",
- "@typescript-eslint/type-utils": "8.0.0-alpha.58",
- "@typescript-eslint/utils": "8.0.0-alpha.58",
- "@typescript-eslint/visitor-keys": "8.0.0-alpha.58",
+ "@typescript-eslint/scope-manager": "8.0.0",
+ "@typescript-eslint/type-utils": "8.0.0",
+ "@typescript-eslint/utils": "8.0.0",
+ "@typescript-eslint/visitor-keys": "8.0.0",
"graphemer": "^1.4.0",
"ignore": "^5.3.1",
"natural-compare": "^1.4.0",
@@ -3681,15 +3869,15 @@
}
},
"node_modules/@typescript-eslint/parser": {
- "version": "8.0.0-alpha.58",
- "resolved": "https://registry.npmjs.org/@typescript-eslint/parser/-/parser-8.0.0-alpha.58.tgz",
- "integrity": "sha512-/RpgxIejBui6WXJgV9ukwzxmvbZt5TlfHUGGLB/BsNLj+NRZEbXVtWT9rKuxVOqsGb1Dn9c5gxvBI/XzyuIsMQ==",
+ "version": "8.0.0",
+ "resolved": "https://registry.npmjs.org/@typescript-eslint/parser/-/parser-8.0.0.tgz",
+ "integrity": "sha512-pS1hdZ+vnrpDIxuFXYQpLTILglTjSYJ9MbetZctrUawogUsPdz31DIIRZ9+rab0LhYNTsk88w4fIzVheiTbWOQ==",
"dev": true,
"dependencies": {
- "@typescript-eslint/scope-manager": "8.0.0-alpha.58",
- "@typescript-eslint/types": "8.0.0-alpha.58",
- "@typescript-eslint/typescript-estree": "8.0.0-alpha.58",
- "@typescript-eslint/visitor-keys": "8.0.0-alpha.58",
+ "@typescript-eslint/scope-manager": "8.0.0",
+ "@typescript-eslint/types": "8.0.0",
+ "@typescript-eslint/typescript-estree": "8.0.0",
+ "@typescript-eslint/visitor-keys": "8.0.0",
"debug": "^4.3.4"
},
"engines": {
@@ -3709,13 +3897,13 @@
}
},
"node_modules/@typescript-eslint/scope-manager": {
- "version": "8.0.0-alpha.58",
- "resolved": "https://registry.npmjs.org/@typescript-eslint/scope-manager/-/scope-manager-8.0.0-alpha.58.tgz",
- "integrity": "sha512-bGgJXn8B3Pf3mzEOUQTPxEqhux54MOJSqw4HcgBReuP7dudz/hsN4TH9GqHbMXkFv8N4Ed1iqVRfgGeC8b1mGw==",
+ "version": "8.0.0",
+ "resolved": "https://registry.npmjs.org/@typescript-eslint/scope-manager/-/scope-manager-8.0.0.tgz",
+ "integrity": "sha512-V0aa9Csx/ZWWv2IPgTfY7T4agYwJyILESu/PVqFtTFz9RIS823mAze+NbnBI8xiwdX3iqeQbcTYlvB04G9wyQw==",
"dev": true,
"dependencies": {
- "@typescript-eslint/types": "8.0.0-alpha.58",
- "@typescript-eslint/visitor-keys": "8.0.0-alpha.58"
+ "@typescript-eslint/types": "8.0.0",
+ "@typescript-eslint/visitor-keys": "8.0.0"
},
"engines": {
"node": "^18.18.0 || ^20.9.0 || >=21.1.0"
@@ -3726,13 +3914,13 @@
}
},
"node_modules/@typescript-eslint/type-utils": {
- "version": "8.0.0-alpha.58",
- "resolved": "https://registry.npmjs.org/@typescript-eslint/type-utils/-/type-utils-8.0.0-alpha.58.tgz",
- "integrity": "sha512-spW/I/UAY6HM0lKj+/333Zb9arOvUoi8+H0cVNYHELPhOti9re9NjyyJFhck84PNiwi8WmpkEf3GXe7/h+Cquw==",
+ "version": "8.0.0",
+ "resolved": "https://registry.npmjs.org/@typescript-eslint/type-utils/-/type-utils-8.0.0.tgz",
+ "integrity": "sha512-mJAFP2mZLTBwAn5WI4PMakpywfWFH5nQZezUQdSKV23Pqo6o9iShQg1hP2+0hJJXP2LnZkWPphdIq4juYYwCeg==",
"dev": true,
"dependencies": {
- "@typescript-eslint/typescript-estree": "8.0.0-alpha.58",
- "@typescript-eslint/utils": "8.0.0-alpha.58",
+ "@typescript-eslint/typescript-estree": "8.0.0",
+ "@typescript-eslint/utils": "8.0.0",
"debug": "^4.3.4",
"ts-api-utils": "^1.3.0"
},
@@ -3750,9 +3938,9 @@
}
},
"node_modules/@typescript-eslint/types": {
- "version": "8.0.0-alpha.58",
- "resolved": "https://registry.npmjs.org/@typescript-eslint/types/-/types-8.0.0-alpha.58.tgz",
- "integrity": "sha512-6+jM4y31a6pwKeV3MVQuVXPZl6d3I1ySMvP5WjZdZ+n57uovMvasZ3ZJstXngoRpa7JtkjVZ7NrMhQ1J8dxKCQ==",
+ "version": "8.0.0",
+ "resolved": "https://registry.npmjs.org/@typescript-eslint/types/-/types-8.0.0.tgz",
+ "integrity": "sha512-wgdSGs9BTMWQ7ooeHtu5quddKKs5Z5dS+fHLbrQI+ID0XWJLODGMHRfhwImiHoeO2S5Wir2yXuadJN6/l4JRxw==",
"dev": true,
"engines": {
"node": "^18.18.0 || ^20.9.0 || >=21.1.0"
@@ -3763,13 +3951,13 @@
}
},
"node_modules/@typescript-eslint/typescript-estree": {
- "version": "8.0.0-alpha.58",
- "resolved": "https://registry.npmjs.org/@typescript-eslint/typescript-estree/-/typescript-estree-8.0.0-alpha.58.tgz",
- "integrity": "sha512-hm4nsoJnQcA7axMopUJrH7CD0MJhAMtE2zQt65uMFCy+U2YDdKPwE0g6qEAUBoKn6UBLQJWthJgUmwDbWrnwZg==",
+ "version": "8.0.0",
+ "resolved": "https://registry.npmjs.org/@typescript-eslint/typescript-estree/-/typescript-estree-8.0.0.tgz",
+ "integrity": "sha512-5b97WpKMX+Y43YKi4zVcCVLtK5F98dFls3Oxui8LbnmRsseKenbbDinmvxrWegKDMmlkIq/XHuyy0UGLtpCDKg==",
"dev": true,
"dependencies": {
- "@typescript-eslint/types": "8.0.0-alpha.58",
- "@typescript-eslint/visitor-keys": "8.0.0-alpha.58",
+ "@typescript-eslint/types": "8.0.0",
+ "@typescript-eslint/visitor-keys": "8.0.0",
"debug": "^4.3.4",
"globby": "^11.1.0",
"is-glob": "^4.0.3",
@@ -3827,15 +4015,15 @@
}
},
"node_modules/@typescript-eslint/utils": {
- "version": "8.0.0-alpha.58",
- "resolved": "https://registry.npmjs.org/@typescript-eslint/utils/-/utils-8.0.0-alpha.58.tgz",
- "integrity": "sha512-lZuGnpK23jr3huebgY4/qqrOKsWJ8dX0Q1Fo4oVYcyAy+sK6p+6nObK4VEPJG098gUmrriiavRiDKIhPDFm4Ig==",
+ "version": "8.0.0",
+ "resolved": "https://registry.npmjs.org/@typescript-eslint/utils/-/utils-8.0.0.tgz",
+ "integrity": "sha512-k/oS/A/3QeGLRvOWCg6/9rATJL5rec7/5s1YmdS0ZU6LHveJyGFwBvLhSRBv6i9xaj7etmosp+l+ViN1I9Aj/Q==",
"dev": true,
"dependencies": {
"@eslint-community/eslint-utils": "^4.4.0",
- "@typescript-eslint/scope-manager": "8.0.0-alpha.58",
- "@typescript-eslint/types": "8.0.0-alpha.58",
- "@typescript-eslint/typescript-estree": "8.0.0-alpha.58"
+ "@typescript-eslint/scope-manager": "8.0.0",
+ "@typescript-eslint/types": "8.0.0",
+ "@typescript-eslint/typescript-estree": "8.0.0"
},
"engines": {
"node": "^18.18.0 || ^20.9.0 || >=21.1.0"
@@ -3849,12 +4037,12 @@
}
},
"node_modules/@typescript-eslint/visitor-keys": {
- "version": "8.0.0-alpha.58",
- "resolved": "https://registry.npmjs.org/@typescript-eslint/visitor-keys/-/visitor-keys-8.0.0-alpha.58.tgz",
- "integrity": "sha512-V//E9PRY2216kh9fN/ihRvTtjpobAXEtmrsr3utlVUwHa2iklcofq1J12yl3KOjx9QBRfBrtfQnYaeruF7L0Fw==",
+ "version": "8.0.0",
+ "resolved": "https://registry.npmjs.org/@typescript-eslint/visitor-keys/-/visitor-keys-8.0.0.tgz",
+ "integrity": "sha512-oN0K4nkHuOyF3PVMyETbpP5zp6wfyOvm7tWhTMfoqxSSsPmJIh6JNASuZDlODE8eE+0EB9uar+6+vxr9DBTYOA==",
"dev": true,
"dependencies": {
- "@typescript-eslint/types": "8.0.0-alpha.58",
+ "@typescript-eslint/types": "8.0.0",
"eslint-visitor-keys": "^3.4.3"
},
"engines": {
@@ -3878,9 +4066,9 @@
}
},
"node_modules/@webref/css": {
- "version": "6.14.0",
- "resolved": "https://registry.npmjs.org/@webref/css/-/css-6.14.0.tgz",
- "integrity": "sha512-TINJdJXcq/TpGD78Qosjzt9Un0Hw6giqJgq1PkCvNpvS5D16UeMrKeR/nS8lt+xBPkAylusXdYt390YiBgUMXA==",
+ "version": "6.14.1",
+ "resolved": "https://registry.npmjs.org/@webref/css/-/css-6.14.1.tgz",
+ "integrity": "sha512-269+WydfyUJLJOsDOV77uobzRWuyc9QbjmvJ24ffyZJm8XbrSWSE1WMpYu2me4KsvKr6dqIAwXMKzGuPi8bz9g==",
"dev": true,
"peerDependencies": {
"css-tree": "^2.3.1"
@@ -3980,9 +4168,9 @@
}
},
"node_modules/angular-html-parser": {
- "version": "5.2.0",
- "resolved": "https://registry.npmjs.org/angular-html-parser/-/angular-html-parser-5.2.0.tgz",
- "integrity": "sha512-8S/8g5iMcuGhRmBUJ+xuXm9hdjqIcaky2z52RA7tSyz9tWN0mgiP/JR9+kx/SiS1REJpTXnEKpMCMEeVVIeo3A==",
+ "version": "6.0.2",
+ "resolved": "https://registry.npmjs.org/angular-html-parser/-/angular-html-parser-6.0.2.tgz",
+ "integrity": "sha512-8+sH1TwYxv8XsQes1psxTHMtWRBbJFA/jY0ThqpT4AgCiRdhTtRxru0vlBfyRJpL9CHd3G06k871bR2vyqaM6A==",
"dev": true,
"dependencies": {
"tslib": "^2.6.2"
@@ -4228,17 +4416,6 @@
"node": ">=10.0.0"
}
},
- "node_modules/bl": {
- "version": "4.1.0",
- "resolved": "https://registry.npmjs.org/bl/-/bl-4.1.0.tgz",
- "integrity": "sha512-1W07cM9gS6DcLperZfFSj+bWLtaPGSOHWhPiGzXmvVJbRLdG82sH/Kn8EtW1VqWVA54AKf2h5k5BbnIbwF3h6w==",
- "dev": true,
- "dependencies": {
- "buffer": "^5.5.0",
- "inherits": "^2.0.4",
- "readable-stream": "^3.4.0"
- }
- },
"node_modules/brace-expansion": {
"version": "1.1.11",
"resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-1.1.11.tgz",
@@ -4262,9 +4439,9 @@
}
},
"node_modules/browserslist": {
- "version": "4.23.2",
- "resolved": "https://registry.npmjs.org/browserslist/-/browserslist-4.23.2.tgz",
- "integrity": "sha512-qkqSyistMYdxAcw+CzbZwlBy8AGmS/eEWs+sEV5TnLRGDOL+C5M2EnH6tlZyg0YoAxGJAFKh61En9BR941GnHA==",
+ "version": "4.23.3",
+ "resolved": "https://registry.npmjs.org/browserslist/-/browserslist-4.23.3.tgz",
+ "integrity": "sha512-btwCFJVjI4YWDNfau8RhZ+B1Q/VLoUITrm3RlP6y1tYGWIOa+InuYiRGXUBXo8nA1qKmHMyLB/iVQg5TT4eFoA==",
"funding": [
{
"type": "opencollective",
@@ -4280,9 +4457,9 @@
}
],
"dependencies": {
- "caniuse-lite": "^1.0.30001640",
- "electron-to-chromium": "^1.4.820",
- "node-releases": "^2.0.14",
+ "caniuse-lite": "^1.0.30001646",
+ "electron-to-chromium": "^1.5.4",
+ "node-releases": "^2.0.18",
"update-browserslist-db": "^1.1.0"
},
"bin": {
@@ -4372,9 +4549,9 @@
}
},
"node_modules/caniuse-lite": {
- "version": "1.0.30001643",
- "resolved": "https://registry.npmjs.org/caniuse-lite/-/caniuse-lite-1.0.30001643.tgz",
- "integrity": "sha512-ERgWGNleEilSrHM6iUz/zJNSQTP8Mr21wDWpdgvRwcTXGAq6jMtOUPP4dqFPTdKqZ2wKTdtB+uucZ3MRpAUSmg==",
+ "version": "1.0.30001646",
+ "resolved": "https://registry.npmjs.org/caniuse-lite/-/caniuse-lite-1.0.30001646.tgz",
+ "integrity": "sha512-dRg00gudiBDDTmUhClSdv3hqRfpbOnU28IpI1T6PBTLWa+kOj0681C8uML3PifYfREuBrVjDGhL3adYpBT6spw==",
"funding": [
{
"type": "opencollective",
@@ -4432,9 +4609,9 @@
"dev": true
},
"node_modules/chromium-bidi": {
- "version": "0.6.2",
- "resolved": "https://registry.npmjs.org/chromium-bidi/-/chromium-bidi-0.6.2.tgz",
- "integrity": "sha512-4WVBa6ijmUTVr9cZD4eicQD8Mdy/HCX3bzEIYYpmk0glqYLoWH+LqQEvV9RpDRzoQSbY1KJHloYXbDMXMbDPhg==",
+ "version": "0.6.3",
+ "resolved": "https://registry.npmjs.org/chromium-bidi/-/chromium-bidi-0.6.3.tgz",
+ "integrity": "sha512-qXlsCmpCZJAnoTYI83Iu6EdYQpMYdVkCfq08KDh2pmlVqK5t5IA9mGs4/LwCwp4fqisSOMXZxP3HIh8w8aRn0A==",
"dev": true,
"dependencies": {
"mitt": "3.0.1",
@@ -4454,18 +4631,6 @@
"node": ">=6"
}
},
- "node_modules/cli-cursor": {
- "version": "3.1.0",
- "resolved": "https://registry.npmjs.org/cli-cursor/-/cli-cursor-3.1.0.tgz",
- "integrity": "sha512-I/zHAwsKf9FqGoXM4WWRACob9+SNukZTd94DWF57E4toouRulbCxcUh6RKUEOQlYTHJnzkPMySvPNaaSLNfLZw==",
- "dev": true,
- "dependencies": {
- "restore-cursor": "^3.1.0"
- },
- "engines": {
- "node": ">=8"
- }
- },
"node_modules/cli-spinners": {
"version": "2.9.2",
"resolved": "https://registry.npmjs.org/cli-spinners/-/cli-spinners-2.9.2.tgz",
@@ -4534,6 +4699,26 @@
"integrity": "sha512-dOy+3AuW3a2wNbZHIuMZpTcgjGuLU/uBL/ubcZF9OXbDo8ff4O8yVp5Bf0efS8uEoYo5q4Fx7dY9OgQGXgAsQA==",
"dev": true
},
+ "node_modules/cliui/node_modules/emoji-regex": {
+ "version": "8.0.0",
+ "resolved": "https://registry.npmjs.org/emoji-regex/-/emoji-regex-8.0.0.tgz",
+ "integrity": "sha512-MSjYzcWNOA0ewAHpz0MxpYFvwg6yjy1NG3xteoqz644VCo/RPgnr1/GGt+ic3iJTzQ8Eu3TdM14SawnVUmGE6A==",
+ "dev": true
+ },
+ "node_modules/cliui/node_modules/string-width": {
+ "version": "4.2.3",
+ "resolved": "https://registry.npmjs.org/string-width/-/string-width-4.2.3.tgz",
+ "integrity": "sha512-wKyQRQpjJ0sIp62ErSZdGsjMJWsap5oRNihHhu6G7JVO/9jIB6UyevL+tXuOqrng8j/cxKTWyWUwvSTriiZz/g==",
+ "dev": true,
+ "dependencies": {
+ "emoji-regex": "^8.0.0",
+ "is-fullwidth-code-point": "^3.0.0",
+ "strip-ansi": "^6.0.1"
+ },
+ "engines": {
+ "node": ">=8"
+ }
+ },
"node_modules/cliui/node_modules/wrap-ansi": {
"version": "7.0.0",
"resolved": "https://registry.npmjs.org/wrap-ansi/-/wrap-ansi-7.0.0.tgz",
@@ -4556,6 +4741,7 @@
"resolved": "https://registry.npmjs.org/clone/-/clone-1.0.4.tgz",
"integrity": "sha512-JQHZ2QMW6l3aH/j6xCqQThY/9OH4D/9ls34cgkUBiEeocRTU04tHfKPBsUK1PqZCUQM7GiA0IIXJSuXHI64Kbg==",
"dev": true,
+ "optional": true,
"engines": {
"node": ">=0.8"
}
@@ -4582,9 +4768,9 @@
"dev": true
},
"node_modules/commander": {
- "version": "12.0.0",
- "resolved": "https://registry.npmjs.org/commander/-/commander-12.0.0.tgz",
- "integrity": "sha512-MwVNWlYjDTtOjX5PiD7o5pK0UrFU/OYgcJfjjK4RaHZETNtjJqrZa9Y9ds88+A+f+d5lv+561eZ+yCKoS3gbAA==",
+ "version": "12.1.0",
+ "resolved": "https://registry.npmjs.org/commander/-/commander-12.1.0.tgz",
+ "integrity": "sha512-Vw8qHK3bZM9y/P10u3Vib8o/DdkvA2OtPtZvD871QKjy74Wj1WSKFILMPRPSdUSx5RFK1arlJzEtA4PkFgnbuA==",
"dev": true,
"engines": {
"node": ">=18"
@@ -4800,6 +4986,7 @@
"resolved": "https://registry.npmjs.org/defaults/-/defaults-1.0.4.tgz",
"integrity": "sha512-eFuaLoy/Rxalv2kr+lqMlUnrDWV+3j4pljOIJgLIhI058IQfWJ7vXhyEIHu+HtC738klGALYxOKDO0bQP3tg8A==",
"dev": true,
+ "optional": true,
"dependencies": {
"clone": "^1.0.2"
},
@@ -4838,6 +5025,16 @@
"node": ">= 14"
}
},
+ "node_modules/des.js": {
+ "version": "1.1.0",
+ "resolved": "https://registry.npmjs.org/des.js/-/des.js-1.1.0.tgz",
+ "integrity": "sha512-r17GxjhUCjSRy8aiJpr8/UadFIzMzJGexI3Nmz4ADi9LYSFx4gTBp80+NaX/YsXWWLhpZ7v/v/ubEc/bCNfKwg==",
+ "dev": true,
+ "dependencies": {
+ "inherits": "^2.0.1",
+ "minimalistic-assert": "^1.0.0"
+ }
+ },
"node_modules/devtools-protocol": {
"version": "0.0.1312386",
"resolved": "https://registry.npmjs.org/devtools-protocol/-/devtools-protocol-0.0.1312386.tgz",
@@ -4881,9 +5078,9 @@
}
},
"node_modules/electron-to-chromium": {
- "version": "1.5.2",
- "resolved": "https://registry.npmjs.org/electron-to-chromium/-/electron-to-chromium-1.5.2.tgz",
- "integrity": "sha512-kc4r3U3V3WLaaZqThjYz/Y6z8tJe+7K0bbjUVo3i+LWIypVdMx5nXCkwRe6SWbY6ILqLdc1rKcKmr3HoH7wjSQ=="
+ "version": "1.5.4",
+ "resolved": "https://registry.npmjs.org/electron-to-chromium/-/electron-to-chromium-1.5.4.tgz",
+ "integrity": "sha512-orzA81VqLyIGUEA77YkVA1D+N+nNfl2isJVjjmOyrlxuooZ19ynb+dOlaDTqd/idKRS9lDCSBmtzM+kyCsMnkA=="
},
"node_modules/emoji-regex": {
"version": "10.3.0",
@@ -5242,23 +5439,26 @@
}
},
"node_modules/execa": {
- "version": "8.0.1",
- "resolved": "https://registry.npmjs.org/execa/-/execa-8.0.1.tgz",
- "integrity": "sha512-VyhnebXciFV2DESc+p6B+y0LjSm0krU4OgJN44qFAhBY0TJ+1V61tYD2+wHusZ6F9n5K+vl8k0sTy7PEfV4qpg==",
+ "version": "9.3.0",
+ "resolved": "https://registry.npmjs.org/execa/-/execa-9.3.0.tgz",
+ "integrity": "sha512-l6JFbqnHEadBoVAVpN5dl2yCyfX28WoBAGaoQcNmLLSedOxTxcn2Qa83s8I/PA5i56vWru2OHOtrwF7Om2vqlg==",
"dev": true,
"dependencies": {
+ "@sindresorhus/merge-streams": "^4.0.0",
"cross-spawn": "^7.0.3",
- "get-stream": "^8.0.1",
- "human-signals": "^5.0.0",
- "is-stream": "^3.0.0",
- "merge-stream": "^2.0.0",
- "npm-run-path": "^5.1.0",
- "onetime": "^6.0.0",
+ "figures": "^6.1.0",
+ "get-stream": "^9.0.0",
+ "human-signals": "^7.0.0",
+ "is-plain-obj": "^4.1.0",
+ "is-stream": "^4.0.1",
+ "npm-run-path": "^5.2.0",
+ "pretty-ms": "^9.0.0",
"signal-exit": "^4.1.0",
- "strip-final-newline": "^3.0.0"
+ "strip-final-newline": "^4.0.0",
+ "yoctocolors": "^2.0.0"
},
"engines": {
- "node": ">=16.17"
+ "node": "^18.19.0 || >=20.5.0"
},
"funding": {
"url": "https://github.com/sindresorhus/execa?sponsor=1"
@@ -5365,6 +5565,12 @@
"integrity": "sha512-DCXu6Ifhqcks7TZKY3Hxp3y6qphY5SJZmrWMDrKcERSOXWQdMhU9Ig/PYrzyw/ul9jOIyh0N4M0tbC5hodg8dw==",
"dev": true
},
+ "node_modules/fast-uri": {
+ "version": "3.0.1",
+ "resolved": "https://registry.npmjs.org/fast-uri/-/fast-uri-3.0.1.tgz",
+ "integrity": "sha512-MWipKbbYiYI0UC7cl8m/i/IWTqfC8YXsqjzybjddLsFjStroQzsHXkc73JutMvBiXmOvapk+axIl79ig5t55Bw==",
+ "dev": true
+ },
"node_modules/fastest-levenshtein": {
"version": "1.0.16",
"resolved": "https://registry.npmjs.org/fastest-levenshtein/-/fastest-levenshtein-1.0.16.tgz",
@@ -5392,6 +5598,21 @@
"pend": "~1.2.0"
}
},
+ "node_modules/figures": {
+ "version": "6.1.0",
+ "resolved": "https://registry.npmjs.org/figures/-/figures-6.1.0.tgz",
+ "integrity": "sha512-d+l3qxjSesT4V7v2fh+QnmFnUWv9lSpjarhShNTgBOfA0ttejbQUAlHLitbjkoRiDulW0OPoQPYIGhIC8ohejg==",
+ "dev": true,
+ "dependencies": {
+ "is-unicode-supported": "^2.0.0"
+ },
+ "engines": {
+ "node": ">=18"
+ },
+ "funding": {
+ "url": "https://github.com/sponsors/sindresorhus"
+ }
+ },
"node_modules/file-entry-cache": {
"version": "8.0.0",
"resolved": "https://registry.npmjs.org/file-entry-cache/-/file-entry-cache-8.0.0.tgz",
@@ -5566,9 +5787,9 @@
}
},
"node_modules/get-port": {
- "version": "7.0.0",
- "resolved": "https://registry.npmjs.org/get-port/-/get-port-7.0.0.tgz",
- "integrity": "sha512-mDHFgApoQd+azgMdwylJrv2DX47ywGq1i5VFJE7fZ0dttNq3iQMfsU4IvEgBHojA3KqEudyu7Vq+oN8kNaNkWw==",
+ "version": "7.1.0",
+ "resolved": "https://registry.npmjs.org/get-port/-/get-port-7.1.0.tgz",
+ "integrity": "sha512-QB9NKEeDg3xxVwCCwJQ9+xycaz6pBB6iQ76wiWMl1927n0Kir6alPiP+yuiICLLU4jpMe08dXfpebuQppFA2zw==",
"dev": true,
"engines": {
"node": ">=16"
@@ -5578,12 +5799,16 @@
}
},
"node_modules/get-stream": {
- "version": "8.0.1",
- "resolved": "https://registry.npmjs.org/get-stream/-/get-stream-8.0.1.tgz",
- "integrity": "sha512-VaUJspBffn/LMCJVoMvSAdmscJyS1auj5Zulnn5UoYcY531UWmdwhRWkcGKnGU93m5HSXP9LP2usOryrBtQowA==",
+ "version": "9.0.1",
+ "resolved": "https://registry.npmjs.org/get-stream/-/get-stream-9.0.1.tgz",
+ "integrity": "sha512-kVCxPF3vQM/N0B1PmoqVUqgHP+EeVjmZSQn+1oCRPxd2P21P2F19lIgbR3HBosbB1PUhOAoctJnfEn2GbN2eZA==",
"dev": true,
+ "dependencies": {
+ "@sec-ant/readable-stream": "^0.4.1",
+ "is-stream": "^4.0.1"
+ },
"engines": {
- "node": ">=16"
+ "node": ">=18"
},
"funding": {
"url": "https://github.com/sponsors/sindresorhus"
@@ -5734,9 +5959,9 @@
}
},
"node_modules/globals": {
- "version": "15.8.0",
- "resolved": "https://registry.npmjs.org/globals/-/globals-15.8.0.tgz",
- "integrity": "sha512-VZAJ4cewHTExBWDHR6yptdIBlx9YSSZuwojj9Nt5mBRXQzrKakDsVKQ1J63sklLvzAJm0X5+RpO4i3Y2hcOnFw==",
+ "version": "15.9.0",
+ "resolved": "https://registry.npmjs.org/globals/-/globals-15.9.0.tgz",
+ "integrity": "sha512-SmSKyLLKFbSr6rptvP8izbyxJL4ILwqO9Jg23UA0sDlGlu58V59D1//I3vlc0KJphVdUR7vMjHIplYnzBxorQA==",
"dev": true,
"engines": {
"node": ">=18"
@@ -5891,12 +6116,12 @@
}
},
"node_modules/human-signals": {
- "version": "5.0.0",
- "resolved": "https://registry.npmjs.org/human-signals/-/human-signals-5.0.0.tgz",
- "integrity": "sha512-AXcZb6vzzrFAUE61HnN4mpLqd/cSIwNQjtNWR0euPm6y0iqx3G4gOXaIDdtdDwZmhwe82LA6+zinmW4UBWVePQ==",
+ "version": "7.0.0",
+ "resolved": "https://registry.npmjs.org/human-signals/-/human-signals-7.0.0.tgz",
+ "integrity": "sha512-74kytxOUSvNbjrT9KisAbaTZ/eJwD/LrbM/kh5j0IhPuJzwuA19dWvniFGwBzN9rVjg+O/e+F310PjObDXS+9Q==",
"dev": true,
"engines": {
- "node": ">=16.17.0"
+ "node": ">=18.18.0"
}
},
"node_modules/iconv-lite": {
@@ -5995,44 +6220,6 @@
"integrity": "sha512-JV/yugV2uzW5iMRSiZAyDtQd+nxtUnjeLt0acNdw98kKLrvuRVyB80tsREOE7yvGVgalhZ6RNXCmEHkUKBKxew==",
"dev": true
},
- "node_modules/inquirer": {
- "version": "9.2.23",
- "resolved": "https://registry.npmjs.org/inquirer/-/inquirer-9.2.23.tgz",
- "integrity": "sha512-kod5s+FBPIDM2xiy9fu+6wdU/SkK5le5GS9lh4FEBjBHqiMgD9lLFbCbuqFNAjNL2ZOy9Wd9F694IOzN9pZHBA==",
- "dev": true,
- "dependencies": {
- "@inquirer/figures": "^1.0.3",
- "@ljharb/through": "^2.3.13",
- "ansi-escapes": "^4.3.2",
- "chalk": "^5.3.0",
- "cli-cursor": "^3.1.0",
- "cli-width": "^4.1.0",
- "external-editor": "^3.1.0",
- "lodash": "^4.17.21",
- "mute-stream": "1.0.0",
- "ora": "^5.4.1",
- "run-async": "^3.0.0",
- "rxjs": "^7.8.1",
- "string-width": "^4.2.3",
- "strip-ansi": "^6.0.1",
- "wrap-ansi": "^6.2.0"
- },
- "engines": {
- "node": ">=18"
- }
- },
- "node_modules/inquirer/node_modules/chalk": {
- "version": "5.3.0",
- "resolved": "https://registry.npmjs.org/chalk/-/chalk-5.3.0.tgz",
- "integrity": "sha512-dLitG79d+GV1Nb/VYcCDFivJeK1hiukt9QjRNVOsUtTy1rR1YJsmpGGTZ3qJos+uw7WmWF4wUwBd9jxjocFC2w==",
- "dev": true,
- "engines": {
- "node": "^12.17.0 || ^14.13 || >=16.0.0"
- },
- "funding": {
- "url": "https://github.com/chalk/chalk?sponsor=1"
- }
- },
"node_modules/ip-address": {
"version": "9.0.5",
"resolved": "https://registry.npmjs.org/ip-address/-/ip-address-9.0.5.tgz",
@@ -6118,15 +6305,6 @@
"node": ">=0.10.0"
}
},
- "node_modules/is-interactive": {
- "version": "1.0.0",
- "resolved": "https://registry.npmjs.org/is-interactive/-/is-interactive-1.0.0.tgz",
- "integrity": "sha512-2HvIEKRoqS62guEC+qBjpvRubdX910WCMuJTZ+I9yvqKU2/12eSL549HMwtabb4oupdj2sMP50k+XJfB/8JE6w==",
- "dev": true,
- "engines": {
- "node": ">=8"
- }
- },
"node_modules/is-module": {
"version": "1.0.0",
"resolved": "https://registry.npmjs.org/is-module/-/is-module-1.0.0.tgz",
@@ -6151,6 +6329,18 @@
"node": ">=8"
}
},
+ "node_modules/is-plain-obj": {
+ "version": "4.1.0",
+ "resolved": "https://registry.npmjs.org/is-plain-obj/-/is-plain-obj-4.1.0.tgz",
+ "integrity": "sha512-+Pgi+vMuUNkJyExiMBt5IlFoMyKnr5zhJ4Uspz58WOhBF5QoIZkFyNHIbBAtHwzVAgk5RtndVNsDRN61/mmDqg==",
+ "dev": true,
+ "engines": {
+ "node": ">=12"
+ },
+ "funding": {
+ "url": "https://github.com/sponsors/sindresorhus"
+ }
+ },
"node_modules/is-plain-object": {
"version": "5.0.0",
"resolved": "https://registry.npmjs.org/is-plain-object/-/is-plain-object-5.0.0.tgz",
@@ -6170,24 +6360,24 @@
}
},
"node_modules/is-stream": {
- "version": "3.0.0",
- "resolved": "https://registry.npmjs.org/is-stream/-/is-stream-3.0.0.tgz",
- "integrity": "sha512-LnQR4bZ9IADDRSkvpqMGvt/tEJWclzklNgSw48V5EAaAeDd6qGvN8ei6k5p0tvxSR171VmGyHuTiAOfxAbr8kA==",
+ "version": "4.0.1",
+ "resolved": "https://registry.npmjs.org/is-stream/-/is-stream-4.0.1.tgz",
+ "integrity": "sha512-Dnz92NInDqYckGEUJv689RbRiTSEHCQ7wOVeALbkOz999YpqT46yMRIGtSNl2iCL1waAZSx40+h59NV/EwzV/A==",
"dev": true,
"engines": {
- "node": "^12.20.0 || ^14.13.1 || >=16.0.0"
+ "node": ">=18"
},
"funding": {
"url": "https://github.com/sponsors/sindresorhus"
}
},
"node_modules/is-unicode-supported": {
- "version": "0.1.0",
- "resolved": "https://registry.npmjs.org/is-unicode-supported/-/is-unicode-supported-0.1.0.tgz",
- "integrity": "sha512-knxG2q4UC3u8stRGyAVJCOdxFmv5DZiRcdlIaAQXAbSfJya+OhopNotLQrstBhququ4ZpuKbDc/8S6mgXgPFPw==",
+ "version": "2.0.0",
+ "resolved": "https://registry.npmjs.org/is-unicode-supported/-/is-unicode-supported-2.0.0.tgz",
+ "integrity": "sha512-FRdAyx5lusK1iHG0TWpVtk9+1i+GjrzRffhDg4ovQ7mcidMQ6mj+MhKPmvh7Xwyv5gIS06ns49CA7Sqg7lC22Q==",
"dev": true,
"engines": {
- "node": ">=10"
+ "node": ">=18"
},
"funding": {
"url": "https://github.com/sponsors/sindresorhus"
@@ -6229,6 +6419,12 @@
"integrity": "sha512-8wb9Yw966OSxApiCt0K3yNJL8pnNeIv+OEq2YMidz4FKP6nonSRoOXc80iXY4JaN2FC11B9qsNmDsm+ZOfMROA==",
"dev": true
},
+ "node_modules/js-md4": {
+ "version": "0.3.2",
+ "resolved": "https://registry.npmjs.org/js-md4/-/js-md4-0.3.2.tgz",
+ "integrity": "sha512-/GDnfQYsltsjRswQhN9fhv3EMw2sCpUdrdxyWDOUK7eyD++r3gRhzgiQgc/x4MAv2i1iuQ4lxO5mvqM3vj4bwA==",
+ "dev": true
+ },
"node_modules/js-tokens": {
"version": "4.0.0",
"resolved": "https://registry.npmjs.org/js-tokens/-/js-tokens-4.0.0.tgz",
@@ -6490,83 +6686,6 @@
"integrity": "sha512-jttmRe7bRse52OsWIMDLaXxWqRAmtIUccAQ3garviCqJjafXOfNMO0yMfNpdD6zbGaTU0P5Nz7e7gAT6cKmJRw==",
"dev": true
},
- "node_modules/log-symbols": {
- "version": "4.1.0",
- "resolved": "https://registry.npmjs.org/log-symbols/-/log-symbols-4.1.0.tgz",
- "integrity": "sha512-8XPvpAA8uyhfteu8pIvQxpJZ7SYYdpUivZpGy6sFsBuKRY/7rQGavedeB8aK+Zkyq6upMFVL/9AW6vOYzfRyLg==",
- "dev": true,
- "dependencies": {
- "chalk": "^4.1.0",
- "is-unicode-supported": "^0.1.0"
- },
- "engines": {
- "node": ">=10"
- },
- "funding": {
- "url": "https://github.com/sponsors/sindresorhus"
- }
- },
- "node_modules/log-symbols/node_modules/ansi-styles": {
- "version": "4.3.0",
- "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-4.3.0.tgz",
- "integrity": "sha512-zbB9rCJAT1rbjiVDb2hqKFHNYLxgtk8NURxZ3IZwD3F6NtxbXZQCnnSi1Lkx+IDohdPlFp222wVALIheZJQSEg==",
- "dev": true,
- "dependencies": {
- "color-convert": "^2.0.1"
- },
- "engines": {
- "node": ">=8"
- },
- "funding": {
- "url": "https://github.com/chalk/ansi-styles?sponsor=1"
- }
- },
- "node_modules/log-symbols/node_modules/chalk": {
- "version": "4.1.2",
- "resolved": "https://registry.npmjs.org/chalk/-/chalk-4.1.2.tgz",
- "integrity": "sha512-oKnbhFyRIXpUuez8iBMmyEa4nbj4IOQyuhc/wy9kY7/WVPcwIO9VA668Pu8RkO7+0G76SLROeyw9CpQ061i4mA==",
- "dev": true,
- "dependencies": {
- "ansi-styles": "^4.1.0",
- "supports-color": "^7.1.0"
- },
- "engines": {
- "node": ">=10"
- },
- "funding": {
- "url": "https://github.com/chalk/chalk?sponsor=1"
- }
- },
- "node_modules/log-symbols/node_modules/color-convert": {
- "version": "2.0.1",
- "resolved": "https://registry.npmjs.org/color-convert/-/color-convert-2.0.1.tgz",
- "integrity": "sha512-RRECPsj7iu/xb5oKYcsFHSppFNnsj/52OVTRKb4zP5onXwVF3zVmmToNcOfGC+CRDpfK/U584fMg38ZHCaElKQ==",
- "dev": true,
- "dependencies": {
- "color-name": "~1.1.4"
- },
- "engines": {
- "node": ">=7.0.0"
- }
- },
- "node_modules/log-symbols/node_modules/color-name": {
- "version": "1.1.4",
- "resolved": "https://registry.npmjs.org/color-name/-/color-name-1.1.4.tgz",
- "integrity": "sha512-dOy+3AuW3a2wNbZHIuMZpTcgjGuLU/uBL/ubcZF9OXbDo8ff4O8yVp5Bf0efS8uEoYo5q4Fx7dY9OgQGXgAsQA==",
- "dev": true
- },
- "node_modules/log-symbols/node_modules/supports-color": {
- "version": "7.2.0",
- "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-7.2.0.tgz",
- "integrity": "sha512-qpCAvRl9stuOHveKsn7HncJRvv501qIacKzQlO/+Lwxc9+0q2wLyv4Dfvt80/DPn2pqOBsJdDiogXGR9+OvwRw==",
- "dev": true,
- "dependencies": {
- "has-flag": "^4.0.0"
- },
- "engines": {
- "node": ">=8"
- }
- },
"node_modules/log4js": {
"version": "6.9.1",
"resolved": "https://registry.npmjs.org/log4js/-/log4js-6.9.1.tgz",
@@ -6612,9 +6731,9 @@
}
},
"node_modules/mdn-data": {
- "version": "2.8.0",
- "resolved": "https://registry.npmjs.org/mdn-data/-/mdn-data-2.8.0.tgz",
- "integrity": "sha512-sez0u7AGXSY0LU2NKoHoMn2F2YAbHgDEXb91Wk2zAfTYsDoOqA4aJS+ZVIlk7ZdODBuOL0vhJ4yF57gMojXVbw==",
+ "version": "2.9.0",
+ "resolved": "https://registry.npmjs.org/mdn-data/-/mdn-data-2.9.0.tgz",
+ "integrity": "sha512-mRKpwcgT19Mp/+kU3BAA8onXlmRCs+2pdLAcAQMVYw4yWzDZPmVLYfoDYkdR0y4jvNYRDJp0uIGJggwYk6WMRQ==",
"dev": true
},
"node_modules/meow": {
@@ -6629,12 +6748,6 @@
"url": "https://github.com/sponsors/sindresorhus"
}
},
- "node_modules/merge-stream": {
- "version": "2.0.0",
- "resolved": "https://registry.npmjs.org/merge-stream/-/merge-stream-2.0.0.tgz",
- "integrity": "sha512-abv/qOcuPfk3URPfDzmZU1LKmuw8kT+0nIHvKrKgFrwifol/doWcdA4ZqsWQ8ENrFKkd67Mfpo/LovbIUsbt3w==",
- "dev": true
- },
"node_modules/merge2": {
"version": "1.4.1",
"resolved": "https://registry.npmjs.org/merge2/-/merge2-1.4.1.tgz",
@@ -6657,17 +6770,11 @@
"node": ">=8.6"
}
},
- "node_modules/mimic-fn": {
- "version": "4.0.0",
- "resolved": "https://registry.npmjs.org/mimic-fn/-/mimic-fn-4.0.0.tgz",
- "integrity": "sha512-vqiC06CuhBTUdZH+RYl8sFrL096vA45Ok5ISO6sE/Mr1jRbGH4Csnhi8f3wKVl7x8mO4Au7Ir9D3Oyv1VYMFJw==",
- "dev": true,
- "engines": {
- "node": ">=12"
- },
- "funding": {
- "url": "https://github.com/sponsors/sindresorhus"
- }
+ "node_modules/minimalistic-assert": {
+ "version": "1.0.1",
+ "resolved": "https://registry.npmjs.org/minimalistic-assert/-/minimalistic-assert-1.0.1.tgz",
+ "integrity": "sha512-UtJcAD4yEaGtjPezWuO9wC4nwUnVH/8/Im3yEHQP4b67cXlD/Qr9hdITCU1xDbSEXg2XKNaP8jsReV7vQd00/A==",
+ "dev": true
},
"node_modules/minimatch": {
"version": "3.0.8",
@@ -6712,24 +6819,24 @@
"dev": true
},
"node_modules/mutation-testing-elements": {
- "version": "3.0.2",
- "resolved": "https://registry.npmjs.org/mutation-testing-elements/-/mutation-testing-elements-3.0.2.tgz",
- "integrity": "sha512-ISsvj+2pfcyAUEMig83Y5KFvWpy3wJ3NIcXiJ6hD5NQeDdZJnhagRJqLQTwBRkzblqiAuYpY611v4isYJauBbg==",
+ "version": "3.1.1",
+ "resolved": "https://registry.npmjs.org/mutation-testing-elements/-/mutation-testing-elements-3.1.1.tgz",
+ "integrity": "sha512-pYkrxZJh2zqA8XRSjtkoDFuIbezY1/4kIYjxw+DM6h6WL5wntLVKP5y3vQT8miRz/ek/3MP0qm2tuvgPn1rjOQ==",
"dev": true
},
"node_modules/mutation-testing-metrics": {
- "version": "3.0.2",
- "resolved": "https://registry.npmjs.org/mutation-testing-metrics/-/mutation-testing-metrics-3.0.2.tgz",
- "integrity": "sha512-FpyCAz43Mmq/l7BIyBrZLv8z3kc5XHNei/DcAyEVSXyj2i+h4jLhen4SiW/BPMijCIMVyiOeMJPMIfaYxrFZGg==",
+ "version": "3.1.1",
+ "resolved": "https://registry.npmjs.org/mutation-testing-metrics/-/mutation-testing-metrics-3.1.1.tgz",
+ "integrity": "sha512-AgXM0TAnwD4G5ml0pA4u4qZu6+EuKnFwDHKjwdipgxy6nZRvZzqj2JUOGfFvbTPyjFLeVbAxYMsedPQskxXyxw==",
"dev": true,
"dependencies": {
- "mutation-testing-report-schema": "3.0.2"
+ "mutation-testing-report-schema": "3.1.1"
}
},
"node_modules/mutation-testing-report-schema": {
- "version": "3.0.2",
- "resolved": "https://registry.npmjs.org/mutation-testing-report-schema/-/mutation-testing-report-schema-3.0.2.tgz",
- "integrity": "sha512-1F6s37zFDsoWa262sANVBDKANMvmKPVU1FAVEpSCMtKAGkFoar+tjXUlPnD0dWJfPuKV58G86zP7sMlcu+QOJQ==",
+ "version": "3.1.1",
+ "resolved": "https://registry.npmjs.org/mutation-testing-report-schema/-/mutation-testing-report-schema-3.1.1.tgz",
+ "integrity": "sha512-lWIbgUEnMEdsY2yymC7SZRBO+6dbZa5tY/Bmw+xjXYPdBxTVlnd2mjKRPZ6FUxgHJ9vMQmQnktMNAKCWZp1H0A==",
"dev": true
},
"node_modules/mute-stream": {
@@ -6843,21 +6950,6 @@
"wrappy": "1"
}
},
- "node_modules/onetime": {
- "version": "6.0.0",
- "resolved": "https://registry.npmjs.org/onetime/-/onetime-6.0.0.tgz",
- "integrity": "sha512-1FlR+gjXK7X+AsAHso35MnyN5KqGwJRi/31ft6x0M194ht7S+rWAvd7PHss9xSKMzE0asv1pyIHaJYq+BbacAQ==",
- "dev": true,
- "dependencies": {
- "mimic-fn": "^4.0.0"
- },
- "engines": {
- "node": ">=12"
- },
- "funding": {
- "url": "https://github.com/sponsors/sindresorhus"
- }
- },
"node_modules/open-props": {
"version": "1.7.5",
"resolved": "https://registry.npmjs.org/open-props/-/open-props-1.7.5.tgz",
@@ -6881,90 +6973,6 @@
"node": ">= 0.8.0"
}
},
- "node_modules/ora": {
- "version": "5.4.1",
- "resolved": "https://registry.npmjs.org/ora/-/ora-5.4.1.tgz",
- "integrity": "sha512-5b6Y85tPxZZ7QytO+BQzysW31HJku27cRIlkbAXaNx+BdcVi+LlRFmVXzeF6a7JCwJpyw5c4b+YSVImQIrBpuQ==",
- "dev": true,
- "dependencies": {
- "bl": "^4.1.0",
- "chalk": "^4.1.0",
- "cli-cursor": "^3.1.0",
- "cli-spinners": "^2.5.0",
- "is-interactive": "^1.0.0",
- "is-unicode-supported": "^0.1.0",
- "log-symbols": "^4.1.0",
- "strip-ansi": "^6.0.0",
- "wcwidth": "^1.0.1"
- },
- "engines": {
- "node": ">=10"
- },
- "funding": {
- "url": "https://github.com/sponsors/sindresorhus"
- }
- },
- "node_modules/ora/node_modules/ansi-styles": {
- "version": "4.3.0",
- "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-4.3.0.tgz",
- "integrity": "sha512-zbB9rCJAT1rbjiVDb2hqKFHNYLxgtk8NURxZ3IZwD3F6NtxbXZQCnnSi1Lkx+IDohdPlFp222wVALIheZJQSEg==",
- "dev": true,
- "dependencies": {
- "color-convert": "^2.0.1"
- },
- "engines": {
- "node": ">=8"
- },
- "funding": {
- "url": "https://github.com/chalk/ansi-styles?sponsor=1"
- }
- },
- "node_modules/ora/node_modules/chalk": {
- "version": "4.1.2",
- "resolved": "https://registry.npmjs.org/chalk/-/chalk-4.1.2.tgz",
- "integrity": "sha512-oKnbhFyRIXpUuez8iBMmyEa4nbj4IOQyuhc/wy9kY7/WVPcwIO9VA668Pu8RkO7+0G76SLROeyw9CpQ061i4mA==",
- "dev": true,
- "dependencies": {
- "ansi-styles": "^4.1.0",
- "supports-color": "^7.1.0"
- },
- "engines": {
- "node": ">=10"
- },
- "funding": {
- "url": "https://github.com/chalk/chalk?sponsor=1"
- }
- },
- "node_modules/ora/node_modules/color-convert": {
- "version": "2.0.1",
- "resolved": "https://registry.npmjs.org/color-convert/-/color-convert-2.0.1.tgz",
- "integrity": "sha512-RRECPsj7iu/xb5oKYcsFHSppFNnsj/52OVTRKb4zP5onXwVF3zVmmToNcOfGC+CRDpfK/U584fMg38ZHCaElKQ==",
- "dev": true,
- "dependencies": {
- "color-name": "~1.1.4"
- },
- "engines": {
- "node": ">=7.0.0"
- }
- },
- "node_modules/ora/node_modules/color-name": {
- "version": "1.1.4",
- "resolved": "https://registry.npmjs.org/color-name/-/color-name-1.1.4.tgz",
- "integrity": "sha512-dOy+3AuW3a2wNbZHIuMZpTcgjGuLU/uBL/ubcZF9OXbDo8ff4O8yVp5Bf0efS8uEoYo5q4Fx7dY9OgQGXgAsQA==",
- "dev": true
- },
- "node_modules/ora/node_modules/supports-color": {
- "version": "7.2.0",
- "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-7.2.0.tgz",
- "integrity": "sha512-qpCAvRl9stuOHveKsn7HncJRvv501qIacKzQlO/+Lwxc9+0q2wLyv4Dfvt80/DPn2pqOBsJdDiogXGR9+OvwRw==",
- "dev": true,
- "dependencies": {
- "has-flag": "^4.0.0"
- },
- "engines": {
- "node": ">=8"
- }
- },
"node_modules/os-tmpdir": {
"version": "1.0.2",
"resolved": "https://registry.npmjs.org/os-tmpdir/-/os-tmpdir-1.0.2.tgz",
@@ -7564,16 +7572,16 @@
}
},
"node_modules/puppeteer": {
- "version": "22.14.0",
- "resolved": "https://registry.npmjs.org/puppeteer/-/puppeteer-22.14.0.tgz",
- "integrity": "sha512-MGTR6/pM8zmWbTdazb6FKnwIihzsSEXBPH49mFFU96DNZpQOevCAZMnjBZGlZRGRzRK6aADCavR6SQtrbv5dQw==",
+ "version": "22.15.0",
+ "resolved": "https://registry.npmjs.org/puppeteer/-/puppeteer-22.15.0.tgz",
+ "integrity": "sha512-XjCY1SiSEi1T7iSYuxS82ft85kwDJUS7wj1Z0eGVXKdtr5g4xnVcbjwxhq5xBnpK/E7x1VZZoJDxpjAOasHT4Q==",
"dev": true,
"hasInstallScript": true,
"dependencies": {
"@puppeteer/browsers": "2.3.0",
"cosmiconfig": "^9.0.0",
"devtools-protocol": "0.0.1312386",
- "puppeteer-core": "22.14.0"
+ "puppeteer-core": "22.15.0"
},
"bin": {
"puppeteer": "lib/esm/puppeteer/node/cli.js"
@@ -7583,14 +7591,14 @@
}
},
"node_modules/puppeteer-core": {
- "version": "22.14.0",
- "resolved": "https://registry.npmjs.org/puppeteer-core/-/puppeteer-core-22.14.0.tgz",
- "integrity": "sha512-rl4tOY5LcA3e374GAlsGGHc05HL3eGNf5rZ+uxkl6id9zVZKcwcp1Z+Nd6byb6WPiPeecT/dwz8f/iUm+AZQSw==",
+ "version": "22.15.0",
+ "resolved": "https://registry.npmjs.org/puppeteer-core/-/puppeteer-core-22.15.0.tgz",
+ "integrity": "sha512-cHArnywCiAAVXa3t4GGL2vttNxh7GqXtIYGym99egkNJ3oG//wL9LkvO4WE8W1TJe95t1F1ocu9X4xWaGsOKOA==",
"dev": true,
"dependencies": {
"@puppeteer/browsers": "2.3.0",
- "chromium-bidi": "0.6.2",
- "debug": "^4.3.5",
+ "chromium-bidi": "0.6.3",
+ "debug": "^4.3.6",
"devtools-protocol": "0.0.1312386",
"ws": "^8.18.0"
},
@@ -7599,9 +7607,9 @@
}
},
"node_modules/qs": {
- "version": "6.12.3",
- "resolved": "https://registry.npmjs.org/qs/-/qs-6.12.3.tgz",
- "integrity": "sha512-AWJm14H1vVaO/iNZ4/hO+HyaTehuy9nRqVdkTqlJt0HWvBiBIEXFmb4C0DGeYo3Xes9rrEW+TxHsaigCbN5ICQ==",
+ "version": "6.13.0",
+ "resolved": "https://registry.npmjs.org/qs/-/qs-6.13.0.tgz",
+ "integrity": "sha512-+38qI9SOr8tfZ4QmJNplMUxqjbe7LKvvZgWdExBOmd+egZTtjLB67Gu0HRX3u/XOq7UU2Nx6nsjvS16Z9uwfpg==",
"dev": true,
"dependencies": {
"side-channel": "^1.0.6"
@@ -7657,20 +7665,6 @@
"pify": "^2.3.0"
}
},
- "node_modules/readable-stream": {
- "version": "3.6.2",
- "resolved": "https://registry.npmjs.org/readable-stream/-/readable-stream-3.6.2.tgz",
- "integrity": "sha512-9u/sniCrY3D5WdsERHzHE4G2YCXqoG5FTHUiCC4SIbr6XcLZBY05ya9EKjYek9O5xOAwjGq+1JdGBAS7Q9ScoA==",
- "dev": true,
- "dependencies": {
- "inherits": "^2.0.3",
- "string_decoder": "^1.1.1",
- "util-deprecate": "^1.0.1"
- },
- "engines": {
- "node": ">= 6"
- }
- },
"node_modules/regenerate": {
"version": "1.4.2",
"resolved": "https://registry.npmjs.org/regenerate/-/regenerate-1.4.2.tgz",
@@ -7786,49 +7780,6 @@
"node": ">=4"
}
},
- "node_modules/restore-cursor": {
- "version": "3.1.0",
- "resolved": "https://registry.npmjs.org/restore-cursor/-/restore-cursor-3.1.0.tgz",
- "integrity": "sha512-l+sSefzHpj5qimhFSE5a8nufZYAM3sBSVMAPtYkmC+4EH2anSGaEMXSD0izRQbu9nfyQ9y5JrVmp7E8oZrUjvA==",
- "dev": true,
- "dependencies": {
- "onetime": "^5.1.0",
- "signal-exit": "^3.0.2"
- },
- "engines": {
- "node": ">=8"
- }
- },
- "node_modules/restore-cursor/node_modules/mimic-fn": {
- "version": "2.1.0",
- "resolved": "https://registry.npmjs.org/mimic-fn/-/mimic-fn-2.1.0.tgz",
- "integrity": "sha512-OqbOk5oEQeAZ8WXWydlu9HJjz9WVdEIvamMCcXmuqUYjTknH/sqsWvhQ3vgwKFRR1HpjvNBKQ37nbJgYzGqGcg==",
- "dev": true,
- "engines": {
- "node": ">=6"
- }
- },
- "node_modules/restore-cursor/node_modules/onetime": {
- "version": "5.1.2",
- "resolved": "https://registry.npmjs.org/onetime/-/onetime-5.1.2.tgz",
- "integrity": "sha512-kbpaSSGJTWdAY5KPVeMOKXSrPtr8C8C7wodJbcsd51jRnmD+GZu8Y0VoU6Dm5Z4vWr0Ig/1NKuWRKf7j5aaYSg==",
- "dev": true,
- "dependencies": {
- "mimic-fn": "^2.1.0"
- },
- "engines": {
- "node": ">=6"
- },
- "funding": {
- "url": "https://github.com/sponsors/sindresorhus"
- }
- },
- "node_modules/restore-cursor/node_modules/signal-exit": {
- "version": "3.0.7",
- "resolved": "https://registry.npmjs.org/signal-exit/-/signal-exit-3.0.7.tgz",
- "integrity": "sha512-wnD2ZE+l+SPC/uoS0vXeE9L1+0wuaMqKlfz9AMUo38JsyLSBWSFcHR1Rri62LZc12vLr1gb3jl7iwQhgwpAbGQ==",
- "dev": true
- },
"node_modules/reusify": {
"version": "1.0.4",
"resolved": "https://registry.npmjs.org/reusify/-/reusify-1.0.4.tgz",
@@ -7846,9 +7797,9 @@
"dev": true
},
"node_modules/rollup": {
- "version": "4.19.1",
- "resolved": "https://registry.npmjs.org/rollup/-/rollup-4.19.1.tgz",
- "integrity": "sha512-K5vziVlg7hTpYfFBI+91zHBEMo6jafYXpkMlqZjg7/zhIG9iHqazBf4xz9AVdjS9BruRn280ROqLI7G3OFRIlw==",
+ "version": "4.19.2",
+ "resolved": "https://registry.npmjs.org/rollup/-/rollup-4.19.2.tgz",
+ "integrity": "sha512-6/jgnN1svF9PjNYJ4ya3l+cqutg49vOZ4rVgsDKxdl+5gpGPnByFXWGyfH9YGx9i3nfBwSu1Iyu6vGwFFA0BdQ==",
"dev": true,
"dependencies": {
"@types/estree": "1.0.5"
@@ -7861,34 +7812,25 @@
"npm": ">=8.0.0"
},
"optionalDependencies": {
- "@rollup/rollup-android-arm-eabi": "4.19.1",
- "@rollup/rollup-android-arm64": "4.19.1",
- "@rollup/rollup-darwin-arm64": "4.19.1",
- "@rollup/rollup-darwin-x64": "4.19.1",
- "@rollup/rollup-linux-arm-gnueabihf": "4.19.1",
- "@rollup/rollup-linux-arm-musleabihf": "4.19.1",
- "@rollup/rollup-linux-arm64-gnu": "4.19.1",
- "@rollup/rollup-linux-arm64-musl": "4.19.1",
- "@rollup/rollup-linux-powerpc64le-gnu": "4.19.1",
- "@rollup/rollup-linux-riscv64-gnu": "4.19.1",
- "@rollup/rollup-linux-s390x-gnu": "4.19.1",
- "@rollup/rollup-linux-x64-gnu": "4.19.1",
- "@rollup/rollup-linux-x64-musl": "4.19.1",
- "@rollup/rollup-win32-arm64-msvc": "4.19.1",
- "@rollup/rollup-win32-ia32-msvc": "4.19.1",
- "@rollup/rollup-win32-x64-msvc": "4.19.1",
+ "@rollup/rollup-android-arm-eabi": "4.19.2",
+ "@rollup/rollup-android-arm64": "4.19.2",
+ "@rollup/rollup-darwin-arm64": "4.19.2",
+ "@rollup/rollup-darwin-x64": "4.19.2",
+ "@rollup/rollup-linux-arm-gnueabihf": "4.19.2",
+ "@rollup/rollup-linux-arm-musleabihf": "4.19.2",
+ "@rollup/rollup-linux-arm64-gnu": "4.19.2",
+ "@rollup/rollup-linux-arm64-musl": "4.19.2",
+ "@rollup/rollup-linux-powerpc64le-gnu": "4.19.2",
+ "@rollup/rollup-linux-riscv64-gnu": "4.19.2",
+ "@rollup/rollup-linux-s390x-gnu": "4.19.2",
+ "@rollup/rollup-linux-x64-gnu": "4.19.2",
+ "@rollup/rollup-linux-x64-musl": "4.19.2",
+ "@rollup/rollup-win32-arm64-msvc": "4.19.2",
+ "@rollup/rollup-win32-ia32-msvc": "4.19.2",
+ "@rollup/rollup-win32-x64-msvc": "4.19.2",
"fsevents": "~2.3.2"
}
},
- "node_modules/run-async": {
- "version": "3.0.0",
- "resolved": "https://registry.npmjs.org/run-async/-/run-async-3.0.0.tgz",
- "integrity": "sha512-540WwVDOMxA6dN6We19EcT9sc3hkXPw5mzRNGM3FkdN/vtE9NFvj5lFAPNwUDmJjXidm3v7TC1cTE7t17Ulm1Q==",
- "dev": true,
- "engines": {
- "node": ">=0.12.0"
- }
- },
"node_modules/run-parallel": {
"version": "1.2.0",
"resolved": "https://registry.npmjs.org/run-parallel/-/run-parallel-1.2.0.tgz",
@@ -8223,15 +8165,6 @@
"bare-events": "^2.2.0"
}
},
- "node_modules/string_decoder": {
- "version": "1.3.0",
- "resolved": "https://registry.npmjs.org/string_decoder/-/string_decoder-1.3.0.tgz",
- "integrity": "sha512-hkRX8U1WjJFd8LsDJ2yQ/wWWxaopEsABU1XfkM8A+j0+85JAGppt16cr1Whg6KIbb4okU6Mql6BOj+uup/wKeA==",
- "dev": true,
- "dependencies": {
- "safe-buffer": "~5.2.0"
- }
- },
"node_modules/string-argv": {
"version": "0.3.2",
"resolved": "https://registry.npmjs.org/string-argv/-/string-argv-0.3.2.tgz",
@@ -8242,17 +8175,20 @@
}
},
"node_modules/string-width": {
- "version": "4.2.3",
- "resolved": "https://registry.npmjs.org/string-width/-/string-width-4.2.3.tgz",
- "integrity": "sha512-wKyQRQpjJ0sIp62ErSZdGsjMJWsap5oRNihHhu6G7JVO/9jIB6UyevL+tXuOqrng8j/cxKTWyWUwvSTriiZz/g==",
+ "version": "5.1.2",
+ "resolved": "https://registry.npmjs.org/string-width/-/string-width-5.1.2.tgz",
+ "integrity": "sha512-HnLOCR3vjcY8beoNLtcjZ5/nxn2afmME6lhrDrebokqMap+XbeW8n9TXpPDOqdGK5qcI3oT0GKTW6wC7EMiVqA==",
"dev": true,
"dependencies": {
- "emoji-regex": "^8.0.0",
- "is-fullwidth-code-point": "^3.0.0",
- "strip-ansi": "^6.0.1"
+ "eastasianwidth": "^0.2.0",
+ "emoji-regex": "^9.2.2",
+ "strip-ansi": "^7.0.1"
},
"engines": {
- "node": ">=8"
+ "node": ">=12"
+ },
+ "funding": {
+ "url": "https://github.com/sponsors/sindresorhus"
}
},
"node_modules/string-width-cjs": {
@@ -8276,12 +8212,39 @@
"integrity": "sha512-MSjYzcWNOA0ewAHpz0MxpYFvwg6yjy1NG3xteoqz644VCo/RPgnr1/GGt+ic3iJTzQ8Eu3TdM14SawnVUmGE6A==",
"dev": true
},
+ "node_modules/string-width/node_modules/ansi-regex": {
+ "version": "6.0.1",
+ "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-6.0.1.tgz",
+ "integrity": "sha512-n5M855fKb2SsfMIiFFoVrABHJC8QtHwVx+mHWP3QcEqBHYienj5dHSgjbxtC0WEZXYt4wcD6zrQElDPhFuZgfA==",
+ "dev": true,
+ "engines": {
+ "node": ">=12"
+ },
+ "funding": {
+ "url": "https://github.com/chalk/ansi-regex?sponsor=1"
+ }
+ },
"node_modules/string-width/node_modules/emoji-regex": {
- "version": "8.0.0",
- "resolved": "https://registry.npmjs.org/emoji-regex/-/emoji-regex-8.0.0.tgz",
- "integrity": "sha512-MSjYzcWNOA0ewAHpz0MxpYFvwg6yjy1NG3xteoqz644VCo/RPgnr1/GGt+ic3iJTzQ8Eu3TdM14SawnVUmGE6A==",
+ "version": "9.2.2",
+ "resolved": "https://registry.npmjs.org/emoji-regex/-/emoji-regex-9.2.2.tgz",
+ "integrity": "sha512-L18DaJsXSUk2+42pv8mLs5jJT2hqFkFE4j21wOmgbUqsZ2hL72NsUU785g9RXgo3s0ZNgVl42TiHp3ZtOv/Vyg==",
"dev": true
},
+ "node_modules/string-width/node_modules/strip-ansi": {
+ "version": "7.1.0",
+ "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-7.1.0.tgz",
+ "integrity": "sha512-iq6eVVI64nQQTRYq2KtEg2d2uU7LElhTJwsH4YzIHZshxlgZms/wIc4VoDQTlG/IvVIrBKG06CrZnp0qv7hkcQ==",
+ "dev": true,
+ "dependencies": {
+ "ansi-regex": "^6.0.1"
+ },
+ "engines": {
+ "node": ">=12"
+ },
+ "funding": {
+ "url": "https://github.com/chalk/strip-ansi?sponsor=1"
+ }
+ },
"node_modules/strip-ansi": {
"version": "6.0.1",
"resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-6.0.1.tgz",
@@ -8308,12 +8271,12 @@
}
},
"node_modules/strip-final-newline": {
- "version": "3.0.0",
- "resolved": "https://registry.npmjs.org/strip-final-newline/-/strip-final-newline-3.0.0.tgz",
- "integrity": "sha512-dOESqjYr96iWYylGObzd39EuNTa5VJxyvVAEm5Jnh7KGo75V43Hk1odPQkNDyXNmUR6k+gEiDVXnjB8HJ3crXw==",
+ "version": "4.0.0",
+ "resolved": "https://registry.npmjs.org/strip-final-newline/-/strip-final-newline-4.0.0.tgz",
+ "integrity": "sha512-aulFJcD6YK8V1G7iRB5tigAP4TsHBZZrOV8pjV++zdUwmeV8uzbY7yn6h9MswN62adStNZFuCIx4haBnRuMDaw==",
"dev": true,
"engines": {
- "node": ">=12"
+ "node": ">=18"
},
"funding": {
"url": "https://github.com/sponsors/sindresorhus"
@@ -8338,9 +8301,9 @@
"dev": true
},
"node_modules/stylelint": {
- "version": "16.8.0",
- "resolved": "https://registry.npmjs.org/stylelint/-/stylelint-16.8.0.tgz",
- "integrity": "sha512-Jjr40w3PXDiJVW6c9swLM0a1e0DgDm/XkFozc4XgAcREFas+/nchzmDmeVxazbzXgpDrwm+cW6W6iGtZqYUh+g==",
+ "version": "16.8.1",
+ "resolved": "https://registry.npmjs.org/stylelint/-/stylelint-16.8.1.tgz",
+ "integrity": "sha512-O8aDyfdODSDNz/B3gW2HQ+8kv8pfhSu7ZR7xskQ93+vI6FhKKGUJMQ03Ydu+w3OvXXE0/u4hWU4hCPNOyld+OA==",
"dev": true,
"funding": [
{
@@ -8422,24 +8385,18 @@
"stylelint": "^16.0.1"
}
},
- "node_modules/stylelint/node_modules/ansi-regex": {
- "version": "6.0.1",
- "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-6.0.1.tgz",
- "integrity": "sha512-n5M855fKb2SsfMIiFFoVrABHJC8QtHwVx+mHWP3QcEqBHYienj5dHSgjbxtC0WEZXYt4wcD6zrQElDPhFuZgfA==",
- "dev": true,
- "engines": {
- "node": ">=12"
- },
- "funding": {
- "url": "https://github.com/chalk/ansi-regex?sponsor=1"
- }
- },
"node_modules/stylelint/node_modules/balanced-match": {
"version": "2.0.0",
"resolved": "https://registry.npmjs.org/balanced-match/-/balanced-match-2.0.0.tgz",
"integrity": "sha512-1ugUSr8BHXRnK23KfuYS+gVMC3LB8QGH9W1iGtDPsNWoQbgtXSExkBu2aDR4epiGWZOjZsj6lDl/N/AqqTC3UA==",
"dev": true
},
+ "node_modules/stylelint/node_modules/emoji-regex": {
+ "version": "8.0.0",
+ "resolved": "https://registry.npmjs.org/emoji-regex/-/emoji-regex-8.0.0.tgz",
+ "integrity": "sha512-MSjYzcWNOA0ewAHpz0MxpYFvwg6yjy1NG3xteoqz644VCo/RPgnr1/GGt+ic3iJTzQ8Eu3TdM14SawnVUmGE6A==",
+ "dev": true
+ },
"node_modules/stylelint/node_modules/file-entry-cache": {
"version": "9.0.0",
"resolved": "https://registry.npmjs.org/file-entry-cache/-/file-entry-cache-9.0.0.tgz",
@@ -8474,6 +8431,32 @@
"node": ">=8"
}
},
+ "node_modules/stylelint/node_modules/string-width": {
+ "version": "4.2.3",
+ "resolved": "https://registry.npmjs.org/string-width/-/string-width-4.2.3.tgz",
+ "integrity": "sha512-wKyQRQpjJ0sIp62ErSZdGsjMJWsap5oRNihHhu6G7JVO/9jIB6UyevL+tXuOqrng8j/cxKTWyWUwvSTriiZz/g==",
+ "dev": true,
+ "dependencies": {
+ "emoji-regex": "^8.0.0",
+ "is-fullwidth-code-point": "^3.0.0",
+ "strip-ansi": "^6.0.1"
+ },
+ "engines": {
+ "node": ">=8"
+ }
+ },
+ "node_modules/stylelint/node_modules/string-width/node_modules/strip-ansi": {
+ "version": "6.0.1",
+ "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-6.0.1.tgz",
+ "integrity": "sha512-Y38VPSHcqkFrCpFnQ9vuSXmquuv5oXOKpGeT6aGrr3o3Gc9AlVa6JBfUSOCnbxGGZF+/0ooI7KrPuUSztUdU5A==",
+ "dev": true,
+ "dependencies": {
+ "ansi-regex": "^5.0.1"
+ },
+ "engines": {
+ "node": ">=8"
+ }
+ },
"node_modules/stylelint/node_modules/strip-ansi": {
"version": "7.1.0",
"resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-7.1.0.tgz",
@@ -8489,6 +8472,18 @@
"url": "https://github.com/chalk/strip-ansi?sponsor=1"
}
},
+ "node_modules/stylelint/node_modules/strip-ansi/node_modules/ansi-regex": {
+ "version": "6.0.1",
+ "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-6.0.1.tgz",
+ "integrity": "sha512-n5M855fKb2SsfMIiFFoVrABHJC8QtHwVx+mHWP3QcEqBHYienj5dHSgjbxtC0WEZXYt4wcD6zrQElDPhFuZgfA==",
+ "dev": true,
+ "engines": {
+ "node": ">=12"
+ },
+ "funding": {
+ "url": "https://github.com/chalk/ansi-regex?sponsor=1"
+ }
+ },
"node_modules/summary": {
"version": "2.1.0",
"resolved": "https://registry.npmjs.org/summary/-/summary-2.1.0.tgz",
@@ -8569,6 +8564,26 @@
"node": ">=10.0.0"
}
},
+ "node_modules/table/node_modules/emoji-regex": {
+ "version": "8.0.0",
+ "resolved": "https://registry.npmjs.org/emoji-regex/-/emoji-regex-8.0.0.tgz",
+ "integrity": "sha512-MSjYzcWNOA0ewAHpz0MxpYFvwg6yjy1NG3xteoqz644VCo/RPgnr1/GGt+ic3iJTzQ8Eu3TdM14SawnVUmGE6A==",
+ "dev": true
+ },
+ "node_modules/table/node_modules/string-width": {
+ "version": "4.2.3",
+ "resolved": "https://registry.npmjs.org/string-width/-/string-width-4.2.3.tgz",
+ "integrity": "sha512-wKyQRQpjJ0sIp62ErSZdGsjMJWsap5oRNihHhu6G7JVO/9jIB6UyevL+tXuOqrng8j/cxKTWyWUwvSTriiZz/g==",
+ "dev": true,
+ "dependencies": {
+ "emoji-regex": "^8.0.0",
+ "is-fullwidth-code-point": "^3.0.0",
+ "strip-ansi": "^6.0.1"
+ },
+ "engines": {
+ "node": ">=8"
+ }
+ },
"node_modules/tar-fs": {
"version": "3.0.6",
"resolved": "https://registry.npmjs.org/tar-fs/-/tar-fs-3.0.6.tgz",
@@ -8742,14 +8757,19 @@
}
},
"node_modules/typed-rest-client": {
- "version": "1.8.11",
- "resolved": "https://registry.npmjs.org/typed-rest-client/-/typed-rest-client-1.8.11.tgz",
- "integrity": "sha512-5UvfMpd1oelmUPRbbaVnq+rHP7ng2cE4qoQkQeAqxRL6PklkxsM0g32/HL0yfvruK6ojQ5x8EE+HF4YV6DtuCA==",
+ "version": "2.0.2",
+ "resolved": "https://registry.npmjs.org/typed-rest-client/-/typed-rest-client-2.0.2.tgz",
+ "integrity": "sha512-rmAQM2gZw/PQpK5+5aSs+I6ZBv4PFC2BT1o+0ADS1SgSejA+14EmbI2Lt8uXwkX7oeOMkwFmg0pHKwe8D9IT5A==",
"dev": true,
"dependencies": {
- "qs": "^6.9.1",
+ "des.js": "^1.1.0",
+ "js-md4": "^0.3.2",
+ "qs": "^6.10.3",
"tunnel": "0.0.6",
"underscore": "^1.12.1"
+ },
+ "engines": {
+ "node": ">= 16.0.0"
}
},
"node_modules/typescript": {
@@ -8766,14 +8786,14 @@
}
},
"node_modules/typescript-eslint": {
- "version": "8.0.0-alpha.58",
- "resolved": "https://registry.npmjs.org/typescript-eslint/-/typescript-eslint-8.0.0-alpha.58.tgz",
- "integrity": "sha512-0mvrodNhExpkWns+5RaZP8YqsAfPyjmPVVM1p+kaJkvApMH58/VFcQ0iSQuun0bFRNCMvW0ZUdulS9AsHqVXkg==",
+ "version": "8.0.0",
+ "resolved": "https://registry.npmjs.org/typescript-eslint/-/typescript-eslint-8.0.0.tgz",
+ "integrity": "sha512-yQWBJutWL1PmpmDddIOl9/Mi6vZjqNCjqSGBMQ4vsc2Aiodk0SnbQQWPXbSy0HNuKCuGkw1+u4aQ2mO40TdhDQ==",
"dev": true,
"dependencies": {
- "@typescript-eslint/eslint-plugin": "8.0.0-alpha.58",
- "@typescript-eslint/parser": "8.0.0-alpha.58",
- "@typescript-eslint/utils": "8.0.0-alpha.58"
+ "@typescript-eslint/eslint-plugin": "8.0.0",
+ "@typescript-eslint/parser": "8.0.0",
+ "@typescript-eslint/utils": "8.0.0"
},
"engines": {
"node": "^18.18.0 || ^20.9.0 || >=21.1.0"
@@ -8805,9 +8825,9 @@
"dev": true
},
"node_modules/undici-types": {
- "version": "6.11.1",
- "resolved": "https://registry.npmjs.org/undici-types/-/undici-types-6.11.1.tgz",
- "integrity": "sha512-mIDEX2ek50x0OlRgxryxsenE5XaQD4on5U2inY7RApK3SOJpofyw7uW2AyfMKkhAxXIceo2DeWGVGwyvng1GNQ==",
+ "version": "6.13.0",
+ "resolved": "https://registry.npmjs.org/undici-types/-/undici-types-6.13.0.tgz",
+ "integrity": "sha512-xtFJHudx8S2DSoujjMd1WeWvn7KKWFRESZTMeL1RptAYERu29D6jphMjjY+vn96jvN3kVPDNxU/E13VTaXj6jg==",
"dev": true
},
"node_modules/unicode-canonical-property-names-ecmascript": {
@@ -8913,6 +8933,7 @@
"resolved": "https://registry.npmjs.org/wcwidth/-/wcwidth-1.0.1.tgz",
"integrity": "sha512-XHPEwS0q6TaxcvG85+8EYkbiCux2XtWG2mkc47Ng2A77BQu9+DqIOJldST4HgPkuea7dvKSj5VgX3P1d4rW8Tg==",
"dev": true,
+ "optional": true,
"dependencies": {
"defaults": "^1.0.3"
}
@@ -9012,6 +9033,26 @@
"integrity": "sha512-dOy+3AuW3a2wNbZHIuMZpTcgjGuLU/uBL/ubcZF9OXbDo8ff4O8yVp5Bf0efS8uEoYo5q4Fx7dY9OgQGXgAsQA==",
"dev": true
},
+ "node_modules/wrap-ansi-cjs/node_modules/emoji-regex": {
+ "version": "8.0.0",
+ "resolved": "https://registry.npmjs.org/emoji-regex/-/emoji-regex-8.0.0.tgz",
+ "integrity": "sha512-MSjYzcWNOA0ewAHpz0MxpYFvwg6yjy1NG3xteoqz644VCo/RPgnr1/GGt+ic3iJTzQ8Eu3TdM14SawnVUmGE6A==",
+ "dev": true
+ },
+ "node_modules/wrap-ansi-cjs/node_modules/string-width": {
+ "version": "4.2.3",
+ "resolved": "https://registry.npmjs.org/string-width/-/string-width-4.2.3.tgz",
+ "integrity": "sha512-wKyQRQpjJ0sIp62ErSZdGsjMJWsap5oRNihHhu6G7JVO/9jIB6UyevL+tXuOqrng8j/cxKTWyWUwvSTriiZz/g==",
+ "dev": true,
+ "dependencies": {
+ "emoji-regex": "^8.0.0",
+ "is-fullwidth-code-point": "^3.0.0",
+ "strip-ansi": "^6.0.1"
+ },
+ "engines": {
+ "node": ">=8"
+ }
+ },
"node_modules/wrap-ansi/node_modules/ansi-styles": {
"version": "4.3.0",
"resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-4.3.0.tgz",
@@ -9045,6 +9086,26 @@
"integrity": "sha512-dOy+3AuW3a2wNbZHIuMZpTcgjGuLU/uBL/ubcZF9OXbDo8ff4O8yVp5Bf0efS8uEoYo5q4Fx7dY9OgQGXgAsQA==",
"dev": true
},
+ "node_modules/wrap-ansi/node_modules/emoji-regex": {
+ "version": "8.0.0",
+ "resolved": "https://registry.npmjs.org/emoji-regex/-/emoji-regex-8.0.0.tgz",
+ "integrity": "sha512-MSjYzcWNOA0ewAHpz0MxpYFvwg6yjy1NG3xteoqz644VCo/RPgnr1/GGt+ic3iJTzQ8Eu3TdM14SawnVUmGE6A==",
+ "dev": true
+ },
+ "node_modules/wrap-ansi/node_modules/string-width": {
+ "version": "4.2.3",
+ "resolved": "https://registry.npmjs.org/string-width/-/string-width-4.2.3.tgz",
+ "integrity": "sha512-wKyQRQpjJ0sIp62ErSZdGsjMJWsap5oRNihHhu6G7JVO/9jIB6UyevL+tXuOqrng8j/cxKTWyWUwvSTriiZz/g==",
+ "dev": true,
+ "dependencies": {
+ "emoji-regex": "^8.0.0",
+ "is-fullwidth-code-point": "^3.0.0",
+ "strip-ansi": "^6.0.1"
+ },
+ "engines": {
+ "node": ">=8"
+ }
+ },
"node_modules/wrappy": {
"version": "1.0.2",
"resolved": "https://registry.npmjs.org/wrappy/-/wrappy-1.0.2.tgz",
@@ -9127,6 +9188,26 @@
"node": ">=12"
}
},
+ "node_modules/yargs/node_modules/emoji-regex": {
+ "version": "8.0.0",
+ "resolved": "https://registry.npmjs.org/emoji-regex/-/emoji-regex-8.0.0.tgz",
+ "integrity": "sha512-MSjYzcWNOA0ewAHpz0MxpYFvwg6yjy1NG3xteoqz644VCo/RPgnr1/GGt+ic3iJTzQ8Eu3TdM14SawnVUmGE6A==",
+ "dev": true
+ },
+ "node_modules/yargs/node_modules/string-width": {
+ "version": "4.2.3",
+ "resolved": "https://registry.npmjs.org/string-width/-/string-width-4.2.3.tgz",
+ "integrity": "sha512-wKyQRQpjJ0sIp62ErSZdGsjMJWsap5oRNihHhu6G7JVO/9jIB6UyevL+tXuOqrng8j/cxKTWyWUwvSTriiZz/g==",
+ "dev": true,
+ "dependencies": {
+ "emoji-regex": "^8.0.0",
+ "is-fullwidth-code-point": "^3.0.0",
+ "strip-ansi": "^6.0.1"
+ },
+ "engines": {
+ "node": ">=8"
+ }
+ },
"node_modules/yauzl": {
"version": "2.10.0",
"resolved": "https://registry.npmjs.org/yauzl/-/yauzl-2.10.0.tgz",
@@ -9149,6 +9230,30 @@
"url": "https://github.com/sponsors/sindresorhus"
}
},
+ "node_modules/yoctocolors": {
+ "version": "2.1.1",
+ "resolved": "https://registry.npmjs.org/yoctocolors/-/yoctocolors-2.1.1.tgz",
+ "integrity": "sha512-GQHQqAopRhwU8Kt1DDM8NjibDXHC8eoh1erhGAJPEyveY9qqVeXvVikNKrDz69sHowPMorbPUrH/mx8c50eiBQ==",
+ "dev": true,
+ "engines": {
+ "node": ">=18"
+ },
+ "funding": {
+ "url": "https://github.com/sponsors/sindresorhus"
+ }
+ },
+ "node_modules/yoctocolors-cjs": {
+ "version": "2.1.2",
+ "resolved": "https://registry.npmjs.org/yoctocolors-cjs/-/yoctocolors-cjs-2.1.2.tgz",
+ "integrity": "sha512-cYVsTjKl8b+FrnidjibDWskAv7UKOfcwaVZdp/it9n1s9fU3IkgDbhdIRKCW4JDsAlECJY0ytoVPT3sK6kideA==",
+ "dev": true,
+ "engines": {
+ "node": ">=18"
+ },
+ "funding": {
+ "url": "https://github.com/sponsors/sindresorhus"
+ }
+ },
"node_modules/zod": {
"version": "3.23.8",
"resolved": "https://registry.npmjs.org/zod/-/zod-3.23.8.tgz",
@@ -9159,9 +9264,9 @@
}
},
"node_modules/zod-validation-error": {
- "version": "3.3.0",
- "resolved": "https://registry.npmjs.org/zod-validation-error/-/zod-validation-error-3.3.0.tgz",
- "integrity": "sha512-Syib9oumw1NTqEv4LT0e6U83Td9aVRk9iTXPUQr1otyV1PuXQKOvOwhMNqZIq5hluzHP2pMgnOmHEo7kPdI2mw==",
+ "version": "3.3.1",
+ "resolved": "https://registry.npmjs.org/zod-validation-error/-/zod-validation-error-3.3.1.tgz",
+ "integrity": "sha512-uFzCZz7FQis256dqw4AhPQgD6f3pzNca/Zh62RNELavlumQB3nDIUFbF5JQfFLcMbO1s02Q7Xg/gpcOBlEnYZA==",
"dev": true,
"engines": {
"node": ">=18.0.0"
@@ -9185,7 +9290,7 @@
],
"license": "MIT-0",
"engines": {
- "node": "^14 || ^16 || >=18"
+ "node": ">=18"
},
"peerDependencies": {
"postcss": "^8.4"
@@ -9206,7 +9311,7 @@
],
"license": "MIT",
"engines": {
- "node": "^14 || ^16 || >=18"
+ "node": ">=18"
},
"peerDependencies": {
"@csstools/css-parser-algorithms": "^2.7.1",
@@ -9228,7 +9333,7 @@
],
"license": "MIT-0",
"engines": {
- "node": "^14 || ^16 || >=18"
+ "node": ">=18"
}
},
"packages/css-calc": {
@@ -9246,7 +9351,7 @@
],
"license": "MIT",
"engines": {
- "node": "^14 || ^16 || >=18"
+ "node": ">=18"
},
"peerDependencies": {
"@csstools/css-parser-algorithms": "^2.7.1",
@@ -9272,7 +9377,7 @@
"@csstools/css-calc": "^1.2.4"
},
"engines": {
- "node": "^14 || ^16 || >=18"
+ "node": ">=18"
},
"peerDependencies": {
"@csstools/css-parser-algorithms": "^2.7.1",
@@ -9294,7 +9399,7 @@
],
"license": "MIT",
"engines": {
- "node": "^14 || ^16 || >=18"
+ "node": ">=18"
},
"peerDependencies": {
"@csstools/css-tokenizer": "^2.4.1"
@@ -9315,12 +9420,12 @@
],
"license": "MIT",
"devDependencies": {
- "@rmenke/css-tokenizer-tests": "^1.1.5",
+ "@rmenke/css-tokenizer-tests": "^1.1.6",
"postcss": "^8.4.38",
"postcss-parser-tests": "^8.8.0"
},
"engines": {
- "node": "^14 || ^16 || >=18"
+ "node": ">=18"
}
},
"packages/generate-test-cases": {
@@ -9341,7 +9446,7 @@
"mdn-data": "^2.7.0"
},
"engines": {
- "node": "^14 || ^16 || >=18"
+ "node": ">=18"
}
},
"packages/media-query-list-parser": {
@@ -9359,7 +9464,7 @@
],
"license": "MIT",
"engines": {
- "node": "^14 || ^16 || >=18"
+ "node": ">=18"
},
"peerDependencies": {
"@csstools/css-parser-algorithms": "^2.7.1",
@@ -9381,7 +9486,7 @@
],
"license": "MIT-0",
"engines": {
- "node": "^14 || ^16 || >=18"
+ "node": ">=18"
}
},
"packages/postcss-tape": {
@@ -9403,7 +9508,7 @@
"postcss-8.4": "npm:postcss@~8.4"
},
"engines": {
- "node": "^14 || ^16 || >=18"
+ "node": ">=18"
}
},
"packages/selector-resolve-nested": {
@@ -9424,7 +9529,7 @@
"postcss-selector-parser": "^6.1.0"
},
"engines": {
- "node": "^14 || ^16 || >=18"
+ "node": ">=18"
},
"peerDependencies": {
"postcss-selector-parser": "^6.1.0"
@@ -9448,7 +9553,7 @@
"postcss-selector-parser": "^6.1.0"
},
"engines": {
- "node": "^14 || ^16 || >=18"
+ "node": ">=18"
},
"peerDependencies": {
"postcss-selector-parser": "^6.1.0"
@@ -9472,7 +9577,7 @@
"postcss": "^8.4.38"
},
"engines": {
- "node": "^14 || ^16 || >=18"
+ "node": ">=18"
},
"peerDependencies": {
"postcss": "^8.4"
@@ -9504,7 +9609,7 @@
"open-props": "^1.7.4"
},
"engines": {
- "node": "^14 || ^16 || >=18"
+ "node": ">=18"
},
"peerDependencies": {
"postcss": "^8.4"
@@ -9592,7 +9697,7 @@
"@webref/css": "^6.14.0"
},
"engines": {
- "node": "^14 || ^16 || >=18"
+ "node": ">=18"
},
"peerDependencies": {
"postcss": "^8.4"
@@ -9618,7 +9723,7 @@
"stylelint-test-rule-node": "^0.3.0"
},
"engines": {
- "node": "^14 || ^16 || >=18"
+ "node": ">=18"
},
"peerDependencies": {
"stylelint": "^16.8.0"
@@ -9643,7 +9748,7 @@
"stylelint": "^16.6.0"
},
"engines": {
- "node": "^14 || ^16 || >=18"
+ "node": ">=18"
},
"peerDependencies": {
"stylelint": "^16.6.0"
@@ -9670,7 +9775,7 @@
"stylelint-test-rule-node": "^0.3.0"
},
"engines": {
- "node": "^14 || ^16 || >=18"
+ "node": ">=18"
},
"peerDependencies": {
"postcss": "^8.4",
@@ -9701,7 +9806,7 @@
"stylelint-test-rule-node": "^0.3.0"
},
"engines": {
- "node": "^14 || ^16 || >=18"
+ "node": ">=18"
},
"peerDependencies": {
"stylelint": "^16.8.0"
@@ -9728,7 +9833,7 @@
"puppeteer": "^22.14.0"
},
"engines": {
- "node": "^14 || ^16 || >=18"
+ "node": ">=18"
},
"peerDependencies": {
"postcss": "^8.4"
@@ -9761,7 +9866,7 @@
"puppeteer": "^22.14.0"
},
"engines": {
- "node": "^14 || ^16 || >=18"
+ "node": ">=18"
},
"peerDependencies": {
"postcss": "^8.4"
@@ -9785,7 +9890,7 @@
"puppeteer": "^22.14.0"
},
"engines": {
- "node": "^14 || ^16 || >=18"
+ "node": ">=18"
},
"peerDependencies": {
"postcss": "^8.4"
@@ -9811,7 +9916,7 @@
"@csstools/postcss-tape": "*"
},
"engines": {
- "node": "^14 || ^16 || >=18"
+ "node": ">=18"
},
"peerDependencies": {
"postcss": "^8.4"
@@ -9835,7 +9940,7 @@
"@csstools/postcss-tape": "*"
},
"engines": {
- "node": "^14 || ^16 || >=18"
+ "node": ">=18"
},
"peerDependencies": {
"postcss": "^8.4"
@@ -9859,7 +9964,7 @@
"browserslist": "^4.23.1"
},
"engines": {
- "node": "^14 || ^16 || >=18"
+ "node": ">=18"
},
"peerDependencies": {
"browserslist": "^4.23.1",
@@ -9890,7 +9995,7 @@
"puppeteer": "^22.14.0"
},
"engines": {
- "node": "^14 || ^16 || >=18"
+ "node": ">=18"
},
"peerDependencies": {
"postcss": "^8.4"
@@ -9922,7 +10027,7 @@
"postcss-lab-function": "^6.0.0"
},
"engines": {
- "node": "^14 || ^16 || >=18"
+ "node": ">=18"
},
"peerDependencies": {
"postcss": "^8.4"
@@ -9952,7 +10057,7 @@
"@csstools/postcss-tape": "*"
},
"engines": {
- "node": "^14 || ^16 || >=18"
+ "node": ">=18"
},
"peerDependencies": {
"postcss": "^8.4"
@@ -9979,7 +10084,7 @@
"@csstools/postcss-tape": "*"
},
"engines": {
- "node": "^14 || ^16 || >=18"
+ "node": ">=18"
},
"peerDependencies": {
"postcss": "^8.4"
@@ -10010,7 +10115,7 @@
"@csstools/postcss-tape": "*"
},
"engines": {
- "node": "^14 || ^16 || >=18"
+ "node": ">=18"
},
"peerDependencies": {
"postcss": "^8.4"
@@ -10037,7 +10142,7 @@
"@csstools/postcss-tape": "*"
},
"engines": {
- "node": "^14 || ^16 || >=18"
+ "node": ">=18"
},
"peerDependencies": {
"postcss": "^8.4"
@@ -10062,7 +10167,7 @@
"postcss-value-parser": "^4.2.0"
},
"engines": {
- "node": "^14 || ^16 || >=18"
+ "node": ">=18"
},
"peerDependencies": {
"postcss": "^8.4"
@@ -10092,7 +10197,7 @@
"@csstools/postcss-tape": "*"
},
"engines": {
- "node": "^14 || ^16 || >=18"
+ "node": ">=18"
},
"peerDependencies": {
"postcss": "^8.4"
@@ -10124,7 +10229,7 @@
"@csstools/postcss-tape": "*"
},
"engines": {
- "node": "^14 || ^16 || >=18"
+ "node": ">=18"
},
"peerDependencies": {
"postcss": "^8.4"
@@ -10153,7 +10258,7 @@
"@csstools/postcss-tape": "*"
},
"engines": {
- "node": "^14 || ^16 || >=18"
+ "node": ">=18"
},
"peerDependencies": {
"postcss": "^8.4"
@@ -10184,7 +10289,7 @@
"@csstools/postcss-tape": "*"
},
"engines": {
- "node": "^14 || ^16 || >=18"
+ "node": ">=18"
},
"peerDependencies": {
"postcss": "^8.4"
@@ -10213,7 +10318,7 @@
"@csstools/postcss-tape": "*"
},
"engines": {
- "node": "^14 || ^16 || >=18"
+ "node": ">=18"
},
"peerDependencies": {
"postcss": "^8.4"
@@ -10237,7 +10342,7 @@
"@csstools/postcss-tape": "*"
},
"engines": {
- "node": "^14 || ^16 || >=18"
+ "node": ">=18"
},
"peerDependencies": {
"postcss": "^8.4"
@@ -10268,7 +10373,7 @@
"style-dictionary-design-tokens-example": "^1.1.0"
},
"engines": {
- "node": "^14 || ^16 || >=18"
+ "node": ">=18"
},
"peerDependencies": {
"postcss": "^8.4"
@@ -10294,7 +10399,7 @@
"@csstools/postcss-tape": "*"
},
"engines": {
- "node": "^14 || ^16 || >=18"
+ "node": ">=18"
},
"peerDependencies": {
"postcss": "^8.4"
@@ -10322,7 +10427,7 @@
"@csstools/postcss-tape": "*"
},
"engines": {
- "node": "^14 || ^16 || >=18"
+ "node": ">=18"
},
"peerDependencies": {
"postcss": "^8.4"
@@ -10348,7 +10453,7 @@
"@csstools/postcss-tape": "*"
},
"engines": {
- "node": "^14 || ^16 || >=18"
+ "node": ">=18"
},
"peerDependencies": {
"postcss": "^8.4"
@@ -10377,7 +10482,7 @@
"@csstools/postcss-tape": "*"
},
"engines": {
- "node": "^14 || ^16 || >=18"
+ "node": ">=18"
},
"peerDependencies": {
"postcss": "^8.4"
@@ -10404,7 +10509,7 @@
"@csstools/postcss-tape": "*"
},
"engines": {
- "node": "^14 || ^16 || >=18"
+ "node": ">=18"
},
"peerDependencies": {
"postcss": "^8.4"
@@ -10431,7 +10536,7 @@
"puppeteer": "^22.14.0"
},
"engines": {
- "node": "^14 || ^16 || >=18"
+ "node": ">=18"
},
"peerDependencies": {
"postcss": "^8.4"
@@ -10458,7 +10563,7 @@
"puppeteer": "^22.14.0"
},
"engines": {
- "node": "^14 || ^16 || >=18"
+ "node": ">=18"
},
"peerDependencies": {
"postcss": "^8.4"
@@ -10486,7 +10591,7 @@
"@csstools/postcss-tape": "*"
},
"engines": {
- "node": "^14 || ^16 || >=18"
+ "node": ">=18"
},
"peerDependencies": {
"postcss": "^8.4"
@@ -10515,7 +10620,7 @@
"@csstools/postcss-tape": "*"
},
"engines": {
- "node": "^14 || ^16 || >=18"
+ "node": ">=18"
},
"peerDependencies": {
"postcss": "^8.4"
@@ -10538,7 +10643,7 @@
"@csstools/postcss-tape": "*"
},
"engines": {
- "node": "^14 || ^16 || >=18"
+ "node": ">=18"
},
"peerDependencies": {
"postcss": "^8.4"
@@ -10565,7 +10670,7 @@
"postcss-custom-properties": "^13.3.12"
},
"engines": {
- "node": "^14 || ^16 || >=18"
+ "node": ">=18"
},
"peerDependencies": {
"postcss": "^8.4"
@@ -10596,7 +10701,7 @@
"@csstools/postcss-tape": "*"
},
"engines": {
- "node": "^14 || ^16 || >=18"
+ "node": ">=18"
},
"peerDependencies": {
"postcss": "^8.4"
@@ -10627,7 +10732,7 @@
"@csstools/postcss-tape": "*"
},
"engines": {
- "node": "^14 || ^16 || >=18"
+ "node": ">=18"
},
"peerDependencies": {
"postcss": "^8.4"
@@ -10656,7 +10761,7 @@
"@csstools/postcss-tape": "*"
},
"engines": {
- "node": "^14 || ^16 || >=18"
+ "node": ">=18"
},
"peerDependencies": {
"postcss": "^8.4"
@@ -10683,7 +10788,7 @@
"@csstools/postcss-tape": "*"
},
"engines": {
- "node": "^14 || ^16 || >=18"
+ "node": ">=18"
},
"peerDependencies": {
"postcss": "^8.4"
@@ -10707,7 +10812,7 @@
"@csstools/postcss-tape": "*"
},
"engines": {
- "node": "^14 || ^16 || >=18"
+ "node": ">=18"
},
"peerDependencies": {
"postcss": "^8.4"
@@ -10736,7 +10841,7 @@
"puppeteer": "^22.14.0"
},
"engines": {
- "node": "^14 || ^16 || >=18"
+ "node": ">=18"
},
"peerDependencies": {
"postcss": "^8.4"
@@ -10766,7 +10871,7 @@
"@csstools/postcss-tape": "*"
},
"engines": {
- "node": "^14 || ^16 || >=18"
+ "node": ">=18"
},
"peerDependencies": {
"postcss": "^8.4"
@@ -10798,7 +10903,7 @@
"puppeteer": "^22.14.0"
},
"engines": {
- "node": "^14 || ^16 || >=18"
+ "node": ">=18"
},
"peerDependencies": {
"postcss": "^8.4"
@@ -10824,7 +10929,7 @@
"@csstools/postcss-tape": "*"
},
"engines": {
- "node": "^14 || ^16 || >=18"
+ "node": ">=18"
},
"peerDependencies": {
"postcss": "^8.4"
@@ -10848,7 +10953,7 @@
"@csstools/postcss-tape": "*"
},
"engines": {
- "node": "^14 || ^16 || >=18"
+ "node": ">=18"
},
"peerDependencies": {
"postcss": "^8.4"
@@ -10872,7 +10977,7 @@
"@csstools/postcss-tape": "*"
},
"engines": {
- "node": "^14 || ^16 || >=18"
+ "node": ">=18"
},
"peerDependencies": {
"postcss": "^8.4"
@@ -10896,7 +11001,7 @@
"@csstools/postcss-tape": "*"
},
"engines": {
- "node": "^14 || ^16 || >=18"
+ "node": ">=18"
},
"peerDependencies": {
"postcss": "^8.4"
@@ -10923,7 +11028,7 @@
"@csstools/postcss-tape": "*"
},
"engines": {
- "node": "^14 || ^16 || >=18"
+ "node": ">=18"
},
"peerDependencies": {
"postcss": "^8.4"
@@ -10951,7 +11056,7 @@
"@csstools/postcss-tape": "*"
},
"engines": {
- "node": "^14 || ^16 || >=18"
+ "node": ">=18"
},
"peerDependencies": {
"postcss": "^8.4"
@@ -10982,7 +11087,7 @@
"puppeteer": "^22.14.0"
},
"engines": {
- "node": "^14 || ^16 || >=18"
+ "node": ">=18"
},
"peerDependencies": {
"postcss": "^8.4"
@@ -11011,7 +11116,7 @@
"@csstools/postcss-tape": "*"
},
"engines": {
- "node": "^14 || ^16 || >=18"
+ "node": ">=18"
},
"peerDependencies": {
"postcss": "^8.4"
@@ -11038,7 +11143,7 @@
"@csstools/postcss-tape": "*"
},
"engines": {
- "node": "^14 || ^16 || >=18"
+ "node": ">=18"
},
"peerDependencies": {
"postcss": "^8.4"
@@ -11066,7 +11171,7 @@
"@csstools/postcss-tape": "*"
},
"engines": {
- "node": "^14 || ^16 || >=18"
+ "node": ">=18"
},
"peerDependencies": {
"postcss": "^8.4"
@@ -11095,7 +11200,7 @@
"puppeteer": "^22.14.0"
},
"engines": {
- "node": "^14 || ^16 || >=18"
+ "node": ">=18"
},
"peerDependencies": {
"postcss": "^8.4"
@@ -11122,7 +11227,7 @@
"@csstools/postcss-tape": "*"
},
"engines": {
- "node": "^14 || ^16 || >=18"
+ "node": ">=18"
},
"peerDependencies": {
"postcss": "^8.4"
@@ -11153,7 +11258,7 @@
"@csstools/postcss-tape": "*"
},
"engines": {
- "node": "^14 || ^16 || >=18"
+ "node": ">=18"
},
"peerDependencies": {
"postcss": "^8.4"
@@ -11179,7 +11284,7 @@
"@csstools/postcss-tape": "*"
},
"engines": {
- "node": "^14 || ^16 || >=18"
+ "node": ">=18"
},
"peerDependencies": {
"postcss": "^8.4"
@@ -11205,7 +11310,7 @@
"@csstools/postcss-tape": "*"
},
"engines": {
- "node": "^14 || ^16 || >=18"
+ "node": ">=18"
},
"peerDependencies": {
"postcss": "^8.4"
@@ -11232,7 +11337,7 @@
"@csstools/postcss-tape": "*"
},
"engines": {
- "node": "^14 || ^16 || >=18"
+ "node": ">=18"
},
"peerDependencies": {
"postcss": "^8.4"
@@ -11258,7 +11363,7 @@
"@csstools/postcss-tape": "*"
},
"engines": {
- "node": "^14 || ^16 || >=18"
+ "node": ">=18"
},
"peerDependencies": {
"postcss": "^8.4"
@@ -11287,7 +11392,7 @@
"postcss-import": "^16.1.0"
},
"engines": {
- "node": "^14 || ^16 || >=18"
+ "node": ">=18"
},
"peerDependencies": {
"postcss": "^8.4"
@@ -11318,7 +11423,7 @@
"@csstools/postcss-tape": "*"
},
"engines": {
- "node": "^14 || ^16 || >=18"
+ "node": ">=18"
},
"peerDependencies": {
"postcss": "^8.4"
@@ -11346,7 +11451,7 @@
"@csstools/postcss-tape": "*"
},
"engines": {
- "node": "^14 || ^16 || >=18"
+ "node": ">=18"
},
"peerDependencies": {
"postcss": "^8.4"
@@ -11373,7 +11478,7 @@
"@csstools/postcss-tape": "*"
},
"engines": {
- "node": "^14 || ^16 || >=18"
+ "node": ">=18"
},
"peerDependencies": {
"postcss": "^8.4"
@@ -11399,7 +11504,7 @@
"@csstools/postcss-tape": "*"
},
"engines": {
- "node": "^14 || ^16 || >=18"
+ "node": ">=18"
},
"peerDependencies": {
"postcss": "^8.4"
@@ -11423,7 +11528,7 @@
"@csstools/postcss-tape": "*"
},
"engines": {
- "node": "^14 || ^16 || >=18"
+ "node": ">=18"
},
"peerDependencies": {
"postcss": "^8.4"
@@ -11452,7 +11557,7 @@
"@csstools/postcss-tape": "*"
},
"engines": {
- "node": "^14 || ^16 || >=18"
+ "node": ">=18"
},
"peerDependencies": {
"postcss": "^8.4"
@@ -11481,7 +11586,7 @@
"autoprefixer": "^10.4.19"
},
"engines": {
- "node": "^14 || ^16 || >=18"
+ "node": ">=18"
},
"peerDependencies": {
"postcss": "^8.4"
@@ -11510,7 +11615,7 @@
"@csstools/postcss-tape": "*"
},
"engines": {
- "node": "^14 || ^16 || >=18"
+ "node": ">=18"
},
"peerDependencies": {
"postcss": "^8.4"
@@ -11539,7 +11644,7 @@
"@csstools/postcss-tape": "*"
},
"engines": {
- "node": "^14 || ^16 || >=18"
+ "node": ">=18"
},
"peerDependencies": {
"postcss": "^8.4"
@@ -11563,7 +11668,7 @@
"@csstools/postcss-tape": "*"
},
"engines": {
- "node": "^14 || ^16 || >=18"
+ "node": ">=18"
},
"peerDependencies": {
"postcss": "^8.4"
diff --git a/package.json b/package.json
index 7a3233bc9..8053bb92d 100644
--- a/package.json
+++ b/package.json
@@ -43,7 +43,7 @@
"rollup": "^4.19.1",
"tslib": "^2.6.3",
"typescript": "^5.5.4",
- "typescript-eslint": "^8.0.0-alpha.58"
+ "typescript-eslint": "^8.0.0"
},
"scripts": {
"build": "npm run build --workspaces --if-present",
diff --git a/packages/base-cli/CHANGELOG.md b/packages/base-cli/CHANGELOG.md
index 260cd8d51..283387d0e 100644
--- a/packages/base-cli/CHANGELOG.md
+++ b/packages/base-cli/CHANGELOG.md
@@ -1 +1,5 @@
# Changes to PostCSS Base CLI
+
+### Unreleased (major)
+
+- Updated: Support for Node v18+ (major).
diff --git a/packages/base-cli/dist/index.cjs b/packages/base-cli/dist/index.cjs
index c657f3b3b..4037fa5cc 100644
--- a/packages/base-cli/dist/index.cjs
+++ b/packages/base-cli/dist/index.cjs
@@ -1 +1 @@
-"use strict";var t,e=require("postcss"),n=require("path"),s=require("fs");function parseArguments(e,n,s){const i=e.map((t=>t.trim())).filter((t=>!!t)),o={stdin:!1,stdout:!1,output:void 0,outputDir:void 0,inputs:[],inlineMap:!0,externalMap:!1,replace:!1,pluginOptions:{},debug:!1};let r,a=!1;for(let e=0;e1&&o.output)return console.warn('[error] omit "--output" when processing multiple inputs\n'),s(),t.InvalidArguments;0===o.inputs.length&&(o.stdin=!0),o.output||o.outputDir||o.replace||(o.stdout=!0),o.stdout&&(o.externalMap=!1);let p={};if(r)try{p=JSON.parse(r)}catch{return console.warn("[error] plugin options must be valid JSON\n"),s(),t.InvalidArguments}for(const e in p){const i=p[e];if(!n.includes(e))return console.warn(`[error] unknown plugin option: ${e}\n`),s(),t.InvalidArguments;o.pluginOptions[e]=i}return o}async function getStdin(){return new Promise((t=>{let e="",n=!1;if(setTimeout((()=>{n=!0,t("")}),1e4),process.stdin.isTTY){if(n)return;t(e)}else process.stdin.setEncoding("utf8"),process.stdin.on("readable",(()=>{let t="";for(;t=process.stdin.read();)e+=t??""})),process.stdin.on("end",(()=>{n||t(e)}))}))}async function stdinToStdout(t,n,s){let i="";try{const o=await getStdin();o||(s(),process.exit(1));const r=await e([t]).process(o,{from:"stdin",to:"stdout",map:!!n.inlineMap&&{inline:!0}});r.warnings().forEach((t=>{console.warn(t.toString())})),i=r.css}catch(t){t instanceof Error?console.error(n.debug?t:t.message):console.error(t),process.exit(1)}process.stdout.write(i+(n.inlineMap?"\n":"")),process.exit(0)}async function stdinToFs(t,i,o){let r=i.output;!r&&i.outputDir&&(r=n.join(i.outputDir,"output.css")),r||process.exit(0);try{const n=await getStdin();n||(o(),process.exit(1));const a=await e([t]).process(n,{from:"stdin",to:r,map:!(!i.inlineMap&&!i.externalMap)&&{inline:i.inlineMap}});a.warnings().forEach((t=>{console.warn(t.toString())})),i.externalMap&&a.map?await Promise.all([await s.promises.writeFile(r,a.css+(i.inlineMap?"\n":"")),await s.promises.writeFile(`${r}.map`,a.map.toString())]):await s.promises.writeFile(r,a.css+(i.inlineMap?"\n":""))}catch(t){t instanceof Error?console.error(i.debug?t:t.message):console.error(t),process.exit(1)}console.log(`CSS was written to "${n.normalize(r)}"`),process.exit(0)}async function fsToStdout(t,n){let i=[];try{i=await Promise.all(n.inputs.map((async n=>{const i=await s.promises.readFile(n),o=await e([t]).process(i,{from:n,to:"stdout",map:!1});return o.warnings().forEach((t=>{console.warn(t.toString())})),o.css})))}catch(t){t instanceof Error?console.error(n.debug?t:t.message):console.error(t),process.exit(1)}for(const t of i)process.stdout.write(t);process.exit(0)}async function fsToFs(t,i){try{await Promise.all(i.inputs.map((async o=>{let r=i.output;i.outputDir&&(r=n.join(i.outputDir,n.basename(o))),i.replace&&(r=o),r||process.exit(0);const a=await s.promises.readFile(o),p=await e([t]).process(a,{from:o,to:r,map:!(!i.inlineMap&&!i.externalMap)&&{inline:i.inlineMap}});p.warnings().forEach((t=>{console.warn(t.toString())})),i.externalMap&&p.map?await Promise.all([await s.promises.writeFile(r,p.css+(i.inlineMap?"\n":"")),await s.promises.writeFile(`${r}.map`,p.map.toString())]):await s.promises.writeFile(r,p.css+(i.inlineMap?"\n":"")),console.log(`CSS was written to "${n.normalize(r)}"`)})))}catch(t){t instanceof Error?console.error(i.debug?t:t.message):console.error(t),process.exit(1)}process.exit(0)}!function(t){t.InvalidArguments="INVALID_ARGUMENTS"}(t||(t={})),exports.cli=async function cli(e,n,s,i=!0){const o=parseArguments(process.argv.slice(i?2:3),n,s);o===t.InvalidArguments&&process.exit(1);const r=e(o.pluginOptions);o.stdin&&o.stdout?await stdinToStdout(r,o,s):o.stdin?await stdinToFs(r,o,s):o.stdout?await fsToStdout(r,o):await fsToFs(r,o)},exports.helpTextLogger=function helpTextLogger(t,e,n,s=null){let i=[];if(s){const t=Math.max(...Object.keys(s).map((t=>t.length))),e=new Array(t).fill(" ").join("");e.length&&(i=["\nPlugin Options:",...Object.keys(s).map((t=>` ${(t+e).slice(0,e.length)} ${typeof s[t]}`))],i.push(`\n ${JSON.stringify(s,null,2).split("\n").join("\n ")}`))}const o=[`${e}\n`,` ${n}\n`,"Usage:",` ${t} [input.css] [OPTIONS] [-o|--output output.css]`,` ${t} ... [OPTIONS] --dir `,` ${t} ... [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 i.length>0&&o.push(...i),()=>{console.warn(o.join("\n"))}},exports.parseArguments=parseArguments;
+"use strict";var t,e=require("postcss"),n=require("node:path"),s=require("node:fs/promises");function parseArguments(e,n,s){const o=e.map((t=>t.trim())).filter((t=>!!t)),i={stdin:!1,stdout:!1,output:void 0,outputDir:void 0,inputs:[],inlineMap:!0,externalMap:!1,replace:!1,pluginOptions:{},debug:!1};let r,a=!1;for(let e=0;e1&&i.output)return console.warn('[error] omit "--output" when processing multiple inputs\n'),s(),t.InvalidArguments;0===i.inputs.length&&(i.stdin=!0),i.output||i.outputDir||i.replace||(i.stdout=!0),i.stdout&&(i.externalMap=!1);let p={};if(r)try{p=JSON.parse(r)}catch{return console.warn("[error] plugin options must be valid JSON\n"),s(),t.InvalidArguments}for(const e in p){const o=p[e];if(!n.includes(e))return console.warn(`[error] unknown plugin option: ${e}\n`),s(),t.InvalidArguments;i.pluginOptions[e]=o}return i}async function getStdin(){return new Promise((t=>{let e="",n=!1;if(setTimeout((()=>{n=!0,t("")}),1e4),process.stdin.isTTY){if(n)return;t(e)}else process.stdin.setEncoding("utf8"),process.stdin.on("readable",(()=>{let t="";for(;t=process.stdin.read();)e+=t??""})),process.stdin.on("end",(()=>{n||t(e)}))}))}async function stdinToStdout(t,n,s){let o="";try{const i=await getStdin();i||(s(),process.exit(1));const r=await e([t]).process(i,{from:"stdin",to:"stdout",map:!!n.inlineMap&&{inline:!0}});r.warnings().forEach((t=>{console.warn(t.toString())})),o=r.css}catch(t){t instanceof Error?console.error(n.debug?t:t.message):console.error(t),process.exit(1)}process.stdout.write(o+(n.inlineMap?"\n":"")),process.exit(0)}async function stdinToFs(t,o,i){let r=o.output;!r&&o.outputDir&&(r=n.join(o.outputDir,"output.css")),r||process.exit(0);try{const n=await getStdin();n||(i(),process.exit(1));const a=await e([t]).process(n,{from:"stdin",to:r,map:!(!o.inlineMap&&!o.externalMap)&&{inline:o.inlineMap}});a.warnings().forEach((t=>{console.warn(t.toString())})),o.externalMap&&a.map?await Promise.all([await s.writeFile(r,a.css+(o.inlineMap?"\n":"")),await s.writeFile(`${r}.map`,a.map.toString())]):await s.writeFile(r,a.css+(o.inlineMap?"\n":""))}catch(t){t instanceof Error?console.error(o.debug?t:t.message):console.error(t),process.exit(1)}console.log(`CSS was written to "${n.normalize(r)}"`),process.exit(0)}async function fsToStdout(t,n){let o=[];try{o=await Promise.all(n.inputs.map((async n=>{const o=await s.readFile(n),i=await e([t]).process(o,{from:n,to:"stdout",map:!1});return i.warnings().forEach((t=>{console.warn(t.toString())})),i.css})))}catch(t){t instanceof Error?console.error(n.debug?t:t.message):console.error(t),process.exit(1)}for(const t of o)process.stdout.write(t);process.exit(0)}async function fsToFs(t,o){try{await Promise.all(o.inputs.map((async i=>{let r=o.output;o.outputDir&&(r=n.join(o.outputDir,n.basename(i))),o.replace&&(r=i),r||process.exit(0);const a=await s.readFile(i),p=await e([t]).process(a,{from:i,to:r,map:!(!o.inlineMap&&!o.externalMap)&&{inline:o.inlineMap}});p.warnings().forEach((t=>{console.warn(t.toString())})),o.externalMap&&p.map?await Promise.all([await s.writeFile(r,p.css+(o.inlineMap?"\n":"")),await s.writeFile(`${r}.map`,p.map.toString())]):await s.writeFile(r,p.css+(o.inlineMap?"\n":"")),console.log(`CSS was written to "${n.normalize(r)}"`)})))}catch(t){t instanceof Error?console.error(o.debug?t:t.message):console.error(t),process.exit(1)}process.exit(0)}!function(t){t.InvalidArguments="INVALID_ARGUMENTS"}(t||(t={})),exports.cli=async function cli(e,n,s,o=!0){const i=parseArguments(process.argv.slice(o?2:3),n,s);i===t.InvalidArguments&&process.exit(1);const r=e(i.pluginOptions);i.stdin&&i.stdout?await stdinToStdout(r,i,s):i.stdin?await stdinToFs(r,i,s):i.stdout?await fsToStdout(r,i):await fsToFs(r,i)},exports.helpTextLogger=function helpTextLogger(t,e,n,s=null){let o=[];if(s){const t=Math.max(...Object.keys(s).map((t=>t.length))),e=new Array(t).fill(" ").join("");e.length&&(o=["\nPlugin Options:",...Object.keys(s).map((t=>` ${(t+e).slice(0,e.length)} ${typeof s[t]}`))],o.push(`\n ${JSON.stringify(s,null,2).split("\n").join("\n ")}`))}const i=[`${e}\n`,` ${n}\n`,"Usage:",` ${t} [input.css] [OPTIONS] [-o|--output output.css]`,` ${t} ... [OPTIONS] --dir `,` ${t} ... [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 o.length>0&&i.push(...o),()=>{console.warn(i.join("\n"))}},exports.parseArguments=parseArguments;
diff --git a/packages/base-cli/dist/index.mjs b/packages/base-cli/dist/index.mjs
index a65a269ac..727f0fdd0 100644
--- a/packages/base-cli/dist/index.mjs
+++ b/packages/base-cli/dist/index.mjs
@@ -1 +1 @@
-import t from"postcss";import e from"path";import{promises as n}from"fs";var o;function parseArguments(t,e,n){const s=t.map((t=>t.trim())).filter((t=>!!t)),i={stdin:!1,stdout:!1,output:void 0,outputDir:void 0,inputs:[],inlineMap:!0,externalMap:!1,replace:!1,pluginOptions:{},debug:!1};let r,a=!1;for(let t=0;t1&&i.output)return console.warn('[error] omit "--output" when processing multiple inputs\n'),n(),o.InvalidArguments;0===i.inputs.length&&(i.stdin=!0),i.output||i.outputDir||i.replace||(i.stdout=!0),i.stdout&&(i.externalMap=!1);let p={};if(r)try{p=JSON.parse(r)}catch{return console.warn("[error] plugin options must be valid JSON\n"),n(),o.InvalidArguments}for(const t in p){const s=p[t];if(!e.includes(t))return console.warn(`[error] unknown plugin option: ${t}\n`),n(),o.InvalidArguments;i.pluginOptions[t]=s}return i}async function getStdin(){return new Promise((t=>{let e="",n=!1;if(setTimeout((()=>{n=!0,t("")}),1e4),process.stdin.isTTY){if(n)return;t(e)}else process.stdin.setEncoding("utf8"),process.stdin.on("readable",(()=>{let t="";for(;t=process.stdin.read();)e+=t??""})),process.stdin.on("end",(()=>{n||t(e)}))}))}async function stdinToStdout(e,n,o){let s="";try{const i=await getStdin();i||(o(),process.exit(1));const r=await t([e]).process(i,{from:"stdin",to:"stdout",map:!!n.inlineMap&&{inline:!0}});r.warnings().forEach((t=>{console.warn(t.toString())})),s=r.css}catch(t){t instanceof Error?console.error(n.debug?t:t.message):console.error(t),process.exit(1)}process.stdout.write(s+(n.inlineMap?"\n":"")),process.exit(0)}async function stdinToFs(o,s,i){let r=s.output;!r&&s.outputDir&&(r=e.join(s.outputDir,"output.css")),r||process.exit(0);try{const e=await getStdin();e||(i(),process.exit(1));const a=await t([o]).process(e,{from:"stdin",to:r,map:!(!s.inlineMap&&!s.externalMap)&&{inline:s.inlineMap}});a.warnings().forEach((t=>{console.warn(t.toString())})),s.externalMap&&a.map?await Promise.all([await n.writeFile(r,a.css+(s.inlineMap?"\n":"")),await n.writeFile(`${r}.map`,a.map.toString())]):await n.writeFile(r,a.css+(s.inlineMap?"\n":""))}catch(t){t instanceof Error?console.error(s.debug?t:t.message):console.error(t),process.exit(1)}console.log(`CSS was written to "${e.normalize(r)}"`),process.exit(0)}async function fsToStdout(e,o){let s=[];try{s=await Promise.all(o.inputs.map((async o=>{const s=await n.readFile(o),i=await t([e]).process(s,{from:o,to:"stdout",map:!1});return i.warnings().forEach((t=>{console.warn(t.toString())})),i.css})))}catch(t){t instanceof Error?console.error(o.debug?t:t.message):console.error(t),process.exit(1)}for(const t of s)process.stdout.write(t);process.exit(0)}async function fsToFs(o,s){try{await Promise.all(s.inputs.map((async i=>{let r=s.output;s.outputDir&&(r=e.join(s.outputDir,e.basename(i))),s.replace&&(r=i),r||process.exit(0);const a=await n.readFile(i),p=await t([o]).process(a,{from:i,to:r,map:!(!s.inlineMap&&!s.externalMap)&&{inline:s.inlineMap}});p.warnings().forEach((t=>{console.warn(t.toString())})),s.externalMap&&p.map?await Promise.all([await n.writeFile(r,p.css+(s.inlineMap?"\n":"")),await n.writeFile(`${r}.map`,p.map.toString())]):await n.writeFile(r,p.css+(s.inlineMap?"\n":"")),console.log(`CSS was written to "${e.normalize(r)}"`)})))}catch(t){t instanceof Error?console.error(s.debug?t:t.message):console.error(t),process.exit(1)}process.exit(0)}function helpTextLogger(t,e,n,o=null){let s=[];if(o){const t=Math.max(...Object.keys(o).map((t=>t.length))),e=new Array(t).fill(" ").join("");e.length&&(s=["\nPlugin Options:",...Object.keys(o).map((t=>` ${(t+e).slice(0,e.length)} ${typeof o[t]}`))],s.push(`\n ${JSON.stringify(o,null,2).split("\n").join("\n ")}`))}const i=[`${e}\n`,` ${n}\n`,"Usage:",` ${t} [input.css] [OPTIONS] [-o|--output output.css]`,` ${t} ... [OPTIONS] --dir `,` ${t} ... [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"))}}async function cli(t,e,n,s=!0){const i=parseArguments(process.argv.slice(s?2:3),e,n);i===o.InvalidArguments&&process.exit(1);const r=t(i.pluginOptions);i.stdin&&i.stdout?await stdinToStdout(r,i,n):i.stdin?await stdinToFs(r,i,n):i.stdout?await fsToStdout(r,i):await fsToFs(r,i)}!function(t){t.InvalidArguments="INVALID_ARGUMENTS"}(o||(o={}));export{cli,helpTextLogger,parseArguments};
+import t from"postcss";import e from"node:path";import n from"node:fs/promises";var o;function parseArguments(t,e,n){const s=t.map((t=>t.trim())).filter((t=>!!t)),i={stdin:!1,stdout:!1,output:void 0,outputDir:void 0,inputs:[],inlineMap:!0,externalMap:!1,replace:!1,pluginOptions:{},debug:!1};let r,a=!1;for(let t=0;t1&&i.output)return console.warn('[error] omit "--output" when processing multiple inputs\n'),n(),o.InvalidArguments;0===i.inputs.length&&(i.stdin=!0),i.output||i.outputDir||i.replace||(i.stdout=!0),i.stdout&&(i.externalMap=!1);let p={};if(r)try{p=JSON.parse(r)}catch{return console.warn("[error] plugin options must be valid JSON\n"),n(),o.InvalidArguments}for(const t in p){const s=p[t];if(!e.includes(t))return console.warn(`[error] unknown plugin option: ${t}\n`),n(),o.InvalidArguments;i.pluginOptions[t]=s}return i}async function getStdin(){return new Promise((t=>{let e="",n=!1;if(setTimeout((()=>{n=!0,t("")}),1e4),process.stdin.isTTY){if(n)return;t(e)}else process.stdin.setEncoding("utf8"),process.stdin.on("readable",(()=>{let t="";for(;t=process.stdin.read();)e+=t??""})),process.stdin.on("end",(()=>{n||t(e)}))}))}async function stdinToStdout(e,n,o){let s="";try{const i=await getStdin();i||(o(),process.exit(1));const r=await t([e]).process(i,{from:"stdin",to:"stdout",map:!!n.inlineMap&&{inline:!0}});r.warnings().forEach((t=>{console.warn(t.toString())})),s=r.css}catch(t){t instanceof Error?console.error(n.debug?t:t.message):console.error(t),process.exit(1)}process.stdout.write(s+(n.inlineMap?"\n":"")),process.exit(0)}async function stdinToFs(o,s,i){let r=s.output;!r&&s.outputDir&&(r=e.join(s.outputDir,"output.css")),r||process.exit(0);try{const e=await getStdin();e||(i(),process.exit(1));const a=await t([o]).process(e,{from:"stdin",to:r,map:!(!s.inlineMap&&!s.externalMap)&&{inline:s.inlineMap}});a.warnings().forEach((t=>{console.warn(t.toString())})),s.externalMap&&a.map?await Promise.all([await n.writeFile(r,a.css+(s.inlineMap?"\n":"")),await n.writeFile(`${r}.map`,a.map.toString())]):await n.writeFile(r,a.css+(s.inlineMap?"\n":""))}catch(t){t instanceof Error?console.error(s.debug?t:t.message):console.error(t),process.exit(1)}console.log(`CSS was written to "${e.normalize(r)}"`),process.exit(0)}async function fsToStdout(e,o){let s=[];try{s=await Promise.all(o.inputs.map((async o=>{const s=await n.readFile(o),i=await t([e]).process(s,{from:o,to:"stdout",map:!1});return i.warnings().forEach((t=>{console.warn(t.toString())})),i.css})))}catch(t){t instanceof Error?console.error(o.debug?t:t.message):console.error(t),process.exit(1)}for(const t of s)process.stdout.write(t);process.exit(0)}async function fsToFs(o,s){try{await Promise.all(s.inputs.map((async i=>{let r=s.output;s.outputDir&&(r=e.join(s.outputDir,e.basename(i))),s.replace&&(r=i),r||process.exit(0);const a=await n.readFile(i),p=await t([o]).process(a,{from:i,to:r,map:!(!s.inlineMap&&!s.externalMap)&&{inline:s.inlineMap}});p.warnings().forEach((t=>{console.warn(t.toString())})),s.externalMap&&p.map?await Promise.all([await n.writeFile(r,p.css+(s.inlineMap?"\n":"")),await n.writeFile(`${r}.map`,p.map.toString())]):await n.writeFile(r,p.css+(s.inlineMap?"\n":"")),console.log(`CSS was written to "${e.normalize(r)}"`)})))}catch(t){t instanceof Error?console.error(s.debug?t:t.message):console.error(t),process.exit(1)}process.exit(0)}function helpTextLogger(t,e,n,o=null){let s=[];if(o){const t=Math.max(...Object.keys(o).map((t=>t.length))),e=new Array(t).fill(" ").join("");e.length&&(s=["\nPlugin Options:",...Object.keys(o).map((t=>` ${(t+e).slice(0,e.length)} ${typeof o[t]}`))],s.push(`\n ${JSON.stringify(o,null,2).split("\n").join("\n ")}`))}const i=[`${e}\n`,` ${n}\n`,"Usage:",` ${t} [input.css] [OPTIONS] [-o|--output output.css]`,` ${t} ... [OPTIONS] --dir `,` ${t} ... [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"))}}async function cli(t,e,n,s=!0){const i=parseArguments(process.argv.slice(s?2:3),e,n);i===o.InvalidArguments&&process.exit(1);const r=t(i.pluginOptions);i.stdin&&i.stdout?await stdinToStdout(r,i,n):i.stdin?await stdinToFs(r,i,n):i.stdout?await fsToStdout(r,i):await fsToFs(r,i)}!function(t){t.InvalidArguments="INVALID_ARGUMENTS"}(o||(o={}));export{cli,helpTextLogger,parseArguments};
diff --git a/packages/base-cli/package.json b/packages/base-cli/package.json
index 86b31777e..9e5ff894c 100644
--- a/packages/base-cli/package.json
+++ b/packages/base-cli/package.json
@@ -16,7 +16,7 @@
],
"private": true,
"engines": {
- "node": "^14 || ^16 || >=18"
+ "node": ">=18"
},
"type": "module",
"main": "dist/index.cjs",
diff --git a/packages/base-cli/src/io-fs-to-fs.ts b/packages/base-cli/src/io-fs-to-fs.ts
index ab2c42dd9..9b184fc15 100644
--- a/packages/base-cli/src/io-fs-to-fs.ts
+++ b/packages/base-cli/src/io-fs-to-fs.ts
@@ -1,8 +1,8 @@
-import path from 'path';
+import path from 'node:path';
import postcss from 'postcss';
import type { Plugin } from 'postcss';
-import { Arguments } from './args';
-import { promises as fsp } from 'fs';
+import type { Arguments } from './args';
+import fs from 'node:fs/promises';
// Read from one or more files and write to as many files
export async function fsToFs(plugin: Plugin, argo: Arguments): Promise {
@@ -21,7 +21,7 @@ export async function fsToFs(plugin: Plugin, argo: Arguments): Promise {
process.exit(0);
}
- const css = await fsp.readFile(input);
+ const css = await fs.readFile(input);
const result = await postcss([plugin]).process(css, {
from: input,
to: output,
@@ -34,11 +34,11 @@ export async function fsToFs(plugin: Plugin, argo: Arguments): Promise {
if (argo.externalMap && result.map) {
await Promise.all([
- await fsp.writeFile(output, result.css + (argo.inlineMap ? '\n' : '')),
- await fsp.writeFile(`${output}.map`, result.map.toString()),
+ await fs.writeFile(output, result.css + (argo.inlineMap ? '\n' : '')),
+ await fs.writeFile(`${output}.map`, result.map.toString()),
]);
} else {
- await fsp.writeFile(output, result.css + (argo.inlineMap ? '\n' : ''));
+ await fs.writeFile(output, result.css + (argo.inlineMap ? '\n' : ''));
}
console.log(`CSS was written to "${path.normalize(output)}"`);
diff --git a/packages/base-cli/src/io-fs-to-stdout.ts b/packages/base-cli/src/io-fs-to-stdout.ts
index adf64ebfd..4a87bcef5 100644
--- a/packages/base-cli/src/io-fs-to-stdout.ts
+++ b/packages/base-cli/src/io-fs-to-stdout.ts
@@ -1,14 +1,14 @@
import postcss from 'postcss';
import type { Plugin } from 'postcss';
-import { Arguments } from './args';
-import { promises as fsp } from 'fs';
+import type { Arguments } from './args';
+import fs from 'node:fs/promises';
// Read from one or more files and write to stdout
export async function fsToStdout(plugin: Plugin, argo: Arguments): Promise {
let allCss: Array = [];
try {
allCss = await Promise.all(argo.inputs.map(async (input) => {
- const css = await fsp.readFile(input);
+ const css = await fs.readFile(input);
const result = await postcss([plugin]).process(css, {
from: input,
to: 'stdout',
diff --git a/packages/base-cli/src/io-stdin-to-fs.ts b/packages/base-cli/src/io-stdin-to-fs.ts
index 20725d331..8f7d0a28c 100644
--- a/packages/base-cli/src/io-stdin-to-fs.ts
+++ b/packages/base-cli/src/io-stdin-to-fs.ts
@@ -1,9 +1,9 @@
-import path from 'path';
+import path from 'node:path';
import postcss from 'postcss';
import type { Plugin } from 'postcss';
-import { Arguments } from './args';
+import type { Arguments } from './args';
import { getStdin } from './get-stdin';
-import { promises as fsp } from 'fs';
+import fs from 'node:fs/promises';
// Read from stdin and write to a file
@@ -37,11 +37,11 @@ export async function stdinToFs(plugin: Plugin, argo: Arguments, helpLogger: ()
if (argo.externalMap && result.map) {
await Promise.all([
- await fsp.writeFile(output, result.css + (argo.inlineMap ? '\n' : '')),
- await fsp.writeFile(`${output}.map`, result.map.toString()),
+ await fs.writeFile(output, result.css + (argo.inlineMap ? '\n' : '')),
+ await fs.writeFile(`${output}.map`, result.map.toString()),
]);
} else {
- await fsp.writeFile(output, result.css + (argo.inlineMap ? '\n' : ''));
+ await fs.writeFile(output, result.css + (argo.inlineMap ? '\n' : ''));
}
} catch (err) {
if (err instanceof Error) {
diff --git a/packages/base-cli/src/io-stdin-to-stdout.ts b/packages/base-cli/src/io-stdin-to-stdout.ts
index 173ecf758..65805028b 100644
--- a/packages/base-cli/src/io-stdin-to-stdout.ts
+++ b/packages/base-cli/src/io-stdin-to-stdout.ts
@@ -1,4 +1,4 @@
-import { Arguments } from './args';
+import type { Arguments } from './args';
import postcss from 'postcss';
import type { Plugin } from 'postcss';
import { getStdin } from './get-stdin';
diff --git a/packages/cascade-layer-name-parser/CHANGELOG.md b/packages/cascade-layer-name-parser/CHANGELOG.md
index c6849a3c0..6c2f7a0cd 100644
--- a/packages/cascade-layer-name-parser/CHANGELOG.md
+++ b/packages/cascade-layer-name-parser/CHANGELOG.md
@@ -1,5 +1,9 @@
# Changes to Cascade Layer Name Parser
+### Unreleased (major)
+
+- Updated: Support for Node v18+ (major).
+
### 1.0.13
_July 6, 2024_
diff --git a/packages/cascade-layer-name-parser/dist/index.d.ts b/packages/cascade-layer-name-parser/dist/index.d.ts
index df9eef3f8..9b4e85c6f 100644
--- a/packages/cascade-layer-name-parser/dist/index.d.ts
+++ b/packages/cascade-layer-name-parser/dist/index.d.ts
@@ -1,4 +1,4 @@
-import { CSSToken } from '@csstools/css-tokenizer';
+import type { CSSToken } from '@csstools/css-tokenizer';
import { ParseError } from '@csstools/css-tokenizer';
export declare function addLayerToModel(layers: Array, currentLayerNames: Array): void;
diff --git a/packages/cascade-layer-name-parser/package.json b/packages/cascade-layer-name-parser/package.json
index 3c1a949f7..247e8bc5e 100644
--- a/packages/cascade-layer-name-parser/package.json
+++ b/packages/cascade-layer-name-parser/package.json
@@ -25,7 +25,7 @@
}
],
"engines": {
- "node": "^14 || ^16 || >=18"
+ "node": ">=18"
},
"type": "module",
"main": "dist/index.cjs",
diff --git a/packages/cascade-layer-name-parser/src/nodes/layer-name.ts b/packages/cascade-layer-name-parser/src/nodes/layer-name.ts
index 0d76406a2..1036b931d 100644
--- a/packages/cascade-layer-name-parser/src/nodes/layer-name.ts
+++ b/packages/cascade-layer-name-parser/src/nodes/layer-name.ts
@@ -1,5 +1,7 @@
-import { isTokenDelim, isTokenIdent, TokenDelim } from '@csstools/css-tokenizer';
-import { CSSToken, stringify, TokenIdent, TokenType } from '@csstools/css-tokenizer';
+import type { TokenDelim } from '@csstools/css-tokenizer';
+import { isTokenDelim, isTokenIdent } from '@csstools/css-tokenizer';
+import type { CSSToken, TokenIdent} from '@csstools/css-tokenizer';
+import { stringify, TokenType } from '@csstools/css-tokenizer';
export class LayerName {
parts: Array;
diff --git a/packages/cascade-layer-name-parser/src/parser/parse.ts b/packages/cascade-layer-name-parser/src/parser/parse.ts
index 45ff7ac09..9d63ea134 100644
--- a/packages/cascade-layer-name-parser/src/parser/parse.ts
+++ b/packages/cascade-layer-name-parser/src/parser/parse.ts
@@ -1,6 +1,7 @@
import { isCommentNode, isTokenNode, isWhitespaceNode } from '@csstools/css-parser-algorithms';
import { parseCommaSeparatedListOfComponentValues } from '@csstools/css-parser-algorithms';
-import { CSSToken, tokenizer, ParseError, isTokenComment, isTokenWhitespace, isTokenIdent, isTokenDelim, isTokenWhiteSpaceOrComment } from '@csstools/css-tokenizer';
+import type { CSSToken} from '@csstools/css-tokenizer';
+import { tokenizer, ParseError, isTokenComment, isTokenWhitespace, isTokenIdent, isTokenDelim, isTokenWhiteSpaceOrComment } from '@csstools/css-tokenizer';
import { LayerName } from '../nodes/layer-name';
/**
diff --git a/packages/cascade-layer-name-parser/src/util/model.ts b/packages/cascade-layer-name-parser/src/util/model.ts
index 58e8167e2..4fcd1b658 100644
--- a/packages/cascade-layer-name-parser/src/util/model.ts
+++ b/packages/cascade-layer-name-parser/src/util/model.ts
@@ -1,4 +1,4 @@
-import { LayerName } from '../nodes/layer-name';
+import type { LayerName } from '../nodes/layer-name';
// Insert new items after the most similar current item
//
diff --git a/packages/cascade-layer-name-parser/test/cases/various/0001.mjs b/packages/cascade-layer-name-parser/test/cases/various/0001.mjs
index 32a008cc8..02d7f53cf 100644
--- a/packages/cascade-layer-name-parser/test/cases/various/0001.mjs
+++ b/packages/cascade-layer-name-parser/test/cases/various/0001.mjs
@@ -1,4 +1,4 @@
-import assert from 'assert';
+import assert from 'node:assert';
import { runTest } from '../../util/run-test.mjs';
runTest(
diff --git a/packages/cascade-layer-name-parser/test/cases/various/0002.mjs b/packages/cascade-layer-name-parser/test/cases/various/0002.mjs
index a649e0dd6..6e4e95c55 100644
--- a/packages/cascade-layer-name-parser/test/cases/various/0002.mjs
+++ b/packages/cascade-layer-name-parser/test/cases/various/0002.mjs
@@ -1,4 +1,4 @@
-import assert from 'assert';
+import assert from 'node:assert';
import { runTest } from '../../util/run-test.mjs';
runTest(
diff --git a/packages/cascade-layer-name-parser/test/cases/various/0003.mjs b/packages/cascade-layer-name-parser/test/cases/various/0003.mjs
index 259bf1008..f459206ad 100644
--- a/packages/cascade-layer-name-parser/test/cases/various/0003.mjs
+++ b/packages/cascade-layer-name-parser/test/cases/various/0003.mjs
@@ -1,4 +1,4 @@
-import assert from 'assert';
+import assert from 'node:assert';
import { runTest } from '../../util/run-test.mjs';
runTest(
diff --git a/packages/cascade-layer-name-parser/test/cases/various/0004.mjs b/packages/cascade-layer-name-parser/test/cases/various/0004.mjs
index 8d01c2486..2abda93a8 100644
--- a/packages/cascade-layer-name-parser/test/cases/various/0004.mjs
+++ b/packages/cascade-layer-name-parser/test/cases/various/0004.mjs
@@ -1,4 +1,4 @@
-import assert from 'assert';
+import assert from 'node:assert';
import { runTest } from '../../util/run-test.mjs';
runTest(
diff --git a/packages/cascade-layer-name-parser/test/cases/various/0005.mjs b/packages/cascade-layer-name-parser/test/cases/various/0005.mjs
index 6e77c95da..805a31f15 100644
--- a/packages/cascade-layer-name-parser/test/cases/various/0005.mjs
+++ b/packages/cascade-layer-name-parser/test/cases/various/0005.mjs
@@ -1,4 +1,4 @@
-import assert from 'assert';
+import assert from 'node:assert';
import { runTest } from '../../util/run-test.mjs';
runTest(
diff --git a/packages/cascade-layer-name-parser/test/cases/various/0006.mjs b/packages/cascade-layer-name-parser/test/cases/various/0006.mjs
index 138d6056e..1e0850645 100644
--- a/packages/cascade-layer-name-parser/test/cases/various/0006.mjs
+++ b/packages/cascade-layer-name-parser/test/cases/various/0006.mjs
@@ -1,4 +1,4 @@
-import assert from 'assert';
+import assert from 'node:assert';
import { runTest } from '../../util/run-test.mjs';
runTest(
diff --git a/packages/cascade-layer-name-parser/test/cases/various/0007.mjs b/packages/cascade-layer-name-parser/test/cases/various/0007.mjs
index f869ff134..00a6172f3 100644
--- a/packages/cascade-layer-name-parser/test/cases/various/0007.mjs
+++ b/packages/cascade-layer-name-parser/test/cases/various/0007.mjs
@@ -1,4 +1,4 @@
-import assert from 'assert';
+import assert from 'node:assert';
import { runTest } from '../../util/run-test.mjs';
runTest(
diff --git a/packages/cascade-layer-name-parser/test/cases/various/0008.mjs b/packages/cascade-layer-name-parser/test/cases/various/0008.mjs
index 3970b75cc..524242e42 100644
--- a/packages/cascade-layer-name-parser/test/cases/various/0008.mjs
+++ b/packages/cascade-layer-name-parser/test/cases/various/0008.mjs
@@ -1,4 +1,4 @@
-import assert from 'assert';
+import assert from 'node:assert';
import { runTest } from '../../util/run-test.mjs';
runTest(
diff --git a/packages/cascade-layer-name-parser/test/cases/various/0009.mjs b/packages/cascade-layer-name-parser/test/cases/various/0009.mjs
index 586990df4..680ae984b 100644
--- a/packages/cascade-layer-name-parser/test/cases/various/0009.mjs
+++ b/packages/cascade-layer-name-parser/test/cases/various/0009.mjs
@@ -1,4 +1,4 @@
-import assert from 'assert';
+import assert from 'node:assert';
import { runTest } from '../../util/run-test.mjs';
runTest(
diff --git a/packages/cascade-layer-name-parser/test/cases/various/0010.mjs b/packages/cascade-layer-name-parser/test/cases/various/0010.mjs
index e7d15d7fe..ec83e6db0 100644
--- a/packages/cascade-layer-name-parser/test/cases/various/0010.mjs
+++ b/packages/cascade-layer-name-parser/test/cases/various/0010.mjs
@@ -1,4 +1,4 @@
-import assert from 'assert';
+import assert from 'node:assert';
import { runTest } from '../../util/run-test.mjs';
runTest(
diff --git a/packages/cascade-layer-name-parser/test/cases/various/0011.mjs b/packages/cascade-layer-name-parser/test/cases/various/0011.mjs
index f88b0a7b9..1fdebcbce 100644
--- a/packages/cascade-layer-name-parser/test/cases/various/0011.mjs
+++ b/packages/cascade-layer-name-parser/test/cases/various/0011.mjs
@@ -1,4 +1,4 @@
-import assert from 'assert';
+import assert from 'node:assert';
import { runTest } from '../../util/run-test.mjs';
runTest(
diff --git a/packages/cascade-layer-name-parser/test/cases/various/0012.mjs b/packages/cascade-layer-name-parser/test/cases/various/0012.mjs
index 7b3b0e00a..5b0243320 100644
--- a/packages/cascade-layer-name-parser/test/cases/various/0012.mjs
+++ b/packages/cascade-layer-name-parser/test/cases/various/0012.mjs
@@ -1,4 +1,4 @@
-import assert from 'assert';
+import assert from 'node:assert';
import { runTest } from '../../util/run-test.mjs';
runTest(
diff --git a/packages/cascade-layer-name-parser/test/cases/various/0013.mjs b/packages/cascade-layer-name-parser/test/cases/various/0013.mjs
index 6097361c6..9568ef351 100644
--- a/packages/cascade-layer-name-parser/test/cases/various/0013.mjs
+++ b/packages/cascade-layer-name-parser/test/cases/various/0013.mjs
@@ -1,4 +1,4 @@
-import assert from 'assert';
+import assert from 'node:assert';
import { runTest } from '../../util/run-test.mjs';
runTest(
diff --git a/packages/cascade-layer-name-parser/test/cases/various/0014.mjs b/packages/cascade-layer-name-parser/test/cases/various/0014.mjs
index 6aa53cf73..333db0ff1 100644
--- a/packages/cascade-layer-name-parser/test/cases/various/0014.mjs
+++ b/packages/cascade-layer-name-parser/test/cases/various/0014.mjs
@@ -1,4 +1,4 @@
-import assert from 'assert';
+import assert from 'node:assert';
import { runTest } from '../../util/run-test.mjs';
runTest(
diff --git a/packages/cascade-layer-name-parser/test/cases/various/0015.mjs b/packages/cascade-layer-name-parser/test/cases/various/0015.mjs
index c726c33a7..25206b70d 100644
--- a/packages/cascade-layer-name-parser/test/cases/various/0015.mjs
+++ b/packages/cascade-layer-name-parser/test/cases/various/0015.mjs
@@ -1,4 +1,4 @@
-import assert from 'assert';
+import assert from 'node:assert';
import { runTest } from '../../util/run-test.mjs';
runTest(
diff --git a/packages/cascade-layer-name-parser/test/cases/various/0016.mjs b/packages/cascade-layer-name-parser/test/cases/various/0016.mjs
index 05baab87e..e785b0cfa 100644
--- a/packages/cascade-layer-name-parser/test/cases/various/0016.mjs
+++ b/packages/cascade-layer-name-parser/test/cases/various/0016.mjs
@@ -1,4 +1,4 @@
-import assert from 'assert';
+import assert from 'node:assert';
import { runTest } from '../../util/run-test.mjs';
runTest(
diff --git a/packages/cascade-layer-name-parser/test/cases/various/0017.mjs b/packages/cascade-layer-name-parser/test/cases/various/0017.mjs
index ecca237e8..b40464ff6 100644
--- a/packages/cascade-layer-name-parser/test/cases/various/0017.mjs
+++ b/packages/cascade-layer-name-parser/test/cases/various/0017.mjs
@@ -1,4 +1,4 @@
-import assert from 'assert';
+import assert from 'node:assert';
import { runTest } from '../../util/run-test.mjs';
runTest(
diff --git a/packages/cascade-layer-name-parser/test/cases/various/0018.mjs b/packages/cascade-layer-name-parser/test/cases/various/0018.mjs
index e7dc77b39..662372fd8 100644
--- a/packages/cascade-layer-name-parser/test/cases/various/0018.mjs
+++ b/packages/cascade-layer-name-parser/test/cases/various/0018.mjs
@@ -1,4 +1,4 @@
-import assert from 'assert';
+import assert from 'node:assert';
import { runTest } from '../../util/run-test.mjs';
runTest(
diff --git a/packages/cascade-layer-name-parser/test/concat.mjs b/packages/cascade-layer-name-parser/test/concat.mjs
index fb25e4016..b5691291e 100644
--- a/packages/cascade-layer-name-parser/test/concat.mjs
+++ b/packages/cascade-layer-name-parser/test/concat.mjs
@@ -1,5 +1,5 @@
import { parse } from '@csstools/cascade-layer-name-parser';
-import assert from 'assert';
+import assert from 'node:assert';
{
const a = parse(' some-layer./* a comment */sub-layer ')[0];
diff --git a/packages/cascade-layer-name-parser/test/equal.mjs b/packages/cascade-layer-name-parser/test/equal.mjs
index c89ea8388..85f74cd91 100644
--- a/packages/cascade-layer-name-parser/test/equal.mjs
+++ b/packages/cascade-layer-name-parser/test/equal.mjs
@@ -1,5 +1,5 @@
import { parse } from '@csstools/cascade-layer-name-parser';
-import assert from 'assert';
+import assert from 'node:assert';
{
const layerNames = [
diff --git a/packages/cascade-layer-name-parser/test/model.mjs b/packages/cascade-layer-name-parser/test/model.mjs
index 2901caf3d..754d2d3d8 100644
--- a/packages/cascade-layer-name-parser/test/model.mjs
+++ b/packages/cascade-layer-name-parser/test/model.mjs
@@ -1,5 +1,5 @@
import { addLayerToModel, parse } from '@csstools/cascade-layer-name-parser';
-import assert from 'assert';
+import assert from 'node:assert';
{
const model = [];
diff --git a/packages/cascade-layer-name-parser/test/slice.mjs b/packages/cascade-layer-name-parser/test/slice.mjs
index 9d6697957..7af2a06c4 100644
--- a/packages/cascade-layer-name-parser/test/slice.mjs
+++ b/packages/cascade-layer-name-parser/test/slice.mjs
@@ -1,5 +1,5 @@
import { parse } from '@csstools/cascade-layer-name-parser';
-import assert from 'assert';
+import assert from 'node:assert';
{
const layerName = parse('alpha./* a comment */beta.gamma.delta')[0];
diff --git a/packages/cascade-layer-name-parser/test/tokens.mjs b/packages/cascade-layer-name-parser/test/tokens.mjs
index d99bf2273..3d85367d5 100644
--- a/packages/cascade-layer-name-parser/test/tokens.mjs
+++ b/packages/cascade-layer-name-parser/test/tokens.mjs
@@ -1,5 +1,5 @@
import { parse } from '@csstools/cascade-layer-name-parser';
-import assert from 'assert';
+import assert from 'node:assert';
// The "tokens" function exists for API parity with other parser tools.
// It's value is the same as "parts".
diff --git a/packages/cascade-layer-name-parser/test/util/run-test.mjs b/packages/cascade-layer-name-parser/test/util/run-test.mjs
index 7b280cec4..d54dd89b2 100644
--- a/packages/cascade-layer-name-parser/test/util/run-test.mjs
+++ b/packages/cascade-layer-name-parser/test/util/run-test.mjs
@@ -1,5 +1,5 @@
-import fs from 'fs';
-import path from 'path';
+import fs from 'node:fs';
+import path from 'node:path';
import { parse } from '@csstools/cascade-layer-name-parser';
export function runTest(source, testPath, assertEqual, expectSuccess = true) {
diff --git a/packages/color-helpers/CHANGELOG.md b/packages/color-helpers/CHANGELOG.md
index 076a21ba3..e166b0e13 100644
--- a/packages/color-helpers/CHANGELOG.md
+++ b/packages/color-helpers/CHANGELOG.md
@@ -1,5 +1,9 @@
# Changes to Color Helpers
+### Unreleased (major)
+
+- Updated: Support for Node v18+ (major).
+
### 4.2.1
_June 29, 2024_
diff --git a/packages/color-helpers/dist/index.cjs b/packages/color-helpers/dist/index.cjs
index aef73c91c..77709e145 100644
--- a/packages/color-helpers/dist/index.cjs
+++ b/packages/color-helpers/dist/index.cjs
@@ -1,10 +1,10 @@
-"use strict";function multiplyMatrices(t,o){return[t[0]*o[0]+t[1]*o[1]+t[2]*o[2],t[3]*o[0]+t[4]*o[1]+t[5]*o[2],t[6]*o[0]+t[7]*o[1]+t[8]*o[2]]}const t=[1.0479297925449969,.022946870601609652,-.05019226628920524,.02962780877005599,.9904344267538799,-.017073799063418826,-.009243040646204504,.015055191490298152,.7518742814281371];
+"use strict";function multiplyMatrices(t,n){return[t[0]*n[0]+t[1]*n[1]+t[2]*n[2],t[3]*n[0]+t[4]*n[1]+t[5]*n[2],t[6]*n[0]+t[7]*n[1]+t[8]*n[2]]}const t=[1.0479297925449969,.022946870601609652,-.05019226628920524,.02962780877005599,.9904344267538799,-.017073799063418826,-.009243040646204504,.015055191490298152,.7518742814281371];
/**
* Bradford chromatic adaptation from D65 to D50
* @license W3C https://www.w3.org/Consortium/Legal/2015/copyright-software-and-document
* @copyright This software or document includes material copied from or derived from https://github.com/w3c/csswg-drafts/blob/main/css-color-4/conversions.js. Copyright © 2022 W3C® (MIT, ERCIM, Keio, Beihang).
* @see http://www.brucelindbloom.com/index.html?Eqn_ChromAdapt.html
- */function D65_to_D50(o){return multiplyMatrices(t,o)}
+ */function D65_to_D50(n){return multiplyMatrices(t,n)}
/**
* @param {number} hue - Hue as degrees 0..360
* @param {number} sat - Saturation as percentage 0..100
@@ -14,7 +14,7 @@
* @license W3C https://www.w3.org/Consortium/Legal/2015/copyright-software-and-document
* @copyright This software or document includes material copied from or derived from https://github.com/w3c/csswg-drafts/blob/main/css-color-4/hslToRgb.js. Copyright © 2022 W3C® (MIT, ERCIM, Keio, Beihang).
* @see https://github.com/w3c/csswg-drafts/blob/main/css-color-4/hslToRgb.js
- */function HSL_to_sRGB(t){let o=t[0],_=t[1],n=t[2];function f(t){const e=(t+o/30)%12,r=_*Math.min(n,1-n);return n-r*Math.max(-1,Math.min(e-3,9-e,1))}return o%=360,o<0&&(o+=360),_/=100,n/=100,[f(0),f(8),f(4)]}
+ */function HSL_to_sRGB(t){let n=t[0]%360;const _=t[1]/100,o=t[2]/100;return n<0&&(n+=360),[HSL_to_sRGB_channel(0,n,_,o),HSL_to_sRGB_channel(8,n,_,o),HSL_to_sRGB_channel(4,n,_,o)]}function HSL_to_sRGB_channel(t,n,_,o){const e=(t+n/30)%12;return o-_*Math.min(o,1-o)*Math.max(-1,Math.min(e-3,9-e,1))}
/**
* @param {number} hue - Hue as degrees 0..360
* @param {number} white - Whiteness as percentage 0..100
@@ -24,22 +24,22 @@
* @license W3C https://www.w3.org/Consortium/Legal/2015/copyright-software-and-document
* @copyright This software or document includes material copied from or derived from https://github.com/w3c/csswg-drafts/blob/main/css-color-4/hwbToRgb.js. Copyright © 2022 W3C® (MIT, ERCIM, Keio, Beihang).
* @see https://github.com/w3c/csswg-drafts/blob/main/css-color-4/hwbToRgb.js
- */function HWB_to_sRGB(t){const o=t[0];let _=t[1],n=t[2];if(_/=100,n/=100,_+n>=1){const t=_/(_+n);return[t,t,t]}const e=HSL_to_sRGB([o,100,50]);for(let t=0;t<3;t++)e[t]*=1-_-n,e[t]+=_;return e}
+ */function HWB_to_sRGB(t){const n=t[0],_=t[1]/100,o=t[2]/100;if(_+o>=1){const t=_/(_+o);return[t,t,t]}const e=HSL_to_sRGB([n,100,50]),r=1-_-o;return[e[0]*r+_,e[1]*r+_,e[2]*r+_]}
/**
* @license W3C https://www.w3.org/Consortium/Legal/2015/copyright-software-and-document
* @copyright This software or document includes material copied from or derived from https://github.com/w3c/csswg-drafts/blob/main/css-color-4/conversions.js. Copyright © 2022 W3C® (MIT, ERCIM, Keio, Beihang).
- */const o=[.3457/.3585,1,.2958/.3585];
+ */function LCH_to_Lab(t){const n=t[2]*Math.PI/180;return[t[0],t[1]*Math.cos(n),t[1]*Math.sin(n)]}const n=[.3457/.3585,1,.2958/.3585];
/**
* Convert Lab to D50-adapted XYZ
* @license W3C https://www.w3.org/Consortium/Legal/2015/copyright-software-and-document
* @copyright This software or document includes material copied from or derived from https://github.com/w3c/csswg-drafts/blob/main/css-color-4/conversions.js. Copyright © 2022 W3C® (MIT, ERCIM, Keio, Beihang).
* @see http://www.brucelindbloom.com/index.html?Eqn_RGB_XYZ_Matrix.html
- */function Lab_to_XYZ(t){const _=24389/27,n=216/24389,e=[];e[1]=(t[0]+16)/116,e[0]=t[1]/500+e[1],e[2]=e[1]-t[2]/200;return[Math.pow(e[0],3)>n?Math.pow(e[0],3):(116*e[0]-16)/_,t[0]>8?Math.pow((t[0]+16)/116,3):t[0]/_,Math.pow(e[2],3)>n?Math.pow(e[2],3):(116*e[2]-16)/_].map(((t,_)=>t*o[_]))}
+ */function Lab_to_XYZ(t){const _=24389/27,o=216/24389,e=(t[0]+16)/116,r=t[1]/500+e,a=e-t[2]/200;return[(Math.pow(r,3)>o?Math.pow(r,3):(116*r-16)/_)*n[0],(t[0]>8?Math.pow((t[0]+16)/116,3):t[0]/_)*n[1],(Math.pow(a,3)>o?Math.pow(a,3):(116*a-16)/_)*n[2]]}
/**
* @license W3C https://www.w3.org/Consortium/Legal/2015/copyright-software-and-document
* @copyright This software or document includes material copied from or derived from https://github.com/w3c/csswg-drafts/blob/main/css-color-4/conversions.js. Copyright © 2022 W3C® (MIT, ERCIM, Keio, Beihang).
* @see https://github.com/w3c/csswg-drafts/blob/main/css-color-4/conversions.js
- */function OKLCH_to_OKLab(t){return[t[0],t[1]*Math.cos(t[2]*Math.PI/180),t[1]*Math.sin(t[2]*Math.PI/180)]}const _=[1.2268798758459243,-.5578149944602171,.2813910456659647,-.0405757452148008,1.112286803280317,-.0717110580655164,-.0763729366746601,-.4214933324022432,1.5869240198367816],n=[1,.3963377773761749,.2158037573099136,1,-.1055613458156586,-.0638541728258133,1,-.0894841775298119,-1.2914855480194092];
+ */function OKLCH_to_OKLab(t){const n=t[2]*Math.PI/180;return[t[0],t[1]*Math.cos(n),t[1]*Math.sin(n)]}const _=[1.2268798758459243,-.5578149944602171,.2813910456659647,-.0405757452148008,1.112286803280317,-.0717110580655164,-.0763729366746601,-.4214933324022432,1.5869240198367816],o=[1,.3963377773761749,.2158037573099136,1,-.1055613458156586,-.0638541728258133,1,-.0894841775298119,-1.2914855480194092];
/**
* Given OKLab, convert to XYZ relative to D65
*
@@ -47,7 +47,7 @@
* @copyright This software or document includes material copied from or derived from https://github.com/w3c/csswg-drafts/blob/main/css-color-4/conversions.js. Copyright © 2022 W3C® (MIT, ERCIM, Keio, Beihang).
* @see https://github.com/w3c/csswg-drafts/blob/main/css-color-4/conversions.js
*/
-function OKLab_to_XYZ(t){const o=multiplyMatrices(n,t);return multiplyMatrices(_,[o[0]**3,o[1]**3,o[2]**3])}
+function OKLab_to_XYZ(t){const n=multiplyMatrices(o,t);return multiplyMatrices(_,[n[0]**3,n[1]**3,n[2]**3])}
/**
* Convert an array of rec2020 RGB values in the range 0.0 - 1.0
* to linear light (un-companded) form.
@@ -55,7 +55,7 @@ function OKLab_to_XYZ(t){const o=multiplyMatrices(n,t);return multiplyMatrices(_
*
* @license W3C https://www.w3.org/Consortium/Legal/2015/copyright-software-and-document
* @copyright This software or document includes material copied from or derived from https://github.com/w3c/csswg-drafts/blob/main/css-color-4/conversions.js. Copyright © 2022 W3C® (MIT, ERCIM, Keio, Beihang).
- */function lin_2020(t){const o=1.09929682680944;return t.map((function(t){const _=t<0?-1:1,n=Math.abs(t);return n<.08124285829863151?t/4.5:_*Math.pow((n+o-1)/o,1/.45)}))}const e=[63426534/99577255,20160776/139408157,47086771/278816314,26158966/99577255,.677998071518871,8267143/139408157,0,19567812/697040785,1.0609850577107909];
+ */const e=1.09929682680944,r=.018053968510807;function lin_2020_channel(t){const n=t<0?-1:1,_=Math.abs(t);return _<4.5*r?t/4.5:n*Math.pow((_+e-1)/e,1/.45)}const a=[63426534/99577255,20160776/139408157,47086771/278816314,26158966/99577255,.677998071518871,8267143/139408157,0,19567812/697040785,1.0609850577107909];
/**
* Convert an array of linear-light rec2020 values to CIE XYZ
* using D65 (no chromatic adaptation)
@@ -75,14 +75,14 @@ function OKLab_to_XYZ(t){const o=multiplyMatrices(n,t);return multiplyMatrices(_
* @copyright This software or document includes material copied from or derived from https://github.com/w3c/csswg-drafts/blob/main/css-color-4/conversions.js. Copyright © 2022 W3C® (MIT, ERCIM, Keio, Beihang).
* @see https://en.wikipedia.org/wiki/SRGB
*/
-function lin_sRGB(t){return t.map((function(t){const o=t<0?-1:1,_=Math.abs(t);return _<=.04045?t/12.92:o*Math.pow((_+.055)/1.055,2.4)}))}
+function lin_sRGB(t){return[lin_sRGB_channel(t[0]),lin_sRGB_channel(t[1]),lin_sRGB_channel(t[2])]}function lin_sRGB_channel(t){const n=t<0?-1:1,_=Math.abs(t);return _<=.04045?t/12.92:n*Math.pow((_+.055)/1.055,2.4)}
/**
* Convert an array of display-p3 RGB values in the range 0.0 - 1.0
* to linear light (un-companded) form.
*
* @license W3C https://www.w3.org/Consortium/Legal/2015/copyright-software-and-document
* @copyright This software or document includes material copied from or derived from https://github.com/w3c/csswg-drafts/blob/main/css-color-4/conversions.js. Copyright © 2022 W3C® (MIT, ERCIM, Keio, Beihang).
- */function lin_P3(t){return lin_sRGB(t)}const r=[608311/1250200,189793/714400,198249/1000160,35783/156275,247089/357200,198249/2500400,0,32229/714400,5220557/5000800];
+ */function lin_P3(t){return lin_sRGB(t)}const l=[608311/1250200,189793/714400,198249/1000160,35783/156275,247089/357200,198249/2500400,0,32229/714400,5220557/5000800];
/**
* Convert an array of linear-light display-p3 values to CIE XYZ
* using D65 (no chromatic adaptation)
@@ -90,7 +90,7 @@ function lin_sRGB(t){return t.map((function(t){const o=t<0?-1:1,_=Math.abs(t);re
* @license W3C https://www.w3.org/Consortium/Legal/2015/copyright-software-and-document
* @copyright This software or document includes material copied from or derived from https://github.com/w3c/csswg-drafts/blob/main/css-color-4/conversions.js. Copyright © 2022 W3C® (MIT, ERCIM, Keio, Beihang).
* @see http://www.brucelindbloom.com/index.html?Eqn_RGB_XYZ_Matrix.html
- */function lin_P3_to_XYZ(t){return multiplyMatrices(r,t)}
+ */function lin_P3_to_XYZ(t){return multiplyMatrices(l,t)}
/**
* Convert an array of prophoto-rgb values where in-gamut Colors are in the
* range [0.0 - 1.0] to linear light (un-companded) form. Transfer curve is
@@ -98,7 +98,7 @@ function lin_sRGB(t){return t.map((function(t){const o=t<0?-1:1,_=Math.abs(t);re
*
* @license W3C https://www.w3.org/Consortium/Legal/2015/copyright-software-and-document
* @copyright This software or document includes material copied from or derived from https://github.com/w3c/csswg-drafts/blob/main/css-color-4/conversions.js. Copyright © 2022 W3C® (MIT, ERCIM, Keio, Beihang).
- */const a=[.7977666449006423,.13518129740053308,.0313477341283922,.2880748288194013,.711835234241873,8993693872564e-17,0,0,.8251046025104602];
+ */const i=16/512;function lin_ProPhoto_channel(t){const n=t<0?-1:1,_=Math.abs(t);return _<=i?t/16:n*Math.pow(_,1.8)}const s=[.7977666449006423,.13518129740053308,.0313477341283922,.2880748288194013,.711835234241873,8993693872564e-17,0,0,.8251046025104602];
/**
* Convert an array of linear-light prophoto-rgb values to CIE D50 XYZ.
* Matrix cannot be expressed in rational form, but is calculated to 64 bit accuracy.
@@ -106,7 +106,7 @@ function lin_sRGB(t){return t.map((function(t){const o=t<0?-1:1,_=Math.abs(t);re
* @license W3C https://www.w3.org/Consortium/Legal/2015/copyright-software-and-document
* @copyright This software or document includes material copied from or derived from https://github.com/w3c/csswg-drafts/blob/main/css-color-4/conversions.js. Copyright © 2022 W3C® (MIT, ERCIM, Keio, Beihang).
* @see see https://github.com/w3c/csswg-drafts/issues/7675
- */const i=[573536/994567,263643/1420810,187206/994567,591459/1989134,6239551/9945670,374412/4972835,53769/1989134,351524/4972835,4929758/4972835];
+ */function lin_a98rgb_channel(t){const n=t<0?-1:1,_=Math.abs(t);return n*Math.pow(_,563/256)}const c=[573536/994567,263643/1420810,187206/994567,591459/1989134,6239551/9945670,374412/4972835,53769/1989134,351524/4972835,4929758/4972835];
/**
* Convert an array of linear-light a98-rgb values to CIE XYZ
* http://www.brucelindbloom.com/index.html?Eqn_RGB_XYZ_Matrix.html
@@ -120,24 +120,24 @@ function lin_sRGB(t){return t.map((function(t){const o=t<0?-1:1,_=Math.abs(t);re
* @see http://www.brucelindbloom.com/index.html?Eqn_RGB_XYZ_Matrix.html
* @see https://www.adobe.com/digitalimag/pdfs/AdobeRGB1998.pdf
* @see https://github.com/w3c/csswg-drafts/blob/main/css-color-4/matrixmaker.html
- */const s=[506752/1228815,87881/245763,12673/70218,87098/409605,175762/245763,12673/175545,7918/409605,87881/737289,1001167/1053270];
+ */const u=[506752/1228815,87881/245763,12673/70218,87098/409605,175762/245763,12673/175545,7918/409605,87881/737289,1001167/1053270];
/**
* Convert an array of linear-light sRGB values to CIE XYZ
* using sRGB's own white, D65 (no chromatic adaptation)
*
* @license W3C https://www.w3.org/Consortium/Legal/2015/copyright-software-and-document
* @copyright This software or document includes material copied from or derived from https://github.com/w3c/csswg-drafts/blob/main/css-color-4/conversions.js. Copyright © 2022 W3C® (MIT, ERCIM, Keio, Beihang).
- */function lin_sRGB_to_XYZ(t){return multiplyMatrices(s,t)}const l=[.955473421488075,-.02309845494876471,.06325924320057072,-.0283697093338637,1.0099953980813041,.021041441191917323,.012314014864481998,-.020507649298898964,1.330365926242124];
+ */function lin_sRGB_to_XYZ(t){return multiplyMatrices(u,t)}const h=[.955473421488075,-.02309845494876471,.06325924320057072,-.0283697093338637,1.0099953980813041,.021041441191917323,.012314014864481998,-.020507649298898964,1.330365926242124];
/**
* Bradford chromatic adaptation from D50 to D65
*
* @license W3C https://www.w3.org/Consortium/Legal/2015/copyright-software-and-document
* @copyright This software or document includes material copied from or derived from https://github.com/w3c/csswg-drafts/blob/main/css-color-4/conversions.js. Copyright © 2022 W3C® (MIT, ERCIM, Keio, Beihang).
- */function D50_to_D65(t){return multiplyMatrices(l,t)}const u=[12831/3959,-329/214,-1974/3959,-851781/878810,1648619/878810,36519/878810,705/12673,-2585/12673,705/667];
+ */function D50_to_D65(t){return multiplyMatrices(h,t)}const m=[12831/3959,-329/214,-1974/3959,-851781/878810,1648619/878810,36519/878810,705/12673,-2585/12673,705/667];
/**
* @license W3C https://www.w3.org/Consortium/Legal/2015/copyright-software-and-document
* @copyright This software or document includes material copied from or derived from https://github.com/w3c/csswg-drafts/blob/main/css-color-4/conversions.js. Copyright © 2022 W3C® (MIT, ERCIM, Keio, Beihang).
- */function XYZ_to_lin_sRGB(t){return multiplyMatrices(u,t)}
+ */function XYZ_to_lin_sRGB(t){return multiplyMatrices(m,t)}
/**
* Convert an array of linear-light sRGB values in the range 0.0-1.0 to gamma corrected form
* Extended transfer function:
@@ -147,7 +147,7 @@ function lin_sRGB(t){return t.map((function(t){const o=t<0?-1:1,_=Math.abs(t);re
* @license W3C https://www.w3.org/Consortium/Legal/2015/copyright-software-and-document
* @copyright This software or document includes material copied from or derived from https://github.com/w3c/csswg-drafts/blob/main/css-color-4/conversions.js. Copyright © 2022 W3C® (MIT, ERCIM, Keio, Beihang).
* @see https://en.wikipedia.org/wiki/SRGB
- */function gam_sRGB(t){return t.map((function(t){const o=t<0?-1:1,_=Math.abs(t);return _>.0031308?o*(1.055*Math.pow(_,1/2.4)-.055):12.92*t}))}
+ */function gam_sRGB(t){return[gam_sRGB_channel(t[0]),gam_sRGB_channel(t[1]),gam_sRGB_channel(t[2])]}function gam_sRGB_channel(t){const n=t<0?-1:1,_=Math.abs(t);return _>.0031308?n*(1.055*Math.pow(_,1/2.4)-.055):12.92*t}
/**
* Convert an array of gamma-corrected sRGB values in the 0.0 to 1.0 range to HSL.
*
@@ -161,13 +161,13 @@ function lin_sRGB(t){return t.map((function(t){const o=t<0?-1:1,_=Math.abs(t);re
* @copyright This software or document includes material copied from or derived from https://github.com/w3c/csswg-drafts/blob/main/css-color-4/utilities.js. Copyright © 2022 W3C® (MIT, ERCIM, Keio, Beihang).
*
* @see https://github.com/w3c/csswg-drafts/blob/main/css-color-4/better-rgbToHsl.js
- */function sRGB_to_HSL(t){const o=t[0],_=t[1],n=t[2],e=Math.max(o,_,n),r=Math.min(o,_,n),a=(r+e)/2,i=e-r;let s=NaN,l=0;if(0!==Math.round(1e5*i)){switch(l=0===Math.round(1e5*a)||1e5===Math.round(1e5*a)?0:(e-a)/Math.min(a,1-a),e){case o:s=(_-n)/i+(_<0&&(s+=180,l=Math.abs(l)),s>=360&&(s-=360),[s,100*l,100*a]}const c=[446124/178915,-333277/357830,-72051/178915,-14852/17905,63121/35810,423/17905,11844/330415,-50337/660830,316169/330415];
+ */function sRGB_to_HSL(t){const n=t[0],_=t[1],o=t[2],e=Math.max(n,_,o),r=Math.min(n,_,o),a=(r+e)/2,l=e-r;let i=NaN,s=0;if(0!==Math.round(1e5*l)){const t=Math.round(1e5*a);switch(s=0===t||1e5===t?0:(e-a)/Math.min(a,1-a),e){case n:i=(_-o)/l+(_<0&&(i+=180,s=Math.abs(s)),i>=360&&(i-=360),[i,100*s,100*a]}const p=[446124/178915,-333277/357830,-72051/178915,-14852/17905,63121/35810,423/17905,11844/330415,-50337/660830,316169/330415];
/**
* Convert XYZ to linear-light P3
*
* @license W3C https://www.w3.org/Consortium/Legal/2015/copyright-software-and-document
* @copyright This software or document includes material copied from or derived from https://github.com/w3c/csswg-drafts/blob/main/css-color-4/conversions.js. Copyright © 2022 W3C® (MIT, ERCIM, Keio, Beihang).
- */function XYZ_to_lin_P3(t){return multiplyMatrices(c,t)}
+ */function XYZ_to_lin_P3(t){return multiplyMatrices(p,t)}
/**
* Convert an array of linear-light display-p3 RGB in the range 0.0-1.0
* to gamma corrected form
@@ -181,7 +181,7 @@ function lin_sRGB(t){return t.map((function(t){const o=t<0?-1:1,_=Math.abs(t);re
*
* @license W3C https://www.w3.org/Consortium/Legal/2015/copyright-software-and-document
* @copyright This software or document includes material copied from or derived from https://github.com/w3c/csswg-drafts/blob/main/css-color-4/conversions.js. Copyright © 2022 W3C® (MIT, ERCIM, Keio, Beihang).
- */function XYZ_to_Lab(t){const _=216/24389,n=24389/27,e=t.map(((t,_)=>t/o[_])).map((t=>t>_?Math.cbrt(t):(n*t+16)/116));return[116*e[1]-16,500*(e[0]-e[1]),200*(e[1]-e[2])]}const p=[.819022437996703,.3619062600528904,-.1288737815209879,.0329836539323885,.9292868615863434,.0361446663506424,.0481771893596242,.2642395317527308,.6335478284694309],m=[.210454268309314,.7936177747023054,-.0040720430116193,1.9779985324311684,-2.42859224204858,.450593709617411,.0259040424655478,.7827717124575296,-.8086757549230774];
+ */function XYZ_to_Lab(t){const _=compute_f(t[0]/n[0]),o=compute_f(t[1]/n[1]);return[116*o-16,500*(_-o),200*(o-compute_f(t[2]/n[2]))]}const D=216/24389,g=24389/27;function compute_f(t){return t>D?Math.cbrt(t):(g*t+16)/116}const b=[.819022437996703,.3619062600528904,-.1288737815209879,.0329836539323885,.9292868615863434,.0361446663506424,.0481771893596242,.2642395317527308,.6335478284694309],X=[.210454268309314,.7936177747023054,-.0040720430116193,1.9779985324311684,-2.42859224204858,.450593709617411,.0259040424655478,.7827717124575296,-.8086757549230774];
/**
* @license W3C https://www.w3.org/Consortium/Legal/2015/copyright-software-and-document
* @copyright This software or document includes material copied from or derived from https://github.com/w3c/csswg-drafts/blob/main/css-color-4/conversions.js. Copyright © 2022 W3C® (MIT, ERCIM, Keio, Beihang).
@@ -189,43 +189,45 @@ function lin_sRGB(t){return t.map((function(t){const o=t<0?-1:1,_=Math.abs(t);re
* XYZ <-> LMS matrices recalculated for consistent reference white
* @see https://github.com/w3c/csswg-drafts/issues/6642#issuecomment-943521484
*/
-function XYZ_to_OKLab(t){const o=multiplyMatrices(p,t);return multiplyMatrices(m,[Math.cbrt(o[0]),Math.cbrt(o[1]),Math.cbrt(o[2])])}
+function XYZ_to_OKLab(t){const n=multiplyMatrices(b,t);return multiplyMatrices(X,[Math.cbrt(n[0]),Math.cbrt(n[1]),Math.cbrt(n[2])])}
/**
* @license W3C https://www.w3.org/Consortium/Legal/2015/copyright-software-and-document
* @copyright This software or document includes material copied from or derived from https://github.com/w3c/csswg-drafts/blob/main/css-color-4/conversions.js. Copyright © 2022 W3C® (MIT, ERCIM, Keio, Beihang).
- */function Lab_to_LCH(t){const o=180*Math.atan2(t[2],t[1])/Math.PI;return[t[0],Math.sqrt(Math.pow(t[1],2)+Math.pow(t[2],2)),o>=0?o:o+360]}
+ */function Lab_to_LCH(t){const n=180*Math.atan2(t[2],t[1])/Math.PI;return[t[0],Math.sqrt(Math.pow(t[1],2)+Math.pow(t[2],2)),n>=0?n:n+360]}
/**
* @license W3C https://www.w3.org/Consortium/Legal/2015/copyright-software-and-document
* @copyright This software or document includes material copied from or derived from https://github.com/w3c/csswg-drafts/blob/main/css-color-4/conversions.js. Copyright © 2022 W3C® (MIT, ERCIM, Keio, Beihang).
* @see https://github.com/w3c/csswg-drafts/blob/main/css-color-4/conversions.js
- */function OKLab_to_OKLCH(t){const o=180*Math.atan2(t[2],t[1])/Math.PI;return[t[0],Math.sqrt(t[1]**2+t[2]**2),o>=0?o:o+360]}const h=[1829569/896150,-506331/896150,-308931/896150,-851781/878810,1648619/878810,36519/878810,16779/1248040,-147721/1248040,1266979/1248040];
+ */function OKLab_to_OKLCH(t){const n=180*Math.atan2(t[2],t[1])/Math.PI;return[t[0],Math.sqrt(t[1]**2+t[2]**2),n>=0?n:n+360]}const Y=[1829569/896150,-506331/896150,-308931/896150,-851781/878810,1648619/878810,36519/878810,16779/1248040,-147721/1248040,1266979/1248040];
/**
* Convert XYZ to linear-light a98-rgb
*
* @license W3C https://www.w3.org/Consortium/Legal/2015/copyright-software-and-document
* @copyright This software or document includes material copied from or derived from https://github.com/w3c/csswg-drafts/blob/main/css-color-4/conversions.js. Copyright © 2022 W3C® (MIT, ERCIM, Keio, Beihang).
- */const D=[30757411/17917100,-6372589/17917100,-4539589/17917100,-.666684351832489,1.616481236634939,467509/29648200,792561/44930125,-1921689/44930125,.942103121235474];
+ */function gam_a98rgb_channel(t){const n=t<0?-1:1,_=Math.abs(t);return n*Math.pow(_,256/563)}const Z=[30757411/17917100,-6372589/17917100,-4539589/17917100,-.666684351832489,1.616481236634939,467509/29648200,792561/44930125,-1921689/44930125,.942103121235474];
/**
* Convert XYZ to linear-light rec2020
*
* @license W3C https://www.w3.org/Consortium/Legal/2015/copyright-software-and-document
* @copyright This software or document includes material copied from or derived from https://github.com/w3c/csswg-drafts/blob/main/css-color-4/conversions.js. Copyright © 2022 W3C® (MIT, ERCIM, Keio, Beihang).
- */
+ */const f=1.09929682680944,L=.018053968510807;function gam_2020_channel(t){const n=t<0?-1:1,_=Math.abs(t);return _>L?n*(f*Math.pow(_,.45)-(f-1)):4.5*t}const M=[1.3457868816471583,-.25557208737979464,-.05110186497554526,-.5446307051249019,1.5082477428451468,.02052744743642139,0,0,1.2119675456389452];
/**
- * Convert an array of linear-light rec2020 RGB in the range 0.0-1.0
- * to gamma corrected form ITU-R BT.2020-2 p.4
+ * Convert D50 XYZ to linear-light prophoto-rgb
*
* @license W3C https://www.w3.org/Consortium/Legal/2015/copyright-software-and-document
* @copyright This software or document includes material copied from or derived from https://github.com/w3c/csswg-drafts/blob/main/css-color-4/conversions.js. Copyright © 2022 W3C® (MIT, ERCIM, Keio, Beihang).
- */
-function gam_2020(t){const o=1.09929682680944;return t.map((function(t){const _=t<0?-1:1,n=Math.abs(t);return n>.018053968510807?_*(o*Math.pow(n,.45)-(o-1)):4.5*t}))}const X=[1.3457868816471583,-.25557208737979464,-.05110186497554526,-.5446307051249019,1.5082477428451468,.02052744743642139,0,0,1.2119675456389452];
+ * @see http://www.brucelindbloom.com/index.html?Eqn_RGB_XYZ_Matrix.html
+ */const d=1/512;function gam_ProPhoto_channel(t){const n=t<0?-1:1,_=Math.abs(t);return _>=d?n*Math.pow(_,1/1.8):16*t}function inGamut(t){return t[0]>=-1e-4&&t[0]<=1.0001&&t[1]>=-1e-4&&t[1]<=1.0001&&t[2]>=-1e-4&&t[2]<=1.0001}function clip(t){return[t[0]<0?0:t[0]>1?1:t[0],t[1]<0?0:t[1]>1?1:t[1],t[2]<0?0:t[2]>1?1:t[2]]}
/**
- * Convert D50 XYZ to linear-light prophoto-rgb
+ * @description Calculate deltaE OK which is the simple root sum of squares
+ * @param {number[]} reference - Array of OKLab values: L as 0..1, a and b as -1..1
+ * @param {number[]} sample - Array of OKLab values: L as 0..1, a and b as -1..1
+ * @return {number} How different a color sample is from reference
*
* @license W3C https://www.w3.org/Consortium/Legal/2015/copyright-software-and-document
- * @copyright This software or document includes material copied from or derived from https://github.com/w3c/csswg-drafts/blob/main/css-color-4/conversions.js. Copyright © 2022 W3C® (MIT, ERCIM, Keio, Beihang).
- * @see http://www.brucelindbloom.com/index.html?Eqn_RGB_XYZ_Matrix.html
- */
+ * @copyright This software or document includes material copied from or derived from https://github.com/w3c/csswg-drafts/blob/main/css-color-4/deltaEOK.js. Copyright © 2022 W3C® (MIT, ERCIM, Keio, Beihang).
+ * @see https://github.com/w3c/csswg-drafts/blob/main/css-color-4/deltaEOK.js
+ */function deltaEOK(t,n){const[_,o,e]=t,[r,a,l]=n,i=_-r,s=o-a,c=e-l;return Math.sqrt(i**2+s**2+c**2)}const B=.02,G=1e-4;function rayTraceBox(t,n){let _=1/0,o=-1/0;const e=[0,0,0];for(let r=0;r<3;r++){const a=t[r],l=n[r]-a;e[r]=l;const i=0,s=1;if(l){const t=1/l,n=(i-a)*t,e=(s-a)*t;o=Math.max(Math.min(n,e),o),_=Math.min(Math.max(n,e),_)}else if(as)return!1}return!(o>_||_<0)&&(o<0&&(o=_),!!isFinite(o)&&[t[0]+e[0]*o,t[1]+e[1]*o,t[2]+e[2]*o])}function luminance(t){const[n,_,o]=t.map((t=>t<=.03928?t/12.92:Math.pow((t+.055)/1.055,2.4)));return.2126*n+.7152*_+.0722*o}exports.HSL_to_XYZ_D50=function HSL_to_XYZ_D50(t){let n=t;return n=HSL_to_sRGB(n),n=lin_sRGB(n),n=lin_sRGB_to_XYZ(n),n=D65_to_D50(n),n},exports.HWB_to_XYZ_D50=function HWB_to_XYZ_D50(t){let n=t;return n=HWB_to_sRGB(n),n=lin_sRGB(n),n=lin_sRGB_to_XYZ(n),n=D65_to_D50(n),n},exports.LCH_to_XYZ_D50=function LCH_to_XYZ_D50(t){let n=t;return n=LCH_to_Lab(n),n=Lab_to_XYZ(n),n},exports.Lab_to_XYZ_D50=function Lab_to_XYZ_D50(t){let n=t;return n=Lab_to_XYZ(n),n},exports.OKLCH_to_OKLab=OKLCH_to_OKLab,exports.OKLCH_to_XYZ_D50=function OKLCH_to_XYZ_D50(t){let n=t;return n=OKLCH_to_OKLab(n),n=OKLab_to_XYZ(n),n=D65_to_D50(n),n},exports.OKLab_to_OKLCH=OKLab_to_OKLCH,exports.OKLab_to_XYZ=OKLab_to_XYZ,exports.OKLab_to_XYZ_D50=function OKLab_to_XYZ_D50(t){let n=t;return n=OKLab_to_XYZ(n),n=D65_to_D50(n),n},exports.P3_to_XYZ_D50=function P3_to_XYZ_D50(t){let n=t;return n=lin_P3(n),n=lin_P3_to_XYZ(n),n=D65_to_D50(n),n},exports.ProPhoto_RGB_to_XYZ_D50=function ProPhoto_RGB_to_XYZ_D50(t){let n=t;var _;return n=[lin_ProPhoto_channel((_=n)[0]),lin_ProPhoto_channel(_[1]),lin_ProPhoto_channel(_[2])],n=multiplyMatrices(s,n),n},exports.XYZ_D50_to_HSL=function XYZ_D50_to_HSL(t){let n=t;return n=D50_to_D65(n),n=XYZ_to_lin_sRGB(n),n=gam_sRGB(n),n=sRGB_to_HSL(n),n},exports.XYZ_D50_to_HWB=function XYZ_D50_to_HWB(t){let n=t;n=D50_to_D65(n),n=XYZ_to_lin_sRGB(n);const _=gam_sRGB(n);n=sRGB_to_HSL(_);const o=Math.min(_[0],_[1],_[2]),e=1-Math.max(_[0],_[1],_[2]);return[n[0],100*o,100*e]},exports.XYZ_D50_to_LCH=function XYZ_D50_to_LCH(t){let n=t;return n=XYZ_to_Lab(n),n=Lab_to_LCH(n),n},exports.XYZ_D50_to_Lab=function XYZ_D50_to_Lab(t){let n=t;return n=XYZ_to_Lab(n),n},exports.XYZ_D50_to_OKLCH=function XYZ_D50_to_OKLCH(t){let n=t;return n=D50_to_D65(n),n=XYZ_to_OKLab(n),n=OKLab_to_OKLCH(n),n},exports.XYZ_D50_to_OKLab=function XYZ_D50_to_OKLab(t){let n=t;return n=D50_to_D65(n),n=XYZ_to_OKLab(n),n},exports.XYZ_D50_to_P3=function XYZ_D50_to_P3(t){let n=t;return n=D50_to_D65(n),n=XYZ_to_lin_P3(n),n=gam_P3(n),n},exports.XYZ_D50_to_ProPhoto=function XYZ_D50_to_ProPhoto(t){let n=t;var _;
/**
* Convert an array of linear-light prophoto-rgb in the range 0.0-1.0
* to gamma corrected form.
@@ -233,18 +235,29 @@ function gam_2020(t){const o=1.09929682680944;return t.map((function(t){const _=
*
* @license W3C https://www.w3.org/Consortium/Legal/2015/copyright-software-and-document
* @copyright This software or document includes material copied from or derived from https://github.com/w3c/csswg-drafts/blob/main/css-color-4/conversions.js. Copyright © 2022 W3C® (MIT, ERCIM, Keio, Beihang).
- */
-function gam_ProPhoto(t){const o=1/512;return t.map((function(t){const _=t<0?-1:1,n=Math.abs(t);return n>=o?_*Math.pow(n,1/1.8):16*t}))}function inGamut(t){const[o,_,n]=t;return o>=-1e-4&&o<=1.0001&&_>=-1e-4&&_<=1.0001&&n>=-1e-4&&n<=1.0001}function clip(t){return t.map((t=>t<0?0:t>1?1:t))}
+ */return n=multiplyMatrices(M,n),n=[gam_ProPhoto_channel((_=n)[0]),gam_ProPhoto_channel(_[1]),gam_ProPhoto_channel(_[2])],n},exports.XYZ_D50_to_XYZ_D50=function XYZ_D50_to_XYZ_D50(t){return t},exports.XYZ_D50_to_XYZ_D65=function XYZ_D50_to_XYZ_D65(t){let n=t;return n=D50_to_D65(n),n},exports.XYZ_D50_to_a98_RGB=function XYZ_D50_to_a98_RGB(t){let n=t;var _;
/**
- * @description Calculate deltaE OK which is the simple root sum of squares
- * @param {number[]} reference - Array of OKLab values: L as 0..1, a and b as -1..1
- * @param {number[]} sample - Array of OKLab values: L as 0..1, a and b as -1..1
- * @return {number} How different a color sample is from reference
+ * Convert an array of linear-light a98-rgb in the range 0.0-1.0
+ * to gamma corrected form. Negative values are also now accepted
*
* @license W3C https://www.w3.org/Consortium/Legal/2015/copyright-software-and-document
- * @copyright This software or document includes material copied from or derived from https://github.com/w3c/csswg-drafts/blob/main/css-color-4/deltaEOK.js. Copyright © 2022 W3C® (MIT, ERCIM, Keio, Beihang).
- * @see https://github.com/w3c/csswg-drafts/blob/main/css-color-4/deltaEOK.js
- */function deltaEOK(t,o){const[_,n,e]=t,[r,a,i]=o,s=_-r,l=n-a,u=e-i;return Math.sqrt(s**2+l**2+u**2)}const Y=.02,Z=1e-4;function rayTraceBox(t,o){let _=1/0,n=-1/0;const e=[];for(let r=0;r<3;r++){const a=t[r],i=o[r]-a;e.push(i);const s=0,l=1;if(i){const t=1/i,o=(s-a)*t,e=(l-a)*t;n=Math.max(Math.min(o,e),n),_=Math.min(Math.max(o,e),_)}else if(al)return!1}return!(n>_||_<0)&&(n<0&&(n=_),!!isFinite(n)&&[t[0]+e[0]*n,t[1]+e[1]*n,t[2]+e[2]*n])}function luminance(t){const[o,_,n]=t.map((t=>t<=.03928?t/12.92:Math.pow((t+.055)/1.055,2.4)));return.2126*o+.7152*_+.0722*n}exports.HSL_to_XYZ_D50=function HSL_to_XYZ_D50(t){let o=t;return o=HSL_to_sRGB(o),o=lin_sRGB(o),o=lin_sRGB_to_XYZ(o),o=D65_to_D50(o),o},exports.HWB_to_XYZ_D50=function HWB_to_XYZ_D50(t){let o=t;return o=HWB_to_sRGB(o),o=lin_sRGB(o),o=lin_sRGB_to_XYZ(o),o=D65_to_D50(o),o},exports.LCH_to_XYZ_D50=function LCH_to_XYZ_D50(t){let o=t;var _;return o=[(_=o)[0],_[1]*Math.cos(_[2]*Math.PI/180),_[1]*Math.sin(_[2]*Math.PI/180)],o=Lab_to_XYZ(o),o},exports.Lab_to_XYZ_D50=function Lab_to_XYZ_D50(t){let o=t;return o=Lab_to_XYZ(o),o},exports.OKLCH_to_OKLab=OKLCH_to_OKLab,exports.OKLCH_to_XYZ_D50=function OKLCH_to_XYZ_D50(t){let o=t;return o=OKLCH_to_OKLab(o),o=OKLab_to_XYZ(o),o=D65_to_D50(o),o},exports.OKLab_to_OKLCH=OKLab_to_OKLCH,exports.OKLab_to_XYZ=OKLab_to_XYZ,exports.OKLab_to_XYZ_D50=function OKLab_to_XYZ_D50(t){let o=t;return o=OKLab_to_XYZ(o),o=D65_to_D50(o),o},exports.P3_to_XYZ_D50=function P3_to_XYZ_D50(t){let o=t;return o=lin_P3(o),o=lin_P3_to_XYZ(o),o=D65_to_D50(o),o},exports.ProPhoto_RGB_to_XYZ_D50=function ProPhoto_RGB_to_XYZ_D50(t){let o=t;return o=o.map((function(t){const o=t<0?-1:1,_=Math.abs(t);return _<=.03125?t/16:o*Math.pow(_,1.8)})),o=multiplyMatrices(a,o),o},exports.XYZ_D50_to_HSL=function XYZ_D50_to_HSL(t){let o=t;return o=D50_to_D65(o),o=XYZ_to_lin_sRGB(o),o=gam_sRGB(o),o=sRGB_to_HSL(o),o},exports.XYZ_D50_to_HWB=function XYZ_D50_to_HWB(t){let o=t;o=D50_to_D65(o),o=XYZ_to_lin_sRGB(o);const _=gam_sRGB(o);o=sRGB_to_HSL(_);const n=Math.min(_[0],_[1],_[2]),e=1-Math.max(_[0],_[1],_[2]);return[o[0],100*n,100*e]},exports.XYZ_D50_to_LCH=function XYZ_D50_to_LCH(t){let o=t;return o=XYZ_to_Lab(o),o=Lab_to_LCH(o),o},exports.XYZ_D50_to_Lab=function XYZ_D50_to_Lab(t){let o=t;return o=XYZ_to_Lab(o),o},exports.XYZ_D50_to_OKLCH=function XYZ_D50_to_OKLCH(t){let o=t;return o=D50_to_D65(o),o=XYZ_to_OKLab(o),o=OKLab_to_OKLCH(o),o},exports.XYZ_D50_to_OKLab=function XYZ_D50_to_OKLab(t){let o=t;return o=D50_to_D65(o),o=XYZ_to_OKLab(o),o},exports.XYZ_D50_to_P3=function XYZ_D50_to_P3(t){let o=t;return o=D50_to_D65(o),o=XYZ_to_lin_P3(o),o=gam_P3(o),o},exports.XYZ_D50_to_ProPhoto=function XYZ_D50_to_ProPhoto(t){let o=t;return o=multiplyMatrices(X,o),o=gam_ProPhoto(o),o},exports.XYZ_D50_to_XYZ_D50=function XYZ_D50_to_XYZ_D50(t){return t},exports.XYZ_D50_to_XYZ_D65=function XYZ_D50_to_XYZ_D65(t){let o=t;return o=D50_to_D65(o),o},exports.XYZ_D50_to_a98_RGB=function XYZ_D50_to_a98_RGB(t){let o=t;return o=D50_to_D65(o),o=multiplyMatrices(h,o),o=o.map((function(t){const o=t<0?-1:1,_=Math.abs(t);return o*Math.pow(_,256/563)})),o},exports.XYZ_D50_to_lin_sRGB=function XYZ_D50_to_lin_sRGB(t){let o=t;return o=D50_to_D65(o),o=XYZ_to_lin_sRGB(o),o},exports.XYZ_D50_to_rec_2020=function XYZ_D50_to_rec_2020(t){let o=t;return o=D50_to_D65(o),o=multiplyMatrices(D,o),o=gam_2020(o),o},exports.XYZ_D50_to_sRGB=function XYZ_D50_to_sRGB(t){let o=t;return o=D50_to_D65(o),o=XYZ_to_lin_sRGB(o),o=gam_sRGB(o),o},exports.XYZ_D65_to_XYZ_D50=function XYZ_D65_to_XYZ_D50(t){let o=t;return o=D65_to_D50(o),o},exports.XYZ_to_OKLab=XYZ_to_OKLab,exports.XYZ_to_lin_P3=XYZ_to_lin_P3,exports.XYZ_to_lin_sRGB=XYZ_to_lin_sRGB,exports.a98_RGB_to_XYZ_D50=function a98_RGB_to_XYZ_D50(t){let o=t;return o=o.map((function(t){const o=t<0?-1:1,_=Math.abs(t);return o*Math.pow(_,563/256)})),o=multiplyMatrices(i,o),o=D65_to_D50(o),o},exports.clip=clip,exports.contrast_ratio_wcag_2_1=function contrast_ratio_wcag_2_1(t,o){const _=luminance(t),n=luminance(o);return(Math.max(_,n)+.05)/(Math.min(_,n)+.05)},exports.gam_P3=gam_P3,exports.gam_sRGB=gam_sRGB,exports.inGamut=inGamut,exports.lin_P3=lin_P3,exports.lin_P3_to_XYZ=lin_P3_to_XYZ,exports.lin_sRGB=lin_sRGB,exports.lin_sRGB_to_XYZ=lin_sRGB_to_XYZ,exports.lin_sRGB_to_XYZ_D50=function lin_sRGB_to_XYZ_D50(t){let o=t;return o=lin_sRGB_to_XYZ(o),o=D65_to_D50(o),o},exports.mapGamut=function mapGamut(t,o,_){const n=t;let e=clip(o(n)),r=deltaEOK(OKLCH_to_OKLab(_(e)),OKLCH_to_OKLab(n));if(rZ;){const t=(a+i)/2;if(n[1]=t,s&&inGamut(o(n)))a=t;else if(e=clip(o(n)),r=deltaEOK(OKLCH_to_OKLab(_(e)),OKLCH_to_OKLab(n)),rG;){const t=(a+l)/2;if(o[1]=t,i&&inGamut(n(o)))a=t;else if(e=clip(n(o)),r=deltaEOK(OKLCH_to_OKLab(_(e)),OKLCH_to_OKLab(o)),r0){const t=_(r);t[0]=n,t[2]=e,r=o(t)}const i=rayTraceBox(a,r.slice());if(!i)break;r=i.slice()}return clip(r)},exports.namedColors={aliceblue:[240,248,255],antiquewhite:[250,235,215],aqua:[0,255,255],aquamarine:[127,255,212],azure:[240,255,255],beige:[245,245,220],bisque:[255,228,196],black:[0,0,0],blanchedalmond:[255,235,205],blue:[0,0,255],blueviolet:[138,43,226],brown:[165,42,42],burlywood:[222,184,135],cadetblue:[95,158,160],chartreuse:[127,255,0],chocolate:[210,105,30],coral:[255,127,80],cornflowerblue:[100,149,237],cornsilk:[255,248,220],crimson:[220,20,60],cyan:[0,255,255],darkblue:[0,0,139],darkcyan:[0,139,139],darkgoldenrod:[184,134,11],darkgray:[169,169,169],darkgreen:[0,100,0],darkgrey:[169,169,169],darkkhaki:[189,183,107],darkmagenta:[139,0,139],darkolivegreen:[85,107,47],darkorange:[255,140,0],darkorchid:[153,50,204],darkred:[139,0,0],darksalmon:[233,150,122],darkseagreen:[143,188,143],darkslateblue:[72,61,139],darkslategray:[47,79,79],darkslategrey:[47,79,79],darkturquoise:[0,206,209],darkviolet:[148,0,211],deeppink:[255,20,147],deepskyblue:[0,191,255],dimgray:[105,105,105],dimgrey:[105,105,105],dodgerblue:[30,144,255],firebrick:[178,34,34],floralwhite:[255,250,240],forestgreen:[34,139,34],fuchsia:[255,0,255],gainsboro:[220,220,220],ghostwhite:[248,248,255],gold:[255,215,0],goldenrod:[218,165,32],gray:[128,128,128],green:[0,128,0],greenyellow:[173,255,47],grey:[128,128,128],honeydew:[240,255,240],hotpink:[255,105,180],indianred:[205,92,92],indigo:[75,0,130],ivory:[255,255,240],khaki:[240,230,140],lavender:[230,230,250],lavenderblush:[255,240,245],lawngreen:[124,252,0],lemonchiffon:[255,250,205],lightblue:[173,216,230],lightcoral:[240,128,128],lightcyan:[224,255,255],lightgoldenrodyellow:[250,250,210],lightgray:[211,211,211],lightgreen:[144,238,144],lightgrey:[211,211,211],lightpink:[255,182,193],lightsalmon:[255,160,122],lightseagreen:[32,178,170],lightskyblue:[135,206,250],lightslategray:[119,136,153],lightslategrey:[119,136,153],lightsteelblue:[176,196,222],lightyellow:[255,255,224],lime:[0,255,0],limegreen:[50,205,50],linen:[250,240,230],magenta:[255,0,255],maroon:[128,0,0],mediumaquamarine:[102,205,170],mediumblue:[0,0,205],mediumorchid:[186,85,211],mediumpurple:[147,112,219],mediumseagreen:[60,179,113],mediumslateblue:[123,104,238],mediumspringgreen:[0,250,154],mediumturquoise:[72,209,204],mediumvioletred:[199,21,133],midnightblue:[25,25,112],mintcream:[245,255,250],mistyrose:[255,228,225],moccasin:[255,228,181],navajowhite:[255,222,173],navy:[0,0,128],oldlace:[253,245,230],olive:[128,128,0],olivedrab:[107,142,35],orange:[255,165,0],orangered:[255,69,0],orchid:[218,112,214],palegoldenrod:[238,232,170],palegreen:[152,251,152],paleturquoise:[175,238,238],palevioletred:[219,112,147],papayawhip:[255,239,213],peachpuff:[255,218,185],peru:[205,133,63],pink:[255,192,203],plum:[221,160,221],powderblue:[176,224,230],purple:[128,0,128],rebeccapurple:[102,51,153],red:[255,0,0],rosybrown:[188,143,143],royalblue:[65,105,225],saddlebrown:[139,69,19],salmon:[250,128,114],sandybrown:[244,164,96],seagreen:[46,139,87],seashell:[255,245,238],sienna:[160,82,45],silver:[192,192,192],skyblue:[135,206,235],slateblue:[106,90,205],slategray:[112,128,144],slategrey:[112,128,144],snow:[255,250,250],springgreen:[0,255,127],steelblue:[70,130,180],tan:[210,180,140],teal:[0,128,128],thistle:[216,191,216],tomato:[255,99,71],turquoise:[64,224,208],violet:[238,130,238],wheat:[245,222,179],white:[255,255,255],whitesmoke:[245,245,245],yellow:[255,255,0],yellowgreen:[154,205,50]},exports.rec_2020_to_XYZ_D50=function rec_2020_to_XYZ_D50(t){let o=t;return o=lin_2020(o),o=multiplyMatrices(e,o),o=D65_to_D50(o),o},exports.sRGB_to_XYZ_D50=function sRGB_to_XYZ_D50(t){let o=t;return o=lin_sRGB(o),o=lin_sRGB_to_XYZ(o),o=D65_to_D50(o),o};
+ */,exports.mapGamutRayTrace=function mapGamutRayTrace(t,n,_){const o=t[0],e=t[2];let r=n(t);const a=n([o,0,e]);for(let t=0;t<4;t++){if(t>0){const t=_(r);t[0]=o,t[2]=e,r=n(t)}const l=rayTraceBox(a,r);if(!l)break;r=l}return clip(r)},exports.namedColors={aliceblue:[240,248,255],antiquewhite:[250,235,215],aqua:[0,255,255],aquamarine:[127,255,212],azure:[240,255,255],beige:[245,245,220],bisque:[255,228,196],black:[0,0,0],blanchedalmond:[255,235,205],blue:[0,0,255],blueviolet:[138,43,226],brown:[165,42,42],burlywood:[222,184,135],cadetblue:[95,158,160],chartreuse:[127,255,0],chocolate:[210,105,30],coral:[255,127,80],cornflowerblue:[100,149,237],cornsilk:[255,248,220],crimson:[220,20,60],cyan:[0,255,255],darkblue:[0,0,139],darkcyan:[0,139,139],darkgoldenrod:[184,134,11],darkgray:[169,169,169],darkgreen:[0,100,0],darkgrey:[169,169,169],darkkhaki:[189,183,107],darkmagenta:[139,0,139],darkolivegreen:[85,107,47],darkorange:[255,140,0],darkorchid:[153,50,204],darkred:[139,0,0],darksalmon:[233,150,122],darkseagreen:[143,188,143],darkslateblue:[72,61,139],darkslategray:[47,79,79],darkslategrey:[47,79,79],darkturquoise:[0,206,209],darkviolet:[148,0,211],deeppink:[255,20,147],deepskyblue:[0,191,255],dimgray:[105,105,105],dimgrey:[105,105,105],dodgerblue:[30,144,255],firebrick:[178,34,34],floralwhite:[255,250,240],forestgreen:[34,139,34],fuchsia:[255,0,255],gainsboro:[220,220,220],ghostwhite:[248,248,255],gold:[255,215,0],goldenrod:[218,165,32],gray:[128,128,128],green:[0,128,0],greenyellow:[173,255,47],grey:[128,128,128],honeydew:[240,255,240],hotpink:[255,105,180],indianred:[205,92,92],indigo:[75,0,130],ivory:[255,255,240],khaki:[240,230,140],lavender:[230,230,250],lavenderblush:[255,240,245],lawngreen:[124,252,0],lemonchiffon:[255,250,205],lightblue:[173,216,230],lightcoral:[240,128,128],lightcyan:[224,255,255],lightgoldenrodyellow:[250,250,210],lightgray:[211,211,211],lightgreen:[144,238,144],lightgrey:[211,211,211],lightpink:[255,182,193],lightsalmon:[255,160,122],lightseagreen:[32,178,170],lightskyblue:[135,206,250],lightslategray:[119,136,153],lightslategrey:[119,136,153],lightsteelblue:[176,196,222],lightyellow:[255,255,224],lime:[0,255,0],limegreen:[50,205,50],linen:[250,240,230],magenta:[255,0,255],maroon:[128,0,0],mediumaquamarine:[102,205,170],mediumblue:[0,0,205],mediumorchid:[186,85,211],mediumpurple:[147,112,219],mediumseagreen:[60,179,113],mediumslateblue:[123,104,238],mediumspringgreen:[0,250,154],mediumturquoise:[72,209,204],mediumvioletred:[199,21,133],midnightblue:[25,25,112],mintcream:[245,255,250],mistyrose:[255,228,225],moccasin:[255,228,181],navajowhite:[255,222,173],navy:[0,0,128],oldlace:[253,245,230],olive:[128,128,0],olivedrab:[107,142,35],orange:[255,165,0],orangered:[255,69,0],orchid:[218,112,214],palegoldenrod:[238,232,170],palegreen:[152,251,152],paleturquoise:[175,238,238],palevioletred:[219,112,147],papayawhip:[255,239,213],peachpuff:[255,218,185],peru:[205,133,63],pink:[255,192,203],plum:[221,160,221],powderblue:[176,224,230],purple:[128,0,128],rebeccapurple:[102,51,153],red:[255,0,0],rosybrown:[188,143,143],royalblue:[65,105,225],saddlebrown:[139,69,19],salmon:[250,128,114],sandybrown:[244,164,96],seagreen:[46,139,87],seashell:[255,245,238],sienna:[160,82,45],silver:[192,192,192],skyblue:[135,206,235],slateblue:[106,90,205],slategray:[112,128,144],slategrey:[112,128,144],snow:[255,250,250],springgreen:[0,255,127],steelblue:[70,130,180],tan:[210,180,140],teal:[0,128,128],thistle:[216,191,216],tomato:[255,99,71],turquoise:[64,224,208],violet:[238,130,238],wheat:[245,222,179],white:[255,255,255],whitesmoke:[245,245,245],yellow:[255,255,0],yellowgreen:[154,205,50]},exports.rec_2020_to_XYZ_D50=function rec_2020_to_XYZ_D50(t){let n=t;var _;return n=[lin_2020_channel((_=n)[0]),lin_2020_channel(_[1]),lin_2020_channel(_[2])],n=multiplyMatrices(a,n),n=D65_to_D50(n),n},exports.sRGB_to_XYZ_D50=function sRGB_to_XYZ_D50(t){let n=t;return n=lin_sRGB(n),n=lin_sRGB_to_XYZ(n),n=D65_to_D50(n),n};
diff --git a/packages/color-helpers/dist/index.mjs b/packages/color-helpers/dist/index.mjs
index c5f779a02..56332f62e 100644
--- a/packages/color-helpers/dist/index.mjs
+++ b/packages/color-helpers/dist/index.mjs
@@ -14,7 +14,7 @@ function multiplyMatrices(t,n){return[t[0]*n[0]+t[1]*n[1]+t[2]*n[2],t[3]*n[0]+t[
* @license W3C https://www.w3.org/Consortium/Legal/2015/copyright-software-and-document
* @copyright This software or document includes material copied from or derived from https://github.com/w3c/csswg-drafts/blob/main/css-color-4/hslToRgb.js. Copyright © 2022 W3C® (MIT, ERCIM, Keio, Beihang).
* @see https://github.com/w3c/csswg-drafts/blob/main/css-color-4/hslToRgb.js
- */function HSL_to_sRGB(t){let n=t[0],_=t[1],o=t[2];function f(t){const e=(t+n/30)%12,r=_*Math.min(o,1-o);return o-r*Math.max(-1,Math.min(e-3,9-e,1))}return n%=360,n<0&&(n+=360),_/=100,o/=100,[f(0),f(8),f(4)]}
+ */function HSL_to_sRGB(t){let n=t[0]%360;const _=t[1]/100,o=t[2]/100;return n<0&&(n+=360),[HSL_to_sRGB_channel(0,n,_,o),HSL_to_sRGB_channel(8,n,_,o),HSL_to_sRGB_channel(4,n,_,o)]}function HSL_to_sRGB_channel(t,n,_,o){const e=(t+n/30)%12;return o-_*Math.min(o,1-o)*Math.max(-1,Math.min(e-3,9-e,1))}
/**
* @param {number} hue - Hue as degrees 0..360
* @param {number} white - Whiteness as percentage 0..100
@@ -24,22 +24,22 @@ function multiplyMatrices(t,n){return[t[0]*n[0]+t[1]*n[1]+t[2]*n[2],t[3]*n[0]+t[
* @license W3C https://www.w3.org/Consortium/Legal/2015/copyright-software-and-document
* @copyright This software or document includes material copied from or derived from https://github.com/w3c/csswg-drafts/blob/main/css-color-4/hwbToRgb.js. Copyright © 2022 W3C® (MIT, ERCIM, Keio, Beihang).
* @see https://github.com/w3c/csswg-drafts/blob/main/css-color-4/hwbToRgb.js
- */function HWB_to_sRGB(t){const n=t[0];let _=t[1],o=t[2];if(_/=100,o/=100,_+o>=1){const t=_/(_+o);return[t,t,t]}const e=HSL_to_sRGB([n,100,50]);for(let t=0;t<3;t++)e[t]*=1-_-o,e[t]+=_;return e}
+ */function HWB_to_sRGB(t){const n=t[0],_=t[1]/100,o=t[2]/100;if(_+o>=1){const t=_/(_+o);return[t,t,t]}const e=HSL_to_sRGB([n,100,50]),a=1-_-o;return[e[0]*a+_,e[1]*a+_,e[2]*a+_]}
/**
* @license W3C https://www.w3.org/Consortium/Legal/2015/copyright-software-and-document
* @copyright This software or document includes material copied from or derived from https://github.com/w3c/csswg-drafts/blob/main/css-color-4/conversions.js. Copyright © 2022 W3C® (MIT, ERCIM, Keio, Beihang).
- */const n=[.3457/.3585,1,.2958/.3585];
+ */function LCH_to_Lab(t){const n=t[2]*Math.PI/180;return[t[0],t[1]*Math.cos(n),t[1]*Math.sin(n)]}const n=[.3457/.3585,1,.2958/.3585];
/**
* Convert Lab to D50-adapted XYZ
* @license W3C https://www.w3.org/Consortium/Legal/2015/copyright-software-and-document
* @copyright This software or document includes material copied from or derived from https://github.com/w3c/csswg-drafts/blob/main/css-color-4/conversions.js. Copyright © 2022 W3C® (MIT, ERCIM, Keio, Beihang).
* @see http://www.brucelindbloom.com/index.html?Eqn_RGB_XYZ_Matrix.html
- */function Lab_to_XYZ(t){const _=24389/27,o=216/24389,e=[];e[1]=(t[0]+16)/116,e[0]=t[1]/500+e[1],e[2]=e[1]-t[2]/200;return[Math.pow(e[0],3)>o?Math.pow(e[0],3):(116*e[0]-16)/_,t[0]>8?Math.pow((t[0]+16)/116,3):t[0]/_,Math.pow(e[2],3)>o?Math.pow(e[2],3):(116*e[2]-16)/_].map(((t,_)=>t*n[_]))}
+ */function Lab_to_XYZ(t){const _=24389/27,o=216/24389,e=(t[0]+16)/116,a=t[1]/500+e,r=e-t[2]/200;return[(Math.pow(a,3)>o?Math.pow(a,3):(116*a-16)/_)*n[0],(t[0]>8?Math.pow((t[0]+16)/116,3):t[0]/_)*n[1],(Math.pow(r,3)>o?Math.pow(r,3):(116*r-16)/_)*n[2]]}
/**
* @license W3C https://www.w3.org/Consortium/Legal/2015/copyright-software-and-document
* @copyright This software or document includes material copied from or derived from https://github.com/w3c/csswg-drafts/blob/main/css-color-4/conversions.js. Copyright © 2022 W3C® (MIT, ERCIM, Keio, Beihang).
* @see https://github.com/w3c/csswg-drafts/blob/main/css-color-4/conversions.js
- */function OKLCH_to_OKLab(t){return[t[0],t[1]*Math.cos(t[2]*Math.PI/180),t[1]*Math.sin(t[2]*Math.PI/180)]}const _=[1.2268798758459243,-.5578149944602171,.2813910456659647,-.0405757452148008,1.112286803280317,-.0717110580655164,-.0763729366746601,-.4214933324022432,1.5869240198367816],o=[1,.3963377773761749,.2158037573099136,1,-.1055613458156586,-.0638541728258133,1,-.0894841775298119,-1.2914855480194092];
+ */function OKLCH_to_OKLab(t){const n=t[2]*Math.PI/180;return[t[0],t[1]*Math.cos(n),t[1]*Math.sin(n)]}const _=[1.2268798758459243,-.5578149944602171,.2813910456659647,-.0405757452148008,1.112286803280317,-.0717110580655164,-.0763729366746601,-.4214933324022432,1.5869240198367816],o=[1,.3963377773761749,.2158037573099136,1,-.1055613458156586,-.0638541728258133,1,-.0894841775298119,-1.2914855480194092];
/**
* Given OKLab, convert to XYZ relative to D65
*
@@ -55,7 +55,7 @@ function OKLab_to_XYZ(t){const n=multiplyMatrices(o,t);return multiplyMatrices(_
*
* @license W3C https://www.w3.org/Consortium/Legal/2015/copyright-software-and-document
* @copyright This software or document includes material copied from or derived from https://github.com/w3c/csswg-drafts/blob/main/css-color-4/conversions.js. Copyright © 2022 W3C® (MIT, ERCIM, Keio, Beihang).
- */function lin_2020(t){const n=1.09929682680944;return t.map((function(t){const _=t<0?-1:1,o=Math.abs(t);return o<.08124285829863151?t/4.5:_*Math.pow((o+n-1)/n,1/.45)}))}const e=[63426534/99577255,20160776/139408157,47086771/278816314,26158966/99577255,.677998071518871,8267143/139408157,0,19567812/697040785,1.0609850577107909];
+ */const e=1.09929682680944,a=.018053968510807;function lin_2020_channel(t){const n=t<0?-1:1,_=Math.abs(t);return _<4.5*a?t/4.5:n*Math.pow((_+e-1)/e,1/.45)}const r=[63426534/99577255,20160776/139408157,47086771/278816314,26158966/99577255,.677998071518871,8267143/139408157,0,19567812/697040785,1.0609850577107909];
/**
* Convert an array of linear-light rec2020 values to CIE XYZ
* using D65 (no chromatic adaptation)
@@ -75,14 +75,14 @@ function OKLab_to_XYZ(t){const n=multiplyMatrices(o,t);return multiplyMatrices(_
* @copyright This software or document includes material copied from or derived from https://github.com/w3c/csswg-drafts/blob/main/css-color-4/conversions.js. Copyright © 2022 W3C® (MIT, ERCIM, Keio, Beihang).
* @see https://en.wikipedia.org/wiki/SRGB
*/
-function lin_sRGB(t){return t.map((function(t){const n=t<0?-1:1,_=Math.abs(t);return _<=.04045?t/12.92:n*Math.pow((_+.055)/1.055,2.4)}))}
+function lin_sRGB(t){return[lin_sRGB_channel(t[0]),lin_sRGB_channel(t[1]),lin_sRGB_channel(t[2])]}function lin_sRGB_channel(t){const n=t<0?-1:1,_=Math.abs(t);return _<=.04045?t/12.92:n*Math.pow((_+.055)/1.055,2.4)}
/**
* Convert an array of display-p3 RGB values in the range 0.0 - 1.0
* to linear light (un-companded) form.
*
* @license W3C https://www.w3.org/Consortium/Legal/2015/copyright-software-and-document
* @copyright This software or document includes material copied from or derived from https://github.com/w3c/csswg-drafts/blob/main/css-color-4/conversions.js. Copyright © 2022 W3C® (MIT, ERCIM, Keio, Beihang).
- */function lin_P3(t){return lin_sRGB(t)}const r=[608311/1250200,189793/714400,198249/1000160,35783/156275,247089/357200,198249/2500400,0,32229/714400,5220557/5000800];
+ */function lin_P3(t){return lin_sRGB(t)}const l=[608311/1250200,189793/714400,198249/1000160,35783/156275,247089/357200,198249/2500400,0,32229/714400,5220557/5000800];
/**
* Convert an array of linear-light display-p3 values to CIE XYZ
* using D65 (no chromatic adaptation)
@@ -90,7 +90,7 @@ function lin_sRGB(t){return t.map((function(t){const n=t<0?-1:1,_=Math.abs(t);re
* @license W3C https://www.w3.org/Consortium/Legal/2015/copyright-software-and-document
* @copyright This software or document includes material copied from or derived from https://github.com/w3c/csswg-drafts/blob/main/css-color-4/conversions.js. Copyright © 2022 W3C® (MIT, ERCIM, Keio, Beihang).
* @see http://www.brucelindbloom.com/index.html?Eqn_RGB_XYZ_Matrix.html
- */function lin_P3_to_XYZ(t){return multiplyMatrices(r,t)}
+ */function lin_P3_to_XYZ(t){return multiplyMatrices(l,t)}
/**
* Convert an array of prophoto-rgb values where in-gamut Colors are in the
* range [0.0 - 1.0] to linear light (un-companded) form. Transfer curve is
@@ -98,7 +98,7 @@ function lin_sRGB(t){return t.map((function(t){const n=t<0?-1:1,_=Math.abs(t);re
*
* @license W3C https://www.w3.org/Consortium/Legal/2015/copyright-software-and-document
* @copyright This software or document includes material copied from or derived from https://github.com/w3c/csswg-drafts/blob/main/css-color-4/conversions.js. Copyright © 2022 W3C® (MIT, ERCIM, Keio, Beihang).
- */const a=[.7977666449006423,.13518129740053308,.0313477341283922,.2880748288194013,.711835234241873,8993693872564e-17,0,0,.8251046025104602];
+ */const i=16/512;function lin_ProPhoto_channel(t){const n=t<0?-1:1,_=Math.abs(t);return _<=i?t/16:n*Math.pow(_,1.8)}const c=[.7977666449006423,.13518129740053308,.0313477341283922,.2880748288194013,.711835234241873,8993693872564e-17,0,0,.8251046025104602];
/**
* Convert an array of linear-light prophoto-rgb values to CIE D50 XYZ.
* Matrix cannot be expressed in rational form, but is calculated to 64 bit accuracy.
@@ -106,7 +106,7 @@ function lin_sRGB(t){return t.map((function(t){const n=t<0?-1:1,_=Math.abs(t);re
* @license W3C https://www.w3.org/Consortium/Legal/2015/copyright-software-and-document
* @copyright This software or document includes material copied from or derived from https://github.com/w3c/csswg-drafts/blob/main/css-color-4/conversions.js. Copyright © 2022 W3C® (MIT, ERCIM, Keio, Beihang).
* @see see https://github.com/w3c/csswg-drafts/issues/7675
- */const i=[573536/994567,263643/1420810,187206/994567,591459/1989134,6239551/9945670,374412/4972835,53769/1989134,351524/4972835,4929758/4972835];
+ */function lin_a98rgb_channel(t){const n=t<0?-1:1,_=Math.abs(t);return n*Math.pow(_,563/256)}const u=[573536/994567,263643/1420810,187206/994567,591459/1989134,6239551/9945670,374412/4972835,53769/1989134,351524/4972835,4929758/4972835];
/**
* Convert an array of linear-light a98-rgb values to CIE XYZ
* http://www.brucelindbloom.com/index.html?Eqn_RGB_XYZ_Matrix.html
@@ -120,24 +120,24 @@ function lin_sRGB(t){return t.map((function(t){const n=t<0?-1:1,_=Math.abs(t);re
* @see http://www.brucelindbloom.com/index.html?Eqn_RGB_XYZ_Matrix.html
* @see https://www.adobe.com/digitalimag/pdfs/AdobeRGB1998.pdf
* @see https://github.com/w3c/csswg-drafts/blob/main/css-color-4/matrixmaker.html
- */const l=[506752/1228815,87881/245763,12673/70218,87098/409605,175762/245763,12673/175545,7918/409605,87881/737289,1001167/1053270];
+ */const s=[506752/1228815,87881/245763,12673/70218,87098/409605,175762/245763,12673/175545,7918/409605,87881/737289,1001167/1053270];
/**
* Convert an array of linear-light sRGB values to CIE XYZ
* using sRGB's own white, D65 (no chromatic adaptation)
*
* @license W3C https://www.w3.org/Consortium/Legal/2015/copyright-software-and-document
* @copyright This software or document includes material copied from or derived from https://github.com/w3c/csswg-drafts/blob/main/css-color-4/conversions.js. Copyright © 2022 W3C® (MIT, ERCIM, Keio, Beihang).
- */function lin_sRGB_to_XYZ(t){return multiplyMatrices(l,t)}const u=[.955473421488075,-.02309845494876471,.06325924320057072,-.0283697093338637,1.0099953980813041,.021041441191917323,.012314014864481998,-.020507649298898964,1.330365926242124];
+ */function lin_sRGB_to_XYZ(t){return multiplyMatrices(s,t)}const h=[.955473421488075,-.02309845494876471,.06325924320057072,-.0283697093338637,1.0099953980813041,.021041441191917323,.012314014864481998,-.020507649298898964,1.330365926242124];
/**
* Bradford chromatic adaptation from D50 to D65
*
* @license W3C https://www.w3.org/Consortium/Legal/2015/copyright-software-and-document
* @copyright This software or document includes material copied from or derived from https://github.com/w3c/csswg-drafts/blob/main/css-color-4/conversions.js. Copyright © 2022 W3C® (MIT, ERCIM, Keio, Beihang).
- */function D50_to_D65(t){return multiplyMatrices(u,t)}const c=[12831/3959,-329/214,-1974/3959,-851781/878810,1648619/878810,36519/878810,705/12673,-2585/12673,705/667];
+ */function D50_to_D65(t){return multiplyMatrices(h,t)}const m=[12831/3959,-329/214,-1974/3959,-851781/878810,1648619/878810,36519/878810,705/12673,-2585/12673,705/667];
/**
* @license W3C https://www.w3.org/Consortium/Legal/2015/copyright-software-and-document
* @copyright This software or document includes material copied from or derived from https://github.com/w3c/csswg-drafts/blob/main/css-color-4/conversions.js. Copyright © 2022 W3C® (MIT, ERCIM, Keio, Beihang).
- */function XYZ_to_lin_sRGB(t){return multiplyMatrices(c,t)}
+ */function XYZ_to_lin_sRGB(t){return multiplyMatrices(m,t)}
/**
* Convert an array of linear-light sRGB values in the range 0.0-1.0 to gamma corrected form
* Extended transfer function:
@@ -147,7 +147,7 @@ function lin_sRGB(t){return t.map((function(t){const n=t<0?-1:1,_=Math.abs(t);re
* @license W3C https://www.w3.org/Consortium/Legal/2015/copyright-software-and-document
* @copyright This software or document includes material copied from or derived from https://github.com/w3c/csswg-drafts/blob/main/css-color-4/conversions.js. Copyright © 2022 W3C® (MIT, ERCIM, Keio, Beihang).
* @see https://en.wikipedia.org/wiki/SRGB
- */function gam_sRGB(t){return t.map((function(t){const n=t<0?-1:1,_=Math.abs(t);return _>.0031308?n*(1.055*Math.pow(_,1/2.4)-.055):12.92*t}))}
+ */function gam_sRGB(t){return[gam_sRGB_channel(t[0]),gam_sRGB_channel(t[1]),gam_sRGB_channel(t[2])]}function gam_sRGB_channel(t){const n=t<0?-1:1,_=Math.abs(t);return _>.0031308?n*(1.055*Math.pow(_,1/2.4)-.055):12.92*t}
/**
* Convert an array of gamma-corrected sRGB values in the 0.0 to 1.0 range to HSL.
*
@@ -161,13 +161,13 @@ function lin_sRGB(t){return t.map((function(t){const n=t<0?-1:1,_=Math.abs(t);re
* @copyright This software or document includes material copied from or derived from https://github.com/w3c/csswg-drafts/blob/main/css-color-4/utilities.js. Copyright © 2022 W3C® (MIT, ERCIM, Keio, Beihang).
*
* @see https://github.com/w3c/csswg-drafts/blob/main/css-color-4/better-rgbToHsl.js
- */function sRGB_to_HSL(t){const n=t[0],_=t[1],o=t[2],e=Math.max(n,_,o),r=Math.min(n,_,o),a=(r+e)/2,i=e-r;let l=NaN,u=0;if(0!==Math.round(1e5*i)){switch(u=0===Math.round(1e5*a)||1e5===Math.round(1e5*a)?0:(e-a)/Math.min(a,1-a),e){case n:l=(_-o)/i+(_<0&&(l+=180,u=Math.abs(u)),l>=360&&(l-=360),[l,100*u,100*a]}const s=[446124/178915,-333277/357830,-72051/178915,-14852/17905,63121/35810,423/17905,11844/330415,-50337/660830,316169/330415];
+ */function sRGB_to_HSL(t){const n=t[0],_=t[1],o=t[2],e=Math.max(n,_,o),a=Math.min(n,_,o),r=(a+e)/2,l=e-a;let i=NaN,c=0;if(0!==Math.round(1e5*l)){const t=Math.round(1e5*r);switch(c=0===t||1e5===t?0:(e-r)/Math.min(r,1-r),e){case n:i=(_-o)/l+(_<0&&(i+=180,c=Math.abs(c)),i>=360&&(i-=360),[i,100*c,100*r]}const D=[446124/178915,-333277/357830,-72051/178915,-14852/17905,63121/35810,423/17905,11844/330415,-50337/660830,316169/330415];
/**
* Convert XYZ to linear-light P3
*
* @license W3C https://www.w3.org/Consortium/Legal/2015/copyright-software-and-document
* @copyright This software or document includes material copied from or derived from https://github.com/w3c/csswg-drafts/blob/main/css-color-4/conversions.js. Copyright © 2022 W3C® (MIT, ERCIM, Keio, Beihang).
- */function XYZ_to_lin_P3(t){return multiplyMatrices(s,t)}
+ */function XYZ_to_lin_P3(t){return multiplyMatrices(D,t)}
/**
* Convert an array of linear-light display-p3 RGB in the range 0.0-1.0
* to gamma corrected form
@@ -181,7 +181,7 @@ function lin_sRGB(t){return t.map((function(t){const n=t<0?-1:1,_=Math.abs(t);re
*
* @license W3C https://www.w3.org/Consortium/Legal/2015/copyright-software-and-document
* @copyright This software or document includes material copied from or derived from https://github.com/w3c/csswg-drafts/blob/main/css-color-4/conversions.js. Copyright © 2022 W3C® (MIT, ERCIM, Keio, Beihang).
- */function XYZ_to_Lab(t){const _=216/24389,o=24389/27,e=t.map(((t,_)=>t/n[_])).map((t=>t>_?Math.cbrt(t):(o*t+16)/116));return[116*e[1]-16,500*(e[0]-e[1]),200*(e[1]-e[2])]}const m=[.819022437996703,.3619062600528904,-.1288737815209879,.0329836539323885,.9292868615863434,.0361446663506424,.0481771893596242,.2642395317527308,.6335478284694309],h=[.210454268309314,.7936177747023054,-.0040720430116193,1.9779985324311684,-2.42859224204858,.450593709617411,.0259040424655478,.7827717124575296,-.8086757549230774];
+ */function XYZ_to_Lab(t){const _=compute_f(t[0]/n[0]),o=compute_f(t[1]/n[1]);return[116*o-16,500*(_-o),200*(o-compute_f(t[2]/n[2]))]}const g=216/24389,b=24389/27;function compute_f(t){return t>g?Math.cbrt(t):(b*t+16)/116}const f=[.819022437996703,.3619062600528904,-.1288737815209879,.0329836539323885,.9292868615863434,.0361446663506424,.0481771893596242,.2642395317527308,.6335478284694309],X=[.210454268309314,.7936177747023054,-.0040720430116193,1.9779985324311684,-2.42859224204858,.450593709617411,.0259040424655478,.7827717124575296,-.8086757549230774];
/**
* @license W3C https://www.w3.org/Consortium/Legal/2015/copyright-software-and-document
* @copyright This software or document includes material copied from or derived from https://github.com/w3c/csswg-drafts/blob/main/css-color-4/conversions.js. Copyright © 2022 W3C® (MIT, ERCIM, Keio, Beihang).
@@ -189,7 +189,7 @@ function lin_sRGB(t){return t.map((function(t){const n=t<0?-1:1,_=Math.abs(t);re
* XYZ <-> LMS matrices recalculated for consistent reference white
* @see https://github.com/w3c/csswg-drafts/issues/6642#issuecomment-943521484
*/
-function XYZ_to_OKLab(t){const n=multiplyMatrices(m,t);return multiplyMatrices(h,[Math.cbrt(n[0]),Math.cbrt(n[1]),Math.cbrt(n[2])])}
+function XYZ_to_OKLab(t){const n=multiplyMatrices(f,t);return multiplyMatrices(X,[Math.cbrt(n[0]),Math.cbrt(n[1]),Math.cbrt(n[2])])}
/**
* @license W3C https://www.w3.org/Consortium/Legal/2015/copyright-software-and-document
* @copyright This software or document includes material copied from or derived from https://github.com/w3c/csswg-drafts/blob/main/css-color-4/conversions.js. Copyright © 2022 W3C® (MIT, ERCIM, Keio, Beihang).
@@ -198,34 +198,48 @@ function XYZ_to_OKLab(t){const n=multiplyMatrices(m,t);return multiplyMatrices(h
* @license W3C https://www.w3.org/Consortium/Legal/2015/copyright-software-and-document
* @copyright This software or document includes material copied from or derived from https://github.com/w3c/csswg-drafts/blob/main/css-color-4/conversions.js. Copyright © 2022 W3C® (MIT, ERCIM, Keio, Beihang).
* @see https://github.com/w3c/csswg-drafts/blob/main/css-color-4/conversions.js
- */function OKLab_to_OKLCH(t){const n=180*Math.atan2(t[2],t[1])/Math.PI;return[t[0],Math.sqrt(t[1]**2+t[2]**2),n>=0?n:n+360]}const D=[1829569/896150,-506331/896150,-308931/896150,-851781/878810,1648619/878810,36519/878810,16779/1248040,-147721/1248040,1266979/1248040];
+ */function OKLab_to_OKLCH(t){const n=180*Math.atan2(t[2],t[1])/Math.PI;return[t[0],Math.sqrt(t[1]**2+t[2]**2),n>=0?n:n+360]}const Y=[1829569/896150,-506331/896150,-308931/896150,-851781/878810,1648619/878810,36519/878810,16779/1248040,-147721/1248040,1266979/1248040];
/**
* Convert XYZ to linear-light a98-rgb
*
* @license W3C https://www.w3.org/Consortium/Legal/2015/copyright-software-and-document
* @copyright This software or document includes material copied from or derived from https://github.com/w3c/csswg-drafts/blob/main/css-color-4/conversions.js. Copyright © 2022 W3C® (MIT, ERCIM, Keio, Beihang).
- */const X=[30757411/17917100,-6372589/17917100,-4539589/17917100,-.666684351832489,1.616481236634939,467509/29648200,792561/44930125,-1921689/44930125,.942103121235474];
+ */function gam_a98rgb_channel(t){const n=t<0?-1:1,_=Math.abs(t);return n*Math.pow(_,256/563)}const Z=[30757411/17917100,-6372589/17917100,-4539589/17917100,-.666684351832489,1.616481236634939,467509/29648200,792561/44930125,-1921689/44930125,.942103121235474];
/**
* Convert XYZ to linear-light rec2020
*
* @license W3C https://www.w3.org/Consortium/Legal/2015/copyright-software-and-document
* @copyright This software or document includes material copied from or derived from https://github.com/w3c/csswg-drafts/blob/main/css-color-4/conversions.js. Copyright © 2022 W3C® (MIT, ERCIM, Keio, Beihang).
- */
+ */const p=1.09929682680944,M=.018053968510807;function gam_2020_channel(t){const n=t<0?-1:1,_=Math.abs(t);return _>M?n*(p*Math.pow(_,.45)-(p-1)):4.5*t}const d=[1.3457868816471583,-.25557208737979464,-.05110186497554526,-.5446307051249019,1.5082477428451468,.02052744743642139,0,0,1.2119675456389452];
/**
- * Convert an array of linear-light rec2020 RGB in the range 0.0-1.0
- * to gamma corrected form ITU-R BT.2020-2 p.4
+ * Convert D50 XYZ to linear-light prophoto-rgb
*
* @license W3C https://www.w3.org/Consortium/Legal/2015/copyright-software-and-document
* @copyright This software or document includes material copied from or derived from https://github.com/w3c/csswg-drafts/blob/main/css-color-4/conversions.js. Copyright © 2022 W3C® (MIT, ERCIM, Keio, Beihang).
- */
-function gam_2020(t){const n=1.09929682680944;return t.map((function(t){const _=t<0?-1:1,o=Math.abs(t);return o>.018053968510807?_*(n*Math.pow(o,.45)-(n-1)):4.5*t}))}const Y=[1.3457868816471583,-.25557208737979464,-.05110186497554526,-.5446307051249019,1.5082477428451468,.02052744743642139,0,0,1.2119675456389452];
+ * @see http://www.brucelindbloom.com/index.html?Eqn_RGB_XYZ_Matrix.html
+ */const L=1/512;function gam_ProPhoto_channel(t){const n=t<0?-1:1,_=Math.abs(t);return _>=L?n*Math.pow(_,1/1.8):16*t}function sRGB_to_XYZ_D50(t){let n=t;return n=lin_sRGB(n),n=lin_sRGB_to_XYZ(n),n=D65_to_D50(n),n}function XYZ_D50_to_sRGB(t){let n=t;return n=D50_to_D65(n),n=XYZ_to_lin_sRGB(n),n=gam_sRGB(n),n}function HSL_to_XYZ_D50(t){let n=t;return n=HSL_to_sRGB(n),n=lin_sRGB(n),n=lin_sRGB_to_XYZ(n),n=D65_to_D50(n),n}function XYZ_D50_to_HSL(t){let n=t;return n=D50_to_D65(n),n=XYZ_to_lin_sRGB(n),n=gam_sRGB(n),n=sRGB_to_HSL(n),n}function HWB_to_XYZ_D50(t){let n=t;return n=HWB_to_sRGB(n),n=lin_sRGB(n),n=lin_sRGB_to_XYZ(n),n=D65_to_D50(n),n}function XYZ_D50_to_HWB(t){let n=t;n=D50_to_D65(n),n=XYZ_to_lin_sRGB(n);const _=gam_sRGB(n);n=sRGB_to_HSL(_);const o=Math.min(_[0],_[1],_[2]),e=1-Math.max(_[0],_[1],_[2]);return[n[0],100*o,100*e]}function Lab_to_XYZ_D50(t){let n=t;return n=Lab_to_XYZ(n),n}function XYZ_D50_to_Lab(t){let n=t;return n=XYZ_to_Lab(n),n}function LCH_to_XYZ_D50(t){let n=t;return n=LCH_to_Lab(n),n=Lab_to_XYZ(n),n}function XYZ_D50_to_LCH(t){let n=t;return n=XYZ_to_Lab(n),n=Lab_to_LCH(n),n}function OKLab_to_XYZ_D50(t){let n=t;return n=OKLab_to_XYZ(n),n=D65_to_D50(n),n}function XYZ_D50_to_OKLab(t){let n=t;return n=D50_to_D65(n),n=XYZ_to_OKLab(n),n}function OKLCH_to_XYZ_D50(t){let n=t;return n=OKLCH_to_OKLab(n),n=OKLab_to_XYZ(n),n=D65_to_D50(n),n}function XYZ_D50_to_OKLCH(t){let n=t;return n=D50_to_D65(n),n=XYZ_to_OKLab(n),n=OKLab_to_OKLCH(n),n}function lin_sRGB_to_XYZ_D50(t){let n=t;return n=lin_sRGB_to_XYZ(n),n=D65_to_D50(n),n}function XYZ_D50_to_lin_sRGB(t){let n=t;return n=D50_to_D65(n),n=XYZ_to_lin_sRGB(n),n}function a98_RGB_to_XYZ_D50(t){let n=t;
/**
- * Convert D50 XYZ to linear-light prophoto-rgb
+ * Convert an array of a98-rgb values in the range 0.0 - 1.0
+ * to linear light (un-companded) form. Negative values are also now accepted
*
* @license W3C https://www.w3.org/Consortium/Legal/2015/copyright-software-and-document
* @copyright This software or document includes material copied from or derived from https://github.com/w3c/csswg-drafts/blob/main/css-color-4/conversions.js. Copyright © 2022 W3C® (MIT, ERCIM, Keio, Beihang).
- * @see http://www.brucelindbloom.com/index.html?Eqn_RGB_XYZ_Matrix.html
*/
+var _;return n=[lin_a98rgb_channel((_=n)[0]),lin_a98rgb_channel(_[1]),lin_a98rgb_channel(_[2])],n=multiplyMatrices(u,n),n=D65_to_D50(n),n}function XYZ_D50_to_a98_RGB(t){let n=t;var _;
+/**
+ * Convert an array of linear-light a98-rgb in the range 0.0-1.0
+ * to gamma corrected form. Negative values are also now accepted
+ *
+ * @license W3C https://www.w3.org/Consortium/Legal/2015/copyright-software-and-document
+ * @copyright This software or document includes material copied from or derived from https://github.com/w3c/csswg-drafts/blob/main/css-color-4/conversions.js. Copyright © 2022 W3C® (MIT, ERCIM, Keio, Beihang).
+ */return n=D50_to_D65(n),n=multiplyMatrices(Y,n),n=[gam_a98rgb_channel((_=n)[0]),gam_a98rgb_channel(_[1]),gam_a98rgb_channel(_[2])],n}function P3_to_XYZ_D50(t){let n=t;return n=lin_P3(n),n=lin_P3_to_XYZ(n),n=D65_to_D50(n),n}function XYZ_D50_to_P3(t){let n=t;return n=D50_to_D65(n),n=XYZ_to_lin_P3(n),n=gam_P3(n),n}function rec_2020_to_XYZ_D50(t){let n=t;var _;return n=[lin_2020_channel((_=n)[0]),lin_2020_channel(_[1]),lin_2020_channel(_[2])],n=multiplyMatrices(r,n),n=D65_to_D50(n),n}function XYZ_D50_to_rec_2020(t){let n=t;var _;
+/**
+ * Convert an array of linear-light rec2020 RGB in the range 0.0-1.0
+ * to gamma corrected form ITU-R BT.2020-2 p.4
+ *
+ * @license W3C https://www.w3.org/Consortium/Legal/2015/copyright-software-and-document
+ * @copyright This software or document includes material copied from or derived from https://github.com/w3c/csswg-drafts/blob/main/css-color-4/conversions.js. Copyright © 2022 W3C® (MIT, ERCIM, Keio, Beihang).
+ */return n=D50_to_D65(n),n=multiplyMatrices(Z,n),n=[gam_2020_channel((_=n)[0]),gam_2020_channel(_[1]),gam_2020_channel(_[2])],n}function ProPhoto_RGB_to_XYZ_D50(t){let n=t;var _;return n=[lin_ProPhoto_channel((_=n)[0]),lin_ProPhoto_channel(_[1]),lin_ProPhoto_channel(_[2])],n=multiplyMatrices(c,n),n}function XYZ_D50_to_ProPhoto(t){let n=t;var _;
/**
* Convert an array of linear-light prophoto-rgb in the range 0.0-1.0
* to gamma corrected form.
@@ -233,8 +247,7 @@ function gam_2020(t){const n=1.09929682680944;return t.map((function(t){const _=
*
* @license W3C https://www.w3.org/Consortium/Legal/2015/copyright-software-and-document
* @copyright This software or document includes material copied from or derived from https://github.com/w3c/csswg-drafts/blob/main/css-color-4/conversions.js. Copyright © 2022 W3C® (MIT, ERCIM, Keio, Beihang).
- */
-function gam_ProPhoto(t){const n=1/512;return t.map((function(t){const _=t<0?-1:1,o=Math.abs(t);return o>=n?_*Math.pow(o,1/1.8):16*t}))}function sRGB_to_XYZ_D50(t){let n=t;return n=lin_sRGB(n),n=lin_sRGB_to_XYZ(n),n=D65_to_D50(n),n}function XYZ_D50_to_sRGB(t){let n=t;return n=D50_to_D65(n),n=XYZ_to_lin_sRGB(n),n=gam_sRGB(n),n}function HSL_to_XYZ_D50(t){let n=t;return n=HSL_to_sRGB(n),n=lin_sRGB(n),n=lin_sRGB_to_XYZ(n),n=D65_to_D50(n),n}function XYZ_D50_to_HSL(t){let n=t;return n=D50_to_D65(n),n=XYZ_to_lin_sRGB(n),n=gam_sRGB(n),n=sRGB_to_HSL(n),n}function HWB_to_XYZ_D50(t){let n=t;return n=HWB_to_sRGB(n),n=lin_sRGB(n),n=lin_sRGB_to_XYZ(n),n=D65_to_D50(n),n}function XYZ_D50_to_HWB(t){let n=t;n=D50_to_D65(n),n=XYZ_to_lin_sRGB(n);const _=gam_sRGB(n);n=sRGB_to_HSL(_);const o=Math.min(_[0],_[1],_[2]),e=1-Math.max(_[0],_[1],_[2]);return[n[0],100*o,100*e]}function Lab_to_XYZ_D50(t){let n=t;return n=Lab_to_XYZ(n),n}function XYZ_D50_to_Lab(t){let n=t;return n=XYZ_to_Lab(n),n}function LCH_to_XYZ_D50(t){let n=t;var _;return n=[(_=n)[0],_[1]*Math.cos(_[2]*Math.PI/180),_[1]*Math.sin(_[2]*Math.PI/180)],n=Lab_to_XYZ(n),n}function XYZ_D50_to_LCH(t){let n=t;return n=XYZ_to_Lab(n),n=Lab_to_LCH(n),n}function OKLab_to_XYZ_D50(t){let n=t;return n=OKLab_to_XYZ(n),n=D65_to_D50(n),n}function XYZ_D50_to_OKLab(t){let n=t;return n=D50_to_D65(n),n=XYZ_to_OKLab(n),n}function OKLCH_to_XYZ_D50(t){let n=t;return n=OKLCH_to_OKLab(n),n=OKLab_to_XYZ(n),n=D65_to_D50(n),n}function XYZ_D50_to_OKLCH(t){let n=t;return n=D50_to_D65(n),n=XYZ_to_OKLab(n),n=OKLab_to_OKLCH(n),n}function lin_sRGB_to_XYZ_D50(t){let n=t;return n=lin_sRGB_to_XYZ(n),n=D65_to_D50(n),n}function XYZ_D50_to_lin_sRGB(t){let n=t;return n=D50_to_D65(n),n=XYZ_to_lin_sRGB(n),n}function a98_RGB_to_XYZ_D50(t){let n=t;return n=n.map((function(t){const n=t<0?-1:1,_=Math.abs(t);return n*Math.pow(_,563/256)})),n=multiplyMatrices(i,n),n=D65_to_D50(n),n}function XYZ_D50_to_a98_RGB(t){let n=t;return n=D50_to_D65(n),n=multiplyMatrices(D,n),n=n.map((function(t){const n=t<0?-1:1,_=Math.abs(t);return n*Math.pow(_,256/563)})),n}function P3_to_XYZ_D50(t){let n=t;return n=lin_P3(n),n=lin_P3_to_XYZ(n),n=D65_to_D50(n),n}function XYZ_D50_to_P3(t){let n=t;return n=D50_to_D65(n),n=XYZ_to_lin_P3(n),n=gam_P3(n),n}function rec_2020_to_XYZ_D50(t){let n=t;return n=lin_2020(n),n=multiplyMatrices(e,n),n=D65_to_D50(n),n}function XYZ_D50_to_rec_2020(t){let n=t;return n=D50_to_D65(n),n=multiplyMatrices(X,n),n=gam_2020(n),n}function ProPhoto_RGB_to_XYZ_D50(t){let n=t;return n=n.map((function(t){const n=t<0?-1:1,_=Math.abs(t);return _<=.03125?t/16:n*Math.pow(_,1.8)})),n=multiplyMatrices(a,n),n}function XYZ_D50_to_ProPhoto(t){let n=t;return n=multiplyMatrices(Y,n),n=gam_ProPhoto(n),n}function XYZ_D65_to_XYZ_D50(t){let n=t;return n=D65_to_D50(n),n}function XYZ_D50_to_XYZ_D65(t){let n=t;return n=D50_to_D65(n),n}function XYZ_D50_to_XYZ_D50(t){return t}function inGamut(t){const[n,_,o]=t;return n>=-1e-4&&n<=1.0001&&_>=-1e-4&&_<=1.0001&&o>=-1e-4&&o<=1.0001}function clip(t){return t.map((t=>t<0?0:t>1?1:t))}
+ */return n=multiplyMatrices(d,n),n=[gam_ProPhoto_channel((_=n)[0]),gam_ProPhoto_channel(_[1]),gam_ProPhoto_channel(_[2])],n}function XYZ_D65_to_XYZ_D50(t){let n=t;return n=D65_to_D50(n),n}function XYZ_D50_to_XYZ_D65(t){let n=t;return n=D50_to_D65(n),n}function XYZ_D50_to_XYZ_D50(t){return t}function inGamut(t){return t[0]>=-1e-4&&t[0]<=1.0001&&t[1]>=-1e-4&&t[1]<=1.0001&&t[2]>=-1e-4&&t[2]<=1.0001}function clip(t){return[t[0]<0?0:t[0]>1?1:t[0],t[1]<0?0:t[1]>1?1:t[1],t[2]<0?0:t[2]>1?1:t[2]]}
/**
* @description Calculate deltaE OK which is the simple root sum of squares
* @param {number[]} reference - Array of OKLab values: L as 0..1, a and b as -1..1
@@ -244,7 +257,7 @@ function gam_ProPhoto(t){const n=1/512;return t.map((function(t){const _=t<0?-1:
* @license W3C https://www.w3.org/Consortium/Legal/2015/copyright-software-and-document
* @copyright This software or document includes material copied from or derived from https://github.com/w3c/csswg-drafts/blob/main/css-color-4/deltaEOK.js. Copyright © 2022 W3C® (MIT, ERCIM, Keio, Beihang).
* @see https://github.com/w3c/csswg-drafts/blob/main/css-color-4/deltaEOK.js
- */function deltaEOK(t,n){const[_,o,e]=t,[r,a,i]=n,l=_-r,u=o-a,c=e-i;return Math.sqrt(l**2+u**2+c**2)}const Z=.02,b=1e-4;function mapGamut(t,n,_){const o=t;let e=clip(n(o)),r=deltaEOK(OKLCH_to_OKLab(_(e)),OKLCH_to_OKLab(o));if(rb;){const t=(a+i)/2;if(o[1]=t,l&&inGamut(n(o)))a=t;else if(e=clip(n(o)),r=deltaEOK(OKLCH_to_OKLab(_(e)),OKLCH_to_OKLab(o)),rG;){const t=(r+l)/2;if(o[1]=t,i&&inGamut(n(o)))r=t;else if(e=clip(n(o)),a=deltaEOK(OKLCH_to_OKLab(_(e)),OKLCH_to_OKLab(o)),a0){const t=_(r);t[0]=o,t[2]=e,r=n(t)}const i=rayTraceBox(a,r.slice());if(!i)break;r=i.slice()}return clip(r)}function rayTraceBox(t,n){let _=1/0,o=-1/0;const e=[];for(let r=0;r<3;r++){const a=t[r],i=n[r]-a;e.push(i);const l=0,u=1;if(i){const t=1/i,n=(l-a)*t,e=(u-a)*t;o=Math.max(Math.min(n,e),o),_=Math.min(Math.max(n,e),_)}else if(au)return!1}return!(o>_||_<0)&&(o<0&&(o=_),!!isFinite(o)&&[t[0]+e[0]*o,t[1]+e[1]*o,t[2]+e[2]*o])}const p={aliceblue:[240,248,255],antiquewhite:[250,235,215],aqua:[0,255,255],aquamarine:[127,255,212],azure:[240,255,255],beige:[245,245,220],bisque:[255,228,196],black:[0,0,0],blanchedalmond:[255,235,205],blue:[0,0,255],blueviolet:[138,43,226],brown:[165,42,42],burlywood:[222,184,135],cadetblue:[95,158,160],chartreuse:[127,255,0],chocolate:[210,105,30],coral:[255,127,80],cornflowerblue:[100,149,237],cornsilk:[255,248,220],crimson:[220,20,60],cyan:[0,255,255],darkblue:[0,0,139],darkcyan:[0,139,139],darkgoldenrod:[184,134,11],darkgray:[169,169,169],darkgreen:[0,100,0],darkgrey:[169,169,169],darkkhaki:[189,183,107],darkmagenta:[139,0,139],darkolivegreen:[85,107,47],darkorange:[255,140,0],darkorchid:[153,50,204],darkred:[139,0,0],darksalmon:[233,150,122],darkseagreen:[143,188,143],darkslateblue:[72,61,139],darkslategray:[47,79,79],darkslategrey:[47,79,79],darkturquoise:[0,206,209],darkviolet:[148,0,211],deeppink:[255,20,147],deepskyblue:[0,191,255],dimgray:[105,105,105],dimgrey:[105,105,105],dodgerblue:[30,144,255],firebrick:[178,34,34],floralwhite:[255,250,240],forestgreen:[34,139,34],fuchsia:[255,0,255],gainsboro:[220,220,220],ghostwhite:[248,248,255],gold:[255,215,0],goldenrod:[218,165,32],gray:[128,128,128],green:[0,128,0],greenyellow:[173,255,47],grey:[128,128,128],honeydew:[240,255,240],hotpink:[255,105,180],indianred:[205,92,92],indigo:[75,0,130],ivory:[255,255,240],khaki:[240,230,140],lavender:[230,230,250],lavenderblush:[255,240,245],lawngreen:[124,252,0],lemonchiffon:[255,250,205],lightblue:[173,216,230],lightcoral:[240,128,128],lightcyan:[224,255,255],lightgoldenrodyellow:[250,250,210],lightgray:[211,211,211],lightgreen:[144,238,144],lightgrey:[211,211,211],lightpink:[255,182,193],lightsalmon:[255,160,122],lightseagreen:[32,178,170],lightskyblue:[135,206,250],lightslategray:[119,136,153],lightslategrey:[119,136,153],lightsteelblue:[176,196,222],lightyellow:[255,255,224],lime:[0,255,0],limegreen:[50,205,50],linen:[250,240,230],magenta:[255,0,255],maroon:[128,0,0],mediumaquamarine:[102,205,170],mediumblue:[0,0,205],mediumorchid:[186,85,211],mediumpurple:[147,112,219],mediumseagreen:[60,179,113],mediumslateblue:[123,104,238],mediumspringgreen:[0,250,154],mediumturquoise:[72,209,204],mediumvioletred:[199,21,133],midnightblue:[25,25,112],mintcream:[245,255,250],mistyrose:[255,228,225],moccasin:[255,228,181],navajowhite:[255,222,173],navy:[0,0,128],oldlace:[253,245,230],olive:[128,128,0],olivedrab:[107,142,35],orange:[255,165,0],orangered:[255,69,0],orchid:[218,112,214],palegoldenrod:[238,232,170],palegreen:[152,251,152],paleturquoise:[175,238,238],palevioletred:[219,112,147],papayawhip:[255,239,213],peachpuff:[255,218,185],peru:[205,133,63],pink:[255,192,203],plum:[221,160,221],powderblue:[176,224,230],purple:[128,0,128],rebeccapurple:[102,51,153],red:[255,0,0],rosybrown:[188,143,143],royalblue:[65,105,225],saddlebrown:[139,69,19],salmon:[250,128,114],sandybrown:[244,164,96],seagreen:[46,139,87],seashell:[255,245,238],sienna:[160,82,45],silver:[192,192,192],skyblue:[135,206,235],slateblue:[106,90,205],slategray:[112,128,144],slategrey:[112,128,144],snow:[255,250,250],springgreen:[0,255,127],steelblue:[70,130,180],tan:[210,180,140],teal:[0,128,128],thistle:[216,191,216],tomato:[255,99,71],turquoise:[64,224,208],violet:[238,130,238],wheat:[245,222,179],white:[255,255,255],whitesmoke:[245,245,245],yellow:[255,255,0],yellowgreen:[154,205,50]};function luminance(t){const[n,_,o]=t.map((t=>t<=.03928?t/12.92:Math.pow((t+.055)/1.055,2.4)));return.2126*n+.7152*_+.0722*o}function contrast_ratio_wcag_2_1(t,n){const _=luminance(t),o=luminance(n);return(Math.max(_,o)+.05)/(Math.min(_,o)+.05)}export{HSL_to_XYZ_D50,HWB_to_XYZ_D50,LCH_to_XYZ_D50,Lab_to_XYZ_D50,OKLCH_to_OKLab,OKLCH_to_XYZ_D50,OKLab_to_OKLCH,OKLab_to_XYZ,OKLab_to_XYZ_D50,P3_to_XYZ_D50,ProPhoto_RGB_to_XYZ_D50,XYZ_D50_to_HSL,XYZ_D50_to_HWB,XYZ_D50_to_LCH,XYZ_D50_to_Lab,XYZ_D50_to_OKLCH,XYZ_D50_to_OKLab,XYZ_D50_to_P3,XYZ_D50_to_ProPhoto,XYZ_D50_to_XYZ_D50,XYZ_D50_to_XYZ_D65,XYZ_D50_to_a98_RGB,XYZ_D50_to_lin_sRGB,XYZ_D50_to_rec_2020,XYZ_D50_to_sRGB,XYZ_D65_to_XYZ_D50,XYZ_to_OKLab,XYZ_to_lin_P3,XYZ_to_lin_sRGB,a98_RGB_to_XYZ_D50,clip,contrast_ratio_wcag_2_1,gam_P3,gam_sRGB,inGamut,lin_P3,lin_P3_to_XYZ,lin_sRGB,lin_sRGB_to_XYZ,lin_sRGB_to_XYZ_D50,mapGamut,mapGamutRayTrace,p as namedColors,rec_2020_to_XYZ_D50,sRGB_to_XYZ_D50};
+ */function mapGamutRayTrace(t,n,_){const o=t[0],e=t[2];let a=n(t);const r=n([o,0,e]);for(let t=0;t<4;t++){if(t>0){const t=_(a);t[0]=o,t[2]=e,a=n(t)}const l=rayTraceBox(r,a);if(!l)break;a=l}return clip(a)}function rayTraceBox(t,n){let _=1/0,o=-1/0;const e=[0,0,0];for(let a=0;a<3;a++){const r=t[a],l=n[a]-r;e[a]=l;const i=0,c=1;if(l){const t=1/l,n=(i-r)*t,e=(c-r)*t;o=Math.max(Math.min(n,e),o),_=Math.min(Math.max(n,e),_)}else if(rc)return!1}return!(o>_||_<0)&&(o<0&&(o=_),!!isFinite(o)&&[t[0]+e[0]*o,t[1]+e[1]*o,t[2]+e[2]*o])}const R={aliceblue:[240,248,255],antiquewhite:[250,235,215],aqua:[0,255,255],aquamarine:[127,255,212],azure:[240,255,255],beige:[245,245,220],bisque:[255,228,196],black:[0,0,0],blanchedalmond:[255,235,205],blue:[0,0,255],blueviolet:[138,43,226],brown:[165,42,42],burlywood:[222,184,135],cadetblue:[95,158,160],chartreuse:[127,255,0],chocolate:[210,105,30],coral:[255,127,80],cornflowerblue:[100,149,237],cornsilk:[255,248,220],crimson:[220,20,60],cyan:[0,255,255],darkblue:[0,0,139],darkcyan:[0,139,139],darkgoldenrod:[184,134,11],darkgray:[169,169,169],darkgreen:[0,100,0],darkgrey:[169,169,169],darkkhaki:[189,183,107],darkmagenta:[139,0,139],darkolivegreen:[85,107,47],darkorange:[255,140,0],darkorchid:[153,50,204],darkred:[139,0,0],darksalmon:[233,150,122],darkseagreen:[143,188,143],darkslateblue:[72,61,139],darkslategray:[47,79,79],darkslategrey:[47,79,79],darkturquoise:[0,206,209],darkviolet:[148,0,211],deeppink:[255,20,147],deepskyblue:[0,191,255],dimgray:[105,105,105],dimgrey:[105,105,105],dodgerblue:[30,144,255],firebrick:[178,34,34],floralwhite:[255,250,240],forestgreen:[34,139,34],fuchsia:[255,0,255],gainsboro:[220,220,220],ghostwhite:[248,248,255],gold:[255,215,0],goldenrod:[218,165,32],gray:[128,128,128],green:[0,128,0],greenyellow:[173,255,47],grey:[128,128,128],honeydew:[240,255,240],hotpink:[255,105,180],indianred:[205,92,92],indigo:[75,0,130],ivory:[255,255,240],khaki:[240,230,140],lavender:[230,230,250],lavenderblush:[255,240,245],lawngreen:[124,252,0],lemonchiffon:[255,250,205],lightblue:[173,216,230],lightcoral:[240,128,128],lightcyan:[224,255,255],lightgoldenrodyellow:[250,250,210],lightgray:[211,211,211],lightgreen:[144,238,144],lightgrey:[211,211,211],lightpink:[255,182,193],lightsalmon:[255,160,122],lightseagreen:[32,178,170],lightskyblue:[135,206,250],lightslategray:[119,136,153],lightslategrey:[119,136,153],lightsteelblue:[176,196,222],lightyellow:[255,255,224],lime:[0,255,0],limegreen:[50,205,50],linen:[250,240,230],magenta:[255,0,255],maroon:[128,0,0],mediumaquamarine:[102,205,170],mediumblue:[0,0,205],mediumorchid:[186,85,211],mediumpurple:[147,112,219],mediumseagreen:[60,179,113],mediumslateblue:[123,104,238],mediumspringgreen:[0,250,154],mediumturquoise:[72,209,204],mediumvioletred:[199,21,133],midnightblue:[25,25,112],mintcream:[245,255,250],mistyrose:[255,228,225],moccasin:[255,228,181],navajowhite:[255,222,173],navy:[0,0,128],oldlace:[253,245,230],olive:[128,128,0],olivedrab:[107,142,35],orange:[255,165,0],orangered:[255,69,0],orchid:[218,112,214],palegoldenrod:[238,232,170],palegreen:[152,251,152],paleturquoise:[175,238,238],palevioletred:[219,112,147],papayawhip:[255,239,213],peachpuff:[255,218,185],peru:[205,133,63],pink:[255,192,203],plum:[221,160,221],powderblue:[176,224,230],purple:[128,0,128],rebeccapurple:[102,51,153],red:[255,0,0],rosybrown:[188,143,143],royalblue:[65,105,225],saddlebrown:[139,69,19],salmon:[250,128,114],sandybrown:[244,164,96],seagreen:[46,139,87],seashell:[255,245,238],sienna:[160,82,45],silver:[192,192,192],skyblue:[135,206,235],slateblue:[106,90,205],slategray:[112,128,144],slategrey:[112,128,144],snow:[255,250,250],springgreen:[0,255,127],steelblue:[70,130,180],tan:[210,180,140],teal:[0,128,128],thistle:[216,191,216],tomato:[255,99,71],turquoise:[64,224,208],violet:[238,130,238],wheat:[245,222,179],white:[255,255,255],whitesmoke:[245,245,245],yellow:[255,255,0],yellowgreen:[154,205,50]};function luminance(t){const[n,_,o]=t.map((t=>t<=.03928?t/12.92:Math.pow((t+.055)/1.055,2.4)));return.2126*n+.7152*_+.0722*o}function contrast_ratio_wcag_2_1(t,n){const _=luminance(t),o=luminance(n);return(Math.max(_,o)+.05)/(Math.min(_,o)+.05)}export{HSL_to_XYZ_D50,HWB_to_XYZ_D50,LCH_to_XYZ_D50,Lab_to_XYZ_D50,OKLCH_to_OKLab,OKLCH_to_XYZ_D50,OKLab_to_OKLCH,OKLab_to_XYZ,OKLab_to_XYZ_D50,P3_to_XYZ_D50,ProPhoto_RGB_to_XYZ_D50,XYZ_D50_to_HSL,XYZ_D50_to_HWB,XYZ_D50_to_LCH,XYZ_D50_to_Lab,XYZ_D50_to_OKLCH,XYZ_D50_to_OKLab,XYZ_D50_to_P3,XYZ_D50_to_ProPhoto,XYZ_D50_to_XYZ_D50,XYZ_D50_to_XYZ_D65,XYZ_D50_to_a98_RGB,XYZ_D50_to_lin_sRGB,XYZ_D50_to_rec_2020,XYZ_D50_to_sRGB,XYZ_D65_to_XYZ_D50,XYZ_to_OKLab,XYZ_to_lin_P3,XYZ_to_lin_sRGB,a98_RGB_to_XYZ_D50,clip,contrast_ratio_wcag_2_1,gam_P3,gam_sRGB,inGamut,lin_P3,lin_P3_to_XYZ,lin_sRGB,lin_sRGB_to_XYZ,lin_sRGB_to_XYZ_D50,mapGamut,mapGamutRayTrace,R as namedColors,rec_2020_to_XYZ_D50,sRGB_to_XYZ_D50};
diff --git a/packages/color-helpers/package.json b/packages/color-helpers/package.json
index eef169629..2b32b69a5 100644
--- a/packages/color-helpers/package.json
+++ b/packages/color-helpers/package.json
@@ -25,7 +25,7 @@
}
],
"engines": {
- "node": "^14 || ^16 || >=18"
+ "node": ">=18"
},
"type": "module",
"main": "dist/index.cjs",
diff --git a/packages/color-helpers/scripts/check-changes.mjs b/packages/color-helpers/scripts/check-changes.mjs
index 4e0db5e4b..6a8caaa50 100644
--- a/packages/color-helpers/scripts/check-changes.mjs
+++ b/packages/color-helpers/scripts/check-changes.mjs
@@ -1,7 +1,7 @@
-import crypto from 'crypto';
-import path from 'path';
-import { URL } from 'url';
-import fs from 'fs/promises';
+import crypto from 'node:crypto';
+import path from 'node:path';
+import { URL } from 'node:url';
+import fs from 'node:fs/promises';
const __dirname = new URL('.', import.meta.url).pathname;
const hashesPath = path.resolve(__dirname, './hashes.json');
diff --git a/packages/color-helpers/src/calculations/map-gamut-ray-trace.ts b/packages/color-helpers/src/calculations/map-gamut-ray-trace.ts
index d6ee435b9..8bb443094 100644
--- a/packages/color-helpers/src/calculations/map-gamut-ray-trace.ts
+++ b/packages/color-helpers/src/calculations/map-gamut-ray-trace.ts
@@ -44,14 +44,14 @@ export function mapGamutRayTrace(
}
// 4.2 Perform a raytrace to find the intersection of the line between the achromatic and the current color
- const intersection = rayTraceBox(achromatic, linear.slice() as Color);
+ const intersection = rayTraceBox(achromatic, linear);
// 4.3 If no intersection is found, we are already in gamut
if (!intersection) {
break;
}
// 4.4 Assign the intersection to the current color
- linear = intersection.slice() as Color;
+ linear = intersection;
}
// 5. Clip the result to account for floating point errors
@@ -61,12 +61,16 @@ export function mapGamutRayTrace(
function rayTraceBox(start: Color, end: Color): Color | false {
let tfar = Infinity;
let tnear = -Infinity;
- const direction = [];
+
+ const direction = [0, 0, 0];
+
for (let i = 0; i < 3; i++) {
const a = start[i];
const b = end[i];
const d = b - a;
- direction.push(d);
+
+ direction[i] = d;
+
const bn = 0;
const bx = 1;
@@ -94,8 +98,8 @@ function rayTraceBox(start: Color, end: Color): Color | false {
}
return [
- start[0] + direction[0] * tnear,
- start[1] + direction[1] * tnear,
- start[2] + direction[2] * tnear,
+ start[0] + (direction[0] * tnear),
+ start[1] + (direction[1] * tnear),
+ start[2] + (direction[2] * tnear),
];
}
diff --git a/packages/color-helpers/src/calculations/multiply-matrices.ts b/packages/color-helpers/src/calculations/multiply-matrices.ts
index b63a1437b..ed6d0da51 100644
--- a/packages/color-helpers/src/calculations/multiply-matrices.ts
+++ b/packages/color-helpers/src/calculations/multiply-matrices.ts
@@ -1,4 +1,4 @@
-import { Color } from '../types/color';
+import type { Color } from '../types/color';
export type Matrix = [
number, number, number,
diff --git a/packages/color-helpers/src/conversions/d50-to-d65.ts b/packages/color-helpers/src/conversions/d50-to-d65.ts
index 91da0a717..2cc65e127 100644
--- a/packages/color-helpers/src/conversions/d50-to-d65.ts
+++ b/packages/color-helpers/src/conversions/d50-to-d65.ts
@@ -1,5 +1,6 @@
import type { Color } from '../types/color';
-import { Matrix, multiplyMatrices } from '../calculations/multiply-matrices';
+import type { Matrix} from '../calculations/multiply-matrices';
+import { multiplyMatrices } from '../calculations/multiply-matrices';
const M: Matrix = [
0.955473421488075, -0.02309845494876471, 0.06325924320057072,
diff --git a/packages/color-helpers/src/conversions/d65-to-d50.ts b/packages/color-helpers/src/conversions/d65-to-d50.ts
index f4a914814..df3f9d67d 100644
--- a/packages/color-helpers/src/conversions/d65-to-d50.ts
+++ b/packages/color-helpers/src/conversions/d65-to-d50.ts
@@ -1,5 +1,6 @@
import type { Color } from '../types/color';
-import { Matrix, multiplyMatrices } from '../calculations/multiply-matrices';
+import type { Matrix} from '../calculations/multiply-matrices';
+import { multiplyMatrices } from '../calculations/multiply-matrices';
const M: Matrix = [
1.0479297925449969, 0.022946870601609652, -0.05019226628920524,
diff --git a/packages/color-helpers/src/conversions/gam-2020.ts b/packages/color-helpers/src/conversions/gam-2020.ts
index b896c5dd0..c06d78747 100644
--- a/packages/color-helpers/src/conversions/gam-2020.ts
+++ b/packages/color-helpers/src/conversions/gam-2020.ts
@@ -8,17 +8,23 @@ import type { Color } from '../types/color';
* @copyright This software or document includes material copied from or derived from https://github.com/w3c/csswg-drafts/blob/main/css-color-4/conversions.js. Copyright © 2022 W3C® (MIT, ERCIM, Keio, Beihang).
*/
export function gam_2020(RGB: Color): Color {
- const α = 1.09929682680944;
- const β = 0.018053968510807;
+ return [
+ gam_2020_channel(RGB[0]),
+ gam_2020_channel(RGB[1]),
+ gam_2020_channel(RGB[2]),
+ ]
+}
+
+const α = 1.09929682680944;
+const β = 0.018053968510807;
- return RGB.map(function (val) {
- const sign = val < 0 ? -1 : 1;
- const abs = Math.abs(val);
+function gam_2020_channel(val: number): number {
+ const sign = val < 0 ? -1 : 1;
+ const abs = Math.abs(val);
- if (abs > β) {
- return sign * (α * Math.pow(abs, 0.45) - (α - 1));
- }
+ if (abs > β) {
+ return sign * (α * Math.pow(abs, 0.45) - (α - 1));
+ }
- return 4.5 * val;
- }) as Color;
+ return 4.5 * val;
}
diff --git a/packages/color-helpers/src/conversions/gam-a98rgb.ts b/packages/color-helpers/src/conversions/gam-a98rgb.ts
index 76acfb1df..d97ce5915 100644
--- a/packages/color-helpers/src/conversions/gam-a98rgb.ts
+++ b/packages/color-helpers/src/conversions/gam-a98rgb.ts
@@ -8,10 +8,16 @@ import type { Color } from '../types/color';
* @copyright This software or document includes material copied from or derived from https://github.com/w3c/csswg-drafts/blob/main/css-color-4/conversions.js. Copyright © 2022 W3C® (MIT, ERCIM, Keio, Beihang).
*/
export function gam_a98rgb(RGB: Color): Color {
- return RGB.map(function (val) {
- const sign = val < 0 ? -1 : 1;
- const abs = Math.abs(val);
+ return [
+ gam_a98rgb_channel(RGB[0]),
+ gam_a98rgb_channel(RGB[1]),
+ gam_a98rgb_channel(RGB[2]),
+ ];
+}
+
+function gam_a98rgb_channel(val: number): number {
+ const sign = val < 0 ? -1 : 1;
+ const abs = Math.abs(val);
- return sign * Math.pow(abs, 256 / 563);
- }) as Color;
+ return sign * Math.pow(abs, 256 / 563);
}
diff --git a/packages/color-helpers/src/conversions/gam-pro-photo.ts b/packages/color-helpers/src/conversions/gam-pro-photo.ts
index cf0329f5f..331a83578 100644
--- a/packages/color-helpers/src/conversions/gam-pro-photo.ts
+++ b/packages/color-helpers/src/conversions/gam-pro-photo.ts
@@ -10,15 +10,23 @@ import type { Color } from '../types/color';
*/
export function gam_ProPhoto(RGB: Color): Color {
// TODO for negative values, extend linear portion on reflection of axis, then add pow below that
- const Et = 1 / 512;
- return RGB.map(function (val) {
- const sign = val < 0 ? -1 : 1;
- const abs = Math.abs(val);
- if (abs >= Et) {
- return sign * Math.pow(abs, 1 / 1.8);
- }
+ return [
+ gam_ProPhoto_channel(RGB[0]),
+ gam_ProPhoto_channel(RGB[1]),
+ gam_ProPhoto_channel(RGB[2]),
+ ];
+}
+
+const Et = 1 / 512;
+
+function gam_ProPhoto_channel(val: number): number {
+ const sign = val < 0 ? -1 : 1;
+ const abs = Math.abs(val);
+
+ if (abs >= Et) {
+ return sign * Math.pow(abs, 1 / 1.8);
+ }
- return 16 * val;
- }) as Color;
+ return 16 * val;
}
diff --git a/packages/color-helpers/src/conversions/gam-srgb.ts b/packages/color-helpers/src/conversions/gam-srgb.ts
index 68d6261d5..37daf00b8 100644
--- a/packages/color-helpers/src/conversions/gam-srgb.ts
+++ b/packages/color-helpers/src/conversions/gam-srgb.ts
@@ -11,14 +11,20 @@ import type { Color } from '../types/color';
* @see https://en.wikipedia.org/wiki/SRGB
*/
export function gam_sRGB(RGB: Color): Color {
- return RGB.map(function (val) {
- const sign = val < 0 ? -1 : 1;
- const abs = Math.abs(val);
+ return [
+ gam_sRGB_channel(RGB[0]),
+ gam_sRGB_channel(RGB[1]),
+ gam_sRGB_channel(RGB[2]),
+ ]
+}
+
+function gam_sRGB_channel(val: number): number {
+ const sign = val < 0 ? -1 : 1;
+ const abs = Math.abs(val);
- if (abs > 0.0031308) {
- return sign * (1.055 * Math.pow(abs, 1 / 2.4) - 0.055);
- }
+ if (abs > 0.0031308) {
+ return sign * (1.055 * Math.pow(abs, 1 / 2.4) - 0.055);
+ }
- return 12.92 * val;
- }) as Color;
+ return 12.92 * val;
}
diff --git a/packages/color-helpers/src/conversions/hsl-to-srgb.ts b/packages/color-helpers/src/conversions/hsl-to-srgb.ts
index 229deb5e4..07a30eca6 100644
--- a/packages/color-helpers/src/conversions/hsl-to-srgb.ts
+++ b/packages/color-helpers/src/conversions/hsl-to-srgb.ts
@@ -11,24 +11,23 @@ import type { Color } from '../types/color';
* @see https://github.com/w3c/csswg-drafts/blob/main/css-color-4/hslToRgb.js
*/
export function HSL_to_sRGB(HSL: Color): Color {
- let hue = HSL[0];
- let sat = HSL[1];
- let light = HSL[2];
-
- hue = hue % 360;
+ let hue = HSL[0] % 360;
+ const sat = HSL[1] / 100;
+ const light = HSL[2] / 100;
if (hue < 0) {
hue = hue + 360;
}
- sat = sat / 100;
- light = light / 100;
-
- function f(n: number): number {
- const k = (n + hue / 30) % 12;
- const a = sat * Math.min(light, 1 - light);
- return light - a * Math.max(-1, Math.min(k - 3, 9 - k, 1));
- }
+ return [
+ HSL_to_sRGB_channel(0, hue, sat, light),
+ HSL_to_sRGB_channel(8, hue, sat, light),
+ HSL_to_sRGB_channel(4, hue, sat, light)
+ ];
+}
- return [f(0), f(8), f(4)];
+function HSL_to_sRGB_channel(n: number, hue: number, sat: number, light: number): number {
+ const k = (n + hue / 30) % 12;
+ const a = sat * Math.min(light, 1 - light);
+ return light - a * Math.max(-1, Math.min(k - 3, 9 - k, 1));
}
diff --git a/packages/color-helpers/src/conversions/hwb-to-srgb.ts b/packages/color-helpers/src/conversions/hwb-to-srgb.ts
index 01194e526..2fff689e6 100644
--- a/packages/color-helpers/src/conversions/hwb-to-srgb.ts
+++ b/packages/color-helpers/src/conversions/hwb-to-srgb.ts
@@ -13,21 +13,20 @@ import { HSL_to_sRGB } from './hsl-to-srgb';
*/
export function HWB_to_sRGB(HWB: Color): Color {
const hue = HWB[0];
- let white = HWB[1];
- let black = HWB[2];
+ const white = HWB[1] / 100;
+ const black = HWB[2] / 100;
- white /= 100;
- black /= 100;
if (white + black >= 1) {
const gray = white / (white + black);
return [gray, gray, gray];
}
const rgb = HSL_to_sRGB([hue, 100, 50]);
- for (let i = 0; i < 3; i++) {
- rgb[i] *= (1 - white - black);
- rgb[i] += white;
- }
+ const l = (1 - white - black);
- return rgb;
+ return [
+ (rgb[0] * l) + white,
+ (rgb[1] * l) + white,
+ (rgb[2] * l) + white,
+ ]
}
diff --git a/packages/color-helpers/src/conversions/lab-to-xyz.ts b/packages/color-helpers/src/conversions/lab-to-xyz.ts
index 13b584979..5cbd75e42 100644
--- a/packages/color-helpers/src/conversions/lab-to-xyz.ts
+++ b/packages/color-helpers/src/conversions/lab-to-xyz.ts
@@ -10,20 +10,16 @@ import { D50 } from '../conversions/constants';
export function Lab_to_XYZ(Lab: Color): Color {
const κ = 24389 / 27; // 29^3/3^3
const ε = 216 / 24389; // 6^3/29^3
- const f = [];
// compute f, starting with the luminance-related term
- f[1] = (Lab[0] + 16) / 116;
- f[0] = Lab[1] / 500 + f[1];
- f[2] = f[1] - Lab[2] / 200;
+ const f1 = (Lab[0] + 16) / 116;
+ const f0 = Lab[1] / 500 + f1;
+ const f2 = f1 - Lab[2] / 200;
// compute xyz
- const xyz = [
- Math.pow(f[0], 3) > ε ? Math.pow(f[0], 3) : (116 * f[0] - 16) / κ,
- Lab[0] > κ * ε ? Math.pow((Lab[0] + 16) / 116, 3) : Lab[0] / κ,
- Math.pow(f[2], 3) > ε ? Math.pow(f[2], 3) : (116 * f[2] - 16) / κ,
+ return [
+ (Math.pow(f0, 3) > ε ? Math.pow(f0, 3) : (116 * f0 - 16) / κ) * D50[0],
+ (Lab[0] > κ * ε ? Math.pow((Lab[0] + 16) / 116, 3) : Lab[0] / κ) * D50[1],
+ (Math.pow(f2, 3) > ε ? Math.pow(f2, 3) : (116 * f2 - 16) / κ) * D50[2],
];
-
- // Compute XYZ by scaling xyz by reference white
- return xyz.map((value, i) => value * D50[i]) as Color;
}
diff --git a/packages/color-helpers/src/conversions/lch-to-lab.ts b/packages/color-helpers/src/conversions/lch-to-lab.ts
index 4f98b7011..c2154682a 100644
--- a/packages/color-helpers/src/conversions/lch-to-lab.ts
+++ b/packages/color-helpers/src/conversions/lch-to-lab.ts
@@ -5,10 +5,12 @@ import type { Color } from '../types/color';
* @copyright This software or document includes material copied from or derived from https://github.com/w3c/csswg-drafts/blob/main/css-color-4/conversions.js. Copyright © 2022 W3C® (MIT, ERCIM, Keio, Beihang).
*/
export function LCH_to_Lab(LCH: Color): Color {
+ const h = LCH[2] * Math.PI / 180;
+
// Convert from polar form
return [
LCH[0], // L is still L
- LCH[1] * Math.cos(LCH[2] * Math.PI / 180), // a
- LCH[1] * Math.sin(LCH[2] * Math.PI / 180), // b
+ LCH[1] * Math.cos(h), // a
+ LCH[1] * Math.sin(h), // b
];
}
diff --git a/packages/color-helpers/src/conversions/lin-2020-to-xyz.ts b/packages/color-helpers/src/conversions/lin-2020-to-xyz.ts
index fdbba96e4..eadaa7cab 100644
--- a/packages/color-helpers/src/conversions/lin-2020-to-xyz.ts
+++ b/packages/color-helpers/src/conversions/lin-2020-to-xyz.ts
@@ -1,5 +1,6 @@
import type { Color } from '../types/color';
-import { Matrix, multiplyMatrices } from '../calculations/multiply-matrices';
+import type { Matrix} from '../calculations/multiply-matrices';
+import { multiplyMatrices } from '../calculations/multiply-matrices';
const M: Matrix = [
63426534 / 99577255, 20160776 / 139408157, 47086771 / 278816314,
diff --git a/packages/color-helpers/src/conversions/lin-2020.ts b/packages/color-helpers/src/conversions/lin-2020.ts
index 6d97b5b8f..853dfcb26 100644
--- a/packages/color-helpers/src/conversions/lin-2020.ts
+++ b/packages/color-helpers/src/conversions/lin-2020.ts
@@ -9,17 +9,23 @@ import type { Color } from '../types/color';
* @copyright This software or document includes material copied from or derived from https://github.com/w3c/csswg-drafts/blob/main/css-color-4/conversions.js. Copyright © 2022 W3C® (MIT, ERCIM, Keio, Beihang).
*/
export function lin_2020(RGB: Color): Color {
- const α = 1.09929682680944;
- const β = 0.018053968510807;
+ return [
+ lin_2020_channel(RGB[0]),
+ lin_2020_channel(RGB[1]),
+ lin_2020_channel(RGB[2]),
+ ]
+}
+
+const α = 1.09929682680944;
+const β = 0.018053968510807;
- return RGB.map(function (val) {
- const sign = val < 0 ? -1 : 1;
- const abs = Math.abs(val);
+function lin_2020_channel(val: number): number {
+ const sign = val < 0 ? -1 : 1;
+ const abs = Math.abs(val);
- if (abs < β * 4.5) {
- return val / 4.5;
- }
+ if (abs < β * 4.5) {
+ return val / 4.5;
+ }
- return sign * (Math.pow((abs + α - 1) / α, 1 / 0.45));
- }) as Color;
+ return sign * (Math.pow((abs + α - 1) / α, 1 / 0.45));
}
diff --git a/packages/color-helpers/src/conversions/lin-a98rgb-to-xyz.ts b/packages/color-helpers/src/conversions/lin-a98rgb-to-xyz.ts
index 9cb09fbe6..7afa21526 100644
--- a/packages/color-helpers/src/conversions/lin-a98rgb-to-xyz.ts
+++ b/packages/color-helpers/src/conversions/lin-a98rgb-to-xyz.ts
@@ -1,5 +1,6 @@
import type { Color } from '../types/color';
-import { Matrix, multiplyMatrices } from '../calculations/multiply-matrices';
+import type { Matrix} from '../calculations/multiply-matrices';
+import { multiplyMatrices } from '../calculations/multiply-matrices';
const M: Matrix = [
573536 / 994567, 263643 / 1420810, 187206 / 994567,
diff --git a/packages/color-helpers/src/conversions/lin-a98rgb.ts b/packages/color-helpers/src/conversions/lin-a98rgb.ts
index c19a5a4c8..c0cdbe9f9 100644
--- a/packages/color-helpers/src/conversions/lin-a98rgb.ts
+++ b/packages/color-helpers/src/conversions/lin-a98rgb.ts
@@ -8,10 +8,16 @@ import type { Color } from '../types/color';
* @copyright This software or document includes material copied from or derived from https://github.com/w3c/csswg-drafts/blob/main/css-color-4/conversions.js. Copyright © 2022 W3C® (MIT, ERCIM, Keio, Beihang).
*/
export function lin_a98rgb(RGB: Color): Color {
- return RGB.map(function (val) {
- const sign = val < 0 ? -1 : 1;
- const abs = Math.abs(val);
+ return [
+ lin_a98rgb_channel(RGB[0]),
+ lin_a98rgb_channel(RGB[1]),
+ lin_a98rgb_channel(RGB[2]),
+ ];
+}
+
+function lin_a98rgb_channel(val: number): number {
+ const sign = val < 0 ? -1 : 1;
+ const abs = Math.abs(val);
- return sign * Math.pow(abs, 563 / 256);
- }) as Color;
+ return sign * Math.pow(abs, 563 / 256);
}
diff --git a/packages/color-helpers/src/conversions/lin-p3-to-xyz.ts b/packages/color-helpers/src/conversions/lin-p3-to-xyz.ts
index 03c5b3b39..2460051af 100644
--- a/packages/color-helpers/src/conversions/lin-p3-to-xyz.ts
+++ b/packages/color-helpers/src/conversions/lin-p3-to-xyz.ts
@@ -1,5 +1,6 @@
import type { Color } from '../types/color';
-import { Matrix, multiplyMatrices } from '../calculations/multiply-matrices';
+import type { Matrix} from '../calculations/multiply-matrices';
+import { multiplyMatrices } from '../calculations/multiply-matrices';
const M: Matrix = [
608311 / 1250200, 189793 / 714400, 198249 / 1000160,
diff --git a/packages/color-helpers/src/conversions/lin-pro-photo-to-xyz.ts b/packages/color-helpers/src/conversions/lin-pro-photo-to-xyz.ts
index af17d5af0..1b78992db 100644
--- a/packages/color-helpers/src/conversions/lin-pro-photo-to-xyz.ts
+++ b/packages/color-helpers/src/conversions/lin-pro-photo-to-xyz.ts
@@ -1,7 +1,8 @@
/* eslint-disable no-loss-of-precision */
import type { Color } from '../types/color';
-import { Matrix, multiplyMatrices } from '../calculations/multiply-matrices';
+import type { Matrix} from '../calculations/multiply-matrices';
+import { multiplyMatrices } from '../calculations/multiply-matrices';
const M: Matrix = [
0.79776664490064230, 0.13518129740053308, 0.03134773412839220,
diff --git a/packages/color-helpers/src/conversions/lin-pro-photo.ts b/packages/color-helpers/src/conversions/lin-pro-photo.ts
index 9ecf05d1f..c25670d38 100644
--- a/packages/color-helpers/src/conversions/lin-pro-photo.ts
+++ b/packages/color-helpers/src/conversions/lin-pro-photo.ts
@@ -9,15 +9,22 @@ import type { Color } from '../types/color';
* @copyright This software or document includes material copied from or derived from https://github.com/w3c/csswg-drafts/blob/main/css-color-4/conversions.js. Copyright © 2022 W3C® (MIT, ERCIM, Keio, Beihang).
*/
export function lin_ProPhoto(RGB: Color): Color {
- const Et2 = 16 / 512;
- return RGB.map(function (val) {
- const sign = val < 0 ? -1 : 1;
- const abs = Math.abs(val);
+ return [
+ lin_ProPhoto_channel(RGB[0]),
+ lin_ProPhoto_channel(RGB[1]),
+ lin_ProPhoto_channel(RGB[2]),
+ ];
+}
+
+const Et2 = 16 / 512;
+
+function lin_ProPhoto_channel(val: number): number {
+ const sign = val < 0 ? -1 : 1;
+ const abs = Math.abs(val);
- if (abs <= Et2) {
- return val / 16;
- }
+ if (abs <= Et2) {
+ return val / 16;
+ }
- return sign * Math.pow(abs, 1.8);
- }) as Color;
+ return sign * Math.pow(abs, 1.8);
}
diff --git a/packages/color-helpers/src/conversions/lin-srgb-to-xyz.ts b/packages/color-helpers/src/conversions/lin-srgb-to-xyz.ts
index 1a91e9a55..df71cb9ef 100644
--- a/packages/color-helpers/src/conversions/lin-srgb-to-xyz.ts
+++ b/packages/color-helpers/src/conversions/lin-srgb-to-xyz.ts
@@ -1,5 +1,6 @@
import type { Color } from '../types/color';
-import { Matrix, multiplyMatrices } from '../calculations/multiply-matrices';
+import type { Matrix} from '../calculations/multiply-matrices';
+import { multiplyMatrices } from '../calculations/multiply-matrices';
const M: Matrix = [
506752 / 1228815, 87881 / 245763, 12673 / 70218,
diff --git a/packages/color-helpers/src/conversions/lin-srgb.ts b/packages/color-helpers/src/conversions/lin-srgb.ts
index ccb5d5f44..bc57b0f29 100644
--- a/packages/color-helpers/src/conversions/lin-srgb.ts
+++ b/packages/color-helpers/src/conversions/lin-srgb.ts
@@ -12,14 +12,20 @@ import type { Color } from '../types/color';
* @see https://en.wikipedia.org/wiki/SRGB
*/
export function lin_sRGB(RGB: Color): Color {
- return RGB.map(function (val) {
- const sign = val < 0 ? -1 : 1;
- const abs = Math.abs(val);
+ return [
+ lin_sRGB_channel(RGB[0]),
+ lin_sRGB_channel(RGB[1]),
+ lin_sRGB_channel(RGB[2]),
+ ];
+}
+
+function lin_sRGB_channel(val: number): number {
+ const sign = val < 0 ? -1 : 1;
+ const abs = Math.abs(val);
- if (abs <= 0.04045) {
- return val / 12.92;
- }
+ if (abs <= 0.04045) {
+ return val / 12.92;
+ }
- return sign * (Math.pow((abs + 0.055) / 1.055, 2.4));
- }) as Color;
+ return sign * (Math.pow((abs + 0.055) / 1.055, 2.4));
}
diff --git a/packages/color-helpers/src/conversions/oklab-to-xyz.ts b/packages/color-helpers/src/conversions/oklab-to-xyz.ts
index 052d1728f..b6da8e274 100644
--- a/packages/color-helpers/src/conversions/oklab-to-xyz.ts
+++ b/packages/color-helpers/src/conversions/oklab-to-xyz.ts
@@ -1,5 +1,6 @@
import type { Color } from '../types/color';
-import { Matrix, multiplyMatrices } from '../calculations/multiply-matrices';
+import type { Matrix} from '../calculations/multiply-matrices';
+import { multiplyMatrices } from '../calculations/multiply-matrices';
const LMStoXYZ: Matrix = [
1.2268798758459243, -0.5578149944602171, 0.2813910456659647,
diff --git a/packages/color-helpers/src/conversions/oklch-to-oklab.ts b/packages/color-helpers/src/conversions/oklch-to-oklab.ts
index 0d1fb5128..d6e3c6ea9 100644
--- a/packages/color-helpers/src/conversions/oklch-to-oklab.ts
+++ b/packages/color-helpers/src/conversions/oklch-to-oklab.ts
@@ -7,9 +7,11 @@ import type { Color } from '../types/color';
*/
export function OKLCH_to_OKLab(OKLCH: Color): Color {
+ const hue = OKLCH[2] * Math.PI / 180;
+
return [
OKLCH[0], // L is still L
- OKLCH[1] * Math.cos(OKLCH[2] * Math.PI / 180), // a
- OKLCH[1] * Math.sin(OKLCH[2] * Math.PI / 180), // b
+ OKLCH[1] * Math.cos(hue), // a
+ OKLCH[1] * Math.sin(hue), // b
];
}
diff --git a/packages/color-helpers/src/conversions/srgb-to-hsl.ts b/packages/color-helpers/src/conversions/srgb-to-hsl.ts
index 6e3882726..9f64ca846 100644
--- a/packages/color-helpers/src/conversions/srgb-to-hsl.ts
+++ b/packages/color-helpers/src/conversions/srgb-to-hsl.ts
@@ -28,7 +28,9 @@ export function sRGB_to_HSL(RGB: Color): Color {
let sat = 0;
if (Math.round(d * 100_000) !== 0) {
- if (Math.round(light * 100_000) === 0 || Math.round(light * 100_000) === 100_000) {
+ const light_00_000 = Math.round(light * 100_000);
+
+ if (light_00_000 === 0 || light_00_000 === 100_000) {
sat = 0;
} else {
sat = (max - light) / Math.min(light, 1 - light);
@@ -61,5 +63,9 @@ export function sRGB_to_HSL(RGB: Color): Color {
hue -= 360;
}
- return [hue, sat * 100, light * 100];
+ return [
+ hue,
+ sat * 100,
+ light * 100
+ ];
}
diff --git a/packages/color-helpers/src/conversions/xyz-to-lab.ts b/packages/color-helpers/src/conversions/xyz-to-lab.ts
index 531de3946..b343c2130 100644
--- a/packages/color-helpers/src/conversions/xyz-to-lab.ts
+++ b/packages/color-helpers/src/conversions/xyz-to-lab.ts
@@ -9,19 +9,21 @@ import { D50 } from '../conversions/constants';
* @copyright This software or document includes material copied from or derived from https://github.com/w3c/csswg-drafts/blob/main/css-color-4/conversions.js. Copyright © 2022 W3C® (MIT, ERCIM, Keio, Beihang).
*/
export function XYZ_to_Lab(XYZ: Color): Color {
- const ε = 216 / 24389; // 6^3/29^3
- const κ = 24389 / 27; // 29^3/3^3
-
- // compute xyz, which is XYZ scaled relative to reference white
- const xyz = XYZ.map((value, i) => value / D50[i]);
-
- // now compute f
- const f = xyz.map(value => value > ε ? Math.cbrt(value) : (κ * value + 16) / 116);
+ const f0 = compute_f(XYZ[0] / D50[0]);
+ const f1 = compute_f(XYZ[1] / D50[1]);
+ const f2 = compute_f(XYZ[2] / D50[2]);
return [
- (116 * f[1]) - 16, // L
- 500 * (f[0] - f[1]), // a
- 200 * (f[1] - f[2]), // b
+ (116 * f1) - 16, // L
+ 500 * (f0 - f1), // a
+ 200 * (f1 - f2), // b
];
// L in range [0,100]. For use in CSS, add a percent
}
+
+const ε = 216 / 24389; // 6^3/29^3
+const κ = 24389 / 27; // 29^3/3^3
+
+function compute_f(val: number): number {
+ return val > ε ? Math.cbrt(val) : (κ * val + 16) / 116
+}
diff --git a/packages/color-helpers/src/conversions/xyz-to-lin-2020.ts b/packages/color-helpers/src/conversions/xyz-to-lin-2020.ts
index 8267639ef..8e5e3ab87 100644
--- a/packages/color-helpers/src/conversions/xyz-to-lin-2020.ts
+++ b/packages/color-helpers/src/conversions/xyz-to-lin-2020.ts
@@ -1,5 +1,6 @@
import type { Color } from '../types/color';
-import { Matrix, multiplyMatrices } from '../calculations/multiply-matrices';
+import type { Matrix} from '../calculations/multiply-matrices';
+import { multiplyMatrices } from '../calculations/multiply-matrices';
const M: Matrix = [
30757411 / 17917100, -6372589 / 17917100, -4539589 / 17917100,
diff --git a/packages/color-helpers/src/conversions/xyz-to-lin-a98rgb.ts b/packages/color-helpers/src/conversions/xyz-to-lin-a98rgb.ts
index fe583d361..d9aef08c1 100644
--- a/packages/color-helpers/src/conversions/xyz-to-lin-a98rgb.ts
+++ b/packages/color-helpers/src/conversions/xyz-to-lin-a98rgb.ts
@@ -1,5 +1,6 @@
import type { Color } from '../types/color';
-import { Matrix, multiplyMatrices } from '../calculations/multiply-matrices';
+import type { Matrix} from '../calculations/multiply-matrices';
+import { multiplyMatrices } from '../calculations/multiply-matrices';
const M: Matrix = [
1829569 / 896150, -506331 / 896150, -308931 / 896150,
diff --git a/packages/color-helpers/src/conversions/xyz-to-lin-p3.ts b/packages/color-helpers/src/conversions/xyz-to-lin-p3.ts
index af48729d8..2e5156e16 100644
--- a/packages/color-helpers/src/conversions/xyz-to-lin-p3.ts
+++ b/packages/color-helpers/src/conversions/xyz-to-lin-p3.ts
@@ -1,5 +1,6 @@
import type { Color } from '../types/color';
-import { Matrix, multiplyMatrices } from '../calculations/multiply-matrices';
+import type { Matrix} from '../calculations/multiply-matrices';
+import { multiplyMatrices } from '../calculations/multiply-matrices';
const M: Matrix = [
446124 / 178915, -333277 / 357830, -72051 / 178915,
diff --git a/packages/color-helpers/src/conversions/xyz-to-lin-pro-photo.ts b/packages/color-helpers/src/conversions/xyz-to-lin-pro-photo.ts
index 4e3633023..9c467bd6f 100644
--- a/packages/color-helpers/src/conversions/xyz-to-lin-pro-photo.ts
+++ b/packages/color-helpers/src/conversions/xyz-to-lin-pro-photo.ts
@@ -1,7 +1,8 @@
/* eslint-disable no-loss-of-precision */
import type { Color } from '../types/color';
-import { Matrix, multiplyMatrices } from '../calculations/multiply-matrices';
+import type { Matrix} from '../calculations/multiply-matrices';
+import { multiplyMatrices } from '../calculations/multiply-matrices';
const M: Matrix = [
1.34578688164715830, -0.25557208737979464, -0.05110186497554526,
diff --git a/packages/color-helpers/src/conversions/xyz-to-lin-srgb.ts b/packages/color-helpers/src/conversions/xyz-to-lin-srgb.ts
index 582153c26..1e9347d15 100644
--- a/packages/color-helpers/src/conversions/xyz-to-lin-srgb.ts
+++ b/packages/color-helpers/src/conversions/xyz-to-lin-srgb.ts
@@ -1,5 +1,6 @@
import type { Color } from '../types/color';
-import { Matrix, multiplyMatrices } from '../calculations/multiply-matrices';
+import type { Matrix} from '../calculations/multiply-matrices';
+import { multiplyMatrices } from '../calculations/multiply-matrices';
const M: Matrix = [
12831 / 3959, -329 / 214, -1974 / 3959,
diff --git a/packages/color-helpers/src/conversions/xyz-to-oklab.ts b/packages/color-helpers/src/conversions/xyz-to-oklab.ts
index 4ffc03f9e..37fb84bd2 100644
--- a/packages/color-helpers/src/conversions/xyz-to-oklab.ts
+++ b/packages/color-helpers/src/conversions/xyz-to-oklab.ts
@@ -1,5 +1,6 @@
import type { Color } from '../types/color';
-import { Matrix, multiplyMatrices } from '../calculations/multiply-matrices';
+import type { Matrix} from '../calculations/multiply-matrices';
+import { multiplyMatrices } from '../calculations/multiply-matrices';
const XYZtoLMS: Matrix = [
0.8190224379967030, 0.3619062600528904, -0.1288737815209879,
diff --git a/packages/color-helpers/src/utils/clip.ts b/packages/color-helpers/src/utils/clip.ts
index f96c131b6..88bebc585 100644
--- a/packages/color-helpers/src/utils/clip.ts
+++ b/packages/color-helpers/src/utils/clip.ts
@@ -1,13 +1,9 @@
import type { Color } from '../types/color';
export function clip(color: Color): Color {
- return color.map(val => {
- if (val < 0) {
- return 0;
- } else if (val > 1) {
- return 1;
- } else {
- return val;
- }
- }) as Color;
+ return [
+ (color[0] < 0 ? 0 : (color[0] > 1 ? 1 : color[0])),
+ (color[1] < 0 ? 0 : (color[1] > 1 ? 1 : color[1])),
+ (color[2] < 0 ? 0 : (color[2] > 1 ? 1 : color[2]))
+ ]
}
diff --git a/packages/color-helpers/src/utils/in-gamut.ts b/packages/color-helpers/src/utils/in-gamut.ts
index a3f49f99e..cfd8d5d51 100644
--- a/packages/color-helpers/src/utils/in-gamut.ts
+++ b/packages/color-helpers/src/utils/in-gamut.ts
@@ -1,6 +1,5 @@
import type { Color } from '../types/color';
export function inGamut(x: Color): boolean {
- const [xX, xY, xZ] = x;
- return xX >= -0.0001 && xX <= 1.0001 && xY >= -0.0001 && xY <= 1.0001 && xZ >= -0.0001 && xZ <= 1.0001;
+ return x[0] >= -0.0001 && x[0] <= 1.0001 && x[1] >= -0.0001 && x[1] <= 1.0001 && x[2] >= -0.0001 && x[2] <= 1.0001;
}
diff --git a/packages/color-helpers/test/_import.mjs b/packages/color-helpers/test/_import.mjs
index cd1bd0e58..f6a8cb824 100644
--- a/packages/color-helpers/test/_import.mjs
+++ b/packages/color-helpers/test/_import.mjs
@@ -1,4 +1,4 @@
-import assert from 'assert';
+import assert from 'node:assert';
import { clip } from '@csstools/color-helpers';
assert.equal(typeof clip, 'function', 'should export nested libraries');
diff --git a/packages/css-calc/CHANGELOG.md b/packages/css-calc/CHANGELOG.md
index 34ddb08f1..fa8f9ddc6 100644
--- a/packages/css-calc/CHANGELOG.md
+++ b/packages/css-calc/CHANGELOG.md
@@ -1,5 +1,9 @@
# Changes to CSS Calc
+### Unreleased (major)
+
+- Updated: Support for Node v18+ (major).
+
### 1.2.4
_July 6, 2024_
diff --git a/packages/css-calc/dist/index.d.ts b/packages/css-calc/dist/index.d.ts
index 7fe7efb4e..8eabc729b 100644
--- a/packages/css-calc/dist/index.d.ts
+++ b/packages/css-calc/dist/index.d.ts
@@ -1,4 +1,4 @@
-import { ComponentValue } from '@csstools/css-parser-algorithms';
+import type { ComponentValue } from '@csstools/css-parser-algorithms';
import type { TokenDimension } from '@csstools/css-tokenizer';
import type { TokenNumber } from '@csstools/css-tokenizer';
import type { TokenPercentage } from '@csstools/css-tokenizer';
diff --git a/packages/css-calc/package.json b/packages/css-calc/package.json
index 3ed5a115c..b0695cd6f 100644
--- a/packages/css-calc/package.json
+++ b/packages/css-calc/package.json
@@ -25,7 +25,7 @@
}
],
"engines": {
- "node": "^14 || ^16 || >=18"
+ "node": ">=18"
},
"type": "module",
"main": "dist/index.cjs",
diff --git a/packages/css-calc/src/functions/globals-and-constants.ts b/packages/css-calc/src/functions/globals-and-constants.ts
index cad6b965d..3e6b0c03c 100644
--- a/packages/css-calc/src/functions/globals-and-constants.ts
+++ b/packages/css-calc/src/functions/globals-and-constants.ts
@@ -1,6 +1,7 @@
import { NumberType, TokenType, isTokenIdent } from '@csstools/css-tokenizer';
-import { ComponentValue, isTokenNode, TokenNode } from '@csstools/css-parser-algorithms';
-import { Globals } from '../util/globals';
+import type { ComponentValue} from '@csstools/css-parser-algorithms';
+import { isTokenNode, TokenNode } from '@csstools/css-parser-algorithms';
+import type { Globals } from '../util/globals';
import { toLowerCaseAZ } from '../util/to-lower-case-a-z';
export function resolveGlobalsAndConstants(nodes: Array, globals: Globals): Array {
diff --git a/packages/css-calc/src/functions/result-to-calculation.ts b/packages/css-calc/src/functions/result-to-calculation.ts
index 9f28c76fc..1bc51f6e6 100644
--- a/packages/css-calc/src/functions/result-to-calculation.ts
+++ b/packages/css-calc/src/functions/result-to-calculation.ts
@@ -1,6 +1,8 @@
-import { CSSToken, NumberType, TokenType, isTokenDimension, isTokenNumber, isTokenPercentage } from '@csstools/css-tokenizer';
-import { FunctionNode, TokenNode } from '@csstools/css-parser-algorithms';
-import { Calculation } from '../calculation';
+import type { CSSToken} from '@csstools/css-tokenizer';
+import { NumberType, TokenType, isTokenDimension, isTokenNumber, isTokenPercentage } from '@csstools/css-tokenizer';
+import type { FunctionNode} from '@csstools/css-parser-algorithms';
+import { TokenNode } from '@csstools/css-parser-algorithms';
+import type { Calculation } from '../calculation';
import { unary } from '../operation/unary';
export function resultToCalculation(node: FunctionNode, aToken: CSSToken, result: number): Calculation | -1 {
diff --git a/packages/css-calc/src/index.ts b/packages/css-calc/src/index.ts
index 9a5f495e3..b625da774 100644
--- a/packages/css-calc/src/index.ts
+++ b/packages/css-calc/src/index.ts
@@ -1,6 +1,7 @@
export type { conversionOptions, GlobalsWithStrings } from './options';
import type { conversionOptions } from './options';
-import { ComponentValue, isFunctionNode, parseCommaSeparatedListOfComponentValues } from '@csstools/css-parser-algorithms';
+import type { ComponentValue} from '@csstools/css-parser-algorithms';
+import { isFunctionNode, parseCommaSeparatedListOfComponentValues } from '@csstools/css-parser-algorithms';
import { mathFunctions } from './functions/calc';
import { patchCalcResult } from './util/patch-result';
import { replaceComponentValues } from '@csstools/css-parser-algorithms';
diff --git a/packages/css-calc/src/options.ts b/packages/css-calc/src/options.ts
index 6c4ba60ae..ad03bc8c3 100644
--- a/packages/css-calc/src/options.ts
+++ b/packages/css-calc/src/options.ts
@@ -1,4 +1,4 @@
-import { GlobalsWithStrings } from './util/globals';
+import type { GlobalsWithStrings } from './util/globals';
export type { GlobalsWithStrings } from './util/globals';
export type conversionOptions = {
diff --git a/packages/css-calc/src/util/kind-of-number.ts b/packages/css-calc/src/util/kind-of-number.ts
index 15681f0dc..dc35dc105 100644
--- a/packages/css-calc/src/util/kind-of-number.ts
+++ b/packages/css-calc/src/util/kind-of-number.ts
@@ -1,4 +1,5 @@
-import { CSSToken, TokenDimension, TokenNumber, TokenPercentage, isTokenDimension, isTokenNumber, isTokenNumeric } from '@csstools/css-tokenizer';
+import type { CSSToken, TokenDimension, TokenNumber, TokenPercentage} from '@csstools/css-tokenizer';
+import { isTokenDimension, isTokenNumber, isTokenNumeric } from '@csstools/css-tokenizer';
import { toLowerCaseAZ } from './to-lower-case-a-z';
export function isDimensionOrNumber(x: CSSToken): x is TokenDimension | TokenNumber {
diff --git a/packages/css-calc/src/util/patch-result.ts b/packages/css-calc/src/util/patch-result.ts
index ecdc79548..9c4cc15ef 100644
--- a/packages/css-calc/src/util/patch-result.ts
+++ b/packages/css-calc/src/util/patch-result.ts
@@ -1,10 +1,10 @@
import { patchNaN } from './nan';
import { patchInfinity } from './infinity';
import { patchMinusZero } from './minus-zero';
-import { FunctionNode, TokenNode } from '@csstools/css-parser-algorithms';
+import type { FunctionNode, TokenNode } from '@csstools/css-parser-algorithms';
import { patchPrecision } from './precision';
import { patchCanonicalUnit } from './canonical-unit';
-import { conversionOptions } from '../options';
+import type { conversionOptions } from '../options';
export function patchCalcResult(x: TokenNode | FunctionNode | -1, options?: conversionOptions): TokenNode | FunctionNode | -1 {
let y: TokenNode | FunctionNode | -1 = x;
diff --git a/packages/css-calc/test/additional/mod-rem-infinity.mjs b/packages/css-calc/test/additional/mod-rem-infinity.mjs
index 19dc9a0d2..695ccdb69 100644
--- a/packages/css-calc/test/additional/mod-rem-infinity.mjs
+++ b/packages/css-calc/test/additional/mod-rem-infinity.mjs
@@ -1,5 +1,5 @@
import { calc } from '@csstools/css-calc';
-import assert from 'assert';
+import assert from 'node:assert';
assert.strictEqual(
calc('mod(infinity, infinity)'),
diff --git a/packages/css-calc/test/additional/tan-asymptotes.mjs b/packages/css-calc/test/additional/tan-asymptotes.mjs
index f83de7b63..4f53924ae 100644
--- a/packages/css-calc/test/additional/tan-asymptotes.mjs
+++ b/packages/css-calc/test/additional/tan-asymptotes.mjs
@@ -1,5 +1,5 @@
import { calc } from '@csstools/css-calc';
-import assert from 'assert';
+import assert from 'node:assert';
assert.strictEqual(
calc('tan(90deg)'),
diff --git a/packages/css-calc/test/basic/none-in-clamp.mjs b/packages/css-calc/test/basic/none-in-clamp.mjs
index 35056b378..df255ca17 100644
--- a/packages/css-calc/test/basic/none-in-clamp.mjs
+++ b/packages/css-calc/test/basic/none-in-clamp.mjs
@@ -1,5 +1,5 @@
import { calc } from '@csstools/css-calc';
-import assert from 'assert';
+import assert from 'node:assert';
// clamp(none, 10px, 20px)
{
diff --git a/packages/css-calc/test/basic/test.mjs b/packages/css-calc/test/basic/test.mjs
index c678ea965..bdce44812 100644
--- a/packages/css-calc/test/basic/test.mjs
+++ b/packages/css-calc/test/basic/test.mjs
@@ -1,6 +1,6 @@
import { calc } from '@csstools/css-calc';
import { NumberType, TokenType } from '@csstools/css-tokenizer';
-import assert from 'assert';
+import assert from 'node:assert';
assert.strictEqual(
calc('calc(10 * 2)'),
diff --git a/packages/css-calc/test/postcss-calc/issue-117.mjs b/packages/css-calc/test/postcss-calc/issue-117.mjs
index f70d3881c..017129a42 100644
--- a/packages/css-calc/test/postcss-calc/issue-117.mjs
+++ b/packages/css-calc/test/postcss-calc/issue-117.mjs
@@ -1,5 +1,5 @@
import { calc } from '@csstools/css-calc';
-import assert from 'assert';
+import assert from 'node:assert';
assert.strictEqual(
calc('calc(min(max(var(--foo), 0), 100))'),
diff --git a/packages/css-calc/test/postcss-calc/issue-130.mjs b/packages/css-calc/test/postcss-calc/issue-130.mjs
index b0c2db7dd..620d6382f 100644
--- a/packages/css-calc/test/postcss-calc/issue-130.mjs
+++ b/packages/css-calc/test/postcss-calc/issue-130.mjs
@@ -1,5 +1,5 @@
import { calc } from '@csstools/css-calc';
-import assert from 'assert';
+import assert from 'node:assert';
assert.strictEqual(
calc(`calc(
diff --git a/packages/css-calc/test/postcss-calc/issue-132.mjs b/packages/css-calc/test/postcss-calc/issue-132.mjs
index 6e30af15c..fe3452e36 100644
--- a/packages/css-calc/test/postcss-calc/issue-132.mjs
+++ b/packages/css-calc/test/postcss-calc/issue-132.mjs
@@ -1,5 +1,5 @@
import { calc } from '@csstools/css-calc';
-import assert from 'assert';
+import assert from 'node:assert';
assert.strictEqual(
calc('calc(120rpx - 41.7rpx)'),
diff --git a/packages/css-calc/test/postcss-calc/issue-142.mjs b/packages/css-calc/test/postcss-calc/issue-142.mjs
index ab1d706ee..eff1725b3 100644
--- a/packages/css-calc/test/postcss-calc/issue-142.mjs
+++ b/packages/css-calc/test/postcss-calc/issue-142.mjs
@@ -1,5 +1,5 @@
import { calc } from '@csstools/css-calc';
-import assert from 'assert';
+import assert from 'node:assert';
assert.strictEqual(
calc('0 calc(var(--my-var) * -1) 0 0'),
diff --git a/packages/css-calc/test/postcss-calc/issue-144.mjs b/packages/css-calc/test/postcss-calc/issue-144.mjs
index b84edfede..271824d8e 100644
--- a/packages/css-calc/test/postcss-calc/issue-144.mjs
+++ b/packages/css-calc/test/postcss-calc/issue-144.mjs
@@ -1,5 +1,5 @@
import { calc } from '@csstools/css-calc';
-import assert from 'assert';
+import assert from 'node:assert';
assert.strictEqual(
calc('calc(100% / 3)'),
diff --git a/packages/css-calc/test/postcss-calc/issue-77.mjs b/packages/css-calc/test/postcss-calc/issue-77.mjs
index cc6f1d435..b527ea2fc 100644
--- a/packages/css-calc/test/postcss-calc/issue-77.mjs
+++ b/packages/css-calc/test/postcss-calc/issue-77.mjs
@@ -1,5 +1,5 @@
import { calc } from '@csstools/css-calc';
-import assert from 'assert';
+import assert from 'node:assert';
assert.strictEqual(
calc('calc(var(--b, calc(var(--c) * 1)))'),
diff --git a/packages/css-calc/test/postcss-calc/tests.mjs b/packages/css-calc/test/postcss-calc/tests.mjs
index b8b717547..d9f6336e5 100644
--- a/packages/css-calc/test/postcss-calc/tests.mjs
+++ b/packages/css-calc/test/postcss-calc/tests.mjs
@@ -1,5 +1,5 @@
import { calc } from '@csstools/css-calc';
-import assert from 'assert';
+import assert from 'node:assert';
assert.strictEqual(
calc('calc(var(--b, calc(var(--c) * 1)))'),
diff --git a/packages/css-calc/test/wpt/acos-asin-atan-atan2-computed.mjs b/packages/css-calc/test/wpt/acos-asin-atan-atan2-computed.mjs
index 5a1e4a3a4..db8bfeb2c 100644
--- a/packages/css-calc/test/wpt/acos-asin-atan-atan2-computed.mjs
+++ b/packages/css-calc/test/wpt/acos-asin-atan-atan2-computed.mjs
@@ -1,5 +1,5 @@
import { calc } from '@csstools/css-calc';
-import assert from 'assert';
+import assert from 'node:assert';
assert.strictEqual(
calc('acos(1)', { toCanonicalUnits: true }),
diff --git a/packages/css-calc/test/wpt/acos-asin-atan-atan2-serialize.mjs b/packages/css-calc/test/wpt/acos-asin-atan-atan2-serialize.mjs
index a44ac6c13..1c7569d13 100644
--- a/packages/css-calc/test/wpt/acos-asin-atan-atan2-serialize.mjs
+++ b/packages/css-calc/test/wpt/acos-asin-atan-atan2-serialize.mjs
@@ -1,5 +1,5 @@
import { calc } from '@csstools/css-calc';
-import assert from 'assert';
+import assert from 'node:assert';
assert.strictEqual(
calc('acos(1)', { toCanonicalUnits: true }),
diff --git a/packages/css-calc/test/wpt/calc-angle-values.mjs b/packages/css-calc/test/wpt/calc-angle-values.mjs
index fefeab6cb..cd113468a 100644
--- a/packages/css-calc/test/wpt/calc-angle-values.mjs
+++ b/packages/css-calc/test/wpt/calc-angle-values.mjs
@@ -1,5 +1,5 @@
import { calc } from '@csstools/css-calc';
-import assert from 'assert';
+import assert from 'node:assert';
assert.strictEqual(
calc('calc(45deg + 45deg)'),
diff --git a/packages/css-calc/test/wpt/calc-catch-divide-by-0.mjs b/packages/css-calc/test/wpt/calc-catch-divide-by-0.mjs
index 9bfa3ae42..693618245 100644
--- a/packages/css-calc/test/wpt/calc-catch-divide-by-0.mjs
+++ b/packages/css-calc/test/wpt/calc-catch-divide-by-0.mjs
@@ -1,5 +1,5 @@
import { calc } from '@csstools/css-calc';
-import assert from 'assert';
+import assert from 'node:assert';
assert.strictEqual(
calc('calc(100px * 0 / 0)'),
diff --git a/packages/css-calc/test/wpt/calc-in-calc.mjs b/packages/css-calc/test/wpt/calc-in-calc.mjs
index 1417545d4..70d47ac80 100644
--- a/packages/css-calc/test/wpt/calc-in-calc.mjs
+++ b/packages/css-calc/test/wpt/calc-in-calc.mjs
@@ -1,5 +1,5 @@
import { calc } from '@csstools/css-calc';
-import assert from 'assert';
+import assert from 'node:assert';
assert.strictEqual(
calc('calc(calc(100%))'),
diff --git a/packages/css-calc/test/wpt/calc-in-color.mjs b/packages/css-calc/test/wpt/calc-in-color.mjs
index ccbd734f2..48aee1aaf 100644
--- a/packages/css-calc/test/wpt/calc-in-color.mjs
+++ b/packages/css-calc/test/wpt/calc-in-color.mjs
@@ -1,5 +1,5 @@
import { calc } from '@csstools/css-calc';
-import assert from 'assert';
+import assert from 'node:assert';
assert.strictEqual(
calc('rgb(calc(0), calc(255 + 0), calc(140 - 139 - 1))'),
diff --git a/packages/css-calc/test/wpt/calc-nesting-002.mjs b/packages/css-calc/test/wpt/calc-nesting-002.mjs
index 5002024aa..dab9f7a73 100644
--- a/packages/css-calc/test/wpt/calc-nesting-002.mjs
+++ b/packages/css-calc/test/wpt/calc-nesting-002.mjs
@@ -1,5 +1,5 @@
import { calc } from '@csstools/css-calc';
-import assert from 'assert';
+import assert from 'node:assert';
assert.strictEqual(
calc('calc(20px + calc(80px))'),
diff --git a/packages/css-calc/test/wpt/calc-parenthesis-stack.mjs b/packages/css-calc/test/wpt/calc-parenthesis-stack.mjs
index 6c6c89ed6..4eea7c829 100644
--- a/packages/css-calc/test/wpt/calc-parenthesis-stack.mjs
+++ b/packages/css-calc/test/wpt/calc-parenthesis-stack.mjs
@@ -1,5 +1,5 @@
import { calc } from '@csstools/css-calc';
-import assert from 'assert';
+import assert from 'node:assert';
assert.strictEqual(
calc('calc((((((((((((((((((((((((((((((((100%))))))))))))))))))))))))))))))))'),
diff --git a/packages/css-calc/test/wpt/calc-serialization-002.mjs b/packages/css-calc/test/wpt/calc-serialization-002.mjs
index 278c45c8e..8dbb6cdd2 100644
--- a/packages/css-calc/test/wpt/calc-serialization-002.mjs
+++ b/packages/css-calc/test/wpt/calc-serialization-002.mjs
@@ -1,5 +1,5 @@
import { calc } from '@csstools/css-calc';
-import assert from 'assert';
+import assert from 'node:assert';
assert.strictEqual(
calc('calc(5mm + 1in)'),
diff --git a/packages/css-calc/test/wpt/calc-time-values.mjs b/packages/css-calc/test/wpt/calc-time-values.mjs
index 720c5c7b4..943d0fef5 100644
--- a/packages/css-calc/test/wpt/calc-time-values.mjs
+++ b/packages/css-calc/test/wpt/calc-time-values.mjs
@@ -1,5 +1,5 @@
import { calc } from '@csstools/css-calc';
-import assert from 'assert';
+import assert from 'node:assert';
assert.strictEqual(
calc('calc(4s + 1s)'),
diff --git a/packages/css-calc/test/wpt/calc-unit-analysis.mjs b/packages/css-calc/test/wpt/calc-unit-analysis.mjs
index e113884be..a79d7e9b0 100644
--- a/packages/css-calc/test/wpt/calc-unit-analysis.mjs
+++ b/packages/css-calc/test/wpt/calc-unit-analysis.mjs
@@ -1,5 +1,5 @@
import { calc } from '@csstools/css-calc';
-import assert from 'assert';
+import assert from 'node:assert';
assert.strictEqual(
calc('calc(0)'),
diff --git a/packages/css-calc/test/wpt/clamp-length-computed.mjs b/packages/css-calc/test/wpt/clamp-length-computed.mjs
index a75b43d1b..d418eaea0 100644
--- a/packages/css-calc/test/wpt/clamp-length-computed.mjs
+++ b/packages/css-calc/test/wpt/clamp-length-computed.mjs
@@ -1,5 +1,5 @@
import { calc } from '@csstools/css-calc';
-import assert from 'assert';
+import assert from 'node:assert';
assert.strictEqual(
calc('clamp(10px, 20px, 30px)'),
diff --git a/packages/css-calc/test/wpt/clamp-length-invalid.mjs b/packages/css-calc/test/wpt/clamp-length-invalid.mjs
index 73118b30f..47800a293 100644
--- a/packages/css-calc/test/wpt/clamp-length-invalid.mjs
+++ b/packages/css-calc/test/wpt/clamp-length-invalid.mjs
@@ -1,5 +1,5 @@
import { calc } from '@csstools/css-calc';
-import assert from 'assert';
+import assert from 'node:assert';
assert.strictEqual(
calc('clamp()'),
diff --git a/packages/css-calc/test/wpt/exp-log-compute.mjs b/packages/css-calc/test/wpt/exp-log-compute.mjs
index 2ff627f56..502e71923 100644
--- a/packages/css-calc/test/wpt/exp-log-compute.mjs
+++ b/packages/css-calc/test/wpt/exp-log-compute.mjs
@@ -1,5 +1,5 @@
import { calc } from '@csstools/css-calc';
-import assert from 'assert';
+import assert from 'node:assert';
assert.strictEqual(
calc('log(1)'),
diff --git a/packages/css-calc/test/wpt/hypot-pow-sqrt-computed.mjs b/packages/css-calc/test/wpt/hypot-pow-sqrt-computed.mjs
index 9a428c013..d251c4426 100644
--- a/packages/css-calc/test/wpt/hypot-pow-sqrt-computed.mjs
+++ b/packages/css-calc/test/wpt/hypot-pow-sqrt-computed.mjs
@@ -1,5 +1,5 @@
import { calc } from '@csstools/css-calc';
-import assert from 'assert';
+import assert from 'node:assert';
assert.strictEqual(
calc('pow(1,1)'),
diff --git a/packages/css-calc/test/wpt/invalid.mjs b/packages/css-calc/test/wpt/invalid.mjs
index 41b899548..092e87361 100644
--- a/packages/css-calc/test/wpt/invalid.mjs
+++ b/packages/css-calc/test/wpt/invalid.mjs
@@ -1,5 +1,5 @@
import { calc } from '@csstools/css-calc';
-import assert from 'assert';
+import assert from 'node:assert';
const testCases = [
'asin()',
diff --git a/packages/css-calc/test/wpt/max-20-arguments.mjs b/packages/css-calc/test/wpt/max-20-arguments.mjs
index 487665e70..cd338dd29 100644
--- a/packages/css-calc/test/wpt/max-20-arguments.mjs
+++ b/packages/css-calc/test/wpt/max-20-arguments.mjs
@@ -1,5 +1,5 @@
import { calc } from '@csstools/css-calc';
-import assert from 'assert';
+import assert from 'node:assert';
assert.strictEqual(
calc('max(5%, 10%, 15%, 20%, 25%, 30%, 35%, 40%, 45%, 50%, 55%, 60%, 65%, 70%, 75%, 80%, 85%, 90%, 95%, 100%)'),
diff --git a/packages/css-calc/test/wpt/minmax-angle-computed.mjs b/packages/css-calc/test/wpt/minmax-angle-computed.mjs
index 9871db581..c234d23d7 100644
--- a/packages/css-calc/test/wpt/minmax-angle-computed.mjs
+++ b/packages/css-calc/test/wpt/minmax-angle-computed.mjs
@@ -1,5 +1,5 @@
import { calc } from '@csstools/css-calc';
-import assert from 'assert';
+import assert from 'node:assert';
assert.strictEqual(
calc('min(1deg)'),
diff --git a/packages/css-calc/test/wpt/minmax-integer-computed.mjs b/packages/css-calc/test/wpt/minmax-integer-computed.mjs
index 07922c5bb..74a9cf71b 100644
--- a/packages/css-calc/test/wpt/minmax-integer-computed.mjs
+++ b/packages/css-calc/test/wpt/minmax-integer-computed.mjs
@@ -1,5 +1,5 @@
import { calc } from '@csstools/css-calc';
-import assert from 'assert';
+import assert from 'node:assert';
assert.strictEqual(
calc('min(1)'),
diff --git a/packages/css-calc/test/wpt/minmax-percentage-computed.mjs b/packages/css-calc/test/wpt/minmax-percentage-computed.mjs
index 48cdac58b..f364d346f 100644
--- a/packages/css-calc/test/wpt/minmax-percentage-computed.mjs
+++ b/packages/css-calc/test/wpt/minmax-percentage-computed.mjs
@@ -1,5 +1,5 @@
import { calc } from '@csstools/css-calc';
-import assert from 'assert';
+import assert from 'node:assert';
assert.strictEqual(
calc('min(1%)'),
diff --git a/packages/css-calc/test/wpt/minmax-time-computed.mjs b/packages/css-calc/test/wpt/minmax-time-computed.mjs
index 13529b678..9e2744e61 100644
--- a/packages/css-calc/test/wpt/minmax-time-computed.mjs
+++ b/packages/css-calc/test/wpt/minmax-time-computed.mjs
@@ -1,5 +1,5 @@
import { calc } from '@csstools/css-calc';
-import assert from 'assert';
+import assert from 'node:assert';
assert.strictEqual(
calc('min(1s)'),
diff --git a/packages/css-calc/test/wpt/round-function.mjs b/packages/css-calc/test/wpt/round-function.mjs
index ffdb90679..93b85edb3 100644
--- a/packages/css-calc/test/wpt/round-function.mjs
+++ b/packages/css-calc/test/wpt/round-function.mjs
@@ -1,5 +1,5 @@
import { calc } from '@csstools/css-calc';
-import assert from 'assert';
+import assert from 'node:assert';
assert.strictEqual(
calc('calc(45deg + 45deg)'),
diff --git a/packages/css-calc/test/wpt/round-mod-rem-computed.mjs b/packages/css-calc/test/wpt/round-mod-rem-computed.mjs
index db5d57bf0..7420acb0b 100644
--- a/packages/css-calc/test/wpt/round-mod-rem-computed.mjs
+++ b/packages/css-calc/test/wpt/round-mod-rem-computed.mjs
@@ -1,5 +1,5 @@
import { calc } from '@csstools/css-calc';
-import assert from 'assert';
+import assert from 'node:assert';
assert.strictEqual(
calc('calc(45deg + 45deg)'),
diff --git a/packages/css-calc/test/wpt/round-mod-rem-invalid.mjs b/packages/css-calc/test/wpt/round-mod-rem-invalid.mjs
index f0a1ce599..4bd490ba3 100644
--- a/packages/css-calc/test/wpt/round-mod-rem-invalid.mjs
+++ b/packages/css-calc/test/wpt/round-mod-rem-invalid.mjs
@@ -1,5 +1,5 @@
import { calc } from '@csstools/css-calc';
-import assert from 'assert';
+import assert from 'node:assert';
assert.strictEqual(
calc('min(1s)'),
diff --git a/packages/css-calc/test/wpt/signs-abs-computed.mjs b/packages/css-calc/test/wpt/signs-abs-computed.mjs
index 875891cb4..7c23796f4 100644
--- a/packages/css-calc/test/wpt/signs-abs-computed.mjs
+++ b/packages/css-calc/test/wpt/signs-abs-computed.mjs
@@ -1,5 +1,5 @@
import { calc } from '@csstools/css-calc';
-import assert from 'assert';
+import assert from 'node:assert';
assert.strictEqual(
calc('calc(45deg + 45deg)'),
diff --git a/packages/css-calc/test/wpt/sin-cos-tan-computed.mjs b/packages/css-calc/test/wpt/sin-cos-tan-computed.mjs
index cdb2b866f..b6cce6bee 100644
--- a/packages/css-calc/test/wpt/sin-cos-tan-computed.mjs
+++ b/packages/css-calc/test/wpt/sin-cos-tan-computed.mjs
@@ -1,5 +1,5 @@
import { calc } from '@csstools/css-calc';
-import assert from 'assert';
+import assert from 'node:assert';
assert.strictEqual(
calc('cos(0)'),
diff --git a/packages/css-color-parser/CHANGELOG.md b/packages/css-color-parser/CHANGELOG.md
index d2e70ba91..1551b5557 100644
--- a/packages/css-color-parser/CHANGELOG.md
+++ b/packages/css-color-parser/CHANGELOG.md
@@ -1,5 +1,9 @@
# Changes to CSS Color Parser
+### Unreleased (major)
+
+- Updated: Support for Node v18+ (major).
+
### 2.0.5
_July 13, 2024_
diff --git a/packages/css-color-parser/dist/index.cjs b/packages/css-color-parser/dist/index.cjs
index 7db9112a3..f79095ffb 100644
--- a/packages/css-color-parser/dist/index.cjs
+++ b/packages/css-color-parser/dist/index.cjs
@@ -1 +1 @@
-"use strict";var e,o,a=require("@csstools/css-tokenizer"),n=require("@csstools/color-helpers"),t=require("@csstools/css-parser-algorithms"),r=require("@csstools/css-calc");function convertNaNToZero(e){return[Number.isNaN(e[0])?0:e[0],Number.isNaN(e[1])?0:e[1],Number.isNaN(e[2])?0:e[2]]}function colorData_to_XYZ_D50(e){switch(e.colorNotation){case exports.ColorNotation.HEX:case exports.ColorNotation.RGB:case exports.ColorNotation.sRGB:return{...e,colorNotation:exports.ColorNotation.XYZ_D50,channels:n.sRGB_to_XYZ_D50(convertNaNToZero(e.channels))};case exports.ColorNotation.Linear_sRGB:return{...e,colorNotation:exports.ColorNotation.XYZ_D50,channels:n.lin_sRGB_to_XYZ_D50(convertNaNToZero(e.channels))};case exports.ColorNotation.Display_P3:return{...e,colorNotation:exports.ColorNotation.XYZ_D50,channels:n.P3_to_XYZ_D50(convertNaNToZero(e.channels))};case exports.ColorNotation.Rec2020:return{...e,colorNotation:exports.ColorNotation.XYZ_D50,channels:n.rec_2020_to_XYZ_D50(convertNaNToZero(e.channels))};case exports.ColorNotation.A98_RGB:return{...e,colorNotation:exports.ColorNotation.XYZ_D50,channels:n.a98_RGB_to_XYZ_D50(convertNaNToZero(e.channels))};case exports.ColorNotation.ProPhoto_RGB:return{...e,colorNotation:exports.ColorNotation.XYZ_D50,channels:n.ProPhoto_RGB_to_XYZ_D50(convertNaNToZero(e.channels))};case exports.ColorNotation.HSL:return{...e,colorNotation:exports.ColorNotation.XYZ_D50,channels:n.HSL_to_XYZ_D50(convertNaNToZero(e.channels))};case exports.ColorNotation.HWB:return{...e,colorNotation:exports.ColorNotation.XYZ_D50,channels:n.HWB_to_XYZ_D50(convertNaNToZero(e.channels))};case exports.ColorNotation.Lab:return{...e,colorNotation:exports.ColorNotation.XYZ_D50,channels:n.Lab_to_XYZ_D50(convertNaNToZero(e.channels))};case exports.ColorNotation.OKLab:return{...e,colorNotation:exports.ColorNotation.XYZ_D50,channels:n.OKLab_to_XYZ_D50(convertNaNToZero(e.channels))};case exports.ColorNotation.LCH:return{...e,colorNotation:exports.ColorNotation.XYZ_D50,channels:n.LCH_to_XYZ_D50(convertNaNToZero(e.channels))};case exports.ColorNotation.OKLCH:return{...e,colorNotation:exports.ColorNotation.XYZ_D50,channels:n.OKLCH_to_XYZ_D50(convertNaNToZero(e.channels))};case exports.ColorNotation.XYZ_D50:return{...e,colorNotation:exports.ColorNotation.XYZ_D50,channels:n.XYZ_D50_to_XYZ_D50(convertNaNToZero(e.channels))};case exports.ColorNotation.XYZ_D65:return{...e,colorNotation:exports.ColorNotation.XYZ_D50,channels:n.XYZ_D65_to_XYZ_D50(convertNaNToZero(e.channels))};default:throw new Error("Unsupported color notation")}}exports.ColorNotation=void 0,(e=exports.ColorNotation||(exports.ColorNotation={})).A98_RGB="a98-rgb",e.Display_P3="display-p3",e.HEX="hex",e.HSL="hsl",e.HWB="hwb",e.LCH="lch",e.Lab="lab",e.Linear_sRGB="srgb-linear",e.OKLCH="oklch",e.OKLab="oklab",e.ProPhoto_RGB="prophoto-rgb",e.RGB="rgb",e.sRGB="srgb",e.Rec2020="rec2020",e.XYZ_D50="xyz-d50",e.XYZ_D65="xyz-d65",exports.SyntaxFlag=void 0,(o=exports.SyntaxFlag||(exports.SyntaxFlag={})).ColorKeyword="color-keyword",o.HasAlpha="has-alpha",o.HasDimensionValues="has-dimension-values",o.HasNoneKeywords="has-none-keywords",o.HasNumberValues="has-number-values",o.HasPercentageAlpha="has-percentage-alpha",o.HasPercentageValues="has-percentage-values",o.HasVariableAlpha="has-variable-alpha",o.Hex="hex",o.LegacyHSL="legacy-hsl",o.LegacyRGB="legacy-rgb",o.NamedColor="named-color",o.RelativeColorSyntax="relative-color-syntax",o.ColorMix="color-mix",o.ContrastColor="contrast-color",o.Experimental="experimental";const s=new Set([exports.ColorNotation.A98_RGB,exports.ColorNotation.Display_P3,exports.ColorNotation.HEX,exports.ColorNotation.Linear_sRGB,exports.ColorNotation.ProPhoto_RGB,exports.ColorNotation.RGB,exports.ColorNotation.sRGB,exports.ColorNotation.Rec2020,exports.ColorNotation.XYZ_D50,exports.ColorNotation.XYZ_D65]);function colorDataTo(e,o){const a={...e};if(e.colorNotation!==o){const e=colorData_to_XYZ_D50(a);switch(o){case exports.ColorNotation.HEX:case exports.ColorNotation.RGB:a.colorNotation=exports.ColorNotation.RGB,a.channels=n.XYZ_D50_to_sRGB(e.channels);break;case exports.ColorNotation.sRGB:a.colorNotation=exports.ColorNotation.sRGB,a.channels=n.XYZ_D50_to_sRGB(e.channels);break;case exports.ColorNotation.Linear_sRGB:a.colorNotation=exports.ColorNotation.Linear_sRGB,a.channels=n.XYZ_D50_to_lin_sRGB(e.channels);break;case exports.ColorNotation.Display_P3:a.colorNotation=exports.ColorNotation.Display_P3,a.channels=n.XYZ_D50_to_P3(e.channels);break;case exports.ColorNotation.Rec2020:a.colorNotation=exports.ColorNotation.Rec2020,a.channels=n.XYZ_D50_to_rec_2020(e.channels);break;case exports.ColorNotation.ProPhoto_RGB:a.colorNotation=exports.ColorNotation.ProPhoto_RGB,a.channels=n.XYZ_D50_to_ProPhoto(e.channels);break;case exports.ColorNotation.A98_RGB:a.colorNotation=exports.ColorNotation.A98_RGB,a.channels=n.XYZ_D50_to_a98_RGB(e.channels);break;case exports.ColorNotation.HSL:a.colorNotation=exports.ColorNotation.HSL,a.channels=n.XYZ_D50_to_HSL(e.channels);break;case exports.ColorNotation.HWB:a.colorNotation=exports.ColorNotation.HWB,a.channels=n.XYZ_D50_to_HWB(e.channels);break;case exports.ColorNotation.Lab:a.colorNotation=exports.ColorNotation.Lab,a.channels=n.XYZ_D50_to_Lab(e.channels);break;case exports.ColorNotation.LCH:a.colorNotation=exports.ColorNotation.LCH,a.channels=n.XYZ_D50_to_LCH(e.channels);break;case exports.ColorNotation.OKLCH:a.colorNotation=exports.ColorNotation.OKLCH,a.channels=n.XYZ_D50_to_OKLCH(e.channels);break;case exports.ColorNotation.OKLab:a.colorNotation=exports.ColorNotation.OKLab,a.channels=n.XYZ_D50_to_OKLab(e.channels);break;case exports.ColorNotation.XYZ_D50:a.colorNotation=exports.ColorNotation.XYZ_D50,a.channels=n.XYZ_D50_to_XYZ_D50(e.channels);break;case exports.ColorNotation.XYZ_D65:a.colorNotation=exports.ColorNotation.XYZ_D65,a.channels=n.XYZ_D50_to_XYZ_D65(e.channels);break;default:throw new Error("Unsupported color notation")}}else a.channels=convertNaNToZero(e.channels);if(o===e.colorNotation)a.channels=carryForwardMissingComponents(e.channels,[0,1,2],a.channels,[0,1,2]);else if(s.has(o)&&s.has(e.colorNotation))a.channels=carryForwardMissingComponents(e.channels,[0,1,2],a.channels,[0,1,2]);else switch(o){case exports.ColorNotation.HSL:switch(e.colorNotation){case exports.ColorNotation.HWB:a.channels=carryForwardMissingComponents(e.channels,[0],a.channels,[0]);break;case exports.ColorNotation.Lab:case exports.ColorNotation.OKLab:a.channels=carryForwardMissingComponents(e.channels,[2],a.channels,[0]);break;case exports.ColorNotation.LCH:case exports.ColorNotation.OKLCH:a.channels=carryForwardMissingComponents(e.channels,[0,1,2],a.channels,[2,1,0])}break;case exports.ColorNotation.HWB:switch(e.colorNotation){case exports.ColorNotation.HSL:a.channels=carryForwardMissingComponents(e.channels,[0],a.channels,[0]);break;case exports.ColorNotation.LCH:case exports.ColorNotation.OKLCH:a.channels=carryForwardMissingComponents(e.channels,[0],a.channels,[2])}break;case exports.ColorNotation.Lab:case exports.ColorNotation.OKLab:switch(e.colorNotation){case exports.ColorNotation.HSL:a.channels=carryForwardMissingComponents(e.channels,[0],a.channels,[2]);break;case exports.ColorNotation.Lab:case exports.ColorNotation.OKLab:a.channels=carryForwardMissingComponents(e.channels,[0,1,2],a.channels,[0,1,2]);break;case exports.ColorNotation.LCH:case exports.ColorNotation.OKLCH:a.channels=carryForwardMissingComponents(e.channels,[0],a.channels,[0])}break;case exports.ColorNotation.LCH:case exports.ColorNotation.OKLCH:switch(e.colorNotation){case exports.ColorNotation.HSL:a.channels=carryForwardMissingComponents(e.channels,[0,1,2],a.channels,[2,1,0]);break;case exports.ColorNotation.HWB:a.channels=carryForwardMissingComponents(e.channels,[0],a.channels,[2]);break;case exports.ColorNotation.Lab:case exports.ColorNotation.OKLab:a.channels=carryForwardMissingComponents(e.channels,[0],a.channels,[0]);break;case exports.ColorNotation.LCH:case exports.ColorNotation.OKLCH:a.channels=carryForwardMissingComponents(e.channels,[0,1,2],a.channels,[0,1,2])}}return a.channels=convertPowerlessComponentsToMissingComponents(a.channels,o),a}function convertPowerlessComponentsToMissingComponents(e,o){const a=[...e];switch(o){case exports.ColorNotation.HSL:!Number.isNaN(a[1])&&reducePrecision(a[1],4)<=0&&(a[0]=NaN);break;case exports.ColorNotation.HWB:Math.max(0,reducePrecision(a[1],4))+Math.max(0,reducePrecision(a[2],4))>=100&&(a[0]=NaN);break;case exports.ColorNotation.LCH:!Number.isNaN(a[1])&&reducePrecision(a[1],4)<=0&&(a[2]=NaN);break;case exports.ColorNotation.OKLCH:!Number.isNaN(a[1])&&reducePrecision(a[1],6)<=0&&(a[2]=NaN)}return a}function convertPowerlessComponentsToZeroValuesForDisplay(e,o){const a=[...e];switch(o){case exports.ColorNotation.HSL:(reducePrecision(a[2])<=0||reducePrecision(a[2])>=100)&&(a[0]=NaN,a[1]=NaN),reducePrecision(a[1])<=0&&(a[0]=NaN);break;case exports.ColorNotation.HWB:Math.max(0,reducePrecision(a[1]))+Math.max(0,reducePrecision(a[2]))>=100&&(a[0]=NaN);break;case exports.ColorNotation.Lab:(reducePrecision(a[0])<=0||reducePrecision(a[0])>=100)&&(a[1]=NaN,a[2]=NaN);break;case exports.ColorNotation.LCH:reducePrecision(a[1])<=0&&(a[2]=NaN),(reducePrecision(a[0])<=0||reducePrecision(a[0])>=100)&&(a[1]=NaN,a[2]=NaN);break;case exports.ColorNotation.OKLab:(reducePrecision(a[0])<=0||reducePrecision(a[0])>=1)&&(a[1]=NaN,a[2]=NaN);break;case exports.ColorNotation.OKLCH:reducePrecision(a[1])<=0&&(a[2]=NaN),(reducePrecision(a[0])<=0||reducePrecision(a[0])>=1)&&(a[1]=NaN,a[2]=NaN)}return a}function carryForwardMissingComponents(e,o,a,n){const t=[...a];for(const a of o)Number.isNaN(e[o[a]])&&(t[n[a]]=NaN);return t}function normalizeRelativeColorDataChannels(e){const o=new Map;switch(e.colorNotation){case exports.ColorNotation.RGB:case exports.ColorNotation.HEX:o.set("r",dummyNumberToken(255*e.channels[0])),o.set("g",dummyNumberToken(255*e.channels[1])),o.set("b",dummyNumberToken(255*e.channels[2])),"number"==typeof e.alpha&&o.set("alpha",dummyNumberToken(e.alpha));break;case exports.ColorNotation.HSL:o.set("h",dummyNumberToken(e.channels[0])),o.set("s",dummyNumberToken(e.channels[1])),o.set("l",dummyNumberToken(e.channels[2])),"number"==typeof e.alpha&&o.set("alpha",dummyNumberToken(e.alpha));break;case exports.ColorNotation.HWB:o.set("h",dummyNumberToken(e.channels[0])),o.set("w",dummyNumberToken(e.channels[1])),o.set("b",dummyNumberToken(e.channels[2])),"number"==typeof e.alpha&&o.set("alpha",dummyNumberToken(e.alpha));break;case exports.ColorNotation.Lab:case exports.ColorNotation.OKLab:o.set("l",dummyNumberToken(e.channels[0])),o.set("a",dummyNumberToken(e.channels[1])),o.set("b",dummyNumberToken(e.channels[2])),"number"==typeof e.alpha&&o.set("alpha",dummyNumberToken(e.alpha));break;case exports.ColorNotation.LCH:case exports.ColorNotation.OKLCH:o.set("l",dummyNumberToken(e.channels[0])),o.set("c",dummyNumberToken(e.channels[1])),o.set("h",dummyNumberToken(e.channels[2])),"number"==typeof e.alpha&&o.set("alpha",dummyNumberToken(e.alpha));break;case exports.ColorNotation.sRGB:case exports.ColorNotation.A98_RGB:case exports.ColorNotation.Display_P3:case exports.ColorNotation.Rec2020:case exports.ColorNotation.Linear_sRGB:case exports.ColorNotation.ProPhoto_RGB:o.set("r",dummyNumberToken(e.channels[0])),o.set("g",dummyNumberToken(e.channels[1])),o.set("b",dummyNumberToken(e.channels[2])),"number"==typeof e.alpha&&o.set("alpha",dummyNumberToken(e.alpha));break;case exports.ColorNotation.XYZ_D50:case exports.ColorNotation.XYZ_D65:o.set("x",dummyNumberToken(e.channels[0])),o.set("y",dummyNumberToken(e.channels[1])),o.set("z",dummyNumberToken(e.channels[2])),"number"==typeof e.alpha&&o.set("alpha",dummyNumberToken(e.alpha))}return o}function noneToZeroInRelativeColorDataChannels(e){const o=new Map(e);for(const[a,n]of e)Number.isNaN(n[4].value)&&o.set(a,dummyNumberToken(0));return o}function dummyNumberToken(e){return Number.isNaN(e)?[a.TokenType.Number,"none",-1,-1,{value:Number.NaN,type:a.NumberType.Number}]:[a.TokenType.Number,e.toString(),-1,-1,{value:e,type:a.NumberType.Number}]}function reducePrecision(e,o=7){if(Number.isNaN(e))return 0;const a=Math.pow(10,o);return Math.round(e*a)/a}function normalize(e,o,a,n){return Math.min(Math.max(e/o,a),n)}const l=/[A-Z]/g;function toLowerCaseAZ(e){return e.replace(l,(e=>String.fromCharCode(e.charCodeAt(0)+32)))}function normalize_Color_ChannelValues(e,o,n){if(a.isTokenIdent(e)&&"none"===toLowerCaseAZ(e[4].value))return n.syntaxFlags.add(exports.SyntaxFlag.HasNoneKeywords),[a.TokenType.Number,"none",e[2],e[3],{value:NaN,type:a.NumberType.Number}];if(a.isTokenPercentage(e)){3!==o&&n.syntaxFlags.add(exports.SyntaxFlag.HasPercentageValues);let t=normalize(e[4].value,100,-2147483647,2147483647);return 3===o&&(t=normalize(e[4].value,100,0,1)),[a.TokenType.Number,t.toString(),e[2],e[3],{value:t,type:a.NumberType.Number}]}if(a.isTokenNumber(e)){3!==o&&n.syntaxFlags.add(exports.SyntaxFlag.HasNumberValues);let t=normalize(e[4].value,1,-2147483647,2147483647);return 3===o&&(t=normalize(e[4].value,1,0,1)),[a.TokenType.Number,t.toString(),e[2],e[3],{value:t,type:a.NumberType.Number}]}return!1}const i=new Set(["srgb","srgb-linear","display-p3","a98-rgb","prophoto-rgb","rec2020","xyz","xyz-d50","xyz-d65"]);function color$1(e,o){const n=[],s=[],l=[],u=[];let c,p,N=!1,m=!1;const h={colorNotation:exports.ColorNotation.sRGB,channels:[0,0,0],alpha:1,syntaxFlags:new Set([])};let x=n;for(let y=0;y=0){i=u.value[4].value;continue}}return!1}if(!l)return!1;n.push({color:l,percentage:i}),l=!1,i=!1}}if(l&&n.push({color:l,percentage:i}),2!==n.length)return!1;let u=n[0].percentage,c=n[1].percentage;return(!1===u||!(u<0||u>100))&&((!1===c||!(c<0||c>100))&&(!1===u&&!1===c?(u=50,c=50):!1!==u&&!1===c?c=100-u:!1===u&&!1!==c&&(u=100-c),(0!==u||0!==c)&&(!1!==u&&!1!==c&&(u+c>100&&(u=u/(u+c)*100,c=c/(u+c)*100),u+c<100&&(s=(u+c)/100,u=u/(u+c)*100,c=c/(u+c)*100),{a:{color:n[0].color,percentage:u},b:{color:n[1].color,percentage:c},alphaMultiplier:s}))))}function colorMixRectangular(e,o){if(!o)return!1;const a=o.a.color,n=o.b.color,t=o.a.percentage/100;let r=a.channels,s=n.channels,l=exports.ColorNotation.RGB,i=a.alpha;if("number"!=typeof i)return!1;let u=n.alpha;if("number"!=typeof u)return!1;switch(i=Number.isNaN(i)?u:i,u=Number.isNaN(u)?i:u,e){case"srgb":l=exports.ColorNotation.RGB;break;case"srgb-linear":l=exports.ColorNotation.Linear_sRGB;break;case"display-p3":l=exports.ColorNotation.Display_P3;break;case"a98-rgb":l=exports.ColorNotation.A98_RGB;break;case"prophoto-rgb":l=exports.ColorNotation.ProPhoto_RGB;break;case"rec2020":l=exports.ColorNotation.Rec2020;break;case"lab":l=exports.ColorNotation.Lab;break;case"oklab":l=exports.ColorNotation.OKLab;break;case"xyz-d50":l=exports.ColorNotation.XYZ_D50;break;case"xyz":case"xyz-d65":l=exports.ColorNotation.XYZ_D65}r=colorDataTo(a,l).channels,s=colorDataTo(n,l).channels,r[0]=fillInMissingComponent(r[0],s[0]),s[0]=fillInMissingComponent(s[0],r[0]),r[1]=fillInMissingComponent(r[1],s[1]),s[1]=fillInMissingComponent(s[1],r[1]),r[2]=fillInMissingComponent(r[2],s[2]),s[2]=fillInMissingComponent(s[2],r[2]),r[0]=premultiply(r[0],i),r[1]=premultiply(r[1],i),r[2]=premultiply(r[2],i),s[0]=premultiply(s[0],u),s[1]=premultiply(s[1],u),s[2]=premultiply(s[2],u);const c=interpolate(i,u,t),p={colorNotation:l,channels:[un_premultiply(interpolate(r[0],s[0],t),c),un_premultiply(interpolate(r[1],s[1],t),c),un_premultiply(interpolate(r[2],s[2],t),c)],alpha:c*o.alphaMultiplier,syntaxFlags:new Set([exports.SyntaxFlag.ColorMix])};return(o.a.color.syntaxFlags.has(exports.SyntaxFlag.Experimental)||o.b.color.syntaxFlags.has(exports.SyntaxFlag.Experimental))&&p.syntaxFlags.add(exports.SyntaxFlag.Experimental),p}function colorMixPolar(e,o,a){if(!a)return!1;const n=a.a.color,t=a.b.color,r=a.a.percentage/100;let s=n.channels,l=t.channels,i=0,u=0,c=0,p=0,N=0,m=0,h=exports.ColorNotation.RGB,x=n.alpha;if("number"!=typeof x)return!1;let y=t.alpha;if("number"!=typeof y)return!1;switch(x=Number.isNaN(x)?y:x,y=Number.isNaN(y)?x:y,e){case"hsl":h=exports.ColorNotation.HSL;break;case"hwb":h=exports.ColorNotation.HWB;break;case"lch":h=exports.ColorNotation.LCH;break;case"oklch":h=exports.ColorNotation.OKLCH}switch(s=colorDataTo(n,h).channels,l=colorDataTo(t,h).channels,e){case"hsl":case"hwb":i=s[0],u=l[0],c=s[1],p=l[1],N=s[2],m=l[2];break;case"lch":case"oklch":c=s[0],p=l[0],N=s[1],m=l[1],i=s[2],u=l[2]}i=fillInMissingComponent(i,u),Number.isNaN(i)&&(i=0),u=fillInMissingComponent(u,i),Number.isNaN(u)&&(u=0),c=fillInMissingComponent(c,p),p=fillInMissingComponent(p,c),N=fillInMissingComponent(N,m),m=fillInMissingComponent(m,N);const b=u-i;switch(o){case"shorter":b>180?i+=360:b<-180&&(u+=360);break;case"longer":-180<180&&(b>0?i+=360:u+=360);break;case"increasing":b<0&&(u+=360);break;case"decreasing":b>0&&(i+=360);break;default:throw new Error("Unknown hue interpolation method")}c=premultiply(c,x),N=premultiply(N,x),p=premultiply(p,y),m=premultiply(m,y);let C=[0,0,0];const d=interpolate(x,y,r);switch(e){case"hsl":case"hwb":C=[interpolate(i,u,r),un_premultiply(interpolate(c,p,r),d),un_premultiply(interpolate(N,m,r),d)];break;case"lch":case"oklch":C=[un_premultiply(interpolate(c,p,r),d),un_premultiply(interpolate(N,m,r),d),interpolate(i,u,r)]}const T={colorNotation:h,channels:C,alpha:d*a.alphaMultiplier,syntaxFlags:new Set([exports.SyntaxFlag.ColorMix])};return(a.a.color.syntaxFlags.has(exports.SyntaxFlag.Experimental)||a.b.color.syntaxFlags.has(exports.SyntaxFlag.Experimental))&&T.syntaxFlags.add(exports.SyntaxFlag.Experimental),T}function fillInMissingComponent(e,o){return Number.isNaN(e)?o:e}function interpolate(e,o,a){return e*a+o*(1-a)}function premultiply(e,o){return Number.isNaN(o)?e:Number.isNaN(e)?NaN:e*o}function un_premultiply(e,o){return 0===o||Number.isNaN(o)?e:Number.isNaN(e)?NaN:e/o}function hex(e){const o=toLowerCaseAZ(e[4].value);if(o.match(/[^a-f0-9]/))return!1;const a={colorNotation:exports.ColorNotation.HEX,channels:[0,0,0],alpha:1,syntaxFlags:new Set([exports.SyntaxFlag.Hex])},n=o.length;if(3===n){const e=o[0],n=o[1],t=o[2];return a.channels=[parseInt(e+e,16)/255,parseInt(n+n,16)/255,parseInt(t+t,16)/255],a}if(6===n){const e=o[0]+o[1],n=o[2]+o[3],t=o[4]+o[5];return a.channels=[parseInt(e,16)/255,parseInt(n,16)/255,parseInt(t,16)/255],a}if(4===n){const e=o[0],n=o[1],t=o[2],r=o[3];return a.channels=[parseInt(e+e,16)/255,parseInt(n+n,16)/255,parseInt(t+t,16)/255],a.alpha=parseInt(r+r,16)/255,a.syntaxFlags.add(exports.SyntaxFlag.HasAlpha),a}if(8===n){const e=o[0]+o[1],n=o[2]+o[3],t=o[4]+o[5],r=o[6]+o[7];return a.channels=[parseInt(e,16)/255,parseInt(n,16)/255,parseInt(t,16)/255],a.alpha=parseInt(r,16)/255,a.syntaxFlags.add(exports.SyntaxFlag.HasAlpha),a}return!1}function normalizeHue(e){if(a.isTokenNumber(e))return e[4].value=e[4].value%360,e[1]=e[4].value.toString(),e;if(a.isTokenDimension(e)){let o=e[4].value;switch(toLowerCaseAZ(e[4].unit)){case"deg":break;case"rad":o=180*e[4].value/Math.PI;break;case"grad":o=.9*e[4].value;break;case"turn":o=360*e[4].value;break;default:return!1}return o%=360,[a.TokenType.Number,o.toString(),e[2],e[3],{value:o,type:a.NumberType.Number}]}return!1}function normalize_legacy_HSL_ChannelValues(e,o,n){if(0===o){const o=normalizeHue(e);return!1!==o&&(a.isTokenDimension(e)&&n.syntaxFlags.add(exports.SyntaxFlag.HasDimensionValues),o)}if(a.isTokenPercentage(e)){3===o?n.syntaxFlags.add(exports.SyntaxFlag.HasPercentageAlpha):n.syntaxFlags.add(exports.SyntaxFlag.HasPercentageValues);let t=normalize(e[4].value,1,0,100);return 3===o&&(t=normalize(e[4].value,100,0,1)),[a.TokenType.Number,t.toString(),e[2],e[3],{value:t,type:a.NumberType.Number}]}if(a.isTokenNumber(e)){if(3!==o)return!1;let n=normalize(e[4].value,1,0,100);return 3===o&&(n=normalize(e[4].value,1,0,1)),[a.TokenType.Number,n.toString(),e[2],e[3],{value:n,type:a.NumberType.Number}]}return!1}function normalize_modern_HSL_ChannelValues(e,o,n){if(a.isTokenIdent(e)&&"none"===toLowerCaseAZ(e[4].value))return n.syntaxFlags.add(exports.SyntaxFlag.HasNoneKeywords),[a.TokenType.Number,"none",e[2],e[3],{value:NaN,type:a.NumberType.Number}];if(0===o){const o=normalizeHue(e);return!1!==o&&(a.isTokenDimension(e)&&n.syntaxFlags.add(exports.SyntaxFlag.HasDimensionValues),o)}if(a.isTokenPercentage(e)){3===o?n.syntaxFlags.add(exports.SyntaxFlag.HasPercentageAlpha):n.syntaxFlags.add(exports.SyntaxFlag.HasPercentageValues);let t=e[4].value;return 3===o?t=normalize(e[4].value,100,0,1):1===o&&(t=normalize(e[4].value,1,0,2147483647)),[a.TokenType.Number,t.toString(),e[2],e[3],{value:t,type:a.NumberType.Number}]}if(a.isTokenNumber(e)){3!==o&&n.syntaxFlags.add(exports.SyntaxFlag.HasNumberValues);let t=e[4].value;return 3===o?t=normalize(e[4].value,1,0,1):1===o&&(t=normalize(e[4].value,1,0,2147483647)),[a.TokenType.Number,t.toString(),e[2],e[3],{value:t,type:a.NumberType.Number}]}return!1}function threeChannelLegacySyntax(e,o,n,s){const l=[],i=[],u=[],c=[],p={colorNotation:n,channels:[0,0,0],alpha:1,syntaxFlags:new Set(s)};let N=l;for(let o=0;ot.isTokenNode(e)&&a.isTokenComma(e.value)))){const o=hslCommaSeparated(e);if(!1!==o)return o}{const a=hslSpaceSeparated(e,o);if(!1!==a)return a}return!1}function hslCommaSeparated(e){return threeChannelLegacySyntax(e,normalize_legacy_HSL_ChannelValues,exports.ColorNotation.HSL,[exports.SyntaxFlag.LegacyHSL])}function hslSpaceSeparated(e,o){return threeChannelSpaceSeparated(e,normalize_modern_HSL_ChannelValues,exports.ColorNotation.HSL,[],o)}function normalize_HWB_ChannelValues(e,o,n){if(a.isTokenIdent(e)&&"none"===toLowerCaseAZ(e[4].value))return n.syntaxFlags.add(exports.SyntaxFlag.HasNoneKeywords),[a.TokenType.Number,"none",e[2],e[3],{value:NaN,type:a.NumberType.Number}];if(0===o){const o=normalizeHue(e);return!1!==o&&(a.isTokenDimension(e)&&n.syntaxFlags.add(exports.SyntaxFlag.HasDimensionValues),o)}if(a.isTokenPercentage(e)){3===o?n.syntaxFlags.add(exports.SyntaxFlag.HasPercentageAlpha):n.syntaxFlags.add(exports.SyntaxFlag.HasPercentageValues);let t=e[4].value;return 3===o&&(t=normalize(e[4].value,100,0,1)),[a.TokenType.Number,t.toString(),e[2],e[3],{value:t,type:a.NumberType.Number}]}if(a.isTokenNumber(e)){3!==o&&n.syntaxFlags.add(exports.SyntaxFlag.HasNumberValues);let t=e[4].value;return 3===o&&(t=normalize(e[4].value,1,0,1)),[a.TokenType.Number,t.toString(),e[2],e[3],{value:t,type:a.NumberType.Number}]}return!1}function normalize_Lab_ChannelValues(e,o,n){if(a.isTokenIdent(e)&&"none"===toLowerCaseAZ(e[4].value))return n.syntaxFlags.add(exports.SyntaxFlag.HasNoneKeywords),[a.TokenType.Number,"none",e[2],e[3],{value:NaN,type:a.NumberType.Number}];if(a.isTokenPercentage(e)){3!==o&&n.syntaxFlags.add(exports.SyntaxFlag.HasPercentageValues);let t=normalize(e[4].value,1,0,100);return 1===o||2===o?t=normalize(e[4].value,.8,-2147483647,2147483647):3===o&&(t=normalize(e[4].value,100,0,1)),[a.TokenType.Number,t.toString(),e[2],e[3],{value:t,type:a.NumberType.Number}]}if(a.isTokenNumber(e)){3!==o&&n.syntaxFlags.add(exports.SyntaxFlag.HasNumberValues);let t=normalize(e[4].value,1,0,100);return 1===o||2===o?t=normalize(e[4].value,1,-2147483647,2147483647):3===o&&(t=normalize(e[4].value,1,0,1)),[a.TokenType.Number,t.toString(),e[2],e[3],{value:t,type:a.NumberType.Number}]}return!1}function lab(e,o){return threeChannelSpaceSeparated(e,normalize_Lab_ChannelValues,exports.ColorNotation.Lab,[],o)}function normalize_LCH_ChannelValues(e,o,n){if(a.isTokenIdent(e)&&"none"===toLowerCaseAZ(e[4].value))return n.syntaxFlags.add(exports.SyntaxFlag.HasNoneKeywords),[a.TokenType.Number,"none",e[2],e[3],{value:NaN,type:a.NumberType.Number}];if(2===o){const o=normalizeHue(e);return!1!==o&&(a.isTokenDimension(e)&&n.syntaxFlags.add(exports.SyntaxFlag.HasDimensionValues),o)}if(a.isTokenPercentage(e)){3!==o&&n.syntaxFlags.add(exports.SyntaxFlag.HasPercentageValues);let t=normalize(e[4].value,1,0,100);return 1===o?t=normalize(e[4].value,100/150,0,2147483647):3===o&&(t=normalize(e[4].value,100,0,1)),[a.TokenType.Number,t.toString(),e[2],e[3],{value:t,type:a.NumberType.Number}]}if(a.isTokenNumber(e)){3!==o&&n.syntaxFlags.add(exports.SyntaxFlag.HasNumberValues);let t=normalize(e[4].value,1,0,100);return 1===o?t=normalize(e[4].value,1,0,2147483647):3===o&&(t=normalize(e[4].value,1,0,1)),[a.TokenType.Number,t.toString(),e[2],e[3],{value:t,type:a.NumberType.Number}]}return!1}function lch(e,o){return threeChannelSpaceSeparated(e,normalize_LCH_ChannelValues,exports.ColorNotation.LCH,[],o)}const N=new Map;for(const[e,o]of Object.entries(n.namedColors))N.set(e,o);function namedColor(e){const o=N.get(toLowerCaseAZ(e));return!!o&&{colorNotation:exports.ColorNotation.RGB,channels:[o[0]/255,o[1]/255,o[2]/255],alpha:1,syntaxFlags:new Set([exports.SyntaxFlag.ColorKeyword,exports.SyntaxFlag.NamedColor])}}function normalize_OKLab_ChannelValues(e,o,n){if(a.isTokenIdent(e)&&"none"===toLowerCaseAZ(e[4].value))return n.syntaxFlags.add(exports.SyntaxFlag.HasNoneKeywords),[a.TokenType.Number,"none",e[2],e[3],{value:NaN,type:a.NumberType.Number}];if(a.isTokenPercentage(e)){3!==o&&n.syntaxFlags.add(exports.SyntaxFlag.HasPercentageValues);let t=normalize(e[4].value,100,0,1);return 1===o||2===o?t=normalize(e[4].value,250,-2147483647,2147483647):3===o&&(t=normalize(e[4].value,100,0,1)),[a.TokenType.Number,t.toString(),e[2],e[3],{value:t,type:a.NumberType.Number}]}if(a.isTokenNumber(e)){3!==o&&n.syntaxFlags.add(exports.SyntaxFlag.HasNumberValues);let t=normalize(e[4].value,1,0,1);return 1===o||2===o?t=normalize(e[4].value,1,-2147483647,2147483647):3===o&&(t=normalize(e[4].value,1,0,1)),[a.TokenType.Number,t.toString(),e[2],e[3],{value:t,type:a.NumberType.Number}]}return!1}function oklab(e,o){return threeChannelSpaceSeparated(e,normalize_OKLab_ChannelValues,exports.ColorNotation.OKLab,[],o)}function normalize_OKLCH_ChannelValues(e,o,n){if(a.isTokenIdent(e)&&"none"===toLowerCaseAZ(e[4].value))return n.syntaxFlags.add(exports.SyntaxFlag.HasNoneKeywords),[a.TokenType.Number,"none",e[2],e[3],{value:NaN,type:a.NumberType.Number}];if(2===o){const o=normalizeHue(e);return!1!==o&&(a.isTokenDimension(e)&&n.syntaxFlags.add(exports.SyntaxFlag.HasDimensionValues),o)}if(a.isTokenPercentage(e)){3!==o&&n.syntaxFlags.add(exports.SyntaxFlag.HasPercentageValues);let t=normalize(e[4].value,100,0,1);return 1===o?t=normalize(e[4].value,250,0,2147483647):3===o&&(t=normalize(e[4].value,100,0,1)),[a.TokenType.Number,t.toString(),e[2],e[3],{value:t,type:a.NumberType.Number}]}if(a.isTokenNumber(e)){3!==o&&n.syntaxFlags.add(exports.SyntaxFlag.HasNumberValues);let t=normalize(e[4].value,1,0,1);return 1===o?t=normalize(e[4].value,1,0,2147483647):3===o&&(t=normalize(e[4].value,1,0,1)),[a.TokenType.Number,t.toString(),e[2],e[3],{value:t,type:a.NumberType.Number}]}return!1}function oklch(e,o){return threeChannelSpaceSeparated(e,normalize_OKLCH_ChannelValues,exports.ColorNotation.OKLCH,[],o)}function normalize_legacy_sRGB_ChannelValues(e,o,n){if(a.isTokenPercentage(e)){3===o?n.syntaxFlags.add(exports.SyntaxFlag.HasPercentageAlpha):n.syntaxFlags.add(exports.SyntaxFlag.HasPercentageValues);const t=normalize(e[4].value,100,0,1);return[a.TokenType.Number,t.toString(),e[2],e[3],{value:t,type:a.NumberType.Number}]}if(a.isTokenNumber(e)){3!==o&&n.syntaxFlags.add(exports.SyntaxFlag.HasNumberValues);let t=normalize(e[4].value,255,0,1);return 3===o&&(t=normalize(e[4].value,1,0,1)),[a.TokenType.Number,t.toString(),e[2],e[3],{value:t,type:a.NumberType.Number}]}return!1}function normalize_modern_sRGB_ChannelValues(e,o,n){if(a.isTokenIdent(e)&&"none"===e[4].value.toLowerCase())return n.syntaxFlags.add(exports.SyntaxFlag.HasNoneKeywords),[a.TokenType.Number,"none",e[2],e[3],{value:NaN,type:a.NumberType.Number}];if(a.isTokenPercentage(e)){3!==o&&n.syntaxFlags.add(exports.SyntaxFlag.HasPercentageValues);let t=normalize(e[4].value,100,-2147483647,2147483647);return 3===o&&(t=normalize(e[4].value,100,0,1)),[a.TokenType.Number,t.toString(),e[2],e[3],{value:t,type:a.NumberType.Number}]}if(a.isTokenNumber(e)){3!==o&&n.syntaxFlags.add(exports.SyntaxFlag.HasNumberValues);let t=normalize(e[4].value,255,-2147483647,2147483647);return 3===o&&(t=normalize(e[4].value,1,0,1)),[a.TokenType.Number,t.toString(),e[2],e[3],{value:t,type:a.NumberType.Number}]}return!1}function rgb(e,o){if(e.value.some((e=>t.isTokenNode(e)&&a.isTokenComma(e.value)))){const o=rgbCommaSeparated(e);if(!1!==o)return(!o.syntaxFlags.has(exports.SyntaxFlag.HasNumberValues)||!o.syntaxFlags.has(exports.SyntaxFlag.HasPercentageValues))&&o}else{const a=rgbSpaceSeparated(e,o);if(!1!==a)return a}return!1}function rgbCommaSeparated(e){return threeChannelLegacySyntax(e,normalize_legacy_sRGB_ChannelValues,exports.ColorNotation.RGB,[exports.SyntaxFlag.LegacyRGB])}function rgbSpaceSeparated(e,o){return threeChannelSpaceSeparated(e,normalize_modern_sRGB_ChannelValues,exports.ColorNotation.RGB,[],o)}function XYZ_D50_to_sRGB_Gamut(e){const o=n.XYZ_D50_to_sRGB(e);if(n.inGamut(o))return n.clip(o);let a=e;return a=n.XYZ_D50_to_OKLCH(a),a[0]<1e-6&&(a=[0,0,0]),a[0]>.999999&&(a=[1,0,0]),n.gam_sRGB(n.mapGamutRayTrace(a,oklch_to_lin_srgb,lin_srgb_to_oklch))}function oklch_to_lin_srgb(e){return e=n.OKLCH_to_OKLab(e),e=n.OKLab_to_XYZ(e),n.XYZ_to_lin_sRGB(e)}function lin_srgb_to_oklch(e){return e=n.lin_sRGB_to_XYZ(e),e=n.XYZ_to_OKLab(e),n.OKLab_to_OKLCH(e)}function contrastColor(e,o){let r=!1,s=!1;for(let n=0;nu?[1,1,1]:[0,0,0],l}function toPrecision(e,o=7){e=+e,o=+o;const a=(Math.floor(e)+"").length;if(o>a)return+e.toFixed(o-a);{const n=10**(a-o);return Math.round(e/n)*n}}function XYZ_D50_to_P3_Gamut(e){const o=n.XYZ_D50_to_P3(e);if(n.inGamut(o))return n.clip(o);let a=e;return a=n.XYZ_D50_to_OKLCH(a),a[0]<1e-6&&(a=[0,0,0]),a[0]>.999999&&(a=[1,0,0]),n.gam_P3(n.mapGamutRayTrace(a,oklch_to_lin_p3,lin_p3_to_oklch))}function oklch_to_lin_p3(e){return e=n.OKLCH_to_OKLab(e),e=n.OKLab_to_XYZ(e),n.XYZ_to_lin_P3(e)}function lin_p3_to_oklch(e){return e=n.lin_P3_to_XYZ(e),e=n.XYZ_to_OKLab(e),n.OKLab_to_OKLCH(e)}function serializeWithAlpha(e,o,n,r){const s=[a.TokenType.CloseParen,")",-1,-1,void 0];if("number"==typeof e.alpha){const l=Math.min(1,Math.max(0,toPrecision(Number.isNaN(e.alpha)?0:e.alpha)));return 1===toPrecision(l,4)?new t.FunctionNode(o,s,r):new t.FunctionNode(o,s,[...r,new t.WhitespaceNode([n]),new t.TokenNode([a.TokenType.Delim,"/",-1,-1,{value:"/"}]),new t.WhitespaceNode([n]),new t.TokenNode([a.TokenType.Number,toPrecision(l,4).toString(),-1,-1,{value:e.alpha,type:a.NumberType.Integer}])])}return new t.FunctionNode(o,s,[...r,new t.WhitespaceNode([n]),new t.TokenNode([a.TokenType.Delim,"/",-1,-1,{value:"/"}]),new t.WhitespaceNode([n]),e.alpha])}exports.color=function color(e){if(t.isFunctionNode(e)){switch(toLowerCaseAZ(e.getName())){case"rgb":case"rgba":return rgb(e,color);case"hsl":case"hsla":return hsl(e,color);case"hwb":return o=color,threeChannelSpaceSeparated(e,normalize_HWB_ChannelValues,exports.ColorNotation.HWB,[],o);case"lab":return lab(e,color);case"lch":return lch(e,color);case"oklab":return oklab(e,color);case"oklch":return oklch(e,color);case"color":return color$1(e,color);case"color-mix":return colorMix(e,color);case"contrast-color":return contrastColor(e,color)}}var o;if(t.isTokenNode(e)){if(a.isTokenHash(e.value))return hex(e.value);if(a.isTokenIdent(e.value)){const o=namedColor(e.value[4].value);return!1!==o?o:"transparent"===toLowerCaseAZ(e.value[4].value)&&{colorNotation:exports.ColorNotation.RGB,channels:[0,0,0],alpha:0,syntaxFlags:new Set([exports.SyntaxFlag.ColorKeyword])}}}return!1},exports.colorDataFitsDisplayP3_Gamut=function colorDataFitsDisplayP3_Gamut(e){const o={...e,channels:[...e.channels]};return o.channels=convertPowerlessComponentsToZeroValuesForDisplay(o.channels,o.colorNotation),!colorDataTo(o,exports.ColorNotation.Display_P3).channels.find((e=>e<-1e-5||e>1.00001))},exports.colorDataFitsRGB_Gamut=function colorDataFitsRGB_Gamut(e){const o={...e,channels:[...e.channels]};return o.channels=convertPowerlessComponentsToZeroValuesForDisplay(o.channels,o.colorNotation),!colorDataTo(o,exports.ColorNotation.RGB).channels.find((e=>e<-1e-5||e>1.00001))},exports.serializeHSL=function serializeHSL(e,o=!0){e.channels=convertPowerlessComponentsToZeroValuesForDisplay(e.channels,e.colorNotation);let r=e.channels.map((e=>Number.isNaN(e)?0:e));r=o?n.XYZ_D50_to_HSL(n.sRGB_to_XYZ_D50(XYZ_D50_to_sRGB_Gamut(colorData_to_XYZ_D50(e).channels))):n.XYZ_D50_to_HSL(colorData_to_XYZ_D50(e).channels),r=r.map((e=>Number.isNaN(e)?0:e));const s=Math.min(360,Math.max(0,Math.round(toPrecision(r[0])))),l=Math.min(100,Math.max(0,Math.round(toPrecision(r[1])))),i=Math.min(100,Math.max(0,Math.round(toPrecision(r[2])))),u=[a.TokenType.CloseParen,")",-1,-1,void 0],c=[a.TokenType.Whitespace," ",-1,-1,void 0],p=[a.TokenType.Comma,",",-1,-1,void 0],N=[new t.TokenNode([a.TokenType.Number,s.toString(),-1,-1,{value:r[0],type:a.NumberType.Integer}]),new t.TokenNode(p),new t.WhitespaceNode([c]),new t.TokenNode([a.TokenType.Percentage,l.toString()+"%",-1,-1,{value:r[1]}]),new t.TokenNode(p),new t.WhitespaceNode([c]),new t.TokenNode([a.TokenType.Percentage,i.toString()+"%",-1,-1,{value:r[2]}])];if("number"==typeof e.alpha){const o=Math.min(1,Math.max(0,toPrecision(Number.isNaN(e.alpha)?0:e.alpha)));return 1===toPrecision(o,4)?new t.FunctionNode([a.TokenType.Function,"hsl(",-1,-1,{value:"hsl"}],u,N):new t.FunctionNode([a.TokenType.Function,"hsla(",-1,-1,{value:"hsla"}],u,[...N,new t.TokenNode(p),new t.WhitespaceNode([c]),new t.TokenNode([a.TokenType.Number,toPrecision(o,4).toString(),-1,-1,{value:e.alpha,type:a.NumberType.Number}])])}return new t.FunctionNode([a.TokenType.Function,"hsla(",-1,-1,{value:"hsla"}],u,[...N,new t.TokenNode(p),new t.WhitespaceNode([c]),e.alpha])},exports.serializeOKLCH=function serializeOKLCH(e){e.channels=convertPowerlessComponentsToZeroValuesForDisplay(e.channels,e.colorNotation);let o=e.channels.map((e=>Number.isNaN(e)?0:e));e.colorNotation!==exports.ColorNotation.OKLCH&&(o=n.XYZ_D50_to_OKLCH(colorData_to_XYZ_D50(e).channels));const r=toPrecision(o[0],6),s=toPrecision(o[1],6),l=toPrecision(o[2],6),i=[a.TokenType.Function,"oklch(",-1,-1,{value:"oklch"}],u=[a.TokenType.Whitespace," ",-1,-1,void 0];return serializeWithAlpha(e,i,u,[new t.TokenNode([a.TokenType.Number,r.toString(),-1,-1,{value:o[0],type:a.NumberType.Number}]),new t.WhitespaceNode([u]),new t.TokenNode([a.TokenType.Number,s.toString(),-1,-1,{value:o[1],type:a.NumberType.Number}]),new t.WhitespaceNode([u]),new t.TokenNode([a.TokenType.Number,l.toString(),-1,-1,{value:o[2],type:a.NumberType.Number}])])},exports.serializeP3=function serializeP3(e,o=!0){e.channels=convertPowerlessComponentsToZeroValuesForDisplay(e.channels,e.colorNotation);let r=e.channels.map((e=>Number.isNaN(e)?0:e));o?r=XYZ_D50_to_P3_Gamut(colorData_to_XYZ_D50(e).channels):e.colorNotation!==exports.ColorNotation.Display_P3&&(r=n.XYZ_D50_to_P3(colorData_to_XYZ_D50(e).channels));const s=o?Math.min(1,Math.max(0,toPrecision(r[0],6))):toPrecision(r[0],6),l=o?Math.min(1,Math.max(0,toPrecision(r[1],6))):toPrecision(r[1],6),i=o?Math.min(1,Math.max(0,toPrecision(r[2],6))):toPrecision(r[2],6),u=[a.TokenType.Function,"color(",-1,-1,{value:"color"}],c=[a.TokenType.Whitespace," ",-1,-1,void 0];return serializeWithAlpha(e,u,c,[new t.TokenNode([a.TokenType.Ident,"display-p3",-1,-1,{value:"display-p3"}]),new t.WhitespaceNode([c]),new t.TokenNode([a.TokenType.Number,s.toString(),-1,-1,{value:r[0],type:a.NumberType.Number}]),new t.WhitespaceNode([c]),new t.TokenNode([a.TokenType.Number,l.toString(),-1,-1,{value:r[1],type:a.NumberType.Number}]),new t.WhitespaceNode([c]),new t.TokenNode([a.TokenType.Number,i.toString(),-1,-1,{value:r[2],type:a.NumberType.Number}])])},exports.serializeRGB=function serializeRGB(e,o=!0){e.channels=convertPowerlessComponentsToZeroValuesForDisplay(e.channels,e.colorNotation);let r=e.channels.map((e=>Number.isNaN(e)?0:e));r=o?XYZ_D50_to_sRGB_Gamut(colorData_to_XYZ_D50(e).channels):n.XYZ_D50_to_sRGB(colorData_to_XYZ_D50(e).channels);const s=Math.min(255,Math.max(0,Math.round(255*toPrecision(r[0])))),l=Math.min(255,Math.max(0,Math.round(255*toPrecision(r[1])))),i=Math.min(255,Math.max(0,Math.round(255*toPrecision(r[2])))),u=[a.TokenType.CloseParen,")",-1,-1,void 0],c=[a.TokenType.Whitespace," ",-1,-1,void 0],p=[a.TokenType.Comma,",",-1,-1,void 0],N=[new t.TokenNode([a.TokenType.Number,s.toString(),-1,-1,{value:Math.min(255,255*Math.max(0,r[0])),type:a.NumberType.Integer}]),new t.TokenNode(p),new t.WhitespaceNode([c]),new t.TokenNode([a.TokenType.Number,l.toString(),-1,-1,{value:Math.min(255,255*Math.max(0,r[1])),type:a.NumberType.Integer}]),new t.TokenNode(p),new t.WhitespaceNode([c]),new t.TokenNode([a.TokenType.Number,i.toString(),-1,-1,{value:Math.min(255,255*Math.max(0,r[2])),type:a.NumberType.Integer}])];if("number"==typeof e.alpha){const o=Math.min(1,Math.max(0,toPrecision(Number.isNaN(e.alpha)?0:e.alpha)));return 1===toPrecision(o,4)?new t.FunctionNode([a.TokenType.Function,"rgb(",-1,-1,{value:"rgb"}],u,N):new t.FunctionNode([a.TokenType.Function,"rgba(",-1,-1,{value:"rgba"}],u,[...N,new t.TokenNode(p),new t.WhitespaceNode([c]),new t.TokenNode([a.TokenType.Number,toPrecision(o,4).toString(),-1,-1,{value:e.alpha,type:a.NumberType.Number}])])}return new t.FunctionNode([a.TokenType.Function,"rgba(",-1,-1,{value:"rgba"}],u,[...N,new t.TokenNode(p),new t.WhitespaceNode([c]),e.alpha])};
+"use strict";var e,o,a=require("@csstools/css-tokenizer"),n=require("@csstools/color-helpers"),t=require("@csstools/css-parser-algorithms"),r=require("@csstools/css-calc");function convertNaNToZero(e){return[Number.isNaN(e[0])?0:e[0],Number.isNaN(e[1])?0:e[1],Number.isNaN(e[2])?0:e[2]]}function colorData_to_XYZ_D50(e){switch(e.colorNotation){case exports.ColorNotation.HEX:case exports.ColorNotation.RGB:case exports.ColorNotation.sRGB:return{...e,colorNotation:exports.ColorNotation.XYZ_D50,channels:n.sRGB_to_XYZ_D50(convertNaNToZero(e.channels))};case exports.ColorNotation.Linear_sRGB:return{...e,colorNotation:exports.ColorNotation.XYZ_D50,channels:n.lin_sRGB_to_XYZ_D50(convertNaNToZero(e.channels))};case exports.ColorNotation.Display_P3:return{...e,colorNotation:exports.ColorNotation.XYZ_D50,channels:n.P3_to_XYZ_D50(convertNaNToZero(e.channels))};case exports.ColorNotation.Rec2020:return{...e,colorNotation:exports.ColorNotation.XYZ_D50,channels:n.rec_2020_to_XYZ_D50(convertNaNToZero(e.channels))};case exports.ColorNotation.A98_RGB:return{...e,colorNotation:exports.ColorNotation.XYZ_D50,channels:n.a98_RGB_to_XYZ_D50(convertNaNToZero(e.channels))};case exports.ColorNotation.ProPhoto_RGB:return{...e,colorNotation:exports.ColorNotation.XYZ_D50,channels:n.ProPhoto_RGB_to_XYZ_D50(convertNaNToZero(e.channels))};case exports.ColorNotation.HSL:return{...e,colorNotation:exports.ColorNotation.XYZ_D50,channels:n.HSL_to_XYZ_D50(convertNaNToZero(e.channels))};case exports.ColorNotation.HWB:return{...e,colorNotation:exports.ColorNotation.XYZ_D50,channels:n.HWB_to_XYZ_D50(convertNaNToZero(e.channels))};case exports.ColorNotation.Lab:return{...e,colorNotation:exports.ColorNotation.XYZ_D50,channels:n.Lab_to_XYZ_D50(convertNaNToZero(e.channels))};case exports.ColorNotation.OKLab:return{...e,colorNotation:exports.ColorNotation.XYZ_D50,channels:n.OKLab_to_XYZ_D50(convertNaNToZero(e.channels))};case exports.ColorNotation.LCH:return{...e,colorNotation:exports.ColorNotation.XYZ_D50,channels:n.LCH_to_XYZ_D50(convertNaNToZero(e.channels))};case exports.ColorNotation.OKLCH:return{...e,colorNotation:exports.ColorNotation.XYZ_D50,channels:n.OKLCH_to_XYZ_D50(convertNaNToZero(e.channels))};case exports.ColorNotation.XYZ_D50:return{...e,colorNotation:exports.ColorNotation.XYZ_D50,channels:n.XYZ_D50_to_XYZ_D50(convertNaNToZero(e.channels))};case exports.ColorNotation.XYZ_D65:return{...e,colorNotation:exports.ColorNotation.XYZ_D50,channels:n.XYZ_D65_to_XYZ_D50(convertNaNToZero(e.channels))};default:throw new Error("Unsupported color notation")}}exports.ColorNotation=void 0,(e=exports.ColorNotation||(exports.ColorNotation={})).A98_RGB="a98-rgb",e.Display_P3="display-p3",e.HEX="hex",e.HSL="hsl",e.HWB="hwb",e.LCH="lch",e.Lab="lab",e.Linear_sRGB="srgb-linear",e.OKLCH="oklch",e.OKLab="oklab",e.ProPhoto_RGB="prophoto-rgb",e.RGB="rgb",e.sRGB="srgb",e.Rec2020="rec2020",e.XYZ_D50="xyz-d50",e.XYZ_D65="xyz-d65",exports.SyntaxFlag=void 0,(o=exports.SyntaxFlag||(exports.SyntaxFlag={})).ColorKeyword="color-keyword",o.HasAlpha="has-alpha",o.HasDimensionValues="has-dimension-values",o.HasNoneKeywords="has-none-keywords",o.HasNumberValues="has-number-values",o.HasPercentageAlpha="has-percentage-alpha",o.HasPercentageValues="has-percentage-values",o.HasVariableAlpha="has-variable-alpha",o.Hex="hex",o.LegacyHSL="legacy-hsl",o.LegacyRGB="legacy-rgb",o.NamedColor="named-color",o.RelativeColorSyntax="relative-color-syntax",o.ColorMix="color-mix",o.ContrastColor="contrast-color",o.Experimental="experimental";const s=new Set([exports.ColorNotation.A98_RGB,exports.ColorNotation.Display_P3,exports.ColorNotation.HEX,exports.ColorNotation.Linear_sRGB,exports.ColorNotation.ProPhoto_RGB,exports.ColorNotation.RGB,exports.ColorNotation.sRGB,exports.ColorNotation.Rec2020,exports.ColorNotation.XYZ_D50,exports.ColorNotation.XYZ_D65]);function colorDataTo(e,o){const a={...e};if(e.colorNotation!==o){const e=colorData_to_XYZ_D50(a);switch(o){case exports.ColorNotation.HEX:case exports.ColorNotation.RGB:a.colorNotation=exports.ColorNotation.RGB,a.channels=n.XYZ_D50_to_sRGB(e.channels);break;case exports.ColorNotation.sRGB:a.colorNotation=exports.ColorNotation.sRGB,a.channels=n.XYZ_D50_to_sRGB(e.channels);break;case exports.ColorNotation.Linear_sRGB:a.colorNotation=exports.ColorNotation.Linear_sRGB,a.channels=n.XYZ_D50_to_lin_sRGB(e.channels);break;case exports.ColorNotation.Display_P3:a.colorNotation=exports.ColorNotation.Display_P3,a.channels=n.XYZ_D50_to_P3(e.channels);break;case exports.ColorNotation.Rec2020:a.colorNotation=exports.ColorNotation.Rec2020,a.channels=n.XYZ_D50_to_rec_2020(e.channels);break;case exports.ColorNotation.ProPhoto_RGB:a.colorNotation=exports.ColorNotation.ProPhoto_RGB,a.channels=n.XYZ_D50_to_ProPhoto(e.channels);break;case exports.ColorNotation.A98_RGB:a.colorNotation=exports.ColorNotation.A98_RGB,a.channels=n.XYZ_D50_to_a98_RGB(e.channels);break;case exports.ColorNotation.HSL:a.colorNotation=exports.ColorNotation.HSL,a.channels=n.XYZ_D50_to_HSL(e.channels);break;case exports.ColorNotation.HWB:a.colorNotation=exports.ColorNotation.HWB,a.channels=n.XYZ_D50_to_HWB(e.channels);break;case exports.ColorNotation.Lab:a.colorNotation=exports.ColorNotation.Lab,a.channels=n.XYZ_D50_to_Lab(e.channels);break;case exports.ColorNotation.LCH:a.colorNotation=exports.ColorNotation.LCH,a.channels=n.XYZ_D50_to_LCH(e.channels);break;case exports.ColorNotation.OKLCH:a.colorNotation=exports.ColorNotation.OKLCH,a.channels=n.XYZ_D50_to_OKLCH(e.channels);break;case exports.ColorNotation.OKLab:a.colorNotation=exports.ColorNotation.OKLab,a.channels=n.XYZ_D50_to_OKLab(e.channels);break;case exports.ColorNotation.XYZ_D50:a.colorNotation=exports.ColorNotation.XYZ_D50,a.channels=n.XYZ_D50_to_XYZ_D50(e.channels);break;case exports.ColorNotation.XYZ_D65:a.colorNotation=exports.ColorNotation.XYZ_D65,a.channels=n.XYZ_D50_to_XYZ_D65(e.channels);break;default:throw new Error("Unsupported color notation")}}else a.channels=convertNaNToZero(e.channels);if(o===e.colorNotation)a.channels=carryForwardMissingComponents(e.channels,[0,1,2],a.channels,[0,1,2]);else if(s.has(o)&&s.has(e.colorNotation))a.channels=carryForwardMissingComponents(e.channels,[0,1,2],a.channels,[0,1,2]);else switch(o){case exports.ColorNotation.HSL:switch(e.colorNotation){case exports.ColorNotation.HWB:a.channels=carryForwardMissingComponents(e.channels,[0],a.channels,[0]);break;case exports.ColorNotation.Lab:case exports.ColorNotation.OKLab:a.channels=carryForwardMissingComponents(e.channels,[2],a.channels,[0]);break;case exports.ColorNotation.LCH:case exports.ColorNotation.OKLCH:a.channels=carryForwardMissingComponents(e.channels,[0,1,2],a.channels,[2,1,0])}break;case exports.ColorNotation.HWB:switch(e.colorNotation){case exports.ColorNotation.HSL:a.channels=carryForwardMissingComponents(e.channels,[0],a.channels,[0]);break;case exports.ColorNotation.LCH:case exports.ColorNotation.OKLCH:a.channels=carryForwardMissingComponents(e.channels,[0],a.channels,[2])}break;case exports.ColorNotation.Lab:case exports.ColorNotation.OKLab:switch(e.colorNotation){case exports.ColorNotation.HSL:a.channels=carryForwardMissingComponents(e.channels,[0],a.channels,[2]);break;case exports.ColorNotation.Lab:case exports.ColorNotation.OKLab:a.channels=carryForwardMissingComponents(e.channels,[0,1,2],a.channels,[0,1,2]);break;case exports.ColorNotation.LCH:case exports.ColorNotation.OKLCH:a.channels=carryForwardMissingComponents(e.channels,[0],a.channels,[0])}break;case exports.ColorNotation.LCH:case exports.ColorNotation.OKLCH:switch(e.colorNotation){case exports.ColorNotation.HSL:a.channels=carryForwardMissingComponents(e.channels,[0,1,2],a.channels,[2,1,0]);break;case exports.ColorNotation.HWB:a.channels=carryForwardMissingComponents(e.channels,[0],a.channels,[2]);break;case exports.ColorNotation.Lab:case exports.ColorNotation.OKLab:a.channels=carryForwardMissingComponents(e.channels,[0],a.channels,[0]);break;case exports.ColorNotation.LCH:case exports.ColorNotation.OKLCH:a.channels=carryForwardMissingComponents(e.channels,[0,1,2],a.channels,[0,1,2])}}return a.channels=convertPowerlessComponentsToMissingComponents(a.channels,o),a}function convertPowerlessComponentsToMissingComponents(e,o){const a=[...e];switch(o){case exports.ColorNotation.HSL:!Number.isNaN(a[1])&&reducePrecision(a[1],4)<=0&&(a[0]=NaN);break;case exports.ColorNotation.HWB:Math.max(0,reducePrecision(a[1],4))+Math.max(0,reducePrecision(a[2],4))>=100&&(a[0]=NaN);break;case exports.ColorNotation.LCH:!Number.isNaN(a[1])&&reducePrecision(a[1],4)<=0&&(a[2]=NaN);break;case exports.ColorNotation.OKLCH:!Number.isNaN(a[1])&&reducePrecision(a[1],6)<=0&&(a[2]=NaN)}return a}function convertPowerlessComponentsToZeroValuesForDisplay(e,o){const a=[...e];switch(o){case exports.ColorNotation.HSL:(reducePrecision(a[2])<=0||reducePrecision(a[2])>=100)&&(a[0]=NaN,a[1]=NaN),reducePrecision(a[1])<=0&&(a[0]=NaN);break;case exports.ColorNotation.HWB:Math.max(0,reducePrecision(a[1]))+Math.max(0,reducePrecision(a[2]))>=100&&(a[0]=NaN);break;case exports.ColorNotation.Lab:(reducePrecision(a[0])<=0||reducePrecision(a[0])>=100)&&(a[1]=NaN,a[2]=NaN);break;case exports.ColorNotation.LCH:reducePrecision(a[1])<=0&&(a[2]=NaN),(reducePrecision(a[0])<=0||reducePrecision(a[0])>=100)&&(a[1]=NaN,a[2]=NaN);break;case exports.ColorNotation.OKLab:(reducePrecision(a[0])<=0||reducePrecision(a[0])>=1)&&(a[1]=NaN,a[2]=NaN);break;case exports.ColorNotation.OKLCH:reducePrecision(a[1])<=0&&(a[2]=NaN),(reducePrecision(a[0])<=0||reducePrecision(a[0])>=1)&&(a[1]=NaN,a[2]=NaN)}return a}function carryForwardMissingComponents(e,o,a,n){const t=[...a];for(const a of o)Number.isNaN(e[o[a]])&&(t[n[a]]=NaN);return t}function normalizeRelativeColorDataChannels(e){const o=new Map;switch(e.colorNotation){case exports.ColorNotation.RGB:case exports.ColorNotation.HEX:o.set("r",dummyNumberToken(255*e.channels[0])),o.set("g",dummyNumberToken(255*e.channels[1])),o.set("b",dummyNumberToken(255*e.channels[2])),"number"==typeof e.alpha&&o.set("alpha",dummyNumberToken(e.alpha));break;case exports.ColorNotation.HSL:o.set("h",dummyNumberToken(e.channels[0])),o.set("s",dummyNumberToken(e.channels[1])),o.set("l",dummyNumberToken(e.channels[2])),"number"==typeof e.alpha&&o.set("alpha",dummyNumberToken(e.alpha));break;case exports.ColorNotation.HWB:o.set("h",dummyNumberToken(e.channels[0])),o.set("w",dummyNumberToken(e.channels[1])),o.set("b",dummyNumberToken(e.channels[2])),"number"==typeof e.alpha&&o.set("alpha",dummyNumberToken(e.alpha));break;case exports.ColorNotation.Lab:case exports.ColorNotation.OKLab:o.set("l",dummyNumberToken(e.channels[0])),o.set("a",dummyNumberToken(e.channels[1])),o.set("b",dummyNumberToken(e.channels[2])),"number"==typeof e.alpha&&o.set("alpha",dummyNumberToken(e.alpha));break;case exports.ColorNotation.LCH:case exports.ColorNotation.OKLCH:o.set("l",dummyNumberToken(e.channels[0])),o.set("c",dummyNumberToken(e.channels[1])),o.set("h",dummyNumberToken(e.channels[2])),"number"==typeof e.alpha&&o.set("alpha",dummyNumberToken(e.alpha));break;case exports.ColorNotation.sRGB:case exports.ColorNotation.A98_RGB:case exports.ColorNotation.Display_P3:case exports.ColorNotation.Rec2020:case exports.ColorNotation.Linear_sRGB:case exports.ColorNotation.ProPhoto_RGB:o.set("r",dummyNumberToken(e.channels[0])),o.set("g",dummyNumberToken(e.channels[1])),o.set("b",dummyNumberToken(e.channels[2])),"number"==typeof e.alpha&&o.set("alpha",dummyNumberToken(e.alpha));break;case exports.ColorNotation.XYZ_D50:case exports.ColorNotation.XYZ_D65:o.set("x",dummyNumberToken(e.channels[0])),o.set("y",dummyNumberToken(e.channels[1])),o.set("z",dummyNumberToken(e.channels[2])),"number"==typeof e.alpha&&o.set("alpha",dummyNumberToken(e.alpha))}return o}function noneToZeroInRelativeColorDataChannels(e){const o=new Map(e);for(const[a,n]of e)Number.isNaN(n[4].value)&&o.set(a,dummyNumberToken(0));return o}function dummyNumberToken(e){return Number.isNaN(e)?[a.TokenType.Number,"none",-1,-1,{value:Number.NaN,type:a.NumberType.Number}]:[a.TokenType.Number,e.toString(),-1,-1,{value:e,type:a.NumberType.Number}]}function reducePrecision(e,o=7){if(Number.isNaN(e))return 0;const a=Math.pow(10,o);return Math.round(e*a)/a}function normalize(e,o,a,n){return Math.min(Math.max(e/o,a),n)}const l=/[A-Z]/g;function toLowerCaseAZ(e){return e.replace(l,(e=>String.fromCharCode(e.charCodeAt(0)+32)))}function normalize_Color_ChannelValues(e,o,n){if(a.isTokenIdent(e)&&"none"===toLowerCaseAZ(e[4].value))return n.syntaxFlags.add(exports.SyntaxFlag.HasNoneKeywords),[a.TokenType.Number,"none",e[2],e[3],{value:NaN,type:a.NumberType.Number}];if(a.isTokenPercentage(e)){3!==o&&n.syntaxFlags.add(exports.SyntaxFlag.HasPercentageValues);let t=normalize(e[4].value,100,-2147483647,2147483647);return 3===o&&(t=normalize(e[4].value,100,0,1)),[a.TokenType.Number,t.toString(),e[2],e[3],{value:t,type:a.NumberType.Number}]}if(a.isTokenNumber(e)){3!==o&&n.syntaxFlags.add(exports.SyntaxFlag.HasNumberValues);let t=normalize(e[4].value,1,-2147483647,2147483647);return 3===o&&(t=normalize(e[4].value,1,0,1)),[a.TokenType.Number,t.toString(),e[2],e[3],{value:t,type:a.NumberType.Number}]}return!1}const i=new Set(["srgb","srgb-linear","display-p3","a98-rgb","prophoto-rgb","rec2020","xyz","xyz-d50","xyz-d65"]);function color$1(e,o){const n=[],s=[],l=[],u=[];let c,p,N=!1,m=!1;const h={colorNotation:exports.ColorNotation.sRGB,channels:[0,0,0],alpha:1,syntaxFlags:new Set([])};let x=n;for(let y=0;y=0){i=u.value[4].value;continue}}return!1}if(!l)return!1;n.push({color:l,percentage:i}),l=!1,i=!1}}if(l&&n.push({color:l,percentage:i}),2!==n.length)return!1;let u=n[0].percentage,c=n[1].percentage;return(!1===u||!(u<0||u>100))&&((!1===c||!(c<0||c>100))&&(!1===u&&!1===c?(u=50,c=50):!1!==u&&!1===c?c=100-u:!1===u&&!1!==c&&(u=100-c),(0!==u||0!==c)&&(!1!==u&&!1!==c&&(u+c>100&&(u=u/(u+c)*100,c=c/(u+c)*100),u+c<100&&(s=(u+c)/100,u=u/(u+c)*100,c=c/(u+c)*100),{a:{color:n[0].color,percentage:u},b:{color:n[1].color,percentage:c},alphaMultiplier:s}))))}function colorMixRectangular(e,o){if(!o)return!1;const a=o.a.color,n=o.b.color,t=o.a.percentage/100;let r=a.channels,s=n.channels,l=exports.ColorNotation.RGB,i=a.alpha;if("number"!=typeof i)return!1;let u=n.alpha;if("number"!=typeof u)return!1;switch(i=Number.isNaN(i)?u:i,u=Number.isNaN(u)?i:u,e){case"srgb":l=exports.ColorNotation.RGB;break;case"srgb-linear":l=exports.ColorNotation.Linear_sRGB;break;case"display-p3":l=exports.ColorNotation.Display_P3;break;case"a98-rgb":l=exports.ColorNotation.A98_RGB;break;case"prophoto-rgb":l=exports.ColorNotation.ProPhoto_RGB;break;case"rec2020":l=exports.ColorNotation.Rec2020;break;case"lab":l=exports.ColorNotation.Lab;break;case"oklab":l=exports.ColorNotation.OKLab;break;case"xyz-d50":l=exports.ColorNotation.XYZ_D50;break;case"xyz":case"xyz-d65":l=exports.ColorNotation.XYZ_D65}r=colorDataTo(a,l).channels,s=colorDataTo(n,l).channels,r[0]=fillInMissingComponent(r[0],s[0]),s[0]=fillInMissingComponent(s[0],r[0]),r[1]=fillInMissingComponent(r[1],s[1]),s[1]=fillInMissingComponent(s[1],r[1]),r[2]=fillInMissingComponent(r[2],s[2]),s[2]=fillInMissingComponent(s[2],r[2]),r[0]=premultiply(r[0],i),r[1]=premultiply(r[1],i),r[2]=premultiply(r[2],i),s[0]=premultiply(s[0],u),s[1]=premultiply(s[1],u),s[2]=premultiply(s[2],u);const c=interpolate(i,u,t),p={colorNotation:l,channels:[un_premultiply(interpolate(r[0],s[0],t),c),un_premultiply(interpolate(r[1],s[1],t),c),un_premultiply(interpolate(r[2],s[2],t),c)],alpha:c*o.alphaMultiplier,syntaxFlags:new Set([exports.SyntaxFlag.ColorMix])};return(o.a.color.syntaxFlags.has(exports.SyntaxFlag.Experimental)||o.b.color.syntaxFlags.has(exports.SyntaxFlag.Experimental))&&p.syntaxFlags.add(exports.SyntaxFlag.Experimental),p}function colorMixPolar(e,o,a){if(!a)return!1;const n=a.a.color,t=a.b.color,r=a.a.percentage/100;let s=n.channels,l=t.channels,i=0,u=0,c=0,p=0,N=0,m=0,h=exports.ColorNotation.RGB,x=n.alpha;if("number"!=typeof x)return!1;let y=t.alpha;if("number"!=typeof y)return!1;switch(x=Number.isNaN(x)?y:x,y=Number.isNaN(y)?x:y,e){case"hsl":h=exports.ColorNotation.HSL;break;case"hwb":h=exports.ColorNotation.HWB;break;case"lch":h=exports.ColorNotation.LCH;break;case"oklch":h=exports.ColorNotation.OKLCH}switch(s=colorDataTo(n,h).channels,l=colorDataTo(t,h).channels,e){case"hsl":case"hwb":i=s[0],u=l[0],c=s[1],p=l[1],N=s[2],m=l[2];break;case"lch":case"oklch":c=s[0],p=l[0],N=s[1],m=l[1],i=s[2],u=l[2]}i=fillInMissingComponent(i,u),Number.isNaN(i)&&(i=0),u=fillInMissingComponent(u,i),Number.isNaN(u)&&(u=0),c=fillInMissingComponent(c,p),p=fillInMissingComponent(p,c),N=fillInMissingComponent(N,m),m=fillInMissingComponent(m,N);const b=u-i;switch(o){case"shorter":b>180?i+=360:b<-180&&(u+=360);break;case"longer":-180<180&&(b>0?i+=360:u+=360);break;case"increasing":b<0&&(u+=360);break;case"decreasing":b>0&&(i+=360);break;default:throw new Error("Unknown hue interpolation method")}c=premultiply(c,x),N=premultiply(N,x),p=premultiply(p,y),m=premultiply(m,y);let C=[0,0,0];const d=interpolate(x,y,r);switch(e){case"hsl":case"hwb":C=[interpolate(i,u,r),un_premultiply(interpolate(c,p,r),d),un_premultiply(interpolate(N,m,r),d)];break;case"lch":case"oklch":C=[un_premultiply(interpolate(c,p,r),d),un_premultiply(interpolate(N,m,r),d),interpolate(i,u,r)]}const T={colorNotation:h,channels:C,alpha:d*a.alphaMultiplier,syntaxFlags:new Set([exports.SyntaxFlag.ColorMix])};return(a.a.color.syntaxFlags.has(exports.SyntaxFlag.Experimental)||a.b.color.syntaxFlags.has(exports.SyntaxFlag.Experimental))&&T.syntaxFlags.add(exports.SyntaxFlag.Experimental),T}function fillInMissingComponent(e,o){return Number.isNaN(e)?o:e}function interpolate(e,o,a){return e*a+o*(1-a)}function premultiply(e,o){return Number.isNaN(o)?e:Number.isNaN(e)?NaN:e*o}function un_premultiply(e,o){return 0===o||Number.isNaN(o)?e:Number.isNaN(e)?NaN:e/o}function hex(e){const o=toLowerCaseAZ(e[4].value);if(o.match(/[^a-f0-9]/))return!1;const a={colorNotation:exports.ColorNotation.HEX,channels:[0,0,0],alpha:1,syntaxFlags:new Set([exports.SyntaxFlag.Hex])},n=o.length;if(3===n){const e=o[0],n=o[1],t=o[2];return a.channels=[parseInt(e+e,16)/255,parseInt(n+n,16)/255,parseInt(t+t,16)/255],a}if(6===n){const e=o[0]+o[1],n=o[2]+o[3],t=o[4]+o[5];return a.channels=[parseInt(e,16)/255,parseInt(n,16)/255,parseInt(t,16)/255],a}if(4===n){const e=o[0],n=o[1],t=o[2],r=o[3];return a.channels=[parseInt(e+e,16)/255,parseInt(n+n,16)/255,parseInt(t+t,16)/255],a.alpha=parseInt(r+r,16)/255,a.syntaxFlags.add(exports.SyntaxFlag.HasAlpha),a}if(8===n){const e=o[0]+o[1],n=o[2]+o[3],t=o[4]+o[5],r=o[6]+o[7];return a.channels=[parseInt(e,16)/255,parseInt(n,16)/255,parseInt(t,16)/255],a.alpha=parseInt(r,16)/255,a.syntaxFlags.add(exports.SyntaxFlag.HasAlpha),a}return!1}function normalizeHue(e){if(a.isTokenNumber(e))return e[4].value=e[4].value%360,e[1]=e[4].value.toString(),e;if(a.isTokenDimension(e)){let o=e[4].value;switch(toLowerCaseAZ(e[4].unit)){case"deg":break;case"rad":o=180*e[4].value/Math.PI;break;case"grad":o=.9*e[4].value;break;case"turn":o=360*e[4].value;break;default:return!1}return o%=360,[a.TokenType.Number,o.toString(),e[2],e[3],{value:o,type:a.NumberType.Number}]}return!1}function normalize_legacy_HSL_ChannelValues(e,o,n){if(0===o){const o=normalizeHue(e);return!1!==o&&(a.isTokenDimension(e)&&n.syntaxFlags.add(exports.SyntaxFlag.HasDimensionValues),o)}if(a.isTokenPercentage(e)){3===o?n.syntaxFlags.add(exports.SyntaxFlag.HasPercentageAlpha):n.syntaxFlags.add(exports.SyntaxFlag.HasPercentageValues);let t=normalize(e[4].value,1,0,100);return 3===o&&(t=normalize(e[4].value,100,0,1)),[a.TokenType.Number,t.toString(),e[2],e[3],{value:t,type:a.NumberType.Number}]}if(a.isTokenNumber(e)){if(3!==o)return!1;let n=normalize(e[4].value,1,0,100);return 3===o&&(n=normalize(e[4].value,1,0,1)),[a.TokenType.Number,n.toString(),e[2],e[3],{value:n,type:a.NumberType.Number}]}return!1}function normalize_modern_HSL_ChannelValues(e,o,n){if(a.isTokenIdent(e)&&"none"===toLowerCaseAZ(e[4].value))return n.syntaxFlags.add(exports.SyntaxFlag.HasNoneKeywords),[a.TokenType.Number,"none",e[2],e[3],{value:NaN,type:a.NumberType.Number}];if(0===o){const o=normalizeHue(e);return!1!==o&&(a.isTokenDimension(e)&&n.syntaxFlags.add(exports.SyntaxFlag.HasDimensionValues),o)}if(a.isTokenPercentage(e)){3===o?n.syntaxFlags.add(exports.SyntaxFlag.HasPercentageAlpha):n.syntaxFlags.add(exports.SyntaxFlag.HasPercentageValues);let t=e[4].value;return 3===o?t=normalize(e[4].value,100,0,1):1===o&&(t=normalize(e[4].value,1,0,2147483647)),[a.TokenType.Number,t.toString(),e[2],e[3],{value:t,type:a.NumberType.Number}]}if(a.isTokenNumber(e)){3!==o&&n.syntaxFlags.add(exports.SyntaxFlag.HasNumberValues);let t=e[4].value;return 3===o?t=normalize(e[4].value,1,0,1):1===o&&(t=normalize(e[4].value,1,0,2147483647)),[a.TokenType.Number,t.toString(),e[2],e[3],{value:t,type:a.NumberType.Number}]}return!1}function threeChannelLegacySyntax(e,o,n,s){const l=[],i=[],u=[],c=[],p={colorNotation:n,channels:[0,0,0],alpha:1,syntaxFlags:new Set(s)};let N=l;for(let o=0;ot.isTokenNode(e)&&a.isTokenComma(e.value)))){const o=hslCommaSeparated(e);if(!1!==o)return o}{const a=hslSpaceSeparated(e,o);if(!1!==a)return a}return!1}function hslCommaSeparated(e){return threeChannelLegacySyntax(e,normalize_legacy_HSL_ChannelValues,exports.ColorNotation.HSL,[exports.SyntaxFlag.LegacyHSL])}function hslSpaceSeparated(e,o){return threeChannelSpaceSeparated(e,normalize_modern_HSL_ChannelValues,exports.ColorNotation.HSL,[],o)}function normalize_HWB_ChannelValues(e,o,n){if(a.isTokenIdent(e)&&"none"===toLowerCaseAZ(e[4].value))return n.syntaxFlags.add(exports.SyntaxFlag.HasNoneKeywords),[a.TokenType.Number,"none",e[2],e[3],{value:NaN,type:a.NumberType.Number}];if(0===o){const o=normalizeHue(e);return!1!==o&&(a.isTokenDimension(e)&&n.syntaxFlags.add(exports.SyntaxFlag.HasDimensionValues),o)}if(a.isTokenPercentage(e)){3===o?n.syntaxFlags.add(exports.SyntaxFlag.HasPercentageAlpha):n.syntaxFlags.add(exports.SyntaxFlag.HasPercentageValues);let t=e[4].value;return 3===o&&(t=normalize(e[4].value,100,0,1)),[a.TokenType.Number,t.toString(),e[2],e[3],{value:t,type:a.NumberType.Number}]}if(a.isTokenNumber(e)){3!==o&&n.syntaxFlags.add(exports.SyntaxFlag.HasNumberValues);let t=e[4].value;return 3===o&&(t=normalize(e[4].value,1,0,1)),[a.TokenType.Number,t.toString(),e[2],e[3],{value:t,type:a.NumberType.Number}]}return!1}function normalize_Lab_ChannelValues(e,o,n){if(a.isTokenIdent(e)&&"none"===toLowerCaseAZ(e[4].value))return n.syntaxFlags.add(exports.SyntaxFlag.HasNoneKeywords),[a.TokenType.Number,"none",e[2],e[3],{value:NaN,type:a.NumberType.Number}];if(a.isTokenPercentage(e)){3!==o&&n.syntaxFlags.add(exports.SyntaxFlag.HasPercentageValues);let t=normalize(e[4].value,1,0,100);return 1===o||2===o?t=normalize(e[4].value,.8,-2147483647,2147483647):3===o&&(t=normalize(e[4].value,100,0,1)),[a.TokenType.Number,t.toString(),e[2],e[3],{value:t,type:a.NumberType.Number}]}if(a.isTokenNumber(e)){3!==o&&n.syntaxFlags.add(exports.SyntaxFlag.HasNumberValues);let t=normalize(e[4].value,1,0,100);return 1===o||2===o?t=normalize(e[4].value,1,-2147483647,2147483647):3===o&&(t=normalize(e[4].value,1,0,1)),[a.TokenType.Number,t.toString(),e[2],e[3],{value:t,type:a.NumberType.Number}]}return!1}function lab(e,o){return threeChannelSpaceSeparated(e,normalize_Lab_ChannelValues,exports.ColorNotation.Lab,[],o)}function normalize_LCH_ChannelValues(e,o,n){if(a.isTokenIdent(e)&&"none"===toLowerCaseAZ(e[4].value))return n.syntaxFlags.add(exports.SyntaxFlag.HasNoneKeywords),[a.TokenType.Number,"none",e[2],e[3],{value:NaN,type:a.NumberType.Number}];if(2===o){const o=normalizeHue(e);return!1!==o&&(a.isTokenDimension(e)&&n.syntaxFlags.add(exports.SyntaxFlag.HasDimensionValues),o)}if(a.isTokenPercentage(e)){3!==o&&n.syntaxFlags.add(exports.SyntaxFlag.HasPercentageValues);let t=normalize(e[4].value,1,0,100);return 1===o?t=normalize(e[4].value,100/150,0,2147483647):3===o&&(t=normalize(e[4].value,100,0,1)),[a.TokenType.Number,t.toString(),e[2],e[3],{value:t,type:a.NumberType.Number}]}if(a.isTokenNumber(e)){3!==o&&n.syntaxFlags.add(exports.SyntaxFlag.HasNumberValues);let t=normalize(e[4].value,1,0,100);return 1===o?t=normalize(e[4].value,1,0,2147483647):3===o&&(t=normalize(e[4].value,1,0,1)),[a.TokenType.Number,t.toString(),e[2],e[3],{value:t,type:a.NumberType.Number}]}return!1}function lch(e,o){return threeChannelSpaceSeparated(e,normalize_LCH_ChannelValues,exports.ColorNotation.LCH,[],o)}const N=new Map;for(const[e,o]of Object.entries(n.namedColors))N.set(e,o);function namedColor(e){const o=N.get(toLowerCaseAZ(e));return!!o&&{colorNotation:exports.ColorNotation.RGB,channels:[o[0]/255,o[1]/255,o[2]/255],alpha:1,syntaxFlags:new Set([exports.SyntaxFlag.ColorKeyword,exports.SyntaxFlag.NamedColor])}}function normalize_OKLab_ChannelValues(e,o,n){if(a.isTokenIdent(e)&&"none"===toLowerCaseAZ(e[4].value))return n.syntaxFlags.add(exports.SyntaxFlag.HasNoneKeywords),[a.TokenType.Number,"none",e[2],e[3],{value:NaN,type:a.NumberType.Number}];if(a.isTokenPercentage(e)){3!==o&&n.syntaxFlags.add(exports.SyntaxFlag.HasPercentageValues);let t=normalize(e[4].value,100,0,1);return 1===o||2===o?t=normalize(e[4].value,250,-2147483647,2147483647):3===o&&(t=normalize(e[4].value,100,0,1)),[a.TokenType.Number,t.toString(),e[2],e[3],{value:t,type:a.NumberType.Number}]}if(a.isTokenNumber(e)){3!==o&&n.syntaxFlags.add(exports.SyntaxFlag.HasNumberValues);let t=normalize(e[4].value,1,0,1);return 1===o||2===o?t=normalize(e[4].value,1,-2147483647,2147483647):3===o&&(t=normalize(e[4].value,1,0,1)),[a.TokenType.Number,t.toString(),e[2],e[3],{value:t,type:a.NumberType.Number}]}return!1}function oklab(e,o){return threeChannelSpaceSeparated(e,normalize_OKLab_ChannelValues,exports.ColorNotation.OKLab,[],o)}function normalize_OKLCH_ChannelValues(e,o,n){if(a.isTokenIdent(e)&&"none"===toLowerCaseAZ(e[4].value))return n.syntaxFlags.add(exports.SyntaxFlag.HasNoneKeywords),[a.TokenType.Number,"none",e[2],e[3],{value:NaN,type:a.NumberType.Number}];if(2===o){const o=normalizeHue(e);return!1!==o&&(a.isTokenDimension(e)&&n.syntaxFlags.add(exports.SyntaxFlag.HasDimensionValues),o)}if(a.isTokenPercentage(e)){3!==o&&n.syntaxFlags.add(exports.SyntaxFlag.HasPercentageValues);let t=normalize(e[4].value,100,0,1);return 1===o?t=normalize(e[4].value,250,0,2147483647):3===o&&(t=normalize(e[4].value,100,0,1)),[a.TokenType.Number,t.toString(),e[2],e[3],{value:t,type:a.NumberType.Number}]}if(a.isTokenNumber(e)){3!==o&&n.syntaxFlags.add(exports.SyntaxFlag.HasNumberValues);let t=normalize(e[4].value,1,0,1);return 1===o?t=normalize(e[4].value,1,0,2147483647):3===o&&(t=normalize(e[4].value,1,0,1)),[a.TokenType.Number,t.toString(),e[2],e[3],{value:t,type:a.NumberType.Number}]}return!1}function oklch(e,o){return threeChannelSpaceSeparated(e,normalize_OKLCH_ChannelValues,exports.ColorNotation.OKLCH,[],o)}function normalize_legacy_sRGB_ChannelValues(e,o,n){if(a.isTokenPercentage(e)){3===o?n.syntaxFlags.add(exports.SyntaxFlag.HasPercentageAlpha):n.syntaxFlags.add(exports.SyntaxFlag.HasPercentageValues);const t=normalize(e[4].value,100,0,1);return[a.TokenType.Number,t.toString(),e[2],e[3],{value:t,type:a.NumberType.Number}]}if(a.isTokenNumber(e)){3!==o&&n.syntaxFlags.add(exports.SyntaxFlag.HasNumberValues);let t=normalize(e[4].value,255,0,1);return 3===o&&(t=normalize(e[4].value,1,0,1)),[a.TokenType.Number,t.toString(),e[2],e[3],{value:t,type:a.NumberType.Number}]}return!1}function normalize_modern_sRGB_ChannelValues(e,o,n){if(a.isTokenIdent(e)&&"none"===e[4].value.toLowerCase())return n.syntaxFlags.add(exports.SyntaxFlag.HasNoneKeywords),[a.TokenType.Number,"none",e[2],e[3],{value:NaN,type:a.NumberType.Number}];if(a.isTokenPercentage(e)){3!==o&&n.syntaxFlags.add(exports.SyntaxFlag.HasPercentageValues);let t=normalize(e[4].value,100,-2147483647,2147483647);return 3===o&&(t=normalize(e[4].value,100,0,1)),[a.TokenType.Number,t.toString(),e[2],e[3],{value:t,type:a.NumberType.Number}]}if(a.isTokenNumber(e)){3!==o&&n.syntaxFlags.add(exports.SyntaxFlag.HasNumberValues);let t=normalize(e[4].value,255,-2147483647,2147483647);return 3===o&&(t=normalize(e[4].value,1,0,1)),[a.TokenType.Number,t.toString(),e[2],e[3],{value:t,type:a.NumberType.Number}]}return!1}function rgb(e,o){if(e.value.some((e=>t.isTokenNode(e)&&a.isTokenComma(e.value)))){const o=rgbCommaSeparated(e);if(!1!==o)return(!o.syntaxFlags.has(exports.SyntaxFlag.HasNumberValues)||!o.syntaxFlags.has(exports.SyntaxFlag.HasPercentageValues))&&o}else{const a=rgbSpaceSeparated(e,o);if(!1!==a)return a}return!1}function rgbCommaSeparated(e){return threeChannelLegacySyntax(e,normalize_legacy_sRGB_ChannelValues,exports.ColorNotation.RGB,[exports.SyntaxFlag.LegacyRGB])}function rgbSpaceSeparated(e,o){return threeChannelSpaceSeparated(e,normalize_modern_sRGB_ChannelValues,exports.ColorNotation.RGB,[],o)}function XYZ_D50_to_sRGB_Gamut(e){const o=n.XYZ_D50_to_sRGB(e);if(n.inGamut(o))return n.clip(o);let a=e;return a=n.XYZ_D50_to_OKLCH(a),a[0]<1e-6&&(a=[0,0,0]),a[0]>.999999&&(a=[1,0,0]),n.gam_sRGB(n.mapGamutRayTrace(a,oklch_to_lin_srgb,lin_srgb_to_oklch))}function oklch_to_lin_srgb(e){return e=n.OKLCH_to_OKLab(e),e=n.OKLab_to_XYZ(e),n.XYZ_to_lin_sRGB(e)}function lin_srgb_to_oklch(e){return e=n.lin_sRGB_to_XYZ(e),e=n.XYZ_to_OKLab(e),n.OKLab_to_OKLCH(e)}function contrastColor(e,o){let r=!1,s=!1;for(let n=0;nu?[1,1,1]:[0,0,0],l}function XYZ_D50_to_P3_Gamut(e){const o=n.XYZ_D50_to_P3(e);if(n.inGamut(o))return n.clip(o);let a=e;return a=n.XYZ_D50_to_OKLCH(a),a[0]<1e-6&&(a=[0,0,0]),a[0]>.999999&&(a=[1,0,0]),n.gam_P3(n.mapGamutRayTrace(a,oklch_to_lin_p3,lin_p3_to_oklch))}function oklch_to_lin_p3(e){return e=n.OKLCH_to_OKLab(e),e=n.OKLab_to_XYZ(e),n.XYZ_to_lin_P3(e)}function lin_p3_to_oklch(e){return e=n.lin_P3_to_XYZ(e),e=n.XYZ_to_OKLab(e),n.OKLab_to_OKLCH(e)}function toPrecision(e,o=7){e=+e,o=+o;const a=(Math.floor(e)+"").length;if(o>a)return+e.toFixed(o-a);{const n=10**(a-o);return Math.round(e/n)*n}}function serializeWithAlpha(e,o,n,r){const s=[a.TokenType.CloseParen,")",-1,-1,void 0];if("number"==typeof e.alpha){const l=Math.min(1,Math.max(0,toPrecision(Number.isNaN(e.alpha)?0:e.alpha)));return 1===toPrecision(l,4)?new t.FunctionNode(o,s,r):new t.FunctionNode(o,s,[...r,new t.WhitespaceNode([n]),new t.TokenNode([a.TokenType.Delim,"/",-1,-1,{value:"/"}]),new t.WhitespaceNode([n]),new t.TokenNode([a.TokenType.Number,toPrecision(l,4).toString(),-1,-1,{value:e.alpha,type:a.NumberType.Integer}])])}return new t.FunctionNode(o,s,[...r,new t.WhitespaceNode([n]),new t.TokenNode([a.TokenType.Delim,"/",-1,-1,{value:"/"}]),new t.WhitespaceNode([n]),e.alpha])}exports.color=function color(e){if(t.isFunctionNode(e)){switch(toLowerCaseAZ(e.getName())){case"rgb":case"rgba":return rgb(e,color);case"hsl":case"hsla":return hsl(e,color);case"hwb":return o=color,threeChannelSpaceSeparated(e,normalize_HWB_ChannelValues,exports.ColorNotation.HWB,[],o);case"lab":return lab(e,color);case"lch":return lch(e,color);case"oklab":return oklab(e,color);case"oklch":return oklch(e,color);case"color":return color$1(e,color);case"color-mix":return colorMix(e,color);case"contrast-color":return contrastColor(e,color)}}var o;if(t.isTokenNode(e)){if(a.isTokenHash(e.value))return hex(e.value);if(a.isTokenIdent(e.value)){const o=namedColor(e.value[4].value);return!1!==o?o:"transparent"===toLowerCaseAZ(e.value[4].value)&&{colorNotation:exports.ColorNotation.RGB,channels:[0,0,0],alpha:0,syntaxFlags:new Set([exports.SyntaxFlag.ColorKeyword])}}}return!1},exports.colorDataFitsDisplayP3_Gamut=function colorDataFitsDisplayP3_Gamut(e){const o={...e,channels:[...e.channels]};return o.channels=convertPowerlessComponentsToZeroValuesForDisplay(o.channels,o.colorNotation),!colorDataTo(o,exports.ColorNotation.Display_P3).channels.find((e=>e<-1e-5||e>1.00001))},exports.colorDataFitsRGB_Gamut=function colorDataFitsRGB_Gamut(e){const o={...e,channels:[...e.channels]};return o.channels=convertPowerlessComponentsToZeroValuesForDisplay(o.channels,o.colorNotation),!colorDataTo(o,exports.ColorNotation.RGB).channels.find((e=>e<-1e-5||e>1.00001))},exports.serializeHSL=function serializeHSL(e,o=!0){e.channels=convertPowerlessComponentsToZeroValuesForDisplay(e.channels,e.colorNotation);let r=e.channels.map((e=>Number.isNaN(e)?0:e));r=o?n.XYZ_D50_to_HSL(n.sRGB_to_XYZ_D50(XYZ_D50_to_sRGB_Gamut(colorData_to_XYZ_D50(e).channels))):n.XYZ_D50_to_HSL(colorData_to_XYZ_D50(e).channels),r=r.map((e=>Number.isNaN(e)?0:e));const s=Math.min(360,Math.max(0,Math.round(toPrecision(r[0])))),l=Math.min(100,Math.max(0,Math.round(toPrecision(r[1])))),i=Math.min(100,Math.max(0,Math.round(toPrecision(r[2])))),u=[a.TokenType.CloseParen,")",-1,-1,void 0],c=[a.TokenType.Whitespace," ",-1,-1,void 0],p=[a.TokenType.Comma,",",-1,-1,void 0],N=[new t.TokenNode([a.TokenType.Number,s.toString(),-1,-1,{value:r[0],type:a.NumberType.Integer}]),new t.TokenNode(p),new t.WhitespaceNode([c]),new t.TokenNode([a.TokenType.Percentage,l.toString()+"%",-1,-1,{value:r[1]}]),new t.TokenNode(p),new t.WhitespaceNode([c]),new t.TokenNode([a.TokenType.Percentage,i.toString()+"%",-1,-1,{value:r[2]}])];if("number"==typeof e.alpha){const o=Math.min(1,Math.max(0,toPrecision(Number.isNaN(e.alpha)?0:e.alpha)));return 1===toPrecision(o,4)?new t.FunctionNode([a.TokenType.Function,"hsl(",-1,-1,{value:"hsl"}],u,N):new t.FunctionNode([a.TokenType.Function,"hsla(",-1,-1,{value:"hsla"}],u,[...N,new t.TokenNode(p),new t.WhitespaceNode([c]),new t.TokenNode([a.TokenType.Number,toPrecision(o,4).toString(),-1,-1,{value:e.alpha,type:a.NumberType.Number}])])}return new t.FunctionNode([a.TokenType.Function,"hsla(",-1,-1,{value:"hsla"}],u,[...N,new t.TokenNode(p),new t.WhitespaceNode([c]),e.alpha])},exports.serializeOKLCH=function serializeOKLCH(e){e.channels=convertPowerlessComponentsToZeroValuesForDisplay(e.channels,e.colorNotation);let o=e.channels.map((e=>Number.isNaN(e)?0:e));e.colorNotation!==exports.ColorNotation.OKLCH&&(o=n.XYZ_D50_to_OKLCH(colorData_to_XYZ_D50(e).channels));const r=toPrecision(o[0],6),s=toPrecision(o[1],6),l=toPrecision(o[2],6),i=[a.TokenType.Function,"oklch(",-1,-1,{value:"oklch"}],u=[a.TokenType.Whitespace," ",-1,-1,void 0];return serializeWithAlpha(e,i,u,[new t.TokenNode([a.TokenType.Number,r.toString(),-1,-1,{value:o[0],type:a.NumberType.Number}]),new t.WhitespaceNode([u]),new t.TokenNode([a.TokenType.Number,s.toString(),-1,-1,{value:o[1],type:a.NumberType.Number}]),new t.WhitespaceNode([u]),new t.TokenNode([a.TokenType.Number,l.toString(),-1,-1,{value:o[2],type:a.NumberType.Number}])])},exports.serializeP3=function serializeP3(e,o=!0){e.channels=convertPowerlessComponentsToZeroValuesForDisplay(e.channels,e.colorNotation);let r=e.channels.map((e=>Number.isNaN(e)?0:e));o?r=XYZ_D50_to_P3_Gamut(colorData_to_XYZ_D50(e).channels):e.colorNotation!==exports.ColorNotation.Display_P3&&(r=n.XYZ_D50_to_P3(colorData_to_XYZ_D50(e).channels));const s=o?Math.min(1,Math.max(0,toPrecision(r[0],6))):toPrecision(r[0],6),l=o?Math.min(1,Math.max(0,toPrecision(r[1],6))):toPrecision(r[1],6),i=o?Math.min(1,Math.max(0,toPrecision(r[2],6))):toPrecision(r[2],6),u=[a.TokenType.Function,"color(",-1,-1,{value:"color"}],c=[a.TokenType.Whitespace," ",-1,-1,void 0];return serializeWithAlpha(e,u,c,[new t.TokenNode([a.TokenType.Ident,"display-p3",-1,-1,{value:"display-p3"}]),new t.WhitespaceNode([c]),new t.TokenNode([a.TokenType.Number,s.toString(),-1,-1,{value:r[0],type:a.NumberType.Number}]),new t.WhitespaceNode([c]),new t.TokenNode([a.TokenType.Number,l.toString(),-1,-1,{value:r[1],type:a.NumberType.Number}]),new t.WhitespaceNode([c]),new t.TokenNode([a.TokenType.Number,i.toString(),-1,-1,{value:r[2],type:a.NumberType.Number}])])},exports.serializeRGB=function serializeRGB(e,o=!0){e.channels=convertPowerlessComponentsToZeroValuesForDisplay(e.channels,e.colorNotation);let r=e.channels.map((e=>Number.isNaN(e)?0:e));r=o?XYZ_D50_to_sRGB_Gamut(colorData_to_XYZ_D50(e).channels):n.XYZ_D50_to_sRGB(colorData_to_XYZ_D50(e).channels);const s=Math.min(255,Math.max(0,Math.round(255*toPrecision(r[0])))),l=Math.min(255,Math.max(0,Math.round(255*toPrecision(r[1])))),i=Math.min(255,Math.max(0,Math.round(255*toPrecision(r[2])))),u=[a.TokenType.CloseParen,")",-1,-1,void 0],c=[a.TokenType.Whitespace," ",-1,-1,void 0],p=[a.TokenType.Comma,",",-1,-1,void 0],N=[new t.TokenNode([a.TokenType.Number,s.toString(),-1,-1,{value:Math.min(255,255*Math.max(0,r[0])),type:a.NumberType.Integer}]),new t.TokenNode(p),new t.WhitespaceNode([c]),new t.TokenNode([a.TokenType.Number,l.toString(),-1,-1,{value:Math.min(255,255*Math.max(0,r[1])),type:a.NumberType.Integer}]),new t.TokenNode(p),new t.WhitespaceNode([c]),new t.TokenNode([a.TokenType.Number,i.toString(),-1,-1,{value:Math.min(255,255*Math.max(0,r[2])),type:a.NumberType.Integer}])];if("number"==typeof e.alpha){const o=Math.min(1,Math.max(0,toPrecision(Number.isNaN(e.alpha)?0:e.alpha)));return 1===toPrecision(o,4)?new t.FunctionNode([a.TokenType.Function,"rgb(",-1,-1,{value:"rgb"}],u,N):new t.FunctionNode([a.TokenType.Function,"rgba(",-1,-1,{value:"rgba"}],u,[...N,new t.TokenNode(p),new t.WhitespaceNode([c]),new t.TokenNode([a.TokenType.Number,toPrecision(o,4).toString(),-1,-1,{value:e.alpha,type:a.NumberType.Number}])])}return new t.FunctionNode([a.TokenType.Function,"rgba(",-1,-1,{value:"rgba"}],u,[...N,new t.TokenNode(p),new t.WhitespaceNode([c]),e.alpha])};
diff --git a/packages/css-color-parser/dist/index.mjs b/packages/css-color-parser/dist/index.mjs
index 3dd10904f..620c0ba6c 100644
--- a/packages/css-color-parser/dist/index.mjs
+++ b/packages/css-color-parser/dist/index.mjs
@@ -1 +1 @@
-import{TokenType as e,NumberType as a,isTokenIdent as n,isTokenPercentage as r,isTokenNumber as o,isTokenDelim as t,isTokenNumeric as l,isTokenComma as s,isTokenDimension as u,isTokenHash as c}from"@csstools/css-tokenizer";import{XYZ_D65_to_XYZ_D50 as i,XYZ_D50_to_XYZ_D50 as h,OKLCH_to_XYZ_D50 as m,LCH_to_XYZ_D50 as p,OKLab_to_XYZ_D50 as N,Lab_to_XYZ_D50 as b,HWB_to_XYZ_D50 as v,HSL_to_XYZ_D50 as g,ProPhoto_RGB_to_XYZ_D50 as f,a98_RGB_to_XYZ_D50 as d,rec_2020_to_XYZ_D50 as y,P3_to_XYZ_D50 as _,lin_sRGB_to_XYZ_D50 as C,sRGB_to_XYZ_D50 as w,XYZ_D50_to_XYZ_D65 as x,XYZ_D50_to_OKLab as H,XYZ_D50_to_OKLCH as L,XYZ_D50_to_LCH as k,XYZ_D50_to_Lab as S,XYZ_D50_to_HWB as P,XYZ_D50_to_HSL as z,XYZ_D50_to_a98_RGB as D,XYZ_D50_to_ProPhoto as F,XYZ_D50_to_rec_2020 as Z,XYZ_D50_to_P3 as M,XYZ_D50_to_lin_sRGB as R,XYZ_D50_to_sRGB as B,namedColors as G,inGamut as T,clip as V,gam_sRGB as A,mapGamutRayTrace as X,OKLCH_to_OKLab as Y,OKLab_to_XYZ as K,XYZ_to_lin_sRGB as I,lin_sRGB_to_XYZ as O,XYZ_to_OKLab as E,OKLab_to_OKLCH as W,contrast_ratio_wcag_2_1 as U,gam_P3 as $,XYZ_to_lin_P3 as j,lin_P3_to_XYZ as q}from"@csstools/color-helpers";import{isWhitespaceNode as J,isCommentNode as Q,isTokenNode as ee,isFunctionNode as ae,TokenNode as ne,FunctionNode as re,WhitespaceNode as oe}from"@csstools/css-parser-algorithms";import{mathFunctionNames as te,calcFromComponentValues as le}from"@csstools/css-calc";var se,ue;function convertNaNToZero(e){return[Number.isNaN(e[0])?0:e[0],Number.isNaN(e[1])?0:e[1],Number.isNaN(e[2])?0:e[2]]}function colorData_to_XYZ_D50(e){switch(e.colorNotation){case se.HEX:case se.RGB:case se.sRGB:return{...e,colorNotation:se.XYZ_D50,channels:w(convertNaNToZero(e.channels))};case se.Linear_sRGB:return{...e,colorNotation:se.XYZ_D50,channels:C(convertNaNToZero(e.channels))};case se.Display_P3:return{...e,colorNotation:se.XYZ_D50,channels:_(convertNaNToZero(e.channels))};case se.Rec2020:return{...e,colorNotation:se.XYZ_D50,channels:y(convertNaNToZero(e.channels))};case se.A98_RGB:return{...e,colorNotation:se.XYZ_D50,channels:d(convertNaNToZero(e.channels))};case se.ProPhoto_RGB:return{...e,colorNotation:se.XYZ_D50,channels:f(convertNaNToZero(e.channels))};case se.HSL:return{...e,colorNotation:se.XYZ_D50,channels:g(convertNaNToZero(e.channels))};case se.HWB:return{...e,colorNotation:se.XYZ_D50,channels:v(convertNaNToZero(e.channels))};case se.Lab:return{...e,colorNotation:se.XYZ_D50,channels:b(convertNaNToZero(e.channels))};case se.OKLab:return{...e,colorNotation:se.XYZ_D50,channels:N(convertNaNToZero(e.channels))};case se.LCH:return{...e,colorNotation:se.XYZ_D50,channels:p(convertNaNToZero(e.channels))};case se.OKLCH:return{...e,colorNotation:se.XYZ_D50,channels:m(convertNaNToZero(e.channels))};case se.XYZ_D50:return{...e,colorNotation:se.XYZ_D50,channels:h(convertNaNToZero(e.channels))};case se.XYZ_D65:return{...e,colorNotation:se.XYZ_D50,channels:i(convertNaNToZero(e.channels))};default:throw new Error("Unsupported color notation")}}!function(e){e.A98_RGB="a98-rgb",e.Display_P3="display-p3",e.HEX="hex",e.HSL="hsl",e.HWB="hwb",e.LCH="lch",e.Lab="lab",e.Linear_sRGB="srgb-linear",e.OKLCH="oklch",e.OKLab="oklab",e.ProPhoto_RGB="prophoto-rgb",e.RGB="rgb",e.sRGB="srgb",e.Rec2020="rec2020",e.XYZ_D50="xyz-d50",e.XYZ_D65="xyz-d65"}(se||(se={})),function(e){e.ColorKeyword="color-keyword",e.HasAlpha="has-alpha",e.HasDimensionValues="has-dimension-values",e.HasNoneKeywords="has-none-keywords",e.HasNumberValues="has-number-values",e.HasPercentageAlpha="has-percentage-alpha",e.HasPercentageValues="has-percentage-values",e.HasVariableAlpha="has-variable-alpha",e.Hex="hex",e.LegacyHSL="legacy-hsl",e.LegacyRGB="legacy-rgb",e.NamedColor="named-color",e.RelativeColorSyntax="relative-color-syntax",e.ColorMix="color-mix",e.ContrastColor="contrast-color",e.Experimental="experimental"}(ue||(ue={}));const ce=new Set([se.A98_RGB,se.Display_P3,se.HEX,se.Linear_sRGB,se.ProPhoto_RGB,se.RGB,se.sRGB,se.Rec2020,se.XYZ_D50,se.XYZ_D65]);function colorDataTo(e,a){const n={...e};if(e.colorNotation!==a){const e=colorData_to_XYZ_D50(n);switch(a){case se.HEX:case se.RGB:n.colorNotation=se.RGB,n.channels=B(e.channels);break;case se.sRGB:n.colorNotation=se.sRGB,n.channels=B(e.channels);break;case se.Linear_sRGB:n.colorNotation=se.Linear_sRGB,n.channels=R(e.channels);break;case se.Display_P3:n.colorNotation=se.Display_P3,n.channels=M(e.channels);break;case se.Rec2020:n.colorNotation=se.Rec2020,n.channels=Z(e.channels);break;case se.ProPhoto_RGB:n.colorNotation=se.ProPhoto_RGB,n.channels=F(e.channels);break;case se.A98_RGB:n.colorNotation=se.A98_RGB,n.channels=D(e.channels);break;case se.HSL:n.colorNotation=se.HSL,n.channels=z(e.channels);break;case se.HWB:n.colorNotation=se.HWB,n.channels=P(e.channels);break;case se.Lab:n.colorNotation=se.Lab,n.channels=S(e.channels);break;case se.LCH:n.colorNotation=se.LCH,n.channels=k(e.channels);break;case se.OKLCH:n.colorNotation=se.OKLCH,n.channels=L(e.channels);break;case se.OKLab:n.colorNotation=se.OKLab,n.channels=H(e.channels);break;case se.XYZ_D50:n.colorNotation=se.XYZ_D50,n.channels=h(e.channels);break;case se.XYZ_D65:n.colorNotation=se.XYZ_D65,n.channels=x(e.channels);break;default:throw new Error("Unsupported color notation")}}else n.channels=convertNaNToZero(e.channels);if(a===e.colorNotation)n.channels=carryForwardMissingComponents(e.channels,[0,1,2],n.channels,[0,1,2]);else if(ce.has(a)&&ce.has(e.colorNotation))n.channels=carryForwardMissingComponents(e.channels,[0,1,2],n.channels,[0,1,2]);else switch(a){case se.HSL:switch(e.colorNotation){case se.HWB:n.channels=carryForwardMissingComponents(e.channels,[0],n.channels,[0]);break;case se.Lab:case se.OKLab:n.channels=carryForwardMissingComponents(e.channels,[2],n.channels,[0]);break;case se.LCH:case se.OKLCH:n.channels=carryForwardMissingComponents(e.channels,[0,1,2],n.channels,[2,1,0])}break;case se.HWB:switch(e.colorNotation){case se.HSL:n.channels=carryForwardMissingComponents(e.channels,[0],n.channels,[0]);break;case se.LCH:case se.OKLCH:n.channels=carryForwardMissingComponents(e.channels,[0],n.channels,[2])}break;case se.Lab:case se.OKLab:switch(e.colorNotation){case se.HSL:n.channels=carryForwardMissingComponents(e.channels,[0],n.channels,[2]);break;case se.Lab:case se.OKLab:n.channels=carryForwardMissingComponents(e.channels,[0,1,2],n.channels,[0,1,2]);break;case se.LCH:case se.OKLCH:n.channels=carryForwardMissingComponents(e.channels,[0],n.channels,[0])}break;case se.LCH:case se.OKLCH:switch(e.colorNotation){case se.HSL:n.channels=carryForwardMissingComponents(e.channels,[0,1,2],n.channels,[2,1,0]);break;case se.HWB:n.channels=carryForwardMissingComponents(e.channels,[0],n.channels,[2]);break;case se.Lab:case se.OKLab:n.channels=carryForwardMissingComponents(e.channels,[0],n.channels,[0]);break;case se.LCH:case se.OKLCH:n.channels=carryForwardMissingComponents(e.channels,[0,1,2],n.channels,[0,1,2])}}return n.channels=convertPowerlessComponentsToMissingComponents(n.channels,a),n}function convertPowerlessComponentsToMissingComponents(e,a){const n=[...e];switch(a){case se.HSL:!Number.isNaN(n[1])&&reducePrecision(n[1],4)<=0&&(n[0]=NaN);break;case se.HWB:Math.max(0,reducePrecision(n[1],4))+Math.max(0,reducePrecision(n[2],4))>=100&&(n[0]=NaN);break;case se.LCH:!Number.isNaN(n[1])&&reducePrecision(n[1],4)<=0&&(n[2]=NaN);break;case se.OKLCH:!Number.isNaN(n[1])&&reducePrecision(n[1],6)<=0&&(n[2]=NaN)}return n}function convertPowerlessComponentsToZeroValuesForDisplay(e,a){const n=[...e];switch(a){case se.HSL:(reducePrecision(n[2])<=0||reducePrecision(n[2])>=100)&&(n[0]=NaN,n[1]=NaN),reducePrecision(n[1])<=0&&(n[0]=NaN);break;case se.HWB:Math.max(0,reducePrecision(n[1]))+Math.max(0,reducePrecision(n[2]))>=100&&(n[0]=NaN);break;case se.Lab:(reducePrecision(n[0])<=0||reducePrecision(n[0])>=100)&&(n[1]=NaN,n[2]=NaN);break;case se.LCH:reducePrecision(n[1])<=0&&(n[2]=NaN),(reducePrecision(n[0])<=0||reducePrecision(n[0])>=100)&&(n[1]=NaN,n[2]=NaN);break;case se.OKLab:(reducePrecision(n[0])<=0||reducePrecision(n[0])>=1)&&(n[1]=NaN,n[2]=NaN);break;case se.OKLCH:reducePrecision(n[1])<=0&&(n[2]=NaN),(reducePrecision(n[0])<=0||reducePrecision(n[0])>=1)&&(n[1]=NaN,n[2]=NaN)}return n}function carryForwardMissingComponents(e,a,n,r){const o=[...n];for(const n of a)Number.isNaN(e[a[n]])&&(o[r[n]]=NaN);return o}function normalizeRelativeColorDataChannels(e){const a=new Map;switch(e.colorNotation){case se.RGB:case se.HEX:a.set("r",dummyNumberToken(255*e.channels[0])),a.set("g",dummyNumberToken(255*e.channels[1])),a.set("b",dummyNumberToken(255*e.channels[2])),"number"==typeof e.alpha&&a.set("alpha",dummyNumberToken(e.alpha));break;case se.HSL:a.set("h",dummyNumberToken(e.channels[0])),a.set("s",dummyNumberToken(e.channels[1])),a.set("l",dummyNumberToken(e.channels[2])),"number"==typeof e.alpha&&a.set("alpha",dummyNumberToken(e.alpha));break;case se.HWB:a.set("h",dummyNumberToken(e.channels[0])),a.set("w",dummyNumberToken(e.channels[1])),a.set("b",dummyNumberToken(e.channels[2])),"number"==typeof e.alpha&&a.set("alpha",dummyNumberToken(e.alpha));break;case se.Lab:case se.OKLab:a.set("l",dummyNumberToken(e.channels[0])),a.set("a",dummyNumberToken(e.channels[1])),a.set("b",dummyNumberToken(e.channels[2])),"number"==typeof e.alpha&&a.set("alpha",dummyNumberToken(e.alpha));break;case se.LCH:case se.OKLCH:a.set("l",dummyNumberToken(e.channels[0])),a.set("c",dummyNumberToken(e.channels[1])),a.set("h",dummyNumberToken(e.channels[2])),"number"==typeof e.alpha&&a.set("alpha",dummyNumberToken(e.alpha));break;case se.sRGB:case se.A98_RGB:case se.Display_P3:case se.Rec2020:case se.Linear_sRGB:case se.ProPhoto_RGB:a.set("r",dummyNumberToken(e.channels[0])),a.set("g",dummyNumberToken(e.channels[1])),a.set("b",dummyNumberToken(e.channels[2])),"number"==typeof e.alpha&&a.set("alpha",dummyNumberToken(e.alpha));break;case se.XYZ_D50:case se.XYZ_D65:a.set("x",dummyNumberToken(e.channels[0])),a.set("y",dummyNumberToken(e.channels[1])),a.set("z",dummyNumberToken(e.channels[2])),"number"==typeof e.alpha&&a.set("alpha",dummyNumberToken(e.alpha))}return a}function noneToZeroInRelativeColorDataChannels(e){const a=new Map(e);for(const[n,r]of e)Number.isNaN(r[4].value)&&a.set(n,dummyNumberToken(0));return a}function dummyNumberToken(n){return Number.isNaN(n)?[e.Number,"none",-1,-1,{value:Number.NaN,type:a.Number}]:[e.Number,n.toString(),-1,-1,{value:n,type:a.Number}]}function reducePrecision(e,a=7){if(Number.isNaN(e))return 0;const n=Math.pow(10,a);return Math.round(e*n)/n}function colorDataFitsRGB_Gamut(e){const a={...e,channels:[...e.channels]};a.channels=convertPowerlessComponentsToZeroValuesForDisplay(a.channels,a.colorNotation);return!colorDataTo(a,se.RGB).channels.find((e=>e<-1e-5||e>1.00001))}function colorDataFitsDisplayP3_Gamut(e){const a={...e,channels:[...e.channels]};a.channels=convertPowerlessComponentsToZeroValuesForDisplay(a.channels,a.colorNotation);return!colorDataTo(a,se.Display_P3).channels.find((e=>e<-1e-5||e>1.00001))}function normalize(e,a,n,r){return Math.min(Math.max(e/a,n),r)}const ie=/[A-Z]/g;function toLowerCaseAZ(e){return e.replace(ie,(e=>String.fromCharCode(e.charCodeAt(0)+32)))}function normalize_Color_ChannelValues(t,l,s){if(n(t)&&"none"===toLowerCaseAZ(t[4].value))return s.syntaxFlags.add(ue.HasNoneKeywords),[e.Number,"none",t[2],t[3],{value:NaN,type:a.Number}];if(r(t)){3!==l&&s.syntaxFlags.add(ue.HasPercentageValues);let n=normalize(t[4].value,100,-2147483647,2147483647);return 3===l&&(n=normalize(t[4].value,100,0,1)),[e.Number,n.toString(),t[2],t[3],{value:n,type:a.Number}]}if(o(t)){3!==l&&s.syntaxFlags.add(ue.HasNumberValues);let n=normalize(t[4].value,1,-2147483647,2147483647);return 3===l&&(n=normalize(t[4].value,1,0,1)),[e.Number,n.toString(),t[2],t[3],{value:n,type:a.Number}]}return!1}const he=new Set(["srgb","srgb-linear","display-p3","a98-rgb","prophoto-rgb","rec2020","xyz","xyz-d50","xyz-d65"]);function color$1(e,a){const r=[],s=[],u=[],c=[];let i,h,m=!1,p=!1;const N={colorNotation:se.sRGB,channels:[0,0,0],alpha:1,syntaxFlags:new Set([])};let b=r;for(let o=0;o=0){u=c.value[4].value;continue}}return!1}if(!t)return!1;n.push({color:t,percentage:u}),t=!1,u=!1}}if(t&&n.push({color:t,percentage:u}),2!==n.length)return!1;let c=n[0].percentage,i=n[1].percentage;return(!1===c||!(c<0||c>100))&&((!1===i||!(i<0||i>100))&&(!1===c&&!1===i?(c=50,i=50):!1!==c&&!1===i?i=100-c:!1===c&&!1!==i&&(c=100-i),(0!==c||0!==i)&&(!1!==c&&!1!==i&&(c+i>100&&(c=c/(c+i)*100,i=i/(c+i)*100),c+i<100&&(o=(c+i)/100,c=c/(c+i)*100,i=i/(c+i)*100),{a:{color:n[0].color,percentage:c},b:{color:n[1].color,percentage:i},alphaMultiplier:o}))))}function colorMixRectangular(e,a){if(!a)return!1;const n=a.a.color,r=a.b.color,o=a.a.percentage/100;let t=n.channels,l=r.channels,s=se.RGB,u=n.alpha;if("number"!=typeof u)return!1;let c=r.alpha;if("number"!=typeof c)return!1;switch(u=Number.isNaN(u)?c:u,c=Number.isNaN(c)?u:c,e){case"srgb":s=se.RGB;break;case"srgb-linear":s=se.Linear_sRGB;break;case"display-p3":s=se.Display_P3;break;case"a98-rgb":s=se.A98_RGB;break;case"prophoto-rgb":s=se.ProPhoto_RGB;break;case"rec2020":s=se.Rec2020;break;case"lab":s=se.Lab;break;case"oklab":s=se.OKLab;break;case"xyz-d50":s=se.XYZ_D50;break;case"xyz":case"xyz-d65":s=se.XYZ_D65}t=colorDataTo(n,s).channels,l=colorDataTo(r,s).channels,t[0]=fillInMissingComponent(t[0],l[0]),l[0]=fillInMissingComponent(l[0],t[0]),t[1]=fillInMissingComponent(t[1],l[1]),l[1]=fillInMissingComponent(l[1],t[1]),t[2]=fillInMissingComponent(t[2],l[2]),l[2]=fillInMissingComponent(l[2],t[2]),t[0]=premultiply(t[0],u),t[1]=premultiply(t[1],u),t[2]=premultiply(t[2],u),l[0]=premultiply(l[0],c),l[1]=premultiply(l[1],c),l[2]=premultiply(l[2],c);const i=interpolate(u,c,o),h={colorNotation:s,channels:[un_premultiply(interpolate(t[0],l[0],o),i),un_premultiply(interpolate(t[1],l[1],o),i),un_premultiply(interpolate(t[2],l[2],o),i)],alpha:i*a.alphaMultiplier,syntaxFlags:new Set([ue.ColorMix])};return(a.a.color.syntaxFlags.has(ue.Experimental)||a.b.color.syntaxFlags.has(ue.Experimental))&&h.syntaxFlags.add(ue.Experimental),h}function colorMixPolar(e,a,n){if(!n)return!1;const r=n.a.color,o=n.b.color,t=n.a.percentage/100;let l=r.channels,s=o.channels,u=0,c=0,i=0,h=0,m=0,p=0,N=se.RGB,b=r.alpha;if("number"!=typeof b)return!1;let v=o.alpha;if("number"!=typeof v)return!1;switch(b=Number.isNaN(b)?v:b,v=Number.isNaN(v)?b:v,e){case"hsl":N=se.HSL;break;case"hwb":N=se.HWB;break;case"lch":N=se.LCH;break;case"oklch":N=se.OKLCH}switch(l=colorDataTo(r,N).channels,s=colorDataTo(o,N).channels,e){case"hsl":case"hwb":u=l[0],c=s[0],i=l[1],h=s[1],m=l[2],p=s[2];break;case"lch":case"oklch":i=l[0],h=s[0],m=l[1],p=s[1],u=l[2],c=s[2]}u=fillInMissingComponent(u,c),Number.isNaN(u)&&(u=0),c=fillInMissingComponent(c,u),Number.isNaN(c)&&(c=0),i=fillInMissingComponent(i,h),h=fillInMissingComponent(h,i),m=fillInMissingComponent(m,p),p=fillInMissingComponent(p,m);const g=c-u;switch(a){case"shorter":g>180?u+=360:g<-180&&(c+=360);break;case"longer":-180<180&&(g>0?u+=360:c+=360);break;case"increasing":g<0&&(c+=360);break;case"decreasing":g>0&&(u+=360);break;default:throw new Error("Unknown hue interpolation method")}i=premultiply(i,b),m=premultiply(m,b),h=premultiply(h,v),p=premultiply(p,v);let f=[0,0,0];const d=interpolate(b,v,t);switch(e){case"hsl":case"hwb":f=[interpolate(u,c,t),un_premultiply(interpolate(i,h,t),d),un_premultiply(interpolate(m,p,t),d)];break;case"lch":case"oklch":f=[un_premultiply(interpolate(i,h,t),d),un_premultiply(interpolate(m,p,t),d),interpolate(u,c,t)]}const y={colorNotation:N,channels:f,alpha:d*n.alphaMultiplier,syntaxFlags:new Set([ue.ColorMix])};return(n.a.color.syntaxFlags.has(ue.Experimental)||n.b.color.syntaxFlags.has(ue.Experimental))&&y.syntaxFlags.add(ue.Experimental),y}function fillInMissingComponent(e,a){return Number.isNaN(e)?a:e}function interpolate(e,a,n){return e*n+a*(1-n)}function premultiply(e,a){return Number.isNaN(a)?e:Number.isNaN(e)?NaN:e*a}function un_premultiply(e,a){return 0===a||Number.isNaN(a)?e:Number.isNaN(e)?NaN:e/a}function hex(e){const a=toLowerCaseAZ(e[4].value);if(a.match(/[^a-f0-9]/))return!1;const n={colorNotation:se.HEX,channels:[0,0,0],alpha:1,syntaxFlags:new Set([ue.Hex])},r=a.length;if(3===r){const e=a[0],r=a[1],o=a[2];return n.channels=[parseInt(e+e,16)/255,parseInt(r+r,16)/255,parseInt(o+o,16)/255],n}if(6===r){const e=a[0]+a[1],r=a[2]+a[3],o=a[4]+a[5];return n.channels=[parseInt(e,16)/255,parseInt(r,16)/255,parseInt(o,16)/255],n}if(4===r){const e=a[0],r=a[1],o=a[2],t=a[3];return n.channels=[parseInt(e+e,16)/255,parseInt(r+r,16)/255,parseInt(o+o,16)/255],n.alpha=parseInt(t+t,16)/255,n.syntaxFlags.add(ue.HasAlpha),n}if(8===r){const e=a[0]+a[1],r=a[2]+a[3],o=a[4]+a[5],t=a[6]+a[7];return n.channels=[parseInt(e,16)/255,parseInt(r,16)/255,parseInt(o,16)/255],n.alpha=parseInt(t,16)/255,n.syntaxFlags.add(ue.HasAlpha),n}return!1}function normalizeHue(n){if(o(n))return n[4].value=n[4].value%360,n[1]=n[4].value.toString(),n;if(u(n)){let r=n[4].value;switch(toLowerCaseAZ(n[4].unit)){case"deg":break;case"rad":r=180*n[4].value/Math.PI;break;case"grad":r=.9*n[4].value;break;case"turn":r=360*n[4].value;break;default:return!1}return r%=360,[e.Number,r.toString(),n[2],n[3],{value:r,type:a.Number}]}return!1}function normalize_legacy_HSL_ChannelValues(n,t,l){if(0===t){const e=normalizeHue(n);return!1!==e&&(u(n)&&l.syntaxFlags.add(ue.HasDimensionValues),e)}if(r(n)){3===t?l.syntaxFlags.add(ue.HasPercentageAlpha):l.syntaxFlags.add(ue.HasPercentageValues);let r=normalize(n[4].value,1,0,100);return 3===t&&(r=normalize(n[4].value,100,0,1)),[e.Number,r.toString(),n[2],n[3],{value:r,type:a.Number}]}if(o(n)){if(3!==t)return!1;let r=normalize(n[4].value,1,0,100);return 3===t&&(r=normalize(n[4].value,1,0,1)),[e.Number,r.toString(),n[2],n[3],{value:r,type:a.Number}]}return!1}function normalize_modern_HSL_ChannelValues(t,l,s){if(n(t)&&"none"===toLowerCaseAZ(t[4].value))return s.syntaxFlags.add(ue.HasNoneKeywords),[e.Number,"none",t[2],t[3],{value:NaN,type:a.Number}];if(0===l){const e=normalizeHue(t);return!1!==e&&(u(t)&&s.syntaxFlags.add(ue.HasDimensionValues),e)}if(r(t)){3===l?s.syntaxFlags.add(ue.HasPercentageAlpha):s.syntaxFlags.add(ue.HasPercentageValues);let n=t[4].value;return 3===l?n=normalize(t[4].value,100,0,1):1===l&&(n=normalize(t[4].value,1,0,2147483647)),[e.Number,n.toString(),t[2],t[3],{value:n,type:a.Number}]}if(o(t)){3!==l&&s.syntaxFlags.add(ue.HasNumberValues);let n=t[4].value;return 3===l?n=normalize(t[4].value,1,0,1):1===l&&(n=normalize(t[4].value,1,0,2147483647)),[e.Number,n.toString(),t[2],t[3],{value:n,type:a.Number}]}return!1}function threeChannelLegacySyntax(e,a,n,r){const t=[],u=[],c=[],i=[],h={colorNotation:n,channels:[0,0,0],alpha:1,syntaxFlags:new Set(r)};let m=t;for(let a=0;aee(e)&&s(e.value)))){const a=hslCommaSeparated(e);if(!1!==a)return a}{const n=hslSpaceSeparated(e,a);if(!1!==n)return n}return!1}function hslCommaSeparated(e){return threeChannelLegacySyntax(e,normalize_legacy_HSL_ChannelValues,se.HSL,[ue.LegacyHSL])}function hslSpaceSeparated(e,a){return threeChannelSpaceSeparated(e,normalize_modern_HSL_ChannelValues,se.HSL,[],a)}function normalize_HWB_ChannelValues(t,l,s){if(n(t)&&"none"===toLowerCaseAZ(t[4].value))return s.syntaxFlags.add(ue.HasNoneKeywords),[e.Number,"none",t[2],t[3],{value:NaN,type:a.Number}];if(0===l){const e=normalizeHue(t);return!1!==e&&(u(t)&&s.syntaxFlags.add(ue.HasDimensionValues),e)}if(r(t)){3===l?s.syntaxFlags.add(ue.HasPercentageAlpha):s.syntaxFlags.add(ue.HasPercentageValues);let n=t[4].value;return 3===l&&(n=normalize(t[4].value,100,0,1)),[e.Number,n.toString(),t[2],t[3],{value:n,type:a.Number}]}if(o(t)){3!==l&&s.syntaxFlags.add(ue.HasNumberValues);let n=t[4].value;return 3===l&&(n=normalize(t[4].value,1,0,1)),[e.Number,n.toString(),t[2],t[3],{value:n,type:a.Number}]}return!1}function normalize_Lab_ChannelValues(t,l,s){if(n(t)&&"none"===toLowerCaseAZ(t[4].value))return s.syntaxFlags.add(ue.HasNoneKeywords),[e.Number,"none",t[2],t[3],{value:NaN,type:a.Number}];if(r(t)){3!==l&&s.syntaxFlags.add(ue.HasPercentageValues);let n=normalize(t[4].value,1,0,100);return 1===l||2===l?n=normalize(t[4].value,.8,-2147483647,2147483647):3===l&&(n=normalize(t[4].value,100,0,1)),[e.Number,n.toString(),t[2],t[3],{value:n,type:a.Number}]}if(o(t)){3!==l&&s.syntaxFlags.add(ue.HasNumberValues);let n=normalize(t[4].value,1,0,100);return 1===l||2===l?n=normalize(t[4].value,1,-2147483647,2147483647):3===l&&(n=normalize(t[4].value,1,0,1)),[e.Number,n.toString(),t[2],t[3],{value:n,type:a.Number}]}return!1}function lab(e,a){return threeChannelSpaceSeparated(e,normalize_Lab_ChannelValues,se.Lab,[],a)}function normalize_LCH_ChannelValues(t,l,s){if(n(t)&&"none"===toLowerCaseAZ(t[4].value))return s.syntaxFlags.add(ue.HasNoneKeywords),[e.Number,"none",t[2],t[3],{value:NaN,type:a.Number}];if(2===l){const e=normalizeHue(t);return!1!==e&&(u(t)&&s.syntaxFlags.add(ue.HasDimensionValues),e)}if(r(t)){3!==l&&s.syntaxFlags.add(ue.HasPercentageValues);let n=normalize(t[4].value,1,0,100);return 1===l?n=normalize(t[4].value,100/150,0,2147483647):3===l&&(n=normalize(t[4].value,100,0,1)),[e.Number,n.toString(),t[2],t[3],{value:n,type:a.Number}]}if(o(t)){3!==l&&s.syntaxFlags.add(ue.HasNumberValues);let n=normalize(t[4].value,1,0,100);return 1===l?n=normalize(t[4].value,1,0,2147483647):3===l&&(n=normalize(t[4].value,1,0,1)),[e.Number,n.toString(),t[2],t[3],{value:n,type:a.Number}]}return!1}function lch(e,a){return threeChannelSpaceSeparated(e,normalize_LCH_ChannelValues,se.LCH,[],a)}const be=new Map;for(const[e,a]of Object.entries(G))be.set(e,a);function namedColor(e){const a=be.get(toLowerCaseAZ(e));return!!a&&{colorNotation:se.RGB,channels:[a[0]/255,a[1]/255,a[2]/255],alpha:1,syntaxFlags:new Set([ue.ColorKeyword,ue.NamedColor])}}function normalize_OKLab_ChannelValues(t,l,s){if(n(t)&&"none"===toLowerCaseAZ(t[4].value))return s.syntaxFlags.add(ue.HasNoneKeywords),[e.Number,"none",t[2],t[3],{value:NaN,type:a.Number}];if(r(t)){3!==l&&s.syntaxFlags.add(ue.HasPercentageValues);let n=normalize(t[4].value,100,0,1);return 1===l||2===l?n=normalize(t[4].value,250,-2147483647,2147483647):3===l&&(n=normalize(t[4].value,100,0,1)),[e.Number,n.toString(),t[2],t[3],{value:n,type:a.Number}]}if(o(t)){3!==l&&s.syntaxFlags.add(ue.HasNumberValues);let n=normalize(t[4].value,1,0,1);return 1===l||2===l?n=normalize(t[4].value,1,-2147483647,2147483647):3===l&&(n=normalize(t[4].value,1,0,1)),[e.Number,n.toString(),t[2],t[3],{value:n,type:a.Number}]}return!1}function oklab(e,a){return threeChannelSpaceSeparated(e,normalize_OKLab_ChannelValues,se.OKLab,[],a)}function normalize_OKLCH_ChannelValues(t,l,s){if(n(t)&&"none"===toLowerCaseAZ(t[4].value))return s.syntaxFlags.add(ue.HasNoneKeywords),[e.Number,"none",t[2],t[3],{value:NaN,type:a.Number}];if(2===l){const e=normalizeHue(t);return!1!==e&&(u(t)&&s.syntaxFlags.add(ue.HasDimensionValues),e)}if(r(t)){3!==l&&s.syntaxFlags.add(ue.HasPercentageValues);let n=normalize(t[4].value,100,0,1);return 1===l?n=normalize(t[4].value,250,0,2147483647):3===l&&(n=normalize(t[4].value,100,0,1)),[e.Number,n.toString(),t[2],t[3],{value:n,type:a.Number}]}if(o(t)){3!==l&&s.syntaxFlags.add(ue.HasNumberValues);let n=normalize(t[4].value,1,0,1);return 1===l?n=normalize(t[4].value,1,0,2147483647):3===l&&(n=normalize(t[4].value,1,0,1)),[e.Number,n.toString(),t[2],t[3],{value:n,type:a.Number}]}return!1}function oklch(e,a){return threeChannelSpaceSeparated(e,normalize_OKLCH_ChannelValues,se.OKLCH,[],a)}function normalize_legacy_sRGB_ChannelValues(n,t,l){if(r(n)){3===t?l.syntaxFlags.add(ue.HasPercentageAlpha):l.syntaxFlags.add(ue.HasPercentageValues);const r=normalize(n[4].value,100,0,1);return[e.Number,r.toString(),n[2],n[3],{value:r,type:a.Number}]}if(o(n)){3!==t&&l.syntaxFlags.add(ue.HasNumberValues);let r=normalize(n[4].value,255,0,1);return 3===t&&(r=normalize(n[4].value,1,0,1)),[e.Number,r.toString(),n[2],n[3],{value:r,type:a.Number}]}return!1}function normalize_modern_sRGB_ChannelValues(t,l,s){if(n(t)&&"none"===t[4].value.toLowerCase())return s.syntaxFlags.add(ue.HasNoneKeywords),[e.Number,"none",t[2],t[3],{value:NaN,type:a.Number}];if(r(t)){3!==l&&s.syntaxFlags.add(ue.HasPercentageValues);let n=normalize(t[4].value,100,-2147483647,2147483647);return 3===l&&(n=normalize(t[4].value,100,0,1)),[e.Number,n.toString(),t[2],t[3],{value:n,type:a.Number}]}if(o(t)){3!==l&&s.syntaxFlags.add(ue.HasNumberValues);let n=normalize(t[4].value,255,-2147483647,2147483647);return 3===l&&(n=normalize(t[4].value,1,0,1)),[e.Number,n.toString(),t[2],t[3],{value:n,type:a.Number}]}return!1}function rgb(e,a){if(e.value.some((e=>ee(e)&&s(e.value)))){const a=rgbCommaSeparated(e);if(!1!==a)return(!a.syntaxFlags.has(ue.HasNumberValues)||!a.syntaxFlags.has(ue.HasPercentageValues))&&a}else{const n=rgbSpaceSeparated(e,a);if(!1!==n)return n}return!1}function rgbCommaSeparated(e){return threeChannelLegacySyntax(e,normalize_legacy_sRGB_ChannelValues,se.RGB,[ue.LegacyRGB])}function rgbSpaceSeparated(e,a){return threeChannelSpaceSeparated(e,normalize_modern_sRGB_ChannelValues,se.RGB,[],a)}function XYZ_D50_to_sRGB_Gamut(e){const a=B(e);if(T(a))return V(a);let n=e;return n=L(n),n[0]<1e-6&&(n=[0,0,0]),n[0]>.999999&&(n=[1,0,0]),A(X(n,oklch_to_lin_srgb,lin_srgb_to_oklch))}function oklch_to_lin_srgb(e){return e=Y(e),e=K(e),I(e)}function lin_srgb_to_oklch(e){return e=O(e),e=E(e),W(e)}function contrastColor(e,a){let r=!1,o=!1;for(let t=0;ts?[1,1,1]:[0,0,0],t}function toPrecision(e,a=7){e=+e,a=+a;const n=(Math.floor(e)+"").length;if(a>n)return+e.toFixed(a-n);{const r=10**(n-a);return Math.round(e/r)*r}}function XYZ_D50_to_P3_Gamut(e){const a=M(e);if(T(a))return V(a);let n=e;return n=L(n),n[0]<1e-6&&(n=[0,0,0]),n[0]>.999999&&(n=[1,0,0]),$(X(n,oklch_to_lin_p3,lin_p3_to_oklch))}function oklch_to_lin_p3(e){return e=Y(e),e=K(e),j(e)}function lin_p3_to_oklch(e){return e=q(e),e=E(e),W(e)}function serializeWithAlpha(n,r,o,t){const l=[e.CloseParen,")",-1,-1,void 0];if("number"==typeof n.alpha){const s=Math.min(1,Math.max(0,toPrecision(Number.isNaN(n.alpha)?0:n.alpha)));return 1===toPrecision(s,4)?new re(r,l,t):new re(r,l,[...t,new oe([o]),new ne([e.Delim,"/",-1,-1,{value:"/"}]),new oe([o]),new ne([e.Number,toPrecision(s,4).toString(),-1,-1,{value:n.alpha,type:a.Integer}])])}return new re(r,l,[...t,new oe([o]),new ne([e.Delim,"/",-1,-1,{value:"/"}]),new oe([o]),n.alpha])}function serializeP3(n,r=!0){n.channels=convertPowerlessComponentsToZeroValuesForDisplay(n.channels,n.colorNotation);let o=n.channels.map((e=>Number.isNaN(e)?0:e));r?o=XYZ_D50_to_P3_Gamut(colorData_to_XYZ_D50(n).channels):n.colorNotation!==se.Display_P3&&(o=M(colorData_to_XYZ_D50(n).channels));const t=r?Math.min(1,Math.max(0,toPrecision(o[0],6))):toPrecision(o[0],6),l=r?Math.min(1,Math.max(0,toPrecision(o[1],6))):toPrecision(o[1],6),s=r?Math.min(1,Math.max(0,toPrecision(o[2],6))):toPrecision(o[2],6),u=[e.Function,"color(",-1,-1,{value:"color"}],c=[e.Whitespace," ",-1,-1,void 0];return serializeWithAlpha(n,u,c,[new ne([e.Ident,"display-p3",-1,-1,{value:"display-p3"}]),new oe([c]),new ne([e.Number,t.toString(),-1,-1,{value:o[0],type:a.Number}]),new oe([c]),new ne([e.Number,l.toString(),-1,-1,{value:o[1],type:a.Number}]),new oe([c]),new ne([e.Number,s.toString(),-1,-1,{value:o[2],type:a.Number}])])}function serializeRGB(n,r=!0){n.channels=convertPowerlessComponentsToZeroValuesForDisplay(n.channels,n.colorNotation);let o=n.channels.map((e=>Number.isNaN(e)?0:e));o=r?XYZ_D50_to_sRGB_Gamut(colorData_to_XYZ_D50(n).channels):B(colorData_to_XYZ_D50(n).channels);const t=Math.min(255,Math.max(0,Math.round(255*toPrecision(o[0])))),l=Math.min(255,Math.max(0,Math.round(255*toPrecision(o[1])))),s=Math.min(255,Math.max(0,Math.round(255*toPrecision(o[2])))),u=[e.CloseParen,")",-1,-1,void 0],c=[e.Whitespace," ",-1,-1,void 0],i=[e.Comma,",",-1,-1,void 0],h=[new ne([e.Number,t.toString(),-1,-1,{value:Math.min(255,255*Math.max(0,o[0])),type:a.Integer}]),new ne(i),new oe([c]),new ne([e.Number,l.toString(),-1,-1,{value:Math.min(255,255*Math.max(0,o[1])),type:a.Integer}]),new ne(i),new oe([c]),new ne([e.Number,s.toString(),-1,-1,{value:Math.min(255,255*Math.max(0,o[2])),type:a.Integer}])];if("number"==typeof n.alpha){const r=Math.min(1,Math.max(0,toPrecision(Number.isNaN(n.alpha)?0:n.alpha)));return 1===toPrecision(r,4)?new re([e.Function,"rgb(",-1,-1,{value:"rgb"}],u,h):new re([e.Function,"rgba(",-1,-1,{value:"rgba"}],u,[...h,new ne(i),new oe([c]),new ne([e.Number,toPrecision(r,4).toString(),-1,-1,{value:n.alpha,type:a.Number}])])}return new re([e.Function,"rgba(",-1,-1,{value:"rgba"}],u,[...h,new ne(i),new oe([c]),n.alpha])}function serializeHSL(n,r=!0){n.channels=convertPowerlessComponentsToZeroValuesForDisplay(n.channels,n.colorNotation);let o=n.channels.map((e=>Number.isNaN(e)?0:e));o=z(r?w(XYZ_D50_to_sRGB_Gamut(colorData_to_XYZ_D50(n).channels)):colorData_to_XYZ_D50(n).channels),o=o.map((e=>Number.isNaN(e)?0:e));const t=Math.min(360,Math.max(0,Math.round(toPrecision(o[0])))),l=Math.min(100,Math.max(0,Math.round(toPrecision(o[1])))),s=Math.min(100,Math.max(0,Math.round(toPrecision(o[2])))),u=[e.CloseParen,")",-1,-1,void 0],c=[e.Whitespace," ",-1,-1,void 0],i=[e.Comma,",",-1,-1,void 0],h=[new ne([e.Number,t.toString(),-1,-1,{value:o[0],type:a.Integer}]),new ne(i),new oe([c]),new ne([e.Percentage,l.toString()+"%",-1,-1,{value:o[1]}]),new ne(i),new oe([c]),new ne([e.Percentage,s.toString()+"%",-1,-1,{value:o[2]}])];if("number"==typeof n.alpha){const r=Math.min(1,Math.max(0,toPrecision(Number.isNaN(n.alpha)?0:n.alpha)));return 1===toPrecision(r,4)?new re([e.Function,"hsl(",-1,-1,{value:"hsl"}],u,h):new re([e.Function,"hsla(",-1,-1,{value:"hsla"}],u,[...h,new ne(i),new oe([c]),new ne([e.Number,toPrecision(r,4).toString(),-1,-1,{value:n.alpha,type:a.Number}])])}return new re([e.Function,"hsla(",-1,-1,{value:"hsla"}],u,[...h,new ne(i),new oe([c]),n.alpha])}function serializeOKLCH(n){n.channels=convertPowerlessComponentsToZeroValuesForDisplay(n.channels,n.colorNotation);let r=n.channels.map((e=>Number.isNaN(e)?0:e));n.colorNotation!==se.OKLCH&&(r=L(colorData_to_XYZ_D50(n).channels));const o=toPrecision(r[0],6),t=toPrecision(r[1],6),l=toPrecision(r[2],6),s=[e.Function,"oklch(",-1,-1,{value:"oklch"}],u=[e.Whitespace," ",-1,-1,void 0];return serializeWithAlpha(n,s,u,[new ne([e.Number,o.toString(),-1,-1,{value:r[0],type:a.Number}]),new oe([u]),new ne([e.Number,t.toString(),-1,-1,{value:r[1],type:a.Number}]),new oe([u]),new ne([e.Number,l.toString(),-1,-1,{value:r[2],type:a.Number}])])}function color(e){if(ae(e)){switch(toLowerCaseAZ(e.getName())){case"rgb":case"rgba":return rgb(e,color);case"hsl":case"hsla":return hsl(e,color);case"hwb":return a=color,threeChannelSpaceSeparated(e,normalize_HWB_ChannelValues,se.HWB,[],a);case"lab":return lab(e,color);case"lch":return lch(e,color);case"oklab":return oklab(e,color);case"oklch":return oklch(e,color);case"color":return color$1(e,color);case"color-mix":return colorMix(e,color);case"contrast-color":return contrastColor(e,color)}}var a;if(ee(e)){if(c(e.value))return hex(e.value);if(n(e.value)){const a=namedColor(e.value[4].value);return!1!==a?a:"transparent"===toLowerCaseAZ(e.value[4].value)&&{colorNotation:se.RGB,channels:[0,0,0],alpha:0,syntaxFlags:new Set([ue.ColorKeyword])}}}return!1}export{se as ColorNotation,ue as SyntaxFlag,color,colorDataFitsDisplayP3_Gamut,colorDataFitsRGB_Gamut,serializeHSL,serializeOKLCH,serializeP3,serializeRGB};
+import{TokenType as e,NumberType as a,isTokenIdent as n,isTokenPercentage as r,isTokenNumber as o,isTokenDelim as t,isTokenNumeric as l,isTokenComma as s,isTokenDimension as u,isTokenHash as c}from"@csstools/css-tokenizer";import{XYZ_D65_to_XYZ_D50 as i,XYZ_D50_to_XYZ_D50 as h,OKLCH_to_XYZ_D50 as m,LCH_to_XYZ_D50 as p,OKLab_to_XYZ_D50 as N,Lab_to_XYZ_D50 as b,HWB_to_XYZ_D50 as v,HSL_to_XYZ_D50 as g,ProPhoto_RGB_to_XYZ_D50 as f,a98_RGB_to_XYZ_D50 as d,rec_2020_to_XYZ_D50 as y,P3_to_XYZ_D50 as _,lin_sRGB_to_XYZ_D50 as C,sRGB_to_XYZ_D50 as w,XYZ_D50_to_XYZ_D65 as x,XYZ_D50_to_OKLab as H,XYZ_D50_to_OKLCH as L,XYZ_D50_to_LCH as k,XYZ_D50_to_Lab as S,XYZ_D50_to_HWB as P,XYZ_D50_to_HSL as z,XYZ_D50_to_a98_RGB as D,XYZ_D50_to_ProPhoto as F,XYZ_D50_to_rec_2020 as Z,XYZ_D50_to_P3 as M,XYZ_D50_to_lin_sRGB as R,XYZ_D50_to_sRGB as B,namedColors as G,inGamut as T,clip as V,gam_sRGB as A,mapGamutRayTrace as X,OKLCH_to_OKLab as Y,OKLab_to_XYZ as K,XYZ_to_lin_sRGB as I,lin_sRGB_to_XYZ as O,XYZ_to_OKLab as E,OKLab_to_OKLCH as W,contrast_ratio_wcag_2_1 as U,gam_P3 as $,XYZ_to_lin_P3 as j,lin_P3_to_XYZ as q}from"@csstools/color-helpers";import{isWhitespaceNode as J,isCommentNode as Q,isTokenNode as ee,isFunctionNode as ae,TokenNode as ne,FunctionNode as re,WhitespaceNode as oe}from"@csstools/css-parser-algorithms";import{mathFunctionNames as te,calcFromComponentValues as le}from"@csstools/css-calc";var se,ue;function convertNaNToZero(e){return[Number.isNaN(e[0])?0:e[0],Number.isNaN(e[1])?0:e[1],Number.isNaN(e[2])?0:e[2]]}function colorData_to_XYZ_D50(e){switch(e.colorNotation){case se.HEX:case se.RGB:case se.sRGB:return{...e,colorNotation:se.XYZ_D50,channels:w(convertNaNToZero(e.channels))};case se.Linear_sRGB:return{...e,colorNotation:se.XYZ_D50,channels:C(convertNaNToZero(e.channels))};case se.Display_P3:return{...e,colorNotation:se.XYZ_D50,channels:_(convertNaNToZero(e.channels))};case se.Rec2020:return{...e,colorNotation:se.XYZ_D50,channels:y(convertNaNToZero(e.channels))};case se.A98_RGB:return{...e,colorNotation:se.XYZ_D50,channels:d(convertNaNToZero(e.channels))};case se.ProPhoto_RGB:return{...e,colorNotation:se.XYZ_D50,channels:f(convertNaNToZero(e.channels))};case se.HSL:return{...e,colorNotation:se.XYZ_D50,channels:g(convertNaNToZero(e.channels))};case se.HWB:return{...e,colorNotation:se.XYZ_D50,channels:v(convertNaNToZero(e.channels))};case se.Lab:return{...e,colorNotation:se.XYZ_D50,channels:b(convertNaNToZero(e.channels))};case se.OKLab:return{...e,colorNotation:se.XYZ_D50,channels:N(convertNaNToZero(e.channels))};case se.LCH:return{...e,colorNotation:se.XYZ_D50,channels:p(convertNaNToZero(e.channels))};case se.OKLCH:return{...e,colorNotation:se.XYZ_D50,channels:m(convertNaNToZero(e.channels))};case se.XYZ_D50:return{...e,colorNotation:se.XYZ_D50,channels:h(convertNaNToZero(e.channels))};case se.XYZ_D65:return{...e,colorNotation:se.XYZ_D50,channels:i(convertNaNToZero(e.channels))};default:throw new Error("Unsupported color notation")}}!function(e){e.A98_RGB="a98-rgb",e.Display_P3="display-p3",e.HEX="hex",e.HSL="hsl",e.HWB="hwb",e.LCH="lch",e.Lab="lab",e.Linear_sRGB="srgb-linear",e.OKLCH="oklch",e.OKLab="oklab",e.ProPhoto_RGB="prophoto-rgb",e.RGB="rgb",e.sRGB="srgb",e.Rec2020="rec2020",e.XYZ_D50="xyz-d50",e.XYZ_D65="xyz-d65"}(se||(se={})),function(e){e.ColorKeyword="color-keyword",e.HasAlpha="has-alpha",e.HasDimensionValues="has-dimension-values",e.HasNoneKeywords="has-none-keywords",e.HasNumberValues="has-number-values",e.HasPercentageAlpha="has-percentage-alpha",e.HasPercentageValues="has-percentage-values",e.HasVariableAlpha="has-variable-alpha",e.Hex="hex",e.LegacyHSL="legacy-hsl",e.LegacyRGB="legacy-rgb",e.NamedColor="named-color",e.RelativeColorSyntax="relative-color-syntax",e.ColorMix="color-mix",e.ContrastColor="contrast-color",e.Experimental="experimental"}(ue||(ue={}));const ce=new Set([se.A98_RGB,se.Display_P3,se.HEX,se.Linear_sRGB,se.ProPhoto_RGB,se.RGB,se.sRGB,se.Rec2020,se.XYZ_D50,se.XYZ_D65]);function colorDataTo(e,a){const n={...e};if(e.colorNotation!==a){const e=colorData_to_XYZ_D50(n);switch(a){case se.HEX:case se.RGB:n.colorNotation=se.RGB,n.channels=B(e.channels);break;case se.sRGB:n.colorNotation=se.sRGB,n.channels=B(e.channels);break;case se.Linear_sRGB:n.colorNotation=se.Linear_sRGB,n.channels=R(e.channels);break;case se.Display_P3:n.colorNotation=se.Display_P3,n.channels=M(e.channels);break;case se.Rec2020:n.colorNotation=se.Rec2020,n.channels=Z(e.channels);break;case se.ProPhoto_RGB:n.colorNotation=se.ProPhoto_RGB,n.channels=F(e.channels);break;case se.A98_RGB:n.colorNotation=se.A98_RGB,n.channels=D(e.channels);break;case se.HSL:n.colorNotation=se.HSL,n.channels=z(e.channels);break;case se.HWB:n.colorNotation=se.HWB,n.channels=P(e.channels);break;case se.Lab:n.colorNotation=se.Lab,n.channels=S(e.channels);break;case se.LCH:n.colorNotation=se.LCH,n.channels=k(e.channels);break;case se.OKLCH:n.colorNotation=se.OKLCH,n.channels=L(e.channels);break;case se.OKLab:n.colorNotation=se.OKLab,n.channels=H(e.channels);break;case se.XYZ_D50:n.colorNotation=se.XYZ_D50,n.channels=h(e.channels);break;case se.XYZ_D65:n.colorNotation=se.XYZ_D65,n.channels=x(e.channels);break;default:throw new Error("Unsupported color notation")}}else n.channels=convertNaNToZero(e.channels);if(a===e.colorNotation)n.channels=carryForwardMissingComponents(e.channels,[0,1,2],n.channels,[0,1,2]);else if(ce.has(a)&&ce.has(e.colorNotation))n.channels=carryForwardMissingComponents(e.channels,[0,1,2],n.channels,[0,1,2]);else switch(a){case se.HSL:switch(e.colorNotation){case se.HWB:n.channels=carryForwardMissingComponents(e.channels,[0],n.channels,[0]);break;case se.Lab:case se.OKLab:n.channels=carryForwardMissingComponents(e.channels,[2],n.channels,[0]);break;case se.LCH:case se.OKLCH:n.channels=carryForwardMissingComponents(e.channels,[0,1,2],n.channels,[2,1,0])}break;case se.HWB:switch(e.colorNotation){case se.HSL:n.channels=carryForwardMissingComponents(e.channels,[0],n.channels,[0]);break;case se.LCH:case se.OKLCH:n.channels=carryForwardMissingComponents(e.channels,[0],n.channels,[2])}break;case se.Lab:case se.OKLab:switch(e.colorNotation){case se.HSL:n.channels=carryForwardMissingComponents(e.channels,[0],n.channels,[2]);break;case se.Lab:case se.OKLab:n.channels=carryForwardMissingComponents(e.channels,[0,1,2],n.channels,[0,1,2]);break;case se.LCH:case se.OKLCH:n.channels=carryForwardMissingComponents(e.channels,[0],n.channels,[0])}break;case se.LCH:case se.OKLCH:switch(e.colorNotation){case se.HSL:n.channels=carryForwardMissingComponents(e.channels,[0,1,2],n.channels,[2,1,0]);break;case se.HWB:n.channels=carryForwardMissingComponents(e.channels,[0],n.channels,[2]);break;case se.Lab:case se.OKLab:n.channels=carryForwardMissingComponents(e.channels,[0],n.channels,[0]);break;case se.LCH:case se.OKLCH:n.channels=carryForwardMissingComponents(e.channels,[0,1,2],n.channels,[0,1,2])}}return n.channels=convertPowerlessComponentsToMissingComponents(n.channels,a),n}function convertPowerlessComponentsToMissingComponents(e,a){const n=[...e];switch(a){case se.HSL:!Number.isNaN(n[1])&&reducePrecision(n[1],4)<=0&&(n[0]=NaN);break;case se.HWB:Math.max(0,reducePrecision(n[1],4))+Math.max(0,reducePrecision(n[2],4))>=100&&(n[0]=NaN);break;case se.LCH:!Number.isNaN(n[1])&&reducePrecision(n[1],4)<=0&&(n[2]=NaN);break;case se.OKLCH:!Number.isNaN(n[1])&&reducePrecision(n[1],6)<=0&&(n[2]=NaN)}return n}function convertPowerlessComponentsToZeroValuesForDisplay(e,a){const n=[...e];switch(a){case se.HSL:(reducePrecision(n[2])<=0||reducePrecision(n[2])>=100)&&(n[0]=NaN,n[1]=NaN),reducePrecision(n[1])<=0&&(n[0]=NaN);break;case se.HWB:Math.max(0,reducePrecision(n[1]))+Math.max(0,reducePrecision(n[2]))>=100&&(n[0]=NaN);break;case se.Lab:(reducePrecision(n[0])<=0||reducePrecision(n[0])>=100)&&(n[1]=NaN,n[2]=NaN);break;case se.LCH:reducePrecision(n[1])<=0&&(n[2]=NaN),(reducePrecision(n[0])<=0||reducePrecision(n[0])>=100)&&(n[1]=NaN,n[2]=NaN);break;case se.OKLab:(reducePrecision(n[0])<=0||reducePrecision(n[0])>=1)&&(n[1]=NaN,n[2]=NaN);break;case se.OKLCH:reducePrecision(n[1])<=0&&(n[2]=NaN),(reducePrecision(n[0])<=0||reducePrecision(n[0])>=1)&&(n[1]=NaN,n[2]=NaN)}return n}function carryForwardMissingComponents(e,a,n,r){const o=[...n];for(const n of a)Number.isNaN(e[a[n]])&&(o[r[n]]=NaN);return o}function normalizeRelativeColorDataChannels(e){const a=new Map;switch(e.colorNotation){case se.RGB:case se.HEX:a.set("r",dummyNumberToken(255*e.channels[0])),a.set("g",dummyNumberToken(255*e.channels[1])),a.set("b",dummyNumberToken(255*e.channels[2])),"number"==typeof e.alpha&&a.set("alpha",dummyNumberToken(e.alpha));break;case se.HSL:a.set("h",dummyNumberToken(e.channels[0])),a.set("s",dummyNumberToken(e.channels[1])),a.set("l",dummyNumberToken(e.channels[2])),"number"==typeof e.alpha&&a.set("alpha",dummyNumberToken(e.alpha));break;case se.HWB:a.set("h",dummyNumberToken(e.channels[0])),a.set("w",dummyNumberToken(e.channels[1])),a.set("b",dummyNumberToken(e.channels[2])),"number"==typeof e.alpha&&a.set("alpha",dummyNumberToken(e.alpha));break;case se.Lab:case se.OKLab:a.set("l",dummyNumberToken(e.channels[0])),a.set("a",dummyNumberToken(e.channels[1])),a.set("b",dummyNumberToken(e.channels[2])),"number"==typeof e.alpha&&a.set("alpha",dummyNumberToken(e.alpha));break;case se.LCH:case se.OKLCH:a.set("l",dummyNumberToken(e.channels[0])),a.set("c",dummyNumberToken(e.channels[1])),a.set("h",dummyNumberToken(e.channels[2])),"number"==typeof e.alpha&&a.set("alpha",dummyNumberToken(e.alpha));break;case se.sRGB:case se.A98_RGB:case se.Display_P3:case se.Rec2020:case se.Linear_sRGB:case se.ProPhoto_RGB:a.set("r",dummyNumberToken(e.channels[0])),a.set("g",dummyNumberToken(e.channels[1])),a.set("b",dummyNumberToken(e.channels[2])),"number"==typeof e.alpha&&a.set("alpha",dummyNumberToken(e.alpha));break;case se.XYZ_D50:case se.XYZ_D65:a.set("x",dummyNumberToken(e.channels[0])),a.set("y",dummyNumberToken(e.channels[1])),a.set("z",dummyNumberToken(e.channels[2])),"number"==typeof e.alpha&&a.set("alpha",dummyNumberToken(e.alpha))}return a}function noneToZeroInRelativeColorDataChannels(e){const a=new Map(e);for(const[n,r]of e)Number.isNaN(r[4].value)&&a.set(n,dummyNumberToken(0));return a}function dummyNumberToken(n){return Number.isNaN(n)?[e.Number,"none",-1,-1,{value:Number.NaN,type:a.Number}]:[e.Number,n.toString(),-1,-1,{value:n,type:a.Number}]}function reducePrecision(e,a=7){if(Number.isNaN(e))return 0;const n=Math.pow(10,a);return Math.round(e*n)/n}function colorDataFitsRGB_Gamut(e){const a={...e,channels:[...e.channels]};a.channels=convertPowerlessComponentsToZeroValuesForDisplay(a.channels,a.colorNotation);return!colorDataTo(a,se.RGB).channels.find((e=>e<-1e-5||e>1.00001))}function colorDataFitsDisplayP3_Gamut(e){const a={...e,channels:[...e.channels]};a.channels=convertPowerlessComponentsToZeroValuesForDisplay(a.channels,a.colorNotation);return!colorDataTo(a,se.Display_P3).channels.find((e=>e<-1e-5||e>1.00001))}function normalize(e,a,n,r){return Math.min(Math.max(e/a,n),r)}const ie=/[A-Z]/g;function toLowerCaseAZ(e){return e.replace(ie,(e=>String.fromCharCode(e.charCodeAt(0)+32)))}function normalize_Color_ChannelValues(t,l,s){if(n(t)&&"none"===toLowerCaseAZ(t[4].value))return s.syntaxFlags.add(ue.HasNoneKeywords),[e.Number,"none",t[2],t[3],{value:NaN,type:a.Number}];if(r(t)){3!==l&&s.syntaxFlags.add(ue.HasPercentageValues);let n=normalize(t[4].value,100,-2147483647,2147483647);return 3===l&&(n=normalize(t[4].value,100,0,1)),[e.Number,n.toString(),t[2],t[3],{value:n,type:a.Number}]}if(o(t)){3!==l&&s.syntaxFlags.add(ue.HasNumberValues);let n=normalize(t[4].value,1,-2147483647,2147483647);return 3===l&&(n=normalize(t[4].value,1,0,1)),[e.Number,n.toString(),t[2],t[3],{value:n,type:a.Number}]}return!1}const he=new Set(["srgb","srgb-linear","display-p3","a98-rgb","prophoto-rgb","rec2020","xyz","xyz-d50","xyz-d65"]);function color$1(e,a){const r=[],s=[],u=[],c=[];let i,h,m=!1,p=!1;const N={colorNotation:se.sRGB,channels:[0,0,0],alpha:1,syntaxFlags:new Set([])};let b=r;for(let o=0;o=0){u=c.value[4].value;continue}}return!1}if(!t)return!1;n.push({color:t,percentage:u}),t=!1,u=!1}}if(t&&n.push({color:t,percentage:u}),2!==n.length)return!1;let c=n[0].percentage,i=n[1].percentage;return(!1===c||!(c<0||c>100))&&((!1===i||!(i<0||i>100))&&(!1===c&&!1===i?(c=50,i=50):!1!==c&&!1===i?i=100-c:!1===c&&!1!==i&&(c=100-i),(0!==c||0!==i)&&(!1!==c&&!1!==i&&(c+i>100&&(c=c/(c+i)*100,i=i/(c+i)*100),c+i<100&&(o=(c+i)/100,c=c/(c+i)*100,i=i/(c+i)*100),{a:{color:n[0].color,percentage:c},b:{color:n[1].color,percentage:i},alphaMultiplier:o}))))}function colorMixRectangular(e,a){if(!a)return!1;const n=a.a.color,r=a.b.color,o=a.a.percentage/100;let t=n.channels,l=r.channels,s=se.RGB,u=n.alpha;if("number"!=typeof u)return!1;let c=r.alpha;if("number"!=typeof c)return!1;switch(u=Number.isNaN(u)?c:u,c=Number.isNaN(c)?u:c,e){case"srgb":s=se.RGB;break;case"srgb-linear":s=se.Linear_sRGB;break;case"display-p3":s=se.Display_P3;break;case"a98-rgb":s=se.A98_RGB;break;case"prophoto-rgb":s=se.ProPhoto_RGB;break;case"rec2020":s=se.Rec2020;break;case"lab":s=se.Lab;break;case"oklab":s=se.OKLab;break;case"xyz-d50":s=se.XYZ_D50;break;case"xyz":case"xyz-d65":s=se.XYZ_D65}t=colorDataTo(n,s).channels,l=colorDataTo(r,s).channels,t[0]=fillInMissingComponent(t[0],l[0]),l[0]=fillInMissingComponent(l[0],t[0]),t[1]=fillInMissingComponent(t[1],l[1]),l[1]=fillInMissingComponent(l[1],t[1]),t[2]=fillInMissingComponent(t[2],l[2]),l[2]=fillInMissingComponent(l[2],t[2]),t[0]=premultiply(t[0],u),t[1]=premultiply(t[1],u),t[2]=premultiply(t[2],u),l[0]=premultiply(l[0],c),l[1]=premultiply(l[1],c),l[2]=premultiply(l[2],c);const i=interpolate(u,c,o),h={colorNotation:s,channels:[un_premultiply(interpolate(t[0],l[0],o),i),un_premultiply(interpolate(t[1],l[1],o),i),un_premultiply(interpolate(t[2],l[2],o),i)],alpha:i*a.alphaMultiplier,syntaxFlags:new Set([ue.ColorMix])};return(a.a.color.syntaxFlags.has(ue.Experimental)||a.b.color.syntaxFlags.has(ue.Experimental))&&h.syntaxFlags.add(ue.Experimental),h}function colorMixPolar(e,a,n){if(!n)return!1;const r=n.a.color,o=n.b.color,t=n.a.percentage/100;let l=r.channels,s=o.channels,u=0,c=0,i=0,h=0,m=0,p=0,N=se.RGB,b=r.alpha;if("number"!=typeof b)return!1;let v=o.alpha;if("number"!=typeof v)return!1;switch(b=Number.isNaN(b)?v:b,v=Number.isNaN(v)?b:v,e){case"hsl":N=se.HSL;break;case"hwb":N=se.HWB;break;case"lch":N=se.LCH;break;case"oklch":N=se.OKLCH}switch(l=colorDataTo(r,N).channels,s=colorDataTo(o,N).channels,e){case"hsl":case"hwb":u=l[0],c=s[0],i=l[1],h=s[1],m=l[2],p=s[2];break;case"lch":case"oklch":i=l[0],h=s[0],m=l[1],p=s[1],u=l[2],c=s[2]}u=fillInMissingComponent(u,c),Number.isNaN(u)&&(u=0),c=fillInMissingComponent(c,u),Number.isNaN(c)&&(c=0),i=fillInMissingComponent(i,h),h=fillInMissingComponent(h,i),m=fillInMissingComponent(m,p),p=fillInMissingComponent(p,m);const g=c-u;switch(a){case"shorter":g>180?u+=360:g<-180&&(c+=360);break;case"longer":-180<180&&(g>0?u+=360:c+=360);break;case"increasing":g<0&&(c+=360);break;case"decreasing":g>0&&(u+=360);break;default:throw new Error("Unknown hue interpolation method")}i=premultiply(i,b),m=premultiply(m,b),h=premultiply(h,v),p=premultiply(p,v);let f=[0,0,0];const d=interpolate(b,v,t);switch(e){case"hsl":case"hwb":f=[interpolate(u,c,t),un_premultiply(interpolate(i,h,t),d),un_premultiply(interpolate(m,p,t),d)];break;case"lch":case"oklch":f=[un_premultiply(interpolate(i,h,t),d),un_premultiply(interpolate(m,p,t),d),interpolate(u,c,t)]}const y={colorNotation:N,channels:f,alpha:d*n.alphaMultiplier,syntaxFlags:new Set([ue.ColorMix])};return(n.a.color.syntaxFlags.has(ue.Experimental)||n.b.color.syntaxFlags.has(ue.Experimental))&&y.syntaxFlags.add(ue.Experimental),y}function fillInMissingComponent(e,a){return Number.isNaN(e)?a:e}function interpolate(e,a,n){return e*n+a*(1-n)}function premultiply(e,a){return Number.isNaN(a)?e:Number.isNaN(e)?NaN:e*a}function un_premultiply(e,a){return 0===a||Number.isNaN(a)?e:Number.isNaN(e)?NaN:e/a}function hex(e){const a=toLowerCaseAZ(e[4].value);if(a.match(/[^a-f0-9]/))return!1;const n={colorNotation:se.HEX,channels:[0,0,0],alpha:1,syntaxFlags:new Set([ue.Hex])},r=a.length;if(3===r){const e=a[0],r=a[1],o=a[2];return n.channels=[parseInt(e+e,16)/255,parseInt(r+r,16)/255,parseInt(o+o,16)/255],n}if(6===r){const e=a[0]+a[1],r=a[2]+a[3],o=a[4]+a[5];return n.channels=[parseInt(e,16)/255,parseInt(r,16)/255,parseInt(o,16)/255],n}if(4===r){const e=a[0],r=a[1],o=a[2],t=a[3];return n.channels=[parseInt(e+e,16)/255,parseInt(r+r,16)/255,parseInt(o+o,16)/255],n.alpha=parseInt(t+t,16)/255,n.syntaxFlags.add(ue.HasAlpha),n}if(8===r){const e=a[0]+a[1],r=a[2]+a[3],o=a[4]+a[5],t=a[6]+a[7];return n.channels=[parseInt(e,16)/255,parseInt(r,16)/255,parseInt(o,16)/255],n.alpha=parseInt(t,16)/255,n.syntaxFlags.add(ue.HasAlpha),n}return!1}function normalizeHue(n){if(o(n))return n[4].value=n[4].value%360,n[1]=n[4].value.toString(),n;if(u(n)){let r=n[4].value;switch(toLowerCaseAZ(n[4].unit)){case"deg":break;case"rad":r=180*n[4].value/Math.PI;break;case"grad":r=.9*n[4].value;break;case"turn":r=360*n[4].value;break;default:return!1}return r%=360,[e.Number,r.toString(),n[2],n[3],{value:r,type:a.Number}]}return!1}function normalize_legacy_HSL_ChannelValues(n,t,l){if(0===t){const e=normalizeHue(n);return!1!==e&&(u(n)&&l.syntaxFlags.add(ue.HasDimensionValues),e)}if(r(n)){3===t?l.syntaxFlags.add(ue.HasPercentageAlpha):l.syntaxFlags.add(ue.HasPercentageValues);let r=normalize(n[4].value,1,0,100);return 3===t&&(r=normalize(n[4].value,100,0,1)),[e.Number,r.toString(),n[2],n[3],{value:r,type:a.Number}]}if(o(n)){if(3!==t)return!1;let r=normalize(n[4].value,1,0,100);return 3===t&&(r=normalize(n[4].value,1,0,1)),[e.Number,r.toString(),n[2],n[3],{value:r,type:a.Number}]}return!1}function normalize_modern_HSL_ChannelValues(t,l,s){if(n(t)&&"none"===toLowerCaseAZ(t[4].value))return s.syntaxFlags.add(ue.HasNoneKeywords),[e.Number,"none",t[2],t[3],{value:NaN,type:a.Number}];if(0===l){const e=normalizeHue(t);return!1!==e&&(u(t)&&s.syntaxFlags.add(ue.HasDimensionValues),e)}if(r(t)){3===l?s.syntaxFlags.add(ue.HasPercentageAlpha):s.syntaxFlags.add(ue.HasPercentageValues);let n=t[4].value;return 3===l?n=normalize(t[4].value,100,0,1):1===l&&(n=normalize(t[4].value,1,0,2147483647)),[e.Number,n.toString(),t[2],t[3],{value:n,type:a.Number}]}if(o(t)){3!==l&&s.syntaxFlags.add(ue.HasNumberValues);let n=t[4].value;return 3===l?n=normalize(t[4].value,1,0,1):1===l&&(n=normalize(t[4].value,1,0,2147483647)),[e.Number,n.toString(),t[2],t[3],{value:n,type:a.Number}]}return!1}function threeChannelLegacySyntax(e,a,n,r){const t=[],u=[],c=[],i=[],h={colorNotation:n,channels:[0,0,0],alpha:1,syntaxFlags:new Set(r)};let m=t;for(let a=0;aee(e)&&s(e.value)))){const a=hslCommaSeparated(e);if(!1!==a)return a}{const n=hslSpaceSeparated(e,a);if(!1!==n)return n}return!1}function hslCommaSeparated(e){return threeChannelLegacySyntax(e,normalize_legacy_HSL_ChannelValues,se.HSL,[ue.LegacyHSL])}function hslSpaceSeparated(e,a){return threeChannelSpaceSeparated(e,normalize_modern_HSL_ChannelValues,se.HSL,[],a)}function normalize_HWB_ChannelValues(t,l,s){if(n(t)&&"none"===toLowerCaseAZ(t[4].value))return s.syntaxFlags.add(ue.HasNoneKeywords),[e.Number,"none",t[2],t[3],{value:NaN,type:a.Number}];if(0===l){const e=normalizeHue(t);return!1!==e&&(u(t)&&s.syntaxFlags.add(ue.HasDimensionValues),e)}if(r(t)){3===l?s.syntaxFlags.add(ue.HasPercentageAlpha):s.syntaxFlags.add(ue.HasPercentageValues);let n=t[4].value;return 3===l&&(n=normalize(t[4].value,100,0,1)),[e.Number,n.toString(),t[2],t[3],{value:n,type:a.Number}]}if(o(t)){3!==l&&s.syntaxFlags.add(ue.HasNumberValues);let n=t[4].value;return 3===l&&(n=normalize(t[4].value,1,0,1)),[e.Number,n.toString(),t[2],t[3],{value:n,type:a.Number}]}return!1}function normalize_Lab_ChannelValues(t,l,s){if(n(t)&&"none"===toLowerCaseAZ(t[4].value))return s.syntaxFlags.add(ue.HasNoneKeywords),[e.Number,"none",t[2],t[3],{value:NaN,type:a.Number}];if(r(t)){3!==l&&s.syntaxFlags.add(ue.HasPercentageValues);let n=normalize(t[4].value,1,0,100);return 1===l||2===l?n=normalize(t[4].value,.8,-2147483647,2147483647):3===l&&(n=normalize(t[4].value,100,0,1)),[e.Number,n.toString(),t[2],t[3],{value:n,type:a.Number}]}if(o(t)){3!==l&&s.syntaxFlags.add(ue.HasNumberValues);let n=normalize(t[4].value,1,0,100);return 1===l||2===l?n=normalize(t[4].value,1,-2147483647,2147483647):3===l&&(n=normalize(t[4].value,1,0,1)),[e.Number,n.toString(),t[2],t[3],{value:n,type:a.Number}]}return!1}function lab(e,a){return threeChannelSpaceSeparated(e,normalize_Lab_ChannelValues,se.Lab,[],a)}function normalize_LCH_ChannelValues(t,l,s){if(n(t)&&"none"===toLowerCaseAZ(t[4].value))return s.syntaxFlags.add(ue.HasNoneKeywords),[e.Number,"none",t[2],t[3],{value:NaN,type:a.Number}];if(2===l){const e=normalizeHue(t);return!1!==e&&(u(t)&&s.syntaxFlags.add(ue.HasDimensionValues),e)}if(r(t)){3!==l&&s.syntaxFlags.add(ue.HasPercentageValues);let n=normalize(t[4].value,1,0,100);return 1===l?n=normalize(t[4].value,100/150,0,2147483647):3===l&&(n=normalize(t[4].value,100,0,1)),[e.Number,n.toString(),t[2],t[3],{value:n,type:a.Number}]}if(o(t)){3!==l&&s.syntaxFlags.add(ue.HasNumberValues);let n=normalize(t[4].value,1,0,100);return 1===l?n=normalize(t[4].value,1,0,2147483647):3===l&&(n=normalize(t[4].value,1,0,1)),[e.Number,n.toString(),t[2],t[3],{value:n,type:a.Number}]}return!1}function lch(e,a){return threeChannelSpaceSeparated(e,normalize_LCH_ChannelValues,se.LCH,[],a)}const be=new Map;for(const[e,a]of Object.entries(G))be.set(e,a);function namedColor(e){const a=be.get(toLowerCaseAZ(e));return!!a&&{colorNotation:se.RGB,channels:[a[0]/255,a[1]/255,a[2]/255],alpha:1,syntaxFlags:new Set([ue.ColorKeyword,ue.NamedColor])}}function normalize_OKLab_ChannelValues(t,l,s){if(n(t)&&"none"===toLowerCaseAZ(t[4].value))return s.syntaxFlags.add(ue.HasNoneKeywords),[e.Number,"none",t[2],t[3],{value:NaN,type:a.Number}];if(r(t)){3!==l&&s.syntaxFlags.add(ue.HasPercentageValues);let n=normalize(t[4].value,100,0,1);return 1===l||2===l?n=normalize(t[4].value,250,-2147483647,2147483647):3===l&&(n=normalize(t[4].value,100,0,1)),[e.Number,n.toString(),t[2],t[3],{value:n,type:a.Number}]}if(o(t)){3!==l&&s.syntaxFlags.add(ue.HasNumberValues);let n=normalize(t[4].value,1,0,1);return 1===l||2===l?n=normalize(t[4].value,1,-2147483647,2147483647):3===l&&(n=normalize(t[4].value,1,0,1)),[e.Number,n.toString(),t[2],t[3],{value:n,type:a.Number}]}return!1}function oklab(e,a){return threeChannelSpaceSeparated(e,normalize_OKLab_ChannelValues,se.OKLab,[],a)}function normalize_OKLCH_ChannelValues(t,l,s){if(n(t)&&"none"===toLowerCaseAZ(t[4].value))return s.syntaxFlags.add(ue.HasNoneKeywords),[e.Number,"none",t[2],t[3],{value:NaN,type:a.Number}];if(2===l){const e=normalizeHue(t);return!1!==e&&(u(t)&&s.syntaxFlags.add(ue.HasDimensionValues),e)}if(r(t)){3!==l&&s.syntaxFlags.add(ue.HasPercentageValues);let n=normalize(t[4].value,100,0,1);return 1===l?n=normalize(t[4].value,250,0,2147483647):3===l&&(n=normalize(t[4].value,100,0,1)),[e.Number,n.toString(),t[2],t[3],{value:n,type:a.Number}]}if(o(t)){3!==l&&s.syntaxFlags.add(ue.HasNumberValues);let n=normalize(t[4].value,1,0,1);return 1===l?n=normalize(t[4].value,1,0,2147483647):3===l&&(n=normalize(t[4].value,1,0,1)),[e.Number,n.toString(),t[2],t[3],{value:n,type:a.Number}]}return!1}function oklch(e,a){return threeChannelSpaceSeparated(e,normalize_OKLCH_ChannelValues,se.OKLCH,[],a)}function normalize_legacy_sRGB_ChannelValues(n,t,l){if(r(n)){3===t?l.syntaxFlags.add(ue.HasPercentageAlpha):l.syntaxFlags.add(ue.HasPercentageValues);const r=normalize(n[4].value,100,0,1);return[e.Number,r.toString(),n[2],n[3],{value:r,type:a.Number}]}if(o(n)){3!==t&&l.syntaxFlags.add(ue.HasNumberValues);let r=normalize(n[4].value,255,0,1);return 3===t&&(r=normalize(n[4].value,1,0,1)),[e.Number,r.toString(),n[2],n[3],{value:r,type:a.Number}]}return!1}function normalize_modern_sRGB_ChannelValues(t,l,s){if(n(t)&&"none"===t[4].value.toLowerCase())return s.syntaxFlags.add(ue.HasNoneKeywords),[e.Number,"none",t[2],t[3],{value:NaN,type:a.Number}];if(r(t)){3!==l&&s.syntaxFlags.add(ue.HasPercentageValues);let n=normalize(t[4].value,100,-2147483647,2147483647);return 3===l&&(n=normalize(t[4].value,100,0,1)),[e.Number,n.toString(),t[2],t[3],{value:n,type:a.Number}]}if(o(t)){3!==l&&s.syntaxFlags.add(ue.HasNumberValues);let n=normalize(t[4].value,255,-2147483647,2147483647);return 3===l&&(n=normalize(t[4].value,1,0,1)),[e.Number,n.toString(),t[2],t[3],{value:n,type:a.Number}]}return!1}function rgb(e,a){if(e.value.some((e=>ee(e)&&s(e.value)))){const a=rgbCommaSeparated(e);if(!1!==a)return(!a.syntaxFlags.has(ue.HasNumberValues)||!a.syntaxFlags.has(ue.HasPercentageValues))&&a}else{const n=rgbSpaceSeparated(e,a);if(!1!==n)return n}return!1}function rgbCommaSeparated(e){return threeChannelLegacySyntax(e,normalize_legacy_sRGB_ChannelValues,se.RGB,[ue.LegacyRGB])}function rgbSpaceSeparated(e,a){return threeChannelSpaceSeparated(e,normalize_modern_sRGB_ChannelValues,se.RGB,[],a)}function XYZ_D50_to_sRGB_Gamut(e){const a=B(e);if(T(a))return V(a);let n=e;return n=L(n),n[0]<1e-6&&(n=[0,0,0]),n[0]>.999999&&(n=[1,0,0]),A(X(n,oklch_to_lin_srgb,lin_srgb_to_oklch))}function oklch_to_lin_srgb(e){return e=Y(e),e=K(e),I(e)}function lin_srgb_to_oklch(e){return e=O(e),e=E(e),W(e)}function contrastColor(e,a){let r=!1,o=!1;for(let t=0;ts?[1,1,1]:[0,0,0],t}function XYZ_D50_to_P3_Gamut(e){const a=M(e);if(T(a))return V(a);let n=e;return n=L(n),n[0]<1e-6&&(n=[0,0,0]),n[0]>.999999&&(n=[1,0,0]),$(X(n,oklch_to_lin_p3,lin_p3_to_oklch))}function oklch_to_lin_p3(e){return e=Y(e),e=K(e),j(e)}function lin_p3_to_oklch(e){return e=q(e),e=E(e),W(e)}function toPrecision(e,a=7){e=+e,a=+a;const n=(Math.floor(e)+"").length;if(a>n)return+e.toFixed(a-n);{const r=10**(n-a);return Math.round(e/r)*r}}function serializeWithAlpha(n,r,o,t){const l=[e.CloseParen,")",-1,-1,void 0];if("number"==typeof n.alpha){const s=Math.min(1,Math.max(0,toPrecision(Number.isNaN(n.alpha)?0:n.alpha)));return 1===toPrecision(s,4)?new re(r,l,t):new re(r,l,[...t,new oe([o]),new ne([e.Delim,"/",-1,-1,{value:"/"}]),new oe([o]),new ne([e.Number,toPrecision(s,4).toString(),-1,-1,{value:n.alpha,type:a.Integer}])])}return new re(r,l,[...t,new oe([o]),new ne([e.Delim,"/",-1,-1,{value:"/"}]),new oe([o]),n.alpha])}function serializeP3(n,r=!0){n.channels=convertPowerlessComponentsToZeroValuesForDisplay(n.channels,n.colorNotation);let o=n.channels.map((e=>Number.isNaN(e)?0:e));r?o=XYZ_D50_to_P3_Gamut(colorData_to_XYZ_D50(n).channels):n.colorNotation!==se.Display_P3&&(o=M(colorData_to_XYZ_D50(n).channels));const t=r?Math.min(1,Math.max(0,toPrecision(o[0],6))):toPrecision(o[0],6),l=r?Math.min(1,Math.max(0,toPrecision(o[1],6))):toPrecision(o[1],6),s=r?Math.min(1,Math.max(0,toPrecision(o[2],6))):toPrecision(o[2],6),u=[e.Function,"color(",-1,-1,{value:"color"}],c=[e.Whitespace," ",-1,-1,void 0];return serializeWithAlpha(n,u,c,[new ne([e.Ident,"display-p3",-1,-1,{value:"display-p3"}]),new oe([c]),new ne([e.Number,t.toString(),-1,-1,{value:o[0],type:a.Number}]),new oe([c]),new ne([e.Number,l.toString(),-1,-1,{value:o[1],type:a.Number}]),new oe([c]),new ne([e.Number,s.toString(),-1,-1,{value:o[2],type:a.Number}])])}function serializeRGB(n,r=!0){n.channels=convertPowerlessComponentsToZeroValuesForDisplay(n.channels,n.colorNotation);let o=n.channels.map((e=>Number.isNaN(e)?0:e));o=r?XYZ_D50_to_sRGB_Gamut(colorData_to_XYZ_D50(n).channels):B(colorData_to_XYZ_D50(n).channels);const t=Math.min(255,Math.max(0,Math.round(255*toPrecision(o[0])))),l=Math.min(255,Math.max(0,Math.round(255*toPrecision(o[1])))),s=Math.min(255,Math.max(0,Math.round(255*toPrecision(o[2])))),u=[e.CloseParen,")",-1,-1,void 0],c=[e.Whitespace," ",-1,-1,void 0],i=[e.Comma,",",-1,-1,void 0],h=[new ne([e.Number,t.toString(),-1,-1,{value:Math.min(255,255*Math.max(0,o[0])),type:a.Integer}]),new ne(i),new oe([c]),new ne([e.Number,l.toString(),-1,-1,{value:Math.min(255,255*Math.max(0,o[1])),type:a.Integer}]),new ne(i),new oe([c]),new ne([e.Number,s.toString(),-1,-1,{value:Math.min(255,255*Math.max(0,o[2])),type:a.Integer}])];if("number"==typeof n.alpha){const r=Math.min(1,Math.max(0,toPrecision(Number.isNaN(n.alpha)?0:n.alpha)));return 1===toPrecision(r,4)?new re([e.Function,"rgb(",-1,-1,{value:"rgb"}],u,h):new re([e.Function,"rgba(",-1,-1,{value:"rgba"}],u,[...h,new ne(i),new oe([c]),new ne([e.Number,toPrecision(r,4).toString(),-1,-1,{value:n.alpha,type:a.Number}])])}return new re([e.Function,"rgba(",-1,-1,{value:"rgba"}],u,[...h,new ne(i),new oe([c]),n.alpha])}function serializeHSL(n,r=!0){n.channels=convertPowerlessComponentsToZeroValuesForDisplay(n.channels,n.colorNotation);let o=n.channels.map((e=>Number.isNaN(e)?0:e));o=z(r?w(XYZ_D50_to_sRGB_Gamut(colorData_to_XYZ_D50(n).channels)):colorData_to_XYZ_D50(n).channels),o=o.map((e=>Number.isNaN(e)?0:e));const t=Math.min(360,Math.max(0,Math.round(toPrecision(o[0])))),l=Math.min(100,Math.max(0,Math.round(toPrecision(o[1])))),s=Math.min(100,Math.max(0,Math.round(toPrecision(o[2])))),u=[e.CloseParen,")",-1,-1,void 0],c=[e.Whitespace," ",-1,-1,void 0],i=[e.Comma,",",-1,-1,void 0],h=[new ne([e.Number,t.toString(),-1,-1,{value:o[0],type:a.Integer}]),new ne(i),new oe([c]),new ne([e.Percentage,l.toString()+"%",-1,-1,{value:o[1]}]),new ne(i),new oe([c]),new ne([e.Percentage,s.toString()+"%",-1,-1,{value:o[2]}])];if("number"==typeof n.alpha){const r=Math.min(1,Math.max(0,toPrecision(Number.isNaN(n.alpha)?0:n.alpha)));return 1===toPrecision(r,4)?new re([e.Function,"hsl(",-1,-1,{value:"hsl"}],u,h):new re([e.Function,"hsla(",-1,-1,{value:"hsla"}],u,[...h,new ne(i),new oe([c]),new ne([e.Number,toPrecision(r,4).toString(),-1,-1,{value:n.alpha,type:a.Number}])])}return new re([e.Function,"hsla(",-1,-1,{value:"hsla"}],u,[...h,new ne(i),new oe([c]),n.alpha])}function serializeOKLCH(n){n.channels=convertPowerlessComponentsToZeroValuesForDisplay(n.channels,n.colorNotation);let r=n.channels.map((e=>Number.isNaN(e)?0:e));n.colorNotation!==se.OKLCH&&(r=L(colorData_to_XYZ_D50(n).channels));const o=toPrecision(r[0],6),t=toPrecision(r[1],6),l=toPrecision(r[2],6),s=[e.Function,"oklch(",-1,-1,{value:"oklch"}],u=[e.Whitespace," ",-1,-1,void 0];return serializeWithAlpha(n,s,u,[new ne([e.Number,o.toString(),-1,-1,{value:r[0],type:a.Number}]),new oe([u]),new ne([e.Number,t.toString(),-1,-1,{value:r[1],type:a.Number}]),new oe([u]),new ne([e.Number,l.toString(),-1,-1,{value:r[2],type:a.Number}])])}function color(e){if(ae(e)){switch(toLowerCaseAZ(e.getName())){case"rgb":case"rgba":return rgb(e,color);case"hsl":case"hsla":return hsl(e,color);case"hwb":return a=color,threeChannelSpaceSeparated(e,normalize_HWB_ChannelValues,se.HWB,[],a);case"lab":return lab(e,color);case"lch":return lch(e,color);case"oklab":return oklab(e,color);case"oklch":return oklch(e,color);case"color":return color$1(e,color);case"color-mix":return colorMix(e,color);case"contrast-color":return contrastColor(e,color)}}var a;if(ee(e)){if(c(e.value))return hex(e.value);if(n(e.value)){const a=namedColor(e.value[4].value);return!1!==a?a:"transparent"===toLowerCaseAZ(e.value[4].value)&&{colorNotation:se.RGB,channels:[0,0,0],alpha:0,syntaxFlags:new Set([ue.ColorKeyword])}}}return!1}export{se as ColorNotation,ue as SyntaxFlag,color,colorDataFitsDisplayP3_Gamut,colorDataFitsRGB_Gamut,serializeHSL,serializeOKLCH,serializeP3,serializeRGB};
diff --git a/packages/css-color-parser/package.json b/packages/css-color-parser/package.json
index 085764e25..5d84d526b 100644
--- a/packages/css-color-parser/package.json
+++ b/packages/css-color-parser/package.json
@@ -25,7 +25,7 @@
}
],
"engines": {
- "node": "^14 || ^16 || >=18"
+ "node": ">=18"
},
"type": "module",
"main": "dist/index.cjs",
diff --git a/packages/css-color-parser/src/color-data.ts b/packages/css-color-parser/src/color-data.ts
index fff0f2ec9..3cbff4319 100644
--- a/packages/css-color-parser/src/color-data.ts
+++ b/packages/css-color-parser/src/color-data.ts
@@ -1,7 +1,8 @@
import type { Color } from '@csstools/color-helpers';
import type { ComponentValue } from '@csstools/css-parser-algorithms';
import { ColorNotation } from './color-notation';
-import { NumberType, TokenNumber, TokenType } from '@csstools/css-tokenizer';
+import type { TokenNumber} from '@csstools/css-tokenizer';
+import { NumberType, TokenType } from '@csstools/css-tokenizer';
import { HSL_to_XYZ_D50, HWB_to_XYZ_D50, LCH_to_XYZ_D50, Lab_to_XYZ_D50, OKLCH_to_XYZ_D50, OKLab_to_XYZ_D50, P3_to_XYZ_D50, ProPhoto_RGB_to_XYZ_D50, XYZ_D50_to_HSL, XYZ_D50_to_HWB, XYZ_D50_to_LCH, XYZ_D50_to_Lab, XYZ_D50_to_OKLCH, XYZ_D50_to_OKLab, XYZ_D50_to_P3, XYZ_D50_to_ProPhoto, XYZ_D50_to_XYZ_D50, XYZ_D50_to_XYZ_D65, XYZ_D50_to_a98_RGB, XYZ_D50_to_lin_sRGB, XYZ_D50_to_rec_2020, XYZ_D50_to_sRGB, XYZ_D65_to_XYZ_D50, a98_RGB_to_XYZ_D50, lin_sRGB_to_XYZ_D50, rec_2020_to_XYZ_D50, sRGB_to_XYZ_D50 } from '@csstools/color-helpers';
/**
diff --git a/packages/css-color-parser/src/functions/color-mix.ts b/packages/css-color-parser/src/functions/color-mix.ts
index 4e2def213..73f4ab57f 100644
--- a/packages/css-color-parser/src/functions/color-mix.ts
+++ b/packages/css-color-parser/src/functions/color-mix.ts
@@ -1,7 +1,7 @@
import type { ColorData } from '../color-data';
import type { ColorParser } from '../color-parser';
import type { ComponentValue, FunctionNode } from '@csstools/css-parser-algorithms';
-import { Color } from '@csstools/color-helpers';
+import type { Color } from '@csstools/color-helpers';
import { ColorNotation } from '../color-notation';
import { isTokenIdent, isTokenNumeric, isTokenPercentage } from '@csstools/css-tokenizer';
import { calcFromComponentValues } from '@csstools/css-calc';
diff --git a/packages/css-color-parser/src/functions/color-normalize-channel-values.ts b/packages/css-color-parser/src/functions/color-normalize-channel-values.ts
index ba3955dc4..fe2389729 100644
--- a/packages/css-color-parser/src/functions/color-normalize-channel-values.ts
+++ b/packages/css-color-parser/src/functions/color-normalize-channel-values.ts
@@ -1,5 +1,6 @@
import type { ColorData } from '../color-data';
-import { CSSToken, NumberType, TokenType, isTokenIdent, isTokenNumber, isTokenPercentage } from '@csstools/css-tokenizer';
+import type { CSSToken} from '@csstools/css-tokenizer';
+import { NumberType, TokenType, isTokenIdent, isTokenNumber, isTokenPercentage } from '@csstools/css-tokenizer';
import { SyntaxFlag } from '../color-data';
import { normalize } from './normalize';
import { toLowerCaseAZ } from '../util/to-lower-case-a-z';
diff --git a/packages/css-color-parser/src/functions/color.ts b/packages/css-color-parser/src/functions/color.ts
index 45590cc07..0c298b39e 100644
--- a/packages/css-color-parser/src/functions/color.ts
+++ b/packages/css-color-parser/src/functions/color.ts
@@ -1,8 +1,11 @@
-import { ColorData, SyntaxFlag, colorDataTo, noneToZeroInRelativeColorDataChannels, normalizeRelativeColorDataChannels } from '../color-data';
+import type { ColorData} from '../color-data';
+import { SyntaxFlag, colorDataTo, noneToZeroInRelativeColorDataChannels, normalizeRelativeColorDataChannels } from '../color-data';
import type { ColorParser } from '../color-parser';
import { ColorNotation } from '../color-notation';
-import { ComponentValue, FunctionNode, TokenNode, isCommentNode, isFunctionNode, isTokenNode, isWhitespaceNode } from '@csstools/css-parser-algorithms';
-import { TokenNumber, isTokenDelim, isTokenIdent, isTokenNumber, isTokenNumeric } from '@csstools/css-tokenizer';
+import type { ComponentValue, FunctionNode} from '@csstools/css-parser-algorithms';
+import { TokenNode, isCommentNode, isFunctionNode, isTokenNode, isWhitespaceNode } from '@csstools/css-parser-algorithms';
+import type { TokenNumber} from '@csstools/css-tokenizer';
+import { isTokenDelim, isTokenIdent, isTokenNumber, isTokenNumeric } from '@csstools/css-tokenizer';
import { normalize_Color_ChannelValues } from './color-normalize-channel-values';
import { toLowerCaseAZ } from '../util/to-lower-case-a-z';
import { calcFromComponentValues, mathFunctionNames } from '@csstools/css-calc';
diff --git a/packages/css-color-parser/src/functions/hsl-normalize-channel-values.ts b/packages/css-color-parser/src/functions/hsl-normalize-channel-values.ts
index fdb9cab58..50334bf3d 100644
--- a/packages/css-color-parser/src/functions/hsl-normalize-channel-values.ts
+++ b/packages/css-color-parser/src/functions/hsl-normalize-channel-values.ts
@@ -1,5 +1,6 @@
import type { ColorData } from '../color-data';
-import { CSSToken, NumberType, TokenType, isTokenDimension, isTokenIdent, isTokenNumber, isTokenPercentage } from '@csstools/css-tokenizer';
+import type { CSSToken} from '@csstools/css-tokenizer';
+import { NumberType, TokenType, isTokenDimension, isTokenIdent, isTokenNumber, isTokenPercentage } from '@csstools/css-tokenizer';
import { SyntaxFlag } from '../color-data';
import { normalize } from './normalize';
import { normalizeHue } from './hue-normalize-channel-value';
diff --git a/packages/css-color-parser/src/functions/hsl.ts b/packages/css-color-parser/src/functions/hsl.ts
index 661634e9b..e0caa8189 100644
--- a/packages/css-color-parser/src/functions/hsl.ts
+++ b/packages/css-color-parser/src/functions/hsl.ts
@@ -1,6 +1,7 @@
import type { ColorData } from '../color-data';
import type { ColorParser } from '../color-parser';
-import { FunctionNode, isTokenNode } from '@csstools/css-parser-algorithms';
+import type { FunctionNode} from '@csstools/css-parser-algorithms';
+import { isTokenNode } from '@csstools/css-parser-algorithms';
import { ColorNotation } from '../color-notation';
import { SyntaxFlag } from '../color-data';
import { normalize_legacy_HSL_ChannelValues, normalize_modern_HSL_ChannelValues } from './hsl-normalize-channel-values';
diff --git a/packages/css-color-parser/src/functions/hue-normalize-channel-value.ts b/packages/css-color-parser/src/functions/hue-normalize-channel-value.ts
index e0a141643..85bfcaaee 100644
--- a/packages/css-color-parser/src/functions/hue-normalize-channel-value.ts
+++ b/packages/css-color-parser/src/functions/hue-normalize-channel-value.ts
@@ -1,5 +1,5 @@
-import type { TokenNumber } from '@csstools/css-tokenizer';
-import { CSSToken, NumberType, TokenType, isTokenDimension, isTokenNumber } from '@csstools/css-tokenizer';
+import type { TokenNumber , CSSToken} from '@csstools/css-tokenizer';
+import { NumberType, TokenType, isTokenDimension, isTokenNumber } from '@csstools/css-tokenizer';
import { toLowerCaseAZ } from '../util/to-lower-case-a-z';
export function normalizeHue(token: CSSToken): TokenNumber | false {
diff --git a/packages/css-color-parser/src/functions/hwb-normalize-channel-values.ts b/packages/css-color-parser/src/functions/hwb-normalize-channel-values.ts
index d0ddf5744..97331f0d8 100644
--- a/packages/css-color-parser/src/functions/hwb-normalize-channel-values.ts
+++ b/packages/css-color-parser/src/functions/hwb-normalize-channel-values.ts
@@ -1,5 +1,6 @@
import type { ColorData } from '../color-data';
-import { CSSToken, NumberType, TokenType, isTokenDimension, isTokenIdent, isTokenNumber, isTokenPercentage } from '@csstools/css-tokenizer';
+import type { CSSToken} from '@csstools/css-tokenizer';
+import { NumberType, TokenType, isTokenDimension, isTokenIdent, isTokenNumber, isTokenPercentage } from '@csstools/css-tokenizer';
import { SyntaxFlag } from '../color-data';
import { normalize } from './normalize';
import { normalizeHue } from './hue-normalize-channel-value';
diff --git a/packages/css-color-parser/src/functions/lab-normalize-channel-values.ts b/packages/css-color-parser/src/functions/lab-normalize-channel-values.ts
index 7132f3419..e9f07a59b 100644
--- a/packages/css-color-parser/src/functions/lab-normalize-channel-values.ts
+++ b/packages/css-color-parser/src/functions/lab-normalize-channel-values.ts
@@ -1,5 +1,6 @@
import type { ColorData } from '../color-data';
-import { CSSToken, NumberType, TokenType, isTokenIdent, isTokenNumber, isTokenPercentage } from '@csstools/css-tokenizer';
+import type { CSSToken} from '@csstools/css-tokenizer';
+import { NumberType, TokenType, isTokenIdent, isTokenNumber, isTokenPercentage } from '@csstools/css-tokenizer';
import { SyntaxFlag } from '../color-data';
import { normalize } from './normalize';
import { toLowerCaseAZ } from '../util/to-lower-case-a-z';
diff --git a/packages/css-color-parser/src/functions/lch-normalize-channel-values.ts b/packages/css-color-parser/src/functions/lch-normalize-channel-values.ts
index 554441ce3..3e91459cf 100644
--- a/packages/css-color-parser/src/functions/lch-normalize-channel-values.ts
+++ b/packages/css-color-parser/src/functions/lch-normalize-channel-values.ts
@@ -1,5 +1,6 @@
import type { ColorData } from '../color-data';
-import { CSSToken, NumberType, TokenType, isTokenDimension, isTokenIdent, isTokenNumber, isTokenPercentage } from '@csstools/css-tokenizer';
+import type { CSSToken} from '@csstools/css-tokenizer';
+import { NumberType, TokenType, isTokenDimension, isTokenIdent, isTokenNumber, isTokenPercentage } from '@csstools/css-tokenizer';
import { SyntaxFlag } from '../color-data';
import { normalize } from './normalize';
import { normalizeHue } from './hue-normalize-channel-value';
diff --git a/packages/css-color-parser/src/functions/named-color.ts b/packages/css-color-parser/src/functions/named-color.ts
index aef8708c5..bb06be3ba 100644
--- a/packages/css-color-parser/src/functions/named-color.ts
+++ b/packages/css-color-parser/src/functions/named-color.ts
@@ -1,7 +1,8 @@
import type { ColorData } from '../color-data';
import { ColorNotation } from '../color-notation';
import { SyntaxFlag } from '../color-data';
-import { Color, namedColors } from '@csstools/color-helpers';
+import type { Color} from '@csstools/color-helpers';
+import { namedColors } from '@csstools/color-helpers';
import { toLowerCaseAZ } from '../util/to-lower-case-a-z';
const namedColorsMap: Map = new Map();
diff --git a/packages/css-color-parser/src/functions/normalize-channel-values.ts b/packages/css-color-parser/src/functions/normalize-channel-values.ts
index e627813ba..6d36e5154 100644
--- a/packages/css-color-parser/src/functions/normalize-channel-values.ts
+++ b/packages/css-color-parser/src/functions/normalize-channel-values.ts
@@ -1,4 +1,4 @@
import type { ColorData } from '../color-data';
-import { CSSToken } from '@csstools/css-tokenizer';
+import type { CSSToken } from '@csstools/css-tokenizer';
export type normalizeChannelValuesFn = (token: CSSToken, index: number, colorData: ColorData) => CSSToken | false;
diff --git a/packages/css-color-parser/src/functions/oklab-normalize-channel-values.ts b/packages/css-color-parser/src/functions/oklab-normalize-channel-values.ts
index 710742194..cf27f370b 100644
--- a/packages/css-color-parser/src/functions/oklab-normalize-channel-values.ts
+++ b/packages/css-color-parser/src/functions/oklab-normalize-channel-values.ts
@@ -1,5 +1,6 @@
import type { ColorData } from '../color-data';
-import { CSSToken, NumberType, TokenType, isTokenIdent, isTokenNumber, isTokenPercentage } from '@csstools/css-tokenizer';
+import type { CSSToken} from '@csstools/css-tokenizer';
+import { NumberType, TokenType, isTokenIdent, isTokenNumber, isTokenPercentage } from '@csstools/css-tokenizer';
import { SyntaxFlag } from '../color-data';
import { normalize } from './normalize';
import { toLowerCaseAZ } from '../util/to-lower-case-a-z';
diff --git a/packages/css-color-parser/src/functions/oklch-normalize-channel-values.ts b/packages/css-color-parser/src/functions/oklch-normalize-channel-values.ts
index 659399d72..3753290b0 100644
--- a/packages/css-color-parser/src/functions/oklch-normalize-channel-values.ts
+++ b/packages/css-color-parser/src/functions/oklch-normalize-channel-values.ts
@@ -1,5 +1,6 @@
import type { ColorData } from '../color-data';
-import { CSSToken, NumberType, TokenType, isTokenDimension, isTokenIdent, isTokenNumber, isTokenPercentage } from '@csstools/css-tokenizer';
+import type { CSSToken} from '@csstools/css-tokenizer';
+import { NumberType, TokenType, isTokenDimension, isTokenIdent, isTokenNumber, isTokenPercentage } from '@csstools/css-tokenizer';
import { SyntaxFlag } from '../color-data';
import { normalize } from './normalize';
import { normalizeHue } from './hue-normalize-channel-value';
diff --git a/packages/css-color-parser/src/functions/rgb-normalize-channel-values.ts b/packages/css-color-parser/src/functions/rgb-normalize-channel-values.ts
index 47820816e..b8418f72b 100644
--- a/packages/css-color-parser/src/functions/rgb-normalize-channel-values.ts
+++ b/packages/css-color-parser/src/functions/rgb-normalize-channel-values.ts
@@ -1,5 +1,6 @@
import type { ColorData } from '../color-data';
-import { CSSToken, NumberType, TokenType, isTokenIdent, isTokenNumber, isTokenPercentage } from '@csstools/css-tokenizer';
+import type { CSSToken} from '@csstools/css-tokenizer';
+import { NumberType, TokenType, isTokenIdent, isTokenNumber, isTokenPercentage } from '@csstools/css-tokenizer';
import { SyntaxFlag } from '../color-data';
import { normalize } from './normalize';
diff --git a/packages/css-color-parser/src/functions/rgb.ts b/packages/css-color-parser/src/functions/rgb.ts
index b5a7bce4f..af6fdc6f6 100644
--- a/packages/css-color-parser/src/functions/rgb.ts
+++ b/packages/css-color-parser/src/functions/rgb.ts
@@ -1,6 +1,7 @@
import type { ColorData } from '../color-data';
import type { ColorParser } from '../color-parser';
-import { FunctionNode, isTokenNode } from '@csstools/css-parser-algorithms';
+import type { FunctionNode} from '@csstools/css-parser-algorithms';
+import { isTokenNode } from '@csstools/css-parser-algorithms';
import { ColorNotation } from '../color-notation';
import { SyntaxFlag } from '../color-data';
import { normalize_legacy_sRGB_ChannelValues, normalize_modern_sRGB_ChannelValues } from './rgb-normalize-channel-values';
diff --git a/packages/css-color-parser/src/functions/three-channel-legacy-syntax.ts b/packages/css-color-parser/src/functions/three-channel-legacy-syntax.ts
index 904fe3594..65a9f420c 100644
--- a/packages/css-color-parser/src/functions/three-channel-legacy-syntax.ts
+++ b/packages/css-color-parser/src/functions/three-channel-legacy-syntax.ts
@@ -1,11 +1,12 @@
import type { ColorData } from '../color-data';
import type { ComponentValue, FunctionNode } from '@csstools/css-parser-algorithms';
-import { TokenNumber, isTokenComma, isTokenNumber, isTokenNumeric } from '@csstools/css-tokenizer';
-import { ColorNotation } from '../color-notation';
+import type { TokenNumber} from '@csstools/css-tokenizer';
+import { isTokenComma, isTokenNumber, isTokenNumeric } from '@csstools/css-tokenizer';
+import type { ColorNotation } from '../color-notation';
import { SyntaxFlag } from '../color-data';
import { calcFromComponentValues } from '@csstools/css-calc';
import { isCommentNode, isFunctionNode, isTokenNode, isWhitespaceNode } from '@csstools/css-parser-algorithms';
-import { normalizeChannelValuesFn } from './normalize-channel-values';
+import type { normalizeChannelValuesFn } from './normalize-channel-values';
import { mathFunctionNames } from '@csstools/css-calc';
export function threeChannelLegacySyntax(
diff --git a/packages/css-color-parser/src/functions/three-channel-space-separated.ts b/packages/css-color-parser/src/functions/three-channel-space-separated.ts
index 7f33cd8a8..af3f629c5 100644
--- a/packages/css-color-parser/src/functions/three-channel-space-separated.ts
+++ b/packages/css-color-parser/src/functions/three-channel-space-separated.ts
@@ -1,14 +1,15 @@
-import { ColorData, noneToZeroInRelativeColorDataChannels, normalizeRelativeColorDataChannels } from '../color-data';
-import { ComponentValue, FunctionNode } from '@csstools/css-parser-algorithms';
-import { TokenNumber, isTokenDelim, isTokenIdent, isTokenNumber, isTokenNumeric } from '@csstools/css-tokenizer';
-import { ColorNotation } from '../color-notation';
-import { SyntaxFlag } from '../color-data';
+import type { ColorData} from '../color-data';
+import { noneToZeroInRelativeColorDataChannels, normalizeRelativeColorDataChannels } from '../color-data';
+import type { ComponentValue, FunctionNode } from '@csstools/css-parser-algorithms';
+import type { TokenNumber} from '@csstools/css-tokenizer';
+import { isTokenDelim, isTokenIdent, isTokenNumber, isTokenNumeric } from '@csstools/css-tokenizer';
+import type { ColorNotation } from '../color-notation';
+import { SyntaxFlag, colorDataTo } from '../color-data';
import { calcFromComponentValues } from '@csstools/css-calc';
import { isCommentNode, isFunctionNode, isTokenNode, isWhitespaceNode } from '@csstools/css-parser-algorithms';
-import { normalizeChannelValuesFn } from './normalize-channel-values';
+import type { normalizeChannelValuesFn } from './normalize-channel-values';
import { mathFunctionNames } from '@csstools/css-calc';
-import { ColorParser } from '../color-parser';
-import { colorDataTo } from '../color-data';
+import type { ColorParser } from '../color-parser';
import { TokenNode } from '@csstools/css-parser-algorithms';
export function threeChannelSpaceSeparated(
diff --git a/packages/css-color-parser/src/gamut-mapping/p3.ts b/packages/css-color-parser/src/gamut-mapping/p3.ts
index 5e28cea13..14fea57f4 100644
--- a/packages/css-color-parser/src/gamut-mapping/p3.ts
+++ b/packages/css-color-parser/src/gamut-mapping/p3.ts
@@ -1,5 +1,5 @@
-import { mapGamutRayTrace } from '@csstools/color-helpers';
-import { clip, XYZ_D50_to_OKLCH, OKLCH_to_OKLab, XYZ_to_lin_P3, gam_P3, XYZ_to_OKLab, OKLab_to_OKLCH, lin_P3_to_XYZ, OKLab_to_XYZ, XYZ_D50_to_P3, inGamut, Color } from '@csstools/color-helpers';
+import type { Color } from '@csstools/color-helpers';
+import { mapGamutRayTrace, clip, XYZ_D50_to_OKLCH, OKLCH_to_OKLab, XYZ_to_lin_P3, gam_P3, XYZ_to_OKLab, OKLab_to_OKLCH, lin_P3_to_XYZ, OKLab_to_XYZ, XYZ_D50_to_P3, inGamut } from '@csstools/color-helpers';
export function XYZ_D50_to_P3_Gamut(color: Color): Color {
const p3 = XYZ_D50_to_P3(color);
diff --git a/packages/css-color-parser/src/gamut-mapping/srgb.ts b/packages/css-color-parser/src/gamut-mapping/srgb.ts
index df9433590..2a8ec8d4c 100644
--- a/packages/css-color-parser/src/gamut-mapping/srgb.ts
+++ b/packages/css-color-parser/src/gamut-mapping/srgb.ts
@@ -1,5 +1,5 @@
-import { mapGamutRayTrace } from '@csstools/color-helpers';
-import { clip, XYZ_D50_to_sRGB, OKLCH_to_OKLab, XYZ_to_lin_sRGB, XYZ_D50_to_OKLCH, XYZ_to_OKLab, OKLab_to_OKLCH, gam_sRGB, OKLab_to_XYZ, lin_sRGB_to_XYZ, inGamut, Color } from '@csstools/color-helpers';
+import type { Color } from '@csstools/color-helpers';
+import { mapGamutRayTrace, clip, XYZ_D50_to_sRGB, OKLCH_to_OKLab, XYZ_to_lin_sRGB, XYZ_D50_to_OKLCH, XYZ_to_OKLab, OKLab_to_OKLCH, gam_sRGB, OKLab_to_XYZ, lin_sRGB_to_XYZ, inGamut } from '@csstools/color-helpers';
export function XYZ_D50_to_sRGB_Gamut(color: Color): Color {
const srgb = XYZ_D50_to_sRGB(color);
diff --git a/packages/css-color-parser/src/serialize/hsl.ts b/packages/css-color-parser/src/serialize/hsl.ts
index 6226c330c..441db1188 100644
--- a/packages/css-color-parser/src/serialize/hsl.ts
+++ b/packages/css-color-parser/src/serialize/hsl.ts
@@ -1,11 +1,11 @@
-import { ColorData, convertPowerlessComponentsToZeroValuesForDisplay } from '../color-data';
import type { TokenCloseParen, TokenComma, TokenWhitespace } from '@csstools/css-tokenizer';
+import type { ColorData} from '../color-data';
+import { convertPowerlessComponentsToZeroValuesForDisplay, colorData_to_XYZ_D50 } from '../color-data';
import { FunctionNode, TokenNode, WhitespaceNode } from '@csstools/css-parser-algorithms';
import { NumberType, TokenType } from '@csstools/css-tokenizer';
import { XYZ_D50_to_HSL, sRGB_to_XYZ_D50 } from '@csstools/color-helpers';
-import { colorData_to_XYZ_D50 } from '../color-data';
-import { toPrecision } from './to-precision';
import { XYZ_D50_to_sRGB_Gamut } from '../gamut-mapping/srgb';
+import { toPrecision } from './to-precision';
export function serializeHSL(color: ColorData, gamutMapping = true): FunctionNode {
color.channels = convertPowerlessComponentsToZeroValuesForDisplay(color.channels, color.colorNotation);
diff --git a/packages/css-color-parser/src/serialize/oklch.ts b/packages/css-color-parser/src/serialize/oklch.ts
index 2b54f6577..7a2bc74aa 100644
--- a/packages/css-color-parser/src/serialize/oklch.ts
+++ b/packages/css-color-parser/src/serialize/oklch.ts
@@ -1,12 +1,13 @@
-import { ColorData, convertPowerlessComponentsToZeroValuesForDisplay } from '../color-data';
import type { TokenFunction, TokenWhitespace } from '@csstools/css-tokenizer';
-import { colorData_to_XYZ_D50 } from '../color-data';
+import type { ColorData} from '../color-data';
+import { convertPowerlessComponentsToZeroValuesForDisplay, colorData_to_XYZ_D50 } from '../color-data';
import { ColorNotation } from '../color-notation';
-import { FunctionNode, TokenNode, WhitespaceNode } from '@csstools/css-parser-algorithms';
+import type { FunctionNode} from '@csstools/css-parser-algorithms';
+import { TokenNode, WhitespaceNode } from '@csstools/css-parser-algorithms';
import { NumberType, TokenType } from '@csstools/css-tokenizer';
import { XYZ_D50_to_OKLCH } from '@csstools/color-helpers';
-import { toPrecision } from './to-precision';
import { serializeWithAlpha } from './with-alpha';
+import { toPrecision } from './to-precision';
/**
* Convert color data to component values in the OKLCH color space.
diff --git a/packages/css-color-parser/src/serialize/p3.ts b/packages/css-color-parser/src/serialize/p3.ts
index c0e162e24..d709b2d0b 100644
--- a/packages/css-color-parser/src/serialize/p3.ts
+++ b/packages/css-color-parser/src/serialize/p3.ts
@@ -1,13 +1,14 @@
-import { ColorData, convertPowerlessComponentsToZeroValuesForDisplay } from '../color-data';
import type { TokenFunction, TokenWhitespace } from '@csstools/css-tokenizer';
-import { colorData_to_XYZ_D50 } from '../color-data';
+import type { ColorData} from '../color-data';
+import { convertPowerlessComponentsToZeroValuesForDisplay, colorData_to_XYZ_D50 } from '../color-data';
import { ColorNotation } from '../color-notation';
-import { FunctionNode, TokenNode, WhitespaceNode } from '@csstools/css-parser-algorithms';
+import type { FunctionNode} from '@csstools/css-parser-algorithms';
+import { TokenNode, WhitespaceNode } from '@csstools/css-parser-algorithms';
import { NumberType, TokenType } from '@csstools/css-tokenizer';
import { XYZ_D50_to_P3 } from '@csstools/color-helpers';
-import { toPrecision } from './to-precision';
import { XYZ_D50_to_P3_Gamut } from '../gamut-mapping/p3';
import { serializeWithAlpha } from './with-alpha';
+import { toPrecision } from './to-precision';
/**
* Convert color data to component values in the display-p3 color space.
diff --git a/packages/css-color-parser/src/serialize/rgb.ts b/packages/css-color-parser/src/serialize/rgb.ts
index 5f1cb0462..99373182a 100644
--- a/packages/css-color-parser/src/serialize/rgb.ts
+++ b/packages/css-color-parser/src/serialize/rgb.ts
@@ -1,4 +1,5 @@
-import { ColorData, convertPowerlessComponentsToZeroValuesForDisplay } from '../color-data';
+import type { ColorData} from '../color-data';
+import { convertPowerlessComponentsToZeroValuesForDisplay } from '../color-data';
import type { TokenCloseParen, TokenComma, TokenWhitespace } from '@csstools/css-tokenizer';
import { FunctionNode, TokenNode, WhitespaceNode } from '@csstools/css-parser-algorithms';
import { NumberType, TokenType } from '@csstools/css-tokenizer';
diff --git a/packages/css-color-parser/src/serialize/with-alpha.ts b/packages/css-color-parser/src/serialize/with-alpha.ts
index ef9a12afb..d21de274c 100644
--- a/packages/css-color-parser/src/serialize/with-alpha.ts
+++ b/packages/css-color-parser/src/serialize/with-alpha.ts
@@ -1,4 +1,4 @@
-import { ColorData } from '../color-data';
+import type { ColorData } from '../color-data';
import type { TokenCloseParen, TokenFunction, TokenWhitespace } from '@csstools/css-tokenizer';
import { FunctionNode, TokenNode, WhitespaceNode } from '@csstools/css-parser-algorithms';
import { NumberType, TokenType } from '@csstools/css-tokenizer';
diff --git a/packages/css-color-parser/test/basic/basic.mjs b/packages/css-color-parser/test/basic/basic.mjs
index a022f0da2..4dc688078 100644
--- a/packages/css-color-parser/test/basic/basic.mjs
+++ b/packages/css-color-parser/test/basic/basic.mjs
@@ -1,5 +1,5 @@
import { color, colorDataFitsDisplayP3_Gamut, colorDataFitsRGB_Gamut } from '@csstools/css-color-parser';
-import assert from 'assert';
+import assert from 'node:assert';
import { parse } from '../util/parse.mjs';
import { serialize_HSL_data, serialize_P3_data, serialize_sRGB_data } from '../util/serialize.mjs';
diff --git a/packages/css-color-parser/test/basic/color-function.mjs b/packages/css-color-parser/test/basic/color-function.mjs
index da1e8280d..3abddbaca 100644
--- a/packages/css-color-parser/test/basic/color-function.mjs
+++ b/packages/css-color-parser/test/basic/color-function.mjs
@@ -1,5 +1,5 @@
import { color } from '@csstools/css-color-parser';
-import assert from 'assert';
+import assert from 'node:assert';
import { parse } from '../util/parse.mjs';
import { serialize_sRGB_data } from '../util/serialize.mjs';
diff --git a/packages/css-color-parser/test/basic/color-mix-function-oklch.mjs b/packages/css-color-parser/test/basic/color-mix-function-oklch.mjs
index 60c7a600b..2f16eee01 100644
--- a/packages/css-color-parser/test/basic/color-mix-function-oklch.mjs
+++ b/packages/css-color-parser/test/basic/color-mix-function-oklch.mjs
@@ -1,5 +1,5 @@
import { color } from '@csstools/css-color-parser';
-import assert from 'assert';
+import assert from 'node:assert';
import { parse } from '../util/parse.mjs';
import { serialize_OKLCH_data } from '../util/serialize.mjs';
diff --git a/packages/css-color-parser/test/basic/color-mix-function.mjs b/packages/css-color-parser/test/basic/color-mix-function.mjs
index 23b51b9f8..0f64b7736 100644
--- a/packages/css-color-parser/test/basic/color-mix-function.mjs
+++ b/packages/css-color-parser/test/basic/color-mix-function.mjs
@@ -1,5 +1,5 @@
import { color } from '@csstools/css-color-parser';
-import assert from 'assert';
+import assert from 'node:assert';
import { parse } from '../util/parse.mjs';
import { serialize_sRGB_data } from '../util/serialize.mjs';
import { canonicalize } from '../util/canonical.mjs';
diff --git a/packages/css-color-parser/test/basic/contrast-color-function.mjs b/packages/css-color-parser/test/basic/contrast-color-function.mjs
index c4ff9e17c..578f74488 100644
--- a/packages/css-color-parser/test/basic/contrast-color-function.mjs
+++ b/packages/css-color-parser/test/basic/contrast-color-function.mjs
@@ -1,5 +1,5 @@
import { color } from '@csstools/css-color-parser';
-import assert from 'assert';
+import assert from 'node:assert';
import { parse } from '../util/parse.mjs';
import { serialize_sRGB_data } from '../util/serialize.mjs';
diff --git a/packages/css-color-parser/test/basic/hwb.mjs b/packages/css-color-parser/test/basic/hwb.mjs
index e65b87b67..0ef5d2219 100644
--- a/packages/css-color-parser/test/basic/hwb.mjs
+++ b/packages/css-color-parser/test/basic/hwb.mjs
@@ -1,5 +1,5 @@
import { color } from '@csstools/css-color-parser';
-import assert from 'assert';
+import assert from 'node:assert';
import { parse } from '../util/parse.mjs';
import { serialize_sRGB_data } from '../util/serialize.mjs';
diff --git a/packages/css-color-parser/test/basic/invalid.mjs b/packages/css-color-parser/test/basic/invalid.mjs
index 1ac745e69..ae179d8b1 100644
--- a/packages/css-color-parser/test/basic/invalid.mjs
+++ b/packages/css-color-parser/test/basic/invalid.mjs
@@ -1,5 +1,5 @@
import { color } from '@csstools/css-color-parser';
-import assert from 'assert';
+import assert from 'node:assert';
import { parse } from '../util/parse.mjs';
const testCases = [];
diff --git a/packages/css-color-parser/test/basic/keywords.mjs b/packages/css-color-parser/test/basic/keywords.mjs
index 9a319ea49..fd555cae8 100644
--- a/packages/css-color-parser/test/basic/keywords.mjs
+++ b/packages/css-color-parser/test/basic/keywords.mjs
@@ -1,5 +1,5 @@
import { color } from '@csstools/css-color-parser';
-import assert from 'assert';
+import assert from 'node:assert';
import { parse } from '../util/parse.mjs';
[
diff --git a/packages/css-color-parser/test/basic/lab.mjs b/packages/css-color-parser/test/basic/lab.mjs
index 9f2b49481..01342e724 100644
--- a/packages/css-color-parser/test/basic/lab.mjs
+++ b/packages/css-color-parser/test/basic/lab.mjs
@@ -1,5 +1,5 @@
import { color } from '@csstools/css-color-parser';
-import assert from 'assert';
+import assert from 'node:assert';
import { parse } from '../util/parse.mjs';
import { serialize_sRGB_data } from '../util/serialize.mjs';
diff --git a/packages/css-color-parser/test/basic/lch.mjs b/packages/css-color-parser/test/basic/lch.mjs
index 6da76c1a6..1d1f1107c 100644
--- a/packages/css-color-parser/test/basic/lch.mjs
+++ b/packages/css-color-parser/test/basic/lch.mjs
@@ -1,5 +1,5 @@
import { color } from '@csstools/css-color-parser';
-import assert from 'assert';
+import assert from 'node:assert';
import { parse } from '../util/parse.mjs';
import { serialize_sRGB_data, serialize_P3_data } from '../util/serialize.mjs';
diff --git a/packages/css-color-parser/test/basic/named-colors.mjs b/packages/css-color-parser/test/basic/named-colors.mjs
index 4fb97cb73..99ef55d97 100644
--- a/packages/css-color-parser/test/basic/named-colors.mjs
+++ b/packages/css-color-parser/test/basic/named-colors.mjs
@@ -1,5 +1,5 @@
import { color } from '@csstools/css-color-parser';
-import assert from 'assert';
+import assert from 'node:assert';
import { parse } from '../util/parse.mjs';
assert.deepStrictEqual(
diff --git a/packages/css-color-parser/test/basic/none.mjs b/packages/css-color-parser/test/basic/none.mjs
index e633d1fc2..8cdfb39ac 100644
--- a/packages/css-color-parser/test/basic/none.mjs
+++ b/packages/css-color-parser/test/basic/none.mjs
@@ -1,5 +1,5 @@
import { color } from '@csstools/css-color-parser';
-import assert from 'assert';
+import assert from 'node:assert';
import { parse } from '../util/parse.mjs';
assert.deepStrictEqual(
diff --git a/packages/css-color-parser/test/basic/relative-color.mjs b/packages/css-color-parser/test/basic/relative-color.mjs
index 67622fbd2..3a3d7767a 100644
--- a/packages/css-color-parser/test/basic/relative-color.mjs
+++ b/packages/css-color-parser/test/basic/relative-color.mjs
@@ -1,5 +1,5 @@
import { color } from '@csstools/css-color-parser';
-import assert from 'assert';
+import assert from 'node:assert';
import { parse } from '../util/parse.mjs';
import { serialize_sRGB_data } from '../util/serialize.mjs';
import { canonicalize } from '../util/canonical.mjs';
diff --git a/packages/css-color-parser/test/basic/variables.mjs b/packages/css-color-parser/test/basic/variables.mjs
index 7c9936bc0..fb9902247 100644
--- a/packages/css-color-parser/test/basic/variables.mjs
+++ b/packages/css-color-parser/test/basic/variables.mjs
@@ -1,5 +1,5 @@
import { color } from '@csstools/css-color-parser';
-import assert from 'assert';
+import assert from 'node:assert';
import { parse } from '../util/parse.mjs';
// Legacy
diff --git a/packages/css-color-parser/test/gamut-mapping/ray-trace.mjs b/packages/css-color-parser/test/gamut-mapping/ray-trace.mjs
index ca4bc5cc6..6595c40eb 100644
--- a/packages/css-color-parser/test/gamut-mapping/ray-trace.mjs
+++ b/packages/css-color-parser/test/gamut-mapping/ray-trace.mjs
@@ -1,5 +1,5 @@
import { color } from '@csstools/css-color-parser';
-import assert from 'assert';
+import assert from 'node:assert';
import { parse } from '../util/parse.mjs';
import { serialize_sRGB_data } from '../util/serialize.mjs';
import { canonicalize } from '../util/canonical.mjs';
diff --git a/packages/css-color-parser/test/wpt/color-computed-color-function.mjs b/packages/css-color-parser/test/wpt/color-computed-color-function.mjs
index fc595e782..cfa8665b9 100644
--- a/packages/css-color-parser/test/wpt/color-computed-color-function.mjs
+++ b/packages/css-color-parser/test/wpt/color-computed-color-function.mjs
@@ -1,5 +1,5 @@
import { color } from '@csstools/css-color-parser';
-import assert from 'assert';
+import assert from 'node:assert';
import { canonicalize } from '../util/canonical.mjs';
import { parse } from '../util/parse.mjs';
import { serialize_sRGB_data } from '../util/serialize.mjs';
diff --git a/packages/css-color-parser/test/wpt/color-computed-color-mix-function.mjs b/packages/css-color-parser/test/wpt/color-computed-color-mix-function.mjs
index ce9477f90..a565a74e2 100644
--- a/packages/css-color-parser/test/wpt/color-computed-color-mix-function.mjs
+++ b/packages/css-color-parser/test/wpt/color-computed-color-mix-function.mjs
@@ -1,5 +1,5 @@
import { color } from '@csstools/css-color-parser';
-import assert from 'assert';
+import assert from 'node:assert';
import { canonicalize } from '../util/canonical.mjs';
import { parse } from '../util/parse.mjs';
import { serialize_sRGB_data } from '../util/serialize.mjs';
diff --git a/packages/css-color-parser/test/wpt/color-computed-hex.mjs b/packages/css-color-parser/test/wpt/color-computed-hex.mjs
index b02de8b7c..1375da750 100644
--- a/packages/css-color-parser/test/wpt/color-computed-hex.mjs
+++ b/packages/css-color-parser/test/wpt/color-computed-hex.mjs
@@ -1,5 +1,5 @@
import { color } from '@csstools/css-color-parser';
-import assert from 'assert';
+import assert from 'node:assert';
import { parse } from '../util/parse.mjs';
import { serialize_sRGB_data } from '../util/serialize.mjs';
diff --git a/packages/css-color-parser/test/wpt/color-computed-hsl.mjs b/packages/css-color-parser/test/wpt/color-computed-hsl.mjs
index e3bdd8a66..f9666f367 100644
--- a/packages/css-color-parser/test/wpt/color-computed-hsl.mjs
+++ b/packages/css-color-parser/test/wpt/color-computed-hsl.mjs
@@ -1,5 +1,5 @@
import { color } from '@csstools/css-color-parser';
-import assert from 'assert';
+import assert from 'node:assert';
import { parse } from '../util/parse.mjs';
import { serialize_sRGB_data } from '../util/serialize.mjs';
diff --git a/packages/css-color-parser/test/wpt/color-computed-hwb.mjs b/packages/css-color-parser/test/wpt/color-computed-hwb.mjs
index 4bce3a795..6580103d2 100644
--- a/packages/css-color-parser/test/wpt/color-computed-hwb.mjs
+++ b/packages/css-color-parser/test/wpt/color-computed-hwb.mjs
@@ -1,5 +1,5 @@
import { color } from '@csstools/css-color-parser';
-import assert from 'assert';
+import assert from 'node:assert';
import { parse } from '../util/parse.mjs';
import { serialize_sRGB_data } from '../util/serialize.mjs';
diff --git a/packages/css-color-parser/test/wpt/color-computed-lab.mjs b/packages/css-color-parser/test/wpt/color-computed-lab.mjs
index 1fc288fc4..13acf6ee8 100644
--- a/packages/css-color-parser/test/wpt/color-computed-lab.mjs
+++ b/packages/css-color-parser/test/wpt/color-computed-lab.mjs
@@ -1,5 +1,5 @@
import { color } from '@csstools/css-color-parser';
-import assert from 'assert';
+import assert from 'node:assert';
import { parse } from '../util/parse.mjs';
import { serialize_sRGB_data, serialize_P3_data } from '../util/serialize.mjs';
diff --git a/packages/css-color-parser/test/wpt/color-computed-named-color.mjs b/packages/css-color-parser/test/wpt/color-computed-named-color.mjs
index 7a6286048..a708b222f 100644
--- a/packages/css-color-parser/test/wpt/color-computed-named-color.mjs
+++ b/packages/css-color-parser/test/wpt/color-computed-named-color.mjs
@@ -1,5 +1,5 @@
import { color } from '@csstools/css-color-parser';
-import assert from 'assert';
+import assert from 'node:assert';
import { parse } from '../util/parse.mjs';
import { serialize_sRGB_data } from '../util/serialize.mjs';
diff --git a/packages/css-color-parser/test/wpt/color-computed-oklab.mjs b/packages/css-color-parser/test/wpt/color-computed-oklab.mjs
index a0af3aaad..da7775099 100644
--- a/packages/css-color-parser/test/wpt/color-computed-oklab.mjs
+++ b/packages/css-color-parser/test/wpt/color-computed-oklab.mjs
@@ -1,5 +1,5 @@
import { color } from '@csstools/css-color-parser';
-import assert from 'assert';
+import assert from 'node:assert';
import { parse } from '../util/parse.mjs';
import { serialize_P3_data, serialize_sRGB_data } from '../util/serialize.mjs';
diff --git a/packages/css-color-parser/test/wpt/color-computed-relative-color.mjs b/packages/css-color-parser/test/wpt/color-computed-relative-color.mjs
index be5893adf..9f27d6a21 100644
--- a/packages/css-color-parser/test/wpt/color-computed-relative-color.mjs
+++ b/packages/css-color-parser/test/wpt/color-computed-relative-color.mjs
@@ -1,5 +1,5 @@
import { color } from '@csstools/css-color-parser';
-import assert from 'assert';
+import assert from 'node:assert';
import { parse } from '../util/parse.mjs';
import { serialize_sRGB_data } from '../util/serialize.mjs';
import { canonicalize } from '../util/canonical.mjs';
diff --git a/packages/css-color-parser/test/wpt/color-computed-rgb.mjs b/packages/css-color-parser/test/wpt/color-computed-rgb.mjs
index 9d93946cd..0f89c4b0b 100644
--- a/packages/css-color-parser/test/wpt/color-computed-rgb.mjs
+++ b/packages/css-color-parser/test/wpt/color-computed-rgb.mjs
@@ -1,5 +1,5 @@
import { color } from '@csstools/css-color-parser';
-import assert from 'assert';
+import assert from 'node:assert';
import { parse } from '../util/parse.mjs';
import { serialize_sRGB_data } from '../util/serialize.mjs';
diff --git a/packages/css-color-parser/test/wpt/color-invalid-color-function.mjs b/packages/css-color-parser/test/wpt/color-invalid-color-function.mjs
index b64fb9b39..314e7d331 100644
--- a/packages/css-color-parser/test/wpt/color-invalid-color-function.mjs
+++ b/packages/css-color-parser/test/wpt/color-invalid-color-function.mjs
@@ -1,5 +1,5 @@
import { color } from '@csstools/css-color-parser';
-import assert from 'assert';
+import assert from 'node:assert';
import { parse } from '../util/parse.mjs';
import { serialize_sRGB_data } from '../util/serialize.mjs';
diff --git a/packages/css-color-parser/test/wpt/color-invalid-color-mix-function.mjs b/packages/css-color-parser/test/wpt/color-invalid-color-mix-function.mjs
index 8d54cd53c..026163d21 100644
--- a/packages/css-color-parser/test/wpt/color-invalid-color-mix-function.mjs
+++ b/packages/css-color-parser/test/wpt/color-invalid-color-mix-function.mjs
@@ -1,5 +1,5 @@
import { color } from '@csstools/css-color-parser';
-import assert from 'assert';
+import assert from 'node:assert';
import { parse } from '../util/parse.mjs';
import { serialize_sRGB_data } from '../util/serialize.mjs';
diff --git a/packages/css-color-parser/test/wpt/color-invalid-hex.mjs b/packages/css-color-parser/test/wpt/color-invalid-hex.mjs
index e612ef9a4..c76a428b3 100644
--- a/packages/css-color-parser/test/wpt/color-invalid-hex.mjs
+++ b/packages/css-color-parser/test/wpt/color-invalid-hex.mjs
@@ -1,5 +1,5 @@
import { color } from '@csstools/css-color-parser';
-import assert from 'assert';
+import assert from 'node:assert';
import { parse } from '../util/parse.mjs';
import { serialize_sRGB_data } from '../util/serialize.mjs';
diff --git a/packages/css-color-parser/test/wpt/color-invalid-hsl.mjs b/packages/css-color-parser/test/wpt/color-invalid-hsl.mjs
index b589fe442..1c79b1f59 100644
--- a/packages/css-color-parser/test/wpt/color-invalid-hsl.mjs
+++ b/packages/css-color-parser/test/wpt/color-invalid-hsl.mjs
@@ -1,5 +1,5 @@
import { color } from '@csstools/css-color-parser';
-import assert from 'assert';
+import assert from 'node:assert';
import { parse } from '../util/parse.mjs';
import { serialize_sRGB_data } from '../util/serialize.mjs';
diff --git a/packages/css-color-parser/test/wpt/color-invalid-hwb.mjs b/packages/css-color-parser/test/wpt/color-invalid-hwb.mjs
index 1449416b9..9bb4fcab6 100644
--- a/packages/css-color-parser/test/wpt/color-invalid-hwb.mjs
+++ b/packages/css-color-parser/test/wpt/color-invalid-hwb.mjs
@@ -1,5 +1,5 @@
import { color } from '@csstools/css-color-parser';
-import assert from 'assert';
+import assert from 'node:assert';
import { parse } from '../util/parse.mjs';
import { serialize_sRGB_data } from '../util/serialize.mjs';
diff --git a/packages/css-color-parser/test/wpt/color-invalid-named-color.mjs b/packages/css-color-parser/test/wpt/color-invalid-named-color.mjs
index 5fa2197e0..4fa996799 100644
--- a/packages/css-color-parser/test/wpt/color-invalid-named-color.mjs
+++ b/packages/css-color-parser/test/wpt/color-invalid-named-color.mjs
@@ -1,5 +1,5 @@
import { color } from '@csstools/css-color-parser';
-import assert from 'assert';
+import assert from 'node:assert';
import { parse } from '../util/parse.mjs';
import { serialize_sRGB_data } from '../util/serialize.mjs';
diff --git a/packages/css-color-parser/test/wpt/color-invalid-relative-color.mjs b/packages/css-color-parser/test/wpt/color-invalid-relative-color.mjs
index c96b102f8..ec05df63f 100644
--- a/packages/css-color-parser/test/wpt/color-invalid-relative-color.mjs
+++ b/packages/css-color-parser/test/wpt/color-invalid-relative-color.mjs
@@ -1,5 +1,5 @@
import { color } from '@csstools/css-color-parser';
-import assert from 'assert';
+import assert from 'node:assert';
import { parse } from '../util/parse.mjs';
import { serialize_sRGB_data } from '../util/serialize.mjs';
diff --git a/packages/css-color-parser/test/wpt/color-invalid-rgb.mjs b/packages/css-color-parser/test/wpt/color-invalid-rgb.mjs
index 9bdeeff74..f3c337f3f 100644
--- a/packages/css-color-parser/test/wpt/color-invalid-rgb.mjs
+++ b/packages/css-color-parser/test/wpt/color-invalid-rgb.mjs
@@ -1,5 +1,5 @@
import { color } from '@csstools/css-color-parser';
-import assert from 'assert';
+import assert from 'node:assert';
import { parse } from '../util/parse.mjs';
import { serialize_sRGB_data } from '../util/serialize.mjs';
diff --git a/packages/css-color-parser/test/wpt/color-mix-out-of-gamut.mjs b/packages/css-color-parser/test/wpt/color-mix-out-of-gamut.mjs
index dcfd5ff45..fff930778 100644
--- a/packages/css-color-parser/test/wpt/color-mix-out-of-gamut.mjs
+++ b/packages/css-color-parser/test/wpt/color-mix-out-of-gamut.mjs
@@ -1,5 +1,5 @@
import { color } from '@csstools/css-color-parser';
-import assert from 'assert';
+import assert from 'node:assert';
import { canonicalize } from '../util/canonical.mjs';
import { parse } from '../util/parse.mjs';
import { serialize_sRGB_data } from '../util/serialize.mjs';
diff --git a/packages/css-color-parser/test/wpt/color-valid-hsl.mjs b/packages/css-color-parser/test/wpt/color-valid-hsl.mjs
index e4db886b4..1b37b3e22 100644
--- a/packages/css-color-parser/test/wpt/color-valid-hsl.mjs
+++ b/packages/css-color-parser/test/wpt/color-valid-hsl.mjs
@@ -1,5 +1,5 @@
import { color } from '@csstools/css-color-parser';
-import assert from 'assert';
+import assert from 'node:assert';
import { parse } from '../util/parse.mjs';
import { serialize_sRGB_data } from '../util/serialize.mjs';
diff --git a/packages/css-parser-algorithms/CHANGELOG.md b/packages/css-parser-algorithms/CHANGELOG.md
index e313fe86d..a5c51fa15 100644
--- a/packages/css-parser-algorithms/CHANGELOG.md
+++ b/packages/css-parser-algorithms/CHANGELOG.md
@@ -1,5 +1,9 @@
# Changes to CSS Parser Algorithms
+### Unreleased (major)
+
+- Updated: Support for Node v18+ (major).
+
### 2.7.1
_July 6, 2024_
diff --git a/packages/css-parser-algorithms/dist/index.d.ts b/packages/css-parser-algorithms/dist/index.d.ts
index 23d6c120d..347b44974 100644
--- a/packages/css-parser-algorithms/dist/index.d.ts
+++ b/packages/css-parser-algorithms/dist/index.d.ts
@@ -75,9 +75,9 @@
* @packageDocumentation
*/
-import { CSSToken } from '@csstools/css-tokenizer';
+import type { CSSToken } from '@csstools/css-tokenizer';
import { ParseError } from '@csstools/css-tokenizer';
-import { TokenFunction } from '@csstools/css-tokenizer';
+import type { TokenFunction } from '@csstools/css-tokenizer';
export declare class CommentNode {
/**
diff --git a/packages/css-parser-algorithms/package.json b/packages/css-parser-algorithms/package.json
index cbb2c7cf0..1d4b91a26 100644
--- a/packages/css-parser-algorithms/package.json
+++ b/packages/css-parser-algorithms/package.json
@@ -25,7 +25,7 @@
}
],
"engines": {
- "node": "^14 || ^16 || >=18"
+ "node": ">=18"
},
"type": "module",
"main": "dist/index.cjs",
diff --git a/packages/css-parser-algorithms/src/consume/component-block-function.ts b/packages/css-parser-algorithms/src/consume/component-block-function.ts
index e3c15d695..598ce8535 100644
--- a/packages/css-parser-algorithms/src/consume/component-block-function.ts
+++ b/packages/css-parser-algorithms/src/consume/component-block-function.ts
@@ -1,5 +1,6 @@
-import { CSSToken, mirrorVariantType, mirrorVariant, stringify, TokenType, isToken, TokenFunction, ParseError, isTokenWhitespace, isTokenComment, isTokenOpenParen, isTokenOpenCurly, isTokenOpenSquare, isTokenFunction, isTokenCloseParen } from '@csstools/css-tokenizer';
-import { Context } from '../interfaces/context';
+import type { CSSToken, TokenFunction} from '@csstools/css-tokenizer';
+import { mirrorVariantType, mirrorVariant, stringify, TokenType, isToken, ParseError, isTokenWhitespace, isTokenComment, isTokenOpenParen, isTokenOpenCurly, isTokenOpenSquare, isTokenFunction, isTokenCloseParen } from '@csstools/css-tokenizer';
+import type { Context } from '../interfaces/context';
import { ComponentValueType } from '../util/component-value-type';
import { walkerIndexGenerator } from '../util/walker-index-generator';
import { isTokenWhiteSpaceOrComment } from '@csstools/css-tokenizer';
diff --git a/packages/css-parser-algorithms/src/interfaces/context.ts b/packages/css-parser-algorithms/src/interfaces/context.ts
index dd261f6b9..cc2514ee1 100644
--- a/packages/css-parser-algorithms/src/interfaces/context.ts
+++ b/packages/css-parser-algorithms/src/interfaces/context.ts
@@ -1,4 +1,4 @@
-import { ParseError } from '@csstools/css-tokenizer';
+import type { ParseError } from '@csstools/css-tokenizer';
export type Context = {
onParseError: (error: ParseError) => void
diff --git a/packages/css-parser-algorithms/src/parse/comma-separated-list-of-component-values.ts b/packages/css-parser-algorithms/src/parse/comma-separated-list-of-component-values.ts
index d000f7a31..c6cb61e00 100644
--- a/packages/css-parser-algorithms/src/parse/comma-separated-list-of-component-values.ts
+++ b/packages/css-parser-algorithms/src/parse/comma-separated-list-of-component-values.ts
@@ -1,5 +1,7 @@
-import { CSSToken, ParseError, TokenType, isTokenComma, isTokenEOF } from '@csstools/css-tokenizer';
-import { ComponentValue, consumeComponentValue } from '../consume/component-block-function';
+import type { CSSToken, ParseError} from '@csstools/css-tokenizer';
+import { TokenType, isTokenComma, isTokenEOF } from '@csstools/css-tokenizer';
+import type { ComponentValue} from '../consume/component-block-function';
+import { consumeComponentValue } from '../consume/component-block-function';
/**
* Parse a comma-separated list of component values.
diff --git a/packages/css-parser-algorithms/src/parse/component-value.ts b/packages/css-parser-algorithms/src/parse/component-value.ts
index 96921d93a..9d017a54c 100644
--- a/packages/css-parser-algorithms/src/parse/component-value.ts
+++ b/packages/css-parser-algorithms/src/parse/component-value.ts
@@ -1,5 +1,7 @@
-import { CSSToken, ParseError, TokenType, isTokenEOF } from '@csstools/css-tokenizer';
-import { ComponentValue, consumeComponentValue } from '../consume/component-block-function';
+import type { CSSToken} from '@csstools/css-tokenizer';
+import { ParseError, TokenType, isTokenEOF } from '@csstools/css-tokenizer';
+import type { ComponentValue} from '../consume/component-block-function';
+import { consumeComponentValue } from '../consume/component-block-function';
/**
* Parse a single component value.
diff --git a/packages/css-parser-algorithms/src/parse/list-of-component-values.ts b/packages/css-parser-algorithms/src/parse/list-of-component-values.ts
index 933795c3f..8345e2cb0 100644
--- a/packages/css-parser-algorithms/src/parse/list-of-component-values.ts
+++ b/packages/css-parser-algorithms/src/parse/list-of-component-values.ts
@@ -1,5 +1,7 @@
-import { CSSToken, ParseError, TokenType, isTokenEOF } from '@csstools/css-tokenizer';
-import { ComponentValue, consumeComponentValue } from '../consume/component-block-function';
+import type { CSSToken, ParseError} from '@csstools/css-tokenizer';
+import { TokenType, isTokenEOF } from '@csstools/css-tokenizer';
+import type { ComponentValue} from '../consume/component-block-function';
+import { consumeComponentValue } from '../consume/component-block-function';
/**
* Parse a list of component values.
diff --git a/packages/css-parser-algorithms/src/util/source-indices.ts b/packages/css-parser-algorithms/src/util/source-indices.ts
index 6621481a2..08e88c807 100644
--- a/packages/css-parser-algorithms/src/util/source-indices.ts
+++ b/packages/css-parser-algorithms/src/util/source-indices.ts
@@ -1,4 +1,4 @@
-import { CSSToken } from '@csstools/css-tokenizer';
+import type { CSSToken } from '@csstools/css-tokenizer';
/**
* Returns the start and end index of a node in the CSS source string.
diff --git a/packages/css-parser-algorithms/test/cases/media-not/0001.mjs b/packages/css-parser-algorithms/test/cases/media-not/0001.mjs
index 5eb55f343..3e03d7596 100644
--- a/packages/css-parser-algorithms/test/cases/media-not/0001.mjs
+++ b/packages/css-parser-algorithms/test/cases/media-not/0001.mjs
@@ -1,4 +1,4 @@
-import assert from 'assert';
+import assert from 'node:assert';
import { runTest } from '../../util/run-test.mjs';
runTest(
diff --git a/packages/css-parser-algorithms/test/cases/mf-boolean/0001.mjs b/packages/css-parser-algorithms/test/cases/mf-boolean/0001.mjs
index 2686abd60..ab2d98481 100644
--- a/packages/css-parser-algorithms/test/cases/mf-boolean/0001.mjs
+++ b/packages/css-parser-algorithms/test/cases/mf-boolean/0001.mjs
@@ -1,4 +1,4 @@
-import assert from 'assert';
+import assert from 'node:assert';
import { runTest } from '../../util/run-test.mjs';
runTest(
diff --git a/packages/css-parser-algorithms/test/cases/mf-boolean/0002.mjs b/packages/css-parser-algorithms/test/cases/mf-boolean/0002.mjs
index f8266d441..bfe3977e3 100644
--- a/packages/css-parser-algorithms/test/cases/mf-boolean/0002.mjs
+++ b/packages/css-parser-algorithms/test/cases/mf-boolean/0002.mjs
@@ -1,4 +1,4 @@
-import assert from 'assert';
+import assert from 'node:assert';
import { runTest } from '../../util/run-test.mjs';
runTest(
diff --git a/packages/css-parser-algorithms/test/cases/mf-boolean/0003.mjs b/packages/css-parser-algorithms/test/cases/mf-boolean/0003.mjs
index c0c9f5645..9f97303c6 100644
--- a/packages/css-parser-algorithms/test/cases/mf-boolean/0003.mjs
+++ b/packages/css-parser-algorithms/test/cases/mf-boolean/0003.mjs
@@ -1,4 +1,4 @@
-import assert from 'assert';
+import assert from 'node:assert';
import { runTest } from '../../util/run-test.mjs';
runTest(
diff --git a/packages/css-parser-algorithms/test/cases/mf-boolean/0004.mjs b/packages/css-parser-algorithms/test/cases/mf-boolean/0004.mjs
index 0a34a2dc8..ec0dbb08a 100644
--- a/packages/css-parser-algorithms/test/cases/mf-boolean/0004.mjs
+++ b/packages/css-parser-algorithms/test/cases/mf-boolean/0004.mjs
@@ -1,4 +1,4 @@
-import assert from 'assert';
+import assert from 'node:assert';
import { runTest } from '../../util/run-test.mjs';
runTest(
diff --git a/packages/css-parser-algorithms/test/cases/mf-boolean/0005.mjs b/packages/css-parser-algorithms/test/cases/mf-boolean/0005.mjs
index c44c8c1f7..a3cec9a91 100644
--- a/packages/css-parser-algorithms/test/cases/mf-boolean/0005.mjs
+++ b/packages/css-parser-algorithms/test/cases/mf-boolean/0005.mjs
@@ -1,4 +1,4 @@
-import assert from 'assert';
+import assert from 'node:assert';
import { runTest } from '../../util/run-test.mjs';
runTest(
diff --git a/packages/css-parser-algorithms/test/cases/mf-plain/0001.mjs b/packages/css-parser-algorithms/test/cases/mf-plain/0001.mjs
index b674721b7..f99538695 100644
--- a/packages/css-parser-algorithms/test/cases/mf-plain/0001.mjs
+++ b/packages/css-parser-algorithms/test/cases/mf-plain/0001.mjs
@@ -1,4 +1,4 @@
-import assert from 'assert';
+import assert from 'node:assert';
import { runTest } from '../../util/run-test.mjs';
runTest(
diff --git a/packages/css-parser-algorithms/test/cases/mf-plain/0002.mjs b/packages/css-parser-algorithms/test/cases/mf-plain/0002.mjs
index 90eb3e1f9..838a4f8bf 100644
--- a/packages/css-parser-algorithms/test/cases/mf-plain/0002.mjs
+++ b/packages/css-parser-algorithms/test/cases/mf-plain/0002.mjs
@@ -1,4 +1,4 @@
-import assert from 'assert';
+import assert from 'node:assert';
import { runTest } from '../../util/run-test.mjs';
runTest(
diff --git a/packages/css-parser-algorithms/test/cases/mf-plain/0003.mjs b/packages/css-parser-algorithms/test/cases/mf-plain/0003.mjs
index ad7c3adf2..a9dc64e6a 100644
--- a/packages/css-parser-algorithms/test/cases/mf-plain/0003.mjs
+++ b/packages/css-parser-algorithms/test/cases/mf-plain/0003.mjs
@@ -1,4 +1,4 @@
-import assert from 'assert';
+import assert from 'node:assert';
import { runTest } from '../../util/run-test.mjs';
runTest(
diff --git a/packages/css-parser-algorithms/test/cases/mf-plain/0004.mjs b/packages/css-parser-algorithms/test/cases/mf-plain/0004.mjs
index 6d9a61a7b..cb00d37b9 100644
--- a/packages/css-parser-algorithms/test/cases/mf-plain/0004.mjs
+++ b/packages/css-parser-algorithms/test/cases/mf-plain/0004.mjs
@@ -1,4 +1,4 @@
-import assert from 'assert';
+import assert from 'node:assert';
import { runTest } from '../../util/run-test.mjs';
runTest(
diff --git a/packages/css-parser-algorithms/test/cases/mf-plain/0005.mjs b/packages/css-parser-algorithms/test/cases/mf-plain/0005.mjs
index 946d31898..8e90cb553 100644
--- a/packages/css-parser-algorithms/test/cases/mf-plain/0005.mjs
+++ b/packages/css-parser-algorithms/test/cases/mf-plain/0005.mjs
@@ -1,4 +1,4 @@
-import assert from 'assert';
+import assert from 'node:assert';
import { runTest } from '../../util/run-test.mjs';
runTest(
diff --git a/packages/css-parser-algorithms/test/cases/query-with-type/0001.mjs b/packages/css-parser-algorithms/test/cases/query-with-type/0001.mjs
index b8d1c3f6b..4f8a2bda6 100644
--- a/packages/css-parser-algorithms/test/cases/query-with-type/0001.mjs
+++ b/packages/css-parser-algorithms/test/cases/query-with-type/0001.mjs
@@ -1,4 +1,4 @@
-import assert from 'assert';
+import assert from 'node:assert';
import { runTest } from '../../util/run-test.mjs';
runTest(
diff --git a/packages/css-parser-algorithms/test/cases/query-with-type/0002.mjs b/packages/css-parser-algorithms/test/cases/query-with-type/0002.mjs
index d9da6523a..0acf0c476 100644
--- a/packages/css-parser-algorithms/test/cases/query-with-type/0002.mjs
+++ b/packages/css-parser-algorithms/test/cases/query-with-type/0002.mjs
@@ -1,4 +1,4 @@
-import assert from 'assert';
+import assert from 'node:assert';
import { runTest } from '../../util/run-test.mjs';
runTest(
diff --git a/packages/css-parser-algorithms/test/cases/query-with-type/0003.mjs b/packages/css-parser-algorithms/test/cases/query-with-type/0003.mjs
index 1684cf679..ca21077e7 100644
--- a/packages/css-parser-algorithms/test/cases/query-with-type/0003.mjs
+++ b/packages/css-parser-algorithms/test/cases/query-with-type/0003.mjs
@@ -1,4 +1,4 @@
-import assert from 'assert';
+import assert from 'node:assert';
import { runTest } from '../../util/run-test.mjs';
runTest(
diff --git a/packages/css-parser-algorithms/test/cases/replacer/0001.mjs b/packages/css-parser-algorithms/test/cases/replacer/0001.mjs
index d115c5d8a..6c37c3dc1 100644
--- a/packages/css-parser-algorithms/test/cases/replacer/0001.mjs
+++ b/packages/css-parser-algorithms/test/cases/replacer/0001.mjs
@@ -1,5 +1,5 @@
import { tokenize, TokenType } from '@csstools/css-tokenizer';
-import assert from 'assert';
+import assert from 'node:assert';
import { CommentNode, replaceComponentValues, isCommentNode, parseCommaSeparatedListOfComponentValues, stringify } from '@csstools/css-parser-algorithms';
const commentReplacer = (x) => {
diff --git a/packages/css-parser-algorithms/test/cases/replacer/0002.mjs b/packages/css-parser-algorithms/test/cases/replacer/0002.mjs
index de35f9631..68c118398 100644
--- a/packages/css-parser-algorithms/test/cases/replacer/0002.mjs
+++ b/packages/css-parser-algorithms/test/cases/replacer/0002.mjs
@@ -1,5 +1,5 @@
import { TokenType, tokenize } from '@csstools/css-tokenizer';
-import assert from 'assert';
+import assert from 'node:assert';
import {replaceComponentValues, parseComponentValue, isFunctionNode, TokenNode } from '@csstools/css-parser-algorithms';
// https://github.com/csstools/postcss-plugins/issues/1202
diff --git a/packages/css-parser-algorithms/test/cases/source-indices/0001.mjs b/packages/css-parser-algorithms/test/cases/source-indices/0001.mjs
index 7f75374c5..e6267f01f 100644
--- a/packages/css-parser-algorithms/test/cases/source-indices/0001.mjs
+++ b/packages/css-parser-algorithms/test/cases/source-indices/0001.mjs
@@ -1,5 +1,5 @@
import { tokenize } from '@csstools/css-tokenizer';
-import assert from 'assert';
+import assert from 'node:assert';
import test from 'node:test';
import { parseCommaSeparatedListOfComponentValues, sourceIndices } from '@csstools/css-parser-algorithms';
diff --git a/packages/css-parser-algorithms/test/cases/various/0001.mjs b/packages/css-parser-algorithms/test/cases/various/0001.mjs
index c5764560e..09804a947 100644
--- a/packages/css-parser-algorithms/test/cases/various/0001.mjs
+++ b/packages/css-parser-algorithms/test/cases/various/0001.mjs
@@ -1,4 +1,4 @@
-import assert from 'assert';
+import assert from 'node:assert';
import { runTest } from '../../util/run-test.mjs';
runTest(
diff --git a/packages/css-parser-algorithms/test/cases/various/0002.mjs b/packages/css-parser-algorithms/test/cases/various/0002.mjs
index 964b4d9b9..332f4a647 100644
--- a/packages/css-parser-algorithms/test/cases/various/0002.mjs
+++ b/packages/css-parser-algorithms/test/cases/various/0002.mjs
@@ -1,4 +1,4 @@
-import assert from 'assert';
+import assert from 'node:assert';
import { runTest } from '../../util/run-test.mjs';
runTest(
diff --git a/packages/css-parser-algorithms/test/cases/various/0003.mjs b/packages/css-parser-algorithms/test/cases/various/0003.mjs
index 2af154b33..b8902025c 100644
--- a/packages/css-parser-algorithms/test/cases/various/0003.mjs
+++ b/packages/css-parser-algorithms/test/cases/various/0003.mjs
@@ -1,4 +1,4 @@
-import assert from 'assert';
+import assert from 'node:assert';
import { runTest } from '../../util/run-test.mjs';
runTest(
diff --git a/packages/css-parser-algorithms/test/cases/various/0004.mjs b/packages/css-parser-algorithms/test/cases/various/0004.mjs
index 62f73bf0a..ab640e461 100644
--- a/packages/css-parser-algorithms/test/cases/various/0004.mjs
+++ b/packages/css-parser-algorithms/test/cases/various/0004.mjs
@@ -1,4 +1,4 @@
-import assert from 'assert';
+import assert from 'node:assert';
import { runTest } from '../../util/run-test.mjs';
runTest(
diff --git a/packages/css-parser-algorithms/test/cases/various/0005.mjs b/packages/css-parser-algorithms/test/cases/various/0005.mjs
index 7c55c608d..f6833f603 100644
--- a/packages/css-parser-algorithms/test/cases/various/0005.mjs
+++ b/packages/css-parser-algorithms/test/cases/various/0005.mjs
@@ -1,4 +1,4 @@
-import assert from 'assert';
+import assert from 'node:assert';
import { runTest } from '../../util/run-test.mjs';
runTest(
diff --git a/packages/css-parser-algorithms/test/cases/various/0006.mjs b/packages/css-parser-algorithms/test/cases/various/0006.mjs
index 2d9faf758..581d7cfc5 100644
--- a/packages/css-parser-algorithms/test/cases/various/0006.mjs
+++ b/packages/css-parser-algorithms/test/cases/various/0006.mjs
@@ -1,4 +1,4 @@
-import assert from 'assert';
+import assert from 'node:assert';
import { runTest } from '../../util/run-test.mjs';
runTest(
diff --git a/packages/css-parser-algorithms/test/cases/various/0007.mjs b/packages/css-parser-algorithms/test/cases/various/0007.mjs
index f3e178c40..6689dea8c 100644
--- a/packages/css-parser-algorithms/test/cases/various/0007.mjs
+++ b/packages/css-parser-algorithms/test/cases/various/0007.mjs
@@ -1,4 +1,4 @@
-import assert from 'assert';
+import assert from 'node:assert';
import { runTest } from '../../util/run-test.mjs';
runTest(
diff --git a/packages/css-parser-algorithms/test/cases/various/0008.mjs b/packages/css-parser-algorithms/test/cases/various/0008.mjs
index 6ea1fad9d..aa0d99bc2 100644
--- a/packages/css-parser-algorithms/test/cases/various/0008.mjs
+++ b/packages/css-parser-algorithms/test/cases/various/0008.mjs
@@ -1,4 +1,4 @@
-import assert from 'assert';
+import assert from 'node:assert';
import { runTest } from '../../util/run-test.mjs';
runTest(
diff --git a/packages/css-parser-algorithms/test/cases/various/0009.mjs b/packages/css-parser-algorithms/test/cases/various/0009.mjs
index bdf46f868..7f7ae68d9 100644
--- a/packages/css-parser-algorithms/test/cases/various/0009.mjs
+++ b/packages/css-parser-algorithms/test/cases/various/0009.mjs
@@ -1,4 +1,4 @@
-import assert from 'assert';
+import assert from 'node:assert';
import { runTest } from '../../util/run-test.mjs';
runTest(
diff --git a/packages/css-parser-algorithms/test/cases/various/0010.mjs b/packages/css-parser-algorithms/test/cases/various/0010.mjs
index 9b314124f..8c3aa79f1 100644
--- a/packages/css-parser-algorithms/test/cases/various/0010.mjs
+++ b/packages/css-parser-algorithms/test/cases/various/0010.mjs
@@ -1,4 +1,4 @@
-import assert from 'assert';
+import assert from 'node:assert';
import { runTest } from '../../util/run-test.mjs';
runTest(
diff --git a/packages/css-parser-algorithms/test/cases/various/0011.mjs b/packages/css-parser-algorithms/test/cases/various/0011.mjs
index dc4fa6514..ace26eca2 100644
--- a/packages/css-parser-algorithms/test/cases/various/0011.mjs
+++ b/packages/css-parser-algorithms/test/cases/various/0011.mjs
@@ -1,4 +1,4 @@
-import assert from 'assert';
+import assert from 'node:assert';
import { runTest } from '../../util/run-test.mjs';
runTest(
diff --git a/packages/css-parser-algorithms/test/cases/various/0012.mjs b/packages/css-parser-algorithms/test/cases/various/0012.mjs
index 6f2b31339..84e8d695d 100644
--- a/packages/css-parser-algorithms/test/cases/various/0012.mjs
+++ b/packages/css-parser-algorithms/test/cases/various/0012.mjs
@@ -1,4 +1,4 @@
-import assert from 'assert';
+import assert from 'node:assert';
import { runTest } from '../../util/run-test.mjs';
runTest(
diff --git a/packages/css-parser-algorithms/test/cases/various/0013.mjs b/packages/css-parser-algorithms/test/cases/various/0013.mjs
index 94cc52dee..da356fa01 100644
--- a/packages/css-parser-algorithms/test/cases/various/0013.mjs
+++ b/packages/css-parser-algorithms/test/cases/various/0013.mjs
@@ -1,4 +1,4 @@
-import assert from 'assert';
+import assert from 'node:assert';
import { runTest } from '../../util/run-test.mjs';
runTest(
diff --git a/packages/css-parser-algorithms/test/cases/various/0014.mjs b/packages/css-parser-algorithms/test/cases/various/0014.mjs
index 26a323ac3..81f93cac4 100644
--- a/packages/css-parser-algorithms/test/cases/various/0014.mjs
+++ b/packages/css-parser-algorithms/test/cases/various/0014.mjs
@@ -1,4 +1,4 @@
-import assert from 'assert';
+import assert from 'node:assert';
import { runTest } from '../../util/run-test.mjs';
runTest(
diff --git a/packages/css-parser-algorithms/test/cases/various/0015.mjs b/packages/css-parser-algorithms/test/cases/various/0015.mjs
index 656a7b017..04e50abbd 100644
--- a/packages/css-parser-algorithms/test/cases/various/0015.mjs
+++ b/packages/css-parser-algorithms/test/cases/various/0015.mjs
@@ -1,4 +1,4 @@
-import assert from 'assert';
+import assert from 'node:assert';
import { runTest } from '../../util/run-test.mjs';
runTest(
diff --git a/packages/css-parser-algorithms/test/cases/various/0016.mjs b/packages/css-parser-algorithms/test/cases/various/0016.mjs
index 238192b31..16899371b 100644
--- a/packages/css-parser-algorithms/test/cases/various/0016.mjs
+++ b/packages/css-parser-algorithms/test/cases/various/0016.mjs
@@ -1,4 +1,4 @@
-import assert from 'assert';
+import assert from 'node:assert';
import { runTest } from '../../util/run-test.mjs';
runTest(
diff --git a/packages/css-parser-algorithms/test/cases/various/0017.mjs b/packages/css-parser-algorithms/test/cases/various/0017.mjs
index 3ffaa1e3b..c2346e258 100644
--- a/packages/css-parser-algorithms/test/cases/various/0017.mjs
+++ b/packages/css-parser-algorithms/test/cases/various/0017.mjs
@@ -1,4 +1,4 @@
-import assert from 'assert';
+import assert from 'node:assert';
import { runTest } from '../../util/run-test.mjs';
runTest(
diff --git a/packages/css-parser-algorithms/test/cases/various/0018.mjs b/packages/css-parser-algorithms/test/cases/various/0018.mjs
index 342074128..c05301add 100644
--- a/packages/css-parser-algorithms/test/cases/various/0018.mjs
+++ b/packages/css-parser-algorithms/test/cases/various/0018.mjs
@@ -1,4 +1,4 @@
-import assert from 'assert';
+import assert from 'node:assert';
import { runTest } from '../../util/run-test.mjs';
runTest(
diff --git a/packages/css-parser-algorithms/test/cases/various/0019.mjs b/packages/css-parser-algorithms/test/cases/various/0019.mjs
index 32c9385e6..d3466cb55 100644
--- a/packages/css-parser-algorithms/test/cases/various/0019.mjs
+++ b/packages/css-parser-algorithms/test/cases/various/0019.mjs
@@ -1,4 +1,4 @@
-import assert from 'assert';
+import assert from 'node:assert';
import { runTest } from '../../util/run-test.mjs';
runTest(
diff --git a/packages/css-parser-algorithms/test/cases/various/0020.mjs b/packages/css-parser-algorithms/test/cases/various/0020.mjs
index 040771614..9084cfc33 100644
--- a/packages/css-parser-algorithms/test/cases/various/0020.mjs
+++ b/packages/css-parser-algorithms/test/cases/various/0020.mjs
@@ -1,4 +1,4 @@
-import assert from 'assert';
+import assert from 'node:assert';
import { runTest } from '../../util/run-test.mjs';
runTest(
diff --git a/packages/css-parser-algorithms/test/cases/various/0021.mjs b/packages/css-parser-algorithms/test/cases/various/0021.mjs
index a0d9cb818..d26043232 100644
--- a/packages/css-parser-algorithms/test/cases/various/0021.mjs
+++ b/packages/css-parser-algorithms/test/cases/various/0021.mjs
@@ -1,4 +1,4 @@
-import assert from 'assert';
+import assert from 'node:assert';
import { runTest } from '../../util/run-test.mjs';
runTest(
diff --git a/packages/css-parser-algorithms/test/cases/walker/0001.mjs b/packages/css-parser-algorithms/test/cases/walker/0001.mjs
index 9f0116031..6615e5494 100644
--- a/packages/css-parser-algorithms/test/cases/walker/0001.mjs
+++ b/packages/css-parser-algorithms/test/cases/walker/0001.mjs
@@ -1,5 +1,5 @@
import { TokenType, tokenize } from '@csstools/css-tokenizer';
-import assert from 'assert';
+import assert from 'node:assert';
import { parseCommaSeparatedListOfComponentValues, isFunctionNode, isTokenNode } from '@csstools/css-parser-algorithms';
const onParseError = (err) => {
diff --git a/packages/css-parser-algorithms/test/cases/walker/0002.mjs b/packages/css-parser-algorithms/test/cases/walker/0002.mjs
index a5a1fa4e9..bc09b411f 100644
--- a/packages/css-parser-algorithms/test/cases/walker/0002.mjs
+++ b/packages/css-parser-algorithms/test/cases/walker/0002.mjs
@@ -1,5 +1,5 @@
import { tokenize } from '@csstools/css-tokenizer';
-import assert from 'assert';
+import assert from 'node:assert';
import { parseComponentValue } from '@csstools/css-parser-algorithms';
const onParseError = (err) => {
diff --git a/packages/css-parser-algorithms/test/cases/walker/0003.mjs b/packages/css-parser-algorithms/test/cases/walker/0003.mjs
index ecbf62edf..ce471e545 100644
--- a/packages/css-parser-algorithms/test/cases/walker/0003.mjs
+++ b/packages/css-parser-algorithms/test/cases/walker/0003.mjs
@@ -1,5 +1,5 @@
import { tokenize } from '@csstools/css-tokenizer';
-import assert from 'assert';
+import assert from 'node:assert';
import { parseListOfComponentValues, parseComponentValue, walk } from '@csstools/css-parser-algorithms';
const onParseError = (err) => {
diff --git a/packages/css-parser-algorithms/test/cases/wpt/0001.mjs b/packages/css-parser-algorithms/test/cases/wpt/0001.mjs
index a68369f07..fb427f41a 100644
--- a/packages/css-parser-algorithms/test/cases/wpt/0001.mjs
+++ b/packages/css-parser-algorithms/test/cases/wpt/0001.mjs
@@ -1,4 +1,4 @@
-import assert from 'assert';
+import assert from 'node:assert';
import { runTest } from '../../util/run-test.mjs';
// css/css-syntax/unclosed-constructs.html
diff --git a/packages/css-parser-algorithms/test/cases/wpt/0002.mjs b/packages/css-parser-algorithms/test/cases/wpt/0002.mjs
index 8028a02b7..bb1b93611 100644
--- a/packages/css-parser-algorithms/test/cases/wpt/0002.mjs
+++ b/packages/css-parser-algorithms/test/cases/wpt/0002.mjs
@@ -1,4 +1,4 @@
-import assert from 'assert';
+import assert from 'node:assert';
import { runTest } from '../../util/run-test.mjs';
// css/css-syntax/unclosed-constructs.html
diff --git a/packages/css-parser-algorithms/test/cases/wpt/0003.mjs b/packages/css-parser-algorithms/test/cases/wpt/0003.mjs
index 67af48370..67f1dece8 100644
--- a/packages/css-parser-algorithms/test/cases/wpt/0003.mjs
+++ b/packages/css-parser-algorithms/test/cases/wpt/0003.mjs
@@ -1,4 +1,4 @@
-import assert from 'assert';
+import assert from 'node:assert';
import { runTest } from '../../util/run-test.mjs';
// css/css-syntax/unclosed-constructs.html
diff --git a/packages/css-parser-algorithms/test/cases/wpt/0004.mjs b/packages/css-parser-algorithms/test/cases/wpt/0004.mjs
index fcb6d5702..e6fab9c53 100644
--- a/packages/css-parser-algorithms/test/cases/wpt/0004.mjs
+++ b/packages/css-parser-algorithms/test/cases/wpt/0004.mjs
@@ -1,4 +1,4 @@
-import assert from 'assert';
+import assert from 'node:assert';
import { runTest } from '../../util/run-test.mjs';
// css/css-syntax/unclosed-constructs.html
diff --git a/packages/css-parser-algorithms/test/util/run-test.mjs b/packages/css-parser-algorithms/test/util/run-test.mjs
index 659cdba5d..e49873b21 100644
--- a/packages/css-parser-algorithms/test/util/run-test.mjs
+++ b/packages/css-parser-algorithms/test/util/run-test.mjs
@@ -1,5 +1,5 @@
-import fs from 'fs';
-import path from 'path';
+import fs from 'node:fs';
+import path from 'node:path';
import test from 'node:test';
import { parseCommaSeparatedListOfComponentValues, parseListOfComponentValues } from '@csstools/css-parser-algorithms';
import { tokenizer } from '@csstools/css-tokenizer';
diff --git a/packages/css-tokenizer/CHANGELOG.md b/packages/css-tokenizer/CHANGELOG.md
index 71addca5e..840a9980b 100644
--- a/packages/css-tokenizer/CHANGELOG.md
+++ b/packages/css-tokenizer/CHANGELOG.md
@@ -1,5 +1,10 @@
# Changes to CSS Tokenizer
+### Unreleased (major)
+
+- Updated: Support for Node v18+ (major).
+- Improve performance.
+
### 2.4.1
_July 5, 2024_
diff --git a/packages/css-tokenizer/dist/index.cjs b/packages/css-tokenizer/dist/index.cjs
index 1a95fd10b..59fdf698b 100644
--- a/packages/css-tokenizer/dist/index.cjs
+++ b/packages/css-tokenizer/dist/index.cjs
@@ -1 +1 @@
-"use strict";class ParseError extends Error{sourceStart;sourceEnd;parserState;constructor(e,o,n,r){super(e),this.name="ParseError",this.sourceStart=o,this.sourceEnd=n,this.parserState=r}}class ParseErrorWithToken extends ParseError{token;constructor(e,o,n,r,t){super(e,o,n,r),this.token=t}}const e={UnexpectedNewLineInString:"Unexpected newline while consuming a string token.",UnexpectedEOFInString:"Unexpected EOF while consuming a string token.",UnexpectedEOFInComment:"Unexpected EOF while consuming a comment.",UnexpectedEOFInURL:"Unexpected EOF while consuming a url token.",UnexpectedEOFInEscapedCodePoint:"Unexpected EOF while consuming an escaped code point.",UnexpectedCharacterInURL:"Unexpected character while consuming a url token.",InvalidEscapeSequenceInURL:"Invalid escape sequence while consuming a url token.",InvalidEscapeSequenceAfterBackslash:'Invalid escape sequence after "\\"'};class Reader{cursor=0;source="";codePointSource=[];representationIndices=[-1];length=0;representationStart=0;representationEnd=-1;constructor(e){this.source=e;{let o=-1,n="";for(n of e)o+=n.length,this.codePointSource.push(n.codePointAt(0)),this.representationIndices.push(o)}this.length=this.codePointSource.length}advanceCodePoint(e=1){this.cursor=this.cursor+e,this.representationEnd=this.representationIndices[this.cursor]}readCodePoint(e=1){const o=this.codePointSource[this.cursor];return void 0!==o&&(this.cursor=this.cursor+e,this.representationEnd=this.representationIndices[this.cursor],o)}unreadCodePoint(e=1){this.cursor=this.cursor-e,this.representationEnd=this.representationIndices[this.cursor]}resetRepresentation(){this.representationStart=this.representationIndices[this.cursor]+1,this.representationEnd=-1}}const o="undefined"!=typeof globalThis&&"structuredClone"in globalThis;const n=39,r=42,t=8,i=13,s=9,c=58,a=44,u=64,d=127,p=33,T=12,P=46,S=62,k=45,C=31,l=69,f=101,x=123,m=40,h=91,E=60,y=10,v=11,g=95,I=1114111,U=0,O=35,D=37,R=43,w=34,L=65533,A=92,W=125,N=41,F=93,q=59,b=14,H=47,B=32,V=117,z=85,K=114,M=82,$=108,J=76,_=63,j=48,Q=70;function checkIfFourCodePointsWouldStartCDO(e){return e.codePointSource[e.cursor]===E&&e.codePointSource[e.cursor+1]===p&&e.codePointSource[e.cursor+2]===k&&e.codePointSource[e.cursor+3]===k}function isDigitCodePoint(e){return e>=48&&e<=57}function isUppercaseLetterCodePoint(e){return e>=65&&e<=90}function isLowercaseLetterCodePoint(e){return e>=97&&e<=122}function isHexDigitCodePoint(e){return isDigitCodePoint(e)||e>=97&&e<=102||e>=65&&e<=70}function isLetterCodePoint(e){return isLowercaseLetterCodePoint(e)||isUppercaseLetterCodePoint(e)}function isIdentStartCodePoint(e){return isLetterCodePoint(e)||isNonASCII_IdentCodePoint(e)||e===g}function isIdentCodePoint(e){return isIdentStartCodePoint(e)||isDigitCodePoint(e)||e===k}function isNonASCII_IdentCodePoint(e){return 183===e||8204===e||8205===e||8255===e||8256===e||8204===e||(192<=e&&e<=214||216<=e&&e<=246||248<=e&&e<=893||895<=e&&e<=8191||8304<=e&&e<=8591||11264<=e&&e<=12271||12289<=e&&e<=55295||63744<=e&&e<=64975||65008<=e&&e<=65533||e>=65536)}function isNewLine(e){return e===y||e===i||e===T}function isWhitespace(e){return e===B||e===y||e===s||e===i||e===T}function checkIfTwoCodePointsAreAValidEscape(e){return e.codePointSource[e.cursor]===A&&!isNewLine(e.codePointSource[e.cursor+1])}function checkIfThreeCodePointsWouldStartAnIdentSequence(e,o){return o.codePointSource[o.cursor]===k?o.codePointSource[o.cursor+1]===k||(!!isIdentStartCodePoint(o.codePointSource[o.cursor+1])||o.codePointSource[o.cursor+1]===A&&!isNewLine(o.codePointSource[o.cursor+2])):!!isIdentStartCodePoint(o.codePointSource[o.cursor])||checkIfTwoCodePointsAreAValidEscape(o)}function checkIfThreeCodePointsWouldStartANumber(e){return e.codePointSource[e.cursor]===R||e.codePointSource[e.cursor]===k?!!isDigitCodePoint(e.codePointSource[e.cursor+1])||e.codePointSource[e.cursor+1]===P&&isDigitCodePoint(e.codePointSource[e.cursor+2]):e.codePointSource[e.cursor]===P?isDigitCodePoint(e.codePointSource[e.cursor+1]):isDigitCodePoint(e.codePointSource[e.cursor])}function checkIfTwoCodePointsStartAComment(e){return e.codePointSource[e.cursor]===H&&e.codePointSource[e.cursor+1]===r}function checkIfThreeCodePointsWouldStartCDC(e){return e.codePointSource[e.cursor]===k&&e.codePointSource[e.cursor+1]===k&&e.codePointSource[e.cursor+2]===S}var G,X,Y;function consumeComment(o,n){for(n.advanceCodePoint(2);;){const t=n.readCodePoint();if(!1===t){const r=[exports.TokenType.Comment,n.source.slice(n.representationStart,n.representationEnd+1),n.representationStart,n.representationEnd,void 0];return o.onParseError(new ParseErrorWithToken(e.UnexpectedEOFInComment,n.representationStart,n.representationEnd,["4.3.2. Consume comments","Unexpected EOF"],r)),r}if(t===r&&(void 0!==n.codePointSource[n.cursor]&&n.codePointSource[n.cursor]===H)){n.advanceCodePoint();break}}return[exports.TokenType.Comment,n.source.slice(n.representationStart,n.representationEnd+1),n.representationStart,n.representationEnd,void 0]}function consumeEscapedCodePoint(o,n){const r=n.readCodePoint();if(!1===r)return o.onParseError(new ParseError(e.UnexpectedEOFInEscapedCodePoint,n.representationStart,n.representationEnd,["4.3.7. Consume an escaped code point","Unexpected EOF"])),L;if(isHexDigitCodePoint(r)){const e=[r];for(;void 0!==n.codePointSource[n.cursor]&&isHexDigitCodePoint(n.codePointSource[n.cursor])&&e.length<6;)e.push(n.codePointSource[n.cursor]),n.advanceCodePoint();isWhitespace(n.codePointSource[n.cursor])&&n.advanceCodePoint();const o=parseInt(String.fromCodePoint(...e),16);return 0===o?L:(t=o)>=55296&&t<=57343||o>I?L:o}var t;return r}function consumeIdentSequence(e,o){const n=[];for(;;)if(isIdentCodePoint(o.codePointSource[o.cursor]))n.push(o.codePointSource[o.cursor]),o.advanceCodePoint();else{if(!checkIfTwoCodePointsAreAValidEscape(o))return n;o.advanceCodePoint(),n.push(consumeEscapedCodePoint(e,o))}}function consumeHashToken(e,o){if(o.advanceCodePoint(),void 0!==o.codePointSource[o.cursor]&&(isIdentCodePoint(o.codePointSource[o.cursor])||checkIfTwoCodePointsAreAValidEscape(o))){let n=exports.HashType.Unrestricted;checkIfThreeCodePointsWouldStartAnIdentSequence(0,o)&&(n=exports.HashType.ID);const r=consumeIdentSequence(e,o);return[exports.TokenType.Hash,o.source.slice(o.representationStart,o.representationEnd+1),o.representationStart,o.representationEnd,{value:String.fromCodePoint(...r),type:n}]}return[exports.TokenType.Delim,"#",o.representationStart,o.representationEnd,{value:"#"}]}function consumeNumber(e,o){let n=exports.NumberType.Integer;for(o.codePointSource[o.cursor]!==R&&o.codePointSource[o.cursor]!==k||o.advanceCodePoint();isDigitCodePoint(o.codePointSource[o.cursor]);)o.advanceCodePoint();if(o.codePointSource[o.cursor]===P&&isDigitCodePoint(o.codePointSource[o.cursor+1]))for(o.advanceCodePoint(2),n=exports.NumberType.Number;isDigitCodePoint(o.codePointSource[o.cursor]);)o.advanceCodePoint();if(o.codePointSource[o.cursor]===f||o.codePointSource[o.cursor]===l){if(isDigitCodePoint(o.codePointSource[o.cursor+1]))o.advanceCodePoint(2);else{if(o.codePointSource[o.cursor+1]!==k&&o.codePointSource[o.cursor+1]!==R||!isDigitCodePoint(o.codePointSource[o.cursor+2]))return n;o.advanceCodePoint(3)}for(n=exports.NumberType.Number;isDigitCodePoint(o.codePointSource[o.cursor]);)o.advanceCodePoint()}return n}function consumeNumericToken(e,o){let n;{const e=o.codePointSource[o.cursor];e===k?n="-":e===R&&(n="+")}const r=consumeNumber(0,o),t=parseFloat(o.source.slice(o.representationStart,o.representationEnd+1));if(checkIfThreeCodePointsWouldStartAnIdentSequence(0,o)){const i=consumeIdentSequence(e,o);return[exports.TokenType.Dimension,o.source.slice(o.representationStart,o.representationEnd+1),o.representationStart,o.representationEnd,{value:t,signCharacter:n,type:r,unit:String.fromCodePoint(...i)}]}return o.codePointSource[o.cursor]===D?(o.advanceCodePoint(),[exports.TokenType.Percentage,o.source.slice(o.representationStart,o.representationEnd+1),o.representationStart,o.representationEnd,{value:t,signCharacter:n}]):[exports.TokenType.Number,o.source.slice(o.representationStart,o.representationEnd+1),o.representationStart,o.representationEnd,{value:t,signCharacter:n,type:r}]}function consumeWhiteSpace(e){for(;isWhitespace(e.codePointSource[e.cursor]);)e.advanceCodePoint();return[exports.TokenType.Whitespace,e.source.slice(e.representationStart,e.representationEnd+1),e.representationStart,e.representationEnd,void 0]}function consumeStringToken(o,n){let r="";const t=n.readCodePoint();for(;;){const s=n.readCodePoint();if(!1===s){const t=[exports.TokenType.String,n.source.slice(n.representationStart,n.representationEnd+1),n.representationStart,n.representationEnd,{value:r}];return o.onParseError(new ParseErrorWithToken(e.UnexpectedEOFInString,n.representationStart,n.representationEnd,["4.3.5. Consume a string token","Unexpected EOF"],t)),t}if(isNewLine(s)){n.unreadCodePoint();const r=[exports.TokenType.BadString,n.source.slice(n.representationStart,n.representationEnd+1),n.representationStart,n.representationEnd,void 0];return o.onParseError(new ParseErrorWithToken(e.UnexpectedNewLineInString,n.representationStart,n.codePointSource[n.cursor]===i&&n.codePointSource[n.cursor+1]===y?n.representationEnd+2:n.representationEnd+1,["4.3.5. Consume a string token","Unexpected newline"],r)),r}if(s===t)return[exports.TokenType.String,n.source.slice(n.representationStart,n.representationEnd+1),n.representationStart,n.representationEnd,{value:r}];if(s!==A)r+=String.fromCodePoint(s);else{if(void 0===n.codePointSource[n.cursor])continue;if(isNewLine(n.codePointSource[n.cursor])){n.codePointSource[n.cursor]===i&&n.codePointSource[n.cursor+1]===y&&n.advanceCodePoint(),n.advanceCodePoint();continue}r+=String.fromCodePoint(consumeEscapedCodePoint(o,n))}}}function checkIfCodePointsMatchURLIdent(e){return!(3!==e.length||e[0]!==V&&e[0]!==z||e[1]!==K&&e[1]!==M||e[2]!==$&&e[2]!==J)}function consumeBadURL(e,o){for(;;){if(void 0===o.codePointSource[o.cursor])return;if(o.codePointSource[o.cursor]===N)return void o.advanceCodePoint();checkIfTwoCodePointsAreAValidEscape(o)?(o.advanceCodePoint(),consumeEscapedCodePoint(e,o)):o.advanceCodePoint()}}function consumeUrlToken(o,r){for(;isWhitespace(r.codePointSource[r.cursor]);)r.advanceCodePoint();let i="";for(;;){if(void 0===r.codePointSource[r.cursor]){const n=[exports.TokenType.URL,r.source.slice(r.representationStart,r.representationEnd+1),r.representationStart,r.representationEnd,{value:i}];return o.onParseError(new ParseErrorWithToken(e.UnexpectedEOFInURL,r.representationStart,r.representationEnd,["4.3.6. Consume a url token","Unexpected EOF"],n)),n}if(r.codePointSource[r.cursor]===N)return r.advanceCodePoint(),[exports.TokenType.URL,r.source.slice(r.representationStart,r.representationEnd+1),r.representationStart,r.representationEnd,{value:i}];if(isWhitespace(r.codePointSource[r.cursor])){for(r.advanceCodePoint();isWhitespace(r.codePointSource[r.cursor]);)r.advanceCodePoint();if(void 0===r.codePointSource[r.cursor]){const n=[exports.TokenType.URL,r.source.slice(r.representationStart,r.representationEnd+1),r.representationStart,r.representationEnd,{value:i}];return o.onParseError(new ParseErrorWithToken(e.UnexpectedEOFInURL,r.representationStart,r.representationEnd,["4.3.6. Consume a url token","Consume as much whitespace as possible","Unexpected EOF"],n)),n}return r.codePointSource[r.cursor]===N?(r.advanceCodePoint(),[exports.TokenType.URL,r.source.slice(r.representationStart,r.representationEnd+1),r.representationStart,r.representationEnd,{value:i}]):(consumeBadURL(o,r),[exports.TokenType.BadURL,r.source.slice(r.representationStart,r.representationEnd+1),r.representationStart,r.representationEnd,void 0])}if(r.codePointSource[r.cursor]===w||r.codePointSource[r.cursor]===n||r.codePointSource[r.cursor]===m||((s=r.codePointSource[r.cursor])===v||s===d||U<=s&&s<=t||b<=s&&s<=C)){consumeBadURL(o,r);const n=[exports.TokenType.BadURL,r.source.slice(r.representationStart,r.representationEnd+1),r.representationStart,r.representationEnd,void 0];return o.onParseError(new ParseErrorWithToken(e.UnexpectedCharacterInURL,r.representationStart,r.representationEnd,["4.3.6. Consume a url token","Unexpected U+0022 QUOTATION MARK (\"), U+0027 APOSTROPHE ('), U+0028 LEFT PARENTHESIS (() or non-printable code point"],n)),n}if(r.codePointSource[r.cursor]===A){if(checkIfTwoCodePointsAreAValidEscape(r)){r.advanceCodePoint(),i+=String.fromCodePoint(consumeEscapedCodePoint(o,r));continue}consumeBadURL(o,r);const n=[exports.TokenType.BadURL,r.source.slice(r.representationStart,r.representationEnd+1),r.representationStart,r.representationEnd,void 0];return o.onParseError(new ParseErrorWithToken(e.InvalidEscapeSequenceInURL,r.representationStart,r.representationEnd,["4.3.6. Consume a url token","U+005C REVERSE SOLIDUS (\\)","The input stream does not start with a valid escape sequence"],n)),n}i+=String.fromCodePoint(r.codePointSource[r.cursor]),r.advanceCodePoint()}var s}function consumeIdentLikeToken(e,o){const r=consumeIdentSequence(e,o);if(o.codePointSource[o.cursor]!==m)return[exports.TokenType.Ident,o.source.slice(o.representationStart,o.representationEnd+1),o.representationStart,o.representationEnd,{value:String.fromCodePoint(...r)}];if(checkIfCodePointsMatchURLIdent(r)){o.advanceCodePoint();let t=0;for(;;){const e=isWhitespace(o.codePointSource[o.cursor]),i=isWhitespace(o.codePointSource[o.cursor+1]);if(e&&i){t+=1,o.advanceCodePoint(1);continue}const s=e?o.codePointSource[o.cursor+1]:o.codePointSource[o.cursor];if(s===w||s===n)return t>0&&o.unreadCodePoint(t),[exports.TokenType.Function,o.source.slice(o.representationStart,o.representationEnd+1),o.representationStart,o.representationEnd,{value:String.fromCodePoint(...r)}];break}return consumeUrlToken(e,o)}return o.advanceCodePoint(),[exports.TokenType.Function,o.source.slice(o.representationStart,o.representationEnd+1),o.representationStart,o.representationEnd,{value:String.fromCodePoint(...r)}]}function checkIfThreeCodePointsWouldStartAUnicodeRange(e){return!(e.codePointSource[e.cursor]!==V&&e.codePointSource[e.cursor]!==z||e.codePointSource[e.cursor+1]!==R||e.codePointSource[e.cursor+2]!==_&&!isHexDigitCodePoint(e.codePointSource[e.cursor+2]))}function consumeUnicodeRangeToken(e,o){o.advanceCodePoint(2);const n=[],r=[];for(;void 0!==o.codePointSource[o.cursor]&&n.length<6&&isHexDigitCodePoint(o.codePointSource[o.cursor]);)n.push(o.codePointSource[o.cursor]),o.advanceCodePoint();for(;void 0!==o.codePointSource[o.cursor]&&n.length<6&&o.codePointSource[o.cursor]===_;)0===r.length&&r.push(...n),n.push(j),r.push(Q),o.advanceCodePoint();if(!r.length&&o.codePointSource[o.cursor]===k&&isHexDigitCodePoint(o.codePointSource[o.cursor+1]))for(o.advanceCodePoint();void 0!==o.codePointSource[o.cursor]&&r.length<6&&isHexDigitCodePoint(o.codePointSource[o.cursor]);)r.push(o.codePointSource[o.cursor]),o.advanceCodePoint();if(!r.length){const e=parseInt(String.fromCodePoint(...n),16);return[exports.TokenType.UnicodeRange,o.source.slice(o.representationStart,o.representationEnd+1),o.representationStart,o.representationEnd,{startOfRange:e,endOfRange:e}]}const t=parseInt(String.fromCodePoint(...n),16),i=parseInt(String.fromCodePoint(...r),16);return[exports.TokenType.UnicodeRange,o.source.slice(o.representationStart,o.representationEnd+1),o.representationStart,o.representationEnd,{startOfRange:t,endOfRange:i}]}function tokenizer(o,r){const t=o.css.valueOf(),d=o.unicodeRangesAllowed??!1,p=new Reader(t),S={onParseError:r?.onParseError??noop};return{nextToken:function nextToken(){p.resetRepresentation();const o=p.codePointSource[p.cursor];if(void 0===o)return[exports.TokenType.EOF,"",-1,-1,void 0];if(o===H&&checkIfTwoCodePointsStartAComment(p))return consumeComment(S,p);if(d&&(o===V||o===z)&&checkIfThreeCodePointsWouldStartAUnicodeRange(p))return consumeUnicodeRangeToken(0,p);if(isIdentStartCodePoint(o))return consumeIdentLikeToken(S,p);if(isDigitCodePoint(o))return consumeNumericToken(S,p);switch(o){case a:return p.advanceCodePoint(),[exports.TokenType.Comma,",",p.representationStart,p.representationEnd,void 0];case c:return p.advanceCodePoint(),[exports.TokenType.Colon,":",p.representationStart,p.representationEnd,void 0];case q:return p.advanceCodePoint(),[exports.TokenType.Semicolon,";",p.representationStart,p.representationEnd,void 0];case m:return p.advanceCodePoint(),[exports.TokenType.OpenParen,"(",p.representationStart,p.representationEnd,void 0];case N:return p.advanceCodePoint(),[exports.TokenType.CloseParen,")",p.representationStart,p.representationEnd,void 0];case h:return p.advanceCodePoint(),[exports.TokenType.OpenSquare,"[",p.representationStart,p.representationEnd,void 0];case F:return p.advanceCodePoint(),[exports.TokenType.CloseSquare,"]",p.representationStart,p.representationEnd,void 0];case x:return p.advanceCodePoint(),[exports.TokenType.OpenCurly,"{",p.representationStart,p.representationEnd,void 0];case W:return p.advanceCodePoint(),[exports.TokenType.CloseCurly,"}",p.representationStart,p.representationEnd,void 0];case n:case w:return consumeStringToken(S,p);case O:return consumeHashToken(S,p);case R:case P:return checkIfThreeCodePointsWouldStartANumber(p)?consumeNumericToken(S,p):(p.advanceCodePoint(),[exports.TokenType.Delim,p.source[p.representationStart],p.representationStart,p.representationEnd,{value:p.source[p.representationStart]}]);case y:case i:case T:case s:case B:return consumeWhiteSpace(p);case k:return checkIfThreeCodePointsWouldStartANumber(p)?consumeNumericToken(S,p):checkIfThreeCodePointsWouldStartCDC(p)?(p.advanceCodePoint(3),[exports.TokenType.CDC,"--\x3e",p.representationStart,p.representationEnd,void 0]):checkIfThreeCodePointsWouldStartAnIdentSequence(0,p)?consumeIdentLikeToken(S,p):(p.advanceCodePoint(),[exports.TokenType.Delim,"-",p.representationStart,p.representationEnd,{value:"-"}]);case E:return checkIfFourCodePointsWouldStartCDO(p)?(p.advanceCodePoint(4),[exports.TokenType.CDO,"\x3c!--",p.representationStart,p.representationEnd,void 0]):(p.advanceCodePoint(),[exports.TokenType.Delim,"<",p.representationStart,p.representationEnd,{value:"<"}]);case u:if(p.advanceCodePoint(),checkIfThreeCodePointsWouldStartAnIdentSequence(0,p)){const e=consumeIdentSequence(S,p);return[exports.TokenType.AtKeyword,p.source.slice(p.representationStart,p.representationEnd+1),p.representationStart,p.representationEnd,{value:String.fromCodePoint(...e)}]}return[exports.TokenType.Delim,"@",p.representationStart,p.representationEnd,{value:"@"}];case A:{if(checkIfTwoCodePointsAreAValidEscape(p))return consumeIdentLikeToken(S,p);p.advanceCodePoint();const o=[exports.TokenType.Delim,"\\",p.representationStart,p.representationEnd,{value:"\\"}];return S.onParseError(new ParseErrorWithToken(e.InvalidEscapeSequenceAfterBackslash,p.representationStart,p.representationEnd,["4.3.1. Consume a token","U+005C REVERSE SOLIDUS (\\)","The input stream does not start with a valid escape sequence"],o)),o}}return p.advanceCodePoint(),[exports.TokenType.Delim,p.source[p.representationStart],p.representationStart,p.representationEnd,{value:p.source[p.representationStart]}]},endOfFile:function endOfFile(){return void 0===p.codePointSource[p.cursor]}}}function noop(){}function ensureThatValueRoundTripsAsIdent(e){let o=0;e[0]===k&&e[1]===k?o=2:e[0]===k&&e[1]?(o=2,isIdentStartCodePoint(e[1])||(o+=insertEscapedCodePoint(e,1,e[1]))):isIdentStartCodePoint(e[0])?o=1:(o=1,o+=insertEscapedCodePoint(e,0,e[0]));for(let n=o;n<4)&&(!!Z.includes(e[0])&&("string"==typeof e[1]&&("number"==typeof e[2]&&"number"==typeof e[3]))))},exports.isTokenAtKeyword=function isTokenAtKeyword(e){return!!e&&e[0]===exports.TokenType.AtKeyword},exports.isTokenBadString=function isTokenBadString(e){return!!e&&e[0]===exports.TokenType.BadString},exports.isTokenBadURL=function isTokenBadURL(e){return!!e&&e[0]===exports.TokenType.BadURL},exports.isTokenCDC=function isTokenCDC(e){return!!e&&e[0]===exports.TokenType.CDC},exports.isTokenCDO=function isTokenCDO(e){return!!e&&e[0]===exports.TokenType.CDO},exports.isTokenCloseCurly=function isTokenCloseCurly(e){return!!e&&e[0]===exports.TokenType.CloseCurly},exports.isTokenCloseParen=function isTokenCloseParen(e){return!!e&&e[0]===exports.TokenType.CloseParen},exports.isTokenCloseSquare=function isTokenCloseSquare(e){return!!e&&e[0]===exports.TokenType.CloseSquare},exports.isTokenColon=function isTokenColon(e){return!!e&&e[0]===exports.TokenType.Colon},exports.isTokenComma=function isTokenComma(e){return!!e&&e[0]===exports.TokenType.Comma},exports.isTokenComment=function isTokenComment(e){return!!e&&e[0]===exports.TokenType.Comment},exports.isTokenDelim=function isTokenDelim(e){return!!e&&e[0]===exports.TokenType.Delim},exports.isTokenDimension=function isTokenDimension(e){return!!e&&e[0]===exports.TokenType.Dimension},exports.isTokenEOF=function isTokenEOF(e){return!!e&&e[0]===exports.TokenType.EOF},exports.isTokenFunction=function isTokenFunction(e){return!!e&&e[0]===exports.TokenType.Function},exports.isTokenHash=function isTokenHash(e){return!!e&&e[0]===exports.TokenType.Hash},exports.isTokenIdent=function isTokenIdent(e){return!!e&&e[0]===exports.TokenType.Ident},exports.isTokenNumber=function isTokenNumber(e){return!!e&&e[0]===exports.TokenType.Number},exports.isTokenNumeric=function isTokenNumeric(e){switch(e[0]){case exports.TokenType.Dimension:case exports.TokenType.Number:case exports.TokenType.Percentage:return!0;default:return!1}},exports.isTokenOpenCurly=function isTokenOpenCurly(e){return!!e&&e[0]===exports.TokenType.OpenCurly},exports.isTokenOpenParen=function isTokenOpenParen(e){return!!e&&e[0]===exports.TokenType.OpenParen},exports.isTokenOpenSquare=function isTokenOpenSquare(e){return!!e&&e[0]===exports.TokenType.OpenSquare},exports.isTokenPercentage=function isTokenPercentage(e){return!!e&&e[0]===exports.TokenType.Percentage},exports.isTokenSemicolon=function isTokenSemicolon(e){return!!e&&e[0]===exports.TokenType.Semicolon},exports.isTokenString=function isTokenString(e){return!!e&&e[0]===exports.TokenType.String},exports.isTokenURL=function isTokenURL(e){return!!e&&e[0]===exports.TokenType.URL},exports.isTokenUnicodeRange=function isTokenUnicodeRange(e){return!!e&&e[0]===exports.TokenType.UnicodeRange},exports.isTokenWhiteSpaceOrComment=function isTokenWhiteSpaceOrComment(e){switch(e[0]){case exports.TokenType.Whitespace:case exports.TokenType.Comment:return!0;default:return!1}},exports.isTokenWhitespace=function isTokenWhitespace(e){return!!e&&e[0]===exports.TokenType.Whitespace},exports.mirrorVariant=function mirrorVariant(e){switch(e[0]){case exports.TokenType.OpenParen:return[exports.TokenType.CloseParen,")",-1,-1,void 0];case exports.TokenType.CloseParen:return[exports.TokenType.OpenParen,"(",-1,-1,void 0];case exports.TokenType.OpenCurly:return[exports.TokenType.CloseCurly,"}",-1,-1,void 0];case exports.TokenType.CloseCurly:return[exports.TokenType.OpenCurly,"{",-1,-1,void 0];case exports.TokenType.OpenSquare:return[exports.TokenType.CloseSquare,"]",-1,-1,void 0];case exports.TokenType.CloseSquare:return[exports.TokenType.OpenSquare,"[",-1,-1,void 0];default:return null}},exports.mirrorVariantType=function mirrorVariantType(e){switch(e){case exports.TokenType.OpenParen:return exports.TokenType.CloseParen;case exports.TokenType.CloseParen:return exports.TokenType.OpenParen;case exports.TokenType.OpenCurly:return exports.TokenType.CloseCurly;case exports.TokenType.CloseCurly:return exports.TokenType.OpenCurly;case exports.TokenType.OpenSquare:return exports.TokenType.CloseSquare;case exports.TokenType.CloseSquare:return exports.TokenType.OpenSquare;default:return null}},exports.mutateIdent=function mutateIdent(e,o){const n=[];for(const e of o)n.push(e.codePointAt(0));const r=String.fromCodePoint(...ensureThatValueRoundTripsAsIdent(n));e[1]=r,e[4].value=o},exports.mutateUnit=function mutateUnit(e,o){const n=[];for(const e of o)n.push(e.codePointAt(0));const r=ensureThatValueRoundTripsAsIdent(n);101===r[0]&&insertEscapedCodePoint(r,0,r[0]);const t=String.fromCodePoint(...r),i="+"===e[4].signCharacter?e[4].signCharacter:"",s=e[4].value.toString();e[1]=`${i}${s}${t}`,e[4].unit=o},exports.stringify=function stringify(...e){let o="";for(let n=0;n=48&&e<=57}function isUppercaseLetterCodePoint(e){return void 0!==e&&e>=65&&e<=90}function isLowercaseLetterCodePoint(e){return void 0!==e&&e>=97&&e<=122}function isHexDigitCodePoint(e){return void 0!==e&&(e>=48&&e<=57||e>=97&&e<=102||e>=65&&e<=70)}function isLetterCodePoint(e){return isLowercaseLetterCodePoint(e)||isUppercaseLetterCodePoint(e)}function isIdentStartCodePoint(e){return isLetterCodePoint(e)||isNonASCII_IdentCodePoint(e)||e===A}function isIdentCodePoint(e){return isIdentStartCodePoint(e)||isDigitCodePoint(e)||e===C}function isNonASCII_IdentCodePoint(e){return 183===e||8204===e||8205===e||8255===e||8256===e||8204===e||void 0!==e&&(192<=e&&e<=214||216<=e&&e<=246||248<=e&&e<=893||895<=e&&e<=8191||8304<=e&&e<=8591||11264<=e&&e<=12271||12289<=e&&e<=55295||63744<=e&&e<=64975||65008<=e&&e<=65533||e>=65536)}function isNewLine(e){return e===y||e===s||e===T}function isWhitespace(e){return e===B||e===y||e===i||e===s||e===T}function checkIfTwoCodePointsAreAValidEscape(e){return e.source.codePointAt(e.cursor)===L&&!isNewLine(e.source.codePointAt(e.cursor+1))}function checkIfThreeCodePointsWouldStartAnIdentSequence(e,n){return n.source.codePointAt(n.cursor)===C?n.source.codePointAt(n.cursor+1)===C||(!!isIdentStartCodePoint(n.source.codePointAt(n.cursor+1))||n.source.codePointAt(n.cursor+1)===L&&!isNewLine(n.source.codePointAt(n.cursor+2))):!!isIdentStartCodePoint(n.source.codePointAt(n.cursor))||checkIfTwoCodePointsAreAValidEscape(n)}function checkIfThreeCodePointsWouldStartANumber(e){return e.source.codePointAt(e.cursor)===D||e.source.codePointAt(e.cursor)===C?!!isDigitCodePoint(e.source.codePointAt(e.cursor+1))||e.source.codePointAt(e.cursor+1)===P&&isDigitCodePoint(e.source.codePointAt(e.cursor+2)):e.source.codePointAt(e.cursor)===P?isDigitCodePoint(e.source.codePointAt(e.cursor+1)):isDigitCodePoint(e.source.codePointAt(e.cursor))}function checkIfTwoCodePointsStartAComment(e){return e.source.codePointAt(e.cursor)===H&&e.source.codePointAt(e.cursor+1)===t}function checkIfThreeCodePointsWouldStartCDC(e){return e.source.codePointAt(e.cursor)===C&&e.source.codePointAt(e.cursor+1)===C&&e.source.codePointAt(e.cursor+2)===k}var G,X,Y;function consumeComment(n,o){for(o.advanceCodePoint(2);;){const r=o.readCodePoint();if(void 0===r){const t=[exports.TokenType.Comment,o.source.slice(o.representationStart,o.representationEnd+1),o.representationStart,o.representationEnd,void 0];return n.onParseError(new ParseErrorWithToken(e.UnexpectedEOFInComment,o.representationStart,o.representationEnd,["4.3.2. Consume comments","Unexpected EOF"],t)),t}if(r===t&&(void 0!==o.source.codePointAt(o.cursor)&&o.source.codePointAt(o.cursor)===H)){o.advanceCodePoint();break}}return[exports.TokenType.Comment,o.source.slice(o.representationStart,o.representationEnd+1),o.representationStart,o.representationEnd,void 0]}function consumeEscapedCodePoint(n,o){const t=o.readCodePoint();if(void 0===t)return n.onParseError(new ParseError(e.UnexpectedEOFInEscapedCodePoint,o.representationStart,o.representationEnd,["4.3.7. Consume an escaped code point","Unexpected EOF"])),w;if(isHexDigitCodePoint(t)){const e=[t];let n;for(;void 0!==(n=o.source.codePointAt(o.cursor))&&isHexDigitCodePoint(n)&&e.length<6;)e.push(n),o.advanceCodePoint();isWhitespace(o.source.codePointAt(o.cursor))&&o.advanceCodePoint();const s=parseInt(String.fromCodePoint(...e),16);return 0===s?w:void 0!==(r=s)&&r>=55296&&r<=57343||s>g?w:s}var r;return t}function consumeIdentSequence(e,n){const o=[];for(;;){const t=n.source.codePointAt(n.cursor);if(isIdentCodePoint(t))o.push(t),n.advanceCodePoint(+(t>65535)+1);else{if(!checkIfTwoCodePointsAreAValidEscape(n))return o;n.advanceCodePoint(),o.push(consumeEscapedCodePoint(e,n))}}}function consumeHashToken(e,n){n.advanceCodePoint();const o=n.source.codePointAt(n.cursor);if(void 0!==o&&(isIdentCodePoint(o)||checkIfTwoCodePointsAreAValidEscape(n))){let o=exports.HashType.Unrestricted;checkIfThreeCodePointsWouldStartAnIdentSequence(0,n)&&(o=exports.HashType.ID);const t=consumeIdentSequence(e,n);return[exports.TokenType.Hash,n.source.slice(n.representationStart,n.representationEnd+1),n.representationStart,n.representationEnd,{value:String.fromCodePoint(...t),type:o}]}return[exports.TokenType.Delim,"#",n.representationStart,n.representationEnd,{value:"#"}]}function consumeNumber(e,n){let o=exports.NumberType.Integer;for(n.source.codePointAt(n.cursor)!==D&&n.source.codePointAt(n.cursor)!==C||n.advanceCodePoint();isDigitCodePoint(n.source.codePointAt(n.cursor));)n.advanceCodePoint();if(n.source.codePointAt(n.cursor)===P&&isDigitCodePoint(n.source.codePointAt(n.cursor+1)))for(n.advanceCodePoint(2),o=exports.NumberType.Number;isDigitCodePoint(n.source.codePointAt(n.cursor));)n.advanceCodePoint();if(n.source.codePointAt(n.cursor)===x||n.source.codePointAt(n.cursor)===f){if(isDigitCodePoint(n.source.codePointAt(n.cursor+1)))n.advanceCodePoint(2);else{if(n.source.codePointAt(n.cursor+1)!==C&&n.source.codePointAt(n.cursor+1)!==D||!isDigitCodePoint(n.source.codePointAt(n.cursor+2)))return o;n.advanceCodePoint(3)}for(o=exports.NumberType.Number;isDigitCodePoint(n.source.codePointAt(n.cursor));)n.advanceCodePoint()}return o}function consumeNumericToken(e,n){let o;{const e=n.source.codePointAt(n.cursor);e===C?o="-":e===D&&(o="+")}const t=consumeNumber(0,n),r=parseFloat(n.source.slice(n.representationStart,n.representationEnd+1));if(checkIfThreeCodePointsWouldStartAnIdentSequence(0,n)){const s=consumeIdentSequence(e,n);return[exports.TokenType.Dimension,n.source.slice(n.representationStart,n.representationEnd+1),n.representationStart,n.representationEnd,{value:r,signCharacter:o,type:t,unit:String.fromCodePoint(...s)}]}return n.source.codePointAt(n.cursor)===O?(n.advanceCodePoint(),[exports.TokenType.Percentage,n.source.slice(n.representationStart,n.representationEnd+1),n.representationStart,n.representationEnd,{value:r,signCharacter:o}]):[exports.TokenType.Number,n.source.slice(n.representationStart,n.representationEnd+1),n.representationStart,n.representationEnd,{value:r,signCharacter:o,type:t}]}function consumeWhiteSpace(e){for(;isWhitespace(e.source.codePointAt(e.cursor));)e.advanceCodePoint();return[exports.TokenType.Whitespace,e.source.slice(e.representationStart,e.representationEnd+1),e.representationStart,e.representationEnd,void 0]}exports.TokenType=void 0,(G=exports.TokenType||(exports.TokenType={})).Comment="comment",G.AtKeyword="at-keyword-token",G.BadString="bad-string-token",G.BadURL="bad-url-token",G.CDC="CDC-token",G.CDO="CDO-token",G.Colon="colon-token",G.Comma="comma-token",G.Delim="delim-token",G.Dimension="dimension-token",G.EOF="EOF-token",G.Function="function-token",G.Hash="hash-token",G.Ident="ident-token",G.Number="number-token",G.Percentage="percentage-token",G.Semicolon="semicolon-token",G.String="string-token",G.URL="url-token",G.Whitespace="whitespace-token",G.OpenParen="(-token",G.CloseParen=")-token",G.OpenSquare="[-token",G.CloseSquare="]-token",G.OpenCurly="{-token",G.CloseCurly="}-token",G.UnicodeRange="unicode-range-token",exports.NumberType=void 0,(X=exports.NumberType||(exports.NumberType={})).Integer="integer",X.Number="number",exports.HashType=void 0,(Y=exports.HashType||(exports.HashType={})).Unrestricted="unrestricted",Y.ID="id";class Reader{cursor=0;source="";representationStart=0;representationEnd=-1;constructor(e){this.source=e}advanceCodePoint(e=1){this.cursor=this.cursor+e,this.representationEnd=this.cursor-1}readCodePoint(){const e=this.source.codePointAt(this.cursor);if(void 0!==e)return this.cursor=this.cursor+1,this.representationEnd=this.cursor-1,e}unreadCodePoint(e=1){this.cursor=this.cursor-e,this.representationEnd=this.cursor-1}resetRepresentation(){this.representationStart=this.cursor,this.representationEnd=-1}}function consumeStringToken(n,o){let t="";const r=o.readCodePoint();for(;;){const i=o.readCodePoint();if(void 0===i){const r=[exports.TokenType.String,o.source.slice(o.representationStart,o.representationEnd+1),o.representationStart,o.representationEnd,{value:t}];return n.onParseError(new ParseErrorWithToken(e.UnexpectedEOFInString,o.representationStart,o.representationEnd,["4.3.5. Consume a string token","Unexpected EOF"],r)),r}if(isNewLine(i)){o.unreadCodePoint();const t=[exports.TokenType.BadString,o.source.slice(o.representationStart,o.representationEnd+1),o.representationStart,o.representationEnd,void 0];return n.onParseError(new ParseErrorWithToken(e.UnexpectedNewLineInString,o.representationStart,o.source.codePointAt(o.cursor)===s&&o.source.codePointAt(o.cursor+1)===y?o.representationEnd+2:o.representationEnd+1,["4.3.5. Consume a string token","Unexpected newline"],t)),t}if(i===r)return[exports.TokenType.String,o.source.slice(o.representationStart,o.representationEnd+1),o.representationStart,o.representationEnd,{value:t}];if(i!==L)t+=String.fromCodePoint(i);else{if(void 0===o.source.codePointAt(o.cursor))continue;if(isNewLine(o.source.codePointAt(o.cursor))){o.source.codePointAt(o.cursor)===s&&o.source.codePointAt(o.cursor+1)===y&&o.advanceCodePoint(),o.advanceCodePoint();continue}t+=String.fromCodePoint(consumeEscapedCodePoint(n,o))}}}function checkIfCodePointsMatchURLIdent(e){return!(3!==e.length||e[0]!==V&&e[0]!==z||e[1]!==K&&e[1]!==M||e[2]!==$&&e[2]!==J)}function consumeBadURL(e,n){for(;;){const o=n.source.codePointAt(n.cursor);if(void 0===o)return;if(o===N)return void n.advanceCodePoint();checkIfTwoCodePointsAreAValidEscape(n)?(n.advanceCodePoint(),consumeEscapedCodePoint(e,n)):n.advanceCodePoint()}}function consumeUrlToken(n,t){for(;isWhitespace(t.source.codePointAt(t.cursor));)t.advanceCodePoint();let s="";for(;;){if(void 0===t.source.codePointAt(t.cursor)){const o=[exports.TokenType.URL,t.source.slice(t.representationStart,t.representationEnd+1),t.representationStart,t.representationEnd,{value:s}];return n.onParseError(new ParseErrorWithToken(e.UnexpectedEOFInURL,t.representationStart,t.representationEnd,["4.3.6. Consume a url token","Unexpected EOF"],o)),o}if(t.source.codePointAt(t.cursor)===N)return t.advanceCodePoint(),[exports.TokenType.URL,t.source.slice(t.representationStart,t.representationEnd+1),t.representationStart,t.representationEnd,{value:s}];if(isWhitespace(t.source.codePointAt(t.cursor))){for(t.advanceCodePoint();isWhitespace(t.source.codePointAt(t.cursor));)t.advanceCodePoint();if(void 0===t.source.codePointAt(t.cursor)){const o=[exports.TokenType.URL,t.source.slice(t.representationStart,t.representationEnd+1),t.representationStart,t.representationEnd,{value:s}];return n.onParseError(new ParseErrorWithToken(e.UnexpectedEOFInURL,t.representationStart,t.representationEnd,["4.3.6. Consume a url token","Consume as much whitespace as possible","Unexpected EOF"],o)),o}return t.source.codePointAt(t.cursor)===N?(t.advanceCodePoint(),[exports.TokenType.URL,t.source.slice(t.representationStart,t.representationEnd+1),t.representationStart,t.representationEnd,{value:s}]):(consumeBadURL(n,t),[exports.TokenType.BadURL,t.source.slice(t.representationStart,t.representationEnd+1),t.representationStart,t.representationEnd,void 0])}const c=t.source.codePointAt(t.cursor);if(c===R||c===o||c===m||void 0!==(i=c)&&(i===v||i===d||I<=i&&i<=r||b<=i&&i<=l)){consumeBadURL(n,t);const o=[exports.TokenType.BadURL,t.source.slice(t.representationStart,t.representationEnd+1),t.representationStart,t.representationEnd,void 0];return n.onParseError(new ParseErrorWithToken(e.UnexpectedCharacterInURL,t.representationStart,t.representationEnd,["4.3.6. Consume a url token","Unexpected U+0022 QUOTATION MARK (\"), U+0027 APOSTROPHE ('), U+0028 LEFT PARENTHESIS (() or non-printable code point"],o)),o}if(c===L){if(checkIfTwoCodePointsAreAValidEscape(t)){t.advanceCodePoint(),s+=String.fromCodePoint(consumeEscapedCodePoint(n,t));continue}consumeBadURL(n,t);const o=[exports.TokenType.BadURL,t.source.slice(t.representationStart,t.representationEnd+1),t.representationStart,t.representationEnd,void 0];return n.onParseError(new ParseErrorWithToken(e.InvalidEscapeSequenceInURL,t.representationStart,t.representationEnd,["4.3.6. Consume a url token","U+005C REVERSE SOLIDUS (\\)","The input stream does not start with a valid escape sequence"],o)),o}s+=t.source[t.cursor],t.advanceCodePoint()}var i}function consumeIdentLikeToken(e,n){const t=consumeIdentSequence(e,n);if(n.source.codePointAt(n.cursor)!==m)return[exports.TokenType.Ident,n.source.slice(n.representationStart,n.representationEnd+1),n.representationStart,n.representationEnd,{value:String.fromCodePoint(...t)}];if(checkIfCodePointsMatchURLIdent(t)){n.advanceCodePoint();let r=0;for(;;){const e=isWhitespace(n.source.codePointAt(n.cursor)),s=isWhitespace(n.source.codePointAt(n.cursor+1));if(e&&s){r+=1,n.advanceCodePoint(1);continue}const i=e?n.source.codePointAt(n.cursor+1):n.source.codePointAt(n.cursor);if(i===R||i===o)return r>0&&n.unreadCodePoint(r),[exports.TokenType.Function,n.source.slice(n.representationStart,n.representationEnd+1),n.representationStart,n.representationEnd,{value:String.fromCodePoint(...t)}];break}return consumeUrlToken(e,n)}return n.advanceCodePoint(),[exports.TokenType.Function,n.source.slice(n.representationStart,n.representationEnd+1),n.representationStart,n.representationEnd,{value:String.fromCodePoint(...t)}]}function checkIfThreeCodePointsWouldStartAUnicodeRange(e){return!(e.source.codePointAt(e.cursor)!==V&&e.source.codePointAt(e.cursor)!==z||e.source.codePointAt(e.cursor+1)!==D||e.source.codePointAt(e.cursor+2)!==_&&!isHexDigitCodePoint(e.source.codePointAt(e.cursor+2)))}function consumeUnicodeRangeToken(e,n){n.advanceCodePoint(2);const o=[],t=[];let r;for(;void 0!==(r=n.source.codePointAt(n.cursor))&&o.length<6&&isHexDigitCodePoint(r);)o.push(r),n.advanceCodePoint();for(;void 0!==(r=n.source.codePointAt(n.cursor))&&o.length<6&&r===_;)0===t.length&&t.push(...o),o.push(j),t.push(Q),n.advanceCodePoint();if(!t.length&&n.source.codePointAt(n.cursor)===C&&isHexDigitCodePoint(n.source.codePointAt(n.cursor+1)))for(n.advanceCodePoint();void 0!==(r=n.source.codePointAt(n.cursor))&&t.length<6&&isHexDigitCodePoint(r);)t.push(r),n.advanceCodePoint();if(!t.length){const e=parseInt(String.fromCodePoint(...o),16);return[exports.TokenType.UnicodeRange,n.source.slice(n.representationStart,n.representationEnd+1),n.representationStart,n.representationEnd,{startOfRange:e,endOfRange:e}]}const s=parseInt(String.fromCodePoint(...o),16),i=parseInt(String.fromCodePoint(...t),16);return[exports.TokenType.UnicodeRange,n.source.slice(n.representationStart,n.representationEnd+1),n.representationStart,n.representationEnd,{startOfRange:s,endOfRange:i}]}function tokenizer(n,t){const r=n.css.valueOf(),d=n.unicodeRangesAllowed??!1,p=new Reader(r),k={onParseError:t?.onParseError??noop};return{nextToken:function nextToken(){p.resetRepresentation();const n=p.source.codePointAt(p.cursor);if(void 0===n)return[exports.TokenType.EOF,"",-1,-1,void 0];if(n===H&&checkIfTwoCodePointsStartAComment(p))return consumeComment(k,p);if(d&&(n===V||n===z)&&checkIfThreeCodePointsWouldStartAUnicodeRange(p))return consumeUnicodeRangeToken(0,p);if(isIdentStartCodePoint(n))return consumeIdentLikeToken(k,p);if(isDigitCodePoint(n))return consumeNumericToken(k,p);switch(n){case a:return p.advanceCodePoint(),[exports.TokenType.Comma,",",p.representationStart,p.representationEnd,void 0];case c:return p.advanceCodePoint(),[exports.TokenType.Colon,":",p.representationStart,p.representationEnd,void 0];case q:return p.advanceCodePoint(),[exports.TokenType.Semicolon,";",p.representationStart,p.representationEnd,void 0];case m:return p.advanceCodePoint(),[exports.TokenType.OpenParen,"(",p.representationStart,p.representationEnd,void 0];case N:return p.advanceCodePoint(),[exports.TokenType.CloseParen,")",p.representationStart,p.representationEnd,void 0];case E:return p.advanceCodePoint(),[exports.TokenType.OpenSquare,"[",p.representationStart,p.representationEnd,void 0];case F:return p.advanceCodePoint(),[exports.TokenType.CloseSquare,"]",p.representationStart,p.representationEnd,void 0];case S:return p.advanceCodePoint(),[exports.TokenType.OpenCurly,"{",p.representationStart,p.representationEnd,void 0];case W:return p.advanceCodePoint(),[exports.TokenType.CloseCurly,"}",p.representationStart,p.representationEnd,void 0];case o:case R:return consumeStringToken(k,p);case U:return consumeHashToken(k,p);case D:case P:return checkIfThreeCodePointsWouldStartANumber(p)?consumeNumericToken(k,p):(p.advanceCodePoint(),[exports.TokenType.Delim,p.source[p.representationStart],p.representationStart,p.representationEnd,{value:p.source[p.representationStart]}]);case y:case s:case T:case i:case B:return consumeWhiteSpace(p);case C:return checkIfThreeCodePointsWouldStartANumber(p)?consumeNumericToken(k,p):checkIfThreeCodePointsWouldStartCDC(p)?(p.advanceCodePoint(3),[exports.TokenType.CDC,"--\x3e",p.representationStart,p.representationEnd,void 0]):checkIfThreeCodePointsWouldStartAnIdentSequence(0,p)?consumeIdentLikeToken(k,p):(p.advanceCodePoint(),[exports.TokenType.Delim,"-",p.representationStart,p.representationEnd,{value:"-"}]);case h:return checkIfFourCodePointsWouldStartCDO(p)?(p.advanceCodePoint(4),[exports.TokenType.CDO,"\x3c!--",p.representationStart,p.representationEnd,void 0]):(p.advanceCodePoint(),[exports.TokenType.Delim,"<",p.representationStart,p.representationEnd,{value:"<"}]);case u:if(p.advanceCodePoint(),checkIfThreeCodePointsWouldStartAnIdentSequence(0,p)){const e=consumeIdentSequence(k,p);return[exports.TokenType.AtKeyword,p.source.slice(p.representationStart,p.representationEnd+1),p.representationStart,p.representationEnd,{value:String.fromCodePoint(...e)}]}return[exports.TokenType.Delim,"@",p.representationStart,p.representationEnd,{value:"@"}];case L:{if(checkIfTwoCodePointsAreAValidEscape(p))return consumeIdentLikeToken(k,p);p.advanceCodePoint();const n=[exports.TokenType.Delim,"\\",p.representationStart,p.representationEnd,{value:"\\"}];return k.onParseError(new ParseErrorWithToken(e.InvalidEscapeSequenceAfterBackslash,p.representationStart,p.representationEnd,["4.3.1. Consume a token","U+005C REVERSE SOLIDUS (\\)","The input stream does not start with a valid escape sequence"],n)),n}}return p.advanceCodePoint(),[exports.TokenType.Delim,p.source[p.representationStart],p.representationStart,p.representationEnd,{value:p.source[p.representationStart]}]},endOfFile:function endOfFile(){return void 0===p.source.codePointAt(p.cursor)}}}function noop(){}function ensureThatValueRoundTripsAsIdent(e){let n=0;e[0]===C&&e[1]===C?n=2:e[0]===C&&e[1]?(n=2,isIdentStartCodePoint(e[1])||(n+=insertEscapedCodePoint(e,1,e[1]))):isIdentStartCodePoint(e[0])?n=1:(n=1,n+=insertEscapedCodePoint(e,0,e[0]));for(let o=n;o<4)&&(!!Z.includes(e[0])&&("string"==typeof e[1]&&("number"==typeof e[2]&&"number"==typeof e[3]))))},exports.isTokenAtKeyword=function isTokenAtKeyword(e){return!!e&&e[0]===exports.TokenType.AtKeyword},exports.isTokenBadString=function isTokenBadString(e){return!!e&&e[0]===exports.TokenType.BadString},exports.isTokenBadURL=function isTokenBadURL(e){return!!e&&e[0]===exports.TokenType.BadURL},exports.isTokenCDC=function isTokenCDC(e){return!!e&&e[0]===exports.TokenType.CDC},exports.isTokenCDO=function isTokenCDO(e){return!!e&&e[0]===exports.TokenType.CDO},exports.isTokenCloseCurly=function isTokenCloseCurly(e){return!!e&&e[0]===exports.TokenType.CloseCurly},exports.isTokenCloseParen=function isTokenCloseParen(e){return!!e&&e[0]===exports.TokenType.CloseParen},exports.isTokenCloseSquare=function isTokenCloseSquare(e){return!!e&&e[0]===exports.TokenType.CloseSquare},exports.isTokenColon=function isTokenColon(e){return!!e&&e[0]===exports.TokenType.Colon},exports.isTokenComma=function isTokenComma(e){return!!e&&e[0]===exports.TokenType.Comma},exports.isTokenComment=function isTokenComment(e){return!!e&&e[0]===exports.TokenType.Comment},exports.isTokenDelim=function isTokenDelim(e){return!!e&&e[0]===exports.TokenType.Delim},exports.isTokenDimension=function isTokenDimension(e){return!!e&&e[0]===exports.TokenType.Dimension},exports.isTokenEOF=function isTokenEOF(e){return!!e&&e[0]===exports.TokenType.EOF},exports.isTokenFunction=function isTokenFunction(e){return!!e&&e[0]===exports.TokenType.Function},exports.isTokenHash=function isTokenHash(e){return!!e&&e[0]===exports.TokenType.Hash},exports.isTokenIdent=function isTokenIdent(e){return!!e&&e[0]===exports.TokenType.Ident},exports.isTokenNumber=function isTokenNumber(e){return!!e&&e[0]===exports.TokenType.Number},exports.isTokenNumeric=function isTokenNumeric(e){switch(e[0]){case exports.TokenType.Dimension:case exports.TokenType.Number:case exports.TokenType.Percentage:return!0;default:return!1}},exports.isTokenOpenCurly=function isTokenOpenCurly(e){return!!e&&e[0]===exports.TokenType.OpenCurly},exports.isTokenOpenParen=function isTokenOpenParen(e){return!!e&&e[0]===exports.TokenType.OpenParen},exports.isTokenOpenSquare=function isTokenOpenSquare(e){return!!e&&e[0]===exports.TokenType.OpenSquare},exports.isTokenPercentage=function isTokenPercentage(e){return!!e&&e[0]===exports.TokenType.Percentage},exports.isTokenSemicolon=function isTokenSemicolon(e){return!!e&&e[0]===exports.TokenType.Semicolon},exports.isTokenString=function isTokenString(e){return!!e&&e[0]===exports.TokenType.String},exports.isTokenURL=function isTokenURL(e){return!!e&&e[0]===exports.TokenType.URL},exports.isTokenUnicodeRange=function isTokenUnicodeRange(e){return!!e&&e[0]===exports.TokenType.UnicodeRange},exports.isTokenWhiteSpaceOrComment=function isTokenWhiteSpaceOrComment(e){switch(e[0]){case exports.TokenType.Whitespace:case exports.TokenType.Comment:return!0;default:return!1}},exports.isTokenWhitespace=function isTokenWhitespace(e){return!!e&&e[0]===exports.TokenType.Whitespace},exports.mirrorVariant=function mirrorVariant(e){switch(e[0]){case exports.TokenType.OpenParen:return[exports.TokenType.CloseParen,")",-1,-1,void 0];case exports.TokenType.CloseParen:return[exports.TokenType.OpenParen,"(",-1,-1,void 0];case exports.TokenType.OpenCurly:return[exports.TokenType.CloseCurly,"}",-1,-1,void 0];case exports.TokenType.CloseCurly:return[exports.TokenType.OpenCurly,"{",-1,-1,void 0];case exports.TokenType.OpenSquare:return[exports.TokenType.CloseSquare,"]",-1,-1,void 0];case exports.TokenType.CloseSquare:return[exports.TokenType.OpenSquare,"[",-1,-1,void 0];default:return null}},exports.mirrorVariantType=function mirrorVariantType(e){switch(e){case exports.TokenType.OpenParen:return exports.TokenType.CloseParen;case exports.TokenType.CloseParen:return exports.TokenType.OpenParen;case exports.TokenType.OpenCurly:return exports.TokenType.CloseCurly;case exports.TokenType.CloseCurly:return exports.TokenType.OpenCurly;case exports.TokenType.OpenSquare:return exports.TokenType.CloseSquare;case exports.TokenType.CloseSquare:return exports.TokenType.OpenSquare;default:return null}},exports.mutateIdent=function mutateIdent(e,n){const o=[];for(const e of n)o.push(e.codePointAt(0));const t=String.fromCodePoint(...ensureThatValueRoundTripsAsIdent(o));e[1]=t,e[4].value=n},exports.mutateUnit=function mutateUnit(e,n){const o=[];for(const e of n)o.push(e.codePointAt(0));const t=ensureThatValueRoundTripsAsIdent(o);101===t[0]&&insertEscapedCodePoint(t,0,t[0]);const r=String.fromCodePoint(...t),s="+"===e[4].signCharacter?e[4].signCharacter:"",i=e[4].value.toString();e[1]=`${s}${i}${r}`,e[4].unit=n},exports.stringify=function stringify(...e){let n="";for(let o=0;o): Array;
-/**
- * @internal
- */
-export declare type CodePointReader = {
- representationStart: number;
- representationEnd: number;
- cursor: number;
- codePointSource: Array;
- representationIndices: Array;
- source: string;
- advanceCodePoint(n?: number): void;
- readCodePoint(n?: number): number | false;
- unreadCodePoint(n?: number): void;
- resetRepresentation(): void;
-};
-
/**
* The union of all possible CSS tokens
*/
@@ -232,24 +216,6 @@ export declare class ParseErrorWithToken extends ParseError {
constructor(message: string, sourceStart: number, sourceEnd: number, parserState: Array, token: CSSToken);
}
-/**
- * @internal
- */
-export declare class Reader implements CodePointReader {
- cursor: number;
- source: string;
- codePointSource: Array;
- representationIndices: Array;
- length: number;
- representationStart: number;
- representationEnd: number;
- constructor(source: string);
- advanceCodePoint(n?: number): void;
- readCodePoint(n?: number): number | false;
- unreadCodePoint(n?: number): void;
- resetRepresentation(): void;
-}
-
/**
* Concatenate the string representation of a list of tokens.
* This is not a proper serializer that will handle escaping and whitespace.
diff --git a/packages/css-tokenizer/dist/index.mjs b/packages/css-tokenizer/dist/index.mjs
index 546539f48..ef13d8640 100644
--- a/packages/css-tokenizer/dist/index.mjs
+++ b/packages/css-tokenizer/dist/index.mjs
@@ -1 +1 @@
-class ParseError extends Error{sourceStart;sourceEnd;parserState;constructor(e,n,o,t){super(e),this.name="ParseError",this.sourceStart=n,this.sourceEnd=o,this.parserState=t}}class ParseErrorWithToken extends ParseError{token;constructor(e,n,o,t,r){super(e,n,o,t),this.token=r}}const e={UnexpectedNewLineInString:"Unexpected newline while consuming a string token.",UnexpectedEOFInString:"Unexpected EOF while consuming a string token.",UnexpectedEOFInComment:"Unexpected EOF while consuming a comment.",UnexpectedEOFInURL:"Unexpected EOF while consuming a url token.",UnexpectedEOFInEscapedCodePoint:"Unexpected EOF while consuming an escaped code point.",UnexpectedCharacterInURL:"Unexpected character while consuming a url token.",InvalidEscapeSequenceInURL:"Invalid escape sequence while consuming a url token.",InvalidEscapeSequenceAfterBackslash:'Invalid escape sequence after "\\"'};class Reader{cursor=0;source="";codePointSource=[];representationIndices=[-1];length=0;representationStart=0;representationEnd=-1;constructor(e){this.source=e;{let n=-1,o="";for(o of e)n+=o.length,this.codePointSource.push(o.codePointAt(0)),this.representationIndices.push(n)}this.length=this.codePointSource.length}advanceCodePoint(e=1){this.cursor=this.cursor+e,this.representationEnd=this.representationIndices[this.cursor]}readCodePoint(e=1){const n=this.codePointSource[this.cursor];return void 0!==n&&(this.cursor=this.cursor+e,this.representationEnd=this.representationIndices[this.cursor],n)}unreadCodePoint(e=1){this.cursor=this.cursor-e,this.representationEnd=this.representationIndices[this.cursor]}resetRepresentation(){this.representationStart=this.representationIndices[this.cursor]+1,this.representationEnd=-1}}const n="undefined"!=typeof globalThis&&"structuredClone"in globalThis;function cloneTokens(e){return n?structuredClone(e):JSON.parse(JSON.stringify(e))}function stringify(...e){let n="";for(let o=0;o=48&&e<=57}function isUppercaseLetterCodePoint(e){return e>=65&&e<=90}function isLowercaseLetterCodePoint(e){return e>=97&&e<=122}function isHexDigitCodePoint(e){return isDigitCodePoint(e)||e>=97&&e<=102||e>=65&&e<=70}function isLetterCodePoint(e){return isLowercaseLetterCodePoint(e)||isUppercaseLetterCodePoint(e)}function isIdentStartCodePoint(e){return isLetterCodePoint(e)||isNonASCII_IdentCodePoint(e)||e===U}function isIdentCodePoint(e){return isIdentStartCodePoint(e)||isDigitCodePoint(e)||e===l}function isNonASCII_IdentCodePoint(e){return 183===e||8204===e||8205===e||8255===e||8256===e||8204===e||(192<=e&&e<=214||216<=e&&e<=246||248<=e&&e<=893||895<=e&&e<=8191||8304<=e&&e<=8591||11264<=e&&e<=12271||12289<=e&&e<=55295||63744<=e&&e<=64975||65008<=e&&e<=65533||e>=65536)}function isNewLine(e){return e===g||e===i||e===P}function isWhitespace(e){return e===H||e===g||e===s||e===i||e===P}function checkIfTwoCodePointsAreAValidEscape(e){return e.codePointSource[e.cursor]===W&&!isNewLine(e.codePointSource[e.cursor+1])}function checkIfThreeCodePointsWouldStartAnIdentSequence(e,n){return n.codePointSource[n.cursor]===l?n.codePointSource[n.cursor+1]===l||(!!isIdentStartCodePoint(n.codePointSource[n.cursor+1])||n.codePointSource[n.cursor+1]===W&&!isNewLine(n.codePointSource[n.cursor+2])):!!isIdentStartCodePoint(n.codePointSource[n.cursor])||checkIfTwoCodePointsAreAValidEscape(n)}function checkIfThreeCodePointsWouldStartANumber(e){return e.codePointSource[e.cursor]===L||e.codePointSource[e.cursor]===l?!!isDigitCodePoint(e.codePointSource[e.cursor+1])||e.codePointSource[e.cursor+1]===S&&isDigitCodePoint(e.codePointSource[e.cursor+2]):e.codePointSource[e.cursor]===S?isDigitCodePoint(e.codePointSource[e.cursor+1]):isDigitCodePoint(e.codePointSource[e.cursor])}function checkIfTwoCodePointsStartAComment(e){return e.codePointSource[e.cursor]===B&&e.codePointSource[e.cursor+1]===t}function checkIfThreeCodePointsWouldStartCDC(e){return e.codePointSource[e.cursor]===l&&e.codePointSource[e.cursor+1]===l&&e.codePointSource[e.cursor+2]===C}var G,X,Y;function mirrorVariantType(e){switch(e){case G.OpenParen:return G.CloseParen;case G.CloseParen:return G.OpenParen;case G.OpenCurly:return G.CloseCurly;case G.CloseCurly:return G.OpenCurly;case G.OpenSquare:return G.CloseSquare;case G.CloseSquare:return G.OpenSquare;default:return null}}function mirrorVariant(e){switch(e[0]){case G.OpenParen:return[G.CloseParen,")",-1,-1,void 0];case G.CloseParen:return[G.OpenParen,"(",-1,-1,void 0];case G.OpenCurly:return[G.CloseCurly,"}",-1,-1,void 0];case G.CloseCurly:return[G.OpenCurly,"{",-1,-1,void 0];case G.OpenSquare:return[G.CloseSquare,"]",-1,-1,void 0];case G.CloseSquare:return[G.OpenSquare,"[",-1,-1,void 0];default:return null}}function consumeComment(n,o){for(o.advanceCodePoint(2);;){const r=o.readCodePoint();if(!1===r){const t=[G.Comment,o.source.slice(o.representationStart,o.representationEnd+1),o.representationStart,o.representationEnd,void 0];return n.onParseError(new ParseErrorWithToken(e.UnexpectedEOFInComment,o.representationStart,o.representationEnd,["4.3.2. Consume comments","Unexpected EOF"],t)),t}if(r===t&&(void 0!==o.codePointSource[o.cursor]&&o.codePointSource[o.cursor]===B)){o.advanceCodePoint();break}}return[G.Comment,o.source.slice(o.representationStart,o.representationEnd+1),o.representationStart,o.representationEnd,void 0]}function consumeEscapedCodePoint(n,o){const t=o.readCodePoint();if(!1===t)return n.onParseError(new ParseError(e.UnexpectedEOFInEscapedCodePoint,o.representationStart,o.representationEnd,["4.3.7. Consume an escaped code point","Unexpected EOF"])),x;if(isHexDigitCodePoint(t)){const e=[t];for(;void 0!==o.codePointSource[o.cursor]&&isHexDigitCodePoint(o.codePointSource[o.cursor])&&e.length<6;)e.push(o.codePointSource[o.cursor]),o.advanceCodePoint();isWhitespace(o.codePointSource[o.cursor])&&o.advanceCodePoint();const n=parseInt(String.fromCodePoint(...e),16);return 0===n?x:(r=n)>=55296&&r<=57343||n>O?x:n}var r;return t}function consumeIdentSequence(e,n){const o=[];for(;;)if(isIdentCodePoint(n.codePointSource[n.cursor]))o.push(n.codePointSource[n.cursor]),n.advanceCodePoint();else{if(!checkIfTwoCodePointsAreAValidEscape(n))return o;n.advanceCodePoint(),o.push(consumeEscapedCodePoint(e,n))}}function consumeHashToken(e,n){if(n.advanceCodePoint(),void 0!==n.codePointSource[n.cursor]&&(isIdentCodePoint(n.codePointSource[n.cursor])||checkIfTwoCodePointsAreAValidEscape(n))){let o=Y.Unrestricted;checkIfThreeCodePointsWouldStartAnIdentSequence(0,n)&&(o=Y.ID);const t=consumeIdentSequence(e,n);return[G.Hash,n.source.slice(n.representationStart,n.representationEnd+1),n.representationStart,n.representationEnd,{value:String.fromCodePoint(...t),type:o}]}return[G.Delim,"#",n.representationStart,n.representationEnd,{value:"#"}]}function consumeNumber(e,n){let o=X.Integer;for(n.codePointSource[n.cursor]!==L&&n.codePointSource[n.cursor]!==l||n.advanceCodePoint();isDigitCodePoint(n.codePointSource[n.cursor]);)n.advanceCodePoint();if(n.codePointSource[n.cursor]===S&&isDigitCodePoint(n.codePointSource[n.cursor+1]))for(n.advanceCodePoint(2),o=X.Number;isDigitCodePoint(n.codePointSource[n.cursor]);)n.advanceCodePoint();if(n.codePointSource[n.cursor]===h||n.codePointSource[n.cursor]===m){if(isDigitCodePoint(n.codePointSource[n.cursor+1]))n.advanceCodePoint(2);else{if(n.codePointSource[n.cursor+1]!==l&&n.codePointSource[n.cursor+1]!==L||!isDigitCodePoint(n.codePointSource[n.cursor+2]))return o;n.advanceCodePoint(3)}for(o=X.Number;isDigitCodePoint(n.codePointSource[n.cursor]);)n.advanceCodePoint()}return o}function consumeNumericToken(e,n){let o;{const e=n.codePointSource[n.cursor];e===l?o="-":e===L&&(o="+")}const t=consumeNumber(0,n),r=parseFloat(n.source.slice(n.representationStart,n.representationEnd+1));if(checkIfThreeCodePointsWouldStartAnIdentSequence(0,n)){const i=consumeIdentSequence(e,n);return[G.Dimension,n.source.slice(n.representationStart,n.representationEnd+1),n.representationStart,n.representationEnd,{value:r,signCharacter:o,type:t,unit:String.fromCodePoint(...i)}]}return n.codePointSource[n.cursor]===w?(n.advanceCodePoint(),[G.Percentage,n.source.slice(n.representationStart,n.representationEnd+1),n.representationStart,n.representationEnd,{value:r,signCharacter:o}]):[G.Number,n.source.slice(n.representationStart,n.representationEnd+1),n.representationStart,n.representationEnd,{value:r,signCharacter:o,type:t}]}function consumeWhiteSpace(e){for(;isWhitespace(e.codePointSource[e.cursor]);)e.advanceCodePoint();return[G.Whitespace,e.source.slice(e.representationStart,e.representationEnd+1),e.representationStart,e.representationEnd,void 0]}function consumeStringToken(n,o){let t="";const r=o.readCodePoint();for(;;){const s=o.readCodePoint();if(!1===s){const r=[G.String,o.source.slice(o.representationStart,o.representationEnd+1),o.representationStart,o.representationEnd,{value:t}];return n.onParseError(new ParseErrorWithToken(e.UnexpectedEOFInString,o.representationStart,o.representationEnd,["4.3.5. Consume a string token","Unexpected EOF"],r)),r}if(isNewLine(s)){o.unreadCodePoint();const t=[G.BadString,o.source.slice(o.representationStart,o.representationEnd+1),o.representationStart,o.representationEnd,void 0];return n.onParseError(new ParseErrorWithToken(e.UnexpectedNewLineInString,o.representationStart,o.codePointSource[o.cursor]===i&&o.codePointSource[o.cursor+1]===g?o.representationEnd+2:o.representationEnd+1,["4.3.5. Consume a string token","Unexpected newline"],t)),t}if(s===r)return[G.String,o.source.slice(o.representationStart,o.representationEnd+1),o.representationStart,o.representationEnd,{value:t}];if(s!==W)t+=String.fromCodePoint(s);else{if(void 0===o.codePointSource[o.cursor])continue;if(isNewLine(o.codePointSource[o.cursor])){o.codePointSource[o.cursor]===i&&o.codePointSource[o.cursor+1]===g&&o.advanceCodePoint(),o.advanceCodePoint();continue}t+=String.fromCodePoint(consumeEscapedCodePoint(n,o))}}}function checkIfCodePointsMatchURLIdent(e){return!(3!==e.length||e[0]!==V&&e[0]!==K||e[1]!==z&&e[1]!==M||e[2]!==$&&e[2]!==J)}function consumeBadURL(e,n){for(;;){if(void 0===n.codePointSource[n.cursor])return;if(n.codePointSource[n.cursor]===F)return void n.advanceCodePoint();checkIfTwoCodePointsAreAValidEscape(n)?(n.advanceCodePoint(),consumeEscapedCodePoint(e,n)):n.advanceCodePoint()}}function consumeUrlToken(n,t){for(;isWhitespace(t.codePointSource[t.cursor]);)t.advanceCodePoint();let i="";for(;;){if(void 0===t.codePointSource[t.cursor]){const o=[G.URL,t.source.slice(t.representationStart,t.representationEnd+1),t.representationStart,t.representationEnd,{value:i}];return n.onParseError(new ParseErrorWithToken(e.UnexpectedEOFInURL,t.representationStart,t.representationEnd,["4.3.6. Consume a url token","Unexpected EOF"],o)),o}if(t.codePointSource[t.cursor]===F)return t.advanceCodePoint(),[G.URL,t.source.slice(t.representationStart,t.representationEnd+1),t.representationStart,t.representationEnd,{value:i}];if(isWhitespace(t.codePointSource[t.cursor])){for(t.advanceCodePoint();isWhitespace(t.codePointSource[t.cursor]);)t.advanceCodePoint();if(void 0===t.codePointSource[t.cursor]){const o=[G.URL,t.source.slice(t.representationStart,t.representationEnd+1),t.representationStart,t.representationEnd,{value:i}];return n.onParseError(new ParseErrorWithToken(e.UnexpectedEOFInURL,t.representationStart,t.representationEnd,["4.3.6. Consume a url token","Consume as much whitespace as possible","Unexpected EOF"],o)),o}return t.codePointSource[t.cursor]===F?(t.advanceCodePoint(),[G.URL,t.source.slice(t.representationStart,t.representationEnd+1),t.representationStart,t.representationEnd,{value:i}]):(consumeBadURL(n,t),[G.BadURL,t.source.slice(t.representationStart,t.representationEnd+1),t.representationStart,t.representationEnd,void 0])}if(t.codePointSource[t.cursor]===A||t.codePointSource[t.cursor]===o||t.codePointSource[t.cursor]===E||((s=t.codePointSource[t.cursor])===I||s===d||D<=s&&s<=r||b<=s&&s<=f)){consumeBadURL(n,t);const o=[G.BadURL,t.source.slice(t.representationStart,t.representationEnd+1),t.representationStart,t.representationEnd,void 0];return n.onParseError(new ParseErrorWithToken(e.UnexpectedCharacterInURL,t.representationStart,t.representationEnd,["4.3.6. Consume a url token","Unexpected U+0022 QUOTATION MARK (\"), U+0027 APOSTROPHE ('), U+0028 LEFT PARENTHESIS (() or non-printable code point"],o)),o}if(t.codePointSource[t.cursor]===W){if(checkIfTwoCodePointsAreAValidEscape(t)){t.advanceCodePoint(),i+=String.fromCodePoint(consumeEscapedCodePoint(n,t));continue}consumeBadURL(n,t);const o=[G.BadURL,t.source.slice(t.representationStart,t.representationEnd+1),t.representationStart,t.representationEnd,void 0];return n.onParseError(new ParseErrorWithToken(e.InvalidEscapeSequenceInURL,t.representationStart,t.representationEnd,["4.3.6. Consume a url token","U+005C REVERSE SOLIDUS (\\)","The input stream does not start with a valid escape sequence"],o)),o}i+=String.fromCodePoint(t.codePointSource[t.cursor]),t.advanceCodePoint()}var s}function consumeIdentLikeToken(e,n){const t=consumeIdentSequence(e,n);if(n.codePointSource[n.cursor]!==E)return[G.Ident,n.source.slice(n.representationStart,n.representationEnd+1),n.representationStart,n.representationEnd,{value:String.fromCodePoint(...t)}];if(checkIfCodePointsMatchURLIdent(t)){n.advanceCodePoint();let r=0;for(;;){const e=isWhitespace(n.codePointSource[n.cursor]),i=isWhitespace(n.codePointSource[n.cursor+1]);if(e&&i){r+=1,n.advanceCodePoint(1);continue}const s=e?n.codePointSource[n.cursor+1]:n.codePointSource[n.cursor];if(s===A||s===o)return r>0&&n.unreadCodePoint(r),[G.Function,n.source.slice(n.representationStart,n.representationEnd+1),n.representationStart,n.representationEnd,{value:String.fromCodePoint(...t)}];break}return consumeUrlToken(e,n)}return n.advanceCodePoint(),[G.Function,n.source.slice(n.representationStart,n.representationEnd+1),n.representationStart,n.representationEnd,{value:String.fromCodePoint(...t)}]}function checkIfThreeCodePointsWouldStartAUnicodeRange(e){return!(e.codePointSource[e.cursor]!==V&&e.codePointSource[e.cursor]!==K||e.codePointSource[e.cursor+1]!==L||e.codePointSource[e.cursor+2]!==_&&!isHexDigitCodePoint(e.codePointSource[e.cursor+2]))}function consumeUnicodeRangeToken(e,n){n.advanceCodePoint(2);const o=[],t=[];for(;void 0!==n.codePointSource[n.cursor]&&o.length<6&&isHexDigitCodePoint(n.codePointSource[n.cursor]);)o.push(n.codePointSource[n.cursor]),n.advanceCodePoint();for(;void 0!==n.codePointSource[n.cursor]&&o.length<6&&n.codePointSource[n.cursor]===_;)0===t.length&&t.push(...o),o.push(j),t.push(Q),n.advanceCodePoint();if(!t.length&&n.codePointSource[n.cursor]===l&&isHexDigitCodePoint(n.codePointSource[n.cursor+1]))for(n.advanceCodePoint();void 0!==n.codePointSource[n.cursor]&&t.length<6&&isHexDigitCodePoint(n.codePointSource[n.cursor]);)t.push(n.codePointSource[n.cursor]),n.advanceCodePoint();if(!t.length){const e=parseInt(String.fromCodePoint(...o),16);return[G.UnicodeRange,n.source.slice(n.representationStart,n.representationEnd+1),n.representationStart,n.representationEnd,{startOfRange:e,endOfRange:e}]}const r=parseInt(String.fromCodePoint(...o),16),i=parseInt(String.fromCodePoint(...t),16);return[G.UnicodeRange,n.source.slice(n.representationStart,n.representationEnd+1),n.representationStart,n.representationEnd,{startOfRange:r,endOfRange:i}]}function tokenize(e,n){const o=tokenizer(e,n),t=[];{for(;!o.endOfFile();){const e=o.nextToken();e&&t.push(e)}const e=o.nextToken();e&&t.push(e)}return t}function tokenizer(n,t){const r=n.css.valueOf(),d=n.unicodeRangesAllowed??!1,p=new Reader(r),C={onParseError:t?.onParseError??noop};return{nextToken:function nextToken(){p.resetRepresentation();const n=p.codePointSource[p.cursor];if(void 0===n)return[G.EOF,"",-1,-1,void 0];if(n===B&&checkIfTwoCodePointsStartAComment(p))return consumeComment(C,p);if(d&&(n===V||n===K)&&checkIfThreeCodePointsWouldStartAUnicodeRange(p))return consumeUnicodeRangeToken(0,p);if(isIdentStartCodePoint(n))return consumeIdentLikeToken(C,p);if(isDigitCodePoint(n))return consumeNumericToken(C,p);switch(n){case a:return p.advanceCodePoint(),[G.Comma,",",p.representationStart,p.representationEnd,void 0];case c:return p.advanceCodePoint(),[G.Colon,":",p.representationStart,p.representationEnd,void 0];case N:return p.advanceCodePoint(),[G.Semicolon,";",p.representationStart,p.representationEnd,void 0];case E:return p.advanceCodePoint(),[G.OpenParen,"(",p.representationStart,p.representationEnd,void 0];case F:return p.advanceCodePoint(),[G.CloseParen,")",p.representationStart,p.representationEnd,void 0];case T:return p.advanceCodePoint(),[G.OpenSquare,"[",p.representationStart,p.representationEnd,void 0];case q:return p.advanceCodePoint(),[G.CloseSquare,"]",p.representationStart,p.representationEnd,void 0];case k:return p.advanceCodePoint(),[G.OpenCurly,"{",p.representationStart,p.representationEnd,void 0];case y:return p.advanceCodePoint(),[G.CloseCurly,"}",p.representationStart,p.representationEnd,void 0];case o:case A:return consumeStringToken(C,p);case R:return consumeHashToken(C,p);case L:case S:return checkIfThreeCodePointsWouldStartANumber(p)?consumeNumericToken(C,p):(p.advanceCodePoint(),[G.Delim,p.source[p.representationStart],p.representationStart,p.representationEnd,{value:p.source[p.representationStart]}]);case g:case i:case P:case s:case H:return consumeWhiteSpace(p);case l:return checkIfThreeCodePointsWouldStartANumber(p)?consumeNumericToken(C,p):checkIfThreeCodePointsWouldStartCDC(p)?(p.advanceCodePoint(3),[G.CDC,"--\x3e",p.representationStart,p.representationEnd,void 0]):checkIfThreeCodePointsWouldStartAnIdentSequence(0,p)?consumeIdentLikeToken(C,p):(p.advanceCodePoint(),[G.Delim,"-",p.representationStart,p.representationEnd,{value:"-"}]);case v:return checkIfFourCodePointsWouldStartCDO(p)?(p.advanceCodePoint(4),[G.CDO,"\x3c!--",p.representationStart,p.representationEnd,void 0]):(p.advanceCodePoint(),[G.Delim,"<",p.representationStart,p.representationEnd,{value:"<"}]);case u:if(p.advanceCodePoint(),checkIfThreeCodePointsWouldStartAnIdentSequence(0,p)){const e=consumeIdentSequence(C,p);return[G.AtKeyword,p.source.slice(p.representationStart,p.representationEnd+1),p.representationStart,p.representationEnd,{value:String.fromCodePoint(...e)}]}return[G.Delim,"@",p.representationStart,p.representationEnd,{value:"@"}];case W:{if(checkIfTwoCodePointsAreAValidEscape(p))return consumeIdentLikeToken(C,p);p.advanceCodePoint();const n=[G.Delim,"\\",p.representationStart,p.representationEnd,{value:"\\"}];return C.onParseError(new ParseErrorWithToken(e.InvalidEscapeSequenceAfterBackslash,p.representationStart,p.representationEnd,["4.3.1. Consume a token","U+005C REVERSE SOLIDUS (\\)","The input stream does not start with a valid escape sequence"],n)),n}}return p.advanceCodePoint(),[G.Delim,p.source[p.representationStart],p.representationStart,p.representationEnd,{value:p.source[p.representationStart]}]},endOfFile:function endOfFile(){return void 0===p.codePointSource[p.cursor]}}}function noop(){}function mutateIdent(e,n){const o=[];for(const e of n)o.push(e.codePointAt(0));const t=String.fromCodePoint(...ensureThatValueRoundTripsAsIdent(o));e[1]=t,e[4].value=n}function mutateUnit(e,n){const o=[];for(const e of n)o.push(e.codePointAt(0));const t=ensureThatValueRoundTripsAsIdent(o);101===t[0]&&insertEscapedCodePoint(t,0,t[0]);const r=String.fromCodePoint(...t),i="+"===e[4].signCharacter?e[4].signCharacter:"",s=e[4].value.toString();e[1]=`${i}${s}${r}`,e[4].unit=n}function ensureThatValueRoundTripsAsIdent(e){let n=0;e[0]===l&&e[1]===l?n=2:e[0]===l&&e[1]?(n=2,isIdentStartCodePoint(e[1])||(n+=insertEscapedCodePoint(e,1,e[1]))):isIdentStartCodePoint(e[0])?n=1:(n=1,n+=insertEscapedCodePoint(e,0,e[0]));for(let o=n;o<4)&&(!!Z.includes(e[0])&&("string"==typeof e[1]&&("number"==typeof e[2]&&"number"==typeof e[3]))))}function isTokenNumeric(e){switch(e[0]){case G.Dimension:case G.Number:case G.Percentage:return!0;default:return!1}}function isTokenWhiteSpaceOrComment(e){switch(e[0]){case G.Whitespace:case G.Comment:return!0;default:return!1}}function isTokenAtKeyword(e){return!!e&&e[0]===G.AtKeyword}function isTokenBadString(e){return!!e&&e[0]===G.BadString}function isTokenBadURL(e){return!!e&&e[0]===G.BadURL}function isTokenCDC(e){return!!e&&e[0]===G.CDC}function isTokenCDO(e){return!!e&&e[0]===G.CDO}function isTokenColon(e){return!!e&&e[0]===G.Colon}function isTokenComma(e){return!!e&&e[0]===G.Comma}function isTokenComment(e){return!!e&&e[0]===G.Comment}function isTokenDelim(e){return!!e&&e[0]===G.Delim}function isTokenDimension(e){return!!e&&e[0]===G.Dimension}function isTokenEOF(e){return!!e&&e[0]===G.EOF}function isTokenFunction(e){return!!e&&e[0]===G.Function}function isTokenHash(e){return!!e&&e[0]===G.Hash}function isTokenIdent(e){return!!e&&e[0]===G.Ident}function isTokenNumber(e){return!!e&&e[0]===G.Number}function isTokenPercentage(e){return!!e&&e[0]===G.Percentage}function isTokenSemicolon(e){return!!e&&e[0]===G.Semicolon}function isTokenString(e){return!!e&&e[0]===G.String}function isTokenURL(e){return!!e&&e[0]===G.URL}function isTokenWhitespace(e){return!!e&&e[0]===G.Whitespace}function isTokenOpenParen(e){return!!e&&e[0]===G.OpenParen}function isTokenCloseParen(e){return!!e&&e[0]===G.CloseParen}function isTokenOpenSquare(e){return!!e&&e[0]===G.OpenSquare}function isTokenCloseSquare(e){return!!e&&e[0]===G.CloseSquare}function isTokenOpenCurly(e){return!!e&&e[0]===G.OpenCurly}function isTokenCloseCurly(e){return!!e&&e[0]===G.CloseCurly}function isTokenUnicodeRange(e){return!!e&&e[0]===G.UnicodeRange}export{Y as HashType,X as NumberType,ParseError,e as ParseErrorMessage,ParseErrorWithToken,Reader,G as TokenType,cloneTokens,isToken,isTokenAtKeyword,isTokenBadString,isTokenBadURL,isTokenCDC,isTokenCDO,isTokenCloseCurly,isTokenCloseParen,isTokenCloseSquare,isTokenColon,isTokenComma,isTokenComment,isTokenDelim,isTokenDimension,isTokenEOF,isTokenFunction,isTokenHash,isTokenIdent,isTokenNumber,isTokenNumeric,isTokenOpenCurly,isTokenOpenParen,isTokenOpenSquare,isTokenPercentage,isTokenSemicolon,isTokenString,isTokenURL,isTokenUnicodeRange,isTokenWhiteSpaceOrComment,isTokenWhitespace,mirrorVariant,mirrorVariantType,mutateIdent,mutateUnit,stringify,tokenize,tokenizer};
+class ParseError extends Error{sourceStart;sourceEnd;parserState;constructor(e,n,t,o){super(e),this.name="ParseError",this.sourceStart=n,this.sourceEnd=t,this.parserState=o}}class ParseErrorWithToken extends ParseError{token;constructor(e,n,t,o,r){super(e,n,t,o),this.token=r}}const e={UnexpectedNewLineInString:"Unexpected newline while consuming a string token.",UnexpectedEOFInString:"Unexpected EOF while consuming a string token.",UnexpectedEOFInComment:"Unexpected EOF while consuming a comment.",UnexpectedEOFInURL:"Unexpected EOF while consuming a url token.",UnexpectedEOFInEscapedCodePoint:"Unexpected EOF while consuming an escaped code point.",UnexpectedCharacterInURL:"Unexpected character while consuming a url token.",InvalidEscapeSequenceInURL:"Invalid escape sequence while consuming a url token.",InvalidEscapeSequenceAfterBackslash:'Invalid escape sequence after "\\"'},n="undefined"!=typeof globalThis&&"structuredClone"in globalThis;function cloneTokens(e){return n?structuredClone(e):JSON.parse(JSON.stringify(e))}function stringify(...e){let n="";for(let t=0;t=48&&e<=57}function isUppercaseLetterCodePoint(e){return void 0!==e&&e>=65&&e<=90}function isLowercaseLetterCodePoint(e){return void 0!==e&&e>=97&&e<=122}function isHexDigitCodePoint(e){return void 0!==e&&(e>=48&&e<=57||e>=97&&e<=102||e>=65&&e<=70)}function isLetterCodePoint(e){return isLowercaseLetterCodePoint(e)||isUppercaseLetterCodePoint(e)}function isIdentStartCodePoint(e){return isLetterCodePoint(e)||isNonASCII_IdentCodePoint(e)||e===I}function isIdentCodePoint(e){return isIdentStartCodePoint(e)||isDigitCodePoint(e)||e===f}function isNonASCII_IdentCodePoint(e){return 183===e||8204===e||8205===e||8255===e||8256===e||8204===e||void 0!==e&&(192<=e&&e<=214||216<=e&&e<=246||248<=e&&e<=893||895<=e&&e<=8191||8304<=e&&e<=8591||11264<=e&&e<=12271||12289<=e&&e<=55295||63744<=e&&e<=64975||65008<=e&&e<=65533||e>=65536)}function isNewLine(e){return e===A||e===i||e===P}function isWhitespace(e){return e===H||e===A||e===s||e===i||e===P}function checkIfTwoCodePointsAreAValidEscape(e){return e.source.codePointAt(e.cursor)===W&&!isNewLine(e.source.codePointAt(e.cursor+1))}function checkIfThreeCodePointsWouldStartAnIdentSequence(e,n){return n.source.codePointAt(n.cursor)===f?n.source.codePointAt(n.cursor+1)===f||(!!isIdentStartCodePoint(n.source.codePointAt(n.cursor+1))||n.source.codePointAt(n.cursor+1)===W&&!isNewLine(n.source.codePointAt(n.cursor+2))):!!isIdentStartCodePoint(n.source.codePointAt(n.cursor))||checkIfTwoCodePointsAreAValidEscape(n)}function checkIfThreeCodePointsWouldStartANumber(e){return e.source.codePointAt(e.cursor)===w||e.source.codePointAt(e.cursor)===f?!!isDigitCodePoint(e.source.codePointAt(e.cursor+1))||e.source.codePointAt(e.cursor+1)===C&&isDigitCodePoint(e.source.codePointAt(e.cursor+2)):e.source.codePointAt(e.cursor)===C?isDigitCodePoint(e.source.codePointAt(e.cursor+1)):isDigitCodePoint(e.source.codePointAt(e.cursor))}function checkIfTwoCodePointsStartAComment(e){return e.source.codePointAt(e.cursor)===B&&e.source.codePointAt(e.cursor+1)===o}function checkIfThreeCodePointsWouldStartCDC(e){return e.source.codePointAt(e.cursor)===f&&e.source.codePointAt(e.cursor+1)===f&&e.source.codePointAt(e.cursor+2)===l}var G,X,Y;function mirrorVariantType(e){switch(e){case G.OpenParen:return G.CloseParen;case G.CloseParen:return G.OpenParen;case G.OpenCurly:return G.CloseCurly;case G.CloseCurly:return G.OpenCurly;case G.OpenSquare:return G.CloseSquare;case G.CloseSquare:return G.OpenSquare;default:return null}}function mirrorVariant(e){switch(e[0]){case G.OpenParen:return[G.CloseParen,")",-1,-1,void 0];case G.CloseParen:return[G.OpenParen,"(",-1,-1,void 0];case G.OpenCurly:return[G.CloseCurly,"}",-1,-1,void 0];case G.CloseCurly:return[G.OpenCurly,"{",-1,-1,void 0];case G.OpenSquare:return[G.CloseSquare,"]",-1,-1,void 0];case G.CloseSquare:return[G.OpenSquare,"[",-1,-1,void 0];default:return null}}function consumeComment(n,t){for(t.advanceCodePoint(2);;){const r=t.readCodePoint();if(void 0===r){const o=[G.Comment,t.source.slice(t.representationStart,t.representationEnd+1),t.representationStart,t.representationEnd,void 0];return n.onParseError(new ParseErrorWithToken(e.UnexpectedEOFInComment,t.representationStart,t.representationEnd,["4.3.2. Consume comments","Unexpected EOF"],o)),o}if(r===o&&(void 0!==t.source.codePointAt(t.cursor)&&t.source.codePointAt(t.cursor)===B)){t.advanceCodePoint();break}}return[G.Comment,t.source.slice(t.representationStart,t.representationEnd+1),t.representationStart,t.representationEnd,void 0]}function consumeEscapedCodePoint(n,t){const o=t.readCodePoint();if(void 0===o)return n.onParseError(new ParseError(e.UnexpectedEOFInEscapedCodePoint,t.representationStart,t.representationEnd,["4.3.7. Consume an escaped code point","Unexpected EOF"])),x;if(isHexDigitCodePoint(o)){const e=[o];let n;for(;void 0!==(n=t.source.codePointAt(t.cursor))&&isHexDigitCodePoint(n)&&e.length<6;)e.push(n),t.advanceCodePoint();isWhitespace(t.source.codePointAt(t.cursor))&&t.advanceCodePoint();const i=parseInt(String.fromCodePoint(...e),16);return 0===i?x:void 0!==(r=i)&&r>=55296&&r<=57343||i>U?x:i}var r;return o}function consumeIdentSequence(e,n){const t=[];for(;;){const o=n.source.codePointAt(n.cursor);if(isIdentCodePoint(o))t.push(o),n.advanceCodePoint(+(o>65535)+1);else{if(!checkIfTwoCodePointsAreAValidEscape(n))return t;n.advanceCodePoint(),t.push(consumeEscapedCodePoint(e,n))}}}function consumeHashToken(e,n){n.advanceCodePoint();const t=n.source.codePointAt(n.cursor);if(void 0!==t&&(isIdentCodePoint(t)||checkIfTwoCodePointsAreAValidEscape(n))){let t=Y.Unrestricted;checkIfThreeCodePointsWouldStartAnIdentSequence(0,n)&&(t=Y.ID);const o=consumeIdentSequence(e,n);return[G.Hash,n.source.slice(n.representationStart,n.representationEnd+1),n.representationStart,n.representationEnd,{value:String.fromCodePoint(...o),type:t}]}return[G.Delim,"#",n.representationStart,n.representationEnd,{value:"#"}]}function consumeNumber(e,n){let t=X.Integer;for(n.source.codePointAt(n.cursor)!==w&&n.source.codePointAt(n.cursor)!==f||n.advanceCodePoint();isDigitCodePoint(n.source.codePointAt(n.cursor));)n.advanceCodePoint();if(n.source.codePointAt(n.cursor)===C&&isDigitCodePoint(n.source.codePointAt(n.cursor+1)))for(n.advanceCodePoint(2),t=X.Number;isDigitCodePoint(n.source.codePointAt(n.cursor));)n.advanceCodePoint();if(n.source.codePointAt(n.cursor)===k||n.source.codePointAt(n.cursor)===m){if(isDigitCodePoint(n.source.codePointAt(n.cursor+1)))n.advanceCodePoint(2);else{if(n.source.codePointAt(n.cursor+1)!==f&&n.source.codePointAt(n.cursor+1)!==w||!isDigitCodePoint(n.source.codePointAt(n.cursor+2)))return t;n.advanceCodePoint(3)}for(t=X.Number;isDigitCodePoint(n.source.codePointAt(n.cursor));)n.advanceCodePoint()}return t}function consumeNumericToken(e,n){let t;{const e=n.source.codePointAt(n.cursor);e===f?t="-":e===w&&(t="+")}const o=consumeNumber(0,n),r=parseFloat(n.source.slice(n.representationStart,n.representationEnd+1));if(checkIfThreeCodePointsWouldStartAnIdentSequence(0,n)){const i=consumeIdentSequence(e,n);return[G.Dimension,n.source.slice(n.representationStart,n.representationEnd+1),n.representationStart,n.representationEnd,{value:r,signCharacter:t,type:o,unit:String.fromCodePoint(...i)}]}return n.source.codePointAt(n.cursor)===R?(n.advanceCodePoint(),[G.Percentage,n.source.slice(n.representationStart,n.representationEnd+1),n.representationStart,n.representationEnd,{value:r,signCharacter:t}]):[G.Number,n.source.slice(n.representationStart,n.representationEnd+1),n.representationStart,n.representationEnd,{value:r,signCharacter:t,type:o}]}function consumeWhiteSpace(e){for(;isWhitespace(e.source.codePointAt(e.cursor));)e.advanceCodePoint();return[G.Whitespace,e.source.slice(e.representationStart,e.representationEnd+1),e.representationStart,e.representationEnd,void 0]}!function(e){e.Comment="comment",e.AtKeyword="at-keyword-token",e.BadString="bad-string-token",e.BadURL="bad-url-token",e.CDC="CDC-token",e.CDO="CDO-token",e.Colon="colon-token",e.Comma="comma-token",e.Delim="delim-token",e.Dimension="dimension-token",e.EOF="EOF-token",e.Function="function-token",e.Hash="hash-token",e.Ident="ident-token",e.Number="number-token",e.Percentage="percentage-token",e.Semicolon="semicolon-token",e.String="string-token",e.URL="url-token",e.Whitespace="whitespace-token",e.OpenParen="(-token",e.CloseParen=")-token",e.OpenSquare="[-token",e.CloseSquare="]-token",e.OpenCurly="{-token",e.CloseCurly="}-token",e.UnicodeRange="unicode-range-token"}(G||(G={})),function(e){e.Integer="integer",e.Number="number"}(X||(X={})),function(e){e.Unrestricted="unrestricted",e.ID="id"}(Y||(Y={}));class Reader{cursor=0;source="";representationStart=0;representationEnd=-1;constructor(e){this.source=e}advanceCodePoint(e=1){this.cursor=this.cursor+e,this.representationEnd=this.cursor-1}readCodePoint(){const e=this.source.codePointAt(this.cursor);if(void 0!==e)return this.cursor=this.cursor+1,this.representationEnd=this.cursor-1,e}unreadCodePoint(e=1){this.cursor=this.cursor-e,this.representationEnd=this.cursor-1}resetRepresentation(){this.representationStart=this.cursor,this.representationEnd=-1}}function consumeStringToken(n,t){let o="";const r=t.readCodePoint();for(;;){const s=t.readCodePoint();if(void 0===s){const r=[G.String,t.source.slice(t.representationStart,t.representationEnd+1),t.representationStart,t.representationEnd,{value:o}];return n.onParseError(new ParseErrorWithToken(e.UnexpectedEOFInString,t.representationStart,t.representationEnd,["4.3.5. Consume a string token","Unexpected EOF"],r)),r}if(isNewLine(s)){t.unreadCodePoint();const o=[G.BadString,t.source.slice(t.representationStart,t.representationEnd+1),t.representationStart,t.representationEnd,void 0];return n.onParseError(new ParseErrorWithToken(e.UnexpectedNewLineInString,t.representationStart,t.source.codePointAt(t.cursor)===i&&t.source.codePointAt(t.cursor+1)===A?t.representationEnd+2:t.representationEnd+1,["4.3.5. Consume a string token","Unexpected newline"],o)),o}if(s===r)return[G.String,t.source.slice(t.representationStart,t.representationEnd+1),t.representationStart,t.representationEnd,{value:o}];if(s!==W)o+=String.fromCodePoint(s);else{if(void 0===t.source.codePointAt(t.cursor))continue;if(isNewLine(t.source.codePointAt(t.cursor))){t.source.codePointAt(t.cursor)===i&&t.source.codePointAt(t.cursor+1)===A&&t.advanceCodePoint(),t.advanceCodePoint();continue}o+=String.fromCodePoint(consumeEscapedCodePoint(n,t))}}}function checkIfCodePointsMatchURLIdent(e){return!(3!==e.length||e[0]!==V&&e[0]!==K||e[1]!==z&&e[1]!==M||e[2]!==$&&e[2]!==J)}function consumeBadURL(e,n){for(;;){const t=n.source.codePointAt(n.cursor);if(void 0===t)return;if(t===F)return void n.advanceCodePoint();checkIfTwoCodePointsAreAValidEscape(n)?(n.advanceCodePoint(),consumeEscapedCodePoint(e,n)):n.advanceCodePoint()}}function consumeUrlToken(n,o){for(;isWhitespace(o.source.codePointAt(o.cursor));)o.advanceCodePoint();let i="";for(;;){if(void 0===o.source.codePointAt(o.cursor)){const t=[G.URL,o.source.slice(o.representationStart,o.representationEnd+1),o.representationStart,o.representationEnd,{value:i}];return n.onParseError(new ParseErrorWithToken(e.UnexpectedEOFInURL,o.representationStart,o.representationEnd,["4.3.6. Consume a url token","Unexpected EOF"],t)),t}if(o.source.codePointAt(o.cursor)===F)return o.advanceCodePoint(),[G.URL,o.source.slice(o.representationStart,o.representationEnd+1),o.representationStart,o.representationEnd,{value:i}];if(isWhitespace(o.source.codePointAt(o.cursor))){for(o.advanceCodePoint();isWhitespace(o.source.codePointAt(o.cursor));)o.advanceCodePoint();if(void 0===o.source.codePointAt(o.cursor)){const t=[G.URL,o.source.slice(o.representationStart,o.representationEnd+1),o.representationStart,o.representationEnd,{value:i}];return n.onParseError(new ParseErrorWithToken(e.UnexpectedEOFInURL,o.representationStart,o.representationEnd,["4.3.6. Consume a url token","Consume as much whitespace as possible","Unexpected EOF"],t)),t}return o.source.codePointAt(o.cursor)===F?(o.advanceCodePoint(),[G.URL,o.source.slice(o.representationStart,o.representationEnd+1),o.representationStart,o.representationEnd,{value:i}]):(consumeBadURL(n,o),[G.BadURL,o.source.slice(o.representationStart,o.representationEnd+1),o.representationStart,o.representationEnd,void 0])}const c=o.source.codePointAt(o.cursor);if(c===L||c===t||c===h||void 0!==(s=c)&&(s===g||s===d||O<=s&&s<=r||b<=s&&s<=S)){consumeBadURL(n,o);const t=[G.BadURL,o.source.slice(o.representationStart,o.representationEnd+1),o.representationStart,o.representationEnd,void 0];return n.onParseError(new ParseErrorWithToken(e.UnexpectedCharacterInURL,o.representationStart,o.representationEnd,["4.3.6. Consume a url token","Unexpected U+0022 QUOTATION MARK (\"), U+0027 APOSTROPHE ('), U+0028 LEFT PARENTHESIS (() or non-printable code point"],t)),t}if(c===W){if(checkIfTwoCodePointsAreAValidEscape(o)){o.advanceCodePoint(),i+=String.fromCodePoint(consumeEscapedCodePoint(n,o));continue}consumeBadURL(n,o);const t=[G.BadURL,o.source.slice(o.representationStart,o.representationEnd+1),o.representationStart,o.representationEnd,void 0];return n.onParseError(new ParseErrorWithToken(e.InvalidEscapeSequenceInURL,o.representationStart,o.representationEnd,["4.3.6. Consume a url token","U+005C REVERSE SOLIDUS (\\)","The input stream does not start with a valid escape sequence"],t)),t}i+=o.source[o.cursor],o.advanceCodePoint()}var s}function consumeIdentLikeToken(e,n){const o=consumeIdentSequence(e,n);if(n.source.codePointAt(n.cursor)!==h)return[G.Ident,n.source.slice(n.representationStart,n.representationEnd+1),n.representationStart,n.representationEnd,{value:String.fromCodePoint(...o)}];if(checkIfCodePointsMatchURLIdent(o)){n.advanceCodePoint();let r=0;for(;;){const e=isWhitespace(n.source.codePointAt(n.cursor)),i=isWhitespace(n.source.codePointAt(n.cursor+1));if(e&&i){r+=1,n.advanceCodePoint(1);continue}const s=e?n.source.codePointAt(n.cursor+1):n.source.codePointAt(n.cursor);if(s===L||s===t)return r>0&&n.unreadCodePoint(r),[G.Function,n.source.slice(n.representationStart,n.representationEnd+1),n.representationStart,n.representationEnd,{value:String.fromCodePoint(...o)}];break}return consumeUrlToken(e,n)}return n.advanceCodePoint(),[G.Function,n.source.slice(n.representationStart,n.representationEnd+1),n.representationStart,n.representationEnd,{value:String.fromCodePoint(...o)}]}function checkIfThreeCodePointsWouldStartAUnicodeRange(e){return!(e.source.codePointAt(e.cursor)!==V&&e.source.codePointAt(e.cursor)!==K||e.source.codePointAt(e.cursor+1)!==w||e.source.codePointAt(e.cursor+2)!==_&&!isHexDigitCodePoint(e.source.codePointAt(e.cursor+2)))}function consumeUnicodeRangeToken(e,n){n.advanceCodePoint(2);const t=[],o=[];let r;for(;void 0!==(r=n.source.codePointAt(n.cursor))&&t.length<6&&isHexDigitCodePoint(r);)t.push(r),n.advanceCodePoint();for(;void 0!==(r=n.source.codePointAt(n.cursor))&&t.length<6&&r===_;)0===o.length&&o.push(...t),t.push(j),o.push(Q),n.advanceCodePoint();if(!o.length&&n.source.codePointAt(n.cursor)===f&&isHexDigitCodePoint(n.source.codePointAt(n.cursor+1)))for(n.advanceCodePoint();void 0!==(r=n.source.codePointAt(n.cursor))&&o.length<6&&isHexDigitCodePoint(r);)o.push(r),n.advanceCodePoint();if(!o.length){const e=parseInt(String.fromCodePoint(...t),16);return[G.UnicodeRange,n.source.slice(n.representationStart,n.representationEnd+1),n.representationStart,n.representationEnd,{startOfRange:e,endOfRange:e}]}const i=parseInt(String.fromCodePoint(...t),16),s=parseInt(String.fromCodePoint(...o),16);return[G.UnicodeRange,n.source.slice(n.representationStart,n.representationEnd+1),n.representationStart,n.representationEnd,{startOfRange:i,endOfRange:s}]}function tokenize(e,n){const t=tokenizer(e,n),o=[];{for(;!t.endOfFile();){const e=t.nextToken();e&&o.push(e)}const e=t.nextToken();e&&o.push(e)}return o}function tokenizer(n,o){const r=n.css.valueOf(),d=n.unicodeRangesAllowed??!1,p=new Reader(r),l={onParseError:o?.onParseError??noop};return{nextToken:function nextToken(){p.resetRepresentation();const n=p.source.codePointAt(p.cursor);if(void 0===n)return[G.EOF,"",-1,-1,void 0];if(n===B&&checkIfTwoCodePointsStartAComment(p))return consumeComment(l,p);if(d&&(n===V||n===K)&&checkIfThreeCodePointsWouldStartAUnicodeRange(p))return consumeUnicodeRangeToken(0,p);if(isIdentStartCodePoint(n))return consumeIdentLikeToken(l,p);if(isDigitCodePoint(n))return consumeNumericToken(l,p);switch(n){case a:return p.advanceCodePoint(),[G.Comma,",",p.representationStart,p.representationEnd,void 0];case c:return p.advanceCodePoint(),[G.Colon,":",p.representationStart,p.representationEnd,void 0];case N:return p.advanceCodePoint(),[G.Semicolon,";",p.representationStart,p.representationEnd,void 0];case h:return p.advanceCodePoint(),[G.OpenParen,"(",p.representationStart,p.representationEnd,void 0];case F:return p.advanceCodePoint(),[G.CloseParen,")",p.representationStart,p.representationEnd,void 0];case v:return p.advanceCodePoint(),[G.OpenSquare,"[",p.representationStart,p.representationEnd,void 0];case q:return p.advanceCodePoint(),[G.CloseSquare,"]",p.representationStart,p.representationEnd,void 0];case E:return p.advanceCodePoint(),[G.OpenCurly,"{",p.representationStart,p.representationEnd,void 0];case y:return p.advanceCodePoint(),[G.CloseCurly,"}",p.representationStart,p.representationEnd,void 0];case t:case L:return consumeStringToken(l,p);case D:return consumeHashToken(l,p);case w:case C:return checkIfThreeCodePointsWouldStartANumber(p)?consumeNumericToken(l,p):(p.advanceCodePoint(),[G.Delim,p.source[p.representationStart],p.representationStart,p.representationEnd,{value:p.source[p.representationStart]}]);case A:case i:case P:case s:case H:return consumeWhiteSpace(p);case f:return checkIfThreeCodePointsWouldStartANumber(p)?consumeNumericToken(l,p):checkIfThreeCodePointsWouldStartCDC(p)?(p.advanceCodePoint(3),[G.CDC,"--\x3e",p.representationStart,p.representationEnd,void 0]):checkIfThreeCodePointsWouldStartAnIdentSequence(0,p)?consumeIdentLikeToken(l,p):(p.advanceCodePoint(),[G.Delim,"-",p.representationStart,p.representationEnd,{value:"-"}]);case T:return checkIfFourCodePointsWouldStartCDO(p)?(p.advanceCodePoint(4),[G.CDO,"\x3c!--",p.representationStart,p.representationEnd,void 0]):(p.advanceCodePoint(),[G.Delim,"<",p.representationStart,p.representationEnd,{value:"<"}]);case u:if(p.advanceCodePoint(),checkIfThreeCodePointsWouldStartAnIdentSequence(0,p)){const e=consumeIdentSequence(l,p);return[G.AtKeyword,p.source.slice(p.representationStart,p.representationEnd+1),p.representationStart,p.representationEnd,{value:String.fromCodePoint(...e)}]}return[G.Delim,"@",p.representationStart,p.representationEnd,{value:"@"}];case W:{if(checkIfTwoCodePointsAreAValidEscape(p))return consumeIdentLikeToken(l,p);p.advanceCodePoint();const n=[G.Delim,"\\",p.representationStart,p.representationEnd,{value:"\\"}];return l.onParseError(new ParseErrorWithToken(e.InvalidEscapeSequenceAfterBackslash,p.representationStart,p.representationEnd,["4.3.1. Consume a token","U+005C REVERSE SOLIDUS (\\)","The input stream does not start with a valid escape sequence"],n)),n}}return p.advanceCodePoint(),[G.Delim,p.source[p.representationStart],p.representationStart,p.representationEnd,{value:p.source[p.representationStart]}]},endOfFile:function endOfFile(){return void 0===p.source.codePointAt(p.cursor)}}}function noop(){}function mutateIdent(e,n){const t=[];for(const e of n)t.push(e.codePointAt(0));const o=String.fromCodePoint(...ensureThatValueRoundTripsAsIdent(t));e[1]=o,e[4].value=n}function mutateUnit(e,n){const t=[];for(const e of n)t.push(e.codePointAt(0));const o=ensureThatValueRoundTripsAsIdent(t);101===o[0]&&insertEscapedCodePoint(o,0,o[0]);const r=String.fromCodePoint(...o),i="+"===e[4].signCharacter?e[4].signCharacter:"",s=e[4].value.toString();e[1]=`${i}${s}${r}`,e[4].unit=n}function ensureThatValueRoundTripsAsIdent(e){let n=0;e[0]===f&&e[1]===f?n=2:e[0]===f&&e[1]?(n=2,isIdentStartCodePoint(e[1])||(n+=insertEscapedCodePoint(e,1,e[1]))):isIdentStartCodePoint(e[0])?n=1:(n=1,n+=insertEscapedCodePoint(e,0,e[0]));for(let t=n;t<4)&&(!!Z.includes(e[0])&&("string"==typeof e[1]&&("number"==typeof e[2]&&"number"==typeof e[3]))))}function isTokenNumeric(e){switch(e[0]){case G.Dimension:case G.Number:case G.Percentage:return!0;default:return!1}}function isTokenWhiteSpaceOrComment(e){switch(e[0]){case G.Whitespace:case G.Comment:return!0;default:return!1}}function isTokenAtKeyword(e){return!!e&&e[0]===G.AtKeyword}function isTokenBadString(e){return!!e&&e[0]===G.BadString}function isTokenBadURL(e){return!!e&&e[0]===G.BadURL}function isTokenCDC(e){return!!e&&e[0]===G.CDC}function isTokenCDO(e){return!!e&&e[0]===G.CDO}function isTokenColon(e){return!!e&&e[0]===G.Colon}function isTokenComma(e){return!!e&&e[0]===G.Comma}function isTokenComment(e){return!!e&&e[0]===G.Comment}function isTokenDelim(e){return!!e&&e[0]===G.Delim}function isTokenDimension(e){return!!e&&e[0]===G.Dimension}function isTokenEOF(e){return!!e&&e[0]===G.EOF}function isTokenFunction(e){return!!e&&e[0]===G.Function}function isTokenHash(e){return!!e&&e[0]===G.Hash}function isTokenIdent(e){return!!e&&e[0]===G.Ident}function isTokenNumber(e){return!!e&&e[0]===G.Number}function isTokenPercentage(e){return!!e&&e[0]===G.Percentage}function isTokenSemicolon(e){return!!e&&e[0]===G.Semicolon}function isTokenString(e){return!!e&&e[0]===G.String}function isTokenURL(e){return!!e&&e[0]===G.URL}function isTokenWhitespace(e){return!!e&&e[0]===G.Whitespace}function isTokenOpenParen(e){return!!e&&e[0]===G.OpenParen}function isTokenCloseParen(e){return!!e&&e[0]===G.CloseParen}function isTokenOpenSquare(e){return!!e&&e[0]===G.OpenSquare}function isTokenCloseSquare(e){return!!e&&e[0]===G.CloseSquare}function isTokenOpenCurly(e){return!!e&&e[0]===G.OpenCurly}function isTokenCloseCurly(e){return!!e&&e[0]===G.CloseCurly}function isTokenUnicodeRange(e){return!!e&&e[0]===G.UnicodeRange}export{Y as HashType,X as NumberType,ParseError,e as ParseErrorMessage,ParseErrorWithToken,G as TokenType,cloneTokens,isToken,isTokenAtKeyword,isTokenBadString,isTokenBadURL,isTokenCDC,isTokenCDO,isTokenCloseCurly,isTokenCloseParen,isTokenCloseSquare,isTokenColon,isTokenComma,isTokenComment,isTokenDelim,isTokenDimension,isTokenEOF,isTokenFunction,isTokenHash,isTokenIdent,isTokenNumber,isTokenNumeric,isTokenOpenCurly,isTokenOpenParen,isTokenOpenSquare,isTokenPercentage,isTokenSemicolon,isTokenString,isTokenURL,isTokenUnicodeRange,isTokenWhiteSpaceOrComment,isTokenWhitespace,mirrorVariant,mirrorVariantType,mutateIdent,mutateUnit,stringify,tokenize,tokenizer};
diff --git a/packages/css-tokenizer/package.json b/packages/css-tokenizer/package.json
index 4397177dd..3e3a49a27 100644
--- a/packages/css-tokenizer/package.json
+++ b/packages/css-tokenizer/package.json
@@ -25,7 +25,7 @@
}
],
"engines": {
- "node": "^14 || ^16 || >=18"
+ "node": ">=18"
},
"type": "module",
"main": "dist/index.cjs",
@@ -48,7 +48,7 @@
"dist"
],
"devDependencies": {
- "@rmenke/css-tokenizer-tests": "^1.1.5",
+ "@rmenke/css-tokenizer-tests": "^1.1.6",
"postcss": "^8.4.38",
"postcss-parser-tests": "^8.8.0"
},
diff --git a/packages/css-tokenizer/src/checks/four-code-points-would-start-cdo.ts b/packages/css-tokenizer/src/checks/four-code-points-would-start-cdo.ts
index b79cbb661..9bb80aadd 100644
--- a/packages/css-tokenizer/src/checks/four-code-points-would-start-cdo.ts
+++ b/packages/css-tokenizer/src/checks/four-code-points-would-start-cdo.ts
@@ -1,7 +1,7 @@
import { EXCLAMATION_MARK, HYPHEN_MINUS, LESS_THAN_SIGN } from '../code-points/code-points';
-import { CodePointReader } from '../interfaces/code-point-reader';
+import type { CodePointReader } from '../interfaces/code-point-reader';
// https://www.w3.org/TR/2021/CRD-css-syntax-3-20211224/#consume-token
export function checkIfFourCodePointsWouldStartCDO(reader: CodePointReader): boolean {
- return reader.codePointSource[reader.cursor] === LESS_THAN_SIGN && reader.codePointSource[reader.cursor + 1] === EXCLAMATION_MARK && reader.codePointSource[reader.cursor + 2] === HYPHEN_MINUS && reader.codePointSource[reader.cursor + 3] === HYPHEN_MINUS;
+ return reader.source.codePointAt(reader.cursor) === LESS_THAN_SIGN && reader.source.codePointAt(reader.cursor + 1) === EXCLAMATION_MARK && reader.source.codePointAt(reader.cursor + 2) === HYPHEN_MINUS && reader.source.codePointAt(reader.cursor + 3) === HYPHEN_MINUS;
}
diff --git a/packages/css-tokenizer/src/checks/three-code-points-would-start-cdc.ts b/packages/css-tokenizer/src/checks/three-code-points-would-start-cdc.ts
index 1ae028fdb..87c728752 100644
--- a/packages/css-tokenizer/src/checks/three-code-points-would-start-cdc.ts
+++ b/packages/css-tokenizer/src/checks/three-code-points-would-start-cdc.ts
@@ -1,7 +1,7 @@
import { GREATER_THAN_SIGN, HYPHEN_MINUS } from '../code-points/code-points';
-import { CodePointReader } from '../interfaces/code-point-reader';
+import type { CodePointReader } from '../interfaces/code-point-reader';
// https://www.w3.org/TR/2021/CRD-css-syntax-3-20211224/#consume-token
export function checkIfThreeCodePointsWouldStartCDC(reader: CodePointReader): boolean {
- return reader.codePointSource[reader.cursor] === HYPHEN_MINUS && reader.codePointSource[reader.cursor + 1] === HYPHEN_MINUS && reader.codePointSource[reader.cursor + 2] === GREATER_THAN_SIGN;
+ return reader.source.codePointAt(reader.cursor) === HYPHEN_MINUS && reader.source.codePointAt(reader.cursor + 1) === HYPHEN_MINUS && reader.source.codePointAt(reader.cursor + 2) === GREATER_THAN_SIGN;
}
diff --git a/packages/css-tokenizer/src/checks/three-code-points-would-start-ident-sequence.ts b/packages/css-tokenizer/src/checks/three-code-points-would-start-ident-sequence.ts
index 8de38737d..ebc2b4802 100644
--- a/packages/css-tokenizer/src/checks/three-code-points-would-start-ident-sequence.ts
+++ b/packages/css-tokenizer/src/checks/three-code-points-would-start-ident-sequence.ts
@@ -1,25 +1,25 @@
import { HYPHEN_MINUS, REVERSE_SOLIDUS } from '../code-points/code-points';
import { isIdentStartCodePoint, isNewLine } from '../code-points/ranges';
-import { CodePointReader } from '../interfaces/code-point-reader';
-import { Context } from '../interfaces/context';
+import type { CodePointReader } from '../interfaces/code-point-reader';
+import type { Context } from '../interfaces/context';
import { checkIfTwoCodePointsAreAValidEscape } from './two-code-points-are-valid-escape';
// https://www.w3.org/TR/2021/CRD-css-syntax-3-20211224/#would-start-an-identifier
export function checkIfThreeCodePointsWouldStartAnIdentSequence(ctx: Context, reader: CodePointReader): boolean {
// // U+002D HYPHEN-MINUS
- if (reader.codePointSource[reader.cursor] === HYPHEN_MINUS) {
+ if (reader.source.codePointAt(reader.cursor) === HYPHEN_MINUS) {
// If the second code point is a U+002D HYPHEN-MINUS return true
- if (reader.codePointSource[reader.cursor + 1] === HYPHEN_MINUS) {
+ if (reader.source.codePointAt(reader.cursor + 1) === HYPHEN_MINUS) {
return true;
}
// If the second code point is an ident-start code point return true
- if (isIdentStartCodePoint(reader.codePointSource[reader.cursor + 1])) {
+ if (isIdentStartCodePoint(reader.source.codePointAt(reader.cursor + 1))) {
return true;
}
// If the second and third code points are a valid escape return true
- if (reader.codePointSource[reader.cursor + 1] === REVERSE_SOLIDUS && !isNewLine(reader.codePointSource[reader.cursor + 2])) {
+ if (reader.source.codePointAt(reader.cursor + 1) === REVERSE_SOLIDUS && !isNewLine(reader.source.codePointAt(reader.cursor + 2))) {
return true;
}
@@ -28,7 +28,7 @@ export function checkIfThreeCodePointsWouldStartAnIdentSequence(ctx: Context, re
// ident-start code point
// Return true.
- if (isIdentStartCodePoint(reader.codePointSource[reader.cursor])) {
+ if (isIdentStartCodePoint(reader.source.codePointAt(reader.cursor))) {
return true;
}
diff --git a/packages/css-tokenizer/src/checks/three-code-points-would-start-number.ts b/packages/css-tokenizer/src/checks/three-code-points-would-start-number.ts
index cbd31faa5..8104a4918 100644
--- a/packages/css-tokenizer/src/checks/three-code-points-would-start-number.ts
+++ b/packages/css-tokenizer/src/checks/three-code-points-would-start-number.ts
@@ -1,29 +1,29 @@
import { FULL_STOP, HYPHEN_MINUS, PLUS_SIGN } from '../code-points/code-points';
import { isDigitCodePoint } from '../code-points/ranges';
-import { CodePointReader } from '../interfaces/code-point-reader';
+import type { CodePointReader } from '../interfaces/code-point-reader';
// https://www.w3.org/TR/2021/CRD-css-syntax-3-20211224/#starts-with-a-number
export function checkIfThreeCodePointsWouldStartANumber(reader: CodePointReader): boolean {
- if (reader.codePointSource[reader.cursor] === PLUS_SIGN || reader.codePointSource[reader.cursor] === HYPHEN_MINUS) { // U+002B PLUS SIGN (+) or U+002D HYPHEN-MINUS (-)
+ if (reader.source.codePointAt(reader.cursor) === PLUS_SIGN || reader.source.codePointAt(reader.cursor) === HYPHEN_MINUS) { // U+002B PLUS SIGN (+) or U+002D HYPHEN-MINUS (-)
// If the second code point is a digit, return true.
- if (isDigitCodePoint(reader.codePointSource[reader.cursor + 1])) {
+ if (isDigitCodePoint(reader.source.codePointAt(reader.cursor + 1))) {
return true;
}
// Otherwise, if the second code point is a U+002E FULL STOP (.)
- if (reader.codePointSource[reader.cursor + 1] === FULL_STOP) {
+ if (reader.source.codePointAt(reader.cursor + 1) === FULL_STOP) {
// and the third code point is a digit, return true.
- return isDigitCodePoint(reader.codePointSource[reader.cursor + 2]);
+ return isDigitCodePoint(reader.source.codePointAt(reader.cursor + 2));
}
// Otherwise, return false.
return false;
- } else if (reader.codePointSource[reader.cursor] === FULL_STOP) { // U+002E FULL STOP (.)
+ } else if (reader.source.codePointAt(reader.cursor) === FULL_STOP) { // U+002E FULL STOP (.)
// If the second code point is a digit, return true.
// Otherwise, return false.
- return isDigitCodePoint(reader.codePointSource[reader.cursor + 1]);
+ return isDigitCodePoint(reader.source.codePointAt(reader.cursor + 1));
}
- return isDigitCodePoint(reader.codePointSource[reader.cursor]); // digit
+ return isDigitCodePoint(reader.source.codePointAt(reader.cursor)); // digit
}
diff --git a/packages/css-tokenizer/src/checks/three-code-points-would-start-unicode-range.ts b/packages/css-tokenizer/src/checks/three-code-points-would-start-unicode-range.ts
index bd485ac68..6bb2d67d6 100644
--- a/packages/css-tokenizer/src/checks/three-code-points-would-start-unicode-range.ts
+++ b/packages/css-tokenizer/src/checks/three-code-points-would-start-unicode-range.ts
@@ -1,21 +1,21 @@
import { LATIN_CAPITAL_LETTER_U, LATIN_SMALL_LETTER_U, PLUS_SIGN, QUESTION_MARK } from '../code-points/code-points';
import { isHexDigitCodePoint } from '../code-points/ranges';
-import { CodePointReader } from '../interfaces/code-point-reader';
+import type { CodePointReader } from '../interfaces/code-point-reader';
// https://drafts.csswg.org/css-syntax/#starts-a-unicode-range
export function checkIfThreeCodePointsWouldStartAUnicodeRange(reader: CodePointReader): boolean {
if (
// The first code point is either U+0055 LATIN CAPITAL LETTER U (U) or U+0075 LATIN SMALL LETTER U (u)
(
- reader.codePointSource[reader.cursor] === LATIN_SMALL_LETTER_U ||
- reader.codePointSource[reader.cursor] === LATIN_CAPITAL_LETTER_U
+ reader.source.codePointAt(reader.cursor) === LATIN_SMALL_LETTER_U ||
+ reader.source.codePointAt(reader.cursor) === LATIN_CAPITAL_LETTER_U
) &&
// The second code point is U+002B PLUS SIGN (+).
- reader.codePointSource[reader.cursor + 1] === PLUS_SIGN &&
+ reader.source.codePointAt(reader.cursor + 1) === PLUS_SIGN &&
// The third code point is either U+003F QUESTION MARK (?) or a hex digit
(
- reader.codePointSource[reader.cursor + 2] === QUESTION_MARK ||
- isHexDigitCodePoint(reader.codePointSource[reader.cursor + 2])
+ reader.source.codePointAt(reader.cursor + 2) === QUESTION_MARK ||
+ isHexDigitCodePoint(reader.source.codePointAt(reader.cursor + 2))
)
) {
// then return true.
diff --git a/packages/css-tokenizer/src/checks/two-code-points-are-valid-escape.ts b/packages/css-tokenizer/src/checks/two-code-points-are-valid-escape.ts
index 63cd334c8..810259032 100644
--- a/packages/css-tokenizer/src/checks/two-code-points-are-valid-escape.ts
+++ b/packages/css-tokenizer/src/checks/two-code-points-are-valid-escape.ts
@@ -1,13 +1,13 @@
import { REVERSE_SOLIDUS } from '../code-points/code-points';
import { isNewLine } from '../code-points/ranges';
-import { CodePointReader } from '../interfaces/code-point-reader';
+import type { CodePointReader } from '../interfaces/code-point-reader';
// https://www.w3.org/TR/2021/CRD-css-syntax-3-20211224/#starts-with-a-valid-escape
export function checkIfTwoCodePointsAreAValidEscape(reader: CodePointReader): boolean {
return (
// If the first code point is not U+005C REVERSE SOLIDUS (\), return false.
- reader.codePointSource[reader.cursor] === REVERSE_SOLIDUS &&
+ reader.source.codePointAt(reader.cursor) === REVERSE_SOLIDUS &&
// Otherwise, if the second code point is a newline, return false.
- !isNewLine(reader.codePointSource[reader.cursor + 1])
+ !isNewLine(reader.source.codePointAt(reader.cursor + 1))
);
}
diff --git a/packages/css-tokenizer/src/checks/two-code-points-start-comment.ts b/packages/css-tokenizer/src/checks/two-code-points-start-comment.ts
index 18f778f0d..796b2ae6a 100644
--- a/packages/css-tokenizer/src/checks/two-code-points-start-comment.ts
+++ b/packages/css-tokenizer/src/checks/two-code-points-start-comment.ts
@@ -1,10 +1,10 @@
import { ASTERISK, SOLIDUS } from '../code-points/code-points';
-import { CodePointReader } from '../interfaces/code-point-reader';
+import type { CodePointReader } from '../interfaces/code-point-reader';
// https://www.w3.org/TR/2021/CRD-css-syntax-3-20211224/#consume-comments
export function checkIfTwoCodePointsStartAComment(reader: CodePointReader): boolean {
return (
- reader.codePointSource[reader.cursor] === SOLIDUS &&
- reader.codePointSource[reader.cursor + 1] === ASTERISK
+ reader.source.codePointAt(reader.cursor) === SOLIDUS &&
+ reader.source.codePointAt(reader.cursor + 1) === ASTERISK
);
}
diff --git a/packages/css-tokenizer/src/code-points/ranges.ts b/packages/css-tokenizer/src/code-points/ranges.ts
index a1458a8d1..43ac1e7ea 100644
--- a/packages/css-tokenizer/src/code-points/ranges.ts
+++ b/packages/css-tokenizer/src/code-points/ranges.ts
@@ -2,46 +2,46 @@ import { BACKSPACE, DELETE, INFORMATION_SEPARATOR_ONE, LINE_TABULATION, LOW_LINE
// https://www.w3.org/TR/2021/CRD-css-syntax-3-20211224/#tokenizer-definitions
// https://www.w3.org/TR/2021/CRD-css-syntax-3-20211224/#digit
-export function isDigitCodePoint(search: number): boolean {
- return search >= 0x0030 && search <= 0x0039;
+export function isDigitCodePoint(search: number | undefined): search is number {
+ return (typeof search !== "undefined") && search >= 0x0030 && search <= 0x0039;
}
// https://www.w3.org/TR/2021/CRD-css-syntax-3-20211224/#uppercase-letter
-function isUppercaseLetterCodePoint(search: number): boolean {
- return search >= 0x0041 && search <= 0x005a;
+function isUppercaseLetterCodePoint(search: number | undefined): search is number {
+ return (typeof search !== "undefined") && search >= 0x0041 && search <= 0x005a;
}
// https://www.w3.org/TR/2021/CRD-css-syntax-3-20211224/#lowercase-letter
-function isLowercaseLetterCodePoint(search: number): boolean {
- return search >= 0x0061 && search <= 0x007a;
+function isLowercaseLetterCodePoint(search: number | undefined): search is number {
+ return (typeof search !== "undefined") && search >= 0x0061 && search <= 0x007a;
}
// https://www.w3.org/TR/2021/CRD-css-syntax-3-20211224/#hex-digit
-export function isHexDigitCodePoint(search: number): boolean {
- return (
- isDigitCodePoint(search) || // 0 .. 9
+export function isHexDigitCodePoint(search: number | undefined): search is number {
+ return (typeof search !== "undefined") && (
+ (search >= 0x0030 && search <= 0x0039) || // 0 .. 9
(search >= 0x0061 && search <= 0x0066) || // a .. f
(search >= 0x0041 && search <= 0x0046) // A .. F
);
}
// https://www.w3.org/TR/2021/CRD-css-syntax-3-20211224/#letter
-function isLetterCodePoint(search: number): boolean {
+function isLetterCodePoint(search: number | undefined): search is number {
return isLowercaseLetterCodePoint(search) || isUppercaseLetterCodePoint(search);
}
// https://www.w3.org/TR/2021/CRD-css-syntax-3-20211224/#ident-start-code-point
-export function isIdentStartCodePoint(search: number): boolean {
+export function isIdentStartCodePoint(search: number | undefined): search is number {
return isLetterCodePoint(search) || isNonASCII_IdentCodePoint(search) || search === LOW_LINE;
}
// https://www.w3.org/TR/2021/CRD-css-syntax-3-20211224/#ident-code-point
-export function isIdentCodePoint(search: number): boolean {
+export function isIdentCodePoint(search: number | undefined): search is number {
return isIdentStartCodePoint(search) || isDigitCodePoint(search) || search === HYPHEN_MINUS;
}
// https://drafts.csswg.org/css-syntax/#non-ascii-ident-code-point
-function isNonASCII_IdentCodePoint(search: number): boolean {
+function isNonASCII_IdentCodePoint(search: number | undefined): search is number {
if (
search === 0x00B7 ||
search === 0x200C ||
@@ -53,6 +53,10 @@ function isNonASCII_IdentCodePoint(search: number): boolean {
return true;
}
+ if (typeof search === "undefined") {
+ return false;
+ }
+
if (
(0x00C0 <= search && search <= 0x00D6) ||
(0x00D8 <= search && search <= 0x00F6) ||
@@ -71,8 +75,8 @@ function isNonASCII_IdentCodePoint(search: number): boolean {
}
// https://www.w3.org/TR/2021/CRD-css-syntax-3-20211224/#non-printable-code-point
-export function isNonPrintableCodePoint(search: number): boolean {
- return (
+export function isNonPrintableCodePoint(search: number | undefined): search is number {
+ return (typeof search !== "undefined") &&(
(search === LINE_TABULATION) ||
(search === DELETE) ||
(NULL <= search && search <= BACKSPACE) ||
@@ -81,16 +85,16 @@ export function isNonPrintableCodePoint(search: number): boolean {
}
// https://www.w3.org/TR/2021/CRD-css-syntax-3-20211224/#whitespace
-export function isNewLine(search: number): boolean {
+export function isNewLine(search: number | undefined): search is number {
return search === LINE_FEED || search === CARRIAGE_RETURN || search === FORM_FEED;
}
// https://www.w3.org/TR/2021/CRD-css-syntax-3-20211224/#whitespace
-export function isWhitespace(search: number): boolean {
+export function isWhitespace(search: number | undefined): search is number {
return search === SPACE || search === LINE_FEED || search === CHARACTER_TABULATION || search === CARRIAGE_RETURN || search === FORM_FEED;
}
// https://infra.spec.whatwg.org/#surrogate
-export function isSurrogate(search: number): boolean {
- return search >= 0xd800 && search <= 0xdfff;
+export function isSurrogate(search: number | undefined): search is number {
+ return (typeof search !== "undefined") && search >= 0xd800 && search <= 0xdfff;
}
diff --git a/packages/css-tokenizer/src/consume/bad-url.ts b/packages/css-tokenizer/src/consume/bad-url.ts
index efe430fc5..20981e5cb 100644
--- a/packages/css-tokenizer/src/consume/bad-url.ts
+++ b/packages/css-tokenizer/src/consume/bad-url.ts
@@ -1,17 +1,18 @@
import { checkIfTwoCodePointsAreAValidEscape } from '../checks/two-code-points-are-valid-escape';
import { RIGHT_PARENTHESIS } from '../code-points/code-points';
-import { CodePointReader } from '../interfaces/code-point-reader';
-import { Context } from '../interfaces/context';
+import type { CodePointReader } from '../interfaces/code-point-reader';
+import type { Context } from '../interfaces/context';
import { consumeEscapedCodePoint } from './escaped-code-point';
// https://www.w3.org/TR/2021/CRD-css-syntax-3-20211224/#consume-remnants-of-bad-url
export function consumeBadURL(ctx: Context, reader: CodePointReader): void {
while (true) {
- if (reader.codePointSource[reader.cursor] === undefined) {
+ const codePoint = reader.source.codePointAt(reader.cursor);
+ if (typeof codePoint === "undefined") {
return;
}
- if (reader.codePointSource[reader.cursor] === RIGHT_PARENTHESIS) {
+ if (codePoint === RIGHT_PARENTHESIS) {
reader.advanceCodePoint();
return;
}
diff --git a/packages/css-tokenizer/src/consume/comment.ts b/packages/css-tokenizer/src/consume/comment.ts
index 6a542b9f2..02c4d6b25 100644
--- a/packages/css-tokenizer/src/consume/comment.ts
+++ b/packages/css-tokenizer/src/consume/comment.ts
@@ -1,8 +1,9 @@
import { ASTERISK, SOLIDUS } from '../code-points/code-points';
-import { CodePointReader } from '../interfaces/code-point-reader';
-import { Context } from '../interfaces/context';
+import type { CodePointReader } from '../interfaces/code-point-reader';
+import type { Context } from '../interfaces/context';
import { ParseErrorMessage, ParseErrorWithToken } from '../interfaces/error';
-import { CSSToken, TokenComment, TokenType } from '../interfaces/token';
+import type { CSSToken, TokenComment} from '../interfaces/token';
+import { TokenType } from '../interfaces/token';
// https://www.w3.org/TR/2021/CRD-css-syntax-3-20211224/#consume-comment
export function consumeComment(ctx: Context, reader: CodePointReader): TokenComment {
@@ -10,7 +11,7 @@ export function consumeComment(ctx: Context, reader: CodePointReader): TokenComm
while (true) {
const codePoint = reader.readCodePoint();
- if (codePoint === false) {
+ if (typeof codePoint === "undefined") {
const token: CSSToken = [
TokenType.Comment,
reader.source.slice(reader.representationStart, reader.representationEnd + 1),
@@ -37,11 +38,11 @@ export function consumeComment(ctx: Context, reader: CodePointReader): TokenComm
continue;
}
- if (reader.codePointSource[reader.cursor] === undefined) {
+ if (typeof reader.source.codePointAt(reader.cursor) === "undefined") {
continue;
}
- if (reader.codePointSource[reader.cursor] === SOLIDUS) {
+ if (reader.source.codePointAt(reader.cursor) === SOLIDUS) {
reader.advanceCodePoint();
break;
}
diff --git a/packages/css-tokenizer/src/consume/escaped-code-point.ts b/packages/css-tokenizer/src/consume/escaped-code-point.ts
index 760750754..bf4f8fef6 100644
--- a/packages/css-tokenizer/src/consume/escaped-code-point.ts
+++ b/packages/css-tokenizer/src/consume/escaped-code-point.ts
@@ -1,13 +1,13 @@
import { MAXIMUM_ALLOWED_CODEPOINT, REPLACEMENT_CHARACTER } from '../code-points/code-points';
import { isHexDigitCodePoint, isSurrogate, isWhitespace } from '../code-points/ranges';
-import { CodePointReader } from '../interfaces/code-point-reader';
-import { Context } from '../interfaces/context';
+import type { CodePointReader } from '../interfaces/code-point-reader';
+import type { Context } from '../interfaces/context';
import { ParseError, ParseErrorMessage } from '../interfaces/error';
// https://www.w3.org/TR/2021/CRD-css-syntax-3-20211224/#consume-escaped-code-point
export function consumeEscapedCodePoint(ctx: Context, reader: CodePointReader): number {
const codePoint = reader.readCodePoint();
- if (codePoint === false) {
+ if (typeof codePoint === "undefined") {
ctx.onParseError(new ParseError(
ParseErrorMessage.UnexpectedEOFInEscapedCodePoint,
reader.representationStart,
@@ -24,12 +24,13 @@ export function consumeEscapedCodePoint(ctx: Context, reader: CodePointReader):
if (isHexDigitCodePoint(codePoint)) {
const hexSequence: Array = [codePoint];
- while ((reader.codePointSource[reader.cursor] !== undefined) && isHexDigitCodePoint(reader.codePointSource[reader.cursor]) && hexSequence.length < 6) {
- hexSequence.push(reader.codePointSource[reader.cursor]);
+ let nextCodePoint: number | undefined;
+ while ((typeof (nextCodePoint = reader.source.codePointAt(reader.cursor)) !== "undefined") && isHexDigitCodePoint(nextCodePoint) && hexSequence.length < 6) {
+ hexSequence.push(nextCodePoint);
reader.advanceCodePoint();
}
- if (isWhitespace(reader.codePointSource[reader.cursor])) {
+ if (isWhitespace(reader.source.codePointAt(reader.cursor))) {
reader.advanceCodePoint();
}
diff --git a/packages/css-tokenizer/src/consume/hash-token.ts b/packages/css-tokenizer/src/consume/hash-token.ts
index 8ada99ff6..3f04ea9ea 100644
--- a/packages/css-tokenizer/src/consume/hash-token.ts
+++ b/packages/css-tokenizer/src/consume/hash-token.ts
@@ -1,18 +1,20 @@
import { checkIfThreeCodePointsWouldStartAnIdentSequence } from '../checks/three-code-points-would-start-ident-sequence';
import { checkIfTwoCodePointsAreAValidEscape } from '../checks/two-code-points-are-valid-escape';
import { isIdentCodePoint } from '../code-points/ranges';
-import { CodePointReader } from '../interfaces/code-point-reader';
-import { Context } from '../interfaces/context';
-import { HashType, TokenDelim, TokenHash, TokenType } from '../interfaces/token';
+import type { CodePointReader } from '../interfaces/code-point-reader';
+import type { Context } from '../interfaces/context';
+import type { TokenDelim, TokenHash} from '../interfaces/token';
+import { HashType, TokenType } from '../interfaces/token';
import { consumeIdentSequence } from './ident-sequence';
// https://www.w3.org/TR/2021/CRD-css-syntax-3-20211224/#consume-token
export function consumeHashToken(ctx: Context, reader: CodePointReader): TokenDelim|TokenHash {
reader.advanceCodePoint();
+ const codePoint = reader.source.codePointAt(reader.cursor);
if (
- (reader.codePointSource[reader.cursor] !== undefined) && (
- isIdentCodePoint(reader.codePointSource[reader.cursor]) ||
+ (typeof codePoint !== "undefined") && (
+ isIdentCodePoint(codePoint) ||
checkIfTwoCodePointsAreAValidEscape(reader)
)
) {
diff --git a/packages/css-tokenizer/src/consume/ident-like-token.ts b/packages/css-tokenizer/src/consume/ident-like-token.ts
index 232ab1921..9b794b9a1 100644
--- a/packages/css-tokenizer/src/consume/ident-like-token.ts
+++ b/packages/css-tokenizer/src/consume/ident-like-token.ts
@@ -1,9 +1,10 @@
import { checkIfCodePointsMatchURLIdent } from '../checks/matches-url-ident';
import { APOSTROPHE, LEFT_PARENTHESIS, QUOTATION_MARK } from '../code-points/code-points';
import { isWhitespace } from '../code-points/ranges';
-import { CodePointReader } from '../interfaces/code-point-reader';
-import { Context } from '../interfaces/context';
-import { TokenBadURL, TokenFunction, TokenIdent, TokenType, TokenURL } from '../interfaces/token';
+import type { CodePointReader } from '../interfaces/code-point-reader';
+import type { Context } from '../interfaces/context';
+import type { TokenBadURL, TokenFunction, TokenIdent, TokenURL } from '../interfaces/token';
+import { TokenType } from '../interfaces/token';
import { consumeIdentSequence } from './ident-sequence';
import { consumeUrlToken } from './url-token';
@@ -11,7 +12,7 @@ import { consumeUrlToken } from './url-token';
export function consumeIdentLikeToken(ctx: Context, reader: CodePointReader): TokenIdent | TokenFunction | TokenURL | TokenBadURL {
const codePoints = consumeIdentSequence(ctx, reader);
- if (reader.codePointSource[reader.cursor] !== LEFT_PARENTHESIS) {
+ if (reader.source.codePointAt(reader.cursor) !== LEFT_PARENTHESIS) {
return [
TokenType.Ident,
reader.source.slice(reader.representationStart, reader.representationEnd + 1),
@@ -28,15 +29,15 @@ export function consumeIdentLikeToken(ctx: Context, reader: CodePointReader): To
let read = 0;
while (true) {
- const firstIsWhitespace = isWhitespace(reader.codePointSource[reader.cursor]);
- const secondIsWhitespace = isWhitespace(reader.codePointSource[reader.cursor+1]);
+ const firstIsWhitespace = isWhitespace(reader.source.codePointAt(reader.cursor));
+ const secondIsWhitespace = isWhitespace(reader.source.codePointAt(reader.cursor + 1));
if (firstIsWhitespace && secondIsWhitespace) {
read = read + 1;
reader.advanceCodePoint(1);
continue;
}
- const firstNonWhitespace = firstIsWhitespace ? reader.codePointSource[reader.cursor+1] : reader.codePointSource[reader.cursor];
+ const firstNonWhitespace = firstIsWhitespace ? reader.source.codePointAt(reader.cursor + 1) : reader.source.codePointAt(reader.cursor);
if (firstNonWhitespace === QUOTATION_MARK || firstNonWhitespace === APOSTROPHE) {
if (read > 0) {
// https://github.com/w3c/csswg-drafts/issues/8280#issuecomment-1370566921
diff --git a/packages/css-tokenizer/src/consume/ident-sequence.ts b/packages/css-tokenizer/src/consume/ident-sequence.ts
index eb8eca9f8..0ec6e1537 100644
--- a/packages/css-tokenizer/src/consume/ident-sequence.ts
+++ b/packages/css-tokenizer/src/consume/ident-sequence.ts
@@ -1,7 +1,7 @@
import { checkIfTwoCodePointsAreAValidEscape } from '../checks/two-code-points-are-valid-escape';
import { isIdentCodePoint } from '../code-points/ranges';
-import { CodePointReader } from '../interfaces/code-point-reader';
-import { Context } from '../interfaces/context';
+import type { CodePointReader } from '../interfaces/code-point-reader';
+import type { Context } from '../interfaces/context';
import { consumeEscapedCodePoint } from './escaped-code-point';
// https://www.w3.org/TR/2021/CRD-css-syntax-3-20211224/#consume-name
@@ -9,9 +9,10 @@ export function consumeIdentSequence(ctx: Context, reader: CodePointReader): Arr
const result: Array = [];
while (true) {
- if (isIdentCodePoint(reader.codePointSource[reader.cursor])) {
- result.push(reader.codePointSource[reader.cursor]);
- reader.advanceCodePoint();
+ const codePoint = reader.source.codePointAt(reader.cursor);
+ if (isIdentCodePoint(codePoint)) {
+ result.push(codePoint);
+ reader.advanceCodePoint(1 + +(codePoint > 0xffff));
continue;
}
diff --git a/packages/css-tokenizer/src/consume/number.ts b/packages/css-tokenizer/src/consume/number.ts
index 4cd00b3c6..a32556128 100644
--- a/packages/css-tokenizer/src/consume/number.ts
+++ b/packages/css-tokenizer/src/consume/number.ts
@@ -1,7 +1,7 @@
import { FULL_STOP, HYPHEN_MINUS, LATIN_CAPITAL_LETTER_E, LATIN_SMALL_LETTER_E, PLUS_SIGN } from '../code-points/code-points';
import { isDigitCodePoint } from '../code-points/ranges';
-import { CodePointReader } from '../interfaces/code-point-reader';
-import { Context } from '../interfaces/context';
+import type { CodePointReader } from '../interfaces/code-point-reader';
+import type { Context } from '../interfaces/context';
import { NumberType } from '../interfaces/token';
// https://www.w3.org/TR/2021/CRD-css-syntax-3-20211224/#consume-number
@@ -10,17 +10,17 @@ export function consumeNumber(ctx: Context, reader: CodePointReader): NumberType
let type = NumberType.Integer;
// 2. If the next input code point is U+002B PLUS SIGN (+) or U+002D HYPHEN-MINUS (-), consume it and append it to repr.
- if (reader.codePointSource[reader.cursor] === PLUS_SIGN || reader.codePointSource[reader.cursor] === HYPHEN_MINUS) {
+ if (reader.source.codePointAt(reader.cursor) === PLUS_SIGN || reader.source.codePointAt(reader.cursor) === HYPHEN_MINUS) {
reader.advanceCodePoint();
}
// 3. While the next input code point is a digit, consume it and append it to repr.
- while (isDigitCodePoint(reader.codePointSource[reader.cursor])) {
+ while (isDigitCodePoint(reader.source.codePointAt(reader.cursor))) {
reader.advanceCodePoint();
}
// 4. If the next 2 input code points are U+002E FULL STOP (.) followed by a digit, then:
- if (reader.codePointSource[reader.cursor] === FULL_STOP && isDigitCodePoint(reader.codePointSource[reader.cursor+1])) {
+ if (reader.source.codePointAt(reader.cursor) === FULL_STOP && isDigitCodePoint(reader.source.codePointAt(reader.cursor + 1))) {
// 4.1. Consume them.
reader.advanceCodePoint(2);
@@ -28,7 +28,7 @@ export function consumeNumber(ctx: Context, reader: CodePointReader): NumberType
type = NumberType.Number;
// 4.4. While the next input code point is a digit, consume it and append it to repr.
- while (isDigitCodePoint(reader.codePointSource[reader.cursor])) {
+ while (isDigitCodePoint(reader.source.codePointAt(reader.cursor))) {
reader.advanceCodePoint();
}
}
@@ -36,13 +36,13 @@ export function consumeNumber(ctx: Context, reader: CodePointReader): NumberType
// 5. If the next 2 or 3 input code points are U+0045 LATIN CAPITAL LETTER E (E) or U+0065 LATIN SMALL LETTER E (e),
// optionally followed by U+002D HYPHEN-MINUS (-) or U+002B PLUS SIGN (+),
// followed by a digit, then:
- if (reader.codePointSource[reader.cursor] === LATIN_SMALL_LETTER_E || reader.codePointSource[reader.cursor] === LATIN_CAPITAL_LETTER_E) {
- if (isDigitCodePoint(reader.codePointSource[reader.cursor + 1])) {
+ if (reader.source.codePointAt(reader.cursor) === LATIN_SMALL_LETTER_E || reader.source.codePointAt(reader.cursor) === LATIN_CAPITAL_LETTER_E) {
+ if (isDigitCodePoint(reader.source.codePointAt(reader.cursor + 1))) {
// 5.1. Consume them.
reader.advanceCodePoint(2);
} else if (
- (reader.codePointSource[reader.cursor + 1] === HYPHEN_MINUS || reader.codePointSource[reader.cursor + 1] === PLUS_SIGN) &&
- isDigitCodePoint(reader.codePointSource[reader.cursor + 2])
+ (reader.source.codePointAt(reader.cursor + 1) === HYPHEN_MINUS || reader.source.codePointAt(reader.cursor + 1) === PLUS_SIGN) &&
+ isDigitCodePoint(reader.source.codePointAt(reader.cursor + 2))
) {
// 5.1. Consume them.
reader.advanceCodePoint(3);
@@ -54,7 +54,7 @@ export function consumeNumber(ctx: Context, reader: CodePointReader): NumberType
type = NumberType.Number;
// 5.4. While the next input code point is a digit, consume it and append it to repr.
- while (isDigitCodePoint(reader.codePointSource[reader.cursor])) {
+ while (isDigitCodePoint(reader.source.codePointAt(reader.cursor))) {
reader.advanceCodePoint();
}
}
diff --git a/packages/css-tokenizer/src/consume/numeric-token.ts b/packages/css-tokenizer/src/consume/numeric-token.ts
index 9d1fb7a40..fb27bb1cc 100644
--- a/packages/css-tokenizer/src/consume/numeric-token.ts
+++ b/packages/css-tokenizer/src/consume/numeric-token.ts
@@ -1,8 +1,9 @@
import { checkIfThreeCodePointsWouldStartAnIdentSequence } from '../checks/three-code-points-would-start-ident-sequence';
import { HYPHEN_MINUS, PERCENTAGE_SIGN, PLUS_SIGN } from '../code-points/code-points';
-import { CodePointReader } from '../interfaces/code-point-reader';
-import { Context } from '../interfaces/context';
-import { TokenDimension, TokenNumber, TokenPercentage, TokenType } from '../interfaces/token';
+import type { CodePointReader } from '../interfaces/code-point-reader';
+import type { Context } from '../interfaces/context';
+import type { TokenDimension, TokenNumber, TokenPercentage} from '../interfaces/token';
+import { TokenType } from '../interfaces/token';
import { consumeIdentSequence } from './ident-sequence';
import { consumeNumber } from './number';
@@ -11,7 +12,7 @@ export function consumeNumericToken(ctx: Context, reader: CodePointReader): Toke
let signCharacter: undefined | '+' | '-' = undefined;
{
- const peeked = reader.codePointSource[reader.cursor];
+ const peeked = reader.source.codePointAt(reader.cursor);
if (peeked === HYPHEN_MINUS) {
signCharacter = '-';
} else if (peeked === PLUS_SIGN) {
@@ -38,7 +39,7 @@ export function consumeNumericToken(ctx: Context, reader: CodePointReader): Toke
];
}
- if (reader.codePointSource[reader.cursor] === PERCENTAGE_SIGN) {
+ if (reader.source.codePointAt(reader.cursor) === PERCENTAGE_SIGN) {
reader.advanceCodePoint();
return [
diff --git a/packages/css-tokenizer/src/consume/string-token.ts b/packages/css-tokenizer/src/consume/string-token.ts
index 27a431670..855429343 100644
--- a/packages/css-tokenizer/src/consume/string-token.ts
+++ b/packages/css-tokenizer/src/consume/string-token.ts
@@ -1,9 +1,10 @@
import { CARRIAGE_RETURN, LINE_FEED, REVERSE_SOLIDUS } from '../code-points/code-points';
import { isNewLine } from '../code-points/ranges';
-import { CodePointReader } from '../interfaces/code-point-reader';
-import { Context } from '../interfaces/context';
+import type { CodePointReader } from '../interfaces/code-point-reader';
+import type { Context } from '../interfaces/context';
import { ParseErrorWithToken, ParseErrorMessage } from '../interfaces/error';
-import { CSSToken, TokenBadString, TokenString, TokenType } from '../interfaces/token';
+import type { CSSToken, TokenBadString, TokenString} from '../interfaces/token';
+import { TokenType } from '../interfaces/token';
import { consumeEscapedCodePoint } from './escaped-code-point';
// https://www.w3.org/TR/2021/CRD-css-syntax-3-20211224/#consume-string-token
@@ -15,7 +16,7 @@ export function consumeStringToken(ctx: Context, reader: CodePointReader): Token
while (true) {
const next = reader.readCodePoint();
- if (next === false) {
+ if (typeof next === "undefined") {
const token: CSSToken = [TokenType.String, reader.source.slice(reader.representationStart, reader.representationEnd + 1), reader.representationStart, reader.representationEnd, { value: result }];
ctx.onParseError(new ParseErrorWithToken(
@@ -42,8 +43,8 @@ export function consumeStringToken(ctx: Context, reader: CodePointReader): Token
reader.representationStart,
(
(
- reader.codePointSource[reader.cursor] === CARRIAGE_RETURN &&
- reader.codePointSource[reader.cursor + 1] === LINE_FEED
+ reader.source.codePointAt(reader.cursor) === CARRIAGE_RETURN &&
+ reader.source.codePointAt(reader.cursor + 1) === LINE_FEED
) ?
// CR LF
reader.representationEnd + 2 :
@@ -65,14 +66,14 @@ export function consumeStringToken(ctx: Context, reader: CodePointReader): Token
}
if (next === REVERSE_SOLIDUS) {
- if (reader.codePointSource[reader.cursor] === undefined) {
+ if (typeof reader.source.codePointAt(reader.cursor) === "undefined") {
continue;
}
- if (isNewLine(reader.codePointSource[reader.cursor])) {
+ if (isNewLine(reader.source.codePointAt(reader.cursor))) {
if (
- reader.codePointSource[reader.cursor] === CARRIAGE_RETURN &&
- reader.codePointSource[reader.cursor + 1] === LINE_FEED
+ reader.source.codePointAt(reader.cursor) === CARRIAGE_RETURN &&
+ reader.source.codePointAt(reader.cursor + 1) === LINE_FEED
) {
reader.advanceCodePoint();
}
diff --git a/packages/css-tokenizer/src/consume/unicode-range-token.ts b/packages/css-tokenizer/src/consume/unicode-range-token.ts
index 06d4135e6..19d3c1b24 100644
--- a/packages/css-tokenizer/src/consume/unicode-range-token.ts
+++ b/packages/css-tokenizer/src/consume/unicode-range-token.ts
@@ -1,8 +1,9 @@
import { DIGIT_ZERO, HYPHEN_MINUS, LATIN_CAPITAL_LETTER_F, QUESTION_MARK } from '../code-points/code-points';
import { isHexDigitCodePoint } from '../code-points/ranges';
-import { CodePointReader } from '../interfaces/code-point-reader';
-import { Context } from '../interfaces/context';
-import { TokenType, TokenUnicodeRange } from '../interfaces/token';
+import type { CodePointReader } from '../interfaces/code-point-reader';
+import type { Context } from '../interfaces/context';
+import type { TokenUnicodeRange } from '../interfaces/token';
+import { TokenType } from '../interfaces/token';
// https://drafts.csswg.org/css-syntax/#starts-a-unicode-range
export function consumeUnicodeRangeToken(ctx: Context, reader: CodePointReader): TokenUnicodeRange {
@@ -14,12 +15,13 @@ export function consumeUnicodeRangeToken(ctx: Context, reader: CodePointReader):
// 2. Consume as many hex digits as possible,
// but no more than 6.
+ let codePoint: number | undefined;
while (
- (reader.codePointSource[reader.cursor] !== undefined) &&
+ (typeof (codePoint = reader.source.codePointAt(reader.cursor)) !== "undefined") &&
firstSegment.length < 6 &&
- isHexDigitCodePoint(reader.codePointSource[reader.cursor])
+ isHexDigitCodePoint(codePoint)
) {
- firstSegment.push(reader.codePointSource[reader.cursor]);
+ firstSegment.push(codePoint);
reader.advanceCodePoint();
}
@@ -27,9 +29,9 @@ export function consumeUnicodeRangeToken(ctx: Context, reader: CodePointReader):
// consume as many U+003F QUESTION MARK (?) code points as possible,
// but no more than enough to make the total of hex digits and U+003F QUESTION MARK (?) code points equal to 6.
while (
- (reader.codePointSource[reader.cursor] !== undefined) &&
+ (typeof (codePoint = reader.source.codePointAt(reader.cursor)) !== "undefined") &&
firstSegment.length < 6 &&
- reader.codePointSource[reader.cursor] === QUESTION_MARK
+ codePoint === QUESTION_MARK
) {
if (secondSegment.length === 0) {
secondSegment.push(...firstSegment);
@@ -46,8 +48,8 @@ export function consumeUnicodeRangeToken(ctx: Context, reader: CodePointReader):
if (!secondSegment.length) {
// 5. If the next 2 input code points are U+002D HYPHEN-MINUS (-) followed by a hex digit
if (
- reader.codePointSource[reader.cursor] === HYPHEN_MINUS &&
- isHexDigitCodePoint(reader.codePointSource[reader.cursor + 1])
+ reader.source.codePointAt(reader.cursor) === HYPHEN_MINUS &&
+ isHexDigitCodePoint(reader.source.codePointAt(reader.cursor + 1))
) {
// 5.1. Consume the next input code point.
reader.advanceCodePoint();
@@ -55,11 +57,11 @@ export function consumeUnicodeRangeToken(ctx: Context, reader: CodePointReader):
// 5.2 Consume as many hex digits as possible,
// but no more than 6.
while (
- (reader.codePointSource[reader.cursor] !== undefined) &&
+ (typeof (codePoint = reader.source.codePointAt(reader.cursor)) !== "undefined") &&
secondSegment.length < 6 &&
- isHexDigitCodePoint(reader.codePointSource[reader.cursor])
+ isHexDigitCodePoint(codePoint)
) {
- secondSegment.push(reader.codePointSource[reader.cursor]);
+ secondSegment.push(codePoint);
reader.advanceCodePoint();
}
}
diff --git a/packages/css-tokenizer/src/consume/url-token.ts b/packages/css-tokenizer/src/consume/url-token.ts
index 92bffdfca..bc7376d66 100644
--- a/packages/css-tokenizer/src/consume/url-token.ts
+++ b/packages/css-tokenizer/src/consume/url-token.ts
@@ -1,23 +1,24 @@
import { checkIfTwoCodePointsAreAValidEscape } from '../checks/two-code-points-are-valid-escape';
import { APOSTROPHE, LEFT_PARENTHESIS, QUOTATION_MARK, REVERSE_SOLIDUS, RIGHT_PARENTHESIS } from '../code-points/code-points';
import { isNonPrintableCodePoint, isWhitespace } from '../code-points/ranges';
-import { CodePointReader } from '../interfaces/code-point-reader';
-import { Context } from '../interfaces/context';
+import type { CodePointReader } from '../interfaces/code-point-reader';
+import type { Context } from '../interfaces/context';
import { ParseErrorWithToken, ParseErrorMessage } from '../interfaces/error';
-import { CSSToken, TokenBadURL, TokenType, TokenURL } from '../interfaces/token';
+import type { CSSToken, TokenBadURL, TokenURL } from '../interfaces/token';
+import { TokenType } from '../interfaces/token';
import { consumeBadURL } from './bad-url';
import { consumeEscapedCodePoint } from './escaped-code-point';
// https://www.w3.org/TR/2021/CRD-css-syntax-3-20211224/#consume-url-token
export function consumeUrlToken(ctx: Context, reader: CodePointReader): TokenURL|TokenBadURL {
- while (isWhitespace(reader.codePointSource[reader.cursor])) {
+ while (isWhitespace(reader.source.codePointAt(reader.cursor))) {
reader.advanceCodePoint();
}
let string = '';
while (true) {
- if (reader.codePointSource[reader.cursor] === undefined) {
+ if (typeof reader.source.codePointAt(reader.cursor) === "undefined") {
const token: CSSToken = [
TokenType.URL,
reader.source.slice(reader.representationStart, reader.representationEnd + 1),
@@ -42,7 +43,7 @@ export function consumeUrlToken(ctx: Context, reader: CodePointReader): TokenURL
return token;
}
- if (reader.codePointSource[reader.cursor] === RIGHT_PARENTHESIS) {
+ if (reader.source.codePointAt(reader.cursor) === RIGHT_PARENTHESIS) {
reader.advanceCodePoint();
return [
TokenType.URL,
@@ -55,13 +56,13 @@ export function consumeUrlToken(ctx: Context, reader: CodePointReader): TokenURL
];
}
- if (isWhitespace(reader.codePointSource[reader.cursor])) {
+ if (isWhitespace(reader.source.codePointAt(reader.cursor))) {
reader.advanceCodePoint();
- while (isWhitespace(reader.codePointSource[reader.cursor])) {
+ while (isWhitespace(reader.source.codePointAt(reader.cursor))) {
reader.advanceCodePoint();
}
- if (reader.codePointSource[reader.cursor] === undefined) {
+ if (typeof reader.source.codePointAt(reader.cursor) === "undefined") {
const token: CSSToken = [
TokenType.URL,
reader.source.slice(reader.representationStart, reader.representationEnd + 1),
@@ -87,7 +88,7 @@ export function consumeUrlToken(ctx: Context, reader: CodePointReader): TokenURL
return token;
}
- if (reader.codePointSource[reader.cursor] === RIGHT_PARENTHESIS) {
+ if (reader.source.codePointAt(reader.cursor) === RIGHT_PARENTHESIS) {
reader.advanceCodePoint();
return [
TokenType.URL,
@@ -110,7 +111,8 @@ export function consumeUrlToken(ctx: Context, reader: CodePointReader): TokenURL
];
}
- if (reader.codePointSource[reader.cursor] === QUOTATION_MARK || reader.codePointSource[reader.cursor] === APOSTROPHE || reader.codePointSource[reader.cursor] === LEFT_PARENTHESIS || isNonPrintableCodePoint(reader.codePointSource[reader.cursor])) {
+ const codePoint = reader.source.codePointAt(reader.cursor);
+ if (codePoint === QUOTATION_MARK || codePoint === APOSTROPHE || codePoint === LEFT_PARENTHESIS || isNonPrintableCodePoint(codePoint)) {
consumeBadURL(ctx, reader);
const token: CSSToken = [
@@ -135,7 +137,7 @@ export function consumeUrlToken(ctx: Context, reader: CodePointReader): TokenURL
return token;
}
- if (reader.codePointSource[reader.cursor] === REVERSE_SOLIDUS) {
+ if (codePoint === REVERSE_SOLIDUS) {
if (checkIfTwoCodePointsAreAValidEscape(reader)) {
reader.advanceCodePoint();
string = string + String.fromCodePoint(consumeEscapedCodePoint(ctx, reader));
@@ -167,7 +169,7 @@ export function consumeUrlToken(ctx: Context, reader: CodePointReader): TokenURL
return token;
}
- string = string + String.fromCodePoint(reader.codePointSource[reader.cursor]);
+ string = string + reader.source[reader.cursor];
reader.advanceCodePoint();
}
}
diff --git a/packages/css-tokenizer/src/consume/whitespace-token.ts b/packages/css-tokenizer/src/consume/whitespace-token.ts
index 8351db768..f3b80d84e 100644
--- a/packages/css-tokenizer/src/consume/whitespace-token.ts
+++ b/packages/css-tokenizer/src/consume/whitespace-token.ts
@@ -1,9 +1,10 @@
import { isWhitespace } from '../code-points/ranges';
-import { CodePointReader } from '../interfaces/code-point-reader';
-import { TokenType, TokenWhitespace } from '../interfaces/token';
+import type { CodePointReader } from '../interfaces/code-point-reader';
+import type { TokenWhitespace } from '../interfaces/token';
+import { TokenType } from '../interfaces/token';
export function consumeWhiteSpace(reader: CodePointReader): TokenWhitespace {
- while (isWhitespace(reader.codePointSource[reader.cursor])) {
+ while (isWhitespace(reader.source.codePointAt(reader.cursor))) {
reader.advanceCodePoint();
}
diff --git a/packages/css-tokenizer/src/index.ts b/packages/css-tokenizer/src/index.ts
index f2cbe55ba..c28cc7fd9 100644
--- a/packages/css-tokenizer/src/index.ts
+++ b/packages/css-tokenizer/src/index.ts
@@ -29,9 +29,7 @@
*
* @packageDocumentation
*/
-export type { CodePointReader } from './interfaces/code-point-reader';
export { ParseError, ParseErrorWithToken, ParseErrorMessage } from './interfaces/error';
-export { Reader } from './reader';
export { cloneTokens } from './util/clone-tokens';
export { stringify } from './stringify';
export { tokenize, tokenizer } from './tokenizer';
diff --git a/packages/css-tokenizer/src/interfaces/code-point-reader.ts b/packages/css-tokenizer/src/interfaces/code-point-reader.ts
index f025ada5d..01e1f4810 100644
--- a/packages/css-tokenizer/src/interfaces/code-point-reader.ts
+++ b/packages/css-tokenizer/src/interfaces/code-point-reader.ts
@@ -6,12 +6,10 @@ export type CodePointReader = {
representationEnd: number;
cursor: number;
- codePointSource: Array;
- representationIndices: Array;
source: string;
advanceCodePoint(n?: number): void
- readCodePoint(n?: number): number | false
+ readCodePoint(): number | undefined
unreadCodePoint(n?: number): void
resetRepresentation(): void
}
diff --git a/packages/css-tokenizer/src/interfaces/context.ts b/packages/css-tokenizer/src/interfaces/context.ts
index 6a2b523b1..fad4193a8 100644
--- a/packages/css-tokenizer/src/interfaces/context.ts
+++ b/packages/css-tokenizer/src/interfaces/context.ts
@@ -1,4 +1,4 @@
-import { ParseError } from './error';
+import type { ParseError } from './error';
export type Context = {
onParseError: (error: ParseError) => void
diff --git a/packages/css-tokenizer/src/interfaces/error.ts b/packages/css-tokenizer/src/interfaces/error.ts
index 717db2999..d6632c01f 100644
--- a/packages/css-tokenizer/src/interfaces/error.ts
+++ b/packages/css-tokenizer/src/interfaces/error.ts
@@ -1,4 +1,4 @@
-import { CSSToken } from "./token";
+import type { CSSToken } from "./token";
/**
* The CSS Tokenizer is forgiving and will never throw on invalid input.
diff --git a/packages/css-tokenizer/src/reader.ts b/packages/css-tokenizer/src/reader.ts
index ffcfc02fd..8a8d44986 100644
--- a/packages/css-tokenizer/src/reader.ts
+++ b/packages/css-tokenizer/src/reader.ts
@@ -1,4 +1,4 @@
-import { CodePointReader } from './interfaces/code-point-reader';
+import type { CodePointReader } from './interfaces/code-point-reader';
/**
* @internal
@@ -6,58 +6,40 @@ import { CodePointReader } from './interfaces/code-point-reader';
export class Reader implements CodePointReader {
cursor = 0;
source = '';
- codePointSource: Array = [];
- representationIndices: Array = [-1];
- length = 0;
representationStart = 0;
representationEnd = -1;
constructor(source: string) {
this.source = source;
-
- {
- let representationEnd = -1;
- let codePoint = '';
-
- for (codePoint of source) {
- representationEnd += codePoint.length;
-
- // eslint-disable-next-line @typescript-eslint/no-non-null-assertion
- this.codePointSource.push(codePoint.codePointAt(0)!);
- this.representationIndices.push(representationEnd);
- }
- }
-
- this.length = this.codePointSource.length;
}
advanceCodePoint(n = 1): void {
this.cursor = this.cursor + n;
- this.representationEnd = this.representationIndices[this.cursor];
+ this.representationEnd = this.cursor - 1;
}
- readCodePoint(n = 1): number | false {
- const codePoint = this.codePointSource[this.cursor];
- if (codePoint === undefined) {
- return false;
+ readCodePoint(): number | undefined {
+ const codePoint = this.source.codePointAt(this.cursor);
+ if (typeof codePoint === "undefined") {
+ return undefined;
}
- this.cursor = this.cursor + n;
- this.representationEnd = this.representationIndices[this.cursor];
+ this.cursor = this.cursor + 1;
+ this.representationEnd = this.cursor - 1;
return codePoint;
}
unreadCodePoint(n = 1): void {
this.cursor = this.cursor - n;
- this.representationEnd = this.representationIndices[this.cursor];
+ this.representationEnd = this.cursor - 1;
return;
}
resetRepresentation(): void {
- this.representationStart = this.representationIndices[this.cursor] + 1;
+ this.representationStart = this.cursor;
this.representationEnd = -1;
}
}
diff --git a/packages/css-tokenizer/src/tokenizer.ts b/packages/css-tokenizer/src/tokenizer.ts
index c3444a05a..d28b21684 100644
--- a/packages/css-tokenizer/src/tokenizer.ts
+++ b/packages/css-tokenizer/src/tokenizer.ts
@@ -10,12 +10,14 @@ import { consumeHashToken } from './consume/hash-token';
import { consumeIdentSequence } from './consume/ident-sequence';
import { consumeNumericToken } from './consume/numeric-token';
import { consumeWhiteSpace } from './consume/whitespace-token';
-import { CSSToken, TokenType } from './interfaces/token';
+import type { CSSToken} from './interfaces/token';
+import { TokenType } from './interfaces/token';
import { Reader } from './reader';
import { consumeStringToken } from './consume/string-token';
import { consumeIdentLikeToken } from './consume/ident-like-token';
import { checkIfTwoCodePointsAreAValidEscape } from './checks/two-code-points-are-valid-escape';
-import { ParseError, ParseErrorMessage, ParseErrorWithToken } from './interfaces/error';
+import type { ParseError} from './interfaces/error';
+import { ParseErrorMessage, ParseErrorWithToken } from './interfaces/error';
import { checkIfThreeCodePointsWouldStartAUnicodeRange } from './checks/three-code-points-would-start-unicode-range';
import { consumeUnicodeRangeToken } from './consume/unicode-range-token';
@@ -76,14 +78,14 @@ export function tokenizer(
};
function endOfFile(): boolean {
- return reader.codePointSource[reader.cursor] === undefined;
+ return typeof reader.source.codePointAt(reader.cursor) === "undefined";
}
function nextToken(): CSSToken | undefined {
reader.resetRepresentation();
- const peeked = reader.codePointSource[reader.cursor];
- if (peeked === undefined) {
+ const peeked = reader.source.codePointAt(reader.cursor);
+ if (typeof peeked === "undefined") {
return [TokenType.EOF, '', -1, -1, undefined];
}
diff --git a/packages/css-tokenizer/src/util/clone-tokens.ts b/packages/css-tokenizer/src/util/clone-tokens.ts
index 8a9a47702..b78a15e76 100644
--- a/packages/css-tokenizer/src/util/clone-tokens.ts
+++ b/packages/css-tokenizer/src/util/clone-tokens.ts
@@ -1,4 +1,4 @@
-import { CSSToken } from '../interfaces/token';
+import type { CSSToken } from '../interfaces/token';
const supportsStructuredClone = (typeof globalThis !== 'undefined') && 'structuredClone' in globalThis;
diff --git a/packages/css-tokenizer/src/util/mutations.ts b/packages/css-tokenizer/src/util/mutations.ts
index feb2f310d..f42b5724b 100644
--- a/packages/css-tokenizer/src/util/mutations.ts
+++ b/packages/css-tokenizer/src/util/mutations.ts
@@ -1,6 +1,6 @@
import { HYPHEN_MINUS } from '../code-points/code-points';
import { isHexDigitCodePoint, isIdentCodePoint, isIdentStartCodePoint } from '../code-points/ranges';
-import { TokenDimension, TokenIdent } from '../interfaces/token';
+import type { TokenDimension, TokenIdent } from '../interfaces/token';
/**
* Set the ident value and update the string representation.
diff --git a/packages/css-tokenizer/src/util/type-predicates.ts b/packages/css-tokenizer/src/util/type-predicates.ts
index 564612ef4..bb04b6ec9 100644
--- a/packages/css-tokenizer/src/util/type-predicates.ts
+++ b/packages/css-tokenizer/src/util/type-predicates.ts
@@ -1,4 +1,5 @@
-import { CSSToken, NumericToken, TokenAtKeyword, TokenBadString, TokenBadURL, TokenCDC, TokenCDO, TokenCloseCurly, TokenCloseParen, TokenCloseSquare, TokenColon, TokenComma, TokenComment, TokenDelim, TokenDimension, TokenEOF, TokenFunction, TokenHash, TokenIdent, TokenNumber, TokenOpenCurly, TokenOpenParen, TokenOpenSquare, TokenPercentage, TokenSemicolon, TokenString, TokenType, TokenURL, TokenUnicodeRange, TokenWhitespace } from '../interfaces/token';
+import type { CSSToken, NumericToken, TokenAtKeyword, TokenBadString, TokenBadURL, TokenCDC, TokenCDO, TokenCloseCurly, TokenCloseParen, TokenCloseSquare, TokenColon, TokenComma, TokenComment, TokenDelim, TokenDimension, TokenEOF, TokenFunction, TokenHash, TokenIdent, TokenNumber, TokenOpenCurly, TokenOpenParen, TokenOpenSquare, TokenPercentage, TokenSemicolon, TokenString, TokenURL, TokenUnicodeRange, TokenWhitespace } from '../interfaces/token';
+import { TokenType } from '../interfaces/token';
const tokenTypes = Object.values(TokenType);
diff --git a/packages/css-tokenizer/test/code-points/code-points.mjs b/packages/css-tokenizer/test/code-points/code-points.mjs
index aed09cdb7..7575a15bb 100644
--- a/packages/css-tokenizer/test/code-points/code-points.mjs
+++ b/packages/css-tokenizer/test/code-points/code-points.mjs
@@ -1,5 +1,5 @@
import { tokenizer } from '@csstools/css-tokenizer';
-import assert from 'assert';
+import assert from 'node:assert';
import { collectTokens } from '../util/collect-tokens.mjs';
// Single characters
diff --git a/packages/css-tokenizer/test/code-points/ranges.mjs b/packages/css-tokenizer/test/code-points/ranges.mjs
index fd20a5147..6ef567012 100644
--- a/packages/css-tokenizer/test/code-points/ranges.mjs
+++ b/packages/css-tokenizer/test/code-points/ranges.mjs
@@ -1,5 +1,5 @@
import { tokenizer, tokenize, mutateIdent } from '@csstools/css-tokenizer';
-import assert from 'assert';
+import assert from 'node:assert';
import { collectTokens } from '../util/collect-tokens.mjs';
// Single characters
diff --git a/packages/css-tokenizer/test/community/bootstrap-benchmark.mjs b/packages/css-tokenizer/test/community/bootstrap-benchmark.mjs
index 6e9f14588..309d7605a 100644
--- a/packages/css-tokenizer/test/community/bootstrap-benchmark.mjs
+++ b/packages/css-tokenizer/test/community/bootstrap-benchmark.mjs
@@ -1,6 +1,6 @@
import { tokenizer, TokenType } from '@csstools/css-tokenizer';
import postcssTokenizer from 'postcss/lib/tokenize';
-import fs from 'fs';
+import fs from 'node:fs';
function logResults(label, tokenStreamLength, results) {
console.log(`-------------- ${label} -------------`);
@@ -353,61 +353,61 @@ postcssLargeSource();
// Last result:
// -------------- csstools tokenizer -------------
// tokens 43
-// tokens/μs @ 95th 129.1941776504298
-// tokens/μs @ 50th 172.09453435114503
-// tokens/μs @ 5th 257.6501028571429
+// tokens/μs @ 95th 2.224176278900998
+// tokens/μs @ 50th 9.92384029540142
+// tokens/μs @ 5th 11.862068965518729
// -----------------------------------------------
-// 95th 0.00033283233642578125
-// 50th 0.0002498626708984375
-// 5th 0.00016689300537109375
-// deviation 0.0001659393310546875
+// 95th 0.019333000000003153
+// 50th 0.004333000000002585
+// 5th 0.0036249999999995453
+// deviation 0.015708000000003608
// -------------- postcss tokenizer -------------
// tokens 24
-// tokens/μs @ 95th 192.10552671755724
-// tokens/μs @ 50th 192.10552671755724
-// tokens/μs @ 5th 289.2623448275862
+// tokens/μs @ 95th 4.500281267579009
+// tokens/μs @ 50th 16.937191249075372
+// tokens/μs @ 5th 17.454545454597408
// -----------------------------------------------
-// 95th 0.00012493133544921875
-// 50th 0.00012493133544921875
-// 5th 0.00008296966552734375
-// deviation 0.000041961669921875
+// 95th 0.005333000000000254
+// 50th 0.0014170000000035543
+// 5th 0.0013749999999959073
+// deviation 0.003958000000004347
// -------------- csstools tokenizer -------------
-// tokens 252
-// tokens/μs @ 95th 2.715778269963052
-// tokens/μs @ 50th 14.788099280857375
-// tokens/μs @ 5th 17.58149985029442
+// tokens 254
+// tokens/μs @ 95th 4.452859296657837
+// tokens/μs @ 50th 8.7333241644877
+// tokens/μs @ 5th 9.600120946403736
// -----------------------------------------------
-// 95th 0.09279108047485352
-// 50th 0.017040729522705078
-// 5th 0.014333248138427734
-// deviation 0.07845783233642578
+// 95th 0.05704200000000981
+// 50th 0.02908400000000455
+// 5th 0.0264580000000052
+// deviation 0.030584000000004608
// -------------- postcss tokenizer -------------
// tokens 214
-// tokens/μs @ 95th 6.8027424968168315
-// tokens/μs @ 50th 7.901659031286864
-// tokens/μs @ 5th 36.16653461197518
+// tokens/μs @ 95th 8.588858564776066
+// tokens/μs @ 50th 33.354114713209
+// tokens/μs @ 5th 36.42553191496199
// -----------------------------------------------
-// 95th 0.03145790100097656
-// 50th 0.02708292007446289
-// 5th 0.005917072296142578
-// deviation 0.025540828704833984
+// 95th 0.0249160000000046
+// 50th 0.006416000000001532
+// 5th 0.005874999999988972
+// deviation 0.01904100000001563
// -------------- csstools tokenizer -------------
-// tokens 87701
-// tokens/μs @ 95th 10.659602521712898
-// tokens/μs @ 50th 13.135529246644223
-// tokens/μs @ 5th 13.474753513157573
+// tokens 87709
+// tokens/μs @ 95th 9.569123769860967
+// tokens/μs @ 50th 9.760582022651974
+// tokens/μs @ 5th 9.936257012018164
// -----------------------------------------------
-// 95th 8.227417469024658
-// 50th 6.676624774932861
-// 5th 6.508542060852051
-// deviation 1.7188754081726074
+// 95th 9.165834000000018
+// 50th 8.986042000000452
+// 5th 8.827166999999463
+// deviation 0.33866700000055516
// -------------- postcss tokenizer -------------
// tokens 66238
-// tokens/μs @ 95th 18.231267325170737
-// tokens/μs @ 50th 25.111551990929474
-// tokens/μs @ 5th 26.735369993583255
+// tokens/μs @ 95th 23.904005774083252
+// tokens/μs @ 50th 30.075140175537726
+// tokens/μs @ 5th 30.758300441137337
// -----------------------------------------------
-// 95th 3.633208751678467
-// 50th 2.6377501487731934
-// 5th 2.477541923522949
-// deviation 1.1556668281555176
+// 95th 2.7710000000006403
+// 50th 2.2024170000004233
+// 5th 2.1535000000003492
+// deviation 0.617500000000291
diff --git a/packages/css-tokenizer/test/community/bootstrap.mjs b/packages/css-tokenizer/test/community/bootstrap.mjs
index ef70430b6..564aed97d 100644
--- a/packages/css-tokenizer/test/community/bootstrap.mjs
+++ b/packages/css-tokenizer/test/community/bootstrap.mjs
@@ -1,5 +1,5 @@
import { tokenizer, TokenType } from '@csstools/css-tokenizer';
-import fs from 'fs';
+import fs from 'node:fs';
{
const source = fs.readFileSync('./test/community/bootstrap.css').toString();
diff --git a/packages/css-tokenizer/test/community/open-props.mjs b/packages/css-tokenizer/test/community/open-props.mjs
index 3c605fa74..4bb2f91cc 100644
--- a/packages/css-tokenizer/test/community/open-props.mjs
+++ b/packages/css-tokenizer/test/community/open-props.mjs
@@ -1,5 +1,5 @@
import { tokenizer, TokenType } from '@csstools/css-tokenizer';
-import fs from 'fs';
+import fs from 'node:fs';
{
const source = fs.readFileSync('./test/community/open-props.css').toString();
diff --git a/packages/css-tokenizer/test/community/postcss-parser-tests.mjs b/packages/css-tokenizer/test/community/postcss-parser-tests.mjs
index 5936a65e9..c2109c78e 100644
--- a/packages/css-tokenizer/test/community/postcss-parser-tests.mjs
+++ b/packages/css-tokenizer/test/community/postcss-parser-tests.mjs
@@ -1,5 +1,5 @@
import { eachTest } from 'postcss-parser-tests';
-import assert from 'assert';
+import assert from 'node:assert';
import { tokenizer, stringify, TokenType } from '@csstools/css-tokenizer';
eachTest((name, css) => {
diff --git a/packages/css-tokenizer/test/community/token-types.mjs b/packages/css-tokenizer/test/community/token-types.mjs
index 0b4724757..1a6afac7b 100644
--- a/packages/css-tokenizer/test/community/token-types.mjs
+++ b/packages/css-tokenizer/test/community/token-types.mjs
@@ -1,7 +1,7 @@
import { tokenizer, TokenType } from '@csstools/css-tokenizer';
import postcssTokenizer from 'postcss/lib/tokenize';
-import assert from 'assert';
-import fs from 'fs';
+import assert from 'node:assert';
+import fs from 'node:fs';
const bootstrapSource = fs.readFileSync('./test/community/bootstrap.css').toString();
const openPropsSource = fs.readFileSync('./test/community/open-props.css').toString();
diff --git a/packages/css-tokenizer/test/complex/at-media-params.mjs b/packages/css-tokenizer/test/complex/at-media-params.mjs
index 845a2bc8f..74b005d57 100644
--- a/packages/css-tokenizer/test/complex/at-media-params.mjs
+++ b/packages/css-tokenizer/test/complex/at-media-params.mjs
@@ -1,5 +1,5 @@
import { tokenizer } from '@csstools/css-tokenizer';
-import assert from 'assert';
+import assert from 'node:assert';
import { collectTokens } from '../util/collect-tokens.mjs';
{
diff --git a/packages/css-tokenizer/test/complex/parse-error.mjs b/packages/css-tokenizer/test/complex/parse-error.mjs
index 20ec7ee0d..4d1e65d58 100644
--- a/packages/css-tokenizer/test/complex/parse-error.mjs
+++ b/packages/css-tokenizer/test/complex/parse-error.mjs
@@ -1,5 +1,5 @@
import { tokenizer, TokenType } from '@csstools/css-tokenizer';
-import assert from 'assert';
+import assert from 'node:assert';
{
const parseErrors = [];
diff --git a/packages/css-tokenizer/test/css-tokenizer-tests/test.mjs b/packages/css-tokenizer/test/css-tokenizer-tests/test.mjs
index 363c8c8f4..d8b916916 100644
--- a/packages/css-tokenizer/test/css-tokenizer-tests/test.mjs
+++ b/packages/css-tokenizer/test/css-tokenizer-tests/test.mjs
@@ -1,4 +1,4 @@
-import assert from 'assert';
+import assert from 'node:assert';
import { collectTokens } from '../util/collect-tokens.mjs';
import { testCorpus } from '@rmenke/css-tokenizer-tests';
import { tokenizer } from '@csstools/css-tokenizer';
diff --git a/packages/css-tokenizer/test/mutations/dimension.mjs b/packages/css-tokenizer/test/mutations/dimension.mjs
index 35edd494e..6a8a34614 100644
--- a/packages/css-tokenizer/test/mutations/dimension.mjs
+++ b/packages/css-tokenizer/test/mutations/dimension.mjs
@@ -1,4 +1,4 @@
-import assert from 'assert';
+import assert from 'node:assert';
import { collectTokens } from '../util/collect-tokens.mjs';
import { mutateUnit, tokenizer, stringify } from '@csstools/css-tokenizer';
diff --git a/packages/css-tokenizer/test/mutations/ident.mjs b/packages/css-tokenizer/test/mutations/ident.mjs
index bdfe5b686..6984ca28e 100644
--- a/packages/css-tokenizer/test/mutations/ident.mjs
+++ b/packages/css-tokenizer/test/mutations/ident.mjs
@@ -1,4 +1,4 @@
-import assert from 'assert';
+import assert from 'node:assert';
import { collectTokens } from '../util/collect-tokens.mjs';
import { mutateIdent, tokenizer, stringify } from '@csstools/css-tokenizer';
diff --git a/packages/css-tokenizer/test/test-reader.mjs b/packages/css-tokenizer/test/test-reader.mjs
deleted file mode 100644
index fba5cb4d8..000000000
--- a/packages/css-tokenizer/test/test-reader.mjs
+++ /dev/null
@@ -1,225 +0,0 @@
-import assert from 'assert';
-import { Reader } from '@csstools/css-tokenizer';
-
-{
- const r = new Reader('abc👨👨👧👦d');
-
- {
- const peeked = r.codePointSource[r.cursor];
- assert.deepEqual(
- peeked,
- 97,
- );
-
- assert.deepEqual(
- String.fromCodePoint(peeked),
- 'a',
- );
-
- assert.deepEqual(
- [
- r.representationStart,
- r.representationEnd,
- ],
- [
- 0,
- -1,
- ],
- );
- }
-
- {
- const peeked = [
- r.codePointSource[r.cursor],
- r.codePointSource[r.cursor+1],
- ];
- assert.deepEqual(
- peeked,
- [97, 98],
- );
-
- assert.deepEqual(
- String.fromCodePoint(peeked[0]),
- 'a',
- );
-
- assert.deepEqual(
- String.fromCodePoint(peeked[1]),
- 'b',
- );
-
- assert.deepEqual(
- [
- r.representationStart,
- r.representationEnd,
- ],
- [
- 0,
- -1,
- ],
- );
- }
-
- {
- const peeked = [
- r.codePointSource[r.cursor],
- r.codePointSource[r.cursor+1],
- r.codePointSource[r.cursor+2],
- ];
- assert.deepEqual(
- peeked,
- [97, 98, 99],
- );
-
- assert.deepEqual(
- String.fromCodePoint(peeked[0]),
- 'a',
- );
-
- assert.deepEqual(
- String.fromCodePoint(peeked[1]),
- 'b',
- );
-
- assert.deepEqual(
- String.fromCodePoint(peeked[2]),
- 'c',
- );
-
- assert.deepEqual(
- [
- r.representationStart,
- r.representationEnd,
- ],
- [
- 0,
- -1,
- ],
- );
- }
-
- {
- const read = r.readCodePoint();
- assert.deepEqual(
- read,
- 97,
- );
-
- assert.deepEqual(
- String.fromCodePoint(read),
- 'a',
- );
-
- assert.deepEqual(
- [
- r.representationStart,
- r.representationEnd,
- ],
- [
- 0,
- 0,
- ],
- );
-
- assert.deepEqual(
- r.source.slice(r.representationStart, r.representationEnd + 1),
- 'a',
- );
- }
-
- r.representationStart = r.cursor;
- r.representationEnd = -1;
-
- {
- const read1 = r.readCodePoint();
- assert.deepEqual(
- read1,
- 98,
- );
-
- const read2 = r.readCodePoint();
- assert.deepEqual(
- read2,
- 99,
- );
-
- const read3 = r.readCodePoint();
- assert.deepEqual(
- read3,
- 128104,
- );
-
- assert.deepEqual(
- String.fromCodePoint(read3),
- '👨',
- );
-
- const read4 = r.readCodePoint();
- assert.deepEqual(
- read4,
- 8205,
- );
-
- assert.deepEqual(
- String.fromCodePoint(read4),
- '',
- );
-
- assert.deepEqual(
- [
- r.representationStart,
- r.representationEnd,
- ],
- [
- 1,
- 5,
- ],
- );
-
- // Read to the end
- r.readCodePoint();
- r.readCodePoint();
- r.readCodePoint();
- r.readCodePoint();
- r.readCodePoint();
- r.readCodePoint();
-
- assert.deepEqual(
- [
- r.representationStart,
- r.representationEnd,
- ],
- [
- 1,
- 14,
- ],
- );
-
- assert.deepEqual(
- r.source.slice(r.representationStart, r.representationEnd + 1),
- 'bc👨👨👧👦d',
- );
-
- {
- // Reader should be exhausted.
- // Extra reads do not change the representation.
-
- r.readCodePoint();
- assert.deepEqual(
- [
- r.representationStart,
- r.representationEnd,
- ],
- [
- 1,
- 14,
- ],
- );
-
- assert.deepEqual(
- r.source.slice(r.representationStart, r.representationEnd + 1),
- 'bc👨👨👧👦d',
- );
- }
- }
-}
diff --git a/packages/css-tokenizer/test/test-stringify.mjs b/packages/css-tokenizer/test/test-stringify.mjs
index d0b0362c1..a8ed7d7e0 100644
--- a/packages/css-tokenizer/test/test-stringify.mjs
+++ b/packages/css-tokenizer/test/test-stringify.mjs
@@ -1,4 +1,4 @@
-import assert from 'assert';
+import assert from 'node:assert';
import { stringify } from 'querystring';
{
diff --git a/packages/css-tokenizer/test/test.mjs b/packages/css-tokenizer/test/test.mjs
index 551ef4ea6..9c5dafb72 100644
--- a/packages/css-tokenizer/test/test.mjs
+++ b/packages/css-tokenizer/test/test.mjs
@@ -1,6 +1,3 @@
-// Reader
-import './test-reader.mjs';
-
// Code points
import './code-points/code-points.mjs';
import './code-points/ranges.mjs';
diff --git a/packages/css-tokenizer/test/token/basic.mjs b/packages/css-tokenizer/test/token/basic.mjs
index c3c0e4f51..32099d6b0 100644
--- a/packages/css-tokenizer/test/token/basic.mjs
+++ b/packages/css-tokenizer/test/token/basic.mjs
@@ -1,5 +1,5 @@
import { tokenizer, tokenize } from '@csstools/css-tokenizer';
-import assert from 'assert';
+import assert from 'node:assert';
import { collectTokens } from '../util/collect-tokens.mjs';
{
diff --git a/packages/css-tokenizer/test/token/cdo.mjs b/packages/css-tokenizer/test/token/cdo.mjs
index 583ab18f3..b828a0467 100644
--- a/packages/css-tokenizer/test/token/cdo.mjs
+++ b/packages/css-tokenizer/test/token/cdo.mjs
@@ -1,5 +1,5 @@
import { tokenizer } from '@csstools/css-tokenizer';
-import assert from 'assert';
+import assert from 'node:assert';
import { collectTokens } from '../util/collect-tokens.mjs';
{
diff --git a/packages/css-tokenizer/test/token/comment.mjs b/packages/css-tokenizer/test/token/comment.mjs
index eb7253b81..ae882be7c 100644
--- a/packages/css-tokenizer/test/token/comment.mjs
+++ b/packages/css-tokenizer/test/token/comment.mjs
@@ -1,5 +1,5 @@
import { tokenizer } from '@csstools/css-tokenizer';
-import assert from 'assert';
+import assert from 'node:assert';
import { collectTokens } from '../util/collect-tokens.mjs';
{
diff --git a/packages/css-tokenizer/test/token/is-token.mjs b/packages/css-tokenizer/test/token/is-token.mjs
index 997173119..e97189c8d 100644
--- a/packages/css-tokenizer/test/token/is-token.mjs
+++ b/packages/css-tokenizer/test/token/is-token.mjs
@@ -1,4 +1,4 @@
-import assert from 'assert';
+import assert from 'node:assert';
import { isToken, NumberType, TokenType } from '@csstools/css-tokenizer';
assert.ok(isToken([TokenType.Number, (3).toString(), -1, -1, { value: 3, type: NumberType.Number }]));
diff --git a/packages/css-tokenizer/test/token/numeric.mjs b/packages/css-tokenizer/test/token/numeric.mjs
index 6bf8bd61b..f04c989e6 100644
--- a/packages/css-tokenizer/test/token/numeric.mjs
+++ b/packages/css-tokenizer/test/token/numeric.mjs
@@ -1,5 +1,5 @@
import { tokenizer } from '@csstools/css-tokenizer';
-import assert from 'assert';
+import assert from 'node:assert';
import { collectTokens } from '../util/collect-tokens.mjs';
{
diff --git a/packages/css-tokenizer/test/token/string.mjs b/packages/css-tokenizer/test/token/string.mjs
index 1b277fb55..fb71193a3 100644
--- a/packages/css-tokenizer/test/token/string.mjs
+++ b/packages/css-tokenizer/test/token/string.mjs
@@ -1,5 +1,5 @@
import { tokenizer } from '@csstools/css-tokenizer';
-import assert from 'assert';
+import assert from 'node:assert';
import { collectTokens } from '../util/collect-tokens.mjs';
{
diff --git a/packages/css-tokenizer/test/token/unicode-range.mjs b/packages/css-tokenizer/test/token/unicode-range.mjs
index b40ded2de..f0e9791c3 100644
--- a/packages/css-tokenizer/test/token/unicode-range.mjs
+++ b/packages/css-tokenizer/test/token/unicode-range.mjs
@@ -1,5 +1,5 @@
import { tokenizer } from '@csstools/css-tokenizer';
-import assert from 'assert';
+import assert from 'node:assert';
import { collectTokens } from '../util/collect-tokens.mjs';
// Sanity check without the additional flag
diff --git a/packages/css-tokenizer/test/token/url.mjs b/packages/css-tokenizer/test/token/url.mjs
index cf0b1065b..89f1c143a 100644
--- a/packages/css-tokenizer/test/token/url.mjs
+++ b/packages/css-tokenizer/test/token/url.mjs
@@ -1,7 +1,7 @@
import { tokenizer } from '@csstools/css-tokenizer';
-import assert from 'assert';
+import assert from 'node:assert';
import { collectTokens } from '../util/collect-tokens.mjs';
-import fs from 'fs';
+import fs from 'node:fs';
{
const t = tokenizer({
diff --git a/packages/css-tokenizer/test/wpt/cdc-vs-ident-tokens.mjs b/packages/css-tokenizer/test/wpt/cdc-vs-ident-tokens.mjs
index 4564ec19a..5ef0acf77 100644
--- a/packages/css-tokenizer/test/wpt/cdc-vs-ident-tokens.mjs
+++ b/packages/css-tokenizer/test/wpt/cdc-vs-ident-tokens.mjs
@@ -1,5 +1,5 @@
import { tokenizer } from '@csstools/css-tokenizer';
-import assert from 'assert';
+import assert from 'node:assert';
import { collectTokens } from '../util/collect-tokens.mjs';
{
diff --git a/packages/css-tokenizer/test/wpt/decimal-points-in-numbers.mjs b/packages/css-tokenizer/test/wpt/decimal-points-in-numbers.mjs
index 3e89ed2bc..36df080dd 100644
--- a/packages/css-tokenizer/test/wpt/decimal-points-in-numbers.mjs
+++ b/packages/css-tokenizer/test/wpt/decimal-points-in-numbers.mjs
@@ -1,5 +1,5 @@
import { tokenizer } from '@csstools/css-tokenizer';
-import assert from 'assert';
+import assert from 'node:assert';
import { collectTokens } from '../util/collect-tokens.mjs';
{
diff --git a/packages/css-tokenizer/test/wpt/ident-three-code-points.mjs b/packages/css-tokenizer/test/wpt/ident-three-code-points.mjs
index 278632c25..f34ba6a02 100644
--- a/packages/css-tokenizer/test/wpt/ident-three-code-points.mjs
+++ b/packages/css-tokenizer/test/wpt/ident-three-code-points.mjs
@@ -1,5 +1,5 @@
import { tokenizer } from '@csstools/css-tokenizer';
-import assert from 'assert';
+import assert from 'node:assert';
import { collectTokens } from '../util/collect-tokens.mjs';
{
diff --git a/packages/css-tokenizer/test/wpt/inclusive-ranges.mjs b/packages/css-tokenizer/test/wpt/inclusive-ranges.mjs
index 31086ac56..59dbb15af 100644
--- a/packages/css-tokenizer/test/wpt/inclusive-ranges.mjs
+++ b/packages/css-tokenizer/test/wpt/inclusive-ranges.mjs
@@ -1,5 +1,5 @@
import { tokenizer } from '@csstools/css-tokenizer';
-import assert from 'assert';
+import assert from 'node:assert';
import { collectTokens } from '../util/collect-tokens.mjs';
{
diff --git a/packages/generate-test-cases/package.json b/packages/generate-test-cases/package.json
index 87c5db0d4..0f5e44945 100644
--- a/packages/generate-test-cases/package.json
+++ b/packages/generate-test-cases/package.json
@@ -16,7 +16,7 @@
],
"private": true,
"engines": {
- "node": "^14 || ^16 || >=18"
+ "node": ">=18"
},
"type": "module",
"main": "src/index.mjs",
diff --git a/packages/generate-test-cases/src/generate.mjs b/packages/generate-test-cases/src/generate.mjs
index ea88d3e83..5b0fdfc55 100644
--- a/packages/generate-test-cases/src/generate.mjs
+++ b/packages/generate-test-cases/src/generate.mjs
@@ -1,5 +1,5 @@
-import { promises as fsp } from 'fs';
-import path from 'path';
+import fs from 'node:fs/promises';
+import path from 'node:path';
import { generateDeclarationTestCases } from './declaration.mjs';
import { generatePropertyTestCases } from './property.mjs';
import { generateSelectorClassFunctionTestCases } from './selector-class-function.mjs';
@@ -9,31 +9,31 @@ import { generateValueTestCases } from './value.mjs';
export async function generate(genType, pluginDir, seedList) {
switch (genType) {
case 'selector':
- await fsp.writeFile(path.join(pluginDir, 'test', 'generated-selector-cases.css'), seedList.map((selector) => {
+ await fs.writeFile(path.join(pluginDir, 'test', 'generated-selector-cases.css'), seedList.map((selector) => {
return generateSelectorTestCases(selector);
}).join('\n'));
break;
case 'selector-class-function':
- await fsp.writeFile(path.join(pluginDir, 'test', 'generated-selector-class-function-cases.css'), seedList.map((selector) => {
+ await fs.writeFile(path.join(pluginDir, 'test', 'generated-selector-class-function-cases.css'), seedList.map((selector) => {
return generateSelectorClassFunctionTestCases(selector);
}).join('\n'));
break;
case 'value':
- await fsp.writeFile(path.join(pluginDir, 'test', 'generated-value-cases.css'), seedList.map((value) => {
+ await fs.writeFile(path.join(pluginDir, 'test', 'generated-value-cases.css'), seedList.map((value) => {
return generateValueTestCases(value);
}).join('\n'));
break;
case 'property':
- await fsp.writeFile(path.join(pluginDir, 'test', 'generated-property-cases.css'), seedList.map((value) => {
+ await fs.writeFile(path.join(pluginDir, 'test', 'generated-property-cases.css'), seedList.map((value) => {
return generatePropertyTestCases(value);
}).join('\n'));
break;
case 'declaration':
- await fsp.writeFile(path.join(pluginDir, 'test', 'generated-declaration-cases.css'), seedList.map((pair) => {
+ await fs.writeFile(path.join(pluginDir, 'test', 'generated-declaration-cases.css'), seedList.map((pair) => {
return generateDeclarationTestCases(pair[0], pair[1]);
}).join('\n'));
break;
diff --git a/packages/generate-test-cases/src/index.mjs b/packages/generate-test-cases/src/index.mjs
index 64ab32bfb..cc8be0b75 100644
--- a/packages/generate-test-cases/src/index.mjs
+++ b/packages/generate-test-cases/src/index.mjs
@@ -1,4 +1,4 @@
-import path from 'path';
+import path from 'node:path';
import { generate } from './generate.mjs';
(async () => {
diff --git a/packages/media-query-list-parser/CHANGELOG.md b/packages/media-query-list-parser/CHANGELOG.md
index a9ee8a70b..c964a0545 100644
--- a/packages/media-query-list-parser/CHANGELOG.md
+++ b/packages/media-query-list-parser/CHANGELOG.md
@@ -1,5 +1,9 @@
# Changes to Media Query List Parser
+### Unreleased (major)
+
+- Updated: Support for Node v18+ (major).
+
### 2.1.13
_July 6, 2024_
diff --git a/packages/media-query-list-parser/dist/index.d.ts b/packages/media-query-list-parser/dist/index.d.ts
index 2869adb74..1d2c79de3 100644
--- a/packages/media-query-list-parser/dist/index.d.ts
+++ b/packages/media-query-list-parser/dist/index.d.ts
@@ -1,10 +1,10 @@
-import { ComponentValue } from '@csstools/css-parser-algorithms';
-import { ContainerNode } from '@csstools/css-parser-algorithms';
-import { CSSToken } from '@csstools/css-tokenizer';
-import { ParseError } from '@csstools/css-tokenizer';
-import { TokenColon } from '@csstools/css-tokenizer';
-import { TokenDelim } from '@csstools/css-tokenizer';
-import { TokenIdent } from '@csstools/css-tokenizer';
+import type { ComponentValue } from '@csstools/css-parser-algorithms';
+import type { ContainerNode } from '@csstools/css-parser-algorithms';
+import type { CSSToken } from '@csstools/css-tokenizer';
+import type { ParseError } from '@csstools/css-tokenizer';
+import type { TokenColon } from '@csstools/css-tokenizer';
+import type { TokenDelim } from '@csstools/css-tokenizer';
+import type { TokenIdent } from '@csstools/css-tokenizer';
export declare function cloneMediaQuery(x: T): T;
diff --git a/packages/media-query-list-parser/package.json b/packages/media-query-list-parser/package.json
index 9f9eff8b9..52c757d8b 100644
--- a/packages/media-query-list-parser/package.json
+++ b/packages/media-query-list-parser/package.json
@@ -25,7 +25,7 @@
}
],
"engines": {
- "node": "^14 || ^16 || >=18"
+ "node": ">=18"
},
"type": "module",
"main": "dist/index.cjs",
diff --git a/packages/media-query-list-parser/src/nodes/custom-media.ts b/packages/media-query-list-parser/src/nodes/custom-media.ts
index bbe7c37e0..85693239c 100644
--- a/packages/media-query-list-parser/src/nodes/custom-media.ts
+++ b/packages/media-query-list-parser/src/nodes/custom-media.ts
@@ -1,6 +1,7 @@
-import { CSSToken, isTokenIdent, isTokenWhiteSpaceOrComment, stringify, TokenType } from '@csstools/css-tokenizer';
+import type { CSSToken} from '@csstools/css-tokenizer';
+import { isTokenIdent, isTokenWhiteSpaceOrComment, stringify, TokenType } from '@csstools/css-tokenizer';
import { NodeType } from '../util/node-type';
-import { MediaQuery } from './media-query';
+import type { MediaQuery } from './media-query';
export class CustomMedia {
type = NodeType.CustomMedia;
diff --git a/packages/media-query-list-parser/src/nodes/general-enclosed.ts b/packages/media-query-list-parser/src/nodes/general-enclosed.ts
index 7efb7c228..8b7d68fb6 100644
--- a/packages/media-query-list-parser/src/nodes/general-enclosed.ts
+++ b/packages/media-query-list-parser/src/nodes/general-enclosed.ts
@@ -1,5 +1,5 @@
-import { ComponentValue, ContainerNode } from '@csstools/css-parser-algorithms';
-import { CSSToken } from '@csstools/css-tokenizer';
+import type { ComponentValue, ContainerNode } from '@csstools/css-parser-algorithms';
+import type { CSSToken } from '@csstools/css-tokenizer';
import { NodeType } from '../util/node-type';
export class GeneralEnclosed {
diff --git a/packages/media-query-list-parser/src/nodes/media-and.ts b/packages/media-query-list-parser/src/nodes/media-and.ts
index 4544a9218..817c10f47 100644
--- a/packages/media-query-list-parser/src/nodes/media-and.ts
+++ b/packages/media-query-list-parser/src/nodes/media-and.ts
@@ -1,5 +1,6 @@
-import { CSSToken, stringify } from '@csstools/css-tokenizer';
-import { MediaInParens, MediaInParensWalkerEntry, MediaInParensWalkerParent } from './media-in-parens';
+import type { CSSToken} from '@csstools/css-tokenizer';
+import { stringify } from '@csstools/css-tokenizer';
+import type { MediaInParens, MediaInParensWalkerEntry, MediaInParensWalkerParent } from './media-in-parens';
import { NodeType } from '../util/node-type';
export class MediaAnd {
diff --git a/packages/media-query-list-parser/src/nodes/media-condition-list.ts b/packages/media-query-list-parser/src/nodes/media-condition-list.ts
index cc4aef190..4d9d69fc5 100644
--- a/packages/media-query-list-parser/src/nodes/media-condition-list.ts
+++ b/packages/media-query-list-parser/src/nodes/media-condition-list.ts
@@ -1,7 +1,8 @@
-import { CSSToken, stringify } from '@csstools/css-tokenizer';
-import { MediaAnd, MediaAndWalkerEntry, MediaAndWalkerParent } from './media-and';
-import { MediaInParens } from './media-in-parens';
-import { MediaOr, MediaOrWalkerEntry, MediaOrWalkerParent } from './media-or';
+import type { CSSToken} from '@csstools/css-tokenizer';
+import { stringify } from '@csstools/css-tokenizer';
+import type { MediaAnd, MediaAndWalkerEntry, MediaAndWalkerParent } from './media-and';
+import type { MediaInParens } from './media-in-parens';
+import type { MediaOr, MediaOrWalkerEntry, MediaOrWalkerParent } from './media-or';
import { NodeType } from '../util/node-type';
import { walkerIndexGenerator } from '@csstools/css-parser-algorithms';
diff --git a/packages/media-query-list-parser/src/nodes/media-condition.ts b/packages/media-query-list-parser/src/nodes/media-condition.ts
index 8c9274f45..332bd27f7 100644
--- a/packages/media-query-list-parser/src/nodes/media-condition.ts
+++ b/packages/media-query-list-parser/src/nodes/media-condition.ts
@@ -1,7 +1,7 @@
-import { CSSToken } from '@csstools/css-tokenizer';
-import { MediaConditionListWithAnd, MediaConditionListWithAndWalkerEntry, MediaConditionListWithAndWalkerParent, MediaConditionListWithOr, MediaConditionListWithOrWalkerEntry, MediaConditionListWithOrWalkerParent } from './media-condition-list';
-import { MediaInParens } from './media-in-parens';
-import { MediaNot, MediaNotWalkerEntry, MediaNotWalkerParent } from './media-not';
+import type { CSSToken } from '@csstools/css-tokenizer';
+import type { MediaConditionListWithAnd, MediaConditionListWithAndWalkerEntry, MediaConditionListWithAndWalkerParent, MediaConditionListWithOr, MediaConditionListWithOrWalkerEntry, MediaConditionListWithOrWalkerParent } from './media-condition-list';
+import type { MediaInParens } from './media-in-parens';
+import type { MediaNot, MediaNotWalkerEntry, MediaNotWalkerParent } from './media-not';
import { NodeType } from '../util/node-type';
export class MediaCondition {
diff --git a/packages/media-query-list-parser/src/nodes/media-feature-boolean.ts b/packages/media-query-list-parser/src/nodes/media-feature-boolean.ts
index 87956e7ca..a1c38695d 100644
--- a/packages/media-query-list-parser/src/nodes/media-feature-boolean.ts
+++ b/packages/media-query-list-parser/src/nodes/media-feature-boolean.ts
@@ -1,7 +1,8 @@
-import { ComponentValue } from '@csstools/css-parser-algorithms';
-import { MediaFeatureName, parseMediaFeatureName } from './media-feature-name';
+import type { ComponentValue } from '@csstools/css-parser-algorithms';
+import type { MediaFeatureName} from './media-feature-name';
+import { parseMediaFeatureName } from './media-feature-name';
import { NodeType } from '../util/node-type';
-import { CSSToken } from '@csstools/css-tokenizer';
+import type { CSSToken } from '@csstools/css-tokenizer';
export class MediaFeatureBoolean {
type = NodeType.MediaFeatureBoolean;
diff --git a/packages/media-query-list-parser/src/nodes/media-feature-comparison.ts b/packages/media-query-list-parser/src/nodes/media-feature-comparison.ts
index 984286d85..3fa714a76 100644
--- a/packages/media-query-list-parser/src/nodes/media-feature-comparison.ts
+++ b/packages/media-query-list-parser/src/nodes/media-feature-comparison.ts
@@ -1,5 +1,7 @@
-import { ComponentValue, ComponentValueType } from '@csstools/css-parser-algorithms';
-import { CSSToken, TokenDelim, isTokenDelim } from '@csstools/css-tokenizer';
+import type { ComponentValue} from '@csstools/css-parser-algorithms';
+import { ComponentValueType } from '@csstools/css-parser-algorithms';
+import type { CSSToken, TokenDelim} from '@csstools/css-tokenizer';
+import { isTokenDelim } from '@csstools/css-tokenizer';
export enum MediaFeatureLT {
LT = '<',
diff --git a/packages/media-query-list-parser/src/nodes/media-feature-name.ts b/packages/media-query-list-parser/src/nodes/media-feature-name.ts
index d9ecb1a82..e1568aa14 100644
--- a/packages/media-query-list-parser/src/nodes/media-feature-name.ts
+++ b/packages/media-query-list-parser/src/nodes/media-feature-name.ts
@@ -1,5 +1,7 @@
-import { ComponentValue, ComponentValueType, TokenNode } from '@csstools/css-parser-algorithms';
-import { CSSToken, stringify, TokenIdent } from '@csstools/css-tokenizer';
+import type { ComponentValue, TokenNode } from '@csstools/css-parser-algorithms';
+import { ComponentValueType } from '@csstools/css-parser-algorithms';
+import type { CSSToken, TokenIdent } from '@csstools/css-tokenizer';
+import { stringify } from '@csstools/css-tokenizer';
import { isIdent } from '../util/component-value-is';
import { NodeType } from '../util/node-type';
diff --git a/packages/media-query-list-parser/src/nodes/media-feature-plain.ts b/packages/media-query-list-parser/src/nodes/media-feature-plain.ts
index f431e00cb..6a16d0f6c 100644
--- a/packages/media-query-list-parser/src/nodes/media-feature-plain.ts
+++ b/packages/media-query-list-parser/src/nodes/media-feature-plain.ts
@@ -1,7 +1,11 @@
-import { ComponentValue, ComponentValueType } from '@csstools/css-parser-algorithms';
-import { CSSToken, stringify, TokenColon } from '@csstools/css-tokenizer';
-import { parseMediaFeatureName, MediaFeatureName } from './media-feature-name';
-import { parseMediaFeatureValue, MediaFeatureValue, MediaFeatureValueWalkerEntry, MediaFeatureValueWalkerParent } from './media-feature-value';
+import type { ComponentValue} from '@csstools/css-parser-algorithms';
+import { ComponentValueType } from '@csstools/css-parser-algorithms';
+import type { CSSToken, TokenColon } from '@csstools/css-tokenizer';
+import { stringify } from '@csstools/css-tokenizer';
+import type { MediaFeatureName } from './media-feature-name';
+import { parseMediaFeatureName } from './media-feature-name';
+import type { MediaFeatureValue, MediaFeatureValueWalkerEntry, MediaFeatureValueWalkerParent } from './media-feature-value';
+import { parseMediaFeatureValue } from './media-feature-value';
import { NodeType } from '../util/node-type';
import { isTokenColon } from '@csstools/css-tokenizer';
diff --git a/packages/media-query-list-parser/src/nodes/media-feature-range.ts b/packages/media-query-list-parser/src/nodes/media-feature-range.ts
index 60429f28d..81f5593b1 100644
--- a/packages/media-query-list-parser/src/nodes/media-feature-range.ts
+++ b/packages/media-query-list-parser/src/nodes/media-feature-range.ts
@@ -1,8 +1,13 @@
-import { ComponentValue, ComponentValueType, TokenNode } from '@csstools/css-parser-algorithms';
-import { CSSToken, stringify, TokenDelim } from '@csstools/css-tokenizer';
-import { comparisonFromTokens, matchesComparison, MediaFeatureComparison, MediaFeatureEQ, MediaFeatureGT, MediaFeatureLT } from './media-feature-comparison';
-import { MediaFeatureName, parseMediaFeatureName } from './media-feature-name';
-import { MediaFeatureValue, MediaFeatureValueWalkerEntry, MediaFeatureValueWalkerParent, parseMediaFeatureValue } from './media-feature-value';
+import type { ComponentValue, TokenNode } from '@csstools/css-parser-algorithms';
+import { ComponentValueType } from '@csstools/css-parser-algorithms';
+import type { CSSToken, TokenDelim } from '@csstools/css-tokenizer';
+import { stringify } from '@csstools/css-tokenizer';
+import type { MediaFeatureComparison} from './media-feature-comparison';
+import { comparisonFromTokens, matchesComparison, MediaFeatureEQ, MediaFeatureGT, MediaFeatureLT } from './media-feature-comparison';
+import type { MediaFeatureName} from './media-feature-name';
+import { parseMediaFeatureName } from './media-feature-name';
+import type { MediaFeatureValue, MediaFeatureValueWalkerEntry, MediaFeatureValueWalkerParent} from './media-feature-value';
+import { parseMediaFeatureValue } from './media-feature-value';
import { NodeType } from '../util/node-type';
import { isTokenDelim } from '@csstools/css-tokenizer';
diff --git a/packages/media-query-list-parser/src/nodes/media-feature-value.ts b/packages/media-query-list-parser/src/nodes/media-feature-value.ts
index 5b0d50044..4f593e4b7 100644
--- a/packages/media-query-list-parser/src/nodes/media-feature-value.ts
+++ b/packages/media-query-list-parser/src/nodes/media-feature-value.ts
@@ -1,5 +1,7 @@
-import { ComponentValue, ComponentValueType, ContainerNode, isTokenNode, walkerIndexGenerator } from '@csstools/css-parser-algorithms';
-import { CSSToken, stringify } from '@csstools/css-tokenizer';
+import type { ComponentValue, ContainerNode} from '@csstools/css-parser-algorithms';
+import { ComponentValueType, isTokenNode, walkerIndexGenerator } from '@csstools/css-parser-algorithms';
+import type { CSSToken} from '@csstools/css-tokenizer';
+import { stringify } from '@csstools/css-tokenizer';
import { isDimension, isEnvironmentVariable, isIdent, isNumber } from '../util/component-value-is';
import { NodeType } from '../util/node-type';
import { isTokenDelim } from '@csstools/css-tokenizer';
diff --git a/packages/media-query-list-parser/src/nodes/media-feature.ts b/packages/media-query-list-parser/src/nodes/media-feature.ts
index 9c391079a..b243359ad 100644
--- a/packages/media-query-list-parser/src/nodes/media-feature.ts
+++ b/packages/media-query-list-parser/src/nodes/media-feature.ts
@@ -1,9 +1,13 @@
-import { SimpleBlockNode, TokenNode, parseListOfComponentValues } from '@csstools/css-parser-algorithms';
-import { CSSToken, mutateIdent, stringify, TokenType } from '@csstools/css-tokenizer';
+import type { SimpleBlockNode} from '@csstools/css-parser-algorithms';
+import { TokenNode, parseListOfComponentValues } from '@csstools/css-parser-algorithms';
+import type { CSSToken} from '@csstools/css-tokenizer';
+import { mutateIdent, stringify, TokenType } from '@csstools/css-tokenizer';
import { MediaFeatureBoolean, parseMediaFeatureBoolean } from './media-feature-boolean';
import { MediaFeatureName } from './media-feature-name';
-import { MediaFeaturePlain, MediaFeaturePlainWalkerEntry, MediaFeaturePlainWalkerParent, parseMediaFeaturePlain } from './media-feature-plain';
-import { MediaFeatureRange, MediaFeatureRangeWalkerEntry, MediaFeatureRangeWalkerParent, parseMediaFeatureRange } from './media-feature-range';
+import type { MediaFeaturePlainWalkerEntry, MediaFeaturePlainWalkerParent} from './media-feature-plain';
+import { MediaFeaturePlain, parseMediaFeaturePlain } from './media-feature-plain';
+import type { MediaFeatureRange, MediaFeatureRangeWalkerEntry, MediaFeatureRangeWalkerParent} from './media-feature-range';
+import { parseMediaFeatureRange } from './media-feature-range';
import { MediaFeatureValue } from './media-feature-value';
import { NodeType } from '../util/node-type';
import { isTokenOpenParen } from '@csstools/css-tokenizer';
diff --git a/packages/media-query-list-parser/src/nodes/media-in-parens.ts b/packages/media-query-list-parser/src/nodes/media-in-parens.ts
index e19be20c7..790c7e217 100644
--- a/packages/media-query-list-parser/src/nodes/media-in-parens.ts
+++ b/packages/media-query-list-parser/src/nodes/media-in-parens.ts
@@ -1,18 +1,19 @@
-import { ComponentValue, ContainerNode } from '@csstools/css-parser-algorithms';
-import { CSSToken, stringify } from '@csstools/css-tokenizer';
-import { GeneralEnclosed } from './general-enclosed';
-import { MediaAnd } from './media-and';
-import { MediaCondition } from './media-condition';
-import { MediaConditionList } from './media-condition-list';
-import { MediaFeature } from './media-feature';
-import { MediaFeatureBoolean } from './media-feature-boolean';
-import { MediaFeatureName } from './media-feature-name';
-import { MediaFeaturePlain } from './media-feature-plain';
-import { MediaFeatureRange } from './media-feature-range';
-import { MediaFeatureValue } from './media-feature-value';
+import type { ComponentValue, ContainerNode } from '@csstools/css-parser-algorithms';
+import type { CSSToken} from '@csstools/css-tokenizer';
+import { stringify } from '@csstools/css-tokenizer';
+import type { GeneralEnclosed } from './general-enclosed';
+import type { MediaAnd } from './media-and';
+import type { MediaCondition } from './media-condition';
+import type { MediaConditionList } from './media-condition-list';
+import type { MediaFeature } from './media-feature';
+import type { MediaFeatureBoolean } from './media-feature-boolean';
+import type { MediaFeatureName } from './media-feature-name';
+import type { MediaFeaturePlain } from './media-feature-plain';
+import type { MediaFeatureRange } from './media-feature-range';
+import type { MediaFeatureValue } from './media-feature-value';
import { NodeType } from '../util/node-type';
-import { MediaNot } from './media-not';
-import { MediaOr } from './media-or';
+import type { MediaNot } from './media-not';
+import type { MediaOr } from './media-or';
export class MediaInParens {
type = NodeType.MediaInParens;
diff --git a/packages/media-query-list-parser/src/nodes/media-not.ts b/packages/media-query-list-parser/src/nodes/media-not.ts
index 9168d1a0a..0a7c9cbde 100644
--- a/packages/media-query-list-parser/src/nodes/media-not.ts
+++ b/packages/media-query-list-parser/src/nodes/media-not.ts
@@ -1,5 +1,6 @@
-import { CSSToken, stringify } from '@csstools/css-tokenizer';
-import { MediaInParens, MediaInParensWalkerEntry, MediaInParensWalkerParent } from './media-in-parens';
+import type { CSSToken} from '@csstools/css-tokenizer';
+import { stringify } from '@csstools/css-tokenizer';
+import type { MediaInParens, MediaInParensWalkerEntry, MediaInParensWalkerParent } from './media-in-parens';
import { NodeType } from '../util/node-type';
export class MediaNot {
diff --git a/packages/media-query-list-parser/src/nodes/media-or.ts b/packages/media-query-list-parser/src/nodes/media-or.ts
index e97ea6257..3996ee888 100644
--- a/packages/media-query-list-parser/src/nodes/media-or.ts
+++ b/packages/media-query-list-parser/src/nodes/media-or.ts
@@ -1,5 +1,6 @@
-import { CSSToken, stringify } from '@csstools/css-tokenizer';
-import { MediaInParens, MediaInParensWalkerEntry, MediaInParensWalkerParent } from './media-in-parens';
+import type { CSSToken} from '@csstools/css-tokenizer';
+import { stringify } from '@csstools/css-tokenizer';
+import type { MediaInParens, MediaInParensWalkerEntry, MediaInParensWalkerParent } from './media-in-parens';
import { NodeType } from '../util/node-type';
export class MediaOr {
diff --git a/packages/media-query-list-parser/src/nodes/media-query-modifier.ts b/packages/media-query-list-parser/src/nodes/media-query-modifier.ts
index d3d8d0721..10f30bf51 100644
--- a/packages/media-query-list-parser/src/nodes/media-query-modifier.ts
+++ b/packages/media-query-list-parser/src/nodes/media-query-modifier.ts
@@ -1,4 +1,5 @@
-import { TokenIdent, isTokenIdent } from '@csstools/css-tokenizer';
+import type { TokenIdent} from '@csstools/css-tokenizer';
+import { isTokenIdent } from '@csstools/css-tokenizer';
export enum MediaQueryModifier {
Not = 'not',
diff --git a/packages/media-query-list-parser/src/nodes/media-query.ts b/packages/media-query-list-parser/src/nodes/media-query.ts
index 900131567..87f525d45 100644
--- a/packages/media-query-list-parser/src/nodes/media-query.ts
+++ b/packages/media-query-list-parser/src/nodes/media-query.ts
@@ -1,9 +1,12 @@
-import { ComponentValue, walkerIndexGenerator } from '@csstools/css-parser-algorithms';
-import { CSSToken, isTokenIdent, stringify, TokenType } from '@csstools/css-tokenizer';
+import type { ComponentValue} from '@csstools/css-parser-algorithms';
+import { walkerIndexGenerator } from '@csstools/css-parser-algorithms';
+import type { CSSToken} from '@csstools/css-tokenizer';
+import { isTokenIdent, stringify, TokenType } from '@csstools/css-tokenizer';
import { NodeType } from '../util/node-type';
-import { MediaCondition, MediaConditionWalkerEntry, MediaConditionWalkerParent } from './media-condition';
+import type { MediaConditionWalkerEntry, MediaConditionWalkerParent } from './media-condition';
+import { MediaCondition } from './media-condition';
import { MediaInParens } from './media-in-parens';
-import { MediaNot } from './media-not';
+import type { MediaNot } from './media-not';
export type MediaQuery = MediaQueryWithType | MediaQueryWithoutType | MediaQueryInvalid;
diff --git a/packages/media-query-list-parser/src/nodes/media-type.ts b/packages/media-query-list-parser/src/nodes/media-type.ts
index 4b57f4ba0..9f18d8252 100644
--- a/packages/media-query-list-parser/src/nodes/media-type.ts
+++ b/packages/media-query-list-parser/src/nodes/media-type.ts
@@ -1,4 +1,5 @@
-import { TokenIdent, isTokenIdent } from '@csstools/css-tokenizer';
+import type { TokenIdent} from '@csstools/css-tokenizer';
+import { isTokenIdent } from '@csstools/css-tokenizer';
export enum MediaType {
/** Always matches */
diff --git a/packages/media-query-list-parser/src/parser/parse-custom-media.ts b/packages/media-query-list-parser/src/parser/parse-custom-media.ts
index 2cd40de91..b6a5e90f1 100644
--- a/packages/media-query-list-parser/src/parser/parse-custom-media.ts
+++ b/packages/media-query-list-parser/src/parser/parse-custom-media.ts
@@ -1,4 +1,5 @@
-import { CSSToken, tokenizer, ParseError, TokenIdent, cloneTokens, isTokenWhiteSpaceOrComment, isTokenIdent, isTokenEOF } from '@csstools/css-tokenizer';
+import type { CSSToken, ParseError, TokenIdent} from '@csstools/css-tokenizer';
+import { tokenizer, cloneTokens, isTokenWhiteSpaceOrComment, isTokenIdent, isTokenEOF } from '@csstools/css-tokenizer';
import { CustomMedia } from '../nodes/custom-media';
import { parseFromTokens } from './parse';
diff --git a/packages/media-query-list-parser/src/parser/parse-media-query.ts b/packages/media-query-list-parser/src/parser/parse-media-query.ts
index 081c31edf..a81973556 100644
--- a/packages/media-query-list-parser/src/parser/parse-media-query.ts
+++ b/packages/media-query-list-parser/src/parser/parse-media-query.ts
@@ -1,6 +1,8 @@
import { isSimpleBlockNode } from '@csstools/css-parser-algorithms';
-import { ComponentValue, ComponentValueType, isCommentNode, isTokenNode, isWhitespaceNode, SimpleBlockNode } from '@csstools/css-parser-algorithms';
-import { CSSToken, isTokenIdent, TokenIdent } from '@csstools/css-tokenizer';
+import type { ComponentValue, SimpleBlockNode } from '@csstools/css-parser-algorithms';
+import { ComponentValueType, isCommentNode, isTokenNode, isWhitespaceNode } from '@csstools/css-parser-algorithms';
+import type { CSSToken, TokenIdent } from '@csstools/css-tokenizer';
+import { isTokenIdent } from '@csstools/css-tokenizer';
import { GeneralEnclosed } from '../nodes/general-enclosed';
import { MediaAnd } from '../nodes/media-and';
import { MediaCondition } from '../nodes/media-condition';
@@ -9,7 +11,8 @@ import { parseMediaFeature } from '../nodes/media-feature';
import { MediaInParens } from '../nodes/media-in-parens';
import { MediaNot } from '../nodes/media-not';
import { MediaOr } from '../nodes/media-or';
-import { MediaQuery, MediaQueryWithoutType, MediaQueryWithType } from '../nodes/media-query';
+import type { MediaQuery} from '../nodes/media-query';
+import { MediaQueryWithoutType, MediaQueryWithType } from '../nodes/media-query';
import { modifierFromToken } from '../nodes/media-query-modifier';
import { isIdent } from '../util/component-value-is';
import { isTokenOpenParen } from '@csstools/css-tokenizer';
diff --git a/packages/media-query-list-parser/src/parser/parse.ts b/packages/media-query-list-parser/src/parser/parse.ts
index 68f357961..cb0c8021d 100644
--- a/packages/media-query-list-parser/src/parser/parse.ts
+++ b/packages/media-query-list-parser/src/parser/parse.ts
@@ -1,6 +1,8 @@
import { parseCommaSeparatedListOfComponentValues } from '@csstools/css-parser-algorithms';
-import { CSSToken, tokenizer, ParseError } from '@csstools/css-tokenizer';
-import { MediaQuery, MediaQueryInvalid } from '../nodes/media-query';
+import type { CSSToken, ParseError } from '@csstools/css-tokenizer';
+import { tokenizer } from '@csstools/css-tokenizer';
+import type { MediaQuery} from '../nodes/media-query';
+import { MediaQueryInvalid } from '../nodes/media-query';
import { parseMediaQuery } from './parse-media-query';
export function parseFromTokens(
diff --git a/packages/media-query-list-parser/src/util/clone-media-query.ts b/packages/media-query-list-parser/src/util/clone-media-query.ts
index ec8b69bde..7d4f3f9a7 100644
--- a/packages/media-query-list-parser/src/util/clone-media-query.ts
+++ b/packages/media-query-list-parser/src/util/clone-media-query.ts
@@ -1,5 +1,5 @@
import { cloneTokens, stringify } from '@csstools/css-tokenizer';
-import { MediaQueryInvalid, MediaQueryWithoutType, MediaQueryWithType } from '../nodes/media-query';
+import type { MediaQueryInvalid, MediaQueryWithoutType, MediaQueryWithType } from '../nodes/media-query';
import { parseFromTokens } from '../parser/parse';
import { isMediaQueryInvalid, isMediaQueryWithoutType, isMediaQueryWithType } from './type-predicates';
diff --git a/packages/media-query-list-parser/src/util/type-predicates.ts b/packages/media-query-list-parser/src/util/type-predicates.ts
index 8293f2482..924715ff7 100644
--- a/packages/media-query-list-parser/src/util/type-predicates.ts
+++ b/packages/media-query-list-parser/src/util/type-predicates.ts
@@ -2,17 +2,20 @@ import { CustomMedia } from '../nodes/custom-media';
import { GeneralEnclosed } from '../nodes/general-enclosed';
import { MediaAnd } from '../nodes/media-and';
import { MediaCondition } from '../nodes/media-condition';
-import { MediaConditionList, MediaConditionListWithAnd, MediaConditionListWithOr } from '../nodes/media-condition-list';
+import type { MediaConditionList} from '../nodes/media-condition-list';
+import { MediaConditionListWithAnd, MediaConditionListWithOr } from '../nodes/media-condition-list';
import { MediaFeature } from '../nodes/media-feature';
import { MediaFeatureBoolean } from '../nodes/media-feature-boolean';
import { MediaFeatureName } from '../nodes/media-feature-name';
import { MediaFeaturePlain } from '../nodes/media-feature-plain';
-import { MediaFeatureRange, MediaFeatureRangeNameValue, MediaFeatureRangeValueName, MediaFeatureRangeValueNameValue } from '../nodes/media-feature-range';
+import type { MediaFeatureRange} from '../nodes/media-feature-range';
+import { MediaFeatureRangeNameValue, MediaFeatureRangeValueName, MediaFeatureRangeValueNameValue } from '../nodes/media-feature-range';
import { MediaFeatureValue } from '../nodes/media-feature-value';
import { MediaInParens } from '../nodes/media-in-parens';
import { MediaNot } from '../nodes/media-not';
import { MediaOr } from '../nodes/media-or';
-import { MediaQuery, MediaQueryInvalid, MediaQueryWithoutType, MediaQueryWithType } from '../nodes/media-query';
+import type { MediaQuery} from '../nodes/media-query';
+import { MediaQueryInvalid, MediaQueryWithoutType, MediaQueryWithType } from '../nodes/media-query';
export function isCustomMedia(x: unknown): x is GeneralEnclosed {
return CustomMedia.isCustomMedia(x);
diff --git a/packages/media-query-list-parser/test/api/options.mjs b/packages/media-query-list-parser/test/api/options.mjs
index 70e488882..cb637f37b 100644
--- a/packages/media-query-list-parser/test/api/options.mjs
+++ b/packages/media-query-list-parser/test/api/options.mjs
@@ -1,4 +1,4 @@
-import assert from 'assert';
+import assert from 'node:assert';
import { parse } from '@csstools/media-query-list-parser';
{
diff --git a/packages/media-query-list-parser/test/cases/custom-media/0001.mjs b/packages/media-query-list-parser/test/cases/custom-media/0001.mjs
index 5f97dff75..a35103b0d 100644
--- a/packages/media-query-list-parser/test/cases/custom-media/0001.mjs
+++ b/packages/media-query-list-parser/test/cases/custom-media/0001.mjs
@@ -1,4 +1,4 @@
-import assert from 'assert';
+import assert from 'node:assert';
import { runTestCustomMedia } from '../../util/run-test-custom-media.mjs';
runTestCustomMedia(
diff --git a/packages/media-query-list-parser/test/cases/custom-media/0002.mjs b/packages/media-query-list-parser/test/cases/custom-media/0002.mjs
index 22185f771..ef2d5ac93 100644
--- a/packages/media-query-list-parser/test/cases/custom-media/0002.mjs
+++ b/packages/media-query-list-parser/test/cases/custom-media/0002.mjs
@@ -1,4 +1,4 @@
-import assert from 'assert';
+import assert from 'node:assert';
import { runTestCustomMedia } from '../../util/run-test-custom-media.mjs';
runTestCustomMedia(
diff --git a/packages/media-query-list-parser/test/cases/custom-media/0003.mjs b/packages/media-query-list-parser/test/cases/custom-media/0003.mjs
index ad6d52ee7..17572e307 100644
--- a/packages/media-query-list-parser/test/cases/custom-media/0003.mjs
+++ b/packages/media-query-list-parser/test/cases/custom-media/0003.mjs
@@ -1,4 +1,4 @@
-import assert from 'assert';
+import assert from 'node:assert';
import { runTestCustomMedia } from '../../util/run-test-custom-media.mjs';
runTestCustomMedia(
diff --git a/packages/media-query-list-parser/test/cases/custom-media/0004.mjs b/packages/media-query-list-parser/test/cases/custom-media/0004.mjs
index 95504121f..43dbaaebb 100644
--- a/packages/media-query-list-parser/test/cases/custom-media/0004.mjs
+++ b/packages/media-query-list-parser/test/cases/custom-media/0004.mjs
@@ -1,4 +1,4 @@
-import assert from 'assert';
+import assert from 'node:assert';
import { runTestCustomMedia } from '../../util/run-test-custom-media.mjs';
runTestCustomMedia(
diff --git a/packages/media-query-list-parser/test/cases/custom-media/0005.mjs b/packages/media-query-list-parser/test/cases/custom-media/0005.mjs
index ba5f18b9b..626ded52f 100644
--- a/packages/media-query-list-parser/test/cases/custom-media/0005.mjs
+++ b/packages/media-query-list-parser/test/cases/custom-media/0005.mjs
@@ -1,4 +1,4 @@
-import assert from 'assert';
+import assert from 'node:assert';
import { runTestCustomMedia } from '../../util/run-test-custom-media.mjs';
runTestCustomMedia(
diff --git a/packages/media-query-list-parser/test/cases/custom-media/0006.mjs b/packages/media-query-list-parser/test/cases/custom-media/0006.mjs
index e3971cc1e..c1b7c62fc 100644
--- a/packages/media-query-list-parser/test/cases/custom-media/0006.mjs
+++ b/packages/media-query-list-parser/test/cases/custom-media/0006.mjs
@@ -1,4 +1,4 @@
-import assert from 'assert';
+import assert from 'node:assert';
import { runTestCustomMedia } from '../../util/run-test-custom-media.mjs';
runTestCustomMedia(
diff --git a/packages/media-query-list-parser/test/cases/custom-media/0007.mjs b/packages/media-query-list-parser/test/cases/custom-media/0007.mjs
index bbb9139d9..673a2cef2 100644
--- a/packages/media-query-list-parser/test/cases/custom-media/0007.mjs
+++ b/packages/media-query-list-parser/test/cases/custom-media/0007.mjs
@@ -1,4 +1,4 @@
-import assert from 'assert';
+import assert from 'node:assert';
import { runTestCustomMedia } from '../../util/run-test-custom-media.mjs';
runTestCustomMedia(
diff --git a/packages/media-query-list-parser/test/cases/custom-media/0008.mjs b/packages/media-query-list-parser/test/cases/custom-media/0008.mjs
index 67b218755..8deaf009e 100644
--- a/packages/media-query-list-parser/test/cases/custom-media/0008.mjs
+++ b/packages/media-query-list-parser/test/cases/custom-media/0008.mjs
@@ -1,4 +1,4 @@
-import assert from 'assert';
+import assert from 'node:assert';
import { runTestCustomMedia } from '../../util/run-test-custom-media.mjs';
runTestCustomMedia(
diff --git a/packages/media-query-list-parser/test/cases/custom-media/0009.mjs b/packages/media-query-list-parser/test/cases/custom-media/0009.mjs
index 7fe554419..b3fb73c23 100644
--- a/packages/media-query-list-parser/test/cases/custom-media/0009.mjs
+++ b/packages/media-query-list-parser/test/cases/custom-media/0009.mjs
@@ -1,4 +1,4 @@
-import assert from 'assert';
+import assert from 'node:assert';
import { runTestCustomMedia } from '../../util/run-test-custom-media.mjs';
runTestCustomMedia(
diff --git a/packages/media-query-list-parser/test/cases/custom-media/0010.mjs b/packages/media-query-list-parser/test/cases/custom-media/0010.mjs
index 81d7ba1de..4fe9f8a2e 100644
--- a/packages/media-query-list-parser/test/cases/custom-media/0010.mjs
+++ b/packages/media-query-list-parser/test/cases/custom-media/0010.mjs
@@ -1,4 +1,4 @@
-import assert from 'assert';
+import assert from 'node:assert';
import { runTestCustomMedia } from '../../util/run-test-custom-media.mjs';
runTestCustomMedia(
diff --git a/packages/media-query-list-parser/test/cases/custom-media/0011.mjs b/packages/media-query-list-parser/test/cases/custom-media/0011.mjs
index e51fc6688..781360491 100644
--- a/packages/media-query-list-parser/test/cases/custom-media/0011.mjs
+++ b/packages/media-query-list-parser/test/cases/custom-media/0011.mjs
@@ -1,4 +1,4 @@
-import assert from 'assert';
+import assert from 'node:assert';
import { runTestCustomMedia } from '../../util/run-test-custom-media.mjs';
runTestCustomMedia(
diff --git a/packages/media-query-list-parser/test/cases/media-not/0001.mjs b/packages/media-query-list-parser/test/cases/media-not/0001.mjs
index 5eb55f343..3e03d7596 100644
--- a/packages/media-query-list-parser/test/cases/media-not/0001.mjs
+++ b/packages/media-query-list-parser/test/cases/media-not/0001.mjs
@@ -1,4 +1,4 @@
-import assert from 'assert';
+import assert from 'node:assert';
import { runTest } from '../../util/run-test.mjs';
runTest(
diff --git a/packages/media-query-list-parser/test/cases/mf-boolean/0001.mjs b/packages/media-query-list-parser/test/cases/mf-boolean/0001.mjs
index 2686abd60..ab2d98481 100644
--- a/packages/media-query-list-parser/test/cases/mf-boolean/0001.mjs
+++ b/packages/media-query-list-parser/test/cases/mf-boolean/0001.mjs
@@ -1,4 +1,4 @@
-import assert from 'assert';
+import assert from 'node:assert';
import { runTest } from '../../util/run-test.mjs';
runTest(
diff --git a/packages/media-query-list-parser/test/cases/mf-boolean/0002.mjs b/packages/media-query-list-parser/test/cases/mf-boolean/0002.mjs
index f8266d441..bfe3977e3 100644
--- a/packages/media-query-list-parser/test/cases/mf-boolean/0002.mjs
+++ b/packages/media-query-list-parser/test/cases/mf-boolean/0002.mjs
@@ -1,4 +1,4 @@
-import assert from 'assert';
+import assert from 'node:assert';
import { runTest } from '../../util/run-test.mjs';
runTest(
diff --git a/packages/media-query-list-parser/test/cases/mf-boolean/0003.mjs b/packages/media-query-list-parser/test/cases/mf-boolean/0003.mjs
index c0c9f5645..9f97303c6 100644
--- a/packages/media-query-list-parser/test/cases/mf-boolean/0003.mjs
+++ b/packages/media-query-list-parser/test/cases/mf-boolean/0003.mjs
@@ -1,4 +1,4 @@
-import assert from 'assert';
+import assert from 'node:assert';
import { runTest } from '../../util/run-test.mjs';
runTest(
diff --git a/packages/media-query-list-parser/test/cases/mf-boolean/0004.mjs b/packages/media-query-list-parser/test/cases/mf-boolean/0004.mjs
index 0a34a2dc8..ec0dbb08a 100644
--- a/packages/media-query-list-parser/test/cases/mf-boolean/0004.mjs
+++ b/packages/media-query-list-parser/test/cases/mf-boolean/0004.mjs
@@ -1,4 +1,4 @@
-import assert from 'assert';
+import assert from 'node:assert';
import { runTest } from '../../util/run-test.mjs';
runTest(
diff --git a/packages/media-query-list-parser/test/cases/mf-boolean/0005.mjs b/packages/media-query-list-parser/test/cases/mf-boolean/0005.mjs
index fd8afbd15..1d2b2d094 100644
--- a/packages/media-query-list-parser/test/cases/mf-boolean/0005.mjs
+++ b/packages/media-query-list-parser/test/cases/mf-boolean/0005.mjs
@@ -1,4 +1,4 @@
-import assert from 'assert';
+import assert from 'node:assert';
import { runTest } from '../../util/run-test.mjs';
runTest(
diff --git a/packages/media-query-list-parser/test/cases/mf-plain/0001.mjs b/packages/media-query-list-parser/test/cases/mf-plain/0001.mjs
index b674721b7..f99538695 100644
--- a/packages/media-query-list-parser/test/cases/mf-plain/0001.mjs
+++ b/packages/media-query-list-parser/test/cases/mf-plain/0001.mjs
@@ -1,4 +1,4 @@
-import assert from 'assert';
+import assert from 'node:assert';
import { runTest } from '../../util/run-test.mjs';
runTest(
diff --git a/packages/media-query-list-parser/test/cases/mf-plain/0002.mjs b/packages/media-query-list-parser/test/cases/mf-plain/0002.mjs
index 90eb3e1f9..838a4f8bf 100644
--- a/packages/media-query-list-parser/test/cases/mf-plain/0002.mjs
+++ b/packages/media-query-list-parser/test/cases/mf-plain/0002.mjs
@@ -1,4 +1,4 @@
-import assert from 'assert';
+import assert from 'node:assert';
import { runTest } from '../../util/run-test.mjs';
runTest(
diff --git a/packages/media-query-list-parser/test/cases/mf-plain/0003.mjs b/packages/media-query-list-parser/test/cases/mf-plain/0003.mjs
index ad7c3adf2..a9dc64e6a 100644
--- a/packages/media-query-list-parser/test/cases/mf-plain/0003.mjs
+++ b/packages/media-query-list-parser/test/cases/mf-plain/0003.mjs
@@ -1,4 +1,4 @@
-import assert from 'assert';
+import assert from 'node:assert';
import { runTest } from '../../util/run-test.mjs';
runTest(
diff --git a/packages/media-query-list-parser/test/cases/mf-plain/0004.mjs b/packages/media-query-list-parser/test/cases/mf-plain/0004.mjs
index 7c310ffb4..c0c45df93 100644
--- a/packages/media-query-list-parser/test/cases/mf-plain/0004.mjs
+++ b/packages/media-query-list-parser/test/cases/mf-plain/0004.mjs
@@ -1,4 +1,4 @@
-import assert from 'assert';
+import assert from 'node:assert';
import { runTest } from '../../util/run-test.mjs';
runTest(
diff --git a/packages/media-query-list-parser/test/cases/mf-plain/0005.mjs b/packages/media-query-list-parser/test/cases/mf-plain/0005.mjs
index 946d31898..8e90cb553 100644
--- a/packages/media-query-list-parser/test/cases/mf-plain/0005.mjs
+++ b/packages/media-query-list-parser/test/cases/mf-plain/0005.mjs
@@ -1,4 +1,4 @@
-import assert from 'assert';
+import assert from 'node:assert';
import { runTest } from '../../util/run-test.mjs';
runTest(
diff --git a/packages/media-query-list-parser/test/cases/mf-plain/0006.mjs b/packages/media-query-list-parser/test/cases/mf-plain/0006.mjs
index 76cfa33a6..317f58e31 100644
--- a/packages/media-query-list-parser/test/cases/mf-plain/0006.mjs
+++ b/packages/media-query-list-parser/test/cases/mf-plain/0006.mjs
@@ -1,4 +1,4 @@
-import assert from 'assert';
+import assert from 'node:assert';
import { runTest } from '../../util/run-test.mjs';
runTest(
diff --git a/packages/media-query-list-parser/test/cases/mf-plain/0007.mjs b/packages/media-query-list-parser/test/cases/mf-plain/0007.mjs
index 3f5b8a294..fdefacb64 100644
--- a/packages/media-query-list-parser/test/cases/mf-plain/0007.mjs
+++ b/packages/media-query-list-parser/test/cases/mf-plain/0007.mjs
@@ -1,4 +1,4 @@
-import assert from 'assert';
+import assert from 'node:assert';
import { runTest } from '../../util/run-test.mjs';
runTest(
diff --git a/packages/media-query-list-parser/test/cases/mf-plain/0008.mjs b/packages/media-query-list-parser/test/cases/mf-plain/0008.mjs
index d467ff39a..d239faafc 100644
--- a/packages/media-query-list-parser/test/cases/mf-plain/0008.mjs
+++ b/packages/media-query-list-parser/test/cases/mf-plain/0008.mjs
@@ -1,4 +1,4 @@
-import assert from 'assert';
+import assert from 'node:assert';
import { runTest } from '../../util/run-test.mjs';
runTest(
diff --git a/packages/media-query-list-parser/test/cases/mf-plain/0009.mjs b/packages/media-query-list-parser/test/cases/mf-plain/0009.mjs
index 032c86c56..aad2c8a13 100644
--- a/packages/media-query-list-parser/test/cases/mf-plain/0009.mjs
+++ b/packages/media-query-list-parser/test/cases/mf-plain/0009.mjs
@@ -1,4 +1,4 @@
-import assert from 'assert';
+import assert from 'node:assert';
import { runTest } from '../../util/run-test.mjs';
runTest(
diff --git a/packages/media-query-list-parser/test/cases/mf-range/0001.mjs b/packages/media-query-list-parser/test/cases/mf-range/0001.mjs
index 37aba33f4..f786e6e8c 100644
--- a/packages/media-query-list-parser/test/cases/mf-range/0001.mjs
+++ b/packages/media-query-list-parser/test/cases/mf-range/0001.mjs
@@ -1,4 +1,4 @@
-import assert from 'assert';
+import assert from 'node:assert';
import { runTest } from '../../util/run-test.mjs';
runTest(
diff --git a/packages/media-query-list-parser/test/cases/mf-range/0002.mjs b/packages/media-query-list-parser/test/cases/mf-range/0002.mjs
index 81b097b60..c65b01917 100644
--- a/packages/media-query-list-parser/test/cases/mf-range/0002.mjs
+++ b/packages/media-query-list-parser/test/cases/mf-range/0002.mjs
@@ -1,4 +1,4 @@
-import assert from 'assert';
+import assert from 'node:assert';
import { runTest } from '../../util/run-test.mjs';
runTest(
diff --git a/packages/media-query-list-parser/test/cases/mf-range/0003.mjs b/packages/media-query-list-parser/test/cases/mf-range/0003.mjs
index 5626fc00a..9f6fa4561 100644
--- a/packages/media-query-list-parser/test/cases/mf-range/0003.mjs
+++ b/packages/media-query-list-parser/test/cases/mf-range/0003.mjs
@@ -1,4 +1,4 @@
-import assert from 'assert';
+import assert from 'node:assert';
import { runTest } from '../../util/run-test.mjs';
runTest(
diff --git a/packages/media-query-list-parser/test/cases/mf-range/0004.mjs b/packages/media-query-list-parser/test/cases/mf-range/0004.mjs
index 3863dfccc..c24976522 100644
--- a/packages/media-query-list-parser/test/cases/mf-range/0004.mjs
+++ b/packages/media-query-list-parser/test/cases/mf-range/0004.mjs
@@ -1,4 +1,4 @@
-import assert from 'assert';
+import assert from 'node:assert';
import { runTest } from '../../util/run-test.mjs';
runTest(
diff --git a/packages/media-query-list-parser/test/cases/mf-range/0005.mjs b/packages/media-query-list-parser/test/cases/mf-range/0005.mjs
index fbaf31925..ae4e75081 100644
--- a/packages/media-query-list-parser/test/cases/mf-range/0005.mjs
+++ b/packages/media-query-list-parser/test/cases/mf-range/0005.mjs
@@ -1,4 +1,4 @@
-import assert from 'assert';
+import assert from 'node:assert';
import { runTest } from '../../util/run-test.mjs';
runTest(
diff --git a/packages/media-query-list-parser/test/cases/mf-range/0006.mjs b/packages/media-query-list-parser/test/cases/mf-range/0006.mjs
index cc1c77c20..b3ae6a7fe 100644
--- a/packages/media-query-list-parser/test/cases/mf-range/0006.mjs
+++ b/packages/media-query-list-parser/test/cases/mf-range/0006.mjs
@@ -1,4 +1,4 @@
-import assert from 'assert';
+import assert from 'node:assert';
import { runTest } from '../../util/run-test.mjs';
runTest(
diff --git a/packages/media-query-list-parser/test/cases/mf-range/0007.mjs b/packages/media-query-list-parser/test/cases/mf-range/0007.mjs
index 0db8883c7..1046972d4 100644
--- a/packages/media-query-list-parser/test/cases/mf-range/0007.mjs
+++ b/packages/media-query-list-parser/test/cases/mf-range/0007.mjs
@@ -1,4 +1,4 @@
-import assert from 'assert';
+import assert from 'node:assert';
import { runTest } from '../../util/run-test.mjs';
runTest(
diff --git a/packages/media-query-list-parser/test/cases/mf-range/0008.mjs b/packages/media-query-list-parser/test/cases/mf-range/0008.mjs
index 7b9fc7609..0c68bd9d2 100644
--- a/packages/media-query-list-parser/test/cases/mf-range/0008.mjs
+++ b/packages/media-query-list-parser/test/cases/mf-range/0008.mjs
@@ -1,4 +1,4 @@
-import assert from 'assert';
+import assert from 'node:assert';
import { runTest } from '../../util/run-test.mjs';
runTest(
diff --git a/packages/media-query-list-parser/test/cases/mf-range/0009.mjs b/packages/media-query-list-parser/test/cases/mf-range/0009.mjs
index 95098d1ca..1f342b1d3 100644
--- a/packages/media-query-list-parser/test/cases/mf-range/0009.mjs
+++ b/packages/media-query-list-parser/test/cases/mf-range/0009.mjs
@@ -1,4 +1,4 @@
-import assert from 'assert';
+import assert from 'node:assert';
import { runTest } from '../../util/run-test.mjs';
runTest(
diff --git a/packages/media-query-list-parser/test/cases/mf-range/0010.mjs b/packages/media-query-list-parser/test/cases/mf-range/0010.mjs
index 6ff9a2ba0..31f8196ed 100644
--- a/packages/media-query-list-parser/test/cases/mf-range/0010.mjs
+++ b/packages/media-query-list-parser/test/cases/mf-range/0010.mjs
@@ -1,4 +1,4 @@
-import assert from 'assert';
+import assert from 'node:assert';
import { runTest } from '../../util/run-test.mjs';
runTest(
diff --git a/packages/media-query-list-parser/test/cases/mf-range/0011.mjs b/packages/media-query-list-parser/test/cases/mf-range/0011.mjs
index 5d1a49b55..a3a218c68 100644
--- a/packages/media-query-list-parser/test/cases/mf-range/0011.mjs
+++ b/packages/media-query-list-parser/test/cases/mf-range/0011.mjs
@@ -1,4 +1,4 @@
-import assert from 'assert';
+import assert from 'node:assert';
import { runTest } from '../../util/run-test.mjs';
runTest(
diff --git a/packages/media-query-list-parser/test/cases/mf-range/0012.mjs b/packages/media-query-list-parser/test/cases/mf-range/0012.mjs
index 01cd32f50..b1150be3a 100644
--- a/packages/media-query-list-parser/test/cases/mf-range/0012.mjs
+++ b/packages/media-query-list-parser/test/cases/mf-range/0012.mjs
@@ -1,4 +1,4 @@
-import assert from 'assert';
+import assert from 'node:assert';
import { runTest } from '../../util/run-test.mjs';
runTest(
diff --git a/packages/media-query-list-parser/test/cases/mf-range/0013.mjs b/packages/media-query-list-parser/test/cases/mf-range/0013.mjs
index ea88732f7..33b549368 100644
--- a/packages/media-query-list-parser/test/cases/mf-range/0013.mjs
+++ b/packages/media-query-list-parser/test/cases/mf-range/0013.mjs
@@ -1,4 +1,4 @@
-import assert from 'assert';
+import assert from 'node:assert';
import { runTest } from '../../util/run-test.mjs';
runTest(
diff --git a/packages/media-query-list-parser/test/cases/mf-range/0014.mjs b/packages/media-query-list-parser/test/cases/mf-range/0014.mjs
index 07057e069..5081056ae 100644
--- a/packages/media-query-list-parser/test/cases/mf-range/0014.mjs
+++ b/packages/media-query-list-parser/test/cases/mf-range/0014.mjs
@@ -1,4 +1,4 @@
-import assert from 'assert';
+import assert from 'node:assert';
import { runTest } from '../../util/run-test.mjs';
runTest(
diff --git a/packages/media-query-list-parser/test/cases/mf-range/0015.mjs b/packages/media-query-list-parser/test/cases/mf-range/0015.mjs
index fe8d5596b..559f589a4 100644
--- a/packages/media-query-list-parser/test/cases/mf-range/0015.mjs
+++ b/packages/media-query-list-parser/test/cases/mf-range/0015.mjs
@@ -1,4 +1,4 @@
-import assert from 'assert';
+import assert from 'node:assert';
import { runTest } from '../../util/run-test.mjs';
runTest(
diff --git a/packages/media-query-list-parser/test/cases/mf-range/0016.mjs b/packages/media-query-list-parser/test/cases/mf-range/0016.mjs
index 6bbe4a167..87ccca8ee 100644
--- a/packages/media-query-list-parser/test/cases/mf-range/0016.mjs
+++ b/packages/media-query-list-parser/test/cases/mf-range/0016.mjs
@@ -1,4 +1,4 @@
-import assert from 'assert';
+import assert from 'node:assert';
import { runTest } from '../../util/run-test.mjs';
runTest(
diff --git a/packages/media-query-list-parser/test/cases/mf-range/0017.mjs b/packages/media-query-list-parser/test/cases/mf-range/0017.mjs
index 330f4a3db..a4746280e 100644
--- a/packages/media-query-list-parser/test/cases/mf-range/0017.mjs
+++ b/packages/media-query-list-parser/test/cases/mf-range/0017.mjs
@@ -1,4 +1,4 @@
-import assert from 'assert';
+import assert from 'node:assert';
import { runTest } from '../../util/run-test.mjs';
runTest(
diff --git a/packages/media-query-list-parser/test/cases/mf-range/0018.mjs b/packages/media-query-list-parser/test/cases/mf-range/0018.mjs
index 9cace5cfa..461a45c03 100644
--- a/packages/media-query-list-parser/test/cases/mf-range/0018.mjs
+++ b/packages/media-query-list-parser/test/cases/mf-range/0018.mjs
@@ -1,4 +1,4 @@
-import assert from 'assert';
+import assert from 'node:assert';
import { runTest } from '../../util/run-test.mjs';
runTest(
diff --git a/packages/media-query-list-parser/test/cases/mf-range/0019.mjs b/packages/media-query-list-parser/test/cases/mf-range/0019.mjs
index b19c27024..27ffe9e40 100644
--- a/packages/media-query-list-parser/test/cases/mf-range/0019.mjs
+++ b/packages/media-query-list-parser/test/cases/mf-range/0019.mjs
@@ -1,4 +1,4 @@
-import assert from 'assert';
+import assert from 'node:assert';
import { runTest } from '../../util/run-test.mjs';
runTest(
diff --git a/packages/media-query-list-parser/test/cases/mf-range/0020.mjs b/packages/media-query-list-parser/test/cases/mf-range/0020.mjs
index c5bc81c04..1eb9db5bc 100644
--- a/packages/media-query-list-parser/test/cases/mf-range/0020.mjs
+++ b/packages/media-query-list-parser/test/cases/mf-range/0020.mjs
@@ -1,4 +1,4 @@
-import assert from 'assert';
+import assert from 'node:assert';
import { runTest } from '../../util/run-test.mjs';
runTest(
diff --git a/packages/media-query-list-parser/test/cases/query-with-type/0001.mjs b/packages/media-query-list-parser/test/cases/query-with-type/0001.mjs
index b8d1c3f6b..4f8a2bda6 100644
--- a/packages/media-query-list-parser/test/cases/query-with-type/0001.mjs
+++ b/packages/media-query-list-parser/test/cases/query-with-type/0001.mjs
@@ -1,4 +1,4 @@
-import assert from 'assert';
+import assert from 'node:assert';
import { runTest } from '../../util/run-test.mjs';
runTest(
diff --git a/packages/media-query-list-parser/test/cases/query-with-type/0002.mjs b/packages/media-query-list-parser/test/cases/query-with-type/0002.mjs
index d9da6523a..0acf0c476 100644
--- a/packages/media-query-list-parser/test/cases/query-with-type/0002.mjs
+++ b/packages/media-query-list-parser/test/cases/query-with-type/0002.mjs
@@ -1,4 +1,4 @@
-import assert from 'assert';
+import assert from 'node:assert';
import { runTest } from '../../util/run-test.mjs';
runTest(
diff --git a/packages/media-query-list-parser/test/cases/query-with-type/0003.mjs b/packages/media-query-list-parser/test/cases/query-with-type/0003.mjs
index 1684cf679..ca21077e7 100644
--- a/packages/media-query-list-parser/test/cases/query-with-type/0003.mjs
+++ b/packages/media-query-list-parser/test/cases/query-with-type/0003.mjs
@@ -1,4 +1,4 @@
-import assert from 'assert';
+import assert from 'node:assert';
import { runTest } from '../../util/run-test.mjs';
runTest(
diff --git a/packages/media-query-list-parser/test/cases/query-with-type/0004.mjs b/packages/media-query-list-parser/test/cases/query-with-type/0004.mjs
index e056d5497..a0dc1b2ee 100644
--- a/packages/media-query-list-parser/test/cases/query-with-type/0004.mjs
+++ b/packages/media-query-list-parser/test/cases/query-with-type/0004.mjs
@@ -1,4 +1,4 @@
-import assert from 'assert';
+import assert from 'node:assert';
import { runTest } from '../../util/run-test.mjs';
runTest(
diff --git a/packages/media-query-list-parser/test/cases/query-with-type/0005.mjs b/packages/media-query-list-parser/test/cases/query-with-type/0005.mjs
index 7dffdd9d5..4057a5bab 100644
--- a/packages/media-query-list-parser/test/cases/query-with-type/0005.mjs
+++ b/packages/media-query-list-parser/test/cases/query-with-type/0005.mjs
@@ -1,4 +1,4 @@
-import assert from 'assert';
+import assert from 'node:assert';
import { runTest } from '../../util/run-test.mjs';
runTest(
diff --git a/packages/media-query-list-parser/test/cases/query-with-type/0006.mjs b/packages/media-query-list-parser/test/cases/query-with-type/0006.mjs
index 7d44ae33c..403f84acc 100644
--- a/packages/media-query-list-parser/test/cases/query-with-type/0006.mjs
+++ b/packages/media-query-list-parser/test/cases/query-with-type/0006.mjs
@@ -1,4 +1,4 @@
-import assert from 'assert';
+import assert from 'node:assert';
import { runTest } from '../../util/run-test.mjs';
runTest(
diff --git a/packages/media-query-list-parser/test/cases/query-with-type/0007.mjs b/packages/media-query-list-parser/test/cases/query-with-type/0007.mjs
index ba3a40806..59d9ac7f9 100644
--- a/packages/media-query-list-parser/test/cases/query-with-type/0007.mjs
+++ b/packages/media-query-list-parser/test/cases/query-with-type/0007.mjs
@@ -1,4 +1,4 @@
-import assert from 'assert';
+import assert from 'node:assert';
import { runTest } from '../../util/run-test.mjs';
runTest(
diff --git a/packages/media-query-list-parser/test/cases/query-with-type/0008.mjs b/packages/media-query-list-parser/test/cases/query-with-type/0008.mjs
index 57293c590..e03547f26 100644
--- a/packages/media-query-list-parser/test/cases/query-with-type/0008.mjs
+++ b/packages/media-query-list-parser/test/cases/query-with-type/0008.mjs
@@ -1,4 +1,4 @@
-import assert from 'assert';
+import assert from 'node:assert';
import { runTest } from '../../util/run-test.mjs';
runTest(
diff --git a/packages/media-query-list-parser/test/cases/specification-examples/0001.mjs b/packages/media-query-list-parser/test/cases/specification-examples/0001.mjs
index 9b78044a6..e28202239 100644
--- a/packages/media-query-list-parser/test/cases/specification-examples/0001.mjs
+++ b/packages/media-query-list-parser/test/cases/specification-examples/0001.mjs
@@ -1,4 +1,4 @@
-import assert from 'assert';
+import assert from 'node:assert';
import { runTest } from '../../util/run-test.mjs';
runTest(
diff --git a/packages/media-query-list-parser/test/cases/specification-examples/0002.mjs b/packages/media-query-list-parser/test/cases/specification-examples/0002.mjs
index fc91ac129..27598dba5 100644
--- a/packages/media-query-list-parser/test/cases/specification-examples/0002.mjs
+++ b/packages/media-query-list-parser/test/cases/specification-examples/0002.mjs
@@ -1,4 +1,4 @@
-import assert from 'assert';
+import assert from 'node:assert';
import { runTest } from '../../util/run-test.mjs';
runTest(
diff --git a/packages/media-query-list-parser/test/cases/specification-examples/0003.mjs b/packages/media-query-list-parser/test/cases/specification-examples/0003.mjs
index 70f1591ed..894854e5c 100644
--- a/packages/media-query-list-parser/test/cases/specification-examples/0003.mjs
+++ b/packages/media-query-list-parser/test/cases/specification-examples/0003.mjs
@@ -1,4 +1,4 @@
-import assert from 'assert';
+import assert from 'node:assert';
import { runTest } from '../../util/run-test.mjs';
runTest(
diff --git a/packages/media-query-list-parser/test/cases/specification-examples/0004.mjs b/packages/media-query-list-parser/test/cases/specification-examples/0004.mjs
index 531984b8b..8f097b36b 100644
--- a/packages/media-query-list-parser/test/cases/specification-examples/0004.mjs
+++ b/packages/media-query-list-parser/test/cases/specification-examples/0004.mjs
@@ -1,4 +1,4 @@
-import assert from 'assert';
+import assert from 'node:assert';
import { runTest } from '../../util/run-test.mjs';
runTest(
diff --git a/packages/media-query-list-parser/test/cases/specification-examples/0005.mjs b/packages/media-query-list-parser/test/cases/specification-examples/0005.mjs
index f9a7370f3..e04be46c6 100644
--- a/packages/media-query-list-parser/test/cases/specification-examples/0005.mjs
+++ b/packages/media-query-list-parser/test/cases/specification-examples/0005.mjs
@@ -1,4 +1,4 @@
-import assert from 'assert';
+import assert from 'node:assert';
import { runTest } from '../../util/run-test.mjs';
runTest(
diff --git a/packages/media-query-list-parser/test/cases/specification-examples/0006.mjs b/packages/media-query-list-parser/test/cases/specification-examples/0006.mjs
index 2a9da88e0..7da3617c3 100644
--- a/packages/media-query-list-parser/test/cases/specification-examples/0006.mjs
+++ b/packages/media-query-list-parser/test/cases/specification-examples/0006.mjs
@@ -1,4 +1,4 @@
-import assert from 'assert';
+import assert from 'node:assert';
import { runTest } from '../../util/run-test.mjs';
runTest(
diff --git a/packages/media-query-list-parser/test/cases/specification-examples/0007.mjs b/packages/media-query-list-parser/test/cases/specification-examples/0007.mjs
index 910e53f13..46fc8aaf9 100644
--- a/packages/media-query-list-parser/test/cases/specification-examples/0007.mjs
+++ b/packages/media-query-list-parser/test/cases/specification-examples/0007.mjs
@@ -1,4 +1,4 @@
-import assert from 'assert';
+import assert from 'node:assert';
import { runTest } from '../../util/run-test.mjs';
runTest(
diff --git a/packages/media-query-list-parser/test/cases/specification-examples/0008.mjs b/packages/media-query-list-parser/test/cases/specification-examples/0008.mjs
index a29e3a438..f387b6a24 100644
--- a/packages/media-query-list-parser/test/cases/specification-examples/0008.mjs
+++ b/packages/media-query-list-parser/test/cases/specification-examples/0008.mjs
@@ -1,4 +1,4 @@
-import assert from 'assert';
+import assert from 'node:assert';
import { runTest } from '../../util/run-test.mjs';
runTest(
diff --git a/packages/media-query-list-parser/test/cases/specification-examples/0009.mjs b/packages/media-query-list-parser/test/cases/specification-examples/0009.mjs
index 35c04d1af..9d8ddc530 100644
--- a/packages/media-query-list-parser/test/cases/specification-examples/0009.mjs
+++ b/packages/media-query-list-parser/test/cases/specification-examples/0009.mjs
@@ -1,4 +1,4 @@
-import assert from 'assert';
+import assert from 'node:assert';
import { runTest } from '../../util/run-test.mjs';
runTest(
diff --git a/packages/media-query-list-parser/test/cases/specification-examples/0010.mjs b/packages/media-query-list-parser/test/cases/specification-examples/0010.mjs
index 490eb23b4..936941a41 100644
--- a/packages/media-query-list-parser/test/cases/specification-examples/0010.mjs
+++ b/packages/media-query-list-parser/test/cases/specification-examples/0010.mjs
@@ -1,4 +1,4 @@
-import assert from 'assert';
+import assert from 'node:assert';
import { runTest } from '../../util/run-test.mjs';
runTest(
diff --git a/packages/media-query-list-parser/test/cases/specification-examples/0011.mjs b/packages/media-query-list-parser/test/cases/specification-examples/0011.mjs
index 4e6c07660..c321afc1e 100644
--- a/packages/media-query-list-parser/test/cases/specification-examples/0011.mjs
+++ b/packages/media-query-list-parser/test/cases/specification-examples/0011.mjs
@@ -1,4 +1,4 @@
-import assert from 'assert';
+import assert from 'node:assert';
import { runTest } from '../../util/run-test.mjs';
runTest(
diff --git a/packages/media-query-list-parser/test/cases/specification-examples/0012.mjs b/packages/media-query-list-parser/test/cases/specification-examples/0012.mjs
index c5e04a01d..f6a4c7765 100644
--- a/packages/media-query-list-parser/test/cases/specification-examples/0012.mjs
+++ b/packages/media-query-list-parser/test/cases/specification-examples/0012.mjs
@@ -1,4 +1,4 @@
-import assert from 'assert';
+import assert from 'node:assert';
import { runTest } from '../../util/run-test.mjs';
runTest(
diff --git a/packages/media-query-list-parser/test/cases/specification-examples/0013.mjs b/packages/media-query-list-parser/test/cases/specification-examples/0013.mjs
index 29fb57b1c..66ac4ac42 100644
--- a/packages/media-query-list-parser/test/cases/specification-examples/0013.mjs
+++ b/packages/media-query-list-parser/test/cases/specification-examples/0013.mjs
@@ -1,4 +1,4 @@
-import assert from 'assert';
+import assert from 'node:assert';
import { runTest } from '../../util/run-test.mjs';
runTest(
diff --git a/packages/media-query-list-parser/test/cases/specification-examples/0014.mjs b/packages/media-query-list-parser/test/cases/specification-examples/0014.mjs
index 1426a6960..835747ddd 100644
--- a/packages/media-query-list-parser/test/cases/specification-examples/0014.mjs
+++ b/packages/media-query-list-parser/test/cases/specification-examples/0014.mjs
@@ -1,4 +1,4 @@
-import assert from 'assert';
+import assert from 'node:assert';
import { runTest } from '../../util/run-test.mjs';
runTest(
diff --git a/packages/media-query-list-parser/test/cases/specification-examples/0015.mjs b/packages/media-query-list-parser/test/cases/specification-examples/0015.mjs
index befcbc3a4..e527db695 100644
--- a/packages/media-query-list-parser/test/cases/specification-examples/0015.mjs
+++ b/packages/media-query-list-parser/test/cases/specification-examples/0015.mjs
@@ -1,4 +1,4 @@
-import assert from 'assert';
+import assert from 'node:assert';
import { runTest } from '../../util/run-test.mjs';
runTest(
diff --git a/packages/media-query-list-parser/test/cases/specification-examples/0016.mjs b/packages/media-query-list-parser/test/cases/specification-examples/0016.mjs
index a45f0c406..07a0ee884 100644
--- a/packages/media-query-list-parser/test/cases/specification-examples/0016.mjs
+++ b/packages/media-query-list-parser/test/cases/specification-examples/0016.mjs
@@ -1,4 +1,4 @@
-import assert from 'assert';
+import assert from 'node:assert';
import { runTest } from '../../util/run-test.mjs';
runTest(
diff --git a/packages/media-query-list-parser/test/cases/specification-examples/0017.mjs b/packages/media-query-list-parser/test/cases/specification-examples/0017.mjs
index 37ded5cb8..e28b919e1 100644
--- a/packages/media-query-list-parser/test/cases/specification-examples/0017.mjs
+++ b/packages/media-query-list-parser/test/cases/specification-examples/0017.mjs
@@ -1,4 +1,4 @@
-import assert from 'assert';
+import assert from 'node:assert';
import { runTest } from '../../util/run-test.mjs';
runTest(
diff --git a/packages/media-query-list-parser/test/cases/specification-examples/0018.mjs b/packages/media-query-list-parser/test/cases/specification-examples/0018.mjs
index 46e80a9a7..58862cd3c 100644
--- a/packages/media-query-list-parser/test/cases/specification-examples/0018.mjs
+++ b/packages/media-query-list-parser/test/cases/specification-examples/0018.mjs
@@ -1,4 +1,4 @@
-import assert from 'assert';
+import assert from 'node:assert';
import { runTest } from '../../util/run-test.mjs';
runTest(
diff --git a/packages/media-query-list-parser/test/cases/specification-examples/0019.mjs b/packages/media-query-list-parser/test/cases/specification-examples/0019.mjs
index 80b9aa5e4..00be0ce96 100644
--- a/packages/media-query-list-parser/test/cases/specification-examples/0019.mjs
+++ b/packages/media-query-list-parser/test/cases/specification-examples/0019.mjs
@@ -1,4 +1,4 @@
-import assert from 'assert';
+import assert from 'node:assert';
import { runTest } from '../../util/run-test.mjs';
runTest(
diff --git a/packages/media-query-list-parser/test/cases/various/0001.mjs b/packages/media-query-list-parser/test/cases/various/0001.mjs
index c5764560e..09804a947 100644
--- a/packages/media-query-list-parser/test/cases/various/0001.mjs
+++ b/packages/media-query-list-parser/test/cases/various/0001.mjs
@@ -1,4 +1,4 @@
-import assert from 'assert';
+import assert from 'node:assert';
import { runTest } from '../../util/run-test.mjs';
runTest(
diff --git a/packages/media-query-list-parser/test/cases/various/0002.mjs b/packages/media-query-list-parser/test/cases/various/0002.mjs
index 964b4d9b9..332f4a647 100644
--- a/packages/media-query-list-parser/test/cases/various/0002.mjs
+++ b/packages/media-query-list-parser/test/cases/various/0002.mjs
@@ -1,4 +1,4 @@
-import assert from 'assert';
+import assert from 'node:assert';
import { runTest } from '../../util/run-test.mjs';
runTest(
diff --git a/packages/media-query-list-parser/test/cases/various/0003.mjs b/packages/media-query-list-parser/test/cases/various/0003.mjs
index 77ab5b39c..cb474e4a2 100644
--- a/packages/media-query-list-parser/test/cases/various/0003.mjs
+++ b/packages/media-query-list-parser/test/cases/various/0003.mjs
@@ -1,4 +1,4 @@
-import assert from 'assert';
+import assert from 'node:assert';
import { runTest } from '../../util/run-test.mjs';
runTest(
diff --git a/packages/media-query-list-parser/test/cases/various/0004.mjs b/packages/media-query-list-parser/test/cases/various/0004.mjs
index 62f73bf0a..ab640e461 100644
--- a/packages/media-query-list-parser/test/cases/various/0004.mjs
+++ b/packages/media-query-list-parser/test/cases/various/0004.mjs
@@ -1,4 +1,4 @@
-import assert from 'assert';
+import assert from 'node:assert';
import { runTest } from '../../util/run-test.mjs';
runTest(
diff --git a/packages/media-query-list-parser/test/cases/various/0005.mjs b/packages/media-query-list-parser/test/cases/various/0005.mjs
index 7c55c608d..f6833f603 100644
--- a/packages/media-query-list-parser/test/cases/various/0005.mjs
+++ b/packages/media-query-list-parser/test/cases/various/0005.mjs
@@ -1,4 +1,4 @@
-import assert from 'assert';
+import assert from 'node:assert';
import { runTest } from '../../util/run-test.mjs';
runTest(
diff --git a/packages/media-query-list-parser/test/cases/various/0006.mjs b/packages/media-query-list-parser/test/cases/various/0006.mjs
index 2d9faf758..581d7cfc5 100644
--- a/packages/media-query-list-parser/test/cases/various/0006.mjs
+++ b/packages/media-query-list-parser/test/cases/various/0006.mjs
@@ -1,4 +1,4 @@
-import assert from 'assert';
+import assert from 'node:assert';
import { runTest } from '../../util/run-test.mjs';
runTest(
diff --git a/packages/media-query-list-parser/test/cases/various/0007.mjs b/packages/media-query-list-parser/test/cases/various/0007.mjs
index 1b5de51ff..421ac88f6 100644
--- a/packages/media-query-list-parser/test/cases/various/0007.mjs
+++ b/packages/media-query-list-parser/test/cases/various/0007.mjs
@@ -1,4 +1,4 @@
-import assert from 'assert';
+import assert from 'node:assert';
import { runTest } from '../../util/run-test.mjs';
// MUST all be invalid:
diff --git a/packages/media-query-list-parser/test/cases/various/0008.mjs b/packages/media-query-list-parser/test/cases/various/0008.mjs
index a14b89947..e174e5983 100644
--- a/packages/media-query-list-parser/test/cases/various/0008.mjs
+++ b/packages/media-query-list-parser/test/cases/various/0008.mjs
@@ -1,4 +1,4 @@
-import assert from 'assert';
+import assert from 'node:assert';
import { runTest } from '../../util/run-test.mjs';
runTest(
diff --git a/packages/media-query-list-parser/test/cases/various/0009.mjs b/packages/media-query-list-parser/test/cases/various/0009.mjs
index ab10995b8..f3144ed4b 100644
--- a/packages/media-query-list-parser/test/cases/various/0009.mjs
+++ b/packages/media-query-list-parser/test/cases/various/0009.mjs
@@ -1,4 +1,4 @@
-import assert from 'assert';
+import assert from 'node:assert';
import { runTest } from '../../util/run-test.mjs';
runTest(
diff --git a/packages/media-query-list-parser/test/cases/walker/0001.mjs b/packages/media-query-list-parser/test/cases/walker/0001.mjs
index 706cbe203..5f8467194 100644
--- a/packages/media-query-list-parser/test/cases/walker/0001.mjs
+++ b/packages/media-query-list-parser/test/cases/walker/0001.mjs
@@ -1,4 +1,4 @@
-import assert from 'assert';
+import assert from 'node:assert';
import { parse } from '@csstools/media-query-list-parser';
{
diff --git a/packages/media-query-list-parser/test/get-name/0001.mjs b/packages/media-query-list-parser/test/get-name/0001.mjs
index 7ce94b968..6c6de545c 100644
--- a/packages/media-query-list-parser/test/get-name/0001.mjs
+++ b/packages/media-query-list-parser/test/get-name/0001.mjs
@@ -1,4 +1,4 @@
-import assert from 'assert';
+import assert from 'node:assert';
import { newMediaFeatureBoolean, newMediaFeaturePlain, parse } from '@csstools/media-query-list-parser';
import { TokenType } from '@csstools/css-tokenizer';
diff --git a/packages/media-query-list-parser/test/new-feature/0001.mjs b/packages/media-query-list-parser/test/new-feature/0001.mjs
index 0a53ea6e2..467f39db8 100644
--- a/packages/media-query-list-parser/test/new-feature/0001.mjs
+++ b/packages/media-query-list-parser/test/new-feature/0001.mjs
@@ -1,4 +1,4 @@
-import assert from 'assert';
+import assert from 'node:assert';
import { newMediaFeaturePlain } from '@csstools/media-query-list-parser';
import { TokenType } from '@csstools/css-tokenizer';
diff --git a/packages/media-query-list-parser/test/serialize/0001.mjs b/packages/media-query-list-parser/test/serialize/0001.mjs
index d1f41f3fe..f842d9332 100644
--- a/packages/media-query-list-parser/test/serialize/0001.mjs
+++ b/packages/media-query-list-parser/test/serialize/0001.mjs
@@ -1,4 +1,4 @@
-import assert from 'assert';
+import assert from 'node:assert';
import { newMediaFeatureBoolean, newMediaFeaturePlain } from '@csstools/media-query-list-parser';
import { TokenType } from '@csstools/css-tokenizer';
diff --git a/packages/media-query-list-parser/test/util/run-test-custom-media.mjs b/packages/media-query-list-parser/test/util/run-test-custom-media.mjs
index 1780e3b52..fb6df2bff 100644
--- a/packages/media-query-list-parser/test/util/run-test-custom-media.mjs
+++ b/packages/media-query-list-parser/test/util/run-test-custom-media.mjs
@@ -1,5 +1,5 @@
-import fs from 'fs';
-import path from 'path';
+import fs from 'node:fs';
+import path from 'node:path';
import { isGeneralEnclosed, parseCustomMedia } from '@csstools/media-query-list-parser';
export function runTestCustomMedia(source, testPath, assertEqual, expectGeneralEnclosed = 0) {
diff --git a/packages/media-query-list-parser/test/util/run-test.mjs b/packages/media-query-list-parser/test/util/run-test.mjs
index 544cdb021..9c1c2a53d 100644
--- a/packages/media-query-list-parser/test/util/run-test.mjs
+++ b/packages/media-query-list-parser/test/util/run-test.mjs
@@ -1,5 +1,5 @@
-import fs from 'fs';
-import path from 'path';
+import fs from 'node:fs';
+import path from 'node:path';
import { isGeneralEnclosed, parse } from '@csstools/media-query-list-parser';
export function runTest(source, testPath, assertEqual, expectGeneralEnclosed = 0) {
diff --git a/packages/pack-test/package.json b/packages/pack-test/package.json
index 5b326df50..04247b402 100644
--- a/packages/pack-test/package.json
+++ b/packages/pack-test/package.json
@@ -25,7 +25,7 @@
}
],
"engines": {
- "node": "^14 || ^16 || >=18"
+ "node": ">=18"
},
"type": "module",
"main": "dist/index.cjs",
diff --git a/packages/postcss-tape/CHANGELOG.md b/packages/postcss-tape/CHANGELOG.md
index e7c707ac0..39d01d2b0 100644
--- a/packages/postcss-tape/CHANGELOG.md
+++ b/packages/postcss-tape/CHANGELOG.md
@@ -1,5 +1,9 @@
# Changes to PostCSS Tape
+### Unreleased (major)
+
+- Updated: Support for Node v18+ (major).
+
### 4.1.2
_January 1, 2024_
diff --git a/packages/postcss-tape/package.json b/packages/postcss-tape/package.json
index 29be94706..a4b3c770f 100644
--- a/packages/postcss-tape/package.json
+++ b/packages/postcss-tape/package.json
@@ -29,7 +29,7 @@
}
],
"engines": {
- "node": "^14 || ^16 || >=18"
+ "node": ">=18"
},
"type": "module",
"main": "dist/index.cjs",
diff --git a/packages/postcss-tape/test/basic.before-after.mjs b/packages/postcss-tape/test/basic.before-after.mjs
index a6ffb7c03..182ff4596 100644
--- a/packages/postcss-tape/test/basic.before-after.mjs
+++ b/packages/postcss-tape/test/basic.before-after.mjs
@@ -1,6 +1,6 @@
import { postcssTape } from '../dist/index.mjs';
import plugin from './_a-plugin.mjs';
-import { promises as fsp } from 'fs';
+import fs from 'node:fs/promises';
let original = '';
@@ -12,12 +12,12 @@ postcssTape(plugin)({
},
before: async () => {
if (original === '') {
- original = await fsp.readFile('./test/basic.css', 'utf8');
+ original = await fs.readFile('./test/basic.css', 'utf8');
}
- await fsp.writeFile('./test/basic.css', '.foos { order: 1; }');
+ await fs.writeFile('./test/basic.css', '.foos { order: 1; }');
},
after: async () => {
- await fsp.writeFile('./test/basic.css', original);
+ await fs.writeFile('./test/basic.css', original);
original = '';
},
},
diff --git a/packages/postcss-tape/test/basic.break-css.mjs b/packages/postcss-tape/test/basic.break-css.mjs
index 392152984..f18369bb4 100644
--- a/packages/postcss-tape/test/basic.break-css.mjs
+++ b/packages/postcss-tape/test/basic.break-css.mjs
@@ -1,12 +1,12 @@
import { postcssTape } from '../dist/index.mjs';
import plugin from './_a-plugin.mjs';
-import { promises as fsp } from 'fs';
+import fs from 'node:fs/promises';
postcssTape(plugin)({
'basic:break-css': {
message: 'supports basic usage',
after: async () => {
- await fsp.writeFile('./test/basic.break-css.result.css', 'world');
+ await fs.writeFile('./test/basic.break-css.result.css', 'world');
},
},
});
diff --git a/packages/selector-resolve-nested/CHANGELOG.md b/packages/selector-resolve-nested/CHANGELOG.md
index 3120273a0..ab5a854a3 100644
--- a/packages/selector-resolve-nested/CHANGELOG.md
+++ b/packages/selector-resolve-nested/CHANGELOG.md
@@ -1,5 +1,9 @@
# Changes to Selector Resolve Nested
+### Unreleased (major)
+
+- Updated: Support for Node v18+ (major).
+
## 1.1.0
_February 1, 2024_
diff --git a/packages/selector-resolve-nested/package.json b/packages/selector-resolve-nested/package.json
index 998dedd5d..93d95e7d4 100644
--- a/packages/selector-resolve-nested/package.json
+++ b/packages/selector-resolve-nested/package.json
@@ -25,7 +25,7 @@
}
],
"engines": {
- "node": "^14 || ^16 || >=18"
+ "node": ">=18"
},
"type": "module",
"main": "dist/index.cjs",
diff --git a/packages/selector-resolve-nested/test/_import.mjs b/packages/selector-resolve-nested/test/_import.mjs
index 8f0381ff3..c8874e95c 100644
--- a/packages/selector-resolve-nested/test/_import.mjs
+++ b/packages/selector-resolve-nested/test/_import.mjs
@@ -1,4 +1,4 @@
-import assert from 'assert';
+import assert from 'node:assert';
import { resolveNestedSelector } from '@csstools/selector-resolve-nested';
import parser from 'postcss-selector-parser';
diff --git a/packages/selector-specificity/CHANGELOG.md b/packages/selector-specificity/CHANGELOG.md
index e0ee38cd1..98c9462f4 100644
--- a/packages/selector-specificity/CHANGELOG.md
+++ b/packages/selector-specificity/CHANGELOG.md
@@ -1,5 +1,9 @@
# Changes to Selector Specificity
+### Unreleased (major)
+
+- Updated: Support for Node v18+ (major).
+
### 3.1.1
_May 13, 2024_
diff --git a/packages/selector-specificity/package.json b/packages/selector-specificity/package.json
index 4a4cdede6..624305ea2 100644
--- a/packages/selector-specificity/package.json
+++ b/packages/selector-specificity/package.json
@@ -25,7 +25,7 @@
}
],
"engines": {
- "node": "^14 || ^16 || >=18"
+ "node": ">=18"
},
"type": "module",
"main": "dist/index.cjs",
diff --git a/packages/selector-specificity/test/_import.mjs b/packages/selector-specificity/test/_import.mjs
index 9c969f45d..87ecac502 100644
--- a/packages/selector-specificity/test/_import.mjs
+++ b/packages/selector-specificity/test/_import.mjs
@@ -1,4 +1,4 @@
-import assert from 'assert';
+import assert from 'node:assert';
import { selectorSpecificity, compare } from '@csstools/selector-specificity';
assert.equal(selectorSpecificity().a, 0);
diff --git a/packages/selector-specificity/test/example.mjs b/packages/selector-specificity/test/example.mjs
index 76f086ec2..bb8c96777 100644
--- a/packages/selector-specificity/test/example.mjs
+++ b/packages/selector-specificity/test/example.mjs
@@ -1,4 +1,4 @@
-import assert from 'assert';
+import assert from 'node:assert';
import { selectorSpecificity } from '@csstools/selector-specificity';
import parser from 'postcss-selector-parser';
diff --git a/packages/selector-specificity/test/test-compare.mjs b/packages/selector-specificity/test/test-compare.mjs
index 19c71bfe3..7cc4f82a7 100644
--- a/packages/selector-specificity/test/test-compare.mjs
+++ b/packages/selector-specificity/test/test-compare.mjs
@@ -1,4 +1,4 @@
-import assert from 'assert';
+import assert from 'node:assert';
import { compare } from '@csstools/selector-specificity';
assert.strictEqual(compare({ a: 0, b: 0, c: 0 }, { a: 0, b: 0, c: 0 }), 0);
diff --git a/packages/selector-specificity/test/test-custom-specificity.mjs b/packages/selector-specificity/test/test-custom-specificity.mjs
index 85c3857c7..ac6900ec8 100644
--- a/packages/selector-specificity/test/test-custom-specificity.mjs
+++ b/packages/selector-specificity/test/test-custom-specificity.mjs
@@ -1,4 +1,4 @@
-import assert from 'assert';
+import assert from 'node:assert';
import { selectorSpecificity, specificityOfMostSpecificListItem } from '@csstools/selector-specificity';
import parser from 'postcss-selector-parser';
diff --git a/packages/selector-specificity/test/test.mjs b/packages/selector-specificity/test/test.mjs
index be64423cc..6f61ee40b 100644
--- a/packages/selector-specificity/test/test.mjs
+++ b/packages/selector-specificity/test/test.mjs
@@ -1,4 +1,4 @@
-import assert from 'assert';
+import assert from 'node:assert';
import { selectorSpecificity } from '@csstools/selector-specificity';
import parser from 'postcss-selector-parser';
diff --git a/packages/selector-specificity/test/tests-from-bramus-specificity.mjs b/packages/selector-specificity/test/tests-from-bramus-specificity.mjs
index 34ef667ab..74ec02881 100644
--- a/packages/selector-specificity/test/tests-from-bramus-specificity.mjs
+++ b/packages/selector-specificity/test/tests-from-bramus-specificity.mjs
@@ -1,4 +1,4 @@
-import assert from 'assert';
+import assert from 'node:assert';
import { selectorSpecificity } from '@csstools/selector-specificity';
import parser from 'postcss-selector-parser';
diff --git a/packages/selector-specificity/test/tests-from-keeganstreet-specificity.mjs b/packages/selector-specificity/test/tests-from-keeganstreet-specificity.mjs
index e263c4a50..655aed812 100644
--- a/packages/selector-specificity/test/tests-from-keeganstreet-specificity.mjs
+++ b/packages/selector-specificity/test/tests-from-keeganstreet-specificity.mjs
@@ -1,4 +1,4 @@
-import assert from 'assert';
+import assert from 'node:assert';
import { selectorSpecificity } from '@csstools/selector-specificity';
import parser from 'postcss-selector-parser';
diff --git a/packages/utilities/CHANGELOG.md b/packages/utilities/CHANGELOG.md
index ebf1f2a96..1f4aa5829 100644
--- a/packages/utilities/CHANGELOG.md
+++ b/packages/utilities/CHANGELOG.md
@@ -1,5 +1,9 @@
# Changes to Utilities
+### Unreleased (major)
+
+- Updated: Support for Node v18+ (major).
+
### 1.0.0
_February 19, 2024_
diff --git a/packages/utilities/package.json b/packages/utilities/package.json
index 47e3293b2..cc2e2051a 100644
--- a/packages/utilities/package.json
+++ b/packages/utilities/package.json
@@ -25,7 +25,7 @@
}
],
"engines": {
- "node": "^14 || ^16 || >=18"
+ "node": ">=18"
},
"type": "module",
"main": "dist/index.cjs",
diff --git a/packages/utilities/test/_import.mjs b/packages/utilities/test/_import.mjs
index 567e47d35..6b8b4641d 100644
--- a/packages/utilities/test/_import.mjs
+++ b/packages/utilities/test/_import.mjs
@@ -1,4 +1,4 @@
-import assert from 'assert';
+import assert from 'node:assert';
import { hasFallback } from '@csstools/utilities';
assert.ok(typeof hasFallback === 'function');
diff --git a/packages/utilities/test/has-fallback-decl.mjs b/packages/utilities/test/has-fallback-decl.mjs
index 94108bd76..c5e9c8b5f 100644
--- a/packages/utilities/test/has-fallback-decl.mjs
+++ b/packages/utilities/test/has-fallback-decl.mjs
@@ -1,5 +1,5 @@
import test from 'node:test';
-import assert from 'assert';
+import assert from 'node:assert';
import { hasFallback } from '@csstools/utilities';
import postcss from 'postcss';
diff --git a/packages/utilities/test/has-supports-at-rule-ancestor.mjs b/packages/utilities/test/has-supports-at-rule-ancestor.mjs
index 34d191489..b18c61af1 100644
--- a/packages/utilities/test/has-supports-at-rule-ancestor.mjs
+++ b/packages/utilities/test/has-supports-at-rule-ancestor.mjs
@@ -1,5 +1,5 @@
import test from 'node:test';
-import assert from 'assert';
+import assert from 'node:assert';
import { hasSupportsAtRuleAncestor } from '@csstools/utilities';
import postcss from 'postcss';
diff --git a/plugin-packs/postcss-bundler/CHANGELOG.md b/plugin-packs/postcss-bundler/CHANGELOG.md
index ca8b45bbd..c3962d81f 100644
--- a/plugin-packs/postcss-bundler/CHANGELOG.md
+++ b/plugin-packs/postcss-bundler/CHANGELOG.md
@@ -1,5 +1,9 @@
# Changes to PostCSS Bundler
+### Unreleased (major)
+
+- Updated: Support for Node v18+ (major).
+
### 1.0.15
_July 6, 2024_
diff --git a/plugin-packs/postcss-bundler/dist/index.cjs b/plugin-packs/postcss-bundler/dist/index.cjs
index 741109ff2..c037fa3ee 100644
--- a/plugin-packs/postcss-bundler/dist/index.cjs
+++ b/plugin-packs/postcss-bundler/dist/index.cjs
@@ -1 +1 @@
-"use strict";var e=require("@csstools/css-parser-algorithms"),t=require("@csstools/css-tokenizer"),s=require("path"),o=require("module"),n=require("fs/promises"),r=require("@csstools/postcss-rebase-url");function isWarning(e){return"warning"===e.type}function isNodesStatement(e){return"nodes"===e.type}function isImportStatement(e){return"import"===e.type}function isPreImportStatement(e){return"pre-import"===e.type}const i=/^data:text\/css(?:;(?:base64|plain))?,/i,a=/^data:text\/css;base64,/i,c=/^data:text\/css;plain,/i;function isValidDataURL(e){return!!e&&i.test(e)}const p=/^charset$/i,u=/^import$/i,l=/^url$/i,m=/^layer$/i,d=/^supports$/i;function parseAtImport(s){const o=t.tokenize({css:s});if(2===o.length&&(t.isTokenString(o[0])||t.isTokenURL(o[0]))){let e=o[0][4].value;return e=stripHash(e),!!e&&{uri:e,fullUri:o[0][1]}}const n=e.parseListOfComponentValues(o);let r,i,a,c="",p="";for(let s=0;s{const i=parseStylesheet(e,t,s,o,n);if(r.charset&&i.charset&&r.charset.params.toLowerCase()!==i.charset.params.toLowerCase())throw i.charset.error(`Incompatible @charset statements:\n ${i.charset.params} specified in ${i.charset.source?.input.file}\n ${r.charset.params} specified in ${r.charset.source?.input.file}`);!r.charset&&i.charset&&(r.charset=i.charset),r.statements.push(...i.statements)})),r;let i,a,c=[],l=[];for(let r=0;r({postcssPlugin:"noop-plugin",Once(){}});async function parseStyles(e,t,s,o,n,r){const i=parseStylesheet(e,t,s,o,n);{let t,s,o;const n=[];for(const a of i.statements)isImportStatement(a)&&isProcessableURL(a.uri)&&(t&&s&&o||([t,s,o]=createRequire(a.node,e),t&&s&&o))&&n.push(resolveImportId(e,a,r,t,s,o));n.length&&await Promise.all(n)}for(let e=0;e{if(isWarning(s)||isPreImportStatement(s)||!s.conditions?.length)return;if(isImportStatement(s))return void(s.node.params=base64EncodedConditionalImport(s.fullUri,s.conditions));const n=s.nodes;if(!n.length)return;const r=n[0].parent;if(!r)return;const i=[];for(const e of s.conditions){if(void 0!==e.media){const o=t({name:"media",params:e.media,source:s.importingNode?.source??r.source});i.push(o)}if(void 0!==e.supports){const o=t({name:"supports",params:"("+e.supports+")",source:s.importingNode?.source??r.source});i.push(o)}if(void 0!==e.layer){const o=t({name:"layer",params:e.layer,source:s.importingNode?.source??r.source});i.push(o)}}const a=i[0];if(!a)return;for(let e=0;e{e.parent=void 0})),c.append(n),e.statements[o]={type:"nodes",nodes:[a],conditions:s.conditions,from:s.from,importingNode:s.importingNode}}))}function applyStyles(e,t){t.nodes=[],e.charset&&(e.charset.parent=void 0,t.append(e.charset)),e.statements.forEach((e=>{isImportStatement(e)?(e.node.parent=void 0,t.append(e.node)):isNodesStatement(e)&&e.nodes.forEach((e=>{e.parent=void 0,t.append(e)}))}))}function postProcess(e,t){let s=-1,o=-1,n=-1;for(let t=0;t({postcssPlugin:"postcss-bundler",async Once(e,{result:t,atRule:s,postcss:o}){const n=await parseStyles(t,e,null,[],[],o);postProcess(n,s),applyConditions(n,s),applyStyles(n,e)}});creator$1.postcss=!0;const creator=()=>({postcssPlugin:"postcss-bundler",plugins:[creator$1(),r()]});creator.postcss=!0,module.exports=creator;
+"use strict";var e=require("@csstools/css-parser-algorithms"),t=require("@csstools/css-tokenizer"),s=require("node:path"),o=require("node:module"),n=require("node:fs/promises"),r=require("@csstools/postcss-rebase-url");function isWarning(e){return"warning"===e.type}function isNodesStatement(e){return"nodes"===e.type}function isImportStatement(e){return"import"===e.type}function isPreImportStatement(e){return"pre-import"===e.type}const i=/^data:text\/css(?:;(?:base64|plain))?,/i,a=/^data:text\/css;base64,/i,c=/^data:text\/css;plain,/i;function isValidDataURL(e){return!!e&&i.test(e)}const p=/^charset$/i,u=/^import$/i,l=/^url$/i,m=/^layer$/i,d=/^supports$/i;function parseAtImport(s){const o=t.tokenize({css:s});if(2===o.length&&(t.isTokenString(o[0])||t.isTokenURL(o[0]))){let e=o[0][4].value;return e=stripHash(e),!!e&&{uri:e,fullUri:o[0][1]}}const n=e.parseListOfComponentValues(o);let r,i,a,c="",p="";for(let s=0;s{const i=parseStylesheet(e,t,s,o,n);if(r.charset&&i.charset&&r.charset.params.toLowerCase()!==i.charset.params.toLowerCase())throw i.charset.error(`Incompatible @charset statements:\n ${i.charset.params} specified in ${i.charset.source?.input.file}\n ${r.charset.params} specified in ${r.charset.source?.input.file}`);!r.charset&&i.charset&&(r.charset=i.charset),r.statements.push(...i.statements)})),r;let i,a,c=[],l=[];for(let r=0;r({postcssPlugin:"noop-plugin",Once(){}});async function parseStyles(e,t,s,o,n,r){const i=parseStylesheet(e,t,s,o,n);{let t,s,o;const n=[];for(const a of i.statements)isImportStatement(a)&&isProcessableURL(a.uri)&&(t&&s&&o||([t,s,o]=createRequire(a.node,e),t&&s&&o))&&n.push(resolveImportId(e,a,r,t,s,o));n.length&&await Promise.all(n)}for(let e=0;e{if(isWarning(s)||isPreImportStatement(s)||!s.conditions?.length)return;if(isImportStatement(s))return void(s.node.params=base64EncodedConditionalImport(s.fullUri,s.conditions));const n=s.nodes;if(!n.length)return;const r=n[0].parent;if(!r)return;const i=[];for(const e of s.conditions){if(void 0!==e.media){const o=t({name:"media",params:e.media,source:s.importingNode?.source??r.source});i.push(o)}if(void 0!==e.supports){const o=t({name:"supports",params:"("+e.supports+")",source:s.importingNode?.source??r.source});i.push(o)}if(void 0!==e.layer){const o=t({name:"layer",params:e.layer,source:s.importingNode?.source??r.source});i.push(o)}}const a=i[0];if(!a)return;for(let e=0;e{e.parent=void 0})),c.append(n),e.statements[o]={type:"nodes",nodes:[a],conditions:s.conditions,from:s.from,importingNode:s.importingNode}}))}function applyStyles(e,t){t.nodes=[],e.charset&&(e.charset.parent=void 0,t.append(e.charset)),e.statements.forEach((e=>{isImportStatement(e)?(e.node.parent=void 0,t.append(e.node)):isNodesStatement(e)&&e.nodes.forEach((e=>{e.parent=void 0,t.append(e)}))}))}function postProcess(e,t){let s=-1,o=-1,n=-1;for(let t=0;t({postcssPlugin:"postcss-bundler",async Once(e,{result:t,atRule:s,postcss:o}){const n=await parseStyles(t,e,null,[],[],o);postProcess(n,s),applyConditions(n,s),applyStyles(n,e)}});creator$1.postcss=!0;const creator=()=>({postcssPlugin:"postcss-bundler",plugins:[creator$1(),r()]});creator.postcss=!0,module.exports=creator;
diff --git a/plugin-packs/postcss-bundler/dist/index.mjs b/plugin-packs/postcss-bundler/dist/index.mjs
index 0ee1f31f8..4ed38f2c3 100644
--- a/plugin-packs/postcss-bundler/dist/index.mjs
+++ b/plugin-packs/postcss-bundler/dist/index.mjs
@@ -1 +1 @@
-import{parseListOfComponentValues as e,isWhitespaceNode as t,isCommentNode as s,isTokenNode as o,isFunctionNode as r,stringify as n}from"@csstools/css-parser-algorithms";import{tokenize as i,isTokenString as a,isTokenURL as c,isTokenIdent as p}from"@csstools/css-tokenizer";import u from"path";import l from"module";import m from"fs/promises";import d from"@csstools/postcss-rebase-url";function isWarning(e){return"warning"===e.type}function isNodesStatement(e){return"nodes"===e.type}function isImportStatement(e){return"import"===e.type}function isPreImportStatement(e){return"pre-import"===e.type}const f=/^data:text\/css(?:;(?:base64|plain))?,/i,h=/^data:text\/css;base64,/i,y=/^data:text\/css;plain,/i;function isValidDataURL(e){return!!e&&f.test(e)}const g=/^charset$/i,v=/^import$/i,I=/^url$/i,S=/^layer$/i,b=/^supports$/i;function parseAtImport(u){const l=i({css:u});if(2===l.length&&(a(l[0])||c(l[0]))){let e=l[0][4].value;return e=stripHash(e),!!e&&{uri:e,fullUri:l[0][1]}}const m=e(l);let d,f,h,y="",g="";for(let e=0;e{const i=parseStylesheet(e,t,s,o,r);if(n.charset&&i.charset&&n.charset.params.toLowerCase()!==i.charset.params.toLowerCase())throw i.charset.error(`Incompatible @charset statements:\n ${i.charset.params} specified in ${i.charset.source?.input.file}\n ${n.charset.params} specified in ${n.charset.source?.input.file}`);!n.charset&&i.charset&&(n.charset=i.charset),n.statements.push(...i.statements)})),n;let i,a,c=[],p=[];for(let n=0;n({postcssPlugin:"noop-plugin",Once(){}});async function parseStyles(e,t,s,o,r,n){const i=parseStylesheet(e,t,s,o,r);{let t,s,o;const r=[];for(const a of i.statements)isImportStatement(a)&&isProcessableURL(a.uri)&&(t&&s&&o||([t,s,o]=createRequire(a.node,e),t&&s&&o))&&r.push(resolveImportId(e,a,n,t,s,o));r.length&&await Promise.all(r)}for(let e=0;e{if(isWarning(s)||isPreImportStatement(s)||!s.conditions?.length)return;if(isImportStatement(s))return void(s.node.params=base64EncodedConditionalImport(s.fullUri,s.conditions));const r=s.nodes;if(!r.length)return;const n=r[0].parent;if(!n)return;const i=[];for(const e of s.conditions){if(void 0!==e.media){const o=t({name:"media",params:e.media,source:s.importingNode?.source??n.source});i.push(o)}if(void 0!==e.supports){const o=t({name:"supports",params:"("+e.supports+")",source:s.importingNode?.source??n.source});i.push(o)}if(void 0!==e.layer){const o=t({name:"layer",params:e.layer,source:s.importingNode?.source??n.source});i.push(o)}}const a=i[0];if(!a)return;for(let e=0;e{e.parent=void 0})),c.append(r),e.statements[o]={type:"nodes",nodes:[a],conditions:s.conditions,from:s.from,importingNode:s.importingNode}}))}function applyStyles(e,t){t.nodes=[],e.charset&&(e.charset.parent=void 0,t.append(e.charset)),e.statements.forEach((e=>{isImportStatement(e)?(e.node.parent=void 0,t.append(e.node)):isNodesStatement(e)&&e.nodes.forEach((e=>{e.parent=void 0,t.append(e)}))}))}function postProcess(e,t){let s=-1,o=-1,r=-1;for(let t=0;t({postcssPlugin:"postcss-bundler",async Once(e,{result:t,atRule:s,postcss:o}){const r=await parseStyles(t,e,null,[],[],o);postProcess(r,s),applyConditions(r,s),applyStyles(r,e)}});creator$1.postcss=!0;const creator=()=>({postcssPlugin:"postcss-bundler",plugins:[creator$1(),d()]});creator.postcss=!0;export{creator as default};
+import{parseListOfComponentValues as e,isWhitespaceNode as t,isCommentNode as s,isTokenNode as o,isFunctionNode as r,stringify as n}from"@csstools/css-parser-algorithms";import{tokenize as i,isTokenString as a,isTokenURL as c,isTokenIdent as p}from"@csstools/css-tokenizer";import u from"node:path";import l from"node:module";import m from"node:fs/promises";import d from"@csstools/postcss-rebase-url";function isWarning(e){return"warning"===e.type}function isNodesStatement(e){return"nodes"===e.type}function isImportStatement(e){return"import"===e.type}function isPreImportStatement(e){return"pre-import"===e.type}const f=/^data:text\/css(?:;(?:base64|plain))?,/i,h=/^data:text\/css;base64,/i,y=/^data:text\/css;plain,/i;function isValidDataURL(e){return!!e&&f.test(e)}const g=/^charset$/i,v=/^import$/i,I=/^url$/i,S=/^layer$/i,b=/^supports$/i;function parseAtImport(u){const l=i({css:u});if(2===l.length&&(a(l[0])||c(l[0]))){let e=l[0][4].value;return e=stripHash(e),!!e&&{uri:e,fullUri:l[0][1]}}const m=e(l);let d,f,h,y="",g="";for(let e=0;e{const i=parseStylesheet(e,t,s,o,r);if(n.charset&&i.charset&&n.charset.params.toLowerCase()!==i.charset.params.toLowerCase())throw i.charset.error(`Incompatible @charset statements:\n ${i.charset.params} specified in ${i.charset.source?.input.file}\n ${n.charset.params} specified in ${n.charset.source?.input.file}`);!n.charset&&i.charset&&(n.charset=i.charset),n.statements.push(...i.statements)})),n;let i,a,c=[],p=[];for(let n=0;n({postcssPlugin:"noop-plugin",Once(){}});async function parseStyles(e,t,s,o,r,n){const i=parseStylesheet(e,t,s,o,r);{let t,s,o;const r=[];for(const a of i.statements)isImportStatement(a)&&isProcessableURL(a.uri)&&(t&&s&&o||([t,s,o]=createRequire(a.node,e),t&&s&&o))&&r.push(resolveImportId(e,a,n,t,s,o));r.length&&await Promise.all(r)}for(let e=0;e{if(isWarning(s)||isPreImportStatement(s)||!s.conditions?.length)return;if(isImportStatement(s))return void(s.node.params=base64EncodedConditionalImport(s.fullUri,s.conditions));const r=s.nodes;if(!r.length)return;const n=r[0].parent;if(!n)return;const i=[];for(const e of s.conditions){if(void 0!==e.media){const o=t({name:"media",params:e.media,source:s.importingNode?.source??n.source});i.push(o)}if(void 0!==e.supports){const o=t({name:"supports",params:"("+e.supports+")",source:s.importingNode?.source??n.source});i.push(o)}if(void 0!==e.layer){const o=t({name:"layer",params:e.layer,source:s.importingNode?.source??n.source});i.push(o)}}const a=i[0];if(!a)return;for(let e=0;e{e.parent=void 0})),c.append(r),e.statements[o]={type:"nodes",nodes:[a],conditions:s.conditions,from:s.from,importingNode:s.importingNode}}))}function applyStyles(e,t){t.nodes=[],e.charset&&(e.charset.parent=void 0,t.append(e.charset)),e.statements.forEach((e=>{isImportStatement(e)?(e.node.parent=void 0,t.append(e.node)):isNodesStatement(e)&&e.nodes.forEach((e=>{e.parent=void 0,t.append(e)}))}))}function postProcess(e,t){let s=-1,o=-1,r=-1;for(let t=0;t({postcssPlugin:"postcss-bundler",async Once(e,{result:t,atRule:s,postcss:o}){const r=await parseStyles(t,e,null,[],[],o);postProcess(r,s),applyConditions(r,s),applyStyles(r,e)}});creator$1.postcss=!0;const creator=()=>({postcssPlugin:"postcss-bundler",plugins:[creator$1(),d()]});creator.postcss=!0;export{creator as default};
diff --git a/plugin-packs/postcss-bundler/package.json b/plugin-packs/postcss-bundler/package.json
index 02e1e6b6a..ae8e0fdb1 100644
--- a/plugin-packs/postcss-bundler/package.json
+++ b/plugin-packs/postcss-bundler/package.json
@@ -25,7 +25,7 @@
}
],
"engines": {
- "node": "^14 || ^16 || >=18"
+ "node": ">=18"
},
"type": "module",
"main": "dist/index.cjs",
diff --git a/plugin-packs/postcss-bundler/src/postcss-import/lib/apply-conditions.ts b/plugin-packs/postcss-bundler/src/postcss-import/lib/apply-conditions.ts
index 8fe57322d..363436b4f 100644
--- a/plugin-packs/postcss-bundler/src/postcss-import/lib/apply-conditions.ts
+++ b/plugin-packs/postcss-bundler/src/postcss-import/lib/apply-conditions.ts
@@ -1,5 +1,6 @@
import type { AtRule, AtRuleProps } from 'postcss';
-import { Stylesheet, isImportStatement, isPreImportStatement, isWarning } from './statement';
+import type { Stylesheet} from './statement';
+import { isImportStatement, isPreImportStatement, isWarning } from './statement';
import { base64EncodedConditionalImport } from './base64-encoded-import';
export function applyConditions(stylesheet: Stylesheet, atRule: (defaults?: AtRuleProps) => AtRule): void {
diff --git a/plugin-packs/postcss-bundler/src/postcss-import/lib/apply-styles.ts b/plugin-packs/postcss-bundler/src/postcss-import/lib/apply-styles.ts
index 51384cb69..a2689a8b4 100644
--- a/plugin-packs/postcss-bundler/src/postcss-import/lib/apply-styles.ts
+++ b/plugin-packs/postcss-bundler/src/postcss-import/lib/apply-styles.ts
@@ -1,5 +1,6 @@
import type { Document, Root } from 'postcss';
-import { Stylesheet, isImportStatement, isNodesStatement } from './statement';
+import type { Stylesheet} from './statement';
+import { isImportStatement, isNodesStatement } from './statement';
export function applyStyles(stylesheet: Stylesheet, styles: Root | Document): void {
styles.nodes = [];
diff --git a/plugin-packs/postcss-bundler/src/postcss-import/lib/base64-encoded-import.ts b/plugin-packs/postcss-bundler/src/postcss-import/lib/base64-encoded-import.ts
index 6b30e8f6d..97273b301 100644
--- a/plugin-packs/postcss-bundler/src/postcss-import/lib/base64-encoded-import.ts
+++ b/plugin-packs/postcss-bundler/src/postcss-import/lib/base64-encoded-import.ts
@@ -1,4 +1,4 @@
-import { Condition } from './conditions';
+import type { Condition } from './conditions';
import { formatImportPrelude } from './format-import-prelude';
// Base64 encode an import with conditions
diff --git a/plugin-packs/postcss-bundler/src/postcss-import/lib/load-content.ts b/plugin-packs/postcss-bundler/src/postcss-import/lib/load-content.ts
index 622140182..fb15cb6dc 100644
--- a/plugin-packs/postcss-bundler/src/postcss-import/lib/load-content.ts
+++ b/plugin-packs/postcss-bundler/src/postcss-import/lib/load-content.ts
@@ -1,4 +1,4 @@
-import fs from 'fs/promises';
+import fs from 'node:fs/promises';
import { dataURLContents, isValidDataURL } from './data-url';
export async function loadContent(filename: string): Promise {
diff --git a/plugin-packs/postcss-bundler/src/postcss-import/lib/parse-styles.ts b/plugin-packs/postcss-bundler/src/postcss-import/lib/parse-styles.ts
index e086621c6..a5fdde762 100644
--- a/plugin-packs/postcss-bundler/src/postcss-import/lib/parse-styles.ts
+++ b/plugin-packs/postcss-bundler/src/postcss-import/lib/parse-styles.ts
@@ -1,6 +1,7 @@
import type { Document, Postcss, Result, Root, AtRule } from 'postcss';
-import { ImportStatement, Stylesheet, isImportStatement } from './statement';
-import { Condition } from './conditions';
+import type { ImportStatement, Stylesheet} from './statement';
+import { isImportStatement } from './statement';
+import type { Condition } from './conditions';
import { isValidDataURL } from './data-url';
import { parseStylesheet } from './parse-stylesheet';
import { createRequire, resolveId } from './resolve-id';
diff --git a/plugin-packs/postcss-bundler/src/postcss-import/lib/parse-stylesheet.ts b/plugin-packs/postcss-bundler/src/postcss-import/lib/parse-stylesheet.ts
index 999b8349f..45158da2e 100644
--- a/plugin-packs/postcss-bundler/src/postcss-import/lib/parse-stylesheet.ts
+++ b/plugin-packs/postcss-bundler/src/postcss-import/lib/parse-stylesheet.ts
@@ -1,6 +1,6 @@
import type { AtRule, ChildNode, Document, Result, Root, Warning } from 'postcss';
-import { Condition } from './conditions';
-import { Stylesheet, ImportStatement, Statement } from './statement';
+import type { Condition } from './conditions';
+import type { Stylesheet, ImportStatement, Statement } from './statement';
import { IS_CHARSET_REGEX, IS_IMPORT_REGEX, IS_LAYER_REGEX } from './names';
import { parseAtImport } from './parse-at-import';
diff --git a/plugin-packs/postcss-bundler/src/postcss-import/lib/post-process.ts b/plugin-packs/postcss-bundler/src/postcss-import/lib/post-process.ts
index 2b140fb20..8a5eeb296 100644
--- a/plugin-packs/postcss-bundler/src/postcss-import/lib/post-process.ts
+++ b/plugin-packs/postcss-bundler/src/postcss-import/lib/post-process.ts
@@ -1,5 +1,6 @@
import type { AtRule, AtRuleProps } from 'postcss';
-import { ImportStatement, NodesStatement, Stylesheet, isImportStatement, isNodesStatement, isPreImportStatement } from './statement';
+import type { ImportStatement, NodesStatement, Stylesheet} from './statement';
+import { isImportStatement, isNodesStatement, isPreImportStatement } from './statement';
export function postProcess(stylesheet: Stylesheet, atRule: (defaults?: AtRuleProps) => AtRule): void {
let indexOfFirstImport = -1;
diff --git a/plugin-packs/postcss-bundler/src/postcss-import/lib/resolve-id.ts b/plugin-packs/postcss-bundler/src/postcss-import/lib/resolve-id.ts
index b4f9b0e20..a71a6c362 100644
--- a/plugin-packs/postcss-bundler/src/postcss-import/lib/resolve-id.ts
+++ b/plugin-packs/postcss-bundler/src/postcss-import/lib/resolve-id.ts
@@ -1,6 +1,6 @@
import type { Node, Result } from 'postcss';
-import path from 'path';
-import module from 'module';
+import path from 'node:path';
+import module from 'node:module';
export function resolveId(node: Node, require: NodeRequire, id: string, base: string): string {
let resolvedPath = '';
diff --git a/plugin-packs/postcss-bundler/src/postcss-import/lib/statement.ts b/plugin-packs/postcss-bundler/src/postcss-import/lib/statement.ts
index 3f16e781e..516562e3a 100644
--- a/plugin-packs/postcss-bundler/src/postcss-import/lib/statement.ts
+++ b/plugin-packs/postcss-bundler/src/postcss-import/lib/statement.ts
@@ -1,5 +1,5 @@
import type { AtRule, ChildNode, Warning } from 'postcss';
-import { Condition } from './conditions';
+import type { Condition } from './conditions';
export type Stylesheet = {
charset?: AtRule;
diff --git a/plugin-packs/postcss-bundler/test/_import.mjs b/plugin-packs/postcss-bundler/test/_import.mjs
index 142e3aa2e..65c64f112 100644
--- a/plugin-packs/postcss-bundler/test/_import.mjs
+++ b/plugin-packs/postcss-bundler/test/_import.mjs
@@ -1,4 +1,4 @@
-import assert from 'assert';
+import assert from 'node:assert';
import plugin from '@csstools/postcss-bundler';
plugin();
diff --git a/plugin-packs/postcss-bundler/test/_tape.mjs b/plugin-packs/postcss-bundler/test/_tape.mjs
index 096d40166..71b9eeb95 100644
--- a/plugin-packs/postcss-bundler/test/_tape.mjs
+++ b/plugin-packs/postcss-bundler/test/_tape.mjs
@@ -1,7 +1,7 @@
import { postcssTape } from '@csstools/postcss-tape';
import plugin from '@csstools/postcss-bundler';
-import fs from 'fs/promises';
-import path from 'path';
+import fs from 'node:fs/promises';
+import path from 'node:path';
const testCases = {
basic: {
diff --git a/plugin-packs/postcss-preset-env/CHANGELOG.md b/plugin-packs/postcss-preset-env/CHANGELOG.md
index 4b87b9ffa..9f52758a0 100644
--- a/plugin-packs/postcss-preset-env/CHANGELOG.md
+++ b/plugin-packs/postcss-preset-env/CHANGELOG.md
@@ -1,5 +1,11 @@
# Changes to PostCSS Preset Env
+### Unreleased (major)
+
+Read more about the specific changes on our [wiki](https://github.com/csstools/postcss-plugins/wiki/PostCSS-Preset-Env-10)
+
+- Updated: Support for Node v18+ (major).
+
### 9.6.0
_July 7, 2024_
diff --git a/plugin-packs/postcss-preset-env/dist/index.cjs b/plugin-packs/postcss-preset-env/dist/index.cjs
index b362eaeaa..8cdab635f 100644
--- a/plugin-packs/postcss-preset-env/dist/index.cjs
+++ b/plugin-packs/postcss-preset-env/dist/index.cjs
@@ -1 +1 @@
-"use strict";var s=require("autoprefixer"),e=require("cssdb"),o=require("browserslist"),t=require("@csstools/postcss-initial"),i=require("postcss-pseudo-class-any-link"),r=require("css-blank-pseudo"),a=require("postcss-page-break"),c=require("@csstools/postcss-cascade-layers"),n=require("postcss-attribute-case-insensitive"),p=require("postcss-clamp"),l=require("@csstools/postcss-color-function"),u=require("postcss-color-functional-notation"),m=require("@csstools/postcss-color-mix-function"),d=require("@csstools/postcss-content-alt-text"),g=require("postcss-custom-media"),f=require("postcss-custom-properties"),b=require("postcss-custom-selectors"),h=require("postcss-dir-pseudo-class"),v=require("@csstools/postcss-normalize-display-values"),N=require("postcss-double-position-gradients"),k=require("@csstools/postcss-exponential-functions"),y=require("@csstools/postcss-logical-float-and-clear"),w=require("postcss-focus-visible"),q=require("postcss-focus-within"),x=require("@csstools/postcss-font-format-keywords"),F=require("postcss-font-variant"),$=require("@csstools/postcss-gamut-mapping"),O=require("postcss-gap-properties"),S=require("@csstools/postcss-gradients-interpolation-method"),P=require("css-has-pseudo"),C=require("postcss-color-hex-alpha"),I=require("@csstools/postcss-hwb-function"),B=require("@csstools/postcss-ic-unit"),E=require("postcss-image-set-function"),A=require("@csstools/postcss-is-pseudo-class"),L=require("postcss-lab-function"),U=require("@csstools/postcss-light-dark-function"),_=require("@csstools/postcss-logical-overflow"),j=require("@csstools/postcss-logical-overscroll-behavior"),M=require("postcss-logical"),z=require("@csstools/postcss-logical-resize"),D=require("@csstools/postcss-logical-viewport-units"),R=require("@csstools/postcss-media-queries-aspect-ratio-number-values"),T=require("@csstools/postcss-media-minmax"),V=require("@csstools/postcss-nested-calc"),H=require("postcss-nesting"),W=require("postcss-selector-not"),G=require("@csstools/postcss-oklab-function"),K=require("postcss-opacity-percentage"),Z=require("postcss-overflow-shorthand"),Q=require("postcss-replace-overflow-wrap"),J=require("postcss-place"),X=require("css-prefers-color-scheme"),Y=require("@csstools/postcss-progressive-custom-properties"),ss=require("postcss-color-rebeccapurple"),es=require("@csstools/postcss-relative-color-syntax"),os=require("@csstools/postcss-scope-pseudo-class"),ts=require("@csstools/postcss-stepped-value-functions"),is=require("@csstools/postcss-text-decoration-shorthand"),rs=require("@csstools/postcss-trigonometric-functions"),as=require("@csstools/postcss-unset-value");const cs={"blank-pseudo-class":"https://github.com/csstools/postcss-plugins/blob/main/plugins/css-blank-pseudo/README.md#browser","focus-visible-pseudo-class":"https://github.com/WICG/focus-visible","focus-within-pseudo-class":"https://github.com/csstools/postcss-plugins/blob/main/plugins/postcss-focus-within/README.md#browser","has-pseudo-class":"https://github.com/csstools/postcss-plugins/blob/main/plugins/css-has-pseudo/README.md#browser","prefers-color-scheme-query":"https://github.com/csstools/postcss-plugins/blob/main/plugins/css-prefers-color-scheme/README.md#browser"},ns=["blank-pseudo-class","focus-visible-pseudo-class","focus-within-pseudo-class","has-pseudo-class","prefers-color-scheme-query"];function logFeaturesList(s,e,o){if(e.debug){o.log("Enabling the following feature(s):");const t=[],i=[];!1!==e.autoprefixer&&i.push(" autoprefixer"),s.forEach((s=>{s.id.startsWith("before")||s.id.startsWith("after")?i.push(` ${s.id} (injected via options)`):i.push(` ${s.id}`),void 0!==cs[s.id]&&t.push(s.id)})),i.sort(((s,e)=>s.localeCompare(e))),t.sort(((s,e)=>s.localeCompare(e))),i.forEach((s=>o.log(s))),t.length&&(o.log("These feature(s) need a browser library to work:"),t.forEach((s=>o.log(` ${s}: ${cs[s]}`))))}}function initializeSharedOptions(s){if("preserve"in s){const e={};return e.preserve=s.preserve,e}return!1}function clamp(s,e,o){return Math.max(s,Math.min(e,o))}const ps=2,ls=5;function stageFromOptions(s,e){let o=ps;if(void 0===s.stage)return e.log(`Using features from Stage ${ps} (default).`),o;if(!1===s.stage)o=ls;else{let e=parseInt(s.stage,10);Number.isNaN(e)&&(e=0),o=clamp(0,e,ls)}return o===ls?e.log('Stage has been disabled, features will be handled via the "features" option.'):e.log(`Using features from Stage ${o}.`),o}const us=Symbol("insertBefore"),ms=Symbol("insertAfter"),ds=Symbol("insertOrder"),gs=Symbol("plugin");function getTransformedInsertions(s,e,o){if("insertBefore"!==o&&"insertAfter"!==o)return[];const t="insertBefore"===o?us:ms,i=[];for(const o in e){if(!Object.hasOwnProperty.call(e,o))continue;if(!s.find((s=>s.id===o)))continue;let r=e[o];Array.isArray(r)||(r=[r]);for(let s=0;sfeatureIsInsertedOrHasAPlugin(s))).sort(((s,e)=>featureIsLess(s,e)))}const qs=["and_chr","and_ff","android","chrome","edge","firefox","ie","ios_saf","op_mini","op_mob","opera","safari","samsung"];function getUnsupportedBrowsersByFeature(s){if(!s)return[];if(!("browser_support"in s))return["> 0%"];const e=[];return qs.forEach((o=>{if("op_mini"===o&&void 0===s.browser_support[o])return void e.push("op_mini all");const t=s.browser_support[o];"string"==typeof t&&xs.test(t)?e.push(`${o} < ${s.browser_support[o]}`):e.push(`${o} >= 1`)})),e}const xs=/^[0-9|.]+$/;function getOptionsForBrowsersByFeature(s,e,o,t,i){switch(e.id){case"is-pseudo-class":return{onComplexSelector:"warning"};case"nesting-rules":if(needsOptionFor(o.find((s=>"is-pseudo-class"===s.id)),s))return i.log("- 'nesting-rules' setting 'noIsPseudoSelector: true' due to lack of browser support for ':is()'."),{noIsPseudoSelector:!0};return{};case"any-link-pseudo-class":if(s.find((s=>s.startsWith("ie ")||"edge 12"===s||"edge 13"===s||"edge 14"===s||"edge 15"===s||"edge 16"===s||"edge 17"===s||"edge 18"===s)))return i.log("- 'any-link-pseudo-class' setting 'subFeatures: { areaHrefNeedsFixing: true }' due to lack of browser support for area[href] in Edge and IE."),{subFeatures:{areaHrefNeedsFixing:!0}};return{};case"logical-properties-and-values":case"float-clear-logical-values":case"logical-resize":case"logical-viewport-units":case"logical-overflow":case"logical-overscroll-behavior":return"logical"in t?t.logical:{};default:return{}}}function needsOptionFor(s,e){const t=getUnsupportedBrowsersByFeature(s),i=o(t,{ignoreUnknownVersions:!0});return!!e.some((s=>i.some((e=>e===s))))}function formatPolyfillableFeature(s){const e=getUnsupportedBrowsersByFeature(s);if(s[us]||s[ms]){let o=s.id;return o=s.insertBefore?`before-${o}`:`after-${o}`,{browsers:e,vendors_implementations:s.vendors_implementations,plugin:s[gs],id:o,stage:ls+1}}return{browsers:e,vendors_implementations:s.vendors_implementations,plugin:ws.get(s.id),id:s.id,stage:s.stage}}function formatStagedFeature(s,e,o,t,i,r,a){let c,n;return c=getOptionsForBrowsersByFeature(e,t,s,r,a),c=i?Object.assign({},c,i,featureOptions(o,t.id)):Object.assign({},c,featureOptions(o,t.id)),"progressive-custom-properties"!==t.id&&(c.enableProgressiveCustomProperties=!1),"overflow-wrap-property"===t.id&&"preserve"in c&&(c.method=c.preserve?"copy":"replace"),n=t.plugin.postcss&&"function"==typeof t.plugin?t.plugin(c):t.plugin&&t.plugin.default&&"function"==typeof t.plugin.default&&t.plugin.default.postcss?t.plugin.default(c):t.plugin,{browsers:t.browsers,vendors_implementations:t.vendors_implementations,plugin:n,pluginOptions:c,id:t.id}}function featureOptions(s,e){if(!(e in s))return;const o=s[e];return Array.isArray(o)?o[1]:o}function intOrZero(s){const e=parseInt(s,10);return Number.isNaN(e)?0:e}const Fs=new Set(["progressive-custom-properties"]);function listFeatures(s,e,t,i){const r=Object(e.features),a="enableClientSidePolyfills"in e&&e.enableClientSidePolyfills,c=Object(e.insertBefore),n=Object(e.insertAfter),p=e.browsers?void 0:e.env,l=e.browsers,u=clamp(0,intOrZero(e.minimumVendorImplementations),3);u>0&&i.log(`Using features with ${u} or more vendor implementations.`);const m=stageFromOptions(e,i),d=prepareFeaturesList([...s,{id:"progressive-custom-properties"}],c,n).map((s=>formatPolyfillableFeature(s))).filter((s=>!!Fs.has(s.id)||(0===u||(!(!s[us]&&!s[ms])||(u<=s.vendors_implementations||(!0===featureEnabledByOptions(r,s.id)?(i.log(`- '${s.id}' enabled manually even when it lacks the required interop (${s.vendors_implementations} out of ${u}).`),!0):(i.log(`- '${s.id}' disabled because it lacks the required interop (${s.vendors_implementations} out of ${u}).`),!1))))))),g=o(l,{env:p,ignoreUnknownVersions:!0}).filter((s=>qs.includes(s.split(" ")[0])));return d.filter((s=>{if(Fs.has(s.id))return!0;const e=s.stage>=m,o=a||!ns.includes(s.id),t=featureEnabledByOptions(r,s.id),c=!1===t,n=!0===t||e&&o;return c?i.log(`- '${s.id}' disabled manually`):e?o||i.log(`- '${s.id}' disabled because 'enableClientSidePolyfills' is 'false'.`):n?i.log(`- '${s.id}' enabled manually even when it lacks the required stage (${s.stage} out of ${m}).`):i.log(`- '${s.id}' disabled because it lacks the required stage (${s.stage} out of ${m}).`),!c&&n})).map((o=>formatStagedFeature(s,g,r,o,t,e,i))).filter((s=>{if(Fs.has(s.id))return!0;const e=featureEnabledByOptions(r,s.id);if(!0===e||!1===e)return e;const t=o(s.browsers,{ignoreUnknownVersions:!0}),a=g.filter((s=>t.some((e=>e===s))));return a.length>0?i.log(`- '${s.id}' enabled for:\n ${a.join("\n ")}`):i.log(`- '${s.id}' disabled because all targeted browsers support it.`),a.length>0}))}function featureEnabledByOptions(s,e){if(!(e in s))return"auto";const o=s[e];return Array.isArray(o)?!0===o[0]||!1!==o[0]&&"auto":Boolean(o)}class Logger{constructor(){this.logs=[]}log(s){this.logs.push(s)}resetLogger(){this.logs.length=0}emitLogs(s){s&&s.warn(this.logs.join("\n")),this.resetLogger()}}var $s=[{packageName:"css-blank-pseudo",id:"blank-pseudo-class",importName:"postcssBlankPseudo"},{packageName:"css-has-pseudo",id:"has-pseudo-class",importName:"postcssHasPseudo"},{packageName:"css-prefers-color-scheme",id:"prefers-color-scheme-query",importName:"postcssPrefersColorScheme"},{packageName:"postcss-attribute-case-insensitive",id:"case-insensitive-attributes",importName:"postcssAttributeCaseInsensitive"},{packageName:"postcss-clamp",id:"clamp",importName:"postcssClamp"},{packageName:"@csstools/postcss-color-mix-function",id:"color-mix",importName:"postcssColorMixFunction"},{packageName:"@csstools/postcss-color-function",id:"color-function",importName:"postcssColorFunction"},{packageName:"postcss-color-functional-notation",id:"color-functional-notation",importName:"postcssColorFunctionalNotation"},{packageName:"postcss-color-hex-alpha",id:"hexadecimal-alpha-notation",importName:"postcssColorHexAlpha"},{packageName:"@csstools/postcss-content-alt-text",id:"content-alt-text",importName:"postcssContentAltText"},{packageName:"postcss-color-rebeccapurple",id:"rebeccapurple-color",importName:"postcssColorRebeccapurple"},{packageName:"postcss-custom-media",id:"custom-media-queries",importName:"postcssCustomMedia"},{packageName:"postcss-custom-properties",id:"custom-properties",importName:"postcssCustomProperties"},{packageName:"postcss-custom-selectors",id:"custom-selectors",importName:"postcssCustomSelectors"},{packageName:"postcss-dir-pseudo-class",id:"dir-pseudo-class",importName:"postcssDirPseudoClass"},{packageName:"postcss-double-position-gradients",id:"double-position-gradients",importName:"postcssDoublePositionGradients"},{packageName:"@csstools/postcss-exponential-functions",id:"exponential-functions",importName:"postcssExponentialFunctions"},{packageName:"postcss-focus-visible",id:"focus-visible-pseudo-class",importName:"postcssFocusVisible"},{packageName:"postcss-focus-within",id:"focus-within-pseudo-class",importName:"postcssFocusWithin"},{packageName:"@csstools/postcss-font-format-keywords",id:"font-format-keywords",importName:"postcssFontFormatKeywords"},{packageName:"postcss-font-variant",id:"font-variant-property",importName:"postcssFontVariant"},{packageName:"@csstools/postcss-gamut-mapping",id:"gamut-mapping",importName:"postcssGamutMapping"},{packageName:"postcss-gap-properties",id:"gap-properties",importName:"postcssGapProperties"},{packageName:"@csstools/postcss-gradients-interpolation-method",id:"gradients-interpolation-method",importName:"postcssGradientsInterpolationMethod"},{packageName:"@csstools/postcss-hwb-function",id:"hwb-function",importName:"postcssHWBFunction"},{packageName:"@csstools/postcss-ic-unit",id:"ic-unit",importName:"postcssICUnit"},{packageName:"postcss-image-set-function",id:"image-set-function",importName:"postcssImageSetFunction"},{packageName:"@csstools/postcss-initial",id:"all-property",importName:"postcssInitial"},{packageName:"@csstools/postcss-is-pseudo-class",id:"is-pseudo-class",importName:"postcssIsPseudoClass"},{packageName:"@csstools/postcss-scope-pseudo-class",id:"scope-pseudo-class",importName:"postcssScopePseudoClass"},{packageName:"postcss-lab-function",id:"lab-function",importName:"postcssLabFunction"},{packageName:"@csstools/postcss-light-dark-function",id:"light-dark-function",importName:"postcssLightDarkFunction"},{packageName:"postcss-logical",id:"logical-properties-and-values",importName:"postcssLogical"},{packageName:"@csstools/postcss-logical-float-and-clear",id:"float-clear-logical-values",importName:"postcssLogicalFloatAndClear"},{packageName:"@csstools/postcss-logical-overflow",id:"logical-overflow",importName:"postcssLogicalOverflow"},{packageName:"@csstools/postcss-logical-overscroll-behavior",id:"logical-overscroll-behavior",importName:"postcssLogicalOverscrollBehavor"},{packageName:"@csstools/postcss-logical-resize",id:"logical-resize",importName:"postcssLogicalResize"},{packageName:"@csstools/postcss-logical-viewport-units",id:"logical-viewport-units",importName:"postcssLogicalViewportUnits"},{packageName:"@csstools/postcss-media-minmax",id:"media-query-ranges",importName:"postcssMediaMinmax"},{packageName:"@csstools/postcss-media-queries-aspect-ratio-number-values",id:"media-queries-aspect-ratio-number-values",importName:"postcssMediaQueriesAspectRatioNumberValues"},{packageName:"postcss-nesting",id:"nesting-rules",importName:"postcssNesting"},{packageName:"@csstools/postcss-normalize-display-values",id:"display-two-values",importName:"postcssNormalizeDisplayValues"},{packageName:"@csstools/postcss-oklab-function",id:"oklab-function",importName:"postcssOKLabFunction"},{packageName:"@csstools/postcss-relative-color-syntax",id:"relative-color-syntax",importName:"postcssRelativeColorSyntax"},{packageName:"postcss-opacity-percentage",id:"opacity-percentage",importName:"postcssOpacityPercentage"},{packageName:"postcss-overflow-shorthand",id:"overflow-property",importName:"postcssOverflowShorthand"},{packageName:"postcss-page-break",id:"break-properties",importName:"postcssPageBreak"},{packageName:"postcss-place",id:"place-properties",importName:"postcssPlace"},{packageName:"postcss-pseudo-class-any-link",id:"any-link-pseudo-class",importName:"postcssPseudoClassAnyLink"},{packageName:"postcss-replace-overflow-wrap",id:"overflow-wrap-property",importName:"postcssReplaceOverflowWrap"},{packageName:"postcss-selector-not",id:"not-pseudo-class",importName:"postcssSelectorNot"},{packageName:"@csstools/postcss-stepped-value-functions",id:"stepped-value-functions",importName:"postcssSteppedValueFunctions"},{packageName:"postcss-system-ui-font-family",importedPackage:"../patch/postcss-system-ui-font-family.mjs",id:"system-ui-font-family",importName:"postcssFontFamilySystemUI"},{packageName:"@csstools/postcss-unset-value",id:"unset-value",importName:"postcssUnsetValue"},{packageName:"@csstools/postcss-cascade-layers",id:"cascade-layers",importName:"postcssCascadeLayers"},{packageName:"@csstools/postcss-trigonometric-functions",id:"trigonometric-functions",importName:"postcssTrigonometricFunctions"},{packageName:"@csstools/postcss-nested-calc",id:"nested-calc",importName:"postcssNestedCalc"},{packageName:"@csstools/postcss-text-decoration-shorthand",id:"text-decoration-shorthand",importName:"postcssTextDecorationShorthand"},{packageName:"@csstools/postcss-progressive-custom-properties",id:"progressive-custom-properties",importName:"postcssProgressiveCustomProperties",omitTypedOptions:!0,omitDocs:!0}];function getPackageNamesToIds(){const s={};return $s.forEach((e=>{s[e.packageName]=e.id})),s}function pluginIdHelp(s,e,o){const t=$s.map((s=>s.id)),i=$s.map((s=>s.packageName)),r=getPackageNamesToIds();s.forEach((s=>{if(t.includes(s))return;const a=[...t.map((e=>[e,levenshteinDistance(s,e)])),...i.map((e=>[r[e],levenshteinDistance(s,e)]))].sort(((s,e)=>s[1]-e[1])).filter((s=>s[1]<10)),c=new Set;for(let s=0;s=3));s++);if(!c.size)return void e.warn(o,`Unknown feature: "${s}", see the list of features https://github.com/csstools/postcss-plugins/blob/main/plugin-packs/postcss-preset-env/FEATURES.md`);let n='"';n+=Array.from(c).join('", "'),n+='"',e.warn(o,`Unknown feature: "${s}", did you mean one of: ${n}`)}))}function levenshteinDistance(s,e){if(!s.length)return e.length;if(!e.length)return s.length;const o=[];for(let t=0;t<=e.length;t++){o[t]=[t];for(let i=1;i<=s.length;i++)o[t][i]=0===t?i:Math.min(o[t-1][i]+1,o[t][i-1]+1,o[t-1][i-1]+(s[i-1]===e[t-1]?0:1))}return o[e.length][s.length]}const creator=o=>{const t=new Logger,i=Object(o),r=Object.keys(Object(i.features)),a=i.browsers?void 0:i.env,c=i.browsers,n=initializeSharedOptions(i),p=listFeatures(e,i,n,t),l=p.map((s=>s.plugin));!1!==i.autoprefixer&&l.push(s(Object.assign({env:a,overrideBrowserslist:c},i.autoprefixer))),logFeaturesList(p,i,t);const internalPlugin=()=>({postcssPlugin:"postcss-preset-env",OnceExit(s,{result:e}){pluginIdHelp(r,s,e),i.debug&&t.emitLogs(e),t.resetLogger()}});return internalPlugin.postcss=!0,{postcssPlugin:"postcss-preset-env",plugins:[...l,internalPlugin()]}};creator.postcss=!0,module.exports=creator;
+"use strict";var s=require("autoprefixer"),e=require("cssdb"),o=require("browserslist"),t=require("@csstools/postcss-initial"),i=require("postcss-pseudo-class-any-link"),r=require("css-blank-pseudo"),a=require("postcss-page-break"),c=require("@csstools/postcss-cascade-layers"),n=require("postcss-attribute-case-insensitive"),p=require("postcss-clamp"),l=require("@csstools/postcss-color-function"),u=require("postcss-color-functional-notation"),m=require("@csstools/postcss-color-mix-function"),d=require("@csstools/postcss-content-alt-text"),g=require("postcss-custom-media"),f=require("postcss-custom-properties"),h=require("postcss-custom-selectors"),b=require("postcss-dir-pseudo-class"),v=require("@csstools/postcss-normalize-display-values"),N=require("postcss-double-position-gradients"),k=require("@csstools/postcss-exponential-functions"),y=require("@csstools/postcss-logical-float-and-clear"),w=require("postcss-focus-visible"),q=require("postcss-focus-within"),x=require("@csstools/postcss-font-format-keywords"),F=require("postcss-font-variant"),$=require("@csstools/postcss-gamut-mapping"),O=require("postcss-gap-properties"),S=require("@csstools/postcss-gradients-interpolation-method"),C=require("css-has-pseudo"),P=require("postcss-color-hex-alpha"),E=require("@csstools/postcss-hwb-function"),I=require("@csstools/postcss-ic-unit"),A=require("postcss-image-set-function"),B=require("@csstools/postcss-is-pseudo-class"),L=require("postcss-lab-function"),_=require("@csstools/postcss-light-dark-function"),U=require("@csstools/postcss-logical-overflow"),j=require("@csstools/postcss-logical-overscroll-behavior"),M=require("postcss-logical"),z=require("@csstools/postcss-logical-resize"),D=require("@csstools/postcss-logical-viewport-units"),R=require("@csstools/postcss-media-queries-aspect-ratio-number-values"),T=require("@csstools/postcss-media-minmax"),V=require("@csstools/postcss-nested-calc"),H=require("postcss-nesting"),W=require("postcss-selector-not"),G=require("@csstools/postcss-oklab-function"),K=require("postcss-opacity-percentage"),Z=require("postcss-overflow-shorthand"),Q=require("postcss-replace-overflow-wrap"),J=require("postcss-place"),X=require("css-prefers-color-scheme"),Y=require("@csstools/postcss-progressive-custom-properties"),ss=require("postcss-color-rebeccapurple"),es=require("@csstools/postcss-relative-color-syntax"),os=require("@csstools/postcss-scope-pseudo-class"),ts=require("@csstools/postcss-stepped-value-functions"),is=require("@csstools/postcss-text-decoration-shorthand"),rs=require("@csstools/postcss-trigonometric-functions"),as=require("@csstools/postcss-unset-value");const cs={"blank-pseudo-class":"https://github.com/csstools/postcss-plugins/blob/main/plugins/css-blank-pseudo/README.md#browser","focus-visible-pseudo-class":"https://github.com/WICG/focus-visible","focus-within-pseudo-class":"https://github.com/csstools/postcss-plugins/blob/main/plugins/postcss-focus-within/README.md#browser","has-pseudo-class":"https://github.com/csstools/postcss-plugins/blob/main/plugins/css-has-pseudo/README.md#browser","prefers-color-scheme-query":"https://github.com/csstools/postcss-plugins/blob/main/plugins/css-prefers-color-scheme/README.md#browser"},ns=["blank-pseudo-class","focus-visible-pseudo-class","focus-within-pseudo-class","has-pseudo-class","prefers-color-scheme-query"];function logFeaturesList(s,e,o){if(e.debug){o.log("Enabling the following feature(s):");const t=[],i=[];!1!==e.autoprefixer&&i.push(" autoprefixer"),s.forEach((s=>{s.id.startsWith("before")||s.id.startsWith("after")?i.push(` ${s.id} (injected via options)`):i.push(` ${s.id}`),void 0!==cs[s.id]&&t.push(s.id)})),i.sort(((s,e)=>s.localeCompare(e))),t.sort(((s,e)=>s.localeCompare(e))),i.forEach((s=>o.log(s))),t.length&&(o.log("These feature(s) need a browser library to work:"),t.forEach((s=>o.log(` ${s}: ${cs[s]}`))))}}function initializeSharedOptions(s){if("preserve"in s){const e={};return e.preserve=s.preserve,e}return!1}function clamp(s,e,o){return Math.max(s,Math.min(e,o))}const ps=2,ls=5;function stageFromOptions(s,e){let o=ps;if(void 0===s.stage)return e.log(`Using features from Stage ${ps} (default).`),o;if(!1===s.stage)o=ls;else{let e=parseInt(s.stage,10);Number.isNaN(e)&&(e=0),o=clamp(0,e,ls)}return o===ls?e.log('Stage has been disabled, features will be handled via the "features" option.'):e.log(`Using features from Stage ${o}.`),o}const us=Symbol("insertBefore"),ms=Symbol("insertAfter"),ds=Symbol("insertOrder"),gs=Symbol("plugin");function getTransformedInsertions(s,e,o){if("insertBefore"!==o&&"insertAfter"!==o)return[];const t="insertBefore"===o?us:ms,i=[];for(const o in e){if(!Object.hasOwnProperty.call(e,o))continue;if(!s.find((s=>s.id===o)))continue;let r=e[o];Array.isArray(r)||(r=[r]);for(let s=0;sfeatureIsInsertedOrHasAPlugin(s))).sort(((s,e)=>featureIsLess(s,e)))}function getOptionsForBrowsersByFeature(s,e,o,t){switch(e.id){case"is-pseudo-class":return{onComplexSelector:"warning"};case"any-link-pseudo-class":if(s.find((s=>s.startsWith("ie ")||"edge 12"===s||"edge 13"===s||"edge 14"===s||"edge 15"===s||"edge 16"===s||"edge 17"===s||"edge 18"===s)))return t.log("- 'any-link-pseudo-class' setting 'subFeatures: { areaHrefNeedsFixing: true }' due to lack of browser support for area[href] in Edge and IE."),{subFeatures:{areaHrefNeedsFixing:!0}};return{};case"logical-properties-and-values":case"float-clear-logical-values":case"logical-resize":case"logical-viewport-units":case"logical-overflow":case"logical-overscroll-behavior":return"logical"in o?o.logical:{};default:return{}}}const qs=["and_chr","and_ff","android","chrome","edge","firefox","ie","ios_saf","op_mini","op_mob","opera","safari","samsung"];function getUnsupportedBrowsersByFeature(s){if(!s)return[];if(!("browser_support"in s))return["> 0%"];const e=[];return qs.forEach((o=>{if("op_mini"===o&&void 0===s.browser_support[o])return void e.push("op_mini all");const t=s.browser_support[o];"string"==typeof t&&xs.test(t)?e.push(`${o} < ${s.browser_support[o]}`):e.push(`${o} >= 1`)})),e}const xs=/^[0-9|.]+$/;function formatPolyfillableFeature(s){const e=getUnsupportedBrowsersByFeature(s);if(s[us]||s[ms]){let o=s.id;return o=s.insertBefore?`before-${o}`:`after-${o}`,{browsers:e,vendors_implementations:s.vendors_implementations,plugin:s[gs],id:o,stage:ls+1}}return{browsers:e,vendors_implementations:s.vendors_implementations,plugin:ws.get(s.id),id:s.id,stage:s.stage}}function formatStagedFeature(s,e,o,t,i,r){let a,c;return a=getOptionsForBrowsersByFeature(s,o,i,r),a=t?Object.assign({},a,t,featureOptions(e,o.id)):Object.assign({},a,featureOptions(e,o.id)),"progressive-custom-properties"!==o.id&&(a.enableProgressiveCustomProperties=!1),"overflow-wrap-property"===o.id&&"preserve"in a&&(a.method=a.preserve?"copy":"replace"),c=o.plugin.postcss&&"function"==typeof o.plugin?o.plugin(a):o.plugin&&o.plugin.default&&"function"==typeof o.plugin.default&&o.plugin.default.postcss?o.plugin.default(a):o.plugin,{browsers:o.browsers,vendors_implementations:o.vendors_implementations,plugin:c,pluginOptions:a,id:o.id}}function featureOptions(s,e){if(!(e in s))return;const o=s[e];return Array.isArray(o)?o[1]:o}function intOrZero(s){const e=parseInt(s,10);return Number.isNaN(e)?0:e}const Fs=new Set(["progressive-custom-properties"]);function listFeatures(s,e,t,i){const r=Object(e.features),a="enableClientSidePolyfills"in e&&e.enableClientSidePolyfills,c=Object(e.insertBefore),n=Object(e.insertAfter),p=e.browsers?void 0:e.env,l=e.browsers,u=clamp(0,intOrZero(e.minimumVendorImplementations),3);u>0&&i.log(`Using features with ${u} or more vendor implementations.`);const m=stageFromOptions(e,i),d=prepareFeaturesList([...s,{id:"progressive-custom-properties"}],c,n).map((s=>formatPolyfillableFeature(s))).filter((s=>!!Fs.has(s.id)||(0===u||(!(!s[us]&&!s[ms])||(u<=s.vendors_implementations||(!0===featureEnabledByOptions(r,s.id)?(i.log(`- '${s.id}' enabled manually even when it lacks the required interop (${s.vendors_implementations} out of ${u}).`),!0):(i.log(`- '${s.id}' disabled because it lacks the required interop (${s.vendors_implementations} out of ${u}).`),!1))))))),g=o(l,{env:p,ignoreUnknownVersions:!0}).filter((s=>qs.includes(s.split(" ")[0])));return d.filter((s=>{if(Fs.has(s.id))return!0;const e=s.stage>=m,o=a||!ns.includes(s.id),t=featureEnabledByOptions(r,s.id),c=!1===t,n=!0===t||e&&o;return c?i.log(`- '${s.id}' disabled manually`):e?o||i.log(`- '${s.id}' disabled because 'enableClientSidePolyfills' is 'false'.`):n?i.log(`- '${s.id}' enabled manually even when it lacks the required stage (${s.stage} out of ${m}).`):i.log(`- '${s.id}' disabled because it lacks the required stage (${s.stage} out of ${m}).`),!c&&n})).map((s=>formatStagedFeature(g,r,s,t,e,i))).filter((s=>{if(Fs.has(s.id))return!0;const e=featureEnabledByOptions(r,s.id);if(!0===e||!1===e)return e;const t=o(s.browsers,{ignoreUnknownVersions:!0}),a=g.filter((s=>t.some((e=>e===s))));return a.length>0?i.log(`- '${s.id}' enabled for:\n ${a.join("\n ")}`):i.log(`- '${s.id}' disabled because all targeted browsers support it.`),a.length>0}))}function featureEnabledByOptions(s,e){if(!(e in s))return"auto";const o=s[e];return Array.isArray(o)?!0===o[0]||!1!==o[0]&&"auto":Boolean(o)}class Logger{constructor(){this.logs=[]}log(s){this.logs.push(s)}resetLogger(){this.logs.length=0}emitLogs(s){s&&s.warn(this.logs.join("\n")),this.resetLogger()}}var $s=[{packageName:"css-blank-pseudo",id:"blank-pseudo-class",importName:"postcssBlankPseudo"},{packageName:"css-has-pseudo",id:"has-pseudo-class",importName:"postcssHasPseudo"},{packageName:"css-prefers-color-scheme",id:"prefers-color-scheme-query",importName:"postcssPrefersColorScheme"},{packageName:"postcss-attribute-case-insensitive",id:"case-insensitive-attributes",importName:"postcssAttributeCaseInsensitive"},{packageName:"postcss-clamp",id:"clamp",importName:"postcssClamp"},{packageName:"@csstools/postcss-color-mix-function",id:"color-mix",importName:"postcssColorMixFunction"},{packageName:"@csstools/postcss-color-function",id:"color-function",importName:"postcssColorFunction"},{packageName:"postcss-color-functional-notation",id:"color-functional-notation",importName:"postcssColorFunctionalNotation"},{packageName:"postcss-color-hex-alpha",id:"hexadecimal-alpha-notation",importName:"postcssColorHexAlpha"},{packageName:"@csstools/postcss-content-alt-text",id:"content-alt-text",importName:"postcssContentAltText"},{packageName:"postcss-color-rebeccapurple",id:"rebeccapurple-color",importName:"postcssColorRebeccapurple"},{packageName:"postcss-custom-media",id:"custom-media-queries",importName:"postcssCustomMedia"},{packageName:"postcss-custom-properties",id:"custom-properties",importName:"postcssCustomProperties"},{packageName:"postcss-custom-selectors",id:"custom-selectors",importName:"postcssCustomSelectors"},{packageName:"postcss-dir-pseudo-class",id:"dir-pseudo-class",importName:"postcssDirPseudoClass"},{packageName:"postcss-double-position-gradients",id:"double-position-gradients",importName:"postcssDoublePositionGradients"},{packageName:"@csstools/postcss-exponential-functions",id:"exponential-functions",importName:"postcssExponentialFunctions"},{packageName:"postcss-focus-visible",id:"focus-visible-pseudo-class",importName:"postcssFocusVisible"},{packageName:"postcss-focus-within",id:"focus-within-pseudo-class",importName:"postcssFocusWithin"},{packageName:"@csstools/postcss-font-format-keywords",id:"font-format-keywords",importName:"postcssFontFormatKeywords"},{packageName:"postcss-font-variant",id:"font-variant-property",importName:"postcssFontVariant"},{packageName:"@csstools/postcss-gamut-mapping",id:"gamut-mapping",importName:"postcssGamutMapping"},{packageName:"postcss-gap-properties",id:"gap-properties",importName:"postcssGapProperties"},{packageName:"@csstools/postcss-gradients-interpolation-method",id:"gradients-interpolation-method",importName:"postcssGradientsInterpolationMethod"},{packageName:"@csstools/postcss-hwb-function",id:"hwb-function",importName:"postcssHWBFunction"},{packageName:"@csstools/postcss-ic-unit",id:"ic-unit",importName:"postcssICUnit"},{packageName:"postcss-image-set-function",id:"image-set-function",importName:"postcssImageSetFunction"},{packageName:"@csstools/postcss-initial",id:"all-property",importName:"postcssInitial"},{packageName:"@csstools/postcss-is-pseudo-class",id:"is-pseudo-class",importName:"postcssIsPseudoClass"},{packageName:"@csstools/postcss-scope-pseudo-class",id:"scope-pseudo-class",importName:"postcssScopePseudoClass"},{packageName:"postcss-lab-function",id:"lab-function",importName:"postcssLabFunction"},{packageName:"@csstools/postcss-light-dark-function",id:"light-dark-function",importName:"postcssLightDarkFunction"},{packageName:"postcss-logical",id:"logical-properties-and-values",importName:"postcssLogical"},{packageName:"@csstools/postcss-logical-float-and-clear",id:"float-clear-logical-values",importName:"postcssLogicalFloatAndClear"},{packageName:"@csstools/postcss-logical-overflow",id:"logical-overflow",importName:"postcssLogicalOverflow"},{packageName:"@csstools/postcss-logical-overscroll-behavior",id:"logical-overscroll-behavior",importName:"postcssLogicalOverscrollBehavor"},{packageName:"@csstools/postcss-logical-resize",id:"logical-resize",importName:"postcssLogicalResize"},{packageName:"@csstools/postcss-logical-viewport-units",id:"logical-viewport-units",importName:"postcssLogicalViewportUnits"},{packageName:"@csstools/postcss-media-minmax",id:"media-query-ranges",importName:"postcssMediaMinmax"},{packageName:"@csstools/postcss-media-queries-aspect-ratio-number-values",id:"media-queries-aspect-ratio-number-values",importName:"postcssMediaQueriesAspectRatioNumberValues"},{packageName:"postcss-nesting",id:"nesting-rules",importName:"postcssNesting"},{packageName:"@csstools/postcss-normalize-display-values",id:"display-two-values",importName:"postcssNormalizeDisplayValues"},{packageName:"@csstools/postcss-oklab-function",id:"oklab-function",importName:"postcssOKLabFunction"},{packageName:"@csstools/postcss-relative-color-syntax",id:"relative-color-syntax",importName:"postcssRelativeColorSyntax"},{packageName:"postcss-opacity-percentage",id:"opacity-percentage",importName:"postcssOpacityPercentage"},{packageName:"postcss-overflow-shorthand",id:"overflow-property",importName:"postcssOverflowShorthand"},{packageName:"postcss-page-break",id:"break-properties",importName:"postcssPageBreak"},{packageName:"postcss-place",id:"place-properties",importName:"postcssPlace"},{packageName:"postcss-pseudo-class-any-link",id:"any-link-pseudo-class",importName:"postcssPseudoClassAnyLink"},{packageName:"postcss-replace-overflow-wrap",id:"overflow-wrap-property",importName:"postcssReplaceOverflowWrap"},{packageName:"postcss-selector-not",id:"not-pseudo-class",importName:"postcssSelectorNot"},{packageName:"@csstools/postcss-stepped-value-functions",id:"stepped-value-functions",importName:"postcssSteppedValueFunctions"},{packageName:"postcss-system-ui-font-family",importedPackage:"../patch/postcss-system-ui-font-family.mjs",id:"system-ui-font-family",importName:"postcssFontFamilySystemUI"},{packageName:"@csstools/postcss-unset-value",id:"unset-value",importName:"postcssUnsetValue"},{packageName:"@csstools/postcss-cascade-layers",id:"cascade-layers",importName:"postcssCascadeLayers"},{packageName:"@csstools/postcss-trigonometric-functions",id:"trigonometric-functions",importName:"postcssTrigonometricFunctions"},{packageName:"@csstools/postcss-nested-calc",id:"nested-calc",importName:"postcssNestedCalc"},{packageName:"@csstools/postcss-text-decoration-shorthand",id:"text-decoration-shorthand",importName:"postcssTextDecorationShorthand"},{packageName:"@csstools/postcss-progressive-custom-properties",id:"progressive-custom-properties",importName:"postcssProgressiveCustomProperties",omitTypedOptions:!0,omitDocs:!0}];function getPackageNamesToIds(){const s={};return $s.forEach((e=>{s[e.packageName]=e.id})),s}function pluginIdHelp(s,e,o){const t=$s.map((s=>s.id)),i=$s.map((s=>s.packageName)),r=getPackageNamesToIds();s.forEach((s=>{if(t.includes(s))return;const a=[...t.map((e=>[e,levenshteinDistance(s,e)])),...i.map((e=>[r[e],levenshteinDistance(s,e)]))].sort(((s,e)=>s[1]-e[1])).filter((s=>s[1]<10)),c=new Set;for(let s=0;s=3));s++);if(!c.size)return void e.warn(o,`Unknown feature: "${s}", see the list of features https://github.com/csstools/postcss-plugins/blob/main/plugin-packs/postcss-preset-env/FEATURES.md`);let n='"';n+=Array.from(c).join('", "'),n+='"',e.warn(o,`Unknown feature: "${s}", did you mean one of: ${n}`)}))}function levenshteinDistance(s,e){if(!s.length)return e.length;if(!e.length)return s.length;const o=[];for(let t=0;t<=e.length;t++){o[t]=[t];for(let i=1;i<=s.length;i++)o[t][i]=0===t?i:Math.min(o[t-1][i]+1,o[t][i-1]+1,o[t-1][i-1]+(s[i-1]===e[t-1]?0:1))}return o[e.length][s.length]}const creator=o=>{const t=new Logger,i=Object(o),r=Object.keys(Object(i.features)),a=i.browsers?void 0:i.env,c=i.browsers,n=initializeSharedOptions(i),p=listFeatures(e,i,n,t),l=p.map((s=>s.plugin));!1!==i.autoprefixer&&l.push(s(Object.assign({env:a,overrideBrowserslist:c},i.autoprefixer))),logFeaturesList(p,i,t);const internalPlugin=()=>({postcssPlugin:"postcss-preset-env",OnceExit(s,{result:e}){pluginIdHelp(r,s,e),i.debug&&t.emitLogs(e),t.resetLogger()}});return internalPlugin.postcss=!0,{postcssPlugin:"postcss-preset-env",plugins:[...l,internalPlugin()]}};creator.postcss=!0,module.exports=creator;
diff --git a/plugin-packs/postcss-preset-env/dist/index.mjs b/plugin-packs/postcss-preset-env/dist/index.mjs
index 9f93f121e..fdfcb1e95 100644
--- a/plugin-packs/postcss-preset-env/dist/index.mjs
+++ b/plugin-packs/postcss-preset-env/dist/index.mjs
@@ -1 +1 @@
-import s from"autoprefixer";import o from"cssdb";import e from"browserslist";import t from"@csstools/postcss-initial";import i from"postcss-pseudo-class-any-link";import r from"css-blank-pseudo";import a from"postcss-page-break";import c from"@csstools/postcss-cascade-layers";import p from"postcss-attribute-case-insensitive";import n from"postcss-clamp";import l from"@csstools/postcss-color-function";import m from"postcss-color-functional-notation";import u from"@csstools/postcss-color-mix-function";import d from"@csstools/postcss-content-alt-text";import f from"postcss-custom-media";import g from"postcss-custom-properties";import b from"postcss-custom-selectors";import h from"postcss-dir-pseudo-class";import v from"@csstools/postcss-normalize-display-values";import N from"postcss-double-position-gradients";import k from"@csstools/postcss-exponential-functions";import y from"@csstools/postcss-logical-float-and-clear";import w from"postcss-focus-visible";import x from"postcss-focus-within";import F from"@csstools/postcss-font-format-keywords";import $ from"postcss-font-variant";import O from"@csstools/postcss-gamut-mapping";import S from"postcss-gap-properties";import P from"@csstools/postcss-gradients-interpolation-method";import C from"css-has-pseudo";import I from"postcss-color-hex-alpha";import B from"@csstools/postcss-hwb-function";import E from"@csstools/postcss-ic-unit";import A from"postcss-image-set-function";import L from"@csstools/postcss-is-pseudo-class";import U from"postcss-lab-function";import q from"@csstools/postcss-light-dark-function";import _ from"@csstools/postcss-logical-overflow";import j from"@csstools/postcss-logical-overscroll-behavior";import M from"postcss-logical";import z from"@csstools/postcss-logical-resize";import D from"@csstools/postcss-logical-viewport-units";import R from"@csstools/postcss-media-queries-aspect-ratio-number-values";import T from"@csstools/postcss-media-minmax";import V from"@csstools/postcss-nested-calc";import H from"postcss-nesting";import W from"postcss-selector-not";import G from"@csstools/postcss-oklab-function";import K from"postcss-opacity-percentage";import Z from"postcss-overflow-shorthand";import Q from"postcss-replace-overflow-wrap";import J from"postcss-place";import X from"css-prefers-color-scheme";import Y from"@csstools/postcss-progressive-custom-properties";import ss from"postcss-color-rebeccapurple";import os from"@csstools/postcss-relative-color-syntax";import es from"@csstools/postcss-scope-pseudo-class";import ts from"@csstools/postcss-stepped-value-functions";import is from"@csstools/postcss-text-decoration-shorthand";import rs from"@csstools/postcss-trigonometric-functions";import as from"@csstools/postcss-unset-value";const cs={"blank-pseudo-class":"https://github.com/csstools/postcss-plugins/blob/main/plugins/css-blank-pseudo/README.md#browser","focus-visible-pseudo-class":"https://github.com/WICG/focus-visible","focus-within-pseudo-class":"https://github.com/csstools/postcss-plugins/blob/main/plugins/postcss-focus-within/README.md#browser","has-pseudo-class":"https://github.com/csstools/postcss-plugins/blob/main/plugins/css-has-pseudo/README.md#browser","prefers-color-scheme-query":"https://github.com/csstools/postcss-plugins/blob/main/plugins/css-prefers-color-scheme/README.md#browser"},ps=["blank-pseudo-class","focus-visible-pseudo-class","focus-within-pseudo-class","has-pseudo-class","prefers-color-scheme-query"];function logFeaturesList(s,o,e){if(o.debug){e.log("Enabling the following feature(s):");const t=[],i=[];!1!==o.autoprefixer&&i.push(" autoprefixer"),s.forEach((s=>{s.id.startsWith("before")||s.id.startsWith("after")?i.push(` ${s.id} (injected via options)`):i.push(` ${s.id}`),void 0!==cs[s.id]&&t.push(s.id)})),i.sort(((s,o)=>s.localeCompare(o))),t.sort(((s,o)=>s.localeCompare(o))),i.forEach((s=>e.log(s))),t.length&&(e.log("These feature(s) need a browser library to work:"),t.forEach((s=>e.log(` ${s}: ${cs[s]}`))))}}function initializeSharedOptions(s){if("preserve"in s){const o={};return o.preserve=s.preserve,o}return!1}function clamp(s,o,e){return Math.max(s,Math.min(o,e))}const ns=2,ls=5;function stageFromOptions(s,o){let e=ns;if(void 0===s.stage)return o.log(`Using features from Stage ${ns} (default).`),e;if(!1===s.stage)e=ls;else{let o=parseInt(s.stage,10);Number.isNaN(o)&&(o=0),e=clamp(0,o,ls)}return e===ls?o.log('Stage has been disabled, features will be handled via the "features" option.'):o.log(`Using features from Stage ${e}.`),e}const ms=Symbol("insertBefore"),us=Symbol("insertAfter"),ds=Symbol("insertOrder"),fs=Symbol("plugin");function getTransformedInsertions(s,o,e){if("insertBefore"!==e&&"insertAfter"!==e)return[];const t="insertBefore"===e?ms:us,i=[];for(const e in o){if(!Object.hasOwnProperty.call(o,e))continue;if(!s.find((s=>s.id===e)))continue;let r=o[e];Array.isArray(r)||(r=[r]);for(let s=0;sfeatureIsInsertedOrHasAPlugin(s))).sort(((s,o)=>featureIsLess(s,o)))}const xs=["and_chr","and_ff","android","chrome","edge","firefox","ie","ios_saf","op_mini","op_mob","opera","safari","samsung"];function getUnsupportedBrowsersByFeature(s){if(!s)return[];if(!("browser_support"in s))return["> 0%"];const o=[];return xs.forEach((e=>{if("op_mini"===e&&void 0===s.browser_support[e])return void o.push("op_mini all");const t=s.browser_support[e];"string"==typeof t&&Fs.test(t)?o.push(`${e} < ${s.browser_support[e]}`):o.push(`${e} >= 1`)})),o}const Fs=/^[0-9|.]+$/;function getOptionsForBrowsersByFeature(s,o,e,t,i){switch(o.id){case"is-pseudo-class":return{onComplexSelector:"warning"};case"nesting-rules":if(needsOptionFor(e.find((s=>"is-pseudo-class"===s.id)),s))return i.log("- 'nesting-rules' setting 'noIsPseudoSelector: true' due to lack of browser support for ':is()'."),{noIsPseudoSelector:!0};return{};case"any-link-pseudo-class":if(s.find((s=>s.startsWith("ie ")||"edge 12"===s||"edge 13"===s||"edge 14"===s||"edge 15"===s||"edge 16"===s||"edge 17"===s||"edge 18"===s)))return i.log("- 'any-link-pseudo-class' setting 'subFeatures: { areaHrefNeedsFixing: true }' due to lack of browser support for area[href] in Edge and IE."),{subFeatures:{areaHrefNeedsFixing:!0}};return{};case"logical-properties-and-values":case"float-clear-logical-values":case"logical-resize":case"logical-viewport-units":case"logical-overflow":case"logical-overscroll-behavior":return"logical"in t?t.logical:{};default:return{}}}function needsOptionFor(s,o){const t=getUnsupportedBrowsersByFeature(s),i=e(t,{ignoreUnknownVersions:!0});return!!o.some((s=>i.some((o=>o===s))))}function formatPolyfillableFeature(s){const o=getUnsupportedBrowsersByFeature(s);if(s[ms]||s[us]){let e=s.id;return e=s.insertBefore?`before-${e}`:`after-${e}`,{browsers:o,vendors_implementations:s.vendors_implementations,plugin:s[fs],id:e,stage:ls+1}}return{browsers:o,vendors_implementations:s.vendors_implementations,plugin:ws.get(s.id),id:s.id,stage:s.stage}}function formatStagedFeature(s,o,e,t,i,r,a){let c,p;return c=getOptionsForBrowsersByFeature(o,t,s,r,a),c=i?Object.assign({},c,i,featureOptions(e,t.id)):Object.assign({},c,featureOptions(e,t.id)),"progressive-custom-properties"!==t.id&&(c.enableProgressiveCustomProperties=!1),"overflow-wrap-property"===t.id&&"preserve"in c&&(c.method=c.preserve?"copy":"replace"),p=t.plugin.postcss&&"function"==typeof t.plugin?t.plugin(c):t.plugin&&t.plugin.default&&"function"==typeof t.plugin.default&&t.plugin.default.postcss?t.plugin.default(c):t.plugin,{browsers:t.browsers,vendors_implementations:t.vendors_implementations,plugin:p,pluginOptions:c,id:t.id}}function featureOptions(s,o){if(!(o in s))return;const e=s[o];return Array.isArray(e)?e[1]:e}function intOrZero(s){const o=parseInt(s,10);return Number.isNaN(o)?0:o}const $s=new Set(["progressive-custom-properties"]);function listFeatures(s,o,t,i){const r=Object(o.features),a="enableClientSidePolyfills"in o&&o.enableClientSidePolyfills,c=Object(o.insertBefore),p=Object(o.insertAfter),n=o.browsers?void 0:o.env,l=o.browsers,m=clamp(0,intOrZero(o.minimumVendorImplementations),3);m>0&&i.log(`Using features with ${m} or more vendor implementations.`);const u=stageFromOptions(o,i),d=prepareFeaturesList([...s,{id:"progressive-custom-properties"}],c,p).map((s=>formatPolyfillableFeature(s))).filter((s=>!!$s.has(s.id)||(0===m||(!(!s[ms]&&!s[us])||(m<=s.vendors_implementations||(!0===featureEnabledByOptions(r,s.id)?(i.log(`- '${s.id}' enabled manually even when it lacks the required interop (${s.vendors_implementations} out of ${m}).`),!0):(i.log(`- '${s.id}' disabled because it lacks the required interop (${s.vendors_implementations} out of ${m}).`),!1))))))),f=e(l,{env:n,ignoreUnknownVersions:!0}).filter((s=>xs.includes(s.split(" ")[0])));return d.filter((s=>{if($s.has(s.id))return!0;const o=s.stage>=u,e=a||!ps.includes(s.id),t=featureEnabledByOptions(r,s.id),c=!1===t,p=!0===t||o&&e;return c?i.log(`- '${s.id}' disabled manually`):o?e||i.log(`- '${s.id}' disabled because 'enableClientSidePolyfills' is 'false'.`):p?i.log(`- '${s.id}' enabled manually even when it lacks the required stage (${s.stage} out of ${u}).`):i.log(`- '${s.id}' disabled because it lacks the required stage (${s.stage} out of ${u}).`),!c&&p})).map((e=>formatStagedFeature(s,f,r,e,t,o,i))).filter((s=>{if($s.has(s.id))return!0;const o=featureEnabledByOptions(r,s.id);if(!0===o||!1===o)return o;const t=e(s.browsers,{ignoreUnknownVersions:!0}),a=f.filter((s=>t.some((o=>o===s))));return a.length>0?i.log(`- '${s.id}' enabled for:\n ${a.join("\n ")}`):i.log(`- '${s.id}' disabled because all targeted browsers support it.`),a.length>0}))}function featureEnabledByOptions(s,o){if(!(o in s))return"auto";const e=s[o];return Array.isArray(e)?!0===e[0]||!1!==e[0]&&"auto":Boolean(e)}class Logger{constructor(){this.logs=[]}log(s){this.logs.push(s)}resetLogger(){this.logs.length=0}emitLogs(s){s&&s.warn(this.logs.join("\n")),this.resetLogger()}}var Os=[{packageName:"css-blank-pseudo",id:"blank-pseudo-class",importName:"postcssBlankPseudo"},{packageName:"css-has-pseudo",id:"has-pseudo-class",importName:"postcssHasPseudo"},{packageName:"css-prefers-color-scheme",id:"prefers-color-scheme-query",importName:"postcssPrefersColorScheme"},{packageName:"postcss-attribute-case-insensitive",id:"case-insensitive-attributes",importName:"postcssAttributeCaseInsensitive"},{packageName:"postcss-clamp",id:"clamp",importName:"postcssClamp"},{packageName:"@csstools/postcss-color-mix-function",id:"color-mix",importName:"postcssColorMixFunction"},{packageName:"@csstools/postcss-color-function",id:"color-function",importName:"postcssColorFunction"},{packageName:"postcss-color-functional-notation",id:"color-functional-notation",importName:"postcssColorFunctionalNotation"},{packageName:"postcss-color-hex-alpha",id:"hexadecimal-alpha-notation",importName:"postcssColorHexAlpha"},{packageName:"@csstools/postcss-content-alt-text",id:"content-alt-text",importName:"postcssContentAltText"},{packageName:"postcss-color-rebeccapurple",id:"rebeccapurple-color",importName:"postcssColorRebeccapurple"},{packageName:"postcss-custom-media",id:"custom-media-queries",importName:"postcssCustomMedia"},{packageName:"postcss-custom-properties",id:"custom-properties",importName:"postcssCustomProperties"},{packageName:"postcss-custom-selectors",id:"custom-selectors",importName:"postcssCustomSelectors"},{packageName:"postcss-dir-pseudo-class",id:"dir-pseudo-class",importName:"postcssDirPseudoClass"},{packageName:"postcss-double-position-gradients",id:"double-position-gradients",importName:"postcssDoublePositionGradients"},{packageName:"@csstools/postcss-exponential-functions",id:"exponential-functions",importName:"postcssExponentialFunctions"},{packageName:"postcss-focus-visible",id:"focus-visible-pseudo-class",importName:"postcssFocusVisible"},{packageName:"postcss-focus-within",id:"focus-within-pseudo-class",importName:"postcssFocusWithin"},{packageName:"@csstools/postcss-font-format-keywords",id:"font-format-keywords",importName:"postcssFontFormatKeywords"},{packageName:"postcss-font-variant",id:"font-variant-property",importName:"postcssFontVariant"},{packageName:"@csstools/postcss-gamut-mapping",id:"gamut-mapping",importName:"postcssGamutMapping"},{packageName:"postcss-gap-properties",id:"gap-properties",importName:"postcssGapProperties"},{packageName:"@csstools/postcss-gradients-interpolation-method",id:"gradients-interpolation-method",importName:"postcssGradientsInterpolationMethod"},{packageName:"@csstools/postcss-hwb-function",id:"hwb-function",importName:"postcssHWBFunction"},{packageName:"@csstools/postcss-ic-unit",id:"ic-unit",importName:"postcssICUnit"},{packageName:"postcss-image-set-function",id:"image-set-function",importName:"postcssImageSetFunction"},{packageName:"@csstools/postcss-initial",id:"all-property",importName:"postcssInitial"},{packageName:"@csstools/postcss-is-pseudo-class",id:"is-pseudo-class",importName:"postcssIsPseudoClass"},{packageName:"@csstools/postcss-scope-pseudo-class",id:"scope-pseudo-class",importName:"postcssScopePseudoClass"},{packageName:"postcss-lab-function",id:"lab-function",importName:"postcssLabFunction"},{packageName:"@csstools/postcss-light-dark-function",id:"light-dark-function",importName:"postcssLightDarkFunction"},{packageName:"postcss-logical",id:"logical-properties-and-values",importName:"postcssLogical"},{packageName:"@csstools/postcss-logical-float-and-clear",id:"float-clear-logical-values",importName:"postcssLogicalFloatAndClear"},{packageName:"@csstools/postcss-logical-overflow",id:"logical-overflow",importName:"postcssLogicalOverflow"},{packageName:"@csstools/postcss-logical-overscroll-behavior",id:"logical-overscroll-behavior",importName:"postcssLogicalOverscrollBehavor"},{packageName:"@csstools/postcss-logical-resize",id:"logical-resize",importName:"postcssLogicalResize"},{packageName:"@csstools/postcss-logical-viewport-units",id:"logical-viewport-units",importName:"postcssLogicalViewportUnits"},{packageName:"@csstools/postcss-media-minmax",id:"media-query-ranges",importName:"postcssMediaMinmax"},{packageName:"@csstools/postcss-media-queries-aspect-ratio-number-values",id:"media-queries-aspect-ratio-number-values",importName:"postcssMediaQueriesAspectRatioNumberValues"},{packageName:"postcss-nesting",id:"nesting-rules",importName:"postcssNesting"},{packageName:"@csstools/postcss-normalize-display-values",id:"display-two-values",importName:"postcssNormalizeDisplayValues"},{packageName:"@csstools/postcss-oklab-function",id:"oklab-function",importName:"postcssOKLabFunction"},{packageName:"@csstools/postcss-relative-color-syntax",id:"relative-color-syntax",importName:"postcssRelativeColorSyntax"},{packageName:"postcss-opacity-percentage",id:"opacity-percentage",importName:"postcssOpacityPercentage"},{packageName:"postcss-overflow-shorthand",id:"overflow-property",importName:"postcssOverflowShorthand"},{packageName:"postcss-page-break",id:"break-properties",importName:"postcssPageBreak"},{packageName:"postcss-place",id:"place-properties",importName:"postcssPlace"},{packageName:"postcss-pseudo-class-any-link",id:"any-link-pseudo-class",importName:"postcssPseudoClassAnyLink"},{packageName:"postcss-replace-overflow-wrap",id:"overflow-wrap-property",importName:"postcssReplaceOverflowWrap"},{packageName:"postcss-selector-not",id:"not-pseudo-class",importName:"postcssSelectorNot"},{packageName:"@csstools/postcss-stepped-value-functions",id:"stepped-value-functions",importName:"postcssSteppedValueFunctions"},{packageName:"postcss-system-ui-font-family",importedPackage:"../patch/postcss-system-ui-font-family.mjs",id:"system-ui-font-family",importName:"postcssFontFamilySystemUI"},{packageName:"@csstools/postcss-unset-value",id:"unset-value",importName:"postcssUnsetValue"},{packageName:"@csstools/postcss-cascade-layers",id:"cascade-layers",importName:"postcssCascadeLayers"},{packageName:"@csstools/postcss-trigonometric-functions",id:"trigonometric-functions",importName:"postcssTrigonometricFunctions"},{packageName:"@csstools/postcss-nested-calc",id:"nested-calc",importName:"postcssNestedCalc"},{packageName:"@csstools/postcss-text-decoration-shorthand",id:"text-decoration-shorthand",importName:"postcssTextDecorationShorthand"},{packageName:"@csstools/postcss-progressive-custom-properties",id:"progressive-custom-properties",importName:"postcssProgressiveCustomProperties",omitTypedOptions:!0,omitDocs:!0}];function getPackageNamesToIds(){const s={};return Os.forEach((o=>{s[o.packageName]=o.id})),s}function pluginIdHelp(s,o,e){const t=Os.map((s=>s.id)),i=Os.map((s=>s.packageName)),r=getPackageNamesToIds();s.forEach((s=>{if(t.includes(s))return;const a=[...t.map((o=>[o,levenshteinDistance(s,o)])),...i.map((o=>[r[o],levenshteinDistance(s,o)]))].sort(((s,o)=>s[1]-o[1])).filter((s=>s[1]<10)),c=new Set;for(let s=0;s=3));s++);if(!c.size)return void o.warn(e,`Unknown feature: "${s}", see the list of features https://github.com/csstools/postcss-plugins/blob/main/plugin-packs/postcss-preset-env/FEATURES.md`);let p='"';p+=Array.from(c).join('", "'),p+='"',o.warn(e,`Unknown feature: "${s}", did you mean one of: ${p}`)}))}function levenshteinDistance(s,o){if(!s.length)return o.length;if(!o.length)return s.length;const e=[];for(let t=0;t<=o.length;t++){e[t]=[t];for(let i=1;i<=s.length;i++)e[t][i]=0===t?i:Math.min(e[t-1][i]+1,e[t][i-1]+1,e[t-1][i-1]+(s[i-1]===o[t-1]?0:1))}return e[o.length][s.length]}const creator=e=>{const t=new Logger,i=Object(e),r=Object.keys(Object(i.features)),a=i.browsers?void 0:i.env,c=i.browsers,p=initializeSharedOptions(i),n=listFeatures(o,i,p,t),l=n.map((s=>s.plugin));!1!==i.autoprefixer&&l.push(s(Object.assign({env:a,overrideBrowserslist:c},i.autoprefixer))),logFeaturesList(n,i,t);const internalPlugin=()=>({postcssPlugin:"postcss-preset-env",OnceExit(s,{result:o}){pluginIdHelp(r,s,o),i.debug&&t.emitLogs(o),t.resetLogger()}});return internalPlugin.postcss=!0,{postcssPlugin:"postcss-preset-env",plugins:[...l,internalPlugin()]}};creator.postcss=!0;export{creator as default};
+import s from"autoprefixer";import o from"cssdb";import e from"browserslist";import t from"@csstools/postcss-initial";import i from"postcss-pseudo-class-any-link";import r from"css-blank-pseudo";import a from"postcss-page-break";import c from"@csstools/postcss-cascade-layers";import p from"postcss-attribute-case-insensitive";import n from"postcss-clamp";import l from"@csstools/postcss-color-function";import m from"postcss-color-functional-notation";import u from"@csstools/postcss-color-mix-function";import d from"@csstools/postcss-content-alt-text";import f from"postcss-custom-media";import g from"postcss-custom-properties";import h from"postcss-custom-selectors";import b from"postcss-dir-pseudo-class";import v from"@csstools/postcss-normalize-display-values";import N from"postcss-double-position-gradients";import k from"@csstools/postcss-exponential-functions";import y from"@csstools/postcss-logical-float-and-clear";import w from"postcss-focus-visible";import x from"postcss-focus-within";import F from"@csstools/postcss-font-format-keywords";import $ from"postcss-font-variant";import O from"@csstools/postcss-gamut-mapping";import S from"postcss-gap-properties";import C from"@csstools/postcss-gradients-interpolation-method";import P from"css-has-pseudo";import E from"postcss-color-hex-alpha";import I from"@csstools/postcss-hwb-function";import A from"@csstools/postcss-ic-unit";import B from"postcss-image-set-function";import L from"@csstools/postcss-is-pseudo-class";import q from"postcss-lab-function";import _ from"@csstools/postcss-light-dark-function";import U from"@csstools/postcss-logical-overflow";import j from"@csstools/postcss-logical-overscroll-behavior";import M from"postcss-logical";import z from"@csstools/postcss-logical-resize";import D from"@csstools/postcss-logical-viewport-units";import R from"@csstools/postcss-media-queries-aspect-ratio-number-values";import T from"@csstools/postcss-media-minmax";import V from"@csstools/postcss-nested-calc";import H from"postcss-nesting";import W from"postcss-selector-not";import G from"@csstools/postcss-oklab-function";import K from"postcss-opacity-percentage";import Z from"postcss-overflow-shorthand";import Q from"postcss-replace-overflow-wrap";import J from"postcss-place";import X from"css-prefers-color-scheme";import Y from"@csstools/postcss-progressive-custom-properties";import ss from"postcss-color-rebeccapurple";import os from"@csstools/postcss-relative-color-syntax";import es from"@csstools/postcss-scope-pseudo-class";import ts from"@csstools/postcss-stepped-value-functions";import is from"@csstools/postcss-text-decoration-shorthand";import rs from"@csstools/postcss-trigonometric-functions";import as from"@csstools/postcss-unset-value";const cs={"blank-pseudo-class":"https://github.com/csstools/postcss-plugins/blob/main/plugins/css-blank-pseudo/README.md#browser","focus-visible-pseudo-class":"https://github.com/WICG/focus-visible","focus-within-pseudo-class":"https://github.com/csstools/postcss-plugins/blob/main/plugins/postcss-focus-within/README.md#browser","has-pseudo-class":"https://github.com/csstools/postcss-plugins/blob/main/plugins/css-has-pseudo/README.md#browser","prefers-color-scheme-query":"https://github.com/csstools/postcss-plugins/blob/main/plugins/css-prefers-color-scheme/README.md#browser"},ps=["blank-pseudo-class","focus-visible-pseudo-class","focus-within-pseudo-class","has-pseudo-class","prefers-color-scheme-query"];function logFeaturesList(s,o,e){if(o.debug){e.log("Enabling the following feature(s):");const t=[],i=[];!1!==o.autoprefixer&&i.push(" autoprefixer"),s.forEach((s=>{s.id.startsWith("before")||s.id.startsWith("after")?i.push(` ${s.id} (injected via options)`):i.push(` ${s.id}`),void 0!==cs[s.id]&&t.push(s.id)})),i.sort(((s,o)=>s.localeCompare(o))),t.sort(((s,o)=>s.localeCompare(o))),i.forEach((s=>e.log(s))),t.length&&(e.log("These feature(s) need a browser library to work:"),t.forEach((s=>e.log(` ${s}: ${cs[s]}`))))}}function initializeSharedOptions(s){if("preserve"in s){const o={};return o.preserve=s.preserve,o}return!1}function clamp(s,o,e){return Math.max(s,Math.min(o,e))}const ns=2,ls=5;function stageFromOptions(s,o){let e=ns;if(void 0===s.stage)return o.log(`Using features from Stage ${ns} (default).`),e;if(!1===s.stage)e=ls;else{let o=parseInt(s.stage,10);Number.isNaN(o)&&(o=0),e=clamp(0,o,ls)}return e===ls?o.log('Stage has been disabled, features will be handled via the "features" option.'):o.log(`Using features from Stage ${e}.`),e}const ms=Symbol("insertBefore"),us=Symbol("insertAfter"),ds=Symbol("insertOrder"),fs=Symbol("plugin");function getTransformedInsertions(s,o,e){if("insertBefore"!==e&&"insertAfter"!==e)return[];const t="insertBefore"===e?ms:us,i=[];for(const e in o){if(!Object.hasOwnProperty.call(o,e))continue;if(!s.find((s=>s.id===e)))continue;let r=o[e];Array.isArray(r)||(r=[r]);for(let s=0;sfeatureIsInsertedOrHasAPlugin(s))).sort(((s,o)=>featureIsLess(s,o)))}function getOptionsForBrowsersByFeature(s,o,e,t){switch(o.id){case"is-pseudo-class":return{onComplexSelector:"warning"};case"any-link-pseudo-class":if(s.find((s=>s.startsWith("ie ")||"edge 12"===s||"edge 13"===s||"edge 14"===s||"edge 15"===s||"edge 16"===s||"edge 17"===s||"edge 18"===s)))return t.log("- 'any-link-pseudo-class' setting 'subFeatures: { areaHrefNeedsFixing: true }' due to lack of browser support for area[href] in Edge and IE."),{subFeatures:{areaHrefNeedsFixing:!0}};return{};case"logical-properties-and-values":case"float-clear-logical-values":case"logical-resize":case"logical-viewport-units":case"logical-overflow":case"logical-overscroll-behavior":return"logical"in e?e.logical:{};default:return{}}}const xs=["and_chr","and_ff","android","chrome","edge","firefox","ie","ios_saf","op_mini","op_mob","opera","safari","samsung"];function getUnsupportedBrowsersByFeature(s){if(!s)return[];if(!("browser_support"in s))return["> 0%"];const o=[];return xs.forEach((e=>{if("op_mini"===e&&void 0===s.browser_support[e])return void o.push("op_mini all");const t=s.browser_support[e];"string"==typeof t&&Fs.test(t)?o.push(`${e} < ${s.browser_support[e]}`):o.push(`${e} >= 1`)})),o}const Fs=/^[0-9|.]+$/;function formatPolyfillableFeature(s){const o=getUnsupportedBrowsersByFeature(s);if(s[ms]||s[us]){let e=s.id;return e=s.insertBefore?`before-${e}`:`after-${e}`,{browsers:o,vendors_implementations:s.vendors_implementations,plugin:s[fs],id:e,stage:ls+1}}return{browsers:o,vendors_implementations:s.vendors_implementations,plugin:ws.get(s.id),id:s.id,stage:s.stage}}function formatStagedFeature(s,o,e,t,i,r){let a,c;return a=getOptionsForBrowsersByFeature(s,e,i,r),a=t?Object.assign({},a,t,featureOptions(o,e.id)):Object.assign({},a,featureOptions(o,e.id)),"progressive-custom-properties"!==e.id&&(a.enableProgressiveCustomProperties=!1),"overflow-wrap-property"===e.id&&"preserve"in a&&(a.method=a.preserve?"copy":"replace"),c=e.plugin.postcss&&"function"==typeof e.plugin?e.plugin(a):e.plugin&&e.plugin.default&&"function"==typeof e.plugin.default&&e.plugin.default.postcss?e.plugin.default(a):e.plugin,{browsers:e.browsers,vendors_implementations:e.vendors_implementations,plugin:c,pluginOptions:a,id:e.id}}function featureOptions(s,o){if(!(o in s))return;const e=s[o];return Array.isArray(e)?e[1]:e}function intOrZero(s){const o=parseInt(s,10);return Number.isNaN(o)?0:o}const $s=new Set(["progressive-custom-properties"]);function listFeatures(s,o,t,i){const r=Object(o.features),a="enableClientSidePolyfills"in o&&o.enableClientSidePolyfills,c=Object(o.insertBefore),p=Object(o.insertAfter),n=o.browsers?void 0:o.env,l=o.browsers,m=clamp(0,intOrZero(o.minimumVendorImplementations),3);m>0&&i.log(`Using features with ${m} or more vendor implementations.`);const u=stageFromOptions(o,i),d=prepareFeaturesList([...s,{id:"progressive-custom-properties"}],c,p).map((s=>formatPolyfillableFeature(s))).filter((s=>!!$s.has(s.id)||(0===m||(!(!s[ms]&&!s[us])||(m<=s.vendors_implementations||(!0===featureEnabledByOptions(r,s.id)?(i.log(`- '${s.id}' enabled manually even when it lacks the required interop (${s.vendors_implementations} out of ${m}).`),!0):(i.log(`- '${s.id}' disabled because it lacks the required interop (${s.vendors_implementations} out of ${m}).`),!1))))))),f=e(l,{env:n,ignoreUnknownVersions:!0}).filter((s=>xs.includes(s.split(" ")[0])));return d.filter((s=>{if($s.has(s.id))return!0;const o=s.stage>=u,e=a||!ps.includes(s.id),t=featureEnabledByOptions(r,s.id),c=!1===t,p=!0===t||o&&e;return c?i.log(`- '${s.id}' disabled manually`):o?e||i.log(`- '${s.id}' disabled because 'enableClientSidePolyfills' is 'false'.`):p?i.log(`- '${s.id}' enabled manually even when it lacks the required stage (${s.stage} out of ${u}).`):i.log(`- '${s.id}' disabled because it lacks the required stage (${s.stage} out of ${u}).`),!c&&p})).map((s=>formatStagedFeature(f,r,s,t,o,i))).filter((s=>{if($s.has(s.id))return!0;const o=featureEnabledByOptions(r,s.id);if(!0===o||!1===o)return o;const t=e(s.browsers,{ignoreUnknownVersions:!0}),a=f.filter((s=>t.some((o=>o===s))));return a.length>0?i.log(`- '${s.id}' enabled for:\n ${a.join("\n ")}`):i.log(`- '${s.id}' disabled because all targeted browsers support it.`),a.length>0}))}function featureEnabledByOptions(s,o){if(!(o in s))return"auto";const e=s[o];return Array.isArray(e)?!0===e[0]||!1!==e[0]&&"auto":Boolean(e)}class Logger{constructor(){this.logs=[]}log(s){this.logs.push(s)}resetLogger(){this.logs.length=0}emitLogs(s){s&&s.warn(this.logs.join("\n")),this.resetLogger()}}var Os=[{packageName:"css-blank-pseudo",id:"blank-pseudo-class",importName:"postcssBlankPseudo"},{packageName:"css-has-pseudo",id:"has-pseudo-class",importName:"postcssHasPseudo"},{packageName:"css-prefers-color-scheme",id:"prefers-color-scheme-query",importName:"postcssPrefersColorScheme"},{packageName:"postcss-attribute-case-insensitive",id:"case-insensitive-attributes",importName:"postcssAttributeCaseInsensitive"},{packageName:"postcss-clamp",id:"clamp",importName:"postcssClamp"},{packageName:"@csstools/postcss-color-mix-function",id:"color-mix",importName:"postcssColorMixFunction"},{packageName:"@csstools/postcss-color-function",id:"color-function",importName:"postcssColorFunction"},{packageName:"postcss-color-functional-notation",id:"color-functional-notation",importName:"postcssColorFunctionalNotation"},{packageName:"postcss-color-hex-alpha",id:"hexadecimal-alpha-notation",importName:"postcssColorHexAlpha"},{packageName:"@csstools/postcss-content-alt-text",id:"content-alt-text",importName:"postcssContentAltText"},{packageName:"postcss-color-rebeccapurple",id:"rebeccapurple-color",importName:"postcssColorRebeccapurple"},{packageName:"postcss-custom-media",id:"custom-media-queries",importName:"postcssCustomMedia"},{packageName:"postcss-custom-properties",id:"custom-properties",importName:"postcssCustomProperties"},{packageName:"postcss-custom-selectors",id:"custom-selectors",importName:"postcssCustomSelectors"},{packageName:"postcss-dir-pseudo-class",id:"dir-pseudo-class",importName:"postcssDirPseudoClass"},{packageName:"postcss-double-position-gradients",id:"double-position-gradients",importName:"postcssDoublePositionGradients"},{packageName:"@csstools/postcss-exponential-functions",id:"exponential-functions",importName:"postcssExponentialFunctions"},{packageName:"postcss-focus-visible",id:"focus-visible-pseudo-class",importName:"postcssFocusVisible"},{packageName:"postcss-focus-within",id:"focus-within-pseudo-class",importName:"postcssFocusWithin"},{packageName:"@csstools/postcss-font-format-keywords",id:"font-format-keywords",importName:"postcssFontFormatKeywords"},{packageName:"postcss-font-variant",id:"font-variant-property",importName:"postcssFontVariant"},{packageName:"@csstools/postcss-gamut-mapping",id:"gamut-mapping",importName:"postcssGamutMapping"},{packageName:"postcss-gap-properties",id:"gap-properties",importName:"postcssGapProperties"},{packageName:"@csstools/postcss-gradients-interpolation-method",id:"gradients-interpolation-method",importName:"postcssGradientsInterpolationMethod"},{packageName:"@csstools/postcss-hwb-function",id:"hwb-function",importName:"postcssHWBFunction"},{packageName:"@csstools/postcss-ic-unit",id:"ic-unit",importName:"postcssICUnit"},{packageName:"postcss-image-set-function",id:"image-set-function",importName:"postcssImageSetFunction"},{packageName:"@csstools/postcss-initial",id:"all-property",importName:"postcssInitial"},{packageName:"@csstools/postcss-is-pseudo-class",id:"is-pseudo-class",importName:"postcssIsPseudoClass"},{packageName:"@csstools/postcss-scope-pseudo-class",id:"scope-pseudo-class",importName:"postcssScopePseudoClass"},{packageName:"postcss-lab-function",id:"lab-function",importName:"postcssLabFunction"},{packageName:"@csstools/postcss-light-dark-function",id:"light-dark-function",importName:"postcssLightDarkFunction"},{packageName:"postcss-logical",id:"logical-properties-and-values",importName:"postcssLogical"},{packageName:"@csstools/postcss-logical-float-and-clear",id:"float-clear-logical-values",importName:"postcssLogicalFloatAndClear"},{packageName:"@csstools/postcss-logical-overflow",id:"logical-overflow",importName:"postcssLogicalOverflow"},{packageName:"@csstools/postcss-logical-overscroll-behavior",id:"logical-overscroll-behavior",importName:"postcssLogicalOverscrollBehavor"},{packageName:"@csstools/postcss-logical-resize",id:"logical-resize",importName:"postcssLogicalResize"},{packageName:"@csstools/postcss-logical-viewport-units",id:"logical-viewport-units",importName:"postcssLogicalViewportUnits"},{packageName:"@csstools/postcss-media-minmax",id:"media-query-ranges",importName:"postcssMediaMinmax"},{packageName:"@csstools/postcss-media-queries-aspect-ratio-number-values",id:"media-queries-aspect-ratio-number-values",importName:"postcssMediaQueriesAspectRatioNumberValues"},{packageName:"postcss-nesting",id:"nesting-rules",importName:"postcssNesting"},{packageName:"@csstools/postcss-normalize-display-values",id:"display-two-values",importName:"postcssNormalizeDisplayValues"},{packageName:"@csstools/postcss-oklab-function",id:"oklab-function",importName:"postcssOKLabFunction"},{packageName:"@csstools/postcss-relative-color-syntax",id:"relative-color-syntax",importName:"postcssRelativeColorSyntax"},{packageName:"postcss-opacity-percentage",id:"opacity-percentage",importName:"postcssOpacityPercentage"},{packageName:"postcss-overflow-shorthand",id:"overflow-property",importName:"postcssOverflowShorthand"},{packageName:"postcss-page-break",id:"break-properties",importName:"postcssPageBreak"},{packageName:"postcss-place",id:"place-properties",importName:"postcssPlace"},{packageName:"postcss-pseudo-class-any-link",id:"any-link-pseudo-class",importName:"postcssPseudoClassAnyLink"},{packageName:"postcss-replace-overflow-wrap",id:"overflow-wrap-property",importName:"postcssReplaceOverflowWrap"},{packageName:"postcss-selector-not",id:"not-pseudo-class",importName:"postcssSelectorNot"},{packageName:"@csstools/postcss-stepped-value-functions",id:"stepped-value-functions",importName:"postcssSteppedValueFunctions"},{packageName:"postcss-system-ui-font-family",importedPackage:"../patch/postcss-system-ui-font-family.mjs",id:"system-ui-font-family",importName:"postcssFontFamilySystemUI"},{packageName:"@csstools/postcss-unset-value",id:"unset-value",importName:"postcssUnsetValue"},{packageName:"@csstools/postcss-cascade-layers",id:"cascade-layers",importName:"postcssCascadeLayers"},{packageName:"@csstools/postcss-trigonometric-functions",id:"trigonometric-functions",importName:"postcssTrigonometricFunctions"},{packageName:"@csstools/postcss-nested-calc",id:"nested-calc",importName:"postcssNestedCalc"},{packageName:"@csstools/postcss-text-decoration-shorthand",id:"text-decoration-shorthand",importName:"postcssTextDecorationShorthand"},{packageName:"@csstools/postcss-progressive-custom-properties",id:"progressive-custom-properties",importName:"postcssProgressiveCustomProperties",omitTypedOptions:!0,omitDocs:!0}];function getPackageNamesToIds(){const s={};return Os.forEach((o=>{s[o.packageName]=o.id})),s}function pluginIdHelp(s,o,e){const t=Os.map((s=>s.id)),i=Os.map((s=>s.packageName)),r=getPackageNamesToIds();s.forEach((s=>{if(t.includes(s))return;const a=[...t.map((o=>[o,levenshteinDistance(s,o)])),...i.map((o=>[r[o],levenshteinDistance(s,o)]))].sort(((s,o)=>s[1]-o[1])).filter((s=>s[1]<10)),c=new Set;for(let s=0;s=3));s++);if(!c.size)return void o.warn(e,`Unknown feature: "${s}", see the list of features https://github.com/csstools/postcss-plugins/blob/main/plugin-packs/postcss-preset-env/FEATURES.md`);let p='"';p+=Array.from(c).join('", "'),p+='"',o.warn(e,`Unknown feature: "${s}", did you mean one of: ${p}`)}))}function levenshteinDistance(s,o){if(!s.length)return o.length;if(!o.length)return s.length;const e=[];for(let t=0;t<=o.length;t++){e[t]=[t];for(let i=1;i<=s.length;i++)e[t][i]=0===t?i:Math.min(e[t-1][i]+1,e[t][i-1]+1,e[t-1][i-1]+(s[i-1]===o[t-1]?0:1))}return e[o.length][s.length]}const creator=e=>{const t=new Logger,i=Object(e),r=Object.keys(Object(i.features)),a=i.browsers?void 0:i.env,c=i.browsers,p=initializeSharedOptions(i),n=listFeatures(o,i,p,t),l=n.map((s=>s.plugin));!1!==i.autoprefixer&&l.push(s(Object.assign({env:a,overrideBrowserslist:c},i.autoprefixer))),logFeaturesList(n,i,t);const internalPlugin=()=>({postcssPlugin:"postcss-preset-env",OnceExit(s,{result:o}){pluginIdHelp(r,s,o),i.debug&&t.emitLogs(o),t.resetLogger()}});return internalPlugin.postcss=!0,{postcssPlugin:"postcss-preset-env",plugins:[...l,internalPlugin()]}};creator.postcss=!0;export{creator as default};
diff --git a/plugin-packs/postcss-preset-env/docs/generate.mjs b/plugin-packs/postcss-preset-env/docs/generate.mjs
index c64884de1..e015ef8c2 100644
--- a/plugin-packs/postcss-preset-env/docs/generate.mjs
+++ b/plugin-packs/postcss-preset-env/docs/generate.mjs
@@ -1,5 +1,5 @@
import cssdb from 'cssdb';
-import fs from 'fs/promises';
+import fs from 'node:fs/promises';
let featuresTable = '';
diff --git a/plugin-packs/postcss-preset-env/package.json b/plugin-packs/postcss-preset-env/package.json
index 01930eceb..e7292aead 100644
--- a/plugin-packs/postcss-preset-env/package.json
+++ b/plugin-packs/postcss-preset-env/package.json
@@ -29,7 +29,7 @@
}
],
"engines": {
- "node": "^14 || ^16 || >=18"
+ "node": ">=18"
},
"type": "module",
"main": "dist/index.cjs",
diff --git a/plugin-packs/postcss-preset-env/scripts/generate-plugins-data.mjs b/plugin-packs/postcss-preset-env/scripts/generate-plugins-data.mjs
index f8d279c62..442a934fc 100644
--- a/plugin-packs/postcss-preset-env/scripts/generate-plugins-data.mjs
+++ b/plugin-packs/postcss-preset-env/scripts/generate-plugins-data.mjs
@@ -1,6 +1,6 @@
-import fs from 'fs/promises';
-import { existsSync } from 'fs';
-import path from 'path';
+import fs from 'node:fs/promises';
+import { existsSync } from 'node:fs';
+import path from 'node:path';
const pluginsData = await fs.readFile('./scripts/plugins-data.json', 'utf8').then(JSON.parse);
diff --git a/plugin-packs/postcss-preset-env/scripts/update-logical-properties-test.mjs b/plugin-packs/postcss-preset-env/scripts/update-logical-properties-test.mjs
index 5c5ff1a23..50f44fa83 100644
--- a/plugin-packs/postcss-preset-env/scripts/update-logical-properties-test.mjs
+++ b/plugin-packs/postcss-preset-env/scripts/update-logical-properties-test.mjs
@@ -1,5 +1,5 @@
import css from '@webref/css';
-import fs from 'fs/promises';
+import fs from 'node:fs/promises';
const logicalProperties = new Set();
diff --git a/plugin-packs/postcss-preset-env/src/lib/format-feature.mjs b/plugin-packs/postcss-preset-env/src/lib/format-feature.mjs
index d62d56f6b..5d4d36ceb 100644
--- a/plugin-packs/postcss-preset-env/src/lib/format-feature.mjs
+++ b/plugin-packs/postcss-preset-env/src/lib/format-feature.mjs
@@ -33,11 +33,11 @@ export function formatPolyfillableFeature(feature) {
};
}
-export function formatStagedFeature(cssdbList, supportedBrowsers, features, feature, sharedOptions, options, logger) {
+export function formatStagedFeature(supportedBrowsers, features, feature, sharedOptions, options, logger) {
let pluginOption;
let plugin;
- pluginOption = getOptionsForBrowsersByFeature(supportedBrowsers, feature, cssdbList, options, logger);
+ pluginOption = getOptionsForBrowsersByFeature(supportedBrowsers, feature, options, logger);
if (sharedOptions) {
pluginOption = Object.assign({}, pluginOption, sharedOptions, featureOptions(features, feature.id));
diff --git a/plugin-packs/postcss-preset-env/src/lib/get-options-for-browsers-by-feature.mjs b/plugin-packs/postcss-preset-env/src/lib/get-options-for-browsers-by-feature.mjs
index 88c291c58..70afc6ec0 100644
--- a/plugin-packs/postcss-preset-env/src/lib/get-options-for-browsers-by-feature.mjs
+++ b/plugin-packs/postcss-preset-env/src/lib/get-options-for-browsers-by-feature.mjs
@@ -1,8 +1,5 @@
-import browserslist from 'browserslist';
-import { getUnsupportedBrowsersByFeature } from './get-unsupported-browsers-by-feature.mjs';
-
// add extra options for certain browsers by feature
-export default function getOptionsForBrowsersByFeature(supportedBrowsers, feature, cssdbList, options, logger) {
+export default function getOptionsForBrowsersByFeature(supportedBrowsers, feature, options, logger) {
switch (feature.id) {
case 'is-pseudo-class':
// Emit a warning to avoid making unresolved removal of `:is()` a feature.
@@ -10,25 +7,6 @@ export default function getOptionsForBrowsersByFeature(supportedBrowsers, featur
return {
onComplexSelector: 'warning',
};
- case 'nesting-rules':
- {
- // TODO : remove this in a next major release
-
- // Nesting rules can transform selectors to use :is pseudo.
- // This is more spec compliant but it's not supported by all browsers.
- // If we can't use :is pseudo according to preset-env options, we add an extra option to avoid :is pseudo.
- const feature = cssdbList.find(feature => feature.id === 'is-pseudo-class');
-
- if (needsOptionFor(feature, supportedBrowsers)) {
- logger.log('- \'nesting-rules\' setting \'noIsPseudoSelector: true\' due to lack of browser support for \':is()\'.');
- return {
- noIsPseudoSelector: true,
- };
- }
- }
-
- return {};
-
case 'any-link-pseudo-class':
{
const hasIEOrEdge = supportedBrowsers.find((browserslistEntry) => {
@@ -71,18 +49,3 @@ export default function getOptionsForBrowsersByFeature(supportedBrowsers, featur
return {};
}
}
-
-function needsOptionFor(feature, supportedBrowsers) {
- const unsupportedIn = getUnsupportedBrowsersByFeature(feature);
- const unsupportedBrowsers = browserslist(unsupportedIn, {
- ignoreUnknownVersions: true,
- });
-
- if (supportedBrowsers.some((supportedBrowser) => {
- return unsupportedBrowsers.some(polyfillBrowser => polyfillBrowser === supportedBrowser);
- })) {
- return true;
- }
-
- return false;
-}
diff --git a/plugin-packs/postcss-preset-env/src/lib/list-features.mjs b/plugin-packs/postcss-preset-env/src/lib/list-features.mjs
index f7f1453de..4139b4997 100644
--- a/plugin-packs/postcss-preset-env/src/lib/list-features.mjs
+++ b/plugin-packs/postcss-preset-env/src/lib/list-features.mjs
@@ -104,7 +104,7 @@ export function listFeatures(cssdbList, options, sharedOptions, logger) {
return !isDisabled && isAllowedFeature;
}).map((feature) => {
- return formatStagedFeature(cssdbList, supportedBrowsers, features, feature, sharedOptions, options, logger);
+ return formatStagedFeature(supportedBrowsers, features, feature, sharedOptions, options, logger);
});
// - features supported by the stage
diff --git a/plugin-packs/postcss-preset-env/src/options.ts b/plugin-packs/postcss-preset-env/src/options.ts
index af98f5db4..b31f717f5 100644
--- a/plugin-packs/postcss-preset-env/src/options.ts
+++ b/plugin-packs/postcss-preset-env/src/options.ts
@@ -1,5 +1,5 @@
import type autoprefixer from 'autoprefixer';
-import { pluginsOptions } from './plugins/plugins-options';
+import type { pluginsOptions } from './plugins/plugins-options';
export enum DirectionFlow {
TopToBottom = 'top-to-bottom',
diff --git a/plugin-packs/postcss-preset-env/src/test/lib/feature-is-inserted-or-has-plugin.mjs b/plugin-packs/postcss-preset-env/src/test/lib/feature-is-inserted-or-has-plugin.mjs
index 1cae2566f..b00ce919d 100644
--- a/plugin-packs/postcss-preset-env/src/test/lib/feature-is-inserted-or-has-plugin.mjs
+++ b/plugin-packs/postcss-preset-env/src/test/lib/feature-is-inserted-or-has-plugin.mjs
@@ -1,5 +1,5 @@
import { featureIsInsertedOrHasAPlugin } from '../../lib/feature-is-inserted-or-has-plugin.mjs';
-import { strict as assert } from 'assert';
+import { strict as assert } from 'node:assert';
import { insertAfterKey, insertBeforeKey } from '../../own-keys/keys.mjs';
// regular features
diff --git a/plugin-packs/postcss-preset-env/src/test/lib/feature-is-less.mjs b/plugin-packs/postcss-preset-env/src/test/lib/feature-is-less.mjs
index bc77f478d..506c07fad 100644
--- a/plugin-packs/postcss-preset-env/src/test/lib/feature-is-less.mjs
+++ b/plugin-packs/postcss-preset-env/src/test/lib/feature-is-less.mjs
@@ -1,5 +1,5 @@
import { featureIsLess } from '../../lib/feature-is-less.mjs';
-import { strict as assert } from 'assert';
+import { strict as assert } from 'node:assert';
import { insertAfterKey, insertBeforeKey, insertOrderKey } from '../../own-keys/keys.mjs';
// "featureIsLess" works as a sorting function.
diff --git a/plugin-packs/postcss-preset-env/src/test/lib/format-staged-feature.mjs b/plugin-packs/postcss-preset-env/src/test/lib/format-staged-feature.mjs
index bc7c71494..8d03cefa6 100644
--- a/plugin-packs/postcss-preset-env/src/test/lib/format-staged-feature.mjs
+++ b/plugin-packs/postcss-preset-env/src/test/lib/format-staged-feature.mjs
@@ -1,13 +1,12 @@
import browserslist from 'browserslist';
import { formatStagedFeature } from '../../lib/format-feature.mjs';
-import { strict as assert } from 'assert';
+import { strict as assert } from 'node:assert';
import { newTestLogger } from '../log/test-logger.mjs';
const testLogger = newTestLogger();
assert.deepStrictEqual(
formatStagedFeature(
- [],
browserslist(['ie >= 1'], { ignoreUnknownVersions: true }),
{},
{
@@ -40,7 +39,6 @@ assert.deepStrictEqual(
assert.deepStrictEqual(
formatStagedFeature(
- [],
browserslist(['ie >= 1'], { ignoreUnknownVersions: true }),
{
'any-link-pseudo-class': true,
@@ -75,7 +73,6 @@ assert.deepStrictEqual(
assert.deepStrictEqual(
formatStagedFeature(
- [],
browserslist(['ie >= 1'], { ignoreUnknownVersions: true }),
{
'any-link-pseudo-class': true,
@@ -113,7 +110,6 @@ assert.deepStrictEqual(
assert.deepStrictEqual(
formatStagedFeature(
- [],
browserslist(['ie >= 1'], { ignoreUnknownVersions: true }),
{},
{
@@ -150,7 +146,6 @@ assert.deepStrictEqual(
// Logical does not get passed to a non-logical plugin
assert.deepStrictEqual(
formatStagedFeature(
- [],
browserslist(['ie >= 1'], { ignoreUnknownVersions: true }),
{},
{
@@ -203,7 +198,6 @@ assert.deepStrictEqual(
for (const plugin of logicalPlugins) {
assert.deepStrictEqual(
formatStagedFeature(
- [],
browserslist(['ie >= 1'], { ignoreUnknownVersions: true }),
{},
{
diff --git a/plugin-packs/postcss-preset-env/src/test/lib/get-unsupported-browsers-by-feature.mjs b/plugin-packs/postcss-preset-env/src/test/lib/get-unsupported-browsers-by-feature.mjs
index 48b24030e..a7ad3155e 100644
--- a/plugin-packs/postcss-preset-env/src/test/lib/get-unsupported-browsers-by-feature.mjs
+++ b/plugin-packs/postcss-preset-env/src/test/lib/get-unsupported-browsers-by-feature.mjs
@@ -1,6 +1,6 @@
import { getUnsupportedBrowsersByFeature } from '../../lib/get-unsupported-browsers-by-feature.mjs';
-import { strict as assert } from 'assert';
+import { strict as assert } from 'node:assert';
assert.deepStrictEqual(
getUnsupportedBrowsersByFeature(),
diff --git a/plugin-packs/postcss-preset-env/src/test/lib/list-features/client-side.mjs b/plugin-packs/postcss-preset-env/src/test/lib/list-features/client-side.mjs
index 0c638fb02..70e3f8cc2 100644
--- a/plugin-packs/postcss-preset-env/src/test/lib/list-features/client-side.mjs
+++ b/plugin-packs/postcss-preset-env/src/test/lib/list-features/client-side.mjs
@@ -1,5 +1,5 @@
import { logsContainEnabledFor, newTestLogger } from '../../log/test-logger.mjs';
-import { strict as assert } from 'assert';
+import { strict as assert } from 'node:assert';
import { listFeatures } from '../../../lib/list-features.mjs';
import { cssdb } from './cssdb-fixture.mjs';
diff --git a/plugin-packs/postcss-preset-env/src/test/lib/list-features/no-options.mjs b/plugin-packs/postcss-preset-env/src/test/lib/list-features/no-options.mjs
index 4597ab9c8..36feeefef 100644
--- a/plugin-packs/postcss-preset-env/src/test/lib/list-features/no-options.mjs
+++ b/plugin-packs/postcss-preset-env/src/test/lib/list-features/no-options.mjs
@@ -1,5 +1,5 @@
import { newTestLogger } from '../../log/test-logger.mjs';
-import { strict as assert } from 'assert';
+import { strict as assert } from 'node:assert';
import { listFeatures } from '../../../lib/list-features.mjs';
import { cssdb } from './cssdb-fixture.mjs';
diff --git a/plugin-packs/postcss-preset-env/src/test/lib/list-features/preserve.mjs b/plugin-packs/postcss-preset-env/src/test/lib/list-features/preserve.mjs
index b3b3df9aa..e6b393389 100644
--- a/plugin-packs/postcss-preset-env/src/test/lib/list-features/preserve.mjs
+++ b/plugin-packs/postcss-preset-env/src/test/lib/list-features/preserve.mjs
@@ -1,5 +1,5 @@
import { newTestLogger } from '../../log/test-logger.mjs';
-import { strict as assert } from 'assert';
+import { strict as assert } from 'node:assert';
import { listFeatures } from '../../../lib/list-features.mjs';
import { cssdb } from './cssdb-fixture.mjs';
diff --git a/plugin-packs/postcss-preset-env/src/test/lib/list-features/stage-0.mjs b/plugin-packs/postcss-preset-env/src/test/lib/list-features/stage-0.mjs
index 9a37aaac5..06126416b 100644
--- a/plugin-packs/postcss-preset-env/src/test/lib/list-features/stage-0.mjs
+++ b/plugin-packs/postcss-preset-env/src/test/lib/list-features/stage-0.mjs
@@ -1,5 +1,5 @@
import { newTestLogger } from '../../log/test-logger.mjs';
-import { strict as assert } from 'assert';
+import { strict as assert } from 'node:assert';
import { listFeatures } from '../../../lib/list-features.mjs';
import { cssdb } from './cssdb-fixture.mjs';
diff --git a/plugin-packs/postcss-preset-env/src/test/lib/list-features/vendor-implementations.mjs b/plugin-packs/postcss-preset-env/src/test/lib/list-features/vendor-implementations.mjs
index 6f177a45a..9525d965a 100644
--- a/plugin-packs/postcss-preset-env/src/test/lib/list-features/vendor-implementations.mjs
+++ b/plugin-packs/postcss-preset-env/src/test/lib/list-features/vendor-implementations.mjs
@@ -1,5 +1,5 @@
import { newTestLogger } from '../../log/test-logger.mjs';
-import { strict as assert } from 'assert';
+import { strict as assert } from 'node:assert';
import { listFeatures } from '../../../lib/list-features.mjs';
import { cssdb } from './cssdb-fixture.mjs';
diff --git a/plugin-packs/postcss-preset-env/src/test/lib/prepare-features-list.mjs b/plugin-packs/postcss-preset-env/src/test/lib/prepare-features-list.mjs
index cd94776ae..a76d6950f 100644
--- a/plugin-packs/postcss-preset-env/src/test/lib/prepare-features-list.mjs
+++ b/plugin-packs/postcss-preset-env/src/test/lib/prepare-features-list.mjs
@@ -1,5 +1,5 @@
import { prepareFeaturesList } from '../../lib/prepare-features-list.mjs';
-import { strict as assert } from 'assert';
+import { strict as assert } from 'node:assert';
import { insertAfterKey, insertBeforeKey, insertOrderKey, pluginKey } from '../../own-keys/keys.mjs';
const fixedList = [
diff --git a/plugin-packs/postcss-preset-env/src/test/lib/stage.mjs b/plugin-packs/postcss-preset-env/src/test/lib/stage.mjs
index 0db80363a..c69f8beb7 100644
--- a/plugin-packs/postcss-preset-env/src/test/lib/stage.mjs
+++ b/plugin-packs/postcss-preset-env/src/test/lib/stage.mjs
@@ -1,5 +1,5 @@
import { newTestLogger } from '../log/test-logger.mjs';
-import { strict as assert } from 'assert';
+import { strict as assert } from 'node:assert';
import { OUT_OF_RANGE_STAGE, stageFromOptions } from '../../lib/stage.mjs';
const testLogger = newTestLogger();
diff --git a/plugin-packs/postcss-preset-env/src/test/lib/transformed-insertions.mjs b/plugin-packs/postcss-preset-env/src/test/lib/transformed-insertions.mjs
index 4501adb30..327d3a799 100644
--- a/plugin-packs/postcss-preset-env/src/test/lib/transformed-insertions.mjs
+++ b/plugin-packs/postcss-preset-env/src/test/lib/transformed-insertions.mjs
@@ -1,5 +1,5 @@
import getTransformedInsertions from '../../lib/get-transformed-insertions.mjs';
-import assert from 'assert';
+import assert from 'node:assert';
import { insertAfterKey, insertBeforeKey, insertOrderKey, pluginKey } from '../../own-keys/keys.mjs';
const labFunctionFixture = {
diff --git a/plugin-packs/postcss-preset-env/test/_import.mjs b/plugin-packs/postcss-preset-env/test/_import.mjs
index b9d6a73dd..7ecdceb65 100644
--- a/plugin-packs/postcss-preset-env/test/_import.mjs
+++ b/plugin-packs/postcss-preset-env/test/_import.mjs
@@ -1,4 +1,4 @@
-import assert from 'assert';
+import assert from 'node:assert';
import plugin from 'postcss-preset-env';
plugin();
diff --git a/plugin-packs/postcss-preset-env/test/_tape.mjs b/plugin-packs/postcss-preset-env/test/_tape.mjs
index 42b034562..a56a3a949 100644
--- a/plugin-packs/postcss-preset-env/test/_tape.mjs
+++ b/plugin-packs/postcss-preset-env/test/_tape.mjs
@@ -50,13 +50,6 @@ postcssTape(plugin)({
browsers: 'ie >= 10',
},
},
- 'basic:ch88-ff78': {
- message: 'uses :is pseudo for nesting with modern browsers { browsers: "chrome >= 88, firefox >= 78", stage: 0 }',
- options: {
- browsers: 'chrome >= 88, firefox >= 78',
- stage: 0,
- },
- },
'basic:safari15': {
message: 'supports { browsers: "safari >= 15" } usage',
options: {
@@ -70,25 +63,6 @@ postcssTape(plugin)({
browsers: 'op_mini all',
},
},
- 'basic:ch88-ff78:no-is-pseudo': {
- message: ':is pseudo for nesting can be disable with modern browsers { browsers: "chrome >= 88, firefox >= 78", stage: 0, features: { nesting-rules: { noIsPseudoSelector: true } } } usage',
- options: {
- browsers: 'chrome >= 88, firefox >= 78',
- stage: 0,
- features: {
- 'nesting-rules': {
- noIsPseudoSelector: true,
- },
- },
- },
- },
- 'basic:ch88-ff78-saf10': {
- message: 'does not use :is pseudo for nesting with an older browser { browsers: "chrome >= 88, firefox >= 78, safari >= 10", stage: 0 } usage',
- options: {
- browsers: 'chrome >= 88, firefox >= 78, safari >= 10',
- stage: 0,
- },
- },
'basic:supports-query': {
message: 'supports { browsers: "defaults and supports css-variables" } usage',
options: {
@@ -148,17 +122,6 @@ postcssTape(plugin)({
},
},
},
- 'basic:nesting:noIsPseudoSelector:false': {
- message: 'supports { stage: false, features: { "nesting-rules": { "noIsPseudoSelector": false } } } usage',
- options: {
- stage: false,
- features: {
- 'nesting-rules': [true, {
- noIsPseudoSelector: false,
- }],
- },
- },
- },
'basic:nesting:false': {
message: 'supports { stage: 0, features: { "nesting-rules": false } } usage',
options: {
diff --git a/plugin-packs/postcss-preset-env/test/basic.autoprefixer.expect.css b/plugin-packs/postcss-preset-env/test/basic.autoprefixer.expect.css
index d7c80f97f..a647744f1 100644
--- a/plugin-packs/postcss-preset-env/test/basic.autoprefixer.expect.css
+++ b/plugin-packs/postcss-preset-env/test/basic.autoprefixer.expect.css
@@ -43,25 +43,32 @@
.test-nesting-rules {
order: 4;
-
- order: 6;
}
.test-nesting-rules p {
order: 5;
}
+.test-nesting-rules {
+
+ order: 6;
+}
+
.test-nesting-rules,
#test-is-pseudo {
order: 7;
-
- order: 9;
}
-.test-nesting-rules + p, #test-is-pseudo + p {
+.test-nesting-rules:not(#does-not-exist) + p,#test-is-pseudo + p {
order: 8;
}
+.test-nesting-rules,
+#test-is-pseudo {
+
+ order: 9;
+}
+
@media (max-width: 30em) {
.test-custom-media-queries {
order: 10;
diff --git a/plugin-packs/postcss-preset-env/test/basic.autoprefixer.false.expect.css b/plugin-packs/postcss-preset-env/test/basic.autoprefixer.false.expect.css
index b065c6dea..942e537df 100644
--- a/plugin-packs/postcss-preset-env/test/basic.autoprefixer.false.expect.css
+++ b/plugin-packs/postcss-preset-env/test/basic.autoprefixer.false.expect.css
@@ -43,25 +43,32 @@
.test-nesting-rules {
order: 4;
-
- order: 6;
}
.test-nesting-rules p {
order: 5;
}
+.test-nesting-rules {
+
+ order: 6;
+}
+
.test-nesting-rules,
#test-is-pseudo {
order: 7;
-
- order: 9;
}
-.test-nesting-rules + p, #test-is-pseudo + p {
+.test-nesting-rules:not(#does-not-exist) + p,#test-is-pseudo + p {
order: 8;
}
+.test-nesting-rules,
+#test-is-pseudo {
+
+ order: 9;
+}
+
@media (max-width: 30em) {
.test-custom-media-queries {
order: 10;
diff --git a/plugin-packs/postcss-preset-env/test/basic.autoprefixer.remove.false.expect.css b/plugin-packs/postcss-preset-env/test/basic.autoprefixer.remove.false.expect.css
index 0857308cd..2d4a087db 100644
--- a/plugin-packs/postcss-preset-env/test/basic.autoprefixer.remove.false.expect.css
+++ b/plugin-packs/postcss-preset-env/test/basic.autoprefixer.remove.false.expect.css
@@ -44,25 +44,32 @@
.test-nesting-rules {
order: 4;
-
- order: 6;
}
.test-nesting-rules p {
order: 5;
}
+.test-nesting-rules {
+
+ order: 6;
+}
+
.test-nesting-rules,
#test-is-pseudo {
order: 7;
-
- order: 9;
}
-.test-nesting-rules + p, #test-is-pseudo + p {
+.test-nesting-rules:not(#does-not-exist) + p,#test-is-pseudo + p {
order: 8;
}
+.test-nesting-rules,
+#test-is-pseudo {
+
+ order: 9;
+}
+
@media (max-width: 30em) {
.test-custom-media-queries {
order: 10;
diff --git a/plugin-packs/postcss-preset-env/test/basic.ch38.expect.css b/plugin-packs/postcss-preset-env/test/basic.ch38.expect.css
index 4b5e7a07b..1553f5353 100644
--- a/plugin-packs/postcss-preset-env/test/basic.ch38.expect.css
+++ b/plugin-packs/postcss-preset-env/test/basic.ch38.expect.css
@@ -36,25 +36,32 @@
.test-nesting-rules {
order: 4;
-
- order: 6;
}
.test-nesting-rules p {
order: 5;
}
+.test-nesting-rules {
+
+ order: 6;
+}
+
.test-nesting-rules,
#test-is-pseudo {
order: 7;
-
- order: 9;
}
-.test-nesting-rules + p, #test-is-pseudo + p {
+.test-nesting-rules:not(#does-not-exist) + p,#test-is-pseudo + p {
order: 8;
}
+.test-nesting-rules,
+#test-is-pseudo {
+
+ order: 9;
+}
+
@media (max-width: 30em) {
.test-custom-media-queries {
order: 10;
diff --git a/plugin-packs/postcss-preset-env/test/basic.ch88-ff78-saf10.expect.css b/plugin-packs/postcss-preset-env/test/basic.ch88-ff78-saf10.expect.css
deleted file mode 100644
index 050ecd40b..000000000
--- a/plugin-packs/postcss-preset-env/test/basic.ch88-ff78-saf10.expect.css
+++ /dev/null
@@ -1,624 +0,0 @@
-:root {
- --order: 1;
-}
-
-.test-custom-property-fallbacks {
- --firebrick: rgb(179, 35, 35);
-}
-
-.test-custom-properties {
- order: var(--order);
-}
-
-.test-image-set-function {
- background-image: url(img/test.png);
- background-image: -webkit-image-set(url(img/test.png) 1x, url(img/test-2x.png) 2x);
- background-image: image-set(url(img/test.png) 1x, url(img/test-2x.png) 2x);
- order: 2;
-}
-
-@media (-webkit-min-device-pixel-ratio: 2), (min-resolution: 192dpi) {
-
-.test-image-set-function {
- background-image: url(img/test-2x.png);
-}
-}
-
-.test-logical-properties-and-values {
- margin-left: 1px;
- margin-right: 2px;
- order: 3;
- padding-top: 4px;
- padding-bottom: 4px;
-}
-
-.test-logical-resize {
- resize: horizontal;
-}
-
-.test-logical-viewport-units {
- width: calc(10vw + 5px);
- width: calc(10vi + 5px);
-}
-
-.test-nesting-rules {
- order: 4;
-
- order: 6;
-}
-
-.test-nesting-rules p {
- order: 5;
- }
-
-.test-nesting-rules,
-#test-is-pseudo {
- order: 7;
-
- order: 9;
-}
-
-.test-nesting-rules + p, #test-is-pseudo + p {
- order: 8;
- }
-
-@media (max-width: 30em) {
- .test-custom-media-queries {
- order: 10;
- }
-}
-
-@media (min-width: 480px) and (max-width: 767.98px) {
- .test-media-query-ranges {
- order: 11;
- }
-}
-
-@media (prefers-color-scheme: dark) {
- body {
- background-color: black;
- color: white;
- }
-}
-
-h1.test-custom-selectors:not(.does-not-exist), h2.test-custom-selectors:not(.does-not-exist), h3.test-custom-selectors:not(.does-not-exist), h4.test-custom-selectors:not(.does-not-exist), h5.test-custom-selectors:not(.does-not-exist), h6.test-custom-selectors:not(.does-not-exist), .test-custom-selectors.heading-7 {
- order:12;
-}
-
-.test-case-insensitive-attributes[frame=hsides i] {
- order: 13;
-}
-
-.test-rebeccapurple-color {
- color: rebeccapurple;
- order: 14;
-}
-
-.test-hexadecimal-alpha-notation {
- background-color: #f3f3f3f3;
- color: #0003;
- order: 15;
-}
-
-.test-color-functional-notation {
- color: rgba(179, 34, 34, 0.5);
- order: 16;
-}
-
-.test-lab-function {
- background-color: rgb(179, 35, 35);
- color: rgba(179, 34, 35, 0.5);
- order: 17;
-}
-
-.test-system-ui-font-family {
- font-family: system-ui, -apple-system, Segoe UI, Roboto, Ubuntu, Cantarell, Noto Sans, sans-serif;
- order: 18;
-}
-
-.test-font-variant-property {
- font-feature-settings: "smcp";
- font-variant-caps: small-caps;
- order: 19;
-}
-
-.test-all-property {
- all: initial;
- order: 20;
-}
-
-.test-matches-pseudo-class:matches(:first-child, .special) {
- order: 21;
-}
-
-.test-not-pseudo-class:not(:first-child):not(.special) {
- order: 22;
-}
-
-.test-any-link-pseudo-class:any-link {
- order: 23;
-}
-
-[dir="rtl"] .test-dir-pseudo-class {
- order: 24;
-}
-
-.test-overflow-wrap-property {
- order: 25;
- overflow-wrap: break-word;
-}
-
-.test-focus-visible-pseudo-class:focus-visible {
- order: 26;
-}
-
-.test-double-position-gradients {
- background-image: conic-gradient(yellowgreen 40%, gold 0deg,gold 75%, #f06 0deg);
- background-image: conic-gradient(yellowgreen 40%, gold 0deg 75%, #f06 0deg);
-}
-
-.test-blank-pseudo-class:blank {
- background-color: yellow;
-}
-
-.test-has-pseudo-class:has(.inner-class) {
- background-color: yellow;
-}
-
-.a:focus, .a:hover, .b:focus, .b:hover {
- order: 27;
-}
-
-.a.c > .b + .d {
- order: 28;
-}
-
-.test-hwb-function {
- background-color: rgba(0, 196, 255, 0.5);
-}
-
-.test-opacity-percent {
- opacity: 0.42;
-}
-
-.clamp-same-unit {
- width: max(10px, min(64px, 80px));
-}
-
-.complex-clamp {
- width: max(calc(100% - 10px), min(min(10px, 100%), max(40px, 4em)));
-}
-
-.clamp-different-units {
- width: max(10%, min(2px, 4rem));
-}
-
-.mixed-clamp {
- grid-template-columns: max(22rem, min(40%, 32rem)) minmax(0, 1fr);
- margin: max(1rem, min(2%, 3rem)) 4vh;
-}
-
-.calc-clamp {
- margin: 0 40px 0 calc(-1 * max(32px, min(16vw, 64px)));
-}
-
-.multiple-calc-clamp {
- margin: calc(-1 * max(1px, min(2vw, 3px))) calc(-1 * max(4px, min(5vw, 6px)));
-}
-
-.nested-clamp {
- font-size: max(max(1rem, min(2vw, 3rem)), min(4vw, 5rem));
-}
-
-@font-face {
- font-family: 'A';
- font-style: normal;
- font-weight: 300;
- font-display: swap;
- src: url(a) format("woff2");
-}
-
-.block-flow {
- display: block;
- display: block flow;
-}
-
-.block-flow-root {
- display: flow-root;
- display: block flow-root;
-}
-
-.inline-flow {
- display: inline;
- display: inline flow;
-}
-
-.inline-flow-root {
- display: inline-block;
- display: inline flow-root;
-}
-
-.run-in-flow {
- display: run-in;
- display: run-in flow;
-}
-
-.list-item-block-flow {
- display: list-item;
- display: list-item block flow;
-}
-
-.inline-flow-list-item {
- display: inline list-item;
- display: inline flow list-item;
-}
-
-.block-flex {
- display: flex;
- display: block flex;
-}
-
-.inline-flex {
- display: inline-flex;
- display: inline flex;
-}
-
-.block-grid {
- display: grid;
- display: block grid;
-}
-
-.inline-grid {
- display: inline-grid;
- display: inline grid;
-}
-
-.inline-ruby {
- display: ruby;
- display: inline ruby;
-}
-
-.block-table {
- display: table;
- display: block table;
-}
-
-.inline-table {
- display: inline-table;
- display: inline table;
-}
-
-.table-cell-flow {
- display: table-cell;
- display: table-cell flow;
-}
-
-.table-caption-flow {
- display: table-caption;
- display: table-caption flow;
-}
-
-.ruby-base-flow {
- display: ruby-base;
- display: ruby-base flow;
-}
-
-.ruby-text-flow {
- display: ruby-text;
- display: ruby-text flow;
-}
-
-.logical-float {
- float: left;
-}
-
-.color-function {
- prop-1: rgb(0, 129, 96);
- prop-2: 'color(display-p3 0.02472 0.01150 0.00574 / 1)';
- prop-3: rgb(7, 3, 1);
- prop-4: rgb(7, 3, 1);
- prop-5: color(display-p3 1 1 1 1);
-}
-
-.oklab {
- color-1: rgb(73, 71, 69);
- color-2: rgb(121, 34, 67);
- color-3: rgba(121, 34, 67, 0.5);
- color-4: rgb(121, 34, 67);
- color-5: rgba(121, 34, 67, 0.5);
- color-6: rgb(177, 102, 126);
- color-7: oklab(60% 0.1 0 foo);
- color-8: rgb(125, 35, 41);
- color-9: rgb(198, 93, 7);
- color-10: rgb(157, 147, 24);
- color-11: rgb(104, 166, 57);
- color-12: rgb(98, 172, 239);
-}
-
-.oklch {
- color-1: rgb(126, 37, 15);
- color-2: rgb(126, 37, 15);
- color-3: rgba(126, 37, 15, 0.5);
- color-4: rgb(126, 37, 15);
- color-5: rgba(126, 37, 15, 0.5);
- color-6: rgb(197, 84, 124);
-
- color-7: rgb(0, 149, 131);
- color-8: rgb(0, 149, 131);
- color-9: rgb(0, 149, 131);
- color-10: rgb(0, 149, 131);
- color-11: rgb(0, 149, 131);
-
- color-12: rgb(188, 101, 59);
- color-13: rgb(188, 101, 59);
- color-14: rgb(188, 101, 59);
- color-15: rgb(188, 101, 59);
- color-16: rgb(188, 101, 59);
- color-17: oklch(60% 0.1250 0.785398unknown);
-}
-
-@media (color-gamut: p3) {
-.oklch {
-
- color-7: color(display-p3 0.19244 0.58461 0.51559);
- color-8: color(display-p3 0.19244 0.58461 0.51559);
- color-9: color(display-p3 0.19244 0.58461 0.51559);
- color-10: color(display-p3 0.19244 0.58461 0.51559);
- color-11: color(display-p3 0.19244 0.58461 0.51559);
-}
-}
-
-.ic-unit {
- --value-2ic: initial;
- text-indent: 2em;
- content: var(--value-2ic);
- left: var(--non-existing, 2em);
- width: calc(8em + 20px);
- height: 10px;
- margin: 0.5em 1em .2em;
- padding: 2 ic;
-}
-
-.unset {
- clip: unset;
-}
-
-.mod {
- padding: 8px 3px 1px calc(3px + 50%);
- transform: rotate(-50deg);
- width: 2px;
-}
-
-.rem {
- padding: 8px 3px 1px calc(3px + 50%);
- transform: rotate(-50deg);
-}
-
-.round {
- top: 3px;
- right: 3px;
- bottom: 3px;
- left: 2px;
- padding-left: 2px;
-}
-
-.trigonometric {
- left: 0.70711;
- left: 0.70711;
- left: 1;
- left: 30deg;
- left: 60deg;
- left: 84.28941deg;
- left: -45deg;
- left: 90deg;
- left: 135deg;
- left: 0.99863;
-}
-
-.trigonometric-ignore-not-a-function {
- left: sin;
- left: cos;
- left: tan;
- left: asin;
- left: acos;
- left: atan;
- left: atan2;
-}
-
-.trigonometric-ignore-no-arguments {
- left: sin();
- left: cos();
- left: tan();
- left: asin();
- left: acos();
- left: atan();
- left: atan2();
-}
-
-[data-view-size=m] .view {
- background: red;
- }
-
-.nested-calc {
- order: calc(1 * (8 / 3 + (5 * 10)));
- order: calc(1 * calc(8 / 3 + calc(5 * 10)));
-}
-
-.text-decoration-shorthand {
- text-decoration: overline;
- -webkit-text-decoration: overline wavy pink;
- text-decoration: overline wavy pink;
- text-decoration-thickness: 3px;
- -webkit-text-decoration: 3px wavy pink overline;
- text-decoration: 3px wavy pink overline;
-}
-
-.stage__container {
- left: var(--size, 1rem);
-}
-
-:scope {
- content: "plain :scope";
-}
-
-@scope (.foo) {
- :scope {
- content: ":scope in @scope";
- }
-}
-
-:scope {
- @scope (.foo) {
- content: ":scope in @scope, but with nesting";
- }
-}
-
-@media (min-aspect-ratio: 177/100) {
- /* media query aspect ratio : */
-}
-
-.color-mix {
- color-1: rgba(0, 0, 255, 0.65);
- color-2: rgba(0, 0, 255, 0.65);
- color-3: rgba(0, 0, 255, 0.65);
- color-4: rgba(121, 0, 181, 0.65);
- color-5: rgba(148, 0, 122, 0.65);
- color-6: rgba(179, 0, 255, 0.65);
-}
-
-@media (color-gamut: p3) {
-.color-mix {
- color-4: color(display-p3 0.44 0 0.70096 / 0.65);
- color-5: color(display-p3 0.54692 0 0.47541 / 0.65);
-}
-}
-
-.gradients-interpolation-method {
- --background-image: linear-gradient(rgb(245, 137, 137) 0%, rgb(245, 140, 170), rgb(238, 146, 202), rgb(227, 155, 230), rgb(210, 166, 253), rgb(188, 179, 255), rgb(164, 192, 255), rgb(137, 206, 255), rgb(111, 218, 255), rgb(93, 229, 255), rgb(94, 237, 237) 100%);
-
- background-image: radial-gradient(farthest-corner circle at 50% 115%, rgb(255, 71, 0) 0%, rgb(255, 103, 0), rgb(255, 137, 0), rgb(255, 169, 0), rgb(250, 199, 0), rgb(197, 225, 0), rgb(116, 246, 0), rgb(0, 255, 86), rgb(0, 255, 171), rgb(0, 255, 239), rgb(0, 255, 255) 100%);
-}
-
-@media (color-gamut: rec2020) {
-.gradients-interpolation-method {
-
- background-image: radial-gradient(farthest-corner circle at 50% 115%, color(display-p3 1.2198 0.38716 0.16814) 0%, color(display-p3 1.20289 0.47522 -0.3004), color(display-p3 1.15167 0.57912 -0.3946), color(display-p3 1.06645 0.68611 -0.4296), color(display-p3 0.94738 0.78766 -0.4263), color(display-p3 0.79233 0.87807 -0.3707), color(display-p3 0.59026 0.95319 -0.1467), color(display-p3 0.27082 1.00972 0.43521), color(display-p3 -0.3983 1.04501 0.69996), color(display-p3 -0.5392 1.05733 0.93686), color(display-p3 -0.5777 1.04644 1.15396) 100%);
-
- background-image: radial-gradient(farthest-corner circle at 50% 115% in oklch, oklch(80% .3 34) 0%, oklch(90% .3 200) 100%);
-}
-}
-
-@supports (color: color(display-p3 0 0 0%)) {
-.gradients-interpolation-method {
- --background-image: linear-gradient(rgb(245, 137, 137) 0%, rgb(245, 140, 170), rgb(238, 146, 202), rgb(227, 155, 230), rgb(210, 166, 253), rgb(189, 182, 255), rgb(173, 195, 255), rgb(159, 205, 255), rgb(140, 215, 255), rgb(100, 228, 255), rgb(94, 237, 237) 100%);
-}
-
-@media (color-gamut: rec2020) {
-.gradients-interpolation-method {
- --background-image: linear-gradient(rgb(245, 137, 137) 0%, rgb(245, 140, 170), rgb(238, 146, 202), rgb(227, 155, 230), rgb(210, 166, 253), color(display-p3 0.73255 0.7035 1.03328), color(display-p3 0.66377 0.75145 1.06652), color(display-p3 0.59643 0.80011 1.0696), color(display-p3 0.54198 0.8462 1.04382), color(display-p3 0.51578 0.88643 0.99318), rgb(94, 237, 237) 100%);
-}
-}
-}
-
-@supports (background: linear-gradient(in oklch, red 0%, red 0% 1%, red 2%)) and (color: hsl(0 0% 0% / 0)) {
-.gradients-interpolation-method {
- --background-image: linear-gradient(in oklch decreasing hue, hsl(0deg 85% 75%) 0%, hsl(180deg 80% 65%) 100%);
-}
-}
-
-.test-css-color-5-interop {
- color-1: rgb(196, 129, 72);
- color-2: color(from rgb(196, 129, 72) a98-rgb r g b / none);
- color-3: rgb(234, 133, 82);
- color-4: color(from rgb(234, 133, 82) prophoto-rgb r g none);
- color-5: rgb(179, 157, 51);
- color-6: rgb(179, 35, 35);
- color-7: rgb(163, 57, 39);
- color-8: rgb(131, 27, 0);
- color-9: rgb(126, 37, 0);
-}
-
-@media (color-gamut: p3) {
-.test-css-color-5-interop {
- color-8: color(display-p3 0.4939 0.10676 0);
- color-9: color(display-p3 0.47553 0.14324 0);
-}
-}
-
-.test-property-with-var {
- --opacity: 1;
- color: rgba(87, 107, 149, var(--opacity));
-}
-
-.exponential-functions {
- width: 8px;
-}
-
-.out-of-gamut {
- --color: rgb(0, 247, 79);
-}
-
-.issue-1244--a {
- background-image: -ms-linear-gradient(180deg, red 0%, blue 100%);
-}
-
-.issue-1244--b {
- background-image: linear-gradient(180deg, red 0%, blue 100%);
-}
-
-.issue-1244--c {
- background-image: linear-gradient(180deg, red 0%, blue 100%);
-}
-
-.dark {
- --csstools-color-scheme--dark: initial;
- color-scheme: dark;
-}
-
-.light {
- --csstools-color-scheme--dark: ;
- color-scheme: light;
-}
-
-.schemed-colors {
- --csstools-light-dark-toggle--1: var(--csstools-color-scheme--dark) rgb(131, 27, 0);
- color: var(--csstools-light-dark-toggle--1, magenta);
- color: light-dark(rgb(131, 27, 0), magenta);
-}
-
-@media (color-gamut: p3) {
-.schemed-colors {
- color: light-dark(color(display-p3 0.4939 0.10676 0), magenta);
-}
-}
-
-.schemed-prop {
- --csstools-light-dark-toggle--0: var(--csstools-color-scheme--dark) cyan;
- --theme-color: var(--csstools-light-dark-toggle--0, deepskyblue);
-}
-
-@supports (color: light-dark(red, red)) {
-.schemed-prop {
- --theme-color: light-dark(cyan, deepskyblue);
-}
-}
-
-.schemed-prop * {
- --csstools-light-dark-toggle--0: var(--csstools-color-scheme--dark) cyan;
- --theme-color: var(--csstools-light-dark-toggle--0, deepskyblue);
-}
-
-.content-alt-text {
- content: url(tree.jpg) "A beautiful tree in a dark forest";
- content: url(tree.jpg) / "A beautiful tree in a dark forest";
-}
-
-.content-alt-text {
- content: var(--foo) "A beautiful tree in a dark forest";
-}
-
-@supports (content: "a" / "a") {
-.content-alt-text {
- content: var(--foo) / "A beautiful tree in a dark forest";
-}
-}
diff --git a/plugin-packs/postcss-preset-env/test/basic.ch88-ff78.expect.css b/plugin-packs/postcss-preset-env/test/basic.ch88-ff78.expect.css
deleted file mode 100644
index a552e0714..000000000
--- a/plugin-packs/postcss-preset-env/test/basic.ch88-ff78.expect.css
+++ /dev/null
@@ -1,618 +0,0 @@
-:root {
- --order: 1;
-}
-
-.test-custom-property-fallbacks {
- --firebrick: rgb(179, 35, 35);
-}
-
-.test-custom-properties {
- order: var(--order);
-}
-
-.test-image-set-function {
- background-image: url(img/test.png);
- background-image: -webkit-image-set(url(img/test.png) 1x, url(img/test-2x.png) 2x);
- background-image: image-set(url(img/test.png) 1x, url(img/test-2x.png) 2x);
- order: 2;
-}
-
-@media (min-resolution: 192dpi) {
-
-.test-image-set-function {
- background-image: url(img/test-2x.png);
-}
-}
-
-.test-logical-properties-and-values {
- margin-left: 1px;
- margin-right: 2px;
- order: 3;
- padding-top: 4px;
- padding-bottom: 4px;
-}
-
-.test-logical-resize {
- resize: horizontal;
-}
-
-.test-logical-viewport-units {
- width: calc(10vw + 5px);
- width: calc(10vi + 5px);
-}
-
-.test-nesting-rules {
- order: 4;
-
- order: 6;
-}
-
-.test-nesting-rules p {
- order: 5;
- }
-
-.test-nesting-rules,
-#test-is-pseudo {
- order: 7;
-
- order: 9;
-}
-
-.test-nesting-rules + p, #test-is-pseudo + p {
- order: 8;
- }
-
-@media (max-width: 30em) {
- .test-custom-media-queries {
- order: 10;
- }
-}
-
-@media (min-width: 480px) and (max-width: 767.98px) {
- .test-media-query-ranges {
- order: 11;
- }
-}
-
-@media (prefers-color-scheme: dark) {
- body {
- background-color: black;
- color: white;
- }
-}
-
-h1.test-custom-selectors:not(.does-not-exist), h2.test-custom-selectors:not(.does-not-exist), h3.test-custom-selectors:not(.does-not-exist), h4.test-custom-selectors:not(.does-not-exist), h5.test-custom-selectors:not(.does-not-exist), h6.test-custom-selectors:not(.does-not-exist), .test-custom-selectors.heading-7 {
- order:12;
-}
-
-.test-case-insensitive-attributes[frame=hsides i] {
- order: 13;
-}
-
-.test-rebeccapurple-color {
- color: rebeccapurple;
- order: 14;
-}
-
-.test-hexadecimal-alpha-notation {
- background-color: #f3f3f3f3;
- color: #0003;
- order: 15;
-}
-
-.test-color-functional-notation {
- color: rgb(70% 13.5% 13.5% / 50%);
- order: 16;
-}
-
-.test-lab-function {
- background-color: rgb(179, 35, 35);
- color: rgba(179, 34, 35, 0.5);
- order: 17;
-}
-
-.test-system-ui-font-family {
- font-family: system-ui, -apple-system, Segoe UI, Roboto, Ubuntu, Cantarell, Noto Sans, sans-serif;
- order: 18;
-}
-
-.test-font-variant-property {
- font-feature-settings: "smcp";
- font-variant-caps: small-caps;
- order: 19;
-}
-
-.test-all-property {
- all: initial;
- order: 20;
-}
-
-.test-matches-pseudo-class:matches(:first-child, .special) {
- order: 21;
-}
-
-.test-not-pseudo-class:not(:first-child):not(.special) {
- order: 22;
-}
-
-.test-any-link-pseudo-class:any-link {
- order: 23;
-}
-
-[dir="rtl"] .test-dir-pseudo-class {
- order: 24;
-}
-
-.test-overflow-wrap-property {
- order: 25;
- overflow-wrap: break-word;
-}
-
-.test-focus-visible-pseudo-class:focus-visible {
- order: 26;
-}
-
-.test-double-position-gradients {
- background-image: conic-gradient(yellowgreen 40%, gold 0deg,gold 75%, #f06 0deg);
- background-image: conic-gradient(yellowgreen 40%, gold 0deg 75%, #f06 0deg);
-}
-
-.test-blank-pseudo-class:blank {
- background-color: yellow;
-}
-
-.test-has-pseudo-class:has(.inner-class) {
- background-color: yellow;
-}
-
-.a:focus, .a:hover, .b:focus, .b:hover {
- order: 27;
-}
-
-.a.c > .b + .d {
- order: 28;
-}
-
-.test-hwb-function {
- background-color: rgba(0, 196, 255, 0.5);
-}
-
-.test-opacity-percent {
- opacity: 42%;
-}
-
-.clamp-same-unit {
- width: clamp(10px, 64px, 80px);
-}
-
-.complex-clamp {
- width: clamp(calc(100% - 10px), min(10px, 100%), max(40px, 4em));
-}
-
-.clamp-different-units {
- width: clamp(10%, 2px, 4rem);
-}
-
-.mixed-clamp {
- grid-template-columns: clamp(22rem, 40%, 32rem) minmax(0, 1fr);
- margin: clamp(1rem, 2%, 3rem) 4vh;
-}
-
-.calc-clamp {
- margin: 0 40px 0 calc(-1 * clamp(32px, 16vw, 64px));
-}
-
-.multiple-calc-clamp {
- margin: calc(-1 * clamp(1px, 2vw, 3px)) calc(-1 * clamp(4px, 5vw, 6px));
-}
-
-.nested-clamp {
- font-size: clamp(clamp(1rem, 2vw, 3rem), 4vw, 5rem);
-}
-
-@font-face {
- font-family: 'A';
- font-style: normal;
- font-weight: 300;
- font-display: swap;
- src: url(a) format("woff2");
-}
-
-.block-flow {
- display: block;
- display: block flow;
-}
-
-.block-flow-root {
- display: flow-root;
- display: block flow-root;
-}
-
-.inline-flow {
- display: inline;
- display: inline flow;
-}
-
-.inline-flow-root {
- display: inline-block;
- display: inline flow-root;
-}
-
-.run-in-flow {
- display: run-in;
- display: run-in flow;
-}
-
-.list-item-block-flow {
- display: list-item;
- display: list-item block flow;
-}
-
-.inline-flow-list-item {
- display: inline list-item;
- display: inline flow list-item;
-}
-
-.block-flex {
- display: flex;
- display: block flex;
-}
-
-.inline-flex {
- display: inline-flex;
- display: inline flex;
-}
-
-.block-grid {
- display: grid;
- display: block grid;
-}
-
-.inline-grid {
- display: inline-grid;
- display: inline grid;
-}
-
-.inline-ruby {
- display: ruby;
- display: inline ruby;
-}
-
-.block-table {
- display: table;
- display: block table;
-}
-
-.inline-table {
- display: inline-table;
- display: inline table;
-}
-
-.table-cell-flow {
- display: table-cell;
- display: table-cell flow;
-}
-
-.table-caption-flow {
- display: table-caption;
- display: table-caption flow;
-}
-
-.ruby-base-flow {
- display: ruby-base;
- display: ruby-base flow;
-}
-
-.ruby-text-flow {
- display: ruby-text;
- display: ruby-text flow;
-}
-
-.logical-float {
- float: left;
-}
-
-.color-function {
- prop-1: rgb(0, 129, 96);
- prop-2: 'color(display-p3 0.02472 0.01150 0.00574 / 1)';
- prop-3: rgb(7, 3, 1);
- prop-4: rgb(7, 3, 1);
- prop-5: color(display-p3 1 1 1 1);
-}
-
-.oklab {
- color-1: rgb(73, 71, 69);
- color-2: rgb(121, 34, 67);
- color-3: rgba(121, 34, 67, 0.5);
- color-4: rgb(121, 34, 67);
- color-5: rgba(121, 34, 67, 0.5);
- color-6: rgb(177, 102, 126);
- color-7: oklab(60% 0.1 0 foo);
- color-8: rgb(125, 35, 41);
- color-9: rgb(198, 93, 7);
- color-10: rgb(157, 147, 24);
- color-11: rgb(104, 166, 57);
- color-12: rgb(98, 172, 239);
-}
-
-.oklch {
- color-1: rgb(126, 37, 15);
- color-2: rgb(126, 37, 15);
- color-3: rgba(126, 37, 15, 0.5);
- color-4: rgb(126, 37, 15);
- color-5: rgba(126, 37, 15, 0.5);
- color-6: rgb(197, 84, 124);
-
- color-7: rgb(0, 149, 131);
- color-8: rgb(0, 149, 131);
- color-9: rgb(0, 149, 131);
- color-10: rgb(0, 149, 131);
- color-11: rgb(0, 149, 131);
-
- color-12: rgb(188, 101, 59);
- color-13: rgb(188, 101, 59);
- color-14: rgb(188, 101, 59);
- color-15: rgb(188, 101, 59);
- color-16: rgb(188, 101, 59);
- color-17: oklch(60% 0.1250 0.785398unknown);
-}
-
-@media (color-gamut: p3) {
-.oklch {
-
- color-7: color(display-p3 0.19244 0.58461 0.51559);
- color-8: color(display-p3 0.19244 0.58461 0.51559);
- color-9: color(display-p3 0.19244 0.58461 0.51559);
- color-10: color(display-p3 0.19244 0.58461 0.51559);
- color-11: color(display-p3 0.19244 0.58461 0.51559);
-}
-}
-
-.ic-unit {
- --value-2ic: initial;
- text-indent: 2em;
- content: var(--value-2ic);
- left: var(--non-existing, 2em);
- width: calc(8em + 20px);
- height: 10px;
- margin: 0.5em 1em .2em;
- padding: 2 ic;
-}
-
-.unset {
- clip: unset;
-}
-
-.mod {
- padding: 8px 3px 1px calc(3px + 50%);
- transform: rotate(-50deg);
- width: 2px;
-}
-
-.rem {
- padding: 8px 3px 1px calc(3px + 50%);
- transform: rotate(-50deg);
-}
-
-.round {
- top: 3px;
- right: 3px;
- bottom: 3px;
- left: 2px;
- padding-left: 2px;
-}
-
-.trigonometric {
- left: 0.70711;
- left: 0.70711;
- left: 1;
- left: 30deg;
- left: 60deg;
- left: 84.28941deg;
- left: -45deg;
- left: 90deg;
- left: 135deg;
- left: 0.99863;
-}
-
-.trigonometric-ignore-not-a-function {
- left: sin;
- left: cos;
- left: tan;
- left: asin;
- left: acos;
- left: atan;
- left: atan2;
-}
-
-.trigonometric-ignore-no-arguments {
- left: sin();
- left: cos();
- left: tan();
- left: asin();
- left: acos();
- left: atan();
- left: atan2();
-}
-
-[data-view-size=m] .view {
- background: red;
- }
-
-.nested-calc {
- order: calc(1 * calc(8 / 3 + calc(5 * 10)));
-}
-
-.text-decoration-shorthand {
- text-decoration: 3px wavy pink overline;
-}
-
-.stage__container {
- left: var(--size, 1rem);
-}
-
-:scope {
- content: "plain :scope";
-}
-
-@scope (.foo) {
- :scope {
- content: ":scope in @scope";
- }
-}
-
-:scope {
- @scope (.foo) {
- content: ":scope in @scope, but with nesting";
- }
-}
-
-@media (min-aspect-ratio: 177/100) {
- /* media query aspect ratio : */
-}
-
-.color-mix {
- color-1: rgba(0, 0, 255, 0.65);
- color-2: rgba(0, 0, 255, 0.65);
- color-3: rgba(0, 0, 255, 0.65);
- color-4: rgba(121, 0, 181, 0.65);
- color-5: rgba(148, 0, 122, 0.65);
- color-6: rgba(179, 0, 255, 0.65);
-}
-
-@media (color-gamut: p3) {
-.color-mix {
- color-4: color(display-p3 0.44 0 0.70096 / 0.65);
- color-5: color(display-p3 0.54692 0 0.47541 / 0.65);
-}
-}
-
-.gradients-interpolation-method {
- --background-image: linear-gradient(rgb(245, 137, 137) 0%, rgb(245, 140, 170), rgb(238, 146, 202), rgb(227, 155, 230), rgb(210, 166, 253), rgb(188, 179, 255), rgb(164, 192, 255), rgb(137, 206, 255), rgb(111, 218, 255), rgb(93, 229, 255), rgb(94, 237, 237) 100%);
-
- background-image: radial-gradient(farthest-corner circle at 50% 115%, rgb(255, 71, 0) 0%, rgb(255, 103, 0), rgb(255, 137, 0), rgb(255, 169, 0), rgb(250, 199, 0), rgb(197, 225, 0), rgb(116, 246, 0), rgb(0, 255, 86), rgb(0, 255, 171), rgb(0, 255, 239), rgb(0, 255, 255) 100%);
-}
-
-@media (color-gamut: rec2020) {
-.gradients-interpolation-method {
-
- background-image: radial-gradient(farthest-corner circle at 50% 115%, color(display-p3 1.2198 0.38716 0.16814) 0%, color(display-p3 1.20289 0.47522 -0.3004), color(display-p3 1.15167 0.57912 -0.3946), color(display-p3 1.06645 0.68611 -0.4296), color(display-p3 0.94738 0.78766 -0.4263), color(display-p3 0.79233 0.87807 -0.3707), color(display-p3 0.59026 0.95319 -0.1467), color(display-p3 0.27082 1.00972 0.43521), color(display-p3 -0.3983 1.04501 0.69996), color(display-p3 -0.5392 1.05733 0.93686), color(display-p3 -0.5777 1.04644 1.15396) 100%);
-
- background-image: radial-gradient(farthest-corner circle at 50% 115% in oklch, oklch(80% .3 34) 0%, oklch(90% .3 200) 100%);
-}
-}
-
-@supports (color: color(display-p3 0 0 0%)) {
-.gradients-interpolation-method {
- --background-image: linear-gradient(rgb(245, 137, 137) 0%, rgb(245, 140, 170), rgb(238, 146, 202), rgb(227, 155, 230), rgb(210, 166, 253), rgb(189, 182, 255), rgb(173, 195, 255), rgb(159, 205, 255), rgb(140, 215, 255), rgb(100, 228, 255), rgb(94, 237, 237) 100%);
-}
-
-@media (color-gamut: rec2020) {
-.gradients-interpolation-method {
- --background-image: linear-gradient(rgb(245, 137, 137) 0%, rgb(245, 140, 170), rgb(238, 146, 202), rgb(227, 155, 230), rgb(210, 166, 253), color(display-p3 0.73255 0.7035 1.03328), color(display-p3 0.66377 0.75145 1.06652), color(display-p3 0.59643 0.80011 1.0696), color(display-p3 0.54198 0.8462 1.04382), color(display-p3 0.51578 0.88643 0.99318), rgb(94, 237, 237) 100%);
-}
-}
-}
-
-@supports (background: linear-gradient(in oklch, red 0%, red 0% 1%, red 2%)) and (color: hsl(0 0% 0% / 0)) {
-.gradients-interpolation-method {
- --background-image: linear-gradient(in oklch decreasing hue, hsl(0deg 85% 75%) 0%, hsl(180deg 80% 65%) 100%);
-}
-}
-
-.test-css-color-5-interop {
- color-1: rgb(196, 129, 72);
- color-2: color(from rgb(196, 129, 72) a98-rgb r g b / none);
- color-3: rgb(234, 133, 82);
- color-4: color(from rgb(234, 133, 82) prophoto-rgb r g none);
- color-5: rgb(179, 157, 51);
- color-6: rgb(179, 35, 35);
- color-7: rgb(163, 57, 39);
- color-8: rgb(131, 27, 0);
- color-9: rgb(126, 37, 0);
-}
-
-@media (color-gamut: p3) {
-.test-css-color-5-interop {
- color-8: color(display-p3 0.4939 0.10676 0);
- color-9: color(display-p3 0.47553 0.14324 0);
-}
-}
-
-.test-property-with-var {
- --opacity: 1;
- color: rgba(87 107 149 / var(--opacity));
-}
-
-.exponential-functions {
- width: 8px;
-}
-
-.out-of-gamut {
- --color: rgb(0, 247, 79);
-}
-
-.issue-1244--a {
- background-image: -ms-linear-gradient(180deg, red 0%, blue 100%);
-}
-
-.issue-1244--b {
- background-image: linear-gradient(180deg, red 0%, blue 100%);
-}
-
-.issue-1244--c {
- background-image: linear-gradient(180deg, red 0%, blue 100%);
-}
-
-.dark {
- --csstools-color-scheme--dark: initial;
- color-scheme: dark;
-}
-
-.light {
- --csstools-color-scheme--dark: ;
- color-scheme: light;
-}
-
-.schemed-colors {
- --csstools-light-dark-toggle--1: var(--csstools-color-scheme--dark) rgb(131, 27, 0);
- color: var(--csstools-light-dark-toggle--1, magenta);
- color: light-dark(rgb(131, 27, 0), magenta);
-}
-
-@media (color-gamut: p3) {
-.schemed-colors {
- color: light-dark(color(display-p3 0.4939 0.10676 0), magenta);
-}
-}
-
-.schemed-prop {
- --csstools-light-dark-toggle--0: var(--csstools-color-scheme--dark) cyan;
- --theme-color: var(--csstools-light-dark-toggle--0, deepskyblue);
-}
-
-@supports (color: light-dark(red, red)) {
-.schemed-prop {
- --theme-color: light-dark(cyan, deepskyblue);
-}
-}
-
-.schemed-prop * {
- --csstools-light-dark-toggle--0: var(--csstools-color-scheme--dark) cyan;
- --theme-color: var(--csstools-light-dark-toggle--0, deepskyblue);
-}
-
-.content-alt-text {
- content: url(tree.jpg) "A beautiful tree in a dark forest";
- content: url(tree.jpg) / "A beautiful tree in a dark forest";
-}
-
-.content-alt-text {
- content: var(--foo) "A beautiful tree in a dark forest";
-}
-
-@supports (content: "a" / "a") {
-.content-alt-text {
- content: var(--foo) / "A beautiful tree in a dark forest";
-}
-}
diff --git a/plugin-packs/postcss-preset-env/test/basic.ch88-ff78.no-is-pseudo.expect.css b/plugin-packs/postcss-preset-env/test/basic.ch88-ff78.no-is-pseudo.expect.css
deleted file mode 100644
index a552e0714..000000000
--- a/plugin-packs/postcss-preset-env/test/basic.ch88-ff78.no-is-pseudo.expect.css
+++ /dev/null
@@ -1,618 +0,0 @@
-:root {
- --order: 1;
-}
-
-.test-custom-property-fallbacks {
- --firebrick: rgb(179, 35, 35);
-}
-
-.test-custom-properties {
- order: var(--order);
-}
-
-.test-image-set-function {
- background-image: url(img/test.png);
- background-image: -webkit-image-set(url(img/test.png) 1x, url(img/test-2x.png) 2x);
- background-image: image-set(url(img/test.png) 1x, url(img/test-2x.png) 2x);
- order: 2;
-}
-
-@media (min-resolution: 192dpi) {
-
-.test-image-set-function {
- background-image: url(img/test-2x.png);
-}
-}
-
-.test-logical-properties-and-values {
- margin-left: 1px;
- margin-right: 2px;
- order: 3;
- padding-top: 4px;
- padding-bottom: 4px;
-}
-
-.test-logical-resize {
- resize: horizontal;
-}
-
-.test-logical-viewport-units {
- width: calc(10vw + 5px);
- width: calc(10vi + 5px);
-}
-
-.test-nesting-rules {
- order: 4;
-
- order: 6;
-}
-
-.test-nesting-rules p {
- order: 5;
- }
-
-.test-nesting-rules,
-#test-is-pseudo {
- order: 7;
-
- order: 9;
-}
-
-.test-nesting-rules + p, #test-is-pseudo + p {
- order: 8;
- }
-
-@media (max-width: 30em) {
- .test-custom-media-queries {
- order: 10;
- }
-}
-
-@media (min-width: 480px) and (max-width: 767.98px) {
- .test-media-query-ranges {
- order: 11;
- }
-}
-
-@media (prefers-color-scheme: dark) {
- body {
- background-color: black;
- color: white;
- }
-}
-
-h1.test-custom-selectors:not(.does-not-exist), h2.test-custom-selectors:not(.does-not-exist), h3.test-custom-selectors:not(.does-not-exist), h4.test-custom-selectors:not(.does-not-exist), h5.test-custom-selectors:not(.does-not-exist), h6.test-custom-selectors:not(.does-not-exist), .test-custom-selectors.heading-7 {
- order:12;
-}
-
-.test-case-insensitive-attributes[frame=hsides i] {
- order: 13;
-}
-
-.test-rebeccapurple-color {
- color: rebeccapurple;
- order: 14;
-}
-
-.test-hexadecimal-alpha-notation {
- background-color: #f3f3f3f3;
- color: #0003;
- order: 15;
-}
-
-.test-color-functional-notation {
- color: rgb(70% 13.5% 13.5% / 50%);
- order: 16;
-}
-
-.test-lab-function {
- background-color: rgb(179, 35, 35);
- color: rgba(179, 34, 35, 0.5);
- order: 17;
-}
-
-.test-system-ui-font-family {
- font-family: system-ui, -apple-system, Segoe UI, Roboto, Ubuntu, Cantarell, Noto Sans, sans-serif;
- order: 18;
-}
-
-.test-font-variant-property {
- font-feature-settings: "smcp";
- font-variant-caps: small-caps;
- order: 19;
-}
-
-.test-all-property {
- all: initial;
- order: 20;
-}
-
-.test-matches-pseudo-class:matches(:first-child, .special) {
- order: 21;
-}
-
-.test-not-pseudo-class:not(:first-child):not(.special) {
- order: 22;
-}
-
-.test-any-link-pseudo-class:any-link {
- order: 23;
-}
-
-[dir="rtl"] .test-dir-pseudo-class {
- order: 24;
-}
-
-.test-overflow-wrap-property {
- order: 25;
- overflow-wrap: break-word;
-}
-
-.test-focus-visible-pseudo-class:focus-visible {
- order: 26;
-}
-
-.test-double-position-gradients {
- background-image: conic-gradient(yellowgreen 40%, gold 0deg,gold 75%, #f06 0deg);
- background-image: conic-gradient(yellowgreen 40%, gold 0deg 75%, #f06 0deg);
-}
-
-.test-blank-pseudo-class:blank {
- background-color: yellow;
-}
-
-.test-has-pseudo-class:has(.inner-class) {
- background-color: yellow;
-}
-
-.a:focus, .a:hover, .b:focus, .b:hover {
- order: 27;
-}
-
-.a.c > .b + .d {
- order: 28;
-}
-
-.test-hwb-function {
- background-color: rgba(0, 196, 255, 0.5);
-}
-
-.test-opacity-percent {
- opacity: 42%;
-}
-
-.clamp-same-unit {
- width: clamp(10px, 64px, 80px);
-}
-
-.complex-clamp {
- width: clamp(calc(100% - 10px), min(10px, 100%), max(40px, 4em));
-}
-
-.clamp-different-units {
- width: clamp(10%, 2px, 4rem);
-}
-
-.mixed-clamp {
- grid-template-columns: clamp(22rem, 40%, 32rem) minmax(0, 1fr);
- margin: clamp(1rem, 2%, 3rem) 4vh;
-}
-
-.calc-clamp {
- margin: 0 40px 0 calc(-1 * clamp(32px, 16vw, 64px));
-}
-
-.multiple-calc-clamp {
- margin: calc(-1 * clamp(1px, 2vw, 3px)) calc(-1 * clamp(4px, 5vw, 6px));
-}
-
-.nested-clamp {
- font-size: clamp(clamp(1rem, 2vw, 3rem), 4vw, 5rem);
-}
-
-@font-face {
- font-family: 'A';
- font-style: normal;
- font-weight: 300;
- font-display: swap;
- src: url(a) format("woff2");
-}
-
-.block-flow {
- display: block;
- display: block flow;
-}
-
-.block-flow-root {
- display: flow-root;
- display: block flow-root;
-}
-
-.inline-flow {
- display: inline;
- display: inline flow;
-}
-
-.inline-flow-root {
- display: inline-block;
- display: inline flow-root;
-}
-
-.run-in-flow {
- display: run-in;
- display: run-in flow;
-}
-
-.list-item-block-flow {
- display: list-item;
- display: list-item block flow;
-}
-
-.inline-flow-list-item {
- display: inline list-item;
- display: inline flow list-item;
-}
-
-.block-flex {
- display: flex;
- display: block flex;
-}
-
-.inline-flex {
- display: inline-flex;
- display: inline flex;
-}
-
-.block-grid {
- display: grid;
- display: block grid;
-}
-
-.inline-grid {
- display: inline-grid;
- display: inline grid;
-}
-
-.inline-ruby {
- display: ruby;
- display: inline ruby;
-}
-
-.block-table {
- display: table;
- display: block table;
-}
-
-.inline-table {
- display: inline-table;
- display: inline table;
-}
-
-.table-cell-flow {
- display: table-cell;
- display: table-cell flow;
-}
-
-.table-caption-flow {
- display: table-caption;
- display: table-caption flow;
-}
-
-.ruby-base-flow {
- display: ruby-base;
- display: ruby-base flow;
-}
-
-.ruby-text-flow {
- display: ruby-text;
- display: ruby-text flow;
-}
-
-.logical-float {
- float: left;
-}
-
-.color-function {
- prop-1: rgb(0, 129, 96);
- prop-2: 'color(display-p3 0.02472 0.01150 0.00574 / 1)';
- prop-3: rgb(7, 3, 1);
- prop-4: rgb(7, 3, 1);
- prop-5: color(display-p3 1 1 1 1);
-}
-
-.oklab {
- color-1: rgb(73, 71, 69);
- color-2: rgb(121, 34, 67);
- color-3: rgba(121, 34, 67, 0.5);
- color-4: rgb(121, 34, 67);
- color-5: rgba(121, 34, 67, 0.5);
- color-6: rgb(177, 102, 126);
- color-7: oklab(60% 0.1 0 foo);
- color-8: rgb(125, 35, 41);
- color-9: rgb(198, 93, 7);
- color-10: rgb(157, 147, 24);
- color-11: rgb(104, 166, 57);
- color-12: rgb(98, 172, 239);
-}
-
-.oklch {
- color-1: rgb(126, 37, 15);
- color-2: rgb(126, 37, 15);
- color-3: rgba(126, 37, 15, 0.5);
- color-4: rgb(126, 37, 15);
- color-5: rgba(126, 37, 15, 0.5);
- color-6: rgb(197, 84, 124);
-
- color-7: rgb(0, 149, 131);
- color-8: rgb(0, 149, 131);
- color-9: rgb(0, 149, 131);
- color-10: rgb(0, 149, 131);
- color-11: rgb(0, 149, 131);
-
- color-12: rgb(188, 101, 59);
- color-13: rgb(188, 101, 59);
- color-14: rgb(188, 101, 59);
- color-15: rgb(188, 101, 59);
- color-16: rgb(188, 101, 59);
- color-17: oklch(60% 0.1250 0.785398unknown);
-}
-
-@media (color-gamut: p3) {
-.oklch {
-
- color-7: color(display-p3 0.19244 0.58461 0.51559);
- color-8: color(display-p3 0.19244 0.58461 0.51559);
- color-9: color(display-p3 0.19244 0.58461 0.51559);
- color-10: color(display-p3 0.19244 0.58461 0.51559);
- color-11: color(display-p3 0.19244 0.58461 0.51559);
-}
-}
-
-.ic-unit {
- --value-2ic: initial;
- text-indent: 2em;
- content: var(--value-2ic);
- left: var(--non-existing, 2em);
- width: calc(8em + 20px);
- height: 10px;
- margin: 0.5em 1em .2em;
- padding: 2 ic;
-}
-
-.unset {
- clip: unset;
-}
-
-.mod {
- padding: 8px 3px 1px calc(3px + 50%);
- transform: rotate(-50deg);
- width: 2px;
-}
-
-.rem {
- padding: 8px 3px 1px calc(3px + 50%);
- transform: rotate(-50deg);
-}
-
-.round {
- top: 3px;
- right: 3px;
- bottom: 3px;
- left: 2px;
- padding-left: 2px;
-}
-
-.trigonometric {
- left: 0.70711;
- left: 0.70711;
- left: 1;
- left: 30deg;
- left: 60deg;
- left: 84.28941deg;
- left: -45deg;
- left: 90deg;
- left: 135deg;
- left: 0.99863;
-}
-
-.trigonometric-ignore-not-a-function {
- left: sin;
- left: cos;
- left: tan;
- left: asin;
- left: acos;
- left: atan;
- left: atan2;
-}
-
-.trigonometric-ignore-no-arguments {
- left: sin();
- left: cos();
- left: tan();
- left: asin();
- left: acos();
- left: atan();
- left: atan2();
-}
-
-[data-view-size=m] .view {
- background: red;
- }
-
-.nested-calc {
- order: calc(1 * calc(8 / 3 + calc(5 * 10)));
-}
-
-.text-decoration-shorthand {
- text-decoration: 3px wavy pink overline;
-}
-
-.stage__container {
- left: var(--size, 1rem);
-}
-
-:scope {
- content: "plain :scope";
-}
-
-@scope (.foo) {
- :scope {
- content: ":scope in @scope";
- }
-}
-
-:scope {
- @scope (.foo) {
- content: ":scope in @scope, but with nesting";
- }
-}
-
-@media (min-aspect-ratio: 177/100) {
- /* media query aspect ratio : */
-}
-
-.color-mix {
- color-1: rgba(0, 0, 255, 0.65);
- color-2: rgba(0, 0, 255, 0.65);
- color-3: rgba(0, 0, 255, 0.65);
- color-4: rgba(121, 0, 181, 0.65);
- color-5: rgba(148, 0, 122, 0.65);
- color-6: rgba(179, 0, 255, 0.65);
-}
-
-@media (color-gamut: p3) {
-.color-mix {
- color-4: color(display-p3 0.44 0 0.70096 / 0.65);
- color-5: color(display-p3 0.54692 0 0.47541 / 0.65);
-}
-}
-
-.gradients-interpolation-method {
- --background-image: linear-gradient(rgb(245, 137, 137) 0%, rgb(245, 140, 170), rgb(238, 146, 202), rgb(227, 155, 230), rgb(210, 166, 253), rgb(188, 179, 255), rgb(164, 192, 255), rgb(137, 206, 255), rgb(111, 218, 255), rgb(93, 229, 255), rgb(94, 237, 237) 100%);
-
- background-image: radial-gradient(farthest-corner circle at 50% 115%, rgb(255, 71, 0) 0%, rgb(255, 103, 0), rgb(255, 137, 0), rgb(255, 169, 0), rgb(250, 199, 0), rgb(197, 225, 0), rgb(116, 246, 0), rgb(0, 255, 86), rgb(0, 255, 171), rgb(0, 255, 239), rgb(0, 255, 255) 100%);
-}
-
-@media (color-gamut: rec2020) {
-.gradients-interpolation-method {
-
- background-image: radial-gradient(farthest-corner circle at 50% 115%, color(display-p3 1.2198 0.38716 0.16814) 0%, color(display-p3 1.20289 0.47522 -0.3004), color(display-p3 1.15167 0.57912 -0.3946), color(display-p3 1.06645 0.68611 -0.4296), color(display-p3 0.94738 0.78766 -0.4263), color(display-p3 0.79233 0.87807 -0.3707), color(display-p3 0.59026 0.95319 -0.1467), color(display-p3 0.27082 1.00972 0.43521), color(display-p3 -0.3983 1.04501 0.69996), color(display-p3 -0.5392 1.05733 0.93686), color(display-p3 -0.5777 1.04644 1.15396) 100%);
-
- background-image: radial-gradient(farthest-corner circle at 50% 115% in oklch, oklch(80% .3 34) 0%, oklch(90% .3 200) 100%);
-}
-}
-
-@supports (color: color(display-p3 0 0 0%)) {
-.gradients-interpolation-method {
- --background-image: linear-gradient(rgb(245, 137, 137) 0%, rgb(245, 140, 170), rgb(238, 146, 202), rgb(227, 155, 230), rgb(210, 166, 253), rgb(189, 182, 255), rgb(173, 195, 255), rgb(159, 205, 255), rgb(140, 215, 255), rgb(100, 228, 255), rgb(94, 237, 237) 100%);
-}
-
-@media (color-gamut: rec2020) {
-.gradients-interpolation-method {
- --background-image: linear-gradient(rgb(245, 137, 137) 0%, rgb(245, 140, 170), rgb(238, 146, 202), rgb(227, 155, 230), rgb(210, 166, 253), color(display-p3 0.73255 0.7035 1.03328), color(display-p3 0.66377 0.75145 1.06652), color(display-p3 0.59643 0.80011 1.0696), color(display-p3 0.54198 0.8462 1.04382), color(display-p3 0.51578 0.88643 0.99318), rgb(94, 237, 237) 100%);
-}
-}
-}
-
-@supports (background: linear-gradient(in oklch, red 0%, red 0% 1%, red 2%)) and (color: hsl(0 0% 0% / 0)) {
-.gradients-interpolation-method {
- --background-image: linear-gradient(in oklch decreasing hue, hsl(0deg 85% 75%) 0%, hsl(180deg 80% 65%) 100%);
-}
-}
-
-.test-css-color-5-interop {
- color-1: rgb(196, 129, 72);
- color-2: color(from rgb(196, 129, 72) a98-rgb r g b / none);
- color-3: rgb(234, 133, 82);
- color-4: color(from rgb(234, 133, 82) prophoto-rgb r g none);
- color-5: rgb(179, 157, 51);
- color-6: rgb(179, 35, 35);
- color-7: rgb(163, 57, 39);
- color-8: rgb(131, 27, 0);
- color-9: rgb(126, 37, 0);
-}
-
-@media (color-gamut: p3) {
-.test-css-color-5-interop {
- color-8: color(display-p3 0.4939 0.10676 0);
- color-9: color(display-p3 0.47553 0.14324 0);
-}
-}
-
-.test-property-with-var {
- --opacity: 1;
- color: rgba(87 107 149 / var(--opacity));
-}
-
-.exponential-functions {
- width: 8px;
-}
-
-.out-of-gamut {
- --color: rgb(0, 247, 79);
-}
-
-.issue-1244--a {
- background-image: -ms-linear-gradient(180deg, red 0%, blue 100%);
-}
-
-.issue-1244--b {
- background-image: linear-gradient(180deg, red 0%, blue 100%);
-}
-
-.issue-1244--c {
- background-image: linear-gradient(180deg, red 0%, blue 100%);
-}
-
-.dark {
- --csstools-color-scheme--dark: initial;
- color-scheme: dark;
-}
-
-.light {
- --csstools-color-scheme--dark: ;
- color-scheme: light;
-}
-
-.schemed-colors {
- --csstools-light-dark-toggle--1: var(--csstools-color-scheme--dark) rgb(131, 27, 0);
- color: var(--csstools-light-dark-toggle--1, magenta);
- color: light-dark(rgb(131, 27, 0), magenta);
-}
-
-@media (color-gamut: p3) {
-.schemed-colors {
- color: light-dark(color(display-p3 0.4939 0.10676 0), magenta);
-}
-}
-
-.schemed-prop {
- --csstools-light-dark-toggle--0: var(--csstools-color-scheme--dark) cyan;
- --theme-color: var(--csstools-light-dark-toggle--0, deepskyblue);
-}
-
-@supports (color: light-dark(red, red)) {
-.schemed-prop {
- --theme-color: light-dark(cyan, deepskyblue);
-}
-}
-
-.schemed-prop * {
- --csstools-light-dark-toggle--0: var(--csstools-color-scheme--dark) cyan;
- --theme-color: var(--csstools-light-dark-toggle--0, deepskyblue);
-}
-
-.content-alt-text {
- content: url(tree.jpg) "A beautiful tree in a dark forest";
- content: url(tree.jpg) / "A beautiful tree in a dark forest";
-}
-
-.content-alt-text {
- content: var(--foo) "A beautiful tree in a dark forest";
-}
-
-@supports (content: "a" / "a") {
-.content-alt-text {
- content: var(--foo) / "A beautiful tree in a dark forest";
-}
-}
diff --git a/plugin-packs/postcss-preset-env/test/basic.edge16.expect.css b/plugin-packs/postcss-preset-env/test/basic.edge16.expect.css
index a3138d150..b69a56ec4 100644
--- a/plugin-packs/postcss-preset-env/test/basic.edge16.expect.css
+++ b/plugin-packs/postcss-preset-env/test/basic.edge16.expect.css
@@ -43,25 +43,32 @@
.test-nesting-rules {
order: 4;
-
- order: 6;
}
.test-nesting-rules p {
order: 5;
}
+.test-nesting-rules {
+
+ order: 6;
+}
+
.test-nesting-rules,
#test-is-pseudo {
order: 7;
-
- order: 9;
}
-.test-nesting-rules + p, #test-is-pseudo + p {
+.test-nesting-rules:not(#does-not-exist) + p,#test-is-pseudo + p {
order: 8;
}
+.test-nesting-rules,
+#test-is-pseudo {
+
+ order: 9;
+}
+
@media (max-width: 30em) {
.test-custom-media-queries {
order: 10;
diff --git a/plugin-packs/postcss-preset-env/test/basic.expect.css b/plugin-packs/postcss-preset-env/test/basic.expect.css
index b30eaef28..b58b75ce9 100644
--- a/plugin-packs/postcss-preset-env/test/basic.expect.css
+++ b/plugin-packs/postcss-preset-env/test/basic.expect.css
@@ -44,25 +44,32 @@
.test-nesting-rules {
order: 4;
-
- order: 6;
}
.test-nesting-rules p {
order: 5;
}
+.test-nesting-rules {
+
+ order: 6;
+}
+
.test-nesting-rules,
#test-is-pseudo {
order: 7;
-
- order: 9;
}
-.test-nesting-rules + p, #test-is-pseudo + p {
+.test-nesting-rules:not(#does-not-exist) + p,#test-is-pseudo + p {
order: 8;
}
+.test-nesting-rules,
+#test-is-pseudo {
+
+ order: 9;
+}
+
@media (max-width: 30em) {
.test-custom-media-queries {
order: 10;
diff --git a/plugin-packs/postcss-preset-env/test/basic.ff49.expect.css b/plugin-packs/postcss-preset-env/test/basic.ff49.expect.css
index 28a166756..d0c6bc4c6 100644
--- a/plugin-packs/postcss-preset-env/test/basic.ff49.expect.css
+++ b/plugin-packs/postcss-preset-env/test/basic.ff49.expect.css
@@ -42,25 +42,32 @@
.test-nesting-rules {
order: 4;
-
- order: 6;
}
.test-nesting-rules p {
order: 5;
}
+.test-nesting-rules {
+
+ order: 6;
+}
+
.test-nesting-rules,
#test-is-pseudo {
order: 7;
-
- order: 9;
}
-.test-nesting-rules + p, #test-is-pseudo + p {
+.test-nesting-rules:not(#does-not-exist) + p,#test-is-pseudo + p {
order: 8;
}
+.test-nesting-rules,
+#test-is-pseudo {
+
+ order: 9;
+}
+
@media (max-width: 30em) {
.test-custom-media-queries {
order: 10;
diff --git a/plugin-packs/postcss-preset-env/test/basic.ff66.expect.css b/plugin-packs/postcss-preset-env/test/basic.ff66.expect.css
index bf7ef9da3..ced1e79f3 100644
--- a/plugin-packs/postcss-preset-env/test/basic.ff66.expect.css
+++ b/plugin-packs/postcss-preset-env/test/basic.ff66.expect.css
@@ -41,25 +41,32 @@
.test-nesting-rules {
order: 4;
-
- order: 6;
}
.test-nesting-rules p {
order: 5;
}
+.test-nesting-rules {
+
+ order: 6;
+}
+
.test-nesting-rules,
#test-is-pseudo {
order: 7;
-
- order: 9;
}
-.test-nesting-rules + p, #test-is-pseudo + p {
+.test-nesting-rules:not(#does-not-exist) + p,#test-is-pseudo + p {
order: 8;
}
+.test-nesting-rules,
+#test-is-pseudo {
+
+ order: 9;
+}
+
@media (max-width: 30em) {
.test-custom-media-queries {
order: 10;
diff --git a/plugin-packs/postcss-preset-env/test/basic.hebrew.all-browsers-have-support.expect.css b/plugin-packs/postcss-preset-env/test/basic.hebrew.all-browsers-have-support.expect.css
index 2d7a561a5..9721f9df3 100644
--- a/plugin-packs/postcss-preset-env/test/basic.hebrew.all-browsers-have-support.expect.css
+++ b/plugin-packs/postcss-preset-env/test/basic.hebrew.all-browsers-have-support.expect.css
@@ -32,25 +32,32 @@
.test-nesting-rules {
order: 4;
-
- order: 6;
}
.test-nesting-rules p {
order: 5;
}
+.test-nesting-rules {
+
+ order: 6;
+}
+
.test-nesting-rules,
#test-is-pseudo {
order: 7;
-
- order: 9;
}
:is(.test-nesting-rules,#test-is-pseudo) + p {
order: 8;
}
+.test-nesting-rules,
+#test-is-pseudo {
+
+ order: 9;
+}
+
@media (max-width: 30em) {
.test-custom-media-queries {
order: 10;
diff --git a/plugin-packs/postcss-preset-env/test/basic.hebrew.expect.css b/plugin-packs/postcss-preset-env/test/basic.hebrew.expect.css
index d9e393e59..95215e834 100644
--- a/plugin-packs/postcss-preset-env/test/basic.hebrew.expect.css
+++ b/plugin-packs/postcss-preset-env/test/basic.hebrew.expect.css
@@ -44,25 +44,32 @@
.test-nesting-rules {
order: 4;
-
- order: 6;
}
.test-nesting-rules p {
order: 5;
}
+.test-nesting-rules {
+
+ order: 6;
+}
+
.test-nesting-rules,
#test-is-pseudo {
order: 7;
-
- order: 9;
}
-.test-nesting-rules + p, #test-is-pseudo + p {
+.test-nesting-rules:not(#does-not-exist) + p,#test-is-pseudo + p {
order: 8;
}
+.test-nesting-rules,
+#test-is-pseudo {
+
+ order: 9;
+}
+
@media (max-width: 30em) {
.test-custom-media-queries {
order: 10;
diff --git a/plugin-packs/postcss-preset-env/test/basic.ie10.expect.css b/plugin-packs/postcss-preset-env/test/basic.ie10.expect.css
index dd156edd5..921d0af1f 100644
--- a/plugin-packs/postcss-preset-env/test/basic.ie10.expect.css
+++ b/plugin-packs/postcss-preset-env/test/basic.ie10.expect.css
@@ -48,10 +48,6 @@
.test-nesting-rules {
-ms-flex-order: 4;
order: 4;
-
- -ms-flex-order: 6;
-
- order: 6;
}
.test-nesting-rules p {
@@ -59,21 +55,32 @@
order: 5;
}
+.test-nesting-rules {
+
+ -ms-flex-order: 6;
+
+ order: 6;
+}
+
.test-nesting-rules,
#test-is-pseudo {
-ms-flex-order: 7;
order: 7;
-
- -ms-flex-order: 9;
-
- order: 9;
}
-.test-nesting-rules + p, #test-is-pseudo + p {
+.test-nesting-rules:not(#does-not-exist) + p,#test-is-pseudo + p {
-ms-flex-order: 8;
order: 8;
}
+.test-nesting-rules,
+#test-is-pseudo {
+
+ -ms-flex-order: 9;
+
+ order: 9;
+}
+
@media (max-width: 30em) {
.test-custom-media-queries {
-ms-flex-order: 10;
diff --git a/plugin-packs/postcss-preset-env/test/basic.nesting.noIsPseudoSelector.false.expect.css b/plugin-packs/postcss-preset-env/test/basic.nesting.noIsPseudoSelector.false.expect.css
deleted file mode 100644
index ea41ecb35..000000000
--- a/plugin-packs/postcss-preset-env/test/basic.nesting.noIsPseudoSelector.false.expect.css
+++ /dev/null
@@ -1,520 +0,0 @@
-:root {
- --order: 1;
-}
-
-.test-custom-property-fallbacks {
- --firebrick: lab(40% 56.6 39);
-}
-
-.test-custom-properties {
- order: var(--order);
-}
-
-.test-image-set-function {
- background-image: -webkit-image-set(url(img/test.png) 1x, url(img/test-2x.png) 2x);
- background-image: image-set(url(img/test.png) 1x, url(img/test-2x.png) 2x);
- order: 2;
-}
-
-.test-logical-properties-and-values {
- margin-inline-start: 1px;
- margin-inline-end: 2px;
- order: 3;
- padding-block: 4px;
-}
-
-.test-logical-resize {
- resize: inline;
-}
-
-.test-logical-viewport-units {
- width: calc(10vi + 5px);
-}
-
-.test-nesting-rules {
- order: 4;
-
- order: 6;
-}
-
-.test-nesting-rules p {
- order: 5;
- }
-
-.test-nesting-rules,
-#test-is-pseudo {
- order: 7;
-
- order: 9;
-}
-
-:is(.test-nesting-rules,#test-is-pseudo) + p {
- order: 8;
- }
-
-@custom-media --narrow-window (max-width: 30em);
-
-@media (--narrow-window) {
- .test-custom-media-queries {
- order: 10;
- }
-}
-
-@media (480px <= width < 768px) {
- .test-media-query-ranges {
- order: 11;
- }
-}
-
-@custom-media --dark-mode (prefers-color-scheme: dark);
-
-@media (--dark-mode) {
- body {
- background-color: black;
- color: white;
- }
-}
-
-@custom-selector :--heading h1, h2, h3, h4, h5, h6, .heading-7;
-
-.test-custom-selectors:--heading {
- order:12;
-}
-
-.test-case-insensitive-attributes[frame=hsides i] {
- order: 13;
-}
-
-.test-rebeccapurple-color {
- color: rebeccapurple;
- order: 14;
-}
-
-.test-hexadecimal-alpha-notation {
- background-color: #f3f3f3f3;
- color: #0003;
- order: 15;
-}
-
-.test-color-functional-notation {
- color: rgb(70% 13.5% 13.5% / 50%);
- order: 16;
-}
-
-.test-lab-function {
- background-color: lab(40% 56.6 39);
- color: lch(40% 68.8 34.5 / 50%);
- order: 17;
-}
-
-.test-system-ui-font-family {
- font-family: system-ui;
- order: 18;
-}
-
-.test-font-variant-property {
- font-variant-caps: small-caps;
- order: 19;
-}
-
-.test-all-property {
- all: initial;
- order: 20;
-}
-
-.test-matches-pseudo-class:matches(:first-child, .special) {
- order: 21;
-}
-
-.test-not-pseudo-class:not(:first-child, .special) {
- order: 22;
-}
-
-.test-any-link-pseudo-class:-moz-any-link {
- order: 23;
-}
-
-.test-any-link-pseudo-class:any-link {
- order: 23;
-}
-
-.test-dir-pseudo-class:dir(rtl) {
- order: 24;
-}
-
-.test-overflow-wrap-property {
- order: 25;
- overflow-wrap: break-word;
-}
-
-.test-focus-visible-pseudo-class:focus-visible {
- order: 26;
-}
-
-.test-double-position-gradients {
- background-image: conic-gradient(yellowgreen 40%, gold 0deg 75%, #f06 0deg);
-}
-
-.test-blank-pseudo-class:blank {
- background-color: yellow;
-}
-
-.test-has-pseudo-class:has(.inner-class) {
- background-color: yellow;
-}
-
-:is(.a, .b):is(:focus, :hover) {
- order: 27;
-}
-
-:is(.a > .b) + :is(.c > .d) {
- order: 28;
-}
-
-.test-hwb-function {
- background-color: hwb(194 0% 0% / .5);
-}
-
-.test-opacity-percent {
- opacity: 42%;
-}
-
-.clamp-same-unit {
- width: clamp(10px, 64px, 80px);
-}
-
-.complex-clamp {
- width: clamp(calc(100% - 10px), min(10px, 100%), max(40px, 4em));
-}
-
-.clamp-different-units {
- width: clamp(10%, 2px, 4rem);
-}
-
-.mixed-clamp {
- grid-template-columns: clamp(22rem, 40%, 32rem) minmax(0, 1fr);
- margin: clamp(1rem, 2%, 3rem) 4vh;
-}
-
-.calc-clamp {
- margin: 0 40px 0 calc(-1 * clamp(32px, 16vw, 64px));
-}
-
-.multiple-calc-clamp {
- margin: calc(-1 * clamp(1px, 2vw, 3px)) calc(-1 * clamp(4px, 5vw, 6px));
-}
-
-.nested-clamp {
- font-size: clamp(clamp(1rem, 2vw, 3rem), 4vw, 5rem);
-}
-
-@font-face {
- font-family: 'A';
- font-style: normal;
- font-weight: 300;
- font-display: swap;
- src: url(a) format(woff2);
-}
-
-.block-flow {
- display: block flow;
-}
-
-.block-flow-root {
- display: block flow-root;
-}
-
-.inline-flow {
- display: inline flow;
-}
-
-.inline-flow-root {
- display: inline flow-root;
-}
-
-.run-in-flow {
- display: run-in flow;
-}
-
-.list-item-block-flow {
- display: list-item block flow;
-}
-
-.inline-flow-list-item {
- display: inline flow list-item;
-}
-
-.block-flex {
- display: block flex;
-}
-
-.inline-flex {
- display: inline flex;
-}
-
-.block-grid {
- display: block grid;
-}
-
-.inline-grid {
- display: inline grid;
-}
-
-.inline-ruby {
- display: inline ruby;
-}
-
-.block-table {
- display: block table;
-}
-
-.inline-table {
- display: inline table;
-}
-
-.table-cell-flow {
- display: table-cell flow;
-}
-
-.table-caption-flow {
- display: table-caption flow;
-}
-
-.ruby-base-flow {
- display: ruby-base flow;
-}
-
-.ruby-text-flow {
- display: ruby-text flow;
-}
-
-.logical-float {
- float: inline-start;
-}
-
-.color-function {
- prop-1: color(display-p3 0.00000 0.51872 0.36985);
- prop-2: 'color(display-p3 0.02472 0.01150 0.00574 / 1)';
- prop-3: color(display-p3 0.02472 0.01150 0.00574 / 1);
- prop-4: color(display-p3 0.02472 0.01150 0.00574 / calc(33 / 22));
- prop-5: color(display-p3 1 1 1 1);
-}
-
-.oklab {
- color-1: oklab(40% 0.001236 0.0039);
- color-2: oklab(40% 0.1236 0.0039 / 1);
- color-3: oklab(40% 0.1236 0.0039 / .5);
- color-4: oklab(40% 0.1236 0.0039 / 100%);
- color-5: oklab(40% 0.1236 0.0039 / 50%);
- color-6: oklab(60% 0.1 0);
- color-7: oklab(60% 0.1 0 foo);
- color-8: oklab(40.101% 0.1147 0.0453);
- color-9: oklab(59.686% 0.1009 0.1192);
- color-10: oklab(65.125% -0.0320 0.1274);
- color-11: oklab(66.016% -0.1084 0.1114);
- color-12: oklab(72.322% -0.0465 -0.1150);
-}
-
-.oklch {
- color-1: oklch(40% 0.1268735435 34.568626);
- color-2: oklch(40% 0.1268735435 34.568626 / 1);
- color-3: oklch(40% 0.1268735435 34.568626 / .5);
- color-4: oklch(40% 0.1268735435 34.568626 / 100%);
- color-5: oklch(40% 0.1268735435 34.568626 / 50%);
- color-6: oklch(60% 0.150 0);
-
- color-7: oklch(60% 0.1250 180);
- color-8: oklch(60% 0.1250 180deg);
- color-9: oklch(60% 0.1250 0.5turn);
- color-10: oklch(60% 0.1250 200grad);
- color-11: oklch(60% 0.1250 3.14159rad);
-
- color-12: oklch(60% 0.1250 45);
- color-13: oklch(60% 0.1250 45deg);
- color-14: oklch(60% 0.1250 0.125turn);
- color-15: oklch(60% 0.1250 50grad);
- color-16: oklch(60% 0.1250 0.785398rad);
- color-17: oklch(60% 0.1250 0.785398unknown);
-}
-
-.ic-unit {
- --value-2ic: initial;
- text-indent: 2ic;
- content: var(--value-2ic);
- left: var(--non-existing, 2ic);
- width: calc(8ic + 20px);
- height: 10px;
- margin: 0.5ic 1ic .2ic;
- padding: 2 ic;
-}
-
-.unset {
- clip: unset;
-}
-
-.mod {
- padding: 8px mod(18px, 5px) 1px calc(mod(15px, 6px) + 50%);
- transform: rotate(mod(-140deg, -90deg));
- width: mod(mod(-18px, 5px), 5px);
-}
-
-.rem {
- padding: 8px rem(18px, 5px) 1px calc(rem(15px, 6px) + 50%);
- transform: rotate(rem(-140deg, -90deg));
-}
-
-.round {
- top: round(2.5px, 1px);
- right: round(nearest, 2.5px, 1px);
- bottom: round(up, 2.5px, 1px);
- left: round(down, 2.5px, 1px);
- padding-left: round(to-zero, 2.5px, 1px);
-}
-
-.trigonometric {
- left: sin(45deg);
- left: cos(45deg);
- left: tan(45deg);
- left: asin(0.5);
- left: acos(0.5);
- left: atan(10);
- left: atan2(-1, 1);
- left: asin(sin(pi / 2));
- left: atan2(infinity, -infinity);
- left: sin((1deg * 3) + .25turn);
-}
-
-.trigonometric-ignore-not-a-function {
- left: sin;
- left: cos;
- left: tan;
- left: asin;
- left: acos;
- left: atan;
- left: atan2;
-}
-
-.trigonometric-ignore-no-arguments {
- left: sin();
- left: cos();
- left: tan();
- left: asin();
- left: acos();
- left: atan();
- left: atan2();
-}
-
-@custom-selector :--view-m [data-view-size=m];
-
-:--view-m .view {
- background: red;
- }
-
-.nested-calc {
- order: calc(1 * calc(8 / 3 + calc(5 * 10)));
-}
-
-.text-decoration-shorthand {
- -webkit-text-decoration: 3px wavy pink overline;
- text-decoration: 3px wavy pink overline;
-}
-
-.stage__container {
- inset-inline-start: var(--size, 1rem);
-}
-
-:scope {
- content: "plain :scope";
-}
-
-@scope (.foo) {
- :scope {
- content: ":scope in @scope";
- }
-}
-
-:scope {
- @scope (.foo) {
- content: ":scope in @scope, but with nesting";
- }
-}
-
-@media (min-aspect-ratio: 1.77) {
- /* media query aspect ratio : */
-}
-
-.color-mix {
- color-1: color-mix(in srgb, rgb(255 0 0 / 0), blue 65%);
- color-2: color-mix(in lab, rgb(255 0 0 / 0), blue 65%);
- color-3: color-mix(in xyz, rgb(255 0 0 / 0), blue 65%);
- color-4: color-mix(in oklch, rgb(255 0 0 / 0), blue 65%);
- color-5: color-mix(in lch, rgb(255 0 0 / 0), blue 65%);
- color-6: color-mix(in hsl, rgb(255 0 0 / 0), blue 65%);
-}
-
-.gradients-interpolation-method {
- --background-image: linear-gradient(in oklch decreasing hue, hsl(0deg 85% 75%) 0%, hsl(180deg 80% 65%) 100%);
-
- background-image: radial-gradient(farthest-corner circle at 50% 115% in oklch, oklch(80% .3 34) 0%, oklch(90% .3 200) 100%);
-}
-
-.test-css-color-5-interop {
- color-1: color(from color(a98-rgb 0.7 0.5 0.3) a98-rgb r g b / alpha);
- color-2: color(from color(a98-rgb 0.7 0.5 0.3) a98-rgb r g b / none);
- color-3: color(from color(prophoto-rgb 0.7 0.5 0.3) prophoto-rgb r g b);
- color-4: color(from color(prophoto-rgb 0.7 0.5 0.3) prophoto-rgb r g none);
- color-5: hwb(from hwb(50deg 20% 30%) h w b);
- color-6: lab(from lab(40% 56.6 39) l a b);
- color-7: lch(from lch(40% 56.6 39) l c h);
- color-8: oklab(from oklab(40% 0.566 0.39) l a b);
- color-9: oklch(from oklch(40% 0.566 39deg) l c h);
-}
-
-.test-property-with-var {
- --opacity: 1;
- color: rgba(87 107 149 / var(--opacity));
-}
-
-.exponential-functions {
- width: calc(1px * pow(2, 3));
-}
-
-.out-of-gamut {
- --color: color(display-p3 0 1 0);
-}
-
-.issue-1244--a {
- background-image: -ms-linear-gradient(180deg, red 0%, blue 100%);
-}
-
-.issue-1244--b {
- background-image: linear-gradient(180deg, red 0%, blue 100%);
-}
-
-.issue-1244--c {
- background-image: linear-gradient(180deg, red 0%, blue 100%);
-}
-
-.dark {
- color-scheme: dark;
-}
-
-.light {
- color-scheme: light;
-}
-
-.schemed-colors {
- color: light-dark(lch(from oklab(40% 0.566 0.39) l c h), magenta);
-}
-
-.schemed-prop {
- --theme-color: light-dark(cyan, deepskyblue);
-}
-
-.content-alt-text {
- content: url(tree.jpg) / "A beautiful tree in a dark forest";
-}
-
-.content-alt-text {
- content: var(--foo) / "A beautiful tree in a dark forest";
-}
diff --git a/plugin-packs/postcss-preset-env/test/basic.nesting.true.expect.css b/plugin-packs/postcss-preset-env/test/basic.nesting.true.expect.css
index 397ba726a..2825e20ea 100644
--- a/plugin-packs/postcss-preset-env/test/basic.nesting.true.expect.css
+++ b/plugin-packs/postcss-preset-env/test/basic.nesting.true.expect.css
@@ -33,25 +33,32 @@
.test-nesting-rules {
order: 4;
-
- order: 6;
}
.test-nesting-rules p {
order: 5;
}
+.test-nesting-rules {
+
+ order: 6;
+}
+
.test-nesting-rules,
#test-is-pseudo {
order: 7;
-
- order: 9;
}
-.test-nesting-rules + p, #test-is-pseudo + p {
+:is(.test-nesting-rules,#test-is-pseudo) + p {
order: 8;
}
+.test-nesting-rules,
+#test-is-pseudo {
+
+ order: 9;
+}
+
@custom-media --narrow-window (max-width: 30em);
@media (--narrow-window) {
diff --git a/plugin-packs/postcss-preset-env/test/basic.op_mini.expect.css b/plugin-packs/postcss-preset-env/test/basic.op_mini.expect.css
index 41bc135f6..51b851981 100644
--- a/plugin-packs/postcss-preset-env/test/basic.op_mini.expect.css
+++ b/plugin-packs/postcss-preset-env/test/basic.op_mini.expect.css
@@ -43,25 +43,32 @@
.test-nesting-rules {
order: 4;
-
- order: 6;
}
.test-nesting-rules p {
order: 5;
}
+.test-nesting-rules {
+
+ order: 6;
+}
+
.test-nesting-rules,
#test-is-pseudo {
order: 7;
-
- order: 9;
}
-.test-nesting-rules + p, #test-is-pseudo + p {
+.test-nesting-rules:not(#does-not-exist) + p,#test-is-pseudo + p {
order: 8;
}
+.test-nesting-rules,
+#test-is-pseudo {
+
+ order: 9;
+}
+
@media (max-width: 30em) {
.test-custom-media-queries {
order: 10;
diff --git a/plugin-packs/postcss-preset-env/test/basic.preserve.false.expect.css b/plugin-packs/postcss-preset-env/test/basic.preserve.false.expect.css
index e48abe7ed..00a685feb 100644
--- a/plugin-packs/postcss-preset-env/test/basic.preserve.false.expect.css
+++ b/plugin-packs/postcss-preset-env/test/basic.preserve.false.expect.css
@@ -54,6 +54,16 @@
-webkit-order: 4;
-moz-box-ordinal-group: 5;
order: 4;
+}
+
+.test-nesting-rules p {
+ -webkit-box-ordinal-group: 6;
+ -webkit-order: 5;
+ -moz-box-ordinal-group: 6;
+ order: 5;
+ }
+
+.test-nesting-rules {
-webkit-box-ordinal-group: 7;
@@ -64,19 +74,23 @@
order: 6;
}
-.test-nesting-rules p {
- -webkit-box-ordinal-group: 6;
- -webkit-order: 5;
- -moz-box-ordinal-group: 6;
- order: 5;
- }
-
.test-nesting-rules,
#test-is-pseudo {
-webkit-box-ordinal-group: 8;
-webkit-order: 7;
-moz-box-ordinal-group: 8;
order: 7;
+}
+
+.test-nesting-rules:not(#does-not-exist) + p,#test-is-pseudo + p {
+ -webkit-box-ordinal-group: 9;
+ -webkit-order: 8;
+ -moz-box-ordinal-group: 9;
+ order: 8;
+ }
+
+.test-nesting-rules,
+#test-is-pseudo {
-webkit-box-ordinal-group: 10;
@@ -87,13 +101,6 @@
order: 9;
}
-.test-nesting-rules + p, #test-is-pseudo + p {
- -webkit-box-ordinal-group: 9;
- -webkit-order: 8;
- -moz-box-ordinal-group: 9;
- order: 8;
- }
-
@media (max-width: 30em) {
.test-custom-media-queries {
-webkit-box-ordinal-group: 11;
diff --git a/plugin-packs/postcss-preset-env/test/basic.preserve.true.expect.css b/plugin-packs/postcss-preset-env/test/basic.preserve.true.expect.css
index ce412c361..c176578c2 100644
--- a/plugin-packs/postcss-preset-env/test/basic.preserve.true.expect.css
+++ b/plugin-packs/postcss-preset-env/test/basic.preserve.true.expect.css
@@ -69,6 +69,16 @@
-webkit-order: 4;
-moz-box-ordinal-group: 5;
order: 4;
+}
+
+.test-nesting-rules p {
+ -webkit-box-ordinal-group: 6;
+ -webkit-order: 5;
+ -moz-box-ordinal-group: 6;
+ order: 5;
+ }
+
+.test-nesting-rules {
-webkit-box-ordinal-group: 7;
@@ -79,19 +89,30 @@
order: 6;
}
-.test-nesting-rules p {
- -webkit-box-ordinal-group: 6;
- -webkit-order: 5;
- -moz-box-ordinal-group: 6;
- order: 5;
- }
-
.test-nesting-rules,
#test-is-pseudo {
-webkit-box-ordinal-group: 8;
-webkit-order: 7;
-moz-box-ordinal-group: 8;
order: 7;
+}
+
+.test-nesting-rules:not(#does-not-exist) + p,#test-is-pseudo + p {
+ -webkit-box-ordinal-group: 9;
+ -webkit-order: 8;
+ -moz-box-ordinal-group: 9;
+ order: 8;
+ }
+
+:is(.test-nesting-rules,#test-is-pseudo) + p {
+ -webkit-box-ordinal-group: 9;
+ -webkit-order: 8;
+ -moz-box-ordinal-group: 9;
+ order: 8;
+ }
+
+.test-nesting-rules,
+#test-is-pseudo {
-webkit-box-ordinal-group: 10;
@@ -102,13 +123,6 @@
order: 9;
}
-.test-nesting-rules + p, #test-is-pseudo + p {
- -webkit-box-ordinal-group: 9;
- -webkit-order: 8;
- -moz-box-ordinal-group: 9;
- order: 8;
- }
-
@custom-media --narrow-window (max-width: 30em);
@media (max-width: 30em) {
diff --git a/plugin-packs/postcss-preset-env/test/basic.safari15.expect.css b/plugin-packs/postcss-preset-env/test/basic.safari15.expect.css
index 60c7b5457..43517b4a8 100644
--- a/plugin-packs/postcss-preset-env/test/basic.safari15.expect.css
+++ b/plugin-packs/postcss-preset-env/test/basic.safari15.expect.css
@@ -33,25 +33,32 @@
.test-nesting-rules {
order: 4;
-
- order: 6;
}
.test-nesting-rules p {
order: 5;
}
+.test-nesting-rules {
+
+ order: 6;
+}
+
.test-nesting-rules,
#test-is-pseudo {
order: 7;
-
- order: 9;
}
:is(.test-nesting-rules,#test-is-pseudo) + p {
order: 8;
}
+.test-nesting-rules,
+#test-is-pseudo {
+
+ order: 9;
+}
+
@media (max-width: 30em) {
.test-custom-media-queries {
order: 10;
diff --git a/plugin-packs/postcss-preset-env/test/basic.stage0-ff49.expect.css b/plugin-packs/postcss-preset-env/test/basic.stage0-ff49.expect.css
index 7adb1f4be..9731c4de5 100644
--- a/plugin-packs/postcss-preset-env/test/basic.stage0-ff49.expect.css
+++ b/plugin-packs/postcss-preset-env/test/basic.stage0-ff49.expect.css
@@ -42,25 +42,32 @@
.test-nesting-rules {
order: 4;
-
- order: 6;
}
.test-nesting-rules p {
order: 5;
}
+.test-nesting-rules {
+
+ order: 6;
+}
+
.test-nesting-rules,
#test-is-pseudo {
order: 7;
-
- order: 9;
}
-.test-nesting-rules + p, #test-is-pseudo + p {
+.test-nesting-rules:not(#does-not-exist) + p,#test-is-pseudo + p {
order: 8;
}
+.test-nesting-rules,
+#test-is-pseudo {
+
+ order: 9;
+}
+
@media (max-width: 30em) {
.test-custom-media-queries {
order: 10;
diff --git a/plugin-packs/postcss-preset-env/test/basic.stage0-ff66.expect.css b/plugin-packs/postcss-preset-env/test/basic.stage0-ff66.expect.css
index 238435d88..03de5a73e 100644
--- a/plugin-packs/postcss-preset-env/test/basic.stage0-ff66.expect.css
+++ b/plugin-packs/postcss-preset-env/test/basic.stage0-ff66.expect.css
@@ -41,25 +41,32 @@
.test-nesting-rules {
order: 4;
-
- order: 6;
}
.test-nesting-rules p {
order: 5;
}
+.test-nesting-rules {
+
+ order: 6;
+}
+
.test-nesting-rules,
#test-is-pseudo {
order: 7;
-
- order: 9;
}
-.test-nesting-rules + p, #test-is-pseudo + p {
+.test-nesting-rules:not(#does-not-exist) + p,#test-is-pseudo + p {
order: 8;
}
+.test-nesting-rules,
+#test-is-pseudo {
+
+ order: 9;
+}
+
@media (max-width: 30em) {
.test-custom-media-queries {
order: 10;
diff --git a/plugin-packs/postcss-preset-env/test/basic.stage0.expect.css b/plugin-packs/postcss-preset-env/test/basic.stage0.expect.css
index 714b51f87..76d30e9ac 100644
--- a/plugin-packs/postcss-preset-env/test/basic.stage0.expect.css
+++ b/plugin-packs/postcss-preset-env/test/basic.stage0.expect.css
@@ -44,25 +44,32 @@
.test-nesting-rules {
order: 4;
-
- order: 6;
}
.test-nesting-rules p {
order: 5;
}
+.test-nesting-rules {
+
+ order: 6;
+}
+
.test-nesting-rules,
#test-is-pseudo {
order: 7;
-
- order: 9;
}
-.test-nesting-rules + p, #test-is-pseudo + p {
+.test-nesting-rules:not(#does-not-exist) + p,#test-is-pseudo + p {
order: 8;
}
+.test-nesting-rules,
+#test-is-pseudo {
+
+ order: 9;
+}
+
@media (max-width: 30em) {
.test-custom-media-queries {
order: 10;
diff --git a/plugin-packs/postcss-preset-env/test/basic.supports-query.expect.css b/plugin-packs/postcss-preset-env/test/basic.supports-query.expect.css
index f8ec2054a..e48aedfab 100644
--- a/plugin-packs/postcss-preset-env/test/basic.supports-query.expect.css
+++ b/plugin-packs/postcss-preset-env/test/basic.supports-query.expect.css
@@ -33,25 +33,32 @@
.test-nesting-rules {
order: 4;
-
- order: 6;
}
.test-nesting-rules p {
order: 5;
}
+.test-nesting-rules {
+
+ order: 6;
+}
+
.test-nesting-rules,
#test-is-pseudo {
order: 7;
-
- order: 9;
}
:is(.test-nesting-rules,#test-is-pseudo) + p {
order: 8;
}
+.test-nesting-rules,
+#test-is-pseudo {
+
+ order: 9;
+}
+
@media (max-width: 30em) {
.test-custom-media-queries {
order: 10;
diff --git a/plugin-packs/postcss-preset-env/test/basic.vendors-1.expect.css b/plugin-packs/postcss-preset-env/test/basic.vendors-1.expect.css
index aeb7c2ea7..67aa1bd5c 100644
--- a/plugin-packs/postcss-preset-env/test/basic.vendors-1.expect.css
+++ b/plugin-packs/postcss-preset-env/test/basic.vendors-1.expect.css
@@ -44,25 +44,32 @@
.test-nesting-rules {
order: 4;
-
- order: 6;
}
.test-nesting-rules p {
order: 5;
}
+.test-nesting-rules {
+
+ order: 6;
+}
+
.test-nesting-rules,
#test-is-pseudo {
order: 7;
-
- order: 9;
}
-.test-nesting-rules + p, #test-is-pseudo + p {
+.test-nesting-rules:not(#does-not-exist) + p,#test-is-pseudo + p {
order: 8;
}
+.test-nesting-rules,
+#test-is-pseudo {
+
+ order: 9;
+}
+
@custom-media --narrow-window (max-width: 30em);
@media (--narrow-window) {
diff --git a/plugin-packs/postcss-preset-env/test/basic.vendors-2.expect.css b/plugin-packs/postcss-preset-env/test/basic.vendors-2.expect.css
index 3aec7d97a..00c20cf54 100644
--- a/plugin-packs/postcss-preset-env/test/basic.vendors-2.expect.css
+++ b/plugin-packs/postcss-preset-env/test/basic.vendors-2.expect.css
@@ -44,25 +44,32 @@
.test-nesting-rules {
order: 4;
-
- order: 6;
}
.test-nesting-rules p {
order: 5;
}
+.test-nesting-rules {
+
+ order: 6;
+}
+
.test-nesting-rules,
#test-is-pseudo {
order: 7;
-
- order: 9;
}
-.test-nesting-rules + p, #test-is-pseudo + p {
+.test-nesting-rules:not(#does-not-exist) + p,#test-is-pseudo + p {
order: 8;
}
+.test-nesting-rules,
+#test-is-pseudo {
+
+ order: 9;
+}
+
@custom-media --narrow-window (max-width: 30em);
@media (--narrow-window) {
diff --git a/plugin-packs/postcss-preset-env/test/basic.vendors-3.expect.css b/plugin-packs/postcss-preset-env/test/basic.vendors-3.expect.css
index 890e4de6d..258c3bd79 100644
--- a/plugin-packs/postcss-preset-env/test/basic.vendors-3.expect.css
+++ b/plugin-packs/postcss-preset-env/test/basic.vendors-3.expect.css
@@ -44,25 +44,32 @@
.test-nesting-rules {
order: 4;
-
- order: 6;
}
.test-nesting-rules p {
order: 5;
}
+.test-nesting-rules {
+
+ order: 6;
+}
+
.test-nesting-rules,
#test-is-pseudo {
order: 7;
-
- order: 9;
}
-.test-nesting-rules + p, #test-is-pseudo + p {
+.test-nesting-rules:not(#does-not-exist) + p,#test-is-pseudo + p {
order: 8;
}
+.test-nesting-rules,
+#test-is-pseudo {
+
+ order: 9;
+}
+
@custom-media --narrow-window (max-width: 30em);
@media (--narrow-window) {
diff --git a/plugin-packs/postcss-preset-env/test/layers-basic.expect.css b/plugin-packs/postcss-preset-env/test/layers-basic.expect.css
index 02b774efe..7c6a19843 100644
--- a/plugin-packs/postcss-preset-env/test/layers-basic.expect.css
+++ b/plugin-packs/postcss-preset-env/test/layers-basic.expect.css
@@ -65,12 +65,6 @@
-webkit-order: 4;
-moz-box-ordinal-group: 5;
order: 4;
-
- is-layer: C;
- -webkit-box-ordinal-group: 7;
- -webkit-order: 6;
- -moz-box-ordinal-group: 7;
- order: 6;
}
.test-nesting-rules:not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#) p {
@@ -81,12 +75,32 @@
order: 5;
}
+.test-nesting-rules:not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#) {
+
+ is-layer: C;
+ -webkit-box-ordinal-group: 7;
+ -webkit-order: 6;
+ -moz-box-ordinal-group: 7;
+ order: 6;
+ }
+
.test-nesting-rules:not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#),
#test-is-pseudo:not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#) {
-webkit-box-ordinal-group: 8;
-webkit-order: 7;
-moz-box-ordinal-group: 8;
order: 7;
+}
+
+.test-nesting-rules:not(#does-not-exist):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#) + p,#test-is-pseudo:not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#) + p {
+ -webkit-box-ordinal-group: 9;
+ -webkit-order: 8;
+ -moz-box-ordinal-group: 9;
+ order: 8;
+ }
+
+.test-nesting-rules:not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#),
+#test-is-pseudo:not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#) {
-webkit-box-ordinal-group: 10;
@@ -97,13 +111,6 @@
order: 9;
}
-.test-nesting-rules:not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#) + p, #test-is-pseudo:not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#) + p {
- -webkit-box-ordinal-group: 9;
- -webkit-order: 8;
- -moz-box-ordinal-group: 9;
- order: 8;
- }
-
@media (max-width: 500px) {
.test-custom-media-queries:not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#) {
-webkit-box-ordinal-group: 11;
diff --git a/plugin-packs/postcss-preset-env/test/layers-basic.preserve.true.expect.css b/plugin-packs/postcss-preset-env/test/layers-basic.preserve.true.expect.css
index bf75e10f8..7b6d929f9 100644
--- a/plugin-packs/postcss-preset-env/test/layers-basic.preserve.true.expect.css
+++ b/plugin-packs/postcss-preset-env/test/layers-basic.preserve.true.expect.css
@@ -74,12 +74,6 @@
-webkit-order: 4;
-moz-box-ordinal-group: 5;
order: 4;
-
- is-layer: C;
- -webkit-box-ordinal-group: 7;
- -webkit-order: 6;
- -moz-box-ordinal-group: 7;
- order: 6;
}
.test-nesting-rules:not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#) p {
@@ -90,12 +84,39 @@
order: 5;
}
+.test-nesting-rules:not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#) {
+
+ is-layer: C;
+ -webkit-box-ordinal-group: 7;
+ -webkit-order: 6;
+ -moz-box-ordinal-group: 7;
+ order: 6;
+ }
+
.test-nesting-rules:not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#),
#test-is-pseudo:not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#) {
-webkit-box-ordinal-group: 8;
-webkit-order: 7;
-moz-box-ordinal-group: 8;
order: 7;
+}
+
+.test-nesting-rules:not(#does-not-exist):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#) + p,#test-is-pseudo:not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#) + p {
+ -webkit-box-ordinal-group: 9;
+ -webkit-order: 8;
+ -moz-box-ordinal-group: 9;
+ order: 8;
+ }
+
+:is(.test-nesting-rules,#test-is-pseudo):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#) + p {
+ -webkit-box-ordinal-group: 9;
+ -webkit-order: 8;
+ -moz-box-ordinal-group: 9;
+ order: 8;
+ }
+
+.test-nesting-rules:not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#),
+#test-is-pseudo:not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#) {
-webkit-box-ordinal-group: 10;
@@ -106,13 +127,6 @@
order: 9;
}
-.test-nesting-rules:not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#) + p, #test-is-pseudo:not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#) + p {
- -webkit-box-ordinal-group: 9;
- -webkit-order: 8;
- -moz-box-ordinal-group: 9;
- order: 8;
- }
-
@custom-media --narrow-window (max-width: 500px);
@media (max-width: 500px) {
diff --git a/plugins-stylelint/at-risk/CHANGELOG.md b/plugins-stylelint/at-risk/CHANGELOG.md
index 520d3328d..4b83ddb9e 100644
--- a/plugins-stylelint/at-risk/CHANGELOG.md
+++ b/plugins-stylelint/at-risk/CHANGELOG.md
@@ -1,7 +1,8 @@
# Changelog
-### Unreleased (minor)
+### Unreleased (major)
+- Updated: Support for Node v18+ (major).
- Add a warning for `inset-area`
### 1.0.0
diff --git a/plugins-stylelint/at-risk/package.json b/plugins-stylelint/at-risk/package.json
index eb3c7fbed..60d5a2aac 100644
--- a/plugins-stylelint/at-risk/package.json
+++ b/plugins-stylelint/at-risk/package.json
@@ -25,7 +25,7 @@
}
],
"engines": {
- "node": "^14 || ^16 || >=18"
+ "node": ">=18"
},
"type": "module",
"main": "index.mjs",
diff --git a/plugins-stylelint/formatter-github/package.json b/plugins-stylelint/formatter-github/package.json
index 56e3515f8..230b462eb 100644
--- a/plugins-stylelint/formatter-github/package.json
+++ b/plugins-stylelint/formatter-github/package.json
@@ -25,7 +25,7 @@
}
],
"engines": {
- "node": "^14 || ^16 || >=18"
+ "node": ">=18"
},
"type": "module",
"main": "index.mjs",
diff --git a/plugins-stylelint/no-at-nest-rule/CHANGELOG.md b/plugins-stylelint/no-at-nest-rule/CHANGELOG.md
index 16699ee50..26f75aa74 100644
--- a/plugins-stylelint/no-at-nest-rule/CHANGELOG.md
+++ b/plugins-stylelint/no-at-nest-rule/CHANGELOG.md
@@ -1,5 +1,9 @@
# Changelog
+### Unreleased (major)
+
+- Updated: Support for Node v18+ (major).
+
### 2.0.0
_December 15, 2023_
diff --git a/plugins-stylelint/no-at-nest-rule/package.json b/plugins-stylelint/no-at-nest-rule/package.json
index 393ab3a9d..b2bac8420 100644
--- a/plugins-stylelint/no-at-nest-rule/package.json
+++ b/plugins-stylelint/no-at-nest-rule/package.json
@@ -25,7 +25,7 @@
}
],
"engines": {
- "node": "^14 || ^16 || >=18"
+ "node": ">=18"
},
"type": "module",
"main": "index.mjs",
diff --git a/plugins-stylelint/no-invalid-at-import-rules-when-bundling/CHANGELOG.md b/plugins-stylelint/no-invalid-at-import-rules-when-bundling/CHANGELOG.md
index 022c5efed..9fb8a56d1 100644
--- a/plugins-stylelint/no-invalid-at-import-rules-when-bundling/CHANGELOG.md
+++ b/plugins-stylelint/no-invalid-at-import-rules-when-bundling/CHANGELOG.md
@@ -1,7 +1,8 @@
# Changelog
-### Unreleased (patch)
+### Unreleased (major)
+- Updated: Support for Node v18+ (major).
- Fix `files` field in `package.json`
### 2.0.7
diff --git a/plugins-stylelint/no-invalid-at-import-rules-when-bundling/package.json b/plugins-stylelint/no-invalid-at-import-rules-when-bundling/package.json
index 264803f47..47ecddbeb 100644
--- a/plugins-stylelint/no-invalid-at-import-rules-when-bundling/package.json
+++ b/plugins-stylelint/no-invalid-at-import-rules-when-bundling/package.json
@@ -25,7 +25,7 @@
}
],
"engines": {
- "node": "^14 || ^16 || >=18"
+ "node": ">=18"
},
"type": "module",
"main": "index.mjs",
diff --git a/plugins/css-blank-pseudo/CHANGELOG.md b/plugins/css-blank-pseudo/CHANGELOG.md
index 9a278acb2..2abf216ee 100644
--- a/plugins/css-blank-pseudo/CHANGELOG.md
+++ b/plugins/css-blank-pseudo/CHANGELOG.md
@@ -1,5 +1,9 @@
# Changes to CSS Blank Pseudo
+### Unreleased (major)
+
+- Updated: Support for Node v18+ (major).
+
### 6.0.2
_April 18, 2024_
diff --git a/plugins/css-blank-pseudo/package.json b/plugins/css-blank-pseudo/package.json
index f2132d2bc..114cb2862 100644
--- a/plugins/css-blank-pseudo/package.json
+++ b/plugins/css-blank-pseudo/package.json
@@ -29,7 +29,7 @@
}
],
"engines": {
- "node": "^14 || ^16 || >=18"
+ "node": ">=18"
},
"type": "module",
"main": "dist/index.cjs",
diff --git a/plugins/css-blank-pseudo/test/_browser.mjs b/plugins/css-blank-pseudo/test/_browser.mjs
index 41e83dbe2..d0bc4f183 100644
--- a/plugins/css-blank-pseudo/test/_browser.mjs
+++ b/plugins/css-blank-pseudo/test/_browser.mjs
@@ -1,7 +1,7 @@
/* global window,requestAnimationFrame */
import puppeteer from 'puppeteer';
-import http from 'http';
-import { promises as fsp } from 'fs';
+import http from 'node:http';
+import fs from 'node:fs/promises';
import test from 'node:test';
import process from 'node:process';
@@ -15,27 +15,27 @@ const requestListener = async function (req, res) {
case '/':
res.setHeader('Content-type', 'text/html');
res.writeHead(200);
- res.end(await fsp.readFile('test/_browser.html', 'utf8'));
+ res.end(await fs.readFile('test/_browser.html', 'utf8'));
break;
case '/replace-with':
res.setHeader('Content-type', 'text/html');
res.writeHead(200);
- res.end(await fsp.readFile('test/_browser_replace.html', 'utf8'));
+ res.end(await fs.readFile('test/_browser_replace.html', 'utf8'));
break;
case '/test/browser.expect.css':
res.setHeader('Content-type', 'text/css');
res.writeHead(200);
- res.end(await fsp.readFile('test/browser.expect.css', 'utf8'));
+ res.end(await fs.readFile('test/browser.expect.css', 'utf8'));
break;
case '/test/browser.replacewith.expect.css':
res.setHeader('Content-type', 'text/css');
res.writeHead(200);
- res.end(await fsp.readFile('test/browser.replacewith.expect.css', 'utf8'));
+ res.end(await fs.readFile('test/browser.replacewith.expect.css', 'utf8'));
break;
case '/dist/browser-global.js':
res.setHeader('Content-type', 'text/javascript');
res.writeHead(200);
- res.end(await fsp.readFile('dist/browser-global.js', 'utf8'));
+ res.end(await fs.readFile('dist/browser-global.js', 'utf8'));
break;
default:
res.setHeader('Content-type', 'text/plain');
@@ -62,184 +62,186 @@ if (!process.env.DEBUG) {
headless: 'new',
});
- const page = await browser.newPage();
- page.on('pageerror', (msg) => {
- throw msg;
- });
-
- const clearInput = async (page, selector) => {
- const input = await page.$(selector);
- await input.click({ clickCount: 3 });
- await page.keyboard.press('Backspace');
- };
-
- // Default
- {
- await page.goto('http://localhost:8080');
- const result = await page.evaluate(async () => {
- return await window.runTest();
+ try {
+ const page = await browser.newPage();
+ page.on('pageerror', (msg) => {
+ throw msg;
});
- if (!result) {
- throw new Error('Test failed, expected "window.runTest()" to return true');
+ const clearInput = async (page, selector) => {
+ const input = await page.$(selector);
+ await input.click({ clickCount: 3 });
+ await page.keyboard.press('Backspace');
+ };
+
+ // Default
+ {
+ await page.goto('http://localhost:8080');
+ const result = await page.evaluate(async () => {
+ return await window.runTest();
+ });
+
+ if (!result) {
+ throw new Error('Test failed, expected "window.runTest()" to return true');
+ }
}
- }
- // Changing values
- {
- await page.goto('http://localhost:8080');
-
- await page.evaluate(async () => window.runTest());
-
- await page.type('#tel-input', '1234');
- await page.type('#text-input', '1234');
- await page.type('#number-input', '1234');
- await page.type('#password-input', '1234');
- await page.type('#textarea', '1234');
- await page.select('#select', 'non-empty');
- await page.select('#multiselect', 'non-empty');
-
- const fillingResults = await Promise.all([
- page.evaluate(async () => window.checkElement('user typing', 'tel', false)),
- page.evaluate(async () => window.checkElement('user typing', 'text', false)),
- page.evaluate(async () => window.checkElement('user typing', 'number', false)),
- page.evaluate(async () => window.checkElement('user typing', 'password', false)),
- page.evaluate(async () => window.checkElement('user typing', 'textarea', false)),
- page.evaluate(async () => window.checkElement('user typing', 'select', false)),
- page.evaluate(async () => window.checkElement('user typing', 'multiselect', false)),
- ]);
-
- // Reverting now, should revert
- await clearInput(page, '#tel-input');
- await clearInput(page, '#text-input');
- await clearInput(page, '#number-input');
- await clearInput(page, '#password-input');
- await clearInput(page, '#textarea');
- await page.select('#select', '');
- await page.select('#multiselect', '');
-
- const unfillingResults = await Promise.all([
- page.evaluate(async () => window.checkElement('user typing', 'tel', true)),
- page.evaluate(async () => window.checkElement('user typing', 'text', true)),
- page.evaluate(async () => window.checkElement('user typing', 'number', true)),
- page.evaluate(async () => window.checkElement('user typing', 'password', true)),
- page.evaluate(async () => window.checkElement('user typing', 'textarea', true)),
- page.evaluate(async () => window.checkElement('user typing', 'select', true)),
- page.evaluate(async () => window.checkElement('user typing', 'multiselect', true)),
- ]);
-
- const result = [
- ...fillingResults,
- ...unfillingResults,
- ].every(test => !!test);
-
- if (!result) {
- throw new Error('Test failed');
+ // Changing values
+ {
+ await page.goto('http://localhost:8080');
+
+ await page.evaluate(async () => window.runTest());
+
+ await page.type('#tel-input', '1234');
+ await page.type('#text-input', '1234');
+ await page.type('#number-input', '1234');
+ await page.type('#password-input', '1234');
+ await page.type('#textarea', '1234');
+ await page.select('#select', 'non-empty');
+ await page.select('#multiselect', 'non-empty');
+
+ const fillingResults = await Promise.all([
+ page.evaluate(async () => window.checkElement('user typing', 'tel', false)),
+ page.evaluate(async () => window.checkElement('user typing', 'text', false)),
+ page.evaluate(async () => window.checkElement('user typing', 'number', false)),
+ page.evaluate(async () => window.checkElement('user typing', 'password', false)),
+ page.evaluate(async () => window.checkElement('user typing', 'textarea', false)),
+ page.evaluate(async () => window.checkElement('user typing', 'select', false)),
+ page.evaluate(async () => window.checkElement('user typing', 'multiselect', false)),
+ ]);
+
+ // Reverting now, should revert
+ await clearInput(page, '#tel-input');
+ await clearInput(page, '#text-input');
+ await clearInput(page, '#number-input');
+ await clearInput(page, '#password-input');
+ await clearInput(page, '#textarea');
+ await page.select('#select', '');
+ await page.select('#multiselect', '');
+
+ const unfillingResults = await Promise.all([
+ page.evaluate(async () => window.checkElement('user typing', 'tel', true)),
+ page.evaluate(async () => window.checkElement('user typing', 'text', true)),
+ page.evaluate(async () => window.checkElement('user typing', 'number', true)),
+ page.evaluate(async () => window.checkElement('user typing', 'password', true)),
+ page.evaluate(async () => window.checkElement('user typing', 'textarea', true)),
+ page.evaluate(async () => window.checkElement('user typing', 'select', true)),
+ page.evaluate(async () => window.checkElement('user typing', 'multiselect', true)),
+ ]);
+
+ const result = [
+ ...fillingResults,
+ ...unfillingResults,
+ ].every(test => !!test);
+
+ if (!result) {
+ throw new Error('Test failed');
+ }
}
- }
- // Changing values via JS
- {
- await page.goto('http://localhost:8080');
-
- await page.evaluate(async () => window.runTest());
-
- await page.evaluate(async () => window.document.getElementById('tel-input').value = '1234');
- await page.evaluate(async () => window.document.getElementById('text-input').value = '1234');
- await page.evaluate(async () => window.document.getElementById('number-input').value = '1234');
- await page.evaluate(async () => window.document.getElementById('password-input').value = '1234');
- await page.evaluate(async () => window.document.getElementById('textarea').value = '1234');
- await page.evaluate(async () => window.document.getElementById('select').value = 'non-empty');
- await page.evaluate(async () => window.document.getElementById('multiselect').value = 'non-empty');
-
-
- const fillingResults = await Promise.all([
- page.evaluate(async () => window.checkElement('js value change', 'tel', false)),
- page.evaluate(async () => window.checkElement('js value change', 'text', false)),
- page.evaluate(async () => window.checkElement('js value change', 'number', false)),
- page.evaluate(async () => window.checkElement('js value change', 'password', false)),
- page.evaluate(async () => window.checkElement('js value change', 'textarea', false)),
- page.evaluate(async () => window.checkElement('js value change', 'select', false)),
- page.evaluate(async () => window.checkElement('js value change', 'multiselect', false)),
- ]);
-
- // Reverting
- await page.evaluate(async () => window.document.getElementById('tel-input').value = '');
- await page.evaluate(async () => window.document.getElementById('text-input').value = '');
- await page.evaluate(async () => window.document.getElementById('number-input').value = '');
- await page.evaluate(async () => window.document.getElementById('password-input').value = '');
- await page.evaluate(async () => window.document.getElementById('textarea').value = '');
- await page.evaluate(async () => window.document.getElementById('select').value = '');
- await page.evaluate(async () => window.document.getElementById('multiselect').value = '');
-
- const unfillingResults = await Promise.all([
- page.evaluate(async () => window.checkElement('js value change', 'tel', true)),
- page.evaluate(async () => window.checkElement('js value change', 'text', true)),
- page.evaluate(async () => window.checkElement('js value change', 'number', true)),
- page.evaluate(async () => window.checkElement('js value change', 'password', true)),
- page.evaluate(async () => window.checkElement('js value change', 'textarea', true)),
- page.evaluate(async () => window.checkElement('js value change', 'select', true)),
- page.evaluate(async () => window.checkElement('js value change', 'multiselect', true)),
- ]);
-
- await page.evaluate(async () => {
- window.document.getElementById('select').options[1].selected = true;
- window.document.getElementById('multiselect').options[1].selected = true;
- });
- await page.evaluate(async () => window.checkElement('js value change', 'select', false));
- await page.evaluate(async () => window.checkElement('js value change', 'multiselect', false));
+ // Changing values via JS
+ {
+ await page.goto('http://localhost:8080');
+
+ await page.evaluate(async () => window.runTest());
+
+ await page.evaluate(async () => window.document.getElementById('tel-input').value = '1234');
+ await page.evaluate(async () => window.document.getElementById('text-input').value = '1234');
+ await page.evaluate(async () => window.document.getElementById('number-input').value = '1234');
+ await page.evaluate(async () => window.document.getElementById('password-input').value = '1234');
+ await page.evaluate(async () => window.document.getElementById('textarea').value = '1234');
+ await page.evaluate(async () => window.document.getElementById('select').value = 'non-empty');
+ await page.evaluate(async () => window.document.getElementById('multiselect').value = 'non-empty');
+
+
+ const fillingResults = await Promise.all([
+ page.evaluate(async () => window.checkElement('js value change', 'tel', false)),
+ page.evaluate(async () => window.checkElement('js value change', 'text', false)),
+ page.evaluate(async () => window.checkElement('js value change', 'number', false)),
+ page.evaluate(async () => window.checkElement('js value change', 'password', false)),
+ page.evaluate(async () => window.checkElement('js value change', 'textarea', false)),
+ page.evaluate(async () => window.checkElement('js value change', 'select', false)),
+ page.evaluate(async () => window.checkElement('js value change', 'multiselect', false)),
+ ]);
+
+ // Reverting
+ await page.evaluate(async () => window.document.getElementById('tel-input').value = '');
+ await page.evaluate(async () => window.document.getElementById('text-input').value = '');
+ await page.evaluate(async () => window.document.getElementById('number-input').value = '');
+ await page.evaluate(async () => window.document.getElementById('password-input').value = '');
+ await page.evaluate(async () => window.document.getElementById('textarea').value = '');
+ await page.evaluate(async () => window.document.getElementById('select').value = '');
+ await page.evaluate(async () => window.document.getElementById('multiselect').value = '');
+
+ const unfillingResults = await Promise.all([
+ page.evaluate(async () => window.checkElement('js value change', 'tel', true)),
+ page.evaluate(async () => window.checkElement('js value change', 'text', true)),
+ page.evaluate(async () => window.checkElement('js value change', 'number', true)),
+ page.evaluate(async () => window.checkElement('js value change', 'password', true)),
+ page.evaluate(async () => window.checkElement('js value change', 'textarea', true)),
+ page.evaluate(async () => window.checkElement('js value change', 'select', true)),
+ page.evaluate(async () => window.checkElement('js value change', 'multiselect', true)),
+ ]);
+
+ await page.evaluate(async () => {
+ window.document.getElementById('select').options[1].selected = true;
+ window.document.getElementById('multiselect').options[1].selected = true;
+ });
+ await page.evaluate(async () => window.checkElement('js value change', 'select', false));
+ await page.evaluate(async () => window.checkElement('js value change', 'multiselect', false));
- const result = [
- ...fillingResults,
- ...unfillingResults,
- ].every(test => !!test);
+ const result = [
+ ...fillingResults,
+ ...unfillingResults,
+ ].every(test => !!test);
- if (!result) {
- throw new Error('Test failed');
+ if (!result) {
+ throw new Error('Test failed');
+ }
}
- }
- // Dynamic element
- {
- await page.goto('http://localhost:8080');
- await page.evaluate(async () => {
+ // Dynamic element
+ {
+ await page.goto('http://localhost:8080');
+ await page.evaluate(async () => {
- return await window.runTest();
- });
+ return await window.runTest();
+ });
- await page.evaluate(async () => {
- const filledInput = window.document.createElement('input');
- const unfilledInput = window.document.createElement('input');
- filledInput.value = 'foo';
+ await page.evaluate(async () => {
+ const filledInput = window.document.createElement('input');
+ const unfilledInput = window.document.createElement('input');
+ filledInput.value = 'foo';
- window.document.body.append(filledInput);
- window.document.body.append(unfilledInput);
+ window.document.body.append(filledInput);
+ window.document.body.append(unfilledInput);
- requestAnimationFrame(() => {
- // Not blank
- window.checkElement('dynamic input', filledInput, false);
- // Blank
- window.checkElement('dynamic input', unfilledInput, true);
+ requestAnimationFrame(() => {
+ // Not blank
+ window.checkElement('dynamic input', filledInput, false);
+ // Blank
+ window.checkElement('dynamic input', unfilledInput, true);
+ });
});
- });
- }
+ }
- // Replace with
- {
- await page.goto('http://localhost:8080/replace-with');
- const result = await page.evaluate(async () => {
+ // Replace with
+ {
+ await page.goto('http://localhost:8080/replace-with');
+ const result = await page.evaluate(async () => {
- return await window.runTest();
- });
+ return await window.runTest();
+ });
- if (!result) {
- throw new Error('Test failed, expected "window.runTest()" to return true');
+ if (!result) {
+ throw new Error('Test failed, expected "window.runTest()" to return true');
+ }
}
- }
+ } finally {
+ await browser.close();
- await browser.close();
-
- await cleanup();
+ await cleanup();
+ }
});
} else {
startServers();
diff --git a/plugins/css-blank-pseudo/test/_import.mjs b/plugins/css-blank-pseudo/test/_import.mjs
index 0d0d31ec9..b2977ccc2 100644
--- a/plugins/css-blank-pseudo/test/_import.mjs
+++ b/plugins/css-blank-pseudo/test/_import.mjs
@@ -1,4 +1,4 @@
-import assert from 'assert';
+import assert from 'node:assert';
import plugin from 'css-blank-pseudo';
plugin();
diff --git a/plugins/css-blank-pseudo/test/_valid-replacements.mjs b/plugins/css-blank-pseudo/test/_valid-replacements.mjs
index bcc4d294d..1d987b295 100644
--- a/plugins/css-blank-pseudo/test/_valid-replacements.mjs
+++ b/plugins/css-blank-pseudo/test/_valid-replacements.mjs
@@ -1,4 +1,4 @@
-import assert from 'assert';
+import assert from 'node:assert';
import isValidReplacement from '../src/is-valid-replacement.mjs';
const valid = [
diff --git a/plugins/css-has-pseudo/CHANGELOG.md b/plugins/css-has-pseudo/CHANGELOG.md
index 1293edd6f..6ef46fc9a 100644
--- a/plugins/css-has-pseudo/CHANGELOG.md
+++ b/plugins/css-has-pseudo/CHANGELOG.md
@@ -1,5 +1,9 @@
# Changes to CSS Has Pseudo
+### Unreleased (major)
+
+- Updated: Support for Node v18+ (major).
+
### 6.0.5
_May 13, 2024_
diff --git a/plugins/css-has-pseudo/package.json b/plugins/css-has-pseudo/package.json
index 1406172e4..c0eb78755 100644
--- a/plugins/css-has-pseudo/package.json
+++ b/plugins/css-has-pseudo/package.json
@@ -29,7 +29,7 @@
}
],
"engines": {
- "node": "^14 || ^16 || >=18"
+ "node": ">=18"
},
"type": "module",
"main": "dist/index.cjs",
diff --git a/plugins/css-has-pseudo/test/_browser.mjs b/plugins/css-has-pseudo/test/_browser.mjs
index 882bb43ac..e39aedfc6 100644
--- a/plugins/css-has-pseudo/test/_browser.mjs
+++ b/plugins/css-has-pseudo/test/_browser.mjs
@@ -1,6 +1,6 @@
import puppeteer from 'puppeteer';
-import http from 'http';
-import { promises as fsp } from 'fs';
+import http from 'node:http';
+import fs from 'node:fs/promises';
import test from 'node:test';
import process from 'node:process';
@@ -14,25 +14,25 @@ const requestListener = async function (req, res) {
case '/':
res.setHeader('Content-type', 'text/html');
res.writeHead(200);
- res.end(await fsp.readFile('test/_browser.html', 'utf8'));
+ res.end(await fs.readFile('test/_browser.html', 'utf8'));
break;
case '/test/basic.expect.css':
// Stylesheet WITHOUT CORS headers
res.setHeader('Content-type', 'text/css');
res.writeHead(200);
- res.end(await fsp.readFile('test/basic.expect.css', 'utf8'));
+ res.end(await fs.readFile('test/basic.expect.css', 'utf8'));
break;
case '/test/browser.expect.css':
// Stylesheet WITH CORS headers
res.setHeader('Content-type', 'text/css');
res.setHeader('Access-Control-Allow-Origin', 'http://localhost:8080');
res.writeHead(200);
- res.end(await fsp.readFile('test/browser.expect.css', 'utf8'));
+ res.end(await fs.readFile('test/browser.expect.css', 'utf8'));
break;
case '/dist/browser-global.js':
res.setHeader('Content-type', 'text/javascript');
res.writeHead(200);
- res.end(await fsp.readFile('dist/browser-global.js', 'utf8'));
+ res.end(await fs.readFile('dist/browser-global.js', 'utf8'));
break;
default:
@@ -71,37 +71,39 @@ if (!process.env.DEBUG) {
headless: 'new',
});
- const page = await browser.newPage();
- page.on('pageerror', (msg) => {
- throw msg;
- });
+ try {
+ const page = await browser.newPage();
+ page.on('pageerror', (msg) => {
+ throw msg;
+ });
- // Uncomment to verify that the polyfill doesn't break native functionality
- // {
- // await page.goto('http://localhost:8080');
- // const result = await page.evaluate(async() => {
- // // eslint-disable-next-line no-undef
- // return await window.runTest();
- // });
- // if (!result) {
- // throw new Error('Test failed, expected "window.runTest()" to return true');
- // }
- // }
+ // Uncomment to verify that the polyfill doesn't break native functionality
+ // {
+ // await page.goto('http://localhost:8080');
+ // const result = await page.evaluate(async() => {
+ // // eslint-disable-next-line no-undef
+ // return await window.runTest();
+ // });
+ // if (!result) {
+ // throw new Error('Test failed, expected "window.runTest()" to return true');
+ // }
+ // }
- {
- await page.goto('http://localhost:8080#force-polyfill');
- const result = await page.evaluate(async () => {
- // eslint-disable-next-line no-undef
- return await window.runTest();
- });
- if (!result) {
- throw new Error('Test failed, expected "window.runTest()" to return true');
+ {
+ await page.goto('http://localhost:8080#force-polyfill');
+ const result = await page.evaluate(async () => {
+ // eslint-disable-next-line no-undef
+ return await window.runTest();
+ });
+ if (!result) {
+ throw new Error('Test failed, expected "window.runTest()" to return true');
+ }
}
- }
-
- await browser.close();
+ } finally {
+ await browser.close();
- await cleanup();
+ await cleanup();
+ }
});
} else {
startServers();
diff --git a/plugins/css-has-pseudo/test/_encode-decode.mjs b/plugins/css-has-pseudo/test/_encode-decode.mjs
index de45470c3..502ca7a33 100644
--- a/plugins/css-has-pseudo/test/_encode-decode.mjs
+++ b/plugins/css-has-pseudo/test/_encode-decode.mjs
@@ -1,4 +1,4 @@
-import { strict as assert } from 'assert';
+import { strict as assert } from 'node:assert';
import encodeCSS from '../src/encode/encode.mjs';
import decodeCSS from '../src/encode/decode.mjs';
import extractEncodedSelectors from '../src/encode/extract.mjs';
diff --git a/plugins/css-has-pseudo/test/_import.mjs b/plugins/css-has-pseudo/test/_import.mjs
index 8a3a746b3..c9d6760a6 100644
--- a/plugins/css-has-pseudo/test/_import.mjs
+++ b/plugins/css-has-pseudo/test/_import.mjs
@@ -1,4 +1,4 @@
-import assert from 'assert';
+import assert from 'node:assert';
import plugin from 'css-has-pseudo';
plugin();
diff --git a/plugins/css-has-pseudo/test/plugin-order-nesting.after.expect.css b/plugins/css-has-pseudo/test/plugin-order-nesting.after.expect.css
index ee5b192d5..4226a2ca3 100644
--- a/plugins/css-has-pseudo/test/plugin-order-nesting.after.expect.css
+++ b/plugins/css-has-pseudo/test/plugin-order-nesting.after.expect.css
@@ -3,10 +3,10 @@
order: 1;
}
-.js-has-pseudo [csstools-has-2p-1m-2w-2p-37-14-1q-w-2x-31-2v-15-1m-2u-33-2r-39-37]:not(does-not-exist):not(does-not-exist) {
+.js-has-pseudo [csstools-has-2p-1m-2w-2p-37-14-w-1q-w-2x-31-2v-15-1m-2u-33-2r-39-37]:not(does-not-exist):not(does-not-exist) {
order: 2;
}
-.js-has-pseudo [csstools-has-2p-1m-2w-2p-37-14-1q-w-2x-31-2v-15-w-1m-2w-2p-37-14-1q-w-1a-37-33-31-2t-15]:not(does-not-exist):not(does-not-exist) {
+.js-has-pseudo [csstools-has-2p-1m-2w-2p-37-14-w-1q-w-2x-31-2v-15-w-1m-2w-2p-37-14-w-1q-w-1a-37-33-31-2t-15]:not(does-not-exist):not(does-not-exist) {
order: 3;
}
diff --git a/plugins/css-has-pseudo/test/plugin-order-nesting.after.preserve.expect.css b/plugins/css-has-pseudo/test/plugin-order-nesting.after.preserve.expect.css
index d1e585c5e..c3d9e159d 100644
--- a/plugins/css-has-pseudo/test/plugin-order-nesting.after.preserve.expect.css
+++ b/plugins/css-has-pseudo/test/plugin-order-nesting.after.preserve.expect.css
@@ -7,18 +7,18 @@ a:has(.b) {
order: 1;
}
-.js-has-pseudo [csstools-has-2p-1m-2w-2p-37-14-1q-w-2x-31-2v-15-1m-2u-33-2r-39-37]:not(does-not-exist):not(does-not-exist) {
+.js-has-pseudo [csstools-has-2p-1m-2w-2p-37-14-w-1q-w-2x-31-2v-15-1m-2u-33-2r-39-37]:not(does-not-exist):not(does-not-exist) {
order: 2;
}
-a:has(> img):focus {
+a:has( > img):focus {
order: 2;
}
-.js-has-pseudo [csstools-has-2p-1m-2w-2p-37-14-1q-w-2x-31-2v-15-w-1m-2w-2p-37-14-1q-w-1a-37-33-31-2t-15]:not(does-not-exist):not(does-not-exist) {
+.js-has-pseudo [csstools-has-2p-1m-2w-2p-37-14-w-1q-w-2x-31-2v-15-w-1m-2w-2p-37-14-w-1q-w-1a-37-33-31-2t-15]:not(does-not-exist):not(does-not-exist) {
order: 3;
}
-a:has(> img) :has(> .some) {
+a:has( > img) :has( > .some) {
order: 3;
}
diff --git a/plugins/css-has-pseudo/test/plugin-order-nesting.before.expect.css b/plugins/css-has-pseudo/test/plugin-order-nesting.before.expect.css
index ee5b192d5..4226a2ca3 100644
--- a/plugins/css-has-pseudo/test/plugin-order-nesting.before.expect.css
+++ b/plugins/css-has-pseudo/test/plugin-order-nesting.before.expect.css
@@ -3,10 +3,10 @@
order: 1;
}
-.js-has-pseudo [csstools-has-2p-1m-2w-2p-37-14-1q-w-2x-31-2v-15-1m-2u-33-2r-39-37]:not(does-not-exist):not(does-not-exist) {
+.js-has-pseudo [csstools-has-2p-1m-2w-2p-37-14-w-1q-w-2x-31-2v-15-1m-2u-33-2r-39-37]:not(does-not-exist):not(does-not-exist) {
order: 2;
}
-.js-has-pseudo [csstools-has-2p-1m-2w-2p-37-14-1q-w-2x-31-2v-15-w-1m-2w-2p-37-14-1q-w-1a-37-33-31-2t-15]:not(does-not-exist):not(does-not-exist) {
+.js-has-pseudo [csstools-has-2p-1m-2w-2p-37-14-w-1q-w-2x-31-2v-15-w-1m-2w-2p-37-14-w-1q-w-1a-37-33-31-2t-15]:not(does-not-exist):not(does-not-exist) {
order: 3;
}
diff --git a/plugins/css-has-pseudo/test/plugin-order-nesting.before.preserve.expect.css b/plugins/css-has-pseudo/test/plugin-order-nesting.before.preserve.expect.css
index d1e585c5e..c3d9e159d 100644
--- a/plugins/css-has-pseudo/test/plugin-order-nesting.before.preserve.expect.css
+++ b/plugins/css-has-pseudo/test/plugin-order-nesting.before.preserve.expect.css
@@ -7,18 +7,18 @@ a:has(.b) {
order: 1;
}
-.js-has-pseudo [csstools-has-2p-1m-2w-2p-37-14-1q-w-2x-31-2v-15-1m-2u-33-2r-39-37]:not(does-not-exist):not(does-not-exist) {
+.js-has-pseudo [csstools-has-2p-1m-2w-2p-37-14-w-1q-w-2x-31-2v-15-1m-2u-33-2r-39-37]:not(does-not-exist):not(does-not-exist) {
order: 2;
}
-a:has(> img):focus {
+a:has( > img):focus {
order: 2;
}
-.js-has-pseudo [csstools-has-2p-1m-2w-2p-37-14-1q-w-2x-31-2v-15-w-1m-2w-2p-37-14-1q-w-1a-37-33-31-2t-15]:not(does-not-exist):not(does-not-exist) {
+.js-has-pseudo [csstools-has-2p-1m-2w-2p-37-14-w-1q-w-2x-31-2v-15-w-1m-2w-2p-37-14-w-1q-w-1a-37-33-31-2t-15]:not(does-not-exist):not(does-not-exist) {
order: 3;
}
-a:has(> img) :has(> .some) {
+a:has( > img) :has( > .some) {
order: 3;
}
diff --git a/plugins/css-prefers-color-scheme/CHANGELOG.md b/plugins/css-prefers-color-scheme/CHANGELOG.md
index ea001bf9e..3caed94e9 100644
--- a/plugins/css-prefers-color-scheme/CHANGELOG.md
+++ b/plugins/css-prefers-color-scheme/CHANGELOG.md
@@ -1,5 +1,9 @@
# Changes to Prefers Color Scheme
+### Unreleased (major)
+
+- Updated: Support for Node v18+ (major).
+
### 9.0.1
_December 15, 2023_
diff --git a/plugins/css-prefers-color-scheme/package.json b/plugins/css-prefers-color-scheme/package.json
index b24d15e3b..db0a28de2 100644
--- a/plugins/css-prefers-color-scheme/package.json
+++ b/plugins/css-prefers-color-scheme/package.json
@@ -29,7 +29,7 @@
}
],
"engines": {
- "node": "^14 || ^16 || >=18"
+ "node": ">=18"
},
"type": "module",
"main": "dist/index.cjs",
diff --git a/plugins/css-prefers-color-scheme/test/_browser.mjs b/plugins/css-prefers-color-scheme/test/_browser.mjs
index 203a4e51f..4533ad40b 100644
--- a/plugins/css-prefers-color-scheme/test/_browser.mjs
+++ b/plugins/css-prefers-color-scheme/test/_browser.mjs
@@ -1,6 +1,6 @@
import puppeteer from 'puppeteer';
-import http from 'http';
-import { promises as fsp } from 'fs';
+import http from 'node:http';
+import fs from 'node:fs/promises';
import test from 'node:test';
import process from 'node:process';
@@ -14,30 +14,30 @@ const requestListener = async function (req, res) {
case '/':
res.setHeader('Content-type', 'text/html');
res.writeHead(200);
- res.end(await fsp.readFile('test/_browser.html', 'utf8'));
+ res.end(await fs.readFile('test/_browser.html', 'utf8'));
break;
case '/no-polyfill.html':
res.setHeader('Content-type', 'text/html');
res.writeHead(200);
- res.end(await fsp.readFile('test/_browser-no-polyfill.html', 'utf8'));
+ res.end(await fs.readFile('test/_browser-no-polyfill.html', 'utf8'));
break;
case '/test/basic.expect.css':
// Stylesheet WITHOUT CORS headers
res.setHeader('Content-type', 'text/css');
res.writeHead(200);
- res.end(await fsp.readFile('test/basic.expect.css', 'utf8'));
+ res.end(await fs.readFile('test/basic.expect.css', 'utf8'));
break;
case '/test/browser.expect.css':
// Stylesheet WITH CORS headers
res.setHeader('Content-type', 'text/css');
res.setHeader('Access-Control-Allow-Origin', 'http://localhost:8080');
res.writeHead(200);
- res.end(await fsp.readFile('test/browser.expect.css', 'utf8'));
+ res.end(await fs.readFile('test/browser.expect.css', 'utf8'));
break;
case '/dist/browser-global.js':
res.setHeader('Content-type', 'text/javascript');
res.writeHead(200);
- res.end(await fsp.readFile('dist/browser-global.js', 'utf8'));
+ res.end(await fs.readFile('dist/browser-global.js', 'utf8'));
break;
default:
@@ -76,92 +76,94 @@ if (!process.env.DEBUG) {
headless: 'new',
});
- const page = await browser.newPage();
- page.on('pageerror', (msg) => {
- throw msg;
- });
-
- // Default
- {
- await page.goto('http://localhost:8080');
- const result = await page.evaluate(async () => {
- // eslint-disable-next-line no-undef
- return await window.runTest();
+ try {
+ const page = await browser.newPage();
+ page.on('pageerror', (msg) => {
+ throw msg;
});
- if (!result) {
- throw new Error('Test failed, expected "window.runTest()" to return true');
+
+ // Default
+ {
+ await page.goto('http://localhost:8080');
+ const result = await page.evaluate(async () => {
+ // eslint-disable-next-line no-undef
+ return await window.runTest();
+ });
+ if (!result) {
+ throw new Error('Test failed, expected "window.runTest()" to return true');
+ }
}
- }
- {
- await page.goto('http://localhost:8080/no-polyfill.html');
- const result = await page.evaluate(async () => {
- // eslint-disable-next-line no-undef
- return await window.runTest();
- });
- if (!result) {
- throw new Error('Test failed, expected "window.runTest()" to return true');
+ {
+ await page.goto('http://localhost:8080/no-polyfill.html');
+ const result = await page.evaluate(async () => {
+ // eslint-disable-next-line no-undef
+ return await window.runTest();
+ });
+ if (!result) {
+ throw new Error('Test failed, expected "window.runTest()" to return true');
+ }
}
- }
- // Explicit "dark"
- {
- await await page.emulateMediaFeatures([{
- name: 'prefers-color-scheme', value: 'dark',
- }]);
- await page.goto('http://localhost:8080#dark');
- const result = await page.evaluate(async () => {
- // eslint-disable-next-line no-undef
- return await window.runTest();
- });
- if (!result) {
- throw new Error('Test failed, expected "window.runTest()" to return true');
+ // Explicit "dark"
+ {
+ await await page.emulateMediaFeatures([{
+ name: 'prefers-color-scheme', value: 'dark',
+ }]);
+ await page.goto('http://localhost:8080#dark');
+ const result = await page.evaluate(async () => {
+ // eslint-disable-next-line no-undef
+ return await window.runTest();
+ });
+ if (!result) {
+ throw new Error('Test failed, expected "window.runTest()" to return true');
+ }
}
- }
- {
- await await page.emulateMediaFeatures([{
- name: 'prefers-color-scheme', value: 'dark',
- }]);
- await page.goto('http://localhost:8080/no-polyfill.html#dark');
- const result = await page.evaluate(async () => {
- // eslint-disable-next-line no-undef
- return await window.runTest();
- });
- if (!result) {
- throw new Error('Test failed, expected "window.runTest()" to return true');
+ {
+ await await page.emulateMediaFeatures([{
+ name: 'prefers-color-scheme', value: 'dark',
+ }]);
+ await page.goto('http://localhost:8080/no-polyfill.html#dark');
+ const result = await page.evaluate(async () => {
+ // eslint-disable-next-line no-undef
+ return await window.runTest();
+ });
+ if (!result) {
+ throw new Error('Test failed, expected "window.runTest()" to return true');
+ }
}
- }
- // Explicit "light"
- {
- await await page.emulateMediaFeatures([{
- name: 'prefers-color-scheme', value: 'light',
- }]);
- await page.goto('http://localhost:8080#light');
- const result = await page.evaluate(async () => {
- // eslint-disable-next-line no-undef
- return await window.runTest();
- });
- if (!result) {
- throw new Error('Test failed, expected "window.runTest()" to return true');
+ // Explicit "light"
+ {
+ await await page.emulateMediaFeatures([{
+ name: 'prefers-color-scheme', value: 'light',
+ }]);
+ await page.goto('http://localhost:8080#light');
+ const result = await page.evaluate(async () => {
+ // eslint-disable-next-line no-undef
+ return await window.runTest();
+ });
+ if (!result) {
+ throw new Error('Test failed, expected "window.runTest()" to return true');
+ }
}
- }
- {
- await await page.emulateMediaFeatures([{
- name: 'prefers-color-scheme', value: 'light',
- }]);
- await page.goto('http://localhost:8080/no-polyfill.html#light');
- const result = await page.evaluate(async () => {
- // eslint-disable-next-line no-undef
- return await window.runTest();
- });
- if (!result) {
- throw new Error('Test failed, expected "window.runTest()" to return true');
+ {
+ await await page.emulateMediaFeatures([{
+ name: 'prefers-color-scheme', value: 'light',
+ }]);
+ await page.goto('http://localhost:8080/no-polyfill.html#light');
+ const result = await page.evaluate(async () => {
+ // eslint-disable-next-line no-undef
+ return await window.runTest();
+ });
+ if (!result) {
+ throw new Error('Test failed, expected "window.runTest()" to return true');
+ }
}
- }
+ } finally {
+ await browser.close();
- await browser.close();
-
- await cleanup();
+ await cleanup();
+ }
});
} else {
startServers();
diff --git a/plugins/css-prefers-color-scheme/test/_import.mjs b/plugins/css-prefers-color-scheme/test/_import.mjs
index bf05e2692..a78159c1a 100644
--- a/plugins/css-prefers-color-scheme/test/_import.mjs
+++ b/plugins/css-prefers-color-scheme/test/_import.mjs
@@ -1,4 +1,4 @@
-import assert from 'assert';
+import assert from 'node:assert';
import plugin from 'css-prefers-color-scheme';
plugin();
diff --git a/plugins/postcss-attribute-case-insensitive/CHANGELOG.md b/plugins/postcss-attribute-case-insensitive/CHANGELOG.md
index d666cba7e..c42baaf27 100644
--- a/plugins/postcss-attribute-case-insensitive/CHANGELOG.md
+++ b/plugins/postcss-attribute-case-insensitive/CHANGELOG.md
@@ -1,5 +1,9 @@
# Changes to PostCSS Attribute Case Insensitive
+### Unreleased (major)
+
+- Updated: Support for Node v18+ (major).
+
### 6.0.3
_February 19, 2024_
diff --git a/plugins/postcss-attribute-case-insensitive/package.json b/plugins/postcss-attribute-case-insensitive/package.json
index 878c51420..b19a44831 100644
--- a/plugins/postcss-attribute-case-insensitive/package.json
+++ b/plugins/postcss-attribute-case-insensitive/package.json
@@ -28,7 +28,7 @@
}
],
"engines": {
- "node": "^14 || ^16 || >=18"
+ "node": ">=18"
},
"type": "module",
"main": "dist/index.cjs",
diff --git a/plugins/postcss-attribute-case-insensitive/test/_import.mjs b/plugins/postcss-attribute-case-insensitive/test/_import.mjs
index 09fb76c62..3cf193ab9 100644
--- a/plugins/postcss-attribute-case-insensitive/test/_import.mjs
+++ b/plugins/postcss-attribute-case-insensitive/test/_import.mjs
@@ -1,4 +1,4 @@
-import assert from 'assert';
+import assert from 'node:assert';
import plugin from 'postcss-attribute-case-insensitive';
plugin();
diff --git a/plugins/postcss-base-plugin/CHANGELOG.md b/plugins/postcss-base-plugin/CHANGELOG.md
index 2475e1207..d7f9c4a81 100644
--- a/plugins/postcss-base-plugin/CHANGELOG.md
+++ b/plugins/postcss-base-plugin/CHANGELOG.md
@@ -1 +1,5 @@
# Changes to PostCSS Base Plugin
+
+### Unreleased (major)
+
+- Updated: Support for Node v18+ (major).
diff --git a/plugins/postcss-base-plugin/package.json b/plugins/postcss-base-plugin/package.json
index e788fe65d..c54922d99 100644
--- a/plugins/postcss-base-plugin/package.json
+++ b/plugins/postcss-base-plugin/package.json
@@ -26,7 +26,7 @@
],
"private": true,
"engines": {
- "node": "^14 || ^16 || >=18"
+ "node": ">=18"
},
"type": "module",
"main": "dist/index.cjs",
diff --git a/plugins/postcss-browser-comments/CHANGELOG.md b/plugins/postcss-browser-comments/CHANGELOG.md
index 60b031c3b..deeafe1d4 100644
--- a/plugins/postcss-browser-comments/CHANGELOG.md
+++ b/plugins/postcss-browser-comments/CHANGELOG.md
@@ -1,5 +1,9 @@
# Changes to PostCSS Browser Comments
+### Unreleased (major)
+
+- Updated: Support for Node v18+ (major).
+
### 5.0.0
_May 12, 2024_
diff --git a/plugins/postcss-browser-comments/package.json b/plugins/postcss-browser-comments/package.json
index bb038d934..e7e4515da 100644
--- a/plugins/postcss-browser-comments/package.json
+++ b/plugins/postcss-browser-comments/package.json
@@ -29,7 +29,7 @@
}
],
"engines": {
- "node": "^14 || ^16 || >=18"
+ "node": ">=18"
},
"type": "module",
"main": "dist/index.cjs",
diff --git a/plugins/postcss-cascade-layers/CHANGELOG.md b/plugins/postcss-cascade-layers/CHANGELOG.md
index 398f90a0c..385690981 100644
--- a/plugins/postcss-cascade-layers/CHANGELOG.md
+++ b/plugins/postcss-cascade-layers/CHANGELOG.md
@@ -1,5 +1,9 @@
# Changes to PostCSS Cascade Layers
+### Unreleased (major)
+
+- Updated: Support for Node v18+ (major).
+
### 4.0.6
_May 13, 2024_
diff --git a/plugins/postcss-cascade-layers/package.json b/plugins/postcss-cascade-layers/package.json
index 3d2fee815..d0470ee21 100644
--- a/plugins/postcss-cascade-layers/package.json
+++ b/plugins/postcss-cascade-layers/package.json
@@ -33,7 +33,7 @@
}
],
"engines": {
- "node": "^14 || ^16 || >=18"
+ "node": ">=18"
},
"type": "module",
"main": "dist/index.cjs",
diff --git a/plugins/postcss-cascade-layers/src/record-layer-order.ts b/plugins/postcss-cascade-layers/src/record-layer-order.ts
index 98e454738..669688984 100644
--- a/plugins/postcss-cascade-layers/src/record-layer-order.ts
+++ b/plugins/postcss-cascade-layers/src/record-layer-order.ts
@@ -3,7 +3,7 @@ import { ANONYMOUS_LAYER_SUFFIX, IMPLICIT_LAYER_SUFFIX } from './constants';
import { getConditionalAtRuleAncestor } from './get-conditional-atrule-ancestor';
import { isProcessableLayerRule } from './is-processable-layer-rule';
import type { Model } from './model';
-import { pluginOptions } from './options';
+import type { pluginOptions } from './options';
export function recordLayerOrder(root: Container, model: Model, { result, options }: { result: Result, options: pluginOptions }): void {
// record layer order
diff --git a/plugins/postcss-cascade-layers/test/_browser.mjs b/plugins/postcss-cascade-layers/test/_browser.mjs
index 9380660cc..6a80c40d6 100644
--- a/plugins/postcss-cascade-layers/test/_browser.mjs
+++ b/plugins/postcss-cascade-layers/test/_browser.mjs
@@ -1,6 +1,6 @@
import puppeteer from 'puppeteer';
-import http from 'http';
-import { promises as fsp } from 'fs';
+import http from 'node:http';
+import fs from 'node:fs/promises';
import plugin from '@csstools/postcss-cascade-layers';
import postcss from 'postcss';
import test from 'node:test';
@@ -49,7 +49,7 @@ const requestListener = async function (req, res) {
case '/wpt/layer-vs-inline-style.html':
res.setHeader('Content-type', 'text/html');
res.writeHead(200);
- res.end(await fsp.readFile('test' + pathname, 'utf8'));
+ res.end(await fs.readFile('test' + pathname, 'utf8'));
break;
case '/test/styles.css':
if (req.method === 'POST') {
@@ -101,34 +101,36 @@ if (!process.env.DEBUG) {
headless: 'new',
});
- const page = await browser.newPage();
- page.on('pageerror', (msg) => {
- throw msg;
- });
-
- for (const url of [
- 'wpt/layer-basic.html',
- 'wpt/layer-buckets.html',
- 'wpt/layer-counter-style-override.html',
- 'wpt/layer-important.html',
- 'wpt/layer-keyframes-override.html',
- 'wpt/layer-media-query.html',
- 'wpt/layer-property-override.html',
- 'wpt/layer-vs-inline-style.html',
- ]) {
- await page.goto('http://localhost:8080/' + url);
- const result = await page.evaluate(async () => {
- // eslint-disable-next-line no-undef
- return await window.runTest();
+ try {
+ const page = await browser.newPage();
+ page.on('pageerror', (msg) => {
+ throw msg;
});
- if (!result) {
- throw new Error('Test failed, expected "window.runTest()" to return true');
- }
- }
- await browser.close();
+ for (const url of [
+ 'wpt/layer-basic.html',
+ 'wpt/layer-buckets.html',
+ 'wpt/layer-counter-style-override.html',
+ 'wpt/layer-important.html',
+ 'wpt/layer-keyframes-override.html',
+ 'wpt/layer-media-query.html',
+ 'wpt/layer-property-override.html',
+ 'wpt/layer-vs-inline-style.html',
+ ]) {
+ await page.goto('http://localhost:8080/' + url);
+ const result = await page.evaluate(async () => {
+ // eslint-disable-next-line no-undef
+ return await window.runTest();
+ });
+ if (!result) {
+ throw new Error('Test failed, expected "window.runTest()" to return true');
+ }
+ }
+ } finally {
+ await browser.close();
- await cleanup();
+ await cleanup();
+ }
});
} else {
startServers();
diff --git a/plugins/postcss-cascade-layers/test/_import.mjs b/plugins/postcss-cascade-layers/test/_import.mjs
index 34ff16211..0c561c90d 100644
--- a/plugins/postcss-cascade-layers/test/_import.mjs
+++ b/plugins/postcss-cascade-layers/test/_import.mjs
@@ -1,4 +1,4 @@
-import assert from 'assert';
+import assert from 'node:assert';
import plugin from '@csstools/postcss-cascade-layers';
plugin();
diff --git a/plugins/postcss-cascade-layers/test/wpt/layer-counter-style-override.html b/plugins/postcss-cascade-layers/test/wpt/layer-counter-style-override.html
index e4157c53f..0e44e4e75 100644
--- a/plugins/postcss-cascade-layers/test/wpt/layer-counter-style-override.html
+++ b/plugins/postcss-cascade-layers/test/wpt/layer-counter-style-override.html
@@ -140,25 +140,22 @@
for (let testCase of testCases) {
var documentStyle = document.createElement('style');
+ var appendedStyle = document.createElement('style');
const testCaseStyle = await (fetch(`/test/styles.css`, {
method: 'POST',
body: testCase['style'],
}).then((response) => response.text()));
+ const testCaseAppend = await (fetch(`/test/styles.css`, {
+ method: 'POST',
+ body: testCase['style'] + "\n" + (testCase['append'] ?? ''),
+ }).then((response) => response.text()));
+
documentStyle.appendChild(document.createTextNode(testCaseStyle));
document.head.appendChild(documentStyle);
- var appendedStyle;
if (testCase['append']) {
- document.body.offsetLeft; // Force style update
- appendedStyle = document.createElement('style');
-
- const testCaseAppend= await (fetch(`/test/styles.css`, {
- method: 'POST',
- body: testCase['style'] + "\n" + testCase['append'],
- }).then((response) => response.text()));
-
appendedStyle.appendChild(document.createTextNode(testCaseAppend));
document.head.appendChild(appendedStyle);
}
@@ -169,10 +166,7 @@
testCase.title + ': width'
);
- if (appendedStyle) {
- appendedStyle.remove();
- }
-
+ appendedStyle.remove();
documentStyle.remove();
}
diff --git a/plugins/postcss-color-function/CHANGELOG.md b/plugins/postcss-color-function/CHANGELOG.md
index 85e6fdb1a..a1e3bceb5 100644
--- a/plugins/postcss-color-function/CHANGELOG.md
+++ b/plugins/postcss-color-function/CHANGELOG.md
@@ -1,7 +1,8 @@
# Changes to PostCSS Color Function
-### Unreleased (patch)
+### Unreleased (major)
+- Updated: Support for Node v18+ (major).
- Updated [`@csstools/css-color-parser`](https://github.com/csstools/postcss-plugins/tree/main/packages/css-color-parser) to [`2.0.5`](https://github.com/csstools/postcss-plugins/tree/main/packages/css-color-parser/CHANGELOG.md#205) (patch)
### 3.0.19
diff --git a/plugins/postcss-color-function/package.json b/plugins/postcss-color-function/package.json
index c9dc49881..e00a3a8c2 100644
--- a/plugins/postcss-color-function/package.json
+++ b/plugins/postcss-color-function/package.json
@@ -15,7 +15,7 @@
}
],
"engines": {
- "node": "^14 || ^16 || >=18"
+ "node": ">=18"
},
"type": "module",
"main": "dist/index.cjs",
diff --git a/plugins/postcss-color-function/test/_import.mjs b/plugins/postcss-color-function/test/_import.mjs
index ba9c41a10..af2816dd8 100644
--- a/plugins/postcss-color-function/test/_import.mjs
+++ b/plugins/postcss-color-function/test/_import.mjs
@@ -1,4 +1,4 @@
-import assert from 'assert';
+import assert from 'node:assert';
import plugin from '@csstools/postcss-color-function';
plugin();
diff --git a/plugins/postcss-color-functional-notation/CHANGELOG.md b/plugins/postcss-color-functional-notation/CHANGELOG.md
index b93d7f4c3..3192043e8 100644
--- a/plugins/postcss-color-functional-notation/CHANGELOG.md
+++ b/plugins/postcss-color-functional-notation/CHANGELOG.md
@@ -1,7 +1,8 @@
# Changes to PostCSS Color Functional Notation
-### Unreleased (patch)
+### Unreleased (major)
+- Updated: Support for Node v18+ (major).
- Updated [`@csstools/css-color-parser`](https://github.com/csstools/postcss-plugins/tree/main/packages/css-color-parser) to [`2.0.5`](https://github.com/csstools/postcss-plugins/tree/main/packages/css-color-parser/CHANGELOG.md#205) (patch)
### 6.0.14
diff --git a/plugins/postcss-color-functional-notation/package.json b/plugins/postcss-color-functional-notation/package.json
index 5c0a6e00c..aa81406b1 100644
--- a/plugins/postcss-color-functional-notation/package.json
+++ b/plugins/postcss-color-functional-notation/package.json
@@ -15,7 +15,7 @@
}
],
"engines": {
- "node": "^14 || ^16 || >=18"
+ "node": ">=18"
},
"type": "module",
"main": "dist/index.cjs",
diff --git a/plugins/postcss-color-functional-notation/test/_import.mjs b/plugins/postcss-color-functional-notation/test/_import.mjs
index 527ae1736..cdf3c7d0e 100644
--- a/plugins/postcss-color-functional-notation/test/_import.mjs
+++ b/plugins/postcss-color-functional-notation/test/_import.mjs
@@ -1,4 +1,4 @@
-import assert from 'assert';
+import assert from 'node:assert';
import plugin from 'postcss-color-functional-notation';
plugin();
diff --git a/plugins/postcss-color-hex-alpha/CHANGELOG.md b/plugins/postcss-color-hex-alpha/CHANGELOG.md
index 484993acb..b441abcca 100644
--- a/plugins/postcss-color-hex-alpha/CHANGELOG.md
+++ b/plugins/postcss-color-hex-alpha/CHANGELOG.md
@@ -1,5 +1,9 @@
# Changes to PostCSS Color Hex Alpha
+### Unreleased (major)
+
+- Updated: Support for Node v18+ (major).
+
### 9.0.4
_February 19, 2024_
diff --git a/plugins/postcss-color-hex-alpha/package.json b/plugins/postcss-color-hex-alpha/package.json
index 2b9aa3f5f..8ad7f6f74 100644
--- a/plugins/postcss-color-hex-alpha/package.json
+++ b/plugins/postcss-color-hex-alpha/package.json
@@ -32,7 +32,7 @@
}
],
"engines": {
- "node": "^14 || ^16 || >=18"
+ "node": ">=18"
},
"type": "module",
"main": "dist/index.cjs",
diff --git a/plugins/postcss-color-hex-alpha/test/_import.mjs b/plugins/postcss-color-hex-alpha/test/_import.mjs
index 088475f66..226ae73f8 100644
--- a/plugins/postcss-color-hex-alpha/test/_import.mjs
+++ b/plugins/postcss-color-hex-alpha/test/_import.mjs
@@ -1,4 +1,4 @@
-import assert from 'assert';
+import assert from 'node:assert';
import plugin from 'postcss-color-hex-alpha';
plugin();
diff --git a/plugins/postcss-color-mix-function/CHANGELOG.md b/plugins/postcss-color-mix-function/CHANGELOG.md
index 629d5af16..7a463ebf4 100644
--- a/plugins/postcss-color-mix-function/CHANGELOG.md
+++ b/plugins/postcss-color-mix-function/CHANGELOG.md
@@ -1,7 +1,8 @@
# Changes to PostCSS Color Mix Function
-### Unreleased (patch)
+### Unreleased (major)
+- Updated: Support for Node v18+ (major).
- Updated [`@csstools/css-color-parser`](https://github.com/csstools/postcss-plugins/tree/main/packages/css-color-parser) to [`2.0.5`](https://github.com/csstools/postcss-plugins/tree/main/packages/css-color-parser/CHANGELOG.md#205) (patch)
### 2.0.19
diff --git a/plugins/postcss-color-mix-function/package.json b/plugins/postcss-color-mix-function/package.json
index cf304878e..55c1e3867 100644
--- a/plugins/postcss-color-mix-function/package.json
+++ b/plugins/postcss-color-mix-function/package.json
@@ -25,7 +25,7 @@
}
],
"engines": {
- "node": "^14 || ^16 || >=18"
+ "node": ">=18"
},
"type": "module",
"main": "dist/index.cjs",
diff --git a/plugins/postcss-color-mix-function/test/_import.mjs b/plugins/postcss-color-mix-function/test/_import.mjs
index e0c65b3a6..a8e46ef1c 100644
--- a/plugins/postcss-color-mix-function/test/_import.mjs
+++ b/plugins/postcss-color-mix-function/test/_import.mjs
@@ -1,4 +1,4 @@
-import assert from 'assert';
+import assert from 'node:assert';
import plugin from '@csstools/postcss-color-mix-function';
plugin();
diff --git a/plugins/postcss-color-rebeccapurple/CHANGELOG.md b/plugins/postcss-color-rebeccapurple/CHANGELOG.md
index 47041f10f..93007f61f 100644
--- a/plugins/postcss-color-rebeccapurple/CHANGELOG.md
+++ b/plugins/postcss-color-rebeccapurple/CHANGELOG.md
@@ -1,5 +1,9 @@
# Changes to PostCSS RebeccaPurple
+### Unreleased (major)
+
+- Updated: Support for Node v18+ (major).
+
### 9.0.3
_February 19, 2024_
diff --git a/plugins/postcss-color-rebeccapurple/package.json b/plugins/postcss-color-rebeccapurple/package.json
index 7ae5f263e..9acda859a 100644
--- a/plugins/postcss-color-rebeccapurple/package.json
+++ b/plugins/postcss-color-rebeccapurple/package.json
@@ -32,7 +32,7 @@
}
],
"engines": {
- "node": "^14 || ^16 || >=18"
+ "node": ">=18"
},
"type": "module",
"main": "dist/index.cjs",
diff --git a/plugins/postcss-color-rebeccapurple/test/_import.mjs b/plugins/postcss-color-rebeccapurple/test/_import.mjs
index f9335459e..6ddb3d99c 100644
--- a/plugins/postcss-color-rebeccapurple/test/_import.mjs
+++ b/plugins/postcss-color-rebeccapurple/test/_import.mjs
@@ -1,4 +1,4 @@
-import assert from 'assert';
+import assert from 'node:assert';
import plugin from 'postcss-color-rebeccapurple';
plugin();
diff --git a/plugins/postcss-conditional-values/CHANGELOG.md b/plugins/postcss-conditional-values/CHANGELOG.md
index 0d6839e48..1239df68b 100644
--- a/plugins/postcss-conditional-values/CHANGELOG.md
+++ b/plugins/postcss-conditional-values/CHANGELOG.md
@@ -1,5 +1,9 @@
# Changes to PostCSS Conditional Values
+### Unreleased (major)
+
+- Updated: Support for Node v18+ (major).
+
### 3.0.1
_December 15, 2023_
diff --git a/plugins/postcss-conditional-values/package.json b/plugins/postcss-conditional-values/package.json
index 1b2aab2a3..19015c2bd 100644
--- a/plugins/postcss-conditional-values/package.json
+++ b/plugins/postcss-conditional-values/package.json
@@ -25,7 +25,7 @@
}
],
"engines": {
- "node": "^14 || ^16 || >=18"
+ "node": ">=18"
},
"type": "module",
"main": "dist/index.cjs",
diff --git a/plugins/postcss-conditional-values/test/_import.mjs b/plugins/postcss-conditional-values/test/_import.mjs
index 8eb22a1f5..976d2c9cc 100644
--- a/plugins/postcss-conditional-values/test/_import.mjs
+++ b/plugins/postcss-conditional-values/test/_import.mjs
@@ -1,4 +1,4 @@
-import assert from 'assert';
+import assert from 'node:assert';
import plugin from '@csstools/postcss-conditional-values';
plugin();
diff --git a/plugins/postcss-content-alt-text/CHANGELOG.md b/plugins/postcss-content-alt-text/CHANGELOG.md
index fe3bd6034..62690dc7b 100644
--- a/plugins/postcss-content-alt-text/CHANGELOG.md
+++ b/plugins/postcss-content-alt-text/CHANGELOG.md
@@ -1,7 +1,8 @@
# Changes to PostCSS Content Alt Text
-### Unreleased (patch)
+### Unreleased (major)
+- Updated: Support for Node v18+ (major).
- Add specific handling of `content: ">" / "";` as this pattern is used in the same way as `
`, i.e. to represent an item that does not need a text alternative.
### 1.0.0
diff --git a/plugins/postcss-content-alt-text/package.json b/plugins/postcss-content-alt-text/package.json
index 914bc51dc..e93b089c8 100644
--- a/plugins/postcss-content-alt-text/package.json
+++ b/plugins/postcss-content-alt-text/package.json
@@ -25,7 +25,7 @@
}
],
"engines": {
- "node": "^14 || ^16 || >=18"
+ "node": ">=18"
},
"type": "module",
"main": "dist/index.cjs",
diff --git a/plugins/postcss-contrast-color-function/CHANGELOG.md b/plugins/postcss-contrast-color-function/CHANGELOG.md
index b3919fb9a..dafac40f9 100644
--- a/plugins/postcss-contrast-color-function/CHANGELOG.md
+++ b/plugins/postcss-contrast-color-function/CHANGELOG.md
@@ -1,7 +1,8 @@
# Changes to PostCSS Contrast Color Function
-### Unreleased (patch)
+### Unreleased (major)
+- Updated: Support for Node v18+ (major).
- Updated [`@csstools/css-color-parser`](https://github.com/csstools/postcss-plugins/tree/main/packages/css-color-parser) to [`2.0.5`](https://github.com/csstools/postcss-plugins/tree/main/packages/css-color-parser/CHANGELOG.md#205) (patch)
### 1.0.6
diff --git a/plugins/postcss-contrast-color-function/package.json b/plugins/postcss-contrast-color-function/package.json
index a0a980b20..9d69cb06a 100644
--- a/plugins/postcss-contrast-color-function/package.json
+++ b/plugins/postcss-contrast-color-function/package.json
@@ -25,7 +25,7 @@
}
],
"engines": {
- "node": "^14 || ^16 || >=18"
+ "node": ">=18"
},
"type": "module",
"main": "dist/index.cjs",
diff --git a/plugins/postcss-contrast-color-function/src/parse-contrast-color.ts b/plugins/postcss-contrast-color-function/src/parse-contrast-color.ts
index 92dd25f1e..a0e44a24e 100644
--- a/plugins/postcss-contrast-color-function/src/parse-contrast-color.ts
+++ b/plugins/postcss-contrast-color-function/src/parse-contrast-color.ts
@@ -1,4 +1,5 @@
-import { ComponentValue, isCommentNode, isFunctionNode, isTokenNode, isWhitespaceNode } from '@csstools/css-parser-algorithms';
+import type { ComponentValue} from '@csstools/css-parser-algorithms';
+import { isCommentNode, isFunctionNode, isTokenNode, isWhitespaceNode } from '@csstools/css-parser-algorithms';
import { isTokenIdent } from '@csstools/css-tokenizer';
const CONTRAST_COLOR_NAME_REGEX = /^contrast-color$/i;
diff --git a/plugins/postcss-custom-media/CHANGELOG.md b/plugins/postcss-custom-media/CHANGELOG.md
index 0212cb21b..d98fed607 100644
--- a/plugins/postcss-custom-media/CHANGELOG.md
+++ b/plugins/postcss-custom-media/CHANGELOG.md
@@ -1,5 +1,9 @@
# Changes to PostCSS Custom Media
+### Unreleased (major)
+
+- Updated: Support for Node v18+ (major).
+
### 10.0.8
_July 6, 2024_
diff --git a/plugins/postcss-custom-media/package.json b/plugins/postcss-custom-media/package.json
index 9f49035f1..c0ca429b2 100644
--- a/plugins/postcss-custom-media/package.json
+++ b/plugins/postcss-custom-media/package.json
@@ -32,7 +32,7 @@
}
],
"engines": {
- "node": "^14 || ^16 || >=18"
+ "node": ">=18"
},
"type": "module",
"main": "dist/index.cjs",
diff --git a/plugins/postcss-custom-media/src/cascade-layers.ts b/plugins/postcss-custom-media/src/cascade-layers.ts
index cdf95a694..5d042e785 100644
--- a/plugins/postcss-custom-media/src/cascade-layers.ts
+++ b/plugins/postcss-custom-media/src/cascade-layers.ts
@@ -1,5 +1,6 @@
import type { AtRule, Container, Document, Node, Root } from 'postcss';
-import { LayerName, parse as parseCascadeLayerNames, addLayerToModel } from '@csstools/cascade-layer-name-parser';
+import type { LayerName} from '@csstools/cascade-layer-name-parser';
+import { parse as parseCascadeLayerNames, addLayerToModel } from '@csstools/cascade-layer-name-parser';
const implicitLayerNameForCloning = parseCascadeLayerNames('csstools-implicit-layer')[0];
diff --git a/plugins/postcss-custom-media/src/custom-media-from-root.ts b/plugins/postcss-custom-media/src/custom-media-from-root.ts
index 705b23eae..3699c2005 100644
--- a/plugins/postcss-custom-media/src/custom-media-from-root.ts
+++ b/plugins/postcss-custom-media/src/custom-media-from-root.ts
@@ -1,4 +1,4 @@
-import { MediaQuery } from '@csstools/media-query-list-parser';
+import type { MediaQuery } from '@csstools/media-query-list-parser';
import type { ChildNode, Container, Document, Result, Root as PostCSSRoot } from 'postcss';
import { collectCascadeLayerOrder, cascadeLayerNumberForNode } from './cascade-layers';
import { isProcessableCustomMediaRule } from './is-processable-custom-media-rule';
diff --git a/plugins/postcss-custom-media/src/index.ts b/plugins/postcss-custom-media/src/index.ts
index 77d9da9dd..1c79ae449 100644
--- a/plugins/postcss-custom-media/src/index.ts
+++ b/plugins/postcss-custom-media/src/index.ts
@@ -1,4 +1,4 @@
-import { MediaQuery } from '@csstools/media-query-list-parser';
+import type { MediaQuery } from '@csstools/media-query-list-parser';
import type { Plugin, PluginCreator } from 'postcss';
import getCustomMedia from './custom-media-from-root';
import { transformAtMediaListTokens } from './transform-at-media/transform-at-media';
diff --git a/plugins/postcss-custom-media/src/transform-at-media/custom-media.ts b/plugins/postcss-custom-media/src/transform-at-media/custom-media.ts
index dd484af2f..03190a637 100644
--- a/plugins/postcss-custom-media/src/transform-at-media/custom-media.ts
+++ b/plugins/postcss-custom-media/src/transform-at-media/custom-media.ts
@@ -1,5 +1,7 @@
-import { cloneTokens, isTokenWhiteSpaceOrComment, stringify, TokenIdent } from '@csstools/css-tokenizer';
-import { parseFromTokens, MediaQuery } from '@csstools/media-query-list-parser';
+import type { TokenIdent } from '@csstools/css-tokenizer';
+import { cloneTokens, isTokenWhiteSpaceOrComment, stringify } from '@csstools/css-tokenizer';
+import type { MediaQuery } from '@csstools/media-query-list-parser';
+import { parseFromTokens } from '@csstools/media-query-list-parser';
import { atMediaParamsTokens } from '../transform-at-media/at-media-params-tokens';
import { replaceTrueAndFalseTokens } from './true-and-false';
import { isTokenIdent } from '@csstools/css-tokenizer';
diff --git a/plugins/postcss-custom-media/src/transform-at-media/transform-at-media.ts b/plugins/postcss-custom-media/src/transform-at-media/transform-at-media.ts
index d17474d43..a9a096fba 100644
--- a/plugins/postcss-custom-media/src/transform-at-media/transform-at-media.ts
+++ b/plugins/postcss-custom-media/src/transform-at-media/transform-at-media.ts
@@ -1,7 +1,8 @@
import { alwaysTrue, neverTrue } from './always-true-or-false';
-import {
+import type {
MediaFeature,
- MediaQuery,
+ MediaQuery} from '@csstools/media-query-list-parser';
+import {
isGeneralEnclosed,
isMediaAnd,
isMediaConditionList,
diff --git a/plugins/postcss-custom-media/src/transform-at-media/true-and-false.ts b/plugins/postcss-custom-media/src/transform-at-media/true-and-false.ts
index 194a113dc..3bfda0bc8 100644
--- a/plugins/postcss-custom-media/src/transform-at-media/true-and-false.ts
+++ b/plugins/postcss-custom-media/src/transform-at-media/true-and-false.ts
@@ -1,5 +1,5 @@
-import { TokenType, TokenIdent, isTokenWhiteSpaceOrComment } from '@csstools/css-tokenizer';
-import type { CSSToken } from '@csstools/css-tokenizer';
+import { TokenType, isTokenWhiteSpaceOrComment } from '@csstools/css-tokenizer';
+import type { CSSToken , TokenIdent} from '@csstools/css-tokenizer';
import { alwaysTrue, neverTrue } from './always-true-or-false';
import { isTokenIdent } from '@csstools/css-tokenizer';
diff --git a/plugins/postcss-custom-media/test/_import.mjs b/plugins/postcss-custom-media/test/_import.mjs
index e5c94d2ab..178544a06 100644
--- a/plugins/postcss-custom-media/test/_import.mjs
+++ b/plugins/postcss-custom-media/test/_import.mjs
@@ -1,4 +1,4 @@
-import assert from 'assert';
+import assert from 'node:assert';
import plugin from 'postcss-custom-media';
plugin();
diff --git a/plugins/postcss-custom-properties/CHANGELOG.md b/plugins/postcss-custom-properties/CHANGELOG.md
index bb02c5042..b77cb26d5 100644
--- a/plugins/postcss-custom-properties/CHANGELOG.md
+++ b/plugins/postcss-custom-properties/CHANGELOG.md
@@ -1,5 +1,9 @@
# Changes to PostCSS Custom Properties
+### Unreleased (major)
+
+- Updated: Support for Node v18+ (major).
+
### 13.3.12
_July 6, 2024_
diff --git a/plugins/postcss-custom-properties/package.json b/plugins/postcss-custom-properties/package.json
index 99a1697b0..d83489a09 100644
--- a/plugins/postcss-custom-properties/package.json
+++ b/plugins/postcss-custom-properties/package.json
@@ -18,7 +18,7 @@
}
],
"engines": {
- "node": "^14 || ^16 || >=18"
+ "node": ">=18"
},
"type": "module",
"main": "dist/index.cjs",
diff --git a/plugins/postcss-custom-properties/src/cascade-layers.ts b/plugins/postcss-custom-properties/src/cascade-layers.ts
index cdf95a694..5d042e785 100644
--- a/plugins/postcss-custom-properties/src/cascade-layers.ts
+++ b/plugins/postcss-custom-properties/src/cascade-layers.ts
@@ -1,5 +1,6 @@
import type { AtRule, Container, Document, Node, Root } from 'postcss';
-import { LayerName, parse as parseCascadeLayerNames, addLayerToModel } from '@csstools/cascade-layer-name-parser';
+import type { LayerName} from '@csstools/cascade-layer-name-parser';
+import { parse as parseCascadeLayerNames, addLayerToModel } from '@csstools/cascade-layer-name-parser';
const implicitLayerNameForCloning = parseCascadeLayerNames('csstools-implicit-layer')[0];
diff --git a/plugins/postcss-custom-properties/src/get-custom-properties-from-root.ts b/plugins/postcss-custom-properties/src/get-custom-properties-from-root.ts
index 27c8005f1..12d269b3c 100644
--- a/plugins/postcss-custom-properties/src/get-custom-properties-from-root.ts
+++ b/plugins/postcss-custom-properties/src/get-custom-properties-from-root.ts
@@ -1,5 +1,5 @@
import type { Root } from 'postcss';
-import valuesParser from 'postcss-value-parser';
+import type valuesParser from 'postcss-value-parser';
import { cascadeLayerNumberForNode, collectCascadeLayerOrder } from './cascade-layers';
import { isBlockIgnored, isDeclarationIgnored } from './is-ignored';
import { HTML_SELECTOR_REGEX, HTML_WHERE_SELECTOR_REGEX, MAYBE_HTML_OR_ROOT_RULE_REGEX, ROOT_SELECTOR_REGEX, ROOT_WHERE_SELECTOR_REGEX, isProcessableRule } from './is-processable-rule';
diff --git a/plugins/postcss-custom-properties/src/get-custom-properties-from-siblings.ts b/plugins/postcss-custom-properties/src/get-custom-properties-from-siblings.ts
index 2f1dcf3a4..d6a1299ca 100644
--- a/plugins/postcss-custom-properties/src/get-custom-properties-from-siblings.ts
+++ b/plugins/postcss-custom-properties/src/get-custom-properties-from-siblings.ts
@@ -1,5 +1,5 @@
import type { Declaration } from 'postcss';
-import valuesParser from 'postcss-value-parser';
+import type valuesParser from 'postcss-value-parser';
import { buildCustomPropertiesMap } from './build-custom-properties-map';
import { isDeclarationIgnored } from './is-ignored';
diff --git a/plugins/postcss-custom-properties/src/index.ts b/plugins/postcss-custom-properties/src/index.ts
index 6d4caace5..ff5296885 100644
--- a/plugins/postcss-custom-properties/src/index.ts
+++ b/plugins/postcss-custom-properties/src/index.ts
@@ -1,5 +1,5 @@
import type { Node, Plugin, PluginCreator } from 'postcss';
-import valuesParser from 'postcss-value-parser';
+import type valuesParser from 'postcss-value-parser';
import getCustomPropertiesFromRoot from './get-custom-properties-from-root';
import getCustomPropertiesFromSiblings from './get-custom-properties-from-siblings';
diff --git a/plugins/postcss-custom-properties/src/is-initial.ts b/plugins/postcss-custom-properties/src/is-initial.ts
index d3ca3ddfe..d66645da8 100644
--- a/plugins/postcss-custom-properties/src/is-initial.ts
+++ b/plugins/postcss-custom-properties/src/is-initial.ts
@@ -1,4 +1,4 @@
-import valueParser from 'postcss-value-parser';
+import type valueParser from 'postcss-value-parser';
const IS_INITIAL_REGEX = /^initial$/i;
diff --git a/plugins/postcss-custom-properties/src/transform-value-ast.ts b/plugins/postcss-custom-properties/src/transform-value-ast.ts
index 7307c442e..d7ff34040 100644
--- a/plugins/postcss-custom-properties/src/transform-value-ast.ts
+++ b/plugins/postcss-custom-properties/src/transform-value-ast.ts
@@ -1,4 +1,5 @@
-import valuesParser, { Node } from 'postcss-value-parser';
+import type { Node } from 'postcss-value-parser';
+import valuesParser from 'postcss-value-parser';
import { isVarFunction } from './is-var-function';
import { parseVarFunction } from './parse-var-function';
diff --git a/plugins/postcss-custom-properties/test/_import.mjs b/plugins/postcss-custom-properties/test/_import.mjs
index 1992cbec1..8e09acc23 100644
--- a/plugins/postcss-custom-properties/test/_import.mjs
+++ b/plugins/postcss-custom-properties/test/_import.mjs
@@ -1,4 +1,4 @@
-import assert from 'assert';
+import assert from 'node:assert';
import plugin from 'postcss-custom-properties';
plugin();
diff --git a/plugins/postcss-custom-selectors/CHANGELOG.md b/plugins/postcss-custom-selectors/CHANGELOG.md
index fa837986d..fc06ea37d 100644
--- a/plugins/postcss-custom-selectors/CHANGELOG.md
+++ b/plugins/postcss-custom-selectors/CHANGELOG.md
@@ -1,5 +1,9 @@
# Changes to PostCSS Custom Selectors
+### Unreleased (major)
+
+- Updated: Support for Node v18+ (major).
+
### 7.1.12
_July 6, 2024_
diff --git a/plugins/postcss-custom-selectors/package.json b/plugins/postcss-custom-selectors/package.json
index 31184a88e..864bccad8 100644
--- a/plugins/postcss-custom-selectors/package.json
+++ b/plugins/postcss-custom-selectors/package.json
@@ -35,7 +35,7 @@
}
],
"engines": {
- "node": "^14 || ^16 || >=18"
+ "node": ">=18"
},
"type": "module",
"main": "dist/index.cjs",
diff --git a/plugins/postcss-custom-selectors/src/cascade-layers.ts b/plugins/postcss-custom-selectors/src/cascade-layers.ts
index cdf95a694..5d042e785 100644
--- a/plugins/postcss-custom-selectors/src/cascade-layers.ts
+++ b/plugins/postcss-custom-selectors/src/cascade-layers.ts
@@ -1,5 +1,6 @@
import type { AtRule, Container, Document, Node, Root } from 'postcss';
-import { LayerName, parse as parseCascadeLayerNames, addLayerToModel } from '@csstools/cascade-layer-name-parser';
+import type { LayerName} from '@csstools/cascade-layer-name-parser';
+import { parse as parseCascadeLayerNames, addLayerToModel } from '@csstools/cascade-layer-name-parser';
const implicitLayerNameForCloning = parseCascadeLayerNames('csstools-implicit-layer')[0];
diff --git a/plugins/postcss-custom-selectors/test/_import.mjs b/plugins/postcss-custom-selectors/test/_import.mjs
index 714149028..4720b6bb2 100644
--- a/plugins/postcss-custom-selectors/test/_import.mjs
+++ b/plugins/postcss-custom-selectors/test/_import.mjs
@@ -1,4 +1,4 @@
-import assert from 'assert';
+import assert from 'node:assert';
import plugin from 'postcss-custom-selectors';
plugin();
diff --git a/plugins/postcss-debug-logger/CHANGELOG.md b/plugins/postcss-debug-logger/CHANGELOG.md
index e0551b97e..99fe7bb70 100644
--- a/plugins/postcss-debug-logger/CHANGELOG.md
+++ b/plugins/postcss-debug-logger/CHANGELOG.md
@@ -1,5 +1,9 @@
# Changes to PostCSS Debug Logger
+### Unreleased (major)
+
+- Updated: Support for Node v18+ (major).
+
### 2.0.1
_December 15, 2023_
diff --git a/plugins/postcss-debug-logger/dist/index.cjs b/plugins/postcss-debug-logger/dist/index.cjs
index 184cdc937..02ebd7126 100644
--- a/plugins/postcss-debug-logger/dist/index.cjs
+++ b/plugins/postcss-debug-logger/dist/index.cjs
@@ -1 +1 @@
-"use strict";var e=require("path");const creator=()=>{const onceHandler=n=>t=>{let o=t.source?.input?.from;o&&(o=e.relative(process.cwd(),o));let r="";r+=n,r+=`\n index : ${t.parent?.index(t)??"N/A"}`,r+=`\n nodes : ${t.nodes?.length}`,r+=`\n input.from : ${o??"N/A"}`,console.log(r+"\n")},documentHandler=n=>t=>{let o=t.source?.input?.from;o&&(o=e.relative(process.cwd(),o));let r="";r+=n,r+=`\n nodes : ${t.nodes?.length}`,r+=`\n input.from : ${o??"N/A"}`,console.log(r+"\n")},atRuleHandler=n=>t=>{let o=t.source?.input?.from;o&&(o=e.relative(process.cwd(),o));let r="";r+=n,r+=`\n name : ${t.name}`,r+=`\n params : ${t.params}`,r+=`\n index : ${t.parent?.index(t)??"N/A"}`,r+=`\n nodes : ${t.nodes?.length}`,r+=`\n raw : ${JSON.stringify(t.raws)}`,r+=`\n input.from : ${o??"N/A"}`,console.log(r+"\n")},ruleHandler=n=>t=>{let o=t.source?.input?.from;o&&(o=e.relative(process.cwd(),o));let r="";r+=n,r+=`\n selector : ${t.selector}`,r+=`\n index : ${t.parent?.index(t)??"N/A"}`,r+=`\n nodes : ${t.nodes?.length}`,r+=`\n raw : ${JSON.stringify(t.raws)}`,r+=`\n input.from : ${o??"N/A"}`,console.log(r+"\n")},commentHandler=n=>t=>{let o=t.source?.input?.from;o&&(o=e.relative(process.cwd(),o));let r="";r+=n,r+=`\n text : ${t.text}`,r+=`\n index : ${t.parent?.index(t)??"N/A"}`,r+=`\n raw : ${JSON.stringify(t.raws)}`,r+=`\n input.from : ${o??"N/A"}`,console.log(r+"\n")},declHandler=n=>t=>{let o=t.source?.input?.from;o&&(o=e.relative(process.cwd(),o));let r="";r+=n,r+=`\n prop : ${t.prop}`,r+=`\n value : ${t.value}`,r+=`\n index : ${t.parent?.index(t)??"N/A"}`,r+=`\n raw : ${JSON.stringify(t.raws)}`,r+=`\n input.from : ${o??"N/A"}`,console.log(r+"\n")};return{postcssPlugin:"postcss-debug-logger",AtRule:atRuleHandler("AtRule"),AtRuleExit:atRuleHandler("AtRuleExit"),Comment:commentHandler("Comment"),CommentExit:commentHandler("CommentExit"),Declaration:declHandler("Declaration"),DeclarationExit:declHandler("DeclarationExit"),Document:documentHandler("Document"),DocumentExit:documentHandler("DocumentExit"),Once:onceHandler("Once"),OnceExit:onceHandler("OnceExit"),Root:onceHandler("Root"),RootExit:onceHandler("RootExit"),Rule:ruleHandler("Rule"),RuleExit:ruleHandler("RuleExit")}};creator.postcss=!0,module.exports=creator;
+"use strict";var e=require("node:path");const creator=()=>{const onceHandler=n=>t=>{let o=t.source?.input?.from;o&&(o=e.relative(process.cwd(),o));let r="";r+=n,r+=`\n index : ${t.parent?.index(t)??"N/A"}`,r+=`\n nodes : ${t.nodes?.length}`,r+=`\n input.from : ${o??"N/A"}`,console.log(r+"\n")},documentHandler=n=>t=>{let o=t.source?.input?.from;o&&(o=e.relative(process.cwd(),o));let r="";r+=n,r+=`\n nodes : ${t.nodes?.length}`,r+=`\n input.from : ${o??"N/A"}`,console.log(r+"\n")},atRuleHandler=n=>t=>{let o=t.source?.input?.from;o&&(o=e.relative(process.cwd(),o));let r="";r+=n,r+=`\n name : ${t.name}`,r+=`\n params : ${t.params}`,r+=`\n index : ${t.parent?.index(t)??"N/A"}`,r+=`\n nodes : ${t.nodes?.length}`,r+=`\n raw : ${JSON.stringify(t.raws)}`,r+=`\n input.from : ${o??"N/A"}`,console.log(r+"\n")},ruleHandler=n=>t=>{let o=t.source?.input?.from;o&&(o=e.relative(process.cwd(),o));let r="";r+=n,r+=`\n selector : ${t.selector}`,r+=`\n index : ${t.parent?.index(t)??"N/A"}`,r+=`\n nodes : ${t.nodes?.length}`,r+=`\n raw : ${JSON.stringify(t.raws)}`,r+=`\n input.from : ${o??"N/A"}`,console.log(r+"\n")},commentHandler=n=>t=>{let o=t.source?.input?.from;o&&(o=e.relative(process.cwd(),o));let r="";r+=n,r+=`\n text : ${t.text}`,r+=`\n index : ${t.parent?.index(t)??"N/A"}`,r+=`\n raw : ${JSON.stringify(t.raws)}`,r+=`\n input.from : ${o??"N/A"}`,console.log(r+"\n")},declHandler=n=>t=>{let o=t.source?.input?.from;o&&(o=e.relative(process.cwd(),o));let r="";r+=n,r+=`\n prop : ${t.prop}`,r+=`\n value : ${t.value}`,r+=`\n index : ${t.parent?.index(t)??"N/A"}`,r+=`\n raw : ${JSON.stringify(t.raws)}`,r+=`\n input.from : ${o??"N/A"}`,console.log(r+"\n")};return{postcssPlugin:"postcss-debug-logger",AtRule:atRuleHandler("AtRule"),AtRuleExit:atRuleHandler("AtRuleExit"),Comment:commentHandler("Comment"),CommentExit:commentHandler("CommentExit"),Declaration:declHandler("Declaration"),DeclarationExit:declHandler("DeclarationExit"),Document:documentHandler("Document"),DocumentExit:documentHandler("DocumentExit"),Once:onceHandler("Once"),OnceExit:onceHandler("OnceExit"),Root:onceHandler("Root"),RootExit:onceHandler("RootExit"),Rule:ruleHandler("Rule"),RuleExit:ruleHandler("RuleExit")}};creator.postcss=!0,module.exports=creator;
diff --git a/plugins/postcss-debug-logger/dist/index.mjs b/plugins/postcss-debug-logger/dist/index.mjs
index c1eb1b985..9f92ecf6f 100644
--- a/plugins/postcss-debug-logger/dist/index.mjs
+++ b/plugins/postcss-debug-logger/dist/index.mjs
@@ -1 +1 @@
-import e from"path";const creator=()=>{const onceHandler=n=>t=>{let o=t.source?.input?.from;o&&(o=e.relative(process.cwd(),o));let r="";r+=n,r+=`\n index : ${t.parent?.index(t)??"N/A"}`,r+=`\n nodes : ${t.nodes?.length}`,r+=`\n input.from : ${o??"N/A"}`,console.log(r+"\n")},documentHandler=n=>t=>{let o=t.source?.input?.from;o&&(o=e.relative(process.cwd(),o));let r="";r+=n,r+=`\n nodes : ${t.nodes?.length}`,r+=`\n input.from : ${o??"N/A"}`,console.log(r+"\n")},atRuleHandler=n=>t=>{let o=t.source?.input?.from;o&&(o=e.relative(process.cwd(),o));let r="";r+=n,r+=`\n name : ${t.name}`,r+=`\n params : ${t.params}`,r+=`\n index : ${t.parent?.index(t)??"N/A"}`,r+=`\n nodes : ${t.nodes?.length}`,r+=`\n raw : ${JSON.stringify(t.raws)}`,r+=`\n input.from : ${o??"N/A"}`,console.log(r+"\n")},ruleHandler=n=>t=>{let o=t.source?.input?.from;o&&(o=e.relative(process.cwd(),o));let r="";r+=n,r+=`\n selector : ${t.selector}`,r+=`\n index : ${t.parent?.index(t)??"N/A"}`,r+=`\n nodes : ${t.nodes?.length}`,r+=`\n raw : ${JSON.stringify(t.raws)}`,r+=`\n input.from : ${o??"N/A"}`,console.log(r+"\n")},commentHandler=n=>t=>{let o=t.source?.input?.from;o&&(o=e.relative(process.cwd(),o));let r="";r+=n,r+=`\n text : ${t.text}`,r+=`\n index : ${t.parent?.index(t)??"N/A"}`,r+=`\n raw : ${JSON.stringify(t.raws)}`,r+=`\n input.from : ${o??"N/A"}`,console.log(r+"\n")},declHandler=n=>t=>{let o=t.source?.input?.from;o&&(o=e.relative(process.cwd(),o));let r="";r+=n,r+=`\n prop : ${t.prop}`,r+=`\n value : ${t.value}`,r+=`\n index : ${t.parent?.index(t)??"N/A"}`,r+=`\n raw : ${JSON.stringify(t.raws)}`,r+=`\n input.from : ${o??"N/A"}`,console.log(r+"\n")};return{postcssPlugin:"postcss-debug-logger",AtRule:atRuleHandler("AtRule"),AtRuleExit:atRuleHandler("AtRuleExit"),Comment:commentHandler("Comment"),CommentExit:commentHandler("CommentExit"),Declaration:declHandler("Declaration"),DeclarationExit:declHandler("DeclarationExit"),Document:documentHandler("Document"),DocumentExit:documentHandler("DocumentExit"),Once:onceHandler("Once"),OnceExit:onceHandler("OnceExit"),Root:onceHandler("Root"),RootExit:onceHandler("RootExit"),Rule:ruleHandler("Rule"),RuleExit:ruleHandler("RuleExit")}};creator.postcss=!0;export{creator as default};
+import e from"node:path";const creator=()=>{const onceHandler=n=>t=>{let o=t.source?.input?.from;o&&(o=e.relative(process.cwd(),o));let r="";r+=n,r+=`\n index : ${t.parent?.index(t)??"N/A"}`,r+=`\n nodes : ${t.nodes?.length}`,r+=`\n input.from : ${o??"N/A"}`,console.log(r+"\n")},documentHandler=n=>t=>{let o=t.source?.input?.from;o&&(o=e.relative(process.cwd(),o));let r="";r+=n,r+=`\n nodes : ${t.nodes?.length}`,r+=`\n input.from : ${o??"N/A"}`,console.log(r+"\n")},atRuleHandler=n=>t=>{let o=t.source?.input?.from;o&&(o=e.relative(process.cwd(),o));let r="";r+=n,r+=`\n name : ${t.name}`,r+=`\n params : ${t.params}`,r+=`\n index : ${t.parent?.index(t)??"N/A"}`,r+=`\n nodes : ${t.nodes?.length}`,r+=`\n raw : ${JSON.stringify(t.raws)}`,r+=`\n input.from : ${o??"N/A"}`,console.log(r+"\n")},ruleHandler=n=>t=>{let o=t.source?.input?.from;o&&(o=e.relative(process.cwd(),o));let r="";r+=n,r+=`\n selector : ${t.selector}`,r+=`\n index : ${t.parent?.index(t)??"N/A"}`,r+=`\n nodes : ${t.nodes?.length}`,r+=`\n raw : ${JSON.stringify(t.raws)}`,r+=`\n input.from : ${o??"N/A"}`,console.log(r+"\n")},commentHandler=n=>t=>{let o=t.source?.input?.from;o&&(o=e.relative(process.cwd(),o));let r="";r+=n,r+=`\n text : ${t.text}`,r+=`\n index : ${t.parent?.index(t)??"N/A"}`,r+=`\n raw : ${JSON.stringify(t.raws)}`,r+=`\n input.from : ${o??"N/A"}`,console.log(r+"\n")},declHandler=n=>t=>{let o=t.source?.input?.from;o&&(o=e.relative(process.cwd(),o));let r="";r+=n,r+=`\n prop : ${t.prop}`,r+=`\n value : ${t.value}`,r+=`\n index : ${t.parent?.index(t)??"N/A"}`,r+=`\n raw : ${JSON.stringify(t.raws)}`,r+=`\n input.from : ${o??"N/A"}`,console.log(r+"\n")};return{postcssPlugin:"postcss-debug-logger",AtRule:atRuleHandler("AtRule"),AtRuleExit:atRuleHandler("AtRuleExit"),Comment:commentHandler("Comment"),CommentExit:commentHandler("CommentExit"),Declaration:declHandler("Declaration"),DeclarationExit:declHandler("DeclarationExit"),Document:documentHandler("Document"),DocumentExit:documentHandler("DocumentExit"),Once:onceHandler("Once"),OnceExit:onceHandler("OnceExit"),Root:onceHandler("Root"),RootExit:onceHandler("RootExit"),Rule:ruleHandler("Rule"),RuleExit:ruleHandler("RuleExit")}};creator.postcss=!0;export{creator as default};
diff --git a/plugins/postcss-debug-logger/package.json b/plugins/postcss-debug-logger/package.json
index 8512f8cc1..e7ae123cf 100644
--- a/plugins/postcss-debug-logger/package.json
+++ b/plugins/postcss-debug-logger/package.json
@@ -25,7 +25,7 @@
}
],
"engines": {
- "node": "^14 || ^16 || >=18"
+ "node": ">=18"
},
"type": "module",
"main": "dist/index.cjs",
diff --git a/plugins/postcss-debug-logger/src/index.ts b/plugins/postcss-debug-logger/src/index.ts
index a1dc24bf8..5f1739b49 100644
--- a/plugins/postcss-debug-logger/src/index.ts
+++ b/plugins/postcss-debug-logger/src/index.ts
@@ -1,5 +1,5 @@
import type { AtRule, Comment, Declaration, Document, PluginCreator, Root, Rule } from 'postcss';
-import path from 'path';
+import path from 'node:path';
const creator: PluginCreator = () => {
diff --git a/plugins/postcss-debug-logger/test/_import.mjs b/plugins/postcss-debug-logger/test/_import.mjs
index 0a8325c1c..bb4157b59 100644
--- a/plugins/postcss-debug-logger/test/_import.mjs
+++ b/plugins/postcss-debug-logger/test/_import.mjs
@@ -1,4 +1,4 @@
-import assert from 'assert';
+import assert from 'node:assert';
import plugin from '@csstools/postcss-debug-logger';
plugin();
diff --git a/plugins/postcss-design-tokens/CHANGELOG.md b/plugins/postcss-design-tokens/CHANGELOG.md
index e233dbb13..98f607e35 100644
--- a/plugins/postcss-design-tokens/CHANGELOG.md
+++ b/plugins/postcss-design-tokens/CHANGELOG.md
@@ -1,5 +1,9 @@
# Changes to PostCSS Design Tokens
+### Unreleased (major)
+
+- Updated: Support for Node v18+ (major).
+
### 3.1.9
_July 6, 2024_
diff --git a/plugins/postcss-design-tokens/dist/index.cjs b/plugins/postcss-design-tokens/dist/index.cjs
index 3c9768994..fef4f7ace 100644
--- a/plugins/postcss-design-tokens/dist/index.cjs
+++ b/plugins/postcss-design-tokens/dist/index.cjs
@@ -1 +1 @@
-"use strict";var e=require("postcss-value-parser"),t=require("path"),n=require("fs"),r=require("module"),o=require("@csstools/css-parser-algorithms"),s=require("@csstools/css-tokenizer");function toposort(e,t){let n=e.length;const r=new Array(n),o={};let s=n;const a=makeOutgoingEdges(t),i=makeNodesHash(e);for(t.forEach((function(e){if(!i.has(e[0])||!i.has(e[1]))throw new Error("Unknown token. Make sure to provide all tokens used in aliases.")}));s--;)o[s]||visit(e[s],s,new Set);return r;function visit(e,t,s){if(s.has(e)){let t;try{t=", token was: "+JSON.stringify(e)}catch{t=""}throw new Error("Cyclic dependency"+t)}if(!i.has(e))throw new Error("Found unknown token. Make sure to provided all involved tokens. Unknown token: "+JSON.stringify(e));if(o[t])return;o[t]=!0;const u=Array.from(a.get(e)||new Set);if(t=u.length){s.add(e);do{const e=u[--t];visit(e,i.get(e),s)}while(t);s.delete(e)}r[--n]=e}}function makeOutgoingEdges(e){const t=new Map;for(let n=0,r=e.length;napplyTransformsToValue(o,e),name:String(e.name??"")||t,comment:String(e.comment??"")||void 0,metadata:{name:String(e.name??"")?t:void 0,path:[...n,t],filePath:r,isSource:!0}}}const a=new Map;function applyTransformsToValue(t,n){if(!t)return"";if(!n)return t;if(!n.toUnit)return t;const r=e.unit(t);if(!r||r.unit===n.toUnit)return t;if(!r.unit){if(a.has(n.toUnit)){if(a.get(n.toUnit))return`${t}${n.toUnit}`;throw new Error(`Invalid unit "${n.toUnit}" for "${t}"`)}try{const r=e.unit(`${t}${n.toUnit}`);if(r&&r.unit===n.toUnit)return a.set(n.toUnit,!0),`${t}${n.toUnit}`;a.set(n.toUnit,!1)}catch{a.set(n.toUnit,!1)}throw new Error(`Invalid unit "${n.toUnit}" for "${t}"`)}return"rem"===r.unit&&"px"===n.toUnit?remToPx(parseFloat(r.number),n.pluginOptions?.rootFontSize??16):"px"===r.unit&&"rem"===n.toUnit?pxToRem(parseFloat(r.number),n.pluginOptions?.rootFontSize??16):t}function remToPx(e,t){return`${formatFloat(e*t)}px`}function pxToRem(e,t){return`${formatFloat(e/t)}rem`}function formatFloat(e){if(Number.isInteger(e))return e.toString();let t=e.toFixed(5);for(let e=t.length-1;e>=0&&"."!==t[e]&&"0"===t[e];e--)t=t.slice(0,e);return t}function dereferenceTokenValues(e){const t=new Set,n=new Map;for(const[r,o]of e.entries()){const e=parseReferences(o.value);e.length&&(t.add(r),n.set(r,e))}for(const[r,o]of n.entries()){for(let n=0;n"value-reference"===e.type)))continue;const s=o.map((e=>e.value)).join(""),a=e.get(r);a.value=s,a.cssValue=e=>applyTransformsToValue(s,e),e.set(r,a),t.delete(r),n.delete(r)}if(0===t.size)return e;{const r=Array.from(e.keys()),o=[];for(const[e,t]of n.entries())for(let n=0;n"value-reference"===e.type)))throw new Error('Token "'+r+'" can not be fully resolved');const s=o.map((e=>e.value)).join(""),a=e.get(r);a.value=s,a.cssValue=e=>applyTransformsToValue(s,e),e.set(r,a),t.delete(r),n.delete(r)}if(0===t.size)return e}return e}function parseReferences(e){if("string"!=typeof e)return[];if(-1===e.indexOf("{"))return[];const t=[];let n=!1,r=!1,o="";for(let s=0;s0&&(t.push({type:"value-non-reference",value:o}),o=""),r=!0;break;case"}":if(!r)throw new Error('Unexpected "}" in "'+e+'" at '+s);if(0===o.length)throw new Error('Empty alias "{}" in "'+e+'" at '+s);{let e=o.trim();".value"===e.slice(-6)&&(e=e.slice(0,-6)),t.push({type:"value-reference",raw:e}),o=""}n=!0,r=!1;break;default:o+=a}}if(r)throw new Error('Unexpected end of alias in "'+e+'"');return o.length>0&&t.push({type:"value-non-reference",value:o}),n?t:[]}function isTokenGroup(e){return"object"==typeof e&&null!==e&&void 0===e.value}function extractTokens(e,t,n){const r=new Map;for(const o in e)if(Object.hasOwnProperty.call(e,o)){if(null===e[o]||"object"!=typeof e[o]||Array.isArray(e[o]))throw new Error(`Parsing error at "${[...t,o].join(".")}"`);const s=e[o];if(!s)throw new Error(`Parsing error at "${[...t,o].join(".")}"`);if(!isTokenGroup(s)){const e=extractStyleDictionaryV3Token(s,o,t,n);r.set(e.metadata.path.join("."),e);continue}for(const[e,a]of extractTokens(s,[...t,o],n).entries())r.set(e,a)}return r}function extractStyleDictionaryV3Tokens(e,t){return dereferenceTokenValues(extractTokens(e,[],t))}function extractStyleDictionaryTokens(e,t,n){return extractStyleDictionaryV3Tokens(t,n)}const i="6b4e71e7-4787-42f7-a092-8684961895db";function parseImport(t){const n=e(t),r={filePath:"",format:"standard",conditions:[i]};return n.walk((e=>{"function"===e.type&&"url"===e.value&&(r.filePath=e.nodes[0].value),"function"===e.type&&"format"===e.value&&(r.format=e.nodes[0].value),"function"===e.type&&"when"===e.value&&(r.conditions=e.nodes.filter((e=>"string"===e.type)).map((e=>e.value)))})),r.conditions.length||(r.conditions=[i]),r}async function tokensFromImport(e,o,s,a,i,u){const{filePath:l,format:c,conditions:f}=parseImport(i);if(!f.every((e=>s.includes(e))))return!1;let p="";try{if(l.startsWith("node_modules://")){p=r.createRequire(t.dirname(a)).resolve(l.slice(15))}else if(l.startsWith("node_modules:")){p=r.createRequire(t.dirname(a)).resolve(l.slice(13))}else p=t.resolve(t.dirname(a),l)}catch(e){throw new Error(`Failed to read ${l} with error ${e instanceof Error?e.message:e}`)}if(u.has(p))return!1;o.result.messages.push({type:"dependency",plugin:"postcss-design-tokens",file:p,parent:e.source?.input?.file}),u.add(p);const d=await n.promises.readFile(p,"utf8"),m=JSON.parse(d);if("style-dictionary3"===c)return{filePath:t.resolve(l),tokens:extractStyleDictionaryTokens(0,m,p)};throw new Error("Unsupported format: "+c)}function mergeTokens(e,t){const n=new Map(e);for(const[e,r]of t)n.set(e,r);return n}function parsePluginOptions(e){const t={importAtRuleName:"design-tokens",is:[i],unitsAndValues:{rootFontSize:16},valueFunctionName:"design-token"};return e?("object"!=typeof e||(Array.isArray(e.is)&&(t.is=e.is.filter((e=>"string"==typeof e))),0===t.is.length&&(t.is=[i]),"object"==typeof e.unitsAndValues&&"number"==typeof e.unitsAndValues.rootFontSize&&((n=e.unitsAndValues.rootFontSize)>0&&n!==1/0)&&(t.unitsAndValues.rootFontSize=e.unitsAndValues.rootFontSize),"string"==typeof e.valueFunctionName&&(t.valueFunctionName=e.valueFunctionName),"string"==typeof e.importAtRuleName&&(t.importAtRuleName=e.importAtRuleName)),t):t;var n}function parseComponentValuesFromTokens(e){return o.parseListOfComponentValues(e,{onParseError:e=>{throw e}})}function parseComponentValues(e){const t=s.tokenizer({css:e},{onParseError:e=>{throw e}}),n=[];for(;!t.endOfFile();)n.push(t.nextToken());return n.push(t.nextToken()),parseComponentValuesFromTokens(n)}function transform(e,t,n,r,o){const s=parseComponentValues(r);let a=!1;return s.forEach(((r,i)=>{if("walk"in r){{const u=transformComponentValue(r,e,t,n,o);if(u)return s.splice(i,1,...u),a=!0,!1}r.walk(((r,s)=>{if("string"==typeof s)return;const i=transformComponentValue(r.node,e,t,n,o);return i?(r.parent.value.splice(s,1,...i),a=!0,!1):void 0}))}})),a?s.map((e=>e.toString())).join(""):r}function transformComponentValue(e,t,n,r,a){if(!o.isFunctionNode(e))return;if(e.getName().toLowerCase()!==a.valueFunctionName)return;let i="",u="",l="";for(let t=0;t{const t=parsePluginOptions(e);return{postcssPlugin:"postcss-design-tokens",prepare(){let e=new Map,n=new Set;return{postcssPlugin:"postcss-design-tokens",OnceExit(){e=new Map,n=new Set},async Once(r,o){const s=[];r.walkAtRules((e=>{if(e.name.toLowerCase()!==t.importAtRuleName)return;if(!e?.source?.input?.file)return;const n=e.source.input.file,r=e.params;e.remove(),s.push({filePath:n,params:r,node:e})}));for(const a of s.values()){let s;try{if(s=await tokensFromImport(r,o,t.is,a.filePath,a.params,n),!s)continue}catch(e){a.node.warn(o.result,`Failed to import design tokens from "${a.params}" with error:\n\t`+(e instanceof Error?e.message:e));continue}o.result.messages.push({type:"dependency",plugin:"postcss-design-tokens",file:s.filePath,parent:a.filePath}),e=mergeTokens(e,s.tokens)}},Declaration(n,{result:r}){if(n.value.toLowerCase().includes(t.valueFunctionName))try{const o=transform(e,r,n,n.value,t);if(o===n.value)return;n.value=o}catch{n.warn(r,`Failed to parse and transform "${n.value}"`)}},AtRule(n,{result:r}){if(n.params.toLowerCase().includes(t.valueFunctionName))try{const o=transform(e,r,n,n.params,t);if(o===n.params)return;n.params=o}catch{n.warn(r,`Failed to parse and transform "${n.params}"`)}}}}}};creator.postcss=!0,module.exports=creator;
+"use strict";var e=require("postcss-value-parser"),t=require("node:path"),n=require("node:fs/promises"),r=require("node:module"),o=require("@csstools/css-parser-algorithms"),s=require("@csstools/css-tokenizer");function toposort(e,t){let n=e.length;const r=new Array(n),o={};let s=n;const a=makeOutgoingEdges(t),i=makeNodesHash(e);for(t.forEach((function(e){if(!i.has(e[0])||!i.has(e[1]))throw new Error("Unknown token. Make sure to provide all tokens used in aliases.")}));s--;)o[s]||visit(e[s],s,new Set);return r;function visit(e,t,s){if(s.has(e)){let t;try{t=", token was: "+JSON.stringify(e)}catch{t=""}throw new Error("Cyclic dependency"+t)}if(!i.has(e))throw new Error("Found unknown token. Make sure to provided all involved tokens. Unknown token: "+JSON.stringify(e));if(o[t])return;o[t]=!0;const u=Array.from(a.get(e)||new Set);if(t=u.length){s.add(e);do{const e=u[--t];visit(e,i.get(e),s)}while(t);s.delete(e)}r[--n]=e}}function makeOutgoingEdges(e){const t=new Map;for(let n=0,r=e.length;napplyTransformsToValue(o,e),name:String(e.name??"")||t,comment:String(e.comment??"")||void 0,metadata:{name:String(e.name??"")?t:void 0,path:[...n,t],filePath:r,isSource:!0}}}const a=new Map;function applyTransformsToValue(t,n){if(!t)return"";if(!n)return t;if(!n.toUnit)return t;const r=e.unit(t);if(!r||r.unit===n.toUnit)return t;if(!r.unit){if(a.has(n.toUnit)){if(a.get(n.toUnit))return`${t}${n.toUnit}`;throw new Error(`Invalid unit "${n.toUnit}" for "${t}"`)}try{const r=e.unit(`${t}${n.toUnit}`);if(r&&r.unit===n.toUnit)return a.set(n.toUnit,!0),`${t}${n.toUnit}`;a.set(n.toUnit,!1)}catch{a.set(n.toUnit,!1)}throw new Error(`Invalid unit "${n.toUnit}" for "${t}"`)}return"rem"===r.unit&&"px"===n.toUnit?remToPx(parseFloat(r.number),n.pluginOptions?.rootFontSize??16):"px"===r.unit&&"rem"===n.toUnit?pxToRem(parseFloat(r.number),n.pluginOptions?.rootFontSize??16):t}function remToPx(e,t){return`${formatFloat(e*t)}px`}function pxToRem(e,t){return`${formatFloat(e/t)}rem`}function formatFloat(e){if(Number.isInteger(e))return e.toString();let t=e.toFixed(5);for(let e=t.length-1;e>=0&&"."!==t[e]&&"0"===t[e];e--)t=t.slice(0,e);return t}function dereferenceTokenValues(e){const t=new Set,n=new Map;for(const[r,o]of e.entries()){const e=parseReferences(o.value);e.length&&(t.add(r),n.set(r,e))}for(const[r,o]of n.entries()){for(let n=0;n"value-reference"===e.type)))continue;const s=o.map((e=>e.value)).join(""),a=e.get(r);a.value=s,a.cssValue=e=>applyTransformsToValue(s,e),e.set(r,a),t.delete(r),n.delete(r)}if(0===t.size)return e;{const r=Array.from(e.keys()),o=[];for(const[e,t]of n.entries())for(let n=0;n"value-reference"===e.type)))throw new Error('Token "'+r+'" can not be fully resolved');const s=o.map((e=>e.value)).join(""),a=e.get(r);a.value=s,a.cssValue=e=>applyTransformsToValue(s,e),e.set(r,a),t.delete(r),n.delete(r)}if(0===t.size)return e}return e}function parseReferences(e){if("string"!=typeof e)return[];if(-1===e.indexOf("{"))return[];const t=[];let n=!1,r=!1,o="";for(let s=0;s0&&(t.push({type:"value-non-reference",value:o}),o=""),r=!0;break;case"}":if(!r)throw new Error('Unexpected "}" in "'+e+'" at '+s);if(0===o.length)throw new Error('Empty alias "{}" in "'+e+'" at '+s);{let e=o.trim();".value"===e.slice(-6)&&(e=e.slice(0,-6)),t.push({type:"value-reference",raw:e}),o=""}n=!0,r=!1;break;default:o+=a}}if(r)throw new Error('Unexpected end of alias in "'+e+'"');return o.length>0&&t.push({type:"value-non-reference",value:o}),n?t:[]}function isTokenGroup(e){return"object"==typeof e&&null!==e&&void 0===e.value}function extractTokens(e,t,n){const r=new Map;for(const o in e)if(Object.hasOwnProperty.call(e,o)){if(null===e[o]||"object"!=typeof e[o]||Array.isArray(e[o]))throw new Error(`Parsing error at "${[...t,o].join(".")}"`);const s=e[o];if(!s)throw new Error(`Parsing error at "${[...t,o].join(".")}"`);if(!isTokenGroup(s)){const e=extractStyleDictionaryV3Token(s,o,t,n);r.set(e.metadata.path.join("."),e);continue}for(const[e,a]of extractTokens(s,[...t,o],n).entries())r.set(e,a)}return r}function extractStyleDictionaryV3Tokens(e,t){return dereferenceTokenValues(extractTokens(e,[],t))}function extractStyleDictionaryTokens(e,t,n){return extractStyleDictionaryV3Tokens(t,n)}const i="6b4e71e7-4787-42f7-a092-8684961895db";function parseImport(t){const n=e(t),r={filePath:"",format:"standard",conditions:[i]};return n.walk((e=>{"function"===e.type&&"url"===e.value&&(r.filePath=e.nodes[0].value),"function"===e.type&&"format"===e.value&&(r.format=e.nodes[0].value),"function"===e.type&&"when"===e.value&&(r.conditions=e.nodes.filter((e=>"string"===e.type)).map((e=>e.value)))})),r.conditions.length||(r.conditions=[i]),r}async function tokensFromImport(e,o,s,a,i,u){const{filePath:l,format:c,conditions:f}=parseImport(i);if(!f.every((e=>s.includes(e))))return!1;let p="";try{if(l.startsWith("node_modules://")){p=r.createRequire(t.dirname(a)).resolve(l.slice(15))}else if(l.startsWith("node_modules:")){p=r.createRequire(t.dirname(a)).resolve(l.slice(13))}else p=t.resolve(t.dirname(a),l)}catch(e){throw new Error(`Failed to read ${l} with error ${e instanceof Error?e.message:e}`)}if(u.has(p))return!1;o.result.messages.push({type:"dependency",plugin:"postcss-design-tokens",file:p,parent:e.source?.input?.file}),u.add(p);const d=await n.readFile(p,"utf8"),m=JSON.parse(d);if("style-dictionary3"===c)return{filePath:t.resolve(l),tokens:extractStyleDictionaryTokens(0,m,p)};throw new Error("Unsupported format: "+c)}function mergeTokens(e,t){const n=new Map(e);for(const[e,r]of t)n.set(e,r);return n}function parsePluginOptions(e){const t={importAtRuleName:"design-tokens",is:[i],unitsAndValues:{rootFontSize:16},valueFunctionName:"design-token"};return e?("object"!=typeof e||(Array.isArray(e.is)&&(t.is=e.is.filter((e=>"string"==typeof e))),0===t.is.length&&(t.is=[i]),"object"==typeof e.unitsAndValues&&"number"==typeof e.unitsAndValues.rootFontSize&&((n=e.unitsAndValues.rootFontSize)>0&&n!==1/0)&&(t.unitsAndValues.rootFontSize=e.unitsAndValues.rootFontSize),"string"==typeof e.valueFunctionName&&(t.valueFunctionName=e.valueFunctionName),"string"==typeof e.importAtRuleName&&(t.importAtRuleName=e.importAtRuleName)),t):t;var n}function parseComponentValuesFromTokens(e){return o.parseListOfComponentValues(e,{onParseError:e=>{throw e}})}function parseComponentValues(e){const t=s.tokenizer({css:e},{onParseError:e=>{throw e}}),n=[];for(;!t.endOfFile();)n.push(t.nextToken());return n.push(t.nextToken()),parseComponentValuesFromTokens(n)}function transform(e,t,n,r,o){const s=parseComponentValues(r);let a=!1;return s.forEach(((r,i)=>{if("walk"in r){{const u=transformComponentValue(r,e,t,n,o);if(u)return s.splice(i,1,...u),a=!0,!1}r.walk(((r,s)=>{if("string"==typeof s)return;const i=transformComponentValue(r.node,e,t,n,o);return i?(r.parent.value.splice(s,1,...i),a=!0,!1):void 0}))}})),a?s.map((e=>e.toString())).join(""):r}function transformComponentValue(e,t,n,r,a){if(!o.isFunctionNode(e))return;if(e.getName().toLowerCase()!==a.valueFunctionName)return;let i="",u="",l="";for(let t=0;t{const t=parsePluginOptions(e);return{postcssPlugin:"postcss-design-tokens",prepare(){let e=new Map,n=new Set;return{postcssPlugin:"postcss-design-tokens",OnceExit(){e=new Map,n=new Set},async Once(r,o){const s=[];r.walkAtRules((e=>{if(e.name.toLowerCase()!==t.importAtRuleName)return;if(!e?.source?.input?.file)return;const n=e.source.input.file,r=e.params;e.remove(),s.push({filePath:n,params:r,node:e})}));for(const a of s.values()){let s;try{if(s=await tokensFromImport(r,o,t.is,a.filePath,a.params,n),!s)continue}catch(e){a.node.warn(o.result,`Failed to import design tokens from "${a.params}" with error:\n\t`+(e instanceof Error?e.message:e));continue}o.result.messages.push({type:"dependency",plugin:"postcss-design-tokens",file:s.filePath,parent:a.filePath}),e=mergeTokens(e,s.tokens)}},Declaration(n,{result:r}){if(n.value.toLowerCase().includes(t.valueFunctionName))try{const o=transform(e,r,n,n.value,t);if(o===n.value)return;n.value=o}catch{n.warn(r,`Failed to parse and transform "${n.value}"`)}},AtRule(n,{result:r}){if(n.params.toLowerCase().includes(t.valueFunctionName))try{const o=transform(e,r,n,n.params,t);if(o===n.params)return;n.params=o}catch{n.warn(r,`Failed to parse and transform "${n.params}"`)}}}}}};creator.postcss=!0,module.exports=creator;
diff --git a/plugins/postcss-design-tokens/dist/index.mjs b/plugins/postcss-design-tokens/dist/index.mjs
index 170c01cf4..3ce10f8f7 100644
--- a/plugins/postcss-design-tokens/dist/index.mjs
+++ b/plugins/postcss-design-tokens/dist/index.mjs
@@ -1 +1 @@
-import e from"postcss-value-parser";import t from"path";import{promises as n}from"fs";import r from"module";import{parseListOfComponentValues as o,isFunctionNode as s,isWhitespaceNode as a,isCommentNode as i,isTokenNode as u}from"@csstools/css-parser-algorithms";import{tokenizer as l,isTokenString as c,isTokenIdent as f}from"@csstools/css-tokenizer";function toposort(e,t){let n=e.length;const r=new Array(n),o={};let s=n;const a=makeOutgoingEdges(t),i=makeNodesHash(e);for(t.forEach((function(e){if(!i.has(e[0])||!i.has(e[1]))throw new Error("Unknown token. Make sure to provide all tokens used in aliases.")}));s--;)o[s]||visit(e[s],s,new Set);return r;function visit(e,t,s){if(s.has(e)){let t;try{t=", token was: "+JSON.stringify(e)}catch{t=""}throw new Error("Cyclic dependency"+t)}if(!i.has(e))throw new Error("Found unknown token. Make sure to provided all involved tokens. Unknown token: "+JSON.stringify(e));if(o[t])return;o[t]=!0;const u=Array.from(a.get(e)||new Set);if(t=u.length){s.add(e);do{const e=u[--t];visit(e,i.get(e),s)}while(t);s.delete(e)}r[--n]=e}}function makeOutgoingEdges(e){const t=new Map;for(let n=0,r=e.length;napplyTransformsToValue(o,e),name:String(e.name??"")||t,comment:String(e.comment??"")||void 0,metadata:{name:String(e.name??"")?t:void 0,path:[...n,t],filePath:r,isSource:!0}}}const p=new Map;function applyTransformsToValue(t,n){if(!t)return"";if(!n)return t;if(!n.toUnit)return t;const r=e.unit(t);if(!r||r.unit===n.toUnit)return t;if(!r.unit){if(p.has(n.toUnit)){if(p.get(n.toUnit))return`${t}${n.toUnit}`;throw new Error(`Invalid unit "${n.toUnit}" for "${t}"`)}try{const r=e.unit(`${t}${n.toUnit}`);if(r&&r.unit===n.toUnit)return p.set(n.toUnit,!0),`${t}${n.toUnit}`;p.set(n.toUnit,!1)}catch{p.set(n.toUnit,!1)}throw new Error(`Invalid unit "${n.toUnit}" for "${t}"`)}return"rem"===r.unit&&"px"===n.toUnit?remToPx(parseFloat(r.number),n.pluginOptions?.rootFontSize??16):"px"===r.unit&&"rem"===n.toUnit?pxToRem(parseFloat(r.number),n.pluginOptions?.rootFontSize??16):t}function remToPx(e,t){return`${formatFloat(e*t)}px`}function pxToRem(e,t){return`${formatFloat(e/t)}rem`}function formatFloat(e){if(Number.isInteger(e))return e.toString();let t=e.toFixed(5);for(let e=t.length-1;e>=0&&"."!==t[e]&&"0"===t[e];e--)t=t.slice(0,e);return t}function dereferenceTokenValues(e){const t=new Set,n=new Map;for(const[r,o]of e.entries()){const e=parseReferences(o.value);e.length&&(t.add(r),n.set(r,e))}for(const[r,o]of n.entries()){for(let n=0;n"value-reference"===e.type)))continue;const s=o.map((e=>e.value)).join(""),a=e.get(r);a.value=s,a.cssValue=e=>applyTransformsToValue(s,e),e.set(r,a),t.delete(r),n.delete(r)}if(0===t.size)return e;{const r=Array.from(e.keys()),o=[];for(const[e,t]of n.entries())for(let n=0;n"value-reference"===e.type)))throw new Error('Token "'+r+'" can not be fully resolved');const s=o.map((e=>e.value)).join(""),a=e.get(r);a.value=s,a.cssValue=e=>applyTransformsToValue(s,e),e.set(r,a),t.delete(r),n.delete(r)}if(0===t.size)return e}return e}function parseReferences(e){if("string"!=typeof e)return[];if(-1===e.indexOf("{"))return[];const t=[];let n=!1,r=!1,o="";for(let s=0;s0&&(t.push({type:"value-non-reference",value:o}),o=""),r=!0;break;case"}":if(!r)throw new Error('Unexpected "}" in "'+e+'" at '+s);if(0===o.length)throw new Error('Empty alias "{}" in "'+e+'" at '+s);{let e=o.trim();".value"===e.slice(-6)&&(e=e.slice(0,-6)),t.push({type:"value-reference",raw:e}),o=""}n=!0,r=!1;break;default:o+=a}}if(r)throw new Error('Unexpected end of alias in "'+e+'"');return o.length>0&&t.push({type:"value-non-reference",value:o}),n?t:[]}function isTokenGroup(e){return"object"==typeof e&&null!==e&&void 0===e.value}function extractTokens(e,t,n){const r=new Map;for(const o in e)if(Object.hasOwnProperty.call(e,o)){if(null===e[o]||"object"!=typeof e[o]||Array.isArray(e[o]))throw new Error(`Parsing error at "${[...t,o].join(".")}"`);const s=e[o];if(!s)throw new Error(`Parsing error at "${[...t,o].join(".")}"`);if(!isTokenGroup(s)){const e=extractStyleDictionaryV3Token(s,o,t,n);r.set(e.metadata.path.join("."),e);continue}for(const[e,a]of extractTokens(s,[...t,o],n).entries())r.set(e,a)}return r}function extractStyleDictionaryV3Tokens(e,t){return dereferenceTokenValues(extractTokens(e,[],t))}function extractStyleDictionaryTokens(e,t,n){return extractStyleDictionaryV3Tokens(t,n)}const m="6b4e71e7-4787-42f7-a092-8684961895db";function parseImport(t){const n=e(t),r={filePath:"",format:"standard",conditions:[m]};return n.walk((e=>{"function"===e.type&&"url"===e.value&&(r.filePath=e.nodes[0].value),"function"===e.type&&"format"===e.value&&(r.format=e.nodes[0].value),"function"===e.type&&"when"===e.value&&(r.conditions=e.nodes.filter((e=>"string"===e.type)).map((e=>e.value)))})),r.conditions.length||(r.conditions=[m]),r}async function tokensFromImport(e,o,s,a,i,u){const{filePath:l,format:c,conditions:f}=parseImport(i);if(!f.every((e=>s.includes(e))))return!1;let p="";try{if(l.startsWith("node_modules://")){p=r.createRequire(t.dirname(a)).resolve(l.slice(15))}else if(l.startsWith("node_modules:")){p=r.createRequire(t.dirname(a)).resolve(l.slice(13))}else p=t.resolve(t.dirname(a),l)}catch(e){throw new Error(`Failed to read ${l} with error ${e instanceof Error?e.message:e}`)}if(u.has(p))return!1;o.result.messages.push({type:"dependency",plugin:"postcss-design-tokens",file:p,parent:e.source?.input?.file}),u.add(p);const m=await n.readFile(p,"utf8"),d=JSON.parse(m);if("style-dictionary3"===c)return{filePath:t.resolve(l),tokens:extractStyleDictionaryTokens(0,d,p)};throw new Error("Unsupported format: "+c)}function mergeTokens(e,t){const n=new Map(e);for(const[e,r]of t)n.set(e,r);return n}function parsePluginOptions(e){const t={importAtRuleName:"design-tokens",is:[m],unitsAndValues:{rootFontSize:16},valueFunctionName:"design-token"};return e?("object"!=typeof e||(Array.isArray(e.is)&&(t.is=e.is.filter((e=>"string"==typeof e))),0===t.is.length&&(t.is=[m]),"object"==typeof e.unitsAndValues&&"number"==typeof e.unitsAndValues.rootFontSize&&((n=e.unitsAndValues.rootFontSize)>0&&n!==1/0)&&(t.unitsAndValues.rootFontSize=e.unitsAndValues.rootFontSize),"string"==typeof e.valueFunctionName&&(t.valueFunctionName=e.valueFunctionName),"string"==typeof e.importAtRuleName&&(t.importAtRuleName=e.importAtRuleName)),t):t;var n}function parseComponentValuesFromTokens(e){return o(e,{onParseError:e=>{throw e}})}function parseComponentValues(e){const t=l({css:e},{onParseError:e=>{throw e}}),n=[];for(;!t.endOfFile();)n.push(t.nextToken());return n.push(t.nextToken()),parseComponentValuesFromTokens(n)}function transform(e,t,n,r,o){const s=parseComponentValues(r);let a=!1;return s.forEach(((r,i)=>{if("walk"in r){{const u=transformComponentValue(r,e,t,n,o);if(u)return s.splice(i,1,...u),a=!0,!1}r.walk(((r,s)=>{if("string"==typeof s)return;const i=transformComponentValue(r.node,e,t,n,o);return i?(r.parent.value.splice(s,1,...i),a=!0,!1):void 0}))}})),a?s.map((e=>e.toString())).join(""):r}function transformComponentValue(e,t,n,r,o){if(!s(e))return;if(e.getName().toLowerCase()!==o.valueFunctionName)return;let l="",p="",m="";for(let t=0;t{const t=parsePluginOptions(e);return{postcssPlugin:"postcss-design-tokens",prepare(){let e=new Map,n=new Set;return{postcssPlugin:"postcss-design-tokens",OnceExit(){e=new Map,n=new Set},async Once(r,o){const s=[];r.walkAtRules((e=>{if(e.name.toLowerCase()!==t.importAtRuleName)return;if(!e?.source?.input?.file)return;const n=e.source.input.file,r=e.params;e.remove(),s.push({filePath:n,params:r,node:e})}));for(const a of s.values()){let s;try{if(s=await tokensFromImport(r,o,t.is,a.filePath,a.params,n),!s)continue}catch(e){a.node.warn(o.result,`Failed to import design tokens from "${a.params}" with error:\n\t`+(e instanceof Error?e.message:e));continue}o.result.messages.push({type:"dependency",plugin:"postcss-design-tokens",file:s.filePath,parent:a.filePath}),e=mergeTokens(e,s.tokens)}},Declaration(n,{result:r}){if(n.value.toLowerCase().includes(t.valueFunctionName))try{const o=transform(e,r,n,n.value,t);if(o===n.value)return;n.value=o}catch{n.warn(r,`Failed to parse and transform "${n.value}"`)}},AtRule(n,{result:r}){if(n.params.toLowerCase().includes(t.valueFunctionName))try{const o=transform(e,r,n,n.params,t);if(o===n.params)return;n.params=o}catch{n.warn(r,`Failed to parse and transform "${n.params}"`)}}}}}};creator.postcss=!0;export{creator as default};
+import e from"postcss-value-parser";import t from"node:path";import n from"node:fs/promises";import r from"node:module";import{parseListOfComponentValues as o,isFunctionNode as s,isWhitespaceNode as a,isCommentNode as i,isTokenNode as u}from"@csstools/css-parser-algorithms";import{tokenizer as l,isTokenString as c,isTokenIdent as f}from"@csstools/css-tokenizer";function toposort(e,t){let n=e.length;const r=new Array(n),o={};let s=n;const a=makeOutgoingEdges(t),i=makeNodesHash(e);for(t.forEach((function(e){if(!i.has(e[0])||!i.has(e[1]))throw new Error("Unknown token. Make sure to provide all tokens used in aliases.")}));s--;)o[s]||visit(e[s],s,new Set);return r;function visit(e,t,s){if(s.has(e)){let t;try{t=", token was: "+JSON.stringify(e)}catch{t=""}throw new Error("Cyclic dependency"+t)}if(!i.has(e))throw new Error("Found unknown token. Make sure to provided all involved tokens. Unknown token: "+JSON.stringify(e));if(o[t])return;o[t]=!0;const u=Array.from(a.get(e)||new Set);if(t=u.length){s.add(e);do{const e=u[--t];visit(e,i.get(e),s)}while(t);s.delete(e)}r[--n]=e}}function makeOutgoingEdges(e){const t=new Map;for(let n=0,r=e.length;napplyTransformsToValue(o,e),name:String(e.name??"")||t,comment:String(e.comment??"")||void 0,metadata:{name:String(e.name??"")?t:void 0,path:[...n,t],filePath:r,isSource:!0}}}const p=new Map;function applyTransformsToValue(t,n){if(!t)return"";if(!n)return t;if(!n.toUnit)return t;const r=e.unit(t);if(!r||r.unit===n.toUnit)return t;if(!r.unit){if(p.has(n.toUnit)){if(p.get(n.toUnit))return`${t}${n.toUnit}`;throw new Error(`Invalid unit "${n.toUnit}" for "${t}"`)}try{const r=e.unit(`${t}${n.toUnit}`);if(r&&r.unit===n.toUnit)return p.set(n.toUnit,!0),`${t}${n.toUnit}`;p.set(n.toUnit,!1)}catch{p.set(n.toUnit,!1)}throw new Error(`Invalid unit "${n.toUnit}" for "${t}"`)}return"rem"===r.unit&&"px"===n.toUnit?remToPx(parseFloat(r.number),n.pluginOptions?.rootFontSize??16):"px"===r.unit&&"rem"===n.toUnit?pxToRem(parseFloat(r.number),n.pluginOptions?.rootFontSize??16):t}function remToPx(e,t){return`${formatFloat(e*t)}px`}function pxToRem(e,t){return`${formatFloat(e/t)}rem`}function formatFloat(e){if(Number.isInteger(e))return e.toString();let t=e.toFixed(5);for(let e=t.length-1;e>=0&&"."!==t[e]&&"0"===t[e];e--)t=t.slice(0,e);return t}function dereferenceTokenValues(e){const t=new Set,n=new Map;for(const[r,o]of e.entries()){const e=parseReferences(o.value);e.length&&(t.add(r),n.set(r,e))}for(const[r,o]of n.entries()){for(let n=0;n"value-reference"===e.type)))continue;const s=o.map((e=>e.value)).join(""),a=e.get(r);a.value=s,a.cssValue=e=>applyTransformsToValue(s,e),e.set(r,a),t.delete(r),n.delete(r)}if(0===t.size)return e;{const r=Array.from(e.keys()),o=[];for(const[e,t]of n.entries())for(let n=0;n"value-reference"===e.type)))throw new Error('Token "'+r+'" can not be fully resolved');const s=o.map((e=>e.value)).join(""),a=e.get(r);a.value=s,a.cssValue=e=>applyTransformsToValue(s,e),e.set(r,a),t.delete(r),n.delete(r)}if(0===t.size)return e}return e}function parseReferences(e){if("string"!=typeof e)return[];if(-1===e.indexOf("{"))return[];const t=[];let n=!1,r=!1,o="";for(let s=0;s0&&(t.push({type:"value-non-reference",value:o}),o=""),r=!0;break;case"}":if(!r)throw new Error('Unexpected "}" in "'+e+'" at '+s);if(0===o.length)throw new Error('Empty alias "{}" in "'+e+'" at '+s);{let e=o.trim();".value"===e.slice(-6)&&(e=e.slice(0,-6)),t.push({type:"value-reference",raw:e}),o=""}n=!0,r=!1;break;default:o+=a}}if(r)throw new Error('Unexpected end of alias in "'+e+'"');return o.length>0&&t.push({type:"value-non-reference",value:o}),n?t:[]}function isTokenGroup(e){return"object"==typeof e&&null!==e&&void 0===e.value}function extractTokens(e,t,n){const r=new Map;for(const o in e)if(Object.hasOwnProperty.call(e,o)){if(null===e[o]||"object"!=typeof e[o]||Array.isArray(e[o]))throw new Error(`Parsing error at "${[...t,o].join(".")}"`);const s=e[o];if(!s)throw new Error(`Parsing error at "${[...t,o].join(".")}"`);if(!isTokenGroup(s)){const e=extractStyleDictionaryV3Token(s,o,t,n);r.set(e.metadata.path.join("."),e);continue}for(const[e,a]of extractTokens(s,[...t,o],n).entries())r.set(e,a)}return r}function extractStyleDictionaryV3Tokens(e,t){return dereferenceTokenValues(extractTokens(e,[],t))}function extractStyleDictionaryTokens(e,t,n){return extractStyleDictionaryV3Tokens(t,n)}const m="6b4e71e7-4787-42f7-a092-8684961895db";function parseImport(t){const n=e(t),r={filePath:"",format:"standard",conditions:[m]};return n.walk((e=>{"function"===e.type&&"url"===e.value&&(r.filePath=e.nodes[0].value),"function"===e.type&&"format"===e.value&&(r.format=e.nodes[0].value),"function"===e.type&&"when"===e.value&&(r.conditions=e.nodes.filter((e=>"string"===e.type)).map((e=>e.value)))})),r.conditions.length||(r.conditions=[m]),r}async function tokensFromImport(e,o,s,a,i,u){const{filePath:l,format:c,conditions:f}=parseImport(i);if(!f.every((e=>s.includes(e))))return!1;let p="";try{if(l.startsWith("node_modules://")){p=r.createRequire(t.dirname(a)).resolve(l.slice(15))}else if(l.startsWith("node_modules:")){p=r.createRequire(t.dirname(a)).resolve(l.slice(13))}else p=t.resolve(t.dirname(a),l)}catch(e){throw new Error(`Failed to read ${l} with error ${e instanceof Error?e.message:e}`)}if(u.has(p))return!1;o.result.messages.push({type:"dependency",plugin:"postcss-design-tokens",file:p,parent:e.source?.input?.file}),u.add(p);const m=await n.readFile(p,"utf8"),d=JSON.parse(m);if("style-dictionary3"===c)return{filePath:t.resolve(l),tokens:extractStyleDictionaryTokens(0,d,p)};throw new Error("Unsupported format: "+c)}function mergeTokens(e,t){const n=new Map(e);for(const[e,r]of t)n.set(e,r);return n}function parsePluginOptions(e){const t={importAtRuleName:"design-tokens",is:[m],unitsAndValues:{rootFontSize:16},valueFunctionName:"design-token"};return e?("object"!=typeof e||(Array.isArray(e.is)&&(t.is=e.is.filter((e=>"string"==typeof e))),0===t.is.length&&(t.is=[m]),"object"==typeof e.unitsAndValues&&"number"==typeof e.unitsAndValues.rootFontSize&&((n=e.unitsAndValues.rootFontSize)>0&&n!==1/0)&&(t.unitsAndValues.rootFontSize=e.unitsAndValues.rootFontSize),"string"==typeof e.valueFunctionName&&(t.valueFunctionName=e.valueFunctionName),"string"==typeof e.importAtRuleName&&(t.importAtRuleName=e.importAtRuleName)),t):t;var n}function parseComponentValuesFromTokens(e){return o(e,{onParseError:e=>{throw e}})}function parseComponentValues(e){const t=l({css:e},{onParseError:e=>{throw e}}),n=[];for(;!t.endOfFile();)n.push(t.nextToken());return n.push(t.nextToken()),parseComponentValuesFromTokens(n)}function transform(e,t,n,r,o){const s=parseComponentValues(r);let a=!1;return s.forEach(((r,i)=>{if("walk"in r){{const u=transformComponentValue(r,e,t,n,o);if(u)return s.splice(i,1,...u),a=!0,!1}r.walk(((r,s)=>{if("string"==typeof s)return;const i=transformComponentValue(r.node,e,t,n,o);return i?(r.parent.value.splice(s,1,...i),a=!0,!1):void 0}))}})),a?s.map((e=>e.toString())).join(""):r}function transformComponentValue(e,t,n,r,o){if(!s(e))return;if(e.getName().toLowerCase()!==o.valueFunctionName)return;let l="",p="",m="";for(let t=0;t{const t=parsePluginOptions(e);return{postcssPlugin:"postcss-design-tokens",prepare(){let e=new Map,n=new Set;return{postcssPlugin:"postcss-design-tokens",OnceExit(){e=new Map,n=new Set},async Once(r,o){const s=[];r.walkAtRules((e=>{if(e.name.toLowerCase()!==t.importAtRuleName)return;if(!e?.source?.input?.file)return;const n=e.source.input.file,r=e.params;e.remove(),s.push({filePath:n,params:r,node:e})}));for(const a of s.values()){let s;try{if(s=await tokensFromImport(r,o,t.is,a.filePath,a.params,n),!s)continue}catch(e){a.node.warn(o.result,`Failed to import design tokens from "${a.params}" with error:\n\t`+(e instanceof Error?e.message:e));continue}o.result.messages.push({type:"dependency",plugin:"postcss-design-tokens",file:s.filePath,parent:a.filePath}),e=mergeTokens(e,s.tokens)}},Declaration(n,{result:r}){if(n.value.toLowerCase().includes(t.valueFunctionName))try{const o=transform(e,r,n,n.value,t);if(o===n.value)return;n.value=o}catch{n.warn(r,`Failed to parse and transform "${n.value}"`)}},AtRule(n,{result:r}){if(n.params.toLowerCase().includes(t.valueFunctionName))try{const o=transform(e,r,n,n.params,t);if(o===n.params)return;n.params=o}catch{n.warn(r,`Failed to parse and transform "${n.params}"`)}}}}}};creator.postcss=!0;export{creator as default};
diff --git a/plugins/postcss-design-tokens/package.json b/plugins/postcss-design-tokens/package.json
index 9bfaf321a..33c31c6df 100644
--- a/plugins/postcss-design-tokens/package.json
+++ b/plugins/postcss-design-tokens/package.json
@@ -25,7 +25,7 @@
}
],
"engines": {
- "node": "^14 || ^16 || >=18"
+ "node": ">=18"
},
"type": "module",
"main": "dist/index.cjs",
diff --git a/plugins/postcss-design-tokens/src/data-formats/parse-import.ts b/plugins/postcss-design-tokens/src/data-formats/parse-import.ts
index 9c27ac1d0..026b041c7 100644
--- a/plugins/postcss-design-tokens/src/data-formats/parse-import.ts
+++ b/plugins/postcss-design-tokens/src/data-formats/parse-import.ts
@@ -1,10 +1,10 @@
import valueParser from 'postcss-value-parser';
-import { Token } from './base/token';
+import type { Token } from './base/token';
import { extractStyleDictionaryTokens } from './style-dictionary/style-dictionary';
-import path from 'path';
-import { promises as fsp } from 'fs';
+import path from 'node:path';
+import fs from 'node:fs/promises';
import { DEFAULT_CONDITION } from '../constants';
-import module from 'module';
+import module from 'node:module';
import type { Helpers, Root } from 'postcss';
function parseImport(statement: string): { filePath: string, format: string, conditions: Array } {
@@ -76,7 +76,7 @@ export async function tokensFromImport(root: Root, postcssHelpers: Helpers, buil
alreadyImported.add(resolvedPath);
- const fileContents = await fsp.readFile(resolvedPath, 'utf8');
+ const fileContents = await fs.readFile(resolvedPath, 'utf8');
const tokenContents: unknown = JSON.parse(fileContents);
switch (format) {
diff --git a/plugins/postcss-design-tokens/src/data-formats/style-dictionary/style-dictionary.ts b/plugins/postcss-design-tokens/src/data-formats/style-dictionary/style-dictionary.ts
index ae813c6c3..e1b0bf891 100644
--- a/plugins/postcss-design-tokens/src/data-formats/style-dictionary/style-dictionary.ts
+++ b/plugins/postcss-design-tokens/src/data-formats/style-dictionary/style-dictionary.ts
@@ -1,6 +1,7 @@
-import { Token } from '../base/token';
-import { extractStyleDictionaryV3Tokens, StyleDictionaryV3TokenGroup } from './v3/group';
+import type { Token } from '../base/token';
+import type { StyleDictionaryV3TokenGroup } from './v3/group';
+import { extractStyleDictionaryV3Tokens } from './v3/group';
export function extractStyleDictionaryTokens(version: string, node: unknown, filePath: string): Map {
if (version === '3') {
diff --git a/plugins/postcss-design-tokens/src/data-formats/style-dictionary/v3/dereference.ts b/plugins/postcss-design-tokens/src/data-formats/style-dictionary/v3/dereference.ts
index 46a5f6782..12c04d64c 100644
--- a/plugins/postcss-design-tokens/src/data-formats/style-dictionary/v3/dereference.ts
+++ b/plugins/postcss-design-tokens/src/data-formats/style-dictionary/v3/dereference.ts
@@ -1,7 +1,8 @@
/* eslint-disable @typescript-eslint/no-non-null-assertion */
-import { TokenTransformOptions } from '../../base/token';
+import type { TokenTransformOptions } from '../../base/token';
import { toposort } from '../../toposort/toposort';
-import { applyTransformsToValue, StyleDictionaryV3TokenValue } from './value';
+import type { StyleDictionaryV3TokenValue } from './value';
+import { applyTransformsToValue } from './value';
export function dereferenceTokenValues(tokens: Map): Map {
const tainted = new Set();
diff --git a/plugins/postcss-design-tokens/src/data-formats/style-dictionary/v3/group.ts b/plugins/postcss-design-tokens/src/data-formats/style-dictionary/v3/group.ts
index dcf287861..188ac4709 100644
--- a/plugins/postcss-design-tokens/src/data-formats/style-dictionary/v3/group.ts
+++ b/plugins/postcss-design-tokens/src/data-formats/style-dictionary/v3/group.ts
@@ -1,6 +1,7 @@
-import { Token } from '../../base/token';
+import type { Token } from '../../base/token';
import { dereferenceTokenValues } from './dereference';
-import { extractStyleDictionaryV3Token, StyleDictionaryV3TokenValue } from './value';
+import type { StyleDictionaryV3TokenValue } from './value';
+import { extractStyleDictionaryV3Token } from './value';
export type StyleDictionaryV3TokenGroup = {
[key: string]: StyleDictionaryV3TokenGroup | StyleDictionaryV3TokenValue;
diff --git a/plugins/postcss-design-tokens/src/data-formats/style-dictionary/v3/value.ts b/plugins/postcss-design-tokens/src/data-formats/style-dictionary/v3/value.ts
index 51a2c2c7a..42a85b96c 100644
--- a/plugins/postcss-design-tokens/src/data-formats/style-dictionary/v3/value.ts
+++ b/plugins/postcss-design-tokens/src/data-formats/style-dictionary/v3/value.ts
@@ -1,4 +1,4 @@
-import { TokenTransformOptions } from '../../base/token';
+import type { TokenTransformOptions } from '../../base/token';
import valueParser from 'postcss-value-parser';
export type StyleDictionaryV3TokenValue = {
diff --git a/plugins/postcss-design-tokens/src/data-formats/token.ts b/plugins/postcss-design-tokens/src/data-formats/token.ts
index 704cb796c..9a73121bb 100644
--- a/plugins/postcss-design-tokens/src/data-formats/token.ts
+++ b/plugins/postcss-design-tokens/src/data-formats/token.ts
@@ -1,4 +1,4 @@
-import { Token } from './base/token';
+import type { Token } from './base/token';
export function mergeTokens(a: Map, b: Map): Map {
const result = new Map(a);
diff --git a/plugins/postcss-design-tokens/src/index.ts b/plugins/postcss-design-tokens/src/index.ts
index 96cb17454..b2feed89c 100644
--- a/plugins/postcss-design-tokens/src/index.ts
+++ b/plugins/postcss-design-tokens/src/index.ts
@@ -1,8 +1,9 @@
import type { Node, Plugin, PluginCreator } from 'postcss';
-import { Token } from './data-formats/base/token';
+import type { Token } from './data-formats/base/token';
import { tokensFromImport } from './data-formats/parse-import';
import { mergeTokens } from './data-formats/token';
-import { parsePluginOptions, pluginOptions } from './options';
+import type { pluginOptions } from './options';
+import { parsePluginOptions } from './options';
export type { pluginOptions } from './options';
import { transform } from './transform';
diff --git a/plugins/postcss-design-tokens/src/parse-component-values.ts b/plugins/postcss-design-tokens/src/parse-component-values.ts
index a7c8cd98d..5e6b9b35d 100644
--- a/plugins/postcss-design-tokens/src/parse-component-values.ts
+++ b/plugins/postcss-design-tokens/src/parse-component-values.ts
@@ -1,5 +1,7 @@
-import { ComponentValue, parseListOfComponentValues } from '@csstools/css-parser-algorithms';
-import { CSSToken, tokenizer } from '@csstools/css-tokenizer';
+import type { ComponentValue} from '@csstools/css-parser-algorithms';
+import { parseListOfComponentValues } from '@csstools/css-parser-algorithms';
+import type { CSSToken} from '@csstools/css-tokenizer';
+import { tokenizer } from '@csstools/css-tokenizer';
function parseComponentValuesFromTokens(tokens: Array): Array {
return parseListOfComponentValues(tokens, {
diff --git a/plugins/postcss-design-tokens/src/transform.ts b/plugins/postcss-design-tokens/src/transform.ts
index f3070b1fe..ed816e0a5 100644
--- a/plugins/postcss-design-tokens/src/transform.ts
+++ b/plugins/postcss-design-tokens/src/transform.ts
@@ -1,8 +1,9 @@
-import { ComponentValue, isCommentNode, isFunctionNode, isTokenNode, isWhitespaceNode } from '@csstools/css-parser-algorithms';
+import type { ComponentValue} from '@csstools/css-parser-algorithms';
+import { isCommentNode, isFunctionNode, isTokenNode, isWhitespaceNode } from '@csstools/css-parser-algorithms';
import { isTokenIdent, isTokenString } from '@csstools/css-tokenizer';
import type { Node, Result } from 'postcss';
-import { Token, TokenTransformOptions } from './data-formats/base/token';
-import { parsedPluginOptions } from './options';
+import type { Token, TokenTransformOptions } from './data-formats/base/token';
+import type { parsedPluginOptions } from './options';
import { parseComponentValues } from './parse-component-values';
export function transform(tokens: Map, result: Result, postCSSNode: Node, source: string, opts: parsedPluginOptions): string {
diff --git a/plugins/postcss-design-tokens/test/_import.mjs b/plugins/postcss-design-tokens/test/_import.mjs
index 97e23a010..3744a9383 100644
--- a/plugins/postcss-design-tokens/test/_import.mjs
+++ b/plugins/postcss-design-tokens/test/_import.mjs
@@ -1,4 +1,4 @@
-import assert from 'assert';
+import assert from 'node:assert';
import plugin from '@csstools/postcss-design-tokens';
plugin();
diff --git a/plugins/postcss-dir-pseudo-class/CHANGELOG.md b/plugins/postcss-dir-pseudo-class/CHANGELOG.md
index 7b3da107f..385274d4b 100644
--- a/plugins/postcss-dir-pseudo-class/CHANGELOG.md
+++ b/plugins/postcss-dir-pseudo-class/CHANGELOG.md
@@ -1,5 +1,9 @@
# Changes to PostCSS Dir Pseudo Class
+### Unreleased (major)
+
+- Updated: Support for Node v18+ (major).
+
### 8.0.1
_December 15, 2023_
diff --git a/plugins/postcss-dir-pseudo-class/package.json b/plugins/postcss-dir-pseudo-class/package.json
index bb1804f3c..8156dc99a 100644
--- a/plugins/postcss-dir-pseudo-class/package.json
+++ b/plugins/postcss-dir-pseudo-class/package.json
@@ -29,7 +29,7 @@
}
],
"engines": {
- "node": "^14 || ^16 || >=18"
+ "node": ">=18"
},
"type": "module",
"main": "dist/index.cjs",
diff --git a/plugins/postcss-dir-pseudo-class/test/_import.mjs b/plugins/postcss-dir-pseudo-class/test/_import.mjs
index 8ece82311..bd94ed926 100644
--- a/plugins/postcss-dir-pseudo-class/test/_import.mjs
+++ b/plugins/postcss-dir-pseudo-class/test/_import.mjs
@@ -1,4 +1,4 @@
-import assert from 'assert';
+import assert from 'node:assert';
import plugin from 'postcss-dir-pseudo-class';
plugin();
diff --git a/plugins/postcss-double-position-gradients/CHANGELOG.md b/plugins/postcss-double-position-gradients/CHANGELOG.md
index c387a3a6a..32a784e3e 100644
--- a/plugins/postcss-double-position-gradients/CHANGELOG.md
+++ b/plugins/postcss-double-position-gradients/CHANGELOG.md
@@ -1,5 +1,9 @@
# Changes to PostCSS Double Position Gradients
+### Unreleased (major)
+
+- Updated: Support for Node v18+ (major).
+
### 5.0.7
_July 7, 2024_
diff --git a/plugins/postcss-double-position-gradients/package.json b/plugins/postcss-double-position-gradients/package.json
index 6b54a73b2..6ac4421e6 100644
--- a/plugins/postcss-double-position-gradients/package.json
+++ b/plugins/postcss-double-position-gradients/package.json
@@ -15,7 +15,7 @@
}
],
"engines": {
- "node": "^14 || ^16 || >=18"
+ "node": ">=18"
},
"type": "module",
"main": "dist/index.cjs",
diff --git a/plugins/postcss-double-position-gradients/test/_import.mjs b/plugins/postcss-double-position-gradients/test/_import.mjs
index 015304634..efdd058d8 100644
--- a/plugins/postcss-double-position-gradients/test/_import.mjs
+++ b/plugins/postcss-double-position-gradients/test/_import.mjs
@@ -1,4 +1,4 @@
-import assert from 'assert';
+import assert from 'node:assert';
import plugin from 'postcss-double-position-gradients';
plugin();
diff --git a/plugins/postcss-env-function/CHANGELOG.md b/plugins/postcss-env-function/CHANGELOG.md
index 2ff24d693..4f983b315 100644
--- a/plugins/postcss-env-function/CHANGELOG.md
+++ b/plugins/postcss-env-function/CHANGELOG.md
@@ -1,5 +1,9 @@
# Changes to PostCSS Environment Variables
+### Unreleased (major)
+
+- Updated: Support for Node v18+ (major).
+
### 6.0.0
_July 3, 2023_
diff --git a/plugins/postcss-env-function/dist/index.cjs b/plugins/postcss-env-function/dist/index.cjs
index aaf8f5142..4dd031904 100644
--- a/plugins/postcss-env-function/dist/index.cjs
+++ b/plugins/postcss-env-function/dist/index.cjs
@@ -1 +1 @@
-"use strict";var e=require("postcss-value-parser"),t=require("fs"),n=require("path"),r=require("url"),isEnvFunc=e=>e&&"function"===e.type&&"env"===e.value,getReplacedValue=(t,n)=>{const r=e(t);return r.walk((e=>{if(isEnvFunc(e)){const[t]=e.nodes;"word"===t.type&&void 0!==n[t.value]&&(e.nodes=[],e.type="word",e.value=n[t.value])}})),r.toString()};function importEnvironmentVariablesFromObject(e){return Object.assign({},Object(e).environmentVariables||Object(e)["environment-variables"])}async function importEnvironmentVariablesFromJSONFile(e){return importEnvironmentVariablesFromObject(await readJSON(n.resolve(e)))}async function importEnvironmentVariablesFromJSFile(e){const t=await import(r.pathToFileURL(n.resolve(e)));return importEnvironmentVariablesFromObject("default"in t?t.default:t)}const readFile=e=>new Promise(((n,r)=>{t.readFile(e,"utf8",((e,t)=>{e?r(e):n(t)}))})),readJSON=async e=>JSON.parse(await readFile(e));function creator(e){const t=[].concat(Object(e).importFrom||[]),r=t.map((e=>{if(e instanceof Promise)return e;if(e instanceof Function)return e();const t=e===Object(e)?e:{from:String(e)};if(t.environmentVariables||t["environment-variables"])return t;const r=String(t.from||"");return{type:(t.type||n.extname(r).slice(1)).toLowerCase(),from:r}})).reduce((async(e,t)=>{const{type:n,from:r}=await t;return"js"===n||"cjs"===n?Object.assign(e,await importEnvironmentVariablesFromJSFile(r)):"json"===n?Object.assign(e,await importEnvironmentVariablesFromJSONFile(r)):Object.assign(e,importEnvironmentVariablesFromObject(await t))}),{});const a="disableDeprecationNotice"in Object(e)&&Boolean(e.disableDeprecationNotice);let i=!1;return{postcssPlugin:"postcss-env-fn",async AtRule(e,{result:t}){let n;try{n=getReplacedValue(e.params,await r)}catch{e.warn(t,`Failed to parse params '${e.params}' as an environment value. Leaving the original value intact.`)}void 0!==n&&n!==e.params&&(e.params=n,a||i||(i=!0,e.warn(t,"postcss-env-function is deprecated and will be removed.\nCheck the discussion on github for more details. https://github.com/csstools/postcss-plugins/discussions/192")))},async Declaration(e,{result:t}){let n;try{n=getReplacedValue(e.value,await r)}catch{e.warn(t,`Failed to parse value '${e.value}' as an environment value. Leaving the original value intact.`)}void 0!==n&&n!==e.value&&(e.value=n,a||i||(i=!0,e.warn(t,"postcss-env-function is deprecated and will be removed.\nWe are looking for insights and anecdotes on how these features are used so that we can design the best alternative.\nPlease let us know if our proposal will work for you.\nVisit the discussion on github for more details. https://github.com/csstools/postcss-plugins/discussions/192")))}}}creator.postcss=!0,module.exports=creator;
+"use strict";var e=require("postcss-value-parser"),t=require("node:fs"),n=require("node:path"),r=require("node:url"),isEnvFunc=e=>e&&"function"===e.type&&"env"===e.value,getReplacedValue=(t,n)=>{const r=e(t);return r.walk((e=>{if(isEnvFunc(e)){const[t]=e.nodes;"word"===t.type&&void 0!==n[t.value]&&(e.nodes=[],e.type="word",e.value=n[t.value])}})),r.toString()};function importEnvironmentVariablesFromObject(e){return Object.assign({},Object(e).environmentVariables||Object(e)["environment-variables"])}async function importEnvironmentVariablesFromJSONFile(e){return importEnvironmentVariablesFromObject(await readJSON(n.resolve(e)))}async function importEnvironmentVariablesFromJSFile(e){const t=await import(r.pathToFileURL(n.resolve(e)));return importEnvironmentVariablesFromObject("default"in t?t.default:t)}const readFile=e=>new Promise(((n,r)=>{t.readFile(e,"utf8",((e,t)=>{e?r(e):n(t)}))})),readJSON=async e=>JSON.parse(await readFile(e));function creator(e){const t=[].concat(Object(e).importFrom||[]),r=t.map((e=>{if(e instanceof Promise)return e;if(e instanceof Function)return e();const t=e===Object(e)?e:{from:String(e)};if(t.environmentVariables||t["environment-variables"])return t;const r=String(t.from||"");return{type:(t.type||n.extname(r).slice(1)).toLowerCase(),from:r}})).reduce((async(e,t)=>{const{type:n,from:r}=await t;return"js"===n||"cjs"===n?Object.assign(e,await importEnvironmentVariablesFromJSFile(r)):"json"===n?Object.assign(e,await importEnvironmentVariablesFromJSONFile(r)):Object.assign(e,importEnvironmentVariablesFromObject(await t))}),{});const a="disableDeprecationNotice"in Object(e)&&Boolean(e.disableDeprecationNotice);let i=!1;return{postcssPlugin:"postcss-env-fn",async AtRule(e,{result:t}){let n;try{n=getReplacedValue(e.params,await r)}catch{e.warn(t,`Failed to parse params '${e.params}' as an environment value. Leaving the original value intact.`)}void 0!==n&&n!==e.params&&(e.params=n,a||i||(i=!0,e.warn(t,"postcss-env-function is deprecated and will be removed.\nCheck the discussion on github for more details. https://github.com/csstools/postcss-plugins/discussions/192")))},async Declaration(e,{result:t}){let n;try{n=getReplacedValue(e.value,await r)}catch{e.warn(t,`Failed to parse value '${e.value}' as an environment value. Leaving the original value intact.`)}void 0!==n&&n!==e.value&&(e.value=n,a||i||(i=!0,e.warn(t,"postcss-env-function is deprecated and will be removed.\nWe are looking for insights and anecdotes on how these features are used so that we can design the best alternative.\nPlease let us know if our proposal will work for you.\nVisit the discussion on github for more details. https://github.com/csstools/postcss-plugins/discussions/192")))}}}creator.postcss=!0,module.exports=creator;
diff --git a/plugins/postcss-env-function/dist/index.mjs b/plugins/postcss-env-function/dist/index.mjs
index 7bd407386..d757054c3 100644
--- a/plugins/postcss-env-function/dist/index.mjs
+++ b/plugins/postcss-env-function/dist/index.mjs
@@ -1 +1 @@
-import e from"postcss-value-parser";import t from"fs";import n from"path";import a from"url";var isEnvFunc=e=>e&&"function"===e.type&&"env"===e.value,getReplacedValue=(t,n)=>{const a=e(t);return a.walk((e=>{if(isEnvFunc(e)){const[t]=e.nodes;"word"===t.type&&void 0!==n[t.value]&&(e.nodes=[],e.type="word",e.value=n[t.value])}})),a.toString()};function importEnvironmentVariablesFromObject(e){return Object.assign({},Object(e).environmentVariables||Object(e)["environment-variables"])}async function importEnvironmentVariablesFromJSONFile(e){return importEnvironmentVariablesFromObject(await readJSON(n.resolve(e)))}async function importEnvironmentVariablesFromJSFile(e){const t=await import(a.pathToFileURL(n.resolve(e)));return importEnvironmentVariablesFromObject("default"in t?t.default:t)}const readFile=e=>new Promise(((n,a)=>{t.readFile(e,"utf8",((e,t)=>{e?a(e):n(t)}))})),readJSON=async e=>JSON.parse(await readFile(e));function creator(e){const t=[].concat(Object(e).importFrom||[]),a=t.map((e=>{if(e instanceof Promise)return e;if(e instanceof Function)return e();const t=e===Object(e)?e:{from:String(e)};if(t.environmentVariables||t["environment-variables"])return t;const a=String(t.from||"");return{type:(t.type||n.extname(a).slice(1)).toLowerCase(),from:a}})).reduce((async(e,t)=>{const{type:n,from:a}=await t;return"js"===n||"cjs"===n?Object.assign(e,await importEnvironmentVariablesFromJSFile(a)):"json"===n?Object.assign(e,await importEnvironmentVariablesFromJSONFile(a)):Object.assign(e,importEnvironmentVariablesFromObject(await t))}),{});const r="disableDeprecationNotice"in Object(e)&&Boolean(e.disableDeprecationNotice);let o=!1;return{postcssPlugin:"postcss-env-fn",async AtRule(e,{result:t}){let n;try{n=getReplacedValue(e.params,await a)}catch{e.warn(t,`Failed to parse params '${e.params}' as an environment value. Leaving the original value intact.`)}void 0!==n&&n!==e.params&&(e.params=n,r||o||(o=!0,e.warn(t,"postcss-env-function is deprecated and will be removed.\nCheck the discussion on github for more details. https://github.com/csstools/postcss-plugins/discussions/192")))},async Declaration(e,{result:t}){let n;try{n=getReplacedValue(e.value,await a)}catch{e.warn(t,`Failed to parse value '${e.value}' as an environment value. Leaving the original value intact.`)}void 0!==n&&n!==e.value&&(e.value=n,r||o||(o=!0,e.warn(t,"postcss-env-function is deprecated and will be removed.\nWe are looking for insights and anecdotes on how these features are used so that we can design the best alternative.\nPlease let us know if our proposal will work for you.\nVisit the discussion on github for more details. https://github.com/csstools/postcss-plugins/discussions/192")))}}}creator.postcss=!0;export{creator as default};
+import e from"postcss-value-parser";import t from"node:fs";import n from"node:path";import a from"node:url";var isEnvFunc=e=>e&&"function"===e.type&&"env"===e.value,getReplacedValue=(t,n)=>{const a=e(t);return a.walk((e=>{if(isEnvFunc(e)){const[t]=e.nodes;"word"===t.type&&void 0!==n[t.value]&&(e.nodes=[],e.type="word",e.value=n[t.value])}})),a.toString()};function importEnvironmentVariablesFromObject(e){return Object.assign({},Object(e).environmentVariables||Object(e)["environment-variables"])}async function importEnvironmentVariablesFromJSONFile(e){return importEnvironmentVariablesFromObject(await readJSON(n.resolve(e)))}async function importEnvironmentVariablesFromJSFile(e){const t=await import(a.pathToFileURL(n.resolve(e)));return importEnvironmentVariablesFromObject("default"in t?t.default:t)}const readFile=e=>new Promise(((n,a)=>{t.readFile(e,"utf8",((e,t)=>{e?a(e):n(t)}))})),readJSON=async e=>JSON.parse(await readFile(e));function creator(e){const t=[].concat(Object(e).importFrom||[]),a=t.map((e=>{if(e instanceof Promise)return e;if(e instanceof Function)return e();const t=e===Object(e)?e:{from:String(e)};if(t.environmentVariables||t["environment-variables"])return t;const a=String(t.from||"");return{type:(t.type||n.extname(a).slice(1)).toLowerCase(),from:a}})).reduce((async(e,t)=>{const{type:n,from:a}=await t;return"js"===n||"cjs"===n?Object.assign(e,await importEnvironmentVariablesFromJSFile(a)):"json"===n?Object.assign(e,await importEnvironmentVariablesFromJSONFile(a)):Object.assign(e,importEnvironmentVariablesFromObject(await t))}),{});const o="disableDeprecationNotice"in Object(e)&&Boolean(e.disableDeprecationNotice);let r=!1;return{postcssPlugin:"postcss-env-fn",async AtRule(e,{result:t}){let n;try{n=getReplacedValue(e.params,await a)}catch{e.warn(t,`Failed to parse params '${e.params}' as an environment value. Leaving the original value intact.`)}void 0!==n&&n!==e.params&&(e.params=n,o||r||(r=!0,e.warn(t,"postcss-env-function is deprecated and will be removed.\nCheck the discussion on github for more details. https://github.com/csstools/postcss-plugins/discussions/192")))},async Declaration(e,{result:t}){let n;try{n=getReplacedValue(e.value,await a)}catch{e.warn(t,`Failed to parse value '${e.value}' as an environment value. Leaving the original value intact.`)}void 0!==n&&n!==e.value&&(e.value=n,o||r||(r=!0,e.warn(t,"postcss-env-function is deprecated and will be removed.\nWe are looking for insights and anecdotes on how these features are used so that we can design the best alternative.\nPlease let us know if our proposal will work for you.\nVisit the discussion on github for more details. https://github.com/csstools/postcss-plugins/discussions/192")))}}}creator.postcss=!0;export{creator as default};
diff --git a/plugins/postcss-env-function/package.json b/plugins/postcss-env-function/package.json
index 42f3b75ec..efe3ebeed 100644
--- a/plugins/postcss-env-function/package.json
+++ b/plugins/postcss-env-function/package.json
@@ -15,7 +15,7 @@
}
],
"engines": {
- "node": "^14 || ^16 || >=18"
+ "node": ">=18"
},
"main": "dist/index.cjs",
"module": "dist/index.mjs",
diff --git a/plugins/postcss-env-function/src/lib/import-from.js b/plugins/postcss-env-function/src/lib/import-from.js
index b2a43b7bb..53b74697c 100644
--- a/plugins/postcss-env-function/src/lib/import-from.js
+++ b/plugins/postcss-env-function/src/lib/import-from.js
@@ -1,6 +1,6 @@
-import fs from 'fs';
-import path from 'path';
-import url from 'url';
+import fs from 'node:fs';
+import path from 'node:path';
+import url from 'node:url';
/**
* Import Custom Properties from Object
diff --git a/plugins/postcss-env-function/test/_import.mjs b/plugins/postcss-env-function/test/_import.mjs
index 0ecf566d1..7b3e60728 100644
--- a/plugins/postcss-env-function/test/_import.mjs
+++ b/plugins/postcss-env-function/test/_import.mjs
@@ -1,4 +1,4 @@
-import assert from 'assert';
+import assert from 'node:assert';
import plugin from 'postcss-env-function';
plugin();
diff --git a/plugins/postcss-exponential-functions/CHANGELOG.md b/plugins/postcss-exponential-functions/CHANGELOG.md
index ea31b60c4..a091489ef 100644
--- a/plugins/postcss-exponential-functions/CHANGELOG.md
+++ b/plugins/postcss-exponential-functions/CHANGELOG.md
@@ -1,5 +1,9 @@
# Changes to PostCSS Exponential Functions
+### Unreleased (major)
+
+- Updated: Support for Node v18+ (major).
+
### 1.0.9
_July 6, 2024_
diff --git a/plugins/postcss-exponential-functions/package.json b/plugins/postcss-exponential-functions/package.json
index bf7b5cd87..6b761c4e7 100644
--- a/plugins/postcss-exponential-functions/package.json
+++ b/plugins/postcss-exponential-functions/package.json
@@ -25,7 +25,7 @@
}
],
"engines": {
- "node": "^14 || ^16 || >=18"
+ "node": ">=18"
},
"type": "module",
"main": "dist/index.cjs",
diff --git a/plugins/postcss-exponential-functions/test/_import.mjs b/plugins/postcss-exponential-functions/test/_import.mjs
index 240e87f86..508da06ca 100644
--- a/plugins/postcss-exponential-functions/test/_import.mjs
+++ b/plugins/postcss-exponential-functions/test/_import.mjs
@@ -1,4 +1,4 @@
-import assert from 'assert';
+import assert from 'node:assert';
import plugin from '@csstools/postcss-exponential-functions';
plugin();
diff --git a/plugins/postcss-extract/CHANGELOG.md b/plugins/postcss-extract/CHANGELOG.md
index 7ced6dbda..b0607ddd1 100644
--- a/plugins/postcss-extract/CHANGELOG.md
+++ b/plugins/postcss-extract/CHANGELOG.md
@@ -1,5 +1,9 @@
# Changes to PostCSS Extract
+### Unreleased (major)
+
+- Updated: Support for Node v18+ (major).
+
### 3.0.1
_December 15, 2023_
diff --git a/plugins/postcss-extract/package.json b/plugins/postcss-extract/package.json
index 4ca293b46..2d6ac7e5f 100644
--- a/plugins/postcss-extract/package.json
+++ b/plugins/postcss-extract/package.json
@@ -25,7 +25,7 @@
}
],
"engines": {
- "node": "^14 || ^16 || >=18"
+ "node": ">=18"
},
"type": "module",
"main": "dist/index.cjs",
diff --git a/plugins/postcss-extract/test/_import.mjs b/plugins/postcss-extract/test/_import.mjs
index 810495738..b36a5511b 100644
--- a/plugins/postcss-extract/test/_import.mjs
+++ b/plugins/postcss-extract/test/_import.mjs
@@ -1,4 +1,4 @@
-import assert from 'assert';
+import assert from 'node:assert';
import plugin from '@csstools/postcss-extract';
plugin();
diff --git a/plugins/postcss-extract/test/_tape.mjs b/plugins/postcss-extract/test/_tape.mjs
index 310f13739..ac88ccc70 100644
--- a/plugins/postcss-extract/test/_tape.mjs
+++ b/plugins/postcss-extract/test/_tape.mjs
@@ -1,6 +1,6 @@
import { postcssTape } from '@csstools/postcss-tape';
import plugin from '@csstools/postcss-extract';
-import assert from 'assert';
+import assert from 'node:assert';
postcssTape(plugin)({
'variables': {
diff --git a/plugins/postcss-focus-visible/CHANGELOG.md b/plugins/postcss-focus-visible/CHANGELOG.md
index 2835ac870..a2e44c30d 100644
--- a/plugins/postcss-focus-visible/CHANGELOG.md
+++ b/plugins/postcss-focus-visible/CHANGELOG.md
@@ -1,5 +1,9 @@
# Changes to PostCSS Focus Visible
+### Unreleased (major)
+
+- Updated: Support for Node v18+ (major).
+
### 9.0.1
_December 15, 2023_
diff --git a/plugins/postcss-focus-visible/package.json b/plugins/postcss-focus-visible/package.json
index 99737964b..af8c1ae0b 100644
--- a/plugins/postcss-focus-visible/package.json
+++ b/plugins/postcss-focus-visible/package.json
@@ -25,7 +25,7 @@
}
],
"engines": {
- "node": "^14 || ^16 || >=18"
+ "node": ">=18"
},
"type": "module",
"main": "dist/index.cjs",
diff --git a/plugins/postcss-focus-visible/test/_browser.mjs b/plugins/postcss-focus-visible/test/_browser.mjs
index d3452ed84..b581125bc 100644
--- a/plugins/postcss-focus-visible/test/_browser.mjs
+++ b/plugins/postcss-focus-visible/test/_browser.mjs
@@ -1,7 +1,7 @@
/* global window */
import puppeteer from 'puppeteer';
-import http from 'http';
-import { promises as fsp } from 'fs';
+import http from 'node:http';
+import fs from 'node:fs/promises';
import test from 'node:test';
import process from 'node:process';
@@ -15,12 +15,12 @@ const requestListener = async function (req, res) {
case '/':
res.setHeader('Content-type', 'text/html');
res.writeHead(200);
- res.end(await fsp.readFile('test/_browser.html', 'utf8'));
+ res.end(await fs.readFile('test/_browser.html', 'utf8'));
break;
case '/test/browser.expect.css':
res.setHeader('Content-type', 'text/css');
res.writeHead(200);
- res.end(await fsp.readFile('test/browser.expect.css', 'utf8'));
+ res.end(await fs.readFile('test/browser.expect.css', 'utf8'));
break;
default:
res.setHeader('Content-type', 'text/plain');
@@ -47,59 +47,61 @@ if (!process.env.DEBUG) {
headless: 'new',
});
- const page = await browser.newPage();
- page.on('pageerror', (msg) => {
- throw msg;
- });
-
- // Default
- {
- await page.goto('http://localhost:8080');
-
- // None of the elements should have styles
- await page.evaluate(async () => window.checkElement('default', 'a', false));
- await page.evaluate(async () => window.checkElement('default', 'b', false));
- await page.evaluate(async () => window.checkElement('default', 'c', false));
-
- await page.keyboard.press('Tab');
- await page.evaluate(async () => window.checkElement('default', 'a', true));
- await page.evaluate(async () => window.checkElement('default', 'b', false));
- await page.evaluate(async () => window.checkElement('default', 'c', false));
-
- await page.keyboard.press('Tab');
- await page.evaluate(async () => window.checkElement('default', 'a', false));
- await page.evaluate(async () => window.checkElement('default', 'b', true));
- await page.evaluate(async () => window.checkElement('default', 'c', false));
-
- await page.keyboard.press('Tab');
- await page.evaluate(async () => window.checkElement('default', 'a', false));
- await page.evaluate(async () => window.checkElement('default', 'b', false));
- await page.evaluate(async () => window.checkElement('default', 'c', true));
- }
-
- // Clicking
- {
- await page.goto('http://localhost:8080');
-
- // None of the elements should have styles
- await page.evaluate(async () => window.checkElement('click', 'a', false));
- await page.evaluate(async () => window.checkElement('click', 'b', false));
- await page.evaluate(async () => window.checkElement('click', 'c', false));
-
- await page.click('#a');
- await page.evaluate(async () => window.checkElement('click', 'a', true));
-
- await page.click('#b');
- await page.evaluate(async () => window.checkElement('click', 'b', true));
-
- // Clicking on a non-input element should not trigger focus-visible if not with keyboard
- await page.click('#c');
- await page.evaluate(async () => window.checkElement('click', 'c', false));
+ try {
+ const page = await browser.newPage();
+ page.on('pageerror', (msg) => {
+ throw msg;
+ });
+
+ // Default
+ {
+ await page.goto('http://localhost:8080');
+
+ // None of the elements should have styles
+ await page.evaluate(async () => window.checkElement('default', 'a', false));
+ await page.evaluate(async () => window.checkElement('default', 'b', false));
+ await page.evaluate(async () => window.checkElement('default', 'c', false));
+
+ await page.keyboard.press('Tab');
+ await page.evaluate(async () => window.checkElement('default', 'a', true));
+ await page.evaluate(async () => window.checkElement('default', 'b', false));
+ await page.evaluate(async () => window.checkElement('default', 'c', false));
+
+ await page.keyboard.press('Tab');
+ await page.evaluate(async () => window.checkElement('default', 'a', false));
+ await page.evaluate(async () => window.checkElement('default', 'b', true));
+ await page.evaluate(async () => window.checkElement('default', 'c', false));
+
+ await page.keyboard.press('Tab');
+ await page.evaluate(async () => window.checkElement('default', 'a', false));
+ await page.evaluate(async () => window.checkElement('default', 'b', false));
+ await page.evaluate(async () => window.checkElement('default', 'c', true));
+ }
+
+ // Clicking
+ {
+ await page.goto('http://localhost:8080');
+
+ // None of the elements should have styles
+ await page.evaluate(async () => window.checkElement('click', 'a', false));
+ await page.evaluate(async () => window.checkElement('click', 'b', false));
+ await page.evaluate(async () => window.checkElement('click', 'c', false));
+
+ await page.click('#a');
+ await page.evaluate(async () => window.checkElement('click', 'a', true));
+
+ await page.click('#b');
+ await page.evaluate(async () => window.checkElement('click', 'b', true));
+
+ // Clicking on a non-input element should not trigger focus-visible if not with keyboard
+ await page.click('#c');
+ await page.evaluate(async () => window.checkElement('click', 'c', false));
+ }
+ } finally {
+ await browser.close();
+
+ await cleanup();
}
-
- await browser.close();
-
- await cleanup();
});
} else {
startServers();
diff --git a/plugins/postcss-focus-visible/test/_import.mjs b/plugins/postcss-focus-visible/test/_import.mjs
index ebf547ec3..2e67fd1b6 100644
--- a/plugins/postcss-focus-visible/test/_import.mjs
+++ b/plugins/postcss-focus-visible/test/_import.mjs
@@ -1,4 +1,4 @@
-import assert from 'assert';
+import assert from 'node:assert';
import plugin from 'postcss-focus-visible';
plugin();
diff --git a/plugins/postcss-focus-within/CHANGELOG.md b/plugins/postcss-focus-within/CHANGELOG.md
index b37e488ab..d8c3af08d 100644
--- a/plugins/postcss-focus-within/CHANGELOG.md
+++ b/plugins/postcss-focus-within/CHANGELOG.md
@@ -1,5 +1,9 @@
# Changes to PostCSS Focus Within
+### Unreleased (major)
+
+- Updated: Support for Node v18+ (major).
+
### 8.0.1
_December 15, 2023_
diff --git a/plugins/postcss-focus-within/package.json b/plugins/postcss-focus-within/package.json
index 993bf4712..9c6b47783 100644
--- a/plugins/postcss-focus-within/package.json
+++ b/plugins/postcss-focus-within/package.json
@@ -29,7 +29,7 @@
}
],
"engines": {
- "node": "^14 || ^16 || >=18"
+ "node": ">=18"
},
"type": "module",
"main": "dist/index.cjs",
diff --git a/plugins/postcss-focus-within/test/_browser.mjs b/plugins/postcss-focus-within/test/_browser.mjs
index 5e067449b..1f317214a 100644
--- a/plugins/postcss-focus-within/test/_browser.mjs
+++ b/plugins/postcss-focus-within/test/_browser.mjs
@@ -1,7 +1,7 @@
/* global window */
import puppeteer from 'puppeteer';
-import http from 'http';
-import { promises as fsp } from 'fs';
+import http from 'node:http';
+import fs from 'node:fs/promises';
import test from 'node:test';
import process from 'node:process';
@@ -15,27 +15,27 @@ const requestListener = async function (req, res) {
case '/':
res.setHeader('Content-type', 'text/html');
res.writeHead(200);
- res.end(await fsp.readFile('test/_browser.html', 'utf8'));
+ res.end(await fs.readFile('test/_browser.html', 'utf8'));
break;
case '/test/browser.expect.css':
res.setHeader('Content-type', 'text/css');
res.writeHead(200);
- res.end(await fsp.readFile('test/browser.expect.css', 'utf8'));
+ res.end(await fs.readFile('test/browser.expect.css', 'utf8'));
break;
case '/dist/browser-global.js':
res.setHeader('Content-type', 'text/javascript');
res.writeHead(200);
- res.end(await fsp.readFile('dist/browser-global.js', 'utf8'));
+ res.end(await fs.readFile('dist/browser-global.js', 'utf8'));
break;
case '/replace-with':
res.setHeader('Content-type', 'text/html');
res.writeHead(200);
- res.end(await fsp.readFile('test/_browser_replace.html', 'utf8'));
+ res.end(await fs.readFile('test/_browser_replace.html', 'utf8'));
break;
case '/test/browser.replacewith.expect.css':
res.setHeader('Content-type', 'text/css');
res.writeHead(200);
- res.end(await fsp.readFile('test/browser.replacewith.expect.css', 'utf8'));
+ res.end(await fs.readFile('test/browser.replacewith.expect.css', 'utf8'));
break;
default:
res.setHeader('Content-type', 'text/plain');
@@ -62,107 +62,109 @@ if (!process.env.DEBUG) {
headless: 'new',
});
- const page = await browser.newPage();
- page.on('pageerror', (msg) => {
- throw msg;
- });
-
- // Default
- {
- await page.goto('http://localhost:8080');
-
- await page.evaluate(async () => window._focusWithinInit({ force: true }));
-
- // None of the elements should have styles
- await page.evaluate(async () => window.checkElement('default', 'a-grand-parent', false));
- await page.evaluate(async () => window.checkElement('default', 'a-grand-parent-input', false));
- await page.evaluate(async () => window.checkElement('default', 'a-parent', false));
- await page.evaluate(async () => window.checkElement('default', 'a-parent-input', false));
- await page.evaluate(async () => window.checkElement('default', 'a-child', false));
- await page.evaluate(async () => window.checkElement('default', 'a-child-input', false));
-
- await page.click('#a-grand-parent-input');
- await page.evaluate(async () => window.checkElement('default', 'a-grand-parent', true));
- await page.evaluate(async () => window.checkElement('default', 'a-grand-parent-input', true));
- await page.evaluate(async () => window.checkElement('default', 'a-parent', false));
- await page.evaluate(async () => window.checkElement('default', 'a-parent-input', false));
- await page.evaluate(async () => window.checkElement('default', 'a-child', false));
- await page.evaluate(async () => window.checkElement('default', 'a-child-input', false));
-
- await page.click('#a-parent-input');
- await page.evaluate(async () => window.checkElement('default', 'a-grand-parent', true));
- await page.evaluate(async () => window.checkElement('default', 'a-grand-parent-input', false));
- await page.evaluate(async () => window.checkElement('default', 'a-parent', true));
- await page.evaluate(async () => window.checkElement('default', 'a-parent-input', true));
- await page.evaluate(async () => window.checkElement('default', 'a-child', false));
- await page.evaluate(async () => window.checkElement('default', 'a-child-input', false));
-
- await page.click('#a-child-input');
- await page.evaluate(async () => window.checkElement('default', 'a-grand-parent', true));
- await page.evaluate(async () => window.checkElement('default', 'a-grand-parent-input', false));
- await page.evaluate(async () => window.checkElement('default', 'a-parent', true));
- await page.evaluate(async () => window.checkElement('default', 'a-parent-input', false));
- await page.evaluate(async () => window.checkElement('default', 'a-child', true));
- await page.evaluate(async () => window.checkElement('default', 'a-child-input', true));
-
- await page.click('body');
- await page.evaluate(async () => window.checkElement('default', 'a-grand-parent', false));
- await page.evaluate(async () => window.checkElement('default', 'a-grand-parent-input', false));
- await page.evaluate(async () => window.checkElement('default', 'a-parent', false));
- await page.evaluate(async () => window.checkElement('default', 'a-parent-input', false));
- await page.evaluate(async () => window.checkElement('default', 'a-child', false));
- await page.evaluate(async () => window.checkElement('default', 'a-child-input', false));
+ try {
+ const page = await browser.newPage();
+ page.on('pageerror', (msg) => {
+ throw msg;
+ });
+
+ // Default
+ {
+ await page.goto('http://localhost:8080');
+
+ await page.evaluate(async () => window._focusWithinInit({ force: true }));
+
+ // None of the elements should have styles
+ await page.evaluate(async () => window.checkElement('default', 'a-grand-parent', false));
+ await page.evaluate(async () => window.checkElement('default', 'a-grand-parent-input', false));
+ await page.evaluate(async () => window.checkElement('default', 'a-parent', false));
+ await page.evaluate(async () => window.checkElement('default', 'a-parent-input', false));
+ await page.evaluate(async () => window.checkElement('default', 'a-child', false));
+ await page.evaluate(async () => window.checkElement('default', 'a-child-input', false));
+
+ await page.click('#a-grand-parent-input');
+ await page.evaluate(async () => window.checkElement('default', 'a-grand-parent', true));
+ await page.evaluate(async () => window.checkElement('default', 'a-grand-parent-input', true));
+ await page.evaluate(async () => window.checkElement('default', 'a-parent', false));
+ await page.evaluate(async () => window.checkElement('default', 'a-parent-input', false));
+ await page.evaluate(async () => window.checkElement('default', 'a-child', false));
+ await page.evaluate(async () => window.checkElement('default', 'a-child-input', false));
+
+ await page.click('#a-parent-input');
+ await page.evaluate(async () => window.checkElement('default', 'a-grand-parent', true));
+ await page.evaluate(async () => window.checkElement('default', 'a-grand-parent-input', false));
+ await page.evaluate(async () => window.checkElement('default', 'a-parent', true));
+ await page.evaluate(async () => window.checkElement('default', 'a-parent-input', true));
+ await page.evaluate(async () => window.checkElement('default', 'a-child', false));
+ await page.evaluate(async () => window.checkElement('default', 'a-child-input', false));
+
+ await page.click('#a-child-input');
+ await page.evaluate(async () => window.checkElement('default', 'a-grand-parent', true));
+ await page.evaluate(async () => window.checkElement('default', 'a-grand-parent-input', false));
+ await page.evaluate(async () => window.checkElement('default', 'a-parent', true));
+ await page.evaluate(async () => window.checkElement('default', 'a-parent-input', false));
+ await page.evaluate(async () => window.checkElement('default', 'a-child', true));
+ await page.evaluate(async () => window.checkElement('default', 'a-child-input', true));
+
+ await page.click('body');
+ await page.evaluate(async () => window.checkElement('default', 'a-grand-parent', false));
+ await page.evaluate(async () => window.checkElement('default', 'a-grand-parent-input', false));
+ await page.evaluate(async () => window.checkElement('default', 'a-parent', false));
+ await page.evaluate(async () => window.checkElement('default', 'a-parent-input', false));
+ await page.evaluate(async () => window.checkElement('default', 'a-child', false));
+ await page.evaluate(async () => window.checkElement('default', 'a-child-input', false));
+ }
+
+ // Replace with
+ {
+ await page.goto('http://localhost:8080/replace-with');
+
+ await page.evaluate(async () => window._focusWithinInit({ force: true, replaceWith: '.focus-within' }));
+
+ // None of the elements should have styles
+ await page.evaluate(async () => window.checkElement('default', 'a-grand-parent', false));
+ await page.evaluate(async () => window.checkElement('default', 'a-grand-parent-input', false));
+ await page.evaluate(async () => window.checkElement('default', 'a-parent', false));
+ await page.evaluate(async () => window.checkElement('default', 'a-parent-input', false));
+ await page.evaluate(async () => window.checkElement('default', 'a-child', false));
+ await page.evaluate(async () => window.checkElement('default', 'a-child-input', false));
+
+ await page.click('#a-grand-parent-input');
+ await page.evaluate(async () => window.checkElement('default', 'a-grand-parent', true));
+ await page.evaluate(async () => window.checkElement('default', 'a-grand-parent-input', true));
+ await page.evaluate(async () => window.checkElement('default', 'a-parent', false));
+ await page.evaluate(async () => window.checkElement('default', 'a-parent-input', false));
+ await page.evaluate(async () => window.checkElement('default', 'a-child', false));
+ await page.evaluate(async () => window.checkElement('default', 'a-child-input', false));
+
+ await page.click('#a-parent-input');
+ await page.evaluate(async () => window.checkElement('default', 'a-grand-parent', true));
+ await page.evaluate(async () => window.checkElement('default', 'a-grand-parent-input', false));
+ await page.evaluate(async () => window.checkElement('default', 'a-parent', true));
+ await page.evaluate(async () => window.checkElement('default', 'a-parent-input', true));
+ await page.evaluate(async () => window.checkElement('default', 'a-child', false));
+ await page.evaluate(async () => window.checkElement('default', 'a-child-input', false));
+
+ await page.click('#a-child-input');
+ await page.evaluate(async () => window.checkElement('default', 'a-grand-parent', true));
+ await page.evaluate(async () => window.checkElement('default', 'a-grand-parent-input', false));
+ await page.evaluate(async () => window.checkElement('default', 'a-parent', true));
+ await page.evaluate(async () => window.checkElement('default', 'a-parent-input', false));
+ await page.evaluate(async () => window.checkElement('default', 'a-child', true));
+ await page.evaluate(async () => window.checkElement('default', 'a-child-input', true));
+
+ await page.click('body');
+ await page.evaluate(async () => window.checkElement('default', 'a-grand-parent', false));
+ await page.evaluate(async () => window.checkElement('default', 'a-grand-parent-input', false));
+ await page.evaluate(async () => window.checkElement('default', 'a-parent', false));
+ await page.evaluate(async () => window.checkElement('default', 'a-parent-input', false));
+ await page.evaluate(async () => window.checkElement('default', 'a-child', false));
+ await page.evaluate(async () => window.checkElement('default', 'a-child-input', false));
+ }
+ } finally {
+ await browser.close();
+ await cleanup();
}
-
- // Replace with
- {
- await page.goto('http://localhost:8080/replace-with');
-
- await page.evaluate(async () => window._focusWithinInit({ force: true, replaceWith: '.focus-within' }));
-
- // None of the elements should have styles
- await page.evaluate(async () => window.checkElement('default', 'a-grand-parent', false));
- await page.evaluate(async () => window.checkElement('default', 'a-grand-parent-input', false));
- await page.evaluate(async () => window.checkElement('default', 'a-parent', false));
- await page.evaluate(async () => window.checkElement('default', 'a-parent-input', false));
- await page.evaluate(async () => window.checkElement('default', 'a-child', false));
- await page.evaluate(async () => window.checkElement('default', 'a-child-input', false));
-
- await page.click('#a-grand-parent-input');
- await page.evaluate(async () => window.checkElement('default', 'a-grand-parent', true));
- await page.evaluate(async () => window.checkElement('default', 'a-grand-parent-input', true));
- await page.evaluate(async () => window.checkElement('default', 'a-parent', false));
- await page.evaluate(async () => window.checkElement('default', 'a-parent-input', false));
- await page.evaluate(async () => window.checkElement('default', 'a-child', false));
- await page.evaluate(async () => window.checkElement('default', 'a-child-input', false));
-
- await page.click('#a-parent-input');
- await page.evaluate(async () => window.checkElement('default', 'a-grand-parent', true));
- await page.evaluate(async () => window.checkElement('default', 'a-grand-parent-input', false));
- await page.evaluate(async () => window.checkElement('default', 'a-parent', true));
- await page.evaluate(async () => window.checkElement('default', 'a-parent-input', true));
- await page.evaluate(async () => window.checkElement('default', 'a-child', false));
- await page.evaluate(async () => window.checkElement('default', 'a-child-input', false));
-
- await page.click('#a-child-input');
- await page.evaluate(async () => window.checkElement('default', 'a-grand-parent', true));
- await page.evaluate(async () => window.checkElement('default', 'a-grand-parent-input', false));
- await page.evaluate(async () => window.checkElement('default', 'a-parent', true));
- await page.evaluate(async () => window.checkElement('default', 'a-parent-input', false));
- await page.evaluate(async () => window.checkElement('default', 'a-child', true));
- await page.evaluate(async () => window.checkElement('default', 'a-child-input', true));
-
- await page.click('body');
- await page.evaluate(async () => window.checkElement('default', 'a-grand-parent', false));
- await page.evaluate(async () => window.checkElement('default', 'a-grand-parent-input', false));
- await page.evaluate(async () => window.checkElement('default', 'a-parent', false));
- await page.evaluate(async () => window.checkElement('default', 'a-parent-input', false));
- await page.evaluate(async () => window.checkElement('default', 'a-child', false));
- await page.evaluate(async () => window.checkElement('default', 'a-child-input', false));
- }
-
- await browser.close();
- await cleanup();
});
} else {
startServers();
diff --git a/plugins/postcss-focus-within/test/_import.mjs b/plugins/postcss-focus-within/test/_import.mjs
index ad2b8b80e..52e3fadff 100644
--- a/plugins/postcss-focus-within/test/_import.mjs
+++ b/plugins/postcss-focus-within/test/_import.mjs
@@ -1,4 +1,4 @@
-import assert from 'assert';
+import assert from 'node:assert';
import plugin from 'postcss-focus-within';
plugin();
diff --git a/plugins/postcss-font-format-keywords/CHANGELOG.md b/plugins/postcss-font-format-keywords/CHANGELOG.md
index bc4f1c47c..cbe761275 100644
--- a/plugins/postcss-font-format-keywords/CHANGELOG.md
+++ b/plugins/postcss-font-format-keywords/CHANGELOG.md
@@ -1,5 +1,9 @@
# Changes to PostCSS Font Format
+### Unreleased (major)
+
+- Updated: Support for Node v18+ (major).
+
### 3.0.2
_February 19, 2024_
diff --git a/plugins/postcss-font-format-keywords/package.json b/plugins/postcss-font-format-keywords/package.json
index 1213bdd5e..5b2843720 100644
--- a/plugins/postcss-font-format-keywords/package.json
+++ b/plugins/postcss-font-format-keywords/package.json
@@ -15,7 +15,7 @@
}
],
"engines": {
- "node": "^14 || ^16 || >=18"
+ "node": ">=18"
},
"type": "module",
"main": "dist/index.cjs",
diff --git a/plugins/postcss-font-format-keywords/src/index.ts b/plugins/postcss-font-format-keywords/src/index.ts
index 57b666876..994e392e3 100644
--- a/plugins/postcss-font-format-keywords/src/index.ts
+++ b/plugins/postcss-font-format-keywords/src/index.ts
@@ -1,5 +1,6 @@
import type { AtRule, PluginCreator } from 'postcss';
-import valueParser, { StringNode } from 'postcss-value-parser';
+import type { StringNode } from 'postcss-value-parser';
+import valueParser from 'postcss-value-parser';
import { hasFallback } from '@csstools/utilities';
const keywords = [
diff --git a/plugins/postcss-font-format-keywords/test/_import.mjs b/plugins/postcss-font-format-keywords/test/_import.mjs
index 8131e4572..fb900690c 100644
--- a/plugins/postcss-font-format-keywords/test/_import.mjs
+++ b/plugins/postcss-font-format-keywords/test/_import.mjs
@@ -1,4 +1,4 @@
-import assert from 'assert';
+import assert from 'node:assert';
import plugin from '@csstools/postcss-font-format-keywords';
plugin();
diff --git a/plugins/postcss-gamut-mapping/CHANGELOG.md b/plugins/postcss-gamut-mapping/CHANGELOG.md
index 2a59415ca..db83096ab 100644
--- a/plugins/postcss-gamut-mapping/CHANGELOG.md
+++ b/plugins/postcss-gamut-mapping/CHANGELOG.md
@@ -1,7 +1,8 @@
# Changes to PostCSS gamut-mapping
-### Unreleased (patch)
+### Unreleased (major)
+- Updated: Support for Node v18+ (major).
- Updated [`@csstools/css-color-parser`](https://github.com/csstools/postcss-plugins/tree/main/packages/css-color-parser) to [`2.0.5`](https://github.com/csstools/postcss-plugins/tree/main/packages/css-color-parser/CHANGELOG.md#205) (patch)
### 1.0.11
diff --git a/plugins/postcss-gamut-mapping/package.json b/plugins/postcss-gamut-mapping/package.json
index c0bfcdc7b..1535b9478 100644
--- a/plugins/postcss-gamut-mapping/package.json
+++ b/plugins/postcss-gamut-mapping/package.json
@@ -25,7 +25,7 @@
}
],
"engines": {
- "node": "^14 || ^16 || >=18"
+ "node": ">=18"
},
"type": "module",
"main": "dist/index.cjs",
diff --git a/plugins/postcss-gamut-mapping/test/_import.mjs b/plugins/postcss-gamut-mapping/test/_import.mjs
index 3c6f7f396..784e17997 100644
--- a/plugins/postcss-gamut-mapping/test/_import.mjs
+++ b/plugins/postcss-gamut-mapping/test/_import.mjs
@@ -1,4 +1,4 @@
-import assert from 'assert';
+import assert from 'node:assert';
import plugin from '@csstools/postcss-gamut-mapping';
plugin();
diff --git a/plugins/postcss-gap-properties/CHANGELOG.md b/plugins/postcss-gap-properties/CHANGELOG.md
index e6bee4842..6ef37789b 100644
--- a/plugins/postcss-gap-properties/CHANGELOG.md
+++ b/plugins/postcss-gap-properties/CHANGELOG.md
@@ -1,5 +1,9 @@
# Changes to PostCSS Gap Properties
+### Unreleased (major)
+
+- Updated: Support for Node v18+ (major).
+
### 5.0.1
_December 15, 2023_
diff --git a/plugins/postcss-gap-properties/package.json b/plugins/postcss-gap-properties/package.json
index a81c70ad2..9e6f53f66 100644
--- a/plugins/postcss-gap-properties/package.json
+++ b/plugins/postcss-gap-properties/package.json
@@ -29,7 +29,7 @@
}
],
"engines": {
- "node": "^14 || ^16 || >=18"
+ "node": ">=18"
},
"type": "module",
"main": "dist/index.cjs",
diff --git a/plugins/postcss-gap-properties/test/_import.mjs b/plugins/postcss-gap-properties/test/_import.mjs
index cbef490db..eef088454 100644
--- a/plugins/postcss-gap-properties/test/_import.mjs
+++ b/plugins/postcss-gap-properties/test/_import.mjs
@@ -1,4 +1,4 @@
-import assert from 'assert';
+import assert from 'node:assert';
import plugin from 'postcss-gap-properties';
plugin();
diff --git a/plugins/postcss-global-data/CHANGELOG.md b/plugins/postcss-global-data/CHANGELOG.md
index 54637e4fe..ae3be4774 100644
--- a/plugins/postcss-global-data/CHANGELOG.md
+++ b/plugins/postcss-global-data/CHANGELOG.md
@@ -1,5 +1,9 @@
# Changes to PostCSS global-data
+### Unreleased (major)
+
+- Updated: Support for Node v18+ (major).
+
### 2.1.1
_December 15, 2023_
diff --git a/plugins/postcss-global-data/dist/index.cjs b/plugins/postcss-global-data/dist/index.cjs
index d6924837f..1e16545c6 100644
--- a/plugins/postcss-global-data/dist/index.cjs
+++ b/plugins/postcss-global-data/dist/index.cjs
@@ -1 +1 @@
-"use strict";var e=require("path"),s=require("fs"),r=require("module");function parseImport(t,o,a,c){let n="";try{if(a.startsWith("node_modules://")){n=r.createRequire(process.cwd()).resolve(a.slice(15))}else if(a.startsWith("node_modules:")){n=r.createRequire(process.cwd()).resolve(a.slice(13))}else n=e.resolve(a)}catch(e){throw new Error(`Failed to read ${a} with error ${e instanceof Error?e.message:e}`)}if(c.has(n))return!1;c.add(n),o.result.messages.push({type:"dependency",plugin:"postcss-global-data",file:n,parent:t.source?.input?.file});const i=s.readFileSync(n,"utf8");return o.postcss.parse(i,{from:n})}const creator=e=>{const s=Object.assign({files:[]},e);return{postcssPlugin:"postcss-global-data",prepare(){let e=new Set,r=new Set;return{postcssPlugin:"postcss-global-data",Once(t,o){s.files.forEach((s=>{if(e.has(s))return;const a=parseImport(t,o,s,e);a&&a.each((e=>{t.append(e),r.add(e)}))}))},OnceExit(){r.forEach((e=>{e.remove()})),r=new Set,e=new Set}}}}};creator.postcss=!0,module.exports=creator;
+"use strict";var e=require("node:path"),s=require("node:fs"),r=require("node:module");function parseImport(t,o,a,n){let c="";try{if(a.startsWith("node_modules://")){c=r.createRequire(process.cwd()).resolve(a.slice(15))}else if(a.startsWith("node_modules:")){c=r.createRequire(process.cwd()).resolve(a.slice(13))}else c=e.resolve(a)}catch(e){throw new Error(`Failed to read ${a} with error ${e instanceof Error?e.message:e}`)}if(n.has(c))return!1;n.add(c),o.result.messages.push({type:"dependency",plugin:"postcss-global-data",file:c,parent:t.source?.input?.file});const i=s.readFileSync(c,"utf8");return o.postcss.parse(i,{from:c})}const creator=e=>{const s=Object.assign({files:[]},e);return{postcssPlugin:"postcss-global-data",prepare(){let e=new Set,r=new Set;return{postcssPlugin:"postcss-global-data",Once(t,o){s.files.forEach((s=>{if(e.has(s))return;const a=parseImport(t,o,s,e);a&&a.each((e=>{t.append(e),r.add(e)}))}))},OnceExit(){r.forEach((e=>{e.remove()})),r=new Set,e=new Set}}}}};creator.postcss=!0,module.exports=creator;
diff --git a/plugins/postcss-global-data/dist/index.mjs b/plugins/postcss-global-data/dist/index.mjs
index 46e88248c..c8c8b3cf7 100644
--- a/plugins/postcss-global-data/dist/index.mjs
+++ b/plugins/postcss-global-data/dist/index.mjs
@@ -1 +1 @@
-import e from"path";import s from"fs";import r from"module";function parseImport(t,o,a,c){let n="";try{if(a.startsWith("node_modules://")){n=r.createRequire(process.cwd()).resolve(a.slice(15))}else if(a.startsWith("node_modules:")){n=r.createRequire(process.cwd()).resolve(a.slice(13))}else n=e.resolve(a)}catch(e){throw new Error(`Failed to read ${a} with error ${e instanceof Error?e.message:e}`)}if(c.has(n))return!1;c.add(n),o.result.messages.push({type:"dependency",plugin:"postcss-global-data",file:n,parent:t.source?.input?.file});const l=s.readFileSync(n,"utf8");return o.postcss.parse(l,{from:n})}const creator=e=>{const s=Object.assign({files:[]},e);return{postcssPlugin:"postcss-global-data",prepare(){let e=new Set,r=new Set;return{postcssPlugin:"postcss-global-data",Once(t,o){s.files.forEach((s=>{if(e.has(s))return;const a=parseImport(t,o,s,e);a&&a.each((e=>{t.append(e),r.add(e)}))}))},OnceExit(){r.forEach((e=>{e.remove()})),r=new Set,e=new Set}}}}};creator.postcss=!0;export{creator as default};
+import e from"node:path";import s from"node:fs";import r from"node:module";function parseImport(t,o,a,n){let c="";try{if(a.startsWith("node_modules://")){c=r.createRequire(process.cwd()).resolve(a.slice(15))}else if(a.startsWith("node_modules:")){c=r.createRequire(process.cwd()).resolve(a.slice(13))}else c=e.resolve(a)}catch(e){throw new Error(`Failed to read ${a} with error ${e instanceof Error?e.message:e}`)}if(n.has(c))return!1;n.add(c),o.result.messages.push({type:"dependency",plugin:"postcss-global-data",file:c,parent:t.source?.input?.file});const l=s.readFileSync(c,"utf8");return o.postcss.parse(l,{from:c})}const creator=e=>{const s=Object.assign({files:[]},e);return{postcssPlugin:"postcss-global-data",prepare(){let e=new Set,r=new Set;return{postcssPlugin:"postcss-global-data",Once(t,o){s.files.forEach((s=>{if(e.has(s))return;const a=parseImport(t,o,s,e);a&&a.each((e=>{t.append(e),r.add(e)}))}))},OnceExit(){r.forEach((e=>{e.remove()})),r=new Set,e=new Set}}}}};creator.postcss=!0;export{creator as default};
diff --git a/plugins/postcss-global-data/package.json b/plugins/postcss-global-data/package.json
index 06b58602c..224526509 100644
--- a/plugins/postcss-global-data/package.json
+++ b/plugins/postcss-global-data/package.json
@@ -25,7 +25,7 @@
}
],
"engines": {
- "node": "^14 || ^16 || >=18"
+ "node": ">=18"
},
"type": "module",
"main": "dist/index.cjs",
diff --git a/plugins/postcss-global-data/src/parse-import.ts b/plugins/postcss-global-data/src/parse-import.ts
index 22d7100d0..982994d9b 100644
--- a/plugins/postcss-global-data/src/parse-import.ts
+++ b/plugins/postcss-global-data/src/parse-import.ts
@@ -1,7 +1,7 @@
-import path from 'path';
-import fs from 'fs';
+import path from 'node:path';
+import fs from 'node:fs';
import type { Helpers, Root } from 'postcss';
-import module from 'module';
+import module from 'node:module';
export function parseImport(root: Root, postcssHelpers: Helpers, filePath: string, alreadyImported: Set): Root|false {
let resolvedPath = '';
diff --git a/plugins/postcss-global-data/test/_import.mjs b/plugins/postcss-global-data/test/_import.mjs
index 3bc6043d7..28cb8a75d 100644
--- a/plugins/postcss-global-data/test/_import.mjs
+++ b/plugins/postcss-global-data/test/_import.mjs
@@ -1,4 +1,4 @@
-import assert from 'assert';
+import assert from 'node:assert';
import plugin from '@csstools/postcss-global-data';
plugin();
diff --git a/plugins/postcss-gradients-interpolation-method/CHANGELOG.md b/plugins/postcss-gradients-interpolation-method/CHANGELOG.md
index ad0ab96d7..eb6158ceb 100644
--- a/plugins/postcss-gradients-interpolation-method/CHANGELOG.md
+++ b/plugins/postcss-gradients-interpolation-method/CHANGELOG.md
@@ -1,7 +1,8 @@
# Changes to PostCSS Gradients Interpolation Method
-### Unreleased (patch)
+### Unreleased (major)
+- Updated: Support for Node v18+ (major).
- Updated [`@csstools/css-color-parser`](https://github.com/csstools/postcss-plugins/tree/main/packages/css-color-parser) to [`2.0.5`](https://github.com/csstools/postcss-plugins/tree/main/packages/css-color-parser/CHANGELOG.md#205) (patch)
### 4.0.20
diff --git a/plugins/postcss-gradients-interpolation-method/package.json b/plugins/postcss-gradients-interpolation-method/package.json
index 656073160..25cca2bc1 100644
--- a/plugins/postcss-gradients-interpolation-method/package.json
+++ b/plugins/postcss-gradients-interpolation-method/package.json
@@ -15,7 +15,7 @@
}
],
"engines": {
- "node": "^14 || ^16 || >=18"
+ "node": ">=18"
},
"type": "module",
"main": "dist/index.cjs",
diff --git a/plugins/postcss-gradients-interpolation-method/src/parse-color-stops.ts b/plugins/postcss-gradients-interpolation-method/src/parse-color-stops.ts
index 7463bfeb2..bf18d114a 100644
--- a/plugins/postcss-gradients-interpolation-method/src/parse-color-stops.ts
+++ b/plugins/postcss-gradients-interpolation-method/src/parse-color-stops.ts
@@ -1,7 +1,8 @@
import type { ColorStop } from './color-stop-list';
import type { ComponentValue } from '@csstools/css-parser-algorithms';
import { isTokenComma } from '@csstools/css-tokenizer';
-import { color, ColorData, SyntaxFlag } from '@csstools/css-color-parser';
+import type { ColorData} from '@csstools/css-color-parser';
+import { color, SyntaxFlag } from '@csstools/css-color-parser';
import { isCommentNode } from '@csstools/css-parser-algorithms';
import { isTokenNode, isWhitespaceNode } from '@csstools/css-parser-algorithms';
diff --git a/plugins/postcss-gradients-interpolation-method/test/_import.mjs b/plugins/postcss-gradients-interpolation-method/test/_import.mjs
index e698ed8ea..6c4f311a9 100644
--- a/plugins/postcss-gradients-interpolation-method/test/_import.mjs
+++ b/plugins/postcss-gradients-interpolation-method/test/_import.mjs
@@ -1,4 +1,4 @@
-import assert from 'assert';
+import assert from 'node:assert';
import plugin from '@csstools/postcss-gradients-interpolation-method';
plugin();
diff --git a/plugins/postcss-hwb-function/CHANGELOG.md b/plugins/postcss-hwb-function/CHANGELOG.md
index a5f36dde4..95993564a 100644
--- a/plugins/postcss-hwb-function/CHANGELOG.md
+++ b/plugins/postcss-hwb-function/CHANGELOG.md
@@ -1,7 +1,8 @@
# Changes to PostCSS HWB Function
-### Unreleased (patch)
+### Unreleased (major)
+- Updated: Support for Node v18+ (major).
- Updated [`@csstools/css-color-parser`](https://github.com/csstools/postcss-plugins/tree/main/packages/css-color-parser) to [`2.0.5`](https://github.com/csstools/postcss-plugins/tree/main/packages/css-color-parser/CHANGELOG.md#205) (patch)
### 3.0.18
diff --git a/plugins/postcss-hwb-function/package.json b/plugins/postcss-hwb-function/package.json
index 0be01049e..e75dc265c 100644
--- a/plugins/postcss-hwb-function/package.json
+++ b/plugins/postcss-hwb-function/package.json
@@ -25,7 +25,7 @@
}
],
"engines": {
- "node": "^14 || ^16 || >=18"
+ "node": ">=18"
},
"type": "module",
"main": "dist/index.cjs",
diff --git a/plugins/postcss-hwb-function/test/_import.mjs b/plugins/postcss-hwb-function/test/_import.mjs
index c6b46cf7e..404f2a71f 100644
--- a/plugins/postcss-hwb-function/test/_import.mjs
+++ b/plugins/postcss-hwb-function/test/_import.mjs
@@ -1,4 +1,4 @@
-import assert from 'assert';
+import assert from 'node:assert';
import plugin from '@csstools/postcss-hwb-function';
plugin();
diff --git a/plugins/postcss-ic-unit/CHANGELOG.md b/plugins/postcss-ic-unit/CHANGELOG.md
index cc7833545..2db297f9e 100644
--- a/plugins/postcss-ic-unit/CHANGELOG.md
+++ b/plugins/postcss-ic-unit/CHANGELOG.md
@@ -1,5 +1,9 @@
# Changes to PostCSS IC Unit
+### Unreleased (major)
+
+- Updated: Support for Node v18+ (major).
+
### 3.0.7
_July 7, 2024_
diff --git a/plugins/postcss-ic-unit/package.json b/plugins/postcss-ic-unit/package.json
index cf5a95947..70a25064b 100644
--- a/plugins/postcss-ic-unit/package.json
+++ b/plugins/postcss-ic-unit/package.json
@@ -15,7 +15,7 @@
}
],
"engines": {
- "node": "^14 || ^16 || >=18"
+ "node": ">=18"
},
"type": "module",
"main": "dist/index.cjs",
diff --git a/plugins/postcss-ic-unit/test/_import.mjs b/plugins/postcss-ic-unit/test/_import.mjs
index 75a9a088d..4b46ce1d1 100644
--- a/plugins/postcss-ic-unit/test/_import.mjs
+++ b/plugins/postcss-ic-unit/test/_import.mjs
@@ -1,4 +1,4 @@
-import assert from 'assert';
+import assert from 'node:assert';
import plugin from '@csstools/postcss-ic-unit';
plugin();
diff --git a/plugins/postcss-image-set-function/CHANGELOG.md b/plugins/postcss-image-set-function/CHANGELOG.md
index 24d36c40d..3c61cf101 100644
--- a/plugins/postcss-image-set-function/CHANGELOG.md
+++ b/plugins/postcss-image-set-function/CHANGELOG.md
@@ -1,5 +1,9 @@
# Changes to PostCSS image-set() Function
+### Unreleased (major)
+
+- Updated: Support for Node v18+ (major).
+
### 6.0.3
_February 19, 2024_
diff --git a/plugins/postcss-image-set-function/package.json b/plugins/postcss-image-set-function/package.json
index 91202d8da..3ed759bfc 100644
--- a/plugins/postcss-image-set-function/package.json
+++ b/plugins/postcss-image-set-function/package.json
@@ -15,7 +15,7 @@
}
],
"engines": {
- "node": "^14 || ^16 || >=18"
+ "node": ">=18"
},
"type": "module",
"main": "dist/index.cjs",
diff --git a/plugins/postcss-image-set-function/src/lib/is-comma.ts b/plugins/postcss-image-set-function/src/lib/is-comma.ts
index b73e6bc85..dbe01b656 100644
--- a/plugins/postcss-image-set-function/src/lib/is-comma.ts
+++ b/plugins/postcss-image-set-function/src/lib/is-comma.ts
@@ -1,4 +1,4 @@
-import valueParser from 'postcss-value-parser';
+import type valueParser from 'postcss-value-parser';
// return whether a node is a valid comma
export function isComma(node?: valueParser.Node): boolean {
diff --git a/plugins/postcss-image-set-function/test/_import.mjs b/plugins/postcss-image-set-function/test/_import.mjs
index cc1bf97ff..4bf8ea21c 100644
--- a/plugins/postcss-image-set-function/test/_import.mjs
+++ b/plugins/postcss-image-set-function/test/_import.mjs
@@ -1,4 +1,4 @@
-import assert from 'assert';
+import assert from 'node:assert';
import plugin from 'postcss-image-set-function';
plugin();
diff --git a/plugins/postcss-initial/CHANGELOG.md b/plugins/postcss-initial/CHANGELOG.md
index dd4e3eb98..41468c2b9 100644
--- a/plugins/postcss-initial/CHANGELOG.md
+++ b/plugins/postcss-initial/CHANGELOG.md
@@ -1,5 +1,9 @@
# Changes to PostCSS Initial
+### Unreleased (major)
+
+- Updated: Support for Node v18+ (major).
+
### 1.0.1
_December 15, 2023_
diff --git a/plugins/postcss-initial/package.json b/plugins/postcss-initial/package.json
index 6f3b057da..d8e5db178 100644
--- a/plugins/postcss-initial/package.json
+++ b/plugins/postcss-initial/package.json
@@ -25,7 +25,7 @@
}
],
"engines": {
- "node": "^14 || ^16 || >=18"
+ "node": ">=18"
},
"type": "module",
"main": "dist/index.cjs",
diff --git a/plugins/postcss-initial/scripts/property-def.mjs b/plugins/postcss-initial/scripts/property-def.mjs
index 67b5ace2b..fd4369f0e 100644
--- a/plugins/postcss-initial/scripts/property-def.mjs
+++ b/plugins/postcss-initial/scripts/property-def.mjs
@@ -1,5 +1,5 @@
-import fs from 'fs/promises';
-import path from 'path';
+import fs from 'node:fs/promises';
+import path from 'node:path';
const properties = [
{
diff --git a/plugins/postcss-initial/test/_import.mjs b/plugins/postcss-initial/test/_import.mjs
index 60135c668..d616bb5a2 100644
--- a/plugins/postcss-initial/test/_import.mjs
+++ b/plugins/postcss-initial/test/_import.mjs
@@ -1,4 +1,4 @@
-import assert from 'assert';
+import assert from 'node:assert';
import plugin from '@csstools/postcss-initial';
plugin();
diff --git a/plugins/postcss-is-pseudo-class/CHANGELOG.md b/plugins/postcss-is-pseudo-class/CHANGELOG.md
index b9dffd6b7..7debc64d9 100644
--- a/plugins/postcss-is-pseudo-class/CHANGELOG.md
+++ b/plugins/postcss-is-pseudo-class/CHANGELOG.md
@@ -1,5 +1,9 @@
# Changes to PostCSS Is Pseudo Class
+### Unreleased (major)
+
+- Updated: Support for Node v18+ (major).
+
### 4.0.8
_May 13, 2024_
diff --git a/plugins/postcss-is-pseudo-class/package.json b/plugins/postcss-is-pseudo-class/package.json
index c08facafc..2d5804740 100644
--- a/plugins/postcss-is-pseudo-class/package.json
+++ b/plugins/postcss-is-pseudo-class/package.json
@@ -15,7 +15,7 @@
}
],
"engines": {
- "node": "^14 || ^16 || >=18"
+ "node": ">=18"
},
"type": "module",
"main": "dist/index.cjs",
diff --git a/plugins/postcss-is-pseudo-class/src/split-selectors/complex/child-adjacent-child.ts b/plugins/postcss-is-pseudo-class/src/split-selectors/complex/child-adjacent-child.ts
index 4dc48fabe..fde94fa89 100644
--- a/plugins/postcss-is-pseudo-class/src/split-selectors/complex/child-adjacent-child.ts
+++ b/plugins/postcss-is-pseudo-class/src/split-selectors/complex/child-adjacent-child.ts
@@ -1,4 +1,4 @@
-import parser from 'postcss-selector-parser';
+import type parser from 'postcss-selector-parser';
// :-csstools-matches(.a > .b) + :-csstools-matches(.c > .d)
// equivalent to
diff --git a/plugins/postcss-is-pseudo-class/test/_browser.mjs b/plugins/postcss-is-pseudo-class/test/_browser.mjs
index 381f69242..f4c477ce6 100644
--- a/plugins/postcss-is-pseudo-class/test/_browser.mjs
+++ b/plugins/postcss-is-pseudo-class/test/_browser.mjs
@@ -1,6 +1,6 @@
import puppeteer from 'puppeteer';
-import http from 'http';
-import { promises as fsp } from 'fs';
+import http from 'node:http';
+import fs from 'node:fs/promises';
import test from 'node:test';
import process from 'node:process';
@@ -14,11 +14,11 @@ const requestListener = async function (req, res) {
case '/':
res.setHeader('Content-type', 'text/html');
res.writeHead(200);
- res.end(await fsp.readFile('test/_browser.html', 'utf8'));
+ res.end(await fs.readFile('test/_browser.html', 'utf8'));
break;
case '/test/browser.expect.css':
res.writeHead(200);
- res.end(await fsp.readFile('test/browser.expect.css', 'utf8'));
+ res.end(await fs.readFile('test/browser.expect.css', 'utf8'));
break;
default:
res.setHeader('Content-type', 'text/plain');
@@ -45,22 +45,24 @@ if (!process.env.DEBUG) {
headless: 'new',
});
- const page = await browser.newPage();
- page.on('pageerror', (msg) => {
- throw msg;
- });
- await page.goto('http://localhost:8080');
- const result = await page.evaluate(async () => {
- // eslint-disable-next-line no-undef
- return await window.runTest();
- });
- if (!result) {
- throw new Error('Test failed, expected "window.runTest()" to return true');
- }
+ try {
+ const page = await browser.newPage();
+ page.on('pageerror', (msg) => {
+ throw msg;
+ });
+ await page.goto('http://localhost:8080');
+ const result = await page.evaluate(async () => {
+ // eslint-disable-next-line no-undef
+ return await window.runTest();
+ });
+ if (!result) {
+ throw new Error('Test failed, expected "window.runTest()" to return true');
+ }
+ } finally {
+ await browser.close();
- await browser.close();
-
- await cleanup();
+ await cleanup();
+ }
});
} else {
startServers();
diff --git a/plugins/postcss-is-pseudo-class/test/_import.mjs b/plugins/postcss-is-pseudo-class/test/_import.mjs
index a94c483f3..4a52be2d9 100644
--- a/plugins/postcss-is-pseudo-class/test/_import.mjs
+++ b/plugins/postcss-is-pseudo-class/test/_import.mjs
@@ -1,4 +1,4 @@
-import assert from 'assert';
+import assert from 'node:assert';
import plugin from '@csstools/postcss-is-pseudo-class';
plugin();
diff --git a/plugins/postcss-lab-function/CHANGELOG.md b/plugins/postcss-lab-function/CHANGELOG.md
index 5b780f0c4..c773c2287 100644
--- a/plugins/postcss-lab-function/CHANGELOG.md
+++ b/plugins/postcss-lab-function/CHANGELOG.md
@@ -1,7 +1,8 @@
# Changes to PostCSS Lab Function
-### Unreleased (patch)
+### Unreleased (major)
+- Updated: Support for Node v18+ (major).
- Updated [`@csstools/css-color-parser`](https://github.com/csstools/postcss-plugins/tree/main/packages/css-color-parser) to [`2.0.5`](https://github.com/csstools/postcss-plugins/tree/main/packages/css-color-parser/CHANGELOG.md#205) (patch)
### 6.0.19
diff --git a/plugins/postcss-lab-function/package.json b/plugins/postcss-lab-function/package.json
index 8a82fdb54..c225c57f7 100644
--- a/plugins/postcss-lab-function/package.json
+++ b/plugins/postcss-lab-function/package.json
@@ -15,7 +15,7 @@
}
],
"engines": {
- "node": "^14 || ^16 || >=18"
+ "node": ">=18"
},
"type": "module",
"main": "dist/index.cjs",
diff --git a/plugins/postcss-lab-function/test/_import.mjs b/plugins/postcss-lab-function/test/_import.mjs
index 2bf59f581..01f6cb40b 100644
--- a/plugins/postcss-lab-function/test/_import.mjs
+++ b/plugins/postcss-lab-function/test/_import.mjs
@@ -1,4 +1,4 @@
-import assert from 'assert';
+import assert from 'node:assert';
import plugin from 'postcss-lab-function';
plugin();
diff --git a/plugins/postcss-light-dark-function/CHANGELOG.md b/plugins/postcss-light-dark-function/CHANGELOG.md
index 6495d475f..a498024dc 100644
--- a/plugins/postcss-light-dark-function/CHANGELOG.md
+++ b/plugins/postcss-light-dark-function/CHANGELOG.md
@@ -1,5 +1,9 @@
# Changes to PostCSS Light Dark Function
+### Unreleased (major)
+
+- Updated: Support for Node v18+ (major).
+
### 1.0.8
_July 7, 2024_
diff --git a/plugins/postcss-light-dark-function/package.json b/plugins/postcss-light-dark-function/package.json
index 8fdeef59e..91a81ac66 100644
--- a/plugins/postcss-light-dark-function/package.json
+++ b/plugins/postcss-light-dark-function/package.json
@@ -25,7 +25,7 @@
}
],
"engines": {
- "node": "^14 || ^16 || >=18"
+ "node": ">=18"
},
"type": "module",
"main": "dist/index.cjs",
diff --git a/plugins/postcss-light-dark-function/src/parse-light-dark.ts b/plugins/postcss-light-dark-function/src/parse-light-dark.ts
index 78fe9c1c4..6e7bc07b6 100644
--- a/plugins/postcss-light-dark-function/src/parse-light-dark.ts
+++ b/plugins/postcss-light-dark-function/src/parse-light-dark.ts
@@ -1,5 +1,6 @@
import { isTokenComma } from '@csstools/css-tokenizer';
-import { ComponentValue, isCommentNode, isFunctionNode, isTokenNode, isWhitespaceNode, walk } from '@csstools/css-parser-algorithms';
+import type { ComponentValue} from '@csstools/css-parser-algorithms';
+import { isCommentNode, isFunctionNode, isTokenNode, isWhitespaceNode, walk } from '@csstools/css-parser-algorithms';
const LIGHT_DARK_NAME_REGEX = /^light-dark$/i;
diff --git a/plugins/postcss-light-dark-function/test/_browser.mjs b/plugins/postcss-light-dark-function/test/_browser.mjs
index 80e95bb67..bc1685f94 100644
--- a/plugins/postcss-light-dark-function/test/_browser.mjs
+++ b/plugins/postcss-light-dark-function/test/_browser.mjs
@@ -1,6 +1,6 @@
import puppeteer from 'puppeteer';
-import http from 'http';
-import { promises as fsp } from 'fs';
+import http from 'node:http';
+import fs from 'node:fs/promises';
import plugin from '@csstools/postcss-light-dark-function';
import postcss from 'postcss';
import test from 'node:test';
@@ -39,7 +39,7 @@ const requestListener = async function (req, res) {
case '/wpt/light-dark-inherited.html':
res.setHeader('Content-type', 'text/html');
res.writeHead(200);
- res.end(await fsp.readFile('test' + pathname, 'utf8'));
+ res.end(await fs.readFile('test' + pathname, 'utf8'));
break;
case '/test/styles.css':
if (req.method === 'POST') {
@@ -91,7 +91,7 @@ function startServers() {
}
if (!process.env.DEBUG) {
- let errors = [];
+ const errors = [];
test('browser', { skip: process.env.GITHUB_ACTIONS && !process.env.BROWSER_TESTS }, async () => {
const cleanup = startServers();
diff --git a/plugins/postcss-logical-float-and-clear/CHANGELOG.md b/plugins/postcss-logical-float-and-clear/CHANGELOG.md
index 78e865522..e5bf44ffc 100644
--- a/plugins/postcss-logical-float-and-clear/CHANGELOG.md
+++ b/plugins/postcss-logical-float-and-clear/CHANGELOG.md
@@ -1,5 +1,9 @@
# Changes to PostCSS Logical Float And Clear
+### Unreleased (major)
+
+- Updated: Support for Node v18+ (major).
+
### 2.0.1
_December 15, 2023_
diff --git a/plugins/postcss-logical-float-and-clear/package.json b/plugins/postcss-logical-float-and-clear/package.json
index 34065d92b..cf1ea4aeb 100644
--- a/plugins/postcss-logical-float-and-clear/package.json
+++ b/plugins/postcss-logical-float-and-clear/package.json
@@ -25,7 +25,7 @@
}
],
"engines": {
- "node": "^14 || ^16 || >=18"
+ "node": ">=18"
},
"type": "module",
"main": "dist/index.cjs",
diff --git a/plugins/postcss-logical-float-and-clear/test/_import.mjs b/plugins/postcss-logical-float-and-clear/test/_import.mjs
index d7a7b04ab..677ad1123 100644
--- a/plugins/postcss-logical-float-and-clear/test/_import.mjs
+++ b/plugins/postcss-logical-float-and-clear/test/_import.mjs
@@ -1,4 +1,4 @@
-import assert from 'assert';
+import assert from 'node:assert';
import plugin from '@csstools/postcss-logical-float-and-clear';
plugin();
diff --git a/plugins/postcss-logical-overflow/CHANGELOG.md b/plugins/postcss-logical-overflow/CHANGELOG.md
index 12e74f716..7996f90cb 100644
--- a/plugins/postcss-logical-overflow/CHANGELOG.md
+++ b/plugins/postcss-logical-overflow/CHANGELOG.md
@@ -1,5 +1,9 @@
# Changes to PostCSS Logical Overflow
+### Unreleased (major)
+
+- Updated: Support for Node v18+ (major).
+
### 1.0.1
_December 15, 2023_
diff --git a/plugins/postcss-logical-overflow/package.json b/plugins/postcss-logical-overflow/package.json
index 79bcc8c47..158362228 100644
--- a/plugins/postcss-logical-overflow/package.json
+++ b/plugins/postcss-logical-overflow/package.json
@@ -25,7 +25,7 @@
}
],
"engines": {
- "node": "^14 || ^16 || >=18"
+ "node": ">=18"
},
"type": "module",
"main": "dist/index.cjs",
diff --git a/plugins/postcss-logical-overflow/test/_import.mjs b/plugins/postcss-logical-overflow/test/_import.mjs
index 527ffd371..90167ee76 100644
--- a/plugins/postcss-logical-overflow/test/_import.mjs
+++ b/plugins/postcss-logical-overflow/test/_import.mjs
@@ -1,4 +1,4 @@
-import assert from 'assert';
+import assert from 'node:assert';
import plugin from '@csstools/postcss-logical-overflow';
plugin();
diff --git a/plugins/postcss-logical-overscroll-behavior/CHANGELOG.md b/plugins/postcss-logical-overscroll-behavior/CHANGELOG.md
index 649e59d84..5cdd30936 100644
--- a/plugins/postcss-logical-overscroll-behavior/CHANGELOG.md
+++ b/plugins/postcss-logical-overscroll-behavior/CHANGELOG.md
@@ -1,5 +1,9 @@
# Changes to PostCSS Logical Overscroll Behavior
+### Unreleased (major)
+
+- Updated: Support for Node v18+ (major).
+
### 1.0.1
_December 15, 2023_
diff --git a/plugins/postcss-logical-overscroll-behavior/package.json b/plugins/postcss-logical-overscroll-behavior/package.json
index 2a3603d24..5ec610365 100644
--- a/plugins/postcss-logical-overscroll-behavior/package.json
+++ b/plugins/postcss-logical-overscroll-behavior/package.json
@@ -25,7 +25,7 @@
}
],
"engines": {
- "node": "^14 || ^16 || >=18"
+ "node": ">=18"
},
"type": "module",
"main": "dist/index.cjs",
diff --git a/plugins/postcss-logical-overscroll-behavior/test/_import.mjs b/plugins/postcss-logical-overscroll-behavior/test/_import.mjs
index 311376caf..8d68f8f02 100644
--- a/plugins/postcss-logical-overscroll-behavior/test/_import.mjs
+++ b/plugins/postcss-logical-overscroll-behavior/test/_import.mjs
@@ -1,4 +1,4 @@
-import assert from 'assert';
+import assert from 'node:assert';
import plugin from '@csstools/postcss-logical-overscroll-behavior';
plugin();
diff --git a/plugins/postcss-logical-resize/CHANGELOG.md b/plugins/postcss-logical-resize/CHANGELOG.md
index ba60b3dc3..7be4079f7 100644
--- a/plugins/postcss-logical-resize/CHANGELOG.md
+++ b/plugins/postcss-logical-resize/CHANGELOG.md
@@ -1,5 +1,9 @@
# Changes to PostCSS Logical Resize
+### Unreleased (major)
+
+- Updated: Support for Node v18+ (major).
+
### 2.0.1
_December 15, 2023_
diff --git a/plugins/postcss-logical-resize/package.json b/plugins/postcss-logical-resize/package.json
index 89842a92e..cae234783 100644
--- a/plugins/postcss-logical-resize/package.json
+++ b/plugins/postcss-logical-resize/package.json
@@ -25,7 +25,7 @@
}
],
"engines": {
- "node": "^14 || ^16 || >=18"
+ "node": ">=18"
},
"type": "module",
"main": "dist/index.cjs",
diff --git a/plugins/postcss-logical-resize/src/index.ts b/plugins/postcss-logical-resize/src/index.ts
index 5683ed75a..a815a4036 100644
--- a/plugins/postcss-logical-resize/src/index.ts
+++ b/plugins/postcss-logical-resize/src/index.ts
@@ -1,5 +1,6 @@
import type { Declaration, PluginCreator, Result } from 'postcss';
-import { Axes, DirectionConfig, DirectionFlow } from './lib/types';
+import type { DirectionConfig} from './lib/types';
+import { Axes, DirectionFlow } from './lib/types';
import { transformResize } from './lib/transform-resize';
import { directionFlowToAxes } from './utils/direction-flow-to-axes';
diff --git a/plugins/postcss-logical-resize/src/lib/transform-resize.ts b/plugins/postcss-logical-resize/src/lib/transform-resize.ts
index 1f2c99b03..9a587d487 100644
--- a/plugins/postcss-logical-resize/src/lib/transform-resize.ts
+++ b/plugins/postcss-logical-resize/src/lib/transform-resize.ts
@@ -1,6 +1,6 @@
import type { Declaration } from 'postcss';
import valueParser from 'postcss-value-parser';
-import { DirectionConfig } from './types';
+import type { DirectionConfig } from './types';
import { cloneDeclaration } from './clone-declaration';
export function transformResize(
diff --git a/plugins/postcss-logical-resize/test/_import.mjs b/plugins/postcss-logical-resize/test/_import.mjs
index cd29efc0e..ec7603e33 100644
--- a/plugins/postcss-logical-resize/test/_import.mjs
+++ b/plugins/postcss-logical-resize/test/_import.mjs
@@ -1,4 +1,4 @@
-import assert from 'assert';
+import assert from 'node:assert';
import plugin from '@csstools/postcss-logical-resize';
plugin();
diff --git a/plugins/postcss-logical-viewport-units/CHANGELOG.md b/plugins/postcss-logical-viewport-units/CHANGELOG.md
index c3f973201..3519c3cfd 100644
--- a/plugins/postcss-logical-viewport-units/CHANGELOG.md
+++ b/plugins/postcss-logical-viewport-units/CHANGELOG.md
@@ -1,5 +1,9 @@
# Changes to PostCSS Logical Viewport Units
+### Unreleased (major)
+
+- Updated: Support for Node v18+ (major).
+
### 2.0.11
_July 6, 2024_
diff --git a/plugins/postcss-logical-viewport-units/package.json b/plugins/postcss-logical-viewport-units/package.json
index 50b2b7772..714a8f9f9 100644
--- a/plugins/postcss-logical-viewport-units/package.json
+++ b/plugins/postcss-logical-viewport-units/package.json
@@ -25,7 +25,7 @@
}
],
"engines": {
- "node": "^14 || ^16 || >=18"
+ "node": ">=18"
},
"type": "module",
"main": "dist/index.cjs",
diff --git a/plugins/postcss-logical-viewport-units/test/_import.mjs b/plugins/postcss-logical-viewport-units/test/_import.mjs
index 0f1eedf3a..e380434d3 100644
--- a/plugins/postcss-logical-viewport-units/test/_import.mjs
+++ b/plugins/postcss-logical-viewport-units/test/_import.mjs
@@ -1,4 +1,4 @@
-import assert from 'assert';
+import assert from 'node:assert';
import plugin from '@csstools/postcss-logical-viewport-units';
plugin();
diff --git a/plugins/postcss-logical/CHANGELOG.md b/plugins/postcss-logical/CHANGELOG.md
index c22eb25d6..4b39ec540 100644
--- a/plugins/postcss-logical/CHANGELOG.md
+++ b/plugins/postcss-logical/CHANGELOG.md
@@ -1,5 +1,9 @@
# Changes to PostCSS Logical Properties
+### Unreleased (major)
+
+- Updated: Support for Node v18+ (major).
+
### 7.0.1
_December 15, 2023_
diff --git a/plugins/postcss-logical/package.json b/plugins/postcss-logical/package.json
index 54d6a1568..096323e79 100644
--- a/plugins/postcss-logical/package.json
+++ b/plugins/postcss-logical/package.json
@@ -29,7 +29,7 @@
}
],
"engines": {
- "node": "^14 || ^16 || >=18"
+ "node": ">=18"
},
"type": "module",
"main": "dist/index.cjs",
diff --git a/plugins/postcss-logical/src/index.ts b/plugins/postcss-logical/src/index.ts
index d2e3699e6..78284ef0b 100644
--- a/plugins/postcss-logical/src/index.ts
+++ b/plugins/postcss-logical/src/index.ts
@@ -1,5 +1,6 @@
import type { Declaration, PluginCreator, Result } from 'postcss';
-import { Axes, DirectionConfig, DirectionFlow, TransformFunction } from './lib/types';
+import type { DirectionConfig, TransformFunction } from './lib/types';
+import { Axes, DirectionFlow } from './lib/types';
import { directionFlowToAxes } from './utils/direction-flow-to-axes';
import { transformTransition } from './lib/transform-transition';
import { prepareTransforms } from './lib/transforms';
diff --git a/plugins/postcss-logical/src/lib/transform-borders.ts b/plugins/postcss-logical/src/lib/transform-borders.ts
index 3a112fd5f..17bfadff9 100644
--- a/plugins/postcss-logical/src/lib/transform-borders.ts
+++ b/plugins/postcss-logical/src/lib/transform-borders.ts
@@ -1,7 +1,7 @@
import type { Declaration } from 'postcss';
import { cloneDeclaration } from './clone-declaration';
import { parseValueCouple } from '../utils/parse-value-couple';
-import { DirectionConfig } from './types';
+import type { DirectionConfig } from './types';
export function transformBorder(
borderSetting: string,
diff --git a/plugins/postcss-logical/src/lib/transform-logical-size.ts b/plugins/postcss-logical/src/lib/transform-logical-size.ts
index 9e8650a01..ab58f3f15 100644
--- a/plugins/postcss-logical/src/lib/transform-logical-size.ts
+++ b/plugins/postcss-logical/src/lib/transform-logical-size.ts
@@ -1,6 +1,6 @@
import type { Declaration } from 'postcss';
import { cloneDeclaration } from './clone-declaration';
-import { DirectionConfig } from './types';
+import type { DirectionConfig } from './types';
export function transformLogicalSize(
directionConfig: DirectionConfig,
diff --git a/plugins/postcss-logical/src/lib/transform-transition.ts b/plugins/postcss-logical/src/lib/transform-transition.ts
index c3998450c..71d651098 100644
--- a/plugins/postcss-logical/src/lib/transform-transition.ts
+++ b/plugins/postcss-logical/src/lib/transform-transition.ts
@@ -2,7 +2,7 @@ import type { Declaration, Postcss } from 'postcss';
import type { Node } from 'postcss-value-parser';
import valueParser from 'postcss-value-parser';
import { cloneDeclaration } from './clone-declaration';
-import { TransformFunction } from './types';
+import type { TransformFunction } from './types';
export function transformTransition(declaration: Declaration, postcss: Postcss, transforms: Record): Array {
const { prop, value } = declaration;
diff --git a/plugins/postcss-logical/src/lib/transform-value.ts b/plugins/postcss-logical/src/lib/transform-value.ts
index f46cf4879..131477ac4 100644
--- a/plugins/postcss-logical/src/lib/transform-value.ts
+++ b/plugins/postcss-logical/src/lib/transform-value.ts
@@ -1,6 +1,7 @@
import type { Declaration } from 'postcss';
import valueParser from 'postcss-value-parser';
-import { DirectionConfig, DirectionValues } from './types';
+import type { DirectionConfig} from './types';
+import { DirectionValues } from './types';
import { logicalToPhysical } from '../utils/logical-to-physical';
import { cloneDeclaration } from './clone-declaration';
diff --git a/plugins/postcss-logical/src/lib/transforms.ts b/plugins/postcss-logical/src/lib/transforms.ts
index 54f524d77..7353e4867 100644
--- a/plugins/postcss-logical/src/lib/transforms.ts
+++ b/plugins/postcss-logical/src/lib/transforms.ts
@@ -1,4 +1,4 @@
-import { Axes, DirectionConfig, TransformFunction } from './types';
+import type { Axes, DirectionConfig, TransformFunction } from './types';
import {
transformBorder,
transformBorderProperty,
diff --git a/plugins/postcss-logical/src/utils/logical-to-physical.ts b/plugins/postcss-logical/src/utils/logical-to-physical.ts
index 0ef446008..06e6a5826 100644
--- a/plugins/postcss-logical/src/utils/logical-to-physical.ts
+++ b/plugins/postcss-logical/src/utils/logical-to-physical.ts
@@ -1,4 +1,5 @@
-import { DirectionConfig, DirectionValues } from '../lib/types';
+import type { DirectionConfig} from '../lib/types';
+import { DirectionValues } from '../lib/types';
export function logicalToPhysical(logical: string, config: DirectionConfig): string {
const [blockStart, blockEnd] = config.block;
diff --git a/plugins/postcss-logical/test/_import.mjs b/plugins/postcss-logical/test/_import.mjs
index 1f319722d..a6e91a069 100644
--- a/plugins/postcss-logical/test/_import.mjs
+++ b/plugins/postcss-logical/test/_import.mjs
@@ -1,4 +1,4 @@
-import assert from 'assert';
+import assert from 'node:assert';
import plugin from 'postcss-logical';
plugin();
diff --git a/plugins/postcss-media-minmax/CHANGELOG.md b/plugins/postcss-media-minmax/CHANGELOG.md
index c945e36f4..cc6e32f35 100644
--- a/plugins/postcss-media-minmax/CHANGELOG.md
+++ b/plugins/postcss-media-minmax/CHANGELOG.md
@@ -1,5 +1,9 @@
# Changes to PostCSS Media MinMax
+### Unreleased (major)
+
+- Updated: Support for Node v18+ (major).
+
### 1.1.8
_July 6, 2024_
diff --git a/plugins/postcss-media-minmax/package.json b/plugins/postcss-media-minmax/package.json
index ee8e77a9d..d609d2040 100644
--- a/plugins/postcss-media-minmax/package.json
+++ b/plugins/postcss-media-minmax/package.json
@@ -28,7 +28,7 @@
}
],
"engines": {
- "node": "^14 || ^16 || >=18"
+ "node": ">=18"
},
"type": "module",
"main": "dist/index.cjs",
diff --git a/plugins/postcss-media-minmax/src/transform-single-pair.ts b/plugins/postcss-media-minmax/src/transform-single-pair.ts
index 1a12d627f..041906491 100644
--- a/plugins/postcss-media-minmax/src/transform-single-pair.ts
+++ b/plugins/postcss-media-minmax/src/transform-single-pair.ts
@@ -1,7 +1,10 @@
import { calcFromComponentValues, mathFunctionNames } from '@csstools/css-calc';
-import { ComponentValue, isFunctionNode, isTokenNode } from '@csstools/css-parser-algorithms';
-import { CSSToken, NumberType, TokenType, isTokenDimension, isTokenNumber, isTokenNumeric } from '@csstools/css-tokenizer';
-import { invertComparison, matchesRatio, matchesRatioExactly, MediaFeature, MediaFeatureComparison, MediaFeatureEQ, MediaFeatureGT, MediaFeatureLT, MediaFeatureValue, newMediaFeaturePlain } from '@csstools/media-query-list-parser';
+import type { ComponentValue} from '@csstools/css-parser-algorithms';
+import { isFunctionNode, isTokenNode } from '@csstools/css-parser-algorithms';
+import type { CSSToken} from '@csstools/css-tokenizer';
+import { NumberType, TokenType, isTokenDimension, isTokenNumber, isTokenNumeric } from '@csstools/css-tokenizer';
+import type { MediaFeature, MediaFeatureComparison, MediaFeatureValue} from '@csstools/media-query-list-parser';
+import { invertComparison, matchesRatio, matchesRatioExactly, MediaFeatureEQ, MediaFeatureGT, MediaFeatureLT, newMediaFeaturePlain } from '@csstools/media-query-list-parser';
const unitsForFeature: Record = {
'width': 'px',
diff --git a/plugins/postcss-media-minmax/src/transform.ts b/plugins/postcss-media-minmax/src/transform.ts
index ddd49c0b1..5705b8c91 100644
--- a/plugins/postcss-media-minmax/src/transform.ts
+++ b/plugins/postcss-media-minmax/src/transform.ts
@@ -1,6 +1,7 @@
import { gatherNodeAncestry } from '@csstools/css-parser-algorithms';
import { isTokenWhitespace, stringify, TokenType } from '@csstools/css-tokenizer';
-import { isMediaAnd, isMediaCondition, isMediaConditionListWithAnd, isMediaFeature, isMediaFeatureRange, isMediaFeatureRangeNameValue, isMediaFeatureRangeValueName, isMediaInParens, isMediaQuery, MediaAnd, MediaCondition, MediaConditionListWithAnd, MediaFeature, MediaInParens, MediaQuery, MediaFeatureLT } from '@csstools/media-query-list-parser';
+import type { MediaFeature, MediaQuery} from '@csstools/media-query-list-parser';
+import { isMediaAnd, isMediaCondition, isMediaConditionListWithAnd, isMediaFeature, isMediaFeatureRange, isMediaFeatureRangeNameValue, isMediaFeatureRangeValueName, isMediaInParens, isMediaQuery, MediaAnd, MediaCondition, MediaConditionListWithAnd, MediaInParens, MediaFeatureLT } from '@csstools/media-query-list-parser';
import { transformSingleNameValuePair } from './transform-single-pair';
const supportedFeatureNames = new Set([
diff --git a/plugins/postcss-media-minmax/test/_browser.mjs b/plugins/postcss-media-minmax/test/_browser.mjs
index 8203cf85b..53a0badd1 100644
--- a/plugins/postcss-media-minmax/test/_browser.mjs
+++ b/plugins/postcss-media-minmax/test/_browser.mjs
@@ -1,6 +1,6 @@
import puppeteer from 'puppeteer';
-import http from 'http';
-import { promises as fsp } from 'fs';
+import http from 'node:http';
+import fs from 'node:fs/promises';
import plugin from '@csstools/postcss-media-minmax';
import postcss from 'postcss';
import test from 'node:test';
@@ -35,7 +35,7 @@ const requestListener = async function (req, res) {
case '/browser/basic.html':
res.setHeader('Content-type', 'text/html');
res.writeHead(200);
- res.end(await fsp.readFile('test' + pathname, 'utf8'));
+ res.end(await fs.readFile('test' + pathname, 'utf8'));
break;
case '/test/styles.css':
if (req.method === 'POST') {
@@ -87,34 +87,36 @@ if (!process.env.DEBUG) {
headless: 'new',
});
- const page = await browser.newPage();
+ try {
+ const page = await browser.newPage();
- await page.setViewport({
- width: 1000,
- height: 500,
- deviceScaleFactor: 2,
- });
-
- page.on('pageerror', (msg) => {
- throw msg;
- });
+ await page.setViewport({
+ width: 1000,
+ height: 500,
+ deviceScaleFactor: 2,
+ });
- for (const url of [
- 'browser/basic.html',
- ]) {
- await page.goto('http://localhost:8080/' + url);
- const result = await page.evaluate(async () => {
- // eslint-disable-next-line no-undef
- return await window.runTest();
+ page.on('pageerror', (msg) => {
+ throw msg;
});
- if (!result) {
- throw new Error('Test failed, expected "window.runTest()" to return true');
- }
- }
- await browser.close();
+ for (const url of [
+ 'browser/basic.html',
+ ]) {
+ await page.goto('http://localhost:8080/' + url);
+ const result = await page.evaluate(async () => {
+ // eslint-disable-next-line no-undef
+ return await window.runTest();
+ });
+ if (!result) {
+ throw new Error('Test failed, expected "window.runTest()" to return true');
+ }
+ }
+ } finally {
+ await browser.close();
- await cleanup();
+ await cleanup();
+ }
});
} else {
startServers();
diff --git a/plugins/postcss-media-minmax/test/_import.mjs b/plugins/postcss-media-minmax/test/_import.mjs
index e4124f01c..ba0d79b42 100644
--- a/plugins/postcss-media-minmax/test/_import.mjs
+++ b/plugins/postcss-media-minmax/test/_import.mjs
@@ -1,4 +1,4 @@
-import assert from 'assert';
+import assert from 'node:assert';
import plugin from '@csstools/postcss-media-minmax';
plugin();
diff --git a/plugins/postcss-media-queries-aspect-ratio-number-values/CHANGELOG.md b/plugins/postcss-media-queries-aspect-ratio-number-values/CHANGELOG.md
index 5adcb396c..7276a3318 100644
--- a/plugins/postcss-media-queries-aspect-ratio-number-values/CHANGELOG.md
+++ b/plugins/postcss-media-queries-aspect-ratio-number-values/CHANGELOG.md
@@ -1,5 +1,9 @@
# Changes to PostCSS Media Queries Aspect-Ratio Number Values
+### Unreleased (major)
+
+- Updated: Support for Node v18+ (major).
+
### 2.0.11
_July 6, 2024_
diff --git a/plugins/postcss-media-queries-aspect-ratio-number-values/package.json b/plugins/postcss-media-queries-aspect-ratio-number-values/package.json
index 376289fe5..15ad62d75 100644
--- a/plugins/postcss-media-queries-aspect-ratio-number-values/package.json
+++ b/plugins/postcss-media-queries-aspect-ratio-number-values/package.json
@@ -25,7 +25,7 @@
}
],
"engines": {
- "node": "^14 || ^16 || >=18"
+ "node": ">=18"
},
"type": "module",
"main": "dist/index.cjs",
diff --git a/plugins/postcss-media-queries-aspect-ratio-number-values/src/transform-media-feature-value.ts b/plugins/postcss-media-queries-aspect-ratio-number-values/src/transform-media-feature-value.ts
index c98c1f075..9e609aa5f 100644
--- a/plugins/postcss-media-queries-aspect-ratio-number-values/src/transform-media-feature-value.ts
+++ b/plugins/postcss-media-queries-aspect-ratio-number-values/src/transform-media-feature-value.ts
@@ -1,6 +1,8 @@
-import { ComponentValue, FunctionNode, isFunctionNode, isTokenNode, SimpleBlockNode, TokenNode, WhitespaceNode } from '@csstools/css-parser-algorithms';
+import type { ComponentValue} from '@csstools/css-parser-algorithms';
+import { FunctionNode, isFunctionNode, isTokenNode, SimpleBlockNode, TokenNode, WhitespaceNode } from '@csstools/css-parser-algorithms';
import { isTokenNumber, NumberType, TokenType } from '@csstools/css-tokenizer';
-import { matchesRatioExactly, MediaFeatureValue } from '@csstools/media-query-list-parser';
+import type { MediaFeatureValue } from '@csstools/media-query-list-parser';
+import { matchesRatioExactly } from '@csstools/media-query-list-parser';
const precision = 100000;
const nearInfinity = 2147483647;
diff --git a/plugins/postcss-media-queries-aspect-ratio-number-values/test/_import.mjs b/plugins/postcss-media-queries-aspect-ratio-number-values/test/_import.mjs
index 0a6832378..0ab470ac9 100644
--- a/plugins/postcss-media-queries-aspect-ratio-number-values/test/_import.mjs
+++ b/plugins/postcss-media-queries-aspect-ratio-number-values/test/_import.mjs
@@ -1,4 +1,4 @@
-import assert from 'assert';
+import assert from 'node:assert';
import plugin from '@csstools/postcss-media-queries-aspect-ratio-number-values';
plugin();
diff --git a/plugins/postcss-minify/CHANGELOG.md b/plugins/postcss-minify/CHANGELOG.md
index 7f0b99855..506fcda23 100644
--- a/plugins/postcss-minify/CHANGELOG.md
+++ b/plugins/postcss-minify/CHANGELOG.md
@@ -1,5 +1,9 @@
# Changes to PostCSS Minify
+### Unreleased (major)
+
+- Updated: Support for Node v18+ (major).
+
### 1.1.5
_July 6, 2024_
diff --git a/plugins/postcss-minify/package.json b/plugins/postcss-minify/package.json
index aab4d6629..1ecf3a0b0 100644
--- a/plugins/postcss-minify/package.json
+++ b/plugins/postcss-minify/package.json
@@ -25,7 +25,7 @@
}
],
"engines": {
- "node": "^14 || ^16 || >=18"
+ "node": ">=18"
},
"type": "module",
"main": "dist/index.cjs",
diff --git a/plugins/postcss-minify/test/_import.mjs b/plugins/postcss-minify/test/_import.mjs
index 781bfa528..ac8bc4a54 100644
--- a/plugins/postcss-minify/test/_import.mjs
+++ b/plugins/postcss-minify/test/_import.mjs
@@ -1,4 +1,4 @@
-import assert from 'assert';
+import assert from 'node:assert';
import plugin from '@csstools/postcss-minify';
plugin();
diff --git a/plugins/postcss-nested-calc/CHANGELOG.md b/plugins/postcss-nested-calc/CHANGELOG.md
index c39811c65..34d6aade2 100644
--- a/plugins/postcss-nested-calc/CHANGELOG.md
+++ b/plugins/postcss-nested-calc/CHANGELOG.md
@@ -1,5 +1,9 @@
# Changes to PostCSS Nested Calc
+### Unreleased (major)
+
+- Updated: Support for Node v18+ (major).
+
### 3.0.2
_February 19, 2024_
diff --git a/plugins/postcss-nested-calc/package.json b/plugins/postcss-nested-calc/package.json
index 7e0c7d6ca..8d453c5b3 100644
--- a/plugins/postcss-nested-calc/package.json
+++ b/plugins/postcss-nested-calc/package.json
@@ -25,7 +25,7 @@
}
],
"engines": {
- "node": "^14 || ^16 || >=18"
+ "node": ">=18"
},
"type": "module",
"main": "dist/index.cjs",
diff --git a/plugins/postcss-nested-calc/test/_import.mjs b/plugins/postcss-nested-calc/test/_import.mjs
index da3a2a9a2..8896168b7 100644
--- a/plugins/postcss-nested-calc/test/_import.mjs
+++ b/plugins/postcss-nested-calc/test/_import.mjs
@@ -1,4 +1,4 @@
-import assert from 'assert';
+import assert from 'node:assert';
import plugin from '@csstools/postcss-nested-calc';
plugin();
diff --git a/plugins/postcss-nesting/CHANGELOG.md b/plugins/postcss-nesting/CHANGELOG.md
index 662073350..f24188c31 100644
--- a/plugins/postcss-nesting/CHANGELOG.md
+++ b/plugins/postcss-nesting/CHANGELOG.md
@@ -1,5 +1,10 @@
# Changes to PostCSS Nesting
+### Unreleased (major)
+
+- Make edition `2024-02` the default (major).
+- Updated: Support for Node v18+ (major).
+
### 12.1.5
_May 23, 2024_
diff --git a/plugins/postcss-nesting/README.md b/plugins/postcss-nesting/README.md
index e867f5546..e605f27de 100644
--- a/plugins/postcss-nesting/README.md
+++ b/plugins/postcss-nesting/README.md
@@ -34,13 +34,11 @@ you might want to use [PostCSS Nested] instead.
.foo {
color: red;
-
- color: pink;
}
.foo:hover {
color: green;
}
-.foo > .bar {
+.foo > .bar {
color: blue;
}
@media (prefers-color-scheme: dark) {
@@ -48,6 +46,10 @@ you might want to use [PostCSS Nested] instead.
color: cyan;
}
}
+.foo {
+
+ color: pink;
+}
```
## Usage
@@ -80,35 +82,23 @@ instructions for:
- [Gulp](INSTALL.md#gulp)
- [Grunt](INSTALL.md#grunt)
-## ⚠️ `@nest` has been removed from the specification.
-
-Previous iterations of the [CSS Nesting specification] required using `@nest` for certain selectors.
-
-`@nest` was removed from the specification completely.
-Future versions of this plugin will error if you use `@nest`.
+## Options
-We advice everyone to migrate their codebase **now** to nested CSS without `@nest`.
-We published a [Stylelint Plugin](https://github.com/csstools/postcss-plugins/tree/main/plugins-stylelint/no-at-nest-rule#csstoolsstylelint-no-at-nest-rule) to help you migrate.
+### edition
-example warning:
-> `@nest` was removed from the CSS Nesting specification and will be removed from PostCSS Nesting in the next major version.
-> Change `@nest foo & {}` to `foo & {}` to migrate to the latest standard.
+The CSS nesting feature has gone through several iterations and what is currently implemented in browsers is not the same as what was originally proposed. This plugin dates back to the original proposal and you might have written your CSS expecting this older behavior.
-You can silence this warning with a new `silenceAtNestWarning` plugin option.
+You can pick the older behavior by setting the `edition` option.
+The `edition` values correspond with rough dates when of a particular version of the specification:
+- `2024-02` (default)
+- `2021`
-```js
-postcssNesting({
- silenceAtNestWarning: true
-})
-```
-
-## Options
+> [!TIP]
+> If you wrote nested rules with `@nest` you definitely want to set the `edition` to `2021`.
+> If you are unsure than you should try to omit the `edition` option and use the default.
-### edition
+Eventually we will remove support for the older edition, and this plugin option, so it is strongly advised to update your CSS to the latest edition.
-The default behavior is to transpile CSS following an older version of the CSS nesting specification.
-
-If you want to already use the latest version you can set the `edition` option to `2024-02`.
```js
postcssNesting({
@@ -116,13 +106,18 @@ postcssNesting({
})
```
-#### `2021` (default)
+#### `2024-02` (default)
+
+- usage of `:is()` pseudo-class is no longer optional
+- at rules are not combined with the `and` keyword
+- `@nest` is removed from the specification
+- declarations and nested rules/at-rules are no longer re-ordered
+
+#### `2021`
This version is a continuation of what existed before CSS nesting was implemented in browsers.
It made a few non-invasive changes to keep up with implementations but it is falling behind.
-In a future version of this plugin this will no longer be the default.
-
```pcss
.foo {
color: red;
@@ -162,55 +157,7 @@ In a future version of this plugin this will no longer be the default.
}
```
-#### `2024-02`
-
-- usage of `:is()` pseudo-class is no longer optional
-- at rules are not combined with the `and` keyword
-- `@nest` is removed from the specification
-- declarations and nested rules/at-rules are no longer re-ordered
-
-```pcss
-.foo {
- color: red;
-
- &:hover {
- color: green;
- }
-
- > .bar {
- color: blue;
- }
-
- @media (prefers-color-scheme: dark) {
- color: cyan;
- }
-
- color: pink;
-}
-
-/* becomes */
-
-.foo {
- color: red;
-}
-.foo:hover {
- color: green;
- }
-.foo > .bar {
- color: blue;
- }
-@media (prefers-color-scheme: dark) {
- .foo {
- color: cyan;
-}
- }
-.foo {
-
- color: pink;
-}
-```
-
-### noIsPseudoSelector
+### noIsPseudoSelector (edition: `2021`)
#### Specificity
diff --git a/plugins/postcss-nesting/dist/index.cjs b/plugins/postcss-nesting/dist/index.cjs
index 625a96ccd..56477902c 100644
--- a/plugins/postcss-nesting/dist/index.cjs
+++ b/plugins/postcss-nesting/dist/index.cjs
@@ -1 +1 @@
-"use strict";var e=require("postcss-selector-parser"),t=require("@csstools/selector-specificity"),n=require("@csstools/selector-resolve-nested");const r=e.pseudo({value:":is"});function sortCompoundSelectorsInsideComplexSelector(t){if(!t||!t.nodes)return;const n=[];let o=[];for(let s=0;s"tag"===e.type))){const n=r.clone({}),o=t.nodes[s];o.replaceWith(n),n.append(e.selector({nodes:[o],value:void 0}))}o.push(t.nodes[s])}else n.push(o),n.push([t.nodes[s]]),o=[];n.push(o);const s=[];for(let e=0;e"selector"===e.type&&"selector"===t.type&&e.nodes.length&&t.nodes.length?selectorTypeOrder(e.nodes[0])-selectorTypeOrder(t.nodes[0]):"selector"===e.type&&e.nodes.length?selectorTypeOrder(e.nodes[0])-selectorTypeOrder(t):"selector"===t.type&&t.nodes.length?selectorTypeOrder(e)-selectorTypeOrder(t.nodes[0]):selectorTypeOrder(e)-selectorTypeOrder(t)));for(let e=0;e=0;e--)s[e].remove(),t.prepend(s[e])}function selectorTypeOrder(t){return e.isPseudoElement(t)?o.pseudoElement:o[t.type]}const o={universal:0,tag:1,pseudoElement:2,id:3,class:4,attribute:5,pseudo:6,selector:7,string:8,root:9,comment:10};function isAtRule(e){return e&&"atrule"===e.type}function isNestRule(e){return e&&isAtRule(e)&&"nest"===e.name}function isRule(e){return e&&"rule"===e.type}function ampersandToScope$1(t,n){let r,o=t.parent;for(;o;){if("rule"===o.type)return;if(isAtRule(o)&&"scope"===o.name)return;o=o.parent}try{r=e().astSync(t.selector)}catch(e){return void t.warn(n,`Failed to parse selector : "${t.selector}" with message: "${e instanceof Error?e.message:e}"`)}r&&(r.walkNesting((t=>{const n=t.parent;t.replaceWith(e.pseudo({value:":scope"})),n&&sortCompoundSelectorsInsideComplexSelector(n)})),t.selector=r.toString())}function cleanupParent(e){if(!e.nodes.length)return void e.remove();const t=e.nodes.filter((e=>"comment"===e.type));t.length===e.nodes.length&&e.replaceWith(...t)}function groupDeclarations(e){const t=[],n=[];e.each((e=>{if(isDeclarationLike(e,n.length>0))t.push(e);else{if("comment"===e.type){let r=e.next();for(;r&&"comment"===r.type;)r=r.next();if(isDeclarationLike(r,n.length>0))return void t.push(e)}n.push(e)}})),e.removeAll(),t.forEach((t=>{e.append(t)})),n.forEach((t=>{e.append(t)}))}function isDeclarationLike(e,t){return!!e&&("decl"===e.type||"atrule"===e.type&&"mixin"===e.name.toLowerCase()&&!t)}function comma(e){const t=[];let n="",r=!1,o=0,s=!1,i=!1;for(const l of e)i?i=!1:"\\"===l?i=!0:s?l===s&&(s=!1):'"'===l||"'"===l?s=l:"("===l?o+=1:")"===l?o>0&&(o-=1):0===o&&","===l&&(r=!0),r?(""!==n&&t.push(n.trim()),n="",r=!1):n+=l;return t.push(n.trim()),t}function shiftNodesBeforeParent(e,t){const n=t.index(e);if(n){const e=t.cloneBefore().removeAll().append(t.nodes.slice(0,n));e.raws.semicolon=!0,cleanupParent(e)}t.before(e),t.raws.semicolon=!0}var s=["container","document","media","supports","layer","starting-style"];function transformAtruleWithinAtrule(e,t){var n,r;groupDeclarations(t),shiftNodesBeforeParent(e,t),e.params=(n=t.params,r=e.params,comma(n).map((e=>comma(r).map((t=>`${e} and ${t}`)).join(", "))).join(", ")),cleanupParent(t)}function isAtruleWithinAtrule(e,t){return s.includes(e.name)&&e.name===t.name}function atruleWithinRule$1(e,t,n,r,o){if(groupDeclarations(t),shiftNodesBeforeParent(e,t),e.nodes){const s=t.clone().removeAll().append(e.nodes);e.append(s),cleanupParent(t),r(s,n,o)}else cleanupParent(t)}function isAtruleWithinRule$1(e){return s.includes(e.name)}function combinationsWithSizeN(e,t){if(t<2)throw new Error("n must be greater than 1");if(e.length<2)throw new Error("s must be greater than 1");if(Math.pow(e.length,t)>1e4)throw new Error("Too many combinations when trying to resolve a nested selector with lists, reduce the complexity of your selectors");const n=[];for(let e=0;e=0;s--){let t=n[s];if(t>=e.length){if(t=0,n[s]=0,0===s)return r;n[s-1]+=1}o[s]=e[t].clone()}r.push(o),n[n.length-1]++}}function nodesAreEquallySpecific(n){const r=n.map((t=>e().astSync(t))).map((e=>t.selectorSpecificity(e))),o=r[0];for(let e=1;ee().astSync(t))):[e().astSync(`:is(${t.join(",")})`)];const s=[];for(let t=0;t{"nesting"===e.type&&(n=!0)}));const r=t.nodes[0];let o=!1;r.each((e=>"combinator"===e.type&&(o=!0,!1))),n?o&&r.insertBefore(r.at(0),e.nesting()):(r.insertBefore(r.at(0),e.combinator({value:" "})),r.insertBefore(r.at(0),e.nesting())),l=t.toString()}let c=[],a=0;if(e().astSync(l).walkNesting((()=>{a++})),a>1&&o.length>1)c=combinationsWithSizeN(o,a),i=c.length;else{i=o.length;for(let e=0;e{if("nesting"!==o.type)return;let s=c[t][n];n++,"root"===s.type&&1===s.nodes.length&&(s=s.nodes[0]);const i=e().astSync(`:is(${s.toString()})`),l=isSimpleSelector(s.nodes[0]),a=isCompoundSelector(s.nodes[0]),u=isSimpleSelector(o),p=isCompoundSelector(o);if(l&&u)return void o.replaceWith(s.clone());if((l||a)&&(u||p)){const e=o.parent;return l&&"selector"===s.type?o.replaceWith(s.clone().nodes[0]):o.replaceWith(...s.clone().nodes),void(e&&e.nodes.length>1&&sortCompoundSelectorsInsideComplexSelector(e))}if(l){const e=o.parent;return o.replaceWith(s.clone().nodes[0]),void(e&&sortCompoundSelectorsInsideComplexSelector(e))}if(a){const e=o.parent;return o.replaceWith(...s.clone().nodes),void(e&&sortCompoundSelectorsInsideComplexSelector(e))}if(nestingIsFirstAndOnlyInSelectorWithEitherSpaceOrChildCombinator(o)){const e=o.parent;return o.replaceWith(...s.clone().nodes),void(e&&sortCompoundSelectorsInsideComplexSelector(e))}if(nestingIsNotInsideCompoundSelector(o)){const e=o.parent;return o.replaceWith(...s.clone().nodes),void(e&&sortCompoundSelectorsInsideComplexSelector(e))}const d=o.parent;r.noIsPseudoSelector?o.replaceWith(...s.clone().nodes):o.replaceWith(...i.clone({}).nodes),d&&sortCompoundSelectorsInsideComplexSelector(d)})),s.push(o.toString())}}return s}function isSimpleSelector(e){return"combinator"!==e.type&&!(e.parent&&e.parent.nodes.length>1)}function isCompoundSelector(e,t=null){if(isSimpleSelector(e))return!1;if(!e.parent)return!1;if(!!e.parent.nodes.find((e=>"combinator"===e.type)))return!1;return!(!!e.parent.nodes.find((e=>"nesting"===e.type))&&t&&!isCompoundSelector(t))}function nestingIsFirstAndOnlyInSelectorWithEitherSpaceOrChildCombinator(e){if(!e.parent)return!1;if(0!==e.parent.nodes.indexOf(e))return!1;for(let t=1;t"!==e.parent.nodes[t].value)return!1;return!0}function nestingIsNotInsideCompoundSelector(e){if(isSimpleSelector(e))return!0;if(!e.parent)return!1;for(let t=0;te.split("&").length>=2&&-1===e.indexOf("|")))}function transformRuleWithinRule$1(e,t,n,r){let o=[];try{o=mergeSelectors$1(t.selectors,e.selectors,r)}catch(r){return void e.warn(n,`Failed to parse selectors : "${t.selector}" / "${e.selector}" with message: "${r instanceof Error?r.message:r}"`)}if(!o.length)return;groupDeclarations(t),shiftNodesBeforeParent(e,t),e.selectors=o;"rule"===e.type&&"rule"===t.type&&e.selector===t.selector&&e.append(...t.nodes),cleanupParent(t)}function isValidRuleWithinRule$1(e){return e.selectors.every((e=>-1===e.indexOf("|")))}function walk$1(e,t,n){e.each((r=>{const o=r.parent;isNestRule(r)&&!n.silenceAtNestWarning&&e.warn(t,`\`@nest\` was removed from the CSS Nesting specification and will be removed from PostCSS Nesting in the next major version.\nChange \`@nest ${r.params} {}\` to \`${r.params} {}\` to migrate to the latest standard.`),isRule(r)&&isRule(o)&&isValidRuleWithinRule$1(r)?transformRuleWithinRule$1(r,o,t,n):isNestRule(r)&&isRule(o)&&isValidNestRuleWithinRule(r)?transformNestRuleWithinRule(r,o,t,walk$1,n):isAtRule(r)&&isRule(o)&&isAtruleWithinRule$1(r)?atruleWithinRule$1(r,o,t,walk$1,n):isAtRule(r)&&isAtRule(o)&&isAtruleWithinAtrule(r,o)&&transformAtruleWithinAtrule(r,o),"nodes"in r&&r.nodes.length&&walk$1(r,t,n)}))}const creator$2=e=>{const t=Object.assign({noIsPseudoSelector:!1,silenceAtNestWarning:!1},e);return{postcssPlugin:"postcss-nesting",Rule(e,{result:n}){walk$1(e,n,t),e.selector.includes("&")&&ersandToScope$1(e,n)}}};creator$2.postcss=!0;const i=e();function mergeSelectors(e,t,r,o){let s;try{s=n.resolveNestedSelector(i.astSync(t),i.astSync(r))}catch(n){return e.warn(o,`Failed to parse selectors : "${r}" / "${t}" with message: "${n instanceof Error?n.message:n}"`),!1}return!!s&&s.toString()}function ampersandToScope(t,n){{let r=t.parent;for(;r;){if("rule"===r.type)return;if(isAtRule(r)&&"scope"===r.name)return;r=r.parent}try{let n=!1;if(e().astSync(t.selector).walkNesting((()=>(n=!0,!1))),!n)return}catch(e){return void t.warn(n,`Failed to parse selector : "${t.selector}" with message: "${e instanceof Error?e.message:e}"`)}}const r=mergeSelectors(t,t.selector,":scope",n);r&&(t.selector=r)}function atruleWithinRule(e,t,n,r){if(shiftNodesBeforeParent(e,t),e.nodes){const o=t.clone().removeAll().append(e.nodes);e.append(o),cleanupParent(t),r(o,n)}else cleanupParent(t)}function isAtruleWithinRule(e){return s.includes(e.name)}function transformRuleWithinRule(e,t,n){const r=mergeSelectors(e,e.selector,t.selector,n);if(!r)return;shiftNodesBeforeParent(e,t),e.selector=r;"rule"===e.type&&"rule"===t.type&&e.selector===t.selector&&e.append(...t.nodes),cleanupParent(t)}function isValidRuleWithinRule(e){return e.selectors.every((e=>-1===e.indexOf("|")))}function walk(e,t){e.each((e=>{const n=e.parent;isRule(e)&&isRule(n)&&isValidRuleWithinRule(e)?transformRuleWithinRule(e,n,t):isAtRule(e)&&isRule(n)&&isAtruleWithinRule(e)&&atruleWithinRule(e,n,t,walk),"nodes"in e&&e.nodes.length&&walk(e,t)}))}const creator$1=()=>({postcssPlugin:"postcss-nesting",Rule(e,{result:t}){walk(e,t),e.selector.includes("&")&&ersandToScope(e,t)},AtRule:{nest(e){throw e.error(`\`@nest\` was removed from the CSS Nesting specification and will be removed from PostCSS Nesting in the next major version.\nChange \`@nest ${e.params} {}\` to \`${e.params} {}\` to migrate to the latest standard.`)}}});creator$1.postcss=!0;const creator=e=>{const t=Object.assign({edition:"2021"},e);switch(t.edition){case"2021":return creator$2(e);case"2024-02":return creator$1();default:throw new Error(`Invalid edition: ${t.edition}`)}};creator.postcss=!0,module.exports=creator;
+"use strict";var e=require("postcss-selector-parser"),t=require("@csstools/selector-specificity"),n=require("@csstools/selector-resolve-nested");const r=e.pseudo({value:":is"});function sortCompoundSelectorsInsideComplexSelector(t){if(!t||!t.nodes)return;const n=[];let o=[];for(let s=0;s"tag"===e.type))){const n=r.clone({}),o=t.nodes[s];o.replaceWith(n),n.append(e.selector({nodes:[o],value:void 0}))}o.push(t.nodes[s])}else n.push(o),n.push([t.nodes[s]]),o=[];n.push(o);const s=[];for(let e=0;e"selector"===e.type&&"selector"===t.type&&e.nodes.length&&t.nodes.length?selectorTypeOrder(e.nodes[0])-selectorTypeOrder(t.nodes[0]):"selector"===e.type&&e.nodes.length?selectorTypeOrder(e.nodes[0])-selectorTypeOrder(t):"selector"===t.type&&t.nodes.length?selectorTypeOrder(e)-selectorTypeOrder(t.nodes[0]):selectorTypeOrder(e)-selectorTypeOrder(t)));for(let e=0;e=0;e--)s[e].remove(),t.prepend(s[e])}function selectorTypeOrder(t){return e.isPseudoElement(t)?o.pseudoElement:o[t.type]}const o={universal:0,tag:1,pseudoElement:2,id:3,class:4,attribute:5,pseudo:6,selector:7,string:8,root:9,comment:10};function isAtRule(e){return e&&"atrule"===e.type}function isNestRule(e){return e&&isAtRule(e)&&"nest"===e.name}function isRule(e){return e&&"rule"===e.type}function ampersandToScope$1(t,n){let r,o=t.parent;for(;o;){if("rule"===o.type)return;if(isAtRule(o)&&"scope"===o.name)return;o=o.parent}try{r=e().astSync(t.selector)}catch(e){return void t.warn(n,`Failed to parse selector : "${t.selector}" with message: "${e instanceof Error?e.message:e}"`)}r&&(r.walkNesting((t=>{const n=t.parent;t.replaceWith(e.pseudo({value:":scope"})),n&&sortCompoundSelectorsInsideComplexSelector(n)})),t.selector=r.toString())}function cleanupParent(e){if(!e.nodes.length)return void e.remove();const t=e.nodes.filter((e=>"comment"===e.type));t.length===e.nodes.length&&e.replaceWith(...t)}function groupDeclarations(e){const t=[],n=[];e.each((e=>{if(isDeclarationLike(e,n.length>0))t.push(e);else{if("comment"===e.type){let r=e.next();for(;r&&"comment"===r.type;)r=r.next();if(isDeclarationLike(r,n.length>0))return void t.push(e)}n.push(e)}})),e.removeAll(),t.forEach((t=>{e.append(t)})),n.forEach((t=>{e.append(t)}))}function isDeclarationLike(e,t){return!!e&&("decl"===e.type||"atrule"===e.type&&"mixin"===e.name.toLowerCase()&&!t)}function comma(e){const t=[];let n="",r=!1,o=0,s=!1,i=!1;for(const l of e)i?i=!1:"\\"===l?i=!0:s?l===s&&(s=!1):'"'===l||"'"===l?s=l:"("===l?o+=1:")"===l?o>0&&(o-=1):0===o&&","===l&&(r=!0),r?(""!==n&&t.push(n.trim()),n="",r=!1):n+=l;return t.push(n.trim()),t}function shiftNodesBeforeParent(e,t){const n=t.index(e);if(n){const e=t.cloneBefore().removeAll().append(t.nodes.slice(0,n));e.raws.semicolon=!0,cleanupParent(e)}t.before(e),t.raws.semicolon=!0}var s=["container","document","media","supports","layer","starting-style"];function transformAtruleWithinAtrule(e,t){var n,r;groupDeclarations(t),shiftNodesBeforeParent(e,t),e.params=(n=t.params,r=e.params,comma(n).map((e=>comma(r).map((t=>`${e} and ${t}`)).join(", "))).join(", ")),cleanupParent(t)}function isAtruleWithinAtrule(e,t){return s.includes(e.name)&&e.name===t.name}function atruleWithinRule$1(e,t,n,r,o){if(groupDeclarations(t),shiftNodesBeforeParent(e,t),e.nodes){const s=t.clone().removeAll().append(e.nodes);e.append(s),cleanupParent(t),r(s,n,o)}else cleanupParent(t)}function isAtruleWithinRule$1(e){return s.includes(e.name)}function combinationsWithSizeN(e,t){if(t<2)throw new Error("n must be greater than 1");if(e.length<2)throw new Error("s must be greater than 1");if(Math.pow(e.length,t)>1e4)throw new Error("Too many combinations when trying to resolve a nested selector with lists, reduce the complexity of your selectors");const n=[];for(let e=0;e=0;s--){let t=n[s];if(t>=e.length){if(t=0,n[s]=0,0===s)return r;n[s-1]+=1}o[s]=e[t].clone()}r.push(o),n[n.length-1]++}}function nodesAreEquallySpecific(n){const r=n.map((t=>e().astSync(t))).map((e=>t.selectorSpecificity(e))),o=r[0];for(let e=1;ee().astSync(t))):[e().astSync(`:is(${t.join(",")})`)];const s=[];for(let t=0;t{"nesting"===e.type&&(n=!0)}));const r=t.nodes[0];let o=!1;r.each((e=>"combinator"===e.type&&(o=!0,!1))),n?o&&r.insertBefore(r.at(0),e.nesting()):(r.insertBefore(r.at(0),e.combinator({value:" "})),r.insertBefore(r.at(0),e.nesting())),l=t.toString()}let c=[],a=0;if(e().astSync(l).walkNesting((()=>{a++})),a>1&&o.length>1)c=combinationsWithSizeN(o,a),i=c.length;else{i=o.length;for(let e=0;e{if("nesting"!==o.type)return;let s=c[t][n];n++,"root"===s.type&&1===s.nodes.length&&(s=s.nodes[0]);const i=e().astSync(`:is(${s.toString()})`),l=isSimpleSelector(s.nodes[0]),a=isCompoundSelector(s.nodes[0]),u=isSimpleSelector(o),p=isCompoundSelector(o);if(l&&u)return void o.replaceWith(s.clone());if((l||a)&&(u||p)){const e=o.parent;return l&&"selector"===s.type?o.replaceWith(s.clone().nodes[0]):o.replaceWith(...s.clone().nodes),void(e&&e.nodes.length>1&&sortCompoundSelectorsInsideComplexSelector(e))}if(l){const e=o.parent;return o.replaceWith(s.clone().nodes[0]),void(e&&sortCompoundSelectorsInsideComplexSelector(e))}if(a){const e=o.parent;return o.replaceWith(...s.clone().nodes),void(e&&sortCompoundSelectorsInsideComplexSelector(e))}if(nestingIsFirstAndOnlyInSelectorWithEitherSpaceOrChildCombinator(o)){const e=o.parent;return o.replaceWith(...s.clone().nodes),void(e&&sortCompoundSelectorsInsideComplexSelector(e))}if(nestingIsNotInsideCompoundSelector(o)){const e=o.parent;return o.replaceWith(...s.clone().nodes),void(e&&sortCompoundSelectorsInsideComplexSelector(e))}const d=o.parent;r.noIsPseudoSelector?o.replaceWith(...s.clone().nodes):o.replaceWith(...i.clone({}).nodes),d&&sortCompoundSelectorsInsideComplexSelector(d)})),s.push(o.toString())}}return s}function isSimpleSelector(e){return"combinator"!==e.type&&!(e.parent&&e.parent.nodes.length>1)}function isCompoundSelector(e,t=null){if(isSimpleSelector(e))return!1;if(!e.parent)return!1;if(!!e.parent.nodes.find((e=>"combinator"===e.type)))return!1;return!(!!e.parent.nodes.find((e=>"nesting"===e.type))&&t&&!isCompoundSelector(t))}function nestingIsFirstAndOnlyInSelectorWithEitherSpaceOrChildCombinator(e){if(!e.parent)return!1;if(0!==e.parent.nodes.indexOf(e))return!1;for(let t=1;t"!==e.parent.nodes[t].value)return!1;return!0}function nestingIsNotInsideCompoundSelector(e){if(isSimpleSelector(e))return!0;if(!e.parent)return!1;for(let t=0;te.split("&").length>=2&&-1===e.indexOf("|")))}function transformRuleWithinRule$1(e,t,n,r){let o=[];try{o=mergeSelectors$1(t.selectors,e.selectors,r)}catch(r){return void e.warn(n,`Failed to parse selectors : "${t.selector}" / "${e.selector}" with message: "${r instanceof Error?r.message:r}"`)}if(!o.length)return;groupDeclarations(t),shiftNodesBeforeParent(e,t),e.selectors=o;"rule"===e.type&&"rule"===t.type&&e.selector===t.selector&&e.append(...t.nodes),cleanupParent(t)}function isValidRuleWithinRule$1(e){return e.selectors.every((e=>-1===e.indexOf("|")))}function walk$1(e,t,n){e.each((r=>{const o=r.parent;isNestRule(r)&&!n.silenceAtNestWarning&&e.warn(t,`\`@nest\` was removed from the CSS Nesting specification and will be removed from PostCSS Nesting in the next major version.\nChange \`@nest ${r.params} {}\` to \`${r.params} {}\` to migrate to the latest standard.`),isRule(r)&&isRule(o)&&isValidRuleWithinRule$1(r)?transformRuleWithinRule$1(r,o,t,n):isNestRule(r)&&isRule(o)&&isValidNestRuleWithinRule(r)?transformNestRuleWithinRule(r,o,t,walk$1,n):isAtRule(r)&&isRule(o)&&isAtruleWithinRule$1(r)?atruleWithinRule$1(r,o,t,walk$1,n):isAtRule(r)&&isAtRule(o)&&isAtruleWithinAtrule(r,o)&&transformAtruleWithinAtrule(r,o),"nodes"in r&&r.nodes.length&&walk$1(r,t,n)}))}const creator$2=e=>{const t=Object.assign({noIsPseudoSelector:!1,silenceAtNestWarning:!1},e);return{postcssPlugin:"postcss-nesting",Rule(e,{result:n}){walk$1(e,n,t),e.selector.includes("&")&&ersandToScope$1(e,n)}}};creator$2.postcss=!0;const i=e();function mergeSelectors(e,t,r,o){let s;try{s=n.resolveNestedSelector(i.astSync(t),i.astSync(r))}catch(n){return e.warn(o,`Failed to parse selectors : "${r}" / "${t}" with message: "${n instanceof Error?n.message:n}"`),!1}return!!s&&s.toString()}function ampersandToScope(t,n){{let r=t.parent;for(;r;){if("rule"===r.type)return;if(isAtRule(r)&&"scope"===r.name)return;r=r.parent}try{let n=!1;if(e().astSync(t.selector).walkNesting((()=>(n=!0,!1))),!n)return}catch(e){return void t.warn(n,`Failed to parse selector : "${t.selector}" with message: "${e instanceof Error?e.message:e}"`)}}const r=mergeSelectors(t,t.selector,":scope",n);r&&(t.selector=r)}function atruleWithinRule(e,t,n,r){if(shiftNodesBeforeParent(e,t),e.nodes){const o=t.clone().removeAll().append(e.nodes);e.append(o),cleanupParent(t),r(o,n)}else cleanupParent(t)}function isAtruleWithinRule(e){return s.includes(e.name)}function transformRuleWithinRule(e,t,n){const r=mergeSelectors(e,e.selector,t.selector,n);if(!r)return;shiftNodesBeforeParent(e,t),e.selector=r;"rule"===e.type&&"rule"===t.type&&e.selector===t.selector&&e.append(...t.nodes),cleanupParent(t)}function isValidRuleWithinRule(e){return e.selectors.every((e=>-1===e.indexOf("|")))}function walk(e,t){e.each((e=>{const n=e.parent;isRule(e)&&isRule(n)&&isValidRuleWithinRule(e)?transformRuleWithinRule(e,n,t):isAtRule(e)&&isRule(n)&&isAtruleWithinRule(e)&&atruleWithinRule(e,n,t,walk),"nodes"in e&&e.nodes.length&&walk(e,t)}))}const creator$1=()=>({postcssPlugin:"postcss-nesting",Rule(e,{result:t}){walk(e,t),e.selector.includes("&")&&ersandToScope(e,t)},AtRule:{nest(e){throw e.error(`\`@nest\` was removed from the CSS Nesting specification and will be removed from PostCSS Nesting in the next major version.\nChange \`@nest ${e.params} {}\` to \`${e.params} {}\` to migrate to the latest standard.`)}}});creator$1.postcss=!0;const creator=e=>{const t=Object.assign({edition:"2024-02"},e);switch(t.edition){case"2021":return creator$2(e);case"2024-02":return creator$1();default:throw new Error(`Invalid edition: ${t.edition}`)}};creator.postcss=!0,module.exports=creator;
diff --git a/plugins/postcss-nesting/dist/index.d.ts b/plugins/postcss-nesting/dist/index.d.ts
index 0ce7888d8..356c13de6 100644
--- a/plugins/postcss-nesting/dist/index.d.ts
+++ b/plugins/postcss-nesting/dist/index.d.ts
@@ -5,7 +5,7 @@ export default creator;
/** postcss-nesting plugin options */
export declare type pluginOptions = {
- /** The implementation edition for CSS Nesting, default to '2021' */
+ /** The implementation edition for CSS Nesting, default to '2024-02' */
edition?: '2021' | '2024-02';
} & pluginOptions2021 & pluginOptions2024_02;
diff --git a/plugins/postcss-nesting/dist/index.mjs b/plugins/postcss-nesting/dist/index.mjs
index 7db55e943..012bb82d6 100644
--- a/plugins/postcss-nesting/dist/index.mjs
+++ b/plugins/postcss-nesting/dist/index.mjs
@@ -1 +1 @@
-import e from"postcss-selector-parser";import{selectorSpecificity as t}from"@csstools/selector-specificity";import{resolveNestedSelector as n}from"@csstools/selector-resolve-nested";const r=e.pseudo({value:":is"});function sortCompoundSelectorsInsideComplexSelector(t){if(!t||!t.nodes)return;const n=[];let o=[];for(let s=0;s"tag"===e.type))){const n=r.clone({}),o=t.nodes[s];o.replaceWith(n),n.append(e.selector({nodes:[o],value:void 0}))}o.push(t.nodes[s])}else n.push(o),n.push([t.nodes[s]]),o=[];n.push(o);const s=[];for(let e=0;e"selector"===e.type&&"selector"===t.type&&e.nodes.length&&t.nodes.length?selectorTypeOrder(e.nodes[0])-selectorTypeOrder(t.nodes[0]):"selector"===e.type&&e.nodes.length?selectorTypeOrder(e.nodes[0])-selectorTypeOrder(t):"selector"===t.type&&t.nodes.length?selectorTypeOrder(e)-selectorTypeOrder(t.nodes[0]):selectorTypeOrder(e)-selectorTypeOrder(t)));for(let e=0;e=0;e--)s[e].remove(),t.prepend(s[e])}function selectorTypeOrder(t){return e.isPseudoElement(t)?o.pseudoElement:o[t.type]}const o={universal:0,tag:1,pseudoElement:2,id:3,class:4,attribute:5,pseudo:6,selector:7,string:8,root:9,comment:10};function isAtRule(e){return e&&"atrule"===e.type}function isNestRule(e){return e&&isAtRule(e)&&"nest"===e.name}function isRule(e){return e&&"rule"===e.type}function ampersandToScope$1(t,n){let r,o=t.parent;for(;o;){if("rule"===o.type)return;if(isAtRule(o)&&"scope"===o.name)return;o=o.parent}try{r=e().astSync(t.selector)}catch(e){return void t.warn(n,`Failed to parse selector : "${t.selector}" with message: "${e instanceof Error?e.message:e}"`)}r&&(r.walkNesting((t=>{const n=t.parent;t.replaceWith(e.pseudo({value:":scope"})),n&&sortCompoundSelectorsInsideComplexSelector(n)})),t.selector=r.toString())}function cleanupParent(e){if(!e.nodes.length)return void e.remove();const t=e.nodes.filter((e=>"comment"===e.type));t.length===e.nodes.length&&e.replaceWith(...t)}function groupDeclarations(e){const t=[],n=[];e.each((e=>{if(isDeclarationLike(e,n.length>0))t.push(e);else{if("comment"===e.type){let r=e.next();for(;r&&"comment"===r.type;)r=r.next();if(isDeclarationLike(r,n.length>0))return void t.push(e)}n.push(e)}})),e.removeAll(),t.forEach((t=>{e.append(t)})),n.forEach((t=>{e.append(t)}))}function isDeclarationLike(e,t){return!!e&&("decl"===e.type||"atrule"===e.type&&"mixin"===e.name.toLowerCase()&&!t)}function comma(e){const t=[];let n="",r=!1,o=0,s=!1,i=!1;for(const l of e)i?i=!1:"\\"===l?i=!0:s?l===s&&(s=!1):'"'===l||"'"===l?s=l:"("===l?o+=1:")"===l?o>0&&(o-=1):0===o&&","===l&&(r=!0),r?(""!==n&&t.push(n.trim()),n="",r=!1):n+=l;return t.push(n.trim()),t}function shiftNodesBeforeParent(e,t){const n=t.index(e);if(n){const e=t.cloneBefore().removeAll().append(t.nodes.slice(0,n));e.raws.semicolon=!0,cleanupParent(e)}t.before(e),t.raws.semicolon=!0}var s=["container","document","media","supports","layer","starting-style"];function transformAtruleWithinAtrule(e,t){var n,r;groupDeclarations(t),shiftNodesBeforeParent(e,t),e.params=(n=t.params,r=e.params,comma(n).map((e=>comma(r).map((t=>`${e} and ${t}`)).join(", "))).join(", ")),cleanupParent(t)}function isAtruleWithinAtrule(e,t){return s.includes(e.name)&&e.name===t.name}function atruleWithinRule$1(e,t,n,r,o){if(groupDeclarations(t),shiftNodesBeforeParent(e,t),e.nodes){const s=t.clone().removeAll().append(e.nodes);e.append(s),cleanupParent(t),r(s,n,o)}else cleanupParent(t)}function isAtruleWithinRule$1(e){return s.includes(e.name)}function combinationsWithSizeN(e,t){if(t<2)throw new Error("n must be greater than 1");if(e.length<2)throw new Error("s must be greater than 1");if(Math.pow(e.length,t)>1e4)throw new Error("Too many combinations when trying to resolve a nested selector with lists, reduce the complexity of your selectors");const n=[];for(let e=0;e=0;s--){let t=n[s];if(t>=e.length){if(t=0,n[s]=0,0===s)return r;n[s-1]+=1}o[s]=e[t].clone()}r.push(o),n[n.length-1]++}}function nodesAreEquallySpecific(n){const r=n.map((t=>e().astSync(t))).map((e=>t(e))),o=r[0];for(let e=1;ee().astSync(t))):[e().astSync(`:is(${t.join(",")})`)];const s=[];for(let t=0;t{"nesting"===e.type&&(n=!0)}));const r=t.nodes[0];let o=!1;r.each((e=>"combinator"===e.type&&(o=!0,!1))),n?o&&r.insertBefore(r.at(0),e.nesting()):(r.insertBefore(r.at(0),e.combinator({value:" "})),r.insertBefore(r.at(0),e.nesting())),l=t.toString()}let c=[],a=0;if(e().astSync(l).walkNesting((()=>{a++})),a>1&&o.length>1)c=combinationsWithSizeN(o,a),i=c.length;else{i=o.length;for(let e=0;e{if("nesting"!==o.type)return;let s=c[t][n];n++,"root"===s.type&&1===s.nodes.length&&(s=s.nodes[0]);const i=e().astSync(`:is(${s.toString()})`),l=isSimpleSelector(s.nodes[0]),a=isCompoundSelector(s.nodes[0]),u=isSimpleSelector(o),p=isCompoundSelector(o);if(l&&u)return void o.replaceWith(s.clone());if((l||a)&&(u||p)){const e=o.parent;return l&&"selector"===s.type?o.replaceWith(s.clone().nodes[0]):o.replaceWith(...s.clone().nodes),void(e&&e.nodes.length>1&&sortCompoundSelectorsInsideComplexSelector(e))}if(l){const e=o.parent;return o.replaceWith(s.clone().nodes[0]),void(e&&sortCompoundSelectorsInsideComplexSelector(e))}if(a){const e=o.parent;return o.replaceWith(...s.clone().nodes),void(e&&sortCompoundSelectorsInsideComplexSelector(e))}if(nestingIsFirstAndOnlyInSelectorWithEitherSpaceOrChildCombinator(o)){const e=o.parent;return o.replaceWith(...s.clone().nodes),void(e&&sortCompoundSelectorsInsideComplexSelector(e))}if(nestingIsNotInsideCompoundSelector(o)){const e=o.parent;return o.replaceWith(...s.clone().nodes),void(e&&sortCompoundSelectorsInsideComplexSelector(e))}const d=o.parent;r.noIsPseudoSelector?o.replaceWith(...s.clone().nodes):o.replaceWith(...i.clone({}).nodes),d&&sortCompoundSelectorsInsideComplexSelector(d)})),s.push(o.toString())}}return s}function isSimpleSelector(e){return"combinator"!==e.type&&!(e.parent&&e.parent.nodes.length>1)}function isCompoundSelector(e,t=null){if(isSimpleSelector(e))return!1;if(!e.parent)return!1;if(!!e.parent.nodes.find((e=>"combinator"===e.type)))return!1;return!(!!e.parent.nodes.find((e=>"nesting"===e.type))&&t&&!isCompoundSelector(t))}function nestingIsFirstAndOnlyInSelectorWithEitherSpaceOrChildCombinator(e){if(!e.parent)return!1;if(0!==e.parent.nodes.indexOf(e))return!1;for(let t=1;t"!==e.parent.nodes[t].value)return!1;return!0}function nestingIsNotInsideCompoundSelector(e){if(isSimpleSelector(e))return!0;if(!e.parent)return!1;for(let t=0;te.split("&").length>=2&&-1===e.indexOf("|")))}function transformRuleWithinRule$1(e,t,n,r){let o=[];try{o=mergeSelectors$1(t.selectors,e.selectors,r)}catch(r){return void e.warn(n,`Failed to parse selectors : "${t.selector}" / "${e.selector}" with message: "${r instanceof Error?r.message:r}"`)}if(!o.length)return;groupDeclarations(t),shiftNodesBeforeParent(e,t),e.selectors=o;"rule"===e.type&&"rule"===t.type&&e.selector===t.selector&&e.append(...t.nodes),cleanupParent(t)}function isValidRuleWithinRule$1(e){return e.selectors.every((e=>-1===e.indexOf("|")))}function walk$1(e,t,n){e.each((r=>{const o=r.parent;isNestRule(r)&&!n.silenceAtNestWarning&&e.warn(t,`\`@nest\` was removed from the CSS Nesting specification and will be removed from PostCSS Nesting in the next major version.\nChange \`@nest ${r.params} {}\` to \`${r.params} {}\` to migrate to the latest standard.`),isRule(r)&&isRule(o)&&isValidRuleWithinRule$1(r)?transformRuleWithinRule$1(r,o,t,n):isNestRule(r)&&isRule(o)&&isValidNestRuleWithinRule(r)?transformNestRuleWithinRule(r,o,t,walk$1,n):isAtRule(r)&&isRule(o)&&isAtruleWithinRule$1(r)?atruleWithinRule$1(r,o,t,walk$1,n):isAtRule(r)&&isAtRule(o)&&isAtruleWithinAtrule(r,o)&&transformAtruleWithinAtrule(r,o),"nodes"in r&&r.nodes.length&&walk$1(r,t,n)}))}const creator$2=e=>{const t=Object.assign({noIsPseudoSelector:!1,silenceAtNestWarning:!1},e);return{postcssPlugin:"postcss-nesting",Rule(e,{result:n}){walk$1(e,n,t),e.selector.includes("&")&&ersandToScope$1(e,n)}}};creator$2.postcss=!0;const i=e();function mergeSelectors(e,t,r,o){let s;try{s=n(i.astSync(t),i.astSync(r))}catch(n){return e.warn(o,`Failed to parse selectors : "${r}" / "${t}" with message: "${n instanceof Error?n.message:n}"`),!1}return!!s&&s.toString()}function ampersandToScope(t,n){{let r=t.parent;for(;r;){if("rule"===r.type)return;if(isAtRule(r)&&"scope"===r.name)return;r=r.parent}try{let n=!1;if(e().astSync(t.selector).walkNesting((()=>(n=!0,!1))),!n)return}catch(e){return void t.warn(n,`Failed to parse selector : "${t.selector}" with message: "${e instanceof Error?e.message:e}"`)}}const r=mergeSelectors(t,t.selector,":scope",n);r&&(t.selector=r)}function atruleWithinRule(e,t,n,r){if(shiftNodesBeforeParent(e,t),e.nodes){const o=t.clone().removeAll().append(e.nodes);e.append(o),cleanupParent(t),r(o,n)}else cleanupParent(t)}function isAtruleWithinRule(e){return s.includes(e.name)}function transformRuleWithinRule(e,t,n){const r=mergeSelectors(e,e.selector,t.selector,n);if(!r)return;shiftNodesBeforeParent(e,t),e.selector=r;"rule"===e.type&&"rule"===t.type&&e.selector===t.selector&&e.append(...t.nodes),cleanupParent(t)}function isValidRuleWithinRule(e){return e.selectors.every((e=>-1===e.indexOf("|")))}function walk(e,t){e.each((e=>{const n=e.parent;isRule(e)&&isRule(n)&&isValidRuleWithinRule(e)?transformRuleWithinRule(e,n,t):isAtRule(e)&&isRule(n)&&isAtruleWithinRule(e)&&atruleWithinRule(e,n,t,walk),"nodes"in e&&e.nodes.length&&walk(e,t)}))}const creator$1=()=>({postcssPlugin:"postcss-nesting",Rule(e,{result:t}){walk(e,t),e.selector.includes("&")&&ersandToScope(e,t)},AtRule:{nest(e){throw e.error(`\`@nest\` was removed from the CSS Nesting specification and will be removed from PostCSS Nesting in the next major version.\nChange \`@nest ${e.params} {}\` to \`${e.params} {}\` to migrate to the latest standard.`)}}});creator$1.postcss=!0;const creator=e=>{const t=Object.assign({edition:"2021"},e);switch(t.edition){case"2021":return creator$2(e);case"2024-02":return creator$1();default:throw new Error(`Invalid edition: ${t.edition}`)}};creator.postcss=!0;export{creator as default};
+import e from"postcss-selector-parser";import{selectorSpecificity as t}from"@csstools/selector-specificity";import{resolveNestedSelector as n}from"@csstools/selector-resolve-nested";const r=e.pseudo({value:":is"});function sortCompoundSelectorsInsideComplexSelector(t){if(!t||!t.nodes)return;const n=[];let o=[];for(let s=0;s"tag"===e.type))){const n=r.clone({}),o=t.nodes[s];o.replaceWith(n),n.append(e.selector({nodes:[o],value:void 0}))}o.push(t.nodes[s])}else n.push(o),n.push([t.nodes[s]]),o=[];n.push(o);const s=[];for(let e=0;e"selector"===e.type&&"selector"===t.type&&e.nodes.length&&t.nodes.length?selectorTypeOrder(e.nodes[0])-selectorTypeOrder(t.nodes[0]):"selector"===e.type&&e.nodes.length?selectorTypeOrder(e.nodes[0])-selectorTypeOrder(t):"selector"===t.type&&t.nodes.length?selectorTypeOrder(e)-selectorTypeOrder(t.nodes[0]):selectorTypeOrder(e)-selectorTypeOrder(t)));for(let e=0;e=0;e--)s[e].remove(),t.prepend(s[e])}function selectorTypeOrder(t){return e.isPseudoElement(t)?o.pseudoElement:o[t.type]}const o={universal:0,tag:1,pseudoElement:2,id:3,class:4,attribute:5,pseudo:6,selector:7,string:8,root:9,comment:10};function isAtRule(e){return e&&"atrule"===e.type}function isNestRule(e){return e&&isAtRule(e)&&"nest"===e.name}function isRule(e){return e&&"rule"===e.type}function ampersandToScope$1(t,n){let r,o=t.parent;for(;o;){if("rule"===o.type)return;if(isAtRule(o)&&"scope"===o.name)return;o=o.parent}try{r=e().astSync(t.selector)}catch(e){return void t.warn(n,`Failed to parse selector : "${t.selector}" with message: "${e instanceof Error?e.message:e}"`)}r&&(r.walkNesting((t=>{const n=t.parent;t.replaceWith(e.pseudo({value:":scope"})),n&&sortCompoundSelectorsInsideComplexSelector(n)})),t.selector=r.toString())}function cleanupParent(e){if(!e.nodes.length)return void e.remove();const t=e.nodes.filter((e=>"comment"===e.type));t.length===e.nodes.length&&e.replaceWith(...t)}function groupDeclarations(e){const t=[],n=[];e.each((e=>{if(isDeclarationLike(e,n.length>0))t.push(e);else{if("comment"===e.type){let r=e.next();for(;r&&"comment"===r.type;)r=r.next();if(isDeclarationLike(r,n.length>0))return void t.push(e)}n.push(e)}})),e.removeAll(),t.forEach((t=>{e.append(t)})),n.forEach((t=>{e.append(t)}))}function isDeclarationLike(e,t){return!!e&&("decl"===e.type||"atrule"===e.type&&"mixin"===e.name.toLowerCase()&&!t)}function comma(e){const t=[];let n="",r=!1,o=0,s=!1,i=!1;for(const l of e)i?i=!1:"\\"===l?i=!0:s?l===s&&(s=!1):'"'===l||"'"===l?s=l:"("===l?o+=1:")"===l?o>0&&(o-=1):0===o&&","===l&&(r=!0),r?(""!==n&&t.push(n.trim()),n="",r=!1):n+=l;return t.push(n.trim()),t}function shiftNodesBeforeParent(e,t){const n=t.index(e);if(n){const e=t.cloneBefore().removeAll().append(t.nodes.slice(0,n));e.raws.semicolon=!0,cleanupParent(e)}t.before(e),t.raws.semicolon=!0}var s=["container","document","media","supports","layer","starting-style"];function transformAtruleWithinAtrule(e,t){var n,r;groupDeclarations(t),shiftNodesBeforeParent(e,t),e.params=(n=t.params,r=e.params,comma(n).map((e=>comma(r).map((t=>`${e} and ${t}`)).join(", "))).join(", ")),cleanupParent(t)}function isAtruleWithinAtrule(e,t){return s.includes(e.name)&&e.name===t.name}function atruleWithinRule$1(e,t,n,r,o){if(groupDeclarations(t),shiftNodesBeforeParent(e,t),e.nodes){const s=t.clone().removeAll().append(e.nodes);e.append(s),cleanupParent(t),r(s,n,o)}else cleanupParent(t)}function isAtruleWithinRule$1(e){return s.includes(e.name)}function combinationsWithSizeN(e,t){if(t<2)throw new Error("n must be greater than 1");if(e.length<2)throw new Error("s must be greater than 1");if(Math.pow(e.length,t)>1e4)throw new Error("Too many combinations when trying to resolve a nested selector with lists, reduce the complexity of your selectors");const n=[];for(let e=0;e=0;s--){let t=n[s];if(t>=e.length){if(t=0,n[s]=0,0===s)return r;n[s-1]+=1}o[s]=e[t].clone()}r.push(o),n[n.length-1]++}}function nodesAreEquallySpecific(n){const r=n.map((t=>e().astSync(t))).map((e=>t(e))),o=r[0];for(let e=1;ee().astSync(t))):[e().astSync(`:is(${t.join(",")})`)];const s=[];for(let t=0;t{"nesting"===e.type&&(n=!0)}));const r=t.nodes[0];let o=!1;r.each((e=>"combinator"===e.type&&(o=!0,!1))),n?o&&r.insertBefore(r.at(0),e.nesting()):(r.insertBefore(r.at(0),e.combinator({value:" "})),r.insertBefore(r.at(0),e.nesting())),l=t.toString()}let c=[],a=0;if(e().astSync(l).walkNesting((()=>{a++})),a>1&&o.length>1)c=combinationsWithSizeN(o,a),i=c.length;else{i=o.length;for(let e=0;e{if("nesting"!==o.type)return;let s=c[t][n];n++,"root"===s.type&&1===s.nodes.length&&(s=s.nodes[0]);const i=e().astSync(`:is(${s.toString()})`),l=isSimpleSelector(s.nodes[0]),a=isCompoundSelector(s.nodes[0]),u=isSimpleSelector(o),p=isCompoundSelector(o);if(l&&u)return void o.replaceWith(s.clone());if((l||a)&&(u||p)){const e=o.parent;return l&&"selector"===s.type?o.replaceWith(s.clone().nodes[0]):o.replaceWith(...s.clone().nodes),void(e&&e.nodes.length>1&&sortCompoundSelectorsInsideComplexSelector(e))}if(l){const e=o.parent;return o.replaceWith(s.clone().nodes[0]),void(e&&sortCompoundSelectorsInsideComplexSelector(e))}if(a){const e=o.parent;return o.replaceWith(...s.clone().nodes),void(e&&sortCompoundSelectorsInsideComplexSelector(e))}if(nestingIsFirstAndOnlyInSelectorWithEitherSpaceOrChildCombinator(o)){const e=o.parent;return o.replaceWith(...s.clone().nodes),void(e&&sortCompoundSelectorsInsideComplexSelector(e))}if(nestingIsNotInsideCompoundSelector(o)){const e=o.parent;return o.replaceWith(...s.clone().nodes),void(e&&sortCompoundSelectorsInsideComplexSelector(e))}const d=o.parent;r.noIsPseudoSelector?o.replaceWith(...s.clone().nodes):o.replaceWith(...i.clone({}).nodes),d&&sortCompoundSelectorsInsideComplexSelector(d)})),s.push(o.toString())}}return s}function isSimpleSelector(e){return"combinator"!==e.type&&!(e.parent&&e.parent.nodes.length>1)}function isCompoundSelector(e,t=null){if(isSimpleSelector(e))return!1;if(!e.parent)return!1;if(!!e.parent.nodes.find((e=>"combinator"===e.type)))return!1;return!(!!e.parent.nodes.find((e=>"nesting"===e.type))&&t&&!isCompoundSelector(t))}function nestingIsFirstAndOnlyInSelectorWithEitherSpaceOrChildCombinator(e){if(!e.parent)return!1;if(0!==e.parent.nodes.indexOf(e))return!1;for(let t=1;t"!==e.parent.nodes[t].value)return!1;return!0}function nestingIsNotInsideCompoundSelector(e){if(isSimpleSelector(e))return!0;if(!e.parent)return!1;for(let t=0;te.split("&").length>=2&&-1===e.indexOf("|")))}function transformRuleWithinRule$1(e,t,n,r){let o=[];try{o=mergeSelectors$1(t.selectors,e.selectors,r)}catch(r){return void e.warn(n,`Failed to parse selectors : "${t.selector}" / "${e.selector}" with message: "${r instanceof Error?r.message:r}"`)}if(!o.length)return;groupDeclarations(t),shiftNodesBeforeParent(e,t),e.selectors=o;"rule"===e.type&&"rule"===t.type&&e.selector===t.selector&&e.append(...t.nodes),cleanupParent(t)}function isValidRuleWithinRule$1(e){return e.selectors.every((e=>-1===e.indexOf("|")))}function walk$1(e,t,n){e.each((r=>{const o=r.parent;isNestRule(r)&&!n.silenceAtNestWarning&&e.warn(t,`\`@nest\` was removed from the CSS Nesting specification and will be removed from PostCSS Nesting in the next major version.\nChange \`@nest ${r.params} {}\` to \`${r.params} {}\` to migrate to the latest standard.`),isRule(r)&&isRule(o)&&isValidRuleWithinRule$1(r)?transformRuleWithinRule$1(r,o,t,n):isNestRule(r)&&isRule(o)&&isValidNestRuleWithinRule(r)?transformNestRuleWithinRule(r,o,t,walk$1,n):isAtRule(r)&&isRule(o)&&isAtruleWithinRule$1(r)?atruleWithinRule$1(r,o,t,walk$1,n):isAtRule(r)&&isAtRule(o)&&isAtruleWithinAtrule(r,o)&&transformAtruleWithinAtrule(r,o),"nodes"in r&&r.nodes.length&&walk$1(r,t,n)}))}const creator$2=e=>{const t=Object.assign({noIsPseudoSelector:!1,silenceAtNestWarning:!1},e);return{postcssPlugin:"postcss-nesting",Rule(e,{result:n}){walk$1(e,n,t),e.selector.includes("&")&&ersandToScope$1(e,n)}}};creator$2.postcss=!0;const i=e();function mergeSelectors(e,t,r,o){let s;try{s=n(i.astSync(t),i.astSync(r))}catch(n){return e.warn(o,`Failed to parse selectors : "${r}" / "${t}" with message: "${n instanceof Error?n.message:n}"`),!1}return!!s&&s.toString()}function ampersandToScope(t,n){{let r=t.parent;for(;r;){if("rule"===r.type)return;if(isAtRule(r)&&"scope"===r.name)return;r=r.parent}try{let n=!1;if(e().astSync(t.selector).walkNesting((()=>(n=!0,!1))),!n)return}catch(e){return void t.warn(n,`Failed to parse selector : "${t.selector}" with message: "${e instanceof Error?e.message:e}"`)}}const r=mergeSelectors(t,t.selector,":scope",n);r&&(t.selector=r)}function atruleWithinRule(e,t,n,r){if(shiftNodesBeforeParent(e,t),e.nodes){const o=t.clone().removeAll().append(e.nodes);e.append(o),cleanupParent(t),r(o,n)}else cleanupParent(t)}function isAtruleWithinRule(e){return s.includes(e.name)}function transformRuleWithinRule(e,t,n){const r=mergeSelectors(e,e.selector,t.selector,n);if(!r)return;shiftNodesBeforeParent(e,t),e.selector=r;"rule"===e.type&&"rule"===t.type&&e.selector===t.selector&&e.append(...t.nodes),cleanupParent(t)}function isValidRuleWithinRule(e){return e.selectors.every((e=>-1===e.indexOf("|")))}function walk(e,t){e.each((e=>{const n=e.parent;isRule(e)&&isRule(n)&&isValidRuleWithinRule(e)?transformRuleWithinRule(e,n,t):isAtRule(e)&&isRule(n)&&isAtruleWithinRule(e)&&atruleWithinRule(e,n,t,walk),"nodes"in e&&e.nodes.length&&walk(e,t)}))}const creator$1=()=>({postcssPlugin:"postcss-nesting",Rule(e,{result:t}){walk(e,t),e.selector.includes("&")&&ersandToScope(e,t)},AtRule:{nest(e){throw e.error(`\`@nest\` was removed from the CSS Nesting specification and will be removed from PostCSS Nesting in the next major version.\nChange \`@nest ${e.params} {}\` to \`${e.params} {}\` to migrate to the latest standard.`)}}});creator$1.postcss=!0;const creator=e=>{const t=Object.assign({edition:"2024-02"},e);switch(t.edition){case"2021":return creator$2(e);case"2024-02":return creator$1();default:throw new Error(`Invalid edition: ${t.edition}`)}};creator.postcss=!0;export{creator as default};
diff --git a/plugins/postcss-nesting/docs/README.md b/plugins/postcss-nesting/docs/README.md
index af3aca4e9..b8f571c59 100644
--- a/plugins/postcss-nesting/docs/README.md
+++ b/plugins/postcss-nesting/docs/README.md
@@ -27,42 +27,30 @@ you might want to use [PostCSS Nested] instead.
/* becomes */
-
+
```
-## ⚠️ `@nest` has been removed from the specification.
+## Options
-Previous iterations of the [CSS Nesting specification] required using `@nest` for certain selectors.
+### edition
-`@nest` was removed from the specification completely.
-Future versions of this plugin will error if you use `@nest`.
+The CSS nesting feature has gone through several iterations and what is currently implemented in browsers is not the same as what was originally proposed. This plugin dates back to the original proposal and you might have written your CSS expecting this older behavior.
-We advice everyone to migrate their codebase **now** to nested CSS without `@nest`.
-We published a [Stylelint Plugin](https://github.com/csstools/postcss-plugins/tree/main/plugins-stylelint/no-at-nest-rule#csstoolsstylelint-no-at-nest-rule) to help you migrate.
+You can pick the older behavior by setting the `edition` option.
+The `edition` values correspond with rough dates when of a particular version of the specification:
+- `2024-02` (default)
+- `2021`
-example warning:
-> `@nest` was removed from the CSS Nesting specification and will be removed from PostCSS Nesting in the next major version.
-> Change `@nest foo & {}` to `foo & {}` to migrate to the latest standard.
+> [!TIP]
+> If you wrote nested rules with `@nest` you definitely want to set the `edition` to `2021`.
+> If you are unsure than you should try to omit the `edition` option and use the default.
-You can silence this warning with a new `silenceAtNestWarning` plugin option.
+Eventually we will remove support for the older edition, and this plugin option, so it is strongly advised to update your CSS to the latest edition.
-```js
-({
- silenceAtNestWarning: true
-})
-```
-
-## Options
-
-### edition
-
-The default behavior is to transpile CSS following an older version of the CSS nesting specification.
-
-If you want to already use the latest version you can set the `edition` option to `2024-02`.
```js
({
@@ -70,37 +58,27 @@ If you want to already use the latest version you can set the `edition` option t
})
```
-#### `2021` (default)
-
-This version is a continuation of what existed before CSS nesting was implemented in browsers.
-It made a few non-invasive changes to keep up with implementations but it is falling behind.
-
-In a future version of this plugin this will no longer be the default.
-
-```pcss
-
-
-/* becomes */
-
-
-```
-
-#### `2024-02`
+#### `2024-02` (default)
- usage of `:is()` pseudo-class is no longer optional
- at rules are not combined with the `and` keyword
- `@nest` is removed from the specification
- declarations and nested rules/at-rules are no longer re-ordered
+#### `2021`
+
+This version is a continuation of what existed before CSS nesting was implemented in browsers.
+It made a few non-invasive changes to keep up with implementations but it is falling behind.
+
```pcss
/* becomes */
-
+
```
-### noIsPseudoSelector
+### noIsPseudoSelector (edition: `2021`)
#### Specificity
diff --git a/plugins/postcss-nesting/package.json b/plugins/postcss-nesting/package.json
index 898bc60a0..236e93f2c 100644
--- a/plugins/postcss-nesting/package.json
+++ b/plugins/postcss-nesting/package.json
@@ -29,7 +29,7 @@
}
],
"engines": {
- "node": "^14 || ^16 || >=18"
+ "node": ">=18"
},
"type": "module",
"main": "dist/index.cjs",
diff --git a/plugins/postcss-nesting/src/editions/2021/lib/atrule-within-rule.ts b/plugins/postcss-nesting/src/editions/2021/lib/atrule-within-rule.ts
index 20ff43461..dfff9c29a 100644
--- a/plugins/postcss-nesting/src/editions/2021/lib/atrule-within-rule.ts
+++ b/plugins/postcss-nesting/src/editions/2021/lib/atrule-within-rule.ts
@@ -4,7 +4,7 @@ import cleanupParent from '../../shared/lib/cleanup-parent.js';
import groupDeclarations from './group-declarations.js';
import shiftNodesBeforeParent from '../../shared/lib/shift-nodes-before-parent.js';
import validAtrules from '../../shared/lib/valid-atrules.js';
-import { options } from './options.js';
+import type { options } from './options.js';
export default function atruleWithinRule(node: AtRule, parent: Rule, result: Result, walk: walkFunc, opts: options): void {
// Group all declarations after the first one.
diff --git a/plugins/postcss-nesting/src/editions/2021/lib/merge-selectors/merge-selectors.ts b/plugins/postcss-nesting/src/editions/2021/lib/merge-selectors/merge-selectors.ts
index 7e37643c3..7d28a2096 100644
--- a/plugins/postcss-nesting/src/editions/2021/lib/merge-selectors/merge-selectors.ts
+++ b/plugins/postcss-nesting/src/editions/2021/lib/merge-selectors/merge-selectors.ts
@@ -3,7 +3,7 @@ import type { Nesting } from 'postcss-selector-parser';
import { combinationsWithSizeN } from './combinations-of-size-n';
import { sortCompoundSelectorsInsideComplexSelector } from './compound-selector-order';
import { nodesAreEquallySpecific } from './specificity';
-import { options } from '../options';
+import type { options } from '../options';
export default function mergeSelectors(fromSelectors: Array, toSelectors: Array, opts: options): Array {
const fromListHasUniformSpecificity = nodesAreEquallySpecific(fromSelectors);
diff --git a/plugins/postcss-nesting/src/editions/2021/lib/nest-rule-within-rule.ts b/plugins/postcss-nesting/src/editions/2021/lib/nest-rule-within-rule.ts
index a78662c45..f04d0a1cb 100644
--- a/plugins/postcss-nesting/src/editions/2021/lib/nest-rule-within-rule.ts
+++ b/plugins/postcss-nesting/src/editions/2021/lib/nest-rule-within-rule.ts
@@ -3,7 +3,7 @@ import type { walkFunc } from './walk-func.js';
import mergeSelectors from './merge-selectors/merge-selectors.js';
import shiftNodesBeforeParent from '../../shared/lib/shift-nodes-before-parent.js';
import { comma } from './list.js';
-import { options } from './options.js';
+import type { options } from './options.js';
import cleanupParent from '../../shared/lib/cleanup-parent.js';
export default function transformNestRuleWithinRule(node: AtRule, parent: Rule, result: Result, walk: walkFunc, opts: options): void {
diff --git a/plugins/postcss-nesting/src/editions/2021/lib/rule-within-rule.ts b/plugins/postcss-nesting/src/editions/2021/lib/rule-within-rule.ts
index c154dd598..18a4143a2 100644
--- a/plugins/postcss-nesting/src/editions/2021/lib/rule-within-rule.ts
+++ b/plugins/postcss-nesting/src/editions/2021/lib/rule-within-rule.ts
@@ -3,7 +3,7 @@ import cleanupParent from '../../shared/lib/cleanup-parent.js';
import groupDeclarations from './group-declarations.js';
import mergeSelectors from './merge-selectors/merge-selectors.js';
import shiftNodesBeforeParent from '../../shared/lib/shift-nodes-before-parent.js';
-import { options } from './options.js';
+import type { options } from './options.js';
export default function transformRuleWithinRule(node: Rule, parent: Rule, result: Result, opts: options): void {
let selectors: Array = [];
diff --git a/plugins/postcss-nesting/src/editions/2021/lib/walk.ts b/plugins/postcss-nesting/src/editions/2021/lib/walk.ts
index 82cdd344b..4a203a935 100644
--- a/plugins/postcss-nesting/src/editions/2021/lib/walk.ts
+++ b/plugins/postcss-nesting/src/editions/2021/lib/walk.ts
@@ -4,7 +4,7 @@ import transformAtruleWithinRule, { isAtruleWithinRule } from './atrule-within-r
import transformNestRuleWithinRule, { isValidNestRuleWithinRule } from './nest-rule-within-rule.js';
import transformRuleWithinRule, { isValidRuleWithinRule } from './rule-within-rule.js';
import { isAtRule, isNestRule, isRule } from '../../shared/lib/is-type-of-rule.js';
-import { options } from './options.js';
+import type { options } from './options.js';
export default function walk(node: Container, result: Result, opts: options): void {
node.each((child) => {
diff --git a/plugins/postcss-nesting/src/index.ts b/plugins/postcss-nesting/src/index.ts
index a18bc974c..814e12571 100644
--- a/plugins/postcss-nesting/src/index.ts
+++ b/plugins/postcss-nesting/src/index.ts
@@ -10,7 +10,7 @@ export type { pluginOptions as pluginOptions2024_02 } from './editions/2024-02';
/** postcss-nesting plugin options */
export type pluginOptions = {
- /** The implementation edition for CSS Nesting, default to '2021' */
+ /** The implementation edition for CSS Nesting, default to '2024-02' */
edition?: '2021' | '2024-02',
} & pluginOptions2021 & pluginOptions2024_02;
@@ -18,7 +18,7 @@ const creator: PluginCreator = (opts?: pluginOptions) => {
const options = Object.assign(
// Default options
{
- edition: '2021',
+ edition: '2024-02',
},
// Provided options
opts,
diff --git a/plugins/postcss-nesting/test/_browser.mjs b/plugins/postcss-nesting/test/_browser.mjs
index 627ffc044..3554e31e2 100644
--- a/plugins/postcss-nesting/test/_browser.mjs
+++ b/plugins/postcss-nesting/test/_browser.mjs
@@ -1,6 +1,6 @@
import puppeteer from 'puppeteer';
-import http from 'http';
-import { promises as fsp } from 'fs';
+import http from 'node:http';
+import fs from 'node:fs/promises';
import plugin from 'postcss-nesting';
import postcss from 'postcss';
import test from 'node:test';
@@ -41,7 +41,7 @@ const requestListener = async function (req, res) {
case '/wpt/nesting-basics.html':
res.setHeader('Content-type', 'text/html');
res.writeHead(200);
- res.end(await fsp.readFile('test' + pathname, 'utf8'));
+ res.end(await fs.readFile('test' + pathname, 'utf8'));
break;
case '/test/styles.css':
if (req.method === 'POST') {
@@ -93,30 +93,32 @@ if (!process.env.DEBUG) {
headless: 'new',
});
- const page = await browser.newPage();
- page.on('pageerror', (msg) => {
- throw msg;
- });
-
- for (const url of [
- 'wpt/conditional.html',
- 'wpt/implicit-nesting.html',
- 'wpt/nest-containing.html',
- 'wpt/nesting-basics.html',
- ]) {
- await page.goto('http://localhost:8080/' + url);
- const result = await page.evaluate(async () => {
- // eslint-disable-next-line no-undef
- return await window.runTest();
+ try {
+ const page = await browser.newPage();
+ page.on('pageerror', (msg) => {
+ throw msg;
});
- if (!result) {
- throw new Error('Test failed, expected "window.runTest()" to return true');
- }
- }
- await browser.close();
+ for (const url of [
+ 'wpt/conditional.html',
+ 'wpt/implicit-nesting.html',
+ 'wpt/nest-containing.html',
+ 'wpt/nesting-basics.html',
+ ]) {
+ await page.goto('http://localhost:8080/' + url);
+ const result = await page.evaluate(async () => {
+ // eslint-disable-next-line no-undef
+ return await window.runTest();
+ });
+ if (!result) {
+ throw new Error('Test failed, expected "window.runTest()" to return true');
+ }
+ }
+ } finally {
+ await browser.close();
- await cleanup();
+ await cleanup();
+ }
});
} else {
startServers();
diff --git a/plugins/postcss-nesting/test/_import.mjs b/plugins/postcss-nesting/test/_import.mjs
index 62ea85f57..f81f9e22a 100644
--- a/plugins/postcss-nesting/test/_import.mjs
+++ b/plugins/postcss-nesting/test/_import.mjs
@@ -1,4 +1,4 @@
-import assert from 'assert';
+import assert from 'node:assert';
import plugin from 'postcss-nesting';
plugin();
diff --git a/plugins/postcss-nesting/test/_tape-2021.mjs b/plugins/postcss-nesting/test/_tape-2021.mjs
index 29578bd1f..31aa7752e 100644
--- a/plugins/postcss-nesting/test/_tape-2021.mjs
+++ b/plugins/postcss-nesting/test/_tape-2021.mjs
@@ -49,42 +49,61 @@ mixinPluginNestedRules.postcss = true;
postcssTape(plugin)({
'basic': {
message: 'supports basic usage',
+ options: {
+ edition: '2021',
+ },
},
'basic:no-is-pseudo-selector': {
message: 'supports basic usage { noIsPseudoSelector: true }',
options: {
+ edition: '2021',
noIsPseudoSelector: true,
},
},
'ampersand-everywhere': {
message: 'supports & at the root',
+ options: {
+ edition: '2021',
+ },
},
'complex': {
message: 'supports complex entries',
+ options: {
+ edition: '2021',
+ },
},
'complex:no-is-pseudo-selector': {
message: 'supports complex entries { noIsPseudoSelector: true }',
options: {
+ edition: '2021',
noIsPseudoSelector: true,
},
},
'direct': {
message: 'supports direct usage',
+ options: {
+ edition: '2021',
+ },
},
'direct:no-is-pseudo-selector': {
message: 'supports direct usage { noIsPseudoSelector: true }',
options: {
+ edition: '2021',
noIsPseudoSelector: true,
},
},
'at-nest': {
message: 'supports at-nest usage',
warnings: 64,
+ options: {
+ edition: '2021',
+ },
},
'at-nest:silent': {
message: 'supports at-nest usage { silenceAtNestWarning: true }',
warnings: 4,
options: {
+ edition: '2021',
silenceAtNestWarning: true,
},
},
@@ -92,121 +111,175 @@ postcssTape(plugin)({
message: 'supports at-nest usage { noIsPseudoSelector: true }',
warnings: 64,
options: {
+ edition: '2021',
noIsPseudoSelector: true,
},
},
'container': {
message: 'supports nested @container',
+ options: {
+ edition: '2021',
+ },
},
'container:no-is-pseudo-selector': {
message: 'supports nested @container { noIsPseudoSelector: true }',
options: {
+ edition: '2021',
noIsPseudoSelector: true,
},
},
'decl-order': {
message: 'resolves to the correct order',
+ options: {
+ edition: '2021',
+ },
},
'document': {
message: 'supports nested @document',
+ options: {
+ edition: '2021',
+ },
},
'document:no-is-pseudo-selector': {
message: 'supports nested @document { noIsPseudoSelector: true }',
options: {
+ edition: '2021',
noIsPseudoSelector: true,
},
},
'invalid-selector': {
message: 'warns on invalid selectors',
warnings: 4,
+ options: {
+ edition: '2021',
+ },
},
'media': {
message: 'supports nested @media',
+ options: {
+ edition: '2021',
+ },
},
'media:no-is-pseudo-selector': {
message: 'supports nested @media { noIsPseudoSelector: true }',
options: {
+ edition: '2021',
noIsPseudoSelector: true,
},
},
'multiple-replacements': {
message: 'supports multiple replacements',
+ options: {
+ edition: '2021',
+ },
},
'pseudo-element': {
message: 'supports pseudo elements',
+ options: {
+ edition: '2021',
+ },
},
'supports': {
message: 'supports nested @supports',
+ options: {
+ edition: '2021',
+ },
},
'supports:no-is-pseudo-selector': {
message: 'supports nested @supports { noIsPseudoSelector: true }',
options: {
+ edition: '2021',
noIsPseudoSelector: true,
},
},
'layer': {
message: 'supports nested @layer',
+ options: {
+ edition: '2021',
+ },
},
'empty': {
message: 'removes empty rules',
+ options: {
+ edition: '2021',
+ },
},
'empty:no-is-pseudo-selector': {
message: 'removes empty rules { noIsPseudoSelector: true }',
options: {
+ edition: '2021',
noIsPseudoSelector: true,
},
},
'ignore': {
message: 'ignores invalid entries',
+ options: {
+ edition: '2021',
+ },
},
'ignore:no-is-pseudo-selector': {
message: 'ignores invalid entries { noIsPseudoSelector: true }',
options: {
+ edition: '2021',
noIsPseudoSelector: true,
},
},
'mixin-declaration': {
message: 'supports other visitors (mixin declaration)',
- plugins: [mixinPluginDeclaration(), plugin()],
+ plugins: [mixinPluginDeclaration(), plugin({ edition: '2021' })],
},
'mixin-declaration:no-is-pseudo-selector': {
message: 'supports other visitors (mixin declaration) { noIsPseudoSelector: true }',
- plugins: [mixinPluginDeclaration(), plugin({ noIsPseudoSelector: true })],
+ plugins: [mixinPluginDeclaration(), plugin({ noIsPseudoSelector: true, edition: '2021' })],
},
'mixin-rule': {
message: 'supports other visitors (mixin rule)',
- plugins: [mixinPluginRule(), plugin()],
+ plugins: [mixinPluginRule(), plugin({ edition: '2021' })],
},
'mixin-rule:no-is-pseudo-selector': {
message: 'supports other visitors (mixin rule) { noIsPseudoSelector: true }',
- plugins: [mixinPluginRule(), plugin({ noIsPseudoSelector: true })],
+ plugins: [mixinPluginRule(), plugin({ noIsPseudoSelector: true, edition: '2021' })],
},
'mixin-nested-rules': {
message: 'supports mixin with nested rules',
- plugins: [mixinPluginNestedRules(), plugin()],
+ plugins: [mixinPluginNestedRules(), plugin({ edition: '2021' })],
},
'spec-examples': {
message: 'supports all spec examples',
+ options: {
+ edition: '2021',
+ },
},
'spec-examples:no-is-pseudo-selector': {
message: 'supports all spec examples { noIsPseudoSelector: true }',
options: {
+ edition: '2021',
noIsPseudoSelector: true,
},
},
'relative-selectors': {
message: 'supports relative selectors',
+ options: {
+ edition: '2021',
+ },
},
'requires-is-pseudo': {
message: 'examples of selector nesting that require :is to be correct',
+ options: {
+ edition: '2021',
+ },
},
'requires-is-pseudo:no-is-pseudo-selector': {
message: 'examples of selector nesting that require :is to be correct { noIsPseudoSelector: true }',
options: {
+ edition: '2021',
noIsPseudoSelector: true,
},
},
'examples/example': {
message: 'basic examples',
+ options: {
+ edition: '2021',
+ },
},
});
diff --git a/plugins/postcss-nesting/test/_tape-2024-02.mjs b/plugins/postcss-nesting/test/_tape-2024-02.mjs
index 445fe12c3..d3f5d6a1c 100644
--- a/plugins/postcss-nesting/test/_tape-2024-02.mjs
+++ b/plugins/postcss-nesting/test/_tape-2024-02.mjs
@@ -49,88 +49,46 @@ mixinPluginNestedRules.postcss = true;
postcssTape(plugin)({
'basic:edition-2024-02': {
message: 'supports basic usage',
- options: {
- edition: '2024-02',
- },
},
'ampersand-everywhere:edition-2024-02': {
message: 'supports & at the root',
- options: {
- edition: '2024-02',
- },
},
'complex:edition-2024-02': {
message: 'supports complex entries',
- options: {
- edition: '2024-02',
- },
},
'direct:edition-2024-02': {
message: 'supports direct usage',
- options: {
- edition: '2024-02',
- },
},
'container:edition-2024-02': {
message: 'supports nested @container',
- options: {
- edition: '2024-02',
- },
},
'decl-order:edition-2024-02': {
message: 'resolves to the correct order',
- options: {
- edition: '2024-02',
- },
},
'invalid-selector:edition-2024-02': {
message: 'warns on invalid selectors',
- options: {
- edition: '2024-02',
- },
warnings: 4,
},
'media:edition-2024-02': {
message: 'supports nested @media',
- options: {
- edition: '2024-02',
- },
},
'multiple-replacements:edition-2024-02': {
message: 'supports multiple replacements',
- options: {
- edition: '2024-02',
- },
},
'pseudo-element:edition-2024-02': {
message: 'supports pseudo elements',
- options: {
- edition: '2024-02',
- },
},
'supports:edition-2024-02': {
message: 'supports nested @supports',
- options: {
- edition: '2024-02',
- },
},
'layer:edition-2024-02': {
message: 'supports nested @layer',
- options: {
- edition: '2024-02',
- },
},
'empty:edition-2024-02': {
message: 'removes empty rules',
- options: {
- edition: '2024-02',
- },
},
'ignore:edition-2024-02': {
message: 'ignores invalid entries',
- options: {
- edition: '2024-02',
- },
},
'mixin-declaration:edition-2024-02': {
message: 'supports other visitors (mixin declaration)',
@@ -146,26 +104,14 @@ postcssTape(plugin)({
},
'spec-examples:edition-2024-02': {
message: 'supports all spec examples',
- options: {
- edition: '2024-02',
- },
},
'relative-selectors:edition-2024-02': {
message: 'supports relative selectors',
- options: {
- edition: '2024-02',
- },
},
'requires-is-pseudo:edition-2024-02': {
message: 'examples of selector nesting that require :is to be correct',
- options: {
- edition: '2024-02',
- },
},
'examples/example:edition-2024-02': {
message: 'basic examples',
- options: {
- edition: '2024-02',
- },
},
});
diff --git a/plugins/postcss-nesting/test/wpt/nesting-basics.html b/plugins/postcss-nesting/test/wpt/nesting-basics.html
index aea0fb4ab..558a8272b 100644
--- a/plugins/postcss-nesting/test/wpt/nesting-basics.html
+++ b/plugins/postcss-nesting/test/wpt/nesting-basics.html
@@ -142,18 +142,18 @@
.test-10 {
& {
- background-color: green;
+ background-color: red;
}
- background-color: red;
+ background-color: green;
}
.test-11 {
& {
- background-color: red;
+ background-color: green !important;
}
- background-color: green !important;
+ background-color: red;
}
@scope (div) {
diff --git a/plugins/postcss-normalize-display-values/CHANGELOG.md b/plugins/postcss-normalize-display-values/CHANGELOG.md
index eacf35442..62910f627 100644
--- a/plugins/postcss-normalize-display-values/CHANGELOG.md
+++ b/plugins/postcss-normalize-display-values/CHANGELOG.md
@@ -1,5 +1,9 @@
# Changes to PostCSS Normalize Display Values
+### Unreleased (major)
+
+- Updated: Support for Node v18+ (major).
+
### 3.0.2
_December 15, 2023_
diff --git a/plugins/postcss-normalize-display-values/package.json b/plugins/postcss-normalize-display-values/package.json
index c1da776c2..63adbccd8 100644
--- a/plugins/postcss-normalize-display-values/package.json
+++ b/plugins/postcss-normalize-display-values/package.json
@@ -15,7 +15,7 @@
}
],
"engines": {
- "node": "^14 || ^16 || >=18"
+ "node": ">=18"
},
"type": "module",
"main": "dist/index.cjs",
diff --git a/plugins/postcss-normalize-display-values/test/_import.mjs b/plugins/postcss-normalize-display-values/test/_import.mjs
index f2c4fecb0..e4b29253d 100644
--- a/plugins/postcss-normalize-display-values/test/_import.mjs
+++ b/plugins/postcss-normalize-display-values/test/_import.mjs
@@ -1,4 +1,4 @@
-import assert from 'assert';
+import assert from 'node:assert';
import plugin from '@csstools/postcss-normalize-display-values';
plugin();
diff --git a/plugins/postcss-oklab-function/CHANGELOG.md b/plugins/postcss-oklab-function/CHANGELOG.md
index 2e34c975f..7f67fb42c 100644
--- a/plugins/postcss-oklab-function/CHANGELOG.md
+++ b/plugins/postcss-oklab-function/CHANGELOG.md
@@ -1,7 +1,8 @@
# Changes to PostCSS OKLab Function
-### Unreleased (patch)
+### Unreleased (major)
+- Updated: Support for Node v18+ (major).
- Updated [`@csstools/css-color-parser`](https://github.com/csstools/postcss-plugins/tree/main/packages/css-color-parser) to [`2.0.5`](https://github.com/csstools/postcss-plugins/tree/main/packages/css-color-parser/CHANGELOG.md#205) (patch)
### 3.0.19
diff --git a/plugins/postcss-oklab-function/package.json b/plugins/postcss-oklab-function/package.json
index 7e3d4d012..749c02078 100644
--- a/plugins/postcss-oklab-function/package.json
+++ b/plugins/postcss-oklab-function/package.json
@@ -15,7 +15,7 @@
}
],
"engines": {
- "node": "^14 || ^16 || >=18"
+ "node": ">=18"
},
"type": "module",
"main": "dist/index.cjs",
diff --git a/plugins/postcss-oklab-function/test/_import.mjs b/plugins/postcss-oklab-function/test/_import.mjs
index 71e59c597..0fb509b38 100644
--- a/plugins/postcss-oklab-function/test/_import.mjs
+++ b/plugins/postcss-oklab-function/test/_import.mjs
@@ -1,4 +1,4 @@
-import assert from 'assert';
+import assert from 'node:assert';
import plugin from '@csstools/postcss-oklab-function';
plugin();
diff --git a/plugins/postcss-overflow-shorthand/CHANGELOG.md b/plugins/postcss-overflow-shorthand/CHANGELOG.md
index 3bbe230a3..ff47b70b9 100644
--- a/plugins/postcss-overflow-shorthand/CHANGELOG.md
+++ b/plugins/postcss-overflow-shorthand/CHANGELOG.md
@@ -1,5 +1,9 @@
# Changes to PostCSS Overflow Shorthand
+### Unreleased (major)
+
+- Updated: Support for Node v18+ (major).
+
### 5.0.1
_December 15, 2023_
diff --git a/plugins/postcss-overflow-shorthand/package.json b/plugins/postcss-overflow-shorthand/package.json
index 8d807188b..fa19f380e 100644
--- a/plugins/postcss-overflow-shorthand/package.json
+++ b/plugins/postcss-overflow-shorthand/package.json
@@ -29,7 +29,7 @@
}
],
"engines": {
- "node": "^14 || ^16 || >=18"
+ "node": ">=18"
},
"type": "module",
"main": "dist/index.cjs",
diff --git a/plugins/postcss-overflow-shorthand/test/_import.mjs b/plugins/postcss-overflow-shorthand/test/_import.mjs
index cc24b07c8..7d34d2653 100644
--- a/plugins/postcss-overflow-shorthand/test/_import.mjs
+++ b/plugins/postcss-overflow-shorthand/test/_import.mjs
@@ -1,4 +1,4 @@
-import assert from 'assert';
+import assert from 'node:assert';
import plugin from 'postcss-overflow-shorthand';
plugin();
diff --git a/plugins/postcss-place/CHANGELOG.md b/plugins/postcss-place/CHANGELOG.md
index 7476e5105..fca6fcfbc 100644
--- a/plugins/postcss-place/CHANGELOG.md
+++ b/plugins/postcss-place/CHANGELOG.md
@@ -1,5 +1,9 @@
# Changes to PostCSS Place Properties
+### Unreleased (major)
+
+- Updated: Support for Node v18+ (major).
+
### 9.0.1
_December 15, 2023_
diff --git a/plugins/postcss-place/package.json b/plugins/postcss-place/package.json
index 115cf00ec..88cd7e94a 100644
--- a/plugins/postcss-place/package.json
+++ b/plugins/postcss-place/package.json
@@ -29,7 +29,7 @@
}
],
"engines": {
- "node": "^14 || ^16 || >=18"
+ "node": ">=18"
},
"type": "module",
"main": "dist/index.cjs",
diff --git a/plugins/postcss-place/test/_import.mjs b/plugins/postcss-place/test/_import.mjs
index aa97b9957..a766e58bf 100644
--- a/plugins/postcss-place/test/_import.mjs
+++ b/plugins/postcss-place/test/_import.mjs
@@ -1,4 +1,4 @@
-import assert from 'assert';
+import assert from 'node:assert';
import plugin from 'postcss-place';
plugin();
diff --git a/plugins/postcss-progressive-custom-properties/CHANGELOG.md b/plugins/postcss-progressive-custom-properties/CHANGELOG.md
index cbfe47133..8e8cf03bf 100644
--- a/plugins/postcss-progressive-custom-properties/CHANGELOG.md
+++ b/plugins/postcss-progressive-custom-properties/CHANGELOG.md
@@ -1,5 +1,9 @@
# Changes to PostCSS Progressive Custom Properties
+### Unreleased (major)
+
+- Updated: Support for Node v18+ (major).
+
### 3.3.0
_July 7, 2024_
diff --git a/plugins/postcss-progressive-custom-properties/package.json b/plugins/postcss-progressive-custom-properties/package.json
index af2db937f..eafb54c5b 100644
--- a/plugins/postcss-progressive-custom-properties/package.json
+++ b/plugins/postcss-progressive-custom-properties/package.json
@@ -15,7 +15,7 @@
}
],
"engines": {
- "node": "^14 || ^16 || >=18"
+ "node": ">=18"
},
"type": "module",
"main": "dist/index.cjs",
diff --git a/plugins/postcss-progressive-custom-properties/scripts/matchers.mjs b/plugins/postcss-progressive-custom-properties/scripts/matchers.mjs
index fd533763c..f987e366b 100644
--- a/plugins/postcss-progressive-custom-properties/scripts/matchers.mjs
+++ b/plugins/postcss-progressive-custom-properties/scripts/matchers.mjs
@@ -1,4 +1,4 @@
-import { promises as fsp } from 'fs';
+import fs from 'node:fs/promises';
import { colorMatchers, hslMatchers, hwbMatchers, labMatchers, lchMatchers, oklabMatchers, oklchMatchers, rgbMatchers } from './color.mjs';
import { colorMixMatchers } from './color-mix.mjs';
import { icUnitMatchers } from './font-size.mjs';
@@ -7,7 +7,7 @@ import { relativeColorSyntaxMatches } from './relative-color-syntax.mjs';
import { contrastColorMatchers } from './contrast-color.mjs';
import { contentMatchers } from './content.mjs';
-fsp.writeFile(
+fs.writeFile(
'./src/matchers.ts',
'export const matchers = ' + JSON.stringify(
[
diff --git a/plugins/postcss-progressive-custom-properties/src/index.ts b/plugins/postcss-progressive-custom-properties/src/index.ts
index 98521fa8d..8d82b94ed 100644
--- a/plugins/postcss-progressive-custom-properties/src/index.ts
+++ b/plugins/postcss-progressive-custom-properties/src/index.ts
@@ -1,4 +1,5 @@
-import { type Node, type AtRule, type PluginCreator, type Container, Plugin } from 'postcss';
+import type { Plugin } from 'postcss';
+import { type Node, type AtRule, type PluginCreator, type Container } from 'postcss';
import { conditionsFromValue } from './conditions-from-values';
const HAS_VARIABLE_FUNCTION_REGEX = /var\(/i;
diff --git a/plugins/postcss-progressive-custom-properties/test/_import.mjs b/plugins/postcss-progressive-custom-properties/test/_import.mjs
index 261a10457..41e8d4a10 100644
--- a/plugins/postcss-progressive-custom-properties/test/_import.mjs
+++ b/plugins/postcss-progressive-custom-properties/test/_import.mjs
@@ -1,4 +1,4 @@
-import assert from 'assert';
+import assert from 'node:assert';
import plugin from '@csstools/postcss-progressive-custom-properties';
plugin();
diff --git a/plugins/postcss-pseudo-class-any-link/CHANGELOG.md b/plugins/postcss-pseudo-class-any-link/CHANGELOG.md
index 3362d231f..9a599cee2 100644
--- a/plugins/postcss-pseudo-class-any-link/CHANGELOG.md
+++ b/plugins/postcss-pseudo-class-any-link/CHANGELOG.md
@@ -1,5 +1,9 @@
# Changes to PostCSS Pseudo Class Any Link
+### Unreleased (major)
+
+- Updated: Support for Node v18+ (major).
+
### 9.0.2
_April 21, 2024_
diff --git a/plugins/postcss-pseudo-class-any-link/package.json b/plugins/postcss-pseudo-class-any-link/package.json
index 405ed2ef5..0ddde9546 100644
--- a/plugins/postcss-pseudo-class-any-link/package.json
+++ b/plugins/postcss-pseudo-class-any-link/package.json
@@ -29,7 +29,7 @@
}
],
"engines": {
- "node": "^14 || ^16 || >=18"
+ "node": ">=18"
},
"type": "module",
"main": "dist/index.cjs",
diff --git a/plugins/postcss-pseudo-class-any-link/test/_import.mjs b/plugins/postcss-pseudo-class-any-link/test/_import.mjs
index 9fb976d24..ddb8937ef 100644
--- a/plugins/postcss-pseudo-class-any-link/test/_import.mjs
+++ b/plugins/postcss-pseudo-class-any-link/test/_import.mjs
@@ -1,4 +1,4 @@
-import assert from 'assert';
+import assert from 'node:assert';
import plugin from 'postcss-pseudo-class-any-link';
plugin();
diff --git a/plugins/postcss-rebase-url/CHANGELOG.md b/plugins/postcss-rebase-url/CHANGELOG.md
index dcd1b44cf..c85d1371e 100644
--- a/plugins/postcss-rebase-url/CHANGELOG.md
+++ b/plugins/postcss-rebase-url/CHANGELOG.md
@@ -1,5 +1,9 @@
# Changes to PostCSS Rebase URL
+### Unreleased (major)
+
+- Updated: Support for Node v18+ (major).
+
### 1.0.11
_July 6, 2024_
diff --git a/plugins/postcss-rebase-url/dist/index.cjs b/plugins/postcss-rebase-url/dist/index.cjs
index 9f6568ad5..03b00b87e 100644
--- a/plugins/postcss-rebase-url/dist/index.cjs
+++ b/plugins/postcss-rebase-url/dist/index.cjs
@@ -1 +1 @@
-"use strict";var e=require("@csstools/css-tokenizer"),r=require("@csstools/css-parser-algorithms"),t=require("path");const s=/^([-_a-z0-9]+:)?\/\//i;function rebase(e,r,i){if(e.startsWith("data:"))return!1;if(s.test(e))return!1;if(e.startsWith("/"))return e;if(e.startsWith("#"))return e;try{const r=new URL(e);if(r.port||r.protocol)return!1}catch{}const o=t.posix.resolve(t.posix.join(r,e));return t.posix.relative(i,o)}function serializeString(e){let r="";for(const t of e){const e=t.codePointAt(0);if(void 0!==e)switch(e){case 0:r+=String.fromCodePoint(65533);break;case 127:r+=`\\${e.toString(16)}`;break;case 34:case 39:case 92:r+=`\\${t}`;break;default:if(1<=e&&e<=31){r+=`\\${e.toString(16)} `;break}r+=t}else r+=String.fromCodePoint(65533)}return r}function normalizedDir(e){return t.parse(t.resolve(e.trim())).dir.split(t.sep).join(t.posix.sep)}const i=/^initial-value$/i,o=/^property$/i,n=/^syntax$/i,a=/url\(/i,u=/^url$/i,l=//i,creator=()=>({postcssPlugin:"postcss-rebase-url",prepare(){const t=new WeakSet,s=new Set;return{postcssPlugin:"postcss-rebase-url",Once(e){e.walkAtRules(o,(e=>{if(!e.nodes)return;const r=e.nodes.find((e=>{if("decl"===e.type&&n.test(e.prop))return!0}));r&&l.test(r.value)&&s.add(e.params.trim())}))},Declaration(n,{result:l}){if(t.has(n))return;if(n.variable&&!s.has(n.prop))return;if(i.test(n.prop)&&"atrule"===n.parent?.type&&o.test(n.parent.name))return;const{from:c}=l.opts;if(!c)return;if(!n.source?.input.from)return;if(!a.test(n.value))return;const p=normalizedDir(c),f=n.source.input.from.trim();if(!f)return;const d=normalizedDir(f),v=r.parseCommaSeparatedListOfComponentValues(e.tokenize({css:n.value})),m=r.replaceComponentValues(v,(t=>{if(r.isTokenNode(t)&&e.isTokenURL(t.value)){const e=rebase(t.value[4].value.trim(),d,p);if(e)return t.value[4].value=e,t.value[1]=`url(${serializeString(e)})`,t}if(r.isFunctionNode(t)&&u.test(t.getName()))for(const s of t.value)if(!r.isWhitespaceNode(s)&&!r.isCommentNode(s)&&r.isTokenNode(s)&&e.isTokenString(s.value)){const e=rebase(s.value[4].value.trim(),d,p);if(e)return s.value[4].value=e,s.value[1]=`"${serializeString(e)}"`,t;break}})),g=r.stringify(m);g!==n.value&&(n.value=g,t.add(n))}}}});creator.postcss=!0,module.exports=creator;
+"use strict";var e=require("@csstools/css-tokenizer"),r=require("@csstools/css-parser-algorithms"),t=require("node:path");const s=/^([-_a-z0-9]+:)?\/\//i;function rebase(e,r,i){if(e.startsWith("data:"))return!1;if(s.test(e))return!1;if(e.startsWith("/"))return e;if(e.startsWith("#"))return e;try{const r=new URL(e);if(r.port||r.protocol)return!1}catch{}const o=t.posix.resolve(t.posix.join(r,e));return t.posix.relative(i,o)}function serializeString(e){let r="";for(const t of e){const e=t.codePointAt(0);if(void 0!==e)switch(e){case 0:r+=String.fromCodePoint(65533);break;case 127:r+=`\\${e.toString(16)}`;break;case 34:case 39:case 92:r+=`\\${t}`;break;default:if(1<=e&&e<=31){r+=`\\${e.toString(16)} `;break}r+=t}else r+=String.fromCodePoint(65533)}return r}function normalizedDir(e){return t.parse(t.resolve(e.trim())).dir.split(t.sep).join(t.posix.sep)}const i=/^initial-value$/i,o=/^property$/i,n=/^syntax$/i,a=/url\(/i,u=/^url$/i,l=//i,creator=()=>({postcssPlugin:"postcss-rebase-url",prepare(){const t=new WeakSet,s=new Set;return{postcssPlugin:"postcss-rebase-url",Once(e){e.walkAtRules(o,(e=>{if(!e.nodes)return;const r=e.nodes.find((e=>{if("decl"===e.type&&n.test(e.prop))return!0}));r&&l.test(r.value)&&s.add(e.params.trim())}))},Declaration(n,{result:l}){if(t.has(n))return;if(n.variable&&!s.has(n.prop))return;if(i.test(n.prop)&&"atrule"===n.parent?.type&&o.test(n.parent.name))return;const{from:c}=l.opts;if(!c)return;if(!n.source?.input.from)return;if(!a.test(n.value))return;const p=normalizedDir(c),f=n.source.input.from.trim();if(!f)return;const d=normalizedDir(f),v=r.parseCommaSeparatedListOfComponentValues(e.tokenize({css:n.value})),m=r.replaceComponentValues(v,(t=>{if(r.isTokenNode(t)&&e.isTokenURL(t.value)){const e=rebase(t.value[4].value.trim(),d,p);if(e)return t.value[4].value=e,t.value[1]=`url(${serializeString(e)})`,t}if(r.isFunctionNode(t)&&u.test(t.getName()))for(const s of t.value)if(!r.isWhitespaceNode(s)&&!r.isCommentNode(s)&&r.isTokenNode(s)&&e.isTokenString(s.value)){const e=rebase(s.value[4].value.trim(),d,p);if(e)return s.value[4].value=e,s.value[1]=`"${serializeString(e)}"`,t;break}})),g=r.stringify(m);g!==n.value&&(n.value=g,t.add(n))}}}});creator.postcss=!0,module.exports=creator;
diff --git a/plugins/postcss-rebase-url/dist/index.mjs b/plugins/postcss-rebase-url/dist/index.mjs
index dc07df090..89db4af94 100644
--- a/plugins/postcss-rebase-url/dist/index.mjs
+++ b/plugins/postcss-rebase-url/dist/index.mjs
@@ -1 +1 @@
-import{tokenize as e,isTokenURL as r,isTokenString as t}from"@csstools/css-tokenizer";import{parseCommaSeparatedListOfComponentValues as s,replaceComponentValues as i,isTokenNode as o,isFunctionNode as a,isWhitespaceNode as n,isCommentNode as u,stringify as l}from"@csstools/css-parser-algorithms";import c from"path";const f=/^([-_a-z0-9]+:)?\/\//i;function rebase(e,r,t){if(e.startsWith("data:"))return!1;if(f.test(e))return!1;if(e.startsWith("/"))return e;if(e.startsWith("#"))return e;try{const r=new URL(e);if(r.port||r.protocol)return!1}catch{}const s=c.posix.resolve(c.posix.join(r,e));return c.posix.relative(t,s)}function serializeString(e){let r="";for(const t of e){const e=t.codePointAt(0);if(void 0!==e)switch(e){case 0:r+=String.fromCodePoint(65533);break;case 127:r+=`\\${e.toString(16)}`;break;case 34:case 39:case 92:r+=`\\${t}`;break;default:if(1<=e&&e<=31){r+=`\\${e.toString(16)} `;break}r+=t}else r+=String.fromCodePoint(65533)}return r}function normalizedDir(e){return c.parse(c.resolve(e.trim())).dir.split(c.sep).join(c.posix.sep)}const p=/^initial-value$/i,v=/^property$/i,m=/^syntax$/i,d=/url\(/i,b=/^url$/i,g=//i,creator=()=>({postcssPlugin:"postcss-rebase-url",prepare(){const c=new WeakSet,f=new Set;return{postcssPlugin:"postcss-rebase-url",Once(e){e.walkAtRules(v,(e=>{if(!e.nodes)return;const r=e.nodes.find((e=>{if("decl"===e.type&&m.test(e.prop))return!0}));r&&g.test(r.value)&&f.add(e.params.trim())}))},Declaration(m,{result:g}){if(c.has(m))return;if(m.variable&&!f.has(m.prop))return;if(p.test(m.prop)&&"atrule"===m.parent?.type&&v.test(m.parent.name))return;const{from:h}=g.opts;if(!h)return;if(!m.source?.input.from)return;if(!d.test(m.value))return;const S=normalizedDir(h),$=m.source.input.from.trim();if(!$)return;const k=normalizedDir($),z=s(e({css:m.value})),x=i(z,(e=>{if(o(e)&&r(e.value)){const r=rebase(e.value[4].value.trim(),k,S);if(r)return e.value[4].value=r,e.value[1]=`url(${serializeString(r)})`,e}if(a(e)&&b.test(e.getName()))for(const r of e.value)if(!n(r)&&!u(r)&&o(r)&&t(r.value)){const t=rebase(r.value[4].value.trim(),k,S);if(t)return r.value[4].value=t,r.value[1]=`"${serializeString(t)}"`,e;break}})),w=l(x);w!==m.value&&(m.value=w,c.add(m))}}}});creator.postcss=!0;export{creator as default};
+import{tokenize as e,isTokenURL as r,isTokenString as t}from"@csstools/css-tokenizer";import{parseCommaSeparatedListOfComponentValues as s,replaceComponentValues as i,isTokenNode as o,isFunctionNode as a,isWhitespaceNode as n,isCommentNode as u,stringify as l}from"@csstools/css-parser-algorithms";import c from"node:path";const f=/^([-_a-z0-9]+:)?\/\//i;function rebase(e,r,t){if(e.startsWith("data:"))return!1;if(f.test(e))return!1;if(e.startsWith("/"))return e;if(e.startsWith("#"))return e;try{const r=new URL(e);if(r.port||r.protocol)return!1}catch{}const s=c.posix.resolve(c.posix.join(r,e));return c.posix.relative(t,s)}function serializeString(e){let r="";for(const t of e){const e=t.codePointAt(0);if(void 0!==e)switch(e){case 0:r+=String.fromCodePoint(65533);break;case 127:r+=`\\${e.toString(16)}`;break;case 34:case 39:case 92:r+=`\\${t}`;break;default:if(1<=e&&e<=31){r+=`\\${e.toString(16)} `;break}r+=t}else r+=String.fromCodePoint(65533)}return r}function normalizedDir(e){return c.parse(c.resolve(e.trim())).dir.split(c.sep).join(c.posix.sep)}const p=/^initial-value$/i,v=/^property$/i,m=/^syntax$/i,d=/url\(/i,b=/^url$/i,g=//i,creator=()=>({postcssPlugin:"postcss-rebase-url",prepare(){const c=new WeakSet,f=new Set;return{postcssPlugin:"postcss-rebase-url",Once(e){e.walkAtRules(v,(e=>{if(!e.nodes)return;const r=e.nodes.find((e=>{if("decl"===e.type&&m.test(e.prop))return!0}));r&&g.test(r.value)&&f.add(e.params.trim())}))},Declaration(m,{result:g}){if(c.has(m))return;if(m.variable&&!f.has(m.prop))return;if(p.test(m.prop)&&"atrule"===m.parent?.type&&v.test(m.parent.name))return;const{from:h}=g.opts;if(!h)return;if(!m.source?.input.from)return;if(!d.test(m.value))return;const S=normalizedDir(h),$=m.source.input.from.trim();if(!$)return;const k=normalizedDir($),z=s(e({css:m.value})),x=i(z,(e=>{if(o(e)&&r(e.value)){const r=rebase(e.value[4].value.trim(),k,S);if(r)return e.value[4].value=r,e.value[1]=`url(${serializeString(r)})`,e}if(a(e)&&b.test(e.getName()))for(const r of e.value)if(!n(r)&&!u(r)&&o(r)&&t(r.value)){const t=rebase(r.value[4].value.trim(),k,S);if(t)return r.value[4].value=t,r.value[1]=`"${serializeString(t)}"`,e;break}})),w=l(x);w!==m.value&&(m.value=w,c.add(m))}}}});creator.postcss=!0;export{creator as default};
diff --git a/plugins/postcss-rebase-url/package.json b/plugins/postcss-rebase-url/package.json
index 4e10771c5..5ba181e65 100644
--- a/plugins/postcss-rebase-url/package.json
+++ b/plugins/postcss-rebase-url/package.json
@@ -25,7 +25,7 @@
}
],
"engines": {
- "node": "^14 || ^16 || >=18"
+ "node": ">=18"
},
"type": "module",
"main": "dist/index.cjs",
diff --git a/plugins/postcss-rebase-url/src/normalized-dir.ts b/plugins/postcss-rebase-url/src/normalized-dir.ts
index 746a58ae4..49e55e874 100644
--- a/plugins/postcss-rebase-url/src/normalized-dir.ts
+++ b/plugins/postcss-rebase-url/src/normalized-dir.ts
@@ -1,4 +1,4 @@
-import path from 'path';
+import path from 'node:path';
/**
* Returns a posix path for the directory of the given file path.
diff --git a/plugins/postcss-rebase-url/src/rebase.mjs b/plugins/postcss-rebase-url/src/rebase.mjs
index 80d98479b..bcd1e0991 100644
--- a/plugins/postcss-rebase-url/src/rebase.mjs
+++ b/plugins/postcss-rebase-url/src/rebase.mjs
@@ -1,4 +1,4 @@
-import path from 'path';
+import path from 'node:path';
const HAS_PROTOCOL_REGEX = /^([-_a-z0-9]+:)?\/\//i;
diff --git a/plugins/postcss-rebase-url/test/_import.mjs b/plugins/postcss-rebase-url/test/_import.mjs
index 4b0bced28..9d2ac1441 100644
--- a/plugins/postcss-rebase-url/test/_import.mjs
+++ b/plugins/postcss-rebase-url/test/_import.mjs
@@ -1,4 +1,4 @@
-import assert from 'assert';
+import assert from 'node:assert';
import plugin from '@csstools/postcss-rebase-url';
plugin();
diff --git a/plugins/postcss-rebase-url/test/unit/basic.mjs b/plugins/postcss-rebase-url/test/unit/basic.mjs
index 02ffe4596..1d5cb42b3 100644
--- a/plugins/postcss-rebase-url/test/unit/basic.mjs
+++ b/plugins/postcss-rebase-url/test/unit/basic.mjs
@@ -1,4 +1,4 @@
-import assert from 'assert';
+import assert from 'node:assert';
import { rebase } from '../../src/rebase.mjs';
{
diff --git a/plugins/postcss-rebase-url/test/unit/ignored.mjs b/plugins/postcss-rebase-url/test/unit/ignored.mjs
index 614fc9e9f..cd3ae7a71 100644
--- a/plugins/postcss-rebase-url/test/unit/ignored.mjs
+++ b/plugins/postcss-rebase-url/test/unit/ignored.mjs
@@ -1,4 +1,4 @@
-import assert from 'assert';
+import assert from 'node:assert';
import { rebase } from '../../src/rebase.mjs';
{
diff --git a/plugins/postcss-rebase-url/test/unit/unexpected-urls.mjs b/plugins/postcss-rebase-url/test/unit/unexpected-urls.mjs
index 348652310..8fb3cf9eb 100644
--- a/plugins/postcss-rebase-url/test/unit/unexpected-urls.mjs
+++ b/plugins/postcss-rebase-url/test/unit/unexpected-urls.mjs
@@ -1,4 +1,4 @@
-import assert from 'assert';
+import assert from 'node:assert';
import { rebase } from '../../src/rebase.mjs';
{
diff --git a/plugins/postcss-relative-color-syntax/CHANGELOG.md b/plugins/postcss-relative-color-syntax/CHANGELOG.md
index 410fcfc0a..eea069e09 100644
--- a/plugins/postcss-relative-color-syntax/CHANGELOG.md
+++ b/plugins/postcss-relative-color-syntax/CHANGELOG.md
@@ -1,7 +1,8 @@
# Changes to PostCSS Relative Color Syntax
-### Unreleased (patch)
+### Unreleased (major)
+- Updated: Support for Node v18+ (major).
- Updated [`@csstools/css-color-parser`](https://github.com/csstools/postcss-plugins/tree/main/packages/css-color-parser) to [`2.0.5`](https://github.com/csstools/postcss-plugins/tree/main/packages/css-color-parser/CHANGELOG.md#205) (patch)
### 2.0.19
diff --git a/plugins/postcss-relative-color-syntax/package.json b/plugins/postcss-relative-color-syntax/package.json
index 24a687e2e..5f1c04df5 100644
--- a/plugins/postcss-relative-color-syntax/package.json
+++ b/plugins/postcss-relative-color-syntax/package.json
@@ -25,7 +25,7 @@
}
],
"engines": {
- "node": "^14 || ^16 || >=18"
+ "node": ">=18"
},
"type": "module",
"main": "dist/index.cjs",
diff --git a/plugins/postcss-relative-color-syntax/test/_import.mjs b/plugins/postcss-relative-color-syntax/test/_import.mjs
index 482bda5c0..8d0a8e92d 100644
--- a/plugins/postcss-relative-color-syntax/test/_import.mjs
+++ b/plugins/postcss-relative-color-syntax/test/_import.mjs
@@ -1,4 +1,4 @@
-import assert from 'assert';
+import assert from 'node:assert';
import plugin from '@csstools/postcss-relative-color-syntax';
plugin();
diff --git a/plugins/postcss-rewrite-url/CHANGELOG.md b/plugins/postcss-rewrite-url/CHANGELOG.md
index fe65b2495..a5a56e837 100644
--- a/plugins/postcss-rewrite-url/CHANGELOG.md
+++ b/plugins/postcss-rewrite-url/CHANGELOG.md
@@ -1,5 +1,9 @@
# Changes to PostCSS Rewrite URL
+### Unreleased (major)
+
+- Updated: Support for Node v18+ (major).
+
### 1.1.4
_July 6, 2024_
diff --git a/plugins/postcss-rewrite-url/package.json b/plugins/postcss-rewrite-url/package.json
index d6a73b917..cec9c48b9 100644
--- a/plugins/postcss-rewrite-url/package.json
+++ b/plugins/postcss-rewrite-url/package.json
@@ -25,7 +25,7 @@
}
],
"engines": {
- "node": "^14 || ^16 || >=18"
+ "node": ">=18"
},
"type": "module",
"main": "dist/index.cjs",
diff --git a/plugins/postcss-scope-pseudo-class/CHANGELOG.md b/plugins/postcss-scope-pseudo-class/CHANGELOG.md
index 38c749613..1f469242f 100644
--- a/plugins/postcss-scope-pseudo-class/CHANGELOG.md
+++ b/plugins/postcss-scope-pseudo-class/CHANGELOG.md
@@ -1,5 +1,9 @@
# Changes to PostCSS Scope Pseudo Class
+### Unreleased (major)
+
+- Updated: Support for Node v18+ (major).
+
### 3.0.1
_December 15, 2023_
diff --git a/plugins/postcss-scope-pseudo-class/package.json b/plugins/postcss-scope-pseudo-class/package.json
index 6982468b8..dfc1fdf3c 100644
--- a/plugins/postcss-scope-pseudo-class/package.json
+++ b/plugins/postcss-scope-pseudo-class/package.json
@@ -25,7 +25,7 @@
}
],
"engines": {
- "node": "^14 || ^16 || >=18"
+ "node": ">=18"
},
"type": "module",
"main": "dist/index.cjs",
diff --git a/plugins/postcss-scope-pseudo-class/test/_import.mjs b/plugins/postcss-scope-pseudo-class/test/_import.mjs
index fe9d178eb..4d1ee3330 100644
--- a/plugins/postcss-scope-pseudo-class/test/_import.mjs
+++ b/plugins/postcss-scope-pseudo-class/test/_import.mjs
@@ -1,4 +1,4 @@
-import assert from 'assert';
+import assert from 'node:assert';
import plugin from '@csstools/postcss-scope-pseudo-class';
plugin();
diff --git a/plugins/postcss-selector-not/CHANGELOG.md b/plugins/postcss-selector-not/CHANGELOG.md
index 130d34232..048007533 100644
--- a/plugins/postcss-selector-not/CHANGELOG.md
+++ b/plugins/postcss-selector-not/CHANGELOG.md
@@ -1,5 +1,9 @@
# Changes to PostCSS Selector Not
+### Unreleased (major)
+
+- Updated: Support for Node v18+ (major).
+
### 7.0.2
_February 19, 2024_
diff --git a/plugins/postcss-selector-not/package.json b/plugins/postcss-selector-not/package.json
index 3c624c121..7b81baf28 100644
--- a/plugins/postcss-selector-not/package.json
+++ b/plugins/postcss-selector-not/package.json
@@ -28,7 +28,7 @@
}
],
"engines": {
- "node": "^14 || ^16 || >=18"
+ "node": ">=18"
},
"type": "module",
"main": "dist/index.cjs",
diff --git a/plugins/postcss-selector-not/test/_import.mjs b/plugins/postcss-selector-not/test/_import.mjs
index f0ff17e46..6fea5e7da 100644
--- a/plugins/postcss-selector-not/test/_import.mjs
+++ b/plugins/postcss-selector-not/test/_import.mjs
@@ -1,4 +1,4 @@
-import assert from 'assert';
+import assert from 'node:assert';
import plugin from 'postcss-selector-not';
plugin();
diff --git a/plugins/postcss-slow-plugins/CHANGELOG.md b/plugins/postcss-slow-plugins/CHANGELOG.md
index aed74c290..5150b067b 100644
--- a/plugins/postcss-slow-plugins/CHANGELOG.md
+++ b/plugins/postcss-slow-plugins/CHANGELOG.md
@@ -1,5 +1,9 @@
# Changes to PostCSS Slow Plugins
+### Unreleased (major)
+
+- Updated: Support for Node v18+ (major).
+
### 1.0.3
- Improve wording
diff --git a/plugins/postcss-slow-plugins/package.json b/plugins/postcss-slow-plugins/package.json
index 356db2ef9..839910e3e 100644
--- a/plugins/postcss-slow-plugins/package.json
+++ b/plugins/postcss-slow-plugins/package.json
@@ -25,7 +25,7 @@
}
],
"engines": {
- "node": "^14 || ^16 || >=18"
+ "node": ">=18"
},
"type": "module",
"main": "dist/index.cjs",
diff --git a/plugins/postcss-slow-plugins/test/_import.mjs b/plugins/postcss-slow-plugins/test/_import.mjs
index 4d850b340..4225ebef1 100644
--- a/plugins/postcss-slow-plugins/test/_import.mjs
+++ b/plugins/postcss-slow-plugins/test/_import.mjs
@@ -1,4 +1,4 @@
-import assert from 'assert';
+import assert from 'node:assert';
import plugin from '@csstools/postcss-slow-plugins';
plugin();
diff --git a/plugins/postcss-stepped-value-functions/CHANGELOG.md b/plugins/postcss-stepped-value-functions/CHANGELOG.md
index 694a9d06e..cb4abbc89 100644
--- a/plugins/postcss-stepped-value-functions/CHANGELOG.md
+++ b/plugins/postcss-stepped-value-functions/CHANGELOG.md
@@ -1,5 +1,9 @@
# Changes to PostCSS Stepped Value Functions
+### Unreleased (major)
+
+- Updated: Support for Node v18+ (major).
+
### 3.0.10
_July 6, 2024_
diff --git a/plugins/postcss-stepped-value-functions/package.json b/plugins/postcss-stepped-value-functions/package.json
index 728899132..a3c0e05e9 100644
--- a/plugins/postcss-stepped-value-functions/package.json
+++ b/plugins/postcss-stepped-value-functions/package.json
@@ -25,7 +25,7 @@
}
],
"engines": {
- "node": "^14 || ^16 || >=18"
+ "node": ">=18"
},
"type": "module",
"main": "dist/index.cjs",
diff --git a/plugins/postcss-stepped-value-functions/test/_import.mjs b/plugins/postcss-stepped-value-functions/test/_import.mjs
index f4e4e4046..8f6e52ee6 100644
--- a/plugins/postcss-stepped-value-functions/test/_import.mjs
+++ b/plugins/postcss-stepped-value-functions/test/_import.mjs
@@ -1,4 +1,4 @@
-import assert from 'assert';
+import assert from 'node:assert';
import plugin from '@csstools/postcss-stepped-value-functions';
plugin();
diff --git a/plugins/postcss-text-decoration-shorthand/CHANGELOG.md b/plugins/postcss-text-decoration-shorthand/CHANGELOG.md
index ae27c4a62..0d627a880 100644
--- a/plugins/postcss-text-decoration-shorthand/CHANGELOG.md
+++ b/plugins/postcss-text-decoration-shorthand/CHANGELOG.md
@@ -1,5 +1,9 @@
# Changes to PostCSS Text Decoration Shorthand
+### Unreleased (major)
+
+- Updated: Support for Node v18+ (major).
+
### 3.0.7
_June 29, 2024_
diff --git a/plugins/postcss-text-decoration-shorthand/package.json b/plugins/postcss-text-decoration-shorthand/package.json
index f1630fe3a..373a13688 100644
--- a/plugins/postcss-text-decoration-shorthand/package.json
+++ b/plugins/postcss-text-decoration-shorthand/package.json
@@ -25,7 +25,7 @@
}
],
"engines": {
- "node": "^14 || ^16 || >=18"
+ "node": ">=18"
},
"type": "module",
"main": "dist/index.cjs",
diff --git a/plugins/postcss-text-decoration-shorthand/test/_import.mjs b/plugins/postcss-text-decoration-shorthand/test/_import.mjs
index b7ad06777..eca3267c1 100644
--- a/plugins/postcss-text-decoration-shorthand/test/_import.mjs
+++ b/plugins/postcss-text-decoration-shorthand/test/_import.mjs
@@ -1,4 +1,4 @@
-import assert from 'assert';
+import assert from 'node:assert';
import plugin from '@csstools/postcss-text-decoration-shorthand';
plugin();
diff --git a/plugins/postcss-todo-or-die/CHANGELOG.md b/plugins/postcss-todo-or-die/CHANGELOG.md
index 33f2a7d7f..7ec32f0e9 100644
--- a/plugins/postcss-todo-or-die/CHANGELOG.md
+++ b/plugins/postcss-todo-or-die/CHANGELOG.md
@@ -1,5 +1,9 @@
# Changes to PostCSS Todo or Die
+### Unreleased (major)
+
+- Updated: Support for Node v18+ (major).
+
### 2.0.10
_July 6, 2024_
diff --git a/plugins/postcss-todo-or-die/package.json b/plugins/postcss-todo-or-die/package.json
index e7f5d5ede..1a2b71444 100644
--- a/plugins/postcss-todo-or-die/package.json
+++ b/plugins/postcss-todo-or-die/package.json
@@ -25,7 +25,7 @@
}
],
"engines": {
- "node": "^14 || ^16 || >=18"
+ "node": ">=18"
},
"type": "module",
"main": "dist/index.cjs",
diff --git a/plugins/postcss-todo-or-die/src/index.ts b/plugins/postcss-todo-or-die/src/index.ts
index f6f5164d2..70d64c3dd 100644
--- a/plugins/postcss-todo-or-die/src/index.ts
+++ b/plugins/postcss-todo-or-die/src/index.ts
@@ -1,6 +1,7 @@
import type { AtRule, PluginCreator } from 'postcss';
import browserslist from 'browserslist';
-import { ParseError, tokenize } from '@csstools/css-tokenizer';
+import type { ParseError} from '@csstools/css-tokenizer';
+import { tokenize } from '@csstools/css-tokenizer';
import { died } from './died';
import { isCommentNode, isFunctionNode, isWhitespaceNode, parseCommaSeparatedListOfComponentValues } from '@csstools/css-parser-algorithms';
import { matchBeforeDateCondition } from './match/before-date';
diff --git a/plugins/postcss-todo-or-die/src/match/if.ts b/plugins/postcss-todo-or-die/src/match/if.ts
index d3b5a57bf..f743b6a4a 100644
--- a/plugins/postcss-todo-or-die/src/match/if.ts
+++ b/plugins/postcss-todo-or-die/src/match/if.ts
@@ -1,4 +1,4 @@
-import { IfCondition } from '../parse/if';
+import type { IfCondition } from '../parse/if';
import { isTokenDimension } from '@csstools/css-tokenizer';
export function matchIfCondition(condition: IfCondition): string | true | undefined {
diff --git a/plugins/postcss-todo-or-die/src/match/not.ts b/plugins/postcss-todo-or-die/src/match/not.ts
index a4a6bc027..b15d15b15 100644
--- a/plugins/postcss-todo-or-die/src/match/not.ts
+++ b/plugins/postcss-todo-or-die/src/match/not.ts
@@ -1,4 +1,4 @@
-import { IfCondition } from '../parse/if';
+import type { IfCondition } from '../parse/if';
import { isTokenDimension } from '@csstools/css-tokenizer';
export function matchNotCondition(condition: IfCondition): string | true | undefined {
diff --git a/plugins/postcss-todo-or-die/src/parse/before-data.ts b/plugins/postcss-todo-or-die/src/parse/before-data.ts
index 42e8ab10b..b2899d52a 100644
--- a/plugins/postcss-todo-or-die/src/parse/before-data.ts
+++ b/plugins/postcss-todo-or-die/src/parse/before-data.ts
@@ -1,4 +1,5 @@
-import { FunctionNode, isCommentNode, isTokenNode, isWhitespaceNode } from '@csstools/css-parser-algorithms';
+import type { FunctionNode} from '@csstools/css-parser-algorithms';
+import { isCommentNode, isTokenNode, isWhitespaceNode } from '@csstools/css-parser-algorithms';
import { NumberType, isTokenNumber } from '@csstools/css-tokenizer';
type BeforeDateCondition = {
diff --git a/plugins/postcss-todo-or-die/src/parse/browserslist.ts b/plugins/postcss-todo-or-die/src/parse/browserslist.ts
index ab77973f5..abfd6fdf6 100644
--- a/plugins/postcss-todo-or-die/src/parse/browserslist.ts
+++ b/plugins/postcss-todo-or-die/src/parse/browserslist.ts
@@ -1,4 +1,5 @@
-import { FunctionNode, isCommentNode, isTokenNode, isWhitespaceNode } from '@csstools/css-parser-algorithms';
+import type { FunctionNode} from '@csstools/css-parser-algorithms';
+import { isCommentNode, isTokenNode, isWhitespaceNode } from '@csstools/css-parser-algorithms';
import { isTokenString } from '@csstools/css-tokenizer';
export function parseBrowserslistCondition(componentValue: FunctionNode) : string|false {
diff --git a/plugins/postcss-todo-or-die/src/parse/if.ts b/plugins/postcss-todo-or-die/src/parse/if.ts
index f67473296..0f39eb02f 100644
--- a/plugins/postcss-todo-or-die/src/parse/if.ts
+++ b/plugins/postcss-todo-or-die/src/parse/if.ts
@@ -1,5 +1,7 @@
-import { FunctionNode, isCommentNode, isTokenNode, isWhitespaceNode } from '@csstools/css-parser-algorithms';
-import { TokenDimension, TokenIdent, TokenNumber, TokenPercentage, TokenType, isTokenDelim } from '@csstools/css-tokenizer';
+import type { FunctionNode} from '@csstools/css-parser-algorithms';
+import { isCommentNode, isTokenNode, isWhitespaceNode } from '@csstools/css-parser-algorithms';
+import type { TokenDimension, TokenIdent, TokenNumber, TokenPercentage} from '@csstools/css-tokenizer';
+import { TokenType, isTokenDelim } from '@csstools/css-tokenizer';
const supportedTokenTypes = [TokenType.Ident, TokenType.Number, TokenType.Percentage, TokenType.Dimension];
const allowedOperators = ['<', '>', '='];
diff --git a/plugins/postcss-todo-or-die/src/parse/not.ts b/plugins/postcss-todo-or-die/src/parse/not.ts
index 153571cea..55d580ae7 100644
--- a/plugins/postcss-todo-or-die/src/parse/not.ts
+++ b/plugins/postcss-todo-or-die/src/parse/not.ts
@@ -1,5 +1,5 @@
-import { FunctionNode } from '@csstools/css-parser-algorithms';
-import { TokenDimension, TokenIdent, TokenNumber, TokenPercentage } from '@csstools/css-tokenizer';
+import type { FunctionNode } from '@csstools/css-parser-algorithms';
+import type { TokenDimension, TokenIdent, TokenNumber, TokenPercentage } from '@csstools/css-tokenizer';
import { parseIfCondition } from './if';
type SubjectToken = TokenIdent | TokenNumber | TokenPercentage | TokenDimension;
diff --git a/plugins/postcss-todo-or-die/test/_import.mjs b/plugins/postcss-todo-or-die/test/_import.mjs
index 39d13e9a8..748407dc4 100644
--- a/plugins/postcss-todo-or-die/test/_import.mjs
+++ b/plugins/postcss-todo-or-die/test/_import.mjs
@@ -1,4 +1,4 @@
-import assert from 'assert';
+import assert from 'node:assert';
import plugin from '@csstools/postcss-todo-or-die';
plugin();
diff --git a/plugins/postcss-trigonometric-functions/CHANGELOG.md b/plugins/postcss-trigonometric-functions/CHANGELOG.md
index 244ce59f8..551e2f684 100644
--- a/plugins/postcss-trigonometric-functions/CHANGELOG.md
+++ b/plugins/postcss-trigonometric-functions/CHANGELOG.md
@@ -1,5 +1,9 @@
# Changes to PostCSS Trigonometric Functions
+### Unreleased (major)
+
+- Updated: Support for Node v18+ (major).
+
### 3.0.10
_July 6, 2024_
diff --git a/plugins/postcss-trigonometric-functions/package.json b/plugins/postcss-trigonometric-functions/package.json
index e5d0f3ae9..e9b24c8c4 100644
--- a/plugins/postcss-trigonometric-functions/package.json
+++ b/plugins/postcss-trigonometric-functions/package.json
@@ -25,7 +25,7 @@
}
],
"engines": {
- "node": "^14 || ^16 || >=18"
+ "node": ">=18"
},
"type": "module",
"main": "dist/index.cjs",
diff --git a/plugins/postcss-trigonometric-functions/test/_import.mjs b/plugins/postcss-trigonometric-functions/test/_import.mjs
index a4098fe21..57d8daaf9 100644
--- a/plugins/postcss-trigonometric-functions/test/_import.mjs
+++ b/plugins/postcss-trigonometric-functions/test/_import.mjs
@@ -1,4 +1,4 @@
-import assert from 'assert';
+import assert from 'node:assert';
import plugin from '@csstools/postcss-trigonometric-functions';
plugin();
diff --git a/plugins/postcss-unset-value/CHANGELOG.md b/plugins/postcss-unset-value/CHANGELOG.md
index 8f6d315b0..5816d46cd 100644
--- a/plugins/postcss-unset-value/CHANGELOG.md
+++ b/plugins/postcss-unset-value/CHANGELOG.md
@@ -1,5 +1,9 @@
# Changes to PostCSS Unset Value
+### Unreleased (major)
+
+- Updated: Support for Node v18+ (major).
+
### 3.0.1
_December 15, 2023_
diff --git a/plugins/postcss-unset-value/package.json b/plugins/postcss-unset-value/package.json
index 7cfee9f13..6c8874f5a 100644
--- a/plugins/postcss-unset-value/package.json
+++ b/plugins/postcss-unset-value/package.json
@@ -25,7 +25,7 @@
}
],
"engines": {
- "node": "^14 || ^16 || >=18"
+ "node": ">=18"
},
"type": "module",
"main": "dist/index.cjs",
diff --git a/plugins/postcss-unset-value/test/_import.mjs b/plugins/postcss-unset-value/test/_import.mjs
index b767d85af..de541a110 100644
--- a/plugins/postcss-unset-value/test/_import.mjs
+++ b/plugins/postcss-unset-value/test/_import.mjs
@@ -1,4 +1,4 @@
-import assert from 'assert';
+import assert from 'node:assert';
import plugin from '@csstools/postcss-unset-value';
plugin();
diff --git a/rollup/configs/externals.mjs b/rollup/configs/externals.mjs
index d3b66e9e1..0e3062c5a 100644
--- a/rollup/configs/externals.mjs
+++ b/rollup/configs/externals.mjs
@@ -1,19 +1,10 @@
export const externalsForCLI = [
- 'assert',
- 'assert/strict',
- 'fs',
- 'fs/promises',
- 'https',
- 'module',
- 'path',
- 'process',
- 'test',
- 'url',
'node:assert',
'node:assert/strict',
'node:child_process',
'node:fs',
'node:fs/promises',
+ 'node:http',
'node:https',
'node:module',
'node:os',
@@ -110,21 +101,12 @@ export const externalsForCLI = [
];
export const externalsForPlugin = [
- 'assert',
- 'assert/strict',
- 'fs',
- 'fs/promises',
- 'https',
- 'module',
- 'path',
- 'process',
- 'test',
- 'url',
'node:assert',
'node:assert/strict',
'node:child_process',
'node:fs',
'node:fs/promises',
+ 'node:http',
'node:https',
'node:module',
'node:os',
diff --git a/rollup/default.mjs b/rollup/default.mjs
index 261e25196..5eab1e147 100644
--- a/rollup/default.mjs
+++ b/rollup/default.mjs
@@ -1,4 +1,4 @@
-import fs from 'fs';
+import fs from 'node:fs';
import { browserJavascript } from './presets/browser-javascript.mjs';
import { cliTypescript } from './presets/cli-typescript.mjs';
import { packageJavascript } from './presets/package-javascript.mjs';
diff --git a/rollup/presets/browser-javascript.mjs b/rollup/presets/browser-javascript.mjs
index dabeea0b5..050b15501 100644
--- a/rollup/presets/browser-javascript.mjs
+++ b/rollup/presets/browser-javascript.mjs
@@ -1,6 +1,6 @@
import babel from '@rollup/plugin-babel';
import commonjs from '@rollup/plugin-commonjs';
-import path from 'path';
+import path from 'node:path';
import terser from '@rollup/plugin-terser';
import { externalsForBrowser } from '../configs/externals.mjs';
import { nodeResolve } from '@rollup/plugin-node-resolve';
diff --git a/rollup/presets/cli-typescript.mjs b/rollup/presets/cli-typescript.mjs
index 2ec9c245d..ab9b57985 100644
--- a/rollup/presets/cli-typescript.mjs
+++ b/rollup/presets/cli-typescript.mjs
@@ -1,5 +1,5 @@
import commonjs from '@rollup/plugin-commonjs';
-import path from 'path';
+import path from 'node:path';
import terser from '@rollup/plugin-terser';
import typescript from '@rollup/plugin-typescript';
import { addHashBang } from '../transforms/cli-hash-bang.mjs';
diff --git a/rollup/transforms/api-extractor.mjs b/rollup/transforms/api-extractor.mjs
index a480a414f..e3ab3b346 100644
--- a/rollup/transforms/api-extractor.mjs
+++ b/rollup/transforms/api-extractor.mjs
@@ -1,5 +1,5 @@
-import fs from 'fs/promises';
-import path from 'path';
+import fs from 'node:fs/promises';
+import path from 'node:path';
import { Extractor, ExtractorConfig } from '@microsoft/api-extractor';
export function apiExtractor() {
diff --git a/sites/postcss-preset-env/src/static/js/playground.js b/sites/postcss-preset-env/src/static/js/playground.js
index 699409b0f..e97fef488 100644
--- a/sites/postcss-preset-env/src/static/js/playground.js
+++ b/sites/postcss-preset-env/src/static/js/playground.js
@@ -41,11 +41,6 @@ const currentConfig = stateAtLoad.config ?? {
inlineDirection: 'left-to-right',
blockDirection: 'top-to-bottom',
},
- features: {
- 'nesting-rules': ['auto', {
- edition: '2024-02',
- }],
- },
};
function processCss(source, config, isDefaultState = false) {