@mkbabb/keyframes.js 1.1.0 → 1.1.5
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +208 -214
- package/dist/assets/CSSCodeEditor.vue_vue_type_script_setup_true_lang-DoeFo9B0.js +15 -0
- package/dist/assets/KeyframeTimeline-DCuTtSyj.js +3 -0
- package/dist/assets/KeyframeTimeline-Jb8HiEJ9.css +1 -0
- package/dist/assets/KeyframesStringControls-gfJd8pQq.js +6 -0
- package/dist/assets/codicon-DCmgc-ay.ttf +0 -0
- package/dist/assets/css.worker-DaIVPe4I.js +78 -0
- package/dist/assets/cube-CrhWuGpy.png +0 -0
- package/dist/assets/editor.worker-D_e4rV1K.js +11 -0
- package/dist/assets/html2canvas.esm-DXEQVQnt.js +5 -0
- package/dist/assets/index-BV83975F.css +1 -0
- package/dist/assets/index-DJ_IAlfb.js +651 -0
- package/dist/assets/ppmycota-logo-2-CAWHh5aE.svg +5 -0
- package/dist/assets/ppmycota-logo-3-BIN0nMRd.svg +5 -0
- package/dist/assets/vendor-highlight-CTbb6sRM.js +1 -0
- package/dist/assets/vendor-monaco-BS62pb6i.js +1035 -0
- package/dist/assets/vendor-monaco-bo9aZu7E.css +1 -0
- package/dist/assets/vendor-prettier-CT2Eqd5k.js +89 -0
- package/dist/index.html +20 -0
- package/package.json +5 -3
- package/dist/keyframes.cjs +0 -15
- package/dist/keyframes.d.ts +0 -213
- package/dist/keyframes.js +0 -5116
package/dist/index.html
ADDED
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
<!doctype html>
|
|
2
|
+
<html lang="en">
|
|
3
|
+
<head>
|
|
4
|
+
<meta charset="UTF-8" />
|
|
5
|
+
<meta http-equiv="X-UA-Compatible" content="IE=edge" />
|
|
6
|
+
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
|
|
7
|
+
<title>Cube Transforms</title>
|
|
8
|
+
<link rel="icon" href="./assets/cube-CrhWuGpy.png" />
|
|
9
|
+
|
|
10
|
+
<script type="module" crossorigin src="./assets/index-DJ_IAlfb.js"></script>
|
|
11
|
+
<link rel="modulepreload" crossorigin href="./assets/vendor-highlight-CTbb6sRM.js">
|
|
12
|
+
<link rel="modulepreload" crossorigin href="./assets/vendor-monaco-BS62pb6i.js">
|
|
13
|
+
<link rel="stylesheet" crossorigin href="./assets/vendor-monaco-bo9aZu7E.css">
|
|
14
|
+
<link rel="stylesheet" crossorigin href="./assets/index-BV83975F.css">
|
|
15
|
+
</head>
|
|
16
|
+
|
|
17
|
+
<body>
|
|
18
|
+
<div style="display: contents" id="app"></div>
|
|
19
|
+
</body>
|
|
20
|
+
</html>
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@mkbabb/keyframes.js",
|
|
3
|
-
"version": "1.1.
|
|
3
|
+
"version": "1.1.5",
|
|
4
4
|
"description": "Create keyframe animations for anything in JavaScript; specify your keyframes in standards-complaint CSS.",
|
|
5
5
|
"licenses": [
|
|
6
6
|
{
|
|
@@ -34,7 +34,8 @@
|
|
|
34
34
|
"dist"
|
|
35
35
|
],
|
|
36
36
|
"scripts": {
|
|
37
|
-
"dev": "vite
|
|
37
|
+
"dev": "vite",
|
|
38
|
+
"dev:playground": "vite --mode playground",
|
|
38
39
|
"build": "vite build --mode production",
|
|
39
40
|
"gh-pages": "vite build --mode gh-pages",
|
|
40
41
|
"test": "vitest",
|
|
@@ -55,7 +56,7 @@
|
|
|
55
56
|
"homepage": "https://github.com/mkbabb/keyframes.js#readme",
|
|
56
57
|
"dependencies": {
|
|
57
58
|
"@mkbabb/parse-that": "^0.7.0",
|
|
58
|
-
"@mkbabb/value.js": "
|
|
59
|
+
"@mkbabb/value.js": "file:../value.js"
|
|
59
60
|
},
|
|
60
61
|
"devDependencies": {
|
|
61
62
|
"@fortawesome/fontawesome-svg-core": "^6.6.0",
|
|
@@ -77,6 +78,7 @@
|
|
|
77
78
|
"clsx": "^2.1.1",
|
|
78
79
|
"embla-carousel-vue": "^8.6.0",
|
|
79
80
|
"highlight.js": "^11.11.1",
|
|
81
|
+
"html2canvas": "^1.4.1",
|
|
80
82
|
"jsdom": "^26.1.0",
|
|
81
83
|
"lucide-vue-next": "^0.525.0",
|
|
82
84
|
"monaco-editor": "^0.50.0",
|
package/dist/keyframes.cjs
DELETED
|
@@ -1,15 +0,0 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const kr=16.666666666666668,zt=t=>!!t&&t.constructor===Object;function ce(t){return zt(t)?Object.entries(t).map(([e,r])=>[e,ce(r)]).reduce((e,[r,n])=>(e[r]=n,e),{}):t!=null&&typeof t.clone=="function"?t.clone():Array.isArray(t)?t.map(ce):t}async function ps(t){return await new Promise(e=>setTimeout(e,t))}function J(t,e={}){const r=new Map,{maxCacheSize:n=1/0,ttl:s=1/0,keyFn:i=JSON.stringify}=e,o=function(...a){const l=i.apply(this,a),c=Date.now();if(r.has(l)){const f=r.get(l);if(c-f.timestamp<=s)return f.value;r.delete(l)}const u=t.apply(this,a);if(r.set(l,{value:u,timestamp:c}),r.size>n){const f=r.keys().next().value;r.delete(f)}return u};return o.cache=r,o}const ms=t=>t.replace(/([-_][a-z])/gi,e=>e.toUpperCase().replace("-","").replace("_",""));function ds(t){return t.replace(/([A-Z])/g,e=>`-${e[0].toLowerCase()}`)}function yr(t,e,r){for(let n=t-1;n>=0;n--)if(r(e[n]))return n}function Me(t){if(typeof window<"u"&&window.requestAnimationFrame)return window.requestAnimationFrame(t);let e=kr,r=Date.now();return setTimeout(()=>{let n=Date.now(),s=n-r;r=n,e=Math.max(0,kr-s),t(n)},e)}function an(t){if(typeof window<"u"&&window.cancelAnimationFrame)return window.cancelAnimationFrame(t);clearTimeout(t)}const vr=(t,e=2)=>typeof t=="number"&&Number.isNaN(t)?"none":String(t?.toFixed?.(e)??t).trim().replace(/\.0+$/,""),xr=(t,e,r)=>`${t}(${e.join(" ")} / ${r})`;let H=class{constructor(t,e=1){this.colorSpace=t,this.alpha=e,this.components=new Map}components;toString(){const t=Array.from(this.components.values()).map(r=>typeof r=="number"&&Number.isNaN(r)?"none":r),e=typeof this.alpha=="number"&&Number.isNaN(this.alpha)?"none":this.alpha;return xr(this.colorSpace,t,e)}toFormattedString(t=2){const e=Array.from(this.components.values()).map(n=>vr(n,t)),r=vr(this.alpha,t);return xr(this.colorSpace,e,r)}valueOf(){return[...this.values(),this.alpha]}toJSON(){const t={};for(const[e,r]of this.entries())t[e]=r;return t.alpha=this.alpha,t}clone(){const t=this.constructor,e=new t;return e.alpha=ce(this.alpha),this.components.forEach((r,n)=>{e.components.set(n,ce(r))}),e}keys(){return[...this.components.keys(),"alpha"]}values(){return[...this.components.values(),this.alpha]}entries(){return[...this.components.entries(),["alpha",this.alpha]]}getComponent(t){return this.components.get(t)}setComponent(t,e){this.components.set(t,e)}};class Ft extends H{constructor(e,r,n){super(e,r),this.whitePoint=n}}class q extends H{constructor(e,r,n,s){super("rgb",s),this.components.set("r",e),this.components.set("g",r),this.components.set("b",n)}get r(){return this.getComponent("r")}set r(e){this.setComponent("r",e)}get g(){return this.getComponent("g")}set g(e){this.setComponent("g",e)}get b(){return this.getComponent("b")}set b(e){this.setComponent("b",e)}}class je extends H{constructor(e,r,n,s){super("hsl",s),this.components.set("h",e),this.components.set("s",r),this.components.set("l",n)}get h(){return this.getComponent("h")}set h(e){this.setComponent("h",e)}get s(){return this.getComponent("s")}set s(e){this.setComponent("s",e)}get l(){return this.getComponent("l")}set l(e){this.setComponent("l",e)}}class $t extends H{constructor(e,r,n,s){super("hsv",s),this.components.set("h",e),this.components.set("s",r),this.components.set("v",n)}get h(){return this.getComponent("h")}set h(e){this.setComponent("h",e)}get s(){return this.getComponent("s")}set s(e){this.setComponent("s",e)}get v(){return this.getComponent("v")}set v(e){this.setComponent("v",e)}}class Nt extends H{constructor(e,r,n,s){super("hwb",s),this.components.set("h",e),this.components.set("w",r),this.components.set("b",n)}get h(){return this.getComponent("h")}set h(e){this.setComponent("h",e)}get w(){return this.getComponent("w")}set w(e){this.setComponent("w",e)}get b(){return this.getComponent("b")}set b(e){this.setComponent("b",e)}}class it extends Ft{constructor(e,r,n,s){super("lab",s,"D50"),this.components.set("l",e),this.components.set("a",r),this.components.set("b",n)}get l(){return this.getComponent("l")}set l(e){this.setComponent("l",e)}get a(){return this.getComponent("a")}set a(e){this.setComponent("a",e)}get b(){return this.getComponent("b")}set b(e){this.setComponent("b",e)}}class Vt extends H{constructor(e,r,n,s){super("lch",s),this.components.set("l",e),this.components.set("c",r),this.components.set("h",n)}get l(){return this.getComponent("l")}set l(e){this.setComponent("l",e)}get c(){return this.getComponent("c")}set c(e){this.setComponent("c",e)}get h(){return this.getComponent("h")}set h(e){this.setComponent("h",e)}}class ot extends Ft{constructor(e,r,n,s){super("oklab",s,"D50"),this.components.set("l",e),this.components.set("a",r),this.components.set("b",n)}get l(){return this.getComponent("l")}set l(e){this.setComponent("l",e)}get a(){return this.getComponent("a")}set a(e){this.setComponent("a",e)}get b(){return this.getComponent("b")}set b(e){this.setComponent("b",e)}}class jt extends H{constructor(e,r,n,s){super("oklch",s),this.components.set("l",e),this.components.set("c",r),this.components.set("h",n)}get l(){return this.getComponent("l")}set l(e){this.setComponent("l",e)}get c(){return this.getComponent("c")}set c(e){this.setComponent("c",e)}get h(){return this.getComponent("h")}set h(e){this.setComponent("h",e)}}class X extends Ft{constructor(e,r,n,s){super("xyz",s,"D65"),this.components.set("x",e),this.components.set("y",r),this.components.set("z",n)}get x(){return this.getComponent("x")}set x(e){this.setComponent("x",e)}get y(){return this.getComponent("y")}set y(e){this.setComponent("y",e)}get z(){return this.getComponent("z")}set z(e){this.setComponent("z",e)}}class ln extends H{constructor(e,r){super("kelvin",r),this.components.set("kelvin",e)}get kelvin(){return this.getComponent("kelvin")}set kelvin(e){this.setComponent("kelvin",e)}}class Rt extends H{constructor(e,r,n,s){super("srgb-linear",s),this.components.set("r",e),this.components.set("g",r),this.components.set("b",n)}get r(){return this.getComponent("r")}set r(e){this.setComponent("r",e)}get g(){return this.getComponent("g")}set g(e){this.setComponent("g",e)}get b(){return this.getComponent("b")}set b(e){this.setComponent("b",e)}}class Lt extends H{constructor(e,r,n,s){super("display-p3",s),this.components.set("r",e),this.components.set("g",r),this.components.set("b",n)}get r(){return this.getComponent("r")}set r(e){this.setComponent("r",e)}get g(){return this.getComponent("g")}set g(e){this.setComponent("g",e)}get b(){return this.getComponent("b")}set b(e){this.setComponent("b",e)}}class Wt extends H{constructor(e,r,n,s){super("a98-rgb",s),this.components.set("r",e),this.components.set("g",r),this.components.set("b",n)}get r(){return this.getComponent("r")}set r(e){this.setComponent("r",e)}get g(){return this.getComponent("g")}set g(e){this.setComponent("g",e)}get b(){return this.getComponent("b")}set b(e){this.setComponent("b",e)}}class Dt extends H{constructor(e,r,n,s){super("prophoto-rgb",s),this.components.set("r",e),this.components.set("g",r),this.components.set("b",n)}get r(){return this.getComponent("r")}set r(e){this.setComponent("r",e)}get g(){return this.getComponent("g")}set g(e){this.setComponent("g",e)}get b(){return this.getComponent("b")}set b(e){this.setComponent("b",e)}}class qt extends H{constructor(e,r,n,s){super("rec2020",s),this.components.set("r",e),this.components.set("g",r),this.components.set("b",n)}get r(){return this.getComponent("r")}set r(e){this.setComponent("r",e)}get g(){return this.getComponent("g")}set g(e){this.setComponent("g",e)}get b(){return this.getComponent("b")}set b(e){this.setComponent("b",e)}}const Sr=4;function Er(t,e="^",r=!1){const n=t.src.split(`
|
|
2
|
-
`),s=Math.min(n.length-1,t.getLineNumber()),i=Math.max(s-Sr,0),o=Math.min(s+Sr+1,n.length),a=n.slice(i,o);if(e){const l=" ".repeat(t.getColumnNumber())+e;a.splice(s-i+1,0,l)}return a.map((l,c)=>` ${i+c+1}| ${l}`).join(`
|
|
3
|
-
`)}const me=new Map;function cn(t){if(me.has(t.id))return me.get(t.id);const e=(n,s)=>{if(me.has(n.id))return me.get(n.id);const{name:i,args:o,parser:a}=n.context,l=a!=null?e(a,s):"unknown",c=(()=>{switch(i){case"string":return`"${o[0]}"`;case"regex":case"regexConcat":case"regexWrap":return`${o[0]}`;case"wrap":case"trim":{const[u,f]=o;return`${e(u,s)} ${l} ${e(f,s)}`}case"trimWhitespace":return`${l}?w`;case"not":return`!${l}`;case"opt":return`${l}?`;case"next":{const[u]=o;return`${l} >> ${e(u,s)}`}case"skip":{const[u]=o;return`${l} << ${e(u,s)}`}case"map":return l;case"all":case"then":return`[${o.map(u=>e(u,s)).join(", ")}]`;case"any":case"or":return o.map(u=>e(u,s)).join(" | ");case"many":{const[u,f]=o,h=f===1/0?`${u},`:`${u},${f}`;return`${l} {${h}}`}case"sepBy":return`${l} sepBy ${e(o[0],s)}`;case"lazy":{const[u]=o,f=ks(u);if(s)return i;{const h=e(f,f.id);return me.set(f.id,h),h}}case"debug":return l;default:return}})()??i??"unknown";return s&&me.set(n.id,c),c},r=e(t);return me.set(t.id,r),r}function un(t,e="",r=""){const n=String(t.value),s=t.offset>=t.src.length,i=`${`[${t.isError?"err":s?"done":"ok"}]`} ${e} offset=${t.offset} value=${n}`,o=t.offset>=t.src.length?Er(t,"",t.isError):Er(t,"^",t.isError);return`${i}
|
|
4
|
-
${o}`}function gs(t,e="",r=!1,n=console.log){const s=i=>{const o=t.parser(i),a=r?cn(t):t.context.name??"",l=un(o,e,a);return n(l),o};return new S(s,O("debug",t,n))}class Ye{constructor(e,r=void 0,n=0,s=!1,i=0){this.src=e,this.value=r,this.offset=n,this.isError=s,this.furthest=i}expected;ok(e,r=0){return this.offset+=r,this.value=e,this.isError=!1,this}err(e,r=0){return this.offset+=r,this.value=e,this.isError=!0,this}from(e,r=0){return this.offset+=r,this.value=e,this}save(){return{offset:this.offset,value:this.value}}restore(e){return this.offset=e.offset,this.value=e.value,this.isError=!1,this}clone(){return new Ye(this.src,this.value,this.offset,this.isError,this.furthest)}getColumnNumber(){const e=this.offset,r=this.src.lastIndexOf(`
|
|
5
|
-
`,e),n=r===-1?e:e-(r+1);return Math.max(0,n)}getLineNumber(){const e=this.src.lastIndexOf(`
|
|
6
|
-
`,this.offset);return e>=0?this.src.slice(0,e).split(`
|
|
7
|
-
`).length:0}toString(){return un(this)}}function O(t,e,...r){return{name:t,parser:e,args:r}}let bs=0;const de=new Map,We=new Map,fn=20,ws=(1<<fn)-1;let He=-1,Ge;function F(t,e){return t.offset>He?(He=t.offset,Ge=t,t.expected=void 0):t.offset,Ge}function ks(t){return t.parser?t.parser:t.parser=t()}function ys(t){let e;return r=>(e||(e=t()),e.parser(r))}const vs=0,De=1,xs=2;class S{constructor(e,r={}){this.parser=e,this.context=r}id=bs++;state;flags=vs;reset(){Ge=void 0,He=-1,de.clear(),We.clear()}parseState(e){this.reset();const r=new Ye(e);if(this.parser(r),r.isError&&Ge){const n=new Ye(e,void 0,He,!0);this.state=n}else this.state=r,r.isError;return r}parse(e){return this.parseState(e).value}getCijKey(e){return this.id<<fn|e.offset&ws}atLeftRecursionLimit(e){return(We.get(this.getCijKey(e))??0)>e.src.length-e.offset}memoize(){const e=r=>{const n=this.getCijKey(r),s=We.get(n)??0,i=de.get(this.id);if(i&&i.offset>=r.offset)return r.offset=i.offset,r.value=i.value,r.isError=i.isError,r;if(this.atLeftRecursionLimit(r))return r.isError=!0,r;We.set(n,s+1),this.parser(r);const o=de.get(this.id);return o&&o.offset>r.offset?r.offset=o.offset:o||de.set(this.id,r.clone()),r};return new S(e,O("memoize",this))}mergeMemos(){const e=r=>{const n=de.get(this.id);return n?(r.offset=n.offset,r.value=n.value,r.isError=n.isError,r):this.atLeftRecursionLimit(r)?(r.isError=!0,r):(this.parser(r),de.get(this.id)||de.set(this.id,r.clone()),r)};return new S(e,O("mergeMemo",this))}then(e){const r=n=>{const s=n.offset;if(this.parser(n),!n.isError){const i=n.value;if(e.parser(n),!n.isError)return n.ok([i,n.value])}return F(n),n.offset=s,n.isError=!0,n};return new S(r,O("then",this,this,e))}or(e){const r=n=>{const s=n.offset;return this.parser(n),n.isError?(n.offset=s,n.isError=!1,e.parser(n)):n};return new S(r,O("or",this,this,e))}chain(e,r=!1){const n=s=>(this.parser(s),s.isError?s:s.value||r?e(s.value).parser(s):s);return new S(n,O("chain",this,e))}map(e,r=!1){const n=s=>(this.parser(s),!s.isError||r?s.ok(e(s.value)):s);return new S(n,O("map",this))}mapState(e){const r=n=>{const s=n.offset,i=n.value;if(this.parser(n),n.isError)return n;const o=Object.create(n);return o.offset=s,o.value=i,e(n,o)};return new S(r,O("mapState",this))}skip(e){const r=n=>{const s=n.offset;if(this.parser(n),!n.isError){const i=n.value;if(e.parser(n),!n.isError)return n.ok(i)}return F(n),n.offset=s,n.isError=!0,n};return new S(r,O("skip",this,e))}next(e){const r=n=>{const s=n.offset;return this.parser(n),!n.isError&&(e.parser(n),!n.isError)||(F(n),n.offset=s,n.isError=!0),n};return new S(r,O("next",this,e))}opt(){const e=r=>{const n=r.offset;return this.parser(r),r.isError?(F(r),r.offset=n,r.ok(void 0)):r};return new S(e,O("opt",this))}not(e){const r=s=>{const i=s.offset,o=s.value;return this.parser(s),s.isError?(F(s),s.offset=i,s.ok(o)):(s.offset=i,s.isError=!0,s)},n=s=>{const i=s.offset;if(this.parser(s),s.isError)return F(s),s.offset=i,s.isError=!0,s;{const o=s.value,a=s.offset;return s.offset=i,s.isError=!1,e.parser(s),s.isError?(s.offset=a,s.value=o,s.isError=!1,s):(F(s),s.offset=i,s.isError=!0,s)}};return new S(e?n:r,O("not",this,e))}wrap(e,r,n=!0){if(!n)return E(e,this,r);const s=this,i=o=>{const a=o.offset;if(e.parser(o),o.isError)return o.offset=a,o;if(s.parser(o),o.isError)return F(o),o.offset=a,o.isError=!0,o;const l=o.value;return r.parser(o),o.isError?(F(o),o.offset=a,o.isError=!0,o):(o.value=l,o)};return new S(i,O("wrap",this,e,r))}call(e){if(this.flags===0)return this.parser(e);if(this.flags===De){Se(e);const n=e.offset;return this.parser(e),e.isError?(F(e),e.offset=n,e.isError=!0,e):(Se(e),e)}this.flags&De&&Se(e);const r=e.offset;return this.parser(e),e.isError?(F(e),e.offset=r,e.isError=!0,e):(this.flags&De&&Se(e),this.flags&xs&&e.offset<e.src.length&&(F(e),e.offset=r,e.isError=!0),e)}trim(e=g,r=!0){if(!r)return E(e,this,e);if(e.context?.name==="whitespace"){const n=this,s=new S((o=>n.call(o)),O("trimWhitespace",this));s.flags=this.flags|De;const i=o=>{Se(o);const a=o.offset;return n.parser(o),o.isError?(F(o),o.offset=a,o.isError=!0,o):(Se(o),o)};return new S(i,O("trimWhitespace",this))}return this.wrap(e,e)}many(e=0,r=1/0){const n=s=>{const i=e>0?e:0,o=i>0?new Array(i):[];let a=0;for(let l=0;l<r;l+=1){const c=s.offset;if(this.parser(s),s.isError){s.offset=c,s.isError=!1;break}if(s.offset===c)break;a<i?o[a]=s.value:o.push(s.value),a++}return a<i&&(o.length=a),a>=e?s.ok(o):(F(s),s.isError=!0,s.value=[],s)};return new S(n,O("many",this,e,r))}sepBy(e,r=0,n=1/0){const s=i=>{const o=r>0?r:0,a=o>0?new Array(o):[];let l=0;for(let c=0;c<n;c+=1){const u=i.offset;if(this.parser(i),i.isError){i.offset=u,i.isError=!1;break}if(i.offset===u)break;l<o?a[l]=i.value:a.push(i.value),l++;const f=i.offset;if(e.parser(i),i.isError){i.offset=f,i.isError=!1;break}}return l<o&&(a.length=l),l>=r?i.ok(a):(F(i),i.isError=!0,i.value=[],i)};return new S(s,O("sepBy",this,e))}eof(){const e=this.skip(Ss());return e.context=O("eof",this),e}debug(e="",r=!1,n=console.log){return gs(this,e,r,n)}toString(){return cn(this)}static lazy(e){return new S(ys(e),O("lazy",void 0,e))}}function Ss(){const t=e=>e.offset>=e.src.length?e.ok(void 0):(F(e),e.isError=!0,e);return new S(t,O("eof",void 0))}function d(...t){const e=r=>{const n=r.offset;for(const s of t){if(s.parser(r),!r.isError)return r;r.offset=n,r.isError=!1}return F(r),r.isError=!0,r};return new S(t.length===1?t[0].parser:e,O("any",void 0,...t))}function E(...t){const e=r=>{const n=[],s=r.offset;for(const i of t){if(i.parser(r),r.isError)return r.offset=s,r.isError=!0,r;r.value!==void 0&&n.push(r.value)}return r.ok(n)};return new S(t.length===1?t[0].parser:e,O("all",void 0,...t))}function w(t){const e=t.length;let r;if(e===1){const n=t.charCodeAt(0);r=(s=>s.src.charCodeAt(s.offset)===n?(s.offset+=1,s.value=t,s.isError=!1,s):(F(s),s.isError=!0,s))}else r=(n=>n.src.startsWith(t,n.offset)?(n.offset+=e,n.value=t,n.isError=!1,n):(F(n),n.isError=!0,n));return new S(r,O("string",void 0,t))}function Z(t,e){const r=t.flags.replace(/y/g,""),n=new RegExp(t,r+"y"),s=e!=null,i=o=>{if(o.offset>=o.src.length)return o.isError=!0,o;const a=o.offset;if(n.lastIndex=a,s){const l=n.exec(o.src),c=e(l);if(c)return o.ok(c,n.lastIndex-a);if(c==="")return o.ok(void 0)}else if(n.test(o.src)){const l=n.lastIndex;return l>a?(o.offset=l,o.value=o.src.substring(a,l),o.isError=!1,o):(o.value=void 0,o.isError=!1,o)}return F(o),o.isError=!0,o};return new S(i,O("regex",void 0,t))}const Se=t=>{const e=t.src,r=e.length;let n=t.offset;if(n>=r||e.charCodeAt(n)>32)return t;for(;n<r;){const s=e.charCodeAt(n);if(s===32||s>=9&&s<=13)n++;else break}return t.offset=n,t},g=Z(/\s*/);g.context.name="whitespace";function V(t,e){const[r,n,s]=t;return[e[0]*r+e[1]*n+e[2]*s,e[3]*r+e[4]*n+e[5]*s,e[6]*r+e[7]*n+e[8]*s]}function ue(t){const[e,r,n,s,i,o,a,l,c]=t,u=i*c-o*l,f=-(s*c-o*a),h=s*l-i*a,p=1/(e*u+r*f+n*h);return[u*p,(n*l-r*c)*p,(r*o-n*i)*p,f*p,(e*c-n*a)*p,(n*s-e*o)*p,h*p,(r*a-e*l)*p,(e*i-r*s)*p]}const j=255,k={"%":{min:0,max:100},number:{min:0,max:1}},wt={"%":k["%"],number:{min:0,max:j}},W={"%":k["%"],number:k.number},Te={deg:{min:0,max:360},number:{min:0,max:360},"%":k["%"]},y={rgb:{r:wt,g:wt,b:wt,alpha:k},hsl:{h:Te,s:{"%":k["%"],number:k.number},l:{"%":k["%"],number:k.number},alpha:k},hsv:{h:Te,s:{"%":k["%"],number:k.number},v:{"%":k["%"],number:k.number},alpha:k},hwb:{h:Te,w:{"%":k["%"],number:k.number},b:{"%":k["%"],number:k.number},alpha:k},lab:{l:{"%":k["%"],number:k["%"]},a:{number:{min:-125,max:125},"%":{min:-100,max:100}},b:{number:{min:-125,max:125},"%":{min:-100,max:100}},alpha:k},lch:{l:{"%":k["%"],number:k["%"]},c:{number:{min:0,max:150},"%":k["%"]},h:Te,alpha:k},oklab:{l:{"%":k["%"],number:k.number},a:{number:{min:-.4,max:.4},"%":{min:-100,max:100}},b:{number:{min:-.4,max:.4},"%":{min:-100,max:100}},alpha:k},oklch:{l:{"%":k["%"],number:k.number},c:{number:{min:0,max:.5},"%":k["%"]},h:Te,alpha:k},xyz:{x:{"%":k["%"],number:k.number},y:{"%":k["%"],number:k.number},z:{"%":k["%"],number:k.number},alpha:k},kelvin:{kelvin:{number:{min:1e3,max:4e4}},alpha:k},"srgb-linear":{r:W,g:W,b:W,alpha:k},"display-p3":{r:W,g:W,b:W,alpha:k},"a98-rgb":{r:W,g:W,b:W,alpha:k},"prophoto-rgb":{r:W,g:W,b:W,alpha:k},rec2020:{r:W,g:W,b:W,alpha:k}},D="%",Es={rgb:{r:"",g:"",b:"",alpha:D},hsl:{h:"deg",s:"%",l:"%",alpha:D},hsv:{h:"deg",s:"%",v:"%",alpha:D},hwb:{h:"deg",w:"%",b:"%",alpha:D},lab:{l:"%",a:"",b:"",alpha:D},lch:{l:"%",c:"",h:"deg",alpha:D},oklab:{l:"%",a:"",b:"",alpha:D},oklch:{l:"%",c:"",h:"deg",alpha:D},xyz:{x:"%",y:"%",z:"%",alpha:D},kelvin:{kelvin:"K",alpha:D},"srgb-linear":{r:"",g:"",b:"",alpha:D},"display-p3":{r:"",g:"",b:"",alpha:D},"a98-rgb":{r:"",g:"",b:"",alpha:D},"prophoto-rgb":{r:"",g:"",b:"",alpha:D},rec2020:{r:"",g:"",b:"",alpha:D}},Cs=[.3127/.329,1,(1-.3127-.329)/.329],Ms=[.3457/.3585,1,(1-.3457-.3585)/.3585],Kt=[1.0479297925449969,.022946870601609652,-.05019226628920524,.02962780877005599,.9904344267538799,-.017073799063418826,-.009243040646204504,.015055191490298152,.7518742814281371],hn=ue(Kt),pn={D65:Cs,D50:Ms},mn=[.819022437996703,.3619062600528904,-.1288737815209879,.0329836539323885,.9292868615863434,.0361446663506424,.0481771893596242,.2642395317527308,.6335478284694309],Is=ue(mn),dn=[.210454268309314,.7936177747023054,-.0040720430116193,1.9779985324311684,-2.42859224204858,.450593709617411,.0259040424655478,.7827717124575296,-.8086757549230774],Os=ue(dn),x=[4.0767416621,-3.3077115913,.2309699292,-1.2684380046,2.6097574011,-.3413193965,-.0041960863,-.7034186147,1.707614701],se=[.4122214708,.5363325363,.0514459929,.2119034982,.6806995451,.1073969566,.0883024619,.2817188376,.6299787005],R={l:[1,.3963377774,.2158037573],m:[1,-.1055613458,-.0638541728],s:[1,-.0894841775,-1.291485548]},As=[{test:(t,e)=>-1.88170328*t-.80936493*e>1,k0:1.19086277,k1:1.76576728,k2:.59662641,k3:.75515197,k4:.56771245,wl:4.0767416621,wm:-3.3077115913,ws:.2309699292},{test:(t,e)=>1.81444104*t-1.19445276*e>1,k0:.73956515,k1:-.45954404,k2:.08285427,k3:.1254107,k4:.14503204,wl:-1.2684380046,wm:2.6097574011,ws:-.3413193965},{test:()=>!0,k0:1.35733652,k1:-.00915799,k2:-1.1513021,k3:-.50559606,k4:.00692167,wl:-.0041960863,wm:-.7034186147,ws:1.707614701}],Cr={aliceblue:"#f0f8ff",antiquewhite:"#faebd7",aqua:"#00ffff",aquamarine:"#7fffd4",azure:"#f0ffff",beige:"#f5f5dc",bisque:"#ffe4c4",black:"#000000",blanchedalmond:"#ffebcd",blue:"#0000ff",blueviolet:"#8a2be2",brown:"#a52a2a",burlywood:"#deb887",cadetblue:"#5f9ea0",chartreuse:"#7fff00",chocolate:"#d2691e",coral:"#ff7f50",cornflowerblue:"#6495ed",cornsilk:"#fff8dc",crimson:"#dc143c",cyan:"#00ffff",darkblue:"#00008b",darkcyan:"#008b8b",darkgoldenrod:"#b8860b",darkgray:"#a9a9a9",darkgreen:"#006400",darkgrey:"#a9a9a9",darkkhaki:"#bdb76b",darkmagenta:"#8b008b",darkolivegreen:"#556b2f",darkorange:"#ff8c00",darkorchid:"#9932cc",darkred:"#8b0000",darksalmon:"#e9967a",darkseagreen:"#8fbc8f",darkslateblue:"#483d8b",darkslategray:"#2f4f4f",darkslategrey:"#2f4f4f",darkturquoise:"#00ced1",darkviolet:"#9400d3",deeppink:"#ff1493",deepskyblue:"#00bfff",dimgray:"#696969",dimgrey:"#696969",dodgerblue:"#1e90ff",firebrick:"#b22222",floralwhite:"#fffaf0",forestgreen:"#228b22",fuchsia:"#ff00ff",gainsboro:"#dcdcdc",ghostwhite:"#f8f8ff",gold:"#ffd700",goldenrod:"#daa520",gray:"#808080",green:"#008000",greenyellow:"#adff2f",grey:"#808080",honeydew:"#f0fff0",hotpink:"#ff69b4",indianred:"#cd5c5c",indigo:"#4b0082",ivory:"#fffff0",khaki:"#f0e68c",lavender:"#e6e6fa",lavenderblush:"#fff0f5",lawngreen:"#7cfc00",lemonchiffon:"#fffacd",lightblue:"#add8e6",lightcoral:"#f08080",lightcyan:"#e0ffff",lightgoldenrodyellow:"#fafad2",lightgray:"#d3d3d3",lightgreen:"#90ee90",lightgrey:"#d3d3d3",lightpink:"#ffb6c1",lightsalmon:"#ffa07a",lightseagreen:"#20b2aa",lightskyblue:"#87cefa",lightslategray:"#778899",lightslategrey:"#778899",lightsteelblue:"#b0c4de",lightyellow:"#ffffe0",lime:"#00ff00",limegreen:"#32cd32",linen:"#faf0e6",magenta:"#ff00ff",maroon:"#800000",mediumaquamarine:"#66cdaa",mediumblue:"#0000cd",mediumorchid:"#ba55d3",mediumpurple:"#9370db",mediumseagreen:"#3cb371",mediumslateblue:"#7b68ee",mediumspringgreen:"#00fa9a",mediumturquoise:"#48d1cc",mediumvioletred:"#c71585",midnightblue:"#191970",mintcream:"#f5fffa",mistyrose:"#ffe4e1",moccasin:"#ffe4b5",navajowhite:"#ffdead",navy:"#000080",oldlace:"#fdf5e6",olive:"#808000",olivedrab:"#6b8e23",orange:"#ffa500",orangered:"#ff4500",orchid:"#da70d6",palegoldenrod:"#eee8aa",palegreen:"#98fb98",paleturquoise:"#afeeee",palevioletred:"#db7093",papayawhip:"#ffefd5",peachpuff:"#ffdab9",peru:"#cd853f",pink:"#ffc0cb",plum:"#dda0dd",powderblue:"#b0e0e6",purple:"#800080",rebeccapurple:"#663399",red:"#ff0000",rosybrown:"#bc8f8f",royalblue:"#4169e1",saddlebrown:"#8b4513",salmon:"#fa8072",sandybrown:"#f4a460",seagreen:"#2e8b57",seashell:"#fff5ee",sienna:"#a0522d",silver:"#c0c0c0",skyblue:"#87ceeb",slateblue:"#6a5acd",slategray:"#708090",slategrey:"#708090",snow:"#fffafa",springgreen:"#00ff7f",steelblue:"#4682b4",tan:"#d2b48c",teal:"#008080",thistle:"#d8bfd8",transparent:"rgba(0, 0, 0, 0)",tomato:"#ff6347",turquoise:"#40e0d0",violet:"#ee82ee",wheat:"#f5deb3",white:"#ffffff",whitesmoke:"#f5f5f5",yellow:"#ffff00",yellowgreen:"#9acd32",padaleckipink:"oklch(100% 0.42 360deg / 71.70%)","lodge-blu-color":"rgb(53 101 144)",lavendi:"oklch(79.90% 0.11 318.24deg / 100%)",shadyshroom:"oklch(53% 0.07 21.60deg / 100%)",patriarchalplum:"oklch(31.20% 0.11 19.80deg / 100%)"};function G(t,e,r){return Math.min(Math.max(t,e),r)}function P(t,e,r,n=0,s=1){const i=(s-n)/(r-e);if(r===e)throw new Error("fromMax and fromMin cannot be equal");return(t-e)*i+n}function ye(t,e,r){return(1-t)*e+t*r}function Ze(t,e){const r=e.length-1,n=[...e];for(let s=1;s<=r;s++)for(let i=0;i<=r-s;i++)n[i]=ye(t,n[i],n[i+1]);return n[0]}function Bs(t,e,r,n,s){return[Ze(t,[0,e,n,1]),Ze(t,[0,r,s,1])]}function at(t,e){const r=e.map(s=>s[0]),n=e.map(s=>s[1]);return[Ze(t,r),Ze(t,n)]}const gn=2.4,Je=.055,Ut=12.92,Ps=.04045,bn=Ps/Ut;function kt(t){const e=t<0?-1:1,r=t*e;return r<=bn?t/Ut:e*((r+Je)/(1+Je))**gn}function yt(t){const e=t<0?-1:1,r=t*e;return r<=bn?t*Ut:e*((1+Je)*r**(1/gn)-Je)}function vt(t,e,r){return Math.min(Math.max(t,e),r)}function Xt(t,e,r){const n=t+R.l[1]*e+R.l[2]*r,s=t+R.m[1]*e+R.m[2]*r,i=t+R.s[1]*e+R.s[2]*r,o=n*n*n,a=s*s*s,l=i*i*i;return[x[0]*o+x[1]*a+x[2]*l,x[3]*o+x[4]*a+x[5]*l,x[6]*o+x[7]*a+x[8]*l]}function Ts(t,e,r){return t>=0&&t<=1&&e>=0&&e<=1&&r>=0&&r<=1}function zs(t,e){const r=As.find(M=>M.test(t,e)),{k0:n,k1:s,k2:i,k3:o,k4:a,wl:l,wm:c,ws:u}=r;let f=n+s*t+i*e+o*t*t+a*t*e;const h=R.l[1]*t+R.l[2]*e,p=R.m[1]*t+R.m[2]*e,T=R.s[1]*t+R.s[2]*e;{const M=1+f*h,z=1+f*p,C=1+f*T,I=M*M*M,v=z*z*z,U=C*C*C,ne=3*h*M*M,he=3*p*z*z,Oe=3*T*C*C,Ae=6*h*h*M,Be=6*p*p*z,Pe=6*T*T*C,xe=l*I+c*v+u*U,pe=l*ne+c*he+u*Oe,Le=l*Ae+c*Be+u*Pe;f=f-xe*pe/(pe*pe-.5*xe*Le)}return f}function Fs(t,e){const r=zs(t,e),[n,s,i]=Xt(1,r*t,r*e),o=Math.cbrt(1/Math.max(n,s,i)),a=o*r;return{L:o,C:a}}function $s(t,e,r,n,s,i){let o;if((r-s)*i.C-(i.L-s)*n<=0)o=i.C*s/(n*i.L+i.C*(s-r));else{o=i.C*(s-1)/(n*(i.L-1)+i.C*(s-r));const a=r-s,l=n,c=R.l[1]*t+R.l[2]*e,u=R.m[1]*t+R.m[2]*e,f=R.s[1]*t+R.s[2]*e,h=a+l*c,p=a+l*u,T=a+l*f;{const M=s*(1-o)+o*r,z=o*n,C=M+z*c,I=M+z*u,v=M+z*f,U=C*C*C,ne=I*I*I,he=v*v*v,Oe=3*h*C*C,Ae=3*p*I*I,Be=3*T*v*v,Pe=6*h*h*C,xe=6*p*p*I,pe=6*T*T*v,Le=x[0]*U+x[1]*ne+x[2]*he-1,ht=x[0]*Oe+x[1]*Ae+x[2]*Be,us=x[0]*Pe+x[1]*xe+x[2]*pe,mr=ht/(ht*ht-.5*Le*us);let pt=-Le*mr;const dr=x[3]*U+x[4]*ne+x[5]*he-1,mt=x[3]*Oe+x[4]*Ae+x[5]*Be,fs=x[3]*Pe+x[4]*xe+x[5]*pe,gr=mt/(mt*mt-.5*dr*fs);let dt=-dr*gr;const br=x[6]*U+x[7]*ne+x[8]*he-1,gt=x[6]*Oe+x[7]*Ae+x[8]*Be,hs=x[6]*Pe+x[7]*xe+x[8]*pe,wr=gt/(gt*gt-.5*br*hs);let bt=-br*wr;pt=mr>=0?pt:1/0,dt=gr>=0?dt:1/0,bt=wr>=0?bt:1/0,o+=Math.min(pt,dt,bt)}}return o}const Ns=1e-5,Vs=.05;function js(t,e,r){const[n,s,i]=Xt(t,e,r);if(Ts(n,s,i))return[t,e,r];const o=Math.max(Ns,Math.sqrt(e*e+r*r)),a=e/o,l=r/o,c=Fs(a,l),u=t-.5,f=.5+Math.abs(u)+Vs*o,h=.5*(1+Math.sign(u)*(f-Math.sqrt(f*f-2*Math.abs(u)))),p=$s(a,l,t,o,h,c),T=h*(1-p)+p*t,M=p*o;return[T,M*a,M*l]}function Rs(t,e,r){const n=kt(t),s=kt(e),i=kt(r),o=Math.cbrt(se[0]*n+se[1]*s+se[2]*i),a=Math.cbrt(se[3]*n+se[4]*s+se[5]*i),l=Math.cbrt(se[6]*n+se[7]*s+se[8]*i);return[.2104542553*o+.793617785*a-.0040720468*l,1.9779984951*o-2.428592205*a+.4505937099*l,.0259040371*o+.7827717662*a-.808675766*l]}function Ls(t,e,r){if(t>=0&&t<=1&&e>=0&&e<=1&&r>=0&&r<=1)return[t,e,r];const[n,s,i]=Rs(t,e,r),[o,a,l]=js(n,s,i),[c,u,f]=Xt(o,a,l);return[vt(yt(c),0,1),vt(yt(u),0,1),vt(yt(f),0,1)]}const le=16,Ws=t=>{if(t=t.slice(1),t.length<=4){const e=parseInt(t[0]+t[0],le),r=parseInt(t[1]+t[1],le),n=parseInt(t[2]+t[2],le),s=t[3]?parseInt(t[3]+t[3],le)/j:1;return new q(e,r,n,s)}else{const e=parseInt(t.slice(0,2),le),r=parseInt(t.slice(2,4),le),n=parseInt(t.slice(4,6),le),s=t.length===8?parseInt(t.slice(6,8),le)/j:1;return new q(e,r,n,s)}},wn=1e3,kn=4e4,yn=100,vn=({kelvin:t,alpha:e})=>{t=G(t,wn,kn)/yn;let r,n,s;return t<=66?r=j:(r=t-60,r=329.698727446*r**-.1332047592),r=G(r,0,j)/j,t<=66?(n=t,n=99.4708025861*Math.log(n)-161.1195681661):(n=t-60,n=288.1221695283*n**-.0755148492),n=G(n,0,j)/j,t>=66?s=j:t<=19?s=0:(s=t-10,s=138.5177312231*Math.log(s)-305.0447927307),s=G(s,0,j)/j,new q(r,n,s,e)},Ds=({r:t,g:e,b:r,alpha:n})=>{t=G(t*j,0,j),e=G(e*j,0,j),r=G(r*j,0,j);let s;if(r===j?s=6600:r===0?s=1900:s=Math.exp((r+305.0447927307)/138.5177312231)+10,t<j){const o=(329.698727446/t)**-7.507239275877164+60;s=Math.max(s,o)}const i=s<=6600?Math.exp((e+161.1195681661)/99.4708025861):(288.1221695283/e)**(1/-.0755148492)+60;return s=(s+i)/2,s=G(Math.round(s*yn),wn,kn),new ln(s,n)},xn=({h:t,s:e,v:r,alpha:n})=>{const s=r-r*e/2;let i;return s===0||s===1?i=0:i=(r-s)/Math.min(s,1-s),new je(t,i,s,n)},Sn=({h:t,s:e,l:r,alpha:n})=>{const s=r+e*Math.min(r,1-r);let i;return s===0?i=0:i=2*(1-r/s),new $t(t,i,s,n)},qs=({h:t,w:e,b:r,alpha:n})=>{let s,i;const o=e+r;return o>=1?(i=e/o,s=0):(i=1-r,s=i===0?0:1-e/i),xn(new $t(t,s,i,n))},Ks=({h:t,s:e,l:r,alpha:n})=>{const{h:s,s:i,v:o}=Sn(new je(t,e,r,n));return new Nt(s,o*(1-i),1-o,n)},Us=({r:t,g:e,b:r,alpha:n})=>{const s=Math.max(t,e,r),i=Math.min(t,e,r);let[o,a,l]=[0,0,(s+i)/2];const c=s-i;switch(a=c/(1-Math.abs(2*l-1)),s){case t:o=(e-r)/c+(e<r?6:0);break;case e:o=(r-t)/c+2;break;case r:o=(t-e)/c+4;break}return o/=6,a<0&&(o=(o+.5)%1,a=Math.abs(a)%1),o>=1&&(o-=1),new je(o,a,l,n)};function Xs({h:t,s:e,l:r,alpha:n}){const s=(1-Math.abs(2*r-1))*e,i=s*(1-Math.abs(t*6%2-1)),o=r-s/2;let a,l,c;return t<1/6?[a,l,c]=[s,i,0]:t<2/6?[a,l,c]=[i,s,0]:t<3/6?[a,l,c]=[0,s,i]:t<4/6?[a,l,c]=[0,i,s]:t<5/6?[a,l,c]=[i,0,s]:[a,l,c]=[s,0,i],new q(a+o,l+o,c+o,n)}const Ys=216/24389,Hs=24/116,Ct=24389/27,Gs=8,ze=16,Fe=116,En=500,Cn=200;function Zs(t){if(t.whitePoint==="D50")return[t.x,t.y,t.z];if(t.whitePoint==="D65")return V([t.x,t.y,t.z],Kt);throw new Error(`Unsupported white point: ${t.whitePoint}`)}function Js(t){if(t.whitePoint==="D65")return[t.x,t.y,t.z];if(t.whitePoint==="D50")return V([t.x,t.y,t.z],hn);throw new Error(`Unsupported white point: ${t.whitePoint}`)}function Mn(t,e="D50"){const r=C=>C>Ys?Math.cbrt(C):(Ct*C+ze)/Fe,n=pn[e],[s,i,o]=Zs(t),a=s/n[0],l=i/n[1],c=o/n[2],u=r(a),f=r(l),h=r(c),p=Fe*f-ze,T=En*(u-f),M=Cn*(f-h),z=new it(P(p,y.lab.l.number.min,y.lab.l.number.max),P(T,y.lab.a.number.min,y.lab.a.number.max),P(M,y.lab.b.number.min,y.lab.b.number.max),t.alpha);return z.whitePoint=e,z}function In(t){const e=I=>I>Hs?I**3:(Fe*I-ze)/Ct,r=I=>I>Gs?((I+ze)/Fe)**3:I/Ct,n=pn[t.whitePoint];let{l:s,a:i,b:o,alpha:a}=t;s=P(s,0,1,y.lab.l.number.min,y.lab.l.number.max),i=P(i,0,1,y.lab.a.number.min,y.lab.a.number.max),o=P(o,0,1,y.lab.b.number.min,y.lab.b.number.max);const l=(s+ze)/Fe,c=i/En+l,u=l-o/Cn,[f,h,p]=[e(c),r(s),e(u)];let T=f*n[0],M=h*n[1],z=p*n[2];const C=new X(T,M,z,a);return C.whitePoint=t.whitePoint,[T,M,z]=Js(C),C.whitePoint="D65",C.x=T,C.y=M,C.z=z,C}const Yt=[.41239079926595934,.357584339383878,.1804807884018343,.21263900587151027,.715168678767756,.07219231536073371,.01933081871559182,.11919477979462598,.9505321522496607],On=ue(Yt),An=2.4,Qe=.055,Ht=12.92,Qs=.04045,Bn=Qs/Ht;function Ie(t){const e=t<0?-1:1,r=t*e;return r<=Bn?t/Ht:e*((r+Qe)/(1+Qe))**An}function Pn(t){const e=t<0?-1:1,r=t*e;return r<=Bn?t*Ht:e*((1+Qe)*r**(1/An)-Qe)}function Gt({r:t,g:e,b:r,alpha:n}){const s=[Ie(t),Ie(e),Ie(r)],[i,o,a]=V(s,Yt);return new X(i,o,a,n)}const Zt=({x:t,y:e,z:r,alpha:n},s=!0)=>{const i=V([t,e,r],On),[o,a,l]=i.map(Pn);if(s){const c=Bi(new q(o,a,l,n));return new q(c.r,c.g,c.b,n)}else return new q(o,a,l,n)};function _s({l:t,c:e,h:r,alpha:n}){e=P(e,0,1,y.lch.c.number.min,y.lch.c.number.max);const s=r*2*Math.PI,i=Math.cos(s)*e,o=Math.sin(s)*e;return new it(t,P(i,y.lab.a.number.min,y.lab.a.number.max),P(o,y.lab.b.number.min,y.lab.b.number.max),n)}function ei({l:t,a:e,b:r,alpha:n}){e=P(e,0,1,y.lab.a.number.min,y.lab.a.number.max),r=P(r,0,1,y.lab.b.number.min,y.lab.b.number.max);const s=Math.hypot(e,r);let i=Math.atan2(r,e)/(2*Math.PI);return i<0&&(i+=1),new Vt(t,P(s,y.lch.c.number.min,y.lch.c.number.max),i,n)}function Tn({l:t,a:e,b:r,alpha:n}){e=P(e,0,1,y.oklab.a.number.min,y.oklab.a.number.max),r=P(r,0,1,y.oklab.b.number.min,y.oklab.b.number.max);const s=V([t,e,r],Os),i=[s[0]*s[0]*s[0],s[1]*s[1]*s[1],s[2]*s[2]*s[2]],[o,a,l]=V(i,Is);return new X(o,a,l,n)}function zn(t){const{x:e,y:r,z:n}=t,s=V([e,r,n],mn),i=[Math.cbrt(s[0]),Math.cbrt(s[1]),Math.cbrt(s[2])],[o,a,l]=V(i,dn);return new ot(o,P(a,y.oklab.a.number.min,y.oklab.a.number.max),P(l,y.oklab.b.number.min,y.oklab.b.number.max),t.alpha)}function ti({l:t,a:e,b:r,alpha:n}){e=P(e,0,1,y.oklab.a.number.min,y.oklab.a.number.max),r=P(r,0,1,y.oklab.b.number.min,y.oklab.b.number.max);const s=Math.hypot(e,r);let i=Math.atan2(r,e)/(2*Math.PI);return i<0&&(i+=1),new jt(t,P(s,y.oklch.c.number.min,y.oklch.c.number.max),i,n)}function ri({l:t,c:e,h:r,alpha:n}){e=P(e,0,1,y.oklch.c.number.min,y.oklch.c.number.max);const s=r*2*Math.PI,i=Math.cos(s)*e,o=Math.sin(s)*e;return new ot(t,P(i,y.oklab.a.number.min,y.oklab.a.number.max),P(o,y.oklab.b.number.min,y.oklab.b.number.max),n)}function Jt(t){const e=Xs(t);return Gt(e)}function Qt(t){const e=Zt(t);return Us(e)}function ni(t){const e=xn(t);return Jt(e)}function si(t){const e=Qt(t);return Sn(e)}function ii(t){const e=qs(t);return Jt(e)}function oi(t){const e=Qt(t);return Ks(e)}function ai(t){const e=_s(t);return In(e)}function li(t){const e=Mn(t);return ei(e)}function ci(t){const e=ri(t);return Tn(e)}function ui(t){const e=zn(t);return ti(e)}function fi(t){const e=vn(t);return Gt(e)}function hi(t){const e=Zt(t);return Ds(e)}const Fn=563/256;function xt(t){return(t<0?-1:1)*Math.abs(t)**Fn}function pi(t){return(t<0?-1:1)*Math.abs(t)**(1/Fn)}const $n=1/512,Nn=1.8;function St(t){const e=t<0?-1:1,r=Math.abs(t);return e*(r<=$n*16?r/16:r**Nn)}function mi(t){const e=t<0?-1:1,r=Math.abs(t);return e*(r>=$n?r**(1/Nn):r*16)}const _e=1.09929682680944,Vn=.018053968510807;function Et(t){const e=t<0?-1:1,r=Math.abs(t);return r<Vn*4.5?e*r/4.5:e*((r+_e-1)/_e)**(1/.45)}function di(t){const e=t<0?-1:1,r=Math.abs(t);return r>=Vn?e*(_e*r**.45-(_e-1)):e*4.5*r}const jn=[.4865709486482162,.26566769316909306,.1982172852343625,.22897456406974884,.6917385218365064,.079286914093745,0,.04511338185890264,1.043944368900976],gi=ue(jn),Rn=[.5766690429101305,.1855582379065463,.1882286462349947,.29734497525053605,.6273635662554661,.07529145849399788,.02703136138641234,.07068885253582723,.9913375368376388],bi=ue(Rn),Ln=[.7977604896723027,.13518583717574031,.0313493495815248,.2880711282292934,.7118432178101014,8565396060525902e-20,0,0,.8251046025104602],wi=ue(Ln),Wn=[.6369580483012914,.14461690358620832,.1688809751641721,.2627002120112671,.6779980715188708,.05930171646986196,0,.028072693049087428,1.0609850577107909],ki=ue(Wn);function yi({r:t,g:e,b:r,alpha:n}){const[s,i,o]=V([t,e,r],Yt);return new X(s,i,o,n)}function vi({x:t,y:e,z:r,alpha:n}){const[s,i,o]=V([t,e,r],On);return new Rt(s,i,o,n)}function xi({r:t,g:e,b:r,alpha:n}){const s=[Ie(t),Ie(e),Ie(r)],[i,o,a]=V(s,jn);return new X(i,o,a,n)}function Si({x:t,y:e,z:r,alpha:n}){const s=V([t,e,r],gi),[i,o,a]=s.map(Pn);return new Lt(i,o,a,n)}function Ei({r:t,g:e,b:r,alpha:n}){const s=[xt(t),xt(e),xt(r)],[i,o,a]=V(s,Rn);return new X(i,o,a,n)}function Ci({x:t,y:e,z:r,alpha:n}){const s=V([t,e,r],bi),[i,o,a]=s.map(pi);return new Wt(i,o,a,n)}function Mi({r:t,g:e,b:r,alpha:n}){const s=[St(t),St(e),St(r)],i=V(s,Ln),[o,a,l]=V(i,hn);return new X(o,a,l,n)}function Ii({x:t,y:e,z:r,alpha:n}){const s=V([t,e,r],Kt),i=V(s,wi),[o,a,l]=i.map(mi);return new Dt(o,a,l,n)}function Oi({r:t,g:e,b:r,alpha:n}){const s=[Et(t),Et(e),Et(r)],[i,o,a]=V(s,Wn);return new X(i,o,a,n)}function Ai({x:t,y:e,z:r,alpha:n}){const s=V([t,e,r],ki),[i,o,a]=s.map(di);return new qt(i,o,a,n)}const Mr={rgb:{to:Gt,from:Zt},hsl:{to:Jt,from:Qt},hsv:{to:ni,from:si},hwb:{to:ii,from:oi},lab:{to:In,from:Mn},lch:{to:ai,from:li},oklab:{to:Tn,from:zn},oklch:{to:ci,from:ui},kelvin:{to:fi,from:hi},xyz:{to:t=>t,from:t=>t},"srgb-linear":{to:yi,from:vi},"display-p3":{to:xi,from:Si},"a98-rgb":{to:Ei,from:Ci},"prophoto-rgb":{to:Mi,from:Ii},rec2020:{to:Oi,from:Ai}};function ke(t,e){if(t.colorSpace===e)return t;const r=Mr[t.colorSpace];if(!r)throw new Error(`Unknown source color space: "${t.colorSpace}"`);const n=Mr[e];if(!n)throw new Error(`Unknown target color space: "${e}"`);const s=r.to(t),i=n.from;return i(s)}const Ee=1e-6;function Bi(t){const e=ke(t,"rgb"),r=Number.isNaN(e.r)?0:e.r,n=Number.isNaN(e.g)?0:e.g,s=Number.isNaN(e.b)?0:e.b;if(r>=0&&r<=1&&n>=0&&n<=1&&s>=0&&s<=1)return t;if(r>=-Ee&&r<=1+Ee&&n>=-Ee&&n<=1+Ee&&s>=-Ee&&s<=1+Ee){const c=new q(G(r,0,1),G(n,0,1),G(s,0,1),t.alpha);return ke(c,t.colorSpace)}const[i,o,a]=Ls(r,n,s),l=new q(i,o,a,t.alpha);return ke(l,t.colorSpace)}const Pi={hsl:"h",hsv:"h",hwb:"h",lch:"h",oklch:"h"};function Ti(t,e,r,n="shorter"){if(Number.isNaN(t)&&Number.isNaN(e))return 0;if(Number.isNaN(t))return e;if(Number.isNaN(e))return t;let s=e-t;switch(n){case"shorter":s>.5?t+=1:s<-.5&&(e+=1);break;case"longer":s>0&&s<.5?t+=1:s>-.5&&s<=0&&(e+=1);break;case"increasing":s<0&&(e+=1);break;case"decreasing":s>0&&(t+=1);break}let i=t+r*(e-t);return i=(i%1+1)%1,i}function zi(t,e,r,n,s="oklab",i="shorter"){const o=ke(t,s),a=ke(e,s);r<0&&(r=0),n<0&&(n=0);const l=r+n;l===0?(r=.5,n=.5):l!==1&&(r=r/l,n=n/l);const c=Math.min(l,1),u=Pi[s],f=o.keys().filter(C=>C!=="alpha"),h=Number.isNaN(o.alpha)?a.alpha:o.alpha,p=Number.isNaN(a.alpha)?o.alpha:a.alpha,T=ye(n,h,p)*c,M=[];for(const C of f){let I=o[C],v=a[C];if(Number.isNaN(I)&&Number.isNaN(v)){M.push(0);continue}if(Number.isNaN(I)&&(I=v),Number.isNaN(v)&&(v=I),C===u)M.push(Ti(I,v,n,i));else{const U=I*h,ne=v*p,he=ye(n,U,ne);M.push(T>0?he/T:0)}}const z=o.constructor;return new z(...M,T)}const Fi=(t,e,r)=>{const n=y[e][r];return n[t]??n.number},$i=(t,e,r,n,s=!1)=>{e=s?Es[r][n]:e;const{min:i,max:o}=Fi(e,r,n),[a,l,c,u]=s?[i,o,0,1]:[0,1,i,o],f=P(t,c,u,a,l);return new b(f,s?e:"")},Ni=(t,e=!1)=>{const r=t.colorSpace;return t.keys().forEach(n=>{const s=t[n]instanceof b?t[n].value:t[n];t[n]=$i(s,t[n]?.unit,r,n,e)}),t},Mt=(t,e=!1,r=!1)=>{t=r?t:t.clone();const n=Ni(t.value,e);return r?t:new b(n).coalesce(t,!0)},Ir=(t,e="oklab",r=!1,n=!1,s=!1)=>{const i=r?s?t:t.clone():Mt(t,!1,s),o=ke(i.toJSON(),e);return o.entries().forEach(([a,l])=>{o[a]=new b(l)}),i.value=o,i.superType[1]=e,n?Mt(i,!0,!0):i},Vi=(t,e,r="oklab",n=!1,s=!1,i=!1,o)=>[Ir(t,r,n,s,i),Ir(e,r,n,s,i),o],Dn=["px","cm","mm","Q","in","pc","pt"],qn=["em","ex","ch","cap","ic","rem","lh","rlh","vw","vh","vmin","vmax","vb","vi","svw","svh","svi","svb","svmin","svmax","lvw","lvh","lvi","lvb","lvmin","lvmax","dvw","dvh","dvi","dvb","dvmin","dvmax","cqw","cqh","cqi","cqb","cqmin","cqmax"],ji=[...Dn,...qn],Ri=["s","ms"],Li=["deg","rad","grad","turn"],Wi=["%"],Di=["Hz","kHz"],qi=["dpi","dpcm","dppx"],Ki=["fr"],Ne=["var","calc"],Ui=["string","var","calc"],Xi=["accentColor","additiveSymbols","alignContent","alignItems","alignSelf","alignmentBaseline","all","anchorName","animation","animationComposition","animationDelay","animationDirection","animationDuration","animationFillMode","animationIterationCount","animationName","animationPlayState","animationRange","animationRangeEnd","animationRangeStart","animationTimeline","animationTimingFunction","appRegion","appearance","ascentOverride","aspectRatio","backdropFilter","backfaceVisibility","background","backgroundAttachment","backgroundBlendMode","backgroundClip","backgroundColor","backgroundImage","backgroundOrigin","backgroundPosition","backgroundPositionX","backgroundPositionY","backgroundRepeat","backgroundSize","basePalette","baselineShift","baselineSource","blockSize","border","borderBlock","borderBlockColor","borderBlockEnd","borderBlockEndColor","borderBlockEndStyle","borderBlockEndWidth","borderBlockStart","borderBlockStartColor","borderBlockStartStyle","borderBlockStartWidth","borderBlockStyle","borderBlockWidth","borderBottom","borderBottomColor","borderBottomLeftRadius","borderBottomRightRadius","borderBottomStyle","borderBottomWidth","borderCollapse","borderColor","borderEndEndRadius","borderEndStartRadius","borderImage","borderImageOutset","borderImageRepeat","borderImageSlice","borderImageSource","borderImageWidth","borderInline","borderInlineColor","borderInlineEnd","borderInlineEndColor","borderInlineEndStyle","borderInlineEndWidth","borderInlineStart","borderInlineStartColor","borderInlineStartStyle","borderInlineStartWidth","borderInlineStyle","borderInlineWidth","borderLeft","borderLeftColor","borderLeftStyle","borderLeftWidth","borderRadius","borderRight","borderRightColor","borderRightStyle","borderRightWidth","borderSpacing","borderStartEndRadius","borderStartStartRadius","borderStyle","borderTop","borderTopColor","borderTopLeftRadius","borderTopRightRadius","borderTopStyle","borderTopWidth","borderWidth","bottom","boxShadow","boxSizing","breakAfter","breakBefore","breakInside","bufferedRendering","captionSide","caretColor","clear","clip","clipPath","clipRule","color","colorInterpolation","colorInterpolationFilters","colorRendering","colorScheme","columnCount","columnFill","columnGap","columnRule","columnRuleColor","columnRuleStyle","columnRuleWidth","columnSpan","columnWidth","columns","contain","containIntrinsicBlockSize","containIntrinsicHeight","containIntrinsicInlineSize","containIntrinsicSize","containIntrinsicWidth","container","containerName","containerType","content","contentVisibility","counterIncrement","counterReset","counterSet","cursor","cx","cy","d","descentOverride","direction","display","dominantBaseline","emptyCells","fallback","fieldSizing","fill","fillOpacity","fillRule","filter","flex","flexBasis","flexDirection","flexFlow","flexGrow","flexShrink","flexWrap","float","floodColor","floodOpacity","font","fontDisplay","fontFamily","fontFeatureSettings","fontKerning","fontOpticalSizing","fontPalette","fontSize","fontStretch","fontStyle","fontSynthesis","fontSynthesisSmallCaps","fontSynthesisStyle","fontSynthesisWeight","fontVariant","fontVariantAlternates","fontVariantCaps","fontVariantEastAsian","fontVariantLigatures","fontVariantNumeric","fontVariantPosition","fontVariationSettings","fontWeight","forcedColorAdjust","gap","grid","gridArea","gridAutoColumns","gridAutoFlow","gridAutoRows","gridColumn","gridColumnEnd","gridColumnGap","gridColumnStart","gridGap","gridRow","gridRowEnd","gridRowGap","gridRowStart","gridTemplate","gridTemplateAreas","gridTemplateColumns","gridTemplateRows","height","hyphenateCharacter","hyphenateLimitChars","hyphens","imageOrientation","imageRendering","inherits","initialLetter","initialValue","inlineSize","inset","insetArea","insetBlock","insetBlockEnd","insetBlockStart","insetInline","insetInlineEnd","insetInlineStart","isolation","justifyContent","justifyItems","justifySelf","left","letterSpacing","lightingColor","lineBreak","lineGapOverride","lineHeight","listStyle","listStyleImage","listStylePosition","listStyleType","margin","marginBlock","marginBlockEnd","marginBlockStart","marginBottom","marginInline","marginInlineEnd","marginInlineStart","marginLeft","marginRight","marginTop","marker","markerEnd","markerMid","markerStart","mask","maskClip","maskComposite","maskImage","maskMode","maskOrigin","maskPosition","maskRepeat","maskSize","maskType","mathDepth","mathShift","mathStyle","maxBlockSize","maxHeight","maxInlineSize","maxWidth","minBlockSize","minHeight","minInlineSize","minWidth","mixBlendMode","navigation","negative","objectFit","objectPosition","objectViewBox","offset","offsetAnchor","offsetDistance","offsetPath","offsetPosition","offsetRotate","opacity","order","orphans","outline","outlineColor","outlineOffset","outlineStyle","outlineWidth","overflow","overflowAnchor","overflowClipMargin","overflowWrap","overflowX","overflowY","overlay","overrideColors","overscrollBehavior","overscrollBehaviorBlock","overscrollBehaviorInline","overscrollBehaviorX","overscrollBehaviorY","pad","padding","paddingBlock","paddingBlockEnd","paddingBlockStart","paddingBottom","paddingInline","paddingInlineEnd","paddingInlineStart","paddingLeft","paddingRight","paddingTop","page","pageBreakAfter","pageBreakBefore","pageBreakInside","pageOrientation","paintOrder","perspective","perspectiveOrigin","placeContent","placeItems","placeSelf","pointerEvents","position","positionAnchor","positionTry","positionTryOptions","positionTryOrder","positionVisibility","prefix","quotes","r","range","resize","right","rotate","rowGap","rubyPosition","rx","ry","scale","scrollBehavior","scrollMargin","scrollMarginBlock","scrollMarginBlockEnd","scrollMarginBlockStart","scrollMarginBottom","scrollMarginInline","scrollMarginInlineEnd","scrollMarginInlineStart","scrollMarginLeft","scrollMarginRight","scrollMarginTop","scrollPadding","scrollPaddingBlock","scrollPaddingBlockEnd","scrollPaddingBlockStart","scrollPaddingBottom","scrollPaddingInline","scrollPaddingInlineEnd","scrollPaddingInlineStart","scrollPaddingLeft","scrollPaddingRight","scrollPaddingTop","scrollSnapAlign","scrollSnapStop","scrollSnapType","scrollTimeline","scrollTimelineAxis","scrollTimelineName","scrollbarColor","scrollbarGutter","scrollbarWidth","shapeImageThreshold","shapeMargin","shapeOutside","shapeRendering","size","sizeAdjust","speak","speakAs","src","stopColor","stopOpacity","stroke","strokeDasharray","strokeDashoffset","strokeLinecap","strokeLinejoin","strokeMiterlimit","strokeOpacity","strokeWidth","suffix","symbols","syntax","system","tabSize","tableLayout","textAlign","textAlignLast","textAnchor","textCombineUpright","textDecoration","textDecorationColor","textDecorationLine","textDecorationSkipInk","textDecorationStyle","textDecorationThickness","textEmphasis","textEmphasisColor","textEmphasisPosition","textEmphasisStyle","textIndent","textOrientation","textOverflow","textRendering","textShadow","textSizeAdjust","textSpacingTrim","textTransform","textUnderlineOffset","textUnderlinePosition","textWrap","timelineScope","top","touchAction","transform","transformBox","transformOrigin","transformStyle","transition","transitionBehavior","transitionDelay","transitionDuration","transitionProperty","transitionTimingFunction","translate","types","unicodeBidi","unicodeRange","userSelect","vectorEffect","verticalAlign","viewTimeline","viewTimelineAxis","viewTimelineInset","viewTimelineName","viewTransitionClass","viewTransitionName","visibility","webkitAlignContent","webkitAlignItems","webkitAlignSelf","webkitAnimation","webkitAnimationDelay","webkitAnimationDirection","webkitAnimationDuration","webkitAnimationFillMode","webkitAnimationIterationCount","webkitAnimationName","webkitAnimationPlayState","webkitAnimationTimingFunction","webkitAppRegion","webkitAppearance","webkitBackfaceVisibility","webkitBackgroundClip","webkitBackgroundOrigin","webkitBackgroundSize","webkitBorderAfter","webkitBorderAfterColor","webkitBorderAfterStyle","webkitBorderAfterWidth","webkitBorderBefore","webkitBorderBeforeColor","webkitBorderBeforeStyle","webkitBorderBeforeWidth","webkitBorderBottomLeftRadius","webkitBorderBottomRightRadius","webkitBorderEnd","webkitBorderEndColor","webkitBorderEndStyle","webkitBorderEndWidth","webkitBorderHorizontalSpacing","webkitBorderImage","webkitBorderRadius","webkitBorderStart","webkitBorderStartColor","webkitBorderStartStyle","webkitBorderStartWidth","webkitBorderTopLeftRadius","webkitBorderTopRightRadius","webkitBorderVerticalSpacing","webkitBoxAlign","webkitBoxDecorationBreak","webkitBoxDirection","webkitBoxFlex","webkitBoxOrdinalGroup","webkitBoxOrient","webkitBoxPack","webkitBoxReflect","webkitBoxShadow","webkitBoxSizing","webkitClipPath","webkitColumnBreakAfter","webkitColumnBreakBefore","webkitColumnBreakInside","webkitColumnCount","webkitColumnGap","webkitColumnRule","webkitColumnRuleColor","webkitColumnRuleStyle","webkitColumnRuleWidth","webkitColumnSpan","webkitColumnWidth","webkitColumns","webkitFilter","webkitFlex","webkitFlexBasis","webkitFlexDirection","webkitFlexFlow","webkitFlexGrow","webkitFlexShrink","webkitFlexWrap","webkitFontFeatureSettings","webkitFontSmoothing","webkitHyphenateCharacter","webkitJustifyContent","webkitLineBreak","webkitLineClamp","webkitLocale","webkitLogicalHeight","webkitLogicalWidth","webkitMarginAfter","webkitMarginBefore","webkitMarginEnd","webkitMarginStart","webkitMask","webkitMaskBoxImage","webkitMaskBoxImageOutset","webkitMaskBoxImageRepeat","webkitMaskBoxImageSlice","webkitMaskBoxImageSource","webkitMaskBoxImageWidth","webkitMaskClip","webkitMaskComposite","webkitMaskImage","webkitMaskOrigin","webkitMaskPosition","webkitMaskPositionX","webkitMaskPositionY","webkitMaskRepeat","webkitMaskSize","webkitMaxLogicalHeight","webkitMaxLogicalWidth","webkitMinLogicalHeight","webkitMinLogicalWidth","webkitOpacity","webkitOrder","webkitPaddingAfter","webkitPaddingBefore","webkitPaddingEnd","webkitPaddingStart","webkitPerspective","webkitPerspectiveOrigin","webkitPerspectiveOriginX","webkitPerspectiveOriginY","webkitPrintColorAdjust","webkitRtlOrdering","webkitRubyPosition","webkitShapeImageThreshold","webkitShapeMargin","webkitShapeOutside","webkitTapHighlightColor","webkitTextCombine","webkitTextDecorationsInEffect","webkitTextEmphasis","webkitTextEmphasisColor","webkitTextEmphasisPosition","webkitTextEmphasisStyle","webkitTextFillColor","webkitTextOrientation","webkitTextSecurity","webkitTextSizeAdjust","webkitTextStroke","webkitTextStrokeColor","webkitTextStrokeWidth","webkitTransform","webkitTransformOrigin","webkitTransformOriginX","webkitTransformOriginY","webkitTransformOriginZ","webkitTransformStyle","webkitTransition","webkitTransitionDelay","webkitTransitionDuration","webkitTransitionProperty","webkitTransitionTimingFunction","webkitUserDrag","webkitUserModify","webkitUserSelect","webkitWritingMode","whiteSpace","whiteSpaceCollapse","widows","width","willChange","wordBreak","wordSpacing","wordWrap","writingMode","x","y","zIndex","zoom"];function It(t){return t.unit==="color"}const Kn=t=>{const e={},r=(n,s=void 0)=>{if(Array.isArray(n)){n.forEach((o,a)=>r(o,s));return}else if(n instanceof N){let o=n.name;s&&(s.endsWith(n.name)?o=s:o=`${s}.${n.name}`),n.values.forEach((a,l)=>r(a,o));return}else if(zt(n)){for(const[o,a]of Object.entries(n)){const l=s?`${s}.${o}`:o;r(a,l)}return}const i=s;e[i]==null&&(e[i]=new ve),e[i].push(n),e[i]=e[i].flat()};return r(t),e},Yi=t=>{const e={};for(const[r,n]of Object.entries(t)){const s=r.split(".");let i=e;for(let o=0;o<s.length;o++){const a=s[o];o===s.length-1?Array.isArray(i)?i.push(n):i[a]=n:(a in i||(i[a]={}),i=i[a])}}return e},Un=t=>{const e={};for(const[r,n]of Object.entries(t)){const s=r.split("."),i=s[0];let o=e[i]??"",a="",l="";for(let u=1;u<s.length;u++)a+=`${s[u]}(`,l+=")";let c="";s.length>1&&Array.isArray(n)?c=n.join(", "):c=n.toString(),o+=` ${a}${c}${l}`,e[i]=o.trim()}return e};new Set(Xi);const Xn=t=>{const e=t.name,r=t.valueOf();if(!t.name.startsWith("matrix"))throw new Error("Input must be a matrix or matrix3d value");const n={scaleX:1,scaleY:1,scaleZ:1,skewX:0,skewY:0,skewZ:0,translateX:0,translateY:0,translateZ:0,rotateX:0,rotateY:0,rotateZ:0,perspectiveX:0,perspectiveY:0,perspectiveZ:0,perspectiveW:1};if(t.name==="matrix")return{...n,scaleX:r[0]??1,skewY:r[1]??0,skewX:r[2]??0,scaleY:r[3]??1,translateX:r[4]??0,translateY:r[5]??0,rotateZ:Math.atan2(r[1]??0,r[0]??1),rotateY:Math.atan2(-(r[2]??0),r[0]??1),rotateX:Math.atan2(r[1]??0,r[3]??1)};if(e==="matrix3d"){if(r.length===4)return{...n,translateX:r[0]??0,translateY:r[1]??0,translateZ:r[2]??0,perspectiveW:r[3]??1};if(r.length===16)return{scaleX:r[0]??1,skewY:r[1]??0,skewX:r[4]??0,scaleY:r[5]??1,scaleZ:r[10]??1,skewZ:r[2]??0,translateX:r[12]??0,translateY:r[13]??0,translateZ:r[14]??0,rotateX:Math.atan2(-(r[9]??0),r[10]??1),rotateY:Math.atan2(r[8]??0,Math.sqrt(Math.pow(r[0]??1,2)+Math.pow(r[1]??0,2))),rotateZ:Math.atan2(r[1]??0,r[0]??1),perspectiveX:r[3]??0,perspectiveY:r[7]??0,perspectiveZ:r[11]??0,perspectiveW:r[15]??1}}throw new Error("Unsupported matrix type or invalid number of values")};function Hi(t,e){let r=t;return e==="cm"?r*=96/2.54:e==="mm"?r*=96/25.4:e==="Q"?r*=96/(25.4*4):e==="in"?r*=96:e==="pt"?r*=4/3:e==="pc"&&(r*=16),r}function Gi(t,e,r,n){if(e==="em"&&r)t*=parseFloat(getComputedStyle(r).fontSize);else if(e==="rem")t*=parseFloat(getComputedStyle(document.documentElement).fontSize);else if(e==="vh")t*=window.innerHeight/100;else if(e==="vw")t*=window.innerWidth/100;else if(e==="vmin")t*=Math.min(window.innerHeight,window.innerWidth)/100;else if(e==="vmax")t*=Math.max(window.innerHeight,window.innerWidth)/100;else if(e==="%"&&r?.parentElement&&n){const s=parseFloat(getComputedStyle(r.parentElement).getPropertyValue(n));t=t/100*s}else if(e==="ch"&&r){const s=parseFloat(getComputedStyle(r).fontSize)||16;if(typeof OffscreenCanvas<"u"||typeof document<"u")try{const i=(typeof OffscreenCanvas<"u"?new OffscreenCanvas(1,1):document.createElement("canvas")).getContext("2d");i.font=`${s}px ${getComputedStyle(r).fontFamily}`;const o=i.measureText("0").width;t*=o>0?o:s*.5}catch{t*=s*.5}else t*=s*.5}else if(e==="ex"&&r){const s=parseFloat(getComputedStyle(r).fontSize)||16;t*=s*.5}else t=Hi(t,e);return t}function Yn(t,e){return e==="s"&&(t*=1e3),t}function Hn(t,e){return e==="grad"?t*=.9:e==="rad"?t*=180/Math.PI:e==="turn"&&(t*=360),t}function Zi(t,e){return e==="dpcm"?t*=2.54:e==="dppx"&&(t*=96),t}const m=t=>{const e=new RegExp(t.replace(/[.*+?^${}()|[\]\\]/g,"\\$&"),"i");return Z(e)},lt=Z(/-?[a-zA-Z][a-zA-Z0-9-]*/),_t=m("none"),Ji=Z(/-?\d+/).map(Number),_=Z(/-?(0|[1-9]\d*)(\.\d+)?([eE][+-]?\d+)?/).map(Number);function Qi(t){return new S(e=>e.ok(t,0))}function _i(t){return new S(e=>e.err(void 0,0))}function re(t,e){const r=t.parseState(e);if(r.isError)throw new Error(`Parse error at offset ${r.offset}`);return r.value}const eo=d(...ji.map(m)),to=d(...Li.map(m)),ro=d(...Ri.map(m)),no=d(...Di.map(m)),so=d(...qi.map(m)),io=d(...Ki.map(m)),oo=d(...Wi.map(m)),ao=w(","),lo=w(" ");d(ao,lo).trim(g);const Gn=E(_,eo).map(([t,e])=>{const r=["length"];return qn.includes(e)?r.push("relative"):Dn.includes(e)&&r.push("absolute"),new b(t,e,r)}),Zn=E(_,to).map(([t,e])=>new b(t,e,["angle"])),er=E(_,ro).map(([t,e])=>new b(t,e,["time"])),co=S.lazy(()=>d(tr,er)),uo=E(_,no).map(([t,e])=>new b(t,e,["frequency"])),fo=E(_,so).map(([t,e])=>new b(t,e,["resolution"])),ho=E(_,io).map(([t,e])=>new b(t,e,["flex"])),tr=d(E(_,oo),m("from").map(()=>[0,"%"]),m("to").map(()=>[100,"%"])).map(([t,e])=>new b(t,e,["percentage"])),Jn=S.lazy(()=>nr.Value),po=w("/").trim(g).map(()=>new b("/","string")),Qn=d(Gn,Zn,er,uo,fo,ho,tr,Jn,po,_.map(t=>new b(t)),_t.map(()=>new b(NaN))).trim(g),L={Length:Gn,Angle:Zn,Time:er,TimePercentage:co,Percentage:tr,Color:Jn,Value:Qn};function ct(t){return re(Qn,t)}const K=t=>new b(t,"color",["color",t.colorSpace],void 0,"color");function Ot(t){const e=Mt(t).value,r=e.clone();for(const n of e.keys()){const s=e[n];r[n]=s instanceof b?s.value:s}return r}function mo(t){const e=t.replace(/[^0-9.+\-*/() e]/g,"");return new Function(`return (${e})`)()}function Or(t,e){switch(t.type){case"ref":return e[t.name]??0;case"literal":return t.value;case"none":return NaN;case"calc":{let r=t.expr;const n=Object.keys(e).sort((s,i)=>i.length-s.length);for(const s of n)r=r.replace(new RegExp(`\\b${s}\\b`,"g"),String(e[s]));return mo(r)}}}function go(t,e,r,n){const s=Ot(t),i=ke(s,e),o={};for(const[f,h]of i.entries())o[f]=h;const a=r.map(f=>Or(f,o)),l=n?Or(n,o):o.alpha??1,c={rgb:q,hsl:je,hwb:Nt,lab:it,lch:Vt,oklab:ot,oklch:jt,xyz:X,"srgb-linear":Rt,"display-p3":Lt,"a98-rgb":Wt,"prophoto-rgb":Dt,rec2020:qt}[e]??q,u=new c(...a,l);return K(u)}const bo={srgb:"rgb","srgb-linear":"srgb-linear","display-p3":"display-p3","a98-rgb":"a98-rgb","prophoto-rgb":"prophoto-rgb",rec2020:"rec2020",lab:"lab",oklab:"oklab",oklch:"oklch",hsl:"hsl",hwb:"hwb",lch:"lch",xyz:"xyz","xyz-d65":"xyz","xyz-d50":"xyz"},wo={srgb:{space:"rgb",ctor:q},"srgb-linear":{space:"srgb-linear",ctor:Rt},"display-p3":{space:"display-p3",ctor:Lt},"a98-rgb":{space:"a98-rgb",ctor:Wt},"prophoto-rgb":{space:"prophoto-rgb",ctor:Dt},rec2020:{space:"rec2020",ctor:qt},xyz:{space:"xyz",ctor:X},"xyz-d65":{space:"xyz",ctor:X},"xyz-d50":{space:"xyz",ctor:X}},ko=w(","),yo=Z(/\s+/),rr=w("/"),ut=w("("),ft=w(")"),At=d(ko.trim(g),yo),vo=d(rr.trim(g),At),Q=S.lazy(()=>d(L.Percentage,L.Angle.map(t=>{const e=Hn(t.value,t.unit);return new b(e,"deg",["angle"])}),d(_,Ji).map(t=>new b(t)),_t.map(()=>new b(NaN)))),qe=d(m("calc").next(Z(/\(([^)]+)\)/,t=>t?.[1]??null)).map(t=>({type:"calc",expr:t})),_t.map(()=>({type:"none"})),Z(/\b(alpha|r|g|b|h|s|l|c|w|a|x|y|z)\b/).map(t=>({type:"ref",name:t})),Q.map(t=>({type:"literal",value:t.value}))),oe=t=>{const e=w(t).skip(m("a").opt()),r=d(E(Q.skip(vo),Q),Q.map(s=>[s])),n=E(Q.skip(At),Q.skip(At),r).trim(g).wrap(ut,ft);return e.next(n).map(([s,i,[o,a]])=>[s,i,o,a??new b(1)])};function fe(t,e){return w(t).skip(m("a").opt()).next(E(m("from").skip(g).next(S.lazy(()=>nr.Value)),g.next(qe),g.next(qe),g.next(qe),rr.trim(g).next(qe).opt()).trim(g).wrap(ut,ft)).map(([r,n,s,i,o])=>go(r,e,[n,s,i],o))}const xo=Z(/#[0-9a-fA-F]{3,8}/).map(t=>{const{r:e,g:r,b:n,alpha:s}=Ws(t);return K(new q(e,r,n,s))}),So=_.skip(m("k")).map(t=>{const e=vn(new ln(t));return K(e)}),Eo=d(fe("rgb","rgb"),oe("rgb").map(([t,e,r,n])=>K(new q(t,e,r,n)))),Co=d(fe("hsl","hsl"),oe("hsl").map(([t,e,r,n])=>K(new je(t,e,r,n)))),Mo=oe("hsv").map(([t,e,r,n])=>K(new $t(t,e,r,n))),Io=d(fe("hwb","hwb"),oe("hwb").map(([t,e,r,n])=>K(new Nt(t,e,r,n)))),Oo=d(fe("lab","lab"),oe("lab").map(([t,e,r,n])=>K(new it(t,e,r,n)))),Ao=d(fe("lch","lch"),oe("lch").map(([t,e,r,n])=>K(new Vt(t,e,r,n)))),Bo=d(fe("oklab","oklab"),oe("oklab").map(([t,e,r,n])=>K(new ot(t,e,r,n)))),Po=d(fe("oklch","oklch"),oe("oklch").map(([t,e,r,n])=>K(new jt(t,e,r,n)))),To=d(fe("xyz","xyz"),oe("xyz").map(([t,e,r,n])=>K(new X(t,e,r,n)))),zo=d(m("srgb-linear").map(()=>"srgb-linear"),m("srgb").map(()=>"srgb"),m("display-p3").map(()=>"display-p3"),m("a98-rgb").map(()=>"a98-rgb"),m("prophoto-rgb").map(()=>"prophoto-rgb"),m("rec2020").map(()=>"rec2020"),m("oklab").map(()=>"oklab"),m("oklch").map(()=>"oklch"),m("lab").map(()=>"lab"),m("lch").map(()=>"lch"),m("hsl").map(()=>"hsl"),m("hwb").map(()=>"hwb"),m("xyz-d65").map(()=>"xyz-d65"),m("xyz-d50").map(()=>"xyz-d50"),m("xyz").map(()=>"xyz")),Fo=d(m("shorter"),m("longer"),m("increasing"),m("decreasing")).skip(g).skip(m("hue")),Ar=S.lazy(()=>E(nr.Value,g.next(L.Percentage).opt())),$o=m("color-mix").next(E(m("in").skip(g).next(E(zo,g.next(Fo).opt())),w(",").trim(g).next(Ar),w(",").trim(g).next(Ar)).trim(g).wrap(ut,ft)).map(([[t,e],[r,n],[s,i]])=>{const o=bo[t]??"oklab",a=e??"shorter";let l=n!=null?n.value/100:-1,c=i!=null?i.value/100:-1;l<0&&c<0?(l=.5,c=.5):l<0?l=1-c:c<0&&(c=1-l);const u=Ot(r),f=Ot(s),h=zi(u,f,l,c,o,a);return K(h)}),No=d(m("srgb-linear").map(()=>"srgb-linear"),m("srgb").map(()=>"srgb"),m("display-p3").map(()=>"display-p3"),m("a98-rgb").map(()=>"a98-rgb"),m("prophoto-rgb").map(()=>"prophoto-rgb"),m("rec2020").map(()=>"rec2020"),m("xyz-d65").map(()=>"xyz-d65"),m("xyz-d50").map(()=>"xyz-d50"),m("xyz").map(()=>"xyz")),Vo=m("color").next(E(No.skip(g),Q.skip(g),Q.skip(g),d(E(Q.skip(rr.trim(g)),Q),Q.map(t=>[t,void 0]))).trim(g).wrap(ut,ft)).map(([t,e,r,[n,s]])=>{const i=wo[t];if(!i)throw new Error(`Unknown color() space: ${t}`);const o=s??new b(1);if(t==="srgb"){const l=c=>c.value*255;return K(new q(l(e),l(r),l(n),o.value))}const a=new i.ctor(e,r,n,o);return t==="xyz-d50"&&a instanceof X&&(a.whitePoint="D50"),K(a)}),jo=d(...Object.keys(Cr).sort((t,e)=>e.length-t.length).map(m)).chain(t=>{const e=Cr[t.toLowerCase()];if(e){const r=ct(e);if(r)return Qi(r)}return _i()}),Ro=d($o,Vo,xo,So,Eo,Co,Mo,Io,Oo,Ao,Bo,Po,To,jo).trim(g),nr={Value:Ro};class b{constructor(e,r,n,s,i,o){this.value=e,this.unit=r,this.superType=n,this.subProperty=s,this.property=i,this.targets=o}setSubProperty(e){this.subProperty=e}setProperty(e){this.property=e}setTargets(e){this.targets=e}valueOf(){return this.value}setValue(e){this.value=e}toString(){return this.value==null?"":this.unit==null||this.unit==="string"?`${this.value}`:It(this)?this.value.toString():this.unit==="var"?`var(${this.value})`:this.unit==="calc"?`calc(${this.value})`:`${this.value}${this.unit}`}toJSON(){return this.valueOf()}toFixed(e=2){const r=Number(this.value).toFixed(e).replace(/\.0+$/,"");return new b(r).coalesce(this,!0).toString()}clone(){return new b(ce(this.value),this.unit,ce(this.superType),this.subProperty,this.property)}coalesce(e,r=!1){return e==null?this:Ui.includes(this.unit)?this:r?(this.unit??=e.unit,this.superType??=e.superType,this.subProperty??=e.subProperty,this.property??=e.property,this.targets??=e.targets,this):new b(ce(this.value),this.unit??e.unit,ce(this.superType??e.superType),this.subProperty??e.subProperty,this.property??e.property,this.targets??e.targets)}}class N{constructor(e,r){this.name=e,this.values=r,r.forEach(n=>{this.setSubProperty(e)})}setSubProperty(e){this.values.forEach(r=>r.setSubProperty(e))}setProperty(e){this.values.forEach(r=>r.setProperty(e))}setTargets(e){this.values.forEach(r=>r.setTargets(e))}setValue(e,r){r!=null?this.values[r].setValue(e):this.values.forEach(n=>n.setValue(e))}valueOf(){return this.values.map(e=>e.valueOf())}toString(){return(this.name==="+"||this.name==="-"||this.name==="*"||this.name==="/")&&this.values.length===2?`${this.values[0].toString()} ${this.name} ${this.values[1].toString()}`:`${this.name}(${this.values.map(e=>e.toString()).join(", ")})`}toJSON(){return{[this.name]:this.values.map(e=>e.toJSON())}}clone(){return new N(this.name,this.values.map(e=>e.clone()))}}class ve extends Array{constructor(...e){super(...e)}setSubProperty(e){this.forEach(r=>r.setSubProperty(e))}setProperty(e){this.forEach(r=>r.setProperty(e))}setTargets(e){this.forEach(r=>r.setTargets(e))}setValue(e,r){r!=null?this[r].setValue(e):this.forEach(n=>n.setValue(e))}valueOf(){return this.map(e=>e.valueOf())}toString(){return this.map(e=>e.toString()).join(" ")}toJSON(){return this.map(e=>e.toJSON())}clone(){return new ve(...this.map(e=>e.clone()))}}const ee=w("("),te=w(")"),Br=w(",");function Lo(t,e){const r=S.lazy(()=>d(a.trim(g).wrap(ee,te),e,t).trim(g)),n=S.lazy(()=>d(E(w("-").trim(g),r).map(([,l])=>new N("*",[new b(-1),l])),E(w("+").trim(g),r).map(([,l])=>l),r)),s=d(w("*"),w("/")).trim(g),i=d(w("+"),w("-")).trim(g),o=E(n,E(s,n).many()).map(([l,c])=>{let u=l;for(const[f,h]of c)u=new N(f,[u,h]);return u}),a=E(o,E(i,o).many()).map(([l,c])=>{let u=l;for(const[f,h]of c)u=new N(f,[u,h]);return u});return a}function Wo(t){const e=S.lazy(()=>I),r=Lo(t,e),n=w("calc").next(r.trim(g).wrap(ee,te)).map(v=>new N("calc",[v])),s=r.trim(g),i=s.sepBy(Br.trim(g)),o=w("min").next(i.wrap(ee,te)).map(v=>new N("min",v)),a=w("max").next(i.wrap(ee,te)).map(v=>new N("max",v)),l=w("clamp").next(i.wrap(ee,te)).map(v=>{if(v.length!==3)throw new Error("clamp() requires exactly 3 arguments");return new N("clamp",v)}),c=d(w("nearest"),w("up"),w("down"),w("to-zero")).trim(g),u=w("round").next(E(c.skip(Br.trim(g)).opt(),i).wrap(ee,te)).map(([v,U])=>{const ne=new b(v??"nearest","string");return new N("round",[ne,...U])}),f=v=>w(v).next(i.wrap(ee,te)).map(U=>{if(U.length!==2)throw new Error(`${v}() requires exactly 2 arguments`);return new N(v,U)}),h=v=>w(v).next(s.trim(g).wrap(ee,te)).map(U=>new N(v,[U])),p=f("pow"),T=f("atan2"),M=w("hypot").next(i.wrap(ee,te)).map(v=>new N("hypot",v)),z=w("log").next(i.wrap(ee,te)).map(v=>{if(v.length<1||v.length>2)throw new Error("log() requires 1 or 2 arguments");return new N("log",v)}),C=d(w("infinity").map(()=>new b(1/0)),w("-infinity").map(()=>new b(-1/0)),w("NaN").map(()=>new b(NaN)),w("pi").map(()=>new b(Math.PI)),w("e").map(()=>new b(Math.E))),I=d(n,o,a,l,u,f("mod"),f("rem"),h("abs"),h("sign"),h("sin"),h("cos"),h("tan"),h("asin"),h("acos"),h("atan"),T,p,h("sqrt"),M,z,h("exp"),C);return{calcFn:n,mathFunction:I,calcSum:r}}const et=w("("),tt=w(")"),Bt=w(","),_n=S.lazy(()=>_o.sepBy(d(Bt,g)).trim(g).map(t=>new ve(...t))),sr=t=>E(t||lt,_n.wrap(et,tt)),Do=()=>{const t=S.lazy(()=>d(Z(/[^()]+/),t.many(1).wrap(et,tt).map(e=>`(${e.flat().join("")})`)).many(1));return w("var").next(t.trim(g).wrap(et,tt).map(e=>[e].flat(1/0).join(""))).map(e=>new b(e,"var"))},{mathFunction:es}=Wo(L.Value),qo=["translate","scale","rotate","skew"],Pt=["x","y","z"],Ko=Pt.map(m),Uo=qo.map(m),Xo=()=>{const t=E(d(...Uo),d(...Ko,w(""))),e=(r,n)=>r+n.toUpperCase();return sr(t).map(([[r,n],s])=>{const i=r.toLowerCase(),o=i==="skew"?Pt.filter(c=>c!=="z"):Pt,a={};if(n){const c=i+n.toUpperCase();a[c]=s[0]}else s.length===1?o.forEach(c=>{const u=e(i,c);a[u]=s[0]}):s.forEach((c,u)=>{const f=e(i,o[u]);a[f]=c});const l=Object.entries(a).map(([c,u])=>new N(c,[u]));return new ve(...l)})},Yo={left:270,right:90,top:0,bottom:180},Ho={"top left":315,"left top":315,"top right":45,"right top":45,"bottom right":135,"right bottom":135,"bottom left":225,"left bottom":225},Go=()=>{const t=d(...["linear-gradient","radial-gradient","conic-gradient","repeating-linear-gradient","repeating-radial-gradient","repeating-conic-gradient"].map(m)),e=d(...["left","right","top","bottom"].map(m)),r=E(w("to").skip(g),e.skip(g),e).map(([,u,f])=>{const h=`${u.toLowerCase()} ${f.toLowerCase()}`,p=Ho[h];if(p==null)throw new Error(`Invalid gradient corner: to ${u} ${f}`);return new b(p,"deg")}),n=E(w("to").skip(g),e).map(([,u])=>new b(Yo[u.toLowerCase()],"deg")),s=d(r,n),i=E(m("from").skip(g),L.Angle).map(([,u])=>u),o=d(L.Angle,s),a=d(L.Length,L.Percentage),l=E(L.Color,a.sepBy(g)).map(([u,f])=>!f||f.length===0?[u]:[u,...f]),c=E(l,Bt.trim(g).next(d(l,a)).many()).map(([u,f])=>[u,...f]);return E(t,E(d(i,o).skip(Bt).opt(),c).trim(g).wrap(et,tt).map(([u,f])=>u?[u,...f].flat():[f])).map(([u,f])=>new N(u,f))},Zo=()=>sr(w("cubic-bezier")).map(t=>new N("cubic-bezier",t[1])),Jo=["inherit","initial","unset","revert","revert-layer"],Qo=d(...Jo.map(m)).map(t=>new b(t.toLowerCase(),"string",["keyword"])),ts=Z(/[^\(\)\{\}\s,;]+/).map(t=>new b(t)),ir=d(Xo(),Do(),es,Go(),Zo(),sr().map(([t,e])=>new N(t,e))),_o=d(Qo,L.Value,ir,ts).trim(g),rs={Function:ir,FunctionArgs:_n},ea=E(w("{"),Z(/[^{}]+/),w("}")).map(t=>{const e=t.join(`
|
|
8
|
-
`);let r=JSON.parse(e);return new b(r,"json")}),ns=d(es,L.Value,ir,ea,ts).trim(g);ns.sepBy(g);const ta=J(t=>re(ns,t));J(t=>re(L.Percentage,String(t)).valueOf());J(t=>re(L.Time.map(e=>e.unit==="ms"?e.value:e.unit==="s"?e.value*1e3:e.value),t));J((t,e)=>(()=>{if(!e)return t;if(t.unit==="var"){const r=getComputedStyle(e).getPropertyValue(t.value);return ct(r)}if(t.unit==="calc"&&t.property&&t.subProperty&&t.value&&e){const r=t.property,n=e.style[r],s=t.subProperty?`${t.subProperty}(${t.toString()})`:t.toString();e.style[r]=s;const i=getComputedStyle(e).getPropertyValue(r);e.style[r]=n;const o=ta(i);if(o instanceof b)return o;if(o.name.startsWith("matrix")){const a=Xn(o)[t.subProperty];if(a!=null)return new b(a,"px",["length","absolute"])}}return t})().coalesce(t),{keyFn:(t,e)=>`${t.toString()}-${JSON.stringify(e)}`});function ra(t){return t}function Pr(t){return t*t}function Tr(t){return-t*(t-2)}function zr(t){return(t/=.5)<1?.5*t*t:-.5*(--t*(t-2)-1)}function Fr(t){return t*t*t}function $r(t){return(t=t-1)*t*t+1}function rt(t){return(t/=.5)<1?.5*t*t*t:.5*((t-=2)*t*t+2)}function Nr(t){return t*t*(3-2*t)}function na(t,e,r,n=1e-6){let s=t;for(let a=0;a<8;a++){const l=s*s,c=l*s,u=1-s,f=u*u,h=3*f*s*e+3*u*l*r+c-t;if(Math.abs(h)<n)return s;const p=3*f*e+6*u*s*(r-e)+3*l*(1-r);if(Math.abs(p)<1e-12)break;s-=h/p}let i=0,o=1;s=t;for(let a=0;a<64;a++){const l=1-s,c=3*l*l*s*e+3*l*s*s*r+s*s*s;if(Math.abs(c-t)<n)return s;t>c?i=s:o=s,s=(i+o)/2}return s}const ie=(t,e,r,n)=>s=>{if(s<=0)return 0;if(s>=1)return 1;const i=na(s,t,r);return Bs(i,t,e,r,n)[1]};function Vr(t){return t=ie(.09,.91,.5,1.5)(t),t}function jr(t){return t=ie(.09,.91,.5,1.5)(t),t}function Rr(t){return t=at(t,[[0,0],[.026,1.746],[.633,1.06],[1,0]])[1],t}function Lr(t){return t=at(t,[[0,0],[.367,.94],[.974,.254],[1,0]])[1],t}function Wr(t){return t=at(t,[[0,0],[.026,1.746],[.633,1.06],[1,0]])[1],t}function Dr(t){return t=at(t,[[0,0],[.026,1.746],[.633,1.06],[1,0]])[1],t}function qr(t){return 1-Math.cos(t*Math.PI/2)}function Kr(t){return Math.sin(t*Math.PI/2)}function Ur(t){return-(Math.cos(Math.PI*t)-1)/2}function Xr(t){return 1-Math.sqrt(1-t*t)}function Yr(t){return Math.sqrt(1- --t*t)}function Hr(t){return(t/=.5)<1?-(Math.sqrt(1-t*t)-1)/2:(Math.sqrt(1-(t-=2)*t)+1)/2}function Gr(t){return t===0?0:Math.pow(2,10*(t-1))}function Zr(t){return t===1?1:1-Math.pow(2,-10*t)}function Jr(t){return t===0?0:t===1?1:(t/=.5)<1?.5*Math.pow(2,10*(t-1)):.5*(2-Math.pow(2,-10*--t))}function sa(t,e){return Math.ceil(t*e)/e}function ia(t,e){return Math.floor(t*e)/e}function oa(t,e){return Math.floor(t*(e+1))/(e+1)}function aa(t,e){return e<=1?t:Math.floor(t*(e-1))/(e-1)}function or(t,e="jump-end"){switch(e){case"jump-none":return r=>aa(r,t);case"jump-start":case"start":return r=>sa(r,t);case"jump-end":case"end":return r=>ia(r,t);case"jump-both":case"both":return r=>oa(r,t)}}function la(){return or(1,"jump-start")}function ca(){return or(1,"jump-end")}const ge={ease:[.25,.1,.25,1],"ease-in":[.42,0,1,1],"ease-out":[0,0,.58,1],"ease-in-out":[.42,0,.58,1],"ease-in-back":[.6,-.28,.735,.045],"ease-out-back":[.175,.885,.32,1.275],"ease-in-out-back":[.68,-.55,.265,1.55]},ua={linear:ra,easeInQuad:Pr,"ease-in-quad":Pr,easeOutQuad:Tr,"ease-out-quad":Tr,easeInOutQuad:zr,"ease-in-out-quad":zr,easeInCubic:Fr,"ease-in-cubic":Fr,easeOutCubic:$r,"ease-out-cubic":$r,easeInOutCubic:rt,"ease-in-out-cubic":rt,easeInBounce:Vr,"ease-in-bounce":Vr,bounceInEase:jr,"bounce-in-ease":jr,bounceInEaseHalf:Rr,"bounce-in-ease-half":Rr,bounceOutEase:Lr,"bounce-out-ease":Lr,bounceOutEaseHalf:Wr,"bounce-out-ease-half":Wr,bounceInOutEase:Dr,"bounce-in-out-ease":Dr,easeInSine:qr,"ease-in-sine":qr,easeOutSine:Kr,"ease-out-sine":Kr,easeInOutSine:Ur,"ease-in-out-sine":Ur,easeInCirc:Xr,"ease-in-circ":Xr,easeOutCirc:Yr,"ease-out-circ":Yr,easeInOutCirc:Hr,"ease-in-out-circ":Hr,easeInExpo:Gr,"ease-in-expo":Gr,easeOutExpo:Zr,"ease-out-expo":Zr,easeInOutExpo:Jr,"ease-in-out-expo":Jr,smoothStep3:Nr,"smooth-step-3":Nr,ease:ie(...ge.ease),"ease-in":ie(...ge["ease-in"]),"ease-out":ie(...ge["ease-out"]),"ease-in-out":ie(...ge["ease-in-out"]),"ease-in-back":ie(...ge["ease-in-back"]),"ease-out-back":ie(...ge["ease-out-back"]),"ease-in-out-back":ie(...ge["ease-in-out-back"]),steps:or,"step-start":la,"step-end":ca},Qr=4;function _r(t,e="^",r=!1){const n=t.src.split(`
|
|
9
|
-
`),s=Math.min(n.length-1,t.getLineNumber()),i=Math.max(s-Qr,0),o=Math.min(s+Qr+1,n.length),a=n.slice(i,o);if(e){const c=" ".repeat(t.getColumnNumber())+e;a.splice(s-i+1,0,c)}return a.map((c,u)=>` ${i+u+1}| ${c}`).join(`
|
|
10
|
-
`)}const be=new Map;function ss(t){if(be.has(t.id))return be.get(t.id);const e=(n,s)=>{if(be.has(n.id))return be.get(n.id);const{name:i,args:o,parser:a}=n.context,l=a!=null?e(a,s):"unknown",u=(()=>{switch(i){case"string":return`"${o[0]}"`;case"regex":case"regexConcat":case"regexWrap":return`${o[0]}`;case"wrap":case"trim":{const[f,h]=o;return`${e(f,s)} ${l} ${e(h,s)}`}case"trimWhitespace":return`${l}?w`;case"not":return`!${l}`;case"opt":return`${l}?`;case"next":{const[f]=o;return`${l} >> ${e(f,s)}`}case"skip":{const[f]=o;return`${l} << ${e(f,s)}`}case"map":return l;case"all":case"then":return`[${o.map(h=>e(h,s)).join(", ")}]`;case"any":case"or":return o.map(h=>e(h,s)).join(" | ");case"many":{const[f,h]=o,p=h===1/0?`${f},`:`${f},${h}`;return`${l} {${p}}`}case"sepBy":return`${l} sepBy ${e(o[0],s)}`;case"lazy":{const[f]=o,h=ma(f);if(s)return i;{const p=e(h,h.id);return be.set(h.id,p),p}}case"debug":return l;default:return}})()??i??"unknown";return s&&be.set(n.id,u),u},r=e(t);return be.set(t.id,r),r}function is(t,e="",r=""){const n=String(t.value),s=t.offset>=t.src.length,a=`${`[${t.isError?"err":s?"done":"ok"}]`} ${e} offset=${t.offset} value=${n}`,l=t.offset>=t.src.length?_r(t,"",t.isError):_r(t,"^",t.isError);return`${a}
|
|
11
|
-
${l}`}function fa(t,e="",r=!1,n=console.log){const s=i=>{const o=t.parser(i),a=r?ss(t):t.context.name??"",l=is(o,e,a);return n(l),o};return new B(s,A("debug",t,n))}class nt{constructor(e,r=void 0,n=0,s=!1,i=0){this.src=e,this.value=r,this.offset=n,this.isError=s,this.furthest=i}expected;ok(e,r=0){return this.offset+=r,this.value=e,this.isError=!1,this}err(e,r=0){return this.offset+=r,this.value=e,this.isError=!0,this}from(e,r=0){return this.offset+=r,this.value=e,this}save(){return{offset:this.offset,value:this.value}}restore(e){return this.offset=e.offset,this.value=e.value,this.isError=!1,this}clone(){return new nt(this.src,this.value,this.offset,this.isError,this.furthest)}getColumnNumber(){const e=this.offset,r=this.src.lastIndexOf(`
|
|
12
|
-
`,e),n=r===-1?e:e-(r+1);return Math.max(0,n)}getLineNumber(){const e=this.src.lastIndexOf(`
|
|
13
|
-
`,this.offset);return e>=0?this.src.slice(0,e).split(`
|
|
14
|
-
`).length:0}toString(){return is(this)}}function A(t,e,...r){return{name:t,parser:e,args:r}}let ha=0;const we=new Map,Ke=new Map,os=20,pa=(1<<os)-1;let $e=-1,st;function $(t,e){return t.offset>$e?($e=t.offset,st=t,t.expected=void 0):t.offset,st}function ma(t){return t.parser?t.parser:t.parser=t()}function da(t){let e;return r=>(e||(e=t()),e.parser(r))}const ga=0,Ue=1,ba=2;class B{constructor(e,r={}){this.parser=e,this.context=r}id=ha++;state;flags=ga;reset(){st=void 0,$e=-1,we.clear(),Ke.clear()}parseState(e){this.reset();const r=new nt(e);if(this.parser(r),r.isError&&st){const n=new nt(e,void 0,$e,!0);this.state=n}else this.state=r,r.isError;return r}parse(e){return this.parseState(e).value}getCijKey(e){return this.id<<os|e.offset&pa}atLeftRecursionLimit(e){return(Ke.get(this.getCijKey(e))??0)>e.src.length-e.offset}memoize(){const e=r=>{const n=this.getCijKey(r),s=Ke.get(n)??0,i=we.get(this.id);if(i&&i.offset>=r.offset)return r.offset=i.offset,r.value=i.value,r.isError=i.isError,r;if(this.atLeftRecursionLimit(r))return r.isError=!0,r;Ke.set(n,s+1),this.parser(r);const o=we.get(this.id);return o&&o.offset>r.offset?r.offset=o.offset:o||we.set(this.id,r.clone()),r};return new B(e,A("memoize",this))}mergeMemos(){const e=r=>{const n=we.get(this.id);return n?(r.offset=n.offset,r.value=n.value,r.isError=n.isError,r):this.atLeftRecursionLimit(r)?(r.isError=!0,r):(this.parser(r),we.get(this.id)||we.set(this.id,r.clone()),r)};return new B(e,A("mergeMemo",this))}then(e){const r=n=>{const s=n.offset;if(this.parser(n),!n.isError){const i=n.value;if(e.parser(n),!n.isError)return n.ok([i,n.value])}return $(n),n.offset=s,n.isError=!0,n};return new B(r,A("then",this,this,e))}or(e){const r=n=>{const s=n.offset;return this.parser(n),n.isError?(n.offset=s,n.isError=!1,e.parser(n)):n};return new B(r,A("or",this,this,e))}chain(e,r=!1){const n=s=>(this.parser(s),s.isError?s:s.value||r?e(s.value).parser(s):s);return new B(n,A("chain",this,e))}map(e,r=!1){const n=s=>(this.parser(s),!s.isError||r?s.ok(e(s.value)):s);return new B(n,A("map",this))}mapState(e){const r=n=>{const s=n.offset,i=n.value;if(this.parser(n),n.isError)return n;const o=Object.create(n);return o.offset=s,o.value=i,e(n,o)};return new B(r,A("mapState",this))}skip(e){const r=n=>{const s=n.offset;if(this.parser(n),!n.isError){const i=n.value;if(e.parser(n),!n.isError)return n.ok(i)}return $(n),n.offset=s,n.isError=!0,n};return new B(r,A("skip",this,e))}next(e){const r=n=>{const s=n.offset;return this.parser(n),!n.isError&&(e.parser(n),!n.isError)||($(n),n.offset=s,n.isError=!0),n};return new B(r,A("next",this,e))}opt(){const e=r=>{const n=r.offset;return this.parser(r),r.isError?($(r),r.offset=n,r.ok(void 0)):r};return new B(e,A("opt",this))}not(e){const r=s=>{const i=s.offset,o=s.value;return this.parser(s),s.isError?($(s),s.offset=i,s.ok(o)):(s.offset=i,s.isError=!0,s)},n=s=>{const i=s.offset;if(this.parser(s),s.isError)return $(s),s.offset=i,s.isError=!0,s;{const o=s.value,a=s.offset;return s.offset=i,s.isError=!1,e.parser(s),s.isError?(s.offset=a,s.value=o,s.isError=!1,s):($(s),s.offset=i,s.isError=!0,s)}};return new B(e?n:r,A("not",this,e))}wrap(e,r,n=!0){if(!n)return Ve(e,this,r);const s=this,i=o=>{const a=o.offset;if(e.parser(o),o.isError)return o.offset=a,o;if(s.parser(o),o.isError)return $(o),o.offset=a,o.isError=!0,o;const l=o.value;return r.parser(o),o.isError?($(o),o.offset=a,o.isError=!0,o):(o.value=l,o)};return new B(i,A("wrap",this,e,r))}call(e){if(this.flags===0)return this.parser(e);if(this.flags===Ue){Ce(e);const n=e.offset;return this.parser(e),e.isError?($(e),e.offset=n,e.isError=!0,e):(Ce(e),e)}this.flags&Ue&&Ce(e);const r=e.offset;return this.parser(e),e.isError?($(e),e.offset=r,e.isError=!0,e):(this.flags&Ue&&Ce(e),this.flags&ba&&e.offset<e.src.length&&($(e),e.offset=r,e.isError=!0),e)}trim(e=lr,r=!0){if(!r)return Ve(e,this,e);if(e.context?.name==="whitespace"){const n=this,s=new B((o=>n.call(o)),A("trimWhitespace",this));s.flags=this.flags|Ue;const i=o=>{Ce(o);const a=o.offset;return n.parser(o),o.isError?($(o),o.offset=a,o.isError=!0,o):(Ce(o),o)};return new B(i,A("trimWhitespace",this))}return this.wrap(e,e)}many(e=0,r=1/0){const n=s=>{const i=e>0?e:0,o=i>0?new Array(i):[];let a=0;for(let l=0;l<r;l+=1){const c=s.offset;if(this.parser(s),s.isError){s.offset=c,s.isError=!1;break}if(s.offset===c)break;a<i?o[a]=s.value:o.push(s.value),a++}return a<i&&(o.length=a),a>=e?s.ok(o):($(s),s.isError=!0,s.value=[],s)};return new B(n,A("many",this,e,r))}sepBy(e,r=0,n=1/0){const s=i=>{const o=r>0?r:0,a=o>0?new Array(o):[];let l=0;for(let c=0;c<n;c+=1){const u=i.offset;if(this.parser(i),i.isError){i.offset=u,i.isError=!1;break}if(i.offset===u)break;l<o?a[l]=i.value:a.push(i.value),l++;const f=i.offset;if(e.parser(i),i.isError){i.offset=f,i.isError=!1;break}}return l<o&&(a.length=l),l>=r?i.ok(a):($(i),i.isError=!0,i.value=[],i)};return new B(s,A("sepBy",this,e))}eof(){const e=this.skip(wa());return e.context=A("eof",this),e}debug(e="",r=!1,n=console.log){return fa(this,e,r,n)}toString(){return ss(this)}static lazy(e){return new B(da(e),A("lazy",void 0,e))}}function wa(){const t=e=>e.offset>=e.src.length?e.ok(void 0):($(e),e.isError=!0,e);return new B(t,A("eof",void 0))}function Re(...t){const e=r=>{const n=r.offset;for(const s of t){if(s.parser(r),!r.isError)return r;r.offset=n,r.isError=!1}return $(r),r.isError=!0,r};return new B(t.length===1?t[0].parser:e,A("any",void 0,...t))}function Ve(...t){const e=r=>{const n=[],s=r.offset;for(const i of t){if(i.parser(r),r.isError)return r.offset=s,r.isError=!0,r;r.value!==void 0&&n.push(r.value)}return r.ok(n)};return new B(t.length===1?t[0].parser:e,A("all",void 0,...t))}function ae(t){const e=t.length;let r;if(e===1){const n=t.charCodeAt(0);r=(s=>s.src.charCodeAt(s.offset)===n?(s.offset+=1,s.value=t,s.isError=!1,s):($(s),s.isError=!0,s))}else r=(n=>n.src.startsWith(t,n.offset)?(n.offset+=e,n.value=t,n.isError=!1,n):($(n),n.isError=!0,n));return new B(r,A("string",void 0,t))}function ar(t,e){const r=t.flags.replace(/y/g,""),n=new RegExp(t,r+"y"),s=i=>{if(i.offset>=i.src.length)return i.isError=!0,i;const o=i.offset;if(n.lastIndex=o,n.test(i.src)){const a=n.lastIndex;return a>o?(i.offset=a,i.value=i.src.substring(o,a),i.isError=!1,i):(i.value=void 0,i.isError=!1,i)}return $(i),i.isError=!0,i};return new B(s,A("regex",void 0,t))}const Ce=t=>{const e=t.src,r=e.length;let n=t.offset;if(n>=r||e.charCodeAt(n)>32)return t;for(;n<r;){const s=e.charCodeAt(n);if(s===32||s>=9&&s<=13)n++;else break}return t.offset=n,t},lr=ar(/\s*/);lr.context.name="whitespace";const ka=t=>t.replace(/\/\*[\s\S]*?\*\//g,""),ya=t=>t.replace(/\s*!important/gi,""),cr=t=>ya(ka(t));ae("(");ae(")");const va=ae(";"),xa=ae(":"),ur=ae("{"),fr=ae("}"),Sa=ae(","),Ea=ae("."),Y=lr,Ca=rs.Function,Ma=Ve(ur,ar(/[^{}]+/),fr).map(t=>{const e=t.join(`
|
|
15
|
-
`),r=JSON.parse(e);return new b(r,"json")}),hr=Re(L.Value,Ca,Ma,ar(/[^\(\)\{\}\s,;]+/).map(t=>new b(t))).trim(Y),Ia=hr.sepBy(Y),Oa=Ve(lt.skip(xa).trim(Y).map(t=>ms(t)),Ia.skip(va.opt()).trim(Y)).map(([t,e])=>{const r=new ve(...e).flat();return r.setProperty(t),{[t]:r}}),Aa=Re(L.TimePercentage.trim(Y).map(t=>t.toString()),_.map(t=>`${t}%`)),Ba=Aa.sepBy(Sa).trim(Y),as=Oa.many().trim(Y).wrap(ur,fr).map(t=>Object.assign({},...t)),Pa=ae("@keyframes").trim(Y).next(lt),en=Ve(Ba,as).map(([t,e])=>t.reduce((r,n)=>(r.set(n,e),r),new Map)),ls=Re(Pa.next(en.many(1).trim(Y).wrap(ur,fr).trim(Y)),en.many(1).trim(Y)).map(t=>t.reduce((e,r)=>{for(const[n,s]of r)e.has(n)?e.set(n,{...e.get(n),...s}):e.set(n,s);return e},new Map)),Ta=Ea.trim(Y).next(lt).trim(Y),za=as.map(t=>{const e={};for(const[r,n]of Object.entries(t))if(r.includes("animation")){const s=r.replace(/^animation/i,"").replace(/^\w/,o=>o.toLowerCase()),i=ds(n.toString());e[s]=i,delete t[r]}return{options:e,values:t}}),Fa=Ta.next(za),$a=Re(Fa.map(t=>t),ls.map(t=>({keyframes:t}))),Na=$a.sepBy(Y).map(t=>Object.assign({},...t)),tn={Value:hr,FunctionArgs:rs.FunctionArgs},Va=J(t=>re(hr,cr(t))),ja=J(t=>re(ls,cr(t)));J(t=>{const{options:e,values:r,keyframes:n}=re(Na,cr(t));return{options:e,values:r,keyframes:n}});J(t=>re(L.Percentage,String(t)).valueOf());const rn=J(t=>re(L.Time.map(e=>e.unit==="ms"?e.value:e.unit==="s"?e.value*1e3:e.value),t));J(t=>t>=5e3?`${t/1e3}s`:`${t}ms`);J(t=>t===1/0?"infinite":String(t));const Ra={duration:1e3,delay:0,iterationCount:1,direction:"normal",fillMode:"forwards",timingFunction:rt,useWAAPI:!0,colorSpace:"oklab"},La={zIndex:0,weight:1,blendMode:"replace",enabled:!0};class Wa{animations={};transform;superKey;paused=!1;started=!1;done=!1;singleTarget=!0;handleId=void 0;resolvePromise=null;constructor(...e){const r=[];for(const n of e){let s,i;n instanceof pr?s=n:(s=n.animation,i=n.layer),this.transform??=s.frames[0].transform;const o=Xe(s);this.animations[o]={values:{},animation:s,layer:{...La,...i}},s.managed=!0,r.push(s)}this.singleTarget=r.every(n=>n.targets[0]===r[0].targets[0])}setSuperKey(e){return this.superKey=e,Object.values(this.animations).forEach(r=>{r.animation.superKey=e}),this}setTargets(...e){Object.values(this.animations).forEach(n=>{n.animation.setTargets(...e)});const r=Object.values(this.animations).map(n=>n.animation);return this.singleTarget=r.every(n=>n.targets[0]===r[0].targets[0]),this}onStart(){return this.started=!0,this}onEnd(){return this}transformFramesGrouped(e){const r={},n=Object.values(this.animations);n.sort((i,o)=>i.layer.zIndex-o.layer.zIndex);let s=!0;for(const i of n){const{animation:o,values:a,layer:l}=i;if(s=s&&o.done,!l.enabled)continue;if(!(o.done||o.paused)){const u=o.interpFrames(o.t,!1);Object.assign(a,u)}const c=l.properties?Object.fromEntries(Object.entries(a).filter(([u])=>l.properties.has(u))):a;switch(l.blendMode){case"replace":Object.assign(r,c);break;case"add":for(const[u,f]of Object.entries(c))if(u in r){const h=r[u],p=f;h!=null&&typeof h.value=="number"&&p!=null&&typeof p.value=="number"?h.value=h.value+p.value:r[u]=f}else r[u]=f;break;case"weighted":for(const[u,f]of Object.entries(c))if(u in r&&l.weight<1){const h=r[u],p=f;h!=null&&typeof h.value=="number"&&p!=null&&typeof p.value=="number"?h.value=ye(l.weight,h.value,p.value):r[u]=f}else r[u]=f;break}}return this.done=s,this.transform(r,e),r}async tick(e){return this.started||this.onStart(),Object.values(this.animations).forEach(async r=>{(!r.animation.paused||r.animation.pausedTime===0)&&await r.animation.tick(e)}),this.done&&this.onEnd(),this}async draw(e){await this.tick(e),!this.paused&&(this.singleTarget?this.transformFramesGrouped(e):this.done=Object.values(this.animations).map(({animation:r})=>(r.interpFrames(r.t,!0),r)).every(r=>r.done),this.done?(this.reset(),this.resolvePromise&&this.resolvePromise()):this.handleId=Me(this.draw.bind(this)))}async play(){return new Promise(e=>{this.resolvePromise=e,this.handleId=Me(this.draw.bind(this))})}pause(){const e=this.paused;return this.started&&(this.paused=!this.paused,Object.values(this.animations).forEach(r=>{r.animation.pause(!1)})),e&&Me(this.draw.bind(this)),this}reset(){return Object.values(this.animations).forEach(e=>{const r=e.animation;r.started&&r.frames.length>0&&r.interpFrames(0,!0),r.managed=!1,r.reset()}),this.started=!1,this.done=!1,this.paused=!1,this}stop(){return an(this.handleId),this.reset(),this}playing(){return!(!this.started||this.paused)}forcePause(){this.paused=!0,Object.values(this.animations).forEach(e=>{e.animation.paused=!0})}forcePlay(){this.paused=!1,Object.values(this.animations).forEach(e=>{e.animation.paused=!1})}setLayerConfig(e,r){const n=typeof e=="string"?e:Xe(e),s=this.animations[n];return s&&Object.assign(s.layer,r),this}setLayerEnabled(e,r){return this.setLayerConfig(e,{enabled:r})}getLayerConfig(e){const r=typeof e=="string"?e:Xe(e);return this.animations[r]?.layer}}const nn=new WeakMap;let Da=0;const qa=t=>{let e=nn.get(t);return e===void 0&&(e=Da++,nn.set(t,e)),e},sn=J((t,e)=>(()=>{if(!e)return t;if(t.unit==="var"){const s=getComputedStyle(e).getPropertyValue(t.value);return ct(s)}if(t.unit==="calc"&&t.property&&t.subProperty&&t.value&&e){const s=e.style[t.property],i=t.subProperty?`${t.subProperty}(${t.toString()})`:t.toString();e.style[t.property]=i;const o=getComputedStyle(e).getPropertyValue(t.property);e.style[t.property]=s;const a=Va(o);if(a instanceof b)return a;if(a.name.startsWith("matrix")){const c=Xn(a)[t.subProperty];if(c!=null)return new b(c,"px",["length","absolute"])}}return t})().coalesce(t),{keyFn:(t,e)=>`${t.toString()}-${e?qa(e):"null"}`}),Ka=(t,e,r=!1)=>{if(t?.superType?.[0]!==e?.superType?.[0])return r?[t,e]:[t.clone(),e.clone()];const n=o=>{switch(o?.superType?.[0]){case"length":return{value:Gi(o.value,o.unit,o.targets?.[0]),unit:"px"};case"angle":return{value:Hn(o.value,o.unit),unit:"deg"};case"time":return{value:Yn(o.value,o.unit),unit:"ms"};case"resolution":return{value:Zi(o.value,o.unit),unit:"dpi"};default:return{value:o.value,unit:o.unit}}},[s,i]=[n(t),n(e)];return r?(t.value=s.value,t.unit=s.unit,e.value=i.value,e.unit=i.unit,[t,e]):[new b(s.value,s.unit,t.superType,t.subProperty,t.property,t.targets),new b(i.value,i.unit,e.superType,e.subProperty,e.property,e.targets)]};function Ua(t,e,r="oklab",n){t=t.coalesce(e,!0),e=e.coalesce(t,!0);const s={start:t,stop:e,value:t.clone()};if(It(t)&&It(e)){const[i,o]=Vi(t,e,r,!0,!1,!1,n);s.start=i,s.stop=o,s.value=i.clone()}if(t.unit!==e.unit){const[i,o]=Ka(t,e,!0);s.start=i,s.stop=o,s.value=i.clone()}return s.computed=Ne.includes(t.unit)||Ne.includes(e.unit),s}const Tt=t=>typeof t=="string"?ua[t]:t??void 0;function Xa(t,{start:e,stop:r,value:n}){const s=sn(e,e.targets?.[0]),i=sn(r,r.targets?.[0]),o=Ne.includes(s.unit)?i.unit:s.unit,a=ye(t,s.value,i.value);return n.value=a,n.unit=o,n}function Ya(t,{start:e,stop:r,value:n}){return e.value.keys().forEach(s=>{n.value[s]=ye(t,e.value[s],r.value[s])}),n}function Ha(t,e){const{start:r,stop:n,computed:s}=e;return typeof r.value=="number"&&typeof n.value=="number"?e.value.value=ye(t,r.value,n.value):r.unit==="color"?Ya(t,e):s&&Xa(t,e),e}const on=new Map;function Ga(t){const e=Kn(t),r=(s,i)=>{const o=s.split(".").pop(),a=s.split(".").shift();if(i instanceof b)return i.setProperty(a),i;if(i instanceof N)return i.setProperty(a),i.setSubProperty(o),i.values.flat();if(i instanceof ve)return i.map(h=>r(s,h)).flat();const l=String(i),c=`${o}:${l}`,u=on.get(c);if(u){const h=u.clone();return h.setProperty(a),h}const f=re(Re(tn.FunctionArgs.map(h=>(h.setSubProperty(o),h)),tn.Value),l);return f.setProperty(a),on.set(c,f.clone()),f};return Object.entries(e).map(([s,i])=>[s,r(s,i)]).reduce((s,[i,o])=>(s[i]=o,s),{})}const Za=(t,e,r,n,s="oklab",i)=>{const o=n[e][t],a=n[r][t],l=Math.max(o.length,a.length),c=o.concat(Array(Math.abs(l-o.length)).fill(new b(0))),u=a.concat(Array(Math.abs(l-a.length)).fill(new b(0)));return c.map((f,h)=>Ua(f,u[h],s,i))};function Ja(t,e,r){const[n,s]=[t.start,e.start];return{start:n.value*r/100,stop:s.value*r/100}}function cs(t,e,r=!0){t=r?t:Kn(t);const n=Un(t);e.forEach(s=>{Object.entries(n).forEach(([i,o])=>{s.style[i]=o})})}function Qa(t){if(!t.targets||t.targets.length===0)return!1;for(const e of t.frames){const r=e.transform;if(r!==cs&&r!==t.transform)return!1}if(t.frames.length>1){const e=t.frames[0].timingFunction;for(let r=1;r<t.frames.length;r++)if(t.frames[r].timingFunction!==e)return!1}for(const e of t.frames)for(const r of Object.values(e.interpVars))for(const n of r){const s=n.start?.unit,i=n.stop?.unit;if(s&&Ne.includes(s)||i&&Ne.includes(i))return!1}for(const e of t.frames)for(const r of Object.values(e.interpVars))for(const n of r)if(n.start?.unit==="color"||n.stop?.unit==="color")return!1;return!0}function _a(t){const e=t.options.duration,r=[],n=new Set;for(const i of t.frames)n.add(i.time.start),n.add(i.time.stop);const s=[...n].sort((i,o)=>i-o);for(const i of s){const o=t.interpFrames(i,!1);if(Object.keys(o).length===0)continue;const a=Un(o),l={offset:Math.max(0,Math.min(1,i/e)),...a};r.push(l)}return r}function el(t){const e=t.options,r={normal:"normal",reverse:"reverse",alternate:"alternate","alternate-reverse":"alternate-reverse"},n={none:"none",forwards:"forwards",backwards:"backwards",both:"both"};return{duration:e.duration,delay:e.delay,iterations:e.iterationCount===1/0?1/0:e.iterationCount,direction:r[e.direction]??"normal",fill:n[e.fillMode]??"forwards",easing:"linear"}}async function tl(t){const e=_a(t),r=el(t),n=[];for(const s of t.targets){const i=s.animate(e,r);n.push(i)}return await Promise.all(n.map(s=>s.finished)),n}const Xe=t=>typeof t=="string"?t:t.name??String(t.id);let rl=0;class pr{id=rl++;name;superKey;targets;options;templateFrames=[];parsedVars=[];frameId=0;frames=[];handleId=void 0;startTime=void 0;pausedTime=0;prevTime=0;t=0;iteration=0;started=!1;done=!1;reversed=!1;paused=!1;managed=!1;unflatten=!0;resolvePromise=null;dispatchAnimationEvent(e){if(!(typeof AnimationEvent>"u"))for(const r of this.targets)r.dispatchEvent(new AnimationEvent(e,{animationName:this.name??"",elapsedTime:this.t/1e3}))}constructor(e,r,n,s){this.options={},this.setOptions({...Ra,...e??{}}),this.targets=r==null?[]:Array.isArray(r)?r:[r],this.name=n,this.superKey=s}convertFrameStart(e){if(e.start.unit==="s"||e.start.unit==="ms"||!e.start.unit){const r=Yn(e.start.value,e.start.unit);e.start.value=r/this.options.duration*100,e.start.unit="%"}return e.start.value=G(e.start.value,0,100),e}addFrame(e,r,n,s){typeof e=="number"?e=String(e)+"%":typeof e=="string"?e=e:e instanceof b&&(e=String(e));const i=ct(e);let o={id:this.frameId,start:i,vars:r,transform:n,timingFunction:Tt(s)??this.options.timingFunction};return this.convertFrameStart(o),this.templateFrames.push(o),this.frameId+=1,this}createFrame(e,r){const[n,s]=[this.templateFrames[e],this.templateFrames[r]],i={start:e,stop:r},o=Ja(n,s,this.options.duration);let a=n.transform;if(a==null){const u=yr(e,this.frames,f=>f.transform!=null);a=this.frames[u].transform}let l=n.timingFunction;if(l==null){const u=yr(e,this.frames,f=>f.timingFunction!=null);l=this.frames[u].timingFunction}return{id:this.frameId++,ixs:i,start:n.start,time:o,vars:void 0,flatVars:void 0,interpVars:{},transform:a,timingFunction:l}}reconcileVars(e){const r=this.parsedVars[e];Object.keys(r).forEach(n=>{const s=this.parsedVars.findIndex((c,u)=>u>e&&c[n]!=null);if(s===-1)return;const[i,o]=[e,s],a=this.frames.findIndex(c=>c.ixs.start===i&&c.ixs.stop===o),l=a!==-1?this.frames[a]:this.createFrame(i,o);l.interpVars[n]=Za(n,i,o,this.parsedVars,this.options.colorSpace,this.options.hueMethod),a===-1&&this.frames.push(l)})}parse(){this.frames=[],this.templateFrames.sort((e,r)=>e.start.value-r.start.value),this.parsedVars=this.templateFrames.map(e=>{const r=Ga(e.vars);return Object.values(r).forEach(n=>{n.setTargets(this.targets)}),r});for(let e=0;e<this.templateFrames.length-1;e++)this.frames.push(this.createFrame(e,e+1));return this.frames.forEach((e,r)=>this.reconcileVars(r)),this.frames.sort((e,r)=>e.time.start===r.time.start?e.time.stop-r.time.stop:e.time.start-r.time.start),this.frames=this.frames.filter(e=>e.interpVars!=null&&Object.keys(e.interpVars).length>0),this.frames.forEach(e=>{e.flatVars=Object.entries(e.interpVars).reduce((r,[n,s])=>(r[n]=s.map(i=>i.value),r),{}),e.vars=Yi(e.flatVars)}),this}setTimingFunction(e){return this.options.timingFunction=Tt(e)??rt,this}setIterationCount(e){return!e||e==="infinite"||e==="∞"||e==="Infinity"?this.options.iterationCount=1/0:typeof e=="string"?this.options.iterationCount=parseFloat(e.trim()):this.options.iterationCount=e,this}setDuration(e){typeof e=="string"&&(e=rn(e));const r=this.options.duration,n=e??r,s=n/r;for(let i=0;i<this.frames.length;i++){const o=this.frames[i];o.time.start*=s,o.time.stop*=s}return this.options.duration=n,this}setDelay(e){return typeof e=="string"&&(e=rn(e)),this.options.delay=e??0,this}setDirection(e){return this.options.direction=e??"normal",this.reversed=!1,(this.options.direction==="reverse"||this.options.direction==="alternate-reverse"&&this.iteration%2===0||this.options.direction==="alternate"&&this.iteration%2===1)&&(this.reversed=!0),this}setFillMode(e){return this.options.fillMode=e??"forwards",this}setUseWAAPI(e){return this.options.useWAAPI=e??!0,this}setColorSpace(e){return this.options.colorSpace=e??"oklab",this}setHueMethod(e){return this.options.hueMethod=e,this}setOptions(e){return this.setTimingFunction(e.timingFunction),this.setDuration(e.duration),this.setIterationCount(e.iterationCount),this.setDelay(e.delay),this.setDirection(e.direction),this.setFillMode(e.fillMode),this.setUseWAAPI(e.useWAAPI),this.setColorSpace(e.colorSpace),this.setHueMethod(e.hueMethod),this}reverse(){return this.reversed=!this.reversed,this}fillForwards(){this.interpFrames(this.options.duration,!0)}fillBackwards(){this.interpFrames(0,!0)}interpFrames(e,r=!1){e=this.reversed?this.options.duration-e:e;const n={};for(let s=0;s<this.frames.length;s++){const i=this.frames[s],{start:o,stop:a}=i.time;if(e<o||e>a)continue;const l=P(e,o,a,0,1),c=i.timingFunction(l),u=Object.values(i.interpVars);for(let f=0;f<u.length;f++){const h=u[f];for(let p=0;p<h.length;p++)Ha(c,h[p])}r&&i.transform(this.unflatten?i.vars:i.flatVars,e),Object.assign(n,i.flatVars)}return n}async onStart(){this.reversed=!1,(this.options.direction==="reverse"||this.options.direction==="alternate-reverse"&&this.iteration%2===0||this.options.direction==="alternate"&&this.iteration%2===1)&&this.reverse(),(this.options.fillMode==="backwards"||this.options.fillMode==="both")&&this.fillBackwards(),this.options.delay>0&&(this.pause(),await ps(this.options.delay),this.pause()),this.started=!0}async onEnd(){this.options.fillMode==="forwards"||this.options.fillMode==="both"?this.fillForwards():(this.options.fillMode==="none"||this.options.fillMode==="backwards")&&this.fillBackwards(),this.startTime=void 0,this.iteration>=this.options.iterationCount-1?(this.done=!0,this.iteration=0,this.dispatchAnimationEvent("animationend")):(this.iteration+=1,this.dispatchAnimationEvent("animationiteration"))}async tick(e){if(this.startTime===void 0&&(await this.onStart(),this.startTime=e+this.options.delay,this.dispatchAnimationEvent("animationstart")),this.paused&&this.pausedTime===0)return this.pausedTime=e,this.t;if(this.pausedTime>0&&!this.paused){const r=e-this.pausedTime;this.startTime+=r,this.pausedTime=0}return this.t=e-this.startTime,this.t>=this.options.duration&&(await this.onEnd(),this.t=this.options.duration),this.t}async draw(e){this.managed||(e=await this.tick(e),!this.paused&&(this.interpFrames(e,!0),this.done?(this.reset(),this.resolvePromise&&this.resolvePromise()):this.handleId=Me(this.draw.bind(this))))}_playRAF(){return new Promise(e=>{this.resolvePromise=e,this.handleId=Me(this.draw.bind(this))})}async _playWAAPI(){try{await tl(this),this.reset()}catch{return this._playRAF()}}async play(){if(!this.managed)return this.options.useWAAPI&&this.targets.length>0&&typeof this.targets[0]?.animate=="function"&&Qa(this)?this._playWAAPI():this._playRAF()}pause(e=!0){return this.paused&&e&&(this.handleId=Me(this.draw.bind(this))),this.started&&(this.paused=!this.paused),this}stop(){an(this.handleId),this.reset()}playing(){return!(!this.started||this.paused)}get effectiveT(){return this.reversed?this.options.duration-this.t:this.t}reset(){return this.done=!1,this.started=!1,this.paused=!1,this.reversed=!1,this.iteration=0,this.startTime=void 0,this.pausedTime=0,this.t=0,this}setTargets(...e){return this.targets=e,this.frames.forEach(r=>{Object.values(r.interpVars).forEach(n=>{n.forEach(({start:s,stop:i,value:o})=>{s.setTargets(this.targets),i.setTargets(this.targets),o.setTargets(this.targets)})})}),this}group(...e){return new Wa(this,...e)}}class nl extends pr{constructor(e,...r){super(e,r),this.unflatten=!1}fromVars(e,r){this.unflatten=r!=null,r??=this.transform.bind(this);for(let n=0;n<e.length;n++){const s=e[n],i=Math.round(n/(e.length-1)*100);this.addFrame(i,s,r)}return this.parse(),this}fromKeyframes(e,r){this.unflatten=r!=null,r??=this.transform.bind(this),zt(e)&&(e=new Map(Object.entries(e)));for(const[n,s]of e.entries())this.addFrame(n,s,r);return this.parse(),this}fromString(e,r){this.unflatten=r!=null,r??=this.transform.bind(this);const n=ja(e);for(const[s,i]of n.entries()){const o=i.animationTimingFunction??i.timingFunction;delete i.animationTimingFunction,delete i.timingFunction;const a=o?Tt(o.toString()):void 0;this.addFrame(s,i,r,a),this.parsedVars.push(i)}return this.parse(),this}transform(e){cs(e,this.targets)}}exports.Animation=pr;exports.CSSKeyframesAnimation=nl;exports.getAnimationId=Xe;
|
package/dist/keyframes.d.ts
DELETED
|
@@ -1,213 +0,0 @@
|
|
|
1
|
-
import { HueInterpolationMethod } from '@mkbabb/value.js';
|
|
2
|
-
import { InterpolatedVar } from '@mkbabb/value.js';
|
|
3
|
-
import { timingFunctions } from '@mkbabb/value.js';
|
|
4
|
-
import { ValueArray } from '@mkbabb/value.js';
|
|
5
|
-
import { ValueUnit } from '@mkbabb/value.js';
|
|
6
|
-
|
|
7
|
-
declare class Animation_2<V extends Vars = any> {
|
|
8
|
-
id: number;
|
|
9
|
-
name: string | undefined;
|
|
10
|
-
superKey: string | undefined;
|
|
11
|
-
targets: HTMLElement[];
|
|
12
|
-
options: AnimationOptions;
|
|
13
|
-
templateFrames: TemplateAnimationFrame<V>[];
|
|
14
|
-
parsedVars: any[];
|
|
15
|
-
frameId: number;
|
|
16
|
-
frames: AnimationFrame<V>[];
|
|
17
|
-
handleId: number | any;
|
|
18
|
-
startTime: number | undefined;
|
|
19
|
-
pausedTime: number;
|
|
20
|
-
prevTime: number;
|
|
21
|
-
t: number;
|
|
22
|
-
iteration: number;
|
|
23
|
-
started: boolean;
|
|
24
|
-
done: boolean;
|
|
25
|
-
reversed: boolean;
|
|
26
|
-
paused: boolean;
|
|
27
|
-
/** When true, this animation is managed by an AnimationGroup and should not run its own rAF loop. */
|
|
28
|
-
managed: boolean;
|
|
29
|
-
unflatten: boolean;
|
|
30
|
-
private resolvePromise;
|
|
31
|
-
private dispatchAnimationEvent;
|
|
32
|
-
constructor(options?: Partial<InputAnimationOptions>, targets?: HTMLElement[] | HTMLElement | undefined, name?: string | undefined, superKey?: string | undefined);
|
|
33
|
-
convertFrameStart(frame: TemplateAnimationFrame<V>): TemplateAnimationFrame<V>;
|
|
34
|
-
addFrame<K extends V>(start: number | string | ValueUnit<number>, vars: Partial<K>, transform?: TransformFunction<K>, timingFunction?: TimingFunction | TimingFunctionNames): Animation_2<K>;
|
|
35
|
-
createFrame(startIx: number, endIx: number): AnimationFrame<V>;
|
|
36
|
-
reconcileVars(ix: number): void;
|
|
37
|
-
parse(): this;
|
|
38
|
-
setTimingFunction(timingFunction: InputAnimationOptions["timingFunction"]): this;
|
|
39
|
-
setIterationCount(iterationCount: InputAnimationOptions["iterationCount"]): this;
|
|
40
|
-
setDuration(duration: InputAnimationOptions["duration"]): this;
|
|
41
|
-
setDelay(delay: InputAnimationOptions["delay"]): this;
|
|
42
|
-
setDirection(direction: InputAnimationOptions["direction"]): this;
|
|
43
|
-
setFillMode(fillMode: InputAnimationOptions["fillMode"]): this;
|
|
44
|
-
setUseWAAPI(useWAAPI: InputAnimationOptions["useWAAPI"]): this;
|
|
45
|
-
setColorSpace(colorSpace: InputAnimationOptions["colorSpace"]): this;
|
|
46
|
-
setHueMethod(hueMethod: InputAnimationOptions["hueMethod"]): this;
|
|
47
|
-
setOptions(options: Partial<InputAnimationOptions>): this;
|
|
48
|
-
reverse(): this;
|
|
49
|
-
fillForwards(): void;
|
|
50
|
-
fillBackwards(): void;
|
|
51
|
-
interpFrames(t: number, transformFrames?: boolean): Record<string, any>;
|
|
52
|
-
onStart(): Promise<void>;
|
|
53
|
-
onEnd(): Promise<void>;
|
|
54
|
-
tick(t: number): Promise<number>;
|
|
55
|
-
draw(t: number): Promise<void>;
|
|
56
|
-
/** Internal rAF-based play loop. */
|
|
57
|
-
private _playRAF;
|
|
58
|
-
/** Play via the Web Animations API for compositor-thread execution. */
|
|
59
|
-
private _playWAAPI;
|
|
60
|
-
play(): Promise<void>;
|
|
61
|
-
pause(draw?: boolean): this;
|
|
62
|
-
stop(): void;
|
|
63
|
-
playing(): boolean;
|
|
64
|
-
/** Returns the effective time accounting for direction reversal. */
|
|
65
|
-
get effectiveT(): number;
|
|
66
|
-
reset(): this;
|
|
67
|
-
setTargets(...targets: HTMLElement[]): this;
|
|
68
|
-
group(...animations: Animation_2<V>[]): AnimationGroup<V>;
|
|
69
|
-
}
|
|
70
|
-
export { Animation_2 as Animation }
|
|
71
|
-
|
|
72
|
-
declare interface AnimationFrame<V extends Vars> {
|
|
73
|
-
id: number;
|
|
74
|
-
start: ValueUnit;
|
|
75
|
-
ixs: {
|
|
76
|
-
start: number;
|
|
77
|
-
stop: number;
|
|
78
|
-
};
|
|
79
|
-
time: {
|
|
80
|
-
start: number;
|
|
81
|
-
stop: number;
|
|
82
|
-
};
|
|
83
|
-
flatVars: V;
|
|
84
|
-
vars: V;
|
|
85
|
-
interpVars: {
|
|
86
|
-
[arg: string]: Array<InterpolatedVar<V>>;
|
|
87
|
-
};
|
|
88
|
-
transform: TransformFunction<V>;
|
|
89
|
-
timingFunction: TimingFunction;
|
|
90
|
-
}
|
|
91
|
-
|
|
92
|
-
declare class AnimationGroup<V extends Vars> {
|
|
93
|
-
animations: AnimationGroupObject<V>;
|
|
94
|
-
transform: TransformFunction<V>;
|
|
95
|
-
superKey: string | undefined;
|
|
96
|
-
paused: boolean;
|
|
97
|
-
started: boolean;
|
|
98
|
-
done: boolean;
|
|
99
|
-
singleTarget: boolean;
|
|
100
|
-
handleId: number | any;
|
|
101
|
-
resolvePromise: ((value: void | PromiseLike<void>) => void) | null;
|
|
102
|
-
constructor(...inputs: (Animation_2<V> | AnimationGroupInput<V>)[]);
|
|
103
|
-
setSuperKey(superKey: string): this;
|
|
104
|
-
setTargets(...targets: HTMLElement[]): this;
|
|
105
|
-
onStart(): this;
|
|
106
|
-
onEnd(): this;
|
|
107
|
-
transformFramesGrouped(t: number): Vars<ValueArray<any>>;
|
|
108
|
-
tick(t: number): Promise<this>;
|
|
109
|
-
draw(t: number): Promise<void>;
|
|
110
|
-
play(): Promise<unknown>;
|
|
111
|
-
pause(): this;
|
|
112
|
-
reset(): this;
|
|
113
|
-
stop(): this;
|
|
114
|
-
playing(): boolean;
|
|
115
|
-
forcePause(): void;
|
|
116
|
-
forcePlay(): void;
|
|
117
|
-
/** Set layer config for an animation by name or reference. Chainable. */
|
|
118
|
-
setLayerConfig(nameOrAnim: string | Animation_2<V>, config: Partial<AnimationLayerConfig>): this;
|
|
119
|
-
/** Convenience toggle for enabling/disabling a layer. Chainable. */
|
|
120
|
-
setLayerEnabled(nameOrAnim: string | Animation_2<V>, enabled: boolean): this;
|
|
121
|
-
/** Read the layer config for an animation. */
|
|
122
|
-
getLayerConfig(nameOrAnim: string | Animation_2<V>): AnimationLayerConfig | undefined;
|
|
123
|
-
}
|
|
124
|
-
|
|
125
|
-
declare interface AnimationGroupEntry<V extends Vars> {
|
|
126
|
-
animation: Animation_2<V>;
|
|
127
|
-
values: Vars<ValueArray>;
|
|
128
|
-
layer: AnimationLayerConfig;
|
|
129
|
-
}
|
|
130
|
-
|
|
131
|
-
/** Input type for AnimationGroup constructor — bare Animation or Animation with layer config. */
|
|
132
|
-
declare type AnimationGroupInput<V extends Vars> = Animation_2<V> | {
|
|
133
|
-
animation: Animation_2<V>;
|
|
134
|
-
layer?: Partial<AnimationLayerConfig>;
|
|
135
|
-
};
|
|
136
|
-
|
|
137
|
-
declare interface AnimationGroupObject<V extends Vars> {
|
|
138
|
-
[key: string]: AnimationGroupEntry<V>;
|
|
139
|
-
}
|
|
140
|
-
|
|
141
|
-
declare interface AnimationLayerConfig {
|
|
142
|
-
/** Higher wins. Default: 0 */
|
|
143
|
-
zIndex: number;
|
|
144
|
-
/** 0–1 for 'weighted' blend mode. Default: 1 */
|
|
145
|
-
weight: number;
|
|
146
|
-
/** Default: 'replace' (backward compat) */
|
|
147
|
-
blendMode: BlendMode;
|
|
148
|
-
/** Layer toggle. Default: true */
|
|
149
|
-
enabled: boolean;
|
|
150
|
-
/** Optional property whitelist — only these properties will be output from this layer */
|
|
151
|
-
properties?: Set<string>;
|
|
152
|
-
}
|
|
153
|
-
|
|
154
|
-
declare type AnimationOptions = {
|
|
155
|
-
duration: number;
|
|
156
|
-
delay: number;
|
|
157
|
-
iterationCount: number;
|
|
158
|
-
direction: (typeof DIRECTIONS)[number];
|
|
159
|
-
fillMode: (typeof FILL_MODES)[number];
|
|
160
|
-
timingFunction: TimingFunction;
|
|
161
|
-
useWAAPI: boolean;
|
|
162
|
-
colorSpace: string;
|
|
163
|
-
hueMethod?: HueInterpolationMethod;
|
|
164
|
-
};
|
|
165
|
-
|
|
166
|
-
declare type BlendMode = "replace" | "add" | "weighted";
|
|
167
|
-
|
|
168
|
-
export declare class CSSKeyframesAnimation<V extends Vars> extends Animation_2<V> {
|
|
169
|
-
constructor(options?: Partial<InputAnimationOptions>, ...targets: HTMLElement[]);
|
|
170
|
-
fromVars(vars: V[], transform?: TransformFunction<V>): this;
|
|
171
|
-
fromKeyframes(keyframes: Map<string, Partial<V>> | Record<string, Partial<V>>, transform?: TransformFunction<V>): this;
|
|
172
|
-
fromString(keyframes: string, transform?: TransformFunction<V>): this;
|
|
173
|
-
transform(vars: any): void;
|
|
174
|
-
}
|
|
175
|
-
|
|
176
|
-
declare const DIRECTIONS: readonly ["normal", "reverse", "alternate", "alternate-reverse"];
|
|
177
|
-
|
|
178
|
-
declare const FILL_MODES: readonly ["none", "forwards", "backwards", "both"];
|
|
179
|
-
|
|
180
|
-
export declare const getAnimationId: (animation: Animation_2 | string) => string;
|
|
181
|
-
|
|
182
|
-
declare type InputAnimationOptions = Partial<{
|
|
183
|
-
duration: number | string;
|
|
184
|
-
delay: number | string;
|
|
185
|
-
iterationCount: number | string | "infinite" | undefined;
|
|
186
|
-
direction: (typeof DIRECTIONS)[number];
|
|
187
|
-
fillMode: (typeof FILL_MODES)[number];
|
|
188
|
-
timingFunction: TimingFunction | TimingFunctionNames | undefined;
|
|
189
|
-
/** When true (default), eligible animations may use the Web Animations API for compositor-thread execution. Set to false to force rAF. */
|
|
190
|
-
useWAAPI: boolean;
|
|
191
|
-
colorSpace?: string;
|
|
192
|
-
hueMethod?: HueInterpolationMethod;
|
|
193
|
-
}>;
|
|
194
|
-
|
|
195
|
-
declare interface TemplateAnimationFrame<V extends Vars> {
|
|
196
|
-
id: number;
|
|
197
|
-
start: ValueUnit;
|
|
198
|
-
vars: V;
|
|
199
|
-
transform?: TransformFunction<V>;
|
|
200
|
-
timingFunction?: TimingFunction;
|
|
201
|
-
}
|
|
202
|
-
|
|
203
|
-
declare type TimingFunction = (t: number) => number;
|
|
204
|
-
|
|
205
|
-
declare type TimingFunctionNames = keyof typeof timingFunctions;
|
|
206
|
-
|
|
207
|
-
declare type TransformFunction<V extends Vars> = (v: V, t: number) => void;
|
|
208
|
-
|
|
209
|
-
declare type Vars<T = any> = {
|
|
210
|
-
[arg: string]: number | string | T;
|
|
211
|
-
};
|
|
212
|
-
|
|
213
|
-
export { }
|