summaryrefslogtreecommitdiff
path: root/node_modules/@csstools
diff options
context:
space:
mode:
authorlittleblack111 <littleblack11111@gmail.com>2024-05-14 14:05:49 +0800
committerlittleblack111 <littleblack11111@gmail.com>2024-05-14 14:05:49 +0800
commit06823fbf1c2e763a5bf76c3990ca98fbbcd98691 (patch)
tree4280bece3888d12a022093bf1a9cd1b049393602 /node_modules/@csstools
parent1368909b3cd552dbb0d12d5863c597f5be46177d (diff)
updated node_modules
Diffstat (limited to 'node_modules/@csstools')
-rw-r--r--node_modules/@csstools/cascade-layer-name-parser/CHANGELOG.md25
-rw-r--r--node_modules/@csstools/cascade-layer-name-parser/dist/index.cjs2
-rw-r--r--node_modules/@csstools/cascade-layer-name-parser/dist/index.d.ts15
-rw-r--r--node_modules/@csstools/cascade-layer-name-parser/dist/index.mjs2
-rw-r--r--node_modules/@csstools/cascade-layer-name-parser/package.json8
-rw-r--r--node_modules/@csstools/color-helpers/CHANGELOG.md22
-rw-r--r--node_modules/@csstools/color-helpers/dist/index.cjs50
-rw-r--r--node_modules/@csstools/color-helpers/dist/index.d.ts10
-rw-r--r--node_modules/@csstools/color-helpers/dist/index.mjs50
-rw-r--r--node_modules/@csstools/color-helpers/package.json4
-rw-r--r--node_modules/@csstools/css-calc/CHANGELOG.md30
-rw-r--r--node_modules/@csstools/css-calc/dist/index.cjs2
-rw-r--r--node_modules/@csstools/css-calc/dist/index.d.ts6
-rw-r--r--node_modules/@csstools/css-calc/dist/index.mjs2
-rw-r--r--node_modules/@csstools/css-calc/package.json8
-rw-r--r--node_modules/@csstools/css-color-parser/CHANGELOG.md34
-rw-r--r--node_modules/@csstools/css-color-parser/dist/index.cjs2
-rw-r--r--node_modules/@csstools/css-color-parser/dist/index.d.ts33
-rw-r--r--node_modules/@csstools/css-color-parser/dist/index.mjs2
-rw-r--r--node_modules/@csstools/css-color-parser/package.json12
-rw-r--r--node_modules/@csstools/css-parser-algorithms/CHANGELOG.md24
-rw-r--r--node_modules/@csstools/css-parser-algorithms/README.md2
-rw-r--r--node_modules/@csstools/css-parser-algorithms/dist/index.cjs2
-rw-r--r--node_modules/@csstools/css-parser-algorithms/dist/index.d.ts43
-rw-r--r--node_modules/@csstools/css-parser-algorithms/dist/index.mjs2
-rw-r--r--node_modules/@csstools/css-parser-algorithms/package.json6
-rw-r--r--node_modules/@csstools/css-tokenizer/CHANGELOG.md19
-rw-r--r--node_modules/@csstools/css-tokenizer/dist/index.cjs2
-rw-r--r--node_modules/@csstools/css-tokenizer/dist/index.d.ts75
-rw-r--r--node_modules/@csstools/css-tokenizer/dist/index.mjs2
-rw-r--r--node_modules/@csstools/css-tokenizer/package.json4
-rw-r--r--node_modules/@csstools/media-query-list-parser/CHANGELOG.md27
-rw-r--r--node_modules/@csstools/media-query-list-parser/dist/index.cjs2
-rw-r--r--node_modules/@csstools/media-query-list-parser/dist/index.d.ts191
-rw-r--r--node_modules/@csstools/media-query-list-parser/dist/index.mjs2
-rw-r--r--node_modules/@csstools/media-query-list-parser/package.json8
-rw-r--r--node_modules/@csstools/postcss-cascade-layers/CHANGELOG.md20
-rw-r--r--node_modules/@csstools/postcss-cascade-layers/README.md2
-rw-r--r--node_modules/@csstools/postcss-cascade-layers/dist/index.cjs2
-rw-r--r--node_modules/@csstools/postcss-cascade-layers/dist/index.mjs2
-rw-r--r--node_modules/@csstools/postcss-cascade-layers/package.json6
-rw-r--r--node_modules/@csstools/postcss-color-function/CHANGELOG.md29
-rw-r--r--node_modules/@csstools/postcss-color-function/README.md2
-rw-r--r--node_modules/@csstools/postcss-color-function/dist/index.cjs2
-rw-r--r--node_modules/@csstools/postcss-color-function/dist/index.mjs2
-rw-r--r--node_modules/@csstools/postcss-color-function/package.json13
-rw-r--r--node_modules/@csstools/postcss-color-mix-function/CHANGELOG.md29
-rw-r--r--node_modules/@csstools/postcss-color-mix-function/dist/index.cjs2
-rw-r--r--node_modules/@csstools/postcss-color-mix-function/dist/index.mjs2
-rw-r--r--node_modules/@csstools/postcss-color-mix-function/package.json13
-rw-r--r--node_modules/@csstools/postcss-exponential-functions/CHANGELOG.md31
-rw-r--r--node_modules/@csstools/postcss-exponential-functions/package.json10
-rw-r--r--node_modules/@csstools/postcss-font-format-keywords/CHANGELOG.md12
-rw-r--r--node_modules/@csstools/postcss-font-format-keywords/README.md4
-rw-r--r--node_modules/@csstools/postcss-font-format-keywords/dist/index.cjs2
-rw-r--r--node_modules/@csstools/postcss-font-format-keywords/dist/index.mjs2
-rw-r--r--node_modules/@csstools/postcss-font-format-keywords/package.json3
-rw-r--r--node_modules/@csstools/postcss-gamut-mapping/CHANGELOG.md30
-rw-r--r--node_modules/@csstools/postcss-gamut-mapping/README.md4
-rw-r--r--node_modules/@csstools/postcss-gamut-mapping/dist/index.cjs2
-rw-r--r--node_modules/@csstools/postcss-gamut-mapping/dist/index.mjs2
-rw-r--r--node_modules/@csstools/postcss-gamut-mapping/package.json10
-rw-r--r--node_modules/@csstools/postcss-gradients-interpolation-method/CHANGELOG.md29
-rw-r--r--node_modules/@csstools/postcss-gradients-interpolation-method/dist/index.cjs2
-rw-r--r--node_modules/@csstools/postcss-gradients-interpolation-method/dist/index.mjs2
-rw-r--r--node_modules/@csstools/postcss-gradients-interpolation-method/package.json13
-rw-r--r--node_modules/@csstools/postcss-hwb-function/CHANGELOG.md27
-rw-r--r--node_modules/@csstools/postcss-hwb-function/INSTALL.md235
-rw-r--r--node_modules/@csstools/postcss-hwb-function/README.md54
-rw-r--r--node_modules/@csstools/postcss-hwb-function/dist/index.cjs2
-rw-r--r--node_modules/@csstools/postcss-hwb-function/dist/index.d.ts8
-rw-r--r--node_modules/@csstools/postcss-hwb-function/dist/index.mjs2
-rw-r--r--node_modules/@csstools/postcss-hwb-function/package.json32
-rw-r--r--node_modules/@csstools/postcss-ic-unit/CHANGELOG.md21
-rw-r--r--node_modules/@csstools/postcss-ic-unit/README.md4
-rw-r--r--node_modules/@csstools/postcss-ic-unit/dist/index.cjs2
-rw-r--r--node_modules/@csstools/postcss-ic-unit/dist/index.mjs2
-rw-r--r--node_modules/@csstools/postcss-ic-unit/package.json7
-rw-r--r--node_modules/@csstools/postcss-is-pseudo-class/CHANGELOG.md19
-rw-r--r--node_modules/@csstools/postcss-is-pseudo-class/README.md4
-rw-r--r--node_modules/@csstools/postcss-is-pseudo-class/dist/index.cjs2
-rw-r--r--node_modules/@csstools/postcss-is-pseudo-class/dist/index.mjs2
-rw-r--r--node_modules/@csstools/postcss-is-pseudo-class/package.json6
-rw-r--r--node_modules/@csstools/postcss-logical-viewport-units/CHANGELOG.md19
-rw-r--r--node_modules/@csstools/postcss-logical-viewport-units/dist/index.cjs2
-rw-r--r--node_modules/@csstools/postcss-logical-viewport-units/dist/index.mjs2
-rw-r--r--node_modules/@csstools/postcss-logical-viewport-units/package.json7
-rw-r--r--node_modules/@csstools/postcss-media-minmax/CHANGELOG.md38
-rw-r--r--node_modules/@csstools/postcss-media-minmax/dist/index.cjs2
-rw-r--r--node_modules/@csstools/postcss-media-minmax/dist/index.mjs2
-rw-r--r--node_modules/@csstools/postcss-media-minmax/package.json12
-rw-r--r--node_modules/@csstools/postcss-media-queries-aspect-ratio-number-values/CHANGELOG.md31
-rw-r--r--node_modules/@csstools/postcss-media-queries-aspect-ratio-number-values/dist/index.cjs2
-rw-r--r--node_modules/@csstools/postcss-media-queries-aspect-ratio-number-values/dist/index.mjs2
-rw-r--r--node_modules/@csstools/postcss-media-queries-aspect-ratio-number-values/package.json10
-rw-r--r--node_modules/@csstools/postcss-nested-calc/CHANGELOG.md12
-rw-r--r--node_modules/@csstools/postcss-nested-calc/README.md2
-rw-r--r--node_modules/@csstools/postcss-nested-calc/dist/index.cjs2
-rw-r--r--node_modules/@csstools/postcss-nested-calc/dist/index.mjs2
-rw-r--r--node_modules/@csstools/postcss-nested-calc/package.json3
-rw-r--r--node_modules/@csstools/postcss-oklab-function/CHANGELOG.md29
-rw-r--r--node_modules/@csstools/postcss-oklab-function/dist/index.cjs2
-rw-r--r--node_modules/@csstools/postcss-oklab-function/dist/index.mjs2
-rw-r--r--node_modules/@csstools/postcss-oklab-function/package.json13
-rw-r--r--node_modules/@csstools/postcss-progressive-custom-properties/CHANGELOG.md21
-rw-r--r--node_modules/@csstools/postcss-progressive-custom-properties/dist/index.cjs2
-rw-r--r--node_modules/@csstools/postcss-progressive-custom-properties/dist/index.mjs2
-rw-r--r--node_modules/@csstools/postcss-progressive-custom-properties/package.json4
-rw-r--r--node_modules/@csstools/postcss-relative-color-syntax/CHANGELOG.md29
-rw-r--r--node_modules/@csstools/postcss-relative-color-syntax/dist/index.cjs2
-rw-r--r--node_modules/@csstools/postcss-relative-color-syntax/dist/index.mjs2
-rw-r--r--node_modules/@csstools/postcss-relative-color-syntax/package.json13
-rw-r--r--node_modules/@csstools/postcss-stepped-value-functions/CHANGELOG.md31
-rw-r--r--node_modules/@csstools/postcss-stepped-value-functions/package.json10
-rw-r--r--node_modules/@csstools/postcss-text-decoration-shorthand/CHANGELOG.md20
-rw-r--r--node_modules/@csstools/postcss-text-decoration-shorthand/README.md2
-rw-r--r--node_modules/@csstools/postcss-text-decoration-shorthand/dist/index.cjs2
-rw-r--r--node_modules/@csstools/postcss-text-decoration-shorthand/dist/index.mjs2
-rw-r--r--node_modules/@csstools/postcss-text-decoration-shorthand/package.json6
-rw-r--r--node_modules/@csstools/postcss-trigonometric-functions/CHANGELOG.md31
-rw-r--r--node_modules/@csstools/postcss-trigonometric-functions/package.json10
-rw-r--r--node_modules/@csstools/selector-specificity/CHANGELOG.md27
-rw-r--r--node_modules/@csstools/selector-specificity/dist/index.cjs2
-rw-r--r--node_modules/@csstools/selector-specificity/dist/index.d.ts47
-rw-r--r--node_modules/@csstools/selector-specificity/dist/index.mjs2
-rw-r--r--node_modules/@csstools/selector-specificity/package.json4
126 files changed, 849 insertions, 1061 deletions
diff --git a/node_modules/@csstools/cascade-layer-name-parser/CHANGELOG.md b/node_modules/@csstools/cascade-layer-name-parser/CHANGELOG.md
index 0399fe70..7364ef6b 100644
--- a/node_modules/@csstools/cascade-layer-name-parser/CHANGELOG.md
+++ b/node_modules/@csstools/cascade-layer-name-parser/CHANGELOG.md
@@ -1,25 +1,24 @@
# Changes to Cascade Layer Name Parser
-### 1.0.7
+### 1.0.11
-_December 31, 2023_
+_May 4, 2024_
-- Updated [`@csstools/css-tokenizer`](https://github.com/csstools/postcss-plugins/tree/main/packages/css-tokenizer) to [`2.2.3`](https://github.com/csstools/postcss-plugins/tree/main/packages/css-tokenizer/CHANGELOG.md#223) (patch)
-- Updated [`@csstools/css-parser-algorithms`](https://github.com/csstools/postcss-plugins/tree/main/packages/css-parser-algorithms) to [`2.5.0`](https://github.com/csstools/postcss-plugins/tree/main/packages/css-parser-algorithms/CHANGELOG.md#250) (minor)
+- Updated [`@csstools/css-tokenizer`](https://github.com/csstools/postcss-plugins/tree/main/packages/css-tokenizer) to [`2.3.1`](https://github.com/csstools/postcss-plugins/tree/main/packages/css-tokenizer/CHANGELOG.md#231) (patch)
+- Updated [`@csstools/css-parser-algorithms`](https://github.com/csstools/postcss-plugins/tree/main/packages/css-parser-algorithms) to [`2.6.3`](https://github.com/csstools/postcss-plugins/tree/main/packages/css-parser-algorithms/CHANGELOG.md#263) (patch)
-### 1.0.6
+### 1.0.10
-_December 15, 2023_
+_May 4, 2024_
-- Fix type definitions
-- Updated [`@csstools/css-tokenizer`](https://github.com/csstools/postcss-plugins/tree/main/packages/css-tokenizer) to [`2.2.2`](https://github.com/csstools/postcss-plugins/tree/main/packages/css-tokenizer/CHANGELOG.md#222) (patch)
-- Updated [`@csstools/css-parser-algorithms`](https://github.com/csstools/postcss-plugins/tree/main/packages/css-parser-algorithms) to [`2.4.0`](https://github.com/csstools/postcss-plugins/tree/main/packages/css-parser-algorithms/CHANGELOG.md#240) (minor)
+- Updated [`@csstools/css-tokenizer`](https://github.com/csstools/postcss-plugins/tree/main/packages/css-tokenizer) to [`2.3.0`](https://github.com/csstools/postcss-plugins/tree/main/packages/css-tokenizer/CHANGELOG.md#230) (minor)
+- Updated [`@csstools/css-parser-algorithms`](https://github.com/csstools/postcss-plugins/tree/main/packages/css-parser-algorithms) to [`2.6.2`](https://github.com/csstools/postcss-plugins/tree/main/packages/css-parser-algorithms/CHANGELOG.md#262) (patch)
-### 1.0.5
+### 1.0.9
-_September 24, 2023_
+_March 13, 2024_
-- Updated [`@csstools/css-tokenizer`](https://github.com/csstools/postcss-plugins/tree/main/packages/css-tokenizer) to [`2.2.1`](https://github.com/csstools/postcss-plugins/tree/main/packages/css-tokenizer/CHANGELOG.md#221) (patch)
-- Updated [`@csstools/css-parser-algorithms`](https://github.com/csstools/postcss-plugins/tree/main/packages/css-parser-algorithms) to [`2.3.2`](https://github.com/csstools/postcss-plugins/tree/main/packages/css-parser-algorithms/CHANGELOG.md#232) (patch)
+- Updated [`@csstools/css-tokenizer`](https://github.com/csstools/postcss-plugins/tree/main/packages/css-tokenizer) to [`2.2.4`](https://github.com/csstools/postcss-plugins/tree/main/packages/css-tokenizer/CHANGELOG.md#224) (patch)
+- Updated [`@csstools/css-parser-algorithms`](https://github.com/csstools/postcss-plugins/tree/main/packages/css-parser-algorithms) to [`2.6.1`](https://github.com/csstools/postcss-plugins/tree/main/packages/css-parser-algorithms/CHANGELOG.md#261) (patch)
[Full CHANGELOG](https://github.com/csstools/postcss-plugins/tree/main/packages/cascade-layer-name-parser/CHANGELOG.md)
diff --git a/node_modules/@csstools/cascade-layer-name-parser/dist/index.cjs b/node_modules/@csstools/cascade-layer-name-parser/dist/index.cjs
index 6d8efe7f..d22aa23e 100644
--- a/node_modules/@csstools/cascade-layer-name-parser/dist/index.cjs
+++ b/node_modules/@csstools/cascade-layer-name-parser/dist/index.cjs
@@ -1 +1 @@
-"use strict";var e=require("@csstools/css-tokenizer"),n=require("@csstools/css-parser-algorithms");class LayerName{parts;constructor(e){this.parts=e}tokens(){return[...this.parts]}slice(n,r){const t=[];for(let n=0;n<this.parts.length;n++)this.parts[n][0]===e.TokenType.Ident&&t.push(n);const a=t.slice(n,r);return new LayerName(this.parts.slice(a[0],a[a.length-1]+1))}concat(n){const r=[e.TokenType.Delim,".",-1,-1,{value:"."}];return new LayerName([...this.parts.filter((n=>n[0]===e.TokenType.Ident||n[0]===e.TokenType.Delim)),r,...n.parts.filter((n=>n[0]===e.TokenType.Ident||n[0]===e.TokenType.Delim))])}segments(){return this.parts.filter((n=>n[0]===e.TokenType.Ident)).map((e=>e[4].value))}name(){return this.parts.filter((n=>n[0]===e.TokenType.Ident||n[0]===e.TokenType.Delim)).map((e=>e[1])).join("")}equal(e){const n=this.segments(),r=e.segments();if(n.length!==r.length)return!1;for(let e=0;e<n.length;e++){if(n[e]!==r[e])return!1}return!0}toString(){return e.stringify(...this.parts)}toJSON(){return{parts:this.parts,segments:this.segments(),name:this.name()}}}function parseFromTokens(r,t){const a=n.parseCommaSeparatedListOfComponentValues(r,{onParseError:t?.onParseError}),s=t?.onParseError??(()=>{}),o=["6.4.2. Layer Naming and Nesting","Layer name syntax","<layer-name> = <ident> [ '.' <ident> ]*"],i=r[0][2],l=r[r.length-1][3],p=[];for(let r=0;r<a.length;r++){const t=a[r];for(let r=0;r<t.length;r++){const a=t[r];if(!n.isTokenNode(a)&&!n.isCommentNode(a)&&!n.isWhitespaceNode(a))return s(new e.ParseError(`Invalid cascade layer name. Invalid layer name part "${a.toString()}"`,i,l,o)),[]}const m=t.flatMap((e=>e.tokens()));let c=!1,T=!1,y=null;for(let n=0;n<m.length;n++){const r=m[n];if(r[0]!==e.TokenType.Comment&&r[0]!==e.TokenType.Whitespace&&r[0]!==e.TokenType.Ident&&(r[0]!==e.TokenType.Delim||"."!==r[4].value))return s(new e.ParseError(`Invalid cascade layer name. Invalid character "${r[1]}"`,i,l,o)),[];if(!c&&r[0]===e.TokenType.Delim)return s(new e.ParseError("Invalid cascade layer name. Layer names can not start with a dot.",i,l,o)),[];if(c){if(r[0]===e.TokenType.Whitespace){T=!0;continue}if(T&&r[0]===e.TokenType.Comment)continue;if(T)return s(new e.ParseError("Invalid cascade layer name. Encountered unexpected whitespace between layer name parts.",i,l,o)),[];if(y&&y[0]===e.TokenType.Ident&&r[0]===e.TokenType.Ident)return s(new e.ParseError("Invalid cascade layer name. Layer name parts must be separated by dots.",i,l,o)),[];if(y&&y[0]===e.TokenType.Delim&&r[0]===e.TokenType.Delim)return s(new e.ParseError("Invalid cascade layer name. Layer name parts must not be empty.",i,l,o)),[]}r[0]===e.TokenType.Ident&&(c=!0),r[0]!==e.TokenType.Ident&&r[0]!==e.TokenType.Delim||(y=r)}if(!y)return s(new e.ParseError("Invalid cascade layer name. Empty layer name.",i,l,o)),[];if(y[0]===e.TokenType.Delim)return s(new e.ParseError("Invalid cascade layer name. Layer name must not end with a dot.",i,l,o)),[];p.push(new LayerName(m))}return p}exports.LayerName=LayerName,exports.addLayerToModel=function addLayerToModel(e,n){return n.forEach((n=>{const r=n.segments();e:for(let t=0;t<r.length;t++){const r=n.slice(0,t+1),a=r.segments();let s=-1,o=0;for(let n=0;n<e.length;n++){const r=e[n].segments();let t=0;n:for(let e=0;e<r.length;e++){const n=r[e],s=a[e];if(s===n&&e+1===a.length)continue e;if(s!==n){if(s!==n)break n}else t++}t>=o&&(s=n,o=t)}-1===s?e.push(r):e.splice(s+1,0,r)}})),e},exports.parse=function parse(n,r){const t=e.tokenizer({css:n},{onParseError:r?.onParseError}),a=[];for(;!t.endOfFile();)a.push(t.nextToken());return a.push(t.nextToken()),parseFromTokens(a,r)},exports.parseFromTokens=parseFromTokens;
+"use strict";var e=require("@csstools/css-tokenizer"),r=require("@csstools/css-parser-algorithms");class LayerName{parts;constructor(e){this.parts=e}tokens(){return[...this.parts]}slice(r,n){const t=[];for(let r=0;r<this.parts.length;r++)e.isTokenIdent(this.parts[r])&&t.push(r);const s=t.slice(r,n);return new LayerName(this.parts.slice(s[0],s[s.length-1]+1))}concat(r){const n=[e.TokenType.Delim,".",-1,-1,{value:"."}];return new LayerName([...this.parts.filter((r=>e.isTokenIdent(r)||e.isTokenDelim(r))),n,...r.parts.filter((r=>e.isTokenIdent(r)||e.isTokenDelim(r)))])}segments(){return this.parts.filter((r=>e.isTokenIdent(r))).map((e=>e[4].value))}name(){return this.parts.filter((r=>e.isTokenIdent(r)||e.isTokenDelim(r))).map((e=>e[1])).join("")}equal(e){const r=this.segments(),n=e.segments();if(r.length!==n.length)return!1;for(let e=0;e<r.length;e++){if(r[e]!==n[e])return!1}return!0}toString(){return e.stringify(...this.parts)}toJSON(){return{parts:this.parts,segments:this.segments(),name:this.name()}}}function parseFromTokens(n,t){const s=r.parseCommaSeparatedListOfComponentValues(n,{onParseError:t?.onParseError}),a=t?.onParseError??(()=>{}),o=["6.4.2. Layer Naming and Nesting","Layer name syntax","<layer-name> = <ident> [ '.' <ident> ]*"],i=n[0][2],l=n[n.length-1][3],m=[];for(let n=0;n<s.length;n++){const t=s[n];for(let n=0;n<t.length;n++){const s=t[n];if(!r.isTokenNode(s)&&!r.isCommentNode(s)&&!r.isWhitespaceNode(s))return a(new e.ParseError(`Invalid cascade layer name. Invalid layer name part "${s.toString()}"`,i,l,o)),[]}const c=t.flatMap((e=>e.tokens()));let d=!1,p=!1,u=null;for(let r=0;r<c.length;r++){const n=c[r];if(!(e.isTokenWhiteSpaceOrComment(n)||e.isTokenIdent(n)||e.isTokenDelim(n)&&"."===n[4].value))return a(new e.ParseError(`Invalid cascade layer name. Invalid character "${n[1]}"`,i,l,o)),[];if(!d&&e.isTokenDelim(n))return a(new e.ParseError("Invalid cascade layer name. Layer names can not start with a dot.",i,l,o)),[];if(d){if(e.isTokenWhitespace(n)){p=!0;continue}if(p&&e.isTokenComment(n))continue;if(p)return a(new e.ParseError("Invalid cascade layer name. Encountered unexpected whitespace between layer name parts.",i,l,o)),[];if(e.isTokenIdent(u)&&e.isTokenIdent(n))return a(new e.ParseError("Invalid cascade layer name. Layer name parts must be separated by dots.",i,l,o)),[];if(e.isTokenDelim(u)&&e.isTokenDelim(n))return a(new e.ParseError("Invalid cascade layer name. Layer name parts must not be empty.",i,l,o)),[]}e.isTokenIdent(n)&&(d=!0),(e.isTokenIdent(n)||e.isTokenDelim(n))&&(u=n)}if(!u)return a(new e.ParseError("Invalid cascade layer name. Empty layer name.",i,l,o)),[];if(e.isTokenDelim(u))return a(new e.ParseError("Invalid cascade layer name. Layer name must not end with a dot.",i,l,o)),[];m.push(new LayerName(c))}return m}exports.LayerName=LayerName,exports.addLayerToModel=function addLayerToModel(e,r){r.forEach((r=>{const n=r.segments();e:for(let t=0;t<n.length;t++){const n=r.slice(0,t+1),s=n.segments();let a=-1,o=0;for(let r=0;r<e.length;r++){const n=e[r].segments();let t=0;r:for(let e=0;e<n.length;e++){const r=n[e],a=s[e];if(a===r&&e+1===s.length)continue e;if(a!==r){if(a!==r)break r}else t++}t>=o&&(a=r,o=t)}-1===a?e.push(n):e.splice(a+1,0,n)}}))},exports.parse=function parse(r,n){const t=e.tokenizer({css:r},{onParseError:n?.onParseError}),s=[];for(;!t.endOfFile();)s.push(t.nextToken());return s.push(t.nextToken()),parseFromTokens(s,n)},exports.parseFromTokens=parseFromTokens;
diff --git a/node_modules/@csstools/cascade-layer-name-parser/dist/index.d.ts b/node_modules/@csstools/cascade-layer-name-parser/dist/index.d.ts
index 5865e6c8..df9eef3f 100644
--- a/node_modules/@csstools/cascade-layer-name-parser/dist/index.d.ts
+++ b/node_modules/@csstools/cascade-layer-name-parser/dist/index.d.ts
@@ -1,7 +1,7 @@
import { CSSToken } from '@csstools/css-tokenizer';
import { ParseError } from '@csstools/css-tokenizer';
-export declare function addLayerToModel(layers: Array<LayerName>, currentLayerNames: Array<LayerName>): LayerName[];
+export declare function addLayerToModel(layers: Array<LayerName>, currentLayerNames: Array<LayerName>): void;
export declare class LayerName {
parts: Array<CSSToken>;
@@ -13,16 +13,17 @@ export declare class LayerName {
name(): string;
equal(other: LayerName): boolean;
toString(): string;
- toJSON(): {
- parts: CSSToken[];
- segments: string[];
- name: string;
- };
+ /**
+ * @internal
+ *
+ * A debug helper to convert the current object to a JSON representation.
+ */
+ toJSON(): Record<string, unknown>;
}
export declare function parse(source: string, options?: {
onParseError?: (error: ParseError) => void;
-}): LayerName[];
+}): Array<LayerName>;
/**
* Parses an array of {@link https://github.com/csstools/postcss-plugins/tree/main/packages/css-tokenizer/docs/css-tokenizer.csstoken.md | CSSTokens} into a list of cascade layer names.
diff --git a/node_modules/@csstools/cascade-layer-name-parser/dist/index.mjs b/node_modules/@csstools/cascade-layer-name-parser/dist/index.mjs
index dffec78f..2b03390e 100644
--- a/node_modules/@csstools/cascade-layer-name-parser/dist/index.mjs
+++ b/node_modules/@csstools/cascade-layer-name-parser/dist/index.mjs
@@ -1 +1 @@
-import{TokenType as e,stringify as t,ParseError as n,tokenizer as r}from"@csstools/css-tokenizer";import{parseCommaSeparatedListOfComponentValues as a,isTokenNode as s,isCommentNode as i,isWhitespaceNode as o}from"@csstools/css-parser-algorithms";class LayerName{parts;constructor(e){this.parts=e}tokens(){return[...this.parts]}slice(t,n){const r=[];for(let t=0;t<this.parts.length;t++)this.parts[t][0]===e.Ident&&r.push(t);const a=r.slice(t,n);return new LayerName(this.parts.slice(a[0],a[a.length-1]+1))}concat(t){const n=[e.Delim,".",-1,-1,{value:"."}];return new LayerName([...this.parts.filter((t=>t[0]===e.Ident||t[0]===e.Delim)),n,...t.parts.filter((t=>t[0]===e.Ident||t[0]===e.Delim))])}segments(){return this.parts.filter((t=>t[0]===e.Ident)).map((e=>e[4].value))}name(){return this.parts.filter((t=>t[0]===e.Ident||t[0]===e.Delim)).map((e=>e[1])).join("")}equal(e){const t=this.segments(),n=e.segments();if(t.length!==n.length)return!1;for(let e=0;e<t.length;e++){if(t[e]!==n[e])return!1}return!0}toString(){return t(...this.parts)}toJSON(){return{parts:this.parts,segments:this.segments(),name:this.name()}}}function addLayerToModel(e,t){return t.forEach((t=>{const n=t.segments();e:for(let r=0;r<n.length;r++){const n=t.slice(0,r+1),a=n.segments();let s=-1,i=0;for(let t=0;t<e.length;t++){const n=e[t].segments();let r=0;t:for(let e=0;e<n.length;e++){const t=n[e],s=a[e];if(s===t&&e+1===a.length)continue e;if(s!==t){if(s!==t)break t}else r++}r>=i&&(s=t,i=r)}-1===s?e.push(n):e.splice(s+1,0,n)}})),e}function parseFromTokens(t,r){const l=a(t,{onParseError:r?.onParseError}),m=r?.onParseError??(()=>{}),c=["6.4.2. Layer Naming and Nesting","Layer name syntax","<layer-name> = <ident> [ '.' <ident> ]*"],d=t[0][2],u=t[t.length-1][3],p=[];for(let t=0;t<l.length;t++){const r=l[t];for(let e=0;e<r.length;e++){const t=r[e];if(!s(t)&&!i(t)&&!o(t))return m(new n(`Invalid cascade layer name. Invalid layer name part "${t.toString()}"`,d,u,c)),[]}const a=r.flatMap((e=>e.tokens()));let h=!1,f=!1,y=null;for(let t=0;t<a.length;t++){const r=a[t];if(r[0]!==e.Comment&&r[0]!==e.Whitespace&&r[0]!==e.Ident&&(r[0]!==e.Delim||"."!==r[4].value))return m(new n(`Invalid cascade layer name. Invalid character "${r[1]}"`,d,u,c)),[];if(!h&&r[0]===e.Delim)return m(new n("Invalid cascade layer name. Layer names can not start with a dot.",d,u,c)),[];if(h){if(r[0]===e.Whitespace){f=!0;continue}if(f&&r[0]===e.Comment)continue;if(f)return m(new n("Invalid cascade layer name. Encountered unexpected whitespace between layer name parts.",d,u,c)),[];if(y&&y[0]===e.Ident&&r[0]===e.Ident)return m(new n("Invalid cascade layer name. Layer name parts must be separated by dots.",d,u,c)),[];if(y&&y[0]===e.Delim&&r[0]===e.Delim)return m(new n("Invalid cascade layer name. Layer name parts must not be empty.",d,u,c)),[]}r[0]===e.Ident&&(h=!0),r[0]!==e.Ident&&r[0]!==e.Delim||(y=r)}if(!y)return m(new n("Invalid cascade layer name. Empty layer name.",d,u,c)),[];if(y[0]===e.Delim)return m(new n("Invalid cascade layer name. Layer name must not end with a dot.",d,u,c)),[];p.push(new LayerName(a))}return p}function parse(e,t){const n=r({css:e},{onParseError:t?.onParseError}),a=[];for(;!n.endOfFile();)a.push(n.nextToken());return a.push(n.nextToken()),parseFromTokens(a,t)}export{LayerName,addLayerToModel,parse,parseFromTokens};
+import{isTokenIdent as e,TokenType as t,isTokenDelim as n,stringify as r,ParseError as a,isTokenWhiteSpaceOrComment as s,tokenizer as o,isTokenWhitespace as l,isTokenComment as i}from"@csstools/css-tokenizer";import{parseCommaSeparatedListOfComponentValues as c,isTokenNode as m,isCommentNode as u,isWhitespaceNode as p}from"@csstools/css-parser-algorithms";class LayerName{parts;constructor(e){this.parts=e}tokens(){return[...this.parts]}slice(t,n){const r=[];for(let t=0;t<this.parts.length;t++)e(this.parts[t])&&r.push(t);const a=r.slice(t,n);return new LayerName(this.parts.slice(a[0],a[a.length-1]+1))}concat(r){const a=[t.Delim,".",-1,-1,{value:"."}];return new LayerName([...this.parts.filter((t=>e(t)||n(t))),a,...r.parts.filter((t=>e(t)||n(t)))])}segments(){return this.parts.filter((t=>e(t))).map((e=>e[4].value))}name(){return this.parts.filter((t=>e(t)||n(t))).map((e=>e[1])).join("")}equal(e){const t=this.segments(),n=e.segments();if(t.length!==n.length)return!1;for(let e=0;e<t.length;e++){if(t[e]!==n[e])return!1}return!0}toString(){return r(...this.parts)}toJSON(){return{parts:this.parts,segments:this.segments(),name:this.name()}}}function addLayerToModel(e,t){t.forEach((t=>{const n=t.segments();e:for(let r=0;r<n.length;r++){const n=t.slice(0,r+1),a=n.segments();let s=-1,o=0;for(let t=0;t<e.length;t++){const n=e[t].segments();let r=0;t:for(let e=0;e<n.length;e++){const t=n[e],s=a[e];if(s===t&&e+1===a.length)continue e;if(s!==t){if(s!==t)break t}else r++}r>=o&&(s=t,o=r)}-1===s?e.push(n):e.splice(s+1,0,n)}}))}function parseFromTokens(t,r){const o=c(t,{onParseError:r?.onParseError}),f=r?.onParseError??(()=>{}),h=["6.4.2. Layer Naming and Nesting","Layer name syntax","<layer-name> = <ident> [ '.' <ident> ]*"],d=t[0][2],y=t[t.length-1][3],g=[];for(let t=0;t<o.length;t++){const r=o[t];for(let e=0;e<r.length;e++){const t=r[e];if(!m(t)&&!u(t)&&!p(t))return f(new a(`Invalid cascade layer name. Invalid layer name part "${t.toString()}"`,d,y,h)),[]}const c=r.flatMap((e=>e.tokens()));let w=!1,v=!1,L=null;for(let t=0;t<c.length;t++){const r=c[t];if(!(s(r)||e(r)||n(r)&&"."===r[4].value))return f(new a(`Invalid cascade layer name. Invalid character "${r[1]}"`,d,y,h)),[];if(!w&&n(r))return f(new a("Invalid cascade layer name. Layer names can not start with a dot.",d,y,h)),[];if(w){if(l(r)){v=!0;continue}if(v&&i(r))continue;if(v)return f(new a("Invalid cascade layer name. Encountered unexpected whitespace between layer name parts.",d,y,h)),[];if(e(L)&&e(r))return f(new a("Invalid cascade layer name. Layer name parts must be separated by dots.",d,y,h)),[];if(n(L)&&n(r))return f(new a("Invalid cascade layer name. Layer name parts must not be empty.",d,y,h)),[]}e(r)&&(w=!0),(e(r)||n(r))&&(L=r)}if(!L)return f(new a("Invalid cascade layer name. Empty layer name.",d,y,h)),[];if(n(L))return f(new a("Invalid cascade layer name. Layer name must not end with a dot.",d,y,h)),[];g.push(new LayerName(c))}return g}function parse(e,t){const n=o({css:e},{onParseError:t?.onParseError}),r=[];for(;!n.endOfFile();)r.push(n.nextToken());return r.push(n.nextToken()),parseFromTokens(r,t)}export{LayerName,addLayerToModel,parse,parseFromTokens};
diff --git a/node_modules/@csstools/cascade-layer-name-parser/package.json b/node_modules/@csstools/cascade-layer-name-parser/package.json
index 8bab037c..f2c2b7be 100644
--- a/node_modules/@csstools/cascade-layer-name-parser/package.json
+++ b/node_modules/@csstools/cascade-layer-name-parser/package.json
@@ -1,7 +1,7 @@
{
"name": "@csstools/cascade-layer-name-parser",
"description": "Parse CSS Cascade Layer names.",
- "version": "1.0.7",
+ "version": "1.0.11",
"contributors": [
{
"name": "Antonio Laguna",
@@ -48,13 +48,13 @@
"dist"
],
"peerDependencies": {
- "@csstools/css-parser-algorithms": "^2.5.0",
- "@csstools/css-tokenizer": "^2.2.3"
+ "@csstools/css-parser-algorithms": "^2.6.3",
+ "@csstools/css-tokenizer": "^2.3.1"
},
"homepage": "https://github.com/csstools/postcss-plugins/tree/main/packages/cascade-layer-name-parser#readme",
"repository": {
"type": "git",
- "url": "https://github.com/csstools/postcss-plugins.git",
+ "url": "git+https://github.com/csstools/postcss-plugins.git",
"directory": "packages/cascade-layer-name-parser"
},
"bugs": "https://github.com/csstools/postcss-plugins/issues",
diff --git a/node_modules/@csstools/color-helpers/CHANGELOG.md b/node_modules/@csstools/color-helpers/CHANGELOG.md
index 6d0272f2..6251a3b4 100644
--- a/node_modules/@csstools/color-helpers/CHANGELOG.md
+++ b/node_modules/@csstools/color-helpers/CHANGELOG.md
@@ -1,23 +1,23 @@
# Changes to Color Helpers
-### 4.0.0
+### 4.2.0
-_December 15, 2023_
+_April 21, 2024_
-- Remove barrel files
-- Fix type definitions
-- Use higher precision color conversion matrices.
+- Add `mapGamutRayTrace` function
-### 3.0.2
+### 4.1.0
-_September 2, 2023_
+_March 31, 2024_
-- Undo the changes from `3.0.1`.
+- Add `contrast_ratio_wcag_2_1` function
-### 3.0.1
+### 4.0.0
-_August 28, 2023_
+_December 15, 2023_
-- Clamp negative saturation in `hsl` to `0`.
+- Remove barrel files
+- Fix type definitions
+- Use higher precision color conversion matrices.
[Full CHANGELOG](https://github.com/csstools/postcss-plugins/tree/main/packages/color-helpers/CHANGELOG.md)
diff --git a/node_modules/@csstools/color-helpers/dist/index.cjs b/node_modules/@csstools/color-helpers/dist/index.cjs
index 41e8ee1d..866bd1df 100644
--- a/node_modules/@csstools/color-helpers/dist/index.cjs
+++ b/node_modules/@csstools/color-helpers/dist/index.cjs
@@ -7,7 +7,7 @@
* @license W3C https://www.w3.org/Consortium/Legal/2015/copyright-software-and-document
* @copyright This software or document includes material copied from or derived from https://github.com/w3c/csswg-drafts/blob/main/css-color-4/multiply-matrices.js. Copyright © 2022 W3C® (MIT, ERCIM, Keio, Beihang).
* @see https://github.com/w3c/csswg-drafts/blob/main/css-color-4/multiply-matrices.js
- */function multiplyMatrices(t,_){const o=t.length;let e,n;e=Array.isArray(t[0])?t:[t],n=Array.isArray(_[0])?_:_.map((t=>[t]));const r=n[0].length,a=n[0].map(((t,_)=>n.map((t=>t[_]))));let i=e.map((t=>a.map((_=>Array.isArray(t)?t.reduce(((t,o,e)=>t+o*(_[e]||0)),0):_.reduce(((_,o)=>_+o*t),0)))));return 1===o&&(i=i[0]),1===r?i.map((t=>t[0])):i}
+ */function multiplyMatrices(t,o){const _=t.length;let e,n;e=Array.isArray(t[0])?t:[t],n=Array.isArray(o[0])?o:o.map((t=>[t]));const r=n[0].length,a=n[0].map(((t,o)=>n.map((t=>t[o]))));let i=e.map((t=>a.map((o=>Array.isArray(t)?t.reduce(((t,_,e)=>t+_*(o[e]||0)),0):o.reduce(((o,_)=>o+_*t),0)))));return 1===_&&(i=i[0]),1===r?i.map((t=>t[0])):i}
/**
* Bradford chromatic adaptation from D65 to D50
* @license W3C https://www.w3.org/Consortium/Legal/2015/copyright-software-and-document
@@ -18,12 +18,12 @@
* @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 RGB components 0..1
+ * @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 _=t[0],o=t[1],e=t[2];function f(t){const n=(t+_/30)%12,r=o*Math.min(e,1-e);return e-r*Math.max(-1,Math.min(n-3,9-n,1))}return _%=360,_<0&&(_+=360),o/=100,e/=100,[f(0),f(8),f(4)]}
+ */function HSL_to_sRGB(t){let o=t[0],_=t[1],e=t[2];function f(t){const n=(t+o/30)%12,r=_*Math.min(e,1-e);return e-r*Math.max(-1,Math.min(n-3,9-n,1))}return o%=360,o<0&&(o+=360),_/=100,e/=100,[f(0),f(8),f(4)]}
/**
* @param {number} hue - Hue as degrees 0..360
* @param {number} white - Whiteness as percentage 0..100
@@ -33,7 +33,7 @@
* @license W3C https://www.w3.org/Consortium/Legal/2015/copyright-software-and-document
* @copyright This software or document includes material copied from or derived from https://github.com/w3c/csswg-drafts/blob/main/css-color-4/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 _=t[0];let o=t[1],e=t[2];if(o/=100,e/=100,o+e>=1){const t=o/(o+e);return[t,t,t]}const n=HSL_to_sRGB([_,100,50]);for(let t=0;t<3;t++)n[t]*=1-o-e,n[t]+=o;return n}
+ */function HWB_to_sRGB(t){const o=t[0];let _=t[1],e=t[2];if(_/=100,e/=100,_+e>=1){const t=_/(_+e);return[t,t,t]}const n=HSL_to_sRGB([o,100,50]);for(let t=0;t<3;t++)n[t]*=1-_-e,n[t]+=_;return 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).
@@ -43,7 +43,7 @@
* @license W3C https://www.w3.org/Consortium/Legal/2015/copyright-software-and-document
* @copyright This software or document includes material copied from or derived from https://github.com/w3c/csswg-drafts/blob/main/css-color-4/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(_){const o=24389/27,e=216/24389,n=[];n[1]=(_[0]+16)/116,n[0]=_[1]/500+n[1],n[2]=n[1]-_[2]/200;return[Math.pow(n[0],3)>e?Math.pow(n[0],3):(116*n[0]-16)/o,_[0]>8?Math.pow((_[0]+16)/116,3):_[0]/o,Math.pow(n[2],3)>e?Math.pow(n[2],3):(116*n[2]-16)/o].map(((_,o)=>_*t[o]))}
+ */function Lab_to_XYZ(o){const _=24389/27,e=216/24389,n=[];n[1]=(o[0]+16)/116,n[0]=o[1]/500+n[1],n[2]=n[1]-o[2]/200;return[Math.pow(n[0],3)>e?Math.pow(n[0],3):(116*n[0]-16)/_,o[0]>8?Math.pow((o[0]+16)/116,3):o[0]/_,Math.pow(n[2],3)>e?Math.pow(n[2],3):(116*n[2]-16)/_].map(((o,_)=>o*t[_]))}
/**
* @license W3C https://www.w3.org/Consortium/Legal/2015/copyright-software-and-document
* @copyright This software or document includes material copied from or derived from https://github.com/w3c/csswg-drafts/blob/main/css-color-4/conversions.js. Copyright © 2022 W3C® (MIT, ERCIM, Keio, Beihang).
@@ -55,7 +55,7 @@
* @license W3C https://www.w3.org/Consortium/Legal/2015/copyright-software-and-document
* @copyright This software or document includes material copied from or derived from https://github.com/w3c/csswg-drafts/blob/main/css-color-4/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 _=multiplyMatrices([[1,.3963377773761749,.2158037573099136],[1,-.1055613458156586,-.0638541728258133],[1,-.0894841775298119,-1.2914855480194092]],t);return multiplyMatrices([[1.2268798758459243,-.5578149944602171,.2813910456659647],[-.0405757452148008,1.112286803280317,-.0717110580655164],[-.0763729366746601,-.4214933324022432,1.5869240198367816]],_.map((t=>t**3)))}
+ */function OKLab_to_XYZ(t){const o=multiplyMatrices([[1,.3963377773761749,.2158037573099136],[1,-.1055613458156586,-.0638541728258133],[1,-.0894841775298119,-1.2914855480194092]],t);return multiplyMatrices([[1.2268798758459243,-.5578149944602171,.2813910456659647],[-.0405757452148008,1.112286803280317,-.0717110580655164],[-.0763729366746601,-.4214933324022432,1.5869240198367816]],o.map((t=>t**3)))}
/**
* Convert an array of rec2020 RGB values in the range 0.0 - 1.0
* to linear light (un-companded) form.
@@ -63,7 +63,7 @@
*
* @license W3C https://www.w3.org/Consortium/Legal/2015/copyright-software-and-document
* @copyright This software or document includes material copied from or derived from https://github.com/w3c/csswg-drafts/blob/main/css-color-4/conversions.js. Copyright © 2022 W3C® (MIT, ERCIM, Keio, Beihang).
- */function lin_2020(t){const _=1.09929682680944;return t.map((function(t){const o=t<0?-1:1,e=Math.abs(t);return e<.08124285829863151?t/4.5:o*Math.pow((e+_-1)/_,1/.45)}))}
+ */function lin_2020(t){const o=1.09929682680944;return t.map((function(t){const _=t<0?-1:1,e=Math.abs(t);return e<.08124285829863151?t/4.5:_*Math.pow((e+o-1)/o,1/.45)}))}
/**
* Convert an array of linear-light rec2020 values to CIE XYZ
* using D65 (no chromatic adaptation)
@@ -83,7 +83,7 @@
* @copyright This software or document includes material copied from or derived from https://github.com/w3c/csswg-drafts/blob/main/css-color-4/conversions.js. Copyright © 2022 W3C® (MIT, ERCIM, Keio, Beihang).
* @see https://en.wikipedia.org/wiki/SRGB
*/
-function lin_sRGB(t){return t.map((function(t){const _=t<0?-1:1,o=Math.abs(t);return o<=.04045?t/12.92:_*Math.pow((o+.055)/1.055,2.4)}))}
+function lin_sRGB(t){return t.map((function(t){const o=t<0?-1:1,_=Math.abs(t);return _<=.04045?t/12.92:o*Math.pow((_+.055)/1.055,2.4)}))}
/**
* Convert an array of display-p3 RGB values in the range 0.0 - 1.0
* to linear light (un-companded) form.
@@ -134,7 +134,7 @@ function lin_sRGB_to_XYZ(t){return multiplyMatrices([[506752/1228815,87881/24576
* @license W3C https://www.w3.org/Consortium/Legal/2015/copyright-software-and-document
* @copyright This software or document includes material copied from or derived from https://github.com/w3c/csswg-drafts/blob/main/css-color-4/conversions.js. Copyright © 2022 W3C® (MIT, ERCIM, Keio, Beihang).
* @see https://en.wikipedia.org/wiki/SRGB
- */function gam_sRGB(t){return t.map((function(t){const _=t<0?-1:1,o=Math.abs(t);return o>.0031308?_*(1.055*Math.pow(o,1/2.4)-.055):12.92*t}))}
+ */function gam_sRGB(t){return t.map((function(t){const o=t<0?-1:1,_=Math.abs(t);return _>.0031308?o*(1.055*Math.pow(_,1/2.4)-.055):12.92*t}))}
/**
* Convert an array of gamma-corrected sRGB values in the 0.0 to 1.0 range to HSL.
*
@@ -147,8 +147,8 @@ function lin_sRGB_to_XYZ(t){return multiplyMatrices([[506752/1228815,87881/24576
* @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/rgbToHsl.js
- */function sRGB_to_HSL(t){const _=t[0],o=t[1],e=t[2],n=Math.max(_,o,e),r=Math.min(_,o,e),a=(r+n)/2,i=n-r;let l=NaN,u=0;if(0!==Math.round(1e5*i)){switch(u=0===Math.round(1e5*a)||1e5===Math.round(1e5*a)?0:(n-a)/Math.min(a,1-a),n){case _:l=(o-e)/i+(o<e?6:0);break;case o:l=(e-_)/i+2;break;case e:l=(_-o)/i+4}l*=60}return[l,100*u,100*a]}
+ * @see https://github.com/w3c/csswg-drafts/blob/main/css-color-4/better-rgbToHsl.js
+ */function sRGB_to_HSL(t){const o=t[0],_=t[1],e=t[2],n=Math.max(o,_,e),r=Math.min(o,_,e),a=(r+n)/2,i=n-r;let l=NaN,s=0;if(0!==Math.round(1e5*i)){switch(s=0===Math.round(1e5*a)||1e5===Math.round(1e5*a)?0:(n-a)/Math.min(a,1-a),n){case o:l=(_-e)/i+(_<e?6:0);break;case _:l=(e-o)/i+2;break;case e:l=(o-_)/i+4}l*=60}return s<0&&(l+=180,s=Math.abs(s)),l>=360&&(l-=360),[l,100*s,100*a]}
/**
* Convert XYZ to linear-light P3
*
@@ -168,23 +168,23 @@ function lin_sRGB_to_XYZ(t){return multiplyMatrices([[506752/1228815,87881/24576
*
* @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(_){const o=_.map(((_,o)=>_/t[o])).map((t=>t>.008856451679035631?Math.cbrt(t):(903.2962962962963*t+16)/116));return[116*o[1]-16,500*(o[0]-o[1]),200*(o[1]-o[2])]}
+ */function XYZ_to_Lab(o){const _=216/24389,e=24389/27,n=o.map(((o,_)=>o/t[_])).map((t=>t>_?Math.cbrt(t):(e*t+16)/116));return[116*n[1]-16,500*(n[0]-n[1]),200*(n[1]-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).
*
* 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 _=multiplyMatrices([[.819022437996703,.3619062600528904,-.1288737815209879],[.0329836539323885,.9292868615863434,.0361446663506424],[.0481771893596242,.2642395317527308,.6335478284694309]],t);return multiplyMatrices([[.210454268309314,.7936177747023054,-.0040720430116193],[1.9779985324311684,-2.42859224204858,.450593709617411],[.0259040424655478,.7827717124575296,-.8086757549230774]],_.map((t=>Math.cbrt(t))))}
+ */function XYZ_to_OKLab(t){const o=multiplyMatrices([[.819022437996703,.3619062600528904,-.1288737815209879],[.0329836539323885,.9292868615863434,.0361446663506424],[.0481771893596242,.2642395317527308,.6335478284694309]],t);return multiplyMatrices([[.210454268309314,.7936177747023054,-.0040720430116193],[1.9779985324311684,-2.42859224204858,.450593709617411],[.0259040424655478,.7827717124575296,-.8086757549230774]],o.map((t=>Math.cbrt(t))))}
/**
* @license W3C https://www.w3.org/Consortium/Legal/2015/copyright-software-and-document
* @copyright This software or document includes material copied from or derived from https://github.com/w3c/csswg-drafts/blob/main/css-color-4/conversions.js. Copyright © 2022 W3C® (MIT, ERCIM, Keio, Beihang).
- */function Lab_to_LCH(t){const _=180*Math.atan2(t[2],t[1])/Math.PI;return[t[0],Math.sqrt(Math.pow(t[1],2)+Math.pow(t[2],2)),_>=0?_:_+360]}
+ */function Lab_to_LCH(t){const o=180*Math.atan2(t[2],t[1])/Math.PI;return[t[0],Math.sqrt(Math.pow(t[1],2)+Math.pow(t[2],2)),o>=0?o:o+360]}
/**
* @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 _=180*Math.atan2(t[2],t[1])/Math.PI;return[t[0],Math.sqrt(t[1]**2+t[2]**2),_>=0?_:_+360]}
+ */function OKLab_to_OKLCH(t){const o=180*Math.atan2(t[2],t[1])/Math.PI;return[t[0],Math.sqrt(t[1]**2+t[2]**2),o>=0?o:o+360]}
/**
* Convert XYZ to linear-light a98-rgb
*
@@ -198,14 +198,23 @@ function lin_sRGB_to_XYZ(t){return multiplyMatrices([[506752/1228815,87881/24576
* @license W3C https://www.w3.org/Consortium/Legal/2015/copyright-software-and-document
* @copyright This software or document includes material copied from or derived from https://github.com/w3c/csswg-drafts/blob/main/css-color-4/conversions.js. Copyright © 2022 W3C® (MIT, ERCIM, Keio, Beihang).
*/
-function gam_2020(t){const _=1.09929682680944;return t.map((function(t){const o=t<0?-1:1,e=Math.abs(t);return e>.018053968510807?o*(_*Math.pow(e,.45)-(_-1)):4.5*t}))}
+function gam_2020(t){const o=1.09929682680944;return t.map((function(t){const _=t<0?-1:1,e=Math.abs(t);return e>.018053968510807?_*(o*Math.pow(e,.45)-(o-1)):4.5*t}))}
/**
- * Convert XYZ to linear-light prophoto-rgb
+ * 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
- */function inGamut(t){const[_,o,e]=t;return _>=-1e-4&&_<=1.0001&&o>=-1e-4&&o<=1.0001&&e>=-1e-4&&e<=1.0001}function clip(t){return t.map((t=>t<0?0:t>1?1: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).
+ */
+function gam_ProPhoto(t){const o=1/512;return t.map((function(t){const _=t<0?-1:1,e=Math.abs(t);return e>=o?_*Math.pow(e,1/1.8):16*t}))}function inGamut(t){const[o,_,e]=t;return o>=-1e-4&&o<=1.0001&&_>=-1e-4&&_<=1.0001&&e>=-1e-4&&e<=1.0001}function clip(t){return t.map((t=>t<0?0:t>1?1:t))}
/**
* @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
@@ -215,4 +224,7 @@ function gam_2020(t){const _=1.09929682680944;return t.map((function(t){const o=
* @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,_){const[o,e,n]=t,[r,a,i]=_,l=o-r,u=e-a,s=n-i;return Math.sqrt(l**2+u**2+s**2)}const _=.02,o=1e-5;function binarySearchGamut(t,e,n){const r=t;let a=0,i=r[1];for(;i-a>o;){const t=(a+i)/2;r[1]=t;const o=e(r);if(inGamut(o)){a=t;continue}const l=clip(o);if(deltaEOK(OKLCH_to_OKLab(n(l)),OKLCH_to_OKLab(r))<_)return l;i=t}return clip(e([...r]))}exports.HSL_to_XYZ_D50=function HSL_to_XYZ_D50(t){let _=t;return _=HSL_to_sRGB(_),_=lin_sRGB(_),_=lin_sRGB_to_XYZ(_),_=D65_to_D50(_),_},exports.HWB_to_XYZ_D50=function HWB_to_XYZ_D50(t){let _=t;return _=HWB_to_sRGB(_),_=lin_sRGB(_),_=lin_sRGB_to_XYZ(_),_=D65_to_D50(_),_},exports.LCH_to_XYZ_D50=function LCH_to_XYZ_D50(t){let _=t;var o;return _=[(o=_)[0],o[1]*Math.cos(o[2]*Math.PI/180),o[1]*Math.sin(o[2]*Math.PI/180)],_=Lab_to_XYZ(_),_},exports.Lab_to_XYZ_D50=function Lab_to_XYZ_D50(t){let _=t;return _=Lab_to_XYZ(_),_},exports.OKLCH_to_OKLab=OKLCH_to_OKLab,exports.OKLCH_to_XYZ_D50=function OKLCH_to_XYZ_D50(t){let _=t;return _=OKLCH_to_OKLab(_),_=OKLab_to_XYZ(_),_=D65_to_D50(_),_},exports.OKLab_to_OKLCH=OKLab_to_OKLCH,exports.OKLab_to_XYZ=OKLab_to_XYZ,exports.OKLab_to_XYZ_D50=function OKLab_to_XYZ_D50(t){let _=t;return _=OKLab_to_XYZ(_),_=D65_to_D50(_),_},exports.P3_to_XYZ_D50=function P3_to_XYZ_D50(t){let _=t;return _=lin_P3(_),_=lin_P3_to_XYZ(_),_=D65_to_D50(_),_},exports.ProPhoto_RGB_to_XYZ_D50=function ProPhoto_RGB_to_XYZ_D50(t){let _=t;return _=_.map((function(t){const _=t<0?-1:1,o=Math.abs(t);return o<=.03125?t/16:_*Math.pow(o,1.8)})),_=multiplyMatrices([[.7977604896723027,.13518583717574031,.0313493495815248],[.2880711282292934,.7118432178101014,8565396060525902e-20],[0,0,.8251046025104601]],_),_},exports.XYZ_D50_to_HSL=function XYZ_D50_to_HSL(t){let _=t;return _=D50_to_D65(_),_=XYZ_to_lin_sRGB(_),_=gam_sRGB(_),_=sRGB_to_HSL(_),_},exports.XYZ_D50_to_HWB=function XYZ_D50_to_HWB(t){let _=t;_=D50_to_D65(_),_=XYZ_to_lin_sRGB(_);const o=gam_sRGB(_);_=sRGB_to_HSL(o);const e=Math.min(o[0],o[1],o[2]),n=1-Math.max(o[0],o[1],o[2]);return[_[0],100*e,100*n]},exports.XYZ_D50_to_LCH=function XYZ_D50_to_LCH(t){let _=t;return _=XYZ_to_Lab(_),_=Lab_to_LCH(_),_},exports.XYZ_D50_to_Lab=function XYZ_D50_to_Lab(t){let _=t;return _=XYZ_to_Lab(_),_},exports.XYZ_D50_to_OKLCH=function XYZ_D50_to_OKLCH(t){let _=t;return _=D50_to_D65(_),_=XYZ_to_OKLab(_),_=OKLab_to_OKLCH(_),_},exports.XYZ_D50_to_OKLab=function XYZ_D50_to_OKLab(t){let _=t;return _=D50_to_D65(_),_=XYZ_to_OKLab(_),_},exports.XYZ_D50_to_P3=function XYZ_D50_to_P3(t){let _=t;return _=D50_to_D65(_),_=XYZ_to_lin_P3(_),_=gam_P3(_),_},exports.XYZ_D50_to_ProPhoto=function XYZ_D50_to_ProPhoto(t){let _=t;return _=multiplyMatrices([[1.3457989731028281,-.25558010007997534,-.05110628506753401],[-.5446224939028347,1.5082327413132781,.02053603239147973],[0,0,1.2119675456389454]],_),_=_.map((function(t){const _=t<0?-1:1,o=Math.abs(t);return o>=.001953125?_*Math.pow(o,1/1.8):16*t})),_},exports.XYZ_D50_to_XYZ_D50=function XYZ_D50_to_XYZ_D50(t){return t},exports.XYZ_D50_to_XYZ_D65=function XYZ_D50_to_XYZ_D65(t){let _=t;return _=D50_to_D65(_),_},exports.XYZ_D50_to_a98_RGB=function XYZ_D50_to_a98_RGB(t){let _=t;return _=D50_to_D65(_),_=multiplyMatrices([[1829569/896150,-506331/896150,-308931/896150],[-851781/878810,1648619/878810,36519/878810],[16779/1248040,-147721/1248040,1266979/1248040]],_),_=_.map((function(t){const _=t<0?-1:1,o=Math.abs(t);return _*Math.pow(o,256/563)})),_},exports.XYZ_D50_to_lin_sRGB=function XYZ_D50_to_lin_sRGB(t){let _=t;return _=D50_to_D65(_),_=XYZ_to_lin_sRGB(_),_},exports.XYZ_D50_to_rec_2020=function XYZ_D50_to_rec_2020(t){let _=t;return _=D50_to_D65(_),_=multiplyMatrices([[30757411/17917100,-6372589/17917100,-4539589/17917100],[-.666684351832489,1.616481236634939,467509/29648200],[792561/44930125,-1921689/44930125,.942103121235474]],_),_=gam_2020(_),_},exports.XYZ_D50_to_sRGB=function XYZ_D50_to_sRGB(t){let _=t;return _=D50_to_D65(_),_=XYZ_to_lin_sRGB(_),_=gam_sRGB(_),_},exports.XYZ_D65_to_XYZ_D50=function XYZ_D65_to_XYZ_D50(t){let _=t;return _=D65_to_D50(_),_},exports.XYZ_to_OKLab=XYZ_to_OKLab,exports.XYZ_to_lin_P3=XYZ_to_lin_P3,exports.XYZ_to_lin_sRGB=XYZ_to_lin_sRGB,exports.a98_RGB_to_XYZ_D50=function a98_RGB_to_XYZ_D50(t){let _=t;return _=_.map((function(t){const _=t<0?-1:1,o=Math.abs(t);return _*Math.pow(o,563/256)})),_=multiplyMatrices([[573536/994567,263643/1420810,187206/994567],[591459/1989134,6239551/9945670,374412/4972835],[53769/1989134,351524/4972835,4929758/4972835]],_),_=D65_to_D50(_),_},exports.clip=clip,exports.gam_P3=gam_P3,exports.gam_sRGB=gam_sRGB,exports.inGamut=inGamut,exports.lin_P3=lin_P3,exports.lin_P3_to_XYZ=lin_P3_to_XYZ,exports.lin_sRGB=lin_sRGB,exports.lin_sRGB_to_XYZ=lin_sRGB_to_XYZ,exports.lin_sRGB_to_XYZ_D50=function lin_sRGB_to_XYZ_D50(t){let _=t;return _=lin_sRGB_to_XYZ(_),_=D65_to_D50(_),_},exports.mapGamut=function mapGamut(t,_,o){return binarySearchGamut(t,_,o)},exports.namedColors={aliceblue:[240,248,255],antiquewhite:[250,235,215],aqua:[0,255,255],aquamarine:[127,255,212],azure:[240,255,255],beige:[245,245,220],bisque:[255,228,196],black:[0,0,0],blanchedalmond:[255,235,205],blue:[0,0,255],blueviolet:[138,43,226],brown:[165,42,42],burlywood:[222,184,135],cadetblue:[95,158,160],chartreuse:[127,255,0],chocolate:[210,105,30],coral:[255,127,80],cornflowerblue:[100,149,237],cornsilk:[255,248,220],crimson:[220,20,60],cyan:[0,255,255],darkblue:[0,0,139],darkcyan:[0,139,139],darkgoldenrod:[184,134,11],darkgray:[169,169,169],darkgreen:[0,100,0],darkgrey:[169,169,169],darkkhaki:[189,183,107],darkmagenta:[139,0,139],darkolivegreen:[85,107,47],darkorange:[255,140,0],darkorchid:[153,50,204],darkred:[139,0,0],darksalmon:[233,150,122],darkseagreen:[143,188,143],darkslateblue:[72,61,139],darkslategray:[47,79,79],darkslategrey:[47,79,79],darkturquoise:[0,206,209],darkviolet:[148,0,211],deeppink:[255,20,147],deepskyblue:[0,191,255],dimgray:[105,105,105],dimgrey:[105,105,105],dodgerblue:[30,144,255],firebrick:[178,34,34],floralwhite:[255,250,240],forestgreen:[34,139,34],fuchsia:[255,0,255],gainsboro:[220,220,220],ghostwhite:[248,248,255],gold:[255,215,0],goldenrod:[218,165,32],gray:[128,128,128],green:[0,128,0],greenyellow:[173,255,47],grey:[128,128,128],honeydew:[240,255,240],hotpink:[255,105,180],indianred:[205,92,92],indigo:[75,0,130],ivory:[255,255,240],khaki:[240,230,140],lavender:[230,230,250],lavenderblush:[255,240,245],lawngreen:[124,252,0],lemonchiffon:[255,250,205],lightblue:[173,216,230],lightcoral:[240,128,128],lightcyan:[224,255,255],lightgoldenrodyellow:[250,250,210],lightgray:[211,211,211],lightgreen:[144,238,144],lightgrey:[211,211,211],lightpink:[255,182,193],lightsalmon:[255,160,122],lightseagreen:[32,178,170],lightskyblue:[135,206,250],lightslategray:[119,136,153],lightslategrey:[119,136,153],lightsteelblue:[176,196,222],lightyellow:[255,255,224],lime:[0,255,0],limegreen:[50,205,50],linen:[250,240,230],magenta:[255,0,255],maroon:[128,0,0],mediumaquamarine:[102,205,170],mediumblue:[0,0,205],mediumorchid:[186,85,211],mediumpurple:[147,112,219],mediumseagreen:[60,179,113],mediumslateblue:[123,104,238],mediumspringgreen:[0,250,154],mediumturquoise:[72,209,204],mediumvioletred:[199,21,133],midnightblue:[25,25,112],mintcream:[245,255,250],mistyrose:[255,228,225],moccasin:[255,228,181],navajowhite:[255,222,173],navy:[0,0,128],oldlace:[253,245,230],olive:[128,128,0],olivedrab:[107,142,35],orange:[255,165,0],orangered:[255,69,0],orchid:[218,112,214],palegoldenrod:[238,232,170],palegreen:[152,251,152],paleturquoise:[175,238,238],palevioletred:[219,112,147],papayawhip:[255,239,213],peachpuff:[255,218,185],peru:[205,133,63],pink:[255,192,203],plum:[221,160,221],powderblue:[176,224,230],purple:[128,0,128],rebeccapurple:[102,51,153],red:[255,0,0],rosybrown:[188,143,143],royalblue:[65,105,225],saddlebrown:[139,69,19],salmon:[250,128,114],sandybrown:[244,164,96],seagreen:[46,139,87],seashell:[255,245,238],sienna:[160,82,45],silver:[192,192,192],skyblue:[135,206,235],slateblue:[106,90,205],slategray:[112,128,144],slategrey:[112,128,144],snow:[255,250,250],springgreen:[0,255,127],steelblue:[70,130,180],tan:[210,180,140],teal:[0,128,128],thistle:[216,191,216],tomato:[255,99,71],turquoise:[64,224,208],violet:[238,130,238],wheat:[245,222,179],white:[255,255,255],whitesmoke:[245,245,245],yellow:[255,255,0],yellowgreen:[154,205,50]},exports.rec_2020_to_XYZ_D50=function rec_2020_to_XYZ_D50(t){let _=t;return _=lin_2020(_),_=multiplyMatrices([[63426534/99577255,20160776/139408157,47086771/278816314],[26158966/99577255,.677998071518871,8267143/139408157],[0,19567812/697040785,1.0609850577107909]],_),_=D65_to_D50(_),_},exports.sRGB_to_XYZ_D50=function sRGB_to_XYZ_D50(t){let _=t;return _=lin_sRGB(_),_=lin_sRGB_to_XYZ(_),_=D65_to_D50(_),_};
+ */function deltaEOK(t,o){const[_,e,n]=t,[r,a,i]=o,l=_-r,s=e-a,u=n-i;return Math.sqrt(l**2+s**2+u**2)}const o=.02,_=1e-4;function rayTraceBox(t,o){let _=1/0,e=-1/0;const n=[];for(let r=0;r<3;r++){const a=t[r],i=o[r]-a;n.push(i);const l=0,s=1;if(i){const t=1/i,o=(l-a)*t,n=(s-a)*t;e=Math.max(Math.min(o,n),e),_=Math.min(Math.max(o,n),_)}else if(a<l||a>s)return!1}return!(e>_||_<0)&&(e<0&&(e=_),!!isFinite(e)&&[t[0]+n[0]*e,t[1]+n[1]*e,t[2]+n[2]*e])}function luminance(t){const[o,_,e]=t.map((t=>t<=.03928?t/12.92:Math.pow((t+.055)/1.055,2.4)));return.2126*o+.7152*_+.0722*e}exports.HSL_to_XYZ_D50=function HSL_to_XYZ_D50(t){let o=t;return o=HSL_to_sRGB(o),o=lin_sRGB(o),o=lin_sRGB_to_XYZ(o),o=D65_to_D50(o),o},exports.HWB_to_XYZ_D50=function HWB_to_XYZ_D50(t){let o=t;return o=HWB_to_sRGB(o),o=lin_sRGB(o),o=lin_sRGB_to_XYZ(o),o=D65_to_D50(o),o},exports.LCH_to_XYZ_D50=function LCH_to_XYZ_D50(t){let o=t;var _;return o=[(_=o)[0],_[1]*Math.cos(_[2]*Math.PI/180),_[1]*Math.sin(_[2]*Math.PI/180)],o=Lab_to_XYZ(o),o},exports.Lab_to_XYZ_D50=function Lab_to_XYZ_D50(t){let o=t;return o=Lab_to_XYZ(o),o},exports.OKLCH_to_OKLab=OKLCH_to_OKLab,exports.OKLCH_to_XYZ_D50=function OKLCH_to_XYZ_D50(t){let o=t;return o=OKLCH_to_OKLab(o),o=OKLab_to_XYZ(o),o=D65_to_D50(o),o},exports.OKLab_to_OKLCH=OKLab_to_OKLCH,exports.OKLab_to_XYZ=OKLab_to_XYZ,exports.OKLab_to_XYZ_D50=function OKLab_to_XYZ_D50(t){let o=t;return o=OKLab_to_XYZ(o),o=D65_to_D50(o),o},exports.P3_to_XYZ_D50=function P3_to_XYZ_D50(t){let o=t;return o=lin_P3(o),o=lin_P3_to_XYZ(o),o=D65_to_D50(o),o},exports.ProPhoto_RGB_to_XYZ_D50=function ProPhoto_RGB_to_XYZ_D50(t){let o=t;return o=o.map((function(t){const o=t<0?-1:1,_=Math.abs(t);return _<=.03125?t/16:o*Math.pow(_,1.8)})),o=multiplyMatrices([[.7977666449006423,.13518129740053308,.0313477341283922],[.2880748288194013,.711835234241873,8993693872564e-17],[0,0,.8251046025104602]],o),o},exports.XYZ_D50_to_HSL=function XYZ_D50_to_HSL(t){let o=t;return o=D50_to_D65(o),o=XYZ_to_lin_sRGB(o),o=gam_sRGB(o),o=sRGB_to_HSL(o),o},exports.XYZ_D50_to_HWB=function XYZ_D50_to_HWB(t){let o=t;o=D50_to_D65(o),o=XYZ_to_lin_sRGB(o);const _=gam_sRGB(o);o=sRGB_to_HSL(_);const e=Math.min(_[0],_[1],_[2]),n=1-Math.max(_[0],_[1],_[2]);return[o[0],100*e,100*n]},exports.XYZ_D50_to_LCH=function XYZ_D50_to_LCH(t){let o=t;return o=XYZ_to_Lab(o),o=Lab_to_LCH(o),o},exports.XYZ_D50_to_Lab=function XYZ_D50_to_Lab(t){let o=t;return o=XYZ_to_Lab(o),o},exports.XYZ_D50_to_OKLCH=function XYZ_D50_to_OKLCH(t){let o=t;return o=D50_to_D65(o),o=XYZ_to_OKLab(o),o=OKLab_to_OKLCH(o),o},exports.XYZ_D50_to_OKLab=function XYZ_D50_to_OKLab(t){let o=t;return o=D50_to_D65(o),o=XYZ_to_OKLab(o),o},exports.XYZ_D50_to_P3=function XYZ_D50_to_P3(t){let o=t;return o=D50_to_D65(o),o=XYZ_to_lin_P3(o),o=gam_P3(o),o},exports.XYZ_D50_to_ProPhoto=function XYZ_D50_to_ProPhoto(t){let o=t;return o=multiplyMatrices([[1.3457868816471583,-.25557208737979464,-.05110186497554526],[-.5446307051249019,1.5082477428451468,.02052744743642139],[0,0,1.2119675456389452]],o),o=gam_ProPhoto(o),o},exports.XYZ_D50_to_XYZ_D50=function XYZ_D50_to_XYZ_D50(t){return t},exports.XYZ_D50_to_XYZ_D65=function XYZ_D50_to_XYZ_D65(t){let o=t;return o=D50_to_D65(o),o},exports.XYZ_D50_to_a98_RGB=function XYZ_D50_to_a98_RGB(t){let o=t;return o=D50_to_D65(o),o=multiplyMatrices([[1829569/896150,-506331/896150,-308931/896150],[-851781/878810,1648619/878810,36519/878810],[16779/1248040,-147721/1248040,1266979/1248040]],o),o=o.map((function(t){const o=t<0?-1:1,_=Math.abs(t);return o*Math.pow(_,256/563)})),o},exports.XYZ_D50_to_lin_sRGB=function XYZ_D50_to_lin_sRGB(t){let o=t;return o=D50_to_D65(o),o=XYZ_to_lin_sRGB(o),o},exports.XYZ_D50_to_rec_2020=function XYZ_D50_to_rec_2020(t){let o=t;return o=D50_to_D65(o),o=multiplyMatrices([[30757411/17917100,-6372589/17917100,-4539589/17917100],[-.666684351832489,1.616481236634939,467509/29648200],[792561/44930125,-1921689/44930125,.942103121235474]],o),o=gam_2020(o),o},exports.XYZ_D50_to_sRGB=function XYZ_D50_to_sRGB(t){let o=t;return o=D50_to_D65(o),o=XYZ_to_lin_sRGB(o),o=gam_sRGB(o),o},exports.XYZ_D65_to_XYZ_D50=function XYZ_D65_to_XYZ_D50(t){let o=t;return o=D65_to_D50(o),o},exports.XYZ_to_OKLab=XYZ_to_OKLab,exports.XYZ_to_lin_P3=XYZ_to_lin_P3,exports.XYZ_to_lin_sRGB=XYZ_to_lin_sRGB,exports.a98_RGB_to_XYZ_D50=function a98_RGB_to_XYZ_D50(t){let o=t;return o=o.map((function(t){const o=t<0?-1:1,_=Math.abs(t);return o*Math.pow(_,563/256)})),o=multiplyMatrices([[573536/994567,263643/1420810,187206/994567],[591459/1989134,6239551/9945670,374412/4972835],[53769/1989134,351524/4972835,4929758/4972835]],o),o=D65_to_D50(o),o},exports.clip=clip,exports.contrast_ratio_wcag_2_1=function contrast_ratio_wcag_2_1(t,o){const _=luminance(t),e=luminance(o);return(Math.max(_,e)+.05)/(Math.min(_,e)+.05)},exports.gam_P3=gam_P3,exports.gam_sRGB=gam_sRGB,exports.inGamut=inGamut,exports.lin_P3=lin_P3,exports.lin_P3_to_XYZ=lin_P3_to_XYZ,exports.lin_sRGB=lin_sRGB,exports.lin_sRGB_to_XYZ=lin_sRGB_to_XYZ,exports.lin_sRGB_to_XYZ_D50=function lin_sRGB_to_XYZ_D50(t){let o=t;return o=lin_sRGB_to_XYZ(o),o=D65_to_D50(o),o},exports.mapGamut=function mapGamut(t,e,n){const r=t;let a=clip(e(r)),i=deltaEOK(OKLCH_to_OKLab(n(a)),OKLCH_to_OKLab(r));if(i<o)return a;let l=0,s=r[1],u=!0;for(;s-l>_;){const t=(l+s)/2;if(r[1]=t,u&&inGamut(e(r)))l=t;else if(a=clip(e(r)),i=deltaEOK(OKLCH_to_OKLab(n(a)),OKLCH_to_OKLab(r)),i<o){if(o-i<_)return a;u=!1,l=t}else s=t}return clip(e([...r]))}
+/**
+ * @license MIT https://github.com/facelessuser/coloraide/blob/main/LICENSE.md
+ */,exports.mapGamutRayTrace=function mapGamutRayTrace(t,o,_){const e=t[0],n=t[2];let r=o(t);const a=o([e,0,n]);for(let t=0;t<4;t++){if(t>0){const t=_(r);t[0]=e,t[2]=n,r=o(t)}const i=rayTraceBox(a,r.slice());if(!i)break;r=i.slice()}return clip(r)},exports.namedColors={aliceblue:[240,248,255],antiquewhite:[250,235,215],aqua:[0,255,255],aquamarine:[127,255,212],azure:[240,255,255],beige:[245,245,220],bisque:[255,228,196],black:[0,0,0],blanchedalmond:[255,235,205],blue:[0,0,255],blueviolet:[138,43,226],brown:[165,42,42],burlywood:[222,184,135],cadetblue:[95,158,160],chartreuse:[127,255,0],chocolate:[210,105,30],coral:[255,127,80],cornflowerblue:[100,149,237],cornsilk:[255,248,220],crimson:[220,20,60],cyan:[0,255,255],darkblue:[0,0,139],darkcyan:[0,139,139],darkgoldenrod:[184,134,11],darkgray:[169,169,169],darkgreen:[0,100,0],darkgrey:[169,169,169],darkkhaki:[189,183,107],darkmagenta:[139,0,139],darkolivegreen:[85,107,47],darkorange:[255,140,0],darkorchid:[153,50,204],darkred:[139,0,0],darksalmon:[233,150,122],darkseagreen:[143,188,143],darkslateblue:[72,61,139],darkslategray:[47,79,79],darkslategrey:[47,79,79],darkturquoise:[0,206,209],darkviolet:[148,0,211],deeppink:[255,20,147],deepskyblue:[0,191,255],dimgray:[105,105,105],dimgrey:[105,105,105],dodgerblue:[30,144,255],firebrick:[178,34,34],floralwhite:[255,250,240],forestgreen:[34,139,34],fuchsia:[255,0,255],gainsboro:[220,220,220],ghostwhite:[248,248,255],gold:[255,215,0],goldenrod:[218,165,32],gray:[128,128,128],green:[0,128,0],greenyellow:[173,255,47],grey:[128,128,128],honeydew:[240,255,240],hotpink:[255,105,180],indianred:[205,92,92],indigo:[75,0,130],ivory:[255,255,240],khaki:[240,230,140],lavender:[230,230,250],lavenderblush:[255,240,245],lawngreen:[124,252,0],lemonchiffon:[255,250,205],lightblue:[173,216,230],lightcoral:[240,128,128],lightcyan:[224,255,255],lightgoldenrodyellow:[250,250,210],lightgray:[211,211,211],lightgreen:[144,238,144],lightgrey:[211,211,211],lightpink:[255,182,193],lightsalmon:[255,160,122],lightseagreen:[32,178,170],lightskyblue:[135,206,250],lightslategray:[119,136,153],lightslategrey:[119,136,153],lightsteelblue:[176,196,222],lightyellow:[255,255,224],lime:[0,255,0],limegreen:[50,205,50],linen:[250,240,230],magenta:[255,0,255],maroon:[128,0,0],mediumaquamarine:[102,205,170],mediumblue:[0,0,205],mediumorchid:[186,85,211],mediumpurple:[147,112,219],mediumseagreen:[60,179,113],mediumslateblue:[123,104,238],mediumspringgreen:[0,250,154],mediumturquoise:[72,209,204],mediumvioletred:[199,21,133],midnightblue:[25,25,112],mintcream:[245,255,250],mistyrose:[255,228,225],moccasin:[255,228,181],navajowhite:[255,222,173],navy:[0,0,128],oldlace:[253,245,230],olive:[128,128,0],olivedrab:[107,142,35],orange:[255,165,0],orangered:[255,69,0],orchid:[218,112,214],palegoldenrod:[238,232,170],palegreen:[152,251,152],paleturquoise:[175,238,238],palevioletred:[219,112,147],papayawhip:[255,239,213],peachpuff:[255,218,185],peru:[205,133,63],pink:[255,192,203],plum:[221,160,221],powderblue:[176,224,230],purple:[128,0,128],rebeccapurple:[102,51,153],red:[255,0,0],rosybrown:[188,143,143],royalblue:[65,105,225],saddlebrown:[139,69,19],salmon:[250,128,114],sandybrown:[244,164,96],seagreen:[46,139,87],seashell:[255,245,238],sienna:[160,82,45],silver:[192,192,192],skyblue:[135,206,235],slateblue:[106,90,205],slategray:[112,128,144],slategrey:[112,128,144],snow:[255,250,250],springgreen:[0,255,127],steelblue:[70,130,180],tan:[210,180,140],teal:[0,128,128],thistle:[216,191,216],tomato:[255,99,71],turquoise:[64,224,208],violet:[238,130,238],wheat:[245,222,179],white:[255,255,255],whitesmoke:[245,245,245],yellow:[255,255,0],yellowgreen:[154,205,50]},exports.rec_2020_to_XYZ_D50=function rec_2020_to_XYZ_D50(t){let o=t;return o=lin_2020(o),o=multiplyMatrices([[63426534/99577255,20160776/139408157,47086771/278816314],[26158966/99577255,.677998071518871,8267143/139408157],[0,19567812/697040785,1.0609850577107909]],o),o=D65_to_D50(o),o},exports.sRGB_to_XYZ_D50=function sRGB_to_XYZ_D50(t){let o=t;return o=lin_sRGB(o),o=lin_sRGB_to_XYZ(o),o=D65_to_D50(o),o};
diff --git a/node_modules/@csstools/color-helpers/dist/index.d.ts b/node_modules/@csstools/color-helpers/dist/index.d.ts
index 5b4405bd..3cd1443b 100644
--- a/node_modules/@csstools/color-helpers/dist/index.d.ts
+++ b/node_modules/@csstools/color-helpers/dist/index.d.ts
@@ -12,6 +12,11 @@ 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
*
@@ -122,6 +127,11 @@ 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<string, Color>;
/**
diff --git a/node_modules/@csstools/color-helpers/dist/index.mjs b/node_modules/@csstools/color-helpers/dist/index.mjs
index 0971c853..660ec028 100644
--- a/node_modules/@csstools/color-helpers/dist/index.mjs
+++ b/node_modules/@csstools/color-helpers/dist/index.mjs
@@ -7,7 +7,7 @@
* @copyright This software or document includes material copied from or derived from https://github.com/w3c/csswg-drafts/blob/main/css-color-4/multiply-matrices.js. Copyright © 2022 W3C® (MIT, ERCIM, Keio, Beihang).
* @see https://github.com/w3c/csswg-drafts/blob/main/css-color-4/multiply-matrices.js
*/
-function multiplyMatrices(t,_){const n=t.length;let o,e;o=Array.isArray(t[0])?t:[t],e=Array.isArray(_[0])?_:_.map((t=>[t]));const r=e[0].length,a=e[0].map(((t,_)=>e.map((t=>t[_]))));let i=o.map((t=>a.map((_=>Array.isArray(t)?t.reduce(((t,n,o)=>t+n*(_[o]||0)),0):_.reduce(((_,n)=>_+n*t),0)))));return 1===n&&(i=i[0]),1===r?i.map((t=>t[0])):i}
+function multiplyMatrices(t,n){const _=t.length;let o,e;o=Array.isArray(t[0])?t:[t],e=Array.isArray(n[0])?n:n.map((t=>[t]));const r=e[0].length,a=e[0].map(((t,n)=>e.map((t=>t[n]))));let i=o.map((t=>a.map((n=>Array.isArray(t)?t.reduce(((t,_,o)=>t+_*(n[o]||0)),0):n.reduce(((n,_)=>n+_*t),0)))));return 1===_&&(i=i[0]),1===r?i.map((t=>t[0])):i}
/**
* Bradford chromatic adaptation from D65 to D50
* @license W3C https://www.w3.org/Consortium/Legal/2015/copyright-software-and-document
@@ -18,12 +18,12 @@ function multiplyMatrices(t,_){const n=t.length;let o,e;o=Array.isArray(t[0])?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 RGB components 0..1
+ * @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 _=t[0],n=t[1],o=t[2];function f(t){const e=(t+_/30)%12,r=n*Math.min(o,1-o);return o-r*Math.max(-1,Math.min(e-3,9-e,1))}return _%=360,_<0&&(_+=360),n/=100,o/=100,[f(0),f(8),f(4)]}
+ */function HSL_to_sRGB(t){let n=t[0],_=t[1],o=t[2];function f(t){const e=(t+n/30)%12,r=_*Math.min(o,1-o);return o-r*Math.max(-1,Math.min(e-3,9-e,1))}return n%=360,n<0&&(n+=360),_/=100,o/=100,[f(0),f(8),f(4)]}
/**
* @param {number} hue - Hue as degrees 0..360
* @param {number} white - Whiteness as percentage 0..100
@@ -33,7 +33,7 @@ function multiplyMatrices(t,_){const n=t.length;let o,e;o=Array.isArray(t[0])?t:
* @license W3C https://www.w3.org/Consortium/Legal/2015/copyright-software-and-document
* @copyright This software or document includes material copied from or derived from https://github.com/w3c/csswg-drafts/blob/main/css-color-4/hwbToRgb.js. Copyright © 2022 W3C® (MIT, ERCIM, Keio, Beihang).
* @see https://github.com/w3c/csswg-drafts/blob/main/css-color-4/hwbToRgb.js
- */function HWB_to_sRGB(t){const _=t[0];let n=t[1],o=t[2];if(n/=100,o/=100,n+o>=1){const t=n/(n+o);return[t,t,t]}const e=HSL_to_sRGB([_,100,50]);for(let t=0;t<3;t++)e[t]*=1-n-o,e[t]+=n;return e}
+ */function HWB_to_sRGB(t){const n=t[0];let _=t[1],o=t[2];if(_/=100,o/=100,_+o>=1){const t=_/(_+o);return[t,t,t]}const e=HSL_to_sRGB([n,100,50]);for(let t=0;t<3;t++)e[t]*=1-_-o,e[t]+=_;return e}
/**
* @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).
@@ -43,7 +43,7 @@ function multiplyMatrices(t,_){const n=t.length;let o,e;o=Array.isArray(t[0])?t:
* @license W3C https://www.w3.org/Consortium/Legal/2015/copyright-software-and-document
* @copyright This software or document includes material copied from or derived from https://github.com/w3c/csswg-drafts/blob/main/css-color-4/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(_){const n=24389/27,o=216/24389,e=[];e[1]=(_[0]+16)/116,e[0]=_[1]/500+e[1],e[2]=e[1]-_[2]/200;return[Math.pow(e[0],3)>o?Math.pow(e[0],3):(116*e[0]-16)/n,_[0]>8?Math.pow((_[0]+16)/116,3):_[0]/n,Math.pow(e[2],3)>o?Math.pow(e[2],3):(116*e[2]-16)/n].map(((_,n)=>_*t[n]))}
+ */function Lab_to_XYZ(n){const _=24389/27,o=216/24389,e=[];e[1]=(n[0]+16)/116,e[0]=n[1]/500+e[1],e[2]=e[1]-n[2]/200;return[Math.pow(e[0],3)>o?Math.pow(e[0],3):(116*e[0]-16)/_,n[0]>8?Math.pow((n[0]+16)/116,3):n[0]/_,Math.pow(e[2],3)>o?Math.pow(e[2],3):(116*e[2]-16)/_].map(((n,_)=>n*t[_]))}
/**
* @license W3C https://www.w3.org/Consortium/Legal/2015/copyright-software-and-document
* @copyright This software or document includes material copied from or derived from https://github.com/w3c/csswg-drafts/blob/main/css-color-4/conversions.js. Copyright © 2022 W3C® (MIT, ERCIM, Keio, Beihang).
@@ -55,7 +55,7 @@ function multiplyMatrices(t,_){const n=t.length;let o,e;o=Array.isArray(t[0])?t:
* @license W3C https://www.w3.org/Consortium/Legal/2015/copyright-software-and-document
* @copyright This software or document includes material copied from or derived from https://github.com/w3c/csswg-drafts/blob/main/css-color-4/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 _=multiplyMatrices([[1,.3963377773761749,.2158037573099136],[1,-.1055613458156586,-.0638541728258133],[1,-.0894841775298119,-1.2914855480194092]],t);return multiplyMatrices([[1.2268798758459243,-.5578149944602171,.2813910456659647],[-.0405757452148008,1.112286803280317,-.0717110580655164],[-.0763729366746601,-.4214933324022432,1.5869240198367816]],_.map((t=>t**3)))}
+ */function OKLab_to_XYZ(t){const n=multiplyMatrices([[1,.3963377773761749,.2158037573099136],[1,-.1055613458156586,-.0638541728258133],[1,-.0894841775298119,-1.2914855480194092]],t);return multiplyMatrices([[1.2268798758459243,-.5578149944602171,.2813910456659647],[-.0405757452148008,1.112286803280317,-.0717110580655164],[-.0763729366746601,-.4214933324022432,1.5869240198367816]],n.map((t=>t**3)))}
/**
* Convert an array of rec2020 RGB values in the range 0.0 - 1.0
* to linear light (un-companded) form.
@@ -63,7 +63,7 @@ function multiplyMatrices(t,_){const n=t.length;let o,e;o=Array.isArray(t[0])?t:
*
* @license W3C https://www.w3.org/Consortium/Legal/2015/copyright-software-and-document
* @copyright This software or document includes material copied from or derived from https://github.com/w3c/csswg-drafts/blob/main/css-color-4/conversions.js. Copyright © 2022 W3C® (MIT, ERCIM, Keio, Beihang).
- */function lin_2020(t){const _=1.09929682680944;return t.map((function(t){const n=t<0?-1:1,o=Math.abs(t);return o<.08124285829863151?t/4.5:n*Math.pow((o+_-1)/_,1/.45)}))}
+ */function lin_2020(t){const n=1.09929682680944;return t.map((function(t){const _=t<0?-1:1,o=Math.abs(t);return o<.08124285829863151?t/4.5:_*Math.pow((o+n-1)/n,1/.45)}))}
/**
* Convert an array of linear-light rec2020 values to CIE XYZ
* using D65 (no chromatic adaptation)
@@ -83,7 +83,7 @@ function multiplyMatrices(t,_){const n=t.length;let o,e;o=Array.isArray(t[0])?t:
* @copyright This software or document includes material copied from or derived from https://github.com/w3c/csswg-drafts/blob/main/css-color-4/conversions.js. Copyright © 2022 W3C® (MIT, ERCIM, Keio, Beihang).
* @see https://en.wikipedia.org/wiki/SRGB
*/
-function lin_sRGB(t){return t.map((function(t){const _=t<0?-1:1,n=Math.abs(t);return n<=.04045?t/12.92:_*Math.pow((n+.055)/1.055,2.4)}))}
+function lin_sRGB(t){return t.map((function(t){const n=t<0?-1:1,_=Math.abs(t);return _<=.04045?t/12.92:n*Math.pow((_+.055)/1.055,2.4)}))}
/**
* Convert an array of display-p3 RGB values in the range 0.0 - 1.0
* to linear light (un-companded) form.
@@ -134,7 +134,7 @@ function lin_sRGB_to_XYZ(t){return multiplyMatrices([[506752/1228815,87881/24576
* @license W3C https://www.w3.org/Consortium/Legal/2015/copyright-software-and-document
* @copyright This software or document includes material copied from or derived from https://github.com/w3c/csswg-drafts/blob/main/css-color-4/conversions.js. Copyright © 2022 W3C® (MIT, ERCIM, Keio, Beihang).
* @see https://en.wikipedia.org/wiki/SRGB
- */function gam_sRGB(t){return t.map((function(t){const _=t<0?-1:1,n=Math.abs(t);return n>.0031308?_*(1.055*Math.pow(n,1/2.4)-.055):12.92*t}))}
+ */function gam_sRGB(t){return t.map((function(t){const n=t<0?-1:1,_=Math.abs(t);return _>.0031308?n*(1.055*Math.pow(_,1/2.4)-.055):12.92*t}))}
/**
* Convert an array of gamma-corrected sRGB values in the 0.0 to 1.0 range to HSL.
*
@@ -147,8 +147,8 @@ function lin_sRGB_to_XYZ(t){return multiplyMatrices([[506752/1228815,87881/24576
* @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/rgbToHsl.js
- */function sRGB_to_HSL(t){const _=t[0],n=t[1],o=t[2],e=Math.max(_,n,o),r=Math.min(_,n,o),a=(r+e)/2,i=e-r;let l=NaN,u=0;if(0!==Math.round(1e5*i)){switch(u=0===Math.round(1e5*a)||1e5===Math.round(1e5*a)?0:(e-a)/Math.min(a,1-a),e){case _:l=(n-o)/i+(n<o?6:0);break;case n:l=(o-_)/i+2;break;case o:l=(_-n)/i+4}l*=60}return[l,100*u,100*a]}
+ * @see https://github.com/w3c/csswg-drafts/blob/main/css-color-4/better-rgbToHsl.js
+ */function sRGB_to_HSL(t){const n=t[0],_=t[1],o=t[2],e=Math.max(n,_,o),r=Math.min(n,_,o),a=(r+e)/2,i=e-r;let l=NaN,u=0;if(0!==Math.round(1e5*i)){switch(u=0===Math.round(1e5*a)||1e5===Math.round(1e5*a)?0:(e-a)/Math.min(a,1-a),e){case n:l=(_-o)/i+(_<o?6:0);break;case _:l=(o-n)/i+2;break;case o:l=(n-_)/i+4}l*=60}return u<0&&(l+=180,u=Math.abs(u)),l>=360&&(l-=360),[l,100*u,100*a]}
/**
* Convert XYZ to linear-light P3
*
@@ -168,23 +168,23 @@ function lin_sRGB_to_XYZ(t){return multiplyMatrices([[506752/1228815,87881/24576
*
* @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(_){const n=_.map(((_,n)=>_/t[n])).map((t=>t>.008856451679035631?Math.cbrt(t):(903.2962962962963*t+16)/116));return[116*n[1]-16,500*(n[0]-n[1]),200*(n[1]-n[2])]}
+ */function XYZ_to_Lab(n){const _=216/24389,o=24389/27,e=n.map(((n,_)=>n/t[_])).map((t=>t>_?Math.cbrt(t):(o*t+16)/116));return[116*e[1]-16,500*(e[0]-e[1]),200*(e[1]-e[2])]}
/**
* @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 _=multiplyMatrices([[.819022437996703,.3619062600528904,-.1288737815209879],[.0329836539323885,.9292868615863434,.0361446663506424],[.0481771893596242,.2642395317527308,.6335478284694309]],t);return multiplyMatrices([[.210454268309314,.7936177747023054,-.0040720430116193],[1.9779985324311684,-2.42859224204858,.450593709617411],[.0259040424655478,.7827717124575296,-.8086757549230774]],_.map((t=>Math.cbrt(t))))}
+ */function XYZ_to_OKLab(t){const n=multiplyMatrices([[.819022437996703,.3619062600528904,-.1288737815209879],[.0329836539323885,.9292868615863434,.0361446663506424],[.0481771893596242,.2642395317527308,.6335478284694309]],t);return multiplyMatrices([[.210454268309314,.7936177747023054,-.0040720430116193],[1.9779985324311684,-2.42859224204858,.450593709617411],[.0259040424655478,.7827717124575296,-.8086757549230774]],n.map((t=>Math.cbrt(t))))}
/**
* @license W3C https://www.w3.org/Consortium/Legal/2015/copyright-software-and-document
* @copyright This software or document includes material copied from or derived from https://github.com/w3c/csswg-drafts/blob/main/css-color-4/conversions.js. Copyright © 2022 W3C® (MIT, ERCIM, Keio, Beihang).
- */function Lab_to_LCH(t){const _=180*Math.atan2(t[2],t[1])/Math.PI;return[t[0],Math.sqrt(Math.pow(t[1],2)+Math.pow(t[2],2)),_>=0?_:_+360]}
+ */function Lab_to_LCH(t){const n=180*Math.atan2(t[2],t[1])/Math.PI;return[t[0],Math.sqrt(Math.pow(t[1],2)+Math.pow(t[2],2)),n>=0?n:n+360]}
/**
* @license W3C https://www.w3.org/Consortium/Legal/2015/copyright-software-and-document
* @copyright This software or document includes material copied from or derived from https://github.com/w3c/csswg-drafts/blob/main/css-color-4/conversions.js. Copyright © 2022 W3C® (MIT, ERCIM, Keio, Beihang).
* @see https://github.com/w3c/csswg-drafts/blob/main/css-color-4/conversions.js
- */function OKLab_to_OKLCH(t){const _=180*Math.atan2(t[2],t[1])/Math.PI;return[t[0],Math.sqrt(t[1]**2+t[2]**2),_>=0?_:_+360]}
+ */function OKLab_to_OKLCH(t){const n=180*Math.atan2(t[2],t[1])/Math.PI;return[t[0],Math.sqrt(t[1]**2+t[2]**2),n>=0?n:n+360]}
/**
* Convert XYZ to linear-light a98-rgb
*
@@ -198,14 +198,23 @@ function lin_sRGB_to_XYZ(t){return multiplyMatrices([[506752/1228815,87881/24576
* @license W3C https://www.w3.org/Consortium/Legal/2015/copyright-software-and-document
* @copyright This software or document includes material copied from or derived from https://github.com/w3c/csswg-drafts/blob/main/css-color-4/conversions.js. Copyright © 2022 W3C® (MIT, ERCIM, Keio, Beihang).
*/
-function gam_2020(t){const _=1.09929682680944;return t.map((function(t){const n=t<0?-1:1,o=Math.abs(t);return o>.018053968510807?n*(_*Math.pow(o,.45)-(_-1)):4.5*t}))}
+function gam_2020(t){const n=1.09929682680944;return t.map((function(t){const _=t<0?-1:1,o=Math.abs(t);return o>.018053968510807?_*(n*Math.pow(o,.45)-(n-1)):4.5*t}))}
/**
- * Convert XYZ to linear-light prophoto-rgb
+ * 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
- */function sRGB_to_XYZ_D50(t){let _=t;return _=lin_sRGB(_),_=lin_sRGB_to_XYZ(_),_=D65_to_D50(_),_}function XYZ_D50_to_sRGB(t){let _=t;return _=D50_to_D65(_),_=XYZ_to_lin_sRGB(_),_=gam_sRGB(_),_}function HSL_to_XYZ_D50(t){let _=t;return _=HSL_to_sRGB(_),_=lin_sRGB(_),_=lin_sRGB_to_XYZ(_),_=D65_to_D50(_),_}function XYZ_D50_to_HSL(t){let _=t;return _=D50_to_D65(_),_=XYZ_to_lin_sRGB(_),_=gam_sRGB(_),_=sRGB_to_HSL(_),_}function HWB_to_XYZ_D50(t){let _=t;return _=HWB_to_sRGB(_),_=lin_sRGB(_),_=lin_sRGB_to_XYZ(_),_=D65_to_D50(_),_}function XYZ_D50_to_HWB(t){let _=t;_=D50_to_D65(_),_=XYZ_to_lin_sRGB(_);const n=gam_sRGB(_);_=sRGB_to_HSL(n);const o=Math.min(n[0],n[1],n[2]),e=1-Math.max(n[0],n[1],n[2]);return[_[0],100*o,100*e]}function Lab_to_XYZ_D50(t){let _=t;return _=Lab_to_XYZ(_),_}function XYZ_D50_to_Lab(t){let _=t;return _=XYZ_to_Lab(_),_}function LCH_to_XYZ_D50(t){let _=t;var n;return _=[(n=_)[0],n[1]*Math.cos(n[2]*Math.PI/180),n[1]*Math.sin(n[2]*Math.PI/180)],_=Lab_to_XYZ(_),_}function XYZ_D50_to_LCH(t){let _=t;return _=XYZ_to_Lab(_),_=Lab_to_LCH(_),_}function OKLab_to_XYZ_D50(t){let _=t;return _=OKLab_to_XYZ(_),_=D65_to_D50(_),_}function XYZ_D50_to_OKLab(t){let _=t;return _=D50_to_D65(_),_=XYZ_to_OKLab(_),_}function OKLCH_to_XYZ_D50(t){let _=t;return _=OKLCH_to_OKLab(_),_=OKLab_to_XYZ(_),_=D65_to_D50(_),_}function XYZ_D50_to_OKLCH(t){let _=t;return _=D50_to_D65(_),_=XYZ_to_OKLab(_),_=OKLab_to_OKLCH(_),_}function lin_sRGB_to_XYZ_D50(t){let _=t;return _=lin_sRGB_to_XYZ(_),_=D65_to_D50(_),_}function XYZ_D50_to_lin_sRGB(t){let _=t;return _=D50_to_D65(_),_=XYZ_to_lin_sRGB(_),_}function a98_RGB_to_XYZ_D50(t){let _=t;return _=_.map((function(t){const _=t<0?-1:1,n=Math.abs(t);return _*Math.pow(n,563/256)})),_=multiplyMatrices([[573536/994567,263643/1420810,187206/994567],[591459/1989134,6239551/9945670,374412/4972835],[53769/1989134,351524/4972835,4929758/4972835]],_),_=D65_to_D50(_),_}function XYZ_D50_to_a98_RGB(t){let _=t;return _=D50_to_D65(_),_=multiplyMatrices([[1829569/896150,-506331/896150,-308931/896150],[-851781/878810,1648619/878810,36519/878810],[16779/1248040,-147721/1248040,1266979/1248040]],_),_=_.map((function(t){const _=t<0?-1:1,n=Math.abs(t);return _*Math.pow(n,256/563)})),_}function P3_to_XYZ_D50(t){let _=t;return _=lin_P3(_),_=lin_P3_to_XYZ(_),_=D65_to_D50(_),_}function XYZ_D50_to_P3(t){let _=t;return _=D50_to_D65(_),_=XYZ_to_lin_P3(_),_=gam_P3(_),_}function rec_2020_to_XYZ_D50(t){let _=t;return _=lin_2020(_),_=multiplyMatrices([[63426534/99577255,20160776/139408157,47086771/278816314],[26158966/99577255,.677998071518871,8267143/139408157],[0,19567812/697040785,1.0609850577107909]],_),_=D65_to_D50(_),_}function XYZ_D50_to_rec_2020(t){let _=t;return _=D50_to_D65(_),_=multiplyMatrices([[30757411/17917100,-6372589/17917100,-4539589/17917100],[-.666684351832489,1.616481236634939,467509/29648200],[792561/44930125,-1921689/44930125,.942103121235474]],_),_=gam_2020(_),_}function ProPhoto_RGB_to_XYZ_D50(t){let _=t;return _=_.map((function(t){const _=t<0?-1:1,n=Math.abs(t);return n<=.03125?t/16:_*Math.pow(n,1.8)})),_=multiplyMatrices([[.7977604896723027,.13518583717574031,.0313493495815248],[.2880711282292934,.7118432178101014,8565396060525902e-20],[0,0,.8251046025104601]],_),_}function XYZ_D50_to_ProPhoto(t){let _=t;return _=multiplyMatrices([[1.3457989731028281,-.25558010007997534,-.05110628506753401],[-.5446224939028347,1.5082327413132781,.02053603239147973],[0,0,1.2119675456389454]],_),_=_.map((function(t){const _=t<0?-1:1,n=Math.abs(t);return n>=.001953125?_*Math.pow(n,1/1.8):16*t})),_}function XYZ_D65_to_XYZ_D50(t){let _=t;return _=D65_to_D50(_),_}function XYZ_D50_to_XYZ_D65(t){let _=t;return _=D50_to_D65(_),_}function XYZ_D50_to_XYZ_D50(t){return t}function inGamut(t){const[_,n,o]=t;return _>=-1e-4&&_<=1.0001&&n>=-1e-4&&n<=1.0001&&o>=-1e-4&&o<=1.0001}function clip(t){return t.map((t=>t<0?0:t>1?1: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).
+ */
+function gam_ProPhoto(t){const n=1/512;return t.map((function(t){const _=t<0?-1:1,o=Math.abs(t);return o>=n?_*Math.pow(o,1/1.8):16*t}))}function sRGB_to_XYZ_D50(t){let n=t;return n=lin_sRGB(n),n=lin_sRGB_to_XYZ(n),n=D65_to_D50(n),n}function XYZ_D50_to_sRGB(t){let n=t;return n=D50_to_D65(n),n=XYZ_to_lin_sRGB(n),n=gam_sRGB(n),n}function HSL_to_XYZ_D50(t){let n=t;return n=HSL_to_sRGB(n),n=lin_sRGB(n),n=lin_sRGB_to_XYZ(n),n=D65_to_D50(n),n}function XYZ_D50_to_HSL(t){let n=t;return n=D50_to_D65(n),n=XYZ_to_lin_sRGB(n),n=gam_sRGB(n),n=sRGB_to_HSL(n),n}function HWB_to_XYZ_D50(t){let n=t;return n=HWB_to_sRGB(n),n=lin_sRGB(n),n=lin_sRGB_to_XYZ(n),n=D65_to_D50(n),n}function XYZ_D50_to_HWB(t){let n=t;n=D50_to_D65(n),n=XYZ_to_lin_sRGB(n);const _=gam_sRGB(n);n=sRGB_to_HSL(_);const o=Math.min(_[0],_[1],_[2]),e=1-Math.max(_[0],_[1],_[2]);return[n[0],100*o,100*e]}function Lab_to_XYZ_D50(t){let n=t;return n=Lab_to_XYZ(n),n}function XYZ_D50_to_Lab(t){let n=t;return n=XYZ_to_Lab(n),n}function LCH_to_XYZ_D50(t){let n=t;var _;return n=[(_=n)[0],_[1]*Math.cos(_[2]*Math.PI/180),_[1]*Math.sin(_[2]*Math.PI/180)],n=Lab_to_XYZ(n),n}function XYZ_D50_to_LCH(t){let n=t;return n=XYZ_to_Lab(n),n=Lab_to_LCH(n),n}function OKLab_to_XYZ_D50(t){let n=t;return n=OKLab_to_XYZ(n),n=D65_to_D50(n),n}function XYZ_D50_to_OKLab(t){let n=t;return n=D50_to_D65(n),n=XYZ_to_OKLab(n),n}function OKLCH_to_XYZ_D50(t){let n=t;return n=OKLCH_to_OKLab(n),n=OKLab_to_XYZ(n),n=D65_to_D50(n),n}function XYZ_D50_to_OKLCH(t){let n=t;return n=D50_to_D65(n),n=XYZ_to_OKLab(n),n=OKLab_to_OKLCH(n),n}function lin_sRGB_to_XYZ_D50(t){let n=t;return n=lin_sRGB_to_XYZ(n),n=D65_to_D50(n),n}function XYZ_D50_to_lin_sRGB(t){let n=t;return n=D50_to_D65(n),n=XYZ_to_lin_sRGB(n),n}function a98_RGB_to_XYZ_D50(t){let n=t;return n=n.map((function(t){const n=t<0?-1:1,_=Math.abs(t);return n*Math.pow(_,563/256)})),n=multiplyMatrices([[573536/994567,263643/1420810,187206/994567],[591459/1989134,6239551/9945670,374412/4972835],[53769/1989134,351524/4972835,4929758/4972835]],n),n=D65_to_D50(n),n}function XYZ_D50_to_a98_RGB(t){let n=t;return n=D50_to_D65(n),n=multiplyMatrices([[1829569/896150,-506331/896150,-308931/896150],[-851781/878810,1648619/878810,36519/878810],[16779/1248040,-147721/1248040,1266979/1248040]],n),n=n.map((function(t){const n=t<0?-1:1,_=Math.abs(t);return n*Math.pow(_,256/563)})),n}function P3_to_XYZ_D50(t){let n=t;return n=lin_P3(n),n=lin_P3_to_XYZ(n),n=D65_to_D50(n),n}function XYZ_D50_to_P3(t){let n=t;return n=D50_to_D65(n),n=XYZ_to_lin_P3(n),n=gam_P3(n),n}function rec_2020_to_XYZ_D50(t){let n=t;return n=lin_2020(n),n=multiplyMatrices([[63426534/99577255,20160776/139408157,47086771/278816314],[26158966/99577255,.677998071518871,8267143/139408157],[0,19567812/697040785,1.0609850577107909]],n),n=D65_to_D50(n),n}function XYZ_D50_to_rec_2020(t){let n=t;return n=D50_to_D65(n),n=multiplyMatrices([[30757411/17917100,-6372589/17917100,-4539589/17917100],[-.666684351832489,1.616481236634939,467509/29648200],[792561/44930125,-1921689/44930125,.942103121235474]],n),n=gam_2020(n),n}function ProPhoto_RGB_to_XYZ_D50(t){let n=t;return n=n.map((function(t){const n=t<0?-1:1,_=Math.abs(t);return _<=.03125?t/16:n*Math.pow(_,1.8)})),n=multiplyMatrices([[.7977666449006423,.13518129740053308,.0313477341283922],[.2880748288194013,.711835234241873,8993693872564e-17],[0,0,.8251046025104602]],n),n}function XYZ_D50_to_ProPhoto(t){let n=t;return n=multiplyMatrices([[1.3457868816471583,-.25557208737979464,-.05110186497554526],[-.5446307051249019,1.5082477428451468,.02052744743642139],[0,0,1.2119675456389452]],n),n=gam_ProPhoto(n),n}function XYZ_D65_to_XYZ_D50(t){let n=t;return n=D65_to_D50(n),n}function XYZ_D50_to_XYZ_D65(t){let n=t;return n=D50_to_D65(n),n}function XYZ_D50_to_XYZ_D50(t){return t}function inGamut(t){const[n,_,o]=t;return n>=-1e-4&&n<=1.0001&&_>=-1e-4&&_<=1.0001&&o>=-1e-4&&o<=1.0001}function clip(t){return t.map((t=>t<0?0:t>1?1:t))}
/**
* @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
@@ -215,4 +224,7 @@ function gam_2020(t){const _=1.09929682680944;return t.map((function(t){const 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/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,_){const[n,o,e]=t,[r,a,i]=_,l=n-r,u=o-a,c=e-i;return Math.sqrt(l**2+u**2+c**2)}const _=.02,n=1e-5;function binarySearchGamut(t,o,e){const r=t;let a=0,i=r[1];for(;i-a>n;){const t=(a+i)/2;r[1]=t;const n=o(r);if(inGamut(n)){a=t;continue}const l=clip(n);if(deltaEOK(OKLCH_to_OKLab(e(l)),OKLCH_to_OKLab(r))<_)return l;i=t}return clip(o([...r]))}function mapGamut(t,_,n){return binarySearchGamut(t,_,n)}const o={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]};export{HSL_to_XYZ_D50,HWB_to_XYZ_D50,LCH_to_XYZ_D50,Lab_to_XYZ_D50,OKLCH_to_OKLab,OKLCH_to_XYZ_D50,OKLab_to_OKLCH,OKLab_to_XYZ,OKLab_to_XYZ_D50,P3_to_XYZ_D50,ProPhoto_RGB_to_XYZ_D50,XYZ_D50_to_HSL,XYZ_D50_to_HWB,XYZ_D50_to_LCH,XYZ_D50_to_Lab,XYZ_D50_to_OKLCH,XYZ_D50_to_OKLab,XYZ_D50_to_P3,XYZ_D50_to_ProPhoto,XYZ_D50_to_XYZ_D50,XYZ_D50_to_XYZ_D65,XYZ_D50_to_a98_RGB,XYZ_D50_to_lin_sRGB,XYZ_D50_to_rec_2020,XYZ_D50_to_sRGB,XYZ_D65_to_XYZ_D50,XYZ_to_OKLab,XYZ_to_lin_P3,XYZ_to_lin_sRGB,a98_RGB_to_XYZ_D50,clip,gam_P3,gam_sRGB,inGamut,lin_P3,lin_P3_to_XYZ,lin_sRGB,lin_sRGB_to_XYZ,lin_sRGB_to_XYZ_D50,mapGamut,o as namedColors,rec_2020_to_XYZ_D50,sRGB_to_XYZ_D50};
+ */function deltaEOK(t,n){const[_,o,e]=t,[r,a,i]=n,l=_-r,u=o-a,c=e-i;return Math.sqrt(l**2+u**2+c**2)}const n=.02,_=1e-4;function mapGamut(t,o,e){const r=t;let a=clip(o(r)),i=deltaEOK(OKLCH_to_OKLab(e(a)),OKLCH_to_OKLab(r));if(i<n)return a;let l=0,u=r[1],c=!0;for(;u-l>_;){const t=(l+u)/2;if(r[1]=t,c&&inGamut(o(r)))l=t;else if(a=clip(o(r)),i=deltaEOK(OKLCH_to_OKLab(e(a)),OKLCH_to_OKLab(r)),i<n){if(n-i<_)return a;c=!1,l=t}else u=t}return clip(o([...r]))}
+/**
+ * @license MIT https://github.com/facelessuser/coloraide/blob/main/LICENSE.md
+ */function mapGamutRayTrace(t,n,_){const o=t[0],e=t[2];let r=n(t);const a=n([o,0,e]);for(let t=0;t<4;t++){if(t>0){const t=_(r);t[0]=o,t[2]=e,r=n(t)}const i=rayTraceBox(a,r.slice());if(!i)break;r=i.slice()}return clip(r)}function rayTraceBox(t,n){let _=1/0,o=-1/0;const e=[];for(let r=0;r<3;r++){const a=t[r],i=n[r]-a;e.push(i);const l=0,u=1;if(i){const t=1/i,n=(l-a)*t,e=(u-a)*t;o=Math.max(Math.min(n,e),o),_=Math.min(Math.max(n,e),_)}else if(a<l||a>u)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 o={aliceblue:[240,248,255],antiquewhite:[250,235,215],aqua:[0,255,255],aquamarine:[127,255,212],azure:[240,255,255],beige:[245,245,220],bisque:[255,228,196],black:[0,0,0],blanchedalmond:[255,235,205],blue:[0,0,255],blueviolet:[138,43,226],brown:[165,42,42],burlywood:[222,184,135],cadetblue:[95,158,160],chartreuse:[127,255,0],chocolate:[210,105,30],coral:[255,127,80],cornflowerblue:[100,149,237],cornsilk:[255,248,220],crimson:[220,20,60],cyan:[0,255,255],darkblue:[0,0,139],darkcyan:[0,139,139],darkgoldenrod:[184,134,11],darkgray:[169,169,169],darkgreen:[0,100,0],darkgrey:[169,169,169],darkkhaki:[189,183,107],darkmagenta:[139,0,139],darkolivegreen:[85,107,47],darkorange:[255,140,0],darkorchid:[153,50,204],darkred:[139,0,0],darksalmon:[233,150,122],darkseagreen:[143,188,143],darkslateblue:[72,61,139],darkslategray:[47,79,79],darkslategrey:[47,79,79],darkturquoise:[0,206,209],darkviolet:[148,0,211],deeppink:[255,20,147],deepskyblue:[0,191,255],dimgray:[105,105,105],dimgrey:[105,105,105],dodgerblue:[30,144,255],firebrick:[178,34,34],floralwhite:[255,250,240],forestgreen:[34,139,34],fuchsia:[255,0,255],gainsboro:[220,220,220],ghostwhite:[248,248,255],gold:[255,215,0],goldenrod:[218,165,32],gray:[128,128,128],green:[0,128,0],greenyellow:[173,255,47],grey:[128,128,128],honeydew:[240,255,240],hotpink:[255,105,180],indianred:[205,92,92],indigo:[75,0,130],ivory:[255,255,240],khaki:[240,230,140],lavender:[230,230,250],lavenderblush:[255,240,245],lawngreen:[124,252,0],lemonchiffon:[255,250,205],lightblue:[173,216,230],lightcoral:[240,128,128],lightcyan:[224,255,255],lightgoldenrodyellow:[250,250,210],lightgray:[211,211,211],lightgreen:[144,238,144],lightgrey:[211,211,211],lightpink:[255,182,193],lightsalmon:[255,160,122],lightseagreen:[32,178,170],lightskyblue:[135,206,250],lightslategray:[119,136,153],lightslategrey:[119,136,153],lightsteelblue:[176,196,222],lightyellow:[255,255,224],lime:[0,255,0],limegreen:[50,205,50],linen:[250,240,230],magenta:[255,0,255],maroon:[128,0,0],mediumaquamarine:[102,205,170],mediumblue:[0,0,205],mediumorchid:[186,85,211],mediumpurple:[147,112,219],mediumseagreen:[60,179,113],mediumslateblue:[123,104,238],mediumspringgreen:[0,250,154],mediumturquoise:[72,209,204],mediumvioletred:[199,21,133],midnightblue:[25,25,112],mintcream:[245,255,250],mistyrose:[255,228,225],moccasin:[255,228,181],navajowhite:[255,222,173],navy:[0,0,128],oldlace:[253,245,230],olive:[128,128,0],olivedrab:[107,142,35],orange:[255,165,0],orangered:[255,69,0],orchid:[218,112,214],palegoldenrod:[238,232,170],palegreen:[152,251,152],paleturquoise:[175,238,238],palevioletred:[219,112,147],papayawhip:[255,239,213],peachpuff:[255,218,185],peru:[205,133,63],pink:[255,192,203],plum:[221,160,221],powderblue:[176,224,230],purple:[128,0,128],rebeccapurple:[102,51,153],red:[255,0,0],rosybrown:[188,143,143],royalblue:[65,105,225],saddlebrown:[139,69,19],salmon:[250,128,114],sandybrown:[244,164,96],seagreen:[46,139,87],seashell:[255,245,238],sienna:[160,82,45],silver:[192,192,192],skyblue:[135,206,235],slateblue:[106,90,205],slategray:[112,128,144],slategrey:[112,128,144],snow:[255,250,250],springgreen:[0,255,127],steelblue:[70,130,180],tan:[210,180,140],teal:[0,128,128],thistle:[216,191,216],tomato:[255,99,71],turquoise:[64,224,208],violet:[238,130,238],wheat:[245,222,179],white:[255,255,255],whitesmoke:[245,245,245],yellow:[255,255,0],yellowgreen:[154,205,50]};function luminance(t){const[n,_,o]=t.map((t=>t<=.03928?t/12.92:Math.pow((t+.055)/1.055,2.4)));return.2126*n+.7152*_+.0722*o}function contrast_ratio_wcag_2_1(t,n){const _=luminance(t),o=luminance(n);return(Math.max(_,o)+.05)/(Math.min(_,o)+.05)}export{HSL_to_XYZ_D50,HWB_to_XYZ_D50,LCH_to_XYZ_D50,Lab_to_XYZ_D50,OKLCH_to_OKLab,OKLCH_to_XYZ_D50,OKLab_to_OKLCH,OKLab_to_XYZ,OKLab_to_XYZ_D50,P3_to_XYZ_D50,ProPhoto_RGB_to_XYZ_D50,XYZ_D50_to_HSL,XYZ_D50_to_HWB,XYZ_D50_to_LCH,XYZ_D50_to_Lab,XYZ_D50_to_OKLCH,XYZ_D50_to_OKLab,XYZ_D50_to_P3,XYZ_D50_to_ProPhoto,XYZ_D50_to_XYZ_D50,XYZ_D50_to_XYZ_D65,XYZ_D50_to_a98_RGB,XYZ_D50_to_lin_sRGB,XYZ_D50_to_rec_2020,XYZ_D50_to_sRGB,XYZ_D65_to_XYZ_D50,XYZ_to_OKLab,XYZ_to_lin_P3,XYZ_to_lin_sRGB,a98_RGB_to_XYZ_D50,clip,contrast_ratio_wcag_2_1,gam_P3,gam_sRGB,inGamut,lin_P3,lin_P3_to_XYZ,lin_sRGB,lin_sRGB_to_XYZ,lin_sRGB_to_XYZ_D50,mapGamut,mapGamutRayTrace,o 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
index 49ccca2e..ad5eb15c 100644
--- a/node_modules/@csstools/color-helpers/package.json
+++ b/node_modules/@csstools/color-helpers/package.json
@@ -1,7 +1,7 @@
{
"name": "@csstools/color-helpers",
"description": "Color helpers to ease transformation between formats, gamut, etc",
- "version": "4.0.0",
+ "version": "4.2.0",
"contributors": [
{
"name": "Antonio Laguna",
@@ -50,7 +50,7 @@
"homepage": "https://github.com/csstools/postcss-plugins/tree/main/packages/color-helpers#readme",
"repository": {
"type": "git",
- "url": "https://github.com/csstools/postcss-plugins.git",
+ "url": "git+https://github.com/csstools/postcss-plugins.git",
"directory": "packages/color-helpers"
},
"bugs": "https://github.com/csstools/postcss-plugins/issues",
diff --git a/node_modules/@csstools/css-calc/CHANGELOG.md b/node_modules/@csstools/css-calc/CHANGELOG.md
index ab4a1177..098f6556 100644
--- a/node_modules/@csstools/css-calc/CHANGELOG.md
+++ b/node_modules/@csstools/css-calc/CHANGELOG.md
@@ -1,25 +1,29 @@
# Changes to CSS Calc
-### 1.1.6
+### 1.2.2
-_December 31, 2023_
+_May 4, 2024_
-- Updated [`@csstools/css-tokenizer`](https://github.com/csstools/postcss-plugins/tree/main/packages/css-tokenizer) to [`2.2.3`](https://github.com/csstools/postcss-plugins/tree/main/packages/css-tokenizer/CHANGELOG.md#223) (patch)
-- Updated [`@csstools/css-parser-algorithms`](https://github.com/csstools/postcss-plugins/tree/main/packages/css-parser-algorithms) to [`2.5.0`](https://github.com/csstools/postcss-plugins/tree/main/packages/css-parser-algorithms/CHANGELOG.md#250) (minor)
+- Updated [`@csstools/css-tokenizer`](https://github.com/csstools/postcss-plugins/tree/main/packages/css-tokenizer) to [`2.3.1`](https://github.com/csstools/postcss-plugins/tree/main/packages/css-tokenizer/CHANGELOG.md#231) (patch)
+- Updated [`@csstools/css-parser-algorithms`](https://github.com/csstools/postcss-plugins/tree/main/packages/css-parser-algorithms) to [`2.6.3`](https://github.com/csstools/postcss-plugins/tree/main/packages/css-parser-algorithms/CHANGELOG.md#263) (patch)
-### 1.1.5
+### 1.2.1
-_December 15, 2023_
+_May 4, 2024_
-- Fix type definitions
-- Updated [`@csstools/css-tokenizer`](https://github.com/csstools/postcss-plugins/tree/main/packages/css-tokenizer) to [`2.2.2`](https://github.com/csstools/postcss-plugins/tree/main/packages/css-tokenizer/CHANGELOG.md#222) (patch)
-- Updated [`@csstools/css-parser-algorithms`](https://github.com/csstools/postcss-plugins/tree/main/packages/css-parser-algorithms) to [`2.4.0`](https://github.com/csstools/postcss-plugins/tree/main/packages/css-parser-algorithms/CHANGELOG.md#240) (minor)
+- Allow uncapped precision in `calc()` serialization
+- Add `censorIntoStandardRepresentableValues` conversion option
+- Updated [`@csstools/css-tokenizer`](https://github.com/csstools/postcss-plugins/tree/main/packages/css-tokenizer) to [`2.3.0`](https://github.com/csstools/postcss-plugins/tree/main/packages/css-tokenizer/CHANGELOG.md#230) (minor)
+- Updated [`@csstools/css-parser-algorithms`](https://github.com/csstools/postcss-plugins/tree/main/packages/css-parser-algorithms) to [`2.6.2`](https://github.com/csstools/postcss-plugins/tree/main/packages/css-parser-algorithms/CHANGELOG.md#262) (patch)
-### 1.1.4
+### 1.2.0
-_September 24, 2023_
+_March 13, 2024_
-- Updated [`@csstools/css-tokenizer`](https://github.com/csstools/postcss-plugins/tree/main/packages/css-tokenizer) to [`2.2.1`](https://github.com/csstools/postcss-plugins/tree/main/packages/css-tokenizer/CHANGELOG.md#221) (patch)
-- Updated [`@csstools/css-parser-algorithms`](https://github.com/csstools/postcss-plugins/tree/main/packages/css-parser-algorithms) to [`2.3.2`](https://github.com/csstools/postcss-plugins/tree/main/packages/css-parser-algorithms/CHANGELOG.md#232) (patch)
+- Correctly serialize negative zero `-0` values
+- Add support for `round()` with only a single number argument
+- Add support for `none` in `clamp()`
+- Updated [`@csstools/css-tokenizer`](https://github.com/csstools/postcss-plugins/tree/main/packages/css-tokenizer) to [`2.2.4`](https://github.com/csstools/postcss-plugins/tree/main/packages/css-tokenizer/CHANGELOG.md#224) (patch)
+- Updated [`@csstools/css-parser-algorithms`](https://github.com/csstools/postcss-plugins/tree/main/packages/css-parser-algorithms) to [`2.6.1`](https://github.com/csstools/postcss-plugins/tree/main/packages/css-parser-algorithms/CHANGELOG.md#261) (patch)
[Full CHANGELOG](https://github.com/csstools/postcss-plugins/tree/main/packages/css-calc/CHANGELOG.md)
diff --git a/node_modules/@csstools/css-calc/dist/index.cjs b/node_modules/@csstools/css-calc/dist/index.cjs
index 496da279..ad3bf8ed 100644
--- a/node_modules/@csstools/css-calc/dist/index.cjs
+++ b/node_modules/@csstools/css-calc/dist/index.cjs
@@ -1 +1 @@
-"use strict";var e=require("@csstools/css-parser-algorithms"),n=require("@csstools/css-tokenizer");const o=/[A-Z]/g;function toLowerCaseAZ(e){return e.replace(o,(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"},r=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]]),u=new Map([["deg",e=>e],["grad",e=>e/.9],["rad",e=>e/180*Math.PI],["turn",e=>e/360]]),i=new Map([["deg",e=>.9*e],["grad",e=>e],["rad",e=>.9*e/180*Math.PI],["turn",e=>.9*e/360]]),a=new Map([["hz",e=>e],["khz",e=>e/1e3]]),l=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]]),s=new Map([["hz",e=>1e3*e],["khz",e=>e]]),c=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]]),T=new Map([["ms",e=>e],["s",e=>e/1e3]]),p=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]]),v=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]]),m=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]]),N=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]]),f=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]]),y=new Map([["ms",e=>1e3*e],["s",e=>e]]),k=new Map([["deg",e=>360*e],["grad",e=>360*e/.9],["rad",e=>360*e/180*Math.PI],["turn",e=>e]]),d=new Map([["cm",r],["mm",c],["q",N],["in",l],["pc",p],["pt",v],["px",m],["ms",T],["s",y],["deg",u],["grad",i],["rad",f],["turn",k],["hz",a],["khz",s]]);function convertUnit(e,o){if(e[0]!==n.TokenType.Dimension)return o;if(o[0]!==n.TokenType.Dimension)return o;const t=toLowerCaseAZ(e[4].unit),r=toLowerCaseAZ(o[4].unit);if(t===r)return o;const u=d.get(r);if(!u)return o;const i=u.get(t);if(!i)return o;const a=i(o[4].value);return[n.TokenType.Dimension,a.toString()+e[4].unit,o[2],o[3],{value:a,unit:e[4].unit,type:Number.isInteger(a)?n.NumberType.Integer:n.NumberType.Number}]}function toCanonicalUnit(e){if(e[0]!==n.TokenType.Dimension)return e;const o=toLowerCaseAZ(e[4].unit),r=t[o];if(o===r)return e;const u=d.get(o);if(!u)return e;const i=u.get(r);if(!i)return e;const a=i(e[4].value);return[n.TokenType.Dimension,a.toString()+r,e[2],e[3],{value:a,unit:r,type:Number.isInteger(a)?n.NumberType.Integer:n.NumberType.Number}]}function addition(o){if(2!==o.length)return-1;const t=o[0].value;let r=o[1].value;if(t[0]===n.TokenType.Number&&r[0]===n.TokenType.Number){const o=t[4].value+r[4].value;return new e.TokenNode([n.TokenType.Number,o.toString(),t[2],r[3],{value:o,type:t[4].type===n.NumberType.Integer&&r[4].type===n.NumberType.Integer?n.NumberType.Integer:n.NumberType.Number}])}if(t[0]===n.TokenType.Percentage&&r[0]===n.TokenType.Percentage){const o=t[4].value+r[4].value;return new e.TokenNode([n.TokenType.Percentage,o.toString()+"%",t[2],r[3],{value:o}])}if(t[0]===n.TokenType.Dimension&&r[0]===n.TokenType.Dimension&&(r=convertUnit(t,r),toLowerCaseAZ(t[4].unit)===toLowerCaseAZ(r[4].unit))){const o=t[4].value+r[4].value;return new e.TokenNode([n.TokenType.Dimension,o.toString()+t[4].unit,t[2],r[3],{value:o,type:t[4].type===n.NumberType.Integer&&r[4].type===n.NumberType.Integer?n.NumberType.Integer:n.NumberType.Number,unit:t[4].unit}])}return-1}function division(o){if(2!==o.length)return-1;const t=o[0].value,r=o[1].value;if(t[0]===n.TokenType.Number&&r[0]===n.TokenType.Number){const o=t[4].value/r[4].value;return new e.TokenNode([n.TokenType.Number,o.toString(),t[2],r[3],{value:o,type:Number.isInteger(o)?n.NumberType.Integer:n.NumberType.Number}])}if(t[0]===n.TokenType.Percentage&&r[0]===n.TokenType.Number){const o=t[4].value/r[4].value;return new e.TokenNode([n.TokenType.Percentage,o.toString()+"%",t[2],r[3],{value:o}])}if(t[0]===n.TokenType.Dimension&&r[0]===n.TokenType.Number){const o=t[4].value/r[4].value;return new e.TokenNode([n.TokenType.Dimension,o.toString()+t[4].unit,t[2],r[3],{value:o,type:Number.isInteger(o)?n.NumberType.Integer:n.NumberType.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(n){if(-1===n)return-1;const o=[];for(let t=0;t<n.inputs.length;t++){const r=n.inputs[t];if(e.isTokenNode(r)){o.push(r);continue}const u=solve(r);if(-1===u)return-1;o.push(u)}return n.operation(o)}function multiplication(o){if(2!==o.length)return-1;const t=o[0].value,r=o[1].value;if(t[0]===n.TokenType.Number&&r[0]===n.TokenType.Number){const o=t[4].value*r[4].value;return new e.TokenNode([n.TokenType.Number,o.toString(),t[2],r[3],{value:o,type:t[4].type===n.NumberType.Integer&&r[4].type===n.NumberType.Integer?n.NumberType.Integer:n.NumberType.Number}])}if(t[0]===n.TokenType.Percentage&&r[0]===n.TokenType.Number){const o=t[4].value*r[4].value;return new e.TokenNode([n.TokenType.Percentage,o.toString()+"%",t[2],r[3],{value:o}])}if(t[0]===n.TokenType.Number&&r[0]===n.TokenType.Percentage){const o=t[4].value*r[4].value;return new e.TokenNode([n.TokenType.Percentage,o.toString()+"%",t[2],r[3],{value:o}])}if(t[0]===n.TokenType.Dimension&&r[0]===n.TokenType.Number){const o=t[4].value*r[4].value;return new e.TokenNode([n.TokenType.Dimension,o.toString()+t[4].unit,t[2],r[3],{value:o,type:t[4].type===n.NumberType.Integer&&r[4].type===n.NumberType.Integer?n.NumberType.Integer:n.NumberType.Number,unit:t[4].unit}])}if(t[0]===n.TokenType.Number&&r[0]===n.TokenType.Dimension){const o=t[4].value*r[4].value;return new e.TokenNode([n.TokenType.Dimension,o.toString()+r[4].unit,t[2],r[3],{value:o,type:t[4].type===n.NumberType.Integer&&r[4].type===n.NumberType.Integer?n.NumberType.Integer:n.NumberType.Number,unit:r[4].unit}])}return-1}function resolveGlobalsAndConstants(o,t){for(let r=0;r<o.length;r++){const u=o[r];if(!e.isTokenNode(u))continue;const i=u.value;if(i[0]!==n.TokenType.Ident)continue;const a=toLowerCaseAZ(i[4].value);switch(a){case"e":o.splice(r,1,new e.TokenNode([n.TokenType.Number,Math.E.toString(),i[2],i[3],{value:Math.E,type:n.NumberType.Number}]));break;case"pi":o.splice(r,1,new e.TokenNode([n.TokenType.Number,Math.PI.toString(),i[2],i[3],{value:Math.PI,type:n.NumberType.Number}]));break;case"infinity":o.splice(r,1,new e.TokenNode([n.TokenType.Number,"infinity",i[2],i[3],{value:1/0,type:n.NumberType.Number}]));break;case"-infinity":o.splice(r,1,new e.TokenNode([n.TokenType.Number,"-infinity",i[2],i[3],{value:-1/0,type:n.NumberType.Number}]));break;case"nan":o.splice(r,1,new e.TokenNode([n.TokenType.Number,"NaN",i[2],i[3],{value:Number.NaN,type:n.NumberType.Number}]));break;default:if(t.has(a)){const n=t.get(a);o.splice(r,1,new e.TokenNode(n))}}}return o}function isNumeric(e){return e[0]===n.TokenType.Dimension||(e[0]===n.TokenType.Percentage||e[0]===n.TokenType.Number)}function isDimensionOrNumber(e){return e[0]===n.TokenType.Dimension||e[0]===n.TokenType.Number}function arrayOfSameNumeric(e){if(0===e.length)return!0;const o=e[0];if(!isNumeric(o))return!1;if(1===e.length)return!0;if(o[0]===n.TokenType.Dimension){const n=toLowerCaseAZ(o[4].unit);for(let t=1;t<e.length;t++){const r=e[t];if(o[0]!==r[0])return!1;if(n!==toLowerCaseAZ(r[4].unit))return!1}return!0}for(let n=1;n<e.length;n++){const t=e[n];if(o[0]!==t[0])return!1}return!0}function twoOfSameNumeric(e,o){return!!isNumeric(e)&&(e[0]===n.TokenType.Dimension?e[0]===o[0]&&toLowerCaseAZ(e[4].unit)===toLowerCaseAZ(o[4].unit):e[0]===o[0])}function unary(e){if(1!==e.length)return-1;return isNumeric(e[0].value)?e[0]:-1}function resultToCalculation(e,o,t){return o[0]===n.TokenType.Dimension?dimensionToCalculation(e,o[4].unit,t):o[0]===n.TokenType.Percentage?percentageToCalculation(e,t):o[0]===n.TokenType.Number?numberToCalculation(e,t):-1}function dimensionToCalculation(o,t,r){const u=o.tokens();return{inputs:[new e.TokenNode([n.TokenType.Dimension,r.toString()+t,u[0][2],u[u.length-1][3],{value:r,type:Number.isInteger(r)?n.NumberType.Integer:n.NumberType.Number,unit:t}])],operation:unary}}function percentageToCalculation(o,t){const r=o.tokens();return{inputs:[new e.TokenNode([n.TokenType.Percentage,t.toString()+"%",r[0][2],r[r.length-1][3],{value:t}])],operation:unary}}function numberToCalculation(o,t){const r=o.tokens();return{inputs:[new e.TokenNode([n.TokenType.Number,t.toString(),r[0][2],r[r.length-1][3],{value:t,type:Number.isInteger(t)?n.NumberType.Integer:n.NumberType.Number}])],operation:unary}}function solveACos(e,o){const t=o.value;if(t[0]!==n.TokenType.Number)return-1;return dimensionToCalculation(e,"rad",Math.acos(t[4].value))}function solveASin(e,o){const t=o.value;if(t[0]!==n.TokenType.Number)return-1;return dimensionToCalculation(e,"rad",Math.asin(t[4].value))}function solveATan(e,o){const t=o.value;if(t[0]!==n.TokenType.Number)return-1;return dimensionToCalculation(e,"rad",Math.atan(t[4].value))}function solveATan2(e,n,o){const t=n.value;if(!isDimensionOrNumber(t))return-1;const r=convertUnit(t,o.value);if(!twoOfSameNumeric(t,r))return-1;return dimensionToCalculation(e,"rad",Math.atan2(t[4].value,r[4].value))}function solveAbs(e,n){const o=n.value;if(!isDimensionOrNumber(o))return-1;return resultToCalculation(e,o,Math.abs(o[4].value))}function solveClamp(n,o,t,r){if(!e.isTokenNode(o)||!e.isTokenNode(t)||!e.isTokenNode(r))return-1;const u=o.value;if(!isNumeric(u))return-1;const i=convertUnit(u,t.value);if(!twoOfSameNumeric(u,i))return-1;const a=convertUnit(u,r.value);if(!twoOfSameNumeric(u,a))return-1;return resultToCalculation(n,u,Math.max(u[4].value,Math.min(i[4].value,a[4].value)))}function solveCos(e,o){const t=o.value;if(!isDimensionOrNumber(t))return-1;let r=t[4].value;if(t[0]===n.TokenType.Dimension)switch(toLowerCaseAZ(t[4].unit)){case"rad":break;case"deg":r=u.get("rad")(t[4].value);break;case"grad":r=i.get("rad")(t[4].value);break;case"turn":r=k.get("rad")(t[4].value);break;default:return-1}return r=Math.cos(r),numberToCalculation(e,r)}function solveExp(e,o){const t=o.value;if(t[0]!==n.TokenType.Number)return-1;return numberToCalculation(e,Math.exp(t[4].value))}function solveHypot(n,o){const t=o[0];if(!t||!e.isTokenNode(t))return-1;if(1!==new Set(o.map((e=>e.type))).size)return-1;const r=t.value;if(!isNumeric(r))return-1;const u=o.map((e=>convertUnit(r,e.value)));if(!arrayOfSameNumeric(u))return-1;const i=u.map((e=>e[4].value)),a=Math.hypot(...i);return resultToCalculation(n,r,a)}function solveMax(n,o){const t=o[0];if(!t||!e.isTokenNode(t))return-1;if(1!==new Set(o.map((e=>e.type))).size)return-1;const r=t.value;if(!isNumeric(r))return-1;const u=o.map((e=>convertUnit(r,e.value)));if(!arrayOfSameNumeric(u))return-1;const i=u.map((e=>e[4].value)),a=Math.max(...i);return resultToCalculation(n,r,a)}function solveMin(n,o){const t=o[0];if(!t||!e.isTokenNode(t))return-1;if(1!==new Set(o.map((e=>e.type))).size)return-1;const r=t.value;if(!isNumeric(r))return-1;const u=o.map((e=>convertUnit(r,e.value)));if(!arrayOfSameNumeric(u))return-1;const i=u.map((e=>e[4].value)),a=Math.min(...i);return resultToCalculation(n,r,a)}function solveMod(e,n,o){const t=n.value;if(!isNumeric(t))return-1;const r=convertUnit(t,o.value);if(!twoOfSameNumeric(t,r))return-1;let u;return u=0===r[4].value?Number.NaN:Number.isFinite(t[4].value)&&(Number.isFinite(r[4].value)||(r[4].value!==Number.POSITIVE_INFINITY||t[4].value!==Number.NEGATIVE_INFINITY&&!Object.is(0*t[4].value,-0))&&(r[4].value!==Number.NEGATIVE_INFINITY||t[4].value!==Number.POSITIVE_INFINITY&&!Object.is(0*t[4].value,0)))?Number.isFinite(r[4].value)?(t[4].value%r[4].value+r[4].value)%r[4].value:t[4].value:Number.NaN,resultToCalculation(e,t,u)}function solvePow(e,o,t){const r=o.value,u=t.value;if(r[0]!==n.TokenType.Number)return-1;if(!twoOfSameNumeric(r,u))return-1;return numberToCalculation(e,Math.pow(r[4].value,u[4].value))}function solveRem(e,n,o){const t=n.value;if(!isNumeric(t))return-1;const r=convertUnit(t,o.value);if(!twoOfSameNumeric(t,r))return-1;let u;return u=0===r[4].value?Number.NaN:Number.isFinite(t[4].value)?Number.isFinite(r[4].value)?t[4].value%r[4].value:t[4].value:Number.NaN,resultToCalculation(e,t,u)}function solveRound(e,n,o,t){const r=o.value;if(!isNumeric(r))return-1;const u=convertUnit(r,t.value);if(!twoOfSameNumeric(r,u))return-1;let i;if(0===u[4].value)i=Number.NaN;else if(Number.isFinite(r[4].value)||Number.isFinite(u[4].value))if(!Number.isFinite(r[4].value)&&Number.isFinite(u[4].value))i=r[4].value;else if(Number.isFinite(r[4].value)&&!Number.isFinite(u[4].value))switch(n){case"down":i=r[4].value<0?-1/0:Object.is(-0,0*r[4].value)?-0:0;break;case"up":i=r[4].value>0?1/0:Object.is(0,0*r[4].value)?0:-0;break;default:i=Object.is(0,0*r[4].value)?0:-0}else if(Number.isFinite(u[4].value))switch(n){case"down":i=Math.floor(r[4].value/u[4].value)*u[4].value;break;case"up":i=Math.ceil(r[4].value/u[4].value)*u[4].value;break;case"to-zero":i=Math.trunc(r[4].value/u[4].value)*u[4].value;break;default:{let e=Math.floor(r[4].value/u[4].value)*u[4].value,n=Math.ceil(r[4].value/u[4].value)*u[4].value;if(e>n){const o=e;e=n,n=o}const o=Math.abs(r[4].value-e),t=Math.abs(r[4].value-n);i=o===t?n:o<t?e:n;break}}else i=r[4].value;else i=Number.NaN;return resultToCalculation(e,r,i)}function solveSign(e,n){const o=n.value;if(!isDimensionOrNumber(o))return-1;return numberToCalculation(e,Math.sign(o[4].value))}function solveSin(e,o){const t=o.value;if(!isDimensionOrNumber(t))return-1;let r=t[4].value;if(t[0]===n.TokenType.Dimension)switch(toLowerCaseAZ(t[4].unit)){case"rad":break;case"deg":r=u.get("rad")(t[4].value);break;case"grad":r=i.get("rad")(t[4].value);break;case"turn":r=k.get("rad")(t[4].value);break;default:return-1}return r=Math.sin(r),numberToCalculation(e,r)}function solveSqrt(e,o){const t=o.value;if(t[0]!==n.TokenType.Number)return-1;return numberToCalculation(e,Math.sqrt(t[4].value))}function solveTan(e,o){const t=o.value;if(!isDimensionOrNumber(t))return-1;const r=t[4].value;let a=0,l=t[4].value;if(t[0]===n.TokenType.Dimension)switch(toLowerCaseAZ(t[4].unit)){case"rad":a=f.get("deg")(r);break;case"deg":a=r,l=u.get("rad")(r);break;case"grad":a=i.get("deg")(r),l=i.get("rad")(r);break;case"turn":a=k.get("deg")(r),l=k.get("rad")(r);break;default:return-1}const s=a/90;return l=a%90==0&&s%2!=0?s>0?1/0:-1/0:Math.tan(l),numberToCalculation(e,l)}function subtraction(o){if(2!==o.length)return-1;const t=o[0].value;let r=o[1].value;if(t[0]===n.TokenType.Number&&r[0]===n.TokenType.Number){const o=t[4].value-r[4].value;return new e.TokenNode([n.TokenType.Number,o.toString(),t[2],r[3],{value:o,type:t[4].type===n.NumberType.Integer&&r[4].type===n.NumberType.Integer?n.NumberType.Integer:n.NumberType.Number}])}if(t[0]===n.TokenType.Percentage&&r[0]===n.TokenType.Percentage){const o=t[4].value-r[4].value;return new e.TokenNode([n.TokenType.Percentage,o.toString()+"%",t[2],r[3],{value:o}])}if(t[0]===n.TokenType.Dimension&&r[0]===n.TokenType.Dimension&&(r=convertUnit(t,r),toLowerCaseAZ(t[4].unit)===toLowerCaseAZ(r[4].unit))){const o=t[4].value-r[4].value;return new e.TokenNode([n.TokenType.Dimension,o.toString()+t[4].unit,t[2],r[3],{value:o,type:t[4].type===n.NumberType.Integer&&r[4].type===n.NumberType.Integer?n.NumberType.Integer:n.NumberType.Number,unit:t[4].unit}])}return-1}function solveLog(o,t){if(1===t.length){const r=t[0];if(!r||!e.isTokenNode(r))return-1;const u=r.value;if(u[0]!==n.TokenType.Number)return-1;return numberToCalculation(o,Math.log(u[4].value))}if(2===t.length){const r=t[0];if(!r||!e.isTokenNode(r))return-1;const u=r.value;if(u[0]!==n.TokenType.Number)return-1;const i=t[1];if(!i||!e.isTokenNode(i))return-1;const a=i.value;if(a[0]!==n.TokenType.Number)return-1;return numberToCalculation(o,Math.log(u[4].value)/Math.log(a[4].value))}return-1}const b=new Map([["abs",function abs(e,n){return singleNodeSolver(e,n,solveAbs)}],["acos",function acos(e,n){return singleNodeSolver(e,n,solveACos)}],["asin",function asin(e,n){return singleNodeSolver(e,n,solveASin)}],["atan",function atan(e,n){return singleNodeSolver(e,n,solveATan)}],["atan2",function atan2(e,n){return twoCommaSeparatedNodesSolver(e,n,solveATan2)}],["calc",calc$1],["clamp",function clamp(o,t){const r=resolveGlobalsAndConstants([...o.value.filter((n=>!e.isCommentNode(n)&&!e.isWhitespaceNode(n)))],t),u=[],i=[],a=[];{let o=u;for(let t=0;t<r.length;t++){const l=r[t];if(e.isTokenNode(l)&&l.value[0]===n.TokenType.Comma){if(o===a)return-1;if(o===i){o=a;continue}if(o===u){o=i;continue}return-1}o.push(l)}}const l=solve(calc$1(new e.FunctionNode([n.TokenType.Function,"calc(",-1,-1,{value:"calc"}],[n.TokenType.CloseParen,")",-1,-1,void 0],u),t));if(-1===l)return-1;const s=solve(calc$1(new e.FunctionNode([n.TokenType.Function,"calc(",-1,-1,{value:"calc"}],[n.TokenType.CloseParen,")",-1,-1,void 0],i),t));if(-1===s)return-1;const c=solve(calc$1(new e.FunctionNode([n.TokenType.Function,"calc(",-1,-1,{value:"calc"}],[n.TokenType.CloseParen,")",-1,-1,void 0],a),t));if(-1===c)return-1;return solveClamp(o,l,s,c)}],["cos",function cos(e,n){return singleNodeSolver(e,n,solveCos)}],["exp",function exp(e,n){return singleNodeSolver(e,n,solveExp)}],["hypot",function hypot(e,n){return variadicNodesSolver(e,n,solveHypot)}],["log",function log(e,n){return variadicNodesSolver(e,n,solveLog)}],["max",function max(e,n){return variadicNodesSolver(e,n,solveMax)}],["min",function min(e,n){return variadicNodesSolver(e,n,solveMin)}],["mod",function mod(e,n){return twoCommaSeparatedNodesSolver(e,n,solveMod)}],["pow",function pow(e,n){return twoCommaSeparatedNodesSolver(e,n,solvePow)}],["rem",function rem(e,n){return twoCommaSeparatedNodesSolver(e,n,solveRem)}],["round",function round(o,t){const r=resolveGlobalsAndConstants([...o.value.filter((n=>!e.isCommentNode(n)&&!e.isWhitespaceNode(n)))],t);let u="";const i=[],a=[];{let o=i;for(let t=0;t<r.length;t++){const l=r[t];if(!u&&0===i.length&&0===a.length&&e.isTokenNode(l)&&l.value[0]===n.TokenType.Ident){const e=toLowerCaseAZ(l.value[4].value);if(g.has(e)){u=e;continue}}if(e.isTokenNode(l)&&l.value[0]===n.TokenType.Comma){if(o===a)return-1;if(o===i&&u&&0===i.length)continue;if(o===i){o=a;continue}return-1}o.push(l)}}const l=solve(calc$1(new e.FunctionNode([n.TokenType.Function,"calc(",-1,-1,{value:"calc"}],[n.TokenType.CloseParen,")",-1,-1,void 0],i),t));if(-1===l)return-1;const s=solve(calc$1(new e.FunctionNode([n.TokenType.Function,"calc(",-1,-1,{value:"calc"}],[n.TokenType.CloseParen,")",-1,-1,void 0],a),t));if(-1===s)return-1;u||(u="nearest");return solveRound(o,u,l,s)}],["sign",function sign(e,n){return singleNodeSolver(e,n,solveSign)}],["sin",function sin(e,n){return singleNodeSolver(e,n,solveSin)}],["sqrt",function sqrt(e,n){return singleNodeSolver(e,n,solveSqrt)}],["tan",function tan(e,n){return singleNodeSolver(e,n,solveTan)}]]);function calc$1(o,t){const r=resolveGlobalsAndConstants([...o.value.filter((n=>!e.isCommentNode(n)&&!e.isWhitespaceNode(n)))],t);if(1===r.length&&e.isTokenNode(r[0]))return{inputs:[r[0]],operation:unary};let u=0;for(;u<r.length;){const o=r[u];if(e.isSimpleBlockNode(o)&&o.startToken[0]===n.TokenType.OpenParen){const e=calc$1(o,t);if(-1===e)return-1;r.splice(u,1,e)}else if(e.isFunctionNode(o)){const e=b.get(toLowerCaseAZ(o.getName()));if(!e)return-1;const n=e(o,t);if(-1===n)return-1;r.splice(u,1,n)}else u++}if(u=0,1===r.length&&isCalculation(r[0]))return r[0];for(;u<r.length;){const o=r[u];if(!o||!e.isTokenNode(o)&&!isCalculation(o)){u++;continue}const t=r[u+1];if(!t||!e.isTokenNode(t)){u++;continue}const i=t.value;if(i[0]!==n.TokenType.Delim||"*"!==i[4].value&&"/"!==i[4].value){u++;continue}const a=r[u+2];if(!a||!e.isTokenNode(a)&&!isCalculation(a))return-1;"*"!==i[4].value?"/"!==i[4].value?u++:r.splice(u,3,{inputs:[o,a],operation:division}):r.splice(u,3,{inputs:[o,a],operation:multiplication})}if(u=0,1===r.length&&isCalculation(r[0]))return r[0];for(;u<r.length;){const o=r[u];if(!o||!e.isTokenNode(o)&&!isCalculation(o)){u++;continue}const t=r[u+1];if(!t||!e.isTokenNode(t)){u++;continue}const i=t.value;if(i[0]!==n.TokenType.Delim||"+"!==i[4].value&&"-"!==i[4].value){u++;continue}const a=r[u+2];if(!a||!e.isTokenNode(a)&&!isCalculation(a))return-1;"+"!==i[4].value?"-"!==i[4].value?u++:r.splice(u,3,{inputs:[o,a],operation:subtraction}):r.splice(u,3,{inputs:[o,a],operation:addition})}return 1===r.length&&isCalculation(r[0])?r[0]:-1}function singleNodeSolver(o,t,r){const u=resolveGlobalsAndConstants([...o.value.filter((n=>!e.isCommentNode(n)&&!e.isWhitespaceNode(n)))],t),i=solve(calc$1(new e.FunctionNode([n.TokenType.Function,"calc(",-1,-1,{value:"calc"}],[n.TokenType.CloseParen,")",-1,-1,void 0],u),t));return-1===i?-1:r(o,i)}function twoCommaSeparatedNodesSolver(o,t,r){const u=resolveGlobalsAndConstants([...o.value.filter((n=>!e.isCommentNode(n)&&!e.isWhitespaceNode(n)))],t),i=[],a=[];{let o=i;for(let t=0;t<u.length;t++){const r=u[t];if(e.isTokenNode(r)&&r.value[0]===n.TokenType.Comma){if(o===a)return-1;if(o===i){o=a;continue}return-1}o.push(r)}}const l=solve(calc$1(new e.FunctionNode([n.TokenType.Function,"calc(",-1,-1,{value:"calc"}],[n.TokenType.CloseParen,")",-1,-1,void 0],i),t));if(-1===l)return-1;const s=solve(calc$1(new e.FunctionNode([n.TokenType.Function,"calc(",-1,-1,{value:"calc"}],[n.TokenType.CloseParen,")",-1,-1,void 0],a),t));return-1===s?-1:r(o,l,s)}function variadicNodesSolver(o,t,r){const u=resolveGlobalsAndConstants([...o.value.filter((n=>!e.isCommentNode(n)&&!e.isWhitespaceNode(n)))],t),i=[];{const o=[];let r=[];for(let t=0;t<u.length;t++){const i=u[t];e.isTokenNode(i)&&i.value[0]===n.TokenType.Comma?(o.push(r),r=[]):r.push(i)}o.push(r);for(let r=0;r<o.length;r++){if(0===o[r].length)return-1;const u=solve(calc$1(new e.FunctionNode([n.TokenType.Function,"calc(",-1,-1,{value:"calc"}],[n.TokenType.CloseParen,")",-1,-1,void 0],o[r]),t));if(-1===u)return-1;i.push(u)}}return r(o,i)}const g=new Set(["nearest","up","down","to-zero"]);function patchNaN(o){if(-1===o)return-1;if(e.isFunctionNode(o))return o;const t=o.value;return t[0]!==n.TokenType.Number&&t[0]!==n.TokenType.Percentage&&t[0]!==n.TokenType.Dimension?o:Number.isNaN(t[4].value)?t[0]===n.TokenType.Number?new e.FunctionNode([n.TokenType.Function,"calc(",t[2],t[3],{value:"calc"}],[n.TokenType.CloseParen,")",t[2],t[3],void 0],[new e.TokenNode([n.TokenType.Ident,"NaN",t[2],t[3],{value:"NaN"}])]):t[0]===n.TokenType.Dimension?new e.FunctionNode([n.TokenType.Function,"calc(",t[2],t[3],{value:"calc"}],[n.TokenType.CloseParen,")",t[2],t[3],void 0],[new e.TokenNode([n.TokenType.Ident,"NaN",t[2],t[3],{value:"NaN"}]),new e.WhitespaceNode([[n.TokenType.Whitespace," ",t[2],t[3],void 0]]),new e.TokenNode([n.TokenType.Delim,"*",t[2],t[3],{value:"*"}]),new e.WhitespaceNode([[n.TokenType.Whitespace," ",t[2],t[3],void 0]]),new e.TokenNode([n.TokenType.Dimension,"1"+t[4].unit,t[2],t[3],{value:1,type:n.NumberType.Integer,unit:t[4].unit}])]):t[0]===n.TokenType.Percentage?new e.FunctionNode([n.TokenType.Function,"calc(",t[2],t[3],{value:"calc"}],[n.TokenType.CloseParen,")",t[2],t[3],void 0],[new e.TokenNode([n.TokenType.Ident,"NaN",t[2],t[3],{value:"NaN"}]),new e.WhitespaceNode([[n.TokenType.Whitespace," ",t[2],t[3],void 0]]),new e.TokenNode([n.TokenType.Delim,"*",t[2],t[3],{value:"*"}]),new e.WhitespaceNode([[n.TokenType.Whitespace," ",t[2],t[3],void 0]]),new e.TokenNode([n.TokenType.Percentage,"1%",t[2],t[3],{value:1}])]):-1:o}function patchInfinity(o){if(-1===o)return-1;if(e.isFunctionNode(o))return o;const t=o.value;if(t[0]!==n.TokenType.Number&&t[0]!==n.TokenType.Percentage&&t[0]!==n.TokenType.Dimension)return o;if(Number.isFinite(t[4].value))return o;let r="";return Number.NEGATIVE_INFINITY===t[4].value&&(r="-"),t[0]===n.TokenType.Number?new e.FunctionNode([n.TokenType.Function,"calc(",t[2],t[3],{value:"calc"}],[n.TokenType.CloseParen,")",t[2],t[3],void 0],[new e.TokenNode([n.TokenType.Ident,r+"infinity",t[2],t[3],{value:r+"infinity"}])]):t[0]===n.TokenType.Dimension?new e.FunctionNode([n.TokenType.Function,"calc(",t[2],t[3],{value:"calc"}],[n.TokenType.CloseParen,")",t[2],t[3],void 0],[new e.TokenNode([n.TokenType.Ident,r+"infinity",t[2],t[3],{value:r+"infinity"}]),new e.WhitespaceNode([[n.TokenType.Whitespace," ",t[2],t[3],void 0]]),new e.TokenNode([n.TokenType.Delim,"*",t[2],t[3],{value:"*"}]),new e.WhitespaceNode([[n.TokenType.Whitespace," ",t[2],t[3],void 0]]),new e.TokenNode([n.TokenType.Dimension,"1"+t[4].unit,t[2],t[3],{value:1,type:n.NumberType.Integer,unit:t[4].unit}])]):t[0]===n.TokenType.Percentage?new e.FunctionNode([n.TokenType.Function,"calc(",t[2],t[3],{value:"calc"}],[n.TokenType.CloseParen,")",t[2],t[3],void 0],[new e.TokenNode([n.TokenType.Ident,r+"infinity",t[2],t[3],{value:r+"infinity"}]),new e.WhitespaceNode([[n.TokenType.Whitespace," ",t[2],t[3],void 0]]),new e.TokenNode([n.TokenType.Delim,"*",t[2],t[3],{value:"*"}]),new e.WhitespaceNode([[n.TokenType.Whitespace," ",t[2],t[3],void 0]]),new e.TokenNode([n.TokenType.Percentage,"1%",t[2],t[3],{value:1}])]):-1}function patchMinusZero(o){if(-1===o)return-1;if(e.isFunctionNode(o))return o;const t=o.value;return t[0]!==n.TokenType.Number&&t[0]!==n.TokenType.Percentage&&t[0]!==n.TokenType.Dimension?o:Object.is(-0,t[4].value)?("-0"===t[1]||(t[1]=`calc(-1 * ${t[1]})`),o):o}function patchPrecision(o,t=13){if(-1===o)return-1;if(e.isFunctionNode(o))return o;const r=o.value;if(r[0]!==n.TokenType.Number&&r[0]!==n.TokenType.Percentage&&r[0]!==n.TokenType.Dimension)return o;if(Number.isInteger(r[4].value))return o;const u=Number(r[4].value.toFixed(t)).toString();return r[0]===n.TokenType.Number?r[1]=u:r[0]===n.TokenType.Percentage?r[1]=u+"%":r[0]===n.TokenType.Dimension&&(r[1]=u+r[4].unit),o}function patchCanonicalUnit(o){return-1===o?-1:(e.isFunctionNode(o)||o.value[0]!==n.TokenType.Dimension||(o.value=toCanonicalUnit(o.value)),o)}function patchCalcResult(e,n){let o;return o=patchNaN(e),o=patchInfinity(o),n?.toCanonicalUnits&&(o=patchCanonicalUnit(o)),o=patchPrecision(o,n?.precision),o=patchMinusZero(o),o}function tokenizeGlobals(e){const o=new Map;if(!e)return o;for(const[t,r]of e)if(n.isToken(r))o.set(t,r);else if("string"!=typeof r);else{const e=n.tokenizer({css:r}),u=e.nextToken();if(e.nextToken(),!e.endOfFile())continue;if(!u)continue;if(u[0]!==n.TokenType.Number&&u[0]!==n.TokenType.Dimension&&u[0]!==n.TokenType.Percentage)continue;o.set(t,u)}return o}function calcFromComponentValues(n,o){const t=tokenizeGlobals(o?.globals);return e.replaceComponentValues(n,(n=>{if(!e.isFunctionNode(n))return;const r=b.get(toLowerCaseAZ(n.getName()));if(!r)return;const u=patchCalcResult(solve(r(n,t)),o);return-1!==u?u:void 0}))}const h=new Set(b.keys());exports.calc=function calc(o,t){return calcFromComponentValues(e.parseCommaSeparatedListOfComponentValues(n.tokenize({css:o}),{}),t).map((e=>e.map((e=>n.stringify(...e.tokens()))).join(""))).join(",")},exports.calcFromComponentValues=calcFromComponentValues,exports.mathFunctionNames=h;
+"use strict";var e=require("@csstools/css-parser-algorithms"),n=require("@csstools/css-tokenizer");const t=/[A-Z]/g;function toLowerCaseAZ(e){return e.replace(t,(e=>String.fromCharCode(e.charCodeAt(0)+32)))}const o={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"},r=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]]),i=new Map([["deg",e=>e],["grad",e=>e/.9],["rad",e=>e/180*Math.PI],["turn",e=>e/360]]),u=new Map([["deg",e=>.9*e],["grad",e=>e],["rad",e=>.9*e/180*Math.PI],["turn",e=>.9*e/360]]),a=new Map([["hz",e=>e],["khz",e=>e/1e3]]),s=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]]),l=new Map([["hz",e=>1e3*e],["khz",e=>e]]),c=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]]),T=new Map([["ms",e=>e],["s",e=>e/1e3]]),p=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]]),m=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]]),v=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]]),N=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]]),f=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]]),k=new Map([["ms",e=>1e3*e],["s",e=>e]]),d=new Map([["deg",e=>360*e],["grad",e=>360*e/.9],["rad",e=>360*e/180*Math.PI],["turn",e=>e]]),b=new Map([["cm",r],["mm",c],["q",N],["in",s],["pc",p],["pt",m],["px",v],["ms",T],["s",k],["deg",i],["grad",u],["rad",f],["turn",d],["hz",a],["khz",l]]);function convertUnit(e,t){if(!n.isTokenDimension(e))return t;if(!n.isTokenDimension(t))return t;const o=toLowerCaseAZ(e[4].unit),r=toLowerCaseAZ(t[4].unit);if(o===r)return t;const i=b.get(r);if(!i)return t;const u=i.get(o);if(!u)return t;const a=u(t[4].value),s=[n.TokenType.Dimension,"",t[2],t[3],{...t[4],signCharacter:a<0?"-":void 0,type:Number.isInteger(a)?n.NumberType.Integer:n.NumberType.Number,value:a}];return n.mutateUnit(s,e[4].unit),s}function toCanonicalUnit(e){if(!n.isTokenDimension(e))return e;const t=toLowerCaseAZ(e[4].unit),r=o[t];if(t===r)return e;const i=b.get(t);if(!i)return e;const u=i.get(r);if(!u)return e;const a=u(e[4].value),s=[n.TokenType.Dimension,"",e[2],e[3],{...e[4],signCharacter:a<0?"-":void 0,type:Number.isInteger(a)?n.NumberType.Integer:n.NumberType.Number,value:a}];return n.mutateUnit(s,r),s}function addition(t){if(2!==t.length)return-1;const o=t[0].value;let r=t[1].value;if(n.isTokenNumber(o)&&n.isTokenNumber(r)){const t=o[4].value+r[4].value;return new e.TokenNode([n.TokenType.Number,t.toString(),o[2],r[3],{value:t,type:o[4].type===n.NumberType.Integer&&r[4].type===n.NumberType.Integer?n.NumberType.Integer:n.NumberType.Number}])}if(n.isTokenPercentage(o)&&n.isTokenPercentage(r)){const t=o[4].value+r[4].value;return new e.TokenNode([n.TokenType.Percentage,t.toString()+"%",o[2],r[3],{value:t}])}if(n.isTokenDimension(o)&&n.isTokenDimension(r)&&(r=convertUnit(o,r),toLowerCaseAZ(o[4].unit)===toLowerCaseAZ(r[4].unit))){const t=o[4].value+r[4].value;return new e.TokenNode([n.TokenType.Dimension,t.toString()+o[4].unit,o[2],r[3],{value:t,type:o[4].type===n.NumberType.Integer&&r[4].type===n.NumberType.Integer?n.NumberType.Integer:n.NumberType.Number,unit:o[4].unit}])}return-1}function division(t){if(2!==t.length)return-1;const o=t[0].value,r=t[1].value;if(n.isTokenNumber(o)&&n.isTokenNumber(r)){const t=o[4].value/r[4].value;return new e.TokenNode([n.TokenType.Number,t.toString(),o[2],r[3],{value:t,type:Number.isInteger(t)?n.NumberType.Integer:n.NumberType.Number}])}if(n.isTokenPercentage(o)&&n.isTokenNumber(r)){const t=o[4].value/r[4].value;return new e.TokenNode([n.TokenType.Percentage,t.toString()+"%",o[2],r[3],{value:t}])}if(n.isTokenDimension(o)&&n.isTokenNumber(r)){const t=o[4].value/r[4].value;return new e.TokenNode([n.TokenType.Dimension,t.toString()+o[4].unit,o[2],r[3],{value:t,type:Number.isInteger(t)?n.NumberType.Integer:n.NumberType.Number,unit:o[4].unit}])}return-1}function isCalculation(e){return!!e&&"object"==typeof e&&"inputs"in e&&Array.isArray(e.inputs)&&"operation"in e}function solve(n){if(-1===n)return-1;const t=[];for(let o=0;o<n.inputs.length;o++){const r=n.inputs[o];if(e.isTokenNode(r)){t.push(r);continue}const i=solve(r);if(-1===i)return-1;t.push(i)}return n.operation(t)}function multiplication(t){if(2!==t.length)return-1;const o=t[0].value,r=t[1].value;if(n.isTokenNumber(o)&&n.isTokenNumber(r)){const t=o[4].value*r[4].value;return new e.TokenNode([n.TokenType.Number,t.toString(),o[2],r[3],{value:t,type:o[4].type===n.NumberType.Integer&&r[4].type===n.NumberType.Integer?n.NumberType.Integer:n.NumberType.Number}])}if(n.isTokenPercentage(o)&&n.isTokenNumber(r)){const t=o[4].value*r[4].value;return new e.TokenNode([n.TokenType.Percentage,t.toString()+"%",o[2],r[3],{value:t}])}if(n.isTokenNumber(o)&&n.isTokenPercentage(r)){const t=o[4].value*r[4].value;return new e.TokenNode([n.TokenType.Percentage,t.toString()+"%",o[2],r[3],{value:t}])}if(n.isTokenDimension(o)&&n.isTokenNumber(r)){const t=o[4].value*r[4].value;return new e.TokenNode([n.TokenType.Dimension,t.toString()+o[4].unit,o[2],r[3],{value:t,type:o[4].type===n.NumberType.Integer&&r[4].type===n.NumberType.Integer?n.NumberType.Integer:n.NumberType.Number,unit:o[4].unit}])}if(n.isTokenNumber(o)&&n.isTokenDimension(r)){const t=o[4].value*r[4].value;return new e.TokenNode([n.TokenType.Dimension,t.toString()+r[4].unit,o[2],r[3],{value:t,type:o[4].type===n.NumberType.Integer&&r[4].type===n.NumberType.Integer?n.NumberType.Integer:n.NumberType.Number,unit:r[4].unit}])}return-1}function resolveGlobalsAndConstants(t,o){for(let r=0;r<t.length;r++){const i=t[r];if(!e.isTokenNode(i))continue;const u=i.value;if(!n.isTokenIdent(u))continue;const a=toLowerCaseAZ(u[4].value);switch(a){case"e":t.splice(r,1,new e.TokenNode([n.TokenType.Number,Math.E.toString(),u[2],u[3],{value:Math.E,type:n.NumberType.Number}]));break;case"pi":t.splice(r,1,new e.TokenNode([n.TokenType.Number,Math.PI.toString(),u[2],u[3],{value:Math.PI,type:n.NumberType.Number}]));break;case"infinity":t.splice(r,1,new e.TokenNode([n.TokenType.Number,"infinity",u[2],u[3],{value:1/0,type:n.NumberType.Number}]));break;case"-infinity":t.splice(r,1,new e.TokenNode([n.TokenType.Number,"-infinity",u[2],u[3],{value:-1/0,type:n.NumberType.Number}]));break;case"nan":t.splice(r,1,new e.TokenNode([n.TokenType.Number,"NaN",u[2],u[3],{value:Number.NaN,type:n.NumberType.Number}]));break;default:if(o.has(a)){const n=o.get(a);t.splice(r,1,new e.TokenNode(n))}}}return t}function unary(e){if(1!==e.length)return-1;const t=e[0].value;return n.isTokenNumeric(t)?e[0]:-1}function resultToCalculation(e,t,o){return n.isTokenDimension(t)?dimensionToCalculation(e,t[4].unit,o):n.isTokenPercentage(t)?percentageToCalculation(e,o):n.isTokenNumber(t)?numberToCalculation(e,o):-1}function dimensionToCalculation(t,o,r){const i=t.tokens();return{inputs:[new e.TokenNode([n.TokenType.Dimension,r.toString()+o,i[0][2],i[i.length-1][3],{value:r,type:Number.isInteger(r)?n.NumberType.Integer:n.NumberType.Number,unit:o}])],operation:unary}}function percentageToCalculation(t,o){const r=t.tokens();return{inputs:[new e.TokenNode([n.TokenType.Percentage,o.toString()+"%",r[0][2],r[r.length-1][3],{value:o}])],operation:unary}}function numberToCalculation(t,o){const r=t.tokens();return{inputs:[new e.TokenNode([n.TokenType.Number,o.toString(),r[0][2],r[r.length-1][3],{value:o,type:Number.isInteger(o)?n.NumberType.Integer:n.NumberType.Number}])],operation:unary}}function solveACos(e,t){const o=t.value;if(!n.isTokenNumber(o))return-1;return dimensionToCalculation(e,"rad",Math.acos(o[4].value))}function solveASin(e,t){const o=t.value;if(!n.isTokenNumber(o))return-1;return dimensionToCalculation(e,"rad",Math.asin(o[4].value))}function solveATan(e,t){const o=t.value;if(!n.isTokenNumber(o))return-1;return dimensionToCalculation(e,"rad",Math.atan(o[4].value))}function isDimensionOrNumber(e){return n.isTokenDimension(e)||n.isTokenNumber(e)}function arrayOfSameNumeric(e){if(0===e.length)return!0;const t=e[0];if(!n.isTokenNumeric(t))return!1;if(1===e.length)return!0;if(n.isTokenDimension(t)){const n=toLowerCaseAZ(t[4].unit);for(let o=1;o<e.length;o++){const r=e[o];if(t[0]!==r[0])return!1;if(n!==toLowerCaseAZ(r[4].unit))return!1}return!0}for(let n=1;n<e.length;n++){const o=e[n];if(t[0]!==o[0])return!1}return!0}function twoOfSameNumeric(e,t){return!!n.isTokenNumeric(e)&&(n.isTokenDimension(e)?e[0]===t[0]&&toLowerCaseAZ(e[4].unit)===toLowerCaseAZ(t[4].unit):e[0]===t[0])}function solveATan2(e,n,t){const o=n.value;if(!isDimensionOrNumber(o))return-1;const r=convertUnit(o,t.value);if(!twoOfSameNumeric(o,r))return-1;return dimensionToCalculation(e,"rad",Math.atan2(o[4].value,r[4].value))}function solveAbs(e,n){const t=n.value;if(!isDimensionOrNumber(t))return-1;return resultToCalculation(e,t,Math.abs(t[4].value))}function solveClamp(t,o,r,i){if(!e.isTokenNode(o)||!e.isTokenNode(r)||!e.isTokenNode(i))return-1;const u=o.value;if(!n.isTokenNumeric(u))return-1;const a=convertUnit(u,r.value);if(!twoOfSameNumeric(u,a))return-1;const s=convertUnit(u,i.value);if(!twoOfSameNumeric(u,s))return-1;return resultToCalculation(t,u,Math.max(u[4].value,Math.min(a[4].value,s[4].value)))}function solveCos(e,t){const o=t.value;if(!isDimensionOrNumber(o))return-1;let r=o[4].value;if(n.isTokenDimension(o))switch(o[4].unit.toLowerCase()){case"rad":break;case"deg":r=i.get("rad")(o[4].value);break;case"grad":r=u.get("rad")(o[4].value);break;case"turn":r=d.get("rad")(o[4].value);break;default:return-1}return r=Math.cos(r),numberToCalculation(e,r)}function solveExp(e,t){const o=t.value;if(!n.isTokenNumber(o))return-1;return numberToCalculation(e,Math.exp(o[4].value))}function solveHypot(t,o){const r=o[0];if(!r||!e.isTokenNode(r))return-1;if(1!==new Set(o.map((e=>e.type))).size)return-1;const i=r.value;if(!n.isTokenNumeric(i))return-1;const u=o.map((e=>convertUnit(i,e.value)));if(!arrayOfSameNumeric(u))return-1;const a=u.map((e=>e[4].value)),s=Math.hypot(...a);return resultToCalculation(t,i,s)}function solveMax(t,o){const r=o[0];if(!r||!e.isTokenNode(r))return-1;if(1!==new Set(o.map((e=>e.type))).size)return-1;const i=r.value;if(!n.isTokenNumeric(i))return-1;const u=o.map((e=>convertUnit(i,e.value)));if(!arrayOfSameNumeric(u))return-1;const a=u.map((e=>e[4].value)),s=Math.max(...a);return resultToCalculation(t,i,s)}function solveMin(t,o){const r=o[0];if(!r||!e.isTokenNode(r))return-1;if(1!==new Set(o.map((e=>e.type))).size)return-1;const i=r.value;if(!n.isTokenNumeric(i))return-1;const u=o.map((e=>convertUnit(i,e.value)));if(!arrayOfSameNumeric(u))return-1;const a=u.map((e=>e[4].value)),s=Math.min(...a);return resultToCalculation(t,i,s)}function solveMod(e,t,o){const r=t.value;if(!n.isTokenNumeric(r))return-1;const i=convertUnit(r,o.value);if(!twoOfSameNumeric(r,i))return-1;let u;return u=0===i[4].value?Number.NaN:Number.isFinite(r[4].value)&&(Number.isFinite(i[4].value)||(i[4].value!==Number.POSITIVE_INFINITY||r[4].value!==Number.NEGATIVE_INFINITY&&!Object.is(0*r[4].value,-0))&&(i[4].value!==Number.NEGATIVE_INFINITY||r[4].value!==Number.POSITIVE_INFINITY&&!Object.is(0*r[4].value,0)))?Number.isFinite(i[4].value)?(r[4].value%i[4].value+i[4].value)%i[4].value:r[4].value:Number.NaN,resultToCalculation(e,r,u)}function solvePow(e,t,o){const r=t.value,i=o.value;if(!n.isTokenNumber(r))return-1;if(!twoOfSameNumeric(r,i))return-1;return numberToCalculation(e,Math.pow(r[4].value,i[4].value))}function solveRem(e,t,o){const r=t.value;if(!n.isTokenNumeric(r))return-1;const i=convertUnit(r,o.value);if(!twoOfSameNumeric(r,i))return-1;let u;return u=0===i[4].value?Number.NaN:Number.isFinite(r[4].value)?Number.isFinite(i[4].value)?r[4].value%i[4].value:r[4].value:Number.NaN,resultToCalculation(e,r,u)}function solveRound(e,t,o,r){const i=o.value;if(!n.isTokenNumeric(i))return-1;const u=convertUnit(i,r.value);if(!twoOfSameNumeric(i,u))return-1;let a;if(0===u[4].value)a=Number.NaN;else if(Number.isFinite(i[4].value)||Number.isFinite(u[4].value))if(!Number.isFinite(i[4].value)&&Number.isFinite(u[4].value))a=i[4].value;else if(Number.isFinite(i[4].value)&&!Number.isFinite(u[4].value))switch(t){case"down":a=i[4].value<0?-1/0:Object.is(-0,0*i[4].value)?-0:0;break;case"up":a=i[4].value>0?1/0:Object.is(0,0*i[4].value)?0:-0;break;default:a=Object.is(0,0*i[4].value)?0:-0}else if(Number.isFinite(u[4].value))switch(t){case"down":a=Math.floor(i[4].value/u[4].value)*u[4].value;break;case"up":a=Math.ceil(i[4].value/u[4].value)*u[4].value;break;case"to-zero":a=Math.trunc(i[4].value/u[4].value)*u[4].value;break;default:{let e=Math.floor(i[4].value/u[4].value)*u[4].value,n=Math.ceil(i[4].value/u[4].value)*u[4].value;if(e>n){const t=e;e=n,n=t}const t=Math.abs(i[4].value-e),o=Math.abs(i[4].value-n);a=t===o?n:t<o?e:n;break}}else a=i[4].value;else a=Number.NaN;return resultToCalculation(e,i,a)}function solveSign(e,n){const t=n.value;if(!isDimensionOrNumber(t))return-1;return numberToCalculation(e,Math.sign(t[4].value))}function solveSin(e,t){const o=t.value;if(!isDimensionOrNumber(o))return-1;let r=o[4].value;if(n.isTokenDimension(o))switch(toLowerCaseAZ(o[4].unit)){case"rad":break;case"deg":r=i.get("rad")(o[4].value);break;case"grad":r=u.get("rad")(o[4].value);break;case"turn":r=d.get("rad")(o[4].value);break;default:return-1}return r=Math.sin(r),numberToCalculation(e,r)}function solveSqrt(e,t){const o=t.value;if(!n.isTokenNumber(o))return-1;return numberToCalculation(e,Math.sqrt(o[4].value))}function solveTan(e,t){const o=t.value;if(!isDimensionOrNumber(o))return-1;const r=o[4].value;let a=0,s=o[4].value;if(n.isTokenDimension(o))switch(toLowerCaseAZ(o[4].unit)){case"rad":a=f.get("deg")(r);break;case"deg":a=r,s=i.get("rad")(r);break;case"grad":a=u.get("deg")(r),s=u.get("rad")(r);break;case"turn":a=d.get("deg")(r),s=d.get("rad")(r);break;default:return-1}const l=a/90;return s=a%90==0&&l%2!=0?l>0?1/0:-1/0:Math.tan(s),numberToCalculation(e,s)}function subtraction(t){if(2!==t.length)return-1;const o=t[0].value;let r=t[1].value;if(n.isTokenNumber(o)&&n.isTokenNumber(r)){const t=o[4].value-r[4].value;return new e.TokenNode([n.TokenType.Number,t.toString(),o[2],r[3],{value:t,type:o[4].type===n.NumberType.Integer&&r[4].type===n.NumberType.Integer?n.NumberType.Integer:n.NumberType.Number}])}if(n.isTokenPercentage(o)&&n.isTokenPercentage(r)){const t=o[4].value-r[4].value;return new e.TokenNode([n.TokenType.Percentage,t.toString()+"%",o[2],r[3],{value:t}])}if(n.isTokenDimension(o)&&n.isTokenDimension(r)&&(r=convertUnit(o,r),toLowerCaseAZ(o[4].unit)===toLowerCaseAZ(r[4].unit))){const t=o[4].value-r[4].value;return new e.TokenNode([n.TokenType.Dimension,t.toString()+o[4].unit,o[2],r[3],{value:t,type:o[4].type===n.NumberType.Integer&&r[4].type===n.NumberType.Integer?n.NumberType.Integer:n.NumberType.Number,unit:o[4].unit}])}return-1}function solveLog(t,o){if(1===o.length){const r=o[0];if(!r||!e.isTokenNode(r))return-1;const i=r.value;if(!n.isTokenNumber(i))return-1;return numberToCalculation(t,Math.log(i[4].value))}if(2===o.length){const r=o[0];if(!r||!e.isTokenNode(r))return-1;const i=r.value;if(!n.isTokenNumber(i))return-1;const u=o[1];if(!u||!e.isTokenNode(u))return-1;const a=u.value;if(!n.isTokenNumber(a))return-1;return numberToCalculation(t,Math.log(i[4].value)/Math.log(a[4].value))}return-1}const g=/^none$/i;function isNone(t){if(Array.isArray(t)){const n=t.filter((n=>!(e.isWhitespaceNode(n)&&e.isCommentNode(n))));return 1===n.length&&isNone(n[0])}if(!e.isTokenNode(t))return!1;const o=t.value;return!!n.isTokenIdent(o)&&g.test(o[4].value)}const y=new Map([["abs",function abs(e,n){return singleNodeSolver(e,n,solveAbs)}],["acos",function acos(e,n){return singleNodeSolver(e,n,solveACos)}],["asin",function asin(e,n){return singleNodeSolver(e,n,solveASin)}],["atan",function atan(e,n){return singleNodeSolver(e,n,solveATan)}],["atan2",function atan2(e,n){return twoCommaSeparatedNodesSolver(e,n,solveATan2)}],["calc",calc$1],["clamp",function clamp(t,o){const r=resolveGlobalsAndConstants([...t.value.filter((n=>!e.isCommentNode(n)&&!e.isWhitespaceNode(n)))],o),i=[],u=[],a=[];{let t=i;for(let o=0;o<r.length;o++){const s=r[o];if(e.isTokenNode(s)&&n.isTokenComma(s.value)){if(t===a)return-1;if(t===u){t=a;continue}if(t===i){t=u;continue}return-1}t.push(s)}}const s=isNone(i),l=isNone(a);if(s&&l)return calc$1(calcWrapper(u),o);const c=solve(calc$1(calcWrapper(u),o));if(-1===c)return-1;if(s){const t=solve(calc$1(calcWrapper(a),o));return-1===t?-1:solveMin((T=c,p=t,new e.FunctionNode([n.TokenType.Function,"min(",-1,-1,{value:"min"}],[n.TokenType.CloseParen,")",-1,-1,void 0],[T,new e.TokenNode([n.TokenType.Comma,",",-1,-1,void 0]),p])),[c,t])}if(l){const e=solve(calc$1(calcWrapper(i),o));return-1===e?-1:solveMax(maxWrapper(e,c),[e,c])}var T,p;const m=solve(calc$1(calcWrapper(i),o));if(-1===m)return-1;const v=solve(calc$1(calcWrapper(a),o));if(-1===v)return-1;return solveClamp(t,m,c,v)}],["cos",function cos(e,n){return singleNodeSolver(e,n,solveCos)}],["exp",function exp(e,n){return singleNodeSolver(e,n,solveExp)}],["hypot",function hypot(e,n){return variadicNodesSolver(e,n,solveHypot)}],["log",function log(e,n){return variadicNodesSolver(e,n,solveLog)}],["max",function max(e,n){return variadicNodesSolver(e,n,solveMax)}],["min",function min(e,n){return variadicNodesSolver(e,n,solveMin)}],["mod",function mod(e,n){return twoCommaSeparatedNodesSolver(e,n,solveMod)}],["pow",function pow(e,n){return twoCommaSeparatedNodesSolver(e,n,solvePow)}],["rem",function rem(e,n){return twoCommaSeparatedNodesSolver(e,n,solveRem)}],["round",function round(t,o){const r=resolveGlobalsAndConstants([...t.value.filter((n=>!e.isCommentNode(n)&&!e.isWhitespaceNode(n)))],o);let i="",u=!1;const a=[],s=[];{let t=a;for(let o=0;o<r.length;o++){const l=r[o];if(!i&&0===a.length&&0===s.length&&e.isTokenNode(l)&&n.isTokenIdent(l.value)){const e=l.value[4].value.toLowerCase();if(h.has(e)){i=e;continue}}if(e.isTokenNode(l)&&n.isTokenComma(l.value)){if(t===s)return-1;if(t===a&&i&&0===a.length)continue;if(t===a){u=!0,t=s;continue}return-1}t.push(l)}}const l=solve(calc$1(calcWrapper(a),o));if(-1===l)return-1;u||0!==s.length||s.push(new e.TokenNode([n.TokenType.Number,"1",-1,-1,{value:1,type:n.NumberType.Integer}]));const c=solve(calc$1(calcWrapper(s),o));if(-1===c)return-1;i||(i="nearest");return solveRound(t,i,l,c)}],["sign",function sign(e,n){return singleNodeSolver(e,n,solveSign)}],["sin",function sin(e,n){return singleNodeSolver(e,n,solveSin)}],["sqrt",function sqrt(e,n){return singleNodeSolver(e,n,solveSqrt)}],["tan",function tan(e,n){return singleNodeSolver(e,n,solveTan)}]]);function calc$1(t,o){const r=resolveGlobalsAndConstants([...t.value.filter((n=>!e.isCommentNode(n)&&!e.isWhitespaceNode(n)))],o);if(1===r.length&&e.isTokenNode(r[0]))return{inputs:[r[0]],operation:unary};let i=0;for(;i<r.length;){const t=r[i];if(e.isSimpleBlockNode(t)&&n.isTokenOpenParen(t.startToken)){const e=calc$1(t,o);if(-1===e)return-1;r.splice(i,1,e)}else if(e.isFunctionNode(t)){const e=y.get(t.getName().toLowerCase());if(!e)return-1;const n=e(t,o);if(-1===n)return-1;r.splice(i,1,n)}else i++}if(i=0,1===r.length&&isCalculation(r[0]))return r[0];for(;i<r.length;){const t=r[i];if(!t||!e.isTokenNode(t)&&!isCalculation(t)){i++;continue}const o=r[i+1];if(!o||!e.isTokenNode(o)){i++;continue}const u=o.value;if(!n.isTokenDelim(u)||"*"!==u[4].value&&"/"!==u[4].value){i++;continue}const a=r[i+2];if(!a||!e.isTokenNode(a)&&!isCalculation(a))return-1;"*"!==u[4].value?"/"!==u[4].value?i++:r.splice(i,3,{inputs:[t,a],operation:division}):r.splice(i,3,{inputs:[t,a],operation:multiplication})}if(i=0,1===r.length&&isCalculation(r[0]))return r[0];for(;i<r.length;){const t=r[i];if(!t||!e.isTokenNode(t)&&!isCalculation(t)){i++;continue}const o=r[i+1];if(!o||!e.isTokenNode(o)){i++;continue}const u=o.value;if(!n.isTokenDelim(u)||"+"!==u[4].value&&"-"!==u[4].value){i++;continue}const a=r[i+2];if(!a||!e.isTokenNode(a)&&!isCalculation(a))return-1;"+"!==u[4].value?"-"!==u[4].value?i++:r.splice(i,3,{inputs:[t,a],operation:subtraction}):r.splice(i,3,{inputs:[t,a],operation:addition})}return 1===r.length&&isCalculation(r[0])?r[0]:-1}function singleNodeSolver(n,t,o){const r=solve(calc$1(calcWrapper(resolveGlobalsAndConstants([...n.value.filter((n=>!e.isCommentNode(n)&&!e.isWhitespaceNode(n)))],t)),t));return-1===r?-1:o(n,r)}function twoCommaSeparatedNodesSolver(t,o,r){const i=resolveGlobalsAndConstants([...t.value.filter((n=>!e.isCommentNode(n)&&!e.isWhitespaceNode(n)))],o),u=[],a=[];{let t=u;for(let o=0;o<i.length;o++){const r=i[o];if(e.isTokenNode(r)&&n.isTokenComma(r.value)){if(t===a)return-1;if(t===u){t=a;continue}return-1}t.push(r)}}const s=solve(calc$1(calcWrapper(u),o));if(-1===s)return-1;const l=solve(calc$1(calcWrapper(a),o));return-1===l?-1:r(t,s,l)}function variadicNodesSolver(t,o,r){const i=resolveGlobalsAndConstants([...t.value.filter((n=>!e.isCommentNode(n)&&!e.isWhitespaceNode(n)))],o),u=[];{const t=[];let r=[];for(let o=0;o<i.length;o++){const u=i[o];e.isTokenNode(u)&&n.isTokenComma(u.value)?(t.push(r),r=[]):r.push(u)}t.push(r);for(let e=0;e<t.length;e++){if(0===t[e].length)return-1;const n=solve(calc$1(calcWrapper(t[e]),o));if(-1===n)return-1;u.push(n)}}return r(t,u)}const h=new Set(["nearest","up","down","to-zero"]);function calcWrapper(t){return new e.FunctionNode([n.TokenType.Function,"calc(",-1,-1,{value:"calc"}],[n.TokenType.CloseParen,")",-1,-1,void 0],t)}function maxWrapper(t,o){return new e.FunctionNode([n.TokenType.Function,"max(",-1,-1,{value:"max"}],[n.TokenType.CloseParen,")",-1,-1,void 0],[t,new e.TokenNode([n.TokenType.Comma,",",-1,-1,void 0]),o])}function patchNaN(t){if(-1===t)return-1;if(e.isFunctionNode(t))return t;const o=t.value;return n.isTokenNumeric(o)&&Number.isNaN(o[4].value)?n.isTokenNumber(o)?new e.FunctionNode([n.TokenType.Function,"calc(",o[2],o[3],{value:"calc"}],[n.TokenType.CloseParen,")",o[2],o[3],void 0],[new e.TokenNode([n.TokenType.Ident,"NaN",o[2],o[3],{value:"NaN"}])]):n.isTokenDimension(o)?new e.FunctionNode([n.TokenType.Function,"calc(",o[2],o[3],{value:"calc"}],[n.TokenType.CloseParen,")",o[2],o[3],void 0],[new e.TokenNode([n.TokenType.Ident,"NaN",o[2],o[3],{value:"NaN"}]),new e.WhitespaceNode([[n.TokenType.Whitespace," ",o[2],o[3],void 0]]),new e.TokenNode([n.TokenType.Delim,"*",o[2],o[3],{value:"*"}]),new e.WhitespaceNode([[n.TokenType.Whitespace," ",o[2],o[3],void 0]]),new e.TokenNode([n.TokenType.Dimension,"1"+o[4].unit,o[2],o[3],{value:1,type:n.NumberType.Integer,unit:o[4].unit}])]):n.isTokenPercentage(o)?new e.FunctionNode([n.TokenType.Function,"calc(",o[2],o[3],{value:"calc"}],[n.TokenType.CloseParen,")",o[2],o[3],void 0],[new e.TokenNode([n.TokenType.Ident,"NaN",o[2],o[3],{value:"NaN"}]),new e.WhitespaceNode([[n.TokenType.Whitespace," ",o[2],o[3],void 0]]),new e.TokenNode([n.TokenType.Delim,"*",o[2],o[3],{value:"*"}]),new e.WhitespaceNode([[n.TokenType.Whitespace," ",o[2],o[3],void 0]]),new e.TokenNode([n.TokenType.Percentage,"1%",o[2],o[3],{value:1}])]):-1:t}function patchInfinity(t){if(-1===t)return-1;if(e.isFunctionNode(t))return t;const o=t.value;if(!n.isTokenNumeric(o))return t;if(Number.isFinite(o[4].value)||Number.isNaN(o[4].value))return t;let r="";return Number.NEGATIVE_INFINITY===o[4].value&&(r="-"),n.isTokenNumber(o)?new e.FunctionNode([n.TokenType.Function,"calc(",o[2],o[3],{value:"calc"}],[n.TokenType.CloseParen,")",o[2],o[3],void 0],[new e.TokenNode([n.TokenType.Ident,r+"infinity",o[2],o[3],{value:r+"infinity"}])]):n.isTokenDimension(o)?new e.FunctionNode([n.TokenType.Function,"calc(",o[2],o[3],{value:"calc"}],[n.TokenType.CloseParen,")",o[2],o[3],void 0],[new e.TokenNode([n.TokenType.Ident,r+"infinity",o[2],o[3],{value:r+"infinity"}]),new e.WhitespaceNode([[n.TokenType.Whitespace," ",o[2],o[3],void 0]]),new e.TokenNode([n.TokenType.Delim,"*",o[2],o[3],{value:"*"}]),new e.WhitespaceNode([[n.TokenType.Whitespace," ",o[2],o[3],void 0]]),new e.TokenNode([n.TokenType.Dimension,"1"+o[4].unit,o[2],o[3],{value:1,type:n.NumberType.Integer,unit:o[4].unit}])]):new e.FunctionNode([n.TokenType.Function,"calc(",o[2],o[3],{value:"calc"}],[n.TokenType.CloseParen,")",o[2],o[3],void 0],[new e.TokenNode([n.TokenType.Ident,r+"infinity",o[2],o[3],{value:r+"infinity"}]),new e.WhitespaceNode([[n.TokenType.Whitespace," ",o[2],o[3],void 0]]),new e.TokenNode([n.TokenType.Delim,"*",o[2],o[3],{value:"*"}]),new e.WhitespaceNode([[n.TokenType.Whitespace," ",o[2],o[3],void 0]]),new e.TokenNode([n.TokenType.Percentage,"1%",o[2],o[3],{value:1}])])}function patchMinusZero(t){if(-1===t)return-1;if(e.isFunctionNode(t))return t;const o=t.value;return n.isTokenNumeric(o)&&Object.is(-0,o[4].value)?("-0"===o[1]||(n.isTokenPercentage(o)?o[1]="-0%":n.isTokenDimension(o)?o[1]="-0"+o[4].unit:o[1]="-0"),t):t}function patchPrecision(t,o=13){if(-1===t)return-1;if(o<=0)return t;if(e.isFunctionNode(t))return t;const r=t.value;if(!n.isTokenNumeric(r))return t;if(Number.isInteger(r[4].value))return t;const i=Number(r[4].value.toFixed(o)).toString();return n.isTokenNumber(r)?r[1]=i:n.isTokenPercentage(r)?r[1]=i+"%":n.isTokenDimension(r)&&(r[1]=i+r[4].unit),t}function patchCanonicalUnit(t){return-1===t?-1:e.isFunctionNode(t)?t:n.isTokenDimension(t.value)?(t.value=toCanonicalUnit(t.value),t):t}function patchCalcResult(e,n){let t=e;return n?.censorIntoStandardRepresentableValues||(t=patchNaN(t),t=patchInfinity(t)),n?.toCanonicalUnits&&(t=patchCanonicalUnit(t)),t=patchPrecision(t,n?.precision),t=patchMinusZero(t),t}function tokenizeGlobals(e){const t=new Map;if(!e)return t;for(const[o,r]of e)if(n.isToken(r))t.set(o,r);else if("string"!=typeof r);else{const e=n.tokenizer({css:r}),i=e.nextToken();if(e.nextToken(),!e.endOfFile())continue;if(!i)continue;if(!n.isTokenNumeric(i))continue;t.set(o,i)}return t}function calcFromComponentValues(n,t){const o=tokenizeGlobals(t?.globals);return e.replaceComponentValues(n,(n=>{if(!e.isFunctionNode(n))return;const r=y.get(n.getName().toLowerCase());if(!r)return;const i=patchCalcResult(solve(r(n,o)),t);return-1!==i?i:void 0}))}const w=new Set(y.keys());exports.calc=function calc(t,o){return calcFromComponentValues(e.parseCommaSeparatedListOfComponentValues(n.tokenize({css:t}),{}),o).map((e=>e.map((e=>n.stringify(...e.tokens()))).join(""))).join(",")},exports.calcFromComponentValues=calcFromComponentValues,exports.mathFunctionNames=w;
diff --git a/node_modules/@csstools/css-calc/dist/index.d.ts b/node_modules/@csstools/css-calc/dist/index.d.ts
index 9d31d3b5..7fe7efb4 100644
--- a/node_modules/@csstools/css-calc/dist/index.d.ts
+++ b/node_modules/@csstools/css-calc/dist/index.d.ts
@@ -5,7 +5,7 @@ import type { TokenPercentage } from '@csstools/css-tokenizer';
export declare function calc(css: string, options?: conversionOptions): string;
-export declare function calcFromComponentValues(componentValuesList: Array<Array<ComponentValue>>, options?: conversionOptions): ComponentValue[][];
+export declare function calcFromComponentValues(componentValuesList: Array<Array<ComponentValue>>, options?: conversionOptions): Array<Array<ComponentValue>>;
export declare type conversionOptions = {
/**
@@ -28,6 +28,10 @@ export declare type conversionOptions = {
* 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;
};
export declare type GlobalsWithStrings = Map<string, TokenDimension | TokenNumber | TokenPercentage | string>;
diff --git a/node_modules/@csstools/css-calc/dist/index.mjs b/node_modules/@csstools/css-calc/dist/index.mjs
index 368e8aa1..a7ef7ef7 100644
--- a/node_modules/@csstools/css-calc/dist/index.mjs
+++ b/node_modules/@csstools/css-calc/dist/index.mjs
@@ -1 +1 @@
-import{TokenNode as e,isTokenNode as n,isCommentNode as t,isWhitespaceNode as r,isSimpleBlockNode as u,isFunctionNode as i,FunctionNode as a,WhitespaceNode as o,parseCommaSeparatedListOfComponentValues as l,replaceComponentValues as c}from"@csstools/css-parser-algorithms";import{TokenType as s,NumberType as v,isToken as m,tokenizer as f,tokenize as p,stringify as N}from"@csstools/css-tokenizer";const g=/[A-Z]/g;function toLowerCaseAZ(e){return e.replace(g,(e=>String.fromCharCode(e.charCodeAt(0)+32)))}const b={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"},d=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]]),w=new Map([["deg",e=>e],["grad",e=>e/.9],["rad",e=>e/180*Math.PI],["turn",e=>e/360]]),h=new Map([["deg",e=>.9*e],["grad",e=>e],["rad",e=>.9*e/180*Math.PI],["turn",e=>.9*e/360]]),C=new Map([["hz",e=>e],["khz",e=>e/1e3]]),I=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]]),S=new Map([["hz",e=>1e3*e],["khz",e=>e]]),y=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]]),M=new Map([["ms",e=>e],["s",e=>e/1e3]]),P=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]]),D=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]]),T=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]]),A=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]]),k=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]]),F=new Map([["ms",e=>1e3*e],["s",e=>e]]),x=new Map([["deg",e=>360*e],["grad",e=>360*e/.9],["rad",e=>360*e/180*Math.PI],["turn",e=>e]]),O=new Map([["cm",d],["mm",y],["q",A],["in",I],["pc",P],["pt",D],["px",T],["ms",M],["s",F],["deg",w],["grad",h],["rad",k],["turn",x],["hz",C],["khz",S]]);function convertUnit(e,n){if(e[0]!==s.Dimension)return n;if(n[0]!==s.Dimension)return n;const t=toLowerCaseAZ(e[4].unit),r=toLowerCaseAZ(n[4].unit);if(t===r)return n;const u=O.get(r);if(!u)return n;const i=u.get(t);if(!i)return n;const a=i(n[4].value);return[s.Dimension,a.toString()+e[4].unit,n[2],n[3],{value:a,unit:e[4].unit,type:Number.isInteger(a)?v.Integer:v.Number}]}function toCanonicalUnit(e){if(e[0]!==s.Dimension)return e;const n=toLowerCaseAZ(e[4].unit),t=b[n];if(n===t)return e;const r=O.get(n);if(!r)return e;const u=r.get(t);if(!u)return e;const i=u(e[4].value);return[s.Dimension,i.toString()+t,e[2],e[3],{value:i,unit:t,type:Number.isInteger(i)?v.Integer:v.Number}]}function addition(n){if(2!==n.length)return-1;const t=n[0].value;let r=n[1].value;if(t[0]===s.Number&&r[0]===s.Number){const n=t[4].value+r[4].value;return new e([s.Number,n.toString(),t[2],r[3],{value:n,type:t[4].type===v.Integer&&r[4].type===v.Integer?v.Integer:v.Number}])}if(t[0]===s.Percentage&&r[0]===s.Percentage){const n=t[4].value+r[4].value;return new e([s.Percentage,n.toString()+"%",t[2],r[3],{value:n}])}if(t[0]===s.Dimension&&r[0]===s.Dimension&&(r=convertUnit(t,r),toLowerCaseAZ(t[4].unit)===toLowerCaseAZ(r[4].unit))){const n=t[4].value+r[4].value;return new e([s.Dimension,n.toString()+t[4].unit,t[2],r[3],{value:n,type:t[4].type===v.Integer&&r[4].type===v.Integer?v.Integer:v.Number,unit:t[4].unit}])}return-1}function division(n){if(2!==n.length)return-1;const t=n[0].value,r=n[1].value;if(t[0]===s.Number&&r[0]===s.Number){const n=t[4].value/r[4].value;return new e([s.Number,n.toString(),t[2],r[3],{value:n,type:Number.isInteger(n)?v.Integer:v.Number}])}if(t[0]===s.Percentage&&r[0]===s.Number){const n=t[4].value/r[4].value;return new e([s.Percentage,n.toString()+"%",t[2],r[3],{value:n}])}if(t[0]===s.Dimension&&r[0]===s.Number){const n=t[4].value/r[4].value;return new e([s.Dimension,n.toString()+t[4].unit,t[2],r[3],{value:n,type:Number.isInteger(n)?v.Integer:v.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){if(-1===e)return-1;const t=[];for(let r=0;r<e.inputs.length;r++){const u=e.inputs[r];if(n(u)){t.push(u);continue}const i=solve(u);if(-1===i)return-1;t.push(i)}return e.operation(t)}function multiplication(n){if(2!==n.length)return-1;const t=n[0].value,r=n[1].value;if(t[0]===s.Number&&r[0]===s.Number){const n=t[4].value*r[4].value;return new e([s.Number,n.toString(),t[2],r[3],{value:n,type:t[4].type===v.Integer&&r[4].type===v.Integer?v.Integer:v.Number}])}if(t[0]===s.Percentage&&r[0]===s.Number){const n=t[4].value*r[4].value;return new e([s.Percentage,n.toString()+"%",t[2],r[3],{value:n}])}if(t[0]===s.Number&&r[0]===s.Percentage){const n=t[4].value*r[4].value;return new e([s.Percentage,n.toString()+"%",t[2],r[3],{value:n}])}if(t[0]===s.Dimension&&r[0]===s.Number){const n=t[4].value*r[4].value;return new e([s.Dimension,n.toString()+t[4].unit,t[2],r[3],{value:n,type:t[4].type===v.Integer&&r[4].type===v.Integer?v.Integer:v.Number,unit:t[4].unit}])}if(t[0]===s.Number&&r[0]===s.Dimension){const n=t[4].value*r[4].value;return new e([s.Dimension,n.toString()+r[4].unit,t[2],r[3],{value:n,type:t[4].type===v.Integer&&r[4].type===v.Integer?v.Integer:v.Number,unit:r[4].unit}])}return-1}function resolveGlobalsAndConstants(t,r){for(let u=0;u<t.length;u++){const i=t[u];if(!n(i))continue;const a=i.value;if(a[0]!==s.Ident)continue;const o=toLowerCaseAZ(a[4].value);switch(o){case"e":t.splice(u,1,new e([s.Number,Math.E.toString(),a[2],a[3],{value:Math.E,type:v.Number}]));break;case"pi":t.splice(u,1,new e([s.Number,Math.PI.toString(),a[2],a[3],{value:Math.PI,type:v.Number}]));break;case"infinity":t.splice(u,1,new e([s.Number,"infinity",a[2],a[3],{value:1/0,type:v.Number}]));break;case"-infinity":t.splice(u,1,new e([s.Number,"-infinity",a[2],a[3],{value:-1/0,type:v.Number}]));break;case"nan":t.splice(u,1,new e([s.Number,"NaN",a[2],a[3],{value:Number.NaN,type:v.Number}]));break;default:if(r.has(o)){const n=r.get(o);t.splice(u,1,new e(n))}}}return t}function isNumeric(e){return e[0]===s.Dimension||(e[0]===s.Percentage||e[0]===s.Number)}function isDimensionOrNumber(e){return e[0]===s.Dimension||e[0]===s.Number}function arrayOfSameNumeric(e){if(0===e.length)return!0;const n=e[0];if(!isNumeric(n))return!1;if(1===e.length)return!0;if(n[0]===s.Dimension){const t=toLowerCaseAZ(n[4].unit);for(let r=1;r<e.length;r++){const u=e[r];if(n[0]!==u[0])return!1;if(t!==toLowerCaseAZ(u[4].unit))return!1}return!0}for(let t=1;t<e.length;t++){const r=e[t];if(n[0]!==r[0])return!1}return!0}function twoOfSameNumeric(e,n){return!!isNumeric(e)&&(e[0]===s.Dimension?e[0]===n[0]&&toLowerCaseAZ(e[4].unit)===toLowerCaseAZ(n[4].unit):e[0]===n[0])}function unary(e){if(1!==e.length)return-1;return isNumeric(e[0].value)?e[0]:-1}function resultToCalculation(e,n,t){return n[0]===s.Dimension?dimensionToCalculation(e,n[4].unit,t):n[0]===s.Percentage?percentageToCalculation(e,t):n[0]===s.Number?numberToCalculation(e,t):-1}function dimensionToCalculation(n,t,r){const u=n.tokens();return{inputs:[new e([s.Dimension,r.toString()+t,u[0][2],u[u.length-1][3],{value:r,type:Number.isInteger(r)?v.Integer:v.Number,unit:t}])],operation:unary}}function percentageToCalculation(n,t){const r=n.tokens();return{inputs:[new e([s.Percentage,t.toString()+"%",r[0][2],r[r.length-1][3],{value:t}])],operation:unary}}function numberToCalculation(n,t){const r=n.tokens();return{inputs:[new e([s.Number,t.toString(),r[0][2],r[r.length-1][3],{value:t,type:Number.isInteger(t)?v.Integer:v.Number}])],operation:unary}}function solveACos(e,n){const t=n.value;if(t[0]!==s.Number)return-1;return dimensionToCalculation(e,"rad",Math.acos(t[4].value))}function solveASin(e,n){const t=n.value;if(t[0]!==s.Number)return-1;return dimensionToCalculation(e,"rad",Math.asin(t[4].value))}function solveATan(e,n){const t=n.value;if(t[0]!==s.Number)return-1;return dimensionToCalculation(e,"rad",Math.atan(t[4].value))}function solveATan2(e,n,t){const r=n.value;if(!isDimensionOrNumber(r))return-1;const u=convertUnit(r,t.value);if(!twoOfSameNumeric(r,u))return-1;return dimensionToCalculation(e,"rad",Math.atan2(r[4].value,u[4].value))}function solveAbs(e,n){const t=n.value;if(!isDimensionOrNumber(t))return-1;return resultToCalculation(e,t,Math.abs(t[4].value))}function solveClamp(e,t,r,u){if(!n(t)||!n(r)||!n(u))return-1;const i=t.value;if(!isNumeric(i))return-1;const a=convertUnit(i,r.value);if(!twoOfSameNumeric(i,a))return-1;const o=convertUnit(i,u.value);if(!twoOfSameNumeric(i,o))return-1;return resultToCalculation(e,i,Math.max(i[4].value,Math.min(a[4].value,o[4].value)))}function solveCos(e,n){const t=n.value;if(!isDimensionOrNumber(t))return-1;let r=t[4].value;if(t[0]===s.Dimension)switch(toLowerCaseAZ(t[4].unit)){case"rad":break;case"deg":r=w.get("rad")(t[4].value);break;case"grad":r=h.get("rad")(t[4].value);break;case"turn":r=x.get("rad")(t[4].value);break;default:return-1}return r=Math.cos(r),numberToCalculation(e,r)}function solveExp(e,n){const t=n.value;if(t[0]!==s.Number)return-1;return numberToCalculation(e,Math.exp(t[4].value))}function solveHypot(e,t){const r=t[0];if(!r||!n(r))return-1;if(1!==new Set(t.map((e=>e.type))).size)return-1;const u=r.value;if(!isNumeric(u))return-1;const i=t.map((e=>convertUnit(u,e.value)));if(!arrayOfSameNumeric(i))return-1;const a=i.map((e=>e[4].value)),o=Math.hypot(...a);return resultToCalculation(e,u,o)}function solveMax(e,t){const r=t[0];if(!r||!n(r))return-1;if(1!==new Set(t.map((e=>e.type))).size)return-1;const u=r.value;if(!isNumeric(u))return-1;const i=t.map((e=>convertUnit(u,e.value)));if(!arrayOfSameNumeric(i))return-1;const a=i.map((e=>e[4].value)),o=Math.max(...a);return resultToCalculation(e,u,o)}function solveMin(e,t){const r=t[0];if(!r||!n(r))return-1;if(1!==new Set(t.map((e=>e.type))).size)return-1;const u=r.value;if(!isNumeric(u))return-1;const i=t.map((e=>convertUnit(u,e.value)));if(!arrayOfSameNumeric(i))return-1;const a=i.map((e=>e[4].value)),o=Math.min(...a);return resultToCalculation(e,u,o)}function solveMod(e,n,t){const r=n.value;if(!isNumeric(r))return-1;const u=convertUnit(r,t.value);if(!twoOfSameNumeric(r,u))return-1;let i;return i=0===u[4].value?Number.NaN:Number.isFinite(r[4].value)&&(Number.isFinite(u[4].value)||(u[4].value!==Number.POSITIVE_INFINITY||r[4].value!==Number.NEGATIVE_INFINITY&&!Object.is(0*r[4].value,-0))&&(u[4].value!==Number.NEGATIVE_INFINITY||r[4].value!==Number.POSITIVE_INFINITY&&!Object.is(0*r[4].value,0)))?Number.isFinite(u[4].value)?(r[4].value%u[4].value+u[4].value)%u[4].value:r[4].value:Number.NaN,resultToCalculation(e,r,i)}function solvePow(e,n,t){const r=n.value,u=t.value;if(r[0]!==s.Number)return-1;if(!twoOfSameNumeric(r,u))return-1;return numberToCalculation(e,Math.pow(r[4].value,u[4].value))}function solveRem(e,n,t){const r=n.value;if(!isNumeric(r))return-1;const u=convertUnit(r,t.value);if(!twoOfSameNumeric(r,u))return-1;let i;return i=0===u[4].value?Number.NaN:Number.isFinite(r[4].value)?Number.isFinite(u[4].value)?r[4].value%u[4].value:r[4].value:Number.NaN,resultToCalculation(e,r,i)}function solveRound(e,n,t,r){const u=t.value;if(!isNumeric(u))return-1;const i=convertUnit(u,r.value);if(!twoOfSameNumeric(u,i))return-1;let a;if(0===i[4].value)a=Number.NaN;else if(Number.isFinite(u[4].value)||Number.isFinite(i[4].value))if(!Number.isFinite(u[4].value)&&Number.isFinite(i[4].value))a=u[4].value;else if(Number.isFinite(u[4].value)&&!Number.isFinite(i[4].value))switch(n){case"down":a=u[4].value<0?-1/0:Object.is(-0,0*u[4].value)?-0:0;break;case"up":a=u[4].value>0?1/0:Object.is(0,0*u[4].value)?0:-0;break;default:a=Object.is(0,0*u[4].value)?0:-0}else if(Number.isFinite(i[4].value))switch(n){case"down":a=Math.floor(u[4].value/i[4].value)*i[4].value;break;case"up":a=Math.ceil(u[4].value/i[4].value)*i[4].value;break;case"to-zero":a=Math.trunc(u[4].value/i[4].value)*i[4].value;break;default:{let e=Math.floor(u[4].value/i[4].value)*i[4].value,n=Math.ceil(u[4].value/i[4].value)*i[4].value;if(e>n){const t=e;e=n,n=t}const t=Math.abs(u[4].value-e),r=Math.abs(u[4].value-n);a=t===r?n:t<r?e:n;break}}else a=u[4].value;else a=Number.NaN;return resultToCalculation(e,u,a)}function solveSign(e,n){const t=n.value;if(!isDimensionOrNumber(t))return-1;return numberToCalculation(e,Math.sign(t[4].value))}function solveSin(e,n){const t=n.value;if(!isDimensionOrNumber(t))return-1;let r=t[4].value;if(t[0]===s.Dimension)switch(toLowerCaseAZ(t[4].unit)){case"rad":break;case"deg":r=w.get("rad")(t[4].value);break;case"grad":r=h.get("rad")(t[4].value);break;case"turn":r=x.get("rad")(t[4].value);break;default:return-1}return r=Math.sin(r),numberToCalculation(e,r)}function solveSqrt(e,n){const t=n.value;if(t[0]!==s.Number)return-1;return numberToCalculation(e,Math.sqrt(t[4].value))}function solveTan(e,n){const t=n.value;if(!isDimensionOrNumber(t))return-1;const r=t[4].value;let u=0,i=t[4].value;if(t[0]===s.Dimension)switch(toLowerCaseAZ(t[4].unit)){case"rad":u=k.get("deg")(r);break;case"deg":u=r,i=w.get("rad")(r);break;case"grad":u=h.get("deg")(r),i=h.get("rad")(r);break;case"turn":u=x.get("deg")(r),i=x.get("rad")(r);break;default:return-1}const a=u/90;return i=u%90==0&&a%2!=0?a>0?1/0:-1/0:Math.tan(i),numberToCalculation(e,i)}function subtraction(n){if(2!==n.length)return-1;const t=n[0].value;let r=n[1].value;if(t[0]===s.Number&&r[0]===s.Number){const n=t[4].value-r[4].value;return new e([s.Number,n.toString(),t[2],r[3],{value:n,type:t[4].type===v.Integer&&r[4].type===v.Integer?v.Integer:v.Number}])}if(t[0]===s.Percentage&&r[0]===s.Percentage){const n=t[4].value-r[4].value;return new e([s.Percentage,n.toString()+"%",t[2],r[3],{value:n}])}if(t[0]===s.Dimension&&r[0]===s.Dimension&&(r=convertUnit(t,r),toLowerCaseAZ(t[4].unit)===toLowerCaseAZ(r[4].unit))){const n=t[4].value-r[4].value;return new e([s.Dimension,n.toString()+t[4].unit,t[2],r[3],{value:n,type:t[4].type===v.Integer&&r[4].type===v.Integer?v.Integer:v.Number,unit:t[4].unit}])}return-1}function solveLog(e,t){if(1===t.length){const r=t[0];if(!r||!n(r))return-1;const u=r.value;if(u[0]!==s.Number)return-1;return numberToCalculation(e,Math.log(u[4].value))}if(2===t.length){const r=t[0];if(!r||!n(r))return-1;const u=r.value;if(u[0]!==s.Number)return-1;const i=t[1];if(!i||!n(i))return-1;const a=i.value;if(a[0]!==s.Number)return-1;return numberToCalculation(e,Math.log(u[4].value)/Math.log(a[4].value))}return-1}const Z=new Map([["abs",function abs(e,n){return singleNodeSolver(e,n,solveAbs)}],["acos",function acos(e,n){return singleNodeSolver(e,n,solveACos)}],["asin",function asin(e,n){return singleNodeSolver(e,n,solveASin)}],["atan",function atan(e,n){return singleNodeSolver(e,n,solveATan)}],["atan2",function atan2(e,n){return twoCommaSeparatedNodesSolver(e,n,solveATan2)}],["calc",calc$1],["clamp",function clamp(e,u){const i=resolveGlobalsAndConstants([...e.value.filter((e=>!t(e)&&!r(e)))],u),o=[],l=[],c=[];{let e=o;for(let t=0;t<i.length;t++){const r=i[t];if(n(r)&&r.value[0]===s.Comma){if(e===c)return-1;if(e===l){e=c;continue}if(e===o){e=l;continue}return-1}e.push(r)}}const v=solve(calc$1(new a([s.Function,"calc(",-1,-1,{value:"calc"}],[s.CloseParen,")",-1,-1,void 0],o),u));if(-1===v)return-1;const m=solve(calc$1(new a([s.Function,"calc(",-1,-1,{value:"calc"}],[s.CloseParen,")",-1,-1,void 0],l),u));if(-1===m)return-1;const f=solve(calc$1(new a([s.Function,"calc(",-1,-1,{value:"calc"}],[s.CloseParen,")",-1,-1,void 0],c),u));if(-1===f)return-1;return solveClamp(e,v,m,f)}],["cos",function cos(e,n){return singleNodeSolver(e,n,solveCos)}],["exp",function exp(e,n){return singleNodeSolver(e,n,solveExp)}],["hypot",function hypot(e,n){return variadicNodesSolver(e,n,solveHypot)}],["log",function log(e,n){return variadicNodesSolver(e,n,solveLog)}],["max",function max(e,n){return variadicNodesSolver(e,n,solveMax)}],["min",function min(e,n){return variadicNodesSolver(e,n,solveMin)}],["mod",function mod(e,n){return twoCommaSeparatedNodesSolver(e,n,solveMod)}],["pow",function pow(e,n){return twoCommaSeparatedNodesSolver(e,n,solvePow)}],["rem",function rem(e,n){return twoCommaSeparatedNodesSolver(e,n,solveRem)}],["round",function round(e,u){const i=resolveGlobalsAndConstants([...e.value.filter((e=>!t(e)&&!r(e)))],u);let o="";const l=[],c=[];{let e=l;for(let t=0;t<i.length;t++){const r=i[t];if(!o&&0===l.length&&0===c.length&&n(r)&&r.value[0]===s.Ident){const e=toLowerCaseAZ(r.value[4].value);if(L.has(e)){o=e;continue}}if(n(r)&&r.value[0]===s.Comma){if(e===c)return-1;if(e===l&&o&&0===l.length)continue;if(e===l){e=c;continue}return-1}e.push(r)}}const v=solve(calc$1(new a([s.Function,"calc(",-1,-1,{value:"calc"}],[s.CloseParen,")",-1,-1,void 0],l),u));if(-1===v)return-1;const m=solve(calc$1(new a([s.Function,"calc(",-1,-1,{value:"calc"}],[s.CloseParen,")",-1,-1,void 0],c),u));if(-1===m)return-1;o||(o="nearest");return solveRound(e,o,v,m)}],["sign",function sign(e,n){return singleNodeSolver(e,n,solveSign)}],["sin",function sin(e,n){return singleNodeSolver(e,n,solveSin)}],["sqrt",function sqrt(e,n){return singleNodeSolver(e,n,solveSqrt)}],["tan",function tan(e,n){return singleNodeSolver(e,n,solveTan)}]]);function calc$1(e,a){const o=resolveGlobalsAndConstants([...e.value.filter((e=>!t(e)&&!r(e)))],a);if(1===o.length&&n(o[0]))return{inputs:[o[0]],operation:unary};let l=0;for(;l<o.length;){const e=o[l];if(u(e)&&e.startToken[0]===s.OpenParen){const n=calc$1(e,a);if(-1===n)return-1;o.splice(l,1,n)}else if(i(e)){const n=Z.get(toLowerCaseAZ(e.getName()));if(!n)return-1;const t=n(e,a);if(-1===t)return-1;o.splice(l,1,t)}else l++}if(l=0,1===o.length&&isCalculation(o[0]))return o[0];for(;l<o.length;){const e=o[l];if(!e||!n(e)&&!isCalculation(e)){l++;continue}const t=o[l+1];if(!t||!n(t)){l++;continue}const r=t.value;if(r[0]!==s.Delim||"*"!==r[4].value&&"/"!==r[4].value){l++;continue}const u=o[l+2];if(!u||!n(u)&&!isCalculation(u))return-1;"*"!==r[4].value?"/"!==r[4].value?l++:o.splice(l,3,{inputs:[e,u],operation:division}):o.splice(l,3,{inputs:[e,u],operation:multiplication})}if(l=0,1===o.length&&isCalculation(o[0]))return o[0];for(;l<o.length;){const e=o[l];if(!e||!n(e)&&!isCalculation(e)){l++;continue}const t=o[l+1];if(!t||!n(t)){l++;continue}const r=t.value;if(r[0]!==s.Delim||"+"!==r[4].value&&"-"!==r[4].value){l++;continue}const u=o[l+2];if(!u||!n(u)&&!isCalculation(u))return-1;"+"!==r[4].value?"-"!==r[4].value?l++:o.splice(l,3,{inputs:[e,u],operation:subtraction}):o.splice(l,3,{inputs:[e,u],operation:addition})}return 1===o.length&&isCalculation(o[0])?o[0]:-1}function singleNodeSolver(e,n,u){const i=resolveGlobalsAndConstants([...e.value.filter((e=>!t(e)&&!r(e)))],n),o=solve(calc$1(new a([s.Function,"calc(",-1,-1,{value:"calc"}],[s.CloseParen,")",-1,-1,void 0],i),n));return-1===o?-1:u(e,o)}function twoCommaSeparatedNodesSolver(e,u,i){const o=resolveGlobalsAndConstants([...e.value.filter((e=>!t(e)&&!r(e)))],u),l=[],c=[];{let e=l;for(let t=0;t<o.length;t++){const r=o[t];if(n(r)&&r.value[0]===s.Comma){if(e===c)return-1;if(e===l){e=c;continue}return-1}e.push(r)}}const v=solve(calc$1(new a([s.Function,"calc(",-1,-1,{value:"calc"}],[s.CloseParen,")",-1,-1,void 0],l),u));if(-1===v)return-1;const m=solve(calc$1(new a([s.Function,"calc(",-1,-1,{value:"calc"}],[s.CloseParen,")",-1,-1,void 0],c),u));return-1===m?-1:i(e,v,m)}function variadicNodesSolver(e,u,i){const o=resolveGlobalsAndConstants([...e.value.filter((e=>!t(e)&&!r(e)))],u),l=[];{const e=[];let t=[];for(let r=0;r<o.length;r++){const u=o[r];n(u)&&u.value[0]===s.Comma?(e.push(t),t=[]):t.push(u)}e.push(t);for(let n=0;n<e.length;n++){if(0===e[n].length)return-1;const t=solve(calc$1(new a([s.Function,"calc(",-1,-1,{value:"calc"}],[s.CloseParen,")",-1,-1,void 0],e[n]),u));if(-1===t)return-1;l.push(t)}}return i(e,l)}const L=new Set(["nearest","up","down","to-zero"]);function patchNaN(n){if(-1===n)return-1;if(i(n))return n;const t=n.value;return t[0]!==s.Number&&t[0]!==s.Percentage&&t[0]!==s.Dimension?n:Number.isNaN(t[4].value)?t[0]===s.Number?new a([s.Function,"calc(",t[2],t[3],{value:"calc"}],[s.CloseParen,")",t[2],t[3],void 0],[new e([s.Ident,"NaN",t[2],t[3],{value:"NaN"}])]):t[0]===s.Dimension?new a([s.Function,"calc(",t[2],t[3],{value:"calc"}],[s.CloseParen,")",t[2],t[3],void 0],[new e([s.Ident,"NaN",t[2],t[3],{value:"NaN"}]),new o([[s.Whitespace," ",t[2],t[3],void 0]]),new e([s.Delim,"*",t[2],t[3],{value:"*"}]),new o([[s.Whitespace," ",t[2],t[3],void 0]]),new e([s.Dimension,"1"+t[4].unit,t[2],t[3],{value:1,type:v.Integer,unit:t[4].unit}])]):t[0]===s.Percentage?new a([s.Function,"calc(",t[2],t[3],{value:"calc"}],[s.CloseParen,")",t[2],t[3],void 0],[new e([s.Ident,"NaN",t[2],t[3],{value:"NaN"}]),new o([[s.Whitespace," ",t[2],t[3],void 0]]),new e([s.Delim,"*",t[2],t[3],{value:"*"}]),new o([[s.Whitespace," ",t[2],t[3],void 0]]),new e([s.Percentage,"1%",t[2],t[3],{value:1}])]):-1:n}function patchInfinity(n){if(-1===n)return-1;if(i(n))return n;const t=n.value;if(t[0]!==s.Number&&t[0]!==s.Percentage&&t[0]!==s.Dimension)return n;if(Number.isFinite(t[4].value))return n;let r="";return Number.NEGATIVE_INFINITY===t[4].value&&(r="-"),t[0]===s.Number?new a([s.Function,"calc(",t[2],t[3],{value:"calc"}],[s.CloseParen,")",t[2],t[3],void 0],[new e([s.Ident,r+"infinity",t[2],t[3],{value:r+"infinity"}])]):t[0]===s.Dimension?new a([s.Function,"calc(",t[2],t[3],{value:"calc"}],[s.CloseParen,")",t[2],t[3],void 0],[new e([s.Ident,r+"infinity",t[2],t[3],{value:r+"infinity"}]),new o([[s.Whitespace," ",t[2],t[3],void 0]]),new e([s.Delim,"*",t[2],t[3],{value:"*"}]),new o([[s.Whitespace," ",t[2],t[3],void 0]]),new e([s.Dimension,"1"+t[4].unit,t[2],t[3],{value:1,type:v.Integer,unit:t[4].unit}])]):t[0]===s.Percentage?new a([s.Function,"calc(",t[2],t[3],{value:"calc"}],[s.CloseParen,")",t[2],t[3],void 0],[new e([s.Ident,r+"infinity",t[2],t[3],{value:r+"infinity"}]),new o([[s.Whitespace," ",t[2],t[3],void 0]]),new e([s.Delim,"*",t[2],t[3],{value:"*"}]),new o([[s.Whitespace," ",t[2],t[3],void 0]]),new e([s.Percentage,"1%",t[2],t[3],{value:1}])]):-1}function patchMinusZero(e){if(-1===e)return-1;if(i(e))return e;const n=e.value;return n[0]!==s.Number&&n[0]!==s.Percentage&&n[0]!==s.Dimension?e:Object.is(-0,n[4].value)?("-0"===n[1]||(n[1]=`calc(-1 * ${n[1]})`),e):e}function patchPrecision(e,n=13){if(-1===e)return-1;if(i(e))return e;const t=e.value;if(t[0]!==s.Number&&t[0]!==s.Percentage&&t[0]!==s.Dimension)return e;if(Number.isInteger(t[4].value))return e;const r=Number(t[4].value.toFixed(n)).toString();return t[0]===s.Number?t[1]=r:t[0]===s.Percentage?t[1]=r+"%":t[0]===s.Dimension&&(t[1]=r+t[4].unit),e}function patchCanonicalUnit(e){return-1===e?-1:(i(e)||e.value[0]!==s.Dimension||(e.value=toCanonicalUnit(e.value)),e)}function patchCalcResult(e,n){let t;return t=patchNaN(e),t=patchInfinity(t),n?.toCanonicalUnits&&(t=patchCanonicalUnit(t)),t=patchPrecision(t,n?.precision),t=patchMinusZero(t),t}function tokenizeGlobals(e){const n=new Map;if(!e)return n;for(const[t,r]of e)if(m(r))n.set(t,r);else if("string"!=typeof r);else{const e=f({css:r}),u=e.nextToken();if(e.nextToken(),!e.endOfFile())continue;if(!u)continue;if(u[0]!==s.Number&&u[0]!==s.Dimension&&u[0]!==s.Percentage)continue;n.set(t,u)}return n}function calc(e,n){return calcFromComponentValues(l(p({css:e}),{}),n).map((e=>e.map((e=>N(...e.tokens()))).join(""))).join(",")}function calcFromComponentValues(e,n){const t=tokenizeGlobals(n?.globals);return c(e,(e=>{if(!i(e))return;const r=Z.get(toLowerCaseAZ(e.getName()));if(!r)return;const u=patchCalcResult(solve(r(e,t)),n);return-1!==u?u:void 0}))}const z=new Set(Z.keys());export{calc,calcFromComponentValues,z as mathFunctionNames};
+import{TokenNode as e,isTokenNode as n,isWhitespaceNode as t,isCommentNode as r,isSimpleBlockNode as u,isFunctionNode as a,FunctionNode as i,WhitespaceNode as o,parseCommaSeparatedListOfComponentValues as l,replaceComponentValues as c}from"@csstools/css-parser-algorithms";import{isTokenDimension as s,TokenType as v,NumberType as f,mutateUnit as p,isTokenNumber as m,isTokenPercentage as g,isTokenIdent as N,isTokenNumeric as d,isTokenOpenParen as b,isTokenDelim as h,isTokenComma as w,isToken as C,tokenizer as I,tokenize as S,stringify as y}from"@csstools/css-tokenizer";const 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"},A=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]]),k=new Map([["deg",e=>e],["grad",e=>e/.9],["rad",e=>e/180*Math.PI],["turn",e=>e/360]]),x=new Map([["deg",e=>.9*e],["grad",e=>e],["rad",e=>.9*e/180*Math.PI],["turn",e=>.9*e/360]]),F=new Map([["hz",e=>e],["khz",e=>e/1e3]]),P=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]]),O=new Map([["hz",e=>1e3*e],["khz",e=>e]]),W=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]]),D=new Map([["ms",e=>e],["s",e=>e/1e3]]),L=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]]),U=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]]),$=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]]),q=new Map([["ms",e=>1e3*e],["s",e=>e]]),E=new Map([["deg",e=>360*e],["grad",e=>360*e/.9],["rad",e=>360*e/180*Math.PI],["turn",e=>e]]),G=new Map([["cm",A],["mm",W],["q",U],["in",P],["pc",L],["pt",z],["px",Z],["ms",D],["s",q],["deg",k],["grad",x],["rad",$],["turn",E],["hz",F],["khz",O]]);function convertUnit(e,n){if(!s(e))return n;if(!s(n))return n;const t=toLowerCaseAZ(e[4].unit),r=toLowerCaseAZ(n[4].unit);if(t===r)return n;const u=G.get(r);if(!u)return n;const a=u.get(t);if(!a)return n;const i=a(n[4].value),o=[v.Dimension,"",n[2],n[3],{...n[4],signCharacter:i<0?"-":void 0,type:Number.isInteger(i)?f.Integer:f.Number,value:i}];return p(o,e[4].unit),o}function toCanonicalUnit(e){if(!s(e))return e;const n=toLowerCaseAZ(e[4].unit),t=T[n];if(n===t)return e;const r=G.get(n);if(!r)return e;const u=r.get(t);if(!u)return e;const a=u(e[4].value),i=[v.Dimension,"",e[2],e[3],{...e[4],signCharacter:a<0?"-":void 0,type:Number.isInteger(a)?f.Integer:f.Number,value:a}];return p(i,t),i}function addition(n){if(2!==n.length)return-1;const t=n[0].value;let r=n[1].value;if(m(t)&&m(r)){const n=t[4].value+r[4].value;return new e([v.Number,n.toString(),t[2],r[3],{value:n,type:t[4].type===f.Integer&&r[4].type===f.Integer?f.Integer:f.Number}])}if(g(t)&&g(r)){const n=t[4].value+r[4].value;return new e([v.Percentage,n.toString()+"%",t[2],r[3],{value:n}])}if(s(t)&&s(r)&&(r=convertUnit(t,r),toLowerCaseAZ(t[4].unit)===toLowerCaseAZ(r[4].unit))){const n=t[4].value+r[4].value;return new e([v.Dimension,n.toString()+t[4].unit,t[2],r[3],{value:n,type:t[4].type===f.Integer&&r[4].type===f.Integer?f.Integer:f.Number,unit:t[4].unit}])}return-1}function division(n){if(2!==n.length)return-1;const t=n[0].value,r=n[1].value;if(m(t)&&m(r)){const n=t[4].value/r[4].value;return new e([v.Number,n.toString(),t[2],r[3],{value:n,type:Number.isInteger(n)?f.Integer:f.Number}])}if(g(t)&&m(r)){const n=t[4].value/r[4].value;return new e([v.Percentage,n.toString()+"%",t[2],r[3],{value:n}])}if(s(t)&&m(r)){const n=t[4].value/r[4].value;return new e([v.Dimension,n.toString()+t[4].unit,t[2],r[3],{value:n,type:Number.isInteger(n)?f.Integer:f.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){if(-1===e)return-1;const t=[];for(let r=0;r<e.inputs.length;r++){const u=e.inputs[r];if(n(u)){t.push(u);continue}const a=solve(u);if(-1===a)return-1;t.push(a)}return e.operation(t)}function multiplication(n){if(2!==n.length)return-1;const t=n[0].value,r=n[1].value;if(m(t)&&m(r)){const n=t[4].value*r[4].value;return new e([v.Number,n.toString(),t[2],r[3],{value:n,type:t[4].type===f.Integer&&r[4].type===f.Integer?f.Integer:f.Number}])}if(g(t)&&m(r)){const n=t[4].value*r[4].value;return new e([v.Percentage,n.toString()+"%",t[2],r[3],{value:n}])}if(m(t)&&g(r)){const n=t[4].value*r[4].value;return new e([v.Percentage,n.toString()+"%",t[2],r[3],{value:n}])}if(s(t)&&m(r)){const n=t[4].value*r[4].value;return new e([v.Dimension,n.toString()+t[4].unit,t[2],r[3],{value:n,type:t[4].type===f.Integer&&r[4].type===f.Integer?f.Integer:f.Number,unit:t[4].unit}])}if(m(t)&&s(r)){const n=t[4].value*r[4].value;return new e([v.Dimension,n.toString()+r[4].unit,t[2],r[3],{value:n,type:t[4].type===f.Integer&&r[4].type===f.Integer?f.Integer:f.Number,unit:r[4].unit}])}return-1}function resolveGlobalsAndConstants(t,r){for(let u=0;u<t.length;u++){const a=t[u];if(!n(a))continue;const i=a.value;if(!N(i))continue;const o=toLowerCaseAZ(i[4].value);switch(o){case"e":t.splice(u,1,new e([v.Number,Math.E.toString(),i[2],i[3],{value:Math.E,type:f.Number}]));break;case"pi":t.splice(u,1,new e([v.Number,Math.PI.toString(),i[2],i[3],{value:Math.PI,type:f.Number}]));break;case"infinity":t.splice(u,1,new e([v.Number,"infinity",i[2],i[3],{value:1/0,type:f.Number}]));break;case"-infinity":t.splice(u,1,new e([v.Number,"-infinity",i[2],i[3],{value:-1/0,type:f.Number}]));break;case"nan":t.splice(u,1,new e([v.Number,"NaN",i[2],i[3],{value:Number.NaN,type:f.Number}]));break;default:if(r.has(o)){const n=r.get(o);t.splice(u,1,new e(n))}}}return t}function unary(e){if(1!==e.length)return-1;const n=e[0].value;return d(n)?e[0]:-1}function resultToCalculation(e,n,t){return s(n)?dimensionToCalculation(e,n[4].unit,t):g(n)?percentageToCalculation(e,t):m(n)?numberToCalculation(e,t):-1}function dimensionToCalculation(n,t,r){const u=n.tokens();return{inputs:[new e([v.Dimension,r.toString()+t,u[0][2],u[u.length-1][3],{value:r,type:Number.isInteger(r)?f.Integer:f.Number,unit:t}])],operation:unary}}function percentageToCalculation(n,t){const r=n.tokens();return{inputs:[new e([v.Percentage,t.toString()+"%",r[0][2],r[r.length-1][3],{value:t}])],operation:unary}}function numberToCalculation(n,t){const r=n.tokens();return{inputs:[new e([v.Number,t.toString(),r[0][2],r[r.length-1][3],{value:t,type:Number.isInteger(t)?f.Integer:f.Number}])],operation:unary}}function solveACos(e,n){const t=n.value;if(!m(t))return-1;return dimensionToCalculation(e,"rad",Math.acos(t[4].value))}function solveASin(e,n){const t=n.value;if(!m(t))return-1;return dimensionToCalculation(e,"rad",Math.asin(t[4].value))}function solveATan(e,n){const t=n.value;if(!m(t))return-1;return dimensionToCalculation(e,"rad",Math.atan(t[4].value))}function isDimensionOrNumber(e){return s(e)||m(e)}function arrayOfSameNumeric(e){if(0===e.length)return!0;const n=e[0];if(!d(n))return!1;if(1===e.length)return!0;if(s(n)){const t=toLowerCaseAZ(n[4].unit);for(let r=1;r<e.length;r++){const u=e[r];if(n[0]!==u[0])return!1;if(t!==toLowerCaseAZ(u[4].unit))return!1}return!0}for(let t=1;t<e.length;t++){const r=e[t];if(n[0]!==r[0])return!1}return!0}function twoOfSameNumeric(e,n){return!!d(e)&&(s(e)?e[0]===n[0]&&toLowerCaseAZ(e[4].unit)===toLowerCaseAZ(n[4].unit):e[0]===n[0])}function solveATan2(e,n,t){const r=n.value;if(!isDimensionOrNumber(r))return-1;const u=convertUnit(r,t.value);if(!twoOfSameNumeric(r,u))return-1;return dimensionToCalculation(e,"rad",Math.atan2(r[4].value,u[4].value))}function solveAbs(e,n){const t=n.value;if(!isDimensionOrNumber(t))return-1;return resultToCalculation(e,t,Math.abs(t[4].value))}function solveClamp(e,t,r,u){if(!n(t)||!n(r)||!n(u))return-1;const a=t.value;if(!d(a))return-1;const i=convertUnit(a,r.value);if(!twoOfSameNumeric(a,i))return-1;const o=convertUnit(a,u.value);if(!twoOfSameNumeric(a,o))return-1;return resultToCalculation(e,a,Math.max(a[4].value,Math.min(i[4].value,o[4].value)))}function solveCos(e,n){const t=n.value;if(!isDimensionOrNumber(t))return-1;let r=t[4].value;if(s(t))switch(t[4].unit.toLowerCase()){case"rad":break;case"deg":r=k.get("rad")(t[4].value);break;case"grad":r=x.get("rad")(t[4].value);break;case"turn":r=E.get("rad")(t[4].value);break;default:return-1}return r=Math.cos(r),numberToCalculation(e,r)}function solveExp(e,n){const t=n.value;if(!m(t))return-1;return numberToCalculation(e,Math.exp(t[4].value))}function solveHypot(e,t){const r=t[0];if(!r||!n(r))return-1;if(1!==new Set(t.map((e=>e.type))).size)return-1;const u=r.value;if(!d(u))return-1;const a=t.map((e=>convertUnit(u,e.value)));if(!arrayOfSameNumeric(a))return-1;const i=a.map((e=>e[4].value)),o=Math.hypot(...i);return resultToCalculation(e,u,o)}function solveMax(e,t){const r=t[0];if(!r||!n(r))return-1;if(1!==new Set(t.map((e=>e.type))).size)return-1;const u=r.value;if(!d(u))return-1;const a=t.map((e=>convertUnit(u,e.value)));if(!arrayOfSameNumeric(a))return-1;const i=a.map((e=>e[4].value)),o=Math.max(...i);return resultToCalculation(e,u,o)}function solveMin(e,t){const r=t[0];if(!r||!n(r))return-1;if(1!==new Set(t.map((e=>e.type))).size)return-1;const u=r.value;if(!d(u))return-1;const a=t.map((e=>convertUnit(u,e.value)));if(!arrayOfSameNumeric(a))return-1;const i=a.map((e=>e[4].value)),o=Math.min(...i);return resultToCalculation(e,u,o)}function solveMod(e,n,t){const r=n.value;if(!d(r))return-1;const u=convertUnit(r,t.value);if(!twoOfSameNumeric(r,u))return-1;let a;return a=0===u[4].value?Number.NaN:Number.isFinite(r[4].value)&&(Number.isFinite(u[4].value)||(u[4].value!==Number.POSITIVE_INFINITY||r[4].value!==Number.NEGATIVE_INFINITY&&!Object.is(0*r[4].value,-0))&&(u[4].value!==Number.NEGATIVE_INFINITY||r[4].value!==Number.POSITIVE_INFINITY&&!Object.is(0*r[4].value,0)))?Number.isFinite(u[4].value)?(r[4].value%u[4].value+u[4].value)%u[4].value:r[4].value:Number.NaN,resultToCalculation(e,r,a)}function solvePow(e,n,t){const r=n.value,u=t.value;if(!m(r))return-1;if(!twoOfSameNumeric(r,u))return-1;return numberToCalculation(e,Math.pow(r[4].value,u[4].value))}function solveRem(e,n,t){const r=n.value;if(!d(r))return-1;const u=convertUnit(r,t.value);if(!twoOfSameNumeric(r,u))return-1;let a;return a=0===u[4].value?Number.NaN:Number.isFinite(r[4].value)?Number.isFinite(u[4].value)?r[4].value%u[4].value:r[4].value:Number.NaN,resultToCalculation(e,r,a)}function solveRound(e,n,t,r){const u=t.value;if(!d(u))return-1;const a=convertUnit(u,r.value);if(!twoOfSameNumeric(u,a))return-1;let i;if(0===a[4].value)i=Number.NaN;else if(Number.isFinite(u[4].value)||Number.isFinite(a[4].value))if(!Number.isFinite(u[4].value)&&Number.isFinite(a[4].value))i=u[4].value;else if(Number.isFinite(u[4].value)&&!Number.isFinite(a[4].value))switch(n){case"down":i=u[4].value<0?-1/0:Object.is(-0,0*u[4].value)?-0:0;break;case"up":i=u[4].value>0?1/0:Object.is(0,0*u[4].value)?0:-0;break;default:i=Object.is(0,0*u[4].value)?0:-0}else if(Number.isFinite(a[4].value))switch(n){case"down":i=Math.floor(u[4].value/a[4].value)*a[4].value;break;case"up":i=Math.ceil(u[4].value/a[4].value)*a[4].value;break;case"to-zero":i=Math.trunc(u[4].value/a[4].value)*a[4].value;break;default:{let e=Math.floor(u[4].value/a[4].value)*a[4].value,n=Math.ceil(u[4].value/a[4].value)*a[4].value;if(e>n){const t=e;e=n,n=t}const t=Math.abs(u[4].value-e),r=Math.abs(u[4].value-n);i=t===r?n:t<r?e:n;break}}else i=u[4].value;else i=Number.NaN;return resultToCalculation(e,u,i)}function solveSign(e,n){const t=n.value;if(!isDimensionOrNumber(t))return-1;return numberToCalculation(e,Math.sign(t[4].value))}function solveSin(e,n){const t=n.value;if(!isDimensionOrNumber(t))return-1;let r=t[4].value;if(s(t))switch(toLowerCaseAZ(t[4].unit)){case"rad":break;case"deg":r=k.get("rad")(t[4].value);break;case"grad":r=x.get("rad")(t[4].value);break;case"turn":r=E.get("rad")(t[4].value);break;default:return-1}return r=Math.sin(r),numberToCalculation(e,r)}function solveSqrt(e,n){const t=n.value;if(!m(t))return-1;return numberToCalculation(e,Math.sqrt(t[4].value))}function solveTan(e,n){const t=n.value;if(!isDimensionOrNumber(t))return-1;const r=t[4].value;let u=0,a=t[4].value;if(s(t))switch(toLowerCaseAZ(t[4].unit)){case"rad":u=$.get("deg")(r);break;case"deg":u=r,a=k.get("rad")(r);break;case"grad":u=x.get("deg")(r),a=x.get("rad")(r);break;case"turn":u=E.get("deg")(r),a=E.get("rad")(r);break;default:return-1}const i=u/90;return a=u%90==0&&i%2!=0?i>0?1/0:-1/0:Math.tan(a),numberToCalculation(e,a)}function subtraction(n){if(2!==n.length)return-1;const t=n[0].value;let r=n[1].value;if(m(t)&&m(r)){const n=t[4].value-r[4].value;return new e([v.Number,n.toString(),t[2],r[3],{value:n,type:t[4].type===f.Integer&&r[4].type===f.Integer?f.Integer:f.Number}])}if(g(t)&&g(r)){const n=t[4].value-r[4].value;return new e([v.Percentage,n.toString()+"%",t[2],r[3],{value:n}])}if(s(t)&&s(r)&&(r=convertUnit(t,r),toLowerCaseAZ(t[4].unit)===toLowerCaseAZ(r[4].unit))){const n=t[4].value-r[4].value;return new e([v.Dimension,n.toString()+t[4].unit,t[2],r[3],{value:n,type:t[4].type===f.Integer&&r[4].type===f.Integer?f.Integer:f.Number,unit:t[4].unit}])}return-1}function solveLog(e,t){if(1===t.length){const r=t[0];if(!r||!n(r))return-1;const u=r.value;if(!m(u))return-1;return numberToCalculation(e,Math.log(u[4].value))}if(2===t.length){const r=t[0];if(!r||!n(r))return-1;const u=r.value;if(!m(u))return-1;const a=t[1];if(!a||!n(a))return-1;const i=a.value;if(!m(i))return-1;return numberToCalculation(e,Math.log(u[4].value)/Math.log(i[4].value))}return-1}const j=/^none$/i;function isNone(e){if(Array.isArray(e)){const n=e.filter((e=>!(t(e)&&r(e))));return 1===n.length&&isNone(n[0])}if(!n(e))return!1;const u=e.value;return!!N(u)&&j.test(u[4].value)}const V=new Map([["abs",function abs(e,n){return singleNodeSolver(e,n,solveAbs)}],["acos",function acos(e,n){return singleNodeSolver(e,n,solveACos)}],["asin",function asin(e,n){return singleNodeSolver(e,n,solveASin)}],["atan",function atan(e,n){return singleNodeSolver(e,n,solveATan)}],["atan2",function atan2(e,n){return twoCommaSeparatedNodesSolver(e,n,solveATan2)}],["calc",calc$1],["clamp",function clamp(u,a){const o=resolveGlobalsAndConstants([...u.value.filter((e=>!r(e)&&!t(e)))],a),l=[],c=[],s=[];{let e=l;for(let t=0;t<o.length;t++){const r=o[t];if(n(r)&&w(r.value)){if(e===s)return-1;if(e===c){e=s;continue}if(e===l){e=c;continue}return-1}e.push(r)}}const f=isNone(l),p=isNone(s);if(f&&p)return calc$1(calcWrapper(c),a);const m=solve(calc$1(calcWrapper(c),a));if(-1===m)return-1;if(f){const n=solve(calc$1(calcWrapper(s),a));return-1===n?-1:solveMin((g=m,N=n,new i([v.Function,"min(",-1,-1,{value:"min"}],[v.CloseParen,")",-1,-1,void 0],[g,new e([v.Comma,",",-1,-1,void 0]),N])),[m,n])}if(p){const e=solve(calc$1(calcWrapper(l),a));return-1===e?-1:solveMax(maxWrapper(e,m),[e,m])}var g,N;const d=solve(calc$1(calcWrapper(l),a));if(-1===d)return-1;const b=solve(calc$1(calcWrapper(s),a));if(-1===b)return-1;return solveClamp(u,d,m,b)}],["cos",function cos(e,n){return singleNodeSolver(e,n,solveCos)}],["exp",function exp(e,n){return singleNodeSolver(e,n,solveExp)}],["hypot",function hypot(e,n){return variadicNodesSolver(e,n,solveHypot)}],["log",function log(e,n){return variadicNodesSolver(e,n,solveLog)}],["max",function max(e,n){return variadicNodesSolver(e,n,solveMax)}],["min",function min(e,n){return variadicNodesSolver(e,n,solveMin)}],["mod",function mod(e,n){return twoCommaSeparatedNodesSolver(e,n,solveMod)}],["pow",function pow(e,n){return twoCommaSeparatedNodesSolver(e,n,solvePow)}],["rem",function rem(e,n){return twoCommaSeparatedNodesSolver(e,n,solveRem)}],["round",function round(u,a){const i=resolveGlobalsAndConstants([...u.value.filter((e=>!r(e)&&!t(e)))],a);let o="",l=!1;const c=[],s=[];{let e=c;for(let t=0;t<i.length;t++){const r=i[t];if(!o&&0===c.length&&0===s.length&&n(r)&&N(r.value)){const e=r.value[4].value.toLowerCase();if(R.has(e)){o=e;continue}}if(n(r)&&w(r.value)){if(e===s)return-1;if(e===c&&o&&0===c.length)continue;if(e===c){l=!0,e=s;continue}return-1}e.push(r)}}const p=solve(calc$1(calcWrapper(c),a));if(-1===p)return-1;l||0!==s.length||s.push(new e([v.Number,"1",-1,-1,{value:1,type:f.Integer}]));const m=solve(calc$1(calcWrapper(s),a));if(-1===m)return-1;o||(o="nearest");return solveRound(u,o,p,m)}],["sign",function sign(e,n){return singleNodeSolver(e,n,solveSign)}],["sin",function sin(e,n){return singleNodeSolver(e,n,solveSin)}],["sqrt",function sqrt(e,n){return singleNodeSolver(e,n,solveSqrt)}],["tan",function tan(e,n){return singleNodeSolver(e,n,solveTan)}]]);function calc$1(e,i){const o=resolveGlobalsAndConstants([...e.value.filter((e=>!r(e)&&!t(e)))],i);if(1===o.length&&n(o[0]))return{inputs:[o[0]],operation:unary};let l=0;for(;l<o.length;){const e=o[l];if(u(e)&&b(e.startToken)){const n=calc$1(e,i);if(-1===n)return-1;o.splice(l,1,n)}else if(a(e)){const n=V.get(e.getName().toLowerCase());if(!n)return-1;const t=n(e,i);if(-1===t)return-1;o.splice(l,1,t)}else l++}if(l=0,1===o.length&&isCalculation(o[0]))return o[0];for(;l<o.length;){const e=o[l];if(!e||!n(e)&&!isCalculation(e)){l++;continue}const t=o[l+1];if(!t||!n(t)){l++;continue}const r=t.value;if(!h(r)||"*"!==r[4].value&&"/"!==r[4].value){l++;continue}const u=o[l+2];if(!u||!n(u)&&!isCalculation(u))return-1;"*"!==r[4].value?"/"!==r[4].value?l++:o.splice(l,3,{inputs:[e,u],operation:division}):o.splice(l,3,{inputs:[e,u],operation:multiplication})}if(l=0,1===o.length&&isCalculation(o[0]))return o[0];for(;l<o.length;){const e=o[l];if(!e||!n(e)&&!isCalculation(e)){l++;continue}const t=o[l+1];if(!t||!n(t)){l++;continue}const r=t.value;if(!h(r)||"+"!==r[4].value&&"-"!==r[4].value){l++;continue}const u=o[l+2];if(!u||!n(u)&&!isCalculation(u))return-1;"+"!==r[4].value?"-"!==r[4].value?l++:o.splice(l,3,{inputs:[e,u],operation:subtraction}):o.splice(l,3,{inputs:[e,u],operation:addition})}return 1===o.length&&isCalculation(o[0])?o[0]:-1}function singleNodeSolver(e,n,u){const a=solve(calc$1(calcWrapper(resolveGlobalsAndConstants([...e.value.filter((e=>!r(e)&&!t(e)))],n)),n));return-1===a?-1:u(e,a)}function twoCommaSeparatedNodesSolver(e,u,a){const i=resolveGlobalsAndConstants([...e.value.filter((e=>!r(e)&&!t(e)))],u),o=[],l=[];{let e=o;for(let t=0;t<i.length;t++){const r=i[t];if(n(r)&&w(r.value)){if(e===l)return-1;if(e===o){e=l;continue}return-1}e.push(r)}}const c=solve(calc$1(calcWrapper(o),u));if(-1===c)return-1;const s=solve(calc$1(calcWrapper(l),u));return-1===s?-1:a(e,c,s)}function variadicNodesSolver(e,u,a){const i=resolveGlobalsAndConstants([...e.value.filter((e=>!r(e)&&!t(e)))],u),o=[];{const e=[];let t=[];for(let r=0;r<i.length;r++){const u=i[r];n(u)&&w(u.value)?(e.push(t),t=[]):t.push(u)}e.push(t);for(let n=0;n<e.length;n++){if(0===e[n].length)return-1;const t=solve(calc$1(calcWrapper(e[n]),u));if(-1===t)return-1;o.push(t)}}return a(e,o)}const R=new Set(["nearest","up","down","to-zero"]);function calcWrapper(e){return new i([v.Function,"calc(",-1,-1,{value:"calc"}],[v.CloseParen,")",-1,-1,void 0],e)}function maxWrapper(n,t){return new i([v.Function,"max(",-1,-1,{value:"max"}],[v.CloseParen,")",-1,-1,void 0],[n,new e([v.Comma,",",-1,-1,void 0]),t])}function patchNaN(n){if(-1===n)return-1;if(a(n))return n;const t=n.value;return d(t)&&Number.isNaN(t[4].value)?m(t)?new i([v.Function,"calc(",t[2],t[3],{value:"calc"}],[v.CloseParen,")",t[2],t[3],void 0],[new e([v.Ident,"NaN",t[2],t[3],{value:"NaN"}])]):s(t)?new i([v.Function,"calc(",t[2],t[3],{value:"calc"}],[v.CloseParen,")",t[2],t[3],void 0],[new e([v.Ident,"NaN",t[2],t[3],{value:"NaN"}]),new o([[v.Whitespace," ",t[2],t[3],void 0]]),new e([v.Delim,"*",t[2],t[3],{value:"*"}]),new o([[v.Whitespace," ",t[2],t[3],void 0]]),new e([v.Dimension,"1"+t[4].unit,t[2],t[3],{value:1,type:f.Integer,unit:t[4].unit}])]):g(t)?new i([v.Function,"calc(",t[2],t[3],{value:"calc"}],[v.CloseParen,")",t[2],t[3],void 0],[new e([v.Ident,"NaN",t[2],t[3],{value:"NaN"}]),new o([[v.Whitespace," ",t[2],t[3],void 0]]),new e([v.Delim,"*",t[2],t[3],{value:"*"}]),new o([[v.Whitespace," ",t[2],t[3],void 0]]),new e([v.Percentage,"1%",t[2],t[3],{value:1}])]):-1:n}function patchInfinity(n){if(-1===n)return-1;if(a(n))return n;const t=n.value;if(!d(t))return n;if(Number.isFinite(t[4].value)||Number.isNaN(t[4].value))return n;let r="";return Number.NEGATIVE_INFINITY===t[4].value&&(r="-"),m(t)?new i([v.Function,"calc(",t[2],t[3],{value:"calc"}],[v.CloseParen,")",t[2],t[3],void 0],[new e([v.Ident,r+"infinity",t[2],t[3],{value:r+"infinity"}])]):s(t)?new i([v.Function,"calc(",t[2],t[3],{value:"calc"}],[v.CloseParen,")",t[2],t[3],void 0],[new e([v.Ident,r+"infinity",t[2],t[3],{value:r+"infinity"}]),new o([[v.Whitespace," ",t[2],t[3],void 0]]),new e([v.Delim,"*",t[2],t[3],{value:"*"}]),new o([[v.Whitespace," ",t[2],t[3],void 0]]),new e([v.Dimension,"1"+t[4].unit,t[2],t[3],{value:1,type:f.Integer,unit:t[4].unit}])]):new i([v.Function,"calc(",t[2],t[3],{value:"calc"}],[v.CloseParen,")",t[2],t[3],void 0],[new e([v.Ident,r+"infinity",t[2],t[3],{value:r+"infinity"}]),new o([[v.Whitespace," ",t[2],t[3],void 0]]),new e([v.Delim,"*",t[2],t[3],{value:"*"}]),new o([[v.Whitespace," ",t[2],t[3],void 0]]),new e([v.Percentage,"1%",t[2],t[3],{value:1}])])}function patchMinusZero(e){if(-1===e)return-1;if(a(e))return e;const n=e.value;return d(n)&&Object.is(-0,n[4].value)?("-0"===n[1]||(g(n)?n[1]="-0%":s(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(a(e))return e;const t=e.value;if(!d(t))return e;if(Number.isInteger(t[4].value))return e;const r=Number(t[4].value.toFixed(n)).toString();return m(t)?t[1]=r:g(t)?t[1]=r+"%":s(t)&&(t[1]=r+t[4].unit),e}function patchCanonicalUnit(e){return-1===e?-1:a(e)?e:s(e.value)?(e.value=toCanonicalUnit(e.value),e):e}function patchCalcResult(e,n){let t=e;return n?.censorIntoStandardRepresentableValues||(t=patchNaN(t),t=patchInfinity(t)),n?.toCanonicalUnits&&(t=patchCanonicalUnit(t)),t=patchPrecision(t,n?.precision),t=patchMinusZero(t),t}function tokenizeGlobals(e){const n=new Map;if(!e)return n;for(const[t,r]of e)if(C(r))n.set(t,r);else if("string"!=typeof r);else{const e=I({css:r}),u=e.nextToken();if(e.nextToken(),!e.endOfFile())continue;if(!u)continue;if(!d(u))continue;n.set(t,u)}return n}function calc(e,n){return calcFromComponentValues(l(S({css:e}),{}),n).map((e=>e.map((e=>y(...e.tokens()))).join(""))).join(",")}function calcFromComponentValues(e,n){const t=tokenizeGlobals(n?.globals);return c(e,(e=>{if(!a(e))return;const r=V.get(e.getName().toLowerCase());if(!r)return;const u=patchCalcResult(solve(r(e,t)),n);return-1!==u?u:void 0}))}const Y=new Set(V.keys());export{calc,calcFromComponentValues,Y as mathFunctionNames};
diff --git a/node_modules/@csstools/css-calc/package.json b/node_modules/@csstools/css-calc/package.json
index 258573a3..f97a2b12 100644
--- a/node_modules/@csstools/css-calc/package.json
+++ b/node_modules/@csstools/css-calc/package.json
@@ -1,7 +1,7 @@
{
"name": "@csstools/css-calc",
"description": "Solve CSS math expressions",
- "version": "1.1.6",
+ "version": "1.2.2",
"contributors": [
{
"name": "Antonio Laguna",
@@ -48,13 +48,13 @@
"dist"
],
"peerDependencies": {
- "@csstools/css-parser-algorithms": "^2.5.0",
- "@csstools/css-tokenizer": "^2.2.3"
+ "@csstools/css-parser-algorithms": "^2.6.3",
+ "@csstools/css-tokenizer": "^2.3.1"
},
"homepage": "https://github.com/csstools/postcss-plugins/tree/main/packages/css-calc#readme",
"repository": {
"type": "git",
- "url": "https://github.com/csstools/postcss-plugins.git",
+ "url": "git+https://github.com/csstools/postcss-plugins.git",
"directory": "packages/css-calc"
},
"bugs": "https://github.com/csstools/postcss-plugins/issues",
diff --git a/node_modules/@csstools/css-color-parser/CHANGELOG.md b/node_modules/@csstools/css-color-parser/CHANGELOG.md
index e52df39b..29ee5b14 100644
--- a/node_modules/@csstools/css-color-parser/CHANGELOG.md
+++ b/node_modules/@csstools/css-color-parser/CHANGELOG.md
@@ -1,30 +1,28 @@
# Changes to CSS Color Parser
-### 1.5.1
+### 2.0.2
-_December 31, 2023_
+_May 4, 2024_
-- Updated [`@csstools/css-tokenizer`](https://github.com/csstools/postcss-plugins/tree/main/packages/css-tokenizer) to [`2.2.3`](https://github.com/csstools/postcss-plugins/tree/main/packages/css-tokenizer/CHANGELOG.md#223) (patch)
-- Updated [`@csstools/css-parser-algorithms`](https://github.com/csstools/postcss-plugins/tree/main/packages/css-parser-algorithms) to [`2.5.0`](https://github.com/csstools/postcss-plugins/tree/main/packages/css-parser-algorithms/CHANGELOG.md#250) (minor)
-- Updated [`@csstools/css-calc`](https://github.com/csstools/postcss-plugins/tree/main/packages/css-calc) to [`1.1.6`](https://github.com/csstools/postcss-plugins/tree/main/packages/css-calc/CHANGELOG.md#116) (patch)
+- Updated [`@csstools/css-tokenizer`](https://github.com/csstools/postcss-plugins/tree/main/packages/css-tokenizer) to [`2.3.1`](https://github.com/csstools/postcss-plugins/tree/main/packages/css-tokenizer/CHANGELOG.md#231) (patch)
+- Updated [`@csstools/css-parser-algorithms`](https://github.com/csstools/postcss-plugins/tree/main/packages/css-parser-algorithms) to [`2.6.3`](https://github.com/csstools/postcss-plugins/tree/main/packages/css-parser-algorithms/CHANGELOG.md#263) (patch)
+- Updated [`@csstools/css-calc`](https://github.com/csstools/postcss-plugins/tree/main/packages/css-calc) to [`1.2.2`](https://github.com/csstools/postcss-plugins/tree/main/packages/css-calc/CHANGELOG.md#122) (patch)
-### 1.5.0
+### 2.0.1
-_December 15, 2023_
+_May 4, 2024_
-- Add the `Experimental` syntax flag, to be used in future features.
-- Add a `serializeHSL` function.
-- Fix type definitions
-- Improve JS Doc comments
-- Updated [`@csstools/color-helpers`](https://github.com/csstools/postcss-plugins/tree/main/packages/color-helpers) to [`4.0.0`](https://github.com/csstools/postcss-plugins/tree/main/packages/color-helpers/CHANGELOG.md#400) (major)
-- Updated [`@csstools/css-tokenizer`](https://github.com/csstools/postcss-plugins/tree/main/packages/css-tokenizer) to [`2.2.2`](https://github.com/csstools/postcss-plugins/tree/main/packages/css-tokenizer/CHANGELOG.md#222) (patch)
-- Updated [`@csstools/css-parser-algorithms`](https://github.com/csstools/postcss-plugins/tree/main/packages/css-parser-algorithms) to [`2.4.0`](https://github.com/csstools/postcss-plugins/tree/main/packages/css-parser-algorithms/CHANGELOG.md#240) (minor)
-- Updated [`@csstools/css-calc`](https://github.com/csstools/postcss-plugins/tree/main/packages/css-calc) to [`1.1.5`](https://github.com/csstools/postcss-plugins/tree/main/packages/css-calc/CHANGELOG.md#115) (patch)
+- Improve handling of `NaN` and `Infinity` in color functions.
+- Updated [`@csstools/css-tokenizer`](https://github.com/csstools/postcss-plugins/tree/main/packages/css-tokenizer) to [`2.3.0`](https://github.com/csstools/postcss-plugins/tree/main/packages/css-tokenizer/CHANGELOG.md#230) (minor)
+- Updated [`@csstools/css-parser-algorithms`](https://github.com/csstools/postcss-plugins/tree/main/packages/css-parser-algorithms) to [`2.6.2`](https://github.com/csstools/postcss-plugins/tree/main/packages/css-parser-algorithms/CHANGELOG.md#262) (patch)
+- Updated [`@csstools/css-calc`](https://github.com/csstools/postcss-plugins/tree/main/packages/css-calc) to [`1.2.1`](https://github.com/csstools/postcss-plugins/tree/main/packages/css-calc/CHANGELOG.md#121) (patch)
-### 1.4.0
+### 2.0.0
-_October 9, 2023_
+_April 21, 2024_
-- Add utility to determine if a color is in the Display P3 gamut.
+- Switch to the ray-tracing gamut mapping algorithm. This is a minimally invasive change when generating fallback colors for CSS but breaking if you relied on the exact output of the previous gamut mapping algorithm.
+- Fix `none` keyword conversion in relative color syntax origin values. (again)
+- Updated [`@csstools/color-helpers`](https://github.com/csstools/postcss-plugins/tree/main/packages/color-helpers) to [`4.2.0`](https://github.com/csstools/postcss-plugins/tree/main/packages/color-helpers/CHANGELOG.md#420) (minor)
[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/dist/index.cjs b/node_modules/@csstools/css-color-parser/dist/index.cjs
index 52d4c22c..79ef0b45 100644
--- a/node_modules/@csstools/css-color-parser/dist/index.cjs
+++ b/node_modules/@csstools/css-color-parser/dist/index.cjs
@@ -1 +1 @@
-"use strict";var e,o,a=require("@csstools/css-tokenizer"),n=require("@csstools/color-helpers"),t=require("@csstools/css-parser-algorithms"),r=require("@csstools/css-calc");function colorData_to_XYZ_D50(e){switch(e.colorNotation){case exports.ColorNotation.HEX:case exports.ColorNotation.RGB:case exports.ColorNotation.sRGB:return{...e,colorNotation:exports.ColorNotation.XYZ_D50,channels:n.sRGB_to_XYZ_D50(e.channels.map((e=>Number.isNaN(e)?0:e)))};case exports.ColorNotation.Linear_sRGB:return{...e,colorNotation:exports.ColorNotation.XYZ_D50,channels:n.lin_sRGB_to_XYZ_D50(e.channels.map((e=>Number.isNaN(e)?0:e)))};case exports.ColorNotation.Display_P3:return{...e,colorNotation:exports.ColorNotation.XYZ_D50,channels:n.P3_to_XYZ_D50(e.channels.map((e=>Number.isNaN(e)?0:e)))};case exports.ColorNotation.Rec2020:return{...e,colorNotation:exports.ColorNotation.XYZ_D50,channels:n.rec_2020_to_XYZ_D50(e.channels.map((e=>Number.isNaN(e)?0:e)))};case exports.ColorNotation.A98_RGB:return{...e,colorNotation:exports.ColorNotation.XYZ_D50,channels:n.a98_RGB_to_XYZ_D50(e.channels.map((e=>Number.isNaN(e)?0:e)))};case exports.ColorNotation.ProPhoto_RGB:return{...e,colorNotation:exports.ColorNotation.XYZ_D50,channels:n.ProPhoto_RGB_to_XYZ_D50(e.channels.map((e=>Number.isNaN(e)?0:e)))};case exports.ColorNotation.HSL:return{...e,colorNotation:exports.ColorNotation.XYZ_D50,channels:n.HSL_to_XYZ_D50(e.channels.map((e=>Number.isNaN(e)?0:e)))};case exports.ColorNotation.HWB:return{...e,colorNotation:exports.ColorNotation.XYZ_D50,channels:n.HWB_to_XYZ_D50(e.channels.map((e=>Number.isNaN(e)?0:e)))};case exports.ColorNotation.Lab:return{...e,colorNotation:exports.ColorNotation.XYZ_D50,channels:n.Lab_to_XYZ_D50(e.channels.map((e=>Number.isNaN(e)?0:e)))};case exports.ColorNotation.OKLab:return{...e,colorNotation:exports.ColorNotation.XYZ_D50,channels:n.OKLab_to_XYZ_D50(e.channels.map((e=>Number.isNaN(e)?0:e)))};case exports.ColorNotation.LCH:return{...e,colorNotation:exports.ColorNotation.XYZ_D50,channels:n.LCH_to_XYZ_D50(e.channels.map((e=>Number.isNaN(e)?0:e)))};case exports.ColorNotation.OKLCH:return{...e,colorNotation:exports.ColorNotation.XYZ_D50,channels:n.OKLCH_to_XYZ_D50(e.channels.map((e=>Number.isNaN(e)?0:e)))};case exports.ColorNotation.XYZ_D50:return{...e,colorNotation:exports.ColorNotation.XYZ_D50,channels:n.XYZ_D50_to_XYZ_D50(e.channels.map((e=>Number.isNaN(e)?0:e)))};case exports.ColorNotation.XYZ_D65:return{...e,colorNotation:exports.ColorNotation.XYZ_D50,channels:n.XYZ_D65_to_XYZ_D50(e.channels.map((e=>Number.isNaN(e)?0:e)))};default:throw new Error("Unsupported color notation")}}exports.ColorNotation=void 0,(e=exports.ColorNotation||(exports.ColorNotation={})).A98_RGB="a98-rgb",e.Display_P3="display-p3",e.HEX="hex",e.HSL="hsl",e.HWB="hwb",e.LCH="lch",e.Lab="lab",e.Linear_sRGB="srgb-linear",e.OKLCH="oklch",e.OKLab="oklab",e.ProPhoto_RGB="prophoto-rgb",e.RGB="rgb",e.sRGB="srgb",e.Rec2020="rec2020",e.XYZ_D50="xyz-d50",e.XYZ_D65="xyz-d65",exports.SyntaxFlag=void 0,(o=exports.SyntaxFlag||(exports.SyntaxFlag={})).ColorKeyword="color-keyword",o.HasAlpha="has-alpha",o.HasDimensionValues="has-dimension-values",o.HasNoneKeywords="has-none-keywords",o.HasNumberValues="has-number-values",o.HasPercentageAlpha="has-percentage-alpha",o.HasPercentageValues="has-percentage-values",o.HasVariableAlpha="has-variable-alpha",o.Hex="hex",o.LegacyHSL="legacy-hsl",o.LegacyRGB="legacy-rgb",o.NamedColor="named-color",o.RelativeColorSyntax="relative-color-syntax",o.ColorMix="color-mix",o.Experimental="experimental";const l=new Set([exports.ColorNotation.A98_RGB,exports.ColorNotation.Display_P3,exports.ColorNotation.HEX,exports.ColorNotation.Linear_sRGB,exports.ColorNotation.ProPhoto_RGB,exports.ColorNotation.RGB,exports.ColorNotation.sRGB,exports.ColorNotation.Rec2020,exports.ColorNotation.XYZ_D50,exports.ColorNotation.XYZ_D65]);function colorDataTo(e,o){const a={...e};if(e.colorNotation!==o){const e=colorData_to_XYZ_D50(a);switch(o){case exports.ColorNotation.HEX:case exports.ColorNotation.RGB:a.colorNotation=exports.ColorNotation.RGB,a.channels=n.XYZ_D50_to_sRGB(e.channels);break;case exports.ColorNotation.sRGB:a.colorNotation=exports.ColorNotation.sRGB,a.channels=n.XYZ_D50_to_sRGB(e.channels);break;case exports.ColorNotation.Linear_sRGB:a.colorNotation=exports.ColorNotation.Linear_sRGB,a.channels=n.XYZ_D50_to_lin_sRGB(e.channels);break;case exports.ColorNotation.Display_P3:a.colorNotation=exports.ColorNotation.Display_P3,a.channels=n.XYZ_D50_to_P3(e.channels);break;case exports.ColorNotation.Rec2020:a.colorNotation=exports.ColorNotation.Rec2020,a.channels=n.XYZ_D50_to_rec_2020(e.channels);break;case exports.ColorNotation.ProPhoto_RGB:a.colorNotation=exports.ColorNotation.ProPhoto_RGB,a.channels=n.XYZ_D50_to_ProPhoto(e.channels);break;case exports.ColorNotation.A98_RGB:a.colorNotation=exports.ColorNotation.A98_RGB,a.channels=n.XYZ_D50_to_a98_RGB(e.channels);break;case exports.ColorNotation.HSL:a.colorNotation=exports.ColorNotation.HSL,a.channels=n.XYZ_D50_to_HSL(e.channels);break;case exports.ColorNotation.HWB:a.colorNotation=exports.ColorNotation.HWB,a.channels=n.XYZ_D50_to_HWB(e.channels);break;case exports.ColorNotation.Lab:a.colorNotation=exports.ColorNotation.Lab,a.channels=n.XYZ_D50_to_Lab(e.channels);break;case exports.ColorNotation.LCH:a.colorNotation=exports.ColorNotation.LCH,a.channels=n.XYZ_D50_to_LCH(e.channels);break;case exports.ColorNotation.OKLCH:a.colorNotation=exports.ColorNotation.OKLCH,a.channels=n.XYZ_D50_to_OKLCH(e.channels);break;case exports.ColorNotation.OKLab:a.colorNotation=exports.ColorNotation.OKLab,a.channels=n.XYZ_D50_to_OKLab(e.channels);break;case exports.ColorNotation.XYZ_D50:a.colorNotation=exports.ColorNotation.XYZ_D50,a.channels=n.XYZ_D50_to_XYZ_D50(e.channels);break;case exports.ColorNotation.XYZ_D65:a.colorNotation=exports.ColorNotation.XYZ_D65,a.channels=n.XYZ_D50_to_XYZ_D65(e.channels);break;default:throw new Error("Unsupported color notation")}}else a.channels=e.channels.map((e=>Number.isNaN(e)?0:e));if(o===e.colorNotation)a.channels=carryForwardMissingComponents(e.channels,[0,1,2],a.channels,[0,1,2]);else if(l.has(o)&&l.has(e.colorNotation))a.channels=carryForwardMissingComponents(e.channels,[0,1,2],a.channels,[0,1,2]);else switch(o){case exports.ColorNotation.HSL:switch(e.colorNotation){case exports.ColorNotation.HWB:a.channels=carryForwardMissingComponents(e.channels,[0],a.channels,[0]);break;case exports.ColorNotation.Lab:case exports.ColorNotation.OKLab:a.channels=carryForwardMissingComponents(e.channels,[2],a.channels,[0]);break;case exports.ColorNotation.LCH:case exports.ColorNotation.OKLCH:a.channels=carryForwardMissingComponents(e.channels,[0,1,2],a.channels,[2,1,0])}break;case exports.ColorNotation.HWB:switch(e.colorNotation){case exports.ColorNotation.HSL:a.channels=carryForwardMissingComponents(e.channels,[0],a.channels,[0]);break;case exports.ColorNotation.LCH:case exports.ColorNotation.OKLCH:a.channels=carryForwardMissingComponents(e.channels,[0],a.channels,[2])}break;case exports.ColorNotation.Lab:case exports.ColorNotation.OKLab:switch(e.colorNotation){case exports.ColorNotation.HSL:a.channels=carryForwardMissingComponents(e.channels,[0],a.channels,[2]);break;case exports.ColorNotation.Lab:case exports.ColorNotation.OKLab:a.channels=carryForwardMissingComponents(e.channels,[0,1,2],a.channels,[0,1,2]);break;case exports.ColorNotation.LCH:case exports.ColorNotation.OKLCH:a.channels=carryForwardMissingComponents(e.channels,[0],a.channels,[0])}break;case exports.ColorNotation.LCH:case exports.ColorNotation.OKLCH:switch(e.colorNotation){case exports.ColorNotation.HSL:a.channels=carryForwardMissingComponents(e.channels,[0,1,2],a.channels,[2,1,0]);break;case exports.ColorNotation.HWB:a.channels=carryForwardMissingComponents(e.channels,[0],a.channels,[2]);break;case exports.ColorNotation.Lab:case exports.ColorNotation.OKLab:a.channels=carryForwardMissingComponents(e.channels,[0],a.channels,[0]);break;case exports.ColorNotation.LCH:case exports.ColorNotation.OKLCH:a.channels=carryForwardMissingComponents(e.channels,[0,1,2],a.channels,[0,1,2])}}return a.channels=convertPowerlessComponentsToMissingComponents(a.channels,o),a}function convertPowerlessComponentsToMissingComponents(e,o){const a=[...e];switch(o){case exports.ColorNotation.HSL:reducePrecision(a[1],4)<=0&&(a[0]=NaN);break;case exports.ColorNotation.HWB:Math.max(0,reducePrecision(a[1],4))+Math.max(0,reducePrecision(a[2],4))>=100&&(a[0]=NaN);break;case exports.ColorNotation.LCH:reducePrecision(a[1],4)<=0&&(a[2]=NaN);break;case exports.ColorNotation.OKLCH:reducePrecision(a[1],6)<=0&&(a[2]=NaN)}return a}function convertPowerlessComponentsToZeroValuesForDisplay(e,o){const a=[...e];switch(o){case exports.ColorNotation.HSL:(reducePrecision(a[2])<=0||reducePrecision(a[2])>=100)&&(a[0]=NaN,a[1]=NaN),reducePrecision(a[1])<=0&&(a[0]=NaN);break;case exports.ColorNotation.HWB:Math.max(0,reducePrecision(a[1]))+Math.max(0,reducePrecision(a[2]))>=100&&(a[0]=NaN);break;case exports.ColorNotation.Lab:(reducePrecision(a[0])<=0||reducePrecision(a[0])>=100)&&(a[1]=NaN,a[2]=NaN);break;case exports.ColorNotation.LCH:reducePrecision(a[1])<=0&&(a[2]=NaN),(reducePrecision(a[0])<=0||reducePrecision(a[0])>=100)&&(a[1]=NaN,a[2]=NaN);break;case exports.ColorNotation.OKLab:(reducePrecision(a[0])<=0||reducePrecision(a[0])>=1)&&(a[1]=NaN,a[2]=NaN);break;case exports.ColorNotation.OKLCH:reducePrecision(a[1])<=0&&(a[2]=NaN),(reducePrecision(a[0])<=0||reducePrecision(a[0])>=1)&&(a[1]=NaN,a[2]=NaN)}return a}function carryForwardMissingComponents(e,o,a,n){const t=[...a];for(const a of o)Number.isNaN(e[o[a]])&&(t[n[a]]=NaN);return t}function normalizeRelativeColorDataChannels(e){const o=new Map;switch(e.colorNotation){case exports.ColorNotation.RGB:case exports.ColorNotation.HEX:o.set("r",dummyNumberToken(255*e.channels[0])),o.set("g",dummyNumberToken(255*e.channels[1])),o.set("b",dummyNumberToken(255*e.channels[2])),"number"==typeof e.alpha&&o.set("alpha",dummyNumberToken(e.alpha));break;case exports.ColorNotation.HSL:o.set("h",dummyNumberToken(e.channels[0])),o.set("s",dummyNumberToken(e.channels[1])),o.set("l",dummyNumberToken(e.channels[2])),"number"==typeof e.alpha&&o.set("alpha",dummyNumberToken(e.alpha));break;case exports.ColorNotation.HWB:o.set("h",dummyNumberToken(e.channels[0])),o.set("w",dummyNumberToken(e.channels[1])),o.set("b",dummyNumberToken(e.channels[2])),"number"==typeof e.alpha&&o.set("alpha",dummyNumberToken(e.alpha));break;case exports.ColorNotation.Lab:case exports.ColorNotation.OKLab:o.set("l",dummyNumberToken(e.channels[0])),o.set("a",dummyNumberToken(e.channels[1])),o.set("b",dummyNumberToken(e.channels[2])),"number"==typeof e.alpha&&o.set("alpha",dummyNumberToken(e.alpha));break;case exports.ColorNotation.LCH:case exports.ColorNotation.OKLCH:o.set("l",dummyNumberToken(e.channels[0])),o.set("c",dummyNumberToken(e.channels[1])),o.set("h",dummyNumberToken(e.channels[2])),"number"==typeof e.alpha&&o.set("alpha",dummyNumberToken(e.alpha));break;case exports.ColorNotation.sRGB:case exports.ColorNotation.A98_RGB:case exports.ColorNotation.Display_P3:case exports.ColorNotation.Rec2020:case exports.ColorNotation.Linear_sRGB:case exports.ColorNotation.ProPhoto_RGB:o.set("r",dummyNumberToken(e.channels[0])),o.set("g",dummyNumberToken(e.channels[1])),o.set("b",dummyNumberToken(e.channels[2])),"number"==typeof e.alpha&&o.set("alpha",dummyNumberToken(e.alpha));break;case exports.ColorNotation.XYZ_D50:case exports.ColorNotation.XYZ_D65:o.set("x",dummyNumberToken(e.channels[0])),o.set("y",dummyNumberToken(e.channels[1])),o.set("z",dummyNumberToken(e.channels[2])),"number"==typeof e.alpha&&o.set("alpha",dummyNumberToken(e.alpha))}return o}function noneToZeroInRelativeColorDataChannels(e){const o=new Map(e);for(const[a,n]of e)Number.isNaN(n[4].value)&&o.set(a,dummyNumberToken(0));return o}function dummyNumberToken(e){return[a.TokenType.Number,e.toString(),-1,-1,{value:e,type:a.NumberType.Number}]}function reducePrecision(e,o=7){if(Number.isNaN(e))return 0;const a=Math.pow(10,o);return Math.round(e*a)/a}function normalize(e,o,a,n){return Math.min(Math.max(e/o,a),n)}const s=/[A-Z]/g;function toLowerCaseAZ(e){return e.replace(s,(e=>String.fromCharCode(e.charCodeAt(0)+32)))}function normalize_Color_ChannelValues(e,o,n){if(e[0]===a.TokenType.Ident&&"none"===toLowerCaseAZ(e[4].value))return n.syntaxFlags.add(exports.SyntaxFlag.HasNoneKeywords),[a.TokenType.Number,"none",e[2],e[3],{value:NaN,type:a.NumberType.Number}];if(e[0]===a.TokenType.Percentage){3!==o&&n.syntaxFlags.add(exports.SyntaxFlag.HasPercentageValues);let t=normalize(e[4].value,100,-1/0,1/0);return 3===o&&(t=normalize(e[4].value,100,0,1)),[a.TokenType.Number,t.toString(),e[2],e[3],{value:t,type:a.NumberType.Number}]}if(e[0]===a.TokenType.Number){3!==o&&n.syntaxFlags.add(exports.SyntaxFlag.HasNumberValues);let t=normalize(e[4].value,1,-1/0,1/0);return 3===o&&(t=normalize(e[4].value,1,0,1)),[a.TokenType.Number,t.toString(),e[2],e[3],{value:t,type:a.NumberType.Number}]}return!1}const i=new Set(["srgb","srgb-linear","display-p3","a98-rgb","prophoto-rgb","rec2020","xyz","xyz-d50","xyz-d65"]);function color$1(e,o){const n=[],l=[],s=[],u=[];let c,p,N=!1,m=!1;const h={colorNotation:exports.ColorNotation.sRGB,channels:[0,0,0],alpha:1,syntaxFlags:new Set([])};let y=n;for(let x=0;x<e.value.length;x++){let T=e.value[x];if(t.isWhitespaceNode(T)||t.isCommentNode(T))for(;t.isWhitespaceNode(e.value[x+1])||t.isCommentNode(e.value[x+1]);)x++;else if(y===n&&n.length&&(y=l),y===l&&l.length&&(y=s),t.isTokenNode(T)&&T.value[0]===a.TokenType.Delim&&"/"===T.value[4].value){if(y===u)return!1;y=u}else{if(t.isFunctionNode(T)){if(y===u&&"var"===toLowerCaseAZ(T.getName())){h.syntaxFlags.add(exports.SyntaxFlag.HasVariableAlpha),y.push(T);continue}if(!r.mathFunctionNames.has(toLowerCaseAZ(T.getName())))return!1;const[[e]]=r.calcFromComponentValues([[T]],{toCanonicalUnits:!0,precision:100,globals:p});if(!e||!t.isTokenNode(e)||(e.value[0]===a.TokenType.Percentage||e.value[0]===a.TokenType.Number||e.value[0]===a.TokenType.Dimension)&&Number.isNaN(e.value[4].value))return!1;T=e}if(y===n&&0===n.length&&t.isTokenNode(T)&&T.value[0]===a.TokenType.Ident&&i.has(toLowerCaseAZ(T.value[4].value))){if(N)return!1;N=toLowerCaseAZ(T.value[4].value),h.colorNotation=colorSpaceNameToColorNotation(N),m&&(m.colorNotation!==h.colorNotation&&(m=colorDataTo(m,h.colorNotation)),c=normalizeRelativeColorDataChannels(m),p=noneToZeroInRelativeColorDataChannels(c))}else if(y===n&&0===n.length&&t.isTokenNode(T)&&T.value[0]===a.TokenType.Ident&&"from"===toLowerCaseAZ(T.value[4].value)){if(m)return!1;if(N)return!1;for(;t.isWhitespaceNode(e.value[x+1])||t.isCommentNode(e.value[x+1]);)x++;if(x++,T=e.value[x],m=o(T),!1===m)return!1;m.syntaxFlags.has(exports.SyntaxFlag.Experimental)&&h.syntaxFlags.add(exports.SyntaxFlag.Experimental),h.syntaxFlags.add(exports.SyntaxFlag.RelativeColorSyntax)}else{if(!t.isTokenNode(T))return!1;if(T.value[0]===a.TokenType.Ident&&c&&c.has(toLowerCaseAZ(T.value[4].value))){y.push(new t.TokenNode(c.get(toLowerCaseAZ(T.value[4].value))));continue}y.push(T)}}}if(!N)return!1;if(1!==y.length)return!1;if(1!==n.length||1!==l.length||1!==s.length)return!1;if(!t.isTokenNode(n[0])||!t.isTokenNode(l[0])||!t.isTokenNode(s[0]))return!1;if(c&&!c.has("alpha"))return!1;const x=normalize_Color_ChannelValues(n[0].value,0,h);if(!x||x[0]!==a.TokenType.Number)return!1;const T=normalize_Color_ChannelValues(l[0].value,1,h);if(!T||T[0]!==a.TokenType.Number)return!1;const b=normalize_Color_ChannelValues(s[0].value,2,h);if(!b||b[0]!==a.TokenType.Number)return!1;const C=[x,T,b];if(1===u.length)if(h.syntaxFlags.add(exports.SyntaxFlag.HasAlpha),t.isTokenNode(u[0])){const e=normalize_Color_ChannelValues(u[0].value,3,h);if(!e||e[0]!==a.TokenType.Number)return!1;C.push(e)}else h.alpha=u[0];else if(c&&c.has("alpha")){const e=normalize_Color_ChannelValues(c.get("alpha"),3,h);if(!e||e[0]!==a.TokenType.Number)return!1;C.push(e)}return h.channels=[C[0][4].value,C[1][4].value,C[2][4].value],4===C.length&&(h.alpha=C[3][4].value),h}function colorSpaceNameToColorNotation(e){switch(e){case"srgb":return exports.ColorNotation.sRGB;case"srgb-linear":return exports.ColorNotation.Linear_sRGB;case"display-p3":return exports.ColorNotation.Display_P3;case"a98-rgb":return exports.ColorNotation.A98_RGB;case"prophoto-rgb":return exports.ColorNotation.ProPhoto_RGB;case"rec2020":return exports.ColorNotation.Rec2020;case"xyz":case"xyz-d65":return exports.ColorNotation.XYZ_D65;case"xyz-d50":return exports.ColorNotation.XYZ_D50;default:throw new Error("Unknown color space name: "+e)}}const u=new Set(["srgb","srgb-linear","lab","oklab","xyz","xyz-d50","xyz-d65"]),c=new Set(["hsl","hwb","lch","oklch"]),p=new Set(["shorter","longer","increasing","decreasing"]);function colorMix(e,o){let n=null,r=null,l=null,s=!1;for(let i=0;i<e.value.length;i++){const N=e.value[i];if(!t.isWhitespaceNode(N)&&!t.isCommentNode(N)){if(t.isTokenNode(N)&&N.value[0]===a.TokenType.Ident){if(!n&&"in"===toLowerCaseAZ(N.value[4].value)){n=N;continue}if(n&&!r){r=toLowerCaseAZ(N.value[4].value);continue}if(n&&r&&!l&&c.has(r)){l=toLowerCaseAZ(N.value[4].value);continue}if(n&&r&&l&&!s&&"hue"===toLowerCaseAZ(N.value[4].value)){s=!0;continue}return!1}return!(!t.isTokenNode(N)||N.value[0]!==a.TokenType.Comma)&&(!!r&&(l||s?!!(r&&l&&s&&c.has(r)&&p.has(l))&&colorMixPolar(r,l,colorMixComponents(e.value.slice(i+1),o)):u.has(r)?colorMixRectangular(r,colorMixComponents(e.value.slice(i+1),o)):!!c.has(r)&&colorMixPolar(r,"shorter",colorMixComponents(e.value.slice(i+1),o))))}}return!1}function colorMixComponents(e,o){const n=[];let l=1,s=!1,i=!1;for(let l=0;l<e.length;l++){let u=e[l];if(!t.isWhitespaceNode(u)&&!t.isCommentNode(u)){if(!t.isTokenNode(u)||u.value[0]!==a.TokenType.Comma){if(!s){const e=o(u);if(e){s=e;continue}}if(!i){if(t.isFunctionNode(u)&&r.mathFunctionNames.has(toLowerCaseAZ(u.getName()))&&([[u]]=r.calcFromComponentValues([[u]],{toCanonicalUnits:!0,precision:100}),!u||!t.isTokenNode(u)||(u.value[0]===a.TokenType.Percentage||u.value[0]===a.TokenType.Number||u.value[0]===a.TokenType.Dimension)&&Number.isNaN(u.value[4].value)))return!1;if(t.isTokenNode(u)&&u.value[0]===a.TokenType.Percentage&&u.value[4].value>=0){i=u.value[4].value;continue}}return!1}if(!s)return!1;n.push({color:s,percentage:i}),s=!1,i=!1}}if(s&&n.push({color:s,percentage:i}),2!==n.length)return!1;let u=n[0].percentage,c=n[1].percentage;return(!1===u||!(u<0||u>100))&&((!1===c||!(c<0||c>100))&&(!1===u&&!1===c?(u=50,c=50):!1!==u&&!1===c?c=100-u:!1===u&&!1!==c&&(u=100-c),(0!==u||0!==c)&&(!1!==u&&!1!==c&&(u+c>100&&(u=u/(u+c)*100,c=c/(u+c)*100),u+c<100&&(l=(u+c)/100,u=u/(u+c)*100,c=c/(u+c)*100),{a:{color:n[0].color,percentage:u},b:{color:n[1].color,percentage:c},alphaMultiplier:l}))))}function colorMixRectangular(e,o){if(!o)return!1;const a=o.a.color,n=o.b.color,t=o.a.percentage/100;let r=a.channels,l=n.channels,s=exports.ColorNotation.RGB,i=a.alpha;if("number"!=typeof i)return!1;let u=n.alpha;if("number"!=typeof u)return!1;switch(i=Number.isNaN(i)?u:i,u=Number.isNaN(u)?i:u,e){case"srgb":s=exports.ColorNotation.RGB;break;case"srgb-linear":s=exports.ColorNotation.Linear_sRGB;break;case"lab":s=exports.ColorNotation.Lab;break;case"oklab":s=exports.ColorNotation.OKLab;break;case"xyz-d50":s=exports.ColorNotation.XYZ_D50;break;case"xyz":case"xyz-d65":s=exports.ColorNotation.XYZ_D65}r=colorDataTo(a,s).channels,l=colorDataTo(n,s).channels,r[0]=fillInMissingComponent(r[0],l[0]),l[0]=fillInMissingComponent(l[0],r[0]),r[1]=fillInMissingComponent(r[1],l[1]),l[1]=fillInMissingComponent(l[1],r[1]),r[2]=fillInMissingComponent(r[2],l[2]),l[2]=fillInMissingComponent(l[2],r[2]),r[0]=premultiply(r[0],i),r[1]=premultiply(r[1],i),r[2]=premultiply(r[2],i),l[0]=premultiply(l[0],u),l[1]=premultiply(l[1],u),l[2]=premultiply(l[2],u);const c=interpolate(i,u,t),p={colorNotation:s,channels:[un_premultiply(interpolate(r[0],l[0],t),c),un_premultiply(interpolate(r[1],l[1],t),c),un_premultiply(interpolate(r[2],l[2],t),c)],alpha:c*o.alphaMultiplier,syntaxFlags:new Set([exports.SyntaxFlag.ColorMix])};return(o.a.color.syntaxFlags.has(exports.SyntaxFlag.Experimental)||o.b.color.syntaxFlags.has(exports.SyntaxFlag.Experimental))&&p.syntaxFlags.add(exports.SyntaxFlag.Experimental),p}function colorMixPolar(e,o,a){if(!a)return!1;const n=a.a.color,t=a.b.color,r=a.a.percentage/100;let l=n.channels,s=t.channels,i=0,u=0,c=0,p=0,N=0,m=0,h=exports.ColorNotation.RGB,y=n.alpha;if("number"!=typeof y)return!1;let x=t.alpha;if("number"!=typeof x)return!1;switch(y=Number.isNaN(y)?x:y,x=Number.isNaN(x)?y:x,e){case"hsl":h=exports.ColorNotation.HSL;break;case"hwb":h=exports.ColorNotation.HWB;break;case"lch":h=exports.ColorNotation.LCH;break;case"oklch":h=exports.ColorNotation.OKLCH}switch(l=colorDataTo(n,h).channels,s=colorDataTo(t,h).channels,e){case"hsl":case"hwb":i=l[0],u=s[0],c=l[1],p=s[1],N=l[2],m=s[2];break;case"lch":case"oklch":c=l[0],p=s[0],N=l[1],m=s[1],i=l[2],u=s[2]}i=fillInMissingComponent(i,u),Number.isNaN(i)&&(i=0),u=fillInMissingComponent(u,i),Number.isNaN(u)&&(u=0),c=fillInMissingComponent(c,p),p=fillInMissingComponent(p,c),N=fillInMissingComponent(N,m),m=fillInMissingComponent(m,N);const T=u-i;switch(o){case"shorter":T>180?i+=360:T<-180&&(u+=360);break;case"longer":-180<T&&T<180&&(T>0?i+=360:u+=360);break;case"increasing":T<0&&(u+=360);break;case"decreasing":T>0&&(i+=360);break;default:throw new Error("Unknown hue interpolation method")}c=premultiply(c,y),N=premultiply(N,y),p=premultiply(p,x),m=premultiply(m,x);let b=[0,0,0];const C=interpolate(y,x,r);switch(e){case"hsl":case"hwb":b=[interpolate(i,u,r),un_premultiply(interpolate(c,p,r),C),un_premultiply(interpolate(N,m,r),C)];break;case"lch":case"oklch":b=[un_premultiply(interpolate(c,p,r),C),un_premultiply(interpolate(N,m,r),C),interpolate(i,u,r)]}const d={colorNotation:h,channels:b,alpha:C*a.alphaMultiplier,syntaxFlags:new Set([exports.SyntaxFlag.ColorMix])};return(a.a.color.syntaxFlags.has(exports.SyntaxFlag.Experimental)||a.b.color.syntaxFlags.has(exports.SyntaxFlag.Experimental))&&d.syntaxFlags.add(exports.SyntaxFlag.Experimental),d}function fillInMissingComponent(e,o){return Number.isNaN(e)?o:e}function interpolate(e,o,a){return e*a+o*(1-a)}function premultiply(e,o){return Number.isNaN(o)?e:Number.isNaN(e)?NaN:e*o}function un_premultiply(e,o){return 0===o||Number.isNaN(o)?e:Number.isNaN(e)?NaN:e/o}function hex(e){const o=toLowerCaseAZ(e[4].value);if(o.match(/[^a-f0-9]/))return!1;const a={colorNotation:exports.ColorNotation.HEX,channels:[0,0,0],alpha:1,syntaxFlags:new Set([exports.SyntaxFlag.Hex])},n=o.length;if(3===n){const e=o[0],n=o[1],t=o[2];return a.channels=[parseInt(e+e,16)/255,parseInt(n+n,16)/255,parseInt(t+t,16)/255],a}if(6===n){const e=o[0]+o[1],n=o[2]+o[3],t=o[4]+o[5];return a.channels=[parseInt(e,16)/255,parseInt(n,16)/255,parseInt(t,16)/255],a}if(4===n){const e=o[0],n=o[1],t=o[2],r=o[3];return a.channels=[parseInt(e+e,16)/255,parseInt(n+n,16)/255,parseInt(t+t,16)/255],a.alpha=parseInt(r+r,16)/255,a.syntaxFlags.add(exports.SyntaxFlag.HasAlpha),a}if(8===n){const e=o[0]+o[1],n=o[2]+o[3],t=o[4]+o[5],r=o[6]+o[7];return a.channels=[parseInt(e,16)/255,parseInt(n,16)/255,parseInt(t,16)/255],a.alpha=parseInt(r,16)/255,a.syntaxFlags.add(exports.SyntaxFlag.HasAlpha),a}return!1}function normalizeHue(e){if(e[0]===a.TokenType.Number)return e[4].value=e[4].value%360,e[1]=e[4].value.toString(),e;if(e[0]===a.TokenType.Dimension){let o=e[4].value;switch(toLowerCaseAZ(e[4].unit)){case"deg":break;case"rad":o=180*e[4].value/Math.PI;break;case"grad":o=.9*e[4].value;break;case"turn":o=360*e[4].value;break;default:return!1}return o%=360,[a.TokenType.Number,o.toString(),e[2],e[3],{value:o,type:a.NumberType.Number}]}return!1}function normalize_legacy_HSL_ChannelValues(e,o,n){if(0===o){const o=normalizeHue(e);return!1!==o&&(e[0]===a.TokenType.Dimension&&n.syntaxFlags.add(exports.SyntaxFlag.HasDimensionValues),o)}if(e[0]===a.TokenType.Percentage){3===o?n.syntaxFlags.add(exports.SyntaxFlag.HasPercentageAlpha):n.syntaxFlags.add(exports.SyntaxFlag.HasPercentageValues);let t=normalize(e[4].value,1,0,100);return 3===o&&(t=normalize(e[4].value,100,0,1)),[a.TokenType.Number,t.toString(),e[2],e[3],{value:t,type:a.NumberType.Number}]}if(e[0]===a.TokenType.Number){if(3!==o)return!1;let n=normalize(e[4].value,1,0,100);return 3===o&&(n=normalize(e[4].value,1,0,1)),[a.TokenType.Number,n.toString(),e[2],e[3],{value:n,type:a.NumberType.Number}]}return!1}function normalize_modern_HSL_ChannelValues(e,o,n){if(e[0]===a.TokenType.Ident&&"none"===toLowerCaseAZ(e[4].value))return n.syntaxFlags.add(exports.SyntaxFlag.HasNoneKeywords),[a.TokenType.Number,"none",e[2],e[3],{value:NaN,type:a.NumberType.Number}];if(0===o){const o=normalizeHue(e);return!1!==o&&(e[0]===a.TokenType.Dimension&&n.syntaxFlags.add(exports.SyntaxFlag.HasDimensionValues),o)}if(e[0]===a.TokenType.Percentage){3===o?n.syntaxFlags.add(exports.SyntaxFlag.HasPercentageAlpha):n.syntaxFlags.add(exports.SyntaxFlag.HasPercentageValues);let t=e[4].value;return 3===o&&(t=normalize(e[4].value,100,0,1)),[a.TokenType.Number,t.toString(),e[2],e[3],{value:t,type:a.NumberType.Number}]}if(e[0]===a.TokenType.Number){3!==o&&n.syntaxFlags.add(exports.SyntaxFlag.HasNumberValues);let t=e[4].value;return 3===o&&(t=normalize(e[4].value,1,0,1)),[a.TokenType.Number,t.toString(),e[2],e[3],{value:t,type:a.NumberType.Number}]}return!1}function threeChannelLegacySyntax(e,o,n,l){const s=[],i=[],u=[],c=[],p={colorNotation:n,channels:[0,0,0],alpha:1,syntaxFlags:new Set(l)};let N=s;for(let o=0;o<e.value.length;o++){let n=e.value[o];if(!t.isWhitespaceNode(n)&&!t.isCommentNode(n)){if(t.isTokenNode(n)&&n.value[0]===a.TokenType.Comma){if(N===s){N=i;continue}if(N===i){N=u;continue}if(N===u){N=c;continue}if(N===c)return!1}if(t.isFunctionNode(n)){if(N===c&&"var"===toLowerCaseAZ(n.getName())){p.syntaxFlags.add(exports.SyntaxFlag.HasVariableAlpha),N.push(n);continue}if(!r.mathFunctionNames.has(toLowerCaseAZ(n.getName())))return!1;const[[e]]=r.calcFromComponentValues([[n]],{toCanonicalUnits:!0,precision:100});if(!e||!t.isTokenNode(e)||(e.value[0]===a.TokenType.Percentage||e.value[0]===a.TokenType.Number||e.value[0]===a.TokenType.Dimension)&&Number.isNaN(e.value[4].value))return!1;n=e}if(!t.isTokenNode(n))return!1;N.push(n)}}if(1!==N.length)return!1;if(1!==s.length||1!==i.length||1!==u.length)return!1;if(!t.isTokenNode(s[0])||!t.isTokenNode(i[0])||!t.isTokenNode(u[0]))return!1;const m=o(s[0].value,0,p);if(!m||m[0]!==a.TokenType.Number)return!1;const h=o(i[0].value,1,p);if(!h||h[0]!==a.TokenType.Number)return!1;const y=o(u[0].value,2,p);if(!y||y[0]!==a.TokenType.Number)return!1;const x=[m,h,y];if(1===c.length)if(p.syntaxFlags.add(exports.SyntaxFlag.HasAlpha),t.isTokenNode(c[0])){const e=o(c[0].value,3,p);if(!e||e[0]!==a.TokenType.Number)return!1;x.push(e)}else p.alpha=c[0];return p.channels=[x[0][4].value,x[1][4].value,x[2][4].value],4===x.length&&(p.alpha=x[3][4].value),p}function threeChannelSpaceSeparated(e,o,n,l,s){const i=toLowerCaseAZ(e.getName()),u=[],c=[],p=[],N=[];let m,h,y=!1;const x={colorNotation:n,channels:[0,0,0],alpha:1,syntaxFlags:new Set(l)};let T=u;for(let o=0;o<e.value.length;o++){let l=e.value[o];if(t.isWhitespaceNode(l)||t.isCommentNode(l))for(;t.isWhitespaceNode(e.value[o+1])||t.isCommentNode(e.value[o+1]);)o++;else if(T===u&&u.length&&(T=c),T===c&&c.length&&(T=p),t.isTokenNode(l)&&l.value[0]===a.TokenType.Delim&&"/"===l.value[4].value){if(T===N)return!1;T=N}else{if(t.isFunctionNode(l)){if(T===N&&"var"===toLowerCaseAZ(l.getName())){x.syntaxFlags.add(exports.SyntaxFlag.HasVariableAlpha),T.push(l);continue}if(!r.mathFunctionNames.has(toLowerCaseAZ(l.getName())))return!1;const[[e]]=r.calcFromComponentValues([[l]],{toCanonicalUnits:!0,precision:100,globals:h});if(!e||!t.isTokenNode(e)||(e.value[0]===a.TokenType.Percentage||e.value[0]===a.TokenType.Number||e.value[0]===a.TokenType.Dimension)&&Number.isNaN(e.value[4].value))return!1;l=e}if(T===u&&0===u.length&&t.isTokenNode(l)&&l.value[0]===a.TokenType.Ident&&"from"===toLowerCaseAZ(l.value[4].value)&&"hsla"!==i&&"rgba"!==i){if(y)return!1;for(;t.isWhitespaceNode(e.value[o+1])||t.isCommentNode(e.value[o+1]);)o++;if(o++,l=e.value[o],y=s(l),!1===y)return!1;y.syntaxFlags.has(exports.SyntaxFlag.Experimental)&&x.syntaxFlags.add(exports.SyntaxFlag.Experimental),x.syntaxFlags.add(exports.SyntaxFlag.RelativeColorSyntax),y.colorNotation!==n&&(y=colorDataTo(y,n)),m=normalizeRelativeColorDataChannels(y),h=noneToZeroInRelativeColorDataChannels(m)}else{if(!t.isTokenNode(l))return!1;if(l.value[0]===a.TokenType.Ident&&m&&m.has(toLowerCaseAZ(l.value[4].value))){T.push(new t.TokenNode(m.get(toLowerCaseAZ(l.value[4].value))));continue}T.push(l)}}}if(1!==T.length)return!1;if(1!==u.length||1!==c.length||1!==p.length)return!1;if(!t.isTokenNode(u[0])||!t.isTokenNode(c[0])||!t.isTokenNode(p[0]))return!1;if(m&&!m.has("alpha"))return!1;const b=o(u[0].value,0,x);if(!b||b[0]!==a.TokenType.Number)return!1;const C=o(c[0].value,1,x);if(!C||C[0]!==a.TokenType.Number)return!1;const d=o(p[0].value,2,x);if(!d||d[0]!==a.TokenType.Number)return!1;const g=[b,C,d];if(1===N.length)if(x.syntaxFlags.add(exports.SyntaxFlag.HasAlpha),t.isTokenNode(N[0])){const e=o(N[0].value,3,x);if(!e||e[0]!==a.TokenType.Number)return!1;g.push(e)}else x.alpha=N[0];else if(m&&m.has("alpha")){const e=o(m.get("alpha"),3,x);if(!e||e[0]!==a.TokenType.Number)return!1;g.push(e)}return x.channels=[g[0][4].value,g[1][4].value,g[2][4].value],4===g.length&&(x.alpha=g[3][4].value),x}function hsl(e,o){if(e.value.some((e=>t.isTokenNode(e)&&e.value[0]===a.TokenType.Comma))){const o=hslCommaSeparated(e);if(!1!==o)return o}{const a=hslSpaceSeparated(e,o);if(!1!==a)return a}return!1}function hslCommaSeparated(e){return threeChannelLegacySyntax(e,normalize_legacy_HSL_ChannelValues,exports.ColorNotation.HSL,[exports.SyntaxFlag.LegacyHSL])}function hslSpaceSeparated(e,o){return threeChannelSpaceSeparated(e,normalize_modern_HSL_ChannelValues,exports.ColorNotation.HSL,[],o)}function normalize_HWB_ChannelValues(e,o,n){if(e[0]===a.TokenType.Ident&&"none"===toLowerCaseAZ(e[4].value))return n.syntaxFlags.add(exports.SyntaxFlag.HasNoneKeywords),[a.TokenType.Number,"none",e[2],e[3],{value:NaN,type:a.NumberType.Number}];if(0===o){const o=normalizeHue(e);return!1!==o&&(e[0]===a.TokenType.Dimension&&n.syntaxFlags.add(exports.SyntaxFlag.HasDimensionValues),o)}if(e[0]===a.TokenType.Percentage){3===o?n.syntaxFlags.add(exports.SyntaxFlag.HasPercentageAlpha):n.syntaxFlags.add(exports.SyntaxFlag.HasPercentageValues);let t=e[4].value;return 3===o&&(t=normalize(e[4].value,100,0,1)),[a.TokenType.Number,t.toString(),e[2],e[3],{value:t,type:a.NumberType.Number}]}if(e[0]===a.TokenType.Number){3!==o&&n.syntaxFlags.add(exports.SyntaxFlag.HasNumberValues);let t=e[4].value;return 3===o&&(t=normalize(e[4].value,1,0,1)),[a.TokenType.Number,t.toString(),e[2],e[3],{value:t,type:a.NumberType.Number}]}return!1}function normalize_Lab_ChannelValues(e,o,n){if(e[0]===a.TokenType.Ident&&"none"===toLowerCaseAZ(e[4].value))return n.syntaxFlags.add(exports.SyntaxFlag.HasNoneKeywords),[a.TokenType.Number,"none",e[2],e[3],{value:NaN,type:a.NumberType.Number}];if(e[0]===a.TokenType.Percentage){3!==o&&n.syntaxFlags.add(exports.SyntaxFlag.HasPercentageValues);let t=normalize(e[4].value,1,0,100);return 1===o||2===o?t=normalize(e[4].value,.8,-1/0,1/0):3===o&&(t=normalize(e[4].value,100,0,1)),[a.TokenType.Number,t.toString(),e[2],e[3],{value:t,type:a.NumberType.Number}]}if(e[0]===a.TokenType.Number){3!==o&&n.syntaxFlags.add(exports.SyntaxFlag.HasNumberValues);let t=normalize(e[4].value,1,0,100);return 1===o||2===o?t=normalize(e[4].value,1,-1/0,1/0):3===o&&(t=normalize(e[4].value,1,0,1)),[a.TokenType.Number,t.toString(),e[2],e[3],{value:t,type:a.NumberType.Number}]}return!1}function lab(e,o){return threeChannelSpaceSeparated(e,normalize_Lab_ChannelValues,exports.ColorNotation.Lab,[],o)}function normalize_LCH_ChannelValues(e,o,n){if(e[0]===a.TokenType.Ident&&"none"===toLowerCaseAZ(e[4].value))return n.syntaxFlags.add(exports.SyntaxFlag.HasNoneKeywords),[a.TokenType.Number,"none",e[2],e[3],{value:NaN,type:a.NumberType.Number}];if(2===o){const o=normalizeHue(e);return!1!==o&&(e[0]===a.TokenType.Dimension&&n.syntaxFlags.add(exports.SyntaxFlag.HasDimensionValues),o)}if(e[0]===a.TokenType.Percentage){3!==o&&n.syntaxFlags.add(exports.SyntaxFlag.HasPercentageValues);let t=normalize(e[4].value,1,0,100);return 1===o?t=normalize(e[4].value,100/150,0,1/0):3===o&&(t=normalize(e[4].value,100,0,1)),[a.TokenType.Number,t.toString(),e[2],e[3],{value:t,type:a.NumberType.Number}]}if(e[0]===a.TokenType.Number){3!==o&&n.syntaxFlags.add(exports.SyntaxFlag.HasNumberValues);let t=normalize(e[4].value,1,0,100);return 1===o?t=normalize(e[4].value,1,0,1/0):3===o&&(t=normalize(e[4].value,1,0,1)),[a.TokenType.Number,t.toString(),e[2],e[3],{value:t,type:a.NumberType.Number}]}return!1}function lch(e,o){return threeChannelSpaceSeparated(e,normalize_LCH_ChannelValues,exports.ColorNotation.LCH,[],o)}const N=new Map;for(const[e,o]of Object.entries(n.namedColors))N.set(e,o);function namedColor(e){const o=N.get(toLowerCaseAZ(e));return!!o&&{colorNotation:exports.ColorNotation.RGB,channels:[o[0]/255,o[1]/255,o[2]/255],alpha:1,syntaxFlags:new Set([exports.SyntaxFlag.ColorKeyword,exports.SyntaxFlag.NamedColor])}}function normalize_OKLab_ChannelValues(e,o,n){if(e[0]===a.TokenType.Ident&&"none"===toLowerCaseAZ(e[4].value))return n.syntaxFlags.add(exports.SyntaxFlag.HasNoneKeywords),[a.TokenType.Number,"none",e[2],e[3],{value:NaN,type:a.NumberType.Number}];if(e[0]===a.TokenType.Percentage){3!==o&&n.syntaxFlags.add(exports.SyntaxFlag.HasPercentageValues);let t=normalize(e[4].value,100,0,1);return 1===o||2===o?t=normalize(e[4].value,250,-1/0,1/0):3===o&&(t=normalize(e[4].value,100,0,1)),[a.TokenType.Number,t.toString(),e[2],e[3],{value:t,type:a.NumberType.Number}]}if(e[0]===a.TokenType.Number){3!==o&&n.syntaxFlags.add(exports.SyntaxFlag.HasNumberValues);let t=normalize(e[4].value,1,0,1);return 1===o||2===o?t=normalize(e[4].value,1,-1/0,1/0):3===o&&(t=normalize(e[4].value,1,0,1)),[a.TokenType.Number,t.toString(),e[2],e[3],{value:t,type:a.NumberType.Number}]}return!1}function oklab(e,o){return threeChannelSpaceSeparated(e,normalize_OKLab_ChannelValues,exports.ColorNotation.OKLab,[],o)}function normalize_OKLCH_ChannelValues(e,o,n){if(e[0]===a.TokenType.Ident&&"none"===toLowerCaseAZ(e[4].value))return n.syntaxFlags.add(exports.SyntaxFlag.HasNoneKeywords),[a.TokenType.Number,"none",e[2],e[3],{value:NaN,type:a.NumberType.Number}];if(2===o){const o=normalizeHue(e);return!1!==o&&(e[0]===a.TokenType.Dimension&&n.syntaxFlags.add(exports.SyntaxFlag.HasDimensionValues),o)}if(e[0]===a.TokenType.Percentage){3!==o&&n.syntaxFlags.add(exports.SyntaxFlag.HasPercentageValues);let t=normalize(e[4].value,100,0,1);return 1===o?t=normalize(e[4].value,250,0,1/0):3===o&&(t=normalize(e[4].value,100,0,1)),[a.TokenType.Number,t.toString(),e[2],e[3],{value:t,type:a.NumberType.Number}]}if(e[0]===a.TokenType.Number){3!==o&&n.syntaxFlags.add(exports.SyntaxFlag.HasNumberValues);let t=normalize(e[4].value,1,0,1);return 1===o?t=normalize(e[4].value,1,0,1/0):3===o&&(t=normalize(e[4].value,1,0,1)),[a.TokenType.Number,t.toString(),e[2],e[3],{value:t,type:a.NumberType.Number}]}return!1}function oklch(e,o){return threeChannelSpaceSeparated(e,normalize_OKLCH_ChannelValues,exports.ColorNotation.OKLCH,[],o)}function normalize_legacy_sRGB_ChannelValues(e,o,n){if(e[0]===a.TokenType.Percentage){3===o?n.syntaxFlags.add(exports.SyntaxFlag.HasPercentageAlpha):n.syntaxFlags.add(exports.SyntaxFlag.HasPercentageValues);const t=normalize(e[4].value,100,0,1);return[a.TokenType.Number,t.toString(),e[2],e[3],{value:t,type:a.NumberType.Number}]}if(e[0]===a.TokenType.Number){3!==o&&n.syntaxFlags.add(exports.SyntaxFlag.HasNumberValues);let t=normalize(e[4].value,255,0,1);return 3===o&&(t=normalize(e[4].value,1,0,1)),[a.TokenType.Number,t.toString(),e[2],e[3],{value:t,type:a.NumberType.Number}]}return!1}function normalize_modern_sRGB_ChannelValues(e,o,n){if(e[0]===a.TokenType.Ident&&"none"===toLowerCaseAZ(e[4].value))return n.syntaxFlags.add(exports.SyntaxFlag.HasNoneKeywords),[a.TokenType.Number,"none",e[2],e[3],{value:NaN,type:a.NumberType.Number}];if(e[0]===a.TokenType.Percentage){3!==o&&n.syntaxFlags.add(exports.SyntaxFlag.HasPercentageValues);let t=normalize(e[4].value,100,-1/0,1/0);return 3===o&&(t=normalize(e[4].value,100,0,1)),[a.TokenType.Number,t.toString(),e[2],e[3],{value:t,type:a.NumberType.Number}]}if(e[0]===a.TokenType.Number){3!==o&&n.syntaxFlags.add(exports.SyntaxFlag.HasNumberValues);let t=normalize(e[4].value,255,-1/0,1/0);return 3===o&&(t=normalize(e[4].value,1,0,1)),[a.TokenType.Number,t.toString(),e[2],e[3],{value:t,type:a.NumberType.Number}]}return!1}function rgb(e,o){if(e.value.some((e=>t.isTokenNode(e)&&e.value[0]===a.TokenType.Comma))){const o=rgbCommaSeparated(e);if(!1!==o)return(!o.syntaxFlags.has(exports.SyntaxFlag.HasNumberValues)||!o.syntaxFlags.has(exports.SyntaxFlag.HasPercentageValues))&&o}else{const a=rgbSpaceSeparated(e,o);if(!1!==a)return a}return!1}function rgbCommaSeparated(e){return threeChannelLegacySyntax(e,normalize_legacy_sRGB_ChannelValues,exports.ColorNotation.RGB,[exports.SyntaxFlag.LegacyRGB])}function rgbSpaceSeparated(e,o){return threeChannelSpaceSeparated(e,normalize_modern_sRGB_ChannelValues,exports.ColorNotation.RGB,[],o)}function toPrecision(e,o=7){e=+e,o=+o;const a=(Math.floor(e)+"").length;if(o>a)return+e.toFixed(o-a);{const n=10**(a-o);return Math.round(e/n)*n}}function XYZ_D50_to_P3_Gamut(e){const o=n.XYZ_D50_to_P3(e);if(n.inGamut(o))return n.clip(o);let a=e.slice();return a=n.XYZ_D50_to_OKLCH(a),a[0]<1e-6&&(a=[0,0,0]),a[0]>.999999&&(a=[1,0,0]),n.mapGamut(a,(e=>(e=n.OKLCH_to_OKLab(e),e=n.OKLab_to_XYZ(e),e=n.XYZ_to_lin_P3(e),n.gam_P3(e))),(e=>(e=n.lin_P3(e),e=n.lin_P3_to_XYZ(e),e=n.XYZ_to_OKLab(e),n.OKLab_to_OKLCH(e))))}function serializeWithAlpha(e,o,n,r){const l=[a.TokenType.CloseParen,")",-1,-1,void 0];if("number"==typeof e.alpha){const s=Math.min(1,Math.max(0,toPrecision(Number.isNaN(e.alpha)?0:e.alpha)));return 1===toPrecision(s,4)?new t.FunctionNode(o,l,r):new t.FunctionNode(o,l,[...r,new t.WhitespaceNode([n]),new t.TokenNode([a.TokenType.Delim,"/",-1,-1,{value:"/"}]),new t.WhitespaceNode([n]),new t.TokenNode([a.TokenType.Number,toPrecision(s,4).toString(),-1,-1,{value:e.alpha,type:a.NumberType.Integer}])])}return new t.FunctionNode(o,l,[...r,new t.WhitespaceNode([n]),new t.TokenNode([a.TokenType.Delim,"/",-1,-1,{value:"/"}]),new t.WhitespaceNode([n]),e.alpha])}function XYZ_D50_to_sRGB_Gamut(e){const o=n.XYZ_D50_to_sRGB(e);if(n.inGamut(o))return n.clip(o);let a=e.slice();return a=n.XYZ_D50_to_OKLCH(a),a[0]<1e-6&&(a=[0,0,0]),a[0]>.999999&&(a=[1,0,0]),n.mapGamut(a,(e=>(e=n.OKLCH_to_OKLab(e),e=n.OKLab_to_XYZ(e),e=n.XYZ_to_lin_sRGB(e),n.gam_sRGB(e))),(e=>(e=n.lin_sRGB(e),e=n.lin_sRGB_to_XYZ(e),e=n.XYZ_to_OKLab(e),n.OKLab_to_OKLCH(e))))}exports.color=function color(e){if(t.isFunctionNode(e)){switch(toLowerCaseAZ(e.getName())){case"rgb":case"rgba":return rgb(e,color);case"hsl":case"hsla":return hsl(e,color);case"hwb":return o=color,threeChannelSpaceSeparated(e,normalize_HWB_ChannelValues,exports.ColorNotation.HWB,[],o);case"lab":return lab(e,color);case"lch":return lch(e,color);case"oklab":return oklab(e,color);case"oklch":return oklch(e,color);case"color":return color$1(e,color);case"color-mix":return colorMix(e,color)}}var o;if(t.isTokenNode(e)){if(e.value[0]===a.TokenType.Hash)return hex(e.value);if(e.value[0]===a.TokenType.Ident){const o=namedColor(e.value[4].value);return!1!==o?o:"transparent"===toLowerCaseAZ(e.value[4].value)&&{colorNotation:exports.ColorNotation.RGB,channels:[0,0,0],alpha:0,syntaxFlags:new Set([exports.SyntaxFlag.ColorKeyword])}}}return!1},exports.colorDataFitsDisplayP3_Gamut=function colorDataFitsDisplayP3_Gamut(e){const o={...e,channels:[...e.channels]};return o.channels=convertPowerlessComponentsToZeroValuesForDisplay(o.channels,o.colorNotation),!colorDataTo(o,exports.ColorNotation.Display_P3).channels.find((e=>e<-1e-5||e>1.00001))},exports.colorDataFitsRGB_Gamut=function colorDataFitsRGB_Gamut(e){const o={...e,channels:[...e.channels]};return o.channels=convertPowerlessComponentsToZeroValuesForDisplay(o.channels,o.colorNotation),!colorDataTo(o,exports.ColorNotation.RGB).channels.find((e=>e<-1e-5||e>1.00001))},exports.colorDataTo=colorDataTo,exports.serializeHSL=function serializeHSL(e,o=!0){e.channels=convertPowerlessComponentsToZeroValuesForDisplay(e.channels,e.colorNotation);let r=e.channels.map((e=>Number.isNaN(e)?0:e));r=o?n.XYZ_D50_to_HSL(n.sRGB_to_XYZ_D50(XYZ_D50_to_sRGB_Gamut(colorData_to_XYZ_D50(e).channels))):n.XYZ_D50_to_HSL(colorData_to_XYZ_D50(e).channels),r=r.map((e=>Number.isNaN(e)?0:e));const l=Math.min(360,Math.max(0,Math.round(toPrecision(r[0])))),s=Math.min(100,Math.max(0,Math.round(toPrecision(r[1])))),i=Math.min(100,Math.max(0,Math.round(toPrecision(r[2])))),u=[a.TokenType.CloseParen,")",-1,-1,void 0],c=[a.TokenType.Whitespace," ",-1,-1,void 0],p=[a.TokenType.Comma,",",-1,-1,void 0],N=[new t.TokenNode([a.TokenType.Number,l.toString(),-1,-1,{value:r[0],type:a.NumberType.Integer}]),new t.TokenNode(p),new t.WhitespaceNode([c]),new t.TokenNode([a.TokenType.Percentage,s.toString()+"%",-1,-1,{value:r[1]}]),new t.TokenNode(p),new t.WhitespaceNode([c]),new t.TokenNode([a.TokenType.Percentage,i.toString()+"%",-1,-1,{value:r[2]}])];if("number"==typeof e.alpha){const o=Math.min(1,Math.max(0,toPrecision(Number.isNaN(e.alpha)?0:e.alpha)));return 1===toPrecision(o,4)?new t.FunctionNode([a.TokenType.Function,"hsl(",-1,-1,{value:"hsl"}],u,N):new t.FunctionNode([a.TokenType.Function,"hsla(",-1,-1,{value:"hsla"}],u,[...N,new t.TokenNode(p),new t.WhitespaceNode([c]),new t.TokenNode([a.TokenType.Number,toPrecision(o,4).toString(),-1,-1,{value:e.alpha,type:a.NumberType.Number}])])}return new t.FunctionNode([a.TokenType.Function,"hsla(",-1,-1,{value:"hsla"}],u,[...N,new t.TokenNode(p),new t.WhitespaceNode([c]),e.alpha])},exports.serializeOKLCH=function serializeOKLCH(e){e.channels=convertPowerlessComponentsToZeroValuesForDisplay(e.channels,e.colorNotation);let o=e.channels.map((e=>Number.isNaN(e)?0:e));e.colorNotation!==exports.ColorNotation.OKLCH&&(o=n.XYZ_D50_to_OKLCH(colorData_to_XYZ_D50(e).channels));const r=toPrecision(o[0],6),l=toPrecision(o[1],6),s=toPrecision(o[2],6),i=[a.TokenType.Function,"oklch(",-1,-1,{value:"oklch"}],u=[a.TokenType.Whitespace," ",-1,-1,void 0];return serializeWithAlpha(e,i,u,[new t.TokenNode([a.TokenType.Number,r.toString(),-1,-1,{value:o[0],type:a.NumberType.Number}]),new t.WhitespaceNode([u]),new t.TokenNode([a.TokenType.Number,l.toString(),-1,-1,{value:o[1],type:a.NumberType.Number}]),new t.WhitespaceNode([u]),new t.TokenNode([a.TokenType.Number,s.toString(),-1,-1,{value:o[2],type:a.NumberType.Number}])])},exports.serializeP3=function serializeP3(e,o=!0){e.channels=convertPowerlessComponentsToZeroValuesForDisplay(e.channels,e.colorNotation);let r=e.channels.map((e=>Number.isNaN(e)?0:e));e.colorNotation!==exports.ColorNotation.Display_P3&&(r=o?XYZ_D50_to_P3_Gamut(colorData_to_XYZ_D50(e).channels):n.XYZ_D50_to_P3(colorData_to_XYZ_D50(e).channels));const l=toPrecision(r[0],6),s=toPrecision(r[1],6),i=toPrecision(r[2],6),u=[a.TokenType.Function,"color(",-1,-1,{value:"color"}],c=[a.TokenType.Whitespace," ",-1,-1,void 0];return serializeWithAlpha(e,u,c,[new t.TokenNode([a.TokenType.Ident,"display-p3",-1,-1,{value:"display-p3"}]),new t.WhitespaceNode([c]),new t.TokenNode([a.TokenType.Number,l.toString(),-1,-1,{value:r[0],type:a.NumberType.Number}]),new t.WhitespaceNode([c]),new t.TokenNode([a.TokenType.Number,s.toString(),-1,-1,{value:r[1],type:a.NumberType.Number}]),new t.WhitespaceNode([c]),new t.TokenNode([a.TokenType.Number,i.toString(),-1,-1,{value:r[2],type:a.NumberType.Number}])])},exports.serializeRGB=function serializeRGB(e,o=!0){e.channels=convertPowerlessComponentsToZeroValuesForDisplay(e.channels,e.colorNotation);let r=e.channels.map((e=>Number.isNaN(e)?0:e));r=o?XYZ_D50_to_sRGB_Gamut(colorData_to_XYZ_D50(e).channels):n.XYZ_D50_to_sRGB(colorData_to_XYZ_D50(e).channels);const l=Math.min(255,Math.max(0,Math.round(255*toPrecision(r[0])))),s=Math.min(255,Math.max(0,Math.round(255*toPrecision(r[1])))),i=Math.min(255,Math.max(0,Math.round(255*toPrecision(r[2])))),u=[a.TokenType.CloseParen,")",-1,-1,void 0],c=[a.TokenType.Whitespace," ",-1,-1,void 0],p=[a.TokenType.Comma,",",-1,-1,void 0],N=[new t.TokenNode([a.TokenType.Number,l.toString(),-1,-1,{value:r[0],type:a.NumberType.Integer}]),new t.TokenNode(p),new t.WhitespaceNode([c]),new t.TokenNode([a.TokenType.Number,s.toString(),-1,-1,{value:r[1],type:a.NumberType.Integer}]),new t.TokenNode(p),new t.WhitespaceNode([c]),new t.TokenNode([a.TokenType.Number,i.toString(),-1,-1,{value:r[2],type:a.NumberType.Integer}])];if("number"==typeof e.alpha){const o=Math.min(1,Math.max(0,toPrecision(Number.isNaN(e.alpha)?0:e.alpha)));return 1===toPrecision(o,4)?new t.FunctionNode([a.TokenType.Function,"rgb(",-1,-1,{value:"rgb"}],u,N):new t.FunctionNode([a.TokenType.Function,"rgba(",-1,-1,{value:"rgba"}],u,[...N,new t.TokenNode(p),new t.WhitespaceNode([c]),new t.TokenNode([a.TokenType.Number,toPrecision(o,4).toString(),-1,-1,{value:e.alpha,type:a.NumberType.Number}])])}return new t.FunctionNode([a.TokenType.Function,"rgba(",-1,-1,{value:"rgba"}],u,[...N,new t.TokenNode(p),new t.WhitespaceNode([c]),e.alpha])};
+"use strict";var e,o,a=require("@csstools/css-tokenizer"),n=require("@csstools/color-helpers"),t=require("@csstools/css-parser-algorithms"),r=require("@csstools/css-calc");function convertNaNToZero(e){return[Number.isNaN(e[0])?0:e[0],Number.isNaN(e[1])?0:e[1],Number.isNaN(e[2])?0:e[2]]}function colorData_to_XYZ_D50(e){switch(e.colorNotation){case exports.ColorNotation.HEX:case exports.ColorNotation.RGB:case exports.ColorNotation.sRGB:return{...e,colorNotation:exports.ColorNotation.XYZ_D50,channels:n.sRGB_to_XYZ_D50(convertNaNToZero(e.channels))};case exports.ColorNotation.Linear_sRGB:return{...e,colorNotation:exports.ColorNotation.XYZ_D50,channels:n.lin_sRGB_to_XYZ_D50(convertNaNToZero(e.channels))};case exports.ColorNotation.Display_P3:return{...e,colorNotation:exports.ColorNotation.XYZ_D50,channels:n.P3_to_XYZ_D50(convertNaNToZero(e.channels))};case exports.ColorNotation.Rec2020:return{...e,colorNotation:exports.ColorNotation.XYZ_D50,channels:n.rec_2020_to_XYZ_D50(convertNaNToZero(e.channels))};case exports.ColorNotation.A98_RGB:return{...e,colorNotation:exports.ColorNotation.XYZ_D50,channels:n.a98_RGB_to_XYZ_D50(convertNaNToZero(e.channels))};case exports.ColorNotation.ProPhoto_RGB:return{...e,colorNotation:exports.ColorNotation.XYZ_D50,channels:n.ProPhoto_RGB_to_XYZ_D50(convertNaNToZero(e.channels))};case exports.ColorNotation.HSL:return{...e,colorNotation:exports.ColorNotation.XYZ_D50,channels:n.HSL_to_XYZ_D50(convertNaNToZero(e.channels))};case exports.ColorNotation.HWB:return{...e,colorNotation:exports.ColorNotation.XYZ_D50,channels:n.HWB_to_XYZ_D50(convertNaNToZero(e.channels))};case exports.ColorNotation.Lab:return{...e,colorNotation:exports.ColorNotation.XYZ_D50,channels:n.Lab_to_XYZ_D50(convertNaNToZero(e.channels))};case exports.ColorNotation.OKLab:return{...e,colorNotation:exports.ColorNotation.XYZ_D50,channels:n.OKLab_to_XYZ_D50(convertNaNToZero(e.channels))};case exports.ColorNotation.LCH:return{...e,colorNotation:exports.ColorNotation.XYZ_D50,channels:n.LCH_to_XYZ_D50(convertNaNToZero(e.channels))};case exports.ColorNotation.OKLCH:return{...e,colorNotation:exports.ColorNotation.XYZ_D50,channels:n.OKLCH_to_XYZ_D50(convertNaNToZero(e.channels))};case exports.ColorNotation.XYZ_D50:return{...e,colorNotation:exports.ColorNotation.XYZ_D50,channels:n.XYZ_D50_to_XYZ_D50(convertNaNToZero(e.channels))};case exports.ColorNotation.XYZ_D65:return{...e,colorNotation:exports.ColorNotation.XYZ_D50,channels:n.XYZ_D65_to_XYZ_D50(convertNaNToZero(e.channels))};default:throw new Error("Unsupported color notation")}}exports.ColorNotation=void 0,(e=exports.ColorNotation||(exports.ColorNotation={})).A98_RGB="a98-rgb",e.Display_P3="display-p3",e.HEX="hex",e.HSL="hsl",e.HWB="hwb",e.LCH="lch",e.Lab="lab",e.Linear_sRGB="srgb-linear",e.OKLCH="oklch",e.OKLab="oklab",e.ProPhoto_RGB="prophoto-rgb",e.RGB="rgb",e.sRGB="srgb",e.Rec2020="rec2020",e.XYZ_D50="xyz-d50",e.XYZ_D65="xyz-d65",exports.SyntaxFlag=void 0,(o=exports.SyntaxFlag||(exports.SyntaxFlag={})).ColorKeyword="color-keyword",o.HasAlpha="has-alpha",o.HasDimensionValues="has-dimension-values",o.HasNoneKeywords="has-none-keywords",o.HasNumberValues="has-number-values",o.HasPercentageAlpha="has-percentage-alpha",o.HasPercentageValues="has-percentage-values",o.HasVariableAlpha="has-variable-alpha",o.Hex="hex",o.LegacyHSL="legacy-hsl",o.LegacyRGB="legacy-rgb",o.NamedColor="named-color",o.RelativeColorSyntax="relative-color-syntax",o.ColorMix="color-mix",o.ContrastColor="contrast-color",o.Experimental="experimental";const s=new Set([exports.ColorNotation.A98_RGB,exports.ColorNotation.Display_P3,exports.ColorNotation.HEX,exports.ColorNotation.Linear_sRGB,exports.ColorNotation.ProPhoto_RGB,exports.ColorNotation.RGB,exports.ColorNotation.sRGB,exports.ColorNotation.Rec2020,exports.ColorNotation.XYZ_D50,exports.ColorNotation.XYZ_D65]);function colorDataTo(e,o){const a={...e};if(e.colorNotation!==o){const e=colorData_to_XYZ_D50(a);switch(o){case exports.ColorNotation.HEX:case exports.ColorNotation.RGB:a.colorNotation=exports.ColorNotation.RGB,a.channels=n.XYZ_D50_to_sRGB(e.channels);break;case exports.ColorNotation.sRGB:a.colorNotation=exports.ColorNotation.sRGB,a.channels=n.XYZ_D50_to_sRGB(e.channels);break;case exports.ColorNotation.Linear_sRGB:a.colorNotation=exports.ColorNotation.Linear_sRGB,a.channels=n.XYZ_D50_to_lin_sRGB(e.channels);break;case exports.ColorNotation.Display_P3:a.colorNotation=exports.ColorNotation.Display_P3,a.channels=n.XYZ_D50_to_P3(e.channels);break;case exports.ColorNotation.Rec2020:a.colorNotation=exports.ColorNotation.Rec2020,a.channels=n.XYZ_D50_to_rec_2020(e.channels);break;case exports.ColorNotation.ProPhoto_RGB:a.colorNotation=exports.ColorNotation.ProPhoto_RGB,a.channels=n.XYZ_D50_to_ProPhoto(e.channels);break;case exports.ColorNotation.A98_RGB:a.colorNotation=exports.ColorNotation.A98_RGB,a.channels=n.XYZ_D50_to_a98_RGB(e.channels);break;case exports.ColorNotation.HSL:a.colorNotation=exports.ColorNotation.HSL,a.channels=n.XYZ_D50_to_HSL(e.channels);break;case exports.ColorNotation.HWB:a.colorNotation=exports.ColorNotation.HWB,a.channels=n.XYZ_D50_to_HWB(e.channels);break;case exports.ColorNotation.Lab:a.colorNotation=exports.ColorNotation.Lab,a.channels=n.XYZ_D50_to_Lab(e.channels);break;case exports.ColorNotation.LCH:a.colorNotation=exports.ColorNotation.LCH,a.channels=n.XYZ_D50_to_LCH(e.channels);break;case exports.ColorNotation.OKLCH:a.colorNotation=exports.ColorNotation.OKLCH,a.channels=n.XYZ_D50_to_OKLCH(e.channels);break;case exports.ColorNotation.OKLab:a.colorNotation=exports.ColorNotation.OKLab,a.channels=n.XYZ_D50_to_OKLab(e.channels);break;case exports.ColorNotation.XYZ_D50:a.colorNotation=exports.ColorNotation.XYZ_D50,a.channels=n.XYZ_D50_to_XYZ_D50(e.channels);break;case exports.ColorNotation.XYZ_D65:a.colorNotation=exports.ColorNotation.XYZ_D65,a.channels=n.XYZ_D50_to_XYZ_D65(e.channels);break;default:throw new Error("Unsupported color notation")}}else a.channels=convertNaNToZero(e.channels);if(o===e.colorNotation)a.channels=carryForwardMissingComponents(e.channels,[0,1,2],a.channels,[0,1,2]);else if(s.has(o)&&s.has(e.colorNotation))a.channels=carryForwardMissingComponents(e.channels,[0,1,2],a.channels,[0,1,2]);else switch(o){case exports.ColorNotation.HSL:switch(e.colorNotation){case exports.ColorNotation.HWB:a.channels=carryForwardMissingComponents(e.channels,[0],a.channels,[0]);break;case exports.ColorNotation.Lab:case exports.ColorNotation.OKLab:a.channels=carryForwardMissingComponents(e.channels,[2],a.channels,[0]);break;case exports.ColorNotation.LCH:case exports.ColorNotation.OKLCH:a.channels=carryForwardMissingComponents(e.channels,[0,1,2],a.channels,[2,1,0])}break;case exports.ColorNotation.HWB:switch(e.colorNotation){case exports.ColorNotation.HSL:a.channels=carryForwardMissingComponents(e.channels,[0],a.channels,[0]);break;case exports.ColorNotation.LCH:case exports.ColorNotation.OKLCH:a.channels=carryForwardMissingComponents(e.channels,[0],a.channels,[2])}break;case exports.ColorNotation.Lab:case exports.ColorNotation.OKLab:switch(e.colorNotation){case exports.ColorNotation.HSL:a.channels=carryForwardMissingComponents(e.channels,[0],a.channels,[2]);break;case exports.ColorNotation.Lab:case exports.ColorNotation.OKLab:a.channels=carryForwardMissingComponents(e.channels,[0,1,2],a.channels,[0,1,2]);break;case exports.ColorNotation.LCH:case exports.ColorNotation.OKLCH:a.channels=carryForwardMissingComponents(e.channels,[0],a.channels,[0])}break;case exports.ColorNotation.LCH:case exports.ColorNotation.OKLCH:switch(e.colorNotation){case exports.ColorNotation.HSL:a.channels=carryForwardMissingComponents(e.channels,[0,1,2],a.channels,[2,1,0]);break;case exports.ColorNotation.HWB:a.channels=carryForwardMissingComponents(e.channels,[0],a.channels,[2]);break;case exports.ColorNotation.Lab:case exports.ColorNotation.OKLab:a.channels=carryForwardMissingComponents(e.channels,[0],a.channels,[0]);break;case exports.ColorNotation.LCH:case exports.ColorNotation.OKLCH:a.channels=carryForwardMissingComponents(e.channels,[0,1,2],a.channels,[0,1,2])}}return a.channels=convertPowerlessComponentsToMissingComponents(a.channels,o),a}function convertPowerlessComponentsToMissingComponents(e,o){const a=[...e];switch(o){case exports.ColorNotation.HSL:!Number.isNaN(a[1])&&reducePrecision(a[1],4)<=0&&(a[0]=NaN);break;case exports.ColorNotation.HWB:Math.max(0,reducePrecision(a[1],4))+Math.max(0,reducePrecision(a[2],4))>=100&&(a[0]=NaN);break;case exports.ColorNotation.LCH:!Number.isNaN(a[1])&&reducePrecision(a[1],4)<=0&&(a[2]=NaN);break;case exports.ColorNotation.OKLCH:!Number.isNaN(a[1])&&reducePrecision(a[1],6)<=0&&(a[2]=NaN)}return a}function convertPowerlessComponentsToZeroValuesForDisplay(e,o){const a=[...e];switch(o){case exports.ColorNotation.HSL:(reducePrecision(a[2])<=0||reducePrecision(a[2])>=100)&&(a[0]=NaN,a[1]=NaN),reducePrecision(a[1])<=0&&(a[0]=NaN);break;case exports.ColorNotation.HWB:Math.max(0,reducePrecision(a[1]))+Math.max(0,reducePrecision(a[2]))>=100&&(a[0]=NaN);break;case exports.ColorNotation.Lab:(reducePrecision(a[0])<=0||reducePrecision(a[0])>=100)&&(a[1]=NaN,a[2]=NaN);break;case exports.ColorNotation.LCH:reducePrecision(a[1])<=0&&(a[2]=NaN),(reducePrecision(a[0])<=0||reducePrecision(a[0])>=100)&&(a[1]=NaN,a[2]=NaN);break;case exports.ColorNotation.OKLab:(reducePrecision(a[0])<=0||reducePrecision(a[0])>=1)&&(a[1]=NaN,a[2]=NaN);break;case exports.ColorNotation.OKLCH:reducePrecision(a[1])<=0&&(a[2]=NaN),(reducePrecision(a[0])<=0||reducePrecision(a[0])>=1)&&(a[1]=NaN,a[2]=NaN)}return a}function carryForwardMissingComponents(e,o,a,n){const t=[...a];for(const a of o)Number.isNaN(e[o[a]])&&(t[n[a]]=NaN);return t}function normalizeRelativeColorDataChannels(e){const o=new Map;switch(e.colorNotation){case exports.ColorNotation.RGB:case exports.ColorNotation.HEX:o.set("r",dummyNumberToken(255*e.channels[0])),o.set("g",dummyNumberToken(255*e.channels[1])),o.set("b",dummyNumberToken(255*e.channels[2])),"number"==typeof e.alpha&&o.set("alpha",dummyNumberToken(e.alpha));break;case exports.ColorNotation.HSL:o.set("h",dummyNumberToken(e.channels[0])),o.set("s",dummyNumberToken(e.channels[1])),o.set("l",dummyNumberToken(e.channels[2])),"number"==typeof e.alpha&&o.set("alpha",dummyNumberToken(e.alpha));break;case exports.ColorNotation.HWB:o.set("h",dummyNumberToken(e.channels[0])),o.set("w",dummyNumberToken(e.channels[1])),o.set("b",dummyNumberToken(e.channels[2])),"number"==typeof e.alpha&&o.set("alpha",dummyNumberToken(e.alpha));break;case exports.ColorNotation.Lab:case exports.ColorNotation.OKLab:o.set("l",dummyNumberToken(e.channels[0])),o.set("a",dummyNumberToken(e.channels[1])),o.set("b",dummyNumberToken(e.channels[2])),"number"==typeof e.alpha&&o.set("alpha",dummyNumberToken(e.alpha));break;case exports.ColorNotation.LCH:case exports.ColorNotation.OKLCH:o.set("l",dummyNumberToken(e.channels[0])),o.set("c",dummyNumberToken(e.channels[1])),o.set("h",dummyNumberToken(e.channels[2])),"number"==typeof e.alpha&&o.set("alpha",dummyNumberToken(e.alpha));break;case exports.ColorNotation.sRGB:case exports.ColorNotation.A98_RGB:case exports.ColorNotation.Display_P3:case exports.ColorNotation.Rec2020:case exports.ColorNotation.Linear_sRGB:case exports.ColorNotation.ProPhoto_RGB:o.set("r",dummyNumberToken(e.channels[0])),o.set("g",dummyNumberToken(e.channels[1])),o.set("b",dummyNumberToken(e.channels[2])),"number"==typeof e.alpha&&o.set("alpha",dummyNumberToken(e.alpha));break;case exports.ColorNotation.XYZ_D50:case exports.ColorNotation.XYZ_D65:o.set("x",dummyNumberToken(e.channels[0])),o.set("y",dummyNumberToken(e.channels[1])),o.set("z",dummyNumberToken(e.channels[2])),"number"==typeof e.alpha&&o.set("alpha",dummyNumberToken(e.alpha))}return o}function noneToZeroInRelativeColorDataChannels(e){const o=new Map(e);for(const[a,n]of e)Number.isNaN(n[4].value)&&o.set(a,dummyNumberToken(0));return o}function dummyNumberToken(e){return Number.isNaN(e)?[a.TokenType.Number,"none",-1,-1,{value:Number.NaN,type:a.NumberType.Number}]:[a.TokenType.Number,e.toString(),-1,-1,{value:e,type:a.NumberType.Number}]}function reducePrecision(e,o=7){if(Number.isNaN(e))return 0;const a=Math.pow(10,o);return Math.round(e*a)/a}function normalize(e,o,a,n){return Math.min(Math.max(e/o,a),n)}const l=/[A-Z]/g;function toLowerCaseAZ(e){return e.replace(l,(e=>String.fromCharCode(e.charCodeAt(0)+32)))}function normalize_Color_ChannelValues(e,o,n){if(a.isTokenIdent(e)&&"none"===toLowerCaseAZ(e[4].value))return n.syntaxFlags.add(exports.SyntaxFlag.HasNoneKeywords),[a.TokenType.Number,"none",e[2],e[3],{value:NaN,type:a.NumberType.Number}];if(a.isTokenPercentage(e)){3!==o&&n.syntaxFlags.add(exports.SyntaxFlag.HasPercentageValues);let t=normalize(e[4].value,100,-2147483647,2147483647);return 3===o&&(t=normalize(e[4].value,100,0,1)),[a.TokenType.Number,t.toString(),e[2],e[3],{value:t,type:a.NumberType.Number}]}if(a.isTokenNumber(e)){3!==o&&n.syntaxFlags.add(exports.SyntaxFlag.HasNumberValues);let t=normalize(e[4].value,1,-2147483647,2147483647);return 3===o&&(t=normalize(e[4].value,1,0,1)),[a.TokenType.Number,t.toString(),e[2],e[3],{value:t,type:a.NumberType.Number}]}return!1}const i=new Set(["srgb","srgb-linear","display-p3","a98-rgb","prophoto-rgb","rec2020","xyz","xyz-d50","xyz-d65"]);function color$1(e,o){const n=[],s=[],l=[],u=[];let c,p,N=!1,m=!1;const h={colorNotation:exports.ColorNotation.sRGB,channels:[0,0,0],alpha:1,syntaxFlags:new Set([])};let x=n;for(let y=0;y<e.value.length;y++){let b=e.value[y];if(t.isWhitespaceNode(b)||t.isCommentNode(b))for(;t.isWhitespaceNode(e.value[y+1])||t.isCommentNode(e.value[y+1]);)y++;else if(x===n&&n.length&&(x=s),x===s&&s.length&&(x=l),t.isTokenNode(b)&&a.isTokenDelim(b.value)&&"/"===b.value[4].value){if(x===u)return!1;x=u}else{if(t.isFunctionNode(b)){if(x===u&&"var"===toLowerCaseAZ(b.getName())){h.syntaxFlags.add(exports.SyntaxFlag.HasVariableAlpha),x.push(b);continue}if(!r.mathFunctionNames.has(toLowerCaseAZ(b.getName())))return!1;const[[e]]=r.calcFromComponentValues([[b]],{censorIntoStandardRepresentableValues:!0,globals:p,precision:-1,toCanonicalUnits:!0});if(!e||!t.isTokenNode(e)||!a.isTokenNumeric(e.value))return!1;Number.isNaN(e.value[4].value)&&(e.value[4].value=0),b=e}if(x===n&&0===n.length&&t.isTokenNode(b)&&a.isTokenIdent(b.value)&&i.has(toLowerCaseAZ(b.value[4].value))){if(N)return!1;N=toLowerCaseAZ(b.value[4].value),h.colorNotation=colorSpaceNameToColorNotation(N),m&&(m.colorNotation!==h.colorNotation&&(m=colorDataTo(m,h.colorNotation)),c=normalizeRelativeColorDataChannels(m),p=noneToZeroInRelativeColorDataChannels(c))}else if(x===n&&0===n.length&&t.isTokenNode(b)&&a.isTokenIdent(b.value)&&"from"===toLowerCaseAZ(b.value[4].value)){if(m)return!1;if(N)return!1;for(;t.isWhitespaceNode(e.value[y+1])||t.isCommentNode(e.value[y+1]);)y++;if(y++,b=e.value[y],m=o(b),!1===m)return!1;m.syntaxFlags.has(exports.SyntaxFlag.Experimental)&&h.syntaxFlags.add(exports.SyntaxFlag.Experimental),h.syntaxFlags.add(exports.SyntaxFlag.RelativeColorSyntax)}else{if(!t.isTokenNode(b))return!1;if(a.isTokenIdent(b.value)&&c&&c.has(toLowerCaseAZ(b.value[4].value))){x.push(new t.TokenNode(c.get(toLowerCaseAZ(b.value[4].value))));continue}x.push(b)}}}if(!N)return!1;if(1!==x.length)return!1;if(1!==n.length||1!==s.length||1!==l.length)return!1;if(!t.isTokenNode(n[0])||!t.isTokenNode(s[0])||!t.isTokenNode(l[0]))return!1;if(c&&!c.has("alpha"))return!1;const y=normalize_Color_ChannelValues(n[0].value,0,h);if(!y||!a.isTokenNumber(y))return!1;const b=normalize_Color_ChannelValues(s[0].value,1,h);if(!b||!a.isTokenNumber(b))return!1;const C=normalize_Color_ChannelValues(l[0].value,2,h);if(!C||!a.isTokenNumber(C))return!1;const d=[y,b,C];if(1===u.length)if(h.syntaxFlags.add(exports.SyntaxFlag.HasAlpha),t.isTokenNode(u[0])){const e=normalize_Color_ChannelValues(u[0].value,3,h);if(!e||!a.isTokenNumber(e))return!1;d.push(e)}else h.alpha=u[0];else if(c&&c.has("alpha")){const e=normalize_Color_ChannelValues(c.get("alpha"),3,h);if(!e||!a.isTokenNumber(e))return!1;d.push(e)}return h.channels=[d[0][4].value,d[1][4].value,d[2][4].value],4===d.length&&(h.alpha=d[3][4].value),h}function colorSpaceNameToColorNotation(e){switch(e){case"srgb":return exports.ColorNotation.sRGB;case"srgb-linear":return exports.ColorNotation.Linear_sRGB;case"display-p3":return exports.ColorNotation.Display_P3;case"a98-rgb":return exports.ColorNotation.A98_RGB;case"prophoto-rgb":return exports.ColorNotation.ProPhoto_RGB;case"rec2020":return exports.ColorNotation.Rec2020;case"xyz":case"xyz-d65":return exports.ColorNotation.XYZ_D65;case"xyz-d50":return exports.ColorNotation.XYZ_D50;default:throw new Error("Unknown color space name: "+e)}}const u=new Set(["srgb","srgb-linear","display-p3","a98-rgb","prophoto-rgb","rec2020","lab","oklab","xyz","xyz-d50","xyz-d65"]),c=new Set(["hsl","hwb","lch","oklch"]),p=new Set(["shorter","longer","increasing","decreasing"]);function colorMix(e,o){let n=null,r=null,s=null,l=!1;for(let i=0;i<e.value.length;i++){const N=e.value[i];if(!t.isWhitespaceNode(N)&&!t.isCommentNode(N)){if(t.isTokenNode(N)&&a.isTokenIdent(N.value)){if(!n&&"in"===toLowerCaseAZ(N.value[4].value)){n=N;continue}if(n&&!r){r=toLowerCaseAZ(N.value[4].value);continue}if(n&&r&&!s&&c.has(r)){s=toLowerCaseAZ(N.value[4].value);continue}if(n&&r&&s&&!l&&"hue"===toLowerCaseAZ(N.value[4].value)){l=!0;continue}return!1}return!(!t.isTokenNode(N)||!a.isTokenComma(N.value))&&(!!r&&(s||l?!!(r&&s&&l&&c.has(r)&&p.has(s))&&colorMixPolar(r,s,colorMixComponents(e.value.slice(i+1),o)):u.has(r)?colorMixRectangular(r,colorMixComponents(e.value.slice(i+1),o)):!!c.has(r)&&colorMixPolar(r,"shorter",colorMixComponents(e.value.slice(i+1),o))))}}return!1}function colorMixComponents(e,o){const n=[];let s=1,l=!1,i=!1;for(let s=0;s<e.length;s++){let u=e[s];if(!t.isWhitespaceNode(u)&&!t.isCommentNode(u)){if(!t.isTokenNode(u)||!a.isTokenComma(u.value)){if(!l){const e=o(u);if(e){l=e;continue}}if(!i){if(t.isFunctionNode(u)&&r.mathFunctionNames.has(toLowerCaseAZ(u.getName()))){if([[u]]=r.calcFromComponentValues([[u]],{censorIntoStandardRepresentableValues:!0,precision:-1,toCanonicalUnits:!0}),!u||!t.isTokenNode(u)||!a.isTokenNumeric(u.value))return!1;Number.isNaN(u.value[4].value)&&(u.value[4].value=0)}if(t.isTokenNode(u)&&a.isTokenPercentage(u.value)&&u.value[4].value>=0){i=u.value[4].value;continue}}return!1}if(!l)return!1;n.push({color:l,percentage:i}),l=!1,i=!1}}if(l&&n.push({color:l,percentage:i}),2!==n.length)return!1;let u=n[0].percentage,c=n[1].percentage;return(!1===u||!(u<0||u>100))&&((!1===c||!(c<0||c>100))&&(!1===u&&!1===c?(u=50,c=50):!1!==u&&!1===c?c=100-u:!1===u&&!1!==c&&(u=100-c),(0!==u||0!==c)&&(!1!==u&&!1!==c&&(u+c>100&&(u=u/(u+c)*100,c=c/(u+c)*100),u+c<100&&(s=(u+c)/100,u=u/(u+c)*100,c=c/(u+c)*100),{a:{color:n[0].color,percentage:u},b:{color:n[1].color,percentage:c},alphaMultiplier:s}))))}function colorMixRectangular(e,o){if(!o)return!1;const a=o.a.color,n=o.b.color,t=o.a.percentage/100;let r=a.channels,s=n.channels,l=exports.ColorNotation.RGB,i=a.alpha;if("number"!=typeof i)return!1;let u=n.alpha;if("number"!=typeof u)return!1;switch(i=Number.isNaN(i)?u:i,u=Number.isNaN(u)?i:u,e){case"srgb":l=exports.ColorNotation.RGB;break;case"srgb-linear":l=exports.ColorNotation.Linear_sRGB;break;case"display-p3":l=exports.ColorNotation.Display_P3;break;case"a98-rgb":l=exports.ColorNotation.A98_RGB;break;case"prophoto-rgb":l=exports.ColorNotation.ProPhoto_RGB;break;case"rec2020":l=exports.ColorNotation.Rec2020;break;case"lab":l=exports.ColorNotation.Lab;break;case"oklab":l=exports.ColorNotation.OKLab;break;case"xyz-d50":l=exports.ColorNotation.XYZ_D50;break;case"xyz":case"xyz-d65":l=exports.ColorNotation.XYZ_D65}r=colorDataTo(a,l).channels,s=colorDataTo(n,l).channels,r[0]=fillInMissingComponent(r[0],s[0]),s[0]=fillInMissingComponent(s[0],r[0]),r[1]=fillInMissingComponent(r[1],s[1]),s[1]=fillInMissingComponent(s[1],r[1]),r[2]=fillInMissingComponent(r[2],s[2]),s[2]=fillInMissingComponent(s[2],r[2]),r[0]=premultiply(r[0],i),r[1]=premultiply(r[1],i),r[2]=premultiply(r[2],i),s[0]=premultiply(s[0],u),s[1]=premultiply(s[1],u),s[2]=premultiply(s[2],u);const c=interpolate(i,u,t),p={colorNotation:l,channels:[un_premultiply(interpolate(r[0],s[0],t),c),un_premultiply(interpolate(r[1],s[1],t),c),un_premultiply(interpolate(r[2],s[2],t),c)],alpha:c*o.alphaMultiplier,syntaxFlags:new Set([exports.SyntaxFlag.ColorMix])};return(o.a.color.syntaxFlags.has(exports.SyntaxFlag.Experimental)||o.b.color.syntaxFlags.has(exports.SyntaxFlag.Experimental))&&p.syntaxFlags.add(exports.SyntaxFlag.Experimental),p}function colorMixPolar(e,o,a){if(!a)return!1;const n=a.a.color,t=a.b.color,r=a.a.percentage/100;let s=n.channels,l=t.channels,i=0,u=0,c=0,p=0,N=0,m=0,h=exports.ColorNotation.RGB,x=n.alpha;if("number"!=typeof x)return!1;let y=t.alpha;if("number"!=typeof y)return!1;switch(x=Number.isNaN(x)?y:x,y=Number.isNaN(y)?x:y,e){case"hsl":h=exports.ColorNotation.HSL;break;case"hwb":h=exports.ColorNotation.HWB;break;case"lch":h=exports.ColorNotation.LCH;break;case"oklch":h=exports.ColorNotation.OKLCH}switch(s=colorDataTo(n,h).channels,l=colorDataTo(t,h).channels,e){case"hsl":case"hwb":i=s[0],u=l[0],c=s[1],p=l[1],N=s[2],m=l[2];break;case"lch":case"oklch":c=s[0],p=l[0],N=s[1],m=l[1],i=s[2],u=l[2]}i=fillInMissingComponent(i,u),Number.isNaN(i)&&(i=0),u=fillInMissingComponent(u,i),Number.isNaN(u)&&(u=0),c=fillInMissingComponent(c,p),p=fillInMissingComponent(p,c),N=fillInMissingComponent(N,m),m=fillInMissingComponent(m,N);const b=u-i;switch(o){case"shorter":b>180?i+=360:b<-180&&(u+=360);break;case"longer":-180<b&&b<180&&(b>0?i+=360:u+=360);break;case"increasing":b<0&&(u+=360);break;case"decreasing":b>0&&(i+=360);break;default:throw new Error("Unknown hue interpolation method")}c=premultiply(c,x),N=premultiply(N,x),p=premultiply(p,y),m=premultiply(m,y);let C=[0,0,0];const d=interpolate(x,y,r);switch(e){case"hsl":case"hwb":C=[interpolate(i,u,r),un_premultiply(interpolate(c,p,r),d),un_premultiply(interpolate(N,m,r),d)];break;case"lch":case"oklch":C=[un_premultiply(interpolate(c,p,r),d),un_premultiply(interpolate(N,m,r),d),interpolate(i,u,r)]}const T={colorNotation:h,channels:C,alpha:d*a.alphaMultiplier,syntaxFlags:new Set([exports.SyntaxFlag.ColorMix])};return(a.a.color.syntaxFlags.has(exports.SyntaxFlag.Experimental)||a.b.color.syntaxFlags.has(exports.SyntaxFlag.Experimental))&&T.syntaxFlags.add(exports.SyntaxFlag.Experimental),T}function fillInMissingComponent(e,o){return Number.isNaN(e)?o:e}function interpolate(e,o,a){return e*a+o*(1-a)}function premultiply(e,o){return Number.isNaN(o)?e:Number.isNaN(e)?NaN:e*o}function un_premultiply(e,o){return 0===o||Number.isNaN(o)?e:Number.isNaN(e)?NaN:e/o}function hex(e){const o=toLowerCaseAZ(e[4].value);if(o.match(/[^a-f0-9]/))return!1;const a={colorNotation:exports.ColorNotation.HEX,channels:[0,0,0],alpha:1,syntaxFlags:new Set([exports.SyntaxFlag.Hex])},n=o.length;if(3===n){const e=o[0],n=o[1],t=o[2];return a.channels=[parseInt(e+e,16)/255,parseInt(n+n,16)/255,parseInt(t+t,16)/255],a}if(6===n){const e=o[0]+o[1],n=o[2]+o[3],t=o[4]+o[5];return a.channels=[parseInt(e,16)/255,parseInt(n,16)/255,parseInt(t,16)/255],a}if(4===n){const e=o[0],n=o[1],t=o[2],r=o[3];return a.channels=[parseInt(e+e,16)/255,parseInt(n+n,16)/255,parseInt(t+t,16)/255],a.alpha=parseInt(r+r,16)/255,a.syntaxFlags.add(exports.SyntaxFlag.HasAlpha),a}if(8===n){const e=o[0]+o[1],n=o[2]+o[3],t=o[4]+o[5],r=o[6]+o[7];return a.channels=[parseInt(e,16)/255,parseInt(n,16)/255,parseInt(t,16)/255],a.alpha=parseInt(r,16)/255,a.syntaxFlags.add(exports.SyntaxFlag.HasAlpha),a}return!1}function normalizeHue(e){if(a.isTokenNumber(e))return e[4].value=e[4].value%360,e[1]=e[4].value.toString(),e;if(a.isTokenDimension(e)){let o=e[4].value;switch(toLowerCaseAZ(e[4].unit)){case"deg":break;case"rad":o=180*e[4].value/Math.PI;break;case"grad":o=.9*e[4].value;break;case"turn":o=360*e[4].value;break;default:return!1}return o%=360,[a.TokenType.Number,o.toString(),e[2],e[3],{value:o,type:a.NumberType.Number}]}return!1}function normalize_legacy_HSL_ChannelValues(e,o,n){if(0===o){const o=normalizeHue(e);return!1!==o&&(a.isTokenDimension(e)&&n.syntaxFlags.add(exports.SyntaxFlag.HasDimensionValues),o)}if(a.isTokenPercentage(e)){3===o?n.syntaxFlags.add(exports.SyntaxFlag.HasPercentageAlpha):n.syntaxFlags.add(exports.SyntaxFlag.HasPercentageValues);let t=normalize(e[4].value,1,0,100);return 3===o&&(t=normalize(e[4].value,100,0,1)),[a.TokenType.Number,t.toString(),e[2],e[3],{value:t,type:a.NumberType.Number}]}if(a.isTokenNumber(e)){if(3!==o)return!1;let n=normalize(e[4].value,1,0,100);return 3===o&&(n=normalize(e[4].value,1,0,1)),[a.TokenType.Number,n.toString(),e[2],e[3],{value:n,type:a.NumberType.Number}]}return!1}function normalize_modern_HSL_ChannelValues(e,o,n){if(a.isTokenIdent(e)&&"none"===toLowerCaseAZ(e[4].value))return n.syntaxFlags.add(exports.SyntaxFlag.HasNoneKeywords),[a.TokenType.Number,"none",e[2],e[3],{value:NaN,type:a.NumberType.Number}];if(0===o){const o=normalizeHue(e);return!1!==o&&(a.isTokenDimension(e)&&n.syntaxFlags.add(exports.SyntaxFlag.HasDimensionValues),o)}if(a.isTokenPercentage(e)){3===o?n.syntaxFlags.add(exports.SyntaxFlag.HasPercentageAlpha):n.syntaxFlags.add(exports.SyntaxFlag.HasPercentageValues);let t=e[4].value;return 3===o?t=normalize(e[4].value,100,0,1):1===o&&(t=normalize(e[4].value,1,0,2147483647)),[a.TokenType.Number,t.toString(),e[2],e[3],{value:t,type:a.NumberType.Number}]}if(a.isTokenNumber(e)){3!==o&&n.syntaxFlags.add(exports.SyntaxFlag.HasNumberValues);let t=e[4].value;return 3===o?t=normalize(e[4].value,1,0,1):1===o&&(t=normalize(e[4].value,1,0,2147483647)),[a.TokenType.Number,t.toString(),e[2],e[3],{value:t,type:a.NumberType.Number}]}return!1}function threeChannelLegacySyntax(e,o,n,s){const l=[],i=[],u=[],c=[],p={colorNotation:n,channels:[0,0,0],alpha:1,syntaxFlags:new Set(s)};let N=l;for(let o=0;o<e.value.length;o++){let n=e.value[o];if(!t.isWhitespaceNode(n)&&!t.isCommentNode(n)){if(t.isTokenNode(n)&&a.isTokenComma(n.value)){if(N===l){N=i;continue}if(N===i){N=u;continue}if(N===u){N=c;continue}if(N===c)return!1}if(t.isFunctionNode(n)){if(N===c&&"var"===n.getName().toLowerCase()){p.syntaxFlags.add(exports.SyntaxFlag.HasVariableAlpha),N.push(n);continue}if(!r.mathFunctionNames.has(n.getName().toLowerCase()))return!1;const[[e]]=r.calcFromComponentValues([[n]],{censorIntoStandardRepresentableValues:!0,precision:-1,toCanonicalUnits:!0});if(!e||!t.isTokenNode(e)||!a.isTokenNumeric(e.value))return!1;Number.isNaN(e.value[4].value)&&(e.value[4].value=0),n=e}if(!t.isTokenNode(n))return!1;N.push(n)}}if(1!==N.length)return!1;if(1!==l.length||1!==i.length||1!==u.length)return!1;if(!t.isTokenNode(l[0])||!t.isTokenNode(i[0])||!t.isTokenNode(u[0]))return!1;const m=o(l[0].value,0,p);if(!m||!a.isTokenNumber(m))return!1;const h=o(i[0].value,1,p);if(!h||!a.isTokenNumber(h))return!1;const x=o(u[0].value,2,p);if(!x||!a.isTokenNumber(x))return!1;const y=[m,h,x];if(1===c.length)if(p.syntaxFlags.add(exports.SyntaxFlag.HasAlpha),t.isTokenNode(c[0])){const e=o(c[0].value,3,p);if(!e||!a.isTokenNumber(e))return!1;y.push(e)}else p.alpha=c[0];return p.channels=[y[0][4].value,y[1][4].value,y[2][4].value],4===y.length&&(p.alpha=y[3][4].value),p}function threeChannelSpaceSeparated(e,o,n,s,l){const i=[],u=[],c=[],p=[];let N,m,h=!1;const x={colorNotation:n,channels:[0,0,0],alpha:1,syntaxFlags:new Set(s)};let y=i;for(let o=0;o<e.value.length;o++){let s=e.value[o];if(t.isWhitespaceNode(s)||t.isCommentNode(s))for(;t.isWhitespaceNode(e.value[o+1])||t.isCommentNode(e.value[o+1]);)o++;else if(y===i&&i.length&&(y=u),y===u&&u.length&&(y=c),t.isTokenNode(s)&&a.isTokenDelim(s.value)&&"/"===s.value[4].value){if(y===p)return!1;y=p}else{if(t.isFunctionNode(s)){if(y===p&&"var"===s.getName().toLowerCase()){x.syntaxFlags.add(exports.SyntaxFlag.HasVariableAlpha),y.push(s);continue}if(!r.mathFunctionNames.has(s.getName().toLowerCase()))return!1;const[[e]]=r.calcFromComponentValues([[s]],{censorIntoStandardRepresentableValues:!0,globals:m,precision:-1,toCanonicalUnits:!0});if(!e||!t.isTokenNode(e)||!a.isTokenNumeric(e.value))return!1;Number.isNaN(e.value[4].value)&&(e.value[4].value=0),s=e}if(y===i&&0===i.length&&t.isTokenNode(s)&&a.isTokenIdent(s.value)&&"from"===s.value[4].value.toLowerCase()){if(h)return!1;for(;t.isWhitespaceNode(e.value[o+1])||t.isCommentNode(e.value[o+1]);)o++;if(o++,s=e.value[o],h=l(s),!1===h)return!1;h.syntaxFlags.has(exports.SyntaxFlag.Experimental)&&x.syntaxFlags.add(exports.SyntaxFlag.Experimental),x.syntaxFlags.add(exports.SyntaxFlag.RelativeColorSyntax),h.colorNotation!==n&&(h=colorDataTo(h,n)),N=normalizeRelativeColorDataChannels(h),m=noneToZeroInRelativeColorDataChannels(N)}else{if(!t.isTokenNode(s))return!1;if(a.isTokenIdent(s.value)&&N){const e=s.value[4].value.toLowerCase();if(N.has(e)){y.push(new t.TokenNode(N.get(e)));continue}}y.push(s)}}}if(1!==y.length)return!1;if(1!==i.length||1!==u.length||1!==c.length)return!1;if(!t.isTokenNode(i[0])||!t.isTokenNode(u[0])||!t.isTokenNode(c[0]))return!1;if(N&&!N.has("alpha"))return!1;const b=o(i[0].value,0,x);if(!b||!a.isTokenNumber(b))return!1;const C=o(u[0].value,1,x);if(!C||!a.isTokenNumber(C))return!1;const d=o(c[0].value,2,x);if(!d||!a.isTokenNumber(d))return!1;const T=[b,C,d];if(1===p.length)if(x.syntaxFlags.add(exports.SyntaxFlag.HasAlpha),t.isTokenNode(p[0])){const e=o(p[0].value,3,x);if(!e||!a.isTokenNumber(e))return!1;T.push(e)}else x.alpha=p[0];else if(N&&N.has("alpha")){const e=o(N.get("alpha"),3,x);if(!e||!a.isTokenNumber(e))return!1;T.push(e)}return x.channels=[T[0][4].value,T[1][4].value,T[2][4].value],4===T.length&&(x.alpha=T[3][4].value),x}function hsl(e,o){if(e.value.some((e=>t.isTokenNode(e)&&a.isTokenComma(e.value)))){const o=hslCommaSeparated(e);if(!1!==o)return o}{const a=hslSpaceSeparated(e,o);if(!1!==a)return a}return!1}function hslCommaSeparated(e){return threeChannelLegacySyntax(e,normalize_legacy_HSL_ChannelValues,exports.ColorNotation.HSL,[exports.SyntaxFlag.LegacyHSL])}function hslSpaceSeparated(e,o){return threeChannelSpaceSeparated(e,normalize_modern_HSL_ChannelValues,exports.ColorNotation.HSL,[],o)}function normalize_HWB_ChannelValues(e,o,n){if(a.isTokenIdent(e)&&"none"===toLowerCaseAZ(e[4].value))return n.syntaxFlags.add(exports.SyntaxFlag.HasNoneKeywords),[a.TokenType.Number,"none",e[2],e[3],{value:NaN,type:a.NumberType.Number}];if(0===o){const o=normalizeHue(e);return!1!==o&&(a.isTokenDimension(e)&&n.syntaxFlags.add(exports.SyntaxFlag.HasDimensionValues),o)}if(a.isTokenPercentage(e)){3===o?n.syntaxFlags.add(exports.SyntaxFlag.HasPercentageAlpha):n.syntaxFlags.add(exports.SyntaxFlag.HasPercentageValues);let t=e[4].value;return 3===o&&(t=normalize(e[4].value,100,0,1)),[a.TokenType.Number,t.toString(),e[2],e[3],{value:t,type:a.NumberType.Number}]}if(a.isTokenNumber(e)){3!==o&&n.syntaxFlags.add(exports.SyntaxFlag.HasNumberValues);let t=e[4].value;return 3===o&&(t=normalize(e[4].value,1,0,1)),[a.TokenType.Number,t.toString(),e[2],e[3],{value:t,type:a.NumberType.Number}]}return!1}function normalize_Lab_ChannelValues(e,o,n){if(a.isTokenIdent(e)&&"none"===toLowerCaseAZ(e[4].value))return n.syntaxFlags.add(exports.SyntaxFlag.HasNoneKeywords),[a.TokenType.Number,"none",e[2],e[3],{value:NaN,type:a.NumberType.Number}];if(a.isTokenPercentage(e)){3!==o&&n.syntaxFlags.add(exports.SyntaxFlag.HasPercentageValues);let t=normalize(e[4].value,1,0,100);return 1===o||2===o?t=normalize(e[4].value,.8,-2147483647,2147483647):3===o&&(t=normalize(e[4].value,100,0,1)),[a.TokenType.Number,t.toString(),e[2],e[3],{value:t,type:a.NumberType.Number}]}if(a.isTokenNumber(e)){3!==o&&n.syntaxFlags.add(exports.SyntaxFlag.HasNumberValues);let t=normalize(e[4].value,1,0,100);return 1===o||2===o?t=normalize(e[4].value,1,-2147483647,2147483647):3===o&&(t=normalize(e[4].value,1,0,1)),[a.TokenType.Number,t.toString(),e[2],e[3],{value:t,type:a.NumberType.Number}]}return!1}function lab(e,o){return threeChannelSpaceSeparated(e,normalize_Lab_ChannelValues,exports.ColorNotation.Lab,[],o)}function normalize_LCH_ChannelValues(e,o,n){if(a.isTokenIdent(e)&&"none"===toLowerCaseAZ(e[4].value))return n.syntaxFlags.add(exports.SyntaxFlag.HasNoneKeywords),[a.TokenType.Number,"none",e[2],e[3],{value:NaN,type:a.NumberType.Number}];if(2===o){const o=normalizeHue(e);return!1!==o&&(a.isTokenDimension(e)&&n.syntaxFlags.add(exports.SyntaxFlag.HasDimensionValues),o)}if(a.isTokenPercentage(e)){3!==o&&n.syntaxFlags.add(exports.SyntaxFlag.HasPercentageValues);let t=normalize(e[4].value,1,0,100);return 1===o?t=normalize(e[4].value,100/150,0,2147483647):3===o&&(t=normalize(e[4].value,100,0,1)),[a.TokenType.Number,t.toString(),e[2],e[3],{value:t,type:a.NumberType.Number}]}if(a.isTokenNumber(e)){3!==o&&n.syntaxFlags.add(exports.SyntaxFlag.HasNumberValues);let t=normalize(e[4].value,1,0,100);return 1===o?t=normalize(e[4].value,1,0,2147483647):3===o&&(t=normalize(e[4].value,1,0,1)),[a.TokenType.Number,t.toString(),e[2],e[3],{value:t,type:a.NumberType.Number}]}return!1}function lch(e,o){return threeChannelSpaceSeparated(e,normalize_LCH_ChannelValues,exports.ColorNotation.LCH,[],o)}const N=new Map;for(const[e,o]of Object.entries(n.namedColors))N.set(e,o);function namedColor(e){const o=N.get(toLowerCaseAZ(e));return!!o&&{colorNotation:exports.ColorNotation.RGB,channels:[o[0]/255,o[1]/255,o[2]/255],alpha:1,syntaxFlags:new Set([exports.SyntaxFlag.ColorKeyword,exports.SyntaxFlag.NamedColor])}}function normalize_OKLab_ChannelValues(e,o,n){if(a.isTokenIdent(e)&&"none"===toLowerCaseAZ(e[4].value))return n.syntaxFlags.add(exports.SyntaxFlag.HasNoneKeywords),[a.TokenType.Number,"none",e[2],e[3],{value:NaN,type:a.NumberType.Number}];if(a.isTokenPercentage(e)){3!==o&&n.syntaxFlags.add(exports.SyntaxFlag.HasPercentageValues);let t=normalize(e[4].value,100,0,1);return 1===o||2===o?t=normalize(e[4].value,250,-2147483647,2147483647):3===o&&(t=normalize(e[4].value,100,0,1)),[a.TokenType.Number,t.toString(),e[2],e[3],{value:t,type:a.NumberType.Number}]}if(a.isTokenNumber(e)){3!==o&&n.syntaxFlags.add(exports.SyntaxFlag.HasNumberValues);let t=normalize(e[4].value,1,0,1);return 1===o||2===o?t=normalize(e[4].value,1,-2147483647,2147483647):3===o&&(t=normalize(e[4].value,1,0,1)),[a.TokenType.Number,t.toString(),e[2],e[3],{value:t,type:a.NumberType.Number}]}return!1}function oklab(e,o){return threeChannelSpaceSeparated(e,normalize_OKLab_ChannelValues,exports.ColorNotation.OKLab,[],o)}function normalize_OKLCH_ChannelValues(e,o,n){if(a.isTokenIdent(e)&&"none"===toLowerCaseAZ(e[4].value))return n.syntaxFlags.add(exports.SyntaxFlag.HasNoneKeywords),[a.TokenType.Number,"none",e[2],e[3],{value:NaN,type:a.NumberType.Number}];if(2===o){const o=normalizeHue(e);return!1!==o&&(a.isTokenDimension(e)&&n.syntaxFlags.add(exports.SyntaxFlag.HasDimensionValues),o)}if(a.isTokenPercentage(e)){3!==o&&n.syntaxFlags.add(exports.SyntaxFlag.HasPercentageValues);let t=normalize(e[4].value,100,0,1);return 1===o?t=normalize(e[4].value,250,0,2147483647):3===o&&(t=normalize(e[4].value,100,0,1)),[a.TokenType.Number,t.toString(),e[2],e[3],{value:t,type:a.NumberType.Number}]}if(a.isTokenNumber(e)){3!==o&&n.syntaxFlags.add(exports.SyntaxFlag.HasNumberValues);let t=normalize(e[4].value,1,0,1);return 1===o?t=normalize(e[4].value,1,0,2147483647):3===o&&(t=normalize(e[4].value,1,0,1)),[a.TokenType.Number,t.toString(),e[2],e[3],{value:t,type:a.NumberType.Number}]}return!1}function oklch(e,o){return threeChannelSpaceSeparated(e,normalize_OKLCH_ChannelValues,exports.ColorNotation.OKLCH,[],o)}function normalize_legacy_sRGB_ChannelValues(e,o,n){if(a.isTokenPercentage(e)){3===o?n.syntaxFlags.add(exports.SyntaxFlag.HasPercentageAlpha):n.syntaxFlags.add(exports.SyntaxFlag.HasPercentageValues);const t=normalize(e[4].value,100,0,1);return[a.TokenType.Number,t.toString(),e[2],e[3],{value:t,type:a.NumberType.Number}]}if(a.isTokenNumber(e)){3!==o&&n.syntaxFlags.add(exports.SyntaxFlag.HasNumberValues);let t=normalize(e[4].value,255,0,1);return 3===o&&(t=normalize(e[4].value,1,0,1)),[a.TokenType.Number,t.toString(),e[2],e[3],{value:t,type:a.NumberType.Number}]}return!1}function normalize_modern_sRGB_ChannelValues(e,o,n){if(a.isTokenIdent(e)&&"none"===e[4].value.toLowerCase())return n.syntaxFlags.add(exports.SyntaxFlag.HasNoneKeywords),[a.TokenType.Number,"none",e[2],e[3],{value:NaN,type:a.NumberType.Number}];if(a.isTokenPercentage(e)){3!==o&&n.syntaxFlags.add(exports.SyntaxFlag.HasPercentageValues);let t=normalize(e[4].value,100,-2147483647,2147483647);return 3===o&&(t=normalize(e[4].value,100,0,1)),[a.TokenType.Number,t.toString(),e[2],e[3],{value:t,type:a.NumberType.Number}]}if(a.isTokenNumber(e)){3!==o&&n.syntaxFlags.add(exports.SyntaxFlag.HasNumberValues);let t=normalize(e[4].value,255,-2147483647,2147483647);return 3===o&&(t=normalize(e[4].value,1,0,1)),[a.TokenType.Number,t.toString(),e[2],e[3],{value:t,type:a.NumberType.Number}]}return!1}function rgb(e,o){if(e.value.some((e=>t.isTokenNode(e)&&a.isTokenComma(e.value)))){const o=rgbCommaSeparated(e);if(!1!==o)return(!o.syntaxFlags.has(exports.SyntaxFlag.HasNumberValues)||!o.syntaxFlags.has(exports.SyntaxFlag.HasPercentageValues))&&o}else{const a=rgbSpaceSeparated(e,o);if(!1!==a)return a}return!1}function rgbCommaSeparated(e){return threeChannelLegacySyntax(e,normalize_legacy_sRGB_ChannelValues,exports.ColorNotation.RGB,[exports.SyntaxFlag.LegacyRGB])}function rgbSpaceSeparated(e,o){return threeChannelSpaceSeparated(e,normalize_modern_sRGB_ChannelValues,exports.ColorNotation.RGB,[],o)}function XYZ_D50_to_sRGB_Gamut(e){const o=n.XYZ_D50_to_sRGB(e);if(n.inGamut(o))return n.clip(o);let a=e;return a=n.XYZ_D50_to_OKLCH(a),a[0]<1e-6&&(a=[0,0,0]),a[0]>.999999&&(a=[1,0,0]),n.gam_sRGB(n.mapGamutRayTrace(a,oklch_to_lin_srgb,lin_srgb_to_oklch))}function oklch_to_lin_srgb(e){return e=n.OKLCH_to_OKLab(e),e=n.OKLab_to_XYZ(e),n.XYZ_to_lin_sRGB(e)}function lin_srgb_to_oklch(e){return e=n.lin_sRGB_to_XYZ(e),e=n.XYZ_to_OKLab(e),n.OKLab_to_OKLCH(e)}function contrastColor(e,o){let r=!1,s=!1;for(let n=0;n<e.value.length;n++){const l=e.value[n];if(!t.isWhitespaceNode(l)&&!t.isCommentNode(l)&&(r||(r=o(l),!r))){if(!r||s||!t.isTokenNode(l)||!a.isTokenIdent(l.value)||"max"!==toLowerCaseAZ(l.value[4].value))return!1;s=!0}}if(!r||!s)return!1;r.channels=convertNaNToZero(r.channels),r.channels=XYZ_D50_to_sRGB_Gamut(colorData_to_XYZ_D50(r).channels),r.colorNotation=exports.ColorNotation.sRGB;const l={colorNotation:exports.ColorNotation.sRGB,channels:[0,0,0],alpha:1,syntaxFlags:new Set([exports.SyntaxFlag.ContrastColor,exports.SyntaxFlag.Experimental])},i=n.contrast_ratio_wcag_2_1(r.channels,[1,1,1]),u=n.contrast_ratio_wcag_2_1(r.channels,[0,0,0]);return l.channels=i>u?[1,1,1]:[0,0,0],l}function toPrecision(e,o=7){e=+e,o=+o;const a=(Math.floor(e)+"").length;if(o>a)return+e.toFixed(o-a);{const n=10**(a-o);return Math.round(e/n)*n}}function XYZ_D50_to_P3_Gamut(e){const o=n.XYZ_D50_to_P3(e);if(n.inGamut(o))return n.clip(o);let a=e;return a=n.XYZ_D50_to_OKLCH(a),a[0]<1e-6&&(a=[0,0,0]),a[0]>.999999&&(a=[1,0,0]),n.gam_P3(n.mapGamutRayTrace(a,oklch_to_lin_p3,lin_p3_to_oklch))}function oklch_to_lin_p3(e){return e=n.OKLCH_to_OKLab(e),e=n.OKLab_to_XYZ(e),n.XYZ_to_lin_P3(e)}function lin_p3_to_oklch(e){return e=n.lin_P3_to_XYZ(e),e=n.XYZ_to_OKLab(e),n.OKLab_to_OKLCH(e)}function serializeWithAlpha(e,o,n,r){const s=[a.TokenType.CloseParen,")",-1,-1,void 0];if("number"==typeof e.alpha){const l=Math.min(1,Math.max(0,toPrecision(Number.isNaN(e.alpha)?0:e.alpha)));return 1===toPrecision(l,4)?new t.FunctionNode(o,s,r):new t.FunctionNode(o,s,[...r,new t.WhitespaceNode([n]),new t.TokenNode([a.TokenType.Delim,"/",-1,-1,{value:"/"}]),new t.WhitespaceNode([n]),new t.TokenNode([a.TokenType.Number,toPrecision(l,4).toString(),-1,-1,{value:e.alpha,type:a.NumberType.Integer}])])}return new t.FunctionNode(o,s,[...r,new t.WhitespaceNode([n]),new t.TokenNode([a.TokenType.Delim,"/",-1,-1,{value:"/"}]),new t.WhitespaceNode([n]),e.alpha])}exports.color=function color(e){if(t.isFunctionNode(e)){switch(toLowerCaseAZ(e.getName())){case"rgb":case"rgba":return rgb(e,color);case"hsl":case"hsla":return hsl(e,color);case"hwb":return o=color,threeChannelSpaceSeparated(e,normalize_HWB_ChannelValues,exports.ColorNotation.HWB,[],o);case"lab":return lab(e,color);case"lch":return lch(e,color);case"oklab":return oklab(e,color);case"oklch":return oklch(e,color);case"color":return color$1(e,color);case"color-mix":return colorMix(e,color);case"contrast-color":return contrastColor(e,color)}}var o;if(t.isTokenNode(e)){if(a.isTokenHash(e.value))return hex(e.value);if(a.isTokenIdent(e.value)){const o=namedColor(e.value[4].value);return!1!==o?o:"transparent"===toLowerCaseAZ(e.value[4].value)&&{colorNotation:exports.ColorNotation.RGB,channels:[0,0,0],alpha:0,syntaxFlags:new Set([exports.SyntaxFlag.ColorKeyword])}}}return!1},exports.colorDataFitsDisplayP3_Gamut=function colorDataFitsDisplayP3_Gamut(e){const o={...e,channels:[...e.channels]};return o.channels=convertPowerlessComponentsToZeroValuesForDisplay(o.channels,o.colorNotation),!colorDataTo(o,exports.ColorNotation.Display_P3).channels.find((e=>e<-1e-5||e>1.00001))},exports.colorDataFitsRGB_Gamut=function colorDataFitsRGB_Gamut(e){const o={...e,channels:[...e.channels]};return o.channels=convertPowerlessComponentsToZeroValuesForDisplay(o.channels,o.colorNotation),!colorDataTo(o,exports.ColorNotation.RGB).channels.find((e=>e<-1e-5||e>1.00001))},exports.serializeHSL=function serializeHSL(e,o=!0){e.channels=convertPowerlessComponentsToZeroValuesForDisplay(e.channels,e.colorNotation);let r=e.channels.map((e=>Number.isNaN(e)?0:e));r=o?n.XYZ_D50_to_HSL(n.sRGB_to_XYZ_D50(XYZ_D50_to_sRGB_Gamut(colorData_to_XYZ_D50(e).channels))):n.XYZ_D50_to_HSL(colorData_to_XYZ_D50(e).channels),r=r.map((e=>Number.isNaN(e)?0:e));const s=Math.min(360,Math.max(0,Math.round(toPrecision(r[0])))),l=Math.min(100,Math.max(0,Math.round(toPrecision(r[1])))),i=Math.min(100,Math.max(0,Math.round(toPrecision(r[2])))),u=[a.TokenType.CloseParen,")",-1,-1,void 0],c=[a.TokenType.Whitespace," ",-1,-1,void 0],p=[a.TokenType.Comma,",",-1,-1,void 0],N=[new t.TokenNode([a.TokenType.Number,s.toString(),-1,-1,{value:r[0],type:a.NumberType.Integer}]),new t.TokenNode(p),new t.WhitespaceNode([c]),new t.TokenNode([a.TokenType.Percentage,l.toString()+"%",-1,-1,{value:r[1]}]),new t.TokenNode(p),new t.WhitespaceNode([c]),new t.TokenNode([a.TokenType.Percentage,i.toString()+"%",-1,-1,{value:r[2]}])];if("number"==typeof e.alpha){const o=Math.min(1,Math.max(0,toPrecision(Number.isNaN(e.alpha)?0:e.alpha)));return 1===toPrecision(o,4)?new t.FunctionNode([a.TokenType.Function,"hsl(",-1,-1,{value:"hsl"}],u,N):new t.FunctionNode([a.TokenType.Function,"hsla(",-1,-1,{value:"hsla"}],u,[...N,new t.TokenNode(p),new t.WhitespaceNode([c]),new t.TokenNode([a.TokenType.Number,toPrecision(o,4).toString(),-1,-1,{value:e.alpha,type:a.NumberType.Number}])])}return new t.FunctionNode([a.TokenType.Function,"hsla(",-1,-1,{value:"hsla"}],u,[...N,new t.TokenNode(p),new t.WhitespaceNode([c]),e.alpha])},exports.serializeOKLCH=function serializeOKLCH(e){e.channels=convertPowerlessComponentsToZeroValuesForDisplay(e.channels,e.colorNotation);let o=e.channels.map((e=>Number.isNaN(e)?0:e));e.colorNotation!==exports.ColorNotation.OKLCH&&(o=n.XYZ_D50_to_OKLCH(colorData_to_XYZ_D50(e).channels));const r=toPrecision(o[0],6),s=toPrecision(o[1],6),l=toPrecision(o[2],6),i=[a.TokenType.Function,"oklch(",-1,-1,{value:"oklch"}],u=[a.TokenType.Whitespace," ",-1,-1,void 0];return serializeWithAlpha(e,i,u,[new t.TokenNode([a.TokenType.Number,r.toString(),-1,-1,{value:o[0],type:a.NumberType.Number}]),new t.WhitespaceNode([u]),new t.TokenNode([a.TokenType.Number,s.toString(),-1,-1,{value:o[1],type:a.NumberType.Number}]),new t.WhitespaceNode([u]),new t.TokenNode([a.TokenType.Number,l.toString(),-1,-1,{value:o[2],type:a.NumberType.Number}])])},exports.serializeP3=function serializeP3(e,o=!0){e.channels=convertPowerlessComponentsToZeroValuesForDisplay(e.channels,e.colorNotation);let r=e.channels.map((e=>Number.isNaN(e)?0:e));e.colorNotation!==exports.ColorNotation.Display_P3&&(r=o?XYZ_D50_to_P3_Gamut(colorData_to_XYZ_D50(e).channels):n.XYZ_D50_to_P3(colorData_to_XYZ_D50(e).channels));const s=o?Math.min(1,Math.max(0,toPrecision(r[0],6))):toPrecision(r[0],6),l=o?Math.min(1,Math.max(0,toPrecision(r[1],6))):toPrecision(r[1],6),i=o?Math.min(1,Math.max(0,toPrecision(r[2],6))):toPrecision(r[2],6),u=[a.TokenType.Function,"color(",-1,-1,{value:"color"}],c=[a.TokenType.Whitespace," ",-1,-1,void 0];return serializeWithAlpha(e,u,c,[new t.TokenNode([a.TokenType.Ident,"display-p3",-1,-1,{value:"display-p3"}]),new t.WhitespaceNode([c]),new t.TokenNode([a.TokenType.Number,s.toString(),-1,-1,{value:r[0],type:a.NumberType.Number}]),new t.WhitespaceNode([c]),new t.TokenNode([a.TokenType.Number,l.toString(),-1,-1,{value:r[1],type:a.NumberType.Number}]),new t.WhitespaceNode([c]),new t.TokenNode([a.TokenType.Number,i.toString(),-1,-1,{value:r[2],type:a.NumberType.Number}])])},exports.serializeRGB=function serializeRGB(e,o=!0){e.channels=convertPowerlessComponentsToZeroValuesForDisplay(e.channels,e.colorNotation);let r=e.channels.map((e=>Number.isNaN(e)?0:e));r=o?XYZ_D50_to_sRGB_Gamut(colorData_to_XYZ_D50(e).channels):n.XYZ_D50_to_sRGB(colorData_to_XYZ_D50(e).channels);const s=Math.min(255,Math.max(0,Math.round(255*toPrecision(r[0])))),l=Math.min(255,Math.max(0,Math.round(255*toPrecision(r[1])))),i=Math.min(255,Math.max(0,Math.round(255*toPrecision(r[2])))),u=[a.TokenType.CloseParen,")",-1,-1,void 0],c=[a.TokenType.Whitespace," ",-1,-1,void 0],p=[a.TokenType.Comma,",",-1,-1,void 0],N=[new t.TokenNode([a.TokenType.Number,s.toString(),-1,-1,{value:Math.min(255,255*Math.max(0,r[0])),type:a.NumberType.Integer}]),new t.TokenNode(p),new t.WhitespaceNode([c]),new t.TokenNode([a.TokenType.Number,l.toString(),-1,-1,{value:Math.min(255,255*Math.max(0,r[1])),type:a.NumberType.Integer}]),new t.TokenNode(p),new t.WhitespaceNode([c]),new t.TokenNode([a.TokenType.Number,i.toString(),-1,-1,{value:Math.min(255,255*Math.max(0,r[2])),type:a.NumberType.Integer}])];if("number"==typeof e.alpha){const o=Math.min(1,Math.max(0,toPrecision(Number.isNaN(e.alpha)?0:e.alpha)));return 1===toPrecision(o,4)?new t.FunctionNode([a.TokenType.Function,"rgb(",-1,-1,{value:"rgb"}],u,N):new t.FunctionNode([a.TokenType.Function,"rgba(",-1,-1,{value:"rgba"}],u,[...N,new t.TokenNode(p),new t.WhitespaceNode([c]),new t.TokenNode([a.TokenType.Number,toPrecision(o,4).toString(),-1,-1,{value:e.alpha,type:a.NumberType.Number}])])}return new t.FunctionNode([a.TokenType.Function,"rgba(",-1,-1,{value:"rgba"}],u,[...N,new t.TokenNode(p),new t.WhitespaceNode([c]),e.alpha])};
diff --git a/node_modules/@csstools/css-color-parser/dist/index.d.ts b/node_modules/@csstools/css-color-parser/dist/index.d.ts
index fa641ac5..075ed6a6 100644
--- a/node_modules/@csstools/css-color-parser/dist/index.d.ts
+++ b/node_modules/@csstools/css-color-parser/dist/index.d.ts
@@ -10,12 +10,37 @@ import { FunctionNode } from '@csstools/css-parser-algorithms';
*/
export declare function color(colorNode: ComponentValue): ColorData | false;
-export declare type ColorData = {
+/**
+ * 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<SyntaxFlag>;
-};
+}
/**
* Check if a color data object fits the `display-p3` gamut.
@@ -33,8 +58,6 @@ export declare function colorDataFitsDisplayP3_Gamut(x: ColorData): boolean;
*/
export declare function colorDataFitsRGB_Gamut(x: ColorData): boolean;
-export declare function colorDataTo(colorData: ColorData, toNotation: ColorNotation): ColorData;
-
export declare enum ColorNotation {
/** Adobe 1999, expressed through `color(a98-rgb 0 0 0)` */
A98_RGB = "a98-rgb",
@@ -130,6 +153,8 @@ export declare enum SyntaxFlag {
RelativeColorSyntax = "relative-color-syntax",
/** Is a mixed color, e.g. `color-mix(in oklch, red, blue)` */
ColorMix = "color-mix",
+ /** Is a contrasting color, e.g. `contrast-color()` */
+ ContrastColor = "contrast-color",
/** Is an experimental color syntax */
Experimental = "experimental"
}
diff --git a/node_modules/@csstools/css-color-parser/dist/index.mjs b/node_modules/@csstools/css-color-parser/dist/index.mjs
index b3e7ae9b..7ca9555e 100644
--- a/node_modules/@csstools/css-color-parser/dist/index.mjs
+++ b/node_modules/@csstools/css-color-parser/dist/index.mjs
@@ -1 +1 @@
-import{TokenType as e,NumberType as a}from"@csstools/css-tokenizer";import{XYZ_D50_to_XYZ_D65 as n,XYZ_D50_to_XYZ_D50 as r,XYZ_D50_to_OKLab as o,XYZ_D50_to_OKLCH as t,XYZ_D50_to_LCH as l,XYZ_D50_to_Lab as s,XYZ_D50_to_HWB as u,XYZ_D50_to_HSL as i,XYZ_D50_to_a98_RGB as c,XYZ_D50_to_ProPhoto as m,XYZ_D50_to_rec_2020 as h,XYZ_D50_to_P3 as N,XYZ_D50_to_lin_sRGB as p,XYZ_D50_to_sRGB as b,XYZ_D65_to_XYZ_D50 as g,OKLCH_to_XYZ_D50 as v,LCH_to_XYZ_D50 as d,OKLab_to_XYZ_D50 as f,Lab_to_XYZ_D50 as y,HWB_to_XYZ_D50 as C,HSL_to_XYZ_D50 as w,ProPhoto_RGB_to_XYZ_D50 as _,a98_RGB_to_XYZ_D50 as H,rec_2020_to_XYZ_D50 as x,P3_to_XYZ_D50 as L,lin_sRGB_to_XYZ_D50 as P,sRGB_to_XYZ_D50 as D,namedColors as S,inGamut as k,clip as z,mapGamut as F,OKLCH_to_OKLab as Z,OKLab_to_XYZ as M,XYZ_to_lin_P3 as R,gam_P3 as B,lin_P3 as G,lin_P3_to_XYZ as V,XYZ_to_OKLab as A,OKLab_to_OKLCH as T,XYZ_to_lin_sRGB as I,gam_sRGB as X,lin_sRGB as K,lin_sRGB_to_XYZ as Y}from"@csstools/color-helpers";import{isWhitespaceNode as O,isCommentNode as E,isTokenNode as W,isFunctionNode as U,TokenNode as $,FunctionNode as j,WhitespaceNode as q}from"@csstools/css-parser-algorithms";import{mathFunctionNames as J,calcFromComponentValues as Q}from"@csstools/css-calc";var ee,ae;function colorData_to_XYZ_D50(e){switch(e.colorNotation){case ee.HEX:case ee.RGB:case ee.sRGB:return{...e,colorNotation:ee.XYZ_D50,channels:D(e.channels.map((e=>Number.isNaN(e)?0:e)))};case ee.Linear_sRGB:return{...e,colorNotation:ee.XYZ_D50,channels:P(e.channels.map((e=>Number.isNaN(e)?0:e)))};case ee.Display_P3:return{...e,colorNotation:ee.XYZ_D50,channels:L(e.channels.map((e=>Number.isNaN(e)?0:e)))};case ee.Rec2020:return{...e,colorNotation:ee.XYZ_D50,channels:x(e.channels.map((e=>Number.isNaN(e)?0:e)))};case ee.A98_RGB:return{...e,colorNotation:ee.XYZ_D50,channels:H(e.channels.map((e=>Number.isNaN(e)?0:e)))};case ee.ProPhoto_RGB:return{...e,colorNotation:ee.XYZ_D50,channels:_(e.channels.map((e=>Number.isNaN(e)?0:e)))};case ee.HSL:return{...e,colorNotation:ee.XYZ_D50,channels:w(e.channels.map((e=>Number.isNaN(e)?0:e)))};case ee.HWB:return{...e,colorNotation:ee.XYZ_D50,channels:C(e.channels.map((e=>Number.isNaN(e)?0:e)))};case ee.Lab:return{...e,colorNotation:ee.XYZ_D50,channels:y(e.channels.map((e=>Number.isNaN(e)?0:e)))};case ee.OKLab:return{...e,colorNotation:ee.XYZ_D50,channels:f(e.channels.map((e=>Number.isNaN(e)?0:e)))};case ee.LCH:return{...e,colorNotation:ee.XYZ_D50,channels:d(e.channels.map((e=>Number.isNaN(e)?0:e)))};case ee.OKLCH:return{...e,colorNotation:ee.XYZ_D50,channels:v(e.channels.map((e=>Number.isNaN(e)?0:e)))};case ee.XYZ_D50:return{...e,colorNotation:ee.XYZ_D50,channels:r(e.channels.map((e=>Number.isNaN(e)?0:e)))};case ee.XYZ_D65:return{...e,colorNotation:ee.XYZ_D50,channels:g(e.channels.map((e=>Number.isNaN(e)?0:e)))};default:throw new Error("Unsupported color notation")}}!function(e){e.A98_RGB="a98-rgb",e.Display_P3="display-p3",e.HEX="hex",e.HSL="hsl",e.HWB="hwb",e.LCH="lch",e.Lab="lab",e.Linear_sRGB="srgb-linear",e.OKLCH="oklch",e.OKLab="oklab",e.ProPhoto_RGB="prophoto-rgb",e.RGB="rgb",e.sRGB="srgb",e.Rec2020="rec2020",e.XYZ_D50="xyz-d50",e.XYZ_D65="xyz-d65"}(ee||(ee={})),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.Experimental="experimental"}(ae||(ae={}));const ne=new Set([ee.A98_RGB,ee.Display_P3,ee.HEX,ee.Linear_sRGB,ee.ProPhoto_RGB,ee.RGB,ee.sRGB,ee.Rec2020,ee.XYZ_D50,ee.XYZ_D65]);function colorDataTo(e,a){const g={...e};if(e.colorNotation!==a){const e=colorData_to_XYZ_D50(g);switch(a){case ee.HEX:case ee.RGB:g.colorNotation=ee.RGB,g.channels=b(e.channels);break;case ee.sRGB:g.colorNotation=ee.sRGB,g.channels=b(e.channels);break;case ee.Linear_sRGB:g.colorNotation=ee.Linear_sRGB,g.channels=p(e.channels);break;case ee.Display_P3:g.colorNotation=ee.Display_P3,g.channels=N(e.channels);break;case ee.Rec2020:g.colorNotation=ee.Rec2020,g.channels=h(e.channels);break;case ee.ProPhoto_RGB:g.colorNotation=ee.ProPhoto_RGB,g.channels=m(e.channels);break;case ee.A98_RGB:g.colorNotation=ee.A98_RGB,g.channels=c(e.channels);break;case ee.HSL:g.colorNotation=ee.HSL,g.channels=i(e.channels);break;case ee.HWB:g.colorNotation=ee.HWB,g.channels=u(e.channels);break;case ee.Lab:g.colorNotation=ee.Lab,g.channels=s(e.channels);break;case ee.LCH:g.colorNotation=ee.LCH,g.channels=l(e.channels);break;case ee.OKLCH:g.colorNotation=ee.OKLCH,g.channels=t(e.channels);break;case ee.OKLab:g.colorNotation=ee.OKLab,g.channels=o(e.channels);break;case ee.XYZ_D50:g.colorNotation=ee.XYZ_D50,g.channels=r(e.channels);break;case ee.XYZ_D65:g.colorNotation=ee.XYZ_D65,g.channels=n(e.channels);break;default:throw new Error("Unsupported color notation")}}else g.channels=e.channels.map((e=>Number.isNaN(e)?0:e));if(a===e.colorNotation)g.channels=carryForwardMissingComponents(e.channels,[0,1,2],g.channels,[0,1,2]);else if(ne.has(a)&&ne.has(e.colorNotation))g.channels=carryForwardMissingComponents(e.channels,[0,1,2],g.channels,[0,1,2]);else switch(a){case ee.HSL:switch(e.colorNotation){case ee.HWB:g.channels=carryForwardMissingComponents(e.channels,[0],g.channels,[0]);break;case ee.Lab:case ee.OKLab:g.channels=carryForwardMissingComponents(e.channels,[2],g.channels,[0]);break;case ee.LCH:case ee.OKLCH:g.channels=carryForwardMissingComponents(e.channels,[0,1,2],g.channels,[2,1,0])}break;case ee.HWB:switch(e.colorNotation){case ee.HSL:g.channels=carryForwardMissingComponents(e.channels,[0],g.channels,[0]);break;case ee.LCH:case ee.OKLCH:g.channels=carryForwardMissingComponents(e.channels,[0],g.channels,[2])}break;case ee.Lab:case ee.OKLab:switch(e.colorNotation){case ee.HSL:g.channels=carryForwardMissingComponents(e.channels,[0],g.channels,[2]);break;case ee.Lab:case ee.OKLab:g.channels=carryForwardMissingComponents(e.channels,[0,1,2],g.channels,[0,1,2]);break;case ee.LCH:case ee.OKLCH:g.channels=carryForwardMissingComponents(e.channels,[0],g.channels,[0])}break;case ee.LCH:case ee.OKLCH:switch(e.colorNotation){case ee.HSL:g.channels=carryForwardMissingComponents(e.channels,[0,1,2],g.channels,[2,1,0]);break;case ee.HWB:g.channels=carryForwardMissingComponents(e.channels,[0],g.channels,[2]);break;case ee.Lab:case ee.OKLab:g.channels=carryForwardMissingComponents(e.channels,[0],g.channels,[0]);break;case ee.LCH:case ee.OKLCH:g.channels=carryForwardMissingComponents(e.channels,[0,1,2],g.channels,[0,1,2])}}return g.channels=convertPowerlessComponentsToMissingComponents(g.channels,a),g}function convertPowerlessComponentsToMissingComponents(e,a){const n=[...e];switch(a){case ee.HSL:reducePrecision(n[1],4)<=0&&(n[0]=NaN);break;case ee.HWB:Math.max(0,reducePrecision(n[1],4))+Math.max(0,reducePrecision(n[2],4))>=100&&(n[0]=NaN);break;case ee.LCH:reducePrecision(n[1],4)<=0&&(n[2]=NaN);break;case ee.OKLCH:reducePrecision(n[1],6)<=0&&(n[2]=NaN)}return n}function convertPowerlessComponentsToZeroValuesForDisplay(e,a){const n=[...e];switch(a){case ee.HSL:(reducePrecision(n[2])<=0||reducePrecision(n[2])>=100)&&(n[0]=NaN,n[1]=NaN),reducePrecision(n[1])<=0&&(n[0]=NaN);break;case ee.HWB:Math.max(0,reducePrecision(n[1]))+Math.max(0,reducePrecision(n[2]))>=100&&(n[0]=NaN);break;case ee.Lab:(reducePrecision(n[0])<=0||reducePrecision(n[0])>=100)&&(n[1]=NaN,n[2]=NaN);break;case ee.LCH:reducePrecision(n[1])<=0&&(n[2]=NaN),(reducePrecision(n[0])<=0||reducePrecision(n[0])>=100)&&(n[1]=NaN,n[2]=NaN);break;case ee.OKLab:(reducePrecision(n[0])<=0||reducePrecision(n[0])>=1)&&(n[1]=NaN,n[2]=NaN);break;case ee.OKLCH:reducePrecision(n[1])<=0&&(n[2]=NaN),(reducePrecision(n[0])<=0||reducePrecision(n[0])>=1)&&(n[1]=NaN,n[2]=NaN)}return n}function carryForwardMissingComponents(e,a,n,r){const o=[...n];for(const n of a)Number.isNaN(e[a[n]])&&(o[r[n]]=NaN);return o}function normalizeRelativeColorDataChannels(e){const a=new Map;switch(e.colorNotation){case ee.RGB:case ee.HEX:a.set("r",dummyNumberToken(255*e.channels[0])),a.set("g",dummyNumberToken(255*e.channels[1])),a.set("b",dummyNumberToken(255*e.channels[2])),"number"==typeof e.alpha&&a.set("alpha",dummyNumberToken(e.alpha));break;case ee.HSL:a.set("h",dummyNumberToken(e.channels[0])),a.set("s",dummyNumberToken(e.channels[1])),a.set("l",dummyNumberToken(e.channels[2])),"number"==typeof e.alpha&&a.set("alpha",dummyNumberToken(e.alpha));break;case ee.HWB:a.set("h",dummyNumberToken(e.channels[0])),a.set("w",dummyNumberToken(e.channels[1])),a.set("b",dummyNumberToken(e.channels[2])),"number"==typeof e.alpha&&a.set("alpha",dummyNumberToken(e.alpha));break;case ee.Lab:case ee.OKLab:a.set("l",dummyNumberToken(e.channels[0])),a.set("a",dummyNumberToken(e.channels[1])),a.set("b",dummyNumberToken(e.channels[2])),"number"==typeof e.alpha&&a.set("alpha",dummyNumberToken(e.alpha));break;case ee.LCH:case ee.OKLCH:a.set("l",dummyNumberToken(e.channels[0])),a.set("c",dummyNumberToken(e.channels[1])),a.set("h",dummyNumberToken(e.channels[2])),"number"==typeof e.alpha&&a.set("alpha",dummyNumberToken(e.alpha));break;case ee.sRGB:case ee.A98_RGB:case ee.Display_P3:case ee.Rec2020:case ee.Linear_sRGB:case ee.ProPhoto_RGB:a.set("r",dummyNumberToken(e.channels[0])),a.set("g",dummyNumberToken(e.channels[1])),a.set("b",dummyNumberToken(e.channels[2])),"number"==typeof e.alpha&&a.set("alpha",dummyNumberToken(e.alpha));break;case ee.XYZ_D50:case ee.XYZ_D65:a.set("x",dummyNumberToken(e.channels[0])),a.set("y",dummyNumberToken(e.channels[1])),a.set("z",dummyNumberToken(e.channels[2])),"number"==typeof e.alpha&&a.set("alpha",dummyNumberToken(e.alpha))}return a}function noneToZeroInRelativeColorDataChannels(e){const a=new Map(e);for(const[n,r]of e)Number.isNaN(r[4].value)&&a.set(n,dummyNumberToken(0));return a}function dummyNumberToken(n){return[e.Number,n.toString(),-1,-1,{value:n,type:a.Number}]}function reducePrecision(e,a=7){if(Number.isNaN(e))return 0;const n=Math.pow(10,a);return Math.round(e*n)/n}function colorDataFitsRGB_Gamut(e){const a={...e,channels:[...e.channels]};a.channels=convertPowerlessComponentsToZeroValuesForDisplay(a.channels,a.colorNotation);return!colorDataTo(a,ee.RGB).channels.find((e=>e<-1e-5||e>1.00001))}function colorDataFitsDisplayP3_Gamut(e){const a={...e,channels:[...e.channels]};a.channels=convertPowerlessComponentsToZeroValuesForDisplay(a.channels,a.colorNotation);return!colorDataTo(a,ee.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 re=/[A-Z]/g;function toLowerCaseAZ(e){return e.replace(re,(e=>String.fromCharCode(e.charCodeAt(0)+32)))}function normalize_Color_ChannelValues(n,r,o){if(n[0]===e.Ident&&"none"===toLowerCaseAZ(n[4].value))return o.syntaxFlags.add(ae.HasNoneKeywords),[e.Number,"none",n[2],n[3],{value:NaN,type:a.Number}];if(n[0]===e.Percentage){3!==r&&o.syntaxFlags.add(ae.HasPercentageValues);let t=normalize(n[4].value,100,-1/0,1/0);return 3===r&&(t=normalize(n[4].value,100,0,1)),[e.Number,t.toString(),n[2],n[3],{value:t,type:a.Number}]}if(n[0]===e.Number){3!==r&&o.syntaxFlags.add(ae.HasNumberValues);let t=normalize(n[4].value,1,-1/0,1/0);return 3===r&&(t=normalize(n[4].value,1,0,1)),[e.Number,t.toString(),n[2],n[3],{value:t,type:a.Number}]}return!1}const oe=new Set(["srgb","srgb-linear","display-p3","a98-rgb","prophoto-rgb","rec2020","xyz","xyz-d50","xyz-d65"]);function color$1(a,n){const r=[],o=[],t=[],l=[];let s,u,i=!1,c=!1;const m={colorNotation:ee.sRGB,channels:[0,0,0],alpha:1,syntaxFlags:new Set([])};let h=r;for(let N=0;N<a.value.length;N++){let p=a.value[N];if(O(p)||E(p))for(;O(a.value[N+1])||E(a.value[N+1]);)N++;else if(h===r&&r.length&&(h=o),h===o&&o.length&&(h=t),W(p)&&p.value[0]===e.Delim&&"/"===p.value[4].value){if(h===l)return!1;h=l}else{if(U(p)){if(h===l&&"var"===toLowerCaseAZ(p.getName())){m.syntaxFlags.add(ae.HasVariableAlpha),h.push(p);continue}if(!J.has(toLowerCaseAZ(p.getName())))return!1;const[[a]]=Q([[p]],{toCanonicalUnits:!0,precision:100,globals:u});if(!a||!W(a)||(a.value[0]===e.Percentage||a.value[0]===e.Number||a.value[0]===e.Dimension)&&Number.isNaN(a.value[4].value))return!1;p=a}if(h===r&&0===r.length&&W(p)&&p.value[0]===e.Ident&&oe.has(toLowerCaseAZ(p.value[4].value))){if(i)return!1;i=toLowerCaseAZ(p.value[4].value),m.colorNotation=colorSpaceNameToColorNotation(i),c&&(c.colorNotation!==m.colorNotation&&(c=colorDataTo(c,m.colorNotation)),s=normalizeRelativeColorDataChannels(c),u=noneToZeroInRelativeColorDataChannels(s))}else if(h===r&&0===r.length&&W(p)&&p.value[0]===e.Ident&&"from"===toLowerCaseAZ(p.value[4].value)){if(c)return!1;if(i)return!1;for(;O(a.value[N+1])||E(a.value[N+1]);)N++;if(N++,p=a.value[N],c=n(p),!1===c)return!1;c.syntaxFlags.has(ae.Experimental)&&m.syntaxFlags.add(ae.Experimental),m.syntaxFlags.add(ae.RelativeColorSyntax)}else{if(!W(p))return!1;if(p.value[0]===e.Ident&&s&&s.has(toLowerCaseAZ(p.value[4].value))){h.push(new $(s.get(toLowerCaseAZ(p.value[4].value))));continue}h.push(p)}}}if(!i)return!1;if(1!==h.length)return!1;if(1!==r.length||1!==o.length||1!==t.length)return!1;if(!W(r[0])||!W(o[0])||!W(t[0]))return!1;if(s&&!s.has("alpha"))return!1;const N=normalize_Color_ChannelValues(r[0].value,0,m);if(!N||N[0]!==e.Number)return!1;const p=normalize_Color_ChannelValues(o[0].value,1,m);if(!p||p[0]!==e.Number)return!1;const b=normalize_Color_ChannelValues(t[0].value,2,m);if(!b||b[0]!==e.Number)return!1;const g=[N,p,b];if(1===l.length)if(m.syntaxFlags.add(ae.HasAlpha),W(l[0])){const a=normalize_Color_ChannelValues(l[0].value,3,m);if(!a||a[0]!==e.Number)return!1;g.push(a)}else m.alpha=l[0];else if(s&&s.has("alpha")){const a=normalize_Color_ChannelValues(s.get("alpha"),3,m);if(!a||a[0]!==e.Number)return!1;g.push(a)}return m.channels=[g[0][4].value,g[1][4].value,g[2][4].value],4===g.length&&(m.alpha=g[3][4].value),m}function colorSpaceNameToColorNotation(e){switch(e){case"srgb":return ee.sRGB;case"srgb-linear":return ee.Linear_sRGB;case"display-p3":return ee.Display_P3;case"a98-rgb":return ee.A98_RGB;case"prophoto-rgb":return ee.ProPhoto_RGB;case"rec2020":return ee.Rec2020;case"xyz":case"xyz-d65":return ee.XYZ_D65;case"xyz-d50":return ee.XYZ_D50;default:throw new Error("Unknown color space name: "+e)}}const te=new Set(["srgb","srgb-linear","lab","oklab","xyz","xyz-d50","xyz-d65"]),le=new Set(["hsl","hwb","lch","oklch"]),se=new Set(["shorter","longer","increasing","decreasing"]);function colorMix(a,n){let r=null,o=null,t=null,l=!1;for(let s=0;s<a.value.length;s++){const u=a.value[s];if(!O(u)&&!E(u)){if(W(u)&&u.value[0]===e.Ident){if(!r&&"in"===toLowerCaseAZ(u.value[4].value)){r=u;continue}if(r&&!o){o=toLowerCaseAZ(u.value[4].value);continue}if(r&&o&&!t&&le.has(o)){t=toLowerCaseAZ(u.value[4].value);continue}if(r&&o&&t&&!l&&"hue"===toLowerCaseAZ(u.value[4].value)){l=!0;continue}return!1}return!(!W(u)||u.value[0]!==e.Comma)&&(!!o&&(t||l?!!(o&&t&&l&&le.has(o)&&se.has(t))&&colorMixPolar(o,t,colorMixComponents(a.value.slice(s+1),n)):te.has(o)?colorMixRectangular(o,colorMixComponents(a.value.slice(s+1),n)):!!le.has(o)&&colorMixPolar(o,"shorter",colorMixComponents(a.value.slice(s+1),n))))}}return!1}function colorMixComponents(a,n){const r=[];let o=1,t=!1,l=!1;for(let o=0;o<a.length;o++){let s=a[o];if(!O(s)&&!E(s)){if(!W(s)||s.value[0]!==e.Comma){if(!t){const e=n(s);if(e){t=e;continue}}if(!l){if(U(s)&&J.has(toLowerCaseAZ(s.getName()))&&([[s]]=Q([[s]],{toCanonicalUnits:!0,precision:100}),!s||!W(s)||(s.value[0]===e.Percentage||s.value[0]===e.Number||s.value[0]===e.Dimension)&&Number.isNaN(s.value[4].value)))return!1;if(W(s)&&s.value[0]===e.Percentage&&s.value[4].value>=0){l=s.value[4].value;continue}}return!1}if(!t)return!1;r.push({color:t,percentage:l}),t=!1,l=!1}}if(t&&r.push({color:t,percentage:l}),2!==r.length)return!1;let s=r[0].percentage,u=r[1].percentage;return(!1===s||!(s<0||s>100))&&((!1===u||!(u<0||u>100))&&(!1===s&&!1===u?(s=50,u=50):!1!==s&&!1===u?u=100-s:!1===s&&!1!==u&&(s=100-u),(0!==s||0!==u)&&(!1!==s&&!1!==u&&(s+u>100&&(s=s/(s+u)*100,u=u/(s+u)*100),s+u<100&&(o=(s+u)/100,s=s/(s+u)*100,u=u/(s+u)*100),{a:{color:r[0].color,percentage:s},b:{color:r[1].color,percentage:u},alphaMultiplier:o}))))}function colorMixRectangular(e,a){if(!a)return!1;const n=a.a.color,r=a.b.color,o=a.a.percentage/100;let t=n.channels,l=r.channels,s=ee.RGB,u=n.alpha;if("number"!=typeof u)return!1;let i=r.alpha;if("number"!=typeof i)return!1;switch(u=Number.isNaN(u)?i:u,i=Number.isNaN(i)?u:i,e){case"srgb":s=ee.RGB;break;case"srgb-linear":s=ee.Linear_sRGB;break;case"lab":s=ee.Lab;break;case"oklab":s=ee.OKLab;break;case"xyz-d50":s=ee.XYZ_D50;break;case"xyz":case"xyz-d65":s=ee.XYZ_D65}t=colorDataTo(n,s).channels,l=colorDataTo(r,s).channels,t[0]=fillInMissingComponent(t[0],l[0]),l[0]=fillInMissingComponent(l[0],t[0]),t[1]=fillInMissingComponent(t[1],l[1]),l[1]=fillInMissingComponent(l[1],t[1]),t[2]=fillInMissingComponent(t[2],l[2]),l[2]=fillInMissingComponent(l[2],t[2]),t[0]=premultiply(t[0],u),t[1]=premultiply(t[1],u),t[2]=premultiply(t[2],u),l[0]=premultiply(l[0],i),l[1]=premultiply(l[1],i),l[2]=premultiply(l[2],i);const c=interpolate(u,i,o),m={colorNotation:s,channels:[un_premultiply(interpolate(t[0],l[0],o),c),un_premultiply(interpolate(t[1],l[1],o),c),un_premultiply(interpolate(t[2],l[2],o),c)],alpha:c*a.alphaMultiplier,syntaxFlags:new Set([ae.ColorMix])};return(a.a.color.syntaxFlags.has(ae.Experimental)||a.b.color.syntaxFlags.has(ae.Experimental))&&m.syntaxFlags.add(ae.Experimental),m}function colorMixPolar(e,a,n){if(!n)return!1;const r=n.a.color,o=n.b.color,t=n.a.percentage/100;let l=r.channels,s=o.channels,u=0,i=0,c=0,m=0,h=0,N=0,p=ee.RGB,b=r.alpha;if("number"!=typeof b)return!1;let g=o.alpha;if("number"!=typeof g)return!1;switch(b=Number.isNaN(b)?g:b,g=Number.isNaN(g)?b:g,e){case"hsl":p=ee.HSL;break;case"hwb":p=ee.HWB;break;case"lch":p=ee.LCH;break;case"oklch":p=ee.OKLCH}switch(l=colorDataTo(r,p).channels,s=colorDataTo(o,p).channels,e){case"hsl":case"hwb":u=l[0],i=s[0],c=l[1],m=s[1],h=l[2],N=s[2];break;case"lch":case"oklch":c=l[0],m=s[0],h=l[1],N=s[1],u=l[2],i=s[2]}u=fillInMissingComponent(u,i),Number.isNaN(u)&&(u=0),i=fillInMissingComponent(i,u),Number.isNaN(i)&&(i=0),c=fillInMissingComponent(c,m),m=fillInMissingComponent(m,c),h=fillInMissingComponent(h,N),N=fillInMissingComponent(N,h);const v=i-u;switch(a){case"shorter":v>180?u+=360:v<-180&&(i+=360);break;case"longer":-180<v&&v<180&&(v>0?u+=360:i+=360);break;case"increasing":v<0&&(i+=360);break;case"decreasing":v>0&&(u+=360);break;default:throw new Error("Unknown hue interpolation method")}c=premultiply(c,b),h=premultiply(h,b),m=premultiply(m,g),N=premultiply(N,g);let d=[0,0,0];const f=interpolate(b,g,t);switch(e){case"hsl":case"hwb":d=[interpolate(u,i,t),un_premultiply(interpolate(c,m,t),f),un_premultiply(interpolate(h,N,t),f)];break;case"lch":case"oklch":d=[un_premultiply(interpolate(c,m,t),f),un_premultiply(interpolate(h,N,t),f),interpolate(u,i,t)]}const y={colorNotation:p,channels:d,alpha:f*n.alphaMultiplier,syntaxFlags:new Set([ae.ColorMix])};return(n.a.color.syntaxFlags.has(ae.Experimental)||n.b.color.syntaxFlags.has(ae.Experimental))&&y.syntaxFlags.add(ae.Experimental),y}function fillInMissingComponent(e,a){return Number.isNaN(e)?a:e}function interpolate(e,a,n){return e*n+a*(1-n)}function premultiply(e,a){return Number.isNaN(a)?e:Number.isNaN(e)?NaN:e*a}function un_premultiply(e,a){return 0===a||Number.isNaN(a)?e:Number.isNaN(e)?NaN:e/a}function hex(e){const a=toLowerCaseAZ(e[4].value);if(a.match(/[^a-f0-9]/))return!1;const n={colorNotation:ee.HEX,channels:[0,0,0],alpha:1,syntaxFlags:new Set([ae.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(ae.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(ae.HasAlpha),n}return!1}function normalizeHue(n){if(n[0]===e.Number)return n[4].value=n[4].value%360,n[1]=n[4].value.toString(),n;if(n[0]===e.Dimension){let r=n[4].value;switch(toLowerCaseAZ(n[4].unit)){case"deg":break;case"rad":r=180*n[4].value/Math.PI;break;case"grad":r=.9*n[4].value;break;case"turn":r=360*n[4].value;break;default:return!1}return r%=360,[e.Number,r.toString(),n[2],n[3],{value:r,type:a.Number}]}return!1}function normalize_legacy_HSL_ChannelValues(n,r,o){if(0===r){const a=normalizeHue(n);return!1!==a&&(n[0]===e.Dimension&&o.syntaxFlags.add(ae.HasDimensionValues),a)}if(n[0]===e.Percentage){3===r?o.syntaxFlags.add(ae.HasPercentageAlpha):o.syntaxFlags.add(ae.HasPercentageValues);let t=normalize(n[4].value,1,0,100);return 3===r&&(t=normalize(n[4].value,100,0,1)),[e.Number,t.toString(),n[2],n[3],{value:t,type:a.Number}]}if(n[0]===e.Number){if(3!==r)return!1;let o=normalize(n[4].value,1,0,100);return 3===r&&(o=normalize(n[4].value,1,0,1)),[e.Number,o.toString(),n[2],n[3],{value:o,type:a.Number}]}return!1}function normalize_modern_HSL_ChannelValues(n,r,o){if(n[0]===e.Ident&&"none"===toLowerCaseAZ(n[4].value))return o.syntaxFlags.add(ae.HasNoneKeywords),[e.Number,"none",n[2],n[3],{value:NaN,type:a.Number}];if(0===r){const a=normalizeHue(n);return!1!==a&&(n[0]===e.Dimension&&o.syntaxFlags.add(ae.HasDimensionValues),a)}if(n[0]===e.Percentage){3===r?o.syntaxFlags.add(ae.HasPercentageAlpha):o.syntaxFlags.add(ae.HasPercentageValues);let t=n[4].value;return 3===r&&(t=normalize(n[4].value,100,0,1)),[e.Number,t.toString(),n[2],n[3],{value:t,type:a.Number}]}if(n[0]===e.Number){3!==r&&o.syntaxFlags.add(ae.HasNumberValues);let t=n[4].value;return 3===r&&(t=normalize(n[4].value,1,0,1)),[e.Number,t.toString(),n[2],n[3],{value:t,type:a.Number}]}return!1}function threeChannelLegacySyntax(a,n,r,o){const t=[],l=[],s=[],u=[],i={colorNotation:r,channels:[0,0,0],alpha:1,syntaxFlags:new Set(o)};let c=t;for(let n=0;n<a.value.length;n++){let r=a.value[n];if(!O(r)&&!E(r)){if(W(r)&&r.value[0]===e.Comma){if(c===t){c=l;continue}if(c===l){c=s;continue}if(c===s){c=u;continue}if(c===u)return!1}if(U(r)){if(c===u&&"var"===toLowerCaseAZ(r.getName())){i.syntaxFlags.add(ae.HasVariableAlpha),c.push(r);continue}if(!J.has(toLowerCaseAZ(r.getName())))return!1;const[[a]]=Q([[r]],{toCanonicalUnits:!0,precision:100});if(!a||!W(a)||(a.value[0]===e.Percentage||a.value[0]===e.Number||a.value[0]===e.Dimension)&&Number.isNaN(a.value[4].value))return!1;r=a}if(!W(r))return!1;c.push(r)}}if(1!==c.length)return!1;if(1!==t.length||1!==l.length||1!==s.length)return!1;if(!W(t[0])||!W(l[0])||!W(s[0]))return!1;const m=n(t[0].value,0,i);if(!m||m[0]!==e.Number)return!1;const h=n(l[0].value,1,i);if(!h||h[0]!==e.Number)return!1;const N=n(s[0].value,2,i);if(!N||N[0]!==e.Number)return!1;const p=[m,h,N];if(1===u.length)if(i.syntaxFlags.add(ae.HasAlpha),W(u[0])){const a=n(u[0].value,3,i);if(!a||a[0]!==e.Number)return!1;p.push(a)}else i.alpha=u[0];return i.channels=[p[0][4].value,p[1][4].value,p[2][4].value],4===p.length&&(i.alpha=p[3][4].value),i}function threeChannelSpaceSeparated(a,n,r,o,t){const l=toLowerCaseAZ(a.getName()),s=[],u=[],i=[],c=[];let m,h,N=!1;const p={colorNotation:r,channels:[0,0,0],alpha:1,syntaxFlags:new Set(o)};let b=s;for(let n=0;n<a.value.length;n++){let o=a.value[n];if(O(o)||E(o))for(;O(a.value[n+1])||E(a.value[n+1]);)n++;else if(b===s&&s.length&&(b=u),b===u&&u.length&&(b=i),W(o)&&o.value[0]===e.Delim&&"/"===o.value[4].value){if(b===c)return!1;b=c}else{if(U(o)){if(b===c&&"var"===toLowerCaseAZ(o.getName())){p.syntaxFlags.add(ae.HasVariableAlpha),b.push(o);continue}if(!J.has(toLowerCaseAZ(o.getName())))return!1;const[[a]]=Q([[o]],{toCanonicalUnits:!0,precision:100,globals:h});if(!a||!W(a)||(a.value[0]===e.Percentage||a.value[0]===e.Number||a.value[0]===e.Dimension)&&Number.isNaN(a.value[4].value))return!1;o=a}if(b===s&&0===s.length&&W(o)&&o.value[0]===e.Ident&&"from"===toLowerCaseAZ(o.value[4].value)&&"hsla"!==l&&"rgba"!==l){if(N)return!1;for(;O(a.value[n+1])||E(a.value[n+1]);)n++;if(n++,o=a.value[n],N=t(o),!1===N)return!1;N.syntaxFlags.has(ae.Experimental)&&p.syntaxFlags.add(ae.Experimental),p.syntaxFlags.add(ae.RelativeColorSyntax),N.colorNotation!==r&&(N=colorDataTo(N,r)),m=normalizeRelativeColorDataChannels(N),h=noneToZeroInRelativeColorDataChannels(m)}else{if(!W(o))return!1;if(o.value[0]===e.Ident&&m&&m.has(toLowerCaseAZ(o.value[4].value))){b.push(new $(m.get(toLowerCaseAZ(o.value[4].value))));continue}b.push(o)}}}if(1!==b.length)return!1;if(1!==s.length||1!==u.length||1!==i.length)return!1;if(!W(s[0])||!W(u[0])||!W(i[0]))return!1;if(m&&!m.has("alpha"))return!1;const g=n(s[0].value,0,p);if(!g||g[0]!==e.Number)return!1;const v=n(u[0].value,1,p);if(!v||v[0]!==e.Number)return!1;const d=n(i[0].value,2,p);if(!d||d[0]!==e.Number)return!1;const f=[g,v,d];if(1===c.length)if(p.syntaxFlags.add(ae.HasAlpha),W(c[0])){const a=n(c[0].value,3,p);if(!a||a[0]!==e.Number)return!1;f.push(a)}else p.alpha=c[0];else if(m&&m.has("alpha")){const a=n(m.get("alpha"),3,p);if(!a||a[0]!==e.Number)return!1;f.push(a)}return p.channels=[f[0][4].value,f[1][4].value,f[2][4].value],4===f.length&&(p.alpha=f[3][4].value),p}function hsl(a,n){if(a.value.some((a=>W(a)&&a.value[0]===e.Comma))){const e=hslCommaSeparated(a);if(!1!==e)return e}{const e=hslSpaceSeparated(a,n);if(!1!==e)return e}return!1}function hslCommaSeparated(e){return threeChannelLegacySyntax(e,normalize_legacy_HSL_ChannelValues,ee.HSL,[ae.LegacyHSL])}function hslSpaceSeparated(e,a){return threeChannelSpaceSeparated(e,normalize_modern_HSL_ChannelValues,ee.HSL,[],a)}function normalize_HWB_ChannelValues(n,r,o){if(n[0]===e.Ident&&"none"===toLowerCaseAZ(n[4].value))return o.syntaxFlags.add(ae.HasNoneKeywords),[e.Number,"none",n[2],n[3],{value:NaN,type:a.Number}];if(0===r){const a=normalizeHue(n);return!1!==a&&(n[0]===e.Dimension&&o.syntaxFlags.add(ae.HasDimensionValues),a)}if(n[0]===e.Percentage){3===r?o.syntaxFlags.add(ae.HasPercentageAlpha):o.syntaxFlags.add(ae.HasPercentageValues);let t=n[4].value;return 3===r&&(t=normalize(n[4].value,100,0,1)),[e.Number,t.toString(),n[2],n[3],{value:t,type:a.Number}]}if(n[0]===e.Number){3!==r&&o.syntaxFlags.add(ae.HasNumberValues);let t=n[4].value;return 3===r&&(t=normalize(n[4].value,1,0,1)),[e.Number,t.toString(),n[2],n[3],{value:t,type:a.Number}]}return!1}function normalize_Lab_ChannelValues(n,r,o){if(n[0]===e.Ident&&"none"===toLowerCaseAZ(n[4].value))return o.syntaxFlags.add(ae.HasNoneKeywords),[e.Number,"none",n[2],n[3],{value:NaN,type:a.Number}];if(n[0]===e.Percentage){3!==r&&o.syntaxFlags.add(ae.HasPercentageValues);let t=normalize(n[4].value,1,0,100);return 1===r||2===r?t=normalize(n[4].value,.8,-1/0,1/0):3===r&&(t=normalize(n[4].value,100,0,1)),[e.Number,t.toString(),n[2],n[3],{value:t,type:a.Number}]}if(n[0]===e.Number){3!==r&&o.syntaxFlags.add(ae.HasNumberValues);let t=normalize(n[4].value,1,0,100);return 1===r||2===r?t=normalize(n[4].value,1,-1/0,1/0):3===r&&(t=normalize(n[4].value,1,0,1)),[e.Number,t.toString(),n[2],n[3],{value:t,type:a.Number}]}return!1}function lab(e,a){return threeChannelSpaceSeparated(e,normalize_Lab_ChannelValues,ee.Lab,[],a)}function normalize_LCH_ChannelValues(n,r,o){if(n[0]===e.Ident&&"none"===toLowerCaseAZ(n[4].value))return o.syntaxFlags.add(ae.HasNoneKeywords),[e.Number,"none",n[2],n[3],{value:NaN,type:a.Number}];if(2===r){const a=normalizeHue(n);return!1!==a&&(n[0]===e.Dimension&&o.syntaxFlags.add(ae.HasDimensionValues),a)}if(n[0]===e.Percentage){3!==r&&o.syntaxFlags.add(ae.HasPercentageValues);let t=normalize(n[4].value,1,0,100);return 1===r?t=normalize(n[4].value,100/150,0,1/0):3===r&&(t=normalize(n[4].value,100,0,1)),[e.Number,t.toString(),n[2],n[3],{value:t,type:a.Number}]}if(n[0]===e.Number){3!==r&&o.syntaxFlags.add(ae.HasNumberValues);let t=normalize(n[4].value,1,0,100);return 1===r?t=normalize(n[4].value,1,0,1/0):3===r&&(t=normalize(n[4].value,1,0,1)),[e.Number,t.toString(),n[2],n[3],{value:t,type:a.Number}]}return!1}function lch(e,a){return threeChannelSpaceSeparated(e,normalize_LCH_ChannelValues,ee.LCH,[],a)}const ue=new Map;for(const[e,a]of Object.entries(S))ue.set(e,a);function namedColor(e){const a=ue.get(toLowerCaseAZ(e));return!!a&&{colorNotation:ee.RGB,channels:[a[0]/255,a[1]/255,a[2]/255],alpha:1,syntaxFlags:new Set([ae.ColorKeyword,ae.NamedColor])}}function normalize_OKLab_ChannelValues(n,r,o){if(n[0]===e.Ident&&"none"===toLowerCaseAZ(n[4].value))return o.syntaxFlags.add(ae.HasNoneKeywords),[e.Number,"none",n[2],n[3],{value:NaN,type:a.Number}];if(n[0]===e.Percentage){3!==r&&o.syntaxFlags.add(ae.HasPercentageValues);let t=normalize(n[4].value,100,0,1);return 1===r||2===r?t=normalize(n[4].value,250,-1/0,1/0):3===r&&(t=normalize(n[4].value,100,0,1)),[e.Number,t.toString(),n[2],n[3],{value:t,type:a.Number}]}if(n[0]===e.Number){3!==r&&o.syntaxFlags.add(ae.HasNumberValues);let t=normalize(n[4].value,1,0,1);return 1===r||2===r?t=normalize(n[4].value,1,-1/0,1/0):3===r&&(t=normalize(n[4].value,1,0,1)),[e.Number,t.toString(),n[2],n[3],{value:t,type:a.Number}]}return!1}function oklab(e,a){return threeChannelSpaceSeparated(e,normalize_OKLab_ChannelValues,ee.OKLab,[],a)}function normalize_OKLCH_ChannelValues(n,r,o){if(n[0]===e.Ident&&"none"===toLowerCaseAZ(n[4].value))return o.syntaxFlags.add(ae.HasNoneKeywords),[e.Number,"none",n[2],n[3],{value:NaN,type:a.Number}];if(2===r){const a=normalizeHue(n);return!1!==a&&(n[0]===e.Dimension&&o.syntaxFlags.add(ae.HasDimensionValues),a)}if(n[0]===e.Percentage){3!==r&&o.syntaxFlags.add(ae.HasPercentageValues);let t=normalize(n[4].value,100,0,1);return 1===r?t=normalize(n[4].value,250,0,1/0):3===r&&(t=normalize(n[4].value,100,0,1)),[e.Number,t.toString(),n[2],n[3],{value:t,type:a.Number}]}if(n[0]===e.Number){3!==r&&o.syntaxFlags.add(ae.HasNumberValues);let t=normalize(n[4].value,1,0,1);return 1===r?t=normalize(n[4].value,1,0,1/0):3===r&&(t=normalize(n[4].value,1,0,1)),[e.Number,t.toString(),n[2],n[3],{value:t,type:a.Number}]}return!1}function oklch(e,a){return threeChannelSpaceSeparated(e,normalize_OKLCH_ChannelValues,ee.OKLCH,[],a)}function normalize_legacy_sRGB_ChannelValues(n,r,o){if(n[0]===e.Percentage){3===r?o.syntaxFlags.add(ae.HasPercentageAlpha):o.syntaxFlags.add(ae.HasPercentageValues);const t=normalize(n[4].value,100,0,1);return[e.Number,t.toString(),n[2],n[3],{value:t,type:a.Number}]}if(n[0]===e.Number){3!==r&&o.syntaxFlags.add(ae.HasNumberValues);let t=normalize(n[4].value,255,0,1);return 3===r&&(t=normalize(n[4].value,1,0,1)),[e.Number,t.toString(),n[2],n[3],{value:t,type:a.Number}]}return!1}function normalize_modern_sRGB_ChannelValues(n,r,o){if(n[0]===e.Ident&&"none"===toLowerCaseAZ(n[4].value))return o.syntaxFlags.add(ae.HasNoneKeywords),[e.Number,"none",n[2],n[3],{value:NaN,type:a.Number}];if(n[0]===e.Percentage){3!==r&&o.syntaxFlags.add(ae.HasPercentageValues);let t=normalize(n[4].value,100,-1/0,1/0);return 3===r&&(t=normalize(n[4].value,100,0,1)),[e.Number,t.toString(),n[2],n[3],{value:t,type:a.Number}]}if(n[0]===e.Number){3!==r&&o.syntaxFlags.add(ae.HasNumberValues);let t=normalize(n[4].value,255,-1/0,1/0);return 3===r&&(t=normalize(n[4].value,1,0,1)),[e.Number,t.toString(),n[2],n[3],{value:t,type:a.Number}]}return!1}function rgb(a,n){if(a.value.some((a=>W(a)&&a.value[0]===e.Comma))){const e=rgbCommaSeparated(a);if(!1!==e)return(!e.syntaxFlags.has(ae.HasNumberValues)||!e.syntaxFlags.has(ae.HasPercentageValues))&&e}else{const e=rgbSpaceSeparated(a,n);if(!1!==e)return e}return!1}function rgbCommaSeparated(e){return threeChannelLegacySyntax(e,normalize_legacy_sRGB_ChannelValues,ee.RGB,[ae.LegacyRGB])}function rgbSpaceSeparated(e,a){return threeChannelSpaceSeparated(e,normalize_modern_sRGB_ChannelValues,ee.RGB,[],a)}function toPrecision(e,a=7){e=+e,a=+a;const n=(Math.floor(e)+"").length;if(a>n)return+e.toFixed(a-n);{const r=10**(n-a);return Math.round(e/r)*r}}function XYZ_D50_to_P3_Gamut(e){const a=N(e);if(k(a))return z(a);let n=e.slice();return n=t(n),n[0]<1e-6&&(n=[0,0,0]),n[0]>.999999&&(n=[1,0,0]),F(n,(e=>(e=Z(e),e=M(e),e=R(e),B(e))),(e=>(e=G(e),e=V(e),e=A(e),T(e))))}function serializeWithAlpha(n,r,o,t){const l=[e.CloseParen,")",-1,-1,void 0];if("number"==typeof n.alpha){const s=Math.min(1,Math.max(0,toPrecision(Number.isNaN(n.alpha)?0:n.alpha)));return 1===toPrecision(s,4)?new j(r,l,t):new j(r,l,[...t,new q([o]),new $([e.Delim,"/",-1,-1,{value:"/"}]),new q([o]),new $([e.Number,toPrecision(s,4).toString(),-1,-1,{value:n.alpha,type:a.Integer}])])}return new j(r,l,[...t,new q([o]),new $([e.Delim,"/",-1,-1,{value:"/"}]),new q([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));n.colorNotation!==ee.Display_P3&&(o=r?XYZ_D50_to_P3_Gamut(colorData_to_XYZ_D50(n).channels):N(colorData_to_XYZ_D50(n).channels));const t=toPrecision(o[0],6),l=toPrecision(o[1],6),s=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 $([e.Ident,"display-p3",-1,-1,{value:"display-p3"}]),new q([i]),new $([e.Number,t.toString(),-1,-1,{value:o[0],type:a.Number}]),new q([i]),new $([e.Number,l.toString(),-1,-1,{value:o[1],type:a.Number}]),new q([i]),new $([e.Number,s.toString(),-1,-1,{value:o[2],type:a.Number}])])}function XYZ_D50_to_sRGB_Gamut(e){const a=b(e);if(k(a))return z(a);let n=e.slice();return n=t(n),n[0]<1e-6&&(n=[0,0,0]),n[0]>.999999&&(n=[1,0,0]),F(n,(e=>(e=Z(e),e=M(e),e=I(e),X(e))),(e=>(e=K(e),e=Y(e),e=A(e),T(e))))}function serializeRGB(n,r=!0){n.channels=convertPowerlessComponentsToZeroValuesForDisplay(n.channels,n.colorNotation);let o=n.channels.map((e=>Number.isNaN(e)?0:e));o=r?XYZ_D50_to_sRGB_Gamut(colorData_to_XYZ_D50(n).channels):b(colorData_to_XYZ_D50(n).channels);const t=Math.min(255,Math.max(0,Math.round(255*toPrecision(o[0])))),l=Math.min(255,Math.max(0,Math.round(255*toPrecision(o[1])))),s=Math.min(255,Math.max(0,Math.round(255*toPrecision(o[2])))),u=[e.CloseParen,")",-1,-1,void 0],i=[e.Whitespace," ",-1,-1,void 0],c=[e.Comma,",",-1,-1,void 0],m=[new $([e.Number,t.toString(),-1,-1,{value:o[0],type:a.Integer}]),new $(c),new q([i]),new $([e.Number,l.toString(),-1,-1,{value:o[1],type:a.Integer}]),new $(c),new q([i]),new $([e.Number,s.toString(),-1,-1,{value: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 j([e.Function,"rgb(",-1,-1,{value:"rgb"}],u,m):new j([e.Function,"rgba(",-1,-1,{value:"rgba"}],u,[...m,new $(c),new q([i]),new $([e.Number,toPrecision(r,4).toString(),-1,-1,{value:n.alpha,type:a.Number}])])}return new j([e.Function,"rgba(",-1,-1,{value:"rgba"}],u,[...m,new $(c),new q([i]),n.alpha])}function serializeHSL(n,r=!0){n.channels=convertPowerlessComponentsToZeroValuesForDisplay(n.channels,n.colorNotation);let o=n.channels.map((e=>Number.isNaN(e)?0:e));o=i(r?D(XYZ_D50_to_sRGB_Gamut(colorData_to_XYZ_D50(n).channels)):colorData_to_XYZ_D50(n).channels),o=o.map((e=>Number.isNaN(e)?0:e));const t=Math.min(360,Math.max(0,Math.round(toPrecision(o[0])))),l=Math.min(100,Math.max(0,Math.round(toPrecision(o[1])))),s=Math.min(100,Math.max(0,Math.round(toPrecision(o[2])))),u=[e.CloseParen,")",-1,-1,void 0],c=[e.Whitespace," ",-1,-1,void 0],m=[e.Comma,",",-1,-1,void 0],h=[new $([e.Number,t.toString(),-1,-1,{value:o[0],type:a.Integer}]),new $(m),new q([c]),new $([e.Percentage,l.toString()+"%",-1,-1,{value:o[1]}]),new $(m),new q([c]),new $([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 j([e.Function,"hsl(",-1,-1,{value:"hsl"}],u,h):new j([e.Function,"hsla(",-1,-1,{value:"hsla"}],u,[...h,new $(m),new q([c]),new $([e.Number,toPrecision(r,4).toString(),-1,-1,{value:n.alpha,type:a.Number}])])}return new j([e.Function,"hsla(",-1,-1,{value:"hsla"}],u,[...h,new $(m),new q([c]),n.alpha])}function serializeOKLCH(n){n.channels=convertPowerlessComponentsToZeroValuesForDisplay(n.channels,n.colorNotation);let r=n.channels.map((e=>Number.isNaN(e)?0:e));n.colorNotation!==ee.OKLCH&&(r=t(colorData_to_XYZ_D50(n).channels));const o=toPrecision(r[0],6),l=toPrecision(r[1],6),s=toPrecision(r[2],6),u=[e.Function,"oklch(",-1,-1,{value:"oklch"}],i=[e.Whitespace," ",-1,-1,void 0];return serializeWithAlpha(n,u,i,[new $([e.Number,o.toString(),-1,-1,{value:r[0],type:a.Number}]),new q([i]),new $([e.Number,l.toString(),-1,-1,{value:r[1],type:a.Number}]),new q([i]),new $([e.Number,s.toString(),-1,-1,{value:r[2],type:a.Number}])])}function color(a){if(U(a)){switch(toLowerCaseAZ(a.getName())){case"rgb":case"rgba":return rgb(a,color);case"hsl":case"hsla":return hsl(a,color);case"hwb":return n=color,threeChannelSpaceSeparated(a,normalize_HWB_ChannelValues,ee.HWB,[],n);case"lab":return lab(a,color);case"lch":return lch(a,color);case"oklab":return oklab(a,color);case"oklch":return oklch(a,color);case"color":return color$1(a,color);case"color-mix":return colorMix(a,color)}}var n;if(W(a)){if(a.value[0]===e.Hash)return hex(a.value);if(a.value[0]===e.Ident){const e=namedColor(a.value[4].value);return!1!==e?e:"transparent"===toLowerCaseAZ(a.value[4].value)&&{colorNotation:ee.RGB,channels:[0,0,0],alpha:0,syntaxFlags:new Set([ae.ColorKeyword])}}}return!1}export{ee as ColorNotation,ae as SyntaxFlag,color,colorDataFitsDisplayP3_Gamut,colorDataFitsRGB_Gamut,colorDataTo,serializeHSL,serializeOKLCH,serializeP3,serializeRGB};
+import{TokenType as e,NumberType as a,isTokenIdent as n,isTokenPercentage as r,isTokenNumber as o,isTokenDelim as t,isTokenNumeric as l,isTokenComma as s,isTokenDimension as u,isTokenHash as c}from"@csstools/css-tokenizer";import{XYZ_D65_to_XYZ_D50 as i,XYZ_D50_to_XYZ_D50 as h,OKLCH_to_XYZ_D50 as m,LCH_to_XYZ_D50 as p,OKLab_to_XYZ_D50 as N,Lab_to_XYZ_D50 as b,HWB_to_XYZ_D50 as v,HSL_to_XYZ_D50 as g,ProPhoto_RGB_to_XYZ_D50 as f,a98_RGB_to_XYZ_D50 as d,rec_2020_to_XYZ_D50 as y,P3_to_XYZ_D50 as _,lin_sRGB_to_XYZ_D50 as C,sRGB_to_XYZ_D50 as w,XYZ_D50_to_XYZ_D65 as x,XYZ_D50_to_OKLab as H,XYZ_D50_to_OKLCH as L,XYZ_D50_to_LCH as k,XYZ_D50_to_Lab as S,XYZ_D50_to_HWB as P,XYZ_D50_to_HSL as z,XYZ_D50_to_a98_RGB as D,XYZ_D50_to_ProPhoto as F,XYZ_D50_to_rec_2020 as Z,XYZ_D50_to_P3 as M,XYZ_D50_to_lin_sRGB as R,XYZ_D50_to_sRGB as B,namedColors as G,inGamut as T,clip as V,gam_sRGB as A,mapGamutRayTrace as X,OKLCH_to_OKLab as Y,OKLab_to_XYZ as K,XYZ_to_lin_sRGB as I,lin_sRGB_to_XYZ as O,XYZ_to_OKLab as E,OKLab_to_OKLCH as W,contrast_ratio_wcag_2_1 as U,gam_P3 as $,XYZ_to_lin_P3 as j,lin_P3_to_XYZ as q}from"@csstools/color-helpers";import{isWhitespaceNode as J,isCommentNode as Q,isTokenNode as ee,isFunctionNode as ae,TokenNode as ne,FunctionNode as re,WhitespaceNode as oe}from"@csstools/css-parser-algorithms";import{mathFunctionNames as te,calcFromComponentValues as le}from"@csstools/css-calc";var se,ue;function convertNaNToZero(e){return[Number.isNaN(e[0])?0:e[0],Number.isNaN(e[1])?0:e[1],Number.isNaN(e[2])?0:e[2]]}function colorData_to_XYZ_D50(e){switch(e.colorNotation){case se.HEX:case se.RGB:case se.sRGB:return{...e,colorNotation:se.XYZ_D50,channels:w(convertNaNToZero(e.channels))};case se.Linear_sRGB:return{...e,colorNotation:se.XYZ_D50,channels:C(convertNaNToZero(e.channels))};case se.Display_P3:return{...e,colorNotation:se.XYZ_D50,channels:_(convertNaNToZero(e.channels))};case se.Rec2020:return{...e,colorNotation:se.XYZ_D50,channels:y(convertNaNToZero(e.channels))};case se.A98_RGB:return{...e,colorNotation:se.XYZ_D50,channels:d(convertNaNToZero(e.channels))};case se.ProPhoto_RGB:return{...e,colorNotation:se.XYZ_D50,channels:f(convertNaNToZero(e.channels))};case se.HSL:return{...e,colorNotation:se.XYZ_D50,channels:g(convertNaNToZero(e.channels))};case se.HWB:return{...e,colorNotation:se.XYZ_D50,channels:v(convertNaNToZero(e.channels))};case se.Lab:return{...e,colorNotation:se.XYZ_D50,channels:b(convertNaNToZero(e.channels))};case se.OKLab:return{...e,colorNotation:se.XYZ_D50,channels:N(convertNaNToZero(e.channels))};case se.LCH:return{...e,colorNotation:se.XYZ_D50,channels:p(convertNaNToZero(e.channels))};case se.OKLCH:return{...e,colorNotation:se.XYZ_D50,channels:m(convertNaNToZero(e.channels))};case se.XYZ_D50:return{...e,colorNotation:se.XYZ_D50,channels:h(convertNaNToZero(e.channels))};case se.XYZ_D65:return{...e,colorNotation:se.XYZ_D50,channels:i(convertNaNToZero(e.channels))};default:throw new Error("Unsupported color notation")}}!function(e){e.A98_RGB="a98-rgb",e.Display_P3="display-p3",e.HEX="hex",e.HSL="hsl",e.HWB="hwb",e.LCH="lch",e.Lab="lab",e.Linear_sRGB="srgb-linear",e.OKLCH="oklch",e.OKLab="oklab",e.ProPhoto_RGB="prophoto-rgb",e.RGB="rgb",e.sRGB="srgb",e.Rec2020="rec2020",e.XYZ_D50="xyz-d50",e.XYZ_D65="xyz-d65"}(se||(se={})),function(e){e.ColorKeyword="color-keyword",e.HasAlpha="has-alpha",e.HasDimensionValues="has-dimension-values",e.HasNoneKeywords="has-none-keywords",e.HasNumberValues="has-number-values",e.HasPercentageAlpha="has-percentage-alpha",e.HasPercentageValues="has-percentage-values",e.HasVariableAlpha="has-variable-alpha",e.Hex="hex",e.LegacyHSL="legacy-hsl",e.LegacyRGB="legacy-rgb",e.NamedColor="named-color",e.RelativeColorSyntax="relative-color-syntax",e.ColorMix="color-mix",e.ContrastColor="contrast-color",e.Experimental="experimental"}(ue||(ue={}));const ce=new Set([se.A98_RGB,se.Display_P3,se.HEX,se.Linear_sRGB,se.ProPhoto_RGB,se.RGB,se.sRGB,se.Rec2020,se.XYZ_D50,se.XYZ_D65]);function colorDataTo(e,a){const n={...e};if(e.colorNotation!==a){const e=colorData_to_XYZ_D50(n);switch(a){case se.HEX:case se.RGB:n.colorNotation=se.RGB,n.channels=B(e.channels);break;case se.sRGB:n.colorNotation=se.sRGB,n.channels=B(e.channels);break;case se.Linear_sRGB:n.colorNotation=se.Linear_sRGB,n.channels=R(e.channels);break;case se.Display_P3:n.colorNotation=se.Display_P3,n.channels=M(e.channels);break;case se.Rec2020:n.colorNotation=se.Rec2020,n.channels=Z(e.channels);break;case se.ProPhoto_RGB:n.colorNotation=se.ProPhoto_RGB,n.channels=F(e.channels);break;case se.A98_RGB:n.colorNotation=se.A98_RGB,n.channels=D(e.channels);break;case se.HSL:n.colorNotation=se.HSL,n.channels=z(e.channels);break;case se.HWB:n.colorNotation=se.HWB,n.channels=P(e.channels);break;case se.Lab:n.colorNotation=se.Lab,n.channels=S(e.channels);break;case se.LCH:n.colorNotation=se.LCH,n.channels=k(e.channels);break;case se.OKLCH:n.colorNotation=se.OKLCH,n.channels=L(e.channels);break;case se.OKLab:n.colorNotation=se.OKLab,n.channels=H(e.channels);break;case se.XYZ_D50:n.colorNotation=se.XYZ_D50,n.channels=h(e.channels);break;case se.XYZ_D65:n.colorNotation=se.XYZ_D65,n.channels=x(e.channels);break;default:throw new Error("Unsupported color notation")}}else n.channels=convertNaNToZero(e.channels);if(a===e.colorNotation)n.channels=carryForwardMissingComponents(e.channels,[0,1,2],n.channels,[0,1,2]);else if(ce.has(a)&&ce.has(e.colorNotation))n.channels=carryForwardMissingComponents(e.channels,[0,1,2],n.channels,[0,1,2]);else switch(a){case se.HSL:switch(e.colorNotation){case se.HWB:n.channels=carryForwardMissingComponents(e.channels,[0],n.channels,[0]);break;case se.Lab:case se.OKLab:n.channels=carryForwardMissingComponents(e.channels,[2],n.channels,[0]);break;case se.LCH:case se.OKLCH:n.channels=carryForwardMissingComponents(e.channels,[0,1,2],n.channels,[2,1,0])}break;case se.HWB:switch(e.colorNotation){case se.HSL:n.channels=carryForwardMissingComponents(e.channels,[0],n.channels,[0]);break;case se.LCH:case se.OKLCH:n.channels=carryForwardMissingComponents(e.channels,[0],n.channels,[2])}break;case se.Lab:case se.OKLab:switch(e.colorNotation){case se.HSL:n.channels=carryForwardMissingComponents(e.channels,[0],n.channels,[2]);break;case se.Lab:case se.OKLab:n.channels=carryForwardMissingComponents(e.channels,[0,1,2],n.channels,[0,1,2]);break;case se.LCH:case se.OKLCH:n.channels=carryForwardMissingComponents(e.channels,[0],n.channels,[0])}break;case se.LCH:case se.OKLCH:switch(e.colorNotation){case se.HSL:n.channels=carryForwardMissingComponents(e.channels,[0,1,2],n.channels,[2,1,0]);break;case se.HWB:n.channels=carryForwardMissingComponents(e.channels,[0],n.channels,[2]);break;case se.Lab:case se.OKLab:n.channels=carryForwardMissingComponents(e.channels,[0],n.channels,[0]);break;case se.LCH:case se.OKLCH:n.channels=carryForwardMissingComponents(e.channels,[0,1,2],n.channels,[0,1,2])}}return n.channels=convertPowerlessComponentsToMissingComponents(n.channels,a),n}function convertPowerlessComponentsToMissingComponents(e,a){const n=[...e];switch(a){case se.HSL:!Number.isNaN(n[1])&&reducePrecision(n[1],4)<=0&&(n[0]=NaN);break;case se.HWB:Math.max(0,reducePrecision(n[1],4))+Math.max(0,reducePrecision(n[2],4))>=100&&(n[0]=NaN);break;case se.LCH:!Number.isNaN(n[1])&&reducePrecision(n[1],4)<=0&&(n[2]=NaN);break;case se.OKLCH:!Number.isNaN(n[1])&&reducePrecision(n[1],6)<=0&&(n[2]=NaN)}return n}function convertPowerlessComponentsToZeroValuesForDisplay(e,a){const n=[...e];switch(a){case se.HSL:(reducePrecision(n[2])<=0||reducePrecision(n[2])>=100)&&(n[0]=NaN,n[1]=NaN),reducePrecision(n[1])<=0&&(n[0]=NaN);break;case se.HWB:Math.max(0,reducePrecision(n[1]))+Math.max(0,reducePrecision(n[2]))>=100&&(n[0]=NaN);break;case se.Lab:(reducePrecision(n[0])<=0||reducePrecision(n[0])>=100)&&(n[1]=NaN,n[2]=NaN);break;case se.LCH:reducePrecision(n[1])<=0&&(n[2]=NaN),(reducePrecision(n[0])<=0||reducePrecision(n[0])>=100)&&(n[1]=NaN,n[2]=NaN);break;case se.OKLab:(reducePrecision(n[0])<=0||reducePrecision(n[0])>=1)&&(n[1]=NaN,n[2]=NaN);break;case se.OKLCH:reducePrecision(n[1])<=0&&(n[2]=NaN),(reducePrecision(n[0])<=0||reducePrecision(n[0])>=1)&&(n[1]=NaN,n[2]=NaN)}return n}function carryForwardMissingComponents(e,a,n,r){const o=[...n];for(const n of a)Number.isNaN(e[a[n]])&&(o[r[n]]=NaN);return o}function normalizeRelativeColorDataChannels(e){const a=new Map;switch(e.colorNotation){case se.RGB:case se.HEX:a.set("r",dummyNumberToken(255*e.channels[0])),a.set("g",dummyNumberToken(255*e.channels[1])),a.set("b",dummyNumberToken(255*e.channels[2])),"number"==typeof e.alpha&&a.set("alpha",dummyNumberToken(e.alpha));break;case se.HSL:a.set("h",dummyNumberToken(e.channels[0])),a.set("s",dummyNumberToken(e.channels[1])),a.set("l",dummyNumberToken(e.channels[2])),"number"==typeof e.alpha&&a.set("alpha",dummyNumberToken(e.alpha));break;case se.HWB:a.set("h",dummyNumberToken(e.channels[0])),a.set("w",dummyNumberToken(e.channels[1])),a.set("b",dummyNumberToken(e.channels[2])),"number"==typeof e.alpha&&a.set("alpha",dummyNumberToken(e.alpha));break;case se.Lab:case se.OKLab:a.set("l",dummyNumberToken(e.channels[0])),a.set("a",dummyNumberToken(e.channels[1])),a.set("b",dummyNumberToken(e.channels[2])),"number"==typeof e.alpha&&a.set("alpha",dummyNumberToken(e.alpha));break;case se.LCH:case se.OKLCH:a.set("l",dummyNumberToken(e.channels[0])),a.set("c",dummyNumberToken(e.channels[1])),a.set("h",dummyNumberToken(e.channels[2])),"number"==typeof e.alpha&&a.set("alpha",dummyNumberToken(e.alpha));break;case se.sRGB:case se.A98_RGB:case se.Display_P3:case se.Rec2020:case se.Linear_sRGB:case se.ProPhoto_RGB:a.set("r",dummyNumberToken(e.channels[0])),a.set("g",dummyNumberToken(e.channels[1])),a.set("b",dummyNumberToken(e.channels[2])),"number"==typeof e.alpha&&a.set("alpha",dummyNumberToken(e.alpha));break;case se.XYZ_D50:case se.XYZ_D65:a.set("x",dummyNumberToken(e.channels[0])),a.set("y",dummyNumberToken(e.channels[1])),a.set("z",dummyNumberToken(e.channels[2])),"number"==typeof e.alpha&&a.set("alpha",dummyNumberToken(e.alpha))}return a}function noneToZeroInRelativeColorDataChannels(e){const a=new Map(e);for(const[n,r]of e)Number.isNaN(r[4].value)&&a.set(n,dummyNumberToken(0));return a}function dummyNumberToken(n){return Number.isNaN(n)?[e.Number,"none",-1,-1,{value:Number.NaN,type:a.Number}]:[e.Number,n.toString(),-1,-1,{value:n,type:a.Number}]}function reducePrecision(e,a=7){if(Number.isNaN(e))return 0;const n=Math.pow(10,a);return Math.round(e*n)/n}function colorDataFitsRGB_Gamut(e){const a={...e,channels:[...e.channels]};a.channels=convertPowerlessComponentsToZeroValuesForDisplay(a.channels,a.colorNotation);return!colorDataTo(a,se.RGB).channels.find((e=>e<-1e-5||e>1.00001))}function colorDataFitsDisplayP3_Gamut(e){const a={...e,channels:[...e.channels]};a.channels=convertPowerlessComponentsToZeroValuesForDisplay(a.channels,a.colorNotation);return!colorDataTo(a,se.Display_P3).channels.find((e=>e<-1e-5||e>1.00001))}function normalize(e,a,n,r){return Math.min(Math.max(e/a,n),r)}const ie=/[A-Z]/g;function toLowerCaseAZ(e){return e.replace(ie,(e=>String.fromCharCode(e.charCodeAt(0)+32)))}function normalize_Color_ChannelValues(t,l,s){if(n(t)&&"none"===toLowerCaseAZ(t[4].value))return s.syntaxFlags.add(ue.HasNoneKeywords),[e.Number,"none",t[2],t[3],{value:NaN,type:a.Number}];if(r(t)){3!==l&&s.syntaxFlags.add(ue.HasPercentageValues);let n=normalize(t[4].value,100,-2147483647,2147483647);return 3===l&&(n=normalize(t[4].value,100,0,1)),[e.Number,n.toString(),t[2],t[3],{value:n,type:a.Number}]}if(o(t)){3!==l&&s.syntaxFlags.add(ue.HasNumberValues);let n=normalize(t[4].value,1,-2147483647,2147483647);return 3===l&&(n=normalize(t[4].value,1,0,1)),[e.Number,n.toString(),t[2],t[3],{value:n,type:a.Number}]}return!1}const he=new Set(["srgb","srgb-linear","display-p3","a98-rgb","prophoto-rgb","rec2020","xyz","xyz-d50","xyz-d65"]);function color$1(e,a){const r=[],s=[],u=[],c=[];let i,h,m=!1,p=!1;const N={colorNotation:se.sRGB,channels:[0,0,0],alpha:1,syntaxFlags:new Set([])};let b=r;for(let o=0;o<e.value.length;o++){let v=e.value[o];if(J(v)||Q(v))for(;J(e.value[o+1])||Q(e.value[o+1]);)o++;else if(b===r&&r.length&&(b=s),b===s&&s.length&&(b=u),ee(v)&&t(v.value)&&"/"===v.value[4].value){if(b===c)return!1;b=c}else{if(ae(v)){if(b===c&&"var"===toLowerCaseAZ(v.getName())){N.syntaxFlags.add(ue.HasVariableAlpha),b.push(v);continue}if(!te.has(toLowerCaseAZ(v.getName())))return!1;const[[e]]=le([[v]],{censorIntoStandardRepresentableValues:!0,globals:h,precision:-1,toCanonicalUnits:!0});if(!e||!ee(e)||!l(e.value))return!1;Number.isNaN(e.value[4].value)&&(e.value[4].value=0),v=e}if(b===r&&0===r.length&&ee(v)&&n(v.value)&&he.has(toLowerCaseAZ(v.value[4].value))){if(m)return!1;m=toLowerCaseAZ(v.value[4].value),N.colorNotation=colorSpaceNameToColorNotation(m),p&&(p.colorNotation!==N.colorNotation&&(p=colorDataTo(p,N.colorNotation)),i=normalizeRelativeColorDataChannels(p),h=noneToZeroInRelativeColorDataChannels(i))}else if(b===r&&0===r.length&&ee(v)&&n(v.value)&&"from"===toLowerCaseAZ(v.value[4].value)){if(p)return!1;if(m)return!1;for(;J(e.value[o+1])||Q(e.value[o+1]);)o++;if(o++,v=e.value[o],p=a(v),!1===p)return!1;p.syntaxFlags.has(ue.Experimental)&&N.syntaxFlags.add(ue.Experimental),N.syntaxFlags.add(ue.RelativeColorSyntax)}else{if(!ee(v))return!1;if(n(v.value)&&i&&i.has(toLowerCaseAZ(v.value[4].value))){b.push(new ne(i.get(toLowerCaseAZ(v.value[4].value))));continue}b.push(v)}}}if(!m)return!1;if(1!==b.length)return!1;if(1!==r.length||1!==s.length||1!==u.length)return!1;if(!ee(r[0])||!ee(s[0])||!ee(u[0]))return!1;if(i&&!i.has("alpha"))return!1;const v=normalize_Color_ChannelValues(r[0].value,0,N);if(!v||!o(v))return!1;const g=normalize_Color_ChannelValues(s[0].value,1,N);if(!g||!o(g))return!1;const f=normalize_Color_ChannelValues(u[0].value,2,N);if(!f||!o(f))return!1;const d=[v,g,f];if(1===c.length)if(N.syntaxFlags.add(ue.HasAlpha),ee(c[0])){const e=normalize_Color_ChannelValues(c[0].value,3,N);if(!e||!o(e))return!1;d.push(e)}else N.alpha=c[0];else if(i&&i.has("alpha")){const e=normalize_Color_ChannelValues(i.get("alpha"),3,N);if(!e||!o(e))return!1;d.push(e)}return N.channels=[d[0][4].value,d[1][4].value,d[2][4].value],4===d.length&&(N.alpha=d[3][4].value),N}function colorSpaceNameToColorNotation(e){switch(e){case"srgb":return se.sRGB;case"srgb-linear":return se.Linear_sRGB;case"display-p3":return se.Display_P3;case"a98-rgb":return se.A98_RGB;case"prophoto-rgb":return se.ProPhoto_RGB;case"rec2020":return se.Rec2020;case"xyz":case"xyz-d65":return se.XYZ_D65;case"xyz-d50":return se.XYZ_D50;default:throw new Error("Unknown color space name: "+e)}}const me=new Set(["srgb","srgb-linear","display-p3","a98-rgb","prophoto-rgb","rec2020","lab","oklab","xyz","xyz-d50","xyz-d65"]),pe=new Set(["hsl","hwb","lch","oklch"]),Ne=new Set(["shorter","longer","increasing","decreasing"]);function colorMix(e,a){let r=null,o=null,t=null,l=!1;for(let u=0;u<e.value.length;u++){const c=e.value[u];if(!J(c)&&!Q(c)){if(ee(c)&&n(c.value)){if(!r&&"in"===toLowerCaseAZ(c.value[4].value)){r=c;continue}if(r&&!o){o=toLowerCaseAZ(c.value[4].value);continue}if(r&&o&&!t&&pe.has(o)){t=toLowerCaseAZ(c.value[4].value);continue}if(r&&o&&t&&!l&&"hue"===toLowerCaseAZ(c.value[4].value)){l=!0;continue}return!1}return!(!ee(c)||!s(c.value))&&(!!o&&(t||l?!!(o&&t&&l&&pe.has(o)&&Ne.has(t))&&colorMixPolar(o,t,colorMixComponents(e.value.slice(u+1),a)):me.has(o)?colorMixRectangular(o,colorMixComponents(e.value.slice(u+1),a)):!!pe.has(o)&&colorMixPolar(o,"shorter",colorMixComponents(e.value.slice(u+1),a))))}}return!1}function colorMixComponents(e,a){const n=[];let o=1,t=!1,u=!1;for(let o=0;o<e.length;o++){let c=e[o];if(!J(c)&&!Q(c)){if(!ee(c)||!s(c.value)){if(!t){const e=a(c);if(e){t=e;continue}}if(!u){if(ae(c)&&te.has(toLowerCaseAZ(c.getName()))){if([[c]]=le([[c]],{censorIntoStandardRepresentableValues:!0,precision:-1,toCanonicalUnits:!0}),!c||!ee(c)||!l(c.value))return!1;Number.isNaN(c.value[4].value)&&(c.value[4].value=0)}if(ee(c)&&r(c.value)&&c.value[4].value>=0){u=c.value[4].value;continue}}return!1}if(!t)return!1;n.push({color:t,percentage:u}),t=!1,u=!1}}if(t&&n.push({color:t,percentage:u}),2!==n.length)return!1;let c=n[0].percentage,i=n[1].percentage;return(!1===c||!(c<0||c>100))&&((!1===i||!(i<0||i>100))&&(!1===c&&!1===i?(c=50,i=50):!1!==c&&!1===i?i=100-c:!1===c&&!1!==i&&(c=100-i),(0!==c||0!==i)&&(!1!==c&&!1!==i&&(c+i>100&&(c=c/(c+i)*100,i=i/(c+i)*100),c+i<100&&(o=(c+i)/100,c=c/(c+i)*100,i=i/(c+i)*100),{a:{color:n[0].color,percentage:c},b:{color:n[1].color,percentage:i},alphaMultiplier:o}))))}function colorMixRectangular(e,a){if(!a)return!1;const n=a.a.color,r=a.b.color,o=a.a.percentage/100;let t=n.channels,l=r.channels,s=se.RGB,u=n.alpha;if("number"!=typeof u)return!1;let c=r.alpha;if("number"!=typeof c)return!1;switch(u=Number.isNaN(u)?c:u,c=Number.isNaN(c)?u:c,e){case"srgb":s=se.RGB;break;case"srgb-linear":s=se.Linear_sRGB;break;case"display-p3":s=se.Display_P3;break;case"a98-rgb":s=se.A98_RGB;break;case"prophoto-rgb":s=se.ProPhoto_RGB;break;case"rec2020":s=se.Rec2020;break;case"lab":s=se.Lab;break;case"oklab":s=se.OKLab;break;case"xyz-d50":s=se.XYZ_D50;break;case"xyz":case"xyz-d65":s=se.XYZ_D65}t=colorDataTo(n,s).channels,l=colorDataTo(r,s).channels,t[0]=fillInMissingComponent(t[0],l[0]),l[0]=fillInMissingComponent(l[0],t[0]),t[1]=fillInMissingComponent(t[1],l[1]),l[1]=fillInMissingComponent(l[1],t[1]),t[2]=fillInMissingComponent(t[2],l[2]),l[2]=fillInMissingComponent(l[2],t[2]),t[0]=premultiply(t[0],u),t[1]=premultiply(t[1],u),t[2]=premultiply(t[2],u),l[0]=premultiply(l[0],c),l[1]=premultiply(l[1],c),l[2]=premultiply(l[2],c);const i=interpolate(u,c,o),h={colorNotation:s,channels:[un_premultiply(interpolate(t[0],l[0],o),i),un_premultiply(interpolate(t[1],l[1],o),i),un_premultiply(interpolate(t[2],l[2],o),i)],alpha:i*a.alphaMultiplier,syntaxFlags:new Set([ue.ColorMix])};return(a.a.color.syntaxFlags.has(ue.Experimental)||a.b.color.syntaxFlags.has(ue.Experimental))&&h.syntaxFlags.add(ue.Experimental),h}function colorMixPolar(e,a,n){if(!n)return!1;const r=n.a.color,o=n.b.color,t=n.a.percentage/100;let l=r.channels,s=o.channels,u=0,c=0,i=0,h=0,m=0,p=0,N=se.RGB,b=r.alpha;if("number"!=typeof b)return!1;let v=o.alpha;if("number"!=typeof v)return!1;switch(b=Number.isNaN(b)?v:b,v=Number.isNaN(v)?b:v,e){case"hsl":N=se.HSL;break;case"hwb":N=se.HWB;break;case"lch":N=se.LCH;break;case"oklch":N=se.OKLCH}switch(l=colorDataTo(r,N).channels,s=colorDataTo(o,N).channels,e){case"hsl":case"hwb":u=l[0],c=s[0],i=l[1],h=s[1],m=l[2],p=s[2];break;case"lch":case"oklch":i=l[0],h=s[0],m=l[1],p=s[1],u=l[2],c=s[2]}u=fillInMissingComponent(u,c),Number.isNaN(u)&&(u=0),c=fillInMissingComponent(c,u),Number.isNaN(c)&&(c=0),i=fillInMissingComponent(i,h),h=fillInMissingComponent(h,i),m=fillInMissingComponent(m,p),p=fillInMissingComponent(p,m);const g=c-u;switch(a){case"shorter":g>180?u+=360:g<-180&&(c+=360);break;case"longer":-180<g&&g<180&&(g>0?u+=360:c+=360);break;case"increasing":g<0&&(c+=360);break;case"decreasing":g>0&&(u+=360);break;default:throw new Error("Unknown hue interpolation method")}i=premultiply(i,b),m=premultiply(m,b),h=premultiply(h,v),p=premultiply(p,v);let f=[0,0,0];const d=interpolate(b,v,t);switch(e){case"hsl":case"hwb":f=[interpolate(u,c,t),un_premultiply(interpolate(i,h,t),d),un_premultiply(interpolate(m,p,t),d)];break;case"lch":case"oklch":f=[un_premultiply(interpolate(i,h,t),d),un_premultiply(interpolate(m,p,t),d),interpolate(u,c,t)]}const y={colorNotation:N,channels:f,alpha:d*n.alphaMultiplier,syntaxFlags:new Set([ue.ColorMix])};return(n.a.color.syntaxFlags.has(ue.Experimental)||n.b.color.syntaxFlags.has(ue.Experimental))&&y.syntaxFlags.add(ue.Experimental),y}function fillInMissingComponent(e,a){return Number.isNaN(e)?a:e}function interpolate(e,a,n){return e*n+a*(1-n)}function premultiply(e,a){return Number.isNaN(a)?e:Number.isNaN(e)?NaN:e*a}function un_premultiply(e,a){return 0===a||Number.isNaN(a)?e:Number.isNaN(e)?NaN:e/a}function hex(e){const a=toLowerCaseAZ(e[4].value);if(a.match(/[^a-f0-9]/))return!1;const n={colorNotation:se.HEX,channels:[0,0,0],alpha:1,syntaxFlags:new Set([ue.Hex])},r=a.length;if(3===r){const e=a[0],r=a[1],o=a[2];return n.channels=[parseInt(e+e,16)/255,parseInt(r+r,16)/255,parseInt(o+o,16)/255],n}if(6===r){const e=a[0]+a[1],r=a[2]+a[3],o=a[4]+a[5];return n.channels=[parseInt(e,16)/255,parseInt(r,16)/255,parseInt(o,16)/255],n}if(4===r){const e=a[0],r=a[1],o=a[2],t=a[3];return n.channels=[parseInt(e+e,16)/255,parseInt(r+r,16)/255,parseInt(o+o,16)/255],n.alpha=parseInt(t+t,16)/255,n.syntaxFlags.add(ue.HasAlpha),n}if(8===r){const e=a[0]+a[1],r=a[2]+a[3],o=a[4]+a[5],t=a[6]+a[7];return n.channels=[parseInt(e,16)/255,parseInt(r,16)/255,parseInt(o,16)/255],n.alpha=parseInt(t,16)/255,n.syntaxFlags.add(ue.HasAlpha),n}return!1}function normalizeHue(n){if(o(n))return n[4].value=n[4].value%360,n[1]=n[4].value.toString(),n;if(u(n)){let r=n[4].value;switch(toLowerCaseAZ(n[4].unit)){case"deg":break;case"rad":r=180*n[4].value/Math.PI;break;case"grad":r=.9*n[4].value;break;case"turn":r=360*n[4].value;break;default:return!1}return r%=360,[e.Number,r.toString(),n[2],n[3],{value:r,type:a.Number}]}return!1}function normalize_legacy_HSL_ChannelValues(n,t,l){if(0===t){const e=normalizeHue(n);return!1!==e&&(u(n)&&l.syntaxFlags.add(ue.HasDimensionValues),e)}if(r(n)){3===t?l.syntaxFlags.add(ue.HasPercentageAlpha):l.syntaxFlags.add(ue.HasPercentageValues);let r=normalize(n[4].value,1,0,100);return 3===t&&(r=normalize(n[4].value,100,0,1)),[e.Number,r.toString(),n[2],n[3],{value:r,type:a.Number}]}if(o(n)){if(3!==t)return!1;let r=normalize(n[4].value,1,0,100);return 3===t&&(r=normalize(n[4].value,1,0,1)),[e.Number,r.toString(),n[2],n[3],{value:r,type:a.Number}]}return!1}function normalize_modern_HSL_ChannelValues(t,l,s){if(n(t)&&"none"===toLowerCaseAZ(t[4].value))return s.syntaxFlags.add(ue.HasNoneKeywords),[e.Number,"none",t[2],t[3],{value:NaN,type:a.Number}];if(0===l){const e=normalizeHue(t);return!1!==e&&(u(t)&&s.syntaxFlags.add(ue.HasDimensionValues),e)}if(r(t)){3===l?s.syntaxFlags.add(ue.HasPercentageAlpha):s.syntaxFlags.add(ue.HasPercentageValues);let n=t[4].value;return 3===l?n=normalize(t[4].value,100,0,1):1===l&&(n=normalize(t[4].value,1,0,2147483647)),[e.Number,n.toString(),t[2],t[3],{value:n,type:a.Number}]}if(o(t)){3!==l&&s.syntaxFlags.add(ue.HasNumberValues);let n=t[4].value;return 3===l?n=normalize(t[4].value,1,0,1):1===l&&(n=normalize(t[4].value,1,0,2147483647)),[e.Number,n.toString(),t[2],t[3],{value:n,type:a.Number}]}return!1}function threeChannelLegacySyntax(e,a,n,r){const t=[],u=[],c=[],i=[],h={colorNotation:n,channels:[0,0,0],alpha:1,syntaxFlags:new Set(r)};let m=t;for(let a=0;a<e.value.length;a++){let n=e.value[a];if(!J(n)&&!Q(n)){if(ee(n)&&s(n.value)){if(m===t){m=u;continue}if(m===u){m=c;continue}if(m===c){m=i;continue}if(m===i)return!1}if(ae(n)){if(m===i&&"var"===n.getName().toLowerCase()){h.syntaxFlags.add(ue.HasVariableAlpha),m.push(n);continue}if(!te.has(n.getName().toLowerCase()))return!1;const[[e]]=le([[n]],{censorIntoStandardRepresentableValues:!0,precision:-1,toCanonicalUnits:!0});if(!e||!ee(e)||!l(e.value))return!1;Number.isNaN(e.value[4].value)&&(e.value[4].value=0),n=e}if(!ee(n))return!1;m.push(n)}}if(1!==m.length)return!1;if(1!==t.length||1!==u.length||1!==c.length)return!1;if(!ee(t[0])||!ee(u[0])||!ee(c[0]))return!1;const p=a(t[0].value,0,h);if(!p||!o(p))return!1;const N=a(u[0].value,1,h);if(!N||!o(N))return!1;const b=a(c[0].value,2,h);if(!b||!o(b))return!1;const v=[p,N,b];if(1===i.length)if(h.syntaxFlags.add(ue.HasAlpha),ee(i[0])){const e=a(i[0].value,3,h);if(!e||!o(e))return!1;v.push(e)}else h.alpha=i[0];return h.channels=[v[0][4].value,v[1][4].value,v[2][4].value],4===v.length&&(h.alpha=v[3][4].value),h}function threeChannelSpaceSeparated(e,a,r,s,u){const c=[],i=[],h=[],m=[];let p,N,b=!1;const v={colorNotation:r,channels:[0,0,0],alpha:1,syntaxFlags:new Set(s)};let g=c;for(let a=0;a<e.value.length;a++){let o=e.value[a];if(J(o)||Q(o))for(;J(e.value[a+1])||Q(e.value[a+1]);)a++;else if(g===c&&c.length&&(g=i),g===i&&i.length&&(g=h),ee(o)&&t(o.value)&&"/"===o.value[4].value){if(g===m)return!1;g=m}else{if(ae(o)){if(g===m&&"var"===o.getName().toLowerCase()){v.syntaxFlags.add(ue.HasVariableAlpha),g.push(o);continue}if(!te.has(o.getName().toLowerCase()))return!1;const[[e]]=le([[o]],{censorIntoStandardRepresentableValues:!0,globals:N,precision:-1,toCanonicalUnits:!0});if(!e||!ee(e)||!l(e.value))return!1;Number.isNaN(e.value[4].value)&&(e.value[4].value=0),o=e}if(g===c&&0===c.length&&ee(o)&&n(o.value)&&"from"===o.value[4].value.toLowerCase()){if(b)return!1;for(;J(e.value[a+1])||Q(e.value[a+1]);)a++;if(a++,o=e.value[a],b=u(o),!1===b)return!1;b.syntaxFlags.has(ue.Experimental)&&v.syntaxFlags.add(ue.Experimental),v.syntaxFlags.add(ue.RelativeColorSyntax),b.colorNotation!==r&&(b=colorDataTo(b,r)),p=normalizeRelativeColorDataChannels(b),N=noneToZeroInRelativeColorDataChannels(p)}else{if(!ee(o))return!1;if(n(o.value)&&p){const e=o.value[4].value.toLowerCase();if(p.has(e)){g.push(new ne(p.get(e)));continue}}g.push(o)}}}if(1!==g.length)return!1;if(1!==c.length||1!==i.length||1!==h.length)return!1;if(!ee(c[0])||!ee(i[0])||!ee(h[0]))return!1;if(p&&!p.has("alpha"))return!1;const f=a(c[0].value,0,v);if(!f||!o(f))return!1;const d=a(i[0].value,1,v);if(!d||!o(d))return!1;const y=a(h[0].value,2,v);if(!y||!o(y))return!1;const _=[f,d,y];if(1===m.length)if(v.syntaxFlags.add(ue.HasAlpha),ee(m[0])){const e=a(m[0].value,3,v);if(!e||!o(e))return!1;_.push(e)}else v.alpha=m[0];else if(p&&p.has("alpha")){const e=a(p.get("alpha"),3,v);if(!e||!o(e))return!1;_.push(e)}return v.channels=[_[0][4].value,_[1][4].value,_[2][4].value],4===_.length&&(v.alpha=_[3][4].value),v}function hsl(e,a){if(e.value.some((e=>ee(e)&&s(e.value)))){const a=hslCommaSeparated(e);if(!1!==a)return a}{const n=hslSpaceSeparated(e,a);if(!1!==n)return n}return!1}function hslCommaSeparated(e){return threeChannelLegacySyntax(e,normalize_legacy_HSL_ChannelValues,se.HSL,[ue.LegacyHSL])}function hslSpaceSeparated(e,a){return threeChannelSpaceSeparated(e,normalize_modern_HSL_ChannelValues,se.HSL,[],a)}function normalize_HWB_ChannelValues(t,l,s){if(n(t)&&"none"===toLowerCaseAZ(t[4].value))return s.syntaxFlags.add(ue.HasNoneKeywords),[e.Number,"none",t[2],t[3],{value:NaN,type:a.Number}];if(0===l){const e=normalizeHue(t);return!1!==e&&(u(t)&&s.syntaxFlags.add(ue.HasDimensionValues),e)}if(r(t)){3===l?s.syntaxFlags.add(ue.HasPercentageAlpha):s.syntaxFlags.add(ue.HasPercentageValues);let n=t[4].value;return 3===l&&(n=normalize(t[4].value,100,0,1)),[e.Number,n.toString(),t[2],t[3],{value:n,type:a.Number}]}if(o(t)){3!==l&&s.syntaxFlags.add(ue.HasNumberValues);let n=t[4].value;return 3===l&&(n=normalize(t[4].value,1,0,1)),[e.Number,n.toString(),t[2],t[3],{value:n,type:a.Number}]}return!1}function normalize_Lab_ChannelValues(t,l,s){if(n(t)&&"none"===toLowerCaseAZ(t[4].value))return s.syntaxFlags.add(ue.HasNoneKeywords),[e.Number,"none",t[2],t[3],{value:NaN,type:a.Number}];if(r(t)){3!==l&&s.syntaxFlags.add(ue.HasPercentageValues);let n=normalize(t[4].value,1,0,100);return 1===l||2===l?n=normalize(t[4].value,.8,-2147483647,2147483647):3===l&&(n=normalize(t[4].value,100,0,1)),[e.Number,n.toString(),t[2],t[3],{value:n,type:a.Number}]}if(o(t)){3!==l&&s.syntaxFlags.add(ue.HasNumberValues);let n=normalize(t[4].value,1,0,100);return 1===l||2===l?n=normalize(t[4].value,1,-2147483647,2147483647):3===l&&(n=normalize(t[4].value,1,0,1)),[e.Number,n.toString(),t[2],t[3],{value:n,type:a.Number}]}return!1}function lab(e,a){return threeChannelSpaceSeparated(e,normalize_Lab_ChannelValues,se.Lab,[],a)}function normalize_LCH_ChannelValues(t,l,s){if(n(t)&&"none"===toLowerCaseAZ(t[4].value))return s.syntaxFlags.add(ue.HasNoneKeywords),[e.Number,"none",t[2],t[3],{value:NaN,type:a.Number}];if(2===l){const e=normalizeHue(t);return!1!==e&&(u(t)&&s.syntaxFlags.add(ue.HasDimensionValues),e)}if(r(t)){3!==l&&s.syntaxFlags.add(ue.HasPercentageValues);let n=normalize(t[4].value,1,0,100);return 1===l?n=normalize(t[4].value,100/150,0,2147483647):3===l&&(n=normalize(t[4].value,100,0,1)),[e.Number,n.toString(),t[2],t[3],{value:n,type:a.Number}]}if(o(t)){3!==l&&s.syntaxFlags.add(ue.HasNumberValues);let n=normalize(t[4].value,1,0,100);return 1===l?n=normalize(t[4].value,1,0,2147483647):3===l&&(n=normalize(t[4].value,1,0,1)),[e.Number,n.toString(),t[2],t[3],{value:n,type:a.Number}]}return!1}function lch(e,a){return threeChannelSpaceSeparated(e,normalize_LCH_ChannelValues,se.LCH,[],a)}const be=new Map;for(const[e,a]of Object.entries(G))be.set(e,a);function namedColor(e){const a=be.get(toLowerCaseAZ(e));return!!a&&{colorNotation:se.RGB,channels:[a[0]/255,a[1]/255,a[2]/255],alpha:1,syntaxFlags:new Set([ue.ColorKeyword,ue.NamedColor])}}function normalize_OKLab_ChannelValues(t,l,s){if(n(t)&&"none"===toLowerCaseAZ(t[4].value))return s.syntaxFlags.add(ue.HasNoneKeywords),[e.Number,"none",t[2],t[3],{value:NaN,type:a.Number}];if(r(t)){3!==l&&s.syntaxFlags.add(ue.HasPercentageValues);let n=normalize(t[4].value,100,0,1);return 1===l||2===l?n=normalize(t[4].value,250,-2147483647,2147483647):3===l&&(n=normalize(t[4].value,100,0,1)),[e.Number,n.toString(),t[2],t[3],{value:n,type:a.Number}]}if(o(t)){3!==l&&s.syntaxFlags.add(ue.HasNumberValues);let n=normalize(t[4].value,1,0,1);return 1===l||2===l?n=normalize(t[4].value,1,-2147483647,2147483647):3===l&&(n=normalize(t[4].value,1,0,1)),[e.Number,n.toString(),t[2],t[3],{value:n,type:a.Number}]}return!1}function oklab(e,a){return threeChannelSpaceSeparated(e,normalize_OKLab_ChannelValues,se.OKLab,[],a)}function normalize_OKLCH_ChannelValues(t,l,s){if(n(t)&&"none"===toLowerCaseAZ(t[4].value))return s.syntaxFlags.add(ue.HasNoneKeywords),[e.Number,"none",t[2],t[3],{value:NaN,type:a.Number}];if(2===l){const e=normalizeHue(t);return!1!==e&&(u(t)&&s.syntaxFlags.add(ue.HasDimensionValues),e)}if(r(t)){3!==l&&s.syntaxFlags.add(ue.HasPercentageValues);let n=normalize(t[4].value,100,0,1);return 1===l?n=normalize(t[4].value,250,0,2147483647):3===l&&(n=normalize(t[4].value,100,0,1)),[e.Number,n.toString(),t[2],t[3],{value:n,type:a.Number}]}if(o(t)){3!==l&&s.syntaxFlags.add(ue.HasNumberValues);let n=normalize(t[4].value,1,0,1);return 1===l?n=normalize(t[4].value,1,0,2147483647):3===l&&(n=normalize(t[4].value,1,0,1)),[e.Number,n.toString(),t[2],t[3],{value:n,type:a.Number}]}return!1}function oklch(e,a){return threeChannelSpaceSeparated(e,normalize_OKLCH_ChannelValues,se.OKLCH,[],a)}function normalize_legacy_sRGB_ChannelValues(n,t,l){if(r(n)){3===t?l.syntaxFlags.add(ue.HasPercentageAlpha):l.syntaxFlags.add(ue.HasPercentageValues);const r=normalize(n[4].value,100,0,1);return[e.Number,r.toString(),n[2],n[3],{value:r,type:a.Number}]}if(o(n)){3!==t&&l.syntaxFlags.add(ue.HasNumberValues);let r=normalize(n[4].value,255,0,1);return 3===t&&(r=normalize(n[4].value,1,0,1)),[e.Number,r.toString(),n[2],n[3],{value:r,type:a.Number}]}return!1}function normalize_modern_sRGB_ChannelValues(t,l,s){if(n(t)&&"none"===t[4].value.toLowerCase())return s.syntaxFlags.add(ue.HasNoneKeywords),[e.Number,"none",t[2],t[3],{value:NaN,type:a.Number}];if(r(t)){3!==l&&s.syntaxFlags.add(ue.HasPercentageValues);let n=normalize(t[4].value,100,-2147483647,2147483647);return 3===l&&(n=normalize(t[4].value,100,0,1)),[e.Number,n.toString(),t[2],t[3],{value:n,type:a.Number}]}if(o(t)){3!==l&&s.syntaxFlags.add(ue.HasNumberValues);let n=normalize(t[4].value,255,-2147483647,2147483647);return 3===l&&(n=normalize(t[4].value,1,0,1)),[e.Number,n.toString(),t[2],t[3],{value:n,type:a.Number}]}return!1}function rgb(e,a){if(e.value.some((e=>ee(e)&&s(e.value)))){const a=rgbCommaSeparated(e);if(!1!==a)return(!a.syntaxFlags.has(ue.HasNumberValues)||!a.syntaxFlags.has(ue.HasPercentageValues))&&a}else{const n=rgbSpaceSeparated(e,a);if(!1!==n)return n}return!1}function rgbCommaSeparated(e){return threeChannelLegacySyntax(e,normalize_legacy_sRGB_ChannelValues,se.RGB,[ue.LegacyRGB])}function rgbSpaceSeparated(e,a){return threeChannelSpaceSeparated(e,normalize_modern_sRGB_ChannelValues,se.RGB,[],a)}function XYZ_D50_to_sRGB_Gamut(e){const a=B(e);if(T(a))return V(a);let n=e;return n=L(n),n[0]<1e-6&&(n=[0,0,0]),n[0]>.999999&&(n=[1,0,0]),A(X(n,oklch_to_lin_srgb,lin_srgb_to_oklch))}function oklch_to_lin_srgb(e){return e=Y(e),e=K(e),I(e)}function lin_srgb_to_oklch(e){return e=O(e),e=E(e),W(e)}function contrastColor(e,a){let r=!1,o=!1;for(let t=0;t<e.value.length;t++){const l=e.value[t];if(!J(l)&&!Q(l)&&(r||(r=a(l),!r))){if(!r||o||!ee(l)||!n(l.value)||"max"!==toLowerCaseAZ(l.value[4].value))return!1;o=!0}}if(!r||!o)return!1;r.channels=convertNaNToZero(r.channels),r.channels=XYZ_D50_to_sRGB_Gamut(colorData_to_XYZ_D50(r).channels),r.colorNotation=se.sRGB;const t={colorNotation:se.sRGB,channels:[0,0,0],alpha:1,syntaxFlags:new Set([ue.ContrastColor,ue.Experimental])},l=U(r.channels,[1,1,1]),s=U(r.channels,[0,0,0]);return t.channels=l>s?[1,1,1]:[0,0,0],t}function toPrecision(e,a=7){e=+e,a=+a;const n=(Math.floor(e)+"").length;if(a>n)return+e.toFixed(a-n);{const r=10**(n-a);return Math.round(e/r)*r}}function XYZ_D50_to_P3_Gamut(e){const a=M(e);if(T(a))return V(a);let n=e;return n=L(n),n[0]<1e-6&&(n=[0,0,0]),n[0]>.999999&&(n=[1,0,0]),$(X(n,oklch_to_lin_p3,lin_p3_to_oklch))}function oklch_to_lin_p3(e){return e=Y(e),e=K(e),j(e)}function lin_p3_to_oklch(e){return e=q(e),e=E(e),W(e)}function serializeWithAlpha(n,r,o,t){const l=[e.CloseParen,")",-1,-1,void 0];if("number"==typeof n.alpha){const s=Math.min(1,Math.max(0,toPrecision(Number.isNaN(n.alpha)?0:n.alpha)));return 1===toPrecision(s,4)?new re(r,l,t):new re(r,l,[...t,new oe([o]),new ne([e.Delim,"/",-1,-1,{value:"/"}]),new oe([o]),new ne([e.Number,toPrecision(s,4).toString(),-1,-1,{value:n.alpha,type:a.Integer}])])}return new re(r,l,[...t,new oe([o]),new ne([e.Delim,"/",-1,-1,{value:"/"}]),new oe([o]),n.alpha])}function serializeP3(n,r=!0){n.channels=convertPowerlessComponentsToZeroValuesForDisplay(n.channels,n.colorNotation);let o=n.channels.map((e=>Number.isNaN(e)?0:e));n.colorNotation!==se.Display_P3&&(o=r?XYZ_D50_to_P3_Gamut(colorData_to_XYZ_D50(n).channels):M(colorData_to_XYZ_D50(n).channels));const t=r?Math.min(1,Math.max(0,toPrecision(o[0],6))):toPrecision(o[0],6),l=r?Math.min(1,Math.max(0,toPrecision(o[1],6))):toPrecision(o[1],6),s=r?Math.min(1,Math.max(0,toPrecision(o[2],6))):toPrecision(o[2],6),u=[e.Function,"color(",-1,-1,{value:"color"}],c=[e.Whitespace," ",-1,-1,void 0];return serializeWithAlpha(n,u,c,[new ne([e.Ident,"display-p3",-1,-1,{value:"display-p3"}]),new oe([c]),new ne([e.Number,t.toString(),-1,-1,{value:o[0],type:a.Number}]),new oe([c]),new ne([e.Number,l.toString(),-1,-1,{value:o[1],type:a.Number}]),new oe([c]),new ne([e.Number,s.toString(),-1,-1,{value:o[2],type:a.Number}])])}function serializeRGB(n,r=!0){n.channels=convertPowerlessComponentsToZeroValuesForDisplay(n.channels,n.colorNotation);let o=n.channels.map((e=>Number.isNaN(e)?0:e));o=r?XYZ_D50_to_sRGB_Gamut(colorData_to_XYZ_D50(n).channels):B(colorData_to_XYZ_D50(n).channels);const t=Math.min(255,Math.max(0,Math.round(255*toPrecision(o[0])))),l=Math.min(255,Math.max(0,Math.round(255*toPrecision(o[1])))),s=Math.min(255,Math.max(0,Math.round(255*toPrecision(o[2])))),u=[e.CloseParen,")",-1,-1,void 0],c=[e.Whitespace," ",-1,-1,void 0],i=[e.Comma,",",-1,-1,void 0],h=[new ne([e.Number,t.toString(),-1,-1,{value:Math.min(255,255*Math.max(0,o[0])),type:a.Integer}]),new ne(i),new oe([c]),new ne([e.Number,l.toString(),-1,-1,{value:Math.min(255,255*Math.max(0,o[1])),type:a.Integer}]),new ne(i),new oe([c]),new ne([e.Number,s.toString(),-1,-1,{value:Math.min(255,255*Math.max(0,o[2])),type:a.Integer}])];if("number"==typeof n.alpha){const r=Math.min(1,Math.max(0,toPrecision(Number.isNaN(n.alpha)?0:n.alpha)));return 1===toPrecision(r,4)?new re([e.Function,"rgb(",-1,-1,{value:"rgb"}],u,h):new re([e.Function,"rgba(",-1,-1,{value:"rgba"}],u,[...h,new ne(i),new oe([c]),new ne([e.Number,toPrecision(r,4).toString(),-1,-1,{value:n.alpha,type:a.Number}])])}return new re([e.Function,"rgba(",-1,-1,{value:"rgba"}],u,[...h,new ne(i),new oe([c]),n.alpha])}function serializeHSL(n,r=!0){n.channels=convertPowerlessComponentsToZeroValuesForDisplay(n.channels,n.colorNotation);let o=n.channels.map((e=>Number.isNaN(e)?0:e));o=z(r?w(XYZ_D50_to_sRGB_Gamut(colorData_to_XYZ_D50(n).channels)):colorData_to_XYZ_D50(n).channels),o=o.map((e=>Number.isNaN(e)?0:e));const t=Math.min(360,Math.max(0,Math.round(toPrecision(o[0])))),l=Math.min(100,Math.max(0,Math.round(toPrecision(o[1])))),s=Math.min(100,Math.max(0,Math.round(toPrecision(o[2])))),u=[e.CloseParen,")",-1,-1,void 0],c=[e.Whitespace," ",-1,-1,void 0],i=[e.Comma,",",-1,-1,void 0],h=[new ne([e.Number,t.toString(),-1,-1,{value:o[0],type:a.Integer}]),new ne(i),new oe([c]),new ne([e.Percentage,l.toString()+"%",-1,-1,{value:o[1]}]),new ne(i),new oe([c]),new ne([e.Percentage,s.toString()+"%",-1,-1,{value:o[2]}])];if("number"==typeof n.alpha){const r=Math.min(1,Math.max(0,toPrecision(Number.isNaN(n.alpha)?0:n.alpha)));return 1===toPrecision(r,4)?new re([e.Function,"hsl(",-1,-1,{value:"hsl"}],u,h):new re([e.Function,"hsla(",-1,-1,{value:"hsla"}],u,[...h,new ne(i),new oe([c]),new ne([e.Number,toPrecision(r,4).toString(),-1,-1,{value:n.alpha,type:a.Number}])])}return new re([e.Function,"hsla(",-1,-1,{value:"hsla"}],u,[...h,new ne(i),new oe([c]),n.alpha])}function serializeOKLCH(n){n.channels=convertPowerlessComponentsToZeroValuesForDisplay(n.channels,n.colorNotation);let r=n.channels.map((e=>Number.isNaN(e)?0:e));n.colorNotation!==se.OKLCH&&(r=L(colorData_to_XYZ_D50(n).channels));const o=toPrecision(r[0],6),t=toPrecision(r[1],6),l=toPrecision(r[2],6),s=[e.Function,"oklch(",-1,-1,{value:"oklch"}],u=[e.Whitespace," ",-1,-1,void 0];return serializeWithAlpha(n,s,u,[new ne([e.Number,o.toString(),-1,-1,{value:r[0],type:a.Number}]),new oe([u]),new ne([e.Number,t.toString(),-1,-1,{value:r[1],type:a.Number}]),new oe([u]),new ne([e.Number,l.toString(),-1,-1,{value:r[2],type:a.Number}])])}function color(e){if(ae(e)){switch(toLowerCaseAZ(e.getName())){case"rgb":case"rgba":return rgb(e,color);case"hsl":case"hsla":return hsl(e,color);case"hwb":return a=color,threeChannelSpaceSeparated(e,normalize_HWB_ChannelValues,se.HWB,[],a);case"lab":return lab(e,color);case"lch":return lch(e,color);case"oklab":return oklab(e,color);case"oklch":return oklch(e,color);case"color":return color$1(e,color);case"color-mix":return colorMix(e,color);case"contrast-color":return contrastColor(e,color)}}var a;if(ee(e)){if(c(e.value))return hex(e.value);if(n(e.value)){const a=namedColor(e.value[4].value);return!1!==a?a:"transparent"===toLowerCaseAZ(e.value[4].value)&&{colorNotation:se.RGB,channels:[0,0,0],alpha:0,syntaxFlags:new Set([ue.ColorKeyword])}}}return!1}export{se as ColorNotation,ue as SyntaxFlag,color,colorDataFitsDisplayP3_Gamut,colorDataFitsRGB_Gamut,serializeHSL,serializeOKLCH,serializeP3,serializeRGB};
diff --git a/node_modules/@csstools/css-color-parser/package.json b/node_modules/@csstools/css-color-parser/package.json
index 0f5b0d43..dc997c15 100644
--- a/node_modules/@csstools/css-color-parser/package.json
+++ b/node_modules/@csstools/css-color-parser/package.json
@@ -1,7 +1,7 @@
{
"name": "@csstools/css-color-parser",
"description": "Parse CSS color values",
- "version": "1.5.1",
+ "version": "2.0.2",
"contributors": [
{
"name": "Antonio Laguna",
@@ -48,17 +48,17 @@
"dist"
],
"dependencies": {
- "@csstools/color-helpers": "^4.0.0",
- "@csstools/css-calc": "^1.1.6"
+ "@csstools/color-helpers": "^4.2.0",
+ "@csstools/css-calc": "^1.2.2"
},
"peerDependencies": {
- "@csstools/css-parser-algorithms": "^2.5.0",
- "@csstools/css-tokenizer": "^2.2.3"
+ "@csstools/css-parser-algorithms": "^2.6.3",
+ "@csstools/css-tokenizer": "^2.3.1"
},
"homepage": "https://github.com/csstools/postcss-plugins/tree/main/packages/css-color-parser#readme",
"repository": {
"type": "git",
- "url": "https://github.com/csstools/postcss-plugins.git",
+ "url": "git+https://github.com/csstools/postcss-plugins.git",
"directory": "packages/css-color-parser"
},
"bugs": "https://github.com/csstools/postcss-plugins/issues",
diff --git a/node_modules/@csstools/css-parser-algorithms/CHANGELOG.md b/node_modules/@csstools/css-parser-algorithms/CHANGELOG.md
index 802f35cf..00d557dd 100644
--- a/node_modules/@csstools/css-parser-algorithms/CHANGELOG.md
+++ b/node_modules/@csstools/css-parser-algorithms/CHANGELOG.md
@@ -1,27 +1,21 @@
# Changes to CSS Parser Algorithms
-### 2.5.0
+### 2.6.3
-_December 31, 2023_
+_May 4, 2024_
-- Add a `forEach` and `walk` function.
-- Improve documentation.
-- Updated [`@csstools/css-tokenizer`](https://github.com/csstools/postcss-plugins/tree/main/packages/css-tokenizer) to [`2.2.3`](https://github.com/csstools/postcss-plugins/tree/main/packages/css-tokenizer/CHANGELOG.md#223) (patch)
+- Updated [`@csstools/css-tokenizer`](https://github.com/csstools/postcss-plugins/tree/main/packages/css-tokenizer) to [`2.3.1`](https://github.com/csstools/postcss-plugins/tree/main/packages/css-tokenizer/CHANGELOG.md#231) (patch)
-### 2.4.0
+### 2.6.2
-_December 15, 2023_
+_May 4, 2024_
-- Fix type definitions
-- Only `walk` child nodes if they are still part of the current AST tree [#1202](https://github.com/csstools/postcss-plugins/issues/1202)
-- Make `walk` methods safe for mutations [#1204](https://github.com/csstools/postcss-plugins/issues/1204)
-- Add a `forEach` method to `FunctionNode` and `SimpleBlockNode`
-- Updated [`@csstools/css-tokenizer`](https://github.com/csstools/postcss-plugins/tree/main/packages/css-tokenizer) to [`2.2.2`](https://github.com/csstools/postcss-plugins/tree/main/packages/css-tokenizer/CHANGELOG.md#222) (patch)
+- Updated [`@csstools/css-tokenizer`](https://github.com/csstools/postcss-plugins/tree/main/packages/css-tokenizer) to [`2.3.0`](https://github.com/csstools/postcss-plugins/tree/main/packages/css-tokenizer/CHANGELOG.md#230) (minor)
-### 2.3.2
+### 2.6.1
-_September 24, 2023_
+_March 13, 2024_
-- Updated [`@csstools/css-tokenizer`](https://github.com/csstools/postcss-plugins/tree/main/packages/css-tokenizer) to [`2.2.1`](https://github.com/csstools/postcss-plugins/tree/main/packages/css-tokenizer/CHANGELOG.md#221) (patch)
+- Updated [`@csstools/css-tokenizer`](https://github.com/csstools/postcss-plugins/tree/main/packages/css-tokenizer) to [`2.2.4`](https://github.com/csstools/postcss-plugins/tree/main/packages/css-tokenizer/CHANGELOG.md#224) (patch)
[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/README.md b/node_modules/@csstools/css-parser-algorithms/README.md
index 3195aff0..a90e689d 100644
--- a/node_modules/@csstools/css-parser-algorithms/README.md
+++ b/node_modules/@csstools/css-parser-algorithms/README.md
@@ -75,7 +75,7 @@ To gather the entire ancestry for a a given sub tree of the AST you can use `gat
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.
-```css
+```js
import { parseComponentValue } from '@csstools/css-parser-algorithms';
const result = parseComponentValue(tokens, options);
diff --git a/node_modules/@csstools/css-parser-algorithms/dist/index.cjs b/node_modules/@csstools/css-parser-algorithms/dist/index.cjs
index 003cd61c..25eb6c2d 100644
--- a/node_modules/@csstools/css-parser-algorithms/dist/index.cjs
+++ b/node_modules/@csstools/css-parser-algorithms/dist/index.cjs
@@ -1 +1 @@
-"use strict";var e,n=require("@csstools/css-tokenizer");function walkerIndexGenerator(e){let n=e.slice();return(e,o,t)=>{let s=-1;for(let r=n.indexOf(o);r<n.length&&(s=e.indexOf(n[r]),-1===s||s<t);r++);return-1===s||s===t&&o===e[t]&&(s++,s>=e.length)?-1:(n=e.slice(),s)}}function consumeComponentValue(e,o){const t=o[0];if(t[0]===n.TokenType.OpenParen||t[0]===n.TokenType.OpenCurly||t[0]===n.TokenType.OpenSquare){const n=consumeSimpleBlock(e,o);return{advance:n.advance,node:n.node}}if(t[0]===n.TokenType.Function){const n=consumeFunction(e,o);return{advance:n.advance,node:n.node}}if(t[0]===n.TokenType.Whitespace){const n=consumeWhitespace(e,o);return{advance:n.advance,node:n.node}}if(t[0]===n.TokenType.Comment){const n=consumeComment(e,o);return{advance:n.advance,node:n.node}}return{advance:1,node:new TokenNode(t)}}exports.ComponentValueType=void 0,(e=exports.ComponentValueType||(exports.ComponentValueType={})).Function="function",e.SimpleBlock="simple-block",e.Whitespace="whitespace",e.Comment="comment",e.Token="token";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 o=walkerIndexGenerator(this.value);let t=0;for(;t<this.value.length;){const s=this.value[t];let r;if(n&&(r={...n}),!1===e({node:s,parent:this,state:r},t))return!1;if(t=o(this.value,s,t),-1===t)break}}walk(e,n){0!==this.value.length&&this.forEach(((n,o)=>!1!==e(n,o)&&((!("walk"in n.node)||!this.value.includes(n.node)||!1!==n.node.walk(e,n.state))&&void 0)),n)}}class FunctionNode extends ContainerNodeBaseClass{type=exports.ComponentValueType.Function;name;endToken;constructor(e,n,o){super(),this.name=e,this.endToken=n,this.value=o}getName(){return this.name[4].value}normalize(){this.endToken[0]===n.TokenType.EOF&&(this.endToken=[n.TokenType.CloseParen,")",-1,-1,void 0])}tokens(){return this.endToken[0]===n.TokenType.EOF?[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=>n.isToken(e)?n.stringify(e):e.toString())).join("");return n.stringify(this.name)+e+n.stringify(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===exports.ComponentValueType.Function)}}function consumeFunction(e,o){const t=[];let s=1;for(;;){const r=o[s];if(!r||r[0]===n.TokenType.EOF)return e.onParseError(new n.ParseError("Unexpected EOF while consuming a function.",o[0][2],o[o.length-1][3],["5.4.9. Consume a function","Unexpected EOF"])),{advance:o.length,node:new FunctionNode(o[0],r,t)};if(r[0]===n.TokenType.CloseParen)return{advance:s+1,node:new FunctionNode(o[0],r,t)};if(r[0]===n.TokenType.Comment||r[0]===n.TokenType.Whitespace){const n=consumeAllCommentsAndWhitespace(e,o.slice(s));s+=n.advance,t.push(...n.nodes);continue}const i=consumeComponentValue(e,o.slice(s));s+=i.advance,t.push(i.node)}}class SimpleBlockNode extends ContainerNodeBaseClass{type=exports.ComponentValueType.SimpleBlock;startToken;endToken;constructor(e,n,o){super(),this.startToken=e,this.endToken=n,this.value=o}normalize(){if(this.endToken[0]===n.TokenType.EOF){const e=n.mirrorVariant(this.startToken);e&&(this.endToken=e)}}tokens(){return this.endToken[0]===n.TokenType.EOF?[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=>n.isToken(e)?n.stringify(e):e.toString())).join("");return n.stringify(this.startToken)+e+n.stringify(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===exports.ComponentValueType.SimpleBlock)}}function consumeSimpleBlock(e,o){const t=n.mirrorVariantType(o[0][0]);if(!t)throw new Error("Failed to parse, a mirror variant must exist for all block open tokens.");const s=[];let r=1;for(;;){const i=o[r];if(!i||i[0]===n.TokenType.EOF)return e.onParseError(new n.ParseError("Unexpected EOF while consuming a simple block.",o[0][2],o[o.length-1][3],["5.4.8. Consume a simple block","Unexpected EOF"])),{advance:o.length,node:new SimpleBlockNode(o[0],i,s)};if(i[0]===t)return{advance:r+1,node:new SimpleBlockNode(o[0],i,s)};if(i[0]===n.TokenType.Comment||i[0]===n.TokenType.Whitespace){const n=consumeAllCommentsAndWhitespace(e,o.slice(r));r+=n.advance,s.push(...n.nodes);continue}const a=consumeComponentValue(e,o.slice(r));r+=a.advance,s.push(a.node)}}class WhitespaceNode{type=exports.ComponentValueType.Whitespace;value;constructor(e){this.value=e}tokens(){return this.value}toString(){return n.stringify(...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===exports.ComponentValueType.Whitespace)}}function consumeWhitespace(e,o){let t=0;for(;;){if(o[t][0]!==n.TokenType.Whitespace)return{advance:t,node:new WhitespaceNode(o.slice(0,t))};t++}}class CommentNode{type=exports.ComponentValueType.Comment;value;constructor(e){this.value=e}tokens(){return[this.value]}toString(){return n.stringify(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===exports.ComponentValueType.Comment)}}function consumeComment(e,n){return{advance:1,node:new CommentNode(n[0])}}function consumeAllCommentsAndWhitespace(e,o){const t=[];let s=0;for(;;)if(o[s][0]!==n.TokenType.Whitespace){if(o[s][0]!==n.TokenType.Comment)return{advance:s,nodes:t};t.push(new CommentNode(o[s])),s++}else{const e=consumeWhitespace(0,o.slice(s));s+=e.advance,t.push(e.node)}}class TokenNode{type=exports.ComponentValueType.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===exports.ComponentValueType.Token)}}function forEach(e,n,o){if(0===e.length)return;const t=walkerIndexGenerator(e);let s=0;for(;s<e.length;){const r=e[s];let i;if(o&&(i={...o}),!1===n({node:r,parent:{value:e},state:i},s))return!1;if(s=t(e,r,s),-1===s)break}}function walk(e,n,o){0!==e.length&&forEach(e,((o,t)=>!1!==n(o,t)&&((!("walk"in o.node)||!e.includes(o.node)||!1!==o.node.walk(n,o.state))&&void 0)),o)}exports.CommentNode=CommentNode,exports.ContainerNodeBaseClass=ContainerNodeBaseClass,exports.FunctionNode=FunctionNode,exports.SimpleBlockNode=SimpleBlockNode,exports.TokenNode=TokenNode,exports.WhitespaceNode=WhitespaceNode,exports.forEach=forEach,exports.gatherNodeAncestry=function gatherNodeAncestry(e){const n=new Map;return e.walk((e=>{Array.isArray(e.node)?e.node.forEach((o=>{n.set(o,e.parent)})):n.set(e.node,e.parent)})),n},exports.isCommentNode=function isCommentNode(e){return CommentNode.isCommentNode(e)},exports.isFunctionNode=function isFunctionNode(e){return FunctionNode.isFunctionNode(e)},exports.isSimpleBlockNode=function isSimpleBlockNode(e){return SimpleBlockNode.isSimpleBlockNode(e)},exports.isTokenNode=function isTokenNode(e){return TokenNode.isTokenNode(e)},exports.isWhitespaceNode=function isWhitespaceNode(e){return WhitespaceNode.isWhitespaceNode(e)},exports.parseCommaSeparatedListOfComponentValues=function parseCommaSeparatedListOfComponentValues(e,o){const t={onParseError:o?.onParseError??(()=>{})},s=[...e];if(0===e.length)return[];s[s.length-1][0]!==n.TokenType.EOF&&s.push([n.TokenType.EOF,"",s[s.length-1][2],s[s.length-1][3],void 0]);const r=[];let i=[],a=0;for(;;){if(!s[a]||s[a][0]===n.TokenType.EOF)return i.length&&r.push(i),r;if(s[a][0]===n.TokenType.Comma){r.push(i),i=[],a++;continue}const o=consumeComponentValue(t,e.slice(a));i.push(o.node),a+=o.advance}},exports.parseComponentValue=function parseComponentValue(e,o){const t={onParseError:o?.onParseError??(()=>{})},s=[...e];s[s.length-1][0]!==n.TokenType.EOF&&s.push([n.TokenType.EOF,"",s[s.length-1][2],s[s.length-1][3],void 0]);const r=consumeComponentValue(t,s);if(s[Math.min(r.advance,s.length-1)][0]===n.TokenType.EOF)return r.node;t.onParseError(new n.ParseError("Expected EOF after parsing a component value.",e[0][2],e[e.length-1][3],["5.3.9. Parse a component value","Expected EOF"]))},exports.parseListOfComponentValues=function parseListOfComponentValues(e,o){const t={onParseError:o?.onParseError??(()=>{})},s=[...e];s[s.length-1][0]!==n.TokenType.EOF&&s.push([n.TokenType.EOF,"",s[s.length-1][2],s[s.length-1][3],void 0]);const r=[];let i=0;for(;;){if(!s[i]||s[i][0]===n.TokenType.EOF)return r;const e=consumeComponentValue(t,s.slice(i));r.push(e.node),i+=e.advance}},exports.replaceComponentValues=function replaceComponentValues(e,n){for(let o=0;o<e.length;o++){walk(e[o],((e,o)=>{if("number"!=typeof o)return;const t=n(e.node);t&&e.parent.value.splice(o,1,t)}))}return e},exports.sourceIndices=function sourceIndices(e){if(Array.isArray(e)){const n=e[0];if(!n)return[0,0];const o=e[e.length-1]||n;return[sourceIndices(n)[0],sourceIndices(o)[1]]}const n=e.tokens(),o=n[0],t=n[n.length-1];return o&&t?[o[2],t[3]]:[0,0]},exports.stringify=function stringify(e){return e.map((e=>e.map((e=>n.stringify(...e.tokens()))).join(""))).join(",")},exports.walk=walk,exports.walkerIndexGenerator=walkerIndexGenerator;
+"use strict";var e,n=require("@csstools/css-tokenizer");function walkerIndexGenerator(e){let n=e.slice();return(e,o,t)=>{let s=-1;for(let i=n.indexOf(o);i<n.length&&(s=e.indexOf(n[i]),-1===s||s<t);i++);return-1===s||s===t&&o===e[t]&&(s++,s>=e.length)?-1:(n=e.slice(),s)}}function consumeComponentValue(e,o){const t=o[0];if(n.isTokenOpenParen(t)||n.isTokenOpenCurly(t)||n.isTokenOpenSquare(t)){const n=consumeSimpleBlock(e,o);return{advance:n.advance,node:n.node}}if(n.isTokenFunction(t)){const n=consumeFunction(e,o);return{advance:n.advance,node:n.node}}if(n.isTokenWhitespace(t)){const n=consumeWhitespace(e,o);return{advance:n.advance,node:n.node}}if(n.isTokenComment(t)){const n=consumeComment(e,o);return{advance:n.advance,node:n.node}}return{advance:1,node:new TokenNode(t)}}exports.ComponentValueType=void 0,(e=exports.ComponentValueType||(exports.ComponentValueType={})).Function="function",e.SimpleBlock="simple-block",e.Whitespace="whitespace",e.Comment="comment",e.Token="token";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 o=walkerIndexGenerator(this.value);let t=0;for(;t<this.value.length;){const s=this.value[t];let i;if(n&&(i={...n}),!1===e({node:s,parent:this,state:i},t))return!1;if(t=o(this.value,s,t),-1===t)break}}walk(e,n){0!==this.value.length&&this.forEach(((n,o)=>!1!==e(n,o)&&((!("walk"in n.node)||!this.value.includes(n.node)||!1!==n.node.walk(e,n.state))&&void 0)),n)}}class FunctionNode extends ContainerNodeBaseClass{type=exports.ComponentValueType.Function;name;endToken;constructor(e,n,o){super(),this.name=e,this.endToken=n,this.value=o}getName(){return this.name[4].value}normalize(){n.isTokenEOF(this.endToken)&&(this.endToken=[n.TokenType.CloseParen,")",-1,-1,void 0])}tokens(){return n.isTokenEOF(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=>n.isToken(e)?n.stringify(e):e.toString())).join("");return n.stringify(this.name)+e+n.stringify(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===exports.ComponentValueType.Function)}}function consumeFunction(e,o){const t=[];let s=1;for(;;){const i=o[s];if(!i||n.isTokenEOF(i))return e.onParseError(new n.ParseError("Unexpected EOF while consuming a function.",o[0][2],o[o.length-1][3],["5.4.9. Consume a function","Unexpected EOF"])),{advance:o.length,node:new FunctionNode(o[0],i,t)};if(n.isTokenCloseParen(i))return{advance:s+1,node:new FunctionNode(o[0],i,t)};if(n.isTokenWhiteSpaceOrComment(i)){const n=consumeAllCommentsAndWhitespace(e,o.slice(s));s+=n.advance,t.push(...n.nodes);continue}const r=consumeComponentValue(e,o.slice(s));s+=r.advance,t.push(r.node)}}class SimpleBlockNode extends ContainerNodeBaseClass{type=exports.ComponentValueType.SimpleBlock;startToken;endToken;constructor(e,n,o){super(),this.startToken=e,this.endToken=n,this.value=o}normalize(){if(n.isTokenEOF(this.endToken)){const e=n.mirrorVariant(this.startToken);e&&(this.endToken=e)}}tokens(){return n.isTokenEOF(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=>n.isToken(e)?n.stringify(e):e.toString())).join("");return n.stringify(this.startToken)+e+n.stringify(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===exports.ComponentValueType.SimpleBlock)}}function consumeSimpleBlock(e,o){const t=n.mirrorVariantType(o[0][0]);if(!t)throw new Error("Failed to parse, a mirror variant must exist for all block open tokens.");const s=[];let i=1;for(;;){const r=o[i];if(!r||n.isTokenEOF(r))return e.onParseError(new n.ParseError("Unexpected EOF while consuming a simple block.",o[0][2],o[o.length-1][3],["5.4.8. Consume a simple block","Unexpected EOF"])),{advance:o.length,node:new SimpleBlockNode(o[0],r,s)};if(r[0]===t)return{advance:i+1,node:new SimpleBlockNode(o[0],r,s)};if(n.isTokenWhiteSpaceOrComment(r)){const n=consumeAllCommentsAndWhitespace(e,o.slice(i));i+=n.advance,s.push(...n.nodes);continue}const a=consumeComponentValue(e,o.slice(i));i+=a.advance,s.push(a.node)}}class WhitespaceNode{type=exports.ComponentValueType.Whitespace;value;constructor(e){this.value=e}tokens(){return this.value}toString(){return n.stringify(...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===exports.ComponentValueType.Whitespace)}}function consumeWhitespace(e,o){let t=0;for(;;){const e=o[t];if(!n.isTokenWhitespace(e))return{advance:t,node:new WhitespaceNode(o.slice(0,t))};t++}}class CommentNode{type=exports.ComponentValueType.Comment;value;constructor(e){this.value=e}tokens(){return[this.value]}toString(){return n.stringify(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===exports.ComponentValueType.Comment)}}function consumeComment(e,n){return{advance:1,node:new CommentNode(n[0])}}function consumeAllCommentsAndWhitespace(e,o){const t=[];let s=0;for(;;)if(n.isTokenWhitespace(o[s])){const e=consumeWhitespace(0,o.slice(s));s+=e.advance,t.push(e.node)}else{if(!n.isTokenComment(o[s]))return{advance:s,nodes:t};t.push(new CommentNode(o[s])),s++}}class TokenNode{type=exports.ComponentValueType.Token;value;constructor(e){this.value=e}tokens(){return[this.value]}toString(){return this.value[1]}toJSON(){return{type:this.type,tokens:this.tokens()}}isTokenNod(){return TokenNode.isTokenNode(this)}static isTokenNode(e){return!!e&&(e instanceof TokenNode&&e.type===exports.ComponentValueType.Token)}}function forEach(e,n,o){if(0===e.length)return;const t=walkerIndexGenerator(e);let s=0;for(;s<e.length;){const i=e[s];let r;if(o&&(r={...o}),!1===n({node:i,parent:{value:e},state:r},s))return!1;if(s=t(e,i,s),-1===s)break}}function walk(e,n,o){0!==e.length&&forEach(e,((o,t)=>!1!==n(o,t)&&((!("walk"in o.node)||!e.includes(o.node)||!1!==o.node.walk(n,o.state))&&void 0)),o)}exports.CommentNode=CommentNode,exports.ContainerNodeBaseClass=ContainerNodeBaseClass,exports.FunctionNode=FunctionNode,exports.SimpleBlockNode=SimpleBlockNode,exports.TokenNode=TokenNode,exports.WhitespaceNode=WhitespaceNode,exports.forEach=forEach,exports.gatherNodeAncestry=function gatherNodeAncestry(e){const n=new Map;return e.walk((e=>{Array.isArray(e.node)?e.node.forEach((o=>{n.set(o,e.parent)})):n.set(e.node,e.parent)})),n},exports.isCommentNode=function isCommentNode(e){return CommentNode.isCommentNode(e)},exports.isFunctionNode=function isFunctionNode(e){return FunctionNode.isFunctionNode(e)},exports.isSimpleBlockNode=function isSimpleBlockNode(e){return SimpleBlockNode.isSimpleBlockNode(e)},exports.isTokenNode=function isTokenNode(e){return TokenNode.isTokenNode(e)},exports.isWhitespaceNode=function isWhitespaceNode(e){return WhitespaceNode.isWhitespaceNode(e)},exports.parseCommaSeparatedListOfComponentValues=function parseCommaSeparatedListOfComponentValues(e,o){const t={onParseError:o?.onParseError??(()=>{})},s=[...e];if(0===e.length)return[];n.isTokenEOF(s[s.length-1])&&s.push([n.TokenType.EOF,"",s[s.length-1][2],s[s.length-1][3],void 0]);const i=[];let r=[],a=0;for(;;){if(!s[a]||n.isTokenEOF(s[a]))return r.length&&i.push(r),i;if(n.isTokenComma(s[a])){i.push(r),r=[],a++;continue}const o=consumeComponentValue(t,e.slice(a));r.push(o.node),a+=o.advance}},exports.parseComponentValue=function parseComponentValue(e,o){const t={onParseError:o?.onParseError??(()=>{})},s=[...e];n.isTokenEOF(s[s.length-1])&&s.push([n.TokenType.EOF,"",s[s.length-1][2],s[s.length-1][3],void 0]);const i=consumeComponentValue(t,s);if(n.isTokenEOF(s[Math.min(i.advance,s.length-1)]))return i.node;t.onParseError(new n.ParseError("Expected EOF after parsing a component value.",e[0][2],e[e.length-1][3],["5.3.9. Parse a component value","Expected EOF"]))},exports.parseListOfComponentValues=function parseListOfComponentValues(e,o){const t={onParseError:o?.onParseError??(()=>{})},s=[...e];n.isTokenEOF(s[s.length-1])&&s.push([n.TokenType.EOF,"",s[s.length-1][2],s[s.length-1][3],void 0]);const i=[];let r=0;for(;;){if(!s[r]||n.isTokenEOF(s[r]))return i;const e=consumeComponentValue(t,s.slice(r));i.push(e.node),r+=e.advance}},exports.replaceComponentValues=function replaceComponentValues(e,n){for(let o=0;o<e.length;o++){walk(e[o],((e,o)=>{if("number"!=typeof o)return;const t=n(e.node);t&&(Array.isArray(t)?e.parent.value.splice(o,1,...t):e.parent.value.splice(o,1,t))}))}return e},exports.sourceIndices=function sourceIndices(e){if(Array.isArray(e)){const n=e[0];if(!n)return[0,0];const o=e[e.length-1]||n;return[sourceIndices(n)[0],sourceIndices(o)[1]]}const n=e.tokens(),o=n[0],t=n[n.length-1];return o&&t?[o[2],t[3]]:[0,0]},exports.stringify=function stringify(e){return e.map((e=>e.map((e=>n.stringify(...e.tokens()))).join(""))).join(",")},exports.walk=walk,exports.walkerIndexGenerator=walkerIndexGenerator;
diff --git a/node_modules/@csstools/css-parser-algorithms/dist/index.d.ts b/node_modules/@csstools/css-parser-algorithms/dist/index.d.ts
index 9759d057..9889d9ea 100644
--- a/node_modules/@csstools/css-parser-algorithms/dist/index.d.ts
+++ b/node_modules/@csstools/css-parser-algorithms/dist/index.d.ts
@@ -15,7 +15,7 @@
* Parse a string of CSS into a component value:
* ```js
* import { tokenize } from '@csstools/css-tokenizer';
- * import { parseComponentValue } from '@csstools/css-parser';
+ * import { parseComponentValue } from '@csstools/css-parser-algorithms';
*
* const myCSS = `calc(1px * 2)`;
*
@@ -35,15 +35,15 @@
* 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';
+ * import { parseListOfComponentValues } from '@csstools/css-parser-algorithms';
*
- * parseComponentValue(tokenize({ css: `10x 20px` }));
+ * 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';
+ * import { parseCommaSeparatedListOfComponentValues } from '@csstools/css-parser-algorithms';
*
* parseCommaSeparatedListOfComponentValues(tokenize({ css: `20deg, 50%, 30%` }));
* ```
@@ -53,7 +53,7 @@
*
* ```js
* import { tokenize } from '@csstools/css-tokenizer';
- * import { parseComponentValue, isSimpleBlockNode } from '@csstools/css-parser';
+ * import { parseComponentValue, isSimpleBlockNode } from '@csstools/css-parser-algorithms';
*
* const myCSS = `calc(1px * (5 / 2))`;
*
@@ -106,10 +106,7 @@ export declare class CommentNode {
* 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(): {
- type: ComponentValueType;
- tokens: CSSToken[];
- };
+ toJSON(): Record<string, unknown>;
/**
* @internal
*/
@@ -344,14 +341,14 @@ export declare function isWhitespaceNode(x: unknown): x is WhitespaceNode;
* @example
* ```js
* import { tokenize } from '@csstools/css-tokenizer';
- * import { parseCommaSeparatedListOfComponentValues } from '@csstools/css-parser';
+ * import { parseCommaSeparatedListOfComponentValues } from '@csstools/css-parser-algorithms';
*
* parseCommaSeparatedListOfComponentValues(tokenize({ css: `20deg, 50%, 30%` }));
* ```
*/
export declare function parseCommaSeparatedListOfComponentValues(tokens: Array<CSSToken>, options?: {
onParseError?: (error: ParseError) => void;
-}): ComponentValue[][];
+}): Array<Array<ComponentValue>>;
/**
* Parse a single component value.
@@ -359,7 +356,7 @@ export declare function parseCommaSeparatedListOfComponentValues(tokens: Array<C
* @example
* ```js
* import { tokenize } from '@csstools/css-tokenizer';
- * import { parseCommaSeparatedListOfComponentValues } from '@csstools/css-parser';
+ * import { parseCommaSeparatedListOfComponentValues } from '@csstools/css-parser-algorithms';
*
* parseCommaSeparatedListOfComponentValues(tokenize({ css: `10px` }));
* parseCommaSeparatedListOfComponentValues(tokenize({ css: `calc((10px + 1x) * 4)` }));
@@ -375,20 +372,20 @@ export declare function parseComponentValue(tokens: Array<CSSToken>, options?: {
* @example
* ```js
* import { tokenize } from '@csstools/css-tokenizer';
- * import { parseListOfComponentValues } from '@csstools/css-parser';
+ * import { parseListOfComponentValues } from '@csstools/css-parser-algorithms';
*
* parseListOfComponentValues(tokenize({ css: `20deg 30%` }));
* ```
*/
export declare function parseListOfComponentValues(tokens: Array<CSSToken>, options?: {
onParseError?: (error: ParseError) => void;
-}): ComponentValue[];
+}): Array<ComponentValue>;
/**
* 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<Array<ComponentValue>>, replaceWith: (componentValue: ComponentValue) => ComponentValue | void): ComponentValue[][];
+export declare function replaceComponentValues(componentValuesList: Array<Array<ComponentValue>>, replaceWith: (componentValue: ComponentValue) => Array<ComponentValue> | ComponentValue | void): Array<Array<ComponentValue>>;
/**
* A simple block node.
@@ -479,7 +476,7 @@ export declare class TokenNode {
/**
* This is the inverse of parsing from a list of tokens.
*/
- tokens(): Array<CSSToken>;
+ tokens(): [CSSToken];
/**
* Convert the current token to a string.
* This is not a true serialization.
@@ -492,14 +489,11 @@ export declare class TokenNode {
* 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(): {
- type: ComponentValueType;
- tokens: CSSToken[];
- };
+ toJSON(): Record<string, unknown>;
/**
* @internal
*/
- isTokenNode(): this is TokenNode;
+ isTokenNod(): this is TokenNode;
/**
* @internal
*/
@@ -524,7 +518,7 @@ export declare class TokenNode {
* @example
* ```js
* import { tokenize } from '@csstools/css-tokenizer';
- * import { parseListOfComponentValues, isSimpleBlockNode } from '@csstools/css-parser';
+ * import { parseListOfComponentValues, isSimpleBlockNode } from '@csstools/css-parser-algorithms';
*
* const myCSS = `calc(1px * (5 / 2)) 10px`;
*
@@ -590,10 +584,7 @@ export declare class WhitespaceNode {
* 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(): {
- type: ComponentValueType;
- tokens: CSSToken[];
- };
+ toJSON(): Record<string, unknown>;
/**
* @internal
*/
diff --git a/node_modules/@csstools/css-parser-algorithms/dist/index.mjs b/node_modules/@csstools/css-parser-algorithms/dist/index.mjs
index 0032d39c..ecbde0cc 100644
--- a/node_modules/@csstools/css-parser-algorithms/dist/index.mjs
+++ b/node_modules/@csstools/css-parser-algorithms/dist/index.mjs
@@ -1 +1 @@
-import{TokenType as e,isToken as n,stringify as t,mirrorVariant as o,ParseError as s,mirrorVariantType as i}from"@csstools/css-tokenizer";var r;function walkerIndexGenerator(e){let n=e.slice();return(e,t,o)=>{let s=-1;for(let i=n.indexOf(t);i<n.length&&(s=e.indexOf(n[i]),-1===s||s<o);i++);return-1===s||s===o&&t===e[o]&&(s++,s>=e.length)?-1:(n=e.slice(),s)}}function consumeComponentValue(n,t){const o=t[0];if(o[0]===e.OpenParen||o[0]===e.OpenCurly||o[0]===e.OpenSquare){const e=consumeSimpleBlock(n,t);return{advance:e.advance,node:e.node}}if(o[0]===e.Function){const e=consumeFunction(n,t);return{advance:e.advance,node:e.node}}if(o[0]===e.Whitespace){const e=consumeWhitespace(n,t);return{advance:e.advance,node:e.node}}if(o[0]===e.Comment){const e=consumeComment(n,t);return{advance:e.advance,node:e.node}}return{advance:1,node:new TokenNode(o)}}!function(e){e.Function="function",e.SimpleBlock="simple-block",e.Whitespace="whitespace",e.Comment="comment",e.Token="token"}(r||(r={}));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<this.value.length;){const s=this.value[o];let i;if(n&&(i={...n}),!1===e({node:s,parent:this,state:i},o))return!1;if(o=t(this.value,s,o),-1===o)break}}walk(e,n){0!==this.value.length&&this.forEach(((n,t)=>!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=r.Function;name;endToken;constructor(e,n,t){super(),this.name=e,this.endToken=n,this.value=t}getName(){return this.name[4].value}normalize(){this.endToken[0]===e.EOF&&(this.endToken=[e.CloseParen,")",-1,-1,void 0])}tokens(){return this.endToken[0]===e.EOF?[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=>n(e)?t(e):e.toString())).join("");return t(this.name)+e+t(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===r.Function)}}function consumeFunction(n,t){const o=[];let i=1;for(;;){const r=t[i];if(!r||r[0]===e.EOF)return n.onParseError(new s("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],r,o)};if(r[0]===e.CloseParen)return{advance:i+1,node:new FunctionNode(t[0],r,o)};if(r[0]===e.Comment||r[0]===e.Whitespace){const e=consumeAllCommentsAndWhitespace(n,t.slice(i));i+=e.advance,o.push(...e.nodes);continue}const a=consumeComponentValue(n,t.slice(i));i+=a.advance,o.push(a.node)}}class SimpleBlockNode extends ContainerNodeBaseClass{type=r.SimpleBlock;startToken;endToken;constructor(e,n,t){super(),this.startToken=e,this.endToken=n,this.value=t}normalize(){if(this.endToken[0]===e.EOF){const e=o(this.startToken);e&&(this.endToken=e)}}tokens(){return this.endToken[0]===e.EOF?[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=>n(e)?t(e):e.toString())).join("");return t(this.startToken)+e+t(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===r.SimpleBlock)}}function consumeSimpleBlock(n,t){const o=i(t[0][0]);if(!o)throw new Error("Failed to parse, a mirror variant must exist for all block open tokens.");const r=[];let a=1;for(;;){const i=t[a];if(!i||i[0]===e.EOF)return n.onParseError(new s("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],i,r)};if(i[0]===o)return{advance:a+1,node:new SimpleBlockNode(t[0],i,r)};if(i[0]===e.Comment||i[0]===e.Whitespace){const e=consumeAllCommentsAndWhitespace(n,t.slice(a));a+=e.advance,r.push(...e.nodes);continue}const c=consumeComponentValue(n,t.slice(a));a+=c.advance,r.push(c.node)}}class WhitespaceNode{type=r.Whitespace;value;constructor(e){this.value=e}tokens(){return this.value}toString(){return t(...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===r.Whitespace)}}function consumeWhitespace(n,t){let o=0;for(;;){if(t[o][0]!==e.Whitespace)return{advance:o,node:new WhitespaceNode(t.slice(0,o))};o++}}class CommentNode{type=r.Comment;value;constructor(e){this.value=e}tokens(){return[this.value]}toString(){return t(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===r.Comment)}}function consumeComment(e,n){return{advance:1,node:new CommentNode(n[0])}}function consumeAllCommentsAndWhitespace(n,t){const o=[];let s=0;for(;;)if(t[s][0]!==e.Whitespace){if(t[s][0]!==e.Comment)return{advance:s,nodes:o};o.push(new CommentNode(t[s])),s++}else{const e=consumeWhitespace(0,t.slice(s));s+=e.advance,o.push(e.node)}}class TokenNode{type=r.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===r.Token)}}function parseComponentValue(n,t){const o={onParseError:t?.onParseError??(()=>{})},i=[...n];i[i.length-1][0]!==e.EOF&&i.push([e.EOF,"",i[i.length-1][2],i[i.length-1][3],void 0]);const r=consumeComponentValue(o,i);if(i[Math.min(r.advance,i.length-1)][0]===e.EOF)return r.node;o.onParseError(new s("Expected EOF after parsing a component value.",n[0][2],n[n.length-1][3],["5.3.9. Parse a component value","Expected EOF"]))}function parseListOfComponentValues(n,t){const o={onParseError:t?.onParseError??(()=>{})},s=[...n];s[s.length-1][0]!==e.EOF&&s.push([e.EOF,"",s[s.length-1][2],s[s.length-1][3],void 0]);const i=[];let r=0;for(;;){if(!s[r]||s[r][0]===e.EOF)return i;const n=consumeComponentValue(o,s.slice(r));i.push(n.node),r+=n.advance}}function parseCommaSeparatedListOfComponentValues(n,t){const o={onParseError:t?.onParseError??(()=>{})},s=[...n];if(0===n.length)return[];s[s.length-1][0]!==e.EOF&&s.push([e.EOF,"",s[s.length-1][2],s[s.length-1][3],void 0]);const i=[];let r=[],a=0;for(;;){if(!s[a]||s[a][0]===e.EOF)return r.length&&i.push(r),i;if(s[a][0]===e.Comma){i.push(r),r=[],a++;continue}const t=consumeComponentValue(o,n.slice(a));r.push(t.node),a+=t.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<e.length;){const i=e[s];let r;if(t&&(r={...t}),!1===n({node:i,parent:{value:e},state:r},s))return!1;if(s=o(e,i,s),-1===s)break}}function walk(e,n,t){0!==e.length&&forEach(e,((t,o)=>!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<e.length;t++){walk(e[t],((e,t)=>{if("number"!=typeof t)return;const o=n(e.node);o&&e.parent.value.splice(t,1,o)}))}return e}function stringify(e){return e.map((e=>e.map((e=>t(...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 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,r as ComponentValueType,ContainerNodeBaseClass,FunctionNode,SimpleBlockNode,TokenNode,WhitespaceNode,forEach,gatherNodeAncestry,isCommentNode,isFunctionNode,isSimpleBlockNode,isTokenNode,isWhitespaceNode,parseCommaSeparatedListOfComponentValues,parseComponentValue,parseListOfComponentValues,replaceComponentValues,sourceIndices,stringify,walk,walkerIndexGenerator};
+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,ParseError as d,isTokenCloseParen as h,isTokenWhiteSpaceOrComment as p,mirrorVariantType 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<n.length&&(s=e.indexOf(n[i]),-1===s||s<o);i++);return-1===s||s===o&&t===e[o]&&(s++,s>=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<this.value.length;){const s=this.value[o];let i;if(n&&(i={...n}),!1===e({node:s,parent:this,state:i},o))return!1;if(o=t(this.value,s,o),-1===o)break}}walk(e,n){0!==this.value.length&&this.forEach(((n,t)=>!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 d("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(h(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=m(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 d("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)}else{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()}}isTokenNod(){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 d("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<e.length;){const i=e[s];let r;if(t&&(r={...t}),!1===n({node:i,parent:{value:e},state:r},s))return!1;if(s=o(e,i,s),-1===s)break}}function walk(e,n,t){0!==e.length&&forEach(e,((t,o)=>!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<e.length;t++){walk(e[t],((e,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 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,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
index 4494b60f..9d389950 100644
--- a/node_modules/@csstools/css-parser-algorithms/package.json
+++ b/node_modules/@csstools/css-parser-algorithms/package.json
@@ -1,7 +1,7 @@
{
"name": "@csstools/css-parser-algorithms",
"description": "Algorithms to help you parse CSS from an array of tokens.",
- "version": "2.5.0",
+ "version": "2.6.3",
"contributors": [
{
"name": "Antonio Laguna",
@@ -48,12 +48,12 @@
"dist"
],
"peerDependencies": {
- "@csstools/css-tokenizer": "^2.2.3"
+ "@csstools/css-tokenizer": "^2.3.1"
},
"homepage": "https://github.com/csstools/postcss-plugins/tree/main/packages/css-parser-algorithms#readme",
"repository": {
"type": "git",
- "url": "https://github.com/csstools/postcss-plugins.git",
+ "url": "git+https://github.com/csstools/postcss-plugins.git",
"directory": "packages/css-parser-algorithms"
},
"bugs": "https://github.com/csstools/postcss-plugins/issues",
diff --git a/node_modules/@csstools/css-tokenizer/CHANGELOG.md b/node_modules/@csstools/css-tokenizer/CHANGELOG.md
index c13a4a8b..f4ea6bfd 100644
--- a/node_modules/@csstools/css-tokenizer/CHANGELOG.md
+++ b/node_modules/@csstools/css-tokenizer/CHANGELOG.md
@@ -1,21 +1,22 @@
# Changes to CSS Tokenizer
-### 2.2.3
+### 2.3.1
-_December 31, 2023_
+_May 4, 2024_
-- Improve documentation.
+- Fix escaping for the last code point in an ident sequence.
-### 2.2.2
+### 2.3.0
-_December 15, 2023_
+_May 4, 2024_
-- Fix type definitions
+- Add `mutateUnit` helper function
+- Add type guard helpers
-### 2.2.1
+### 2.2.4
-_September 24, 2023_
+_March 13, 2024_
-- Small performance improvements
+- Correctly tokenize negative zero `-0` (for real this time)
[Full CHANGELOG](https://github.com/csstools/postcss-plugins/tree/main/packages/css-tokenizer/CHANGELOG.md)
diff --git a/node_modules/@csstools/css-tokenizer/dist/index.cjs b/node_modules/@csstools/css-tokenizer/dist/index.cjs
index a5f6acbe..e83b1dd2 100644
--- a/node_modules/@csstools/css-tokenizer/dist/index.cjs
+++ b/node_modules/@csstools/css-tokenizer/dist/index.cjs
@@ -1 +1 @@
-"use strict";class ParseError extends Error{sourceStart;sourceEnd;parserState;constructor(e,o,n,r){super(e),this.name="ParseError",this.sourceStart=o,this.sourceEnd=n,this.parserState=r}}class Reader{cursor=0;source="";codePointSource=[];representationIndices=[-1];length=0;representationStart=0;representationEnd=-1;constructor(e){this.source=e;{let o=-1,n="";for(n of e)o+=n.length,this.codePointSource.push(n.codePointAt(0)),this.representationIndices.push(o)}this.length=this.codePointSource.length}advanceCodePoint(e=1){this.cursor=this.cursor+e,this.representationEnd=this.representationIndices[this.cursor]}readCodePoint(e=1){const o=this.codePointSource[this.cursor];return void 0!==o&&(this.cursor=this.cursor+e,this.representationEnd=this.representationIndices[this.cursor],o)}unreadCodePoint(e=1){this.cursor=this.cursor-e,this.representationEnd=this.representationIndices[this.cursor]}resetRepresentation(){this.representationStart=this.representationIndices[this.cursor]+1,this.representationEnd=-1}}var e,o,n;exports.TokenType=void 0,(e=exports.TokenType||(exports.TokenType={})).Comment="comment",e.AtKeyword="at-keyword-token",e.BadString="bad-string-token",e.BadURL="bad-url-token",e.CDC="CDC-token",e.CDO="CDO-token",e.Colon="colon-token",e.Comma="comma-token",e.Delim="delim-token",e.Dimension="dimension-token",e.EOF="EOF-token",e.Function="function-token",e.Hash="hash-token",e.Ident="ident-token",e.Number="number-token",e.Percentage="percentage-token",e.Semicolon="semicolon-token",e.String="string-token",e.URL="url-token",e.Whitespace="whitespace-token",e.OpenParen="(-token",e.CloseParen=")-token",e.OpenSquare="[-token",e.CloseSquare="]-token",e.OpenCurly="{-token",e.CloseCurly="}-token",e.UnicodeRange="unicode-range-token",exports.NumberType=void 0,(o=exports.NumberType||(exports.NumberType={})).Integer="integer",o.Number="number",function(e){e.Unrestricted="unrestricted",e.ID="id"}(n||(n={}));const r=Object.values(exports.TokenType);const t=39,i=42,s=8,c=13,a=9,u=58,d=44,p=64,P=127,S=33,C=12,T=46,l=62,k=45,f=31,m=69,h=101,E=123,v=40,x=91,y=60,g=10,I=11,O=95,U=1114111,w=0,D=35,R=37,A=43,L=34,N=65533,b=92,q=125,W=41,F=93,H=59,V=14,B=47,z=32,K=117,M=85,$=114,J=82,_=108,j=76,Q=63,G=48,X=70;function checkIfFourCodePointsWouldStartCDO(e){return e.codePointSource[e.cursor]===y&&e.codePointSource[e.cursor+1]===S&&e.codePointSource[e.cursor+2]===k&&e.codePointSource[e.cursor+3]===k}function isDigitCodePoint(e){return e>=48&&e<=57}function isUppercaseLetterCodePoint(e){return e>=65&&e<=90}function isLowercaseLetterCodePoint(e){return e>=97&&e<=122}function isHexDigitCodePoint(e){return isDigitCodePoint(e)||e>=97&&e<=102||e>=65&&e<=70}function isLetterCodePoint(e){return isLowercaseLetterCodePoint(e)||isUppercaseLetterCodePoint(e)}function isIdentStartCodePoint(e){return isLetterCodePoint(e)||isNonASCII_IdentCodePoint(e)||e===O}function isIdentCodePoint(e){return isIdentStartCodePoint(e)||isDigitCodePoint(e)||e===k}function isNonASCII_IdentCodePoint(e){return 183===e||8204===e||8205===e||8255===e||8256===e||8204===e||(192<=e&&e<=214||216<=e&&e<=246||248<=e&&e<=893||895<=e&&e<=8191||8304<=e&&e<=8591||11264<=e&&e<=12271||12289<=e&&e<=55295||63744<=e&&e<=64975||65008<=e&&e<=65533||e>=65536)}function isNewLine(e){return 10===e||13===e||12===e}function isWhitespace(e){return 32===e||10===e||9===e||13===e||12===e}function checkIfTwoCodePointsAreAValidEscape(e){return e.codePointSource[e.cursor]===b&&!isNewLine(e.codePointSource[e.cursor+1])}function checkIfThreeCodePointsWouldStartAnIdentSequence(e,o){return o.codePointSource[o.cursor]===k?o.codePointSource[o.cursor+1]===k||(!!isIdentStartCodePoint(o.codePointSource[o.cursor+1])||o.codePointSource[o.cursor+1]===b&&!isNewLine(o.codePointSource[o.cursor+2])):!!isIdentStartCodePoint(o.codePointSource[o.cursor])||checkIfTwoCodePointsAreAValidEscape(o)}function checkIfThreeCodePointsWouldStartANumber(e){return e.codePointSource[e.cursor]===A||e.codePointSource[e.cursor]===k?!!isDigitCodePoint(e.codePointSource[e.cursor+1])||e.codePointSource[e.cursor+1]===T&&isDigitCodePoint(e.codePointSource[e.cursor+2]):e.codePointSource[e.cursor]===T?isDigitCodePoint(e.codePointSource[e.cursor+1]):isDigitCodePoint(e.codePointSource[e.cursor])}function checkIfTwoCodePointsStartAComment(e){return e.codePointSource[e.cursor]===B&&e.codePointSource[e.cursor+1]===i}function checkIfThreeCodePointsWouldStartCDC(e){return e.codePointSource[e.cursor]===k&&e.codePointSource[e.cursor+1]===k&&e.codePointSource[e.cursor+2]===l}function consumeComment(e,o){for(o.advanceCodePoint(2);;){const n=o.readCodePoint();if(!1===n){e.onParseError(new ParseError("Unexpected EOF while consuming a comment.",o.representationStart,o.representationEnd,["4.3.2. Consume comments","Unexpected EOF"]));break}if(n===i&&(void 0!==o.codePointSource[o.cursor]&&o.codePointSource[o.cursor]===B)){o.advanceCodePoint();break}}return[exports.TokenType.Comment,o.source.slice(o.representationStart,o.representationEnd+1),o.representationStart,o.representationEnd,void 0]}function consumeEscapedCodePoint(e,o){const n=o.readCodePoint();if(!1===n)return e.onParseError(new ParseError("Unexpected EOF while consuming an escaped code point.",o.representationStart,o.representationEnd,["4.3.7. Consume an escaped code point","Unexpected EOF"])),N;if(isHexDigitCodePoint(n)){const e=[n];for(;void 0!==o.codePointSource[o.cursor]&&isHexDigitCodePoint(o.codePointSource[o.cursor])&&e.length<6;)e.push(o.codePointSource[o.cursor]),o.advanceCodePoint();isWhitespace(o.codePointSource[o.cursor])&&o.advanceCodePoint();const t=parseInt(String.fromCodePoint(...e),16);return 0===t?N:(r=t)>=55296&&r<=57343||t>U?N:t}var r;return n}function consumeIdentSequence(e,o){const n=[];for(;;)if(isIdentCodePoint(o.codePointSource[o.cursor]))n.push(o.codePointSource[o.cursor]),o.advanceCodePoint();else{if(!checkIfTwoCodePointsAreAValidEscape(o))return n;o.advanceCodePoint(),n.push(consumeEscapedCodePoint(e,o))}}function consumeHashToken(e,o){if(o.advanceCodePoint(),void 0!==o.codePointSource[o.cursor]&&(isIdentCodePoint(o.codePointSource[o.cursor])||checkIfTwoCodePointsAreAValidEscape(o))){let r=n.Unrestricted;checkIfThreeCodePointsWouldStartAnIdentSequence(0,o)&&(r=n.ID);const t=consumeIdentSequence(e,o);return[exports.TokenType.Hash,o.source.slice(o.representationStart,o.representationEnd+1),o.representationStart,o.representationEnd,{value:String.fromCodePoint(...t),type:r}]}return[exports.TokenType.Delim,"#",o.representationStart,o.representationEnd,{value:"#"}]}function consumeNumber(e,o){let n=exports.NumberType.Integer;for(o.codePointSource[o.cursor]!==A&&o.codePointSource[o.cursor]!==k||o.advanceCodePoint();isDigitCodePoint(o.codePointSource[o.cursor]);)o.advanceCodePoint();if(o.codePointSource[o.cursor]===T&&isDigitCodePoint(o.codePointSource[o.cursor+1]))for(o.advanceCodePoint(2),n=exports.NumberType.Number;isDigitCodePoint(o.codePointSource[o.cursor]);)o.advanceCodePoint();if(o.codePointSource[o.cursor]===h||o.codePointSource[o.cursor]===m){if(isDigitCodePoint(o.codePointSource[o.cursor+1]))o.advanceCodePoint(2);else{if(o.codePointSource[o.cursor+1]!==k&&o.codePointSource[o.cursor+1]!==A||!isDigitCodePoint(o.codePointSource[o.cursor+2]))return n;o.advanceCodePoint(3)}for(n=exports.NumberType.Number;isDigitCodePoint(o.codePointSource[o.cursor]);)o.advanceCodePoint()}return n}function consumeNumericToken(e,o){let n;{const e=o.codePointSource[o.cursor];e===k?n="-":e===A&&(n="+")}const r=consumeNumber(0,o),t=parseFloat(o.source.slice(o.representationStart,o.representationEnd+1))||0;if(checkIfThreeCodePointsWouldStartAnIdentSequence(0,o)){const i=consumeIdentSequence(e,o);return[exports.TokenType.Dimension,o.source.slice(o.representationStart,o.representationEnd+1),o.representationStart,o.representationEnd,{value:t,signCharacter:n,type:r,unit:String.fromCodePoint(...i)}]}return o.codePointSource[o.cursor]===R?(o.advanceCodePoint(),[exports.TokenType.Percentage,o.source.slice(o.representationStart,o.representationEnd+1),o.representationStart,o.representationEnd,{value:t,signCharacter:n}]):[exports.TokenType.Number,o.source.slice(o.representationStart,o.representationEnd+1),o.representationStart,o.representationEnd,{value:t,signCharacter:n,type:r}]}function consumeWhiteSpace(e){for(;isWhitespace(e.codePointSource[e.cursor]);)e.advanceCodePoint();return[exports.TokenType.Whitespace,e.source.slice(e.representationStart,e.representationEnd+1),e.representationStart,e.representationEnd,void 0]}function consumeStringToken(e,o){let n="";const r=o.readCodePoint();for(;;){const t=o.readCodePoint();if(!1===t)return e.onParseError(new ParseError("Unexpected EOF while consuming a string token.",o.representationStart,o.representationEnd,["4.3.5. Consume a string token","Unexpected EOF"])),[exports.TokenType.String,o.source.slice(o.representationStart,o.representationEnd+1),o.representationStart,o.representationEnd,{value:n}];if(isNewLine(t))return e.onParseError(new ParseError("Unexpected newline while consuming a string token.",o.representationStart,o.representationEnd,["4.3.5. Consume a string token","Unexpected newline"])),o.unreadCodePoint(),[exports.TokenType.BadString,o.source.slice(o.representationStart,o.representationEnd+1),o.representationStart,o.representationEnd,void 0];if(t===r)return[exports.TokenType.String,o.source.slice(o.representationStart,o.representationEnd+1),o.representationStart,o.representationEnd,{value:n}];if(t!==b)n+=String.fromCodePoint(t);else{if(void 0===o.codePointSource[o.cursor])continue;if(isNewLine(o.codePointSource[o.cursor])){o.advanceCodePoint();continue}n+=String.fromCodePoint(consumeEscapedCodePoint(e,o))}}}function checkIfCodePointsMatchURLIdent(e){return!(3!==e.length||e[0]!==K&&e[0]!==M||e[1]!==$&&e[1]!==J||e[2]!==_&&e[2]!==j)}function consumeBadURL(e,o){for(;;){if(void 0===o.codePointSource[o.cursor])return;if(o.codePointSource[o.cursor]===W)return void o.advanceCodePoint();checkIfTwoCodePointsAreAValidEscape(o)?(o.advanceCodePoint(),consumeEscapedCodePoint(e,o)):o.advanceCodePoint()}}function consumeUrlToken(e,o){for(;isWhitespace(o.codePointSource[o.cursor]);)o.advanceCodePoint();let n="";for(;;){if(void 0===o.codePointSource[o.cursor])return e.onParseError(new ParseError("Unexpected EOF while consuming a url token.",o.representationStart,o.representationEnd,["4.3.6. Consume a url token","Unexpected EOF"])),[exports.TokenType.URL,o.source.slice(o.representationStart,o.representationEnd+1),o.representationStart,o.representationEnd,{value:n}];if(o.codePointSource[o.cursor]===W)return o.advanceCodePoint(),[exports.TokenType.URL,o.source.slice(o.representationStart,o.representationEnd+1),o.representationStart,o.representationEnd,{value:n}];if(isWhitespace(o.codePointSource[o.cursor])){for(o.advanceCodePoint();isWhitespace(o.codePointSource[o.cursor]);)o.advanceCodePoint();return void 0===o.codePointSource[o.cursor]?(e.onParseError(new ParseError("Unexpected EOF while consuming a url token.",o.representationStart,o.representationEnd,["4.3.6. Consume a url token","Consume as much whitespace as possible","Unexpected EOF"])),[exports.TokenType.URL,o.source.slice(o.representationStart,o.representationEnd+1),o.representationStart,o.representationEnd,{value:n}]):o.codePointSource[o.cursor]===W?(o.advanceCodePoint(),[exports.TokenType.URL,o.source.slice(o.representationStart,o.representationEnd+1),o.representationStart,o.representationEnd,{value:n}]):(consumeBadURL(e,o),[exports.TokenType.BadURL,o.source.slice(o.representationStart,o.representationEnd+1),o.representationStart,o.representationEnd,void 0])}if(o.codePointSource[o.cursor]===L||o.codePointSource[o.cursor]===t||o.codePointSource[o.cursor]===v||((r=o.codePointSource[o.cursor])===I||r===P||w<=r&&r<=s||V<=r&&r<=f))return consumeBadURL(e,o),e.onParseError(new ParseError("Unexpected character while consuming a url token.",o.representationStart,o.representationEnd,["4.3.6. Consume a url token","Unexpected U+0022 QUOTATION MARK (\"), U+0027 APOSTROPHE ('), U+0028 LEFT PARENTHESIS (() or non-printable code point"])),[exports.TokenType.BadURL,o.source.slice(o.representationStart,o.representationEnd+1),o.representationStart,o.representationEnd,void 0];if(o.codePointSource[o.cursor]===b){if(checkIfTwoCodePointsAreAValidEscape(o)){o.advanceCodePoint(),n+=String.fromCodePoint(consumeEscapedCodePoint(e,o));continue}return consumeBadURL(e,o),e.onParseError(new ParseError("Invalid escape sequence while consuming a url token.",o.representationStart,o.representationEnd,["4.3.6. Consume a url token","U+005C REVERSE SOLIDUS (\\)","The input stream does not start with a valid escape sequence"])),[exports.TokenType.BadURL,o.source.slice(o.representationStart,o.representationEnd+1),o.representationStart,o.representationEnd,void 0]}n+=String.fromCodePoint(o.codePointSource[o.cursor]),o.advanceCodePoint()}var r}function consumeIdentLikeToken(e,o){const n=consumeIdentSequence(e,o);if(o.codePointSource[o.cursor]!==v)return[exports.TokenType.Ident,o.source.slice(o.representationStart,o.representationEnd+1),o.representationStart,o.representationEnd,{value:String.fromCodePoint(...n)}];if(checkIfCodePointsMatchURLIdent(n)){o.advanceCodePoint();let r=0;for(;;){const e=isWhitespace(o.codePointSource[o.cursor]),i=isWhitespace(o.codePointSource[o.cursor+1]);if(e&&i){r+=1,o.advanceCodePoint(1);continue}const s=e?o.codePointSource[o.cursor+1]:o.codePointSource[o.cursor];if(s===L||s===t)return r>0&&o.unreadCodePoint(r),[exports.TokenType.Function,o.source.slice(o.representationStart,o.representationEnd+1),o.representationStart,o.representationEnd,{value:String.fromCodePoint(...n)}];break}return consumeUrlToken(e,o)}return o.advanceCodePoint(),[exports.TokenType.Function,o.source.slice(o.representationStart,o.representationEnd+1),o.representationStart,o.representationEnd,{value:String.fromCodePoint(...n)}]}function checkIfThreeCodePointsWouldStartAUnicodeRange(e){return!(e.codePointSource[e.cursor]!==K&&e.codePointSource[e.cursor]!==M||e.codePointSource[e.cursor+1]!==A||e.codePointSource[e.cursor+2]!==Q&&!isHexDigitCodePoint(e.codePointSource[e.cursor+2]))}function consumeUnicodeRangeToken(e,o){o.advanceCodePoint(2);const n=[],r=[];for(;void 0!==o.codePointSource[o.cursor]&&n.length<6&&isHexDigitCodePoint(o.codePointSource[o.cursor]);)n.push(o.codePointSource[o.cursor]),o.advanceCodePoint();for(;void 0!==o.codePointSource[o.cursor]&&n.length<6&&o.codePointSource[o.cursor]===Q;)0===r.length&&r.push(...n),n.push(G),r.push(X),o.advanceCodePoint();if(!r.length&&o.codePointSource[o.cursor]===k&&isHexDigitCodePoint(o.codePointSource[o.cursor+1]))for(o.advanceCodePoint();void 0!==o.codePointSource[o.cursor]&&r.length<6&&isHexDigitCodePoint(o.codePointSource[o.cursor]);)r.push(o.codePointSource[o.cursor]),o.advanceCodePoint();if(!r.length){const e=parseInt(String.fromCodePoint(...n),16);return[exports.TokenType.UnicodeRange,o.source.slice(o.representationStart,o.representationEnd+1),o.representationStart,o.representationEnd,{startOfRange:e,endOfRange:e}]}const t=parseInt(String.fromCodePoint(...n),16),i=parseInt(String.fromCodePoint(...r),16);return[exports.TokenType.UnicodeRange,o.source.slice(o.representationStart,o.representationEnd+1),o.representationStart,o.representationEnd,{startOfRange:t,endOfRange:i}]}function tokenizer(e,o){const n=e.css.valueOf(),r=e.unicodeRangesAllowed??!1,i=new Reader(n),s={onParseError:o?.onParseError??noop};return{nextToken:function nextToken(){i.resetRepresentation();const e=i.codePointSource[i.cursor];if(void 0===e)return[exports.TokenType.EOF,"",-1,-1,void 0];if(e===B&&checkIfTwoCodePointsStartAComment(i))return consumeComment(s,i);if(r&&(e===K||e===M)&&checkIfThreeCodePointsWouldStartAUnicodeRange(i))return consumeUnicodeRangeToken(0,i);if(isIdentStartCodePoint(e))return consumeIdentLikeToken(s,i);if(isDigitCodePoint(e))return consumeNumericToken(s,i);switch(e){case d:return i.advanceCodePoint(),[exports.TokenType.Comma,",",i.representationStart,i.representationEnd,void 0];case u:return i.advanceCodePoint(),[exports.TokenType.Colon,":",i.representationStart,i.representationEnd,void 0];case H:return i.advanceCodePoint(),[exports.TokenType.Semicolon,";",i.representationStart,i.representationEnd,void 0];case v:return i.advanceCodePoint(),[exports.TokenType.OpenParen,"(",i.representationStart,i.representationEnd,void 0];case W:return i.advanceCodePoint(),[exports.TokenType.CloseParen,")",i.representationStart,i.representationEnd,void 0];case x:return i.advanceCodePoint(),[exports.TokenType.OpenSquare,"[",i.representationStart,i.representationEnd,void 0];case F:return i.advanceCodePoint(),[exports.TokenType.CloseSquare,"]",i.representationStart,i.representationEnd,void 0];case E:return i.advanceCodePoint(),[exports.TokenType.OpenCurly,"{",i.representationStart,i.representationEnd,void 0];case q:return i.advanceCodePoint(),[exports.TokenType.CloseCurly,"}",i.representationStart,i.representationEnd,void 0];case t:case L:return consumeStringToken(s,i);case D:return consumeHashToken(s,i);case A:case T:return checkIfThreeCodePointsWouldStartANumber(i)?consumeNumericToken(s,i):(i.advanceCodePoint(),[exports.TokenType.Delim,i.source[i.representationStart],i.representationStart,i.representationEnd,{value:i.source[i.representationStart]}]);case g:case c:case C:case a:case z:return consumeWhiteSpace(i);case k:return checkIfThreeCodePointsWouldStartANumber(i)?consumeNumericToken(s,i):checkIfThreeCodePointsWouldStartCDC(i)?(i.advanceCodePoint(3),[exports.TokenType.CDC,"--\x3e",i.representationStart,i.representationEnd,void 0]):checkIfThreeCodePointsWouldStartAnIdentSequence(0,i)?consumeIdentLikeToken(s,i):(i.advanceCodePoint(),[exports.TokenType.Delim,"-",i.representationStart,i.representationEnd,{value:"-"}]);case y:return checkIfFourCodePointsWouldStartCDO(i)?(i.advanceCodePoint(4),[exports.TokenType.CDO,"\x3c!--",i.representationStart,i.representationEnd,void 0]):(i.advanceCodePoint(),[exports.TokenType.Delim,"<",i.representationStart,i.representationEnd,{value:"<"}]);case p:if(i.advanceCodePoint(),checkIfThreeCodePointsWouldStartAnIdentSequence(0,i)){const e=consumeIdentSequence(s,i);return[exports.TokenType.AtKeyword,i.source.slice(i.representationStart,i.representationEnd+1),i.representationStart,i.representationEnd,{value:String.fromCodePoint(...e)}]}return[exports.TokenType.Delim,"@",i.representationStart,i.representationEnd,{value:"@"}];case b:return checkIfTwoCodePointsAreAValidEscape(i)?consumeIdentLikeToken(s,i):(i.advanceCodePoint(),s.onParseError(new ParseError('Invalid escape sequence after "\\"',i.representationStart,i.representationEnd,["4.3.1. Consume a token","U+005C REVERSE SOLIDUS (\\)","The input stream does not start with a valid escape sequence"])),[exports.TokenType.Delim,"\\",i.representationStart,i.representationEnd,{value:"\\"}])}return i.advanceCodePoint(),[exports.TokenType.Delim,i.source[i.representationStart],i.representationStart,i.representationEnd,{value:i.source[i.representationStart]}]},endOfFile:function endOfFile(){return void 0===i.codePointSource[i.cursor]}}}function noop(){}exports.ParseError=ParseError,exports.Reader=Reader,exports.cloneTokens=function cloneTokens(e){return"undefined"!=typeof globalThis&&"structuredClone"in globalThis?structuredClone(e):JSON.parse(JSON.stringify(e))},exports.isToken=function isToken(e){return!!Array.isArray(e)&&(!(e.length<4)&&(!!r.includes(e[0])&&("string"==typeof e[1]&&("number"==typeof e[2]&&"number"==typeof e[3]))))},exports.mirrorVariant=function mirrorVariant(e){switch(e[0]){case exports.TokenType.OpenParen:return[exports.TokenType.CloseParen,")",-1,-1,void 0];case exports.TokenType.CloseParen:return[exports.TokenType.OpenParen,"(",-1,-1,void 0];case exports.TokenType.OpenCurly:return[exports.TokenType.CloseCurly,"}",-1,-1,void 0];case exports.TokenType.CloseCurly:return[exports.TokenType.OpenCurly,"{",-1,-1,void 0];case exports.TokenType.OpenSquare:return[exports.TokenType.CloseSquare,"]",-1,-1,void 0];case exports.TokenType.CloseSquare:return[exports.TokenType.OpenSquare,"[",-1,-1,void 0];default:return null}},exports.mirrorVariantType=function mirrorVariantType(e){switch(e){case exports.TokenType.OpenParen:return exports.TokenType.CloseParen;case exports.TokenType.CloseParen:return exports.TokenType.OpenParen;case exports.TokenType.OpenCurly:return exports.TokenType.CloseCurly;case exports.TokenType.CloseCurly:return exports.TokenType.OpenCurly;case exports.TokenType.OpenSquare:return exports.TokenType.CloseSquare;case exports.TokenType.CloseSquare:return exports.TokenType.OpenSquare;default:return null}},exports.mutateIdent=function mutateIdent(e,o){let n="";const r=[];for(const e of o)r.push(e.codePointAt(0));let t=0;r[0]===k&&r[1]===k?(n="--",t=2):r[0]===k&&r[1]?(n="-",t=2,isIdentStartCodePoint(r[1])?n+=o[1]:n+=`\\${r[1].toString(16)} `):isIdentStartCodePoint(r[0])?(n=o[0],t=1):(n=`\\${r[0].toString(16)} `,t=1);for(let e=t;e<r.length;e++)isIdentCodePoint(r[e])?n+=o[e]:n+=`\\${r[e].toString(16)} `;e[1]=n,e[4].value=o},exports.stringify=function stringify(...e){let o="";for(let n=0;n<e.length;n++)o+=e[n][1];return o},exports.tokenize=function tokenize(e,o){const n=tokenizer(e,o),r=[];{for(;!n.endOfFile();){const e=n.nextToken();e&&r.push(e)}const e=n.nextToken();e&&r.push(e)}return r},exports.tokenizer=tokenizer;
+"use strict";class ParseError extends Error{sourceStart;sourceEnd;parserState;constructor(e,o,n,r){super(e),this.name="ParseError",this.sourceStart=o,this.sourceEnd=n,this.parserState=r}}class Reader{cursor=0;source="";codePointSource=[];representationIndices=[-1];length=0;representationStart=0;representationEnd=-1;constructor(e){this.source=e;{let o=-1,n="";for(n of e)o+=n.length,this.codePointSource.push(n.codePointAt(0)),this.representationIndices.push(o)}this.length=this.codePointSource.length}advanceCodePoint(e=1){this.cursor=this.cursor+e,this.representationEnd=this.representationIndices[this.cursor]}readCodePoint(e=1){const o=this.codePointSource[this.cursor];return void 0!==o&&(this.cursor=this.cursor+e,this.representationEnd=this.representationIndices[this.cursor],o)}unreadCodePoint(e=1){this.cursor=this.cursor-e,this.representationEnd=this.representationIndices[this.cursor]}resetRepresentation(){this.representationStart=this.representationIndices[this.cursor]+1,this.representationEnd=-1}}const e=39,o=42,n=8,r=13,t=9,i=58,s=44,c=64,a=127,u=33,d=12,p=46,T=62,P=45,S=31,C=69,k=101,l=123,f=40,x=91,m=60,h=10,y=11,E=95,v=1114111,g=0,I=35,O=37,U=43,D=34,w=65533,R=92,A=125,L=41,N=93,b=59,q=14,W=47,F=32,H=117,B=85,V=114,z=82,K=108,M=76,$=63,J=48,_=70;function checkIfFourCodePointsWouldStartCDO(e){return e.codePointSource[e.cursor]===m&&e.codePointSource[e.cursor+1]===u&&e.codePointSource[e.cursor+2]===P&&e.codePointSource[e.cursor+3]===P}function isDigitCodePoint(e){return e>=48&&e<=57}function isUppercaseLetterCodePoint(e){return e>=65&&e<=90}function isLowercaseLetterCodePoint(e){return e>=97&&e<=122}function isHexDigitCodePoint(e){return isDigitCodePoint(e)||e>=97&&e<=102||e>=65&&e<=70}function isLetterCodePoint(e){return isLowercaseLetterCodePoint(e)||isUppercaseLetterCodePoint(e)}function isIdentStartCodePoint(e){return isLetterCodePoint(e)||isNonASCII_IdentCodePoint(e)||e===E}function isIdentCodePoint(e){return isIdentStartCodePoint(e)||isDigitCodePoint(e)||e===P}function isNonASCII_IdentCodePoint(e){return 183===e||8204===e||8205===e||8255===e||8256===e||8204===e||(192<=e&&e<=214||216<=e&&e<=246||248<=e&&e<=893||895<=e&&e<=8191||8304<=e&&e<=8591||11264<=e&&e<=12271||12289<=e&&e<=55295||63744<=e&&e<=64975||65008<=e&&e<=65533||e>=65536)}function isNewLine(e){return 10===e||13===e||12===e}function isWhitespace(e){return 32===e||10===e||9===e||13===e||12===e}function checkIfTwoCodePointsAreAValidEscape(e){return e.codePointSource[e.cursor]===R&&!isNewLine(e.codePointSource[e.cursor+1])}function checkIfThreeCodePointsWouldStartAnIdentSequence(e,o){return o.codePointSource[o.cursor]===P?o.codePointSource[o.cursor+1]===P||(!!isIdentStartCodePoint(o.codePointSource[o.cursor+1])||o.codePointSource[o.cursor+1]===R&&!isNewLine(o.codePointSource[o.cursor+2])):!!isIdentStartCodePoint(o.codePointSource[o.cursor])||checkIfTwoCodePointsAreAValidEscape(o)}function checkIfThreeCodePointsWouldStartANumber(e){return e.codePointSource[e.cursor]===U||e.codePointSource[e.cursor]===P?!!isDigitCodePoint(e.codePointSource[e.cursor+1])||e.codePointSource[e.cursor+1]===p&&isDigitCodePoint(e.codePointSource[e.cursor+2]):e.codePointSource[e.cursor]===p?isDigitCodePoint(e.codePointSource[e.cursor+1]):isDigitCodePoint(e.codePointSource[e.cursor])}function checkIfTwoCodePointsStartAComment(e){return e.codePointSource[e.cursor]===W&&e.codePointSource[e.cursor+1]===o}function checkIfThreeCodePointsWouldStartCDC(e){return e.codePointSource[e.cursor]===P&&e.codePointSource[e.cursor+1]===P&&e.codePointSource[e.cursor+2]===T}var j,Q,G;function consumeComment(e,n){for(n.advanceCodePoint(2);;){const r=n.readCodePoint();if(!1===r){e.onParseError(new ParseError("Unexpected EOF while consuming a comment.",n.representationStart,n.representationEnd,["4.3.2. Consume comments","Unexpected EOF"]));break}if(r===o&&(void 0!==n.codePointSource[n.cursor]&&n.codePointSource[n.cursor]===W)){n.advanceCodePoint();break}}return[exports.TokenType.Comment,n.source.slice(n.representationStart,n.representationEnd+1),n.representationStart,n.representationEnd,void 0]}function consumeEscapedCodePoint(e,o){const n=o.readCodePoint();if(!1===n)return e.onParseError(new ParseError("Unexpected EOF while consuming an escaped code point.",o.representationStart,o.representationEnd,["4.3.7. Consume an escaped code point","Unexpected EOF"])),w;if(isHexDigitCodePoint(n)){const e=[n];for(;void 0!==o.codePointSource[o.cursor]&&isHexDigitCodePoint(o.codePointSource[o.cursor])&&e.length<6;)e.push(o.codePointSource[o.cursor]),o.advanceCodePoint();isWhitespace(o.codePointSource[o.cursor])&&o.advanceCodePoint();const t=parseInt(String.fromCodePoint(...e),16);return 0===t?w:(r=t)>=55296&&r<=57343||t>v?w:t}var r;return n}function consumeIdentSequence(e,o){const n=[];for(;;)if(isIdentCodePoint(o.codePointSource[o.cursor]))n.push(o.codePointSource[o.cursor]),o.advanceCodePoint();else{if(!checkIfTwoCodePointsAreAValidEscape(o))return n;o.advanceCodePoint(),n.push(consumeEscapedCodePoint(e,o))}}function consumeHashToken(e,o){if(o.advanceCodePoint(),void 0!==o.codePointSource[o.cursor]&&(isIdentCodePoint(o.codePointSource[o.cursor])||checkIfTwoCodePointsAreAValidEscape(o))){let n=exports.HashType.Unrestricted;checkIfThreeCodePointsWouldStartAnIdentSequence(0,o)&&(n=exports.HashType.ID);const r=consumeIdentSequence(e,o);return[exports.TokenType.Hash,o.source.slice(o.representationStart,o.representationEnd+1),o.representationStart,o.representationEnd,{value:String.fromCodePoint(...r),type:n}]}return[exports.TokenType.Delim,"#",o.representationStart,o.representationEnd,{value:"#"}]}function consumeNumber(e,o){let n=exports.NumberType.Integer;for(o.codePointSource[o.cursor]!==U&&o.codePointSource[o.cursor]!==P||o.advanceCodePoint();isDigitCodePoint(o.codePointSource[o.cursor]);)o.advanceCodePoint();if(o.codePointSource[o.cursor]===p&&isDigitCodePoint(o.codePointSource[o.cursor+1]))for(o.advanceCodePoint(2),n=exports.NumberType.Number;isDigitCodePoint(o.codePointSource[o.cursor]);)o.advanceCodePoint();if(o.codePointSource[o.cursor]===k||o.codePointSource[o.cursor]===C){if(isDigitCodePoint(o.codePointSource[o.cursor+1]))o.advanceCodePoint(2);else{if(o.codePointSource[o.cursor+1]!==P&&o.codePointSource[o.cursor+1]!==U||!isDigitCodePoint(o.codePointSource[o.cursor+2]))return n;o.advanceCodePoint(3)}for(n=exports.NumberType.Number;isDigitCodePoint(o.codePointSource[o.cursor]);)o.advanceCodePoint()}return n}function consumeNumericToken(e,o){let n;{const e=o.codePointSource[o.cursor];e===P?n="-":e===U&&(n="+")}const r=consumeNumber(0,o),t=parseFloat(o.source.slice(o.representationStart,o.representationEnd+1));if(checkIfThreeCodePointsWouldStartAnIdentSequence(0,o)){const i=consumeIdentSequence(e,o);return[exports.TokenType.Dimension,o.source.slice(o.representationStart,o.representationEnd+1),o.representationStart,o.representationEnd,{value:t,signCharacter:n,type:r,unit:String.fromCodePoint(...i)}]}return o.codePointSource[o.cursor]===O?(o.advanceCodePoint(),[exports.TokenType.Percentage,o.source.slice(o.representationStart,o.representationEnd+1),o.representationStart,o.representationEnd,{value:t,signCharacter:n}]):[exports.TokenType.Number,o.source.slice(o.representationStart,o.representationEnd+1),o.representationStart,o.representationEnd,{value:t,signCharacter:n,type:r}]}function consumeWhiteSpace(e){for(;isWhitespace(e.codePointSource[e.cursor]);)e.advanceCodePoint();return[exports.TokenType.Whitespace,e.source.slice(e.representationStart,e.representationEnd+1),e.representationStart,e.representationEnd,void 0]}function consumeStringToken(e,o){let n="";const r=o.readCodePoint();for(;;){const t=o.readCodePoint();if(!1===t)return e.onParseError(new ParseError("Unexpected EOF while consuming a string token.",o.representationStart,o.representationEnd,["4.3.5. Consume a string token","Unexpected EOF"])),[exports.TokenType.String,o.source.slice(o.representationStart,o.representationEnd+1),o.representationStart,o.representationEnd,{value:n}];if(isNewLine(t))return e.onParseError(new ParseError("Unexpected newline while consuming a string token.",o.representationStart,o.representationEnd,["4.3.5. Consume a string token","Unexpected newline"])),o.unreadCodePoint(),[exports.TokenType.BadString,o.source.slice(o.representationStart,o.representationEnd+1),o.representationStart,o.representationEnd,void 0];if(t===r)return[exports.TokenType.String,o.source.slice(o.representationStart,o.representationEnd+1),o.representationStart,o.representationEnd,{value:n}];if(t!==R)n+=String.fromCodePoint(t);else{if(void 0===o.codePointSource[o.cursor])continue;if(isNewLine(o.codePointSource[o.cursor])){o.advanceCodePoint();continue}n+=String.fromCodePoint(consumeEscapedCodePoint(e,o))}}}function checkIfCodePointsMatchURLIdent(e){return!(3!==e.length||e[0]!==H&&e[0]!==B||e[1]!==V&&e[1]!==z||e[2]!==K&&e[2]!==M)}function consumeBadURL(e,o){for(;;){if(void 0===o.codePointSource[o.cursor])return;if(o.codePointSource[o.cursor]===L)return void o.advanceCodePoint();checkIfTwoCodePointsAreAValidEscape(o)?(o.advanceCodePoint(),consumeEscapedCodePoint(e,o)):o.advanceCodePoint()}}function consumeUrlToken(o,r){for(;isWhitespace(r.codePointSource[r.cursor]);)r.advanceCodePoint();let t="";for(;;){if(void 0===r.codePointSource[r.cursor])return o.onParseError(new ParseError("Unexpected EOF while consuming a url token.",r.representationStart,r.representationEnd,["4.3.6. Consume a url token","Unexpected EOF"])),[exports.TokenType.URL,r.source.slice(r.representationStart,r.representationEnd+1),r.representationStart,r.representationEnd,{value:t}];if(r.codePointSource[r.cursor]===L)return r.advanceCodePoint(),[exports.TokenType.URL,r.source.slice(r.representationStart,r.representationEnd+1),r.representationStart,r.representationEnd,{value:t}];if(isWhitespace(r.codePointSource[r.cursor])){for(r.advanceCodePoint();isWhitespace(r.codePointSource[r.cursor]);)r.advanceCodePoint();return void 0===r.codePointSource[r.cursor]?(o.onParseError(new ParseError("Unexpected EOF while consuming a url token.",r.representationStart,r.representationEnd,["4.3.6. Consume a url token","Consume as much whitespace as possible","Unexpected EOF"])),[exports.TokenType.URL,r.source.slice(r.representationStart,r.representationEnd+1),r.representationStart,r.representationEnd,{value:t}]):r.codePointSource[r.cursor]===L?(r.advanceCodePoint(),[exports.TokenType.URL,r.source.slice(r.representationStart,r.representationEnd+1),r.representationStart,r.representationEnd,{value:t}]):(consumeBadURL(o,r),[exports.TokenType.BadURL,r.source.slice(r.representationStart,r.representationEnd+1),r.representationStart,r.representationEnd,void 0])}if(r.codePointSource[r.cursor]===D||r.codePointSource[r.cursor]===e||r.codePointSource[r.cursor]===f||((i=r.codePointSource[r.cursor])===y||i===a||g<=i&&i<=n||q<=i&&i<=S))return consumeBadURL(o,r),o.onParseError(new ParseError("Unexpected character while consuming a url token.",r.representationStart,r.representationEnd,["4.3.6. Consume a url token","Unexpected U+0022 QUOTATION MARK (\"), U+0027 APOSTROPHE ('), U+0028 LEFT PARENTHESIS (() or non-printable code point"])),[exports.TokenType.BadURL,r.source.slice(r.representationStart,r.representationEnd+1),r.representationStart,r.representationEnd,void 0];if(r.codePointSource[r.cursor]===R){if(checkIfTwoCodePointsAreAValidEscape(r)){r.advanceCodePoint(),t+=String.fromCodePoint(consumeEscapedCodePoint(o,r));continue}return consumeBadURL(o,r),o.onParseError(new ParseError("Invalid escape sequence while consuming a url token.",r.representationStart,r.representationEnd,["4.3.6. Consume a url token","U+005C REVERSE SOLIDUS (\\)","The input stream does not start with a valid escape sequence"])),[exports.TokenType.BadURL,r.source.slice(r.representationStart,r.representationEnd+1),r.representationStart,r.representationEnd,void 0]}t+=String.fromCodePoint(r.codePointSource[r.cursor]),r.advanceCodePoint()}var i}function consumeIdentLikeToken(o,n){const r=consumeIdentSequence(o,n);if(n.codePointSource[n.cursor]!==f)return[exports.TokenType.Ident,n.source.slice(n.representationStart,n.representationEnd+1),n.representationStart,n.representationEnd,{value:String.fromCodePoint(...r)}];if(checkIfCodePointsMatchURLIdent(r)){n.advanceCodePoint();let t=0;for(;;){const o=isWhitespace(n.codePointSource[n.cursor]),i=isWhitespace(n.codePointSource[n.cursor+1]);if(o&&i){t+=1,n.advanceCodePoint(1);continue}const s=o?n.codePointSource[n.cursor+1]:n.codePointSource[n.cursor];if(s===D||s===e)return t>0&&n.unreadCodePoint(t),[exports.TokenType.Function,n.source.slice(n.representationStart,n.representationEnd+1),n.representationStart,n.representationEnd,{value:String.fromCodePoint(...r)}];break}return consumeUrlToken(o,n)}return n.advanceCodePoint(),[exports.TokenType.Function,n.source.slice(n.representationStart,n.representationEnd+1),n.representationStart,n.representationEnd,{value:String.fromCodePoint(...r)}]}function checkIfThreeCodePointsWouldStartAUnicodeRange(e){return!(e.codePointSource[e.cursor]!==H&&e.codePointSource[e.cursor]!==B||e.codePointSource[e.cursor+1]!==U||e.codePointSource[e.cursor+2]!==$&&!isHexDigitCodePoint(e.codePointSource[e.cursor+2]))}function consumeUnicodeRangeToken(e,o){o.advanceCodePoint(2);const n=[],r=[];for(;void 0!==o.codePointSource[o.cursor]&&n.length<6&&isHexDigitCodePoint(o.codePointSource[o.cursor]);)n.push(o.codePointSource[o.cursor]),o.advanceCodePoint();for(;void 0!==o.codePointSource[o.cursor]&&n.length<6&&o.codePointSource[o.cursor]===$;)0===r.length&&r.push(...n),n.push(J),r.push(_),o.advanceCodePoint();if(!r.length&&o.codePointSource[o.cursor]===P&&isHexDigitCodePoint(o.codePointSource[o.cursor+1]))for(o.advanceCodePoint();void 0!==o.codePointSource[o.cursor]&&r.length<6&&isHexDigitCodePoint(o.codePointSource[o.cursor]);)r.push(o.codePointSource[o.cursor]),o.advanceCodePoint();if(!r.length){const e=parseInt(String.fromCodePoint(...n),16);return[exports.TokenType.UnicodeRange,o.source.slice(o.representationStart,o.representationEnd+1),o.representationStart,o.representationEnd,{startOfRange:e,endOfRange:e}]}const t=parseInt(String.fromCodePoint(...n),16),i=parseInt(String.fromCodePoint(...r),16);return[exports.TokenType.UnicodeRange,o.source.slice(o.representationStart,o.representationEnd+1),o.representationStart,o.representationEnd,{startOfRange:t,endOfRange:i}]}function tokenizer(o,n){const a=o.css.valueOf(),u=o.unicodeRangesAllowed??!1,T=new Reader(a),S={onParseError:n?.onParseError??noop};return{nextToken:function nextToken(){T.resetRepresentation();const o=T.codePointSource[T.cursor];if(void 0===o)return[exports.TokenType.EOF,"",-1,-1,void 0];if(o===W&&checkIfTwoCodePointsStartAComment(T))return consumeComment(S,T);if(u&&(o===H||o===B)&&checkIfThreeCodePointsWouldStartAUnicodeRange(T))return consumeUnicodeRangeToken(0,T);if(isIdentStartCodePoint(o))return consumeIdentLikeToken(S,T);if(isDigitCodePoint(o))return consumeNumericToken(S,T);switch(o){case s:return T.advanceCodePoint(),[exports.TokenType.Comma,",",T.representationStart,T.representationEnd,void 0];case i:return T.advanceCodePoint(),[exports.TokenType.Colon,":",T.representationStart,T.representationEnd,void 0];case b:return T.advanceCodePoint(),[exports.TokenType.Semicolon,";",T.representationStart,T.representationEnd,void 0];case f:return T.advanceCodePoint(),[exports.TokenType.OpenParen,"(",T.representationStart,T.representationEnd,void 0];case L:return T.advanceCodePoint(),[exports.TokenType.CloseParen,")",T.representationStart,T.representationEnd,void 0];case x:return T.advanceCodePoint(),[exports.TokenType.OpenSquare,"[",T.representationStart,T.representationEnd,void 0];case N:return T.advanceCodePoint(),[exports.TokenType.CloseSquare,"]",T.representationStart,T.representationEnd,void 0];case l:return T.advanceCodePoint(),[exports.TokenType.OpenCurly,"{",T.representationStart,T.representationEnd,void 0];case A:return T.advanceCodePoint(),[exports.TokenType.CloseCurly,"}",T.representationStart,T.representationEnd,void 0];case e:case D:return consumeStringToken(S,T);case I:return consumeHashToken(S,T);case U:case p:return checkIfThreeCodePointsWouldStartANumber(T)?consumeNumericToken(S,T):(T.advanceCodePoint(),[exports.TokenType.Delim,T.source[T.representationStart],T.representationStart,T.representationEnd,{value:T.source[T.representationStart]}]);case h:case r:case d:case t:case F:return consumeWhiteSpace(T);case P:return checkIfThreeCodePointsWouldStartANumber(T)?consumeNumericToken(S,T):checkIfThreeCodePointsWouldStartCDC(T)?(T.advanceCodePoint(3),[exports.TokenType.CDC,"--\x3e",T.representationStart,T.representationEnd,void 0]):checkIfThreeCodePointsWouldStartAnIdentSequence(0,T)?consumeIdentLikeToken(S,T):(T.advanceCodePoint(),[exports.TokenType.Delim,"-",T.representationStart,T.representationEnd,{value:"-"}]);case m:return checkIfFourCodePointsWouldStartCDO(T)?(T.advanceCodePoint(4),[exports.TokenType.CDO,"\x3c!--",T.representationStart,T.representationEnd,void 0]):(T.advanceCodePoint(),[exports.TokenType.Delim,"<",T.representationStart,T.representationEnd,{value:"<"}]);case c:if(T.advanceCodePoint(),checkIfThreeCodePointsWouldStartAnIdentSequence(0,T)){const e=consumeIdentSequence(S,T);return[exports.TokenType.AtKeyword,T.source.slice(T.representationStart,T.representationEnd+1),T.representationStart,T.representationEnd,{value:String.fromCodePoint(...e)}]}return[exports.TokenType.Delim,"@",T.representationStart,T.representationEnd,{value:"@"}];case R:return checkIfTwoCodePointsAreAValidEscape(T)?consumeIdentLikeToken(S,T):(T.advanceCodePoint(),S.onParseError(new ParseError('Invalid escape sequence after "\\"',T.representationStart,T.representationEnd,["4.3.1. Consume a token","U+005C REVERSE SOLIDUS (\\)","The input stream does not start with a valid escape sequence"])),[exports.TokenType.Delim,"\\",T.representationStart,T.representationEnd,{value:"\\"}])}return T.advanceCodePoint(),[exports.TokenType.Delim,T.source[T.representationStart],T.representationStart,T.representationEnd,{value:T.source[T.representationStart]}]},endOfFile:function endOfFile(){return void 0===T.codePointSource[T.cursor]}}}function noop(){}function ensureThatValueRoundTripsAsIdent(e){let o=0;e[0]===P&&e[1]===P?o=2:e[0]===P&&e[1]?(o=2,isIdentStartCodePoint(e[1])||(o+=insertEscapedCodePoint(e,1,e[1]))):isIdentStartCodePoint(e[0])?o=1:(o=1,o+=insertEscapedCodePoint(e,0,e[0]));for(let n=o;n<e.length;n++)isIdentCodePoint(e[n])||(n+=insertEscapedCodePoint(e,n,e[n]));return e}function insertEscapedCodePoint(e,o,n){const r=n.toString(16),t=[];for(const e of r)t.push(e.codePointAt(0));const i=e[o+1];return o===e.length-1||i&&isHexDigitCodePoint(i)?(e.splice(o,1,92,...t,32),1+t.length):(e.splice(o,1,92,...t),t.length)}exports.TokenType=void 0,(j=exports.TokenType||(exports.TokenType={})).Comment="comment",j.AtKeyword="at-keyword-token",j.BadString="bad-string-token",j.BadURL="bad-url-token",j.CDC="CDC-token",j.CDO="CDO-token",j.Colon="colon-token",j.Comma="comma-token",j.Delim="delim-token",j.Dimension="dimension-token",j.EOF="EOF-token",j.Function="function-token",j.Hash="hash-token",j.Ident="ident-token",j.Number="number-token",j.Percentage="percentage-token",j.Semicolon="semicolon-token",j.String="string-token",j.URL="url-token",j.Whitespace="whitespace-token",j.OpenParen="(-token",j.CloseParen=")-token",j.OpenSquare="[-token",j.CloseSquare="]-token",j.OpenCurly="{-token",j.CloseCurly="}-token",j.UnicodeRange="unicode-range-token",exports.NumberType=void 0,(Q=exports.NumberType||(exports.NumberType={})).Integer="integer",Q.Number="number",exports.HashType=void 0,(G=exports.HashType||(exports.HashType={})).Unrestricted="unrestricted",G.ID="id";const X=Object.values(exports.TokenType);exports.ParseError=ParseError,exports.Reader=Reader,exports.cloneTokens=function cloneTokens(e){return"undefined"!=typeof globalThis&&"structuredClone"in globalThis?structuredClone(e):JSON.parse(JSON.stringify(e))},exports.isToken=function isToken(e){return!!Array.isArray(e)&&(!(e.length<4)&&(!!X.includes(e[0])&&("string"==typeof e[1]&&("number"==typeof e[2]&&"number"==typeof e[3]))))},exports.isTokenAtKeyword=function isTokenAtKeyword(e){return!!e&&e[0]===exports.TokenType.AtKeyword},exports.isTokenBadString=function isTokenBadString(e){return!!e&&e[0]===exports.TokenType.BadString},exports.isTokenBadURL=function isTokenBadURL(e){return!!e&&e[0]===exports.TokenType.BadURL},exports.isTokenCDC=function isTokenCDC(e){return!!e&&e[0]===exports.TokenType.CDC},exports.isTokenCDO=function isTokenCDO(e){return!!e&&e[0]===exports.TokenType.CDO},exports.isTokenCloseCurly=function isTokenCloseCurly(e){return!!e&&e[0]===exports.TokenType.CloseCurly},exports.isTokenCloseParen=function isTokenCloseParen(e){return!!e&&e[0]===exports.TokenType.CloseParen},exports.isTokenCloseSquare=function isTokenCloseSquare(e){return!!e&&e[0]===exports.TokenType.CloseSquare},exports.isTokenColon=function isTokenColon(e){return!!e&&e[0]===exports.TokenType.Colon},exports.isTokenComma=function isTokenComma(e){return!!e&&e[0]===exports.TokenType.Comma},exports.isTokenComment=function isTokenComment(e){return!!e&&e[0]===exports.TokenType.Comment},exports.isTokenDelim=function isTokenDelim(e){return!!e&&e[0]===exports.TokenType.Delim},exports.isTokenDimension=function isTokenDimension(e){return!!e&&e[0]===exports.TokenType.Dimension},exports.isTokenEOF=function isTokenEOF(e){return!!e&&e[0]===exports.TokenType.EOF},exports.isTokenFunction=function isTokenFunction(e){return!!e&&e[0]===exports.TokenType.Function},exports.isTokenHash=function isTokenHash(e){return!!e&&e[0]===exports.TokenType.Hash},exports.isTokenIdent=function isTokenIdent(e){return!!e&&e[0]===exports.TokenType.Ident},exports.isTokenNumber=function isTokenNumber(e){return!!e&&e[0]===exports.TokenType.Number},exports.isTokenNumeric=function isTokenNumeric(e){switch(e[0]){case exports.TokenType.Dimension:case exports.TokenType.Number:case exports.TokenType.Percentage:return!0;default:return!1}},exports.isTokenOpenCurly=function isTokenOpenCurly(e){return!!e&&e[0]===exports.TokenType.OpenCurly},exports.isTokenOpenParen=function isTokenOpenParen(e){return!!e&&e[0]===exports.TokenType.OpenParen},exports.isTokenOpenSquare=function isTokenOpenSquare(e){return!!e&&e[0]===exports.TokenType.OpenSquare},exports.isTokenPercentage=function isTokenPercentage(e){return!!e&&e[0]===exports.TokenType.Percentage},exports.isTokenSemicolon=function isTokenSemicolon(e){return!!e&&e[0]===exports.TokenType.Semicolon},exports.isTokenString=function isTokenString(e){return!!e&&e[0]===exports.TokenType.String},exports.isTokenURL=function isTokenURL(e){return!!e&&e[0]===exports.TokenType.URL},exports.isTokenUnicodeRange=function isTokenUnicodeRange(e){return!!e&&e[0]===exports.TokenType.UnicodeRange},exports.isTokenWhiteSpaceOrComment=function isTokenWhiteSpaceOrComment(e){switch(e[0]){case exports.TokenType.Whitespace:case exports.TokenType.Comment:return!0;default:return!1}},exports.isTokenWhitespace=function isTokenWhitespace(e){return!!e&&e[0]===exports.TokenType.Whitespace},exports.mirrorVariant=function mirrorVariant(e){switch(e[0]){case exports.TokenType.OpenParen:return[exports.TokenType.CloseParen,")",-1,-1,void 0];case exports.TokenType.CloseParen:return[exports.TokenType.OpenParen,"(",-1,-1,void 0];case exports.TokenType.OpenCurly:return[exports.TokenType.CloseCurly,"}",-1,-1,void 0];case exports.TokenType.CloseCurly:return[exports.TokenType.OpenCurly,"{",-1,-1,void 0];case exports.TokenType.OpenSquare:return[exports.TokenType.CloseSquare,"]",-1,-1,void 0];case exports.TokenType.CloseSquare:return[exports.TokenType.OpenSquare,"[",-1,-1,void 0];default:return null}},exports.mirrorVariantType=function mirrorVariantType(e){switch(e){case exports.TokenType.OpenParen:return exports.TokenType.CloseParen;case exports.TokenType.CloseParen:return exports.TokenType.OpenParen;case exports.TokenType.OpenCurly:return exports.TokenType.CloseCurly;case exports.TokenType.CloseCurly:return exports.TokenType.OpenCurly;case exports.TokenType.OpenSquare:return exports.TokenType.CloseSquare;case exports.TokenType.CloseSquare:return exports.TokenType.OpenSquare;default:return null}},exports.mutateIdent=function mutateIdent(e,o){const n=[];for(const e of o)n.push(e.codePointAt(0));const r=String.fromCodePoint(...ensureThatValueRoundTripsAsIdent(n));e[1]=r,e[4].value=o},exports.mutateUnit=function mutateUnit(e,o){const n=[];for(const e of o)n.push(e.codePointAt(0));const r=ensureThatValueRoundTripsAsIdent(n);101===r[0]&&insertEscapedCodePoint(r,0,r[0]);const t=String.fromCodePoint(...r),i="+"===e[4].signCharacter?e[4].signCharacter:"",s=e[4].value.toString();e[1]=`${i}${s}${t}`,e[4].unit=o},exports.stringify=function stringify(...e){let o="";for(let n=0;n<e.length;n++)o+=e[n][1];return o},exports.tokenize=function tokenize(e,o){const n=tokenizer(e,o),r=[];{for(;!n.endOfFile();){const e=n.nextToken();e&&r.push(e)}const e=n.nextToken();e&&r.push(e)}return r},exports.tokenizer=tokenizer;
diff --git a/node_modules/@csstools/css-tokenizer/dist/index.d.ts b/node_modules/@csstools/css-tokenizer/dist/index.d.ts
index e503c818..f61c023b 100644
--- a/node_modules/@csstools/css-tokenizer/dist/index.d.ts
+++ b/node_modules/@csstools/css-tokenizer/dist/index.d.ts
@@ -83,6 +83,70 @@ export declare enum HashType {
*/
export declare function isToken(x: any): x is CSSToken;
+export declare function isTokenAtKeyword(x?: CSSToken | null): x is TokenAtKeyword;
+
+export declare function isTokenBadString(x?: CSSToken | null): x is TokenBadString;
+
+export declare function isTokenBadURL(x?: CSSToken | null): x is TokenBadURL;
+
+export declare function isTokenCDC(x?: CSSToken | null): x is TokenCDC;
+
+export declare function isTokenCDO(x?: CSSToken | null): x is TokenCDO;
+
+export declare function isTokenCloseCurly(x?: CSSToken | null): x is TokenCloseCurly;
+
+export declare function isTokenCloseParen(x?: CSSToken | null): x is TokenCloseParen;
+
+export declare function isTokenCloseSquare(x?: CSSToken | null): x is TokenCloseSquare;
+
+export declare function isTokenColon(x?: CSSToken | null): x is TokenColon;
+
+export declare function isTokenComma(x?: CSSToken | null): x is TokenComma;
+
+export declare function isTokenComment(x?: CSSToken | null): x is TokenComment;
+
+export declare function isTokenDelim(x?: CSSToken | null): x is TokenDelim;
+
+export declare function isTokenDimension(x?: CSSToken | null): x is TokenDimension;
+
+export declare function isTokenEOF(x?: CSSToken | null): x is TokenEOF;
+
+export declare function isTokenFunction(x?: CSSToken | null): x is TokenFunction;
+
+export declare function isTokenHash(x?: CSSToken | null): x is TokenHash;
+
+export declare function isTokenIdent(x?: CSSToken | null): x is TokenIdent;
+
+export declare function isTokenNumber(x?: CSSToken | null): x is TokenNumber;
+
+/**
+ * Assert that a token is a numeric token
+ */
+export declare function isTokenNumeric(x: CSSToken): x is NumericToken;
+
+export declare function isTokenOpenCurly(x?: CSSToken | null): x is TokenOpenCurly;
+
+export declare function isTokenOpenParen(x?: CSSToken | null): x is TokenOpenParen;
+
+export declare function isTokenOpenSquare(x?: CSSToken | null): x is TokenOpenSquare;
+
+export declare function isTokenPercentage(x?: CSSToken | null): x is TokenPercentage;
+
+export declare function isTokenSemicolon(x?: CSSToken | null): x is TokenSemicolon;
+
+export declare function isTokenString(x?: CSSToken | null): x is TokenString;
+
+export declare function isTokenUnicodeRange(x?: CSSToken | null): x is TokenUnicodeRange;
+
+export declare function isTokenURL(x?: CSSToken | null): x is TokenURL;
+
+export declare function isTokenWhitespace(x?: CSSToken | null): x is TokenWhitespace;
+
+/**
+ * Assert that a token is a whitespace or comment token
+ */
+export declare function isTokenWhiteSpaceOrComment(x: CSSToken): x is TokenWhitespace | TokenComment;
+
/**
* Get the mirror variant of a given token
*
@@ -118,6 +182,12 @@ export declare function mirrorVariantType(type: TokenType): TokenType | null;
export declare function mutateIdent(ident: TokenIdent, newValue: string): void;
/**
+ * Set the unit and update the string representation.
+ * This handles escaping.
+ */
+export declare function mutateUnit(ident: TokenDimension, newUnit: string): void;
+
+/**
* The type of number token
* Either `integer` or `number`
*/
@@ -127,6 +197,11 @@ export declare enum NumberType {
}
/**
+ * The union of all possible CSS tokens that represent a numeric value
+ */
+export declare type NumericToken = TokenDimension | TokenNumber | TokenPercentage;
+
+/**
* The CSS Tokenizer is forgiving and will never throw on invalid input.
* Any errors are reported through the `onParseError` callback.
*/
diff --git a/node_modules/@csstools/css-tokenizer/dist/index.mjs b/node_modules/@csstools/css-tokenizer/dist/index.mjs
index b0d518e2..ebc39c26 100644
--- a/node_modules/@csstools/css-tokenizer/dist/index.mjs
+++ b/node_modules/@csstools/css-tokenizer/dist/index.mjs
@@ -1 +1 @@
-class ParseError extends Error{sourceStart;sourceEnd;parserState;constructor(e,n,o,r){super(e),this.name="ParseError",this.sourceStart=n,this.sourceEnd=o,this.parserState=r}}class Reader{cursor=0;source="";codePointSource=[];representationIndices=[-1];length=0;representationStart=0;representationEnd=-1;constructor(e){this.source=e;{let n=-1,o="";for(o of e)n+=o.length,this.codePointSource.push(o.codePointAt(0)),this.representationIndices.push(n)}this.length=this.codePointSource.length}advanceCodePoint(e=1){this.cursor=this.cursor+e,this.representationEnd=this.representationIndices[this.cursor]}readCodePoint(e=1){const n=this.codePointSource[this.cursor];return void 0!==n&&(this.cursor=this.cursor+e,this.representationEnd=this.representationIndices[this.cursor],n)}unreadCodePoint(e=1){this.cursor=this.cursor-e,this.representationEnd=this.representationIndices[this.cursor]}resetRepresentation(){this.representationStart=this.representationIndices[this.cursor]+1,this.representationEnd=-1}}var e,n,o;function mirrorVariantType(n){switch(n){case e.OpenParen:return e.CloseParen;case e.CloseParen:return e.OpenParen;case e.OpenCurly:return e.CloseCurly;case e.CloseCurly:return e.OpenCurly;case e.OpenSquare:return e.CloseSquare;case e.CloseSquare:return e.OpenSquare;default:return null}}function mirrorVariant(n){switch(n[0]){case e.OpenParen:return[e.CloseParen,")",-1,-1,void 0];case e.CloseParen:return[e.OpenParen,"(",-1,-1,void 0];case e.OpenCurly:return[e.CloseCurly,"}",-1,-1,void 0];case e.CloseCurly:return[e.OpenCurly,"{",-1,-1,void 0];case e.OpenSquare:return[e.CloseSquare,"]",-1,-1,void 0];case e.CloseSquare:return[e.OpenSquare,"[",-1,-1,void 0];default:return null}}!function(e){e.Comment="comment",e.AtKeyword="at-keyword-token",e.BadString="bad-string-token",e.BadURL="bad-url-token",e.CDC="CDC-token",e.CDO="CDO-token",e.Colon="colon-token",e.Comma="comma-token",e.Delim="delim-token",e.Dimension="dimension-token",e.EOF="EOF-token",e.Function="function-token",e.Hash="hash-token",e.Ident="ident-token",e.Number="number-token",e.Percentage="percentage-token",e.Semicolon="semicolon-token",e.String="string-token",e.URL="url-token",e.Whitespace="whitespace-token",e.OpenParen="(-token",e.CloseParen=")-token",e.OpenSquare="[-token",e.CloseSquare="]-token",e.OpenCurly="{-token",e.CloseCurly="}-token",e.UnicodeRange="unicode-range-token"}(e||(e={})),function(e){e.Integer="integer",e.Number="number"}(n||(n={})),function(e){e.Unrestricted="unrestricted",e.ID="id"}(o||(o={}));const r=Object.values(e);function isToken(e){return!!Array.isArray(e)&&(!(e.length<4)&&(!!r.includes(e[0])&&("string"==typeof e[1]&&("number"==typeof e[2]&&"number"==typeof e[3]))))}function cloneTokens(e){return"undefined"!=typeof globalThis&&"structuredClone"in globalThis?structuredClone(e):JSON.parse(JSON.stringify(e))}function stringify(...e){let n="";for(let o=0;o<e.length;o++)n+=e[o][1];return n}const t=39,i=42,c=8,s=13,a=9,u=58,d=44,P=64,p=127,S=33,C=12,l=46,f=62,h=45,E=31,m=69,v=101,g=123,k=40,I=91,T=60,O=10,U=11,w=95,D=1114111,A=0,R=35,L=37,x=43,y=34,q=65533,W=92,N=125,b=41,F=93,H=59,V=14,B=47,z=32,K=117,M=85,$=114,J=82,_=108,j=76,Q=63,G=48,X=70;function checkIfFourCodePointsWouldStartCDO(e){return e.codePointSource[e.cursor]===T&&e.codePointSource[e.cursor+1]===S&&e.codePointSource[e.cursor+2]===h&&e.codePointSource[e.cursor+3]===h}function isDigitCodePoint(e){return e>=48&&e<=57}function isUppercaseLetterCodePoint(e){return e>=65&&e<=90}function isLowercaseLetterCodePoint(e){return e>=97&&e<=122}function isHexDigitCodePoint(e){return isDigitCodePoint(e)||e>=97&&e<=102||e>=65&&e<=70}function isLetterCodePoint(e){return isLowercaseLetterCodePoint(e)||isUppercaseLetterCodePoint(e)}function isIdentStartCodePoint(e){return isLetterCodePoint(e)||isNonASCII_IdentCodePoint(e)||e===w}function isIdentCodePoint(e){return isIdentStartCodePoint(e)||isDigitCodePoint(e)||e===h}function isNonASCII_IdentCodePoint(e){return 183===e||8204===e||8205===e||8255===e||8256===e||8204===e||(192<=e&&e<=214||216<=e&&e<=246||248<=e&&e<=893||895<=e&&e<=8191||8304<=e&&e<=8591||11264<=e&&e<=12271||12289<=e&&e<=55295||63744<=e&&e<=64975||65008<=e&&e<=65533||e>=65536)}function isNewLine(e){return 10===e||13===e||12===e}function isWhitespace(e){return 32===e||10===e||9===e||13===e||12===e}function checkIfTwoCodePointsAreAValidEscape(e){return e.codePointSource[e.cursor]===W&&!isNewLine(e.codePointSource[e.cursor+1])}function checkIfThreeCodePointsWouldStartAnIdentSequence(e,n){return n.codePointSource[n.cursor]===h?n.codePointSource[n.cursor+1]===h||(!!isIdentStartCodePoint(n.codePointSource[n.cursor+1])||n.codePointSource[n.cursor+1]===W&&!isNewLine(n.codePointSource[n.cursor+2])):!!isIdentStartCodePoint(n.codePointSource[n.cursor])||checkIfTwoCodePointsAreAValidEscape(n)}function checkIfThreeCodePointsWouldStartANumber(e){return e.codePointSource[e.cursor]===x||e.codePointSource[e.cursor]===h?!!isDigitCodePoint(e.codePointSource[e.cursor+1])||e.codePointSource[e.cursor+1]===l&&isDigitCodePoint(e.codePointSource[e.cursor+2]):e.codePointSource[e.cursor]===l?isDigitCodePoint(e.codePointSource[e.cursor+1]):isDigitCodePoint(e.codePointSource[e.cursor])}function checkIfTwoCodePointsStartAComment(e){return e.codePointSource[e.cursor]===B&&e.codePointSource[e.cursor+1]===i}function checkIfThreeCodePointsWouldStartCDC(e){return e.codePointSource[e.cursor]===h&&e.codePointSource[e.cursor+1]===h&&e.codePointSource[e.cursor+2]===f}function consumeComment(n,o){for(o.advanceCodePoint(2);;){const e=o.readCodePoint();if(!1===e){n.onParseError(new ParseError("Unexpected EOF while consuming a comment.",o.representationStart,o.representationEnd,["4.3.2. Consume comments","Unexpected EOF"]));break}if(e===i&&(void 0!==o.codePointSource[o.cursor]&&o.codePointSource[o.cursor]===B)){o.advanceCodePoint();break}}return[e.Comment,o.source.slice(o.representationStart,o.representationEnd+1),o.representationStart,o.representationEnd,void 0]}function consumeEscapedCodePoint(e,n){const o=n.readCodePoint();if(!1===o)return e.onParseError(new ParseError("Unexpected EOF while consuming an escaped code point.",n.representationStart,n.representationEnd,["4.3.7. Consume an escaped code point","Unexpected EOF"])),q;if(isHexDigitCodePoint(o)){const e=[o];for(;void 0!==n.codePointSource[n.cursor]&&isHexDigitCodePoint(n.codePointSource[n.cursor])&&e.length<6;)e.push(n.codePointSource[n.cursor]),n.advanceCodePoint();isWhitespace(n.codePointSource[n.cursor])&&n.advanceCodePoint();const t=parseInt(String.fromCodePoint(...e),16);return 0===t?q:(r=t)>=55296&&r<=57343||t>D?q:t}var r;return o}function consumeIdentSequence(e,n){const o=[];for(;;)if(isIdentCodePoint(n.codePointSource[n.cursor]))o.push(n.codePointSource[n.cursor]),n.advanceCodePoint();else{if(!checkIfTwoCodePointsAreAValidEscape(n))return o;n.advanceCodePoint(),o.push(consumeEscapedCodePoint(e,n))}}function consumeHashToken(n,r){if(r.advanceCodePoint(),void 0!==r.codePointSource[r.cursor]&&(isIdentCodePoint(r.codePointSource[r.cursor])||checkIfTwoCodePointsAreAValidEscape(r))){let t=o.Unrestricted;checkIfThreeCodePointsWouldStartAnIdentSequence(0,r)&&(t=o.ID);const i=consumeIdentSequence(n,r);return[e.Hash,r.source.slice(r.representationStart,r.representationEnd+1),r.representationStart,r.representationEnd,{value:String.fromCodePoint(...i),type:t}]}return[e.Delim,"#",r.representationStart,r.representationEnd,{value:"#"}]}function consumeNumber(e,o){let r=n.Integer;for(o.codePointSource[o.cursor]!==x&&o.codePointSource[o.cursor]!==h||o.advanceCodePoint();isDigitCodePoint(o.codePointSource[o.cursor]);)o.advanceCodePoint();if(o.codePointSource[o.cursor]===l&&isDigitCodePoint(o.codePointSource[o.cursor+1]))for(o.advanceCodePoint(2),r=n.Number;isDigitCodePoint(o.codePointSource[o.cursor]);)o.advanceCodePoint();if(o.codePointSource[o.cursor]===v||o.codePointSource[o.cursor]===m){if(isDigitCodePoint(o.codePointSource[o.cursor+1]))o.advanceCodePoint(2);else{if(o.codePointSource[o.cursor+1]!==h&&o.codePointSource[o.cursor+1]!==x||!isDigitCodePoint(o.codePointSource[o.cursor+2]))return r;o.advanceCodePoint(3)}for(r=n.Number;isDigitCodePoint(o.codePointSource[o.cursor]);)o.advanceCodePoint()}return r}function consumeNumericToken(n,o){let r;{const e=o.codePointSource[o.cursor];e===h?r="-":e===x&&(r="+")}const t=consumeNumber(0,o),i=parseFloat(o.source.slice(o.representationStart,o.representationEnd+1))||0;if(checkIfThreeCodePointsWouldStartAnIdentSequence(0,o)){const c=consumeIdentSequence(n,o);return[e.Dimension,o.source.slice(o.representationStart,o.representationEnd+1),o.representationStart,o.representationEnd,{value:i,signCharacter:r,type:t,unit:String.fromCodePoint(...c)}]}return o.codePointSource[o.cursor]===L?(o.advanceCodePoint(),[e.Percentage,o.source.slice(o.representationStart,o.representationEnd+1),o.representationStart,o.representationEnd,{value:i,signCharacter:r}]):[e.Number,o.source.slice(o.representationStart,o.representationEnd+1),o.representationStart,o.representationEnd,{value:i,signCharacter:r,type:t}]}function consumeWhiteSpace(n){for(;isWhitespace(n.codePointSource[n.cursor]);)n.advanceCodePoint();return[e.Whitespace,n.source.slice(n.representationStart,n.representationEnd+1),n.representationStart,n.representationEnd,void 0]}function consumeStringToken(n,o){let r="";const t=o.readCodePoint();for(;;){const i=o.readCodePoint();if(!1===i)return n.onParseError(new ParseError("Unexpected EOF while consuming a string token.",o.representationStart,o.representationEnd,["4.3.5. Consume a string token","Unexpected EOF"])),[e.String,o.source.slice(o.representationStart,o.representationEnd+1),o.representationStart,o.representationEnd,{value:r}];if(isNewLine(i))return n.onParseError(new ParseError("Unexpected newline while consuming a string token.",o.representationStart,o.representationEnd,["4.3.5. Consume a string token","Unexpected newline"])),o.unreadCodePoint(),[e.BadString,o.source.slice(o.representationStart,o.representationEnd+1),o.representationStart,o.representationEnd,void 0];if(i===t)return[e.String,o.source.slice(o.representationStart,o.representationEnd+1),o.representationStart,o.representationEnd,{value:r}];if(i!==W)r+=String.fromCodePoint(i);else{if(void 0===o.codePointSource[o.cursor])continue;if(isNewLine(o.codePointSource[o.cursor])){o.advanceCodePoint();continue}r+=String.fromCodePoint(consumeEscapedCodePoint(n,o))}}}function checkIfCodePointsMatchURLIdent(e){return!(3!==e.length||e[0]!==K&&e[0]!==M||e[1]!==$&&e[1]!==J||e[2]!==_&&e[2]!==j)}function consumeBadURL(e,n){for(;;){if(void 0===n.codePointSource[n.cursor])return;if(n.codePointSource[n.cursor]===b)return void n.advanceCodePoint();checkIfTwoCodePointsAreAValidEscape(n)?(n.advanceCodePoint(),consumeEscapedCodePoint(e,n)):n.advanceCodePoint()}}function consumeUrlToken(n,o){for(;isWhitespace(o.codePointSource[o.cursor]);)o.advanceCodePoint();let r="";for(;;){if(void 0===o.codePointSource[o.cursor])return n.onParseError(new ParseError("Unexpected EOF while consuming a url token.",o.representationStart,o.representationEnd,["4.3.6. Consume a url token","Unexpected EOF"])),[e.URL,o.source.slice(o.representationStart,o.representationEnd+1),o.representationStart,o.representationEnd,{value:r}];if(o.codePointSource[o.cursor]===b)return o.advanceCodePoint(),[e.URL,o.source.slice(o.representationStart,o.representationEnd+1),o.representationStart,o.representationEnd,{value:r}];if(isWhitespace(o.codePointSource[o.cursor])){for(o.advanceCodePoint();isWhitespace(o.codePointSource[o.cursor]);)o.advanceCodePoint();return void 0===o.codePointSource[o.cursor]?(n.onParseError(new ParseError("Unexpected EOF while consuming a url token.",o.representationStart,o.representationEnd,["4.3.6. Consume a url token","Consume as much whitespace as possible","Unexpected EOF"])),[e.URL,o.source.slice(o.representationStart,o.representationEnd+1),o.representationStart,o.representationEnd,{value:r}]):o.codePointSource[o.cursor]===b?(o.advanceCodePoint(),[e.URL,o.source.slice(o.representationStart,o.representationEnd+1),o.representationStart,o.representationEnd,{value:r}]):(consumeBadURL(n,o),[e.BadURL,o.source.slice(o.representationStart,o.representationEnd+1),o.representationStart,o.representationEnd,void 0])}if(o.codePointSource[o.cursor]===y||o.codePointSource[o.cursor]===t||o.codePointSource[o.cursor]===k||((i=o.codePointSource[o.cursor])===U||i===p||A<=i&&i<=c||V<=i&&i<=E))return consumeBadURL(n,o),n.onParseError(new ParseError("Unexpected character while consuming a url token.",o.representationStart,o.representationEnd,["4.3.6. Consume a url token","Unexpected U+0022 QUOTATION MARK (\"), U+0027 APOSTROPHE ('), U+0028 LEFT PARENTHESIS (() or non-printable code point"])),[e.BadURL,o.source.slice(o.representationStart,o.representationEnd+1),o.representationStart,o.representationEnd,void 0];if(o.codePointSource[o.cursor]===W){if(checkIfTwoCodePointsAreAValidEscape(o)){o.advanceCodePoint(),r+=String.fromCodePoint(consumeEscapedCodePoint(n,o));continue}return consumeBadURL(n,o),n.onParseError(new ParseError("Invalid escape sequence while consuming a url token.",o.representationStart,o.representationEnd,["4.3.6. Consume a url token","U+005C REVERSE SOLIDUS (\\)","The input stream does not start with a valid escape sequence"])),[e.BadURL,o.source.slice(o.representationStart,o.representationEnd+1),o.representationStart,o.representationEnd,void 0]}r+=String.fromCodePoint(o.codePointSource[o.cursor]),o.advanceCodePoint()}var i}function consumeIdentLikeToken(n,o){const r=consumeIdentSequence(n,o);if(o.codePointSource[o.cursor]!==k)return[e.Ident,o.source.slice(o.representationStart,o.representationEnd+1),o.representationStart,o.representationEnd,{value:String.fromCodePoint(...r)}];if(checkIfCodePointsMatchURLIdent(r)){o.advanceCodePoint();let i=0;for(;;){const n=isWhitespace(o.codePointSource[o.cursor]),c=isWhitespace(o.codePointSource[o.cursor+1]);if(n&&c){i+=1,o.advanceCodePoint(1);continue}const s=n?o.codePointSource[o.cursor+1]:o.codePointSource[o.cursor];if(s===y||s===t)return i>0&&o.unreadCodePoint(i),[e.Function,o.source.slice(o.representationStart,o.representationEnd+1),o.representationStart,o.representationEnd,{value:String.fromCodePoint(...r)}];break}return consumeUrlToken(n,o)}return o.advanceCodePoint(),[e.Function,o.source.slice(o.representationStart,o.representationEnd+1),o.representationStart,o.representationEnd,{value:String.fromCodePoint(...r)}]}function checkIfThreeCodePointsWouldStartAUnicodeRange(e){return!(e.codePointSource[e.cursor]!==K&&e.codePointSource[e.cursor]!==M||e.codePointSource[e.cursor+1]!==x||e.codePointSource[e.cursor+2]!==Q&&!isHexDigitCodePoint(e.codePointSource[e.cursor+2]))}function consumeUnicodeRangeToken(n,o){o.advanceCodePoint(2);const r=[],t=[];for(;void 0!==o.codePointSource[o.cursor]&&r.length<6&&isHexDigitCodePoint(o.codePointSource[o.cursor]);)r.push(o.codePointSource[o.cursor]),o.advanceCodePoint();for(;void 0!==o.codePointSource[o.cursor]&&r.length<6&&o.codePointSource[o.cursor]===Q;)0===t.length&&t.push(...r),r.push(G),t.push(X),o.advanceCodePoint();if(!t.length&&o.codePointSource[o.cursor]===h&&isHexDigitCodePoint(o.codePointSource[o.cursor+1]))for(o.advanceCodePoint();void 0!==o.codePointSource[o.cursor]&&t.length<6&&isHexDigitCodePoint(o.codePointSource[o.cursor]);)t.push(o.codePointSource[o.cursor]),o.advanceCodePoint();if(!t.length){const n=parseInt(String.fromCodePoint(...r),16);return[e.UnicodeRange,o.source.slice(o.representationStart,o.representationEnd+1),o.representationStart,o.representationEnd,{startOfRange:n,endOfRange:n}]}const i=parseInt(String.fromCodePoint(...r),16),c=parseInt(String.fromCodePoint(...t),16);return[e.UnicodeRange,o.source.slice(o.representationStart,o.representationEnd+1),o.representationStart,o.representationEnd,{startOfRange:i,endOfRange:c}]}function tokenize(e,n){const o=tokenizer(e,n),r=[];{for(;!o.endOfFile();){const e=o.nextToken();e&&r.push(e)}const e=o.nextToken();e&&r.push(e)}return r}function tokenizer(n,o){const r=n.css.valueOf(),i=n.unicodeRangesAllowed??!1,c=new Reader(r),p={onParseError:o?.onParseError??noop};return{nextToken:function nextToken(){c.resetRepresentation();const n=c.codePointSource[c.cursor];if(void 0===n)return[e.EOF,"",-1,-1,void 0];if(n===B&&checkIfTwoCodePointsStartAComment(c))return consumeComment(p,c);if(i&&(n===K||n===M)&&checkIfThreeCodePointsWouldStartAUnicodeRange(c))return consumeUnicodeRangeToken(0,c);if(isIdentStartCodePoint(n))return consumeIdentLikeToken(p,c);if(isDigitCodePoint(n))return consumeNumericToken(p,c);switch(n){case d:return c.advanceCodePoint(),[e.Comma,",",c.representationStart,c.representationEnd,void 0];case u:return c.advanceCodePoint(),[e.Colon,":",c.representationStart,c.representationEnd,void 0];case H:return c.advanceCodePoint(),[e.Semicolon,";",c.representationStart,c.representationEnd,void 0];case k:return c.advanceCodePoint(),[e.OpenParen,"(",c.representationStart,c.representationEnd,void 0];case b:return c.advanceCodePoint(),[e.CloseParen,")",c.representationStart,c.representationEnd,void 0];case I:return c.advanceCodePoint(),[e.OpenSquare,"[",c.representationStart,c.representationEnd,void 0];case F:return c.advanceCodePoint(),[e.CloseSquare,"]",c.representationStart,c.representationEnd,void 0];case g:return c.advanceCodePoint(),[e.OpenCurly,"{",c.representationStart,c.representationEnd,void 0];case N:return c.advanceCodePoint(),[e.CloseCurly,"}",c.representationStart,c.representationEnd,void 0];case t:case y:return consumeStringToken(p,c);case R:return consumeHashToken(p,c);case x:case l:return checkIfThreeCodePointsWouldStartANumber(c)?consumeNumericToken(p,c):(c.advanceCodePoint(),[e.Delim,c.source[c.representationStart],c.representationStart,c.representationEnd,{value:c.source[c.representationStart]}]);case O:case s:case C:case a:case z:return consumeWhiteSpace(c);case h:return checkIfThreeCodePointsWouldStartANumber(c)?consumeNumericToken(p,c):checkIfThreeCodePointsWouldStartCDC(c)?(c.advanceCodePoint(3),[e.CDC,"--\x3e",c.representationStart,c.representationEnd,void 0]):checkIfThreeCodePointsWouldStartAnIdentSequence(0,c)?consumeIdentLikeToken(p,c):(c.advanceCodePoint(),[e.Delim,"-",c.representationStart,c.representationEnd,{value:"-"}]);case T:return checkIfFourCodePointsWouldStartCDO(c)?(c.advanceCodePoint(4),[e.CDO,"\x3c!--",c.representationStart,c.representationEnd,void 0]):(c.advanceCodePoint(),[e.Delim,"<",c.representationStart,c.representationEnd,{value:"<"}]);case P:if(c.advanceCodePoint(),checkIfThreeCodePointsWouldStartAnIdentSequence(0,c)){const n=consumeIdentSequence(p,c);return[e.AtKeyword,c.source.slice(c.representationStart,c.representationEnd+1),c.representationStart,c.representationEnd,{value:String.fromCodePoint(...n)}]}return[e.Delim,"@",c.representationStart,c.representationEnd,{value:"@"}];case W:return checkIfTwoCodePointsAreAValidEscape(c)?consumeIdentLikeToken(p,c):(c.advanceCodePoint(),p.onParseError(new ParseError('Invalid escape sequence after "\\"',c.representationStart,c.representationEnd,["4.3.1. Consume a token","U+005C REVERSE SOLIDUS (\\)","The input stream does not start with a valid escape sequence"])),[e.Delim,"\\",c.representationStart,c.representationEnd,{value:"\\"}])}return c.advanceCodePoint(),[e.Delim,c.source[c.representationStart],c.representationStart,c.representationEnd,{value:c.source[c.representationStart]}]},endOfFile:function endOfFile(){return void 0===c.codePointSource[c.cursor]}}}function noop(){}function mutateIdent(e,n){let o="";const r=[];for(const e of n)r.push(e.codePointAt(0));let t=0;r[0]===h&&r[1]===h?(o="--",t=2):r[0]===h&&r[1]?(o="-",t=2,isIdentStartCodePoint(r[1])?o+=n[1]:o+=`\\${r[1].toString(16)} `):isIdentStartCodePoint(r[0])?(o=n[0],t=1):(o=`\\${r[0].toString(16)} `,t=1);for(let e=t;e<r.length;e++)isIdentCodePoint(r[e])?o+=n[e]:o+=`\\${r[e].toString(16)} `;e[1]=o,e[4].value=n}export{n as NumberType,ParseError,Reader,e as TokenType,cloneTokens,isToken,mirrorVariant,mirrorVariantType,mutateIdent,stringify,tokenize,tokenizer};
+class ParseError extends Error{sourceStart;sourceEnd;parserState;constructor(e,n,o,r){super(e),this.name="ParseError",this.sourceStart=n,this.sourceEnd=o,this.parserState=r}}class Reader{cursor=0;source="";codePointSource=[];representationIndices=[-1];length=0;representationStart=0;representationEnd=-1;constructor(e){this.source=e;{let n=-1,o="";for(o of e)n+=o.length,this.codePointSource.push(o.codePointAt(0)),this.representationIndices.push(n)}this.length=this.codePointSource.length}advanceCodePoint(e=1){this.cursor=this.cursor+e,this.representationEnd=this.representationIndices[this.cursor]}readCodePoint(e=1){const n=this.codePointSource[this.cursor];return void 0!==n&&(this.cursor=this.cursor+e,this.representationEnd=this.representationIndices[this.cursor],n)}unreadCodePoint(e=1){this.cursor=this.cursor-e,this.representationEnd=this.representationIndices[this.cursor]}resetRepresentation(){this.representationStart=this.representationIndices[this.cursor]+1,this.representationEnd=-1}}function cloneTokens(e){return"undefined"!=typeof globalThis&&"structuredClone"in globalThis?structuredClone(e):JSON.parse(JSON.stringify(e))}function stringify(...e){let n="";for(let o=0;o<e.length;o++)n+=e[o][1];return n}const e=39,n=42,o=8,r=13,t=9,i=58,s=44,c=64,a=127,u=33,d=12,P=46,p=62,S=45,C=31,l=69,f=101,m=123,h=40,k=91,E=60,v=10,g=11,T=95,I=1114111,O=0,U=35,D=37,w=43,R=34,A=65533,L=92,y=125,q=41,W=93,N=59,x=14,F=47,b=32,H=117,B=85,V=114,K=82,z=108,M=76,$=63,J=48,_=70;function checkIfFourCodePointsWouldStartCDO(e){return e.codePointSource[e.cursor]===E&&e.codePointSource[e.cursor+1]===u&&e.codePointSource[e.cursor+2]===S&&e.codePointSource[e.cursor+3]===S}function isDigitCodePoint(e){return e>=48&&e<=57}function isUppercaseLetterCodePoint(e){return e>=65&&e<=90}function isLowercaseLetterCodePoint(e){return e>=97&&e<=122}function isHexDigitCodePoint(e){return isDigitCodePoint(e)||e>=97&&e<=102||e>=65&&e<=70}function isLetterCodePoint(e){return isLowercaseLetterCodePoint(e)||isUppercaseLetterCodePoint(e)}function isIdentStartCodePoint(e){return isLetterCodePoint(e)||isNonASCII_IdentCodePoint(e)||e===T}function isIdentCodePoint(e){return isIdentStartCodePoint(e)||isDigitCodePoint(e)||e===S}function isNonASCII_IdentCodePoint(e){return 183===e||8204===e||8205===e||8255===e||8256===e||8204===e||(192<=e&&e<=214||216<=e&&e<=246||248<=e&&e<=893||895<=e&&e<=8191||8304<=e&&e<=8591||11264<=e&&e<=12271||12289<=e&&e<=55295||63744<=e&&e<=64975||65008<=e&&e<=65533||e>=65536)}function isNewLine(e){return 10===e||13===e||12===e}function isWhitespace(e){return 32===e||10===e||9===e||13===e||12===e}function checkIfTwoCodePointsAreAValidEscape(e){return e.codePointSource[e.cursor]===L&&!isNewLine(e.codePointSource[e.cursor+1])}function checkIfThreeCodePointsWouldStartAnIdentSequence(e,n){return n.codePointSource[n.cursor]===S?n.codePointSource[n.cursor+1]===S||(!!isIdentStartCodePoint(n.codePointSource[n.cursor+1])||n.codePointSource[n.cursor+1]===L&&!isNewLine(n.codePointSource[n.cursor+2])):!!isIdentStartCodePoint(n.codePointSource[n.cursor])||checkIfTwoCodePointsAreAValidEscape(n)}function checkIfThreeCodePointsWouldStartANumber(e){return e.codePointSource[e.cursor]===w||e.codePointSource[e.cursor]===S?!!isDigitCodePoint(e.codePointSource[e.cursor+1])||e.codePointSource[e.cursor+1]===P&&isDigitCodePoint(e.codePointSource[e.cursor+2]):e.codePointSource[e.cursor]===P?isDigitCodePoint(e.codePointSource[e.cursor+1]):isDigitCodePoint(e.codePointSource[e.cursor])}function checkIfTwoCodePointsStartAComment(e){return e.codePointSource[e.cursor]===F&&e.codePointSource[e.cursor+1]===n}function checkIfThreeCodePointsWouldStartCDC(e){return e.codePointSource[e.cursor]===S&&e.codePointSource[e.cursor+1]===S&&e.codePointSource[e.cursor+2]===p}var j,Q,G;function mirrorVariantType(e){switch(e){case j.OpenParen:return j.CloseParen;case j.CloseParen:return j.OpenParen;case j.OpenCurly:return j.CloseCurly;case j.CloseCurly:return j.OpenCurly;case j.OpenSquare:return j.CloseSquare;case j.CloseSquare:return j.OpenSquare;default:return null}}function mirrorVariant(e){switch(e[0]){case j.OpenParen:return[j.CloseParen,")",-1,-1,void 0];case j.CloseParen:return[j.OpenParen,"(",-1,-1,void 0];case j.OpenCurly:return[j.CloseCurly,"}",-1,-1,void 0];case j.CloseCurly:return[j.OpenCurly,"{",-1,-1,void 0];case j.OpenSquare:return[j.CloseSquare,"]",-1,-1,void 0];case j.CloseSquare:return[j.OpenSquare,"[",-1,-1,void 0];default:return null}}function consumeComment(e,o){for(o.advanceCodePoint(2);;){const r=o.readCodePoint();if(!1===r){e.onParseError(new ParseError("Unexpected EOF while consuming a comment.",o.representationStart,o.representationEnd,["4.3.2. Consume comments","Unexpected EOF"]));break}if(r===n&&(void 0!==o.codePointSource[o.cursor]&&o.codePointSource[o.cursor]===F)){o.advanceCodePoint();break}}return[j.Comment,o.source.slice(o.representationStart,o.representationEnd+1),o.representationStart,o.representationEnd,void 0]}function consumeEscapedCodePoint(e,n){const o=n.readCodePoint();if(!1===o)return e.onParseError(new ParseError("Unexpected EOF while consuming an escaped code point.",n.representationStart,n.representationEnd,["4.3.7. Consume an escaped code point","Unexpected EOF"])),A;if(isHexDigitCodePoint(o)){const e=[o];for(;void 0!==n.codePointSource[n.cursor]&&isHexDigitCodePoint(n.codePointSource[n.cursor])&&e.length<6;)e.push(n.codePointSource[n.cursor]),n.advanceCodePoint();isWhitespace(n.codePointSource[n.cursor])&&n.advanceCodePoint();const t=parseInt(String.fromCodePoint(...e),16);return 0===t?A:(r=t)>=55296&&r<=57343||t>I?A:t}var r;return o}function consumeIdentSequence(e,n){const o=[];for(;;)if(isIdentCodePoint(n.codePointSource[n.cursor]))o.push(n.codePointSource[n.cursor]),n.advanceCodePoint();else{if(!checkIfTwoCodePointsAreAValidEscape(n))return o;n.advanceCodePoint(),o.push(consumeEscapedCodePoint(e,n))}}function consumeHashToken(e,n){if(n.advanceCodePoint(),void 0!==n.codePointSource[n.cursor]&&(isIdentCodePoint(n.codePointSource[n.cursor])||checkIfTwoCodePointsAreAValidEscape(n))){let o=G.Unrestricted;checkIfThreeCodePointsWouldStartAnIdentSequence(0,n)&&(o=G.ID);const r=consumeIdentSequence(e,n);return[j.Hash,n.source.slice(n.representationStart,n.representationEnd+1),n.representationStart,n.representationEnd,{value:String.fromCodePoint(...r),type:o}]}return[j.Delim,"#",n.representationStart,n.representationEnd,{value:"#"}]}function consumeNumber(e,n){let o=Q.Integer;for(n.codePointSource[n.cursor]!==w&&n.codePointSource[n.cursor]!==S||n.advanceCodePoint();isDigitCodePoint(n.codePointSource[n.cursor]);)n.advanceCodePoint();if(n.codePointSource[n.cursor]===P&&isDigitCodePoint(n.codePointSource[n.cursor+1]))for(n.advanceCodePoint(2),o=Q.Number;isDigitCodePoint(n.codePointSource[n.cursor]);)n.advanceCodePoint();if(n.codePointSource[n.cursor]===f||n.codePointSource[n.cursor]===l){if(isDigitCodePoint(n.codePointSource[n.cursor+1]))n.advanceCodePoint(2);else{if(n.codePointSource[n.cursor+1]!==S&&n.codePointSource[n.cursor+1]!==w||!isDigitCodePoint(n.codePointSource[n.cursor+2]))return o;n.advanceCodePoint(3)}for(o=Q.Number;isDigitCodePoint(n.codePointSource[n.cursor]);)n.advanceCodePoint()}return o}function consumeNumericToken(e,n){let o;{const e=n.codePointSource[n.cursor];e===S?o="-":e===w&&(o="+")}const r=consumeNumber(0,n),t=parseFloat(n.source.slice(n.representationStart,n.representationEnd+1));if(checkIfThreeCodePointsWouldStartAnIdentSequence(0,n)){const i=consumeIdentSequence(e,n);return[j.Dimension,n.source.slice(n.representationStart,n.representationEnd+1),n.representationStart,n.representationEnd,{value:t,signCharacter:o,type:r,unit:String.fromCodePoint(...i)}]}return n.codePointSource[n.cursor]===D?(n.advanceCodePoint(),[j.Percentage,n.source.slice(n.representationStart,n.representationEnd+1),n.representationStart,n.representationEnd,{value:t,signCharacter:o}]):[j.Number,n.source.slice(n.representationStart,n.representationEnd+1),n.representationStart,n.representationEnd,{value:t,signCharacter:o,type:r}]}function consumeWhiteSpace(e){for(;isWhitespace(e.codePointSource[e.cursor]);)e.advanceCodePoint();return[j.Whitespace,e.source.slice(e.representationStart,e.representationEnd+1),e.representationStart,e.representationEnd,void 0]}function consumeStringToken(e,n){let o="";const r=n.readCodePoint();for(;;){const t=n.readCodePoint();if(!1===t)return e.onParseError(new ParseError("Unexpected EOF while consuming a string token.",n.representationStart,n.representationEnd,["4.3.5. Consume a string token","Unexpected EOF"])),[j.String,n.source.slice(n.representationStart,n.representationEnd+1),n.representationStart,n.representationEnd,{value:o}];if(isNewLine(t))return e.onParseError(new ParseError("Unexpected newline while consuming a string token.",n.representationStart,n.representationEnd,["4.3.5. Consume a string token","Unexpected newline"])),n.unreadCodePoint(),[j.BadString,n.source.slice(n.representationStart,n.representationEnd+1),n.representationStart,n.representationEnd,void 0];if(t===r)return[j.String,n.source.slice(n.representationStart,n.representationEnd+1),n.representationStart,n.representationEnd,{value:o}];if(t!==L)o+=String.fromCodePoint(t);else{if(void 0===n.codePointSource[n.cursor])continue;if(isNewLine(n.codePointSource[n.cursor])){n.advanceCodePoint();continue}o+=String.fromCodePoint(consumeEscapedCodePoint(e,n))}}}function checkIfCodePointsMatchURLIdent(e){return!(3!==e.length||e[0]!==H&&e[0]!==B||e[1]!==V&&e[1]!==K||e[2]!==z&&e[2]!==M)}function consumeBadURL(e,n){for(;;){if(void 0===n.codePointSource[n.cursor])return;if(n.codePointSource[n.cursor]===q)return void n.advanceCodePoint();checkIfTwoCodePointsAreAValidEscape(n)?(n.advanceCodePoint(),consumeEscapedCodePoint(e,n)):n.advanceCodePoint()}}function consumeUrlToken(n,r){for(;isWhitespace(r.codePointSource[r.cursor]);)r.advanceCodePoint();let t="";for(;;){if(void 0===r.codePointSource[r.cursor])return n.onParseError(new ParseError("Unexpected EOF while consuming a url token.",r.representationStart,r.representationEnd,["4.3.6. Consume a url token","Unexpected EOF"])),[j.URL,r.source.slice(r.representationStart,r.representationEnd+1),r.representationStart,r.representationEnd,{value:t}];if(r.codePointSource[r.cursor]===q)return r.advanceCodePoint(),[j.URL,r.source.slice(r.representationStart,r.representationEnd+1),r.representationStart,r.representationEnd,{value:t}];if(isWhitespace(r.codePointSource[r.cursor])){for(r.advanceCodePoint();isWhitespace(r.codePointSource[r.cursor]);)r.advanceCodePoint();return void 0===r.codePointSource[r.cursor]?(n.onParseError(new ParseError("Unexpected EOF while consuming a url token.",r.representationStart,r.representationEnd,["4.3.6. Consume a url token","Consume as much whitespace as possible","Unexpected EOF"])),[j.URL,r.source.slice(r.representationStart,r.representationEnd+1),r.representationStart,r.representationEnd,{value:t}]):r.codePointSource[r.cursor]===q?(r.advanceCodePoint(),[j.URL,r.source.slice(r.representationStart,r.representationEnd+1),r.representationStart,r.representationEnd,{value:t}]):(consumeBadURL(n,r),[j.BadURL,r.source.slice(r.representationStart,r.representationEnd+1),r.representationStart,r.representationEnd,void 0])}if(r.codePointSource[r.cursor]===R||r.codePointSource[r.cursor]===e||r.codePointSource[r.cursor]===h||((i=r.codePointSource[r.cursor])===g||i===a||O<=i&&i<=o||x<=i&&i<=C))return consumeBadURL(n,r),n.onParseError(new ParseError("Unexpected character while consuming a url token.",r.representationStart,r.representationEnd,["4.3.6. Consume a url token","Unexpected U+0022 QUOTATION MARK (\"), U+0027 APOSTROPHE ('), U+0028 LEFT PARENTHESIS (() or non-printable code point"])),[j.BadURL,r.source.slice(r.representationStart,r.representationEnd+1),r.representationStart,r.representationEnd,void 0];if(r.codePointSource[r.cursor]===L){if(checkIfTwoCodePointsAreAValidEscape(r)){r.advanceCodePoint(),t+=String.fromCodePoint(consumeEscapedCodePoint(n,r));continue}return consumeBadURL(n,r),n.onParseError(new ParseError("Invalid escape sequence while consuming a url token.",r.representationStart,r.representationEnd,["4.3.6. Consume a url token","U+005C REVERSE SOLIDUS (\\)","The input stream does not start with a valid escape sequence"])),[j.BadURL,r.source.slice(r.representationStart,r.representationEnd+1),r.representationStart,r.representationEnd,void 0]}t+=String.fromCodePoint(r.codePointSource[r.cursor]),r.advanceCodePoint()}var i}function consumeIdentLikeToken(n,o){const r=consumeIdentSequence(n,o);if(o.codePointSource[o.cursor]!==h)return[j.Ident,o.source.slice(o.representationStart,o.representationEnd+1),o.representationStart,o.representationEnd,{value:String.fromCodePoint(...r)}];if(checkIfCodePointsMatchURLIdent(r)){o.advanceCodePoint();let t=0;for(;;){const n=isWhitespace(o.codePointSource[o.cursor]),i=isWhitespace(o.codePointSource[o.cursor+1]);if(n&&i){t+=1,o.advanceCodePoint(1);continue}const s=n?o.codePointSource[o.cursor+1]:o.codePointSource[o.cursor];if(s===R||s===e)return t>0&&o.unreadCodePoint(t),[j.Function,o.source.slice(o.representationStart,o.representationEnd+1),o.representationStart,o.representationEnd,{value:String.fromCodePoint(...r)}];break}return consumeUrlToken(n,o)}return o.advanceCodePoint(),[j.Function,o.source.slice(o.representationStart,o.representationEnd+1),o.representationStart,o.representationEnd,{value:String.fromCodePoint(...r)}]}function checkIfThreeCodePointsWouldStartAUnicodeRange(e){return!(e.codePointSource[e.cursor]!==H&&e.codePointSource[e.cursor]!==B||e.codePointSource[e.cursor+1]!==w||e.codePointSource[e.cursor+2]!==$&&!isHexDigitCodePoint(e.codePointSource[e.cursor+2]))}function consumeUnicodeRangeToken(e,n){n.advanceCodePoint(2);const o=[],r=[];for(;void 0!==n.codePointSource[n.cursor]&&o.length<6&&isHexDigitCodePoint(n.codePointSource[n.cursor]);)o.push(n.codePointSource[n.cursor]),n.advanceCodePoint();for(;void 0!==n.codePointSource[n.cursor]&&o.length<6&&n.codePointSource[n.cursor]===$;)0===r.length&&r.push(...o),o.push(J),r.push(_),n.advanceCodePoint();if(!r.length&&n.codePointSource[n.cursor]===S&&isHexDigitCodePoint(n.codePointSource[n.cursor+1]))for(n.advanceCodePoint();void 0!==n.codePointSource[n.cursor]&&r.length<6&&isHexDigitCodePoint(n.codePointSource[n.cursor]);)r.push(n.codePointSource[n.cursor]),n.advanceCodePoint();if(!r.length){const e=parseInt(String.fromCodePoint(...o),16);return[j.UnicodeRange,n.source.slice(n.representationStart,n.representationEnd+1),n.representationStart,n.representationEnd,{startOfRange:e,endOfRange:e}]}const t=parseInt(String.fromCodePoint(...o),16),i=parseInt(String.fromCodePoint(...r),16);return[j.UnicodeRange,n.source.slice(n.representationStart,n.representationEnd+1),n.representationStart,n.representationEnd,{startOfRange:t,endOfRange:i}]}function tokenize(e,n){const o=tokenizer(e,n),r=[];{for(;!o.endOfFile();){const e=o.nextToken();e&&r.push(e)}const e=o.nextToken();e&&r.push(e)}return r}function tokenizer(n,o){const a=n.css.valueOf(),u=n.unicodeRangesAllowed??!1,p=new Reader(a),C={onParseError:o?.onParseError??noop};return{nextToken:function nextToken(){p.resetRepresentation();const n=p.codePointSource[p.cursor];if(void 0===n)return[j.EOF,"",-1,-1,void 0];if(n===F&&checkIfTwoCodePointsStartAComment(p))return consumeComment(C,p);if(u&&(n===H||n===B)&&checkIfThreeCodePointsWouldStartAUnicodeRange(p))return consumeUnicodeRangeToken(0,p);if(isIdentStartCodePoint(n))return consumeIdentLikeToken(C,p);if(isDigitCodePoint(n))return consumeNumericToken(C,p);switch(n){case s:return p.advanceCodePoint(),[j.Comma,",",p.representationStart,p.representationEnd,void 0];case i:return p.advanceCodePoint(),[j.Colon,":",p.representationStart,p.representationEnd,void 0];case N:return p.advanceCodePoint(),[j.Semicolon,";",p.representationStart,p.representationEnd,void 0];case h:return p.advanceCodePoint(),[j.OpenParen,"(",p.representationStart,p.representationEnd,void 0];case q:return p.advanceCodePoint(),[j.CloseParen,")",p.representationStart,p.representationEnd,void 0];case k:return p.advanceCodePoint(),[j.OpenSquare,"[",p.representationStart,p.representationEnd,void 0];case W:return p.advanceCodePoint(),[j.CloseSquare,"]",p.representationStart,p.representationEnd,void 0];case m:return p.advanceCodePoint(),[j.OpenCurly,"{",p.representationStart,p.representationEnd,void 0];case y:return p.advanceCodePoint(),[j.CloseCurly,"}",p.representationStart,p.representationEnd,void 0];case e:case R:return consumeStringToken(C,p);case U:return consumeHashToken(C,p);case w:case P:return checkIfThreeCodePointsWouldStartANumber(p)?consumeNumericToken(C,p):(p.advanceCodePoint(),[j.Delim,p.source[p.representationStart],p.representationStart,p.representationEnd,{value:p.source[p.representationStart]}]);case v:case r:case d:case t:case b:return consumeWhiteSpace(p);case S:return checkIfThreeCodePointsWouldStartANumber(p)?consumeNumericToken(C,p):checkIfThreeCodePointsWouldStartCDC(p)?(p.advanceCodePoint(3),[j.CDC,"--\x3e",p.representationStart,p.representationEnd,void 0]):checkIfThreeCodePointsWouldStartAnIdentSequence(0,p)?consumeIdentLikeToken(C,p):(p.advanceCodePoint(),[j.Delim,"-",p.representationStart,p.representationEnd,{value:"-"}]);case E:return checkIfFourCodePointsWouldStartCDO(p)?(p.advanceCodePoint(4),[j.CDO,"\x3c!--",p.representationStart,p.representationEnd,void 0]):(p.advanceCodePoint(),[j.Delim,"<",p.representationStart,p.representationEnd,{value:"<"}]);case c:if(p.advanceCodePoint(),checkIfThreeCodePointsWouldStartAnIdentSequence(0,p)){const e=consumeIdentSequence(C,p);return[j.AtKeyword,p.source.slice(p.representationStart,p.representationEnd+1),p.representationStart,p.representationEnd,{value:String.fromCodePoint(...e)}]}return[j.Delim,"@",p.representationStart,p.representationEnd,{value:"@"}];case L:return checkIfTwoCodePointsAreAValidEscape(p)?consumeIdentLikeToken(C,p):(p.advanceCodePoint(),C.onParseError(new ParseError('Invalid escape sequence after "\\"',p.representationStart,p.representationEnd,["4.3.1. Consume a token","U+005C REVERSE SOLIDUS (\\)","The input stream does not start with a valid escape sequence"])),[j.Delim,"\\",p.representationStart,p.representationEnd,{value:"\\"}])}return p.advanceCodePoint(),[j.Delim,p.source[p.representationStart],p.representationStart,p.representationEnd,{value:p.source[p.representationStart]}]},endOfFile:function endOfFile(){return void 0===p.codePointSource[p.cursor]}}}function noop(){}function mutateIdent(e,n){const o=[];for(const e of n)o.push(e.codePointAt(0));const r=String.fromCodePoint(...ensureThatValueRoundTripsAsIdent(o));e[1]=r,e[4].value=n}function mutateUnit(e,n){const o=[];for(const e of n)o.push(e.codePointAt(0));const r=ensureThatValueRoundTripsAsIdent(o);101===r[0]&&insertEscapedCodePoint(r,0,r[0]);const t=String.fromCodePoint(...r),i="+"===e[4].signCharacter?e[4].signCharacter:"",s=e[4].value.toString();e[1]=`${i}${s}${t}`,e[4].unit=n}function ensureThatValueRoundTripsAsIdent(e){let n=0;e[0]===S&&e[1]===S?n=2:e[0]===S&&e[1]?(n=2,isIdentStartCodePoint(e[1])||(n+=insertEscapedCodePoint(e,1,e[1]))):isIdentStartCodePoint(e[0])?n=1:(n=1,n+=insertEscapedCodePoint(e,0,e[0]));for(let o=n;o<e.length;o++)isIdentCodePoint(e[o])||(o+=insertEscapedCodePoint(e,o,e[o]));return e}function insertEscapedCodePoint(e,n,o){const r=o.toString(16),t=[];for(const e of r)t.push(e.codePointAt(0));const i=e[n+1];return n===e.length-1||i&&isHexDigitCodePoint(i)?(e.splice(n,1,92,...t,32),1+t.length):(e.splice(n,1,92,...t),t.length)}!function(e){e.Comment="comment",e.AtKeyword="at-keyword-token",e.BadString="bad-string-token",e.BadURL="bad-url-token",e.CDC="CDC-token",e.CDO="CDO-token",e.Colon="colon-token",e.Comma="comma-token",e.Delim="delim-token",e.Dimension="dimension-token",e.EOF="EOF-token",e.Function="function-token",e.Hash="hash-token",e.Ident="ident-token",e.Number="number-token",e.Percentage="percentage-token",e.Semicolon="semicolon-token",e.String="string-token",e.URL="url-token",e.Whitespace="whitespace-token",e.OpenParen="(-token",e.CloseParen=")-token",e.OpenSquare="[-token",e.CloseSquare="]-token",e.OpenCurly="{-token",e.CloseCurly="}-token",e.UnicodeRange="unicode-range-token"}(j||(j={})),function(e){e.Integer="integer",e.Number="number"}(Q||(Q={})),function(e){e.Unrestricted="unrestricted",e.ID="id"}(G||(G={}));const X=Object.values(j);function isToken(e){return!!Array.isArray(e)&&(!(e.length<4)&&(!!X.includes(e[0])&&("string"==typeof e[1]&&("number"==typeof e[2]&&"number"==typeof e[3]))))}function isTokenNumeric(e){switch(e[0]){case j.Dimension:case j.Number:case j.Percentage:return!0;default:return!1}}function isTokenWhiteSpaceOrComment(e){switch(e[0]){case j.Whitespace:case j.Comment:return!0;default:return!1}}function isTokenAtKeyword(e){return!!e&&e[0]===j.AtKeyword}function isTokenBadString(e){return!!e&&e[0]===j.BadString}function isTokenBadURL(e){return!!e&&e[0]===j.BadURL}function isTokenCDC(e){return!!e&&e[0]===j.CDC}function isTokenCDO(e){return!!e&&e[0]===j.CDO}function isTokenColon(e){return!!e&&e[0]===j.Colon}function isTokenComma(e){return!!e&&e[0]===j.Comma}function isTokenComment(e){return!!e&&e[0]===j.Comment}function isTokenDelim(e){return!!e&&e[0]===j.Delim}function isTokenDimension(e){return!!e&&e[0]===j.Dimension}function isTokenEOF(e){return!!e&&e[0]===j.EOF}function isTokenFunction(e){return!!e&&e[0]===j.Function}function isTokenHash(e){return!!e&&e[0]===j.Hash}function isTokenIdent(e){return!!e&&e[0]===j.Ident}function isTokenNumber(e){return!!e&&e[0]===j.Number}function isTokenPercentage(e){return!!e&&e[0]===j.Percentage}function isTokenSemicolon(e){return!!e&&e[0]===j.Semicolon}function isTokenString(e){return!!e&&e[0]===j.String}function isTokenURL(e){return!!e&&e[0]===j.URL}function isTokenWhitespace(e){return!!e&&e[0]===j.Whitespace}function isTokenOpenParen(e){return!!e&&e[0]===j.OpenParen}function isTokenCloseParen(e){return!!e&&e[0]===j.CloseParen}function isTokenOpenSquare(e){return!!e&&e[0]===j.OpenSquare}function isTokenCloseSquare(e){return!!e&&e[0]===j.CloseSquare}function isTokenOpenCurly(e){return!!e&&e[0]===j.OpenCurly}function isTokenCloseCurly(e){return!!e&&e[0]===j.CloseCurly}function isTokenUnicodeRange(e){return!!e&&e[0]===j.UnicodeRange}export{G as HashType,Q as NumberType,ParseError,Reader,j as TokenType,cloneTokens,isToken,isTokenAtKeyword,isTokenBadString,isTokenBadURL,isTokenCDC,isTokenCDO,isTokenCloseCurly,isTokenCloseParen,isTokenCloseSquare,isTokenColon,isTokenComma,isTokenComment,isTokenDelim,isTokenDimension,isTokenEOF,isTokenFunction,isTokenHash,isTokenIdent,isTokenNumber,isTokenNumeric,isTokenOpenCurly,isTokenOpenParen,isTokenOpenSquare,isTokenPercentage,isTokenSemicolon,isTokenString,isTokenURL,isTokenUnicodeRange,isTokenWhiteSpaceOrComment,isTokenWhitespace,mirrorVariant,mirrorVariantType,mutateIdent,mutateUnit,stringify,tokenize,tokenizer};
diff --git a/node_modules/@csstools/css-tokenizer/package.json b/node_modules/@csstools/css-tokenizer/package.json
index e050098e..0cbfad60 100644
--- a/node_modules/@csstools/css-tokenizer/package.json
+++ b/node_modules/@csstools/css-tokenizer/package.json
@@ -1,7 +1,7 @@
{
"name": "@csstools/css-tokenizer",
"description": "Tokenize CSS",
- "version": "2.2.3",
+ "version": "2.3.1",
"contributors": [
{
"name": "Antonio Laguna",
@@ -50,7 +50,7 @@
"homepage": "https://github.com/csstools/postcss-plugins/tree/main/packages/css-tokenizer#readme",
"repository": {
"type": "git",
- "url": "https://github.com/csstools/postcss-plugins.git",
+ "url": "git+https://github.com/csstools/postcss-plugins.git",
"directory": "packages/css-tokenizer"
},
"bugs": "https://github.com/csstools/postcss-plugins/issues",
diff --git a/node_modules/@csstools/media-query-list-parser/CHANGELOG.md b/node_modules/@csstools/media-query-list-parser/CHANGELOG.md
index 6ce1c871..c86eee1d 100644
--- a/node_modules/@csstools/media-query-list-parser/CHANGELOG.md
+++ b/node_modules/@csstools/media-query-list-parser/CHANGELOG.md
@@ -1,27 +1,24 @@
# Changes to Media Query List Parser
-### 2.1.7
+### 2.1.11
-_December 31, 2023_
+_May 4, 2024_
-- Updated [`@csstools/css-tokenizer`](https://github.com/csstools/postcss-plugins/tree/main/packages/css-tokenizer) to [`2.2.3`](https://github.com/csstools/postcss-plugins/tree/main/packages/css-tokenizer/CHANGELOG.md#223) (patch)
-- Updated [`@csstools/css-parser-algorithms`](https://github.com/csstools/postcss-plugins/tree/main/packages/css-parser-algorithms) to [`2.5.0`](https://github.com/csstools/postcss-plugins/tree/main/packages/css-parser-algorithms/CHANGELOG.md#250) (minor)
+- Updated [`@csstools/css-tokenizer`](https://github.com/csstools/postcss-plugins/tree/main/packages/css-tokenizer) to [`2.3.1`](https://github.com/csstools/postcss-plugins/tree/main/packages/css-tokenizer/CHANGELOG.md#231) (patch)
+- Updated [`@csstools/css-parser-algorithms`](https://github.com/csstools/postcss-plugins/tree/main/packages/css-parser-algorithms) to [`2.6.3`](https://github.com/csstools/postcss-plugins/tree/main/packages/css-parser-algorithms/CHANGELOG.md#263) (patch)
-### 2.1.6
+### 2.1.10
-_December 15, 2023_
+_May 4, 2024_
-- Fix type definitions
-- Only `walk` child nodes if they are still part of the current AST tree [#1202](https://github.com/csstools/postcss-plugins/issues/1202)
-- Make `walk` methods safe for mutations [#1204](https://github.com/csstools/postcss-plugins/issues/1204)
-- Updated [`@csstools/css-tokenizer`](https://github.com/csstools/postcss-plugins/tree/main/packages/css-tokenizer) to [`2.2.2`](https://github.com/csstools/postcss-plugins/tree/main/packages/css-tokenizer/CHANGELOG.md#222) (patch)
-- Updated [`@csstools/css-parser-algorithms`](https://github.com/csstools/postcss-plugins/tree/main/packages/css-parser-algorithms) to [`2.4.0`](https://github.com/csstools/postcss-plugins/tree/main/packages/css-parser-algorithms/CHANGELOG.md#240) (minor)
+- Updated [`@csstools/css-tokenizer`](https://github.com/csstools/postcss-plugins/tree/main/packages/css-tokenizer) to [`2.3.0`](https://github.com/csstools/postcss-plugins/tree/main/packages/css-tokenizer/CHANGELOG.md#230) (minor)
+- Updated [`@csstools/css-parser-algorithms`](https://github.com/csstools/postcss-plugins/tree/main/packages/css-parser-algorithms) to [`2.6.2`](https://github.com/csstools/postcss-plugins/tree/main/packages/css-parser-algorithms/CHANGELOG.md#262) (patch)
-### 2.1.5
+### 2.1.9
-_September 24, 2023_
+_March 13, 2024_
-- Updated [`@csstools/css-tokenizer`](https://github.com/csstools/postcss-plugins/tree/main/packages/css-tokenizer) to [`2.2.1`](https://github.com/csstools/postcss-plugins/tree/main/packages/css-tokenizer/CHANGELOG.md#221) (patch)
-- Updated [`@csstools/css-parser-algorithms`](https://github.com/csstools/postcss-plugins/tree/main/packages/css-parser-algorithms) to [`2.3.2`](https://github.com/csstools/postcss-plugins/tree/main/packages/css-parser-algorithms/CHANGELOG.md#232) (patch)
+- Updated [`@csstools/css-tokenizer`](https://github.com/csstools/postcss-plugins/tree/main/packages/css-tokenizer) to [`2.2.4`](https://github.com/csstools/postcss-plugins/tree/main/packages/css-tokenizer/CHANGELOG.md#224) (patch)
+- Updated [`@csstools/css-parser-algorithms`](https://github.com/csstools/postcss-plugins/tree/main/packages/css-parser-algorithms) to [`2.6.1`](https://github.com/csstools/postcss-plugins/tree/main/packages/css-parser-algorithms/CHANGELOG.md#261) (patch)
[Full CHANGELOG](https://github.com/csstools/postcss-plugins/tree/main/packages/media-query-list-parser/CHANGELOG.md)
diff --git a/node_modules/@csstools/media-query-list-parser/dist/index.cjs b/node_modules/@csstools/media-query-list-parser/dist/index.cjs
index 8d3e5aea..702e5c1e 100644
--- a/node_modules/@csstools/media-query-list-parser/dist/index.cjs
+++ b/node_modules/@csstools/media-query-list-parser/dist/index.cjs
@@ -1 +1 @@
-"use strict";var e,t=require("@csstools/css-parser-algorithms"),i=require("@csstools/css-tokenizer");exports.NodeType=void 0,(e=exports.NodeType||(exports.NodeType={})).CustomMedia="custom-media",e.GeneralEnclosed="general-enclosed",e.MediaAnd="media-and",e.MediaCondition="media-condition",e.MediaConditionListWithAnd="media-condition-list-and",e.MediaConditionListWithOr="media-condition-list-or",e.MediaFeature="media-feature",e.MediaFeatureBoolean="mf-boolean",e.MediaFeatureName="mf-name",e.MediaFeaturePlain="mf-plain",e.MediaFeatureRangeNameValue="mf-range-name-value",e.MediaFeatureRangeValueName="mf-range-value-name",e.MediaFeatureRangeValueNameValue="mf-range-value-name-value",e.MediaFeatureValue="mf-value",e.MediaInParens="media-in-parens",e.MediaNot="media-not",e.MediaOr="media-or",e.MediaQueryWithType="media-query-with-type",e.MediaQueryWithoutType="media-query-without-type",e.MediaQueryInvalid="media-query-invalid";const a=/[A-Z]/g;function toLowerCaseAZ(e){return e.replace(a,(e=>String.fromCharCode(e.charCodeAt(0)+32)))}class MediaCondition{type=exports.NodeType.MediaCondition;media;constructor(e){this.media=e}tokens(){return this.media.tokens()}toString(){return this.media.toString()}indexOf(e){return e===this.media?"media":-1}at(e){if("media"===e)return this.media}walk(e,t){let i;return t&&(i={...t}),!1!==e({node:this.media,parent:this,state:i},"media")&&this.media.walk(e,i)}toJSON(){return{type:this.type,media:this.media.toJSON()}}isMediaCondition(){return MediaCondition.isMediaCondition(this)}static isMediaCondition(e){return!!e&&(e instanceof MediaCondition&&e.type===exports.NodeType.MediaCondition)}}class MediaInParens{type=exports.NodeType.MediaInParens;media;before;after;constructor(e,t=[],i=[]){this.media=e,this.before=t,this.after=i}tokens(){return[...this.before,...this.media.tokens(),...this.after]}toString(){return i.stringify(...this.before)+this.media.toString()+i.stringify(...this.after)}indexOf(e){return e===this.media?"media":-1}at(e){if("media"===e)return this.media}walk(e,t){let i;return t&&(i={...t}),!1!==e({node:this.media,parent:this,state:i},"media")&&("walk"in this.media?this.media.walk(e,i):void 0)}toJSON(){return{type:this.type,media:this.media.toJSON(),before:this.before,after:this.after}}isMediaInParens(){return MediaInParens.isMediaInParens(this)}static isMediaInParens(e){return!!e&&(e instanceof MediaInParens&&e.type===exports.NodeType.MediaInParens)}}class MediaQueryWithType{type=exports.NodeType.MediaQueryWithType;modifier;mediaType;and=void 0;media=void 0;constructor(e,t,i,a){this.modifier=e,this.mediaType=t,i&&a&&(this.and=i,this.media=a)}getModifier(){if(!this.modifier.length)return"";for(let e=0;e<this.modifier.length;e++){const t=this.modifier[e];if(t[0]===i.TokenType.Ident)return t[4].value}return""}negateQuery(){const e=new MediaQueryWithType([...this.modifier],[...this.mediaType],this.and,this.media);if(0===e.modifier.length)return e.modifier=[[i.TokenType.Ident,"not",-1,-1,{value:"not"}],[i.TokenType.Whitespace," ",-1,-1,void 0]],e;for(let t=0;t<e.modifier.length;t++){const a=e.modifier[t];if(a[0]===i.TokenType.Ident&&"not"===toLowerCaseAZ(a[4].value)){e.modifier.splice(t,1);break}if(a[0]===i.TokenType.Ident&&"only"===toLowerCaseAZ(a[4].value)){a[1]="not",a[4].value="not";break}}return e}getMediaType(){if(!this.mediaType.length)return"";for(let e=0;e<this.mediaType.length;e++){const t=this.mediaType[e];if(t[0]===i.TokenType.Ident)return t[4].value}return""}tokens(){return this.and&&this.media?[...this.modifier,...this.mediaType,...this.and,...this.media.tokens()]:[...this.modifier,...this.mediaType]}toString(){return this.and&&this.media?i.stringify(...this.modifier)+i.stringify(...this.mediaType)+i.stringify(...this.and)+this.media.toString():i.stringify(...this.modifier)+i.stringify(...this.mediaType)}indexOf(e){return e===this.media?"media":-1}at(e){if("media"===e)return this.media}walk(e,t){let i;if(t&&(i={...t}),this.media)return!1!==e({node:this.media,parent:this,state:i},"media")&&this.media.walk(e,i)}toJSON(){return{type:this.type,string:this.toString(),modifier:this.modifier,mediaType:this.mediaType,and:this.and,media:this.media}}isMediaQueryWithType(){return MediaQueryWithType.isMediaQueryWithType(this)}static isMediaQueryWithType(e){return!!e&&(e instanceof MediaQueryWithType&&e.type===exports.NodeType.MediaQueryWithType)}}class MediaQueryWithoutType{type=exports.NodeType.MediaQueryWithoutType;media;constructor(e){this.media=e}negateQuery(){let e=this.media;if(e.media.type===exports.NodeType.MediaNot)return new MediaQueryWithoutType(new MediaCondition(e.media.media));e.media.type===exports.NodeType.MediaConditionListWithOr&&(e=new MediaCondition(new MediaInParens(e,[[i.TokenType.Whitespace," ",0,0,void 0],[i.TokenType.OpenParen,"(",0,0,void 0]],[[i.TokenType.CloseParen,")",0,0,void 0]])));return new MediaQueryWithType([[i.TokenType.Ident,"not",0,0,{value:"not"}],[i.TokenType.Whitespace," ",0,0,void 0]],[[i.TokenType.Ident,"all",0,0,{value:"all"}],[i.TokenType.Whitespace," ",0,0,void 0]],[[i.TokenType.Ident,"and",0,0,{value:"and"}]],e)}tokens(){return this.media.tokens()}toString(){return this.media.toString()}indexOf(e){return e===this.media?"media":-1}at(e){if("media"===e)return this.media}walk(e,t){let i;return t&&(i={...t}),!1!==e({node:this.media,parent:this,state:i},"media")&&this.media.walk(e,i)}toJSON(){return{type:this.type,string:this.toString(),media:this.media}}isMediaQueryWithoutType(){return MediaQueryWithoutType.isMediaQueryWithoutType(this)}static isMediaQueryWithoutType(e){return!!e&&(e instanceof MediaQueryWithoutType&&e.type===exports.NodeType.MediaQueryWithoutType)}}class MediaQueryInvalid{type=exports.NodeType.MediaQueryInvalid;media;constructor(e){this.media=e}negateQuery(){return new MediaQueryInvalid(this.media)}tokens(){return this.media.flatMap((e=>e.tokens()))}toString(){return this.media.map((e=>e.toString())).join("")}walk(e,i){if(0===this.media.length)return;const a=t.walkerIndexGenerator(this.media);let r=0;for(;r<this.media.length;){const t=this.media[r];let n;if(i&&(n={...i}),!1===e({node:t,parent:this,state:n},r))return!1;if("walk"in t&&this.media.includes(t)&&!1===t.walk(e,n))return!1;if(r=a(this.media,t,r),-1===r)break}}toJSON(){return{type:this.type,string:this.toString(),media:this.media}}isMediaQueryInvalid(){return MediaQueryInvalid.isMediaQueryInvalid(this)}static isMediaQueryInvalid(e){return!!e&&(e instanceof MediaQueryInvalid&&e.type===exports.NodeType.MediaQueryInvalid)}}class GeneralEnclosed{type=exports.NodeType.GeneralEnclosed;value;constructor(e){this.value=e}tokens(){return this.value.tokens()}toString(){return this.value.toString()}indexOf(e){return e===this.value?"value":-1}at(e){if("value"===e)return this.value}walk(e,t){let i;return t&&(i={...t}),!1!==e({node:this.value,parent:this,state:i},"value")&&("walk"in this.value?this.value.walk(e,i):void 0)}toJSON(){return{type:this.type,tokens:this.tokens()}}isGeneralEnclosed(){return GeneralEnclosed.isGeneralEnclosed(this)}static isGeneralEnclosed(e){return!!e&&(e instanceof GeneralEnclosed&&e.type===exports.NodeType.GeneralEnclosed)}}class MediaAnd{type=exports.NodeType.MediaAnd;modifier;media;constructor(e,t){this.modifier=e,this.media=t}tokens(){return[...this.modifier,...this.media.tokens()]}toString(){return i.stringify(...this.modifier)+this.media.toString()}indexOf(e){return e===this.media?"media":-1}at(e){return"media"===e?this.media:null}walk(e,t){let i;return t&&(i={...t}),!1!==e({node:this.media,parent:this,state:i},"media")&&this.media.walk(e,i)}toJSON(){return{type:this.type,modifier:this.modifier,media:this.media.toJSON()}}isMediaAnd(){return MediaAnd.isMediaAnd(this)}static isMediaAnd(e){return!!e&&(e instanceof MediaAnd&&e.type===exports.NodeType.MediaAnd)}}class MediaConditionListWithAnd{type=exports.NodeType.MediaConditionListWithAnd;leading;list;before;after;constructor(e,t,i=[],a=[]){this.leading=e,this.list=t,this.before=i,this.after=a}tokens(){return[...this.before,...this.leading.tokens(),...this.list.flatMap((e=>e.tokens())),...this.after]}toString(){return i.stringify(...this.before)+this.leading.toString()+this.list.map((e=>e.toString())).join("")+i.stringify(...this.after)}indexOf(e){return e===this.leading?"leading":"media-and"===e.type?this.list.indexOf(e):-1}at(e){return"leading"===e?this.leading:"number"==typeof e?(e<0&&(e=this.list.length+e),this.list[e]):void 0}walk(e,i){let a;if(i&&(a={...i}),!1===e({node:this.leading,parent:this,state:a},"leading"))return!1;if("walk"in this.leading&&!1===this.leading.walk(e,a))return!1;if(0===this.list.length)return;const r=t.walkerIndexGenerator(this.list);let n=0;for(;n<this.list.length;){const t=this.list[n];if(i&&(a={...i}),!1===e({node:t,parent:this,state:a},n))return!1;if("walk"in t&&this.list.includes(t)&&!1===t.walk(e,a))return!1;if(n=r(this.list,t,n),-1===n)break}}toJSON(){return{type:this.type,leading:this.leading.toJSON(),list:this.list.map((e=>e.toJSON())),before:this.before,after:this.after}}isMediaConditionListWithAnd(){return MediaConditionListWithAnd.isMediaConditionListWithAnd(this)}static isMediaConditionListWithAnd(e){return!!e&&(e instanceof MediaConditionListWithAnd&&e.type===exports.NodeType.MediaConditionListWithAnd)}}class MediaConditionListWithOr{type=exports.NodeType.MediaConditionListWithOr;leading;list;before;after;constructor(e,t,i=[],a=[]){this.leading=e,this.list=t,this.before=i,this.after=a}tokens(){return[...this.before,...this.leading.tokens(),...this.list.flatMap((e=>e.tokens())),...this.after]}toString(){return i.stringify(...this.before)+this.leading.toString()+this.list.map((e=>e.toString())).join("")+i.stringify(...this.after)}indexOf(e){return e===this.leading?"leading":"media-or"===e.type?this.list.indexOf(e):-1}at(e){return"leading"===e?this.leading:"number"==typeof e?(e<0&&(e=this.list.length+e),this.list[e]):void 0}walk(e,i){let a;if(i&&(a={...i}),!1===e({node:this.leading,parent:this,state:a},"leading"))return!1;if("walk"in this.leading&&!1===this.leading.walk(e,a))return!1;if(0===this.list.length)return;const r=t.walkerIndexGenerator(this.list);let n=0;for(;n<this.list.length;){const t=this.list[n];if(i&&(a={...i}),!1===e({node:t,parent:this,state:a},n))return!1;if("walk"in t&&this.list.includes(t)&&!1===t.walk(e,a))return!1;if(n=r(this.list,t,n),-1===n)break}}toJSON(){return{type:this.type,leading:this.leading.toJSON(),list:this.list.map((e=>e.toJSON())),before:this.before,after:this.after}}isMediaConditionListWithOr(){return MediaConditionListWithOr.isMediaConditionListWithOr(this)}static isMediaConditionListWithOr(e){return!!e&&(e instanceof MediaConditionListWithOr&&e.type===exports.NodeType.MediaConditionListWithOr)}}function isNumber(e){return!!(e.type===t.ComponentValueType.Token&&e.value[0]===i.TokenType.Number||e.type===t.ComponentValueType.Function&&r.has(toLowerCaseAZ(e.name[4].value)))}const r=new Set(["abs","acos","asin","atan","atan2","calc","clamp","cos","exp","hypot","log","max","min","mod","pow","rem","round","sign","sin","sqrt","tan"]);function isDimension(e){return e.type===t.ComponentValueType.Token&&e.value[0]===i.TokenType.Dimension}function isIdent(e){return e.type===t.ComponentValueType.Token&&e.value[0]===i.TokenType.Ident}function isEnvironmentVariable(e){return e.type===t.ComponentValueType.Function&&"env"===toLowerCaseAZ(e.name[4].value)}class MediaFeatureName{type=exports.NodeType.MediaFeatureName;name;before;after;constructor(e,t=[],i=[]){this.name=e,this.before=t,this.after=i}getName(){return this.name.value[4].value}getNameToken(){return this.name.value}tokens(){return[...this.before,...this.name.tokens(),...this.after]}toString(){return i.stringify(...this.before)+this.name.toString()+i.stringify(...this.after)}indexOf(e){return e===this.name?"name":-1}at(e){if("name"===e)return this.name}toJSON(){return{type:this.type,name:this.getName(),tokens:this.tokens()}}isMediaFeatureName(){return MediaFeatureName.isMediaFeatureName(this)}static isMediaFeatureName(e){return!!e&&(e instanceof MediaFeatureName&&e.type===exports.NodeType.MediaFeatureName)}}function parseMediaFeatureName(e){let i=-1;for(let a=0;a<e.length;a++){const r=e[a];if(r.type!==t.ComponentValueType.Whitespace&&r.type!==t.ComponentValueType.Comment){if(!isIdent(r))return!1;if(-1!==i)return!1;i=a}}return-1!==i&&new MediaFeatureName(e[i],e.slice(0,i).flatMap((e=>e.tokens())),e.slice(i+1).flatMap((e=>e.tokens())))}class MediaFeatureBoolean{type=exports.NodeType.MediaFeatureBoolean;name;constructor(e){this.name=e}getName(){return this.name.getName()}getNameToken(){return this.name.getNameToken()}tokens(){return this.name.tokens()}toString(){return this.name.toString()}indexOf(e){return e===this.name?"name":-1}at(e){if("name"===e)return this.name}toJSON(){return{type:this.type,name:this.name.toJSON(),tokens:this.tokens()}}isMediaFeatureBoolean(){return MediaFeatureBoolean.isMediaFeatureBoolean(this)}static isMediaFeatureBoolean(e){return!!e&&(e instanceof MediaFeatureBoolean&&e.type===exports.NodeType.MediaFeatureBoolean)}}function parseMediaFeatureBoolean(e){const t=parseMediaFeatureName(e);return!1===t?t:new MediaFeatureBoolean(t)}class MediaFeatureValue{type=exports.NodeType.MediaFeatureValue;value;before;after;constructor(e,t=[],i=[]){Array.isArray(e)&&1===e.length?this.value=e[0]:this.value=e,this.before=t,this.after=i}tokens(){return Array.isArray(this.value)?[...this.before,...this.value.flatMap((e=>e.tokens())),...this.after]:[...this.before,...this.value.tokens(),...this.after]}toString(){return Array.isArray(this.value)?i.stringify(...this.before)+this.value.map((e=>e.toString())).join("")+i.stringify(...this.after):i.stringify(...this.before)+this.value.toString()+i.stringify(...this.after)}indexOf(e){return e===this.value?"value":-1}at(e){return"value"===e?this.value:Array.isArray(this.value)&&"number"==typeof e?(e<0&&(e=this.value.length+e),this.value[e]):void 0}walk(e,i){if(Array.isArray(this.value)){if(0===this.value.length)return;const a=t.walkerIndexGenerator(this.value);let r=0;for(;r<this.value.length;){const t=this.value[r];let n;if(i&&(n={...i}),!1===e({node:t,parent:this,state:n},r))return!1;if("walk"in t&&this.value.includes(t)&&!1===t.walk(e,n))return!1;if(r=a(this.value,t,r),-1===r)break}}else{let t;if(i&&(t={...i}),!1===e({node:this.value,parent:this,state:t},"value"))return!1;if("walk"in this.value)return this.value.walk(e,t)}}toJSON(){return Array.isArray(this.value)?{type:this.type,value:this.value.map((e=>e.toJSON())),tokens:this.tokens()}:{type:this.type,value:this.value.toJSON(),tokens:this.tokens()}}isMediaFeatureValue(){return MediaFeatureValue.isMediaFeatureValue(this)}static isMediaFeatureValue(e){return!!e&&(e instanceof MediaFeatureValue&&e.type===exports.NodeType.MediaFeatureValue)}}function parseMediaFeatureValue(e,i=!1){let a=-1,r=-1;for(let n=0;n<e.length;n++){const s=e[n];if(s.type!==t.ComponentValueType.Whitespace&&s.type!==t.ComponentValueType.Comment){if(-1!==a)return!1;if(isNumber(s)){const t=matchesRatioExactly(e.slice(n));if(-1!==t){a=t[0]+n,r=t[1]+n,n+=t[1]-t[0];continue}a=n,r=n}else if(isEnvironmentVariable(s))a=n,r=n;else if(isDimension(s))a=n,r=n;else{if(i||!isIdent(s))return!1;a=n,r=n}}}return-1!==a&&new MediaFeatureValue(e.slice(a,r+1),e.slice(0,a).flatMap((e=>e.tokens())),e.slice(r+1).flatMap((e=>e.tokens())))}function matchesRatioExactly(e){let t=-1,i=-1;const a=matchesRatio(e);if(-1===a)return-1;t=a[0],i=a[1];for(let t=i+1;t<e.length;t++){const i=e[t];if("whitespace"!==i.type&&"comment"!==i.type)return-1}return[t,i]}function matchesRatio(e){let t=-1,a=-1;for(let r=0;r<e.length;r++){const n=e[r];if("whitespace"!==n.type&&"comment"!==n.type){if("token"===n.type){const e=n.value;if(e[0]===i.TokenType.Delim&&"/"===e[4].value){if(-1===t)return-1;if(-1!==a)return-1;a=r;continue}}if(!isNumber(n))return-1;if(-1!==a)return[t,r];if(-1!==t)return-1;t=r}}return-1}class MediaFeaturePlain{type=exports.NodeType.MediaFeaturePlain;name;colon;value;constructor(e,t,i){this.name=e,this.colon=t,this.value=i}getName(){return this.name.getName()}getNameToken(){return this.name.getNameToken()}tokens(){return[...this.name.tokens(),this.colon,...this.value.tokens()]}toString(){return this.name.toString()+i.stringify(this.colon)+this.value.toString()}indexOf(e){return e===this.name?"name":e===this.value?"value":-1}at(e){return"name"===e?this.name:"value"===e?this.value:void 0}walk(e,t){let i;return t&&(i={...t}),!1!==e({node:this.value,parent:this,state:i},"value")&&this.value.walk(e,i)}toJSON(){return{type:this.type,name:this.name.toJSON(),value:this.value.toJSON(),tokens:this.tokens()}}isMediaFeaturePlain(){return MediaFeaturePlain.isMediaFeaturePlain(this)}static isMediaFeaturePlain(e){return!!e&&(e instanceof MediaFeaturePlain&&e.type===exports.NodeType.MediaFeaturePlain)}}function parseMediaFeaturePlain(e){let a=[],r=[],n=null;for(let s=0;s<e.length;s++){const o=e[s];if(o.type===t.ComponentValueType.Token){const t=o.value;if(t[0]===i.TokenType.Colon){a=e.slice(0,s),r=e.slice(s+1),n=t;break}}}if(!a.length||!r.length||!n)return!1;const s=parseMediaFeatureName(a);if(!1===s)return!1;const o=parseMediaFeatureValue(r);return!1!==o&&new MediaFeaturePlain(s,n,o)}var n,s,o,u;function matchesComparison(e){let a=-1;for(let r=0;r<e.length;r++){const n=e[r];if(n.type===t.ComponentValueType.Token){const e=n.value;if(e[0]===i.TokenType.Delim){if(e[4].value===exports.MediaFeatureEQ.EQ)return-1!==a?[a,r]:[r,r];if(e[4].value===exports.MediaFeatureLT.LT){a=r;continue}if(e[4].value===exports.MediaFeatureGT.GT){a=r;continue}}}break}return-1!==a&&[a,a]}function comparisonFromTokens(e){if(0===e.length||e.length>2)return!1;if(e[0][0]!==i.TokenType.Delim)return!1;if(1===e.length)switch(e[0][4].value){case exports.MediaFeatureEQ.EQ:return exports.MediaFeatureEQ.EQ;case exports.MediaFeatureLT.LT:return exports.MediaFeatureLT.LT;case exports.MediaFeatureGT.GT:return exports.MediaFeatureGT.GT;default:return!1}if(e[1][0]!==i.TokenType.Delim)return!1;if(e[1][4].value!==exports.MediaFeatureEQ.EQ)return!1;switch(e[0][4].value){case exports.MediaFeatureLT.LT:return exports.MediaFeatureLT.LT_OR_EQ;case exports.MediaFeatureGT.GT:return exports.MediaFeatureGT.GT_OR_EQ;default:return!1}}exports.MediaFeatureLT=void 0,(n=exports.MediaFeatureLT||(exports.MediaFeatureLT={})).LT="<",n.LT_OR_EQ="<=",exports.MediaFeatureGT=void 0,(s=exports.MediaFeatureGT||(exports.MediaFeatureGT={})).GT=">",s.GT_OR_EQ=">=",exports.MediaFeatureEQ=void 0,(exports.MediaFeatureEQ||(exports.MediaFeatureEQ={})).EQ="=";class MediaFeatureRangeNameValue{type=exports.NodeType.MediaFeatureRangeNameValue;name;operator;value;constructor(e,t,i){this.name=e,this.operator=t,this.value=i}operatorKind(){return comparisonFromTokens(this.operator)}getName(){return this.name.getName()}getNameToken(){return this.name.getNameToken()}tokens(){return[...this.name.tokens(),...this.operator,...this.value.tokens()]}toString(){return this.name.toString()+i.stringify(...this.operator)+this.value.toString()}indexOf(e){return e===this.name?"name":e===this.value?"value":-1}at(e){return"name"===e?this.name:"value"===e?this.value:void 0}walk(e,t){let i;return t&&(i={...t}),!1!==e({node:this.value,parent:this,state:i},"value")&&("walk"in this.value?this.value.walk(e,i):void 0)}toJSON(){return{type:this.type,name:this.name.toJSON(),value:this.value.toJSON(),tokens:this.tokens()}}isMediaFeatureRangeNameValue(){return MediaFeatureRangeNameValue.isMediaFeatureRangeNameValue(this)}static isMediaFeatureRangeNameValue(e){return!!e&&(e instanceof MediaFeatureRangeNameValue&&e.type===exports.NodeType.MediaFeatureRangeNameValue)}}class MediaFeatureRangeValueName{type=exports.NodeType.MediaFeatureRangeValueName;name;operator;value;constructor(e,t,i){this.name=e,this.operator=t,this.value=i}operatorKind(){return comparisonFromTokens(this.operator)}getName(){return this.name.getName()}getNameToken(){return this.name.getNameToken()}tokens(){return[...this.value.tokens(),...this.operator,...this.name.tokens()]}toString(){return this.value.toString()+i.stringify(...this.operator)+this.name.toString()}indexOf(e){return e===this.name?"name":e===this.value?"value":-1}at(e){return"name"===e?this.name:"value"===e?this.value:void 0}walk(e,t){let i;return t&&(i={...t}),!1!==e({node:this.value,parent:this,state:i},"value")&&("walk"in this.value?this.value.walk(e,i):void 0)}toJSON(){return{type:this.type,name:this.name.toJSON(),value:this.value.toJSON(),tokens:this.tokens()}}isMediaFeatureRangeValueName(){return MediaFeatureRangeValueName.isMediaFeatureRangeValueName(this)}static isMediaFeatureRangeValueName(e){return!!e&&(e instanceof MediaFeatureRangeValueName&&e.type===exports.NodeType.MediaFeatureRangeValueName)}}class MediaFeatureRangeValueNameValue{type=exports.NodeType.MediaFeatureRangeValueNameValue;name;valueOne;valueOneOperator;valueTwo;valueTwoOperator;constructor(e,t,i,a,r){this.name=e,this.valueOne=t,this.valueOneOperator=i,this.valueTwo=a,this.valueTwoOperator=r}valueOneOperatorKind(){return comparisonFromTokens(this.valueOneOperator)}valueTwoOperatorKind(){return comparisonFromTokens(this.valueTwoOperator)}getName(){return this.name.getName()}getNameToken(){return this.name.getNameToken()}tokens(){return[...this.valueOne.tokens(),...this.valueOneOperator,...this.name.tokens(),...this.valueTwoOperator,...this.valueTwo.tokens()]}toString(){return this.valueOne.toString()+i.stringify(...this.valueOneOperator)+this.name.toString()+i.stringify(...this.valueTwoOperator)+this.valueTwo.toString()}indexOf(e){return e===this.name?"name":e===this.valueOne?"valueOne":e===this.valueTwo?"valueTwo":-1}at(e){return"name"===e?this.name:"valueOne"===e?this.valueOne:"valueTwo"===e?this.valueTwo:void 0}walk(e,t){let i;return t&&(i={...t}),!1!==e({node:this.valueOne,parent:this,state:i},"valueOne")&&((!("walk"in this.valueOne)||!1!==this.valueOne.walk(e,i))&&(t&&(i={...t}),!1!==e({node:this.valueTwo,parent:this,state:i},"valueTwo")&&((!("walk"in this.valueTwo)||!1!==this.valueTwo.walk(e,i))&&void 0)))}toJSON(){return{type:this.type,name:this.name.toJSON(),valueOne:this.valueOne.toJSON(),valueTwo:this.valueTwo.toJSON(),tokens:this.tokens()}}isMediaFeatureRangeValueNameValue(){return MediaFeatureRangeValueNameValue.isMediaFeatureRangeValueNameValue(this)}static isMediaFeatureRangeValueNameValue(e){return!!e&&(e instanceof MediaFeatureRangeValueNameValue&&e.type===exports.NodeType.MediaFeatureRangeValueNameValue)}}function parseMediaFeatureRange(e){let a=!1,r=!1;for(let n=0;n<e.length;n++){const s=e[n];if(s.type===t.ComponentValueType.Token){if(s.value[0]===i.TokenType.Delim){const t=matchesComparison(e.slice(n));if(!1!==t){if(!1!==a){r=[t[0]+n,t[1]+n];break}a=[t[0]+n,t[1]+n],n+=t[1]}}}}if(!1===a)return!1;const n=[e[a[0]].value];if(a[0]!==a[1]&&n.push(e[a[1]].value),!1===r){const t=e.slice(0,a[0]),i=e.slice(a[1]+1),r=parseMediaFeatureName(t);if(r){const e=parseMediaFeatureValue(i,!0);return!!e&&new MediaFeatureRangeNameValue(r,n,e)}const s=parseMediaFeatureName(i);if(s){const e=parseMediaFeatureValue(t,!0);return!!e&&new MediaFeatureRangeValueName(s,n,e)}return!1}const s=[e[r[0]].value];r[0]!==r[1]&&s.push(e[r[1]].value);const o=e.slice(0,a[0]),u=e.slice(a[1]+1,r[0]),d=e.slice(r[1]+1),l=parseMediaFeatureValue(o,!0),p=parseMediaFeatureName(u),h=parseMediaFeatureValue(d,!0);if(!l||!p||!h)return!1;{const e=comparisonFromTokens(n);if(!1===e||e===exports.MediaFeatureEQ.EQ)return!1;const t=comparisonFromTokens(s);if(!1===t||t===exports.MediaFeatureEQ.EQ)return!1;if(!(e!==exports.MediaFeatureLT.LT&&e!==exports.MediaFeatureLT.LT_OR_EQ||t!==exports.MediaFeatureGT.GT&&t!==exports.MediaFeatureGT.GT_OR_EQ))return!1;if(!(e!==exports.MediaFeatureGT.GT&&e!==exports.MediaFeatureGT.GT_OR_EQ||t!==exports.MediaFeatureLT.LT&&t!==exports.MediaFeatureLT.LT_OR_EQ))return!1}return new MediaFeatureRangeValueNameValue(p,l,n,h,s)}class MediaFeature{type=exports.NodeType.MediaFeature;feature;before;after;constructor(e,t=[],i=[]){this.feature=e,this.before=t,this.after=i}getName(){return this.feature.getName()}getNameToken(){return this.feature.getNameToken()}tokens(){return[...this.before,...this.feature.tokens(),...this.after]}toString(){return i.stringify(...this.before)+this.feature.toString()+i.stringify(...this.after)}indexOf(e){return e===this.feature?"feature":-1}at(e){if("feature"===e)return this.feature}walk(e,t){let i;return t&&(i={...t}),!1!==e({node:this.feature,parent:this,state:i},"feature")&&("walk"in this.feature?this.feature.walk(e,i):void 0)}toJSON(){return{type:this.type,feature:this.feature.toJSON(),before:this.before,after:this.after}}isMediaFeature(){return MediaFeature.isMediaFeature(this)}static isMediaFeature(e){return!!e&&(e instanceof MediaFeature&&e.type===exports.NodeType.MediaFeature)}}function parseMediaFeature(e,t=[],a=[]){if(e.startToken[0]!==i.TokenType.OpenParen)return!1;const r=parseMediaFeatureBoolean(e.value);if(!1!==r)return new MediaFeature(r,t,a);const n=parseMediaFeaturePlain(e.value);if(!1!==n)return new MediaFeature(n,t,a);const s=parseMediaFeatureRange(e.value);return!1!==s&&new MediaFeature(s,t,a)}class MediaNot{type=exports.NodeType.MediaNot;modifier;media;constructor(e,t){this.modifier=e,this.media=t}tokens(){return[...this.modifier,...this.media.tokens()]}toString(){return i.stringify(...this.modifier)+this.media.toString()}indexOf(e){return e===this.media?"media":-1}at(e){if("media"===e)return this.media}walk(e,t){let i;return t&&(i={...t}),!1!==e({node:this.media,parent:this,state:i},"media")&&this.media.walk(e,i)}toJSON(){return{type:this.type,modifier:this.modifier,media:this.media.toJSON()}}isMediaNot(){return MediaNot.isMediaNot(this)}static isMediaNot(e){return!!e&&(e instanceof MediaNot&&e.type===exports.NodeType.MediaNot)}}class MediaOr{type=exports.NodeType.MediaOr;modifier;media;constructor(e,t){this.modifier=e,this.media=t}tokens(){return[...this.modifier,...this.media.tokens()]}toString(){return i.stringify(...this.modifier)+this.media.toString()}indexOf(e){return e===this.media?"media":-1}at(e){if("media"===e)return this.media}walk(e,t){let i;return t&&(i={...t}),!1!==e({node:this.media,parent:this,state:i},"media")&&this.media.walk(e,i)}toJSON(){return{type:this.type,modifier:this.modifier,media:this.media.toJSON()}}isMediaOr(){return MediaOr.isMediaOr(this)}static isMediaOr(e){return!!e&&(e instanceof MediaOr&&e.type===exports.NodeType.MediaOr)}}function modifierFromToken(e){if(e[0]!==i.TokenType.Ident)return!1;switch(toLowerCaseAZ(e[4].value)){case exports.MediaQueryModifier.Not:return exports.MediaQueryModifier.Not;case exports.MediaQueryModifier.Only:return exports.MediaQueryModifier.Only;default:return!1}}function parseMediaQuery(e){{const t=parseMediaCondition(e);if(!1!==t)return new MediaQueryWithoutType(t)}{let a=-1,r=-1,n=-1;for(let s=0;s<e.length;s++){const o=e[s];if(!t.isWhitespaceNode(o)&&!t.isCommentNode(o)){if(t.isTokenNode(o)){const t=o.value;if(-1===a&&t[0]===i.TokenType.Ident&&modifierFromToken(t)){a=s;continue}if(-1===r&&t[0]===i.TokenType.Ident&&!modifierFromToken(t)){r=s;continue}if(-1===n&&t[0]===i.TokenType.Ident&&"and"===toLowerCaseAZ(t[4].value)){n=s;if(!1===parseMediaConditionWithoutOr(e.slice(s+1)))return!1;break}return!1}return!1}}let s=[],o=[];-1!==a?(s=e.slice(0,a+1).flatMap((e=>e.tokens())),-1!==r&&(o=e.slice(a+1,r+1).flatMap((e=>e.tokens())))):-1!==r&&(o=e.slice(0,r+1).flatMap((e=>e.tokens())));const u=parseMediaConditionWithoutOr(e.slice(Math.max(a,r,n)+1));return!1===u?new MediaQueryWithType(s,[...o,...e.slice(r+1).flatMap((e=>e.tokens()))]):new MediaQueryWithType(s,o,e.slice(r+1,n+1).flatMap((e=>e.tokens())),u)}}function parseMediaConditionListWithOr(e){let i=!1;const a=[];let r=-1,n=-1;for(let s=0;s<e.length;s++){if(i){const t=parseMediaOr(e.slice(s));if(!1!==t){s+=t.advance,a.push(t.node),n=s;continue}}const o=e[s];if(o.type!==t.ComponentValueType.Whitespace&&o.type!==t.ComponentValueType.Comment){if(i)return!1;if(!1!==i||!t.isSimpleBlockNode(o))return!1;if(o.normalize(),i=parseMediaInParensFromSimpleBlock(o),!1===i)return!1;r=s}}return!(!i||!a.length)&&new MediaConditionListWithOr(i,a,e.slice(0,r).flatMap((e=>e.tokens())),e.slice(n+1).flatMap((e=>e.tokens())))}function parseMediaConditionListWithAnd(e){let i=!1;const a=[];let r=-1,n=-1;for(let s=0;s<e.length;s++){if(i){const t=parseMediaAnd(e.slice(s));if(!1!==t){s+=t.advance,a.push(t.node),n=s;continue}}const o=e[s];if(o.type!==t.ComponentValueType.Whitespace&&o.type!==t.ComponentValueType.Comment){if(i)return!1;if(!1!==i||!t.isSimpleBlockNode(o))return!1;if(o.normalize(),i=parseMediaInParensFromSimpleBlock(o),!1===i)return!1;r=s}}return!(!i||!a.length)&&new MediaConditionListWithAnd(i,a,e.slice(0,r).flatMap((e=>e.tokens())),e.slice(n+1).flatMap((e=>e.tokens())))}function parseMediaCondition(e){const t=parseMediaNot(e);if(!1!==t)return new MediaCondition(t);const i=parseMediaConditionListWithAnd(e);if(!1!==i)return new MediaCondition(i);const a=parseMediaConditionListWithOr(e);if(!1!==a)return new MediaCondition(a);const r=parseMediaInParens(e);return!1!==r&&new MediaCondition(r)}function parseMediaConditionWithoutOr(e){const t=parseMediaNot(e);if(!1!==t)return new MediaCondition(t);const i=parseMediaConditionListWithAnd(e);if(!1!==i)return new MediaCondition(i);const a=parseMediaInParens(e);return!1!==a&&new MediaCondition(a)}function parseMediaInParens(e){let a=-1;for(let i=0;i<e.length;i++){const r=e[i];if(r.type!==t.ComponentValueType.Whitespace&&r.type!==t.ComponentValueType.Comment){if(!t.isSimpleBlockNode(r))return!1;if(-1!==a)return!1;a=i}}if(-1===a)return!1;const r=e[a];if(r.startToken[0]!==i.TokenType.OpenParen)return!1;r.normalize();const n=[...e.slice(0,a).flatMap((e=>e.tokens())),r.startToken],s=[r.endToken,...e.slice(a+1).flatMap((e=>e.tokens()))],o=parseMediaFeature(r,n,s);if(!1!==o)return new MediaInParens(o);const u=parseMediaCondition(r.value);return!1!==u?new MediaInParens(u,n,s):new MediaInParens(new GeneralEnclosed(r),e.slice(0,a).flatMap((e=>e.tokens())),e.slice(a+1).flatMap((e=>e.tokens())))}function parseMediaInParensFromSimpleBlock(e){if(e.startToken[0]!==i.TokenType.OpenParen)return!1;const t=parseMediaFeature(e,[e.startToken],[e.endToken]);if(!1!==t)return new MediaInParens(t);const a=parseMediaCondition(e.value);return!1!==a?new MediaInParens(a,[e.startToken],[e.endToken]):new MediaInParens(new GeneralEnclosed(e))}function parseMediaNot(e){let i=!1,a=null;for(let r=0;r<e.length;r++){const n=e[r];if(n.type!==t.ComponentValueType.Whitespace&&n.type!==t.ComponentValueType.Comment){if(isIdent(n)){if("not"===toLowerCaseAZ(n.value[4].value)){if(i)return!1;i=!0;continue}return!1}if(!i||!t.isSimpleBlockNode(n))return!1;{n.normalize();const t=parseMediaInParensFromSimpleBlock(n);if(!1===t)return!1;a=new MediaNot(e.slice(0,r).flatMap((e=>e.tokens())),t)}}}return a||!1}function parseMediaOr(e){let i=!1;for(let a=0;a<e.length;a++){const r=e[a];if(r.type!==t.ComponentValueType.Whitespace&&r.type!==t.ComponentValueType.Comment){if(isIdent(r)){if("or"===toLowerCaseAZ(r.value[4].value)){if(i)return!1;i=!0;continue}return!1}if(i&&t.isSimpleBlockNode(r)){r.normalize();const t=parseMediaInParensFromSimpleBlock(r);return!1!==t&&{advance:a,node:new MediaOr(e.slice(0,a).flatMap((e=>e.tokens())),t)}}return!1}}return!1}function parseMediaAnd(e){let i=!1;for(let a=0;a<e.length;a++){const r=e[a];if(r.type!==t.ComponentValueType.Whitespace&&r.type!==t.ComponentValueType.Comment){if(isIdent(r)){if("and"===toLowerCaseAZ(r.value[4].value)){if(i)return!1;i=!0;continue}return!1}if(i&&t.isSimpleBlockNode(r)){r.normalize();const t=parseMediaInParensFromSimpleBlock(r);return!1!==t&&{advance:a,node:new MediaAnd(e.slice(0,a).flatMap((e=>e.tokens())),t)}}return!1}}return!1}function parseFromTokens(e,i){const a=t.parseCommaSeparatedListOfComponentValues(e,{onParseError:i?.onParseError});return a.map(((e,t)=>{const r=parseMediaQuery(e);return 0==r&&!0===i?.preserveInvalidMediaQueries?new MediaQueryInvalid(a[t]):r})).filter((e=>!!e))}exports.MediaQueryModifier=void 0,(o=exports.MediaQueryModifier||(exports.MediaQueryModifier={})).Not="not",o.Only="only";class CustomMedia{type=exports.NodeType.CustomMedia;name;mediaQueryList=null;trueOrFalseKeyword=null;constructor(e,t,i){this.name=e,this.mediaQueryList=t,this.trueOrFalseKeyword=i??null}getName(){for(let e=0;e<this.name.length;e++){const t=this.name[e];if(t[0]===i.TokenType.Ident)return t[4].value}return""}getNameToken(){for(let e=0;e<this.name.length;e++){const t=this.name[e];if(t[0]===i.TokenType.Ident)return t}return null}hasMediaQueryList(){return!!this.mediaQueryList}hasTrueKeyword(){if(!this.trueOrFalseKeyword)return!1;for(let e=0;e<this.trueOrFalseKeyword.length;e++){const t=this.trueOrFalseKeyword[e];if(t[0]!==i.TokenType.Comment&&t[0]!==i.TokenType.Whitespace)return t[0]===i.TokenType.Ident&&"true"===toLowerCaseAZ(t[4].value)}return!1}hasFalseKeyword(){if(!this.trueOrFalseKeyword)return!1;for(let e=0;e<this.trueOrFalseKeyword.length;e++){const t=this.trueOrFalseKeyword[e];if(t[0]!==i.TokenType.Comment&&t[0]!==i.TokenType.Whitespace)return t[0]===i.TokenType.Ident&&"false"===toLowerCaseAZ(t[4].value)}return!1}tokens(){if(this.trueOrFalseKeyword)return[...this.name,...this.trueOrFalseKeyword];if(!this.mediaQueryList)return[...this.name];const e=[];for(let t=0;t<this.mediaQueryList.length;t++){const a=this.mediaQueryList[t];0!==t&&e.push([i.TokenType.Comma,",",-1,-1,void 0]),e.push(...a.tokens())}return[...this.name,...e]}toString(){return i.stringify(...this.tokens())}toJSON(){return{type:this.type,string:this.toString(),nameValue:this.getName(),name:this.name,hasFalseKeyword:this.hasFalseKeyword(),hasTrueKeyword:this.hasTrueKeyword(),trueOrFalseKeyword:this.trueOrFalseKeyword,mediaQueryList:this.mediaQueryList?.map((e=>e.toJSON()))}}isCustomMedia(){return CustomMedia.isCustomMedia(this)}static isCustomMedia(e){return!!e&&(e instanceof CustomMedia&&e.type===exports.NodeType.CustomMedia)}}function parseCustomMediaFromTokens(e,t){let a=[],r=e;for(let t=0;t<e.length;t++)if(e[t][0]!==i.TokenType.Comment&&e[t][0]!==i.TokenType.Whitespace){if(e[t][0]===i.TokenType.Ident){if(e[t][4].value.startsWith("--")){a=e.slice(0,t+1),r=e.slice(t+1);break}}return!1}let n=!0;for(let e=0;e<r.length;e++)if(r[e][0]!==i.TokenType.Comment&&r[e][0]!==i.TokenType.Whitespace){if(r[e][0]===i.TokenType.Ident){const t=toLowerCaseAZ(r[e][4].value);if("false"===t)continue;if("true"===t)continue}if(r[e][0]===i.TokenType.EOF)break;n=!1}return n?new CustomMedia(a,null,r):new CustomMedia(a,parseFromTokens(i.cloneTokens(r),t))}function isMediaConditionListWithAnd(e){return MediaConditionListWithAnd.isMediaConditionListWithAnd(e)}function isMediaConditionListWithOr(e){return MediaConditionListWithOr.isMediaConditionListWithOr(e)}function isMediaFeatureRangeNameValue(e){return MediaFeatureRangeNameValue.isMediaFeatureRangeNameValue(e)}function isMediaFeatureRangeValueName(e){return MediaFeatureRangeValueName.isMediaFeatureRangeValueName(e)}function isMediaFeatureRangeValueNameValue(e){return MediaFeatureRangeValueNameValue.isMediaFeatureRangeValueNameValue(e)}function isMediaQueryWithType(e){return MediaQueryWithType.isMediaQueryWithType(e)}function isMediaQueryWithoutType(e){return MediaQueryWithoutType.isMediaQueryWithoutType(e)}function isMediaQueryInvalid(e){return MediaQueryInvalid.isMediaQueryInvalid(e)}exports.MediaType=void 0,(u=exports.MediaType||(exports.MediaType={})).All="all",u.Print="print",u.Screen="screen",u.Tty="tty",u.Tv="tv",u.Projection="projection",u.Handheld="handheld",u.Braille="braille",u.Embossed="embossed",u.Aural="aural",u.Speech="speech",exports.CustomMedia=CustomMedia,exports.GeneralEnclosed=GeneralEnclosed,exports.MediaAnd=MediaAnd,exports.MediaCondition=MediaCondition,exports.MediaConditionListWithAnd=MediaConditionListWithAnd,exports.MediaConditionListWithOr=MediaConditionListWithOr,exports.MediaFeature=MediaFeature,exports.MediaFeatureBoolean=MediaFeatureBoolean,exports.MediaFeatureName=MediaFeatureName,exports.MediaFeaturePlain=MediaFeaturePlain,exports.MediaFeatureRangeNameValue=MediaFeatureRangeNameValue,exports.MediaFeatureRangeValueName=MediaFeatureRangeValueName,exports.MediaFeatureRangeValueNameValue=MediaFeatureRangeValueNameValue,exports.MediaFeatureValue=MediaFeatureValue,exports.MediaInParens=MediaInParens,exports.MediaNot=MediaNot,exports.MediaOr=MediaOr,exports.MediaQueryInvalid=MediaQueryInvalid,exports.MediaQueryWithType=MediaQueryWithType,exports.MediaQueryWithoutType=MediaQueryWithoutType,exports.cloneMediaQuery=function cloneMediaQuery(e){const t=i.cloneTokens(e.tokens()),a=parseFromTokens(t,{preserveInvalidMediaQueries:!0})[0];if(!a)throw new Error(`Failed to clone media query for : "${i.stringify(...t)}"`);if(isMediaQueryInvalid(e)&&isMediaQueryInvalid(a))return a;if(isMediaQueryWithType(e)&&isMediaQueryWithType(a))return a;if(isMediaQueryWithoutType(e)&&isMediaQueryWithoutType(a))return a;throw new Error(`Failed to clone media query for : "${i.stringify(...t)}"`)},exports.comparisonFromTokens=comparisonFromTokens,exports.invertComparison=function invertComparison(e){switch(e){case exports.MediaFeatureEQ.EQ:return exports.MediaFeatureEQ.EQ;case exports.MediaFeatureLT.LT:return exports.MediaFeatureGT.GT;case exports.MediaFeatureLT.LT_OR_EQ:return exports.MediaFeatureGT.GT_OR_EQ;case exports.MediaFeatureGT.GT:return exports.MediaFeatureLT.LT;case exports.MediaFeatureGT.GT_OR_EQ:return exports.MediaFeatureLT.LT_OR_EQ;default:return!1}},exports.isCustomMedia=function isCustomMedia(e){return CustomMedia.isCustomMedia(e)},exports.isGeneralEnclosed=function isGeneralEnclosed(e){return GeneralEnclosed.isGeneralEnclosed(e)},exports.isMediaAnd=function isMediaAnd(e){return MediaAnd.isMediaAnd(e)},exports.isMediaCondition=function isMediaCondition(e){return MediaCondition.isMediaCondition(e)},exports.isMediaConditionList=function isMediaConditionList(e){return isMediaConditionListWithAnd(e)||isMediaConditionListWithOr(e)},exports.isMediaConditionListWithAnd=isMediaConditionListWithAnd,exports.isMediaConditionListWithOr=isMediaConditionListWithOr,exports.isMediaFeature=function isMediaFeature(e){return MediaFeature.isMediaFeature(e)},exports.isMediaFeatureBoolean=function isMediaFeatureBoolean(e){return MediaFeatureBoolean.isMediaFeatureBoolean(e)},exports.isMediaFeatureName=function isMediaFeatureName(e){return MediaFeatureName.isMediaFeatureName(e)},exports.isMediaFeaturePlain=function isMediaFeaturePlain(e){return MediaFeaturePlain.isMediaFeaturePlain(e)},exports.isMediaFeatureRange=function isMediaFeatureRange(e){return isMediaFeatureRangeNameValue(e)||isMediaFeatureRangeValueName(e)||isMediaFeatureRangeValueNameValue(e)},exports.isMediaFeatureRangeNameValue=isMediaFeatureRangeNameValue,exports.isMediaFeatureRangeValueName=isMediaFeatureRangeValueName,exports.isMediaFeatureRangeValueNameValue=isMediaFeatureRangeValueNameValue,exports.isMediaFeatureValue=function isMediaFeatureValue(e){return MediaFeatureValue.isMediaFeatureValue(e)},exports.isMediaInParens=function isMediaInParens(e){return MediaInParens.isMediaInParens(e)},exports.isMediaNot=function isMediaNot(e){return MediaNot.isMediaNot(e)},exports.isMediaOr=function isMediaOr(e){return MediaOr.isMediaOr(e)},exports.isMediaQuery=function isMediaQuery(e){return isMediaQueryWithType(e)||isMediaQueryWithoutType(e)||isMediaQueryInvalid(e)},exports.isMediaQueryInvalid=isMediaQueryInvalid,exports.isMediaQueryWithType=isMediaQueryWithType,exports.isMediaQueryWithoutType=isMediaQueryWithoutType,exports.matchesComparison=matchesComparison,exports.matchesRatio=matchesRatio,exports.matchesRatioExactly=matchesRatioExactly,exports.modifierFromToken=modifierFromToken,exports.newMediaFeatureBoolean=function newMediaFeatureBoolean(e){const a=[i.TokenType.Ident,"",-1,-1,{value:""}];return i.mutateIdent(a,e),new MediaFeature(new MediaFeatureBoolean(new MediaFeatureName(new t.TokenNode(a))),[[i.TokenType.OpenParen,"(",-1,-1,void 0]],[[i.TokenType.CloseParen,")",-1,-1,void 0]])},exports.newMediaFeaturePlain=function newMediaFeaturePlain(e,...a){const r=[i.TokenType.Ident,"",-1,-1,{value:""}];i.mutateIdent(r,e);const n=t.parseListOfComponentValues(a);return new MediaFeature(new MediaFeaturePlain(new MediaFeatureName(new t.TokenNode(r)),[i.TokenType.Colon,":",-1,-1,void 0],new MediaFeatureValue(1===n.length?n[0]:n)),[[i.TokenType.OpenParen,"(",-1,-1,void 0]],[[i.TokenType.CloseParen,")",-1,-1,void 0]])},exports.parse=function parse(e,t){const a=i.tokenizer({css:e},{onParseError:t?.onParseError}),r=[];for(;!a.endOfFile();)r.push(a.nextToken());return r.push(a.nextToken()),parseFromTokens(r,t)},exports.parseCustomMedia=function parseCustomMedia(e,t){const a=i.tokenizer({css:e},{onParseError:t?.onParseError}),r=[];for(;!a.endOfFile();)r.push(a.nextToken());return r.push(a.nextToken()),parseCustomMediaFromTokens(r,t)},exports.parseCustomMediaFromTokens=parseCustomMediaFromTokens,exports.parseFromTokens=parseFromTokens,exports.typeFromToken=function typeFromToken(e){if(e[0]!==i.TokenType.Ident)return!1;switch(toLowerCaseAZ(e[4].value)){case exports.MediaType.All:return exports.MediaType.All;case exports.MediaType.Print:return exports.MediaType.Print;case exports.MediaType.Screen:return exports.MediaType.Screen;case exports.MediaType.Tty:return exports.MediaType.Tty;case exports.MediaType.Tv:return exports.MediaType.Tv;case exports.MediaType.Projection:return exports.MediaType.Projection;case exports.MediaType.Handheld:return exports.MediaType.Handheld;case exports.MediaType.Braille:return exports.MediaType.Braille;case exports.MediaType.Embossed:return exports.MediaType.Embossed;case exports.MediaType.Aural:return exports.MediaType.Aural;case exports.MediaType.Speech:return exports.MediaType.Speech;default:return!1}};
+"use strict";var e,t=require("@csstools/css-parser-algorithms"),i=require("@csstools/css-tokenizer");exports.NodeType=void 0,(e=exports.NodeType||(exports.NodeType={})).CustomMedia="custom-media",e.GeneralEnclosed="general-enclosed",e.MediaAnd="media-and",e.MediaCondition="media-condition",e.MediaConditionListWithAnd="media-condition-list-and",e.MediaConditionListWithOr="media-condition-list-or",e.MediaFeature="media-feature",e.MediaFeatureBoolean="mf-boolean",e.MediaFeatureName="mf-name",e.MediaFeaturePlain="mf-plain",e.MediaFeatureRangeNameValue="mf-range-name-value",e.MediaFeatureRangeValueName="mf-range-value-name",e.MediaFeatureRangeValueNameValue="mf-range-value-name-value",e.MediaFeatureValue="mf-value",e.MediaInParens="media-in-parens",e.MediaNot="media-not",e.MediaOr="media-or",e.MediaQueryWithType="media-query-with-type",e.MediaQueryWithoutType="media-query-without-type",e.MediaQueryInvalid="media-query-invalid";class MediaCondition{type=exports.NodeType.MediaCondition;media;constructor(e){this.media=e}tokens(){return this.media.tokens()}toString(){return this.media.toString()}indexOf(e){return e===this.media?"media":-1}at(e){if("media"===e)return this.media}walk(e,t){let i;return t&&(i={...t}),!1!==e({node:this.media,parent:this,state:i},"media")&&this.media.walk(e,i)}toJSON(){return{type:this.type,media:this.media.toJSON()}}isMediaCondition(){return MediaCondition.isMediaCondition(this)}static isMediaCondition(e){return!!e&&(e instanceof MediaCondition&&e.type===exports.NodeType.MediaCondition)}}class MediaInParens{type=exports.NodeType.MediaInParens;media;before;after;constructor(e,t=[],i=[]){this.media=e,this.before=t,this.after=i}tokens(){return[...this.before,...this.media.tokens(),...this.after]}toString(){return i.stringify(...this.before)+this.media.toString()+i.stringify(...this.after)}indexOf(e){return e===this.media?"media":-1}at(e){if("media"===e)return this.media}walk(e,t){let i;return t&&(i={...t}),!1!==e({node:this.media,parent:this,state:i},"media")&&("walk"in this.media?this.media.walk(e,i):void 0)}toJSON(){return{type:this.type,media:this.media.toJSON(),before:this.before,after:this.after}}isMediaInParens(){return MediaInParens.isMediaInParens(this)}static isMediaInParens(e){return!!e&&(e instanceof MediaInParens&&e.type===exports.NodeType.MediaInParens)}}class MediaQueryWithType{type=exports.NodeType.MediaQueryWithType;modifier;mediaType;and=void 0;media=void 0;constructor(e,t,i,a){this.modifier=e,this.mediaType=t,i&&a&&(this.and=i,this.media=a)}getModifier(){if(!this.modifier.length)return"";for(let e=0;e<this.modifier.length;e++){const t=this.modifier[e];if(i.isTokenIdent(t))return t[4].value}return""}negateQuery(){const e=new MediaQueryWithType([...this.modifier],[...this.mediaType],this.and,this.media);if(0===e.modifier.length)return e.modifier=[[i.TokenType.Ident,"not",-1,-1,{value:"not"}],[i.TokenType.Whitespace," ",-1,-1,void 0]],e;for(let t=0;t<e.modifier.length;t++){const a=e.modifier[t];if(i.isTokenIdent(a)&&"not"===a[4].value.toLowerCase()){e.modifier.splice(t,1);break}if(i.isTokenIdent(a)&&"only"===a[4].value.toLowerCase()){a[1]="not",a[4].value="not";break}}return e}getMediaType(){if(!this.mediaType.length)return"";for(let e=0;e<this.mediaType.length;e++){const t=this.mediaType[e];if(i.isTokenIdent(t))return t[4].value}return""}tokens(){return this.and&&this.media?[...this.modifier,...this.mediaType,...this.and,...this.media.tokens()]:[...this.modifier,...this.mediaType]}toString(){return this.and&&this.media?i.stringify(...this.modifier)+i.stringify(...this.mediaType)+i.stringify(...this.and)+this.media.toString():i.stringify(...this.modifier)+i.stringify(...this.mediaType)}indexOf(e){return e===this.media?"media":-1}at(e){if("media"===e)return this.media}walk(e,t){let i;if(t&&(i={...t}),this.media)return!1!==e({node:this.media,parent:this,state:i},"media")&&this.media.walk(e,i)}toJSON(){return{type:this.type,string:this.toString(),modifier:this.modifier,mediaType:this.mediaType,and:this.and,media:this.media}}isMediaQueryWithType(){return MediaQueryWithType.isMediaQueryWithType(this)}static isMediaQueryWithType(e){return!!e&&(e instanceof MediaQueryWithType&&e.type===exports.NodeType.MediaQueryWithType)}}class MediaQueryWithoutType{type=exports.NodeType.MediaQueryWithoutType;media;constructor(e){this.media=e}negateQuery(){let e=this.media;if(e.media.type===exports.NodeType.MediaNot)return new MediaQueryWithoutType(new MediaCondition(e.media.media));e.media.type===exports.NodeType.MediaConditionListWithOr&&(e=new MediaCondition(new MediaInParens(e,[[i.TokenType.Whitespace," ",0,0,void 0],[i.TokenType.OpenParen,"(",0,0,void 0]],[[i.TokenType.CloseParen,")",0,0,void 0]])));return new MediaQueryWithType([[i.TokenType.Ident,"not",0,0,{value:"not"}],[i.TokenType.Whitespace," ",0,0,void 0]],[[i.TokenType.Ident,"all",0,0,{value:"all"}],[i.TokenType.Whitespace," ",0,0,void 0]],[[i.TokenType.Ident,"and",0,0,{value:"and"}]],e)}tokens(){return this.media.tokens()}toString(){return this.media.toString()}indexOf(e){return e===this.media?"media":-1}at(e){if("media"===e)return this.media}walk(e,t){let i;return t&&(i={...t}),!1!==e({node:this.media,parent:this,state:i},"media")&&this.media.walk(e,i)}toJSON(){return{type:this.type,string:this.toString(),media:this.media}}isMediaQueryWithoutType(){return MediaQueryWithoutType.isMediaQueryWithoutType(this)}static isMediaQueryWithoutType(e){return!!e&&(e instanceof MediaQueryWithoutType&&e.type===exports.NodeType.MediaQueryWithoutType)}}class MediaQueryInvalid{type=exports.NodeType.MediaQueryInvalid;media;constructor(e){this.media=e}negateQuery(){return new MediaQueryInvalid(this.media)}tokens(){return this.media.flatMap((e=>e.tokens()))}toString(){return this.media.map((e=>e.toString())).join("")}walk(e,i){if(0===this.media.length)return;const a=t.walkerIndexGenerator(this.media);let r=0;for(;r<this.media.length;){const t=this.media[r];let n;if(i&&(n={...i}),!1===e({node:t,parent:this,state:n},r))return!1;if("walk"in t&&this.media.includes(t)&&!1===t.walk(e,n))return!1;if(r=a(this.media,t,r),-1===r)break}}toJSON(){return{type:this.type,string:this.toString(),media:this.media}}isMediaQueryInvalid(){return MediaQueryInvalid.isMediaQueryInvalid(this)}static isMediaQueryInvalid(e){return!!e&&(e instanceof MediaQueryInvalid&&e.type===exports.NodeType.MediaQueryInvalid)}}class GeneralEnclosed{type=exports.NodeType.GeneralEnclosed;value;constructor(e){this.value=e}tokens(){return this.value.tokens()}toString(){return this.value.toString()}indexOf(e){return e===this.value?"value":-1}at(e){if("value"===e)return this.value}walk(e,t){let i;return t&&(i={...t}),!1!==e({node:this.value,parent:this,state:i},"value")&&("walk"in this.value?this.value.walk(e,i):void 0)}toJSON(){return{type:this.type,tokens:this.tokens()}}isGeneralEnclosed(){return GeneralEnclosed.isGeneralEnclosed(this)}static isGeneralEnclosed(e){return!!e&&(e instanceof GeneralEnclosed&&e.type===exports.NodeType.GeneralEnclosed)}}class MediaAnd{type=exports.NodeType.MediaAnd;modifier;media;constructor(e,t){this.modifier=e,this.media=t}tokens(){return[...this.modifier,...this.media.tokens()]}toString(){return i.stringify(...this.modifier)+this.media.toString()}indexOf(e){return e===this.media?"media":-1}at(e){return"media"===e?this.media:null}walk(e,t){let i;return t&&(i={...t}),!1!==e({node:this.media,parent:this,state:i},"media")&&this.media.walk(e,i)}toJSON(){return{type:this.type,modifier:this.modifier,media:this.media.toJSON()}}isMediaAnd(){return MediaAnd.isMediaAnd(this)}static isMediaAnd(e){return!!e&&(e instanceof MediaAnd&&e.type===exports.NodeType.MediaAnd)}}class MediaConditionListWithAnd{type=exports.NodeType.MediaConditionListWithAnd;leading;list;before;after;constructor(e,t,i=[],a=[]){this.leading=e,this.list=t,this.before=i,this.after=a}tokens(){return[...this.before,...this.leading.tokens(),...this.list.flatMap((e=>e.tokens())),...this.after]}toString(){return i.stringify(...this.before)+this.leading.toString()+this.list.map((e=>e.toString())).join("")+i.stringify(...this.after)}indexOf(e){return e===this.leading?"leading":"media-and"===e.type?this.list.indexOf(e):-1}at(e){return"leading"===e?this.leading:"number"==typeof e?(e<0&&(e=this.list.length+e),this.list[e]):void 0}walk(e,i){let a;if(i&&(a={...i}),!1===e({node:this.leading,parent:this,state:a},"leading"))return!1;if("walk"in this.leading&&!1===this.leading.walk(e,a))return!1;if(0===this.list.length)return;const r=t.walkerIndexGenerator(this.list);let n=0;for(;n<this.list.length;){const t=this.list[n];if(i&&(a={...i}),!1===e({node:t,parent:this,state:a},n))return!1;if("walk"in t&&this.list.includes(t)&&!1===t.walk(e,a))return!1;if(n=r(this.list,t,n),-1===n)break}}toJSON(){return{type:this.type,leading:this.leading.toJSON(),list:this.list.map((e=>e.toJSON())),before:this.before,after:this.after}}isMediaConditionListWithAnd(){return MediaConditionListWithAnd.isMediaConditionListWithAnd(this)}static isMediaConditionListWithAnd(e){return!!e&&(e instanceof MediaConditionListWithAnd&&e.type===exports.NodeType.MediaConditionListWithAnd)}}class MediaConditionListWithOr{type=exports.NodeType.MediaConditionListWithOr;leading;list;before;after;constructor(e,t,i=[],a=[]){this.leading=e,this.list=t,this.before=i,this.after=a}tokens(){return[...this.before,...this.leading.tokens(),...this.list.flatMap((e=>e.tokens())),...this.after]}toString(){return i.stringify(...this.before)+this.leading.toString()+this.list.map((e=>e.toString())).join("")+i.stringify(...this.after)}indexOf(e){return e===this.leading?"leading":"media-or"===e.type?this.list.indexOf(e):-1}at(e){return"leading"===e?this.leading:"number"==typeof e?(e<0&&(e=this.list.length+e),this.list[e]):void 0}walk(e,i){let a;if(i&&(a={...i}),!1===e({node:this.leading,parent:this,state:a},"leading"))return!1;if("walk"in this.leading&&!1===this.leading.walk(e,a))return!1;if(0===this.list.length)return;const r=t.walkerIndexGenerator(this.list);let n=0;for(;n<this.list.length;){const t=this.list[n];if(i&&(a={...i}),!1===e({node:t,parent:this,state:a},n))return!1;if("walk"in t&&this.list.includes(t)&&!1===t.walk(e,a))return!1;if(n=r(this.list,t,n),-1===n)break}}toJSON(){return{type:this.type,leading:this.leading.toJSON(),list:this.list.map((e=>e.toJSON())),before:this.before,after:this.after}}isMediaConditionListWithOr(){return MediaConditionListWithOr.isMediaConditionListWithOr(this)}static isMediaConditionListWithOr(e){return!!e&&(e instanceof MediaConditionListWithOr&&e.type===exports.NodeType.MediaConditionListWithOr)}}function isNumber(e){return!!(t.isTokenNode(e)&&i.isTokenNumber(e.value)||t.isFunctionNode(e)&&a.has(e.getName().toLowerCase()))}const a=new Set(["abs","acos","asin","atan","atan2","calc","clamp","cos","exp","hypot","log","max","min","mod","pow","rem","round","sign","sin","sqrt","tan"]);function isDimension(e){return t.isTokenNode(e)&&i.isTokenDimension(e.value)}function isIdent(e){return t.isTokenNode(e)&&i.isTokenIdent(e.value)}function isEnvironmentVariable(e){return t.isFunctionNode(e)&&"env"===e.getName().toLowerCase()}class MediaFeatureName{type=exports.NodeType.MediaFeatureName;name;before;after;constructor(e,t=[],i=[]){this.name=e,this.before=t,this.after=i}getName(){return this.name.value[4].value}getNameToken(){return this.name.value}tokens(){return[...this.before,...this.name.tokens(),...this.after]}toString(){return i.stringify(...this.before)+this.name.toString()+i.stringify(...this.after)}indexOf(e){return e===this.name?"name":-1}at(e){if("name"===e)return this.name}toJSON(){return{type:this.type,name:this.getName(),tokens:this.tokens()}}isMediaFeatureName(){return MediaFeatureName.isMediaFeatureName(this)}static isMediaFeatureName(e){return!!e&&(e instanceof MediaFeatureName&&e.type===exports.NodeType.MediaFeatureName)}}function parseMediaFeatureName(e){let i=-1;for(let a=0;a<e.length;a++){const r=e[a];if(r.type!==t.ComponentValueType.Whitespace&&r.type!==t.ComponentValueType.Comment){if(!isIdent(r))return!1;if(-1!==i)return!1;i=a}}return-1!==i&&new MediaFeatureName(e[i],e.slice(0,i).flatMap((e=>e.tokens())),e.slice(i+1).flatMap((e=>e.tokens())))}class MediaFeatureBoolean{type=exports.NodeType.MediaFeatureBoolean;name;constructor(e){this.name=e}getName(){return this.name.getName()}getNameToken(){return this.name.getNameToken()}tokens(){return this.name.tokens()}toString(){return this.name.toString()}indexOf(e){return e===this.name?"name":-1}at(e){if("name"===e)return this.name}toJSON(){return{type:this.type,name:this.name.toJSON(),tokens:this.tokens()}}isMediaFeatureBoolean(){return MediaFeatureBoolean.isMediaFeatureBoolean(this)}static isMediaFeatureBoolean(e){return!!e&&(e instanceof MediaFeatureBoolean&&e.type===exports.NodeType.MediaFeatureBoolean)}}function parseMediaFeatureBoolean(e){const t=parseMediaFeatureName(e);return!1===t?t:new MediaFeatureBoolean(t)}class MediaFeatureValue{type=exports.NodeType.MediaFeatureValue;value;before;after;constructor(e,t=[],i=[]){Array.isArray(e)&&1===e.length?this.value=e[0]:this.value=e,this.before=t,this.after=i}tokens(){return Array.isArray(this.value)?[...this.before,...this.value.flatMap((e=>e.tokens())),...this.after]:[...this.before,...this.value.tokens(),...this.after]}toString(){return Array.isArray(this.value)?i.stringify(...this.before)+this.value.map((e=>e.toString())).join("")+i.stringify(...this.after):i.stringify(...this.before)+this.value.toString()+i.stringify(...this.after)}indexOf(e){return e===this.value?"value":-1}at(e){return"value"===e?this.value:Array.isArray(this.value)&&"number"==typeof e?(e<0&&(e=this.value.length+e),this.value[e]):void 0}walk(e,i){if(Array.isArray(this.value)){if(0===this.value.length)return;const a=t.walkerIndexGenerator(this.value);let r=0;for(;r<this.value.length;){const t=this.value[r];let n;if(i&&(n={...i}),!1===e({node:t,parent:this,state:n},r))return!1;if("walk"in t&&this.value.includes(t)&&!1===t.walk(e,n))return!1;if(r=a(this.value,t,r),-1===r)break}}else{let t;if(i&&(t={...i}),!1===e({node:this.value,parent:this,state:t},"value"))return!1;if("walk"in this.value)return this.value.walk(e,t)}}toJSON(){return Array.isArray(this.value)?{type:this.type,value:this.value.map((e=>e.toJSON())),tokens:this.tokens()}:{type:this.type,value:this.value.toJSON(),tokens:this.tokens()}}isMediaFeatureValue(){return MediaFeatureValue.isMediaFeatureValue(this)}static isMediaFeatureValue(e){return!!e&&(e instanceof MediaFeatureValue&&e.type===exports.NodeType.MediaFeatureValue)}}function parseMediaFeatureValue(e,i=!1){let a=-1,r=-1;for(let n=0;n<e.length;n++){const s=e[n];if(s.type!==t.ComponentValueType.Whitespace&&s.type!==t.ComponentValueType.Comment){if(-1!==a)return!1;if(isNumber(s)){const t=matchesRatioExactly(e.slice(n));if(-1!==t){a=t[0]+n,r=t[1]+n,n+=t[1]-t[0];continue}a=n,r=n}else if(isEnvironmentVariable(s))a=n,r=n;else if(isDimension(s))a=n,r=n;else{if(i||!isIdent(s))return!1;a=n,r=n}}}return-1!==a&&new MediaFeatureValue(e.slice(a,r+1),e.slice(0,a).flatMap((e=>e.tokens())),e.slice(r+1).flatMap((e=>e.tokens())))}function matchesRatioExactly(e){let t=-1,i=-1;const a=matchesRatio(e);if(-1===a)return-1;t=a[0],i=a[1];for(let t=i+1;t<e.length;t++){const i=e[t];if("whitespace"!==i.type&&"comment"!==i.type)return-1}return[t,i]}function matchesRatio(e){let t=-1,a=-1;for(let r=0;r<e.length;r++){const n=e[r];if("whitespace"!==n.type&&"comment"!==n.type){if("token"===n.type){const e=n.value;if(i.isTokenDelim(e)&&"/"===e[4].value){if(-1===t)return-1;if(-1!==a)return-1;a=r;continue}}if(!isNumber(n))return-1;if(-1!==a)return[t,r];if(-1!==t)return-1;t=r}}return-1}class MediaFeaturePlain{type=exports.NodeType.MediaFeaturePlain;name;colon;value;constructor(e,t,i){this.name=e,this.colon=t,this.value=i}getName(){return this.name.getName()}getNameToken(){return this.name.getNameToken()}tokens(){return[...this.name.tokens(),this.colon,...this.value.tokens()]}toString(){return this.name.toString()+i.stringify(this.colon)+this.value.toString()}indexOf(e){return e===this.name?"name":e===this.value?"value":-1}at(e){return"name"===e?this.name:"value"===e?this.value:void 0}walk(e,t){let i;return t&&(i={...t}),!1!==e({node:this.value,parent:this,state:i},"value")&&this.value.walk(e,i)}toJSON(){return{type:this.type,name:this.name.toJSON(),value:this.value.toJSON(),tokens:this.tokens()}}isMediaFeaturePlain(){return MediaFeaturePlain.isMediaFeaturePlain(this)}static isMediaFeaturePlain(e){return!!e&&(e instanceof MediaFeaturePlain&&e.type===exports.NodeType.MediaFeaturePlain)}}function parseMediaFeaturePlain(e){let a=[],r=[],n=null;for(let s=0;s<e.length;s++){const o=e[s];if(o.type===t.ComponentValueType.Token){const t=o.value;if(i.isTokenColon(t)){a=e.slice(0,s),r=e.slice(s+1),n=t;break}}}if(!a.length||!r.length||!n)return!1;const s=parseMediaFeatureName(a);if(!1===s)return!1;const o=parseMediaFeatureValue(r);return!1!==o&&new MediaFeaturePlain(s,n,o)}var r,n,s;function matchesComparison(e){let a=-1;for(let r=0;r<e.length;r++){const n=e[r];if(n.type===t.ComponentValueType.Token){const e=n.value;if(i.isTokenDelim(e)){if(e[4].value===exports.MediaFeatureEQ.EQ)return-1!==a?[a,r]:[r,r];if(e[4].value===exports.MediaFeatureLT.LT){a=r;continue}if(e[4].value===exports.MediaFeatureGT.GT){a=r;continue}}}break}return-1!==a&&[a,a]}function comparisonFromTokens(e){if(0===e.length||e.length>2)return!1;if(!i.isTokenDelim(e[0]))return!1;if(1===e.length)switch(e[0][4].value){case exports.MediaFeatureEQ.EQ:return exports.MediaFeatureEQ.EQ;case exports.MediaFeatureLT.LT:return exports.MediaFeatureLT.LT;case exports.MediaFeatureGT.GT:return exports.MediaFeatureGT.GT;default:return!1}if(!i.isTokenDelim(e[1]))return!1;if(e[1][4].value!==exports.MediaFeatureEQ.EQ)return!1;switch(e[0][4].value){case exports.MediaFeatureLT.LT:return exports.MediaFeatureLT.LT_OR_EQ;case exports.MediaFeatureGT.GT:return exports.MediaFeatureGT.GT_OR_EQ;default:return!1}}exports.MediaFeatureLT=void 0,(r=exports.MediaFeatureLT||(exports.MediaFeatureLT={})).LT="<",r.LT_OR_EQ="<=",exports.MediaFeatureGT=void 0,(n=exports.MediaFeatureGT||(exports.MediaFeatureGT={})).GT=">",n.GT_OR_EQ=">=",exports.MediaFeatureEQ=void 0,(exports.MediaFeatureEQ||(exports.MediaFeatureEQ={})).EQ="=";class MediaFeatureRangeNameValue{type=exports.NodeType.MediaFeatureRangeNameValue;name;operator;value;constructor(e,t,i){this.name=e,this.operator=t,this.value=i}operatorKind(){return comparisonFromTokens(this.operator)}getName(){return this.name.getName()}getNameToken(){return this.name.getNameToken()}tokens(){return[...this.name.tokens(),...this.operator,...this.value.tokens()]}toString(){return this.name.toString()+i.stringify(...this.operator)+this.value.toString()}indexOf(e){return e===this.name?"name":e===this.value?"value":-1}at(e){return"name"===e?this.name:"value"===e?this.value:void 0}walk(e,t){let i;return t&&(i={...t}),!1!==e({node:this.value,parent:this,state:i},"value")&&("walk"in this.value?this.value.walk(e,i):void 0)}toJSON(){return{type:this.type,name:this.name.toJSON(),value:this.value.toJSON(),tokens:this.tokens()}}isMediaFeatureRangeNameValue(){return MediaFeatureRangeNameValue.isMediaFeatureRangeNameValue(this)}static isMediaFeatureRangeNameValue(e){return!!e&&(e instanceof MediaFeatureRangeNameValue&&e.type===exports.NodeType.MediaFeatureRangeNameValue)}}class MediaFeatureRangeValueName{type=exports.NodeType.MediaFeatureRangeValueName;name;operator;value;constructor(e,t,i){this.name=e,this.operator=t,this.value=i}operatorKind(){return comparisonFromTokens(this.operator)}getName(){return this.name.getName()}getNameToken(){return this.name.getNameToken()}tokens(){return[...this.value.tokens(),...this.operator,...this.name.tokens()]}toString(){return this.value.toString()+i.stringify(...this.operator)+this.name.toString()}indexOf(e){return e===this.name?"name":e===this.value?"value":-1}at(e){return"name"===e?this.name:"value"===e?this.value:void 0}walk(e,t){let i;return t&&(i={...t}),!1!==e({node:this.value,parent:this,state:i},"value")&&("walk"in this.value?this.value.walk(e,i):void 0)}toJSON(){return{type:this.type,name:this.name.toJSON(),value:this.value.toJSON(),tokens:this.tokens()}}isMediaFeatureRangeValueName(){return MediaFeatureRangeValueName.isMediaFeatureRangeValueName(this)}static isMediaFeatureRangeValueName(e){return!!e&&(e instanceof MediaFeatureRangeValueName&&e.type===exports.NodeType.MediaFeatureRangeValueName)}}class MediaFeatureRangeValueNameValue{type=exports.NodeType.MediaFeatureRangeValueNameValue;name;valueOne;valueOneOperator;valueTwo;valueTwoOperator;constructor(e,t,i,a,r){this.name=e,this.valueOne=t,this.valueOneOperator=i,this.valueTwo=a,this.valueTwoOperator=r}valueOneOperatorKind(){return comparisonFromTokens(this.valueOneOperator)}valueTwoOperatorKind(){return comparisonFromTokens(this.valueTwoOperator)}getName(){return this.name.getName()}getNameToken(){return this.name.getNameToken()}tokens(){return[...this.valueOne.tokens(),...this.valueOneOperator,...this.name.tokens(),...this.valueTwoOperator,...this.valueTwo.tokens()]}toString(){return this.valueOne.toString()+i.stringify(...this.valueOneOperator)+this.name.toString()+i.stringify(...this.valueTwoOperator)+this.valueTwo.toString()}indexOf(e){return e===this.name?"name":e===this.valueOne?"valueOne":e===this.valueTwo?"valueTwo":-1}at(e){return"name"===e?this.name:"valueOne"===e?this.valueOne:"valueTwo"===e?this.valueTwo:void 0}walk(e,t){let i;return t&&(i={...t}),!1!==e({node:this.valueOne,parent:this,state:i},"valueOne")&&((!("walk"in this.valueOne)||!1!==this.valueOne.walk(e,i))&&(t&&(i={...t}),!1!==e({node:this.valueTwo,parent:this,state:i},"valueTwo")&&((!("walk"in this.valueTwo)||!1!==this.valueTwo.walk(e,i))&&void 0)))}toJSON(){return{type:this.type,name:this.name.toJSON(),valueOne:this.valueOne.toJSON(),valueTwo:this.valueTwo.toJSON(),tokens:this.tokens()}}isMediaFeatureRangeValueNameValue(){return MediaFeatureRangeValueNameValue.isMediaFeatureRangeValueNameValue(this)}static isMediaFeatureRangeValueNameValue(e){return!!e&&(e instanceof MediaFeatureRangeValueNameValue&&e.type===exports.NodeType.MediaFeatureRangeValueNameValue)}}function parseMediaFeatureRange(e){let a=!1,r=!1;for(let n=0;n<e.length;n++){const s=e[n];if(s.type===t.ComponentValueType.Token){const t=s.value;if(i.isTokenDelim(t)){const t=matchesComparison(e.slice(n));if(!1!==t){if(!1!==a){r=[t[0]+n,t[1]+n];break}a=[t[0]+n,t[1]+n],n+=t[1]}}}}if(!1===a)return!1;const n=[e[a[0]].value];if(a[0]!==a[1]&&n.push(e[a[1]].value),!1===r){const t=e.slice(0,a[0]),i=e.slice(a[1]+1),r=parseMediaFeatureName(t);if(r){const e=parseMediaFeatureValue(i,!0);return!!e&&new MediaFeatureRangeNameValue(r,n,e)}const s=parseMediaFeatureName(i);if(s){const e=parseMediaFeatureValue(t,!0);return!!e&&new MediaFeatureRangeValueName(s,n,e)}return!1}const s=[e[r[0]].value];r[0]!==r[1]&&s.push(e[r[1]].value);const o=e.slice(0,a[0]),u=e.slice(a[1]+1,r[0]),d=e.slice(r[1]+1),l=parseMediaFeatureValue(o,!0),p=parseMediaFeatureName(u),h=parseMediaFeatureValue(d,!0);if(!l||!p||!h)return!1;{const e=comparisonFromTokens(n);if(!1===e||e===exports.MediaFeatureEQ.EQ)return!1;const t=comparisonFromTokens(s);if(!1===t||t===exports.MediaFeatureEQ.EQ)return!1;if(!(e!==exports.MediaFeatureLT.LT&&e!==exports.MediaFeatureLT.LT_OR_EQ||t!==exports.MediaFeatureGT.GT&&t!==exports.MediaFeatureGT.GT_OR_EQ))return!1;if(!(e!==exports.MediaFeatureGT.GT&&e!==exports.MediaFeatureGT.GT_OR_EQ||t!==exports.MediaFeatureLT.LT&&t!==exports.MediaFeatureLT.LT_OR_EQ))return!1}return new MediaFeatureRangeValueNameValue(p,l,n,h,s)}class MediaFeature{type=exports.NodeType.MediaFeature;feature;before;after;constructor(e,t=[],i=[]){this.feature=e,this.before=t,this.after=i}getName(){return this.feature.getName()}getNameToken(){return this.feature.getNameToken()}tokens(){return[...this.before,...this.feature.tokens(),...this.after]}toString(){return i.stringify(...this.before)+this.feature.toString()+i.stringify(...this.after)}indexOf(e){return e===this.feature?"feature":-1}at(e){if("feature"===e)return this.feature}walk(e,t){let i;return t&&(i={...t}),!1!==e({node:this.feature,parent:this,state:i},"feature")&&("walk"in this.feature?this.feature.walk(e,i):void 0)}toJSON(){return{type:this.type,feature:this.feature.toJSON(),before:this.before,after:this.after}}isMediaFeature(){return MediaFeature.isMediaFeature(this)}static isMediaFeature(e){return!!e&&(e instanceof MediaFeature&&e.type===exports.NodeType.MediaFeature)}}function parseMediaFeature(e,t=[],a=[]){if(!i.isTokenOpenParen(e.startToken))return!1;const r=parseMediaFeatureBoolean(e.value);if(!1!==r)return new MediaFeature(r,t,a);const n=parseMediaFeaturePlain(e.value);if(!1!==n)return new MediaFeature(n,t,a);const s=parseMediaFeatureRange(e.value);return!1!==s&&new MediaFeature(s,t,a)}class MediaNot{type=exports.NodeType.MediaNot;modifier;media;constructor(e,t){this.modifier=e,this.media=t}tokens(){return[...this.modifier,...this.media.tokens()]}toString(){return i.stringify(...this.modifier)+this.media.toString()}indexOf(e){return e===this.media?"media":-1}at(e){if("media"===e)return this.media}walk(e,t){let i;return t&&(i={...t}),!1!==e({node:this.media,parent:this,state:i},"media")&&this.media.walk(e,i)}toJSON(){return{type:this.type,modifier:this.modifier,media:this.media.toJSON()}}isMediaNot(){return MediaNot.isMediaNot(this)}static isMediaNot(e){return!!e&&(e instanceof MediaNot&&e.type===exports.NodeType.MediaNot)}}class MediaOr{type=exports.NodeType.MediaOr;modifier;media;constructor(e,t){this.modifier=e,this.media=t}tokens(){return[...this.modifier,...this.media.tokens()]}toString(){return i.stringify(...this.modifier)+this.media.toString()}indexOf(e){return e===this.media?"media":-1}at(e){if("media"===e)return this.media}walk(e,t){let i;return t&&(i={...t}),!1!==e({node:this.media,parent:this,state:i},"media")&&this.media.walk(e,i)}toJSON(){return{type:this.type,modifier:this.modifier,media:this.media.toJSON()}}isMediaOr(){return MediaOr.isMediaOr(this)}static isMediaOr(e){return!!e&&(e instanceof MediaOr&&e.type===exports.NodeType.MediaOr)}}function modifierFromToken(e){if(!i.isTokenIdent(e))return!1;switch(e[4].value.toLowerCase()){case exports.MediaQueryModifier.Not:return exports.MediaQueryModifier.Not;case exports.MediaQueryModifier.Only:return exports.MediaQueryModifier.Only;default:return!1}}function parseMediaQuery(e){{const t=parseMediaCondition(e);if(!1!==t)return new MediaQueryWithoutType(t)}{let a=-1,r=-1,n=-1;for(let s=0;s<e.length;s++){const o=e[s];if(!t.isWhitespaceNode(o)&&!t.isCommentNode(o)){if(t.isTokenNode(o)){const t=o.value;if(-1===a&&i.isTokenIdent(t)&&modifierFromToken(t)){a=s;continue}if(-1===r&&i.isTokenIdent(t)&&!modifierFromToken(t)){r=s;continue}if(-1===n&&i.isTokenIdent(t)&&d.test(t[4].value)){n=s;if(!1===parseMediaConditionWithoutOr(e.slice(s+1)))return!1;break}return!1}return!1}}let s=[],o=[];-1!==a?(s=e.slice(0,a+1).flatMap((e=>e.tokens())),-1!==r&&(o=e.slice(a+1,r+1).flatMap((e=>e.tokens())))):-1!==r&&(o=e.slice(0,r+1).flatMap((e=>e.tokens())));const u=parseMediaConditionWithoutOr(e.slice(Math.max(a,r,n)+1));return!1===u?new MediaQueryWithType(s,[...o,...e.slice(r+1).flatMap((e=>e.tokens()))]):new MediaQueryWithType(s,o,e.slice(r+1,n+1).flatMap((e=>e.tokens())),u)}}function parseMediaConditionListWithOr(e){let i=!1;const a=[];let r=-1,n=-1;for(let s=0;s<e.length;s++){if(i){const t=parseMediaOr(e.slice(s));if(!1!==t){s+=t.advance,a.push(t.node),n=s;continue}}const o=e[s];if(o.type!==t.ComponentValueType.Whitespace&&o.type!==t.ComponentValueType.Comment){if(i)return!1;if(!1!==i||!t.isSimpleBlockNode(o))return!1;if(o.normalize(),i=parseMediaInParensFromSimpleBlock(o),!1===i)return!1;r=s}}return!(!i||!a.length)&&new MediaConditionListWithOr(i,a,e.slice(0,r).flatMap((e=>e.tokens())),e.slice(n+1).flatMap((e=>e.tokens())))}function parseMediaConditionListWithAnd(e){let i=!1;const a=[];let r=-1,n=-1;for(let s=0;s<e.length;s++){if(i){const t=parseMediaAnd(e.slice(s));if(!1!==t){s+=t.advance,a.push(t.node),n=s;continue}}const o=e[s];if(o.type!==t.ComponentValueType.Whitespace&&o.type!==t.ComponentValueType.Comment){if(i)return!1;if(!1!==i||!t.isSimpleBlockNode(o))return!1;if(o.normalize(),i=parseMediaInParensFromSimpleBlock(o),!1===i)return!1;r=s}}return!(!i||!a.length)&&new MediaConditionListWithAnd(i,a,e.slice(0,r).flatMap((e=>e.tokens())),e.slice(n+1).flatMap((e=>e.tokens())))}function parseMediaCondition(e){const t=parseMediaNot(e);if(!1!==t)return new MediaCondition(t);const i=parseMediaConditionListWithAnd(e);if(!1!==i)return new MediaCondition(i);const a=parseMediaConditionListWithOr(e);if(!1!==a)return new MediaCondition(a);const r=parseMediaInParens(e);return!1!==r&&new MediaCondition(r)}function parseMediaConditionWithoutOr(e){const t=parseMediaNot(e);if(!1!==t)return new MediaCondition(t);const i=parseMediaConditionListWithAnd(e);if(!1!==i)return new MediaCondition(i);const a=parseMediaInParens(e);return!1!==a&&new MediaCondition(a)}function parseMediaInParens(e){let a=-1;for(let i=0;i<e.length;i++){const r=e[i];if(r.type!==t.ComponentValueType.Whitespace&&r.type!==t.ComponentValueType.Comment){if(!t.isSimpleBlockNode(r))return!1;if(-1!==a)return!1;a=i}}if(-1===a)return!1;const r=e[a];if(!i.isTokenOpenParen(r.startToken))return!1;r.normalize();const n=[...e.slice(0,a).flatMap((e=>e.tokens())),r.startToken],s=[r.endToken,...e.slice(a+1).flatMap((e=>e.tokens()))],o=parseMediaFeature(r,n,s);if(!1!==o)return new MediaInParens(o);const u=parseMediaCondition(r.value);return!1!==u?new MediaInParens(u,n,s):new MediaInParens(new GeneralEnclosed(r),e.slice(0,a).flatMap((e=>e.tokens())),e.slice(a+1).flatMap((e=>e.tokens())))}function parseMediaInParensFromSimpleBlock(e){if(!i.isTokenOpenParen(e.startToken))return!1;const t=parseMediaFeature(e,[e.startToken],[e.endToken]);if(!1!==t)return new MediaInParens(t);const a=parseMediaCondition(e.value);return!1!==a?new MediaInParens(a,[e.startToken],[e.endToken]):new MediaInParens(new GeneralEnclosed(e))}exports.MediaQueryModifier=void 0,(s=exports.MediaQueryModifier||(exports.MediaQueryModifier={})).Not="not",s.Only="only";const o=/^not$/i;function parseMediaNot(e){let i=!1,a=null;for(let r=0;r<e.length;r++){const n=e[r];if(n.type!==t.ComponentValueType.Whitespace&&n.type!==t.ComponentValueType.Comment){if(isIdent(n)){const e=n.value;if(o.test(e[4].value)){if(i)return!1;i=!0;continue}return!1}if(!i||!t.isSimpleBlockNode(n))return!1;{n.normalize();const t=parseMediaInParensFromSimpleBlock(n);if(!1===t)return!1;a=new MediaNot(e.slice(0,r).flatMap((e=>e.tokens())),t)}}}return a||!1}const u=/^or$/i;function parseMediaOr(e){let i=!1;for(let a=0;a<e.length;a++){const r=e[a];if(r.type!==t.ComponentValueType.Whitespace&&r.type!==t.ComponentValueType.Comment){if(isIdent(r)){const e=r.value;if(u.test(e[4].value)){if(i)return!1;i=!0;continue}return!1}if(i&&t.isSimpleBlockNode(r)){r.normalize();const t=parseMediaInParensFromSimpleBlock(r);return!1!==t&&{advance:a,node:new MediaOr(e.slice(0,a).flatMap((e=>e.tokens())),t)}}return!1}}return!1}const d=/^and$/i;function parseMediaAnd(e){let i=!1;for(let a=0;a<e.length;a++){const r=e[a];if(r.type!==t.ComponentValueType.Whitespace&&r.type!==t.ComponentValueType.Comment){if(isIdent(r)){const e=r.value;if(d.test(e[4].value)){if(i)return!1;i=!0;continue}return!1}if(i&&t.isSimpleBlockNode(r)){r.normalize();const t=parseMediaInParensFromSimpleBlock(r);return!1!==t&&{advance:a,node:new MediaAnd(e.slice(0,a).flatMap((e=>e.tokens())),t)}}return!1}}return!1}function parseFromTokens(e,i){const a=t.parseCommaSeparatedListOfComponentValues(e,{onParseError:i?.onParseError});return a.map(((e,t)=>{const r=parseMediaQuery(e);return!1===r&&!0===i?.preserveInvalidMediaQueries?new MediaQueryInvalid(a[t]):r})).filter((e=>!!e))}class CustomMedia{type=exports.NodeType.CustomMedia;name;mediaQueryList=null;trueOrFalseKeyword=null;constructor(e,t,i){this.name=e,this.mediaQueryList=t,this.trueOrFalseKeyword=i??null}getName(){for(let e=0;e<this.name.length;e++){const t=this.name[e];if(i.isTokenIdent(t))return t[4].value}return""}getNameToken(){for(let e=0;e<this.name.length;e++){const t=this.name[e];if(i.isTokenIdent(t))return t}return null}hasMediaQueryList(){return!!this.mediaQueryList}hasTrueKeyword(){if(!this.trueOrFalseKeyword)return!1;for(let e=0;e<this.trueOrFalseKeyword.length;e++){const t=this.trueOrFalseKeyword[e];if(!i.isTokenWhiteSpaceOrComment(t))return!!i.isTokenIdent(t)&&"true"===t[4].value.toLowerCase()}return!1}hasFalseKeyword(){if(!this.trueOrFalseKeyword)return!1;for(let e=0;e<this.trueOrFalseKeyword.length;e++){const t=this.trueOrFalseKeyword[e];if(!i.isTokenWhiteSpaceOrComment(t))return!!i.isTokenIdent(t)&&"false"===t[4].value.toLowerCase()}return!1}tokens(){if(this.trueOrFalseKeyword)return[...this.name,...this.trueOrFalseKeyword];if(!this.mediaQueryList)return[...this.name];const e=[];for(let t=0;t<this.mediaQueryList.length;t++){const a=this.mediaQueryList[t];0!==t&&e.push([i.TokenType.Comma,",",-1,-1,void 0]),e.push(...a.tokens())}return[...this.name,...e]}toString(){return i.stringify(...this.tokens())}toJSON(){return{type:this.type,string:this.toString(),nameValue:this.getName(),name:this.name,hasFalseKeyword:this.hasFalseKeyword(),hasTrueKeyword:this.hasTrueKeyword(),trueOrFalseKeyword:this.trueOrFalseKeyword,mediaQueryList:this.mediaQueryList?.map((e=>e.toJSON()))}}isCustomMedia(){return CustomMedia.isCustomMedia(this)}static isCustomMedia(e){return!!e&&(e instanceof CustomMedia&&e.type===exports.NodeType.CustomMedia)}}function parseCustomMediaFromTokens(e,t){let a=[],r=e;for(let t=0;t<e.length;t++)if(!i.isTokenWhiteSpaceOrComment(e[t])){if(i.isTokenIdent(e[t])){if(e[t][4].value.startsWith("--")){a=e.slice(0,t+1),r=e.slice(t+1);break}}return!1}let n=!0;for(let e=0;e<r.length;e++)if(!i.isTokenWhiteSpaceOrComment(r[e])){if(i.isTokenIdent(r[e])){const t=r[e][4].value.toLowerCase();if("false"===t)continue;if("true"===t)continue}if(i.isTokenEOF(r[e]))break;n=!1}return n?new CustomMedia(a,null,r):new CustomMedia(a,parseFromTokens(i.cloneTokens(r),t))}function isMediaConditionListWithAnd(e){return MediaConditionListWithAnd.isMediaConditionListWithAnd(e)}function isMediaConditionListWithOr(e){return MediaConditionListWithOr.isMediaConditionListWithOr(e)}function isMediaFeatureRangeNameValue(e){return MediaFeatureRangeNameValue.isMediaFeatureRangeNameValue(e)}function isMediaFeatureRangeValueName(e){return MediaFeatureRangeValueName.isMediaFeatureRangeValueName(e)}function isMediaFeatureRangeValueNameValue(e){return MediaFeatureRangeValueNameValue.isMediaFeatureRangeValueNameValue(e)}function isMediaQueryWithType(e){return MediaQueryWithType.isMediaQueryWithType(e)}function isMediaQueryWithoutType(e){return MediaQueryWithoutType.isMediaQueryWithoutType(e)}function isMediaQueryInvalid(e){return MediaQueryInvalid.isMediaQueryInvalid(e)}var l;exports.MediaType=void 0,(l=exports.MediaType||(exports.MediaType={})).All="all",l.Print="print",l.Screen="screen",l.Tty="tty",l.Tv="tv",l.Projection="projection",l.Handheld="handheld",l.Braille="braille",l.Embossed="embossed",l.Aural="aural",l.Speech="speech",exports.CustomMedia=CustomMedia,exports.GeneralEnclosed=GeneralEnclosed,exports.MediaAnd=MediaAnd,exports.MediaCondition=MediaCondition,exports.MediaConditionListWithAnd=MediaConditionListWithAnd,exports.MediaConditionListWithOr=MediaConditionListWithOr,exports.MediaFeature=MediaFeature,exports.MediaFeatureBoolean=MediaFeatureBoolean,exports.MediaFeatureName=MediaFeatureName,exports.MediaFeaturePlain=MediaFeaturePlain,exports.MediaFeatureRangeNameValue=MediaFeatureRangeNameValue,exports.MediaFeatureRangeValueName=MediaFeatureRangeValueName,exports.MediaFeatureRangeValueNameValue=MediaFeatureRangeValueNameValue,exports.MediaFeatureValue=MediaFeatureValue,exports.MediaInParens=MediaInParens,exports.MediaNot=MediaNot,exports.MediaOr=MediaOr,exports.MediaQueryInvalid=MediaQueryInvalid,exports.MediaQueryWithType=MediaQueryWithType,exports.MediaQueryWithoutType=MediaQueryWithoutType,exports.cloneMediaQuery=function cloneMediaQuery(e){const t=i.cloneTokens(e.tokens()),a=parseFromTokens(t,{preserveInvalidMediaQueries:!0})[0];if(!a)throw new Error(`Failed to clone media query for : "${i.stringify(...t)}"`);if(isMediaQueryInvalid(e)&&isMediaQueryInvalid(a))return a;if(isMediaQueryWithType(e)&&isMediaQueryWithType(a))return a;if(isMediaQueryWithoutType(e)&&isMediaQueryWithoutType(a))return a;throw new Error(`Failed to clone media query for : "${i.stringify(...t)}"`)},exports.comparisonFromTokens=comparisonFromTokens,exports.invertComparison=function invertComparison(e){switch(e){case exports.MediaFeatureEQ.EQ:return exports.MediaFeatureEQ.EQ;case exports.MediaFeatureLT.LT:return exports.MediaFeatureGT.GT;case exports.MediaFeatureLT.LT_OR_EQ:return exports.MediaFeatureGT.GT_OR_EQ;case exports.MediaFeatureGT.GT:return exports.MediaFeatureLT.LT;case exports.MediaFeatureGT.GT_OR_EQ:return exports.MediaFeatureLT.LT_OR_EQ;default:return!1}},exports.isCustomMedia=function isCustomMedia(e){return CustomMedia.isCustomMedia(e)},exports.isGeneralEnclosed=function isGeneralEnclosed(e){return GeneralEnclosed.isGeneralEnclosed(e)},exports.isMediaAnd=function isMediaAnd(e){return MediaAnd.isMediaAnd(e)},exports.isMediaCondition=function isMediaCondition(e){return MediaCondition.isMediaCondition(e)},exports.isMediaConditionList=function isMediaConditionList(e){return isMediaConditionListWithAnd(e)||isMediaConditionListWithOr(e)},exports.isMediaConditionListWithAnd=isMediaConditionListWithAnd,exports.isMediaConditionListWithOr=isMediaConditionListWithOr,exports.isMediaFeature=function isMediaFeature(e){return MediaFeature.isMediaFeature(e)},exports.isMediaFeatureBoolean=function isMediaFeatureBoolean(e){return MediaFeatureBoolean.isMediaFeatureBoolean(e)},exports.isMediaFeatureName=function isMediaFeatureName(e){return MediaFeatureName.isMediaFeatureName(e)},exports.isMediaFeaturePlain=function isMediaFeaturePlain(e){return MediaFeaturePlain.isMediaFeaturePlain(e)},exports.isMediaFeatureRange=function isMediaFeatureRange(e){return isMediaFeatureRangeNameValue(e)||isMediaFeatureRangeValueName(e)||isMediaFeatureRangeValueNameValue(e)},exports.isMediaFeatureRangeNameValue=isMediaFeatureRangeNameValue,exports.isMediaFeatureRangeValueName=isMediaFeatureRangeValueName,exports.isMediaFeatureRangeValueNameValue=isMediaFeatureRangeValueNameValue,exports.isMediaFeatureValue=function isMediaFeatureValue(e){return MediaFeatureValue.isMediaFeatureValue(e)},exports.isMediaInParens=function isMediaInParens(e){return MediaInParens.isMediaInParens(e)},exports.isMediaNot=function isMediaNot(e){return MediaNot.isMediaNot(e)},exports.isMediaOr=function isMediaOr(e){return MediaOr.isMediaOr(e)},exports.isMediaQuery=function isMediaQuery(e){return isMediaQueryWithType(e)||isMediaQueryWithoutType(e)||isMediaQueryInvalid(e)},exports.isMediaQueryInvalid=isMediaQueryInvalid,exports.isMediaQueryWithType=isMediaQueryWithType,exports.isMediaQueryWithoutType=isMediaQueryWithoutType,exports.matchesComparison=matchesComparison,exports.matchesRatio=matchesRatio,exports.matchesRatioExactly=matchesRatioExactly,exports.modifierFromToken=modifierFromToken,exports.newMediaFeatureBoolean=function newMediaFeatureBoolean(e){const a=[i.TokenType.Ident,"",-1,-1,{value:""}];return i.mutateIdent(a,e),new MediaFeature(new MediaFeatureBoolean(new MediaFeatureName(new t.TokenNode(a))),[[i.TokenType.OpenParen,"(",-1,-1,void 0]],[[i.TokenType.CloseParen,")",-1,-1,void 0]])},exports.newMediaFeaturePlain=function newMediaFeaturePlain(e,...a){const r=[i.TokenType.Ident,"",-1,-1,{value:""}];i.mutateIdent(r,e);const n=t.parseListOfComponentValues(a);return new MediaFeature(new MediaFeaturePlain(new MediaFeatureName(new t.TokenNode(r)),[i.TokenType.Colon,":",-1,-1,void 0],new MediaFeatureValue(1===n.length?n[0]:n)),[[i.TokenType.OpenParen,"(",-1,-1,void 0]],[[i.TokenType.CloseParen,")",-1,-1,void 0]])},exports.parse=function parse(e,t){const a=i.tokenizer({css:e},{onParseError:t?.onParseError}),r=[];for(;!a.endOfFile();)r.push(a.nextToken());return r.push(a.nextToken()),parseFromTokens(r,t)},exports.parseCustomMedia=function parseCustomMedia(e,t){const a=i.tokenizer({css:e},{onParseError:t?.onParseError}),r=[];for(;!a.endOfFile();)r.push(a.nextToken());return r.push(a.nextToken()),parseCustomMediaFromTokens(r,t)},exports.parseCustomMediaFromTokens=parseCustomMediaFromTokens,exports.parseFromTokens=parseFromTokens,exports.typeFromToken=function typeFromToken(e){if(!i.isTokenIdent(e))return!1;switch(e[4].value.toLowerCase()){case exports.MediaType.All:return exports.MediaType.All;case exports.MediaType.Print:return exports.MediaType.Print;case exports.MediaType.Screen:return exports.MediaType.Screen;case exports.MediaType.Tty:return exports.MediaType.Tty;case exports.MediaType.Tv:return exports.MediaType.Tv;case exports.MediaType.Projection:return exports.MediaType.Projection;case exports.MediaType.Handheld:return exports.MediaType.Handheld;case exports.MediaType.Braille:return exports.MediaType.Braille;case exports.MediaType.Embossed:return exports.MediaType.Embossed;case exports.MediaType.Aural:return exports.MediaType.Aural;case exports.MediaType.Speech:return exports.MediaType.Speech;default:return!1}};
diff --git a/node_modules/@csstools/media-query-list-parser/dist/index.d.ts b/node_modules/@csstools/media-query-list-parser/dist/index.d.ts
index 69738ea8..e97acc33 100644
--- a/node_modules/@csstools/media-query-list-parser/dist/index.d.ts
+++ b/node_modules/@csstools/media-query-list-parser/dist/index.d.ts
@@ -26,31 +26,7 @@ export declare class CustomMedia {
/**
* @internal
*/
- toJSON(): {
- type: NodeType;
- string: string;
- nameValue: string;
- name: CSSToken[];
- hasFalseKeyword: boolean;
- hasTrueKeyword: boolean;
- trueOrFalseKeyword: CSSToken[] | null;
- mediaQueryList: ({
- type: NodeType;
- string: string;
- modifier: CSSToken[];
- mediaType: CSSToken[];
- and: CSSToken[] | undefined;
- media: MediaCondition | undefined;
- } | {
- type: NodeType;
- string: string;
- media: MediaCondition;
- } | {
- type: NodeType;
- string: string;
- media: ComponentValue[];
- })[] | undefined;
- };
+ toJSON(): Record<string, unknown>;
/**
* @internal
*/
@@ -74,10 +50,7 @@ export declare class GeneralEnclosed {
/**
* @internal
*/
- toJSON(): {
- type: NodeType;
- tokens: CSSToken[];
- };
+ toJSON(): Record<string, unknown>;
/**
* @internal
*/
@@ -139,9 +112,9 @@ export declare function isMediaQueryWithType(x: unknown): x is MediaQueryWithTyp
export declare function matchesComparison(componentValues: Array<ComponentValue>): false | [number, number];
-export declare function matchesRatio(componentValues: Array<ComponentValue>): number[] | -1;
+export declare function matchesRatio(componentValues: Array<ComponentValue>): -1 | [number, number];
-export declare function matchesRatioExactly(componentValues: Array<ComponentValue>): number[] | -1;
+export declare function matchesRatioExactly(componentValues: Array<ComponentValue>): -1 | [number, number];
export declare class MediaAnd {
type: NodeType;
@@ -278,20 +251,7 @@ export declare class MediaFeature {
/**
* @internal
*/
- toJSON(): {
- type: NodeType;
- feature: {
- type: NodeType;
- name: {
- type: NodeType;
- name: string;
- tokens: CSSToken[];
- };
- tokens: CSSToken[];
- };
- before: CSSToken[];
- after: CSSToken[];
- };
+ toJSON(): Record<string, unknown>;
/**
* @internal
*/
@@ -312,15 +272,7 @@ export declare class MediaFeatureBoolean {
/**
* @internal
*/
- toJSON(): {
- type: NodeType;
- name: {
- type: NodeType;
- name: string;
- tokens: CSSToken[];
- };
- tokens: CSSToken[];
- };
+ toJSON(): Record<string, unknown>;
/**
* @internal
*/
@@ -359,11 +311,7 @@ export declare class MediaFeatureName {
/**
* @internal
*/
- toJSON(): {
- type: NodeType;
- name: string;
- tokens: CSSToken[];
- };
+ toJSON(): Record<string, unknown>;
/**
* @internal
*/
@@ -391,20 +339,7 @@ export declare class MediaFeaturePlain {
/**
* @internal
*/
- toJSON(): {
- type: NodeType;
- name: {
- type: NodeType;
- name: string;
- tokens: CSSToken[];
- };
- value: {
- type: NodeType;
- value: unknown;
- tokens: CSSToken[];
- };
- tokens: CSSToken[];
- };
+ toJSON(): Record<string, unknown>;
/**
* @internal
*/
@@ -439,20 +374,7 @@ export declare class MediaFeatureRangeNameValue {
/**
* @internal
*/
- toJSON(): {
- type: NodeType;
- name: {
- type: NodeType;
- name: string;
- tokens: CSSToken[];
- };
- value: {
- type: NodeType;
- value: unknown;
- tokens: CSSToken[];
- };
- tokens: CSSToken[];
- };
+ toJSON(): Record<string, unknown>;
/**
* @internal
*/
@@ -481,20 +403,7 @@ export declare class MediaFeatureRangeValueName {
/**
* @internal
*/
- toJSON(): {
- type: NodeType;
- name: {
- type: NodeType;
- name: string;
- tokens: CSSToken[];
- };
- value: {
- type: NodeType;
- value: unknown;
- tokens: CSSToken[];
- };
- tokens: CSSToken[];
- };
+ toJSON(): Record<string, unknown>;
/**
* @internal
*/
@@ -526,25 +435,7 @@ export declare class MediaFeatureRangeValueNameValue {
/**
* @internal
*/
- toJSON(): {
- type: NodeType;
- name: {
- type: NodeType;
- name: string;
- tokens: CSSToken[];
- };
- valueOne: {
- type: NodeType;
- value: unknown;
- tokens: CSSToken[];
- };
- valueTwo: {
- type: NodeType;
- value: unknown;
- tokens: CSSToken[];
- };
- tokens: CSSToken[];
- };
+ toJSON(): Record<string, unknown>;
/**
* @internal
*/
@@ -574,11 +465,7 @@ export declare class MediaFeatureValue {
/**
* @internal
*/
- toJSON(): {
- type: NodeType;
- value: unknown;
- tokens: CSSToken[];
- };
+ toJSON(): Record<string, unknown>;
/**
* @internal
*/
@@ -612,12 +499,7 @@ export declare class MediaInParens {
/**
* @internal
*/
- toJSON(): {
- type: NodeType;
- media: unknown;
- before: CSSToken[];
- after: CSSToken[];
- };
+ toJSON(): Record<string, unknown>;
/**
* @internal
*/
@@ -646,16 +528,7 @@ export declare class MediaNot {
/**
* @internal
*/
- toJSON(): {
- type: NodeType;
- modifier: CSSToken[];
- media: {
- type: NodeType;
- media: unknown;
- before: CSSToken[];
- after: CSSToken[];
- };
- };
+ toJSON(): Record<string, unknown>;
/**
* @internal
*/
@@ -684,16 +557,7 @@ export declare class MediaOr {
/**
* @internal
*/
- toJSON(): {
- type: NodeType;
- modifier: CSSToken[];
- media: {
- type: NodeType;
- media: unknown;
- before: CSSToken[];
- after: CSSToken[];
- };
- };
+ toJSON(): Record<string, unknown>;
/**
* @internal
*/
@@ -722,11 +586,7 @@ export declare class MediaQueryInvalid {
/**
* @internal
*/
- toJSON(): {
- type: NodeType;
- string: string;
- media: ComponentValue[];
- };
+ toJSON(): Record<string, unknown>;
/**
* @internal
*/
@@ -760,11 +620,7 @@ export declare class MediaQueryWithoutType {
/**
* @internal
*/
- toJSON(): {
- type: NodeType;
- string: string;
- media: MediaCondition;
- };
+ toJSON(): Record<string, unknown>;
/**
* @internal
*/
@@ -798,14 +654,7 @@ export declare class MediaQueryWithType {
/**
* @internal
*/
- toJSON(): {
- type: NodeType;
- string: string;
- modifier: CSSToken[];
- mediaType: CSSToken[];
- and: CSSToken[] | undefined;
- media: MediaCondition | undefined;
- };
+ toJSON(): Record<string, unknown>;
/**
* @internal
*/
@@ -872,7 +721,7 @@ export declare enum NodeType {
export declare function parse(source: string, options?: {
preserveInvalidMediaQueries?: boolean;
onParseError?: (error: ParseError) => void;
-}): MediaQuery[];
+}): Array<MediaQuery>;
export declare function parseCustomMedia(source: string, options?: {
preserveInvalidMediaQueries?: boolean;
@@ -887,7 +736,7 @@ export declare function parseCustomMediaFromTokens(tokens: Array<CSSToken>, opti
export declare function parseFromTokens(tokens: Array<CSSToken>, options?: {
preserveInvalidMediaQueries?: boolean;
onParseError?: (error: ParseError) => void;
-}): MediaQuery[];
+}): Array<MediaQuery>;
export declare function typeFromToken(token: TokenIdent): MediaType | false;
diff --git a/node_modules/@csstools/media-query-list-parser/dist/index.mjs b/node_modules/@csstools/media-query-list-parser/dist/index.mjs
index 6a84592c..500d03cb 100644
--- a/node_modules/@csstools/media-query-list-parser/dist/index.mjs
+++ b/node_modules/@csstools/media-query-list-parser/dist/index.mjs
@@ -1 +1 @@
-import{walkerIndexGenerator as e,ComponentValueType as t,TokenNode as i,parseListOfComponentValues as a,isWhitespaceNode as n,isCommentNode as r,isTokenNode as s,isSimpleBlockNode as o,parseCommaSeparatedListOfComponentValues as u}from"@csstools/css-parser-algorithms";import{stringify as d,TokenType as l,mutateIdent as h,tokenizer as m,cloneTokens as f}from"@csstools/css-tokenizer";var c;!function(e){e.CustomMedia="custom-media",e.GeneralEnclosed="general-enclosed",e.MediaAnd="media-and",e.MediaCondition="media-condition",e.MediaConditionListWithAnd="media-condition-list-and",e.MediaConditionListWithOr="media-condition-list-or",e.MediaFeature="media-feature",e.MediaFeatureBoolean="mf-boolean",e.MediaFeatureName="mf-name",e.MediaFeaturePlain="mf-plain",e.MediaFeatureRangeNameValue="mf-range-name-value",e.MediaFeatureRangeValueName="mf-range-value-name",e.MediaFeatureRangeValueNameValue="mf-range-value-name-value",e.MediaFeatureValue="mf-value",e.MediaInParens="media-in-parens",e.MediaNot="media-not",e.MediaOr="media-or",e.MediaQueryWithType="media-query-with-type",e.MediaQueryWithoutType="media-query-without-type",e.MediaQueryInvalid="media-query-invalid"}(c||(c={}));const M=/[A-Z]/g;function toLowerCaseAZ(e){return e.replace(M,(e=>String.fromCharCode(e.charCodeAt(0)+32)))}class MediaCondition{type=c.MediaCondition;media;constructor(e){this.media=e}tokens(){return this.media.tokens()}toString(){return this.media.toString()}indexOf(e){return e===this.media?"media":-1}at(e){if("media"===e)return this.media}walk(e,t){let i;return t&&(i={...t}),!1!==e({node:this.media,parent:this,state:i},"media")&&this.media.walk(e,i)}toJSON(){return{type:this.type,media:this.media.toJSON()}}isMediaCondition(){return MediaCondition.isMediaCondition(this)}static isMediaCondition(e){return!!e&&(e instanceof MediaCondition&&e.type===c.MediaCondition)}}class MediaInParens{type=c.MediaInParens;media;before;after;constructor(e,t=[],i=[]){this.media=e,this.before=t,this.after=i}tokens(){return[...this.before,...this.media.tokens(),...this.after]}toString(){return d(...this.before)+this.media.toString()+d(...this.after)}indexOf(e){return e===this.media?"media":-1}at(e){if("media"===e)return this.media}walk(e,t){let i;return t&&(i={...t}),!1!==e({node:this.media,parent:this,state:i},"media")&&("walk"in this.media?this.media.walk(e,i):void 0)}toJSON(){return{type:this.type,media:this.media.toJSON(),before:this.before,after:this.after}}isMediaInParens(){return MediaInParens.isMediaInParens(this)}static isMediaInParens(e){return!!e&&(e instanceof MediaInParens&&e.type===c.MediaInParens)}}class MediaQueryWithType{type=c.MediaQueryWithType;modifier;mediaType;and=void 0;media=void 0;constructor(e,t,i,a){this.modifier=e,this.mediaType=t,i&&a&&(this.and=i,this.media=a)}getModifier(){if(!this.modifier.length)return"";for(let e=0;e<this.modifier.length;e++){const t=this.modifier[e];if(t[0]===l.Ident)return t[4].value}return""}negateQuery(){const e=new MediaQueryWithType([...this.modifier],[...this.mediaType],this.and,this.media);if(0===e.modifier.length)return e.modifier=[[l.Ident,"not",-1,-1,{value:"not"}],[l.Whitespace," ",-1,-1,void 0]],e;for(let t=0;t<e.modifier.length;t++){const i=e.modifier[t];if(i[0]===l.Ident&&"not"===toLowerCaseAZ(i[4].value)){e.modifier.splice(t,1);break}if(i[0]===l.Ident&&"only"===toLowerCaseAZ(i[4].value)){i[1]="not",i[4].value="not";break}}return e}getMediaType(){if(!this.mediaType.length)return"";for(let e=0;e<this.mediaType.length;e++){const t=this.mediaType[e];if(t[0]===l.Ident)return t[4].value}return""}tokens(){return this.and&&this.media?[...this.modifier,...this.mediaType,...this.and,...this.media.tokens()]:[...this.modifier,...this.mediaType]}toString(){return this.and&&this.media?d(...this.modifier)+d(...this.mediaType)+d(...this.and)+this.media.toString():d(...this.modifier)+d(...this.mediaType)}indexOf(e){return e===this.media?"media":-1}at(e){if("media"===e)return this.media}walk(e,t){let i;if(t&&(i={...t}),this.media)return!1!==e({node:this.media,parent:this,state:i},"media")&&this.media.walk(e,i)}toJSON(){return{type:this.type,string:this.toString(),modifier:this.modifier,mediaType:this.mediaType,and:this.and,media:this.media}}isMediaQueryWithType(){return MediaQueryWithType.isMediaQueryWithType(this)}static isMediaQueryWithType(e){return!!e&&(e instanceof MediaQueryWithType&&e.type===c.MediaQueryWithType)}}class MediaQueryWithoutType{type=c.MediaQueryWithoutType;media;constructor(e){this.media=e}negateQuery(){let e=this.media;if(e.media.type===c.MediaNot)return new MediaQueryWithoutType(new MediaCondition(e.media.media));e.media.type===c.MediaConditionListWithOr&&(e=new MediaCondition(new MediaInParens(e,[[l.Whitespace," ",0,0,void 0],[l.OpenParen,"(",0,0,void 0]],[[l.CloseParen,")",0,0,void 0]])));return new MediaQueryWithType([[l.Ident,"not",0,0,{value:"not"}],[l.Whitespace," ",0,0,void 0]],[[l.Ident,"all",0,0,{value:"all"}],[l.Whitespace," ",0,0,void 0]],[[l.Ident,"and",0,0,{value:"and"}]],e)}tokens(){return this.media.tokens()}toString(){return this.media.toString()}indexOf(e){return e===this.media?"media":-1}at(e){if("media"===e)return this.media}walk(e,t){let i;return t&&(i={...t}),!1!==e({node:this.media,parent:this,state:i},"media")&&this.media.walk(e,i)}toJSON(){return{type:this.type,string:this.toString(),media:this.media}}isMediaQueryWithoutType(){return MediaQueryWithoutType.isMediaQueryWithoutType(this)}static isMediaQueryWithoutType(e){return!!e&&(e instanceof MediaQueryWithoutType&&e.type===c.MediaQueryWithoutType)}}class MediaQueryInvalid{type=c.MediaQueryInvalid;media;constructor(e){this.media=e}negateQuery(){return new MediaQueryInvalid(this.media)}tokens(){return this.media.flatMap((e=>e.tokens()))}toString(){return this.media.map((e=>e.toString())).join("")}walk(t,i){if(0===this.media.length)return;const a=e(this.media);let n=0;for(;n<this.media.length;){const e=this.media[n];let r;if(i&&(r={...i}),!1===t({node:e,parent:this,state:r},n))return!1;if("walk"in e&&this.media.includes(e)&&!1===e.walk(t,r))return!1;if(n=a(this.media,e,n),-1===n)break}}toJSON(){return{type:this.type,string:this.toString(),media:this.media}}isMediaQueryInvalid(){return MediaQueryInvalid.isMediaQueryInvalid(this)}static isMediaQueryInvalid(e){return!!e&&(e instanceof MediaQueryInvalid&&e.type===c.MediaQueryInvalid)}}class GeneralEnclosed{type=c.GeneralEnclosed;value;constructor(e){this.value=e}tokens(){return this.value.tokens()}toString(){return this.value.toString()}indexOf(e){return e===this.value?"value":-1}at(e){if("value"===e)return this.value}walk(e,t){let i;return t&&(i={...t}),!1!==e({node:this.value,parent:this,state:i},"value")&&("walk"in this.value?this.value.walk(e,i):void 0)}toJSON(){return{type:this.type,tokens:this.tokens()}}isGeneralEnclosed(){return GeneralEnclosed.isGeneralEnclosed(this)}static isGeneralEnclosed(e){return!!e&&(e instanceof GeneralEnclosed&&e.type===c.GeneralEnclosed)}}class MediaAnd{type=c.MediaAnd;modifier;media;constructor(e,t){this.modifier=e,this.media=t}tokens(){return[...this.modifier,...this.media.tokens()]}toString(){return d(...this.modifier)+this.media.toString()}indexOf(e){return e===this.media?"media":-1}at(e){return"media"===e?this.media:null}walk(e,t){let i;return t&&(i={...t}),!1!==e({node:this.media,parent:this,state:i},"media")&&this.media.walk(e,i)}toJSON(){return{type:this.type,modifier:this.modifier,media:this.media.toJSON()}}isMediaAnd(){return MediaAnd.isMediaAnd(this)}static isMediaAnd(e){return!!e&&(e instanceof MediaAnd&&e.type===c.MediaAnd)}}class MediaConditionListWithAnd{type=c.MediaConditionListWithAnd;leading;list;before;after;constructor(e,t,i=[],a=[]){this.leading=e,this.list=t,this.before=i,this.after=a}tokens(){return[...this.before,...this.leading.tokens(),...this.list.flatMap((e=>e.tokens())),...this.after]}toString(){return d(...this.before)+this.leading.toString()+this.list.map((e=>e.toString())).join("")+d(...this.after)}indexOf(e){return e===this.leading?"leading":"media-and"===e.type?this.list.indexOf(e):-1}at(e){return"leading"===e?this.leading:"number"==typeof e?(e<0&&(e=this.list.length+e),this.list[e]):void 0}walk(t,i){let a;if(i&&(a={...i}),!1===t({node:this.leading,parent:this,state:a},"leading"))return!1;if("walk"in this.leading&&!1===this.leading.walk(t,a))return!1;if(0===this.list.length)return;const n=e(this.list);let r=0;for(;r<this.list.length;){const e=this.list[r];if(i&&(a={...i}),!1===t({node:e,parent:this,state:a},r))return!1;if("walk"in e&&this.list.includes(e)&&!1===e.walk(t,a))return!1;if(r=n(this.list,e,r),-1===r)break}}toJSON(){return{type:this.type,leading:this.leading.toJSON(),list:this.list.map((e=>e.toJSON())),before:this.before,after:this.after}}isMediaConditionListWithAnd(){return MediaConditionListWithAnd.isMediaConditionListWithAnd(this)}static isMediaConditionListWithAnd(e){return!!e&&(e instanceof MediaConditionListWithAnd&&e.type===c.MediaConditionListWithAnd)}}class MediaConditionListWithOr{type=c.MediaConditionListWithOr;leading;list;before;after;constructor(e,t,i=[],a=[]){this.leading=e,this.list=t,this.before=i,this.after=a}tokens(){return[...this.before,...this.leading.tokens(),...this.list.flatMap((e=>e.tokens())),...this.after]}toString(){return d(...this.before)+this.leading.toString()+this.list.map((e=>e.toString())).join("")+d(...this.after)}indexOf(e){return e===this.leading?"leading":"media-or"===e.type?this.list.indexOf(e):-1}at(e){return"leading"===e?this.leading:"number"==typeof e?(e<0&&(e=this.list.length+e),this.list[e]):void 0}walk(t,i){let a;if(i&&(a={...i}),!1===t({node:this.leading,parent:this,state:a},"leading"))return!1;if("walk"in this.leading&&!1===this.leading.walk(t,a))return!1;if(0===this.list.length)return;const n=e(this.list);let r=0;for(;r<this.list.length;){const e=this.list[r];if(i&&(a={...i}),!1===t({node:e,parent:this,state:a},r))return!1;if("walk"in e&&this.list.includes(e)&&!1===e.walk(t,a))return!1;if(r=n(this.list,e,r),-1===r)break}}toJSON(){return{type:this.type,leading:this.leading.toJSON(),list:this.list.map((e=>e.toJSON())),before:this.before,after:this.after}}isMediaConditionListWithOr(){return MediaConditionListWithOr.isMediaConditionListWithOr(this)}static isMediaConditionListWithOr(e){return!!e&&(e instanceof MediaConditionListWithOr&&e.type===c.MediaConditionListWithOr)}}function isNumber(e){return!!(e.type===t.Token&&e.value[0]===l.Number||e.type===t.Function&&p.has(toLowerCaseAZ(e.name[4].value)))}const p=new Set(["abs","acos","asin","atan","atan2","calc","clamp","cos","exp","hypot","log","max","min","mod","pow","rem","round","sign","sin","sqrt","tan"]);function isDimension(e){return e.type===t.Token&&e.value[0]===l.Dimension}function isIdent(e){return e.type===t.Token&&e.value[0]===l.Ident}function isEnvironmentVariable(e){return e.type===t.Function&&"env"===toLowerCaseAZ(e.name[4].value)}class MediaFeatureName{type=c.MediaFeatureName;name;before;after;constructor(e,t=[],i=[]){this.name=e,this.before=t,this.after=i}getName(){return this.name.value[4].value}getNameToken(){return this.name.value}tokens(){return[...this.before,...this.name.tokens(),...this.after]}toString(){return d(...this.before)+this.name.toString()+d(...this.after)}indexOf(e){return e===this.name?"name":-1}at(e){if("name"===e)return this.name}toJSON(){return{type:this.type,name:this.getName(),tokens:this.tokens()}}isMediaFeatureName(){return MediaFeatureName.isMediaFeatureName(this)}static isMediaFeatureName(e){return!!e&&(e instanceof MediaFeatureName&&e.type===c.MediaFeatureName)}}function parseMediaFeatureName(e){let i=-1;for(let a=0;a<e.length;a++){const n=e[a];if(n.type!==t.Whitespace&&n.type!==t.Comment){if(!isIdent(n))return!1;if(-1!==i)return!1;i=a}}return-1!==i&&new MediaFeatureName(e[i],e.slice(0,i).flatMap((e=>e.tokens())),e.slice(i+1).flatMap((e=>e.tokens())))}class MediaFeatureBoolean{type=c.MediaFeatureBoolean;name;constructor(e){this.name=e}getName(){return this.name.getName()}getNameToken(){return this.name.getNameToken()}tokens(){return this.name.tokens()}toString(){return this.name.toString()}indexOf(e){return e===this.name?"name":-1}at(e){if("name"===e)return this.name}toJSON(){return{type:this.type,name:this.name.toJSON(),tokens:this.tokens()}}isMediaFeatureBoolean(){return MediaFeatureBoolean.isMediaFeatureBoolean(this)}static isMediaFeatureBoolean(e){return!!e&&(e instanceof MediaFeatureBoolean&&e.type===c.MediaFeatureBoolean)}}function parseMediaFeatureBoolean(e){const t=parseMediaFeatureName(e);return!1===t?t:new MediaFeatureBoolean(t)}class MediaFeatureValue{type=c.MediaFeatureValue;value;before;after;constructor(e,t=[],i=[]){Array.isArray(e)&&1===e.length?this.value=e[0]:this.value=e,this.before=t,this.after=i}tokens(){return Array.isArray(this.value)?[...this.before,...this.value.flatMap((e=>e.tokens())),...this.after]:[...this.before,...this.value.tokens(),...this.after]}toString(){return Array.isArray(this.value)?d(...this.before)+this.value.map((e=>e.toString())).join("")+d(...this.after):d(...this.before)+this.value.toString()+d(...this.after)}indexOf(e){return e===this.value?"value":-1}at(e){return"value"===e?this.value:Array.isArray(this.value)&&"number"==typeof e?(e<0&&(e=this.value.length+e),this.value[e]):void 0}walk(t,i){if(Array.isArray(this.value)){if(0===this.value.length)return;const a=e(this.value);let n=0;for(;n<this.value.length;){const e=this.value[n];let r;if(i&&(r={...i}),!1===t({node:e,parent:this,state:r},n))return!1;if("walk"in e&&this.value.includes(e)&&!1===e.walk(t,r))return!1;if(n=a(this.value,e,n),-1===n)break}}else{let e;if(i&&(e={...i}),!1===t({node:this.value,parent:this,state:e},"value"))return!1;if("walk"in this.value)return this.value.walk(t,e)}}toJSON(){return Array.isArray(this.value)?{type:this.type,value:this.value.map((e=>e.toJSON())),tokens:this.tokens()}:{type:this.type,value:this.value.toJSON(),tokens:this.tokens()}}isMediaFeatureValue(){return MediaFeatureValue.isMediaFeatureValue(this)}static isMediaFeatureValue(e){return!!e&&(e instanceof MediaFeatureValue&&e.type===c.MediaFeatureValue)}}function parseMediaFeatureValue(e,i=!1){let a=-1,n=-1;for(let r=0;r<e.length;r++){const s=e[r];if(s.type!==t.Whitespace&&s.type!==t.Comment){if(-1!==a)return!1;if(isNumber(s)){const t=matchesRatioExactly(e.slice(r));if(-1!==t){a=t[0]+r,n=t[1]+r,r+=t[1]-t[0];continue}a=r,n=r}else if(isEnvironmentVariable(s))a=r,n=r;else if(isDimension(s))a=r,n=r;else{if(i||!isIdent(s))return!1;a=r,n=r}}}return-1!==a&&new MediaFeatureValue(e.slice(a,n+1),e.slice(0,a).flatMap((e=>e.tokens())),e.slice(n+1).flatMap((e=>e.tokens())))}function matchesRatioExactly(e){let t=-1,i=-1;const a=matchesRatio(e);if(-1===a)return-1;t=a[0],i=a[1];for(let t=i+1;t<e.length;t++){const i=e[t];if("whitespace"!==i.type&&"comment"!==i.type)return-1}return[t,i]}function matchesRatio(e){let t=-1,i=-1;for(let a=0;a<e.length;a++){const n=e[a];if("whitespace"!==n.type&&"comment"!==n.type){if("token"===n.type){const e=n.value;if(e[0]===l.Delim&&"/"===e[4].value){if(-1===t)return-1;if(-1!==i)return-1;i=a;continue}}if(!isNumber(n))return-1;if(-1!==i)return[t,a];if(-1!==t)return-1;t=a}}return-1}class MediaFeaturePlain{type=c.MediaFeaturePlain;name;colon;value;constructor(e,t,i){this.name=e,this.colon=t,this.value=i}getName(){return this.name.getName()}getNameToken(){return this.name.getNameToken()}tokens(){return[...this.name.tokens(),this.colon,...this.value.tokens()]}toString(){return this.name.toString()+d(this.colon)+this.value.toString()}indexOf(e){return e===this.name?"name":e===this.value?"value":-1}at(e){return"name"===e?this.name:"value"===e?this.value:void 0}walk(e,t){let i;return t&&(i={...t}),!1!==e({node:this.value,parent:this,state:i},"value")&&this.value.walk(e,i)}toJSON(){return{type:this.type,name:this.name.toJSON(),value:this.value.toJSON(),tokens:this.tokens()}}isMediaFeaturePlain(){return MediaFeaturePlain.isMediaFeaturePlain(this)}static isMediaFeaturePlain(e){return!!e&&(e instanceof MediaFeaturePlain&&e.type===c.MediaFeaturePlain)}}function parseMediaFeaturePlain(e){let i=[],a=[],n=null;for(let r=0;r<e.length;r++){const s=e[r];if(s.type===t.Token){const t=s.value;if(t[0]===l.Colon){i=e.slice(0,r),a=e.slice(r+1),n=t;break}}}if(!i.length||!a.length||!n)return!1;const r=parseMediaFeatureName(i);if(!1===r)return!1;const s=parseMediaFeatureValue(a);return!1!==s&&new MediaFeaturePlain(r,n,s)}var y,v,g,k,F;function matchesComparison(e){let i=-1;for(let a=0;a<e.length;a++){const n=e[a];if(n.type===t.Token){const e=n.value;if(e[0]===l.Delim){if(e[4].value===g.EQ)return-1!==i?[i,a]:[a,a];if(e[4].value===y.LT){i=a;continue}if(e[4].value===v.GT){i=a;continue}}}break}return-1!==i&&[i,i]}function comparisonFromTokens(e){if(0===e.length||e.length>2)return!1;if(e[0][0]!==l.Delim)return!1;if(1===e.length)switch(e[0][4].value){case g.EQ:return g.EQ;case y.LT:return y.LT;case v.GT:return v.GT;default:return!1}if(e[1][0]!==l.Delim)return!1;if(e[1][4].value!==g.EQ)return!1;switch(e[0][4].value){case y.LT:return y.LT_OR_EQ;case v.GT:return v.GT_OR_EQ;default:return!1}}function invertComparison(e){switch(e){case g.EQ:return g.EQ;case y.LT:return v.GT;case y.LT_OR_EQ:return v.GT_OR_EQ;case v.GT:return y.LT;case v.GT_OR_EQ:return y.LT_OR_EQ;default:return!1}}!function(e){e.LT="<",e.LT_OR_EQ="<="}(y||(y={})),function(e){e.GT=">",e.GT_OR_EQ=">="}(v||(v={})),function(e){e.EQ="="}(g||(g={}));class MediaFeatureRangeNameValue{type=c.MediaFeatureRangeNameValue;name;operator;value;constructor(e,t,i){this.name=e,this.operator=t,this.value=i}operatorKind(){return comparisonFromTokens(this.operator)}getName(){return this.name.getName()}getNameToken(){return this.name.getNameToken()}tokens(){return[...this.name.tokens(),...this.operator,...this.value.tokens()]}toString(){return this.name.toString()+d(...this.operator)+this.value.toString()}indexOf(e){return e===this.name?"name":e===this.value?"value":-1}at(e){return"name"===e?this.name:"value"===e?this.value:void 0}walk(e,t){let i;return t&&(i={...t}),!1!==e({node:this.value,parent:this,state:i},"value")&&("walk"in this.value?this.value.walk(e,i):void 0)}toJSON(){return{type:this.type,name:this.name.toJSON(),value:this.value.toJSON(),tokens:this.tokens()}}isMediaFeatureRangeNameValue(){return MediaFeatureRangeNameValue.isMediaFeatureRangeNameValue(this)}static isMediaFeatureRangeNameValue(e){return!!e&&(e instanceof MediaFeatureRangeNameValue&&e.type===c.MediaFeatureRangeNameValue)}}class MediaFeatureRangeValueName{type=c.MediaFeatureRangeValueName;name;operator;value;constructor(e,t,i){this.name=e,this.operator=t,this.value=i}operatorKind(){return comparisonFromTokens(this.operator)}getName(){return this.name.getName()}getNameToken(){return this.name.getNameToken()}tokens(){return[...this.value.tokens(),...this.operator,...this.name.tokens()]}toString(){return this.value.toString()+d(...this.operator)+this.name.toString()}indexOf(e){return e===this.name?"name":e===this.value?"value":-1}at(e){return"name"===e?this.name:"value"===e?this.value:void 0}walk(e,t){let i;return t&&(i={...t}),!1!==e({node:this.value,parent:this,state:i},"value")&&("walk"in this.value?this.value.walk(e,i):void 0)}toJSON(){return{type:this.type,name:this.name.toJSON(),value:this.value.toJSON(),tokens:this.tokens()}}isMediaFeatureRangeValueName(){return MediaFeatureRangeValueName.isMediaFeatureRangeValueName(this)}static isMediaFeatureRangeValueName(e){return!!e&&(e instanceof MediaFeatureRangeValueName&&e.type===c.MediaFeatureRangeValueName)}}class MediaFeatureRangeValueNameValue{type=c.MediaFeatureRangeValueNameValue;name;valueOne;valueOneOperator;valueTwo;valueTwoOperator;constructor(e,t,i,a,n){this.name=e,this.valueOne=t,this.valueOneOperator=i,this.valueTwo=a,this.valueTwoOperator=n}valueOneOperatorKind(){return comparisonFromTokens(this.valueOneOperator)}valueTwoOperatorKind(){return comparisonFromTokens(this.valueTwoOperator)}getName(){return this.name.getName()}getNameToken(){return this.name.getNameToken()}tokens(){return[...this.valueOne.tokens(),...this.valueOneOperator,...this.name.tokens(),...this.valueTwoOperator,...this.valueTwo.tokens()]}toString(){return this.valueOne.toString()+d(...this.valueOneOperator)+this.name.toString()+d(...this.valueTwoOperator)+this.valueTwo.toString()}indexOf(e){return e===this.name?"name":e===this.valueOne?"valueOne":e===this.valueTwo?"valueTwo":-1}at(e){return"name"===e?this.name:"valueOne"===e?this.valueOne:"valueTwo"===e?this.valueTwo:void 0}walk(e,t){let i;return t&&(i={...t}),!1!==e({node:this.valueOne,parent:this,state:i},"valueOne")&&((!("walk"in this.valueOne)||!1!==this.valueOne.walk(e,i))&&(t&&(i={...t}),!1!==e({node:this.valueTwo,parent:this,state:i},"valueTwo")&&((!("walk"in this.valueTwo)||!1!==this.valueTwo.walk(e,i))&&void 0)))}toJSON(){return{type:this.type,name:this.name.toJSON(),valueOne:this.valueOne.toJSON(),valueTwo:this.valueTwo.toJSON(),tokens:this.tokens()}}isMediaFeatureRangeValueNameValue(){return MediaFeatureRangeValueNameValue.isMediaFeatureRangeValueNameValue(this)}static isMediaFeatureRangeValueNameValue(e){return!!e&&(e instanceof MediaFeatureRangeValueNameValue&&e.type===c.MediaFeatureRangeValueNameValue)}}function parseMediaFeatureRange(e){let i=!1,a=!1;for(let n=0;n<e.length;n++){const r=e[n];if(r.type===t.Token){if(r.value[0]===l.Delim){const t=matchesComparison(e.slice(n));if(!1!==t){if(!1!==i){a=[t[0]+n,t[1]+n];break}i=[t[0]+n,t[1]+n],n+=t[1]}}}}if(!1===i)return!1;const n=[e[i[0]].value];if(i[0]!==i[1]&&n.push(e[i[1]].value),!1===a){const t=e.slice(0,i[0]),a=e.slice(i[1]+1),r=parseMediaFeatureName(t);if(r){const e=parseMediaFeatureValue(a,!0);return!!e&&new MediaFeatureRangeNameValue(r,n,e)}const s=parseMediaFeatureName(a);if(s){const e=parseMediaFeatureValue(t,!0);return!!e&&new MediaFeatureRangeValueName(s,n,e)}return!1}const r=[e[a[0]].value];a[0]!==a[1]&&r.push(e[a[1]].value);const s=e.slice(0,i[0]),o=e.slice(i[1]+1,a[0]),u=e.slice(a[1]+1),d=parseMediaFeatureValue(s,!0),h=parseMediaFeatureName(o),m=parseMediaFeatureValue(u,!0);if(!d||!h||!m)return!1;{const e=comparisonFromTokens(n);if(!1===e||e===g.EQ)return!1;const t=comparisonFromTokens(r);if(!1===t||t===g.EQ)return!1;if(!(e!==y.LT&&e!==y.LT_OR_EQ||t!==v.GT&&t!==v.GT_OR_EQ))return!1;if(!(e!==v.GT&&e!==v.GT_OR_EQ||t!==y.LT&&t!==y.LT_OR_EQ))return!1}return new MediaFeatureRangeValueNameValue(h,d,n,m,r)}class MediaFeature{type=c.MediaFeature;feature;before;after;constructor(e,t=[],i=[]){this.feature=e,this.before=t,this.after=i}getName(){return this.feature.getName()}getNameToken(){return this.feature.getNameToken()}tokens(){return[...this.before,...this.feature.tokens(),...this.after]}toString(){return d(...this.before)+this.feature.toString()+d(...this.after)}indexOf(e){return e===this.feature?"feature":-1}at(e){if("feature"===e)return this.feature}walk(e,t){let i;return t&&(i={...t}),!1!==e({node:this.feature,parent:this,state:i},"feature")&&("walk"in this.feature?this.feature.walk(e,i):void 0)}toJSON(){return{type:this.type,feature:this.feature.toJSON(),before:this.before,after:this.after}}isMediaFeature(){return MediaFeature.isMediaFeature(this)}static isMediaFeature(e){return!!e&&(e instanceof MediaFeature&&e.type===c.MediaFeature)}}function parseMediaFeature(e,t=[],i=[]){if(e.startToken[0]!==l.OpenParen)return!1;const a=parseMediaFeatureBoolean(e.value);if(!1!==a)return new MediaFeature(a,t,i);const n=parseMediaFeaturePlain(e.value);if(!1!==n)return new MediaFeature(n,t,i);const r=parseMediaFeatureRange(e.value);return!1!==r&&new MediaFeature(r,t,i)}function newMediaFeatureBoolean(e){const t=[l.Ident,"",-1,-1,{value:""}];return h(t,e),new MediaFeature(new MediaFeatureBoolean(new MediaFeatureName(new i(t))),[[l.OpenParen,"(",-1,-1,void 0]],[[l.CloseParen,")",-1,-1,void 0]])}function newMediaFeaturePlain(e,...t){const n=[l.Ident,"",-1,-1,{value:""}];h(n,e);const r=a(t);return new MediaFeature(new MediaFeaturePlain(new MediaFeatureName(new i(n)),[l.Colon,":",-1,-1,void 0],new MediaFeatureValue(1===r.length?r[0]:r)),[[l.OpenParen,"(",-1,-1,void 0]],[[l.CloseParen,")",-1,-1,void 0]])}class MediaNot{type=c.MediaNot;modifier;media;constructor(e,t){this.modifier=e,this.media=t}tokens(){return[...this.modifier,...this.media.tokens()]}toString(){return d(...this.modifier)+this.media.toString()}indexOf(e){return e===this.media?"media":-1}at(e){if("media"===e)return this.media}walk(e,t){let i;return t&&(i={...t}),!1!==e({node:this.media,parent:this,state:i},"media")&&this.media.walk(e,i)}toJSON(){return{type:this.type,modifier:this.modifier,media:this.media.toJSON()}}isMediaNot(){return MediaNot.isMediaNot(this)}static isMediaNot(e){return!!e&&(e instanceof MediaNot&&e.type===c.MediaNot)}}class MediaOr{type=c.MediaOr;modifier;media;constructor(e,t){this.modifier=e,this.media=t}tokens(){return[...this.modifier,...this.media.tokens()]}toString(){return d(...this.modifier)+this.media.toString()}indexOf(e){return e===this.media?"media":-1}at(e){if("media"===e)return this.media}walk(e,t){let i;return t&&(i={...t}),!1!==e({node:this.media,parent:this,state:i},"media")&&this.media.walk(e,i)}toJSON(){return{type:this.type,modifier:this.modifier,media:this.media.toJSON()}}isMediaOr(){return MediaOr.isMediaOr(this)}static isMediaOr(e){return!!e&&(e instanceof MediaOr&&e.type===c.MediaOr)}}function modifierFromToken(e){if(e[0]!==l.Ident)return!1;switch(toLowerCaseAZ(e[4].value)){case k.Not:return k.Not;case k.Only:return k.Only;default:return!1}}function parseMediaQuery(e){{const t=parseMediaCondition(e);if(!1!==t)return new MediaQueryWithoutType(t)}{let t=-1,i=-1,a=-1;for(let o=0;o<e.length;o++){const u=e[o];if(!n(u)&&!r(u)){if(s(u)){const n=u.value;if(-1===t&&n[0]===l.Ident&&modifierFromToken(n)){t=o;continue}if(-1===i&&n[0]===l.Ident&&!modifierFromToken(n)){i=o;continue}if(-1===a&&n[0]===l.Ident&&"and"===toLowerCaseAZ(n[4].value)){a=o;if(!1===parseMediaConditionWithoutOr(e.slice(o+1)))return!1;break}return!1}return!1}}let o=[],u=[];-1!==t?(o=e.slice(0,t+1).flatMap((e=>e.tokens())),-1!==i&&(u=e.slice(t+1,i+1).flatMap((e=>e.tokens())))):-1!==i&&(u=e.slice(0,i+1).flatMap((e=>e.tokens())));const d=parseMediaConditionWithoutOr(e.slice(Math.max(t,i,a)+1));return!1===d?new MediaQueryWithType(o,[...u,...e.slice(i+1).flatMap((e=>e.tokens()))]):new MediaQueryWithType(o,u,e.slice(i+1,a+1).flatMap((e=>e.tokens())),d)}}function parseMediaConditionListWithOr(e){let i=!1;const a=[];let n=-1,r=-1;for(let s=0;s<e.length;s++){if(i){const t=parseMediaOr(e.slice(s));if(!1!==t){s+=t.advance,a.push(t.node),r=s;continue}}const u=e[s];if(u.type!==t.Whitespace&&u.type!==t.Comment){if(i)return!1;if(!1!==i||!o(u))return!1;if(u.normalize(),i=parseMediaInParensFromSimpleBlock(u),!1===i)return!1;n=s}}return!(!i||!a.length)&&new MediaConditionListWithOr(i,a,e.slice(0,n).flatMap((e=>e.tokens())),e.slice(r+1).flatMap((e=>e.tokens())))}function parseMediaConditionListWithAnd(e){let i=!1;const a=[];let n=-1,r=-1;for(let s=0;s<e.length;s++){if(i){const t=parseMediaAnd(e.slice(s));if(!1!==t){s+=t.advance,a.push(t.node),r=s;continue}}const u=e[s];if(u.type!==t.Whitespace&&u.type!==t.Comment){if(i)return!1;if(!1!==i||!o(u))return!1;if(u.normalize(),i=parseMediaInParensFromSimpleBlock(u),!1===i)return!1;n=s}}return!(!i||!a.length)&&new MediaConditionListWithAnd(i,a,e.slice(0,n).flatMap((e=>e.tokens())),e.slice(r+1).flatMap((e=>e.tokens())))}function parseMediaCondition(e){const t=parseMediaNot(e);if(!1!==t)return new MediaCondition(t);const i=parseMediaConditionListWithAnd(e);if(!1!==i)return new MediaCondition(i);const a=parseMediaConditionListWithOr(e);if(!1!==a)return new MediaCondition(a);const n=parseMediaInParens(e);return!1!==n&&new MediaCondition(n)}function parseMediaConditionWithoutOr(e){const t=parseMediaNot(e);if(!1!==t)return new MediaCondition(t);const i=parseMediaConditionListWithAnd(e);if(!1!==i)return new MediaCondition(i);const a=parseMediaInParens(e);return!1!==a&&new MediaCondition(a)}function parseMediaInParens(e){let i=-1;for(let a=0;a<e.length;a++){const n=e[a];if(n.type!==t.Whitespace&&n.type!==t.Comment){if(!o(n))return!1;if(-1!==i)return!1;i=a}}if(-1===i)return!1;const a=e[i];if(a.startToken[0]!==l.OpenParen)return!1;a.normalize();const n=[...e.slice(0,i).flatMap((e=>e.tokens())),a.startToken],r=[a.endToken,...e.slice(i+1).flatMap((e=>e.tokens()))],s=parseMediaFeature(a,n,r);if(!1!==s)return new MediaInParens(s);const u=parseMediaCondition(a.value);return!1!==u?new MediaInParens(u,n,r):new MediaInParens(new GeneralEnclosed(a),e.slice(0,i).flatMap((e=>e.tokens())),e.slice(i+1).flatMap((e=>e.tokens())))}function parseMediaInParensFromSimpleBlock(e){if(e.startToken[0]!==l.OpenParen)return!1;const t=parseMediaFeature(e,[e.startToken],[e.endToken]);if(!1!==t)return new MediaInParens(t);const i=parseMediaCondition(e.value);return!1!==i?new MediaInParens(i,[e.startToken],[e.endToken]):new MediaInParens(new GeneralEnclosed(e))}function parseMediaNot(e){let i=!1,a=null;for(let n=0;n<e.length;n++){const r=e[n];if(r.type!==t.Whitespace&&r.type!==t.Comment){if(isIdent(r)){if("not"===toLowerCaseAZ(r.value[4].value)){if(i)return!1;i=!0;continue}return!1}if(!i||!o(r))return!1;{r.normalize();const t=parseMediaInParensFromSimpleBlock(r);if(!1===t)return!1;a=new MediaNot(e.slice(0,n).flatMap((e=>e.tokens())),t)}}}return a||!1}function parseMediaOr(e){let i=!1;for(let a=0;a<e.length;a++){const n=e[a];if(n.type!==t.Whitespace&&n.type!==t.Comment){if(isIdent(n)){if("or"===toLowerCaseAZ(n.value[4].value)){if(i)return!1;i=!0;continue}return!1}if(i&&o(n)){n.normalize();const t=parseMediaInParensFromSimpleBlock(n);return!1!==t&&{advance:a,node:new MediaOr(e.slice(0,a).flatMap((e=>e.tokens())),t)}}return!1}}return!1}function parseMediaAnd(e){let i=!1;for(let a=0;a<e.length;a++){const n=e[a];if(n.type!==t.Whitespace&&n.type!==t.Comment){if(isIdent(n)){if("and"===toLowerCaseAZ(n.value[4].value)){if(i)return!1;i=!0;continue}return!1}if(i&&o(n)){n.normalize();const t=parseMediaInParensFromSimpleBlock(n);return!1!==t&&{advance:a,node:new MediaAnd(e.slice(0,a).flatMap((e=>e.tokens())),t)}}return!1}}return!1}function parseFromTokens(e,t){const i=u(e,{onParseError:t?.onParseError});return i.map(((e,a)=>{const n=parseMediaQuery(e);return 0==n&&!0===t?.preserveInvalidMediaQueries?new MediaQueryInvalid(i[a]):n})).filter((e=>!!e))}function parse(e,t){const i=m({css:e},{onParseError:t?.onParseError}),a=[];for(;!i.endOfFile();)a.push(i.nextToken());return a.push(i.nextToken()),parseFromTokens(a,t)}!function(e){e.Not="not",e.Only="only"}(k||(k={}));class CustomMedia{type=c.CustomMedia;name;mediaQueryList=null;trueOrFalseKeyword=null;constructor(e,t,i){this.name=e,this.mediaQueryList=t,this.trueOrFalseKeyword=i??null}getName(){for(let e=0;e<this.name.length;e++){const t=this.name[e];if(t[0]===l.Ident)return t[4].value}return""}getNameToken(){for(let e=0;e<this.name.length;e++){const t=this.name[e];if(t[0]===l.Ident)return t}return null}hasMediaQueryList(){return!!this.mediaQueryList}hasTrueKeyword(){if(!this.trueOrFalseKeyword)return!1;for(let e=0;e<this.trueOrFalseKeyword.length;e++){const t=this.trueOrFalseKeyword[e];if(t[0]!==l.Comment&&t[0]!==l.Whitespace)return t[0]===l.Ident&&"true"===toLowerCaseAZ(t[4].value)}return!1}hasFalseKeyword(){if(!this.trueOrFalseKeyword)return!1;for(let e=0;e<this.trueOrFalseKeyword.length;e++){const t=this.trueOrFalseKeyword[e];if(t[0]!==l.Comment&&t[0]!==l.Whitespace)return t[0]===l.Ident&&"false"===toLowerCaseAZ(t[4].value)}return!1}tokens(){if(this.trueOrFalseKeyword)return[...this.name,...this.trueOrFalseKeyword];if(!this.mediaQueryList)return[...this.name];const e=[];for(let t=0;t<this.mediaQueryList.length;t++){const i=this.mediaQueryList[t];0!==t&&e.push([l.Comma,",",-1,-1,void 0]),e.push(...i.tokens())}return[...this.name,...e]}toString(){return d(...this.tokens())}toJSON(){return{type:this.type,string:this.toString(),nameValue:this.getName(),name:this.name,hasFalseKeyword:this.hasFalseKeyword(),hasTrueKeyword:this.hasTrueKeyword(),trueOrFalseKeyword:this.trueOrFalseKeyword,mediaQueryList:this.mediaQueryList?.map((e=>e.toJSON()))}}isCustomMedia(){return CustomMedia.isCustomMedia(this)}static isCustomMedia(e){return!!e&&(e instanceof CustomMedia&&e.type===c.CustomMedia)}}function parseCustomMediaFromTokens(e,t){let i=[],a=e;for(let t=0;t<e.length;t++)if(e[t][0]!==l.Comment&&e[t][0]!==l.Whitespace){if(e[t][0]===l.Ident){if(e[t][4].value.startsWith("--")){i=e.slice(0,t+1),a=e.slice(t+1);break}}return!1}let n=!0;for(let e=0;e<a.length;e++)if(a[e][0]!==l.Comment&&a[e][0]!==l.Whitespace){if(a[e][0]===l.Ident){const t=toLowerCaseAZ(a[e][4].value);if("false"===t)continue;if("true"===t)continue}if(a[e][0]===l.EOF)break;n=!1}return n?new CustomMedia(i,null,a):new CustomMedia(i,parseFromTokens(f(a),t))}function parseCustomMedia(e,t){const i=m({css:e},{onParseError:t?.onParseError}),a=[];for(;!i.endOfFile();)a.push(i.nextToken());return a.push(i.nextToken()),parseCustomMediaFromTokens(a,t)}function isCustomMedia(e){return CustomMedia.isCustomMedia(e)}function isGeneralEnclosed(e){return GeneralEnclosed.isGeneralEnclosed(e)}function isMediaAnd(e){return MediaAnd.isMediaAnd(e)}function isMediaConditionList(e){return isMediaConditionListWithAnd(e)||isMediaConditionListWithOr(e)}function isMediaConditionListWithAnd(e){return MediaConditionListWithAnd.isMediaConditionListWithAnd(e)}function isMediaConditionListWithOr(e){return MediaConditionListWithOr.isMediaConditionListWithOr(e)}function isMediaCondition(e){return MediaCondition.isMediaCondition(e)}function isMediaFeatureBoolean(e){return MediaFeatureBoolean.isMediaFeatureBoolean(e)}function isMediaFeatureName(e){return MediaFeatureName.isMediaFeatureName(e)}function isMediaFeatureValue(e){return MediaFeatureValue.isMediaFeatureValue(e)}function isMediaFeaturePlain(e){return MediaFeaturePlain.isMediaFeaturePlain(e)}function isMediaFeatureRange(e){return isMediaFeatureRangeNameValue(e)||isMediaFeatureRangeValueName(e)||isMediaFeatureRangeValueNameValue(e)}function isMediaFeatureRangeNameValue(e){return MediaFeatureRangeNameValue.isMediaFeatureRangeNameValue(e)}function isMediaFeatureRangeValueName(e){return MediaFeatureRangeValueName.isMediaFeatureRangeValueName(e)}function isMediaFeatureRangeValueNameValue(e){return MediaFeatureRangeValueNameValue.isMediaFeatureRangeValueNameValue(e)}function isMediaFeature(e){return MediaFeature.isMediaFeature(e)}function isMediaInParens(e){return MediaInParens.isMediaInParens(e)}function isMediaNot(e){return MediaNot.isMediaNot(e)}function isMediaOr(e){return MediaOr.isMediaOr(e)}function isMediaQuery(e){return isMediaQueryWithType(e)||isMediaQueryWithoutType(e)||isMediaQueryInvalid(e)}function isMediaQueryWithType(e){return MediaQueryWithType.isMediaQueryWithType(e)}function isMediaQueryWithoutType(e){return MediaQueryWithoutType.isMediaQueryWithoutType(e)}function isMediaQueryInvalid(e){return MediaQueryInvalid.isMediaQueryInvalid(e)}function cloneMediaQuery(e){const t=f(e.tokens()),i=parseFromTokens(t,{preserveInvalidMediaQueries:!0})[0];if(!i)throw new Error(`Failed to clone media query for : "${d(...t)}"`);if(isMediaQueryInvalid(e)&&isMediaQueryInvalid(i))return i;if(isMediaQueryWithType(e)&&isMediaQueryWithType(i))return i;if(isMediaQueryWithoutType(e)&&isMediaQueryWithoutType(i))return i;throw new Error(`Failed to clone media query for : "${d(...t)}"`)}function typeFromToken(e){if(e[0]!==l.Ident)return!1;switch(toLowerCaseAZ(e[4].value)){case F.All:return F.All;case F.Print:return F.Print;case F.Screen:return F.Screen;case F.Tty:return F.Tty;case F.Tv:return F.Tv;case F.Projection:return F.Projection;case F.Handheld:return F.Handheld;case F.Braille:return F.Braille;case F.Embossed:return F.Embossed;case F.Aural:return F.Aural;case F.Speech:return F.Speech;default:return!1}}!function(e){e.All="all",e.Print="print",e.Screen="screen",e.Tty="tty",e.Tv="tv",e.Projection="projection",e.Handheld="handheld",e.Braille="braille",e.Embossed="embossed",e.Aural="aural",e.Speech="speech"}(F||(F={}));export{CustomMedia,GeneralEnclosed,MediaAnd,MediaCondition,MediaConditionListWithAnd,MediaConditionListWithOr,MediaFeature,MediaFeatureBoolean,g as MediaFeatureEQ,v as MediaFeatureGT,y as MediaFeatureLT,MediaFeatureName,MediaFeaturePlain,MediaFeatureRangeNameValue,MediaFeatureRangeValueName,MediaFeatureRangeValueNameValue,MediaFeatureValue,MediaInParens,MediaNot,MediaOr,MediaQueryInvalid,k as MediaQueryModifier,MediaQueryWithType,MediaQueryWithoutType,F as MediaType,c as NodeType,cloneMediaQuery,comparisonFromTokens,invertComparison,isCustomMedia,isGeneralEnclosed,isMediaAnd,isMediaCondition,isMediaConditionList,isMediaConditionListWithAnd,isMediaConditionListWithOr,isMediaFeature,isMediaFeatureBoolean,isMediaFeatureName,isMediaFeaturePlain,isMediaFeatureRange,isMediaFeatureRangeNameValue,isMediaFeatureRangeValueName,isMediaFeatureRangeValueNameValue,isMediaFeatureValue,isMediaInParens,isMediaNot,isMediaOr,isMediaQuery,isMediaQueryInvalid,isMediaQueryWithType,isMediaQueryWithoutType,matchesComparison,matchesRatio,matchesRatioExactly,modifierFromToken,newMediaFeatureBoolean,newMediaFeaturePlain,parse,parseCustomMedia,parseCustomMediaFromTokens,parseFromTokens,typeFromToken};
+import{walkerIndexGenerator as e,isTokenNode as t,isFunctionNode as i,ComponentValueType as a,TokenNode as n,parseListOfComponentValues as r,isWhitespaceNode as s,isCommentNode as o,isSimpleBlockNode as u,parseCommaSeparatedListOfComponentValues as d}from"@csstools/css-parser-algorithms";import{stringify as l,isTokenIdent as h,TokenType as m,isTokenNumber as f,isTokenDimension as c,isTokenDelim as M,isTokenColon as p,mutateIdent as y,isTokenOpenParen as v,tokenizer as g,isTokenWhiteSpaceOrComment as k,isTokenEOF as F,cloneTokens as N}from"@csstools/css-tokenizer";var w;!function(e){e.CustomMedia="custom-media",e.GeneralEnclosed="general-enclosed",e.MediaAnd="media-and",e.MediaCondition="media-condition",e.MediaConditionListWithAnd="media-condition-list-and",e.MediaConditionListWithOr="media-condition-list-or",e.MediaFeature="media-feature",e.MediaFeatureBoolean="mf-boolean",e.MediaFeatureName="mf-name",e.MediaFeaturePlain="mf-plain",e.MediaFeatureRangeNameValue="mf-range-name-value",e.MediaFeatureRangeValueName="mf-range-value-name",e.MediaFeatureRangeValueNameValue="mf-range-value-name-value",e.MediaFeatureValue="mf-value",e.MediaInParens="media-in-parens",e.MediaNot="media-not",e.MediaOr="media-or",e.MediaQueryWithType="media-query-with-type",e.MediaQueryWithoutType="media-query-without-type",e.MediaQueryInvalid="media-query-invalid"}(w||(w={}));class MediaCondition{type=w.MediaCondition;media;constructor(e){this.media=e}tokens(){return this.media.tokens()}toString(){return this.media.toString()}indexOf(e){return e===this.media?"media":-1}at(e){if("media"===e)return this.media}walk(e,t){let i;return t&&(i={...t}),!1!==e({node:this.media,parent:this,state:i},"media")&&this.media.walk(e,i)}toJSON(){return{type:this.type,media:this.media.toJSON()}}isMediaCondition(){return MediaCondition.isMediaCondition(this)}static isMediaCondition(e){return!!e&&(e instanceof MediaCondition&&e.type===w.MediaCondition)}}class MediaInParens{type=w.MediaInParens;media;before;after;constructor(e,t=[],i=[]){this.media=e,this.before=t,this.after=i}tokens(){return[...this.before,...this.media.tokens(),...this.after]}toString(){return l(...this.before)+this.media.toString()+l(...this.after)}indexOf(e){return e===this.media?"media":-1}at(e){if("media"===e)return this.media}walk(e,t){let i;return t&&(i={...t}),!1!==e({node:this.media,parent:this,state:i},"media")&&("walk"in this.media?this.media.walk(e,i):void 0)}toJSON(){return{type:this.type,media:this.media.toJSON(),before:this.before,after:this.after}}isMediaInParens(){return MediaInParens.isMediaInParens(this)}static isMediaInParens(e){return!!e&&(e instanceof MediaInParens&&e.type===w.MediaInParens)}}class MediaQueryWithType{type=w.MediaQueryWithType;modifier;mediaType;and=void 0;media=void 0;constructor(e,t,i,a){this.modifier=e,this.mediaType=t,i&&a&&(this.and=i,this.media=a)}getModifier(){if(!this.modifier.length)return"";for(let e=0;e<this.modifier.length;e++){const t=this.modifier[e];if(h(t))return t[4].value}return""}negateQuery(){const e=new MediaQueryWithType([...this.modifier],[...this.mediaType],this.and,this.media);if(0===e.modifier.length)return e.modifier=[[m.Ident,"not",-1,-1,{value:"not"}],[m.Whitespace," ",-1,-1,void 0]],e;for(let t=0;t<e.modifier.length;t++){const i=e.modifier[t];if(h(i)&&"not"===i[4].value.toLowerCase()){e.modifier.splice(t,1);break}if(h(i)&&"only"===i[4].value.toLowerCase()){i[1]="not",i[4].value="not";break}}return e}getMediaType(){if(!this.mediaType.length)return"";for(let e=0;e<this.mediaType.length;e++){const t=this.mediaType[e];if(h(t))return t[4].value}return""}tokens(){return this.and&&this.media?[...this.modifier,...this.mediaType,...this.and,...this.media.tokens()]:[...this.modifier,...this.mediaType]}toString(){return this.and&&this.media?l(...this.modifier)+l(...this.mediaType)+l(...this.and)+this.media.toString():l(...this.modifier)+l(...this.mediaType)}indexOf(e){return e===this.media?"media":-1}at(e){if("media"===e)return this.media}walk(e,t){let i;if(t&&(i={...t}),this.media)return!1!==e({node:this.media,parent:this,state:i},"media")&&this.media.walk(e,i)}toJSON(){return{type:this.type,string:this.toString(),modifier:this.modifier,mediaType:this.mediaType,and:this.and,media:this.media}}isMediaQueryWithType(){return MediaQueryWithType.isMediaQueryWithType(this)}static isMediaQueryWithType(e){return!!e&&(e instanceof MediaQueryWithType&&e.type===w.MediaQueryWithType)}}class MediaQueryWithoutType{type=w.MediaQueryWithoutType;media;constructor(e){this.media=e}negateQuery(){let e=this.media;if(e.media.type===w.MediaNot)return new MediaQueryWithoutType(new MediaCondition(e.media.media));e.media.type===w.MediaConditionListWithOr&&(e=new MediaCondition(new MediaInParens(e,[[m.Whitespace," ",0,0,void 0],[m.OpenParen,"(",0,0,void 0]],[[m.CloseParen,")",0,0,void 0]])));return new MediaQueryWithType([[m.Ident,"not",0,0,{value:"not"}],[m.Whitespace," ",0,0,void 0]],[[m.Ident,"all",0,0,{value:"all"}],[m.Whitespace," ",0,0,void 0]],[[m.Ident,"and",0,0,{value:"and"}]],e)}tokens(){return this.media.tokens()}toString(){return this.media.toString()}indexOf(e){return e===this.media?"media":-1}at(e){if("media"===e)return this.media}walk(e,t){let i;return t&&(i={...t}),!1!==e({node:this.media,parent:this,state:i},"media")&&this.media.walk(e,i)}toJSON(){return{type:this.type,string:this.toString(),media:this.media}}isMediaQueryWithoutType(){return MediaQueryWithoutType.isMediaQueryWithoutType(this)}static isMediaQueryWithoutType(e){return!!e&&(e instanceof MediaQueryWithoutType&&e.type===w.MediaQueryWithoutType)}}class MediaQueryInvalid{type=w.MediaQueryInvalid;media;constructor(e){this.media=e}negateQuery(){return new MediaQueryInvalid(this.media)}tokens(){return this.media.flatMap((e=>e.tokens()))}toString(){return this.media.map((e=>e.toString())).join("")}walk(t,i){if(0===this.media.length)return;const a=e(this.media);let n=0;for(;n<this.media.length;){const e=this.media[n];let r;if(i&&(r={...i}),!1===t({node:e,parent:this,state:r},n))return!1;if("walk"in e&&this.media.includes(e)&&!1===e.walk(t,r))return!1;if(n=a(this.media,e,n),-1===n)break}}toJSON(){return{type:this.type,string:this.toString(),media:this.media}}isMediaQueryInvalid(){return MediaQueryInvalid.isMediaQueryInvalid(this)}static isMediaQueryInvalid(e){return!!e&&(e instanceof MediaQueryInvalid&&e.type===w.MediaQueryInvalid)}}class GeneralEnclosed{type=w.GeneralEnclosed;value;constructor(e){this.value=e}tokens(){return this.value.tokens()}toString(){return this.value.toString()}indexOf(e){return e===this.value?"value":-1}at(e){if("value"===e)return this.value}walk(e,t){let i;return t&&(i={...t}),!1!==e({node:this.value,parent:this,state:i},"value")&&("walk"in this.value?this.value.walk(e,i):void 0)}toJSON(){return{type:this.type,tokens:this.tokens()}}isGeneralEnclosed(){return GeneralEnclosed.isGeneralEnclosed(this)}static isGeneralEnclosed(e){return!!e&&(e instanceof GeneralEnclosed&&e.type===w.GeneralEnclosed)}}class MediaAnd{type=w.MediaAnd;modifier;media;constructor(e,t){this.modifier=e,this.media=t}tokens(){return[...this.modifier,...this.media.tokens()]}toString(){return l(...this.modifier)+this.media.toString()}indexOf(e){return e===this.media?"media":-1}at(e){return"media"===e?this.media:null}walk(e,t){let i;return t&&(i={...t}),!1!==e({node:this.media,parent:this,state:i},"media")&&this.media.walk(e,i)}toJSON(){return{type:this.type,modifier:this.modifier,media:this.media.toJSON()}}isMediaAnd(){return MediaAnd.isMediaAnd(this)}static isMediaAnd(e){return!!e&&(e instanceof MediaAnd&&e.type===w.MediaAnd)}}class MediaConditionListWithAnd{type=w.MediaConditionListWithAnd;leading;list;before;after;constructor(e,t,i=[],a=[]){this.leading=e,this.list=t,this.before=i,this.after=a}tokens(){return[...this.before,...this.leading.tokens(),...this.list.flatMap((e=>e.tokens())),...this.after]}toString(){return l(...this.before)+this.leading.toString()+this.list.map((e=>e.toString())).join("")+l(...this.after)}indexOf(e){return e===this.leading?"leading":"media-and"===e.type?this.list.indexOf(e):-1}at(e){return"leading"===e?this.leading:"number"==typeof e?(e<0&&(e=this.list.length+e),this.list[e]):void 0}walk(t,i){let a;if(i&&(a={...i}),!1===t({node:this.leading,parent:this,state:a},"leading"))return!1;if("walk"in this.leading&&!1===this.leading.walk(t,a))return!1;if(0===this.list.length)return;const n=e(this.list);let r=0;for(;r<this.list.length;){const e=this.list[r];if(i&&(a={...i}),!1===t({node:e,parent:this,state:a},r))return!1;if("walk"in e&&this.list.includes(e)&&!1===e.walk(t,a))return!1;if(r=n(this.list,e,r),-1===r)break}}toJSON(){return{type:this.type,leading:this.leading.toJSON(),list:this.list.map((e=>e.toJSON())),before:this.before,after:this.after}}isMediaConditionListWithAnd(){return MediaConditionListWithAnd.isMediaConditionListWithAnd(this)}static isMediaConditionListWithAnd(e){return!!e&&(e instanceof MediaConditionListWithAnd&&e.type===w.MediaConditionListWithAnd)}}class MediaConditionListWithOr{type=w.MediaConditionListWithOr;leading;list;before;after;constructor(e,t,i=[],a=[]){this.leading=e,this.list=t,this.before=i,this.after=a}tokens(){return[...this.before,...this.leading.tokens(),...this.list.flatMap((e=>e.tokens())),...this.after]}toString(){return l(...this.before)+this.leading.toString()+this.list.map((e=>e.toString())).join("")+l(...this.after)}indexOf(e){return e===this.leading?"leading":"media-or"===e.type?this.list.indexOf(e):-1}at(e){return"leading"===e?this.leading:"number"==typeof e?(e<0&&(e=this.list.length+e),this.list[e]):void 0}walk(t,i){let a;if(i&&(a={...i}),!1===t({node:this.leading,parent:this,state:a},"leading"))return!1;if("walk"in this.leading&&!1===this.leading.walk(t,a))return!1;if(0===this.list.length)return;const n=e(this.list);let r=0;for(;r<this.list.length;){const e=this.list[r];if(i&&(a={...i}),!1===t({node:e,parent:this,state:a},r))return!1;if("walk"in e&&this.list.includes(e)&&!1===e.walk(t,a))return!1;if(r=n(this.list,e,r),-1===r)break}}toJSON(){return{type:this.type,leading:this.leading.toJSON(),list:this.list.map((e=>e.toJSON())),before:this.before,after:this.after}}isMediaConditionListWithOr(){return MediaConditionListWithOr.isMediaConditionListWithOr(this)}static isMediaConditionListWithOr(e){return!!e&&(e instanceof MediaConditionListWithOr&&e.type===w.MediaConditionListWithOr)}}function isNumber(e){return!!(t(e)&&f(e.value)||i(e)&&O.has(e.getName().toLowerCase()))}const O=new Set(["abs","acos","asin","atan","atan2","calc","clamp","cos","exp","hypot","log","max","min","mod","pow","rem","round","sign","sin","sqrt","tan"]);function isDimension(e){return t(e)&&c(e.value)}function isIdent(e){return t(e)&&h(e.value)}function isEnvironmentVariable(e){return i(e)&&"env"===e.getName().toLowerCase()}class MediaFeatureName{type=w.MediaFeatureName;name;before;after;constructor(e,t=[],i=[]){this.name=e,this.before=t,this.after=i}getName(){return this.name.value[4].value}getNameToken(){return this.name.value}tokens(){return[...this.before,...this.name.tokens(),...this.after]}toString(){return l(...this.before)+this.name.toString()+l(...this.after)}indexOf(e){return e===this.name?"name":-1}at(e){if("name"===e)return this.name}toJSON(){return{type:this.type,name:this.getName(),tokens:this.tokens()}}isMediaFeatureName(){return MediaFeatureName.isMediaFeatureName(this)}static isMediaFeatureName(e){return!!e&&(e instanceof MediaFeatureName&&e.type===w.MediaFeatureName)}}function parseMediaFeatureName(e){let t=-1;for(let i=0;i<e.length;i++){const n=e[i];if(n.type!==a.Whitespace&&n.type!==a.Comment){if(!isIdent(n))return!1;if(-1!==t)return!1;t=i}}return-1!==t&&new MediaFeatureName(e[t],e.slice(0,t).flatMap((e=>e.tokens())),e.slice(t+1).flatMap((e=>e.tokens())))}class MediaFeatureBoolean{type=w.MediaFeatureBoolean;name;constructor(e){this.name=e}getName(){return this.name.getName()}getNameToken(){return this.name.getNameToken()}tokens(){return this.name.tokens()}toString(){return this.name.toString()}indexOf(e){return e===this.name?"name":-1}at(e){if("name"===e)return this.name}toJSON(){return{type:this.type,name:this.name.toJSON(),tokens:this.tokens()}}isMediaFeatureBoolean(){return MediaFeatureBoolean.isMediaFeatureBoolean(this)}static isMediaFeatureBoolean(e){return!!e&&(e instanceof MediaFeatureBoolean&&e.type===w.MediaFeatureBoolean)}}function parseMediaFeatureBoolean(e){const t=parseMediaFeatureName(e);return!1===t?t:new MediaFeatureBoolean(t)}class MediaFeatureValue{type=w.MediaFeatureValue;value;before;after;constructor(e,t=[],i=[]){Array.isArray(e)&&1===e.length?this.value=e[0]:this.value=e,this.before=t,this.after=i}tokens(){return Array.isArray(this.value)?[...this.before,...this.value.flatMap((e=>e.tokens())),...this.after]:[...this.before,...this.value.tokens(),...this.after]}toString(){return Array.isArray(this.value)?l(...this.before)+this.value.map((e=>e.toString())).join("")+l(...this.after):l(...this.before)+this.value.toString()+l(...this.after)}indexOf(e){return e===this.value?"value":-1}at(e){return"value"===e?this.value:Array.isArray(this.value)&&"number"==typeof e?(e<0&&(e=this.value.length+e),this.value[e]):void 0}walk(t,i){if(Array.isArray(this.value)){if(0===this.value.length)return;const a=e(this.value);let n=0;for(;n<this.value.length;){const e=this.value[n];let r;if(i&&(r={...i}),!1===t({node:e,parent:this,state:r},n))return!1;if("walk"in e&&this.value.includes(e)&&!1===e.walk(t,r))return!1;if(n=a(this.value,e,n),-1===n)break}}else{let e;if(i&&(e={...i}),!1===t({node:this.value,parent:this,state:e},"value"))return!1;if("walk"in this.value)return this.value.walk(t,e)}}toJSON(){return Array.isArray(this.value)?{type:this.type,value:this.value.map((e=>e.toJSON())),tokens:this.tokens()}:{type:this.type,value:this.value.toJSON(),tokens:this.tokens()}}isMediaFeatureValue(){return MediaFeatureValue.isMediaFeatureValue(this)}static isMediaFeatureValue(e){return!!e&&(e instanceof MediaFeatureValue&&e.type===w.MediaFeatureValue)}}function parseMediaFeatureValue(e,t=!1){let i=-1,n=-1;for(let r=0;r<e.length;r++){const s=e[r];if(s.type!==a.Whitespace&&s.type!==a.Comment){if(-1!==i)return!1;if(isNumber(s)){const t=matchesRatioExactly(e.slice(r));if(-1!==t){i=t[0]+r,n=t[1]+r,r+=t[1]-t[0];continue}i=r,n=r}else if(isEnvironmentVariable(s))i=r,n=r;else if(isDimension(s))i=r,n=r;else{if(t||!isIdent(s))return!1;i=r,n=r}}}return-1!==i&&new MediaFeatureValue(e.slice(i,n+1),e.slice(0,i).flatMap((e=>e.tokens())),e.slice(n+1).flatMap((e=>e.tokens())))}function matchesRatioExactly(e){let t=-1,i=-1;const a=matchesRatio(e);if(-1===a)return-1;t=a[0],i=a[1];for(let t=i+1;t<e.length;t++){const i=e[t];if("whitespace"!==i.type&&"comment"!==i.type)return-1}return[t,i]}function matchesRatio(e){let t=-1,i=-1;for(let a=0;a<e.length;a++){const n=e[a];if("whitespace"!==n.type&&"comment"!==n.type){if("token"===n.type){const e=n.value;if(M(e)&&"/"===e[4].value){if(-1===t)return-1;if(-1!==i)return-1;i=a;continue}}if(!isNumber(n))return-1;if(-1!==i)return[t,a];if(-1!==t)return-1;t=a}}return-1}class MediaFeaturePlain{type=w.MediaFeaturePlain;name;colon;value;constructor(e,t,i){this.name=e,this.colon=t,this.value=i}getName(){return this.name.getName()}getNameToken(){return this.name.getNameToken()}tokens(){return[...this.name.tokens(),this.colon,...this.value.tokens()]}toString(){return this.name.toString()+l(this.colon)+this.value.toString()}indexOf(e){return e===this.name?"name":e===this.value?"value":-1}at(e){return"name"===e?this.name:"value"===e?this.value:void 0}walk(e,t){let i;return t&&(i={...t}),!1!==e({node:this.value,parent:this,state:i},"value")&&this.value.walk(e,i)}toJSON(){return{type:this.type,name:this.name.toJSON(),value:this.value.toJSON(),tokens:this.tokens()}}isMediaFeaturePlain(){return MediaFeaturePlain.isMediaFeaturePlain(this)}static isMediaFeaturePlain(e){return!!e&&(e instanceof MediaFeaturePlain&&e.type===w.MediaFeaturePlain)}}function parseMediaFeaturePlain(e){let t=[],i=[],n=null;for(let r=0;r<e.length;r++){const s=e[r];if(s.type===a.Token){const a=s.value;if(p(a)){t=e.slice(0,r),i=e.slice(r+1),n=a;break}}}if(!t.length||!i.length||!n)return!1;const r=parseMediaFeatureName(t);if(!1===r)return!1;const s=parseMediaFeatureValue(i);return!1!==s&&new MediaFeaturePlain(r,n,s)}var T,C,S,Q;function matchesComparison(e){let t=-1;for(let i=0;i<e.length;i++){const n=e[i];if(n.type===a.Token){const e=n.value;if(M(e)){if(e[4].value===S.EQ)return-1!==t?[t,i]:[i,i];if(e[4].value===T.LT){t=i;continue}if(e[4].value===C.GT){t=i;continue}}}break}return-1!==t&&[t,t]}function comparisonFromTokens(e){if(0===e.length||e.length>2)return!1;if(!M(e[0]))return!1;if(1===e.length)switch(e[0][4].value){case S.EQ:return S.EQ;case T.LT:return T.LT;case C.GT:return C.GT;default:return!1}if(!M(e[1]))return!1;if(e[1][4].value!==S.EQ)return!1;switch(e[0][4].value){case T.LT:return T.LT_OR_EQ;case C.GT:return C.GT_OR_EQ;default:return!1}}function invertComparison(e){switch(e){case S.EQ:return S.EQ;case T.LT:return C.GT;case T.LT_OR_EQ:return C.GT_OR_EQ;case C.GT:return T.LT;case C.GT_OR_EQ:return T.LT_OR_EQ;default:return!1}}!function(e){e.LT="<",e.LT_OR_EQ="<="}(T||(T={})),function(e){e.GT=">",e.GT_OR_EQ=">="}(C||(C={})),function(e){e.EQ="="}(S||(S={}));class MediaFeatureRangeNameValue{type=w.MediaFeatureRangeNameValue;name;operator;value;constructor(e,t,i){this.name=e,this.operator=t,this.value=i}operatorKind(){return comparisonFromTokens(this.operator)}getName(){return this.name.getName()}getNameToken(){return this.name.getNameToken()}tokens(){return[...this.name.tokens(),...this.operator,...this.value.tokens()]}toString(){return this.name.toString()+l(...this.operator)+this.value.toString()}indexOf(e){return e===this.name?"name":e===this.value?"value":-1}at(e){return"name"===e?this.name:"value"===e?this.value:void 0}walk(e,t){let i;return t&&(i={...t}),!1!==e({node:this.value,parent:this,state:i},"value")&&("walk"in this.value?this.value.walk(e,i):void 0)}toJSON(){return{type:this.type,name:this.name.toJSON(),value:this.value.toJSON(),tokens:this.tokens()}}isMediaFeatureRangeNameValue(){return MediaFeatureRangeNameValue.isMediaFeatureRangeNameValue(this)}static isMediaFeatureRangeNameValue(e){return!!e&&(e instanceof MediaFeatureRangeNameValue&&e.type===w.MediaFeatureRangeNameValue)}}class MediaFeatureRangeValueName{type=w.MediaFeatureRangeValueName;name;operator;value;constructor(e,t,i){this.name=e,this.operator=t,this.value=i}operatorKind(){return comparisonFromTokens(this.operator)}getName(){return this.name.getName()}getNameToken(){return this.name.getNameToken()}tokens(){return[...this.value.tokens(),...this.operator,...this.name.tokens()]}toString(){return this.value.toString()+l(...this.operator)+this.name.toString()}indexOf(e){return e===this.name?"name":e===this.value?"value":-1}at(e){return"name"===e?this.name:"value"===e?this.value:void 0}walk(e,t){let i;return t&&(i={...t}),!1!==e({node:this.value,parent:this,state:i},"value")&&("walk"in this.value?this.value.walk(e,i):void 0)}toJSON(){return{type:this.type,name:this.name.toJSON(),value:this.value.toJSON(),tokens:this.tokens()}}isMediaFeatureRangeValueName(){return MediaFeatureRangeValueName.isMediaFeatureRangeValueName(this)}static isMediaFeatureRangeValueName(e){return!!e&&(e instanceof MediaFeatureRangeValueName&&e.type===w.MediaFeatureRangeValueName)}}class MediaFeatureRangeValueNameValue{type=w.MediaFeatureRangeValueNameValue;name;valueOne;valueOneOperator;valueTwo;valueTwoOperator;constructor(e,t,i,a,n){this.name=e,this.valueOne=t,this.valueOneOperator=i,this.valueTwo=a,this.valueTwoOperator=n}valueOneOperatorKind(){return comparisonFromTokens(this.valueOneOperator)}valueTwoOperatorKind(){return comparisonFromTokens(this.valueTwoOperator)}getName(){return this.name.getName()}getNameToken(){return this.name.getNameToken()}tokens(){return[...this.valueOne.tokens(),...this.valueOneOperator,...this.name.tokens(),...this.valueTwoOperator,...this.valueTwo.tokens()]}toString(){return this.valueOne.toString()+l(...this.valueOneOperator)+this.name.toString()+l(...this.valueTwoOperator)+this.valueTwo.toString()}indexOf(e){return e===this.name?"name":e===this.valueOne?"valueOne":e===this.valueTwo?"valueTwo":-1}at(e){return"name"===e?this.name:"valueOne"===e?this.valueOne:"valueTwo"===e?this.valueTwo:void 0}walk(e,t){let i;return t&&(i={...t}),!1!==e({node:this.valueOne,parent:this,state:i},"valueOne")&&((!("walk"in this.valueOne)||!1!==this.valueOne.walk(e,i))&&(t&&(i={...t}),!1!==e({node:this.valueTwo,parent:this,state:i},"valueTwo")&&((!("walk"in this.valueTwo)||!1!==this.valueTwo.walk(e,i))&&void 0)))}toJSON(){return{type:this.type,name:this.name.toJSON(),valueOne:this.valueOne.toJSON(),valueTwo:this.valueTwo.toJSON(),tokens:this.tokens()}}isMediaFeatureRangeValueNameValue(){return MediaFeatureRangeValueNameValue.isMediaFeatureRangeValueNameValue(this)}static isMediaFeatureRangeValueNameValue(e){return!!e&&(e instanceof MediaFeatureRangeValueNameValue&&e.type===w.MediaFeatureRangeValueNameValue)}}function parseMediaFeatureRange(e){let t=!1,i=!1;for(let n=0;n<e.length;n++){const r=e[n];if(r.type===a.Token){const a=r.value;if(M(a)){const a=matchesComparison(e.slice(n));if(!1!==a){if(!1!==t){i=[a[0]+n,a[1]+n];break}t=[a[0]+n,a[1]+n],n+=a[1]}}}}if(!1===t)return!1;const n=[e[t[0]].value];if(t[0]!==t[1]&&n.push(e[t[1]].value),!1===i){const i=e.slice(0,t[0]),a=e.slice(t[1]+1),r=parseMediaFeatureName(i);if(r){const e=parseMediaFeatureValue(a,!0);return!!e&&new MediaFeatureRangeNameValue(r,n,e)}const s=parseMediaFeatureName(a);if(s){const e=parseMediaFeatureValue(i,!0);return!!e&&new MediaFeatureRangeValueName(s,n,e)}return!1}const r=[e[i[0]].value];i[0]!==i[1]&&r.push(e[i[1]].value);const s=e.slice(0,t[0]),o=e.slice(t[1]+1,i[0]),u=e.slice(i[1]+1),d=parseMediaFeatureValue(s,!0),l=parseMediaFeatureName(o),h=parseMediaFeatureValue(u,!0);if(!d||!l||!h)return!1;{const e=comparisonFromTokens(n);if(!1===e||e===S.EQ)return!1;const t=comparisonFromTokens(r);if(!1===t||t===S.EQ)return!1;if(!(e!==T.LT&&e!==T.LT_OR_EQ||t!==C.GT&&t!==C.GT_OR_EQ))return!1;if(!(e!==C.GT&&e!==C.GT_OR_EQ||t!==T.LT&&t!==T.LT_OR_EQ))return!1}return new MediaFeatureRangeValueNameValue(l,d,n,h,r)}class MediaFeature{type=w.MediaFeature;feature;before;after;constructor(e,t=[],i=[]){this.feature=e,this.before=t,this.after=i}getName(){return this.feature.getName()}getNameToken(){return this.feature.getNameToken()}tokens(){return[...this.before,...this.feature.tokens(),...this.after]}toString(){return l(...this.before)+this.feature.toString()+l(...this.after)}indexOf(e){return e===this.feature?"feature":-1}at(e){if("feature"===e)return this.feature}walk(e,t){let i;return t&&(i={...t}),!1!==e({node:this.feature,parent:this,state:i},"feature")&&("walk"in this.feature?this.feature.walk(e,i):void 0)}toJSON(){return{type:this.type,feature:this.feature.toJSON(),before:this.before,after:this.after}}isMediaFeature(){return MediaFeature.isMediaFeature(this)}static isMediaFeature(e){return!!e&&(e instanceof MediaFeature&&e.type===w.MediaFeature)}}function parseMediaFeature(e,t=[],i=[]){if(!v(e.startToken))return!1;const a=parseMediaFeatureBoolean(e.value);if(!1!==a)return new MediaFeature(a,t,i);const n=parseMediaFeaturePlain(e.value);if(!1!==n)return new MediaFeature(n,t,i);const r=parseMediaFeatureRange(e.value);return!1!==r&&new MediaFeature(r,t,i)}function newMediaFeatureBoolean(e){const t=[m.Ident,"",-1,-1,{value:""}];return y(t,e),new MediaFeature(new MediaFeatureBoolean(new MediaFeatureName(new n(t))),[[m.OpenParen,"(",-1,-1,void 0]],[[m.CloseParen,")",-1,-1,void 0]])}function newMediaFeaturePlain(e,...t){const i=[m.Ident,"",-1,-1,{value:""}];y(i,e);const a=r(t);return new MediaFeature(new MediaFeaturePlain(new MediaFeatureName(new n(i)),[m.Colon,":",-1,-1,void 0],new MediaFeatureValue(1===a.length?a[0]:a)),[[m.OpenParen,"(",-1,-1,void 0]],[[m.CloseParen,")",-1,-1,void 0]])}class MediaNot{type=w.MediaNot;modifier;media;constructor(e,t){this.modifier=e,this.media=t}tokens(){return[...this.modifier,...this.media.tokens()]}toString(){return l(...this.modifier)+this.media.toString()}indexOf(e){return e===this.media?"media":-1}at(e){if("media"===e)return this.media}walk(e,t){let i;return t&&(i={...t}),!1!==e({node:this.media,parent:this,state:i},"media")&&this.media.walk(e,i)}toJSON(){return{type:this.type,modifier:this.modifier,media:this.media.toJSON()}}isMediaNot(){return MediaNot.isMediaNot(this)}static isMediaNot(e){return!!e&&(e instanceof MediaNot&&e.type===w.MediaNot)}}class MediaOr{type=w.MediaOr;modifier;media;constructor(e,t){this.modifier=e,this.media=t}tokens(){return[...this.modifier,...this.media.tokens()]}toString(){return l(...this.modifier)+this.media.toString()}indexOf(e){return e===this.media?"media":-1}at(e){if("media"===e)return this.media}walk(e,t){let i;return t&&(i={...t}),!1!==e({node:this.media,parent:this,state:i},"media")&&this.media.walk(e,i)}toJSON(){return{type:this.type,modifier:this.modifier,media:this.media.toJSON()}}isMediaOr(){return MediaOr.isMediaOr(this)}static isMediaOr(e){return!!e&&(e instanceof MediaOr&&e.type===w.MediaOr)}}function modifierFromToken(e){if(!h(e))return!1;switch(e[4].value.toLowerCase()){case Q.Not:return Q.Not;case Q.Only:return Q.Only;default:return!1}}function parseMediaQuery(e){{const t=parseMediaCondition(e);if(!1!==t)return new MediaQueryWithoutType(t)}{let i=-1,a=-1,n=-1;for(let r=0;r<e.length;r++){const u=e[r];if(!s(u)&&!o(u)){if(t(u)){const t=u.value;if(-1===i&&h(t)&&modifierFromToken(t)){i=r;continue}if(-1===a&&h(t)&&!modifierFromToken(t)){a=r;continue}if(-1===n&&h(t)&&L.test(t[4].value)){n=r;if(!1===parseMediaConditionWithoutOr(e.slice(r+1)))return!1;break}return!1}return!1}}let r=[],u=[];-1!==i?(r=e.slice(0,i+1).flatMap((e=>e.tokens())),-1!==a&&(u=e.slice(i+1,a+1).flatMap((e=>e.tokens())))):-1!==a&&(u=e.slice(0,a+1).flatMap((e=>e.tokens())));const d=parseMediaConditionWithoutOr(e.slice(Math.max(i,a,n)+1));return!1===d?new MediaQueryWithType(r,[...u,...e.slice(a+1).flatMap((e=>e.tokens()))]):new MediaQueryWithType(r,u,e.slice(a+1,n+1).flatMap((e=>e.tokens())),d)}}function parseMediaConditionListWithOr(e){let t=!1;const i=[];let n=-1,r=-1;for(let s=0;s<e.length;s++){if(t){const t=parseMediaOr(e.slice(s));if(!1!==t){s+=t.advance,i.push(t.node),r=s;continue}}const o=e[s];if(o.type!==a.Whitespace&&o.type!==a.Comment){if(t)return!1;if(!1!==t||!u(o))return!1;if(o.normalize(),t=parseMediaInParensFromSimpleBlock(o),!1===t)return!1;n=s}}return!(!t||!i.length)&&new MediaConditionListWithOr(t,i,e.slice(0,n).flatMap((e=>e.tokens())),e.slice(r+1).flatMap((e=>e.tokens())))}function parseMediaConditionListWithAnd(e){let t=!1;const i=[];let n=-1,r=-1;for(let s=0;s<e.length;s++){if(t){const t=parseMediaAnd(e.slice(s));if(!1!==t){s+=t.advance,i.push(t.node),r=s;continue}}const o=e[s];if(o.type!==a.Whitespace&&o.type!==a.Comment){if(t)return!1;if(!1!==t||!u(o))return!1;if(o.normalize(),t=parseMediaInParensFromSimpleBlock(o),!1===t)return!1;n=s}}return!(!t||!i.length)&&new MediaConditionListWithAnd(t,i,e.slice(0,n).flatMap((e=>e.tokens())),e.slice(r+1).flatMap((e=>e.tokens())))}function parseMediaCondition(e){const t=parseMediaNot(e);if(!1!==t)return new MediaCondition(t);const i=parseMediaConditionListWithAnd(e);if(!1!==i)return new MediaCondition(i);const a=parseMediaConditionListWithOr(e);if(!1!==a)return new MediaCondition(a);const n=parseMediaInParens(e);return!1!==n&&new MediaCondition(n)}function parseMediaConditionWithoutOr(e){const t=parseMediaNot(e);if(!1!==t)return new MediaCondition(t);const i=parseMediaConditionListWithAnd(e);if(!1!==i)return new MediaCondition(i);const a=parseMediaInParens(e);return!1!==a&&new MediaCondition(a)}function parseMediaInParens(e){let t=-1;for(let i=0;i<e.length;i++){const n=e[i];if(n.type!==a.Whitespace&&n.type!==a.Comment){if(!u(n))return!1;if(-1!==t)return!1;t=i}}if(-1===t)return!1;const i=e[t];if(!v(i.startToken))return!1;i.normalize();const n=[...e.slice(0,t).flatMap((e=>e.tokens())),i.startToken],r=[i.endToken,...e.slice(t+1).flatMap((e=>e.tokens()))],s=parseMediaFeature(i,n,r);if(!1!==s)return new MediaInParens(s);const o=parseMediaCondition(i.value);return!1!==o?new MediaInParens(o,n,r):new MediaInParens(new GeneralEnclosed(i),e.slice(0,t).flatMap((e=>e.tokens())),e.slice(t+1).flatMap((e=>e.tokens())))}function parseMediaInParensFromSimpleBlock(e){if(!v(e.startToken))return!1;const t=parseMediaFeature(e,[e.startToken],[e.endToken]);if(!1!==t)return new MediaInParens(t);const i=parseMediaCondition(e.value);return!1!==i?new MediaInParens(i,[e.startToken],[e.endToken]):new MediaInParens(new GeneralEnclosed(e))}!function(e){e.Not="not",e.Only="only"}(Q||(Q={}));const W=/^not$/i;function parseMediaNot(e){let t=!1,i=null;for(let n=0;n<e.length;n++){const r=e[n];if(r.type!==a.Whitespace&&r.type!==a.Comment){if(isIdent(r)){const e=r.value;if(W.test(e[4].value)){if(t)return!1;t=!0;continue}return!1}if(!t||!u(r))return!1;{r.normalize();const t=parseMediaInParensFromSimpleBlock(r);if(!1===t)return!1;i=new MediaNot(e.slice(0,n).flatMap((e=>e.tokens())),t)}}}return i||!1}const V=/^or$/i;function parseMediaOr(e){let t=!1;for(let i=0;i<e.length;i++){const n=e[i];if(n.type!==a.Whitespace&&n.type!==a.Comment){if(isIdent(n)){const e=n.value;if(V.test(e[4].value)){if(t)return!1;t=!0;continue}return!1}if(t&&u(n)){n.normalize();const t=parseMediaInParensFromSimpleBlock(n);return!1!==t&&{advance:i,node:new MediaOr(e.slice(0,i).flatMap((e=>e.tokens())),t)}}return!1}}return!1}const L=/^and$/i;function parseMediaAnd(e){let t=!1;for(let i=0;i<e.length;i++){const n=e[i];if(n.type!==a.Whitespace&&n.type!==a.Comment){if(isIdent(n)){const e=n.value;if(L.test(e[4].value)){if(t)return!1;t=!0;continue}return!1}if(t&&u(n)){n.normalize();const t=parseMediaInParensFromSimpleBlock(n);return!1!==t&&{advance:i,node:new MediaAnd(e.slice(0,i).flatMap((e=>e.tokens())),t)}}return!1}}return!1}function parseFromTokens(e,t){const i=d(e,{onParseError:t?.onParseError});return i.map(((e,a)=>{const n=parseMediaQuery(e);return!1===n&&!0===t?.preserveInvalidMediaQueries?new MediaQueryInvalid(i[a]):n})).filter((e=>!!e))}function parse(e,t){const i=g({css:e},{onParseError:t?.onParseError}),a=[];for(;!i.endOfFile();)a.push(i.nextToken());return a.push(i.nextToken()),parseFromTokens(a,t)}class CustomMedia{type=w.CustomMedia;name;mediaQueryList=null;trueOrFalseKeyword=null;constructor(e,t,i){this.name=e,this.mediaQueryList=t,this.trueOrFalseKeyword=i??null}getName(){for(let e=0;e<this.name.length;e++){const t=this.name[e];if(h(t))return t[4].value}return""}getNameToken(){for(let e=0;e<this.name.length;e++){const t=this.name[e];if(h(t))return t}return null}hasMediaQueryList(){return!!this.mediaQueryList}hasTrueKeyword(){if(!this.trueOrFalseKeyword)return!1;for(let e=0;e<this.trueOrFalseKeyword.length;e++){const t=this.trueOrFalseKeyword[e];if(!k(t))return!!h(t)&&"true"===t[4].value.toLowerCase()}return!1}hasFalseKeyword(){if(!this.trueOrFalseKeyword)return!1;for(let e=0;e<this.trueOrFalseKeyword.length;e++){const t=this.trueOrFalseKeyword[e];if(!k(t))return!!h(t)&&"false"===t[4].value.toLowerCase()}return!1}tokens(){if(this.trueOrFalseKeyword)return[...this.name,...this.trueOrFalseKeyword];if(!this.mediaQueryList)return[...this.name];const e=[];for(let t=0;t<this.mediaQueryList.length;t++){const i=this.mediaQueryList[t];0!==t&&e.push([m.Comma,",",-1,-1,void 0]),e.push(...i.tokens())}return[...this.name,...e]}toString(){return l(...this.tokens())}toJSON(){return{type:this.type,string:this.toString(),nameValue:this.getName(),name:this.name,hasFalseKeyword:this.hasFalseKeyword(),hasTrueKeyword:this.hasTrueKeyword(),trueOrFalseKeyword:this.trueOrFalseKeyword,mediaQueryList:this.mediaQueryList?.map((e=>e.toJSON()))}}isCustomMedia(){return CustomMedia.isCustomMedia(this)}static isCustomMedia(e){return!!e&&(e instanceof CustomMedia&&e.type===w.CustomMedia)}}function parseCustomMediaFromTokens(e,t){let i=[],a=e;for(let t=0;t<e.length;t++)if(!k(e[t])){if(h(e[t])){if(e[t][4].value.startsWith("--")){i=e.slice(0,t+1),a=e.slice(t+1);break}}return!1}let n=!0;for(let e=0;e<a.length;e++)if(!k(a[e])){if(h(a[e])){const t=a[e][4].value.toLowerCase();if("false"===t)continue;if("true"===t)continue}if(F(a[e]))break;n=!1}return n?new CustomMedia(i,null,a):new CustomMedia(i,parseFromTokens(N(a),t))}function parseCustomMedia(e,t){const i=g({css:e},{onParseError:t?.onParseError}),a=[];for(;!i.endOfFile();)a.push(i.nextToken());return a.push(i.nextToken()),parseCustomMediaFromTokens(a,t)}function isCustomMedia(e){return CustomMedia.isCustomMedia(e)}function isGeneralEnclosed(e){return GeneralEnclosed.isGeneralEnclosed(e)}function isMediaAnd(e){return MediaAnd.isMediaAnd(e)}function isMediaConditionList(e){return isMediaConditionListWithAnd(e)||isMediaConditionListWithOr(e)}function isMediaConditionListWithAnd(e){return MediaConditionListWithAnd.isMediaConditionListWithAnd(e)}function isMediaConditionListWithOr(e){return MediaConditionListWithOr.isMediaConditionListWithOr(e)}function isMediaCondition(e){return MediaCondition.isMediaCondition(e)}function isMediaFeatureBoolean(e){return MediaFeatureBoolean.isMediaFeatureBoolean(e)}function isMediaFeatureName(e){return MediaFeatureName.isMediaFeatureName(e)}function isMediaFeatureValue(e){return MediaFeatureValue.isMediaFeatureValue(e)}function isMediaFeaturePlain(e){return MediaFeaturePlain.isMediaFeaturePlain(e)}function isMediaFeatureRange(e){return isMediaFeatureRangeNameValue(e)||isMediaFeatureRangeValueName(e)||isMediaFeatureRangeValueNameValue(e)}function isMediaFeatureRangeNameValue(e){return MediaFeatureRangeNameValue.isMediaFeatureRangeNameValue(e)}function isMediaFeatureRangeValueName(e){return MediaFeatureRangeValueName.isMediaFeatureRangeValueName(e)}function isMediaFeatureRangeValueNameValue(e){return MediaFeatureRangeValueNameValue.isMediaFeatureRangeValueNameValue(e)}function isMediaFeature(e){return MediaFeature.isMediaFeature(e)}function isMediaInParens(e){return MediaInParens.isMediaInParens(e)}function isMediaNot(e){return MediaNot.isMediaNot(e)}function isMediaOr(e){return MediaOr.isMediaOr(e)}function isMediaQuery(e){return isMediaQueryWithType(e)||isMediaQueryWithoutType(e)||isMediaQueryInvalid(e)}function isMediaQueryWithType(e){return MediaQueryWithType.isMediaQueryWithType(e)}function isMediaQueryWithoutType(e){return MediaQueryWithoutType.isMediaQueryWithoutType(e)}function isMediaQueryInvalid(e){return MediaQueryInvalid.isMediaQueryInvalid(e)}function cloneMediaQuery(e){const t=N(e.tokens()),i=parseFromTokens(t,{preserveInvalidMediaQueries:!0})[0];if(!i)throw new Error(`Failed to clone media query for : "${l(...t)}"`);if(isMediaQueryInvalid(e)&&isMediaQueryInvalid(i))return i;if(isMediaQueryWithType(e)&&isMediaQueryWithType(i))return i;if(isMediaQueryWithoutType(e)&&isMediaQueryWithoutType(i))return i;throw new Error(`Failed to clone media query for : "${l(...t)}"`)}var R;function typeFromToken(e){if(!h(e))return!1;switch(e[4].value.toLowerCase()){case R.All:return R.All;case R.Print:return R.Print;case R.Screen:return R.Screen;case R.Tty:return R.Tty;case R.Tv:return R.Tv;case R.Projection:return R.Projection;case R.Handheld:return R.Handheld;case R.Braille:return R.Braille;case R.Embossed:return R.Embossed;case R.Aural:return R.Aural;case R.Speech:return R.Speech;default:return!1}}!function(e){e.All="all",e.Print="print",e.Screen="screen",e.Tty="tty",e.Tv="tv",e.Projection="projection",e.Handheld="handheld",e.Braille="braille",e.Embossed="embossed",e.Aural="aural",e.Speech="speech"}(R||(R={}));export{CustomMedia,GeneralEnclosed,MediaAnd,MediaCondition,MediaConditionListWithAnd,MediaConditionListWithOr,MediaFeature,MediaFeatureBoolean,S as MediaFeatureEQ,C as MediaFeatureGT,T as MediaFeatureLT,MediaFeatureName,MediaFeaturePlain,MediaFeatureRangeNameValue,MediaFeatureRangeValueName,MediaFeatureRangeValueNameValue,MediaFeatureValue,MediaInParens,MediaNot,MediaOr,MediaQueryInvalid,Q as MediaQueryModifier,MediaQueryWithType,MediaQueryWithoutType,R as MediaType,w as NodeType,cloneMediaQuery,comparisonFromTokens,invertComparison,isCustomMedia,isGeneralEnclosed,isMediaAnd,isMediaCondition,isMediaConditionList,isMediaConditionListWithAnd,isMediaConditionListWithOr,isMediaFeature,isMediaFeatureBoolean,isMediaFeatureName,isMediaFeaturePlain,isMediaFeatureRange,isMediaFeatureRangeNameValue,isMediaFeatureRangeValueName,isMediaFeatureRangeValueNameValue,isMediaFeatureValue,isMediaInParens,isMediaNot,isMediaOr,isMediaQuery,isMediaQueryInvalid,isMediaQueryWithType,isMediaQueryWithoutType,matchesComparison,matchesRatio,matchesRatioExactly,modifierFromToken,newMediaFeatureBoolean,newMediaFeaturePlain,parse,parseCustomMedia,parseCustomMediaFromTokens,parseFromTokens,typeFromToken};
diff --git a/node_modules/@csstools/media-query-list-parser/package.json b/node_modules/@csstools/media-query-list-parser/package.json
index 7e08ead0..140fdb93 100644
--- a/node_modules/@csstools/media-query-list-parser/package.json
+++ b/node_modules/@csstools/media-query-list-parser/package.json
@@ -1,7 +1,7 @@
{
"name": "@csstools/media-query-list-parser",
"description": "Parse CSS media query lists.",
- "version": "2.1.7",
+ "version": "2.1.11",
"contributors": [
{
"name": "Antonio Laguna",
@@ -48,13 +48,13 @@
"dist"
],
"peerDependencies": {
- "@csstools/css-parser-algorithms": "^2.5.0",
- "@csstools/css-tokenizer": "^2.2.3"
+ "@csstools/css-parser-algorithms": "^2.6.3",
+ "@csstools/css-tokenizer": "^2.3.1"
},
"homepage": "https://github.com/csstools/postcss-plugins/tree/main/packages/media-query-list-parser#readme",
"repository": {
"type": "git",
- "url": "https://github.com/csstools/postcss-plugins.git",
+ "url": "git+https://github.com/csstools/postcss-plugins.git",
"directory": "packages/media-query-list-parser"
},
"bugs": "https://github.com/csstools/postcss-plugins/issues",
diff --git a/node_modules/@csstools/postcss-cascade-layers/CHANGELOG.md b/node_modules/@csstools/postcss-cascade-layers/CHANGELOG.md
index 9cb80ecb..a1f4d179 100644
--- a/node_modules/@csstools/postcss-cascade-layers/CHANGELOG.md
+++ b/node_modules/@csstools/postcss-cascade-layers/CHANGELOG.md
@@ -1,23 +1,21 @@
# Changes to PostCSS Cascade Layers
-### 4.0.2
+### 4.0.6
-_December 15, 2023_
+_May 13, 2024_
-- Fix type definitions
-- Updated [`@csstools/selector-specificity`](https://github.com/csstools/postcss-plugins/tree/main/packages/selector-specificity) to [`3.0.1`](https://github.com/csstools/postcss-plugins/tree/main/packages/selector-specificity/CHANGELOG.md#301) (patch)
+- Updated [`@csstools/selector-specificity`](https://github.com/csstools/postcss-plugins/tree/main/packages/selector-specificity) to [`3.1.1`](https://github.com/csstools/postcss-plugins/tree/main/packages/selector-specificity/CHANGELOG.md#311) (patch)
-### 4.0.1
+### 4.0.5
-_October 31, 2023_
+_May 11, 2024_
-- Improve performance
+- Updated [`@csstools/selector-specificity`](https://github.com/csstools/postcss-plugins/tree/main/packages/selector-specificity) to [`3.1.0`](https://github.com/csstools/postcss-plugins/tree/main/packages/selector-specificity/CHANGELOG.md#310) (minor)
-### 4.0.0
+### 4.0.4
-_July 3, 2023_
+_March 31, 2024_
-- Change license to `MIT-0` ([read more about this change in the blog post](https://preset-env.cssdb.org/blog/license-change/))
-- Updated [`@csstools/selector-specificity`](https://github.com/csstools/postcss-plugins/tree/main/packages/selector-specificity) to [`3.0.0`](https://github.com/csstools/postcss-plugins/tree/main/packages/selector-specificity/CHANGELOG.md#300) (major)
+- Updated [`@csstools/selector-specificity`](https://github.com/csstools/postcss-plugins/tree/main/packages/selector-specificity) to [`3.0.3`](https://github.com/csstools/postcss-plugins/tree/main/packages/selector-specificity/CHANGELOG.md#303) (patch)
[Full CHANGELOG](https://github.com/csstools/postcss-plugins/tree/main/plugins/postcss-cascade-layers/CHANGELOG.md)
diff --git a/node_modules/@csstools/postcss-cascade-layers/README.md b/node_modules/@csstools/postcss-cascade-layers/README.md
index af14b6c8..66c92550 100644
--- a/node_modules/@csstools/postcss-cascade-layers/README.md
+++ b/node_modules/@csstools/postcss-cascade-layers/README.md
@@ -1,6 +1,6 @@
# PostCSS Cascade Layers [<img src="https://postcss.github.io/postcss/logo.svg" alt="PostCSS Logo" width="90" height="90" align="right">][PostCSS]
-[<img alt="npm version" src="https://img.shields.io/npm/v/@csstools/postcss-cascade-layers.svg" height="20">][npm-url] [<img alt="CSS Standard Status" src="https://cssdb.org/images/badges/cascade-layers.svg" height="20">][css-url] [<img alt="Build Status" src="https://github.com/csstools/postcss-plugins/workflows/test/badge.svg" height="20">][cli-url] [<img alt="Discord" src="https://shields.io/badge/Discord-5865F2?logo=discord&logoColor=white">][discord]
+[<img alt="npm version" src="https://img.shields.io/npm/v/@csstools/postcss-cascade-layers.svg" height="20">][npm-url] [<img alt="Build Status" src="https://github.com/csstools/postcss-plugins/workflows/test/badge.svg" height="20">][cli-url] [<img alt="Discord" src="https://shields.io/badge/Discord-5865F2?logo=discord&logoColor=white">][discord]<br><br>[<img alt="Baseline Status" src="https://cssdb.org/images/badges-baseline/cascade-layers.svg" height="20">][css-url] [<img alt="CSS Standard Status" src="https://cssdb.org/images/badges/cascade-layers.svg" height="20">][css-url]
```bash
npm install @csstools/postcss-cascade-layers --save-dev
diff --git a/node_modules/@csstools/postcss-cascade-layers/dist/index.cjs b/node_modules/@csstools/postcss-cascade-layers/dist/index.cjs
index a679b688..b7817a54 100644
--- a/node_modules/@csstools/postcss-cascade-layers/dist/index.cjs
+++ b/node_modules/@csstools/postcss-cascade-layers/dist/index.cjs
@@ -1 +1 @@
-"use strict";var e=require("postcss-selector-parser"),r=require("@csstools/selector-specificity");const t="csstools-invalid-layer",a="csstools-layer-with-selector-rules",s="6efdb677-bb05-44e5-840f-29d2175862fd",n="b147acf6-11a6-4338-a4d0-80aef4cd1a2f",o=["media","supports"],l=["keyframes"],i=/^revert-layer$/i,c=/^import$/i,u=/^layer$/i,y=/layer/i,m=new Set(["layer","supports","media","container","scope"]);function isProcessableLayerRule(e){if("atrule"!==e.type)return!1;if(!u.test(e.name))return!1;let r=e.parent;for(;r;){if("rule"===r.type)return!1;if("atrule"===r.type&&!m.has(r.name.toLowerCase()))return!1;r=r.parent}return!0}class Model{anonymousLayerCount=0;layerCount=0;layerOrder;layerParamsParsed;layerNameParts;constructor(){this.anonymousLayerCount=0,this.layerCount=0,this.layerOrder=new Map,this.layerParamsParsed=new Map,this.layerNameParts=new Map}createAnonymousLayerName(){const e=`anonymous-${this.anonymousLayerCount}-${s}`;return this.addLayerNameParts(e),this.layerParamsParsed.set(e,[e]),this.anonymousLayerCount++,e}createImplicitLayerName(e){const r=this.layerNameParts.get(e)??[],t=`implicit-${r[r.length-1]}-${n}`;return this.addLayerNameParts([...r,t]),this.layerParamsParsed.set(t,[t]),t}addLayerParams(e,r){r?"string"!=typeof r?this.layerParamsParsed.set(e,r):this.layerParamsParsed.set(e,[r]):this.layerParamsParsed.set(e,[e])}addLayerNameParts(e){"string"!=typeof e?this.layerNameParts.set(e.join("."),e):this.layerNameParts.set(e,[e])}getLayerParams(e){const r=[...this.layerParamsParsed.get(e.params)??[]];let t=e.parent;for(;t;)"atrule"===t.type?(isProcessableLayerRule(t)&&r.push(...this.layerParamsParsed.get(t.params)??[]),t=t.parent):t=t.parent;return r.reverse(),r.flatMap((e=>this.layerNameParts.get(e)??[]))}getLayerNameList(e){const r=this.layerNameParts.get(e)??[],t=[];for(let e=0;e<r.length;e++){const a=r.slice(0,e+1).join(".");this.layerParamsParsed.has(a)||this.layerParamsParsed.set(a,[a]),this.layerNameParts.has(a)||this.layerNameParts.set(a,r.slice(0,e+1)),t.push(r.slice(0,e+1).join("."))}return t}sortLayerNames(){for(const[e,r]of this.layerOrder){const t=this.layerNameParts.get(e)??[];for(let e=1;e<t.length;e++){const a=t.slice(0,e).join(".");this.layerOrder.has(a)||this.layerOrder.set(a,r)}}let e=Array.from(this.layerOrder.entries());e=e.sort(((e,r)=>{const t=this.layerNameParts.get(e[0])??[],a=this.layerNameParts.get(r[0])??[];if(t[0]!==a[0])return(this.layerOrder.get(t[0])??0)-(this.layerOrder.get(a[0])??0);const s=Math.max(t.length,a.length);for(let e=0;e<s;e++){const r=t[e],s=a[e];if(r!==s)return r?s?(this.layerOrder.get(t.slice(0,e).join("."))??0)-(this.layerOrder.get(a.slice(0,e).join("."))??0):-1:1}return 0})),this.layerOrder.clear(),e.forEach(((e,r)=>{this.layerOrder.set(e[0],r)}))}}function adjustSelectorSpecificity(r,t){const a=e().astSync(r),s=e().astSync(generateNot(t));let n=!1;for(let r=0;r<a.nodes[0].nodes.length;r++)if("combinator"===a.nodes[0].nodes[r].type||e.isPseudoElement(a.nodes[0].nodes[r])){a.nodes[0].insertBefore(a.nodes[0].nodes[r],s),n=!0;break}return n||a.nodes[0].insertAfter(a.nodes[0].nodes[a.nodes[0].nodes.length-1],s),a.toString()}function generateNot(e){if(0===e)return"";let r="";for(let t=0;t<e;t++)r+=":not(#\\#)";return r}function someInTree(e,r){let t=!1;return e.walk((e=>{if(r(e))return t=!0,!1})),t}function someAtRuleInTree(e,r){let t=!1;return e.walkAtRules((e=>{if(r(e))return t=!0,!1})),t}function getLayerAtRuleAncestor(e){let r=e.parent;for(;r;)if("atrule"===r.type){if(isProcessableLayerRule(r))return r;r=r.parent}else r=r.parent;return null}function removeEmptyDescendantBlocks(e){e&&(e.walk((e=>{("rule"===e.type||"atrule"===e.type&&["layer",...o].includes(e.name.toLowerCase()))&&0===e.nodes?.length&&e.remove()})),0===e.nodes?.length&&e.remove())}function removeEmptyAncestorBlocks(e){if(!e)return;let r=e;for(;r;){if(void 0===r.nodes)return;if(r.nodes.length>0)return;const e=r.parent;r.remove(),r=e}}function desugarAndParseLayerNames(r,a){r.walkAtRules((r=>{if(!isProcessableLayerRule(r))return;if(r.params){const s=[];let n=!1;if(e().astSync(r.params).each((e=>{const r=[];e.walk((e=>{switch(e.type){case"class":case"tag":r.push(e.value);break;default:n=!0}})),n||(s.push(r.join(".")),a.addLayerNameParts(r))})),a.addLayerParams(r.params,s),r.nodes&&s.length>1&&(n=!0),n)return void(r.name=t);if(!r.nodes||0===r.nodes.length){if(s.length<=1)return;return s.slice(0,-1).forEach((e=>{a.addLayerParams(e,e),r.cloneBefore({params:e})})),a.addLayerParams(s[s.length-1],s[s.length-1]),void(r.params=s[s.length-1])}}r.params||(r.raws.afterName=" ",r.params=a.createAnonymousLayerName());const s=someAtRuleInTree(r,(e=>isProcessableLayerRule(e))),n=someInTree(r,(e=>{if("rule"!==e.type)return!1;return getLayerAtRuleAncestor(e)===r}));if(s&&n){const e=a.createImplicitLayerName(r.params),t=r.clone({params:e});t.walkAtRules((e=>{isProcessableLayerRule(e)&&e.remove()})),r.walk((e=>{if("atrule"===e.type&&isProcessableLayerRule(e))return;if("atrule"===e.type&&o.includes(e.name.toLowerCase()))return;getLayerAtRuleAncestor(e)===r&&e.remove()})),r.append(t),removeEmptyDescendantBlocks(r),removeEmptyAncestorBlocks(r)}}))}function desugarNestedLayers(e,r){for(;someAtRuleInTree(e,(e=>e.nodes&&someAtRuleInTree(e,(e=>isProcessableLayerRule(e)))));){let t=!1;if(e.walkAtRules((a=>{if(isProcessableLayerRule(a)&&a.parent!==e){if("atrule"===a.parent?.type&&isProcessableLayerRule(a.parent)){const e=a.parent;{const t=r.layerNameParts.get(e.params),s=r.layerNameParts.get(a.params);if(!t||!s)return;r.layerNameParts.set(`${e.params}.${a.params}`,[...t,...s]),r.layerParamsParsed.set(`${e.params}.${a.params}`,[`${e.params}.${a.params}`])}return a.params=`${e.params}.${a.params}`,e.before(a),removeEmptyDescendantBlocks(e),void removeEmptyAncestorBlocks(e)}if("atrule"===a.parent?.type){const e=a.parent,r=e.clone(),t=a.clone();return r.removeAll(),t.removeAll(),r.append(a.nodes),t.append(r),e.before(t),a.remove(),removeEmptyDescendantBlocks(e),void removeEmptyAncestorBlocks(e)}t=!0}})),t)break}}function sortRootNodes(e,r){e.walkAtRules((e=>{if(!isProcessableLayerRule(e))return;const r=e.clone(),t=e.clone();r.walkAtRules((e=>{if(l.includes(e.name.toLowerCase())){const r=e.parent;return e.remove(),removeEmptyDescendantBlocks(r),void removeEmptyAncestorBlocks(r)}if(someInTree(e,(e=>"rule"===e.type)))return;const r=e.parent;e.remove(),removeEmptyDescendantBlocks(r),removeEmptyAncestorBlocks(r)})),t.walkRules((e=>{if(e.parent&&"atrule"===e.parent.type&&l.includes(e.parent.name.toLowerCase()))return;const r=e.parent;e.remove(),removeEmptyDescendantBlocks(r),removeEmptyAncestorBlocks(r)})),t.walkAtRules((e=>{if(o.includes(e.name.toLowerCase()))return removeEmptyDescendantBlocks(e),void removeEmptyAncestorBlocks(e)})),r.name=a,e.replaceWith(r,t),0===r.nodes.length&&r.remove(),0===t.nodes.length&&t.remove()})),e.nodes.sort(((e,t)=>{const a="atrule"===e.type&&u.test(e.name),s="atrule"===t.type&&u.test(t.name);if(a&&s){return(r.layerOrder.get(e.params)??0)-(r.layerOrder.get(t.params)??0)}return a!==s?a?-1:1:0})),e.walkAtRules(a,(e=>{e.name="layer"}))}function getConditionalAtRuleAncestor(e){let r=e.parent;for(;r;)if("atrule"===r.type){if(o.includes(r.name.toLowerCase()))return r;r=r.parent}else r=r.parent;return null}function recordLayerOrder(e,r,{result:t,options:a}){e.walkAtRules((e=>{if(!isProcessableLayerRule(e))return;const o=r.getLayerParams(e),l=o.join(".");r.layerOrder.has(l)||(a.onConditionalRulesChangingLayerOrder&&getConditionalAtRuleAncestor(e)&&!e.params.endsWith(n)&&!e.params.endsWith(s)&&e.warn(t,"handling different layer orders in conditional rules is unsupported by this plugin and will cause style differences between browser versions."),r.layerParamsParsed.has(l)||r.layerParamsParsed.set(l,[l]),r.layerNameParts.has(l)||r.layerNameParts.set(l,[...o]),r.getLayerNameList(l).forEach((e=>{r.layerOrder.has(e)||(r.layerOrder.set(e,r.layerCount),r.layerCount+=1)}))),e.nodes&&0!==e.nodes.length||e.remove()}))}function splitImportantStyles(e){e.walkDecls((e=>{if(!e.important)return;const r=e.parent;if(!r)return;if("atrule"===r?.parent?.type&&l.includes(r.parent.name.toLowerCase()))return;const t=r.clone();t.each((e=>{"decl"===e.type&&e.important||e.remove()})),r.each((e=>{"decl"===e.type&&e.important&&e.remove()})),r.before(t),removeEmptyDescendantBlocks(r)}))}const creator=a=>{const s=Object.assign({onRevertLayerKeyword:"warn",onConditionalRulesChangingLayerOrder:"warn",onImportLayerRule:"warn"},a);return{postcssPlugin:"postcss-cascade-layers",OnceExit(a,{result:n}){let o=!1;if((s.onRevertLayerKeyword||s.onImportLayerRule)&&a.walk((e=>"decl"===e.type?i.test(e.value)?void e.warn(n,'handling "revert-layer" is unsupported by this plugin and will cause style differences between browser versions.'):void 0:"atrule"===e.type?c.test(e.name)&&y.test(e.params)?void e.warn(n,"To use @import with layers, the postcss-import plugin is also required. This plugin alone will not support using the @import at-rule."):u.test(e.name)?void(o=!0):void 0:void 0)),!o)return;splitImportantStyles(a);const m=new Model;if(desugarAndParseLayerNames(a,m),recordLayerOrder(a,m,{result:n,options:s}),!m.layerCount)return void a.walkAtRules(t,(e=>{e.name="layer"}));let p=0;for(a.walkRules((t=>{t.selectors.forEach((a=>{try{const t=r.selectorSpecificity(e().astSync(a));p=Math.max(p,t.a+1)}catch(e){t.warn(n,`Failed to parse selector : "${a}" with message: "${e instanceof Error?e.message:e}"`)}}))})),a.walkRules((e=>{e.parent&&"atrule"===e.parent.type&&l.includes(e.parent.name.toLowerCase())||getLayerAtRuleAncestor(e)||e.some((e=>"decl"===e.type&&e.important))||(e.selectors=e.selectors.map((r=>{try{return adjustSelectorSpecificity(r,m.layerCount*p)}catch(t){e.warn(n,`Failed to parse selector : "${r}" with message: "${t instanceof Error?t.message:t}"`)}return r})))})),m.sortLayerNames(),desugarNestedLayers(a,m),sortRootNodes(a,m),a.walkRules((e=>{if(e.parent&&"atrule"===e.parent.type&&l.includes(e.parent.name.toLowerCase()))return;const r=getLayerAtRuleAncestor(e);if(!r)return;const t=m.getLayerParams(r).join(".");let a=(m.layerOrder.get(t)??0)*p;e.some((e=>"decl"===e.type&&e.important))&&(a=m.layerCount-a),e.selectors=e.selectors.map((e=>adjustSelectorSpecificity(e,a)))}));someAtRuleInTree(a,(e=>isProcessableLayerRule(e)));)a.walkAtRules((e=>{isProcessableLayerRule(e)&&e.replaceWith(e.nodes)}));a.walkAtRules(t,(e=>{e.name="layer"}))}}};creator.postcss=!0,module.exports=creator;
+"use strict";var e=require("postcss-selector-parser"),r=require("@csstools/selector-specificity");const t="csstools-invalid-layer",a="csstools-layer-with-selector-rules",s="6efdb677-bb05-44e5-840f-29d2175862fd",n="b147acf6-11a6-4338-a4d0-80aef4cd1a2f",o=["media","supports"],l=["keyframes"],i=/^revert-layer$/i,c=/^import$/i,u=/^layer$/i,m=/layer/i,y=new Set(["layer","supports","media","container","scope"]);function isProcessableLayerRule(e){if("atrule"!==e.type)return!1;if(!u.test(e.name))return!1;let r=e.parent;for(;r;){if("rule"===r.type)return!1;if("atrule"===r.type&&!y.has(r.name.toLowerCase()))return!1;r=r.parent}return!0}class Model{anonymousLayerCount=0;layerCount=0;layerOrder;layerParamsParsed;layerNameParts;constructor(){this.anonymousLayerCount=0,this.layerCount=0,this.layerOrder=new Map,this.layerParamsParsed=new Map,this.layerNameParts=new Map}createAnonymousLayerName(){const e=`anonymous-${this.anonymousLayerCount}-${s}`;return this.addLayerNameParts(e),this.layerParamsParsed.set(e,[e]),this.anonymousLayerCount++,e}createImplicitLayerName(e){const r=this.layerNameParts.get(e)??[],t=`implicit-${r[r.length-1]}-${n}`;return this.addLayerNameParts([...r,t]),this.layerParamsParsed.set(t,[t]),t}addLayerParams(e,r){r?"string"!=typeof r?this.layerParamsParsed.set(e,r):this.layerParamsParsed.set(e,[r]):this.layerParamsParsed.set(e,[e])}addLayerNameParts(e){"string"!=typeof e?this.layerNameParts.set(e.join("."),e):this.layerNameParts.set(e,[e])}getLayerParams(e){const r=[...this.layerParamsParsed.get(e.params)??[]];let t=e.parent;for(;t;)"atrule"===t.type?(isProcessableLayerRule(t)&&r.push(...this.layerParamsParsed.get(t.params)??[]),t=t.parent):t=t.parent;return r.reverse(),r.flatMap((e=>this.layerNameParts.get(e)??[]))}getLayerNameList(e){const r=this.layerNameParts.get(e)??[],t=[];for(let e=0;e<r.length;e++){const a=r.slice(0,e+1).join(".");this.layerParamsParsed.has(a)||this.layerParamsParsed.set(a,[a]),this.layerNameParts.has(a)||this.layerNameParts.set(a,r.slice(0,e+1)),t.push(r.slice(0,e+1).join("."))}return t}sortLayerNames(){for(const[e,r]of this.layerOrder){const t=this.layerNameParts.get(e)??[];for(let e=1;e<t.length;e++){const a=t.slice(0,e).join(".");this.layerOrder.has(a)||this.layerOrder.set(a,r)}}let e=Array.from(this.layerOrder.entries());e=e.sort(((e,r)=>{const t=this.layerNameParts.get(e[0])??[],a=this.layerNameParts.get(r[0])??[];if(t[0]!==a[0])return(this.layerOrder.get(t[0])??0)-(this.layerOrder.get(a[0])??0);const s=Math.max(t.length,a.length);for(let e=0;e<s;e++){const r=t[e],s=a[e];if(r!==s)return r?s?(this.layerOrder.get(t.slice(0,e).join("."))??0)-(this.layerOrder.get(a.slice(0,e).join("."))??0):-1:1}return 0})),this.layerOrder.clear(),e.forEach(((e,r)=>{this.layerOrder.set(e[0],r)}))}}function adjustSelectorSpecificity(r,t){const a=e().astSync(r),s=e().astSync(generateNot(t));let n=!1;for(let r=0;r<a.nodes[0].nodes.length;r++)if("combinator"===a.nodes[0].nodes[r].type||e.isPseudoElement(a.nodes[0].nodes[r])){a.nodes[0].insertBefore(a.nodes[0].nodes[r],s),n=!0;break}return n||a.nodes[0].insertAfter(a.nodes[0].nodes[a.nodes[0].nodes.length-1],s),a.toString()}function generateNot(e){if(0===e)return"";let r="";for(let t=0;t<e;t++)r+=":not(#\\#)";return r}function someInTree(e,r){let t=!1;return e.walk((e=>{if(r(e))return t=!0,!1})),t}function someAtRuleInTree(e,r){let t=!1;return e.walkAtRules((e=>{if(r(e))return t=!0,!1})),t}function getLayerAtRuleAncestor(e){let r=e.parent;for(;r;)if("atrule"===r.type){if(isProcessableLayerRule(r))return r;r=r.parent}else r=r.parent;return null}function removeEmptyDescendantBlocks(e){e&&(e.walk((e=>{("rule"===e.type||"atrule"===e.type&&["layer",...o].includes(e.name.toLowerCase()))&&0===e.nodes?.length&&e.remove()})),0===e.nodes?.length&&e.remove())}function removeEmptyAncestorBlocks(e){if(!e)return;let r=e;for(;r;){if(void 0===r.nodes)return;if(r.nodes.length>0)return;const e=r.parent;r.remove(),r=e}}function desugarAndParseLayerNames(r,a){r.walkAtRules((r=>{if(!isProcessableLayerRule(r))return;if(r.params){const s=[];let n=!1;if(e().astSync(r.params).each((e=>{const r=[];e.walk((e=>{switch(e.type){case"class":case"tag":r.push(e.value);break;default:n=!0}})),n||(s.push(r.join(".")),a.addLayerNameParts(r))})),a.addLayerParams(r.params,s),r.nodes&&s.length>1&&(n=!0),n)return void(r.name=t);if(!r.nodes||0===r.nodes.length){if(s.length<=1)return;return s.slice(0,-1).forEach((e=>{a.addLayerParams(e,e),r.cloneBefore({params:e})})),a.addLayerParams(s[s.length-1],s[s.length-1]),void(r.params=s[s.length-1])}}r.params||(r.raws.afterName=" ",r.params=a.createAnonymousLayerName());const s=someAtRuleInTree(r,(e=>isProcessableLayerRule(e))),n=someInTree(r,(e=>{if("rule"!==e.type)return!1;return getLayerAtRuleAncestor(e)===r}));if(s&&n){const e=a.createImplicitLayerName(r.params),t=r.clone({params:e});t.walkAtRules((e=>{isProcessableLayerRule(e)&&e.remove()})),r.walk((e=>{if("atrule"===e.type&&isProcessableLayerRule(e))return;if("atrule"===e.type&&o.includes(e.name.toLowerCase()))return;getLayerAtRuleAncestor(e)===r&&e.remove()})),r.append(t),removeEmptyDescendantBlocks(r),removeEmptyAncestorBlocks(r)}}))}function desugarNestedLayers(e,r){for(;someAtRuleInTree(e,(e=>!!e.nodes&&someAtRuleInTree(e,(e=>isProcessableLayerRule(e)))));){let t=!1;if(e.walkAtRules((a=>{if(isProcessableLayerRule(a)&&a.parent!==e){if("atrule"===a.parent?.type&&isProcessableLayerRule(a.parent)){const e=a.parent;{const t=r.layerNameParts.get(e.params),s=r.layerNameParts.get(a.params);if(!t||!s)return;r.layerNameParts.set(`${e.params}.${a.params}`,[...t,...s]),r.layerParamsParsed.set(`${e.params}.${a.params}`,[`${e.params}.${a.params}`])}return a.params=`${e.params}.${a.params}`,e.before(a),removeEmptyDescendantBlocks(e),void removeEmptyAncestorBlocks(e)}if("atrule"===a.parent?.type){const e=a.parent,r=e.clone(),t=a.clone();return r.removeAll(),t.removeAll(),r.append(a.nodes),t.append(r),e.before(t),a.remove(),removeEmptyDescendantBlocks(e),void removeEmptyAncestorBlocks(e)}t=!0}})),t)break}}function sortRootNodes(e,r){e.nodes&&(e.walkAtRules((e=>{if(!isProcessableLayerRule(e))return;const r=e.clone(),t=e.clone();r.walkAtRules((e=>{if(l.includes(e.name.toLowerCase())){const r=e.parent;return e.remove(),removeEmptyDescendantBlocks(r),void removeEmptyAncestorBlocks(r)}if(someInTree(e,(e=>"rule"===e.type)))return;const r=e.parent;e.remove(),removeEmptyDescendantBlocks(r),removeEmptyAncestorBlocks(r)})),t.walkRules((e=>{if(e.parent&&"atrule"===e.parent.type&&l.includes(e.parent.name.toLowerCase()))return;const r=e.parent;e.remove(),removeEmptyDescendantBlocks(r),removeEmptyAncestorBlocks(r)})),t.walkAtRules((e=>{if(o.includes(e.name.toLowerCase()))return removeEmptyDescendantBlocks(e),void removeEmptyAncestorBlocks(e)})),r.name=a,e.replaceWith(r,t),r.nodes?.length||r.remove(),t.nodes?.length||t.remove()})),e.nodes.sort(((e,t)=>{const a="atrule"===e.type&&u.test(e.name),s="atrule"===t.type&&u.test(t.name);if(a&&s){return(r.layerOrder.get(e.params)??0)-(r.layerOrder.get(t.params)??0)}return a!==s?a?-1:1:0})),e.walkAtRules(a,(e=>{e.name="layer"})))}function getConditionalAtRuleAncestor(e){let r=e.parent;for(;r;)if("atrule"===r.type){if(o.includes(r.name.toLowerCase()))return r;r=r.parent}else r=r.parent;return null}function recordLayerOrder(e,r,{result:t,options:a}){e.walkAtRules((e=>{if(!isProcessableLayerRule(e))return;const o=r.getLayerParams(e),l=o.join(".");r.layerOrder.has(l)||(a.onConditionalRulesChangingLayerOrder&&getConditionalAtRuleAncestor(e)&&!e.params.endsWith(n)&&!e.params.endsWith(s)&&e.warn(t,"handling different layer orders in conditional rules is unsupported by this plugin and will cause style differences between browser versions."),r.layerParamsParsed.has(l)||r.layerParamsParsed.set(l,[l]),r.layerNameParts.has(l)||r.layerNameParts.set(l,[...o]),r.getLayerNameList(l).forEach((e=>{r.layerOrder.has(e)||(r.layerOrder.set(e,r.layerCount),r.layerCount+=1)}))),e.nodes&&0!==e.nodes.length||e.remove()}))}function splitImportantStyles(e){e.walkDecls((e=>{if(!e.important)return;const r=e.parent;if(!r)return;if("atrule"===r?.parent?.type&&l.includes(r.parent.name.toLowerCase()))return;const t=r.clone();t.each((e=>{"decl"===e.type&&e.important||e.remove()})),r.each((e=>{"decl"===e.type&&e.important&&e.remove()})),r.before(t),removeEmptyDescendantBlocks(r)}))}const creator=a=>{const s=Object.assign({onRevertLayerKeyword:"warn",onConditionalRulesChangingLayerOrder:"warn",onImportLayerRule:"warn"},a);return{postcssPlugin:"postcss-cascade-layers",OnceExit(a,{result:n}){let o=!1;if((s.onRevertLayerKeyword||s.onImportLayerRule)&&a.walk((e=>"decl"===e.type?i.test(e.value)?void e.warn(n,'handling "revert-layer" is unsupported by this plugin and will cause style differences between browser versions.'):void 0:"atrule"===e.type?c.test(e.name)&&m.test(e.params)?void e.warn(n,"To use @import with layers, the postcss-import plugin is also required. This plugin alone will not support using the @import at-rule."):u.test(e.name)?void(o=!0):void 0:void 0)),!o)return;splitImportantStyles(a);const y=new Model;if(desugarAndParseLayerNames(a,y),recordLayerOrder(a,y,{result:n,options:s}),!y.layerCount)return void a.walkAtRules(t,(e=>{e.name="layer"}));let d=0;for(a.walkRules((t=>{t.selectors.forEach((a=>{try{const t=r.selectorSpecificity(e().astSync(a));d=Math.max(d,t.a+1)}catch(e){t.warn(n,`Failed to parse selector : "${a}" with message: "${e instanceof Error?e.message:e}"`)}}))})),a.walkRules((e=>{e.parent&&"atrule"===e.parent.type&&l.includes(e.parent.name.toLowerCase())||getLayerAtRuleAncestor(e)||e.some((e=>"decl"===e.type&&e.important))||(e.selectors=e.selectors.map((r=>{try{return adjustSelectorSpecificity(r,y.layerCount*d)}catch(t){e.warn(n,`Failed to parse selector : "${r}" with message: "${t instanceof Error?t.message:t}"`)}return r})))})),y.sortLayerNames(),desugarNestedLayers(a,y),sortRootNodes(a,y),a.walkRules((e=>{if(e.parent&&"atrule"===e.parent.type&&l.includes(e.parent.name.toLowerCase()))return;const r=getLayerAtRuleAncestor(e);if(!r)return;const t=y.getLayerParams(r).join(".");let a=(y.layerOrder.get(t)??0)*d;e.some((e=>"decl"===e.type&&e.important))&&(a=y.layerCount-a),e.selectors=e.selectors.map((e=>adjustSelectorSpecificity(e,a)))}));someAtRuleInTree(a,(e=>isProcessableLayerRule(e)));)a.walkAtRules((e=>{isProcessableLayerRule(e)&&(e.nodes?e.replaceWith(e.nodes):e.remove())}));a.walkAtRules(t,(e=>{e.name="layer"}))}}};creator.postcss=!0,module.exports=creator;
diff --git a/node_modules/@csstools/postcss-cascade-layers/dist/index.mjs b/node_modules/@csstools/postcss-cascade-layers/dist/index.mjs
index f28cd9e9..bc359a13 100644
--- a/node_modules/@csstools/postcss-cascade-layers/dist/index.mjs
+++ b/node_modules/@csstools/postcss-cascade-layers/dist/index.mjs
@@ -1 +1 @@
-import e from"postcss-selector-parser";import{selectorSpecificity as r}from"@csstools/selector-specificity";const t="csstools-invalid-layer",a="csstools-layer-with-selector-rules",s="6efdb677-bb05-44e5-840f-29d2175862fd",n="b147acf6-11a6-4338-a4d0-80aef4cd1a2f",o=["media","supports"],l=["keyframes"],i=/^revert-layer$/i,c=/^import$/i,u=/^layer$/i,m=/layer/i,y=new Set(["layer","supports","media","container","scope"]);function isProcessableLayerRule(e){if("atrule"!==e.type)return!1;if(!u.test(e.name))return!1;let r=e.parent;for(;r;){if("rule"===r.type)return!1;if("atrule"===r.type&&!y.has(r.name.toLowerCase()))return!1;r=r.parent}return!0}class Model{anonymousLayerCount=0;layerCount=0;layerOrder;layerParamsParsed;layerNameParts;constructor(){this.anonymousLayerCount=0,this.layerCount=0,this.layerOrder=new Map,this.layerParamsParsed=new Map,this.layerNameParts=new Map}createAnonymousLayerName(){const e=`anonymous-${this.anonymousLayerCount}-${s}`;return this.addLayerNameParts(e),this.layerParamsParsed.set(e,[e]),this.anonymousLayerCount++,e}createImplicitLayerName(e){const r=this.layerNameParts.get(e)??[],t=`implicit-${r[r.length-1]}-${n}`;return this.addLayerNameParts([...r,t]),this.layerParamsParsed.set(t,[t]),t}addLayerParams(e,r){r?"string"!=typeof r?this.layerParamsParsed.set(e,r):this.layerParamsParsed.set(e,[r]):this.layerParamsParsed.set(e,[e])}addLayerNameParts(e){"string"!=typeof e?this.layerNameParts.set(e.join("."),e):this.layerNameParts.set(e,[e])}getLayerParams(e){const r=[...this.layerParamsParsed.get(e.params)??[]];let t=e.parent;for(;t;)"atrule"===t.type?(isProcessableLayerRule(t)&&r.push(...this.layerParamsParsed.get(t.params)??[]),t=t.parent):t=t.parent;return r.reverse(),r.flatMap((e=>this.layerNameParts.get(e)??[]))}getLayerNameList(e){const r=this.layerNameParts.get(e)??[],t=[];for(let e=0;e<r.length;e++){const a=r.slice(0,e+1).join(".");this.layerParamsParsed.has(a)||this.layerParamsParsed.set(a,[a]),this.layerNameParts.has(a)||this.layerNameParts.set(a,r.slice(0,e+1)),t.push(r.slice(0,e+1).join("."))}return t}sortLayerNames(){for(const[e,r]of this.layerOrder){const t=this.layerNameParts.get(e)??[];for(let e=1;e<t.length;e++){const a=t.slice(0,e).join(".");this.layerOrder.has(a)||this.layerOrder.set(a,r)}}let e=Array.from(this.layerOrder.entries());e=e.sort(((e,r)=>{const t=this.layerNameParts.get(e[0])??[],a=this.layerNameParts.get(r[0])??[];if(t[0]!==a[0])return(this.layerOrder.get(t[0])??0)-(this.layerOrder.get(a[0])??0);const s=Math.max(t.length,a.length);for(let e=0;e<s;e++){const r=t[e],s=a[e];if(r!==s)return r?s?(this.layerOrder.get(t.slice(0,e).join("."))??0)-(this.layerOrder.get(a.slice(0,e).join("."))??0):-1:1}return 0})),this.layerOrder.clear(),e.forEach(((e,r)=>{this.layerOrder.set(e[0],r)}))}}function adjustSelectorSpecificity(r,t){const a=e().astSync(r),s=e().astSync(generateNot(t));let n=!1;for(let r=0;r<a.nodes[0].nodes.length;r++)if("combinator"===a.nodes[0].nodes[r].type||e.isPseudoElement(a.nodes[0].nodes[r])){a.nodes[0].insertBefore(a.nodes[0].nodes[r],s),n=!0;break}return n||a.nodes[0].insertAfter(a.nodes[0].nodes[a.nodes[0].nodes.length-1],s),a.toString()}function generateNot(e){if(0===e)return"";let r="";for(let t=0;t<e;t++)r+=":not(#\\#)";return r}function someInTree(e,r){let t=!1;return e.walk((e=>{if(r(e))return t=!0,!1})),t}function someAtRuleInTree(e,r){let t=!1;return e.walkAtRules((e=>{if(r(e))return t=!0,!1})),t}function getLayerAtRuleAncestor(e){let r=e.parent;for(;r;)if("atrule"===r.type){if(isProcessableLayerRule(r))return r;r=r.parent}else r=r.parent;return null}function removeEmptyDescendantBlocks(e){e&&(e.walk((e=>{("rule"===e.type||"atrule"===e.type&&["layer",...o].includes(e.name.toLowerCase()))&&0===e.nodes?.length&&e.remove()})),0===e.nodes?.length&&e.remove())}function removeEmptyAncestorBlocks(e){if(!e)return;let r=e;for(;r;){if(void 0===r.nodes)return;if(r.nodes.length>0)return;const e=r.parent;r.remove(),r=e}}function desugarAndParseLayerNames(r,a){r.walkAtRules((r=>{if(!isProcessableLayerRule(r))return;if(r.params){const s=[];let n=!1;if(e().astSync(r.params).each((e=>{const r=[];e.walk((e=>{switch(e.type){case"class":case"tag":r.push(e.value);break;default:n=!0}})),n||(s.push(r.join(".")),a.addLayerNameParts(r))})),a.addLayerParams(r.params,s),r.nodes&&s.length>1&&(n=!0),n)return void(r.name=t);if(!r.nodes||0===r.nodes.length){if(s.length<=1)return;return s.slice(0,-1).forEach((e=>{a.addLayerParams(e,e),r.cloneBefore({params:e})})),a.addLayerParams(s[s.length-1],s[s.length-1]),void(r.params=s[s.length-1])}}r.params||(r.raws.afterName=" ",r.params=a.createAnonymousLayerName());const s=someAtRuleInTree(r,(e=>isProcessableLayerRule(e))),n=someInTree(r,(e=>{if("rule"!==e.type)return!1;return getLayerAtRuleAncestor(e)===r}));if(s&&n){const e=a.createImplicitLayerName(r.params),t=r.clone({params:e});t.walkAtRules((e=>{isProcessableLayerRule(e)&&e.remove()})),r.walk((e=>{if("atrule"===e.type&&isProcessableLayerRule(e))return;if("atrule"===e.type&&o.includes(e.name.toLowerCase()))return;getLayerAtRuleAncestor(e)===r&&e.remove()})),r.append(t),removeEmptyDescendantBlocks(r),removeEmptyAncestorBlocks(r)}}))}function desugarNestedLayers(e,r){for(;someAtRuleInTree(e,(e=>e.nodes&&someAtRuleInTree(e,(e=>isProcessableLayerRule(e)))));){let t=!1;if(e.walkAtRules((a=>{if(isProcessableLayerRule(a)&&a.parent!==e){if("atrule"===a.parent?.type&&isProcessableLayerRule(a.parent)){const e=a.parent;{const t=r.layerNameParts.get(e.params),s=r.layerNameParts.get(a.params);if(!t||!s)return;r.layerNameParts.set(`${e.params}.${a.params}`,[...t,...s]),r.layerParamsParsed.set(`${e.params}.${a.params}`,[`${e.params}.${a.params}`])}return a.params=`${e.params}.${a.params}`,e.before(a),removeEmptyDescendantBlocks(e),void removeEmptyAncestorBlocks(e)}if("atrule"===a.parent?.type){const e=a.parent,r=e.clone(),t=a.clone();return r.removeAll(),t.removeAll(),r.append(a.nodes),t.append(r),e.before(t),a.remove(),removeEmptyDescendantBlocks(e),void removeEmptyAncestorBlocks(e)}t=!0}})),t)break}}function sortRootNodes(e,r){e.walkAtRules((e=>{if(!isProcessableLayerRule(e))return;const r=e.clone(),t=e.clone();r.walkAtRules((e=>{if(l.includes(e.name.toLowerCase())){const r=e.parent;return e.remove(),removeEmptyDescendantBlocks(r),void removeEmptyAncestorBlocks(r)}if(someInTree(e,(e=>"rule"===e.type)))return;const r=e.parent;e.remove(),removeEmptyDescendantBlocks(r),removeEmptyAncestorBlocks(r)})),t.walkRules((e=>{if(e.parent&&"atrule"===e.parent.type&&l.includes(e.parent.name.toLowerCase()))return;const r=e.parent;e.remove(),removeEmptyDescendantBlocks(r),removeEmptyAncestorBlocks(r)})),t.walkAtRules((e=>{if(o.includes(e.name.toLowerCase()))return removeEmptyDescendantBlocks(e),void removeEmptyAncestorBlocks(e)})),r.name=a,e.replaceWith(r,t),0===r.nodes.length&&r.remove(),0===t.nodes.length&&t.remove()})),e.nodes.sort(((e,t)=>{const a="atrule"===e.type&&u.test(e.name),s="atrule"===t.type&&u.test(t.name);if(a&&s){return(r.layerOrder.get(e.params)??0)-(r.layerOrder.get(t.params)??0)}return a!==s?a?-1:1:0})),e.walkAtRules(a,(e=>{e.name="layer"}))}function getConditionalAtRuleAncestor(e){let r=e.parent;for(;r;)if("atrule"===r.type){if(o.includes(r.name.toLowerCase()))return r;r=r.parent}else r=r.parent;return null}function recordLayerOrder(e,r,{result:t,options:a}){e.walkAtRules((e=>{if(!isProcessableLayerRule(e))return;const o=r.getLayerParams(e),l=o.join(".");r.layerOrder.has(l)||(a.onConditionalRulesChangingLayerOrder&&getConditionalAtRuleAncestor(e)&&!e.params.endsWith(n)&&!e.params.endsWith(s)&&e.warn(t,"handling different layer orders in conditional rules is unsupported by this plugin and will cause style differences between browser versions."),r.layerParamsParsed.has(l)||r.layerParamsParsed.set(l,[l]),r.layerNameParts.has(l)||r.layerNameParts.set(l,[...o]),r.getLayerNameList(l).forEach((e=>{r.layerOrder.has(e)||(r.layerOrder.set(e,r.layerCount),r.layerCount+=1)}))),e.nodes&&0!==e.nodes.length||e.remove()}))}function splitImportantStyles(e){e.walkDecls((e=>{if(!e.important)return;const r=e.parent;if(!r)return;if("atrule"===r?.parent?.type&&l.includes(r.parent.name.toLowerCase()))return;const t=r.clone();t.each((e=>{"decl"===e.type&&e.important||e.remove()})),r.each((e=>{"decl"===e.type&&e.important&&e.remove()})),r.before(t),removeEmptyDescendantBlocks(r)}))}const creator=a=>{const s=Object.assign({onRevertLayerKeyword:"warn",onConditionalRulesChangingLayerOrder:"warn",onImportLayerRule:"warn"},a);return{postcssPlugin:"postcss-cascade-layers",OnceExit(a,{result:n}){let o=!1;if((s.onRevertLayerKeyword||s.onImportLayerRule)&&a.walk((e=>"decl"===e.type?i.test(e.value)?void e.warn(n,'handling "revert-layer" is unsupported by this plugin and will cause style differences between browser versions.'):void 0:"atrule"===e.type?c.test(e.name)&&m.test(e.params)?void e.warn(n,"To use @import with layers, the postcss-import plugin is also required. This plugin alone will not support using the @import at-rule."):u.test(e.name)?void(o=!0):void 0:void 0)),!o)return;splitImportantStyles(a);const y=new Model;if(desugarAndParseLayerNames(a,y),recordLayerOrder(a,y,{result:n,options:s}),!y.layerCount)return void a.walkAtRules(t,(e=>{e.name="layer"}));let p=0;for(a.walkRules((t=>{t.selectors.forEach((a=>{try{const t=r(e().astSync(a));p=Math.max(p,t.a+1)}catch(e){t.warn(n,`Failed to parse selector : "${a}" with message: "${e instanceof Error?e.message:e}"`)}}))})),a.walkRules((e=>{e.parent&&"atrule"===e.parent.type&&l.includes(e.parent.name.toLowerCase())||getLayerAtRuleAncestor(e)||e.some((e=>"decl"===e.type&&e.important))||(e.selectors=e.selectors.map((r=>{try{return adjustSelectorSpecificity(r,y.layerCount*p)}catch(t){e.warn(n,`Failed to parse selector : "${r}" with message: "${t instanceof Error?t.message:t}"`)}return r})))})),y.sortLayerNames(),desugarNestedLayers(a,y),sortRootNodes(a,y),a.walkRules((e=>{if(e.parent&&"atrule"===e.parent.type&&l.includes(e.parent.name.toLowerCase()))return;const r=getLayerAtRuleAncestor(e);if(!r)return;const t=y.getLayerParams(r).join(".");let a=(y.layerOrder.get(t)??0)*p;e.some((e=>"decl"===e.type&&e.important))&&(a=y.layerCount-a),e.selectors=e.selectors.map((e=>adjustSelectorSpecificity(e,a)))}));someAtRuleInTree(a,(e=>isProcessableLayerRule(e)));)a.walkAtRules((e=>{isProcessableLayerRule(e)&&e.replaceWith(e.nodes)}));a.walkAtRules(t,(e=>{e.name="layer"}))}}};creator.postcss=!0;export{creator as default};
+import e from"postcss-selector-parser";import{selectorSpecificity as r}from"@csstools/selector-specificity";const t="csstools-invalid-layer",a="csstools-layer-with-selector-rules",s="6efdb677-bb05-44e5-840f-29d2175862fd",n="b147acf6-11a6-4338-a4d0-80aef4cd1a2f",o=["media","supports"],l=["keyframes"],i=/^revert-layer$/i,c=/^import$/i,u=/^layer$/i,m=/layer/i,y=new Set(["layer","supports","media","container","scope"]);function isProcessableLayerRule(e){if("atrule"!==e.type)return!1;if(!u.test(e.name))return!1;let r=e.parent;for(;r;){if("rule"===r.type)return!1;if("atrule"===r.type&&!y.has(r.name.toLowerCase()))return!1;r=r.parent}return!0}class Model{anonymousLayerCount=0;layerCount=0;layerOrder;layerParamsParsed;layerNameParts;constructor(){this.anonymousLayerCount=0,this.layerCount=0,this.layerOrder=new Map,this.layerParamsParsed=new Map,this.layerNameParts=new Map}createAnonymousLayerName(){const e=`anonymous-${this.anonymousLayerCount}-${s}`;return this.addLayerNameParts(e),this.layerParamsParsed.set(e,[e]),this.anonymousLayerCount++,e}createImplicitLayerName(e){const r=this.layerNameParts.get(e)??[],t=`implicit-${r[r.length-1]}-${n}`;return this.addLayerNameParts([...r,t]),this.layerParamsParsed.set(t,[t]),t}addLayerParams(e,r){r?"string"!=typeof r?this.layerParamsParsed.set(e,r):this.layerParamsParsed.set(e,[r]):this.layerParamsParsed.set(e,[e])}addLayerNameParts(e){"string"!=typeof e?this.layerNameParts.set(e.join("."),e):this.layerNameParts.set(e,[e])}getLayerParams(e){const r=[...this.layerParamsParsed.get(e.params)??[]];let t=e.parent;for(;t;)"atrule"===t.type?(isProcessableLayerRule(t)&&r.push(...this.layerParamsParsed.get(t.params)??[]),t=t.parent):t=t.parent;return r.reverse(),r.flatMap((e=>this.layerNameParts.get(e)??[]))}getLayerNameList(e){const r=this.layerNameParts.get(e)??[],t=[];for(let e=0;e<r.length;e++){const a=r.slice(0,e+1).join(".");this.layerParamsParsed.has(a)||this.layerParamsParsed.set(a,[a]),this.layerNameParts.has(a)||this.layerNameParts.set(a,r.slice(0,e+1)),t.push(r.slice(0,e+1).join("."))}return t}sortLayerNames(){for(const[e,r]of this.layerOrder){const t=this.layerNameParts.get(e)??[];for(let e=1;e<t.length;e++){const a=t.slice(0,e).join(".");this.layerOrder.has(a)||this.layerOrder.set(a,r)}}let e=Array.from(this.layerOrder.entries());e=e.sort(((e,r)=>{const t=this.layerNameParts.get(e[0])??[],a=this.layerNameParts.get(r[0])??[];if(t[0]!==a[0])return(this.layerOrder.get(t[0])??0)-(this.layerOrder.get(a[0])??0);const s=Math.max(t.length,a.length);for(let e=0;e<s;e++){const r=t[e],s=a[e];if(r!==s)return r?s?(this.layerOrder.get(t.slice(0,e).join("."))??0)-(this.layerOrder.get(a.slice(0,e).join("."))??0):-1:1}return 0})),this.layerOrder.clear(),e.forEach(((e,r)=>{this.layerOrder.set(e[0],r)}))}}function adjustSelectorSpecificity(r,t){const a=e().astSync(r),s=e().astSync(generateNot(t));let n=!1;for(let r=0;r<a.nodes[0].nodes.length;r++)if("combinator"===a.nodes[0].nodes[r].type||e.isPseudoElement(a.nodes[0].nodes[r])){a.nodes[0].insertBefore(a.nodes[0].nodes[r],s),n=!0;break}return n||a.nodes[0].insertAfter(a.nodes[0].nodes[a.nodes[0].nodes.length-1],s),a.toString()}function generateNot(e){if(0===e)return"";let r="";for(let t=0;t<e;t++)r+=":not(#\\#)";return r}function someInTree(e,r){let t=!1;return e.walk((e=>{if(r(e))return t=!0,!1})),t}function someAtRuleInTree(e,r){let t=!1;return e.walkAtRules((e=>{if(r(e))return t=!0,!1})),t}function getLayerAtRuleAncestor(e){let r=e.parent;for(;r;)if("atrule"===r.type){if(isProcessableLayerRule(r))return r;r=r.parent}else r=r.parent;return null}function removeEmptyDescendantBlocks(e){e&&(e.walk((e=>{("rule"===e.type||"atrule"===e.type&&["layer",...o].includes(e.name.toLowerCase()))&&0===e.nodes?.length&&e.remove()})),0===e.nodes?.length&&e.remove())}function removeEmptyAncestorBlocks(e){if(!e)return;let r=e;for(;r;){if(void 0===r.nodes)return;if(r.nodes.length>0)return;const e=r.parent;r.remove(),r=e}}function desugarAndParseLayerNames(r,a){r.walkAtRules((r=>{if(!isProcessableLayerRule(r))return;if(r.params){const s=[];let n=!1;if(e().astSync(r.params).each((e=>{const r=[];e.walk((e=>{switch(e.type){case"class":case"tag":r.push(e.value);break;default:n=!0}})),n||(s.push(r.join(".")),a.addLayerNameParts(r))})),a.addLayerParams(r.params,s),r.nodes&&s.length>1&&(n=!0),n)return void(r.name=t);if(!r.nodes||0===r.nodes.length){if(s.length<=1)return;return s.slice(0,-1).forEach((e=>{a.addLayerParams(e,e),r.cloneBefore({params:e})})),a.addLayerParams(s[s.length-1],s[s.length-1]),void(r.params=s[s.length-1])}}r.params||(r.raws.afterName=" ",r.params=a.createAnonymousLayerName());const s=someAtRuleInTree(r,(e=>isProcessableLayerRule(e))),n=someInTree(r,(e=>{if("rule"!==e.type)return!1;return getLayerAtRuleAncestor(e)===r}));if(s&&n){const e=a.createImplicitLayerName(r.params),t=r.clone({params:e});t.walkAtRules((e=>{isProcessableLayerRule(e)&&e.remove()})),r.walk((e=>{if("atrule"===e.type&&isProcessableLayerRule(e))return;if("atrule"===e.type&&o.includes(e.name.toLowerCase()))return;getLayerAtRuleAncestor(e)===r&&e.remove()})),r.append(t),removeEmptyDescendantBlocks(r),removeEmptyAncestorBlocks(r)}}))}function desugarNestedLayers(e,r){for(;someAtRuleInTree(e,(e=>!!e.nodes&&someAtRuleInTree(e,(e=>isProcessableLayerRule(e)))));){let t=!1;if(e.walkAtRules((a=>{if(isProcessableLayerRule(a)&&a.parent!==e){if("atrule"===a.parent?.type&&isProcessableLayerRule(a.parent)){const e=a.parent;{const t=r.layerNameParts.get(e.params),s=r.layerNameParts.get(a.params);if(!t||!s)return;r.layerNameParts.set(`${e.params}.${a.params}`,[...t,...s]),r.layerParamsParsed.set(`${e.params}.${a.params}`,[`${e.params}.${a.params}`])}return a.params=`${e.params}.${a.params}`,e.before(a),removeEmptyDescendantBlocks(e),void removeEmptyAncestorBlocks(e)}if("atrule"===a.parent?.type){const e=a.parent,r=e.clone(),t=a.clone();return r.removeAll(),t.removeAll(),r.append(a.nodes),t.append(r),e.before(t),a.remove(),removeEmptyDescendantBlocks(e),void removeEmptyAncestorBlocks(e)}t=!0}})),t)break}}function sortRootNodes(e,r){e.nodes&&(e.walkAtRules((e=>{if(!isProcessableLayerRule(e))return;const r=e.clone(),t=e.clone();r.walkAtRules((e=>{if(l.includes(e.name.toLowerCase())){const r=e.parent;return e.remove(),removeEmptyDescendantBlocks(r),void removeEmptyAncestorBlocks(r)}if(someInTree(e,(e=>"rule"===e.type)))return;const r=e.parent;e.remove(),removeEmptyDescendantBlocks(r),removeEmptyAncestorBlocks(r)})),t.walkRules((e=>{if(e.parent&&"atrule"===e.parent.type&&l.includes(e.parent.name.toLowerCase()))return;const r=e.parent;e.remove(),removeEmptyDescendantBlocks(r),removeEmptyAncestorBlocks(r)})),t.walkAtRules((e=>{if(o.includes(e.name.toLowerCase()))return removeEmptyDescendantBlocks(e),void removeEmptyAncestorBlocks(e)})),r.name=a,e.replaceWith(r,t),r.nodes?.length||r.remove(),t.nodes?.length||t.remove()})),e.nodes.sort(((e,t)=>{const a="atrule"===e.type&&u.test(e.name),s="atrule"===t.type&&u.test(t.name);if(a&&s){return(r.layerOrder.get(e.params)??0)-(r.layerOrder.get(t.params)??0)}return a!==s?a?-1:1:0})),e.walkAtRules(a,(e=>{e.name="layer"})))}function getConditionalAtRuleAncestor(e){let r=e.parent;for(;r;)if("atrule"===r.type){if(o.includes(r.name.toLowerCase()))return r;r=r.parent}else r=r.parent;return null}function recordLayerOrder(e,r,{result:t,options:a}){e.walkAtRules((e=>{if(!isProcessableLayerRule(e))return;const o=r.getLayerParams(e),l=o.join(".");r.layerOrder.has(l)||(a.onConditionalRulesChangingLayerOrder&&getConditionalAtRuleAncestor(e)&&!e.params.endsWith(n)&&!e.params.endsWith(s)&&e.warn(t,"handling different layer orders in conditional rules is unsupported by this plugin and will cause style differences between browser versions."),r.layerParamsParsed.has(l)||r.layerParamsParsed.set(l,[l]),r.layerNameParts.has(l)||r.layerNameParts.set(l,[...o]),r.getLayerNameList(l).forEach((e=>{r.layerOrder.has(e)||(r.layerOrder.set(e,r.layerCount),r.layerCount+=1)}))),e.nodes&&0!==e.nodes.length||e.remove()}))}function splitImportantStyles(e){e.walkDecls((e=>{if(!e.important)return;const r=e.parent;if(!r)return;if("atrule"===r?.parent?.type&&l.includes(r.parent.name.toLowerCase()))return;const t=r.clone();t.each((e=>{"decl"===e.type&&e.important||e.remove()})),r.each((e=>{"decl"===e.type&&e.important&&e.remove()})),r.before(t),removeEmptyDescendantBlocks(r)}))}const creator=a=>{const s=Object.assign({onRevertLayerKeyword:"warn",onConditionalRulesChangingLayerOrder:"warn",onImportLayerRule:"warn"},a);return{postcssPlugin:"postcss-cascade-layers",OnceExit(a,{result:n}){let o=!1;if((s.onRevertLayerKeyword||s.onImportLayerRule)&&a.walk((e=>"decl"===e.type?i.test(e.value)?void e.warn(n,'handling "revert-layer" is unsupported by this plugin and will cause style differences between browser versions.'):void 0:"atrule"===e.type?c.test(e.name)&&m.test(e.params)?void e.warn(n,"To use @import with layers, the postcss-import plugin is also required. This plugin alone will not support using the @import at-rule."):u.test(e.name)?void(o=!0):void 0:void 0)),!o)return;splitImportantStyles(a);const y=new Model;if(desugarAndParseLayerNames(a,y),recordLayerOrder(a,y,{result:n,options:s}),!y.layerCount)return void a.walkAtRules(t,(e=>{e.name="layer"}));let p=0;for(a.walkRules((t=>{t.selectors.forEach((a=>{try{const t=r(e().astSync(a));p=Math.max(p,t.a+1)}catch(e){t.warn(n,`Failed to parse selector : "${a}" with message: "${e instanceof Error?e.message:e}"`)}}))})),a.walkRules((e=>{e.parent&&"atrule"===e.parent.type&&l.includes(e.parent.name.toLowerCase())||getLayerAtRuleAncestor(e)||e.some((e=>"decl"===e.type&&e.important))||(e.selectors=e.selectors.map((r=>{try{return adjustSelectorSpecificity(r,y.layerCount*p)}catch(t){e.warn(n,`Failed to parse selector : "${r}" with message: "${t instanceof Error?t.message:t}"`)}return r})))})),y.sortLayerNames(),desugarNestedLayers(a,y),sortRootNodes(a,y),a.walkRules((e=>{if(e.parent&&"atrule"===e.parent.type&&l.includes(e.parent.name.toLowerCase()))return;const r=getLayerAtRuleAncestor(e);if(!r)return;const t=y.getLayerParams(r).join(".");let a=(y.layerOrder.get(t)??0)*p;e.some((e=>"decl"===e.type&&e.important))&&(a=y.layerCount-a),e.selectors=e.selectors.map((e=>adjustSelectorSpecificity(e,a)))}));someAtRuleInTree(a,(e=>isProcessableLayerRule(e)));)a.walkAtRules((e=>{isProcessableLayerRule(e)&&(e.nodes?e.replaceWith(e.nodes):e.remove())}));a.walkAtRules(t,(e=>{e.name="layer"}))}}};creator.postcss=!0;export{creator as default};
diff --git a/node_modules/@csstools/postcss-cascade-layers/package.json b/node_modules/@csstools/postcss-cascade-layers/package.json
index a0bc9cd1..570271e3 100644
--- a/node_modules/@csstools/postcss-cascade-layers/package.json
+++ b/node_modules/@csstools/postcss-cascade-layers/package.json
@@ -1,7 +1,7 @@
{
"name": "@csstools/postcss-cascade-layers",
"description": "Use cascade layers in CSS",
- "version": "4.0.2",
+ "version": "4.0.6",
"contributors": [
{
"name": "Olu Niyi-Awosusi",
@@ -56,7 +56,7 @@
"dist"
],
"dependencies": {
- "@csstools/selector-specificity": "^3.0.1",
+ "@csstools/selector-specificity": "^3.1.1",
"postcss-selector-parser": "^6.0.13"
},
"peerDependencies": {
@@ -65,7 +65,7 @@
"homepage": "https://github.com/csstools/postcss-plugins/tree/main/plugins/postcss-cascade-layers#readme",
"repository": {
"type": "git",
- "url": "https://github.com/csstools/postcss-plugins.git",
+ "url": "git+https://github.com/csstools/postcss-plugins.git",
"directory": "plugins/postcss-cascade-layers"
},
"bugs": "https://github.com/csstools/postcss-plugins/issues",
diff --git a/node_modules/@csstools/postcss-color-function/CHANGELOG.md b/node_modules/@csstools/postcss-color-function/CHANGELOG.md
index 65d1ad39..fc1b2fad 100644
--- a/node_modules/@csstools/postcss-color-function/CHANGELOG.md
+++ b/node_modules/@csstools/postcss-color-function/CHANGELOG.md
@@ -1,28 +1,25 @@
# Changes to PostCSS Color Function
-### 3.0.9
+### 3.0.16
-_December 31, 2023_
+_May 4, 2024_
-- Updated [`@csstools/css-tokenizer`](https://github.com/csstools/postcss-plugins/tree/main/packages/css-tokenizer) to [`2.2.3`](https://github.com/csstools/postcss-plugins/tree/main/packages/css-tokenizer/CHANGELOG.md#223) (patch)
-- Updated [`@csstools/css-parser-algorithms`](https://github.com/csstools/postcss-plugins/tree/main/packages/css-parser-algorithms) to [`2.5.0`](https://github.com/csstools/postcss-plugins/tree/main/packages/css-parser-algorithms/CHANGELOG.md#250) (minor)
-- Updated [`@csstools/css-color-parser`](https://github.com/csstools/postcss-plugins/tree/main/packages/css-color-parser) to [`1.5.1`](https://github.com/csstools/postcss-plugins/tree/main/packages/css-color-parser/CHANGELOG.md#151) (patch)
+- Updated [`@csstools/css-tokenizer`](https://github.com/csstools/postcss-plugins/tree/main/packages/css-tokenizer) to [`2.3.1`](https://github.com/csstools/postcss-plugins/tree/main/packages/css-tokenizer/CHANGELOG.md#231) (patch)
+- Updated [`@csstools/css-parser-algorithms`](https://github.com/csstools/postcss-plugins/tree/main/packages/css-parser-algorithms) to [`2.6.3`](https://github.com/csstools/postcss-plugins/tree/main/packages/css-parser-algorithms/CHANGELOG.md#263) (patch)
+- Updated [`@csstools/css-color-parser`](https://github.com/csstools/postcss-plugins/tree/main/packages/css-color-parser) to [`2.0.2`](https://github.com/csstools/postcss-plugins/tree/main/packages/css-color-parser/CHANGELOG.md#202) (patch)
-### 3.0.8
+### 3.0.15
-_December 15, 2023_
+_May 4, 2024_
-- Skip transforms when a color value contains experimental syntax
-- Updated [`@csstools/css-tokenizer`](https://github.com/csstools/postcss-plugins/tree/main/packages/css-tokenizer) to [`2.2.2`](https://github.com/csstools/postcss-plugins/tree/main/packages/css-tokenizer/CHANGELOG.md#222) (patch)
-- Updated [`@csstools/css-parser-algorithms`](https://github.com/csstools/postcss-plugins/tree/main/packages/css-parser-algorithms) to [`2.4.0`](https://github.com/csstools/postcss-plugins/tree/main/packages/css-parser-algorithms/CHANGELOG.md#240) (minor)
-- Updated [`@csstools/postcss-progressive-custom-properties`](https://github.com/csstools/postcss-plugins/tree/main/plugins/postcss-progressive-custom-properties) to [`3.0.3`](https://github.com/csstools/postcss-plugins/tree/main/plugins/postcss-progressive-custom-properties/CHANGELOG.md#303) (patch)
-- Updated [`@csstools/css-color-parser`](https://github.com/csstools/postcss-plugins/tree/main/packages/css-color-parser) to [`1.5.0`](https://github.com/csstools/postcss-plugins/tree/main/packages/css-color-parser/CHANGELOG.md#150) (minor)
+- Updated [`@csstools/css-tokenizer`](https://github.com/csstools/postcss-plugins/tree/main/packages/css-tokenizer) to [`2.3.0`](https://github.com/csstools/postcss-plugins/tree/main/packages/css-tokenizer/CHANGELOG.md#230) (minor)
+- Updated [`@csstools/css-parser-algorithms`](https://github.com/csstools/postcss-plugins/tree/main/packages/css-parser-algorithms) to [`2.6.2`](https://github.com/csstools/postcss-plugins/tree/main/packages/css-parser-algorithms/CHANGELOG.md#262) (patch)
+- Updated [`@csstools/css-color-parser`](https://github.com/csstools/postcss-plugins/tree/main/packages/css-color-parser) to [`2.0.1`](https://github.com/csstools/postcss-plugins/tree/main/packages/css-color-parser/CHANGELOG.md#201) (patch)
-### 3.0.7
+### 3.0.14
-_October 9, 2023_
+_April 21, 2024_
-- Updated [`@csstools/css-color-parser`](https://github.com/csstools/postcss-plugins/tree/main/packages/css-color-parser) to [`1.4.0`](https://github.com/csstools/postcss-plugins/tree/main/packages/css-color-parser/CHANGELOG.md#140) (minor)
-- Updated [`@csstools/postcss-progressive-custom-properties`](https://github.com/csstools/postcss-plugins/tree/main/plugins/postcss-progressive-custom-properties) to [`3.0.2`](https://github.com/csstools/postcss-plugins/tree/main/plugins/postcss-progressive-custom-properties/CHANGELOG.md#302) (patch)
+- Updated [`@csstools/css-color-parser`](https://github.com/csstools/postcss-plugins/tree/main/packages/css-color-parser) to [`2.0.0`](https://github.com/csstools/postcss-plugins/tree/main/packages/css-color-parser/CHANGELOG.md#200) (major)
[Full CHANGELOG](https://github.com/csstools/postcss-plugins/tree/main/plugins/postcss-color-function/CHANGELOG.md)
diff --git a/node_modules/@csstools/postcss-color-function/README.md b/node_modules/@csstools/postcss-color-function/README.md
index 61f51b92..92215353 100644
--- a/node_modules/@csstools/postcss-color-function/README.md
+++ b/node_modules/@csstools/postcss-color-function/README.md
@@ -90,7 +90,7 @@ postcssColorFunction({ preserve: true })
--a-color: rgb(164, 49, 43);
}
-@supports (color: color(display-p3 0 0 0)) {
+@supports (color: color(display-p3 0 0 0%)) {
:root {
--a-color: color(srgb 0.64331 0.19245 0.16771);
}
diff --git a/node_modules/@csstools/postcss-color-function/dist/index.cjs b/node_modules/@csstools/postcss-color-function/dist/index.cjs
index 31619c18..608715ec 100644
--- a/node_modules/@csstools/postcss-color-function/dist/index.cjs
+++ b/node_modules/@csstools/postcss-color-function/dist/index.cjs
@@ -1 +1 @@
-"use strict";var s=require("@csstools/postcss-progressive-custom-properties"),e=require("@csstools/css-tokenizer"),r=require("@csstools/css-color-parser"),t=require("@csstools/css-parser-algorithms");function hasFallback(s){const e=s.parent;if(!e)return!1;const r=s.prop.toLowerCase(),t=e.index(s);for(let s=0;s<t;s++){const t=e.nodes[s];if("decl"===t.type&&t.prop.toLowerCase()===r)return!0}return!1}function hasSupportsAtRuleAncestor(s){let e=s.parent;for(;e;)if("atrule"===e.type){if("supports"===e.name&&-1!==e.params.indexOf("color("))return!0;e=e.parent}else e=e.parent;return!1}const o=/(color)\(/i,n=/^(color)$/i,basePlugin=s=>({postcssPlugin:"postcss-color-function",Declaration:a=>{const c=a.value;if(!o.test(c))return;if(hasFallback(a))return;if(hasSupportsAtRuleAncestor(a))return;const l=e.tokenize({css:c}),i=t.replaceComponentValues(t.parseCommaSeparatedListOfComponentValues(l),(s=>{if(!t.isFunctionNode(s)||!n.test(s.getName()))return;const e=r.color(s);return e&&!(e.syntaxFlags.has(r.SyntaxFlag.Experimental)||e.syntaxFlags.has(r.SyntaxFlag.HasNoneKeywords)||e.syntaxFlags.has(r.SyntaxFlag.RelativeColorSyntax))?r.serializeRGB(e):void 0})),p=t.stringify(i);p!==c&&(a.cloneBefore({value:p}),s?.preserve||a.remove())}});basePlugin.postcss=!0;const postcssPlugin=e=>{const r=Object.assign({preserve:!1,enableProgressiveCustomProperties:!0},e);return r.enableProgressiveCustomProperties&&r.preserve?{postcssPlugin:"postcss-color-function",plugins:[s(),basePlugin(r)]}:basePlugin(r)};postcssPlugin.postcss=!0,module.exports=postcssPlugin;
+"use strict";var s=require("@csstools/postcss-progressive-custom-properties"),e=require("@csstools/css-tokenizer"),o=require("@csstools/css-color-parser"),r=require("@csstools/utilities"),t=require("@csstools/css-parser-algorithms");const a=/\b(?:color)\(/i,n=/^(?:color)$/i,basePlugin=s=>({postcssPlugin:"postcss-color-function",Declaration(i){const c=i.value;if(!a.test(c))return;if(r.hasFallback(i))return;if(r.hasSupportsAtRuleAncestor(i,a))return;const l=e.tokenize({css:c}),u=t.replaceComponentValues(t.parseCommaSeparatedListOfComponentValues(l),(s=>{if(!t.isFunctionNode(s)||!n.test(s.getName()))return;const e=o.color(s);return e&&!(e.syntaxFlags.has(o.SyntaxFlag.Experimental)||e.syntaxFlags.has(o.SyntaxFlag.HasNoneKeywords)||e.syntaxFlags.has(o.SyntaxFlag.RelativeColorSyntax))?o.serializeRGB(e):void 0})),p=t.stringify(u);p!==c&&(i.cloneBefore({value:p}),s?.preserve||i.remove())}});basePlugin.postcss=!0;const postcssPlugin=e=>{const o=Object.assign({preserve:!1,enableProgressiveCustomProperties:!0},e);return o.enableProgressiveCustomProperties&&o.preserve?{postcssPlugin:"postcss-color-function",plugins:[s(),basePlugin(o)]}:basePlugin(o)};postcssPlugin.postcss=!0,module.exports=postcssPlugin;
diff --git a/node_modules/@csstools/postcss-color-function/dist/index.mjs b/node_modules/@csstools/postcss-color-function/dist/index.mjs
index a5b645da..d1cf0967 100644
--- a/node_modules/@csstools/postcss-color-function/dist/index.mjs
+++ b/node_modules/@csstools/postcss-color-function/dist/index.mjs
@@ -1 +1 @@
-import s from"@csstools/postcss-progressive-custom-properties";import{tokenize as e}from"@csstools/css-tokenizer";import{color as r,SyntaxFlag as o,serializeRGB as t}from"@csstools/css-color-parser";import{replaceComponentValues as n,parseCommaSeparatedListOfComponentValues as a,isFunctionNode as c,stringify as p}from"@csstools/css-parser-algorithms";function hasFallback(s){const e=s.parent;if(!e)return!1;const r=s.prop.toLowerCase(),o=e.index(s);for(let s=0;s<o;s++){const o=e.nodes[s];if("decl"===o.type&&o.prop.toLowerCase()===r)return!0}return!1}function hasSupportsAtRuleAncestor(s){let e=s.parent;for(;e;)if("atrule"===e.type){if("supports"===e.name&&-1!==e.params.indexOf("color("))return!0;e=e.parent}else e=e.parent;return!1}const l=/(color)\(/i,i=/^(color)$/i,basePlugin=s=>({postcssPlugin:"postcss-color-function",Declaration:u=>{const f=u.value;if(!l.test(f))return;if(hasFallback(u))return;if(hasSupportsAtRuleAncestor(u))return;const m=e({css:f}),g=n(a(m),(s=>{if(!c(s)||!i.test(s.getName()))return;const e=r(s);return e&&!(e.syntaxFlags.has(o.Experimental)||e.syntaxFlags.has(o.HasNoneKeywords)||e.syntaxFlags.has(o.RelativeColorSyntax))?t(e):void 0})),v=p(g);v!==f&&(u.cloneBefore({value:v}),s?.preserve||u.remove())}});basePlugin.postcss=!0;const postcssPlugin=e=>{const r=Object.assign({preserve:!1,enableProgressiveCustomProperties:!0},e);return r.enableProgressiveCustomProperties&&r.preserve?{postcssPlugin:"postcss-color-function",plugins:[s(),basePlugin(r)]}:basePlugin(r)};postcssPlugin.postcss=!0;export{postcssPlugin as default};
+import s from"@csstools/postcss-progressive-custom-properties";import{tokenize as o}from"@csstools/css-tokenizer";import{color as r,SyntaxFlag as e,serializeRGB as t}from"@csstools/css-color-parser";import{hasFallback as c,hasSupportsAtRuleAncestor as i}from"@csstools/utilities";import{replaceComponentValues as n,parseCommaSeparatedListOfComponentValues as l,isFunctionNode as a,stringify as p}from"@csstools/css-parser-algorithms";const u=/\b(?:color)\(/i,m=/^(?:color)$/i,basePlugin=s=>({postcssPlugin:"postcss-color-function",Declaration(f){const g=f.value;if(!u.test(g))return;if(c(f))return;if(i(f,u))return;const v=o({css:g}),x=n(l(v),(s=>{if(!a(s)||!m.test(s.getName()))return;const o=r(s);return o&&!(o.syntaxFlags.has(e.Experimental)||o.syntaxFlags.has(e.HasNoneKeywords)||o.syntaxFlags.has(e.RelativeColorSyntax))?t(o):void 0})),P=p(x);P!==g&&(f.cloneBefore({value:P}),s?.preserve||f.remove())}});basePlugin.postcss=!0;const postcssPlugin=o=>{const r=Object.assign({preserve:!1,enableProgressiveCustomProperties:!0},o);return r.enableProgressiveCustomProperties&&r.preserve?{postcssPlugin:"postcss-color-function",plugins:[s(),basePlugin(r)]}:basePlugin(r)};postcssPlugin.postcss=!0;export{postcssPlugin as default};
diff --git a/node_modules/@csstools/postcss-color-function/package.json b/node_modules/@csstools/postcss-color-function/package.json
index 68235e7f..805d3a38 100644
--- a/node_modules/@csstools/postcss-color-function/package.json
+++ b/node_modules/@csstools/postcss-color-function/package.json
@@ -1,7 +1,7 @@
{
"name": "@csstools/postcss-color-function",
"description": "Use the color() function in CSS",
- "version": "3.0.9",
+ "version": "3.0.16",
"author": "Jonathan Neal <jonathantneal@hotmail.com>",
"license": "MIT-0",
"funding": [
@@ -38,10 +38,11 @@
"dist"
],
"dependencies": {
- "@csstools/css-color-parser": "^1.5.1",
- "@csstools/css-parser-algorithms": "^2.5.0",
- "@csstools/css-tokenizer": "^2.2.3",
- "@csstools/postcss-progressive-custom-properties": "^3.0.3"
+ "@csstools/css-color-parser": "^2.0.2",
+ "@csstools/css-parser-algorithms": "^2.6.3",
+ "@csstools/css-tokenizer": "^2.3.1",
+ "@csstools/postcss-progressive-custom-properties": "^3.2.0",
+ "@csstools/utilities": "^1.0.0"
},
"peerDependencies": {
"postcss": "^8.4"
@@ -49,7 +50,7 @@
"homepage": "https://github.com/csstools/postcss-plugins/tree/main/plugins/postcss-color-function#readme",
"repository": {
"type": "git",
- "url": "https://github.com/csstools/postcss-plugins.git",
+ "url": "git+https://github.com/csstools/postcss-plugins.git",
"directory": "plugins/postcss-color-function"
},
"bugs": "https://github.com/csstools/postcss-plugins/issues",
diff --git a/node_modules/@csstools/postcss-color-mix-function/CHANGELOG.md b/node_modules/@csstools/postcss-color-mix-function/CHANGELOG.md
index e71587b7..b4db7a7f 100644
--- a/node_modules/@csstools/postcss-color-mix-function/CHANGELOG.md
+++ b/node_modules/@csstools/postcss-color-mix-function/CHANGELOG.md
@@ -1,28 +1,25 @@
# Changes to PostCSS Color Mix Function
-### 2.0.9
+### 2.0.16
-_December 31, 2023_
+_May 4, 2024_
-- Updated [`@csstools/css-tokenizer`](https://github.com/csstools/postcss-plugins/tree/main/packages/css-tokenizer) to [`2.2.3`](https://github.com/csstools/postcss-plugins/tree/main/packages/css-tokenizer/CHANGELOG.md#223) (patch)
-- Updated [`@csstools/css-parser-algorithms`](https://github.com/csstools/postcss-plugins/tree/main/packages/css-parser-algorithms) to [`2.5.0`](https://github.com/csstools/postcss-plugins/tree/main/packages/css-parser-algorithms/CHANGELOG.md#250) (minor)
-- Updated [`@csstools/css-color-parser`](https://github.com/csstools/postcss-plugins/tree/main/packages/css-color-parser) to [`1.5.1`](https://github.com/csstools/postcss-plugins/tree/main/packages/css-color-parser/CHANGELOG.md#151) (patch)
+- Updated [`@csstools/css-tokenizer`](https://github.com/csstools/postcss-plugins/tree/main/packages/css-tokenizer) to [`2.3.1`](https://github.com/csstools/postcss-plugins/tree/main/packages/css-tokenizer/CHANGELOG.md#231) (patch)
+- Updated [`@csstools/css-parser-algorithms`](https://github.com/csstools/postcss-plugins/tree/main/packages/css-parser-algorithms) to [`2.6.3`](https://github.com/csstools/postcss-plugins/tree/main/packages/css-parser-algorithms/CHANGELOG.md#263) (patch)
+- Updated [`@csstools/css-color-parser`](https://github.com/csstools/postcss-plugins/tree/main/packages/css-color-parser) to [`2.0.2`](https://github.com/csstools/postcss-plugins/tree/main/packages/css-color-parser/CHANGELOG.md#202) (patch)
-### 2.0.8
+### 2.0.15
-_December 15, 2023_
+_May 4, 2024_
-- Skip transforms when a color value contains experimental syntax
-- Updated [`@csstools/css-tokenizer`](https://github.com/csstools/postcss-plugins/tree/main/packages/css-tokenizer) to [`2.2.2`](https://github.com/csstools/postcss-plugins/tree/main/packages/css-tokenizer/CHANGELOG.md#222) (patch)
-- Updated [`@csstools/css-parser-algorithms`](https://github.com/csstools/postcss-plugins/tree/main/packages/css-parser-algorithms) to [`2.4.0`](https://github.com/csstools/postcss-plugins/tree/main/packages/css-parser-algorithms/CHANGELOG.md#240) (minor)
-- Updated [`@csstools/postcss-progressive-custom-properties`](https://github.com/csstools/postcss-plugins/tree/main/plugins/postcss-progressive-custom-properties) to [`3.0.3`](https://github.com/csstools/postcss-plugins/tree/main/plugins/postcss-progressive-custom-properties/CHANGELOG.md#303) (patch)
-- Updated [`@csstools/css-color-parser`](https://github.com/csstools/postcss-plugins/tree/main/packages/css-color-parser) to [`1.5.0`](https://github.com/csstools/postcss-plugins/tree/main/packages/css-color-parser/CHANGELOG.md#150) (minor)
+- Updated [`@csstools/css-tokenizer`](https://github.com/csstools/postcss-plugins/tree/main/packages/css-tokenizer) to [`2.3.0`](https://github.com/csstools/postcss-plugins/tree/main/packages/css-tokenizer/CHANGELOG.md#230) (minor)
+- Updated [`@csstools/css-parser-algorithms`](https://github.com/csstools/postcss-plugins/tree/main/packages/css-parser-algorithms) to [`2.6.2`](https://github.com/csstools/postcss-plugins/tree/main/packages/css-parser-algorithms/CHANGELOG.md#262) (patch)
+- Updated [`@csstools/css-color-parser`](https://github.com/csstools/postcss-plugins/tree/main/packages/css-color-parser) to [`2.0.1`](https://github.com/csstools/postcss-plugins/tree/main/packages/css-color-parser/CHANGELOG.md#201) (patch)
-### 2.0.7
+### 2.0.14
-_October 9, 2023_
+_April 21, 2024_
-- Updated [`@csstools/css-color-parser`](https://github.com/csstools/postcss-plugins/tree/main/packages/css-color-parser) to [`1.4.0`](https://github.com/csstools/postcss-plugins/tree/main/packages/css-color-parser/CHANGELOG.md#140) (minor)
-- Updated [`@csstools/postcss-progressive-custom-properties`](https://github.com/csstools/postcss-plugins/tree/main/plugins/postcss-progressive-custom-properties) to [`3.0.2`](https://github.com/csstools/postcss-plugins/tree/main/plugins/postcss-progressive-custom-properties/CHANGELOG.md#302) (patch)
+- Updated [`@csstools/css-color-parser`](https://github.com/csstools/postcss-plugins/tree/main/packages/css-color-parser) to [`2.0.0`](https://github.com/csstools/postcss-plugins/tree/main/packages/css-color-parser/CHANGELOG.md#200) (major)
[Full CHANGELOG](https://github.com/csstools/postcss-plugins/tree/main/plugins/postcss-color-mix-function/CHANGELOG.md)
diff --git a/node_modules/@csstools/postcss-color-mix-function/dist/index.cjs b/node_modules/@csstools/postcss-color-mix-function/dist/index.cjs
index 70944027..f539e761 100644
--- a/node_modules/@csstools/postcss-color-mix-function/dist/index.cjs
+++ b/node_modules/@csstools/postcss-color-mix-function/dist/index.cjs
@@ -1 +1 @@
-"use strict";var e=require("@csstools/postcss-progressive-custom-properties"),s=require("@csstools/css-tokenizer"),r=require("@csstools/css-color-parser"),t=require("@csstools/css-parser-algorithms");function hasFallback(e){const s=e.parent;if(!s)return!1;const r=e.prop.toLowerCase(),t=s.index(e);for(let e=0;e<t;e++){const t=s.nodes[e];if("decl"===t.type&&t.prop.toLowerCase()===r)return!0}return!1}function hasSupportsAtRuleAncestor(e){let s=e.parent;for(;s;)if("atrule"===s.type){if("supports"===s.name.toLowerCase()&&-1!==s.params.toLowerCase().indexOf("color-mix("))return!0;s=s.parent}else s=s.parent;return!1}const o=/(color-mix)\(/i,a=/^(color-mix)$/i,basePlugin=e=>({postcssPlugin:"postcss-color-mix-function",Declaration:n=>{const i=n.value;if(!o.test(i))return;if(hasFallback(n))return;if(hasSupportsAtRuleAncestor(n))return;const l=s.tokenize({css:i}),u=t.replaceComponentValues(t.parseCommaSeparatedListOfComponentValues(l),(e=>{if(!t.isFunctionNode(e)||!a.test(e.getName()))return;const s=r.color(e);return s&&!s.syntaxFlags.has(r.SyntaxFlag.Experimental)?r.serializeRGB(s):void 0})),c=t.stringify(u);if(c===i)return;let p=c;e?.subFeatures.displayP3&&(p=t.stringify(t.replaceComponentValues(t.parseCommaSeparatedListOfComponentValues(l),(e=>{if(!t.isFunctionNode(e)||!a.test(e.getName()))return;const s=r.color(e);return s&&!s.syntaxFlags.has(r.SyntaxFlag.Experimental)?r.colorDataFitsRGB_Gamut(s)?r.serializeRGB(s):r.serializeP3(s):void 0})))),n.cloneBefore({value:c}),e?.subFeatures.displayP3&&p!==c&&n.cloneBefore({value:p}),e?.preserve||n.remove()}});basePlugin.postcss=!0;const postcssPlugin=s=>{const r=Object.assign({enableProgressiveCustomProperties:!0,preserve:!1,subFeatures:{displayP3:!0}},s);return r.subFeatures=Object.assign({displayP3:!0},r.subFeatures),r.enableProgressiveCustomProperties&&(r.preserve||r.subFeatures.displayP3)?{postcssPlugin:"postcss-color-mix-function",plugins:[e(),basePlugin(r)]}:basePlugin(r)};postcssPlugin.postcss=!0,module.exports=postcssPlugin;
+"use strict";var s=require("@csstools/postcss-progressive-custom-properties"),e=require("@csstools/css-color-parser"),r=require("@csstools/utilities"),t=require("@csstools/css-parser-algorithms"),o=require("@csstools/css-tokenizer");const i=/\b(?:color-mix)\(/i,a=/^(?:color-mix)$/i,basePlugin=s=>({postcssPlugin:"postcss-color-mix-function",Declaration(n){const l=n.value;if(!i.test(l))return;if(r.hasFallback(n))return;if(r.hasSupportsAtRuleAncestor(n,i))return;const u=o.tokenize({css:l}),c=t.replaceComponentValues(t.parseCommaSeparatedListOfComponentValues(u),(s=>{if(!t.isFunctionNode(s)||!a.test(s.getName()))return;const r=e.color(s);return r&&!r.syntaxFlags.has(e.SyntaxFlag.Experimental)?e.serializeRGB(r):void 0})),p=t.stringify(c);if(p===l)return;let m=p;s?.subFeatures.displayP3&&(m=t.stringify(t.replaceComponentValues(t.parseCommaSeparatedListOfComponentValues(u),(s=>{if(!t.isFunctionNode(s)||!a.test(s.getName()))return;const r=e.color(s);return r&&!r.syntaxFlags.has(e.SyntaxFlag.Experimental)?e.colorDataFitsRGB_Gamut(r)?e.serializeRGB(r):e.serializeP3(r):void 0})))),n.cloneBefore({value:p}),s?.subFeatures.displayP3&&m!==p&&n.cloneBefore({value:m}),s?.preserve||n.remove()}});basePlugin.postcss=!0;const postcssPlugin=e=>{const r=Object.assign({enableProgressiveCustomProperties:!0,preserve:!1,subFeatures:{displayP3:!0}},e);return r.subFeatures=Object.assign({displayP3:!0},r.subFeatures),r.enableProgressiveCustomProperties&&(r.preserve||r.subFeatures.displayP3)?{postcssPlugin:"postcss-color-mix-function",plugins:[s(),basePlugin(r)]}:basePlugin(r)};postcssPlugin.postcss=!0,module.exports=postcssPlugin;
diff --git a/node_modules/@csstools/postcss-color-mix-function/dist/index.mjs b/node_modules/@csstools/postcss-color-mix-function/dist/index.mjs
index 871d81a9..1996ee7f 100644
--- a/node_modules/@csstools/postcss-color-mix-function/dist/index.mjs
+++ b/node_modules/@csstools/postcss-color-mix-function/dist/index.mjs
@@ -1 +1 @@
-import s from"@csstools/postcss-progressive-custom-properties";import{tokenize as e}from"@csstools/css-tokenizer";import{color as r,SyntaxFlag as t,serializeRGB as o,colorDataFitsRGB_Gamut as n,serializeP3 as a}from"@csstools/css-color-parser";import{replaceComponentValues as i,parseCommaSeparatedListOfComponentValues as p,isFunctionNode as c,stringify as u}from"@csstools/css-parser-algorithms";function hasFallback(s){const e=s.parent;if(!e)return!1;const r=s.prop.toLowerCase(),t=e.index(s);for(let s=0;s<t;s++){const t=e.nodes[s];if("decl"===t.type&&t.prop.toLowerCase()===r)return!0}return!1}function hasSupportsAtRuleAncestor(s){let e=s.parent;for(;e;)if("atrule"===e.type){if("supports"===e.name.toLowerCase()&&-1!==e.params.toLowerCase().indexOf("color-mix("))return!0;e=e.parent}else e=e.parent;return!1}const l=/(color-mix)\(/i,f=/^(color-mix)$/i,basePlugin=s=>({postcssPlugin:"postcss-color-mix-function",Declaration:m=>{const g=m.value;if(!l.test(g))return;if(hasFallback(m))return;if(hasSupportsAtRuleAncestor(m))return;const b=e({css:g}),d=i(p(b),(s=>{if(!c(s)||!f.test(s.getName()))return;const e=r(s);return e&&!e.syntaxFlags.has(t.Experimental)?o(e):void 0})),v=u(d);if(v===g)return;let x=v;s?.subFeatures.displayP3&&(x=u(i(p(b),(s=>{if(!c(s)||!f.test(s.getName()))return;const e=r(s);return e&&!e.syntaxFlags.has(t.Experimental)?n(e)?o(e):a(e):void 0})))),m.cloneBefore({value:v}),s?.subFeatures.displayP3&&x!==v&&m.cloneBefore({value:x}),s?.preserve||m.remove()}});basePlugin.postcss=!0;const postcssPlugin=e=>{const r=Object.assign({enableProgressiveCustomProperties:!0,preserve:!1,subFeatures:{displayP3:!0}},e);return r.subFeatures=Object.assign({displayP3:!0},r.subFeatures),r.enableProgressiveCustomProperties&&(r.preserve||r.subFeatures.displayP3)?{postcssPlugin:"postcss-color-mix-function",plugins:[s(),basePlugin(r)]}:basePlugin(r)};postcssPlugin.postcss=!0;export{postcssPlugin as default};
+import s from"@csstools/postcss-progressive-custom-properties";import{color as e,SyntaxFlag as r,serializeRGB as t,colorDataFitsRGB_Gamut as o,serializeP3 as i}from"@csstools/css-color-parser";import{hasFallback as c,hasSupportsAtRuleAncestor as a}from"@csstools/utilities";import{replaceComponentValues as n,parseCommaSeparatedListOfComponentValues as l,isFunctionNode as u,stringify as p}from"@csstools/css-parser-algorithms";import{tokenize as m}from"@csstools/css-tokenizer";const f=/\b(?:color-mix)\(/i,g=/^(?:color-mix)$/i,basePlugin=s=>({postcssPlugin:"postcss-color-mix-function",Declaration(v){const b=v.value;if(!f.test(b))return;if(c(v))return;if(a(v,f))return;const P=m({css:b}),x=n(l(P),(s=>{if(!u(s)||!g.test(s.getName()))return;const o=e(s);return o&&!o.syntaxFlags.has(r.Experimental)?t(o):void 0})),d=p(x);if(d===b)return;let F=d;s?.subFeatures.displayP3&&(F=p(n(l(P),(s=>{if(!u(s)||!g.test(s.getName()))return;const c=e(s);return c&&!c.syntaxFlags.has(r.Experimental)?o(c)?t(c):i(c):void 0})))),v.cloneBefore({value:d}),s?.subFeatures.displayP3&&F!==d&&v.cloneBefore({value:F}),s?.preserve||v.remove()}});basePlugin.postcss=!0;const postcssPlugin=e=>{const r=Object.assign({enableProgressiveCustomProperties:!0,preserve:!1,subFeatures:{displayP3:!0}},e);return r.subFeatures=Object.assign({displayP3:!0},r.subFeatures),r.enableProgressiveCustomProperties&&(r.preserve||r.subFeatures.displayP3)?{postcssPlugin:"postcss-color-mix-function",plugins:[s(),basePlugin(r)]}:basePlugin(r)};postcssPlugin.postcss=!0;export{postcssPlugin as default};
diff --git a/node_modules/@csstools/postcss-color-mix-function/package.json b/node_modules/@csstools/postcss-color-mix-function/package.json
index 603d7005..9780e670 100644
--- a/node_modules/@csstools/postcss-color-mix-function/package.json
+++ b/node_modules/@csstools/postcss-color-mix-function/package.json
@@ -1,7 +1,7 @@
{
"name": "@csstools/postcss-color-mix-function",
"description": "Use the color-mix function in CSS",
- "version": "2.0.9",
+ "version": "2.0.16",
"contributors": [
{
"name": "Antonio Laguna",
@@ -48,10 +48,11 @@
"dist"
],
"dependencies": {
- "@csstools/css-color-parser": "^1.5.1",
- "@csstools/css-parser-algorithms": "^2.5.0",
- "@csstools/css-tokenizer": "^2.2.3",
- "@csstools/postcss-progressive-custom-properties": "^3.0.3"
+ "@csstools/css-color-parser": "^2.0.2",
+ "@csstools/css-parser-algorithms": "^2.6.3",
+ "@csstools/css-tokenizer": "^2.3.1",
+ "@csstools/postcss-progressive-custom-properties": "^3.2.0",
+ "@csstools/utilities": "^1.0.0"
},
"peerDependencies": {
"postcss": "^8.4"
@@ -59,7 +60,7 @@
"homepage": "https://github.com/csstools/postcss-plugins/tree/main/plugins/postcss-color-mix-function#readme",
"repository": {
"type": "git",
- "url": "https://github.com/csstools/postcss-plugins.git",
+ "url": "git+https://github.com/csstools/postcss-plugins.git",
"directory": "plugins/postcss-color-mix-function"
},
"bugs": "https://github.com/csstools/postcss-plugins/issues",
diff --git a/node_modules/@csstools/postcss-exponential-functions/CHANGELOG.md b/node_modules/@csstools/postcss-exponential-functions/CHANGELOG.md
index d89e4509..4f836ca3 100644
--- a/node_modules/@csstools/postcss-exponential-functions/CHANGELOG.md
+++ b/node_modules/@csstools/postcss-exponential-functions/CHANGELOG.md
@@ -1,28 +1,27 @@
# Changes to PostCSS Exponential Functions
-### 1.0.3
+### 1.0.7
-_December 31, 2023_
+_May 4, 2024_
-- Updated [`@csstools/css-tokenizer`](https://github.com/csstools/postcss-plugins/tree/main/packages/css-tokenizer) to [`2.2.3`](https://github.com/csstools/postcss-plugins/tree/main/packages/css-tokenizer/CHANGELOG.md#223) (patch)
-- Updated [`@csstools/css-parser-algorithms`](https://github.com/csstools/postcss-plugins/tree/main/packages/css-parser-algorithms) to [`2.5.0`](https://github.com/csstools/postcss-plugins/tree/main/packages/css-parser-algorithms/CHANGELOG.md#250) (minor)
-- Updated [`@csstools/css-calc`](https://github.com/csstools/postcss-plugins/tree/main/packages/css-calc) to [`1.1.6`](https://github.com/csstools/postcss-plugins/tree/main/packages/css-calc/CHANGELOG.md#116) (patch)
+- Updated [`@csstools/css-tokenizer`](https://github.com/csstools/postcss-plugins/tree/main/packages/css-tokenizer) to [`2.3.1`](https://github.com/csstools/postcss-plugins/tree/main/packages/css-tokenizer/CHANGELOG.md#231) (patch)
+- Updated [`@csstools/css-parser-algorithms`](https://github.com/csstools/postcss-plugins/tree/main/packages/css-parser-algorithms) to [`2.6.3`](https://github.com/csstools/postcss-plugins/tree/main/packages/css-parser-algorithms/CHANGELOG.md#263) (patch)
+- Updated [`@csstools/css-calc`](https://github.com/csstools/postcss-plugins/tree/main/packages/css-calc) to [`1.2.2`](https://github.com/csstools/postcss-plugins/tree/main/packages/css-calc/CHANGELOG.md#122) (patch)
-### 1.0.2
+### 1.0.6
-_December 15, 2023_
+_May 4, 2024_
-- Fix type definitions
-- Updated [`@csstools/css-tokenizer`](https://github.com/csstools/postcss-plugins/tree/main/packages/css-tokenizer) to [`2.2.2`](https://github.com/csstools/postcss-plugins/tree/main/packages/css-tokenizer/CHANGELOG.md#222) (patch)
-- Updated [`@csstools/css-parser-algorithms`](https://github.com/csstools/postcss-plugins/tree/main/packages/css-parser-algorithms) to [`2.4.0`](https://github.com/csstools/postcss-plugins/tree/main/packages/css-parser-algorithms/CHANGELOG.md#240) (minor)
-- Updated [`@csstools/css-calc`](https://github.com/csstools/postcss-plugins/tree/main/packages/css-calc) to [`1.1.5`](https://github.com/csstools/postcss-plugins/tree/main/packages/css-calc/CHANGELOG.md#115) (patch)
+- Updated [`@csstools/css-tokenizer`](https://github.com/csstools/postcss-plugins/tree/main/packages/css-tokenizer) to [`2.3.0`](https://github.com/csstools/postcss-plugins/tree/main/packages/css-tokenizer/CHANGELOG.md#230) (minor)
+- Updated [`@csstools/css-parser-algorithms`](https://github.com/csstools/postcss-plugins/tree/main/packages/css-parser-algorithms) to [`2.6.2`](https://github.com/csstools/postcss-plugins/tree/main/packages/css-parser-algorithms/CHANGELOG.md#262) (patch)
+- Updated [`@csstools/css-calc`](https://github.com/csstools/postcss-plugins/tree/main/packages/css-calc) to [`1.2.1`](https://github.com/csstools/postcss-plugins/tree/main/packages/css-calc/CHANGELOG.md#121) (patch)
-### 1.0.1
+### 1.0.5
-_September 24, 2023_
+_March 13, 2024_
-- Updated [`@csstools/css-tokenizer`](https://github.com/csstools/postcss-plugins/tree/main/packages/css-tokenizer) to [`2.2.1`](https://github.com/csstools/postcss-plugins/tree/main/packages/css-tokenizer/CHANGELOG.md#221) (patch)
-- Updated [`@csstools/css-parser-algorithms`](https://github.com/csstools/postcss-plugins/tree/main/packages/css-parser-algorithms) to [`2.3.2`](https://github.com/csstools/postcss-plugins/tree/main/packages/css-parser-algorithms/CHANGELOG.md#232) (patch)
-- Updated [`@csstools/css-calc`](https://github.com/csstools/postcss-plugins/tree/main/packages/css-calc) to [`1.1.4`](https://github.com/csstools/postcss-plugins/tree/main/packages/css-calc/CHANGELOG.md#114) (patch)
+- Updated [`@csstools/css-tokenizer`](https://github.com/csstools/postcss-plugins/tree/main/packages/css-tokenizer) to [`2.2.4`](https://github.com/csstools/postcss-plugins/tree/main/packages/css-tokenizer/CHANGELOG.md#224) (patch)
+- Updated [`@csstools/css-parser-algorithms`](https://github.com/csstools/postcss-plugins/tree/main/packages/css-parser-algorithms) to [`2.6.1`](https://github.com/csstools/postcss-plugins/tree/main/packages/css-parser-algorithms/CHANGELOG.md#261) (patch)
+- Updated [`@csstools/css-calc`](https://github.com/csstools/postcss-plugins/tree/main/packages/css-calc) to [`1.2.0`](https://github.com/csstools/postcss-plugins/tree/main/packages/css-calc/CHANGELOG.md#120) (minor)
[Full CHANGELOG](https://github.com/csstools/postcss-plugins/tree/main/plugins/postcss-exponential-functions/CHANGELOG.md)
diff --git a/node_modules/@csstools/postcss-exponential-functions/package.json b/node_modules/@csstools/postcss-exponential-functions/package.json
index decb8014..38e4ed5c 100644
--- a/node_modules/@csstools/postcss-exponential-functions/package.json
+++ b/node_modules/@csstools/postcss-exponential-functions/package.json
@@ -1,7 +1,7 @@
{
"name": "@csstools/postcss-exponential-functions",
"description": "Use pow(), sqrt(), hypot(), log(), exp() exponential functions in CSS",
- "version": "1.0.3",
+ "version": "1.0.7",
"contributors": [
{
"name": "Antonio Laguna",
@@ -48,9 +48,9 @@
"dist"
],
"dependencies": {
- "@csstools/css-calc": "^1.1.6",
- "@csstools/css-parser-algorithms": "^2.5.0",
- "@csstools/css-tokenizer": "^2.2.3"
+ "@csstools/css-calc": "^1.2.2",
+ "@csstools/css-parser-algorithms": "^2.6.3",
+ "@csstools/css-tokenizer": "^2.3.1"
},
"peerDependencies": {
"postcss": "^8.4"
@@ -58,7 +58,7 @@
"homepage": "https://github.com/csstools/postcss-plugins/tree/main/plugins/postcss-exponential-functions#readme",
"repository": {
"type": "git",
- "url": "https://github.com/csstools/postcss-plugins.git",
+ "url": "git+https://github.com/csstools/postcss-plugins.git",
"directory": "plugins/postcss-exponential-functions"
},
"bugs": "https://github.com/csstools/postcss-plugins/issues",
diff --git a/node_modules/@csstools/postcss-font-format-keywords/CHANGELOG.md b/node_modules/@csstools/postcss-font-format-keywords/CHANGELOG.md
index 9714df58..693b76c5 100644
--- a/node_modules/@csstools/postcss-font-format-keywords/CHANGELOG.md
+++ b/node_modules/@csstools/postcss-font-format-keywords/CHANGELOG.md
@@ -1,5 +1,11 @@
# Changes to PostCSS Font Format
+### 3.0.2
+
+_February 19, 2024_
+
+- Reuse code with `@csstools/utilities`
+
### 3.0.1
_December 15, 2023_
@@ -12,10 +18,4 @@ _July 3, 2023_
- Change license to `MIT-0` ([read more about this change in the blog post](https://preset-env.cssdb.org/blog/license-change/))
-### 2.0.2
-
-_February 8, 2023_
-
-- Reduce the amount of duplicate fallback CSS.
-
[Full CHANGELOG](https://github.com/csstools/postcss-plugins/tree/main/plugins/postcss-font-format-keywords/CHANGELOG.md)
diff --git a/node_modules/@csstools/postcss-font-format-keywords/README.md b/node_modules/@csstools/postcss-font-format-keywords/README.md
index bf4927ee..80e94141 100644
--- a/node_modules/@csstools/postcss-font-format-keywords/README.md
+++ b/node_modules/@csstools/postcss-font-format-keywords/README.md
@@ -1,9 +1,11 @@
# PostCSS Font Format [<img src="https://postcss.github.io/postcss/logo.svg" alt="PostCSS Logo" width="90" height="90" align="right">][postcss]
[<img alt="npm version" src="https://img.shields.io/npm/v/@csstools/postcss-font-format-keywords.svg" height="20">][npm-url]
-[<img alt="CSS Standard Status" src="https://cssdb.org/images/badges/font-format-keywords.svg" height="20">][css-url]
[<img alt="Build Status" src="https://github.com/csstools/postcss-plugins/workflows/test/badge.svg" height="20">][cli-url]
[<img alt="Discord" src="https://shields.io/badge/Discord-5865F2?logo=discord&logoColor=white">][discord]
+<br><br>
+[<img alt="Baseline Status" src="https://cssdb.org/images/badges-baseline/font-format-keywords.svg" height="20">][css-url]
+[<img alt="CSS Standard Status" src="https://cssdb.org/images/badges/font-format-keywords.svg" height="20">][css-url]
[PostCSS Font Format Keywords] lets you specify font formats as keywords, following the [CSS Fonts] specification.
diff --git a/node_modules/@csstools/postcss-font-format-keywords/dist/index.cjs b/node_modules/@csstools/postcss-font-format-keywords/dist/index.cjs
index a14a3a26..c05d8bf0 100644
--- a/node_modules/@csstools/postcss-font-format-keywords/dist/index.cjs
+++ b/node_modules/@csstools/postcss-font-format-keywords/dist/index.cjs
@@ -1 +1 @@
-"use strict";var e=require("postcss-value-parser");function hasFallback(e){const t=e.parent;if(!t)return!1;const o=e.prop.toLowerCase(),r=t.index(e);for(let e=0;e<r;e++){const r=t.nodes[e];if("decl"===r.type&&r.prop.toLowerCase()===o)return!0}return!1}const t=["woff","truetype","opentype","woff2","embedded-opentype","collection","svg"],creator=o=>{const r="preserve"in Object(o)&&Boolean(o?.preserve);return{postcssPlugin:"postcss-font-format-keywords",Declaration(o){if("src"!==o.prop.toLowerCase())return;if(!o.value.toLowerCase().includes("format("))return;if(hasFallback(o))return;const s=o.parent;if(!s||"atrule"!==s.type)return;if("font-face"!==s.name.toLowerCase())return;const n=e(o.value);n.walk((o=>{"function"===o.type&&"format"===o.value.toLowerCase()&&o.nodes.forEach((o=>{"word"===o.type&&t.includes(o.value.toLowerCase())&&(o.value=e.stringify({type:"string",value:o.value,quote:'"'}))}))})),n.toString()!==o.value&&(o.cloneBefore({value:n.toString()}),r||o.remove())}}};creator.postcss=!0,module.exports=creator;
+"use strict";var e=require("postcss-value-parser"),t=require("@csstools/utilities");const o=["woff","truetype","opentype","woff2","embedded-opentype","collection","svg"],creator=r=>{const s="preserve"in Object(r)&&Boolean(r?.preserve);return{postcssPlugin:"postcss-font-format-keywords",Declaration(r){if("src"!==r.prop.toLowerCase())return;if(!r.value.toLowerCase().includes("format("))return;if(t.hasFallback(r))return;const a=r.parent;if(!a||"atrule"!==a.type)return;if("font-face"!==a.name.toLowerCase())return;const n=e(r.value);n.walk((t=>{"function"===t.type&&"format"===t.value.toLowerCase()&&t.nodes.forEach((t=>{"word"===t.type&&o.includes(t.value.toLowerCase())&&(t.value=e.stringify({type:"string",value:t.value,quote:'"'}))}))})),n.toString()!==r.value&&(r.cloneBefore({value:n.toString()}),s||r.remove())}}};creator.postcss=!0,module.exports=creator;
diff --git a/node_modules/@csstools/postcss-font-format-keywords/dist/index.mjs b/node_modules/@csstools/postcss-font-format-keywords/dist/index.mjs
index 4c88bb7a..928242ae 100644
--- a/node_modules/@csstools/postcss-font-format-keywords/dist/index.mjs
+++ b/node_modules/@csstools/postcss-font-format-keywords/dist/index.mjs
@@ -1 +1 @@
-import e from"postcss-value-parser";function hasFallback(e){const t=e.parent;if(!t)return!1;const o=e.prop.toLowerCase(),r=t.index(e);for(let e=0;e<r;e++){const r=t.nodes[e];if("decl"===r.type&&r.prop.toLowerCase()===o)return!0}return!1}const t=["woff","truetype","opentype","woff2","embedded-opentype","collection","svg"],creator=o=>{const r="preserve"in Object(o)&&Boolean(o?.preserve);return{postcssPlugin:"postcss-font-format-keywords",Declaration(o){if("src"!==o.prop.toLowerCase())return;if(!o.value.toLowerCase().includes("format("))return;if(hasFallback(o))return;const n=o.parent;if(!n||"atrule"!==n.type)return;if("font-face"!==n.name.toLowerCase())return;const s=e(o.value);s.walk((o=>{"function"===o.type&&"format"===o.value.toLowerCase()&&o.nodes.forEach((o=>{"word"===o.type&&t.includes(o.value.toLowerCase())&&(o.value=e.stringify({type:"string",value:o.value,quote:'"'}))}))})),s.toString()!==o.value&&(o.cloneBefore({value:s.toString()}),r||o.remove())}}};creator.postcss=!0;export{creator as default};
+import e from"postcss-value-parser";import{hasFallback as t}from"@csstools/utilities";const o=["woff","truetype","opentype","woff2","embedded-opentype","collection","svg"],creator=r=>{const s="preserve"in Object(r)&&Boolean(r?.preserve);return{postcssPlugin:"postcss-font-format-keywords",Declaration(r){if("src"!==r.prop.toLowerCase())return;if(!r.value.toLowerCase().includes("format("))return;if(t(r))return;const n=r.parent;if(!n||"atrule"!==n.type)return;if("font-face"!==n.name.toLowerCase())return;const a=e(r.value);a.walk((t=>{"function"===t.type&&"format"===t.value.toLowerCase()&&t.nodes.forEach((t=>{"word"===t.type&&o.includes(t.value.toLowerCase())&&(t.value=e.stringify({type:"string",value:t.value,quote:'"'}))}))})),a.toString()!==r.value&&(r.cloneBefore({value:a.toString()}),s||r.remove())}}};creator.postcss=!0;export{creator as default};
diff --git a/node_modules/@csstools/postcss-font-format-keywords/package.json b/node_modules/@csstools/postcss-font-format-keywords/package.json
index c39466a7..2777403f 100644
--- a/node_modules/@csstools/postcss-font-format-keywords/package.json
+++ b/node_modules/@csstools/postcss-font-format-keywords/package.json
@@ -1,7 +1,7 @@
{
"name": "@csstools/postcss-font-format-keywords",
"description": "Use unquoted format on @font-face CSS definitions.",
- "version": "3.0.1",
+ "version": "3.0.2",
"author": "Jonathan Neal <jonathantneal@hotmail.com>",
"license": "MIT-0",
"funding": [
@@ -38,6 +38,7 @@
"dist"
],
"dependencies": {
+ "@csstools/utilities": "^1.0.0",
"postcss-value-parser": "^4.2.0"
},
"peerDependencies": {
diff --git a/node_modules/@csstools/postcss-gamut-mapping/CHANGELOG.md b/node_modules/@csstools/postcss-gamut-mapping/CHANGELOG.md
index c03cc700..8991b109 100644
--- a/node_modules/@csstools/postcss-gamut-mapping/CHANGELOG.md
+++ b/node_modules/@csstools/postcss-gamut-mapping/CHANGELOG.md
@@ -1,25 +1,25 @@
# Changes to PostCSS gamut-mapping
-### 1.0.2
+### 1.0.9
-_December 31, 2023_
+_May 4, 2024_
-- Updated [`@csstools/css-tokenizer`](https://github.com/csstools/postcss-plugins/tree/main/packages/css-tokenizer) to [`2.2.3`](https://github.com/csstools/postcss-plugins/tree/main/packages/css-tokenizer/CHANGELOG.md#223) (patch)
-- Updated [`@csstools/css-parser-algorithms`](https://github.com/csstools/postcss-plugins/tree/main/packages/css-parser-algorithms) to [`2.5.0`](https://github.com/csstools/postcss-plugins/tree/main/packages/css-parser-algorithms/CHANGELOG.md#250) (minor)
-- Updated [`@csstools/css-color-parser`](https://github.com/csstools/postcss-plugins/tree/main/packages/css-color-parser) to [`1.5.1`](https://github.com/csstools/postcss-plugins/tree/main/packages/css-color-parser/CHANGELOG.md#151) (patch)
+- Updated [`@csstools/css-tokenizer`](https://github.com/csstools/postcss-plugins/tree/main/packages/css-tokenizer) to [`2.3.1`](https://github.com/csstools/postcss-plugins/tree/main/packages/css-tokenizer/CHANGELOG.md#231) (patch)
+- Updated [`@csstools/css-parser-algorithms`](https://github.com/csstools/postcss-plugins/tree/main/packages/css-parser-algorithms) to [`2.6.3`](https://github.com/csstools/postcss-plugins/tree/main/packages/css-parser-algorithms/CHANGELOG.md#263) (patch)
+- Updated [`@csstools/css-color-parser`](https://github.com/csstools/postcss-plugins/tree/main/packages/css-color-parser) to [`2.0.2`](https://github.com/csstools/postcss-plugins/tree/main/packages/css-color-parser/CHANGELOG.md#202) (patch)
-### 1.0.1
+### 1.0.8
-_December 15, 2023_
+_May 4, 2024_
-- Fix type definitions
-- Updated [`@csstools/css-tokenizer`](https://github.com/csstools/postcss-plugins/tree/main/packages/css-tokenizer) to [`2.2.2`](https://github.com/csstools/postcss-plugins/tree/main/packages/css-tokenizer/CHANGELOG.md#222) (patch)
-- Updated [`@csstools/css-parser-algorithms`](https://github.com/csstools/postcss-plugins/tree/main/packages/css-parser-algorithms) to [`2.4.0`](https://github.com/csstools/postcss-plugins/tree/main/packages/css-parser-algorithms/CHANGELOG.md#240) (minor)
-- Updated [`@csstools/css-color-parser`](https://github.com/csstools/postcss-plugins/tree/main/packages/css-color-parser) to [`1.5.0`](https://github.com/csstools/postcss-plugins/tree/main/packages/css-color-parser/CHANGELOG.md#150) (minor)
+- Updated [`@csstools/css-tokenizer`](https://github.com/csstools/postcss-plugins/tree/main/packages/css-tokenizer) to [`2.3.0`](https://github.com/csstools/postcss-plugins/tree/main/packages/css-tokenizer/CHANGELOG.md#230) (minor)
+- Updated [`@csstools/css-parser-algorithms`](https://github.com/csstools/postcss-plugins/tree/main/packages/css-parser-algorithms) to [`2.6.2`](https://github.com/csstools/postcss-plugins/tree/main/packages/css-parser-algorithms/CHANGELOG.md#262) (patch)
+- Updated [`@csstools/css-color-parser`](https://github.com/csstools/postcss-plugins/tree/main/packages/css-color-parser) to [`2.0.1`](https://github.com/csstools/postcss-plugins/tree/main/packages/css-color-parser/CHANGELOG.md#201) (patch)
-### 1.0.0
+### 1.0.7
-_October 9, 2023_
+_April 21, 2024_
-- Initial version
-- Updated [`@csstools/css-color-parser`](https://github.com/csstools/postcss-plugins/tree/main/packages/css-color-parser) to [`1.4.0`](https://github.com/csstools/postcss-plugins/tree/main/packages/css-color-parser/CHANGELOG.md#140) (minor)
+- Updated [`@csstools/css-color-parser`](https://github.com/csstools/postcss-plugins/tree/main/packages/css-color-parser) to [`2.0.0`](https://github.com/csstools/postcss-plugins/tree/main/packages/css-color-parser/CHANGELOG.md#200) (major)
+
+[Full CHANGELOG](https://github.com/csstools/postcss-plugins/tree/main/plugins/postcss-gamut-mapping/CHANGELOG.md)
diff --git a/node_modules/@csstools/postcss-gamut-mapping/README.md b/node_modules/@csstools/postcss-gamut-mapping/README.md
index 874c5c89..34da36d2 100644
--- a/node_modules/@csstools/postcss-gamut-mapping/README.md
+++ b/node_modules/@csstools/postcss-gamut-mapping/README.md
@@ -27,8 +27,8 @@ p {
p {
background-color: oklch(80% 0.05 0.39 / 0.5);
- color: rgba(50, 0, 20, 0.5);
- border-color: rgb(0, 249, 66);
+ color: rgba(48, 0, 20, 0.5);
+ border-color: rgb(0, 247, 79);
}
@media (color-gamut: rec2020) {
diff --git a/node_modules/@csstools/postcss-gamut-mapping/dist/index.cjs b/node_modules/@csstools/postcss-gamut-mapping/dist/index.cjs
index e8bf04db..d63f2607 100644
--- a/node_modules/@csstools/postcss-gamut-mapping/dist/index.cjs
+++ b/node_modules/@csstools/postcss-gamut-mapping/dist/index.cjs
@@ -1 +1 @@
-"use strict";var e=require("@csstools/css-tokenizer"),o=require("@csstools/css-parser-algorithms"),a=require("@csstools/css-color-parser");const t=/\bcolor-gamut\b/i;function hasConditionalAncestor(e){let o=e.parent;for(;o;)if("atrule"===o.type){if("media"===o.name.toLowerCase()&&t.test(o.params))return!0;o=o.parent}else o=o.parent;return!1}function hasOverrideOrFallback(e){const o=e.prop.toLowerCase();let a=!1,t=!1;const s=e.parent?.nodes??[],r=s.indexOf(e);for(let e=0;e<s.length;e++){if(e===r)continue;const n=s[e];if("decl"===n.type&&n.prop.toLowerCase()===o){if(!(e<r)){a=!0;break}t=!0,e=r}}return{hasOverride:a,hasFallback:t}}const s=/\b(?:color|lab|lch|oklab|oklch)\(/i,r=/^(?:color|lab|lch|oklab|oklch)$/i,creator=()=>({postcssPlugin:"postcss-gamut-mapping",prepare(){const t=new WeakMap;return{OnceExit:(n,{postcss:l})=>{n.walkDecls((n=>{const i=n.value;if(!s.test(i))return;if(!n.parent||hasConditionalAncestor(n))return;const{hasOverride:c,hasFallback:p}=hasOverrideOrFallback(n);if(c)return;const u=t.get(n.parent)||{conditionalRules:[],propNames:new Set,lastConditionParams:{media:void 0},lastConditionalRule:void 0};t.set(n.parent,u);let d=!1;const m=o.replaceComponentValues(o.parseCommaSeparatedListOfComponentValues(e.tokenize({css:i})),(e=>{if(!o.isFunctionNode(e)||!r.test(e.getName()))return;const t=a.color(e);return!t||t.syntaxFlags.has(a.SyntaxFlag.HasNoneKeywords)||a.colorDataFitsRGB_Gamut(t)?void 0:(d||a.colorDataFitsDisplayP3_Gamut(t)||(d=!0),a.serializeRGB(t,!0))})),f=o.stringify(m);if(f===i)return;const h=`(color-gamut: ${d?"rec2020":"p3"})`;if(u.lastConditionParams.media!==h&&(u.lastConditionalRule=void 0),u.lastConditionalRule)return p||n.cloneBefore({value:f}),u.lastConditionalRule.append(n.clone()),void n.remove();p||n.cloneBefore({value:f});const v=l.atRule({name:"media",params:h,source:n.parent.source,raws:{before:"\n\n",after:"\n"}}),C=n.parent.clone();C.removeAll(),C.raws.before="\n",C.append(n.clone()),n.remove(),u.lastConditionParams.media=v.params,u.lastConditionalRule=C,v.append(C),u.conditionalRules.push(v)})),n.walk((e=>{const o=t.get(e);o&&0!==o.conditionalRules.length&&o.conditionalRules.reverse().forEach((o=>{e.after(o)}))}))}}}});creator.postcss=!0,module.exports=creator;
+"use strict";var e=require("@csstools/css-tokenizer"),o=require("@csstools/css-parser-algorithms"),a=require("@csstools/css-color-parser");const t=/\bcolor-gamut\b/i;function hasConditionalAncestor(e){let o=e.parent;for(;o;)if("atrule"===o.type){if("media"===o.name.toLowerCase()&&t.test(o.params))return!0;o=o.parent}else o=o.parent;return!1}function sameProperty(e){const o=e.prop.toLowerCase(),a=[],t=e.parent?.nodes??[];for(let e=0;e<t.length;e++){const s=t[e];"decl"===s.type&&s.prop.toLowerCase()===o&&a.push(s)}return a}const s=/\b(?:color|lab|lch|oklab|oklch)\(/i,n=/^(?:color|lab|lch|oklab|oklch)$/i,creator=()=>({postcssPlugin:"postcss-gamut-mapping",prepare(){const t=new WeakMap,r=new WeakSet;return{postcssPlugin:"postcss-gamut-mapping",OnceExit(i,{postcss:l}){i.walkDecls((i=>{if(r.has(i))return;if(!s.test(i.value))return;if(!i.parent||hasConditionalAncestor(i))return;const c=sameProperty(i).map(((t,s)=>{r.add(t);let i=!1;const l=t.value,c=o.replaceComponentValues(o.parseCommaSeparatedListOfComponentValues(e.tokenize({css:l})),(e=>{if(!o.isFunctionNode(e)||!n.test(e.getName()))return;const t=a.color(e);return!t||t.syntaxFlags.has(a.SyntaxFlag.HasNoneKeywords)||a.colorDataFitsRGB_Gamut(t)?void 0:(i||a.colorDataFitsDisplayP3_Gamut(t)||(i=!0),a.serializeRGB(t,!0))})),p=o.stringify(c);return{isRec2020:i,matchesOriginal:p===l,modifiedValue:p,hasFallback:s>0,item:t}})),p=[];c.reverse();for(const e of c){if(e.matchesOriginal)break;p.push(e)}p.reverse(),p.forEach((({isRec2020:e,modifiedValue:o,hasFallback:a,item:s})=>{const n=s.parent;if(!n)return;const i=t.get(n)||{conditionalRules:[],propNames:new Set,lastConditionParams:{media:void 0},lastConditionalRule:void 0};t.set(n,i);const c=`(color-gamut: ${e?"rec2020":"p3"})`;if(i.lastConditionParams.media!==c&&(i.lastConditionalRule=void 0),!a){const e=s.cloneBefore({value:o});r.add(e)}if(i.lastConditionalRule){const e=s.clone();return i.lastConditionalRule.append(e),r.add(e),void s.remove()}const p=l.atRule({name:"media",params:c,source:n.source,raws:{before:"\n\n",after:"\n"}}),u=n.clone();u.removeAll(),u.raws.before="\n";const d=s.clone();u.append(d),s.remove(),r.add(d),i.lastConditionParams.media=p.params,i.lastConditionalRule=u,p.append(u),i.conditionalRules.push(p)}))})),i.walk((e=>{const o=t.get(e);o&&0!==o.conditionalRules.length&&o.conditionalRules.reverse().forEach((o=>{e.after(o)}))}))}}}});creator.postcss=!0,module.exports=creator;
diff --git a/node_modules/@csstools/postcss-gamut-mapping/dist/index.mjs b/node_modules/@csstools/postcss-gamut-mapping/dist/index.mjs
index d4355811..ceaa3864 100644
--- a/node_modules/@csstools/postcss-gamut-mapping/dist/index.mjs
+++ b/node_modules/@csstools/postcss-gamut-mapping/dist/index.mjs
@@ -1 +1 @@
-import{tokenize as e}from"@csstools/css-tokenizer";import{replaceComponentValues as o,parseCommaSeparatedListOfComponentValues as t,isFunctionNode as a,stringify as r}from"@csstools/css-parser-algorithms";import{color as s,SyntaxFlag as n,colorDataFitsRGB_Gamut as l,colorDataFitsDisplayP3_Gamut as i,serializeRGB as c}from"@csstools/css-color-parser";const p=/\bcolor-gamut\b/i;function hasConditionalAncestor(e){let o=e.parent;for(;o;)if("atrule"===o.type){if("media"===o.name.toLowerCase()&&p.test(o.params))return!0;o=o.parent}else o=o.parent;return!1}function hasOverrideOrFallback(e){const o=e.prop.toLowerCase();let t=!1,a=!1;const r=e.parent?.nodes??[],s=r.indexOf(e);for(let e=0;e<r.length;e++){if(e===s)continue;const n=r[e];if("decl"===n.type&&n.prop.toLowerCase()===o){if(!(e<s)){t=!0;break}a=!0,e=s}}return{hasOverride:t,hasFallback:a}}const d=/\b(?:color|lab|lch|oklab|oklch)\(/i,u=/^(?:color|lab|lch|oklab|oklch)$/i,creator=()=>({postcssPlugin:"postcss-gamut-mapping",prepare(){const p=new WeakMap;return{OnceExit:(m,{postcss:f})=>{m.walkDecls((m=>{const h=m.value;if(!d.test(h))return;if(!m.parent||hasConditionalAncestor(m))return;const{hasOverride:v,hasFallback:b}=hasOverrideOrFallback(m);if(v)return;const k=p.get(m.parent)||{conditionalRules:[],propNames:new Set,lastConditionParams:{media:void 0},lastConditionalRule:void 0};p.set(m.parent,k);let C=!1;const g=o(t(e({css:h})),(e=>{if(!a(e)||!u.test(e.getName()))return;const o=s(e);return!o||o.syntaxFlags.has(n.HasNoneKeywords)||l(o)?void 0:(C||i(o)||(C=!0),c(o,!0))})),w=r(g);if(w===h)return;const R=`(color-gamut: ${C?"rec2020":"p3"})`;if(k.lastConditionParams.media!==R&&(k.lastConditionalRule=void 0),k.lastConditionalRule)return b||m.cloneBefore({value:w}),k.lastConditionalRule.append(m.clone()),void m.remove();b||m.cloneBefore({value:w});const O=f.atRule({name:"media",params:R,source:m.parent.source,raws:{before:"\n\n",after:"\n"}}),F=m.parent.clone();F.removeAll(),F.raws.before="\n",F.append(m.clone()),m.remove(),k.lastConditionParams.media=O.params,k.lastConditionalRule=F,O.append(F),k.conditionalRules.push(O)})),m.walk((e=>{const o=p.get(e);o&&0!==o.conditionalRules.length&&o.conditionalRules.reverse().forEach((o=>{e.after(o)}))}))}}}});creator.postcss=!0;export{creator as default};
+import{tokenize as e}from"@csstools/css-tokenizer";import{replaceComponentValues as o,parseCommaSeparatedListOfComponentValues as t,isFunctionNode as s,stringify as a}from"@csstools/css-parser-algorithms";import{color as n,SyntaxFlag as r,colorDataFitsRGB_Gamut as l,colorDataFitsDisplayP3_Gamut as i,serializeRGB as c}from"@csstools/css-color-parser";const p=/\bcolor-gamut\b/i;function hasConditionalAncestor(e){let o=e.parent;for(;o;)if("atrule"===o.type){if("media"===o.name.toLowerCase()&&p.test(o.params))return!0;o=o.parent}else o=o.parent;return!1}function sameProperty(e){const o=e.prop.toLowerCase(),t=[],s=e.parent?.nodes??[];for(let e=0;e<s.length;e++){const a=s[e];"decl"===a.type&&a.prop.toLowerCase()===o&&t.push(a)}return t}const d=/\b(?:color|lab|lch|oklab|oklch)\(/i,u=/^(?:color|lab|lch|oklab|oklch)$/i,creator=()=>({postcssPlugin:"postcss-gamut-mapping",prepare(){const p=new WeakMap,m=new WeakSet;return{postcssPlugin:"postcss-gamut-mapping",OnceExit(f,{postcss:h}){f.walkDecls((f=>{if(m.has(f))return;if(!d.test(f.value))return;if(!f.parent||hasConditionalAncestor(f))return;const g=sameProperty(f).map(((p,d)=>{m.add(p);let f=!1;const h=p.value,g=o(t(e({css:h})),(e=>{if(!s(e)||!u.test(e.getName()))return;const o=n(e);return!o||o.syntaxFlags.has(r.HasNoneKeywords)||l(o)?void 0:(f||i(o)||(f=!0),c(o,!0))})),v=a(g);return{isRec2020:f,matchesOriginal:v===h,modifiedValue:v,hasFallback:d>0,item:p}})),v=[];g.reverse();for(const e of g){if(e.matchesOriginal)break;v.push(e)}v.reverse(),v.forEach((({isRec2020:e,modifiedValue:o,hasFallback:t,item:s})=>{const a=s.parent;if(!a)return;const n=p.get(a)||{conditionalRules:[],propNames:new Set,lastConditionParams:{media:void 0},lastConditionalRule:void 0};p.set(a,n);const r=`(color-gamut: ${e?"rec2020":"p3"})`;if(n.lastConditionParams.media!==r&&(n.lastConditionalRule=void 0),!t){const e=s.cloneBefore({value:o});m.add(e)}if(n.lastConditionalRule){const e=s.clone();return n.lastConditionalRule.append(e),m.add(e),void s.remove()}const l=h.atRule({name:"media",params:r,source:a.source,raws:{before:"\n\n",after:"\n"}}),i=a.clone();i.removeAll(),i.raws.before="\n";const c=s.clone();i.append(c),s.remove(),m.add(c),n.lastConditionParams.media=l.params,n.lastConditionalRule=i,l.append(i),n.conditionalRules.push(l)}))})),f.walk((e=>{const o=p.get(e);o&&0!==o.conditionalRules.length&&o.conditionalRules.reverse().forEach((o=>{e.after(o)}))}))}}}});creator.postcss=!0;export{creator as default};
diff --git a/node_modules/@csstools/postcss-gamut-mapping/package.json b/node_modules/@csstools/postcss-gamut-mapping/package.json
index 49890eee..dde5442d 100644
--- a/node_modules/@csstools/postcss-gamut-mapping/package.json
+++ b/node_modules/@csstools/postcss-gamut-mapping/package.json
@@ -1,7 +1,7 @@
{
"name": "@csstools/postcss-gamut-mapping",
"description": "Gamut map css colors to fit display specific gamuts",
- "version": "1.0.2",
+ "version": "1.0.9",
"contributors": [
{
"name": "Antonio Laguna",
@@ -48,9 +48,9 @@
"dist"
],
"dependencies": {
- "@csstools/css-color-parser": "^1.5.1",
- "@csstools/css-parser-algorithms": "^2.5.0",
- "@csstools/css-tokenizer": "^2.2.3"
+ "@csstools/css-color-parser": "^2.0.2",
+ "@csstools/css-parser-algorithms": "^2.6.3",
+ "@csstools/css-tokenizer": "^2.3.1"
},
"peerDependencies": {
"postcss": "^8.4"
@@ -58,7 +58,7 @@
"homepage": "https://github.com/csstools/postcss-plugins/tree/main/plugins/postcss-gamut-mapping#readme",
"repository": {
"type": "git",
- "url": "https://github.com/csstools/postcss-plugins.git",
+ "url": "git+https://github.com/csstools/postcss-plugins.git",
"directory": "plugins/postcss-gamut-mapping"
},
"bugs": "https://github.com/csstools/postcss-plugins/issues",
diff --git a/node_modules/@csstools/postcss-gradients-interpolation-method/CHANGELOG.md b/node_modules/@csstools/postcss-gradients-interpolation-method/CHANGELOG.md
index a082903c..148a837f 100644
--- a/node_modules/@csstools/postcss-gradients-interpolation-method/CHANGELOG.md
+++ b/node_modules/@csstools/postcss-gradients-interpolation-method/CHANGELOG.md
@@ -1,28 +1,25 @@
# Changes to PostCSS Gradients Interpolation Method
-### 4.0.9
+### 4.0.17
-_December 31, 2023_
+_May 4, 2024_
-- Updated [`@csstools/css-tokenizer`](https://github.com/csstools/postcss-plugins/tree/main/packages/css-tokenizer) to [`2.2.3`](https://github.com/csstools/postcss-plugins/tree/main/packages/css-tokenizer/CHANGELOG.md#223) (patch)
-- Updated [`@csstools/css-parser-algorithms`](https://github.com/csstools/postcss-plugins/tree/main/packages/css-parser-algorithms) to [`2.5.0`](https://github.com/csstools/postcss-plugins/tree/main/packages/css-parser-algorithms/CHANGELOG.md#250) (minor)
-- Updated [`@csstools/css-color-parser`](https://github.com/csstools/postcss-plugins/tree/main/packages/css-color-parser) to [`1.5.1`](https://github.com/csstools/postcss-plugins/tree/main/packages/css-color-parser/CHANGELOG.md#151) (patch)
+- Updated [`@csstools/css-tokenizer`](https://github.com/csstools/postcss-plugins/tree/main/packages/css-tokenizer) to [`2.3.1`](https://github.com/csstools/postcss-plugins/tree/main/packages/css-tokenizer/CHANGELOG.md#231) (patch)
+- Updated [`@csstools/css-parser-algorithms`](https://github.com/csstools/postcss-plugins/tree/main/packages/css-parser-algorithms) to [`2.6.3`](https://github.com/csstools/postcss-plugins/tree/main/packages/css-parser-algorithms/CHANGELOG.md#263) (patch)
+- Updated [`@csstools/css-color-parser`](https://github.com/csstools/postcss-plugins/tree/main/packages/css-color-parser) to [`2.0.2`](https://github.com/csstools/postcss-plugins/tree/main/packages/css-color-parser/CHANGELOG.md#202) (patch)
-### 4.0.8
+### 4.0.16
-_December 15, 2023_
+_May 4, 2024_
-- Skip transforms when a color value contains experimental syntax
-- Updated [`@csstools/css-tokenizer`](https://github.com/csstools/postcss-plugins/tree/main/packages/css-tokenizer) to [`2.2.2`](https://github.com/csstools/postcss-plugins/tree/main/packages/css-tokenizer/CHANGELOG.md#222) (patch)
-- Updated [`@csstools/css-parser-algorithms`](https://github.com/csstools/postcss-plugins/tree/main/packages/css-parser-algorithms) to [`2.4.0`](https://github.com/csstools/postcss-plugins/tree/main/packages/css-parser-algorithms/CHANGELOG.md#240) (minor)
-- Updated [`@csstools/postcss-progressive-custom-properties`](https://github.com/csstools/postcss-plugins/tree/main/plugins/postcss-progressive-custom-properties) to [`3.0.3`](https://github.com/csstools/postcss-plugins/tree/main/plugins/postcss-progressive-custom-properties/CHANGELOG.md#303) (patch)
-- Updated [`@csstools/css-color-parser`](https://github.com/csstools/postcss-plugins/tree/main/packages/css-color-parser) to [`1.5.0`](https://github.com/csstools/postcss-plugins/tree/main/packages/css-color-parser/CHANGELOG.md#150) (minor)
+- Updated [`@csstools/css-tokenizer`](https://github.com/csstools/postcss-plugins/tree/main/packages/css-tokenizer) to [`2.3.0`](https://github.com/csstools/postcss-plugins/tree/main/packages/css-tokenizer/CHANGELOG.md#230) (minor)
+- Updated [`@csstools/css-parser-algorithms`](https://github.com/csstools/postcss-plugins/tree/main/packages/css-parser-algorithms) to [`2.6.2`](https://github.com/csstools/postcss-plugins/tree/main/packages/css-parser-algorithms/CHANGELOG.md#262) (patch)
+- Updated [`@csstools/css-color-parser`](https://github.com/csstools/postcss-plugins/tree/main/packages/css-color-parser) to [`2.0.1`](https://github.com/csstools/postcss-plugins/tree/main/packages/css-color-parser/CHANGELOG.md#201) (patch)
-### 4.0.7
+### 4.0.15
-_October 9, 2023_
+_April 21, 2024_
-- Updated [`@csstools/css-color-parser`](https://github.com/csstools/postcss-plugins/tree/main/packages/css-color-parser) to [`1.4.0`](https://github.com/csstools/postcss-plugins/tree/main/packages/css-color-parser/CHANGELOG.md#140) (minor)
-- Updated [`@csstools/postcss-progressive-custom-properties`](https://github.com/csstools/postcss-plugins/tree/main/plugins/postcss-progressive-custom-properties) to [`3.0.2`](https://github.com/csstools/postcss-plugins/tree/main/plugins/postcss-progressive-custom-properties/CHANGELOG.md#302) (patch)
+- Updated [`@csstools/css-color-parser`](https://github.com/csstools/postcss-plugins/tree/main/packages/css-color-parser) to [`2.0.0`](https://github.com/csstools/postcss-plugins/tree/main/packages/css-color-parser/CHANGELOG.md#200) (major)
[Full CHANGELOG](https://github.com/csstools/postcss-plugins/tree/main/plugins/postcss-gradients-interpolation-method/CHANGELOG.md)
diff --git a/node_modules/@csstools/postcss-gradients-interpolation-method/dist/index.cjs b/node_modules/@csstools/postcss-gradients-interpolation-method/dist/index.cjs
index 0a4d9bfc..4aab2eb4 100644
--- a/node_modules/@csstools/postcss-gradients-interpolation-method/dist/index.cjs
+++ b/node_modules/@csstools/postcss-gradients-interpolation-method/dist/index.cjs
@@ -1 +1 @@
-"use strict";var e=require("@csstools/postcss-progressive-custom-properties"),o=require("@csstools/css-parser-algorithms"),t=require("@csstools/css-tokenizer"),n=require("@csstools/css-color-parser");const i=/(repeating-)?(linear|radial|conic)-gradient\(.*?in/i,s=/^(repeating-)?(linear|radial|conic)-gradient$/i;function hasFallback(e){const o=e.parent;if(!o)return!1;const t=e.prop.toLowerCase(),n=o.index(e);for(let e=0;e<n;e++){const n=o.nodes[e];if("decl"===n.type&&n.prop.toLowerCase()===t)return!0}return!1}function hasSupportsAtRuleAncestor(e){let o=e.parent;for(;o;)if("atrule"===o.type){if("supports"===o.name&&i.test(o.params))return!0;o=o.parent}else o=o.parent;return!1}function interpolateColorsInColorStopsList(e,i,s,r=!1){const a=[],l=[];for(let r=0;r<e.length-1;r++){const a=e[r],c=e[r+1];if(l.push(a),s||n.serializeP3(a.colorData,!1).toString()!==n.serializeP3(c.colorData,!1).toString()&&a.position.toString()!==c.position.toString())for(let e=1;e<=9;e++){const r=10*e;let p=[];s&&(p=[new o.WhitespaceNode([[t.TokenType.Whitespace," ",-1,-1,void 0]]),s,new o.WhitespaceNode([[t.TokenType.Whitespace," ",-1,-1,void 0]]),new o.TokenNode([t.TokenType.Ident,"hue",-1,-1,{value:"hue"}])]);const u=new o.FunctionNode([t.TokenType.Function,"color-mix(",-1,-1,{value:"color-mix"}],[t.TokenType.CloseParen,")",-1,-1,void 0],[new o.TokenNode([t.TokenType.Ident,"in",-1,-1,{value:"in"}]),new o.WhitespaceNode([[t.TokenType.Whitespace," ",-1,-1,void 0]]),i,...p,new o.TokenNode([t.TokenType.Comma,",",-1,-1,void 0]),new o.WhitespaceNode([[t.TokenType.Whitespace," ",-1,-1,void 0]]),a.color,new o.WhitespaceNode([[t.TokenType.Whitespace," ",-1,-1,void 0]]),new o.TokenNode([t.TokenType.Percentage,100-r+"%",-1,-1,{value:100-r}]),new o.TokenNode([t.TokenType.Comma,",",-1,-1,void 0]),new o.WhitespaceNode([[t.TokenType.Whitespace," ",-1,-1,void 0]]),c.color,new o.WhitespaceNode([[t.TokenType.Whitespace," ",-1,-1,void 0]]),new o.TokenNode([t.TokenType.Percentage,`${r}%`,-1,-1,{value:r}])]),d=n.color(u);if(!d)return!1;l.push({colorData:d})}r===e.length-2&&l.push(c)}for(let e=0;e<l.length;e++)r&&!n.colorDataFitsRGB_Gamut(l[e].colorData)?l[e].color=n.serializeP3(l[e].colorData,!1):l[e].color=n.serializeRGB(l[e].colorData,!1);for(let e=0;e<l.length;e++){const n=l[e];n.position?a.push(n.color,new o.WhitespaceNode([[t.TokenType.Whitespace," ",-1,-1,void 0]]),n.position):a.push(n.color),e!==l.length-1&&a.push(new o.TokenNode([t.TokenType.Comma,",",-1,-1,void 0]),new o.WhitespaceNode([[t.TokenType.Whitespace," ",-1,-1,void 0]]))}return a}function parseColorStops(e){const i=[];let s={};for(let r=0;r<e.length;r++){const a=e[r];if(o.isCommentNode(a)||o.isWhitespaceNode(a))continue;if(o.isTokenNode(a)&&a.value[0]===t.TokenType.Comma){if(s.color&&s.colorData&&s.positionA){i.push({color:s.color,colorData:s.colorData,position:s.positionA}),s.positionB&&i.push({color:s.color,colorData:s.colorData,position:s.positionB}),s={};continue}return!1}const l=n.color(a);if(l){if(s.color)return!1;if(l.syntaxFlags.has(n.SyntaxFlag.Experimental))return!1;s.color=a,s.colorData=l}else{if(!s.color)return!1;if(s.positionA){if(!s.positionA||s.positionB)return!1;s.positionB=a}else s.positionA=a}}return!(!s.color||!s.positionA)&&(s.color&&s.colorData&&s.positionA&&(i.push({color:s.color,colorData:s.colorData,position:s.positionA}),s.positionB&&i.push({color:s.color,colorData:s.colorData,position:s.positionB})),!(i.length<2)&&i)}const r=/^(srgb|srgb-linear|lab|oklab|xyz|xyz-d50|xyz-d65|hsl|hwb|lch|oklch)$/i,a=/^(hsl|hwb|lch|oklch)$/i,l=/^(shorter|longer|increasing|decreasing)$/i,c=/^in$/i,p=/^hue$/i;function modifyGradientFunctionComponentValues(e,n=!1){const i=e.getName();if(!s.test(i))return!1;let u="srgb",d=null,f=null,T=null,h=null,v=null,m=[];{let n=0,i=e.value[n];for(;i&&(!o.isTokenNode(i)||i.value[0]!==t.TokenType.Ident||!c.test(i.value[4].value));){if(o.isTokenNode(i)&&i.value[0]===t.TokenType.Comma)return!1;n++,i=e.value[n]}for(d=i,n++,i=e.value[n];o.isCommentNode(i)||o.isWhitespaceNode(i);)n++,i=e.value[n];if(o.isTokenNode(i)&&i.value[0]===t.TokenType.Ident&&r.test(i.value[4].value)){if(f)return!1;f=i,u=i.value[4].value,n++,i=e.value[n]}for(;o.isCommentNode(i)||o.isWhitespaceNode(i);)n++,i=e.value[n];if(o.isTokenNode(i)&&i.value[0]===t.TokenType.Ident&&l.test(i.value[4].value)&&a.test(u)){if(T||!f)return!1;T=i,n++,i=e.value[n]}for(;o.isCommentNode(i)||o.isWhitespaceNode(i);)n++,i=e.value[n];if(o.isTokenNode(i)&&i.value[0]===t.TokenType.Ident&&p.test(i.value[4].value)){if(h||!f||!T)return!1;h=i,n++,i=e.value[n]}for(;i&&(!o.isTokenNode(i)||i.value[0]!==t.TokenType.Comma);)n++,i=e.value[n];if(v=i,!v)return!1;m=e.value.slice(n+1)}if(!f)return!1;if(T&&!h)return!1;if(h&&!T)return!1;const k=parseColorStops(m);if(!k)return!1;const g=interpolateColorsInColorStopsList(k,f,T,n);if(!g)return!1;const N=trim([...e.value.slice(0,e.value.indexOf(d)),...e.value.slice(e.value.indexOf(h||f)+1,e.value.indexOf(v))]);return N.length>0&&N.some((e=>!o.isCommentNode(e)))&&N.push(new o.TokenNode([t.TokenType.Comma,",",-1,-1,void 0]),new o.WhitespaceNode([[t.TokenType.Whitespace," ",-1,-1,void 0]])),trim([...N,...trim(g)])}function trim(e){let t=0,n=e.length-1;for(let n=0;n<e.length;n++)if(!o.isWhitespaceNode(e[n])){t=n;break}for(let t=e.length-1;t>=0;t--)if(!o.isWhitespaceNode(e[t])){n=t;break}return e.slice(t,n+1)}const basePlugin=e=>({postcssPlugin:"postcss-gradients-interpolation-method",Declaration(n){if(!i.test(n.value))return;if(hasFallback(n))return;if(hasSupportsAtRuleAncestor(n))return;const s=t.tokenize({css:n.value}),r=o.stringify(o.replaceComponentValues(o.parseCommaSeparatedListOfComponentValues(s),(e=>{if(!o.isFunctionNode(e))return;const t=modifyGradientFunctionComponentValues(e);t&&(e.value=t)})));if(r===n.value)return;const a=o.stringify(o.replaceComponentValues(o.parseCommaSeparatedListOfComponentValues(s),(e=>{if(!o.isFunctionNode(e))return;const t=modifyGradientFunctionComponentValues(e,!0);t&&(e.value=t)})));n.cloneBefore({value:r}),r!==a&&n.cloneBefore({value:a}),e?.preserve||n.remove()}});basePlugin.postcss=!0;const postcssPlugin=o=>{const t=Object.assign({enableProgressiveCustomProperties:!0,preserve:!0},o);return t.enableProgressiveCustomProperties?{postcssPlugin:"postcss-gradients-interpolation-method",plugins:[e(),basePlugin(t)]}:basePlugin(t)};postcssPlugin.postcss=!0,module.exports=postcssPlugin;
+"use strict";var e=require("@csstools/postcss-progressive-custom-properties"),o=require("@csstools/utilities"),t=require("@csstools/css-parser-algorithms"),i=require("@csstools/css-tokenizer"),n=require("@csstools/css-color-parser");const s=/(repeating-)?(linear|radial|conic)-gradient\(/i,r=/\bin\b/i,a={test:e=>s.test(e)&&r.test(e)},l=/^(repeating-)?(linear|radial|conic)-gradient$/i;function interpolateColorsInColorStopsList(e,o,s,r=!1){const a=[],l=[];for(let r=0;r<e.length-1;r++){const a=e[r],c=e[r+1];if(l.push(a),s||n.serializeP3(a.colorData,!1).toString()!==n.serializeP3(c.colorData,!1).toString()&&a.position.toString()!==c.position.toString())for(let e=1;e<=9;e++){const r=10*e;let u=[];s&&(u=[new t.WhitespaceNode([[i.TokenType.Whitespace," ",-1,-1,void 0]]),s,new t.WhitespaceNode([[i.TokenType.Whitespace," ",-1,-1,void 0]]),new t.TokenNode([i.TokenType.Ident,"hue",-1,-1,{value:"hue"}])]);const p=new t.FunctionNode([i.TokenType.Function,"color-mix(",-1,-1,{value:"color-mix"}],[i.TokenType.CloseParen,")",-1,-1,void 0],[new t.TokenNode([i.TokenType.Ident,"in",-1,-1,{value:"in"}]),new t.WhitespaceNode([[i.TokenType.Whitespace," ",-1,-1,void 0]]),o,...u,new t.TokenNode([i.TokenType.Comma,",",-1,-1,void 0]),new t.WhitespaceNode([[i.TokenType.Whitespace," ",-1,-1,void 0]]),a.color,new t.WhitespaceNode([[i.TokenType.Whitespace," ",-1,-1,void 0]]),new t.TokenNode([i.TokenType.Percentage,100-r+"%",-1,-1,{value:100-r}]),new t.TokenNode([i.TokenType.Comma,",",-1,-1,void 0]),new t.WhitespaceNode([[i.TokenType.Whitespace," ",-1,-1,void 0]]),c.color,new t.WhitespaceNode([[i.TokenType.Whitespace," ",-1,-1,void 0]]),new t.TokenNode([i.TokenType.Percentage,`${r}%`,-1,-1,{value:r}])]),d=n.color(p);if(!d)return!1;l.push({colorData:d})}r===e.length-2&&l.push(c)}for(let e=0;e<l.length;e++)r&&!n.colorDataFitsRGB_Gamut(l[e].colorData)?l[e].color=n.serializeP3(l[e].colorData,!1):l[e].color=n.serializeRGB(l[e].colorData,!1);for(let e=0;e<l.length;e++){const o=l[e];o.position?a.push(o.color,new t.WhitespaceNode([[i.TokenType.Whitespace," ",-1,-1,void 0]]),o.position):a.push(o.color),e!==l.length-1&&a.push(new t.TokenNode([i.TokenType.Comma,",",-1,-1,void 0]),new t.WhitespaceNode([[i.TokenType.Whitespace," ",-1,-1,void 0]]))}return a}function parseColorStops(e){const o=[];let s={};for(let r=0;r<e.length;r++){const a=e[r];if(t.isCommentNode(a)||t.isWhitespaceNode(a))continue;if(t.isTokenNode(a)&&i.isTokenComma(a.value)){if(s.color&&s.colorData&&s.positionA){o.push({color:s.color,colorData:s.colorData,position:s.positionA}),s.positionB&&o.push({color:s.color,colorData:s.colorData,position:s.positionB}),s={};continue}return!1}const l=n.color(a);if(l){if(s.color)return!1;if(l.syntaxFlags.has(n.SyntaxFlag.Experimental))return!1;s.color=a,s.colorData=l}else{if(!s.color)return!1;if(s.positionA){if(!s.positionA||s.positionB)return!1;s.positionB=a}else s.positionA=a}}return!(!s.color||!s.positionA)&&(s.color&&s.colorData&&s.positionA&&(o.push({color:s.color,colorData:s.colorData,position:s.positionA}),s.positionB&&o.push({color:s.color,colorData:s.colorData,position:s.positionB})),!(o.length<2)&&o)}const c=/^(srgb|srgb-linear|lab|oklab|xyz|xyz-d50|xyz-d65|hsl|hwb|lch|oklch)$/i,u=/^(hsl|hwb|lch|oklch)$/i,p=/^(shorter|longer|increasing|decreasing)$/i,d=/^in$/i,v=/^hue$/i;function modifyGradientFunctionComponentValues(e,o=!1){const n=e.getName();if(!l.test(n))return!1;let s="srgb",r=null,a=null,h=null,T=null,f=null,m=[];{let o=0,n=e.value[o];for(;n&&!(t.isTokenNode(n)&&i.isTokenIdent(n.value)&&d.test(n.value[4].value));){if(t.isTokenNode(n)&&i.isTokenComma(n.value))return!1;o++,n=e.value[o]}for(r=n,o++,n=e.value[o];t.isCommentNode(n)||t.isWhitespaceNode(n);)o++,n=e.value[o];if(t.isTokenNode(n)&&i.isTokenIdent(n.value)&&c.test(n.value[4].value)){if(a)return!1;a=n,s=n.value[4].value,o++,n=e.value[o]}for(;t.isCommentNode(n)||t.isWhitespaceNode(n);)o++,n=e.value[o];if(t.isTokenNode(n)&&i.isTokenIdent(n.value)&&p.test(n.value[4].value)&&u.test(s)){if(h||!a)return!1;h=n,o++,n=e.value[o]}for(;t.isCommentNode(n)||t.isWhitespaceNode(n);)o++,n=e.value[o];if(t.isTokenNode(n)&&i.isTokenIdent(n.value)&&v.test(n.value[4].value)){if(T||!a||!h)return!1;T=n,o++,n=e.value[o]}for(;n&&(!t.isTokenNode(n)||!i.isTokenComma(n.value));)o++,n=e.value[o];if(f=n,!f)return!1;m=e.value.slice(o+1)}if(!a)return!1;if(h&&!T)return!1;if(T&&!h)return!1;const k=parseColorStops(m);if(!k)return!1;const g=interpolateColorsInColorStopsList(k,a,h,o);if(!g)return!1;const N=trim([...e.value.slice(0,e.value.indexOf(r)),...e.value.slice(e.value.indexOf(T||a)+1,e.value.indexOf(f))]);return N.length>0&&N.some((e=>!t.isCommentNode(e)))&&N.push(new t.TokenNode([i.TokenType.Comma,",",-1,-1,void 0]),new t.WhitespaceNode([[i.TokenType.Whitespace," ",-1,-1,void 0]])),trim([...N,...trim(g)])}function trim(e){let o=0,i=e.length-1;for(let i=0;i<e.length;i++)if(!t.isWhitespaceNode(e[i])){o=i;break}for(let o=e.length-1;o>=0;o--)if(!t.isWhitespaceNode(e[o])){i=o;break}return e.slice(o,i+1)}const basePlugin=e=>({postcssPlugin:"postcss-gradients-interpolation-method",Declaration(n){if(!a.test(n.value))return;if(o.hasFallback(n))return;if(o.hasSupportsAtRuleAncestor(n,a))return;const s=i.tokenize({css:n.value}),r=t.stringify(t.replaceComponentValues(t.parseCommaSeparatedListOfComponentValues(s),(e=>{if(!t.isFunctionNode(e))return;const o=modifyGradientFunctionComponentValues(e);o&&(e.value=o)})));if(r===n.value)return;const l=t.stringify(t.replaceComponentValues(t.parseCommaSeparatedListOfComponentValues(s),(e=>{if(!t.isFunctionNode(e))return;const o=modifyGradientFunctionComponentValues(e,!0);o&&(e.value=o)})));n.cloneBefore({value:r}),r!==l&&n.cloneBefore({value:l}),e?.preserve||n.remove()}});basePlugin.postcss=!0;const postcssPlugin=o=>{const t=Object.assign({enableProgressiveCustomProperties:!0,preserve:!0},o);return t.enableProgressiveCustomProperties?{postcssPlugin:"postcss-gradients-interpolation-method",plugins:[e(),basePlugin(t)]}:basePlugin(t)};postcssPlugin.postcss=!0,module.exports=postcssPlugin;
diff --git a/node_modules/@csstools/postcss-gradients-interpolation-method/dist/index.mjs b/node_modules/@csstools/postcss-gradients-interpolation-method/dist/index.mjs
index c0dfa7b5..9bd4676f 100644
--- a/node_modules/@csstools/postcss-gradients-interpolation-method/dist/index.mjs
+++ b/node_modules/@csstools/postcss-gradients-interpolation-method/dist/index.mjs
@@ -1 +1 @@
-import o from"@csstools/postcss-progressive-custom-properties";import{WhitespaceNode as e,TokenNode as t,FunctionNode as r,isCommentNode as n,isWhitespaceNode as i,isTokenNode as s,stringify as l,replaceComponentValues as a,parseCommaSeparatedListOfComponentValues as c,isFunctionNode as u}from"@csstools/css-parser-algorithms";import{TokenType as p,tokenize as f}from"@csstools/css-tokenizer";import{serializeP3 as v,color as h,colorDataFitsRGB_Gamut as m,serializeRGB as d,SyntaxFlag as g}from"@csstools/css-color-parser";const w=/(repeating-)?(linear|radial|conic)-gradient\(.*?in/i,C=/^(repeating-)?(linear|radial|conic)-gradient$/i;function hasFallback(o){const e=o.parent;if(!e)return!1;const t=o.prop.toLowerCase(),r=e.index(o);for(let o=0;o<r;o++){const r=e.nodes[o];if("decl"===r.type&&r.prop.toLowerCase()===t)return!0}return!1}function hasSupportsAtRuleAncestor(o){let e=o.parent;for(;e;)if("atrule"===e.type){if("supports"===e.name&&w.test(e.params))return!0;e=e.parent}else e=e.parent;return!1}function interpolateColorsInColorStopsList(o,n,i,s=!1){const l=[],a=[];for(let s=0;s<o.length-1;s++){const l=o[s],c=o[s+1];if(a.push(l),i||v(l.colorData,!1).toString()!==v(c.colorData,!1).toString()&&l.position.toString()!==c.position.toString())for(let o=1;o<=9;o++){const s=10*o;let u=[];i&&(u=[new e([[p.Whitespace," ",-1,-1,void 0]]),i,new e([[p.Whitespace," ",-1,-1,void 0]]),new t([p.Ident,"hue",-1,-1,{value:"hue"}])]);const f=new r([p.Function,"color-mix(",-1,-1,{value:"color-mix"}],[p.CloseParen,")",-1,-1,void 0],[new t([p.Ident,"in",-1,-1,{value:"in"}]),new e([[p.Whitespace," ",-1,-1,void 0]]),n,...u,new t([p.Comma,",",-1,-1,void 0]),new e([[p.Whitespace," ",-1,-1,void 0]]),l.color,new e([[p.Whitespace," ",-1,-1,void 0]]),new t([p.Percentage,100-s+"%",-1,-1,{value:100-s}]),new t([p.Comma,",",-1,-1,void 0]),new e([[p.Whitespace," ",-1,-1,void 0]]),c.color,new e([[p.Whitespace," ",-1,-1,void 0]]),new t([p.Percentage,`${s}%`,-1,-1,{value:s}])]),v=h(f);if(!v)return!1;a.push({colorData:v})}s===o.length-2&&a.push(c)}for(let o=0;o<a.length;o++)s&&!m(a[o].colorData)?a[o].color=v(a[o].colorData,!1):a[o].color=d(a[o].colorData,!1);for(let o=0;o<a.length;o++){const r=a[o];r.position?l.push(r.color,new e([[p.Whitespace," ",-1,-1,void 0]]),r.position):l.push(r.color),o!==a.length-1&&l.push(new t([p.Comma,",",-1,-1,void 0]),new e([[p.Whitespace," ",-1,-1,void 0]]))}return l}function parseColorStops(o){const e=[];let t={};for(let r=0;r<o.length;r++){const l=o[r];if(n(l)||i(l))continue;if(s(l)&&l.value[0]===p.Comma){if(t.color&&t.colorData&&t.positionA){e.push({color:t.color,colorData:t.colorData,position:t.positionA}),t.positionB&&e.push({color:t.color,colorData:t.colorData,position:t.positionB}),t={};continue}return!1}const a=h(l);if(a){if(t.color)return!1;if(a.syntaxFlags.has(g.Experimental))return!1;t.color=l,t.colorData=a}else{if(!t.color)return!1;if(t.positionA){if(!t.positionA||t.positionB)return!1;t.positionB=l}else t.positionA=l}}return!(!t.color||!t.positionA)&&(t.color&&t.colorData&&t.positionA&&(e.push({color:t.color,colorData:t.colorData,position:t.positionA}),t.positionB&&e.push({color:t.color,colorData:t.colorData,position:t.positionB})),!(e.length<2)&&e)}const D=/^(srgb|srgb-linear|lab|oklab|xyz|xyz-d50|xyz-d65|hsl|hwb|lch|oklch)$/i,b=/^(hsl|hwb|lch|oklch)$/i,x=/^(shorter|longer|increasing|decreasing)$/i,A=/^in$/i,S=/^hue$/i;function modifyGradientFunctionComponentValues(o,r=!1){const l=o.getName();if(!C.test(l))return!1;let a="srgb",c=null,u=null,f=null,v=null,h=null,m=[];{let e=0,t=o.value[e];for(;t&&(!s(t)||t.value[0]!==p.Ident||!A.test(t.value[4].value));){if(s(t)&&t.value[0]===p.Comma)return!1;e++,t=o.value[e]}for(c=t,e++,t=o.value[e];n(t)||i(t);)e++,t=o.value[e];if(s(t)&&t.value[0]===p.Ident&&D.test(t.value[4].value)){if(u)return!1;u=t,a=t.value[4].value,e++,t=o.value[e]}for(;n(t)||i(t);)e++,t=o.value[e];if(s(t)&&t.value[0]===p.Ident&&x.test(t.value[4].value)&&b.test(a)){if(f||!u)return!1;f=t,e++,t=o.value[e]}for(;n(t)||i(t);)e++,t=o.value[e];if(s(t)&&t.value[0]===p.Ident&&S.test(t.value[4].value)){if(v||!u||!f)return!1;v=t,e++,t=o.value[e]}for(;t&&(!s(t)||t.value[0]!==p.Comma);)e++,t=o.value[e];if(h=t,!h)return!1;m=o.value.slice(e+1)}if(!u)return!1;if(f&&!v)return!1;if(v&&!f)return!1;const d=parseColorStops(m);if(!d)return!1;const g=interpolateColorsInColorStopsList(d,u,f,r);if(!g)return!1;const w=trim([...o.value.slice(0,o.value.indexOf(c)),...o.value.slice(o.value.indexOf(v||u)+1,o.value.indexOf(h))]);return w.length>0&&w.some((o=>!n(o)))&&w.push(new t([p.Comma,",",-1,-1,void 0]),new e([[p.Whitespace," ",-1,-1,void 0]])),trim([...w,...trim(g)])}function trim(o){let e=0,t=o.length-1;for(let t=0;t<o.length;t++)if(!i(o[t])){e=t;break}for(let e=o.length-1;e>=0;e--)if(!i(o[e])){t=e;break}return o.slice(e,t+1)}const basePlugin=o=>({postcssPlugin:"postcss-gradients-interpolation-method",Declaration(e){if(!w.test(e.value))return;if(hasFallback(e))return;if(hasSupportsAtRuleAncestor(e))return;const t=f({css:e.value}),r=l(a(c(t),(o=>{if(!u(o))return;const e=modifyGradientFunctionComponentValues(o);e&&(o.value=e)})));if(r===e.value)return;const n=l(a(c(t),(o=>{if(!u(o))return;const e=modifyGradientFunctionComponentValues(o,!0);e&&(o.value=e)})));e.cloneBefore({value:r}),r!==n&&e.cloneBefore({value:n}),o?.preserve||e.remove()}});basePlugin.postcss=!0;const postcssPlugin=e=>{const t=Object.assign({enableProgressiveCustomProperties:!0,preserve:!0},e);return t.enableProgressiveCustomProperties?{postcssPlugin:"postcss-gradients-interpolation-method",plugins:[o(),basePlugin(t)]}:basePlugin(t)};postcssPlugin.postcss=!0;export{postcssPlugin as default};
+import o from"@csstools/postcss-progressive-custom-properties";import{hasFallback as e,hasSupportsAtRuleAncestor as t}from"@csstools/utilities";import{WhitespaceNode as i,TokenNode as r,FunctionNode as n,isCommentNode as s,isWhitespaceNode as l,isTokenNode as a,stringify as c,replaceComponentValues as u,parseCommaSeparatedListOfComponentValues as p,isFunctionNode as v}from"@csstools/css-parser-algorithms";import{TokenType as f,isTokenComma as h,isTokenIdent as m,tokenize as g}from"@csstools/css-tokenizer";import{serializeP3 as d,color as w,colorDataFitsRGB_Gamut as D,serializeRGB as C,SyntaxFlag as b}from"@csstools/css-color-parser";const x=/(repeating-)?(linear|radial|conic)-gradient\(/i,W=/\bin\b/i,P={test:o=>x.test(o)&&W.test(o)},A=/^(repeating-)?(linear|radial|conic)-gradient$/i;function interpolateColorsInColorStopsList(o,e,t,s=!1){const l=[],a=[];for(let s=0;s<o.length-1;s++){const l=o[s],c=o[s+1];if(a.push(l),t||d(l.colorData,!1).toString()!==d(c.colorData,!1).toString()&&l.position.toString()!==c.position.toString())for(let o=1;o<=9;o++){const s=10*o;let u=[];t&&(u=[new i([[f.Whitespace," ",-1,-1,void 0]]),t,new i([[f.Whitespace," ",-1,-1,void 0]]),new r([f.Ident,"hue",-1,-1,{value:"hue"}])]);const p=new n([f.Function,"color-mix(",-1,-1,{value:"color-mix"}],[f.CloseParen,")",-1,-1,void 0],[new r([f.Ident,"in",-1,-1,{value:"in"}]),new i([[f.Whitespace," ",-1,-1,void 0]]),e,...u,new r([f.Comma,",",-1,-1,void 0]),new i([[f.Whitespace," ",-1,-1,void 0]]),l.color,new i([[f.Whitespace," ",-1,-1,void 0]]),new r([f.Percentage,100-s+"%",-1,-1,{value:100-s}]),new r([f.Comma,",",-1,-1,void 0]),new i([[f.Whitespace," ",-1,-1,void 0]]),c.color,new i([[f.Whitespace," ",-1,-1,void 0]]),new r([f.Percentage,`${s}%`,-1,-1,{value:s}])]),v=w(p);if(!v)return!1;a.push({colorData:v})}s===o.length-2&&a.push(c)}for(let o=0;o<a.length;o++)s&&!D(a[o].colorData)?a[o].color=d(a[o].colorData,!1):a[o].color=C(a[o].colorData,!1);for(let o=0;o<a.length;o++){const e=a[o];e.position?l.push(e.color,new i([[f.Whitespace," ",-1,-1,void 0]]),e.position):l.push(e.color),o!==a.length-1&&l.push(new r([f.Comma,",",-1,-1,void 0]),new i([[f.Whitespace," ",-1,-1,void 0]]))}return l}function parseColorStops(o){const e=[];let t={};for(let i=0;i<o.length;i++){const r=o[i];if(s(r)||l(r))continue;if(a(r)&&h(r.value)){if(t.color&&t.colorData&&t.positionA){e.push({color:t.color,colorData:t.colorData,position:t.positionA}),t.positionB&&e.push({color:t.color,colorData:t.colorData,position:t.positionB}),t={};continue}return!1}const n=w(r);if(n){if(t.color)return!1;if(n.syntaxFlags.has(b.Experimental))return!1;t.color=r,t.colorData=n}else{if(!t.color)return!1;if(t.positionA){if(!t.positionA||t.positionB)return!1;t.positionB=r}else t.positionA=r}}return!(!t.color||!t.positionA)&&(t.color&&t.colorData&&t.positionA&&(e.push({color:t.color,colorData:t.colorData,position:t.positionA}),t.positionB&&e.push({color:t.color,colorData:t.colorData,position:t.positionB})),!(e.length<2)&&e)}const B=/^(srgb|srgb-linear|lab|oklab|xyz|xyz-d50|xyz-d65|hsl|hwb|lch|oklch)$/i,S=/^(hsl|hwb|lch|oklch)$/i,y=/^(shorter|longer|increasing|decreasing)$/i,$=/^in$/i,k=/^hue$/i;function modifyGradientFunctionComponentValues(o,e=!1){const t=o.getName();if(!A.test(t))return!1;let n="srgb",c=null,u=null,p=null,v=null,g=null,d=[];{let e=0,t=o.value[e];for(;t&&!(a(t)&&m(t.value)&&$.test(t.value[4].value));){if(a(t)&&h(t.value))return!1;e++,t=o.value[e]}for(c=t,e++,t=o.value[e];s(t)||l(t);)e++,t=o.value[e];if(a(t)&&m(t.value)&&B.test(t.value[4].value)){if(u)return!1;u=t,n=t.value[4].value,e++,t=o.value[e]}for(;s(t)||l(t);)e++,t=o.value[e];if(a(t)&&m(t.value)&&y.test(t.value[4].value)&&S.test(n)){if(p||!u)return!1;p=t,e++,t=o.value[e]}for(;s(t)||l(t);)e++,t=o.value[e];if(a(t)&&m(t.value)&&k.test(t.value[4].value)){if(v||!u||!p)return!1;v=t,e++,t=o.value[e]}for(;t&&(!a(t)||!h(t.value));)e++,t=o.value[e];if(g=t,!g)return!1;d=o.value.slice(e+1)}if(!u)return!1;if(p&&!v)return!1;if(v&&!p)return!1;const w=parseColorStops(d);if(!w)return!1;const D=interpolateColorsInColorStopsList(w,u,p,e);if(!D)return!1;const C=trim([...o.value.slice(0,o.value.indexOf(c)),...o.value.slice(o.value.indexOf(v||u)+1,o.value.indexOf(g))]);return C.length>0&&C.some((o=>!s(o)))&&C.push(new r([f.Comma,",",-1,-1,void 0]),new i([[f.Whitespace," ",-1,-1,void 0]])),trim([...C,...trim(D)])}function trim(o){let e=0,t=o.length-1;for(let t=0;t<o.length;t++)if(!l(o[t])){e=t;break}for(let e=o.length-1;e>=0;e--)if(!l(o[e])){t=e;break}return o.slice(e,t+1)}const basePlugin=o=>({postcssPlugin:"postcss-gradients-interpolation-method",Declaration(i){if(!P.test(i.value))return;if(e(i))return;if(t(i,P))return;const r=g({css:i.value}),n=c(u(p(r),(o=>{if(!v(o))return;const e=modifyGradientFunctionComponentValues(o);e&&(o.value=e)})));if(n===i.value)return;const s=c(u(p(r),(o=>{if(!v(o))return;const e=modifyGradientFunctionComponentValues(o,!0);e&&(o.value=e)})));i.cloneBefore({value:n}),n!==s&&i.cloneBefore({value:s}),o?.preserve||i.remove()}});basePlugin.postcss=!0;const postcssPlugin=e=>{const t=Object.assign({enableProgressiveCustomProperties:!0,preserve:!0},e);return t.enableProgressiveCustomProperties?{postcssPlugin:"postcss-gradients-interpolation-method",plugins:[o(),basePlugin(t)]}:basePlugin(t)};postcssPlugin.postcss=!0;export{postcssPlugin as default};
diff --git a/node_modules/@csstools/postcss-gradients-interpolation-method/package.json b/node_modules/@csstools/postcss-gradients-interpolation-method/package.json
index 740f20eb..3c9c9bf1 100644
--- a/node_modules/@csstools/postcss-gradients-interpolation-method/package.json
+++ b/node_modules/@csstools/postcss-gradients-interpolation-method/package.json
@@ -1,7 +1,7 @@
{
"name": "@csstools/postcss-gradients-interpolation-method",
"description": "Use interpolation methods in CSS gradient functions",
- "version": "4.0.9",
+ "version": "4.0.17",
"author": "Jonathan Neal <jonathantneal@hotmail.com>",
"license": "MIT-0",
"funding": [
@@ -38,10 +38,11 @@
"dist"
],
"dependencies": {
- "@csstools/css-color-parser": "^1.5.1",
- "@csstools/css-parser-algorithms": "^2.5.0",
- "@csstools/css-tokenizer": "^2.2.3",
- "@csstools/postcss-progressive-custom-properties": "^3.0.3"
+ "@csstools/css-color-parser": "^2.0.2",
+ "@csstools/css-parser-algorithms": "^2.6.3",
+ "@csstools/css-tokenizer": "^2.3.1",
+ "@csstools/postcss-progressive-custom-properties": "^3.2.0",
+ "@csstools/utilities": "^1.0.0"
},
"peerDependencies": {
"postcss": "^8.4"
@@ -49,7 +50,7 @@
"homepage": "https://github.com/csstools/postcss-plugins/tree/main/plugins/postcss-gradients-interpolation-method#readme",
"repository": {
"type": "git",
- "url": "https://github.com/csstools/postcss-plugins.git",
+ "url": "git+https://github.com/csstools/postcss-plugins.git",
"directory": "plugins/postcss-gradients-interpolation-method"
},
"bugs": "https://github.com/csstools/postcss-plugins/issues",
diff --git a/node_modules/@csstools/postcss-hwb-function/CHANGELOG.md b/node_modules/@csstools/postcss-hwb-function/CHANGELOG.md
index b5ae4f99..8b087a2d 100644
--- a/node_modules/@csstools/postcss-hwb-function/CHANGELOG.md
+++ b/node_modules/@csstools/postcss-hwb-function/CHANGELOG.md
@@ -1,26 +1,25 @@
# Changes to PostCSS HWB Function
-### 3.0.8
+### 3.0.15
-_December 31, 2023_
+_May 4, 2024_
-- Updated [`@csstools/css-tokenizer`](https://github.com/csstools/postcss-plugins/tree/main/packages/css-tokenizer) to [`2.2.3`](https://github.com/csstools/postcss-plugins/tree/main/packages/css-tokenizer/CHANGELOG.md#223) (patch)
-- Updated [`@csstools/css-parser-algorithms`](https://github.com/csstools/postcss-plugins/tree/main/packages/css-parser-algorithms) to [`2.5.0`](https://github.com/csstools/postcss-plugins/tree/main/packages/css-parser-algorithms/CHANGELOG.md#250) (minor)
-- Updated [`@csstools/css-color-parser`](https://github.com/csstools/postcss-plugins/tree/main/packages/css-color-parser) to [`1.5.1`](https://github.com/csstools/postcss-plugins/tree/main/packages/css-color-parser/CHANGELOG.md#151) (patch)
+- Updated [`@csstools/css-tokenizer`](https://github.com/csstools/postcss-plugins/tree/main/packages/css-tokenizer) to [`2.3.1`](https://github.com/csstools/postcss-plugins/tree/main/packages/css-tokenizer/CHANGELOG.md#231) (patch)
+- Updated [`@csstools/css-parser-algorithms`](https://github.com/csstools/postcss-plugins/tree/main/packages/css-parser-algorithms) to [`2.6.3`](https://github.com/csstools/postcss-plugins/tree/main/packages/css-parser-algorithms/CHANGELOG.md#263) (patch)
+- Updated [`@csstools/css-color-parser`](https://github.com/csstools/postcss-plugins/tree/main/packages/css-color-parser) to [`2.0.2`](https://github.com/csstools/postcss-plugins/tree/main/packages/css-color-parser/CHANGELOG.md#202) (patch)
-### 3.0.7
+### 3.0.14
-_December 15, 2023_
+_May 4, 2024_
-- Skip transforms when a color value contains experimental syntax
-- Updated [`@csstools/css-tokenizer`](https://github.com/csstools/postcss-plugins/tree/main/packages/css-tokenizer) to [`2.2.2`](https://github.com/csstools/postcss-plugins/tree/main/packages/css-tokenizer/CHANGELOG.md#222) (patch)
-- Updated [`@csstools/css-parser-algorithms`](https://github.com/csstools/postcss-plugins/tree/main/packages/css-parser-algorithms) to [`2.4.0`](https://github.com/csstools/postcss-plugins/tree/main/packages/css-parser-algorithms/CHANGELOG.md#240) (minor)
-- Updated [`@csstools/css-color-parser`](https://github.com/csstools/postcss-plugins/tree/main/packages/css-color-parser) to [`1.5.0`](https://github.com/csstools/postcss-plugins/tree/main/packages/css-color-parser/CHANGELOG.md#150) (minor)
+- Updated [`@csstools/css-tokenizer`](https://github.com/csstools/postcss-plugins/tree/main/packages/css-tokenizer) to [`2.3.0`](https://github.com/csstools/postcss-plugins/tree/main/packages/css-tokenizer/CHANGELOG.md#230) (minor)
+- Updated [`@csstools/css-parser-algorithms`](https://github.com/csstools/postcss-plugins/tree/main/packages/css-parser-algorithms) to [`2.6.2`](https://github.com/csstools/postcss-plugins/tree/main/packages/css-parser-algorithms/CHANGELOG.md#262) (patch)
+- Updated [`@csstools/css-color-parser`](https://github.com/csstools/postcss-plugins/tree/main/packages/css-color-parser) to [`2.0.1`](https://github.com/csstools/postcss-plugins/tree/main/packages/css-color-parser/CHANGELOG.md#201) (patch)
-### 3.0.6
+### 3.0.13
-_October 9, 2023_
+_April 21, 2024_
-- Updated [`@csstools/css-color-parser`](https://github.com/csstools/postcss-plugins/tree/main/packages/css-color-parser) to [`1.4.0`](https://github.com/csstools/postcss-plugins/tree/main/packages/css-color-parser/CHANGELOG.md#140) (minor)
+- Updated [`@csstools/css-color-parser`](https://github.com/csstools/postcss-plugins/tree/main/packages/css-color-parser) to [`2.0.0`](https://github.com/csstools/postcss-plugins/tree/main/packages/css-color-parser/CHANGELOG.md#200) (major)
[Full CHANGELOG](https://github.com/csstools/postcss-plugins/tree/main/plugins/postcss-hwb-function/CHANGELOG.md)
diff --git a/node_modules/@csstools/postcss-hwb-function/INSTALL.md b/node_modules/@csstools/postcss-hwb-function/INSTALL.md
deleted file mode 100644
index eaf1cf25..00000000
--- a/node_modules/@csstools/postcss-hwb-function/INSTALL.md
+++ /dev/null
@@ -1,235 +0,0 @@
-# Installing PostCSS HWB Function
-
-[PostCSS HWB Function] runs in all Node environments, with special instructions for:
-
-- [Node](#node)
-- [PostCSS CLI](#postcss-cli)
-- [PostCSS Load Config](#postcss-load-config)
-- [Webpack](#webpack)
-- [Next.js](#nextjs)
-- [Gulp](#gulp)
-- [Grunt](#grunt)
-
-
-
-## Node
-
-Add [PostCSS HWB Function] to your project:
-
-```bash
-npm install postcss @csstools/postcss-hwb-function --save-dev
-```
-
-Use it as a [PostCSS] plugin:
-
-```js
-// commonjs
-const postcss = require('postcss');
-const postcssHWBFunction = require('@csstools/postcss-hwb-function');
-
-postcss([
- postcssHWBFunction(/* pluginOptions */)
-]).process(YOUR_CSS /*, processOptions */);
-```
-
-```js
-// esm
-import postcss from 'postcss';
-import postcssHWBFunction from '@csstools/postcss-hwb-function';
-
-postcss([
- postcssHWBFunction(/* pluginOptions */)
-]).process(YOUR_CSS /*, processOptions */);
-```
-
-## PostCSS CLI
-
-Add [PostCSS CLI] to your project:
-
-```bash
-npm install postcss-cli @csstools/postcss-hwb-function --save-dev
-```
-
-Use [PostCSS HWB Function] in your `postcss.config.js` configuration file:
-
-```js
-const postcssHWBFunction = require('@csstools/postcss-hwb-function');
-
-module.exports = {
- plugins: [
- postcssHWBFunction(/* pluginOptions */)
- ]
-}
-```
-
-## PostCSS Load Config
-
-If your framework/CLI supports [`postcss-load-config`](https://github.com/postcss/postcss-load-config).
-
-```bash
-npm install @csstools/postcss-hwb-function --save-dev
-```
-
-`package.json`:
-
-```json
-{
- "postcss": {
- "plugins": {
- "@csstools/postcss-hwb-function": {}
- }
- }
-}
-```
-
-`.postcssrc.json`:
-
-```json
-{
- "plugins": {
- "@csstools/postcss-hwb-function": {}
- }
-}
-```
-
-_See the [README of `postcss-load-config`](https://github.com/postcss/postcss-load-config#usage) for more usage options._
-
-## Webpack
-
-_Webpack version 5_
-
-Add [PostCSS Loader] to your project:
-
-```bash
-npm install postcss-loader @csstools/postcss-hwb-function --save-dev
-```
-
-Use [PostCSS HWB Function] in your Webpack configuration:
-
-```js
-module.exports = {
- module: {
- rules: [
- {
- test: /\.css$/i,
- use: [
- "style-loader",
- {
- loader: "css-loader",
- options: { importLoaders: 1 },
- },
- {
- loader: "postcss-loader",
- options: {
- postcssOptions: {
- plugins: [
- // Other plugins,
- [
- "@csstools/postcss-hwb-function",
- {
- // Options
- },
- ],
- ],
- },
- },
- },
- ],
- },
- ],
- },
-};
-```
-
-## Next.js
-
-Read the instructions on how to [customize the PostCSS configuration in Next.js](https://nextjs.org/docs/advanced-features/customizing-postcss-config)
-
-```bash
-npm install @csstools/postcss-hwb-function --save-dev
-```
-
-Use [PostCSS HWB Function] in your `postcss.config.json` file:
-
-```json
-{
- "plugins": [
- "@csstools/postcss-hwb-function"
- ]
-}
-```
-
-```json5
-{
- "plugins": [
- [
- "@csstools/postcss-hwb-function",
- {
- // Optionally add plugin options
- }
- ]
- ]
-}
-```
-
-## Gulp
-
-Add [Gulp PostCSS] to your project:
-
-```bash
-npm install gulp-postcss @csstools/postcss-hwb-function --save-dev
-```
-
-Use [PostCSS HWB Function] in your Gulpfile:
-
-```js
-const postcss = require('gulp-postcss');
-const postcssHWBFunction = require('@csstools/postcss-hwb-function');
-
-gulp.task('css', function () {
- var plugins = [
- postcssHWBFunction(/* pluginOptions */)
- ];
-
- return gulp.src('./src/*.css')
- .pipe(postcss(plugins))
- .pipe(gulp.dest('.'));
-});
-```
-
-## Grunt
-
-Add [Grunt PostCSS] to your project:
-
-```bash
-npm install grunt-postcss @csstools/postcss-hwb-function --save-dev
-```
-
-Use [PostCSS HWB Function] in your Gruntfile:
-
-```js
-const postcssHWBFunction = require('@csstools/postcss-hwb-function');
-
-grunt.loadNpmTasks('grunt-postcss');
-
-grunt.initConfig({
- postcss: {
- options: {
- processors: [
- postcssHWBFunction(/* pluginOptions */)
- ]
- },
- dist: {
- src: '*.css'
- }
- }
-});
-```
-
-[Gulp PostCSS]: https://github.com/postcss/gulp-postcss
-[Grunt PostCSS]: https://github.com/nDmitry/grunt-postcss
-[PostCSS]: https://github.com/postcss/postcss
-[PostCSS CLI]: https://github.com/postcss/postcss-cli
-[PostCSS Loader]: https://github.com/postcss/postcss-loader
-[PostCSS HWB Function]: https://github.com/csstools/postcss-plugins/tree/main/plugins/postcss-hwb-function
-[Next.js]: https://nextjs.org
diff --git a/node_modules/@csstools/postcss-hwb-function/README.md b/node_modules/@csstools/postcss-hwb-function/README.md
index 3f068a4c..6fde9eba 100644
--- a/node_modules/@csstools/postcss-hwb-function/README.md
+++ b/node_modules/@csstools/postcss-hwb-function/README.md
@@ -1,26 +1,30 @@
-# PostCSS HWB Function [<img src="https://postcss.github.io/postcss/logo.svg" alt="PostCSS Logo" width="90" height="90" align="right">][postcss]
+# PostCSS HWB Function [<img src="https://postcss.github.io/postcss/logo.svg" alt="PostCSS Logo" width="90" height="90" align="right">][PostCSS]
-[<img alt="npm version" src="https://img.shields.io/npm/v/@csstools/postcss-hwb-function.svg" height="20">][npm-url]
-[<img alt="Build Status" src="https://github.com/csstools/postcss-plugins/workflows/test/badge.svg" height="20">][cli-url]
-[<img alt="Discord" src="https://shields.io/badge/Discord-5865F2?logo=discord&logoColor=white">][discord]
-<br><br>
-[<img alt="Baseline Status" src="https://cssdb.org/images/badges-baseline/hwb-function.svg" height="20">][css-url]
-[<img alt="CSS Standard Status" src="https://cssdb.org/images/badges/hwb-function.svg" height="20">][css-url]
+[<img alt="npm version" src="https://img.shields.io/npm/v/@csstools/postcss-hwb-function.svg" height="20">][npm-url] [<img alt="Build Status" src="https://github.com/csstools/postcss-plugins/workflows/test/badge.svg" height="20">][cli-url] [<img alt="Discord" src="https://shields.io/badge/Discord-5865F2?logo=discord&logoColor=white">][discord]<br><br>[<img alt="Baseline Status" src="https://cssdb.org/images/badges-baseline/hwb-function.svg" height="20">][css-url] [<img alt="CSS Standard Status" src="https://cssdb.org/images/badges/hwb-function.svg" height="20">][css-url]
-[PostCSS HWB Function] lets you use `hwb` color functions in
-CSS, following the [CSS Color] specification.
+```bash
+npm install @csstools/postcss-hwb-function --save-dev
+```
+
+[PostCSS HWB Function] lets you use the `hwb()` color function in CSS, following [CSS Color Module 4].
```pcss
a {
color: hwb(194 0% 0%);
+}
+
+b {
color: hwb(194 0% 0% / .5);
}
/* becomes */
a {
- color: rgb(0, 195, 255);
- color: rgba(0, 195, 255, .5);
+ color: rgb(0, 196, 255);
+}
+
+b {
+ color: rgba(0, 196, 255, 0.5);
}
```
@@ -39,21 +43,26 @@ const postcss = require('postcss');
const postcssHWBFunction = require('@csstools/postcss-hwb-function');
postcss([
- postcssHWBFunction(/* pluginOptions */)
+ postcssHWBFunction(/* pluginOptions */)
]).process(YOUR_CSS /*, processOptions */);
```
[PostCSS HWB Function] runs in all Node environments, with special
instructions for:
-| [Node](INSTALL.md#node) | [PostCSS CLI](INSTALL.md#postcss-cli) | [Webpack](INSTALL.md#webpack) | [Gulp](INSTALL.md#gulp) | [Grunt](INSTALL.md#grunt) |
-| --- | --- | --- | --- | --- |
+- [Node](INSTALL.md#node)
+- [PostCSS CLI](INSTALL.md#postcss-cli)
+- [PostCSS Load Config](INSTALL.md#postcss-load-config)
+- [Webpack](INSTALL.md#webpack)
+- [Next.js](INSTALL.md#nextjs)
+- [Gulp](INSTALL.md#gulp)
+- [Grunt](INSTALL.md#grunt)
## Options
### preserve
-The `preserve` option determines whether the original functional color notation
+The `preserve` option determines whether the original notation
is preserved. By default, it is not preserved.
```js
@@ -63,15 +72,21 @@ postcssHWBFunction({ preserve: true })
```pcss
a {
color: hwb(194 0% 0%);
+}
+
+b {
color: hwb(194 0% 0% / .5);
}
/* becomes */
a {
- color: rgb(0, 195, 255);
+ color: rgb(0, 196, 255);
color: hwb(194 0% 0%);
- color: rgba(0, 195, 255, .5);
+}
+
+b {
+ color: rgba(0, 196, 255, 0.5);
color: hwb(194 0% 0% / .5);
}
```
@@ -81,9 +96,6 @@ a {
[discord]: https://discord.gg/bUadyRwkJS
[npm-url]: https://www.npmjs.com/package/@csstools/postcss-hwb-function
-[CSS Color]: https://drafts.csswg.org/css-color/#the-hwb-notation
-[Gulp PostCSS]: https://github.com/postcss/gulp-postcss
-[Grunt PostCSS]: https://github.com/nDmitry/grunt-postcss
[PostCSS]: https://github.com/postcss/postcss
-[PostCSS Loader]: https://github.com/postcss/postcss-loader
[PostCSS HWB Function]: https://github.com/csstools/postcss-plugins/tree/main/plugins/postcss-hwb-function
+[CSS Color Module 4]: https://www.w3.org/TR/css-color-4/#the-hwb-notation
diff --git a/node_modules/@csstools/postcss-hwb-function/dist/index.cjs b/node_modules/@csstools/postcss-hwb-function/dist/index.cjs
index f5aa6511..11fc03b4 100644
--- a/node_modules/@csstools/postcss-hwb-function/dist/index.cjs
+++ b/node_modules/@csstools/postcss-hwb-function/dist/index.cjs
@@ -1 +1 @@
-"use strict";var e=require("@csstools/css-color-parser"),t=require("@csstools/css-parser-algorithms"),r=require("@csstools/css-tokenizer");const s="(color: hwb(0 0% 0%))";function hasSupportsAtRuleAncestor(e){let t=e.parent;for(;t;)if("atrule"===t.type){if("supports"===t.name.toLowerCase()&&t.params.includes(s))return!0;t=t.parent}else t=t.parent;return!1}function hasFallback(e){const t=e.parent;if(!t)return!1;const r=e.prop.toLowerCase(),s=t.index(e);for(let e=0;e<s;e++){const s=t.nodes[e];if("decl"===s.type&&s.prop.toLowerCase()===r)return!0}return!1}const o=/hwb\(/i,a=/^hwb$/i,postcssPlugin=n=>{const l="preserve"in Object(n)&&Boolean(n?.preserve);return{postcssPlugin:"postcss-hwb-function",Declaration:(n,{postcss:p})=>{const c=n.value;if(!o.test(c))return;if(l&&hasSupportsAtRuleAncestor(n))return;if(hasFallback(n))return;const u=t.replaceComponentValues(t.parseCommaSeparatedListOfComponentValues(r.tokenize({css:c})),(r=>{if(!t.isFunctionNode(r)||!a.test(r.getName()))return;const s=e.color(r);return s&&!(s.syntaxFlags.has(e.SyntaxFlag.Experimental)||s.syntaxFlags.has(e.SyntaxFlag.HasNoneKeywords)||s.syntaxFlags.has(e.SyntaxFlag.RelativeColorSyntax))?e.serializeRGB(s):void 0})),i=t.stringify(u);if(i!==c)if(n.variable&&l&&n.parent){const e=n.parent,t=p.atRule({name:"supports",params:s,source:n.source}),r=e.clone();r.removeAll(),r.append(n.clone()),t.append(r),insertAtSupportsAfterCorrectRule(t,e,s),n.replaceWith(n.clone({value:i}))}else l?n.cloneBefore({value:i}):n.replaceWith(n.clone({value:i}))}}};function insertAtSupportsAfterCorrectRule(e,t,r){let s=t,o=t.next();for(;s&&o&&"atrule"===o.type&&"supports"===o.name.toLowerCase()&&o.params===r;)s=o,o=o.next();s.after(e)}postcssPlugin.postcss=!0,module.exports=postcssPlugin;
+"use strict";var s=require("@csstools/postcss-progressive-custom-properties"),e=require("@csstools/css-color-parser"),t=require("@csstools/utilities"),r=require("@csstools/css-parser-algorithms"),o=require("@csstools/css-tokenizer");const a=/\bhwb\(/i,n=/^hwb$/i,basePlugin=s=>({postcssPlugin:"postcss-hwb-function",Declaration(i){const c=i.value;if(!a.test(c))return;if(t.hasFallback(i))return;if(t.hasSupportsAtRuleAncestor(i,a))return;const l=r.replaceComponentValues(r.parseCommaSeparatedListOfComponentValues(o.tokenize({css:c})),(s=>{if(!r.isFunctionNode(s)||!n.test(s.getName()))return;const t=e.color(s);return t&&!(t.syntaxFlags.has(e.SyntaxFlag.Experimental)||t.syntaxFlags.has(e.SyntaxFlag.HasNoneKeywords)||t.syntaxFlags.has(e.SyntaxFlag.RelativeColorSyntax))?e.serializeRGB(t):void 0})),u=r.stringify(l);u!==c&&(i.cloneBefore({value:u}),s?.preserve||i.remove())}});basePlugin.postcss=!0;const postcssPlugin=e=>{const t=Object.assign({preserve:!1,enableProgressiveCustomProperties:!0},e);return t.enableProgressiveCustomProperties&&t.preserve?{postcssPlugin:"postcss-hwb-function",plugins:[s(),basePlugin(t)]}:basePlugin(t)};postcssPlugin.postcss=!0,module.exports=postcssPlugin;
diff --git a/node_modules/@csstools/postcss-hwb-function/dist/index.d.ts b/node_modules/@csstools/postcss-hwb-function/dist/index.d.ts
index d469e87a..f502980c 100644
--- a/node_modules/@csstools/postcss-hwb-function/dist/index.d.ts
+++ b/node_modules/@csstools/postcss-hwb-function/dist/index.d.ts
@@ -1,9 +1,17 @@
import type { PluginCreator } from 'postcss';
/** postcss-hwb-function plugin options */
+export declare type basePluginOptions = {
+ /** Preserve the original notation. default: false */
+ preserve?: boolean;
+};
+
+/** postcss-hwb-function plugin options */
export declare type pluginOptions = {
/** Preserve the original notation. default: false */
preserve?: boolean;
+ /** Enable "@csstools/postcss-progressive-custom-properties". default: true */
+ enableProgressiveCustomProperties?: boolean;
};
/** Transform hwb() functions in CSS. */
diff --git a/node_modules/@csstools/postcss-hwb-function/dist/index.mjs b/node_modules/@csstools/postcss-hwb-function/dist/index.mjs
index 157f55fb..d4af1683 100644
--- a/node_modules/@csstools/postcss-hwb-function/dist/index.mjs
+++ b/node_modules/@csstools/postcss-hwb-function/dist/index.mjs
@@ -1 +1 @@
-import{color as e,SyntaxFlag as t,serializeRGB as r}from"@csstools/css-color-parser";import{replaceComponentValues as s,parseCommaSeparatedListOfComponentValues as o,isFunctionNode as n,stringify as a}from"@csstools/css-parser-algorithms";import{tokenize as p}from"@csstools/css-tokenizer";const l="(color: hwb(0 0% 0%))";function hasSupportsAtRuleAncestor(e){let t=e.parent;for(;t;)if("atrule"===t.type){if("supports"===t.name.toLowerCase()&&t.params.includes(l))return!0;t=t.parent}else t=t.parent;return!1}function hasFallback(e){const t=e.parent;if(!t)return!1;const r=e.prop.toLowerCase(),s=t.index(e);for(let e=0;e<s;e++){const s=t.nodes[e];if("decl"===s.type&&s.prop.toLowerCase()===r)return!0}return!1}const c=/hwb\(/i,u=/^hwb$/i,postcssPlugin=i=>{const f="preserve"in Object(i)&&Boolean(i?.preserve);return{postcssPlugin:"postcss-hwb-function",Declaration:(i,{postcss:m})=>{const h=i.value;if(!c.test(h))return;if(f&&hasSupportsAtRuleAncestor(i))return;if(hasFallback(i))return;const v=s(o(p({css:h})),(s=>{if(!n(s)||!u.test(s.getName()))return;const o=e(s);return o&&!(o.syntaxFlags.has(t.Experimental)||o.syntaxFlags.has(t.HasNoneKeywords)||o.syntaxFlags.has(t.RelativeColorSyntax))?r(o):void 0})),d=a(v);if(d!==h)if(i.variable&&f&&i.parent){const e=i.parent,t=m.atRule({name:"supports",params:l,source:i.source}),r=e.clone();r.removeAll(),r.append(i.clone()),t.append(r),insertAtSupportsAfterCorrectRule(t,e,l),i.replaceWith(i.clone({value:d}))}else f?i.cloneBefore({value:d}):i.replaceWith(i.clone({value:d}))}}};function insertAtSupportsAfterCorrectRule(e,t,r){let s=t,o=t.next();for(;s&&o&&"atrule"===o.type&&"supports"===o.name.toLowerCase()&&o.params===r;)s=o,o=o.next();s.after(e)}postcssPlugin.postcss=!0;export{postcssPlugin as default};
+import s from"@csstools/postcss-progressive-custom-properties";import{color as o,SyntaxFlag as e,serializeRGB as t}from"@csstools/css-color-parser";import{hasFallback as r,hasSupportsAtRuleAncestor as i}from"@csstools/utilities";import{replaceComponentValues as n,parseCommaSeparatedListOfComponentValues as c,isFunctionNode as a,stringify as p}from"@csstools/css-parser-algorithms";import{tokenize as l}from"@csstools/css-tokenizer";const u=/\bhwb\(/i,m=/^hwb$/i,basePlugin=s=>({postcssPlugin:"postcss-hwb-function",Declaration(f){const g=f.value;if(!u.test(g))return;if(r(f))return;if(i(f,u))return;const v=n(c(l({css:g})),(s=>{if(!a(s)||!m.test(s.getName()))return;const r=o(s);return r&&!(r.syntaxFlags.has(e.Experimental)||r.syntaxFlags.has(e.HasNoneKeywords)||r.syntaxFlags.has(e.RelativeColorSyntax))?t(r):void 0})),b=p(v);b!==g&&(f.cloneBefore({value:b}),s?.preserve||f.remove())}});basePlugin.postcss=!0;const postcssPlugin=o=>{const e=Object.assign({preserve:!1,enableProgressiveCustomProperties:!0},o);return e.enableProgressiveCustomProperties&&e.preserve?{postcssPlugin:"postcss-hwb-function",plugins:[s(),basePlugin(e)]}:basePlugin(e)};postcssPlugin.postcss=!0;export{postcssPlugin as default};
diff --git a/node_modules/@csstools/postcss-hwb-function/package.json b/node_modules/@csstools/postcss-hwb-function/package.json
index 72c9d389..81ea788c 100644
--- a/node_modules/@csstools/postcss-hwb-function/package.json
+++ b/node_modules/@csstools/postcss-hwb-function/package.json
@@ -1,8 +1,18 @@
{
"name": "@csstools/postcss-hwb-function",
"description": "Use hwb() color functions in CSS",
- "version": "3.0.8",
- "author": "Jonathan Neal <jonathantneal@hotmail.com>",
+ "version": "3.0.15",
+ "contributors": [
+ {
+ "name": "Antonio Laguna",
+ "email": "antonio@laguna.es",
+ "url": "https://antonio.laguna.es"
+ },
+ {
+ "name": "Romain Menke",
+ "email": "romainmenke@gmail.com"
+ }
+ ],
"license": "MIT-0",
"funding": [
{
@@ -33,15 +43,16 @@
},
"files": [
"CHANGELOG.md",
- "INSTALL.md",
"LICENSE.md",
"README.md",
"dist"
],
"dependencies": {
- "@csstools/css-color-parser": "^1.5.1",
- "@csstools/css-parser-algorithms": "^2.5.0",
- "@csstools/css-tokenizer": "^2.2.3"
+ "@csstools/css-color-parser": "^2.0.2",
+ "@csstools/css-parser-algorithms": "^2.6.3",
+ "@csstools/css-tokenizer": "^2.3.1",
+ "@csstools/postcss-progressive-custom-properties": "^3.2.0",
+ "@csstools/utilities": "^1.0.0"
},
"peerDependencies": {
"postcss": "^8.4"
@@ -49,25 +60,18 @@
"homepage": "https://github.com/csstools/postcss-plugins/tree/main/plugins/postcss-hwb-function#readme",
"repository": {
"type": "git",
- "url": "https://github.com/csstools/postcss-plugins.git",
+ "url": "git+https://github.com/csstools/postcss-plugins.git",
"directory": "plugins/postcss-hwb-function"
},
"bugs": "https://github.com/csstools/postcss-plugins/issues",
"keywords": [
"color",
- "comma",
"css",
"design",
- "functional",
- "hsl",
- "hsla",
"hwb",
"notation",
"postcss",
"postcss-plugin",
- "rgb",
- "rgba",
- "space",
"syntax"
]
}
diff --git a/node_modules/@csstools/postcss-ic-unit/CHANGELOG.md b/node_modules/@csstools/postcss-ic-unit/CHANGELOG.md
index 31630c25..0ee60295 100644
--- a/node_modules/@csstools/postcss-ic-unit/CHANGELOG.md
+++ b/node_modules/@csstools/postcss-ic-unit/CHANGELOG.md
@@ -1,23 +1,22 @@
# Changes to PostCSS IC Unit
-### 3.0.3
+### 3.0.6
-_December 15, 2023_
+_March 31, 2024_
-- Fix type definitions
-- Updated [`@csstools/postcss-progressive-custom-properties`](https://github.com/csstools/postcss-plugins/tree/main/plugins/postcss-progressive-custom-properties) to [`3.0.3`](https://github.com/csstools/postcss-plugins/tree/main/plugins/postcss-progressive-custom-properties/CHANGELOG.md#303) (patch)
+- Updated [`@csstools/postcss-progressive-custom-properties`](https://github.com/csstools/postcss-plugins/tree/main/plugins/postcss-progressive-custom-properties) to [`3.2.0`](https://github.com/csstools/postcss-plugins/tree/main/plugins/postcss-progressive-custom-properties/CHANGELOG.md#320) (minor)
-### 3.0.2
+### 3.0.5
-_October 9, 2023_
+_March 13, 2024_
-- Updated [`@csstools/postcss-progressive-custom-properties`](https://github.com/csstools/postcss-plugins/tree/main/plugins/postcss-progressive-custom-properties) to [`3.0.2`](https://github.com/csstools/postcss-plugins/tree/main/plugins/postcss-progressive-custom-properties/CHANGELOG.md#302) (patch)
+- Updated [`@csstools/postcss-progressive-custom-properties`](https://github.com/csstools/postcss-plugins/tree/main/plugins/postcss-progressive-custom-properties) to [`3.1.1`](https://github.com/csstools/postcss-plugins/tree/main/plugins/postcss-progressive-custom-properties/CHANGELOG.md#311) (patch)
-### 3.0.1
+### 3.0.4
-_September 18, 2023_
+_February 19, 2024_
-- Improve performance
-- Updated [`@csstools/postcss-progressive-custom-properties`](https://github.com/csstools/postcss-plugins/tree/main/plugins/postcss-progressive-custom-properties) to [`3.0.1`](https://github.com/csstools/postcss-plugins/tree/main/plugins/postcss-progressive-custom-properties/CHANGELOG.md#301) (patch)
+- Reuse code with `@csstools/utilities`
+- Updated [`@csstools/postcss-progressive-custom-properties`](https://github.com/csstools/postcss-plugins/tree/main/plugins/postcss-progressive-custom-properties) to [`3.1.0`](https://github.com/csstools/postcss-plugins/tree/main/plugins/postcss-progressive-custom-properties/CHANGELOG.md#310) (minor)
[Full CHANGELOG](https://github.com/csstools/postcss-plugins/tree/main/plugins/postcss-ic-unit/CHANGELOG.md)
diff --git a/node_modules/@csstools/postcss-ic-unit/README.md b/node_modules/@csstools/postcss-ic-unit/README.md
index b7069c16..871f98d2 100644
--- a/node_modules/@csstools/postcss-ic-unit/README.md
+++ b/node_modules/@csstools/postcss-ic-unit/README.md
@@ -2,9 +2,11 @@
[<img alt="npm version" src="https://img.shields.io/npm/v/@csstools/postcss-ic-unit.svg" height="20">][npm-url]
-[<img alt="CSS Standard Status" src="https://cssdb.org/images/badges/ic-unit.svg" height="20">][css-url]
[<img alt="Build Status" src="https://github.com/csstools/postcss-plugins/workflows/test/badge.svg" height="20">][cli-url]
[<img alt="Discord" src="https://shields.io/badge/Discord-5865F2?logo=discord&logoColor=white">][discord]
+<br><br>
+[<img alt="Baseline Status" src="https://cssdb.org/images/badges-baseline/ic-unit.svg" height="20">][css-url]
+[<img alt="CSS Standard Status" src="https://cssdb.org/images/badges/ic-unit.svg" height="20">][css-url]
[PostCSS IC Unit] lets you use the ic length unit, following the [CSS Values and Units Module] specification.
diff --git a/node_modules/@csstools/postcss-ic-unit/dist/index.cjs b/node_modules/@csstools/postcss-ic-unit/dist/index.cjs
index 5d207a0c..e3e574cc 100644
--- a/node_modules/@csstools/postcss-ic-unit/dist/index.cjs
+++ b/node_modules/@csstools/postcss-ic-unit/dist/index.cjs
@@ -1 +1 @@
-"use strict";var e=require("@csstools/postcss-progressive-custom-properties"),s=require("postcss-value-parser");function hasFallback(e){const s=e.parent;if(!s)return!1;const t=e.prop.toLowerCase(),r=s.index(e);for(let e=0;e<r;e++){const r=s.nodes[e];if("decl"===r.type&&r.prop.toLowerCase()===t)return!0}return!1}function hasSupportsAtRuleAncestor(e){let s=e.parent;for(;s;)if("atrule"===s.type){if("supports"===s.name.toLowerCase()&&/\(font-size: \d+ic\)/i.test(s.params))return!0;s=s.parent}else s=s.parent;return!1}const t=/ic\b/i,basePlugin=e=>({postcssPlugin:"postcss-ic-unit",Declaration(r){if(!t.test(r.value))return;if(hasFallback(r))return;if(hasSupportsAtRuleAncestor(r))return;const o=s(r.value);o.walk((e=>{if(!e.type||"word"!==e.type)return;const t=s.unit(e.value);t&&"ic"===t.unit.toLowerCase()&&(e.value=`${t.number}em`)}));const n=String(o);n!==r.value&&(r.cloneBefore({value:n}),e?.preserve||r.remove())}});basePlugin.postcss=!0;const postcssPlugin=s=>{const t=Object.assign({preserve:!1,enableProgressiveCustomProperties:!0},s);return t.enableProgressiveCustomProperties&&t.preserve?{postcssPlugin:"postcss-ic-unit",plugins:[e(),basePlugin(t)]}:basePlugin(t)};postcssPlugin.postcss=!0,module.exports=postcssPlugin;
+"use strict";var s=require("@csstools/postcss-progressive-custom-properties"),e=require("postcss-value-parser"),r=require("@csstools/utilities");const t=/ic\b/i,o=/\(font-size: \d+ic\)/i,basePlugin=s=>({postcssPlugin:"postcss-ic-unit",Declaration(i){if(!t.test(i.value))return;if(r.hasFallback(i))return;if(r.hasSupportsAtRuleAncestor(i,o))return;const u=e(i.value);u.walk((s=>{if(!s.type||"word"!==s.type)return;const r=e.unit(s.value);r&&"ic"===r.unit.toLowerCase()&&(s.value=`${r.number}em`)}));const c=String(u);c!==i.value&&(i.cloneBefore({value:c}),s?.preserve||i.remove())}});basePlugin.postcss=!0;const postcssPlugin=e=>{const r=Object.assign({preserve:!1,enableProgressiveCustomProperties:!0},e);return r.enableProgressiveCustomProperties&&r.preserve?{postcssPlugin:"postcss-ic-unit",plugins:[s(),basePlugin(r)]}:basePlugin(r)};postcssPlugin.postcss=!0,module.exports=postcssPlugin;
diff --git a/node_modules/@csstools/postcss-ic-unit/dist/index.mjs b/node_modules/@csstools/postcss-ic-unit/dist/index.mjs
index def48e6e..f69d6fcb 100644
--- a/node_modules/@csstools/postcss-ic-unit/dist/index.mjs
+++ b/node_modules/@csstools/postcss-ic-unit/dist/index.mjs
@@ -1 +1 @@
-import e from"@csstools/postcss-progressive-custom-properties";import s from"postcss-value-parser";function hasFallback(e){const s=e.parent;if(!s)return!1;const t=e.prop.toLowerCase(),r=s.index(e);for(let e=0;e<r;e++){const r=s.nodes[e];if("decl"===r.type&&r.prop.toLowerCase()===t)return!0}return!1}function hasSupportsAtRuleAncestor(e){let s=e.parent;for(;s;)if("atrule"===s.type){if("supports"===s.name.toLowerCase()&&/\(font-size: \d+ic\)/i.test(s.params))return!0;s=s.parent}else s=s.parent;return!1}const t=/ic\b/i,basePlugin=e=>({postcssPlugin:"postcss-ic-unit",Declaration(r){if(!t.test(r.value))return;if(hasFallback(r))return;if(hasSupportsAtRuleAncestor(r))return;const o=s(r.value);o.walk((e=>{if(!e.type||"word"!==e.type)return;const t=s.unit(e.value);t&&"ic"===t.unit.toLowerCase()&&(e.value=`${t.number}em`)}));const n=String(o);n!==r.value&&(r.cloneBefore({value:n}),e?.preserve||r.remove())}});basePlugin.postcss=!0;const postcssPlugin=s=>{const t=Object.assign({preserve:!1,enableProgressiveCustomProperties:!0},s);return t.enableProgressiveCustomProperties&&t.preserve?{postcssPlugin:"postcss-ic-unit",plugins:[e(),basePlugin(t)]}:basePlugin(t)};postcssPlugin.postcss=!0;export{postcssPlugin as default};
+import s from"@csstools/postcss-progressive-custom-properties";import e from"postcss-value-parser";import{hasFallback as t,hasSupportsAtRuleAncestor as r}from"@csstools/utilities";const o=/ic\b/i,i=/\(font-size: \d+ic\)/i,basePlugin=s=>({postcssPlugin:"postcss-ic-unit",Declaration(n){if(!o.test(n.value))return;if(t(n))return;if(r(n,i))return;const c=e(n.value);c.walk((s=>{if(!s.type||"word"!==s.type)return;const t=e.unit(s.value);t&&"ic"===t.unit.toLowerCase()&&(s.value=`${t.number}em`)}));const u=String(c);u!==n.value&&(n.cloneBefore({value:u}),s?.preserve||n.remove())}});basePlugin.postcss=!0;const postcssPlugin=e=>{const t=Object.assign({preserve:!1,enableProgressiveCustomProperties:!0},e);return t.enableProgressiveCustomProperties&&t.preserve?{postcssPlugin:"postcss-ic-unit",plugins:[s(),basePlugin(t)]}:basePlugin(t)};postcssPlugin.postcss=!0;export{postcssPlugin as default};
diff --git a/node_modules/@csstools/postcss-ic-unit/package.json b/node_modules/@csstools/postcss-ic-unit/package.json
index dc14e1da..4a32b805 100644
--- a/node_modules/@csstools/postcss-ic-unit/package.json
+++ b/node_modules/@csstools/postcss-ic-unit/package.json
@@ -1,7 +1,7 @@
{
"name": "@csstools/postcss-ic-unit",
"description": "Use the ic length unit",
- "version": "3.0.3",
+ "version": "3.0.6",
"author": "Jonathan Neal <jonathantneal@hotmail.com>",
"license": "MIT-0",
"funding": [
@@ -38,7 +38,8 @@
"dist"
],
"dependencies": {
- "@csstools/postcss-progressive-custom-properties": "^3.0.3",
+ "@csstools/postcss-progressive-custom-properties": "^3.2.0",
+ "@csstools/utilities": "^1.0.0",
"postcss-value-parser": "^4.2.0"
},
"peerDependencies": {
@@ -47,7 +48,7 @@
"homepage": "https://github.com/csstools/postcss-plugins/tree/main/plugins/postcss-ic-unit#readme",
"repository": {
"type": "git",
- "url": "https://github.com/csstools/postcss-plugins.git",
+ "url": "git+https://github.com/csstools/postcss-plugins.git",
"directory": "plugins/postcss-ic-unit"
},
"bugs": "https://github.com/csstools/postcss-plugins/issues",
diff --git a/node_modules/@csstools/postcss-is-pseudo-class/CHANGELOG.md b/node_modules/@csstools/postcss-is-pseudo-class/CHANGELOG.md
index fb009385..b77b23c6 100644
--- a/node_modules/@csstools/postcss-is-pseudo-class/CHANGELOG.md
+++ b/node_modules/@csstools/postcss-is-pseudo-class/CHANGELOG.md
@@ -1,22 +1,21 @@
# Changes to PostCSS Is Pseudo Class
-### 4.0.4
+### 4.0.8
-_December 15, 2023_
+_May 13, 2024_
-- Fix type definitions
-- Updated [`@csstools/selector-specificity`](https://github.com/csstools/postcss-plugins/tree/main/packages/selector-specificity) to [`3.0.1`](https://github.com/csstools/postcss-plugins/tree/main/packages/selector-specificity/CHANGELOG.md#301) (patch)
+- Updated [`@csstools/selector-specificity`](https://github.com/csstools/postcss-plugins/tree/main/packages/selector-specificity) to [`3.1.1`](https://github.com/csstools/postcss-plugins/tree/main/packages/selector-specificity/CHANGELOG.md#311) (patch)
-### 4.0.3
+### 4.0.7
-_October 2, 2023_
+_May 11, 2024_
-- Prevent incorrect transforms when `:is()` is wrapped in `:has()`.
+- Updated [`@csstools/selector-specificity`](https://github.com/csstools/postcss-plugins/tree/main/packages/selector-specificity) to [`3.1.0`](https://github.com/csstools/postcss-plugins/tree/main/packages/selector-specificity/CHANGELOG.md#310) (minor)
-### 4.0.2
+### 4.0.6
-_September 18, 2023_
+_March 31, 2024_
-- Improve performance
+- Updated [`@csstools/selector-specificity`](https://github.com/csstools/postcss-plugins/tree/main/packages/selector-specificity) to [`3.0.3`](https://github.com/csstools/postcss-plugins/tree/main/packages/selector-specificity/CHANGELOG.md#303) (patch)
[Full CHANGELOG](https://github.com/csstools/postcss-plugins/tree/main/plugins/postcss-is-pseudo-class/CHANGELOG.md)
diff --git a/node_modules/@csstools/postcss-is-pseudo-class/README.md b/node_modules/@csstools/postcss-is-pseudo-class/README.md
index 407fab67..96430357 100644
--- a/node_modules/@csstools/postcss-is-pseudo-class/README.md
+++ b/node_modules/@csstools/postcss-is-pseudo-class/README.md
@@ -1,9 +1,11 @@
# PostCSS Is Pseudo [<img src="https://postcss.github.io/postcss/logo.svg" alt="PostCSS" width="90" height="90" align="right">][postcss]
[![NPM Version][npm-img]][npm-url]
-[![CSS Standard Status][css-img]][css-url]
[<img alt="Build Status" src="https://github.com/csstools/postcss-plugins/workflows/test/badge.svg" height="20">][cli-url]
[<img alt="Discord" src="https://shields.io/badge/Discord-5865F2?logo=discord&logoColor=white">][discord]
+<br><br>
+[<img alt="Baseline Status" src="https://cssdb.org/images/badges-baseline/is-pseudo-class.svg" height="20">][css-url]
+[![CSS Standard Status][css-img]][css-url]
[PostCSS Is Pseudo Class] lets you use the `:is` pseudo class function, following the
[CSS Selector] specification.
diff --git a/node_modules/@csstools/postcss-is-pseudo-class/dist/index.cjs b/node_modules/@csstools/postcss-is-pseudo-class/dist/index.cjs
index d1355d60..3055fe92 100644
--- a/node_modules/@csstools/postcss-is-pseudo-class/dist/index.cjs
+++ b/node_modules/@csstools/postcss-is-pseudo-class/dist/index.cjs
@@ -1 +1 @@
-"use strict";var e=require("postcss-selector-parser"),o=require("@csstools/selector-specificity");function alwaysValidSelector(o){const s=e().astSync(o);let t=!0;return s.walk((e=>{if("class"!==e.type&&"comment"!==e.type&&"id"!==e.type&&"root"!==e.type&&"selector"!==e.type&&"string"!==e.type&&"tag"!==e.type&&"universal"!==e.type&&("attribute"!==e.type||e.insensitive)&&("combinator"!==e.type||"+"!==e.value&&">"!==e.value&&"~"!==e.value&&" "!==e.value)&&("pseudo"!==e.type||e.nodes?.length||":hover"!==e.value.toLowerCase()&&":focus"!==e.value.toLowerCase())){if("pseudo"===e.type&&1===e.nodes?.length&&":not"===e.value.toLowerCase()){let o=!0;if(e.nodes[0].walkCombinators((()=>{o=!1})),o)return}return t=!1,!1}})),t}function sortCompoundSelectorsInsideComplexSelector(o){if(!o||!o.nodes||1===o.nodes.length)return;const s=[];let t=[];for(let n=0;n<o.nodes.length;n++)"combinator"!==o.nodes[n].type?e.isPseudoElement(o.nodes[n])?(s.push(t),t=[o.nodes[n]]):t.push(o.nodes[n]):(s.push(t),s.push([o.nodes[n]]),t=[]);s.push(t);const n=[];for(let e=0;e<s.length;e++){const o=s[e];o.sort(((e,o)=>"selector"===e.type&&"selector"===o.type&&e.nodes.length&&o.nodes.length?selectorTypeOrder(e.nodes[0],e.nodes[0].type)-selectorTypeOrder(o.nodes[0],o.nodes[0].type):"selector"===e.type&&e.nodes.length?selectorTypeOrder(e.nodes[0],e.nodes[0].type)-selectorTypeOrder(o,o.type):"selector"===o.type&&o.nodes.length?selectorTypeOrder(e,e.type)-selectorTypeOrder(o.nodes[0],o.nodes[0].type):selectorTypeOrder(e,e.type)-selectorTypeOrder(o,o.type)));const t=new Set(o.map((e=>e.type))),r=t.has("universal")&&(t.has("tag")||t.has("attribute")||t.has("class")||t.has("id")||t.has("pseudo"));for(let e=0;e<o.length;e++)"universal"===o[e].type&&r?o[e].remove():n.push(o[e])}for(let s=n.length-1;s>=0;s--){const t=n[s-1];if(n[s].remove(),t&&"tag"===t.type&&"tag"===n[s].type){const t=e.pseudo({value:":is",nodes:[e.selector({value:"",nodes:[n[s]]})]});o.prepend(t)}else o.prepend(n[s])}}function selectorTypeOrder(o,t){return e.isPseudoElement(o)?s.pseudoElement:s[t]}const s={universal:0,tag:1,pseudoElement:2,id:3,class:4,attribute:5,pseudo:6,selector:7,string:8,root:9,comment:10};function childAdjacentChild(e){return!(!e||!e.nodes)&&("selector"===e.type&&(3===e.nodes.length&&(!(!e.nodes[0]||"pseudo"!==e.nodes[0].type||":-csstools-matches"!==e.nodes[0].value)&&(!(!e.nodes[1]||"combinator"!==e.nodes[1].type||"+"!==e.nodes[1].value&&"~"!==e.nodes[1].value)&&(!(!e.nodes[2]||"pseudo"!==e.nodes[2].type||":-csstools-matches"!==e.nodes[2].value)&&(!(!e.nodes[0].nodes||1!==e.nodes[0].nodes.length)&&("selector"===e.nodes[0].nodes[0].type&&(!(!e.nodes[0].nodes[0].nodes||3!==e.nodes[0].nodes[0].nodes.length)&&(!(!e.nodes[0].nodes[0].nodes||"combinator"!==e.nodes[0].nodes[0].nodes[1].type||">"!==e.nodes[0].nodes[0].nodes[1].value)&&(!(!e.nodes[2].nodes||1!==e.nodes[2].nodes.length)&&("selector"===e.nodes[2].nodes[0].type&&(!(!e.nodes[2].nodes[0].nodes||3!==e.nodes[2].nodes[0].nodes.length)&&(!(!e.nodes[2].nodes[0].nodes||"combinator"!==e.nodes[2].nodes[0].nodes[1].type||">"!==e.nodes[2].nodes[0].nodes[1].value)&&(e.nodes[0].nodes[0].insertAfter(e.nodes[0].nodes[0].nodes[0],e.nodes[2].nodes[0].nodes[0].clone()),e.nodes[2].nodes[0].nodes[1].remove(),e.nodes[2].nodes[0].nodes[0].remove(),e.nodes[0].replaceWith(e.nodes[0].nodes[0]),e.nodes[2].replaceWith(e.nodes[2].nodes[0]),!0))))))))))))))}function isInCompoundWithOneOtherElement(o){if(!o||!o.nodes)return!1;if("selector"!==o.type)return!1;if(2!==o.nodes.length)return!1;let s,t;return o.nodes[0]&&"pseudo"===o.nodes[0].type&&":-csstools-matches"===o.nodes[0].value?(s=0,t=1):o.nodes[1]&&"pseudo"===o.nodes[1].type&&":-csstools-matches"===o.nodes[1].value&&(s=1,t=0),!!s&&(!!o.nodes[t]&&(("selector"!==o.nodes[t].type||!o.nodes[t].some((o=>"combinator"===o.type||e.isPseudoElement(o))))&&("combinator"!==o.nodes[t].type&&(o.nodes[s].nodes[0].append(o.nodes[t].clone()),o.nodes[s].replaceWith(...o.nodes[s].nodes[0].nodes),o.nodes[t].remove(),!0))))}function isPseudoInFirstCompound(e){if(!e||!e.nodes)return!1;if("selector"!==e.type)return!1;let o=-1;for(let s=0;s<e.nodes.length;s++){const t=e.nodes[s];if("combinator"===t.type)return!1;if("pseudo"===t.type&&":-csstools-matches"===t.value){if(!t.nodes||1!==t.nodes.length)return!1;o=s;break}}if(-1===o)return!1;const s=e.nodes.slice(0,o),t=e.nodes[o],n=e.nodes.slice(o+1);return s.forEach((e=>{t.nodes[0].append(e.clone())})),n.forEach((e=>{t.nodes[0].append(e.clone())})),t.replaceWith(...t.nodes),s.forEach((e=>{e.remove()})),n.forEach((e=>{e.remove()})),!0}function complexSelectors(o,s,t,n){return o.flatMap((o=>{if(-1===o.indexOf(":-csstools-matches")&&-1===o.toLowerCase().indexOf(":is"))return o;const r=e().astSync(o);return r.walkPseudos((o=>{if(":is"===o.value.toLowerCase()&&o.nodes&&o.nodes.length&&"selector"===o.nodes[0].type&&0===o.nodes[0].nodes.length)return o.value=":not",void o.nodes[0].append(e.universal());if(":-csstools-matches"===o.value)if(!o.nodes||o.nodes.length){if(o.walkPseudos((o=>{if(e.isPseudoElement(o)){let e=o.value;if(e.startsWith("::-csstools-invalid-"))return;for(;e.startsWith(":");)e=e.slice(1);o.value=`::-csstools-invalid-${e}`,n()}})),1===o.nodes.length&&"selector"===o.nodes[0].type){if(1===o.nodes[0].nodes.length)return void o.replaceWith(o.nodes[0].nodes[0]);if(!o.nodes[0].some((e=>"combinator"===e.type)))return void o.replaceWith(...o.nodes[0].nodes)}1!==r.nodes.length||"selector"!==r.nodes[0].type||1!==r.nodes[0].nodes.length||r.nodes[0].nodes[0]!==o?childAdjacentChild(o.parent)||isInCompoundWithOneOtherElement(o.parent)||isPseudoInFirstCompound(o.parent)||("warning"===s.onComplexSelector&&t(),o.value=":is"):o.replaceWith(...o.nodes[0].nodes)}else o.remove()})),r.walk((e=>{"selector"===e.type&&"nodes"in e&&1===e.nodes.length&&"selector"===e.nodes[0].type&&e.replaceWith(e.nodes[0])})),r.walk((e=>{"nodes"in e&&sortCompoundSelectorsInsideComplexSelector(e)})),r.toString()})).filter((e=>!!e))}function splitSelectors(s,t,n=0){const r=":not(#"+t.specificityMatchingName+")",d=":not(."+t.specificityMatchingName+")",l=":not("+t.specificityMatchingName+")";return s.flatMap((s=>{if(-1===s.toLowerCase().indexOf(":is"))return s;let c=!1;const i=[];if(e().astSync(s).walkPseudos((e=>{if(":is"!==e.value.toLowerCase()||!e.nodes||!e.nodes.length)return;if("selector"===e.nodes[0].type&&0===e.nodes[0].nodes.length)return;if("pseudo"===e.parent?.parent?.type&&":not"===e.parent?.parent?.value?.toLowerCase())return void i.push([{start:e.parent.parent.sourceIndex,end:e.parent.parent.sourceIndex+e.parent.parent.toString().length,option:`:not(${e.nodes.toString()})`}]);if("pseudo"===e.parent?.parent?.type&&":has"===e.parent?.parent?.value?.toLowerCase())return void(e.value=":-csstools-matches");let s=e.parent;for(;s;){if(s.value&&":is"===s.value.toLowerCase()&&"pseudo"===s.type)return void(c=!0);s=s.parent}const t=o.selectorSpecificity(e),n=e.sourceIndex,a=n+e.toString().length,p=[];e.nodes.forEach((e=>{const s={start:n,end:a,option:""},c=o.selectorSpecificity(e);let i=e.toString().trim();const u=Math.max(0,t.a-c.a),h=Math.max(0,t.b-c.b),f=Math.max(0,t.c-c.c);for(let e=0;e<u;e++)i+=r;for(let e=0;e<h;e++)i+=d;for(let e=0;e<f;e++)i+=l;s.option=i,p.push(s)})),i.push(p)})),!i.length)return[s];let a=[];return cartesianProduct(...i).forEach((e=>{let o="";for(let t=0;t<e.length;t++){const n=e[t];o+=s.substring(e[t-1]?.end||0,e[t].start),o+=":-csstools-matches("+n.option+")",t===e.length-1&&(o+=s.substring(e[t].end))}a.push(o)})),c&&n<10&&(a=splitSelectors(a,t,n+1)),a})).filter((e=>!!e))}function cartesianProduct(...e){const o=[],s=e.length-1;return function helper(t,n){for(let r=0,d=e[n].length;r<d;r++){const d=t.slice(0);d.push(e[n][r]),n===s?o.push(d):helper(d,n+1)}}([],0),o}const t=/:is\(/i,creator=e=>{const o={specificityMatchingName:"does-not-exist",...e||{}};return{postcssPlugin:"postcss-is-pseudo-class",prepare(){const e=new WeakSet;return{Rule(s,{result:n}){if(!s.selector)return;if(!t.test(s.selector))return;if(e.has(s))return;let r=!1;const warnOnComplexSelector=()=>{"warning"===o.onComplexSelector&&(r||(r=!0,s.warn(n,`Complex selectors in '${s.selector}' can not be transformed to an equivalent selector without ':is()'.`)))};let d=!1;const warnOnPseudoElements=()=>{"warning"===o.onPseudoElement&&(d||(d=!0,s.warn(n,`Pseudo elements are not allowed in ':is()', unable to transform '${s.selector}'`)))};try{let t=!1;const n=[],r=complexSelectors(splitSelectors(s.selectors,{specificityMatchingName:o.specificityMatchingName}),{onComplexSelector:o.onComplexSelector},warnOnComplexSelector,warnOnPseudoElements);if(Array.from(new Set(r)).forEach((o=>{if(s.selectors.indexOf(o)>-1)n.push(o);else{if(alwaysValidSelector(o))return n.push(o),void(t=!0);e.add(s),s.cloneBefore({selector:o}),t=!0}})),n.length&&t&&(e.add(s),s.cloneBefore({selectors:n})),!o.preserve){if(!t)return;s.remove()}}catch(e){if(e.message.indexOf("call stack size exceeded")>-1)throw e;s.warn(n,`Failed to parse selector "${s.selector}"`)}}}}}};creator.postcss=!0,module.exports=creator;
+"use strict";var e=require("postcss-selector-parser"),o=require("@csstools/selector-specificity");function alwaysValidSelector(o){const s=e().astSync(o);let t=!0;return s.walk((e=>{if("class"!==e.type&&"comment"!==e.type&&"id"!==e.type&&"root"!==e.type&&"selector"!==e.type&&"string"!==e.type&&"tag"!==e.type&&"universal"!==e.type&&("attribute"!==e.type||e.insensitive)&&("combinator"!==e.type||"+"!==e.value&&">"!==e.value&&"~"!==e.value&&" "!==e.value)&&("pseudo"!==e.type||e.nodes?.length||":hover"!==e.value.toLowerCase()&&":focus"!==e.value.toLowerCase())){if("pseudo"===e.type&&1===e.nodes?.length&&":not"===e.value.toLowerCase()){let o=!0;if(e.nodes[0].walkCombinators((()=>{o=!1})),o)return}return t=!1,!1}})),t}function sortCompoundSelectorsInsideComplexSelector(o){if(!o||!o.nodes||1===o.nodes.length)return;const s=[];let t=[];for(let n=0;n<o.nodes.length;n++)"combinator"!==o.nodes[n].type?e.isPseudoElement(o.nodes[n])?(s.push(t),t=[o.nodes[n]]):t.push(o.nodes[n]):(s.push(t),s.push([o.nodes[n]]),t=[]);s.push(t);const n=[];for(let e=0;e<s.length;e++){const o=s[e];o.sort(((e,o)=>"selector"===e.type&&"selector"===o.type&&e.nodes.length&&o.nodes.length?selectorTypeOrder(e.nodes[0],e.nodes[0].type)-selectorTypeOrder(o.nodes[0],o.nodes[0].type):"selector"===e.type&&e.nodes.length?selectorTypeOrder(e.nodes[0],e.nodes[0].type)-selectorTypeOrder(o,o.type):"selector"===o.type&&o.nodes.length?selectorTypeOrder(e,e.type)-selectorTypeOrder(o.nodes[0],o.nodes[0].type):selectorTypeOrder(e,e.type)-selectorTypeOrder(o,o.type)));const t=new Set(o.map((e=>e.type))),r=t.has("universal")&&(t.has("tag")||t.has("attribute")||t.has("class")||t.has("id")||t.has("pseudo"));for(let e=0;e<o.length;e++)"universal"===o[e].type&&r?o[e].remove():n.push(o[e])}for(let s=n.length-1;s>=0;s--){const t=n[s-1];if(n[s].remove(),t&&"tag"===t.type&&"tag"===n[s].type){const t=e.pseudo({value:":is",nodes:[e.selector({value:"",nodes:[n[s]]})]});o.prepend(t)}else o.prepend(n[s])}}function selectorTypeOrder(o,t){return e.isPseudoElement(o)?s.pseudoElement:s[t]}const s={universal:0,tag:1,pseudoElement:2,id:3,class:4,attribute:5,pseudo:6,selector:7,string:8,root:9,comment:10};function childAdjacentChild(e){return!(!e||!e.nodes)&&("selector"===e.type&&(3===e.nodes.length&&(!(!e.nodes[0]||"pseudo"!==e.nodes[0].type||":-csstools-matches"!==e.nodes[0].value)&&(!(!e.nodes[1]||"combinator"!==e.nodes[1].type||"+"!==e.nodes[1].value&&"~"!==e.nodes[1].value)&&(!(!e.nodes[2]||"pseudo"!==e.nodes[2].type||":-csstools-matches"!==e.nodes[2].value)&&(!(!e.nodes[0].nodes||1!==e.nodes[0].nodes.length)&&("selector"===e.nodes[0].nodes[0].type&&(!(!e.nodes[0].nodes[0].nodes||3!==e.nodes[0].nodes[0].nodes.length)&&(!(!e.nodes[0].nodes[0].nodes||"combinator"!==e.nodes[0].nodes[0].nodes[1].type||">"!==e.nodes[0].nodes[0].nodes[1].value)&&(!(!e.nodes[2].nodes||1!==e.nodes[2].nodes.length)&&("selector"===e.nodes[2].nodes[0].type&&(!(!e.nodes[2].nodes[0].nodes||3!==e.nodes[2].nodes[0].nodes.length)&&(!(!e.nodes[2].nodes[0].nodes||"combinator"!==e.nodes[2].nodes[0].nodes[1].type||">"!==e.nodes[2].nodes[0].nodes[1].value)&&(e.nodes[0].nodes[0].insertAfter(e.nodes[0].nodes[0].nodes[0],e.nodes[2].nodes[0].nodes[0].clone()),e.nodes[2].nodes[0].nodes[1].remove(),e.nodes[2].nodes[0].nodes[0].remove(),e.nodes[0].replaceWith(e.nodes[0].nodes[0]),e.nodes[2].replaceWith(e.nodes[2].nodes[0]),!0))))))))))))))}function isInCompoundWithOneOtherElement(o){if(!o||!o.nodes)return!1;if("selector"!==o.type)return!1;if(2!==o.nodes.length)return!1;let s,t;return o.nodes[0]&&"pseudo"===o.nodes[0].type&&":-csstools-matches"===o.nodes[0].value?(s=0,t=1):o.nodes[1]&&"pseudo"===o.nodes[1].type&&":-csstools-matches"===o.nodes[1].value&&(s=1,t=0),!!s&&(!!o.nodes[t]&&(("selector"!==o.nodes[t].type||!o.nodes[t].some((o=>"combinator"===o.type||e.isPseudoElement(o))))&&("combinator"!==o.nodes[t].type&&(o.nodes[s].nodes[0].append(o.nodes[t].clone()),o.nodes[s].replaceWith(...o.nodes[s].nodes[0].nodes),o.nodes[t].remove(),!0))))}function isPseudoInFirstCompound(e){if(!e||!e.nodes)return!1;if("selector"!==e.type)return!1;let o=-1;for(let s=0;s<e.nodes.length;s++){const t=e.nodes[s];if("combinator"===t.type)return!1;if("pseudo"===t.type&&":-csstools-matches"===t.value){if(!t.nodes||1!==t.nodes.length)return!1;o=s;break}}if(-1===o)return!1;const s=e.nodes.slice(0,o),t=e.nodes[o],n=e.nodes.slice(o+1);return s.forEach((e=>{t.nodes[0].append(e.clone())})),n.forEach((e=>{t.nodes[0].append(e.clone())})),t.replaceWith(...t.nodes),s.forEach((e=>{e.remove()})),n.forEach((e=>{e.remove()})),!0}function complexSelectors(o,s,t,n){return o.flatMap((o=>{if(-1===o.indexOf(":-csstools-matches")&&-1===o.toLowerCase().indexOf(":is"))return o;const r=e().astSync(o);return r.walkPseudos((o=>{if(":is"===o.value.toLowerCase()&&o.nodes&&o.nodes.length&&"selector"===o.nodes[0].type&&0===o.nodes[0].nodes.length)return o.value=":not",void o.nodes[0].append(e.universal());if(":-csstools-matches"===o.value)if(!o.nodes||o.nodes.length){if(o.walkPseudos((o=>{if(e.isPseudoElement(o)){let e=o.value;if(e.startsWith("::-csstools-invalid-"))return;for(;e.startsWith(":");)e=e.slice(1);o.value=`::-csstools-invalid-${e}`,n()}})),1===o.nodes.length&&"selector"===o.nodes[0].type){if(1===o.nodes[0].nodes.length)return void o.replaceWith(o.nodes[0].nodes[0]);if(!o.nodes[0].some((e=>"combinator"===e.type)))return void o.replaceWith(...o.nodes[0].nodes)}1!==r.nodes.length||"selector"!==r.nodes[0].type||1!==r.nodes[0].nodes.length||r.nodes[0].nodes[0]!==o?childAdjacentChild(o.parent)||isInCompoundWithOneOtherElement(o.parent)||isPseudoInFirstCompound(o.parent)||("warning"===s.onComplexSelector&&t(),o.value=":is"):o.replaceWith(...o.nodes[0].nodes)}else o.remove()})),r.walk((e=>{"selector"===e.type&&"nodes"in e&&1===e.nodes.length&&"selector"===e.nodes[0].type&&e.replaceWith(e.nodes[0])})),r.walk((e=>{"nodes"in e&&sortCompoundSelectorsInsideComplexSelector(e)})),r.toString()})).filter((e=>!!e))}function splitSelectors(s,t,n=0){const r=":not(#"+t.specificityMatchingName+")",d=":not(."+t.specificityMatchingName+")",l=":not("+t.specificityMatchingName+")";return s.flatMap((s=>{if(-1===s.toLowerCase().indexOf(":is"))return s;let c=!1;const i=[];if(e().astSync(s).walkPseudos((e=>{if(":is"!==e.value.toLowerCase()||!e.nodes||!e.nodes.length)return;if("selector"===e.nodes[0].type&&0===e.nodes[0].nodes.length)return;if("pseudo"===e.parent?.parent?.type&&":not"===e.parent?.parent?.value?.toLowerCase())return void i.push([{start:e.parent.parent.sourceIndex,end:e.parent.parent.sourceIndex+e.parent.parent.toString().length,option:`:not(${e.nodes.toString()})`}]);if("pseudo"===e.parent?.parent?.type&&":has"===e.parent?.parent?.value?.toLowerCase())return void(e.value=":-csstools-matches");let s=e.parent;for(;s;){if(s.value&&":is"===s.value.toLowerCase()&&"pseudo"===s.type)return void(c=!0);s=s.parent}const t=o.selectorSpecificity(e),n=e.sourceIndex,a=n+e.toString().length,p=[];e.nodes.forEach((e=>{const s={start:n,end:a,option:""},c=o.selectorSpecificity(e);let i=e.toString().trim();const u=Math.max(0,t.a-c.a),h=Math.max(0,t.b-c.b),f=Math.max(0,t.c-c.c);for(let e=0;e<u;e++)i+=r;for(let e=0;e<h;e++)i+=d;for(let e=0;e<f;e++)i+=l;s.option=i,p.push(s)})),i.push(p)})),!i.length)return[s];let a=[];return cartesianProduct(...i).forEach((e=>{let o="";for(let t=0;t<e.length;t++){const n=e[t];o+=s.substring(e[t-1]?.end||0,e[t].start),o+=":-csstools-matches("+n.option+")",t===e.length-1&&(o+=s.substring(e[t].end))}a.push(o)})),c&&n<10&&(a=splitSelectors(a,t,n+1)),a})).filter((e=>!!e))}function cartesianProduct(...e){const o=[],s=e.length-1;return function helper(t,n){for(let r=0,d=e[n].length;r<d;r++){const d=t.slice(0);d.push(e[n][r]),n===s?o.push(d):helper(d,n+1)}}([],0),o}const t=/:is\(/i,creator=e=>{const o={specificityMatchingName:"does-not-exist",...e||{}};return{postcssPlugin:"postcss-is-pseudo-class",prepare(){const e=new WeakSet;return{postcssPlugin:"postcss-is-pseudo-class",Rule(s,{result:n}){if(!s.selector)return;if(!t.test(s.selector))return;if(e.has(s))return;let r=!1;const warnOnComplexSelector=()=>{"warning"===o.onComplexSelector&&(r||(r=!0,s.warn(n,`Complex selectors in '${s.selector}' can not be transformed to an equivalent selector without ':is()'.`)))};let d=!1;const warnOnPseudoElements=()=>{"warning"===o.onPseudoElement&&(d||(d=!0,s.warn(n,`Pseudo elements are not allowed in ':is()', unable to transform '${s.selector}'`)))};try{let t=!1;const n=[],r=complexSelectors(splitSelectors(s.selectors,{specificityMatchingName:o.specificityMatchingName}),{onComplexSelector:o.onComplexSelector},warnOnComplexSelector,warnOnPseudoElements);if(Array.from(new Set(r)).forEach((o=>{if(s.selectors.indexOf(o)>-1)n.push(o);else{if(alwaysValidSelector(o))return n.push(o),void(t=!0);e.add(s),s.cloneBefore({selector:o}),t=!0}})),n.length&&t&&(e.add(s),s.cloneBefore({selectors:n})),!o.preserve){if(!t)return;s.remove()}}catch(e){if(e.message.indexOf("call stack size exceeded")>-1)throw e;s.warn(n,`Failed to parse selector "${s.selector}" with error: ${e.message}`)}}}}}};creator.postcss=!0,module.exports=creator;
diff --git a/node_modules/@csstools/postcss-is-pseudo-class/dist/index.mjs b/node_modules/@csstools/postcss-is-pseudo-class/dist/index.mjs
index a3b17fa5..2d34a4d2 100644
--- a/node_modules/@csstools/postcss-is-pseudo-class/dist/index.mjs
+++ b/node_modules/@csstools/postcss-is-pseudo-class/dist/index.mjs
@@ -1 +1 @@
-import e from"postcss-selector-parser";import{selectorSpecificity as o}from"@csstools/selector-specificity";function alwaysValidSelector(o){const s=e().astSync(o);let t=!0;return s.walk((e=>{if("class"!==e.type&&"comment"!==e.type&&"id"!==e.type&&"root"!==e.type&&"selector"!==e.type&&"string"!==e.type&&"tag"!==e.type&&"universal"!==e.type&&("attribute"!==e.type||e.insensitive)&&("combinator"!==e.type||"+"!==e.value&&">"!==e.value&&"~"!==e.value&&" "!==e.value)&&("pseudo"!==e.type||e.nodes?.length||":hover"!==e.value.toLowerCase()&&":focus"!==e.value.toLowerCase())){if("pseudo"===e.type&&1===e.nodes?.length&&":not"===e.value.toLowerCase()){let o=!0;if(e.nodes[0].walkCombinators((()=>{o=!1})),o)return}return t=!1,!1}})),t}function sortCompoundSelectorsInsideComplexSelector(o){if(!o||!o.nodes||1===o.nodes.length)return;const s=[];let t=[];for(let n=0;n<o.nodes.length;n++)"combinator"!==o.nodes[n].type?e.isPseudoElement(o.nodes[n])?(s.push(t),t=[o.nodes[n]]):t.push(o.nodes[n]):(s.push(t),s.push([o.nodes[n]]),t=[]);s.push(t);const n=[];for(let e=0;e<s.length;e++){const o=s[e];o.sort(((e,o)=>"selector"===e.type&&"selector"===o.type&&e.nodes.length&&o.nodes.length?selectorTypeOrder(e.nodes[0],e.nodes[0].type)-selectorTypeOrder(o.nodes[0],o.nodes[0].type):"selector"===e.type&&e.nodes.length?selectorTypeOrder(e.nodes[0],e.nodes[0].type)-selectorTypeOrder(o,o.type):"selector"===o.type&&o.nodes.length?selectorTypeOrder(e,e.type)-selectorTypeOrder(o.nodes[0],o.nodes[0].type):selectorTypeOrder(e,e.type)-selectorTypeOrder(o,o.type)));const t=new Set(o.map((e=>e.type))),r=t.has("universal")&&(t.has("tag")||t.has("attribute")||t.has("class")||t.has("id")||t.has("pseudo"));for(let e=0;e<o.length;e++)"universal"===o[e].type&&r?o[e].remove():n.push(o[e])}for(let s=n.length-1;s>=0;s--){const t=n[s-1];if(n[s].remove(),t&&"tag"===t.type&&"tag"===n[s].type){const t=e.pseudo({value:":is",nodes:[e.selector({value:"",nodes:[n[s]]})]});o.prepend(t)}else o.prepend(n[s])}}function selectorTypeOrder(o,t){return e.isPseudoElement(o)?s.pseudoElement:s[t]}const s={universal:0,tag:1,pseudoElement:2,id:3,class:4,attribute:5,pseudo:6,selector:7,string:8,root:9,comment:10};function childAdjacentChild(e){return!(!e||!e.nodes)&&("selector"===e.type&&(3===e.nodes.length&&(!(!e.nodes[0]||"pseudo"!==e.nodes[0].type||":-csstools-matches"!==e.nodes[0].value)&&(!(!e.nodes[1]||"combinator"!==e.nodes[1].type||"+"!==e.nodes[1].value&&"~"!==e.nodes[1].value)&&(!(!e.nodes[2]||"pseudo"!==e.nodes[2].type||":-csstools-matches"!==e.nodes[2].value)&&(!(!e.nodes[0].nodes||1!==e.nodes[0].nodes.length)&&("selector"===e.nodes[0].nodes[0].type&&(!(!e.nodes[0].nodes[0].nodes||3!==e.nodes[0].nodes[0].nodes.length)&&(!(!e.nodes[0].nodes[0].nodes||"combinator"!==e.nodes[0].nodes[0].nodes[1].type||">"!==e.nodes[0].nodes[0].nodes[1].value)&&(!(!e.nodes[2].nodes||1!==e.nodes[2].nodes.length)&&("selector"===e.nodes[2].nodes[0].type&&(!(!e.nodes[2].nodes[0].nodes||3!==e.nodes[2].nodes[0].nodes.length)&&(!(!e.nodes[2].nodes[0].nodes||"combinator"!==e.nodes[2].nodes[0].nodes[1].type||">"!==e.nodes[2].nodes[0].nodes[1].value)&&(e.nodes[0].nodes[0].insertAfter(e.nodes[0].nodes[0].nodes[0],e.nodes[2].nodes[0].nodes[0].clone()),e.nodes[2].nodes[0].nodes[1].remove(),e.nodes[2].nodes[0].nodes[0].remove(),e.nodes[0].replaceWith(e.nodes[0].nodes[0]),e.nodes[2].replaceWith(e.nodes[2].nodes[0]),!0))))))))))))))}function isInCompoundWithOneOtherElement(o){if(!o||!o.nodes)return!1;if("selector"!==o.type)return!1;if(2!==o.nodes.length)return!1;let s,t;return o.nodes[0]&&"pseudo"===o.nodes[0].type&&":-csstools-matches"===o.nodes[0].value?(s=0,t=1):o.nodes[1]&&"pseudo"===o.nodes[1].type&&":-csstools-matches"===o.nodes[1].value&&(s=1,t=0),!!s&&(!!o.nodes[t]&&(("selector"!==o.nodes[t].type||!o.nodes[t].some((o=>"combinator"===o.type||e.isPseudoElement(o))))&&("combinator"!==o.nodes[t].type&&(o.nodes[s].nodes[0].append(o.nodes[t].clone()),o.nodes[s].replaceWith(...o.nodes[s].nodes[0].nodes),o.nodes[t].remove(),!0))))}function isPseudoInFirstCompound(e){if(!e||!e.nodes)return!1;if("selector"!==e.type)return!1;let o=-1;for(let s=0;s<e.nodes.length;s++){const t=e.nodes[s];if("combinator"===t.type)return!1;if("pseudo"===t.type&&":-csstools-matches"===t.value){if(!t.nodes||1!==t.nodes.length)return!1;o=s;break}}if(-1===o)return!1;const s=e.nodes.slice(0,o),t=e.nodes[o],n=e.nodes.slice(o+1);return s.forEach((e=>{t.nodes[0].append(e.clone())})),n.forEach((e=>{t.nodes[0].append(e.clone())})),t.replaceWith(...t.nodes),s.forEach((e=>{e.remove()})),n.forEach((e=>{e.remove()})),!0}function complexSelectors(o,s,t,n){return o.flatMap((o=>{if(-1===o.indexOf(":-csstools-matches")&&-1===o.toLowerCase().indexOf(":is"))return o;const r=e().astSync(o);return r.walkPseudos((o=>{if(":is"===o.value.toLowerCase()&&o.nodes&&o.nodes.length&&"selector"===o.nodes[0].type&&0===o.nodes[0].nodes.length)return o.value=":not",void o.nodes[0].append(e.universal());if(":-csstools-matches"===o.value)if(!o.nodes||o.nodes.length){if(o.walkPseudos((o=>{if(e.isPseudoElement(o)){let e=o.value;if(e.startsWith("::-csstools-invalid-"))return;for(;e.startsWith(":");)e=e.slice(1);o.value=`::-csstools-invalid-${e}`,n()}})),1===o.nodes.length&&"selector"===o.nodes[0].type){if(1===o.nodes[0].nodes.length)return void o.replaceWith(o.nodes[0].nodes[0]);if(!o.nodes[0].some((e=>"combinator"===e.type)))return void o.replaceWith(...o.nodes[0].nodes)}1!==r.nodes.length||"selector"!==r.nodes[0].type||1!==r.nodes[0].nodes.length||r.nodes[0].nodes[0]!==o?childAdjacentChild(o.parent)||isInCompoundWithOneOtherElement(o.parent)||isPseudoInFirstCompound(o.parent)||("warning"===s.onComplexSelector&&t(),o.value=":is"):o.replaceWith(...o.nodes[0].nodes)}else o.remove()})),r.walk((e=>{"selector"===e.type&&"nodes"in e&&1===e.nodes.length&&"selector"===e.nodes[0].type&&e.replaceWith(e.nodes[0])})),r.walk((e=>{"nodes"in e&&sortCompoundSelectorsInsideComplexSelector(e)})),r.toString()})).filter((e=>!!e))}function splitSelectors(s,t,n=0){const r=":not(#"+t.specificityMatchingName+")",d=":not(."+t.specificityMatchingName+")",l=":not("+t.specificityMatchingName+")";return s.flatMap((s=>{if(-1===s.toLowerCase().indexOf(":is"))return s;let a=!1;const c=[];if(e().astSync(s).walkPseudos((e=>{if(":is"!==e.value.toLowerCase()||!e.nodes||!e.nodes.length)return;if("selector"===e.nodes[0].type&&0===e.nodes[0].nodes.length)return;if("pseudo"===e.parent?.parent?.type&&":not"===e.parent?.parent?.value?.toLowerCase())return void c.push([{start:e.parent.parent.sourceIndex,end:e.parent.parent.sourceIndex+e.parent.parent.toString().length,option:`:not(${e.nodes.toString()})`}]);if("pseudo"===e.parent?.parent?.type&&":has"===e.parent?.parent?.value?.toLowerCase())return void(e.value=":-csstools-matches");let s=e.parent;for(;s;){if(s.value&&":is"===s.value.toLowerCase()&&"pseudo"===s.type)return void(a=!0);s=s.parent}const t=o(e),n=e.sourceIndex,i=n+e.toString().length,p=[];e.nodes.forEach((e=>{const s={start:n,end:i,option:""},a=o(e);let c=e.toString().trim();const u=Math.max(0,t.a-a.a),h=Math.max(0,t.b-a.b),f=Math.max(0,t.c-a.c);for(let e=0;e<u;e++)c+=r;for(let e=0;e<h;e++)c+=d;for(let e=0;e<f;e++)c+=l;s.option=c,p.push(s)})),c.push(p)})),!c.length)return[s];let i=[];return cartesianProduct(...c).forEach((e=>{let o="";for(let t=0;t<e.length;t++){const n=e[t];o+=s.substring(e[t-1]?.end||0,e[t].start),o+=":-csstools-matches("+n.option+")",t===e.length-1&&(o+=s.substring(e[t].end))}i.push(o)})),a&&n<10&&(i=splitSelectors(i,t,n+1)),i})).filter((e=>!!e))}function cartesianProduct(...e){const o=[],s=e.length-1;return function helper(t,n){for(let r=0,d=e[n].length;r<d;r++){const d=t.slice(0);d.push(e[n][r]),n===s?o.push(d):helper(d,n+1)}}([],0),o}const t=/:is\(/i,creator=e=>{const o={specificityMatchingName:"does-not-exist",...e||{}};return{postcssPlugin:"postcss-is-pseudo-class",prepare(){const e=new WeakSet;return{Rule(s,{result:n}){if(!s.selector)return;if(!t.test(s.selector))return;if(e.has(s))return;let r=!1;const warnOnComplexSelector=()=>{"warning"===o.onComplexSelector&&(r||(r=!0,s.warn(n,`Complex selectors in '${s.selector}' can not be transformed to an equivalent selector without ':is()'.`)))};let d=!1;const warnOnPseudoElements=()=>{"warning"===o.onPseudoElement&&(d||(d=!0,s.warn(n,`Pseudo elements are not allowed in ':is()', unable to transform '${s.selector}'`)))};try{let t=!1;const n=[],r=complexSelectors(splitSelectors(s.selectors,{specificityMatchingName:o.specificityMatchingName}),{onComplexSelector:o.onComplexSelector},warnOnComplexSelector,warnOnPseudoElements);if(Array.from(new Set(r)).forEach((o=>{if(s.selectors.indexOf(o)>-1)n.push(o);else{if(alwaysValidSelector(o))return n.push(o),void(t=!0);e.add(s),s.cloneBefore({selector:o}),t=!0}})),n.length&&t&&(e.add(s),s.cloneBefore({selectors:n})),!o.preserve){if(!t)return;s.remove()}}catch(e){if(e.message.indexOf("call stack size exceeded")>-1)throw e;s.warn(n,`Failed to parse selector "${s.selector}"`)}}}}}};creator.postcss=!0;export{creator as default};
+import e from"postcss-selector-parser";import{selectorSpecificity as o}from"@csstools/selector-specificity";function alwaysValidSelector(o){const s=e().astSync(o);let t=!0;return s.walk((e=>{if("class"!==e.type&&"comment"!==e.type&&"id"!==e.type&&"root"!==e.type&&"selector"!==e.type&&"string"!==e.type&&"tag"!==e.type&&"universal"!==e.type&&("attribute"!==e.type||e.insensitive)&&("combinator"!==e.type||"+"!==e.value&&">"!==e.value&&"~"!==e.value&&" "!==e.value)&&("pseudo"!==e.type||e.nodes?.length||":hover"!==e.value.toLowerCase()&&":focus"!==e.value.toLowerCase())){if("pseudo"===e.type&&1===e.nodes?.length&&":not"===e.value.toLowerCase()){let o=!0;if(e.nodes[0].walkCombinators((()=>{o=!1})),o)return}return t=!1,!1}})),t}function sortCompoundSelectorsInsideComplexSelector(o){if(!o||!o.nodes||1===o.nodes.length)return;const s=[];let t=[];for(let n=0;n<o.nodes.length;n++)"combinator"!==o.nodes[n].type?e.isPseudoElement(o.nodes[n])?(s.push(t),t=[o.nodes[n]]):t.push(o.nodes[n]):(s.push(t),s.push([o.nodes[n]]),t=[]);s.push(t);const n=[];for(let e=0;e<s.length;e++){const o=s[e];o.sort(((e,o)=>"selector"===e.type&&"selector"===o.type&&e.nodes.length&&o.nodes.length?selectorTypeOrder(e.nodes[0],e.nodes[0].type)-selectorTypeOrder(o.nodes[0],o.nodes[0].type):"selector"===e.type&&e.nodes.length?selectorTypeOrder(e.nodes[0],e.nodes[0].type)-selectorTypeOrder(o,o.type):"selector"===o.type&&o.nodes.length?selectorTypeOrder(e,e.type)-selectorTypeOrder(o.nodes[0],o.nodes[0].type):selectorTypeOrder(e,e.type)-selectorTypeOrder(o,o.type)));const t=new Set(o.map((e=>e.type))),r=t.has("universal")&&(t.has("tag")||t.has("attribute")||t.has("class")||t.has("id")||t.has("pseudo"));for(let e=0;e<o.length;e++)"universal"===o[e].type&&r?o[e].remove():n.push(o[e])}for(let s=n.length-1;s>=0;s--){const t=n[s-1];if(n[s].remove(),t&&"tag"===t.type&&"tag"===n[s].type){const t=e.pseudo({value:":is",nodes:[e.selector({value:"",nodes:[n[s]]})]});o.prepend(t)}else o.prepend(n[s])}}function selectorTypeOrder(o,t){return e.isPseudoElement(o)?s.pseudoElement:s[t]}const s={universal:0,tag:1,pseudoElement:2,id:3,class:4,attribute:5,pseudo:6,selector:7,string:8,root:9,comment:10};function childAdjacentChild(e){return!(!e||!e.nodes)&&("selector"===e.type&&(3===e.nodes.length&&(!(!e.nodes[0]||"pseudo"!==e.nodes[0].type||":-csstools-matches"!==e.nodes[0].value)&&(!(!e.nodes[1]||"combinator"!==e.nodes[1].type||"+"!==e.nodes[1].value&&"~"!==e.nodes[1].value)&&(!(!e.nodes[2]||"pseudo"!==e.nodes[2].type||":-csstools-matches"!==e.nodes[2].value)&&(!(!e.nodes[0].nodes||1!==e.nodes[0].nodes.length)&&("selector"===e.nodes[0].nodes[0].type&&(!(!e.nodes[0].nodes[0].nodes||3!==e.nodes[0].nodes[0].nodes.length)&&(!(!e.nodes[0].nodes[0].nodes||"combinator"!==e.nodes[0].nodes[0].nodes[1].type||">"!==e.nodes[0].nodes[0].nodes[1].value)&&(!(!e.nodes[2].nodes||1!==e.nodes[2].nodes.length)&&("selector"===e.nodes[2].nodes[0].type&&(!(!e.nodes[2].nodes[0].nodes||3!==e.nodes[2].nodes[0].nodes.length)&&(!(!e.nodes[2].nodes[0].nodes||"combinator"!==e.nodes[2].nodes[0].nodes[1].type||">"!==e.nodes[2].nodes[0].nodes[1].value)&&(e.nodes[0].nodes[0].insertAfter(e.nodes[0].nodes[0].nodes[0],e.nodes[2].nodes[0].nodes[0].clone()),e.nodes[2].nodes[0].nodes[1].remove(),e.nodes[2].nodes[0].nodes[0].remove(),e.nodes[0].replaceWith(e.nodes[0].nodes[0]),e.nodes[2].replaceWith(e.nodes[2].nodes[0]),!0))))))))))))))}function isInCompoundWithOneOtherElement(o){if(!o||!o.nodes)return!1;if("selector"!==o.type)return!1;if(2!==o.nodes.length)return!1;let s,t;return o.nodes[0]&&"pseudo"===o.nodes[0].type&&":-csstools-matches"===o.nodes[0].value?(s=0,t=1):o.nodes[1]&&"pseudo"===o.nodes[1].type&&":-csstools-matches"===o.nodes[1].value&&(s=1,t=0),!!s&&(!!o.nodes[t]&&(("selector"!==o.nodes[t].type||!o.nodes[t].some((o=>"combinator"===o.type||e.isPseudoElement(o))))&&("combinator"!==o.nodes[t].type&&(o.nodes[s].nodes[0].append(o.nodes[t].clone()),o.nodes[s].replaceWith(...o.nodes[s].nodes[0].nodes),o.nodes[t].remove(),!0))))}function isPseudoInFirstCompound(e){if(!e||!e.nodes)return!1;if("selector"!==e.type)return!1;let o=-1;for(let s=0;s<e.nodes.length;s++){const t=e.nodes[s];if("combinator"===t.type)return!1;if("pseudo"===t.type&&":-csstools-matches"===t.value){if(!t.nodes||1!==t.nodes.length)return!1;o=s;break}}if(-1===o)return!1;const s=e.nodes.slice(0,o),t=e.nodes[o],n=e.nodes.slice(o+1);return s.forEach((e=>{t.nodes[0].append(e.clone())})),n.forEach((e=>{t.nodes[0].append(e.clone())})),t.replaceWith(...t.nodes),s.forEach((e=>{e.remove()})),n.forEach((e=>{e.remove()})),!0}function complexSelectors(o,s,t,n){return o.flatMap((o=>{if(-1===o.indexOf(":-csstools-matches")&&-1===o.toLowerCase().indexOf(":is"))return o;const r=e().astSync(o);return r.walkPseudos((o=>{if(":is"===o.value.toLowerCase()&&o.nodes&&o.nodes.length&&"selector"===o.nodes[0].type&&0===o.nodes[0].nodes.length)return o.value=":not",void o.nodes[0].append(e.universal());if(":-csstools-matches"===o.value)if(!o.nodes||o.nodes.length){if(o.walkPseudos((o=>{if(e.isPseudoElement(o)){let e=o.value;if(e.startsWith("::-csstools-invalid-"))return;for(;e.startsWith(":");)e=e.slice(1);o.value=`::-csstools-invalid-${e}`,n()}})),1===o.nodes.length&&"selector"===o.nodes[0].type){if(1===o.nodes[0].nodes.length)return void o.replaceWith(o.nodes[0].nodes[0]);if(!o.nodes[0].some((e=>"combinator"===e.type)))return void o.replaceWith(...o.nodes[0].nodes)}1!==r.nodes.length||"selector"!==r.nodes[0].type||1!==r.nodes[0].nodes.length||r.nodes[0].nodes[0]!==o?childAdjacentChild(o.parent)||isInCompoundWithOneOtherElement(o.parent)||isPseudoInFirstCompound(o.parent)||("warning"===s.onComplexSelector&&t(),o.value=":is"):o.replaceWith(...o.nodes[0].nodes)}else o.remove()})),r.walk((e=>{"selector"===e.type&&"nodes"in e&&1===e.nodes.length&&"selector"===e.nodes[0].type&&e.replaceWith(e.nodes[0])})),r.walk((e=>{"nodes"in e&&sortCompoundSelectorsInsideComplexSelector(e)})),r.toString()})).filter((e=>!!e))}function splitSelectors(s,t,n=0){const r=":not(#"+t.specificityMatchingName+")",d=":not(."+t.specificityMatchingName+")",l=":not("+t.specificityMatchingName+")";return s.flatMap((s=>{if(-1===s.toLowerCase().indexOf(":is"))return s;let a=!1;const c=[];if(e().astSync(s).walkPseudos((e=>{if(":is"!==e.value.toLowerCase()||!e.nodes||!e.nodes.length)return;if("selector"===e.nodes[0].type&&0===e.nodes[0].nodes.length)return;if("pseudo"===e.parent?.parent?.type&&":not"===e.parent?.parent?.value?.toLowerCase())return void c.push([{start:e.parent.parent.sourceIndex,end:e.parent.parent.sourceIndex+e.parent.parent.toString().length,option:`:not(${e.nodes.toString()})`}]);if("pseudo"===e.parent?.parent?.type&&":has"===e.parent?.parent?.value?.toLowerCase())return void(e.value=":-csstools-matches");let s=e.parent;for(;s;){if(s.value&&":is"===s.value.toLowerCase()&&"pseudo"===s.type)return void(a=!0);s=s.parent}const t=o(e),n=e.sourceIndex,i=n+e.toString().length,p=[];e.nodes.forEach((e=>{const s={start:n,end:i,option:""},a=o(e);let c=e.toString().trim();const u=Math.max(0,t.a-a.a),h=Math.max(0,t.b-a.b),f=Math.max(0,t.c-a.c);for(let e=0;e<u;e++)c+=r;for(let e=0;e<h;e++)c+=d;for(let e=0;e<f;e++)c+=l;s.option=c,p.push(s)})),c.push(p)})),!c.length)return[s];let i=[];return cartesianProduct(...c).forEach((e=>{let o="";for(let t=0;t<e.length;t++){const n=e[t];o+=s.substring(e[t-1]?.end||0,e[t].start),o+=":-csstools-matches("+n.option+")",t===e.length-1&&(o+=s.substring(e[t].end))}i.push(o)})),a&&n<10&&(i=splitSelectors(i,t,n+1)),i})).filter((e=>!!e))}function cartesianProduct(...e){const o=[],s=e.length-1;return function helper(t,n){for(let r=0,d=e[n].length;r<d;r++){const d=t.slice(0);d.push(e[n][r]),n===s?o.push(d):helper(d,n+1)}}([],0),o}const t=/:is\(/i,creator=e=>{const o={specificityMatchingName:"does-not-exist",...e||{}};return{postcssPlugin:"postcss-is-pseudo-class",prepare(){const e=new WeakSet;return{postcssPlugin:"postcss-is-pseudo-class",Rule(s,{result:n}){if(!s.selector)return;if(!t.test(s.selector))return;if(e.has(s))return;let r=!1;const warnOnComplexSelector=()=>{"warning"===o.onComplexSelector&&(r||(r=!0,s.warn(n,`Complex selectors in '${s.selector}' can not be transformed to an equivalent selector without ':is()'.`)))};let d=!1;const warnOnPseudoElements=()=>{"warning"===o.onPseudoElement&&(d||(d=!0,s.warn(n,`Pseudo elements are not allowed in ':is()', unable to transform '${s.selector}'`)))};try{let t=!1;const n=[],r=complexSelectors(splitSelectors(s.selectors,{specificityMatchingName:o.specificityMatchingName}),{onComplexSelector:o.onComplexSelector},warnOnComplexSelector,warnOnPseudoElements);if(Array.from(new Set(r)).forEach((o=>{if(s.selectors.indexOf(o)>-1)n.push(o);else{if(alwaysValidSelector(o))return n.push(o),void(t=!0);e.add(s),s.cloneBefore({selector:o}),t=!0}})),n.length&&t&&(e.add(s),s.cloneBefore({selectors:n})),!o.preserve){if(!t)return;s.remove()}}catch(e){if(e.message.indexOf("call stack size exceeded")>-1)throw e;s.warn(n,`Failed to parse selector "${s.selector}" with error: ${e.message}`)}}}}}};creator.postcss=!0;export{creator as default};
diff --git a/node_modules/@csstools/postcss-is-pseudo-class/package.json b/node_modules/@csstools/postcss-is-pseudo-class/package.json
index 1ff045ec..3d0a1cb0 100644
--- a/node_modules/@csstools/postcss-is-pseudo-class/package.json
+++ b/node_modules/@csstools/postcss-is-pseudo-class/package.json
@@ -1,7 +1,7 @@
{
"name": "@csstools/postcss-is-pseudo-class",
"description": "A pseudo-class for matching elements in a selector list",
- "version": "4.0.4",
+ "version": "4.0.8",
"author": "Jonathan Neal <jonathantneal@hotmail.com>",
"license": "MIT-0",
"funding": [
@@ -38,7 +38,7 @@
"dist"
],
"dependencies": {
- "@csstools/selector-specificity": "^3.0.1",
+ "@csstools/selector-specificity": "^3.1.1",
"postcss-selector-parser": "^6.0.13"
},
"peerDependencies": {
@@ -47,7 +47,7 @@
"homepage": "https://github.com/csstools/postcss-plugins/tree/main/plugins/postcss-is-pseudo-class#readme",
"repository": {
"type": "git",
- "url": "https://github.com/csstools/postcss-plugins.git",
+ "url": "git+https://github.com/csstools/postcss-plugins.git",
"directory": "plugins/postcss-is-pseudo-class"
},
"bugs": "https://github.com/csstools/postcss-plugins/issues",
diff --git a/node_modules/@csstools/postcss-logical-viewport-units/CHANGELOG.md b/node_modules/@csstools/postcss-logical-viewport-units/CHANGELOG.md
index 91c1fddc..24dffd5e 100644
--- a/node_modules/@csstools/postcss-logical-viewport-units/CHANGELOG.md
+++ b/node_modules/@csstools/postcss-logical-viewport-units/CHANGELOG.md
@@ -1,22 +1,21 @@
# Changes to PostCSS Logical Viewport Units
-### 2.0.5
+### 2.0.9
-_December 31, 2023_
+_May 4, 2024_
-- Updated [`@csstools/css-tokenizer`](https://github.com/csstools/postcss-plugins/tree/main/packages/css-tokenizer) to [`2.2.3`](https://github.com/csstools/postcss-plugins/tree/main/packages/css-tokenizer/CHANGELOG.md#223) (patch)
+- Updated [`@csstools/css-tokenizer`](https://github.com/csstools/postcss-plugins/tree/main/packages/css-tokenizer) to [`2.3.1`](https://github.com/csstools/postcss-plugins/tree/main/packages/css-tokenizer/CHANGELOG.md#231) (patch)
-### 2.0.4
+### 2.0.8
-_December 15, 2023_
+_May 4, 2024_
-- Fix type definitions
-- Updated [`@csstools/css-tokenizer`](https://github.com/csstools/postcss-plugins/tree/main/packages/css-tokenizer) to [`2.2.2`](https://github.com/csstools/postcss-plugins/tree/main/packages/css-tokenizer/CHANGELOG.md#222) (patch)
+- Updated [`@csstools/css-tokenizer`](https://github.com/csstools/postcss-plugins/tree/main/packages/css-tokenizer) to [`2.3.0`](https://github.com/csstools/postcss-plugins/tree/main/packages/css-tokenizer/CHANGELOG.md#230) (minor)
-### 2.0.3
+### 2.0.7
-_September 24, 2023_
+_March 13, 2024_
-- Updated [`@csstools/css-tokenizer`](https://github.com/csstools/postcss-plugins/tree/main/packages/css-tokenizer) to [`2.2.1`](https://github.com/csstools/postcss-plugins/tree/main/packages/css-tokenizer/CHANGELOG.md#221) (patch)
+- Updated [`@csstools/css-tokenizer`](https://github.com/csstools/postcss-plugins/tree/main/packages/css-tokenizer) to [`2.2.4`](https://github.com/csstools/postcss-plugins/tree/main/packages/css-tokenizer/CHANGELOG.md#224) (patch)
[Full CHANGELOG](https://github.com/csstools/postcss-plugins/tree/main/plugins/postcss-logical-viewport-units/CHANGELOG.md)
diff --git a/node_modules/@csstools/postcss-logical-viewport-units/dist/index.cjs b/node_modules/@csstools/postcss-logical-viewport-units/dist/index.cjs
index 8b0c9d63..beb015ff 100644
--- a/node_modules/@csstools/postcss-logical-viewport-units/dist/index.cjs
+++ b/node_modules/@csstools/postcss-logical-viewport-units/dist/index.cjs
@@ -1 +1 @@
-"use strict";var e,t=require("@csstools/css-tokenizer");function hasFeature(e){{const t=e.toLowerCase();if(!t.includes("vb")&&!t.includes("vi"))return!1}const o=t.tokenizer({css:e});for(;;){const e=o.nextToken();if(!e)break;if(e[0]===t.TokenType.EOF)break;if(e[0]!==t.TokenType.Dimension)continue;const n=e[4].unit.toLowerCase();if("vb"===n||"vi"===n)return!0}return!1}function hasSupportsAtRuleAncestor(e){let t=e.parent;for(;t;)if("atrule"===t.type){if("supports"===t.name.toLowerCase()&&hasFeature(t.params))return!0;t=t.parent}else t=t.parent;return!1}function transform(e,o){const n=t.tokenizer({css:e}),r=[];let i=!1;for(;;){const e=n.nextToken();if(!e)break;if(r.push(e),e[0]===t.TokenType.EOF)break;if(e[0]!==t.TokenType.Dimension)continue;const s=e[4].unit.toLowerCase();let c;"vi"===s?c=o.vi:"vb"===s&&(c=o.vb),c&&(e[1]=e[4].value.toString()+c,e[4].unit=c,i=!0)}return i?t.stringify(...r):e}!function(e){e.TopToBottom="top-to-bottom",e.BottomToTop="bottom-to-top",e.RightToLeft="right-to-left",e.LeftToRight="left-to-right"}(e||(e={}));const o=/(?:vi|vb)\b/i,creator=t=>{const n=Object.assign({inlineDirection:e.LeftToRight,preserve:!0},t);switch(n.inlineDirection){case e.LeftToRight:case e.RightToLeft:case e.TopToBottom:case e.BottomToTop:break;default:throw new Error(`[postcss-logical-viewport-units] "inlineDirection" must be one of ${Object.values(e).join(", ")}`)}const r=[e.LeftToRight,e.RightToLeft].includes(n.inlineDirection),i={vb:"vh",vi:"vw"};return r||(i.vb="vw",i.vi="vh"),{postcssPlugin:"postcss-logical-viewport-units",Declaration(e,{atRule:t}){{if(!o.test(e.value))return;const t=e.prev();if(t&&"decl"===t.type&&t.prop===e.prop)return;if(hasSupportsAtRuleAncestor(e))return}const r=transform(e.value,i);if(r===e.value)return;if(e.cloneBefore({value:r}),!n.preserve)return void e.remove();if(!e.variable)return;const s=t({name:"supports",params:"(top: 1vi)",source:e.source}),c=e.parent;if(!c)return;const u=c.cloneAfter({nodes:[]});u.append(e),s.append(u),c.after(s)}}};creator.postcss=!0,module.exports=creator;
+"use strict";var t,e=require("@csstools/utilities"),o=require("@csstools/css-tokenizer");function transform(t,e){const i=o.tokenizer({css:t}),n=[];let s=!1;for(;;){const t=i.nextToken();if(!t)break;if(n.push(t),o.isTokenEOF(t))break;if(!o.isTokenDimension(t))continue;const r=t[4].unit.toLowerCase();let c;"vi"===r?c=e.vi:"vb"===r&&(c=e.vb),c&&(t[1]=t[4].value.toString()+c,t[4].unit=c,s=!0)}return s?o.stringify(...n):t}!function(t){t.TopToBottom="top-to-bottom",t.BottomToTop="bottom-to-top",t.RightToLeft="right-to-left",t.LeftToRight="left-to-right"}(t||(t={}));const i={test(t){{const e=t.toLowerCase();if(!e.includes("vb")&&!e.includes("vi"))return!1}const e=o.tokenizer({css:t});for(;;){const t=e.nextToken();if(!t)break;if(o.isTokenEOF(t))break;if(!o.isTokenDimension(t))continue;const i=t[4].unit.toLowerCase();if("vb"===i||"vi"===i)return!0}return!1}},n=/(?:vi|vb)\b/i,creator=o=>{const s=Object.assign({inlineDirection:t.LeftToRight,preserve:!0},o);switch(s.inlineDirection){case t.LeftToRight:case t.RightToLeft:case t.TopToBottom:case t.BottomToTop:break;default:throw new Error(`[postcss-logical-viewport-units] "inlineDirection" must be one of ${Object.values(t).join(", ")}`)}const r=[t.LeftToRight,t.RightToLeft].includes(s.inlineDirection),c={vb:"vh",vi:"vw"};return r||(c.vb="vw",c.vi="vh"),{postcssPlugin:"postcss-logical-viewport-units",Declaration(t,{atRule:o}){if(!n.test(t.value))return;if(e.hasFallback(t))return;if(e.hasSupportsAtRuleAncestor(t,i))return;const r=transform(t.value,c);if(r===t.value)return;if(t.cloneBefore({value:r}),!s.preserve)return void t.remove();if(!t.variable)return;const u=o({name:"supports",params:"(top: 1vi)",source:t.source}),a=t.parent;if(!a)return;const f=a.cloneAfter({nodes:[]});f.append(t),u.append(f),a.after(u)}}};creator.postcss=!0,module.exports=creator;
diff --git a/node_modules/@csstools/postcss-logical-viewport-units/dist/index.mjs b/node_modules/@csstools/postcss-logical-viewport-units/dist/index.mjs
index 0d970cf1..3c50fd65 100644
--- a/node_modules/@csstools/postcss-logical-viewport-units/dist/index.mjs
+++ b/node_modules/@csstools/postcss-logical-viewport-units/dist/index.mjs
@@ -1 +1 @@
-import{tokenizer as t,TokenType as e,stringify as o}from"@csstools/css-tokenizer";function hasFeature(o){{const t=o.toLowerCase();if(!t.includes("vb")&&!t.includes("vi"))return!1}const r=t({css:o});for(;;){const t=r.nextToken();if(!t)break;if(t[0]===e.EOF)break;if(t[0]!==e.Dimension)continue;const o=t[4].unit.toLowerCase();if("vb"===o||"vi"===o)return!0}return!1}function hasSupportsAtRuleAncestor(t){let e=t.parent;for(;e;)if("atrule"===e.type){if("supports"===e.name.toLowerCase()&&hasFeature(e.params))return!0;e=e.parent}else e=e.parent;return!1}var r;function transform(r,n){const i=t({css:r}),s=[];let a=!1;for(;;){const t=i.nextToken();if(!t)break;if(s.push(t),t[0]===e.EOF)break;if(t[0]!==e.Dimension)continue;const o=t[4].unit.toLowerCase();let r;"vi"===o?r=n.vi:"vb"===o&&(r=n.vb),r&&(t[1]=t[4].value.toString()+r,t[4].unit=r,a=!0)}return a?o(...s):r}!function(t){t.TopToBottom="top-to-bottom",t.BottomToTop="bottom-to-top",t.RightToLeft="right-to-left",t.LeftToRight="left-to-right"}(r||(r={}));const n=/(?:vi|vb)\b/i,creator=t=>{const e=Object.assign({inlineDirection:r.LeftToRight,preserve:!0},t);switch(e.inlineDirection){case r.LeftToRight:case r.RightToLeft:case r.TopToBottom:case r.BottomToTop:break;default:throw new Error(`[postcss-logical-viewport-units] "inlineDirection" must be one of ${Object.values(r).join(", ")}`)}const o=[r.LeftToRight,r.RightToLeft].includes(e.inlineDirection),i={vb:"vh",vi:"vw"};return o||(i.vb="vw",i.vi="vh"),{postcssPlugin:"postcss-logical-viewport-units",Declaration(t,{atRule:o}){{if(!n.test(t.value))return;const e=t.prev();if(e&&"decl"===e.type&&e.prop===t.prop)return;if(hasSupportsAtRuleAncestor(t))return}const r=transform(t.value,i);if(r===t.value)return;if(t.cloneBefore({value:r}),!e.preserve)return void t.remove();if(!t.variable)return;const s=o({name:"supports",params:"(top: 1vi)",source:t.source}),a=t.parent;if(!a)return;const c=a.cloneAfter({nodes:[]});c.append(t),s.append(c),a.after(s)}}};creator.postcss=!0;export{creator as default};
+import{hasFallback as t,hasSupportsAtRuleAncestor as o}from"@csstools/utilities";import{tokenizer as e,isTokenEOF as i,isTokenDimension as n,stringify as r}from"@csstools/css-tokenizer";var s;function transform(t,o){const s=e({css:t}),c=[];let u=!1;for(;;){const t=s.nextToken();if(!t)break;if(c.push(t),i(t))break;if(!n(t))continue;const e=t[4].unit.toLowerCase();let r;"vi"===e?r=o.vi:"vb"===e&&(r=o.vb),r&&(t[1]=t[4].value.toString()+r,t[4].unit=r,u=!0)}return u?r(...c):t}!function(t){t.TopToBottom="top-to-bottom",t.BottomToTop="bottom-to-top",t.RightToLeft="right-to-left",t.LeftToRight="left-to-right"}(s||(s={}));const c={test(t){{const o=t.toLowerCase();if(!o.includes("vb")&&!o.includes("vi"))return!1}const o=e({css:t});for(;;){const t=o.nextToken();if(!t)break;if(i(t))break;if(!n(t))continue;const e=t[4].unit.toLowerCase();if("vb"===e||"vi"===e)return!0}return!1}},u=/(?:vi|vb)\b/i,creator=e=>{const i=Object.assign({inlineDirection:s.LeftToRight,preserve:!0},e);switch(i.inlineDirection){case s.LeftToRight:case s.RightToLeft:case s.TopToBottom:case s.BottomToTop:break;default:throw new Error(`[postcss-logical-viewport-units] "inlineDirection" must be one of ${Object.values(s).join(", ")}`)}const n=[s.LeftToRight,s.RightToLeft].includes(i.inlineDirection),r={vb:"vh",vi:"vw"};return n||(r.vb="vw",r.vi="vh"),{postcssPlugin:"postcss-logical-viewport-units",Declaration(e,{atRule:n}){if(!u.test(e.value))return;if(t(e))return;if(o(e,c))return;const s=transform(e.value,r);if(s===e.value)return;if(e.cloneBefore({value:s}),!i.preserve)return void e.remove();if(!e.variable)return;const a=n({name:"supports",params:"(top: 1vi)",source:e.source}),f=e.parent;if(!f)return;const v=f.cloneAfter({nodes:[]});v.append(e),a.append(v),f.after(a)}}};creator.postcss=!0;export{creator as default};
diff --git a/node_modules/@csstools/postcss-logical-viewport-units/package.json b/node_modules/@csstools/postcss-logical-viewport-units/package.json
index f8b333d8..edac2247 100644
--- a/node_modules/@csstools/postcss-logical-viewport-units/package.json
+++ b/node_modules/@csstools/postcss-logical-viewport-units/package.json
@@ -1,7 +1,7 @@
{
"name": "@csstools/postcss-logical-viewport-units",
"description": "Use vb and vi length units in CSS",
- "version": "2.0.5",
+ "version": "2.0.9",
"contributors": [
{
"name": "Antonio Laguna",
@@ -48,7 +48,8 @@
"dist"
],
"dependencies": {
- "@csstools/css-tokenizer": "^2.2.3"
+ "@csstools/css-tokenizer": "^2.3.1",
+ "@csstools/utilities": "^1.0.0"
},
"peerDependencies": {
"postcss": "^8.4"
@@ -56,7 +57,7 @@
"homepage": "https://github.com/csstools/postcss-plugins/tree/main/plugins/postcss-logical-viewport-units#readme",
"repository": {
"type": "git",
- "url": "https://github.com/csstools/postcss-plugins.git",
+ "url": "git+https://github.com/csstools/postcss-plugins.git",
"directory": "plugins/postcss-logical-viewport-units"
},
"bugs": "https://github.com/csstools/postcss-plugins/issues",
diff --git a/node_modules/@csstools/postcss-media-minmax/CHANGELOG.md b/node_modules/@csstools/postcss-media-minmax/CHANGELOG.md
index 412ead85..341e0907 100644
--- a/node_modules/@csstools/postcss-media-minmax/CHANGELOG.md
+++ b/node_modules/@csstools/postcss-media-minmax/CHANGELOG.md
@@ -1,32 +1,30 @@
# Changes to PostCSS Media MinMax
-### 1.1.2
+### 1.1.6
-_December 31, 2023_
+_May 4, 2024_
-- Updated [`@csstools/css-tokenizer`](https://github.com/csstools/postcss-plugins/tree/main/packages/css-tokenizer) to [`2.2.3`](https://github.com/csstools/postcss-plugins/tree/main/packages/css-tokenizer/CHANGELOG.md#223) (patch)
-- Updated [`@csstools/css-parser-algorithms`](https://github.com/csstools/postcss-plugins/tree/main/packages/css-parser-algorithms) to [`2.5.0`](https://github.com/csstools/postcss-plugins/tree/main/packages/css-parser-algorithms/CHANGELOG.md#250) (minor)
-- Updated [`@csstools/css-calc`](https://github.com/csstools/postcss-plugins/tree/main/packages/css-calc) to [`1.1.6`](https://github.com/csstools/postcss-plugins/tree/main/packages/css-calc/CHANGELOG.md#116) (patch)
-- Updated [`@csstools/media-query-list-parser`](https://github.com/csstools/postcss-plugins/tree/main/packages/media-query-list-parser) to [`2.1.7`](https://github.com/csstools/postcss-plugins/tree/main/packages/media-query-list-parser/CHANGELOG.md#217) (patch)
+- Updated [`@csstools/css-tokenizer`](https://github.com/csstools/postcss-plugins/tree/main/packages/css-tokenizer) to [`2.3.1`](https://github.com/csstools/postcss-plugins/tree/main/packages/css-tokenizer/CHANGELOG.md#231) (patch)
+- Updated [`@csstools/css-parser-algorithms`](https://github.com/csstools/postcss-plugins/tree/main/packages/css-parser-algorithms) to [`2.6.3`](https://github.com/csstools/postcss-plugins/tree/main/packages/css-parser-algorithms/CHANGELOG.md#263) (patch)
+- Updated [`@csstools/css-calc`](https://github.com/csstools/postcss-plugins/tree/main/packages/css-calc) to [`1.2.2`](https://github.com/csstools/postcss-plugins/tree/main/packages/css-calc/CHANGELOG.md#122) (patch)
+- Updated [`@csstools/media-query-list-parser`](https://github.com/csstools/postcss-plugins/tree/main/packages/media-query-list-parser) to [`2.1.11`](https://github.com/csstools/postcss-plugins/tree/main/packages/media-query-list-parser/CHANGELOG.md#2111) (patch)
-### 1.1.1
+### 1.1.5
-_December 15, 2023_
+_May 4, 2024_
-- Fix type definitions
-- Updated [`@csstools/css-tokenizer`](https://github.com/csstools/postcss-plugins/tree/main/packages/css-tokenizer) to [`2.2.2`](https://github.com/csstools/postcss-plugins/tree/main/packages/css-tokenizer/CHANGELOG.md#222) (patch)
-- Updated [`@csstools/css-parser-algorithms`](https://github.com/csstools/postcss-plugins/tree/main/packages/css-parser-algorithms) to [`2.4.0`](https://github.com/csstools/postcss-plugins/tree/main/packages/css-parser-algorithms/CHANGELOG.md#240) (minor)
-- Updated [`@csstools/css-calc`](https://github.com/csstools/postcss-plugins/tree/main/packages/css-calc) to [`1.1.5`](https://github.com/csstools/postcss-plugins/tree/main/packages/css-calc/CHANGELOG.md#115) (patch)
-- Updated [`@csstools/media-query-list-parser`](https://github.com/csstools/postcss-plugins/tree/main/packages/media-query-list-parser) to [`2.1.6`](https://github.com/csstools/postcss-plugins/tree/main/packages/media-query-list-parser/CHANGELOG.md#216) (patch)
+- Updated [`@csstools/css-tokenizer`](https://github.com/csstools/postcss-plugins/tree/main/packages/css-tokenizer) to [`2.3.0`](https://github.com/csstools/postcss-plugins/tree/main/packages/css-tokenizer/CHANGELOG.md#230) (minor)
+- Updated [`@csstools/css-parser-algorithms`](https://github.com/csstools/postcss-plugins/tree/main/packages/css-parser-algorithms) to [`2.6.2`](https://github.com/csstools/postcss-plugins/tree/main/packages/css-parser-algorithms/CHANGELOG.md#262) (patch)
+- Updated [`@csstools/css-calc`](https://github.com/csstools/postcss-plugins/tree/main/packages/css-calc) to [`1.2.1`](https://github.com/csstools/postcss-plugins/tree/main/packages/css-calc/CHANGELOG.md#121) (patch)
+- Updated [`@csstools/media-query-list-parser`](https://github.com/csstools/postcss-plugins/tree/main/packages/media-query-list-parser) to [`2.1.10`](https://github.com/csstools/postcss-plugins/tree/main/packages/media-query-list-parser/CHANGELOG.md#2110) (patch)
-### 1.1.0
+### 1.1.4
-_September 24, 2023_
+_March 13, 2024_
-- Add support for `@custom-media` queries.
-- Updated [`@csstools/css-tokenizer`](https://github.com/csstools/postcss-plugins/tree/main/packages/css-tokenizer) to [`2.2.1`](https://github.com/csstools/postcss-plugins/tree/main/packages/css-tokenizer/CHANGELOG.md#221) (patch)
-- Updated [`@csstools/css-parser-algorithms`](https://github.com/csstools/postcss-plugins/tree/main/packages/css-parser-algorithms) to [`2.3.2`](https://github.com/csstools/postcss-plugins/tree/main/packages/css-parser-algorithms/CHANGELOG.md#232) (patch)
-- Updated [`@csstools/css-calc`](https://github.com/csstools/postcss-plugins/tree/main/packages/css-calc) to [`1.1.4`](https://github.com/csstools/postcss-plugins/tree/main/packages/css-calc/CHANGELOG.md#114) (patch)
-- Updated [`@csstools/media-query-list-parser`](https://github.com/csstools/postcss-plugins/tree/main/packages/media-query-list-parser) to [`2.1.5`](https://github.com/csstools/postcss-plugins/tree/main/packages/media-query-list-parser/CHANGELOG.md#215) (patch)
+- Updated [`@csstools/css-tokenizer`](https://github.com/csstools/postcss-plugins/tree/main/packages/css-tokenizer) to [`2.2.4`](https://github.com/csstools/postcss-plugins/tree/main/packages/css-tokenizer/CHANGELOG.md#224) (patch)
+- Updated [`@csstools/css-parser-algorithms`](https://github.com/csstools/postcss-plugins/tree/main/packages/css-parser-algorithms) to [`2.6.1`](https://github.com/csstools/postcss-plugins/tree/main/packages/css-parser-algorithms/CHANGELOG.md#261) (patch)
+- Updated [`@csstools/css-calc`](https://github.com/csstools/postcss-plugins/tree/main/packages/css-calc) to [`1.2.0`](https://github.com/csstools/postcss-plugins/tree/main/packages/css-calc/CHANGELOG.md#120) (minor)
+- Updated [`@csstools/media-query-list-parser`](https://github.com/csstools/postcss-plugins/tree/main/packages/media-query-list-parser) to [`2.1.9`](https://github.com/csstools/postcss-plugins/tree/main/packages/media-query-list-parser/CHANGELOG.md#219) (patch)
[Full CHANGELOG](https://github.com/csstools/postcss-plugins/tree/main/plugins/postcss-media-minmax/CHANGELOG.md)
diff --git a/node_modules/@csstools/postcss-media-minmax/dist/index.cjs b/node_modules/@csstools/postcss-media-minmax/dist/index.cjs
index 1552173d..725a9077 100644
--- a/node_modules/@csstools/postcss-media-minmax/dist/index.cjs
+++ b/node_modules/@csstools/postcss-media-minmax/dist/index.cjs
@@ -1 +1 @@
-"use strict";var e=require("@csstools/css-parser-algorithms"),i=require("@csstools/css-tokenizer"),n=require("@csstools/media-query-list-parser"),a=require("@csstools/css-calc");const t=/[A-Z]/g;function toLowerCaseAZ(e){return e.replace(t,(e=>String.fromCharCode(e.charCodeAt(0)+32)))}const r={width:"px",height:"px","device-width":"px","device-height":"px","aspect-ratio":"","device-aspect-ratio":"",color:"","color-index":"",monochrome:"",resolution:"dpi"},o={width:!1,height:!1,"device-width":!1,"device-height":!1,"aspect-ratio":!1,"device-aspect-ratio":!1,color:!0,"color-index":!0,monochrome:!0,resolution:"dpi"};function featureNamePrefix(e){return e===n.MediaFeatureLT.LT||e===n.MediaFeatureLT.LT_OR_EQ?"max-":e===n.MediaFeatureGT.GT||e===n.MediaFeatureGT.GT_OR_EQ?"min-":""}const s={">":1,"<":-1},u=.001,d=.02;function transformSingleNameValuePair(t,l,c,p){let T=c.before,m=c.after;if(p||(T=c.after,m=c.before),!p){const e=n.invertComparison(l);if(!1===e)return;l=e}if(l===n.MediaFeatureEQ.EQ||l===n.MediaFeatureLT.LT_OR_EQ||l===n.MediaFeatureGT.GT_OR_EQ)return Array.isArray(c.value)?n.newMediaFeaturePlain(featureNamePrefix(l)+t,...T,...c.value.flatMap((e=>e.tokens())),...m):n.newMediaFeaturePlain(featureNamePrefix(l)+t,...T,...c.value.tokens(),...m);let f,v,y=!1;if(Array.isArray(c.value)){if(!n.matchesRatioExactly(c.value))return;if("aspect-ratio"!==t&&"device-aspect-ratio"!==t)return;const e=n.matchesRatio(c.value);if(-1===e)return;y=!0,f=c.value[e[0]],v=[...c.value.slice(e[0]+1).flatMap((e=>e.tokens()))]}else f=c.value,v=[];const h=r[t.toLowerCase()];if(e.isFunctionNode(f)){const r=toLowerCaseAZ(f.getName());if(a.mathFunctionNames.has(r)||"env"===r){const[[r]]=a.calcFromComponentValues([[f]],{precision:5,toCanonicalUnits:!0});if(!r||!e.isTokenNode(r)||r.value[0]!==i.TokenType.Number&&r.value[0]!==i.TokenType.Percentage&&r.value[0]!==i.TokenType.Dimension||!Number.isInteger(r.value[4].value)){let e;if(void 0!==h){const n=s[l]*("px"===h?d:u);e=[i.TokenType.Dimension,`${n.toString()}${h}`,-1,-1,{value:n,unit:h,type:i.NumberType.Integer}]}else if(!0===o[t]){const n=s[l];e=[i.TokenType.Number,n.toString(),-1,-1,{value:n,type:i.NumberType.Integer}]}else if(y){const n=s[l]*u;e=[i.TokenType.Number,n.toString(),-1,-1,{value:n,type:i.NumberType.Integer}]}else{const n=s[l];e=[i.TokenType.Number,n.toString(),-1,-1,{value:n,type:i.NumberType.Integer}]}return n.newMediaFeaturePlain(featureNamePrefix(l)+t,...T,[i.TokenType.Function,"calc(",-1,-1,{value:"calc("}],[i.TokenType.OpenParen,"(",-1,-1,void 0],...f.tokens().slice(1),[i.TokenType.Whitespace," ",-1,-1,void 0],[i.TokenType.Delim,"+",-1,-1,{value:"+"}],[i.TokenType.Whitespace," ",-1,-1,void 0],e,[i.TokenType.CloseParen,")",-1,-1,void 0],...v,...m)}f=r}}if(!e.isTokenNode(f))return;let g,k=f.value,M="";if(void 0!==h&&k[0]===i.TokenType.Number&&0===k[4].value)g=s[l],M=h;else if(k[0]===i.TokenType.Number&&0===k[4].value)g=s[l],M="";else if(k[0]===i.TokenType.Dimension&&0===k[4].value)g=s[l],M=k[4].unit;else if(k[0]===i.TokenType.Number&&!0===o[t])g=k[4].value+s[l];else if(k[0]===i.TokenType.Dimension&&"px"===k[4].unit&&k[4].type===i.NumberType.Integer)g=Number(Math.round(Number(k[4].value+d*s[l]+"e6"))+"e-6");else{if(k[0]!==i.TokenType.Dimension&&k[0]!==i.TokenType.Number)return;g=Number(Math.round(Number(k[4].value+u*s[l]+"e6"))+"e-6")}return M&&(k=[i.TokenType.Dimension,k[1],k[2],k[3],{value:k[4].value,unit:M,type:k[4].type}]),k[4].value=g,k[0]===i.TokenType.Dimension?k[1]=k[4].value.toString()+k[4].unit:k[1]=k[4].value.toString(),n.newMediaFeaturePlain(featureNamePrefix(l)+t,...T,k,...v,...m)}const l=new Set(["aspect-ratio","color","color-index","device-aspect-ratio","device-height","device-width","height","horizontal-viewport-segments","monochrome","resolution","vertical-viewport-segments","width"]);function transform(a){return a.map(((a,t)=>{const r=e.gatherNodeAncestry(a);a.walk((e=>{const t=e.node;if(!n.isMediaFeatureRange(t))return;const o=e.parent;if(!n.isMediaFeature(o))return;const s=toLowerCaseAZ(t.name.getName());if(!l.has(s))return;if(n.isMediaFeatureRangeNameValue(t)||n.isMediaFeatureRangeValueName(t)){const e=t.operatorKind();if(!1===e)return;const i=transformSingleNameValuePair(s,e,t.value,n.isMediaFeatureRangeNameValue(t));return void(i&&(o.feature=i.feature))}const u=r.get(o);if(!n.isMediaInParens(u))return;let d=null,c=null;{const e=t.valueOneOperatorKind();if(!1===e)return;const i=transformSingleNameValuePair(s,e,t.valueOne,!1);if(!i)return;e===n.MediaFeatureLT.LT||e===n.MediaFeatureLT.LT_OR_EQ?(d=i,d.before=o.before):(c=i,c.after=o.after)}{const e=t.valueTwoOperatorKind();if(!1===e)return;const i=transformSingleNameValuePair(s,e,t.valueTwo,!0);if(!i)return;e===n.MediaFeatureLT.LT||e===n.MediaFeatureLT.LT_OR_EQ?(c=i,c.before=o.before):(d=i,d.after=o.after)}if(!d||!c)return;const p=new n.MediaInParens(d),T=new n.MediaInParens(c),m=getMediaConditionListWithAndFromAncestry(u,r);if(m)return m.leading===u?(m.leading=p,void(m.list=[new n.MediaAnd([[i.TokenType.Whitespace," ",-1,-1,void 0],[i.TokenType.Ident,"and",-1,-1,{value:"and"}],[i.TokenType.Whitespace," ",-1,-1,void 0]],T),...m.list])):void m.list.splice(m.indexOf(r.get(u)),1,new n.MediaAnd([[i.TokenType.Whitespace," ",-1,-1,void 0],[i.TokenType.Ident,"and",-1,-1,{value:"and"}],[i.TokenType.Whitespace," ",-1,-1,void 0]],p),new n.MediaAnd([[i.TokenType.Whitespace," ",-1,-1,void 0],[i.TokenType.Ident,"and",-1,-1,{value:"and"}],[i.TokenType.Whitespace," ",-1,-1,void 0]],T));const f=new n.MediaConditionListWithAnd(p,[new n.MediaAnd([[i.TokenType.Whitespace," ",-1,-1,void 0],[i.TokenType.Ident,"and",-1,-1,{value:"and"}],[i.TokenType.Whitespace," ",-1,-1,void 0]],T)],[[i.TokenType.Whitespace," ",-1,-1,void 0]]),v=getMediaConditionInShallowMediaQueryFromAncestry(u,a,r);v?v.media=f:u.media=new n.MediaCondition(new n.MediaInParens(new n.MediaCondition(f),[[i.TokenType.Whitespace," ",-1,-1,void 0],[i.TokenType.OpenParen,"(",-1,-1,void 0]],[[i.TokenType.CloseParen,")",-1,-1,void 0]]))}));const o=a.tokens();return i.stringify(...o.filter(((e,n)=>(0!==n||0!==t||e[0]!==i.TokenType.Whitespace)&&(e[0]!==i.TokenType.Whitespace||!o[n+1]||o[n+1][0]!==i.TokenType.Whitespace))))})).join(",")}function getMediaConditionListWithAndFromAncestry(e,i){let a=e;if(a){if(a=i.get(a),n.isMediaConditionListWithAnd(a))return a;if(n.isMediaAnd(a))return a=i.get(a),n.isMediaConditionListWithAnd(a)?a:void 0}}function getMediaConditionInShallowMediaQueryFromAncestry(e,i,a){let t=e;if(!t)return;if(t=a.get(t),!n.isMediaCondition(t))return;const r=t;return t=a.get(t),n.isMediaQuery(t)&&t===i?r:void 0}const creator=()=>({postcssPlugin:"postcss-media-minmax",AtRule:{media:e=>{if(!(e.params.includes("<")||e.params.includes(">")||e.params.includes("=")))return;const i=transform(n.parse(e.params,{preserveInvalidMediaQueries:!0,onParseError:()=>{throw e.error(`Unable to parse media query "${e.params}"`)}}));e.params!==i&&(e.params=i)},"custom-media":e=>{if(!(e.params.includes("<")||e.params.includes(">")||e.params.includes("=")))return;const a=n.parseCustomMedia(e.params,{preserveInvalidMediaQueries:!0,onParseError:()=>{throw e.error(`Unable to parse media query "${e.params}"`)}});if(!a||!a.mediaQueryList)return;const t=a.mediaQueryList.map((e=>e.toString())).join(","),r=transform(a.mediaQueryList);t!==r&&(e.params=`${i.stringify(...a.name)} ${r}`)}}});creator.postcss=!0,module.exports=creator;
+"use strict";var e=require("@csstools/css-parser-algorithms"),i=require("@csstools/css-tokenizer"),n=require("@csstools/media-query-list-parser"),a=require("@csstools/css-calc");const t={width:"px",height:"px","device-width":"px","device-height":"px","aspect-ratio":"","device-aspect-ratio":"",color:"","color-index":"",monochrome:"",resolution:"dpi"},r={width:!1,height:!1,"device-width":!1,"device-height":!1,"aspect-ratio":!1,"device-aspect-ratio":!1,color:!0,"color-index":!0,monochrome:!0,resolution:"dpi"};function featureNamePrefix(e){return e===n.MediaFeatureLT.LT||e===n.MediaFeatureLT.LT_OR_EQ?"max-":e===n.MediaFeatureGT.GT||e===n.MediaFeatureGT.GT_OR_EQ?"min-":""}const o={">":1,"<":-1},s=.001,u=.02;function transformSingleNameValuePair(d,l,c,p){let m=c.before,T=c.after;if(p||(m=c.after,T=c.before),!p){const e=n.invertComparison(l);if(!1===e)return;l=e}if(l===n.MediaFeatureEQ.EQ||l===n.MediaFeatureLT.LT_OR_EQ||l===n.MediaFeatureGT.GT_OR_EQ)return Array.isArray(c.value)?n.newMediaFeaturePlain(featureNamePrefix(l)+d,...m,...c.value.flatMap((e=>e.tokens())),...T):n.newMediaFeaturePlain(featureNamePrefix(l)+d,...m,...c.value.tokens(),...T);let f,v,y=!1;if(Array.isArray(c.value)){if(!n.matchesRatioExactly(c.value))return;if("aspect-ratio"!==d&&"device-aspect-ratio"!==d)return;const e=n.matchesRatio(c.value);if(-1===e)return;y=!0,f=c.value[e[0]],v=[...c.value.slice(e[0]+1).flatMap((e=>e.tokens()))]}else f=c.value,v=[];const h=t[d.toLowerCase()];if(e.isFunctionNode(f)){const t=f.getName().toLowerCase();if(a.mathFunctionNames.has(t)||"env"===t){const[[t]]=a.calcFromComponentValues([[f]],{precision:5,toCanonicalUnits:!0});if(!(t&&e.isTokenNode(t)&&i.isTokenNumeric(t.value)&&Number.isInteger(t.value[4].value))){let e;if(void 0!==h){const n=o[l]*("px"===h?u:s);e=[i.TokenType.Dimension,`${n.toString()}${h}`,-1,-1,{value:n,unit:h,type:i.NumberType.Integer}]}else if(!0===r[d]){const n=o[l];e=[i.TokenType.Number,n.toString(),-1,-1,{value:n,type:i.NumberType.Integer}]}else if(y){const n=o[l]*s;e=[i.TokenType.Number,n.toString(),-1,-1,{value:n,type:i.NumberType.Integer}]}else{const n=o[l];e=[i.TokenType.Number,n.toString(),-1,-1,{value:n,type:i.NumberType.Integer}]}return n.newMediaFeaturePlain(featureNamePrefix(l)+d,...m,[i.TokenType.Function,"calc(",-1,-1,{value:"calc("}],[i.TokenType.OpenParen,"(",-1,-1,void 0],...f.tokens().slice(1),[i.TokenType.Whitespace," ",-1,-1,void 0],[i.TokenType.Delim,"+",-1,-1,{value:"+"}],[i.TokenType.Whitespace," ",-1,-1,void 0],e,[i.TokenType.CloseParen,")",-1,-1,void 0],...v,...T)}f=t}}if(!e.isTokenNode(f))return;let M,g=f.value,k="";if(void 0!==h&&i.isTokenNumber(g)&&0===g[4].value)M=o[l],k=h;else if(i.isTokenNumber(g)&&0===g[4].value)M=o[l],k="";else if(i.isTokenDimension(g)&&0===g[4].value)M=o[l],k=g[4].unit;else if(i.isTokenNumber(g)&&!0===r[d])M=g[4].value+o[l];else if(i.isTokenDimension(g)&&"px"===g[4].unit&&g[4].type===i.NumberType.Integer)M=Number(Math.round(Number(g[4].value+u*o[l]+"e6"))+"e-6");else{if(!i.isTokenDimension(g)&&!i.isTokenNumber(g))return;M=Number(Math.round(Number(g[4].value+s*o[l]+"e6"))+"e-6")}return k&&(g=[i.TokenType.Dimension,g[1],g[2],g[3],{value:g[4].value,unit:k,type:g[4].type}]),g[4].value=M,i.isTokenDimension(g)?g[1]=g[4].value.toString()+g[4].unit:g[1]=g[4].value.toString(),n.newMediaFeaturePlain(featureNamePrefix(l)+d,...m,g,...v,...T)}const d=new Set(["aspect-ratio","color","color-index","device-aspect-ratio","device-height","device-width","height","horizontal-viewport-segments","monochrome","resolution","vertical-viewport-segments","width"]);function transform(a){return a.map(((a,t)=>{const r=e.gatherNodeAncestry(a);a.walk((e=>{const t=e.node;if(!n.isMediaFeatureRange(t))return;const o=e.parent;if(!n.isMediaFeature(o))return;const s=t.name.getName().toLowerCase();if(!d.has(s))return;if(n.isMediaFeatureRangeNameValue(t)||n.isMediaFeatureRangeValueName(t)){const e=t.operatorKind();if(!1===e)return;const i=transformSingleNameValuePair(s,e,t.value,n.isMediaFeatureRangeNameValue(t));return void(i&&(o.feature=i.feature))}const u=r.get(o);if(!n.isMediaInParens(u))return;let l=null,c=null;{const e=t.valueOneOperatorKind();if(!1===e)return;const i=transformSingleNameValuePair(s,e,t.valueOne,!1);if(!i)return;e===n.MediaFeatureLT.LT||e===n.MediaFeatureLT.LT_OR_EQ?(l=i,l.before=o.before):(c=i,c.after=o.after)}{const e=t.valueTwoOperatorKind();if(!1===e)return;const i=transformSingleNameValuePair(s,e,t.valueTwo,!0);if(!i)return;e===n.MediaFeatureLT.LT||e===n.MediaFeatureLT.LT_OR_EQ?(c=i,c.before=o.before):(l=i,l.after=o.after)}if(!l||!c)return;const p=new n.MediaInParens(l),m=new n.MediaInParens(c),T=getMediaConditionListWithAndFromAncestry(u,r);if(T)return T.leading===u?(T.leading=p,void(T.list=[new n.MediaAnd([[i.TokenType.Whitespace," ",-1,-1,void 0],[i.TokenType.Ident,"and",-1,-1,{value:"and"}],[i.TokenType.Whitespace," ",-1,-1,void 0]],m),...T.list])):void T.list.splice(T.indexOf(r.get(u)),1,new n.MediaAnd([[i.TokenType.Whitespace," ",-1,-1,void 0],[i.TokenType.Ident,"and",-1,-1,{value:"and"}],[i.TokenType.Whitespace," ",-1,-1,void 0]],p),new n.MediaAnd([[i.TokenType.Whitespace," ",-1,-1,void 0],[i.TokenType.Ident,"and",-1,-1,{value:"and"}],[i.TokenType.Whitespace," ",-1,-1,void 0]],m));const f=new n.MediaConditionListWithAnd(p,[new n.MediaAnd([[i.TokenType.Whitespace," ",-1,-1,void 0],[i.TokenType.Ident,"and",-1,-1,{value:"and"}],[i.TokenType.Whitespace," ",-1,-1,void 0]],m)],[[i.TokenType.Whitespace," ",-1,-1,void 0]]),v=getMediaConditionInShallowMediaQueryFromAncestry(u,a,r);v?v.media=f:u.media=new n.MediaCondition(new n.MediaInParens(new n.MediaCondition(f),[[i.TokenType.Whitespace," ",-1,-1,void 0],[i.TokenType.OpenParen,"(",-1,-1,void 0]],[[i.TokenType.CloseParen,")",-1,-1,void 0]]))}));const o=a.tokens();return i.stringify(...o.filter(((e,n)=>(0!==n||0!==t||!i.isTokenWhitespace(e))&&!(i.isTokenWhitespace(e)&&o[n+1]&&i.isTokenWhitespace(o[n+1])))))})).join(",")}function getMediaConditionListWithAndFromAncestry(e,i){let a=e;if(a){if(a=i.get(a),n.isMediaConditionListWithAnd(a))return a;if(n.isMediaAnd(a))return a=i.get(a),n.isMediaConditionListWithAnd(a)?a:void 0}}function getMediaConditionInShallowMediaQueryFromAncestry(e,i,a){let t=e;if(!t)return;if(t=a.get(t),!n.isMediaCondition(t))return;const r=t;return t=a.get(t),n.isMediaQuery(t)&&t===i?r:void 0}const creator=()=>({postcssPlugin:"postcss-media-minmax",AtRule:{media(e){if(!(e.params.includes("<")||e.params.includes(">")||e.params.includes("=")))return;const i=transform(n.parse(e.params,{preserveInvalidMediaQueries:!0,onParseError:()=>{throw e.error(`Unable to parse media query "${e.params}"`)}}));e.params!==i&&(e.params=i)},"custom-media"(e){if(!(e.params.includes("<")||e.params.includes(">")||e.params.includes("=")))return;const a=n.parseCustomMedia(e.params,{preserveInvalidMediaQueries:!0,onParseError:()=>{throw e.error(`Unable to parse media query "${e.params}"`)}});if(!a||!a.mediaQueryList)return;const t=a.mediaQueryList.map((e=>e.toString())).join(","),r=transform(a.mediaQueryList);t!==r&&(e.params=`${i.stringify(...a.name)} ${r}`)}}});creator.postcss=!0,module.exports=creator;
diff --git a/node_modules/@csstools/postcss-media-minmax/dist/index.mjs b/node_modules/@csstools/postcss-media-minmax/dist/index.mjs
index 1d4c7bf2..bbe126a9 100644
--- a/node_modules/@csstools/postcss-media-minmax/dist/index.mjs
+++ b/node_modules/@csstools/postcss-media-minmax/dist/index.mjs
@@ -1 +1 @@
-import{isFunctionNode as e,isTokenNode as t,gatherNodeAncestry as r}from"@csstools/css-parser-algorithms";import{TokenType as i,NumberType as n,stringify as a}from"@csstools/css-tokenizer";import{invertComparison as o,MediaFeatureEQ as s,MediaFeatureLT as u,MediaFeatureGT as l,newMediaFeaturePlain as c,matchesRatioExactly as d,matchesRatio as m,isMediaFeatureRange as f,isMediaFeature as v,isMediaFeatureRangeNameValue as p,isMediaFeatureRangeValueName as h,isMediaInParens as g,MediaInParens as w,MediaAnd as N,MediaConditionListWithAnd as y,MediaCondition as b,isMediaConditionListWithAnd as x,isMediaAnd as P,isMediaCondition as W,isMediaQuery as A,parse as L,parseCustomMedia as S}from"@csstools/media-query-list-parser";import{mathFunctionNames as C,calcFromComponentValues as I}from"@csstools/css-calc";const Q=/[A-Z]/g;function toLowerCaseAZ(e){return e.replace(Q,(e=>String.fromCharCode(e.charCodeAt(0)+32)))}const O={width:"px",height:"px","device-width":"px","device-height":"px","aspect-ratio":"","device-aspect-ratio":"",color:"","color-index":"",monochrome:"",resolution:"dpi"},M={width:!1,height:!1,"device-width":!1,"device-height":!1,"aspect-ratio":!1,"device-aspect-ratio":!1,color:!0,"color-index":!0,monochrome:!0,resolution:"dpi"};function featureNamePrefix(e){return e===u.LT||e===u.LT_OR_EQ?"max-":e===l.GT||e===l.GT_OR_EQ?"min-":""}const T={">":1,"<":-1},_=.001,E=.02;function transformSingleNameValuePair(r,a,f,v){let p=f.before,h=f.after;if(v||(p=f.after,h=f.before),!v){const e=o(a);if(!1===e)return;a=e}if(a===s.EQ||a===u.LT_OR_EQ||a===l.GT_OR_EQ)return Array.isArray(f.value)?c(featureNamePrefix(a)+r,...p,...f.value.flatMap((e=>e.tokens())),...h):c(featureNamePrefix(a)+r,...p,...f.value.tokens(),...h);let g,w,N=!1;if(Array.isArray(f.value)){if(!d(f.value))return;if("aspect-ratio"!==r&&"device-aspect-ratio"!==r)return;const e=m(f.value);if(-1===e)return;N=!0,g=f.value[e[0]],w=[...f.value.slice(e[0]+1).flatMap((e=>e.tokens()))]}else g=f.value,w=[];const y=O[r.toLowerCase()];if(e(g)){const e=toLowerCaseAZ(g.getName());if(C.has(e)||"env"===e){const[[e]]=I([[g]],{precision:5,toCanonicalUnits:!0});if(!e||!t(e)||e.value[0]!==i.Number&&e.value[0]!==i.Percentage&&e.value[0]!==i.Dimension||!Number.isInteger(e.value[4].value)){let e;if(void 0!==y){const t=T[a]*("px"===y?E:_);e=[i.Dimension,`${t.toString()}${y}`,-1,-1,{value:t,unit:y,type:n.Integer}]}else if(!0===M[r]){const t=T[a];e=[i.Number,t.toString(),-1,-1,{value:t,type:n.Integer}]}else if(N){const t=T[a]*_;e=[i.Number,t.toString(),-1,-1,{value:t,type:n.Integer}]}else{const t=T[a];e=[i.Number,t.toString(),-1,-1,{value:t,type:n.Integer}]}return c(featureNamePrefix(a)+r,...p,[i.Function,"calc(",-1,-1,{value:"calc("}],[i.OpenParen,"(",-1,-1,void 0],...g.tokens().slice(1),[i.Whitespace," ",-1,-1,void 0],[i.Delim,"+",-1,-1,{value:"+"}],[i.Whitespace," ",-1,-1,void 0],e,[i.CloseParen,")",-1,-1,void 0],...w,...h)}g=e}}if(!t(g))return;let b,x=g.value,P="";if(void 0!==y&&x[0]===i.Number&&0===x[4].value)b=T[a],P=y;else if(x[0]===i.Number&&0===x[4].value)b=T[a],P="";else if(x[0]===i.Dimension&&0===x[4].value)b=T[a],P=x[4].unit;else if(x[0]===i.Number&&!0===M[r])b=x[4].value+T[a];else if(x[0]===i.Dimension&&"px"===x[4].unit&&x[4].type===n.Integer)b=Number(Math.round(Number(x[4].value+E*T[a]+"e6"))+"e-6");else{if(x[0]!==i.Dimension&&x[0]!==i.Number)return;b=Number(Math.round(Number(x[4].value+_*T[a]+"e6"))+"e-6")}return P&&(x=[i.Dimension,x[1],x[2],x[3],{value:x[4].value,unit:P,type:x[4].type}]),x[4].value=b,x[0]===i.Dimension?x[1]=x[4].value.toString()+x[4].unit:x[1]=x[4].value.toString(),c(featureNamePrefix(a)+r,...p,x,...w,...h)}const D=new Set(["aspect-ratio","color","color-index","device-aspect-ratio","device-height","device-width","height","horizontal-viewport-segments","monochrome","resolution","vertical-viewport-segments","width"]);function transform(e){return e.map(((e,t)=>{const n=r(e);e.walk((t=>{const r=t.node;if(!f(r))return;const a=t.parent;if(!v(a))return;const o=toLowerCaseAZ(r.name.getName());if(!D.has(o))return;if(p(r)||h(r)){const e=r.operatorKind();if(!1===e)return;const t=transformSingleNameValuePair(o,e,r.value,p(r));return void(t&&(a.feature=t.feature))}const s=n.get(a);if(!g(s))return;let l=null,c=null;{const e=r.valueOneOperatorKind();if(!1===e)return;const t=transformSingleNameValuePair(o,e,r.valueOne,!1);if(!t)return;e===u.LT||e===u.LT_OR_EQ?(l=t,l.before=a.before):(c=t,c.after=a.after)}{const e=r.valueTwoOperatorKind();if(!1===e)return;const t=transformSingleNameValuePair(o,e,r.valueTwo,!0);if(!t)return;e===u.LT||e===u.LT_OR_EQ?(c=t,c.before=a.before):(l=t,l.after=a.after)}if(!l||!c)return;const d=new w(l),m=new w(c),x=getMediaConditionListWithAndFromAncestry(s,n);if(x)return x.leading===s?(x.leading=d,void(x.list=[new N([[i.Whitespace," ",-1,-1,void 0],[i.Ident,"and",-1,-1,{value:"and"}],[i.Whitespace," ",-1,-1,void 0]],m),...x.list])):void x.list.splice(x.indexOf(n.get(s)),1,new N([[i.Whitespace," ",-1,-1,void 0],[i.Ident,"and",-1,-1,{value:"and"}],[i.Whitespace," ",-1,-1,void 0]],d),new N([[i.Whitespace," ",-1,-1,void 0],[i.Ident,"and",-1,-1,{value:"and"}],[i.Whitespace," ",-1,-1,void 0]],m));const P=new y(d,[new N([[i.Whitespace," ",-1,-1,void 0],[i.Ident,"and",-1,-1,{value:"and"}],[i.Whitespace," ",-1,-1,void 0]],m)],[[i.Whitespace," ",-1,-1,void 0]]),W=getMediaConditionInShallowMediaQueryFromAncestry(s,e,n);W?W.media=P:s.media=new b(new w(new b(P),[[i.Whitespace," ",-1,-1,void 0],[i.OpenParen,"(",-1,-1,void 0]],[[i.CloseParen,")",-1,-1,void 0]]))}));const o=e.tokens();return a(...o.filter(((e,r)=>(0!==r||0!==t||e[0]!==i.Whitespace)&&(e[0]!==i.Whitespace||!o[r+1]||o[r+1][0]!==i.Whitespace))))})).join(",")}function getMediaConditionListWithAndFromAncestry(e,t){let r=e;if(r){if(r=t.get(r),x(r))return r;if(P(r))return r=t.get(r),x(r)?r:void 0}}function getMediaConditionInShallowMediaQueryFromAncestry(e,t,r){let i=e;if(!i)return;if(i=r.get(i),!W(i))return;const n=i;return i=r.get(i),A(i)&&i===t?n:void 0}const creator=()=>({postcssPlugin:"postcss-media-minmax",AtRule:{media:e=>{if(!(e.params.includes("<")||e.params.includes(">")||e.params.includes("=")))return;const t=transform(L(e.params,{preserveInvalidMediaQueries:!0,onParseError:()=>{throw e.error(`Unable to parse media query "${e.params}"`)}}));e.params!==t&&(e.params=t)},"custom-media":e=>{if(!(e.params.includes("<")||e.params.includes(">")||e.params.includes("=")))return;const t=S(e.params,{preserveInvalidMediaQueries:!0,onParseError:()=>{throw e.error(`Unable to parse media query "${e.params}"`)}});if(!t||!t.mediaQueryList)return;const r=t.mediaQueryList.map((e=>e.toString())).join(","),i=transform(t.mediaQueryList);r!==i&&(e.params=`${a(...t.name)} ${i}`)}}});creator.postcss=!0;export{creator as default};
+import{isFunctionNode as e,isTokenNode as t,gatherNodeAncestry as r}from"@csstools/css-parser-algorithms";import{isTokenNumeric as i,TokenType as a,NumberType as n,isTokenNumber as o,isTokenDimension as s,stringify as u,isTokenWhitespace as l}from"@csstools/css-tokenizer";import{invertComparison as c,MediaFeatureEQ as d,MediaFeatureLT as f,MediaFeatureGT as m,newMediaFeaturePlain as v,matchesRatioExactly as p,matchesRatio as h,isMediaFeatureRange as g,isMediaFeature as w,isMediaFeatureRangeNameValue as y,isMediaFeatureRangeValueName as N,isMediaInParens as x,MediaInParens as b,MediaAnd as P,MediaConditionListWithAnd as L,MediaCondition as I,isMediaConditionListWithAnd as Q,isMediaAnd as S,isMediaCondition as W,isMediaQuery as O,parse as M,parseCustomMedia as T}from"@csstools/media-query-list-parser";import{mathFunctionNames as _,calcFromComponentValues as A}from"@csstools/css-calc";const C={width:"px",height:"px","device-width":"px","device-height":"px","aspect-ratio":"","device-aspect-ratio":"",color:"","color-index":"",monochrome:"",resolution:"dpi"},E={width:!1,height:!1,"device-width":!1,"device-height":!1,"aspect-ratio":!1,"device-aspect-ratio":!1,color:!0,"color-index":!0,monochrome:!0,resolution:"dpi"};function featureNamePrefix(e){return e===f.LT||e===f.LT_OR_EQ?"max-":e===m.GT||e===m.GT_OR_EQ?"min-":""}const k={">":1,"<":-1},R=.001,$=.02;function transformSingleNameValuePair(r,u,l,g){let w=l.before,y=l.after;if(g||(w=l.after,y=l.before),!g){const e=c(u);if(!1===e)return;u=e}if(u===d.EQ||u===f.LT_OR_EQ||u===m.GT_OR_EQ)return Array.isArray(l.value)?v(featureNamePrefix(u)+r,...w,...l.value.flatMap((e=>e.tokens())),...y):v(featureNamePrefix(u)+r,...w,...l.value.tokens(),...y);let N,x,b=!1;if(Array.isArray(l.value)){if(!p(l.value))return;if("aspect-ratio"!==r&&"device-aspect-ratio"!==r)return;const e=h(l.value);if(-1===e)return;b=!0,N=l.value[e[0]],x=[...l.value.slice(e[0]+1).flatMap((e=>e.tokens()))]}else N=l.value,x=[];const P=C[r.toLowerCase()];if(e(N)){const e=N.getName().toLowerCase();if(_.has(e)||"env"===e){const[[e]]=A([[N]],{precision:5,toCanonicalUnits:!0});if(!(e&&t(e)&&i(e.value)&&Number.isInteger(e.value[4].value))){let e;if(void 0!==P){const t=k[u]*("px"===P?$:R);e=[a.Dimension,`${t.toString()}${P}`,-1,-1,{value:t,unit:P,type:n.Integer}]}else if(!0===E[r]){const t=k[u];e=[a.Number,t.toString(),-1,-1,{value:t,type:n.Integer}]}else if(b){const t=k[u]*R;e=[a.Number,t.toString(),-1,-1,{value:t,type:n.Integer}]}else{const t=k[u];e=[a.Number,t.toString(),-1,-1,{value:t,type:n.Integer}]}return v(featureNamePrefix(u)+r,...w,[a.Function,"calc(",-1,-1,{value:"calc("}],[a.OpenParen,"(",-1,-1,void 0],...N.tokens().slice(1),[a.Whitespace," ",-1,-1,void 0],[a.Delim,"+",-1,-1,{value:"+"}],[a.Whitespace," ",-1,-1,void 0],e,[a.CloseParen,")",-1,-1,void 0],...x,...y)}N=e}}if(!t(N))return;let L,I=N.value,Q="";if(void 0!==P&&o(I)&&0===I[4].value)L=k[u],Q=P;else if(o(I)&&0===I[4].value)L=k[u],Q="";else if(s(I)&&0===I[4].value)L=k[u],Q=I[4].unit;else if(o(I)&&!0===E[r])L=I[4].value+k[u];else if(s(I)&&"px"===I[4].unit&&I[4].type===n.Integer)L=Number(Math.round(Number(I[4].value+$*k[u]+"e6"))+"e-6");else{if(!s(I)&&!o(I))return;L=Number(Math.round(Number(I[4].value+R*k[u]+"e6"))+"e-6")}return Q&&(I=[a.Dimension,I[1],I[2],I[3],{value:I[4].value,unit:Q,type:I[4].type}]),I[4].value=L,s(I)?I[1]=I[4].value.toString()+I[4].unit:I[1]=I[4].value.toString(),v(featureNamePrefix(u)+r,...w,I,...x,...y)}const F=new Set(["aspect-ratio","color","color-index","device-aspect-ratio","device-height","device-width","height","horizontal-viewport-segments","monochrome","resolution","vertical-viewport-segments","width"]);function transform(e){return e.map(((e,t)=>{const i=r(e);e.walk((t=>{const r=t.node;if(!g(r))return;const n=t.parent;if(!w(n))return;const o=r.name.getName().toLowerCase();if(!F.has(o))return;if(y(r)||N(r)){const e=r.operatorKind();if(!1===e)return;const t=transformSingleNameValuePair(o,e,r.value,y(r));return void(t&&(n.feature=t.feature))}const s=i.get(n);if(!x(s))return;let u=null,l=null;{const e=r.valueOneOperatorKind();if(!1===e)return;const t=transformSingleNameValuePair(o,e,r.valueOne,!1);if(!t)return;e===f.LT||e===f.LT_OR_EQ?(u=t,u.before=n.before):(l=t,l.after=n.after)}{const e=r.valueTwoOperatorKind();if(!1===e)return;const t=transformSingleNameValuePair(o,e,r.valueTwo,!0);if(!t)return;e===f.LT||e===f.LT_OR_EQ?(l=t,l.before=n.before):(u=t,u.after=n.after)}if(!u||!l)return;const c=new b(u),d=new b(l),m=getMediaConditionListWithAndFromAncestry(s,i);if(m)return m.leading===s?(m.leading=c,void(m.list=[new P([[a.Whitespace," ",-1,-1,void 0],[a.Ident,"and",-1,-1,{value:"and"}],[a.Whitespace," ",-1,-1,void 0]],d),...m.list])):void m.list.splice(m.indexOf(i.get(s)),1,new P([[a.Whitespace," ",-1,-1,void 0],[a.Ident,"and",-1,-1,{value:"and"}],[a.Whitespace," ",-1,-1,void 0]],c),new P([[a.Whitespace," ",-1,-1,void 0],[a.Ident,"and",-1,-1,{value:"and"}],[a.Whitespace," ",-1,-1,void 0]],d));const v=new L(c,[new P([[a.Whitespace," ",-1,-1,void 0],[a.Ident,"and",-1,-1,{value:"and"}],[a.Whitespace," ",-1,-1,void 0]],d)],[[a.Whitespace," ",-1,-1,void 0]]),p=getMediaConditionInShallowMediaQueryFromAncestry(s,e,i);p?p.media=v:s.media=new I(new b(new I(v),[[a.Whitespace," ",-1,-1,void 0],[a.OpenParen,"(",-1,-1,void 0]],[[a.CloseParen,")",-1,-1,void 0]]))}));const n=e.tokens();return u(...n.filter(((e,r)=>(0!==r||0!==t||!l(e))&&!(l(e)&&n[r+1]&&l(n[r+1])))))})).join(",")}function getMediaConditionListWithAndFromAncestry(e,t){let r=e;if(r){if(r=t.get(r),Q(r))return r;if(S(r))return r=t.get(r),Q(r)?r:void 0}}function getMediaConditionInShallowMediaQueryFromAncestry(e,t,r){let i=e;if(!i)return;if(i=r.get(i),!W(i))return;const a=i;return i=r.get(i),O(i)&&i===t?a:void 0}const creator=()=>({postcssPlugin:"postcss-media-minmax",AtRule:{media(e){if(!(e.params.includes("<")||e.params.includes(">")||e.params.includes("=")))return;const t=transform(M(e.params,{preserveInvalidMediaQueries:!0,onParseError:()=>{throw e.error(`Unable to parse media query "${e.params}"`)}}));e.params!==t&&(e.params=t)},"custom-media"(e){if(!(e.params.includes("<")||e.params.includes(">")||e.params.includes("=")))return;const t=T(e.params,{preserveInvalidMediaQueries:!0,onParseError:()=>{throw e.error(`Unable to parse media query "${e.params}"`)}});if(!t||!t.mediaQueryList)return;const r=t.mediaQueryList.map((e=>e.toString())).join(","),i=transform(t.mediaQueryList);r!==i&&(e.params=`${u(...t.name)} ${i}`)}}});creator.postcss=!0;export{creator as default};
diff --git a/node_modules/@csstools/postcss-media-minmax/package.json b/node_modules/@csstools/postcss-media-minmax/package.json
index d4f0e0c3..bbf5861e 100644
--- a/node_modules/@csstools/postcss-media-minmax/package.json
+++ b/node_modules/@csstools/postcss-media-minmax/package.json
@@ -1,7 +1,7 @@
{
"name": "@csstools/postcss-media-minmax",
"description": "Use the range notation in CSS media queries",
- "version": "1.1.2",
+ "version": "1.1.6",
"contributors": [
{
"name": "Antonio Laguna",
@@ -51,10 +51,10 @@
"dist"
],
"dependencies": {
- "@csstools/css-calc": "^1.1.6",
- "@csstools/css-parser-algorithms": "^2.5.0",
- "@csstools/css-tokenizer": "^2.2.3",
- "@csstools/media-query-list-parser": "^2.1.7"
+ "@csstools/css-calc": "^1.2.2",
+ "@csstools/css-parser-algorithms": "^2.6.3",
+ "@csstools/css-tokenizer": "^2.3.1",
+ "@csstools/media-query-list-parser": "^2.1.11"
},
"peerDependencies": {
"postcss": "^8.4"
@@ -62,7 +62,7 @@
"homepage": "https://github.com/csstools/postcss-plugins/tree/main/plugins/postcss-media-minmax#readme",
"repository": {
"type": "git",
- "url": "https://github.com/csstools/postcss-plugins.git",
+ "url": "git+https://github.com/csstools/postcss-plugins.git",
"directory": "plugins/postcss-media-minmax"
},
"bugs": "https://github.com/csstools/postcss-plugins/issues",
diff --git a/node_modules/@csstools/postcss-media-queries-aspect-ratio-number-values/CHANGELOG.md b/node_modules/@csstools/postcss-media-queries-aspect-ratio-number-values/CHANGELOG.md
index 24d1557f..7be0dd01 100644
--- a/node_modules/@csstools/postcss-media-queries-aspect-ratio-number-values/CHANGELOG.md
+++ b/node_modules/@csstools/postcss-media-queries-aspect-ratio-number-values/CHANGELOG.md
@@ -1,28 +1,27 @@
# Changes to PostCSS Media Queries Aspect-Ratio Number Values
-### 2.0.5
+### 2.0.9
-_December 31, 2023_
+_May 4, 2024_
-- Updated [`@csstools/css-tokenizer`](https://github.com/csstools/postcss-plugins/tree/main/packages/css-tokenizer) to [`2.2.3`](https://github.com/csstools/postcss-plugins/tree/main/packages/css-tokenizer/CHANGELOG.md#223) (patch)
-- Updated [`@csstools/css-parser-algorithms`](https://github.com/csstools/postcss-plugins/tree/main/packages/css-parser-algorithms) to [`2.5.0`](https://github.com/csstools/postcss-plugins/tree/main/packages/css-parser-algorithms/CHANGELOG.md#250) (minor)
-- Updated [`@csstools/media-query-list-parser`](https://github.com/csstools/postcss-plugins/tree/main/packages/media-query-list-parser) to [`2.1.7`](https://github.com/csstools/postcss-plugins/tree/main/packages/media-query-list-parser/CHANGELOG.md#217) (patch)
+- Updated [`@csstools/css-tokenizer`](https://github.com/csstools/postcss-plugins/tree/main/packages/css-tokenizer) to [`2.3.1`](https://github.com/csstools/postcss-plugins/tree/main/packages/css-tokenizer/CHANGELOG.md#231) (patch)
+- Updated [`@csstools/css-parser-algorithms`](https://github.com/csstools/postcss-plugins/tree/main/packages/css-parser-algorithms) to [`2.6.3`](https://github.com/csstools/postcss-plugins/tree/main/packages/css-parser-algorithms/CHANGELOG.md#263) (patch)
+- Updated [`@csstools/media-query-list-parser`](https://github.com/csstools/postcss-plugins/tree/main/packages/media-query-list-parser) to [`2.1.11`](https://github.com/csstools/postcss-plugins/tree/main/packages/media-query-list-parser/CHANGELOG.md#2111) (patch)
-### 2.0.4
+### 2.0.8
-_December 15, 2023_
+_May 4, 2024_
-- Fix type definitions
-- Updated [`@csstools/css-tokenizer`](https://github.com/csstools/postcss-plugins/tree/main/packages/css-tokenizer) to [`2.2.2`](https://github.com/csstools/postcss-plugins/tree/main/packages/css-tokenizer/CHANGELOG.md#222) (patch)
-- Updated [`@csstools/css-parser-algorithms`](https://github.com/csstools/postcss-plugins/tree/main/packages/css-parser-algorithms) to [`2.4.0`](https://github.com/csstools/postcss-plugins/tree/main/packages/css-parser-algorithms/CHANGELOG.md#240) (minor)
-- Updated [`@csstools/media-query-list-parser`](https://github.com/csstools/postcss-plugins/tree/main/packages/media-query-list-parser) to [`2.1.6`](https://github.com/csstools/postcss-plugins/tree/main/packages/media-query-list-parser/CHANGELOG.md#216) (patch)
+- Updated [`@csstools/css-tokenizer`](https://github.com/csstools/postcss-plugins/tree/main/packages/css-tokenizer) to [`2.3.0`](https://github.com/csstools/postcss-plugins/tree/main/packages/css-tokenizer/CHANGELOG.md#230) (minor)
+- Updated [`@csstools/css-parser-algorithms`](https://github.com/csstools/postcss-plugins/tree/main/packages/css-parser-algorithms) to [`2.6.2`](https://github.com/csstools/postcss-plugins/tree/main/packages/css-parser-algorithms/CHANGELOG.md#262) (patch)
+- Updated [`@csstools/media-query-list-parser`](https://github.com/csstools/postcss-plugins/tree/main/packages/media-query-list-parser) to [`2.1.10`](https://github.com/csstools/postcss-plugins/tree/main/packages/media-query-list-parser/CHANGELOG.md#2110) (patch)
-### 2.0.3
+### 2.0.7
-_September 24, 2023_
+_March 13, 2024_
-- Updated [`@csstools/css-tokenizer`](https://github.com/csstools/postcss-plugins/tree/main/packages/css-tokenizer) to [`2.2.1`](https://github.com/csstools/postcss-plugins/tree/main/packages/css-tokenizer/CHANGELOG.md#221) (patch)
-- Updated [`@csstools/css-parser-algorithms`](https://github.com/csstools/postcss-plugins/tree/main/packages/css-parser-algorithms) to [`2.3.2`](https://github.com/csstools/postcss-plugins/tree/main/packages/css-parser-algorithms/CHANGELOG.md#232) (patch)
-- Updated [`@csstools/media-query-list-parser`](https://github.com/csstools/postcss-plugins/tree/main/packages/media-query-list-parser) to [`2.1.5`](https://github.com/csstools/postcss-plugins/tree/main/packages/media-query-list-parser/CHANGELOG.md#215) (patch)
+- Updated [`@csstools/css-tokenizer`](https://github.com/csstools/postcss-plugins/tree/main/packages/css-tokenizer) to [`2.2.4`](https://github.com/csstools/postcss-plugins/tree/main/packages/css-tokenizer/CHANGELOG.md#224) (patch)
+- Updated [`@csstools/css-parser-algorithms`](https://github.com/csstools/postcss-plugins/tree/main/packages/css-parser-algorithms) to [`2.6.1`](https://github.com/csstools/postcss-plugins/tree/main/packages/css-parser-algorithms/CHANGELOG.md#261) (patch)
+- Updated [`@csstools/media-query-list-parser`](https://github.com/csstools/postcss-plugins/tree/main/packages/media-query-list-parser) to [`2.1.9`](https://github.com/csstools/postcss-plugins/tree/main/packages/media-query-list-parser/CHANGELOG.md#219) (patch)
[Full CHANGELOG](https://github.com/csstools/postcss-plugins/tree/main/plugins/postcss-media-queries-aspect-ratio-number-values/CHANGELOG.md)
diff --git a/node_modules/@csstools/postcss-media-queries-aspect-ratio-number-values/dist/index.cjs b/node_modules/@csstools/postcss-media-queries-aspect-ratio-number-values/dist/index.cjs
index 6b2cf88f..fff30ccf 100644
--- a/node_modules/@csstools/postcss-media-queries-aspect-ratio-number-values/dist/index.cjs
+++ b/node_modules/@csstools/postcss-media-queries-aspect-ratio-number-values/dist/index.cjs
@@ -1 +1 @@
-"use strict";var e=require("@csstools/media-query-list-parser"),r=require("@csstools/css-parser-algorithms"),n=require("@csstools/css-tokenizer");const o=1e5,t=2147483647;function transformMediaFeatureValue(a){if(Array.isArray(a.value)&&e.matchesRatioExactly(a.value)){const e=[];for(let o=0;o<a.value.length;o++){const t=a.value[o];r.isTokenNode(t)&&t.value[0]===n.TokenType.Number?e.push(t):r.isFunctionNode(t)&&"calc"===t.getName().toLowerCase()&&e.push(t)}if(2!==e.length)return;const i=e[0],u=a.value.indexOf(i),s=e[1],l=a.value.indexOf(s);if(r.isTokenNode(s)&&s.value[0]===n.TokenType.Number&&0===s.value[4].value)return a.value.splice(u,1,new r.TokenNode([n.TokenType.Number,t.toString(),-1,-1,{value:t,type:n.NumberType.Integer}])),void a.value.splice(l,1,new r.TokenNode([n.TokenType.Number,"1",-1,-1,{value:1,type:n.NumberType.Integer}]));if(r.isTokenNode(i)&&i.value[0]===n.TokenType.Number&&i.value[4].type===n.NumberType.Integer&&r.isTokenNode(s)&&s.value[0]===n.TokenType.Number&&s.value[4].type===n.NumberType.Integer)return;let c=null,p=null;if(r.isFunctionNode(i)&&"calc"===i.getName().toLowerCase()){if(i.toString().includes(o.toString()))return;c=modifyCalc(i)}if(r.isFunctionNode(s)&&"calc"===s.getName().toLowerCase()){if(s.toString().includes(o.toString()))return;p=modifyCalc(s)}if(r.isTokenNode(i)&&i.value[0]===n.TokenType.Number&&r.isTokenNode(s)&&s.value[0]===n.TokenType.Number){const e=i.value,t=s.value,a=Math.round(e[4].value*o),u=Math.round(t[4].value*o),l=greatestCommonDivisor(a,u);c=new r.TokenNode([n.TokenType.Number,Math.round(a/l).toString(),-1,-1,{value:Math.round(a/l),type:n.NumberType.Integer}]),p=new r.TokenNode([n.TokenType.Number,Math.round(u/l).toString(),-1,-1,{value:Math.round(u/l),type:n.NumberType.Integer}])}else{if(r.isTokenNode(i)&&i.value[0]===n.TokenType.Number){const e=i.value;c=new r.TokenNode([n.TokenType.Number,Math.round(e[4].value*o).toString(),-1,-1,{value:Math.round(e[4].value*o),type:n.NumberType.Integer}])}if(r.isTokenNode(s)&&s.value[0]===n.TokenType.Number){const e=s.value;p=new r.TokenNode([n.TokenType.Number,Math.round(e[4].value*o).toString(),-1,-1,{value:Math.round(e[4].value*o),type:n.NumberType.Integer}])}}return c&&p?(a.value.splice(u,1,c),void a.value.splice(l,1,p)):void 0}const i=Array.isArray(a.value)?a.value:[a.value];for(let e=0;e<i.length;e++){const t=i[e];if(r.isTokenNode(t)){const u=t.value;if(u[0]!==n.TokenType.Number)return;if(u[4].type===n.NumberType.Integer)return i.splice(e+1,0,new r.TokenNode([n.TokenType.Delim,"/",-1,-1,{value:"/"}]),new r.TokenNode([n.TokenType.Number,"1",-1,-1,{value:1,type:n.NumberType.Integer}])),void(a.value=i);if(u[4].type===n.NumberType.Number){const t=Math.round(u[4].value*o),s=greatestCommonDivisor(t,o);return i.splice(e,1,new r.TokenNode([n.TokenType.Number,Math.round(t/s).toString(),-1,-1,{value:Math.round(t/s),type:n.NumberType.Integer}]),new r.TokenNode([n.TokenType.Delim,"/",-1,-1,{value:"/"}]),new r.TokenNode([n.TokenType.Number,Math.round(o/s).toString(),-1,-1,{value:Math.round(o/s),type:n.NumberType.Integer}])),void(a.value=i)}return}if(r.isFunctionNode(t)&&"calc"===t.getName().toLowerCase())return i.splice(e,1,modifyCalc(t),new r.TokenNode([n.TokenType.Delim,"/",-1,-1,{value:"/"}]),new r.TokenNode([n.TokenType.Number,o.toString(),-1,-1,{value:o,type:n.NumberType.Integer}])),void(a.value=i)}}function modifyCalc(e){return new r.FunctionNode([n.TokenType.Function,"calc(",-1,-1,{value:"calc("}],[n.TokenType.CloseParen,")",-1,-1,void 0],[new r.SimpleBlockNode([n.TokenType.OpenParen,"(",-1,-1,void 0],[n.TokenType.CloseParen,")",-1,-1,void 0],e.value),new r.WhitespaceNode([[n.TokenType.Whitespace," ",-1,-1,void 0]]),new r.TokenNode([n.TokenType.Delim,"*",-1,-1,{value:"*"}]),new r.WhitespaceNode([[n.TokenType.Whitespace," ",-1,-1,void 0]]),new r.TokenNode([n.TokenType.Number,o.toString(),-1,-1,{value:o,type:n.NumberType.Integer}])])}function greatestCommonDivisor(e,r){if(Number.isNaN(e)||Number.isNaN(r))throw new Error("Unexpected 'NaN' when calculating the greatest common divisor.");if(!Number.isFinite(e)||!Number.isFinite(r))throw new Error("Unexpected 'Infinite' value when calculating the greatest common divisor.");for(r>e&&([e,r]=[r,e]);;){if(0==r)return e;if(0==(e%=r))return r;r%=e}}const a=new Set(["aspect-ratio","min-aspect-ratio","max-aspect-ratio","device-aspect-ratio","min-device-aspect-ratio","max-device-aspect-ratio"]);function transformMediaQueryList(r,n){const o=e.parse(r,{preserveInvalidMediaQueries:!0,onParseError:()=>{throw new Error(`Unable to parse media query "${r}"`)}}),t=new Set(o.map((e=>e.toString())));return o.flatMap((r=>{if(e.isMediaQueryInvalid(r))return[r.toString()];const o=e.cloneMediaQuery(r);o.walk((r=>{const n=r.node;if(e.isMediaFeaturePlain(n)||e.isMediaFeatureRangeNameValue(n)||e.isMediaFeatureRangeValueName(n)){const e=n.name.getName().toLowerCase();if(!a.has(e))return;transformMediaFeatureValue(n.value)}else if(e.isMediaFeatureRangeValueNameValue(n)){const e=n.name.getName().toLowerCase();if(!a.has(e))return;transformMediaFeatureValue(n.valueOne);transformMediaFeatureValue(n.valueTwo)}else;}));const i=r.toString(),u=o.toString();return u===i||t.has(u)?[i]:n?[i,u]:[u]})).join(",")}const creator=e=>{const r=Object.assign({preserve:!1},e);return{postcssPlugin:"postcss-media-queries-aspect-ratio-number-values",AtRule(e,{result:n}){if("media"!==e.name.toLowerCase())return;const o=e.params.toLowerCase();if(!(o.includes("aspect-ratio")||o.includes("min-aspect-ratio")||o.includes("max-aspect-ratio")||o.includes("device-aspect-ratio")||o.includes("min-device-aspect-ratio")||o.includes("max-device-aspect-ratio")))return;let t;try{if(t=transformMediaQueryList(e.params,r.preserve),t===e.params)return}catch(r){return void e.warn(n,`Failed to transform @media params for "${e.params}" with message: "${r instanceof Error?r.message:r}"`)}e.cloneBefore({params:t}),e.remove()}}};creator.postcss=!0,module.exports=creator;
+"use strict";var e=require("@csstools/media-query-list-parser"),r=require("@csstools/css-parser-algorithms"),n=require("@csstools/css-tokenizer");const o=1e5,t=2147483647;function transformMediaFeatureValue(a){if(Array.isArray(a.value)&&e.matchesRatioExactly(a.value)){const e=[];for(let o=0;o<a.value.length;o++){const t=a.value[o];r.isTokenNode(t)&&n.isTokenNumber(t.value)?e.push(t):r.isFunctionNode(t)&&"calc"===t.getName().toLowerCase()&&e.push(t)}if(2!==e.length)return;const i=e[0],u=a.value.indexOf(i),s=e[1],l=a.value.indexOf(s);if(r.isTokenNode(s)&&n.isTokenNumber(s.value)&&0===s.value[4].value)return a.value.splice(u,1,new r.TokenNode([n.TokenType.Number,t.toString(),-1,-1,{value:t,type:n.NumberType.Integer}])),void a.value.splice(l,1,new r.TokenNode([n.TokenType.Number,"1",-1,-1,{value:1,type:n.NumberType.Integer}]));if(r.isTokenNode(i)&&n.isTokenNumber(i.value)&&i.value[4].type===n.NumberType.Integer&&r.isTokenNode(s)&&n.isTokenNumber(s.value)&&s.value[4].type===n.NumberType.Integer)return;let c=null,d=null;if(r.isFunctionNode(i)&&"calc"===i.getName().toLowerCase()){if(i.toString().includes(o.toString()))return;c=modifyCalc(i)}if(r.isFunctionNode(s)&&"calc"===s.getName().toLowerCase()){if(s.toString().includes(o.toString()))return;d=modifyCalc(s)}if(r.isTokenNode(i)&&n.isTokenNumber(i.value)&&r.isTokenNode(s)&&n.isTokenNumber(s.value)){const e=i.value,t=s.value,a=Math.round(e[4].value*o),u=Math.round(t[4].value*o),l=greatestCommonDivisor(a,u);c=new r.TokenNode([n.TokenType.Number,Math.round(a/l).toString(),-1,-1,{value:Math.round(a/l),type:n.NumberType.Integer}]),d=new r.TokenNode([n.TokenType.Number,Math.round(u/l).toString(),-1,-1,{value:Math.round(u/l),type:n.NumberType.Integer}])}else{if(r.isTokenNode(i)&&n.isTokenNumber(i.value)){const e=i.value;c=new r.TokenNode([n.TokenType.Number,Math.round(e[4].value*o).toString(),-1,-1,{value:Math.round(e[4].value*o),type:n.NumberType.Integer}])}if(r.isTokenNode(s)&&n.isTokenNumber(s.value)){const e=s.value;d=new r.TokenNode([n.TokenType.Number,Math.round(e[4].value*o).toString(),-1,-1,{value:Math.round(e[4].value*o),type:n.NumberType.Integer}])}}return c&&d?(a.value.splice(u,1,c),void a.value.splice(l,1,d)):void 0}const i=Array.isArray(a.value)?a.value:[a.value];for(let e=0;e<i.length;e++){const t=i[e];if(r.isTokenNode(t)){const u=t.value;if(!n.isTokenNumber(u))return;if(u[4].type===n.NumberType.Integer)return i.splice(e+1,0,new r.TokenNode([n.TokenType.Delim,"/",-1,-1,{value:"/"}]),new r.TokenNode([n.TokenType.Number,"1",-1,-1,{value:1,type:n.NumberType.Integer}])),void(a.value=i);if(u[4].type===n.NumberType.Number){const t=Math.round(u[4].value*o),s=greatestCommonDivisor(t,o);return i.splice(e,1,new r.TokenNode([n.TokenType.Number,Math.round(t/s).toString(),-1,-1,{value:Math.round(t/s),type:n.NumberType.Integer}]),new r.TokenNode([n.TokenType.Delim,"/",-1,-1,{value:"/"}]),new r.TokenNode([n.TokenType.Number,Math.round(o/s).toString(),-1,-1,{value:Math.round(o/s),type:n.NumberType.Integer}])),void(a.value=i)}return}if(r.isFunctionNode(t)&&"calc"===t.getName().toLowerCase())return i.splice(e,1,modifyCalc(t),new r.TokenNode([n.TokenType.Delim,"/",-1,-1,{value:"/"}]),new r.TokenNode([n.TokenType.Number,o.toString(),-1,-1,{value:o,type:n.NumberType.Integer}])),void(a.value=i)}}function modifyCalc(e){return new r.FunctionNode([n.TokenType.Function,"calc(",-1,-1,{value:"calc("}],[n.TokenType.CloseParen,")",-1,-1,void 0],[new r.SimpleBlockNode([n.TokenType.OpenParen,"(",-1,-1,void 0],[n.TokenType.CloseParen,")",-1,-1,void 0],e.value),new r.WhitespaceNode([[n.TokenType.Whitespace," ",-1,-1,void 0]]),new r.TokenNode([n.TokenType.Delim,"*",-1,-1,{value:"*"}]),new r.WhitespaceNode([[n.TokenType.Whitespace," ",-1,-1,void 0]]),new r.TokenNode([n.TokenType.Number,o.toString(),-1,-1,{value:o,type:n.NumberType.Integer}])])}function greatestCommonDivisor(e,r){if(Number.isNaN(e)||Number.isNaN(r))throw new Error("Unexpected 'NaN' when calculating the greatest common divisor.");if(!Number.isFinite(e)||!Number.isFinite(r))throw new Error("Unexpected 'Infinite' value when calculating the greatest common divisor.");for(r>e&&([e,r]=[r,e]);;){if(0==r)return e;if(0==(e%=r))return r;r%=e}}const a=new Set(["aspect-ratio","min-aspect-ratio","max-aspect-ratio","device-aspect-ratio","min-device-aspect-ratio","max-device-aspect-ratio"]);function transformMediaQueryList(r,n){const o=e.parse(r,{preserveInvalidMediaQueries:!0,onParseError:()=>{throw new Error(`Unable to parse media query "${r}"`)}}),t=new Set(o.map((e=>e.toString())));return o.flatMap((r=>{if(e.isMediaQueryInvalid(r))return[r.toString()];const o=e.cloneMediaQuery(r);o.walk((r=>{const n=r.node;if(e.isMediaFeaturePlain(n)||e.isMediaFeatureRangeNameValue(n)||e.isMediaFeatureRangeValueName(n)){const e=n.name.getName().toLowerCase();if(!a.has(e))return;transformMediaFeatureValue(n.value)}else if(e.isMediaFeatureRangeValueNameValue(n)){const e=n.name.getName().toLowerCase();if(!a.has(e))return;transformMediaFeatureValue(n.valueOne);transformMediaFeatureValue(n.valueTwo)}else;}));const i=r.toString(),u=o.toString();return u===i||t.has(u)?[i]:n?[i,u]:[u]})).join(",")}const creator=e=>{const r=Object.assign({preserve:!1},e);return{postcssPlugin:"postcss-media-queries-aspect-ratio-number-values",AtRule(e,{result:n}){if("media"!==e.name.toLowerCase())return;const o=e.params.toLowerCase();if(!(o.includes("aspect-ratio")||o.includes("min-aspect-ratio")||o.includes("max-aspect-ratio")||o.includes("device-aspect-ratio")||o.includes("min-device-aspect-ratio")||o.includes("max-device-aspect-ratio")))return;let t;try{if(t=transformMediaQueryList(e.params,r.preserve),t===e.params)return}catch(r){return void e.warn(n,`Failed to transform @media params for "${e.params}" with message: "${r instanceof Error?r.message:r}"`)}e.cloneBefore({params:t}),e.remove()}}};creator.postcss=!0,module.exports=creator;
diff --git a/node_modules/@csstools/postcss-media-queries-aspect-ratio-number-values/dist/index.mjs b/node_modules/@csstools/postcss-media-queries-aspect-ratio-number-values/dist/index.mjs
index 9b382247..823fc128 100644
--- a/node_modules/@csstools/postcss-media-queries-aspect-ratio-number-values/dist/index.mjs
+++ b/node_modules/@csstools/postcss-media-queries-aspect-ratio-number-values/dist/index.mjs
@@ -1 +1 @@
-import{matchesRatioExactly as e,parse as r,isMediaQueryInvalid as t,cloneMediaQuery as a,isMediaFeaturePlain as n,isMediaFeatureRangeNameValue as o,isMediaFeatureRangeValueName as i,isMediaFeatureRangeValueNameValue as u}from"@csstools/media-query-list-parser";import{isTokenNode as s,isFunctionNode as l,TokenNode as c,FunctionNode as m,SimpleBlockNode as v,WhitespaceNode as d}from"@csstools/css-parser-algorithms";import{TokenType as p,NumberType as f}from"@csstools/css-tokenizer";const g=1e5,w=2147483647;function transformMediaFeatureValue(r){if(Array.isArray(r.value)&&e(r.value)){const e=[];for(let t=0;t<r.value.length;t++){const a=r.value[t];s(a)&&a.value[0]===p.Number?e.push(a):l(a)&&"calc"===a.getName().toLowerCase()&&e.push(a)}if(2!==e.length)return;const t=e[0],a=r.value.indexOf(t),n=e[1],o=r.value.indexOf(n);if(s(n)&&n.value[0]===p.Number&&0===n.value[4].value)return r.value.splice(a,1,new c([p.Number,w.toString(),-1,-1,{value:w,type:f.Integer}])),void r.value.splice(o,1,new c([p.Number,"1",-1,-1,{value:1,type:f.Integer}]));if(s(t)&&t.value[0]===p.Number&&t.value[4].type===f.Integer&&s(n)&&n.value[0]===p.Number&&n.value[4].type===f.Integer)return;let i=null,u=null;if(l(t)&&"calc"===t.getName().toLowerCase()){if(t.toString().includes(g.toString()))return;i=modifyCalc(t)}if(l(n)&&"calc"===n.getName().toLowerCase()){if(n.toString().includes(g.toString()))return;u=modifyCalc(n)}if(s(t)&&t.value[0]===p.Number&&s(n)&&n.value[0]===p.Number){const e=t.value,r=n.value,a=Math.round(e[4].value*g),o=Math.round(r[4].value*g),s=greatestCommonDivisor(a,o);i=new c([p.Number,Math.round(a/s).toString(),-1,-1,{value:Math.round(a/s),type:f.Integer}]),u=new c([p.Number,Math.round(o/s).toString(),-1,-1,{value:Math.round(o/s),type:f.Integer}])}else{if(s(t)&&t.value[0]===p.Number){const e=t.value;i=new c([p.Number,Math.round(e[4].value*g).toString(),-1,-1,{value:Math.round(e[4].value*g),type:f.Integer}])}if(s(n)&&n.value[0]===p.Number){const e=n.value;u=new c([p.Number,Math.round(e[4].value*g).toString(),-1,-1,{value:Math.round(e[4].value*g),type:f.Integer}])}}return i&&u?(r.value.splice(a,1,i),void r.value.splice(o,1,u)):void 0}const t=Array.isArray(r.value)?r.value:[r.value];for(let e=0;e<t.length;e++){const a=t[e];if(s(a)){const n=a.value;if(n[0]!==p.Number)return;if(n[4].type===f.Integer)return t.splice(e+1,0,new c([p.Delim,"/",-1,-1,{value:"/"}]),new c([p.Number,"1",-1,-1,{value:1,type:f.Integer}])),void(r.value=t);if(n[4].type===f.Number){const a=Math.round(n[4].value*g),o=greatestCommonDivisor(a,g);return t.splice(e,1,new c([p.Number,Math.round(a/o).toString(),-1,-1,{value:Math.round(a/o),type:f.Integer}]),new c([p.Delim,"/",-1,-1,{value:"/"}]),new c([p.Number,Math.round(g/o).toString(),-1,-1,{value:Math.round(g/o),type:f.Integer}])),void(r.value=t)}return}if(l(a)&&"calc"===a.getName().toLowerCase())return t.splice(e,1,modifyCalc(a),new c([p.Delim,"/",-1,-1,{value:"/"}]),new c([p.Number,g.toString(),-1,-1,{value:g,type:f.Integer}])),void(r.value=t)}}function modifyCalc(e){return new m([p.Function,"calc(",-1,-1,{value:"calc("}],[p.CloseParen,")",-1,-1,void 0],[new v([p.OpenParen,"(",-1,-1,void 0],[p.CloseParen,")",-1,-1,void 0],e.value),new d([[p.Whitespace," ",-1,-1,void 0]]),new c([p.Delim,"*",-1,-1,{value:"*"}]),new d([[p.Whitespace," ",-1,-1,void 0]]),new c([p.Number,g.toString(),-1,-1,{value:g,type:f.Integer}])])}function greatestCommonDivisor(e,r){if(Number.isNaN(e)||Number.isNaN(r))throw new Error("Unexpected 'NaN' when calculating the greatest common divisor.");if(!Number.isFinite(e)||!Number.isFinite(r))throw new Error("Unexpected 'Infinite' value when calculating the greatest common divisor.");for(r>e&&([e,r]=[r,e]);;){if(0==r)return e;if(0==(e%=r))return r;r%=e}}const N=new Set(["aspect-ratio","min-aspect-ratio","max-aspect-ratio","device-aspect-ratio","min-device-aspect-ratio","max-device-aspect-ratio"]);function transformMediaQueryList(e,s){const l=r(e,{preserveInvalidMediaQueries:!0,onParseError:()=>{throw new Error(`Unable to parse media query "${e}"`)}}),c=new Set(l.map((e=>e.toString())));return l.flatMap((e=>{if(t(e))return[e.toString()];const r=a(e);r.walk((e=>{const r=e.node;if(n(r)||o(r)||i(r)){const e=r.name.getName().toLowerCase();if(!N.has(e))return;transformMediaFeatureValue(r.value)}else if(u(r)){const e=r.name.getName().toLowerCase();if(!N.has(e))return;transformMediaFeatureValue(r.valueOne);transformMediaFeatureValue(r.valueTwo)}else;}));const l=e.toString(),m=r.toString();return m===l||c.has(m)?[l]:s?[l,m]:[m]})).join(",")}const creator=e=>{const r=Object.assign({preserve:!1},e);return{postcssPlugin:"postcss-media-queries-aspect-ratio-number-values",AtRule(e,{result:t}){if("media"!==e.name.toLowerCase())return;const a=e.params.toLowerCase();if(!(a.includes("aspect-ratio")||a.includes("min-aspect-ratio")||a.includes("max-aspect-ratio")||a.includes("device-aspect-ratio")||a.includes("min-device-aspect-ratio")||a.includes("max-device-aspect-ratio")))return;let n;try{if(n=transformMediaQueryList(e.params,r.preserve),n===e.params)return}catch(r){return void e.warn(t,`Failed to transform @media params for "${e.params}" with message: "${r instanceof Error?r.message:r}"`)}e.cloneBefore({params:n}),e.remove()}}};creator.postcss=!0;export{creator as default};
+import{matchesRatioExactly as e,parse as t,isMediaQueryInvalid as r,cloneMediaQuery as a,isMediaFeaturePlain as n,isMediaFeatureRangeNameValue as o,isMediaFeatureRangeValueName as i,isMediaFeatureRangeValueNameValue as u}from"@csstools/media-query-list-parser";import{isTokenNode as s,isFunctionNode as l,TokenNode as c,FunctionNode as v,SimpleBlockNode as m,WhitespaceNode as d}from"@csstools/css-parser-algorithms";import{isTokenNumber as p,TokenType as f,NumberType as g}from"@csstools/css-tokenizer";const w=1e5,h=2147483647;function transformMediaFeatureValue(t){if(Array.isArray(t.value)&&e(t.value)){const e=[];for(let r=0;r<t.value.length;r++){const a=t.value[r];s(a)&&p(a.value)?e.push(a):l(a)&&"calc"===a.getName().toLowerCase()&&e.push(a)}if(2!==e.length)return;const r=e[0],a=t.value.indexOf(r),n=e[1],o=t.value.indexOf(n);if(s(n)&&p(n.value)&&0===n.value[4].value)return t.value.splice(a,1,new c([f.Number,h.toString(),-1,-1,{value:h,type:g.Integer}])),void t.value.splice(o,1,new c([f.Number,"1",-1,-1,{value:1,type:g.Integer}]));if(s(r)&&p(r.value)&&r.value[4].type===g.Integer&&s(n)&&p(n.value)&&n.value[4].type===g.Integer)return;let i=null,u=null;if(l(r)&&"calc"===r.getName().toLowerCase()){if(r.toString().includes(w.toString()))return;i=modifyCalc(r)}if(l(n)&&"calc"===n.getName().toLowerCase()){if(n.toString().includes(w.toString()))return;u=modifyCalc(n)}if(s(r)&&p(r.value)&&s(n)&&p(n.value)){const e=r.value,t=n.value,a=Math.round(e[4].value*w),o=Math.round(t[4].value*w),s=greatestCommonDivisor(a,o);i=new c([f.Number,Math.round(a/s).toString(),-1,-1,{value:Math.round(a/s),type:g.Integer}]),u=new c([f.Number,Math.round(o/s).toString(),-1,-1,{value:Math.round(o/s),type:g.Integer}])}else{if(s(r)&&p(r.value)){const e=r.value;i=new c([f.Number,Math.round(e[4].value*w).toString(),-1,-1,{value:Math.round(e[4].value*w),type:g.Integer}])}if(s(n)&&p(n.value)){const e=n.value;u=new c([f.Number,Math.round(e[4].value*w).toString(),-1,-1,{value:Math.round(e[4].value*w),type:g.Integer}])}}return i&&u?(t.value.splice(a,1,i),void t.value.splice(o,1,u)):void 0}const r=Array.isArray(t.value)?t.value:[t.value];for(let e=0;e<r.length;e++){const a=r[e];if(s(a)){const n=a.value;if(!p(n))return;if(n[4].type===g.Integer)return r.splice(e+1,0,new c([f.Delim,"/",-1,-1,{value:"/"}]),new c([f.Number,"1",-1,-1,{value:1,type:g.Integer}])),void(t.value=r);if(n[4].type===g.Number){const a=Math.round(n[4].value*w),o=greatestCommonDivisor(a,w);return r.splice(e,1,new c([f.Number,Math.round(a/o).toString(),-1,-1,{value:Math.round(a/o),type:g.Integer}]),new c([f.Delim,"/",-1,-1,{value:"/"}]),new c([f.Number,Math.round(w/o).toString(),-1,-1,{value:Math.round(w/o),type:g.Integer}])),void(t.value=r)}return}if(l(a)&&"calc"===a.getName().toLowerCase())return r.splice(e,1,modifyCalc(a),new c([f.Delim,"/",-1,-1,{value:"/"}]),new c([f.Number,w.toString(),-1,-1,{value:w,type:g.Integer}])),void(t.value=r)}}function modifyCalc(e){return new v([f.Function,"calc(",-1,-1,{value:"calc("}],[f.CloseParen,")",-1,-1,void 0],[new m([f.OpenParen,"(",-1,-1,void 0],[f.CloseParen,")",-1,-1,void 0],e.value),new d([[f.Whitespace," ",-1,-1,void 0]]),new c([f.Delim,"*",-1,-1,{value:"*"}]),new d([[f.Whitespace," ",-1,-1,void 0]]),new c([f.Number,w.toString(),-1,-1,{value:w,type:g.Integer}])])}function greatestCommonDivisor(e,t){if(Number.isNaN(e)||Number.isNaN(t))throw new Error("Unexpected 'NaN' when calculating the greatest common divisor.");if(!Number.isFinite(e)||!Number.isFinite(t))throw new Error("Unexpected 'Infinite' value when calculating the greatest common divisor.");for(t>e&&([e,t]=[t,e]);;){if(0==t)return e;if(0==(e%=t))return t;t%=e}}const y=new Set(["aspect-ratio","min-aspect-ratio","max-aspect-ratio","device-aspect-ratio","min-device-aspect-ratio","max-device-aspect-ratio"]);function transformMediaQueryList(e,s){const l=t(e,{preserveInvalidMediaQueries:!0,onParseError:()=>{throw new Error(`Unable to parse media query "${e}"`)}}),c=new Set(l.map((e=>e.toString())));return l.flatMap((e=>{if(r(e))return[e.toString()];const t=a(e);t.walk((e=>{const t=e.node;if(n(t)||o(t)||i(t)){const e=t.name.getName().toLowerCase();if(!y.has(e))return;transformMediaFeatureValue(t.value)}else if(u(t)){const e=t.name.getName().toLowerCase();if(!y.has(e))return;transformMediaFeatureValue(t.valueOne);transformMediaFeatureValue(t.valueTwo)}else;}));const l=e.toString(),v=t.toString();return v===l||c.has(v)?[l]:s?[l,v]:[v]})).join(",")}const creator=e=>{const t=Object.assign({preserve:!1},e);return{postcssPlugin:"postcss-media-queries-aspect-ratio-number-values",AtRule(e,{result:r}){if("media"!==e.name.toLowerCase())return;const a=e.params.toLowerCase();if(!(a.includes("aspect-ratio")||a.includes("min-aspect-ratio")||a.includes("max-aspect-ratio")||a.includes("device-aspect-ratio")||a.includes("min-device-aspect-ratio")||a.includes("max-device-aspect-ratio")))return;let n;try{if(n=transformMediaQueryList(e.params,t.preserve),n===e.params)return}catch(t){return void e.warn(r,`Failed to transform @media params for "${e.params}" with message: "${t instanceof Error?t.message:t}"`)}e.cloneBefore({params:n}),e.remove()}}};creator.postcss=!0;export{creator as default};
diff --git a/node_modules/@csstools/postcss-media-queries-aspect-ratio-number-values/package.json b/node_modules/@csstools/postcss-media-queries-aspect-ratio-number-values/package.json
index a2c2b76c..9711ad88 100644
--- a/node_modules/@csstools/postcss-media-queries-aspect-ratio-number-values/package.json
+++ b/node_modules/@csstools/postcss-media-queries-aspect-ratio-number-values/package.json
@@ -1,7 +1,7 @@
{
"name": "@csstools/postcss-media-queries-aspect-ratio-number-values",
"description": "Use number values in aspect-ratio media queries.",
- "version": "2.0.5",
+ "version": "2.0.9",
"contributors": [
{
"name": "Antonio Laguna",
@@ -48,9 +48,9 @@
"dist"
],
"dependencies": {
- "@csstools/css-parser-algorithms": "^2.5.0",
- "@csstools/css-tokenizer": "^2.2.3",
- "@csstools/media-query-list-parser": "^2.1.7"
+ "@csstools/css-parser-algorithms": "^2.6.3",
+ "@csstools/css-tokenizer": "^2.3.1",
+ "@csstools/media-query-list-parser": "^2.1.11"
},
"peerDependencies": {
"postcss": "^8.4"
@@ -58,7 +58,7 @@
"homepage": "https://github.com/csstools/postcss-plugins/tree/main/plugins/postcss-media-queries-aspect-ratio-number-values#readme",
"repository": {
"type": "git",
- "url": "https://github.com/csstools/postcss-plugins.git",
+ "url": "git+https://github.com/csstools/postcss-plugins.git",
"directory": "plugins/postcss-media-queries-aspect-ratio-number-values"
},
"bugs": "https://github.com/csstools/postcss-plugins/issues",
diff --git a/node_modules/@csstools/postcss-nested-calc/CHANGELOG.md b/node_modules/@csstools/postcss-nested-calc/CHANGELOG.md
index bd4cf68e..6d369f34 100644
--- a/node_modules/@csstools/postcss-nested-calc/CHANGELOG.md
+++ b/node_modules/@csstools/postcss-nested-calc/CHANGELOG.md
@@ -1,5 +1,11 @@
# Changes to PostCSS Nested Calc
+### 3.0.2
+
+_February 19, 2024_
+
+- Reuse code with `@csstools/utilities`
+
### 3.0.1
_December 15, 2023_
@@ -12,10 +18,4 @@ _July 3, 2023_
- Change license to `MIT-0` ([read more about this change in the blog post](https://preset-env.cssdb.org/blog/license-change/))
-### 2.0.2
-
-_February 9, 2023_
-
-- Reduce the amount of duplicate fallback CSS.
-
[Full CHANGELOG](https://github.com/csstools/postcss-plugins/tree/main/plugins/postcss-nested-calc/CHANGELOG.md)
diff --git a/node_modules/@csstools/postcss-nested-calc/README.md b/node_modules/@csstools/postcss-nested-calc/README.md
index 5b822e35..ce6119f4 100644
--- a/node_modules/@csstools/postcss-nested-calc/README.md
+++ b/node_modules/@csstools/postcss-nested-calc/README.md
@@ -1,6 +1,6 @@
# PostCSS Nested Calc [<img src="https://postcss.github.io/postcss/logo.svg" alt="PostCSS Logo" width="90" height="90" align="right">][PostCSS]
-[<img alt="npm version" src="https://img.shields.io/npm/v/@csstools/postcss-nested-calc.svg" height="20">][npm-url] [<img alt="CSS Standard Status" src="https://cssdb.org/images/badges/nested-calc.svg" height="20">][css-url] [<img alt="Build Status" src="https://github.com/csstools/postcss-plugins/workflows/test/badge.svg" height="20">][cli-url] [<img alt="Discord" src="https://shields.io/badge/Discord-5865F2?logo=discord&logoColor=white">][discord]
+[<img alt="npm version" src="https://img.shields.io/npm/v/@csstools/postcss-nested-calc.svg" height="20">][npm-url] [<img alt="Build Status" src="https://github.com/csstools/postcss-plugins/workflows/test/badge.svg" height="20">][cli-url] [<img alt="Discord" src="https://shields.io/badge/Discord-5865F2?logo=discord&logoColor=white">][discord]<br><br>[<img alt="Baseline Status" src="https://cssdb.org/images/badges-baseline/nested-calc.svg" height="20">][css-url] [<img alt="CSS Standard Status" src="https://cssdb.org/images/badges/nested-calc.svg" height="20">][css-url]
```bash
npm install @csstools/postcss-nested-calc --save-dev
diff --git a/node_modules/@csstools/postcss-nested-calc/dist/index.cjs b/node_modules/@csstools/postcss-nested-calc/dist/index.cjs
index a52f3cd7..27ae530a 100644
--- a/node_modules/@csstools/postcss-nested-calc/dist/index.cjs
+++ b/node_modules/@csstools/postcss-nested-calc/dist/index.cjs
@@ -1 +1 @@
-"use strict";var e=require("postcss-value-parser");const t=/calc\(/gim;function hasFallback(e){const t=e.parent;if(!t)return!1;const r=t.index(e);for(let a=0;a<r;a++){const r=t.nodes[a];if("decl"===r.type&&r.prop.toLowerCase()===e.prop.toLowerCase())return!0}return!1}const creator=r=>{const a=Object.assign({preserve:!0},r);return{postcssPlugin:"postcss-nested-calc",Declaration(r,{result:n}){if((r.value.match(t)||[]).length<2)return;if(r.variable)return;if(hasFallback(r))return;const o=r.value;let s;try{s=e(o)}catch(e){return void r.warn(n,`Failed to parse value '${o}'. Leaving the original value intact.`)}if(void 0===s)return;e.walk(s.nodes,(t=>{t.type&&"function"===t.type&&"calc"===t.value.toLowerCase()&&e.walk(t.nodes,(e=>{if(e.type&&"function"===e.type)return"calc"===e.value.toLowerCase()&&void(e.value="")}))}),!0);const c=String(s);c!==o&&(r.cloneBefore({value:c}),a.preserve||r.remove())}}};creator.postcss=!0,module.exports=creator;
+"use strict";var e=require("postcss-value-parser"),t=require("@csstools/utilities");const r=/calc\(/gim;const creator=s=>{const a=Object.assign({preserve:!0},s);return{postcssPlugin:"postcss-nested-calc",Declaration(s,{result:o}){if((s.value.match(r)||[]).length<2)return;if(s.variable)return;if(t.hasFallback(s))return;const c=s.value;let l;try{l=e(c)}catch(e){return void s.warn(o,`Failed to parse value '${c}'. Leaving the original value intact.`)}if(void 0===l)return;e.walk(l.nodes,(t=>{t.type&&"function"===t.type&&"calc"===t.value.toLowerCase()&&e.walk(t.nodes,(e=>{if(e.type&&"function"===e.type)return"calc"===e.value.toLowerCase()&&void(e.value="")}))}),!0);const n=String(l);n!==c&&(s.cloneBefore({value:n}),a.preserve||s.remove())}}};creator.postcss=!0,module.exports=creator;
diff --git a/node_modules/@csstools/postcss-nested-calc/dist/index.mjs b/node_modules/@csstools/postcss-nested-calc/dist/index.mjs
index 41363381..5ef02cad 100644
--- a/node_modules/@csstools/postcss-nested-calc/dist/index.mjs
+++ b/node_modules/@csstools/postcss-nested-calc/dist/index.mjs
@@ -1 +1 @@
-import e from"postcss-value-parser";const t=/calc\(/gim;function hasFallback(e){const t=e.parent;if(!t)return!1;const r=t.index(e);for(let a=0;a<r;a++){const r=t.nodes[a];if("decl"===r.type&&r.prop.toLowerCase()===e.prop.toLowerCase())return!0}return!1}const creator=r=>{const a=Object.assign({preserve:!0},r);return{postcssPlugin:"postcss-nested-calc",Declaration(r,{result:o}){if((r.value.match(t)||[]).length<2)return;if(r.variable)return;if(hasFallback(r))return;const n=r.value;let s;try{s=e(n)}catch(e){return void r.warn(o,`Failed to parse value '${n}'. Leaving the original value intact.`)}if(void 0===s)return;e.walk(s.nodes,(t=>{t.type&&"function"===t.type&&"calc"===t.value.toLowerCase()&&e.walk(t.nodes,(e=>{if(e.type&&"function"===e.type)return"calc"===e.value.toLowerCase()&&void(e.value="")}))}),!0);const c=String(s);c!==n&&(r.cloneBefore({value:c}),a.preserve||r.remove())}}};creator.postcss=!0;export{creator as default};
+import e from"postcss-value-parser";import{hasFallback as t}from"@csstools/utilities";const r=/calc\(/gim;const creator=s=>{const a=Object.assign({preserve:!0},s);return{postcssPlugin:"postcss-nested-calc",Declaration(s,{result:o}){if((s.value.match(r)||[]).length<2)return;if(s.variable)return;if(t(s))return;const n=s.value;let c;try{c=e(n)}catch(e){return void s.warn(o,`Failed to parse value '${n}'. Leaving the original value intact.`)}if(void 0===c)return;e.walk(c.nodes,(t=>{t.type&&"function"===t.type&&"calc"===t.value.toLowerCase()&&e.walk(t.nodes,(e=>{if(e.type&&"function"===e.type)return"calc"===e.value.toLowerCase()&&void(e.value="")}))}),!0);const l=String(c);l!==n&&(s.cloneBefore({value:l}),a.preserve||s.remove())}}};creator.postcss=!0;export{creator as default};
diff --git a/node_modules/@csstools/postcss-nested-calc/package.json b/node_modules/@csstools/postcss-nested-calc/package.json
index d4bb4e20..032d4110 100644
--- a/node_modules/@csstools/postcss-nested-calc/package.json
+++ b/node_modules/@csstools/postcss-nested-calc/package.json
@@ -1,7 +1,7 @@
{
"name": "@csstools/postcss-nested-calc",
"description": "Use nested calc() expressions in CSS",
- "version": "3.0.1",
+ "version": "3.0.2",
"contributors": [
{
"name": "Antonio Laguna",
@@ -48,6 +48,7 @@
"dist"
],
"dependencies": {
+ "@csstools/utilities": "^1.0.0",
"postcss-value-parser": "^4.2.0"
},
"peerDependencies": {
diff --git a/node_modules/@csstools/postcss-oklab-function/CHANGELOG.md b/node_modules/@csstools/postcss-oklab-function/CHANGELOG.md
index ff39dec0..4679e6b2 100644
--- a/node_modules/@csstools/postcss-oklab-function/CHANGELOG.md
+++ b/node_modules/@csstools/postcss-oklab-function/CHANGELOG.md
@@ -1,28 +1,25 @@
# Changes to PostCSS OKLab Function
-### 3.0.9
+### 3.0.16
-_December 31, 2023_
+_May 4, 2024_
-- Updated [`@csstools/css-tokenizer`](https://github.com/csstools/postcss-plugins/tree/main/packages/css-tokenizer) to [`2.2.3`](https://github.com/csstools/postcss-plugins/tree/main/packages/css-tokenizer/CHANGELOG.md#223) (patch)
-- Updated [`@csstools/css-parser-algorithms`](https://github.com/csstools/postcss-plugins/tree/main/packages/css-parser-algorithms) to [`2.5.0`](https://github.com/csstools/postcss-plugins/tree/main/packages/css-parser-algorithms/CHANGELOG.md#250) (minor)
-- Updated [`@csstools/css-color-parser`](https://github.com/csstools/postcss-plugins/tree/main/packages/css-color-parser) to [`1.5.1`](https://github.com/csstools/postcss-plugins/tree/main/packages/css-color-parser/CHANGELOG.md#151) (patch)
+- Updated [`@csstools/css-tokenizer`](https://github.com/csstools/postcss-plugins/tree/main/packages/css-tokenizer) to [`2.3.1`](https://github.com/csstools/postcss-plugins/tree/main/packages/css-tokenizer/CHANGELOG.md#231) (patch)
+- Updated [`@csstools/css-parser-algorithms`](https://github.com/csstools/postcss-plugins/tree/main/packages/css-parser-algorithms) to [`2.6.3`](https://github.com/csstools/postcss-plugins/tree/main/packages/css-parser-algorithms/CHANGELOG.md#263) (patch)
+- Updated [`@csstools/css-color-parser`](https://github.com/csstools/postcss-plugins/tree/main/packages/css-color-parser) to [`2.0.2`](https://github.com/csstools/postcss-plugins/tree/main/packages/css-color-parser/CHANGELOG.md#202) (patch)
-### 3.0.8
+### 3.0.15
-_December 15, 2023_
+_May 4, 2024_
-- Skip transforms when a color value contains experimental syntax
-- Updated [`@csstools/css-tokenizer`](https://github.com/csstools/postcss-plugins/tree/main/packages/css-tokenizer) to [`2.2.2`](https://github.com/csstools/postcss-plugins/tree/main/packages/css-tokenizer/CHANGELOG.md#222) (patch)
-- Updated [`@csstools/css-parser-algorithms`](https://github.com/csstools/postcss-plugins/tree/main/packages/css-parser-algorithms) to [`2.4.0`](https://github.com/csstools/postcss-plugins/tree/main/packages/css-parser-algorithms/CHANGELOG.md#240) (minor)
-- Updated [`@csstools/postcss-progressive-custom-properties`](https://github.com/csstools/postcss-plugins/tree/main/plugins/postcss-progressive-custom-properties) to [`3.0.3`](https://github.com/csstools/postcss-plugins/tree/main/plugins/postcss-progressive-custom-properties/CHANGELOG.md#303) (patch)
-- Updated [`@csstools/css-color-parser`](https://github.com/csstools/postcss-plugins/tree/main/packages/css-color-parser) to [`1.5.0`](https://github.com/csstools/postcss-plugins/tree/main/packages/css-color-parser/CHANGELOG.md#150) (minor)
+- Updated [`@csstools/css-tokenizer`](https://github.com/csstools/postcss-plugins/tree/main/packages/css-tokenizer) to [`2.3.0`](https://github.com/csstools/postcss-plugins/tree/main/packages/css-tokenizer/CHANGELOG.md#230) (minor)
+- Updated [`@csstools/css-parser-algorithms`](https://github.com/csstools/postcss-plugins/tree/main/packages/css-parser-algorithms) to [`2.6.2`](https://github.com/csstools/postcss-plugins/tree/main/packages/css-parser-algorithms/CHANGELOG.md#262) (patch)
+- Updated [`@csstools/css-color-parser`](https://github.com/csstools/postcss-plugins/tree/main/packages/css-color-parser) to [`2.0.1`](https://github.com/csstools/postcss-plugins/tree/main/packages/css-color-parser/CHANGELOG.md#201) (patch)
-### 3.0.7
+### 3.0.14
-_October 9, 2023_
+_April 21, 2024_
-- Updated [`@csstools/css-color-parser`](https://github.com/csstools/postcss-plugins/tree/main/packages/css-color-parser) to [`1.4.0`](https://github.com/csstools/postcss-plugins/tree/main/packages/css-color-parser/CHANGELOG.md#140) (minor)
-- Updated [`@csstools/postcss-progressive-custom-properties`](https://github.com/csstools/postcss-plugins/tree/main/plugins/postcss-progressive-custom-properties) to [`3.0.2`](https://github.com/csstools/postcss-plugins/tree/main/plugins/postcss-progressive-custom-properties/CHANGELOG.md#302) (patch)
+- Updated [`@csstools/css-color-parser`](https://github.com/csstools/postcss-plugins/tree/main/packages/css-color-parser) to [`2.0.0`](https://github.com/csstools/postcss-plugins/tree/main/packages/css-color-parser/CHANGELOG.md#200) (major)
[Full CHANGELOG](https://github.com/csstools/postcss-plugins/tree/main/plugins/postcss-oklab-function/CHANGELOG.md)
diff --git a/node_modules/@csstools/postcss-oklab-function/dist/index.cjs b/node_modules/@csstools/postcss-oklab-function/dist/index.cjs
index bf1fe995..b9e0e8aa 100644
--- a/node_modules/@csstools/postcss-oklab-function/dist/index.cjs
+++ b/node_modules/@csstools/postcss-oklab-function/dist/index.cjs
@@ -1 +1 @@
-"use strict";var e=require("@csstools/postcss-progressive-custom-properties"),s=require("@csstools/css-tokenizer"),t=require("@csstools/css-color-parser"),r=require("@csstools/css-parser-algorithms");function hasFallback(e){const s=e.parent;if(!s)return!1;const t=e.prop.toLowerCase(),r=s.index(e);for(let e=0;e<r;e++){const r=s.nodes[e];if("decl"===r.type&&r.prop.toLowerCase()===t)return!0}return!1}function hasSupportsAtRuleAncestor(e){let s=e.parent;for(;s;)if("atrule"===s.type){if("supports"===s.name.toLowerCase()){if(-1!==s.params.toLowerCase().indexOf("oklab("))return!0;if(-1!==s.params.toLowerCase().indexOf("oklch("))return!0}s=s.parent}else s=s.parent;return!1}const a=/(oklab|oklch)\(/i,o=/^(oklab|oklch)$/i,basePlugin=e=>({postcssPlugin:"postcss-oklab-function",Declaration:n=>{const l=n.value;if(!a.test(l))return;if(hasFallback(n))return;if(hasSupportsAtRuleAncestor(n))return;const i=s.tokenize({css:l}),u=r.replaceComponentValues(r.parseCommaSeparatedListOfComponentValues(i),(e=>{if(!r.isFunctionNode(e)||!o.test(e.getName()))return;const s=t.color(e);return s&&!(s.syntaxFlags.has(t.SyntaxFlag.Experimental)||s.syntaxFlags.has(t.SyntaxFlag.HasNoneKeywords)||s.syntaxFlags.has(t.SyntaxFlag.RelativeColorSyntax))?t.serializeRGB(s):void 0})),p=r.stringify(u);if(p===l)return;let c=p;e?.subFeatures.displayP3&&(c=r.stringify(r.replaceComponentValues(r.parseCommaSeparatedListOfComponentValues(i),(e=>{if(!r.isFunctionNode(e)||!o.test(e.getName()))return;const s=t.color(e);return s&&!(s.syntaxFlags.has(t.SyntaxFlag.Experimental)||s.syntaxFlags.has(t.SyntaxFlag.HasNoneKeywords)||s.syntaxFlags.has(t.SyntaxFlag.RelativeColorSyntax))?t.colorDataFitsRGB_Gamut(s)?t.serializeRGB(s):t.serializeP3(s):void 0})))),n.cloneBefore({value:p}),e?.subFeatures.displayP3&&c!==p&&n.cloneBefore({value:c}),e?.preserve||n.remove()}});basePlugin.postcss=!0;const postcssPlugin=s=>{const t=Object.assign({enableProgressiveCustomProperties:!0,preserve:!1,subFeatures:{displayP3:!0}},s);return t.subFeatures=Object.assign({displayP3:!0},t.subFeatures),t.enableProgressiveCustomProperties&&(t.preserve||t.subFeatures.displayP3)?{postcssPlugin:"postcss-oklab-function",plugins:[e(),basePlugin(t)]}:basePlugin(t)};postcssPlugin.postcss=!0,module.exports=postcssPlugin;
+"use strict";var s=require("@csstools/postcss-progressive-custom-properties"),e=require("@csstools/css-color-parser"),t=require("@csstools/utilities"),a=require("@csstools/css-parser-algorithms"),r=require("@csstools/css-tokenizer");const o=/\b(?:oklab|oklch)\(/i,l=/^(?:oklab|oklch)$/i,basePlugin=s=>({postcssPlugin:"postcss-oklab-function",Declaration(n){const i=n.value;if(!o.test(i))return;if(t.hasFallback(n))return;if(t.hasSupportsAtRuleAncestor(n,o))return;const u=r.tokenize({css:i}),c=a.replaceComponentValues(a.parseCommaSeparatedListOfComponentValues(u),(s=>{if(!a.isFunctionNode(s)||!l.test(s.getName()))return;const t=e.color(s);return t&&!(t.syntaxFlags.has(e.SyntaxFlag.Experimental)||t.syntaxFlags.has(e.SyntaxFlag.HasNoneKeywords)||t.syntaxFlags.has(e.SyntaxFlag.RelativeColorSyntax))?e.serializeRGB(t):void 0})),p=a.stringify(c);if(p===i)return;let g=p;s?.subFeatures.displayP3&&(g=a.stringify(a.replaceComponentValues(a.parseCommaSeparatedListOfComponentValues(u),(s=>{if(!a.isFunctionNode(s)||!l.test(s.getName()))return;const t=e.color(s);return t&&!(t.syntaxFlags.has(e.SyntaxFlag.Experimental)||t.syntaxFlags.has(e.SyntaxFlag.HasNoneKeywords)||t.syntaxFlags.has(e.SyntaxFlag.RelativeColorSyntax))?e.colorDataFitsRGB_Gamut(t)?e.serializeRGB(t):e.serializeP3(t):void 0})))),n.cloneBefore({value:p}),s?.subFeatures.displayP3&&g!==p&&n.cloneBefore({value:g}),s?.preserve||n.remove()}});basePlugin.postcss=!0;const postcssPlugin=e=>{const t=Object.assign({enableProgressiveCustomProperties:!0,preserve:!1,subFeatures:{displayP3:!0}},e);return t.subFeatures=Object.assign({displayP3:!0},t.subFeatures),t.enableProgressiveCustomProperties&&(t.preserve||t.subFeatures.displayP3)?{postcssPlugin:"postcss-oklab-function",plugins:[s(),basePlugin(t)]}:basePlugin(t)};postcssPlugin.postcss=!0,module.exports=postcssPlugin;
diff --git a/node_modules/@csstools/postcss-oklab-function/dist/index.mjs b/node_modules/@csstools/postcss-oklab-function/dist/index.mjs
index 935e4ebe..faf62c39 100644
--- a/node_modules/@csstools/postcss-oklab-function/dist/index.mjs
+++ b/node_modules/@csstools/postcss-oklab-function/dist/index.mjs
@@ -1 +1 @@
-import s from"@csstools/postcss-progressive-custom-properties";import{tokenize as e}from"@csstools/css-tokenizer";import{color as t,SyntaxFlag as r,serializeRGB as o,colorDataFitsRGB_Gamut as a,serializeP3 as n}from"@csstools/css-color-parser";import{replaceComponentValues as l,parseCommaSeparatedListOfComponentValues as i,isFunctionNode as p,stringify as u}from"@csstools/css-parser-algorithms";function hasFallback(s){const e=s.parent;if(!e)return!1;const t=s.prop.toLowerCase(),r=e.index(s);for(let s=0;s<r;s++){const r=e.nodes[s];if("decl"===r.type&&r.prop.toLowerCase()===t)return!0}return!1}function hasSupportsAtRuleAncestor(s){let e=s.parent;for(;e;)if("atrule"===e.type){if("supports"===e.name.toLowerCase()){if(-1!==e.params.toLowerCase().indexOf("oklab("))return!0;if(-1!==e.params.toLowerCase().indexOf("oklch("))return!0}e=e.parent}else e=e.parent;return!1}const c=/(oklab|oklch)\(/i,f=/^(oklab|oklch)$/i,basePlugin=s=>({postcssPlugin:"postcss-oklab-function",Declaration:m=>{const b=m.value;if(!c.test(b))return;if(hasFallback(m))return;if(hasSupportsAtRuleAncestor(m))return;const g=e({css:b}),y=l(i(g),(s=>{if(!p(s)||!f.test(s.getName()))return;const e=t(s);return e&&!(e.syntaxFlags.has(r.Experimental)||e.syntaxFlags.has(r.HasNoneKeywords)||e.syntaxFlags.has(r.RelativeColorSyntax))?o(e):void 0})),d=u(y);if(d===b)return;let h=d;s?.subFeatures.displayP3&&(h=u(l(i(g),(s=>{if(!p(s)||!f.test(s.getName()))return;const e=t(s);return e&&!(e.syntaxFlags.has(r.Experimental)||e.syntaxFlags.has(r.HasNoneKeywords)||e.syntaxFlags.has(r.RelativeColorSyntax))?a(e)?o(e):n(e):void 0})))),m.cloneBefore({value:d}),s?.subFeatures.displayP3&&h!==d&&m.cloneBefore({value:h}),s?.preserve||m.remove()}});basePlugin.postcss=!0;const postcssPlugin=e=>{const t=Object.assign({enableProgressiveCustomProperties:!0,preserve:!1,subFeatures:{displayP3:!0}},e);return t.subFeatures=Object.assign({displayP3:!0},t.subFeatures),t.enableProgressiveCustomProperties&&(t.preserve||t.subFeatures.displayP3)?{postcssPlugin:"postcss-oklab-function",plugins:[s(),basePlugin(t)]}:basePlugin(t)};postcssPlugin.postcss=!0;export{postcssPlugin as default};
+import s from"@csstools/postcss-progressive-custom-properties";import{color as e,SyntaxFlag as t,serializeRGB as o,colorDataFitsRGB_Gamut as r,serializeP3 as a}from"@csstools/css-color-parser";import{hasFallback as l,hasSupportsAtRuleAncestor as i}from"@csstools/utilities";import{replaceComponentValues as n,parseCommaSeparatedListOfComponentValues as c,isFunctionNode as u,stringify as p}from"@csstools/css-parser-algorithms";import{tokenize as m}from"@csstools/css-tokenizer";const g=/\b(?:oklab|oklch)\(/i,f=/^(?:oklab|oklch)$/i,basePlugin=s=>({postcssPlugin:"postcss-oklab-function",Declaration(b){const y=b.value;if(!g.test(y))return;if(l(b))return;if(i(b,g))return;const v=m({css:y}),F=n(c(v),(s=>{if(!u(s)||!f.test(s.getName()))return;const r=e(s);return r&&!(r.syntaxFlags.has(t.Experimental)||r.syntaxFlags.has(t.HasNoneKeywords)||r.syntaxFlags.has(t.RelativeColorSyntax))?o(r):void 0})),x=p(F);if(x===y)return;let P=x;s?.subFeatures.displayP3&&(P=p(n(c(v),(s=>{if(!u(s)||!f.test(s.getName()))return;const l=e(s);return l&&!(l.syntaxFlags.has(t.Experimental)||l.syntaxFlags.has(t.HasNoneKeywords)||l.syntaxFlags.has(t.RelativeColorSyntax))?r(l)?o(l):a(l):void 0})))),b.cloneBefore({value:x}),s?.subFeatures.displayP3&&P!==x&&b.cloneBefore({value:P}),s?.preserve||b.remove()}});basePlugin.postcss=!0;const postcssPlugin=e=>{const t=Object.assign({enableProgressiveCustomProperties:!0,preserve:!1,subFeatures:{displayP3:!0}},e);return t.subFeatures=Object.assign({displayP3:!0},t.subFeatures),t.enableProgressiveCustomProperties&&(t.preserve||t.subFeatures.displayP3)?{postcssPlugin:"postcss-oklab-function",plugins:[s(),basePlugin(t)]}:basePlugin(t)};postcssPlugin.postcss=!0;export{postcssPlugin as default};
diff --git a/node_modules/@csstools/postcss-oklab-function/package.json b/node_modules/@csstools/postcss-oklab-function/package.json
index 2d795cad..2dc9e68b 100644
--- a/node_modules/@csstools/postcss-oklab-function/package.json
+++ b/node_modules/@csstools/postcss-oklab-function/package.json
@@ -1,7 +1,7 @@
{
"name": "@csstools/postcss-oklab-function",
"description": "Use oklab() and oklch() color functions in CSS",
- "version": "3.0.9",
+ "version": "3.0.16",
"author": "Jonathan Neal <jonathantneal@hotmail.com>",
"license": "MIT-0",
"funding": [
@@ -38,10 +38,11 @@
"dist"
],
"dependencies": {
- "@csstools/css-color-parser": "^1.5.1",
- "@csstools/css-parser-algorithms": "^2.5.0",
- "@csstools/css-tokenizer": "^2.2.3",
- "@csstools/postcss-progressive-custom-properties": "^3.0.3"
+ "@csstools/css-color-parser": "^2.0.2",
+ "@csstools/css-parser-algorithms": "^2.6.3",
+ "@csstools/css-tokenizer": "^2.3.1",
+ "@csstools/postcss-progressive-custom-properties": "^3.2.0",
+ "@csstools/utilities": "^1.0.0"
},
"peerDependencies": {
"postcss": "^8.4"
@@ -49,7 +50,7 @@
"homepage": "https://github.com/csstools/postcss-plugins/tree/main/plugins/postcss-oklab-function#readme",
"repository": {
"type": "git",
- "url": "https://github.com/csstools/postcss-plugins.git",
+ "url": "git+https://github.com/csstools/postcss-plugins.git",
"directory": "plugins/postcss-oklab-function"
},
"bugs": "https://github.com/csstools/postcss-plugins/issues",
diff --git a/node_modules/@csstools/postcss-progressive-custom-properties/CHANGELOG.md b/node_modules/@csstools/postcss-progressive-custom-properties/CHANGELOG.md
index b7a01fef..140f9e7f 100644
--- a/node_modules/@csstools/postcss-progressive-custom-properties/CHANGELOG.md
+++ b/node_modules/@csstools/postcss-progressive-custom-properties/CHANGELOG.md
@@ -1,23 +1,22 @@
# Changes to PostCSS Progressive Custom Properties
-### 3.0.3
+### 3.2.0
-_December 15, 2023_
+_March 31, 2024_
-- Fix type definitions
+- Add matching rules for `contrast-color`
-### 3.0.2
+### 3.1.1
-_October 9, 2023_
+_March 13, 2024_
-- Add support for css nesting
-- Improve grouping of `@supports` rules
-- Reduce the size of the generated `@supports` rules for values that contain `var()`
+- Test for mixed component types in color values (e.g. `lab(100 50% 50)`)
+- Allow relative color syntax in `rgba` and `hsla` color notations.
-### 3.0.1
+### 3.1.0
-_September 18, 2023_
+_February 19, 2024_
-- Improve performance
+- Add matching rules for `light-dark`
[Full CHANGELOG](https://github.com/csstools/postcss-plugins/tree/main/plugins/postcss-progressive-custom-properties/CHANGELOG.md)
diff --git a/node_modules/@csstools/postcss-progressive-custom-properties/dist/index.cjs b/node_modules/@csstools/postcss-progressive-custom-properties/dist/index.cjs
index 550926ab..dfa8b191 100644
--- a/node_modules/@csstools/postcss-progressive-custom-properties/dist/index.cjs
+++ b/node_modules/@csstools/postcss-progressive-custom-properties/dist/index.cjs
@@ -1 +1 @@
-"use strict";var e=require("postcss-value-parser");const a=["at","bottom","center","circle","closest-corner","closest-side","ellipse","farthest-corner","farthest-side","from","in","left","right","to","top"];function doublePositionGradients(e){const r=[],p=e.value.toLowerCase();if("function"===e.type&&("conic-gradient"===p||"linear-gradient"===p||"radial-gradient"===p||"repeating-conic-gradient"===p||"repeating-linear-gradient"===p||"repeating-radial-gradient"===p)){let p=0,t=!1,i=!1;e:for(let o=0;o<e.nodes.length;o++){const s=e.nodes[o];if("word"===s.type&&a.includes(s.value.toLowerCase())&&(t=!0),"div"!==s.type||","!==s.value.trim())if("word"!==s.type||"in"!==s.value.toLowerCase()){if("word"!==s.type&&"function"!==s.type||p++,i)switch(e.value.toLowerCase()){case"conic-gradient":r.push("(background: conic-gradient(in oklch, red 0deg, red 0deg 1deg, red 2deg))");break e;case"linear-gradient":r.push("(background: linear-gradient(in oklch, red 0%, red 0% 1%, red 2%))");break e;case"radial-gradient":r.push("(background: radial-gradient(in oklch, red, red 1px 2px, red 3px))");break e;case"repeating-conic-gradient":r.push("(background: repeating-conic-gradient(in oklch from 0deg, red 0deg, red 0deg 1deg, red 2deg))");break e;case"repeating-linear-gradient":r.push("(background: repeating-linear-gradient(in oklch, red 0%, red 0% 1%, red 2%))");break e;case"repeating-radial-gradient":r.push("(background: repeating-radial-gradient(in oklch, red, red 1px 2px, red 3px))");break e}if(!t&&3===p)switch(e.value.toLowerCase()){case"conic-gradient":r.push("(background: conic-gradient(red 0deg, red 0deg 1deg, red 2deg))");break e;case"linear-gradient":r.push("(background: linear-gradient(red 0%, red 0% 1%, red 2%))");break e;case"radial-gradient":r.push("(background: radial-gradient(red, red 1px 2px, red 3px))");break e;case"repeating-conic-gradient":r.push("(background: repeating-conic-gradient(from 0deg, red 0deg, red 0deg 1deg, red 2deg))");break e;case"repeating-linear-gradient":r.push("(background: repeating-linear-gradient(red 0%, red 0% 1%, red 2%))");break e;case"repeating-radial-gradient":r.push("(background: repeating-radial-gradient(red, red 1px 2px, red 3px))");break e}}else i=!0;else p=0,t=!1}}return r}const r=[{supports:"color-mix(in lch, red, blue)",property:"color",sniff:"color-mix",matchers:[{type:"function",value:"color-mix",nodes:[{type:"word",value:"in"},{type:"space"},{type:"word",isVariable:!0},{type:"div",value:","},{type:"word",isVariable:!0},{type:"div",value:","},{type:"word",isVariable:!0}]},{type:"function",value:"color-mix",nodes:[{type:"word",value:"in"},{type:"space"},{type:"word",isVariable:!0},{type:"div",value:","},{type:"word",isVariable:!0},{type:"space"},{type:"word",isVariable:!0},{type:"div",value:","},{type:"word",isVariable:!0}]},{type:"function",value:"color-mix",nodes:[{type:"word",value:"in"},{type:"space"},{type:"word",isVariable:!0},{type:"div",value:","},{type:"word",isVariable:!0},{type:"div",value:","},{type:"word",isVariable:!0},{type:"space"},{type:"word",isVariable:!0}]},{type:"function",value:"color-mix",nodes:[{type:"word",value:"in"},{type:"space"},{type:"word",isVariable:!0},{type:"div",value:","},{type:"word",isVariable:!0},{type:"space"},{type:"word",isVariable:!0},{type:"div",value:","},{type:"word",isVariable:!0},{type:"space"},{type:"word",isVariable:!0}]},{type:"function",value:"color-mix",nodes:[{type:"word",value:"in"},{type:"space"},{type:"word",isVariable:!0},{type:"space"},{type:"word",isVariable:!0},{type:"div",value:","},{type:"word",isVariable:!0},{type:"div",value:","},{type:"word",isVariable:!0}]},{type:"function",value:"color-mix",nodes:[{type:"word",value:"in"},{type:"space"},{type:"word",isVariable:!0},{type:"space"},{type:"word",isVariable:!0},{type:"div",value:","},{type:"word",isVariable:!0},{type:"space"},{type:"word",isVariable:!0},{type:"div",value:","},{type:"word",isVariable:!0}]},{type:"function",value:"color-mix",nodes:[{type:"word",value:"in"},{type:"space"},{type:"word",isVariable:!0},{type:"space"},{type:"word",isVariable:!0},{type:"div",value:","},{type:"word",isVariable:!0},{type:"div",value:","},{type:"word",isVariable:!0},{type:"space"},{type:"word",isVariable:!0}]},{type:"function",value:"color-mix",nodes:[{type:"word",value:"in"},{type:"space"},{type:"word",isVariable:!0},{type:"space"},{type:"word",isVariable:!0},{type:"div",value:","},{type:"word",isVariable:!0},{type:"space"},{type:"word",isVariable:!0},{type:"div",value:","},{type:"word",isVariable:!0},{type:"space"},{type:"word",isVariable:!0}]}]},{supports:"rgb(from red r g b)",property:"color",sniff:"from ",matchers:[{type:"function",value:"rgb",nodes:[{type:"word",value:"from"},{type:"space"},{type:"word",isVariable:!0},{type:"space"},{type:"word",isVariable:!0},{type:"space"},{type:"word",isVariable:!0},{type:"space"},{type:"word",isVariable:!0}]},{type:"function",value:"rgb",nodes:[{type:"word",value:"from"},{type:"space"},{type:"word",isVariable:!0},{type:"space"},{type:"word",isVariable:!0},{type:"space"},{type:"word",isVariable:!0},{type:"space"},{type:"word",isVariable:!0},{type:"div",value:"/"},{type:"word",isVariable:!0}]},{type:"function",value:"hsl",nodes:[{type:"word",value:"from"},{type:"space"},{type:"word",isVariable:!0},{type:"space"},{type:"word",isVariable:!0},{type:"space"},{type:"word",isVariable:!0},{type:"space"},{type:"word",isVariable:!0}]},{type:"function",value:"hsl",nodes:[{type:"word",value:"from"},{type:"space"},{type:"word",isVariable:!0},{type:"space"},{type:"word",isVariable:!0},{type:"space"},{type:"word",isVariable:!0},{type:"space"},{type:"word",isVariable:!0},{type:"div",value:"/"},{type:"word",isVariable:!0}]},{type:"function",value:"hwb",nodes:[{type:"word",value:"from"},{type:"space"},{type:"word",isVariable:!0},{type:"space"},{type:"word",isVariable:!0},{type:"space"},{type:"word",isVariable:!0},{type:"space"},{type:"word",isVariable:!0}]},{type:"function",value:"hwb",nodes:[{type:"word",value:"from"},{type:"space"},{type:"word",isVariable:!0},{type:"space"},{type:"word",isVariable:!0},{type:"space"},{type:"word",isVariable:!0},{type:"space"},{type:"word",isVariable:!0},{type:"div",value:"/"},{type:"word",isVariable:!0}]},{type:"function",value:"lch",nodes:[{type:"word",value:"from"},{type:"space"},{type:"word",isVariable:!0},{type:"space"},{type:"word",isVariable:!0},{type:"space"},{type:"word",isVariable:!0},{type:"space"},{type:"word",isVariable:!0}]},{type:"function",value:"lch",nodes:[{type:"word",value:"from"},{type:"space"},{type:"word",isVariable:!0},{type:"space"},{type:"word",isVariable:!0},{type:"space"},{type:"word",isVariable:!0},{type:"space"},{type:"word",isVariable:!0},{type:"div",value:"/"},{type:"word",isVariable:!0}]},{type:"function",value:"oklch",nodes:[{type:"word",value:"from"},{type:"space"},{type:"word",isVariable:!0},{type:"space"},{type:"word",isVariable:!0},{type:"space"},{type:"word",isVariable:!0},{type:"space"},{type:"word",isVariable:!0}]},{type:"function",value:"oklch",nodes:[{type:"word",value:"from"},{type:"space"},{type:"word",isVariable:!0},{type:"space"},{type:"word",isVariable:!0},{type:"space"},{type:"word",isVariable:!0},{type:"space"},{type:"word",isVariable:!0},{type:"div",value:"/"},{type:"word",isVariable:!0}]},{type:"function",value:"lab",nodes:[{type:"word",value:"from"},{type:"space"},{type:"word",isVariable:!0},{type:"space"},{type:"word",isVariable:!0},{type:"space"},{type:"word",isVariable:!0},{type:"space"},{type:"word",isVariable:!0}]},{type:"function",value:"lab",nodes:[{type:"word",value:"from"},{type:"space"},{type:"word",isVariable:!0},{type:"space"},{type:"word",isVariable:!0},{type:"space"},{type:"word",isVariable:!0},{type:"space"},{type:"word",isVariable:!0},{type:"div",value:"/"},{type:"word",isVariable:!0}]},{type:"function",value:"oklab",nodes:[{type:"word",value:"from"},{type:"space"},{type:"word",isVariable:!0},{type:"space"},{type:"word",isVariable:!0},{type:"space"},{type:"word",isVariable:!0},{type:"space"},{type:"word",isVariable:!0}]},{type:"function",value:"oklab",nodes:[{type:"word",value:"from"},{type:"space"},{type:"word",isVariable:!0},{type:"space"},{type:"word",isVariable:!0},{type:"space"},{type:"word",isVariable:!0},{type:"space"},{type:"word",isVariable:!0},{type:"div",value:"/"},{type:"word",isVariable:!0}]},{type:"function",value:"color",nodes:[{type:"word",value:"from"},{type:"space"},{type:"word",isVariable:!0},{type:"space"},{type:"word",isVariable:!0},{type:"space"},{type:"word",isVariable:!0},{type:"space"},{type:"word",isVariable:!0},{type:"space"},{type:"word",isVariable:!0}]},{type:"function",value:"color",nodes:[{type:"word",value:"from"},{type:"space"},{type:"word",isVariable:!0},{type:"space"},{type:"word",isVariable:!0},{type:"space"},{type:"word",isVariable:!0},{type:"space"},{type:"word",isVariable:!0},{type:"space"},{type:"word",isVariable:!0},{type:"div",value:"/"},{type:"word",isVariable:!0}]}]},{supports:"color(display-p3 0 0 0)",property:"color",sniff:"color",matchers:[{type:"function",value:"color",nodes:[{type:"word",value:"srgb"},{type:"space"},{type:"word",isVariable:!0},{type:"space"},{type:"word",isVariable:!0},{type:"space"},{type:"word",isVariable:!0}]},{type:"function",value:"color",nodes:[{type:"word",value:"srgb"},{type:"space"},{type:"word",isVariable:!0},{type:"space"},{type:"word",isVariable:!0},{type:"space"},{type:"word",isVariable:!0},{type:"div",value:"/"},{type:"word",isVariable:!0}]}]},{supports:"color(display-p3 0 0 0)",property:"color",sniff:"color",matchers:[{type:"function",value:"color",nodes:[{type:"word",value:"display-p3"},{type:"space"},{type:"word",isVariable:!0},{type:"space"},{type:"word",isVariable:!0},{type:"space"},{type:"word",isVariable:!0}]},{type:"function",value:"color",nodes:[{type:"word",value:"display-p3"},{type:"space"},{type:"word",isVariable:!0},{type:"space"},{type:"word",isVariable:!0},{type:"space"},{type:"word",isVariable:!0},{type:"div",value:"/"},{type:"word",isVariable:!0}]}]},{supports:"color(xyz 0 0 0)",property:"color",sniff:"color",matchers:[{type:"function",value:"color",nodes:[{type:"word",value:"srgb-linear"},{type:"space"},{type:"word",isVariable:!0},{type:"space"},{type:"word",isVariable:!0},{type:"space"},{type:"word",isVariable:!0}]},{type:"function",value:"color",nodes:[{type:"word",value:"srgb-linear"},{type:"space"},{type:"word",isVariable:!0},{type:"space"},{type:"word",isVariable:!0},{type:"space"},{type:"word",isVariable:!0},{type:"div",value:"/"},{type:"word",isVariable:!0}]}]},{supports:"color(xyz 0 0 0)",property:"color",sniff:"color",matchers:[{type:"function",value:"color",nodes:[{type:"word",value:"a98-rgb"},{type:"space"},{type:"word",isVariable:!0},{type:"space"},{type:"word",isVariable:!0},{type:"space"},{type:"word",isVariable:!0}]},{type:"function",value:"color",nodes:[{type:"word",value:"a98-rgb"},{type:"space"},{type:"word",isVariable:!0},{type:"space"},{type:"word",isVariable:!0},{type:"space"},{type:"word",isVariable:!0},{type:"div",value:"/"},{type:"word",isVariable:!0}]}]},{supports:"color(xyz 0 0 0)",property:"color",sniff:"color",matchers:[{type:"function",value:"color",nodes:[{type:"word",value:"prophoto-rgb"},{type:"space"},{type:"word",isVariable:!0},{type:"space"},{type:"word",isVariable:!0},{type:"space"},{type:"word",isVariable:!0}]},{type:"function",value:"color",nodes:[{type:"word",value:"prophoto-rgb"},{type:"space"},{type:"word",isVariable:!0},{type:"space"},{type:"word",isVariable:!0},{type:"space"},{type:"word",isVariable:!0},{type:"div",value:"/"},{type:"word",isVariable:!0}]}]},{supports:"color(xyz 0 0 0)",property:"color",sniff:"color",matchers:[{type:"function",value:"color",nodes:[{type:"word",value:"rec2020"},{type:"space"},{type:"word",isVariable:!0},{type:"space"},{type:"word",isVariable:!0},{type:"space"},{type:"word",isVariable:!0}]},{type:"function",value:"color",nodes:[{type:"word",value:"rec2020"},{type:"space"},{type:"word",isVariable:!0},{type:"space"},{type:"word",isVariable:!0},{type:"space"},{type:"word",isVariable:!0},{type:"div",value:"/"},{type:"word",isVariable:!0}]}]},{supports:"color(xyz 0 0 0)",property:"color",sniff:"color",matchers:[{type:"function",value:"color",nodes:[{type:"word",value:"xyz-d50"},{type:"space"},{type:"word",isVariable:!0},{type:"space"},{type:"word",isVariable:!0},{type:"space"},{type:"word",isVariable:!0}]},{type:"function",value:"color",nodes:[{type:"word",value:"xyz-d50"},{type:"space"},{type:"word",isVariable:!0},{type:"space"},{type:"word",isVariable:!0},{type:"space"},{type:"word",isVariable:!0},{type:"div",value:"/"},{type:"word",isVariable:!0}]}]},{supports:"color(xyz 0 0 0)",property:"color",sniff:"color",matchers:[{type:"function",value:"color",nodes:[{type:"word",value:"xyz-d65"},{type:"space"},{type:"word",isVariable:!0},{type:"space"},{type:"word",isVariable:!0},{type:"space"},{type:"word",isVariable:!0}]},{type:"function",value:"color",nodes:[{type:"word",value:"xyz-d65"},{type:"space"},{type:"word",isVariable:!0},{type:"space"},{type:"word",isVariable:!0},{type:"space"},{type:"word",isVariable:!0},{type:"div",value:"/"},{type:"word",isVariable:!0}]}]},{supports:"color(xyz 0 0 0)",property:"color",sniff:"color",matchers:[{type:"function",value:"color",nodes:[{type:"word",value:"xyz"},{type:"space"},{type:"word",isVariable:!0},{type:"space"},{type:"word",isVariable:!0},{type:"space"},{type:"word",isVariable:!0}]},{type:"function",value:"color",nodes:[{type:"word",value:"xyz"},{type:"space"},{type:"word",isVariable:!0},{type:"space"},{type:"word",isVariable:!0},{type:"space"},{type:"word",isVariable:!0},{type:"div",value:"/"},{type:"word",isVariable:!0}]}]},{supports:"hsl(0, 0%, 0%)",property:"color",sniff:"hsl",matchers:[{type:"function",value:"hsl",nodes:[{type:"word",isVariable:!0},{type:"div",value:","},{type:"word",isVariable:!0},{type:"div",value:","},{type:"word",isVariable:!0},{type:"div",value:","},{type:"word",isVariable:!0}]}]},{supports:"hsl(0 0% 0% / 0)",property:"color",sniff:"hsl",matchers:[{type:"function",value:"hsl",nodes:[{type:"word",isVariable:!0},{type:"space"},{type:"word",isVariable:!0},{type:"space"},{type:"word",isVariable:!0}]},{type:"function",value:"hsl",nodes:[{type:"word",isVariable:!0},{type:"space"},{type:"word",isVariable:!0},{type:"space"},{type:"word",isVariable:!0},{type:"div",value:"/"},{type:"word",isVariable:!0}]}]},{supports:"hsla(0 0% 0% / 0)",property:"color",sniff:"hsla",matchers:[{type:"function",value:"hsla",nodes:[{type:"word",isVariable:!0},{type:"space"},{type:"word",isVariable:!0},{type:"space"},{type:"word",isVariable:!0},{type:"div",value:"/"},{type:"word",isVariable:!0}]}]},{supports:"hwb(0 0% 0%)",property:"color",sniff:"hwb",matchers:[{type:"function",value:"hwb",nodes:[{type:"word",isVariable:!0},{type:"space"},{type:"word",isVariable:!0},{type:"space"},{type:"word",isVariable:!0}]},{type:"function",value:"hwb",nodes:[{type:"word",isVariable:!0},{type:"space"},{type:"word",isVariable:!0},{type:"space"},{type:"word",isVariable:!0},{type:"div",value:"/"},{type:"word",isVariable:!0}]}]},{supports:"lab(0% 0 0)",property:"color",sniff:"lab",matchers:[{type:"function",value:"lab",nodes:[{type:"word",isVariable:!0},{type:"space"},{type:"word",isVariable:!0},{type:"space"},{type:"word",isVariable:!0}]},{type:"function",value:"lab",nodes:[{type:"word",isVariable:!0},{type:"space"},{type:"word",isVariable:!0},{type:"space"},{type:"word",isVariable:!0},{type:"div",value:"/"},{type:"word",isVariable:!0}]}]},{supports:"lab(0% 0 0)",property:"color",sniff:"lch",matchers:[{type:"function",value:"lch",nodes:[{type:"word",isVariable:!0},{type:"space"},{type:"word",isVariable:!0},{type:"space"},{type:"word",isVariable:!0}]},{type:"function",value:"lch",nodes:[{type:"word",isVariable:!0},{type:"space"},{type:"word",isVariable:!0},{type:"space"},{type:"word",isVariable:!0},{type:"div",value:"/"},{type:"word",isVariable:!0}]}]},{supports:"oklab(0% 0 0)",property:"color",sniff:"oklab",matchers:[{type:"function",value:"oklab",nodes:[{type:"word",isVariable:!0},{type:"space"},{type:"word",isVariable:!0},{type:"space"},{type:"word",isVariable:!0}]},{type:"function",value:"oklab",nodes:[{type:"word",isVariable:!0},{type:"space"},{type:"word",isVariable:!0},{type:"space"},{type:"word",isVariable:!0},{type:"div",value:"/"},{type:"word",isVariable:!0}]}]},{supports:"oklab(0% 0 0)",property:"color",sniff:"oklch",matchers:[{type:"function",value:"oklch",nodes:[{type:"word",isVariable:!0},{type:"space"},{type:"word",isVariable:!0},{type:"space"},{type:"word",isVariable:!0}]},{type:"function",value:"oklch",nodes:[{type:"word",isVariable:!0},{type:"space"},{type:"word",isVariable:!0},{type:"space"},{type:"word",isVariable:!0},{type:"div",value:"/"},{type:"word",isVariable:!0}]}]},{supports:"rgb(0, 0, 0, 0)",property:"color",sniff:"rgb",matchers:[{type:"function",value:"rgb",nodes:[{type:"word",isVariable:!0},{type:"div",value:","},{type:"word",isVariable:!0},{type:"div",value:","},{type:"word",isVariable:!0},{type:"div",value:","},{type:"word",isVariable:!0}]}]},{supports:"rgb(0 0 0 / 0)",property:"color",sniff:"rgb",matchers:[{type:"function",value:"rgb",nodes:[{type:"word",isVariable:!0},{type:"space"},{type:"word",isVariable:!0},{type:"space"},{type:"word",isVariable:!0}]},{type:"function",value:"rgb",nodes:[{type:"word",isVariable:!0},{type:"space"},{type:"word",isVariable:!0},{type:"space"},{type:"word",isVariable:!0},{type:"div",value:"/"},{type:"word",isVariable:!0}]}]},{supports:"rgba(0 0 0 / 0)",property:"color",sniff:"rgba",matchers:[{type:"function",value:"rgba",nodes:[{type:"word",isVariable:!0},{type:"space"},{type:"word",isVariable:!0},{type:"space"},{type:"word",isVariable:!0},{type:"div",value:"/"},{type:"word",isVariable:!0}]}]},{supports:"1ic",property:"font-size",sniff:"ic",matchers:[{type:"word",value:"1ic",dimension:{unit:"ic"}}]}];function matches(e,a){if(e.isVariable&&a&&("word"===a.type||"string"===a.type||"function"===a.type))return!0;if(e.type!==a.type)return!1;if(doesNotMatchValue(e,a))return!1;if(e.nodes&&a.nodes){for(let r=0;r<Math.max(e.nodes.length,a.nodes.length);r++){let p=r,t=r;for(;e.nodes[p]&&"space"===e.nodes[p].type;)p++;for(;a.nodes[t]&&"space"===a.nodes[t].type;)t++;if(!!e.nodes[p]!=!!a.nodes[t])return!1;if(!matches(e.nodes[p],a.nodes[t]))return!1}return!0}return!0}function doesNotMatchValue(e,a){return("space"!==e.type||"space"!==a.type||e.value?.trim()!==a.value?.trim())&&(e.dimension&&a.dimension?e.dimension.unit!==a.dimension.unit:"string"===e.type?e.value!==a.value:e.value?.toLowerCase()!==a.value?.toLowerCase())}const p=/^var$/i;function conditionsFromValue(a,t=!1){const i=[],o=r.filter((e=>a.includes(e.sniff)));let s=!1;try{e(a).walk((a=>{"function"===a.type&&p.test(a.value)&&(s=!0);try{const r=e.unit(a.value);!1!==r&&(a.dimension=r)}catch{}for(let e=0;e<o.length;e++){const r=o[e];for(let e=0;e<r.matchers.length;e++){if(matches(r.matchers[e],a))return void i.push(`(${r.property}: ${r.supports})`)}}i.push(...doublePositionGradients(a))}))}catch(e){}return t&&!s?{support:[]}:{support:Array.from(new Set(i)).sort()}}const t=/var\(/i,i=/^initial$/i,o=/^\s*$/,creator=()=>({postcssPlugin:"postcss-progressive-custom-properties",prepare(){const e=new WeakMap;return{OnceExit:(a,{postcss:r})=>{a.walkDecls((a=>{if(!a.parent)return;const p=e.get(a.parent)||{conditionalRules:[],propNames:new Set,lastConditionParams:{support:void 0},lastConditionalRule:void 0};if(e.set(a.parent,p),a.variable){if(!p.propNames.has(a.prop))return void p.propNames.add(a.prop)}else{const e=a.prop.toLowerCase();if(!p.propNames.has(e))return void p.propNames.add(e)}if(!a.variable&&!t.test(a.value))return;if(i.test(a.value))return;if(o.test(a.value))return;const s=!a.variable,l=conditionsFromValue(a.value,s).support.join(" and ");if(!l)return;if(p.lastConditionParams.support!==l&&(p.lastConditionalRule=void 0),p.lastConditionalRule)return p.lastConditionalRule.append(a.clone()),void a.remove();const y=[];if(l&&y.push(r.atRule({name:"supports",params:l,source:a.parent.source,raws:{before:"\n\n",after:"\n"}})),!y.length)return;for(let e=0;e<y.length-1;e++){const a=y[e],r=y[e+1];a.append(r)}const d=y[0],c=y[y.length-1],n=a.parent.clone();n.removeAll(),n.raws.before="\n",n.append(a.clone()),a.remove(),p.lastConditionParams.support=l,p.lastConditionalRule=n,c.append(n),p.conditionalRules.push(d)})),a.walk((a=>{const r=e.get(a);r&&0!==r.conditionalRules.length&&r.conditionalRules.reverse().forEach((e=>{a.after(e)}))}))}}}});creator.postcss=!0,module.exports=creator;
+"use strict";var e=require("postcss-value-parser");const a=["at","bottom","center","circle","closest-corner","closest-side","ellipse","farthest-corner","farthest-side","from","in","left","right","to","top"];function doublePositionGradients(e){const r=[],p=e.value.toLowerCase();if("function"===e.type&&("conic-gradient"===p||"linear-gradient"===p||"radial-gradient"===p||"repeating-conic-gradient"===p||"repeating-linear-gradient"===p||"repeating-radial-gradient"===p)){let p=0,t=!1,i=!1;e:for(let o=0;o<e.nodes.length;o++){const s=e.nodes[o];if("word"===s.type&&a.includes(s.value.toLowerCase())&&(t=!0),"div"!==s.type||","!==s.value.trim())if("word"!==s.type||"in"!==s.value.toLowerCase()){if("word"!==s.type&&"function"!==s.type||p++,i)switch(e.value.toLowerCase()){case"conic-gradient":r.push("(background: conic-gradient(in oklch, red 0deg, red 0deg 1deg, red 2deg))");break e;case"linear-gradient":r.push("(background: linear-gradient(in oklch, red 0%, red 0% 1%, red 2%))");break e;case"radial-gradient":r.push("(background: radial-gradient(in oklch, red, red 1px 2px, red 3px))");break e;case"repeating-conic-gradient":r.push("(background: repeating-conic-gradient(in oklch from 0deg, red 0deg, red 0deg 1deg, red 2deg))");break e;case"repeating-linear-gradient":r.push("(background: repeating-linear-gradient(in oklch, red 0%, red 0% 1%, red 2%))");break e;case"repeating-radial-gradient":r.push("(background: repeating-radial-gradient(in oklch, red, red 1px 2px, red 3px))");break e}if(!t&&3===p)switch(e.value.toLowerCase()){case"conic-gradient":r.push("(background: conic-gradient(red 0deg, red 0deg 1deg, red 2deg))");break e;case"linear-gradient":r.push("(background: linear-gradient(red 0%, red 0% 1%, red 2%))");break e;case"radial-gradient":r.push("(background: radial-gradient(red, red 1px 2px, red 3px))");break e;case"repeating-conic-gradient":r.push("(background: repeating-conic-gradient(from 0deg, red 0deg, red 0deg 1deg, red 2deg))");break e;case"repeating-linear-gradient":r.push("(background: repeating-linear-gradient(red 0%, red 0% 1%, red 2%))");break e;case"repeating-radial-gradient":r.push("(background: repeating-radial-gradient(red, red 1px 2px, red 3px))");break e}}else i=!0;else p=0,t=!1}}return r}const r=[{supports:"color-mix(in lch, red, blue)",property:"color",sniff:"color-mix",matchers:[{type:"function",value:"color-mix",nodes:[{type:"word",value:"in"},{type:"space"},{type:"word",isVariable:!0},{type:"div",value:","},{type:"word",isVariable:!0},{type:"div",value:","},{type:"word",isVariable:!0}]},{type:"function",value:"color-mix",nodes:[{type:"word",value:"in"},{type:"space"},{type:"word",isVariable:!0},{type:"div",value:","},{type:"word",isVariable:!0},{type:"space"},{type:"word",isVariable:!0},{type:"div",value:","},{type:"word",isVariable:!0}]},{type:"function",value:"color-mix",nodes:[{type:"word",value:"in"},{type:"space"},{type:"word",isVariable:!0},{type:"div",value:","},{type:"word",isVariable:!0},{type:"div",value:","},{type:"word",isVariable:!0},{type:"space"},{type:"word",isVariable:!0}]},{type:"function",value:"color-mix",nodes:[{type:"word",value:"in"},{type:"space"},{type:"word",isVariable:!0},{type:"div",value:","},{type:"word",isVariable:!0},{type:"space"},{type:"word",isVariable:!0},{type:"div",value:","},{type:"word",isVariable:!0},{type:"space"},{type:"word",isVariable:!0}]},{type:"function",value:"color-mix",nodes:[{type:"word",value:"in"},{type:"space"},{type:"word",isVariable:!0},{type:"space"},{type:"word",isVariable:!0},{type:"div",value:","},{type:"word",isVariable:!0},{type:"div",value:","},{type:"word",isVariable:!0}]},{type:"function",value:"color-mix",nodes:[{type:"word",value:"in"},{type:"space"},{type:"word",isVariable:!0},{type:"space"},{type:"word",isVariable:!0},{type:"div",value:","},{type:"word",isVariable:!0},{type:"space"},{type:"word",isVariable:!0},{type:"div",value:","},{type:"word",isVariable:!0}]},{type:"function",value:"color-mix",nodes:[{type:"word",value:"in"},{type:"space"},{type:"word",isVariable:!0},{type:"space"},{type:"word",isVariable:!0},{type:"div",value:","},{type:"word",isVariable:!0},{type:"div",value:","},{type:"word",isVariable:!0},{type:"space"},{type:"word",isVariable:!0}]},{type:"function",value:"color-mix",nodes:[{type:"word",value:"in"},{type:"space"},{type:"word",isVariable:!0},{type:"space"},{type:"word",isVariable:!0},{type:"div",value:","},{type:"word",isVariable:!0},{type:"space"},{type:"word",isVariable:!0},{type:"div",value:","},{type:"word",isVariable:!0},{type:"space"},{type:"word",isVariable:!0}]}]},{supports:"lab(from red l 1 1% / calc(alpha + 0.1))",property:"color",sniff:"from ",matchers:[{type:"function",value:"rgb",nodes:[{type:"word",value:"from"},{type:"space"},{type:"word",isVariable:!0},{type:"space"},{type:"word",isVariable:!0},{type:"space"},{type:"word",isVariable:!0},{type:"space"},{type:"word",isVariable:!0}]},{type:"function",value:"rgb",nodes:[{type:"word",value:"from"},{type:"space"},{type:"word",isVariable:!0},{type:"space"},{type:"word",isVariable:!0},{type:"space"},{type:"word",isVariable:!0},{type:"space"},{type:"word",isVariable:!0},{type:"div",value:"/"},{type:"word",isVariable:!0}]},{type:"function",value:"rgba",nodes:[{type:"word",value:"from"},{type:"space"},{type:"word",isVariable:!0},{type:"space"},{type:"word",isVariable:!0},{type:"space"},{type:"word",isVariable:!0},{type:"space"},{type:"word",isVariable:!0}]},{type:"function",value:"rgba",nodes:[{type:"word",value:"from"},{type:"space"},{type:"word",isVariable:!0},{type:"space"},{type:"word",isVariable:!0},{type:"space"},{type:"word",isVariable:!0},{type:"space"},{type:"word",isVariable:!0},{type:"div",value:"/"},{type:"word",isVariable:!0}]},{type:"function",value:"hsl",nodes:[{type:"word",value:"from"},{type:"space"},{type:"word",isVariable:!0},{type:"space"},{type:"word",isVariable:!0},{type:"space"},{type:"word",isVariable:!0},{type:"space"},{type:"word",isVariable:!0}]},{type:"function",value:"hsl",nodes:[{type:"word",value:"from"},{type:"space"},{type:"word",isVariable:!0},{type:"space"},{type:"word",isVariable:!0},{type:"space"},{type:"word",isVariable:!0},{type:"space"},{type:"word",isVariable:!0},{type:"div",value:"/"},{type:"word",isVariable:!0}]},{type:"function",value:"hsla",nodes:[{type:"word",value:"from"},{type:"space"},{type:"word",isVariable:!0},{type:"space"},{type:"word",isVariable:!0},{type:"space"},{type:"word",isVariable:!0},{type:"space"},{type:"word",isVariable:!0}]},{type:"function",value:"hsla",nodes:[{type:"word",value:"from"},{type:"space"},{type:"word",isVariable:!0},{type:"space"},{type:"word",isVariable:!0},{type:"space"},{type:"word",isVariable:!0},{type:"space"},{type:"word",isVariable:!0},{type:"div",value:"/"},{type:"word",isVariable:!0}]},{type:"function",value:"hwb",nodes:[{type:"word",value:"from"},{type:"space"},{type:"word",isVariable:!0},{type:"space"},{type:"word",isVariable:!0},{type:"space"},{type:"word",isVariable:!0},{type:"space"},{type:"word",isVariable:!0}]},{type:"function",value:"hwb",nodes:[{type:"word",value:"from"},{type:"space"},{type:"word",isVariable:!0},{type:"space"},{type:"word",isVariable:!0},{type:"space"},{type:"word",isVariable:!0},{type:"space"},{type:"word",isVariable:!0},{type:"div",value:"/"},{type:"word",isVariable:!0}]},{type:"function",value:"lch",nodes:[{type:"word",value:"from"},{type:"space"},{type:"word",isVariable:!0},{type:"space"},{type:"word",isVariable:!0},{type:"space"},{type:"word",isVariable:!0},{type:"space"},{type:"word",isVariable:!0}]},{type:"function",value:"lch",nodes:[{type:"word",value:"from"},{type:"space"},{type:"word",isVariable:!0},{type:"space"},{type:"word",isVariable:!0},{type:"space"},{type:"word",isVariable:!0},{type:"space"},{type:"word",isVariable:!0},{type:"div",value:"/"},{type:"word",isVariable:!0}]},{type:"function",value:"oklch",nodes:[{type:"word",value:"from"},{type:"space"},{type:"word",isVariable:!0},{type:"space"},{type:"word",isVariable:!0},{type:"space"},{type:"word",isVariable:!0},{type:"space"},{type:"word",isVariable:!0}]},{type:"function",value:"oklch",nodes:[{type:"word",value:"from"},{type:"space"},{type:"word",isVariable:!0},{type:"space"},{type:"word",isVariable:!0},{type:"space"},{type:"word",isVariable:!0},{type:"space"},{type:"word",isVariable:!0},{type:"div",value:"/"},{type:"word",isVariable:!0}]},{type:"function",value:"lab",nodes:[{type:"word",value:"from"},{type:"space"},{type:"word",isVariable:!0},{type:"space"},{type:"word",isVariable:!0},{type:"space"},{type:"word",isVariable:!0},{type:"space"},{type:"word",isVariable:!0}]},{type:"function",value:"lab",nodes:[{type:"word",value:"from"},{type:"space"},{type:"word",isVariable:!0},{type:"space"},{type:"word",isVariable:!0},{type:"space"},{type:"word",isVariable:!0},{type:"space"},{type:"word",isVariable:!0},{type:"div",value:"/"},{type:"word",isVariable:!0}]},{type:"function",value:"oklab",nodes:[{type:"word",value:"from"},{type:"space"},{type:"word",isVariable:!0},{type:"space"},{type:"word",isVariable:!0},{type:"space"},{type:"word",isVariable:!0},{type:"space"},{type:"word",isVariable:!0}]},{type:"function",value:"oklab",nodes:[{type:"word",value:"from"},{type:"space"},{type:"word",isVariable:!0},{type:"space"},{type:"word",isVariable:!0},{type:"space"},{type:"word",isVariable:!0},{type:"space"},{type:"word",isVariable:!0},{type:"div",value:"/"},{type:"word",isVariable:!0}]},{type:"function",value:"color",nodes:[{type:"word",value:"from"},{type:"space"},{type:"word",isVariable:!0},{type:"space"},{type:"word",isVariable:!0},{type:"space"},{type:"word",isVariable:!0},{type:"space"},{type:"word",isVariable:!0},{type:"space"},{type:"word",isVariable:!0}]},{type:"function",value:"color",nodes:[{type:"word",value:"from"},{type:"space"},{type:"word",isVariable:!0},{type:"space"},{type:"word",isVariable:!0},{type:"space"},{type:"word",isVariable:!0},{type:"space"},{type:"word",isVariable:!0},{type:"space"},{type:"word",isVariable:!0},{type:"div",value:"/"},{type:"word",isVariable:!0}]}]},{supports:"color(display-p3 0 0 0%)",property:"color",sniff:"color",matchers:[{type:"function",value:"color",nodes:[{type:"word",value:"srgb"},{type:"space"},{type:"word",isVariable:!0},{type:"space"},{type:"word",isVariable:!0},{type:"space"},{type:"word",isVariable:!0}]},{type:"function",value:"color",nodes:[{type:"word",value:"srgb"},{type:"space"},{type:"word",isVariable:!0},{type:"space"},{type:"word",isVariable:!0},{type:"space"},{type:"word",isVariable:!0},{type:"div",value:"/"},{type:"word",isVariable:!0}]}]},{supports:"color(display-p3 0 0 0%)",property:"color",sniff:"color",matchers:[{type:"function",value:"color",nodes:[{type:"word",value:"display-p3"},{type:"space"},{type:"word",isVariable:!0},{type:"space"},{type:"word",isVariable:!0},{type:"space"},{type:"word",isVariable:!0}]},{type:"function",value:"color",nodes:[{type:"word",value:"display-p3"},{type:"space"},{type:"word",isVariable:!0},{type:"space"},{type:"word",isVariable:!0},{type:"space"},{type:"word",isVariable:!0},{type:"div",value:"/"},{type:"word",isVariable:!0}]}]},{supports:"color(xyz 0 0 0%)",property:"color",sniff:"color",matchers:[{type:"function",value:"color",nodes:[{type:"word",value:"srgb-linear"},{type:"space"},{type:"word",isVariable:!0},{type:"space"},{type:"word",isVariable:!0},{type:"space"},{type:"word",isVariable:!0}]},{type:"function",value:"color",nodes:[{type:"word",value:"srgb-linear"},{type:"space"},{type:"word",isVariable:!0},{type:"space"},{type:"word",isVariable:!0},{type:"space"},{type:"word",isVariable:!0},{type:"div",value:"/"},{type:"word",isVariable:!0}]}]},{supports:"color(xyz 0 0 0%)",property:"color",sniff:"color",matchers:[{type:"function",value:"color",nodes:[{type:"word",value:"a98-rgb"},{type:"space"},{type:"word",isVariable:!0},{type:"space"},{type:"word",isVariable:!0},{type:"space"},{type:"word",isVariable:!0}]},{type:"function",value:"color",nodes:[{type:"word",value:"a98-rgb"},{type:"space"},{type:"word",isVariable:!0},{type:"space"},{type:"word",isVariable:!0},{type:"space"},{type:"word",isVariable:!0},{type:"div",value:"/"},{type:"word",isVariable:!0}]}]},{supports:"color(xyz 0 0 0%)",property:"color",sniff:"color",matchers:[{type:"function",value:"color",nodes:[{type:"word",value:"prophoto-rgb"},{type:"space"},{type:"word",isVariable:!0},{type:"space"},{type:"word",isVariable:!0},{type:"space"},{type:"word",isVariable:!0}]},{type:"function",value:"color",nodes:[{type:"word",value:"prophoto-rgb"},{type:"space"},{type:"word",isVariable:!0},{type:"space"},{type:"word",isVariable:!0},{type:"space"},{type:"word",isVariable:!0},{type:"div",value:"/"},{type:"word",isVariable:!0}]}]},{supports:"color(xyz 0 0 0%)",property:"color",sniff:"color",matchers:[{type:"function",value:"color",nodes:[{type:"word",value:"rec2020"},{type:"space"},{type:"word",isVariable:!0},{type:"space"},{type:"word",isVariable:!0},{type:"space"},{type:"word",isVariable:!0}]},{type:"function",value:"color",nodes:[{type:"word",value:"rec2020"},{type:"space"},{type:"word",isVariable:!0},{type:"space"},{type:"word",isVariable:!0},{type:"space"},{type:"word",isVariable:!0},{type:"div",value:"/"},{type:"word",isVariable:!0}]}]},{supports:"color(xyz 0 0 0%)",property:"color",sniff:"color",matchers:[{type:"function",value:"color",nodes:[{type:"word",value:"xyz-d50"},{type:"space"},{type:"word",isVariable:!0},{type:"space"},{type:"word",isVariable:!0},{type:"space"},{type:"word",isVariable:!0}]},{type:"function",value:"color",nodes:[{type:"word",value:"xyz-d50"},{type:"space"},{type:"word",isVariable:!0},{type:"space"},{type:"word",isVariable:!0},{type:"space"},{type:"word",isVariable:!0},{type:"div",value:"/"},{type:"word",isVariable:!0}]}]},{supports:"color(xyz 0 0 0%)",property:"color",sniff:"color",matchers:[{type:"function",value:"color",nodes:[{type:"word",value:"xyz-d65"},{type:"space"},{type:"word",isVariable:!0},{type:"space"},{type:"word",isVariable:!0},{type:"space"},{type:"word",isVariable:!0}]},{type:"function",value:"color",nodes:[{type:"word",value:"xyz-d65"},{type:"space"},{type:"word",isVariable:!0},{type:"space"},{type:"word",isVariable:!0},{type:"space"},{type:"word",isVariable:!0},{type:"div",value:"/"},{type:"word",isVariable:!0}]}]},{supports:"color(xyz 0 0 0%)",property:"color",sniff:"color",matchers:[{type:"function",value:"color",nodes:[{type:"word",value:"xyz"},{type:"space"},{type:"word",isVariable:!0},{type:"space"},{type:"word",isVariable:!0},{type:"space"},{type:"word",isVariable:!0}]},{type:"function",value:"color",nodes:[{type:"word",value:"xyz"},{type:"space"},{type:"word",isVariable:!0},{type:"space"},{type:"word",isVariable:!0},{type:"space"},{type:"word",isVariable:!0},{type:"div",value:"/"},{type:"word",isVariable:!0}]}]},{supports:"hsl(0, 0%, 0%)",property:"color",sniff:"hsl",matchers:[{type:"function",value:"hsl",nodes:[{type:"word",isVariable:!0},{type:"div",value:","},{type:"word",isVariable:!0},{type:"div",value:","},{type:"word",isVariable:!0},{type:"div",value:","},{type:"word",isVariable:!0}]}]},{supports:"hsl(0 0% 0% / 0)",property:"color",sniff:"hsl",matchers:[{type:"function",value:"hsl",nodes:[{type:"word",isVariable:!0},{type:"space"},{type:"word",isVariable:!0},{type:"space"},{type:"word",isVariable:!0}]},{type:"function",value:"hsl",nodes:[{type:"word",isVariable:!0},{type:"space"},{type:"word",isVariable:!0},{type:"space"},{type:"word",isVariable:!0},{type:"div",value:"/"},{type:"word",isVariable:!0}]}]},{supports:"hsla(0 0% 0% / 0)",property:"color",sniff:"hsla",matchers:[{type:"function",value:"hsla",nodes:[{type:"word",isVariable:!0},{type:"space"},{type:"word",isVariable:!0},{type:"space"},{type:"word",isVariable:!0},{type:"div",value:"/"},{type:"word",isVariable:!0}]}]},{supports:"hwb(0 0% 0%)",property:"color",sniff:"hwb",matchers:[{type:"function",value:"hwb",nodes:[{type:"word",isVariable:!0},{type:"space"},{type:"word",isVariable:!0},{type:"space"},{type:"word",isVariable:!0}]},{type:"function",value:"hwb",nodes:[{type:"word",isVariable:!0},{type:"space"},{type:"word",isVariable:!0},{type:"space"},{type:"word",isVariable:!0},{type:"div",value:"/"},{type:"word",isVariable:!0}]}]},{supports:"lab(0% 0 0%)",property:"color",sniff:"lab",matchers:[{type:"function",value:"lab",nodes:[{type:"word",isVariable:!0},{type:"space"},{type:"word",isVariable:!0},{type:"space"},{type:"word",isVariable:!0}]},{type:"function",value:"lab",nodes:[{type:"word",isVariable:!0},{type:"space"},{type:"word",isVariable:!0},{type:"space"},{type:"word",isVariable:!0},{type:"div",value:"/"},{type:"word",isVariable:!0}]}]},{supports:"lab(0% 0 0%)",property:"color",sniff:"lch",matchers:[{type:"function",value:"lch",nodes:[{type:"word",isVariable:!0},{type:"space"},{type:"word",isVariable:!0},{type:"space"},{type:"word",isVariable:!0}]},{type:"function",value:"lch",nodes:[{type:"word",isVariable:!0},{type:"space"},{type:"word",isVariable:!0},{type:"space"},{type:"word",isVariable:!0},{type:"div",value:"/"},{type:"word",isVariable:!0}]}]},{supports:"oklab(0% 0 0%)",property:"color",sniff:"oklab",matchers:[{type:"function",value:"oklab",nodes:[{type:"word",isVariable:!0},{type:"space"},{type:"word",isVariable:!0},{type:"space"},{type:"word",isVariable:!0}]},{type:"function",value:"oklab",nodes:[{type:"word",isVariable:!0},{type:"space"},{type:"word",isVariable:!0},{type:"space"},{type:"word",isVariable:!0},{type:"div",value:"/"},{type:"word",isVariable:!0}]}]},{supports:"oklab(0% 0 0%)",property:"color",sniff:"oklch",matchers:[{type:"function",value:"oklch",nodes:[{type:"word",isVariable:!0},{type:"space"},{type:"word",isVariable:!0},{type:"space"},{type:"word",isVariable:!0}]},{type:"function",value:"oklch",nodes:[{type:"word",isVariable:!0},{type:"space"},{type:"word",isVariable:!0},{type:"space"},{type:"word",isVariable:!0},{type:"div",value:"/"},{type:"word",isVariable:!0}]}]},{supports:"rgb(0, 0, 0, 0)",property:"color",sniff:"rgb",matchers:[{type:"function",value:"rgb",nodes:[{type:"word",isVariable:!0},{type:"div",value:","},{type:"word",isVariable:!0},{type:"div",value:","},{type:"word",isVariable:!0},{type:"div",value:","},{type:"word",isVariable:!0}]}]},{supports:"rgb(0 0 0 / 0)",property:"color",sniff:"rgb",matchers:[{type:"function",value:"rgb",nodes:[{type:"word",isVariable:!0},{type:"space"},{type:"word",isVariable:!0},{type:"space"},{type:"word",isVariable:!0}]},{type:"function",value:"rgb",nodes:[{type:"word",isVariable:!0},{type:"space"},{type:"word",isVariable:!0},{type:"space"},{type:"word",isVariable:!0},{type:"div",value:"/"},{type:"word",isVariable:!0}]}]},{supports:"rgba(0 0 0 / 0)",property:"color",sniff:"rgba",matchers:[{type:"function",value:"rgba",nodes:[{type:"word",isVariable:!0},{type:"space"},{type:"word",isVariable:!0},{type:"space"},{type:"word",isVariable:!0},{type:"div",value:"/"},{type:"word",isVariable:!0}]}]},{supports:"light-dark(red, red)",property:"color",sniff:"light-dark",matchers:[{type:"function",value:"light-dark",nodes:[{type:"word",isVariable:!0},{type:"div",value:","},{type:"word",isVariable:!0}]}]},{supports:"contrast-color(red max)",property:"color",sniff:"contrast-color",matchers:[{type:"function",value:"contrast-color",nodes:[{type:"word",isVariable:!0}]},{type:"function",value:"contrast-color",nodes:[{type:"word",isVariable:!0},{type:"space"},{type:"word",isVariable:!0}]}]},{supports:"1ic",property:"font-size",sniff:"ic",matchers:[{type:"word",value:"1ic",dimension:{unit:"ic"}}]}];function matches(e,a){if(e.isVariable&&a&&("word"===a.type||"string"===a.type||"function"===a.type))return!0;if(e.type!==a.type)return!1;if(doesNotMatchValue(e,a))return!1;if(e.nodes&&a.nodes){for(let r=0;r<Math.max(e.nodes.length,a.nodes.length);r++){let p=r,t=r;for(;e.nodes[p]&&"space"===e.nodes[p].type;)p++;for(;a.nodes[t]&&"space"===a.nodes[t].type;)t++;if(!!e.nodes[p]!=!!a.nodes[t])return!1;if(!matches(e.nodes[p],a.nodes[t]))return!1}return!0}return!0}function doesNotMatchValue(e,a){return("space"!==e.type||"space"!==a.type||e.value?.trim()!==a.value?.trim())&&(e.dimension&&a.dimension?e.dimension.unit!==a.dimension.unit:"string"===e.type?e.value!==a.value:e.value?.toLowerCase()!==a.value?.toLowerCase())}const p=/^var$/i;function conditionsFromValue(a,t=!1){const i=[],o=r.filter((e=>a.includes(e.sniff)));let s=!1;try{e(a).walk((a=>{"function"===a.type&&p.test(a.value)&&(s=!0);try{const r=e.unit(a.value);!1!==r&&(a.dimension=r)}catch{}for(let e=0;e<o.length;e++){const r=o[e];for(let e=0;e<r.matchers.length;e++){if(matches(r.matchers[e],a))return void i.push(`(${r.property}: ${r.supports})`)}}i.push(...doublePositionGradients(a))}))}catch(e){}return t&&!s?{support:[]}:{support:Array.from(new Set(i)).sort()}}const t=/var\(/i,i=/^initial$/i,o=/^\s*$/,creator=()=>({postcssPlugin:"postcss-progressive-custom-properties",prepare(){const e=new WeakMap;return{postcssPlugin:"postcss-progressive-custom-properties",OnceExit(a,{postcss:r}){a.walkDecls((a=>{if(!a.parent)return;const p=e.get(a.parent)||{conditionalRules:[],propNames:new Set,lastConditionParams:{support:void 0},lastConditionalRule:void 0};if(e.set(a.parent,p),a.variable){if(!p.propNames.has(a.prop))return void p.propNames.add(a.prop)}else{const e=a.prop.toLowerCase();if(!p.propNames.has(e))return void p.propNames.add(e)}if(!a.variable&&!t.test(a.value))return;if(i.test(a.value))return;if(o.test(a.value))return;const s=!a.variable,l=conditionsFromValue(a.value,s).support.join(" and ");if(!l)return;if(p.lastConditionParams.support!==l&&(p.lastConditionalRule=void 0),p.lastConditionalRule)return p.lastConditionalRule.append(a.clone()),void a.remove();const y=[];if(l&&y.push(r.atRule({name:"supports",params:l,source:a.parent.source,raws:{before:"\n\n",after:"\n"}})),!y.length)return;for(let e=0;e<y.length-1;e++){const a=y[e],r=y[e+1];a.append(r)}const d=y[0],c=y[y.length-1],n=a.parent.clone();n.removeAll(),n.raws.before="\n",n.append(a.clone()),a.remove(),p.lastConditionParams.support=l,p.lastConditionalRule=n,c.append(n),p.conditionalRules.push(d)})),a.walk((a=>{const r=e.get(a);r&&0!==r.conditionalRules.length&&r.conditionalRules.reverse().forEach((e=>{a.after(e)}))}))}}}});creator.postcss=!0,module.exports=creator;
diff --git a/node_modules/@csstools/postcss-progressive-custom-properties/dist/index.mjs b/node_modules/@csstools/postcss-progressive-custom-properties/dist/index.mjs
index 4c343809..f57f664d 100644
--- a/node_modules/@csstools/postcss-progressive-custom-properties/dist/index.mjs
+++ b/node_modules/@csstools/postcss-progressive-custom-properties/dist/index.mjs
@@ -1 +1 @@
-import e from"postcss-value-parser";const a=["at","bottom","center","circle","closest-corner","closest-side","ellipse","farthest-corner","farthest-side","from","in","left","right","to","top"];function doublePositionGradients(e){const r=[],p=e.value.toLowerCase();if("function"===e.type&&("conic-gradient"===p||"linear-gradient"===p||"radial-gradient"===p||"repeating-conic-gradient"===p||"repeating-linear-gradient"===p||"repeating-radial-gradient"===p)){let p=0,t=!1,i=!1;e:for(let o=0;o<e.nodes.length;o++){const s=e.nodes[o];if("word"===s.type&&a.includes(s.value.toLowerCase())&&(t=!0),"div"!==s.type||","!==s.value.trim())if("word"!==s.type||"in"!==s.value.toLowerCase()){if("word"!==s.type&&"function"!==s.type||p++,i)switch(e.value.toLowerCase()){case"conic-gradient":r.push("(background: conic-gradient(in oklch, red 0deg, red 0deg 1deg, red 2deg))");break e;case"linear-gradient":r.push("(background: linear-gradient(in oklch, red 0%, red 0% 1%, red 2%))");break e;case"radial-gradient":r.push("(background: radial-gradient(in oklch, red, red 1px 2px, red 3px))");break e;case"repeating-conic-gradient":r.push("(background: repeating-conic-gradient(in oklch from 0deg, red 0deg, red 0deg 1deg, red 2deg))");break e;case"repeating-linear-gradient":r.push("(background: repeating-linear-gradient(in oklch, red 0%, red 0% 1%, red 2%))");break e;case"repeating-radial-gradient":r.push("(background: repeating-radial-gradient(in oklch, red, red 1px 2px, red 3px))");break e}if(!t&&3===p)switch(e.value.toLowerCase()){case"conic-gradient":r.push("(background: conic-gradient(red 0deg, red 0deg 1deg, red 2deg))");break e;case"linear-gradient":r.push("(background: linear-gradient(red 0%, red 0% 1%, red 2%))");break e;case"radial-gradient":r.push("(background: radial-gradient(red, red 1px 2px, red 3px))");break e;case"repeating-conic-gradient":r.push("(background: repeating-conic-gradient(from 0deg, red 0deg, red 0deg 1deg, red 2deg))");break e;case"repeating-linear-gradient":r.push("(background: repeating-linear-gradient(red 0%, red 0% 1%, red 2%))");break e;case"repeating-radial-gradient":r.push("(background: repeating-radial-gradient(red, red 1px 2px, red 3px))");break e}}else i=!0;else p=0,t=!1}}return r}const r=[{supports:"color-mix(in lch, red, blue)",property:"color",sniff:"color-mix",matchers:[{type:"function",value:"color-mix",nodes:[{type:"word",value:"in"},{type:"space"},{type:"word",isVariable:!0},{type:"div",value:","},{type:"word",isVariable:!0},{type:"div",value:","},{type:"word",isVariable:!0}]},{type:"function",value:"color-mix",nodes:[{type:"word",value:"in"},{type:"space"},{type:"word",isVariable:!0},{type:"div",value:","},{type:"word",isVariable:!0},{type:"space"},{type:"word",isVariable:!0},{type:"div",value:","},{type:"word",isVariable:!0}]},{type:"function",value:"color-mix",nodes:[{type:"word",value:"in"},{type:"space"},{type:"word",isVariable:!0},{type:"div",value:","},{type:"word",isVariable:!0},{type:"div",value:","},{type:"word",isVariable:!0},{type:"space"},{type:"word",isVariable:!0}]},{type:"function",value:"color-mix",nodes:[{type:"word",value:"in"},{type:"space"},{type:"word",isVariable:!0},{type:"div",value:","},{type:"word",isVariable:!0},{type:"space"},{type:"word",isVariable:!0},{type:"div",value:","},{type:"word",isVariable:!0},{type:"space"},{type:"word",isVariable:!0}]},{type:"function",value:"color-mix",nodes:[{type:"word",value:"in"},{type:"space"},{type:"word",isVariable:!0},{type:"space"},{type:"word",isVariable:!0},{type:"div",value:","},{type:"word",isVariable:!0},{type:"div",value:","},{type:"word",isVariable:!0}]},{type:"function",value:"color-mix",nodes:[{type:"word",value:"in"},{type:"space"},{type:"word",isVariable:!0},{type:"space"},{type:"word",isVariable:!0},{type:"div",value:","},{type:"word",isVariable:!0},{type:"space"},{type:"word",isVariable:!0},{type:"div",value:","},{type:"word",isVariable:!0}]},{type:"function",value:"color-mix",nodes:[{type:"word",value:"in"},{type:"space"},{type:"word",isVariable:!0},{type:"space"},{type:"word",isVariable:!0},{type:"div",value:","},{type:"word",isVariable:!0},{type:"div",value:","},{type:"word",isVariable:!0},{type:"space"},{type:"word",isVariable:!0}]},{type:"function",value:"color-mix",nodes:[{type:"word",value:"in"},{type:"space"},{type:"word",isVariable:!0},{type:"space"},{type:"word",isVariable:!0},{type:"div",value:","},{type:"word",isVariable:!0},{type:"space"},{type:"word",isVariable:!0},{type:"div",value:","},{type:"word",isVariable:!0},{type:"space"},{type:"word",isVariable:!0}]}]},{supports:"rgb(from red r g b)",property:"color",sniff:"from ",matchers:[{type:"function",value:"rgb",nodes:[{type:"word",value:"from"},{type:"space"},{type:"word",isVariable:!0},{type:"space"},{type:"word",isVariable:!0},{type:"space"},{type:"word",isVariable:!0},{type:"space"},{type:"word",isVariable:!0}]},{type:"function",value:"rgb",nodes:[{type:"word",value:"from"},{type:"space"},{type:"word",isVariable:!0},{type:"space"},{type:"word",isVariable:!0},{type:"space"},{type:"word",isVariable:!0},{type:"space"},{type:"word",isVariable:!0},{type:"div",value:"/"},{type:"word",isVariable:!0}]},{type:"function",value:"hsl",nodes:[{type:"word",value:"from"},{type:"space"},{type:"word",isVariable:!0},{type:"space"},{type:"word",isVariable:!0},{type:"space"},{type:"word",isVariable:!0},{type:"space"},{type:"word",isVariable:!0}]},{type:"function",value:"hsl",nodes:[{type:"word",value:"from"},{type:"space"},{type:"word",isVariable:!0},{type:"space"},{type:"word",isVariable:!0},{type:"space"},{type:"word",isVariable:!0},{type:"space"},{type:"word",isVariable:!0},{type:"div",value:"/"},{type:"word",isVariable:!0}]},{type:"function",value:"hwb",nodes:[{type:"word",value:"from"},{type:"space"},{type:"word",isVariable:!0},{type:"space"},{type:"word",isVariable:!0},{type:"space"},{type:"word",isVariable:!0},{type:"space"},{type:"word",isVariable:!0}]},{type:"function",value:"hwb",nodes:[{type:"word",value:"from"},{type:"space"},{type:"word",isVariable:!0},{type:"space"},{type:"word",isVariable:!0},{type:"space"},{type:"word",isVariable:!0},{type:"space"},{type:"word",isVariable:!0},{type:"div",value:"/"},{type:"word",isVariable:!0}]},{type:"function",value:"lch",nodes:[{type:"word",value:"from"},{type:"space"},{type:"word",isVariable:!0},{type:"space"},{type:"word",isVariable:!0},{type:"space"},{type:"word",isVariable:!0},{type:"space"},{type:"word",isVariable:!0}]},{type:"function",value:"lch",nodes:[{type:"word",value:"from"},{type:"space"},{type:"word",isVariable:!0},{type:"space"},{type:"word",isVariable:!0},{type:"space"},{type:"word",isVariable:!0},{type:"space"},{type:"word",isVariable:!0},{type:"div",value:"/"},{type:"word",isVariable:!0}]},{type:"function",value:"oklch",nodes:[{type:"word",value:"from"},{type:"space"},{type:"word",isVariable:!0},{type:"space"},{type:"word",isVariable:!0},{type:"space"},{type:"word",isVariable:!0},{type:"space"},{type:"word",isVariable:!0}]},{type:"function",value:"oklch",nodes:[{type:"word",value:"from"},{type:"space"},{type:"word",isVariable:!0},{type:"space"},{type:"word",isVariable:!0},{type:"space"},{type:"word",isVariable:!0},{type:"space"},{type:"word",isVariable:!0},{type:"div",value:"/"},{type:"word",isVariable:!0}]},{type:"function",value:"lab",nodes:[{type:"word",value:"from"},{type:"space"},{type:"word",isVariable:!0},{type:"space"},{type:"word",isVariable:!0},{type:"space"},{type:"word",isVariable:!0},{type:"space"},{type:"word",isVariable:!0}]},{type:"function",value:"lab",nodes:[{type:"word",value:"from"},{type:"space"},{type:"word",isVariable:!0},{type:"space"},{type:"word",isVariable:!0},{type:"space"},{type:"word",isVariable:!0},{type:"space"},{type:"word",isVariable:!0},{type:"div",value:"/"},{type:"word",isVariable:!0}]},{type:"function",value:"oklab",nodes:[{type:"word",value:"from"},{type:"space"},{type:"word",isVariable:!0},{type:"space"},{type:"word",isVariable:!0},{type:"space"},{type:"word",isVariable:!0},{type:"space"},{type:"word",isVariable:!0}]},{type:"function",value:"oklab",nodes:[{type:"word",value:"from"},{type:"space"},{type:"word",isVariable:!0},{type:"space"},{type:"word",isVariable:!0},{type:"space"},{type:"word",isVariable:!0},{type:"space"},{type:"word",isVariable:!0},{type:"div",value:"/"},{type:"word",isVariable:!0}]},{type:"function",value:"color",nodes:[{type:"word",value:"from"},{type:"space"},{type:"word",isVariable:!0},{type:"space"},{type:"word",isVariable:!0},{type:"space"},{type:"word",isVariable:!0},{type:"space"},{type:"word",isVariable:!0},{type:"space"},{type:"word",isVariable:!0}]},{type:"function",value:"color",nodes:[{type:"word",value:"from"},{type:"space"},{type:"word",isVariable:!0},{type:"space"},{type:"word",isVariable:!0},{type:"space"},{type:"word",isVariable:!0},{type:"space"},{type:"word",isVariable:!0},{type:"space"},{type:"word",isVariable:!0},{type:"div",value:"/"},{type:"word",isVariable:!0}]}]},{supports:"color(display-p3 0 0 0)",property:"color",sniff:"color",matchers:[{type:"function",value:"color",nodes:[{type:"word",value:"srgb"},{type:"space"},{type:"word",isVariable:!0},{type:"space"},{type:"word",isVariable:!0},{type:"space"},{type:"word",isVariable:!0}]},{type:"function",value:"color",nodes:[{type:"word",value:"srgb"},{type:"space"},{type:"word",isVariable:!0},{type:"space"},{type:"word",isVariable:!0},{type:"space"},{type:"word",isVariable:!0},{type:"div",value:"/"},{type:"word",isVariable:!0}]}]},{supports:"color(display-p3 0 0 0)",property:"color",sniff:"color",matchers:[{type:"function",value:"color",nodes:[{type:"word",value:"display-p3"},{type:"space"},{type:"word",isVariable:!0},{type:"space"},{type:"word",isVariable:!0},{type:"space"},{type:"word",isVariable:!0}]},{type:"function",value:"color",nodes:[{type:"word",value:"display-p3"},{type:"space"},{type:"word",isVariable:!0},{type:"space"},{type:"word",isVariable:!0},{type:"space"},{type:"word",isVariable:!0},{type:"div",value:"/"},{type:"word",isVariable:!0}]}]},{supports:"color(xyz 0 0 0)",property:"color",sniff:"color",matchers:[{type:"function",value:"color",nodes:[{type:"word",value:"srgb-linear"},{type:"space"},{type:"word",isVariable:!0},{type:"space"},{type:"word",isVariable:!0},{type:"space"},{type:"word",isVariable:!0}]},{type:"function",value:"color",nodes:[{type:"word",value:"srgb-linear"},{type:"space"},{type:"word",isVariable:!0},{type:"space"},{type:"word",isVariable:!0},{type:"space"},{type:"word",isVariable:!0},{type:"div",value:"/"},{type:"word",isVariable:!0}]}]},{supports:"color(xyz 0 0 0)",property:"color",sniff:"color",matchers:[{type:"function",value:"color",nodes:[{type:"word",value:"a98-rgb"},{type:"space"},{type:"word",isVariable:!0},{type:"space"},{type:"word",isVariable:!0},{type:"space"},{type:"word",isVariable:!0}]},{type:"function",value:"color",nodes:[{type:"word",value:"a98-rgb"},{type:"space"},{type:"word",isVariable:!0},{type:"space"},{type:"word",isVariable:!0},{type:"space"},{type:"word",isVariable:!0},{type:"div",value:"/"},{type:"word",isVariable:!0}]}]},{supports:"color(xyz 0 0 0)",property:"color",sniff:"color",matchers:[{type:"function",value:"color",nodes:[{type:"word",value:"prophoto-rgb"},{type:"space"},{type:"word",isVariable:!0},{type:"space"},{type:"word",isVariable:!0},{type:"space"},{type:"word",isVariable:!0}]},{type:"function",value:"color",nodes:[{type:"word",value:"prophoto-rgb"},{type:"space"},{type:"word",isVariable:!0},{type:"space"},{type:"word",isVariable:!0},{type:"space"},{type:"word",isVariable:!0},{type:"div",value:"/"},{type:"word",isVariable:!0}]}]},{supports:"color(xyz 0 0 0)",property:"color",sniff:"color",matchers:[{type:"function",value:"color",nodes:[{type:"word",value:"rec2020"},{type:"space"},{type:"word",isVariable:!0},{type:"space"},{type:"word",isVariable:!0},{type:"space"},{type:"word",isVariable:!0}]},{type:"function",value:"color",nodes:[{type:"word",value:"rec2020"},{type:"space"},{type:"word",isVariable:!0},{type:"space"},{type:"word",isVariable:!0},{type:"space"},{type:"word",isVariable:!0},{type:"div",value:"/"},{type:"word",isVariable:!0}]}]},{supports:"color(xyz 0 0 0)",property:"color",sniff:"color",matchers:[{type:"function",value:"color",nodes:[{type:"word",value:"xyz-d50"},{type:"space"},{type:"word",isVariable:!0},{type:"space"},{type:"word",isVariable:!0},{type:"space"},{type:"word",isVariable:!0}]},{type:"function",value:"color",nodes:[{type:"word",value:"xyz-d50"},{type:"space"},{type:"word",isVariable:!0},{type:"space"},{type:"word",isVariable:!0},{type:"space"},{type:"word",isVariable:!0},{type:"div",value:"/"},{type:"word",isVariable:!0}]}]},{supports:"color(xyz 0 0 0)",property:"color",sniff:"color",matchers:[{type:"function",value:"color",nodes:[{type:"word",value:"xyz-d65"},{type:"space"},{type:"word",isVariable:!0},{type:"space"},{type:"word",isVariable:!0},{type:"space"},{type:"word",isVariable:!0}]},{type:"function",value:"color",nodes:[{type:"word",value:"xyz-d65"},{type:"space"},{type:"word",isVariable:!0},{type:"space"},{type:"word",isVariable:!0},{type:"space"},{type:"word",isVariable:!0},{type:"div",value:"/"},{type:"word",isVariable:!0}]}]},{supports:"color(xyz 0 0 0)",property:"color",sniff:"color",matchers:[{type:"function",value:"color",nodes:[{type:"word",value:"xyz"},{type:"space"},{type:"word",isVariable:!0},{type:"space"},{type:"word",isVariable:!0},{type:"space"},{type:"word",isVariable:!0}]},{type:"function",value:"color",nodes:[{type:"word",value:"xyz"},{type:"space"},{type:"word",isVariable:!0},{type:"space"},{type:"word",isVariable:!0},{type:"space"},{type:"word",isVariable:!0},{type:"div",value:"/"},{type:"word",isVariable:!0}]}]},{supports:"hsl(0, 0%, 0%)",property:"color",sniff:"hsl",matchers:[{type:"function",value:"hsl",nodes:[{type:"word",isVariable:!0},{type:"div",value:","},{type:"word",isVariable:!0},{type:"div",value:","},{type:"word",isVariable:!0},{type:"div",value:","},{type:"word",isVariable:!0}]}]},{supports:"hsl(0 0% 0% / 0)",property:"color",sniff:"hsl",matchers:[{type:"function",value:"hsl",nodes:[{type:"word",isVariable:!0},{type:"space"},{type:"word",isVariable:!0},{type:"space"},{type:"word",isVariable:!0}]},{type:"function",value:"hsl",nodes:[{type:"word",isVariable:!0},{type:"space"},{type:"word",isVariable:!0},{type:"space"},{type:"word",isVariable:!0},{type:"div",value:"/"},{type:"word",isVariable:!0}]}]},{supports:"hsla(0 0% 0% / 0)",property:"color",sniff:"hsla",matchers:[{type:"function",value:"hsla",nodes:[{type:"word",isVariable:!0},{type:"space"},{type:"word",isVariable:!0},{type:"space"},{type:"word",isVariable:!0},{type:"div",value:"/"},{type:"word",isVariable:!0}]}]},{supports:"hwb(0 0% 0%)",property:"color",sniff:"hwb",matchers:[{type:"function",value:"hwb",nodes:[{type:"word",isVariable:!0},{type:"space"},{type:"word",isVariable:!0},{type:"space"},{type:"word",isVariable:!0}]},{type:"function",value:"hwb",nodes:[{type:"word",isVariable:!0},{type:"space"},{type:"word",isVariable:!0},{type:"space"},{type:"word",isVariable:!0},{type:"div",value:"/"},{type:"word",isVariable:!0}]}]},{supports:"lab(0% 0 0)",property:"color",sniff:"lab",matchers:[{type:"function",value:"lab",nodes:[{type:"word",isVariable:!0},{type:"space"},{type:"word",isVariable:!0},{type:"space"},{type:"word",isVariable:!0}]},{type:"function",value:"lab",nodes:[{type:"word",isVariable:!0},{type:"space"},{type:"word",isVariable:!0},{type:"space"},{type:"word",isVariable:!0},{type:"div",value:"/"},{type:"word",isVariable:!0}]}]},{supports:"lab(0% 0 0)",property:"color",sniff:"lch",matchers:[{type:"function",value:"lch",nodes:[{type:"word",isVariable:!0},{type:"space"},{type:"word",isVariable:!0},{type:"space"},{type:"word",isVariable:!0}]},{type:"function",value:"lch",nodes:[{type:"word",isVariable:!0},{type:"space"},{type:"word",isVariable:!0},{type:"space"},{type:"word",isVariable:!0},{type:"div",value:"/"},{type:"word",isVariable:!0}]}]},{supports:"oklab(0% 0 0)",property:"color",sniff:"oklab",matchers:[{type:"function",value:"oklab",nodes:[{type:"word",isVariable:!0},{type:"space"},{type:"word",isVariable:!0},{type:"space"},{type:"word",isVariable:!0}]},{type:"function",value:"oklab",nodes:[{type:"word",isVariable:!0},{type:"space"},{type:"word",isVariable:!0},{type:"space"},{type:"word",isVariable:!0},{type:"div",value:"/"},{type:"word",isVariable:!0}]}]},{supports:"oklab(0% 0 0)",property:"color",sniff:"oklch",matchers:[{type:"function",value:"oklch",nodes:[{type:"word",isVariable:!0},{type:"space"},{type:"word",isVariable:!0},{type:"space"},{type:"word",isVariable:!0}]},{type:"function",value:"oklch",nodes:[{type:"word",isVariable:!0},{type:"space"},{type:"word",isVariable:!0},{type:"space"},{type:"word",isVariable:!0},{type:"div",value:"/"},{type:"word",isVariable:!0}]}]},{supports:"rgb(0, 0, 0, 0)",property:"color",sniff:"rgb",matchers:[{type:"function",value:"rgb",nodes:[{type:"word",isVariable:!0},{type:"div",value:","},{type:"word",isVariable:!0},{type:"div",value:","},{type:"word",isVariable:!0},{type:"div",value:","},{type:"word",isVariable:!0}]}]},{supports:"rgb(0 0 0 / 0)",property:"color",sniff:"rgb",matchers:[{type:"function",value:"rgb",nodes:[{type:"word",isVariable:!0},{type:"space"},{type:"word",isVariable:!0},{type:"space"},{type:"word",isVariable:!0}]},{type:"function",value:"rgb",nodes:[{type:"word",isVariable:!0},{type:"space"},{type:"word",isVariable:!0},{type:"space"},{type:"word",isVariable:!0},{type:"div",value:"/"},{type:"word",isVariable:!0}]}]},{supports:"rgba(0 0 0 / 0)",property:"color",sniff:"rgba",matchers:[{type:"function",value:"rgba",nodes:[{type:"word",isVariable:!0},{type:"space"},{type:"word",isVariable:!0},{type:"space"},{type:"word",isVariable:!0},{type:"div",value:"/"},{type:"word",isVariable:!0}]}]},{supports:"1ic",property:"font-size",sniff:"ic",matchers:[{type:"word",value:"1ic",dimension:{unit:"ic"}}]}];function matches(e,a){if(e.isVariable&&a&&("word"===a.type||"string"===a.type||"function"===a.type))return!0;if(e.type!==a.type)return!1;if(doesNotMatchValue(e,a))return!1;if(e.nodes&&a.nodes){for(let r=0;r<Math.max(e.nodes.length,a.nodes.length);r++){let p=r,t=r;for(;e.nodes[p]&&"space"===e.nodes[p].type;)p++;for(;a.nodes[t]&&"space"===a.nodes[t].type;)t++;if(!!e.nodes[p]!=!!a.nodes[t])return!1;if(!matches(e.nodes[p],a.nodes[t]))return!1}return!0}return!0}function doesNotMatchValue(e,a){return("space"!==e.type||"space"!==a.type||e.value?.trim()!==a.value?.trim())&&(e.dimension&&a.dimension?e.dimension.unit!==a.dimension.unit:"string"===e.type?e.value!==a.value:e.value?.toLowerCase()!==a.value?.toLowerCase())}const p=/^var$/i;function conditionsFromValue(a,t=!1){const i=[],o=r.filter((e=>a.includes(e.sniff)));let s=!1;try{e(a).walk((a=>{"function"===a.type&&p.test(a.value)&&(s=!0);try{const r=e.unit(a.value);!1!==r&&(a.dimension=r)}catch{}for(let e=0;e<o.length;e++){const r=o[e];for(let e=0;e<r.matchers.length;e++){if(matches(r.matchers[e],a))return void i.push(`(${r.property}: ${r.supports})`)}}i.push(...doublePositionGradients(a))}))}catch(e){}return t&&!s?{support:[]}:{support:Array.from(new Set(i)).sort()}}const t=/var\(/i,i=/^initial$/i,o=/^\s*$/,creator=()=>({postcssPlugin:"postcss-progressive-custom-properties",prepare(){const e=new WeakMap;return{OnceExit:(a,{postcss:r})=>{a.walkDecls((a=>{if(!a.parent)return;const p=e.get(a.parent)||{conditionalRules:[],propNames:new Set,lastConditionParams:{support:void 0},lastConditionalRule:void 0};if(e.set(a.parent,p),a.variable){if(!p.propNames.has(a.prop))return void p.propNames.add(a.prop)}else{const e=a.prop.toLowerCase();if(!p.propNames.has(e))return void p.propNames.add(e)}if(!a.variable&&!t.test(a.value))return;if(i.test(a.value))return;if(o.test(a.value))return;const s=!a.variable,l=conditionsFromValue(a.value,s).support.join(" and ");if(!l)return;if(p.lastConditionParams.support!==l&&(p.lastConditionalRule=void 0),p.lastConditionalRule)return p.lastConditionalRule.append(a.clone()),void a.remove();const y=[];if(l&&y.push(r.atRule({name:"supports",params:l,source:a.parent.source,raws:{before:"\n\n",after:"\n"}})),!y.length)return;for(let e=0;e<y.length-1;e++){const a=y[e],r=y[e+1];a.append(r)}const d=y[0],c=y[y.length-1],n=a.parent.clone();n.removeAll(),n.raws.before="\n",n.append(a.clone()),a.remove(),p.lastConditionParams.support=l,p.lastConditionalRule=n,c.append(n),p.conditionalRules.push(d)})),a.walk((a=>{const r=e.get(a);r&&0!==r.conditionalRules.length&&r.conditionalRules.reverse().forEach((e=>{a.after(e)}))}))}}}});creator.postcss=!0;export{creator as default};
+import e from"postcss-value-parser";const a=["at","bottom","center","circle","closest-corner","closest-side","ellipse","farthest-corner","farthest-side","from","in","left","right","to","top"];function doublePositionGradients(e){const r=[],p=e.value.toLowerCase();if("function"===e.type&&("conic-gradient"===p||"linear-gradient"===p||"radial-gradient"===p||"repeating-conic-gradient"===p||"repeating-linear-gradient"===p||"repeating-radial-gradient"===p)){let p=0,t=!1,i=!1;e:for(let o=0;o<e.nodes.length;o++){const s=e.nodes[o];if("word"===s.type&&a.includes(s.value.toLowerCase())&&(t=!0),"div"!==s.type||","!==s.value.trim())if("word"!==s.type||"in"!==s.value.toLowerCase()){if("word"!==s.type&&"function"!==s.type||p++,i)switch(e.value.toLowerCase()){case"conic-gradient":r.push("(background: conic-gradient(in oklch, red 0deg, red 0deg 1deg, red 2deg))");break e;case"linear-gradient":r.push("(background: linear-gradient(in oklch, red 0%, red 0% 1%, red 2%))");break e;case"radial-gradient":r.push("(background: radial-gradient(in oklch, red, red 1px 2px, red 3px))");break e;case"repeating-conic-gradient":r.push("(background: repeating-conic-gradient(in oklch from 0deg, red 0deg, red 0deg 1deg, red 2deg))");break e;case"repeating-linear-gradient":r.push("(background: repeating-linear-gradient(in oklch, red 0%, red 0% 1%, red 2%))");break e;case"repeating-radial-gradient":r.push("(background: repeating-radial-gradient(in oklch, red, red 1px 2px, red 3px))");break e}if(!t&&3===p)switch(e.value.toLowerCase()){case"conic-gradient":r.push("(background: conic-gradient(red 0deg, red 0deg 1deg, red 2deg))");break e;case"linear-gradient":r.push("(background: linear-gradient(red 0%, red 0% 1%, red 2%))");break e;case"radial-gradient":r.push("(background: radial-gradient(red, red 1px 2px, red 3px))");break e;case"repeating-conic-gradient":r.push("(background: repeating-conic-gradient(from 0deg, red 0deg, red 0deg 1deg, red 2deg))");break e;case"repeating-linear-gradient":r.push("(background: repeating-linear-gradient(red 0%, red 0% 1%, red 2%))");break e;case"repeating-radial-gradient":r.push("(background: repeating-radial-gradient(red, red 1px 2px, red 3px))");break e}}else i=!0;else p=0,t=!1}}return r}const r=[{supports:"color-mix(in lch, red, blue)",property:"color",sniff:"color-mix",matchers:[{type:"function",value:"color-mix",nodes:[{type:"word",value:"in"},{type:"space"},{type:"word",isVariable:!0},{type:"div",value:","},{type:"word",isVariable:!0},{type:"div",value:","},{type:"word",isVariable:!0}]},{type:"function",value:"color-mix",nodes:[{type:"word",value:"in"},{type:"space"},{type:"word",isVariable:!0},{type:"div",value:","},{type:"word",isVariable:!0},{type:"space"},{type:"word",isVariable:!0},{type:"div",value:","},{type:"word",isVariable:!0}]},{type:"function",value:"color-mix",nodes:[{type:"word",value:"in"},{type:"space"},{type:"word",isVariable:!0},{type:"div",value:","},{type:"word",isVariable:!0},{type:"div",value:","},{type:"word",isVariable:!0},{type:"space"},{type:"word",isVariable:!0}]},{type:"function",value:"color-mix",nodes:[{type:"word",value:"in"},{type:"space"},{type:"word",isVariable:!0},{type:"div",value:","},{type:"word",isVariable:!0},{type:"space"},{type:"word",isVariable:!0},{type:"div",value:","},{type:"word",isVariable:!0},{type:"space"},{type:"word",isVariable:!0}]},{type:"function",value:"color-mix",nodes:[{type:"word",value:"in"},{type:"space"},{type:"word",isVariable:!0},{type:"space"},{type:"word",isVariable:!0},{type:"div",value:","},{type:"word",isVariable:!0},{type:"div",value:","},{type:"word",isVariable:!0}]},{type:"function",value:"color-mix",nodes:[{type:"word",value:"in"},{type:"space"},{type:"word",isVariable:!0},{type:"space"},{type:"word",isVariable:!0},{type:"div",value:","},{type:"word",isVariable:!0},{type:"space"},{type:"word",isVariable:!0},{type:"div",value:","},{type:"word",isVariable:!0}]},{type:"function",value:"color-mix",nodes:[{type:"word",value:"in"},{type:"space"},{type:"word",isVariable:!0},{type:"space"},{type:"word",isVariable:!0},{type:"div",value:","},{type:"word",isVariable:!0},{type:"div",value:","},{type:"word",isVariable:!0},{type:"space"},{type:"word",isVariable:!0}]},{type:"function",value:"color-mix",nodes:[{type:"word",value:"in"},{type:"space"},{type:"word",isVariable:!0},{type:"space"},{type:"word",isVariable:!0},{type:"div",value:","},{type:"word",isVariable:!0},{type:"space"},{type:"word",isVariable:!0},{type:"div",value:","},{type:"word",isVariable:!0},{type:"space"},{type:"word",isVariable:!0}]}]},{supports:"lab(from red l 1 1% / calc(alpha + 0.1))",property:"color",sniff:"from ",matchers:[{type:"function",value:"rgb",nodes:[{type:"word",value:"from"},{type:"space"},{type:"word",isVariable:!0},{type:"space"},{type:"word",isVariable:!0},{type:"space"},{type:"word",isVariable:!0},{type:"space"},{type:"word",isVariable:!0}]},{type:"function",value:"rgb",nodes:[{type:"word",value:"from"},{type:"space"},{type:"word",isVariable:!0},{type:"space"},{type:"word",isVariable:!0},{type:"space"},{type:"word",isVariable:!0},{type:"space"},{type:"word",isVariable:!0},{type:"div",value:"/"},{type:"word",isVariable:!0}]},{type:"function",value:"rgba",nodes:[{type:"word",value:"from"},{type:"space"},{type:"word",isVariable:!0},{type:"space"},{type:"word",isVariable:!0},{type:"space"},{type:"word",isVariable:!0},{type:"space"},{type:"word",isVariable:!0}]},{type:"function",value:"rgba",nodes:[{type:"word",value:"from"},{type:"space"},{type:"word",isVariable:!0},{type:"space"},{type:"word",isVariable:!0},{type:"space"},{type:"word",isVariable:!0},{type:"space"},{type:"word",isVariable:!0},{type:"div",value:"/"},{type:"word",isVariable:!0}]},{type:"function",value:"hsl",nodes:[{type:"word",value:"from"},{type:"space"},{type:"word",isVariable:!0},{type:"space"},{type:"word",isVariable:!0},{type:"space"},{type:"word",isVariable:!0},{type:"space"},{type:"word",isVariable:!0}]},{type:"function",value:"hsl",nodes:[{type:"word",value:"from"},{type:"space"},{type:"word",isVariable:!0},{type:"space"},{type:"word",isVariable:!0},{type:"space"},{type:"word",isVariable:!0},{type:"space"},{type:"word",isVariable:!0},{type:"div",value:"/"},{type:"word",isVariable:!0}]},{type:"function",value:"hsla",nodes:[{type:"word",value:"from"},{type:"space"},{type:"word",isVariable:!0},{type:"space"},{type:"word",isVariable:!0},{type:"space"},{type:"word",isVariable:!0},{type:"space"},{type:"word",isVariable:!0}]},{type:"function",value:"hsla",nodes:[{type:"word",value:"from"},{type:"space"},{type:"word",isVariable:!0},{type:"space"},{type:"word",isVariable:!0},{type:"space"},{type:"word",isVariable:!0},{type:"space"},{type:"word",isVariable:!0},{type:"div",value:"/"},{type:"word",isVariable:!0}]},{type:"function",value:"hwb",nodes:[{type:"word",value:"from"},{type:"space"},{type:"word",isVariable:!0},{type:"space"},{type:"word",isVariable:!0},{type:"space"},{type:"word",isVariable:!0},{type:"space"},{type:"word",isVariable:!0}]},{type:"function",value:"hwb",nodes:[{type:"word",value:"from"},{type:"space"},{type:"word",isVariable:!0},{type:"space"},{type:"word",isVariable:!0},{type:"space"},{type:"word",isVariable:!0},{type:"space"},{type:"word",isVariable:!0},{type:"div",value:"/"},{type:"word",isVariable:!0}]},{type:"function",value:"lch",nodes:[{type:"word",value:"from"},{type:"space"},{type:"word",isVariable:!0},{type:"space"},{type:"word",isVariable:!0},{type:"space"},{type:"word",isVariable:!0},{type:"space"},{type:"word",isVariable:!0}]},{type:"function",value:"lch",nodes:[{type:"word",value:"from"},{type:"space"},{type:"word",isVariable:!0},{type:"space"},{type:"word",isVariable:!0},{type:"space"},{type:"word",isVariable:!0},{type:"space"},{type:"word",isVariable:!0},{type:"div",value:"/"},{type:"word",isVariable:!0}]},{type:"function",value:"oklch",nodes:[{type:"word",value:"from"},{type:"space"},{type:"word",isVariable:!0},{type:"space"},{type:"word",isVariable:!0},{type:"space"},{type:"word",isVariable:!0},{type:"space"},{type:"word",isVariable:!0}]},{type:"function",value:"oklch",nodes:[{type:"word",value:"from"},{type:"space"},{type:"word",isVariable:!0},{type:"space"},{type:"word",isVariable:!0},{type:"space"},{type:"word",isVariable:!0},{type:"space"},{type:"word",isVariable:!0},{type:"div",value:"/"},{type:"word",isVariable:!0}]},{type:"function",value:"lab",nodes:[{type:"word",value:"from"},{type:"space"},{type:"word",isVariable:!0},{type:"space"},{type:"word",isVariable:!0},{type:"space"},{type:"word",isVariable:!0},{type:"space"},{type:"word",isVariable:!0}]},{type:"function",value:"lab",nodes:[{type:"word",value:"from"},{type:"space"},{type:"word",isVariable:!0},{type:"space"},{type:"word",isVariable:!0},{type:"space"},{type:"word",isVariable:!0},{type:"space"},{type:"word",isVariable:!0},{type:"div",value:"/"},{type:"word",isVariable:!0}]},{type:"function",value:"oklab",nodes:[{type:"word",value:"from"},{type:"space"},{type:"word",isVariable:!0},{type:"space"},{type:"word",isVariable:!0},{type:"space"},{type:"word",isVariable:!0},{type:"space"},{type:"word",isVariable:!0}]},{type:"function",value:"oklab",nodes:[{type:"word",value:"from"},{type:"space"},{type:"word",isVariable:!0},{type:"space"},{type:"word",isVariable:!0},{type:"space"},{type:"word",isVariable:!0},{type:"space"},{type:"word",isVariable:!0},{type:"div",value:"/"},{type:"word",isVariable:!0}]},{type:"function",value:"color",nodes:[{type:"word",value:"from"},{type:"space"},{type:"word",isVariable:!0},{type:"space"},{type:"word",isVariable:!0},{type:"space"},{type:"word",isVariable:!0},{type:"space"},{type:"word",isVariable:!0},{type:"space"},{type:"word",isVariable:!0}]},{type:"function",value:"color",nodes:[{type:"word",value:"from"},{type:"space"},{type:"word",isVariable:!0},{type:"space"},{type:"word",isVariable:!0},{type:"space"},{type:"word",isVariable:!0},{type:"space"},{type:"word",isVariable:!0},{type:"space"},{type:"word",isVariable:!0},{type:"div",value:"/"},{type:"word",isVariable:!0}]}]},{supports:"color(display-p3 0 0 0%)",property:"color",sniff:"color",matchers:[{type:"function",value:"color",nodes:[{type:"word",value:"srgb"},{type:"space"},{type:"word",isVariable:!0},{type:"space"},{type:"word",isVariable:!0},{type:"space"},{type:"word",isVariable:!0}]},{type:"function",value:"color",nodes:[{type:"word",value:"srgb"},{type:"space"},{type:"word",isVariable:!0},{type:"space"},{type:"word",isVariable:!0},{type:"space"},{type:"word",isVariable:!0},{type:"div",value:"/"},{type:"word",isVariable:!0}]}]},{supports:"color(display-p3 0 0 0%)",property:"color",sniff:"color",matchers:[{type:"function",value:"color",nodes:[{type:"word",value:"display-p3"},{type:"space"},{type:"word",isVariable:!0},{type:"space"},{type:"word",isVariable:!0},{type:"space"},{type:"word",isVariable:!0}]},{type:"function",value:"color",nodes:[{type:"word",value:"display-p3"},{type:"space"},{type:"word",isVariable:!0},{type:"space"},{type:"word",isVariable:!0},{type:"space"},{type:"word",isVariable:!0},{type:"div",value:"/"},{type:"word",isVariable:!0}]}]},{supports:"color(xyz 0 0 0%)",property:"color",sniff:"color",matchers:[{type:"function",value:"color",nodes:[{type:"word",value:"srgb-linear"},{type:"space"},{type:"word",isVariable:!0},{type:"space"},{type:"word",isVariable:!0},{type:"space"},{type:"word",isVariable:!0}]},{type:"function",value:"color",nodes:[{type:"word",value:"srgb-linear"},{type:"space"},{type:"word",isVariable:!0},{type:"space"},{type:"word",isVariable:!0},{type:"space"},{type:"word",isVariable:!0},{type:"div",value:"/"},{type:"word",isVariable:!0}]}]},{supports:"color(xyz 0 0 0%)",property:"color",sniff:"color",matchers:[{type:"function",value:"color",nodes:[{type:"word",value:"a98-rgb"},{type:"space"},{type:"word",isVariable:!0},{type:"space"},{type:"word",isVariable:!0},{type:"space"},{type:"word",isVariable:!0}]},{type:"function",value:"color",nodes:[{type:"word",value:"a98-rgb"},{type:"space"},{type:"word",isVariable:!0},{type:"space"},{type:"word",isVariable:!0},{type:"space"},{type:"word",isVariable:!0},{type:"div",value:"/"},{type:"word",isVariable:!0}]}]},{supports:"color(xyz 0 0 0%)",property:"color",sniff:"color",matchers:[{type:"function",value:"color",nodes:[{type:"word",value:"prophoto-rgb"},{type:"space"},{type:"word",isVariable:!0},{type:"space"},{type:"word",isVariable:!0},{type:"space"},{type:"word",isVariable:!0}]},{type:"function",value:"color",nodes:[{type:"word",value:"prophoto-rgb"},{type:"space"},{type:"word",isVariable:!0},{type:"space"},{type:"word",isVariable:!0},{type:"space"},{type:"word",isVariable:!0},{type:"div",value:"/"},{type:"word",isVariable:!0}]}]},{supports:"color(xyz 0 0 0%)",property:"color",sniff:"color",matchers:[{type:"function",value:"color",nodes:[{type:"word",value:"rec2020"},{type:"space"},{type:"word",isVariable:!0},{type:"space"},{type:"word",isVariable:!0},{type:"space"},{type:"word",isVariable:!0}]},{type:"function",value:"color",nodes:[{type:"word",value:"rec2020"},{type:"space"},{type:"word",isVariable:!0},{type:"space"},{type:"word",isVariable:!0},{type:"space"},{type:"word",isVariable:!0},{type:"div",value:"/"},{type:"word",isVariable:!0}]}]},{supports:"color(xyz 0 0 0%)",property:"color",sniff:"color",matchers:[{type:"function",value:"color",nodes:[{type:"word",value:"xyz-d50"},{type:"space"},{type:"word",isVariable:!0},{type:"space"},{type:"word",isVariable:!0},{type:"space"},{type:"word",isVariable:!0}]},{type:"function",value:"color",nodes:[{type:"word",value:"xyz-d50"},{type:"space"},{type:"word",isVariable:!0},{type:"space"},{type:"word",isVariable:!0},{type:"space"},{type:"word",isVariable:!0},{type:"div",value:"/"},{type:"word",isVariable:!0}]}]},{supports:"color(xyz 0 0 0%)",property:"color",sniff:"color",matchers:[{type:"function",value:"color",nodes:[{type:"word",value:"xyz-d65"},{type:"space"},{type:"word",isVariable:!0},{type:"space"},{type:"word",isVariable:!0},{type:"space"},{type:"word",isVariable:!0}]},{type:"function",value:"color",nodes:[{type:"word",value:"xyz-d65"},{type:"space"},{type:"word",isVariable:!0},{type:"space"},{type:"word",isVariable:!0},{type:"space"},{type:"word",isVariable:!0},{type:"div",value:"/"},{type:"word",isVariable:!0}]}]},{supports:"color(xyz 0 0 0%)",property:"color",sniff:"color",matchers:[{type:"function",value:"color",nodes:[{type:"word",value:"xyz"},{type:"space"},{type:"word",isVariable:!0},{type:"space"},{type:"word",isVariable:!0},{type:"space"},{type:"word",isVariable:!0}]},{type:"function",value:"color",nodes:[{type:"word",value:"xyz"},{type:"space"},{type:"word",isVariable:!0},{type:"space"},{type:"word",isVariable:!0},{type:"space"},{type:"word",isVariable:!0},{type:"div",value:"/"},{type:"word",isVariable:!0}]}]},{supports:"hsl(0, 0%, 0%)",property:"color",sniff:"hsl",matchers:[{type:"function",value:"hsl",nodes:[{type:"word",isVariable:!0},{type:"div",value:","},{type:"word",isVariable:!0},{type:"div",value:","},{type:"word",isVariable:!0},{type:"div",value:","},{type:"word",isVariable:!0}]}]},{supports:"hsl(0 0% 0% / 0)",property:"color",sniff:"hsl",matchers:[{type:"function",value:"hsl",nodes:[{type:"word",isVariable:!0},{type:"space"},{type:"word",isVariable:!0},{type:"space"},{type:"word",isVariable:!0}]},{type:"function",value:"hsl",nodes:[{type:"word",isVariable:!0},{type:"space"},{type:"word",isVariable:!0},{type:"space"},{type:"word",isVariable:!0},{type:"div",value:"/"},{type:"word",isVariable:!0}]}]},{supports:"hsla(0 0% 0% / 0)",property:"color",sniff:"hsla",matchers:[{type:"function",value:"hsla",nodes:[{type:"word",isVariable:!0},{type:"space"},{type:"word",isVariable:!0},{type:"space"},{type:"word",isVariable:!0},{type:"div",value:"/"},{type:"word",isVariable:!0}]}]},{supports:"hwb(0 0% 0%)",property:"color",sniff:"hwb",matchers:[{type:"function",value:"hwb",nodes:[{type:"word",isVariable:!0},{type:"space"},{type:"word",isVariable:!0},{type:"space"},{type:"word",isVariable:!0}]},{type:"function",value:"hwb",nodes:[{type:"word",isVariable:!0},{type:"space"},{type:"word",isVariable:!0},{type:"space"},{type:"word",isVariable:!0},{type:"div",value:"/"},{type:"word",isVariable:!0}]}]},{supports:"lab(0% 0 0%)",property:"color",sniff:"lab",matchers:[{type:"function",value:"lab",nodes:[{type:"word",isVariable:!0},{type:"space"},{type:"word",isVariable:!0},{type:"space"},{type:"word",isVariable:!0}]},{type:"function",value:"lab",nodes:[{type:"word",isVariable:!0},{type:"space"},{type:"word",isVariable:!0},{type:"space"},{type:"word",isVariable:!0},{type:"div",value:"/"},{type:"word",isVariable:!0}]}]},{supports:"lab(0% 0 0%)",property:"color",sniff:"lch",matchers:[{type:"function",value:"lch",nodes:[{type:"word",isVariable:!0},{type:"space"},{type:"word",isVariable:!0},{type:"space"},{type:"word",isVariable:!0}]},{type:"function",value:"lch",nodes:[{type:"word",isVariable:!0},{type:"space"},{type:"word",isVariable:!0},{type:"space"},{type:"word",isVariable:!0},{type:"div",value:"/"},{type:"word",isVariable:!0}]}]},{supports:"oklab(0% 0 0%)",property:"color",sniff:"oklab",matchers:[{type:"function",value:"oklab",nodes:[{type:"word",isVariable:!0},{type:"space"},{type:"word",isVariable:!0},{type:"space"},{type:"word",isVariable:!0}]},{type:"function",value:"oklab",nodes:[{type:"word",isVariable:!0},{type:"space"},{type:"word",isVariable:!0},{type:"space"},{type:"word",isVariable:!0},{type:"div",value:"/"},{type:"word",isVariable:!0}]}]},{supports:"oklab(0% 0 0%)",property:"color",sniff:"oklch",matchers:[{type:"function",value:"oklch",nodes:[{type:"word",isVariable:!0},{type:"space"},{type:"word",isVariable:!0},{type:"space"},{type:"word",isVariable:!0}]},{type:"function",value:"oklch",nodes:[{type:"word",isVariable:!0},{type:"space"},{type:"word",isVariable:!0},{type:"space"},{type:"word",isVariable:!0},{type:"div",value:"/"},{type:"word",isVariable:!0}]}]},{supports:"rgb(0, 0, 0, 0)",property:"color",sniff:"rgb",matchers:[{type:"function",value:"rgb",nodes:[{type:"word",isVariable:!0},{type:"div",value:","},{type:"word",isVariable:!0},{type:"div",value:","},{type:"word",isVariable:!0},{type:"div",value:","},{type:"word",isVariable:!0}]}]},{supports:"rgb(0 0 0 / 0)",property:"color",sniff:"rgb",matchers:[{type:"function",value:"rgb",nodes:[{type:"word",isVariable:!0},{type:"space"},{type:"word",isVariable:!0},{type:"space"},{type:"word",isVariable:!0}]},{type:"function",value:"rgb",nodes:[{type:"word",isVariable:!0},{type:"space"},{type:"word",isVariable:!0},{type:"space"},{type:"word",isVariable:!0},{type:"div",value:"/"},{type:"word",isVariable:!0}]}]},{supports:"rgba(0 0 0 / 0)",property:"color",sniff:"rgba",matchers:[{type:"function",value:"rgba",nodes:[{type:"word",isVariable:!0},{type:"space"},{type:"word",isVariable:!0},{type:"space"},{type:"word",isVariable:!0},{type:"div",value:"/"},{type:"word",isVariable:!0}]}]},{supports:"light-dark(red, red)",property:"color",sniff:"light-dark",matchers:[{type:"function",value:"light-dark",nodes:[{type:"word",isVariable:!0},{type:"div",value:","},{type:"word",isVariable:!0}]}]},{supports:"contrast-color(red max)",property:"color",sniff:"contrast-color",matchers:[{type:"function",value:"contrast-color",nodes:[{type:"word",isVariable:!0}]},{type:"function",value:"contrast-color",nodes:[{type:"word",isVariable:!0},{type:"space"},{type:"word",isVariable:!0}]}]},{supports:"1ic",property:"font-size",sniff:"ic",matchers:[{type:"word",value:"1ic",dimension:{unit:"ic"}}]}];function matches(e,a){if(e.isVariable&&a&&("word"===a.type||"string"===a.type||"function"===a.type))return!0;if(e.type!==a.type)return!1;if(doesNotMatchValue(e,a))return!1;if(e.nodes&&a.nodes){for(let r=0;r<Math.max(e.nodes.length,a.nodes.length);r++){let p=r,t=r;for(;e.nodes[p]&&"space"===e.nodes[p].type;)p++;for(;a.nodes[t]&&"space"===a.nodes[t].type;)t++;if(!!e.nodes[p]!=!!a.nodes[t])return!1;if(!matches(e.nodes[p],a.nodes[t]))return!1}return!0}return!0}function doesNotMatchValue(e,a){return("space"!==e.type||"space"!==a.type||e.value?.trim()!==a.value?.trim())&&(e.dimension&&a.dimension?e.dimension.unit!==a.dimension.unit:"string"===e.type?e.value!==a.value:e.value?.toLowerCase()!==a.value?.toLowerCase())}const p=/^var$/i;function conditionsFromValue(a,t=!1){const i=[],o=r.filter((e=>a.includes(e.sniff)));let s=!1;try{e(a).walk((a=>{"function"===a.type&&p.test(a.value)&&(s=!0);try{const r=e.unit(a.value);!1!==r&&(a.dimension=r)}catch{}for(let e=0;e<o.length;e++){const r=o[e];for(let e=0;e<r.matchers.length;e++){if(matches(r.matchers[e],a))return void i.push(`(${r.property}: ${r.supports})`)}}i.push(...doublePositionGradients(a))}))}catch(e){}return t&&!s?{support:[]}:{support:Array.from(new Set(i)).sort()}}const t=/var\(/i,i=/^initial$/i,o=/^\s*$/,creator=()=>({postcssPlugin:"postcss-progressive-custom-properties",prepare(){const e=new WeakMap;return{postcssPlugin:"postcss-progressive-custom-properties",OnceExit(a,{postcss:r}){a.walkDecls((a=>{if(!a.parent)return;const p=e.get(a.parent)||{conditionalRules:[],propNames:new Set,lastConditionParams:{support:void 0},lastConditionalRule:void 0};if(e.set(a.parent,p),a.variable){if(!p.propNames.has(a.prop))return void p.propNames.add(a.prop)}else{const e=a.prop.toLowerCase();if(!p.propNames.has(e))return void p.propNames.add(e)}if(!a.variable&&!t.test(a.value))return;if(i.test(a.value))return;if(o.test(a.value))return;const s=!a.variable,l=conditionsFromValue(a.value,s).support.join(" and ");if(!l)return;if(p.lastConditionParams.support!==l&&(p.lastConditionalRule=void 0),p.lastConditionalRule)return p.lastConditionalRule.append(a.clone()),void a.remove();const y=[];if(l&&y.push(r.atRule({name:"supports",params:l,source:a.parent.source,raws:{before:"\n\n",after:"\n"}})),!y.length)return;for(let e=0;e<y.length-1;e++){const a=y[e],r=y[e+1];a.append(r)}const d=y[0],c=y[y.length-1],n=a.parent.clone();n.removeAll(),n.raws.before="\n",n.append(a.clone()),a.remove(),p.lastConditionParams.support=l,p.lastConditionalRule=n,c.append(n),p.conditionalRules.push(d)})),a.walk((a=>{const r=e.get(a);r&&0!==r.conditionalRules.length&&r.conditionalRules.reverse().forEach((e=>{a.after(e)}))}))}}}});creator.postcss=!0;export{creator as default};
diff --git a/node_modules/@csstools/postcss-progressive-custom-properties/package.json b/node_modules/@csstools/postcss-progressive-custom-properties/package.json
index e9dc0109..01f939bd 100644
--- a/node_modules/@csstools/postcss-progressive-custom-properties/package.json
+++ b/node_modules/@csstools/postcss-progressive-custom-properties/package.json
@@ -1,7 +1,7 @@
{
"name": "@csstools/postcss-progressive-custom-properties",
"description": "Correctly declare progressive enhancements for CSS Custom Properties.",
- "version": "3.0.3",
+ "version": "3.2.0",
"author": "Jonathan Neal <jonathantneal@hotmail.com>",
"license": "MIT-0",
"funding": [
@@ -45,7 +45,7 @@
},
"repository": {
"type": "git",
- "url": "https://github.com/csstools/postcss-plugins.git",
+ "url": "git+https://github.com/csstools/postcss-plugins.git",
"directory": "plugins/postcss-progressive-custom-properties"
},
"keywords": [
diff --git a/node_modules/@csstools/postcss-relative-color-syntax/CHANGELOG.md b/node_modules/@csstools/postcss-relative-color-syntax/CHANGELOG.md
index 5361cc06..64be5ad3 100644
--- a/node_modules/@csstools/postcss-relative-color-syntax/CHANGELOG.md
+++ b/node_modules/@csstools/postcss-relative-color-syntax/CHANGELOG.md
@@ -1,28 +1,25 @@
# Changes to PostCSS Relative Color Syntax
-### 2.0.9
+### 2.0.16
-_December 31, 2023_
+_May 4, 2024_
-- Updated [`@csstools/css-tokenizer`](https://github.com/csstools/postcss-plugins/tree/main/packages/css-tokenizer) to [`2.2.3`](https://github.com/csstools/postcss-plugins/tree/main/packages/css-tokenizer/CHANGELOG.md#223) (patch)
-- Updated [`@csstools/css-parser-algorithms`](https://github.com/csstools/postcss-plugins/tree/main/packages/css-parser-algorithms) to [`2.5.0`](https://github.com/csstools/postcss-plugins/tree/main/packages/css-parser-algorithms/CHANGELOG.md#250) (minor)
-- Updated [`@csstools/css-color-parser`](https://github.com/csstools/postcss-plugins/tree/main/packages/css-color-parser) to [`1.5.1`](https://github.com/csstools/postcss-plugins/tree/main/packages/css-color-parser/CHANGELOG.md#151) (patch)
+- Updated [`@csstools/css-tokenizer`](https://github.com/csstools/postcss-plugins/tree/main/packages/css-tokenizer) to [`2.3.1`](https://github.com/csstools/postcss-plugins/tree/main/packages/css-tokenizer/CHANGELOG.md#231) (patch)
+- Updated [`@csstools/css-parser-algorithms`](https://github.com/csstools/postcss-plugins/tree/main/packages/css-parser-algorithms) to [`2.6.3`](https://github.com/csstools/postcss-plugins/tree/main/packages/css-parser-algorithms/CHANGELOG.md#263) (patch)
+- Updated [`@csstools/css-color-parser`](https://github.com/csstools/postcss-plugins/tree/main/packages/css-color-parser) to [`2.0.2`](https://github.com/csstools/postcss-plugins/tree/main/packages/css-color-parser/CHANGELOG.md#202) (patch)
-### 2.0.8
+### 2.0.15
-_December 15, 2023_
+_May 4, 2024_
-- Skip transforms when a color value contains experimental syntax
-- Updated [`@csstools/css-tokenizer`](https://github.com/csstools/postcss-plugins/tree/main/packages/css-tokenizer) to [`2.2.2`](https://github.com/csstools/postcss-plugins/tree/main/packages/css-tokenizer/CHANGELOG.md#222) (patch)
-- Updated [`@csstools/css-parser-algorithms`](https://github.com/csstools/postcss-plugins/tree/main/packages/css-parser-algorithms) to [`2.4.0`](https://github.com/csstools/postcss-plugins/tree/main/packages/css-parser-algorithms/CHANGELOG.md#240) (minor)
-- Updated [`@csstools/postcss-progressive-custom-properties`](https://github.com/csstools/postcss-plugins/tree/main/plugins/postcss-progressive-custom-properties) to [`3.0.3`](https://github.com/csstools/postcss-plugins/tree/main/plugins/postcss-progressive-custom-properties/CHANGELOG.md#303) (patch)
-- Updated [`@csstools/css-color-parser`](https://github.com/csstools/postcss-plugins/tree/main/packages/css-color-parser) to [`1.5.0`](https://github.com/csstools/postcss-plugins/tree/main/packages/css-color-parser/CHANGELOG.md#150) (minor)
+- Updated [`@csstools/css-tokenizer`](https://github.com/csstools/postcss-plugins/tree/main/packages/css-tokenizer) to [`2.3.0`](https://github.com/csstools/postcss-plugins/tree/main/packages/css-tokenizer/CHANGELOG.md#230) (minor)
+- Updated [`@csstools/css-parser-algorithms`](https://github.com/csstools/postcss-plugins/tree/main/packages/css-parser-algorithms) to [`2.6.2`](https://github.com/csstools/postcss-plugins/tree/main/packages/css-parser-algorithms/CHANGELOG.md#262) (patch)
+- Updated [`@csstools/css-color-parser`](https://github.com/csstools/postcss-plugins/tree/main/packages/css-color-parser) to [`2.0.1`](https://github.com/csstools/postcss-plugins/tree/main/packages/css-color-parser/CHANGELOG.md#201) (patch)
-### 2.0.7
+### 2.0.14
-_October 9, 2023_
+_April 21, 2024_
-- Updated [`@csstools/css-color-parser`](https://github.com/csstools/postcss-plugins/tree/main/packages/css-color-parser) to [`1.4.0`](https://github.com/csstools/postcss-plugins/tree/main/packages/css-color-parser/CHANGELOG.md#140) (minor)
-- Updated [`@csstools/postcss-progressive-custom-properties`](https://github.com/csstools/postcss-plugins/tree/main/plugins/postcss-progressive-custom-properties) to [`3.0.2`](https://github.com/csstools/postcss-plugins/tree/main/plugins/postcss-progressive-custom-properties/CHANGELOG.md#302) (patch)
+- Updated [`@csstools/css-color-parser`](https://github.com/csstools/postcss-plugins/tree/main/packages/css-color-parser) to [`2.0.0`](https://github.com/csstools/postcss-plugins/tree/main/packages/css-color-parser/CHANGELOG.md#200) (major)
[Full CHANGELOG](https://github.com/csstools/postcss-plugins/tree/main/plugins/postcss-relative-color-syntax/CHANGELOG.md)
diff --git a/node_modules/@csstools/postcss-relative-color-syntax/dist/index.cjs b/node_modules/@csstools/postcss-relative-color-syntax/dist/index.cjs
index 80f0a93d..3ce20e78 100644
--- a/node_modules/@csstools/postcss-relative-color-syntax/dist/index.cjs
+++ b/node_modules/@csstools/postcss-relative-color-syntax/dist/index.cjs
@@ -1 +1 @@
-"use strict";var s=require("@csstools/postcss-progressive-custom-properties"),e=require("@csstools/css-tokenizer"),t=require("@csstools/css-color-parser"),r=require("@csstools/css-parser-algorithms");function hasFallback(s){const e=s.parent;if(!e)return!1;const t=s.prop.toLowerCase(),r=e.index(s);for(let s=0;s<r;s++){const r=e.nodes[s];if("decl"===r.type&&r.prop.toLowerCase()===t)return!0}return!1}const o=/(rgb|hsl|hwb|lab|lch|oklch|oklab|color)\(\s*?from/i;function hasSupportsAtRuleAncestor(s){let e=s.parent;for(;e;)if("atrule"===e.type){if("supports"===e.name.toLowerCase()&&o.test(e.params))return!0;e=e.parent}else e=e.parent;return!1}const a=/(rgb|hsl|hwb|lab|lch|oklch|oklab|color)\(/i,l=/^(rgb|hsl|hwb|lab|lch|oklch|oklab|color)$/i,n=/from/i,basePlugin=s=>({postcssPlugin:"postcss-relative-color-syntax",Declaration:o=>{const i=o.value;if(!a.test(i)||!n.test(i))return;if(hasFallback(o))return;if(hasSupportsAtRuleAncestor(o))return;const c=e.tokenize({css:i}),u=r.replaceComponentValues(r.parseCommaSeparatedListOfComponentValues(c),(s=>{if(!r.isFunctionNode(s)||!l.test(s.getName()))return;const e=t.color(s);return e&&!e.syntaxFlags.has(t.SyntaxFlag.Experimental)&&!e.syntaxFlags.has(t.SyntaxFlag.HasNoneKeywords)&&e.syntaxFlags.has(t.SyntaxFlag.RelativeColorSyntax)?t.serializeRGB(e):void 0})),p=r.stringify(u);if(p===i)return;let g=p;s?.subFeatures.displayP3&&(g=r.stringify(r.replaceComponentValues(r.parseCommaSeparatedListOfComponentValues(c),(s=>{if(!r.isFunctionNode(s)||!l.test(s.getName()))return;const e=t.color(s);return e&&!e.syntaxFlags.has(t.SyntaxFlag.Experimental)&&!e.syntaxFlags.has(t.SyntaxFlag.HasNoneKeywords)&&e.syntaxFlags.has(t.SyntaxFlag.RelativeColorSyntax)?t.colorDataFitsRGB_Gamut(e)?t.serializeRGB(e):t.serializeP3(e):void 0})))),o.cloneBefore({value:p}),s?.subFeatures.displayP3&&g!==p&&o.cloneBefore({value:g}),s?.preserve||o.remove()}});basePlugin.postcss=!0;const postcssPlugin=e=>{const t=Object.assign({enableProgressiveCustomProperties:!0,preserve:!1,subFeatures:{displayP3:!0}},e);return t.subFeatures=Object.assign({displayP3:!0},t.subFeatures),t.enableProgressiveCustomProperties&&(t.preserve||t.subFeatures.displayP3)?{postcssPlugin:"postcss-relative-color-syntax",plugins:[s(),basePlugin(t)]}:basePlugin(t)};postcssPlugin.postcss=!0,module.exports=postcssPlugin;
+"use strict";var s=require("@csstools/postcss-progressive-custom-properties"),e=require("@csstools/css-color-parser"),a=require("@csstools/utilities"),r=require("@csstools/css-parser-algorithms"),t=require("@csstools/css-tokenizer");const o=/\b(?:rgb|rgba|hsl|hsla|hwb|lab|lch|oklch|oklab|color)\(/i,l=/\b(?:rgb|rgba|hsl|hsla|hwb|lab|lch|oklch|oklab|color)\(\s*?from/i,i=/^(?:rgb|rgba|hsl|hsla|hwb|lab|lch|oklch|oklab|color)$/i,n=/from/i,basePlugin=s=>({postcssPlugin:"postcss-relative-color-syntax",Declaration(c){const u=c.value;if(!o.test(u)||!n.test(u))return;if(a.hasFallback(c))return;if(a.hasSupportsAtRuleAncestor(c,l))return;const p=t.tokenize({css:u}),g=r.replaceComponentValues(r.parseCommaSeparatedListOfComponentValues(p),(s=>{if(!r.isFunctionNode(s)||!i.test(s.getName()))return;const a=e.color(s);return a&&!a.syntaxFlags.has(e.SyntaxFlag.Experimental)&&!a.syntaxFlags.has(e.SyntaxFlag.HasNoneKeywords)&&a.syntaxFlags.has(e.SyntaxFlag.RelativeColorSyntax)?e.serializeRGB(a):void 0})),b=r.stringify(g);if(b===u)return;let y=b;s?.subFeatures.displayP3&&(y=r.stringify(r.replaceComponentValues(r.parseCommaSeparatedListOfComponentValues(p),(s=>{if(!r.isFunctionNode(s)||!i.test(s.getName()))return;const a=e.color(s);return a&&!a.syntaxFlags.has(e.SyntaxFlag.Experimental)&&!a.syntaxFlags.has(e.SyntaxFlag.HasNoneKeywords)&&a.syntaxFlags.has(e.SyntaxFlag.RelativeColorSyntax)?e.colorDataFitsRGB_Gamut(a)?e.serializeRGB(a):e.serializeP3(a):void 0})))),c.cloneBefore({value:b}),s?.subFeatures.displayP3&&y!==b&&c.cloneBefore({value:y}),s?.preserve||c.remove()}});basePlugin.postcss=!0;const postcssPlugin=e=>{const a=Object.assign({enableProgressiveCustomProperties:!0,preserve:!1,subFeatures:{displayP3:!0}},e);return a.subFeatures=Object.assign({displayP3:!0},a.subFeatures),a.enableProgressiveCustomProperties&&(a.preserve||a.subFeatures.displayP3)?{postcssPlugin:"postcss-relative-color-syntax",plugins:[s(),basePlugin(a)]}:basePlugin(a)};postcssPlugin.postcss=!0,module.exports=postcssPlugin;
diff --git a/node_modules/@csstools/postcss-relative-color-syntax/dist/index.mjs b/node_modules/@csstools/postcss-relative-color-syntax/dist/index.mjs
index 08b26cb6..0184ff35 100644
--- a/node_modules/@csstools/postcss-relative-color-syntax/dist/index.mjs
+++ b/node_modules/@csstools/postcss-relative-color-syntax/dist/index.mjs
@@ -1 +1 @@
-import s from"@csstools/postcss-progressive-custom-properties";import{tokenize as e}from"@csstools/css-tokenizer";import{color as t,SyntaxFlag as r,serializeRGB as o,colorDataFitsRGB_Gamut as a,serializeP3 as l}from"@csstools/css-color-parser";import{replaceComponentValues as n,parseCommaSeparatedListOfComponentValues as c,isFunctionNode as i,stringify as p}from"@csstools/css-parser-algorithms";function hasFallback(s){const e=s.parent;if(!e)return!1;const t=s.prop.toLowerCase(),r=e.index(s);for(let s=0;s<r;s++){const r=e.nodes[s];if("decl"===r.type&&r.prop.toLowerCase()===t)return!0}return!1}const u=/(rgb|hsl|hwb|lab|lch|oklch|oklab|color)\(\s*?from/i;function hasSupportsAtRuleAncestor(s){let e=s.parent;for(;e;)if("atrule"===e.type){if("supports"===e.name.toLowerCase()&&u.test(e.params))return!0;e=e.parent}else e=e.parent;return!1}const b=/(rgb|hsl|hwb|lab|lch|oklch|oklab|color)\(/i,f=/^(rgb|hsl|hwb|lab|lch|oklch|oklab|color)$/i,h=/from/i,basePlugin=s=>({postcssPlugin:"postcss-relative-color-syntax",Declaration:u=>{const m=u.value;if(!b.test(m)||!h.test(m))return;if(hasFallback(u))return;if(hasSupportsAtRuleAncestor(u))return;const g=e({css:m}),y=n(c(g),(s=>{if(!i(s)||!f.test(s.getName()))return;const e=t(s);return e&&!e.syntaxFlags.has(r.Experimental)&&!e.syntaxFlags.has(r.HasNoneKeywords)&&e.syntaxFlags.has(r.RelativeColorSyntax)?o(e):void 0})),v=p(y);if(v===m)return;let x=v;s?.subFeatures.displayP3&&(x=p(n(c(g),(s=>{if(!i(s)||!f.test(s.getName()))return;const e=t(s);return e&&!e.syntaxFlags.has(r.Experimental)&&!e.syntaxFlags.has(r.HasNoneKeywords)&&e.syntaxFlags.has(r.RelativeColorSyntax)?a(e)?o(e):l(e):void 0})))),u.cloneBefore({value:v}),s?.subFeatures.displayP3&&x!==v&&u.cloneBefore({value:x}),s?.preserve||u.remove()}});basePlugin.postcss=!0;const postcssPlugin=e=>{const t=Object.assign({enableProgressiveCustomProperties:!0,preserve:!1,subFeatures:{displayP3:!0}},e);return t.subFeatures=Object.assign({displayP3:!0},t.subFeatures),t.enableProgressiveCustomProperties&&(t.preserve||t.subFeatures.displayP3)?{postcssPlugin:"postcss-relative-color-syntax",plugins:[s(),basePlugin(t)]}:basePlugin(t)};postcssPlugin.postcss=!0;export{postcssPlugin as default};
+import s from"@csstools/postcss-progressive-custom-properties";import{color as e,SyntaxFlag as r,serializeRGB as o,colorDataFitsRGB_Gamut as t,serializeP3 as a}from"@csstools/css-color-parser";import{hasFallback as l,hasSupportsAtRuleAncestor as i}from"@csstools/utilities";import{replaceComponentValues as c,parseCommaSeparatedListOfComponentValues as n,isFunctionNode as u,stringify as p}from"@csstools/css-parser-algorithms";import{tokenize as b}from"@csstools/css-tokenizer";const g=/\b(?:rgb|rgba|hsl|hsla|hwb|lab|lch|oklch|oklab|color)\(/i,h=/\b(?:rgb|rgba|hsl|hsla|hwb|lab|lch|oklch|oklab|color)\(\s*?from/i,m=/^(?:rgb|rgba|hsl|hsla|hwb|lab|lch|oklch|oklab|color)$/i,y=/from/i,basePlugin=s=>({postcssPlugin:"postcss-relative-color-syntax",Declaration(f){const v=f.value;if(!g.test(v)||!y.test(v))return;if(l(f))return;if(i(f,h))return;const x=b({css:v}),F=c(n(x),(s=>{if(!u(s)||!m.test(s.getName()))return;const t=e(s);return t&&!t.syntaxFlags.has(r.Experimental)&&!t.syntaxFlags.has(r.HasNoneKeywords)&&t.syntaxFlags.has(r.RelativeColorSyntax)?o(t):void 0})),P=p(F);if(P===v)return;let d=P;s?.subFeatures.displayP3&&(d=p(c(n(x),(s=>{if(!u(s)||!m.test(s.getName()))return;const l=e(s);return l&&!l.syntaxFlags.has(r.Experimental)&&!l.syntaxFlags.has(r.HasNoneKeywords)&&l.syntaxFlags.has(r.RelativeColorSyntax)?t(l)?o(l):a(l):void 0})))),f.cloneBefore({value:P}),s?.subFeatures.displayP3&&d!==P&&f.cloneBefore({value:d}),s?.preserve||f.remove()}});basePlugin.postcss=!0;const postcssPlugin=e=>{const r=Object.assign({enableProgressiveCustomProperties:!0,preserve:!1,subFeatures:{displayP3:!0}},e);return r.subFeatures=Object.assign({displayP3:!0},r.subFeatures),r.enableProgressiveCustomProperties&&(r.preserve||r.subFeatures.displayP3)?{postcssPlugin:"postcss-relative-color-syntax",plugins:[s(),basePlugin(r)]}:basePlugin(r)};postcssPlugin.postcss=!0;export{postcssPlugin as default};
diff --git a/node_modules/@csstools/postcss-relative-color-syntax/package.json b/node_modules/@csstools/postcss-relative-color-syntax/package.json
index 27e20edf..0b9c5536 100644
--- a/node_modules/@csstools/postcss-relative-color-syntax/package.json
+++ b/node_modules/@csstools/postcss-relative-color-syntax/package.json
@@ -1,7 +1,7 @@
{
"name": "@csstools/postcss-relative-color-syntax",
"description": "Use the relative color syntax in CSS",
- "version": "2.0.9",
+ "version": "2.0.16",
"contributors": [
{
"name": "Antonio Laguna",
@@ -48,10 +48,11 @@
"dist"
],
"dependencies": {
- "@csstools/css-color-parser": "^1.5.1",
- "@csstools/css-parser-algorithms": "^2.5.0",
- "@csstools/css-tokenizer": "^2.2.3",
- "@csstools/postcss-progressive-custom-properties": "^3.0.3"
+ "@csstools/css-color-parser": "^2.0.2",
+ "@csstools/css-parser-algorithms": "^2.6.3",
+ "@csstools/css-tokenizer": "^2.3.1",
+ "@csstools/postcss-progressive-custom-properties": "^3.2.0",
+ "@csstools/utilities": "^1.0.0"
},
"peerDependencies": {
"postcss": "^8.4"
@@ -59,7 +60,7 @@
"homepage": "https://github.com/csstools/postcss-plugins/tree/main/plugins/postcss-relative-color-syntax#readme",
"repository": {
"type": "git",
- "url": "https://github.com/csstools/postcss-plugins.git",
+ "url": "git+https://github.com/csstools/postcss-plugins.git",
"directory": "plugins/postcss-relative-color-syntax"
},
"bugs": "https://github.com/csstools/postcss-plugins/issues",
diff --git a/node_modules/@csstools/postcss-stepped-value-functions/CHANGELOG.md b/node_modules/@csstools/postcss-stepped-value-functions/CHANGELOG.md
index 34548155..b79ded93 100644
--- a/node_modules/@csstools/postcss-stepped-value-functions/CHANGELOG.md
+++ b/node_modules/@csstools/postcss-stepped-value-functions/CHANGELOG.md
@@ -1,28 +1,27 @@
# Changes to PostCSS Stepped Value Functions
-### 3.0.4
+### 3.0.8
-_December 31, 2023_
+_May 4, 2024_
-- Updated [`@csstools/css-tokenizer`](https://github.com/csstools/postcss-plugins/tree/main/packages/css-tokenizer) to [`2.2.3`](https://github.com/csstools/postcss-plugins/tree/main/packages/css-tokenizer/CHANGELOG.md#223) (patch)
-- Updated [`@csstools/css-parser-algorithms`](https://github.com/csstools/postcss-plugins/tree/main/packages/css-parser-algorithms) to [`2.5.0`](https://github.com/csstools/postcss-plugins/tree/main/packages/css-parser-algorithms/CHANGELOG.md#250) (minor)
-- Updated [`@csstools/css-calc`](https://github.com/csstools/postcss-plugins/tree/main/packages/css-calc) to [`1.1.6`](https://github.com/csstools/postcss-plugins/tree/main/packages/css-calc/CHANGELOG.md#116) (patch)
+- Updated [`@csstools/css-tokenizer`](https://github.com/csstools/postcss-plugins/tree/main/packages/css-tokenizer) to [`2.3.1`](https://github.com/csstools/postcss-plugins/tree/main/packages/css-tokenizer/CHANGELOG.md#231) (patch)
+- Updated [`@csstools/css-parser-algorithms`](https://github.com/csstools/postcss-plugins/tree/main/packages/css-parser-algorithms) to [`2.6.3`](https://github.com/csstools/postcss-plugins/tree/main/packages/css-parser-algorithms/CHANGELOG.md#263) (patch)
+- Updated [`@csstools/css-calc`](https://github.com/csstools/postcss-plugins/tree/main/packages/css-calc) to [`1.2.2`](https://github.com/csstools/postcss-plugins/tree/main/packages/css-calc/CHANGELOG.md#122) (patch)
-### 3.0.3
+### 3.0.7
-_December 15, 2023_
+_May 4, 2024_
-- Fix type definitions
-- Updated [`@csstools/css-tokenizer`](https://github.com/csstools/postcss-plugins/tree/main/packages/css-tokenizer) to [`2.2.2`](https://github.com/csstools/postcss-plugins/tree/main/packages/css-tokenizer/CHANGELOG.md#222) (patch)
-- Updated [`@csstools/css-parser-algorithms`](https://github.com/csstools/postcss-plugins/tree/main/packages/css-parser-algorithms) to [`2.4.0`](https://github.com/csstools/postcss-plugins/tree/main/packages/css-parser-algorithms/CHANGELOG.md#240) (minor)
-- Updated [`@csstools/css-calc`](https://github.com/csstools/postcss-plugins/tree/main/packages/css-calc) to [`1.1.5`](https://github.com/csstools/postcss-plugins/tree/main/packages/css-calc/CHANGELOG.md#115) (patch)
+- Updated [`@csstools/css-tokenizer`](https://github.com/csstools/postcss-plugins/tree/main/packages/css-tokenizer) to [`2.3.0`](https://github.com/csstools/postcss-plugins/tree/main/packages/css-tokenizer/CHANGELOG.md#230) (minor)
+- Updated [`@csstools/css-parser-algorithms`](https://github.com/csstools/postcss-plugins/tree/main/packages/css-parser-algorithms) to [`2.6.2`](https://github.com/csstools/postcss-plugins/tree/main/packages/css-parser-algorithms/CHANGELOG.md#262) (patch)
+- Updated [`@csstools/css-calc`](https://github.com/csstools/postcss-plugins/tree/main/packages/css-calc) to [`1.2.1`](https://github.com/csstools/postcss-plugins/tree/main/packages/css-calc/CHANGELOG.md#121) (patch)
-### 3.0.2
+### 3.0.6
-_September 24, 2023_
+_March 13, 2024_
-- Updated [`@csstools/css-tokenizer`](https://github.com/csstools/postcss-plugins/tree/main/packages/css-tokenizer) to [`2.2.1`](https://github.com/csstools/postcss-plugins/tree/main/packages/css-tokenizer/CHANGELOG.md#221) (patch)
-- Updated [`@csstools/css-parser-algorithms`](https://github.com/csstools/postcss-plugins/tree/main/packages/css-parser-algorithms) to [`2.3.2`](https://github.com/csstools/postcss-plugins/tree/main/packages/css-parser-algorithms/CHANGELOG.md#232) (patch)
-- Updated [`@csstools/css-calc`](https://github.com/csstools/postcss-plugins/tree/main/packages/css-calc) to [`1.1.4`](https://github.com/csstools/postcss-plugins/tree/main/packages/css-calc/CHANGELOG.md#114) (patch)
+- Updated [`@csstools/css-tokenizer`](https://github.com/csstools/postcss-plugins/tree/main/packages/css-tokenizer) to [`2.2.4`](https://github.com/csstools/postcss-plugins/tree/main/packages/css-tokenizer/CHANGELOG.md#224) (patch)
+- Updated [`@csstools/css-parser-algorithms`](https://github.com/csstools/postcss-plugins/tree/main/packages/css-parser-algorithms) to [`2.6.1`](https://github.com/csstools/postcss-plugins/tree/main/packages/css-parser-algorithms/CHANGELOG.md#261) (patch)
+- Updated [`@csstools/css-calc`](https://github.com/csstools/postcss-plugins/tree/main/packages/css-calc) to [`1.2.0`](https://github.com/csstools/postcss-plugins/tree/main/packages/css-calc/CHANGELOG.md#120) (minor)
[Full CHANGELOG](https://github.com/csstools/postcss-plugins/tree/main/plugins/postcss-stepped-value-functions/CHANGELOG.md)
diff --git a/node_modules/@csstools/postcss-stepped-value-functions/package.json b/node_modules/@csstools/postcss-stepped-value-functions/package.json
index b66c8895..acdeac1b 100644
--- a/node_modules/@csstools/postcss-stepped-value-functions/package.json
+++ b/node_modules/@csstools/postcss-stepped-value-functions/package.json
@@ -1,7 +1,7 @@
{
"name": "@csstools/postcss-stepped-value-functions",
"description": "Use round, rem and mod functions in CSS",
- "version": "3.0.4",
+ "version": "3.0.8",
"contributors": [
{
"name": "Antonio Laguna",
@@ -48,9 +48,9 @@
"dist"
],
"dependencies": {
- "@csstools/css-calc": "^1.1.6",
- "@csstools/css-parser-algorithms": "^2.5.0",
- "@csstools/css-tokenizer": "^2.2.3"
+ "@csstools/css-calc": "^1.2.2",
+ "@csstools/css-parser-algorithms": "^2.6.3",
+ "@csstools/css-tokenizer": "^2.3.1"
},
"peerDependencies": {
"postcss": "^8.4"
@@ -58,7 +58,7 @@
"homepage": "https://github.com/csstools/postcss-plugins/tree/main/plugins/postcss-stepped-value-functions#readme",
"repository": {
"type": "git",
- "url": "https://github.com/csstools/postcss-plugins.git",
+ "url": "git+https://github.com/csstools/postcss-plugins.git",
"directory": "plugins/postcss-stepped-value-functions"
},
"bugs": "https://github.com/csstools/postcss-plugins/issues",
diff --git a/node_modules/@csstools/postcss-text-decoration-shorthand/CHANGELOG.md b/node_modules/@csstools/postcss-text-decoration-shorthand/CHANGELOG.md
index 66698668..7e19fbb7 100644
--- a/node_modules/@csstools/postcss-text-decoration-shorthand/CHANGELOG.md
+++ b/node_modules/@csstools/postcss-text-decoration-shorthand/CHANGELOG.md
@@ -1,22 +1,22 @@
# Changes to PostCSS Text Decoration Shorthand
-### 3.0.4
+### 3.0.6
-_December 15, 2023_
+_April 21, 2024_
-- Fix type definitions
-- Updated [`@csstools/color-helpers`](https://github.com/csstools/postcss-plugins/tree/main/packages/color-helpers) to [`4.0.0`](https://github.com/csstools/postcss-plugins/tree/main/packages/color-helpers/CHANGELOG.md#400) (major)
+- Updated [`@csstools/color-helpers`](https://github.com/csstools/postcss-plugins/tree/main/packages/color-helpers) to [`4.2.0`](https://github.com/csstools/postcss-plugins/tree/main/packages/color-helpers/CHANGELOG.md#420) (minor)
-### 3.0.3
+### 3.0.5
-_September 18, 2023_
+_March 31, 2024_
-- Improve performance
+- Updated [`@csstools/color-helpers`](https://github.com/csstools/postcss-plugins/tree/main/packages/color-helpers) to [`4.1.0`](https://github.com/csstools/postcss-plugins/tree/main/packages/color-helpers/CHANGELOG.md#410) (minor)
-### 3.0.2
+### 3.0.4
-_September 2, 2023_
+_December 15, 2023_
-- Updated [`@csstools/color-helpers`](https://github.com/csstools/postcss-plugins/tree/main/packages/color-helpers) to [`3.0.2`](https://github.com/csstools/postcss-plugins/tree/main/packages/color-helpers/CHANGELOG.md#302) (patch)
+- Fix type definitions
+- Updated [`@csstools/color-helpers`](https://github.com/csstools/postcss-plugins/tree/main/packages/color-helpers) to [`4.0.0`](https://github.com/csstools/postcss-plugins/tree/main/packages/color-helpers/CHANGELOG.md#400) (major)
[Full CHANGELOG](https://github.com/csstools/postcss-plugins/tree/main/plugins/postcss-text-decoration-shorthand/CHANGELOG.md)
diff --git a/node_modules/@csstools/postcss-text-decoration-shorthand/README.md b/node_modules/@csstools/postcss-text-decoration-shorthand/README.md
index 4e16d512..774d43b0 100644
--- a/node_modules/@csstools/postcss-text-decoration-shorthand/README.md
+++ b/node_modules/@csstools/postcss-text-decoration-shorthand/README.md
@@ -1,6 +1,6 @@
# PostCSS Text Decoration Shorthand [<img src="https://postcss.github.io/postcss/logo.svg" alt="PostCSS Logo" width="90" height="90" align="right">][PostCSS]
-[<img alt="npm version" src="https://img.shields.io/npm/v/@csstools/postcss-text-decoration-shorthand.svg" height="20">][npm-url] [<img alt="CSS Standard Status" src="https://cssdb.org/images/badges/text-decoration-shorthand.svg" height="20">][css-url] [<img alt="Build Status" src="https://github.com/csstools/postcss-plugins/workflows/test/badge.svg" height="20">][cli-url] [<img alt="Discord" src="https://shields.io/badge/Discord-5865F2?logo=discord&logoColor=white">][discord]
+[<img alt="npm version" src="https://img.shields.io/npm/v/@csstools/postcss-text-decoration-shorthand.svg" height="20">][npm-url] [<img alt="Build Status" src="https://github.com/csstools/postcss-plugins/workflows/test/badge.svg" height="20">][cli-url] [<img alt="Discord" src="https://shields.io/badge/Discord-5865F2?logo=discord&logoColor=white">][discord]<br><br>[<img alt="Baseline Status" src="https://cssdb.org/images/badges-baseline/text-decoration-shorthand.svg" height="20">][css-url] [<img alt="CSS Standard Status" src="https://cssdb.org/images/badges/text-decoration-shorthand.svg" height="20">][css-url]
```bash
npm install @csstools/postcss-text-decoration-shorthand --save-dev
diff --git a/node_modules/@csstools/postcss-text-decoration-shorthand/dist/index.cjs b/node_modules/@csstools/postcss-text-decoration-shorthand/dist/index.cjs
index 44f618a9..804ffc0d 100644
--- a/node_modules/@csstools/postcss-text-decoration-shorthand/dist/index.cjs
+++ b/node_modules/@csstools/postcss-text-decoration-shorthand/dist/index.cjs
@@ -1 +1 @@
-"use strict";var e=require("@csstools/color-helpers"),o=require("postcss-value-parser");const r=/^text-decoration$/i,creator=e=>{const c=Object.assign({preserve:!0},e);return{postcssPlugin:"postcss-text-decoration-shorthand",prepare(){const e=new Map;return{OnceExit:()=>{e.clear()},Declaration:u=>{if(!r.test(u.prop))return;const a=u.parent;if(!a)return;const i=a.index(u);if(a.nodes.some((o=>"decl"===o.type&&r.test(o.prop)&&e.get(u.value)===o.value&&a.index(o)!==i)))return;const d=o(u.value),p=d.nodes.filter((e=>"space"!==e.type&&"comment"!==e.type));if(p.find((e=>"var"===e.value.toLowerCase()&&"function"===e.type)))return;if(p.find((e=>"word"===e.type&&t.includes(e.value))))return;const f={line:[],style:null,color:null,thickness:null};for(let e=0;e<p.length;e++){const r=p[e];if(f.line.length||"word"!==r.type||!n.includes(r.value.toLowerCase()))if(f.line.length||"word"!==r.type||"none"!==r.value.toLowerCase())if(f.style||"word"!==r.type||!s.includes(r.value.toLowerCase()))if(f.thickness||"word"!==r.type||!l.includes(r.value.toLowerCase()))if(f.thickness||"function"!==r.type||"calc"!==r.value.toLowerCase())if(f.color||!nodeIsAColor(r)){if("word"!==r.type)return;{let e;try{e=o.unit(r.value)}catch(e){return}if(!e||!e.unit)return;f.thickness=r,"%"===e.unit&&(f.thickness={before:"",after:"",sourceIndex:0,sourceEndIndex:0,type:"function",value:"calc",nodes:[{before:"",after:"",sourceIndex:0,sourceEndIndex:0,type:"word",value:"0.01em"},{before:"",after:"",sourceIndex:0,sourceEndIndex:0,type:"space",value:" "},{before:"",after:"",sourceIndex:0,sourceEndIndex:0,type:"word",value:"*"},{before:"",after:"",sourceIndex:0,sourceEndIndex:0,type:"space",value:" "},{before:"",after:"",sourceIndex:0,sourceEndIndex:0,type:"word",value:e.number}]})}}else f.color=r;else f.thickness=r;else f.thickness=r;else f.style=r;else f.line.push(r);else{const o=r;let t=r;for(;;){const o=p[e+1];if(!o||"word"!==o.type||!n.includes(o.value.toLowerCase()))break;t=o,e++}f.line=d.nodes.slice(d.nodes.indexOf(o),d.nodes.indexOf(t)+1)}}f.line.length||f.line.push({before:"",after:"",sourceIndex:0,sourceEndIndex:0,type:"word",value:"none"}),f.style||(f.style={before:"",after:"",sourceIndex:0,sourceEndIndex:0,type:"word",value:"solid"}),f.color||(f.color={before:"",after:"",sourceIndex:0,sourceEndIndex:0,type:"word",value:"currentColor"});const v=o.stringify(f.line);if(u.value.toLowerCase()===v.toLowerCase()){const e=u.next();return void(e&&"decl"===e.type&&"text-decoration"===e.prop.toLowerCase()||u.cloneBefore({prop:"-webkit-text-decoration",value:v}))}u.cloneBefore({prop:"text-decoration",value:v});const y=o.stringify([...f.line,{before:"",after:"",sourceIndex:0,sourceEndIndex:0,type:"space",value:" "},f.style,{before:"",after:"",sourceIndex:0,sourceEndIndex:0,type:"space",value:" "},f.color]);f.thickness&&u.cloneBefore({prop:"text-decoration",value:y}),f.thickness&&u.cloneBefore({prop:"text-decoration-thickness",value:o.stringify([f.thickness])}),e.set(u.value,v),e.set(y,v),c.preserve||u.remove()}}}}};function nodeIsAColor(e){return!("word"!==e.type||!e.value.startsWith("#"))||(!("word"!==e.type||!u.includes(e.value.toLowerCase()))||!("function"!==e.type||!c.includes(e.value.toLowerCase())))}creator.postcss=!0;const t=["unset","inherit","initial","revert","revert-layer"],n=["underline","overline","line-through","blink","spelling-error","grammar-error"],s=["solid","double","dotted","dashed","wavy"],l=["auto","from-font"],c=["color","color-mix","hsl","hsla","hwb","lab","lch","oklab","oklch","rgb","rgba"],u=["currentcolor","transparent",...Object.keys(e.namedColors)];module.exports=creator;
+"use strict";var e=require("postcss-value-parser"),o=require("@csstools/color-helpers");const r=/^text-decoration$/i,creator=o=>{const c=Object.assign({preserve:!0},o);return{postcssPlugin:"postcss-text-decoration-shorthand",prepare(){const o=new Map;return{postcssPlugin:"postcss-text-decoration-shorthand",OnceExit(){o.clear()},Declaration(u){if(!r.test(u.prop))return;const a=u.parent;if(!a)return;const i=a.index(u);if(a.nodes.some((e=>"decl"===e.type&&r.test(e.prop)&&o.get(u.value)===e.value&&a.index(e)!==i)))return;const d=e(u.value),p=d.nodes.filter((e=>"space"!==e.type&&"comment"!==e.type));if(p.find((e=>"var"===e.value.toLowerCase()&&"function"===e.type)))return;if(p.find((e=>"word"===e.type&&t.includes(e.value))))return;const f={line:[],style:null,color:null,thickness:null};for(let o=0;o<p.length;o++){const r=p[o];if(f.line.length||"word"!==r.type||!n.includes(r.value.toLowerCase()))if(f.line.length||"word"!==r.type||"none"!==r.value.toLowerCase())if(f.style||"word"!==r.type||!s.includes(r.value.toLowerCase()))if(f.thickness||"word"!==r.type||!l.includes(r.value.toLowerCase()))if(f.thickness||"function"!==r.type||"calc"!==r.value.toLowerCase())if(f.color||!nodeIsAColor(r)){if("word"!==r.type)return;{let o;try{o=e.unit(r.value)}catch(e){return}if(!o||!o.unit)return;f.thickness=r,"%"===o.unit&&(f.thickness={before:"",after:"",sourceIndex:0,sourceEndIndex:0,type:"function",value:"calc",nodes:[{before:"",after:"",sourceIndex:0,sourceEndIndex:0,type:"word",value:"0.01em"},{before:"",after:"",sourceIndex:0,sourceEndIndex:0,type:"space",value:" "},{before:"",after:"",sourceIndex:0,sourceEndIndex:0,type:"word",value:"*"},{before:"",after:"",sourceIndex:0,sourceEndIndex:0,type:"space",value:" "},{before:"",after:"",sourceIndex:0,sourceEndIndex:0,type:"word",value:o.number}]})}}else f.color=r;else f.thickness=r;else f.thickness=r;else f.style=r;else f.line.push(r);else{const e=r;let t=r;for(;;){const e=p[o+1];if(!e||"word"!==e.type||!n.includes(e.value.toLowerCase()))break;t=e,o++}f.line=d.nodes.slice(d.nodes.indexOf(e),d.nodes.indexOf(t)+1)}}f.line.length||f.line.push({before:"",after:"",sourceIndex:0,sourceEndIndex:0,type:"word",value:"none"}),f.style||(f.style={before:"",after:"",sourceIndex:0,sourceEndIndex:0,type:"word",value:"solid"}),f.color||(f.color={before:"",after:"",sourceIndex:0,sourceEndIndex:0,type:"word",value:"currentColor"});const v=e.stringify(f.line);if(u.value.toLowerCase()===v.toLowerCase()){const e=u.next();return void(e&&"decl"===e.type&&"text-decoration"===e.prop.toLowerCase()||u.cloneBefore({prop:"-webkit-text-decoration",value:v}))}u.cloneBefore({prop:"text-decoration",value:v});const y=e.stringify([...f.line,{before:"",after:"",sourceIndex:0,sourceEndIndex:0,type:"space",value:" "},f.style,{before:"",after:"",sourceIndex:0,sourceEndIndex:0,type:"space",value:" "},f.color]);f.thickness&&u.cloneBefore({prop:"text-decoration",value:y}),f.thickness&&u.cloneBefore({prop:"text-decoration-thickness",value:e.stringify([f.thickness])}),o.set(u.value,v),o.set(y,v),c.preserve||u.remove()}}}}};function nodeIsAColor(e){return!("word"!==e.type||!e.value.startsWith("#"))||(!("word"!==e.type||!u.includes(e.value.toLowerCase()))||!("function"!==e.type||!c.includes(e.value.toLowerCase())))}creator.postcss=!0;const t=["unset","inherit","initial","revert","revert-layer"],n=["underline","overline","line-through","blink","spelling-error","grammar-error"],s=["solid","double","dotted","dashed","wavy"],l=["auto","from-font"],c=["color","color-mix","hsl","hsla","hwb","lab","lch","oklab","oklch","rgb","rgba"],u=["currentcolor","transparent",...Object.keys(o.namedColors)];module.exports=creator;
diff --git a/node_modules/@csstools/postcss-text-decoration-shorthand/dist/index.mjs b/node_modules/@csstools/postcss-text-decoration-shorthand/dist/index.mjs
index 09cd53e2..878862d3 100644
--- a/node_modules/@csstools/postcss-text-decoration-shorthand/dist/index.mjs
+++ b/node_modules/@csstools/postcss-text-decoration-shorthand/dist/index.mjs
@@ -1 +1 @@
-import{namedColors as e}from"@csstools/color-helpers";import o from"postcss-value-parser";const r=/^text-decoration$/i,creator=e=>{const c=Object.assign({preserve:!0},e);return{postcssPlugin:"postcss-text-decoration-shorthand",prepare(){const e=new Map;return{OnceExit:()=>{e.clear()},Declaration:a=>{if(!r.test(a.prop))return;const u=a.parent;if(!u)return;const i=u.index(a);if(u.nodes.some((o=>"decl"===o.type&&r.test(o.prop)&&e.get(a.value)===o.value&&u.index(o)!==i)))return;const d=o(a.value),p=d.nodes.filter((e=>"space"!==e.type&&"comment"!==e.type));if(p.find((e=>"var"===e.value.toLowerCase()&&"function"===e.type)))return;if(p.find((e=>"word"===e.type&&t.includes(e.value))))return;const f={line:[],style:null,color:null,thickness:null};for(let e=0;e<p.length;e++){const r=p[e];if(f.line.length||"word"!==r.type||!n.includes(r.value.toLowerCase()))if(f.line.length||"word"!==r.type||"none"!==r.value.toLowerCase())if(f.style||"word"!==r.type||!s.includes(r.value.toLowerCase()))if(f.thickness||"word"!==r.type||!l.includes(r.value.toLowerCase()))if(f.thickness||"function"!==r.type||"calc"!==r.value.toLowerCase())if(f.color||!nodeIsAColor(r)){if("word"!==r.type)return;{let e;try{e=o.unit(r.value)}catch(e){return}if(!e||!e.unit)return;f.thickness=r,"%"===e.unit&&(f.thickness={before:"",after:"",sourceIndex:0,sourceEndIndex:0,type:"function",value:"calc",nodes:[{before:"",after:"",sourceIndex:0,sourceEndIndex:0,type:"word",value:"0.01em"},{before:"",after:"",sourceIndex:0,sourceEndIndex:0,type:"space",value:" "},{before:"",after:"",sourceIndex:0,sourceEndIndex:0,type:"word",value:"*"},{before:"",after:"",sourceIndex:0,sourceEndIndex:0,type:"space",value:" "},{before:"",after:"",sourceIndex:0,sourceEndIndex:0,type:"word",value:e.number}]})}}else f.color=r;else f.thickness=r;else f.thickness=r;else f.style=r;else f.line.push(r);else{const o=r;let t=r;for(;;){const o=p[e+1];if(!o||"word"!==o.type||!n.includes(o.value.toLowerCase()))break;t=o,e++}f.line=d.nodes.slice(d.nodes.indexOf(o),d.nodes.indexOf(t)+1)}}f.line.length||f.line.push({before:"",after:"",sourceIndex:0,sourceEndIndex:0,type:"word",value:"none"}),f.style||(f.style={before:"",after:"",sourceIndex:0,sourceEndIndex:0,type:"word",value:"solid"}),f.color||(f.color={before:"",after:"",sourceIndex:0,sourceEndIndex:0,type:"word",value:"currentColor"});const v=o.stringify(f.line);if(a.value.toLowerCase()===v.toLowerCase()){const e=a.next();return void(e&&"decl"===e.type&&"text-decoration"===e.prop.toLowerCase()||a.cloneBefore({prop:"-webkit-text-decoration",value:v}))}a.cloneBefore({prop:"text-decoration",value:v});const y=o.stringify([...f.line,{before:"",after:"",sourceIndex:0,sourceEndIndex:0,type:"space",value:" "},f.style,{before:"",after:"",sourceIndex:0,sourceEndIndex:0,type:"space",value:" "},f.color]);f.thickness&&a.cloneBefore({prop:"text-decoration",value:y}),f.thickness&&a.cloneBefore({prop:"text-decoration-thickness",value:o.stringify([f.thickness])}),e.set(a.value,v),e.set(y,v),c.preserve||a.remove()}}}}};function nodeIsAColor(e){return!("word"!==e.type||!e.value.startsWith("#"))||(!("word"!==e.type||!a.includes(e.value.toLowerCase()))||!("function"!==e.type||!c.includes(e.value.toLowerCase())))}creator.postcss=!0;const t=["unset","inherit","initial","revert","revert-layer"],n=["underline","overline","line-through","blink","spelling-error","grammar-error"],s=["solid","double","dotted","dashed","wavy"],l=["auto","from-font"],c=["color","color-mix","hsl","hsla","hwb","lab","lch","oklab","oklch","rgb","rgba"],a=["currentcolor","transparent",...Object.keys(e)];export{creator as default};
+import e from"postcss-value-parser";import{namedColors as o}from"@csstools/color-helpers";const r=/^text-decoration$/i,creator=o=>{const c=Object.assign({preserve:!0},o);return{postcssPlugin:"postcss-text-decoration-shorthand",prepare(){const o=new Map;return{postcssPlugin:"postcss-text-decoration-shorthand",OnceExit(){o.clear()},Declaration(a){if(!r.test(a.prop))return;const u=a.parent;if(!u)return;const i=u.index(a);if(u.nodes.some((e=>"decl"===e.type&&r.test(e.prop)&&o.get(a.value)===e.value&&u.index(e)!==i)))return;const d=e(a.value),p=d.nodes.filter((e=>"space"!==e.type&&"comment"!==e.type));if(p.find((e=>"var"===e.value.toLowerCase()&&"function"===e.type)))return;if(p.find((e=>"word"===e.type&&t.includes(e.value))))return;const f={line:[],style:null,color:null,thickness:null};for(let o=0;o<p.length;o++){const r=p[o];if(f.line.length||"word"!==r.type||!n.includes(r.value.toLowerCase()))if(f.line.length||"word"!==r.type||"none"!==r.value.toLowerCase())if(f.style||"word"!==r.type||!s.includes(r.value.toLowerCase()))if(f.thickness||"word"!==r.type||!l.includes(r.value.toLowerCase()))if(f.thickness||"function"!==r.type||"calc"!==r.value.toLowerCase())if(f.color||!nodeIsAColor(r)){if("word"!==r.type)return;{let o;try{o=e.unit(r.value)}catch(e){return}if(!o||!o.unit)return;f.thickness=r,"%"===o.unit&&(f.thickness={before:"",after:"",sourceIndex:0,sourceEndIndex:0,type:"function",value:"calc",nodes:[{before:"",after:"",sourceIndex:0,sourceEndIndex:0,type:"word",value:"0.01em"},{before:"",after:"",sourceIndex:0,sourceEndIndex:0,type:"space",value:" "},{before:"",after:"",sourceIndex:0,sourceEndIndex:0,type:"word",value:"*"},{before:"",after:"",sourceIndex:0,sourceEndIndex:0,type:"space",value:" "},{before:"",after:"",sourceIndex:0,sourceEndIndex:0,type:"word",value:o.number}]})}}else f.color=r;else f.thickness=r;else f.thickness=r;else f.style=r;else f.line.push(r);else{const e=r;let t=r;for(;;){const e=p[o+1];if(!e||"word"!==e.type||!n.includes(e.value.toLowerCase()))break;t=e,o++}f.line=d.nodes.slice(d.nodes.indexOf(e),d.nodes.indexOf(t)+1)}}f.line.length||f.line.push({before:"",after:"",sourceIndex:0,sourceEndIndex:0,type:"word",value:"none"}),f.style||(f.style={before:"",after:"",sourceIndex:0,sourceEndIndex:0,type:"word",value:"solid"}),f.color||(f.color={before:"",after:"",sourceIndex:0,sourceEndIndex:0,type:"word",value:"currentColor"});const v=e.stringify(f.line);if(a.value.toLowerCase()===v.toLowerCase()){const e=a.next();return void(e&&"decl"===e.type&&"text-decoration"===e.prop.toLowerCase()||a.cloneBefore({prop:"-webkit-text-decoration",value:v}))}a.cloneBefore({prop:"text-decoration",value:v});const y=e.stringify([...f.line,{before:"",after:"",sourceIndex:0,sourceEndIndex:0,type:"space",value:" "},f.style,{before:"",after:"",sourceIndex:0,sourceEndIndex:0,type:"space",value:" "},f.color]);f.thickness&&a.cloneBefore({prop:"text-decoration",value:y}),f.thickness&&a.cloneBefore({prop:"text-decoration-thickness",value:e.stringify([f.thickness])}),o.set(a.value,v),o.set(y,v),c.preserve||a.remove()}}}}};function nodeIsAColor(e){return!("word"!==e.type||!e.value.startsWith("#"))||(!("word"!==e.type||!a.includes(e.value.toLowerCase()))||!("function"!==e.type||!c.includes(e.value.toLowerCase())))}creator.postcss=!0;const t=["unset","inherit","initial","revert","revert-layer"],n=["underline","overline","line-through","blink","spelling-error","grammar-error"],s=["solid","double","dotted","dashed","wavy"],l=["auto","from-font"],c=["color","color-mix","hsl","hsla","hwb","lab","lch","oklab","oklch","rgb","rgba"],a=["currentcolor","transparent",...Object.keys(o)];export{creator as default};
diff --git a/node_modules/@csstools/postcss-text-decoration-shorthand/package.json b/node_modules/@csstools/postcss-text-decoration-shorthand/package.json
index c8dc9de4..9d08cd3d 100644
--- a/node_modules/@csstools/postcss-text-decoration-shorthand/package.json
+++ b/node_modules/@csstools/postcss-text-decoration-shorthand/package.json
@@ -1,7 +1,7 @@
{
"name": "@csstools/postcss-text-decoration-shorthand",
"description": "Use text-decoration in it's shorthand form in CSS",
- "version": "3.0.4",
+ "version": "3.0.6",
"contributors": [
{
"name": "Antonio Laguna",
@@ -48,7 +48,7 @@
"dist"
],
"dependencies": {
- "@csstools/color-helpers": "^4.0.0",
+ "@csstools/color-helpers": "^4.2.0",
"postcss-value-parser": "^4.2.0"
},
"peerDependencies": {
@@ -57,7 +57,7 @@
"homepage": "https://github.com/csstools/postcss-plugins/tree/main/plugins/postcss-text-decoration-shorthand#readme",
"repository": {
"type": "git",
- "url": "https://github.com/csstools/postcss-plugins.git",
+ "url": "git+https://github.com/csstools/postcss-plugins.git",
"directory": "plugins/postcss-text-decoration-shorthand"
},
"bugs": "https://github.com/csstools/postcss-plugins/issues",
diff --git a/node_modules/@csstools/postcss-trigonometric-functions/CHANGELOG.md b/node_modules/@csstools/postcss-trigonometric-functions/CHANGELOG.md
index ba355eec..e9c215b2 100644
--- a/node_modules/@csstools/postcss-trigonometric-functions/CHANGELOG.md
+++ b/node_modules/@csstools/postcss-trigonometric-functions/CHANGELOG.md
@@ -1,28 +1,27 @@
# Changes to PostCSS Trigonometric Functions
-### 3.0.4
+### 3.0.8
-_December 31, 2023_
+_May 4, 2024_
-- Updated [`@csstools/css-tokenizer`](https://github.com/csstools/postcss-plugins/tree/main/packages/css-tokenizer) to [`2.2.3`](https://github.com/csstools/postcss-plugins/tree/main/packages/css-tokenizer/CHANGELOG.md#223) (patch)
-- Updated [`@csstools/css-parser-algorithms`](https://github.com/csstools/postcss-plugins/tree/main/packages/css-parser-algorithms) to [`2.5.0`](https://github.com/csstools/postcss-plugins/tree/main/packages/css-parser-algorithms/CHANGELOG.md#250) (minor)
-- Updated [`@csstools/css-calc`](https://github.com/csstools/postcss-plugins/tree/main/packages/css-calc) to [`1.1.6`](https://github.com/csstools/postcss-plugins/tree/main/packages/css-calc/CHANGELOG.md#116) (patch)
+- Updated [`@csstools/css-tokenizer`](https://github.com/csstools/postcss-plugins/tree/main/packages/css-tokenizer) to [`2.3.1`](https://github.com/csstools/postcss-plugins/tree/main/packages/css-tokenizer/CHANGELOG.md#231) (patch)
+- Updated [`@csstools/css-parser-algorithms`](https://github.com/csstools/postcss-plugins/tree/main/packages/css-parser-algorithms) to [`2.6.3`](https://github.com/csstools/postcss-plugins/tree/main/packages/css-parser-algorithms/CHANGELOG.md#263) (patch)
+- Updated [`@csstools/css-calc`](https://github.com/csstools/postcss-plugins/tree/main/packages/css-calc) to [`1.2.2`](https://github.com/csstools/postcss-plugins/tree/main/packages/css-calc/CHANGELOG.md#122) (patch)
-### 3.0.3
+### 3.0.7
-_December 15, 2023_
+_May 4, 2024_
-- Fix type definitions
-- Updated [`@csstools/css-tokenizer`](https://github.com/csstools/postcss-plugins/tree/main/packages/css-tokenizer) to [`2.2.2`](https://github.com/csstools/postcss-plugins/tree/main/packages/css-tokenizer/CHANGELOG.md#222) (patch)
-- Updated [`@csstools/css-parser-algorithms`](https://github.com/csstools/postcss-plugins/tree/main/packages/css-parser-algorithms) to [`2.4.0`](https://github.com/csstools/postcss-plugins/tree/main/packages/css-parser-algorithms/CHANGELOG.md#240) (minor)
-- Updated [`@csstools/css-calc`](https://github.com/csstools/postcss-plugins/tree/main/packages/css-calc) to [`1.1.5`](https://github.com/csstools/postcss-plugins/tree/main/packages/css-calc/CHANGELOG.md#115) (patch)
+- Updated [`@csstools/css-tokenizer`](https://github.com/csstools/postcss-plugins/tree/main/packages/css-tokenizer) to [`2.3.0`](https://github.com/csstools/postcss-plugins/tree/main/packages/css-tokenizer/CHANGELOG.md#230) (minor)
+- Updated [`@csstools/css-parser-algorithms`](https://github.com/csstools/postcss-plugins/tree/main/packages/css-parser-algorithms) to [`2.6.2`](https://github.com/csstools/postcss-plugins/tree/main/packages/css-parser-algorithms/CHANGELOG.md#262) (patch)
+- Updated [`@csstools/css-calc`](https://github.com/csstools/postcss-plugins/tree/main/packages/css-calc) to [`1.2.1`](https://github.com/csstools/postcss-plugins/tree/main/packages/css-calc/CHANGELOG.md#121) (patch)
-### 3.0.2
+### 3.0.6
-_September 24, 2023_
+_March 13, 2024_
-- Updated [`@csstools/css-tokenizer`](https://github.com/csstools/postcss-plugins/tree/main/packages/css-tokenizer) to [`2.2.1`](https://github.com/csstools/postcss-plugins/tree/main/packages/css-tokenizer/CHANGELOG.md#221) (patch)
-- Updated [`@csstools/css-parser-algorithms`](https://github.com/csstools/postcss-plugins/tree/main/packages/css-parser-algorithms) to [`2.3.2`](https://github.com/csstools/postcss-plugins/tree/main/packages/css-parser-algorithms/CHANGELOG.md#232) (patch)
-- Updated [`@csstools/css-calc`](https://github.com/csstools/postcss-plugins/tree/main/packages/css-calc) to [`1.1.4`](https://github.com/csstools/postcss-plugins/tree/main/packages/css-calc/CHANGELOG.md#114) (patch)
+- Updated [`@csstools/css-tokenizer`](https://github.com/csstools/postcss-plugins/tree/main/packages/css-tokenizer) to [`2.2.4`](https://github.com/csstools/postcss-plugins/tree/main/packages/css-tokenizer/CHANGELOG.md#224) (patch)
+- Updated [`@csstools/css-parser-algorithms`](https://github.com/csstools/postcss-plugins/tree/main/packages/css-parser-algorithms) to [`2.6.1`](https://github.com/csstools/postcss-plugins/tree/main/packages/css-parser-algorithms/CHANGELOG.md#261) (patch)
+- Updated [`@csstools/css-calc`](https://github.com/csstools/postcss-plugins/tree/main/packages/css-calc) to [`1.2.0`](https://github.com/csstools/postcss-plugins/tree/main/packages/css-calc/CHANGELOG.md#120) (minor)
[Full CHANGELOG](https://github.com/csstools/postcss-plugins/tree/main/plugins/postcss-trigonometric-functions/CHANGELOG.md)
diff --git a/node_modules/@csstools/postcss-trigonometric-functions/package.json b/node_modules/@csstools/postcss-trigonometric-functions/package.json
index a3d0f898..4398ff05 100644
--- a/node_modules/@csstools/postcss-trigonometric-functions/package.json
+++ b/node_modules/@csstools/postcss-trigonometric-functions/package.json
@@ -1,7 +1,7 @@
{
"name": "@csstools/postcss-trigonometric-functions",
"description": "Use sin(), cos(), tan(), acos(), atan(), and atan2() to compute trigonometric relationships",
- "version": "3.0.4",
+ "version": "3.0.8",
"contributors": [
{
"name": "Antonio Laguna",
@@ -48,9 +48,9 @@
"dist"
],
"dependencies": {
- "@csstools/css-calc": "^1.1.6",
- "@csstools/css-parser-algorithms": "^2.5.0",
- "@csstools/css-tokenizer": "^2.2.3"
+ "@csstools/css-calc": "^1.2.2",
+ "@csstools/css-parser-algorithms": "^2.6.3",
+ "@csstools/css-tokenizer": "^2.3.1"
},
"peerDependencies": {
"postcss": "^8.4"
@@ -58,7 +58,7 @@
"homepage": "https://github.com/csstools/postcss-plugins/tree/main/plugins/postcss-trigonometric-functions#readme",
"repository": {
"type": "git",
- "url": "https://github.com/csstools/postcss-plugins.git",
+ "url": "git+https://github.com/csstools/postcss-plugins.git",
"directory": "plugins/postcss-trigonometric-functions"
},
"bugs": "https://github.com/csstools/postcss-plugins/issues",
diff --git a/node_modules/@csstools/selector-specificity/CHANGELOG.md b/node_modules/@csstools/selector-specificity/CHANGELOG.md
index 8cf61c3e..c3ca9230 100644
--- a/node_modules/@csstools/selector-specificity/CHANGELOG.md
+++ b/node_modules/@csstools/selector-specificity/CHANGELOG.md
@@ -1,29 +1,24 @@
# Changes to Selector Specificity
-### 3.0.1
+### 3.1.1
-_December 15, 2023_
+_May 13, 2024_
-- Add support for:
- - `:active-view-transition(*)`
- - `:active-view-transition(name)`
+- Prevent mutation of selectors with An+B microsyntax (e.g. `:nth-child(2n+1 of .foo)`) during specificity calculation
-### 3.0.0
+### 3.1.0
-_July 3, 2023_
+_May 11, 2024_
-- Change license to `MIT-0` ([read more about this change in the blog post](https://preset-env.cssdb.org/blog/license-change/))
+- Add an option to `selectorSpecificity` and `specificityOfMostSpecificListItem` to customize the calculation
+- Add `specificityOfMostSpecificListItem` as an exported function
-### 2.2.0
+### 3.0.3
-_March 21, 2023_
+_March 31, 2024_
-- Improve case insensitive string matching.
- Add support for:
- - `::view-transition`
- - `::view-transition-group(*)` and `::view-transition-group(name)`
- - `::view-transition-image-par(*)` and `::view-transition-image-par(name)`
- - `::view-transition-old(*)` and `::view-transition-old(name)`
- - `::view-transition-new(*)` and `::view-transition-new(name)`
+ - `:active-view-transition`
+ - `:active-view-transition-type(foo)`
[Full CHANGELOG](https://github.com/csstools/postcss-plugins/tree/main/packages/selector-specificity/CHANGELOG.md)
diff --git a/node_modules/@csstools/selector-specificity/dist/index.cjs b/node_modules/@csstools/selector-specificity/dist/index.cjs
index 7139faff..22f96490 100644
--- a/node_modules/@csstools/selector-specificity/dist/index.cjs
+++ b/node_modules/@csstools/selector-specificity/dist/index.cjs
@@ -1 +1 @@
-"use strict";var e=require("postcss-selector-parser");const s=/[A-Z]/g;function toLowerCaseAZ(e){return e.replace(s,(e=>String.fromCharCode(e.charCodeAt(0)+32)))}function selectorSpecificity(s){if(!s)return{a:0,b:0,c:0};let t=0,c=0,n=0;if("universal"==s.type)return{a:0,b:0,c:0};if("id"===s.type)t+=1;else if("tag"===s.type)n+=1;else if("class"===s.type)c+=1;else if("attribute"===s.type)c+=1;else if(isPseudoElement(s))switch(toLowerCaseAZ(s.value)){case"::slotted":if(n+=1,s.nodes&&s.nodes.length>0){const e=specificityOfMostSpecificListItem(s.nodes);t+=e.a,c+=e.b,n+=e.c}break;case"::view-transition-group":case"::view-transition-image-pair":case"::view-transition-old":case"::view-transition-new":return s.nodes&&1===s.nodes.length&&"selector"===s.nodes[0].type&&selectorNodeContainsOnlyUniversal(s.nodes[0])?{a:0,b:0,c:0}:{a:0,b:0,c:1};default:n+=1}else if(e.isPseudoClass(s))switch(toLowerCaseAZ(s.value)){case":-moz-any":case":-webkit-any":case":any":case":has":case":is":case":matches":case":not":if(s.nodes&&s.nodes.length>0){const e=specificityOfMostSpecificListItem(s.nodes);t+=e.a,c+=e.b,n+=e.c}break;case":where":break;case":nth-child":case":nth-last-child":if(c+=1,s.nodes&&s.nodes.length>0){const i=s.nodes[0].nodes.findIndex((e=>"tag"===e.type&&"of"===toLowerCaseAZ(e.value)));if(i>-1){const o=[e.selector({nodes:s.nodes[0].nodes.slice(i+1),value:""})];s.nodes.length>1&&o.push(...s.nodes.slice(1));const a=specificityOfMostSpecificListItem(o);t+=a.a,c+=a.b,n+=a.c}}break;case":local":case":global":s.nodes&&s.nodes.length>0&&s.nodes.forEach((e=>{const s=selectorSpecificity(e);t+=s.a,c+=s.b,n+=s.c}));break;case":host":case":host-context":if(c+=1,s.nodes&&s.nodes.length>0){const e=specificityOfMostSpecificListItem(s.nodes);t+=e.a,c+=e.b,n+=e.c}break;case":active-view-transition":return s.nodes&&1===s.nodes.length&&"selector"===s.nodes[0].type&&selectorNodeContainsOnlyUniversal(s.nodes[0])?{a:0,b:1,c:0}:{a:0,b:2,c:0};default:c+=1}else e.isContainer(s)&&s.nodes.length>0&&s.nodes.forEach((e=>{const s=selectorSpecificity(e);t+=s.a,c+=s.b,n+=s.c}));return{a:t,b:c,c:n}}function specificityOfMostSpecificListItem(e){let s={a:0,b:0,c:0};return e.forEach((e=>{const t=selectorSpecificity(e);t.a>s.a?s=t:t.a<s.a||(t.b>s.b?s=t:t.b<s.b||t.c>s.c&&(s=t))})),s}function isPseudoElement(s){return e.isPseudoElement(s)}function selectorNodeContainsOnlyUniversal(e){if(!e)return!1;if(!e.nodes)return!1;const s=e.nodes.filter((e=>"comment"!==e.type));return 1===s.length&&"universal"===s[0].type}exports.compare=function compare(e,s){return e.a===s.a?e.b===s.b?e.c-s.c:e.b-s.b:e.a-s.a},exports.selectorSpecificity=selectorSpecificity;
+"use strict";var e=require("postcss-selector-parser");function compare(e,t){return e.a===t.a?e.b===t.b?e.c-t.c:e.b-t.b:e.a-t.a}function selectorSpecificity(t,s){const i=s?.customSpecificity?.(t);if(i)return i;if(!t)return{a:0,b:0,c:0};let c=0,n=0,o=0;if("universal"==t.type)return{a:0,b:0,c:0};if("id"===t.type)c+=1;else if("tag"===t.type)o+=1;else if("class"===t.type)n+=1;else if("attribute"===t.type)n+=1;else if(isPseudoElement(t))switch(t.value.toLowerCase()){case"::slotted":if(o+=1,t.nodes&&t.nodes.length>0){const e=specificityOfMostSpecificListItem(t.nodes,s);c+=e.a,n+=e.b,o+=e.c}break;case"::view-transition-group":case"::view-transition-image-pair":case"::view-transition-old":case"::view-transition-new":return t.nodes&&1===t.nodes.length&&"selector"===t.nodes[0].type&&selectorNodeContainsNothingOrOnlyUniversal(t.nodes[0])?{a:0,b:0,c:0}:{a:0,b:0,c:1};default:o+=1}else if(e.isPseudoClass(t))switch(t.value.toLowerCase()){case":-webkit-any":case":any":default:n+=1;break;case":-moz-any":case":has":case":is":case":matches":case":not":if(t.nodes&&t.nodes.length>0){const e=specificityOfMostSpecificListItem(t.nodes,s);c+=e.a,n+=e.b,o+=e.c}break;case":where":break;case":nth-child":case":nth-last-child":if(n+=1,t.nodes&&t.nodes.length>0){const i=t.nodes[0].nodes.findIndex((e=>"tag"===e.type&&"of"===e.value.toLowerCase()));if(i>-1){const a=e.selector({nodes:[],value:""});t.nodes[0].nodes.slice(i+1).forEach((e=>{a.append(e.clone())}));const r=[a];t.nodes.length>1&&r.push(...t.nodes.slice(1));const l=specificityOfMostSpecificListItem(r,s);c+=l.a,n+=l.b,o+=l.c}}break;case":local":case":global":t.nodes&&t.nodes.length>0&&t.nodes.forEach((e=>{const t=selectorSpecificity(e,s);c+=t.a,n+=t.b,o+=t.c}));break;case":host":case":host-context":if(n+=1,t.nodes&&t.nodes.length>0){const e=specificityOfMostSpecificListItem(t.nodes,s);c+=e.a,n+=e.b,o+=e.c}break;case":active-view-transition":case":active-view-transition-type":return{a:0,b:1,c:0}}else e.isContainer(t)&&t.nodes?.length>0&&t.nodes.forEach((e=>{const t=selectorSpecificity(e,s);c+=t.a,n+=t.b,o+=t.c}));return{a:c,b:n,c:o}}function specificityOfMostSpecificListItem(e,t){let s={a:0,b:0,c:0};return e.forEach((e=>{const i=selectorSpecificity(e,t);compare(i,s)<0||(s=i)})),s}function isPseudoElement(t){return e.isPseudoElement(t)}function selectorNodeContainsNothingOrOnlyUniversal(e){if(!e)return!1;if(!e.nodes)return!1;const t=e.nodes.filter((e=>"comment"!==e.type));return 0===t.length||1===t.length&&"universal"===t[0].type}exports.compare=compare,exports.selectorSpecificity=selectorSpecificity,exports.specificityOfMostSpecificListItem=specificityOfMostSpecificListItem;
diff --git a/node_modules/@csstools/selector-specificity/dist/index.d.ts b/node_modules/@csstools/selector-specificity/dist/index.d.ts
index 90606de1..f3f959d3 100644
--- a/node_modules/@csstools/selector-specificity/dist/index.d.ts
+++ b/node_modules/@csstools/selector-specificity/dist/index.d.ts
@@ -1,10 +1,55 @@
import type { Node } from 'postcss-selector-parser';
+/**
+ * Options for the calculation of the specificity of a selector
+ */
+export declare type CalculationOptions = {
+ /**
+ * The callback to calculate a custom specificity for a node
+ */
+ customSpecificity?: CustomSpecificityCallback;
+};
+
+/**
+ * Compare two specificities
+ * @param s1 The first specificity
+ * @param s2 The second specificity
+ * @returns A value smaller than `0` if `s1` is less specific than `s2`, `0` if `s1` is equally specific as `s2`, a value larger than `0` if `s1` is more specific than `s2`
+ */
export declare function compare(s1: Specificity, s2: Specificity): number;
-export declare function selectorSpecificity(node: Node): Specificity;
+/**
+ * Calculate a custom specificity for a node
+ */
+export declare type CustomSpecificityCallback = (node: Node) => Specificity | void | false | null | undefined;
+/**
+ * Calculate the specificity for a selector
+ */
+export declare function selectorSpecificity(node: Node, options?: CalculationOptions): Specificity;
+
+/**
+ * The specificity of a selector
+ */
export declare type Specificity = {
+ /**
+ * The number of ID selectors in the selector
+ */
+ a: number;
+ /**
+ * The number of class selectors, attribute selectors, and pseudo-classes in the selector
+ */
+ b: number;
+ /**
+ * The number of type selectors and pseudo-elements in the selector
+ */
+ c: number;
+};
+
+/**
+ * Calculate the most specific selector in a list
+ */
+export declare function specificityOfMostSpecificListItem(nodes: Array<Node>, options?: CalculationOptions): {
a: number;
b: number;
c: number;
diff --git a/node_modules/@csstools/selector-specificity/dist/index.mjs b/node_modules/@csstools/selector-specificity/dist/index.mjs
index 83be7cda..b6c4e1cb 100644
--- a/node_modules/@csstools/selector-specificity/dist/index.mjs
+++ b/node_modules/@csstools/selector-specificity/dist/index.mjs
@@ -1 +1 @@
-import e from"postcss-selector-parser";const s=/[A-Z]/g;function toLowerCaseAZ(e){return e.replace(s,(e=>String.fromCharCode(e.charCodeAt(0)+32)))}function compare(e,s){return e.a===s.a?e.b===s.b?e.c-s.c:e.b-s.b:e.a-s.a}function selectorSpecificity(s){if(!s)return{a:0,b:0,c:0};let t=0,n=0,c=0;if("universal"==s.type)return{a:0,b:0,c:0};if("id"===s.type)t+=1;else if("tag"===s.type)c+=1;else if("class"===s.type)n+=1;else if("attribute"===s.type)n+=1;else if(isPseudoElement(s))switch(toLowerCaseAZ(s.value)){case"::slotted":if(c+=1,s.nodes&&s.nodes.length>0){const e=specificityOfMostSpecificListItem(s.nodes);t+=e.a,n+=e.b,c+=e.c}break;case"::view-transition-group":case"::view-transition-image-pair":case"::view-transition-old":case"::view-transition-new":return s.nodes&&1===s.nodes.length&&"selector"===s.nodes[0].type&&selectorNodeContainsOnlyUniversal(s.nodes[0])?{a:0,b:0,c:0}:{a:0,b:0,c:1};default:c+=1}else if(e.isPseudoClass(s))switch(toLowerCaseAZ(s.value)){case":-moz-any":case":-webkit-any":case":any":case":has":case":is":case":matches":case":not":if(s.nodes&&s.nodes.length>0){const e=specificityOfMostSpecificListItem(s.nodes);t+=e.a,n+=e.b,c+=e.c}break;case":where":break;case":nth-child":case":nth-last-child":if(n+=1,s.nodes&&s.nodes.length>0){const o=s.nodes[0].nodes.findIndex((e=>"tag"===e.type&&"of"===toLowerCaseAZ(e.value)));if(o>-1){const i=[e.selector({nodes:s.nodes[0].nodes.slice(o+1),value:""})];s.nodes.length>1&&i.push(...s.nodes.slice(1));const a=specificityOfMostSpecificListItem(i);t+=a.a,n+=a.b,c+=a.c}}break;case":local":case":global":s.nodes&&s.nodes.length>0&&s.nodes.forEach((e=>{const s=selectorSpecificity(e);t+=s.a,n+=s.b,c+=s.c}));break;case":host":case":host-context":if(n+=1,s.nodes&&s.nodes.length>0){const e=specificityOfMostSpecificListItem(s.nodes);t+=e.a,n+=e.b,c+=e.c}break;case":active-view-transition":return s.nodes&&1===s.nodes.length&&"selector"===s.nodes[0].type&&selectorNodeContainsOnlyUniversal(s.nodes[0])?{a:0,b:1,c:0}:{a:0,b:2,c:0};default:n+=1}else e.isContainer(s)&&s.nodes.length>0&&s.nodes.forEach((e=>{const s=selectorSpecificity(e);t+=s.a,n+=s.b,c+=s.c}));return{a:t,b:n,c:c}}function specificityOfMostSpecificListItem(e){let s={a:0,b:0,c:0};return e.forEach((e=>{const t=selectorSpecificity(e);t.a>s.a?s=t:t.a<s.a||(t.b>s.b?s=t:t.b<s.b||t.c>s.c&&(s=t))})),s}function isPseudoElement(s){return e.isPseudoElement(s)}function selectorNodeContainsOnlyUniversal(e){if(!e)return!1;if(!e.nodes)return!1;const s=e.nodes.filter((e=>"comment"!==e.type));return 1===s.length&&"universal"===s[0].type}export{compare,selectorSpecificity};
+import e from"postcss-selector-parser";function compare(e,t){return e.a===t.a?e.b===t.b?e.c-t.c:e.b-t.b:e.a-t.a}function selectorSpecificity(t,s){const i=s?.customSpecificity?.(t);if(i)return i;if(!t)return{a:0,b:0,c:0};let c=0,n=0,o=0;if("universal"==t.type)return{a:0,b:0,c:0};if("id"===t.type)c+=1;else if("tag"===t.type)o+=1;else if("class"===t.type)n+=1;else if("attribute"===t.type)n+=1;else if(isPseudoElement(t))switch(t.value.toLowerCase()){case"::slotted":if(o+=1,t.nodes&&t.nodes.length>0){const e=specificityOfMostSpecificListItem(t.nodes,s);c+=e.a,n+=e.b,o+=e.c}break;case"::view-transition-group":case"::view-transition-image-pair":case"::view-transition-old":case"::view-transition-new":return t.nodes&&1===t.nodes.length&&"selector"===t.nodes[0].type&&selectorNodeContainsNothingOrOnlyUniversal(t.nodes[0])?{a:0,b:0,c:0}:{a:0,b:0,c:1};default:o+=1}else if(e.isPseudoClass(t))switch(t.value.toLowerCase()){case":-webkit-any":case":any":default:n+=1;break;case":-moz-any":case":has":case":is":case":matches":case":not":if(t.nodes&&t.nodes.length>0){const e=specificityOfMostSpecificListItem(t.nodes,s);c+=e.a,n+=e.b,o+=e.c}break;case":where":break;case":nth-child":case":nth-last-child":if(n+=1,t.nodes&&t.nodes.length>0){const i=t.nodes[0].nodes.findIndex((e=>"tag"===e.type&&"of"===e.value.toLowerCase()));if(i>-1){const a=e.selector({nodes:[],value:""});t.nodes[0].nodes.slice(i+1).forEach((e=>{a.append(e.clone())}));const r=[a];t.nodes.length>1&&r.push(...t.nodes.slice(1));const l=specificityOfMostSpecificListItem(r,s);c+=l.a,n+=l.b,o+=l.c}}break;case":local":case":global":t.nodes&&t.nodes.length>0&&t.nodes.forEach((e=>{const t=selectorSpecificity(e,s);c+=t.a,n+=t.b,o+=t.c}));break;case":host":case":host-context":if(n+=1,t.nodes&&t.nodes.length>0){const e=specificityOfMostSpecificListItem(t.nodes,s);c+=e.a,n+=e.b,o+=e.c}break;case":active-view-transition":case":active-view-transition-type":return{a:0,b:1,c:0}}else e.isContainer(t)&&t.nodes?.length>0&&t.nodes.forEach((e=>{const t=selectorSpecificity(e,s);c+=t.a,n+=t.b,o+=t.c}));return{a:c,b:n,c:o}}function specificityOfMostSpecificListItem(e,t){let s={a:0,b:0,c:0};return e.forEach((e=>{const i=selectorSpecificity(e,t);compare(i,s)<0||(s=i)})),s}function isPseudoElement(t){return e.isPseudoElement(t)}function selectorNodeContainsNothingOrOnlyUniversal(e){if(!e)return!1;if(!e.nodes)return!1;const t=e.nodes.filter((e=>"comment"!==e.type));return 0===t.length||1===t.length&&"universal"===t[0].type}export{compare,selectorSpecificity,specificityOfMostSpecificListItem};
diff --git a/node_modules/@csstools/selector-specificity/package.json b/node_modules/@csstools/selector-specificity/package.json
index 4d5fcfd7..ce426825 100644
--- a/node_modules/@csstools/selector-specificity/package.json
+++ b/node_modules/@csstools/selector-specificity/package.json
@@ -1,7 +1,7 @@
{
"name": "@csstools/selector-specificity",
"description": "Determine selector specificity with postcss-selector-parser",
- "version": "3.0.1",
+ "version": "3.1.1",
"contributors": [
{
"name": "Antonio Laguna",
@@ -53,7 +53,7 @@
"homepage": "https://github.com/csstools/postcss-plugins/tree/main/packages/selector-specificity#readme",
"repository": {
"type": "git",
- "url": "https://github.com/csstools/postcss-plugins.git",
+ "url": "git+https://github.com/csstools/postcss-plugins.git",
"directory": "packages/selector-specificity"
},
"bugs": "https://github.com/csstools/postcss-plugins/issues",