@pixerate/editor 0.40.0 → 0.41.0

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.
@@ -0,0 +1,66 @@
1
+ "use strict";Object.defineProperty(exports, "__esModule", {value: true});
2
+
3
+
4
+
5
+ var _chunkA6PHCAGXcjs = require('./chunk-A6PHCAGX.cjs');
6
+
7
+ // src/animation/color.ts
8
+ var toLinear = (c) => c <= 0.04045 ? c / 12.92 : ((c + 0.055) / 1.055) ** 2.4;
9
+ var toGamma = (c) => c <= 31308e-7 ? 12.92 * c : 1.055 * Math.sign(c) * Math.abs(c) ** (1 / 2.4) - 0.055;
10
+ function rgbToOklab(r, g, b, alpha = 1) {
11
+ const lr = toLinear(r);
12
+ const lg = toLinear(g);
13
+ const lb = toLinear(b);
14
+ const l = Math.cbrt(0.4122214708 * lr + 0.5363325363 * lg + 0.0514459929 * lb);
15
+ const m = Math.cbrt(0.2119034982 * lr + 0.6806995451 * lg + 0.1073969566 * lb);
16
+ const s = Math.cbrt(0.0883024619 * lr + 0.2817188376 * lg + 0.6299787005 * lb);
17
+ return {
18
+ l: 0.2104542553 * l + 0.793617785 * m - 0.0040720468 * s,
19
+ a: 1.9779984951 * l - 2.428592205 * m + 0.4505937099 * s,
20
+ b: 0.0259040371 * l + 0.7827717662 * m - 0.808675766 * s,
21
+ alpha
22
+ };
23
+ }
24
+ function oklabToRgb(color) {
25
+ const l_ = color.l + 0.3963377774 * color.a + 0.2158037573 * color.b;
26
+ const m_ = color.l - 0.1055613458 * color.a - 0.0638541728 * color.b;
27
+ const s_ = color.l - 0.0894841775 * color.a - 1.291485548 * color.b;
28
+ const l = l_ ** 3;
29
+ const m = m_ ** 3;
30
+ const s = s_ ** 3;
31
+ const clamp01 = (v) => Math.min(1, Math.max(0, v));
32
+ return {
33
+ r: clamp01(toGamma(4.0767416621 * l - 3.3077115913 * m + 0.2309699292 * s)),
34
+ g: clamp01(toGamma(-1.2684380046 * l + 2.6097574011 * m - 0.3413193965 * s)),
35
+ b: clamp01(toGamma(-0.0041960863 * l - 0.7034186147 * m + 1.707614701 * s)),
36
+ a: clamp01(color.alpha)
37
+ };
38
+ }
39
+ function parseOklab(input) {
40
+ const hex = _chunkA6PHCAGXcjs.normalizeTokenColor.call(void 0, input);
41
+ if (hex === null) return null;
42
+ const c = _chunkA6PHCAGXcjs.hexToRgba.call(void 0, hex);
43
+ return rgbToOklab(c.r, c.g, c.b, c.a);
44
+ }
45
+ function formatOklab(color) {
46
+ const { r, g, b, a } = oklabToRgb(color);
47
+ return _chunkA6PHCAGXcjs.rgbaToHex.call(void 0, r, g, b, a);
48
+ }
49
+ function mixColorsOklab(from, to, t) {
50
+ const a = parseOklab(from);
51
+ const b = parseOklab(to);
52
+ if (!a || !b) return null;
53
+ const alpha = a.alpha + (b.alpha - a.alpha) * t;
54
+ const premul = (k) => a[k] * a.alpha + (b[k] * b.alpha - a[k] * a.alpha) * t;
55
+ if (alpha <= 1e-9) return formatOklab({ l: a.l + (b.l - a.l) * t, a: 0, b: 0, alpha: 0 });
56
+ return formatOklab({ l: premul("l") / alpha, a: premul("a") / alpha, b: premul("b") / alpha, alpha });
57
+ }
58
+
59
+
60
+
61
+
62
+
63
+
64
+
65
+ exports.rgbToOklab = rgbToOklab; exports.oklabToRgb = oklabToRgb; exports.parseOklab = parseOklab; exports.formatOklab = formatOklab; exports.mixColorsOklab = mixColorsOklab;
66
+ //# sourceMappingURL=chunk-MR3Z4OQI.cjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["/home/runner/work/editor/editor/packages/core/dist/chunk-MR3Z4OQI.cjs","../src/animation/color.ts"],"names":[],"mappings":"AAAA;AACE;AACA;AACA;AACF,wDAA6B;AAC7B;AACA;ACWA,IAAM,SAAA,EAAW,CAAC,CAAA,EAAA,GAAe,EAAA,GAAK,QAAA,EAAU,EAAA,EAAI,MAAA,EAAA,CAAA,CAAU,EAAA,EAAI,KAAA,EAAA,EAAS,KAAA,EAAA,G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AAA,EAAA,EAAK,CAAA,EAAG,CAAA,EAAG,CAAA,EAAG,CAAA,EAAG,CAAA,EAAG,KAAA,EAAO,EAAE,CAAC,CAAA;AACxF,EAAA,OAAO,WAAA,CAAY,EAAE,CAAA,EAAG,MAAA,CAAO,GAAG,EAAA,EAAI,KAAA,EAAO,CAAA,EAAG,MAAA,CAAO,GAAG,EAAA,EAAI,KAAA,EAAO,CAAA,EAAG,MAAA,CAAO,GAAG,EAAA,EAAI,KAAA,EAAO,MAAM,CAAC,CAAA;AACrG;ADtBA;AACA;AACE;AACA;AACA;AACA;AACA;AACF,8KAAC","file":"/home/runner/work/editor/editor/packages/core/dist/chunk-MR3Z4OQI.cjs","sourcesContent":[null,"import { hexToRgba, normalizeTokenColor, rgbaToHex } from '../tokens/color.js';\n\n/**\n * Colour interpolation in OKLab (Björn Ottosson's perceptual space, as CSS Color 4 uses for\n * `color-mix(in oklab, …)`), with premultiplied alpha so a fade to `transparent` does not\n * darken through black.\n */\n\nexport interface OklabColor {\n\t/** Lightness, 0–1. */\n\tl: number;\n\ta: number;\n\tb: number;\n\t/** Alpha, 0–1. */\n\talpha: number;\n}\n\nconst toLinear = (c: number) => (c <= 0.04045 ? c / 12.92 : ((c + 0.055) / 1.055) ** 2.4);\nconst toGamma = (c: number) => (c <= 0.0031308 ? 12.92 * c : 1.055 * Math.sign(c) * Math.abs(c) ** (1 / 2.4) - 0.055);\n\n/** sRGB channels (0–1) to OKLab. */\nexport function rgbToOklab(r: number, g: number, b: number, alpha = 1): OklabColor {\n\tconst lr = toLinear(r);\n\tconst lg = toLinear(g);\n\tconst lb = toLinear(b);\n\tconst l = Math.cbrt(0.4122214708 * lr + 0.5363325363 * lg + 0.0514459929 * lb);\n\tconst m = Math.cbrt(0.2119034982 * lr + 0.6806995451 * lg + 0.1073969566 * lb);\n\tconst s = Math.cbrt(0.0883024619 * lr + 0.2817188376 * lg + 0.6299787005 * lb);\n\treturn {\n\t\tl: 0.2104542553 * l + 0.793617785 * m - 0.0040720468 * s,\n\t\ta: 1.9779984951 * l - 2.428592205 * m + 0.4505937099 * s,\n\t\tb: 0.0259040371 * l + 0.7827717662 * m - 0.808675766 * s,\n\t\talpha\n\t};\n}\n\n/** OKLab to sRGB channels (0–1, clamped into gamut). */\nexport function oklabToRgb(color: OklabColor): { r: number; g: number; b: number; a: number } {\n\tconst l_ = color.l + 0.3963377774 * color.a + 0.2158037573 * color.b;\n\tconst m_ = color.l - 0.1055613458 * color.a - 0.0638541728 * color.b;\n\tconst s_ = color.l - 0.0894841775 * color.a - 1.291485548 * color.b;\n\tconst l = l_ ** 3;\n\tconst m = m_ ** 3;\n\tconst s = s_ ** 3;\n\tconst clamp01 = (v: number) => Math.min(1, Math.max(0, v));\n\treturn {\n\t\tr: clamp01(toGamma(4.0767416621 * l - 3.3077115913 * m + 0.2309699292 * s)),\n\t\tg: clamp01(toGamma(-1.2684380046 * l + 2.6097574011 * m - 0.3413193965 * s)),\n\t\tb: clamp01(toGamma(-0.0041960863 * l - 0.7034186147 * m + 1.707614701 * s)),\n\t\ta: clamp01(color.alpha)\n\t};\n}\n\n/** Parses a CSS colour (hex, `rgb()` / `rgba()`, `transparent`, `black`, `white`) to OKLab, or `null`. */\nexport function parseOklab(input: unknown): OklabColor | null {\n\tconst hex = normalizeTokenColor(input);\n\tif (hex === null) return null;\n\tconst c = hexToRgba(hex)!;\n\treturn rgbToOklab(c.r, c.g, c.b, c.a);\n}\n\n/** Formats OKLab as `#rrggbb` (or `#rrggbbaa` when translucent). */\nexport function formatOklab(color: OklabColor): string {\n\tconst { r, g, b, a } = oklabToRgb(color);\n\treturn rgbaToHex(r, g, b, a);\n}\n\n/**\n * Mixes two colours at `t` (0 = `from`, 1 = `to`) in OKLab with premultiplied alpha.\n * Returns `null` when either is not a readable colour.\n */\nexport function mixColorsOklab(from: unknown, to: unknown, t: number): string | null {\n\tconst a = parseOklab(from);\n\tconst b = parseOklab(to);\n\tif (!a || !b) return null;\n\tconst alpha = a.alpha + (b.alpha - a.alpha) * t;\n\tconst premul = (k: 'l' | 'a' | 'b') => a[k] * a.alpha + (b[k] * b.alpha - a[k] * a.alpha) * t;\n\tif (alpha <= 1e-9) return formatOklab({ l: a.l + (b.l - a.l) * t, a: 0, b: 0, alpha: 0 });\n\treturn formatOklab({ l: premul('l') / alpha, a: premul('a') / alpha, b: premul('b') / alpha, alpha });\n}\n"]}
@@ -1,64 +1,10 @@
1
1
  "use strict";Object.defineProperty(exports, "__esModule", {value: true}); function _nullishCoalesce(lhs, rhsFn) { if (lhs != null) { return lhs; } else { return rhsFn(); } } function _optionalChain(ops) { let lastAccessLHS = undefined; let value = ops[0]; let i = 1; while (i < ops.length) { const op = ops[i]; const fn = ops[i + 1]; i += 2; if ((op === 'optionalAccess' || op === 'optionalCall') && value == null) { return undefined; } if (op === 'access' || op === 'optionalAccess') { lastAccessLHS = value; value = fn(value); } else if (op === 'call' || op === 'optionalCall') { value = fn((...args) => value.call(lastAccessLHS, ...args)); lastAccessLHS = undefined; } } return value; } var _class; var _class2;
2
2
 
3
-
4
- var _chunkXZ4L3R4Kcjs = require('./chunk-XZ4L3R4K.cjs');
5
-
6
-
3
+ var _chunkMR3Z4OQIcjs = require('./chunk-MR3Z4OQI.cjs');
7
4
 
8
5
 
9
- var _chunkA6PHCAGXcjs = require('./chunk-A6PHCAGX.cjs');
10
6
 
11
- // src/animation/color.ts
12
- var toLinear = (c) => c <= 0.04045 ? c / 12.92 : ((c + 0.055) / 1.055) ** 2.4;
13
- var toGamma = (c) => c <= 31308e-7 ? 12.92 * c : 1.055 * Math.sign(c) * Math.abs(c) ** (1 / 2.4) - 0.055;
14
- function rgbToOklab(r, g, b, alpha = 1) {
15
- const lr = toLinear(r);
16
- const lg = toLinear(g);
17
- const lb = toLinear(b);
18
- const l = Math.cbrt(0.4122214708 * lr + 0.5363325363 * lg + 0.0514459929 * lb);
19
- const m = Math.cbrt(0.2119034982 * lr + 0.6806995451 * lg + 0.1073969566 * lb);
20
- const s = Math.cbrt(0.0883024619 * lr + 0.2817188376 * lg + 0.6299787005 * lb);
21
- return {
22
- l: 0.2104542553 * l + 0.793617785 * m - 0.0040720468 * s,
23
- a: 1.9779984951 * l - 2.428592205 * m + 0.4505937099 * s,
24
- b: 0.0259040371 * l + 0.7827717662 * m - 0.808675766 * s,
25
- alpha
26
- };
27
- }
28
- function oklabToRgb(color) {
29
- const l_ = color.l + 0.3963377774 * color.a + 0.2158037573 * color.b;
30
- const m_ = color.l - 0.1055613458 * color.a - 0.0638541728 * color.b;
31
- const s_ = color.l - 0.0894841775 * color.a - 1.291485548 * color.b;
32
- const l = l_ ** 3;
33
- const m = m_ ** 3;
34
- const s = s_ ** 3;
35
- const clamp01 = (v) => Math.min(1, Math.max(0, v));
36
- return {
37
- r: clamp01(toGamma(4.0767416621 * l - 3.3077115913 * m + 0.2309699292 * s)),
38
- g: clamp01(toGamma(-1.2684380046 * l + 2.6097574011 * m - 0.3413193965 * s)),
39
- b: clamp01(toGamma(-0.0041960863 * l - 0.7034186147 * m + 1.707614701 * s)),
40
- a: clamp01(color.alpha)
41
- };
42
- }
43
- function parseOklab(input) {
44
- const hex = _chunkA6PHCAGXcjs.normalizeTokenColor.call(void 0, input);
45
- if (hex === null) return null;
46
- const c = _chunkA6PHCAGXcjs.hexToRgba.call(void 0, hex);
47
- return rgbToOklab(c.r, c.g, c.b, c.a);
48
- }
49
- function formatOklab(color) {
50
- const { r, g, b, a } = oklabToRgb(color);
51
- return _chunkA6PHCAGXcjs.rgbaToHex.call(void 0, r, g, b, a);
52
- }
53
- function mixColorsOklab(from, to, t) {
54
- const a = parseOklab(from);
55
- const b = parseOklab(to);
56
- if (!a || !b) return null;
57
- const alpha = a.alpha + (b.alpha - a.alpha) * t;
58
- const premul = (k) => a[k] * a.alpha + (b[k] * b.alpha - a[k] * a.alpha) * t;
59
- if (alpha <= 1e-9) return formatOklab({ l: a.l + (b.l - a.l) * t, a: 0, b: 0, alpha: 0 });
60
- return formatOklab({ l: premul("l") / alpha, a: premul("a") / alpha, b: premul("b") / alpha, alpha });
61
- }
7
+ var _chunkXZ4L3R4Kcjs = require('./chunk-XZ4L3R4K.cjs');
62
8
 
63
9
  // src/animation/keyframes.ts
64
10
  var ANIMATION_TIME_EPSILON = 1e-6;
@@ -100,7 +46,7 @@ function interpolateAnimationValue(from, to, t, type = "number") {
100
46
  if (t <= 0) return from;
101
47
  if (t >= 1) return to;
102
48
  if (type === "color" || typeof from === "string" && typeof to === "string") {
103
- const mixed = mixColorsOklab(from, to, t);
49
+ const mixed = _chunkMR3Z4OQIcjs.mixColorsOklab.call(void 0, from, to, t);
104
50
  if (mixed !== null) return mixed;
105
51
  }
106
52
  return from;
@@ -437,10 +383,5 @@ function createAnimationPlayer(options) {
437
383
 
438
384
 
439
385
 
440
-
441
-
442
-
443
-
444
-
445
- exports.rgbToOklab = rgbToOklab; exports.oklabToRgb = oklabToRgb; exports.parseOklab = parseOklab; exports.formatOklab = formatOklab; exports.mixColorsOklab = mixColorsOklab; exports.ANIMATION_TIME_EPSILON = ANIMATION_TIME_EPSILON; exports.isAnimationKeyframe = isAnimationKeyframe; exports.normalizeKeyframes = normalizeKeyframes; exports.interpolateAnimationValue = interpolateAnimationValue; exports.evaluateTrack = evaluateTrack; exports.wrapAnimationTime = wrapAnimationTime; exports.pageHidden = pageHidden; exports.realClock = realClock; exports.ManualClock = ManualClock; exports.AnimationPlayer = AnimationPlayer; exports.createAnimationPlayer = createAnimationPlayer;
446
- //# sourceMappingURL=chunk-XHRZSB77.cjs.map
386
+ exports.ANIMATION_TIME_EPSILON = ANIMATION_TIME_EPSILON; exports.isAnimationKeyframe = isAnimationKeyframe; exports.normalizeKeyframes = normalizeKeyframes; exports.interpolateAnimationValue = interpolateAnimationValue; exports.evaluateTrack = evaluateTrack; exports.wrapAnimationTime = wrapAnimationTime; exports.pageHidden = pageHidden; exports.realClock = realClock; exports.ManualClock = ManualClock; exports.AnimationPlayer = AnimationPlayer; exports.createAnimationPlayer = createAnimationPlayer;
387
+ //# sourceMappingURL=chunk-O4ONBPZW.cjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["/home/runner/work/editor/editor/packages/core/dist/chunk-O4ONBPZW.cjs","../src/animation/keyframes.ts","../src/animation/evaluate.ts","../src/animation/clock.ts","../src/animation/player.ts"],"names":[],"mappings":"AAAA;AACE;AACF,wDAA6B;AAC7B;AACE;AACA;AACF,wDAA6B;AAC7B;AACA;ACEO,IAAM,uBAAA,EAAyB,IAAA;AAsBtC,SAAS,OAAA,CAAQ,KAAA,EAAyC;AACzD,EAAA,OAAQ,OAAO,MAAA,IAAU,SAAA,GAAY,MAAA,CAAO,QAAA,CAAS,KAAK,EAAA,GAAM,OAAO,MAAA,IAAU,QAAA;AAClF;AAGO,SAAS,mBAAA,CAAoB,KAAA,EAA4C;AAC/E,EAAA,GAAA,CAAI,OAAO,MAAA,IAAU,SAAA,GAAY,MAAA,IAAU,IAAA,EAAM,OAAO,KAAA;AACxD,EAAA,MAAM,EAAA,EAAI,KAAA;AACV,EAAA,OACC,OAAO,CAAA,CAAE,KAAA,IAAS,SAAA,GAClB,MAAA,CAAO,QAAA,CAAS,CAAA,CAAE,IAAI,EAAA,GACtB,OAAA,CAAQ,CAAA,CAAE,KAAK,EAAA,GAAA,CACd,CAAA,CAAE,OAAA,IAAW,KAAA,EAAA,GAAa,iDAAA,CAAkB,CAAE,MAAM,CAAA,CAAA;AAEvD;AAEA,IAAM,YAAA,kBAAc,IAAI,OAAA,CAAgG,CAAA;AAQjH,SAAS,kBAAA,CAAmB,SAAA,EAAiF;AACnH,EAAA,GAAA,CAAI,CAAC,KAAA,CAAM,OAAA,CAAQ,SAAS,CAAA,EAAG,OAAO,CAAC,CAAA;AACvC,EAAA,MAAM,OAAA,EAAS,WAAA,CAAY,GAAA,CAAI,SAAS,CAAA;AAExC,EAAA,GAAA,CAAI,OAAA,GAAU,MAAA,CAAO,KAAA,CAAM,OAAA,IAAW,SAAA,CAAU,OAAA,GAAU,MAAA,CAAO,KAAA,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EAAW,IAAA,CAAK,SAAA;AAAA,MAChB,IAAA,EAAM,IAAA,CAAK,IAAA;AAAA,MACX,YAAA,EAAc,IAAA,CAAK,IAAA;AAAA,MACnB,QAAA,EAAU,IAAA,CAAK;AAAA,IAChB,CAAA;AAAA,EACD;AAAA,EAEQ,IAAA,CAAK,WAAA,EAAsB;AAClC,IAAA,MAAM,KAAA,EAAO,IAAA,CAAK,QAAA,CAAS,CAAA;AAC3B,IAAA,MAAM,KAAA,EAAO,IAAA,CAAK,MAAA;AAClB,IAAA,GAAA,CACC,IAAA,CAAK,KAAA,IAAS,IAAA,CAAK,KAAA,GACnB,IAAA,CAAK,QAAA,IAAY,IAAA,CAAK,QAAA,GACtB,IAAA,CAAK,UAAA,IAAc,IAAA,CAAK,UAAA,GACxB,IAAA,CAAK,KAAA,IAAS,IAAA,CAAK,KAAA,GACnB,IAAA,CAAK,aAAA,IAAiB,IAAA,CAAK,aAAA,GAC3B,IAAA,CAAK,SAAA,IAAa,IAAA,CAAK,QAAA,EACtB;AACD,MAAA,MAAA;AAAA,IACD;AACA,IAAA,IAAA,CAAK,OAAA,EAAS,IAAA;AACd,IAAA,GAAA,CAAI,YAAA,GAAe,IAAA,CAAK,KAAA,IAAS,IAAA,CAAK,IAAA,kBAAM,IAAA,qBAAK,MAAA,0BAAA,CAAS,IAAA,CAAK,IAAI,GAAA;AACnE,IAAA,IAAA,CAAA,MAAW,SAAA,GAAY,IAAA,CAAK,SAAA,EAAW,QAAA,CAAS,IAAI,CAAA;AAAA,EACrD;AACD,WAAA;AAEO,SAAS,qBAAA,CAAsB,OAAA,EAAmD;AACxF,EAAA,OAAO,IAAI,eAAA,CAAgB,OAAO,CAAA;AACnC;AJkGA;AACA;AACE;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACF,sfAAC","file":"/home/runner/work/editor/editor/packages/core/dist/chunk-O4ONBPZW.cjs","sourcesContent":[null,"// Portions ported from filmcraft-main/crates/project/src/keyframe.rs (MIT OR Apache-2.0, © ArtCraft Team and contributors). See THIRD_PARTY_NOTICES.md.\nimport { isAnimationEasing, type AnimationEasing } from './easing.js';\n\n/**\n * Keyframe tracks, independent of what they animate: each track is a list of keyframes\n * `{ time (ms), value, easing }`, where the easing governs the segment *leaving* the keyframe\n * (filmcraft / After Effects convention).\n */\n\n/** Keyframe times closer than this (ms) are the same time. */\nexport const ANIMATION_TIME_EPSILON = 1e-6;\n\n/** A keyframe value: a number, or a CSS colour for colour properties. */\nexport type AnimationValue = number | string;\n\nexport interface AnimationKeyframe {\n\t/** Time in milliseconds from the start of the timeline. */\n\ttime: number;\n\tvalue: AnimationValue;\n\t/** Easing of the segment from this keyframe to the next (default `linear`). */\n\teasing?: AnimationEasing;\n}\n\nexport interface AnimationTrack {\n\tkeyframes: AnimationKeyframe[];\n\t/** Disabled tracks keep their keyframes but do not animate (default `true`). */\n\tenabled?: boolean;\n}\n\n/** How a track's values interpolate: numbers linearly, colours in OKLab. */\nexport type AnimationValueType = 'number' | 'color';\n\nfunction isValue(value: unknown): value is AnimationValue {\n\treturn (typeof value === 'number' && Number.isFinite(value)) || typeof value === 'string';\n}\n\n/** Whether `value` is a well-formed keyframe. */\nexport function isAnimationKeyframe(value: unknown): value is AnimationKeyframe {\n\tif (typeof value !== 'object' || value === null) return false;\n\tconst k = value as Record<string, unknown>;\n\treturn (\n\t\ttypeof k.time === 'number' &&\n\t\tNumber.isFinite(k.time) &&\n\t\tisValue(k.value) &&\n\t\t(k.easing === undefined || isAnimationEasing(k.easing))\n\t);\n}\n\nconst sortedCache = new WeakMap<readonly AnimationKeyframe[], { items: AnimationKeyframe[]; out: AnimationKeyframe[] }>();\n\n/**\n * Keyframes sorted by time, invalid entries dropped and duplicate times merged (the *later*\n * entry in the array wins, so appending a keyframe replaces one at the same time). Cached per\n * array (revalidated by element identity), so evaluating every frame does not re-sort; treat\n * keyframe objects as immutable.\n */\nexport function normalizeKeyframes(keyframes: readonly AnimationKeyframe[] | undefined | null): AnimationKeyframe[] {\n\tif (!Array.isArray(keyframes)) return [];\n\tconst cached = sortedCache.get(keyframes);\n\t// The array may have been edited in place since: reuse only while it holds the same keyframes.\n\tif (cached && cached.items.length === keyframes.length && cached.items.every((k, i) => k === keyframes[i])) return cached.out;\n\tconst indexed = keyframes\n\t\t.map((k, i) => ({ k, i }))\n\t\t.filter(({ k }) => isAnimationKeyframe(k))\n\t\t.sort((a, b) => a.k.time - b.k.time || a.i - b.i);\n\tconst out: AnimationKeyframe[] = [];\n\tlet lastIndex = -1;\n\tfor (const { k, i } of indexed) {\n\t\tconst prev = out[out.length - 1];\n\t\tif (prev && Math.abs(k.time - prev.time) <= ANIMATION_TIME_EPSILON) {\n\t\t\tif (i > lastIndex) {\n\t\t\t\tout[out.length - 1] = k;\n\t\t\t\tlastIndex = i;\n\t\t\t}\n\t\t\tcontinue;\n\t\t}\n\t\tout.push(k);\n\t\tlastIndex = i;\n\t}\n\tsortedCache.set(keyframes, { items: [...keyframes], out });\n\treturn out;\n}\n","// Portions ported from filmcraft-main/crates/project/src/keyframe.rs (MIT OR Apache-2.0, © ArtCraft Team and contributors). See THIRD_PARTY_NOTICES.md.\nimport { mixColorsOklab } from './color.js';\nimport { evaluateEasing } from './easing.js';\nimport { normalizeKeyframes, type AnimationKeyframe, type AnimationTrack, type AnimationValue, type AnimationValueType } from './keyframes.js';\n\n/** How time past the end of the timeline maps back into it. */\nexport type AnimationLoopMode = 'none' | 'loop' | 'ping-pong';\n\n/**\n * Interpolates between two keyframe values: numbers linearly, colours in OKLab (premultiplied\n * alpha). Mismatched or unreadable values hold `from` until `t` reaches 1.\n */\nexport function interpolateAnimationValue(from: AnimationValue, to: AnimationValue, t: number, type: AnimationValueType = 'number'): AnimationValue {\n\t// Numbers extrapolate, so overshooting easings (back, spring) overshoot the value too.\n\tif (typeof from === 'number' && typeof to === 'number') return from + (to - from) * t;\n\tif (t <= 0) return from;\n\tif (t >= 1) return to;\n\tif (type === 'color' || (typeof from === 'string' && typeof to === 'string')) {\n\t\tconst mixed = mixColorsOklab(from, to, t);\n\t\tif (mixed !== null) return mixed;\n\t}\n\treturn from;\n}\n\n/** Index of the last keyframe at or before `time` (-1 before the first). Binary search. */\nfunction segmentIndex(keys: readonly AnimationKeyframe[], time: number): number {\n\tlet lo = 0;\n\tlet hi = keys.length - 1;\n\tlet found = -1;\n\twhile (lo <= hi) {\n\t\tconst mid = (lo + hi) >> 1;\n\t\tif (keys[mid].time <= time) {\n\t\t\tfound = mid;\n\t\t\tlo = mid + 1;\n\t\t} else hi = mid - 1;\n\t}\n\treturn found;\n}\n\n/**\n * A track's value at `time`. Before the first keyframe it holds the first value, after the\n * last the last value. Keyframes may be unsorted or share times (see `normalizeKeyframes`).\n * Returns `undefined` for a track without valid keyframes.\n */\nexport function evaluateTrack(track: AnimationTrack | readonly AnimationKeyframe[] | undefined | null, time: number, type: AnimationValueType = 'number'): AnimationValue | undefined {\n\tconst keyframes = Array.isArray(track) ? track : (track as AnimationTrack | undefined)?.keyframes;\n\tconst keys = normalizeKeyframes(keyframes as AnimationKeyframe[]);\n\tif (keys.length === 0) return undefined;\n\tif (!(time > keys[0].time)) return keys[0].value;\n\tconst last = keys[keys.length - 1];\n\tif (time >= last.time) return last.value;\n\tconst i = segmentIndex(keys, time);\n\tconst a = keys[i];\n\tconst b = keys[i + 1];\n\tif (time === a.time) return a.value;\n\tconst span = b.time - a.time;\n\tconst u = (time - a.time) / span;\n\tif (a.easing === 'hold') return a.value;\n\treturn interpolateAnimationValue(a.value, b.value, evaluateEasing(a.easing, u, span), type);\n}\n\n/**\n * Maps a running time onto the timeline `[0, duration]`: clamped (`none`), wrapped (`loop`)\n * or bounced (`ping-pong`).\n */\nexport function wrapAnimationTime(time: number, duration: number, loop: AnimationLoopMode = 'none'): number {\n\tif (!Number.isFinite(time)) return 0;\n\tif (!(duration > 0)) return 0;\n\tif (loop === 'loop') return ((time % duration) + duration) % duration;\n\tif (loop === 'ping-pong') {\n\t\tconst period = duration * 2;\n\t\tconst m = ((time % period) + period) % period;\n\t\treturn m <= duration ? m : period - m;\n\t}\n\treturn Math.min(duration, Math.max(0, time));\n}\n","/**\n * The time source that animations (and canvas agent performances) play on.\n *\n * Defaults to `realClock` (requestAnimationFrame and setTimeout).\n * A `ManualClock` moves only when told to via `advance(ms)` or `tick(fps)`,\n * enabling deterministic frame-by-frame stepping for testing, video generation,\n * or headless server environments.\n */\n\nexport interface Clock {\n\t/** Current time in milliseconds. */\n\tnow(): number;\n\t/** Resolves on the next animation frame. */\n\tframe(): Promise<void>;\n\t/** Resolves after `ms` milliseconds of this clock's time. */\n\tsleep(ms: number): Promise<void>;\n\t/**\n\t * Whether the clock follows wall time. Live clocks stop or degrade when the\n\t * tab is in the background (browsers pause animation frames), so transitions\n\t * can commit immediately rather than leaving operations hanging.\n\t */\n\treadonly live: boolean;\n}\n\n/** Whether the browser tab is hidden (where RAF pauses). */\nexport const pageHidden = (): boolean =>\n\ttypeof document !== 'undefined' && document.hidden;\n\n/** Real-time clock using requestAnimationFrame and setTimeout. */\nexport const realClock: Clock = {\n\tlive: true,\n\tnow: () => (typeof performance !== 'undefined' ? performance.now() : Date.now()),\n\tframe: () =>\n\t\tnew Promise<void>((resolve) => {\n\t\t\tif (typeof requestAnimationFrame === 'function' && !pageHidden()) {\n\t\t\t\trequestAnimationFrame(() => resolve());\n\t\t\t} else {\n\t\t\t\tsetTimeout(resolve, 16);\n\t\t\t}\n\t\t}),\n\tsleep: (ms: number) => new Promise<void>((resolve) => setTimeout(resolve, Math.max(0, ms)))\n};\n\nconst settle = () => new Promise<void>((resolve) => setTimeout(resolve, 0));\n\n/**\n * A deterministic clock that only moves forward when `advance` or `tick` is called.\n * Allows step-by-step frame testing and video rendering without waiting for real time.\n */\nexport class ManualClock implements Clock {\n\treadonly live = false;\n\tprivate time: number;\n\tprivate frames: (() => void)[] = [];\n\tprivate sleepers: { at: number; seq: number; resolve: () => void }[] = [];\n\tprivate seq = 0;\n\n\tconstructor(start = 0) {\n\t\tthis.time = start;\n\t}\n\n\tpublic now(): number {\n\t\treturn this.time;\n\t}\n\n\tpublic frame(): Promise<void> {\n\t\treturn new Promise<void>((resolve) => this.frames.push(resolve));\n\t}\n\n\tpublic sleep(ms: number): Promise<void> {\n\t\treturn new Promise<void>((resolve) =>\n\t\t\tthis.sleepers.push({\n\t\t\t\tat: this.time + Math.max(0, ms),\n\t\t\t\tseq: this.seq++,\n\t\t\t\tresolve\n\t\t\t})\n\t\t);\n\t}\n\n\t/** Whether any frames or sleep timers are currently pending. */\n\tpublic get pending(): boolean {\n\t\treturn this.frames.length > 0 || this.sleepers.length > 0;\n\t}\n\n\t/** Advances time by `ms`, resolving due sleep timers in order, followed by queued frames. */\n\tpublic async advance(ms: number): Promise<void> {\n\t\tconst end = this.time + Math.max(0, ms);\n\t\tawait settle();\n\n\t\twhile (true) {\n\t\t\tlet next: (typeof this.sleepers)[number] | undefined;\n\t\t\tfor (const s of this.sleepers) {\n\t\t\t\tif (s.at <= end && (!next || s.at < next.at || (s.at === next.at && s.seq < next.seq))) {\n\t\t\t\t\tnext = s;\n\t\t\t\t}\n\t\t\t}\n\t\t\tif (!next) break;\n\n\t\t\tthis.sleepers.splice(this.sleepers.indexOf(next), 1);\n\t\t\tthis.time = Math.max(this.time, next.at);\n\t\t\tnext.resolve();\n\t\t\tawait settle();\n\t\t}\n\n\t\tthis.time = end;\n\t\tconst dueFrames = this.frames.splice(0, this.frames.length);\n\t\tfor (const resolveFrame of dueFrames) {\n\t\t\tresolveFrame();\n\t\t}\n\t\tawait settle();\n\t}\n\n\t/** Convenience method to advance by 1 frame at a given fps (default: 60fps = 16.67ms). */\n\tpublic async tick(fps = 60): Promise<void> {\n\t\tawait this.advance(Math.round(1000 / fps));\n\t}\n}\n","import { realClock, type Clock } from './clock.js';\nimport { wrapAnimationTime, type AnimationLoopMode } from './evaluate.js';\n\nexport interface AnimationPlayerState {\n\t/** Playhead time in ms, inside `[0, duration]`. */\n\ttime: number;\n\tplaying: boolean;\n\t/** True between `scrub` and `endScrub`. */\n\tscrubbing: boolean;\n\tloop: AnimationLoopMode;\n\t/** Speed multiplier (negative plays backwards). */\n\tplaybackRate: number;\n\tduration: number;\n}\n\nexport interface AnimationPlayerOptions {\n\t/** Time source (default `realClock`: requestAnimationFrame). Pass a `ManualClock` in tests or for rendering. */\n\tclock?: Clock;\n\t/** Timeline length in ms, or a getter (e.g. the last keyframe time). Default 1000. */\n\tduration?: number | (() => number);\n\tloop?: AnimationLoopMode;\n\tplaybackRate?: number;\n\t/** Initial playhead time (default 0). */\n\ttime?: number;\n\t/** Called whenever the playhead moves (playback, seek, scrub). */\n\tonTime?: (time: number) => void;\n\t/** Called when non-looping playback reaches the end (or the start, playing backwards). */\n\tonEnd?: () => void;\n}\n\n/**\n * Plays a timeline on an injectable `Clock`: play / pause / seek / scrub with looping,\n * ping-pong and playback rate. It only asks the clock for frames while playing, so a\n * `ManualClock` steps it deterministically and the real clock's requestAnimationFrame is the\n * only place wall time enters.\n *\n * `getState()` returns a cached snapshot replaced on change (usable with `useSyncExternalStore`).\n */\nexport class AnimationPlayer {\n\tprivate readonly clock: Clock;\n\tprivate durationSource: number | (() => number);\n\tprivate onTime?: (time: number) => void;\n\tprivate onEnd?: () => void;\n\tprivate time: number;\n\tprivate playing = false;\n\tprivate scrubbing = false;\n\tprivate resumeAfterScrub = false;\n\tprivate loop: AnimationLoopMode;\n\tprivate rate: number;\n\t/** Unwrapped time at `anchorAt` (keeps the ping-pong direction across frames). */\n\tprivate anchorRaw = 0;\n\tprivate anchorAt = 0;\n\tprivate generation = 0;\n\tprivate cached: AnimationPlayerState;\n\tprivate listeners = new Set<(state: AnimationPlayerState) => void>();\n\n\tconstructor(options: AnimationPlayerOptions = {}) {\n\t\tthis.clock = options.clock ?? realClock;\n\t\tthis.durationSource = options.duration ?? 1000;\n\t\tthis.loop = options.loop ?? 'none';\n\t\tthis.rate = Number.isFinite(options.playbackRate) && options.playbackRate !== 0 ? options.playbackRate! : 1;\n\t\tthis.onTime = options.onTime;\n\t\tthis.onEnd = options.onEnd;\n\t\tthis.time = this.clamp(options.time ?? 0);\n\t\tthis.cached = this.snapshot();\n\t}\n\n\t/** Current timeline length (ms). */\n\tget duration(): number {\n\t\tconst d = typeof this.durationSource === 'function' ? this.durationSource() : this.durationSource;\n\t\treturn Number.isFinite(d) && d > 0 ? d : 0;\n\t}\n\n\tget currentTime(): number {\n\t\treturn this.time;\n\t}\n\n\tget isPlaying(): boolean {\n\t\treturn this.playing;\n\t}\n\n\tgetState(): AnimationPlayerState {\n\t\treturn this.cached;\n\t}\n\n\tsubscribe(listener: (state: AnimationPlayerState) => void): () => void {\n\t\tthis.listeners.add(listener);\n\t\treturn () => {\n\t\t\tthis.listeners.delete(listener);\n\t\t};\n\t}\n\n\t/** Replaces the callbacks (hooks keep them current without recreating the player). */\n\tsetCallbacks(callbacks: { onTime?: (time: number) => void; onEnd?: () => void }): void {\n\t\tthis.onTime = callbacks.onTime;\n\t\tthis.onEnd = callbacks.onEnd;\n\t}\n\n\tsetDuration(duration: number | (() => number)): void {\n\t\tthis.durationSource = duration;\n\t\tthis.time = this.clamp(this.time);\n\t\tthis.emit(false);\n\t}\n\n\tsetLoop(loop: AnimationLoopMode): void {\n\t\tif (loop === this.loop) return;\n\t\tthis.reanchor();\n\t\tthis.loop = loop;\n\t\tthis.emit(false);\n\t}\n\n\tsetPlaybackRate(rate: number): void {\n\t\tif (!Number.isFinite(rate) || rate === 0 || rate === this.rate) return;\n\t\tthis.reanchor();\n\t\tthis.rate = rate;\n\t\tthis.emit(false);\n\t}\n\n\t/** Starts playing from the playhead (from the start again when a one-shot play had ended). */\n\tplay(): void {\n\t\tif (this.playing) return;\n\t\tconst d = this.duration;\n\t\tif (this.loop === 'none' && d > 0) {\n\t\t\tif (this.rate > 0 && this.time >= d) this.time = 0;\n\t\t\tif (this.rate < 0 && this.time <= 0) this.time = d;\n\t\t}\n\t\tthis.playing = true;\n\t\tthis.scrubbing = false;\n\t\tthis.anchorRaw = this.time;\n\t\tthis.anchorAt = this.clock.now();\n\t\tthis.emit(false);\n\t\tthis.schedule();\n\t}\n\n\tpause(): void {\n\t\tif (!this.playing) return;\n\t\tthis.tick(false);\n\t\tthis.playing = false;\n\t\tthis.generation++;\n\t\tthis.emit(true);\n\t}\n\n\ttoggle(): void {\n\t\tif (this.playing) this.pause();\n\t\telse this.play();\n\t}\n\n\t/** Pauses and returns to the start. */\n\tstop(): void {\n\t\tthis.playing = false;\n\t\tthis.generation++;\n\t\tthis.seek(0);\n\t}\n\n\t/** Moves the playhead (clamped to the timeline); playback continues from there. */\n\tseek(time: number): void {\n\t\tif (!Number.isFinite(time)) return;\n\t\tthis.time = this.clamp(time);\n\t\tthis.anchorRaw = this.time;\n\t\tthis.anchorAt = this.clock.now();\n\t\tthis.emit(true);\n\t}\n\n\t/** Seeks while dragging the playhead: playback pauses until `endScrub`. */\n\tscrub(time: number): void {\n\t\tif (!this.scrubbing) {\n\t\t\tthis.resumeAfterScrub = this.playing;\n\t\t\tif (this.playing) {\n\t\t\t\tthis.playing = false;\n\t\t\t\tthis.generation++;\n\t\t\t}\n\t\t\tthis.scrubbing = true;\n\t\t}\n\t\tthis.seek(time);\n\t}\n\n\t/** Ends a scrub, resuming playback if it was playing when the scrub began. */\n\tendScrub(): void {\n\t\tif (!this.scrubbing) return;\n\t\tthis.scrubbing = false;\n\t\tconst resume = this.resumeAfterScrub;\n\t\tthis.resumeAfterScrub = false;\n\t\tif (resume) this.play();\n\t\telse this.emit(false);\n\t}\n\n\t/** Stops scheduling frames and drops listeners. */\n\tdestroy(): void {\n\t\tthis.playing = false;\n\t\tthis.generation++;\n\t\tthis.listeners.clear();\n\t}\n\n\tprivate clamp(time: number): number {\n\t\treturn Math.min(this.duration, Math.max(0, Number.isFinite(time) ? time : 0));\n\t}\n\n\tprivate reanchor() {\n\t\tif (!this.playing) return;\n\t\tthis.tick(false);\n\t\tthis.anchorRaw = this.rawNow();\n\t\tthis.anchorAt = this.clock.now();\n\t}\n\n\tprivate rawNow(): number {\n\t\treturn this.anchorRaw + (this.clock.now() - this.anchorAt) * this.rate;\n\t}\n\n\tprivate schedule() {\n\t\tconst generation = this.generation;\n\t\tthis.clock.frame().then(() => {\n\t\t\tif (generation !== this.generation || !this.playing) return;\n\t\t\tthis.tick(true);\n\t\t\tif (this.playing) this.schedule();\n\t\t});\n\t}\n\n\t/** Advances the playhead to the clock's time; `notify` emits the change. */\n\tprivate tick(notify: boolean) {\n\t\tif (!this.playing) return;\n\t\tconst d = this.duration;\n\t\tconst raw = this.rawNow();\n\t\tlet ended = false;\n\t\tif (this.loop === 'none' || d <= 0) {\n\t\t\tif (this.rate > 0 && raw >= d) {\n\t\t\t\tthis.time = d;\n\t\t\t\tended = true;\n\t\t\t} else if (this.rate < 0 && raw <= 0) {\n\t\t\t\tthis.time = 0;\n\t\t\t\tended = true;\n\t\t\t} else this.time = this.clamp(raw);\n\t\t} else {\n\t\t\tthis.time = wrapAnimationTime(raw, d, this.loop);\n\t\t}\n\t\tif (ended) {\n\t\t\tthis.playing = false;\n\t\t\tthis.generation++;\n\t\t}\n\t\tif (notify || ended) this.emit(true);\n\t\tif (ended) this.onEnd?.();\n\t}\n\n\tprivate snapshot(): AnimationPlayerState {\n\t\treturn {\n\t\t\ttime: this.time,\n\t\t\tplaying: this.playing,\n\t\t\tscrubbing: this.scrubbing,\n\t\t\tloop: this.loop,\n\t\t\tplaybackRate: this.rate,\n\t\t\tduration: this.duration\n\t\t};\n\t}\n\n\tprivate emit(timeChanged: boolean) {\n\t\tconst next = this.snapshot();\n\t\tconst prev = this.cached;\n\t\tif (\n\t\t\tprev.time === next.time &&\n\t\t\tprev.playing === next.playing &&\n\t\t\tprev.scrubbing === next.scrubbing &&\n\t\t\tprev.loop === next.loop &&\n\t\t\tprev.playbackRate === next.playbackRate &&\n\t\t\tprev.duration === next.duration\n\t\t) {\n\t\t\treturn;\n\t\t}\n\t\tthis.cached = next;\n\t\tif (timeChanged && prev.time !== next.time) this.onTime?.(next.time);\n\t\tfor (const listener of this.listeners) listener(next);\n\t}\n}\n\nexport function createAnimationPlayer(options?: AnimationPlayerOptions): AnimationPlayer {\n\treturn new AnimationPlayer(options);\n}\n"]}
@@ -1,64 +1,10 @@
1
+ import {
2
+ mixColorsOklab
3
+ } from "./chunk-ZRJMJIQU.js";
1
4
  import {
2
5
  evaluateEasing,
3
6
  isAnimationEasing
4
7
  } from "./chunk-UB2OY7FD.js";
5
- import {
6
- hexToRgba,
7
- normalizeTokenColor,
8
- rgbaToHex
9
- } from "./chunk-TGD52FEZ.js";
10
-
11
- // src/animation/color.ts
12
- var toLinear = (c) => c <= 0.04045 ? c / 12.92 : ((c + 0.055) / 1.055) ** 2.4;
13
- var toGamma = (c) => c <= 31308e-7 ? 12.92 * c : 1.055 * Math.sign(c) * Math.abs(c) ** (1 / 2.4) - 0.055;
14
- function rgbToOklab(r, g, b, alpha = 1) {
15
- const lr = toLinear(r);
16
- const lg = toLinear(g);
17
- const lb = toLinear(b);
18
- const l = Math.cbrt(0.4122214708 * lr + 0.5363325363 * lg + 0.0514459929 * lb);
19
- const m = Math.cbrt(0.2119034982 * lr + 0.6806995451 * lg + 0.1073969566 * lb);
20
- const s = Math.cbrt(0.0883024619 * lr + 0.2817188376 * lg + 0.6299787005 * lb);
21
- return {
22
- l: 0.2104542553 * l + 0.793617785 * m - 0.0040720468 * s,
23
- a: 1.9779984951 * l - 2.428592205 * m + 0.4505937099 * s,
24
- b: 0.0259040371 * l + 0.7827717662 * m - 0.808675766 * s,
25
- alpha
26
- };
27
- }
28
- function oklabToRgb(color) {
29
- const l_ = color.l + 0.3963377774 * color.a + 0.2158037573 * color.b;
30
- const m_ = color.l - 0.1055613458 * color.a - 0.0638541728 * color.b;
31
- const s_ = color.l - 0.0894841775 * color.a - 1.291485548 * color.b;
32
- const l = l_ ** 3;
33
- const m = m_ ** 3;
34
- const s = s_ ** 3;
35
- const clamp01 = (v) => Math.min(1, Math.max(0, v));
36
- return {
37
- r: clamp01(toGamma(4.0767416621 * l - 3.3077115913 * m + 0.2309699292 * s)),
38
- g: clamp01(toGamma(-1.2684380046 * l + 2.6097574011 * m - 0.3413193965 * s)),
39
- b: clamp01(toGamma(-0.0041960863 * l - 0.7034186147 * m + 1.707614701 * s)),
40
- a: clamp01(color.alpha)
41
- };
42
- }
43
- function parseOklab(input) {
44
- const hex = normalizeTokenColor(input);
45
- if (hex === null) return null;
46
- const c = hexToRgba(hex);
47
- return rgbToOklab(c.r, c.g, c.b, c.a);
48
- }
49
- function formatOklab(color) {
50
- const { r, g, b, a } = oklabToRgb(color);
51
- return rgbaToHex(r, g, b, a);
52
- }
53
- function mixColorsOklab(from, to, t) {
54
- const a = parseOklab(from);
55
- const b = parseOklab(to);
56
- if (!a || !b) return null;
57
- const alpha = a.alpha + (b.alpha - a.alpha) * t;
58
- const premul = (k) => a[k] * a.alpha + (b[k] * b.alpha - a[k] * a.alpha) * t;
59
- if (alpha <= 1e-9) return formatOklab({ l: a.l + (b.l - a.l) * t, a: 0, b: 0, alpha: 0 });
60
- return formatOklab({ l: premul("l") / alpha, a: premul("a") / alpha, b: premul("b") / alpha, alpha });
61
- }
62
8
 
63
9
  // src/animation/keyframes.ts
64
10
  var ANIMATION_TIME_EPSILON = 1e-6;
@@ -426,11 +372,6 @@ function createAnimationPlayer(options) {
426
372
  }
427
373
 
428
374
  export {
429
- rgbToOklab,
430
- oklabToRgb,
431
- parseOklab,
432
- formatOklab,
433
- mixColorsOklab,
434
375
  ANIMATION_TIME_EPSILON,
435
376
  isAnimationKeyframe,
436
377
  normalizeKeyframes,
@@ -443,4 +384,4 @@ export {
443
384
  AnimationPlayer,
444
385
  createAnimationPlayer
445
386
  };
446
- //# sourceMappingURL=chunk-W7BOBWZD.js.map
387
+ //# sourceMappingURL=chunk-SHOVAHUB.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../src/animation/keyframes.ts","../src/animation/evaluate.ts","../src/animation/clock.ts","../src/animation/player.ts"],"sourcesContent":["// Portions ported from filmcraft-main/crates/project/src/keyframe.rs (MIT OR Apache-2.0, © ArtCraft Team and contributors). See THIRD_PARTY_NOTICES.md.\nimport { isAnimationEasing, type AnimationEasing } from './easing.js';\n\n/**\n * Keyframe tracks, independent of what they animate: each track is a list of keyframes\n * `{ time (ms), value, easing }`, where the easing governs the segment *leaving* the keyframe\n * (filmcraft / After Effects convention).\n */\n\n/** Keyframe times closer than this (ms) are the same time. */\nexport const ANIMATION_TIME_EPSILON = 1e-6;\n\n/** A keyframe value: a number, or a CSS colour for colour properties. */\nexport type AnimationValue = number | string;\n\nexport interface AnimationKeyframe {\n\t/** Time in milliseconds from the start of the timeline. */\n\ttime: number;\n\tvalue: AnimationValue;\n\t/** Easing of the segment from this keyframe to the next (default `linear`). */\n\teasing?: AnimationEasing;\n}\n\nexport interface AnimationTrack {\n\tkeyframes: AnimationKeyframe[];\n\t/** Disabled tracks keep their keyframes but do not animate (default `true`). */\n\tenabled?: boolean;\n}\n\n/** How a track's values interpolate: numbers linearly, colours in OKLab. */\nexport type AnimationValueType = 'number' | 'color';\n\nfunction isValue(value: unknown): value is AnimationValue {\n\treturn (typeof value === 'number' && Number.isFinite(value)) || typeof value === 'string';\n}\n\n/** Whether `value` is a well-formed keyframe. */\nexport function isAnimationKeyframe(value: unknown): value is AnimationKeyframe {\n\tif (typeof value !== 'object' || value === null) return false;\n\tconst k = value as Record<string, unknown>;\n\treturn (\n\t\ttypeof k.time === 'number' &&\n\t\tNumber.isFinite(k.time) &&\n\t\tisValue(k.value) &&\n\t\t(k.easing === undefined || isAnimationEasing(k.easing))\n\t);\n}\n\nconst sortedCache = new WeakMap<readonly AnimationKeyframe[], { items: AnimationKeyframe[]; out: AnimationKeyframe[] }>();\n\n/**\n * Keyframes sorted by time, invalid entries dropped and duplicate times merged (the *later*\n * entry in the array wins, so appending a keyframe replaces one at the same time). Cached per\n * array (revalidated by element identity), so evaluating every frame does not re-sort; treat\n * keyframe objects as immutable.\n */\nexport function normalizeKeyframes(keyframes: readonly AnimationKeyframe[] | undefined | null): AnimationKeyframe[] {\n\tif (!Array.isArray(keyframes)) return [];\n\tconst cached = sortedCache.get(keyframes);\n\t// The array may have been edited in place since: reuse only while it holds the same keyframes.\n\tif (cached && cached.items.length === keyframes.length && cached.items.every((k, i) => k === keyframes[i])) return cached.out;\n\tconst indexed = keyframes\n\t\t.map((k, i) => ({ k, i }))\n\t\t.filter(({ k }) => isAnimationKeyframe(k))\n\t\t.sort((a, b) => a.k.time - b.k.time || a.i - b.i);\n\tconst out: AnimationKeyframe[] = [];\n\tlet lastIndex = -1;\n\tfor (const { k, i } of indexed) {\n\t\tconst prev = out[out.length - 1];\n\t\tif (prev && Math.abs(k.time - prev.time) <= ANIMATION_TIME_EPSILON) {\n\t\t\tif (i > lastIndex) {\n\t\t\t\tout[out.length - 1] = k;\n\t\t\t\tlastIndex = i;\n\t\t\t}\n\t\t\tcontinue;\n\t\t}\n\t\tout.push(k);\n\t\tlastIndex = i;\n\t}\n\tsortedCache.set(keyframes, { items: [...keyframes], out });\n\treturn out;\n}\n","// Portions ported from filmcraft-main/crates/project/src/keyframe.rs (MIT OR Apache-2.0, © ArtCraft Team and contributors). See THIRD_PARTY_NOTICES.md.\nimport { mixColorsOklab } from './color.js';\nimport { evaluateEasing } from './easing.js';\nimport { normalizeKeyframes, type AnimationKeyframe, type AnimationTrack, type AnimationValue, type AnimationValueType } from './keyframes.js';\n\n/** How time past the end of the timeline maps back into it. */\nexport type AnimationLoopMode = 'none' | 'loop' | 'ping-pong';\n\n/**\n * Interpolates between two keyframe values: numbers linearly, colours in OKLab (premultiplied\n * alpha). Mismatched or unreadable values hold `from` until `t` reaches 1.\n */\nexport function interpolateAnimationValue(from: AnimationValue, to: AnimationValue, t: number, type: AnimationValueType = 'number'): AnimationValue {\n\t// Numbers extrapolate, so overshooting easings (back, spring) overshoot the value too.\n\tif (typeof from === 'number' && typeof to === 'number') return from + (to - from) * t;\n\tif (t <= 0) return from;\n\tif (t >= 1) return to;\n\tif (type === 'color' || (typeof from === 'string' && typeof to === 'string')) {\n\t\tconst mixed = mixColorsOklab(from, to, t);\n\t\tif (mixed !== null) return mixed;\n\t}\n\treturn from;\n}\n\n/** Index of the last keyframe at or before `time` (-1 before the first). Binary search. */\nfunction segmentIndex(keys: readonly AnimationKeyframe[], time: number): number {\n\tlet lo = 0;\n\tlet hi = keys.length - 1;\n\tlet found = -1;\n\twhile (lo <= hi) {\n\t\tconst mid = (lo + hi) >> 1;\n\t\tif (keys[mid].time <= time) {\n\t\t\tfound = mid;\n\t\t\tlo = mid + 1;\n\t\t} else hi = mid - 1;\n\t}\n\treturn found;\n}\n\n/**\n * A track's value at `time`. Before the first keyframe it holds the first value, after the\n * last the last value. Keyframes may be unsorted or share times (see `normalizeKeyframes`).\n * Returns `undefined` for a track without valid keyframes.\n */\nexport function evaluateTrack(track: AnimationTrack | readonly AnimationKeyframe[] | undefined | null, time: number, type: AnimationValueType = 'number'): AnimationValue | undefined {\n\tconst keyframes = Array.isArray(track) ? track : (track as AnimationTrack | undefined)?.keyframes;\n\tconst keys = normalizeKeyframes(keyframes as AnimationKeyframe[]);\n\tif (keys.length === 0) return undefined;\n\tif (!(time > keys[0].time)) return keys[0].value;\n\tconst last = keys[keys.length - 1];\n\tif (time >= last.time) return last.value;\n\tconst i = segmentIndex(keys, time);\n\tconst a = keys[i];\n\tconst b = keys[i + 1];\n\tif (time === a.time) return a.value;\n\tconst span = b.time - a.time;\n\tconst u = (time - a.time) / span;\n\tif (a.easing === 'hold') return a.value;\n\treturn interpolateAnimationValue(a.value, b.value, evaluateEasing(a.easing, u, span), type);\n}\n\n/**\n * Maps a running time onto the timeline `[0, duration]`: clamped (`none`), wrapped (`loop`)\n * or bounced (`ping-pong`).\n */\nexport function wrapAnimationTime(time: number, duration: number, loop: AnimationLoopMode = 'none'): number {\n\tif (!Number.isFinite(time)) return 0;\n\tif (!(duration > 0)) return 0;\n\tif (loop === 'loop') return ((time % duration) + duration) % duration;\n\tif (loop === 'ping-pong') {\n\t\tconst period = duration * 2;\n\t\tconst m = ((time % period) + period) % period;\n\t\treturn m <= duration ? m : period - m;\n\t}\n\treturn Math.min(duration, Math.max(0, time));\n}\n","/**\n * The time source that animations (and canvas agent performances) play on.\n *\n * Defaults to `realClock` (requestAnimationFrame and setTimeout).\n * A `ManualClock` moves only when told to via `advance(ms)` or `tick(fps)`,\n * enabling deterministic frame-by-frame stepping for testing, video generation,\n * or headless server environments.\n */\n\nexport interface Clock {\n\t/** Current time in milliseconds. */\n\tnow(): number;\n\t/** Resolves on the next animation frame. */\n\tframe(): Promise<void>;\n\t/** Resolves after `ms` milliseconds of this clock's time. */\n\tsleep(ms: number): Promise<void>;\n\t/**\n\t * Whether the clock follows wall time. Live clocks stop or degrade when the\n\t * tab is in the background (browsers pause animation frames), so transitions\n\t * can commit immediately rather than leaving operations hanging.\n\t */\n\treadonly live: boolean;\n}\n\n/** Whether the browser tab is hidden (where RAF pauses). */\nexport const pageHidden = (): boolean =>\n\ttypeof document !== 'undefined' && document.hidden;\n\n/** Real-time clock using requestAnimationFrame and setTimeout. */\nexport const realClock: Clock = {\n\tlive: true,\n\tnow: () => (typeof performance !== 'undefined' ? performance.now() : Date.now()),\n\tframe: () =>\n\t\tnew Promise<void>((resolve) => {\n\t\t\tif (typeof requestAnimationFrame === 'function' && !pageHidden()) {\n\t\t\t\trequestAnimationFrame(() => resolve());\n\t\t\t} else {\n\t\t\t\tsetTimeout(resolve, 16);\n\t\t\t}\n\t\t}),\n\tsleep: (ms: number) => new Promise<void>((resolve) => setTimeout(resolve, Math.max(0, ms)))\n};\n\nconst settle = () => new Promise<void>((resolve) => setTimeout(resolve, 0));\n\n/**\n * A deterministic clock that only moves forward when `advance` or `tick` is called.\n * Allows step-by-step frame testing and video rendering without waiting for real time.\n */\nexport class ManualClock implements Clock {\n\treadonly live = false;\n\tprivate time: number;\n\tprivate frames: (() => void)[] = [];\n\tprivate sleepers: { at: number; seq: number; resolve: () => void }[] = [];\n\tprivate seq = 0;\n\n\tconstructor(start = 0) {\n\t\tthis.time = start;\n\t}\n\n\tpublic now(): number {\n\t\treturn this.time;\n\t}\n\n\tpublic frame(): Promise<void> {\n\t\treturn new Promise<void>((resolve) => this.frames.push(resolve));\n\t}\n\n\tpublic sleep(ms: number): Promise<void> {\n\t\treturn new Promise<void>((resolve) =>\n\t\t\tthis.sleepers.push({\n\t\t\t\tat: this.time + Math.max(0, ms),\n\t\t\t\tseq: this.seq++,\n\t\t\t\tresolve\n\t\t\t})\n\t\t);\n\t}\n\n\t/** Whether any frames or sleep timers are currently pending. */\n\tpublic get pending(): boolean {\n\t\treturn this.frames.length > 0 || this.sleepers.length > 0;\n\t}\n\n\t/** Advances time by `ms`, resolving due sleep timers in order, followed by queued frames. */\n\tpublic async advance(ms: number): Promise<void> {\n\t\tconst end = this.time + Math.max(0, ms);\n\t\tawait settle();\n\n\t\twhile (true) {\n\t\t\tlet next: (typeof this.sleepers)[number] | undefined;\n\t\t\tfor (const s of this.sleepers) {\n\t\t\t\tif (s.at <= end && (!next || s.at < next.at || (s.at === next.at && s.seq < next.seq))) {\n\t\t\t\t\tnext = s;\n\t\t\t\t}\n\t\t\t}\n\t\t\tif (!next) break;\n\n\t\t\tthis.sleepers.splice(this.sleepers.indexOf(next), 1);\n\t\t\tthis.time = Math.max(this.time, next.at);\n\t\t\tnext.resolve();\n\t\t\tawait settle();\n\t\t}\n\n\t\tthis.time = end;\n\t\tconst dueFrames = this.frames.splice(0, this.frames.length);\n\t\tfor (const resolveFrame of dueFrames) {\n\t\t\tresolveFrame();\n\t\t}\n\t\tawait settle();\n\t}\n\n\t/** Convenience method to advance by 1 frame at a given fps (default: 60fps = 16.67ms). */\n\tpublic async tick(fps = 60): Promise<void> {\n\t\tawait this.advance(Math.round(1000 / fps));\n\t}\n}\n","import { realClock, type Clock } from './clock.js';\nimport { wrapAnimationTime, type AnimationLoopMode } from './evaluate.js';\n\nexport interface AnimationPlayerState {\n\t/** Playhead time in ms, inside `[0, duration]`. */\n\ttime: number;\n\tplaying: boolean;\n\t/** True between `scrub` and `endScrub`. */\n\tscrubbing: boolean;\n\tloop: AnimationLoopMode;\n\t/** Speed multiplier (negative plays backwards). */\n\tplaybackRate: number;\n\tduration: number;\n}\n\nexport interface AnimationPlayerOptions {\n\t/** Time source (default `realClock`: requestAnimationFrame). Pass a `ManualClock` in tests or for rendering. */\n\tclock?: Clock;\n\t/** Timeline length in ms, or a getter (e.g. the last keyframe time). Default 1000. */\n\tduration?: number | (() => number);\n\tloop?: AnimationLoopMode;\n\tplaybackRate?: number;\n\t/** Initial playhead time (default 0). */\n\ttime?: number;\n\t/** Called whenever the playhead moves (playback, seek, scrub). */\n\tonTime?: (time: number) => void;\n\t/** Called when non-looping playback reaches the end (or the start, playing backwards). */\n\tonEnd?: () => void;\n}\n\n/**\n * Plays a timeline on an injectable `Clock`: play / pause / seek / scrub with looping,\n * ping-pong and playback rate. It only asks the clock for frames while playing, so a\n * `ManualClock` steps it deterministically and the real clock's requestAnimationFrame is the\n * only place wall time enters.\n *\n * `getState()` returns a cached snapshot replaced on change (usable with `useSyncExternalStore`).\n */\nexport class AnimationPlayer {\n\tprivate readonly clock: Clock;\n\tprivate durationSource: number | (() => number);\n\tprivate onTime?: (time: number) => void;\n\tprivate onEnd?: () => void;\n\tprivate time: number;\n\tprivate playing = false;\n\tprivate scrubbing = false;\n\tprivate resumeAfterScrub = false;\n\tprivate loop: AnimationLoopMode;\n\tprivate rate: number;\n\t/** Unwrapped time at `anchorAt` (keeps the ping-pong direction across frames). */\n\tprivate anchorRaw = 0;\n\tprivate anchorAt = 0;\n\tprivate generation = 0;\n\tprivate cached: AnimationPlayerState;\n\tprivate listeners = new Set<(state: AnimationPlayerState) => void>();\n\n\tconstructor(options: AnimationPlayerOptions = {}) {\n\t\tthis.clock = options.clock ?? realClock;\n\t\tthis.durationSource = options.duration ?? 1000;\n\t\tthis.loop = options.loop ?? 'none';\n\t\tthis.rate = Number.isFinite(options.playbackRate) && options.playbackRate !== 0 ? options.playbackRate! : 1;\n\t\tthis.onTime = options.onTime;\n\t\tthis.onEnd = options.onEnd;\n\t\tthis.time = this.clamp(options.time ?? 0);\n\t\tthis.cached = this.snapshot();\n\t}\n\n\t/** Current timeline length (ms). */\n\tget duration(): number {\n\t\tconst d = typeof this.durationSource === 'function' ? this.durationSource() : this.durationSource;\n\t\treturn Number.isFinite(d) && d > 0 ? d : 0;\n\t}\n\n\tget currentTime(): number {\n\t\treturn this.time;\n\t}\n\n\tget isPlaying(): boolean {\n\t\treturn this.playing;\n\t}\n\n\tgetState(): AnimationPlayerState {\n\t\treturn this.cached;\n\t}\n\n\tsubscribe(listener: (state: AnimationPlayerState) => void): () => void {\n\t\tthis.listeners.add(listener);\n\t\treturn () => {\n\t\t\tthis.listeners.delete(listener);\n\t\t};\n\t}\n\n\t/** Replaces the callbacks (hooks keep them current without recreating the player). */\n\tsetCallbacks(callbacks: { onTime?: (time: number) => void; onEnd?: () => void }): void {\n\t\tthis.onTime = callbacks.onTime;\n\t\tthis.onEnd = callbacks.onEnd;\n\t}\n\n\tsetDuration(duration: number | (() => number)): void {\n\t\tthis.durationSource = duration;\n\t\tthis.time = this.clamp(this.time);\n\t\tthis.emit(false);\n\t}\n\n\tsetLoop(loop: AnimationLoopMode): void {\n\t\tif (loop === this.loop) return;\n\t\tthis.reanchor();\n\t\tthis.loop = loop;\n\t\tthis.emit(false);\n\t}\n\n\tsetPlaybackRate(rate: number): void {\n\t\tif (!Number.isFinite(rate) || rate === 0 || rate === this.rate) return;\n\t\tthis.reanchor();\n\t\tthis.rate = rate;\n\t\tthis.emit(false);\n\t}\n\n\t/** Starts playing from the playhead (from the start again when a one-shot play had ended). */\n\tplay(): void {\n\t\tif (this.playing) return;\n\t\tconst d = this.duration;\n\t\tif (this.loop === 'none' && d > 0) {\n\t\t\tif (this.rate > 0 && this.time >= d) this.time = 0;\n\t\t\tif (this.rate < 0 && this.time <= 0) this.time = d;\n\t\t}\n\t\tthis.playing = true;\n\t\tthis.scrubbing = false;\n\t\tthis.anchorRaw = this.time;\n\t\tthis.anchorAt = this.clock.now();\n\t\tthis.emit(false);\n\t\tthis.schedule();\n\t}\n\n\tpause(): void {\n\t\tif (!this.playing) return;\n\t\tthis.tick(false);\n\t\tthis.playing = false;\n\t\tthis.generation++;\n\t\tthis.emit(true);\n\t}\n\n\ttoggle(): void {\n\t\tif (this.playing) this.pause();\n\t\telse this.play();\n\t}\n\n\t/** Pauses and returns to the start. */\n\tstop(): void {\n\t\tthis.playing = false;\n\t\tthis.generation++;\n\t\tthis.seek(0);\n\t}\n\n\t/** Moves the playhead (clamped to the timeline); playback continues from there. */\n\tseek(time: number): void {\n\t\tif (!Number.isFinite(time)) return;\n\t\tthis.time = this.clamp(time);\n\t\tthis.anchorRaw = this.time;\n\t\tthis.anchorAt = this.clock.now();\n\t\tthis.emit(true);\n\t}\n\n\t/** Seeks while dragging the playhead: playback pauses until `endScrub`. */\n\tscrub(time: number): void {\n\t\tif (!this.scrubbing) {\n\t\t\tthis.resumeAfterScrub = this.playing;\n\t\t\tif (this.playing) {\n\t\t\t\tthis.playing = false;\n\t\t\t\tthis.generation++;\n\t\t\t}\n\t\t\tthis.scrubbing = true;\n\t\t}\n\t\tthis.seek(time);\n\t}\n\n\t/** Ends a scrub, resuming playback if it was playing when the scrub began. */\n\tendScrub(): void {\n\t\tif (!this.scrubbing) return;\n\t\tthis.scrubbing = false;\n\t\tconst resume = this.resumeAfterScrub;\n\t\tthis.resumeAfterScrub = false;\n\t\tif (resume) this.play();\n\t\telse this.emit(false);\n\t}\n\n\t/** Stops scheduling frames and drops listeners. */\n\tdestroy(): void {\n\t\tthis.playing = false;\n\t\tthis.generation++;\n\t\tthis.listeners.clear();\n\t}\n\n\tprivate clamp(time: number): number {\n\t\treturn Math.min(this.duration, Math.max(0, Number.isFinite(time) ? time : 0));\n\t}\n\n\tprivate reanchor() {\n\t\tif (!this.playing) return;\n\t\tthis.tick(false);\n\t\tthis.anchorRaw = this.rawNow();\n\t\tthis.anchorAt = this.clock.now();\n\t}\n\n\tprivate rawNow(): number {\n\t\treturn this.anchorRaw + (this.clock.now() - this.anchorAt) * this.rate;\n\t}\n\n\tprivate schedule() {\n\t\tconst generation = this.generation;\n\t\tthis.clock.frame().then(() => {\n\t\t\tif (generation !== this.generation || !this.playing) return;\n\t\t\tthis.tick(true);\n\t\t\tif (this.playing) this.schedule();\n\t\t});\n\t}\n\n\t/** Advances the playhead to the clock's time; `notify` emits the change. */\n\tprivate tick(notify: boolean) {\n\t\tif (!this.playing) return;\n\t\tconst d = this.duration;\n\t\tconst raw = this.rawNow();\n\t\tlet ended = false;\n\t\tif (this.loop === 'none' || d <= 0) {\n\t\t\tif (this.rate > 0 && raw >= d) {\n\t\t\t\tthis.time = d;\n\t\t\t\tended = true;\n\t\t\t} else if (this.rate < 0 && raw <= 0) {\n\t\t\t\tthis.time = 0;\n\t\t\t\tended = true;\n\t\t\t} else this.time = this.clamp(raw);\n\t\t} else {\n\t\t\tthis.time = wrapAnimationTime(raw, d, this.loop);\n\t\t}\n\t\tif (ended) {\n\t\t\tthis.playing = false;\n\t\t\tthis.generation++;\n\t\t}\n\t\tif (notify || ended) this.emit(true);\n\t\tif (ended) this.onEnd?.();\n\t}\n\n\tprivate snapshot(): AnimationPlayerState {\n\t\treturn {\n\t\t\ttime: this.time,\n\t\t\tplaying: this.playing,\n\t\t\tscrubbing: this.scrubbing,\n\t\t\tloop: this.loop,\n\t\t\tplaybackRate: this.rate,\n\t\t\tduration: this.duration\n\t\t};\n\t}\n\n\tprivate emit(timeChanged: boolean) {\n\t\tconst next = this.snapshot();\n\t\tconst prev = this.cached;\n\t\tif (\n\t\t\tprev.time === next.time &&\n\t\t\tprev.playing === next.playing &&\n\t\t\tprev.scrubbing === next.scrubbing &&\n\t\t\tprev.loop === next.loop &&\n\t\t\tprev.playbackRate === next.playbackRate &&\n\t\t\tprev.duration === next.duration\n\t\t) {\n\t\t\treturn;\n\t\t}\n\t\tthis.cached = next;\n\t\tif (timeChanged && prev.time !== next.time) this.onTime?.(next.time);\n\t\tfor (const listener of this.listeners) listener(next);\n\t}\n}\n\nexport function createAnimationPlayer(options?: AnimationPlayerOptions): AnimationPlayer {\n\treturn new AnimationPlayer(options);\n}\n"],"mappings":";;;;;;;;;AAUO,IAAM,yBAAyB;AAsBtC,SAAS,QAAQ,OAAyC;AACzD,SAAQ,OAAO,UAAU,YAAY,OAAO,SAAS,KAAK,KAAM,OAAO,UAAU;AAClF;AAGO,SAAS,oBAAoB,OAA4C;AAC/E,MAAI,OAAO,UAAU,YAAY,UAAU,KAAM,QAAO;AACxD,QAAM,IAAI;AACV,SACC,OAAO,EAAE,SAAS,YAClB,OAAO,SAAS,EAAE,IAAI,KACtB,QAAQ,EAAE,KAAK,MACd,EAAE,WAAW,UAAa,kBAAkB,EAAE,MAAM;AAEvD;AAEA,IAAM,cAAc,oBAAI,QAAgG;AAQjH,SAAS,mBAAmB,WAAiF;AACnH,MAAI,CAAC,MAAM,QAAQ,SAAS,EAAG,QAAO,CAAC;AACvC,QAAM,SAAS,YAAY,IAAI,SAAS;AAExC,MAAI,UAAU,OAAO,MAAM,WAAW,UAAU,UAAU,OAAO,MAAM,MAAM,CAAC,GAAG,MAAM,MAAM,UAAU,CAAC,CAAC,EAAG,QAAO,OAAO;AAC1H,QAAM,UAAU,UACd,IAAI,CAAC,GAAG,OAAO,EAAE,GAAG,EAAE,EAAE,EACxB,OAAO,CAAC,EAAE,EAAE,MAAM,oBAAoB,CAAC,CAAC,EACxC,KAAK,CAAC,GAAG,MAAM,EAAE,EAAE,OAAO,EAAE,EAAE,QAAQ,EAAE,IAAI,EAAE,CAAC;AACjD,QAAM,MAA2B,CAAC;AAClC,MAAI,YAAY;AAChB,aAAW,EAAE,GAAG,EAAE,KAAK,SAAS;AAC/B,UAAM,OAAO,IAAI,IAAI,SAAS,CAAC;AAC/B,QAAI,QAAQ,KAAK,IAAI,EAAE,OAAO,KAAK,IAAI,KAAK,wBAAwB;AACnE,UAAI,IAAI,WAAW;A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,KAAK,KAAM,MAAK,SAAS,KAAK,IAAI;AACnE,eAAW,YAAY,KAAK,UAAW,UAAS,IAAI;AAAA,EACrD;AACD;AAEO,SAAS,sBAAsB,SAAmD;AACxF,SAAO,IAAI,gBAAgB,OAAO;AACnC;","names":[]}
@@ -0,0 +1,66 @@
1
+ import {
2
+ hexToRgba,
3
+ normalizeTokenColor,
4
+ rgbaToHex
5
+ } from "./chunk-TGD52FEZ.js";
6
+
7
+ // src/animation/color.ts
8
+ var toLinear = (c) => c <= 0.04045 ? c / 12.92 : ((c + 0.055) / 1.055) ** 2.4;
9
+ var toGamma = (c) => c <= 31308e-7 ? 12.92 * c : 1.055 * Math.sign(c) * Math.abs(c) ** (1 / 2.4) - 0.055;
10
+ function rgbToOklab(r, g, b, alpha = 1) {
11
+ const lr = toLinear(r);
12
+ const lg = toLinear(g);
13
+ const lb = toLinear(b);
14
+ const l = Math.cbrt(0.4122214708 * lr + 0.5363325363 * lg + 0.0514459929 * lb);
15
+ const m = Math.cbrt(0.2119034982 * lr + 0.6806995451 * lg + 0.1073969566 * lb);
16
+ const s = Math.cbrt(0.0883024619 * lr + 0.2817188376 * lg + 0.6299787005 * lb);
17
+ return {
18
+ l: 0.2104542553 * l + 0.793617785 * m - 0.0040720468 * s,
19
+ a: 1.9779984951 * l - 2.428592205 * m + 0.4505937099 * s,
20
+ b: 0.0259040371 * l + 0.7827717662 * m - 0.808675766 * s,
21
+ alpha
22
+ };
23
+ }
24
+ function oklabToRgb(color) {
25
+ const l_ = color.l + 0.3963377774 * color.a + 0.2158037573 * color.b;
26
+ const m_ = color.l - 0.1055613458 * color.a - 0.0638541728 * color.b;
27
+ const s_ = color.l - 0.0894841775 * color.a - 1.291485548 * color.b;
28
+ const l = l_ ** 3;
29
+ const m = m_ ** 3;
30
+ const s = s_ ** 3;
31
+ const clamp01 = (v) => Math.min(1, Math.max(0, v));
32
+ return {
33
+ r: clamp01(toGamma(4.0767416621 * l - 3.3077115913 * m + 0.2309699292 * s)),
34
+ g: clamp01(toGamma(-1.2684380046 * l + 2.6097574011 * m - 0.3413193965 * s)),
35
+ b: clamp01(toGamma(-0.0041960863 * l - 0.7034186147 * m + 1.707614701 * s)),
36
+ a: clamp01(color.alpha)
37
+ };
38
+ }
39
+ function parseOklab(input) {
40
+ const hex = normalizeTokenColor(input);
41
+ if (hex === null) return null;
42
+ const c = hexToRgba(hex);
43
+ return rgbToOklab(c.r, c.g, c.b, c.a);
44
+ }
45
+ function formatOklab(color) {
46
+ const { r, g, b, a } = oklabToRgb(color);
47
+ return rgbaToHex(r, g, b, a);
48
+ }
49
+ function mixColorsOklab(from, to, t) {
50
+ const a = parseOklab(from);
51
+ const b = parseOklab(to);
52
+ if (!a || !b) return null;
53
+ const alpha = a.alpha + (b.alpha - a.alpha) * t;
54
+ const premul = (k) => a[k] * a.alpha + (b[k] * b.alpha - a[k] * a.alpha) * t;
55
+ if (alpha <= 1e-9) return formatOklab({ l: a.l + (b.l - a.l) * t, a: 0, b: 0, alpha: 0 });
56
+ return formatOklab({ l: premul("l") / alpha, a: premul("a") / alpha, b: premul("b") / alpha, alpha });
57
+ }
58
+
59
+ export {
60
+ rgbToOklab,
61
+ oklabToRgb,
62
+ parseOklab,
63
+ formatOklab,
64
+ mixColorsOklab
65
+ };
66
+ //# sourceMappingURL=chunk-ZRJMJIQU.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../src/animation/color.ts"],"sourcesContent":["import { hexToRgba, normalizeTokenColor, rgbaToHex } from '../tokens/color.js';\n\n/**\n * Colour interpolation in OKLab (Björn Ottosson's perceptual space, as CSS Color 4 uses for\n * `color-mix(in oklab, …)`), with premultiplied alpha so a fade to `transparent` does not\n * darken through black.\n */\n\nexport interface OklabColor {\n\t/** Lightness, 0–1. */\n\tl: number;\n\ta: number;\n\tb: number;\n\t/** Alpha, 0–1. */\n\talpha: number;\n}\n\nconst toLinear = (c: number) => (c <= 0.04045 ? c / 12.92 : ((c + 0.055) / 1.055) ** 2.4);\nconst toGamma = (c: number) => (c <= 0.0031308 ? 12.92 * c : 1.055 * Math.sign(c) * Math.abs(c) ** (1 / 2.4) - 0.055);\n\n/** sRGB channels (0–1) to OKLab. */\nexport function rgbToOklab(r: number, g: number, b: number, alpha = 1): OklabColor {\n\tconst lr = toLinear(r);\n\tconst lg = toLinear(g);\n\tconst lb = toLinear(b);\n\tconst l = Math.cbrt(0.4122214708 * lr + 0.5363325363 * lg + 0.0514459929 * lb);\n\tconst m = Math.cbrt(0.2119034982 * lr + 0.6806995451 * lg + 0.1073969566 * lb);\n\tconst s = Math.cbrt(0.0883024619 * lr + 0.2817188376 * lg + 0.6299787005 * lb);\n\treturn {\n\t\tl: 0.2104542553 * l + 0.793617785 * m - 0.0040720468 * s,\n\t\ta: 1.9779984951 * l - 2.428592205 * m + 0.4505937099 * s,\n\t\tb: 0.0259040371 * l + 0.7827717662 * m - 0.808675766 * s,\n\t\talpha\n\t};\n}\n\n/** OKLab to sRGB channels (0–1, clamped into gamut). */\nexport function oklabToRgb(color: OklabColor): { r: number; g: number; b: number; a: number } {\n\tconst l_ = color.l + 0.3963377774 * color.a + 0.2158037573 * color.b;\n\tconst m_ = color.l - 0.1055613458 * color.a - 0.0638541728 * color.b;\n\tconst s_ = color.l - 0.0894841775 * color.a - 1.291485548 * color.b;\n\tconst l = l_ ** 3;\n\tconst m = m_ ** 3;\n\tconst s = s_ ** 3;\n\tconst clamp01 = (v: number) => Math.min(1, Math.max(0, v));\n\treturn {\n\t\tr: clamp01(toGamma(4.0767416621 * l - 3.3077115913 * m + 0.2309699292 * s)),\n\t\tg: clamp01(toGamma(-1.2684380046 * l + 2.6097574011 * m - 0.3413193965 * s)),\n\t\tb: clamp01(toGamma(-0.0041960863 * l - 0.7034186147 * m + 1.707614701 * s)),\n\t\ta: clamp01(color.alpha)\n\t};\n}\n\n/** Parses a CSS colour (hex, `rgb()` / `rgba()`, `transparent`, `black`, `white`) to OKLab, or `null`. */\nexport function parseOklab(input: unknown): OklabColor | null {\n\tconst hex = normalizeTokenColor(input);\n\tif (hex === null) return null;\n\tconst c = hexToRgba(hex)!;\n\treturn rgbToOklab(c.r, c.g, c.b, c.a);\n}\n\n/** Formats OKLab as `#rrggbb` (or `#rrggbbaa` when translucent). */\nexport function formatOklab(color: OklabColor): string {\n\tconst { r, g, b, a } = oklabToRgb(color);\n\treturn rgbaToHex(r, g, b, a);\n}\n\n/**\n * Mixes two colours at `t` (0 = `from`, 1 = `to`) in OKLab with premultiplied alpha.\n * Returns `null` when either is not a readable colour.\n */\nexport function mixColorsOklab(from: unknown, to: unknown, t: number): string | null {\n\tconst a = parseOklab(from);\n\tconst b = parseOklab(to);\n\tif (!a || !b) return null;\n\tconst alpha = a.alpha + (b.alpha - a.alpha) * t;\n\tconst premul = (k: 'l' | 'a' | 'b') => a[k] * a.alpha + (b[k] * b.alpha - a[k] * a.alpha) * t;\n\tif (alpha <= 1e-9) return formatOklab({ l: a.l + (b.l - a.l) * t, a: 0, b: 0, alpha: 0 });\n\treturn formatOklab({ l: premul('l') / alpha, a: premul('a') / alpha, b: premul('b') / alpha, alpha });\n}\n"],"mappings":";;;;;;;AAiBA,IAAM,WAAW,CAAC,MAAe,KAAK,UAAU,IAAI,UAAU,IAAI,SAAS,UAAU;AACrF,IAAM,UAAU,CAAC,MAAe,KAAK,WAAY,QAAQ,IAAI,QAAQ,KAAK,KAAK,CAAC,IAAI,KAAK,IAAI,CAAC,MAAM,IAAI,OAAO;AAGxG,SAAS,WAAW,GAAW,GAAW,GAAW,QAAQ,GAAe;AAClF,QAAM,KAAK,SAAS,CAAC;AACrB,QAAM,KAAK,SAAS,CAAC;AACrB,QAAM,KAAK,SAAS,CAAC;AACrB,QAAM,IAAI,KAAK,KAAK,eAAe,KAAK,eAAe,KAAK,eAAe,EAAE;AAC7E,QAAM,IAAI,KAAK,KAAK,eAAe,KAAK,eAAe,KAAK,eAAe,EAAE;AAC7E,QAAM,IAAI,KAAK,KAAK,eAAe,KAAK,eAAe,KAAK,eAAe,EAA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AI;AACzB,QAAM,IAAI,WAAW,EAAE;AACvB,MAAI,CAAC,KAAK,CAAC,EAAG,QAAO;AACrB,QAAM,QAAQ,EAAE,SAAS,EAAE,QAAQ,EAAE,SAAS;AAC9C,QAAM,SAAS,CAAC,MAAuB,EAAE,CAAC,IAAI,EAAE,SAAS,EAAE,CAAC,IAAI,EAAE,QAAQ,EAAE,CAAC,IAAI,EAAE,SAAS;AAC5F,MAAI,SAAS,KAAM,QAAO,YAAY,EAAE,GAAG,EAAE,KAAK,EAAE,IAAI,EAAE,KAAK,GAAG,GAAG,GAAG,GAAG,GAAG,OAAO,EAAE,CAAC;AACxF,SAAO,YAAY,EAAE,GAAG,OAAO,GAAG,IAAI,OAAO,GAAG,OAAO,GAAG,IAAI,OAAO,GAAG,OAAO,GAAG,IAAI,OAAO,MAAM,CAAC;AACrG;","names":[]}
@@ -1009,4 +1009,4 @@ interface PathfinderResult extends PathOpsReport {
1009
1009
  */
1010
1010
  declare function pathfinder(op: PathfinderOperation, shapes: readonly PathfinderShape[], options?: PathOpsOptions): PathfinderResult;
1011
1011
 
1012
- export { type PolygonInput as $, type AffineMatrix as A, type BezierPathInput as B, type CanvasGradientDef as C, type DashedPath as D, type EllipseShape as E, type FlattenOptions as F, type GetShapeRenderDataOptions as G, type PathOpsOptions as H, type PathOpsReport as I, type PathPiece as J, type PathPointAtLength as K, type PathSelectResult as L, type MultiPolygon as M, type PathShape as N, type OffsetPathOptions as O, PlanarMap as P, type PathfinderPiece as Q, type PathfinderResult as R, type SvgGradientDef as S, type PlanarChain as T, type PlanarFace as U, type PlanarInput as V, type PlanarMapOptions as W, type PlanarSplitEdge as X, type PlanarSplitResult as Y, type PolygonBooleanOperation as Z, type PolygonBooleanOptions as _, type BezierPath as a, segmentCurvature as a$, type PolygonOperand as a0, type PolygonPiece as a1, type PolygonToPathOptions as a2, type PolygonWithHoles as a3, type RectShape as a4, type RegularPolygonShape as a5, SHAPE_KINDS as a6, type SegmentIntersection as a7, type ShapeKind as a8, type ShapePaint as a9, gradientToSvgDef as aA, interiorPoint as aB, intersectPaths as aC, intersectPolygons as aD, isCanvasGradient as aE, isShapeDescription as aF, multiPolygonArea as aG, multiPolygonBounds as aH, normalizeBezierPath as aI, offsetPath as aJ, outlineStroke as aK, parseCssGradient as aL, parseSvgPath as aM, pathBoolean as aN, pathBooleanSelect as aO, pathToContours as aP, pathfinder as aQ, planarSplit as aR, pointInBezierPath as aS, pointInMultiPolygon as aT, pointInRings as aU, polygonArea as aV, polygonBoolean as aW, polygonToSvgPath as aX, resolveCanvasGradient as aY, ringSignedArea as aZ, segmentBounds as a_, type ShapeRenderData as aa, type StarShape as ab, type SvgGradientStop as ac, angleToSvgLinearCoords as ad, arcToCubics as ae, bezierPathArea as af, bezierPathBounds as ag, bezierPathLength as ah, bezierPathPointAtLength as ai, bezierPathSignedArea as aj, bezierPathToSvg as ak, closeContour as al, contourEnclosesArea as am, contourSignedArea as an, contoursToPath as ao, countPathSegments as ap, cutOutPiece as aq, dashContours as ar, distanceToBezierPath as as, dividePaths as at, dividePolygons as au, excludePaths as av, flattenSvgPath as aw, formatNumber as ax, getShapeRenderData as ay, getShapeSvg as az, type StrokeJoin as b, segmentDerivative as b0, segmentExtrema as b1, segmentIntersections as b2, segmentLength as b3, segmentNearest as b4, segmentParamAtLength as b5, segmentPoint as b6, segmentTangent as b7, shapeToPolygon as b8, simplifyRing as b9, splitSegment as ba, strokeOutlineRings as bb, subSegment as bc, subtractPaths as bd, subtractPolygons as be, toBezierPath as bf, transformBezierPath as bg, trimSegments as bh, unionPolygons as bi, unitePaths as bj, windingNumber as bk, xorPolygons as bl, type StrokeCap as c, type BezierSegment as d, type PathfinderOperation as e, type PathfinderShape as f, type ShapeDescription as g, type PolygonFillRule as h, type PolygonRing as i, type ShapeSize as j, type BezierCommand as k, type BezierContour as l, type BezierPathToSvgOptions as m, CANVAS_GRADIENT_PRESETS as n, type CanvasLinearGradient as o, type CanvasRadialGradient as p, type DividePathsResult as q, type GradientStop as r, type OutlineStrokeOptions as s, PATHFINDER_OPERATIONS as t, type PathBooleanOperation as u, type PathBooleanResult as v, type PathCommand as w, type PathOperand as x, type PathOperandInput as y, PathOpsError as z };
1012
+ export { type PolygonInput as $, type AffineMatrix as A, type BezierPathInput as B, type CanvasGradientDef as C, type DashedPath as D, type EllipseShape as E, type FlattenOptions as F, type GradientStop as G, type PathOpsOptions as H, type PathOpsReport as I, type PathPiece as J, type PathPointAtLength as K, type PathSelectResult as L, type MultiPolygon as M, type PathShape as N, type OffsetPathOptions as O, PlanarMap as P, type PathfinderPiece as Q, type PathfinderResult as R, type SvgGradientDef as S, type PlanarChain as T, type PlanarFace as U, type PlanarInput as V, type PlanarMapOptions as W, type PlanarSplitEdge as X, type PlanarSplitResult as Y, type PolygonBooleanOperation as Z, type PolygonBooleanOptions as _, type BezierPath as a, segmentCurvature as a$, type PolygonOperand as a0, type PolygonPiece as a1, type PolygonToPathOptions as a2, type PolygonWithHoles as a3, type RectShape as a4, type RegularPolygonShape as a5, SHAPE_KINDS as a6, type SegmentIntersection as a7, type ShapeKind as a8, type ShapePaint as a9, gradientToSvgDef as aA, interiorPoint as aB, intersectPaths as aC, intersectPolygons as aD, isCanvasGradient as aE, isShapeDescription as aF, multiPolygonArea as aG, multiPolygonBounds as aH, normalizeBezierPath as aI, offsetPath as aJ, outlineStroke as aK, parseCssGradient as aL, parseSvgPath as aM, pathBoolean as aN, pathBooleanSelect as aO, pathToContours as aP, pathfinder as aQ, planarSplit as aR, pointInBezierPath as aS, pointInMultiPolygon as aT, pointInRings as aU, polygonArea as aV, polygonBoolean as aW, polygonToSvgPath as aX, resolveCanvasGradient as aY, ringSignedArea as aZ, segmentBounds as a_, type ShapeRenderData as aa, type StarShape as ab, type SvgGradientStop as ac, angleToSvgLinearCoords as ad, arcToCubics as ae, bezierPathArea as af, bezierPathBounds as ag, bezierPathLength as ah, bezierPathPointAtLength as ai, bezierPathSignedArea as aj, bezierPathToSvg as ak, closeContour as al, contourEnclosesArea as am, contourSignedArea as an, contoursToPath as ao, countPathSegments as ap, cutOutPiece as aq, dashContours as ar, distanceToBezierPath as as, dividePaths as at, dividePolygons as au, excludePaths as av, flattenSvgPath as aw, formatNumber as ax, getShapeRenderData as ay, getShapeSvg as az, type StrokeJoin as b, segmentDerivative as b0, segmentExtrema as b1, segmentIntersections as b2, segmentLength as b3, segmentNearest as b4, segmentParamAtLength as b5, segmentPoint as b6, segmentTangent as b7, shapeToPolygon as b8, simplifyRing as b9, splitSegment as ba, strokeOutlineRings as bb, subSegment as bc, subtractPaths as bd, subtractPolygons as be, toBezierPath as bf, transformBezierPath as bg, trimSegments as bh, unionPolygons as bi, unitePaths as bj, windingNumber as bk, xorPolygons as bl, type StrokeCap as c, type BezierSegment as d, type PathfinderOperation as e, type PathfinderShape as f, type ShapeDescription as g, type PolygonFillRule as h, type PolygonRing as i, type ShapeSize as j, type BezierCommand as k, type BezierContour as l, type BezierPathToSvgOptions as m, CANVAS_GRADIENT_PRESETS as n, type CanvasLinearGradient as o, type CanvasRadialGradient as p, type DividePathsResult as q, type GetShapeRenderDataOptions as r, type OutlineStrokeOptions as s, PATHFINDER_OPERATIONS as t, type PathBooleanOperation as u, type PathBooleanResult as v, type PathCommand as w, type PathOperand as x, type PathOperandInput as y, PathOpsError as z };
@@ -1009,4 +1009,4 @@ interface PathfinderResult extends PathOpsReport {
1009
1009
  */
1010
1010
  declare function pathfinder(op: PathfinderOperation, shapes: readonly PathfinderShape[], options?: PathOpsOptions): PathfinderResult;
1011
1011
 
1012
- export { type PolygonInput as $, type AffineMatrix as A, type BezierPathInput as B, type CanvasGradientDef as C, type DashedPath as D, type EllipseShape as E, type FlattenOptions as F, type GetShapeRenderDataOptions as G, type PathOpsOptions as H, type PathOpsReport as I, type PathPiece as J, type PathPointAtLength as K, type PathSelectResult as L, type MultiPolygon as M, type PathShape as N, type OffsetPathOptions as O, PlanarMap as P, type PathfinderPiece as Q, type PathfinderResult as R, type SvgGradientDef as S, type PlanarChain as T, type PlanarFace as U, type PlanarInput as V, type PlanarMapOptions as W, type PlanarSplitEdge as X, type PlanarSplitResult as Y, type PolygonBooleanOperation as Z, type PolygonBooleanOptions as _, type BezierPath as a, segmentCurvature as a$, type PolygonOperand as a0, type PolygonPiece as a1, type PolygonToPathOptions as a2, type PolygonWithHoles as a3, type RectShape as a4, type RegularPolygonShape as a5, SHAPE_KINDS as a6, type SegmentIntersection as a7, type ShapeKind as a8, type ShapePaint as a9, gradientToSvgDef as aA, interiorPoint as aB, intersectPaths as aC, intersectPolygons as aD, isCanvasGradient as aE, isShapeDescription as aF, multiPolygonArea as aG, multiPolygonBounds as aH, normalizeBezierPath as aI, offsetPath as aJ, outlineStroke as aK, parseCssGradient as aL, parseSvgPath as aM, pathBoolean as aN, pathBooleanSelect as aO, pathToContours as aP, pathfinder as aQ, planarSplit as aR, pointInBezierPath as aS, pointInMultiPolygon as aT, pointInRings as aU, polygonArea as aV, polygonBoolean as aW, polygonToSvgPath as aX, resolveCanvasGradient as aY, ringSignedArea as aZ, segmentBounds as a_, type ShapeRenderData as aa, type StarShape as ab, type SvgGradientStop as ac, angleToSvgLinearCoords as ad, arcToCubics as ae, bezierPathArea as af, bezierPathBounds as ag, bezierPathLength as ah, bezierPathPointAtLength as ai, bezierPathSignedArea as aj, bezierPathToSvg as ak, closeContour as al, contourEnclosesArea as am, contourSignedArea as an, contoursToPath as ao, countPathSegments as ap, cutOutPiece as aq, dashContours as ar, distanceToBezierPath as as, dividePaths as at, dividePolygons as au, excludePaths as av, flattenSvgPath as aw, formatNumber as ax, getShapeRenderData as ay, getShapeSvg as az, type StrokeJoin as b, segmentDerivative as b0, segmentExtrema as b1, segmentIntersections as b2, segmentLength as b3, segmentNearest as b4, segmentParamAtLength as b5, segmentPoint as b6, segmentTangent as b7, shapeToPolygon as b8, simplifyRing as b9, splitSegment as ba, strokeOutlineRings as bb, subSegment as bc, subtractPaths as bd, subtractPolygons as be, toBezierPath as bf, transformBezierPath as bg, trimSegments as bh, unionPolygons as bi, unitePaths as bj, windingNumber as bk, xorPolygons as bl, type StrokeCap as c, type BezierSegment as d, type PathfinderOperation as e, type PathfinderShape as f, type ShapeDescription as g, type PolygonFillRule as h, type PolygonRing as i, type ShapeSize as j, type BezierCommand as k, type BezierContour as l, type BezierPathToSvgOptions as m, CANVAS_GRADIENT_PRESETS as n, type CanvasLinearGradient as o, type CanvasRadialGradient as p, type DividePathsResult as q, type GradientStop as r, type OutlineStrokeOptions as s, PATHFINDER_OPERATIONS as t, type PathBooleanOperation as u, type PathBooleanResult as v, type PathCommand as w, type PathOperand as x, type PathOperandInput as y, PathOpsError as z };
1012
+ export { type PolygonInput as $, type AffineMatrix as A, type BezierPathInput as B, type CanvasGradientDef as C, type DashedPath as D, type EllipseShape as E, type FlattenOptions as F, type GradientStop as G, type PathOpsOptions as H, type PathOpsReport as I, type PathPiece as J, type PathPointAtLength as K, type PathSelectResult as L, type MultiPolygon as M, type PathShape as N, type OffsetPathOptions as O, PlanarMap as P, type PathfinderPiece as Q, type PathfinderResult as R, type SvgGradientDef as S, type PlanarChain as T, type PlanarFace as U, type PlanarInput as V, type PlanarMapOptions as W, type PlanarSplitEdge as X, type PlanarSplitResult as Y, type PolygonBooleanOperation as Z, type PolygonBooleanOptions as _, type BezierPath as a, segmentCurvature as a$, type PolygonOperand as a0, type PolygonPiece as a1, type PolygonToPathOptions as a2, type PolygonWithHoles as a3, type RectShape as a4, type RegularPolygonShape as a5, SHAPE_KINDS as a6, type SegmentIntersection as a7, type ShapeKind as a8, type ShapePaint as a9, gradientToSvgDef as aA, interiorPoint as aB, intersectPaths as aC, intersectPolygons as aD, isCanvasGradient as aE, isShapeDescription as aF, multiPolygonArea as aG, multiPolygonBounds as aH, normalizeBezierPath as aI, offsetPath as aJ, outlineStroke as aK, parseCssGradient as aL, parseSvgPath as aM, pathBoolean as aN, pathBooleanSelect as aO, pathToContours as aP, pathfinder as aQ, planarSplit as aR, pointInBezierPath as aS, pointInMultiPolygon as aT, pointInRings as aU, polygonArea as aV, polygonBoolean as aW, polygonToSvgPath as aX, resolveCanvasGradient as aY, ringSignedArea as aZ, segmentBounds as a_, type ShapeRenderData as aa, type StarShape as ab, type SvgGradientStop as ac, angleToSvgLinearCoords as ad, arcToCubics as ae, bezierPathArea as af, bezierPathBounds as ag, bezierPathLength as ah, bezierPathPointAtLength as ai, bezierPathSignedArea as aj, bezierPathToSvg as ak, closeContour as al, contourEnclosesArea as am, contourSignedArea as an, contoursToPath as ao, countPathSegments as ap, cutOutPiece as aq, dashContours as ar, distanceToBezierPath as as, dividePaths as at, dividePolygons as au, excludePaths as av, flattenSvgPath as aw, formatNumber as ax, getShapeRenderData as ay, getShapeSvg as az, type StrokeJoin as b, segmentDerivative as b0, segmentExtrema as b1, segmentIntersections as b2, segmentLength as b3, segmentNearest as b4, segmentParamAtLength as b5, segmentPoint as b6, segmentTangent as b7, shapeToPolygon as b8, simplifyRing as b9, splitSegment as ba, strokeOutlineRings as bb, subSegment as bc, subtractPaths as bd, subtractPolygons as be, toBezierPath as bf, transformBezierPath as bg, trimSegments as bh, unionPolygons as bi, unitePaths as bj, windingNumber as bk, xorPolygons as bl, type StrokeCap as c, type BezierSegment as d, type PathfinderOperation as e, type PathfinderShape as f, type ShapeDescription as g, type PolygonFillRule as h, type PolygonRing as i, type ShapeSize as j, type BezierCommand as k, type BezierContour as l, type BezierPathToSvgOptions as m, CANVAS_GRADIENT_PRESETS as n, type CanvasLinearGradient as o, type CanvasRadialGradient as p, type DividePathsResult as q, type GetShapeRenderDataOptions as r, type OutlineStrokeOptions as s, PATHFINDER_OPERATIONS as t, type PathBooleanOperation as u, type PathBooleanResult as v, type PathCommand as w, type PathOperand as x, type PathOperandInput as y, PathOpsError as z };