@pibbl/core 0.0.1 → 0.0.2

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.
Files changed (167) hide show
  1. package/README.md +1 -1
  2. package/dist/features/machines/animation.d.ts +64 -0
  3. package/dist/features/machines/animation.js +55 -0
  4. package/dist/features/machines/animation.js.map +7 -0
  5. package/dist/features/machines/animation.mjs +1 -0
  6. package/dist/features/machines/assign.d.ts +16 -0
  7. package/dist/features/machines/assign.js +15 -0
  8. package/dist/features/machines/assign.js.map +7 -0
  9. package/dist/features/machines/callback.d.ts +9 -0
  10. package/dist/features/machines/callback.js +7 -0
  11. package/dist/features/machines/callback.js.map +7 -0
  12. package/dist/features/machines/hook.d.ts +30 -0
  13. package/dist/features/machines/hook.js +37 -0
  14. package/dist/features/machines/hook.js.map +7 -0
  15. package/dist/features/machines/index.d.ts +6 -0
  16. package/dist/features/machines/index.js +12 -0
  17. package/dist/features/machines/index.js.map +7 -0
  18. package/dist/features/machines/index.mjs +1 -0
  19. package/dist/features/machines/runtime.d.ts +18 -0
  20. package/dist/features/machines/runtime.js +363 -0
  21. package/dist/features/machines/runtime.js.map +7 -0
  22. package/dist/features/machines/types.d.ts +164 -0
  23. package/dist/features/physics/2d-geometry.d.ts +3 -3
  24. package/dist/features/physics/2d-geometry.js.map +1 -1
  25. package/dist/features/physics/2d.d.ts +115 -62
  26. package/dist/features/physics/2d.js +59 -28
  27. package/dist/features/physics/2d.js.map +2 -2
  28. package/dist/features/physics/lib/2d/query-types.d.ts +6 -0
  29. package/dist/features/physics/lib/2d/runtime/controller.d.ts +7 -6
  30. package/dist/features/physics/lib/2d/runtime/controller.js.map +2 -2
  31. package/dist/features/physics/lib/2d/types.d.ts +8 -30
  32. package/dist/features/physics/lib/2d/world/queries.d.ts +7 -6
  33. package/dist/features/physics/lib/2d/world/queries.js.map +2 -2
  34. package/dist/features/sprites/formats/aseprite.d.ts +5 -0
  35. package/dist/features/sprites/formats/texture-packer.d.ts +5 -0
  36. package/dist/features/sprites/index.d.ts +6 -0
  37. package/dist/features/sprites/loader.d.ts +25 -0
  38. package/dist/features/sprites/model.d.ts +75 -0
  39. package/dist/features/sprites/sprite.d.ts +22 -0
  40. package/dist/features/viz/index.d.ts +28 -3
  41. package/dist/features/viz/index.js +40 -4
  42. package/dist/features/viz/index.js.map +2 -2
  43. package/dist/features/viz/lib/axis-labels.d.ts +2 -0
  44. package/dist/features/viz/lib/axis-labels.js +41 -0
  45. package/dist/features/viz/lib/axis-labels.js.map +7 -0
  46. package/dist/features/viz/lib/axis-title.d.ts +23 -0
  47. package/dist/features/viz/lib/axis-title.js +23 -0
  48. package/dist/features/viz/lib/axis-title.js.map +7 -0
  49. package/dist/features/viz/lib/axis.d.ts +1 -1
  50. package/dist/features/viz/lib/axis.js +50 -50
  51. package/dist/features/viz/lib/axis.js.map +2 -2
  52. package/dist/features/viz/lib/bar-scale.d.ts +7 -0
  53. package/dist/features/viz/lib/bar-scale.js +34 -0
  54. package/dist/features/viz/lib/bar-scale.js.map +7 -0
  55. package/dist/features/viz/lib/bar-series.js +5 -4
  56. package/dist/features/viz/lib/bar-series.js.map +2 -2
  57. package/dist/features/viz/lib/chart-lines.d.ts +41 -0
  58. package/dist/features/viz/lib/chart-lines.js +32 -0
  59. package/dist/features/viz/lib/chart-lines.js.map +7 -0
  60. package/dist/features/viz/lib/hover-data.js +2 -2
  61. package/dist/features/viz/lib/hover-data.js.map +2 -2
  62. package/dist/features/viz/lib/hover-types.d.ts +5 -5
  63. package/dist/features/viz/lib/line-series.js +3 -3
  64. package/dist/features/viz/lib/line-series.js.map +2 -2
  65. package/dist/features/viz/lib/linear-scale-component.d.ts +7 -0
  66. package/dist/features/viz/lib/linear-scale-component.js +18 -0
  67. package/dist/features/viz/lib/linear-scale-component.js.map +7 -0
  68. package/dist/features/viz/lib/linear-scale.js +1 -1
  69. package/dist/features/viz/lib/linear-scale.js.map +2 -2
  70. package/dist/features/viz/lib/log-scale-component.d.ts +7 -0
  71. package/dist/features/viz/lib/log-scale-component.js +19 -0
  72. package/dist/features/viz/lib/log-scale-component.js.map +7 -0
  73. package/dist/features/viz/lib/log-scale.d.ts +2 -0
  74. package/dist/features/viz/lib/log-scale.js +53 -0
  75. package/dist/features/viz/lib/log-scale.js.map +7 -0
  76. package/dist/features/viz/lib/nearest.d.ts +9 -9
  77. package/dist/features/viz/lib/nearest.js.map +1 -1
  78. package/dist/features/viz/lib/numeric-ticks.d.ts +38 -0
  79. package/dist/features/viz/lib/numeric-ticks.js +54 -0
  80. package/dist/features/viz/lib/numeric-ticks.js.map +7 -0
  81. package/dist/features/viz/lib/plot-series.js +2 -2
  82. package/dist/features/viz/lib/plot-series.js.map +2 -2
  83. package/dist/features/viz/lib/point-scale-component.d.ts +7 -0
  84. package/dist/features/viz/lib/point-scale-component.js +19 -0
  85. package/dist/features/viz/lib/point-scale-component.js.map +7 -0
  86. package/dist/features/viz/lib/point-scale.d.ts +2 -0
  87. package/dist/features/viz/lib/point-scale.js +45 -0
  88. package/dist/features/viz/lib/point-scale.js.map +7 -0
  89. package/dist/features/viz/lib/point-series.js +2 -2
  90. package/dist/features/viz/lib/point-series.js.map +2 -2
  91. package/dist/features/viz/lib/reference-band.d.ts +16 -0
  92. package/dist/features/viz/lib/reference-band.js +27 -0
  93. package/dist/features/viz/lib/reference-band.js.map +7 -0
  94. package/dist/features/viz/lib/scale-adjust.js +9 -4
  95. package/dist/features/viz/lib/scale-adjust.js.map +2 -2
  96. package/dist/features/viz/lib/scale-context.d.ts +5 -4
  97. package/dist/features/viz/lib/scale-context.js +15 -11
  98. package/dist/features/viz/lib/scale-context.js.map +2 -2
  99. package/dist/features/viz/lib/scale-provider.d.ts +2 -0
  100. package/dist/features/viz/lib/scale-provider.js +13 -0
  101. package/dist/features/viz/lib/scale-provider.js.map +7 -0
  102. package/dist/features/viz/lib/scale-ticks.d.ts +5 -0
  103. package/dist/features/viz/lib/scale-ticks.js +49 -0
  104. package/dist/features/viz/lib/scale-ticks.js.map +7 -0
  105. package/dist/features/viz/lib/scale-view.d.ts +4 -0
  106. package/dist/features/viz/lib/scale-view.js +21 -0
  107. package/dist/features/viz/lib/scale-view.js.map +7 -0
  108. package/dist/features/viz/lib/symlog-scale-component.d.ts +7 -0
  109. package/dist/features/viz/lib/symlog-scale-component.js +19 -0
  110. package/dist/features/viz/lib/symlog-scale-component.js.map +7 -0
  111. package/dist/features/viz/lib/symlog-scale.d.ts +2 -0
  112. package/dist/features/viz/lib/symlog-scale.js +38 -0
  113. package/dist/features/viz/lib/symlog-scale.js.map +7 -0
  114. package/dist/features/viz/lib/types.d.ts +95 -18
  115. package/dist/features/viz/lib/use-bar-scale.d.ts +8 -0
  116. package/dist/features/viz/lib/use-bar-scale.js +9 -0
  117. package/dist/features/viz/lib/use-bar-scale.js.map +7 -0
  118. package/dist/features/viz/lib/use-continuous-scale.d.ts +8 -0
  119. package/dist/features/viz/lib/use-continuous-scale.js +9 -0
  120. package/dist/features/viz/lib/use-continuous-scale.js.map +7 -0
  121. package/dist/features/viz/lib/use-linear-scale.d.ts +8 -0
  122. package/dist/features/viz/lib/use-linear-scale.js +9 -0
  123. package/dist/features/viz/lib/use-linear-scale.js.map +7 -0
  124. package/dist/features/viz/lib/use-log-scale.d.ts +8 -0
  125. package/dist/features/viz/lib/use-log-scale.js +9 -0
  126. package/dist/features/viz/lib/use-log-scale.js.map +7 -0
  127. package/dist/features/viz/lib/use-point-scale.d.ts +8 -0
  128. package/dist/features/viz/lib/use-point-scale.js +9 -0
  129. package/dist/features/viz/lib/use-point-scale.js.map +7 -0
  130. package/dist/features/viz/lib/use-symlog-scale.d.ts +8 -0
  131. package/dist/features/viz/lib/use-symlog-scale.js +9 -0
  132. package/dist/features/viz/lib/use-symlog-scale.js.map +7 -0
  133. package/dist/features/viz/lib/use-utc-scale.d.ts +8 -0
  134. package/dist/features/viz/lib/use-utc-scale.js +9 -0
  135. package/dist/features/viz/lib/use-utc-scale.js.map +7 -0
  136. package/dist/features/viz/lib/utc-labels.d.ts +12 -0
  137. package/dist/features/viz/lib/utc-labels.js +27 -0
  138. package/dist/features/viz/lib/utc-labels.js.map +7 -0
  139. package/dist/features/viz/lib/utc-scale-component.d.ts +7 -0
  140. package/dist/features/viz/lib/utc-scale-component.js +18 -0
  141. package/dist/features/viz/lib/utc-scale-component.js.map +7 -0
  142. package/dist/features/viz/lib/utc-scale.d.ts +21 -0
  143. package/dist/features/viz/lib/utc-scale.js +123 -0
  144. package/dist/features/viz/lib/utc-scale.js.map +7 -0
  145. package/dist/index.d.ts +1 -1
  146. package/dist/index.js.map +1 -1
  147. package/dist/lib/animation/definition.d.ts +5 -3
  148. package/dist/lib/animation/definition.js +29 -4
  149. package/dist/lib/animation/definition.js.map +2 -2
  150. package/dist/lib/animation/playback.d.ts +8 -0
  151. package/dist/lib/animation/playback.js +33 -11
  152. package/dist/lib/animation/playback.js.map +2 -2
  153. package/dist/lib/animation/spring.d.ts +3 -1
  154. package/dist/lib/animation/spring.js.map +2 -2
  155. package/dist/lib/animation/types.d.ts +29 -73
  156. package/dist/lib/hooks/use-animated-value.d.ts +11 -21
  157. package/dist/lib/hooks/use-animated-value.js +23 -70
  158. package/dist/lib/hooks/use-animated-value.js.map +3 -3
  159. package/dist/lib/hooks/use-playback.js +1 -0
  160. package/dist/lib/hooks/use-playback.js.map +2 -2
  161. package/package.json +18 -4
  162. package/dist/features/viz/lib/scale.d.ts +0 -11
  163. package/dist/features/viz/lib/scale.js +0 -80
  164. package/dist/features/viz/lib/scale.js.map +0 -7
  165. package/dist/features/viz/lib/use-scale.d.ts +0 -20
  166. package/dist/features/viz/lib/use-scale.js +0 -10
  167. package/dist/features/viz/lib/use-scale.js.map +0 -7
@@ -0,0 +1,123 @@
1
+ import { resolveLinearScale } from "./linear-scale.js";
2
+ const LIMIT = 864e13;
3
+ const DAY = 864e5;
4
+ function timestamp(value, integer = false) {
5
+ if (typeof value !== "number" || !Number.isFinite(value) || Math.abs(value) > LIMIT || integer && !Number.isSafeInteger(value))
6
+ throw new RangeError("UTC timestamps must be finite milliseconds within Date range; domain endpoints must be safe integers.");
7
+ return value;
8
+ }
9
+ function validateDomain(domain) {
10
+ if (!Array.isArray(domain) || domain.length !== 2)
11
+ throw new RangeError("UTC domain requires two endpoints.");
12
+ timestamp(domain[0], true);
13
+ timestamp(domain[1], true);
14
+ }
15
+ function monthAt(ordinal) {
16
+ const date = /* @__PURE__ */ new Date(0);
17
+ date.setUTCFullYear(Math.floor(ordinal / 12), (ordinal % 12 + 12) % 12, 1);
18
+ return date.getTime();
19
+ }
20
+ const fixedSteps = [
21
+ 1,
22
+ 2,
23
+ 5,
24
+ 10,
25
+ 20,
26
+ 50,
27
+ 100,
28
+ 200,
29
+ 500,
30
+ ...[1, 2, 5, 10, 15, 30].map((n) => n * 1e3),
31
+ ...[1, 2, 5, 10, 15, 30].map((n) => n * 6e4),
32
+ ...[1, 2, 3, 6, 12].map((n) => n * 36e5),
33
+ DAY,
34
+ 2 * DAY
35
+ ];
36
+ function selectCadence(lo, hi, count) {
37
+ for (const step of [...fixedSteps, 7 * DAY]) {
38
+ const offset = step === 7 * DAY ? -3 * DAY : 0;
39
+ const first = Math.floor((lo - offset) / step) + 1;
40
+ const last = Math.ceil((hi - offset) / step) - 1;
41
+ if (Math.max(0, last - first + 1) <= count - 2)
42
+ return { first, last, at: (index) => index * step + offset };
43
+ }
44
+ const start = new Date(lo), stop = new Date(hi);
45
+ const lowMonth = start.getUTCFullYear() * 12 + start.getUTCMonth();
46
+ const highMonth = stop.getUTCFullYear() * 12 + stop.getUTCMonth();
47
+ const highBoundary = stop.getUTCDate() === 1 && stop.getUTCHours() === 0 && stop.getUTCMinutes() === 0 && stop.getUTCSeconds() === 0 && stop.getUTCMilliseconds() === 0;
48
+ const steps = [
49
+ 1,
50
+ 2,
51
+ 3,
52
+ 6,
53
+ ...Array.from({ length: 7 }, (_, exponent) => [1, 2, 5].map((n) => 12 * n * 10 ** exponent)).flat()
54
+ ];
55
+ for (const step of steps) {
56
+ const first = Math.floor(lowMonth / step) + 1;
57
+ const last = Math.floor(highMonth / step) - (highBoundary && highMonth % step === 0 ? 1 : 0);
58
+ if (Math.max(0, last - first + 1) <= count - 2)
59
+ return { first, last, at: (index) => monthAt(index * step) };
60
+ }
61
+ if (count === 2) return { first: lo + 1, last: hi - 1, at: (index) => index };
62
+ throw new RangeError("UTC could not select a bounded cadence.");
63
+ }
64
+ function tickCount(count) {
65
+ if (!Number.isInteger(count) || count < 2 || count > 100)
66
+ throw new RangeError("UTC ticks count must be an integer from 2 to 100.");
67
+ }
68
+ function utcTicks(domain, count) {
69
+ tickCount(count);
70
+ if (count === 2) return Object.freeze([...domain]);
71
+ const lo = Math.min(...domain), hi = Math.max(...domain);
72
+ const cadence = selectCadence(lo, hi, count);
73
+ const ticks = [lo];
74
+ for (let i = cadence.first; i <= cadence.last; i++) {
75
+ const value = cadence.at(i);
76
+ if (value > lo && value < hi) ticks.push(timestamp(value, true));
77
+ }
78
+ ticks.push(hi);
79
+ return Object.freeze(domain[0] > domain[1] ? ticks.reverse() : ticks);
80
+ }
81
+ function resolveUtcScale(domain, range, reverse, width, height) {
82
+ validateDomain(domain);
83
+ const linear = resolveLinearScale(domain, range, reverse, width, height);
84
+ return Object.freeze({
85
+ ...linear,
86
+ type: "utc",
87
+ map: (value) => linear.map(timestamp(value)),
88
+ ticks: (count = 5) => utcTicks(linear.domain, count),
89
+ formatTick: (value) => new Date(timestamp(value)).toISOString()
90
+ });
91
+ }
92
+ function niceUTCDomain(domain, options = {}) {
93
+ validateDomain(domain);
94
+ const count = options.count ?? 5;
95
+ tickCount(count);
96
+ if (domain[0] === domain[1]) {
97
+ const lo2 = Math.max(-LIMIT, Math.min(LIMIT - 2, domain[0] - 1));
98
+ return Object.freeze([lo2, lo2 + 2]);
99
+ }
100
+ const lo = Math.min(...domain), hi = Math.max(...domain);
101
+ const cadence = selectCadence(lo, hi, count);
102
+ const start = timestamp(cadence.at(cadence.first - 1), true);
103
+ const stop = timestamp(cadence.at(cadence.last + 1), true);
104
+ return Object.freeze(domain[0] > domain[1] ? [stop, start] : [start, stop]);
105
+ }
106
+ function extent(data, value) {
107
+ if (!Array.isArray(data) || typeof value !== "function") throw new TypeError("extent requires an array and accessor.");
108
+ let min = Infinity, max = -Infinity;
109
+ for (let i = 0; i < data.length; i++) {
110
+ const v = value(data[i], i, data);
111
+ if (v === null || v === void 0) continue;
112
+ if (typeof v !== "number" || !Number.isFinite(v)) throw new TypeError("extent values must be finite numbers or missing.");
113
+ min = Math.min(min, v);
114
+ max = Math.max(max, v);
115
+ }
116
+ return min === Infinity ? void 0 : Object.freeze([min, max]);
117
+ }
118
+ export {
119
+ extent,
120
+ niceUTCDomain,
121
+ resolveUtcScale
122
+ };
123
+ //# sourceMappingURL=utc-scale.js.map
@@ -0,0 +1,7 @@
1
+ {
2
+ "version": 3,
3
+ "sources": ["../../../../src/features/viz/lib/utc-scale.ts"],
4
+ "sourcesContent": ["import type { UTCScale } from \"./utc-scale-component.js\";\nimport type { LinearDomain, ResolvedUtcScale, ScaleRange } from \"./types.js\";\nimport { resolveLinearScale } from \"./linear-scale.js\";\nconst LIMIT = 8_640_000_000_000_000;\nconst DAY = 86_400_000;\n\nfunction timestamp(value: number, integer = false): number {\n if (typeof value !== \"number\" || !Number.isFinite(value) || Math.abs(value) > LIMIT || (integer && !Number.isSafeInteger(value)))\n throw new RangeError(\"UTC timestamps must be finite milliseconds within Date range; domain endpoints must be safe integers.\");\n return value;\n}\nfunction validateDomain(domain: LinearDomain): void {\n if (!Array.isArray(domain) || domain.length !== 2)\n throw new RangeError(\"UTC domain requires two endpoints.\");\n timestamp(domain[0], true);\n timestamp(domain[1], true);\n}\ninterface Cadence {\n first: number;\n last: number;\n at(index: number): number;\n}\nfunction monthAt(ordinal: number): number {\n const date = new Date(0);\n date.setUTCFullYear(Math.floor(ordinal / 12), ((ordinal % 12) + 12) % 12, 1);\n return date.getTime();\n}\nconst fixedSteps = [1, 2, 5, 10, 20, 50, 100, 200, 500,\n ...[1, 2, 5, 10, 15, 30].map(n => n * 1000),\n ...[1, 2, 5, 10, 15, 30].map(n => n * 60_000),\n ...[1, 2, 3, 6, 12].map(n => n * 3_600_000), DAY, 2 * DAY];\nfunction selectCadence(lo: number, hi: number, count: number): Cadence {\n for (const step of [...fixedSteps, 7 * DAY]) {\n const offset = step === 7 * DAY ? -3 * DAY : 0;\n const first = Math.floor((lo - offset) / step) + 1;\n const last = Math.ceil((hi - offset) / step) - 1;\n if (Math.max(0, last - first + 1) <= count - 2)\n return { first, last, at: index => index * step + offset };\n }\n // Two Date objects for endpoint ordinals; candidate counting is arithmetic.\n const start = new Date(lo), stop = new Date(hi);\n const lowMonth = start.getUTCFullYear() * 12 + start.getUTCMonth();\n const highMonth = stop.getUTCFullYear() * 12 + stop.getUTCMonth();\n const highBoundary = stop.getUTCDate() === 1 && stop.getUTCHours() === 0 &&\n stop.getUTCMinutes() === 0 && stop.getUTCSeconds() === 0 && stop.getUTCMilliseconds() === 0;\n const steps = [1, 2, 3, 6,\n ...Array.from({ length: 7 }, (_, exponent) => [1, 2, 5].map(n => 12 * n * 10 ** exponent)).flat()];\n for (const step of steps) {\n const first = Math.floor(lowMonth / step) + 1;\n const last = Math.floor(highMonth / step) - (highBoundary && highMonth % step === 0 ? 1 : 0);\n if (Math.max(0, last - first + 1) <= count - 2)\n return { first, last, at: index => monthAt(index * step) };\n }\n // Every epoch-aligned cadence crosses year zero for a straddling domain.\n // Two-tick output is endpoints-only; keep already integral millisecond bounds\n // rather than overflow Date trying ever coarser calendar boundaries.\n if (count === 2) return { first: lo + 1, last: hi - 1, at: index => index };\n throw new RangeError(\"UTC could not select a bounded cadence.\");\n}\nfunction tickCount(count: number): void {\n if (!Number.isInteger(count) || count < 2 || count > 100)\n throw new RangeError(\"UTC ticks count must be an integer from 2 to 100.\");\n}\nfunction utcTicks(domain: LinearDomain, count: number): readonly number[] {\n tickCount(count);\n if (count === 2) return Object.freeze([...domain]);\n const lo = Math.min(...domain), hi = Math.max(...domain);\n const cadence = selectCadence(lo, hi, count);\n const ticks = [lo];\n for (let i = cadence.first; i <= cadence.last; i++) {\n const value = cadence.at(i);\n if (value > lo && value < hi) ticks.push(timestamp(value, true));\n }\n ticks.push(hi);\n return Object.freeze(domain[0] > domain[1] ? ticks.reverse() : ticks);\n}\nexport function resolveUtcScale(domain: LinearDomain, range: ScaleRange, reverse: boolean, width: number, height: number): ResolvedUtcScale {\n validateDomain(domain);\n const linear = resolveLinearScale(domain, range, reverse, width, height);\n return Object.freeze({\n ...linear,\n type: \"utc\",\n map: (value: number) => linear.map(timestamp(value)),\n ticks: (count = 5) => utcTicks(linear.domain, count),\n formatTick: (value: number) => new Date(timestamp(value)).toISOString(),\n });\n}\n\n/**\n * Expands a numeric timestamp domain to enclosing UTC calendar boundaries.\n * @param domain - Safe integer epoch-millisecond endpoints, possibly equal or descending.\n * @param options - Optional bounded target tick count (default 5).\n * @returns A frozen outward-rounded domain preserving its direction. See {@link LinearDomain}.\n * @see {@link UTCScale}\n */\nexport function niceUTCDomain(domain: LinearDomain, options: { readonly count?: number } = {}): LinearDomain {\n validateDomain(domain);\n const count = options.count ?? 5;\n tickCount(count);\n if (domain[0] === domain[1]) {\n const lo = Math.max(-LIMIT, Math.min(LIMIT - 2, domain[0] - 1));\n return Object.freeze([lo, lo + 2]);\n }\n const lo = Math.min(...domain), hi = Math.max(...domain);\n const cadence = selectCadence(lo, hi, count);\n const start = timestamp(cadence.at(cadence.first - 1), true);\n const stop = timestamp(cadence.at(cadence.last + 1), true);\n return Object.freeze(domain[0] > domain[1] ? [stop, start] : [start, stop]);\n}\n\n/**\n * Computes a finite numeric extent in source order, skipping only null and undefined.\n * @param data - Source rows, which are never sorted or mutated.\n * @param value - Accessor called once per row with its index and original array.\n * @returns A frozen minimum/maximum pair, or undefined when every row is missing.\n * @see {@link niceUTCDomain}\n */\nexport function extent<D>(data: readonly D[], value: (datum: D, index: number, data: readonly D[]) => number | null | undefined): LinearDomain | undefined {\n if (!Array.isArray(data) || typeof value !== \"function\") throw new TypeError(\"extent requires an array and accessor.\");\n let min = Infinity, max = -Infinity;\n for (let i = 0; i < data.length; i++) {\n const v = value(data[i], i, data);\n if (v === null || v === undefined) continue;\n if (typeof v !== \"number\" || !Number.isFinite(v)) throw new TypeError(\"extent values must be finite numbers or missing.\");\n min = Math.min(min, v); max = Math.max(max, v);\n }\n return min === Infinity ? undefined : Object.freeze([min, max]);\n}\n"],
5
+ "mappings": "AAEA,SAAS,0BAA0B;AACnC,MAAM,QAAQ;AACd,MAAM,MAAM;AAEZ,SAAS,UAAU,OAAe,UAAU,OAAe;AACzD,MAAI,OAAO,UAAU,YAAY,CAAC,OAAO,SAAS,KAAK,KAAK,KAAK,IAAI,KAAK,IAAI,SAAU,WAAW,CAAC,OAAO,cAAc,KAAK;AAC5H,UAAM,IAAI,WAAW,uGAAuG;AAC9H,SAAO;AACT;AACA,SAAS,eAAe,QAA4B;AAClD,MAAI,CAAC,MAAM,QAAQ,MAAM,KAAK,OAAO,WAAW;AAC9C,UAAM,IAAI,WAAW,oCAAoC;AAC3D,YAAU,OAAO,CAAC,GAAG,IAAI;AACzB,YAAU,OAAO,CAAC,GAAG,IAAI;AAC3B;AAMA,SAAS,QAAQ,SAAyB;AACxC,QAAM,OAAO,oBAAI,KAAK,CAAC;AACvB,OAAK,eAAe,KAAK,MAAM,UAAU,EAAE,IAAK,UAAU,KAAM,MAAM,IAAI,CAAC;AAC3E,SAAO,KAAK,QAAQ;AACtB;AACA,MAAM,aAAa;AAAA,EAAC;AAAA,EAAG;AAAA,EAAG;AAAA,EAAG;AAAA,EAAI;AAAA,EAAI;AAAA,EAAI;AAAA,EAAK;AAAA,EAAK;AAAA,EACjD,GAAG,CAAC,GAAG,GAAG,GAAG,IAAI,IAAI,EAAE,EAAE,IAAI,OAAK,IAAI,GAAI;AAAA,EAC1C,GAAG,CAAC,GAAG,GAAG,GAAG,IAAI,IAAI,EAAE,EAAE,IAAI,OAAK,IAAI,GAAM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AM,KAAK,IAAI,KAAK,CAAC;AAAG,UAAM,KAAK,IAAI,KAAK,CAAC;AAAA,EAC/C;AACA,SAAO,QAAQ,WAAW,SAAY,OAAO,OAAO,CAAC,KAAK,GAAG,CAAC;AAChE;",
6
+ "names": ["lo"]
7
+ }
package/dist/index.d.ts CHANGED
@@ -40,7 +40,7 @@ export type { Signal, SignalEquals, SignalOptions, SignalValue, WritableSignal,
40
40
  export { easing } from './lib/animation/easing.js';
41
41
  export { defineAnimation, keyframes, spring, stepper, tween, } from './lib/animation/definition.js';
42
42
  export { marker, parallel, repeat, sequence, drive, wait, } from './lib/animation/program.js';
43
- export type { PibblAnimationDefinition, PibblAnimationOptions, PibblAnimationProgram, PibblAnimationRepeatDirection, PibblAnimationRepeatOptions, PibblAnimationSampleInput, PibblSpringAnimatedValueOptions, PibblPlayback, PibblPlaybackEvent, PibblPlaybackOptions, PibblPlaybackStatus, PibblEasing, PibblInterpolator, PibblKeyframesOptions, PibblSpringOptions, PibblStepperOptions, PibblTweenOptions, PibblTweenAnimatedValueOptions, } from './lib/animation/types.js';
43
+ export type { PibblAnimationDefinition, PibblAnimationOptions, PibblAnimationProgram, PibblAnimationRepeatDirection, PibblAnimationRepeatOptions, PibblAnimationSampleInput, PibblAnimatedValueOptions, PibblAnimationTarget, PibblPlayback, PibblPlaybackEvent, PibblPlaybackOptions, PibblPlaybackStatus, PibblEasing, PibblInterpolator, PibblKeyframesOptions, PibblSpringOptions, PibblStepperOptions, PibblTweenOptions, } from './lib/animation/types.js';
44
44
  export type { PibblConfig, PibblFit, PibblFixedViewportConfig, PibblPixelRatio, PibblResponsiveViewportConfig, } from './lib/surface/types.js';
45
45
  export { Absolute, type AbsoluteProps, type AbsoluteStyle, } from './lib/layout/absolute.js';
46
46
  export { Overlay, type OverlayProps, type OverlayStyle, } from './lib/layout/overlay.js';
package/dist/index.js.map CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "version": 3,
3
3
  "sources": ["../src/index.ts"],
4
- "sourcesContent": ["export {\n meshTransform,\n arcBendTransform,\n pathBendTransform,\n type MeshTransformOptions,\n type ArcBendTransformOptions,\n type PathBendTransformOptions,\n transformPath,\n composeTransforms,\n affineTransform,\n quadTransform,\n envelopeTransform,\n type PathTransform,\n type PathPoint,\n type PathRect,\n type TransformPathOptions,\n type QuadTransformOptions,\n type PathQuadCorners,\n type PathQuadMode,\n type BendTransformOptions,\n type EnvelopeTransformOptions,\n type EnvelopeGuide,\n type PathGuide,\n type PathGuideOptions,\n type PathGuideStation,\n} from './lib/geometry/path-transforms.js';\nexport { type PathBendArc, type PathBendAlign, type PathBendBaseline, type PathBendFit, type PathBendOverflow } from './lib/geometry/path-bending.js';\nexport { flattenPathWang } from './lib/geometry/path-wang.js';\nexport { simplifyPathRadial } from './lib/geometry/path-radial.js';\nexport { PathGeometry, type PathSegment } from './lib/geometry/path-geometry.js';\nexport { toPath2D, toSvgPathData } from './lib/geometry/path-conversion.js';\nexport {\n flattenPath,\n simplifyPath,\n subdividePath,\n type FlattenPathOptions,\n type SimplifyPathOptions,\n type SubdividePathOptions,\n} from './lib/geometry/path-utilities.js';\n// components\nexport { Arc, type ArcProps, type ArcStyle } from './lib/components/arc.js';\nexport {\n Circle,\n type CircleProps,\n type CircleStyle,\n} from './lib/components/circle.js';\nexport { Clip, type ClipProps, type ClipStyle } from './lib/components/clip.js';\nexport {\n Ellipse,\n type EllipseProps,\n type EllipseStyle,\n} from './lib/components/ellipse.js';\nexport {\n Group,\n type GroupProps,\n type GStyle,\n} from './lib/components/g.js';\nexport {\n HorizontalLine,\n type HorizontalLineProps,\n type HorizontalLineStyle,\n} from './lib/components/horizontal-line.js';\n\nexport {\n Image,\n type ImageProps,\n} from './lib/components/img.js';\nexport {\n Layer,\n type LayerProps,\n type LayerStyle,\n} from './lib/components/layer.js';\nexport {\n Line,\n type LineProps,\n type LineStyle,\n} from './lib/components/line.js';\nexport { Path, type PathProps } from './lib/components/path.js';\nexport {\n Polygon,\n type PolygonProps,\n type PolygonStyle,\n} from './lib/components/polygon.js';\nexport {\n RegularPolygon,\n type RegularPolygonProps,\n type RegularPolygonStyle,\n} from './lib/components/regular-polygon.js';\nexport {\n Rectangle,\n type RectangleProps,\n} from './lib/components/rect.js';\nexport {\n Star,\n type StarProps,\n type StarStyle,\n} from './lib/components/star.js';\nexport {\n SvgPath,\n type SvgPathProps,\n} from './lib/components/svg-path.js';\nexport { Text, type TextProps } from './lib/components/text.js';\nexport {\n VerticalLine,\n type VerticalLineProps,\n type VerticalLineStyle,\n} from './lib/components/vertical-line.js';\nexport {\n Wedge,\n type WedgeProps,\n type WedgeStyle,\n} from './lib/components/wedge.js';\nexport {\n createArcPath,\n createWedgePath,\n type ArcPathOptions,\n type WedgePathOptions,\n} from './lib/geometry/circular-sweep.js';\nexport {\n createCirclePath,\n type CirclePathOptions,\n} from './lib/geometry/circle.js';\nexport {\n createEllipsePath,\n type EllipsePathOptions,\n} from './lib/geometry/ellipse.js';\nexport {\n createLinePath,\n type LinePathOptions,\n} from './lib/geometry/line.js';\nexport {\n createPolygonPath,\n type PolygonPathOptions,\n} from './lib/geometry/polygon.js';\nexport {\n createRectanglePath,\n type RectanglePathOptions,\n} from './lib/geometry/rectangle.js';\nexport {\n createRegularPolygonPath,\n type RegularPolygonNumericSize,\n type RegularPolygonPathOptions,\n type RegularPolygonPathPosition,\n} from './lib/geometry/regular-polygon.js';\nexport {\n createStarPath,\n type StarPathOptions,\n} from './lib/geometry/star.js';\nexport {\n createSvgPath,\n type SvgPathOptions,\n} from './lib/geometry/svg-path.js';\nexport type { RoundedCornerPathOptions } from './lib/geometry/rounded-corners.js';\nexport { pibbl } from './lib/pibbl.js';\nexport {\n batch,\n computed,\n isSignal,\n signal,\n untracked,\n} from './lib/signals/graph.js';\nexport { resolveSignalValue } from './lib/signals/resolve-signal-value.js';\nexport type {\n Signal,\n SignalEquals,\n SignalOptions,\n SignalValue,\n WritableSignal,\n} from './lib/signals/types.js';\nexport { easing } from './lib/animation/easing.js';\nexport {\n defineAnimation,\n keyframes,\n spring,\n stepper,\n tween,\n} from './lib/animation/definition.js';\nexport {\n marker,\n parallel,\n repeat,\n sequence,\n drive,\n wait,\n} from './lib/animation/program.js';\nexport type {\n PibblAnimationDefinition,\n PibblAnimationOptions,\n PibblAnimationProgram,\n PibblAnimationRepeatDirection,\n PibblAnimationRepeatOptions,\n PibblAnimationSampleInput,\n PibblSpringAnimatedValueOptions,\n PibblPlayback,\n PibblPlaybackEvent,\n PibblPlaybackOptions,\n PibblPlaybackStatus,\n PibblEasing,\n PibblInterpolator,\n PibblKeyframesOptions,\n PibblSpringOptions,\n PibblStepperOptions,\n PibblTweenOptions,\n PibblTweenAnimatedValueOptions,\n} from './lib/animation/types.js';\nexport type {\n PibblConfig,\n PibblFit,\n PibblFixedViewportConfig,\n PibblPixelRatio,\n PibblResponsiveViewportConfig,\n} from './lib/surface/types.js';\nexport {\n Absolute,\n type AbsoluteProps,\n type AbsoluteStyle,\n} from './lib/layout/absolute.js';\nexport {\n Overlay,\n type OverlayProps,\n type OverlayStyle,\n} from './lib/layout/overlay.js';\nexport {\n Flow,\n type FlowProps,\n type FlowStyle,\n} from './lib/layout/flow.js';\nexport {\n Flex,\n type FlexProps,\n type FlexStyle,\n} from './lib/layout/flex.js';\nexport {\n Grid,\n type GridProps,\n type GridStyle,\n type GridTrack,\n} from './lib/layout/grid.js';\nexport { measureElement } from './lib/layout/measure.js';\n\nexport {\n FocusManagement,\n KeyboardNavigation,\n type FocusManagementProps,\n type KeyboardNavigationProps,\n} from './lib/focus/policy-components.js';\nexport type { PibblKeyboardNavigationOptions } from './lib/focus/types.js';\n\nexport { definePrimitive } from './lib/define-primitive.js';\nexport { defineRenderLayer } from './lib/render-layer/define-render-layer.js';\nexport type {\n PibblRenderLayerComponentProps,\n PibblRenderLayerDefinition,\n PibblRenderLayerFrame,\n PibblRenderLayerContext,\n PibblRenderLayerHit,\n PibblRenderLayerInput,\n PibblRenderLayerInteraction,\n PibblRenderLayerInteractionSnapshot,\n PibblRenderLayerProps,\n PibblRenderLayerSize,\n PibblRenderLayerStyle,\n PibblRenderLayerTarget,\n} from './lib/render-layer/types.js';\nexport { createElement } from './lib/element/create-element.js';\nexport { Fragment } from './lib/element/fragment.js';\nexport type {\n BoxStyle,\n CursorStyle,\n EdgeValues,\n FlexItemStyle,\n GridItemStyle,\n ImgStyle,\n LayoutItemStyle,\n Length,\n PaintStyle,\n PathStyle,\n RectStyle,\n ResolvedBoxStyle,\n SvgPathStyle,\n TextFit,\n TextStyle,\n Percentage,\n RoundedCornerStyle,\n} from './lib/style/types.js';\nexport {\n LayoutDiagnostic,\n layoutDiagnostic,\n type LayoutDiagnosticContext,\n type LayoutDiagnosticInput,\n} from './lib/style/diagnostics.js';\nexport { normalizeEdges } from './lib/style/normalize.js';\nexport { resolveLength } from './lib/style/resolve-length.js';\nexport { resolveBox } from './lib/layout/box.js';\nexport type {\n PibblFilter,\n} from './lib/style/filter-types.js';\nexport type {\n Constraints,\n Edges,\n LayoutBox,\n Size,\n} from './lib/layout/types.js';\n// hooks\nexport { useCursor } from './lib/hooks/use-cursor.js';\nexport { useCanvasContext } from './lib/hooks/use-canvas-context.js';\nexport { useComputed } from './lib/hooks/use-computed.js';\nexport { useConst } from './lib/hooks/use-const.js';\nexport { useEventListener } from './lib/hooks/use-event-listener.js';\nexport { useEventTarget } from './lib/hooks/use-event-target.js';\nexport { useLinePath } from './lib/hooks/use-line-path.js';\nexport { useLayoutBox } from './lib/hooks/use-layout-box.js';\nexport { useRectPath } from './lib/hooks/use-rect-path.js';\nexport { useRef, type PibblRef } from './lib/hooks/use-ref.js';\nexport { usePlayback } from './lib/hooks/use-playback.js';\nexport {\n useReaction,\n type PibblReactionOptions,\n} from './lib/hooks/use-reaction.js';\nexport { useAnimatedValue } from './lib/hooks/use-animated-value.js';\nexport { useSignal } from './lib/hooks/use-signal.js';\nexport { useSvgPath } from './lib/hooks/use-svg-path.js';\nexport type {\n Canvas,\n CanvasMeasurementService,\n PibblController,\n PibblComponent,\n PibblContainerChild,\n PibblElement,\n PibblElementType,\n PibblEmptyNode,\n PibblKey,\n PibblNode,\n PibblNodeInput,\n PibblPhysics2DPropExtension,\n PibblPrimitiveComponent,\n PibblTextChild,\n PibblTextInput,\n PibblRenderResult,\n PibblSizeQuery,\n PibblStyleRule,\n PibblResponsiveStyle,\n PrimitiveInputOf,\n PrimitiveCapabilities,\n PrimitiveInput,\n PrimitiveProgramProps,\n PrimitiveRender,\n FillStyle,\n MeasureInput,\n MeasureResult,\n PixelGridAlignment,\n NormalizedStyle,\n RenderingContext2D,\n ResolvedStyle,\n SpecifiedStyle,\n StyleResolutionContext,\n StrokeStyle,\n SystemStyle,\n} from './lib/types.js';\nexport type {\n PibblClipboardEvent,\n PibblCompositionEvent,\n PibblDragEvent,\n PibblEvent,\n PibblEventCapturePropName,\n PibblEventHandler,\n PibblEventHandlers,\n PibblEventMap,\n PibblEventParticipationOptions,\n PibblEventPhase,\n PibblEventPropName,\n PibblEventTarget,\n PibblEventTargetOptions,\n PibblEventTargetSnapshot,\n PibblEventType,\n PibblFocusEvent,\n PibblInputEvent,\n PibblKeyboardEvent,\n PibblLogicalMouseEvent,\n PibblPointerEvent,\n PibblPointerEvents,\n PibblTouchEvent,\n PibblWheelEvent,\n} from './lib/events/types.js';\n\nexport { useManipulation } from './lib/manipulation/controller.js';\nexport { ManipulationFrame } from './lib/manipulation/frame.js';\nexport { DragHandle, ResizeHandle, ResizeHandles, RotationHandle } from './lib/manipulation/handles.js';\nexport type { PibblManipulationController, PibblManipulationOptions, PibblManipulationSnapshot, PibblManipulationEvent, PibblManipulationCommitEvent, PibblManipulationCancelEvent, PibblManipulationCancelReason, PibblManipulationGeometry, PibblManipulationOperation, PibblManipulationActive, PibblManipulationFrameProps, PibblManipulationMoveInput, PibblManipulationResizeInput, PibblManipulationRotateInput } from './lib/manipulation/controller-types.js';\nexport type { PibblManipulationBox, PibblManipulationPoint, PibblManipulationWhen, PibblResizePosition } from './lib/manipulation/types.js';\nexport type { PibblDragHandleProps, PibblDragHandleStyle } from './lib/manipulation/handles.js';\n\nexport type { PibblResizeHandleProps, PibblResizeHandlesProps, PibblRotationHandleProps, PibblResizeHandleStyle, PibblRotationHandleStyle, PibblManipulationReadoutStyle, PibblManipulationReadoutStateStyle, PibblRotationConnectorStyle, PibblRotationArcStyle } from './lib/manipulation/handles.js';\n\nexport { degrees } from './lib/manipulation/degrees.js';\nexport { Manipulable } from './lib/manipulation/manipulable.js';\nexport type { PibblManipulableProps } from './lib/manipulation/manipulable.js';\n\nexport { defineTexture, useTexture } from './lib/textures/texture.js';\nexport type { Texture, TexturePaint, TextureRecipe, TextureDefinition, TextureOptions, TexturePlacement, TextureContext, TextureFrame } from './lib/textures/texture.js';\n\nexport { HtmlBox } from './lib/components/html-box.js';\nexport type { HtmlBoxProps, HtmlBoxStyle, HtmlMountCallback, HtmlUpdateFunction, HtmlBoxFocusState } from './lib/html/types.js';\n\nexport { fade } from './lib/transitions/fade.js';\nexport type { PibblTransitionEffect } from './lib/transitions/fade.js';\nexport type { PibblTransitionBinding } from './lib/transitions/binding.js';\nexport { useVisibilityTransition } from './lib/hooks/use-visibility-transition.js';\nexport type { PibblVisibilityTransition, PibblVisibilityTransitionOptions, PibblVisibilityTransitionResult, PibblVisibilityTransitionStatus } from './lib/hooks/use-visibility-transition.js';\n\nexport { embers } from './lib/transitions/embers.js';\nexport type { PibblEmbersOptions } from './lib/transitions/embers.js';\n\nexport { hologram } from './lib/transitions/hologram.js';\nexport type { PibblHologramOptions } from './lib/transitions/hologram.js';\nexport { bifrost } from './lib/transitions/bifrost.js';\nexport type { PibblBifrostOptions } from './lib/transitions/bifrost.js';\n\nexport { slide, zoom, wipe, blurReveal, dissolve } from './lib/transitions/common.js';\nexport type { PibblSlideOptions, PibblZoomOptions, PibblWipeOptions, PibblBlurRevealOptions, PibblDissolveOptions } from './lib/transitions/common.js';\n\nexport { defineTransition } from './lib/transitions/define-transition.js';\nexport type { PibblTransitionDefinition, PibblTransitionRenderFrame } from './lib/transitions/define-transition.js';\n\nexport type { PibblEmbersPhysicsOptions, PibblEmberCollision } from './lib/transitions/embers-physics.js';\n"],
4
+ "sourcesContent": ["export {\n meshTransform,\n arcBendTransform,\n pathBendTransform,\n type MeshTransformOptions,\n type ArcBendTransformOptions,\n type PathBendTransformOptions,\n transformPath,\n composeTransforms,\n affineTransform,\n quadTransform,\n envelopeTransform,\n type PathTransform,\n type PathPoint,\n type PathRect,\n type TransformPathOptions,\n type QuadTransformOptions,\n type PathQuadCorners,\n type PathQuadMode,\n type BendTransformOptions,\n type EnvelopeTransformOptions,\n type EnvelopeGuide,\n type PathGuide,\n type PathGuideOptions,\n type PathGuideStation,\n} from './lib/geometry/path-transforms.js';\nexport { type PathBendArc, type PathBendAlign, type PathBendBaseline, type PathBendFit, type PathBendOverflow } from './lib/geometry/path-bending.js';\nexport { flattenPathWang } from './lib/geometry/path-wang.js';\nexport { simplifyPathRadial } from './lib/geometry/path-radial.js';\nexport { PathGeometry, type PathSegment } from './lib/geometry/path-geometry.js';\nexport { toPath2D, toSvgPathData } from './lib/geometry/path-conversion.js';\nexport {\n flattenPath,\n simplifyPath,\n subdividePath,\n type FlattenPathOptions,\n type SimplifyPathOptions,\n type SubdividePathOptions,\n} from './lib/geometry/path-utilities.js';\n// components\nexport { Arc, type ArcProps, type ArcStyle } from './lib/components/arc.js';\nexport {\n Circle,\n type CircleProps,\n type CircleStyle,\n} from './lib/components/circle.js';\nexport { Clip, type ClipProps, type ClipStyle } from './lib/components/clip.js';\nexport {\n Ellipse,\n type EllipseProps,\n type EllipseStyle,\n} from './lib/components/ellipse.js';\nexport {\n Group,\n type GroupProps,\n type GStyle,\n} from './lib/components/g.js';\nexport {\n HorizontalLine,\n type HorizontalLineProps,\n type HorizontalLineStyle,\n} from './lib/components/horizontal-line.js';\n\nexport {\n Image,\n type ImageProps,\n} from './lib/components/img.js';\nexport {\n Layer,\n type LayerProps,\n type LayerStyle,\n} from './lib/components/layer.js';\nexport {\n Line,\n type LineProps,\n type LineStyle,\n} from './lib/components/line.js';\nexport { Path, type PathProps } from './lib/components/path.js';\nexport {\n Polygon,\n type PolygonProps,\n type PolygonStyle,\n} from './lib/components/polygon.js';\nexport {\n RegularPolygon,\n type RegularPolygonProps,\n type RegularPolygonStyle,\n} from './lib/components/regular-polygon.js';\nexport {\n Rectangle,\n type RectangleProps,\n} from './lib/components/rect.js';\nexport {\n Star,\n type StarProps,\n type StarStyle,\n} from './lib/components/star.js';\nexport {\n SvgPath,\n type SvgPathProps,\n} from './lib/components/svg-path.js';\nexport { Text, type TextProps } from './lib/components/text.js';\nexport {\n VerticalLine,\n type VerticalLineProps,\n type VerticalLineStyle,\n} from './lib/components/vertical-line.js';\nexport {\n Wedge,\n type WedgeProps,\n type WedgeStyle,\n} from './lib/components/wedge.js';\nexport {\n createArcPath,\n createWedgePath,\n type ArcPathOptions,\n type WedgePathOptions,\n} from './lib/geometry/circular-sweep.js';\nexport {\n createCirclePath,\n type CirclePathOptions,\n} from './lib/geometry/circle.js';\nexport {\n createEllipsePath,\n type EllipsePathOptions,\n} from './lib/geometry/ellipse.js';\nexport {\n createLinePath,\n type LinePathOptions,\n} from './lib/geometry/line.js';\nexport {\n createPolygonPath,\n type PolygonPathOptions,\n} from './lib/geometry/polygon.js';\nexport {\n createRectanglePath,\n type RectanglePathOptions,\n} from './lib/geometry/rectangle.js';\nexport {\n createRegularPolygonPath,\n type RegularPolygonNumericSize,\n type RegularPolygonPathOptions,\n type RegularPolygonPathPosition,\n} from './lib/geometry/regular-polygon.js';\nexport {\n createStarPath,\n type StarPathOptions,\n} from './lib/geometry/star.js';\nexport {\n createSvgPath,\n type SvgPathOptions,\n} from './lib/geometry/svg-path.js';\nexport type { RoundedCornerPathOptions } from './lib/geometry/rounded-corners.js';\nexport { pibbl } from './lib/pibbl.js';\nexport {\n batch,\n computed,\n isSignal,\n signal,\n untracked,\n} from './lib/signals/graph.js';\nexport { resolveSignalValue } from './lib/signals/resolve-signal-value.js';\nexport type {\n Signal,\n SignalEquals,\n SignalOptions,\n SignalValue,\n WritableSignal,\n} from './lib/signals/types.js';\nexport { easing } from './lib/animation/easing.js';\nexport {\n defineAnimation,\n keyframes,\n spring,\n stepper,\n tween,\n} from './lib/animation/definition.js';\nexport {\n marker,\n parallel,\n repeat,\n sequence,\n drive,\n wait,\n} from './lib/animation/program.js';\nexport type {\n PibblAnimationDefinition,\n PibblAnimationOptions,\n PibblAnimationProgram,\n PibblAnimationRepeatDirection,\n PibblAnimationRepeatOptions,\n PibblAnimationSampleInput,\n PibblAnimatedValueOptions,\n PibblAnimationTarget,\n PibblPlayback,\n PibblPlaybackEvent,\n PibblPlaybackOptions,\n PibblPlaybackStatus,\n PibblEasing,\n PibblInterpolator,\n PibblKeyframesOptions,\n PibblSpringOptions,\n PibblStepperOptions,\n PibblTweenOptions,\n} from './lib/animation/types.js';\nexport type {\n PibblConfig,\n PibblFit,\n PibblFixedViewportConfig,\n PibblPixelRatio,\n PibblResponsiveViewportConfig,\n} from './lib/surface/types.js';\nexport {\n Absolute,\n type AbsoluteProps,\n type AbsoluteStyle,\n} from './lib/layout/absolute.js';\nexport {\n Overlay,\n type OverlayProps,\n type OverlayStyle,\n} from './lib/layout/overlay.js';\nexport {\n Flow,\n type FlowProps,\n type FlowStyle,\n} from './lib/layout/flow.js';\nexport {\n Flex,\n type FlexProps,\n type FlexStyle,\n} from './lib/layout/flex.js';\nexport {\n Grid,\n type GridProps,\n type GridStyle,\n type GridTrack,\n} from './lib/layout/grid.js';\nexport { measureElement } from './lib/layout/measure.js';\n\nexport {\n FocusManagement,\n KeyboardNavigation,\n type FocusManagementProps,\n type KeyboardNavigationProps,\n} from './lib/focus/policy-components.js';\nexport type { PibblKeyboardNavigationOptions } from './lib/focus/types.js';\n\nexport { definePrimitive } from './lib/define-primitive.js';\nexport { defineRenderLayer } from './lib/render-layer/define-render-layer.js';\nexport type {\n PibblRenderLayerComponentProps,\n PibblRenderLayerDefinition,\n PibblRenderLayerFrame,\n PibblRenderLayerContext,\n PibblRenderLayerHit,\n PibblRenderLayerInput,\n PibblRenderLayerInteraction,\n PibblRenderLayerInteractionSnapshot,\n PibblRenderLayerProps,\n PibblRenderLayerSize,\n PibblRenderLayerStyle,\n PibblRenderLayerTarget,\n} from './lib/render-layer/types.js';\nexport { createElement } from './lib/element/create-element.js';\nexport { Fragment } from './lib/element/fragment.js';\nexport type {\n BoxStyle,\n CursorStyle,\n EdgeValues,\n FlexItemStyle,\n GridItemStyle,\n ImgStyle,\n LayoutItemStyle,\n Length,\n PaintStyle,\n PathStyle,\n RectStyle,\n ResolvedBoxStyle,\n SvgPathStyle,\n TextFit,\n TextStyle,\n Percentage,\n RoundedCornerStyle,\n} from './lib/style/types.js';\nexport {\n LayoutDiagnostic,\n layoutDiagnostic,\n type LayoutDiagnosticContext,\n type LayoutDiagnosticInput,\n} from './lib/style/diagnostics.js';\nexport { normalizeEdges } from './lib/style/normalize.js';\nexport { resolveLength } from './lib/style/resolve-length.js';\nexport { resolveBox } from './lib/layout/box.js';\nexport type {\n PibblFilter,\n} from './lib/style/filter-types.js';\nexport type {\n Constraints,\n Edges,\n LayoutBox,\n Size,\n} from './lib/layout/types.js';\n// hooks\nexport { useCursor } from './lib/hooks/use-cursor.js';\nexport { useCanvasContext } from './lib/hooks/use-canvas-context.js';\nexport { useComputed } from './lib/hooks/use-computed.js';\nexport { useConst } from './lib/hooks/use-const.js';\nexport { useEventListener } from './lib/hooks/use-event-listener.js';\nexport { useEventTarget } from './lib/hooks/use-event-target.js';\nexport { useLinePath } from './lib/hooks/use-line-path.js';\nexport { useLayoutBox } from './lib/hooks/use-layout-box.js';\nexport { useRectPath } from './lib/hooks/use-rect-path.js';\nexport { useRef, type PibblRef } from './lib/hooks/use-ref.js';\nexport { usePlayback } from './lib/hooks/use-playback.js';\nexport {\n useReaction,\n type PibblReactionOptions,\n} from './lib/hooks/use-reaction.js';\nexport { useAnimatedValue } from './lib/hooks/use-animated-value.js';\nexport { useSignal } from './lib/hooks/use-signal.js';\nexport { useSvgPath } from './lib/hooks/use-svg-path.js';\nexport type {\n Canvas,\n CanvasMeasurementService,\n PibblController,\n PibblComponent,\n PibblContainerChild,\n PibblElement,\n PibblElementType,\n PibblEmptyNode,\n PibblKey,\n PibblNode,\n PibblNodeInput,\n PibblPhysics2DPropExtension,\n PibblPrimitiveComponent,\n PibblTextChild,\n PibblTextInput,\n PibblRenderResult,\n PibblSizeQuery,\n PibblStyleRule,\n PibblResponsiveStyle,\n PrimitiveInputOf,\n PrimitiveCapabilities,\n PrimitiveInput,\n PrimitiveProgramProps,\n PrimitiveRender,\n FillStyle,\n MeasureInput,\n MeasureResult,\n PixelGridAlignment,\n NormalizedStyle,\n RenderingContext2D,\n ResolvedStyle,\n SpecifiedStyle,\n StyleResolutionContext,\n StrokeStyle,\n SystemStyle,\n} from './lib/types.js';\nexport type {\n PibblClipboardEvent,\n PibblCompositionEvent,\n PibblDragEvent,\n PibblEvent,\n PibblEventCapturePropName,\n PibblEventHandler,\n PibblEventHandlers,\n PibblEventMap,\n PibblEventParticipationOptions,\n PibblEventPhase,\n PibblEventPropName,\n PibblEventTarget,\n PibblEventTargetOptions,\n PibblEventTargetSnapshot,\n PibblEventType,\n PibblFocusEvent,\n PibblInputEvent,\n PibblKeyboardEvent,\n PibblLogicalMouseEvent,\n PibblPointerEvent,\n PibblPointerEvents,\n PibblTouchEvent,\n PibblWheelEvent,\n} from './lib/events/types.js';\n\nexport { useManipulation } from './lib/manipulation/controller.js';\nexport { ManipulationFrame } from './lib/manipulation/frame.js';\nexport { DragHandle, ResizeHandle, ResizeHandles, RotationHandle } from './lib/manipulation/handles.js';\nexport type { PibblManipulationController, PibblManipulationOptions, PibblManipulationSnapshot, PibblManipulationEvent, PibblManipulationCommitEvent, PibblManipulationCancelEvent, PibblManipulationCancelReason, PibblManipulationGeometry, PibblManipulationOperation, PibblManipulationActive, PibblManipulationFrameProps, PibblManipulationMoveInput, PibblManipulationResizeInput, PibblManipulationRotateInput } from './lib/manipulation/controller-types.js';\nexport type { PibblManipulationBox, PibblManipulationPoint, PibblManipulationWhen, PibblResizePosition } from './lib/manipulation/types.js';\nexport type { PibblDragHandleProps, PibblDragHandleStyle } from './lib/manipulation/handles.js';\n\nexport type { PibblResizeHandleProps, PibblResizeHandlesProps, PibblRotationHandleProps, PibblResizeHandleStyle, PibblRotationHandleStyle, PibblManipulationReadoutStyle, PibblManipulationReadoutStateStyle, PibblRotationConnectorStyle, PibblRotationArcStyle } from './lib/manipulation/handles.js';\n\nexport { degrees } from './lib/manipulation/degrees.js';\nexport { Manipulable } from './lib/manipulation/manipulable.js';\nexport type { PibblManipulableProps } from './lib/manipulation/manipulable.js';\n\nexport { defineTexture, useTexture } from './lib/textures/texture.js';\nexport type { Texture, TexturePaint, TextureRecipe, TextureDefinition, TextureOptions, TexturePlacement, TextureContext, TextureFrame } from './lib/textures/texture.js';\n\nexport { HtmlBox } from './lib/components/html-box.js';\nexport type { HtmlBoxProps, HtmlBoxStyle, HtmlMountCallback, HtmlUpdateFunction, HtmlBoxFocusState } from './lib/html/types.js';\n\nexport { fade } from './lib/transitions/fade.js';\nexport type { PibblTransitionEffect } from './lib/transitions/fade.js';\nexport type { PibblTransitionBinding } from './lib/transitions/binding.js';\nexport { useVisibilityTransition } from './lib/hooks/use-visibility-transition.js';\nexport type { PibblVisibilityTransition, PibblVisibilityTransitionOptions, PibblVisibilityTransitionResult, PibblVisibilityTransitionStatus } from './lib/hooks/use-visibility-transition.js';\n\nexport { embers } from './lib/transitions/embers.js';\nexport type { PibblEmbersOptions } from './lib/transitions/embers.js';\n\nexport { hologram } from './lib/transitions/hologram.js';\nexport type { PibblHologramOptions } from './lib/transitions/hologram.js';\nexport { bifrost } from './lib/transitions/bifrost.js';\nexport type { PibblBifrostOptions } from './lib/transitions/bifrost.js';\n\nexport { slide, zoom, wipe, blurReveal, dissolve } from './lib/transitions/common.js';\nexport type { PibblSlideOptions, PibblZoomOptions, PibblWipeOptions, PibblBlurRevealOptions, PibblDissolveOptions } from './lib/transitions/common.js';\n\nexport { defineTransition } from './lib/transitions/define-transition.js';\nexport type { PibblTransitionDefinition, PibblTransitionRenderFrame } from './lib/transitions/define-transition.js';\n\nexport type { PibblEmbersPhysicsOptions, PibblEmberCollision } from './lib/transitions/embers-physics.js';\n"],
5
5
  "mappings": "AAAA;AAAA,EACE;AAAA,EACA;AAAA,EACA;AAAA,EAIA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,OAcK;AAEP,SAAS,uBAAuB;AAChC,SAAS,0BAA0B;AACnC,SAAS,oBAAsC;AAC/C,SAAS,UAAU,qBAAqB;AACxC;AAAA,EACE;AAAA,EACA;AAAA,EACA;AAAA,OAIK;AAEP,SAAS,WAAyC;AAClD;AAAA,EACE;AAAA,OAGK;AACP,SAAS,YAA4C;AACrD;AAAA,EACE;AAAA,OAGK;AACP;AAAA,EACE;AAAA,OAGK;AACP;AAAA,EACE;AAAA,OAGK;AAEP;AAAA,EACE;AAAA,OAEK;AACP;AAAA,EACE;AAAA,OAGK;AACP;AAAA,EACE;AAAA,OAGK;AACP,SAAS,YAA4B;AACrC;AAAA,EACE;AAAA,OAGK;AACP;AAAA,EACE;AAAA,OAGK;AACP;AAAA,EACE;AAAA,OAEK;AACP;AAAA,EACE;AAAA,OAGK;AACP;AAAA,EACE;AAAA,OAEK;AACP,SAAS,YAA4B;AACrC;AAAA,EACE;AAAA,OAGK;AACP;AAAA,EACE;AAAA,OAGK;AACP;AAAA,EACE;AAAA,EACA;AAAA,OAGK;AACP;AAAA,EACE;AAAA,OAEK;AACP;AAAA,EACE;AAAA,OAEK;AACP;AAAA,EACE;AAAA,OAEK;AACP;AAAA,EACE;AAAA,OAEK;AACP;AAAA,EACE;AAAA,OAEK;AACP;AAAA,EACE;AAAA,OAIK;AACP;AAAA,EACE;AAAA,OAEK;AACP;AAAA,EACE;AAAA,OAEK;AAEP,SAAS,aAAa;AACtB;AAAA,EACE;AAAA,EACA;AAAA,E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,MAAM,YAAY,gBAAgB;AAGxD,SAAS,wBAAwB;",
6
6
  "names": []
7
7
  }
@@ -1,5 +1,5 @@
1
1
  import { type SpringDefinitionRecord } from './spring.js';
2
- import type { PibblAnimationDefinition, PibblAnimationOptions, PibblAnimationSampleInput, PibblEasing, PibblInterpolator, PibblKeyframesOptions, PibblSpringOptions, PibblStepperOptions, PibblTweenOptions } from './types.js';
2
+ import type { PibblAnimationDefinition, PibblAnimationTarget, PibblAnimationOptions, PibblAnimationSampleInput, PibblEasing, PibblInterpolator, PibblKeyframesOptions, PibblSpringOptions, PibblStepperOptions, PibblTweenOptions } from './types.js';
3
3
  declare const seekableDefinitionActivationBrand: unique symbol;
4
4
  interface BaseDefinitionRecord {
5
5
  readonly duration: number;
@@ -47,6 +47,8 @@ export type SeekableDefinitionBoundaryValue<T> = {
47
47
  } | {
48
48
  readonly kind: 'unknown';
49
49
  };
50
+ /** @internal Resolves hook-owned endpoints using the definition's implementation. */
51
+ export declare function bindAnimationTarget<T>(definition: PibblAnimationDefinition<T>, target: PibblAnimationTarget<T>): PibblAnimationDefinition<T>;
50
52
  export interface AnimationDefinitionPerformanceSnapshot {
51
53
  readonly keyframeDefinitions: number;
52
54
  readonly keyframeStorageArrayAllocations: number;
@@ -67,7 +69,7 @@ export declare function snapshotAnimationActivationValue<T>(value: T, seen?: Wea
67
69
  * @see {@link PibblTweenOptions}
68
70
  * @see {@link PibblAnimationDefinition}
69
71
  */
70
- export declare function tween<T>(options: Readonly<PibblTweenOptions<T>>): PibblAnimationDefinition<T>;
72
+ export declare function tween<T = number>(options: Readonly<PibblTweenOptions<T>>): PibblAnimationDefinition<T>;
71
73
  /**
72
74
  * Returns an opaque immutable keyframe definition.
73
75
  *
@@ -90,7 +92,7 @@ export declare function keyframes<T>(options: Readonly<PibblKeyframesOptions<T>>
90
92
  * @see {@link PibblSpringOptions}
91
93
  * @see {@link PibblAnimationDefinition}
92
94
  */
93
- export declare function spring(options: Readonly<PibblSpringOptions>): PibblAnimationDefinition<number>;
95
+ export declare function spring(options?: Readonly<PibblSpringOptions>): PibblAnimationDefinition<number>;
94
96
  /**
95
97
  * Returns an opaque immutable definition from a custom seekable sampler.
96
98
  *
@@ -6,6 +6,17 @@ import {
6
6
  sampleSpring
7
7
  } from "./spring.js";
8
8
  const definitionRecords = /* @__PURE__ */ new WeakMap();
9
+ const targetBindings = /* @__PURE__ */ new WeakMap();
10
+ function targetDefinition(definition, unbound, bind) {
11
+ targetBindings.set(definition, { unbound, bind });
12
+ return definition;
13
+ }
14
+ function bindAnimationTarget(definition, target) {
15
+ const binding = targetBindings.get(definition);
16
+ if (binding) return binding.bind(target);
17
+ getDefinitionRecord(definition);
18
+ return definition;
19
+ }
9
20
  const seekableActivationRecords = /* @__PURE__ */ new WeakMap();
10
21
  let keyframeDefinitions = 0;
11
22
  let keyframeStorageArrayAllocations = 0;
@@ -342,7 +353,7 @@ function tween(options) {
342
353
  }
343
354
  const hasFrom = hasOwn(options, "from");
344
355
  const snapshots = /* @__PURE__ */ new WeakMap();
345
- return createDefinition({
356
+ const record = {
346
357
  kind: "tween",
347
358
  duration: options.duration,
348
359
  debugName: options.debugName,
@@ -351,7 +362,15 @@ function tween(options) {
351
362
  to: snapshotAnimationValue(options.to, snapshots),
352
363
  easing: options.easing ?? easing.linear,
353
364
  interpolate: options.interpolate
354
- });
365
+ };
366
+ return targetDefinition(createDefinition(record), !hasOwn(options, "to"), ({ from, to }) => tween({
367
+ from,
368
+ to,
369
+ duration: record.duration,
370
+ easing: record.easing,
371
+ interpolate: record.interpolate,
372
+ debugName: record.debugName
373
+ }));
355
374
  }
356
375
  function keyframes(options) {
357
376
  assertDuration(options.duration, options.debugName);
@@ -377,8 +396,10 @@ function keyframes(options) {
377
396
  interpolate: options.interpolate
378
397
  });
379
398
  }
380
- function spring(options) {
381
- return createDefinition(createSpringRecord(options));
399
+ function spring(options = {}) {
400
+ const unbound = !hasOwn(options, "to");
401
+ const record = createSpringRecord({ ...options, to: unbound ? 0 : options.to });
402
+ return targetDefinition(createDefinition(record), unbound, ({ from, to, velocity }) => spring({ ...record, from, to, initialVelocity: velocity ?? record.initialVelocity }));
382
403
  }
383
404
  function defineAnimation(options) {
384
405
  assertDuration(options.duration, options.debugName);
@@ -425,6 +446,9 @@ function stepper(options) {
425
446
  });
426
447
  }
427
448
  function getDefinitionRecord(definition) {
449
+ if (targetBindings.get(definition)?.unbound) {
450
+ throw new TypeError("Animation definition needs a target: supply to for drive(), or pass it to useAnimatedValue().");
451
+ }
428
452
  const record = definitionRecords.get(definition);
429
453
  if (record === void 0) throw new TypeError("Expected a Pibbl animation definition.");
430
454
  return record;
@@ -590,6 +614,7 @@ function getStaticSeekableDefinitionBoundaryValue(definition, boundary) {
590
614
  export {
591
615
  activateSeekableDefinition,
592
616
  animationDefinitionPerformanceSnapshot,
617
+ bindAnimationTarget,
593
618
  defineAnimation,
594
619
  getDefinitionRecord,
595
620
  getSeekableDefinitionBoundaryValue,
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "version": 3,
3
3
  "sources": ["../../../src/lib/animation/definition.ts"],
4
- "sourcesContent": ["import { withSignalWriteForbidden } from '../signals/graph.js';\nimport { easing } from './easing.js';\nimport {\n createSpringRecord,\n resolveSpringStart,\n sampleSpring,\n type SpringDefinitionRecord,\n} from './spring.js';\nimport type {\n PibblAnimationDefinition,\n PibblAnimationOptions,\n PibblAnimationSampleInput,\n PibblEasing,\n PibblInterpolator,\n PibblKeyframesOptions,\n PibblSpringOptions,\n PibblStepperOptions,\n PibblTweenOptions,\n} from './types.js';\n\ndeclare const seekableDefinitionActivationBrand: unique symbol;\n\ninterface BaseDefinitionRecord {\n readonly duration: number;\n readonly debugName: string | undefined;\n}\n\ninterface TweenDefinitionRecord<T> extends BaseDefinitionRecord {\n readonly kind: 'tween';\n readonly hasFrom: boolean;\n readonly from: T | undefined;\n readonly to: T;\n readonly easing: PibblEasing;\n readonly interpolate: PibblInterpolator<T> | undefined;\n}\n\ninterface KeyframesDefinitionRecord<T> extends BaseDefinitionRecord {\n readonly kind: 'keyframes';\n readonly values: readonly T[];\n readonly offsets: readonly number[];\n readonly easings: readonly PibblEasing[];\n readonly interpolate: PibblInterpolator<T> | undefined;\n}\n\ninterface CustomDefinitionRecord<T> extends BaseDefinitionRecord {\n readonly kind: 'custom';\n readonly sample: (input: PibblAnimationSampleInput<T>) => T;\n}\n\nexport interface StepperDefinitionRecord<T> extends BaseDefinitionRecord {\n readonly kind: 'stepper';\n readonly stepMilliseconds: number;\n readonly maxElapsedMilliseconds: number;\n readonly initial: (currentValue: T) => unknown;\n readonly step: (state: unknown, deltaMilliseconds: number) => unknown;\n readonly read: (state: unknown) => T;\n readonly done: ((state: unknown) => boolean) | undefined;\n}\n\nexport type DefinitionRecord<T> =\n | TweenDefinitionRecord<T>\n | KeyframesDefinitionRecord<T>\n | CustomDefinitionRecord<T>\n | StepperDefinitionRecord<T>\n | SpringDefinitionRecord;\n\n/** @internal Opaque activation-time state for one seekable track instance. */\nexport interface SeekableDefinitionActivation<T> {\n readonly [seekableDefinitionActivationBrand]: T;\n readonly duration: number;\n readonly initialValue: T;\n}\n\n/** @internal Callback-free knowledge about a seekable definition boundary. */\nexport type SeekableDefinitionBoundaryValue<T> =\n | { readonly kind: 'known'; readonly value: T }\n | { readonly kind: 'unknown' };\n\ninterface SeekableDefinitionActivationRecord<T> {\n readonly definition: PibblAnimationDefinition<T>;\n readonly definitionRecord: Exclude<DefinitionRecord<T>, StepperDefinitionRecord<T>>;\n readonly initialValue: T;\n}\n\nconst definitionRecords = new WeakMap<\n PibblAnimationDefinition<unknown>,\n DefinitionRecord<unknown>\n>();\nconst seekableActivationRecords = new WeakMap<\n SeekableDefinitionActivation<unknown>,\n SeekableDefinitionActivationRecord<unknown>\n>();\nlet keyframeDefinitions = 0;\nlet keyframeStorageArrayAllocations = 0;\nlet keyframeSamples = 0;\nlet keyframeSampleArrayAllocations = 0;\nlet keyframeSampleDepth = 0;\n\nexport interface AnimationDefinitionPerformanceSnapshot {\n readonly keyframeDefinitions: number;\n readonly keyframeStorageArrayAllocations: number;\n readonly keyframeSamples: number;\n readonly keyframeSampleArrayAllocations: number;\n}\n\n/** @internal Deterministic structural counters for normalized keyframe sampling. */\nexport function animationDefinitionPerformanceSnapshot():\nAnimationDefinitionPerformanceSnapshot {\n return Object.freeze({\n keyframeDefinitions,\n keyframeStorageArrayAllocations,\n keyframeSamples,\n keyframeSampleArrayAllocations,\n });\n}\n\nfunction definitionLabel(debugName: string | undefined): string {\n return debugName === undefined ? 'Pibbl animation definition' :\n `Pibbl animation definition \"${debugName}\"`;\n}\n\nfunction assertDuration(duration: number, debugName: string | undefined): void {\n if (!Number.isFinite(duration) || duration < 0) {\n throw new RangeError(`${definitionLabel(debugName)} duration must be finite and nonnegative.`);\n }\n}\n\nfunction assertFiniteNumber(value: number, message: string): void {\n if (!Number.isFinite(value)) throw new RangeError(message);\n}\n\nconst MUTATING_MAP_METHODS = new Set<PropertyKey>(['set', 'delete', 'clear']);\nconst MUTATING_SET_METHODS = new Set<PropertyKey>(['add', 'delete', 'clear']);\nconst MUTATING_DATE_METHODS = new Set<PropertyKey>([\n 'setDate', 'setFullYear', 'setHours', 'setMilliseconds', 'setMinutes',\n 'setMonth', 'setSeconds', 'setTime', 'setUTCDate', 'setUTCFullYear',\n 'setUTCHours', 'setUTCMilliseconds', 'setUTCMinutes', 'setUTCMonth',\n 'setUTCSeconds', 'setYear',\n]);\n\nfunction immutableBuiltin<T extends object>(\n target: T,\n mutatingMethods: ReadonlySet<PropertyKey>,\n): T {\n return new Proxy(target, {\n get(current, key) {\n if (mutatingMethods.has(key)) {\n return (): never => {\n throw new TypeError('Cannot mutate an animation definition snapshot.');\n };\n }\n const member = Reflect.get(current, key, current);\n return typeof member === 'function' && key !== 'constructor' ?\n member.bind(current) : member;\n },\n set(): false {\n return false;\n },\n defineProperty(): false {\n return false;\n },\n deleteProperty(): false {\n return false;\n },\n });\n}\n\nfunction rememberIdentity<T extends object>(\n value: T,\n seen: WeakMap<object, unknown>,\n): T {\n seen.set(value, value);\n return value;\n}\n\nfunction hasOwnProperties(value: object, allowed: ReadonlySet<PropertyKey>): boolean {\n return Reflect.ownKeys(value).some(key => !allowed.has(key));\n}\n\nfunction hasOnlyDataProperties(value: object, allowed: ReadonlySet<PropertyKey>): boolean {\n return Reflect.ownKeys(value).every(key => {\n if (allowed.has(key)) return true;\n const descriptor = Object.getOwnPropertyDescriptor(value, key);\n return descriptor !== undefined && 'value' in descriptor;\n });\n}\n\nconst ARRAY_OWN_KEYS = new Set<PropertyKey>(['length']);\nconst REGEXP_OWN_KEYS = new Set<PropertyKey>(['lastIndex']);\nconst snapshotsRequiringIsolation = new WeakSet<object>();\n\nfunction requiresIsolation(value: unknown): value is object {\n return (typeof value === 'object' && value !== null || typeof value === 'function') &&\n snapshotsRequiringIsolation.has(value as object);\n}\n\nfunction propagateIsolation(snapshot: object, value: unknown): void {\n if (requiresIsolation(value)) snapshotsRequiringIsolation.add(snapshot);\n}\n\nfunction isArrayIndex(key: PropertyKey): boolean {\n return typeof key === 'string' && /^(?:0|[1-9]\\d*)$/u.test(key);\n}\n\nfunction cloneTypedArray(\n value: ArrayBufferView,\n buffer?: ArrayBuffer,\n): ArrayBufferView {\n if (value instanceof DataView) {\n if (buffer !== undefined) {\n return new DataView(buffer, value.byteOffset, value.byteLength);\n }\n const bytes = value.buffer.slice(value.byteOffset, value.byteOffset + value.byteLength);\n return new DataView(bytes);\n }\n const TypedArray = value.constructor as unknown as {\n new (source: ArrayBufferView): ArrayBufferView;\n new (buffer: ArrayBuffer, byteOffset: number, length: number): ArrayBufferView;\n };\n return buffer === undefined ? new TypedArray(value) :\n new TypedArray(\n buffer,\n value.byteOffset,\n (value as ArrayBufferView & { readonly length: number }).length,\n );\n}\n\n/**\n * Definitions retain values after their caller has moved on. The context is\n * shared across one definition so aliases and cycles remain aliases and cycles\n * in its immutable snapshot. Only categories with stable, inspectable cloning\n * semantics are copied. Reconstructable values that cannot themselves be\n * frozen are marked so only the containing paths are rematerialized before a\n * callback or terminal return. Functions, classes, accessors, and opaque host\n * values (notably WeakMap, WeakSet, Promise, and host handles) remain usable\n * identity values because cloning them can manufacture an invalid receiver or\n * change their behavior; an absolute snapshot guarantee for those values\n * requires an explicit public clone contract that Pibbl does not currently\n * provide.\n */\nfunction snapshotAnimationValue<T>(\n value: T,\n seen: WeakMap<object, unknown>,\n isolateStoredValue = false,\n): T {\n if (value === null || typeof value === 'function' || typeof value !== 'object') {\n return value;\n }\n const existing = seen.get(value);\n if (existing !== undefined) return existing as T;\n if (isolateStoredValue && !requiresIsolation(value)) {\n seen.set(value, value);\n return value;\n }\n\n if (value instanceof Date) {\n if (hasOwnProperties(value, new Set())) return rememberIdentity(value, seen) as T;\n const snapshot = immutableBuiltin(new Date(value.getTime()), MUTATING_DATE_METHODS);\n seen.set(value, snapshot);\n return snapshot as T;\n }\n if (value instanceof Map) {\n if (hasOwnProperties(value, new Set())) return rememberIdentity(value, seen) as T;\n const target = new Map();\n const snapshot = immutableBuiltin(target, MUTATING_MAP_METHODS);\n seen.set(value, snapshot);\n for (const [key, entry] of value) {\n const keySnapshot = snapshotAnimationValue(key, seen, isolateStoredValue);\n const entrySnapshot = snapshotAnimationValue(entry, seen, isolateStoredValue);\n target.set(keySnapshot, entrySnapshot);\n propagateIsolation(snapshot, keySnapshot);\n propagateIsolation(snapshot, entrySnapshot);\n }\n return snapshot as T;\n }\n if (value instanceof Set) {\n if (hasOwnProperties(value, new Set())) return rememberIdentity(value, seen) as T;\n const target = new Set();\n const snapshot = immutableBuiltin(target, MUTATING_SET_METHODS);\n seen.set(value, snapshot);\n for (const entry of value) {\n const entrySnapshot = snapshotAnimationValue(entry, seen, isolateStoredValue);\n target.add(entrySnapshot);\n propagateIsolation(snapshot, entrySnapshot);\n }\n return snapshot as T;\n }\n if (Array.isArray(value)) {\n const ownKeys = Reflect.ownKeys(value);\n if (Object.getPrototypeOf(value) !== Array.prototype ||\n ownKeys.some(key => !ARRAY_OWN_KEYS.has(key) && !isArrayIndex(key)) ||\n !hasOnlyDataProperties(value, ARRAY_OWN_KEYS)) {\n return rememberIdentity(value, seen) as T;\n }\n const snapshot: unknown[] = new Array(value.length);\n if (keyframeSampleDepth > 0) keyframeSampleArrayAllocations++;\n seen.set(value, snapshot);\n for (const key of ownKeys) {\n if (ARRAY_OWN_KEYS.has(key)) continue;\n const descriptor = Object.getOwnPropertyDescriptor(value, key);\n if (descriptor === undefined || !('value' in descriptor)) continue;\n const itemSnapshot = snapshotAnimationValue(\n descriptor.value,\n seen,\n isolateStoredValue,\n );\n Object.defineProperty(snapshot, key, {\n configurable: false,\n enumerable: descriptor.enumerable,\n writable: false,\n value: itemSnapshot,\n });\n propagateIsolation(snapshot, itemSnapshot);\n }\n return Object.freeze(snapshot) as T;\n }\n\n if (value instanceof RegExp) {\n if (hasOwnProperties(value, REGEXP_OWN_KEYS)) return rememberIdentity(value, seen) as T;\n const snapshot = new RegExp(value.source, value.flags);\n snapshot.lastIndex = value.lastIndex;\n seen.set(value, snapshot);\n snapshotsRequiringIsolation.add(snapshot);\n return snapshot as T;\n }\n\n if (ArrayBuffer.isView(value)) {\n const ownKeys = Reflect.ownKeys(value);\n if (ownKeys.some(key => !isArrayIndex(key))) return rememberIdentity(value, seen) as T;\n const buffer = value.buffer instanceof ArrayBuffer ?\n snapshotAnimationValue(value.buffer, seen, isolateStoredValue) : undefined;\n const snapshot = cloneTypedArray(value, buffer);\n seen.set(value, snapshot);\n snapshotsRequiringIsolation.add(snapshot);\n return snapshot as T;\n }\n\n if (value instanceof ArrayBuffer) {\n const snapshot = value.slice(0);\n seen.set(value, snapshot);\n snapshotsRequiringIsolation.add(snapshot);\n return snapshot as T;\n }\n\n const prototype = Object.getPrototypeOf(value);\n if (prototype !== Object.prototype && prototype !== null ||\n !hasOnlyDataProperties(value, new Set())) {\n return rememberIdentity(value, seen) as T;\n }\n const snapshot = Object.create(prototype) as Record<PropertyKey, unknown>;\n seen.set(value, snapshot);\n for (const key of Reflect.ownKeys(value)) {\n const descriptor = Object.getOwnPropertyDescriptor(value, key);\n if (descriptor === undefined) continue;\n const propertySnapshot = snapshotAnimationValue(\n descriptor.value,\n seen,\n isolateStoredValue,\n );\n Object.defineProperty(snapshot, key, {\n configurable: false,\n enumerable: descriptor.enumerable,\n writable: false,\n value: propertySnapshot,\n });\n propagateIsolation(snapshot, propertySnapshot);\n }\n return Object.freeze(snapshot) as T;\n}\n\nfunction isolateStoredAnimationValue<T>(\n value: T,\n seen: WeakMap<object, unknown>,\n): T {\n return snapshotAnimationValue(value, seen, true);\n}\n\n/** @internal Captures a committed output value for a playback activation. */\nexport function snapshotAnimationActivationValue<T>(\n value: T,\n seen: WeakMap<object, unknown> = new WeakMap(),\n): T {\n return snapshotAnimationValue(value, seen);\n}\n\nfunction validateSampledValue<T>(sampled: T, debugName: string | undefined): T {\n if (typeof sampled === 'number' && !Number.isFinite(sampled)) {\n throw new RangeError(`${definitionLabel(debugName)} sampled value must be finite.`);\n }\n return sampled;\n}\n\nfunction createDefinition<T>(record: DefinitionRecord<T>): PibblAnimationDefinition<T> {\n const definition = Object.freeze({}) as PibblAnimationDefinition<T>;\n definitionRecords.set(\n definition as PibblAnimationDefinition<unknown>,\n Object.freeze(record) as DefinitionRecord<unknown>,\n );\n return definition;\n}\n\nfunction hasOwn(object: object, key: PropertyKey): boolean {\n return Object.prototype.hasOwnProperty.call(object, key);\n}\n\nfunction callback<T>(\n debugName: string | undefined,\n callback: () => T,\n): T {\n return withSignalWriteForbidden(\n `${definitionLabel(debugName)} callbacks cannot write to signals.`,\n callback,\n );\n}\n\nfunction sampledProgress(duration: number, localTime: number): {\n readonly localTime: number;\n readonly progress: number;\n} {\n assertFiniteNumber(localTime, 'Pibbl animation sample localTime must be finite.');\n if (duration === 0) return Object.freeze({ localTime: 0, progress: 1 });\n const normalizedLocalTime = Math.min(duration, Math.max(0, localTime));\n return Object.freeze({\n localTime: normalizedLocalTime,\n progress: normalizedLocalTime / duration,\n });\n}\n\nfunction interpolate<T>(\n from: T,\n to: T,\n progress: number,\n custom: PibblInterpolator<T> | undefined,\n debugName: string | undefined,\n): T {\n if (custom === undefined && (typeof from !== 'number' || typeof to !== 'number')) {\n throw new TypeError(`${definitionLabel(debugName)} requires an explicit interpolator for nonnumeric values.`);\n }\n let sampled: T;\n if (custom === undefined) {\n sampled = ((from as unknown as number) +\n ((to as unknown as number) - (from as unknown as number)) * progress) as T;\n } else {\n const isolated = new WeakMap<object, unknown>();\n const isolatedFrom = isolateStoredAnimationValue(from, isolated);\n const isolatedTo = isolateStoredAnimationValue(to, isolated);\n sampled = callback(debugName, () => custom(isolatedFrom, isolatedTo, progress));\n }\n return validateSampledValue(sampled, debugName);\n}\n\nfunction easedProgress(\n ease: PibblEasing,\n progress: number,\n debugName: string | undefined,\n): number {\n const eased = callback(debugName, () => ease(progress));\n if (!Number.isFinite(eased)) {\n throw new RangeError(`${definitionLabel(debugName)} easing result must be finite.`);\n }\n return eased;\n}\n\nfunction normalizeOffsets(\n values: readonly unknown[],\n offsets: readonly number[] | undefined,\n debugName: string | undefined,\n): readonly number[] {\n if (offsets === undefined) {\n return Object.freeze(values.map((_, index) => index / (values.length - 1)));\n }\n if (offsets.length !== values.length) {\n throw new RangeError(`${definitionLabel(debugName)} keyframe offsets must match the values length.`);\n }\n const snapshot = [...offsets];\n for (const offset of snapshot) {\n if (!Number.isFinite(offset) || offset < 0 || offset > 1) {\n throw new RangeError(`${definitionLabel(debugName)} keyframe offsets must be finite values within [0, 1].`);\n }\n }\n if (snapshot[0] !== 0) {\n throw new RangeError(`${definitionLabel(debugName)} keyframe offsets must start at 0.`);\n }\n if (snapshot.at(-1) !== 1) {\n throw new RangeError(`${definitionLabel(debugName)} keyframe offsets must end at 1.`);\n }\n for (let index = 1; index < snapshot.length; index++) {\n if (snapshot[index] < snapshot[index - 1]) {\n throw new RangeError(`${definitionLabel(debugName)} keyframe offsets must be nondecreasing.`);\n }\n }\n return Object.freeze(snapshot);\n}\n\nfunction normalizeEasings(\n easingOption: PibblEasing | readonly PibblEasing[] | undefined,\n segmentCount: number,\n debugName: string | undefined,\n): readonly PibblEasing[] {\n if (Array.isArray(easingOption)) {\n if (easingOption.length !== segmentCount) {\n throw new RangeError(`${definitionLabel(debugName)} keyframe easing list must have one entry per segment.`);\n }\n if (easingOption.some(ease => typeof ease !== 'function')) {\n throw new TypeError(`${definitionLabel(debugName)} keyframe easings must be functions.`);\n }\n return Object.freeze([...easingOption]);\n }\n const ease = easingOption ?? easing.linear;\n if (typeof ease !== 'function') {\n throw new TypeError(`${definitionLabel(debugName)} easing must be a function.`);\n }\n return Object.freeze(Array.from({ length: segmentCount }, () => ease));\n}\n\n/**\n * Returns an opaque immutable tween definition.\n *\n * @param options - Start and end values, duration, easing, and interpolation settings. See\n * {@link PibblTweenOptions} .\n * @returns An immutable tween definition. See {@link PibblAnimationDefinition}.\n *\n * @see {@link PibblTweenOptions}\n * @see {@link PibblAnimationDefinition}\n */\nexport function tween<T>(options: Readonly<PibblTweenOptions<T>>): PibblAnimationDefinition<T> {\n assertDuration(options.duration, options.debugName);\n if (typeof options.easing !== 'undefined' && typeof options.easing !== 'function') {\n throw new TypeError(`${definitionLabel(options.debugName)} easing must be a function.`);\n }\n if (typeof options.interpolate !== 'undefined' && typeof options.interpolate !== 'function') {\n throw new TypeError(`${definitionLabel(options.debugName)} interpolator must be a function.`);\n }\n const hasFrom = hasOwn(options, 'from');\n const snapshots = new WeakMap<object, unknown>();\n return createDefinition({\n kind: 'tween',\n duration: options.duration,\n debugName: options.debugName,\n hasFrom,\n from: hasFrom ? snapshotAnimationValue(options.from as T, snapshots) : undefined,\n to: snapshotAnimationValue(options.to, snapshots),\n easing: options.easing ?? easing.linear,\n interpolate: options.interpolate,\n });\n}\n\n/**\n * Returns an opaque immutable keyframe definition.\n *\n * @param options - Keyframe values, timing, easing, and interpolation settings. See\n * {@link PibblKeyframesOptions} .\n * @returns An immutable animation definition sampling the keyframes. See\n * {@link PibblAnimationDefinition} .\n *\n * @see {@link PibblKeyframesOptions}\n * @see {@link PibblAnimationDefinition}\n */\nexport function keyframes<T>(\n options: Readonly<PibblKeyframesOptions<T>>,\n): PibblAnimationDefinition<T> {\n assertDuration(options.duration, options.debugName);\n if (options.values.length < 2) {\n throw new RangeError(`${definitionLabel(options.debugName)} keyframes require at least two values.`);\n }\n if (typeof options.interpolate !== 'undefined' && typeof options.interpolate !== 'function') {\n throw new TypeError(`${definitionLabel(options.debugName)} interpolator must be a function.`);\n }\n const snapshots = new WeakMap<object, unknown>();\n const values = Object.freeze(options.values.map(value => snapshotAnimationValue(value, snapshots)));\n const offsets = normalizeOffsets(values, options.offsets, options.debugName);\n const easings = normalizeEasings(options.easing, values.length - 1, options.debugName);\n keyframeDefinitions++;\n keyframeStorageArrayAllocations += 3;\n return createDefinition({\n kind: 'keyframes',\n duration: options.duration,\n debugName: options.debugName,\n values,\n offsets,\n easings,\n interpolate: options.interpolate,\n });\n}\n\n/**\n * Returns an opaque immutable analytic one-dimensional spring definition.\n *\n * @param options - Target, initial conditions, and spring parameters. See {@link PibblSpringOptions}\n * .\n * @returns An analytic numeric spring definition. See {@link PibblAnimationDefinition}.\n *\n * @see {@link PibblSpringOptions}\n * @see {@link PibblAnimationDefinition}\n */\nexport function spring(\n options: Readonly<PibblSpringOptions>,\n): PibblAnimationDefinition<number> {\n return createDefinition(createSpringRecord(options));\n}\n\n/**\n * Returns an opaque immutable definition from a custom seekable sampler.\n *\n * @param options - Duration and pure sampling callback for the animation. See\n * {@link PibblAnimationOptions} .\n * @returns An immutable, seekable animation definition. See {@link PibblAnimationDefinition}.\n *\n * @see {@link PibblAnimationOptions}\n * @see {@link PibblAnimationDefinition}\n */\nexport function defineAnimation<T>(\n options: Readonly<PibblAnimationOptions<T>>,\n): PibblAnimationDefinition<T> {\n assertDuration(options.duration, options.debugName);\n if (typeof options.sample !== 'function') {\n throw new TypeError(`${definitionLabel(options.debugName)} sample must be a function.`);\n }\n return createDefinition({\n kind: 'custom',\n duration: options.duration,\n debugName: options.debugName,\n sample: options.sample,\n });\n}\n\n/**\n * Returns an opaque immutable stepper definition. Steppers are evaluated by\n * the playback engine, not by the seekable sampler.\n *\n * @param options - Initial state, fixed-step integration, value reader, and completion predicate.\n * See {@link PibblStepperOptions} .\n * @returns A stateful animation definition advanced by fixed simulation steps. See\n * {@link PibblAnimationDefinition} .\n *\n * @see {@link PibblStepperOptions}\n * @see {@link PibblAnimationDefinition}\n */\nexport function stepper<State, T>(\n options: Readonly<PibblStepperOptions<State, T>>,\n): PibblAnimationDefinition<T> {\n if (typeof options.initial !== 'function') {\n throw new TypeError(`${definitionLabel(options.debugName)} stepper initial must be a function.`);\n }\n if (typeof options.step !== 'function') {\n throw new TypeError(`${definitionLabel(options.debugName)} stepper step must be a function.`);\n }\n if (typeof options.read !== 'function') {\n throw new TypeError(`${definitionLabel(options.debugName)} stepper read must be a function.`);\n }\n if (typeof options.done !== 'undefined' && typeof options.done !== 'function') {\n throw new TypeError(`${definitionLabel(options.debugName)} stepper done must be a function.`);\n }\n if (!Number.isFinite(options.stepMilliseconds) || options.stepMilliseconds <= 0) {\n throw new RangeError(`${definitionLabel(options.debugName)} stepper stepMilliseconds must be finite and positive.`);\n }\n const maxElapsedMilliseconds = options.maxElapsedMilliseconds ?? 100;\n if (!Number.isFinite(maxElapsedMilliseconds) || maxElapsedMilliseconds <= 0) {\n throw new RangeError(`${definitionLabel(options.debugName)} stepper maxElapsedMilliseconds must be finite and positive.`);\n }\n return createDefinition({\n kind: 'stepper',\n duration: Number.POSITIVE_INFINITY,\n debugName: options.debugName,\n stepMilliseconds: options.stepMilliseconds,\n maxElapsedMilliseconds,\n initial: options.initial as (currentValue: T) => unknown,\n step: options.step as (state: unknown, deltaMilliseconds: number) => unknown,\n read: options.read as (state: unknown) => T,\n done: options.done as ((state: unknown) => boolean) | undefined,\n });\n}\n\n/** @internal Returns the private immutable record associated with a definition. */\nexport function getDefinitionRecord<T>(\n definition: PibblAnimationDefinition<T>,\n): DefinitionRecord<T> {\n const record = definitionRecords.get(definition as PibblAnimationDefinition<unknown>);\n if (record === undefined) throw new TypeError('Expected a Pibbl animation definition.');\n return record as DefinitionRecord<T>;\n}\n\n/** @internal Samples a non-stepper definition from its activation snapshot. */\nexport function sampleSeekableDefinition<T>(\n definition: PibblAnimationDefinition<T>,\n input: Readonly<Pick<PibblAnimationSampleInput<T>, 'initialValue' | 'localTime'>>,\n): T {\n const record = getDefinitionRecord(definition);\n if (record.kind === 'stepper') {\n throw new TypeError(\n `${definitionLabel(record.debugName)} is stateful and requires the stateful program evaluator.`,\n );\n }\n if (record.kind === 'spring') {\n const resolved = resolveSpringStart(record, input.initialValue as number);\n const timing = sampledProgress(resolved.duration, input.localTime);\n return sampleSpring(resolved, timing.localTime / 1000).position as T;\n }\n const timing = sampledProgress(record.duration, input.localTime);\n if (record.kind === 'custom') {\n const sampled = callback(record.debugName, () => record.sample(Object.freeze({\n initialValue: input.initialValue,\n localTime: timing.localTime,\n progress: timing.progress,\n })));\n return validateSampledValue(sampled, record.debugName);\n }\n if (record.kind === 'tween') {\n const from = record.hasFrom ? record.from as T : input.initialValue;\n return interpolate(\n from,\n record.to,\n easedProgress(record.easing, timing.progress, record.debugName),\n record.interpolate,\n record.debugName,\n );\n }\n\n keyframeSamples++;\n keyframeSampleDepth++;\n try {\n return sampleKeyframe(record, timing);\n } finally {\n keyframeSampleDepth--;\n }\n}\n\nfunction sampleKeyframe<T>(\n record: KeyframesDefinitionRecord<T>,\n timing: { readonly progress: number },\n): T {\n let segment = 0;\n for (let index = 1; index < record.offsets.length; index++) {\n if (record.offsets[index] <= timing.progress) segment = index;\n else break;\n }\n if (segment === record.values.length - 1) {\n return validateSampledValue(\n isolateStoredAnimationValue(record.values[segment], new WeakMap()),\n record.debugName,\n );\n }\n const start = record.offsets[segment];\n const end = record.offsets[segment + 1];\n return interpolate(\n record.values[segment],\n record.values[segment + 1],\n easedProgress(record.easings[segment], (timing.progress - start) / (end - start), record.debugName),\n record.interpolate,\n record.debugName,\n );\n}\n\n/**\n * @internal Resolves activation-dependent definition data exactly once for a\n * track instance. Stateful definitions use a separate playback-owned record.\n */\nexport function activateSeekableDefinition<T>(\n definition: PibblAnimationDefinition<T>,\n initialValue: T,\n seen: WeakMap<object, unknown> = new WeakMap(),\n): SeekableDefinitionActivation<T> {\n const definitionRecord = getDefinitionRecord(definition);\n if (definitionRecord.kind === 'stepper') {\n throw new TypeError(\n 'Stateful animation definitions require the stateful program evaluator.',\n );\n }\n const snapshot = snapshotAnimationActivationValue(initialValue, seen);\n const resolved = definitionRecord.kind === 'spring' ?\n resolveSpringStart(definitionRecord, snapshot as number) : definitionRecord;\n const activation = Object.freeze({\n duration: resolved.duration,\n initialValue: snapshot,\n }) as SeekableDefinitionActivation<T>;\n seekableActivationRecords.set(\n activation as SeekableDefinitionActivation<unknown>,\n Object.freeze({\n definition,\n definitionRecord: resolved,\n initialValue: snapshot,\n }) as SeekableDefinitionActivationRecord<unknown>,\n );\n return activation;\n}\n\n/** @internal Samples a definition from one retained activation record. */\nexport function sampleActivatedSeekableDefinition<T>(\n activation: SeekableDefinitionActivation<T>,\n localTime: number,\n): T {\n const activationRecord = seekableActivationRecords.get(\n activation as SeekableDefinitionActivation<unknown>,\n ) as SeekableDefinitionActivationRecord<T> | undefined;\n if (activationRecord === undefined) {\n throw new TypeError('Expected a seekable Pibbl animation definition activation.');\n }\n const record = activationRecord.definitionRecord;\n if (record.kind === 'spring') {\n const timing = sampledProgress(record.duration, localTime);\n return sampleSpring(record, timing.localTime / 1000).position as T;\n }\n return sampleSeekableDefinition(activationRecord.definition, {\n initialValue: activationRecord.initialValue,\n localTime,\n });\n}\n\n/**\n * @internal Returns a boundary value only when the normalized definition makes\n * it exact without invoking user easing, interpolation, or sampling callbacks.\n */\nexport function getSeekableDefinitionBoundaryValue<T>(\n activation: SeekableDefinitionActivation<T>,\n boundary: 'start' | 'end',\n): SeekableDefinitionBoundaryValue<T> {\n const activationRecord = seekableActivationRecords.get(\n activation as SeekableDefinitionActivation<unknown>,\n ) as SeekableDefinitionActivationRecord<T> | undefined;\n if (activationRecord === undefined) {\n throw new TypeError('Expected a seekable Pibbl animation definition activation.');\n }\n const record = activationRecord.definitionRecord;\n if (record.kind === 'spring') {\n return Object.freeze({\n kind: 'known' as const,\n value: (boundary === 'start' ? record.from : record.to) as T,\n });\n }\n if (record.kind === 'keyframes') {\n if (boundary === 'end') {\n return Object.freeze({ kind: 'known' as const, value: record.values.at(-1)! });\n }\n if (record.interpolate === undefined && record.easings[0] === easing.linear) {\n return Object.freeze({ kind: 'known' as const, value: record.values[0]! });\n }\n return Object.freeze({ kind: 'unknown' as const });\n }\n if (record.kind === 'tween' && record.interpolate === undefined &&\n record.easing === easing.linear) {\n return Object.freeze({\n kind: 'known' as const,\n value: boundary === 'start' ?\n (record.hasFrom ? record.from as T : activationRecord.initialValue) : record.to,\n });\n }\n return Object.freeze({ kind: 'unknown' as const });\n}\n\n/**\n * @internal Returns a callback-free boundary that does not depend on a track's\n * activation value. This lets discovery recover known terminal state after an\n * earlier opaque custom value.\n */\nexport function getStaticSeekableDefinitionBoundaryValue<T>(\n definition: PibblAnimationDefinition<T>,\n boundary: 'start' | 'end',\n): SeekableDefinitionBoundaryValue<T> {\n const record = getDefinitionRecord(definition);\n if (record.kind === 'spring' && record.hasFrom) {\n return Object.freeze({\n kind: 'known' as const,\n value: (boundary === 'start' ? record.from : record.to) as T,\n });\n }\n if (record.kind === 'keyframes') {\n if (boundary === 'end') {\n return Object.freeze({ kind: 'known' as const, value: record.values.at(-1)! });\n }\n if (record.interpolate === undefined && record.easings[0] === easing.linear) {\n return Object.freeze({ kind: 'known' as const, value: record.values[0]! });\n }\n }\n if (record.kind === 'tween' && record.interpolate === undefined &&\n record.easing === easing.linear) {\n if (boundary === 'end') {\n return Object.freeze({ kind: 'known' as const, value: record.to });\n }\n if (record.hasFrom) {\n return Object.freeze({ kind: 'known' as const, value: record.from as T });\n }\n }\n return Object.freeze({ kind: 'unknown' as const });\n}\n"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AAO,gBAAgB,UACpD,OAAO,WAAW,OAAO,QAAQ;AACjC,WAAO,OAAO,OAAO;AAAA,MACnB,MAAM;AAAA,MACN,OAAO,aAAa,UACjB,OAAO,UAAU,OAAO,OAAY,iBAAiB,eAAgB,OAAO;AAAA,IACjF,CAAC;AAAA,EACH;AACA,SAAO,OAAO,OAAO,EAAE,MAAM,UAAmB,CAAC;AACnD;AAOO,SAAS,yCACd,YACA,UACoC;AACpC,QAAM,SAAS,oBAAoB,UAAU;AAC7C,MAAI,OAAO,SAAS,YAAY,OAAO,SAAS;AAC9C,WAAO,OAAO,OAAO;AAAA,MACnB,MAAM;AAAA,MACN,OAAQ,aAAa,UAAU,OAAO,OAAO,OAAO;AAAA,IACtD,CAAC;AAAA,EACH;AACA,MAAI,OAAO,SAAS,aAAa;AAC/B,QAAI,aAAa,OAAO;AACtB,aAAO,OAAO,OAAO,EAAE,MAAM,SAAkB,OAAO,OAAO,OAAO,GAAG,EAAE,EAAG,CAAC;AAAA,IAC/E;AACA,QAAI,OAAO,gBAAgB,UAAa,OAAO,QAAQ,CAAC,MAAM,OAAO,QAAQ;AAC3E,aAAO,OAAO,OAAO,EAAE,MAAM,SAAkB,OAAO,OAAO,OAAO,CAAC,EAAG,CAAC;AAAA,IAC3E;AAAA,EACF;AACA,MAAI,OAAO,SAAS,WAAW,OAAO,gBAAgB,UACpD,OAAO,WAAW,OAAO,QAAQ;AACjC,QAAI,aAAa,OAAO;AACtB,aAAO,OAAO,OAAO,EAAE,MAAM,SAAkB,OAAO,OAAO,GAAG,CAAC;AAAA,IACnE;AACA,QAAI,OAAO,SAAS;AAClB,aAAO,OAAO,OAAO,EAAE,MAAM,SAAkB,OAAO,OAAO,KAAU,CAAC;AAAA,IAC1E;AAAA,EACF;AACA,SAAO,OAAO,OAAO,EAAE,MAAM,UAAmB,CAAC;AACnD;",
4
+ "sourcesContent": ["import { withSignalWriteForbidden } from '../signals/graph.js';\nimport { easing } from './easing.js';\nimport {\n createSpringRecord,\n resolveSpringStart,\n sampleSpring,\n type SpringDefinitionRecord,\n} from './spring.js';\nimport type {\n PibblAnimationDefinition,\n PibblAnimationTarget,\n PibblAnimationOptions,\n PibblAnimationSampleInput,\n PibblEasing,\n PibblInterpolator,\n PibblKeyframesOptions,\n PibblSpringOptions,\n PibblStepperOptions,\n PibblTweenOptions,\n} from './types.js';\n\ndeclare const seekableDefinitionActivationBrand: unique symbol;\n\ninterface BaseDefinitionRecord {\n readonly duration: number;\n readonly debugName: string | undefined;\n}\n\ninterface TweenDefinitionRecord<T> extends BaseDefinitionRecord {\n readonly kind: 'tween';\n readonly hasFrom: boolean;\n readonly from: T | undefined;\n readonly to: T;\n readonly easing: PibblEasing;\n readonly interpolate: PibblInterpolator<T> | undefined;\n}\n\ninterface KeyframesDefinitionRecord<T> extends BaseDefinitionRecord {\n readonly kind: 'keyframes';\n readonly values: readonly T[];\n readonly offsets: readonly number[];\n readonly easings: readonly PibblEasing[];\n readonly interpolate: PibblInterpolator<T> | undefined;\n}\n\ninterface CustomDefinitionRecord<T> extends BaseDefinitionRecord {\n readonly kind: 'custom';\n readonly sample: (input: PibblAnimationSampleInput<T>) => T;\n}\n\nexport interface StepperDefinitionRecord<T> extends BaseDefinitionRecord {\n readonly kind: 'stepper';\n readonly stepMilliseconds: number;\n readonly maxElapsedMilliseconds: number;\n readonly initial: (currentValue: T) => unknown;\n readonly step: (state: unknown, deltaMilliseconds: number) => unknown;\n readonly read: (state: unknown) => T;\n readonly done: ((state: unknown) => boolean) | undefined;\n}\n\nexport type DefinitionRecord<T> =\n | TweenDefinitionRecord<T>\n | KeyframesDefinitionRecord<T>\n | CustomDefinitionRecord<T>\n | StepperDefinitionRecord<T>\n | SpringDefinitionRecord;\n\n/** @internal Opaque activation-time state for one seekable track instance. */\nexport interface SeekableDefinitionActivation<T> {\n readonly [seekableDefinitionActivationBrand]: T;\n readonly duration: number;\n readonly initialValue: T;\n}\n\n/** @internal Callback-free knowledge about a seekable definition boundary. */\nexport type SeekableDefinitionBoundaryValue<T> =\n | { readonly kind: 'known'; readonly value: T }\n | { readonly kind: 'unknown' };\n\ninterface SeekableDefinitionActivationRecord<T> {\n readonly definition: PibblAnimationDefinition<T>;\n readonly definitionRecord: Exclude<DefinitionRecord<T>, StepperDefinitionRecord<T>>;\n readonly initialValue: T;\n}\n\nconst definitionRecords = new WeakMap<\n PibblAnimationDefinition<unknown>,\n DefinitionRecord<unknown>\n>();\n// Binding is carried by the definition, so the hook does not select algorithms.\nconst targetBindings = new WeakMap<object, {\n readonly unbound: boolean;\n readonly bind: (target: PibblAnimationTarget<any>) => PibblAnimationDefinition<any>;\n}>();\n\nfunction targetDefinition<T>(\n definition: PibblAnimationDefinition<T>,\n unbound: boolean,\n bind: (target: PibblAnimationTarget<T>) => PibblAnimationDefinition<T>,\n): PibblAnimationDefinition<T> {\n targetBindings.set(definition, { unbound, bind });\n return definition;\n}\n\n/** @internal Resolves hook-owned endpoints using the definition's implementation. */\nexport function bindAnimationTarget<T>(\n definition: PibblAnimationDefinition<T>,\n target: PibblAnimationTarget<T>,\n): PibblAnimationDefinition<T> {\n const binding = targetBindings.get(definition);\n if (binding) return binding.bind(target);\n getDefinitionRecord(definition);\n return definition;\n}\n\nconst seekableActivationRecords = new WeakMap<\n SeekableDefinitionActivation<unknown>,\n SeekableDefinitionActivationRecord<unknown>\n>();\nlet keyframeDefinitions = 0;\nlet keyframeStorageArrayAllocations = 0;\nlet keyframeSamples = 0;\nlet keyframeSampleArrayAllocations = 0;\nlet keyframeSampleDepth = 0;\n\nexport interface AnimationDefinitionPerformanceSnapshot {\n readonly keyframeDefinitions: number;\n readonly keyframeStorageArrayAllocations: number;\n readonly keyframeSamples: number;\n readonly keyframeSampleArrayAllocations: number;\n}\n\n/** @internal Deterministic structural counters for normalized keyframe sampling. */\nexport function animationDefinitionPerformanceSnapshot():\nAnimationDefinitionPerformanceSnapshot {\n return Object.freeze({\n keyframeDefinitions,\n keyframeStorageArrayAllocations,\n keyframeSamples,\n keyframeSampleArrayAllocations,\n });\n}\n\nfunction definitionLabel(debugName: string | undefined): string {\n return debugName === undefined ? 'Pibbl animation definition' :\n `Pibbl animation definition \"${debugName}\"`;\n}\n\nfunction assertDuration(duration: number, debugName: string | undefined): void {\n if (!Number.isFinite(duration) || duration < 0) {\n throw new RangeError(`${definitionLabel(debugName)} duration must be finite and nonnegative.`);\n }\n}\n\nfunction assertFiniteNumber(value: number, message: string): void {\n if (!Number.isFinite(value)) throw new RangeError(message);\n}\n\nconst MUTATING_MAP_METHODS = new Set<PropertyKey>(['set', 'delete', 'clear']);\nconst MUTATING_SET_METHODS = new Set<PropertyKey>(['add', 'delete', 'clear']);\nconst MUTATING_DATE_METHODS = new Set<PropertyKey>([\n 'setDate', 'setFullYear', 'setHours', 'setMilliseconds', 'setMinutes',\n 'setMonth', 'setSeconds', 'setTime', 'setUTCDate', 'setUTCFullYear',\n 'setUTCHours', 'setUTCMilliseconds', 'setUTCMinutes', 'setUTCMonth',\n 'setUTCSeconds', 'setYear',\n]);\n\nfunction immutableBuiltin<T extends object>(\n target: T,\n mutatingMethods: ReadonlySet<PropertyKey>,\n): T {\n return new Proxy(target, {\n get(current, key) {\n if (mutatingMethods.has(key)) {\n return (): never => {\n throw new TypeError('Cannot mutate an animation definition snapshot.');\n };\n }\n const member = Reflect.get(current, key, current);\n return typeof member === 'function' && key !== 'constructor' ?\n member.bind(current) : member;\n },\n set(): false {\n return false;\n },\n defineProperty(): false {\n return false;\n },\n deleteProperty(): false {\n return false;\n },\n });\n}\n\nfunction rememberIdentity<T extends object>(\n value: T,\n seen: WeakMap<object, unknown>,\n): T {\n seen.set(value, value);\n return value;\n}\n\nfunction hasOwnProperties(value: object, allowed: ReadonlySet<PropertyKey>): boolean {\n return Reflect.ownKeys(value).some(key => !allowed.has(key));\n}\n\nfunction hasOnlyDataProperties(value: object, allowed: ReadonlySet<PropertyKey>): boolean {\n return Reflect.ownKeys(value).every(key => {\n if (allowed.has(key)) return true;\n const descriptor = Object.getOwnPropertyDescriptor(value, key);\n return descriptor !== undefined && 'value' in descriptor;\n });\n}\n\nconst ARRAY_OWN_KEYS = new Set<PropertyKey>(['length']);\nconst REGEXP_OWN_KEYS = new Set<PropertyKey>(['lastIndex']);\nconst snapshotsRequiringIsolation = new WeakSet<object>();\n\nfunction requiresIsolation(value: unknown): value is object {\n return (typeof value === 'object' && value !== null || typeof value === 'function') &&\n snapshotsRequiringIsolation.has(value as object);\n}\n\nfunction propagateIsolation(snapshot: object, value: unknown): void {\n if (requiresIsolation(value)) snapshotsRequiringIsolation.add(snapshot);\n}\n\nfunction isArrayIndex(key: PropertyKey): boolean {\n return typeof key === 'string' && /^(?:0|[1-9]\\d*)$/u.test(key);\n}\n\nfunction cloneTypedArray(\n value: ArrayBufferView,\n buffer?: ArrayBuffer,\n): ArrayBufferView {\n if (value instanceof DataView) {\n if (buffer !== undefined) {\n return new DataView(buffer, value.byteOffset, value.byteLength);\n }\n const bytes = value.buffer.slice(value.byteOffset, value.byteOffset + value.byteLength);\n return new DataView(bytes);\n }\n const TypedArray = value.constructor as unknown as {\n new (source: ArrayBufferView): ArrayBufferView;\n new (buffer: ArrayBuffer, byteOffset: number, length: number): ArrayBufferView;\n };\n return buffer === undefined ? new TypedArray(value) :\n new TypedArray(\n buffer,\n value.byteOffset,\n (value as ArrayBufferView & { readonly length: number }).length,\n );\n}\n\n/**\n * Definitions retain values after their caller has moved on. The context is\n * shared across one definition so aliases and cycles remain aliases and cycles\n * in its immutable snapshot. Only categories with stable, inspectable cloning\n * semantics are copied. Reconstructable values that cannot themselves be\n * frozen are marked so only the containing paths are rematerialized before a\n * callback or terminal return. Functions, classes, accessors, and opaque host\n * values (notably WeakMap, WeakSet, Promise, and host handles) remain usable\n * identity values because cloning them can manufacture an invalid receiver or\n * change their behavior; an absolute snapshot guarantee for those values\n * requires an explicit public clone contract that Pibbl does not currently\n * provide.\n */\nfunction snapshotAnimationValue<T>(\n value: T,\n seen: WeakMap<object, unknown>,\n isolateStoredValue = false,\n): T {\n if (value === null || typeof value === 'function' || typeof value !== 'object') {\n return value;\n }\n const existing = seen.get(value);\n if (existing !== undefined) return existing as T;\n if (isolateStoredValue && !requiresIsolation(value)) {\n seen.set(value, value);\n return value;\n }\n\n if (value instanceof Date) {\n if (hasOwnProperties(value, new Set())) return rememberIdentity(value, seen) as T;\n const snapshot = immutableBuiltin(new Date(value.getTime()), MUTATING_DATE_METHODS);\n seen.set(value, snapshot);\n return snapshot as T;\n }\n if (value instanceof Map) {\n if (hasOwnProperties(value, new Set())) return rememberIdentity(value, seen) as T;\n const target = new Map();\n const snapshot = immutableBuiltin(target, MUTATING_MAP_METHODS);\n seen.set(value, snapshot);\n for (const [key, entry] of value) {\n const keySnapshot = snapshotAnimationValue(key, seen, isolateStoredValue);\n const entrySnapshot = snapshotAnimationValue(entry, seen, isolateStoredValue);\n target.set(keySnapshot, entrySnapshot);\n propagateIsolation(snapshot, keySnapshot);\n propagateIsolation(snapshot, entrySnapshot);\n }\n return snapshot as T;\n }\n if (value instanceof Set) {\n if (hasOwnProperties(value, new Set())) return rememberIdentity(value, seen) as T;\n const target = new Set();\n const snapshot = immutableBuiltin(target, MUTATING_SET_METHODS);\n seen.set(value, snapshot);\n for (const entry of value) {\n const entrySnapshot = snapshotAnimationValue(entry, seen, isolateStoredValue);\n target.add(entrySnapshot);\n propagateIsolation(snapshot, entrySnapshot);\n }\n return snapshot as T;\n }\n if (Array.isArray(value)) {\n const ownKeys = Reflect.ownKeys(value);\n if (Object.getPrototypeOf(value) !== Array.prototype ||\n ownKeys.some(key => !ARRAY_OWN_KEYS.has(key) && !isArrayIndex(key)) ||\n !hasOnlyDataProperties(value, ARRAY_OWN_KEYS)) {\n return rememberIdentity(value, seen) as T;\n }\n const snapshot: unknown[] = new Array(value.length);\n if (keyframeSampleDepth > 0) keyframeSampleArrayAllocations++;\n seen.set(value, snapshot);\n for (const key of ownKeys) {\n if (ARRAY_OWN_KEYS.has(key)) continue;\n const descriptor = Object.getOwnPropertyDescriptor(value, key);\n if (descriptor === undefined || !('value' in descriptor)) continue;\n const itemSnapshot = snapshotAnimationValue(\n descriptor.value,\n seen,\n isolateStoredValue,\n );\n Object.defineProperty(snapshot, key, {\n configurable: false,\n enumerable: descriptor.enumerable,\n writable: false,\n value: itemSnapshot,\n });\n propagateIsolation(snapshot, itemSnapshot);\n }\n return Object.freeze(snapshot) as T;\n }\n\n if (value instanceof RegExp) {\n if (hasOwnProperties(value, REGEXP_OWN_KEYS)) return rememberIdentity(value, seen) as T;\n const snapshot = new RegExp(value.source, value.flags);\n snapshot.lastIndex = value.lastIndex;\n seen.set(value, snapshot);\n snapshotsRequiringIsolation.add(snapshot);\n return snapshot as T;\n }\n\n if (ArrayBuffer.isView(value)) {\n const ownKeys = Reflect.ownKeys(value);\n if (ownKeys.some(key => !isArrayIndex(key))) return rememberIdentity(value, seen) as T;\n const buffer = value.buffer instanceof ArrayBuffer ?\n snapshotAnimationValue(value.buffer, seen, isolateStoredValue) : undefined;\n const snapshot = cloneTypedArray(value, buffer);\n seen.set(value, snapshot);\n snapshotsRequiringIsolation.add(snapshot);\n return snapshot as T;\n }\n\n if (value instanceof ArrayBuffer) {\n const snapshot = value.slice(0);\n seen.set(value, snapshot);\n snapshotsRequiringIsolation.add(snapshot);\n return snapshot as T;\n }\n\n const prototype = Object.getPrototypeOf(value);\n if (prototype !== Object.prototype && prototype !== null ||\n !hasOnlyDataProperties(value, new Set())) {\n return rememberIdentity(value, seen) as T;\n }\n const snapshot = Object.create(prototype) as Record<PropertyKey, unknown>;\n seen.set(value, snapshot);\n for (const key of Reflect.ownKeys(value)) {\n const descriptor = Object.getOwnPropertyDescriptor(value, key);\n if (descriptor === undefined) continue;\n const propertySnapshot = snapshotAnimationValue(\n descriptor.value,\n seen,\n isolateStoredValue,\n );\n Object.defineProperty(snapshot, key, {\n configurable: false,\n enumerable: descriptor.enumerable,\n writable: false,\n value: propertySnapshot,\n });\n propagateIsolation(snapshot, propertySnapshot);\n }\n return Object.freeze(snapshot) as T;\n}\n\nfunction isolateStoredAnimationValue<T>(\n value: T,\n seen: WeakMap<object, unknown>,\n): T {\n return snapshotAnimationValue(value, seen, true);\n}\n\n/** @internal Captures a committed output value for a playback activation. */\nexport function snapshotAnimationActivationValue<T>(\n value: T,\n seen: WeakMap<object, unknown> = new WeakMap(),\n): T {\n return snapshotAnimationValue(value, seen);\n}\n\nfunction validateSampledValue<T>(sampled: T, debugName: string | undefined): T {\n if (typeof sampled === 'number' && !Number.isFinite(sampled)) {\n throw new RangeError(`${definitionLabel(debugName)} sampled value must be finite.`);\n }\n return sampled;\n}\n\nfunction createDefinition<T>(record: DefinitionRecord<T>): PibblAnimationDefinition<T> {\n const definition = Object.freeze({}) as PibblAnimationDefinition<T>;\n definitionRecords.set(\n definition as PibblAnimationDefinition<unknown>,\n Object.freeze(record) as DefinitionRecord<unknown>,\n );\n return definition;\n}\n\nfunction hasOwn(object: object, key: PropertyKey): boolean {\n return Object.prototype.hasOwnProperty.call(object, key);\n}\n\nfunction callback<T>(\n debugName: string | undefined,\n callback: () => T,\n): T {\n return withSignalWriteForbidden(\n `${definitionLabel(debugName)} callbacks cannot write to signals.`,\n callback,\n );\n}\n\nfunction sampledProgress(duration: number, localTime: number): {\n readonly localTime: number;\n readonly progress: number;\n} {\n assertFiniteNumber(localTime, 'Pibbl animation sample localTime must be finite.');\n if (duration === 0) return Object.freeze({ localTime: 0, progress: 1 });\n const normalizedLocalTime = Math.min(duration, Math.max(0, localTime));\n return Object.freeze({\n localTime: normalizedLocalTime,\n progress: normalizedLocalTime / duration,\n });\n}\n\nfunction interpolate<T>(\n from: T,\n to: T,\n progress: number,\n custom: PibblInterpolator<T> | undefined,\n debugName: string | undefined,\n): T {\n if (custom === undefined && (typeof from !== 'number' || typeof to !== 'number')) {\n throw new TypeError(`${definitionLabel(debugName)} requires an explicit interpolator for nonnumeric values.`);\n }\n let sampled: T;\n if (custom === undefined) {\n sampled = ((from as unknown as number) +\n ((to as unknown as number) - (from as unknown as number)) * progress) as T;\n } else {\n const isolated = new WeakMap<object, unknown>();\n const isolatedFrom = isolateStoredAnimationValue(from, isolated);\n const isolatedTo = isolateStoredAnimationValue(to, isolated);\n sampled = callback(debugName, () => custom(isolatedFrom, isolatedTo, progress));\n }\n return validateSampledValue(sampled, debugName);\n}\n\nfunction easedProgress(\n ease: PibblEasing,\n progress: number,\n debugName: string | undefined,\n): number {\n const eased = callback(debugName, () => ease(progress));\n if (!Number.isFinite(eased)) {\n throw new RangeError(`${definitionLabel(debugName)} easing result must be finite.`);\n }\n return eased;\n}\n\nfunction normalizeOffsets(\n values: readonly unknown[],\n offsets: readonly number[] | undefined,\n debugName: string | undefined,\n): readonly number[] {\n if (offsets === undefined) {\n return Object.freeze(values.map((_, index) => index / (values.length - 1)));\n }\n if (offsets.length !== values.length) {\n throw new RangeError(`${definitionLabel(debugName)} keyframe offsets must match the values length.`);\n }\n const snapshot = [...offsets];\n for (const offset of snapshot) {\n if (!Number.isFinite(offset) || offset < 0 || offset > 1) {\n throw new RangeError(`${definitionLabel(debugName)} keyframe offsets must be finite values within [0, 1].`);\n }\n }\n if (snapshot[0] !== 0) {\n throw new RangeError(`${definitionLabel(debugName)} keyframe offsets must start at 0.`);\n }\n if (snapshot.at(-1) !== 1) {\n throw new RangeError(`${definitionLabel(debugName)} keyframe offsets must end at 1.`);\n }\n for (let index = 1; index < snapshot.length; index++) {\n if (snapshot[index] < snapshot[index - 1]) {\n throw new RangeError(`${definitionLabel(debugName)} keyframe offsets must be nondecreasing.`);\n }\n }\n return Object.freeze(snapshot);\n}\n\nfunction normalizeEasings(\n easingOption: PibblEasing | readonly PibblEasing[] | undefined,\n segmentCount: number,\n debugName: string | undefined,\n): readonly PibblEasing[] {\n if (Array.isArray(easingOption)) {\n if (easingOption.length !== segmentCount) {\n throw new RangeError(`${definitionLabel(debugName)} keyframe easing list must have one entry per segment.`);\n }\n if (easingOption.some(ease => typeof ease !== 'function')) {\n throw new TypeError(`${definitionLabel(debugName)} keyframe easings must be functions.`);\n }\n return Object.freeze([...easingOption]);\n }\n const ease = easingOption ?? easing.linear;\n if (typeof ease !== 'function') {\n throw new TypeError(`${definitionLabel(debugName)} easing must be a function.`);\n }\n return Object.freeze(Array.from({ length: segmentCount }, () => ease));\n}\n\n/**\n * Returns an opaque immutable tween definition.\n *\n * @param options - Start and end values, duration, easing, and interpolation settings. See\n * {@link PibblTweenOptions} .\n * @returns An immutable tween definition. See {@link PibblAnimationDefinition}.\n *\n * @see {@link PibblTweenOptions}\n * @see {@link PibblAnimationDefinition}\n */\nexport function tween<T = number>(options: Readonly<PibblTweenOptions<T>>): PibblAnimationDefinition<T> {\n assertDuration(options.duration, options.debugName);\n if (typeof options.easing !== 'undefined' && typeof options.easing !== 'function') {\n throw new TypeError(`${definitionLabel(options.debugName)} easing must be a function.`);\n }\n if (typeof options.interpolate !== 'undefined' && typeof options.interpolate !== 'function') {\n throw new TypeError(`${definitionLabel(options.debugName)} interpolator must be a function.`);\n }\n const hasFrom = hasOwn(options, 'from');\n const snapshots = new WeakMap<object, unknown>();\n const record: TweenDefinitionRecord<T> = {\n kind: 'tween',\n duration: options.duration,\n debugName: options.debugName,\n hasFrom,\n from: hasFrom ? snapshotAnimationValue(options.from as T, snapshots) : undefined,\n to: snapshotAnimationValue(options.to as T, snapshots),\n easing: options.easing ?? easing.linear,\n interpolate: options.interpolate,\n };\n return targetDefinition(createDefinition(record), !hasOwn(options, 'to'), ({ from, to }) =>\n tween({ from, to, duration: record.duration, easing: record.easing,\n interpolate: record.interpolate, debugName: record.debugName }));\n}\n\n/**\n * Returns an opaque immutable keyframe definition.\n *\n * @param options - Keyframe values, timing, easing, and interpolation settings. See\n * {@link PibblKeyframesOptions} .\n * @returns An immutable animation definition sampling the keyframes. See\n * {@link PibblAnimationDefinition} .\n *\n * @see {@link PibblKeyframesOptions}\n * @see {@link PibblAnimationDefinition}\n */\nexport function keyframes<T>(\n options: Readonly<PibblKeyframesOptions<T>>,\n): PibblAnimationDefinition<T> {\n assertDuration(options.duration, options.debugName);\n if (options.values.length < 2) {\n throw new RangeError(`${definitionLabel(options.debugName)} keyframes require at least two values.`);\n }\n if (typeof options.interpolate !== 'undefined' && typeof options.interpolate !== 'function') {\n throw new TypeError(`${definitionLabel(options.debugName)} interpolator must be a function.`);\n }\n const snapshots = new WeakMap<object, unknown>();\n const values = Object.freeze(options.values.map(value => snapshotAnimationValue(value, snapshots)));\n const offsets = normalizeOffsets(values, options.offsets, options.debugName);\n const easings = normalizeEasings(options.easing, values.length - 1, options.debugName);\n keyframeDefinitions++;\n keyframeStorageArrayAllocations += 3;\n return createDefinition({\n kind: 'keyframes',\n duration: options.duration,\n debugName: options.debugName,\n values,\n offsets,\n easings,\n interpolate: options.interpolate,\n });\n}\n\n/**\n * Returns an opaque immutable analytic one-dimensional spring definition.\n *\n * @param options - Target, initial conditions, and spring parameters. See {@link PibblSpringOptions}\n * .\n * @returns An analytic numeric spring definition. See {@link PibblAnimationDefinition}.\n *\n * @see {@link PibblSpringOptions}\n * @see {@link PibblAnimationDefinition}\n */\nexport function spring(\n options: Readonly<PibblSpringOptions> = {},\n): PibblAnimationDefinition<number> {\n const unbound = !hasOwn(options, 'to');\n const record = createSpringRecord({ ...options, to: unbound ? 0 : options.to as number });\n return targetDefinition(createDefinition<number>(record), unbound, ({ from, to, velocity }) =>\n spring({ ...record, from, to, initialVelocity: velocity ?? record.initialVelocity }));\n}\n\n/**\n * Returns an opaque immutable definition from a custom seekable sampler.\n *\n * @param options - Duration and pure sampling callback for the animation. See\n * {@link PibblAnimationOptions} .\n * @returns An immutable, seekable animation definition. See {@link PibblAnimationDefinition}.\n *\n * @see {@link PibblAnimationOptions}\n * @see {@link PibblAnimationDefinition}\n */\nexport function defineAnimation<T>(\n options: Readonly<PibblAnimationOptions<T>>,\n): PibblAnimationDefinition<T> {\n assertDuration(options.duration, options.debugName);\n if (typeof options.sample !== 'function') {\n throw new TypeError(`${definitionLabel(options.debugName)} sample must be a function.`);\n }\n return createDefinition({\n kind: 'custom',\n duration: options.duration,\n debugName: options.debugName,\n sample: options.sample,\n });\n}\n\n/**\n * Returns an opaque immutable stepper definition. Steppers are evaluated by\n * the playback engine, not by the seekable sampler.\n *\n * @param options - Initial state, fixed-step integration, value reader, and completion predicate.\n * See {@link PibblStepperOptions} .\n * @returns A stateful animation definition advanced by fixed simulation steps. See\n * {@link PibblAnimationDefinition} .\n *\n * @see {@link PibblStepperOptions}\n * @see {@link PibblAnimationDefinition}\n */\nexport function stepper<State, T>(\n options: Readonly<PibblStepperOptions<State, T>>,\n): PibblAnimationDefinition<T> {\n if (typeof options.initial !== 'function') {\n throw new TypeError(`${definitionLabel(options.debugName)} stepper initial must be a function.`);\n }\n if (typeof options.step !== 'function') {\n throw new TypeError(`${definitionLabel(options.debugName)} stepper step must be a function.`);\n }\n if (typeof options.read !== 'function') {\n throw new TypeError(`${definitionLabel(options.debugName)} stepper read must be a function.`);\n }\n if (typeof options.done !== 'undefined' && typeof options.done !== 'function') {\n throw new TypeError(`${definitionLabel(options.debugName)} stepper done must be a function.`);\n }\n if (!Number.isFinite(options.stepMilliseconds) || options.stepMilliseconds <= 0) {\n throw new RangeError(`${definitionLabel(options.debugName)} stepper stepMilliseconds must be finite and positive.`);\n }\n const maxElapsedMilliseconds = options.maxElapsedMilliseconds ?? 100;\n if (!Number.isFinite(maxElapsedMilliseconds) || maxElapsedMilliseconds <= 0) {\n throw new RangeError(`${definitionLabel(options.debugName)} stepper maxElapsedMilliseconds must be finite and positive.`);\n }\n return createDefinition({\n kind: 'stepper',\n duration: Number.POSITIVE_INFINITY,\n debugName: options.debugName,\n stepMilliseconds: options.stepMilliseconds,\n maxElapsedMilliseconds,\n initial: options.initial as (currentValue: T) => unknown,\n step: options.step as (state: unknown, deltaMilliseconds: number) => unknown,\n read: options.read as (state: unknown) => T,\n done: options.done as ((state: unknown) => boolean) | undefined,\n });\n}\n\n/** @internal Returns the private immutable record associated with a definition. */\nexport function getDefinitionRecord<T>(\n definition: PibblAnimationDefinition<T>,\n): DefinitionRecord<T> {\n if (targetBindings.get(definition)?.unbound) {\n throw new TypeError('Animation definition needs a target: supply to for drive(), or pass it to useAnimatedValue().');\n }\n const record = definitionRecords.get(definition as PibblAnimationDefinition<unknown>);\n if (record === undefined) throw new TypeError('Expected a Pibbl animation definition.');\n return record as DefinitionRecord<T>;\n}\n\n/** @internal Samples a non-stepper definition from its activation snapshot. */\nexport function sampleSeekableDefinition<T>(\n definition: PibblAnimationDefinition<T>,\n input: Readonly<Pick<PibblAnimationSampleInput<T>, 'initialValue' | 'localTime'>>,\n): T {\n const record = getDefinitionRecord(definition);\n if (record.kind === 'stepper') {\n throw new TypeError(\n `${definitionLabel(record.debugName)} is stateful and requires the stateful program evaluator.`,\n );\n }\n if (record.kind === 'spring') {\n const resolved = resolveSpringStart(record, input.initialValue as number);\n const timing = sampledProgress(resolved.duration, input.localTime);\n return sampleSpring(resolved, timing.localTime / 1000).position as T;\n }\n const timing = sampledProgress(record.duration, input.localTime);\n if (record.kind === 'custom') {\n const sampled = callback(record.debugName, () => record.sample(Object.freeze({\n initialValue: input.initialValue,\n localTime: timing.localTime,\n progress: timing.progress,\n })));\n return validateSampledValue(sampled, record.debugName);\n }\n if (record.kind === 'tween') {\n const from = record.hasFrom ? record.from as T : input.initialValue;\n return interpolate(\n from,\n record.to,\n easedProgress(record.easing, timing.progress, record.debugName),\n record.interpolate,\n record.debugName,\n );\n }\n\n keyframeSamples++;\n keyframeSampleDepth++;\n try {\n return sampleKeyframe(record, timing);\n } finally {\n keyframeSampleDepth--;\n }\n}\n\nfunction sampleKeyframe<T>(\n record: KeyframesDefinitionRecord<T>,\n timing: { readonly progress: number },\n): T {\n let segment = 0;\n for (let index = 1; index < record.offsets.length; index++) {\n if (record.offsets[index] <= timing.progress) segment = index;\n else break;\n }\n if (segment === record.values.length - 1) {\n return validateSampledValue(\n isolateStoredAnimationValue(record.values[segment], new WeakMap()),\n record.debugName,\n );\n }\n const start = record.offsets[segment];\n const end = record.offsets[segment + 1];\n return interpolate(\n record.values[segment],\n record.values[segment + 1],\n easedProgress(record.easings[segment], (timing.progress - start) / (end - start), record.debugName),\n record.interpolate,\n record.debugName,\n );\n}\n\n/**\n * @internal Resolves activation-dependent definition data exactly once for a\n * track instance. Stateful definitions use a separate playback-owned record.\n */\nexport function activateSeekableDefinition<T>(\n definition: PibblAnimationDefinition<T>,\n initialValue: T,\n seen: WeakMap<object, unknown> = new WeakMap(),\n): SeekableDefinitionActivation<T> {\n const definitionRecord = getDefinitionRecord(definition);\n if (definitionRecord.kind === 'stepper') {\n throw new TypeError(\n 'Stateful animation definitions require the stateful program evaluator.',\n );\n }\n const snapshot = snapshotAnimationActivationValue(initialValue, seen);\n const resolved = definitionRecord.kind === 'spring' ?\n resolveSpringStart(definitionRecord, snapshot as number) : definitionRecord;\n const activation = Object.freeze({\n duration: resolved.duration,\n initialValue: snapshot,\n }) as SeekableDefinitionActivation<T>;\n seekableActivationRecords.set(\n activation as SeekableDefinitionActivation<unknown>,\n Object.freeze({\n definition,\n definitionRecord: resolved,\n initialValue: snapshot,\n }) as SeekableDefinitionActivationRecord<unknown>,\n );\n return activation;\n}\n\n/** @internal Samples a definition from one retained activation record. */\nexport function sampleActivatedSeekableDefinition<T>(\n activation: SeekableDefinitionActivation<T>,\n localTime: number,\n): T {\n const activationRecord = seekableActivationRecords.get(\n activation as SeekableDefinitionActivation<unknown>,\n ) as SeekableDefinitionActivationRecord<T> | undefined;\n if (activationRecord === undefined) {\n throw new TypeError('Expected a seekable Pibbl animation definition activation.');\n }\n const record = activationRecord.definitionRecord;\n if (record.kind === 'spring') {\n const timing = sampledProgress(record.duration, localTime);\n return sampleSpring(record, timing.localTime / 1000).position as T;\n }\n return sampleSeekableDefinition(activationRecord.definition, {\n initialValue: activationRecord.initialValue,\n localTime,\n });\n}\n\n/**\n * @internal Returns a boundary value only when the normalized definition makes\n * it exact without invoking user easing, interpolation, or sampling callbacks.\n */\nexport function getSeekableDefinitionBoundaryValue<T>(\n activation: SeekableDefinitionActivation<T>,\n boundary: 'start' | 'end',\n): SeekableDefinitionBoundaryValue<T> {\n const activationRecord = seekableActivationRecords.get(\n activation as SeekableDefinitionActivation<unknown>,\n ) as SeekableDefinitionActivationRecord<T> | undefined;\n if (activationRecord === undefined) {\n throw new TypeError('Expected a seekable Pibbl animation definition activation.');\n }\n const record = activationRecord.definitionRecord;\n if (record.kind === 'spring') {\n return Object.freeze({\n kind: 'known' as const,\n value: (boundary === 'start' ? record.from : record.to) as T,\n });\n }\n if (record.kind === 'keyframes') {\n if (boundary === 'end') {\n return Object.freeze({ kind: 'known' as const, value: record.values.at(-1)! });\n }\n if (record.interpolate === undefined && record.easings[0] === easing.linear) {\n return Object.freeze({ kind: 'known' as const, value: record.values[0]! });\n }\n return Object.freeze({ kind: 'unknown' as const });\n }\n if (record.kind === 'tween' && record.interpolate === undefined &&\n record.easing === easing.linear) {\n return Object.freeze({\n kind: 'known' as const,\n value: boundary === 'start' ?\n (record.hasFrom ? record.from as T : activationRecord.initialValue) : record.to,\n });\n }\n return Object.freeze({ kind: 'unknown' as const });\n}\n\n/**\n * @internal Returns a callback-free boundary that does not depend on a track's\n * activation value. This lets discovery recover known terminal state after an\n * earlier opaque custom value.\n */\nexport function getStaticSeekableDefinitionBoundaryValue<T>(\n definition: PibblAnimationDefinition<T>,\n boundary: 'start' | 'end',\n): SeekableDefinitionBoundaryValue<T> {\n const record = getDefinitionRecord(definition);\n if (record.kind === 'spring' && record.hasFrom) {\n return Object.freeze({\n kind: 'known' as const,\n value: (boundary === 'start' ? record.from : record.to) as T,\n });\n }\n if (record.kind === 'keyframes') {\n if (boundary === 'end') {\n return Object.freeze({ kind: 'known' as const, value: record.values.at(-1)! });\n }\n if (record.interpolate === undefined && record.easings[0] === easing.linear) {\n return Object.freeze({ kind: 'known' as const, value: record.values[0]! });\n }\n }\n if (record.kind === 'tween' && record.interpolate === undefined &&\n record.easing === easing.linear) {\n if (boundary === 'end') {\n return Object.freeze({ kind: 'known' as const, value: record.to });\n }\n if (record.hasFrom) {\n return Object.freeze({ kind: 'known' as const, value: record.from as T });\n }\n }\n return Object.freeze({ kind: 'unknown' as const });\n}\n"],
5
+ "mappings": "AAAA,SAAS,gCAAgC;AACzC,SAAS,cAAc;AACvB;AAAA,EACE;AAAA,EACA;AAAA,EACA;AAAA,OAEK;AA8EP,MAAM,oBAAoB,oBAAI,QAG5B;AAEF,MAAM,iBAAiB,oBAAI,QAGxB;AAEH,SAAS,iBACP,YACA,SACA,MAC6B;AAC7B,iBAAe,IAAI,YAAY,EAAE,SAAS,KAAK,CAAC;AAChD,SAAO;AACT;AAGO,SAAS,oBACd,YACA,QAC6B;AAC7B,QAAM,UAAU,eAAe,IAAI,UAAU;AAC7C,MAAI,QAAS,QAAO,QAAQ,KAAK,MAAM;AACvC,sBAAoB,UAAU;AAC9B,SAAO;AACT;AAEA,MAAM,4BAA4B,oBAAI,QAGpC;AACF,IAAI,sBAAsB;AAC1B,IAAI,kCAAkC;AACtC,IAAI,kBAAkB;AACtB,IAAI,iCAAiC;AACrC,IAAI,sBAAsB;AAUnB,SAAS,yCACuB;AACrC,SAAO,OAAO,OAAO;AAAA,IACnB;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,EACF,CAAC;AACH;AAEA,SAAS,gBAAgB,WAAuC;AAC9D,SAAO,cAAc,SAAY,+BAC/B,+BAA+B,SAAS;AAC5C;AAEA,SAAS,eAAe,UAAkB,WAAqC;AAC7E,MAAI,CAAC,OAAO,SAAS,QAAQ,KAAK,WAAW,GAAG;AAC9C,UAAM,IAAI,WAAW,GAAG,gBAAgB,SAAS,CAAC,2CAA2C;AAAA,EAC/F;AACF;AAEA,SAAS,mBAAmB,OAAe,SAAuB;AAChE,MAAI,CAAC,OAAO,SAAS,KAAK,EAAG,OAAM,IAAI,WAAW,OAAO;AAC3D;AAEA,MAAM,uBAAuB,oBAAI,IAAiB,CAAC,OAAO,UAAU,OAAO,CAAC;AAC5E,MAAM,uBAAuB,oBAAI,IAAiB,CAA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