diff --git a/node_modules/@babel/types/lib/validators/isVar.js b/node_modules/@babel/types/lib/validators/isVar.js new file mode 100644 index 0000000000000000000000000000000000000000..3018b41a4d07a5be3d80e43872ababbdf95d3f60 --- /dev/null +++ b/node_modules/@babel/types/lib/validators/isVar.js @@ -0,0 +1,15 @@ +"use strict"; + +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.default = isVar; +var _index = require("./generated/index.js"); +var BLOCK_SCOPED_SYMBOL = Symbol.for("var used to be block scoped"); +function isVar(node) { + return (0, _index.isVariableDeclaration)(node, { + kind: "var" + }) && !node[BLOCK_SCOPED_SYMBOL]; +} + +//# sourceMappingURL=isVar.js.map diff --git a/node_modules/@babel/types/lib/validators/isVar.js.map b/node_modules/@babel/types/lib/validators/isVar.js.map new file mode 100644 index 0000000000000000000000000000000000000000..81b3cd7d3be7e2b17de93833079c5e906f325e9d --- /dev/null +++ b/node_modules/@babel/types/lib/validators/isVar.js.map @@ -0,0 +1 @@ +{"version":3,"names":["_index","require","BLOCK_SCOPED_SYMBOL","Symbol","for","isVar","node","isVariableDeclaration","kind"],"sources":["../../src/validators/isVar.ts"],"sourcesContent":["import { isVariableDeclaration } from \"./generated/index.ts\";\nimport type * as t from \"../index.ts\";\n\nif (!process.env.BABEL_8_BREAKING) {\n // eslint-disable-next-line no-var\n var BLOCK_SCOPED_SYMBOL = Symbol.for(\"var used to be block scoped\");\n}\n\n/**\n * Check if the input `node` is a variable declaration.\n */\nexport default function isVar(node: t.Node | null | undefined): boolean {\n if (process.env.BABEL_8_BREAKING) {\n return isVariableDeclaration(node) && node.kind === \"var\";\n } else {\n return (\n isVariableDeclaration(node, { kind: \"var\" }) &&\n !(\n // @ts-expect-error document private properties\n node[BLOCK_SCOPED_SYMBOL]\n )\n );\n }\n}\n"],"mappings":";;;;;;AAAA,IAAAA,MAAA,GAAAC,OAAA;AAKE,IAAIC,mBAAmB,GAAGC,MAAM,CAACC,GAAG,CAAC,6BAA6B,CAAC;AAMtD,SAASC,KAAKA,CAACC,IAA+B,EAAW;EAIpE,OACE,IAAAC,4BAAqB,EAACD,IAAI,EAAE;IAAEE,IAAI,EAAE;EAAM,CAAC,CAAC,IAC5C,CAEEF,IAAI,CAACJ,mBAAmB,CACzB;AAGP","ignoreList":[]} \ No newline at end of file diff --git a/node_modules/@babel/types/lib/validators/matchesPattern.js b/node_modules/@babel/types/lib/validators/matchesPattern.js new file mode 100644 index 0000000000000000000000000000000000000000..37f0484c69d9d3e7a6058ea67b48efb19e804a83 --- /dev/null +++ b/node_modules/@babel/types/lib/validators/matchesPattern.js @@ -0,0 +1,44 @@ +"use strict"; + +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.default = matchesPattern; +var _index = require("./generated/index.js"); +function isMemberExpressionLike(node) { + return (0, _index.isMemberExpression)(node) || (0, _index.isMetaProperty)(node); +} +function matchesPattern(member, match, allowPartial) { + if (!isMemberExpressionLike(member)) return false; + const parts = Array.isArray(match) ? match : match.split("."); + const nodes = []; + let node; + for (node = member; isMemberExpressionLike(node); node = (_object = node.object) != null ? _object : node.meta) { + var _object; + nodes.push(node.property); + } + nodes.push(node); + if (nodes.length < parts.length) return false; + if (!allowPartial && nodes.length > parts.length) return false; + for (let i = 0, j = nodes.length - 1; i < parts.length; i++, j--) { + const node = nodes[j]; + let value; + if ((0, _index.isIdentifier)(node)) { + value = node.name; + } else if ((0, _index.isStringLiteral)(node)) { + value = node.value; + } else if ((0, _index.isThisExpression)(node)) { + value = "this"; + } else if ((0, _index.isSuper)(node)) { + value = "super"; + } else if ((0, _index.isPrivateName)(node)) { + value = "#" + node.id.name; + } else { + return false; + } + if (parts[i] !== value) return false; + } + return true; +} + +//# sourceMappingURL=matchesPattern.js.map diff --git a/node_modules/@babel/types/lib/validators/matchesPattern.js.map b/node_modules/@babel/types/lib/validators/matchesPattern.js.map new file mode 100644 index 0000000000000000000000000000000000000000..7a9b379daf5c72b16d3b43086f80be515437b3d7 --- /dev/null +++ b/node_modules/@babel/types/lib/validators/matchesPattern.js.map @@ -0,0 +1 @@ +{"version":3,"names":["_index","require","isMemberExpressionLike","node","isMemberExpression","isMetaProperty","matchesPattern","member","match","allowPartial","parts","Array","isArray","split","nodes","_object","object","meta","push","property","length","i","j","value","isIdentifier","name","isStringLiteral","isThisExpression","isSuper","isPrivateName","id"],"sources":["../../src/validators/matchesPattern.ts"],"sourcesContent":["import {\n isIdentifier,\n isMetaProperty,\n isMemberExpression,\n isPrivateName,\n isStringLiteral,\n isSuper,\n isThisExpression,\n} from \"./generated/index.ts\";\nimport type * as t from \"../index.ts\";\n\nfunction isMemberExpressionLike(\n node: t.Node,\n): node is t.MemberExpression | t.MetaProperty {\n return isMemberExpression(node) || isMetaProperty(node);\n}\n\n/**\n * Determines whether or not the input node `member` matches the\n * input `match`.\n *\n * For example, given the match `React.createClass` it would match the\n * parsed nodes of `React.createClass` and `React[\"createClass\"]`.\n */\nexport default function matchesPattern(\n member: t.Node | null | undefined,\n match: string | string[],\n allowPartial?: boolean,\n): boolean {\n // not a member expression\n if (!isMemberExpressionLike(member)) return false;\n\n const parts = Array.isArray(match) ? match : match.split(\".\");\n const nodes = [];\n\n let node;\n for (\n node = member;\n isMemberExpressionLike(node);\n node = (node as t.MemberExpression).object ?? (node as t.MetaProperty).meta\n ) {\n nodes.push(node.property);\n }\n nodes.push(node);\n\n if (nodes.length < parts.length) return false;\n if (!allowPartial && nodes.length > parts.length) return false;\n\n for (let i = 0, j = nodes.length - 1; i < parts.length; i++, j--) {\n const node = nodes[j];\n let value;\n if (isIdentifier(node)) {\n value = node.name;\n } else if (isStringLiteral(node)) {\n value = node.value;\n } else if (isThisExpression(node)) {\n value = \"this\";\n } else if (isSuper(node)) {\n value = \"super\";\n } else if (isPrivateName(node)) {\n value = \"#\" + node.id.name;\n } else {\n return false;\n }\n\n if (parts[i] !== value) return false;\n }\n\n return true;\n}\n"],"mappings":";;;;;;AAAA,IAAAA,MAAA,GAAAC,OAAA;AAWA,SAASC,sBAAsBA,CAC7BC,IAAY,EACiC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,EAACvB,IAAI,CAAC,EAAE;MAChCoB,KAAK,GAAGpB,IAAI,CAACoB,KAAK;IACpB,CAAC,MAAM,IAAI,IAAAI,uBAAgB,EAACxB,IAAI,CAAC,EAAE;MACjCoB,KAAK,GAAG,MAAM;IAChB,CAAC,MAAM,IAAI,IAAAK,cAAO,EAACzB,IAAI,CAAC,EAAE;MACxBoB,KAAK,GAAG,OAAO;IACjB,CAAC,MAAM,IAAI,IAAAM,oBAAa,EAAC1B,IAAI,CAAC,EAAE;MAC9BoB,KAAK,GAAG,GAAG,GAAGpB,IAAI,CAAC2B,EAAE,CAACL,IAAI;IAC5B,CAAC,MAAM;MACL,OAAO,KAAK;IACd;IAEA,IAAIf,KAAK,CAACW,CAAC,CAAC,KAAKE,KAAK,EAAE,OAAO,KAAK;EACtC;EAEA,OAAO,IAAI;AACb","ignoreList":[]} \ No newline at end of file diff --git a/node_modules/@babel/types/lib/validators/react/isCompatTag.js b/node_modules/@babel/types/lib/validators/react/isCompatTag.js new file mode 100644 index 0000000000000000000000000000000000000000..868b8441a10972418b8a94f5cdb688b315320605 --- /dev/null +++ b/node_modules/@babel/types/lib/validators/react/isCompatTag.js @@ -0,0 +1,11 @@ +"use strict"; + +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.default = isCompatTag; +function isCompatTag(tagName) { + return !!tagName && /^[a-z]/.test(tagName); +} + +//# sourceMappingURL=isCompatTag.js.map diff --git a/node_modules/@babel/types/lib/validators/react/isCompatTag.js.map b/node_modules/@babel/types/lib/validators/react/isCompatTag.js.map new file mode 100644 index 0000000000000000000000000000000000000000..570f2863dcb0fd26678d6c05dae54fafbbe52cbc --- /dev/null +++ b/node_modules/@babel/types/lib/validators/react/isCompatTag.js.map @@ -0,0 +1 @@ +{"version":3,"names":["isCompatTag","tagName","test"],"sources":["../../../src/validators/react/isCompatTag.ts"],"sourcesContent":["export default function isCompatTag(tagName?: string): boolean {\n // Must start with a lowercase ASCII letter\n return !!tagName && /^[a-z]/.test(tagName);\n}\n"],"mappings":";;;;;;AAAe,SAASA,WAAWA,CAACC,OAAgB,EAAW;EAE7D,OAAO,CAAC,CAACA,OAAO,IAAI,QAAQ,CAACC,IAAI,CAACD,OAAO,CAAC;AAC5C","ignoreList":[]} \ No newline at end of file diff --git a/node_modules/@babel/types/lib/validators/react/isReactComponent.js b/node_modules/@babel/types/lib/validators/react/isReactComponent.js new file mode 100644 index 0000000000000000000000000000000000000000..34b3467250c1e51a33faf954db5ed835a42d2ac1 --- /dev/null +++ b/node_modules/@babel/types/lib/validators/react/isReactComponent.js @@ -0,0 +1,11 @@ +"use strict"; + +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.default = void 0; +var _buildMatchMemberExpression = require("../buildMatchMemberExpression.js"); +const isReactComponent = (0, _buildMatchMemberExpression.default)("React.Component"); +var _default = exports.default = isReactComponent; + +//# sourceMappingURL=isReactComponent.js.map diff --git a/node_modules/@babel/types/lib/validators/react/isReactComponent.js.map b/node_modules/@babel/types/lib/validators/react/isReactComponent.js.map new file mode 100644 index 0000000000000000000000000000000000000000..16fb3e36d4a1715a3841b0b3bf45ff1af2d1065b --- /dev/null +++ b/node_modules/@babel/types/lib/validators/react/isReactComponent.js.map @@ -0,0 +1 @@ +{"version":3,"names":["_buildMatchMemberExpression","require","isReactComponent","buildMatchMemberExpression","_default","exports","default"],"sources":["../../../src/validators/react/isReactComponent.ts"],"sourcesContent":["import buildMatchMemberExpression from \"../buildMatchMemberExpression.ts\";\n\nconst isReactComponent = buildMatchMemberExpression(\"React.Component\");\n\nexport default isReactComponent;\n"],"mappings":";;;;;;AAAA,IAAAA,2BAAA,GAAAC,OAAA;AAEA,MAAMC,gBAAgB,GAAG,IAAAC,mCAA0B,EAAC,iBAAiB,CAAC;AAAC,IAAAC,QAAA,GAAAC,OAAA,CAAAC,OAAA,GAExDJ,gBAAgB","ignoreList":[]} \ No newline at end of file diff --git a/node_modules/@babel/types/lib/validators/validate.js b/node_modules/@babel/types/lib/validators/validate.js new file mode 100644 index 0000000000000000000000000000000000000000..146f5ccb94cb131316f387857fd35e5c0ea5eacd --- /dev/null +++ b/node_modules/@babel/types/lib/validators/validate.js @@ -0,0 +1,42 @@ +"use strict"; + +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.default = validate; +exports.validateChild = validateChild; +exports.validateField = validateField; +exports.validateInternal = validateInternal; +var _index = require("../definitions/index.js"); +function validate(node, key, val) { + if (!node) return; + const fields = _index.NODE_FIELDS[node.type]; + if (!fields) return; + const field = fields[key]; + validateField(node, key, val, field); + validateChild(node, key, val); +} +function validateInternal(field, node, key, val, maybeNode) { + if (!(field != null && field.validate)) return; + if (field.optional && val == null) return; + field.validate(node, key, val); + if (maybeNode) { + var _NODE_PARENT_VALIDATI; + const type = val.type; + if (type == null) return; + (_NODE_PARENT_VALIDATI = _index.NODE_PARENT_VALIDATIONS[type]) == null || _NODE_PARENT_VALIDATI.call(_index.NODE_PARENT_VALIDATIONS, node, key, val); + } +} +function validateField(node, key, val, field) { + if (!(field != null && field.validate)) return; + if (field.optional && val == null) return; + field.validate(node, key, val); +} +function validateChild(node, key, val) { + var _NODE_PARENT_VALIDATI2; + const type = val == null ? void 0 : val.type; + if (type == null) return; + (_NODE_PARENT_VALIDATI2 = _index.NODE_PARENT_VALIDATIONS[type]) == null || _NODE_PARENT_VALIDATI2.call(_index.NODE_PARENT_VALIDATIONS, node, key, val); +} + +//# sourceMappingURL=validate.js.map diff --git a/node_modules/@babel/types/lib/validators/validate.js.map b/node_modules/@babel/types/lib/validators/validate.js.map new file mode 100644 index 0000000000000000000000000000000000000000..8cb8aa79bb1be12d89ddf508d6fdd3a4f57dc7bd --- /dev/null +++ b/node_modules/@babel/types/lib/validators/validate.js.map @@ -0,0 +1 @@ +{"version":3,"names":["_index","require","validate","node","key","val","fields","NODE_FIELDS","type","field","validateField","validateChild","validateInternal","maybeNode","optional","_NODE_PARENT_VALIDATI","NODE_PARENT_VALIDATIONS","call","_NODE_PARENT_VALIDATI2"],"sources":["../../src/validators/validate.ts"],"sourcesContent":["import {\n NODE_FIELDS,\n NODE_PARENT_VALIDATIONS,\n type FieldOptions,\n} from \"../definitions/index.ts\";\nimport type * as t from \"../index.ts\";\n\nexport default function validate(\n node: t.Node | undefined | null,\n key: string,\n val: unknown,\n): void {\n if (!node) return;\n\n const fields = NODE_FIELDS[node.type];\n if (!fields) return;\n\n const field = fields[key];\n validateField(node, key, val, field);\n validateChild(node, key, val);\n}\n\nexport function validateInternal(\n field: FieldOptions,\n node: t.Node | undefined | null,\n key: string,\n val: unknown,\n maybeNode?: 1,\n): void {\n if (!field?.validate) return;\n if (field.optional && val == null) return;\n\n field.validate(node, key, val);\n\n if (maybeNode) {\n const type = (val as t.Node).type;\n if (type == null) return;\n NODE_PARENT_VALIDATIONS[type]?.(node, key, val);\n }\n}\n\nexport function validateField(\n node: t.Node | undefined | null,\n key: string,\n val: unknown,\n field: FieldOptions | undefined | null,\n): void {\n if (!field?.validate) return;\n if (field.optional && val == null) return;\n\n field.validate(node, key, val);\n}\n\nexport function validateChild(\n node: t.Node | undefined | null,\n key: string | { toString(): string },\n val?: unknown,\n) {\n const type = (val as t.Node)?.type;\n if (type == null) return;\n NODE_PARENT_VALIDATIONS[type]?.(node, key, val);\n}\n"],"mappings":";;;;;;;;;AAAA,IAAAA,MAAA,GAAAC,OAAA;AAOe,SAASC,QAAQA,CAC9BC,IAA+B,EAC/BC,GAAW,EACXC,GAAY,EACN;EACN,IAAI,CAACF,IAAI,EAAE;EAEX,MAAMG,MAAM,GAAGC,kBAAW,CAACJ,IAAI,CAACK,IAAI,CAAC;EACrC,IAAI,CAACF,MAAM,EAAE;EAEb,MAAMG,KAAK,GAAGH,MAAM,CAACF,GAAG,CAAC;EACzBM,aAAa,CAACP,IAAI,EAAEC,GAAG,EAAEC,GAAG,EAAEI,KAAK,CAAC;EACpCE,aAAa,CAACR,IAAI,EAAEC,GAAG,EAAEC,GAAG,CAAC;AAC/B;AAEO,SAASO,gBAAgBA,CAC9BH,KAAmB,EACnBN,IAA+B,EAC/BC,GAAW,EACXC,GAAY,EACZQ,SAAa,EACP;EACN,IAAI,EAACJ,KAAK,YAALA,KAAK,CAAEP,QAAQ,GAAE;EACtB,IAAIO,KAAK,CAACK,QAAQ,IAAIT,GAAG,IAAI,IAAI,EAAE;EAEnCI,KAAK,CAACP,QAAQ,CAACC,IAAI,EAAEC,GAAG,EAAEC,GAAG,CAAC;EAE9B,IAAIQ,SAAS,EAAE;IAAA,IAAAE,qBAAA;IACb,MAAMP,IAAI,GAAIH,GAAG,CAAYG,IAAI;IACjC,IAAIA,IAAI,IAAI,IAAI,EAAE;IAClB,CAAAO,qBAAA,GAAAC,8BAAuB,CAACR,IAAI,CAAC,aAA7BO,qBAAA,CAAAE,IAAA,CAAAD,8BAAuB,EAASb,IAAI,EAAEC,GAAG,EAAEC,GAAG,CAAC;EACjD;AACF;AAEO,SAASK,aAAaA,CAC3BP,IAA+B,EAC/BC,GAAW,EACXC,GAAY,EACZI,KAAsC,EAChC;EACN,IAAI,EAACA,KAAK,YAALA,KAAK,CAAEP,QAAQ,GAAE;EACtB,IAAIO,KAAK,CAACK,QAAQ,IAAIT,GAAG,IAAI,IAAI,EAAE;EAEnCI,KAAK,CAACP,QAAQ,CAACC,IAAI,EAAEC,GAAG,EAAEC,GAAG,CAAC;AAChC;AAEO,SAASM,aAAaA,CAC3BR,IAA+B,EAC/BC,GAAoC,EACpCC,GAAa,EACb;EAAA,IAAAa,sBAAA;EACA,MAAMV,IAAI,GAAIH,GAAG,oBAAHA,GAAG,CAAaG,IAAI;EAClC,IAAIA,IAAI,IAAI,IAAI,EAAE;EAClB,CAAAU,sBAAA,GAAAF,8BAAuB,CAACR,IAAI,CAAC,aAA7BU,sBAAA,CAAAD,IAAA,CAAAD,8BAAuB,EAASb,IAAI,EAAEC,GAAG,EAAEC,GAAG,CAAC;AACjD","ignoreList":[]} \ No newline at end of file diff --git a/node_modules/@babel/types/package.json b/node_modules/@babel/types/package.json new file mode 100644 index 0000000000000000000000000000000000000000..a366c46b87b0f4e098bce5752e34bc62f0c899e9 --- /dev/null +++ b/node_modules/@babel/types/package.json @@ -0,0 +1,39 @@ +{ + "name": "@babel/types", + "version": "7.29.7", + "description": "Babel Types is a Lodash-esque utility library for AST nodes", + "author": "The Babel Team (https://babel.dev/team)", + "homepage": "https://babel.dev/docs/en/next/babel-types", + "bugs": "https://github.com/babel/babel/issues?utf8=%E2%9C%93&q=is%3Aissue+label%3A%22pkg%3A%20types%22+is%3Aopen", + "license": "MIT", + "publishConfig": { + "access": "public" + }, + "repository": { + "type": "git", + "url": "https://github.com/babel/babel.git", + "directory": "packages/babel-types" + }, + "main": "./lib/index.js", + "dependencies": { + "@babel/helper-string-parser": "^7.29.7", + "@babel/helper-validator-identifier": "^7.29.7" + }, + "devDependencies": { + "@babel/generator": "^7.29.7", + "@babel/helper-fixtures": "^7.29.7", + "@babel/parser": "^7.29.7" + }, + "engines": { + "node": ">=6.9.0" + }, + "type": "commonjs", + "types": "./lib/index-legacy.d.ts", + "typesVersions": { + ">=4.1": { + "lib/index-legacy.d.ts": [ + "lib/index.d.ts" + ] + } + } +} \ No newline at end of file diff --git a/node_modules/@bcoe/v8-coverage/LICENSE.md b/node_modules/@bcoe/v8-coverage/LICENSE.md new file mode 100644 index 0000000000000000000000000000000000000000..d588b5c321e618e63a2991e42544ba151b107b1e --- /dev/null +++ b/node_modules/@bcoe/v8-coverage/LICENSE.md @@ -0,0 +1,21 @@ +The MIT License (MIT) + +Copyright © 2015-2017 Charles Samborski + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +SOFTWARE. diff --git a/node_modules/@bcoe/v8-coverage/LICENSE.txt b/node_modules/@bcoe/v8-coverage/LICENSE.txt new file mode 100644 index 0000000000000000000000000000000000000000..629264e941d45f2bd92fdbf82d7dd11faa2d77f4 --- /dev/null +++ b/node_modules/@bcoe/v8-coverage/LICENSE.txt @@ -0,0 +1,14 @@ +Copyright (c) 2017, Contributors + +Permission to use, copy, modify, and/or distribute this software +for any purpose with or without fee is hereby granted, provided +that the above copyright notice and this permission notice +appear in all copies. + +THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES +WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES +OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE +LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES +OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, +WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, +ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. diff --git a/node_modules/@bcoe/v8-coverage/README.md b/node_modules/@bcoe/v8-coverage/README.md new file mode 100644 index 0000000000000000000000000000000000000000..eea761b9dfe8640ece6558db3295a82ca8302405 --- /dev/null +++ b/node_modules/@bcoe/v8-coverage/README.md @@ -0,0 +1,11 @@ +# V8 Coverage + +[![npm](https://img.shields.io/npm/v/@c88/v8-coverage.svg?maxAge=2592000)](https://www.npmjs.com/package/@c88/v8-coverage) +[![GitHub repository](https://img.shields.io/badge/Github-demurgos%2Fv8--coverage-blue.svg)](https://github.com/demurgos/v8-coverage) +[![Build status (Travis)](https://img.shields.io/travis/demurgos/v8-coverage/master.svg?maxAge=2592000)](https://travis-ci.org/demurgos/v8-coverage) +[![Build status (AppVeyor)](https://ci.appveyor.com/api/projects/status/qgcbdffyb9e09d0e?svg=true)](https://ci.appveyor.com/project/demurgos/v8-coverage) +[![Codecov](https://codecov.io/gh/demurgos/v8-coverage/branch/master/graph/badge.svg)](https://codecov.io/gh/demurgos/v8-coverage) + +## License + +[MIT License](./LICENSE.md) diff --git a/node_modules/@bcoe/v8-coverage/package.json b/node_modules/@bcoe/v8-coverage/package.json new file mode 100644 index 0000000000000000000000000000000000000000..2c04d1b5c866ea867c297c409e33b1d9f5aba63a --- /dev/null +++ b/node_modules/@bcoe/v8-coverage/package.json @@ -0,0 +1,29 @@ +{ + "name": "@bcoe/v8-coverage", + "version": "1.0.2", + "description": "Helper functions for V8 coverage files.", + "author": "Charles Samborski (https://demurgos.net)", + "license": "MIT", + "main": "./src/lib/index.js", + "repository": { + "type": "git", + "url": "git://github.com/bcoe/v8-coverage.git" + }, + "scripts": { + "test": "c8 mocha ./src/test/*.js", + "posttest": "prettier --check ./src/lib/*.js", + "fix": "prettier --write ./src/lib/*.js" + }, + "devDependencies": { + "c8": "^10.1.2", + "chai": "^4.5.0", + "mocha": "^11.0.1", + "prettier": "3.4.2" + }, + "engines": { + "node": ">=18" + }, + "files": [ + "./src/lib" + ] +} diff --git a/node_modules/@bcoe/v8-coverage/src/lib/ascii.js b/node_modules/@bcoe/v8-coverage/src/lib/ascii.js new file mode 100644 index 0000000000000000000000000000000000000000..f0700ca492d73ff61c83b967096760d144078f00 --- /dev/null +++ b/node_modules/@bcoe/v8-coverage/src/lib/ascii.js @@ -0,0 +1,145 @@ +const { compareRangeCovs } = require("./compare"); + +function emitForest(trees) { + return emitForestLines(trees).join("\n"); +} + +function emitForestLines(trees) { + const colMap = getColMap(trees); + const header = emitOffsets(colMap); + return [header, ...trees.map((tree) => emitTree(tree, colMap).join("\n"))]; +} + +function getColMap(trees) { + const eventSet = new Set(); + for (const tree of trees) { + const stack = [tree]; + while (stack.length > 0) { + const cur = stack.pop(); + eventSet.add(cur.start); + eventSet.add(cur.end); + for (const child of cur.children) { + stack.push(child); + } + } + } + const events = [...eventSet]; + events.sort((a, b) => a - b); + let maxDigits = 1; + for (const event of events) { + maxDigits = Math.max(maxDigits, event.toString(10).length); + } + const colWidth = maxDigits + 3; + const colMap = new Map(); + for (const [i, event] of events.entries()) { + colMap.set(event, i * colWidth); + } + return colMap; +} + +function emitTree(tree, colMap) { + const layers = []; + let nextLayer = [tree]; + while (nextLayer.length > 0) { + const layer = nextLayer; + layers.push(layer); + nextLayer = []; + for (const node of layer) { + for (const child of node.children) { + nextLayer.push(child); + } + } + } + return layers.map((layer) => emitTreeLayer(layer, colMap)); +} + +function parseFunctionRanges(text, offsetMap) { + const result = []; + for (const line of text.split("\n")) { + for (const range of parseTreeLayer(line, offsetMap)) { + result.push(range); + } + } + result.sort(compareRangeCovs); + return result; +} + +/** + * + * @param layer Sorted list of disjoint trees. + * @param colMap + */ +function emitTreeLayer(layer, colMap) { + const line = []; + let curIdx = 0; + for (const { start, end, count } of layer) { + const startIdx = colMap.get(start); + const endIdx = colMap.get(end); + if (startIdx > curIdx) { + line.push(" ".repeat(startIdx - curIdx)); + } + line.push(emitRange(count, endIdx - startIdx)); + curIdx = endIdx; + } + return line.join(""); +} + +function parseTreeLayer(text, offsetMap) { + const result = []; + const regex = /\[(\d+)-*\)/gs; + while (true) { + const match = regex.exec(text); + if (match === null) { + break; + } + const startIdx = match.index; + const endIdx = startIdx + match[0].length; + const count = parseInt(match[1], 10); + const startOffset = offsetMap.get(startIdx); + const endOffset = offsetMap.get(endIdx); + if (startOffset === undefined || endOffset === undefined) { + throw new Error(`Invalid offsets for: ${JSON.stringify(text)}`); + } + result.push({ startOffset, endOffset, count }); + } + return result; +} + +function emitRange(count, len) { + const rangeStart = `[${count.toString(10)}`; + const rangeEnd = ")"; + const hyphensLen = len - (rangeStart.length + rangeEnd.length); + const hyphens = "-".repeat(Math.max(0, hyphensLen)); + return `${rangeStart}${hyphens}${rangeEnd}`; +} + +function emitOffsets(colMap) { + let line = ""; + for (const [event, col] of colMap) { + if (line.length < col) { + line += " ".repeat(col - line.length); + } + line += event.toString(10); + } + return line; +} + +function parseOffsets(text) { + const result = new Map(); + const regex = /\d+/gs; + while (true) { + const match = regex.exec(text); + if (match === null) { + break; + } + result.set(match.index, parseInt(match[0], 10)); + } + return result; +} + +module.exports = { + emitForest, + emitForestLines, + parseFunctionRanges, + parseOffsets, +}; diff --git a/node_modules/@bcoe/v8-coverage/src/lib/clone.js b/node_modules/@bcoe/v8-coverage/src/lib/clone.js new file mode 100644 index 0000000000000000000000000000000000000000..44c5e279f24cac8902f21ad085750647d0bc91e5 --- /dev/null +++ b/node_modules/@bcoe/v8-coverage/src/lib/clone.js @@ -0,0 +1,75 @@ +/** + * Creates a deep copy of a process coverage. + * + * @param processCov Process coverage to clone. + * @return Cloned process coverage. + */ +function cloneProcessCov(processCov) { + const result = []; + for (const scriptCov of processCov.result) { + result.push(cloneScriptCov(scriptCov)); + } + + return { + result, + }; +} + +/** + * Creates a deep copy of a script coverage. + * + * @param scriptCov Script coverage to clone. + * @return Cloned script coverage. + */ +function cloneScriptCov(scriptCov) { + const functions = []; + for (const functionCov of scriptCov.functions) { + functions.push(cloneFunctionCov(functionCov)); + } + + return { + scriptId: scriptCov.scriptId, + url: scriptCov.url, + functions, + }; +} + +/** + * Creates a deep copy of a function coverage. + * + * @param functionCov Function coverage to clone. + * @return Cloned function coverage. + */ +function cloneFunctionCov(functionCov) { + const ranges = []; + for (const rangeCov of functionCov.ranges) { + ranges.push(cloneRangeCov(rangeCov)); + } + + return { + functionName: functionCov.functionName, + ranges, + isBlockCoverage: functionCov.isBlockCoverage, + }; +} + +/** + * Creates a deep copy of a function coverage. + * + * @param rangeCov Range coverage to clone. + * @return Cloned range coverage. + */ +function cloneRangeCov(rangeCov) { + return { + startOffset: rangeCov.startOffset, + endOffset: rangeCov.endOffset, + count: rangeCov.count, + }; +} + +module.exports = { + cloneProcessCov, + cloneScriptCov, + cloneFunctionCov, + cloneRangeCov, +}; diff --git a/node_modules/@bcoe/v8-coverage/src/lib/compare.js b/node_modules/@bcoe/v8-coverage/src/lib/compare.js new file mode 100644 index 0000000000000000000000000000000000000000..d8870184ff6bc4b2f402beafe37a813b8e328afc --- /dev/null +++ b/node_modules/@bcoe/v8-coverage/src/lib/compare.js @@ -0,0 +1,44 @@ +/** + * Compares two script coverages. + * + * The result corresponds to the comparison of their `url` value (alphabetical sort). + */ +function compareScriptCovs(a, b) { + if (a.url === b.url) { + return 0; + } else if (a.url < b.url) { + return -1; + } else { + return 1; + } +} + +/** + * Compares two function coverages. + * + * The result corresponds to the comparison of the root ranges. + */ +function compareFunctionCovs(a, b) { + return compareRangeCovs(a.ranges[0], b.ranges[0]); +} + +/** + * Compares two range coverages. + * + * The ranges are first ordered by ascending `startOffset` and then by + * descending `endOffset`. + * This corresponds to a pre-order tree traversal. + */ +function compareRangeCovs(a, b) { + if (a.startOffset !== b.startOffset) { + return a.startOffset - b.startOffset; + } else { + return b.endOffset - a.endOffset; + } +} + +module.exports = { + compareScriptCovs, + compareFunctionCovs, + compareRangeCovs, +}; diff --git a/node_modules/@bcoe/v8-coverage/src/lib/index.js b/node_modules/@bcoe/v8-coverage/src/lib/index.js new file mode 100644 index 0000000000000000000000000000000000000000..0429ad5a72b8a10412e268ec92b5350b01add377 --- /dev/null +++ b/node_modules/@bcoe/v8-coverage/src/lib/index.js @@ -0,0 +1,41 @@ +const { + emitForest, + emitForestLines, + parseFunctionRanges, + parseOffsets, +} = require("./ascii"); +const { + cloneFunctionCov, + cloneProcessCov, + cloneScriptCov, + cloneRangeCov, +} = require("./clone"); +const { + compareScriptCovs, + compareFunctionCovs, + compareRangeCovs, +} = require("./compare"); +const { + mergeFunctionCovs, + mergeProcessCovs, + mergeScriptCovs, +} = require("./merge"); +const { RangeTree } = require("./range-tree"); + +module.exports = { + emitForest, + emitForestLines, + parseFunctionRanges, + parseOffsets, + cloneFunctionCov, + cloneProcessCov, + cloneScriptCov, + cloneRangeCov, + compareScriptCovs, + compareFunctionCovs, + compareRangeCovs, + mergeFunctionCovs, + mergeProcessCovs, + mergeScriptCovs, + RangeTree, +}; diff --git a/node_modules/@bcoe/v8-coverage/src/lib/merge.js b/node_modules/@bcoe/v8-coverage/src/lib/merge.js new file mode 100644 index 0000000000000000000000000000000000000000..1f3d9156e0006f8e4395ece29cc5eb90b6d9d624 --- /dev/null +++ b/node_modules/@bcoe/v8-coverage/src/lib/merge.js @@ -0,0 +1,353 @@ +const { + deepNormalizeScriptCov, + normalizeFunctionCov, + normalizeProcessCov, + normalizeRangeTree, + normalizeScriptCov, +} = require("./normalize"); +const { RangeTree } = require("./range-tree"); + +/** + * Merges a list of process coverages. + * + * The result is normalized. + * The input values may be mutated, it is not safe to use them after passing + * them to this function. + * The computation is synchronous. + * + * @param processCovs Process coverages to merge. + * @return Merged process coverage. + */ +function mergeProcessCovs(processCovs) { + if (processCovs.length === 0) { + return { result: [] }; + } + + const urlToScripts = new Map(); + for (const processCov of processCovs) { + for (const scriptCov of processCov.result) { + let scriptCovs = urlToScripts.get(scriptCov.url); + if (scriptCovs === undefined) { + scriptCovs = []; + urlToScripts.set(scriptCov.url, scriptCovs); + } + scriptCovs.push(scriptCov); + } + } + + const result = []; + for (const scripts of urlToScripts.values()) { + // assert: `scripts.length > 0` + result.push(mergeScriptCovs(scripts)); + } + const merged = { result }; + + normalizeProcessCov(merged); + return merged; +} + +/** + * Merges a list of matching script coverages. + * + * Scripts are matching if they have the same `url`. + * The result is normalized. + * The input values may be mutated, it is not safe to use them after passing + * them to this function. + * The computation is synchronous. + * + * @param scriptCovs Process coverages to merge. + * @return Merged script coverage, or `undefined` if the input list was empty. + */ +function mergeScriptCovs(scriptCovs) { + if (scriptCovs.length === 0) { + return undefined; + } else if (scriptCovs.length === 1) { + const merged = scriptCovs[0]; + deepNormalizeScriptCov(merged); + return merged; + } + + const first = scriptCovs[0]; + const scriptId = first.scriptId; + const url = first.url; + + const rangeToFuncs = new Map(); + for (const scriptCov of scriptCovs) { + for (const funcCov of scriptCov.functions) { + const rootRange = stringifyFunctionRootRange(funcCov); + let funcCovs = rangeToFuncs.get(rootRange); + + if ( + funcCovs === undefined || + // if the entry in rangeToFuncs is function-level granularity and + // the new coverage is block-level, prefer block-level. + (!funcCovs[0].isBlockCoverage && funcCov.isBlockCoverage) + ) { + funcCovs = []; + rangeToFuncs.set(rootRange, funcCovs); + } else if (funcCovs[0].isBlockCoverage && !funcCov.isBlockCoverage) { + // if the entry in rangeToFuncs is block-level granularity, we should + // not append function level granularity. + continue; + } + funcCovs.push(funcCov); + } + } + + const functions = []; + for (const funcCovs of rangeToFuncs.values()) { + // assert: `funcCovs.length > 0` + functions.push(mergeFunctionCovs(funcCovs)); + } + + const merged = { scriptId, url, functions }; + normalizeScriptCov(merged); + return merged; +} + +/** + * Returns a string representation of the root range of the function. + * + * This string can be used to match function with same root range. + * The string is derived from the start and end offsets of the root range of + * the function. + * This assumes that `ranges` is non-empty (true for valid function coverages). + * + * @param funcCov Function coverage with the range to stringify + * @internal + */ +function stringifyFunctionRootRange(funcCov) { + const rootRange = funcCov.ranges[0]; + return `${rootRange.startOffset.toString(10)};${rootRange.endOffset.toString(10)}`; +} + +/** + * Merges a list of matching function coverages. + * + * Functions are matching if their root ranges have the same span. + * The result is normalized. + * The input values may be mutated, it is not safe to use them after passing + * them to this function. + * The computation is synchronous. + * + * @param funcCovs Function coverages to merge. + * @return Merged function coverage, or `undefined` if the input list was empty. + */ +function mergeFunctionCovs(funcCovs) { + if (funcCovs.length === 0) { + return undefined; + } else if (funcCovs.length === 1) { + const merged = funcCovs[0]; + normalizeFunctionCov(merged); + return merged; + } + + const functionName = funcCovs[0].functionName; + + const trees = []; + for (const funcCov of funcCovs) { + // assert: `fn.ranges.length > 0` + // assert: `fn.ranges` is sorted + trees.push(RangeTree.fromSortedRanges(funcCov.ranges)); + } + + // assert: `trees.length > 0` + const mergedTree = mergeRangeTrees(trees); + normalizeRangeTree(mergedTree); + const ranges = mergedTree.toRanges(); + const isBlockCoverage = !(ranges.length === 1 && ranges[0].count === 0); + + const merged = { functionName, ranges, isBlockCoverage }; + // assert: `merged` is normalized + return merged; +} + +/** + * @precondition Same `start` and `end` for all the trees + */ +function mergeRangeTrees(trees) { + if (trees.length <= 1) { + return trees[0]; + } + const first = trees[0]; + let delta = 0; + for (const tree of trees) { + delta += tree.delta; + } + const children = mergeRangeTreeChildren(trees); + return new RangeTree(first.start, first.end, delta, children); +} + +class RangeTreeWithParent { + parentIndex; + tree; + + constructor(parentIndex, tree) { + this.parentIndex = parentIndex; + this.tree = tree; + } +} + +class StartEvent { + offset; + trees; + + constructor(offset, trees) { + this.offset = offset; + this.trees = trees; + } + + static compare(a, b) { + return a.offset - b.offset; + } +} + +class StartEventQueue { + queue; + nextIndex; + pendingOffset; + pendingTrees; + + constructor(queue) { + this.queue = queue; + this.nextIndex = 0; + this.pendingOffset = 0; + this.pendingTrees = undefined; + } + + static fromParentTrees(parentTrees) { + const startToTrees = new Map(); + for (const [parentIndex, parentTree] of parentTrees.entries()) { + for (const child of parentTree.children) { + let trees = startToTrees.get(child.start); + if (trees === undefined) { + trees = []; + startToTrees.set(child.start, trees); + } + trees.push(new RangeTreeWithParent(parentIndex, child)); + } + } + const queue = []; + for (const [startOffset, trees] of startToTrees) { + queue.push(new StartEvent(startOffset, trees)); + } + queue.sort(StartEvent.compare); + return new StartEventQueue(queue); + } + + setPendingOffset(offset) { + this.pendingOffset = offset; + } + + pushPendingTree(tree) { + if (this.pendingTrees === undefined) { + this.pendingTrees = []; + } + this.pendingTrees.push(tree); + } + + next() { + const pendingTrees = this.pendingTrees; + const nextEvent = this.queue[this.nextIndex]; + if (pendingTrees === undefined) { + this.nextIndex++; + return nextEvent; + } else if (nextEvent === undefined) { + this.pendingTrees = undefined; + return new StartEvent(this.pendingOffset, pendingTrees); + } else { + if (this.pendingOffset < nextEvent.offset) { + this.pendingTrees = undefined; + return new StartEvent(this.pendingOffset, pendingTrees); + } else { + if (this.pendingOffset === nextEvent.offset) { + this.pendingTrees = undefined; + for (const tree of pendingTrees) { + nextEvent.trees.push(tree); + } + } + this.nextIndex++; + return nextEvent; + } + } + } +} + +function mergeRangeTreeChildren(parentTrees) { + const result = []; + const startEventQueue = StartEventQueue.fromParentTrees(parentTrees); + const parentToNested = new Map(); + let openRange; + + while (true) { + const event = startEventQueue.next(); + if (event === undefined) { + break; + } + + if (openRange !== undefined && openRange.end <= event.offset) { + result.push(nextChild(openRange, parentToNested)); + openRange = undefined; + } + + if (openRange === undefined) { + let openRangeEnd = event.offset + 1; + for (const { parentIndex, tree } of event.trees) { + openRangeEnd = Math.max(openRangeEnd, tree.end); + insertChild(parentToNested, parentIndex, tree); + } + startEventQueue.setPendingOffset(openRangeEnd); + openRange = { start: event.offset, end: openRangeEnd }; + } else { + for (const { parentIndex, tree } of event.trees) { + if (tree.end > openRange.end) { + const right = tree.split(openRange.end); + startEventQueue.pushPendingTree( + new RangeTreeWithParent(parentIndex, right), + ); + } + insertChild(parentToNested, parentIndex, tree); + } + } + } + if (openRange !== undefined) { + result.push(nextChild(openRange, parentToNested)); + } + + return result; +} + +function insertChild(parentToNested, parentIndex, tree) { + let nested = parentToNested.get(parentIndex); + if (nested === undefined) { + nested = []; + parentToNested.set(parentIndex, nested); + } + nested.push(tree); +} + +function nextChild(openRange, parentToNested) { + const matchingTrees = []; + + for (const nested of parentToNested.values()) { + if ( + nested.length === 1 && + nested[0].start === openRange.start && + nested[0].end === openRange.end + ) { + matchingTrees.push(nested[0]); + } else { + matchingTrees.push( + new RangeTree(openRange.start, openRange.end, 0, nested), + ); + } + } + parentToNested.clear(); + return mergeRangeTrees(matchingTrees); +} + +module.exports = { + mergeProcessCovs, + mergeScriptCovs, + mergeFunctionCovs, +}; diff --git a/node_modules/@bcoe/v8-coverage/src/lib/normalize.js b/node_modules/@bcoe/v8-coverage/src/lib/normalize.js new file mode 100644 index 0000000000000000000000000000000000000000..130e9b82a38c44fc33171a3115f6b14dc6e5a76f --- /dev/null +++ b/node_modules/@bcoe/v8-coverage/src/lib/normalize.js @@ -0,0 +1,96 @@ +const { + compareFunctionCovs, + compareRangeCovs, + compareScriptCovs, +} = require("./compare"); +const { RangeTree } = require("./range-tree"); + +/** + * Normalizes a process coverage. + * + * Sorts the scripts alphabetically by `url`. + * Reassigns script ids: the script at index `0` receives `"0"`, the script at + * index `1` receives `"1"` etc. + * This does not normalize the script coverages. + * + * @param processCov Process coverage to normalize. + */ +function normalizeProcessCov(processCov) { + processCov.result.sort(compareScriptCovs); + for (const [scriptId, scriptCov] of processCov.result.entries()) { + scriptCov.scriptId = scriptId.toString(10); + } +} + +/** + * Normalizes a process coverage deeply. + * + * Normalizes the script coverages deeply, then normalizes the process coverage + * itself. + * + * @param processCov Process coverage to normalize. + */ +function deepNormalizeProcessCov(processCov) { + for (const scriptCov of processCov.result) { + deepNormalizeScriptCov(scriptCov); + } + normalizeProcessCov(processCov); +} + +/** + * Normalizes a script coverage. + * + * Sorts the function by root range (pre-order sort). + * This does not normalize the function coverages. + * + * @param scriptCov Script coverage to normalize. + */ +function normalizeScriptCov(scriptCov) { + scriptCov.functions.sort(compareFunctionCovs); +} + +/** + * Normalizes a script coverage deeply. + * + * Normalizes the function coverages deeply, then normalizes the script coverage + * itself. + * + * @param scriptCov Script coverage to normalize. + */ +function deepNormalizeScriptCov(scriptCov) { + for (const funcCov of scriptCov.functions) { + normalizeFunctionCov(funcCov); + } + normalizeScriptCov(scriptCov); +} + +/** + * Normalizes a function coverage. + * + * Sorts the ranges (pre-order sort). + * TODO: Tree-based normalization of the ranges. + * + * @param funcCov Function coverage to normalize. + */ +function normalizeFunctionCov(funcCov) { + funcCov.ranges.sort(compareRangeCovs); + const tree = RangeTree.fromSortedRanges(funcCov.ranges); + normalizeRangeTree(tree); + funcCov.ranges = tree.toRanges(); +} + +/** + * @internal + */ +function normalizeRangeTree(tree) { + tree.normalize(); +} + +module.exports = { + normalizeProcessCov, + deepNormalizeProcessCov, + normalizeScriptCov, + deepNormalizeScriptCov, + normalizeFunctionCov, + normalizeRangeTree, +}; diff --git a/node_modules/@bcoe/v8-coverage/src/lib/range-tree.js b/node_modules/@bcoe/v8-coverage/src/lib/range-tree.js new file mode 100644 index 0000000000000000000000000000000000000000..2bd456f4f5e46bbf19f06e1199ba529a4d47d49b --- /dev/null +++ b/node_modules/@bcoe/v8-coverage/src/lib/range-tree.js @@ -0,0 +1,157 @@ +class RangeTree { + start; + end; + delta; + children; + + constructor(start, end, delta, children) { + this.start = start; + this.end = end; + this.delta = delta; + this.children = children; + } + + /** + * @precodition `ranges` are well-formed and pre-order sorted + */ + static fromSortedRanges(ranges) { + let root; + // Stack of parent trees and parent counts. + const stack = []; + for (const range of ranges) { + const node = new RangeTree( + range.startOffset, + range.endOffset, + range.count, + [], + ); + if (root === undefined) { + root = node; + stack.push([node, range.count]); + continue; + } + let parent; + let parentCount; + while (true) { + [parent, parentCount] = stack[stack.length - 1]; + // assert: `top !== undefined` (the ranges are sorted) + if (range.startOffset < parent.end) { + break; + } else { + stack.pop(); + } + + if (stack.length === 0) { + break; + } + } + node.delta -= parentCount; + parent.children.push(node); + stack.push([node, range.count]); + } + return root; + } + + normalize() { + const children = []; + let curEnd; + let head; + const tail = []; + for (const child of this.children) { + if (head === undefined) { + head = child; + } else if (child.delta === head.delta && child.start === curEnd) { + tail.push(child); + } else { + endChain(); + head = child; + } + curEnd = child.end; + } + if (head !== undefined) { + endChain(); + } + + if (children.length === 1) { + const child = children[0]; + if (child.start === this.start && child.end === this.end) { + this.delta += child.delta; + this.children = child.children; + // `.lazyCount` is zero for both (both are after normalization) + return; + } + } + + this.children = children; + + function endChain() { + if (tail.length !== 0) { + head.end = tail[tail.length - 1].end; + for (const tailTree of tail) { + for (const subChild of tailTree.children) { + subChild.delta += tailTree.delta - head.delta; + head.children.push(subChild); + } + } + tail.length = 0; + } + head.normalize(); + children.push(head); + } + } + + /** + * @precondition `tree.start < value && value < tree.end` + * @return RangeTree Right part + */ + split(value) { + let leftChildLen = this.children.length; + let mid; + + // TODO(perf): Binary search (check overhead) + for (let i = 0; i < this.children.length; i++) { + const child = this.children[i]; + if (child.start < value && value < child.end) { + mid = child.split(value); + leftChildLen = i + 1; + break; + } else if (child.start >= value) { + leftChildLen = i; + break; + } + } + + const rightLen = this.children.length - leftChildLen; + const rightChildren = this.children.splice(leftChildLen, rightLen); + if (mid !== undefined) { + rightChildren.unshift(mid); + } + const result = new RangeTree(value, this.end, this.delta, rightChildren); + this.end = value; + return result; + } + + /** + * Get the range coverages corresponding to the tree. + * + * The ranges are pre-order sorted. + */ + toRanges() { + const ranges = []; + // Stack of parent trees and counts. + const stack = [[this, 0]]; + while (stack.length > 0) { + const [cur, parentCount] = stack.pop(); + const count = parentCount + cur.delta; + ranges.push({ startOffset: cur.start, endOffset: cur.end, count }); + for (let i = cur.children.length - 1; i >= 0; i--) { + stack.push([cur.children[i], count]); + } + } + return ranges; + } +} + +module.exports = { + RangeTree, +}; diff --git a/node_modules/@borewit/text-codec/LICENSE.txt b/node_modules/@borewit/text-codec/LICENSE.txt new file mode 100644 index 0000000000000000000000000000000000000000..6780b3c143fd28c1aa1f1fcdb3b891db1aa37948 --- /dev/null +++ b/node_modules/@borewit/text-codec/LICENSE.txt @@ -0,0 +1,9 @@ +The MIT License (MIT) + +Copyright © 2025 Borewit + +Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. diff --git a/node_modules/@borewit/text-codec/README.md b/node_modules/@borewit/text-codec/README.md new file mode 100644 index 0000000000000000000000000000000000000000..53b80d667ce805315c9c4548b5347b6a68766d73 --- /dev/null +++ b/node_modules/@borewit/text-codec/README.md @@ -0,0 +1,87 @@ +[![CI](https://github.com/Borewit/text-codec/actions/workflows/ci.yml/badge.svg)](https://github.com/Borewit/text-codec/actions/workflows/ci.yml) +[![npm version](https://img.shields.io/npm/v/%40borewit%2Ftext-codec.svg)](https://www.npmjs.com/package/@borewit/text-codec) +[![npm downloads](http://img.shields.io/npm/dm/@borewit/text-codec.svg)](https://npmcharts.com/compare/@borewit/text-codec?interval=30) +![bundlejs](https://deno.bundlejs.com/?q=@borewit/text-codec&badge) +[![License: MIT](https://img.shields.io/badge/License-MIT-green.svg?logo=open-source-initiative&logoColor=white)](LICENSE.txt) + +# `@borewit/text-codec` + +A **lightweight polyfill for text encoders and decoders** covering a small set of commonly used encodings. + +Some JavaScript runtimes provide limited or inconsistent encoding support through `TextEncoder` and `TextDecoder`. +Examples include environments like **Hermes (React Native)** or certain **Node.js builds with limited ICU support**. + +This module provides **reliable encode/decode support for a small set of encodings that may be missing or unreliable in those environments**. + +- If a native UTF-8 `TextEncoder` / `TextDecoder` is available, it is used. +- All other encodings are implemented by this library. + +## Supported encodings + +- `utf-8` / `utf8` +- `utf-16le` +- `ascii` +- `latin1` / `iso-8859-1` +- `windows-1252` + +These encodings are commonly encountered in metadata formats and legacy text data. + +## ✨ Features + +- Encoding and decoding utilities +- Lightweight +- Typed API + +## 📦 Installation + +```sh +npm install @borewit/text-codec +``` + +# 📚 API Documentation + +## `textDecode(bytes, encoding): string` + +Decodes binary data into a JavaScript string. + +**Parameters** +- `bytes` (`Uint8Array`) — The binary data to decode. +- `encoding` (`SupportedEncoding`, optional) — Encoding type. Defaults to `"utf-8"`. + +**Returns** +- `string` — The decoded text. + +**Example** +```js +import { textDecode } from "@borewit/text-codec"; + +const bytes = new Uint8Array([0x48, 0x65, 0x6c, 0x6c, 0x6f]); +const text = textDecode(bytes, "ascii"); +console.log(text); // "Hello" +``` + +## `textEncode(input, encoding): Uint8Array` + +Encodes a JavaScript string into binary form using the specified encoding. + +**Parameters** + +- `input` (`string`) — The string to encode. +- `encoding` (`SupportedEncoding`, optional) — Encoding type. Defaults to `"utf-8"`. + +**Returns** + +`Uint8Array` — The encoded binary data. + +Example: +```js +import { textEncode } from "@borewit/text-codec"; + +const bytes = textEncode("Hello", "utf-16le"); +console.log(bytes); // Uint8Array([...]) +``` + +## 📜 Licence + +This project is licensed under the [MIT License](LICENSE.txt). Feel free to use, modify, and distribute as needed. + \ No newline at end of file diff --git a/node_modules/@borewit/text-codec/lib/index.d.ts b/node_modules/@borewit/text-codec/lib/index.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..1e22404ab73ae27c27233b4ecad79e88e1469dfe --- /dev/null +++ b/node_modules/@borewit/text-codec/lib/index.d.ts @@ -0,0 +1,6 @@ +export type SupportedEncoding = "utf-8" | "utf8" | "utf-16le" | "us-ascii" | "ascii" | "latin1" | "iso-8859-1" | "windows-1252"; +/** + * Decode text from binary data + */ +export declare function textDecode(bytes: Uint8Array, encoding?: SupportedEncoding): string; +export declare function textEncode(input?: string, encoding?: SupportedEncoding): Uint8Array; diff --git a/node_modules/@borewit/text-codec/lib/index.js b/node_modules/@borewit/text-codec/lib/index.js new file mode 100644 index 0000000000000000000000000000000000000000..1f552e0030c219ff58c724ef4c0e0eac09856a7c --- /dev/null +++ b/node_modules/@borewit/text-codec/lib/index.js @@ -0,0 +1,380 @@ +const WINDOWS_1252_EXTRA = { + 0x80: "€", 0x82: "‚", 0x83: "ƒ", 0x84: "„", 0x85: "…", 0x86: "†", + 0x87: "‡", 0x88: "ˆ", 0x89: "‰", 0x8a: "Š", 0x8b: "‹", 0x8c: "Œ", + 0x8e: "Ž", 0x91: "‘", 0x92: "’", 0x93: "“", 0x94: "”", 0x95: "•", + 0x96: "–", 0x97: "—", 0x98: "˜", 0x99: "™", 0x9a: "š", 0x9b: "›", + 0x9c: "œ", 0x9e: "ž", 0x9f: "Ÿ", +}; +const WINDOWS_1252_REVERSE = {}; +for (const [code, char] of Object.entries(WINDOWS_1252_EXTRA)) { + WINDOWS_1252_REVERSE[char] = Number.parseInt(code, 10); +} +let _utf8Decoder; +let _utf8Encoder; +function utf8Decoder() { + if (typeof globalThis.TextDecoder === "undefined") + return undefined; + return (_utf8Decoder !== null && _utf8Decoder !== void 0 ? _utf8Decoder : (_utf8Decoder = new globalThis.TextDecoder("utf-8"))); +} +function utf8Encoder() { + if (typeof globalThis.TextEncoder === "undefined") + return undefined; + return (_utf8Encoder !== null && _utf8Encoder !== void 0 ? _utf8Encoder : (_utf8Encoder = new globalThis.TextEncoder())); +} +const CHUNK = 32 * 1024; +const REPLACEMENT = 0xfffd; +/** + * Decode text from binary data + */ +export function textDecode(bytes, encoding = "utf-8") { + switch (encoding.toLowerCase()) { + case "utf-8": + case "utf8": { + const dec = utf8Decoder(); + return dec ? dec.decode(bytes) : decodeUTF8(bytes); + } + case "utf-16le": + return decodeUTF16LE(bytes); + case "us-ascii": + case "ascii": + return decodeASCII(bytes); + case "latin1": + case "iso-8859-1": + return decodeLatin1(bytes); + case "windows-1252": + return decodeWindows1252(bytes); + default: + throw new RangeError(`Encoding '${encoding}' not supported`); + } +} +export function textEncode(input = "", encoding = "utf-8") { + switch (encoding.toLowerCase()) { + case "utf-8": + case "utf8": { + const enc = utf8Encoder(); + return enc ? enc.encode(input) : encodeUTF8(input); + } + case "utf-16le": + return encodeUTF16LE(input); + case "us-ascii": + case "ascii": + return encodeASCII(input); + case "latin1": + case "iso-8859-1": + return encodeLatin1(input); + case "windows-1252": + return encodeWindows1252(input); + default: + throw new RangeError(`Encoding '${encoding}' not supported`); + } +} +function appendCodePoint(out, cp) { + if (cp <= 0xffff) { + out.push(String.fromCharCode(cp)); + return; + } + cp -= 0x10000; + out.push(String.fromCharCode(0xd800 + (cp >> 10), 0xdc00 + (cp & 0x3ff))); +} +function flushChunk(parts, chunk) { + if (chunk.length === 0) + return; + parts.push(String.fromCharCode.apply(null, chunk)); + chunk.length = 0; +} +function pushCodeUnit(parts, chunk, codeUnit) { + chunk.push(codeUnit); + if (chunk.length >= CHUNK) + flushChunk(parts, chunk); +} +function pushCodePoint(parts, chunk, cp) { + if (cp <= 0xffff) { + pushCodeUnit(parts, chunk, cp); + return; + } + cp -= 0x10000; + pushCodeUnit(parts, chunk, 0xd800 + (cp >> 10)); + pushCodeUnit(parts, chunk, 0xdc00 + (cp & 0x3ff)); +} +function decodeUTF8(bytes) { + const parts = []; + const chunk = []; + let i = 0; + // Match TextDecoder("utf-8") default BOM handling + if (bytes.length >= 3 && + bytes[0] === 0xef && + bytes[1] === 0xbb && + bytes[2] === 0xbf) { + i = 3; + } + while (i < bytes.length) { + const b1 = bytes[i]; + if (b1 <= 0x7f) { + pushCodeUnit(parts, chunk, b1); + i++; + continue; + } + // Invalid leading bytes: continuation byte or impossible prefixes + if (b1 < 0xc2 || b1 > 0xf4) { + pushCodeUnit(parts, chunk, REPLACEMENT); + i++; + continue; + } + // 2-byte sequence + if (b1 <= 0xdf) { + if (i + 1 >= bytes.length) { + pushCodeUnit(parts, chunk, REPLACEMENT); + i++; + continue; + } + const b2 = bytes[i + 1]; + if ((b2 & 0xc0) !== 0x80) { + pushCodeUnit(parts, chunk, REPLACEMENT); + i++; + continue; + } + const cp = ((b1 & 0x1f) << 6) | (b2 & 0x3f); + pushCodeUnit(parts, chunk, cp); + i += 2; + continue; + } + // 3-byte sequence + if (b1 <= 0xef) { + if (i + 2 >= bytes.length) { + pushCodeUnit(parts, chunk, REPLACEMENT); + i++; + continue; + } + const b2 = bytes[i + 1]; + const b3 = bytes[i + 2]; + const valid = (b2 & 0xc0) === 0x80 && + (b3 & 0xc0) === 0x80 && + !(b1 === 0xe0 && b2 < 0xa0) && // overlong + !(b1 === 0xed && b2 >= 0xa0); // surrogate range + if (!valid) { + pushCodeUnit(parts, chunk, REPLACEMENT); + i++; + continue; + } + const cp = ((b1 & 0x0f) << 12) | + ((b2 & 0x3f) << 6) | + (b3 & 0x3f); + pushCodeUnit(parts, chunk, cp); + i += 3; + continue; + } + // 4-byte sequence + if (i + 3 >= bytes.length) { + pushCodeUnit(parts, chunk, REPLACEMENT); + i++; + continue; + } + const b2 = bytes[i + 1]; + const b3 = bytes[i + 2]; + const b4 = bytes[i + 3]; + const valid = (b2 & 0xc0) === 0x80 && + (b3 & 0xc0) === 0x80 && + (b4 & 0xc0) === 0x80 && + !(b1 === 0xf0 && b2 < 0x90) && // overlong + !(b1 === 0xf4 && b2 > 0x8f); // > U+10FFFF + if (!valid) { + pushCodeUnit(parts, chunk, REPLACEMENT); + i++; + continue; + } + const cp = ((b1 & 0x07) << 18) | + ((b2 & 0x3f) << 12) | + ((b3 & 0x3f) << 6) | + (b4 & 0x3f); + pushCodePoint(parts, chunk, cp); + i += 4; + } + flushChunk(parts, chunk); + return parts.join(""); +} +function decodeUTF16LE(bytes) { + const parts = []; + const chunk = []; + const len = bytes.length; + let i = 0; + while (i + 1 < len) { + const u1 = bytes[i] | (bytes[i + 1] << 8); + i += 2; + // High surrogate + if (u1 >= 0xd800 && u1 <= 0xdbff) { + if (i + 1 < len) { + const u2 = bytes[i] | (bytes[i + 1] << 8); + if (u2 >= 0xdc00 && u2 <= 0xdfff) { + pushCodeUnit(parts, chunk, u1); + pushCodeUnit(parts, chunk, u2); + i += 2; + } + else { + pushCodeUnit(parts, chunk, REPLACEMENT); + } + } + else { + pushCodeUnit(parts, chunk, REPLACEMENT); + } + continue; + } + // Lone low surrogate + if (u1 >= 0xdc00 && u1 <= 0xdfff) { + pushCodeUnit(parts, chunk, REPLACEMENT); + continue; + } + pushCodeUnit(parts, chunk, u1); + } + // Odd trailing byte + if (i < len) { + pushCodeUnit(parts, chunk, REPLACEMENT); + } + flushChunk(parts, chunk); + return parts.join(""); +} +function decodeASCII(bytes) { + const parts = []; + for (let i = 0; i < bytes.length; i += CHUNK) { + const end = Math.min(bytes.length, i + CHUNK); + const codes = new Array(end - i); + for (let j = i, k = 0; j < end; j++, k++) { + codes[k] = bytes[j] & 0x7f; + } + parts.push(String.fromCharCode.apply(null, codes)); + } + return parts.join(""); +} +function decodeLatin1(bytes) { + const parts = []; + for (let i = 0; i < bytes.length; i += CHUNK) { + const end = Math.min(bytes.length, i + CHUNK); + const codes = new Array(end - i); + for (let j = i, k = 0; j < end; j++, k++) { + codes[k] = bytes[j]; + } + parts.push(String.fromCharCode.apply(null, codes)); + } + return parts.join(""); +} +function decodeWindows1252(bytes) { + const parts = []; + let out = ""; + for (let i = 0; i < bytes.length; i++) { + const b = bytes[i]; + const extra = b >= 0x80 && b <= 0x9f ? WINDOWS_1252_EXTRA[b] : undefined; + out += extra !== null && extra !== void 0 ? extra : String.fromCharCode(b); + if (out.length >= CHUNK) { + parts.push(out); + out = ""; + } + } + if (out) + parts.push(out); + return parts.join(""); +} +function encodeUTF8(str) { + const out = []; + for (let i = 0; i < str.length; i++) { + let cp = str.charCodeAt(i); + // Valid surrogate pair + if (cp >= 0xd800 && cp <= 0xdbff) { + if (i + 1 < str.length) { + const lo = str.charCodeAt(i + 1); + if (lo >= 0xdc00 && lo <= 0xdfff) { + cp = 0x10000 + ((cp - 0xd800) << 10) + (lo - 0xdc00); + i++; + } + else { + cp = REPLACEMENT; + } + } + else { + cp = REPLACEMENT; + } + } + else if (cp >= 0xdc00 && cp <= 0xdfff) { + // Lone low surrogate + cp = REPLACEMENT; + } + if (cp < 0x80) { + out.push(cp); + } + else if (cp < 0x800) { + out.push(0xc0 | (cp >> 6), 0x80 | (cp & 0x3f)); + } + else if (cp < 0x10000) { + out.push(0xe0 | (cp >> 12), 0x80 | ((cp >> 6) & 0x3f), 0x80 | (cp & 0x3f)); + } + else { + out.push(0xf0 | (cp >> 18), 0x80 | ((cp >> 12) & 0x3f), 0x80 | ((cp >> 6) & 0x3f), 0x80 | (cp & 0x3f)); + } + } + return new Uint8Array(out); +} +function encodeUTF16LE(str) { + // Preserve JS string code units, but do not emit non-well-formed UTF-16. + // Replace lone surrogates with U+FFFD. + const units = []; + for (let i = 0; i < str.length; i++) { + const u = str.charCodeAt(i); + if (u >= 0xd800 && u <= 0xdbff) { + if (i + 1 < str.length) { + const lo = str.charCodeAt(i + 1); + if (lo >= 0xdc00 && lo <= 0xdfff) { + units.push(u, lo); + i++; + } + else { + units.push(REPLACEMENT); + } + } + else { + units.push(REPLACEMENT); + } + continue; + } + if (u >= 0xdc00 && u <= 0xdfff) { + units.push(REPLACEMENT); + continue; + } + units.push(u); + } + const out = new Uint8Array(units.length * 2); + for (let i = 0; i < units.length; i++) { + const code = units[i]; + const o = i * 2; + out[o] = code & 0xff; + out[o + 1] = code >>> 8; + } + return out; +} +function encodeASCII(str) { + const out = new Uint8Array(str.length); + for (let i = 0; i < str.length; i++) + out[i] = str.charCodeAt(i) & 0x7f; + return out; +} +function encodeLatin1(str) { + const out = new Uint8Array(str.length); + for (let i = 0; i < str.length; i++) + out[i] = str.charCodeAt(i) & 0xff; + return out; +} +function encodeWindows1252(str) { + const out = new Uint8Array(str.length); + for (let i = 0; i < str.length; i++) { + const ch = str[i]; + const code = ch.charCodeAt(0); + if (WINDOWS_1252_REVERSE[ch] !== undefined) { + out[i] = WINDOWS_1252_REVERSE[ch]; + continue; + } + if ((code >= 0x00 && code <= 0x7f) || + (code >= 0xa0 && code <= 0xff)) { + out[i] = code; + continue; + } + out[i] = 0x3f; // '?' + } + return out; +} diff --git a/node_modules/@borewit/text-codec/package.json b/node_modules/@borewit/text-codec/package.json new file mode 100644 index 0000000000000000000000000000000000000000..bb8188787d72e57b9a14576533f74a38c2fd50c0 --- /dev/null +++ b/node_modules/@borewit/text-codec/package.json @@ -0,0 +1,70 @@ +{ + "name": "@borewit/text-codec", + "version": "0.2.2", + "description": "Text Decoder", + "type": "module", + "exports": "./lib/index.js", + "types": "lib/index.d.ts", + "files": [ + "lib/index.js", + "lib/index.d.ts" + ], + "scripts": { + "clean": "del-cli lib/**/*.js lib/***.js.map test/**/*.d.ts test/**/*.js test/**/*.js.map", + "build": "npm run compile", + "prepublishOnly": "npm run build", + "compile:src": "tsc --p lib --sourceMap false", + "compile:test": "tsc --p test", + "compile": "npm run compile:src && npm run compile:test", + "lint": "biome check", + "test": "mocha", + "update-biome": "npm install --save-dev --save-exact @biomejs/biome@latest && npx @biomejs/biome migrate --write" + }, + "devDependencies": { + "@biomejs/biome": "2.4.6", + "@types/chai": "^5.2.2", + "@types/mocha": "^10.0.10", + "chai": "^6.2.2", + "mocha": "^11.7.5", + "ts-node": "^10.9.2", + "typescript": "^5.9.3" + }, + "keywords": [ + "TextDecoder", + "TextEncoder", + "decoder", + "decoding", + "encod", + "encoding", + "decode", + "text", + "ascii", + "utf-8", + "utf8", + "utf-16le", + "latin1", + "iso-8859-1", + "windows-1252", + "charset", + "encoding", + "decoding", + "polyfill", + "character-set", + "latin", + "hermes", + "react" + ], + "repository": { + "type": "git", + "url": "git+https://github.com/Borewit/text-codec.git" + }, + "author": { + "name": "Borewit", + "url": "https://github.com/Borewit" + }, + "funding": { + "type": "github", + "url": "https://github.com/sponsors/Borewit" + }, + "license": "MIT" +} diff --git a/node_modules/@bramus/specificity/LICENSE b/node_modules/@bramus/specificity/LICENSE new file mode 100644 index 0000000000000000000000000000000000000000..34642d0e2c0cb57904fca475d1142653da299bfd --- /dev/null +++ b/node_modules/@bramus/specificity/LICENSE @@ -0,0 +1,19 @@ +Copyright (c) 2022 Bramus Van Damme - https://www.bram.us/ + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is furnished +to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +THE SOFTWARE. diff --git a/node_modules/@bramus/specificity/README.md b/node_modules/@bramus/specificity/README.md new file mode 100644 index 0000000000000000000000000000000000000000..61c42236733f10a6341449ae41a4e8872f0ec9f5 --- /dev/null +++ b/node_modules/@bramus/specificity/README.md @@ -0,0 +1,164 @@ +[![Calculate CSS Specificity](./screenshots/calculate-specificity.png)](https://codepen.io/bramus/pen/WNXyoYm) + +# Specificity + +`@bramus/specificity` is a package to calculate the specificity of CSS Selectors. It also includes some convenience functions to compare, sort, and filter an array of specificity values. + +Supports [Selectors Level 4](https://www.w3.org/TR/selectors-4/), including those special cases `:is()`, `:where()`, `:not()`, etc. + +Demo: [https://codepen.io/bramus/pen/WNXyoYm](https://codepen.io/bramus/pen/WNXyoYm) + +## Installation + +```bash +npm i @bramus/specificity +``` + +## Usage / Example + +At its core, `@bramus/specificity` exposes a `Specificity` class. Its static `calculate` method can be used to calculate the specificity of a given CSS [Selector List](https://www.w3.org/TR/selectors-4/#grouping) string. + +```js +import Specificity from '@bramus/specificity'; + +const specificities = Specificity.calculate('header:where(#top) nav li:nth-child(2n), #doormat'); +``` + +Because `calculate` accepts a [Selector List](https://www.w3.org/TR/selectors-4/#grouping) — which can contain more than 1 [Selector](https://www.w3.org/TR/selectors-4/#selector) — it will always return an array, with each entry being a `Specificity` instance — one per found selector. + +```js +const specificities = Specificity.calculate('header:where(#top) nav li:nth-child(2n), #doormat'); +specificities.map((s) => s.toString()); // ~> ["(0,1,3)","(1,0,0)"] +``` + +💡 If you know you’re passing only a single Selector into `calculate()`, you can use JavaScript’s built-in destructuring to keep your variable names clean. + +```js +const [s] = Specificity.calculate('header:where(#top) nav li:nth-child(2n)'); +s.toString(); // ~> "(0,1,3)" +``` + +💡 Under the hood, `@bramus/specificity` uses [CSSTree](https://github.com/csstree/csstree) to do the parsing of strings to Selectors. As a result, the `calculate` method also accepts a [CSSTree AST](https://github.com/csstree/csstree/blob/master/docs/ast.md) of the types `Selector` and `SelectorList`. + +If you have a pre-parsed CSSTree AST of the type `Selector` you can pass it into `Specificity.calculateForAST()`. It [performs slightly better](#benchmark) than `Specificity.calculate()` as it needs to check fewer things. It differs from `Specificity.calculate()` in that it does not return an array of `Specificity` instances but only a single value. + +## The Return Format + +A calculated specificity is represented as an instance of the `Specificity` class. The `Specificity` class includes methods to get the specificity value in a certain format, along with some convenience methods to compare it against other instances. + +```js +// 🚀 Thunderbirds are go! +import Specificity from '@bramus/specificity'; + +// ✨ Calculate specificity for each Selector in the given Selector List +const specificities = Specificity.calculate('header:where(#top) nav li:nth-child(2n), #doormat'); + +// 🚚 The values in the array are instances of the Specificity class +const s = specificities[0]; // Instance of Specificity + +// 👀 Read the specificity value using one of its accessors +s.value; // { a: 0, b: 1, c: 3 } +s.a; // 0 +s.b; // 1 +s.c; // 3 + +// 🛠 Convert the calculated value to various formats using one of the toXXX() instance methods +s.toString(); // "(0,1,3)" +s.toArray(); // [0, 1, 3] +s.toObject(); // { a: 0, b: 1, c: 3 } + +// 💡 Extract the matched selector string +s.selectorString(); // "header:where(#top) nav li:nth-child(2n)" + +// 🔀 Use one of its instance comparison methods to compare it to another Specificity instance +s.isEqualTo(specificities[1]); // false +s.isGreaterThan(specificities[1]); // false +s.isLessThan(specificities[1]); // true + +// 💻 Don’t worry about JSON.stringify() +JSON.stringify(s); +// { +// "selector": 'header:where(#top) nav li:nth-child(2n)', +// "asObject": { "a": 0, "b": 1, "c": 3 }, +// "asArray": [0, 1, 3], +// "asString": "(0,1,3)", +// } +``` + +## Utility Functions (Static Methods) + +This package also exposes some utility functions to work with specificities. These utility functions are all exposed as static methods on the `Specificity` class. + +- Comparing: + + - `Specificity.compare(s1, s2)`: Compares s1 to s2. Returns a value that can be: + - `> 0` = Sort s2 before s1 _(i.e. s1 is more specific than s2)_ + - `0` = Keep original order of s1 and s2 _(i.e. s1 and s2 are equally specific)_ + - `< 0` = Sort s1 before s2 _(i.e. s1 is less specific than s2)_ + - `Specificity.equals(s1, s2)`: Returns `true` if s1 and s2 have the same specificity. If not, `false` is returned. + - `Specificity.greaterThan(s1, s2)`: Returns `true` if s1 has a higher specificity than s2. If not, `false` is returned. + - `Specificity.lessThan(s1, s2)`: Returns `true` if s1 has a lower specificity than s2. If not, `false` is returned. + +- Sorting: + + - `Specificity.sortAsc(s1, s2, …, sN)`: Sorts the given specificities in ascending order _(low specificity to high specificity)_ + - `Specificity.sortDesc(s1, s2, …, sN)`: Sorts the given specificities in descending order _(high specificity to low specificity)_ + +- Filtering: + - `Specificity.min(s1, s2, …, sN)`: Filters out the value with the lowest specificity + - `Specificity.max(s1, s2, …, sN)`: Filters out the value with the highest specificity + +A specificity passed into any of these utility functions can be any of: + +- An instance of the included `Specificity` class +- A simple Object such as `{'a': 1, 'b': 0, 'c': 2}` + +## Utility Functions (Standalone) + +All static methods the `Specificity` class exposes are also exported as standalone functions using [Subpath Exports](https://nodejs.org/api/packages.html#subpath-exports). + +If you're only interested in including some of these functions into your project you can import them from their Subpath. As a result, your bundle size will be reduced greatly _(except for including the standalone `calculate`, as it returns an array of `Specificity` instances that relies on the whole lot)_ + +```js +import { calculate, calculateForAST } from '@bramus/specificity/core'; +import { compare, equals, greaterThan, lessThan } from '@bramus/specificity/compare'; +import { min, max } from '@bramus/specificity/filter'; +import { sortAsc, sortDesc } from '@bramus/specificity/sort'; +``` + +## Type Definitions + +Although `@bramus/specificity` is written in Vanilla JavaScript, it does include [Type Definitions](https://www.typescriptlang.org/docs/handbook/2/type-declarations.html) which are exposed via its `package.json`. + +## Binary/CLI + +`@bramus/specificity` exposes a binary named `specificity` to calculate the specificity of a given selector list on the CLI. For each selector that it finds, it'll print out the calculated specificity as a string on a new line. + +```bash +$ specificity "header:where(#top) nav li:nth-child(2n), #doormat" +(0,1,3) +(1,0,0) +``` + +## Benchmark + +A benchmark is included, which you can invoke using `npm run benchmark`. + +Sample results (tested on a MacBook Air M3): + +``` +Specificity.calculate(string) x 420,682 ops/sec ±0.34% (98 runs sampled) +Specificity.calculate(ast) - using SelectorList x 8,994,080 ops/sec ±0.25% (98 runs sampled) +Specificity.calculate(ast) - using Selector x 11,054,856 ops/sec ±0.39% (91 runs sampled) +Specificity.calculateForAST(ast) x 12,652,322 ops/sec ±0.35% (96 runs sampled) +``` + +## License + +`@bramus/specificity` is released under the MIT public license. See the enclosed `LICENSE` for details. + +## Acknowledgements + +The idea to create this package was sparked by [the wonderful Specificity Calculator created by Kilian Valkhof / Polypane](https://polypane.app/css-specificity-calculator/), a highly educational tool that not only calculates the specificity, but also explains which parts are responsible for it. + +The heavy lifting of doing the actual parsing of Selectors is done by [CSSTree](https://github.com/csstree/csstree). diff --git a/node_modules/@bramus/specificity/bin/cli.js b/node_modules/@bramus/specificity/bin/cli.js new file mode 100644 index 0000000000000000000000000000000000000000..9d26b686fb92b85c03cb0cfcc3eeec0c09e9015b --- /dev/null +++ b/node_modules/@bramus/specificity/bin/cli.js @@ -0,0 +1,14 @@ +#!/usr/bin/env node +import Specificity from '../dist/index.js'; + +if (!process.argv[2]) { + console.error('❌ Missing selector argument'); + process.exit(1); +} + +try { + const specificities = Specificity.calculate(process.argv[2]); + console.log(specificities.map((specificity) => `${specificity}`).join('\n')); +} catch (e) { + console.error(`❌ ${e.message}`); +} diff --git a/node_modules/@bramus/specificity/dist/index.cjs b/node_modules/@bramus/specificity/dist/index.cjs new file mode 100644 index 0000000000000000000000000000000000000000..f8377233c2678143cb296cfb9c17907fb6168868 --- /dev/null +++ b/node_modules/@bramus/specificity/dist/index.cjs @@ -0,0 +1,8 @@ +var Kn=Object.create;var Tt=Object.defineProperty;var Qn=Object.getOwnPropertyDescriptor;var $n=Object.getOwnPropertyNames;var Xn=Object.getPrototypeOf,Jn=Object.prototype.hasOwnProperty;var De=e=>Tt(e,"__esModule",{value:!0});var lt=(e,t)=>()=>(t||e((t={exports:{}}).exports,t),t.exports),vt=(e,t)=>{for(var r in t)Tt(e,r,{get:t[r],enumerable:!0})},Pe=(e,t,r,n)=>{if(t&&typeof t=="object"||typeof t=="function")for(let s of $n(t))!Jn.call(e,s)&&(r||s!=="default")&&Tt(e,s,{get:()=>t[s],enumerable:!(n=Qn(t,s))||n.enumerable});return e},Zn=(e,t)=>Pe(De(Tt(e!=null?Kn(Xn(e)):{},"default",!t&&e&&e.__esModule?{get:()=>e.default,enumerable:!0}:{value:e,enumerable:!0})),e),ti=(e=>(t,r)=>e&&e.get(t)||(r=Pe(De({}),t,1),e&&e.set(t,r),r))(typeof WeakMap!="undefined"?new WeakMap:0);var Ue=lt(se=>{var Be="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/".split("");se.encode=function(e){if(0<=e&&e{var We=Ue(),oe=5,Ve=1<>1;return t?-r:r}ae.encode=function(t){var r="",n,s=li(t);do n=s&He,s>>>=oe,s>0&&(n|=Ge),r+=We.encode(n);while(s>0);return r};ae.decode=function(t,r,n){var s=t.length,o=0,a=0,h,l;do{if(r>=s)throw new Error("Expected more digits in base 64 VLQ value.");if(l=We.decode(t.charCodeAt(r++)),l===-1)throw new Error("Invalid base64 digit: "+t.charAt(r-1));h=!!(l&Ge),l&=He,o=o+(l<{function ui(e,t,r){if(t in e)return e[t];if(arguments.length===3)return r;throw new Error('"'+t+'" is a required argument.')}N.getArg=ui;var Ye=/^(?:([\w+\-.]+):)?\/\/(?:(\w+:\w+)@)?([\w.-]*)(?::(\d+))?(.*)$/,fi=/^data:.+\,.+$/;function Ct(e){var t=e.match(Ye);return t?{scheme:t[1],auth:t[2],host:t[3],port:t[4],path:t[5]}:null}N.urlParse=Ct;function ft(e){var t="";return e.scheme&&(t+=e.scheme+":"),t+="//",e.auth&&(t+=e.auth+"@"),e.host&&(t+=e.host),e.port&&(t+=":"+e.port),e.path&&(t+=e.path),t}N.urlGenerate=ft;var pi=32;function mi(e){var t=[];return function(r){for(var n=0;npi&&t.pop(),o}}var ce=mi(function(t){var r=t,n=Ct(t);if(n){if(!n.path)return t;r=n.path}for(var s=N.isAbsolute(r),o=[],a=0,h=0;;)if(a=h,h=r.indexOf("/",a),h===-1){o.push(r.slice(a));break}else for(o.push(r.slice(a,h));h=0;h--)l=o[h],l==="."?o.splice(h,1):l===".."?i++:i>0&&(l===""?(o.splice(h+1,i),i=0):(o.splice(h,2),i--));return r=o.join("/"),r===""&&(r=s?"/":"."),n?(n.path=r,ft(n)):r});N.normalize=ce;function je(e,t){e===""&&(e="."),t===""&&(t=".");var r=Ct(t),n=Ct(e);if(n&&(e=n.path||"/"),r&&!r.scheme)return n&&(r.scheme=n.scheme),ft(r);if(r||t.match(fi))return t;if(n&&!n.host&&!n.path)return n.host=t,ft(n);var s=t.charAt(0)==="/"?t:ce(e.replace(/\/+$/,"")+"/"+t);return n?(n.path=s,ft(n)):s}N.join=je;N.isAbsolute=function(e){return e.charAt(0)==="/"||Ye.test(e)};function di(e,t){e===""&&(e="."),e=e.replace(/\/$/,"");for(var r=0;t.indexOf(e+"/")!==0;){var n=e.lastIndexOf("/");if(n<0||(e=e.slice(0,n),e.match(/^([^\/]+:\/)?\/*$/)))return t;++r}return Array(r+1).join("../")+t.substr(e.length+1)}N.relative=di;var ze=function(){var e=Object.create(null);return!("__proto__"in e)}();function Ke(e){return e}function xi(e){return Qe(e)?"$"+e:e}N.toSetString=ze?Ke:xi;function ki(e){return Qe(e)?e.slice(1):e}N.fromSetString=ze?Ke:ki;function Qe(e){if(!e)return!1;var t=e.length;if(t<9||e.charCodeAt(t-1)!==95||e.charCodeAt(t-2)!==95||e.charCodeAt(t-3)!==111||e.charCodeAt(t-4)!==116||e.charCodeAt(t-5)!==111||e.charCodeAt(t-6)!==114||e.charCodeAt(t-7)!==112||e.charCodeAt(t-8)!==95||e.charCodeAt(t-9)!==95)return!1;for(var r=t-10;r>=0;r--)if(e.charCodeAt(r)!==36)return!1;return!0}function Si(e,t,r){var n=K(e.source,t.source);return n!==0||(n=e.originalLine-t.originalLine,n!==0)||(n=e.originalColumn-t.originalColumn,n!==0||r)||(n=e.generatedColumn-t.generatedColumn,n!==0)||(n=e.generatedLine-t.generatedLine,n!==0)?n:K(e.name,t.name)}N.compareByOriginalPositions=Si;function gi(e,t,r){var n;return n=e.originalLine-t.originalLine,n!==0||(n=e.originalColumn-t.originalColumn,n!==0||r)||(n=e.generatedColumn-t.generatedColumn,n!==0)||(n=e.generatedLine-t.generatedLine,n!==0)?n:K(e.name,t.name)}N.compareByOriginalPositionsNoSource=gi;function Ci(e,t,r){var n=e.generatedLine-t.generatedLine;return n!==0||(n=e.generatedColumn-t.generatedColumn,n!==0||r)||(n=K(e.source,t.source),n!==0)||(n=e.originalLine-t.originalLine,n!==0)||(n=e.originalColumn-t.originalColumn,n!==0)?n:K(e.name,t.name)}N.compareByGeneratedPositionsDeflated=Ci;function yi(e,t,r){var n=e.generatedColumn-t.generatedColumn;return n!==0||r||(n=K(e.source,t.source),n!==0)||(n=e.originalLine-t.originalLine,n!==0)||(n=e.originalColumn-t.originalColumn,n!==0)?n:K(e.name,t.name)}N.compareByGeneratedPositionsDeflatedNoLine=yi;function K(e,t){return e===t?0:e===null?1:t===null?-1:e>t?1:-1}function bi(e,t){var r=e.generatedLine-t.generatedLine;return r!==0||(r=e.generatedColumn-t.generatedColumn,r!==0)||(r=K(e.source,t.source),r!==0)||(r=e.originalLine-t.originalLine,r!==0)||(r=e.originalColumn-t.originalColumn,r!==0)?r:K(e.name,t.name)}N.compareByGeneratedPositionsInflated=bi;function Li(e){return JSON.parse(e.replace(/^\)]}'[^\n]*\n/,""))}N.parseSourceMapInput=Li;function Ti(e,t,r){if(t=t||"",e&&(e[e.length-1]!=="/"&&t[0]!=="/"&&(e+="/"),t=e+t),r){var n=Ct(r);if(!n)throw new Error("sourceMapURL could not be parsed");if(n.path){var s=n.path.lastIndexOf("/");s>=0&&(n.path=n.path.substring(0,s+1))}t=je(ft(n),t)}return ce(t)}N.computeSourceURL=Ti});var Xe=lt($e=>{var le=Ut(),he=Object.prototype.hasOwnProperty,it=typeof Map<"u";function Q(){this._array=[],this._set=it?new Map:Object.create(null)}Q.fromArray=function(t,r){for(var n=new Q,s=0,o=t.length;s=0)return r}else{var n=le.toSetString(t);if(he.call(this._set,n))return this._set[n]}throw new Error('"'+t+'" is not in the set.')};Q.prototype.at=function(t){if(t>=0&&t{var Je=Ut();function vi(e,t){var r=e.generatedLine,n=t.generatedLine,s=e.generatedColumn,o=t.generatedColumn;return n>r||n==r&&o>=s||Je.compareByGeneratedPositionsInflated(e,t)<=0}function Wt(){this._array=[],this._sorted=!0,this._last={generatedLine:-1,generatedColumn:0}}Wt.prototype.unsortedForEach=function(t,r){this._array.forEach(t,r)};Wt.prototype.add=function(t){vi(this._last,t)?(this._last=t,this._array.push(t)):(this._sorted=!1,this._array.push(t))};Wt.prototype.toArray=function(){return this._sorted||(this._array.sort(Je.compareByGeneratedPositionsInflated),this._sorted=!0),this._array};Ze.MappingList=Wt});var rr=lt(er=>{var yt=qe(),v=Ut(),Vt=Xe().ArraySet,Ei=tr().MappingList;function W(e){e||(e={}),this._file=v.getArg(e,"file",null),this._sourceRoot=v.getArg(e,"sourceRoot",null),this._skipValidation=v.getArg(e,"skipValidation",!1),this._sources=new Vt,this._names=new Vt,this._mappings=new Ei,this._sourcesContents=null}W.prototype._version=3;W.fromSourceMap=function(t){var r=t.sourceRoot,n=new W({file:t.file,sourceRoot:r});return t.eachMapping(function(s){var o={generated:{line:s.generatedLine,column:s.generatedColumn}};s.source!=null&&(o.source=s.source,r!=null&&(o.source=v.relative(r,o.source)),o.original={line:s.originalLine,column:s.originalColumn},s.name!=null&&(o.name=s.name)),n.addMapping(o)}),t.sources.forEach(function(s){var o=s;r!==null&&(o=v.relative(r,s)),n._sources.has(o)||n._sources.add(o);var a=t.sourceContentFor(s);a!=null&&n.setSourceContent(s,a)}),n};W.prototype.addMapping=function(t){var r=v.getArg(t,"generated"),n=v.getArg(t,"original",null),s=v.getArg(t,"source",null),o=v.getArg(t,"name",null);this._skipValidation||this._validateMapping(r,n,s,o),s!=null&&(s=String(s),this._sources.has(s)||this._sources.add(s)),o!=null&&(o=String(o),this._names.has(o)||this._names.add(o)),this._mappings.add({generatedLine:r.line,generatedColumn:r.column,originalLine:n!=null&&n.line,originalColumn:n!=null&&n.column,source:s,name:o})};W.prototype.setSourceContent=function(t,r){var n=t;this._sourceRoot!=null&&(n=v.relative(this._sourceRoot,n)),r!=null?(this._sourcesContents||(this._sourcesContents=Object.create(null)),this._sourcesContents[v.toSetString(n)]=r):this._sourcesContents&&(delete this._sourcesContents[v.toSetString(n)],Object.keys(this._sourcesContents).length===0&&(this._sourcesContents=null))};W.prototype.applySourceMap=function(t,r,n){var s=r;if(r==null){if(t.file==null)throw new Error(`SourceMapGenerator.prototype.applySourceMap requires either an explicit source file, or the source map's "file" property. Both were omitted.`);s=t.file}var o=this._sourceRoot;o!=null&&(s=v.relative(o,s));var a=new Vt,h=new Vt;this._mappings.unsortedForEach(function(l){if(l.source===s&&l.originalLine!=null){var i=t.originalPositionFor({line:l.originalLine,column:l.originalColumn});i.source!=null&&(l.source=i.source,n!=null&&(l.source=v.join(n,l.source)),o!=null&&(l.source=v.relative(o,l.source)),l.originalLine=i.line,l.originalColumn=i.column,i.name!=null&&(l.name=i.name))}var c=l.source;c!=null&&!a.has(c)&&a.add(c);var f=l.name;f!=null&&!h.has(f)&&h.add(f)},this),this._sources=a,this._names=h,t.sources.forEach(function(l){var i=t.sourceContentFor(l);i!=null&&(n!=null&&(l=v.join(n,l)),o!=null&&(l=v.relative(o,l)),this.setSourceContent(l,i))},this)};W.prototype._validateMapping=function(t,r,n,s){if(r&&typeof r.line!="number"&&typeof r.column!="number")throw new Error("original.line and original.column are not numbers -- you probably meant to omit the original mapping entirely and only map the generated position. If so, pass null for the original mapping instead of an object with empty or null values.");if(!(t&&"line"in t&&"column"in t&&t.line>0&&t.column>=0&&!r&&!n&&!s)){if(t&&"line"in t&&"column"in t&&r&&"line"in r&&"column"in r&&t.line>0&&t.column>=0&&r.line>0&&r.column>=0&&n)return;throw new Error("Invalid mapping: "+JSON.stringify({generated:t,source:n,original:r,name:s}))}};W.prototype._serializeMappings=function(){for(var t=0,r=1,n=0,s=0,o=0,a=0,h="",l,i,c,f,k=this._mappings.toArray(),S=0,T=k.length;S0){if(!v.compareByGeneratedPositionsInflated(i,k[S-1]))continue;l+=","}l+=yt.encode(i.generatedColumn-t),t=i.generatedColumn,i.source!=null&&(f=this._sources.indexOf(i.source),l+=yt.encode(f-a),a=f,l+=yt.encode(i.originalLine-1-s),s=i.originalLine-1,l+=yt.encode(i.originalColumn-n),n=i.originalColumn,i.name!=null&&(c=this._names.indexOf(i.name),l+=yt.encode(c-o),o=c)),h+=l}return h};W.prototype._generateSourcesContent=function(t,r){return t.map(function(n){if(!this._sourcesContents)return null;r!=null&&(n=v.relative(r,n));var s=v.toSetString(n);return Object.prototype.hasOwnProperty.call(this._sourcesContents,s)?this._sourcesContents[s]:null},this)};W.prototype.toJSON=function(){var t={version:this._version,sources:this._sources.toArray(),names:this._names.toArray(),mappings:this._serializeMappings()};return this._file!=null&&(t.file=this._file),this._sourceRoot!=null&&(t.sourceRoot=this._sourceRoot),this._sourcesContents&&(t.sourcesContent=this._generateSourcesContent(t.sources,t.sourceRoot)),t};W.prototype.toString=function(){return JSON.stringify(this.toJSON())};er.SourceMapGenerator=W});var gs={};vt(gs,{default:()=>Ie});function I(e){return e>=48&&e<=57}function z(e){return I(e)||e>=65&&e<=70||e>=97&&e<=102}function wt(e){return e>=65&&e<=90}function ei(e){return e>=97&&e<=122}function ri(e){return wt(e)||ei(e)}function ni(e){return e>=128}function Et(e){return ri(e)||ni(e)||e===95}function At(e){return Et(e)||I(e)||e===45}function ii(e){return e>=0&&e<=8||e===11||e>=14&&e<=31||e===127}function dt(e){return e===10||e===13||e===12}function $(e){return dt(e)||e===32||e===9}function R(e,t){return!(e!==92||dt(t)||t===0)}function Nt(e,t,r){return e===45?Et(t)||t===45||R(t,r):Et(e)?!0:e===92?R(e,t):!1}function It(e,t,r){return e===43||e===45?I(t)?2:t===46&&I(r)?3:0:e===46?I(t)?2:0:I(e)?1:0}function Dt(e){return e===65279||e===65534?1:0}var Xt=new Array(128),si=128,xt=130,Jt=131,Pt=132,Zt=133;for(let e=0;ee.length)return!1;for(let s=t;s=0&&$(e.charCodeAt(t));t--);return t+1}function kt(e,t){for(;t=55296&&t<=57343||t>1114111)&&(t=65533),String.fromCodePoint(t)}var gt=["EOF-token","ident-token","function-token","at-keyword-token","hash-token","string-token","bad-string-token","url-token","bad-url-token","delim-token","number-token","percentage-token","dimension-token","whitespace-token","CDO-token","CDC-token","colon-token","semicolon-token","comma-token","[-token","]-token","(-token",")-token","{-token","}-token","comment-token"];function ut(e=null,t){return e===null||e.length0?Dt(t.charCodeAt(0)):0,s=ut(e.lines,r),o=ut(e.columns,r),a=e.startLine,h=e.startColumn;for(let l=n;l{}){t=String(t||"");let n=t.length,s=ut(this.offsetAndType,t.length+1),o=ut(this.balance,t.length+1),a=0,h=0,l=0,i=-1;for(this.offsetAndType=null,this.balance=null,r(t,(c,f,k)=>{switch(c){default:o[a]=n;break;case h:{let S=l&M;for(l=o[S],h=l>>V,o[a]=S,o[S++]=a;S>V:0}lookupTypeNonSC(t){for(let r=this.tokenIndex;r>V;if(n!==13&&n!==25&&t--===0)return n}return 0}lookupOffset(t){return t+=this.tokenIndex,t>V;if(n!==13&&n!==25&&t--===0)return r-this.tokenIndex}return 0}lookupValue(t,r){return t+=this.tokenIndex,t0?t>V,this.tokenEnd=r&M):(this.tokenIndex=this.tokenCount,this.next())}next(){let t=this.tokenIndex+1;t>V,this.tokenEnd=t&M):(this.eof=!0,this.tokenIndex=this.tokenCount,this.tokenType=0,this.tokenStart=this.tokenEnd=this.source.length)}skipSC(){for(;this.tokenType===13||this.tokenType===25;)this.next()}skipUntilBalanced(t,r){let n=t,s,o;t:for(;n0?this.offsetAndType[n-1]&M:this.firstCharOffset,r(this.source.charCodeAt(o))){case 1:break t;case 2:n++;break t;default:this.balance[s]===n&&(n=s)}}this.skip(n-this.tokenIndex)}forEachToken(t){for(let r=0,n=this.firstCharOffset;r>V;n=a,t(h,s,a,r)}}dump(){let t=new Array(this.tokenCount);return this.forEachToken((r,n,s,o)=>{t[o]={idx:o,type:gt[r],chunk:this.source.substring(n,s),balance:this.balance[o]}}),t}};function Bt(e,t){function r(f){return f=e.length){ife,spec:()=>Ii});var wi=43,Ai=45,ue=(e,t)=>{if(e===9&&(e=t),typeof e=="string"){let r=e.charCodeAt(0);return r>127?32768:r<<8}return e},or=[[1,1],[1,2],[1,7],[1,8],[1,"-"],[1,10],[1,11],[1,12],[1,15],[1,21],[3,1],[3,2],[3,7],[3,8],[3,"-"],[3,10],[3,11],[3,12],[3,15],[4,1],[4,2],[4,7],[4,8],[4,"-"],[4,10],[4,11],[4,12],[4,15],[12,1],[12,2],[12,7],[12,8],[12,"-"],[12,10],[12,11],[12,12],[12,15],["#",1],["#",2],["#",7],["#",8],["#","-"],["#",10],["#",11],["#",12],["#",15],["-",1],["-",2],["-",7],["-",8],["-","-"],["-",10],["-",11],["-",12],["-",15],[10,1],[10,2],[10,7],[10,8],[10,10],[10,11],[10,12],[10,"%"],[10,15],["@",1],["@",2],["@",7],["@",8],["@","-"],["@",15],[".",10],[".",11],[".",12],["+",10],["+",11],["+",12],["/","*"]],Ni=or.concat([[1,4],[12,4],[4,4],[3,21],[3,5],[3,16],[11,11],[11,12],[11,2],[11,"-"],[22,1],[22,2],[22,11],[22,12],[22,4],[22,"-"]]);function ar(e){let t=new Set(e.map(([r,n])=>ue(r)<<16|ue(n)));return function(r,n,s){let o=ue(n,s),a=s.charCodeAt(0);return(a===Ai&&n!==1&&n!==2&&n!==15||a===wi?t.has(r<<16|a<<8):t.has(r<<16|o))&&this.emit(" ",13,!0),o}}var Ii=ar(or),fe=ar(Ni);var Di=92;function Pi(e,t){if(typeof t=="function"){let r=null;e.children.forEach(n=>{r!==null&&t.call(this,r),this.node(n),r=n});return}e.children.forEach(this.node,this)}function Fi(e){Bt(e,(t,r,n)=>{this.token(t,e.slice(r,n))})}function cr(e){let t=new Map;for(let[r,n]of Object.entries(e.node))typeof(n.generate||n)=="function"&&t.set(r,n.generate||n);return function(r,n){let s="",o=0,a={node(l){if(t.has(l.type))t.get(l.type).call(h,l);else throw new Error("Unknown node type: "+l.type)},tokenBefore:fe,token(l,i){o=this.tokenBefore(o,l,i),this.emit(i,l,!1),l===9&&i.charCodeAt(0)===Di&&this.emit(` +`,13,!0)},emit(l){s+=l},result(){return s}};n&&(typeof n.decorator=="function"&&(a=n.decorator(a)),n.sourceMap&&(a=sr(a)),n.mode in Ht&&(a.tokenBefore=Ht[n.mode]));let h={node:l=>a.node(l),children:Pi,token:(l,i)=>a.token(l,i),tokenize:Fi};return a.node(r),a.result()}}var Se={};vt(Se,{AnPlusB:()=>hr,Atrule:()=>ur,AtrulePrelude:()=>fr,AttributeSelector:()=>dr,Block:()=>xr,Brackets:()=>kr,CDC:()=>Sr,CDO:()=>gr,ClassSelector:()=>yr,Combinator:()=>Tr,Comment:()=>vr,Condition:()=>Er,Declaration:()=>wr,DeclarationList:()=>Ar,Dimension:()=>Nr,Feature:()=>Ir,FeatureFunction:()=>Dr,FeatureRange:()=>Pr,Function:()=>Fr,GeneralEnclosed:()=>Rr,Hash:()=>Or,IdSelector:()=>Ur,Identifier:()=>Mr,Layer:()=>Wr,LayerList:()=>Vr,MediaQuery:()=>Hr,MediaQueryList:()=>Gr,NestingSelector:()=>Yr,Nth:()=>zr,Number:()=>Kr,Operator:()=>$r,Parentheses:()=>Xr,Percentage:()=>Zr,PseudoClassSelector:()=>en,PseudoElementSelector:()=>nn,Ratio:()=>sn,Raw:()=>an,Rule:()=>cn,Scope:()=>ln,Selector:()=>un,SelectorList:()=>pn,String:()=>Sn,StyleSheet:()=>gn,SupportsDeclaration:()=>Cn,TypeSelector:()=>Ln,UnicodeRange:()=>Tn,Url:()=>En,Value:()=>wn,WhiteSpace:()=>An});var Y=43,_=45,Gt=110,st=!0,Ri=!1;function qt(e,t){let r=this.tokenStart+e,n=this.charCodeAt(r);for((n===Y||n===_)&&(t&&this.error("Number sign is not allowed"),r++);r0&&this.skip(e),t===0&&(r=this.charCodeAt(this.tokenStart),r!==Y&&r!==_&&this.error("Number sign is expected")),pt.call(this,t!==0),t===_?"-"+this.consume(10):this.consume(10)}function lr(){let e=this.tokenStart,t=null,r=null;if(this.tokenType===10)pt.call(this,Ri),r=this.consume(10);else if(this.tokenType===1&&this.cmpChar(this.tokenStart,_))switch(t="-1",Z.call(this,1,Gt),this.tokenEnd-this.tokenStart){case 2:this.next(),r=pe.call(this);break;case 3:Z.call(this,2,_),this.next(),this.skipSC(),pt.call(this,st),r="-"+this.consume(10);break;default:Z.call(this,2,_),qt.call(this,3,st),this.next(),r=this.substrToCursor(e+2)}else if(this.tokenType===1||this.isDelim(Y)&&this.lookupType(1)===1){let n=0;switch(t="1",this.isDelim(Y)&&(n=1,this.next()),Z.call(this,0,Gt),this.tokenEnd-this.tokenStart){case 1:this.next(),r=pe.call(this);break;case 2:Z.call(this,1,_),this.next(),this.skipSC(),pt.call(this,st),r="-"+this.consume(10);break;default:Z.call(this,1,_),qt.call(this,2,st),this.next(),r=this.substrToCursor(e+n+1)}}else if(this.tokenType===12){let n=this.charCodeAt(this.tokenStart),s=n===Y||n===_,o=this.tokenStart+s;for(;o{t.type==="Declaration"&&this.token(17,";")})}function kr(e){this.token(9,"["),this.children(e),this.token(9,"]")}function Sr(){this.token(15,"-->")}function gr(){this.token(14,"\n\n return {\n type: 'CDC',\n loc: this.getLocation(start, this.tokenStart)\n };\n}\n\nexport function generate() {\n this.token(CDC, '-->');\n}\n", "import { CDO } from '../../tokenizer/index.js';\n\nexport const name = 'CDO';\nexport const structure = [];\n\nexport function parse() {\n const start = this.tokenStart;\n\n this.eat(CDO); // \n child = this.CDC();\n break;\n\n // CSS Syntax Module Level 3\n // \u00A72.2 Error handling\n // At the \"top level\" of a stylesheet, an starts an at-rule.\n case AtKeyword:\n child = this.parseWithFallback(this.Atrule, consumeRaw);\n break;\n\n // Anything else starts a qualified rule ...\n default:\n child = this.parseWithFallback(this.Rule, consumeRaw);\n }\n\n children.push(child);\n }\n\n return {\n type: 'StyleSheet',\n loc: this.getLocation(start, this.tokenStart),\n children\n };\n}\n\nexport function generate(node) {\n this.children(node);\n}\n", "import {\n LeftParenthesis,\n RightParenthesis\n} from '../../tokenizer/index.js';\n\nexport const name = 'SupportsDeclaration';\nexport const structure = {\n declaration: 'Declaration'\n};\n\nexport function parse() {\n const start = this.tokenStart;\n\n this.eat(LeftParenthesis);\n this.skipSC();\n\n const declaration = this.Declaration();\n\n if (!this.eof) {\n this.eat(RightParenthesis);\n }\n\n return {\n type: 'SupportsDeclaration',\n loc: this.getLocation(start, this.tokenStart),\n declaration\n };\n}\n\nexport function generate(node) {\n this.token(LeftParenthesis, '(');\n this.node(node.declaration);\n this.token(RightParenthesis, ')');\n}\n", "import { Ident } from '../../tokenizer/index.js';\n\nconst ASTERISK = 0x002A; // U+002A ASTERISK (*)\nconst VERTICALLINE = 0x007C; // U+007C VERTICAL LINE (|)\n\nfunction eatIdentifierOrAsterisk() {\n if (this.tokenType !== Ident &&\n this.isDelim(ASTERISK) === false) {\n this.error('Identifier or asterisk is expected');\n }\n\n this.next();\n}\n\nexport const name = 'TypeSelector';\nexport const structure = {\n name: String\n};\n\n// ident\n// ident|ident\n// ident|*\n// *\n// *|ident\n// *|*\n// |ident\n// |*\nexport function parse() {\n const start = this.tokenStart;\n\n if (this.isDelim(VERTICALLINE)) {\n this.next();\n eatIdentifierOrAsterisk.call(this);\n } else {\n eatIdentifierOrAsterisk.call(this);\n\n if (this.isDelim(VERTICALLINE)) {\n this.next();\n eatIdentifierOrAsterisk.call(this);\n }\n }\n\n return {\n type: 'TypeSelector',\n loc: this.getLocation(start, this.tokenStart),\n name: this.substrToCursor(start)\n };\n}\n\nexport function generate(node) {\n this.tokenize(node.name);\n}\n", "import {\n isHexDigit,\n Ident,\n Number,\n Dimension\n} from '../../tokenizer/index.js';\n\nconst PLUSSIGN = 0x002B; // U+002B PLUS SIGN (+)\nconst HYPHENMINUS = 0x002D; // U+002D HYPHEN-MINUS (-)\nconst QUESTIONMARK = 0x003F; // U+003F QUESTION MARK (?)\n\nfunction eatHexSequence(offset, allowDash) {\n let len = 0;\n\n for (let pos = this.tokenStart + offset; pos < this.tokenEnd; pos++) {\n const code = this.charCodeAt(pos);\n\n if (code === HYPHENMINUS && allowDash && len !== 0) {\n eatHexSequence.call(this, offset + len + 1, false);\n return -1;\n }\n\n if (!isHexDigit(code)) {\n this.error(\n allowDash && len !== 0\n ? 'Hyphen minus' + (len < 6 ? ' or hex digit' : '') + ' is expected'\n : (len < 6 ? 'Hex digit is expected' : 'Unexpected input'),\n pos\n );\n }\n\n if (++len > 6) {\n this.error('Too many hex digits', pos);\n };\n }\n\n this.next();\n return len;\n}\n\nfunction eatQuestionMarkSequence(max) {\n let count = 0;\n\n while (this.isDelim(QUESTIONMARK)) {\n if (++count > max) {\n this.error('Too many question marks');\n }\n\n this.next();\n }\n}\n\nfunction startsWith(code) {\n if (this.charCodeAt(this.tokenStart) !== code) {\n this.error((code === PLUSSIGN ? 'Plus sign' : 'Hyphen minus') + ' is expected');\n }\n}\n\n// https://drafts.csswg.org/css-syntax/#urange\n// Informally, the production has three forms:\n// U+0001\n// Defines a range consisting of a single code point, in this case the code point \"1\".\n// U+0001-00ff\n// Defines a range of codepoints between the first and the second value, in this case\n// the range between \"1\" and \"ff\" (255 in decimal) inclusive.\n// U+00??\n// Defines a range of codepoints where the \"?\" characters range over all hex digits,\n// in this case defining the same as the value U+0000-00ff.\n// In each form, a maximum of 6 digits is allowed for each hexadecimal number (if you treat \"?\" as a hexadecimal digit).\n//\n// =\n// u '+' '?'* |\n// u '?'* |\n// u '?'* |\n// u |\n// u |\n// u '+' '?'+\nfunction scanUnicodeRange() {\n let hexLength = 0;\n\n switch (this.tokenType) {\n case Number:\n // u '?'*\n // u \n // u \n hexLength = eatHexSequence.call(this, 1, true);\n\n if (this.isDelim(QUESTIONMARK)) {\n eatQuestionMarkSequence.call(this, 6 - hexLength);\n break;\n }\n\n if (this.tokenType === Dimension ||\n this.tokenType === Number) {\n startsWith.call(this, HYPHENMINUS);\n eatHexSequence.call(this, 1, false);\n break;\n }\n\n break;\n\n case Dimension:\n // u '?'*\n hexLength = eatHexSequence.call(this, 1, true);\n\n if (hexLength > 0) {\n eatQuestionMarkSequence.call(this, 6 - hexLength);\n }\n\n break;\n\n default:\n // u '+' '?'*\n // u '+' '?'+\n this.eatDelim(PLUSSIGN);\n\n if (this.tokenType === Ident) {\n hexLength = eatHexSequence.call(this, 0, true);\n if (hexLength > 0) {\n eatQuestionMarkSequence.call(this, 6 - hexLength);\n }\n break;\n }\n\n if (this.isDelim(QUESTIONMARK)) {\n this.next();\n eatQuestionMarkSequence.call(this, 5);\n break;\n }\n\n this.error('Hex digit or question mark is expected');\n }\n}\n\nexport const name = 'UnicodeRange';\nexport const structure = {\n value: String\n};\n\nexport function parse() {\n const start = this.tokenStart;\n\n // U or u\n this.eatIdent('u');\n scanUnicodeRange.call(this);\n\n return {\n type: 'UnicodeRange',\n loc: this.getLocation(start, this.tokenStart),\n value: this.substrToCursor(start)\n };\n}\n\nexport function generate(node) {\n this.tokenize(node.value);\n}\n", "import {\n isHexDigit,\n isWhiteSpace,\n isValidEscape,\n consumeEscaped,\n decodeEscaped\n} from '../tokenizer/index.js';\n\nconst SPACE = 0x0020; // U+0020 SPACE\nconst REVERSE_SOLIDUS = 0x005c; // U+005C REVERSE SOLIDUS (\\)\nconst QUOTATION_MARK = 0x0022; // \"\nconst APOSTROPHE = 0x0027; // '\nconst LEFTPARENTHESIS = 0x0028; // U+0028 LEFT PARENTHESIS (()\nconst RIGHTPARENTHESIS = 0x0029; // U+0029 RIGHT PARENTHESIS ())\n\nexport function decode(str) {\n const len = str.length;\n let start = 4; // length of \"url(\"\n let end = str.charCodeAt(len - 1) === RIGHTPARENTHESIS ? len - 2 : len - 1;\n let decoded = '';\n\n while (start < end && isWhiteSpace(str.charCodeAt(start))) {\n start++;\n }\n\n while (start < end && isWhiteSpace(str.charCodeAt(end))) {\n end--;\n }\n\n for (let i = start; i <= end; i++) {\n let code = str.charCodeAt(i);\n\n if (code === REVERSE_SOLIDUS) {\n // special case at the ending\n if (i === end) {\n // if the next input code point is EOF, do nothing\n // otherwise include last left parenthesis as escaped\n if (i !== len - 1) {\n decoded = str.substr(i + 1);\n }\n break;\n }\n\n code = str.charCodeAt(++i);\n\n // consume escaped\n if (isValidEscape(REVERSE_SOLIDUS, code)) {\n const escapeStart = i - 1;\n const escapeEnd = consumeEscaped(str, escapeStart);\n\n i = escapeEnd - 1;\n decoded += decodeEscaped(str.substring(escapeStart + 1, escapeEnd));\n } else {\n // \\r\\n\n if (code === 0x000d && str.charCodeAt(i + 1) === 0x000a) {\n i++;\n }\n }\n } else {\n decoded += str[i];\n }\n }\n\n return decoded;\n}\n\nexport function encode(str) {\n let encoded = '';\n let wsBeforeHexIsNeeded = false;\n\n for (let i = 0; i < str.length; i++) {\n const code = str.charCodeAt(i);\n\n // If the character is NULL (U+0000), then the REPLACEMENT CHARACTER (U+FFFD).\n if (code === 0x0000) {\n encoded += '\\uFFFD';\n continue;\n }\n\n // If the character is in the range [\\1-\\1f] (U+0001 to U+001F) or is U+007F,\n // the character escaped as code point.\n // Note: Do not compare with 0x0001 since 0x0000 is precessed before\n if (code <= 0x001f || code === 0x007F) {\n encoded += '\\\\' + code.toString(16);\n wsBeforeHexIsNeeded = true;\n continue;\n }\n\n if (code === SPACE ||\n code === REVERSE_SOLIDUS ||\n code === QUOTATION_MARK ||\n code === APOSTROPHE ||\n code === LEFTPARENTHESIS ||\n code === RIGHTPARENTHESIS) {\n encoded += '\\\\' + str.charAt(i);\n wsBeforeHexIsNeeded = false;\n } else {\n if (wsBeforeHexIsNeeded && isHexDigit(code)) {\n encoded += ' ';\n }\n\n encoded += str.charAt(i);\n wsBeforeHexIsNeeded = false;\n }\n }\n\n return 'url(' + encoded + ')';\n}\n", "import * as url from '../../utils/url.js';\nimport * as string from '../../utils/string.js';\nimport {\n Function as FunctionToken,\n String as StringToken,\n Url,\n RightParenthesis\n} from '../../tokenizer/index.js';\n\nexport const name = 'Url';\nexport const structure = {\n value: String\n};\n\n// | )\nexport function parse() {\n const start = this.tokenStart;\n let value;\n\n switch (this.tokenType) {\n case Url:\n value = url.decode(this.consume(Url));\n break;\n\n case FunctionToken:\n if (!this.cmpStr(this.tokenStart, this.tokenEnd, 'url(')) {\n this.error('Function name must be `url`');\n }\n\n this.eat(FunctionToken);\n this.skipSC();\n value = string.decode(this.consume(StringToken));\n this.skipSC();\n if (!this.eof) {\n this.eat(RightParenthesis);\n }\n break;\n\n default:\n this.error('Url or Function is expected');\n }\n\n return {\n type: 'Url',\n loc: this.getLocation(start, this.tokenStart),\n value\n };\n}\n\nexport function generate(node) {\n this.token(Url, url.encode(node.value));\n}\n", "export const name = 'Value';\nexport const structure = {\n children: [[]]\n};\n\nexport function parse() {\n const start = this.tokenStart;\n const children = this.readSequence(this.scope.Value);\n\n return {\n type: 'Value',\n loc: this.getLocation(start, this.tokenStart),\n children\n };\n}\n\nexport function generate(node) {\n this.children(node);\n}\n", "import { WhiteSpace } from '../../tokenizer/index.js';\n\nconst SPACE = Object.freeze({\n type: 'WhiteSpace',\n loc: null,\n value: ' '\n});\n\nexport const name = 'WhiteSpace';\nexport const structure = {\n value: String\n};\n\nexport function parse() {\n this.eat(WhiteSpace);\n return SPACE;\n\n // return {\n // type: 'WhiteSpace',\n // loc: this.getLocation(this.tokenStart, this.tokenEnd),\n // value: this.consume(WHITESPACE)\n // };\n}\n\nexport function generate(node) {\n this.token(WhiteSpace, node.value);\n}\n", "import * as node from '../node/index-generate.js';\n\nexport default {\n node\n};\n", "import { createGenerator } from './create.js';\nimport config from '../syntax/config/generator.js';\n\nexport default createGenerator(config);\n", "//\n// list\n// \u250C\u2500\u2500\u2500\u2500\u2500\u2500\u2510\n// \u250C\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u253C\u2500head \u2502\n// \u2502 \u2502 tail\u2500\u253C\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2510\n// \u2502 \u2514\u2500\u2500\u2500\u2500\u2500\u2500\u2518 \u2502\n// \u25BC \u25BC\n// item item item item\n// \u250C\u2500\u2500\u2500\u2500\u2500\u2500\u2510 \u250C\u2500\u2500\u2500\u2500\u2500\u2500\u2510 \u250C\u2500\u2500\u2500\u2500\u2500\u2500\u2510 \u250C\u2500\u2500\u2500\u2500\u2500\u2500\u2510\n// null \u25C0\u2500\u2500\u253C\u2500prev \u2502\u25C0\u2500\u2500\u2500\u253C\u2500prev \u2502\u25C0\u2500\u2500\u2500\u253C\u2500prev \u2502\u25C0\u2500\u2500\u2500\u253C\u2500prev \u2502\n// \u2502 next\u2500\u253C\u2500\u2500\u2500\u25B6\u2502 next\u2500\u253C\u2500\u2500\u2500\u25B6\u2502 next\u2500\u253C\u2500\u2500\u2500\u25B6\u2502 next\u2500\u253C\u2500\u2500\u25B6 null\n// \u251C\u2500\u2500\u2500\u2500\u2500\u2500\u2524 \u251C\u2500\u2500\u2500\u2500\u2500\u2500\u2524 \u251C\u2500\u2500\u2500\u2500\u2500\u2500\u2524 \u251C\u2500\u2500\u2500\u2500\u2500\u2500\u2524\n// \u2502 data \u2502 \u2502 data \u2502 \u2502 data \u2502 \u2502 data \u2502\n// \u2514\u2500\u2500\u2500\u2500\u2500\u2500\u2518 \u2514\u2500\u2500\u2500\u2500\u2500\u2500\u2518 \u2514\u2500\u2500\u2500\u2500\u2500\u2500\u2518 \u2514\u2500\u2500\u2500\u2500\u2500\u2500\u2518\n//\n\nlet releasedCursors = null;\n\nexport class List {\n static createItem(data) {\n return {\n prev: null,\n next: null,\n data\n };\n }\n\n constructor() {\n this.head = null;\n this.tail = null;\n this.cursor = null;\n }\n createItem(data) {\n return List.createItem(data);\n }\n\n // cursor helpers\n allocateCursor(prev, next) {\n let cursor;\n\n if (releasedCursors !== null) {\n cursor = releasedCursors;\n releasedCursors = releasedCursors.cursor;\n cursor.prev = prev;\n cursor.next = next;\n cursor.cursor = this.cursor;\n } else {\n cursor = {\n prev,\n next,\n cursor: this.cursor\n };\n }\n\n this.cursor = cursor;\n\n return cursor;\n }\n releaseCursor() {\n const { cursor } = this;\n\n this.cursor = cursor.cursor;\n cursor.prev = null;\n cursor.next = null;\n cursor.cursor = releasedCursors;\n releasedCursors = cursor;\n }\n updateCursors(prevOld, prevNew, nextOld, nextNew) {\n let { cursor } = this;\n\n while (cursor !== null) {\n if (cursor.prev === prevOld) {\n cursor.prev = prevNew;\n }\n\n if (cursor.next === nextOld) {\n cursor.next = nextNew;\n }\n\n cursor = cursor.cursor;\n }\n }\n *[Symbol.iterator]() {\n for (let cursor = this.head; cursor !== null; cursor = cursor.next) {\n yield cursor.data;\n }\n }\n\n // getters\n get size() {\n let size = 0;\n\n for (let cursor = this.head; cursor !== null; cursor = cursor.next) {\n size++;\n }\n\n return size;\n }\n get isEmpty() {\n return this.head === null;\n }\n get first() {\n return this.head && this.head.data;\n }\n get last() {\n return this.tail && this.tail.data;\n }\n\n // convertors\n fromArray(array) {\n let cursor = null;\n this.head = null;\n\n for (let data of array) {\n const item = List.createItem(data);\n\n if (cursor !== null) {\n cursor.next = item;\n } else {\n this.head = item;\n }\n\n item.prev = cursor;\n cursor = item;\n }\n\n this.tail = cursor;\n return this;\n }\n toArray() {\n return [...this];\n }\n toJSON() {\n return [...this];\n }\n\n // array-like methods\n forEach(fn, thisArg = this) {\n // push cursor\n const cursor = this.allocateCursor(null, this.head);\n\n while (cursor.next !== null) {\n const item = cursor.next;\n cursor.next = item.next;\n fn.call(thisArg, item.data, item, this);\n }\n\n // pop cursor\n this.releaseCursor();\n }\n forEachRight(fn, thisArg = this) {\n // push cursor\n const cursor = this.allocateCursor(this.tail, null);\n\n while (cursor.prev !== null) {\n const item = cursor.prev;\n cursor.prev = item.prev;\n fn.call(thisArg, item.data, item, this);\n }\n\n // pop cursor\n this.releaseCursor();\n }\n reduce(fn, initialValue, thisArg = this) {\n // push cursor\n let cursor = this.allocateCursor(null, this.head);\n let acc = initialValue;\n let item;\n\n while (cursor.next !== null) {\n item = cursor.next;\n cursor.next = item.next;\n\n acc = fn.call(thisArg, acc, item.data, item, this);\n }\n\n // pop cursor\n this.releaseCursor();\n\n return acc;\n }\n reduceRight(fn, initialValue, thisArg = this) {\n // push cursor\n let cursor = this.allocateCursor(this.tail, null);\n let acc = initialValue;\n let item;\n\n while (cursor.prev !== null) {\n item = cursor.prev;\n cursor.prev = item.prev;\n\n acc = fn.call(thisArg, acc, item.data, item, this);\n }\n\n // pop cursor\n this.releaseCursor();\n\n return acc;\n }\n some(fn, thisArg = this) {\n for (let cursor = this.head; cursor !== null; cursor = cursor.next) {\n if (fn.call(thisArg, cursor.data, cursor, this)) {\n return true;\n }\n }\n\n return false;\n }\n map(fn, thisArg = this) {\n const result = new List();\n\n for (let cursor = this.head; cursor !== null; cursor = cursor.next) {\n result.appendData(fn.call(thisArg, cursor.data, cursor, this));\n }\n\n return result;\n }\n filter(fn, thisArg = this) {\n const result = new List();\n\n for (let cursor = this.head; cursor !== null; cursor = cursor.next) {\n if (fn.call(thisArg, cursor.data, cursor, this)) {\n result.appendData(cursor.data);\n }\n }\n\n return result;\n }\n\n nextUntil(start, fn, thisArg = this) {\n if (start === null) {\n return;\n }\n\n // push cursor\n const cursor = this.allocateCursor(null, start);\n\n while (cursor.next !== null) {\n const item = cursor.next;\n cursor.next = item.next;\n if (fn.call(thisArg, item.data, item, this)) {\n break;\n }\n }\n\n // pop cursor\n this.releaseCursor();\n }\n prevUntil(start, fn, thisArg = this) {\n if (start === null) {\n return;\n }\n\n // push cursor\n const cursor = this.allocateCursor(start, null);\n\n while (cursor.prev !== null) {\n const item = cursor.prev;\n cursor.prev = item.prev;\n if (fn.call(thisArg, item.data, item, this)) {\n break;\n }\n }\n\n // pop cursor\n this.releaseCursor();\n }\n\n // mutation\n clear() {\n this.head = null;\n this.tail = null;\n }\n copy() {\n const result = new List();\n\n for (let data of this) {\n result.appendData(data);\n }\n\n return result;\n }\n prepend(item) {\n // head\n // ^\n // item\n this.updateCursors(null, item, this.head, item);\n\n // insert to the beginning of the list\n if (this.head !== null) {\n // new item <- first item\n this.head.prev = item;\n // new item -> first item\n item.next = this.head;\n } else {\n // if list has no head, then it also has no tail\n // in this case tail points to the new item\n this.tail = item;\n }\n\n // head always points to new item\n this.head = item;\n return this;\n }\n prependData(data) {\n return this.prepend(List.createItem(data));\n }\n append(item) {\n return this.insert(item);\n }\n appendData(data) {\n return this.insert(List.createItem(data));\n }\n insert(item, before = null) {\n if (before !== null) {\n // prev before\n // ^\n // item\n this.updateCursors(before.prev, item, before, item);\n\n if (before.prev === null) {\n // insert to the beginning of list\n if (this.head !== before) {\n throw new Error('before doesn\\'t belong to list');\n }\n // since head points to before therefore list doesn't empty\n // no need to check tail\n this.head = item;\n before.prev = item;\n item.next = before;\n this.updateCursors(null, item);\n } else {\n // insert between two items\n before.prev.next = item;\n item.prev = before.prev;\n before.prev = item;\n item.next = before;\n }\n } else {\n // tail\n // ^\n // item\n this.updateCursors(this.tail, item, null, item);\n\n // insert to the ending of the list\n if (this.tail !== null) {\n // last item -> new item\n this.tail.next = item;\n // last item <- new item\n item.prev = this.tail;\n } else {\n // if list has no tail, then it also has no head\n // in this case head points to new item\n this.head = item;\n }\n\n // tail always points to new item\n this.tail = item;\n }\n\n return this;\n }\n insertData(data, before) {\n return this.insert(List.createItem(data), before);\n }\n remove(item) {\n // item\n // ^\n // prev next\n this.updateCursors(item, item.prev, item, item.next);\n\n if (item.prev !== null) {\n item.prev.next = item.next;\n } else {\n if (this.head !== item) {\n throw new Error('item doesn\\'t belong to list');\n }\n\n this.head = item.next;\n }\n\n if (item.next !== null) {\n item.next.prev = item.prev;\n } else {\n if (this.tail !== item) {\n throw new Error('item doesn\\'t belong to list');\n }\n\n this.tail = item.prev;\n }\n\n item.prev = null;\n item.next = null;\n\n return item;\n }\n push(data) {\n this.insert(List.createItem(data));\n }\n pop() {\n return this.tail !== null ? this.remove(this.tail) : null;\n }\n unshift(data) {\n this.prepend(List.createItem(data));\n }\n shift() {\n return this.head !== null ? this.remove(this.head) : null;\n }\n prependList(list) {\n return this.insertList(list, this.head);\n }\n appendList(list) {\n return this.insertList(list);\n }\n insertList(list, before) {\n // ignore empty lists\n if (list.head === null) {\n return this;\n }\n\n if (before !== undefined && before !== null) {\n this.updateCursors(before.prev, list.tail, before, list.head);\n\n // insert in the middle of dist list\n if (before.prev !== null) {\n // before.prev <-> list.head\n before.prev.next = list.head;\n list.head.prev = before.prev;\n } else {\n this.head = list.head;\n }\n\n before.prev = list.tail;\n list.tail.next = before;\n } else {\n this.updateCursors(this.tail, list.tail, null, list.head);\n\n // insert to end of the list\n if (this.tail !== null) {\n // if destination list has a tail, then it also has a head,\n // but head doesn't change\n // dest tail -> source head\n this.tail.next = list.head;\n // dest tail <- source head\n list.head.prev = this.tail;\n } else {\n // if list has no a tail, then it also has no a head\n // in this case points head to new item\n this.head = list.head;\n }\n\n // tail always start point to new item\n this.tail = list.tail;\n }\n\n list.head = null;\n list.tail = null;\n return this;\n }\n replace(oldItem, newItemOrList) {\n if ('head' in newItemOrList) {\n this.insertList(newItemOrList, oldItem);\n } else {\n this.insert(newItemOrList, oldItem);\n }\n\n this.remove(oldItem);\n }\n}\n", "export function createCustomError(name, message) {\n // use Object.create(), because some VMs prevent setting line/column otherwise\n // (iOS Safari 10 even throws an exception)\n const error = Object.create(SyntaxError.prototype);\n const errorStack = new Error();\n\n return Object.assign(error, {\n name,\n message,\n get stack() {\n return (errorStack.stack || '').replace(/^(.+\\n){1,3}/, `${name}: ${message}\\n`);\n }\n });\n};\n", "import { createCustomError } from '../utils/create-custom-error.js';\n\nconst MAX_LINE_LENGTH = 100;\nconst OFFSET_CORRECTION = 60;\nconst TAB_REPLACEMENT = ' ';\n\nfunction sourceFragment({ source, line, column, baseLine, baseColumn }, extraLines) {\n function processLines(start, end) {\n return lines\n .slice(start, end)\n .map((line, idx) =>\n String(start + idx + 1).padStart(maxNumLength) + ' |' + line\n ).join('\\n');\n }\n\n const prelines = '\\n'.repeat(Math.max(baseLine - 1, 0));\n const precolumns = ' '.repeat(Math.max(baseColumn - 1, 0));\n const lines = (prelines + precolumns + source).split(/\\r\\n?|\\n|\\f/);\n const startLine = Math.max(1, line - extraLines) - 1;\n const endLine = Math.min(line + extraLines, lines.length + 1);\n const maxNumLength = Math.max(4, String(endLine).length) + 1;\n let cutLeft = 0;\n\n // column correction according to replaced tab before column\n column += (TAB_REPLACEMENT.length - 1) * (lines[line - 1].substr(0, column - 1).match(/\\t/g) || []).length;\n\n if (column > MAX_LINE_LENGTH) {\n cutLeft = column - OFFSET_CORRECTION + 3;\n column = OFFSET_CORRECTION - 2;\n }\n\n for (let i = startLine; i <= endLine; i++) {\n if (i >= 0 && i < lines.length) {\n lines[i] = lines[i].replace(/\\t/g, TAB_REPLACEMENT);\n lines[i] =\n (cutLeft > 0 && lines[i].length > cutLeft ? '\\u2026' : '') +\n lines[i].substr(cutLeft, MAX_LINE_LENGTH - 2) +\n (lines[i].length > cutLeft + MAX_LINE_LENGTH - 1 ? '\\u2026' : '');\n }\n }\n\n return [\n processLines(startLine, line),\n new Array(column + maxNumLength + 2).join('-') + '^',\n processLines(line, endLine)\n ].filter(Boolean)\n .join('\\n')\n .replace(/^(\\s+\\d+\\s+\\|\\n)+/, '')\n .replace(/\\n(\\s+\\d+\\s+\\|)+$/, '');\n}\n\nexport function SyntaxError(message, source, offset, line, column, baseLine = 1, baseColumn = 1) {\n const error = Object.assign(createCustomError('SyntaxError', message), {\n source,\n offset,\n line,\n column,\n sourceFragment(extraLines) {\n return sourceFragment({ source, line, column, baseLine, baseColumn }, isNaN(extraLines) ? 0 : extraLines);\n },\n get formattedMessage() {\n return (\n `Parse error: ${message}\\n` +\n sourceFragment({ source, line, column, baseLine, baseColumn }, 2)\n );\n }\n });\n\n return error;\n}\n", "import { WhiteSpace, Comment } from '../tokenizer/index.js';\n\nexport function readSequence(recognizer) {\n const children = this.createList();\n let space = false;\n const context = {\n recognizer\n };\n\n while (!this.eof) {\n switch (this.tokenType) {\n case Comment:\n this.next();\n continue;\n\n case WhiteSpace:\n space = true;\n this.next();\n continue;\n }\n\n let child = recognizer.getNode.call(this, context);\n\n if (child === undefined) {\n break;\n }\n\n if (space) {\n if (recognizer.onWhiteSpace) {\n recognizer.onWhiteSpace.call(this, child, children, context);\n }\n space = false;\n }\n\n children.push(child);\n }\n\n if (space && recognizer.onWhiteSpace) {\n recognizer.onWhiteSpace.call(this, null, children, context);\n }\n\n return children;\n};\n", "import { List } from '../utils/List.js';\nimport { SyntaxError } from './SyntaxError.js';\nimport {\n tokenize,\n OffsetToLocation,\n TokenStream,\n tokenNames,\n\n consumeNumber,\n findWhiteSpaceStart,\n cmpChar,\n cmpStr,\n\n WhiteSpace,\n Comment,\n Ident,\n Function as FunctionToken,\n Url,\n Hash,\n Percentage,\n Number as NumberToken\n} from '../tokenizer/index.js';\nimport { readSequence } from './sequence.js';\n\nconst NOOP = () => {};\nconst EXCLAMATIONMARK = 0x0021; // U+0021 EXCLAMATION MARK (!)\nconst NUMBERSIGN = 0x0023; // U+0023 NUMBER SIGN (#)\nconst SEMICOLON = 0x003B; // U+003B SEMICOLON (;)\nconst LEFTCURLYBRACKET = 0x007B; // U+007B LEFT CURLY BRACKET ({)\nconst NULL = 0;\n\nfunction createParseContext(name) {\n return function() {\n return this[name]();\n };\n}\n\nfunction fetchParseValues(dict) {\n const result = Object.create(null);\n\n for (const name of Object.keys(dict)) {\n const item = dict[name];\n const fn = item.parse || item;\n\n if (fn) {\n result[name] = fn;\n }\n }\n\n return result;\n}\n\nfunction processConfig(config) {\n const parseConfig = {\n context: Object.create(null),\n features: Object.assign(Object.create(null), config.features),\n scope: Object.assign(Object.create(null), config.scope),\n atrule: fetchParseValues(config.atrule),\n pseudo: fetchParseValues(config.pseudo),\n node: fetchParseValues(config.node)\n };\n\n for (const [name, context] of Object.entries(config.parseContext)) {\n switch (typeof context) {\n case 'function':\n parseConfig.context[name] = context;\n break;\n\n case 'string':\n parseConfig.context[name] = createParseContext(context);\n break;\n }\n }\n\n return {\n config: parseConfig,\n ...parseConfig,\n ...parseConfig.node\n };\n}\n\nexport function createParser(config) {\n let source = '';\n let filename = '';\n let needPositions = false;\n let onParseError = NOOP;\n let onParseErrorThrow = false;\n\n const locationMap = new OffsetToLocation();\n const parser = Object.assign(new TokenStream(), processConfig(config || {}), {\n parseAtrulePrelude: true,\n parseRulePrelude: true,\n parseValue: true,\n parseCustomProperty: false,\n\n readSequence,\n\n consumeUntilBalanceEnd: () => 0,\n consumeUntilLeftCurlyBracket(code) {\n return code === LEFTCURLYBRACKET ? 1 : 0;\n },\n consumeUntilLeftCurlyBracketOrSemicolon(code) {\n return code === LEFTCURLYBRACKET || code === SEMICOLON ? 1 : 0;\n },\n consumeUntilExclamationMarkOrSemicolon(code) {\n return code === EXCLAMATIONMARK || code === SEMICOLON ? 1 : 0;\n },\n consumeUntilSemicolonIncluded(code) {\n return code === SEMICOLON ? 2 : 0;\n },\n\n createList() {\n return new List();\n },\n createSingleNodeList(node) {\n return new List().appendData(node);\n },\n getFirstListNode(list) {\n return list && list.first;\n },\n getLastListNode(list) {\n return list && list.last;\n },\n\n parseWithFallback(consumer, fallback) {\n const startIndex = this.tokenIndex;\n\n try {\n return consumer.call(this);\n } catch (e) {\n if (onParseErrorThrow) {\n throw e;\n }\n\n this.skip(startIndex - this.tokenIndex);\n const fallbackNode = fallback.call(this);\n\n onParseErrorThrow = true;\n onParseError(e, fallbackNode);\n onParseErrorThrow = false;\n\n return fallbackNode;\n }\n },\n\n lookupNonWSType(offset) {\n let type;\n\n do {\n type = this.lookupType(offset++);\n if (type !== WhiteSpace && type !== Comment) {\n return type;\n }\n } while (type !== NULL);\n\n return NULL;\n },\n\n charCodeAt(offset) {\n return offset >= 0 && offset < source.length ? source.charCodeAt(offset) : 0;\n },\n substring(offsetStart, offsetEnd) {\n return source.substring(offsetStart, offsetEnd);\n },\n substrToCursor(start) {\n return this.source.substring(start, this.tokenStart);\n },\n\n cmpChar(offset, charCode) {\n return cmpChar(source, offset, charCode);\n },\n cmpStr(offsetStart, offsetEnd, str) {\n return cmpStr(source, offsetStart, offsetEnd, str);\n },\n\n consume(tokenType) {\n const start = this.tokenStart;\n\n this.eat(tokenType);\n\n return this.substrToCursor(start);\n },\n consumeFunctionName() {\n const name = source.substring(this.tokenStart, this.tokenEnd - 1);\n\n this.eat(FunctionToken);\n\n return name;\n },\n consumeNumber(type) {\n const number = source.substring(this.tokenStart, consumeNumber(source, this.tokenStart));\n\n this.eat(type);\n\n return number;\n },\n\n eat(tokenType) {\n if (this.tokenType !== tokenType) {\n const tokenName = tokenNames[tokenType].slice(0, -6).replace(/-/g, ' ').replace(/^./, m => m.toUpperCase());\n let message = `${/[[\\](){}]/.test(tokenName) ? `\"${tokenName}\"` : tokenName} is expected`;\n let offset = this.tokenStart;\n\n // tweak message and offset\n switch (tokenType) {\n case Ident:\n // when identifier is expected but there is a function or url\n if (this.tokenType === FunctionToken || this.tokenType === Url) {\n offset = this.tokenEnd - 1;\n message = 'Identifier is expected but function found';\n } else {\n message = 'Identifier is expected';\n }\n break;\n\n case Hash:\n if (this.isDelim(NUMBERSIGN)) {\n this.next();\n offset++;\n message = 'Name is expected';\n }\n break;\n\n case Percentage:\n if (this.tokenType === NumberToken) {\n offset = this.tokenEnd;\n message = 'Percent sign is expected';\n }\n break;\n }\n\n this.error(message, offset);\n }\n\n this.next();\n },\n eatIdent(name) {\n if (this.tokenType !== Ident || this.lookupValue(0, name) === false) {\n this.error(`Identifier \"${name}\" is expected`);\n }\n\n this.next();\n },\n eatDelim(code) {\n if (!this.isDelim(code)) {\n this.error(`Delim \"${String.fromCharCode(code)}\" is expected`);\n }\n\n this.next();\n },\n\n getLocation(start, end) {\n if (needPositions) {\n return locationMap.getLocationRange(\n start,\n end,\n filename\n );\n }\n\n return null;\n },\n getLocationFromList(list) {\n if (needPositions) {\n const head = this.getFirstListNode(list);\n const tail = this.getLastListNode(list);\n return locationMap.getLocationRange(\n head !== null ? head.loc.start.offset - locationMap.startOffset : this.tokenStart,\n tail !== null ? tail.loc.end.offset - locationMap.startOffset : this.tokenStart,\n filename\n );\n }\n\n return null;\n },\n\n error(message, offset) {\n const location = typeof offset !== 'undefined' && offset < source.length\n ? locationMap.getLocation(offset)\n : this.eof\n ? locationMap.getLocation(findWhiteSpaceStart(source, source.length - 1))\n : locationMap.getLocation(this.tokenStart);\n\n throw new SyntaxError(\n message || 'Unexpected input',\n source,\n location.offset,\n location.line,\n location.column,\n locationMap.startLine,\n locationMap.startColumn\n );\n }\n });\n\n const parse = function(source_, options) {\n source = source_;\n options = options || {};\n\n parser.setSource(source, tokenize);\n locationMap.setSource(\n source,\n options.offset,\n options.line,\n options.column\n );\n\n filename = options.filename || '';\n needPositions = Boolean(options.positions);\n onParseError = typeof options.onParseError === 'function' ? options.onParseError : NOOP;\n onParseErrorThrow = false;\n\n parser.parseAtrulePrelude = 'parseAtrulePrelude' in options ? Boolean(options.parseAtrulePrelude) : true;\n parser.parseRulePrelude = 'parseRulePrelude' in options ? Boolean(options.parseRulePrelude) : true;\n parser.parseValue = 'parseValue' in options ? Boolean(options.parseValue) : true;\n parser.parseCustomProperty = 'parseCustomProperty' in options ? Boolean(options.parseCustomProperty) : false;\n\n const { context = 'default', onComment } = options;\n\n if (context in parser.context === false) {\n throw new Error('Unknown context `' + context + '`');\n }\n\n if (typeof onComment === 'function') {\n parser.forEachToken((type, start, end) => {\n if (type === Comment) {\n const loc = parser.getLocation(start, end);\n const value = cmpStr(source, end - 2, end, '*/')\n ? source.slice(start + 2, end - 2)\n : source.slice(start + 2, end);\n\n onComment(value, loc);\n }\n });\n }\n\n const ast = parser.context[context].call(parser, options);\n\n if (!parser.eof) {\n parser.error();\n }\n\n return ast;\n };\n\n return Object.assign(parse, {\n SyntaxError,\n config: parser.config\n });\n};\n", "import {\n Delim,\n Ident,\n Dimension,\n Percentage,\n Number as NumberToken,\n Hash,\n Colon,\n LeftSquareBracket\n} from '../../tokenizer/index.js';\n\nconst NUMBERSIGN = 0x0023; // U+0023 NUMBER SIGN (#)\nconst AMPERSAND = 0x0026; // U+0026 AMPERSAND (&)\nconst ASTERISK = 0x002A; // U+002A ASTERISK (*)\nconst PLUSSIGN = 0x002B; // U+002B PLUS SIGN (+)\nconst SOLIDUS = 0x002F; // U+002F SOLIDUS (/)\nconst FULLSTOP = 0x002E; // U+002E FULL STOP (.)\nconst GREATERTHANSIGN = 0x003E; // U+003E GREATER-THAN SIGN (>)\nconst VERTICALLINE = 0x007C; // U+007C VERTICAL LINE (|)\nconst TILDE = 0x007E; // U+007E TILDE (~)\n\nfunction onWhiteSpace(next, children) {\n if (children.last !== null && children.last.type !== 'Combinator' &&\n next !== null && next.type !== 'Combinator') {\n children.push({ // FIXME: this.Combinator() should be used instead\n type: 'Combinator',\n loc: null,\n name: ' '\n });\n }\n}\n\nfunction getNode() {\n switch (this.tokenType) {\n case LeftSquareBracket:\n return this.AttributeSelector();\n\n case Hash:\n return this.IdSelector();\n\n case Colon:\n if (this.lookupType(1) === Colon) {\n return this.PseudoElementSelector();\n } else {\n return this.PseudoClassSelector();\n }\n\n case Ident:\n return this.TypeSelector();\n\n case NumberToken:\n case Percentage:\n return this.Percentage();\n\n case Dimension:\n // throws when .123ident\n if (this.charCodeAt(this.tokenStart) === FULLSTOP) {\n this.error('Identifier is expected', this.tokenStart + 1);\n }\n break;\n\n case Delim: {\n const code = this.charCodeAt(this.tokenStart);\n\n switch (code) {\n case PLUSSIGN:\n case GREATERTHANSIGN:\n case TILDE:\n case SOLIDUS: // /deep/\n return this.Combinator();\n\n case FULLSTOP:\n return this.ClassSelector();\n\n case ASTERISK:\n case VERTICALLINE:\n return this.TypeSelector();\n\n case NUMBERSIGN:\n return this.IdSelector();\n\n case AMPERSAND:\n return this.NestingSelector();\n }\n\n break;\n }\n }\n};\n\nexport default {\n onWhiteSpace,\n getNode\n};\n", "import { Comma, String as StringToken, Ident, RightParenthesis } from '../../tokenizer/index.js';\n\nexport function parseLanguageRangeList() {\n const children = this.createList();\n\n this.skipSC();\n\n loop: while (!this.eof) {\n switch (this.tokenType) {\n case Ident:\n children.push(this.Identifier());\n break;\n\n case StringToken:\n children.push(this.String());\n break;\n\n case Comma:\n children.push(this.Operator());\n break;\n\n case RightParenthesis:\n break loop;\n\n default:\n this.error('Identifier, string or comma is expected');\n }\n\n this.skipSC();\n }\n\n return children;\n}\n", "import { parseLanguageRangeList } from './lang.js';\n\nconst selectorList = {\n parse() {\n return this.createSingleNodeList(\n this.SelectorList()\n );\n }\n};\n\nconst selector = {\n parse() {\n return this.createSingleNodeList(\n this.Selector()\n );\n }\n};\n\nconst identList = {\n parse() {\n return this.createSingleNodeList(\n this.Identifier()\n );\n }\n};\n\nconst langList = {\n parse: parseLanguageRangeList\n};\n\nconst nth = {\n parse() {\n return this.createSingleNodeList(\n this.Nth()\n );\n }\n};\n\nexport default {\n 'dir': identList,\n 'has': selectorList,\n 'lang': langList,\n 'matches': selectorList,\n 'is': selectorList,\n '-moz-any': selectorList,\n '-webkit-any': selectorList,\n 'where': selectorList,\n 'not': selectorList,\n 'nth-child': nth,\n 'nth-last-child': nth,\n 'nth-last-of-type': nth,\n 'nth-of-type': nth,\n 'slotted': selector,\n 'host': selector,\n 'host-context': selector\n};\n", "export { parse as AnPlusB } from './AnPlusB.js';\nexport { parse as AttributeSelector } from './AttributeSelector.js';\nexport { parse as ClassSelector } from './ClassSelector.js';\nexport { parse as Combinator } from './Combinator.js';\nexport { parse as Identifier } from './Identifier.js';\nexport { parse as IdSelector } from './IdSelector.js';\nexport { parse as NestingSelector } from './NestingSelector.js';\nexport { parse as Nth } from './Nth.js';\nexport { parse as Operator } from './Operator.js';\nexport { parse as Percentage } from './Percentage.js';\nexport { parse as PseudoClassSelector } from './PseudoClassSelector.js';\nexport { parse as PseudoElementSelector } from './PseudoElementSelector.js';\nexport { parse as Raw } from './Raw.js';\nexport { parse as Selector } from './Selector.js';\nexport { parse as SelectorList } from './SelectorList.js';\nexport { parse as String } from './String.js';\nexport { parse as TypeSelector } from './TypeSelector.js';\n", "import { Selector } from '../scope/index.js';\nimport pseudo from '../pseudo/index.js';\nimport * as node from '../node/index-parse-selector.js';\n\nexport default {\n parseContext: {\n default: 'SelectorList',\n selectorList: 'SelectorList',\n selector: 'Selector'\n },\n scope: { Selector },\n atrule: {},\n pseudo,\n node\n};\n", "import { createParser } from './create.js';\nimport config from '../syntax/config/parser-selector.js';\n\nexport default createParser(config);\n", "const compare = (s1, s2) => {\n if (s1.a === s2.a) {\n if (s1.b === s2.b) {\n return s1.c - s2.c;\n }\n return s1.b - s2.b;\n }\n return s1.a - s2.a;\n};\n\nconst equals = (s1, s2) => {\n return compare(s1, s2) === 0;\n};\n\nconst greaterThan = (s1, s2) => {\n return compare(s1, s2) > 0;\n};\n\nconst lessThan = (s1, s2) => {\n return compare(s1, s2) < 0;\n};\n\nexport { compare, equals, greaterThan, lessThan };\n", "import { compare } from './compare.js';\n\nconst sort = (specificities, order = 'ASC') => {\n const sorted = specificities.sort(compare);\n\n if (order === 'DESC') {\n return sorted.reverse();\n }\n\n return sorted;\n};\n\nconst sortAsc = (...specificities) => {\n return sort(specificities, 'ASC');\n};\n\nconst sortDesc = (...specificities) => {\n return sort(specificities, 'DESC');\n};\n\nexport { sortAsc, sortDesc };\n", "import { sortAsc, sortDesc } from './sort.js';\n\nconst max = (...specificities) => {\n const sorted = sortDesc(...specificities);\n return sorted[0];\n};\n\nconst min = (...specificities) => {\n const sorted = sortAsc(...specificities);\n return sorted[0];\n};\n\nexport { max, min };\n", "import parse from 'css-tree/selector-parser';\nimport Specificity from '../index.js';\nimport { max } from './../util/index.js';\n\n/** @param {import('css-tree').Selector} selectorAST */\nconst calculateForAST = (selectorAST) => {\n // Quit while you're ahead\n if (!selectorAST || selectorAST.type !== 'Selector') {\n throw new TypeError(`Passed in source is not a Selector AST`);\n }\n\n // https://www.w3.org/TR/selectors-4/#specificity-rules\n let a = 0; /* ID Selectors */\n let b = 0; /* Class selectors, Attributes selectors, and Pseudo-classes */\n let c = 0; /* Type selectors and Pseudo-elements */\n\n selectorAST.children.forEach((child) => {\n switch (child.type) {\n case 'IdSelector':\n a += 1;\n break;\n\n case 'AttributeSelector':\n case 'ClassSelector':\n b += 1;\n break;\n\n case 'PseudoClassSelector':\n switch (child.name.toLowerCase()) {\n // \u201CThe specificity of a :where() pseudo-class is replaced by zero.\u201D\n case 'where':\n // Noop :)\n break;\n\n case '-webkit-any':\n case 'any':\n if (child.children?.first) {\n b += 1;\n }\n break;\n\n // \u201CThe specificity of an :is(), :not(), or :has() pseudo-class is replaced by the specificity of the most specific complex selector in its selector list argument.\u201C\n case '-moz-any':\n case 'is':\n case 'matches':\n case 'not':\n case 'has':\n if (child.children?.first) {\n // Calculate Specificity from nested SelectorList\n const max1 = max(...calculate(child.children.first));\n\n // Adjust orig specificity\n a += max1.a;\n b += max1.b;\n c += max1.c;\n }\n\n break;\n\n // \u201CThe specificity of an :nth-child() or :nth-last-child() selector is the specificity of the pseudo class itself (counting as one pseudo-class selector) plus the specificity of the most specific complex selector in its selector list argument\u201D\n case 'nth-child':\n case 'nth-last-child':\n b += 1;\n\n if (child.children?.first?.selector) {\n // Calculate Specificity from SelectorList\n const max2 = max(...calculate(child.children.first.selector));\n\n // Adjust orig specificity\n a += max2.a;\n b += max2.b;\n c += max2.c;\n }\n break;\n\n // \u201CThe specificity of :host is that of a pseudo-class. The specificity of :host() is that of a pseudo-class, plus the specificity of its argument.\u201D\n // \u201CThe specificity of :host-context() is that of a pseudo-class, plus the specificity of its argument.\u201D\n case 'host-context':\n case 'host':\n b += 1;\n\n if (child.children?.first?.children) {\n // Workaround to a css-tree bug in which it allows complex selectors instead of only compound selectors\n // We work around it by filtering out any Combinator and successive Selectors\n const childAST = { type: 'Selector', children: [] };\n let foundCombinator = false;\n child.children.first.children.forEach((entry) => {\n if (foundCombinator) return false;\n if (entry.type === 'Combinator') {\n foundCombinator = true;\n return false;\n }\n childAST.children.push(entry);\n });\n\n // Calculate Specificity from Selector\n const childSpecificity = calculate(childAST)[0];\n\n // Adjust orig specificity\n a += childSpecificity.a;\n b += childSpecificity.b;\n c += childSpecificity.c;\n }\n break;\n\n // Improper use of Pseudo-Class Selectors instead of a Pseudo-Element\n // @ref https://developer.mozilla.org/en-US/docs/Web/CSS/Pseudo-elements#index\n case 'after':\n case 'before':\n case 'first-letter':\n case 'first-line':\n c += 1;\n break;\n\n default:\n b += 1;\n break;\n }\n break;\n\n case 'PseudoElementSelector':\n switch (child.name) {\n // \u201CThe specificity of ::slotted() is that of a pseudo-element, plus the specificity of its argument.\u201D\n case 'slotted':\n c += 1;\n\n if (child.children?.first?.children) {\n // Workaround to a css-tree bug in which it allows complex selectors instead of only compound selectors\n // We work around it by filtering out any Combinator and successive Selectors\n const childAST = { type: 'Selector', children: [] };\n let foundCombinator = false;\n child.children.first.children.forEach((entry) => {\n if (foundCombinator) return false;\n if (entry.type === 'Combinator') {\n foundCombinator = true;\n return false;\n }\n childAST.children.push(entry);\n });\n\n // Calculate Specificity from Selector\n const childSpecificity = calculate(childAST)[0];\n\n // Adjust orig specificity\n a += childSpecificity.a;\n b += childSpecificity.b;\n c += childSpecificity.c;\n }\n break;\n\n case 'view-transition-group':\n case 'view-transition-image-pair':\n case 'view-transition-old':\n case 'view-transition-new':\n // The specificity of a view-transition selector with a * argument is zero.\n if (child.children?.first?.value === '*') {\n break;\n }\n // The specificity of a view-transition selector with an argument is the same\n // as for other pseudo - elements, and is equivalent to a type selector.\n c += 1;\n break;\n\n default:\n c += 1;\n break;\n }\n break;\n\n case 'TypeSelector':\n // Omit namespace\n let typeSelector = child.name;\n if (typeSelector.includes('|')) {\n typeSelector = typeSelector.split('|')[1];\n }\n\n // \u201CIgnore the universal selector\u201D\n if (typeSelector !== '*') {\n c += 1;\n }\n break;\n\n default:\n // NOOP\n break;\n }\n });\n\n return new Specificity({ a, b, c }, selectorAST);\n};\n\nconst convertToAST = (source) => {\n // The passed in argument was a String.\n // ~> Let's try and parse to an AST\n if (typeof source === 'string' || source instanceof String) {\n try {\n return parse(source, {\n context: 'selectorList',\n });\n } catch (e) {\n throw new TypeError(`Could not convert passed in source '${source}' to SelectorList: ${e.message}`);\n }\n }\n\n // The passed in argument was an Object.\n // ~> Let's verify if it's a AST of the type Selector or SelectorList\n if (source instanceof Object) {\n if (source.type && ['Selector', 'SelectorList'].includes(source.type)) {\n return source;\n }\n\n // Manually parsing subtree when the child is of the type Raw, most likely due to https://github.com/csstree/csstree/issues/151\n if (source.type && source.type === 'Raw') {\n try {\n return parse(source.value, {\n context: 'selectorList',\n });\n } catch (e) {\n throw new TypeError(`Could not convert passed in source to SelectorList: ${e.message}`);\n }\n }\n\n throw new TypeError(`Passed in source is an Object but no AST / AST of the type Selector or SelectorList`);\n }\n\n throw new TypeError(`Passed in source is not a String nor an Object. I don't know what to do with it.`);\n};\n\n/**\n * @param {string} selector\n * @returns {Specificity[]}\n */\nconst calculate = (selector) => {\n // Quit while you're ahead\n if (!selector) {\n return [];\n }\n\n // Make sure we have a SelectorList AST\n // If not, an exception will be thrown\n const ast = convertToAST(selector);\n\n // Selector?\n if (ast.type === 'Selector') {\n return [calculateForAST(selector)];\n }\n\n // SelectorList?\n // ~> Calculate Specificity for each contained Selector\n if (ast.type === 'SelectorList') {\n const specificities = [];\n ast.children.forEach((childAST) => {\n const specificity = calculateForAST(childAST);\n specificities.push(specificity);\n });\n return specificities;\n }\n};\n\nexport { calculate, calculateForAST };\n"], + "mappings": "wwBAAA,eAOA,GAAI,IAAe,mEAAmE,MAAM,IAK5F,GAAQ,OAAS,SAAU,EAAQ,CACjC,GAAI,GAAK,GAAU,EAAS,GAAa,OACvC,MAAO,IAAa,GAEtB,KAAM,IAAI,WAAU,6BAA+B,IAOrD,GAAQ,OAAS,SAAU,EAAU,CACnC,GAAI,GAAO,GACP,EAAO,GAEP,EAAU,GACV,EAAU,IAEV,EAAO,GACP,EAAO,GAEP,EAAO,GACP,EAAQ,GAER,EAAe,GACf,EAAe,GAGnB,MAAI,IAAQ,GAAY,GAAY,EAC1B,EAAW,EAIjB,GAAW,GAAY,GAAY,EAC7B,EAAW,EAAU,EAI3B,GAAQ,GAAY,GAAY,EAC1B,EAAW,EAAO,EAIxB,GAAY,EACP,GAIL,GAAY,EACP,GAIF,MCjET,eAqCA,GAAI,IAAS,KAcT,GAAiB,EAGjB,GAAW,GAAK,GAGhB,GAAgB,GAAW,EAG3B,GAAuB,GAQ3B,YAAqB,EAAQ,CAC3B,MAAO,GAAS,EACV,EAAC,GAAW,GAAK,EAClB,IAAU,GAAK,EAStB,YAAuB,EAAQ,CAC7B,GAAI,GAAc,GAAS,KAAO,EAC9B,EAAU,GAAU,EACxB,MAAO,GACH,CAAC,EACD,EAMN,GAAQ,OAAS,SAA0B,EAAQ,CACjD,GAAI,GAAU,GACV,EAEA,EAAM,GAAY,GAEtB,EACE,GAAQ,EAAM,GACd,KAAS,GACL,EAAM,GAGR,IAA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AGxB,cAAc,EAAkB,CAC5B,MAAO,IAAY,KAAM,GAG7B,WAAW,EAAkB,CACzB,MAAO,IAAS,KAAM,SAGnB,WAAU,EAAU,CACvB,MAAO,IAAU,SAGd,iBAAgB,EAAU,CAC7B,MAAO,IAAgB,SAGpB,SAAQ,EAAI,EAAI,CACnB,MAAO,IAAQ,EAAI,SAGhB,QAAO,EAAI,EAAI,CAClB,MAAO,IAAO,EAAI,SAGf,UAAS,EAAI,EAAI,CACpB,MAAO,IAAS,EAAI,SAGjB,aAAY,EAAI,EAAI,CACvB,MAAO,IAAY,EAAI,SAGpB,QAAO,EAAe,CACzB,MAAO,IAAI,GAAG,SAGX,QAAO,EAAe,CACzB,MAAO,IAAI,GAAG,SAGX,YAAW,EAAe,CAC7B,MAAO,IAAQ,GAAG,SAGf,aAAY,EAAe,CAC9B,MAAO,IAAS,GAAG,KAIpB,GAAQ", + "names": [] +} diff --git a/node_modules/@bramus/specificity/dist/index.js b/node_modules/@bramus/specificity/dist/index.js new file mode 100644 index 0000000000000000000000000000000000000000..b56a1f39a29f09e1f9502978480f06007505672d --- /dev/null +++ b/node_modules/@bramus/specificity/dist/index.js @@ -0,0 +1,8 @@ +var jn=Object.create;var Tt=Object.defineProperty;var zn=Object.getOwnPropertyDescriptor;var Kn=Object.getOwnPropertyNames;var Qn=Object.getPrototypeOf,$n=Object.prototype.hasOwnProperty;var Xn=e=>Tt(e,"__esModule",{value:!0});var lt=(e,t)=>()=>(t||e((t={exports:{}}).exports,t),t.exports),$t=(e,t)=>{for(var r in t)Tt(e,r,{get:t[r],enumerable:!0})},Jn=(e,t,r,n)=>{if(t&&typeof t=="object"||typeof t=="function")for(let s of Kn(t))!$n.call(e,s)&&(r||s!=="default")&&Tt(e,s,{get:()=>t[s],enumerable:!(n=zn(t,s))||n.enumerable});return e},Zn=(e,t)=>Jn(Xn(Tt(e!=null?jn(Qn(e)):{},"default",!t&&e&&e.__esModule?{get:()=>e.default,enumerable:!0}:{value:e,enumerable:!0})),e);var _e=lt(se=>{var Oe="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/".split("");se.encode=function(e){if(0<=e&&e{var Me=_e(),oe=5,Be=1<>1;return t?-r:r}ae.encode=function(t){var r="",n,s=ci(t);do n=s&Ue,s>>>=oe,s>0&&(n|=We),r+=Me.encode(n);while(s>0);return r};ae.decode=function(t,r,n){var s=t.length,o=0,a=0,h,l;do{if(r>=s)throw new Error("Expected more digits in base 64 VLQ value.");if(l=Me.decode(t.charCodeAt(r++)),l===-1)throw new Error("Invalid base64 digit: "+t.charAt(r-1));h=!!(l&We),l&=Ue,o=o+(l<{function hi(e,t,r){if(t in e)return e[t];if(arguments.length===3)return r;throw new Error('"'+t+'" is a required argument.')}N.getArg=hi;var He=/^(?:([\w+\-.]+):)?\/\/(?:(\w+:\w+)@)?([\w.-]*)(?::(\d+))?(.*)$/,ui=/^data:.+\,.+$/;function Ct(e){var t=e.match(He);return t?{scheme:t[1],auth:t[2],host:t[3],port:t[4],path:t[5]}:null}N.urlParse=Ct;function ft(e){var t="";return e.scheme&&(t+=e.scheme+":"),t+="//",e.auth&&(t+=e.auth+"@"),e.host&&(t+=e.host),e.port&&(t+=":"+e.port),e.path&&(t+=e.path),t}N.urlGenerate=ft;var fi=32;function pi(e){var t=[];return function(r){for(var n=0;nfi&&t.pop(),o}}var ce=pi(function(t){var r=t,n=Ct(t);if(n){if(!n.path)return t;r=n.path}for(var s=N.isAbsolute(r),o=[],a=0,h=0;;)if(a=h,h=r.indexOf("/",a),h===-1){o.push(r.slice(a));break}else for(o.push(r.slice(a,h));h=0;h--)l=o[h],l==="."?o.splice(h,1):l===".."?i++:i>0&&(l===""?(o.splice(h+1,i),i=0):(o.splice(h,2),i--));return r=o.join("/"),r===""&&(r=s?"/":"."),n?(n.path=r,ft(n)):r});N.normalize=ce;function Ge(e,t){e===""&&(e="."),t===""&&(t=".");var r=Ct(t),n=Ct(e);if(n&&(e=n.path||"/"),r&&!r.scheme)return n&&(r.scheme=n.scheme),ft(r);if(r||t.match(ui))return t;if(n&&!n.host&&!n.path)return n.host=t,ft(n);var s=t.charAt(0)==="/"?t:ce(e.replace(/\/+$/,"")+"/"+t);return n?(n.path=s,ft(n)):s}N.join=Ge;N.isAbsolute=function(e){return e.charAt(0)==="/"||He.test(e)};function mi(e,t){e===""&&(e="."),e=e.replace(/\/$/,"");for(var r=0;t.indexOf(e+"/")!==0;){var n=e.lastIndexOf("/");if(n<0||(e=e.slice(0,n),e.match(/^([^\/]+:\/)?\/*$/)))return t;++r}return Array(r+1).join("../")+t.substr(e.length+1)}N.relative=mi;var qe=function(){var e=Object.create(null);return!("__proto__"in e)}();function Ye(e){return e}function di(e){return je(e)?"$"+e:e}N.toSetString=qe?Ye:di;function xi(e){return je(e)?e.slice(1):e}N.fromSetString=qe?Ye:xi;function je(e){if(!e)return!1;var t=e.length;if(t<9||e.charCodeAt(t-1)!==95||e.charCodeAt(t-2)!==95||e.charCodeAt(t-3)!==111||e.charCodeAt(t-4)!==116||e.charCodeAt(t-5)!==111||e.charCodeAt(t-6)!==114||e.charCodeAt(t-7)!==112||e.charCodeAt(t-8)!==95||e.charCodeAt(t-9)!==95)return!1;for(var r=t-10;r>=0;r--)if(e.charCodeAt(r)!==36)return!1;return!0}function ki(e,t,r){var n=K(e.source,t.source);return n!==0||(n=e.originalLine-t.originalLine,n!==0)||(n=e.originalColumn-t.originalColumn,n!==0||r)||(n=e.generatedColumn-t.generatedColumn,n!==0)||(n=e.generatedLine-t.generatedLine,n!==0)?n:K(e.name,t.name)}N.compareByOriginalPositions=ki;function Si(e,t,r){var n;return n=e.originalLine-t.originalLine,n!==0||(n=e.originalColumn-t.originalColumn,n!==0||r)||(n=e.generatedColumn-t.generatedColumn,n!==0)||(n=e.generatedLine-t.generatedLine,n!==0)?n:K(e.name,t.name)}N.compareByOriginalPositionsNoSource=Si;function gi(e,t,r){var n=e.generatedLine-t.generatedLine;return n!==0||(n=e.generatedColumn-t.generatedColumn,n!==0||r)||(n=K(e.source,t.source),n!==0)||(n=e.originalLine-t.originalLine,n!==0)||(n=e.originalColumn-t.originalColumn,n!==0)?n:K(e.name,t.name)}N.compareByGeneratedPositionsDeflated=gi;function Ci(e,t,r){var n=e.generatedColumn-t.generatedColumn;return n!==0||r||(n=K(e.source,t.source),n!==0)||(n=e.originalLine-t.originalLine,n!==0)||(n=e.originalColumn-t.originalColumn,n!==0)?n:K(e.name,t.name)}N.compareByGeneratedPositionsDeflatedNoLine=Ci;function K(e,t){return e===t?0:e===null?1:t===null?-1:e>t?1:-1}function yi(e,t){var r=e.generatedLine-t.generatedLine;return r!==0||(r=e.generatedColumn-t.generatedColumn,r!==0)||(r=K(e.source,t.source),r!==0)||(r=e.originalLine-t.originalLine,r!==0)||(r=e.originalColumn-t.originalColumn,r!==0)?r:K(e.name,t.name)}N.compareByGeneratedPositionsInflated=yi;function bi(e){return JSON.parse(e.replace(/^\)]}'[^\n]*\n/,""))}N.parseSourceMapInput=bi;function Li(e,t,r){if(t=t||"",e&&(e[e.length-1]!=="/"&&t[0]!=="/"&&(e+="/"),t=e+t),r){var n=Ct(r);if(!n)throw new Error("sourceMapURL could not be parsed");if(n.path){var s=n.path.lastIndexOf("/");s>=0&&(n.path=n.path.substring(0,s+1))}t=Ge(ft(n),t)}return ce(t)}N.computeSourceURL=Li});var Ke=lt(ze=>{var le=Bt(),he=Object.prototype.hasOwnProperty,it=typeof Map<"u";function Q(){this._array=[],this._set=it?new Map:Object.create(null)}Q.fromArray=function(t,r){for(var n=new Q,s=0,o=t.length;s=0)return r}else{var n=le.toSetString(t);if(he.call(this._set,n))return this._set[n]}throw new Error('"'+t+'" is not in the set.')};Q.prototype.at=function(t){if(t>=0&&t{var Qe=Bt();function Ti(e,t){var r=e.generatedLine,n=t.generatedLine,s=e.generatedColumn,o=t.generatedColumn;return n>r||n==r&&o>=s||Qe.compareByGeneratedPositionsInflated(e,t)<=0}function Ut(){this._array=[],this._sorted=!0,this._last={generatedLine:-1,generatedColumn:0}}Ut.prototype.unsortedForEach=function(t,r){this._array.forEach(t,r)};Ut.prototype.add=function(t){Ti(this._last,t)?(this._last=t,this._array.push(t)):(this._sorted=!1,this._array.push(t))};Ut.prototype.toArray=function(){return this._sorted||(this._array.sort(Qe.compareByGeneratedPositionsInflated),this._sorted=!0),this._array};$e.MappingList=Ut});var Ze=lt(Je=>{var yt=Ve(),v=Bt(),Wt=Ke().ArraySet,vi=Xe().MappingList;function W(e){e||(e={}),this._file=v.getArg(e,"file",null),this._sourceRoot=v.getArg(e,"sourceRoot",null),this._skipValidation=v.getArg(e,"skipValidation",!1),this._sources=new Wt,this._names=new Wt,this._mappings=new vi,this._sourcesContents=null}W.prototype._version=3;W.fromSourceMap=function(t){var r=t.sourceRoot,n=new W({file:t.file,sourceRoot:r});return t.eachMapping(function(s){var o={generated:{line:s.generatedLine,column:s.generatedColumn}};s.source!=null&&(o.source=s.source,r!=null&&(o.source=v.relative(r,o.source)),o.original={line:s.originalLine,column:s.originalColumn},s.name!=null&&(o.name=s.name)),n.addMapping(o)}),t.sources.forEach(function(s){var o=s;r!==null&&(o=v.relative(r,s)),n._sources.has(o)||n._sources.add(o);var a=t.sourceContentFor(s);a!=null&&n.setSourceContent(s,a)}),n};W.prototype.addMapping=function(t){var r=v.getArg(t,"generated"),n=v.getArg(t,"original",null),s=v.getArg(t,"source",null),o=v.getArg(t,"name",null);this._skipValidation||this._validateMapping(r,n,s,o),s!=null&&(s=String(s),this._sources.has(s)||this._sources.add(s)),o!=null&&(o=String(o),this._names.has(o)||this._names.add(o)),this._mappings.add({generatedLine:r.line,generatedColumn:r.column,originalLine:n!=null&&n.line,originalColumn:n!=null&&n.column,source:s,name:o})};W.prototype.setSourceContent=function(t,r){var n=t;this._sourceRoot!=null&&(n=v.relative(this._sourceRoot,n)),r!=null?(this._sourcesContents||(this._sourcesContents=Object.create(null)),this._sourcesContents[v.toSetString(n)]=r):this._sourcesContents&&(delete this._sourcesContents[v.toSetString(n)],Object.keys(this._sourcesContents).length===0&&(this._sourcesContents=null))};W.prototype.applySourceMap=function(t,r,n){var s=r;if(r==null){if(t.file==null)throw new Error(`SourceMapGenerator.prototype.applySourceMap requires either an explicit source file, or the source map's "file" property. Both were omitted.`);s=t.file}var o=this._sourceRoot;o!=null&&(s=v.relative(o,s));var a=new Wt,h=new Wt;this._mappings.unsortedForEach(function(l){if(l.source===s&&l.originalLine!=null){var i=t.originalPositionFor({line:l.originalLine,column:l.originalColumn});i.source!=null&&(l.source=i.source,n!=null&&(l.source=v.join(n,l.source)),o!=null&&(l.source=v.relative(o,l.source)),l.originalLine=i.line,l.originalColumn=i.column,i.name!=null&&(l.name=i.name))}var c=l.source;c!=null&&!a.has(c)&&a.add(c);var f=l.name;f!=null&&!h.has(f)&&h.add(f)},this),this._sources=a,this._names=h,t.sources.forEach(function(l){var i=t.sourceContentFor(l);i!=null&&(n!=null&&(l=v.join(n,l)),o!=null&&(l=v.relative(o,l)),this.setSourceContent(l,i))},this)};W.prototype._validateMapping=function(t,r,n,s){if(r&&typeof r.line!="number"&&typeof r.column!="number")throw new Error("original.line and original.column are not numbers -- you probably meant to omit the original mapping entirely and only map the generated position. If so, pass null for the original mapping instead of an object with empty or null values.");if(!(t&&"line"in t&&"column"in t&&t.line>0&&t.column>=0&&!r&&!n&&!s)){if(t&&"line"in t&&"column"in t&&r&&"line"in r&&"column"in r&&t.line>0&&t.column>=0&&r.line>0&&r.column>=0&&n)return;throw new Error("Invalid mapping: "+JSON.stringify({generated:t,source:n,original:r,name:s}))}};W.prototype._serializeMappings=function(){for(var t=0,r=1,n=0,s=0,o=0,a=0,h="",l,i,c,f,k=this._mappings.toArray(),S=0,T=k.length;S0){if(!v.compareByGeneratedPositionsInflated(i,k[S-1]))continue;l+=","}l+=yt.encode(i.generatedColumn-t),t=i.generatedColumn,i.source!=null&&(f=this._sources.indexOf(i.source),l+=yt.encode(f-a),a=f,l+=yt.encode(i.originalLine-1-s),s=i.originalLine-1,l+=yt.encode(i.originalColumn-n),n=i.originalColumn,i.name!=null&&(c=this._names.indexOf(i.name),l+=yt.encode(c-o),o=c)),h+=l}return h};W.prototype._generateSourcesContent=function(t,r){return t.map(function(n){if(!this._sourcesContents)return null;r!=null&&(n=v.relative(r,n));var s=v.toSetString(n);return Object.prototype.hasOwnProperty.call(this._sourcesContents,s)?this._sourcesContents[s]:null},this)};W.prototype.toJSON=function(){var t={version:this._version,sources:this._sources.toArray(),names:this._names.toArray(),mappings:this._serializeMappings()};return this._file!=null&&(t.file=this._file),this._sourceRoot!=null&&(t.sourceRoot=this._sourceRoot),this._sourcesContents&&(t.sourcesContent=this._generateSourcesContent(t.sources,t.sourceRoot)),t};W.prototype.toString=function(){return JSON.stringify(this.toJSON())};Je.SourceMapGenerator=W});function I(e){return e>=48&&e<=57}function z(e){return I(e)||e>=65&&e<=70||e>=97&&e<=102}function Et(e){return e>=65&&e<=90}function ti(e){return e>=97&&e<=122}function ei(e){return Et(e)||ti(e)}function ri(e){return e>=128}function vt(e){return ei(e)||ri(e)||e===95}function wt(e){return vt(e)||I(e)||e===45}function ni(e){return e>=0&&e<=8||e===11||e>=14&&e<=31||e===127}function dt(e){return e===10||e===13||e===12}function $(e){return dt(e)||e===32||e===9}function R(e,t){return!(e!==92||dt(t)||t===0)}function At(e,t,r){return e===45?vt(t)||t===45||R(t,r):vt(e)?!0:e===92?R(e,t):!1}function Nt(e,t,r){return e===43||e===45?I(t)?2:t===46&&I(r)?3:0:e===46?I(t)?2:0:I(e)?1:0}function It(e){return e===65279||e===65534?1:0}var Xt=new Array(128),ii=128,xt=130,Jt=131,Dt=132,Zt=133;for(let e=0;ee.length)return!1;for(let s=t;s=0&&$(e.charCodeAt(t));t--);return t+1}function kt(e,t){for(;t=55296&&t<=57343||t>1114111)&&(t=65533),String.fromCodePoint(t)}var gt=["EOF-token","ident-token","function-token","at-keyword-token","hash-token","string-token","bad-string-token","url-token","bad-url-token","delim-token","number-token","percentage-token","dimension-token","whitespace-token","CDO-token","CDC-token","colon-token","semicolon-token","comma-token","[-token","]-token","(-token",")-token","{-token","}-token","comment-token"];function ut(e=null,t){return e===null||e.length0?It(t.charCodeAt(0)):0,s=ut(e.lines,r),o=ut(e.columns,r),a=e.startLine,h=e.startColumn;for(let l=n;l{}){t=String(t||"");let n=t.length,s=ut(this.offsetAndType,t.length+1),o=ut(this.balance,t.length+1),a=0,h=0,l=0,i=-1;for(this.offsetAndType=null,this.balance=null,r(t,(c,f,k)=>{switch(c){default:o[a]=n;break;case h:{let S=l&M;for(l=o[S],h=l>>V,o[a]=S,o[S++]=a;S>V:0}lookupTypeNonSC(t){for(let r=this.tokenIndex;r>V;if(n!==13&&n!==25&&t--===0)return n}return 0}lookupOffset(t){return t+=this.tokenIndex,t>V;if(n!==13&&n!==25&&t--===0)return r-this.tokenIndex}return 0}lookupValue(t,r){return t+=this.tokenIndex,t0?t>V,this.tokenEnd=r&M):(this.tokenIndex=this.tokenCount,this.next())}next(){let t=this.tokenIndex+1;t>V,this.tokenEnd=t&M):(this.eof=!0,this.tokenIndex=this.tokenCount,this.tokenType=0,this.tokenStart=this.tokenEnd=this.source.length)}skipSC(){for(;this.tokenType===13||this.tokenType===25;)this.next()}skipUntilBalanced(t,r){let n=t,s,o;t:for(;n0?this.offsetAndType[n-1]&M:this.firstCharOffset,r(this.source.charCodeAt(o))){case 1:break t;case 2:n++;break t;default:this.balance[s]===n&&(n=s)}}this.skip(n-this.tokenIndex)}forEachToken(t){for(let r=0,n=this.firstCharOffset;r>V;n=a,t(h,s,a,r)}}dump(){let t=new Array(this.tokenCount);return this.forEachToken((r,n,s,o)=>{t[o]={idx:o,type:gt[r],chunk:this.source.substring(n,s),balance:this.balance[o]}}),t}};function Mt(e,t){function r(f){return f=e.length){ife,spec:()=>Ni});var Ei=43,wi=45,ue=(e,t)=>{if(e===9&&(e=t),typeof e=="string"){let r=e.charCodeAt(0);return r>127?32768:r<<8}return e},nr=[[1,1],[1,2],[1,7],[1,8],[1,"-"],[1,10],[1,11],[1,12],[1,15],[1,21],[3,1],[3,2],[3,7],[3,8],[3,"-"],[3,10],[3,11],[3,12],[3,15],[4,1],[4,2],[4,7],[4,8],[4,"-"],[4,10],[4,11],[4,12],[4,15],[12,1],[12,2],[12,7],[12,8],[12,"-"],[12,10],[12,11],[12,12],[12,15],["#",1],["#",2],["#",7],["#",8],["#","-"],["#",10],["#",11],["#",12],["#",15],["-",1],["-",2],["-",7],["-",8],["-","-"],["-",10],["-",11],["-",12],["-",15],[10,1],[10,2],[10,7],[10,8],[10,10],[10,11],[10,12],[10,"%"],[10,15],["@",1],["@",2],["@",7],["@",8],["@","-"],["@",15],[".",10],[".",11],[".",12],["+",10],["+",11],["+",12],["/","*"]],Ai=nr.concat([[1,4],[12,4],[4,4],[3,21],[3,5],[3,16],[11,11],[11,12],[11,2],[11,"-"],[22,1],[22,2],[22,11],[22,12],[22,4],[22,"-"]]);function ir(e){let t=new Set(e.map(([r,n])=>ue(r)<<16|ue(n)));return function(r,n,s){let o=ue(n,s),a=s.charCodeAt(0);return(a===wi&&n!==1&&n!==2&&n!==15||a===Ei?t.has(r<<16|a<<8):t.has(r<<16|o))&&this.emit(" ",13,!0),o}}var Ni=ir(nr),fe=ir(Ai);var Ii=92;function Di(e,t){if(typeof t=="function"){let r=null;e.children.forEach(n=>{r!==null&&t.call(this,r),this.node(n),r=n});return}e.children.forEach(this.node,this)}function Pi(e){Mt(e,(t,r,n)=>{this.token(t,e.slice(r,n))})}function sr(e){let t=new Map;for(let[r,n]of Object.entries(e.node))typeof(n.generate||n)=="function"&&t.set(r,n.generate||n);return function(r,n){let s="",o=0,a={node(l){if(t.has(l.type))t.get(l.type).call(h,l);else throw new Error("Unknown node type: "+l.type)},tokenBefore:fe,token(l,i){o=this.tokenBefore(o,l,i),this.emit(i,l,!1),l===9&&i.charCodeAt(0)===Ii&&this.emit(` +`,13,!0)},emit(l){s+=l},result(){return s}};n&&(typeof n.decorator=="function"&&(a=n.decorator(a)),n.sourceMap&&(a=rr(a)),n.mode in Vt&&(a.tokenBefore=Vt[n.mode]));let h={node:l=>a.node(l),children:Di,token:(l,i)=>a.token(l,i),tokenize:Pi};return a.node(r),a.result()}}var Se={};$t(Se,{AnPlusB:()=>ar,Atrule:()=>cr,AtrulePrelude:()=>lr,AttributeSelector:()=>fr,Block:()=>pr,Brackets:()=>mr,CDC:()=>dr,CDO:()=>xr,ClassSelector:()=>Sr,Combinator:()=>yr,Comment:()=>br,Condition:()=>Lr,Declaration:()=>Tr,DeclarationList:()=>vr,Dimension:()=>Er,Feature:()=>wr,FeatureFunction:()=>Ar,FeatureRange:()=>Nr,Function:()=>Ir,GeneralEnclosed:()=>Dr,Hash:()=>Pr,IdSelector:()=>_r,Identifier:()=>Rr,Layer:()=>Mr,LayerList:()=>Br,MediaQuery:()=>Ur,MediaQueryList:()=>Wr,NestingSelector:()=>Hr,Nth:()=>qr,Number:()=>Yr,Operator:()=>zr,Parentheses:()=>Kr,Percentage:()=>$r,PseudoClassSelector:()=>Jr,PseudoElementSelector:()=>tn,Ratio:()=>en,Raw:()=>nn,Rule:()=>sn,Scope:()=>on,Selector:()=>cn,SelectorList:()=>hn,String:()=>dn,StyleSheet:()=>xn,SupportsDeclaration:()=>kn,TypeSelector:()=>Cn,UnicodeRange:()=>yn,Url:()=>Ln,Value:()=>Tn,WhiteSpace:()=>vn});var Y=43,_=45,Ht=110,st=!0,Fi=!1;function Gt(e,t){let r=this.tokenStart+e,n=this.charCodeAt(r);for((n===Y||n===_)&&(t&&this.error("Number sign is not allowed"),r++);r0&&this.skip(e),t===0&&(r=this.charCodeAt(this.tokenStart),r!==Y&&r!==_&&this.error("Number sign is expected")),pt.call(this,t!==0),t===_?"-"+this.consume(10):this.consume(10)}function or(){let e=this.tokenStart,t=null,r=null;if(this.tokenType===10)pt.call(this,Fi),r=this.consume(10);else if(this.tokenType===1&&this.cmpChar(this.tokenStart,_))switch(t="-1",Z.call(this,1,Ht),this.tokenEnd-this.tokenStart){case 2:this.next(),r=pe.call(this);break;case 3:Z.call(this,2,_),this.next(),this.skipSC(),pt.call(this,st),r="-"+this.consume(10);break;default:Z.call(this,2,_),Gt.call(this,3,st),this.next(),r=this.substrToCursor(e+2)}else if(this.tokenType===1||this.isDelim(Y)&&this.lookupType(1)===1){let n=0;switch(t="1",this.isDelim(Y)&&(n=1,this.next()),Z.call(this,0,Ht),this.tokenEnd-this.tokenStart){case 1:this.next(),r=pe.call(this);break;case 2:Z.call(this,1,_),this.next(),this.skipSC(),pt.call(this,st),r="-"+this.consume(10);break;default:Z.call(this,1,_),Gt.call(this,2,st),this.next(),r=this.substrToCursor(e+n+1)}}else if(this.tokenType===12){let n=this.charCodeAt(this.tokenStart),s=n===Y||n===_,o=this.tokenStart+s;for(;o{t.type==="Declaration"&&this.token(17,";")})}function mr(e){this.token(9,"["),this.children(e),this.token(9,"]")}function dr(){this.token(15,"-->")}function xr(){this.token(14,"\n\n return {\n type: 'CDC',\n loc: this.getLocation(start, this.tokenStart)\n };\n}\n\nexport function generate() {\n this.token(CDC, '-->');\n}\n", "import { CDO } from '../../tokenizer/index.js';\n\nexport const name = 'CDO';\nexport const structure = [];\n\nexport function parse() {\n const start = this.tokenStart;\n\n this.eat(CDO); // \n child = this.CDC();\n break;\n\n // CSS Syntax Module Level 3\n // \u00A72.2 Error handling\n // At the \"top level\" of a stylesheet, an starts an at-rule.\n case AtKeyword:\n child = this.parseWithFallback(this.Atrule, consumeRaw);\n break;\n\n // Anything else starts a qualified rule ...\n default:\n child = this.parseWithFallback(this.Rule, consumeRaw);\n }\n\n children.push(child);\n }\n\n return {\n type: 'StyleSheet',\n loc: this.getLocation(start, this.tokenStart),\n children\n };\n}\n\nexport function generate(node) {\n this.children(node);\n}\n", "import {\n LeftParenthesis,\n RightParenthesis\n} from '../../tokenizer/index.js';\n\nexport const name = 'SupportsDeclaration';\nexport const structure = {\n declaration: 'Declaration'\n};\n\nexport function parse() {\n const start = this.tokenStart;\n\n this.eat(LeftParenthesis);\n this.skipSC();\n\n const declaration = this.Declaration();\n\n if (!this.eof) {\n this.eat(RightParenthesis);\n }\n\n return {\n type: 'SupportsDeclaration',\n loc: this.getLocation(start, this.tokenStart),\n declaration\n };\n}\n\nexport function generate(node) {\n this.token(LeftParenthesis, '(');\n this.node(node.declaration);\n this.token(RightParenthesis, ')');\n}\n", "import { Ident } from '../../tokenizer/index.js';\n\nconst ASTERISK = 0x002A; // U+002A ASTERISK (*)\nconst VERTICALLINE = 0x007C; // U+007C VERTICAL LINE (|)\n\nfunction eatIdentifierOrAsterisk() {\n if (this.tokenType !== Ident &&\n this.isDelim(ASTERISK) === false) {\n this.error('Identifier or asterisk is expected');\n }\n\n this.next();\n}\n\nexport const name = 'TypeSelector';\nexport const structure = {\n name: String\n};\n\n// ident\n// ident|ident\n// ident|*\n// *\n// *|ident\n// *|*\n// |ident\n// |*\nexport function parse() {\n const start = this.tokenStart;\n\n if (this.isDelim(VERTICALLINE)) {\n this.next();\n eatIdentifierOrAsterisk.call(this);\n } else {\n eatIdentifierOrAsterisk.call(this);\n\n if (this.isDelim(VERTICALLINE)) {\n this.next();\n eatIdentifierOrAsterisk.call(this);\n }\n }\n\n return {\n type: 'TypeSelector',\n loc: this.getLocation(start, this.tokenStart),\n name: this.substrToCursor(start)\n };\n}\n\nexport function generate(node) {\n this.tokenize(node.name);\n}\n", "import {\n isHexDigit,\n Ident,\n Number,\n Dimension\n} from '../../tokenizer/index.js';\n\nconst PLUSSIGN = 0x002B; // U+002B PLUS SIGN (+)\nconst HYPHENMINUS = 0x002D; // U+002D HYPHEN-MINUS (-)\nconst QUESTIONMARK = 0x003F; // U+003F QUESTION MARK (?)\n\nfunction eatHexSequence(offset, allowDash) {\n let len = 0;\n\n for (let pos = this.tokenStart + offset; pos < this.tokenEnd; pos++) {\n const code = this.charCodeAt(pos);\n\n if (code === HYPHENMINUS && allowDash && len !== 0) {\n eatHexSequence.call(this, offset + len + 1, false);\n return -1;\n }\n\n if (!isHexDigit(code)) {\n this.error(\n allowDash && len !== 0\n ? 'Hyphen minus' + (len < 6 ? ' or hex digit' : '') + ' is expected'\n : (len < 6 ? 'Hex digit is expected' : 'Unexpected input'),\n pos\n );\n }\n\n if (++len > 6) {\n this.error('Too many hex digits', pos);\n };\n }\n\n this.next();\n return len;\n}\n\nfunction eatQuestionMarkSequence(max) {\n let count = 0;\n\n while (this.isDelim(QUESTIONMARK)) {\n if (++count > max) {\n this.error('Too many question marks');\n }\n\n this.next();\n }\n}\n\nfunction startsWith(code) {\n if (this.charCodeAt(this.tokenStart) !== code) {\n this.error((code === PLUSSIGN ? 'Plus sign' : 'Hyphen minus') + ' is expected');\n }\n}\n\n// https://drafts.csswg.org/css-syntax/#urange\n// Informally, the production has three forms:\n// U+0001\n// Defines a range consisting of a single code point, in this case the code point \"1\".\n// U+0001-00ff\n// Defines a range of codepoints between the first and the second value, in this case\n// the range between \"1\" and \"ff\" (255 in decimal) inclusive.\n// U+00??\n// Defines a range of codepoints where the \"?\" characters range over all hex digits,\n// in this case defining the same as the value U+0000-00ff.\n// In each form, a maximum of 6 digits is allowed for each hexadecimal number (if you treat \"?\" as a hexadecimal digit).\n//\n// =\n// u '+' '?'* |\n// u '?'* |\n// u '?'* |\n// u |\n// u |\n// u '+' '?'+\nfunction scanUnicodeRange() {\n let hexLength = 0;\n\n switch (this.tokenType) {\n case Number:\n // u '?'*\n // u \n // u \n hexLength = eatHexSequence.call(this, 1, true);\n\n if (this.isDelim(QUESTIONMARK)) {\n eatQuestionMarkSequence.call(this, 6 - hexLength);\n break;\n }\n\n if (this.tokenType === Dimension ||\n this.tokenType === Number) {\n startsWith.call(this, HYPHENMINUS);\n eatHexSequence.call(this, 1, false);\n break;\n }\n\n break;\n\n case Dimension:\n // u '?'*\n hexLength = eatHexSequence.call(this, 1, true);\n\n if (hexLength > 0) {\n eatQuestionMarkSequence.call(this, 6 - hexLength);\n }\n\n break;\n\n default:\n // u '+' '?'*\n // u '+' '?'+\n this.eatDelim(PLUSSIGN);\n\n if (this.tokenType === Ident) {\n hexLength = eatHexSequence.call(this, 0, true);\n if (hexLength > 0) {\n eatQuestionMarkSequence.call(this, 6 - hexLength);\n }\n break;\n }\n\n if (this.isDelim(QUESTIONMARK)) {\n this.next();\n eatQuestionMarkSequence.call(this, 5);\n break;\n }\n\n this.error('Hex digit or question mark is expected');\n }\n}\n\nexport const name = 'UnicodeRange';\nexport const structure = {\n value: String\n};\n\nexport function parse() {\n const start = this.tokenStart;\n\n // U or u\n this.eatIdent('u');\n scanUnicodeRange.call(this);\n\n return {\n type: 'UnicodeRange',\n loc: this.getLocation(start, this.tokenStart),\n value: this.substrToCursor(start)\n };\n}\n\nexport function generate(node) {\n this.tokenize(node.value);\n}\n", "import {\n isHexDigit,\n isWhiteSpace,\n isValidEscape,\n consumeEscaped,\n decodeEscaped\n} from '../tokenizer/index.js';\n\nconst SPACE = 0x0020; // U+0020 SPACE\nconst REVERSE_SOLIDUS = 0x005c; // U+005C REVERSE SOLIDUS (\\)\nconst QUOTATION_MARK = 0x0022; // \"\nconst APOSTROPHE = 0x0027; // '\nconst LEFTPARENTHESIS = 0x0028; // U+0028 LEFT PARENTHESIS (()\nconst RIGHTPARENTHESIS = 0x0029; // U+0029 RIGHT PARENTHESIS ())\n\nexport function decode(str) {\n const len = str.length;\n let start = 4; // length of \"url(\"\n let end = str.charCodeAt(len - 1) === RIGHTPARENTHESIS ? len - 2 : len - 1;\n let decoded = '';\n\n while (start < end && isWhiteSpace(str.charCodeAt(start))) {\n start++;\n }\n\n while (start < end && isWhiteSpace(str.charCodeAt(end))) {\n end--;\n }\n\n for (let i = start; i <= end; i++) {\n let code = str.charCodeAt(i);\n\n if (code === REVERSE_SOLIDUS) {\n // special case at the ending\n if (i === end) {\n // if the next input code point is EOF, do nothing\n // otherwise include last left parenthesis as escaped\n if (i !== len - 1) {\n decoded = str.substr(i + 1);\n }\n break;\n }\n\n code = str.charCodeAt(++i);\n\n // consume escaped\n if (isValidEscape(REVERSE_SOLIDUS, code)) {\n const escapeStart = i - 1;\n const escapeEnd = consumeEscaped(str, escapeStart);\n\n i = escapeEnd - 1;\n decoded += decodeEscaped(str.substring(escapeStart + 1, escapeEnd));\n } else {\n // \\r\\n\n if (code === 0x000d && str.charCodeAt(i + 1) === 0x000a) {\n i++;\n }\n }\n } else {\n decoded += str[i];\n }\n }\n\n return decoded;\n}\n\nexport function encode(str) {\n let encoded = '';\n let wsBeforeHexIsNeeded = false;\n\n for (let i = 0; i < str.length; i++) {\n const code = str.charCodeAt(i);\n\n // If the character is NULL (U+0000), then the REPLACEMENT CHARACTER (U+FFFD).\n if (code === 0x0000) {\n encoded += '\\uFFFD';\n continue;\n }\n\n // If the character is in the range [\\1-\\1f] (U+0001 to U+001F) or is U+007F,\n // the character escaped as code point.\n // Note: Do not compare with 0x0001 since 0x0000 is precessed before\n if (code <= 0x001f || code === 0x007F) {\n encoded += '\\\\' + code.toString(16);\n wsBeforeHexIsNeeded = true;\n continue;\n }\n\n if (code === SPACE ||\n code === REVERSE_SOLIDUS ||\n code === QUOTATION_MARK ||\n code === APOSTROPHE ||\n code === LEFTPARENTHESIS ||\n code === RIGHTPARENTHESIS) {\n encoded += '\\\\' + str.charAt(i);\n wsBeforeHexIsNeeded = false;\n } else {\n if (wsBeforeHexIsNeeded && isHexDigit(code)) {\n encoded += ' ';\n }\n\n encoded += str.charAt(i);\n wsBeforeHexIsNeeded = false;\n }\n }\n\n return 'url(' + encoded + ')';\n}\n", "import * as url from '../../utils/url.js';\nimport * as string from '../../utils/string.js';\nimport {\n Function as FunctionToken,\n String as StringToken,\n Url,\n RightParenthesis\n} from '../../tokenizer/index.js';\n\nexport const name = 'Url';\nexport const structure = {\n value: String\n};\n\n// | )\nexport function parse() {\n const start = this.tokenStart;\n let value;\n\n switch (this.tokenType) {\n case Url:\n value = url.decode(this.consume(Url));\n break;\n\n case FunctionToken:\n if (!this.cmpStr(this.tokenStart, this.tokenEnd, 'url(')) {\n this.error('Function name must be `url`');\n }\n\n this.eat(FunctionToken);\n this.skipSC();\n value = string.decode(this.consume(StringToken));\n this.skipSC();\n if (!this.eof) {\n this.eat(RightParenthesis);\n }\n break;\n\n default:\n this.error('Url or Function is expected');\n }\n\n return {\n type: 'Url',\n loc: this.getLocation(start, this.tokenStart),\n value\n };\n}\n\nexport function generate(node) {\n this.token(Url, url.encode(node.value));\n}\n", "export const name = 'Value';\nexport const structure = {\n children: [[]]\n};\n\nexport function parse() {\n const start = this.tokenStart;\n const children = this.readSequence(this.scope.Value);\n\n return {\n type: 'Value',\n loc: this.getLocation(start, this.tokenStart),\n children\n };\n}\n\nexport function generate(node) {\n this.children(node);\n}\n", "import { WhiteSpace } from '../../tokenizer/index.js';\n\nconst SPACE = Object.freeze({\n type: 'WhiteSpace',\n loc: null,\n value: ' '\n});\n\nexport const name = 'WhiteSpace';\nexport const structure = {\n value: String\n};\n\nexport function parse() {\n this.eat(WhiteSpace);\n return SPACE;\n\n // return {\n // type: 'WhiteSpace',\n // loc: this.getLocation(this.tokenStart, this.tokenEnd),\n // value: this.consume(WHITESPACE)\n // };\n}\n\nexport function generate(node) {\n this.token(WhiteSpace, node.value);\n}\n", "import * as node from '../node/index-generate.js';\n\nexport default {\n node\n};\n", "import { createGenerator } from './create.js';\nimport config from '../syntax/config/generator.js';\n\nexport default createGenerator(config);\n", "//\n// list\n// \u250C\u2500\u2500\u2500\u2500\u2500\u2500\u2510\n// \u250C\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u253C\u2500head \u2502\n// \u2502 \u2502 tail\u2500\u253C\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2510\n// \u2502 \u2514\u2500\u2500\u2500\u2500\u2500\u2500\u2518 \u2502\n// \u25BC \u25BC\n// item item item item\n// \u250C\u2500\u2500\u2500\u2500\u2500\u2500\u2510 \u250C\u2500\u2500\u2500\u2500\u2500\u2500\u2510 \u250C\u2500\u2500\u2500\u2500\u2500\u2500\u2510 \u250C\u2500\u2500\u2500\u2500\u2500\u2500\u2510\n// null \u25C0\u2500\u2500\u253C\u2500prev \u2502\u25C0\u2500\u2500\u2500\u253C\u2500prev \u2502\u25C0\u2500\u2500\u2500\u253C\u2500prev \u2502\u25C0\u2500\u2500\u2500\u253C\u2500prev \u2502\n// \u2502 next\u2500\u253C\u2500\u2500\u2500\u25B6\u2502 next\u2500\u253C\u2500\u2500\u2500\u25B6\u2502 next\u2500\u253C\u2500\u2500\u2500\u25B6\u2502 next\u2500\u253C\u2500\u2500\u25B6 null\n// \u251C\u2500\u2500\u2500\u2500\u2500\u2500\u2524 \u251C\u2500\u2500\u2500\u2500\u2500\u2500\u2524 \u251C\u2500\u2500\u2500\u2500\u2500\u2500\u2524 \u251C\u2500\u2500\u2500\u2500\u2500\u2500\u2524\n// \u2502 data \u2502 \u2502 data \u2502 \u2502 data \u2502 \u2502 data \u2502\n// \u2514\u2500\u2500\u2500\u2500\u2500\u2500\u2518 \u2514\u2500\u2500\u2500\u2500\u2500\u2500\u2518 \u2514\u2500\u2500\u2500\u2500\u2500\u2500\u2518 \u2514\u2500\u2500\u2500\u2500\u2500\u2500\u2518\n//\n\nlet releasedCursors = null;\n\nexport class List {\n static createItem(data) {\n return {\n prev: null,\n next: null,\n data\n };\n }\n\n constructor() {\n this.head = null;\n this.tail = null;\n this.cursor = null;\n }\n createItem(data) {\n return List.createItem(data);\n }\n\n // cursor helpers\n allocateCursor(prev, next) {\n let cursor;\n\n if (releasedCursors !== null) {\n cursor = releasedCursors;\n releasedCursors = releasedCursors.cursor;\n cursor.prev = prev;\n cursor.next = next;\n cursor.cursor = this.cursor;\n } else {\n cursor = {\n prev,\n next,\n cursor: this.cursor\n };\n }\n\n this.cursor = cursor;\n\n return cursor;\n }\n releaseCursor() {\n const { cursor } = this;\n\n this.cursor = cursor.cursor;\n cursor.prev = null;\n cursor.next = null;\n cursor.cursor = releasedCursors;\n releasedCursors = cursor;\n }\n updateCursors(prevOld, prevNew, nextOld, nextNew) {\n let { cursor } = this;\n\n while (cursor !== null) {\n if (cursor.prev === prevOld) {\n cursor.prev = prevNew;\n }\n\n if (cursor.next === nextOld) {\n cursor.next = nextNew;\n }\n\n cursor = cursor.cursor;\n }\n }\n *[Symbol.iterator]() {\n for (let cursor = this.head; cursor !== null; cursor = cursor.next) {\n yield cursor.data;\n }\n }\n\n // getters\n get size() {\n let size = 0;\n\n for (let cursor = this.head; cursor !== null; cursor = cursor.next) {\n size++;\n }\n\n return size;\n }\n get isEmpty() {\n return this.head === null;\n }\n get first() {\n return this.head && this.head.data;\n }\n get last() {\n return this.tail && this.tail.data;\n }\n\n // convertors\n fromArray(array) {\n let cursor = null;\n this.head = null;\n\n for (let data of array) {\n const item = List.createItem(data);\n\n if (cursor !== null) {\n cursor.next = item;\n } else {\n this.head = item;\n }\n\n item.prev = cursor;\n cursor = item;\n }\n\n this.tail = cursor;\n return this;\n }\n toArray() {\n return [...this];\n }\n toJSON() {\n return [...this];\n }\n\n // array-like methods\n forEach(fn, thisArg = this) {\n // push cursor\n const cursor = this.allocateCursor(null, this.head);\n\n while (cursor.next !== null) {\n const item = cursor.next;\n cursor.next = item.next;\n fn.call(thisArg, item.data, item, this);\n }\n\n // pop cursor\n this.releaseCursor();\n }\n forEachRight(fn, thisArg = this) {\n // push cursor\n const cursor = this.allocateCursor(this.tail, null);\n\n while (cursor.prev !== null) {\n const item = cursor.prev;\n cursor.prev = item.prev;\n fn.call(thisArg, item.data, item, this);\n }\n\n // pop cursor\n this.releaseCursor();\n }\n reduce(fn, initialValue, thisArg = this) {\n // push cursor\n let cursor = this.allocateCursor(null, this.head);\n let acc = initialValue;\n let item;\n\n while (cursor.next !== null) {\n item = cursor.next;\n cursor.next = item.next;\n\n acc = fn.call(thisArg, acc, item.data, item, this);\n }\n\n // pop cursor\n this.releaseCursor();\n\n return acc;\n }\n reduceRight(fn, initialValue, thisArg = this) {\n // push cursor\n let cursor = this.allocateCursor(this.tail, null);\n let acc = initialValue;\n let item;\n\n while (cursor.prev !== null) {\n item = cursor.prev;\n cursor.prev = item.prev;\n\n acc = fn.call(thisArg, acc, item.data, item, this);\n }\n\n // pop cursor\n this.releaseCursor();\n\n return acc;\n }\n some(fn, thisArg = this) {\n for (let cursor = this.head; cursor !== null; cursor = cursor.next) {\n if (fn.call(thisArg, cursor.data, cursor, this)) {\n return true;\n }\n }\n\n return false;\n }\n map(fn, thisArg = this) {\n const result = new List();\n\n for (let cursor = this.head; cursor !== null; cursor = cursor.next) {\n result.appendData(fn.call(thisArg, cursor.data, cursor, this));\n }\n\n return result;\n }\n filter(fn, thisArg = this) {\n const result = new List();\n\n for (let cursor = this.head; cursor !== null; cursor = cursor.next) {\n if (fn.call(thisArg, cursor.data, cursor, this)) {\n result.appendData(cursor.data);\n }\n }\n\n return result;\n }\n\n nextUntil(start, fn, thisArg = this) {\n if (start === null) {\n return;\n }\n\n // push cursor\n const cursor = this.allocateCursor(null, start);\n\n while (cursor.next !== null) {\n const item = cursor.next;\n cursor.next = item.next;\n if (fn.call(thisArg, item.data, item, this)) {\n break;\n }\n }\n\n // pop cursor\n this.releaseCursor();\n }\n prevUntil(start, fn, thisArg = this) {\n if (start === null) {\n return;\n }\n\n // push cursor\n const cursor = this.allocateCursor(start, null);\n\n while (cursor.prev !== null) {\n const item = cursor.prev;\n cursor.prev = item.prev;\n if (fn.call(thisArg, item.data, item, this)) {\n break;\n }\n }\n\n // pop cursor\n this.releaseCursor();\n }\n\n // mutation\n clear() {\n this.head = null;\n this.tail = null;\n }\n copy() {\n const result = new List();\n\n for (let data of this) {\n result.appendData(data);\n }\n\n return result;\n }\n prepend(item) {\n // head\n // ^\n // item\n this.updateCursors(null, item, this.head, item);\n\n // insert to the beginning of the list\n if (this.head !== null) {\n // new item <- first item\n this.head.prev = item;\n // new item -> first item\n item.next = this.head;\n } else {\n // if list has no head, then it also has no tail\n // in this case tail points to the new item\n this.tail = item;\n }\n\n // head always points to new item\n this.head = item;\n return this;\n }\n prependData(data) {\n return this.prepend(List.createItem(data));\n }\n append(item) {\n return this.insert(item);\n }\n appendData(data) {\n return this.insert(List.createItem(data));\n }\n insert(item, before = null) {\n if (before !== null) {\n // prev before\n // ^\n // item\n this.updateCursors(before.prev, item, before, item);\n\n if (before.prev === null) {\n // insert to the beginning of list\n if (this.head !== before) {\n throw new Error('before doesn\\'t belong to list');\n }\n // since head points to before therefore list doesn't empty\n // no need to check tail\n this.head = item;\n before.prev = item;\n item.next = before;\n this.updateCursors(null, item);\n } else {\n // insert between two items\n before.prev.next = item;\n item.prev = before.prev;\n before.prev = item;\n item.next = before;\n }\n } else {\n // tail\n // ^\n // item\n this.updateCursors(this.tail, item, null, item);\n\n // insert to the ending of the list\n if (this.tail !== null) {\n // last item -> new item\n this.tail.next = item;\n // last item <- new item\n item.prev = this.tail;\n } else {\n // if list has no tail, then it also has no head\n // in this case head points to new item\n this.head = item;\n }\n\n // tail always points to new item\n this.tail = item;\n }\n\n return this;\n }\n insertData(data, before) {\n return this.insert(List.createItem(data), before);\n }\n remove(item) {\n // item\n // ^\n // prev next\n this.updateCursors(item, item.prev, item, item.next);\n\n if (item.prev !== null) {\n item.prev.next = item.next;\n } else {\n if (this.head !== item) {\n throw new Error('item doesn\\'t belong to list');\n }\n\n this.head = item.next;\n }\n\n if (item.next !== null) {\n item.next.prev = item.prev;\n } else {\n if (this.tail !== item) {\n throw new Error('item doesn\\'t belong to list');\n }\n\n this.tail = item.prev;\n }\n\n item.prev = null;\n item.next = null;\n\n return item;\n }\n push(data) {\n this.insert(List.createItem(data));\n }\n pop() {\n return this.tail !== null ? this.remove(this.tail) : null;\n }\n unshift(data) {\n this.prepend(List.createItem(data));\n }\n shift() {\n return this.head !== null ? this.remove(this.head) : null;\n }\n prependList(list) {\n return this.insertList(list, this.head);\n }\n appendList(list) {\n return this.insertList(list);\n }\n insertList(list, before) {\n // ignore empty lists\n if (list.head === null) {\n return this;\n }\n\n if (before !== undefined && before !== null) {\n this.updateCursors(before.prev, list.tail, before, list.head);\n\n // insert in the middle of dist list\n if (before.prev !== null) {\n // before.prev <-> list.head\n before.prev.next = list.head;\n list.head.prev = before.prev;\n } else {\n this.head = list.head;\n }\n\n before.prev = list.tail;\n list.tail.next = before;\n } else {\n this.updateCursors(this.tail, list.tail, null, list.head);\n\n // insert to end of the list\n if (this.tail !== null) {\n // if destination list has a tail, then it also has a head,\n // but head doesn't change\n // dest tail -> source head\n this.tail.next = list.head;\n // dest tail <- source head\n list.head.prev = this.tail;\n } else {\n // if list has no a tail, then it also has no a head\n // in this case points head to new item\n this.head = list.head;\n }\n\n // tail always start point to new item\n this.tail = list.tail;\n }\n\n list.head = null;\n list.tail = null;\n return this;\n }\n replace(oldItem, newItemOrList) {\n if ('head' in newItemOrList) {\n this.insertList(newItemOrList, oldItem);\n } else {\n this.insert(newItemOrList, oldItem);\n }\n\n this.remove(oldItem);\n }\n}\n", "export function createCustomError(name, message) {\n // use Object.create(), because some VMs prevent setting line/column otherwise\n // (iOS Safari 10 even throws an exception)\n const error = Object.create(SyntaxError.prototype);\n const errorStack = new Error();\n\n return Object.assign(error, {\n name,\n message,\n get stack() {\n return (errorStack.stack || '').replace(/^(.+\\n){1,3}/, `${name}: ${message}\\n`);\n }\n });\n};\n", "import { createCustomError } from '../utils/create-custom-error.js';\n\nconst MAX_LINE_LENGTH = 100;\nconst OFFSET_CORRECTION = 60;\nconst TAB_REPLACEMENT = ' ';\n\nfunction sourceFragment({ source, line, column, baseLine, baseColumn }, extraLines) {\n function processLines(start, end) {\n return lines\n .slice(start, end)\n .map((line, idx) =>\n String(start + idx + 1).padStart(maxNumLength) + ' |' + line\n ).join('\\n');\n }\n\n const prelines = '\\n'.repeat(Math.max(baseLine - 1, 0));\n const precolumns = ' '.repeat(Math.max(baseColumn - 1, 0));\n const lines = (prelines + precolumns + source).split(/\\r\\n?|\\n|\\f/);\n const startLine = Math.max(1, line - extraLines) - 1;\n const endLine = Math.min(line + extraLines, lines.length + 1);\n const maxNumLength = Math.max(4, String(endLine).length) + 1;\n let cutLeft = 0;\n\n // column correction according to replaced tab before column\n column += (TAB_REPLACEMENT.length - 1) * (lines[line - 1].substr(0, column - 1).match(/\\t/g) || []).length;\n\n if (column > MAX_LINE_LENGTH) {\n cutLeft = column - OFFSET_CORRECTION + 3;\n column = OFFSET_CORRECTION - 2;\n }\n\n for (let i = startLine; i <= endLine; i++) {\n if (i >= 0 && i < lines.length) {\n lines[i] = lines[i].replace(/\\t/g, TAB_REPLACEMENT);\n lines[i] =\n (cutLeft > 0 && lines[i].length > cutLeft ? '\\u2026' : '') +\n lines[i].substr(cutLeft, MAX_LINE_LENGTH - 2) +\n (lines[i].length > cutLeft + MAX_LINE_LENGTH - 1 ? '\\u2026' : '');\n }\n }\n\n return [\n processLines(startLine, line),\n new Array(column + maxNumLength + 2).join('-') + '^',\n processLines(line, endLine)\n ].filter(Boolean)\n .join('\\n')\n .replace(/^(\\s+\\d+\\s+\\|\\n)+/, '')\n .replace(/\\n(\\s+\\d+\\s+\\|)+$/, '');\n}\n\nexport function SyntaxError(message, source, offset, line, column, baseLine = 1, baseColumn = 1) {\n const error = Object.assign(createCustomError('SyntaxError', message), {\n source,\n offset,\n line,\n column,\n sourceFragment(extraLines) {\n return sourceFragment({ source, line, column, baseLine, baseColumn }, isNaN(extraLines) ? 0 : extraLines);\n },\n get formattedMessage() {\n return (\n `Parse error: ${message}\\n` +\n sourceFragment({ source, line, column, baseLine, baseColumn }, 2)\n );\n }\n });\n\n return error;\n}\n", "import { WhiteSpace, Comment } from '../tokenizer/index.js';\n\nexport function readSequence(recognizer) {\n const children = this.createList();\n let space = false;\n const context = {\n recognizer\n };\n\n while (!this.eof) {\n switch (this.tokenType) {\n case Comment:\n this.next();\n continue;\n\n case WhiteSpace:\n space = true;\n this.next();\n continue;\n }\n\n let child = recognizer.getNode.call(this, context);\n\n if (child === undefined) {\n break;\n }\n\n if (space) {\n if (recognizer.onWhiteSpace) {\n recognizer.onWhiteSpace.call(this, child, children, context);\n }\n space = false;\n }\n\n children.push(child);\n }\n\n if (space && recognizer.onWhiteSpace) {\n recognizer.onWhiteSpace.call(this, null, children, context);\n }\n\n return children;\n};\n", "import { List } from '../utils/List.js';\nimport { SyntaxError } from './SyntaxError.js';\nimport {\n tokenize,\n OffsetToLocation,\n TokenStream,\n tokenNames,\n\n consumeNumber,\n findWhiteSpaceStart,\n cmpChar,\n cmpStr,\n\n WhiteSpace,\n Comment,\n Ident,\n Function as FunctionToken,\n Url,\n Hash,\n Percentage,\n Number as NumberToken\n} from '../tokenizer/index.js';\nimport { readSequence } from './sequence.js';\n\nconst NOOP = () => {};\nconst EXCLAMATIONMARK = 0x0021; // U+0021 EXCLAMATION MARK (!)\nconst NUMBERSIGN = 0x0023; // U+0023 NUMBER SIGN (#)\nconst SEMICOLON = 0x003B; // U+003B SEMICOLON (;)\nconst LEFTCURLYBRACKET = 0x007B; // U+007B LEFT CURLY BRACKET ({)\nconst NULL = 0;\n\nfunction createParseContext(name) {\n return function() {\n return this[name]();\n };\n}\n\nfunction fetchParseValues(dict) {\n const result = Object.create(null);\n\n for (const name of Object.keys(dict)) {\n const item = dict[name];\n const fn = item.parse || item;\n\n if (fn) {\n result[name] = fn;\n }\n }\n\n return result;\n}\n\nfunction processConfig(config) {\n const parseConfig = {\n context: Object.create(null),\n features: Object.assign(Object.create(null), config.features),\n scope: Object.assign(Object.create(null), config.scope),\n atrule: fetchParseValues(config.atrule),\n pseudo: fetchParseValues(config.pseudo),\n node: fetchParseValues(config.node)\n };\n\n for (const [name, context] of Object.entries(config.parseContext)) {\n switch (typeof context) {\n case 'function':\n parseConfig.context[name] = context;\n break;\n\n case 'string':\n parseConfig.context[name] = createParseContext(context);\n break;\n }\n }\n\n return {\n config: parseConfig,\n ...parseConfig,\n ...parseConfig.node\n };\n}\n\nexport function createParser(config) {\n let source = '';\n let filename = '';\n let needPositions = false;\n let onParseError = NOOP;\n let onParseErrorThrow = false;\n\n const locationMap = new OffsetToLocation();\n const parser = Object.assign(new TokenStream(), processConfig(config || {}), {\n parseAtrulePrelude: true,\n parseRulePrelude: true,\n parseValue: true,\n parseCustomProperty: false,\n\n readSequence,\n\n consumeUntilBalanceEnd: () => 0,\n consumeUntilLeftCurlyBracket(code) {\n return code === LEFTCURLYBRACKET ? 1 : 0;\n },\n consumeUntilLeftCurlyBracketOrSemicolon(code) {\n return code === LEFTCURLYBRACKET || code === SEMICOLON ? 1 : 0;\n },\n consumeUntilExclamationMarkOrSemicolon(code) {\n return code === EXCLAMATIONMARK || code === SEMICOLON ? 1 : 0;\n },\n consumeUntilSemicolonIncluded(code) {\n return code === SEMICOLON ? 2 : 0;\n },\n\n createList() {\n return new List();\n },\n createSingleNodeList(node) {\n return new List().appendData(node);\n },\n getFirstListNode(list) {\n return list && list.first;\n },\n getLastListNode(list) {\n return list && list.last;\n },\n\n parseWithFallback(consumer, fallback) {\n const startIndex = this.tokenIndex;\n\n try {\n return consumer.call(this);\n } catch (e) {\n if (onParseErrorThrow) {\n throw e;\n }\n\n this.skip(startIndex - this.tokenIndex);\n const fallbackNode = fallback.call(this);\n\n onParseErrorThrow = true;\n onParseError(e, fallbackNode);\n onParseErrorThrow = false;\n\n return fallbackNode;\n }\n },\n\n lookupNonWSType(offset) {\n let type;\n\n do {\n type = this.lookupType(offset++);\n if (type !== WhiteSpace && type !== Comment) {\n return type;\n }\n } while (type !== NULL);\n\n return NULL;\n },\n\n charCodeAt(offset) {\n return offset >= 0 && offset < source.length ? source.charCodeAt(offset) : 0;\n },\n substring(offsetStart, offsetEnd) {\n return source.substring(offsetStart, offsetEnd);\n },\n substrToCursor(start) {\n return this.source.substring(start, this.tokenStart);\n },\n\n cmpChar(offset, charCode) {\n return cmpChar(source, offset, charCode);\n },\n cmpStr(offsetStart, offsetEnd, str) {\n return cmpStr(source, offsetStart, offsetEnd, str);\n },\n\n consume(tokenType) {\n const start = this.tokenStart;\n\n this.eat(tokenType);\n\n return this.substrToCursor(start);\n },\n consumeFunctionName() {\n const name = source.substring(this.tokenStart, this.tokenEnd - 1);\n\n this.eat(FunctionToken);\n\n return name;\n },\n consumeNumber(type) {\n const number = source.substring(this.tokenStart, consumeNumber(source, this.tokenStart));\n\n this.eat(type);\n\n return number;\n },\n\n eat(tokenType) {\n if (this.tokenType !== tokenType) {\n const tokenName = tokenNames[tokenType].slice(0, -6).replace(/-/g, ' ').replace(/^./, m => m.toUpperCase());\n let message = `${/[[\\](){}]/.test(tokenName) ? `\"${tokenName}\"` : tokenName} is expected`;\n let offset = this.tokenStart;\n\n // tweak message and offset\n switch (tokenType) {\n case Ident:\n // when identifier is expected but there is a function or url\n if (this.tokenType === FunctionToken || this.tokenType === Url) {\n offset = this.tokenEnd - 1;\n message = 'Identifier is expected but function found';\n } else {\n message = 'Identifier is expected';\n }\n break;\n\n case Hash:\n if (this.isDelim(NUMBERSIGN)) {\n this.next();\n offset++;\n message = 'Name is expected';\n }\n break;\n\n case Percentage:\n if (this.tokenType === NumberToken) {\n offset = this.tokenEnd;\n message = 'Percent sign is expected';\n }\n break;\n }\n\n this.error(message, offset);\n }\n\n this.next();\n },\n eatIdent(name) {\n if (this.tokenType !== Ident || this.lookupValue(0, name) === false) {\n this.error(`Identifier \"${name}\" is expected`);\n }\n\n this.next();\n },\n eatDelim(code) {\n if (!this.isDelim(code)) {\n this.error(`Delim \"${String.fromCharCode(code)}\" is expected`);\n }\n\n this.next();\n },\n\n getLocation(start, end) {\n if (needPositions) {\n return locationMap.getLocationRange(\n start,\n end,\n filename\n );\n }\n\n return null;\n },\n getLocationFromList(list) {\n if (needPositions) {\n const head = this.getFirstListNode(list);\n const tail = this.getLastListNode(list);\n return locationMap.getLocationRange(\n head !== null ? head.loc.start.offset - locationMap.startOffset : this.tokenStart,\n tail !== null ? tail.loc.end.offset - locationMap.startOffset : this.tokenStart,\n filename\n );\n }\n\n return null;\n },\n\n error(message, offset) {\n const location = typeof offset !== 'undefined' && offset < source.length\n ? locationMap.getLocation(offset)\n : this.eof\n ? locationMap.getLocation(findWhiteSpaceStart(source, source.length - 1))\n : locationMap.getLocation(this.tokenStart);\n\n throw new SyntaxError(\n message || 'Unexpected input',\n source,\n location.offset,\n location.line,\n location.column,\n locationMap.startLine,\n locationMap.startColumn\n );\n }\n });\n\n const parse = function(source_, options) {\n source = source_;\n options = options || {};\n\n parser.setSource(source, tokenize);\n locationMap.setSource(\n source,\n options.offset,\n options.line,\n options.column\n );\n\n filename = options.filename || '';\n needPositions = Boolean(options.positions);\n onParseError = typeof options.onParseError === 'function' ? options.onParseError : NOOP;\n onParseErrorThrow = false;\n\n parser.parseAtrulePrelude = 'parseAtrulePrelude' in options ? Boolean(options.parseAtrulePrelude) : true;\n parser.parseRulePrelude = 'parseRulePrelude' in options ? Boolean(options.parseRulePrelude) : true;\n parser.parseValue = 'parseValue' in options ? Boolean(options.parseValue) : true;\n parser.parseCustomProperty = 'parseCustomProperty' in options ? Boolean(options.parseCustomProperty) : false;\n\n const { context = 'default', onComment } = options;\n\n if (context in parser.context === false) {\n throw new Error('Unknown context `' + context + '`');\n }\n\n if (typeof onComment === 'function') {\n parser.forEachToken((type, start, end) => {\n if (type === Comment) {\n const loc = parser.getLocation(start, end);\n const value = cmpStr(source, end - 2, end, '*/')\n ? source.slice(start + 2, end - 2)\n : source.slice(start + 2, end);\n\n onComment(value, loc);\n }\n });\n }\n\n const ast = parser.context[context].call(parser, options);\n\n if (!parser.eof) {\n parser.error();\n }\n\n return ast;\n };\n\n return Object.assign(parse, {\n SyntaxError,\n config: parser.config\n });\n};\n", "import {\n Delim,\n Ident,\n Dimension,\n Percentage,\n Number as NumberToken,\n Hash,\n Colon,\n LeftSquareBracket\n} from '../../tokenizer/index.js';\n\nconst NUMBERSIGN = 0x0023; // U+0023 NUMBER SIGN (#)\nconst AMPERSAND = 0x0026; // U+0026 AMPERSAND (&)\nconst ASTERISK = 0x002A; // U+002A ASTERISK (*)\nconst PLUSSIGN = 0x002B; // U+002B PLUS SIGN (+)\nconst SOLIDUS = 0x002F; // U+002F SOLIDUS (/)\nconst FULLSTOP = 0x002E; // U+002E FULL STOP (.)\nconst GREATERTHANSIGN = 0x003E; // U+003E GREATER-THAN SIGN (>)\nconst VERTICALLINE = 0x007C; // U+007C VERTICAL LINE (|)\nconst TILDE = 0x007E; // U+007E TILDE (~)\n\nfunction onWhiteSpace(next, children) {\n if (children.last !== null && children.last.type !== 'Combinator' &&\n next !== null && next.type !== 'Combinator') {\n children.push({ // FIXME: this.Combinator() should be used instead\n type: 'Combinator',\n loc: null,\n name: ' '\n });\n }\n}\n\nfunction getNode() {\n switch (this.tokenType) {\n case LeftSquareBracket:\n return this.AttributeSelector();\n\n case Hash:\n return this.IdSelector();\n\n case Colon:\n if (this.lookupType(1) === Colon) {\n return this.PseudoElementSelector();\n } else {\n return this.PseudoClassSelector();\n }\n\n case Ident:\n return this.TypeSelector();\n\n case NumberToken:\n case Percentage:\n return this.Percentage();\n\n case Dimension:\n // throws when .123ident\n if (this.charCodeAt(this.tokenStart) === FULLSTOP) {\n this.error('Identifier is expected', this.tokenStart + 1);\n }\n break;\n\n case Delim: {\n const code = this.charCodeAt(this.tokenStart);\n\n switch (code) {\n case PLUSSIGN:\n case GREATERTHANSIGN:\n case TILDE:\n case SOLIDUS: // /deep/\n return this.Combinator();\n\n case FULLSTOP:\n return this.ClassSelector();\n\n case ASTERISK:\n case VERTICALLINE:\n return this.TypeSelector();\n\n case NUMBERSIGN:\n return this.IdSelector();\n\n case AMPERSAND:\n return this.NestingSelector();\n }\n\n break;\n }\n }\n};\n\nexport default {\n onWhiteSpace,\n getNode\n};\n", "import { Comma, String as StringToken, Ident, RightParenthesis } from '../../tokenizer/index.js';\n\nexport function parseLanguageRangeList() {\n const children = this.createList();\n\n this.skipSC();\n\n loop: while (!this.eof) {\n switch (this.tokenType) {\n case Ident:\n children.push(this.Identifier());\n break;\n\n case StringToken:\n children.push(this.String());\n break;\n\n case Comma:\n children.push(this.Operator());\n break;\n\n case RightParenthesis:\n break loop;\n\n default:\n this.error('Identifier, string or comma is expected');\n }\n\n this.skipSC();\n }\n\n return children;\n}\n", "import { parseLanguageRangeList } from './lang.js';\n\nconst selectorList = {\n parse() {\n return this.createSingleNodeList(\n this.SelectorList()\n );\n }\n};\n\nconst selector = {\n parse() {\n return this.createSingleNodeList(\n this.Selector()\n );\n }\n};\n\nconst identList = {\n parse() {\n return this.createSingleNodeList(\n this.Identifier()\n );\n }\n};\n\nconst langList = {\n parse: parseLanguageRangeList\n};\n\nconst nth = {\n parse() {\n return this.createSingleNodeList(\n this.Nth()\n );\n }\n};\n\nexport default {\n 'dir': identList,\n 'has': selectorList,\n 'lang': langList,\n 'matches': selectorList,\n 'is': selectorList,\n '-moz-any': selectorList,\n '-webkit-any': selectorList,\n 'where': selectorList,\n 'not': selectorList,\n 'nth-child': nth,\n 'nth-last-child': nth,\n 'nth-last-of-type': nth,\n 'nth-of-type': nth,\n 'slotted': selector,\n 'host': selector,\n 'host-context': selector\n};\n", "export { parse as AnPlusB } from './AnPlusB.js';\nexport { parse as AttributeSelector } from './AttributeSelector.js';\nexport { parse as ClassSelector } from './ClassSelector.js';\nexport { parse as Combinator } from './Combinator.js';\nexport { parse as Identifier } from './Identifier.js';\nexport { parse as IdSelector } from './IdSelector.js';\nexport { parse as NestingSelector } from './NestingSelector.js';\nexport { parse as Nth } from './Nth.js';\nexport { parse as Operator } from './Operator.js';\nexport { parse as Percentage } from './Percentage.js';\nexport { parse as PseudoClassSelector } from './PseudoClassSelector.js';\nexport { parse as PseudoElementSelector } from './PseudoElementSelector.js';\nexport { parse as Raw } from './Raw.js';\nexport { parse as Selector } from './Selector.js';\nexport { parse as SelectorList } from './SelectorList.js';\nexport { parse as String } from './String.js';\nexport { parse as TypeSelector } from './TypeSelector.js';\n", "import { Selector } from '../scope/index.js';\nimport pseudo from '../pseudo/index.js';\nimport * as node from '../node/index-parse-selector.js';\n\nexport default {\n parseContext: {\n default: 'SelectorList',\n selectorList: 'SelectorList',\n selector: 'Selector'\n },\n scope: { Selector },\n atrule: {},\n pseudo,\n node\n};\n", "import { createParser } from './create.js';\nimport config from '../syntax/config/parser-selector.js';\n\nexport default createParser(config);\n", "const compare = (s1, s2) => {\n if (s1.a === s2.a) {\n if (s1.b === s2.b) {\n return s1.c - s2.c;\n }\n return s1.b - s2.b;\n }\n return s1.a - s2.a;\n};\n\nconst equals = (s1, s2) => {\n return compare(s1, s2) === 0;\n};\n\nconst greaterThan = (s1, s2) => {\n return compare(s1, s2) > 0;\n};\n\nconst lessThan = (s1, s2) => {\n return compare(s1, s2) < 0;\n};\n\nexport { compare, equals, greaterThan, lessThan };\n", "import { compare } from './compare.js';\n\nconst sort = (specificities, order = 'ASC') => {\n const sorted = specificities.sort(compare);\n\n if (order === 'DESC') {\n return sorted.reverse();\n }\n\n return sorted;\n};\n\nconst sortAsc = (...specificities) => {\n return sort(specificities, 'ASC');\n};\n\nconst sortDesc = (...specificities) => {\n return sort(specificities, 'DESC');\n};\n\nexport { sortAsc, sortDesc };\n", "import { sortAsc, sortDesc } from './sort.js';\n\nconst max = (...specificities) => {\n const sorted = sortDesc(...specificities);\n return sorted[0];\n};\n\nconst min = (...specificities) => {\n const sorted = sortAsc(...specificities);\n return sorted[0];\n};\n\nexport { max, min };\n", "import parse from 'css-tree/selector-parser';\nimport Specificity from '../index.js';\nimport { max } from './../util/index.js';\n\n/** @param {import('css-tree').Selector} selectorAST */\nconst calculateForAST = (selectorAST) => {\n // Quit while you're ahead\n if (!selectorAST || selectorAST.type !== 'Selector') {\n throw new TypeError(`Passed in source is not a Selector AST`);\n }\n\n // https://www.w3.org/TR/selectors-4/#specificity-rules\n let a = 0; /* ID Selectors */\n let b = 0; /* Class selectors, Attributes selectors, and Pseudo-classes */\n let c = 0; /* Type selectors and Pseudo-elements */\n\n selectorAST.children.forEach((child) => {\n switch (child.type) {\n case 'IdSelector':\n a += 1;\n break;\n\n case 'AttributeSelector':\n case 'ClassSelector':\n b += 1;\n break;\n\n case 'PseudoClassSelector':\n switch (child.name.toLowerCase()) {\n // \u201CThe specificity of a :where() pseudo-class is replaced by zero.\u201D\n case 'where':\n // Noop :)\n break;\n\n case '-webkit-any':\n case 'any':\n if (child.children?.first) {\n b += 1;\n }\n break;\n\n // \u201CThe specificity of an :is(), :not(), or :has() pseudo-class is replaced by the specificity of the most specific complex selector in its selector list argument.\u201C\n case '-moz-any':\n case 'is':\n case 'matches':\n case 'not':\n case 'has':\n if (child.children?.first) {\n // Calculate Specificity from nested SelectorList\n const max1 = max(...calculate(child.children.first));\n\n // Adjust orig specificity\n a += max1.a;\n b += max1.b;\n c += max1.c;\n }\n\n break;\n\n // \u201CThe specificity of an :nth-child() or :nth-last-child() selector is the specificity of the pseudo class itself (counting as one pseudo-class selector) plus the specificity of the most specific complex selector in its selector list argument\u201D\n case 'nth-child':\n case 'nth-last-child':\n b += 1;\n\n if (child.children?.first?.selector) {\n // Calculate Specificity from SelectorList\n const max2 = max(...calculate(child.children.first.selector));\n\n // Adjust orig specificity\n a += max2.a;\n b += max2.b;\n c += max2.c;\n }\n break;\n\n // \u201CThe specificity of :host is that of a pseudo-class. The specificity of :host() is that of a pseudo-class, plus the specificity of its argument.\u201D\n // \u201CThe specificity of :host-context() is that of a pseudo-class, plus the specificity of its argument.\u201D\n case 'host-context':\n case 'host':\n b += 1;\n\n if (child.children?.first?.children) {\n // Workaround to a css-tree bug in which it allows complex selectors instead of only compound selectors\n // We work around it by filtering out any Combinator and successive Selectors\n const childAST = { type: 'Selector', children: [] };\n let foundCombinator = false;\n child.children.first.children.forEach((entry) => {\n if (foundCombinator) return false;\n if (entry.type === 'Combinator') {\n foundCombinator = true;\n return false;\n }\n childAST.children.push(entry);\n });\n\n // Calculate Specificity from Selector\n const childSpecificity = calculate(childAST)[0];\n\n // Adjust orig specificity\n a += childSpecificity.a;\n b += childSpecificity.b;\n c += childSpecificity.c;\n }\n break;\n\n // Improper use of Pseudo-Class Selectors instead of a Pseudo-Element\n // @ref https://developer.mozilla.org/en-US/docs/Web/CSS/Pseudo-elements#index\n case 'after':\n case 'before':\n case 'first-letter':\n case 'first-line':\n c += 1;\n break;\n\n default:\n b += 1;\n break;\n }\n break;\n\n case 'PseudoElementSelector':\n switch (child.name) {\n // \u201CThe specificity of ::slotted() is that of a pseudo-element, plus the specificity of its argument.\u201D\n case 'slotted':\n c += 1;\n\n if (child.children?.first?.children) {\n // Workaround to a css-tree bug in which it allows complex selectors instead of only compound selectors\n // We work around it by filtering out any Combinator and successive Selectors\n const childAST = { type: 'Selector', children: [] };\n let foundCombinator = false;\n child.children.first.children.forEach((entry) => {\n if (foundCombinator) return false;\n if (entry.type === 'Combinator') {\n foundCombinator = true;\n return false;\n }\n childAST.children.push(entry);\n });\n\n // Calculate Specificity from Selector\n const childSpecificity = calculate(childAST)[0];\n\n // Adjust orig specificity\n a += childSpecificity.a;\n b += childSpecificity.b;\n c += childSpecificity.c;\n }\n break;\n\n case 'view-transition-group':\n case 'view-transition-image-pair':\n case 'view-transition-old':\n case 'view-transition-new':\n // The specificity of a view-transition selector with a * argument is zero.\n if (child.children?.first?.value === '*') {\n break;\n }\n // The specificity of a view-transition selector with an argument is the same\n // as for other pseudo - elements, and is equivalent to a type selector.\n c += 1;\n break;\n\n default:\n c += 1;\n break;\n }\n break;\n\n case 'TypeSelector':\n // Omit namespace\n let typeSelector = child.name;\n if (typeSelector.includes('|')) {\n typeSelector = typeSelector.split('|')[1];\n }\n\n // \u201CIgnore the universal selector\u201D\n if (typeSelector !== '*') {\n c += 1;\n }\n break;\n\n default:\n // NOOP\n break;\n }\n });\n\n return new Specificity({ a, b, c }, selectorAST);\n};\n\nconst convertToAST = (source) => {\n // The passed in argument was a String.\n // ~> Let's try and parse to an AST\n if (typeof source === 'string' || source instanceof String) {\n try {\n return parse(source, {\n context: 'selectorList',\n });\n } catch (e) {\n throw new TypeError(`Could not convert passed in source '${source}' to SelectorList: ${e.message}`);\n }\n }\n\n // The passed in argument was an Object.\n // ~> Let's verify if it's a AST of the type Selector or SelectorList\n if (source instanceof Object) {\n if (source.type && ['Selector', 'SelectorList'].includes(source.type)) {\n return source;\n }\n\n // Manually parsing subtree when the child is of the type Raw, most likely due to https://github.com/csstree/csstree/issues/151\n if (source.type && source.type === 'Raw') {\n try {\n return parse(source.value, {\n context: 'selectorList',\n });\n } catch (e) {\n throw new TypeError(`Could not convert passed in source to SelectorList: ${e.message}`);\n }\n }\n\n throw new TypeError(`Passed in source is an Object but no AST / AST of the type Selector or SelectorList`);\n }\n\n throw new TypeError(`Passed in source is not a String nor an Object. I don't know what to do with it.`);\n};\n\n/**\n * @param {string} selector\n * @returns {Specificity[]}\n */\nconst calculate = (selector) => {\n // Quit while you're ahead\n if (!selector) {\n return [];\n }\n\n // Make sure we have a SelectorList AST\n // If not, an exception will be thrown\n const ast = convertToAST(selector);\n\n // Selector?\n if (ast.type === 'Selector') {\n return [calculateForAST(selector)];\n }\n\n // SelectorList?\n // ~> Calculate Specificity for each contained Selector\n if (ast.type === 'SelectorList') {\n const specificities = [];\n ast.children.forEach((childAST) => {\n const specificity = calculateForAST(childAST);\n specificities.push(specificity);\n });\n return specificities;\n }\n};\n\nexport { calculate, calculateForAST };\n", "import generate from 'css-tree/generator';\n\nimport { calculate, calculateForAST } from './core/index.js';\nimport { compare, equals, greaterThan, lessThan } from './util/compare.js';\nimport { min, max } from './util/filter.js';\nimport { sortAsc, sortDesc } from './util/sort.js';\n\nclass NotAllowedError extends Error {\n constructor() {\n super('Manipulating a Specificity instance is not allowed. Instead, create a new Specificity()');\n }\n}\n\nclass Specificity {\n constructor(value, selector = null) {\n this.value = value;\n this.selector = selector;\n }\n\n get a() {\n return this.value.a;\n }\n\n set a(val) {\n throw new NotAllowedError();\n }\n\n get b() {\n return this.value.b;\n }\n\n set b(val) {\n throw new NotAllowedError();\n }\n\n get c() {\n return this.value.c;\n }\n\n set c(val) {\n throw new NotAllowedError();\n }\n\n selectorString() {\n // this.selector already is a String\n if (typeof this.selector === 'string' || this.selector instanceof String) {\n return this.selector;\n }\n\n // this.selector is a Selector as parsed by CSSTree\n if (this.selector instanceof Object) {\n if (this.selector.type === 'Selector') {\n return generate(this.selector);\n }\n }\n\n // this.selector is something else \u2026\n return '';\n }\n\n toObject() {\n return this.value;\n }\n\n toArray() {\n return [this.value.a, this.value.b, this.value.c];\n }\n\n toString() {\n return `(${this.value.a},${this.value.b},${this.value.c})`;\n }\n\n toJSON() {\n return {\n selector: this.selectorString(),\n asObject: this.toObject(),\n asArray: this.toArray(),\n asString: this.toString(),\n };\n }\n\n isEqualTo(otherSpecificity) {\n return equals(this, otherSpecificity);\n }\n\n isGreaterThan(otherSpecificity) {\n return greaterThan(this, otherSpecificity);\n }\n\n isLessThan(otherSpecificity) {\n return lessThan(this, otherSpecificity);\n }\n\n static calculate(selector) {\n return calculate(selector);\n }\n\n static calculateForAST(selector) {\n return calculateForAST(selector);\n }\n\n static compare(s1, s2) {\n return compare(s1, s2);\n }\n\n static equals(s1, s2) {\n return equals(s1, s2);\n }\n\n static lessThan(s1, s2) {\n return lessThan(s1, s2);\n }\n\n static greaterThan(s1, s2) {\n return greaterThan(s1, s2);\n }\n\n static min(...specificities) {\n return min(...specificities);\n }\n\n static max(...specificities) {\n return max(...specificities);\n }\n\n static sortAsc(...specificities) {\n return sortAsc(...specificities);\n }\n\n static sortDesc(...specificities) {\n return sortDesc(...specificities);\n }\n}\n\nexport default Specificity;\n"], + "mappings": "8pBAAA,eAOA,GAAI,IAAe,mEAAmE,MAAM,IAK5F,GAAQ,OAAS,SAAU,EAAQ,CACjC,GAAI,GAAK,GAAU,EAAS,GAAa,OACvC,MAAO,IAAa,GAEtB,KAAM,IAAI,WAAU,6BAA+B,IAOrD,GAAQ,OAAS,SAAU,EAAU,CACnC,GAAI,GAAO,GACP,EAAO,GAEP,EAAU,GACV,EAAU,IAEV,EAAO,GACP,EAAO,GAEP,EAAO,GACP,EAAQ,GAER,EAAe,GACf,EAAe,GAGnB,MAAI,IAAQ,GAAY,GAAY,EAC1B,EAAW,EAIjB,GAAW,GAAY,GAAY,EAC7B,EAAW,EAAU,EAI3B,GAAQ,GAAY,GAAY,EAC1B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AAI,OAAO,MAAK,UAAa,UAAY,KAAK,mBAAoB,QACvD,KAAK,SAIZ,KAAK,mBAAoB,SACrB,KAAK,SAAS,OAAS,WAChB,GAAS,KAAK,UAKtB,GAGX,UAAW,CACP,MAAO,MAAK,MAGhB,SAAU,CACN,MAAO,CAAC,KAAK,MAAM,EAAG,KAAK,MAAM,EAAG,KAAK,MAAM,GAGnD,UAAW,CACP,MAAO,IAAI,KAAK,MAAM,KAAK,KAAK,MAAM,KAAK,KAAK,MAAM,KAG1D,QAAS,CACL,MAAO,CACH,SAAU,KAAK,iBACf,SAAU,KAAK,WACf,QAAS,KAAK,UACd,SAAU,KAAK,YAIvB,UAAU,EAAkB,CACxB,MAAO,IAAO,KAAM,GAGxB,cAAc,EAAkB,CAC5B,MAAO,IAAY,KAAM,GAG7B,WAAW,EAAkB,CACzB,MAAO,IAAS,KAAM,SAGnB,WAAU,EAAU,CACvB,MAAO,IAAU,SAGd,iBAAgB,EAAU,CAC7B,MAAO,IAAgB,SAGpB,SAAQ,EAAI,EAAI,CACnB,MAAO,IAAQ,EAAI,SAGhB,QAAO,EAAI,EAAI,CAClB,MAAO,IAAO,EAAI,SAGf,UAAS,EAAI,EAAI,CACpB,MAAO,IAAS,EAAI,SAGjB,aAAY,EAAI,EAAI,CACvB,MAAO,IAAY,EAAI,SAGpB,QAAO,EAAe,CACzB,MAAO,IAAI,GAAG,SAGX,QAAO,EAAe,CACzB,MAAO,IAAI,GAAG,SAGX,YAAW,EAAe,CAC7B,MAAO,IAAQ,GAAG,SAGf,aAAY,EAAe,CAC9B,MAAO,IAAS,GAAG,KAIpB,GAAQ", + "names": [] +} diff --git a/node_modules/@bramus/specificity/index.d.ts b/node_modules/@bramus/specificity/index.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..95d477af20575133c91c0a8d6fb4d6b2efa55220 --- /dev/null +++ b/node_modules/@bramus/specificity/index.d.ts @@ -0,0 +1,59 @@ +// Types & Classes +export type SpecificityArray = [number, number, number]; +export type SpecificityObject = { a: number; b: number; c: number }; + +export default class Specificity { + static calculate(selector: string | CSSTreeAST): Array; + static calculateForAST(selectorAST: CSSTreeAST): Specificity; + static compare(s1: SpecificityInstanceOrObject, s2: SpecificityInstanceOrObject): number; + static equals(s1: SpecificityInstanceOrObject, s2: SpecificityInstanceOrObject): boolean; + static lessThan(s1: SpecificityInstanceOrObject, s2: SpecificityInstanceOrObject): boolean; + static greaterThan(s1: SpecificityInstanceOrObject, s2: SpecificityInstanceOrObject): boolean; + static min(...specificities: SpecificityInstanceOrObject[]): SpecificityInstanceOrObject; + static max(...specificities: SpecificityInstanceOrObject[]): SpecificityInstanceOrObject; + static sortAsc(...specificities: SpecificityInstanceOrObject[]): SpecificityInstanceOrObject; + static sortDesc(...specificities: SpecificityInstanceOrObject[]): SpecificityInstanceOrObject; + constructor(value: SpecificityObject, selector?: any); + value: SpecificityObject; + selector: string | CSSTreeAST; + set a(arg: number); + get a(): number; + set b(arg: number); + get b(): number; + set c(arg: number); + get c(): number; + selectorString(): string; + toObject(): SpecificityObject; + toArray(): SpecificityArray; + toString(): string; + toJSON(): { + selector: string; + asObject: SpecificityObject; + asArray: SpecificityArray; + asString: string; + }; + isEqualTo(otherSpecificity: SpecificityInstanceOrObject): boolean; + isGreaterThan(otherSpecificity: SpecificityInstanceOrObject): boolean; + isLessThan(otherSpecificity: SpecificityInstanceOrObject): boolean; +} + +type SpecificityInstanceOrObject = Specificity | SpecificityObject; +type CSSTreeAST = Object; // @TODO: Define shape + +// CORE +export function calculate(selector: string | CSSTreeAST): Array; +export function calculateForAST(selectorAST: CSSTreeAST): Specificity; + +// UTIL: COMPARE +export function equals(s1: SpecificityInstanceOrObject, s2: SpecificityInstanceOrObject): boolean; +export function greaterThan(s1: SpecificityInstanceOrObject, s2: SpecificityInstanceOrObject): boolean; +export function lessThan(s1: SpecificityInstanceOrObject, s2: SpecificityInstanceOrObject): boolean; +export function compare(s1: SpecificityInstanceOrObject, s2: SpecificityInstanceOrObject): number; + +// UTIL: FILTER +export function min(specificities: SpecificityInstanceOrObject[]): SpecificityInstanceOrObject; +export function max(specificities: SpecificityInstanceOrObject[]): SpecificityInstanceOrObject; + +// UTIL: SORT +export function sortAsc(specificities: SpecificityInstanceOrObject[]): SpecificityInstanceOrObject[]; +export function sortDesc(specificities: SpecificityInstanceOrObject[]): SpecificityInstanceOrObject[]; diff --git a/node_modules/@bramus/specificity/package.json b/node_modules/@bramus/specificity/package.json new file mode 100644 index 0000000000000000000000000000000000000000..1674a61d57e6adcc2320477dce6a647dd29bf32e --- /dev/null +++ b/node_modules/@bramus/specificity/package.json @@ -0,0 +1,92 @@ +{ + "name": "@bramus/specificity", + "version": "2.4.2", + "description": "Calculate specificity of a CSS Selector", + "type": "module", + "main": "./dist/index.cjs", + "module": "./dist/index.js", + "exports": { + ".": { + "browser": "./dist/index.js", + "import": "./dist/index.js", + "require": "./dist/index.cjs" + }, + "./core": { + "import": "./src/core/index.js" + }, + "./util": { + "import": "./src/util/index.js" + }, + "./compare": { + "import": "./src/util/compare.js" + }, + "./filter": { + "import": "./src/util/filter.js" + }, + "./sort": { + "import": "./src/util/sort.js" + } + }, + "unpkg": "./dist/index.js", + "jsdelivr": "./dist/index.js", + "files": [ + "bin", + "src", + "dist", + "index.d.ts" + ], + "types": "./index.d.ts", + "bin": { + "specificity": "./bin/cli.js" + }, + "scripts": { + "build-esm": "esbuild --bundle ./src/index.js --outfile=./dist/index.js --format=esm --sourcemap --minify", + "build-cjs": "esbuild --bundle ./src/index.js --outfile=./dist/index.cjs --format=cjs --sourcemap --minify", + "lint": "prettier --check '{src,test}/**/*.{ts,tsx,js,jsx}'", + "format": "prettier --write '{src,test}/**/*.{ts,tsx,js,jsx}'", + "build": "npm run build-esm && npm run build-cjs", + "prepack": "npm run prevent-dirty-tree && npm run test", + "prepublish": "npm run build", + "pretest": "npm run build", + "test": "mocha", + "prebenchmark": "npm run build", + "benchmark": "node ./benchmark/bench.cjs", + "beta-version-patch": "npm version $(semver $npm_package_version -i prerelease --preid beta)", + "beta-version-minor": "npm version $(semver $npm_package_version -i preminor --preid beta)", + "beta-version-major": "npm version $(semver $npm_package_version -i premajor --preid beta)", + "rc-version": "npm version $(semver $npm_package_version -i prerelease --preid rc)", + "final-release": "npm version $(semver $npm_package_version -i)", + "preversion": "npm run prevent-dirty-tree && npm run test", + "prevent-dirty-tree": "exit $(git status --porcelain | wc -l)" + }, + "repository": { + "type": "git", + "url": "git+https://github.com/bramus/specificity.git" + }, + "keywords": [ + "css", + "specificity" + ], + "author": { + "name": "Bramus Van Damme", + "email": "bramus@bram.us", + "twitter": "@bramus", + "web": "https://www.bram.us/" + }, + "license": "MIT", + "bugs": { + "url": "https://github.com/bramus/specificity/issues" + }, + "homepage": "https://github.com/bramus/specificity#readme", + "devDependencies": { + "benchmark": "^2.1.4", + "esbuild": "^0.25.0", + "microtime": "^3.1.1", + "mocha": "^11.1.0", + "prettier": "^3.5.1", + "semver": "^7.7.1" + }, + "dependencies": { + "css-tree": "^3.0.0" + } +} diff --git a/node_modules/@bramus/specificity/src/core/calculate.js b/node_modules/@bramus/specificity/src/core/calculate.js new file mode 100644 index 0000000000000000000000000000000000000000..f05b1aed152a0b3606ff576e75082c7deb245245 --- /dev/null +++ b/node_modules/@bramus/specificity/src/core/calculate.js @@ -0,0 +1,260 @@ +import parse from 'css-tree/selector-parser'; +import Specificity from '../index.js'; +import { max } from './../util/index.js'; + +/** @param {import('css-tree').Selector} selectorAST */ +const calculateForAST = (selectorAST) => { + // Quit while you're ahead + if (!selectorAST || selectorAST.type !== 'Selector') { + throw new TypeError(`Passed in source is not a Selector AST`); + } + + // https://www.w3.org/TR/selectors-4/#specificity-rules + let a = 0; /* ID Selectors */ + let b = 0; /* Class selectors, Attributes selectors, and Pseudo-classes */ + let c = 0; /* Type selectors and Pseudo-elements */ + + selectorAST.children.forEach((child) => { + switch (child.type) { + case 'IdSelector': + a += 1; + break; + + case 'AttributeSelector': + case 'ClassSelector': + b += 1; + break; + + case 'PseudoClassSelector': + switch (child.name.toLowerCase()) { + // “The specificity of a :where() pseudo-class is replaced by zero.” + case 'where': + // Noop :) + break; + + case '-webkit-any': + case 'any': + if (child.children?.first) { + b += 1; + } + break; + + // “The specificity of an :is(), :not(), or :has() pseudo-class is replaced by the specificity of the most specific complex selector in its selector list argument.“ + case '-moz-any': + case 'is': + case 'matches': + case 'not': + case 'has': + if (child.children?.first) { + // Calculate Specificity from nested SelectorList + const max1 = max(...calculate(child.children.first)); + + // Adjust orig specificity + a += max1.a; + b += max1.b; + c += max1.c; + } + + break; + + // “The specificity of an :nth-child() or :nth-last-child() selector is the specificity of the pseudo class itself (counting as one pseudo-class selector) plus the specificity of the most specific complex selector in its selector list argument” + case 'nth-child': + case 'nth-last-child': + b += 1; + + if (child.children?.first?.selector) { + // Calculate Specificity from SelectorList + const max2 = max(...calculate(child.children.first.selector)); + + // Adjust orig specificity + a += max2.a; + b += max2.b; + c += max2.c; + } + break; + + // “The specificity of :host is that of a pseudo-class. The specificity of :host() is that of a pseudo-class, plus the specificity of its argument.” + // “The specificity of :host-context() is that of a pseudo-class, plus the specificity of its argument.” + case 'host-context': + case 'host': + b += 1; + + if (child.children?.first?.children) { + // Workaround to a css-tree bug in which it allows complex selectors instead of only compound selectors + // We work around it by filtering out any Combinator and successive Selectors + const childAST = { type: 'Selector', children: [] }; + let foundCombinator = false; + child.children.first.children.forEach((entry) => { + if (foundCombinator) return false; + if (entry.type === 'Combinator') { + foundCombinator = true; + return false; + } + childAST.children.push(entry); + }); + + // Calculate Specificity from Selector + const childSpecificity = calculate(childAST)[0]; + + // Adjust orig specificity + a += childSpecificity.a; + b += childSpecificity.b; + c += childSpecificity.c; + } + break; + + // Improper use of Pseudo-Class Selectors instead of a Pseudo-Element + // @ref https://developer.mozilla.org/en-US/docs/Web/CSS/Pseudo-elements#index + case 'after': + case 'before': + case 'first-letter': + case 'first-line': + c += 1; + break; + + default: + b += 1; + break; + } + break; + + case 'PseudoElementSelector': + switch (child.name) { + // “The specificity of ::slotted() is that of a pseudo-element, plus the specificity of its argument.” + case 'slotted': + c += 1; + + if (child.children?.first?.children) { + // Workaround to a css-tree bug in which it allows complex selectors instead of only compound selectors + // We work around it by filtering out any Combinator and successive Selectors + const childAST = { type: 'Selector', children: [] }; + let foundCombinator = false; + child.children.first.children.forEach((entry) => { + if (foundCombinator) return false; + if (entry.type === 'Combinator') { + foundCombinator = true; + return false; + } + childAST.children.push(entry); + }); + + // Calculate Specificity from Selector + const childSpecificity = calculate(childAST)[0]; + + // Adjust orig specificity + a += childSpecificity.a; + b += childSpecificity.b; + c += childSpecificity.c; + } + break; + + case 'view-transition-group': + case 'view-transition-image-pair': + case 'view-transition-old': + case 'view-transition-new': + // The specificity of a view-transition selector with a * argument is zero. + if (child.children?.first?.value === '*') { + break; + } + // The specificity of a view-transition selector with an argument is the same + // as for other pseudo - elements, and is equivalent to a type selector. + c += 1; + break; + + default: + c += 1; + break; + } + break; + + case 'TypeSelector': + // Omit namespace + let typeSelector = child.name; + if (typeSelector.includes('|')) { + typeSelector = typeSelector.split('|')[1]; + } + + // “Ignore the universal selector” + if (typeSelector !== '*') { + c += 1; + } + break; + + default: + // NOOP + break; + } + }); + + return new Specificity({ a, b, c }, selectorAST); +}; + +const convertToAST = (source) => { + // The passed in argument was a String. + // ~> Let's try and parse to an AST + if (typeof source === 'string' || source instanceof String) { + try { + return parse(source, { + context: 'selectorList', + }); + } catch (e) { + throw new TypeError(`Could not convert passed in source '${source}' to SelectorList: ${e.message}`); + } + } + + // The passed in argument was an Object. + // ~> Let's verify if it's a AST of the type Selector or SelectorList + if (source instanceof Object) { + if (source.type && ['Selector', 'SelectorList'].includes(source.type)) { + return source; + } + + // Manually parsing subtree when the child is of the type Raw, most likely due to https://github.com/csstree/csstree/issues/151 + if (source.type && source.type === 'Raw') { + try { + return parse(source.value, { + context: 'selectorList', + }); + } catch (e) { + throw new TypeError(`Could not convert passed in source to SelectorList: ${e.message}`); + } + } + + throw new TypeError(`Passed in source is an Object but no AST / AST of the type Selector or SelectorList`); + } + + throw new TypeError(`Passed in source is not a String nor an Object. I don't know what to do with it.`); +}; + +/** + * @param {string} selector + * @returns {Specificity[]} + */ +const calculate = (selector) => { + // Quit while you're ahead + if (!selector) { + return []; + } + + // Make sure we have a SelectorList AST + // If not, an exception will be thrown + const ast = convertToAST(selector); + + // Selector? + if (ast.type === 'Selector') { + return [calculateForAST(selector)]; + } + + // SelectorList? + // ~> Calculate Specificity for each contained Selector + if (ast.type === 'SelectorList') { + const specificities = []; + ast.children.forEach((childAST) => { + const specificity = calculateForAST(childAST); + specificities.push(specificity); + }); + return specificities; + } +}; + +export { calculate, calculateForAST }; diff --git a/node_modules/@bramus/specificity/src/core/index.js b/node_modules/@bramus/specificity/src/core/index.js new file mode 100644 index 0000000000000000000000000000000000000000..0db60bf03391068a9679effef3483c394bcd698a --- /dev/null +++ b/node_modules/@bramus/specificity/src/core/index.js @@ -0,0 +1 @@ +export { calculate, calculateForAST } from './calculate.js'; diff --git a/node_modules/@bramus/specificity/src/index.js b/node_modules/@bramus/specificity/src/index.js new file mode 100644 index 0000000000000000000000000000000000000000..cfa1932dc7fb7f1130f09f496feb2f6d3d6b4a0b --- /dev/null +++ b/node_modules/@bramus/specificity/src/index.js @@ -0,0 +1,135 @@ +import generate from 'css-tree/generator'; + +import { calculate, calculateForAST } from './core/index.js'; +import { compare, equals, greaterThan, lessThan } from './util/compare.js'; +import { min, max } from './util/filter.js'; +import { sortAsc, sortDesc } from './util/sort.js'; + +class NotAllowedError extends Error { + constructor() { + super('Manipulating a Specificity instance is not allowed. Instead, create a new Specificity()'); + } +} + +class Specificity { + constructor(value, selector = null) { + this.value = value; + this.selector = selector; + } + + get a() { + return this.value.a; + } + + set a(val) { + throw new NotAllowedError(); + } + + get b() { + return this.value.b; + } + + set b(val) { + throw new NotAllowedError(); + } + + get c() { + return this.value.c; + } + + set c(val) { + throw new NotAllowedError(); + } + + selectorString() { + // this.selector already is a String + if (typeof this.selector === 'string' || this.selector instanceof String) { + return this.selector; + } + + // this.selector is a Selector as parsed by CSSTree + if (this.selector instanceof Object) { + if (this.selector.type === 'Selector') { + return generate(this.selector); + } + } + + // this.selector is something else … + return ''; + } + + toObject() { + return this.value; + } + + toArray() { + return [this.value.a, this.value.b, this.value.c]; + } + + toString() { + return `(${this.value.a},${this.value.b},${this.value.c})`; + } + + toJSON() { + return { + selector: this.selectorString(), + asObject: this.toObject(), + asArray: this.toArray(), + asString: this.toString(), + }; + } + + isEqualTo(otherSpecificity) { + return equals(this, otherSpecificity); + } + + isGreaterThan(otherSpecificity) { + return greaterThan(this, otherSpecificity); + } + + isLessThan(otherSpecificity) { + return lessThan(this, otherSpecificity); + } + + static calculate(selector) { + return calculate(selector); + } + + static calculateForAST(selector) { + return calculateForAST(selector); + } + + static compare(s1, s2) { + return compare(s1, s2); + } + + static equals(s1, s2) { + return equals(s1, s2); + } + + static lessThan(s1, s2) { + return lessThan(s1, s2); + } + + static greaterThan(s1, s2) { + return greaterThan(s1, s2); + } + + static min(...specificities) { + return min(...specificities); + } + + static max(...specificities) { + return max(...specificities); + } + + static sortAsc(...specificities) { + return sortAsc(...specificities); + } + + static sortDesc(...specificities) { + return sortDesc(...specificities); + } +} + +export default Specificity; diff --git a/node_modules/@bramus/specificity/src/util/compare.js b/node_modules/@bramus/specificity/src/util/compare.js new file mode 100644 index 0000000000000000000000000000000000000000..4e2fcf912a33a0688885d42e94d7c20899ef2065 --- /dev/null +++ b/node_modules/@bramus/specificity/src/util/compare.js @@ -0,0 +1,23 @@ +const compare = (s1, s2) => { + if (s1.a === s2.a) { + if (s1.b === s2.b) { + return s1.c - s2.c; + } + return s1.b - s2.b; + } + return s1.a - s2.a; +}; + +const equals = (s1, s2) => { + return compare(s1, s2) === 0; +}; + +const greaterThan = (s1, s2) => { + return compare(s1, s2) > 0; +}; + +const lessThan = (s1, s2) => { + return compare(s1, s2) < 0; +}; + +export { compare, equals, greaterThan, lessThan }; diff --git a/node_modules/@bramus/specificity/src/util/filter.js b/node_modules/@bramus/specificity/src/util/filter.js new file mode 100644 index 0000000000000000000000000000000000000000..4cf500a4b665e10347b41def63a342254cc112db --- /dev/null +++ b/node_modules/@bramus/specificity/src/util/filter.js @@ -0,0 +1,13 @@ +import { sortAsc, sortDesc } from './sort.js'; + +const max = (...specificities) => { + const sorted = sortDesc(...specificities); + return sorted[0]; +}; + +const min = (...specificities) => { + const sorted = sortAsc(...specificities); + return sorted[0]; +}; + +export { max, min }; diff --git a/node_modules/@bramus/specificity/src/util/index.js b/node_modules/@bramus/specificity/src/util/index.js new file mode 100644 index 0000000000000000000000000000000000000000..160f3412dccd194412f0a26928e6900f7435713d --- /dev/null +++ b/node_modules/@bramus/specificity/src/util/index.js @@ -0,0 +1,3 @@ +export * from './compare.js'; +export * from './sort.js'; +export * from './filter.js'; diff --git a/node_modules/@bramus/specificity/src/util/sort.js b/node_modules/@bramus/specificity/src/util/sort.js new file mode 100644 index 0000000000000000000000000000000000000000..9691c6eef53253b092918161cf644c3eca8c9edb --- /dev/null +++ b/node_modules/@bramus/specificity/src/util/sort.js @@ -0,0 +1,21 @@ +import { compare } from './compare.js'; + +const sort = (specificities, order = 'ASC') => { + const sorted = specificities.sort(compare); + + if (order === 'DESC') { + return sorted.reverse(); + } + + return sorted; +}; + +const sortAsc = (...specificities) => { + return sort(specificities, 'ASC'); +}; + +const sortDesc = (...specificities) => { + return sort(specificities, 'DESC'); +}; + +export { sortAsc, sortDesc }; diff --git a/node_modules/@csstools/color-helpers/CHANGELOG.md b/node_modules/@csstools/color-helpers/CHANGELOG.md new file mode 100644 index 0000000000000000000000000000000000000000..d99d4c8feacf9f02cd966e79505c5b6ff814ab78 --- /dev/null +++ b/node_modules/@csstools/color-helpers/CHANGELOG.md @@ -0,0 +1,9 @@ +# Changes to Color Helpers + +### 6.0.2 + +_February 21, 2026_ + +- Updated: gamut mapping algorithm + +[Full CHANGELOG](https://github.com/csstools/postcss-plugins/tree/main/packages/color-helpers/CHANGELOG.md) diff --git a/node_modules/@csstools/color-helpers/LICENSE.md b/node_modules/@csstools/color-helpers/LICENSE.md new file mode 100644 index 0000000000000000000000000000000000000000..e8ae93b9f928ff78839d6b26e3a079d9c95ed3be --- /dev/null +++ b/node_modules/@csstools/color-helpers/LICENSE.md @@ -0,0 +1,18 @@ +MIT No Attribution (MIT-0) + +Copyright © CSSTools Contributors + +Permission is hereby granted, free of charge, to any person obtaining a copy of +this software and associated documentation files (the “Software”), to deal in +the Software without restriction, including without limitation the rights to +use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies +of the Software, and to permit persons to whom the Software is furnished to do +so. + +THE SOFTWARE IS PROVIDED “AS IS”, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +SOFTWARE. diff --git a/node_modules/@csstools/color-helpers/README.md b/node_modules/@csstools/color-helpers/README.md new file mode 100644 index 0000000000000000000000000000000000000000..97528d0eb893658ede4725a60c6f4d5dc56e4d33 --- /dev/null +++ b/node_modules/@csstools/color-helpers/README.md @@ -0,0 +1,32 @@ +# Color Helpers for CSS + +[npm version][npm-url] +[Build Status][cli-url] +[Discord][discord] + +## Usage + +Add [Color Helpers] to your project: + +```bash +npm install @csstools/color-helpers --save-dev +``` + +This package exists to join all the different color functions scattered among the Colors 4 and Colors 5 plugins we maintain such as: + +* [PostCSS Color Function] +* [PostCSS Lab Function] +* [PostCSS OKLab Function] + +## Copyright + +This software or document includes material copied from or derived from https://github.com/w3c/csswg-drafts/tree/main/css-color-4. Copyright © 2022 W3C® (MIT, ERCIM, Keio, Beihang). + +[cli-url]: https://github.com/csstools/postcss-plugins/actions/workflows/test.yml?query=workflow/test +[discord]: https://discord.gg/bUadyRwkJS +[npm-url]: https://www.npmjs.com/package/@csstools/color-helpers + +[Color Helpers]: https://github.com/csstools/postcss-plugins/tree/main/packages/color-helpers +[PostCSS Color Function]: https://github.com/csstools/postcss-plugins/tree/main/plugins/postcss-color-function +[PostCSS Lab Function]: https://github.com/csstools/postcss-plugins/tree/main/plugins/postcss-lab-functionw +[PostCSS OKLab Function]: https://github.com/csstools/postcss-plugins/tree/main/plugins/postcss-oklab-function diff --git a/node_modules/@csstools/color-helpers/dist/index.d.ts b/node_modules/@csstools/color-helpers/dist/index.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..2eb948cf72a944deea94c9e8d70e29c18179a7f9 --- /dev/null +++ b/node_modules/@csstools/color-helpers/dist/index.d.ts @@ -0,0 +1,429 @@ +/** + * @param {Color} color [r, g, b] + * - Red as number 0..1; + * - Green as number 0..1; + * - Blue as number 0..1; + * @return {Color} D50 XYZ [x, y, z] + */ +export declare function a98_RGB_to_XYZ_D50(x: Color): Color; + +export declare function clip(color: Color): Color; + +export declare type Color = [number, number, number]; + +/** + * WCAG 2.1 contrast ratio + */ +export declare function contrast_ratio_wcag_2_1(color1: Color, color2: Color): number; + +/** + * Convert an array of linear-light display-p3 RGB in the range 0.0-1.0 + * to gamma corrected 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). + */ +export declare function gam_P3(RGB: Color): Color; + +/** + * Convert an array of linear-light sRGB values in the range 0.0-1.0 to gamma corrected form + * Extended transfer function: + * For negative values, linear portion extends on reflection + * of axis, then uses reflected pow below that + * + * @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 + */ +export declare function gam_sRGB(RGB: Color): Color; + +/** + * @param {Color} color [h, s, l] + * - Hue as degrees 0..360; + * - Saturation as number 0..100; + * - Lightness as number 0..100; + * @return {Color} D50 XYZ [x, y, z] + */ +export declare function HSL_to_XYZ_D50(x: Color): Color; + +/** + * @param {Color} color [h, w, b] + * - Hue as degrees 0..360; + * - Whiteness as number 0..100; + * - Blackness as number 0..100; + * @return {Color} D50 XYZ [x, y, z] + */ +export declare function HWB_to_XYZ_D50(x: Color): Color; + +export declare function inGamut(x: Color): boolean; + +/** + * @param {Color} color [l, a, b] + * - Lightness as number 0..100; + * - a as number -160..160; + * - b as number -160..160; + * @return {Color} D50 XYZ [x, y, z] + */ +export declare function Lab_to_XYZ_D50(x: Color): Color; + +/** + * @param {Color} color [l, c, h] + * - Lightness as number 0..100; + * - Chroma as number 0..230; + * - Hue as degrees 0..360; + * @return {Color} D50 XYZ [x, y, z] + */ +export declare function LCH_to_XYZ_D50(x: Color): Color; + +/** + * 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). + */ +export declare function lin_P3(RGB: Color): Color; + +/** + * Convert an array of linear-light display-p3 values to CIE XYZ + * using 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). + * @see http://www.brucelindbloom.com/index.html?Eqn_RGB_XYZ_Matrix.html + */ +export declare function lin_P3_to_XYZ(rgb: Color): Color; + +/** + * @param {Color} color [r, g, b] + * - Red as number 0..1; + * - Green as number 0..1; + * - Blue as number 0..1; + * @return {Color} D50 XYZ [x, y, z] + */ +export declare function lin_P3_to_XYZ_D50(x: Color): Color; + +/** + * Convert an array of of sRGB values where in-gamut values are in the range + * [0 - 1] to linear light (un-companded) form. + * Extended transfer function: + * For negative values, linear portion is extended on reflection of axis, + * then reflected power function is used. + * + * @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 + */ +export declare function lin_sRGB(RGB: Color): Color; + +/** + * 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). + */ +export declare function lin_sRGB_to_XYZ(rgb: Color): Color; + +/** + * @param {Color} color [r, g, b] + * - Red as number 0..1; + * - Green as number 0..1; + * - Blue as number 0..1; + * @return {Color} D50 XYZ [x, y, z] + */ +export declare function lin_sRGB_to_XYZ_D50(x: Color): Color; + +export declare function mapGamut(startOKLCH: Color, toDestination: (x: Color) => Color, fromDestination: (x: Color) => Color): Color; + +/** + * @license MIT https://github.com/facelessuser/coloraide/blob/main/LICENSE.md + */ +export declare function mapGamutRayTrace(startOKLCH: Color, toLinear: (x: Color) => Color, fromLinear: (x: Color) => Color): Color; + +export declare const namedColors: Record; + +/** + * @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 + */ +export declare function OKLab_to_OKLCH(OKLab: Color): Color; + +/** + * Given OKLab, convert to XYZ relative 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). + * @see https://github.com/w3c/csswg-drafts/blob/main/css-color-4/conversions.js + */ +export declare function OKLab_to_XYZ(OKLab: Color): Color; + +/** + * @param {Color} color [l, a, b] + * - Lightness as number 0..1; + * - a as number 0..0.5; + * - b as number 0..0.5; + * @return {Color} D50 XYZ [x, y, z] + */ +export declare function OKLab_to_XYZ_D50(x: Color): Color; + +/** + * @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 + */ +export declare function OKLCH_to_OKLab(OKLCH: Color): Color; + +/** + * @param {Color} color [l, c, h] + * - Lightness as number 0..1; + * - Chroma as number 0..0.5; + * - Hue as degrees 0..360; + * @return {Color} D50 XYZ [x, y, z] + */ +export declare function OKLCH_to_XYZ_D50(x: Color): Color; + +/** + * @param {Color} color [r, g, b] + * - Red as number 0..1; + * - Green as number 0..1; + * - Blue as number 0..1; + * @return {Color} D50 XYZ [x, y, z] + */ +export declare function P3_to_XYZ_D50(x: Color): Color; + +/** + * @param {Color} color [r, g, b] + * - Red as number 0..1; + * - Green as number 0..1; + * - Blue as number 0..1; + * @return {Color} D50 XYZ [x, y, z] + */ +export declare function ProPhoto_RGB_to_XYZ_D50(x: Color): Color; + +/** + * @param {Color} color [r, g, b] + * - Red as number 0..1; + * - Green as number 0..1; + * - Blue as number 0..1; + * @return {Color} D50 XYZ [x, y, z] + */ +export declare function rec_2020_to_XYZ_D50(x: Color): Color; + +/** + * @param {Color} color [r, g, b] + * - Red as number 0..1; + * - Green as number 0..1; + * - Blue as number 0..1; + * @return {Color} D50 XYZ [x, y, z] + */ +export declare function sRGB_to_XYZ_D50(x: Color): Color; + +/** + * @param {Color} color [x, y, z] + * - X as number 0..1; + * - Y as number 0..1; + * - Z as number 0..1; + * @return {Color} a98 sRGB [r, g, b] + * - Red as number 0..1; + * - Green as number 0..1; + * - Blue as number 0..1; + */ +export declare function XYZ_D50_to_a98_RGB(x: Color): Color; + +/** + * @param {Color} color [x, y, z] + * - X as number 0..1; + * - Y as number 0..1; + * - Z as number 0..1; + * @return {Color} HSL [r, g, b] + * - Hue as degrees 0..360; + * - Saturation as number 0..100; + * - Lightness as number 0..100; + */ +export declare function XYZ_D50_to_HSL(x: Color): Color; + +/** + * @param {Color} color [x, y, z] + * - X as number 0..1; + * - Y as number 0..1; + * - Z as number 0..1; + * @return {Color} HWB [r, g, b] + * - Hue as degrees 0..360; + * - Whiteness as number 0..100; + * - Blackness as number 0..100; + */ +export declare function XYZ_D50_to_HWB(x: Color): Color; + +/** + * @param {Color} color [x, y, z] + * - X as number 0..1; + * - Y as number 0..1; + * - Z as number 0..1; + * @return {Color} Lab [r, g, b] + * - Lightness as number 0..100; + * - a as number -160..160; + * - b as number -160..160; + */ +export declare function XYZ_D50_to_Lab(x: Color): Color; + +/** + * @param {Color} color [x, y, z] + * - X as number 0..1; + * - Y as number 0..1; + * - Z as number 0..1; + * @return {Color} LCH [r, g, b] + * - Lightness as number 0..100; + * - Chroma as number 0..230; + * - Hue as degrees 0..360; + */ +export declare function XYZ_D50_to_LCH(x: Color): Color; + +/** + * @param {Color} color [x, y, z] + * - X as number 0..1; + * - Y as number 0..1; + * - Z as number 0..1; + * @return {Color} P3 [r, g, b] + * - R as number 0..1; + * - G as number 0..1; + * - B as number 0..1; + */ +export declare function XYZ_D50_to_lin_P3(x: Color): Color; + +/** + * @param {Color} color [x, y, z] + * - X as number 0..1; + * - Y as number 0..1; + * - Z as number 0..1; + * @return {Color} linear sRGB [r, g, b] + * - Red as number 0..1; + * - Green as number 0..1; + * - Blue as number 0..1; + */ +export declare function XYZ_D50_to_lin_sRGB(x: Color): Color; + +/** + * @param {Color} color [x, y, z] + * - X as number 0..1; + * - Y as number 0..1; + * - Z as number 0..1; + * @return {Color} OKLab [r, g, b] + * - Lightness as number 0..1; + * - a as number 0..0.5; + * - b as number 0..0.5; + */ +export declare function XYZ_D50_to_OKLab(x: Color): Color; + +/** + * @param {Color} color [x, y, z] + * - X as number 0..1; + * - Y as number 0..1; + * - Z as number 0..1; + * @return {Color} OKLCH [r, g, b] + * - Lightness as number 0..1; + * - Chroma as number 0..0.5; + * - Hue as degrees 0..360; + */ +export declare function XYZ_D50_to_OKLCH(x: Color): Color; + +/** + * @param {Color} color [x, y, z] + * - X as number 0..1; + * - Y as number 0..1; + * - Z as number 0..1; + * @return {Color} P3 [r, g, b] + * - R as number 0..1; + * - G as number 0..1; + * - B as number 0..1; + */ +export declare function XYZ_D50_to_P3(x: Color): Color; + +/** + * @param {Color} color [x, y, z] + * - X as number 0..1; + * - Y as number 0..1; + * - Z as number 0..1; + * @return {Color} ProPhoto [r, g, b] + * - Red as number 0..1; + * - Green as number 0..1; + * - Blue as number 0..1; + */ +export declare function XYZ_D50_to_ProPhoto(x: Color): Color; + +/** + * @param {Color} color [x, y, z] + * - X as number 0..1; + * - Y as number 0..1; + * - Z as number 0..1; + * @return {Color} rec 2020 [r, g, b] + * - Red as number 0..1; + * - Green as number 0..1; + * - Blue as number 0..1; + */ +export declare function XYZ_D50_to_rec_2020(x: Color): Color; + +/** + * @param {Color} color [x, y, z] + * - X as number 0..1; + * - Y as number 0..1; + * - Z as number 0..1; + * @return {Color} sRGB [r, g, b] + * - Red as number 0..1; + * - Green as number 0..1; + * - Blue as number 0..1; + */ +export declare function XYZ_D50_to_sRGB(x: Color): Color; + +/** + * @param {Color} color [x, y, z] + * - X as number 0..1; + * - Y as number 0..1; + * - Z as number 0..1; + * @return {Color} D50 XYZ [x, y, z] + */ +export declare function XYZ_D50_to_XYZ_D50(x: Color): Color; + +/** + * @param {Color} color [x, y, z] + * - X as number 0..1; + * - Y as number 0..1; + * - Z as number 0..1; + * @return {Color} D65 XYZ [x, y, z] + */ +export declare function XYZ_D50_to_XYZ_D65(x: Color): Color; + +/** + * @param {Color} color [x, y, z] + * - X as number 0..1; + * - Y as number 0..1; + * - Z as number 0..1; + * @return {Color} D50 XYZ [x, y, z] + */ +export declare function XYZ_D65_to_XYZ_D50(x: Color): Color; + +/** + * 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). + */ +export declare function XYZ_to_lin_P3(XYZ: Color): Color; + +/** + * @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). + */ +export declare function XYZ_to_lin_sRGB(XYZ: Color): Color; + +/** + * @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). + * + * XYZ <-> LMS matrices recalculated for consistent reference white + * @see https://github.com/w3c/csswg-drafts/issues/6642#issuecomment-943521484 + */ +export declare function XYZ_to_OKLab(XYZ: Color): Color; + +export { } diff --git a/node_modules/@csstools/color-helpers/dist/index.mjs b/node_modules/@csstools/color-helpers/dist/index.mjs new file mode 100644 index 0000000000000000000000000000000000000000..6e9f3e653ea58255df5abc60c8a8ed186f91e154 --- /dev/null +++ b/node_modules/@csstools/color-helpers/dist/index.mjs @@ -0,0 +1,263 @@ +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=[.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(n){return multiplyMatrices(t,n)}const n=[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(t){return multiplyMatrices(n,t)} +/** + * @param {number} hue - Hue as degrees 0..360 + * @param {number} sat - Saturation as percentage 0..100 + * @param {number} light - Lightness as percentage 0..100 + * @return {number[]} Array of sRGB components; in-gamut colors in range [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/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]%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 + * @param {number} black - Blackness as percentage 0..100 + * @return {number[]} Array of RGB components 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/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],_=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). + */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)]} +/** + * @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 n=Math.sqrt(Math.pow(t[1],2)+Math.pow(t[2],2));let _=180*Math.atan2(t[2],t[1])/Math.PI;return _<0&&(_+=360),n<=.0015&&(_=NaN),[t[0],n,_]}const _=[.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 n=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){const n=t[2]*Math.PI/180;return[t[0],t[1]*Math.cos(n),t[1]*Math.sin(n)]} +/** + * @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=Math.sqrt(t[1]**2+t[2]**2);let _=180*Math.atan2(t[2],t[1])/Math.PI;return _<0&&(_+=360),n<=4e-6&&(_=NaN),[t[0],n,_]}const o=[1.2268798758459243,-.5578149944602171,.2813910456659647,-.0405757452148008,1.112286803280317,-.0717110580655164,-.0763729366746601,-.4214933324022432,1.5869240198367816],e=[1,.3963377773761749,.2158037573099136,1,-.1055613458156586,-.0638541728258133,1,-.0894841775298119,-1.2914855480194092]; +/** + * Given OKLab, convert to XYZ relative 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). + * @see https://github.com/w3c/csswg-drafts/blob/main/css-color-4/conversions.js + */ +function OKLab_to_XYZ(t){const n=multiplyMatrices(e,t);return multiplyMatrices(o,[n[0]**3,n[1]**3,n[2]**3])} +/** + * Assuming XYZ is relative to D50, convert to CIE Lab + * from CIE standard, which now defines these as a rational fraction + * + * @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 n=compute_f(t[0]/_[0]),o=compute_f(t[1]/_[1]);return[116*o-16,500*(n-o),200*(o-compute_f(t[2]/_[2]))]}const a=216/24389,r=24389/27;function compute_f(t){return t>a?Math.cbrt(t):(r*t+16)/116}const l=[.819022437996703,.3619062600528904,-.1288737815209879,.0329836539323885,.9292868615863434,.0361446663506424,.0481771893596242,.2642395317527308,.6335478284694309],i=[.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). + * + * 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(l,t);return multiplyMatrices(i,[Math.cbrt(n[0]),Math.cbrt(n[1]),Math.cbrt(n[2])])}const c=[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 u=[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(u,t)}const s=[1.3457868816471583,-.25557208737979464,-.05110186497554526,-.5446307051249019,1.5082477428451468,.02052744743642139,0,0,1.2119675456389452]; +/** + * 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). + * @see http://www.brucelindbloom.com/index.html?Eqn_RGB_XYZ_Matrix.html + */const h=[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 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(m,t)} +/** + * 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). + */function gam_2020_channel(t){const n=t<0?-1:1,_=Math.abs(t);return n*Math.pow(_,1/2.4)} +/** + * Convert an array of linear-light sRGB values in the range 0.0-1.0 to gamma corrected form + * Extended transfer function: + * For negative values, linear portion extends on reflection + * of axis, then uses reflected pow below that + * + * @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[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 linear-light display-p3 RGB in the range 0.0-1.0 + * to gamma corrected 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 gam_P3(t){return gam_sRGB(t)} +/** + * Convert an array of linear-light prophoto-rgb in the range 0.0-1.0 + * to gamma corrected form. + * Transfer curve is gamma 1.8 with a small linear portion. + * + * @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=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} +/** + * 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). + */function gam_a98rgb_channel(t){const n=t<0?-1:1,_=Math.abs(t);return n*Math.pow(_,256/563)} +/** + * Convert an array of rec2020 RGB values in the range 0.0 - 1.0 + * to linear light (un-companded) 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). + */function lin_2020_channel(t){const n=t<0?-1:1,_=Math.abs(t);return n*Math.pow(_,2.4)}const b=[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) + * + * @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 + */ +/** + * Convert an array of of sRGB values where in-gamut values are in the range + * [0 - 1] to linear light (un-companded) form. + * Extended transfer function: + * For negative values, linear portion is extended on reflection of axis, + * then reflected power function is used. + * + * @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 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 g=[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) + * + * @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(g,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 + * gamma 1.8 with a small linear portion. Extended transfer function + * + * @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=16/512;function lin_ProPhoto_channel(t){const n=t<0?-1:1,_=Math.abs(t);return _<=X?t/16:n*Math.pow(_,1.8)}const Y=[.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. + * + * @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 + */function lin_a98rgb_channel(t){const n=t<0?-1:1,_=Math.abs(t);return n*Math.pow(_,563/256)}const Z=[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 + * has greater numerical precision than section 4.3.5.3 of + * https://www.adobe.com/digitalimag/pdfs/AdobeRGB1998.pdf + * but the values below were calculated from first principles + * from the chromaticity coordinates of R G B W + * + * @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 + * @see https://www.adobe.com/digitalimag/pdfs/AdobeRGB1998.pdf + * @see https://github.com/w3c/csswg-drafts/blob/main/css-color-4/matrixmaker.html + */const f=[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(f,t)} +/** + * Convert an array of gamma-corrected sRGB values in the 0.0 to 1.0 range to HSL. + * + * @param {Color} RGB [r, g, b] + * - Red component 0..1 + * - Green component 0..1 + * - Blue component 0..1 + * @return {number[]} Array of HSL values: Hue as degrees 0..360, Saturation and Lightness as percentages 0..100 + * + * @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/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),a=Math.min(n,_,o),r=(a+e)/2,l=e-a;let i=Number.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+(_=360&&(i-=360);return c<=1e-5&&(i=NaN),[i,100*c,100*r]}function sRGB_to_Hue(t){const n=t[0],_=t[1],o=t[2],e=Math.max(n,_,o),a=Math.min(n,_,o);let r=Number.NaN;const l=e-a;if(0!==l){switch(e){case n:r=(_-o)/l+(_=360&&(r-=360),r}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),o=Math.min(_[0],_[1],_[2]),e=1-Math.max(_[0],_[1],_[2]);let a=sRGB_to_Hue(_);return o+e>=.99999&&(a=NaN),[a,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 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). + */ +var _;return n=[lin_a98rgb_channel((_=n)[0]),lin_a98rgb_channel(_[1]),lin_a98rgb_channel(_[2])],n=multiplyMatrices(Z,n),n=D65_to_D50(n),n}function XYZ_D50_to_a98_RGB(t){let n=t;var _;return n=D50_to_D65(n),n=multiplyMatrices(h,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 lin_P3_to_XYZ_D50(t){let n=t;return n=lin_P3_to_XYZ(n),n=D65_to_D50(n),n}function XYZ_D50_to_lin_P3(t){let n=t;return n=D50_to_D65(n),n=XYZ_to_lin_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(b,n),n=D65_to_D50(n),n}function XYZ_D50_to_rec_2020(t){let n=t;var _;return n=D50_to_D65(n),n=multiplyMatrices(c,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(Y,n),n}function XYZ_D50_to_ProPhoto(t){let n=t;var _;return n=multiplyMatrices(s,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 + * @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/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,[a,r,l]=n,i=_-a,c=o-r,u=e-l;return Math.sqrt(i**2+c**2+u**2)}const M=.02,p=1e-4;function mapGamut(t,n,_){const o=t;let e=clip(n(o)),a=deltaEOK(OKLCH_to_OKLab(_(e)),OKLCH_to_OKLab(o));if(ap;){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=_(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(Math.abs(l)>1e-15){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 d={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<=.04045?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_P3,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_P3_to_XYZ_D50,lin_sRGB,lin_sRGB_to_XYZ,lin_sRGB_to_XYZ_D50,mapGamut,mapGamutRayTrace,d as namedColors,rec_2020_to_XYZ_D50,sRGB_to_XYZ_D50}; diff --git a/node_modules/@csstools/color-helpers/package.json b/node_modules/@csstools/color-helpers/package.json new file mode 100644 index 0000000000000000000000000000000000000000..1774c01159f53fc23f7c73331cadf47a16c7d681 --- /dev/null +++ b/node_modules/@csstools/color-helpers/package.json @@ -0,0 +1,55 @@ +{ + "name": "@csstools/color-helpers", + "description": "Color helpers to ease transformation between formats, gamut, etc", + "version": "6.0.2", + "contributors": [ + { + "name": "Antonio Laguna", + "email": "antonio@laguna.es", + "url": "https://antonio.laguna.es" + }, + { + "name": "Romain Menke", + "email": "romainmenke@gmail.com" + } + ], + "license": "MIT-0", + "funding": [ + { + "type": "github", + "url": "https://github.com/sponsors/csstools" + }, + { + "type": "opencollective", + "url": "https://opencollective.com/csstools" + } + ], + "engines": { + "node": ">=20.19.0" + }, + "type": "module", + "exports": { + ".": { + "types": "./dist/index.d.ts", + "default": "./dist/index.mjs" + } + }, + "files": [ + "CHANGELOG.md", + "LICENSE.md", + "README.md", + "dist" + ], + "scripts": {}, + "homepage": "https://github.com/csstools/postcss-plugins/tree/main/packages/color-helpers#readme", + "repository": { + "type": "git", + "url": "git+https://github.com/csstools/postcss-plugins.git", + "directory": "packages/color-helpers" + }, + "bugs": "https://github.com/csstools/postcss-plugins/issues", + "keywords": [ + "colors", + "css" + ] +} diff --git a/node_modules/@csstools/css-calc/CHANGELOG.md b/node_modules/@csstools/css-calc/CHANGELOG.md new file mode 100644 index 0000000000000000000000000000000000000000..f5fb3d0d0ee729d9979fc06dde14366adf68c2f4 --- /dev/null +++ b/node_modules/@csstools/css-calc/CHANGELOG.md @@ -0,0 +1,9 @@ +# Changes to CSS Calc + +### 3.2.1 + +_May 13, 2026_ + +- Update `round(line-width, 1.2345px)` to match the latest spec + +[Full CHANGELOG](https://github.com/csstools/postcss-plugins/tree/main/packages/css-calc/CHANGELOG.md) diff --git a/node_modules/@csstools/css-calc/LICENSE.md b/node_modules/@csstools/css-calc/LICENSE.md new file mode 100644 index 0000000000000000000000000000000000000000..af5411fa243cfcf2b61c79d081dbb6204e956041 --- /dev/null +++ b/node_modules/@csstools/css-calc/LICENSE.md @@ -0,0 +1,20 @@ +The MIT License (MIT) + +Copyright 2022 Romain Menke, Antonio Laguna + +Permission is hereby granted, free of charge, to any person obtaining a copy of +this software and associated documentation files (the "Software"), to deal in +the Software without restriction, including without limitation the rights to +use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of +the Software, and to permit persons to whom the Software is furnished to do so, +subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS +FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR +COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER +IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN +CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. diff --git a/node_modules/@csstools/css-calc/README.md b/node_modules/@csstools/css-calc/README.md new file mode 100644 index 0000000000000000000000000000000000000000..1e20fae72a633559b3334baed43a270b6a2e1212 --- /dev/null +++ b/node_modules/@csstools/css-calc/README.md @@ -0,0 +1,132 @@ +# CSS Calc for CSS + +[npm version][npm-url] +[Build Status][cli-url] +[Discord][discord] + +Implemented from : https://drafts.csswg.org/css-values-4/ on 2023-02-17 + +## Usage + +Add [CSS calc] to your project: + +```bash +npm install @csstools/css-calc @csstools/css-parser-algorithms @csstools/css-tokenizer --save-dev +``` + +### With string values : + +```mjs +import { calc } from '@csstools/css-calc'; + +// '20' +console.log(calc('calc(10 * 2)')); +``` + +### With component values : + +```mjs +import { stringify, tokenizer } from '@csstools/css-tokenizer'; +import { parseCommaSeparatedListOfComponentValues } from '@csstools/css-parser-algorithms'; +import { calcFromComponentValues } from '@csstools/css-calc'; + +const t = tokenizer({ + css: 'calc(10 * 2)', +}); + +const tokens = []; + +{ + while (!t.endOfFile()) { + tokens.push(t.nextToken()); + } + + tokens.push(t.nextToken()); // EOF-token +} + +const result = parseCommaSeparatedListOfComponentValues(tokens, {}); + +// filter or mutate the component values + +const calcResult = calcFromComponentValues(result, { precision: 5, toCanonicalUnits: true }); + +// filter or mutate the component values even further + +const calcResultStr = calcResult.map((componentValues) => { + return componentValues.map((x) => stringify(...x.tokens())).join(''); +}).join(','); + +// '20' +console.log(calcResultStr); +``` + +### Options + +#### `precision` : + +The default precision is fairly high. +It aims to be high enough to make rounding unnoticeable in the browser. + +You can set it to a lower number to suit your needs. + +```mjs +import { calc } from '@csstools/css-calc'; + +// '0.3' +console.log(calc('calc(1 / 3)', { precision: 1 })); +// '0.33' +console.log(calc('calc(1 / 3)', { precision: 2 })); +``` + +#### `globals` : + +Pass global values as a map of key value pairs. + +> Example : Relative color syntax (`lch(from pink calc(l / 2) c h)`) exposes color channel information as ident tokens. +> By passing globals for `l`, `c` and `h` it is possible to solve nested `calc()`'s. + +```mjs +import { calc } from '@csstools/css-calc'; + +const globals = new Map([ + ['a', '10px'], + ['b', '2rem'], +]); + +// '20px' +console.log(calc('calc(a * 2)', { globals: globals })); +// '6rem' +console.log(calc('calc(b * 3)', { globals: globals })); +``` + +#### `toCanonicalUnits` : + +By default this package will try to preserve units. +The heuristic to do this is very simplistic. +We take the first unit we encounter and try to convert other dimensions to that unit. + +This better matches what users expect from a CSS dev tool. + +If you want to have outputs that are closes to CSS serialized values you can pass `toCanonicalUnits: true`. + +```mjs +import { calc } from '@csstools/css-calc'; + +// '20hz' +console.log(calc('calc(0.01khz + 10hz)', { toCanonicalUnits: true })); + +// '20hz' +console.log(calc('calc(10hz + 0.01khz)', { toCanonicalUnits: true })); + +// '0.02khz' !!! +console.log(calc('calc(0.01khz + 10hz)', { toCanonicalUnits: false })); + +// '20hz' +console.log(calc('calc(10hz + 0.01khz)', { toCanonicalUnits: false })); +``` + +[cli-url]: https://github.com/csstools/postcss-plugins/actions/workflows/test.yml?query=workflow/test +[discord]: https://discord.gg/bUadyRwkJS +[npm-url]: https://www.npmjs.com/package/@csstools/css-calc + +[CSS calc]: https://github.com/csstools/postcss-plugins/tree/main/packages/css-calc diff --git a/node_modules/@csstools/css-calc/dist/index.d.ts b/node_modules/@csstools/css-calc/dist/index.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..2c41cf823c0c1fe2a2ff6665b9bca3cedbb88911 --- /dev/null +++ b/node_modules/@csstools/css-calc/dist/index.d.ts @@ -0,0 +1,106 @@ +import { 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'; + +export declare function calc(css: string, options?: conversionOptions): string; + +export declare function calcFromComponentValues(componentValuesList: Array>, options?: conversionOptions): Array>; + +export declare type conversionOptions = { + /** + * If a calc expression can not be solved the parse error might be reported through this callback. + * Not all cases are covered. Open an issue if you need specific errors reported. + * + * Values are recursively visited and at each nesting level an attempt is made to solve the expression. + * Errors can be reported multiple times as a result of this. + */ + onParseError?: (error: ParseError) => void; + /** + * Pass global values as a map of key value pairs. + */ + globals?: GlobalsWithStrings; + /** + * The default precision is fairly high. + * It aims to be high enough to make rounding unnoticeable in the browser. + * You can set it to a lower number to suite your needs. + */ + precision?: number; + /** + * The CSS pixel length of one device pixel. + * Used when rounding to `line-width` and similar features + */ + devicePixelLength?: number; + /** + * By default this package will try to preserve units. + * The heuristic to do this is very simplistic. + * We take the first unit we encounter and try to convert other dimensions to that unit. + * + * This better matches what users expect from a CSS dev tool. + * + * If you want to have outputs that are closes to CSS serialized values you can set `true`. + */ + toCanonicalUnits?: boolean; + /** + * Convert NaN, Infinity, ... into standard representable values. + */ + censorIntoStandardRepresentableValues?: boolean; + /** + * Some percentages resolve against other values and might be negative or positive depending on context. + * Raw percentages are more likely to be safe to simplify outside of a browser context + * + * @see https://drafts.csswg.org/css-values-4/#calc-simplification + */ + rawPercentages?: boolean; + /** + * The values used to generate random value cache keys. + */ + randomCaching?: { + /** + * The name of the property the random function is used in. + */ + propertyName: string; + /** + * N is the index of the random function among other random functions in the same property value. + */ + propertyN: number; + /** + * An element ID identifying the element the style is being applied to. + * When omitted any `random()` call will not be computed. + */ + elementID: string; + /** + * A document ID identifying the Document the styles are from. + * When omitted any `random()` call will not be computed. + */ + documentID: string; + }; +}; + +export declare type GlobalsWithStrings = Map; + +export declare const mathFunctionNames: Set; + +/** + * Any errors are reported through the `onParseError` callback. + */ +export declare class ParseError extends Error { + /** The index of the start character of the current token. */ + sourceStart: number; + /** The index of the end character of the current token. */ + sourceEnd: number; + constructor(message: string, sourceStart: number, sourceEnd: number); +} + +export declare const ParseErrorMessage: { + UnexpectedAdditionOfDimensionOrPercentageWithNumber: string; + UnexpectedSubtractionOfDimensionOrPercentageWithNumber: string; +}; + +export declare class ParseErrorWithComponentValues extends ParseError { + /** The associated component values. */ + componentValues: Array; + constructor(message: string, componentValues: Array); +} + +export { } diff --git a/node_modules/@csstools/css-calc/dist/index.mjs b/node_modules/@csstools/css-calc/dist/index.mjs new file mode 100644 index 0000000000000000000000000000000000000000..2d6db05afbdbf7572b073d06244bde917f24df92 --- /dev/null +++ b/node_modules/@csstools/css-calc/dist/index.mjs @@ -0,0 +1 @@ +import{sourceIndices as e,TokenNode as n,isTokenNode as t,isWhitespaceNode as r,isCommentNode as a,isWhiteSpaceOrCommentNode as u,isSimpleBlockNode as i,isFunctionNode as o,FunctionNode as l,WhitespaceNode as c,parseCommaSeparatedListOfComponentValues as s,walk as v}from"@csstools/css-parser-algorithms";import{isTokenDimension as f,TokenType as m,NumberType as p,mutateUnit as d,isTokenNumber as C,isTokenPercentage as g,isTokenIdent as D,isTokenNumeric as h,isTokenOpenParen as N,isTokenDelim as B,isTokenComma as A,isToken as b,tokenizer as F,tokenize as w,stringify as E,isTokenColon as I,isTokenSemicolon as S}from"@csstools/css-tokenizer";class ParseError extends Error{sourceStart;sourceEnd;constructor(e,n,t){super(e),this.name="ParseError",this.sourceStart=n,this.sourceEnd=t}}class ParseErrorWithComponentValues extends ParseError{componentValues;constructor(n,t){super(n,...e(t)),this.componentValues=t}}const y={UnexpectedAdditionOfDimensionOrPercentageWithNumber:"Unexpected addition of a dimension or percentage with a number.",UnexpectedSubtractionOfDimensionOrPercentageWithNumber:"Unexpected subtraction of a dimension or percentage with a number."},M=/[A-Z]/g;function toLowerCaseAZ(e){return e.replace(M,e=>String.fromCharCode(e.charCodeAt(0)+32))}const T={cm:"px",in:"px",mm:"px",pc:"px",pt:"px",px:"px",q:"px",deg:"deg",grad:"deg",rad:"deg",turn:"deg",ms:"s",s:"s",hz:"hz",khz:"hz"},x=new Map([["cm",e=>e],["mm",e=>10*e],["q",e=>40*e],["in",e=>e/2.54],["pc",e=>e/2.54*6],["pt",e=>e/2.54*72],["px",e=>e/2.54*96]]),P=new Map([["deg",e=>e],["grad",e=>e/.9],["rad",e=>e/180*Math.PI],["turn",e=>e/360]]),k=new Map([["deg",e=>.9*e],["grad",e=>e],["rad",e=>.9*e/180*Math.PI],["turn",e=>.9*e/360]]),W=new Map([["hz",e=>e],["khz",e=>e/1e3]]),O=new Map([["cm",e=>2.54*e],["mm",e=>25.4*e],["q",e=>25.4*e*4],["in",e=>e],["pc",e=>6*e],["pt",e=>72*e],["px",e=>96*e]]),U=new Map([["hz",e=>1e3*e],["khz",e=>e]]),L=new Map([["cm",e=>e/10],["mm",e=>e],["q",e=>4*e],["in",e=>e/25.4],["pc",e=>e/25.4*6],["pt",e=>e/25.4*72],["px",e=>e/25.4*96]]),$=new Map([["ms",e=>e],["s",e=>e/1e3]]),V=new Map([["cm",e=>e/6*2.54],["mm",e=>e/6*25.4],["q",e=>e/6*25.4*4],["in",e=>e/6],["pc",e=>e],["pt",e=>e/6*72],["px",e=>e/6*96]]),Z=new Map([["cm",e=>e/72*2.54],["mm",e=>e/72*25.4],["q",e=>e/72*25.4*4],["in",e=>e/72],["pc",e=>e/72*6],["pt",e=>e],["px",e=>e/72*96]]),z=new Map([["cm",e=>e/96*2.54],["mm",e=>e/96*25.4],["q",e=>e/96*25.4*4],["in",e=>e/96],["pc",e=>e/96*6],["pt",e=>e/96*72],["px",e=>e]]),q=new Map([["cm",e=>e/4/10],["mm",e=>e/4],["q",e=>e],["in",e=>e/4/25.4],["pc",e=>e/4/25.4*6],["pt",e=>e/4/25.4*72],["px",e=>e/4/25.4*96]]),G=new Map([["deg",e=>180*e/Math.PI],["grad",e=>180*e/Math.PI/.9],["rad",e=>e],["turn",e=>180*e/Math.PI/360]]),R=new Map([["ms",e=>1e3*e],["s",e=>e]]),j=new Map([["deg",e=>360*e],["grad",e=>360*e/.9],["rad",e=>360*e/180*Math.PI],["turn",e=>e]]),Y=new Map([["cm",x],["mm",L],["q",q],["in",O],["pc",V],["pt",Z],["px",z],["ms",$],["s",R],["deg",P],["grad",k],["rad",G],["turn",j],["hz",W],["khz",U]]);function convertUnit(e,n){if(!f(e))return n;if(!f(n))return n;const t=toLowerCaseAZ(e[4].unit),r=toLowerCaseAZ(n[4].unit);if(t===r)return n;const a=Y.get(r);if(!a)return n;const u=a.get(t);if(!u)return n;const i=u(n[4].value),o=[m.Dimension,"",n[2],n[3],{...n[4],signCharacter:i<0?"-":void 0,type:Number.isInteger(i)?p.Integer:p.Number,value:i}];return d(o,e[4].unit),o}function toCanonicalUnit(e){if(!f(e))return e;const n=toLowerCaseAZ(e[4].unit),t=T[n];if(n===t)return e;const r=Y.get(n);if(!r)return e;const a=r.get(t);if(!a)return e;const u=a(e[4].value),i=[m.Dimension,"",e[2],e[3],{...e[4],signCharacter:u<0?"-":void 0,type:Number.isInteger(u)?p.Integer:p.Number,value:u}];return d(i,t),i}function addition(e,t){if(2!==e.length)return-1;const r=e[0].value;let a=e[1].value;if(C(r)&&C(a)){const e=r[4].value+a[4].value;return new n([m.Number,e.toString(),r[2],a[3],{value:e,type:r[4].type===p.Integer&&a[4].type===p.Integer?p.Integer:p.Number}])}if(g(r)&&g(a)){const e=r[4].value+a[4].value;return new n([m.Percentage,e.toString()+"%",r[2],a[3],{value:e}])}if(f(r)&&f(a)&&(a=convertUnit(r,a),toLowerCaseAZ(r[4].unit)===toLowerCaseAZ(a[4].unit))){const e=r[4].value+a[4].value;return new n([m.Dimension,e.toString()+r[4].unit,r[2],a[3],{value:e,type:r[4].type===p.Integer&&a[4].type===p.Integer?p.Integer:p.Number,unit:r[4].unit}])}return(C(r)&&(f(a)||g(a))||C(a)&&(f(r)||g(r)))&&t.onParseError?.(new ParseErrorWithComponentValues(y.UnexpectedAdditionOfDimensionOrPercentageWithNumber,e)),-1}function division(e){if(2!==e.length)return-1;const t=e[0].value,r=e[1].value;if(C(t)&&C(r)){const e=t[4].value/r[4].value;return new n([m.Number,e.toString(),t[2],r[3],{value:e,type:Number.isInteger(e)?p.Integer:p.Number}])}if(g(t)&&C(r)){const e=t[4].value/r[4].value;return new n([m.Percentage,e.toString()+"%",t[2],r[3],{value:e}])}if(f(t)&&C(r)){const e=t[4].value/r[4].value;return new n([m.Dimension,e.toString()+t[4].unit,t[2],r[3],{value:e,type:Number.isInteger(e)?p.Integer:p.Number,unit:t[4].unit}])}return-1}function isCalculation(e){return!!e&&"object"==typeof e&&"inputs"in e&&Array.isArray(e.inputs)&&"operation"in e}function solve(e,n){if(-1===e)return-1;const r=[];for(let a=0;aconvertUnit(a,e.value));if(!arrayOfSameNumeric(u))return-1;const i=u.map(e=>e[4].value),o=Math.hypot(...i);return resultToCalculation(e,a,o)}function solveMax(e,n,r){if(!n.every(t))return-1;const a=n[0].value;if(!h(a))return-1;if(!r.rawPercentages&&g(a))return-1;const u=n.map(e=>convertUnit(a,e.value));if(!arrayOfSameNumeric(u))return-1;const i=u.map(e=>e[4].value),o=Math.max(...i);return resultToCalculation(e,a,o)}function solveMin(e,n,r){if(!n.every(t))return-1;const a=n[0].value;if(!h(a))return-1;if(!r.rawPercentages&&g(a))return-1;const u=n.map(e=>convertUnit(a,e.value));if(!arrayOfSameNumeric(u))return-1;const i=u.map(e=>e[4].value),o=Math.min(...i);return resultToCalculation(e,a,o)}function solveMod(e,n,t){const r=n.value;if(!h(r))return-1;const a=convertUnit(r,t.value);if(!twoOfSameNumeric(r,a))return-1;let u;return u=0===a[4].value?Number.NaN:Number.isFinite(r[4].value)&&(Number.isFinite(a[4].value)||(a[4].value!==Number.POSITIVE_INFINITY||r[4].value!==Number.NEGATIVE_INFINITY&&!Object.is(0*r[4].value,-0))&&(a[4].value!==Number.NEGATIVE_INFINITY||r[4].value!==Number.POSITIVE_INFINITY&&!Object.is(0*r[4].value,0)))?Number.isFinite(a[4].value)?(r[4].value%a[4].value+a[4].value)%a[4].value:r[4].value:Number.NaN,resultToCalculation(e,r,u)}function solvePow(e,n,t){const r=n.value,a=t.value;if(!C(r))return-1;if(!twoOfSameNumeric(r,a))return-1;return numberToCalculation(e,Math.pow(r[4].value,a[4].value))}function solveRem(e,n,t){const r=n.value;if(!h(r))return-1;const a=convertUnit(r,t.value);if(!twoOfSameNumeric(r,a))return-1;let u;return u=0===a[4].value?Number.NaN:Number.isFinite(r[4].value)?Number.isFinite(a[4].value)?r[4].value%a[4].value:r[4].value:Number.NaN,resultToCalculation(e,r,u)}function snapAsBorderWidth(e,n,t){if(!f(n))return-1;const r=t.devicePixelLength??1,a=[m.Dimension,`${r}px`,n[2],n[3],{value:r,type:p.Integer,unit:"px"}],u=convertUnit(a,n);if(!twoOfSameNumeric(u,a))return-1;if(Number.isInteger(u[4].value/r))return resultToCalculation(e,n,n[4].value);if(u[4].value>0){if(u[4].value0?1/0:Object.is(0,0*u[4].value)?0:-0;break;default:o=Object.is(0,0*u[4].value)?0:-0}else switch(n){case"down":o=Math.floor(u[4].value/i[4].value)*i[4].value;break;case"up":o=Math.ceil(u[4].value/i[4].value)*i[4].value;break;case"to-zero":o=Math.trunc(u[4].value/i[4].value)*i[4].value;break;default:{let t=Math.floor(u[4].value/i[4].value)*i[4].value,r=Math.ceil(u[4].value/i[4].value)*i[4].value;if(t>r){const e=t;t=r,r=e}const l=Math.abs(u[4].value-t),c=Math.abs(u[4].value-r);if(o="line-width"===n&&u[4].value>=0&&(0===r||0===t)?0!==r?r:t:l===c?r:l0?1/0:-1/0:Math.tan(u),numberToCalculation(e,u)}function subtraction(e,t){if(2!==e.length)return-1;const r=e[0].value;let a=e[1].value;if(C(r)&&C(a)){const e=r[4].value-a[4].value;return new n([m.Number,e.toString(),r[2],a[3],{value:e,type:r[4].type===p.Integer&&a[4].type===p.Integer?p.Integer:p.Number}])}if(g(r)&&g(a)){const e=r[4].value-a[4].value;return new n([m.Percentage,e.toString()+"%",r[2],a[3],{value:e}])}if(f(r)&&f(a)&&(a=convertUnit(r,a),toLowerCaseAZ(r[4].unit)===toLowerCaseAZ(a[4].unit))){const e=r[4].value-a[4].value;return new n([m.Dimension,e.toString()+r[4].unit,r[2],a[3],{value:e,type:r[4].type===p.Integer&&a[4].type===p.Integer?p.Integer:p.Number,unit:r[4].unit}])}return(C(r)&&(f(a)||g(a))||C(a)&&(f(r)||g(r)))&&t.onParseError?.(new ParseErrorWithComponentValues(y.UnexpectedSubtractionOfDimensionOrPercentageWithNumber,e)),-1}function solveLog(e,n){if(1===n.length){const r=n[0];if(!r||!t(r))return-1;const a=r.value;if(!C(a))return-1;return numberToCalculation(e,Math.log(a[4].value))}if(2===n.length){const r=n[0];if(!r||!t(r))return-1;const a=r.value;if(!C(a))return-1;const u=n[1];if(!u||!t(u))return-1;const i=u.value;if(!C(i))return-1;return numberToCalculation(e,Math.log(a[4].value)/Math.log(i[4].value))}return-1}const _=/^none$/i;function isNone(e){if(Array.isArray(e)){const n=e.filter(e=>!(r(e)&&a(e)));return 1===n.length&&isNone(n[0])}if(!t(e))return!1;const n=e.value;return!!D(n)&&_.test(n[4].value)}const H=String.fromCodePoint(0);function solveRandom(e,n,t,r,a,u){if(-1===n.fixed&&!u.randomCaching)return-1;u.randomCaching||(u.randomCaching={propertyName:"",propertyN:0,elementID:"",documentID:""}),u.randomCaching&&!u.randomCaching.propertyN&&(u.randomCaching.propertyN=0);const i=t.value;if(!h(i))return-1;const o=convertUnit(i,r.value);if(!twoOfSameNumeric(i,o))return-1;let l=null;if(a&&(l=convertUnit(i,a.value),!twoOfSameNumeric(i,l)))return-1;if(!Number.isFinite(i[4].value))return resultToCalculation(e,i,Number.NaN);if(!Number.isFinite(o[4].value))return resultToCalculation(e,i,Number.NaN);if(!Number.isFinite(o[4].value-i[4].value))return resultToCalculation(e,i,Number.NaN);if(l&&!Number.isFinite(l[4].value))return resultToCalculation(e,i,i[4].value);const c=-1===n.fixed?sfc32(crc32([n.dashedIdent?n.dashedIdent:`${u.randomCaching?.propertyName} ${u.randomCaching.propertyN++}`,n.elementShared?"":u.randomCaching.elementID,u.randomCaching.documentID].join(H))):()=>n.fixed;let s=i[4].value,v=o[4].value;if(s>v&&([s,v]=[v,s]),l&&(l[4].value<=0||Math.abs(s-v)/l[4].value>1e10)&&(l=null),l){const n=Math.max(l[4].value/1e3,1e-9),t=[s];let r=0;for(;;){r+=l[4].value;const e=s+r;if(!(e+nv)break}const a=c();return resultToCalculation(e,i,Number(t[Math.floor(t.length*a)].toFixed(5)))}const f=c();return resultToCalculation(e,i,Number((f*(v-s)+s).toFixed(5)))}function sfc32(e=.34944106645296036,n=.19228640875738723,t=.8784393832007205,r=.04850964319275053){return()=>{const a=((e|=0)+(n|=0)|0)+(r|=0)|0;return r=r+1|0,e=n^n>>>9,n=(t|=0)+(t<<3)|0,t=(t=t<<21|t>>>11)+a|0,(a>>>0)/4294967296}}function crc32(e){let n,t,r=0;r^=-1;for(let a=0,u=e.length;a>>8^n;return(-1^r)>>>0}const J=new Map([["abs",function abs(e,n,t){return singleNodeSolver(e,n,t,solveAbs)}],["acos",function acos(e,n,t){return singleNodeSolver(e,n,t,solveACos)}],["asin",function asin(e,n,t){return singleNodeSolver(e,n,t,solveASin)}],["atan",function atan(e,n,t){return singleNodeSolver(e,n,t,solveATan)}],["atan2",function atan2(e,n,t){return twoCommaSeparatedNodesSolver(e,n,t,solveATan2)}],["calc",calc$1],["clamp",function clamp(r,a,i){const o=resolveGlobalsAndConstants([...r.value.filter(e=>!u(e))],a),c=[],s=[],v=[];{let e=c;for(let n=0;n!u(e)),n,t);if(-1===r)return-1;const[a,i]=r,o=variadicArguments(e,i,n,t);if(-1===o)return-1;const[l,c,s]=o;if(!l||!c)return-1;return solveRandom(e,a,l,c,s,t)}],["rem",function rem(e,n,t){return twoCommaSeparatedNodesSolver(e,n,t,solveRem)}],["round",function round(e,r,a){const i=resolveGlobalsAndConstants([...e.value.filter(e=>!u(e))],r);let o="",l=!1;const c=[],s=[];{let e=c;for(let n=0;n!u(e))],n);if(1===a.length&&t(a[0]))return{inputs:[a[0]],operation:unary};let l=0;for(;l!u(e))],n),a=solve(calc$1(calcWrapper(e,r),n,t),t);return-1===a?-1:a}function twoCommaSeparatedNodesSolver(e,n,t,r){const a=twoCommaSeparatedArguments(e,n,t);if(-1===a)return-1;const[u,i]=a;return r(e,u,i,t)}function twoCommaSeparatedArguments(e,n,r){const a=resolveGlobalsAndConstants([...e.value.filter(e=>!u(e))],n),i=[],o=[];{let e=i;for(let n=0;n!u(e))],r),o=[];{const n=[];let u=[];for(let e=0;e1)return-1;u.fixed=Math.max(0,Math.min(o.value[4].value,1-1e-9));continue}if("auto"!==l)if(l.startsWith("--")){if(-1!==u.fixed||u.isAuto)return-1;u.dashedIdent=l}else;else{if(-1!==u.fixed||u.dashedIdent)return-1;u.isAuto=!0}}else{if(-1!==u.fixed)return-1;u.elementShared=!0}}return-1}function calcWrapper(e,n){return new l([m.Function,"calc(",e.name[2],e.name[3],{value:"calc"}],[m.CloseParen,")",e.endToken[2],e.endToken[3],void 0],n)}function maxWrapper(t,r,a){return new l([m.Function,"max(",t.name[2],t.name[3],{value:"max"}],[m.CloseParen,")",t.endToken[2],t.endToken[3],void 0],[r,new n([m.Comma,",",...e(r),void 0]),a])}function patchNaN(e){if(-1===e)return-1;if(o(e))return e;const t=e.value;return h(t)&&Number.isNaN(t[4].value)?C(t)?new l([m.Function,"calc(",t[2],t[3],{value:"calc"}],[m.CloseParen,")",t[2],t[3],void 0],[new n([m.Ident,"NaN",t[2],t[3],{value:"NaN"}])]):f(t)?new l([m.Function,"calc(",t[2],t[3],{value:"calc"}],[m.CloseParen,")",t[2],t[3],void 0],[new n([m.Ident,"NaN",t[2],t[3],{value:"NaN"}]),new c([[m.Whitespace," ",t[2],t[3],void 0]]),new n([m.Delim,"*",t[2],t[3],{value:"*"}]),new c([[m.Whitespace," ",t[2],t[3],void 0]]),new n([m.Dimension,"1"+t[4].unit,t[2],t[3],{value:1,type:p.Integer,unit:t[4].unit}])]):g(t)?new l([m.Function,"calc(",t[2],t[3],{value:"calc"}],[m.CloseParen,")",t[2],t[3],void 0],[new n([m.Ident,"NaN",t[2],t[3],{value:"NaN"}]),new c([[m.Whitespace," ",t[2],t[3],void 0]]),new n([m.Delim,"*",t[2],t[3],{value:"*"}]),new c([[m.Whitespace," ",t[2],t[3],void 0]]),new n([m.Percentage,"1%",t[2],t[3],{value:1}])]):-1:e}function patchInfinity(e){if(-1===e)return-1;if(o(e))return e;const t=e.value;if(!h(t))return e;if(Number.isFinite(t[4].value)||Number.isNaN(t[4].value))return e;let r="";return Number.NEGATIVE_INFINITY===t[4].value&&(r="-"),C(t)?new l([m.Function,"calc(",t[2],t[3],{value:"calc"}],[m.CloseParen,")",t[2],t[3],void 0],[new n([m.Ident,r+"infinity",t[2],t[3],{value:r+"infinity"}])]):f(t)?new l([m.Function,"calc(",t[2],t[3],{value:"calc"}],[m.CloseParen,")",t[2],t[3],void 0],[new n([m.Ident,r+"infinity",t[2],t[3],{value:r+"infinity"}]),new c([[m.Whitespace," ",t[2],t[3],void 0]]),new n([m.Delim,"*",t[2],t[3],{value:"*"}]),new c([[m.Whitespace," ",t[2],t[3],void 0]]),new n([m.Dimension,"1"+t[4].unit,t[2],t[3],{value:1,type:p.Integer,unit:t[4].unit}])]):new l([m.Function,"calc(",t[2],t[3],{value:"calc"}],[m.CloseParen,")",t[2],t[3],void 0],[new n([m.Ident,r+"infinity",t[2],t[3],{value:r+"infinity"}]),new c([[m.Whitespace," ",t[2],t[3],void 0]]),new n([m.Delim,"*",t[2],t[3],{value:"*"}]),new c([[m.Whitespace," ",t[2],t[3],void 0]]),new n([m.Percentage,"1%",t[2],t[3],{value:1}])])}function patchMinusZero(e){if(-1===e)return-1;if(o(e))return e;const n=e.value;return h(n)&&Object.is(-0,n[4].value)?("-0"===n[1]||(g(n)?n[1]="-0%":f(n)?n[1]="-0"+n[4].unit:n[1]="-0"),e):e}function patchPrecision(e,n=13){if(-1===e)return-1;if(n<=0)return e;if(o(e))return e;const t=e.value;if(!h(t))return e;if(Number.isInteger(t[4].value))return e;const r=Number(t[4].value.toFixed(n)).toString();return C(t)?t[1]=r:g(t)?t[1]=r+"%":f(t)&&(t[1]=r+t[4].unit),e}function patchCanonicalUnit(e){return-1===e?-1:o(e)?e:f(e.value)?(e.value=toCanonicalUnit(e.value),e):e}function patchCalcResult(e,n){let t=e;return n?.toCanonicalUnits&&(t=patchCanonicalUnit(t)),t=patchPrecision(t,n?.precision),t=patchMinusZero(t),n?.censorIntoStandardRepresentableValues||(t=patchNaN(t),t=patchInfinity(t)),t}function tokenizeGlobals(e){const n=new Map;if(!e)return n;for(const[t,r]of e)if(b(r))n.set(t,r);else if("string"==typeof r){const e=F({css:r}),a=e.nextToken();if(e.nextToken(),!e.endOfFile())continue;if(!h(a))continue;n.set(t,a);continue}return n}function calc(e,n){return calcFromComponentValues(s(w({css:e}),{}),n).map(e=>e.map(e=>E(...e.tokens())).join("")).join(",")}function calcFromComponentValues(e,n){const t=tokenizeGlobals(n?.globals);return replaceComponentValues(e,e=>{if(!o(e))return;const r=J.get(e.getName().toLowerCase());if(!r)return;const a=patchCalcResult(solve(r(e,t,n??{}),n??{}),n);return-1!==a?a:void 0})}function replaceComponentValues(n,r){for(let a=0;a{if("number"!=typeof a)return;const i=r(n.node);if(!i)return;const o=[i],l=n.parent.value[a-1];t(l)&&B(l.value)&&("-"===l.value[4].value||"+"===l.value[4].value)&&o.splice(0,0,new c([[m.Whitespace," ",...e(n.node),void 0]]));const s=n.parent.value[a+1];!s||u(s)||t(s)&&(A(s.value)||I(s.value)||S(s.value)||B(s.value)&&"-"!==s.value[4].value&&"+"!==s.value[4].value)||o.push(new c([[m.Whitespace," ",...e(n.node),void 0]])),n.parent.value.splice(a,1,...o)})}return n}const Q=new Set(J.keys());export{ParseError,y as ParseErrorMessage,ParseErrorWithComponentValues,calc,calcFromComponentValues,Q as mathFunctionNames}; diff --git a/node_modules/@csstools/css-calc/package.json b/node_modules/@csstools/css-calc/package.json new file mode 100644 index 0000000000000000000000000000000000000000..52b609c18f7858926bc694a2abba37a716a86c5d --- /dev/null +++ b/node_modules/@csstools/css-calc/package.json @@ -0,0 +1,59 @@ +{ + "name": "@csstools/css-calc", + "description": "Solve CSS math expressions", + "version": "3.2.1", + "contributors": [ + { + "name": "Antonio Laguna", + "email": "antonio@laguna.es", + "url": "https://antonio.laguna.es" + }, + { + "name": "Romain Menke", + "email": "romainmenke@gmail.com" + } + ], + "license": "MIT", + "funding": [ + { + "type": "github", + "url": "https://github.com/sponsors/csstools" + }, + { + "type": "opencollective", + "url": "https://opencollective.com/csstools" + } + ], + "engines": { + "node": ">=20.19.0" + }, + "type": "module", + "exports": { + ".": { + "types": "./dist/index.d.ts", + "default": "./dist/index.mjs" + } + }, + "files": [ + "CHANGELOG.md", + "LICENSE.md", + "README.md", + "dist" + ], + "peerDependencies": { + "@csstools/css-parser-algorithms": "^4.0.0", + "@csstools/css-tokenizer": "^4.0.0" + }, + "scripts": {}, + "homepage": "https://github.com/csstools/postcss-plugins/tree/main/packages/css-calc#readme", + "repository": { + "type": "git", + "url": "git+https://github.com/csstools/postcss-plugins.git", + "directory": "packages/css-calc" + }, + "bugs": "https://github.com/csstools/postcss-plugins/issues", + "keywords": [ + "calc", + "css" + ] +} diff --git a/node_modules/@csstools/css-color-parser/CHANGELOG.md b/node_modules/@csstools/css-color-parser/CHANGELOG.md new file mode 100644 index 0000000000000000000000000000000000000000..c0a28f6be63fa3392a7419b0a8be384625637679 --- /dev/null +++ b/node_modules/@csstools/css-color-parser/CHANGELOG.md @@ -0,0 +1,9 @@ +# Changes to CSS Color Parser + +### 4.1.7 + +_June 14, 2026_ + +- Fix normalization of `hue` to `[0, 360]` range when `hue` is not finite + +[Full CHANGELOG](https://github.com/csstools/postcss-plugins/tree/main/packages/css-color-parser/CHANGELOG.md) diff --git a/node_modules/@csstools/css-color-parser/LICENSE.md b/node_modules/@csstools/css-color-parser/LICENSE.md new file mode 100644 index 0000000000000000000000000000000000000000..af5411fa243cfcf2b61c79d081dbb6204e956041 --- /dev/null +++ b/node_modules/@csstools/css-color-parser/LICENSE.md @@ -0,0 +1,20 @@ +The MIT License (MIT) + +Copyright 2022 Romain Menke, Antonio Laguna + +Permission is hereby granted, free of charge, to any person obtaining a copy of +this software and associated documentation files (the "Software"), to deal in +the Software without restriction, including without limitation the rights to +use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of +the Software, and to permit persons to whom the Software is furnished to do so, +subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS +FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR +COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER +IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN +CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. diff --git a/node_modules/@csstools/css-color-parser/README.md b/node_modules/@csstools/css-color-parser/README.md new file mode 100644 index 0000000000000000000000000000000000000000..f886fc91bca94637d1f1ff455e90bc41afb3e677 --- /dev/null +++ b/node_modules/@csstools/css-color-parser/README.md @@ -0,0 +1,37 @@ +# CSS Color Parser for CSS + +[npm version][npm-url] +[Build Status][cli-url] +[Discord][discord] + +## Usage + +Add [CSS Color Parser] to your project: + +```bash +npm install @csstools/css-color-parser @csstools/css-parser-algorithms @csstools/css-tokenizer --save-dev +``` + +```ts +import { color } from '@csstools/css-color-parser'; +import { isFunctionNode, parseComponentValue } from '@csstools/css-parser-algorithms'; +import { serializeRGB } from '@csstools/css-color-parser'; +import { tokenize } from '@csstools/css-tokenizer'; + +// color() expects a parsed component value. +const hwbComponentValue = parseComponentValue(tokenize({ css: 'hwb(10deg 10% 20%)' })); +const colorData = color(hwbComponentValue); +if (colorData) { + console.log(colorData); + + // serializeRGB() returns a component value. + const rgbComponentValue = serializeRGB(colorData); + console.log(rgbComponentValue.toString()); +} +``` + +[cli-url]: https://github.com/csstools/postcss-plugins/actions/workflows/test.yml?query=workflow/test +[discord]: https://discord.gg/bUadyRwkJS +[npm-url]: https://www.npmjs.com/package/@csstools/css-color-parser + +[CSS Color Parser]: https://github.com/csstools/postcss-plugins/tree/main/packages/css-color-parser diff --git a/node_modules/@csstools/css-color-parser/dist/index.d.ts b/node_modules/@csstools/css-color-parser/dist/index.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..e4b8600edb30741c2ef70f3052643cfe72c294ef --- /dev/null +++ b/node_modules/@csstools/css-color-parser/dist/index.d.ts @@ -0,0 +1,168 @@ +import type { Color } from '@csstools/color-helpers'; +import type { ComponentValue } from '@csstools/css-parser-algorithms'; +import { FunctionNode } from '@csstools/css-parser-algorithms'; + +/** + * Convert a color function to a `ColorData` object. + * + * @param {ComponentValue} colorNode - The color function to be converted. + * @returns {ColorData|false} The color function as a `ColorData` object or `false` if it could not be converted. + */ +export declare function color(colorNode: ComponentValue): ColorData | false; + +/** + * A color data object. + * It contains as much information as possible about the color and the original parsed syntax. + */ +export declare interface ColorData { + /** + * The color notation of the color data. + * + * We use "color notation" and not "color space" because these represent the original notation and not the actual color space. + * The actual color space is however always implied by the color notation. + */ + colorNotation: ColorNotation; + /** + * The color channels. + * This is always an array of three numbers + * but the channels can only be interpreted by looking at the color notation. + */ + channels: Color; + /** + * The alpha channel. + * This is either a number between `0` and `1` or a `ComponentValue` object. + * + * Since most computations are not dependent on the alpha channel, + * we allow things like `var(--some-alpha)` as an alpha channel value for most inputs. + */ + alpha: number | ComponentValue; + /** + * Information about the original syntax. + */ + syntaxFlags: Set; +} + +/** + * Check if a color data object fits the `display-p3` gamut. + * + * @param {ColorData} x - The color data to be checked. + * @returns {boolean} Whether the color data fits the `display-p3` gamut. + */ +export declare function colorDataFitsDisplayP3_Gamut(x: ColorData): boolean; + +/** + * Check if a color data object fits the `sRGB` gamut. + * + * @param {ColorData} x - The color data to be checked. + * @returns {boolean} Whether the color data fits the `sRGB` gamut. + */ +export declare function colorDataFitsRGB_Gamut(x: ColorData): boolean; + +export declare enum ColorNotation { + /** Adobe 1999, expressed through `color(a98-rgb 0 0 0)` */ + A98_RGB = "a98-rgb", + /** Display P3, expressed through `color(display-p3 0 0 0)` */ + Display_P3 = "display-p3", + /** Display P3, expressed through `color(display-p3-linear 0 0 0)` */ + Linear_Display_P3 = "display-p3-linear", + /** Hex, expressed through `#000` */ + HEX = "hex", + /** HSL, expressed through `hsl(0 0% 0%)` */ + HSL = "hsl", + /** HWB, expressed through `hwb(0 0% 0%)` */ + HWB = "hwb", + /** LCH, expressed through `lch(0 0% 0deg)` */ + LCH = "lch", + /** Lab, expressed through `lab(0 0 0)` */ + Lab = "lab", + /** Linear sRGB, expressed through `color(linear-srgb 0 0 0)` */ + Linear_sRGB = "srgb-linear", + /** Oklch, expressed through `oklch(0 0% 0deg)` */ + OKLCH = "oklch", + /** Oklab, expressed through `oklab(0 0 0)` */ + OKLab = "oklab", + /** ProPhoto RGB, expressed through `color(prophoto-rgb 0 0 0)` */ + ProPhoto_RGB = "prophoto-rgb", + /** RGB, expressed through `rgb(0 0 0)` */ + RGB = "rgb", + /** sRGB, expressed through `color(srgb 0 0 0)` */ + sRGB = "srgb", + /** Rec. 2020, expressed through `color(rec2020 0 0 0)` */ + Rec2020 = "rec2020", + /** XYZ, expressed through `color(xyz-d50 0 0 0)` */ + XYZ_D50 = "xyz-d50", + /** XYZ, expressed through `color(xyz-d65 0 0 0)` */ + XYZ_D65 = "xyz-d65" +} + +export declare function serializeHSL(color: ColorData, gamutMapping?: boolean): FunctionNode; + +/** + * Convert color data to component values in the OKLCH color space. + * The return value can be converted to a string by calling `toString()` on it. + * + * @param {ColorData} color - The color data to be serialized. + * @returns {FunctionNode} The serialized color data as a FunctionNode object. + */ +export declare function serializeOKLCH(color: ColorData): FunctionNode; + +/** + * Convert color data to component values in the display-p3 color space. + * The return value can be converted to a string by calling `toString()` on it. + * + * @param {ColorData} color - The color data to be serialized. + * @param {boolean} gamutMapping - Whether to perform gamut mapping, defaults to `true`. + * @returns {FunctionNode} The serialized color data as a FunctionNode object. + */ +export declare function serializeP3(color: ColorData, gamutMapping?: boolean): FunctionNode; + +/** + * Convert color data to component values in the srgb color space. + * The return value can be converted to a string by calling `toString()` on it. + * + * @param {ColorData} color - The color data to be serialized. + * @param {boolean} gamutMapping - Whether to perform gamut mapping, defaults to `true`. + * @returns {FunctionNode} The serialized color data as a FunctionNode object. + */ +export declare function serializeRGB(color: ColorData, gamutMapping?: boolean): FunctionNode; + +export declare enum SyntaxFlag { + /** Is a color keyword, e.g. `transparent`, `currentColor`, ... */ + ColorKeyword = "color-keyword", + /** Has an explicit alpha channel */ + HasAlpha = "has-alpha", + /** Has a channel with a dimension value, e.g. `50deg` */ + HasDimensionValues = "has-dimension-values", + /** Has a channel with the `none` keyword */ + HasNoneKeywords = "has-none-keywords", + /** Has a channel with a number value */ + HasNumberValues = "has-number-values", + /** Has an alpha channel with a percentage value */ + HasPercentageAlpha = "has-percentage-alpha", + /** Has a channel with a percentage value */ + HasPercentageValues = "has-percentage-values", + /** Has an alpha channel with a `var()` function value */ + HasVariableAlpha = "has-variable-alpha", + /** Is Hex notation */ + Hex = "hex", + /** Is legacy HSL, e.g. `hsl(50deg, 0%, 0%)` */ + LegacyHSL = "legacy-hsl", + /** Is legacy RGB, e.g. `rgb(0, 0, 0)` */ + LegacyRGB = "legacy-rgb", + /** Is a named color, e.g. `red`, `blue` */ + NamedColor = "named-color", + /** Is a relative color syntax, e.g. `rgb(from purple r g b)` */ + RelativeColorSyntax = "relative-color-syntax", + /** Is a mixed color, e.g. `color-mix(in oklch, red, blue)` */ + ColorMix = "color-mix", + /** Is a variadic mixed color, e.g. `color-mix(in oklch, red)` `color-mix(in oklch, red, blue, green)` */ + ColorMixVariadic = "color-mix-variadic", + /** Is a contrasting color, e.g. `contrast-color()` */ + ContrastColor = "contrast-color", + /** Is a relative alpha syntax `alpha(from red / 0.5)` */ + RelativeAlphaSyntax = "relative-alpha-syntax", + /** Is an experimental color syntax */ + Experimental = "experimental" +} + +export { } diff --git a/node_modules/@csstools/css-color-parser/dist/index.mjs b/node_modules/@csstools/css-color-parser/dist/index.mjs new file mode 100644 index 0000000000000000000000000000000000000000..6db85f13f3749abbc9146c4715d9491de8417a2f --- /dev/null +++ b/node_modules/@csstools/css-color-parser/dist/index.mjs @@ -0,0 +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 i}from"@csstools/css-tokenizer";import{XYZ_D50_to_XYZ_D65 as c,XYZ_D50_to_XYZ_D50 as h,XYZ_D50_to_OKLab as m,XYZ_D50_to_OKLCH as N,XYZ_D50_to_LCH as p,XYZ_D50_to_Lab as b,XYZ_D50_to_HWB as v,XYZ_D50_to_HSL as f,XYZ_D50_to_a98_RGB as g,XYZ_D50_to_ProPhoto as y,XYZ_D50_to_rec_2020 as d,XYZ_D50_to_lin_P3 as _,XYZ_D50_to_P3 as C,XYZ_D50_to_lin_sRGB as w,XYZ_D50_to_sRGB as x,XYZ_D65_to_XYZ_D50 as L,OKLCH_to_XYZ_D50 as H,LCH_to_XYZ_D50 as k,OKLab_to_XYZ_D50 as P,Lab_to_XYZ_D50 as S,HWB_to_XYZ_D50 as D,HSL_to_XYZ_D50 as F,ProPhoto_RGB_to_XYZ_D50 as M,a98_RGB_to_XYZ_D50 as z,rec_2020_to_XYZ_D50 as Z,lin_P3_to_XYZ_D50 as R,P3_to_XYZ_D50 as B,lin_sRGB_to_XYZ_D50 as V,sRGB_to_XYZ_D50 as T,namedColors as G,inGamut as A,clip as X,gam_sRGB as K,mapGamutRayTrace as Y,OKLCH_to_OKLab as I,OKLab_to_XYZ as O,XYZ_to_lin_sRGB as W,lin_sRGB_to_XYZ as E,XYZ_to_OKLab as U,OKLab_to_OKLCH as $,contrast_ratio_wcag_2_1 as j,gam_P3 as q,XYZ_to_lin_P3 as J,lin_P3_to_XYZ as Q}from"@csstools/color-helpers";import{isWhitespaceNode as ee,isCommentNode as ae,isTokenNode as ne,isFunctionNode as re,TokenNode as oe,isWhiteSpaceOrCommentNode as te,replaceComponentValues as le,FunctionNode as se,WhitespaceNode as ue}from"@csstools/css-parser-algorithms";import{mathFunctionNames as ie,calcFromComponentValues as ce}from"@csstools/css-calc";var he,me;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 he.HEX:case he.RGB:case he.sRGB:return{...e,colorNotation:he.XYZ_D50,channels:T(convertNaNToZero(e.channels))};case he.Linear_sRGB:return{...e,colorNotation:he.XYZ_D50,channels:V(convertNaNToZero(e.channels))};case he.Display_P3:return{...e,colorNotation:he.XYZ_D50,channels:B(convertNaNToZero(e.channels))};case he.Linear_Display_P3:return{...e,colorNotation:he.XYZ_D50,channels:R(convertNaNToZero(e.channels))};case he.Rec2020:return{...e,colorNotation:he.XYZ_D50,channels:Z(convertNaNToZero(e.channels))};case he.A98_RGB:return{...e,colorNotation:he.XYZ_D50,channels:z(convertNaNToZero(e.channels))};case he.ProPhoto_RGB:return{...e,colorNotation:he.XYZ_D50,channels:M(convertNaNToZero(e.channels))};case he.HSL:return{...e,colorNotation:he.XYZ_D50,channels:F(convertNaNToZero(e.channels))};case he.HWB:return{...e,colorNotation:he.XYZ_D50,channels:D(convertNaNToZero(e.channels))};case he.Lab:return{...e,colorNotation:he.XYZ_D50,channels:S(convertNaNToZero(e.channels))};case he.OKLab:return{...e,colorNotation:he.XYZ_D50,channels:P(convertNaNToZero(e.channels))};case he.LCH:return{...e,colorNotation:he.XYZ_D50,channels:k(convertNaNToZero(e.channels))};case he.OKLCH:return{...e,colorNotation:he.XYZ_D50,channels:H(convertNaNToZero(e.channels))};case he.XYZ_D50:return{...e,colorNotation:he.XYZ_D50,channels:h(convertNaNToZero(e.channels))};case he.XYZ_D65:return{...e,colorNotation:he.XYZ_D50,channels:L(convertNaNToZero(e.channels))};default:throw new Error("Unsupported color notation")}}!function(e){e.A98_RGB="a98-rgb",e.Display_P3="display-p3",e.Linear_Display_P3="display-p3-linear",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"}(he||(he={})),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.ColorMixVariadic="color-mix-variadic",e.ContrastColor="contrast-color",e.RelativeAlphaSyntax="relative-alpha-syntax",e.Experimental="experimental"}(me||(me={}));const Ne=new Set([he.A98_RGB,he.Display_P3,he.Linear_Display_P3,he.HEX,he.Linear_sRGB,he.ProPhoto_RGB,he.RGB,he.sRGB,he.Rec2020,he.XYZ_D50,he.XYZ_D65]);function colorDataTo(e,a){(e={...e}).channels=convertPowerlessComponentsToMissingComponents(e.channels,e.colorNotation);const n={...e};if(e.colorNotation!==a){const e=colorData_to_XYZ_D50(n);switch(a){case he.HEX:case he.RGB:n.colorNotation=he.RGB,n.channels=x(e.channels);break;case he.sRGB:n.colorNotation=he.sRGB,n.channels=x(e.channels);break;case he.Linear_sRGB:n.colorNotation=he.Linear_sRGB,n.channels=w(e.channels);break;case he.Display_P3:n.colorNotation=he.Display_P3,n.channels=C(e.channels);break;case he.Linear_Display_P3:n.colorNotation=he.Linear_Display_P3,n.channels=_(e.channels);break;case he.Rec2020:n.colorNotation=he.Rec2020,n.channels=d(e.channels);break;case he.ProPhoto_RGB:n.colorNotation=he.ProPhoto_RGB,n.channels=y(e.channels);break;case he.A98_RGB:n.colorNotation=he.A98_RGB,n.channels=g(e.channels);break;case he.HSL:n.colorNotation=he.HSL,n.channels=f(e.channels);break;case he.HWB:n.colorNotation=he.HWB,n.channels=v(e.channels);break;case he.Lab:n.colorNotation=he.Lab,n.channels=b(e.channels);break;case he.LCH:n.colorNotation=he.LCH,n.channels=p(e.channels);break;case he.OKLCH:n.colorNotation=he.OKLCH,n.channels=N(e.channels);break;case he.OKLab:n.colorNotation=he.OKLab,n.channels=m(e.channels);break;case he.XYZ_D50:n.colorNotation=he.XYZ_D50,n.channels=h(e.channels);break;case he.XYZ_D65:n.colorNotation=he.XYZ_D65,n.channels=c(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(Ne.has(a)&&Ne.has(e.colorNotation))n.channels=carryForwardMissingComponents(e.channels,[0,1,2],[],n.channels,[0,1,2],[]);else switch(a){case he.HSL:switch(e.colorNotation){case he.HWB:n.channels=carryForwardMissingComponents(e.channels,[0],[1,2],n.channels,[0],[1,2]);break;case he.Lab:case he.OKLab:n.channels=carryForwardMissingComponents(e.channels,[0],[1,2],n.channels,[2],[0,1]);break;case he.LCH:case he.OKLCH:n.channels=carryForwardMissingComponents(e.channels,[0,1,2],[],n.channels,[2,1,0],[]);break;default:n.channels=carryForwardMissingComponents(e.channels,[],[],n.channels,[],[])}break;case he.HWB:switch(e.colorNotation){case he.HSL:n.channels=carryForwardMissingComponents(e.channels,[0],[1,2],n.channels,[0],[1,2]);break;case he.LCH:case he.OKLCH:n.channels=carryForwardMissingComponents(e.channels,[2],[0,1],n.channels,[0],[1,2]);break;default:n.channels=carryForwardMissingComponents(e.channels,[],[],n.channels,[],[])}break;case he.Lab:case he.OKLab:switch(e.colorNotation){case he.HSL:n.channels=carryForwardMissingComponents(e.channels,[2],[0,1],n.channels,[0],[1,2]);break;case he.Lab:case he.OKLab:n.channels=carryForwardMissingComponents(e.channels,[0,1,2],[],n.channels,[0,1,2],[]);break;case he.LCH:case he.OKLCH:n.channels=carryForwardMissingComponents(e.channels,[0],[1,2],n.channels,[0],[1,2]);break;default:n.channels=carryForwardMissingComponents(e.channels,[],[],n.channels,[],[])}break;case he.LCH:case he.OKLCH:switch(e.colorNotation){case he.HSL:n.channels=carryForwardMissingComponents(e.channels,[0,1,2],[],n.channels,[2,1,0],[]);break;case he.HWB:n.channels=carryForwardMissingComponents(e.channels,[0],[1,2],n.channels,[2],[0,1]);break;case he.Lab:case he.OKLab:n.channels=carryForwardMissingComponents(e.channels,[0],[1,2],n.channels,[0],[1,2]);break;case he.LCH:case he.OKLCH:n.channels=carryForwardMissingComponents(e.channels,[0,1,2],[],n.channels,[0,1,2],[]);break;default:n.channels=carryForwardMissingComponents(e.channels,[],[],n.channels,[],[])}break;default:n.channels=carryForwardMissingComponents(e.channels,[],[],n.channels,[],[])}return n}function convertPowerlessComponentsToMissingComponents(e,a){const n=[...e];switch(a){case he.HSL:!Number.isNaN(n[1])&&n[1]<=.001&&(n[0]=Number.NaN);break;case he.HWB:!Number.isNaN(n[1])&&!Number.isNaN(n[2])&&Math.max(0,n[1])+Math.max(0,n[2])>=99.999&&(n[0]=Number.NaN);break;case he.LCH:!Number.isNaN(n[1])&&n[1]<=.0015&&(n[2]=Number.NaN);break;case he.OKLCH:!Number.isNaN(n[1])&&n[1]<=4e-6&&(n[2]=Number.NaN)}return n}function convertPowerlessComponentsToZeroValuesForDisplay(e,a){const n=[...e];switch(a){case he.HSL:(reducePrecision(n[2])<=0||reducePrecision(n[2])>=100)&&(n[0]=Number.NaN,n[1]=Number.NaN),!Number.isNaN(n[1])&&n[1]<=.001&&(n[0]=Number.NaN);break;case he.HWB:!Number.isNaN(n[1])&&!Number.isNaN(n[2])&&Math.max(0,n[1])+Math.max(0,n[2])>=99.999&&(n[0]=Number.NaN);break;case he.Lab:(reducePrecision(n[0])<=0||reducePrecision(n[0])>=100)&&(n[1]=Number.NaN,n[2]=Number.NaN);break;case he.LCH:!Number.isNaN(n[1])&&n[1]<=.0015&&(n[2]=Number.NaN),(reducePrecision(n[0])<=0||reducePrecision(n[0])>=100)&&(n[1]=Number.NaN,n[2]=Number.NaN);break;case he.OKLab:(reducePrecision(n[0])<=0||reducePrecision(n[0])>=1)&&(n[1]=Number.NaN,n[2]=Number.NaN);break;case he.OKLCH:!Number.isNaN(n[1])&&n[1]<=4e-6&&(n[2]=Number.NaN),(reducePrecision(n[0])<=0||reducePrecision(n[0])>=1)&&(n[1]=Number.NaN,n[2]=Number.NaN)}return n}function carryForwardMissingComponents(e,a,n,r,o,t){if(a.length<3&&e.every(Number.isNaN))return[Number.NaN,Number.NaN,Number.NaN];const l=[...r];for(let n=0;nNumber.isNaN(e[a])))for(let e=0;ee<-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,he.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 pe=/[A-Z]/g;function toLowerCaseAZ(e){return e.replace(pe,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(me.HasNoneKeywords),[e.Number,"none",t[2],t[3],{value:Number.NaN,type:a.Number}];if(r(t)){3!==l&&s.syntaxFlags.add(me.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(me.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 be=new Set(["srgb","srgb-linear","display-p3","display-p3-linear","a98-rgb","prophoto-rgb","rec2020","xyz","xyz-d50","xyz-d65"]);function color$1(e,a){const r=[],s=[],u=[],i=[];let c,h,m=!1,N=!1;const p={colorNotation:he.sRGB,channels:[0,0,0],alpha:1,syntaxFlags:new Set([])};let b=r;for(let o=0;o=0){t=i.value[4].value;continue}}return!1}if(!o)return!1;n.push({color:o,percentage:t}),o=!1,t=!1}}return!!o&&(n.push({color:o,percentage:t}),n)}function colorMixRectangular(e,a){if(!a||!a.length)return!1;for(const e of a)if(e.percentage&&(e.percentage<0||e.percentage>100))return!1;const{items:n,leftover:r}=normalizeMixPercentages(a,!0),o=1-r/100;let t;switch(e){case"srgb":t=he.RGB;break;case"srgb-linear":t=he.Linear_sRGB;break;case"display-p3":t=he.Display_P3;break;case"display-p3-linear":t=he.Linear_Display_P3;break;case"a98-rgb":t=he.A98_RGB;break;case"prophoto-rgb":t=he.ProPhoto_RGB;break;case"rec2020":t=he.Rec2020;break;case"lab":t=he.Lab;break;case"oklab":t=he.OKLab;break;case"xyz-d50":t=he.XYZ_D50;break;case"xyz":case"xyz-d65":t=he.XYZ_D65;break;default:return!1}if(1===n.length){const e=colorDataTo(n[0].color,t);return e.colorNotation=t,e.syntaxFlags.add(me.ColorMixVariadic),"number"!=typeof e.alpha?!1:(e.alpha=e.alpha*o,e)}for(n.reverse();n.length>=2;){const e=n.pop(),a=n.pop();if(!e||!a)return!1;const r=e.percentage+a.percentage,o=r>0?a.percentage/r:.5,l=colorMixRectangularPair(t,e.color,a.color,o);if(!l)return!1;n.push({color:l,percentage:r})}const l=n[0]?.color;return!!l&&("number"==typeof l.alpha&&(l.alpha=l.alpha*o,a.some(e=>e.color.syntaxFlags.has(me.Experimental))&&l.syntaxFlags.add(me.Experimental),2!==a.length&&l.syntaxFlags.add(me.ColorMixVariadic),l))}function colorMixRectangularPair(e,a,n,r){let o=a.alpha;if("number"!=typeof o)return!1;let t=n.alpha;if("number"!=typeof t)return!1;o=Number.isNaN(o)?t:o,t=Number.isNaN(t)?o:t;const l=colorDataTo(a,e).channels,s=colorDataTo(n,e).channels;l[0]=fillInMissingComponent(l[0],s[0]),s[0]=fillInMissingComponent(s[0],l[0]),l[1]=fillInMissingComponent(l[1],s[1]),s[1]=fillInMissingComponent(s[1],l[1]),l[2]=fillInMissingComponent(l[2],s[2]),s[2]=fillInMissingComponent(s[2],l[2]),l[0]=premultiply(l[0],o),l[1]=premultiply(l[1],o),l[2]=premultiply(l[2],o),s[0]=premultiply(s[0],t),s[1]=premultiply(s[1],t),s[2]=premultiply(s[2],t);const u=interpolate(o,t,r);return{colorNotation:e,channels:[un_premultiply(interpolate(l[0],s[0],r),u),un_premultiply(interpolate(l[1],s[1],r),u),un_premultiply(interpolate(l[2],s[2],r),u)],alpha:u,syntaxFlags:new Set([me.ColorMix])}}function colorMixPolar(e,a,n){if(!n||!n.length)return!1;for(const e of n)if(e.percentage&&(e.percentage<0||e.percentage>100))return!1;const{items:r,leftover:o}=normalizeMixPercentages(n,!0),t=1-o/100;let l;switch(e){case"hsl":l=he.HSL;break;case"hwb":l=he.HWB;break;case"lch":l=he.LCH;break;case"oklch":l=he.OKLCH;break;default:return!1}if(1===r.length){const e=colorDataTo(r[0].color,l);return e.colorNotation=l,e.syntaxFlags.add(me.ColorMixVariadic),"number"!=typeof e.alpha?!1:(e.alpha=e.alpha*t,e)}for(r.reverse();r.length>=2;){const e=r.pop(),n=r.pop();if(!e||!n)return!1;const o=e.percentage+n.percentage,t=o>0?n.percentage/o:.5,s=colorMixPolarPair(l,a,e.color,n.color,t);if(!s)return!1;r.push({color:s,percentage:o})}const s=r[0]?.color;return!!s&&("number"==typeof s.alpha&&(s.alpha=s.alpha*t,n.some(e=>e.color.syntaxFlags.has(me.Experimental))&&s.syntaxFlags.add(me.Experimental),2!==n.length&&s.syntaxFlags.add(me.ColorMixVariadic),s))}function colorMixPolarPair(e,a,n,r,o){let t=0,l=0,s=0,u=0,i=0,c=0,h=n.alpha;if("number"!=typeof h)return!1;let m=r.alpha;if("number"!=typeof m)return!1;h=Number.isNaN(h)?m:h,m=Number.isNaN(m)?h:m;const N=colorDataTo(n,e).channels,p=colorDataTo(r,e).channels;switch(e){case he.HSL:case he.HWB:t=N[0],l=p[0],s=N[1],u=p[1],i=N[2],c=p[2];break;case he.LCH:case he.OKLCH:s=N[0],u=p[0],i=N[1],c=p[1],t=N[2],l=p[2]}if(s=fillInMissingComponent(s,u),u=fillInMissingComponent(u,s),i=fillInMissingComponent(i,c),c=fillInMissingComponent(c,i),t=fillInMissingComponent(t,l),l=fillInMissingComponent(l,t),Number.isNaN(t)&&Number.isNaN(l));else{Number.isNaN(t)?t=0:Number.isNaN(l)&&(l=0);const e=l-t;switch(a){case"shorter":e>180?t+=360:e<-180&&(l+=360);break;case"longer":-1800?t+=360:l+=360);break;case"increasing":e<0&&(l+=360);break;case"decreasing":e>0&&(t+=360);break;default:throw new Error("Unknown hue interpolation method")}}s=premultiply(s,h),i=premultiply(i,h),u=premultiply(u,m),c=premultiply(c,m);let b=[0,0,0];const v=interpolate(h,m,o);switch(e){case he.HSL:case he.HWB:b=[interpolate(t,l,o),un_premultiply(interpolate(s,u,o),v),un_premultiply(interpolate(i,c,o),v)];break;case he.LCH:case he.OKLCH:b=[un_premultiply(interpolate(s,u,o),v),un_premultiply(interpolate(i,c,o),v),interpolate(t,l,o)]}return{colorNotation:e,channels:b,alpha:v,syntaxFlags:new Set([me.ColorMix])}}function fillInMissingComponent(e,a){return Number.isNaN(e)?a:e}function interpolate(e,a,n){return e*(1-n)+a*n}function premultiply(e,a){return Number.isNaN(a)?e:Number.isNaN(e)?Number.NaN:e*a}function un_premultiply(e,a){return 0===a||Number.isNaN(a)?e:Number.isNaN(e)?Number.NaN:e/a}function normalizeMixPercentages(e,a=!1){let n=0,r=0;for(const a of e)a.percentage&&(n+=a.percentage),!1===a.percentage&&r++;n=Math.min(100,n);for(const a of e)!1===a.percentage&&(a.percentage=(100-n)/r);const o=e.slice();let t=0;for(const e of o)t+=e.percentage;if(t>100||t>0&&a)for(const e of o)e.percentage=e.percentage*(100/t);let l=0;return t<100&&(l=100-t),{items:o,leftover:l}}function hex(e){const a=toLowerCaseAZ(e[4].value);if(a.match(/[^a-f0-9]/))return!1;const n={colorNotation:he.HEX,channels:[0,0,0],alpha:1,syntaxFlags:new Set([me.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(me.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(me.HasAlpha),n}return!1}function normalizeHue(n){if(o(n))return Number.isNaN(n[4].value)||Number.isFinite(n[4].value)||(n[4].value=0),n[4].value=n[4].value%360,n[4].value<0&&(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 Number.isNaN(n[4].value)||Number.isFinite(n[4].value)||(n[4].value=0),r%=360,r<0&&(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(me.HasDimensionValues),e)}if(r(n)){3===t?l.syntaxFlags.add(me.HasPercentageAlpha):l.syntaxFlags.add(me.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(me.HasNoneKeywords),[e.Number,"none",t[2],t[3],{value:Number.NaN,type:a.Number}];if(0===l){const e=normalizeHue(t);return!1!==e&&(u(t)&&s.syntaxFlags.add(me.HasDimensionValues),e)}if(r(t)){3===l?s.syntaxFlags.add(me.HasPercentageAlpha):s.syntaxFlags.add(me.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(me.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=[],i=[],c=[],h={colorNotation:n,channels:[0,0,0],alpha:1,syntaxFlags:new Set(r)};let m=t;for(let a=0;ane(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,he.HSL,[me.LegacyHSL])}function hslSpaceSeparated(e,a){return threeChannelSpaceSeparated(e,normalize_modern_HSL_ChannelValues,he.HSL,[],a)}function normalize_HWB_ChannelValues(t,l,s){if(n(t)&&"none"===toLowerCaseAZ(t[4].value))return s.syntaxFlags.add(me.HasNoneKeywords),[e.Number,"none",t[2],t[3],{value:Number.NaN,type:a.Number}];if(0===l){const e=normalizeHue(t);return!1!==e&&(u(t)&&s.syntaxFlags.add(me.HasDimensionValues),e)}if(r(t)){3===l?s.syntaxFlags.add(me.HasPercentageAlpha):s.syntaxFlags.add(me.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(me.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(me.HasNoneKeywords),[e.Number,"none",t[2],t[3],{value:Number.NaN,type:a.Number}];if(r(t)){3!==l&&s.syntaxFlags.add(me.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(me.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,he.Lab,[],a)}function normalize_LCH_ChannelValues(t,l,s){if(n(t)&&"none"===toLowerCaseAZ(t[4].value))return s.syntaxFlags.add(me.HasNoneKeywords),[e.Number,"none",t[2],t[3],{value:Number.NaN,type:a.Number}];if(2===l){const e=normalizeHue(t);return!1!==e&&(u(t)&&s.syntaxFlags.add(me.HasDimensionValues),e)}if(r(t)){3!==l&&s.syntaxFlags.add(me.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(me.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,he.LCH,[],a)}const ye=new Map;for(const[e,a]of Object.entries(G))ye.set(e,a);function namedColor(e){const a=ye.get(toLowerCaseAZ(e));return!!a&&{colorNotation:he.RGB,channels:[a[0]/255,a[1]/255,a[2]/255],alpha:1,syntaxFlags:new Set([me.ColorKeyword,me.NamedColor])}}function normalize_OKLab_ChannelValues(t,l,s){if(n(t)&&"none"===toLowerCaseAZ(t[4].value))return s.syntaxFlags.add(me.HasNoneKeywords),[e.Number,"none",t[2],t[3],{value:Number.NaN,type:a.Number}];if(r(t)){3!==l&&s.syntaxFlags.add(me.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(me.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,he.OKLab,[],a)}function normalize_OKLCH_ChannelValues(t,l,s){if(n(t)&&"none"===toLowerCaseAZ(t[4].value))return s.syntaxFlags.add(me.HasNoneKeywords),[e.Number,"none",t[2],t[3],{value:Number.NaN,type:a.Number}];if(2===l){const e=normalizeHue(t);return!1!==e&&(u(t)&&s.syntaxFlags.add(me.HasDimensionValues),e)}if(r(t)){3!==l&&s.syntaxFlags.add(me.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(me.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,he.OKLCH,[],a)}function normalize_legacy_sRGB_ChannelValues(n,t,l){if(r(n)){3===t?l.syntaxFlags.add(me.HasPercentageAlpha):l.syntaxFlags.add(me.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(me.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(me.HasNoneKeywords),[e.Number,"none",t[2],t[3],{value:Number.NaN,type:a.Number}];if(r(t)){3!==l&&s.syntaxFlags.add(me.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(me.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=>ne(e)&&s(e.value))){const a=rgbCommaSeparated(e);if(!1!==a)return(!a.syntaxFlags.has(me.HasNumberValues)||!a.syntaxFlags.has(me.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,he.RGB,[me.LegacyRGB])}function rgbSpaceSeparated(e,a){return threeChannelSpaceSeparated(e,normalize_modern_sRGB_ChannelValues,he.RGB,[],a)}function XYZ_D50_to_sRGB_Gamut(e){const a=x(e);if(A(a))return X(a);let n=e;return n=N(n),n[0]<1e-6&&(n=[0,0,0]),n[0]>.999999&&(n=[1,0,0]),K(Y(n,oklch_to_lin_srgb,lin_srgb_to_oklch))}function oklch_to_lin_srgb(e){return e=I(e),e=O(e),W(e)}function lin_srgb_to_oklch(e){return e=E(e),e=U(e),$(e)}function contrastColor(e,a){let n=!1;for(let r=0;rt?[1,1,1]:[0,0,0],r}function alpha(e,a){let r,s,u=!1,i=!1,c=!1;const h={colorNotation:he.sRGB,channels:[0,0,0],alpha:1,syntaxFlags:new Set([])};for(let m=0;m{if(ne(e)&&n(e.value)&&"alpha"===toLowerCaseAZ(e.value[4].value)&&r&&r.has("alpha"))return new oe(r.get("alpha"))});h.alpha=e[0][0],i=!0;continue}return!1}if(c)return!1;for(;ee(e.value[m+1])||ae(e.value[m+1]);)m++;if(m++,N=e.value[m],c=a(N),!1===c)return!1;r=normalizeRelativeColorDataChannels(c),s=noneToZeroInRelativeColorDataChannels(r),h.syntaxFlags=new Set(c.syntaxFlags),h.syntaxFlags.add(me.RelativeAlphaSyntax),h.channels=[...c.channels],h.colorNotation=c.colorNotation,h.alpha=c.alpha}}return!!r&&h}function XYZ_D50_to_P3_Gamut(e){const a=C(e);if(A(a))return X(a);let n=e;return n=N(n),n[0]<1e-6&&(n=[0,0,0]),n[0]>.999999&&(n=[1,0,0]),q(Y(n,oklch_to_lin_p3,lin_p3_to_oklch))}function oklch_to_lin_p3(e){return e=I(e),e=O(e),J(e)}function lin_p3_to_oklch(e){return e=Q(e),e=U(e),$(e)}function toPrecision(e,a=7){e=+e,a=+a;const n=(Math.floor(Math.abs(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 se(r,l,t):new se(r,l,[...t,new ue([o]),new oe([e.Delim,"/",-1,-1,{value:"/"}]),new ue([o]),new oe([e.Number,toPrecision(s,4).toString(),-1,-1,{value:n.alpha,type:a.Integer}])])}return new se(r,l,[...t,new ue([o]),new oe([e.Delim,"/",-1,-1,{value:"/"}]),new ue([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!==he.Display_P3&&(o=C(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"}],i=[e.Whitespace," ",-1,-1,void 0];return serializeWithAlpha(n,u,i,[new oe([e.Ident,"display-p3",-1,-1,{value:"display-p3"}]),new ue([i]),new oe([e.Number,t.toString(),-1,-1,{value:o[0],type:a.Number}]),new ue([i]),new oe([e.Number,l.toString(),-1,-1,{value:o[1],type:a.Number}]),new ue([i]),new oe([e.Number,s.toString(),-1,-1,{value:o[2],type:a.Number}])])}function serializeRGB(n,r=!0){let o;n.channels=convertPowerlessComponentsToZeroValuesForDisplay(n.channels,n.colorNotation),o=r?XYZ_D50_to_sRGB_Gamut(colorData_to_XYZ_D50(n).channels):x(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],i=[e.Whitespace," ",-1,-1,void 0],c=[e.Comma,",",-1,-1,void 0],h=[new oe([e.Number,t.toString(),-1,-1,{value:Math.min(255,255*Math.max(0,o[0])),type:a.Integer}]),new oe(c),new ue([i]),new oe([e.Number,l.toString(),-1,-1,{value:Math.min(255,255*Math.max(0,o[1])),type:a.Integer}]),new oe(c),new ue([i]),new oe([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 se([e.Function,"rgb(",-1,-1,{value:"rgb"}],u,h):new se([e.Function,"rgba(",-1,-1,{value:"rgba"}],u,[...h,new oe(c),new ue([i]),new oe([e.Number,toPrecision(r,4).toString(),-1,-1,{value:n.alpha,type:a.Number}])])}return new se([e.Function,"rgba(",-1,-1,{value:"rgba"}],u,[...h,new oe(c),new ue([i]),n.alpha])}function serializeHSL(n,r=!0){let o;n.channels=convertPowerlessComponentsToZeroValuesForDisplay(n.channels,n.colorNotation),o=f(r?T(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],i=[e.Whitespace," ",-1,-1,void 0],c=[e.Comma,",",-1,-1,void 0],h=[new oe([e.Number,t.toString(),-1,-1,{value:o[0],type:a.Integer}]),new oe(c),new ue([i]),new oe([e.Percentage,l.toString()+"%",-1,-1,{value:o[1]}]),new oe(c),new ue([i]),new oe([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 se([e.Function,"hsl(",-1,-1,{value:"hsl"}],u,h):new se([e.Function,"hsla(",-1,-1,{value:"hsla"}],u,[...h,new oe(c),new ue([i]),new oe([e.Number,toPrecision(r,4).toString(),-1,-1,{value:n.alpha,type:a.Number}])])}return new se([e.Function,"hsla(",-1,-1,{value:"hsla"}],u,[...h,new oe(c),new ue([i]),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!==he.OKLCH&&(r=N(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 oe([e.Number,o.toString(),-1,-1,{value:r[0],type:a.Number}]),new ue([u]),new oe([e.Number,t.toString(),-1,-1,{value:r[1],type:a.Number}]),new ue([u]),new oe([e.Number,l.toString(),-1,-1,{value:r[2],type:a.Number}])])}function color(e){if(re(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,he.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);case"alpha":return alpha(e,color)}}var a;if(ne(e)){if(i(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:he.RGB,channels:[0,0,0],alpha:0,syntaxFlags:new Set([me.ColorKeyword])}}}return!1}export{he as ColorNotation,me as SyntaxFlag,color,colorDataFitsDisplayP3_Gamut,colorDataFitsRGB_Gamut,serializeHSL,serializeOKLCH,serializeP3,serializeRGB}; diff --git a/node_modules/@csstools/css-color-parser/package.json b/node_modules/@csstools/css-color-parser/package.json new file mode 100644 index 0000000000000000000000000000000000000000..b16dd5618d7ddb0b152b7c8624f9807ab93aeb5b --- /dev/null +++ b/node_modules/@csstools/css-color-parser/package.json @@ -0,0 +1,64 @@ +{ + "name": "@csstools/css-color-parser", + "description": "Parse CSS color values", + "version": "4.1.7", + "contributors": [ + { + "name": "Antonio Laguna", + "email": "antonio@laguna.es", + "url": "https://antonio.laguna.es" + }, + { + "name": "Romain Menke", + "email": "romainmenke@gmail.com" + } + ], + "license": "MIT", + "funding": [ + { + "type": "github", + "url": "https://github.com/sponsors/csstools" + }, + { + "type": "opencollective", + "url": "https://opencollective.com/csstools" + } + ], + "engines": { + "node": ">=20.19.0" + }, + "type": "module", + "exports": { + ".": { + "types": "./dist/index.d.ts", + "default": "./dist/index.mjs" + } + }, + "files": [ + "CHANGELOG.md", + "LICENSE.md", + "README.md", + "dist" + ], + "dependencies": { + "@csstools/color-helpers": "^6.0.2", + "@csstools/css-calc": "^3.2.1" + }, + "peerDependencies": { + "@csstools/css-parser-algorithms": "^4.0.0", + "@csstools/css-tokenizer": "^4.0.0" + }, + "scripts": {}, + "homepage": "https://github.com/csstools/postcss-plugins/tree/main/packages/css-color-parser#readme", + "repository": { + "type": "git", + "url": "git+https://github.com/csstools/postcss-plugins.git", + "directory": "packages/css-color-parser" + }, + "bugs": "https://github.com/csstools/postcss-plugins/issues", + "keywords": [ + "color", + "css", + "parser" + ] +} diff --git a/node_modules/@csstools/css-parser-algorithms/CHANGELOG.md b/node_modules/@csstools/css-parser-algorithms/CHANGELOG.md new file mode 100644 index 0000000000000000000000000000000000000000..5abd590803a81795c97892ced4f5332027a04b55 --- /dev/null +++ b/node_modules/@csstools/css-parser-algorithms/CHANGELOG.md @@ -0,0 +1,11 @@ +# Changes to CSS Parser Algorithms + +### 4.0.0 + +_January 14, 2026_ + +- Updated: Support for Node `20.19.0` or later (major). +- Removed: `commonjs` API. In supported Node versions `require(esm)` will work without needing to make code changes. +- Updated [`@csstools/css-tokenizer`](https://github.com/csstools/postcss-plugins/tree/main/packages/css-tokenizer) to [`4.0.0`](https://github.com/csstools/postcss-plugins/tree/main/packages/css-tokenizer/CHANGELOG.md#400) (major) + +[Full CHANGELOG](https://github.com/csstools/postcss-plugins/tree/main/packages/css-parser-algorithms/CHANGELOG.md) diff --git a/node_modules/@csstools/css-parser-algorithms/LICENSE.md b/node_modules/@csstools/css-parser-algorithms/LICENSE.md new file mode 100644 index 0000000000000000000000000000000000000000..af5411fa243cfcf2b61c79d081dbb6204e956041 --- /dev/null +++ b/node_modules/@csstools/css-parser-algorithms/LICENSE.md @@ -0,0 +1,20 @@ +The MIT License (MIT) + +Copyright 2022 Romain Menke, Antonio Laguna + +Permission is hereby granted, free of charge, to any person obtaining a copy of +this software and associated documentation files (the "Software"), to deal in +the Software without restriction, including without limitation the rights to +use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of +the Software, and to permit persons to whom the Software is furnished to do so, +subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS +FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR +COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER +IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN +CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. diff --git a/node_modules/@csstools/css-parser-algorithms/README.md b/node_modules/@csstools/css-parser-algorithms/README.md new file mode 100644 index 0000000000000000000000000000000000000000..a51d668793606fbc2faf755abb557024da3a6345 --- /dev/null +++ b/node_modules/@csstools/css-parser-algorithms/README.md @@ -0,0 +1,119 @@ +# CSS Parser Algorithms for CSS + +[npm version][npm-url] +[Build Status][cli-url] +[Discord][discord] + +Implemented from : https://www.w3.org/TR/2021/CRD-css-syntax-3-20211224/ + +## API + +[Read the API docs](./docs/css-parser-algorithms.md) + +## Usage + +Add [CSS Parser Algorithms] to your project: + +```bash +npm install @csstools/css-parser-algorithms @csstools/css-tokenizer --save-dev +``` + +[CSS Parser Algorithms] only accepts tokenized CSS. +It must be used together with `@csstools/css-tokenizer`. + + +```js +import { tokenizer, TokenType } from '@csstools/css-tokenizer'; +import { parseComponentValue } from '@csstools/css-parser-algorithms'; + +const myCSS = `@media only screen and (min-width: 768rem) { + .foo { + content: 'Some content!' !important; + } +} +`; + +const t = tokenizer({ + css: myCSS, +}); + +const tokens = []; + +{ + while (!t.endOfFile()) { + tokens.push(t.nextToken()); + } + + tokens.push(t.nextToken()); // EOF-token +} + +const options = { + onParseError: ((err) => { + throw err; + }), +}; + +const result = parseComponentValue(tokens, options); + +console.log(result); +``` + +### Available functions + +- [`parseComponentValue`](https://www.w3.org/TR/css-syntax-3/#parse-component-value) +- [`parseListOfComponentValues`](https://www.w3.org/TR/css-syntax-3/#parse-list-of-component-values) +- [`parseCommaSeparatedListOfComponentValues`](https://www.w3.org/TR/css-syntax-3/#parse-comma-separated-list-of-component-values) + +### Utilities + +#### `gatherNodeAncestry` + +The AST does not expose the entire ancestry of each node. +The walker methods do provide access to the current parent, but also not the entire ancestry. + +To gather the entire ancestry for a a given sub tree of the AST you can use `gatherNodeAncestry`. +The result is a `Map` with the child nodes as keys and the parents as values. +This allows you to lookup any ancestor of any node. + +```js +import { parseComponentValue } from '@csstools/css-parser-algorithms'; + +const result = parseComponentValue(tokens, options); +const ancestry = gatherNodeAncestry(result); +``` + +### Options + +```ts +{ + onParseError?: (error: ParseError) => void +} +``` + +#### `onParseError` + +The parser algorithms are forgiving and won't stop when a parse error is encountered. +Parse errors also aren't tokens. + +To receive parsing error information you can set a callback. + +Parser errors will try to inform you about the point in the parsing logic the error happened. +This tells you the kind of error. + +## Goals and non-goals + +Things this package aims to be: +- specification compliant CSS parser +- a reliable low level package to be used in CSS sub-grammars + +What it is not: +- opinionated +- fast +- small +- a replacement for PostCSS (PostCSS is fast and also an ecosystem) + +[cli-url]: https://github.com/csstools/postcss-plugins/actions/workflows/test.yml?query=workflow/test +[discord]: https://discord.gg/bUadyRwkJS +[npm-url]: https://www.npmjs.com/package/@csstools/css-parser-algorithms + +[CSS Parser Algorithms]: https://github.com/csstools/postcss-plugins/tree/main/packages/css-parser-algorithms diff --git a/node_modules/@csstools/css-parser-algorithms/dist/index.d.ts b/node_modules/@csstools/css-parser-algorithms/dist/index.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..c59d3ddfdefa7886c9ba6c0dd024dd64c5e8993f --- /dev/null +++ b/node_modules/@csstools/css-parser-algorithms/dist/index.d.ts @@ -0,0 +1,604 @@ +/** + * Parse CSS following the {@link https://drafts.csswg.org/css-syntax/#parsing | CSS Syntax Level 3 specification}. + * + * @remarks + * The tokenizing and parsing tools provided by CSS Tools are designed to be low level and generic with strong ties to their respective specifications. + * + * Any analysis or mutation of CSS source code should be done with the least powerful tool that can accomplish the task. + * For many applications it is sufficient to work with tokens. + * For others you might need to use {@link https://github.com/csstools/postcss-plugins/tree/main/packages/css-parser-algorithms | @csstools/css-parser-algorithms} or a more specific parser. + * + * The implementation of the AST nodes is kept lightweight and simple. + * Do not expect magic methods, instead assume that arrays and class instances behave like any other JavaScript. + * + * @example + * Parse a string of CSS into a component value: + * ```js + * import { tokenize } from '@csstools/css-tokenizer'; + * import { parseComponentValue } from '@csstools/css-parser-algorithms'; + * + * const myCSS = `calc(1px * 2)`; + * + * const componentValue = parseComponentValue(tokenize({ + * css: myCSS, + * })); + * + * console.log(componentValue); + * ``` + * + * @example + * Use the right algorithm for the job. + * + * Algorithms that can parse larger structures (comma-separated lists, ...) can also parse smaller structures. + * However, the opposite is not true. + * + * If your context allows a list of component values, use {@link parseListOfComponentValues}: + * ```js + * import { tokenize } from '@csstools/css-tokenizer'; + * import { parseListOfComponentValues } from '@csstools/css-parser-algorithms'; + * + * parseListOfComponentValues(tokenize({ css: `10x 20px` })); + * ``` + * + * If your context allows a comma-separated list of component values, use {@link parseCommaSeparatedListOfComponentValues}: + * ```js + * import { tokenize } from '@csstools/css-tokenizer'; + * import { parseCommaSeparatedListOfComponentValues } from '@csstools/css-parser-algorithms'; + * + * parseCommaSeparatedListOfComponentValues(tokenize({ css: `20deg, 50%, 30%` })); + * ``` + * + * @example + * Use the stateful walkers to keep track of the context of a given component value. + * + * ```js + * import { tokenize } from '@csstools/css-tokenizer'; + * import { parseComponentValue, isSimpleBlockNode } from '@csstools/css-parser-algorithms'; + * + * const myCSS = `calc(1px * (5 / 2))`; + * + * const componentValue = parseComponentValue(tokenize({ css: myCSS })); + * + * let state = { inSimpleBlock: false }; + * componentValue.walk((entry) => { + * if (isSimpleBlockNode(entry)) { + * entry.state.inSimpleBlock = true; + * return; + * } + * + * if (entry.state.inSimpleBlock) { + * console.log(entry.node.toString()); // `5`, ... + * } + * }, state); + * ``` + * + * @packageDocumentation + */ + +import type { CSSToken } from '@csstools/css-tokenizer'; +import { ParseError } from '@csstools/css-tokenizer'; +import type { TokenFunction } from '@csstools/css-tokenizer'; + +export declare class CommentNode { + /** + * The node type, always `ComponentValueType.Comment` + */ + type: ComponentValueType; + /** + * The comment token. + */ + value: CSSToken; + constructor(value: CSSToken); + /** + * Retrieve the tokens for the current comment. + * This is the inverse of parsing from a list of tokens. + */ + tokens(): Array; + /** + * Convert the current comment to a string. + * This is not a true serialization. + * It is purely a concatenation of the string representation of the tokens. + */ + toString(): string; + /** + * @internal + * + * A debug helper to convert the current object to a JSON representation. + * This is useful in asserts and to store large ASTs in files. + */ + toJSON(): Record; + /** + * @internal + */ + isCommentNode(): this is CommentNode; + /** + * @internal + */ + static isCommentNode(x: unknown): x is CommentNode; +} + +export declare type ComponentValue = FunctionNode | SimpleBlockNode | WhitespaceNode | CommentNode | TokenNode; + +export declare enum ComponentValueType { + Function = "function", + SimpleBlock = "simple-block", + Whitespace = "whitespace", + Comment = "comment", + Token = "token" +} + +export declare type ContainerNode = FunctionNode | SimpleBlockNode; + +export declare abstract class ContainerNodeBaseClass { + /** + * The contents of the `Function` or `Simple Block`. + * This is a list of component values. + */ + value: Array; + /** + * Retrieve the index of the given item in the current node. + * For most node types this will be trivially implemented as `this.value.indexOf(item)`. + */ + indexOf(item: ComponentValue): number | string; + /** + * Retrieve the item at the given index in the current node. + * For most node types this will be trivially implemented as `this.value[index]`. + */ + at(index: number | string): ComponentValue | undefined; + /** + * Iterates over each item in the `value` array of the current node. + * + * @param cb - The callback function to execute for each item. + * The function receives an object containing the current node (`node`), its parent (`parent`), + * and an optional `state` object. + * A second parameter is the index of the current node. + * The function can return `false` to stop the iteration. + * + * @param state - An optional state object that can be used to pass additional information to the callback function. + * The state object is cloned for each iteration. This means that changes to the state object are not reflected in the next iteration. + * + * @returns `false` if the iteration was halted, `undefined` otherwise. + */ + forEach, U extends ContainerNode>(this: U, cb: (entry: { + node: ComponentValue; + parent: ContainerNode; + state?: T; + }, index: number | string) => boolean | void, state?: T): false | undefined; + /** + * Walks the current node and all its children. + * + * @param cb - The callback function to execute for each item. + * The function receives an object containing the current node (`node`), its parent (`parent`), + * and an optional `state` object. + * A second parameter is the index of the current node. + * The function can return `false` to stop the iteration. + * + * @param state - An optional state object that can be used to pass additional information to the callback function. + * The state object is cloned for each iteration. This means that changes to the state object are not reflected in the next iteration. + * However changes are passed down to child node iterations. + * + * @returns `false` if the iteration was halted, `undefined` otherwise. + */ + walk, U extends ContainerNode>(this: U, cb: (entry: { + node: ComponentValue; + parent: ContainerNode; + state?: T; + }, index: number | string) => boolean | void, state?: T): false | undefined; +} + +/** + * Iterates over each item in a list of component values. + * + * @param cb - The callback function to execute for each item. + * The function receives an object containing the current node (`node`), its parent (`parent`), + * and an optional `state` object. + * A second parameter is the index of the current node. + * The function can return `false` to stop the iteration. + * + * @param state - An optional state object that can be used to pass additional information to the callback function. + * The state object is cloned for each iteration. This means that changes to the state object are not reflected in the next iteration. + * + * @returns `false` if the iteration was halted, `undefined` otherwise. + */ +export declare function forEach>(componentValues: Array, cb: (entry: { + node: ComponentValue; + parent: ContainerNode | { + value: Array; + }; + state?: T; +}, index: number | string) => boolean | void, state?: T): false | undefined; + +/** + * A function node. + * + * @example + * ```js + * const node = parseComponentValue(tokenize('calc(1 + 1)')); + * + * isFunctionNode(node); // true + * node.getName(); // 'calc' + * ``` + */ +export declare class FunctionNode extends ContainerNodeBaseClass { + /** + * The node type, always `ComponentValueType.Function` + */ + type: ComponentValueType; + /** + * The token for the name of the function. + */ + name: TokenFunction; + /** + * The token for the closing parenthesis of the function. + * If the function is unclosed, this will be an EOF token. + */ + endToken: CSSToken; + constructor(name: TokenFunction, endToken: CSSToken, value: Array); + /** + * Retrieve the name of the current function. + * This is the parsed and unescaped name of the function. + */ + getName(): string; + /** + * Normalize the current function: + * 1. if the "endToken" is EOF, replace with a ")-token" + */ + normalize(): void; + /** + * Retrieve the tokens for the current function. + * This is the inverse of parsing from a list of tokens. + */ + tokens(): Array; + /** + * Convert the current function to a string. + * This is not a true serialization. + * It is purely a concatenation of the string representation of the tokens. + */ + toString(): string; + /** + * @internal + * + * A debug helper to convert the current object to a JSON representation. + * This is useful in asserts and to store large ASTs in files. + */ + toJSON(): unknown; + /** + * @internal + */ + isFunctionNode(): this is FunctionNode; + /** + * @internal + */ + static isFunctionNode(x: unknown): x is FunctionNode; +} + +/** + * AST nodes do not have a `parent` property or method. + * This makes it harder to traverse the AST upwards. + * This function builds a `Map` that can be used to lookup ancestors of a node. + * + * @remarks + * There is no magic behind this or the map it returns. + * Mutating the AST will not update the map. + * + * Types are erased and any content of the map has type `unknown`. + * If someone knows a clever way to type this, please let us know. + * + * @example + * ```js + * const ancestry = gatherNodeAncestry(mediaQuery); + * mediaQuery.walk((entry) => { + * const node = entry.node; // directly exposed + * const parent = entry.parent; // directly exposed + * const grandParent: unknown = ancestry.get(parent); // lookup + * + * console.log('node', node); + * console.log('parent', parent); + * console.log('grandParent', grandParent); + * }); + * ``` + */ +export declare function gatherNodeAncestry(node: { + walk(cb: (entry: { + node: unknown; + parent: unknown; + }, index: number | string) => boolean | void): false | undefined; +}): Map; + +/** + * Check if the current object is a `CommentNode`. + * This is a type guard. + */ +export declare function isCommentNode(x: unknown): x is CommentNode; + +/** + * Check if the current object is a `FunctionNode`. + * This is a type guard. + */ +export declare function isFunctionNode(x: unknown): x is FunctionNode; + +/** + * Check if the current object is a `SimpleBlockNode`. + * This is a type guard. + */ +export declare function isSimpleBlockNode(x: unknown): x is SimpleBlockNode; + +/** + * Check if the current object is a `TokenNode`. + * This is a type guard. + */ +export declare function isTokenNode(x: unknown): x is TokenNode; + +/** + * Check if the current object is a `WhitespaceNode`. + * This is a type guard. + */ +export declare function isWhitespaceNode(x: unknown): x is WhitespaceNode; + +/** + * Check if the current object is a `WhiteSpaceNode` or a `CommentNode`. + * This is a type guard. + */ +export declare function isWhiteSpaceOrCommentNode(x: unknown): x is WhitespaceNode | CommentNode; + +/** + * Parse a comma-separated list of component values. + * + * @example + * ```js + * import { tokenize } from '@csstools/css-tokenizer'; + * import { parseCommaSeparatedListOfComponentValues } from '@csstools/css-parser-algorithms'; + * + * parseCommaSeparatedListOfComponentValues(tokenize({ css: `20deg, 50%, 30%` })); + * ``` + */ +export declare function parseCommaSeparatedListOfComponentValues(tokens: Array, options?: { + onParseError?: (error: ParseError) => void; +}): Array>; + +/** + * Parse a single component value. + * + * @example + * ```js + * import { tokenize } from '@csstools/css-tokenizer'; + * import { parseComponentValue } from '@csstools/css-parser-algorithms'; + * + * parseComponentValue(tokenize({ css: `10px` })); + * parseComponentValue(tokenize({ css: `calc((10px + 1x) * 4)` })); + * ``` + */ +export declare function parseComponentValue(tokens: Array, options?: { + onParseError?: (error: ParseError) => void; +}): ComponentValue | undefined; + +/** + * Parse a list of component values. + * + * @example + * ```js + * import { tokenize } from '@csstools/css-tokenizer'; + * import { parseListOfComponentValues } from '@csstools/css-parser-algorithms'; + * + * parseListOfComponentValues(tokenize({ css: `20deg 30%` })); + * ``` + */ +export declare function parseListOfComponentValues(tokens: Array, options?: { + onParseError?: (error: ParseError) => void; +}): Array; + +/** + * Replace specific component values in a list of component values. + * A helper for the most common and simplistic cases when mutating an AST. + */ +export declare function replaceComponentValues(componentValuesList: Array>, replaceWith: (componentValue: ComponentValue) => Array | ComponentValue | void): Array>; + +/** + * A simple block node. + * + * @example + * ```js + * const node = parseComponentValue(tokenize('[foo=bar]')); + * + * isSimpleBlockNode(node); // true + * node.startToken; // [TokenType.OpenSquare, '[', 0, 0, undefined] + * ``` + */ +export declare class SimpleBlockNode extends ContainerNodeBaseClass { + /** + * The node type, always `ComponentValueType.SimpleBlock` + */ + type: ComponentValueType; + /** + * The token for the opening token of the block. + */ + startToken: CSSToken; + /** + * The token for the closing token of the block. + * If the block is closed it will be the mirror variant of the `startToken`. + * If the block is unclosed, this will be an EOF token. + */ + endToken: CSSToken; + constructor(startToken: CSSToken, endToken: CSSToken, value: Array); + /** + * Normalize the current simple block + * 1. if the "endToken" is EOF, replace with the mirror token of the "startToken" + */ + normalize(): void; + /** + * Retrieve the tokens for the current simple block. + * This is the inverse of parsing from a list of tokens. + */ + tokens(): Array; + /** + * Convert the current simple block to a string. + * This is not a true serialization. + * It is purely a concatenation of the string representation of the tokens. + */ + toString(): string; + /** + * @internal + * + * A debug helper to convert the current object to a JSON representation. + * This is useful in asserts and to store large ASTs in files. + */ + toJSON(): unknown; + /** + * @internal + */ + isSimpleBlockNode(): this is SimpleBlockNode; + /** + * @internal + */ + static isSimpleBlockNode(x: unknown): x is SimpleBlockNode; +} + +/** + * Returns the start and end index of a node in the CSS source string. + */ +export declare function sourceIndices(x: { + tokens(): Array; +} | Array<{ + tokens(): Array; +}>): [number, number]; + +/** + * Concatenate the string representation of a collection of component values. + * This is not a proper serializer that will handle escaping and whitespace. + * It only produces valid CSS for token lists that are also valid. + */ +export declare function stringify(componentValueLists: Array>): string; + +export declare class TokenNode { + /** + * The node type, always `ComponentValueType.Token` + */ + type: ComponentValueType; + /** + * The token. + */ + value: CSSToken; + constructor(value: CSSToken); + /** + * This is the inverse of parsing from a list of tokens. + */ + tokens(): [CSSToken]; + /** + * Convert the current token to a string. + * This is not a true serialization. + * It is purely the string representation of token. + */ + toString(): string; + /** + * @internal + * + * A debug helper to convert the current object to a JSON representation. + * This is useful in asserts and to store large ASTs in files. + */ + toJSON(): Record; + /** + * @internal + */ + isTokenNode(): this is TokenNode; + /** + * @internal + */ + static isTokenNode(x: unknown): x is TokenNode; +} + +/** + * Walks each item in a list of component values all of their children. + * + * @param cb - The callback function to execute for each item. + * The function receives an object containing the current node (`node`), its parent (`parent`), + * and an optional `state` object. + * A second parameter is the index of the current node. + * The function can return `false` to stop the iteration. + * + * @param state - An optional state object that can be used to pass additional information to the callback function. + * The state object is cloned for each iteration. This means that changes to the state object are not reflected in the next iteration. + * However changes are passed down to child node iterations. + * + * @returns `false` if the iteration was halted, `undefined` otherwise. + * + * @example + * ```js + * import { tokenize } from '@csstools/css-tokenizer'; + * import { parseListOfComponentValues, isSimpleBlockNode } from '@csstools/css-parser-algorithms'; + * + * const myCSS = `calc(1px * (5 / 2)) 10px`; + * + * const componentValues = parseListOfComponentValues(tokenize({ css: myCSS })); + * + * let state = { inSimpleBlock: false }; + * walk(componentValues, (entry) => { + * if (isSimpleBlockNode(entry)) { + * entry.state.inSimpleBlock = true; + * return; + * } + * + * if (entry.state.inSimpleBlock) { + * console.log(entry.node.toString()); // `5`, ... + * } + * }, state); + * ``` + */ +export declare function walk>(componentValues: Array, cb: (entry: { + node: ComponentValue; + parent: ContainerNode | { + value: Array; + }; + state?: T; +}, index: number | string) => boolean | void, state?: T): false | undefined; + +/** + * Generate a function that finds the next element that should be visited when walking an AST. + * Rules : + * 1. the previous iteration is used as a reference, so any checks are relative to the start of the current iteration. + * 2. the next element always appears after the current index. + * 3. the next element always exists in the list. + * 4. replacing an element does not cause the replaced element to be visited. + * 5. removing an element does not cause elements to be skipped. + * 6. an element added later in the list will be visited. + */ +export declare function walkerIndexGenerator(initialList: Array): (list: Array, child: T, index: number) => number; + +export declare class WhitespaceNode { + /** + * The node type, always `ComponentValueType.WhiteSpace` + */ + type: ComponentValueType; + /** + * The list of consecutive whitespace tokens. + */ + value: Array; + constructor(value: Array); + /** + * Retrieve the tokens for the current whitespace. + * This is the inverse of parsing from a list of tokens. + */ + tokens(): Array; + /** + * Convert the current whitespace to a string. + * This is not a true serialization. + * It is purely a concatenation of the string representation of the tokens. + */ + toString(): string; + /** + * @internal + * + * A debug helper to convert the current object to a JSON representation. + * This is useful in asserts and to store large ASTs in files. + */ + toJSON(): Record; + /** + * @internal + */ + isWhitespaceNode(): this is WhitespaceNode; + /** + * @internal + */ + static isWhitespaceNode(x: unknown): x is WhitespaceNode; +} + +export { } diff --git a/node_modules/@csstools/css-parser-algorithms/dist/index.mjs b/node_modules/@csstools/css-parser-algorithms/dist/index.mjs new file mode 100644 index 0000000000000000000000000000000000000000..ca4f76de31a2e9693cc7b89685336fb0c1e1777d --- /dev/null +++ b/node_modules/@csstools/css-parser-algorithms/dist/index.mjs @@ -0,0 +1 @@ +import{isTokenEOF as e,TokenType as n,isToken as t,stringify as o,mirrorVariant as s,isTokenOpenParen as i,isTokenOpenCurly as r,isTokenOpenSquare as a,isTokenFunction as c,isTokenWhitespace as u,isTokenComment as l,mirrorVariantType as d,ParseError as h,isTokenWhiteSpaceOrComment as p,isTokenCloseParen as m,isTokenComma as k}from"@csstools/css-tokenizer";var f;function walkerIndexGenerator(e){let n=e.slice();return(e,t,o)=>{let s=-1;for(let i=n.indexOf(t);i=e.length)?-1:(n=e.slice(),s)}}function consumeComponentValue(e,n){const t=n[0];if(i(t)||r(t)||a(t)){const t=consumeSimpleBlock(e,n);return{advance:t.advance,node:t.node}}if(c(t)){const t=consumeFunction(e,n);return{advance:t.advance,node:t.node}}if(u(t)){const t=consumeWhitespace(e,n);return{advance:t.advance,node:t.node}}if(l(t)){const t=consumeComment(e,n);return{advance:t.advance,node:t.node}}return{advance:1,node:new TokenNode(t)}}!function(e){e.Function="function",e.SimpleBlock="simple-block",e.Whitespace="whitespace",e.Comment="comment",e.Token="token"}(f||(f={}));class ContainerNodeBaseClass{value=[];indexOf(e){return this.value.indexOf(e)}at(e){if("number"==typeof e)return e<0&&(e=this.value.length+e),this.value[e]}forEach(e,n){if(0===this.value.length)return;const t=walkerIndexGenerator(this.value);let o=0;for(;o!1!==e(n,t)&&((!("walk"in n.node)||!this.value.includes(n.node)||!1!==n.node.walk(e,n.state))&&void 0),n)}}class FunctionNode extends ContainerNodeBaseClass{type=f.Function;name;endToken;constructor(e,n,t){super(),this.name=e,this.endToken=n,this.value=t}getName(){return this.name[4].value}normalize(){e(this.endToken)&&(this.endToken=[n.CloseParen,")",-1,-1,void 0])}tokens(){return e(this.endToken)?[this.name,...this.value.flatMap(e=>e.tokens())]:[this.name,...this.value.flatMap(e=>e.tokens()),this.endToken]}toString(){const e=this.value.map(e=>t(e)?o(e):e.toString()).join("");return o(this.name)+e+o(this.endToken)}toJSON(){return{type:this.type,name:this.getName(),tokens:this.tokens(),value:this.value.map(e=>e.toJSON())}}isFunctionNode(){return FunctionNode.isFunctionNode(this)}static isFunctionNode(e){return!!e&&(e instanceof FunctionNode&&e.type===f.Function)}}function consumeFunction(n,t){const o=[];let s=1;for(;;){const i=t[s];if(!i||e(i))return n.onParseError(new h("Unexpected EOF while consuming a function.",t[0][2],t[t.length-1][3],["5.4.9. Consume a function","Unexpected EOF"])),{advance:t.length,node:new FunctionNode(t[0],i,o)};if(m(i))return{advance:s+1,node:new FunctionNode(t[0],i,o)};if(p(i)){const e=consumeAllCommentsAndWhitespace(n,t.slice(s));s+=e.advance,o.push(...e.nodes);continue}const r=consumeComponentValue(n,t.slice(s));s+=r.advance,o.push(r.node)}}class SimpleBlockNode extends ContainerNodeBaseClass{type=f.SimpleBlock;startToken;endToken;constructor(e,n,t){super(),this.startToken=e,this.endToken=n,this.value=t}normalize(){if(e(this.endToken)){const e=s(this.startToken);e&&(this.endToken=e)}}tokens(){return e(this.endToken)?[this.startToken,...this.value.flatMap(e=>e.tokens())]:[this.startToken,...this.value.flatMap(e=>e.tokens()),this.endToken]}toString(){const e=this.value.map(e=>t(e)?o(e):e.toString()).join("");return o(this.startToken)+e+o(this.endToken)}toJSON(){return{type:this.type,startToken:this.startToken,tokens:this.tokens(),value:this.value.map(e=>e.toJSON())}}isSimpleBlockNode(){return SimpleBlockNode.isSimpleBlockNode(this)}static isSimpleBlockNode(e){return!!e&&(e instanceof SimpleBlockNode&&e.type===f.SimpleBlock)}}function consumeSimpleBlock(n,t){const o=d(t[0][0]);if(!o)throw new Error("Failed to parse, a mirror variant must exist for all block open tokens.");const s=[];let i=1;for(;;){const r=t[i];if(!r||e(r))return n.onParseError(new h("Unexpected EOF while consuming a simple block.",t[0][2],t[t.length-1][3],["5.4.8. Consume a simple block","Unexpected EOF"])),{advance:t.length,node:new SimpleBlockNode(t[0],r,s)};if(r[0]===o)return{advance:i+1,node:new SimpleBlockNode(t[0],r,s)};if(p(r)){const e=consumeAllCommentsAndWhitespace(n,t.slice(i));i+=e.advance,s.push(...e.nodes);continue}const a=consumeComponentValue(n,t.slice(i));i+=a.advance,s.push(a.node)}}class WhitespaceNode{type=f.Whitespace;value;constructor(e){this.value=e}tokens(){return this.value}toString(){return o(...this.value)}toJSON(){return{type:this.type,tokens:this.tokens()}}isWhitespaceNode(){return WhitespaceNode.isWhitespaceNode(this)}static isWhitespaceNode(e){return!!e&&(e instanceof WhitespaceNode&&e.type===f.Whitespace)}}function consumeWhitespace(e,n){let t=0;for(;;){const e=n[t];if(!u(e))return{advance:t,node:new WhitespaceNode(n.slice(0,t))};t++}}class CommentNode{type=f.Comment;value;constructor(e){this.value=e}tokens(){return[this.value]}toString(){return o(this.value)}toJSON(){return{type:this.type,tokens:this.tokens()}}isCommentNode(){return CommentNode.isCommentNode(this)}static isCommentNode(e){return!!e&&(e instanceof CommentNode&&e.type===f.Comment)}}function consumeComment(e,n){return{advance:1,node:new CommentNode(n[0])}}function consumeAllCommentsAndWhitespace(e,n){const t=[];let o=0;for(;;){if(u(n[o])){const e=consumeWhitespace(0,n.slice(o));o+=e.advance,t.push(e.node);continue}if(!l(n[o]))return{advance:o,nodes:t};t.push(new CommentNode(n[o])),o++}}class TokenNode{type=f.Token;value;constructor(e){this.value=e}tokens(){return[this.value]}toString(){return this.value[1]}toJSON(){return{type:this.type,tokens:this.tokens()}}isTokenNode(){return TokenNode.isTokenNode(this)}static isTokenNode(e){return!!e&&(e instanceof TokenNode&&e.type===f.Token)}}function parseComponentValue(t,o){const s={onParseError:o?.onParseError??(()=>{})},i=[...t];e(i[i.length-1])||i.push([n.EOF,"",i[i.length-1][2],i[i.length-1][3],void 0]);const r=consumeComponentValue(s,i);if(e(i[Math.min(r.advance,i.length-1)]))return r.node;s.onParseError(new h("Expected EOF after parsing a component value.",t[0][2],t[t.length-1][3],["5.3.9. Parse a component value","Expected EOF"]))}function parseListOfComponentValues(t,o){const s={onParseError:o?.onParseError??(()=>{})},i=[...t];e(i[i.length-1])&&i.push([n.EOF,"",i[i.length-1][2],i[i.length-1][3],void 0]);const r=[];let a=0;for(;;){if(!i[a]||e(i[a]))return r;const n=consumeComponentValue(s,i.slice(a));r.push(n.node),a+=n.advance}}function parseCommaSeparatedListOfComponentValues(t,o){const s={onParseError:o?.onParseError??(()=>{})},i=[...t];if(0===t.length)return[];e(i[i.length-1])&&i.push([n.EOF,"",i[i.length-1][2],i[i.length-1][3],void 0]);const r=[];let a=[],c=0;for(;;){if(!i[c]||e(i[c]))return a.length&&r.push(a),r;if(k(i[c])){r.push(a),a=[],c++;continue}const n=consumeComponentValue(s,t.slice(c));a.push(n.node),c+=n.advance}}function gatherNodeAncestry(e){const n=new Map;return e.walk(e=>{Array.isArray(e.node)?e.node.forEach(t=>{n.set(t,e.parent)}):n.set(e.node,e.parent)}),n}function forEach(e,n,t){if(0===e.length)return;const o=walkerIndexGenerator(e);let s=0;for(;s!1!==n(t,o)&&((!("walk"in t.node)||!e.includes(t.node)||!1!==t.node.walk(n,t.state))&&void 0),t)}function replaceComponentValues(e,n){for(let t=0;t{if("number"!=typeof t)return;const o=n(e.node);o&&(Array.isArray(o)?e.parent.value.splice(t,1,...o):e.parent.value.splice(t,1,o))})}return e}function stringify(e){return e.map(e=>e.map(e=>o(...e.tokens())).join("")).join(",")}function isSimpleBlockNode(e){return SimpleBlockNode.isSimpleBlockNode(e)}function isFunctionNode(e){return FunctionNode.isFunctionNode(e)}function isWhitespaceNode(e){return WhitespaceNode.isWhitespaceNode(e)}function isCommentNode(e){return CommentNode.isCommentNode(e)}function isWhiteSpaceOrCommentNode(e){return isWhitespaceNode(e)||isCommentNode(e)}function isTokenNode(e){return TokenNode.isTokenNode(e)}function sourceIndices(e){if(Array.isArray(e)){const n=e[0];if(!n)return[0,0];const t=e[e.length-1]||n;return[sourceIndices(n)[0],sourceIndices(t)[1]]}const n=e.tokens(),t=n[0],o=n[n.length-1];return t&&o?[t[2],o[3]]:[0,0]}export{CommentNode,f as ComponentValueType,ContainerNodeBaseClass,FunctionNode,SimpleBlockNode,TokenNode,WhitespaceNode,forEach,gatherNodeAncestry,isCommentNode,isFunctionNode,isSimpleBlockNode,isTokenNode,isWhiteSpaceOrCommentNode,isWhitespaceNode,parseCommaSeparatedListOfComponentValues,parseComponentValue,parseListOfComponentValues,replaceComponentValues,sourceIndices,stringify,walk,walkerIndexGenerator}; diff --git a/node_modules/@csstools/css-parser-algorithms/package.json b/node_modules/@csstools/css-parser-algorithms/package.json new file mode 100644 index 0000000000000000000000000000000000000000..5734668fea74649ddb3ea7fc2ea4986ea903a6b7 --- /dev/null +++ b/node_modules/@csstools/css-parser-algorithms/package.json @@ -0,0 +1,58 @@ +{ + "name": "@csstools/css-parser-algorithms", + "description": "Algorithms to help you parse CSS from an array of tokens.", + "version": "4.0.0", + "contributors": [ + { + "name": "Antonio Laguna", + "email": "antonio@laguna.es", + "url": "https://antonio.laguna.es" + }, + { + "name": "Romain Menke", + "email": "romainmenke@gmail.com" + } + ], + "license": "MIT", + "funding": [ + { + "type": "github", + "url": "https://github.com/sponsors/csstools" + }, + { + "type": "opencollective", + "url": "https://opencollective.com/csstools" + } + ], + "engines": { + "node": ">=20.19.0" + }, + "type": "module", + "exports": { + ".": { + "types": "./dist/index.d.ts", + "default": "./dist/index.mjs" + } + }, + "files": [ + "CHANGELOG.md", + "LICENSE.md", + "README.md", + "dist" + ], + "peerDependencies": { + "@csstools/css-tokenizer": "^4.0.0" + }, + "scripts": {}, + "homepage": "https://github.com/csstools/postcss-plugins/tree/main/packages/css-parser-algorithms#readme", + "repository": { + "type": "git", + "url": "git+https://github.com/csstools/postcss-plugins.git", + "directory": "packages/css-parser-algorithms" + }, + "bugs": "https://github.com/csstools/postcss-plugins/issues", + "keywords": [ + "css", + "parser" + ] +} diff --git a/node_modules/@csstools/css-syntax-patches-for-csstree/CHANGELOG.md b/node_modules/@csstools/css-syntax-patches-for-csstree/CHANGELOG.md new file mode 100644 index 0000000000000000000000000000000000000000..28fd67a36c521e74b95adfb85e3c08c52b09ee4e --- /dev/null +++ b/node_modules/@csstools/css-syntax-patches-for-csstree/CHANGELOG.md @@ -0,0 +1,10 @@ +# Changes to CSS Syntax Patches For CSSTree + +### 1.1.5 + +_June 3, 2026_ + +- Update `@webref/css` to [`v8.5.7`](https://github.com/w3c/webref/releases/tag/%40webref%2Fcss%408.5.7) +- Patch `@position-try` and `@page` + +[Full CHANGELOG](https://github.com/csstools/postcss-plugins/tree/main/packages/css-syntax-patches-for-csstree/CHANGELOG.md) diff --git a/node_modules/@csstools/css-syntax-patches-for-csstree/LICENSE.md b/node_modules/@csstools/css-syntax-patches-for-csstree/LICENSE.md new file mode 100644 index 0000000000000000000000000000000000000000..e8ae93b9f928ff78839d6b26e3a079d9c95ed3be --- /dev/null +++ b/node_modules/@csstools/css-syntax-patches-for-csstree/LICENSE.md @@ -0,0 +1,18 @@ +MIT No Attribution (MIT-0) + +Copyright © CSSTools Contributors + +Permission is hereby granted, free of charge, to any person obtaining a copy of +this software and associated documentation files (the “Software”), to deal in +the Software without restriction, including without limitation the rights to +use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies +of the Software, and to permit persons to whom the Software is furnished to do +so. + +THE SOFTWARE IS PROVIDED “AS IS”, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +SOFTWARE. diff --git a/node_modules/@csstools/css-syntax-patches-for-csstree/README.md b/node_modules/@csstools/css-syntax-patches-for-csstree/README.md new file mode 100644 index 0000000000000000000000000000000000000000..00e214f6290b6cdefa4d4b7e4851c8da4f823486 --- /dev/null +++ b/node_modules/@csstools/css-syntax-patches-for-csstree/README.md @@ -0,0 +1,43 @@ +# CSS Syntax Patches For CSSTree for CSS + +[npm version][npm-url] +[Build Status][cli-url] + +Patch [csstree](https://github.com/csstree/csstree) syntax definitions with the latest data from CSS specifications. + +## Usage + +```bash +npm install @csstools/css-syntax-patches-for-csstree +``` + +```js +import { fork } from 'css-tree'; +import syntax_patches from '@csstools/css-syntax-patches-for-csstree' with { type: 'json' }; + +const forkedLexer = fork({ + atrules: syntax_patches.next.atrules, + properties: syntax_patches.next.properties, + types: syntax_patches.next.types, +}).lexer; +``` + +## `next` + +```js +import syntax_patches from '@csstools/css-syntax-patches-for-csstree' with { type: 'json' }; + +console.log(syntax_patches.next); +// ^^^^ +``` + +CSS specifications are often still in flux and various parts might change or disappear altogether. +Specifications also contains parts that haven't been implemented yet in a browser. +Only CSS that is widely adopted can be expected to be stable. + +The `next` grouping contains a combination of what is currently valid in browsers and the progress in various specifications. + +_In the future more groupings might be added._ + +[cli-url]: https://github.com/csstools/postcss-plugins/actions/workflows/test.yml?query=workflow/test +[npm-url]: https://www.npmjs.com/package/@csstools/css-syntax-patches-for-csstree diff --git a/node_modules/@csstools/css-syntax-patches-for-csstree/dist/index.d.ts b/node_modules/@csstools/css-syntax-patches-for-csstree/dist/index.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..05d942a6108634866c065e329dbc173a98e7c2ef --- /dev/null +++ b/node_modules/@csstools/css-syntax-patches-for-csstree/dist/index.d.ts @@ -0,0 +1,5 @@ +export const next: { + atrules: Record }>, + properties: Record, + types: Record, +} diff --git a/node_modules/@csstools/css-syntax-patches-for-csstree/dist/index.json b/node_modules/@csstools/css-syntax-patches-for-csstree/dist/index.json new file mode 100644 index 0000000000000000000000000000000000000000..833ee14d49329b72f2875c466be6821fff388786 --- /dev/null +++ b/node_modules/@csstools/css-syntax-patches-for-csstree/dist/index.json @@ -0,0 +1,794 @@ +{ + "next": { + "atrules": { + "color-profile": { + "descriptors": { + "components": "#", + "rendering-intent": "relative-colorimetric | absolute-colorimetric | perceptual | saturation", + "src": "" + } + }, + "font-face": { + "descriptors": { + "ascent-override": "[ normal | ]{1,2}", + "descent-override": "[ normal | ]{1,2}", + "font-family": "", + "font-language-override": "normal | ", + "font-named-instance": "auto | ", + "font-size": "auto | [ ]{1,2}", + "font-style": "auto | normal | italic | left | right | oblique [ {1,2} ]?", + "font-weight": "| auto", + "font-width": "auto | <'font-width'>{1,2}", + "line-gap-override": "[ normal | ]{1,2}", + "size-adjust": "", + "src": "", + "subscript-position-override": "[ normal | from-font | ]{1,2}", + "subscript-size-override": "[ normal | from-font | ]{1,2}", + "superscript-position-override": "[ normal | from-font | ]{1,2}", + "superscript-size-override": "[ normal | from-font | ]{1,2}", + "unicode-range": "#" + } + }, + "font-feature-values": { + "descriptors": { + "font-display": "auto | block | swap | fallback | optional" + } + }, + "font-palette-values": { + "descriptors": { + "font-family": "#" + } + }, + "function": { + "descriptors": { + "result": "?" + } + }, + "page": { + "descriptors": { + "margin": "<'margin'>", + "margin-bottom": "<'margin-bottom'>", + "margin-left": "<'margin-left'>", + "margin-right": "<'margin-right'>", + "margin-top": "<'margin-top'>", + "page-margin-safety": "none | clamp | add" + } + }, + "position-try": { + "descriptors": { + "position-anchor": "<'position-anchor'>", + "position-area": "<'position-area'>" + } + } + }, + "properties": { + "align-self": "auto | ? [ normal | ] | stretch | | anchor-center", + "alignment-baseline": "auto | before-edge | text-before-edge | after-edge | text-after-edge | baseline | ", + "all": " | revert-rule", + "anchor-name": "none | #", + "anchor-scope": "none | all | #", + "animation-range-center": "[ normal | [ | ? ] ]#", + "appearance": "none | auto | base | base-select | | | base", + "background-blend-mode": "<'mix-blend-mode'>#", + "background-position-block": "[ center | [ [ start | end ]? ? ]! ]#", + "background-position-inline": "[ center | [ [ start | end ]? ? ]! ]#", + "background-repeat-block": "#", + "background-repeat-inline": "#", + "background-repeat-x": "#", + "background-repeat-y": "#", + "background-tbd": "#", + "baseline-shift": " | sub | super | top | center | bottom", + "block-ellipsis": "no-ellipsis | auto | ", + "block-step": "<'block-step-size'> || <'block-step-insert'> || <'block-step-align'> || <'block-step-round'>", + "block-step-align": "auto | center | start | end", + "block-step-insert": "margin-box | padding-box | content-box", + "block-step-round": "up | down | nearest", + "block-step-size": "none | ", + "bookmark-label": "", + "bookmark-level": "none | ", + "bookmark-state": "open | closed", + "border-block-clip": "<'border-top-clip'>", + "border-block-end": " || || ", + "border-block-end-clip": "none | [ | ]+", + "border-block-end-color": " | ", + "border-block-end-radius": "{1,2} [ / {1,2} ]?", + "border-block-end-style": "", + "border-block-end-width": "", + "border-block-start": " || || ", + "border-block-start-clip": "none | [ | ]+", + "border-block-start-color": " | ", + "border-block-start-radius": "{1,2} [ / {1,2} ]?", + "border-block-start-style": "", + "border-block-start-width": "", + "border-bottom-clip": "none | [ | ]+", + "border-bottom-color": " | ", + "border-bottom-left-radius": "", + "border-bottom-radius": "{1,2} [ / {1,2} ]?", + "border-bottom-right-radius": "", + "border-boundary": "none | parent | display", + "border-clip": "<'border-top-clip'>", + "border-color": "[ | ]{1,4}", + "border-end-end-radius": "", + "border-end-start-radius": "", + "border-inline-clip": "<'border-top-clip'>", + "border-inline-end": " || || ", + "border-inline-end-clip": "none | [ | ]+", + "border-inline-end-color": " | ", + "border-inline-end-radius": "{1,2} [ / {1,2} ]?", + "border-inline-end-style": "", + "border-inline-end-width": "", + "border-inline-start": " || || ", + "border-inline-start-clip": "none | [ | ]+", + "border-inline-start-color": " | ", + "border-inline-start-radius": "{1,2} [ / {1,2} ]?", + "border-inline-start-style": "", + "border-inline-start-width": "", + "border-left-clip": "none | [ | ]+", + "border-left-color": " | ", + "border-left-radius": "{1,2} [ / {1,2} ]?", + "border-limit": "all | [ sides | corners ] ? | [ top | right | bottom | left ] ", + "border-right-clip": "none | [ | ]+", + "border-right-color": " | ", + "border-right-radius": "{1,2} [ / {1,2} ]?", + "border-shape": "none | [ ? ]{1,2}", + "border-spacing": "{1,2}", + "border-start-end-radius": "", + "border-start-start-radius": "", + "border-style": "<'border-top-style'>{1,4}", + "border-top-clip": "none | [ | ]+", + "border-top-color": " | ", + "border-top-left-radius": "", + "border-top-radius": "{1,2} [ / {1,2} ]?", + "border-top-right-radius": "", + "border-width": "<'border-top-width'>{1,4}", + "box-shadow": "#", + "box-shadow-blur": "#", + "box-shadow-color": "#", + "box-shadow-offset": "[ none | {1,2} ]#", + "box-shadow-position": "[ outset | inset ]#", + "box-shadow-spread": "#", + "box-snap": "none | block-start | block-end | center | baseline | last-baseline", + "caret-color": "auto | [ auto | ]?", + "clear": "| block-start | block-end | top | bottom | both-inline | both-block", + "clip": "rect( , , , ) | rect( ) | auto", + "color-adjust": "<'print-color-adjust'>", + "color-interpolation": "auto | sRGB | linearRGB", + "column-count": "auto | ", + "column-fill": "| balance-all", + "column-gap": "normal | | ", + "column-rule": " | ", + "column-rule-break": "none | normal | intersection", + "column-rule-color": " | ", + "column-rule-inset": "<'column-rule-inset-cap'> [ / <'column-rule-inset-junction'> ]?", + "column-rule-inset-cap": " ?", + "column-rule-inset-cap-end": "", + "column-rule-inset-cap-start": "", + "column-rule-inset-end": "", + "column-rule-inset-junction": " ?", + "column-rule-inset-junction-end": "", + "column-rule-inset-junction-start": "", + "column-rule-inset-start": "", + "column-rule-style": " | ", + "column-rule-visibility-items": "all | around | between | normal", + "column-rule-width": " | ", + "column-span": "| | auto", + "column-width": "auto | | min-content | max-content | fit-content( )", + "contain": "none | strict | content | [ [ size | inline-size ] || layout || style || paint ]", + "contain-intrinsic-block-size": "auto? [ none | ]", + "contain-intrinsic-height": "auto? [ none | ]", + "contain-intrinsic-inline-size": "auto? [ none | ]", + "contain-intrinsic-size": "[ auto? [ none | ] ]{1,2}", + "contain-intrinsic-width": "auto? [ none | ]", + "container-type": "normal | [ [ size | inline-size ] || scroll-state ]", + "content": "| ", + "continue": "auto | discard | collapse | -webkit-legacy | overflow | paginate | fragments", + "copy-into": "none | [ [ ] [, ]* ]?", + "corner": "<'border-radius'> || <'corner-shape'>", + "corner-block-end": "<'border-top-radius'> || <'corner-top-shape'>", + "corner-block-end-shape": "<'corner-top-left-shape'>{1,2}", + "corner-block-start": "<'border-top-radius'> || <'corner-top-shape'>", + "corner-block-start-shape": "<'corner-top-left-shape'>{1,2}", + "corner-bottom": "<'border-top-radius'> || <'corner-top-shape'>", + "corner-bottom-left": "<'border-top-left-radius'> || <'corner-top-left-shape'>", + "corner-bottom-right": "<'border-top-left-radius'> || <'corner-top-left-shape'>", + "corner-bottom-shape": "<'corner-top-left-shape'>{1,2}", + "corner-end-end": "<'border-top-left-radius'> || <'corner-top-left-shape'>", + "corner-end-start": "<'border-top-left-radius'> || <'corner-top-left-shape'>", + "corner-inline-end": "<'border-top-radius'> || <'corner-top-shape'>", + "corner-inline-end-shape": "<'corner-top-left-shape'>{1,2}", + "corner-inline-start": "<'border-top-radius'> || <'corner-top-shape'>", + "corner-inline-start-shape": "<'corner-top-left-shape'>{1,2}", + "corner-left": "<'border-top-radius'> || <'corner-top-shape'>", + "corner-left-shape": "<'corner-top-left-shape'>{1,2}", + "corner-right": "<'border-top-radius'> || <'corner-top-shape'>", + "corner-right-shape": "<'corner-top-left-shape'>{1,2}", + "corner-shape": "<'corner-top-left-shape'>{1,4}", + "corner-start-end": "<'border-top-left-radius'> || <'corner-top-left-shape'>", + "corner-start-start": "<'border-top-left-radius'> || <'corner-top-left-shape'>", + "corner-top": "<'border-top-radius'> || <'corner-top-shape'>", + "corner-top-left": "<'border-top-left-radius'> || <'corner-top-left-shape'>", + "corner-top-right": "<'border-top-left-radius'> || <'corner-top-left-shape'>", + "corner-top-shape": "<'corner-top-left-shape'>{1,2}", + "cursor": "[ , ]* ", + "cx": "", + "cy": "", + "display": "[ || ] | | | | | <-non-standard-display> | grid-lanes | inline-grid-lanes | || [ | math ]", + "dominant-baseline": "use-script | no-change | reset-size | text-after-edge | text-before-edge | auto | ", + "event-trigger": "none | [ <'event-trigger-name'> <'event-trigger-source'> ]#", + "event-trigger-name": "none | #", + "event-trigger-source": "[ none | + [ / + ]? ]#", + "fill-break": "bounding-box | slice | clone", + "fill-color": "", + "fill-image": "#", + "fill-opacity": "<'opacity'>", + "fill-origin": "match-parent | fill-box | stroke-box | content-box | padding-box | border-box", + "fill-position": "#", + "fill-repeat": "#", + "fill-size": "#", + "filter": "none | ", + "flex-grow": "", + "flex-line-count": "", + "flex-shrink": "", + "flex-wrap": "nowrap | [ wrap | wrap-reverse ] || balance", + "float": "| block-start | block-end | snap-block | snap-block( , [ start | end | near ]? ) | snap-inline | snap-inline( , [ left | right | near ]? ) | top | bottom | footnote", + "float-defer": " | last | none", + "float-offset": "", + "float-reference": "inline | column | region | page", + "flow-from": " | none", + "flow-into": "none | [ element | content ]?", + "flow-tolerance": "normal | | infinite", + "font": "[ [ <'font-style'> || || <'font-weight'> || ]? <'font-size'> [ / <'line-height'> ]? <'font-family'># ] | | <-non-standard-font>", + "font-family": "[ | ]#", + "font-size-adjust": "none | [ ex-height | cap-height | ch-width | ic-width | ic-height ]? [ from-font | ]", + "font-stretch": "normal | | ultra-condensed | extra-condensed | condensed | semi-condensed | semi-expanded | expanded | extra-expanded | ultra-expanded", + "font-style": "normal | italic | left | right | oblique ?", + "font-synthesis-style": "auto | none | oblique-only", + "font-variant": "normal | none | [ [ || || || ] || [ small-caps | all-small-caps | petite-caps | all-petite-caps | unicase | titling-caps ] || [ stylistic( ) || historical-forms || styleset( # ) || character-variant( # ) || swash( ) || ornaments( ) || annotation( ) ] || [ || || || ordinal || slashed-zero ] || [ || || ruby ] || [ sub | super ] || [ text | emoji | unicode ] ]", + "font-variant-alternates": "normal | [ stylistic( ) || historical-forms || styleset( # ) || character-variant( # ) || swash( ) || ornaments( ) || annotation( ) ]", + "font-variation-settings": "normal | [ ]#", + "footnote-display": "block | inline | compact", + "footnote-policy": "auto | line | block", + "frame-sizing": "auto | content-width | content-height | content-block-size | content-inline-size", + "glyph-orientation-vertical": "auto | 0deg | 90deg | 0 | 90", + "grid-column-gap": "normal | | ", + "grid-gap": "<'row-gap'> <'column-gap'>?", + "grid-row-gap": "normal | | ", + "height": "auto | | min-content | max-content | fit-content( ) | | | stretch | fit-content | contain | <-non-standard-size>", + "hyphenate-limit-last": "none | always | column | page | spread", + "hyphenate-limit-lines": "no-limit | ", + "hyphenate-limit-zone": "", + "image-animation": "normal | paused | stopped | running", + "image-orientation": "from-image | none | [ || flip ]", + "image-rendering": "auto | smooth | high-quality | pixelated | crisp-edges | <-non-standard-image-rendering>", + "initial-letter": "normal | | && [ drop | raise ]?", + "initial-letter-align": "[ border-box? [ alphabetic | ideographic | hanging | leading ]? ]!", + "initial-letter-wrap": "none | first | all | grid | ", + "inline-sizing": "normal | stretch", + "input-security": "auto | none", + "isolation": "", + "justify-self": "auto | ? [ normal | | left | right ] | stretch | | anchor-center", + "line-clamp": "none | [ || <'block-ellipsis'> ] -webkit-legacy?", + "line-fit-edge": "leading | ", + "line-grid": "match-parent | create", + "line-height": "normal | | ", + "line-height-step": "", + "line-padding": "", + "line-snap": "none | baseline | contain", + "link-parameters": "none | #", + "list-style": "<'list-style-position'> || <'list-style-image'> || <'list-style-type'>", + "margin-break": "auto | keep | discard", + "margin-trim": "none | [ block || inline ] | [ block-start || inline-start || block-end || inline-end ]", + "marker": "none | ", + "marker-end": "none | ", + "marker-mid": "none | ", + "marker-side": "match-self | match-parent", + "marker-start": "none | ", + "mask-border-outset": "<'border-image-outset'>", + "mask-border-repeat": "<'border-image-repeat'>", + "mask-border-slice": "<'border-image-slice'>", + "mask-border-source": "<'border-image-source'>", + "mask-border-width": "<'border-image-width'>", + "max-height": "none | | min-content | max-content | fit-content( ) | | | stretch | fit-content | contain | <-non-standard-size>", + "max-lines": "none | ", + "max-width": "none | | min-content | max-content | fit-content( ) | | | stretch | fit-content | contain | <-non-standard-size>", + "min-height": "auto | | min-content | max-content | fit-content( ) | | | stretch | fit-content | contain | <-non-standard-size>", + "min-intrinsic-sizing": "legacy | zero-if-scroll || zero-if-extrinsic", + "min-width": "auto | | min-content | max-content | fit-content( ) | | | stretch | fit-content | contain | <-non-standard-size>", + "mix-blend-mode": " | plus-lighter", + "object-fit": "fill | none | [ contain | cover ] || scale-down", + "orphans": "", + "outline-color": "auto | <'border-top-color'>", + "overflow": "<'overflow-block'>{1,2} | <-non-standard-overflow>", + "overflow-block": "| <-non-standard-overflow>", + "overflow-clip-margin": " || ", + "overflow-clip-margin-block": " || ", + "overflow-clip-margin-block-end": " || ", + "overflow-clip-margin-block-start": " || ", + "overflow-clip-margin-bottom": " || ", + "overflow-clip-margin-inline": " || ", + "overflow-clip-margin-inline-end": " || ", + "overflow-clip-margin-inline-start": " || ", + "overflow-clip-margin-left": " || ", + "overflow-clip-margin-right": " || ", + "overflow-clip-margin-top": " || ", + "overflow-inline": "| <-non-standard-overflow>", + "overflow-x": "| <-non-standard-overflow>", + "overflow-y": "| <-non-standard-overflow>", + "overscroll-behavior": "[ contain | none | auto | chain ]{1,2}", + "overscroll-behavior-block": "contain | none | auto | chain", + "overscroll-behavior-inline": "contain | none | auto | chain", + "overscroll-behavior-x": "contain | none | auto | chain", + "overscroll-behavior-y": "contain | none | auto | chain", + "path-length": "none | @ @ unknown symbol \" number [ 0 , ∞ ] \"", + "pause-after": "