@algorisys/tinyfly 0.111.0 → 0.112.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,12 +1,12 @@
1
- import { e as we, A as bt, R as ce, B as Pe, D as Xt, E as on, F as at, G as ta, H as ye, I as oa, d as zo, s as nn, a as na, r as sa, b as Gs, c as sn, J as Ys, K as ra, p as aa, L as ia, M as _e, N as la, O as Ke, n as Us, P as Xs, Q as Pn, T as ha, U as xe, V as Le, W as Oe, X as ca, Y as da, Z as fa, _ as Vs, $ as Ae, a0 as $e, a1 as Js, a2 as ua, a3 as Lo, a4 as je, a5 as Zs, a6 as ga, a7 as pa, a8 as Qs, a9 as ma, aa as ya, ab as ba, ac as wa, ad as ka, u as va, h as Sa, j as Ma, g as $a, C as Ea, l as Aa, ae as Ta, af as Pa, ag as Oa, ah as Ha, ai as Ia, aj as xa, ak as ja } from "./cricket-markings-KbMjP7r6.js";
2
- import { al as vf, am as Sf, an as Mf, ao as $f, S as Ef, ap as Af, aq as Tf, ar as Pf, as as Of, at as Hf, au as If, av as xf, aw as jf, ax as _f, ay as Kf, az as Nf, aA as Cf, aB as Wf, aC as Rf, aD as zf, aE as Lf, aF as Ff, aG as Df, aH as qf, aI as Bf, aJ as Gf, aK as Yf, aL as Uf, aM as Xf, aN as Vf, aO as Jf, aP as Zf, aQ as Qf, aR as eu, aS as tu, o as ou, aT as nu, aU as su, aV as ru, aW as au, aX as iu, aY as lu, aZ as hu, a_ as cu, a$ as du, b0 as fu, b1 as uu, b2 as gu, b3 as pu, b4 as mu, b5 as yu, b6 as bu, b7 as wu, b8 as ku, b9 as vu, ba as Su, bb as Mu, bc as $u, bd as Eu } from "./cricket-markings-KbMjP7r6.js";
3
- import { getEasingFunction as mt, hashSeed as Fe, mat4 as ne, vec3 as ke, quat as Re, Timeline as ve, unknownName as fe, createRandom as rn, springFollow as Bt, closestName as Fo } from "@algorisys/tinyfly";
4
- import { f as Vt, h as _a, a as er } from "./load-scene-oWNsYYC1.js";
1
+ import { H as we, w as bt, R as ce, x as Pe, y as Xt, z as on, A as at, B as ta, D as ye, E as oa, F as zo, G as nn, I as na, J as sa, K as Gs, L as sn, M as Ys, N as ra, O as aa, P as ia, Q as _e, S as la, T as Ke, U as Us, V as Xs, W as Pn, X as ha, Y as xe, Z as Le, _ as Oe, $ as ca, a0 as da, a1 as fa, a2 as Vs, a3 as Ae, a4 as $e, a5 as Js, a6 as ua, a7 as Lo, a8 as je, a9 as Zs, aa as ga, ab as pa, ac as Qs, ad as ma, ae as ya, af as ba, ag as wa, ah as ka, h as va, g as Sa, i as Ma, e as $a, c as Ea, b as Aa, d as Ta, C as Pa, ai as Oa, aj as Ha, ak as Ia, al as xa, am as ja, an as _a, ao as Ka } from "./cricket-play-Zm5cghdV.js";
2
+ import { ap as Mf, aq as $f, ar as Ef, as as Af, at as Tf, au as Pf, av as Of, aw as Hf, ax as If, ay as xf, az as jf, aA as _f, aB as Kf, aC as Nf, aD as Cf, aE as Rf, aF as Wf, aG as zf, aH as Lf, aI as Ff, aJ as Df, aK as qf, aL as Bf, aM as Gf, aN as Yf, aO as Uf, aP as Xf, aQ as Vf, aR as Jf, aS as Zf, aT as Qf, aU as eu, aV as tu, aW as ou, aX as nu, aY as su, aZ as ru, a_ as au, a$ as iu, b0 as lu, b1 as hu, b2 as cu, b3 as du, b4 as fu, b5 as uu, b6 as gu, b7 as pu, b8 as mu, b9 as yu, ba as bu, bb as wu, bc as ku, bd as vu, be as Su, bf as Mu, bg as $u, bh as Eu, bi as Au, bj as Tu } from "./cricket-play-Zm5cghdV.js";
3
+ import { getEasingFunction as mt, hashSeed as Fe, mat4 as ne, vec3 as ke, quat as We, Timeline as ve, unknownName as fe, createRandom as rn, springFollow as Bt, closestName as Fo } from "@algorisys/tinyfly";
4
+ import { f as Vt, h as Na, a as er } from "./load-scene-oWNsYYC1.js";
5
5
  import { l as tr, f as or } from "./shading-0lPgnXmD.js";
6
- import { s as Ka, p as nr, b as an } from "./sketch-CYPUbk3Q.js";
7
- import { c as Tu, a as Pu } from "./sketch-CYPUbk3Q.js";
8
- import { C as Na } from "./target-properties-BtN9skb-.js";
9
- import { I as Hu, a as Iu, b as xu, c as ju, d as _u, e as Ku, f as Nu } from "./target-properties-BtN9skb-.js";
6
+ import { s as Ca, p as nr, b as an } from "./sketch-CYPUbk3Q.js";
7
+ import { c as Ou, a as Hu } from "./sketch-CYPUbk3Q.js";
8
+ import { C as Ra } from "./target-properties-BtN9skb-.js";
9
+ import { I as xu, a as ju, b as _u, c as Ku, d as Nu, e as Cu, f as Ru } from "./target-properties-BtN9skb-.js";
10
10
  const bo = 0.5, Do = {
11
11
  /** Flag: fingers together and straight, thumb bent in */
12
12
  pataka: bt({ "thumb.curl": 0.3, "thumb.across": 0.6, "index.curl": 0, "middle.curl": 0, "ring.curl": 0, "pinky.curl": 0, spread: 0, turn: 2 }),
@@ -41,7 +41,7 @@ function sr(e, t, o) {
41
41
  return n;
42
42
  }
43
43
  const ln = (e, t) => (e % t + t) % t;
44
- function Ca(e, t, o, n) {
44
+ function Wa(e, t, o, n) {
45
45
  const a = sr(e, o, n);
46
46
  if (a.length === 0) return { pose: o, hands: n };
47
47
  const r = ln(t, e.beats);
@@ -53,7 +53,7 @@ function Ca(e, t, o, n) {
53
53
  hands: { left: Xt(i.left, h.left, f), right: Xt(i.right, h.right, f) }
54
54
  };
55
55
  }
56
- const Wa = [
56
+ const za = [
57
57
  ["leftShoulder", "rightShoulder"],
58
58
  ["leftElbow", "rightElbow"],
59
59
  ["leftWrist", "rightWrist"],
@@ -63,19 +63,19 @@ const Wa = [
63
63
  ["leftFootOut", "rightFootOut"],
64
64
  ["leftEye", "rightEye"],
65
65
  ["leftBrow", "rightBrow"]
66
- ], Ra = ["lean", "headTilt", "lookX", "spin"], za = /* @__PURE__ */ new Set(["leftShoulder", "rightShoulder", "leftElbow", "rightElbow", "leftWrist", "rightWrist", "leftHip", "rightHip", "leftKnee", "rightKnee"]);
67
- function La(e) {
66
+ ], La = ["lean", "headTilt", "lookX", "spin"], Fa = /* @__PURE__ */ new Set(["leftShoulder", "rightShoulder", "leftElbow", "rightElbow", "leftWrist", "rightWrist", "leftHip", "rightHip", "leftKnee", "rightKnee"]);
67
+ function Da(e) {
68
68
  const t = { ...e }, o = (e.turn ?? 0) >= 0.5;
69
- for (const [n, a] of Wa) {
70
- const r = o && za.has(n) ? -1 : 1;
69
+ for (const [n, a] of za) {
70
+ const r = o && Fa.has(n) ? -1 : 1;
71
71
  t[n] = r * e[a], t[a] = r * e[n];
72
72
  }
73
- if (!o) for (const n of Ra) t[n] = -e[n];
73
+ if (!o) for (const n of La) t[n] = -e[n];
74
74
  return t;
75
75
  }
76
- const Fa = (e) => Math.min(1, Math.max(-1, (0.5 - e) * 4));
77
- function Da(e, t, o) {
78
- const n = ln(o, 1), a = (1 + Math.cos(2 * Math.PI * n)) / 2, r = t.bounce * (t.accent === "up" ? 1 - a : a), s = Math.min(1, Math.max(0, e.turn ?? 0)), i = Fa(s);
76
+ const qa = (e) => Math.min(1, Math.max(-1, (0.5 - e) * 4));
77
+ function Ba(e, t, o) {
78
+ const n = ln(o, 1), a = (1 + Math.cos(2 * Math.PI * n)) / 2, r = t.bounce * (t.accent === "up" ? 1 - a : a), s = Math.min(1, Math.max(0, e.turn ?? 0)), i = qa(s);
79
79
  return {
80
80
  ...e,
81
81
  leftHip: e.leftHip + i * r / 2,
@@ -98,8 +98,8 @@ function rr(e) {
98
98
  function wo(e, t, o) {
99
99
  const n = e.moves[t.move];
100
100
  if (!n) throw new Error(`dance: "${e.label}" has no move "${t.move}"`);
101
- const a = Ca(n, o, qo(e), rr(e));
102
- return t.mirror ? { pose: La(a.pose), hands: { left: a.hands?.right, right: a.hands?.left } } : a;
101
+ const a = Wa(n, o, qo(e), rr(e));
102
+ return t.mirror ? { pose: Da(a.pose), hands: { left: a.hands?.right, right: a.hands?.left } } : a;
103
103
  }
104
104
  function hn(e, t, o = {}) {
105
105
  const n = typeof e == "string" ? Je[e] : e;
@@ -119,24 +119,24 @@ function hn(e, t, o = {}) {
119
119
  };
120
120
  }
121
121
  }
122
- return { ...a, pose: Da(a.pose, n.groove, t) };
122
+ return { ...a, pose: Ba(a.pose, n.groove, t) };
123
123
  }
124
- function md(e, t, o = {}) {
124
+ function bd(e, t, o = {}) {
125
125
  return hn(e, t, o).pose;
126
126
  }
127
127
  function cn(e) {
128
128
  return (typeof e == "string" ? Je[e] : e).routine.reduce((o, n) => o + n.beats, 0);
129
129
  }
130
- const qa = { leftToe: "rightToe", rightToe: "leftToe", leftHeel: "rightHeel", rightHeel: "leftHeel" };
130
+ const Ga = { leftToe: "rightToe", rightToe: "leftToe", leftHeel: "rightHeel", rightHeel: "leftHeel" };
131
131
  function On(e, t, o, n, a, r, s) {
132
132
  for (let i = 0; i * e.beats < o; i++)
133
133
  for (const h of e.keys) {
134
134
  const c = i * e.beats + h.beat, l = t + c;
135
135
  if (!(c >= o || l < r || l >= s))
136
- for (const d of h.taps ?? []) a.push({ beat: l, tap: n ? qa[d] : d });
136
+ for (const d of h.taps ?? []) a.push({ beat: l, tap: n ? Ga[d] : d });
137
137
  }
138
138
  }
139
- function yd(e, t, o, n = {}) {
139
+ function wd(e, t, o, n = {}) {
140
140
  const a = typeof e == "string" ? Je[e] : e, r = [];
141
141
  if (o <= t) return r;
142
142
  if (n.move) {
@@ -170,18 +170,18 @@ function ko(e, t, o = {}) {
170
170
  }
171
171
  return h;
172
172
  }
173
- function Ba(e, t, o) {
173
+ function Ya(e, t, o) {
174
174
  const n = ar(e, o), a = [0];
175
175
  let r = 0;
176
176
  for (let s = 0; r < t; s = (s + 1) % n.length)
177
177
  r += n[s].beats, a.push(Math.min(r, t));
178
178
  return a;
179
179
  }
180
- const Ga = 8;
181
- function Ya(e, t, o) {
182
- const n = typeof t == "string" ? Je[t] : t, a = o.bpm ?? n.bpm, r = o.beats ?? (o.move ? n.moves[o.move].beats : cn(n)), s = Ba(n, r, o);
180
+ const Ua = 8;
181
+ function Xa(e, t, o) {
182
+ const n = typeof t == "string" ? Je[t] : t, a = o.bpm ?? n.bpm, r = o.beats ?? (o.move ? n.moves[o.move].beats : cn(n)), s = Ya(n, r, o);
183
183
  if (s.every((T) => ko(n, T, o) === 0)) return;
184
- const i = Math.min(o.fade ?? 1, r / 2), h = mt("ease-in-out"), c = (T) => i <= 0 ? 1 : Math.min(h(Math.min(1, T / i)), h(Math.min(1, (r - T) / i))), l = Math.ceil(i * Ga), d = i <= 0 ? [] : Array.from({ length: l + 1 }, (T, H) => [H / l * i, r - H / l * i]).flat(), f = [.../* @__PURE__ */ new Set([...s, ...d])].sort((T, H) => T - H);
184
+ const i = Math.min(o.fade ?? 1, r / 2), h = mt("ease-in-out"), c = (T) => i <= 0 ? 1 : Math.min(h(Math.min(1, T / i)), h(Math.min(1, (r - T) / i))), l = Math.ceil(i * Ua), d = i <= 0 ? [] : Array.from({ length: l + 1 }, (T, H) => [H / l * i, r - H / l * i]).flat(), f = [.../* @__PURE__ */ new Set([...s, ...d])].sort((T, H) => T - H);
185
185
  let u = 0;
186
186
  const p = f.map((T, H) => {
187
187
  if (H > 0) {
@@ -200,13 +200,13 @@ function Ya(e, t, o) {
200
200
  keyframes: p.map((T) => ({ time: g + T.beat * 6e4 / a, value: b + o.height * T.travel, easing: "linear" }))
201
201
  };
202
202
  }
203
- function bd(e, t, o = 0) {
203
+ function kd(e, t, o = 0) {
204
204
  return (e - o) * t / 6e4;
205
205
  }
206
- function wd(e, t = {}) {
206
+ function vd(e, t = {}) {
207
207
  return (o) => hn(e, o, t);
208
208
  }
209
- function kd(e, t) {
209
+ function Sd(e, t) {
210
210
  const o = t.start ?? 0, n = 6e4 / t.bpm, a = o + t.beats * n, r = Math.min((t.fade ?? 1) * n, (a - o) / 2);
211
211
  return [
212
212
  {
@@ -231,7 +231,7 @@ function kd(e, t) {
231
231
  }
232
232
  ];
233
233
  }
234
- function vd(e, t, o = {}) {
234
+ function Md(e, t, o = {}) {
235
235
  const n = typeof t == "string" ? Je[t] : t, a = o.bpm ?? n.bpm, r = o.beats ?? (o.move ? n.moves[o.move].beats : cn(n)), s = o.samplesPerBeat ?? 4, i = o.start ?? 0, h = Math.round(r * s), c = Array.from({ length: h + 1 }, (g, b) => {
236
236
  const T = b / s;
237
237
  return { time: i + T * 6e4 / a, frame: hn(n, T, o) };
@@ -240,7 +240,7 @@ function vd(e, t, o = {}) {
240
240
  target: e,
241
241
  property: g,
242
242
  keyframes: c.map((T) => ({ time: T.time, value: b(T.frame) }))
243
- }), f = Object.keys(ce).filter((g) => c.some((b) => b.frame.pose[g] !== c[0].frame.pose[g]) || c[0].frame.pose[g] !== ce[g]).map((g) => l(g, (b) => b.pose[g])), u = o.height === void 0 ? void 0 : Ya(e, n, { ...o, bpm: a, beats: r, start: i, height: o.height, fade: 0 });
243
+ }), f = Object.keys(ce).filter((g) => c.some((b) => b.frame.pose[g] !== c[0].frame.pose[g]) || c[0].frame.pose[g] !== ce[g]).map((g) => l(g, (b) => b.pose[g])), u = o.height === void 0 ? void 0 : Xa(e, n, { ...o, bpm: a, beats: r, start: i, height: o.height, fade: 0 });
244
244
  if (u && f.push(u), o.hands === !1) return f;
245
245
  const p = [];
246
246
  for (const g of ["left", "right"])
@@ -250,7 +250,7 @@ function vd(e, t, o = {}) {
250
250
  }
251
251
  return [...f, ...p];
252
252
  }
253
- const $t = { type: "back", mode: "out", overshoot: 1.1 }, Se = "ease-out-cubic", Ua = {
253
+ const $t = { type: "back", mode: "out", overshoot: 1.1 }, Se = "ease-out-cubic", Va = {
254
254
  label: "Disco",
255
255
  bpm: 120,
256
256
  stance: { leftHip: 10, rightHip: 10, leftKnee: 6, rightKnee: 6 },
@@ -298,7 +298,7 @@ const $t = { type: "back", mode: "out", overshoot: 1.1 }, Se = "ease-out-cubic",
298
298
  { move: "point", beats: 8, mirror: !0 },
299
299
  { move: "bump", beats: 8 }
300
300
  ]
301
- }, Xa = {
301
+ }, Ja = {
302
302
  label: "Hip hop",
303
303
  bpm: 95,
304
304
  stance: { leftHip: 14, rightHip: 14, leftKnee: 20, rightKnee: 20, leftShoulder: 22, rightShoulder: 22, leftElbow: -30, rightElbow: -30, leftFootOut: 0.15, rightFootOut: 0.15 },
@@ -350,7 +350,7 @@ const $t = { type: "back", mode: "out", overshoot: 1.1 }, Se = "ease-out-cubic",
350
350
  { move: "armWave", beats: 8 },
351
351
  { move: "bounce", beats: 4 }
352
352
  ]
353
- }, Va = {
353
+ }, Za = {
354
354
  label: "Breaking (toprock)",
355
355
  bpm: 110,
356
356
  stance: { leftHip: 14, rightHip: 14, leftKnee: 14, rightKnee: 14, leftShoulder: 35, rightShoulder: 35, leftElbow: -90, rightElbow: -90 },
@@ -392,7 +392,7 @@ const $t = { type: "back", mode: "out", overshoot: 1.1 }, Se = "ease-out-cubic",
392
392
  { move: "kick", beats: 4, mirror: !0 },
393
393
  { move: "freeze", beats: 4 }
394
394
  ]
395
- }, Ja = {
395
+ }, Qa = {
396
396
  label: "Jazz",
397
397
  bpm: 130,
398
398
  stance: { leftHip: 10, rightHip: 10 },
@@ -453,7 +453,7 @@ const $t = { type: "back", mode: "out", overshoot: 1.1 }, Se = "ease-out-cubic",
453
453
  { move: "jazzHands", beats: 4 },
454
454
  { move: "splitDrop", beats: 8 }
455
455
  ]
456
- }, Za = {
456
+ }, ei = {
457
457
  label: "K-pop",
458
458
  bpm: 125,
459
459
  stance: { leftHip: 9, rightHip: 9, leftKnee: 4, rightKnee: 4 },
@@ -500,7 +500,7 @@ const $t = { type: "back", mode: "out", overshoot: 1.1 }, Se = "ease-out-cubic",
500
500
  { move: "pointCombo", beats: 8, mirror: !0 },
501
501
  { move: "isolations", beats: 4 }
502
502
  ]
503
- }, Qa = {
503
+ }, ti = {
504
504
  label: "Bollywood",
505
505
  bpm: 120,
506
506
  stance: { leftHip: 10, rightHip: 10 },
@@ -545,7 +545,7 @@ const $t = { type: "back", mode: "out", overshoot: 1.1 }, Se = "ease-out-cubic",
545
545
  { move: "thumka", beats: 4, mirror: !0 },
546
546
  { move: "lightBulb", beats: 8, mirror: !0 }
547
547
  ]
548
- }, ei = {
548
+ }, oi = {
549
549
  label: "Bhangra",
550
550
  bpm: 100,
551
551
  stance: { leftShoulder: 150, rightShoulder: 150, leftElbow: 18, rightElbow: 18, leftHip: 10, rightHip: 10 },
@@ -580,11 +580,11 @@ const $t = { type: "back", mode: "out", overshoot: 1.1 }, Se = "ease-out-cubic",
580
580
  { move: "basic", beats: 8 },
581
581
  { move: "dhamaal", beats: 4 }
582
582
  ]
583
- }, ti = { leftHip: 42, rightHip: 42, leftKnee: 82, rightKnee: 82, leftFootOut: 0.3, rightFootOut: 0.3 }, oi = {
583
+ }, ni = { leftHip: 42, rightHip: 42, leftKnee: 82, rightKnee: 82, leftFootOut: 0.3, rightFootOut: 0.3 }, si = {
584
584
  label: "Bharatanatyam",
585
585
  bpm: 80,
586
586
  // Natyarambhe: arms out at shoulder height, hands raised in pataka.
587
- stance: { ...ti, leftShoulder: 90, rightShoulder: 90, leftElbow: 0, rightElbow: 0, leftWrist: 75, rightWrist: 75 },
587
+ stance: { ...ni, leftShoulder: 90, rightShoulder: 90, leftElbow: 0, rightElbow: 0, leftWrist: 75, rightWrist: 75 },
588
588
  expression: { smile: 0.5, leftEye: 1.2, rightEye: 1.2, leftBrow: 0.3, rightBrow: 0.3 },
589
589
  hands: { left: "pataka", right: "pataka" },
590
590
  groove: { bounce: 0 },
@@ -626,7 +626,7 @@ const $t = { type: "back", mode: "out", overshoot: 1.1 }, Se = "ease-out-cubic",
626
626
  { move: "alapadma", beats: 8 },
627
627
  { move: "tatta", beats: 4 }
628
628
  ]
629
- }, ni = {
629
+ }, ri = {
630
630
  label: "Charleston",
631
631
  bpm: 150,
632
632
  stance: { leftHip: 10, rightHip: 10, leftKnee: 10, rightKnee: 10, leftShoulder: 30, rightShoulder: 30, leftElbow: 20, rightElbow: 20 },
@@ -676,7 +676,7 @@ const $t = { type: "back", mode: "out", overshoot: 1.1 }, Se = "ease-out-cubic",
676
676
  { move: "basic", beats: 8, mirror: !0 },
677
677
  { move: "twist", beats: 4 }
678
678
  ]
679
- }, si = {
679
+ }, ai = {
680
680
  label: "Tap",
681
681
  bpm: 120,
682
682
  // Three-quarters to side-on, so shuffles read as brushes forward and back. Side-on,
@@ -774,7 +774,7 @@ const $t = { type: "back", mode: "out", overshoot: 1.1 }, Se = "ease-out-cubic",
774
774
  { move: "heelToe", beats: 8 },
775
775
  { move: "crampRoll", beats: 4 }
776
776
  ]
777
- }, ri = {
777
+ }, ii = {
778
778
  label: "Popping (glides, moonwalk)",
779
779
  bpm: 100,
780
780
  stance: { leftHip: 9, rightHip: 9, leftShoulder: 16, rightShoulder: 16, leftElbow: -24, rightElbow: -24 },
@@ -848,18 +848,18 @@ const $t = { type: "back", mode: "out", overshoot: 1.1 }, Se = "ease-out-cubic",
848
848
  { move: "toeStand", beats: 4 }
849
849
  ]
850
850
  }, Je = {
851
- disco: Ua,
852
- hipHop: Xa,
853
- breaking: Va,
854
- jazz: Ja,
855
- kpop: Za,
856
- bollywood: Qa,
857
- bhangra: ei,
858
- bharatanatyam: oi,
859
- charleston: ni,
860
- tap: si,
861
- popping: ri
862
- }, it = (e, t) => (e % t + t) % t, In = (e) => e * e * (3 - 2 * e), ai = (e) => Object.fromEntries(
851
+ disco: Va,
852
+ hipHop: Ja,
853
+ breaking: Za,
854
+ jazz: Qa,
855
+ kpop: ei,
856
+ bollywood: ti,
857
+ bhangra: oi,
858
+ bharatanatyam: si,
859
+ charleston: ri,
860
+ tap: ai,
861
+ popping: ii
862
+ }, it = (e, t) => (e % t + t) % t, In = (e) => e * e * (3 - 2 * e), li = (e) => Object.fromEntries(
863
863
  ["left", "right"].flatMap((t) => Object.entries(we[e]).map(([o, n]) => [`hand.${t}.${o}`, n]))
864
864
  );
865
865
  function vo(e, t = !1) {
@@ -885,7 +885,7 @@ function vo(e, t = !1) {
885
885
  "arm.left.bend": -35 * f,
886
886
  "arm.right.bend": -35 * f,
887
887
  smile: 0.9,
888
- ...ai(t ? "hold" : "spread")
888
+ ...li(t ? "hold" : "spread")
889
889
  };
890
890
  if (!t)
891
891
  for (const p of Object.keys(a)) p.startsWith("arm.") && (u[p] += (a[p] - u[p]) * f);
@@ -917,7 +917,7 @@ function Zt(e, t, o = ye) {
917
917
  const f = Math.floor(t), u = t - f, p = u <= 0.6 ? 1 : 1 - In((u - 0.6) / 0.4), g = Math.max(0, ...n.strikes.map((b) => 1 - Math.min(it(a - b, n.beats), it(b - a, n.beats)) / 0.25));
918
918
  return { pose: d, contact: { side: it(f, 2) === 0 ? "left" : "right", start: f, weight: p }, strike: g };
919
919
  }
920
- function Sd(e, t) {
920
+ function $d(e, t) {
921
921
  const o = ir(t.style), n = t.bpm ?? o.bpm, a = t.beats ?? o.beats, r = t.samplesPerBeat ?? 16;
922
922
  if (![n, a, r].every((h) => Number.isFinite(h) && h > 0)) throw new Error("humanDanceTracks: bpm, beats and samplesPerBeat must be positive and finite");
923
923
  if (!Number.isFinite(t.start ?? 0)) throw new Error("humanDanceTracks: start must be finite");
@@ -937,7 +937,7 @@ function hr(e, t, o) {
937
937
  const n = lo(e.pose), a = fn(e).hip, r = na(e.character.plan, n, e.character.height), s = Te(Te(o, e.position), a), i = sa(s, (n.roll ?? 0) * Math.PI / 180), h = io(r.root, Gs(i, -(n.turn ?? 0) * Math.PI / 2));
938
938
  return zo(e.character.plan, n, t, h, { height: e.character.height });
939
939
  }
940
- function ii(e, t, o, n = "toe") {
940
+ function hi(e, t, o, n = "toe") {
941
941
  const a = `leg.${t}`, r = n === "toe" ? 3 : 2;
942
942
  let s = { ...e, pose: lo(e.pose), position: [...e.position] };
943
943
  for (let h = 0; h < 6; h++) {
@@ -953,7 +953,7 @@ function xn(e, t) {
953
953
  const o = ut(e, `arm.${t}`, 2), n = ut(e, `arm.${t}`, 1);
954
954
  return io(o, Qt(lr(Te(o, n)), e.character.lineWidth * 0.5));
955
955
  }
956
- function Md(e, t, o = {}) {
956
+ function Ed(e, t, o = {}) {
957
957
  const n = Math.min(e.character.height, t.character.height), a = o.length ?? n * 0.22;
958
958
  if (!(a > 0) || !Number.isFinite(a)) throw new Error("meetDandiya: stick length must be positive and finite");
959
959
  const r = o.point ?? [(e.position[0] + t.position[0]) / 2, Math.max(e.position[1], t.position[1]) + n * 0.62, (e.position[2] + t.position[2]) / 2], s = (c, l) => {
@@ -975,7 +975,7 @@ function Md(e, t, o = {}) {
975
975
  reached: [i.stick, h.stick].every((c) => dn(Te(c.tip, r)) < n * 2e-3)
976
976
  };
977
977
  }
978
- function li(e, t) {
978
+ function ci(e, t) {
979
979
  const o = t.count ?? 8, n = t.beatsPerTurn ?? 32;
980
980
  if (!Number.isFinite(e) || !Number.isFinite(t.radius) || t.radius <= 0 || !Number.isInteger(o) || o < 1 || !Number.isFinite(n) || n <= 0) throw new Error("danceCircleAt: finite beat, positive radius/beatsPerTurn and a positive integer count are required");
981
981
  const a = t.center ?? [0, 0], r = t.direction ?? 1;
@@ -987,7 +987,7 @@ function li(e, t) {
987
987
  return Array.from({ length: o }, (l, d) => {
988
988
  const f = h(e, d);
989
989
  if (t.plantFeet === !1) return { ...f, planted: !1 };
990
- const u = h(c.start, d), p = ut(u, `leg.${c.side}`, 3), g = ii(f, c.side, p);
990
+ const u = h(c.start, d), p = ut(u, `leg.${c.side}`, 3), g = hi(f, c.side, p);
991
991
  return {
992
992
  ...f,
993
993
  pose: Ys(f.pose, g.pose, c.weight),
@@ -996,12 +996,12 @@ function li(e, t) {
996
996
  };
997
997
  });
998
998
  }
999
- function $d(e, t) {
999
+ function Ad(e, t) {
1000
1000
  if (t.count !== void 0 && t.count !== e.length) throw new Error("danceCircleTracks: count must match targets.length");
1001
1001
  const o = t.bpm ?? 120, n = t.samplesPerBeat ?? 16;
1002
1002
  if (!e.length || ![o, t.beats, n].every((h) => Number.isFinite(h) && h > 0)) throw new Error("danceCircleTracks: targets and positive finite bpm, beats and samplesPerBeat are required");
1003
1003
  if (!Number.isFinite(t.start ?? 0)) throw new Error("danceCircleTracks: start must be finite");
1004
- const a = Math.max(1, Math.ceil(t.beats * n)), r = Array.from({ length: a + 1 }, (h, c) => ({ time: (t.start ?? 0) + t.beats * c / a * 6e4 / o, members: li(t.beats * c / a, { ...t, count: e.length }) })), s = r.some((h) => h.members.some((c) => c.pose.roll !== 0)), i = /* @__PURE__ */ new Set(["x", "y", "z", "rotateY", ...s ? ["turn", "roll"] : []]);
1004
+ const a = Math.max(1, Math.ceil(t.beats * n)), r = Array.from({ length: a + 1 }, (h, c) => ({ time: (t.start ?? 0) + t.beats * c / a * 6e4 / o, members: ci(t.beats * c / a, { ...t, count: e.length }) })), s = r.some((h) => h.members.some((c) => c.pose.roll !== 0)), i = /* @__PURE__ */ new Set(["x", "y", "z", "rotateY", ...s ? ["turn", "roll"] : []]);
1005
1005
  return e.flatMap((h, c) => {
1006
1006
  const l = r.map((d) => {
1007
1007
  const f = d.members[c], { turn: u, ...p } = f.pose;
@@ -1016,7 +1016,7 @@ function $d(e, t) {
1016
1016
  });
1017
1017
  }
1018
1018
  const eo = (e) => Math.min(1, Math.max(0, e));
1019
- function hi(e) {
1019
+ function di(e) {
1020
1020
  const t = { ...ce, turn: e.view }, o = [];
1021
1021
  for (const n of e.keys) {
1022
1022
  const a = o[o.length - 1], r = !a || n.reset ? t : a.pose;
@@ -1024,33 +1024,33 @@ function hi(e) {
1024
1024
  }
1025
1025
  return o;
1026
1026
  }
1027
- function ci(e) {
1028
- return e - di * Math.sin(2 * Math.PI * e) / (2 * Math.PI);
1027
+ function fi(e) {
1028
+ return e - ui * Math.sin(2 * Math.PI * e) / (2 * Math.PI);
1029
1029
  }
1030
- const di = 0.5;
1031
- function fi(e, t) {
1030
+ const ui = 0.5;
1031
+ function gi(e, t) {
1032
1032
  if (!(t <= e.takeoff || t >= e.landing))
1033
1033
  return (t - e.takeoff) / (e.landing - e.takeoff);
1034
1034
  }
1035
- function ui(e, t) {
1036
- const o = typeof e == "string" ? ho[e] : e, n = hi(o), a = eo(t);
1035
+ function pi(e, t) {
1036
+ const o = typeof e == "string" ? ho[e] : e, n = di(o), a = eo(t);
1037
1037
  let r = 0;
1038
1038
  for (let d = 0; d < n.length; d++) n[d].at <= a && (r = d);
1039
- const s = n[r], i = n[Math.min(r + 1, n.length - 1)], h = i.at > s.at ? (a - s.at) / (i.at - s.at) : 0, c = on(s.pose, i.pose, mt(i.easing ?? "ease-in-out")(eo(h))), l = fi(o, a);
1039
+ const s = n[r], i = n[Math.min(r + 1, n.length - 1)], h = i.at > s.at ? (a - s.at) / (i.at - s.at) : 0, c = on(s.pose, i.pose, mt(i.easing ?? "ease-in-out")(eo(h))), l = gi(o, a);
1040
1040
  return l === void 0 ? { ...c, spin: 0, rise: 0 } : {
1041
1041
  ...c,
1042
- spin: o.spin * ci(l),
1042
+ spin: o.spin * fi(l),
1043
1043
  rise: 4 * o.height * l * (1 - l)
1044
1044
  };
1045
1045
  }
1046
- function gi(e, t, o) {
1046
+ function mi(e, t, o) {
1047
1047
  const n = typeof e == "string" ? ho[e] : e, a = eo(t), r = eo((a - n.takeoff) / (n.landing - n.takeoff));
1048
1048
  return n.travel * o * r;
1049
1049
  }
1050
- function Ed(e, t, o = {}) {
1050
+ function Td(e, t, o = {}) {
1051
1051
  const n = typeof t == "string" ? ho[t] : t, a = o.start ?? 0, r = o.duration ?? n.duration, s = o.samples ?? 48, i = Array.from({ length: s + 1 }, (l, d) => {
1052
1052
  const f = d / s;
1053
- return { time: a + f * r, progress: f, pose: ui(n, f) };
1053
+ return { time: a + f * r, progress: f, pose: pi(n, f) };
1054
1054
  }), c = Object.keys(ce).filter((l) => i.some((d) => d.pose[l] !== ce[l])).map((l) => ({
1055
1055
  id: `${e}-${l}`,
1056
1056
  target: e,
@@ -1063,12 +1063,12 @@ function Ed(e, t, o = {}) {
1063
1063
  id: `${e}-x`,
1064
1064
  target: e,
1065
1065
  property: "x",
1066
- keyframes: i.map((d) => ({ time: d.time, value: (o.x ?? 0) + l * gi(n, d.progress, o.height) }))
1066
+ keyframes: i.map((d) => ({ time: d.time, value: (o.x ?? 0) + l * mi(n, d.progress, o.height) }))
1067
1067
  });
1068
1068
  }
1069
1069
  return c;
1070
1070
  }
1071
- const pi = {
1071
+ const yi = {
1072
1072
  leftHip: -55,
1073
1073
  leftKnee: -95,
1074
1074
  rightHip: 55,
@@ -1080,7 +1080,7 @@ const pi = {
1080
1080
  lean: 22,
1081
1081
  stretch: 0.94,
1082
1082
  headTilt: 6
1083
- }, mi = {
1083
+ }, bi = {
1084
1084
  leftHip: 0,
1085
1085
  leftKnee: 0,
1086
1086
  rightHip: 0,
@@ -1108,7 +1108,7 @@ const pi = {
1108
1108
  lean: 26,
1109
1109
  stretch: 1,
1110
1110
  headTilt: 14
1111
- }, yi = {
1111
+ }, wi = {
1112
1112
  leftHip: -22,
1113
1113
  leftKnee: -30,
1114
1114
  rightHip: 22,
@@ -1121,7 +1121,7 @@ const pi = {
1121
1121
  rightElbow: 0,
1122
1122
  lean: 8,
1123
1123
  headTilt: 0
1124
- }, bi = {
1124
+ }, ki = {
1125
1125
  leftHip: -58,
1126
1126
  leftKnee: -100,
1127
1127
  rightHip: 58,
@@ -1147,11 +1147,11 @@ function et(e, t, o, n, a, r = 1300) {
1147
1147
  duration: r,
1148
1148
  keys: [
1149
1149
  { at: 0, reset: !0 },
1150
- { at: 0.16, pose: pi },
1151
- { at: 0.27, pose: mi, easing: "ease-out-quad" },
1150
+ { at: 0.16, pose: yi },
1151
+ { at: 0.27, pose: bi, easing: "ease-out-quad" },
1152
1152
  ...a,
1153
- { at: 0.76, pose: yi },
1154
- { at: 0.86, pose: bi, easing: "ease-out-quad" },
1153
+ { at: 0.76, pose: wi },
1154
+ { at: 0.86, pose: ki, easing: "ease-out-quad" },
1155
1155
  { at: 1, reset: !0 }
1156
1156
  ]
1157
1157
  };
@@ -1248,7 +1248,7 @@ const ho = {
1248
1248
  { at: 0.6, pose: { leftHip: -40, rightHip: 40, leftKnee: -20, rightKnee: 20, lean: 6, headTilt: 0 } }
1249
1249
  ], 1200)
1250
1250
  };
1251
- function wi(e, t) {
1251
+ function vi(e, t) {
1252
1252
  const o = Math.min(1, Math.max(0, e.turn ?? 0)), n = 1 - o, a = { ...ye, turn: o }, r = [
1253
1253
  { stick: "right", human: "left", s: 1 },
1254
1254
  { stick: "left", human: "right", s: -1 }
@@ -1257,23 +1257,23 @@ function wi(e, t) {
1257
1257
  const l = e[`${i}Shoulder`], d = e[`${i}Elbow`];
1258
1258
  a[`arm.${h}.spread`] = l * n, a[`arm.${h}.swing`] = c * l * o, a[`arm.${h}.bend`] = d * n, a[`arm.${h}.elbow`] = c * d * o;
1259
1259
  const f = e[`${i}Hip`], u = e[`${i}Knee`], p = n + c * o;
1260
- a[`leg.${h}.rotate`] = 90 * n, a[`leg.${h}.spread`] = 0, a[`leg.${h}.swing`] = f * p, a[`leg.${h}.knee`] = u * p, a[`leg.${h}.ankle`] = -(e[`${i}Ankle`] ?? 0), a[`leg.${h}.toeOut`] = (e[`${i}FootOut`] ?? 0) * ki, a[`eye.${h}`] = e[`${i}Eye`], a[`brow.${h}`] = e[`${i}Brow`], t && Object.assign(a, vi(h, t[i] ?? Pe, e[`${i}Wrist`] ?? 0, o));
1260
+ a[`leg.${h}.rotate`] = 90 * n, a[`leg.${h}.spread`] = 0, a[`leg.${h}.swing`] = f * p, a[`leg.${h}.knee`] = u * p, a[`leg.${h}.ankle`] = -(e[`${i}Ankle`] ?? 0), a[`leg.${h}.toeOut`] = (e[`${i}FootOut`] ?? 0) * Si, a[`eye.${h}`] = e[`${i}Eye`], a[`brow.${h}`] = e[`${i}Brow`], t && Object.assign(a, Mi(h, t[i] ?? Pe, e[`${i}Wrist`] ?? 0, o));
1261
1261
  }
1262
1262
  const s = e.bend ?? 0;
1263
1263
  a.lean = e.lean * o, a.bend = s * o, a.side = (e.lean + s * 0.5) * n, a["head.tilt"] = (e.headTilt + s * 0.5) * n, a["head.nod"] = e.headTilt * o;
1264
1264
  for (const i of ["mouth", "smile", "mouthWidth", "blink", "browTilt", "lookX", "lookY", "stretch"]) a[i] = e[i];
1265
1265
  return a.lift = e.rise ?? 0, a.roll = e.spin ?? 0, a;
1266
1266
  }
1267
- const ki = 70;
1268
- function vi(e, t, o, n) {
1267
+ const Si = 70;
1268
+ function Mi(e, t, o, n) {
1269
1269
  const a = e === "right" ? 1 - n : 1 + n, r = {};
1270
1270
  for (const s of Object.keys(Pe)) r[`hand.${e}.${s}`] = t[s] ?? Pe[s];
1271
1271
  return r[`hand.${e}.turn`] = (t.turn ?? 0) - a, r[`hand.${e}.roll`] = (t.roll ?? 0) + o, r;
1272
1272
  }
1273
1273
  function cr(e, t, o = {}) {
1274
- e.save(), Si(e, t, o), e.restore();
1274
+ e.save(), $i(e, t, o), e.restore();
1275
1275
  }
1276
- function Si(e, t, o) {
1276
+ function $i(e, t, o) {
1277
1277
  const n = dr(t, o);
1278
1278
  o.shadow !== !1 && fr(e, t, o);
1279
1279
  for (const a of t.under) jn(e, a, n, o);
@@ -1309,10 +1309,10 @@ function dr(e, t = {}) {
1309
1309
  function fr(e, t, o = {}) {
1310
1310
  t.shadow.opacity <= 0 || t.shadow.points.length < 3 || (e.save(), e.globalAlpha = t.shadow.opacity, co(e, t.shadow.points, o.ink ?? "#26262b", !1), e.restore());
1311
1311
  }
1312
- function Ad(e, t, o, n = {}) {
1312
+ function Pd(e, t, o, n = {}) {
1313
1313
  e.save(), Bo(e, t, o, n), e.restore();
1314
1314
  }
1315
- function Mi(e, t, o, n = {}) {
1315
+ function Ei(e, t, o, n = {}) {
1316
1316
  const a = n.style === "stick", r = t.flatMap((l) => {
1317
1317
  if (a && l.part.solidOnly) return [];
1318
1318
  const d = l.part.layer ?? 0;
@@ -1347,7 +1347,7 @@ function Mi(e, t, o, n = {}) {
1347
1347
  const f = h(l);
1348
1348
  if (!d) f.line(l.spine, o * 1.15);
1349
1349
  else {
1350
- const u = a ? ur(l, n) : d.light ? $i(l, d, n) : gn(l);
1350
+ const u = a ? ur(l, n) : d.light ? Ai(l, d, n) : gn(l);
1351
1351
  u && (!a && n.look === "silhouette" ? f.shape(d.points, u, 0) : co(e, d.points, a || d.light ? u : mn(u, d.tone), !0, l.cut ? 1.6 : 0.8));
1352
1352
  const p = (l.part.outline ?? 1) * o;
1353
1353
  if (p > 0)
@@ -1372,7 +1372,7 @@ function gn(e) {
1372
1372
  const { part: t } = e;
1373
1373
  return t.glow && e.glow > 0 && t.fill ? pr(t.fill, t.glow.color, e.glow) : t.fill;
1374
1374
  }
1375
- function $i(e, t, o) {
1375
+ function Ai(e, t, o) {
1376
1376
  const { part: n } = e;
1377
1377
  if (!n.fill) return;
1378
1378
  const a = gr(n.fill, t.light, t.fog ?? 0, o.fog);
@@ -1380,13 +1380,13 @@ function $i(e, t, o) {
1380
1380
  }
1381
1381
  function ur(e, t) {
1382
1382
  const o = gn(e);
1383
- return o && (Ai(o) || e.glow > 0) ? o : t.paper ?? "#fbf8ef";
1383
+ return o && (Pi(o) || e.glow > 0) ? o : t.paper ?? "#fbf8ef";
1384
1384
  }
1385
1385
  function Bo(e, t, o, n) {
1386
1386
  t.opacity < 1 ? (e.save(), e.globalAlpha *= t.opacity, Kn(e, t, o, n), e.restore()) : Kn(e, t, o, n);
1387
1387
  }
1388
1388
  function Kn(e, t, o, n) {
1389
- if (n.style === "stick") return Ei(e, t, o, n);
1389
+ if (n.style === "stick") return Ti(e, t, o, n);
1390
1390
  const { part: a } = t, r = un(e, t, o, n), s = gn(t), i = n.look === "silhouette";
1391
1391
  for (const c of t.faces)
1392
1392
  s && (i ? r.shape(c.points, s, 0) : co(e, c.points, mn(s, c.tone)));
@@ -1395,7 +1395,7 @@ function Kn(e, t, o, n) {
1395
1395
  for (const c of t.edges) c.length > 1 && r.line(c, h);
1396
1396
  for (const c of t.marks) r.line(c, o * 0.7);
1397
1397
  }
1398
- function Ei(e, t, o, n) {
1398
+ function Ti(e, t, o, n) {
1399
1399
  const { part: a } = t;
1400
1400
  if (a.solidOnly) return;
1401
1401
  const r = un(e, t, o, n);
@@ -1410,7 +1410,7 @@ function Ei(e, t, o, n) {
1410
1410
  for (const h of t.edges) h.length > 1 && r.line(h, i);
1411
1411
  for (const h of t.marks) r.line(h, o * 0.7);
1412
1412
  }
1413
- function Ai(e) {
1413
+ function Pi(e) {
1414
1414
  const t = gt(e);
1415
1415
  return t ? (0.299 * t[0] + 0.587 * t[1] + 0.114 * t[2]) / 255 < 0.3 : !1;
1416
1416
  }
@@ -1441,7 +1441,7 @@ function pr(e, t, o) {
1441
1441
  const n = gt(e), a = gt(t);
1442
1442
  return !n || !a ? o < 0.5 ? e : t : pn(n.map((r, s) => r + (a[s] - r) * o));
1443
1443
  }
1444
- const Ti = /* @__PURE__ */ new Set([
1444
+ const Oi = /* @__PURE__ */ new Set([
1445
1445
  "x",
1446
1446
  "y",
1447
1447
  "z",
@@ -1457,30 +1457,30 @@ const Ti = /* @__PURE__ */ new Set([
1457
1457
  "visible",
1458
1458
  "opacity",
1459
1459
  "color"
1460
- ]), Pi = /* @__PURE__ */ new Set(["walk", "walking", "gait"]), Nn = (e) => typeof e == "number" ? e : void 0, Oi = 1.7;
1461
- function Hi(e, t, o) {
1460
+ ]), Hi = /* @__PURE__ */ new Set(["walk", "walking", "gait"]), Nn = (e) => typeof e == "number" ? e : void 0, Ii = 1.7;
1461
+ function xi(e, t, o) {
1462
1462
  const n = Array.from({ length: 24 }, (a, r) => {
1463
1463
  const s = r / 24 * Math.PI * 2, i = t.toView([Math.cos(s) * o, 0, Math.sin(s) * o * 0.8]);
1464
1464
  return i[2] < -1e-3 ? t.toScreen(i) : null;
1465
1465
  });
1466
1466
  n.some((a) => a === null) || (e.beginPath(), n.forEach((a, r) => r === 0 ? e.moveTo(a.x, a.y) : e.lineTo(a.x, a.y)), e.closePath(), e.fillStyle = "rgba(0, 0, 0, 0.22)", e.fill());
1467
1467
  }
1468
- function Ii(e) {
1468
+ function ji(e) {
1469
1469
  const t = ke.dot([0, 1, 0], e);
1470
1470
  if (t > 0.999999) return ne.identity();
1471
- if (t < -0.999999) return ne.fromQuat(Re.fromAxisAngle([1, 0, 0], 180));
1471
+ if (t < -0.999999) return ne.fromQuat(We.fromAxisAngle([1, 0, 0], 180));
1472
1472
  const o = ke.cross([0, 1, 0], e);
1473
- return ne.fromQuat(Re.fromAxisAngle(o, Math.acos(t) * 180 / Math.PI));
1473
+ return ne.fromQuat(We.fromAxisAngle(o, Math.acos(t) * 180 / Math.PI));
1474
1474
  }
1475
- function xi(e, t, o, n, a) {
1475
+ function _i(e, t, o, n, a) {
1476
1476
  const r = e.solid ?? {}, s = r.outline === !1 ? void 0 : r.outline ?? { width: 2, color: "#0f172a" }, i = { color: r.color ?? "#475569", shading: r.shading ?? "toon", outline: s }, h = { color: r.skin ?? "#f2c49b", shading: r.shading ?? "toon", outline: s }, c = { color: "#0f172a", shading: "unlit" }, l = n.height * 0.034, d = [], f = (M, m, P) => d.push({ mesh: M, world: ne.multiply(a, m), material: P }), u = (M, m, P) => f(t.sphere, ne.compose(M, [0, 0, 0, 1], [m, m, m]), P);
1477
1477
  for (const M of o.chains) {
1478
1478
  const m = n.chains[M.id], P = M.id === "spine" ? 1.9 : 1;
1479
1479
  M.bones.forEach((A, k) => {
1480
1480
  const y = m[k], v = m[k + 1], w = ke.distance(y, v), [E, O] = A.width ?? [1, 1], j = l * P * (E + O) / 2;
1481
1481
  if (w > 1e-6) {
1482
- const x = ke.lerp(y, v, 0.5), R = Ii(ke.normalize(ke.subtract(v, y)));
1483
- f(t.cylinder, ne.multiply(ne.translation(x), ne.multiply(R, ne.scaling([j, w, j]))), i);
1482
+ const x = ke.lerp(y, v, 0.5), W = ji(ke.normalize(ke.subtract(v, y)));
1483
+ f(t.cylinder, ne.multiply(ne.translation(x), ne.multiply(W, ne.scaling([j, w, j]))), i);
1484
1484
  }
1485
1485
  u(y, l * P * E, i), u(v, l * P * O, i);
1486
1486
  }), M.id.startsWith("arm.") && u(m[m.length - 1], l * 1.5, h);
@@ -1493,7 +1493,7 @@ function xi(e, t, o, n, a) {
1493
1493
  }
1494
1494
  return d;
1495
1495
  }
1496
- const Td = {
1496
+ const Od = {
1497
1497
  kind: "character",
1498
1498
  validate(e) {
1499
1499
  const t = e;
@@ -1503,7 +1503,7 @@ const Td = {
1503
1503
  return {
1504
1504
  who: sn({ ...e.character, height: 1 }),
1505
1505
  cylinder: Vt(er(1, 1, 16)),
1506
- sphere: Vt(_a(1, 20))
1506
+ sphere: Vt(Na(1, 20))
1507
1507
  };
1508
1508
  },
1509
1509
  // `lights` may be missing from a scene entry older than this add-on: treated as none.
@@ -1511,21 +1511,21 @@ const Td = {
1511
1511
  const h = e, c = t, l = c.who;
1512
1512
  let d = { ...ye, ...h.pose };
1513
1513
  for (const [y, v] of o)
1514
- typeof v == "number" && !Ti.has(y) && !Pi.has(y) && (d[y] = v);
1514
+ typeof v == "number" && !Oi.has(y) && !Hi.has(y) && (d[y] = v);
1515
1515
  const f = Math.max(0, Math.min(1, Nn(o.get("walking")) ?? h.walking ?? 0));
1516
1516
  if (f > 0) {
1517
1517
  const y = typeof o.get("gait") == "string" ? o.get("gait") : h.gait, v = aa(y, Nn(o.get("walk")) ?? 0, d);
1518
1518
  d = Object.fromEntries(Object.keys({ ...d, ...v }).map((w) => [w, (d[w] ?? 0) + ((v[w] ?? 0) - (d[w] ?? 0)) * f]));
1519
1519
  }
1520
- const u = h.height ?? Oi, p = ne.multiply(a.view, n), g = {
1520
+ const u = h.height ?? Ii, p = ne.multiply(a.view, n), g = {
1521
1521
  toView: (y) => ne.transformPoint(p, y),
1522
1522
  toScreen: (y) => i(y)
1523
1523
  }, T = -g.toView([0, u / 2, 0])[2];
1524
1524
  if (T <= a.near) return null;
1525
- const H = h.shadow === !1 ? [] : [{ depth: T + u, draw: (y) => Hi(y, g, u * 0.18) }];
1525
+ const H = h.shadow === !1 ? [] : [{ depth: T + u, draw: (y) => xi(y, g, u * 0.18) }];
1526
1526
  if (h.look === "solid") {
1527
1527
  const y = nn(l.plan, d, { height: u, contact: l.contact });
1528
- return { meshes: xi(h, c, l.plan, y, n), drawables: H };
1528
+ return { meshes: _i(h, c, l.plan, y, n), drawables: H };
1529
1529
  }
1530
1530
  const M = ne.transformPoint(n, [0, u * 0.6, 0]), m = ke.normalize(ke.subtract(a.position, M)), P = tr(M, m, r).map((y) => Math.min(1, y));
1531
1531
  let A = l;
@@ -1563,7 +1563,7 @@ const Td = {
1563
1563
  l: { mouth: 0.3, mouthWidth: 1 },
1564
1564
  /** Other consonants: slightly open */
1565
1565
  c: { mouth: 0.2, mouthWidth: 1 }
1566
- }, wt = 1, Nt = 0.55, Cn = 0.35, ji = 1.6, Wn = { a: "a", e: "e", i: "i", y: "i", o: "o", u: "u" }, Rn = { m: "m", b: "m", p: "m", f: "f", v: "f", w: "u", q: "u", l: "l", n: "l", d: "l", t: "l" }, zn = {
1566
+ }, wt = 1, Nt = 0.55, Cn = 0.35, Ki = 1.6, Rn = { a: "a", e: "e", i: "i", y: "i", o: "o", u: "u" }, Wn = { m: "m", b: "m", p: "m", f: "f", v: "f", w: "u", q: "u", l: "l", n: "l", d: "l", t: "l" }, zn = {
1567
1567
  अ: "a",
1568
1568
  आ: "a",
1569
1569
  इ: "i",
@@ -1590,33 +1590,33 @@ const Td = {
1590
1590
  "ौ": "o",
1591
1591
  "ॅ": "e",
1592
1592
  "ॉ": "o"
1593
- }, _i = { प: "m", फ: "m", ब: "m", भ: "m", म: "m", व: "u" }, Ki = "्", Fn = "़", Ni = (e) => e >= "क" && e <= "ह", Dn = /* @__PURE__ */ new Set([".", ",", "!", "?", ";", ":", "…", "।", "॥", "—", "-"]);
1594
- function Ci(e) {
1593
+ }, Ni = { प: "m", फ: "m", ब: "m", भ: "m", म: "m", व: "u" }, Ci = "्", Fn = "़", Ri = (e) => e >= "क" && e <= "ह", Dn = /* @__PURE__ */ new Set([".", ",", "!", "?", ";", ":", "…", "।", "॥", "—", "-"]);
1594
+ function Wi(e) {
1595
1595
  const t = [], o = Array.from(e.toLowerCase()), n = (a, r) => {
1596
1596
  const s = t[t.length - 1];
1597
1597
  s && s.viseme === a ? s.weight += r * 0.5 : t.push({ viseme: a, weight: r });
1598
1598
  };
1599
1599
  for (let a = 0; a < o.length; a++) {
1600
1600
  const r = o[a], s = o[a + 1];
1601
- if (Dn.has(r)) n("rest", ji);
1601
+ if (Dn.has(r)) n("rest", Ki);
1602
1602
  else if (/\s/.test(r)) {
1603
1603
  const i = t[t.length - 1];
1604
1604
  i && i.viseme !== "rest" && t.push({ viseme: "c", weight: Cn });
1605
1605
  } else if ((r === "o" || r === "e") && s === r)
1606
1606
  n(r === "o" ? "u" : "i", wt), a++;
1607
- else if (r in Wn) n(Wn[r], wt);
1608
- else if (r in Rn) n(Rn[r], Nt);
1607
+ else if (r in Rn) n(Rn[r], wt);
1608
+ else if (r in Wn) n(Wn[r], Nt);
1609
1609
  else {
1610
1610
  if (r === "h") continue;
1611
1611
  if (/[a-z]/.test(r)) n("c", Nt);
1612
1612
  else if (r in zn) n(zn[r], wt);
1613
- else if (Ni(r)) {
1614
- const i = s === Fn ? r === "फ" ? "f" : void 0 : _i[r];
1613
+ else if (Ri(r)) {
1614
+ const i = s === Fn ? r === "फ" ? "f" : void 0 : Ni[r];
1615
1615
  n(i ?? "c", Nt);
1616
1616
  let h = a + 1;
1617
1617
  o[h] === Fn && h++;
1618
1618
  const c = o[h];
1619
- c === Ki ? a = h : c && c in Ln ? (n(Ln[c], wt), a = h) : (!c || /\s/.test(c) || Dn.has(c) || n("a", wt * 0.6), a = h - 1);
1619
+ c === Ci ? a = h : c && c in Ln ? (n(Ln[c], wt), a = h) : (!c || /\s/.test(c) || Dn.has(c) || n("a", wt * 0.6), a = h - 1);
1620
1620
  } else (r === "ं" || r === "ँ") && n("l", Nt * 0.6);
1621
1621
  }
1622
1622
  }
@@ -1624,7 +1624,7 @@ function Ci(e) {
1624
1624
  return t;
1625
1625
  }
1626
1626
  function mr(e, t = {}) {
1627
- const o = t.fields?.mouth ?? "mouth", n = t.fields?.mouthWidth ?? "mouthWidth", a = t.energy ?? 1, r = Ci(e.text), s = [{ time: e.start, value: Be.rest.mouth }], i = [{ time: e.start, value: Be.rest.mouthWidth }], h = r.reduce((l, d) => l + d.weight, 0), c = e.end - e.start;
1627
+ const o = t.fields?.mouth ?? "mouth", n = t.fields?.mouthWidth ?? "mouthWidth", a = t.energy ?? 1, r = Wi(e.text), s = [{ time: e.start, value: Be.rest.mouth }], i = [{ time: e.start, value: Be.rest.mouthWidth }], h = r.reduce((l, d) => l + d.weight, 0), c = e.end - e.start;
1628
1628
  if (h > 0 && c > 0) {
1629
1629
  let l = e.start;
1630
1630
  for (const d of r) {
@@ -1638,7 +1638,7 @@ function mr(e, t = {}) {
1638
1638
  }
1639
1639
  return e.end > s[s.length - 1].time && (s.push({ time: e.end, value: Be.rest.mouth, easing: "ease-in-out" }), i.push({ time: e.end, value: Be.rest.mouthWidth, easing: "ease-in-out" })), { [o]: s, [n]: i };
1640
1640
  }
1641
- function Pd(e, t, o = {}) {
1641
+ function Hd(e, t, o = {}) {
1642
1642
  const n = {};
1643
1643
  for (const a of [...t].sort((r, s) => r.start - s.start))
1644
1644
  for (const [r, s] of Object.entries(mr(a, o))) {
@@ -1665,7 +1665,7 @@ const Et = ([e, t, o]) => {
1665
1665
  const n = Math.hypot(e, t, o) || 1;
1666
1666
  return [e / n, t / n, o / n];
1667
1667
  };
1668
- function Wi([e, t, o]) {
1668
+ function zi([e, t, o]) {
1669
1669
  const [n, a, r] = [e / 2, t / 2, o / 2];
1670
1670
  return {
1671
1671
  vertices: [
@@ -1689,7 +1689,7 @@ function Wi([e, t, o]) {
1689
1689
  };
1690
1690
  }
1691
1691
  const tt = (e, [t, o, n]) => e === "z" ? [t, o, n] : e === "x" ? [n, o, t] : [t, n, o];
1692
- function Ri(e, t, o = "x", n = 20, a = 0) {
1692
+ function Li(e, t, o = "x", n = 20, a = 0) {
1693
1693
  const r = [], s = t / 2;
1694
1694
  for (const c of [-s, s])
1695
1695
  for (let l = 0; l < n; l++) {
@@ -1715,7 +1715,7 @@ function Ri(e, t, o = "x", n = 20, a = 0) {
1715
1715
  }
1716
1716
  return { vertices: r, faces: i, marks: h, creases: !0 };
1717
1717
  }
1718
- function zi([e, t, o], n = 16) {
1718
+ function Fi([e, t, o], n = 16) {
1719
1719
  const a = Math.max(4, Math.round(n / 2)), r = [[0, t, 0]];
1720
1720
  for (let l = 1; l < a; l++) {
1721
1721
  const d = Math.PI * l / a;
@@ -1740,12 +1740,12 @@ function zi([e, t, o], n = 16) {
1740
1740
  }
1741
1741
  return { vertices: r, faces: c, creases: !1 };
1742
1742
  }
1743
- const Li = (e) => e.reduce((t, [o, n], a) => {
1743
+ const Di = (e) => e.reduce((t, [o, n], a) => {
1744
1744
  const [r, s] = e[(a + 1) % e.length];
1745
1745
  return t + o * s - r * n;
1746
1746
  }, 0) / 2;
1747
- function Fi(e, t) {
1748
- const o = Li(e) < 0 ? [...e].reverse() : e, n = o.length, a = t / 2, r = [...o.map(([i, h]) => [a, h, i]), ...o.map(([i, h]) => [-a, h, i])], s = [
1747
+ function qi(e, t) {
1748
+ const o = Di(e) < 0 ? [...e].reverse() : e, n = o.length, a = t / 2, r = [...o.map(([i, h]) => [a, h, i]), ...o.map(([i, h]) => [-a, h, i])], s = [
1749
1749
  // Seen from +x, (forward, up) = (z, y) runs anticlockwise when z points left on screen: so reverse for the left cap.
1750
1750
  { corners: Array.from({ length: n }, (i, h) => n - 1 - h), normal: [1, 0, 0] },
1751
1751
  { corners: Array.from({ length: n }, (i, h) => n + h), normal: [-1, 0, 0] }
@@ -1756,7 +1756,7 @@ function Fi(e, t) {
1756
1756
  }
1757
1757
  return { vertices: r, faces: s, creases: !0 };
1758
1758
  }
1759
- function Di(e, t) {
1759
+ function Bi(e, t) {
1760
1760
  const o = {
1761
1761
  left: ([a, r]) => [0, r, a],
1762
1762
  right: ([a, r]) => [0, r, a],
@@ -1766,7 +1766,7 @@ function Di(e, t) {
1766
1766
  }, n = { left: [1, 0, 0], right: [-1, 0, 0], front: [0, 0, 1], back: [0, 0, -1], up: [0, 1, 0] };
1767
1767
  return { vertices: e.map(o[t]), faces: [{ corners: e.map((a, r) => r), normal: n[t] }] };
1768
1768
  }
1769
- function qi(e, t, o = 8) {
1769
+ function Gi(e, t, o = 8) {
1770
1770
  const n = (s) => Array.isArray(t) ? t[Math.min(s, t.length - 1)] : t, a = [], r = [];
1771
1771
  e.forEach((s, i) => {
1772
1772
  const h = e[Math.min(i + 1, e.length - 1)], c = e[Math.max(i - 1, 0)], l = Et([h[0] - c[0], h[1] - c[1], h[2] - c[2]]), d = Math.abs(l[1]) < 0.9 ? [0, 1, 0] : [1, 0, 0], f = Et(qn(l, d)), u = qn(f, l);
@@ -1785,20 +1785,20 @@ function qi(e, t, o = 8) {
1785
1785
  function qn(e, t) {
1786
1786
  return [e[1] * t[2] - e[2] * t[1], e[2] * t[0] - e[0] * t[2], e[0] * t[1] - e[1] * t[0]];
1787
1787
  }
1788
- function Bi(e) {
1788
+ function Yi(e) {
1789
1789
  switch (e.type) {
1790
1790
  case "box":
1791
- return Wi(e.size);
1791
+ return zi(e.size);
1792
1792
  case "cylinder":
1793
- return Ri(e.radius, e.length, e.axis, e.segments, e.spokes);
1793
+ return Li(e.radius, e.length, e.axis, e.segments, e.spokes);
1794
1794
  case "ellipsoid":
1795
- return zi(e.radii, e.segments);
1795
+ return Fi(e.radii, e.segments);
1796
1796
  case "extrude":
1797
- return Fi(e.profile, e.width);
1797
+ return qi(e.profile, e.width);
1798
1798
  case "panel":
1799
- return Di(e.points, e.facing);
1799
+ return Bi(e.points, e.facing);
1800
1800
  case "tube":
1801
- return { ...qi(e.points, e.radius, e.segments), joined: e.joined };
1801
+ return { ...Gi(e.points, e.radius, e.segments), joined: e.joined };
1802
1802
  }
1803
1803
  }
1804
1804
  function yr(e, t) {
@@ -1849,7 +1849,7 @@ function vr(e, t) {
1849
1849
  }
1850
1850
  return (o + n) / 2;
1851
1851
  }
1852
- const kt = 520, Bn = ["do", "at", "for", "to", "through", "toward", "speed", "pose", "gag", "say", "look", "turns", "dance", "bpm", "beats"], Gi = (e) => Math.max(700, Array.from(e).length * 65), Gn = 70, Yn = 35;
1852
+ const kt = 520, Bn = ["do", "at", "for", "to", "through", "toward", "speed", "pose", "gag", "say", "look", "turns", "dance", "bpm", "beats"], Ui = (e) => Math.max(700, Array.from(e).length * 65), Gn = 70, Yn = 35;
1853
1853
  function Sr(e, t) {
1854
1854
  const o = t[0] - e.x, n = t[1] - e.eyeHeight, a = t[2] - e.z, r = e.heading * Math.PI / 180, s = o * Math.cos(r) - a * Math.sin(r), i = o * Math.sin(r) + a * Math.cos(r), h = Math.atan2(s, i) * 180 / Math.PI, c = Math.hypot(s, i), l = -Math.atan2(n, c) * 180 / Math.PI, d = Math.max(-Gn, Math.min(Gn, h * 0.75)), f = Math.max(-Yn, Math.min(Yn, l * 0.7));
1855
1855
  return {
@@ -1859,7 +1859,7 @@ function Sr(e, t) {
1859
1859
  lookY: Math.max(-1, Math.min(1, (l - f) / 30))
1860
1860
  };
1861
1861
  }
1862
- const Yi = {
1862
+ const Xi = {
1863
1863
  walk: 1.3,
1864
1864
  bouncy: 1.4,
1865
1865
  doubleBounce: 1.2,
@@ -1868,8 +1868,8 @@ const Yi = {
1868
1868
  tired: 0.8,
1869
1869
  run: 3.6,
1870
1870
  shove: 0.7
1871
- }, Go = Object.keys(Ke), So = Object.keys(_e), Mo = Object.keys(Xs), Ui = 0.25, Xi = 700 / 180, Vi = 200, Ji = 300;
1872
- function Zi(e) {
1871
+ }, Go = Object.keys(Ke), So = Object.keys(_e), Mo = Object.keys(Xs), Vi = 0.25, Ji = 700 / 180, Zi = 200, Qi = 300;
1872
+ function el(e) {
1873
1873
  if (!Array.isArray(e)) return [{ beat: -1, message: `Beats must be an array of { do: … } objects (got ${typeof e}).` }];
1874
1874
  const t = [...Go, "face", "spin", "dance", "hold", "pose", "gag", "place", "say", "look"], o = [];
1875
1875
  return e.forEach((n, a) => {
@@ -1890,8 +1890,8 @@ function Zi(e) {
1890
1890
  s.do === "pose" && !(typeof s.pose == "object" && s.pose !== null) && !So.includes(s.pose) && r(fe("pose", s.pose, So)), s.do === "gag" && !Mo.includes(s.gag) && r(fe("gag", s.gag, Mo));
1891
1891
  }), o;
1892
1892
  }
1893
- function Od(e, t, o) {
1894
- const n = Zi(t);
1893
+ function Id(e, t, o) {
1894
+ const n = el(t);
1895
1895
  if (n.length > 0) throw new Error(`characterScript3D: ${n.length} problem(s) in the beats:
1896
1896
  ${n.map((k) => ` beat ${k.beat}: ${k.message}`).join(`
1897
1897
  `)}`);
@@ -1917,7 +1917,7 @@ ${n.map((k) => ` beat ${k.beat}: ${k.message}`).join(`
1917
1917
  const w = to(c, y);
1918
1918
  if (Math.abs(w) < 1)
1919
1919
  return v !== void 0 && (p("rotateY", k, c), u("rotateY", k + v, c)), k + (v ?? 0);
1920
- const E = v ?? Math.max(Vi, Math.abs(w) * Xi);
1920
+ const E = v ?? Math.max(Zi, Math.abs(w) * Ji);
1921
1921
  return p("rotateY", k, c), c += w, u("rotateY", k + E, c, "ease-in-out"), k + E;
1922
1922
  }, b = (k, y, v, w = "ease-in-out") => {
1923
1923
  for (const [E, O] of Object.entries(v))
@@ -1925,17 +1925,17 @@ ${n.map((k) => ` beat ${k.beat}: ${k.message}`).join(`
1925
1925
  }, T = (k, y, v) => {
1926
1926
  const w = wr([[i, h], ...y.through ?? [y.to]]);
1927
1927
  if (w.length < 2) return v;
1928
- const E = g(v, lt(w[0].point, w[1].point)), O = w[w.length - 1].at, j = y.speed ?? Yi[k] * Math.sqrt(a / 1.7), x = y.for ?? O / j * 1e3, R = Us(k, a), G = mt("ease-in-out"), Y = Math.min(Ji, x / 4);
1928
+ const E = g(v, lt(w[0].point, w[1].point)), O = w[w.length - 1].at, j = y.speed ?? Xi[k] * Math.sqrt(a / 1.7), x = y.for ?? O / j * 1e3, W = Us(k, a), G = mt("ease-in-out"), Y = Math.min(Qi, x / 4);
1929
1929
  f.push({ time: E, value: k }), p("walking", E, 0), u("walking", E + Y, 1, "ease-out"), u("walking", E + x - Y, 1), u("walking", E + x, 0, "ease-in");
1930
1930
  const oe = l;
1931
1931
  let q = c;
1932
- for (let I = 0; ; I = Math.min(O, I + Ui)) {
1932
+ for (let I = 0; ; I = Math.min(O, I + Vi)) {
1933
1933
  const N = E + vr(G, I / O) * x, { point: C, direction: S } = kr(w, I);
1934
1934
  q += to(q, lt([0, 0], S));
1935
1935
  const _ = I === 0 ? p : u;
1936
- if (_("x", N, C[0]), _("z", N, C[1]), _("rotateY", N, q), _("walk", N, oe + I / R), I >= O) break;
1936
+ if (_("x", N, C[0]), _("z", N, C[1]), _("rotateY", N, q), _("walk", N, oe + I / W), I >= O) break;
1937
1937
  }
1938
- return l = oe + O / R, [i, h] = w[w.length - 1].point, c = q, E + x;
1938
+ return l = oe + O / W, [i, h] = w[w.length - 1].point, c = q, E + x;
1939
1939
  }, H = [], M = [];
1940
1940
  let m = 0;
1941
1941
  for (const k of t) {
@@ -1948,13 +1948,13 @@ ${n.map((k) => ` beat ${k.beat}: ${k.message}`).join(`
1948
1948
  else if (k.do === "dance") {
1949
1949
  const w = ft[k.dance], E = k.bpm ?? w.bpm, O = k.beats ?? (k.for !== void 0 ? k.for * E / 6e4 : w.beats);
1950
1950
  v = y + (k.for ?? O * 6e4 / E);
1951
- const j = { ...r }, x = Math.max(1, Math.ceil(O * 16)), R = Array.from({ length: x + 1 }, (Y, oe) => Zt(k.dance, O * oe / x, j).pose), G = Math.min(150, (v - y) / 4);
1952
- for (const Y of Object.keys(R[0])) {
1951
+ const j = { ...r }, x = Math.max(1, Math.ceil(O * 16)), W = Array.from({ length: x + 1 }, (Y, oe) => Zt(k.dance, O * oe / x, j).pose), G = Math.min(150, (v - y) / 4);
1952
+ for (const Y of Object.keys(W[0])) {
1953
1953
  const oe = s(Y, j);
1954
- Y === "turn" || Y === "roll" || R.every((q) => q[Y] === oe) || (p(Y, y, oe), R.slice(1).forEach((q, I) => {
1954
+ Y === "turn" || Y === "roll" || W.every((q) => q[Y] === oe) || (p(Y, y, oe), W.slice(1).forEach((q, I) => {
1955
1955
  const N = y + (v - y) * (I + 1) / x, C = Math.min(1, (N - y) / G), S = C * C * (3 - 2 * C);
1956
1956
  u(Y, N, oe + (q[Y] - oe) * S);
1957
- }), r[Y] = R[x][Y]);
1957
+ }), r[Y] = W[x][Y]);
1958
1958
  }
1959
1959
  } else if (k.do === "hold") v = y + (k.for ?? 1e3);
1960
1960
  else if (k.do === "place")
@@ -1970,7 +1970,7 @@ ${n.map((k) => ` beat ${k.beat}: ${k.message}`).join(`
1970
1970
  b(E.time, O.time, Object.fromEntries(Object.entries(O.pose).filter(([j, x]) => r[j] !== x)), O.easing ?? "ease-in-out"), E = O;
1971
1971
  v = E.time;
1972
1972
  } else if (k.do === "say") {
1973
- v = y + (k.for ?? Gi(k.say)), M.push({ text: k.say, start: y, end: v });
1973
+ v = y + (k.for ?? Ui(k.say)), M.push({ text: k.say, start: y, end: v });
1974
1974
  const w = { tilt: r["head.tilt"] ?? 0, left: r["brow.left"] ?? 0, right: r["brow.right"] ?? 0 };
1975
1975
  let E = 0;
1976
1976
  for (let O = y + kt; O < v - kt / 2; O += kt, E++) {
@@ -2000,7 +2000,7 @@ function Un(e, t, o = [0, 0, 0]) {
2000
2000
  return [h("x", o[0]), h("y", o[1]), h("z", o[2])];
2001
2001
  };
2002
2002
  }
2003
- function Hd(e, t) {
2003
+ function xd(e, t) {
2004
2004
  const o = `${t.scene}/${t.character}`, n = t.height ?? 1.7, a = Math.max(1, t.every ?? 66), r = t.objects?.[t.character] ?? [0, 0, 0], s = new ve({ id: `${o}-own`, tracks: e.filter((d) => d.target === o) }), i = t.at, h = typeof i == "function" ? i : Array.isArray(i) ? () => i : "camera" in i ? Un(e, `${t.scene}/${i.camera}`, t.objects?.[i.camera] ?? [0, 1.6, 8]) : (() => {
2005
2005
  const d = Un(e, `${t.scene}/${i.object}`, t.objects?.[i.object] ?? [0, 0, 0]), f = i.eyeHeight ?? n * 0.9;
2006
2006
  return (u) => {
@@ -2018,7 +2018,7 @@ function Hd(e, t) {
2018
2018
  }
2019
2019
  return c.map((d) => ({ id: `${o}-lookAt-${d}`, target: o, property: d, keyframes: l[d] }));
2020
2020
  }
2021
- function Id(e) {
2021
+ function jd(e) {
2022
2022
  const t = Math.max(1, Math.round(e.count)), [o, n] = e.centre ?? [0, 0], a = e.spacing ?? 1.2, r = e.shape ?? "line", s = [];
2023
2023
  if (r === "circle") {
2024
2024
  const l = t < 2 ? 0 : Math.max(a, a * t / (Math.PI * 2));
@@ -2053,7 +2053,7 @@ function Id(e) {
2053
2053
  }
2054
2054
  return s;
2055
2055
  }
2056
- function Qi(e, t, o = {}, n) {
2056
+ function tl(e, t, o = {}, n) {
2057
2057
  const a = o.length ?? 240, r = 9, s = 28, i = a - 22;
2058
2058
  e.save(), e.translate(t.x, t.y), e.rotate((o.angle ?? -30) * Math.PI / 180), e.fillStyle = o.color ?? "#f4c542", e.fillRect(s, -r, i - s, 2 * r), e.fillStyle = "#e8b4a0", e.fillRect(i, -r, a - i, 2 * r), e.fillStyle = "#f1dcbf", e.beginPath(), e.moveTo(0, 0), e.lineTo(s, -r), e.lineTo(s, r), e.closePath(), e.fill(), e.fillStyle = o.outline ?? "#2f2f33", e.beginPath(), e.moveTo(0, 0), e.lineTo(s * 0.35, -r * 0.35), e.lineTo(s * 0.35, r * 0.35), e.closePath(), e.fill(), e.strokeStyle = o.outline ?? "#2f2f33", e.lineWidth = 3, e.lineJoin = "round", e.lineCap = "round";
2059
2059
  const h = [
@@ -2086,15 +2086,15 @@ function Mr(e, t, o = {}, n) {
2086
2086
  }
2087
2087
  e.restore();
2088
2088
  }
2089
- const $r = 150, el = { pencil: 44, eraser: 30 };
2089
+ const $r = 150, ol = { pencil: 44, eraser: 30 };
2090
2090
  function Er(e, t, o = {}, n) {
2091
2091
  const a = o.tool ?? "pencil", r = o.skin ?? "#f1c9a5", s = o.outline ?? "#2f2f33", i = o.scale ?? 1, h = Math.min(1, Math.max(0, o.lift ?? 0)), c = (o.angle ?? -30) * Math.PI / 180, l = n ? n.nudge(0.6) : { x: 0, y: 0 }, d = $r * i * (1 + 0.05 * h);
2092
2092
  h > 0 && (e.save(), e.fillStyle = s, e.globalAlpha = 0.15 * h, e.beginPath(), e.ellipse(t.x, t.y, 9 * i, 4 * i, 0, 0, Math.PI * 2), e.fill(), e.restore());
2093
2093
  const f = { x: t.x + l.x + 6 * h * i, y: t.y + l.y - 18 * h * i }, u = we.pencilGrip, p = (k) => {
2094
2094
  const y = k.fingers.thumb, v = k.fingers.index, w = k.fingers.middle, E = Xn([y.points[3], v.points[3], w.points[3]]), O = Xn([y.points[1], v.points[0]]), j = (y.depths[3] + v.depths[3] + w.depths[3]) / 3;
2095
2095
  return { pinch: E, direction: Math.atan2(O.y - E.y, O.x - E.x), depth: j };
2096
- }, g = Pn(u, { size: d }), b = c - p(g).direction, T = Pn(u, { size: d, angle: b * 180 / Math.PI }), H = p(T), M = el[a] * i, m = { x: H.pinch.x - Math.cos(c) * M, y: H.pinch.y - Math.sin(c) * M }, P = { x: f.x - m.x, y: f.y - m.y }, A = T.axes.up;
2097
- tl(e, P, { x: -A.x, y: -A.y }, d, o.arm ?? 300 * i, r, o.sleeve ?? "#5b7db1", s), ha(e, P, u, {
2096
+ }, g = Pn(u, { size: d }), b = c - p(g).direction, T = Pn(u, { size: d, angle: b * 180 / Math.PI }), H = p(T), M = ol[a] * i, m = { x: H.pinch.x - Math.cos(c) * M, y: H.pinch.y - Math.sin(c) * M }, P = { x: f.x - m.x, y: f.y - m.y }, A = T.axes.up;
2097
+ nl(e, P, { x: -A.x, y: -A.y }, d, o.arm ?? 300 * i, r, o.sleeve ?? "#5b7db1", s), ha(e, P, u, {
2098
2098
  size: d,
2099
2099
  angle: b * 180 / Math.PI,
2100
2100
  skin: r,
@@ -2103,7 +2103,7 @@ function Er(e, t, o = {}, n) {
2103
2103
  prop: {
2104
2104
  depth: H.depth,
2105
2105
  draw: () => {
2106
- e.save(), e.translate(f.x, f.y), e.scale(i, i), a === "eraser" ? Mr(e, { x: 0, y: 0 }, { angle: c * 180 / Math.PI, outline: s }, n) : Qi(e, { x: 0, y: 0 }, { angle: c * 180 / Math.PI, length: 190, outline: s }, n), e.restore();
2106
+ e.save(), e.translate(f.x, f.y), e.scale(i, i), a === "eraser" ? Mr(e, { x: 0, y: 0 }, { angle: c * 180 / Math.PI, outline: s }, n) : tl(e, { x: 0, y: 0 }, { angle: c * 180 / Math.PI, length: 190, outline: s }, n), e.restore();
2107
2107
  }
2108
2108
  }
2109
2109
  });
@@ -2112,19 +2112,19 @@ const Xn = (e) => ({
2112
2112
  x: e.reduce((t, o) => t + o.x, 0) / e.length,
2113
2113
  y: e.reduce((t, o) => t + o.y, 0) / e.length
2114
2114
  });
2115
- function tl(e, t, o, n, a, r, s, i) {
2115
+ function nl(e, t, o, n, a, r, s, i) {
2116
2116
  const h = { x: -o.y, y: o.x }, c = n * 0.15, l = (g, b, T) => ({
2117
2117
  x: t.x + o.x * g + h.x * b * T,
2118
2118
  y: t.y + o.y * g + h.y * b * T
2119
2119
  }), d = l(a, 0, 0), f = (g) => {
2120
2120
  const b = e.createLinearGradient(t.x, t.y, d.x, d.y);
2121
- return b.addColorStop(0, g), b.addColorStop(0.6, g), b.addColorStop(1, ol(g)), b;
2121
+ return b.addColorStop(0, g), b.addColorStop(0.6, g), b.addColorStop(1, sl(g)), b;
2122
2122
  }, u = Math.min(n * 0.55, a * 0.35);
2123
2123
  e.save(), e.lineJoin = "round", e.lineCap = "round", e.lineWidth = 3 * (n / $r), e.beginPath(), e.moveTo(l(-n * 0.1, -1, c).x, l(-n * 0.1, -1, c).y), e.lineTo(l(u + 4, -1, c * 1.1).x, l(u + 4, -1, c * 1.1).y), e.lineTo(l(u + 4, 1, c * 1.1).x, l(u + 4, 1, c * 1.1).y), e.lineTo(l(-n * 0.1, 1, c).x, l(-n * 0.1, 1, c).y), e.closePath(), e.fillStyle = r, e.fill(), e.strokeStyle = i, e.beginPath(), e.moveTo(l(0, -1, c).x, l(0, -1, c).y), e.lineTo(l(u, -1, c * 1.1).x, l(u, -1, c * 1.1).y), e.moveTo(l(0, 1, c).x, l(0, 1, c).y), e.lineTo(l(u, 1, c * 1.1).x, l(u, 1, c * 1.1).y), e.stroke();
2124
2124
  const p = [l(u, -1, c * 1.3), l(a, -1, c * 1.5), l(a, 1, c * 1.5), l(u, 1, c * 1.3)];
2125
2125
  e.beginPath(), p.forEach((g, b) => b ? e.lineTo(g.x, g.y) : e.moveTo(g.x, g.y)), e.closePath(), e.fillStyle = f(s), e.fill(), e.strokeStyle = f(i), e.beginPath(), e.moveTo(p[1].x, p[1].y), e.lineTo(p[0].x, p[0].y), e.lineTo(p[3].x, p[3].y), e.lineTo(p[2].x, p[2].y), e.stroke(), e.restore();
2126
2126
  }
2127
- function xd(e, t, o = {}) {
2127
+ function _d(e, t, o = {}) {
2128
2128
  const n = o.offstage ?? { x: 2e3, y: 1400 }, a = o.enter ?? 450, r = o.exit ?? 450, s = o.linger ?? 1500, i = [...e].filter((g) => g.path.length > 0).sort((g, b) => g.start - b.start), h = (g) => g.tool ?? "pencil", c = (g) => {
2129
2129
  const b = Math.min(1, Math.max(0, g));
2130
2130
  return b * b * (3 - 2 * b);
@@ -2148,7 +2148,7 @@ function xd(e, t, o = {}) {
2148
2148
  }
2149
2149
  return null;
2150
2150
  }
2151
- function jd(e, t, o, n = 0.08, a = 32) {
2151
+ function Kd(e, t, o, n = 0.08, a = 32) {
2152
2152
  const r = Math.PI * 2 * (1 + n), s = [];
2153
2153
  for (let i = 0; i <= a; i++) {
2154
2154
  const h = -Math.PI / 2 + r * i / a;
@@ -2156,7 +2156,7 @@ function jd(e, t, o, n = 0.08, a = 32) {
2156
2156
  }
2157
2157
  return s;
2158
2158
  }
2159
- function _d(e) {
2159
+ function Nd(e) {
2160
2160
  const { path: t } = e, o = t.map((i) => i.x), n = t.map((i) => i.y), a = Math.min(...o), r = Math.min(...n), s = e.hand === !1 ? void 0 : e.hand === !0 || e.hand === void 0 ? {} : e.hand;
2161
2161
  return {
2162
2162
  type: "custom",
@@ -2168,12 +2168,12 @@ function _d(e) {
2168
2168
  draw(i, h, c) {
2169
2169
  const l = Math.min(1, Math.max(0, Number(h.props?.draw ?? 0)));
2170
2170
  i.translate(-a, -r), i.strokeStyle = e.color ?? "#2f2f33", i.lineWidth = e.lineWidth ?? 5, i.lineCap = "round", i.lineJoin = "round";
2171
- const d = e.sketch ? Ka(i, e.sketch, c) : void 0;
2171
+ const d = e.sketch ? Ca(i, e.sketch, c) : void 0;
2172
2172
  l > 0 && (d ? e.smooth ? d.curve(t, l) : d.line(t, l) : Ar(i, nr(t, l))), s && l > 0 && l < 1 && Er(i, an(t, l), s, d);
2173
2173
  }
2174
2174
  };
2175
2175
  }
2176
- function ol(e) {
2176
+ function sl(e) {
2177
2177
  const t = /^#([0-9a-f]{3}|[0-9a-f]{6})$/i.exec(e.trim());
2178
2178
  if (!t) return "rgba(0, 0, 0, 0)";
2179
2179
  const o = t[1].length === 3 ? [...t[1]].map((s) => s + s).join("") : t[1], [n, a, r] = [0, 2, 4].map((s) => parseInt(o.slice(s, s + 2), 16));
@@ -2188,7 +2188,7 @@ function Ar(e, t, o) {
2188
2188
  }
2189
2189
  }
2190
2190
  const Ct = 1e5;
2191
- function Kd(e, t, o, n, a = 6) {
2191
+ function Cd(e, t, o, n, a = 6) {
2192
2192
  const r = [], s = Math.max(1, Math.round(a));
2193
2193
  for (let i = 0; i <= s; i++)
2194
2194
  r.push({ x: i % 2 === 0 ? e : e + o, y: t + n * i / s });
@@ -2212,10 +2212,10 @@ function Tr(e, t, o, n) {
2212
2212
  });
2213
2213
  }
2214
2214
  }
2215
- function Nd(e, t, o, n, a) {
2215
+ function Rd(e, t, o, n, a) {
2216
2216
  e.save(), Tr(e, t, o, n), a(), e.restore();
2217
2217
  }
2218
- function Cd(e, t) {
2218
+ function Wd(e, t) {
2219
2219
  const o = t.width ?? 40, n = t.hand === !0 ? {} : t.hand || void 0, a = t.eraser === !1 ? void 0 : t.eraser === !0 || t.eraser === void 0 ? {} : t.eraser;
2220
2220
  return {
2221
2221
  ...e,
@@ -2249,7 +2249,7 @@ function It() {
2249
2249
  id: `${o}-${n}`,
2250
2250
  target: o,
2251
2251
  property: n,
2252
- keyframes: nl(a)
2252
+ keyframes: rl(a)
2253
2253
  }));
2254
2254
  }
2255
2255
  };
@@ -2269,10 +2269,10 @@ function Pt(e) {
2269
2269
  const t = [...e ?? []].sort((o, n) => o.time - n.time);
2270
2270
  return t.slice(1).flatMap((o, n) => o.value !== t[n].value ? [{ start: t[n].time, end: o.time }] : []);
2271
2271
  }
2272
- function nl(e) {
2272
+ function rl(e) {
2273
2273
  return [...e].sort((o, n) => o.time - n.time).map((o) => ({ time: o.time, value: o.value, ...o.easing ? { easing: o.easing } : {} }));
2274
2274
  }
2275
- const sl = 16e-4, rl = 0.6, Ye = 33;
2275
+ const al = 16e-4, il = 0.6, Ye = 33;
2276
2276
  function fo(e) {
2277
2277
  const t = (r, s) => `piece.${r.id}.${s}`, o = (r, s) => ({
2278
2278
  x: r.home.x + e.valueAt(t(r, "x"), s),
@@ -2291,7 +2291,7 @@ function fo(e) {
2291
2291
  e.push(t(r, "x"), { time: i.time, value: i.x - r.home.x }), e.push(t(r, "y"), { time: i.time, value: i.y - r.home.y });
2292
2292
  },
2293
2293
  fling(r, s) {
2294
- const i = o(r, s.at), h = s.velocity ?? n(r, s.at) ?? { x: 0.5, y: -0.6 }, c = s.gravity ?? sl, l = s.duration ?? 900, d = (s.spin ?? rl) * (h.x < 0 ? -1 : 1), f = e.valueAt(t(r, "rotate"), s.at);
2294
+ const i = o(r, s.at), h = s.velocity ?? n(r, s.at) ?? { x: 0.5, y: -0.6 }, c = s.gravity ?? al, l = s.duration ?? 900, d = (s.spin ?? il) * (h.x < 0 ? -1 : 1), f = e.valueAt(t(r, "rotate"), s.at);
2295
2295
  a(r, s.at);
2296
2296
  for (let u = 0; u <= l; u += Ye) {
2297
2297
  const p = i.x + h.x * u, g = i.y + h.y * u + 0.5 * c * u * u;
@@ -2354,7 +2354,7 @@ function me(e, t, o, n) {
2354
2354
  height: n
2355
2355
  };
2356
2356
  }
2357
- const al = {
2357
+ const ll = {
2358
2358
  background: "#1e1e2e",
2359
2359
  gutter: "#6c7086",
2360
2360
  text: "#cdd6f4",
@@ -2385,12 +2385,12 @@ const al = {
2385
2385
  move: "a token; { at, to: an anchor name or { x, y }, duration? }: move the word there",
2386
2386
  fling: "a token; { at, velocity?, spin?, gravity?, duration? }: throw or kick the word away on a spinning arc"
2387
2387
  }
2388
- }, il = 0.9, ll = 8;
2389
- function Wd(e) {
2390
- const t = { ...al, ...e.theme }, o = e.code.replace(/\t/g, " ").replace(/\n$/, "").split(`
2388
+ }, hl = 0.9, cl = 8;
2389
+ function zd(e) {
2390
+ const t = { ...ll, ...e.theme }, o = e.code.replace(/\t/g, " ").replace(/\n$/, "").split(`
2391
2391
  `), n = e.fontSize ?? 16, a = (e.lineHeight ?? 1.6) * n, r = (e.charWidth ?? 0.6) * n, s = e.padding ?? 12, i = e.lineNumbers === !1 ? 0 : (String(o.length).length + 2) * r, h = Math.max(1, ...o.map((I) => I.length)), c = e.width ?? s * 2 + i + h * r, l = s * 2 + o.length * a, d = e.x + s + i, f = new Set(e.hidden ?? []), u = e.language ?? "plain";
2392
2392
  if (!Uo.includes(u)) throw new Error(`codePanel: ${fe("language", u, Uo)}`);
2393
- const p = o.map((I) => fl(I, u).flatMap((N) => Array.from(N.text, () => t[N.kind]))), g = It(), b = fo(g), T = [], H = /* @__PURE__ */ new Map(), M = [], m = [], P = (I) => {
2393
+ const p = o.map((I) => gl(I, u).flatMap((N) => Array.from(N.text, () => t[N.kind]))), g = It(), b = fo(g), T = [], H = /* @__PURE__ */ new Map(), M = [], m = [], P = (I) => {
2394
2394
  if (!Number.isInteger(I) || I < 1 || I > o.length) throw new Error(`codePanel: no line ${I} (it has ${o.length})`);
2395
2395
  }, A = g.tween, k = g.last, y = (I, N, C, S, _, V = 300) => {
2396
2396
  P(I), A(`line.${I}.${N}`, C, S, _, V);
@@ -2404,7 +2404,7 @@ function Wd(e) {
2404
2404
  const C = N + 1;
2405
2405
  x[`line.${C}.highlight`] = 0, x[`line.${C}.strike`] = 0, x[`line.${C}.wipe`] = 0, x[`line.${C}.reveal`] = f.has(C) ? 0 : 1, x[`line.${C}.shift`] = 0;
2406
2406
  });
2407
- const R = {
2407
+ const W = {
2408
2408
  type: "custom",
2409
2409
  x: e.x,
2410
2410
  y: e.y,
@@ -2416,7 +2416,7 @@ function Wd(e) {
2416
2416
  summary: `${o.length} lines of ${u} code. Its lines and words are places in the scene (line(), token(), spot()); its edits are methods that record tracks (tracks()).`,
2417
2417
  // Pieces and inserts add props as they are made; these describe them by pattern.
2418
2418
  get props() {
2419
- return cl(Object.keys(x));
2419
+ return fl(Object.keys(x));
2420
2420
  },
2421
2421
  actions: Pr
2422
2422
  },
@@ -2432,7 +2432,7 @@ function Wd(e) {
2432
2432
  const re = Q + 1, K = S(`line.${re}.wipe`);
2433
2433
  if (K >= 1) return;
2434
2434
  const X = V(re), F = X + a / 2, Z = Math.max(1, L.length) * r, se = Math.round(S(`line.${re}.reveal`) * L.length), ae = H.get(re) ?? { style: "wipe", from: "left" };
2435
- I.save(), K > 0 && hl(I, ae, K, { left: _ - i, top: X, width: i + Z + r, height: a }, c);
2435
+ I.save(), K > 0 && dl(I, ae, K, { left: _ - i, top: X, width: i + Z + r, height: a }, c);
2436
2436
  const ie = S(`line.${re}.highlight`);
2437
2437
  ie > 0 && (I.globalAlpha *= Math.min(1, ie), I.fillStyle = t.highlight, I.fillRect(_ - r / 2, X, Z + r, a), I.globalAlpha /= Math.min(1, ie)), i > 0 && se > 0 && (I.fillStyle = t.gutter, I.textAlign = "right", I.fillText(String(re), _ - r, F), I.textAlign = "left");
2438
2438
  const $ = [
@@ -2444,11 +2444,11 @@ function Wd(e) {
2444
2444
  ee(re, z, Math.min(B.column, se), U, F), U += (B.column - z) * r;
2445
2445
  let le = B.length, D = "";
2446
2446
  if (B.piece) {
2447
- const W = B.piece.written ?? "", J = S(`piece.${B.piece.id}.write`);
2448
- W && J > 0 ? (D = W.slice(0, Math.round(J * W.length)), le = B.length + (W.length - B.length) * Math.min(1, J * 2)) : le = B.length * (1 - S(`piece.${B.piece.id}.away`));
2447
+ const R = B.piece.written ?? "", J = S(`piece.${B.piece.id}.write`);
2448
+ R && J > 0 ? (D = R.slice(0, Math.round(J * R.length)), le = B.length + (R.length - B.length) * Math.min(1, J * 2)) : le = B.length * (1 - S(`piece.${B.piece.id}.away`));
2449
2449
  } else B.insert && (le = B.insert.chars * S(`insert.${B.insert.id}.open`), B.insert.text && (D = B.insert.text.slice(0, Math.round(S(`insert.${B.insert.id}.type`) * B.insert.text.length))));
2450
2450
  I.fillStyle = t.text;
2451
- for (let W = 0; W < D.length; W++) D[W] !== " " && I.fillText(D[W], U + W * r, F);
2451
+ for (let R = 0; R < D.length; R++) D[R] !== " " && I.fillText(D[R], U + R * r, F);
2452
2452
  U += le * r, z = B.column + B.length;
2453
2453
  }
2454
2454
  ee(re, z, Math.max(z, se), U, F);
@@ -2498,7 +2498,7 @@ function Wd(e) {
2498
2498
  }, q = {
2499
2499
  kind: "code",
2500
2500
  about: Gt,
2501
- target: R,
2501
+ target: W,
2502
2502
  lines: o,
2503
2503
  box: w(e.x, e.y, c, l),
2504
2504
  line(I, N = 1 / 0) {
@@ -2632,15 +2632,15 @@ function Wd(e) {
2632
2632
  };
2633
2633
  return q;
2634
2634
  }
2635
- function hl(e, t, o, n, a) {
2635
+ function dl(e, t, o, n, a) {
2636
2636
  if (t.style === "wipe") {
2637
2637
  e.beginPath(), t.from === "right" ? e.rect(n.left, n.top, n.width * (1 - o), n.height) : e.rect(n.left + o * n.width, n.top, n.width * (1 - o), n.height), e.clip();
2638
2638
  return;
2639
2639
  }
2640
- const r = ll * o;
2640
+ const r = cl * o;
2641
2641
  if (r > 0.2 && "filter" in e && (e.filter = `blur(${r.toFixed(1)}px)`), e.globalAlpha *= 1 - o, t.style === "fly") {
2642
2642
  const s = t.from === "right" ? -1 : 1;
2643
- e.translate(s * o * il * a, 0), e.rotate(s * o * 0.08);
2643
+ e.translate(s * o * hl * a, 0), e.rotate(s * o * 0.08);
2644
2644
  } else {
2645
2645
  const s = 1 + 0.08 * o, i = n.left + n.width / 2, h = n.top + n.height / 2;
2646
2646
  e.translate(i, h), e.scale(s, s), e.translate(-i, -h);
@@ -2660,7 +2660,7 @@ const Pr = {
2660
2660
  drop: "drop(piece, n, column, { at, duration? }): put a piece into a line (into its own line it slides, the text closing behind it)",
2661
2661
  ride: "ride(tracks, figureId, { ground }): a figure’s tracks with it carried by the line it stands on"
2662
2662
  };
2663
- function cl(e) {
2663
+ function fl(e) {
2664
2664
  const t = [
2665
2665
  [/^line\.\d+\.highlight$/, { description: "How much the line is tinted", unit: "0..1", min: 0, max: 1 }],
2666
2666
  [/^line\.\d+\.strike$/, { description: "How far the strike-through has drawn", unit: "0..1", min: 0, max: 1 }],
@@ -2694,7 +2694,7 @@ const oo = {
2694
2694
  plain: []
2695
2695
  };
2696
2696
  oo.typescript = [...oo.javascript, "enum", "interface", "type", "implements", "private", "public", "readonly", "keyof", "as", "declare", "namespace"];
2697
- const Uo = Object.keys(oo), dl = {
2697
+ const Uo = Object.keys(oo), ul = {
2698
2698
  go: "//",
2699
2699
  rust: "//",
2700
2700
  csharp: "//",
@@ -2703,8 +2703,8 @@ const Uo = Object.keys(oo), dl = {
2703
2703
  python: "#",
2704
2704
  plain: null
2705
2705
  };
2706
- function fl(e, t) {
2707
- const o = new Set(oo[t]), n = dl[t], a = [], r = (i, h) => {
2706
+ function gl(e, t) {
2707
+ const o = new Set(oo[t]), n = ul[t], a = [], r = (i, h) => {
2708
2708
  const c = a[a.length - 1];
2709
2709
  c && c.kind === h ? c.text += i : a.push({ text: i, kind: h });
2710
2710
  };
@@ -2735,7 +2735,7 @@ function fl(e, t) {
2735
2735
  }
2736
2736
  return a;
2737
2737
  }
2738
- const $o = '"Patrick Hand", "Segoe Print", "Bradley Hand", "Comic Sans MS", "Chalkboard SE", cursive', Wt = {
2738
+ const $o = '"Patrick Hand", "Segoe Print", "Bradley Hand", "Comic Sans MS", "Chalkboard SE", cursive', Rt = {
2739
2739
  whiteboard: {
2740
2740
  background: "#f7f7f2",
2741
2741
  frame: "#b8bcc4",
@@ -2781,11 +2781,11 @@ const $o = '"Patrick Hand", "Segoe Print", "Bradley Hand", "Comic Sans MS", "Cha
2781
2781
  move: "a term; { at, to: an anchor name or { x, y }, duration? }: move the term there",
2782
2782
  fling: "a term; { at, velocity?, spin?, gravity?, duration? }: throw or knock the term off on a spinning arc"
2783
2783
  }
2784
- }, Zn = 90, Qn = 300, ul = 0.3;
2785
- function Rd(e) {
2784
+ }, Zn = 90, Qn = 300, pl = 0.3;
2785
+ function Ld(e) {
2786
2786
  const t = typeof e.theme == "string" ? e.theme : "whiteboard";
2787
- if (!(t in Wt)) throw new Error(`whiteboard: ${fe("theme", t, Object.keys(Wt))}`);
2788
- const o = typeof e.theme == "object" ? { ...Wt.whiteboard, ...e.theme } : Wt[t], n = e.fontSize ?? 28, a = e.charWidth ?? 0.55, r = (m) => m === void 0 ? o.ink : o.colors[m] ?? m, s = (m) => me(e.x + m.left, e.y + m.top, m.width, m.height), i = It(), h = fo(i), c = {}, l = /* @__PURE__ */ new Map(), d = [], f = [], u = (m, P, A, k) => {
2787
+ if (!(t in Rt)) throw new Error(`whiteboard: ${fe("theme", t, Object.keys(Rt))}`);
2788
+ const o = typeof e.theme == "object" ? { ...Rt.whiteboard, ...e.theme } : Rt[t], n = e.fontSize ?? 28, a = e.charWidth ?? 0.55, r = (m) => m === void 0 ? o.ink : o.colors[m] ?? m, s = (m) => me(e.x + m.left, e.y + m.top, m.width, m.height), i = It(), h = fo(i), c = {}, l = /* @__PURE__ */ new Map(), d = [], f = [], u = (m, P, A, k) => {
2789
2789
  const y = l.get(m);
2790
2790
  if (!y || y.kind !== "text") throw Ue("whiteboard", k, Ce, `there is no text "${m}" (texts: ${p().join(", ") || "none"})`);
2791
2791
  let v = -1;
@@ -2832,8 +2832,8 @@ function Rd(e) {
2832
2832
  if (!Jn.includes(m.mark)) throw new Error(`whiteboard: mark "${m.id}": ${fe("mark", m.mark, Jn)}`);
2833
2833
  const P = m.mark === "arrow" ? ["from", "to"] : ["around"];
2834
2834
  for (const v of P) if (typeof m[v] != "string") throw new Error(`whiteboard: ${m.mark} "${m.id}" needs \`${v}\`, a place on the board (an item before it)`);
2835
- const A = new Set([m.from, m.to].filter((v) => typeof v == "string").map((v) => v.split(":")[1])), k = m.mark === "arrow" ? [...l.values()].filter((v) => v.kind === "text" && !A.has(v.item.id)).map((v) => v.box) : [], y = gl(m, b, n, k);
2836
- l.set(m.id, { kind: "mark", item: m, color: r(m.color), points: y, box: yl(y) }), c[`mark.${m.id}.draw`] = m.hidden ? 0 : 1, c[`mark.${m.id}.erase`] = 0;
2835
+ const A = new Set([m.from, m.to].filter((v) => typeof v == "string").map((v) => v.split(":")[1])), k = m.mark === "arrow" ? [...l.values()].filter((v) => v.kind === "text" && !A.has(v.item.id)).map((v) => v.box) : [], y = ml(m, b, n, k);
2836
+ l.set(m.id, { kind: "mark", item: m, color: r(m.color), points: y, box: wl(y) }), c[`mark.${m.id}.draw`] = m.hidden ? 0 : 1, c[`mark.${m.id}.erase`] = 0;
2837
2837
  }
2838
2838
  const T = (m) => d.filter((P) => P.item === m), H = {
2839
2839
  type: "custom",
@@ -2846,7 +2846,7 @@ function Rd(e) {
2846
2846
  kind: "whiteboard",
2847
2847
  summary: `A board with ${l.size} items. Its texts, terms and marks are places in the scene (anchor()); its edits record tracks (edit(), tracks()).`,
2848
2848
  get props() {
2849
- return bl(Object.keys(c));
2849
+ return kl(Object.keys(c));
2850
2850
  },
2851
2851
  actions: Ce.edits
2852
2852
  },
@@ -2881,16 +2881,16 @@ function Rd(e) {
2881
2881
  m.font = `${v.size}px ${o.font}`, m.fillStyle = v.color;
2882
2882
  const E = y.written;
2883
2883
  if (E) {
2884
- const R = k(`piece.${y.id}.write`) * E.length, G = y.home.x - e.x - E.length * w / 2;
2885
- for (let Y = 0; Y < Math.ceil(R); Y++)
2886
- E[Y] !== " " && (m.globalAlpha = o.opacity * Math.min(1, R - Y), m.fillText(E[Y], G + (Y + 0.5) * w, y.home.y - e.y));
2884
+ const W = k(`piece.${y.id}.write`) * E.length, G = y.home.x - e.x - E.length * w / 2;
2885
+ for (let Y = 0; Y < Math.ceil(W); Y++)
2886
+ E[Y] !== " " && (m.globalAlpha = o.opacity * Math.min(1, W - Y), m.fillText(E[Y], G + (Y + 0.5) * w, y.home.y - e.y));
2887
2887
  }
2888
2888
  const O = k(`piece.${y.id}.opacity`) * Math.min(1, k(`text.${y.item}.write`) * v.item.text.length - y.column);
2889
2889
  if (O <= 0) continue;
2890
2890
  m.save();
2891
2891
  const j = { x: y.home.x - e.x, y: y.home.y - e.y }, x = { x: k(`piece.${y.id}.x`), y: k(`piece.${y.id}.y`) };
2892
2892
  Eo(m, me(j.x + x.x - y.home.width / 2, j.y + x.y - y.home.height / 2, y.home.width, y.home.height), k(`piece.${y.id}.erase`)), Math.hypot(x.x, x.y) < 1 && Eo(m, v.box, k(`text.${y.item}.erase`)), m.globalAlpha = o.opacity * Math.min(1, O), m.translate(j.x + x.x, j.y + x.y), m.rotate(k(`piece.${y.id}.rotate`) * Math.PI / 180);
2893
- for (let R = 0; R < y.text.length; R++) y.text[R] !== " " && m.fillText(y.text[R], (R + 0.5 - y.text.length / 2) * w, 0);
2893
+ for (let W = 0; W < y.text.length; W++) y.text[W] !== " " && m.fillText(y.text[W], (W + 0.5 - y.text.length / 2) * w, 0);
2894
2894
  m.restore();
2895
2895
  }
2896
2896
  m.restore();
@@ -2985,14 +2985,14 @@ function Rd(e) {
2985
2985
  };
2986
2986
  return M;
2987
2987
  }
2988
- function gl(e, t, o, n = []) {
2989
- const a = rn(Fe(e.id)), r = (g) => (a.next() * 2 - 1) * g, s = o * ul;
2988
+ function ml(e, t, o, n = []) {
2989
+ const a = rn(Fe(e.id)), r = (g) => (a.next() * 2 - 1) * g, s = o * pl;
2990
2990
  if (e.mark === "arrow") {
2991
- const g = t(e.from), b = t(e.to), T = es(g, b, s * 0.6), H = es(b, g, s * 0.6), M = Math.hypot(H.x - T.x, H.y - T.y), m = ml(T, H);
2991
+ const g = t(e.from), b = t(e.to), T = es(g, b, s * 0.6), H = es(b, g, s * 0.6), M = Math.hypot(H.x - T.x, H.y - T.y), m = bl(T, H);
2992
2992
  let P = M * (0.06 + r(0.04));
2993
2993
  if (e.bend !== void 0) P = M * e.bend;
2994
2994
  else {
2995
- const y = pl(T, H, m, n, s);
2995
+ const y = yl(T, H, m, n, s);
2996
2996
  y !== 0 && (P = y);
2997
2997
  }
2998
2998
  const A = { x: (T.x + H.x) / 2 + m.x * P, y: (T.y + H.y) / 2 + m.y * P }, k = [];
@@ -3022,7 +3022,7 @@ function gl(e, t, o, n = []) {
3022
3022
  }
3023
3023
  return p;
3024
3024
  }
3025
- function pl(e, t, o, n, a) {
3025
+ function yl(e, t, o, n, a) {
3026
3026
  const r = Math.hypot(t.x - e.x, t.y - e.y);
3027
3027
  if (r < 1e-6) return 0;
3028
3028
  const s = { x: (t.x - e.x) / r, y: (t.y - e.y) / r };
@@ -3044,11 +3044,11 @@ function es(e, t, o) {
3044
3044
  const r = Math.min(n === 0 ? 1 / 0 : (e.width / 2 + o) / Math.abs(n), a === 0 ? 1 / 0 : (e.height / 2 + o) / Math.abs(a));
3045
3045
  return { x: e.x + n * r, y: e.y + a * r };
3046
3046
  }
3047
- function ml(e, t) {
3047
+ function bl(e, t) {
3048
3048
  const o = Math.hypot(t.x - e.x, t.y - e.y) || 1;
3049
3049
  return { x: -(t.y - e.y) / o, y: (t.x - e.x) / o };
3050
3050
  }
3051
- function yl(e) {
3051
+ function wl(e) {
3052
3052
  const t = e.map((r) => r.x), o = e.map((r) => r.y), n = Math.min(...t), a = Math.min(...o);
3053
3053
  return me(n, a, Math.max(...t) - n, Math.max(...o) - a);
3054
3054
  }
@@ -3082,7 +3082,7 @@ function Eo(e, t, o) {
3082
3082
  function os(e, t, o, n, a, r) {
3083
3083
  e.beginPath(), e.moveTo(t + r, o), e.arcTo(t + n, o, t + n, o + a, r), e.arcTo(t + n, o + a, t, o + a, r), e.arcTo(t, o + a, t, o, r), e.arcTo(t, o, t + n, o, r), e.closePath();
3084
3084
  }
3085
- function bl(e) {
3085
+ function kl(e) {
3086
3086
  const t = [
3087
3087
  [/^text\..+\.write$/, { description: "How much of the text is written", unit: "0..1", min: 0, max: 1 }],
3088
3088
  [/^(text|mark)\..+\.erase$/, { description: "How far it has been wiped off, left to right", unit: "0..1", min: 0, max: 1 }],
@@ -3100,7 +3100,7 @@ function bl(e) {
3100
3100
  }
3101
3101
  return o;
3102
3102
  }
3103
- const ns = ["bar", "line", "pie", "donut"], ss = 'system-ui, -apple-system, "Segoe UI", sans-serif', Rt = {
3103
+ const ns = ["bar", "line", "pie", "donut"], ss = 'system-ui, -apple-system, "Segoe UI", sans-serif', Wt = {
3104
3104
  light: {
3105
3105
  background: "#ffffff",
3106
3106
  text: "#3b4252",
@@ -3137,12 +3137,12 @@ const ns = ["bar", "line", "pie", "donut"], ss = 'system-ui, -apple-system, "Seg
3137
3137
  highlight: "bar, point or slice anchors; { at, duration?, on? }: colour it out (on: false clears)",
3138
3138
  pull: "slice anchors; { at, duration?, on? }: pull the slice out from the centre (on: false puts it back)"
3139
3139
  }
3140
- }, wl = 600, kl = 500, vl = 200, Sl = 400, Ml = 0.14, $l = Math.PI * 2;
3141
- function zd(e) {
3140
+ }, vl = 600, Sl = 500, Ml = 200, $l = 400, El = 0.14, Al = Math.PI * 2;
3141
+ function Fd(e) {
3142
3142
  if (!ns.includes(e.kind)) throw new Error(`chart: ${fe("kind", e.kind, ns)}`);
3143
3143
  const t = typeof e.theme == "string" ? e.theme : "light";
3144
- if (!(t in Rt)) throw new Error(`chart: ${fe("theme", t, Object.keys(Rt))}`);
3145
- const o = typeof e.theme == "object" ? { ...Rt.light, ...e.theme } : Rt[t];
3144
+ if (!(t in Wt)) throw new Error(`chart: ${fe("theme", t, Object.keys(Wt))}`);
3145
+ const o = typeof e.theme == "object" ? { ...Wt.light, ...e.theme } : Wt[t];
3146
3146
  if (!Array.isArray(e.data) || e.data.length === 0) throw new Error("chart: `data` needs at least one { id, value }");
3147
3147
  const n = e.kind, a = n === "pie" || n === "donut", r = Array.isArray(e.series) && e.series.length > 1, s = Array.isArray(e.series) && e.series.length > 0 ? e.series : [{ id: "value" }];
3148
3148
  if (a && r) throw new Error(`chart: a ${n} shows one series (got ${s.length}); make a chart per series`);
@@ -3164,17 +3164,17 @@ function zd(e) {
3164
3164
  for (const z of s) d($, z);
3165
3165
  l.add($.id);
3166
3166
  }
3167
- const f = n === "bar" ? "bar" : n === "line" ? "point" : "slice", u = Math.max(...e.data.flatMap(($) => s.map((z) => d($, z)))), p = a ? e.data.reduce(($, z) => $ + d(z, s[0]), 0) : e.max ?? El(u * 1.1);
3167
+ const f = n === "bar" ? "bar" : n === "line" ? "point" : "slice", u = Math.max(...e.data.flatMap(($) => s.map((z) => d($, z)))), p = a ? e.data.reduce(($, z) => $ + d(z, s[0]), 0) : e.max ?? Tl(u * 1.1);
3168
3168
  if (!a && !(p > 0)) throw new Error(`chart: \`max\` must be above 0 (got ${p})`);
3169
3169
  const g = Math.max(10, Math.min(16, e.height / 20)), b = r && e.legend !== !1, T = a ? void 0 : e.axis?.x, H = a ? void 0 : e.axis?.y, M = e.title ? g * 2.3 : g * 0.5, m = {
3170
3170
  left: g * 3.6 + (H ? g * 1.5 : 0),
3171
3171
  right: e.width - g,
3172
3172
  top: (e.title ? g * 3 : g * 1.6) + (b ? g * 1.6 : 0),
3173
3173
  bottom: e.height - g * 2.4 - (T ? g * 1.4 : 0)
3174
- }, P = m.bottom - m.top, A = (m.right - m.left) / e.data.length, k = r ? A * 0.72 / s.length : A * 0.6, y = r ? k * 0.86 : k, v = Math.max(4, g * 0.35), w = P / p, E = new Map(e.data.map(($, z) => [$.id, z])), O = ($) => m.left + A * (E.get($) + 0.5), j = ($, z) => r ? O($) - A * 0.36 + k * h.get(z) + (k - y) / 2 : O($) - y / 2, x = ($, z) => j($, z) + y / 2, R = e.height - g * 1.2, G = {
3174
+ }, P = m.bottom - m.top, A = (m.right - m.left) / e.data.length, k = r ? A * 0.72 / s.length : A * 0.6, y = r ? k * 0.86 : k, v = Math.max(4, g * 0.35), w = P / p, E = new Map(e.data.map(($, z) => [$.id, z])), O = ($) => m.left + A * (E.get($) + 0.5), j = ($, z) => r ? O($) - A * 0.36 + k * h.get(z) + (k - y) / 2 : O($) - y / 2, x = ($, z) => j($, z) + y / 2, W = e.height - g * 1.2, G = {
3175
3175
  cx: e.width / 2,
3176
- cy: (m.top + R) / 2,
3177
- r: Math.max(10, Math.min(e.width / 2, (R - m.top) / 2) - g * 2.6)
3176
+ cy: (m.top + W) / 2,
3177
+ r: Math.max(10, Math.min(e.width / 2, (W - m.top) / 2) - g * 2.6)
3178
3178
  }, Y = n === "donut" ? G.r * 0.55 : 0, oe = n === "donut" ? (Y + G.r) / 2 : G.r * 0.62, q = /* @__PURE__ */ new Map();
3179
3179
  if (b) {
3180
3180
  let $ = m.right;
@@ -3188,10 +3188,10 @@ function zd(e) {
3188
3188
  for (const z of s)
3189
3189
  C[S($.id, z.id, "value")] = d($, z), C[S($.id, z.id, "show")] = $.hidden ? 0 : 1, C[S($.id, z.id, "highlight")] = 0, a && (C[S($.id, z.id, "pull")] = 0);
3190
3190
  const _ = ($, z) => I.keys($)?.length ? bn(I.keys($), z) : C[$], V = ($, z, U) => _(S($, z, "value"), U) * (n === "bar" ? _(S($, z, "show"), U) : 1) * w, ee = ($) => {
3191
- const z = s[0].id, U = e.data.map((D) => Math.max(0, $(S(D.id, z, "value"))) * Math.max(0, Math.min(1, $(S(D.id, z, "show"))))), te = U.reduce((D, W) => D + W, 0), B = /* @__PURE__ */ new Map();
3191
+ const z = s[0].id, U = e.data.map((D) => Math.max(0, $(S(D.id, z, "value"))) * Math.max(0, Math.min(1, $(S(D.id, z, "show"))))), te = U.reduce((D, R) => D + R, 0), B = /* @__PURE__ */ new Map();
3192
3192
  let le = -Math.PI / 2;
3193
- return e.data.forEach((D, W) => {
3194
- const J = te > 0 ? $l * U[W] / te : 0, he = le + J / 2, de = Math.max(0, Math.min(1, $(S(D.id, z, "pull")))) * G.r * Ml;
3193
+ return e.data.forEach((D, R) => {
3194
+ const J = te > 0 ? Al * U[R] / te : 0, he = le + J / 2, de = Math.max(0, Math.min(1, $(S(D.id, z, "pull")))) * G.r * El;
3195
3195
  B.set(D.id, {
3196
3196
  start: le,
3197
3197
  sweep: J,
@@ -3214,7 +3214,7 @@ function zd(e) {
3214
3214
  if (!U) throw te(`write it ${z}:ID`);
3215
3215
  const B = U.indexOf(":"), le = B < 0 ? U : U.slice(0, B), D = B < 0 ? s[0].id : U.slice(B + 1);
3216
3216
  if (!E.has(le)) throw te(`there is no "${le}" (data: ${[...E.keys()].join(", ")})`);
3217
- if (!i.has(D)) throw te(`there is no series "${D}" (series: ${s.map((W) => W.id).join(", ")})`);
3217
+ if (!i.has(D)) throw te(`there is no series "${D}" (series: ${s.map((R) => R.id).join(", ")})`);
3218
3218
  if (z === "label" && B >= 0) throw te("a label is one per datum: label:ID");
3219
3219
  if ((z === "bar" || z === "point" || z === "slice") && z !== f) throw te(`a ${n} chart has ${f}s, not ${z}s: ${f}:${le}`);
3220
3220
  return { kind: z, id: le, series: D };
@@ -3224,8 +3224,8 @@ function zd(e) {
3224
3224
  if ($.kind === "box") return me(0, 0, e.width, e.height);
3225
3225
  if ($.kind === "legend") return q.get($.series);
3226
3226
  if (a) {
3227
- const D = L(z).get($.id), W = Math.max(g * 1.5, G.r * 0.42);
3228
- if ($.kind === "slice") return me(D.centre.x - W / 2, D.centre.y - W / 2, W, W);
3227
+ const D = L(z).get($.id), R = Math.max(g * 1.5, G.r * 0.42);
3228
+ if ($.kind === "slice") return me(D.centre.x - R / 2, D.centre.y - R / 2, R, R);
3229
3229
  const J = K(D);
3230
3230
  return $.kind === "label" ? J : D.sweep >= 0.3 ? me(D.centre.x - g * 1.6, D.centre.y - g * 0.65, g * 3.2, g * 1.3) : me(J.left, J.bottom, J.width, g * 1.3);
3231
3231
  }
@@ -3248,7 +3248,7 @@ function zd(e) {
3248
3248
  about: {
3249
3249
  kind: `${n} chart`,
3250
3250
  summary: `A ${n} chart of ${e.data.length} values (${e.data.map(($) => $.id).join(", ")})${r ? ` in ${s.length} series (${s.map(($) => $.id).join(", ")})` : ""}${a ? "" : `, scaled to ${p}`}. Its ${f}s and labels are places in the scene (anchor()); its edits record tracks (edit(), tracks()).`,
3251
- props: Object.fromEntries(Object.keys(C).map(($) => [$, Pl($)])),
3251
+ props: Object.fromEntries(Object.keys(C).map(($) => [$, Hl($)])),
3252
3252
  actions: st.edits
3253
3253
  },
3254
3254
  draw($, z) {
@@ -3256,8 +3256,8 @@ function zd(e) {
3256
3256
  if ($.save(), $.fillStyle = o.background, rs($, 0, 0, e.width, e.height, 8), $.fill(), $.font = `${g}px ${o.font}`, $.textBaseline = "middle", e.title && ($.fillStyle = o.text, $.textAlign = "left", $.font = `600 ${g * 1.2}px ${o.font}`, $.fillText(e.title, a ? g : m.left, g * 1.5), $.font = `${g}px ${o.font}`), b) {
3257
3257
  $.textAlign = "left";
3258
3258
  for (const D of s) {
3259
- const W = q.get(D.id);
3260
- $.fillStyle = c(D.id), rs($, W.left, W.top + g * 0.25, g * 0.9, g * 0.9, 2), $.fill(), $.fillStyle = o.text, $.fillText(D.label ?? D.id, W.left + g * 1.3, W.top + W.height / 2);
3259
+ const R = q.get(D.id);
3260
+ $.fillStyle = c(D.id), rs($, R.left, R.top + g * 0.25, g * 0.9, g * 0.9, 2), $.fill(), $.fillStyle = o.text, $.fillText(D.label ?? D.id, R.left + g * 1.3, R.top + R.height / 2);
3261
3261
  }
3262
3262
  }
3263
3263
  if (a) {
@@ -3266,16 +3266,16 @@ function zd(e) {
3266
3266
  }
3267
3267
  $.lineWidth = 1, $.textAlign = "right";
3268
3268
  for (let D = 0; D <= 4; D++) {
3269
- const W = m.bottom - P * D / 4;
3270
- $.strokeStyle = o.grid, $.beginPath(), $.moveTo(m.left, W), $.lineTo(m.right, W), $.stroke(), $.fillStyle = o.text, $.globalAlpha = 0.7, $.fillText(Al(p * D / 4), m.left - g * 0.5, W), $.globalAlpha = 1;
3269
+ const R = m.bottom - P * D / 4;
3270
+ $.strokeStyle = o.grid, $.beginPath(), $.moveTo(m.left, R), $.lineTo(m.right, R), $.stroke(), $.fillStyle = o.text, $.globalAlpha = 0.7, $.fillText(Pl(p * D / 4), m.left - g * 0.5, R), $.globalAlpha = 1;
3271
3271
  }
3272
3272
  (H || T) && ($.fillStyle = o.text, $.textAlign = "center", $.globalAlpha = 0.85, H && ($.save(), $.translate(g * 0.9, (m.top + m.bottom) / 2), $.rotate(-Math.PI / 2), $.fillText(H, 0, 0), $.restore()), T && $.fillText(T, (m.left + m.right) / 2, m.bottom + g * 2.3), $.globalAlpha = 1);
3273
- const B = (D, W) => te(S(D, W, "value")) * (n === "bar" ? te(S(D, W, "show")) : 1) * w, le = (D, W) => Ao(c(W), o.highlight, te(S(D, W, "highlight")));
3273
+ const B = (D, R) => te(S(D, R, "value")) * (n === "bar" ? te(S(D, R, "show")) : 1) * w, le = (D, R) => Ao(c(R), o.highlight, te(S(D, R, "highlight")));
3274
3274
  if (n === "line") {
3275
3275
  $.lineWidth = Math.max(2, g * 0.2), $.lineJoin = "round", $.lineCap = "round";
3276
3276
  for (const D of s)
3277
- $.strokeStyle = c(D.id), $.beginPath(), e.data.forEach((W, J) => {
3278
- const he = { x: O(W.id), y: m.bottom - B(W.id, D.id) }, de = te(S(W.id, D.id, "show"));
3277
+ $.strokeStyle = c(D.id), $.beginPath(), e.data.forEach((R, J) => {
3278
+ const he = { x: O(R.id), y: m.bottom - B(R.id, D.id) }, de = te(S(R.id, D.id, "show"));
3279
3279
  if (J === 0) {
3280
3280
  de > 0 && $.moveTo(he.x, he.y);
3281
3281
  return;
@@ -3288,12 +3288,12 @@ function zd(e) {
3288
3288
  }
3289
3289
  $.textAlign = "center";
3290
3290
  for (const D of e.data) {
3291
- for (const W of s) {
3292
- const J = n === "bar" ? x(D.id, W.id) : O(D.id), he = B(D.id, W.id), de = te(S(D.id, W.id, "show"));
3293
- if ($.fillStyle = le(D.id, W.id), n === "bar" ? he > 0.5 && (Tl($, J - y / 2, m.bottom - he, y, he, Math.min(6, y / 4)), $.fill()) : de > 0 && ($.beginPath(), $.arc(J, m.bottom - he, v * Math.min(1, de * 1.5) * (1 + 0.3 * te(S(D.id, W.id, "highlight"))), 0, Math.PI * 2), $.fill()), e.values !== !1 && de > 0) {
3294
- $.globalAlpha = Math.min(1, de * 2), $.font = `600 ${r ? g * 0.85 : g}px ${o.font}`, $.fillStyle = Ao(o.text, o.highlight, te(S(D.id, W.id, "highlight")));
3291
+ for (const R of s) {
3292
+ const J = n === "bar" ? x(D.id, R.id) : O(D.id), he = B(D.id, R.id), de = te(S(D.id, R.id, "show"));
3293
+ if ($.fillStyle = le(D.id, R.id), n === "bar" ? he > 0.5 && (Ol($, J - y / 2, m.bottom - he, y, he, Math.min(6, y / 4)), $.fill()) : de > 0 && ($.beginPath(), $.arc(J, m.bottom - he, v * Math.min(1, de * 1.5) * (1 + 0.3 * te(S(D.id, R.id, "highlight"))), 0, Math.PI * 2), $.fill()), e.values !== !1 && de > 0) {
3294
+ $.globalAlpha = Math.min(1, de * 2), $.font = `600 ${r ? g * 0.85 : g}px ${o.font}`, $.fillStyle = Ao(o.text, o.highlight, te(S(D.id, R.id, "highlight")));
3295
3295
  const pe = m.bottom - he - (n === "line" ? v : 0) - g * 0.95;
3296
- $.fillText(F(te(S(D.id, W.id, "value"))), J, pe), $.font = `${g}px ${o.font}`, $.globalAlpha = 1;
3296
+ $.fillText(F(te(S(D.id, R.id, "value"))), J, pe), $.font = `${g}px ${o.font}`, $.globalAlpha = 1;
3297
3297
  }
3298
3298
  }
3299
3299
  $.fillStyle = o.text, $.fillText(D.label ?? D.id, O(D.id), m.bottom + g * 1.1);
@@ -3306,7 +3306,7 @@ function zd(e) {
3306
3306
  e.data.forEach((B, le) => {
3307
3307
  const D = te.get(B.id);
3308
3308
  if (D.sweep <= 1e-4) return;
3309
- const W = Z.get(B.id), J = W ? { x: z(`piece.${W.id}.x`), y: z(`piece.${W.id}.y`) } : { x: 0, y: 0 }, he = W ? z(`piece.${W.id}.rotate`) * Math.PI / 180 : 0, de = W ? z(`piece.${W.id}.opacity`) : 1;
3309
+ const R = Z.get(B.id), J = R ? { x: z(`piece.${R.id}.x`), y: z(`piece.${R.id}.y`) } : { x: 0, y: 0 }, he = R ? z(`piece.${R.id}.rotate`) * Math.PI / 180 : 0, de = R ? z(`piece.${R.id}.opacity`) : 1;
3310
3310
  if (de <= 0) return;
3311
3311
  $.save(), $.globalAlpha = de;
3312
3312
  const pe = { x: G.cx + Math.cos(D.mid) * D.out, y: G.cy + Math.sin(D.mid) * D.out };
@@ -3349,11 +3349,11 @@ function zd(e) {
3349
3349
  return D;
3350
3350
  });
3351
3351
  for (const { id: le, series: D } of B) {
3352
- const W = (J) => S(le, D, J);
3352
+ const R = (J) => S(le, D, J);
3353
3353
  if ($ === "set") {
3354
3354
  if (typeof U.value != "number" || !Number.isFinite(U.value)) throw new Error("chart.edit: set needs `value`, a number");
3355
- I.tween(W("value"), _(W("value"), U.at), U.value, U, wl);
3356
- } else $ === "show" ? I.tween(W("show"), _(W("show"), U.at), U.on === !1 ? 0 : 1, U, kl) : $ === "pull" ? I.tween(W("pull"), _(W("pull"), U.at), U.on === !1 ? 0 : 1, U, Sl) : I.tween(W("highlight"), _(W("highlight"), U.at), U.on === !1 ? 0 : 1, U, vl);
3355
+ I.tween(R("value"), _(R("value"), U.at), U.value, U, vl);
3356
+ } else $ === "show" ? I.tween(R("show"), _(R("show"), U.at), U.on === !1 ? 0 : 1, U, Sl) : $ === "pull" ? I.tween(R("pull"), _(R("pull"), U.at), U.on === !1 ? 0 : 1, U, $l) : I.tween(R("highlight"), _(R("highlight"), U.at), U.on === !1 ? 0 : 1, U, Ml);
3357
3357
  }
3358
3358
  return ie;
3359
3359
  },
@@ -3370,8 +3370,8 @@ function zd(e) {
3370
3370
  if (n !== "bar") return $;
3371
3371
  const te = e.data.flatMap(
3372
3372
  (B) => s.map((le) => {
3373
- const D = V(B.id, le.id, 0), W = [...Pt(I.keys(S(B.id, le.id, "value"))), ...Pt(I.keys(S(B.id, le.id, "show")))];
3374
- return { top: e.y + m.bottom - D, offset: (J) => D - V(B.id, le.id, J), windows: W };
3373
+ const D = V(B.id, le.id, 0), R = [...Pt(I.keys(S(B.id, le.id, "value"))), ...Pt(I.keys(S(B.id, le.id, "show")))];
3374
+ return { top: e.y + m.bottom - D, offset: (J) => D - V(B.id, le.id, J), windows: R };
3375
3375
  })
3376
3376
  );
3377
3377
  return wn($, z, { ground: U.ground, every: U.every ?? Ye, floors: te });
@@ -3380,13 +3380,13 @@ function zd(e) {
3380
3380
  };
3381
3381
  return ie;
3382
3382
  }
3383
- function El(e) {
3383
+ function Tl(e) {
3384
3384
  if (!(e > 0)) return 1;
3385
3385
  const t = 10 ** Math.floor(Math.log10(e));
3386
3386
  for (const o of [1, 2, 2.5, 5, 10]) if (o * t >= e - 1e-9) return o * t;
3387
3387
  return 10 * t;
3388
3388
  }
3389
- function Al(e) {
3389
+ function Pl(e) {
3390
3390
  return Number.isInteger(e) ? String(e) : String(Number(e.toFixed(2)));
3391
3391
  }
3392
3392
  function Ao(e, t, o) {
@@ -3400,14 +3400,14 @@ function Ao(e, t, o) {
3400
3400
  function rs(e, t, o, n, a, r) {
3401
3401
  e.beginPath(), e.moveTo(t + r, o), e.arcTo(t + n, o, t + n, o + a, r), e.arcTo(t + n, o + a, t, o + a, r), e.arcTo(t, o + a, t, o, r), e.arcTo(t, o, t + n, o, r), e.closePath();
3402
3402
  }
3403
- function Tl(e, t, o, n, a, r) {
3403
+ function Ol(e, t, o, n, a, r) {
3404
3404
  const s = Math.min(r, a);
3405
3405
  e.beginPath(), e.moveTo(t, o + a), e.lineTo(t, o + s), e.arcTo(t, o, t + s, o, s), e.lineTo(t + n - s, o), e.arcTo(t + n, o, t + n, o + s, s), e.lineTo(t + n, o + a), e.closePath();
3406
3406
  }
3407
- function Pl(e) {
3407
+ function Hl(e) {
3408
3408
  return e.endsWith(".value") ? { description: "Its value (the bar’s height, the point’s, or the slice’s share, and its value label)", unit: "value" } : e.endsWith(".show") ? { description: "How much of it is shown: a bar grown in from the axis, the line drawn out to the point, a slice opened", unit: "0..1", min: 0, max: 1 } : e.endsWith(".pull") ? { description: "How far the slice is pulled out from the centre", unit: "0..1", min: 0, max: 1 } : e.startsWith("piece.") ? { description: e.endsWith(".opacity") ? "The loose slice’s opacity" : e.endsWith(".rotate") ? "The loose slice’s turn, degrees" : "The loose slice’s offset from home, px", unit: e.endsWith(".rotate") ? "degrees" : e.endsWith(".opacity") ? "0..1" : "px" } : { description: "How much it is coloured out", unit: "0..1", min: 0, max: 1 };
3409
3409
  }
3410
- const Ol = {
3410
+ const Il = {
3411
3411
  animeBoy: {
3412
3412
  label: "Anime boy",
3413
3413
  group: "anime",
@@ -3569,7 +3569,7 @@ const Ol = {
3569
3569
  outfit: { shirt: "#6d9b93", trousers: "#66597a", sleeves: "long", over: "cardigan", overColor: "#6d9b93", shoes: "boots" }
3570
3570
  }
3571
3571
  }
3572
- }, Hl = {
3572
+ }, xl = {
3573
3573
  mangaYoungMan: {
3574
3574
  label: "Manga young man",
3575
3575
  group: "manga",
@@ -3746,10 +3746,10 @@ const Ol = {
3746
3746
  scale: 0.97,
3747
3747
  options: { build: "stocky", hair: { style: "shoulderStraight", color: xe.blond }, hat: "sunHat", ears: !0, outfit: { shirt: "#d64535", trousers: "#4f6b3a", sleeves: "long" } }
3748
3748
  },
3749
- ...Ol,
3750
- ...Hl
3749
+ ...Il,
3750
+ ...xl
3751
3751
  };
3752
- function Ld(e, t = 300, o = {}) {
3752
+ function Dd(e, t = 300, o = {}) {
3753
3753
  const n = Or[e];
3754
3754
  if (!n) throw new Error(`castMember: unknown cast member '${e}'`);
3755
3755
  return { ...n.options, height: Math.round(t * n.scale), ...o };
@@ -3760,11 +3760,11 @@ const no = {
3760
3760
  fistBump: { height: 0.55, spacing: 0.44, lean: 6 },
3761
3761
  handOver: { height: 0.52, spacing: 0.46, lean: 8 }
3762
3762
  };
3763
- function Fd(e, t, o) {
3763
+ function qd(e, t, o) {
3764
3764
  return no[e].spacing * Math.min(t.height, o.height);
3765
3765
  }
3766
3766
  const as = 0.075;
3767
- function Dd(e, t, o, n = {}) {
3767
+ function Bd(e, t, o, n = {}) {
3768
3768
  const a = no[e];
3769
3769
  if (!a) throw new Error(`meetHands: unknown meeting '${e}' (one of ${Object.keys(no).join(", ")})`);
3770
3770
  const [r, s] = t.x <= o.x ? [t, o] : [o, t], i = n.view === "side", h = Math.min(r.character.height, s.character.height), c = { x: (r.x + s.x) / 2, y: -(n.height ?? a.height) * h }, l = (b, T) => {
@@ -3786,10 +3786,10 @@ function Dd(e, t, o, n = {}) {
3786
3786
  return t.x <= o.x ? { a: d, b: f, point: c, reached: g } : { a: f, b: d, point: c, reached: g };
3787
3787
  }
3788
3788
  const Xo = { spacing: 0.3, lean: 10, tilt: 8 };
3789
- function qd(e, t) {
3789
+ function Gd(e, t) {
3790
3790
  return Xo.spacing * Math.min(e.height, t.height);
3791
3791
  }
3792
- function Bd(e, t, o = {}) {
3792
+ function Yd(e, t, o = {}) {
3793
3793
  const [n, a] = e.x <= t.x ? [e, t] : [t, e], r = o.view === "side", s = Math.min(n.character.height, a.character.height), i = (p, g, b) => ({
3794
3794
  over: { x: g.x - b * 0.02 * s - p.x, y: -0.72 * s, depth: -0.08 * s },
3795
3795
  round: { x: g.x - b * 0.04 * s - p.x, y: -0.5 * s, depth: 0.06 * s }
@@ -3805,10 +3805,10 @@ function Bd(e, t, o = {}) {
3805
3805
  return e.x <= t.x ? { a: c, b: l, reached: u } : { a: l, b: c, reached: u };
3806
3806
  }
3807
3807
  const rt = { spacing: 0.32, low: 0.3, high: 0.5, helperLean: 40, helperBend: 16 };
3808
- function Gd(e, t) {
3808
+ function Ud(e, t) {
3809
3809
  return rt.spacing * Math.min(e.height, t.height);
3810
3810
  }
3811
- function Yd(e, t, o, n = {}) {
3811
+ function Xd(e, t, o, n = {}) {
3812
3812
  const a = Math.max(0, Math.min(1, o)), r = n.view === "side", s = e.x <= t.x, i = Math.min(e.character.height, t.character.height), h = { x: (e.x + t.x) / 2, y: -(rt.low + (rt.high - rt.low) * a) * i }, c = (b) => b ? r ? 1 : 0.62 : r ? 3 : 3.38;
3813
3813
  let l = { ...ye, ...e.pose, turn: c(s), lean: (e.pose?.lean ?? 0) + rt.helperLean * (1 - a) + 4, bend: (e.pose?.bend ?? 0) + rt.helperBend * (1 - a), "head.nod": 18 * (1 - a) };
3814
3814
  l = Le(e.character, l, "arm.right", { x: h.x - e.x, y: h.y });
@@ -3821,8 +3821,8 @@ function Yd(e, t, o, n = {}) {
3821
3821
  };
3822
3822
  return { helper: l, sitter: u, point: h, reached: g(e, l) && g(t, u) };
3823
3823
  }
3824
- const Il = 0.7, xl = 50, jl = 1.2, _l = 0.8, Kl = 3, Nl = 30, Cl = 0.8, Wl = 0.6, To = (e, t) => Math.max(-t, Math.min(t, e)), Rl = ["hair.swing", "hair.trail", "hair.lift"];
3825
- function zl(e, t) {
3824
+ const jl = 0.7, _l = 50, Kl = 1.2, Nl = 0.8, Cl = 3, Rl = 30, Wl = 0.8, zl = 0.6, To = (e, t) => Math.max(-t, Math.min(t, e)), Ll = ["hair.swing", "hair.trail", "hair.lift"];
3825
+ function Fl(e, t) {
3826
3826
  const o = t.start ?? 0, n = t.amount ?? 1, a = Math.max(1e-6, t.headRadius);
3827
3827
  let r = NaN, s = { x: 0, y: 0, turn: 0 };
3828
3828
  const i = (u) => (u !== r && (s = e(u), r = u), s), h = (u) => {
@@ -3830,16 +3830,16 @@ function zl(e, t) {
3830
3830
  return p.turn * 90 + (p.headTurn ?? 0);
3831
3831
  }, c = { start: o, end: t.end, step: t.step, stiffness: t.stiffness ?? 70, damping: t.damping ?? 6 }, l = Bt(h, c), d = Bt((u) => i(u).x, c), f = Bt((u) => i(u).y, c);
3832
3832
  return l.map((u, p) => {
3833
- const g = i(u.time), b = u.value - h(u.time), T = d[p].value - g.x - (t.wind ?? 0) * Il * a, H = f[p].value - g.y, M = Math.sin(g.turn * Math.PI / 2), m = Math.cos(g.turn * Math.PI / 2), P = b * Kl + T * m / a * Nl, A = -T * M / a * Cl, k = -H / a * Wl;
3833
+ const g = i(u.time), b = u.value - h(u.time), T = d[p].value - g.x - (t.wind ?? 0) * jl * a, H = f[p].value - g.y, M = Math.sin(g.turn * Math.PI / 2), m = Math.cos(g.turn * Math.PI / 2), P = b * Cl + T * m / a * Rl, A = -T * M / a * Wl, k = -H / a * zl;
3834
3834
  return {
3835
3835
  time: u.time,
3836
- swing: To(P * n, xl),
3837
- trail: To(A * n, jl),
3838
- lift: To(k * n, _l)
3836
+ swing: To(P * n, _l),
3837
+ trail: To(A * n, Kl),
3838
+ lift: To(k * n, Nl)
3839
3839
  };
3840
3840
  });
3841
3841
  }
3842
- function Ud(e, t) {
3842
+ function Vd(e, t) {
3843
3843
  if (e.length === 0) return { "hair.swing": 0, "hair.trail": 0, "hair.lift": 0 };
3844
3844
  if (t <= e[0].time) return is(e[0]);
3845
3845
  if (t >= e[e.length - 1].time) return is(e[e.length - 1]);
@@ -3855,8 +3855,8 @@ function Ud(e, t) {
3855
3855
  "hair.lift": a.lift + (r.lift - a.lift) * s
3856
3856
  };
3857
3857
  }
3858
- const is = (e) => ({ "hair.swing": e.swing, "hair.trail": e.trail, "hair.lift": e.lift }), ot = 16, Ll = 1500;
3859
- function Xd(e, t, o, n = {}) {
3858
+ const is = (e) => ({ "hair.swing": e.swing, "hair.trail": e.trail, "hair.lift": e.lift }), ot = 16, Dl = 1500;
3859
+ function Jd(e, t, o, n = {}) {
3860
3860
  const a = o.head.hair;
3861
3861
  if (!a || !ca(a)) return [];
3862
3862
  const r = t.filter((H) => H.target === e), s = r.reduce((H, M) => M.keyframes.reduce((m, P) => Math.max(m, P.time), H), 0), i = ye, h = /* @__PURE__ */ new Set(["x", "y", "turn", "head.turn"]), c = new ve({ id: `${e}-hair-follow`, tracks: r.filter((H) => h.has(H.property)) }), l = (H, M, m) => {
@@ -3875,7 +3875,7 @@ function Xd(e, t, o, n = {}) {
3875
3875
  }, g = (H) => {
3876
3876
  const M = Math.floor(H / ot), m = H / ot - M, P = p(M * ot), A = p((M + 1) * ot);
3877
3877
  return { x: P.x + (A.x - P.x) * m, y: P.y + (A.y - P.y) * m };
3878
- }, b = zl(
3878
+ }, b = Fl(
3879
3879
  (H) => {
3880
3880
  const M = g(H);
3881
3881
  return {
@@ -3887,7 +3887,7 @@ function Xd(e, t, o, n = {}) {
3887
3887
  },
3888
3888
  {
3889
3889
  start: 0,
3890
- end: s + (n.settle ?? Ll),
3890
+ end: s + (n.settle ?? Dl),
3891
3891
  headRadius: Oe(o, ye).head.rx,
3892
3892
  step: n.step,
3893
3893
  stiffness: n.stiffness,
@@ -3896,7 +3896,7 @@ function Xd(e, t, o, n = {}) {
3896
3896
  wind: n.wind
3897
3897
  }
3898
3898
  ), T = [];
3899
- for (const H of Rl) {
3899
+ for (const H of Ll) {
3900
3900
  const M = H.slice(5);
3901
3901
  let m = b.map((A) => ({ time: A.time, value: A[M] }));
3902
3902
  if (m.every((A) => Math.abs(A.value) < 1e-3)) continue;
@@ -3977,25 +3977,25 @@ function Hr(e) {
3977
3977
  const { base: t, ...o } = e;
3978
3978
  return { ...ht[t ?? "full"], ...o };
3979
3979
  }
3980
- const Vo = 160, Fl = 120, Dl = 700, Po = 60, ql = 90, zt = 3200, ct = 1, Xe = 1e-6;
3980
+ const Vo = 160, ql = 120, Bl = 700, Po = 60, Gl = 90, zt = 3200, ct = 1, Xe = 1e-6;
3981
3981
  function kn(e, t, o = {}) {
3982
3982
  const n = Hr(o.style), a = o.seed ?? 1, r = {};
3983
3983
  if (e.length === 0) return r;
3984
3984
  const s = Object.keys(e[0].pose).filter((d) => e.some((f) => Math.abs(f.pose[d] - e[0].pose[d]) > Xe));
3985
- for (const d of s) r[d] = Bl(d, e, t, n, a);
3985
+ for (const d of s) r[d] = Yl(d, e, t, n, a);
3986
3986
  const i = t.blink, h = i !== void 0 && s.includes(i);
3987
3987
  if (n.blinks && i !== void 0 && !h && i in e[0].pose) {
3988
- const d = Gl(e, t, n, a, e[0].pose[i]);
3988
+ const d = Ul(e, t, n, a, e[0].pose[i]);
3989
3989
  d.length > 0 && (r[i] = d);
3990
3990
  }
3991
3991
  const { lift: c, stretch: l } = t;
3992
3992
  if (n.jumpSquash > 0 && c && l && s.includes(c) && !s.includes(l) && l in e[0].pose) {
3993
- const d = Yl(e, c, e[0].pose[l], n.jumpSquash);
3993
+ const d = Xl(e, c, e[0].pose[l], n.jumpSquash);
3994
3994
  d.length > 0 && (r[l] = d);
3995
3995
  }
3996
3996
  return r;
3997
3997
  }
3998
- function Bl(e, t, o, n, a) {
3998
+ function Yl(e, t, o, n, a) {
3999
3999
  const r = o.eyes.includes(e), s = o.limits[e], i = s !== void 0, h = r ? -n.eyeLead : (o.depth[e] ?? 1) * n.overlap, c = (u) => {
4000
4000
  const p = (t[u].time - t[u - 1].time) / 2;
4001
4001
  return Math.max(-p, Math.min(p, h));
@@ -4014,7 +4014,7 @@ function Bl(e, t, o, n, a) {
4014
4014
  const E = p.time + (M ? c(u) : 0);
4015
4015
  if (u === t.length - 1)
4016
4016
  Math.abs(f - b) > Xe && d(Math.max(E, H + Vo), b, "ease-in-out"), f = b;
4017
- else if (M && i && n.drift > 0 && o.drift.includes(e) && E - H >= Dl) {
4017
+ else if (M && i && n.drift > 0 && o.drift.includes(e) && E - H >= Bl) {
4018
4018
  const O = Fe(`${a}:${e}:${u}`) % 2 === 0 ? 1 : -1;
4019
4019
  f = b + O * n.drift * s, d(E, f, "ease-in-out");
4020
4020
  }
@@ -4039,7 +4039,7 @@ function Bl(e, t, o, n, a) {
4039
4039
  d(O, E, "ease-in-out"), n.hold > 0 && d(O + k * n.hold, E);
4040
4040
  }
4041
4041
  const v = u + 1 < t.length ? t[u + 1].time - p.time : 1 / 0, w = Math.min(n.settle, v / 2);
4042
- if (i && n.overshoot > 0 && s > 0 && k >= Fl && w > ct) {
4042
+ if (i && n.overshoot > 0 && s > 0 && k >= ql && w > ct) {
4043
4043
  const E = Math.min(Math.abs(T) * n.overshoot, s);
4044
4044
  d(A, b + y * E, p.easing ?? n.actionEase), d(A + w, b, n.settleEase);
4045
4045
  } else
@@ -4048,8 +4048,8 @@ function Bl(e, t, o, n, a) {
4048
4048
  }
4049
4049
  return l;
4050
4050
  }
4051
- function Gl(e, t, o, n, a) {
4052
- const r = [], s = Po + ql;
4051
+ function Ul(e, t, o, n, a) {
4052
+ const r = [], s = Po + Gl;
4053
4053
  for (let u = 1; u < e.length; u++) {
4054
4054
  const p = e[u - 1].pose, g = e[u].pose;
4055
4055
  Object.entries(t.headTurns).some(([T, H]) => Math.abs((g[T] ?? 0) - (p[T] ?? 0)) > H) && e[u].act !== !1 && r.push(Math.max(e[0].time, e[u - 1].time - o.eyeLead));
@@ -4069,7 +4069,7 @@ function Gl(e, t, o, n, a) {
4069
4069
  }
4070
4070
  return f.length > 1 ? f : [];
4071
4071
  }
4072
- function Yl(e, t, o, n) {
4072
+ function Xl(e, t, o, n) {
4073
4073
  const a = o * (1 - 0.18 * n), r = o * (1 + 0.14 * n), s = [{ time: e[0].time, value: o }], i = (h, c, l) => {
4074
4074
  const d = s[s.length - 1];
4075
4075
  h <= d.time + ct || s.push({ time: h, value: c, ...l ? { easing: l } : {} });
@@ -4087,7 +4087,7 @@ function Yl(e, t, o, n) {
4087
4087
  }
4088
4088
  return s.length > 1 ? s : [];
4089
4089
  }
4090
- const Ul = {
4090
+ const Vl = {
4091
4091
  depth: {
4092
4092
  lean: 0,
4093
4093
  bend: 0,
@@ -4153,13 +4153,13 @@ const Ul = {
4153
4153
  lift: "rise",
4154
4154
  stretch: "stretch"
4155
4155
  };
4156
- function Xl(e) {
4156
+ function Jl(e) {
4157
4157
  return /^(turn|lean|bend|side|lift|roll|stretch)$/.test(e) ? { depth: 0, limit: { turn: 0.06, lean: 10, bend: 10, side: 8, lift: 0, roll: 25, stretch: 0.08 }[e] } : /^leg\.\w+\.(swing|spread|rotate)$/.test(e) ? { depth: 0, limit: 12 } : /^head\./.test(e) ? { depth: 1, limit: 12 } : /^arm\.\w+\.(swing|spread)$/.test(e) ? { depth: 1, limit: 20 } : /^leg\.\w+\.knee$/.test(e) ? { depth: 1, limit: 15 } : /^(brow\.|browTilt$)/.test(e) ? { depth: 1, limit: e === "browTilt" ? void 0 : 0.25 } : /^eye\./.test(e) ? { depth: 1, limit: 0.15 } : /^arm\.\w+\.(elbow|bend)$/.test(e) ? { depth: 2, limit: 18 } : /^leg\.\w+\.(ankle|toeOut)$/.test(e) ? { depth: 2, limit: 10 } : /^(mouth|smile|mouthWidth)$/.test(e) ? { depth: 2 } : /^hand\./.test(e) ? { depth: 3 } : { depth: 1 };
4158
4158
  }
4159
- function Vl() {
4159
+ function Zl() {
4160
4160
  const e = {}, t = {};
4161
4161
  for (const o of Object.keys(ye)) {
4162
- const n = Xl(o);
4162
+ const n = Jl(o);
4163
4163
  e[o] = n.depth, n.limit !== void 0 && (t[o] = n.limit);
4164
4164
  }
4165
4165
  return {
@@ -4173,19 +4173,19 @@ function Vl() {
4173
4173
  stretch: "stretch"
4174
4174
  };
4175
4175
  }
4176
- const Jl = Vl();
4176
+ const Ql = Zl();
4177
4177
  function Ir(e, t) {
4178
4178
  return Object.entries(t).map(([o, n]) => ({ id: `${e}-${o}`, target: e, property: o, keyframes: n }));
4179
4179
  }
4180
- function Zl(e, t, o = {}) {
4180
+ function eh(e, t, o = {}) {
4181
4181
  const n = Vs(t), a = t.map((r, s) => ({ time: r.time, pose: { ...n[s] }, easing: r.easing, act: r.act }));
4182
- return Ir(e, kn(a, o.rig ?? Ul, o));
4182
+ return Ir(e, kn(a, o.rig ?? Vl, o));
4183
4183
  }
4184
- function Ql(e, t, o = {}) {
4184
+ function th(e, t, o = {}) {
4185
4185
  const n = o.rest ?? ye, a = fa(t, n), r = t.map((s, i) => ({ time: s.time, pose: { ...n, ...a[i] }, easing: s.easing, act: s.act }));
4186
- return Ir(e, kn(r, o.rig ?? Jl, o));
4186
+ return Ir(e, kn(r, o.rig ?? Ql, o));
4187
4187
  }
4188
- const ls = $e.shocked, eh = $e.scared, Ve = {
4188
+ const ls = $e.shocked, oh = $e.scared, Ve = {
4189
4189
  /** The classic take: squash down in a squint, then shoot up stretched with eyes popping, hang, and land squashed. */
4190
4190
  take: (e) => [
4191
4191
  { after: 140, pose: { stretch: 0.8, bend: 10, lean: e.lean - 4, leftShoulder: 8, rightShoulder: 8, leftEye: 0.35, rightEye: 0.35, leftBrow: -0.6, rightBrow: -0.6, mouth: 0 }, easing: "ease-in-out" },
@@ -4219,7 +4219,7 @@ const ls = $e.shocked, eh = $e.scared, Ve = {
4219
4219
  ],
4220
4220
  /** A frightened shiver: small, fast shakes with wide eyes, then still. */
4221
4221
  tremble: (e) => {
4222
- const t = [{ after: 80, pose: { ...eh, bend: e.bend + 8, leftShoulder: 40, rightShoulder: 40, leftElbow: 110, rightElbow: 110, stretch: 0.94 }, easing: "ease-out" }];
4222
+ const t = [{ after: 80, pose: { ...oh, bend: e.bend + 8, leftShoulder: 40, rightShoulder: 40, leftElbow: 110, rightElbow: 110, stretch: 0.94 }, easing: "ease-out" }];
4223
4223
  for (let o = 1; o <= 14; o++) t.push({ after: 80 + o * 45, pose: { lean: e.lean + (o % 2 === 0 ? 2.5 : -2.5), headTilt: e.headTilt + (o % 2 === 0 ? -2 : 2) } });
4224
4224
  return t.push({ after: 755, pose: { lean: e.lean, headTilt: e.headTilt, bend: e.bend } }), t;
4225
4225
  },
@@ -4245,7 +4245,7 @@ function so(e, t = 1) {
4245
4245
  const o = Ve[e](ce);
4246
4246
  return o[o.length - 1].after * t;
4247
4247
  }
4248
- function th(e, t, o = {}) {
4248
+ function nh(e, t, o = {}) {
4249
4249
  if (t.length < 2) return;
4250
4250
  const n = Math.max(1, Math.round(o.lines ?? 3)), a = o.spacing ?? 5, r = o.lineWidth ?? 2, s = o.opacity ?? 0.7;
4251
4251
  e.save(), e.strokeStyle = o.color ?? "#222", e.lineCap = "round";
@@ -4258,7 +4258,7 @@ function th(e, t, o = {}) {
4258
4258
  }
4259
4259
  e.restore();
4260
4260
  }
4261
- const oh = {
4261
+ const sh = {
4262
4262
  hands: [
4263
4263
  { name: "left hand", at: (e) => e.hands.left },
4264
4264
  { name: "right hand", at: (e) => e.hands.right }
@@ -4273,7 +4273,7 @@ const oh = {
4273
4273
  { name: "neck", at: (e) => e.neck }
4274
4274
  ]
4275
4275
  };
4276
- function Vd(e, t, o, n, a = {}) {
4276
+ function Zd(e, t, o, n, a = {}) {
4277
4277
  const r = o.stateAt;
4278
4278
  if (!r) return;
4279
4279
  const s = a.length ?? 120, i = Math.max(2, Math.round(a.samples ?? 8)), h = Math.max(0, o.time - s);
@@ -4283,7 +4283,7 @@ function Vd(e, t, o, n, a = {}) {
4283
4283
  const p = h + (o.time - h) * u / (i - 1);
4284
4284
  c.push(Js(t, { time: p, state: r(p) }, n).joints);
4285
4285
  }
4286
- const l = c[c.length - 1].height, d = (a.threshold ?? 1.2) * l, f = (a.parts ?? ["hands", "toes", "head"]).flatMap((u) => oh[u]);
4286
+ const l = c[c.length - 1].height, d = (a.threshold ?? 1.2) * l, f = (a.parts ?? ["hands", "toes", "head"]).flatMap((u) => sh[u]);
4287
4287
  for (const u of f) {
4288
4288
  const p = c.map(u.at);
4289
4289
  let g = 0;
@@ -4291,10 +4291,10 @@ function Vd(e, t, o, n, a = {}) {
4291
4291
  const b = g / ((o.time - h) / 1e3);
4292
4292
  if (b <= d) continue;
4293
4293
  const T = Math.min(1, (b - d) / (d * 0.5));
4294
- th(e, p, { ...a, opacity: (a.opacity ?? 0.7) * T, spacing: a.spacing ?? l * 0.02 });
4294
+ nh(e, p, { ...a, opacity: (a.opacity ?? 0.7) * T, spacing: a.spacing ?? l * 0.02 });
4295
4295
  }
4296
4296
  }
4297
- function nh(e, t, o, n = {}) {
4297
+ function rh(e, t, o, n = {}) {
4298
4298
  if (o <= 0 || o >= 1) return;
4299
4299
  const a = n.size ?? 40, r = n.seed ?? 1, s = 0.45 + 0.55 * (1 - (1 - o) ** 3);
4300
4300
  e.save(), e.strokeStyle = n.color ?? "#555", e.lineWidth = Math.max(1, a * 0.03), e.globalAlpha = Math.min(1, o / 0.08) * (1 - o);
@@ -4304,17 +4304,17 @@ function nh(e, t, o, n = {}) {
4304
4304
  }
4305
4305
  e.restore();
4306
4306
  }
4307
- function Jd(e, t, o, n = {}) {
4307
+ function Qd(e, t, o, n = {}) {
4308
4308
  if (o <= 0 || o >= 1) return;
4309
4309
  const a = n.size ?? 40, r = 5, s = 1 - (1 - o) ** 2;
4310
4310
  e.save(), e.strokeStyle = n.color ?? "#222", e.lineWidth = Math.max(1, a * 0.035), e.lineJoin = "round", e.globalAlpha = o < 0.7 ? 1 : (1 - o) / 0.3;
4311
4311
  for (let i = 0; i < r; i++) {
4312
4312
  const h = -Math.PI / 2 + (i - (r - 1) / 2) * Math.PI / (r + 1), c = a * (0.3 + 0.7 * s), l = t.x + Math.cos(h) * c, d = t.y + Math.sin(h) * c;
4313
- sh(e, l, d, a * 0.14, o * Math.PI + i), e.stroke();
4313
+ ah(e, l, d, a * 0.14, o * Math.PI + i), e.stroke();
4314
4314
  }
4315
4315
  e.restore();
4316
4316
  }
4317
- function sh(e, t, o, n, a) {
4317
+ function ah(e, t, o, n, a) {
4318
4318
  e.beginPath();
4319
4319
  for (let r = 0; r < 10; r++) {
4320
4320
  const s = r % 2 === 0 ? n : n * 0.45, i = a + r * Math.PI / 5 - Math.PI / 2, h = t + Math.cos(i) * s, c = o + Math.sin(i) * s;
@@ -4367,7 +4367,7 @@ function Kr(e = {}) {
4367
4367
  for (const [o, n] of Object.entries(e.actions ?? {})) t[o] = n.summary;
4368
4368
  return t;
4369
4369
  }
4370
- const Jo = ["do", "at", "for", "to", "toward", "mood", "say", "pose", "target", "onto"], rh = {
4370
+ const Jo = ["do", "at", "for", "to", "toward", "mood", "say", "pose", "target", "onto"], ih = {
4371
4371
  action: "do",
4372
4372
  type: "do",
4373
4373
  verb: "do",
@@ -4408,7 +4408,7 @@ function ro(e, t = {}) {
4408
4408
  }
4409
4409
  const f = h;
4410
4410
  for (const g of Object.keys(f))
4411
- Jo.includes(g) || l(fe("beat field", g, Jo, rh[g.toLowerCase()]));
4411
+ Jo.includes(g) || l(fe("beat field", g, Jo, ih[g.toLowerCase()]));
4412
4412
  const u = f.do;
4413
4413
  if (u === void 0) {
4414
4414
  l(`A beat needs \`do\` (what happens). Actions: ${n.join(", ")}`);
@@ -4450,13 +4450,13 @@ ${n.map((a) => ` ${a.beat >= 0 ? `beat ${a.beat}: ` : ""}${a.message}`).join(`
4450
4450
  `)}`);
4451
4451
  }
4452
4452
  ua(Kr);
4453
- function Zd(e) {
4453
+ function ef(e) {
4454
4454
  const t = "steps" in e && typeof e.steps == "function", o = "beats" in e && typeof e.beats == "function";
4455
4455
  if (t === o) throw new Error("defineAction: give either `steps: (from, beat) => [...]` or `beats: (beat) => [...]`");
4456
4456
  if (!e.summary) throw new Error("defineAction: give a `summary`: one line on what the figure does");
4457
4457
  return e;
4458
4458
  }
4459
- function Qd(e) {
4459
+ function tf(e) {
4460
4460
  for (const t of ["swing", "knee", "arm", "elbow", "lean"])
4461
4461
  if (typeof e[t] != "number") throw new Error(`defineGait: \`${t}\` must be a number (degrees)`);
4462
4462
  if (e.cycle !== void 0 && !(e.cycle > 0)) throw new Error("defineGait: `cycle` is ms per two steps, above 0");
@@ -4474,7 +4474,7 @@ function vn(e, t = {}, o = 0) {
4474
4474
  return vn(r, t, o + 1);
4475
4475
  });
4476
4476
  }
4477
- function ah(e) {
4477
+ function lh(e) {
4478
4478
  return e.length === 0 ? 0 : Math.max(...e.map((t) => t.after));
4479
4479
  }
4480
4480
  const fs = {
@@ -4486,9 +4486,9 @@ const fs = {
4486
4486
  tired: 1500,
4487
4487
  shove: 1300,
4488
4488
  run: 560
4489
- }, ih = 450, lh = 2.4, hh = 160, us = 2.5, ch = 200, dh = 340, fh = 1.1, gs = [380, 900], uh = 0.35, Ft = 300, Oo = 150, gh = 260, ph = 1.2, Ho = 160, ps = 400, vt = 300, mh = 450, ms = 500, Io = 350, ys = 150, yh = 120, xo = 180, bs = 420, bh = 300, ws = 300, wh = 140, jo = 150, ks = 450, kh = 450, _o = 150, vs = 350, Ss = 400, vh = 12, Sh = 600, Ms = 90, $s = 400, Mh = 200, $h = 0.09, Es = 350, He = 450, Ko = 1200, Eh = 700, nt = 320, Ie = 220, Ah = 65, Th = 700, As = (e) => e in Ve, Ph = (e) => e in Ae;
4490
- function Oh(e) {
4491
- return Math.max(Th, Array.from(e).length * Ah);
4489
+ }, hh = 450, ch = 2.4, dh = 160, us = 2.5, fh = 200, uh = 340, gh = 1.1, gs = [380, 900], ph = 0.35, Ft = 300, Oo = 150, mh = 260, yh = 1.2, Ho = 160, ps = 400, vt = 300, bh = 450, ms = 500, Io = 350, ys = 150, wh = 120, xo = 180, bs = 420, kh = 300, ws = 300, vh = 140, jo = 150, ks = 450, Sh = 450, _o = 150, vs = 350, Ss = 400, Mh = 12, $h = 600, Ms = 90, $s = 400, Eh = 200, Ah = 0.09, Es = 350, He = 450, Ko = 1200, Th = 700, nt = 320, Ie = 220, Ph = 65, Oh = 700, As = (e) => e in Ve, Hh = (e) => e in Ae;
4490
+ function Ih(e) {
4491
+ return Math.max(Oh, Array.from(e).length * Ph);
4492
4492
  }
4493
4493
  function Sn(e, t, o = {}) {
4494
4494
  const n = { actions: o.actions, gaits: o.gaits };
@@ -4502,7 +4502,7 @@ function Sn(e, t, o = {}) {
4502
4502
  let f = c, u = l, p = o.facing ?? 1, g = o.start ?? ce, b = 0, T = 0;
4503
4503
  const H = [{ time: 0, pose: g }], M = [{ time: 0, value: 0 }], m = [{ time: 0, value: 0 }], P = [{ time: 0, value: 0 }], A = [{ time: 0, value: 0 }], k = [{ time: 0, value: "walk" }], y = [{ time: 0, value: p }], v = [], w = [], E = [], O = (S, _, V, ee) => {
4504
4504
  g = { ...g, ..._ }, V && (g = at(g, V)), H.push({ time: S, pose: g, ...ee === !1 ? { act: ee } : {} });
4505
- }, j = (S, _, V) => (O(S + nt / 2, { turn: 0 }, V), y.push({ time: S + nt / 2, value: p }, { time: S + nt / 2 + 1, value: _ }), p = _, O(S + nt, { turn: 1 }), S + nt), x = (S) => S < f ? -1 : 1, R = (S, _, V) => x(_) !== p ? j(S, x(_), V) : S, G = (S, _, V, ee = "arm") => {
4505
+ }, j = (S, _, V) => (O(S + nt / 2, { turn: 0 }, V), y.push({ time: S + nt / 2, value: p }, { time: S + nt / 2 + 1, value: _ }), p = _, O(S + nt, { turn: 1 }), S + nt), x = (S) => S < f ? -1 : 1, W = (S, _, V) => x(_) !== p ? j(S, x(_), V) : S, G = (S, _, V, ee = "arm") => {
4506
4506
  const L = ee === "arm", Q = je({ ...S, ...L ? { rightShoulder: 0, rightElbow: 0 } : { rightHip: 0, rightKnee: 0 } }, { height: d, facing: p }), re = L ? Q.shoulders.right : Q.hip, K = L ? Q.elbows.right : Q.knees.right, X = (se, ae) => Math.atan2(p * se, ae) * 180 / Math.PI, Z = ((X(_ - (f + re.x), V - (u + re.y)) - X(K.x - re.x, K.y - re.y)) % 360 + 360) % 360;
4507
4507
  return Z > 270 ? Z - 360 : Z;
4508
4508
  }, Y = (S, _, V, ee) => {
@@ -4537,36 +4537,36 @@ function Sn(e, t, o = {}) {
4537
4537
  X !== p ? F = j(_, X, S.mood) : g.turn < 1 && (F = _ + Ie, O(F, { turn: 1 }, S.mood));
4538
4538
  const Z = hs("windUp", { at: F, from: S.mood ? at(g, S.mood) : g });
4539
4539
  H.push(...Z), g = Z[Z.length - 1].pose;
4540
- const se = F + so("windUp"), ae = se + ih, ie = ae + Math.max(hh, Math.abs(K - f) / lh);
4540
+ const se = F + so("windUp"), ae = se + hh, ie = ae + Math.max(dh, Math.abs(K - f) / ch);
4541
4541
  k.push({ time: se, value: "run" }), A.push({ time: se, value: 0 }, { time: se + 80, value: 1, easing: "ease-out" }, { time: ie, value: 1 }, { time: ie + 120, value: 0 }), P.push({ time: se, value: b }, { time: ae, value: b + us, easing: "ease-in" }), b += us + (ie - ae) / fs.run * 1.5, P.push({ time: ie, value: b }), M.push({ time: ae, value: f - c }, { time: ie, value: K - c, easing: "ease-in" }), E.push({ kind: "dust", time: ae, x: f, y: u, length: 900 }), f = K, O(ie, {}), V = ie;
4542
4542
  } else if (S.do === "leap") {
4543
4543
  const K = S.to ?? f, X = S.onto ?? u;
4544
- let F = K === f ? _ : R(_, K, S.mood);
4544
+ let F = K === f ? _ : W(_, K, S.mood);
4545
4545
  g.turn < 1 && (F += Ie, O(F, { turn: 1 }, S.mood));
4546
4546
  const Z = { leftShoulder: 35, rightShoulder: 35, leftElbow: -50, rightElbow: -50 };
4547
- O(F + ch, { stretch: 0.75, bend: 12, leftHip: 22, rightHip: 22, ...Z }, S.mood, !1);
4548
- const se = F + dh;
4547
+ O(F + fh, { stretch: 0.75, bend: 12, leftHip: 22, rightHip: 22, ...Z }, S.mood, !1);
4548
+ const se = F + uh;
4549
4549
  O(se - 40, { stretch: 0.72 }, void 0, !1), O(se, { stretch: 1.2, bend: -6, leftShoulder: 140, rightShoulder: 140, leftElbow: 20, rightElbow: 20, leftHip: 4, rightHip: 4 }, void 0, !1);
4550
- const ae = Math.hypot(K - f, X - u), ie = S.for ?? Math.min(gs[1], Math.max(gs[0], 300 + ae * fh)), $ = Math.min(u, X) - uh * d, z = Math.sqrt(u - $), U = Math.sqrt(X - $), te = se + ie * z / (z + U), B = se + ie;
4550
+ const ae = Math.hypot(K - f, X - u), ie = S.for ?? Math.min(gs[1], Math.max(gs[0], 300 + ae * gh)), $ = Math.min(u, X) - ph * d, z = Math.sqrt(u - $), U = Math.sqrt(X - $), te = se + ie * z / (z + U), B = se + ie;
4551
4551
  O(te, { stretch: 1, bend: 4, leftHip: -55, leftKnee: -80, rightHip: 55, rightKnee: 80, leftShoulder: 110, rightShoulder: 110 }, void 0, !1), O(B, { stretch: 0.72, bend: 12, leftShoulder: 75, rightShoulder: 75, leftElbow: 0, rightElbow: 0, leftHip: 18, rightHip: 18, leftKnee: 0, rightKnee: 0 }, void 0, !1), O(B + 180, { stretch: 1.05, bend: -3 }, void 0, !1), O(B + 340, { stretch: 1, bend: 0, leftHip: ce.leftHip, rightHip: ce.rightHip, leftShoulder: ce.leftShoulder, rightShoulder: ce.rightShoulder, leftElbow: ce.leftElbow, rightElbow: ce.rightElbow }, void 0, !1), M.push({ time: se, value: f - c }, { time: B, value: K - c }), m.push(
4552
4552
  { time: se, value: u - l },
4553
4553
  { time: te, value: $ - l, easing: "ease-out-quad" },
4554
4554
  { time: B, value: X - l, easing: "ease-in-quad" }
4555
4555
  ), f = K, u = X, E.push({ kind: "dust", time: B, x: f, y: u, length: 500 }), V = B + 340, ee = B;
4556
4556
  } else if (S.do === "point" && S.target) {
4557
- const K = S.target, X = R(_, K.x, S.mood), F = { ...g, ...S.mood ? $e[S.mood] : {}, turn: Math.max(g.turn, 0.6), rightElbow: 0, rightWrist: 0, ...Q }, Z = je(F, { height: d, facing: p }).head.center, se = Math.abs(K.x - (f + Z.x)), ae = K.y - (u + Z.y), ie = X + He;
4558
- O(ie, { ...F, rightShoulder: G(F, K.x, K.y), lookX: 1, lookY: Hh(ae / Math.max(1, Math.hypot(se, ae))) * 0.8 }), V = ie + (S.for ?? Ko), ee = ie, L = V;
4557
+ const K = S.target, X = W(_, K.x, S.mood), F = { ...g, ...S.mood ? $e[S.mood] : {}, turn: Math.max(g.turn, 0.6), rightElbow: 0, rightWrist: 0, ...Q }, Z = je(F, { height: d, facing: p }).head.center, se = Math.abs(K.x - (f + Z.x)), ae = K.y - (u + Z.y), ie = X + He;
4558
+ O(ie, { ...F, rightShoulder: G(F, K.x, K.y), lookX: 1, lookY: xh(ae / Math.max(1, Math.hypot(se, ae))) * 0.8 }), V = ie + (S.for ?? Ko), ee = ie, L = V;
4559
4559
  } else if (S.do === "swipe") {
4560
- const K = S.target ?? { x: f + p * d * 0.5, y: u - d * 0.6 }, X = x(K.x), F = R(_, K.x, S.mood), Z = X === 1 ? K.left ?? K.x : K.right ?? K.x, se = X === 1 ? K.right ?? K.x : K.left ?? K.x, ae = { ...g, turn: 1, lean: -10, bend: -8, rightElbow: 40, lookX: 1, ...Q };
4560
+ const K = S.target ?? { x: f + p * d * 0.5, y: u - d * 0.6 }, X = x(K.x), F = W(_, K.x, S.mood), Z = X === 1 ? K.left ?? K.x : K.right ?? K.x, se = X === 1 ? K.right ?? K.x : K.left ?? K.x, ae = { ...g, turn: 1, lean: -10, bend: -8, rightElbow: 40, lookX: 1, ...Q };
4561
4561
  O(F + Ft, { ...ae, rightShoulder: G(ae, f - p * d * 0.3, u - d * 1.1) }, S.mood, !1);
4562
4562
  const ie = { ...g, lean: 6, bend: 4, rightElbow: 0, rightWrist: 0 }, $ = { ...g, lean: 14, bend: 12, rightElbow: 0, rightWrist: 0 };
4563
4563
  I(F, Y(ie, Z, K.y, "arm"), Ft + Oo), O(F + Ft + Oo, { lean: -12 }, void 0, !1);
4564
4564
  const z = F + Ft + Oo + 80;
4565
4565
  O(z, { ...ie, rightShoulder: G(ie, Z, K.y) }, void 0, !1);
4566
- const U = z + (S.for ?? Math.max(gh, Math.abs(se - Z) / ph));
4566
+ const U = z + (S.for ?? Math.max(mh, Math.abs(se - Z) / yh));
4567
4567
  M.push({ time: z, value: f - c }), f = Y($, se, K.y, "arm"), M.push({ time: U, value: f - c }), O(U, { ...$, rightShoulder: G($, se, K.y) }, void 0, !1), O(U + Ho, { lean: 16, bend: 14, rightShoulder: G(g, se + X * d * 0.4, K.y + d * 0.25) }, void 0, !1), O(U + Ho + ps, { lean: 0, bend: 0, rightShoulder: ce.rightShoulder, rightElbow: ce.rightElbow }), V = U + Ho + ps, ee = z, L = U;
4568
4568
  } else if (S.do === "grab" && S.target) {
4569
- const K = S.target, X = R(_, K.x, S.mood), F = K.y > u - d * 0.5, Z = {
4569
+ const K = S.target, X = W(_, K.x, S.mood), F = K.y > u - d * 0.5, Z = {
4570
4570
  ...g,
4571
4571
  turn: 1,
4572
4572
  rightElbow: 0,
@@ -4576,17 +4576,17 @@ function Sn(e, t, o = {}) {
4576
4576
  lookX: 1,
4577
4577
  lookY: F ? 0.8 : 0,
4578
4578
  ...Q
4579
- }, ae = I(X, Y(Z, K.x, K.y, "arm"), vt) + mh;
4579
+ }, ae = I(X, Y(Z, K.x, K.y, "arm"), vt) + bh;
4580
4580
  O(ae, { ...Z, rightShoulder: G(Z, K.x, K.y) }, S.mood, !1), O(ae + 120, {}, void 0, !1), O(ae + ms, { bend: 0, lean: -3, stretch: 1, rightShoulder: 165, rightElbow: 20, lookY: -0.6 }), V = ae + ms + 150, ee = ae;
4581
4581
  } else if (S.do === "throw") {
4582
- const K = S.target?.x ?? S.to ?? f + p * d, X = R(_, K, S.mood), F = { ...g, turn: 1, lean: -12, bend: -10, rightElbow: 60, stretch: 0.95, lookX: 1, lookY: -0.3, ...Q };
4582
+ const K = S.target?.x ?? S.to ?? f + p * d, X = W(_, K, S.mood), F = { ...g, turn: 1, lean: -12, bend: -10, rightElbow: 60, stretch: 0.95, lookX: 1, lookY: -0.3, ...Q };
4583
4583
  O(X + Io, { ...F, rightShoulder: G(F, f - p * d * 0.4, u - d * 1.05) }, S.mood, !1), O(X + Io + ys, { lean: -14 }, void 0, !1);
4584
- const Z = X + Io + ys + yh, se = { ...g, lean: 14, bend: 12, rightElbow: 0, stretch: 1.04 };
4584
+ const Z = X + Io + ys + wh, se = { ...g, lean: 14, bend: 12, rightElbow: 0, stretch: 1.04 };
4585
4585
  H.push({ time: Z, pose: g = { ...se, rightShoulder: G(se, f + p * d, u - d * 1.1) }, easing: "ease-in", act: !1 }), O(Z + xo, { lean: 18, bend: 14, rightShoulder: 55, stretch: 1 }, void 0, !1), O(Z + xo + bs, { lean: 0, bend: 0, rightShoulder: ce.rightShoulder, rightElbow: ce.rightElbow, lookY: 0 }), V = Z + xo + bs, ee = Z, L = Z;
4586
4586
  } else if (S.do === "kick" && S.target) {
4587
- const K = S.target, X = R(_, K.x, S.mood), F = { ...g, turn: 1, lean: -12, bend: -6, rightKnee: 0, leftShoulder: 100, rightShoulder: 70 }, Z = I(X, Y(F, K.x, K.y, "leg"), bh), se = { leftShoulder: 70, rightShoulder: 50, leftElbow: -20, rightElbow: 20 };
4587
+ const K = S.target, X = W(_, K.x, S.mood), F = { ...g, turn: 1, lean: -12, bend: -6, rightKnee: 0, leftShoulder: 100, rightShoulder: 70 }, Z = I(X, Y(F, K.x, K.y, "leg"), kh), se = { leftShoulder: 70, rightShoulder: 50, leftElbow: -20, rightElbow: 20 };
4588
4588
  O(Z + ws, { turn: 1, lean: 8, bend: 6, rightHip: -40, rightKnee: 80, lookX: 1, lookY: 0.7, ...se, ...Q }, S.mood, !1);
4589
- const ae = Z + ws + wh, ie = G(F, K.x, K.y, "leg");
4589
+ const ae = Z + ws + vh, ie = G(F, K.x, K.y, "leg");
4590
4590
  H.push({ time: ae, pose: g = { ...g, ...F, rightHip: ie }, easing: "ease-in", act: !1 }), O(ae + jo, { lean: -15, rightHip: ie + 20 }, void 0, !1), O(ae + jo + ks, {
4591
4591
  lean: 0,
4592
4592
  bend: 0,
@@ -4599,37 +4599,37 @@ function Sn(e, t, o = {}) {
4599
4599
  lookY: 0
4600
4600
  }), V = ae + jo + ks, ee = ae;
4601
4601
  } else if (S.do === "put" && S.target) {
4602
- const K = S.target, X = R(_, K.x, S.mood), F = K.y > u - d * 0.5, Z = { ...g, turn: 1, rightElbow: 0, rightWrist: 0, bend: F ? 35 : 0, lean: F ? 12 : 0, stretch: F ? 0.75 : 1, lookX: 1, lookY: F ? 0.8 : 0, ...Q }, ae = I(X, Y(Z, K.x, K.y, "arm"), vt) + kh;
4602
+ const K = S.target, X = W(_, K.x, S.mood), F = K.y > u - d * 0.5, Z = { ...g, turn: 1, rightElbow: 0, rightWrist: 0, bend: F ? 35 : 0, lean: F ? 12 : 0, stretch: F ? 0.75 : 1, lookX: 1, lookY: F ? 0.8 : 0, ...Q }, ae = I(X, Y(Z, K.x, K.y, "arm"), vt) + Sh;
4603
4603
  O(ae, { ...Z, rightShoulder: G(Z, K.x, K.y) }, S.mood, !1), O(ae + _o, {}, void 0, !1), O(ae + _o + vs, { bend: 0, lean: 0, stretch: 1, rightShoulder: ce.rightShoulder, rightElbow: ce.rightElbow, lookY: 0 }), V = ae + _o + vs, ee = ae;
4604
4604
  } else if (S.do === "write" && S.target) {
4605
- const K = S.target, X = K.left ?? K.x, F = K.right ?? K.x, Z = R(_, (X + F) / 2, S.mood), se = { ...g, turn: 1, rightElbow: 0, rightWrist: 0, ...$e.thinking, lookX: 1, lookY: 0, ...Q }, ae = (D) => Y(se, D, K.y, "arm") + p * d * 0.08, ie = (D) => {
4606
- const W = oe({ ...se, ...q(se, D, K.y), rightWrist: 0 });
4607
- return Math.hypot(W.x - D, W.y - K.y) < 2;
4605
+ const K = S.target, X = K.left ?? K.x, F = K.right ?? K.x, Z = W(_, (X + F) / 2, S.mood), se = { ...g, turn: 1, rightElbow: 0, rightWrist: 0, ...$e.thinking, lookX: 1, lookY: 0, ...Q }, ae = (D) => Y(se, D, K.y, "arm") + p * d * 0.08, ie = (D) => {
4606
+ const R = oe({ ...se, ...q(se, D, K.y), rightWrist: 0 });
4607
+ return Math.hypot(R.x - D, R.y - K.y) < 2;
4608
4608
  }, $ = p === 1 ? X : F, z = I(Z, ae((X + F) / 2), vt), U = !ie(X) || !ie(F), te = U ? I(z, ae(X), vt) + Ss : z + Ss;
4609
4609
  O(te, { ...se, ...q(se, U ? X : $, K.y) }, S.mood, !1);
4610
- const B = S.for ?? Math.max(Sh, Math.abs(F - X) * vh);
4610
+ const B = S.for ?? Math.max($h, Math.abs(F - X) * Mh);
4611
4611
  U && M.push({ time: te, value: f - c });
4612
- for (let D = Ms, W = 0; D <= B; D += Ms, W++) {
4612
+ for (let D = Ms, R = 0; D <= B; D += Ms, R++) {
4613
4613
  const J = X + (F - X) * Math.min(D, B) / B;
4614
4614
  U && (f = ae(J), M.push({ time: te + D, value: f - c }));
4615
- const he = (W % 2 === 0 ? -1 : 1) * d * 0.02;
4615
+ const he = (R % 2 === 0 ? -1 : 1) * d * 0.02;
4616
4616
  O(te + D, q(se, J, K.y + he), void 0, !1);
4617
4617
  }
4618
4618
  const le = te + B;
4619
4619
  O(le, q(se, F, K.y), void 0, !1), O(le + $s, { rightShoulder: ce.rightShoulder, rightElbow: ce.rightElbow, ...$e.happy }), V = le + $s, ee = te, L = le;
4620
4620
  } else if (S.do === "push" && S.target) {
4621
- const K = S.target, X = S.to ?? K.x, F = R(_, f + (X >= K.x ? 1 : -1), S.mood), Z = p === 1 ? K.left ?? K.x : K.right ?? K.x, se = { ...g, turn: 1, lean: 16, bend: 8, rightWrist: 0, leftWrist: 0, lookX: 1, ...Q }, ae = Y(se, Z, K.y, "arm"), ie = I(F, ae + p * d * 0.06, vt), $ = q(se, Z, K.y), z = { ...se, ...$, leftShoulder: -$.rightShoulder, leftElbow: -$.rightElbow }, U = ie + Mh;
4621
+ const K = S.target, X = S.to ?? K.x, F = W(_, f + (X >= K.x ? 1 : -1), S.mood), Z = p === 1 ? K.left ?? K.x : K.right ?? K.x, se = { ...g, turn: 1, lean: 16, bend: 8, rightWrist: 0, leftWrist: 0, lookX: 1, ...Q }, ae = Y(se, Z, K.y, "arm"), ie = I(F, ae + p * d * 0.06, vt), $ = q(se, Z, K.y), z = { ...se, ...$, leftShoulder: -$.rightShoulder, leftElbow: -$.rightElbow }, U = ie + Eh;
4622
4622
  O(U, z, S.mood, !1);
4623
- const te = Math.abs(X - K.x), B = U + (S.for ?? Math.max(600, te / $h)), le = te / Lo("shove", d);
4623
+ const te = Math.abs(X - K.x), B = U + (S.for ?? Math.max(600, te / Ah)), le = te / Lo("shove", d);
4624
4624
  k.push({ time: U, value: "shove" }), A.push({ time: U, value: 0 }, { time: U + Ie, value: 1, easing: "ease-out" }, { time: B - Ie, value: 1 }, { time: B, value: 0, easing: "ease-in" }), P.push({ time: U, value: b }, { time: B, value: b + le }), b += le, M.push({ time: U, value: f - c }, { time: B, value: f + (X - K.x) - c }), f += X - K.x, O(B, {}, void 0, !1), O(B + Es, { lean: 0, bend: 0, rightShoulder: ce.rightShoulder, leftShoulder: ce.leftShoulder, rightElbow: ce.rightElbow, leftElbow: ce.leftElbow }), V = B + Es, ee = U, L = B;
4625
4625
  } else if (re) {
4626
4626
  const K = S.mood ? at(g, S.mood) : g, X = re.steps(K, S), F = xr(X, { at: _, from: K });
4627
- H.push(...F), g = F[F.length - 1].pose, V = _ + Math.max(ah(X), S.for ?? 0);
4627
+ H.push(...F), g = F[F.length - 1].pose, V = _ + Math.max(lh(X), S.for ?? 0);
4628
4628
  } else if (As(S.do)) {
4629
4629
  const K = hs(S.do, { at: _, from: S.mood ? at(g, S.mood) : g });
4630
4630
  H.push(...K), g = K[K.length - 1].pose, V = _ + so(S.do), S.do === "take" && E.push({ kind: "dust", time: _ + 900, x: f, y: u, length: 500 }), S.do === "land" && E.push({ kind: "dust", time: _ + 120, x: f, y: u, length: 500 });
4631
4631
  } else if (S.do === "look" || S.do === "face") {
4632
- const K = S.toward ?? "viewer", X = S.for ?? Eh;
4632
+ const K = S.toward ?? "viewer", X = S.for ?? Th;
4633
4633
  if (K === "viewer") O(_ + He, { turn: 0, lookX: 0, lookY: 0, ...Q }, S.mood);
4634
4634
  else if (K === "ahead") O(_ + He, { turn: S.do === "face" ? 1 : 0.6, lookX: 1, ...Q }, S.mood);
4635
4635
  else if (K === "back") O(_ + He, { turn: 0.2, lookX: -1, ...Q }, S.mood);
@@ -4638,20 +4638,20 @@ function Sn(e, t, o = {}) {
4638
4638
  F !== p && S.do === "face" ? (j(_, F, S.mood), O(_ + nt + 1, { lookX: 1, ...Q })) : F !== p ? O(_ + He, { turn: 0.25, lookX: -1, ...Q }, S.mood) : O(_ + He, { turn: S.do === "face" ? 1 : 0.6, lookX: 1, ...Q }, S.mood);
4639
4639
  }
4640
4640
  V = _ + Math.max(X, He);
4641
- } else if (Ph(S.do) || S.do === "stand") {
4641
+ } else if (Hh(S.do) || S.do === "stand") {
4642
4642
  const K = S.do === "stand" ? o.rest ?? ce : Ae[S.do], X = K.turn !== ce.turn ? K.turn : g.turn, F = S.mood ? $e[S.mood] : { lookX: g.lookX, lookY: g.lookY };
4643
4643
  O(_ + He, { ...K, turn: X, ...F, ...Q }), V = _ + (S.for ?? Ko);
4644
4644
  } else {
4645
- const K = S.for ?? (S.say ? Oh(S.say) : Ko);
4645
+ const K = S.for ?? (S.say ? Ih(S.say) : Ko);
4646
4646
  (S.mood || S.pose) && O(_ + Math.min(He, K / 2), Q, S.mood), V = _ + K;
4647
4647
  }
4648
4648
  if (S.say) {
4649
4649
  const K = s(S.do) || As(S.do) || re ? _ : _ + Math.min(150, (V - _) / 4), X = s(S.do) ? V : Math.max(K + 200, V - 100);
4650
- v.push({ text: S.say, start: K, end: X }), S.do === "say" && jh(H, g, K, X);
4650
+ v.push({ text: S.say, start: K, end: X }), S.do === "say" && Kh(H, g, K, X);
4651
4651
  }
4652
4652
  S.onto !== void 0 && S.do !== "leap" && S.onto !== u && (m.push({ time: _, value: u - l }, { time: V, value: S.onto - l, easing: "ease-in-out" }), u = S.onto), V > H[H.length - 1].time && H.push({ time: V, pose: g }), w.push({ start: _, end: V, ...ee !== void 0 ? { contact: ee } : {}, ...L !== void 0 ? { release: L } : {} }), T = V;
4653
4653
  }
4654
- const N = Zl(e, xh(H), o), C = [
4654
+ const N = eh(e, _h(H), o), C = [
4655
4655
  { id: `${e}-x`, target: e, property: "x", keyframes: M },
4656
4656
  { id: `${e}-y`, target: e, property: "y", keyframes: m },
4657
4657
  { id: `${e}-walk`, target: e, property: "walk", keyframes: P },
@@ -4671,16 +4671,16 @@ function Sn(e, t, o = {}) {
4671
4671
  effects: E
4672
4672
  };
4673
4673
  }
4674
- const Hh = (e) => Math.max(-1, Math.min(1, e)), Ih = 30;
4675
- function xh(e) {
4674
+ const xh = (e) => Math.max(-1, Math.min(1, e)), jh = 30;
4675
+ function _h(e) {
4676
4676
  const t = [];
4677
4677
  for (const o of e) {
4678
4678
  const n = t[t.length - 1];
4679
- n && o.time - n.time < Ih ? t[t.length - 1] = { ...o, time: n.time } : t.push(o);
4679
+ n && o.time - n.time < jh ? t[t.length - 1] = { ...o, time: n.time } : t.push(o);
4680
4680
  }
4681
4681
  return t;
4682
4682
  }
4683
- function jh(e, t, o, n) {
4683
+ function Kh(e, t, o, n) {
4684
4684
  const r = e.filter((h) => h.time > o), s = e.filter((h) => h.time <= o), i = [];
4685
4685
  for (let h = o + 520, c = 0; h < n - 520 / 2; h += 520, c++) {
4686
4686
  const l = c % 2 === 0 ? 3 : -2;
@@ -4696,16 +4696,16 @@ function Nr(e, t, o) {
4696
4696
  }
4697
4697
  return i;
4698
4698
  }
4699
- const At = ["start", "contact", "release", "end"], _h = ["surface", "edit", "anchor", "at", "until"], Kh = ["carry"], Yt = (e) => !!e && typeof e == "object" && !Array.isArray(e) && "surface" in e && "anchor" in e, Nh = (e) => e.then === void 0 ? [] : Array.isArray(e.then) ? e.then : [e.then];
4700
- function ef(e, t, o, n = {}) {
4701
- const a = Ch(o, t, n).filter((f) => f.level === "error");
4699
+ const At = ["start", "contact", "release", "end"], Nh = ["surface", "edit", "anchor", "at", "until"], Ch = ["carry"], Yt = (e) => !!e && typeof e == "object" && !Array.isArray(e) && "surface" in e && "anchor" in e, Rh = (e) => e.then === void 0 ? [] : Array.isArray(e.then) ? e.then : [e.then];
4700
+ function of(e, t, o, n = {}) {
4701
+ const a = Wh(o, t, n).filter((f) => f.level === "error");
4702
4702
  if (a.length > 0)
4703
4703
  throw new Error(`surfaceScript: ${a.length} problem(s) in the beats:
4704
4704
  ${a.map((f) => ` ${f.beat >= 0 ? `beat ${f.beat}: ` : ""}${f.message}`).join(`
4705
4705
  `)}`);
4706
- const r = o.map((f) => Cr(f, t)), s = Sn(e, r, n), i = Wh(r, s.beats, n), h = n.ground ?? 0, c = (f) => n.ride === !1 ? f : Object.values(t).reduce((u, p) => p.ride(u, e, { ground: h }), f);
4706
+ const r = o.map((f) => Cr(f, t)), s = Sn(e, r, n), i = zh(r, s.beats, n), h = n.ground ?? 0, c = (f) => n.ride === !1 ? f : Object.values(t).reduce((u, p) => p.ride(u, e, { ground: h }), f);
4707
4707
  o.forEach((f, u) => {
4708
- for (const p of Nh(f)) {
4708
+ for (const p of Rh(f)) {
4709
4709
  const g = (m) => new Error(`surfaceScript: beat ${u} (${f.do}), ${p.edit} on ${p.surface}: ${m}`), b = (m, P) => {
4710
4710
  const A = typeof m == "object" ? m.beat : u, k = (typeof m == "object" ? m.at : m) ?? P ?? "start", y = i[A][k];
4711
4711
  if (y === void 0) {
@@ -4728,7 +4728,7 @@ ${a.map((f) => ` ${f.beat >= 0 ? `beat ${f.beat}: ` : ""}${f.message}`).join(`
4728
4728
  T.follow(P, A);
4729
4729
  continue;
4730
4730
  }
4731
- const m = Object.fromEntries(Object.entries(p).filter(([P]) => !_h.includes(P)));
4731
+ const m = Object.fromEntries(Object.entries(p).filter(([P]) => !Nh.includes(P)));
4732
4732
  T.edit(p.edit, p.anchor, { ...m, at: H, ...M !== void 0 ? { duration: M - H } : {} });
4733
4733
  } catch (m) {
4734
4734
  throw g(m.message);
@@ -4738,7 +4738,7 @@ ${a.map((f) => ` ${f.beat >= 0 ? `beat ${f.beat}: ` : ""}${f.message}`).join(`
4738
4738
  const l = c(s.tracks), d = Object.entries(t).flatMap(([f, u]) => u.tracks(f));
4739
4739
  return { ...s, tracks: [...l, ...d], figureTracks: l };
4740
4740
  }
4741
- function Ch(e, t, o = {}) {
4741
+ function Wh(e, t, o = {}) {
4742
4742
  if (!Array.isArray(e)) return ro(e, o);
4743
4743
  const n = [], a = Object.keys(t), r = (c, l, d) => {
4744
4744
  const f = typeof l == "string" ? t[l] : void 0;
@@ -4777,7 +4777,7 @@ function Ch(e, t, o = {}) {
4777
4777
  }
4778
4778
  const p = u, g = r(l, p.surface, "`then`");
4779
4779
  if (!g) return;
4780
- const b = `\`then\` (${String(p.edit)} on ${String(p.surface)})`, T = [...Object.keys(g.about.edits), ...Kh];
4780
+ const b = `\`then\` (${String(p.edit)} on ${String(p.surface)})`, T = [...Object.keys(g.about.edits), ...Ch];
4781
4781
  if (typeof p.edit != "string" || !T.includes(p.edit)) {
4782
4782
  n.push({ level: "error", beat: l, message: `\`then\`: ${fe("edit", p.edit, T)}` });
4783
4783
  return;
@@ -4800,7 +4800,7 @@ function Cr(e, t, o = !1) {
4800
4800
  }, s = { ...a };
4801
4801
  return Yt(e.target) && (s.target = r(e.target)), Yt(e.to) && (s.to = r(e.to).x), Yt(e.onto) && (s.onto = r(e.onto).top), s;
4802
4802
  }
4803
- function Wh(e, t, o) {
4803
+ function zh(e, t, o) {
4804
4804
  let n = 0;
4805
4805
  return e.map((a) => {
4806
4806
  const r = vn([a], o.actions).length, s = t.slice(n, n + r);
@@ -4814,7 +4814,7 @@ function Wh(e, t, o) {
4814
4814
  };
4815
4815
  });
4816
4816
  }
4817
- function tf(e) {
4817
+ function nf(e) {
4818
4818
  const t = { actions: e.actions, gaits: e.gaits }, o = _r(t);
4819
4819
  if (o.length > 0) throw new Error(`persona "${e.name}": ${o.join(" ")}`);
4820
4820
  const n = [...Object.keys(Ke), ...Object.keys(e.gaits ?? {})], a = e.gait ?? "walk";
@@ -4860,18 +4860,18 @@ function tf(e) {
4860
4860
  })
4861
4861
  };
4862
4862
  }
4863
- const Rh = /* @__PURE__ */ new Set(["x", "y", "walking", "gait"]), Ts = 0.215 + 0.205;
4864
- function zh(e, t, o = 1) {
4863
+ const Lh = /* @__PURE__ */ new Set(["x", "y", "walking", "gait"]), Ts = 0.215 + 0.205;
4864
+ function Fh(e, t, o = 1) {
4865
4865
  const { points: n } = Oe(e, ye), a = n["hip.left"], r = n["knee.left"], s = n["ankle.left"], i = a && r && s ? Math.hypot(r.x - a.x, r.y - a.y) + Math.hypot(s.x - r.x, s.y - r.y) : Ts * e.height;
4866
4866
  return Us(t, i / Ts, o);
4867
4867
  }
4868
- function of(e, t, o, n = {}) {
4869
- const a = Sn(e, o, { ...n, height: t.height, reach: n.reach ?? Lh(t) }), r = a.tracks.find((T) => T.property === "facing")?.keyframes ?? [], s = (T) => {
4868
+ function sf(e, t, o, n = {}) {
4869
+ const a = Sn(e, o, { ...n, height: t.height, reach: n.reach ?? Dh(t) }), r = a.tracks.find((T) => T.property === "facing")?.keyframes ?? [], s = (T) => {
4870
4870
  let H = n.facing ?? 1;
4871
4871
  for (const M of r) M.time <= T && (H = M.value);
4872
4872
  return H;
4873
4873
  }, i = Vs(a.keys), h = a.keys.map((T, H) => {
4874
- const M = wi(i[H]);
4874
+ const M = vi(i[H]);
4875
4875
  return {
4876
4876
  time: T.time,
4877
4877
  pose: s(T.time) < 0 ? pa(M) : M,
@@ -4879,16 +4879,16 @@ function of(e, t, o, n = {}) {
4879
4879
  ...T.act === !1 ? { act: !1 } : {}
4880
4880
  };
4881
4881
  }), { rest: c, start: l, ...d } = n;
4882
- qh(h, i, o, a, t, s, n);
4883
- const f = Ql(e, h, d), u = yn(e, f, a.lines, { energy: n.energy }), p = a.tracks.filter((T) => Rh.has(T.property)), g = a.tracks.find((T) => T.property === "walk");
4884
- return { tracks: g ? [...u, ...p, Vh(e, g, a.tracks, t, n)] : [...u, ...p], duration: a.duration, lines: a.lines, keys: h, beats: a.beats, effects: a.effects };
4882
+ Gh(h, i, o, a, t, s, n);
4883
+ const f = th(e, h, d), u = yn(e, f, a.lines, { energy: n.energy }), p = a.tracks.filter((T) => Lh.has(T.property)), g = a.tracks.find((T) => T.property === "walk");
4884
+ return { tracks: g ? [...u, ...p, Zh(e, g, a.tracks, t, n)] : [...u, ...p], duration: a.duration, lines: a.lines, keys: h, beats: a.beats, effects: a.effects };
4885
4885
  }
4886
- function Lh(e) {
4886
+ function Dh(e) {
4887
4887
  const t = Qs({ "arm.left.spread": 90, "arm.left.elbow": 0, "arm.left.bend": 0, "leg.left.knee": 0 }), o = Oe(e, t).points, n = Math.hypot(o["hand.left"].x - o["shoulder.left"].x, o["hand.left"].y - o["shoulder.left"].y), a = Math.hypot(o["toe.left"].x - o["hip.left"].x, o["toe.left"].y - o["hip.left"].y), r = je({ ...ce, rightShoulder: 90, rightElbow: 0, rightWrist: 0 }, { height: e.height, facing: 1 }), s = je({ ...ce, rightHip: 90, rightKnee: 0 }, { height: e.height, facing: 1 }), i = { x: (r.hands.right.x + r.fingertips.right.x) / 2, y: (r.hands.right.y + r.fingertips.right.y) / 2 }, h = Math.hypot(i.x - r.shoulders.right.x, i.y - r.shoulders.right.y), c = Math.hypot(s.feet.right.x - s.hip.x, s.feet.right.y - s.hip.y);
4888
4888
  return { arm: h > 0 ? n / h : 1, leg: c > 0 ? a / c : 1 };
4889
4889
  }
4890
- const Fh = { point: "arm", grab: "arm", put: "arm", write: "arm", swipe: "arm", push: "arm", kick: "leg" }, Dh = /* @__PURE__ */ new Set(["point", "grab", "put", "kick"]);
4891
- function qh(e, t, o, n, a, r, s) {
4890
+ const qh = { point: "arm", grab: "arm", put: "arm", write: "arm", swipe: "arm", push: "arm", kick: "leg" }, Bh = /* @__PURE__ */ new Set(["point", "grab", "put", "kick"]);
4891
+ function Gh(e, t, o, n, a, r, s) {
4892
4892
  const i = n.beats;
4893
4893
  if (o.length !== i.length) return;
4894
4894
  const h = new ve({ id: "placed", tracks: n.tracks.filter((l) => l.property === "x" || l.property === "y") }), c = (l) => {
@@ -4896,17 +4896,17 @@ function qh(e, t, o, n, a, r, s) {
4896
4896
  return { x: (s.from ?? 0) + Number(d?.get("x") ?? 0), y: (s.ground ?? 0) + Number(d?.get("y") ?? 0) };
4897
4897
  };
4898
4898
  o.forEach((l, d) => {
4899
- const f = Fh[l.do], u = i[d];
4899
+ const f = qh[l.do], u = i[d];
4900
4900
  if (!f || u.contact === void 0 || l.do !== "swipe" && !l.target) return;
4901
4901
  const p = u.contact, g = u.release ?? u.contact;
4902
4902
  e.forEach((b, T) => {
4903
4903
  if (b.time < p - 1 || b.time > g + 1) return;
4904
- const H = r(b.time), M = je(t[T], { height: a.height, facing: H < 0 ? -1 : 1 }), m = c(b.time), P = Dh.has(l.do) && l.target ? { x: l.target.x - m.x, y: l.target.y - m.y } : void 0, A = { x: (M.hands.right.x + M.fingertips.right.x) / 2, y: (M.hands.right.y + M.fingertips.right.y) / 2 }, k = P ?? (f === "arm" ? A : M.toes.right), y = H < 0 ? "right" : "left", v = `${f}.${y}`;
4904
+ const H = r(b.time), M = je(t[T], { height: a.height, facing: H < 0 ? -1 : 1 }), m = c(b.time), P = Bh.has(l.do) && l.target ? { x: l.target.x - m.x, y: l.target.y - m.y } : void 0, A = { x: (M.hands.right.x + M.fingertips.right.x) / 2, y: (M.hands.right.y + M.fingertips.right.y) / 2 }, k = P ?? (f === "arm" ? A : M.toes.right), y = H < 0 ? "right" : "left", v = `${f}.${y}`;
4905
4905
  let w = b.pose;
4906
4906
  if (l.do === "point")
4907
4907
  w = Le(a, w, v, k);
4908
4908
  else if (f === "arm")
4909
- w = Le(a, Xh(a, w, y, k), v, k);
4909
+ w = Le(a, Jh(a, w, y, k), v, k);
4910
4910
  else
4911
4911
  for (let E = 0; E < 3; E++) {
4912
4912
  const O = Oe(a, w).points, j = O[`ankle.${y}`], x = O[`toe.${y}`];
@@ -4916,23 +4916,23 @@ function qh(e, t, o, n, a, r, s) {
4916
4916
  });
4917
4917
  });
4918
4918
  }
4919
- function Bh(e, t) {
4919
+ function Yh(e, t) {
4920
4920
  const o = Qs({ [`arm.${t}.spread`]: 90, [`arm.${t}.elbow`]: 0, [`arm.${t}.bend`]: 0 }), n = Oe(e, o).points;
4921
4921
  return Math.hypot(n[`hand.${t}`].x - n[`shoulder.${t}`].x, n[`hand.${t}`].y - n[`shoulder.${t}`].y);
4922
4922
  }
4923
- const Gh = 5, Yh = 4, Uh = 8;
4924
- function Xh(e, t, o, n) {
4925
- const a = Bh(e, o) * 0.9, r = (i) => {
4923
+ const Uh = 5, Xh = 4, Vh = 8;
4924
+ function Jh(e, t, o, n) {
4925
+ const a = Yh(e, o) * 0.9, r = (i) => {
4926
4926
  const h = Oe(e, i).points[`shoulder.${o}`];
4927
4927
  return Math.hypot(n.x - h.x, n.y - h.y) <= a;
4928
4928
  };
4929
4929
  if (r(t)) return t;
4930
4930
  let s = t;
4931
- for (let i = 1; i <= Uh; i++)
4932
- if (s = { ...t, lean: (t.lean ?? 0) + Gh * i, bend: (t.bend ?? 0) + Yh * i }, r(s)) return s;
4931
+ for (let i = 1; i <= Vh; i++)
4932
+ if (s = { ...t, lean: (t.lean ?? 0) + Uh * i, bend: (t.bend ?? 0) + Xh * i }, r(s)) return s;
4933
4933
  return s;
4934
4934
  }
4935
- function Vh(e, t, o, n, a) {
4935
+ function Zh(e, t, o, n, a) {
4936
4936
  const r = o.find((d) => d.property === "gait"), s = r ? new ve({ id: `${e}-gait-of`, tracks: [r] }) : void 0, i = (d) => {
4937
4937
  const f = s?.getStateAtTime(d).values.get(e)?.get("gait");
4938
4938
  if (typeof f == "string")
@@ -4941,7 +4941,7 @@ function Vh(e, t, o, n, a) {
4941
4941
  let l = h[0]?.value ?? 0;
4942
4942
  return h.forEach((d, f) => {
4943
4943
  if (f > 0) {
4944
- const u = h[f - 1], p = i((u.time + d.time) / 2), g = Lo(p, n.height), b = zh(n, p);
4944
+ const u = h[f - 1], p = i((u.time + d.time) / 2), g = Lo(p, n.height), b = Fh(n, p);
4945
4945
  l += (d.value - u.value) * (b > 0 ? g / b : 1);
4946
4946
  } else
4947
4947
  l = d.value;
@@ -4961,7 +4961,7 @@ function Ps(e, t) {
4961
4961
  s !== i && o.push(Zo(r, n, t)), s && o.push(n);
4962
4962
  }), o.length >= 3 ? o : [];
4963
4963
  }
4964
- function Jh(e, t) {
4964
+ function Qh(e, t) {
4965
4965
  if (e.every((a) => dt(a, t))) return [e];
4966
4966
  const o = [];
4967
4967
  let n = [];
@@ -4980,11 +4980,11 @@ function Os(e, t, o) {
4980
4980
  const a = Math.round(n / o);
4981
4981
  return Array.from({ length: a + 1 }, (r, s) => e + n * s / a);
4982
4982
  }
4983
- function Zh(e, t, o) {
4983
+ function ec(e, t, o) {
4984
4984
  const n = (a, r) => Math.max(0, Math.min(a.length - 2, a.findIndex((s, i) => i > 0 && r <= s) - 1));
4985
4985
  return [n(e, o[0]), n(t, o[2])];
4986
4986
  }
4987
- function Qh(e, t) {
4987
+ function tc(e, t) {
4988
4988
  const o = (n) => {
4989
4989
  const a = [t[0] * n[0] + t[4] * n[1] + t[8] * n[2], t[1] * n[0] + t[5] * n[1] + t[9] * n[2], t[2] * n[0] + t[6] * n[1] + t[10] * n[2]], r = Math.hypot(...a) || 1;
4990
4990
  return [a[0] / r, a[1] / r, a[2] / r];
@@ -5004,7 +5004,7 @@ function Dt(e, t, o, n) {
5004
5004
  a(s) && r.push(s);
5005
5005
  }), r.length >= 3 ? r : [];
5006
5006
  }
5007
- function ec(e, t, o) {
5007
+ function oc(e, t, o) {
5008
5008
  const n = e.faces.map((s) => ({ points: s.corners.map((i) => e.vertices[i]), normal: s.normal })), a = [], r = { x: t.slice(1, -1), z: o.slice(1, -1) };
5009
5009
  for (let s = 0; s + 1 < t.length; s++)
5010
5010
  for (let i = 0; i + 1 < o.length; i++) {
@@ -5021,37 +5021,37 @@ function ec(e, t, o) {
5021
5021
  }
5022
5022
  return a;
5023
5023
  }
5024
- const tc = /* @__PURE__ */ new WeakMap(), oc = /* @__PURE__ */ new WeakMap(), nc = 48, Wr = (e) => e.map((t) => Math.round(t * 1e5)).join(",");
5025
- function Rr(e, t, o, n) {
5024
+ const nc = /* @__PURE__ */ new WeakMap(), sc = /* @__PURE__ */ new WeakMap(), rc = 48, Rr = (e) => e.map((t) => Math.round(t * 1e5)).join(",");
5025
+ function Wr(e, t, o, n) {
5026
5026
  let a = e.get(t);
5027
5027
  a || e.set(t, a = /* @__PURE__ */ new Map());
5028
5028
  let r = a.get(o);
5029
- return r === void 0 && (a.size >= nc && a.clear(), a.set(o, r = n())), r;
5029
+ return r === void 0 && (a.size >= rc && a.clear(), a.set(o, r = n())), r;
5030
5030
  }
5031
5031
  function Mn(e, t) {
5032
- const o = Wr(t);
5033
- return Rr(tc, e, o, () => {
5034
- const n = Qh(e, t), a = [1 / 0, 1 / 0, 1 / 0], r = [-1 / 0, -1 / 0, -1 / 0];
5032
+ const o = Rr(t);
5033
+ return Wr(nc, e, o, () => {
5034
+ const n = tc(e, t), a = [1 / 0, 1 / 0, 1 / 0], r = [-1 / 0, -1 / 0, -1 / 0];
5035
5035
  for (const s of n.vertices) for (const i of [0, 1, 2])
5036
5036
  a[i] = Math.min(a[i], s[i]), r[i] = Math.max(r[i], s[i]);
5037
5037
  return { key: o, inSpace: n, low: a, high: r };
5038
5038
  });
5039
5039
  }
5040
- function sc(e, t) {
5040
+ function ac(e, t) {
5041
5041
  const o = e.map((l) => ({ ...l, ...Mn(l.mesh, l.local) })), n = [1 / 0, 1 / 0, 1 / 0], a = [-1 / 0, -1 / 0, -1 / 0];
5042
5042
  for (const l of o) for (const d of [0, 1, 2])
5043
5043
  n[d] = Math.min(n[d], l.low[d]), a[d] = Math.max(a[d], l.high[d]);
5044
5044
  const r = Os(n[0], a[0], t), s = Os(n[2], a[2], t), i = `${r.join(",")}|${s.join(",")}`, h = o.flatMap((l) => {
5045
5045
  if (l.high[0] - l.low[0] <= t * 2.5 && l.high[2] - l.low[2] <= t * 2.5 || l.whole || l.mesh.joined || (l.mesh.marks?.length ?? 0) > 0) {
5046
5046
  const f = [(l.low[0] + l.high[0]) / 2, (l.low[1] + l.high[1]) / 2, (l.low[2] + l.high[2]) / 2];
5047
- return [{ part: l.part, mesh: l.mesh, cut: !1, cell: Zh(r, s, f) }];
5047
+ return [{ part: l.part, mesh: l.mesh, cut: !1, cell: ec(r, s, f) }];
5048
5048
  }
5049
- return Rr(oc, l.inSpace, i, () => ec(l.inSpace, r, s)).map((f) => ({ part: l.part, mesh: f.mesh, cut: !0, cell: f.cell }));
5049
+ return Wr(sc, l.inSpace, i, () => oc(l.inSpace, r, s)).map((f) => ({ part: l.part, mesh: f.mesh, cut: !0, cell: f.cell }));
5050
5050
  }), c = (n[1] + a[1]) / 2;
5051
5051
  return { pieces: h, middle: ([l, d]) => [(r[l] + r[l + 1]) / 2, c, (s[d] + s[d + 1]) / 2] };
5052
5052
  }
5053
5053
  const Hs = 4e-3, No = 0.05, Is = /* @__PURE__ */ new WeakMap();
5054
- function rc(e) {
5054
+ function ic(e) {
5055
5055
  let t = Is.get(e);
5056
5056
  return t === void 0 && (t = !e.joined && !e.walls && e.faces.length >= 4 && e.faces.every((o) => {
5057
5057
  const n = e.vertices[o.corners[0]];
@@ -5060,7 +5060,7 @@ function rc(e) {
5060
5060
  }
5061
5061
  const xs = /* @__PURE__ */ new WeakMap();
5062
5062
  function zr(e) {
5063
- return e.filter(({ mesh: t }) => rc(t)).map(({ part: t, key: o, inSpace: n, low: a, high: r }) => {
5063
+ return e.filter(({ mesh: t }) => ic(t)).map(({ part: t, key: o, inSpace: n, low: a, high: r }) => {
5064
5064
  let s = xs.get(n);
5065
5065
  return s || (s = n.faces.map((i) => {
5066
5066
  const h = n.vertices[i.corners[0]];
@@ -5068,7 +5068,7 @@ function zr(e) {
5068
5068
  }), xs.set(n, s)), { part: t, key: o, planes: s, low: a, high: r };
5069
5069
  });
5070
5070
  }
5071
- function ac(e, t, o, n) {
5071
+ function lc(e, t, o, n) {
5072
5072
  const a = t.reduce((r, s) => [r[0] + s[0] / t.length, r[1] + s[1] / t.length, r[2] + s[2] / t.length], [0, 0, 0]);
5073
5073
  for (const r of n) {
5074
5074
  if (r.part === e || [0, 1, 2].some((i) => a[i] < r.low[i] - No || a[i] > r.high[i] + No)) continue;
@@ -5093,7 +5093,7 @@ function Lr(e, t, o, n, a) {
5093
5093
  const d = [o[0] * l[0] + o[4] * l[1] + o[8] * l[2], o[1] * l[0] + o[5] * l[1] + o[9] * l[2], o[2] * l[0] + o[6] * l[1] + o[10] * l[2]], f = Math.hypot(...d) || 1;
5094
5094
  return [d[0] / f, d[1] / f, d[2] / f];
5095
5095
  }, c = t.vertices.map((l) => ne.transformPoint(o, l));
5096
- i = t.faces.map((l) => ac(e, l.corners.map((d) => c[d]), h(l.normal), a)), s.set(r, i);
5096
+ i = t.faces.map((l) => lc(e, l.corners.map((d) => c[d]), h(l.normal), a)), s.set(r, i);
5097
5097
  }
5098
5098
  return i;
5099
5099
  }
@@ -5107,7 +5107,7 @@ const xt = {
5107
5107
  lean: { description: "The top sheared forward (+) or back (−): speed and drag", unit: "shear" },
5108
5108
  size: { description: "Its size, about the ground: 1 as built, 0 gone (pop it in or out)", unit: "factor", default: 1, min: 0 }
5109
5109
  }, Qo = Math.PI / 180;
5110
- function ic(e, t, o) {
5110
+ function hc(e, t, o) {
5111
5111
  return {
5112
5112
  toView: (n) => ma(Gs(n, e * 90 * Qo), -t * Qo),
5113
5113
  toScreen: (n) => ({ x: n[0] * o, y: -n[1] * o })
@@ -5115,7 +5115,7 @@ function ic(e, t, o) {
5115
5115
  }
5116
5116
  const _s = /* @__PURE__ */ new WeakMap(), ao = (e) => Ut(e), Ut = (e) => {
5117
5117
  let t = _s.get(e);
5118
- return t || _s.set(e, t = Bi(e)), t;
5118
+ return t || _s.set(e, t = Yi(e)), t;
5119
5119
  };
5120
5120
  function be(e, t, o) {
5121
5121
  return t[o] ?? e.controls[o]?.default ?? xt[o]?.default ?? 0;
@@ -5124,8 +5124,8 @@ function Ot(e, t) {
5124
5124
  const o = Math.max(0.05, be(e, t, "squash")), n = 1 / Math.sqrt(o), r = [1, 0, 0, 0, 0, 1, be(e, t, "lean"), 0, 0, 0, 1, 0, 0, 0, 0, 1];
5125
5125
  return [
5126
5126
  ne.translation([0, be(e, t, "lift"), 0]),
5127
- ne.fromQuat(Re.fromAxisAngle([1, 0, 0], -be(e, t, "pitch"))),
5128
- ne.fromQuat(Re.fromAxisAngle([0, 0, 1], be(e, t, "roll"))),
5127
+ ne.fromQuat(We.fromAxisAngle([1, 0, 0], -be(e, t, "pitch"))),
5128
+ ne.fromQuat(We.fromAxisAngle([0, 0, 1], be(e, t, "roll"))),
5129
5129
  r,
5130
5130
  ne.scaling([n, o, n]),
5131
5131
  ne.scaling(Array(3).fill(Math.max(0, be(e, t, "size"))))
@@ -5140,13 +5140,13 @@ function $n(e, t) {
5140
5140
  let c = ne.multiply(h ? r(h) : o, ne.translation(s.at ?? [0, 0, 0]));
5141
5141
  if (s.rotate) {
5142
5142
  const [l, d, f] = s.rotate;
5143
- l && (c = ne.multiply(c, ne.fromQuat(Re.fromAxisAngle([1, 0, 0], l)))), d && (c = ne.multiply(c, ne.fromQuat(Re.fromAxisAngle([0, 1, 0], d)))), f && (c = ne.multiply(c, ne.fromQuat(Re.fromAxisAngle([0, 0, 1], f))));
5143
+ l && (c = ne.multiply(c, ne.fromQuat(We.fromAxisAngle([1, 0, 0], l)))), d && (c = ne.multiply(c, ne.fromQuat(We.fromAxisAngle([0, 1, 0], d)))), f && (c = ne.multiply(c, ne.fromQuat(We.fromAxisAngle([0, 0, 1], f))));
5144
5144
  }
5145
5145
  for (const { value: l, bind: d } of a)
5146
5146
  if (!(!d.parts.includes(s.id) || l === 0)) {
5147
5147
  if (d.translate && (c = ne.multiply(c, ne.translation([d.translate[0] * l, d.translate[1] * l, d.translate[2] * l]))), d.rotate) {
5148
5148
  const f = d.rotate.pivot ?? [0, 0, 0], u = d.rotate.axis === "x" ? [1, 0, 0] : d.rotate.axis === "y" ? [0, 1, 0] : [0, 0, 1];
5149
- c = [c, ne.translation(f), ne.fromQuat(Re.fromAxisAngle(u, d.rotate.degrees * l)), ne.translation([-f[0], -f[1], -f[2]])].reduce((p, g) => ne.multiply(p, g));
5149
+ c = [c, ne.translation(f), ne.fromQuat(We.fromAxisAngle(u, d.rotate.degrees * l)), ne.translation([-f[0], -f[1], -f[2]])].reduce((p, g) => ne.multiply(p, g));
5150
5150
  }
5151
5151
  d.scale && (c = ne.multiply(c, ne.scaling([1 + (d.scale[0] - 1) * l, 1 + (d.scale[1] - 1) * l, 1 + (d.scale[2] - 1) * l])));
5152
5152
  }
@@ -5158,49 +5158,49 @@ function $n(e, t) {
5158
5158
  const Co = (() => {
5159
5159
  const e = [-0.45, 0.75, 0.5], t = Math.hypot(...e);
5160
5160
  return [e[0] / t, e[1] / t, e[2] / t];
5161
- })(), lc = Math.cos(35 * Qo);
5161
+ })(), cc = Math.cos(35 * Qo);
5162
5162
  function Fr(e, t, o, n, a = {}) {
5163
- const r = e.derive ? { ...t, ...e.derive(t) } : t, s = $n(e, r), i = o.toView([0, 0, 0]), h = (x) => (R) => [x[0] * R[0] + x[4] * R[1] + x[8] * R[2], x[1] * R[0] + x[5] * R[1] + x[9] * R[2], x[2] * R[0] + x[6] * R[1] + x[10] * R[2]], c = Ot(e, r), l = a.slice === void 0 ? null : ne.invert(c), d = l ? e.parts.map((x) => ({ part: x, mesh: Ut(x.shape), local: ne.multiply(l, s.get(x.id)), whole: x.shape.type === "tube" })) : void 0, f = d ? sc(d, a.slice) : void 0, u = d ? zr(d.map((x) => ({ part: x.part.id, mesh: x.mesh, ...Mn(x.mesh, x.local) }))) : void 0, p = (x, R, G, Y) => {
5164
- const oe = (W) => o.toView(ne.transformPoint(G, W)), q = R.vertices.map(oe), I = q.map((W) => o.toScreen(W)), N = a.perspective ? a.near : void 0, C = (W) => W.map((J) => o.toScreen(J)), S = (W) => N === void 0 ? W : Ps(W, N), _ = (W) => N === void 0 ? [W] : Jh(W, N), V = h(G), ee = R.faces.map((W) => {
5165
- const J = o.toView(V(W.normal)), he = [J[0] - i[0], J[1] - i[1], J[2] - i[2]], de = Math.hypot(...he) || 1;
5163
+ const r = e.derive ? { ...t, ...e.derive(t) } : t, s = $n(e, r), i = o.toView([0, 0, 0]), h = (x) => (W) => [x[0] * W[0] + x[4] * W[1] + x[8] * W[2], x[1] * W[0] + x[5] * W[1] + x[9] * W[2], x[2] * W[0] + x[6] * W[1] + x[10] * W[2]], c = Ot(e, r), l = a.slice === void 0 ? null : ne.invert(c), d = l ? e.parts.map((x) => ({ part: x, mesh: Ut(x.shape), local: ne.multiply(l, s.get(x.id)), whole: x.shape.type === "tube" })) : void 0, f = d ? ac(d, a.slice) : void 0, u = d ? zr(d.map((x) => ({ part: x.part.id, mesh: x.mesh, ...Mn(x.mesh, x.local) }))) : void 0, p = (x, W, G, Y) => {
5164
+ const oe = (R) => o.toView(ne.transformPoint(G, R)), q = W.vertices.map(oe), I = q.map((R) => o.toScreen(R)), N = a.perspective ? a.near : void 0, C = (R) => R.map((J) => o.toScreen(J)), S = (R) => N === void 0 ? R : Ps(R, N), _ = (R) => N === void 0 ? [R] : Qh(R, N), V = h(G), ee = W.faces.map((R) => {
5165
+ const J = o.toView(V(R.normal)), he = [J[0] - i[0], J[1] - i[1], J[2] - i[2]], de = Math.hypot(...he) || 1;
5166
5166
  return [he[0] / de, he[1] / de, he[2] / de];
5167
- }), L = u && Y ? Lr(x.id, R, Y, Wr(Y), u) : void 0, Q = (W) => L?.[W] ?? !1, re = ee.map((W, J) => {
5167
+ }), L = u && Y ? Lr(x.id, W, Y, Rr(Y), u) : void 0, Q = (R) => L?.[R] ?? !1, re = ee.map((R, J) => {
5168
5168
  if (Q(J)) return !1;
5169
- if (!a.perspective) return W[2] > 1e-6;
5170
- const de = R.faces[J].corners.reduce((pe, ge) => [pe[0] + q[ge][0], pe[1] + q[ge][1], pe[2] + q[ge][2]], [0, 0, 0]);
5171
- return -(W[0] * de[0] + W[1] * de[1] + W[2] * de[2]) > 1e-9;
5172
- }), K = (W) => R.faces[W].corners.reduce((J, he) => J + q[he][2], 0) / R.faces[W].corners.length, X = R.faces.map((W, J) => ({ face: W, i: J })).filter(({ i: W }) => re[W]).map(({ face: W, i: J }) => ({
5169
+ if (!a.perspective) return R[2] > 1e-6;
5170
+ const de = W.faces[J].corners.reduce((pe, ge) => [pe[0] + q[ge][0], pe[1] + q[ge][1], pe[2] + q[ge][2]], [0, 0, 0]);
5171
+ return -(R[0] * de[0] + R[1] * de[1] + R[2] * de[2]) > 1e-9;
5172
+ }), K = (R) => W.faces[R].corners.reduce((J, he) => J + q[he][2], 0) / W.faces[R].corners.length, X = W.faces.map((R, J) => ({ face: R, i: J })).filter(({ i: R }) => re[R]).map(({ face: R, i: J }) => ({
5173
5173
  i: J,
5174
5174
  solved: {
5175
- points: N === void 0 ? W.corners.map((he) => I[he]) : C(S(W.corners.map((he) => q[he]))),
5175
+ points: N === void 0 ? R.corners.map((he) => I[he]) : C(S(R.corners.map((he) => q[he]))),
5176
5176
  depth: K(J),
5177
5177
  tone: 0.72 + 0.33 * Math.max(0, ee[J][0] * Co[0] + ee[J][1] * Co[1] + ee[J][2] * Co[2])
5178
5178
  }
5179
- })).filter((W) => W.solved.points.length >= 3).sort((W, J) => W.solved.depth - J.solved.depth);
5179
+ })).filter((R) => R.solved.points.length >= 3).sort((R, J) => R.solved.depth - J.solved.depth);
5180
5180
  if (a.light) {
5181
- const W = h(G);
5181
+ const R = h(G);
5182
5182
  for (const { i: J, solved: he } of X) {
5183
- const de = R.faces[J].corners, pe = de.reduce((mo, ea) => {
5184
- const yo = ne.transformPoint(G, R.vertices[ea]);
5183
+ const de = W.faces[J].corners, pe = de.reduce((mo, ea) => {
5184
+ const yo = ne.transformPoint(G, W.vertices[ea]);
5185
5185
  return [mo[0] + yo[0] / de.length, mo[1] + yo[1] / de.length, mo[2] + yo[2] / de.length];
5186
- }, [0, 0, 0]), ge = W(R.faces[J].normal), Me = Math.hypot(...ge) || 1, yt = a.light(pe, [ge[0] / Me, ge[1] / Me, ge[2] / Me]);
5186
+ }, [0, 0, 0]), ge = R(W.faces[J].normal), Me = Math.hypot(...ge) || 1, yt = a.light(pe, [ge[0] / Me, ge[1] / Me, ge[2] / Me]);
5187
5187
  he.light = yt.light, he.fog = yt.fog;
5188
5188
  }
5189
5189
  }
5190
- const F = X.map((W) => W.solved), Z = hc(R), se = [], ae = [];
5191
- for (const [W, J] of Z) {
5190
+ const F = X.map((R) => R.solved), Z = dc(W), se = [], ae = [];
5191
+ for (const [R, J] of Z) {
5192
5192
  const he = J.filter((pe) => re[pe]).length;
5193
5193
  if (he === 0) continue;
5194
- const de = J.length === 2 && he === 2 && R.creases !== !1 && ee[J[0]][0] * ee[J[1]][0] + ee[J[0]][1] * ee[J[1]][1] + ee[J[0]][2] * ee[J[1]][2] < lc;
5195
- J.length === 1 && (R.joined || fc(R, W)) || (J.length === 1 || he === 1 || de) && (se.push(W.split("-").map(Number)), ae.push(J.filter((pe) => re[pe]).reduce((pe, ge) => K(ge) > K(pe) ? ge : pe)));
5194
+ const de = J.length === 2 && he === 2 && W.creases !== !1 && ee[J[0]][0] * ee[J[1]][0] + ee[J[0]][1] * ee[J[1]][1] + ee[J[0]][2] * ee[J[1]][2] < cc;
5195
+ J.length === 1 && (W.joined || gc(W, R)) || (J.length === 1 || he === 1 || de) && (se.push(R.split("-").map(Number)), ae.push(J.filter((pe) => re[pe]).reduce((pe, ge) => K(ge) > K(pe) ? ge : pe)));
5196
5196
  }
5197
- const ie = (W) => R.faces.findIndex((J) => J.corners.length > 4 && Math.sign(gc(R.vertices[W], J.normal)) > 0), $ = (R.marks ?? []).filter(([W]) => ie(W) < 0 || re[ie(W)]), z = ([W, J]) => N === void 0 ? [[I[W], I[J]]] : _([q[W], q[J]]).map(C), U = $.flatMap(z), te = (W) => N === void 0 ? [W.map((J) => I[J])] : _(W.map((J) => q[J])).map(C);
5197
+ const ie = (R) => W.faces.findIndex((J) => J.corners.length > 4 && Math.sign(mc(W.vertices[R], J.normal)) > 0), $ = (W.marks ?? []).filter(([R]) => ie(R) < 0 || re[ie(R)]), z = ([R, J]) => N === void 0 ? [[I[R], I[J]]] : _([q[R], q[J]]).map(C), U = $.flatMap(z), te = (R) => N === void 0 ? [R.map((J) => I[J])] : _(R.map((J) => q[J])).map(C);
5198
5198
  if (a.slice !== void 0) {
5199
- const W = /* @__PURE__ */ new Map();
5200
- se.forEach((J, he) => W.set(ae[he], [...W.get(ae[he]) ?? [], J]));
5199
+ const R = /* @__PURE__ */ new Map();
5200
+ se.forEach((J, he) => R.set(ae[he], [...R.get(ae[he]) ?? [], J]));
5201
5201
  for (const { i: J, solved: he } of X) {
5202
- he.edges = Ns(W.get(J) ?? []).flatMap(te);
5203
- const de = R.faces[J].corners;
5202
+ he.edges = Ns(R.get(J) ?? []).flatMap(te);
5203
+ const de = W.faces[J].corners;
5204
5204
  he.center = de.reduce((ge, Me) => [ge[0] + q[Me][0] / de.length, ge[1] + q[Me][1] / de.length, ge[2] + q[Me][2] / de.length], [0, 0, 0]), he.normal = ee[J];
5205
5205
  const pe = X[X.length - 1].i;
5206
5206
  he.marks = $.filter(([ge]) => (ie(ge) >= 0 ? ie(ge) : pe) === J).flatMap(z);
@@ -5209,14 +5209,14 @@ function Fr(e, t, o, n, a = {}) {
5209
5209
  const B = x.glow ? Math.max(0, Math.min(1, be(e, r, x.glow.control))) : 0, le = x.fade ? Math.max(0, Math.min(1, be(e, r, x.fade.control))) : 0, D = x.fade ? Math.max(0, Math.min(1, x.fade.from + (x.fade.to - x.fade.from) * le)) : 1;
5210
5210
  return {
5211
5211
  part: x,
5212
- depth: q.reduce((W, J) => W + J[2], 0) / Math.max(1, q.length),
5212
+ depth: q.reduce((R, J) => R + J[2], 0) / Math.max(1, q.length),
5213
5213
  faces: F,
5214
5214
  edges: Ns(se).flatMap(te),
5215
5215
  marks: U,
5216
5216
  glow: B,
5217
5217
  opacity: D,
5218
- ...x.shape.type === "tube" ? { spine: uc(_(x.shape.points.map(oe)).map(C)) } : {},
5219
- ...R.walls ? { cut: !0 } : {}
5218
+ ...x.shape.type === "tube" ? { spine: pc(_(x.shape.points.map(oe)).map(C)) } : {},
5219
+ ...W.walls ? { cut: !0 } : {}
5220
5220
  };
5221
5221
  }, g = new Map(d?.map((x) => [x.part.id, x.local])), T = (f ? f.pieces.map((x) => ({
5222
5222
  part: x.part,
@@ -5225,37 +5225,37 @@ function Fr(e, t, o, n, a = {}) {
5225
5225
  m: x.cut ? c : s.get(x.part.id),
5226
5226
  local: x.cut ? ne.identity() : g.get(x.part.id),
5227
5227
  cell: x.cell
5228
- })) : e.parts.map((x) => ({ part: x, mesh: Ut(x.shape), m: s.get(x.id), local: void 0, cell: void 0 }))).map((x) => ({ cell: x.cell, solved: p(x.part, x.mesh, x.m, x.local) })), H = T.map((x) => x.solved), M = (x) => x.filter((R) => R.faces.length > 0 && R.opacity > 0.01).sort((R, G) => R.depth - G.depth);
5228
+ })) : e.parts.map((x) => ({ part: x, mesh: Ut(x.shape), m: s.get(x.id), local: void 0, cell: void 0 }))).map((x) => ({ cell: x.cell, solved: p(x.part, x.mesh, x.m, x.local) })), H = T.map((x) => x.solved), M = (x) => x.filter((W) => W.faces.length > 0 && W.opacity > 0.01).sort((W, G) => W.depth - G.depth);
5229
5229
  let m;
5230
5230
  if (f) {
5231
5231
  const x = new Map(e.parts.map((G) => {
5232
5232
  const Y = s.get(G.id), oe = Ut(G.shape).vertices;
5233
5233
  return [G.id, oe.reduce((q, I) => q + o.toView(ne.transformPoint(Y, I))[2], 0) / Math.max(1, oe.length)];
5234
- })), R = /* @__PURE__ */ new Map();
5234
+ })), W = /* @__PURE__ */ new Map();
5235
5235
  for (const G of T) {
5236
5236
  const Y = G.cell.join(",");
5237
- R.has(Y) || R.set(Y, { cell: G.cell, parts: [] }), R.get(Y).parts.push(G.solved), G.solved.depth = x.get(G.solved.part.id);
5237
+ W.has(Y) || W.set(Y, { cell: G.cell, parts: [] }), W.get(Y).parts.push(G.solved), G.solved.depth = x.get(G.solved.part.id);
5238
5238
  }
5239
- m = [...R.values()].map(({ cell: G, parts: Y }) => ({ depth: o.toView(ne.transformPoint(c, f.middle(G)))[2], parts: M(Y) })).filter((G) => G.parts.length > 0);
5239
+ m = [...W.values()].map(({ cell: G, parts: Y }) => ({ depth: o.toView(ne.transformPoint(c, f.middle(G)))[2], parts: M(Y) })).filter((G) => G.parts.length > 0);
5240
5240
  }
5241
5241
  const P = {};
5242
- for (const [x, R] of Object.entries(e.anchors ?? {})) {
5243
- const G = R.part ? s.get(R.part) : Ot(e, r);
5244
- if (!G) throw new Error(`prop rig: anchor "${x}" is on "${R.part}", which is not a part`);
5245
- const Y = o.toView(ne.transformPoint(G, R.at));
5242
+ for (const [x, W] of Object.entries(e.anchors ?? {})) {
5243
+ const G = W.part ? s.get(W.part) : Ot(e, r);
5244
+ if (!G) throw new Error(`prop rig: anchor "${x}" is on "${W.part}", which is not a part`);
5245
+ const Y = o.toView(ne.transformPoint(G, W.at));
5246
5246
  P[x] = { point: o.toScreen(Y), depth: Y[2] };
5247
5247
  }
5248
- const [A, k] = e.footprint ?? [e.length * 0.45, e.length], y = Math.max(0, be(e, r, "lift")), v = Math.max(0, be(e, r, "size")) / (1 + y * 0.8), w = Array.from({ length: 24 }, (x, R) => {
5249
- const G = Math.PI * 2 * R / 24;
5248
+ const [A, k] = e.footprint ?? [e.length * 0.45, e.length], y = Math.max(0, be(e, r, "lift")), v = Math.max(0, be(e, r, "size")) / (1 + y * 0.8), w = Array.from({ length: 24 }, (x, W) => {
5249
+ const G = Math.PI * 2 * W / 24;
5250
5250
  return o.toView([Math.cos(G) * A * 0.55 * v, 0, Math.sin(G) * k * 0.55 * v]);
5251
5251
  }), E = a.perspective ? a.near : void 0, O = {
5252
5252
  points: (E === void 0 ? w : Ps(w, E)).map((x) => o.toScreen(x)),
5253
5253
  opacity: 0.16 * v
5254
- }, j = H.filter((x) => x.part.seeThrough && x.opacity > 0.01).flatMap((x) => x.faces.map((R) => R.points));
5254
+ }, j = H.filter((x) => x.part.seeThrough && x.opacity > 0.01).flatMap((x) => x.faces.map((W) => W.points));
5255
5255
  return { under: M(H.filter((x) => !x.part.overRider)), over: M(H.filter((x) => x.part.overRider)), ...m ? { cells: m } : {}, anchors: P, openings: j, shadow: O, pxPerUnit: n, sizePx: e.height * n };
5256
5256
  }
5257
5257
  const Ks = /* @__PURE__ */ new WeakMap();
5258
- function hc(e) {
5258
+ function dc(e) {
5259
5259
  let t = Ks.get(e);
5260
5260
  if (!t) {
5261
5261
  t = /* @__PURE__ */ new Map();
@@ -5270,7 +5270,7 @@ function hc(e) {
5270
5270
  }
5271
5271
  return t;
5272
5272
  }
5273
- function cc(e, t) {
5273
+ function fc(e, t) {
5274
5274
  const o = e.derive ? { ...t, ...e.derive(t) } : t, n = $n(e, o), a = ne.invert(Ot(e, o)) ?? ne.identity(), r = (s) => Math.max(0, Math.min(1, s));
5275
5275
  return e.parts.map((s) => {
5276
5276
  const i = s.fade ? r(be(e, o, s.fade.control)) : 0;
@@ -5283,7 +5283,7 @@ function cc(e, t) {
5283
5283
  };
5284
5284
  });
5285
5285
  }
5286
- function dc(e, t) {
5286
+ function uc(e, t) {
5287
5287
  const o = e.derive ? { ...t, ...e.derive(t) } : t, n = $n(e, o), a = Ot(e, o), r = {};
5288
5288
  for (const [s, i] of Object.entries(e.anchors ?? {})) {
5289
5289
  const h = i.part ? n.get(i.part) : a;
@@ -5292,15 +5292,15 @@ function dc(e, t) {
5292
5292
  }
5293
5293
  return r;
5294
5294
  }
5295
- function fc(e, t) {
5295
+ function gc(e, t) {
5296
5296
  if (!e.walls) return !1;
5297
5297
  const [o, n] = t.split("-").map((r) => e.vertices[Number(r)]), a = (r, s) => s.some((i) => Math.abs(o[r] - i) < 1e-6 && Math.abs(n[r] - i) < 1e-6);
5298
5298
  return a(0, e.walls.x) || a(2, e.walls.z);
5299
5299
  }
5300
- function uc(e) {
5300
+ function pc(e) {
5301
5301
  return e.reduce((t, o) => !t || o.length > t.length ? o : t, void 0);
5302
5302
  }
5303
- const gc = (e, t) => e[0] * t[0] + e[1] * t[1] + e[2] * t[2];
5303
+ const mc = (e, t) => e[0] * t[0] + e[1] * t[1] + e[2] * t[2];
5304
5304
  function Ns(e) {
5305
5305
  const t = e.map((n) => [...n]), o = [];
5306
5306
  for (; t.length > 0; ) {
@@ -5338,7 +5338,7 @@ function qr(e) {
5338
5338
  }
5339
5339
  return t;
5340
5340
  }
5341
- function pc(e) {
5341
+ function yc(e) {
5342
5342
  const { prop: t } = e, o = e.scale ?? 60, n = t.rig.length * o * 1.4, a = t.rig.height * o * 1.6, r = qr(t), s = {};
5343
5343
  for (const [h, c] of Object.entries(r)) s[h] = e.values?.[h] ?? c.default ?? 0;
5344
5344
  const i = { look: e.look, ink: e.ink, lineWidth: e.lineWidth, pencil: e.pencil, seed: e.seed, style: e.style, paper: e.paper };
@@ -5365,7 +5365,7 @@ function pc(e) {
5365
5365
  };
5366
5366
  }
5367
5367
  function jt(e, t, o) {
5368
- const n = ic(be(e.rig, t, "turn"), be(e.rig, t, "tilt"), o);
5368
+ const n = hc(be(e.rig, t, "turn"), be(e.rig, t, "tilt"), o);
5369
5369
  return Fr(e.rig, t, n, o);
5370
5370
  }
5371
5371
  function En(e, t, o) {
@@ -5385,7 +5385,7 @@ function En(e, t, o) {
5385
5385
  }
5386
5386
  };
5387
5387
  }
5388
- function nf(e, t, o, n, a = {}) {
5388
+ function rf(e, t, o, n, a = {}) {
5389
5389
  const r = En(t, o, n);
5390
5390
  return e.save(), e.translate(r.origin.x, r.origin.y), cr(e, r.solved, {
5391
5391
  ...t.propDraw,
@@ -5412,8 +5412,8 @@ const Mt = {
5412
5412
  move: "a part; { at, to: an anchor name or { x, y }, duration? }: carry the part there, loose",
5413
5413
  fling: "a part; { at, velocity?, spin?, gravity?, duration? }: knock the part off on a spinning arc"
5414
5414
  }
5415
- }, mc = 400, yc = 0.2;
5416
- function sf(e, t = {}) {
5415
+ }, bc = 400, wc = 0.2;
5416
+ function af(e, t = {}) {
5417
5417
  const { prop: o } = e, n = qr(o), a = Object.keys(n), r = Object.keys(o.rig.anchors ?? {}), s = o.rig.parts.map((A) => A.id), i = It(), h = fo(i), c = t.tracks?.length ? new ve({ id: `${o.kind}-surface`, tracks: t.tracks }) : void 0, l = Math.max(0, ...(t.tracks ?? []).flatMap((A) => A.keyframes.map((k) => k.time))), d = /* @__PURE__ */ new Map(), f = /* @__PURE__ */ new Map();
5418
5418
  e.loose = f;
5419
5419
  const u = e.props, p = (A) => {
@@ -5460,18 +5460,18 @@ function sf(e, t = {}) {
5460
5460
  const y = g(A), { values: v, origin: w, solved: E } = H(k);
5461
5461
  if (y.kind === "box") return me(w.x - e.width / 2, w.y - e.height, e.width, e.height);
5462
5462
  if (y.kind === "anchor") {
5463
- const x = E.anchors[y.name].point, R = yc * e.propScale;
5464
- return me(w.x + x.x - R / 2, w.y + x.y - R / 2, R, R);
5463
+ const x = E.anchors[y.name].point, W = wc * e.propScale;
5464
+ return me(w.x + x.x - W / 2, w.y + x.y - W / 2, W, W);
5465
5465
  }
5466
5466
  if (y.kind === "part") return j(/* @__PURE__ */ new Set([y.name]), `part "${y.name}" is`);
5467
5467
  const O = b(y.name);
5468
5468
  if (O.size === 0) return me(w.x - e.width / 2, w.y - e.height, e.width, e.height);
5469
5469
  return j(O, `the parts control "${y.name}" moves are`);
5470
- function j(x, R) {
5470
+ function j(x, W) {
5471
5471
  const G = [...E.under, ...E.over].filter((N) => x.has(N.part.id)).flatMap((N) => N.faces.flatMap((C) => C.points));
5472
5472
  if (G.length === 0) {
5473
5473
  const N = Number.isFinite(k) ? `at ${k} ms` : "after its edits";
5474
- throw new Error(`${o.kind}: ${R} turned away from the viewer ${N}; aim at an anchor (${r.map((C) => `anchor:${C}`).join(", ") || "none"}) or box`);
5474
+ throw new Error(`${o.kind}: ${W} turned away from the viewer ${N}; aim at an anchor (${r.map((C) => `anchor:${C}`).join(", ") || "none"}) or box`);
5475
5475
  }
5476
5476
  const Y = G.map((N) => N.x), oe = G.map((N) => N.y), q = Math.min(...Y), I = Math.min(...oe);
5477
5477
  return me(w.x + q, w.y + I, Math.max(...Y) - q, Math.max(...oe) - I);
@@ -5527,7 +5527,7 @@ function sf(e, t = {}) {
5527
5527
  j = y.value;
5528
5528
  } else
5529
5529
  j = y.on === !1 ? O.default ?? O.min ?? 0 : O.max ?? 1;
5530
- i.tween(E.name, p(y.at).values[E.name], j, y, mc);
5530
+ i.tween(E.name, p(y.at).values[E.name], j, y, bc);
5531
5531
  }
5532
5532
  return P;
5533
5533
  },
@@ -5556,9 +5556,9 @@ function sf(e, t = {}) {
5556
5556
  };
5557
5557
  return P;
5558
5558
  }
5559
- const bc = { body: "#e8574a", trim: "#3b3b44", glass: "#bfe3f2", tyre: "#2c2c33", hub: "#c9ccd3", light: "#fff4b8", tail: "#ff5a4f", inside: "#3b3640", seat: "#6d5d55" };
5559
+ const kc = { body: "#e8574a", trim: "#3b3b44", glass: "#bfe3f2", tyre: "#2c2c33", hub: "#c9ccd3", light: "#fff4b8", tail: "#ff5a4f", inside: "#3b3640", seat: "#6d5d55" };
5560
5560
  function De(e) {
5561
- const t = { ...bc, ...e.colors }, o = [], { forwardMost: n, backMost: a, top: r } = Br(e);
5561
+ const t = { ...kc, ...e.colors }, o = [], { forwardMost: n, backMost: a, top: r } = Br(e);
5562
5562
  e.body && o.push({ id: "body", shape: { type: "extrude", profile: e.body, width: e.width }, fill: t.body });
5563
5563
  for (const [l, d] of (e.frame ?? []).entries())
5564
5564
  o.push({ id: `frame-${l}`, shape: { type: "tube", points: d.points, radius: d.radius ?? 0.035, segments: 6 }, fill: d.color ?? t.body, outline: 0.7 });
@@ -5685,8 +5685,8 @@ function De(e) {
5685
5685
  family: "vehicle",
5686
5686
  summary: e.summary ?? "A wheeled vehicle",
5687
5687
  rig: c,
5688
- actions: kc(e),
5689
- acting: wc,
5688
+ actions: Sc(e),
5689
+ acting: vc,
5690
5690
  colors: { body: t.body, ink: "#26262b" },
5691
5691
  follow: e.antenna ? [{ control: "antenna", of: "x", per: 0.9, stiffness: 140, damping: 7, limit: 35 }] : void 0,
5692
5692
  wheelRadius: s,
@@ -5707,7 +5707,7 @@ function Br(e) {
5707
5707
  ];
5708
5708
  return { forwardMost: Math.max(...t), backMost: Math.min(...t), top: Math.max(...o) };
5709
5709
  }
5710
- const wc = {
5710
+ const vc = {
5711
5711
  depth: { turn: 0, lift: 0, lights: 0, pitch: 1, roll: 1, squash: 1, lean: 1, door: 2 },
5712
5712
  limits: { turn: 0.08, pitch: 5, roll: 4, lean: 0.1, squash: 0.06, door: 0.12, lift: 0 },
5713
5713
  eyes: [],
@@ -5719,7 +5719,7 @@ function qt(e, t, o, n, a, r, s = !1) {
5719
5719
  e.set("wheelSpin", t, h), e.move(t, o, n, { easing: a }), e.set("wheelSpin", o, s ? h : h + c / r * (180 / Math.PI), a);
5720
5720
  }
5721
5721
  const Cs = 0.4;
5722
- function kc(e) {
5722
+ function Sc(e) {
5723
5723
  const t = e.wheels[0]?.radius ?? 0.4, { forwardMost: o, backMost: n } = Br(e), a = (o - n) / 2, r = (i, h, c) => {
5724
5724
  const l = i.exaggeration;
5725
5725
  let d = h;
@@ -5788,7 +5788,7 @@ function kc(e) {
5788
5788
  } : {}
5789
5789
  };
5790
5790
  }
5791
- function vc(e = {}) {
5791
+ function Mc(e = {}) {
5792
5792
  return De({
5793
5793
  kind: "car",
5794
5794
  summary: "A cartoon car: drives, brakes, bumps, honks, opens its doors, lights up, and turns toward the camera.",
@@ -5806,7 +5806,7 @@ function vc(e = {}) {
5806
5806
  colors: e.colors
5807
5807
  });
5808
5808
  }
5809
- function Sc(e = {}) {
5809
+ function $c(e = {}) {
5810
5810
  return De({
5811
5811
  kind: "truck",
5812
5812
  summary: "A box truck: drives, brakes, bumps, honks, opens its cab doors, lights up, turns toward the camera.",
@@ -5825,7 +5825,7 @@ function Sc(e = {}) {
5825
5825
  colors: { body: "#2f6fb7", ...e.colors }
5826
5826
  });
5827
5827
  }
5828
- function Mc(e = {}) {
5828
+ function Ec(e = {}) {
5829
5829
  return De({
5830
5830
  kind: "bus",
5831
5831
  summary: "A bus: drives, brakes, bumps, honks, opens its front doors, lights its windows, turns toward the camera.",
@@ -5843,7 +5843,7 @@ function Mc(e = {}) {
5843
5843
  colors: { body: "#f2c230", ...e.colors }
5844
5844
  });
5845
5845
  }
5846
- function $c(e = {}) {
5846
+ function Ac(e = {}) {
5847
5847
  return De({
5848
5848
  kind: "tractor",
5849
5849
  summary: "A tractor: big rear wheels and small front ones turning at their own rates; drives, brakes, bumps, honks.",
@@ -5863,7 +5863,7 @@ function $c(e = {}) {
5863
5863
  colors: { body: "#3f9b47", hub: "#e9c64a", ...e.colors }
5864
5864
  });
5865
5865
  }
5866
- function Ec(e = {}) {
5866
+ function Tc(e = {}) {
5867
5867
  const t = e.colors?.body ?? "#a8743f";
5868
5868
  return De({
5869
5869
  kind: "cart",
@@ -5880,7 +5880,7 @@ function Ec(e = {}) {
5880
5880
  colors: { body: t, tyre: "#5a3a1f", ...e.colors }
5881
5881
  });
5882
5882
  }
5883
- function Ac(e = {}) {
5883
+ function Pc(e = {}) {
5884
5884
  return De({
5885
5885
  kind: "train carriage",
5886
5886
  summary: "A railway carriage: rolls along (drive), brakes, lights its windows, turns toward the camera.",
@@ -5898,7 +5898,7 @@ function Ac(e = {}) {
5898
5898
  colors: { body: "#2f7d6d", ...e.colors }
5899
5899
  });
5900
5900
  }
5901
- function Tc(e = {}) {
5901
+ function Oc(e = {}) {
5902
5902
  const t = e.colors?.body ?? "#e0473b", o = [0, 0.32, -0.05], n = [0, 0.86, -0.22], a = [0, 0.9, 0.42], r = [0, 0.34, 0.56], s = [0, 0.34, -0.56];
5903
5903
  return De({
5904
5904
  kind: "bike",
@@ -5923,7 +5923,7 @@ function Tc(e = {}) {
5923
5923
  colors: { body: t, tyre: "#2c2c33", ...e.colors }
5924
5924
  });
5925
5925
  }
5926
- function Pc(e = {}) {
5926
+ function Hc(e = {}) {
5927
5927
  return De({
5928
5928
  kind: "motorbike",
5929
5929
  summary: "A motorbike: rides (drive) with a lunge, brakes into a skid, bumps, honks, lights up.",
@@ -5944,7 +5944,7 @@ function Pc(e = {}) {
5944
5944
  colors: { body: "#1f1f26", hub: "#c9ccd3", ...e.colors }
5945
5945
  });
5946
5946
  }
5947
- function Oc(e = {}) {
5947
+ function Ic(e = {}) {
5948
5948
  const t = e.height ?? 2.4, o = e.trunkRadius ?? 0.16, n = e.canopy?.radius ?? 1.1, a = e.canopy?.shape === "tall", r = { trunk: "#8a5a3b", leaves: "#5cae5a", ...e.colors }, s = rn(e.canopy?.seed ?? 7), i = [
5949
5949
  { id: "trunk", shape: { type: "tube", points: [[0, 0, 0], [0.06, t * 0.5, 0], [-0.02, t, 0]], radius: o, segments: 8 }, fill: r.trunk },
5950
5950
  { id: "branch", parent: "trunk", shape: { type: "tube", points: [[0, 0, 0], [0.45, 0.4, 0.1]], radius: o * 0.45, segments: 6 }, at: [0.04, t * 0.62, 0], fill: r.trunk },
@@ -5975,19 +5975,19 @@ function Oc(e = {}) {
5975
5975
  family: "plant",
5976
5976
  summary: e.summary ?? "A tree: sways in the wind with its canopy trailing, shakes, sheds leaves, pops up.",
5977
5977
  rig: c,
5978
- actions: Ic(),
5979
- acting: Hc,
5978
+ actions: jc(),
5979
+ acting: xc,
5980
5980
  colors: { body: r.leaves }
5981
5981
  };
5982
5982
  }
5983
- const Hc = {
5983
+ const xc = {
5984
5984
  depth: { sway: 1, canopySway: 2, size: 0, squash: 1 },
5985
5985
  limits: { sway: 2, canopySway: 3, squash: 0.08 },
5986
5986
  eyes: [],
5987
5987
  headTurns: {},
5988
5988
  drift: []
5989
5989
  };
5990
- function Ic() {
5990
+ function jc() {
5991
5991
  const e = (t, o, n, a) => {
5992
5992
  const r = t.anchor("canopy");
5993
5993
  t.effect({ kind: "leaves", time: o, x: r.x, y: r.y, length: n, direction: a, toY: t.floor });
@@ -6030,7 +6030,7 @@ function Ic() {
6030
6030
  }
6031
6031
  };
6032
6032
  }
6033
- function xc(e = {}) {
6033
+ function _c(e = {}) {
6034
6034
  const t = e.width ?? 4, o = e.depth ?? 3.2, n = e.wallHeight ?? 2.5, a = e.roofHeight ?? 1.5, r = e.overhang ?? 0.25, s = { walls: "#f1d9a8", roof: "#b8433a", door: "#7a4b2a", doorway: "#3a2a22", glass: "#bfe3f2", lit: "#ffd66b", chimney: "#9b5a45", ...e.colors }, i = o / 2 + 0.01, h = e.door?.width ?? 0.9, c = e.door?.height ?? 1.9, l = e.door?.at ?? 0, d = e.windows ?? [
6035
6035
  { at: -1.25, low: 1, width: 0.8, height: 0.8 },
6036
6036
  { at: 1.25, low: 1, width: 0.8, height: 0.8 }
@@ -6095,19 +6095,19 @@ function xc(e = {}) {
6095
6095
  family: "building",
6096
6096
  summary: e.summary ?? "A house: opens its door, lights its windows, puffs chimney smoke, shakes, pops up.",
6097
6097
  rig: p,
6098
- actions: _c(!!u),
6099
- acting: jc,
6098
+ actions: Nc(!!u),
6099
+ acting: Kc,
6100
6100
  colors: { body: s.walls }
6101
6101
  };
6102
6102
  }
6103
- const jc = {
6103
+ const Kc = {
6104
6104
  depth: { door: 1, lights: 0, roll: 1, squash: 1, size: 0 },
6105
6105
  limits: { door: 0.1, roll: 1.5, squash: 0.05 },
6106
6106
  eyes: [],
6107
6107
  headTurns: {},
6108
6108
  drift: []
6109
6109
  };
6110
- function _c(e) {
6110
+ function Nc(e) {
6111
6111
  return {
6112
6112
  door: {
6113
6113
  summary: "Opens the front door (`open: true`) or shuts it (`open: false`).",
@@ -6148,7 +6148,7 @@ function _c(e) {
6148
6148
  } : {}
6149
6149
  };
6150
6150
  }
6151
- function Kc(e = {}) {
6151
+ function Cc(e = {}) {
6152
6152
  const t = e.width ?? 0.46, o = e.depth ?? 0.46, n = e.seatHeight ?? 0.46, a = e.backHeight ?? 0.95, r = { wood: "#8a5a3b", seat: "#c48a4a", ...e.colors }, s = 0.05, i = 0.025, h = [
6153
6153
  { id: "seat", shape: { type: "box", size: [t, s, o] }, at: [0, n - s / 2, 0], fill: r.seat },
6154
6154
  { id: "back", shape: { type: "box", size: [t, a - n, s] }, at: [0, (a + n) / 2, -o / 2 + s / 2], fill: r.wood }
@@ -6174,19 +6174,19 @@ function Kc(e = {}) {
6174
6174
  family: "furniture",
6175
6175
  summary: e.summary ?? "A chair: a seat to sit on (`seat`), tips back on its rear legs and settles, or falls over.",
6176
6176
  rig: c,
6177
- actions: Cc(),
6178
- acting: Nc,
6177
+ actions: Wc(),
6178
+ acting: Rc,
6179
6179
  colors: { body: r.seat }
6180
6180
  };
6181
6181
  }
6182
- const Nc = {
6182
+ const Rc = {
6183
6183
  depth: { tip: 1, roll: 1, squash: 1, size: 0 },
6184
6184
  limits: { tip: 2, roll: 1, squash: 0.05 },
6185
6185
  eyes: [],
6186
6186
  headTurns: {},
6187
6187
  drift: []
6188
6188
  };
6189
- function Cc() {
6189
+ function Wc() {
6190
6190
  return {
6191
6191
  tip: {
6192
6192
  summary: "Tips back on its rear legs for `for` ms (default 1200), rocking a little, then settles down.",
@@ -6206,7 +6206,7 @@ function Cc() {
6206
6206
  }
6207
6207
  };
6208
6208
  }
6209
- function Wc(e = {}) {
6209
+ function zc(e = {}) {
6210
6210
  const t = e.width ?? 1.4, o = e.depth ?? 0.7, n = e.height ?? 0.75, a = { wood: "#8a5a3b", top: "#a9754a", knob: "#2b2b2b", ...e.colors }, r = 0.04, s = 0.03, i = 0.14, h = t * 0.4, c = [
6211
6211
  { id: "top", shape: { type: "box", size: [t, r, o] }, at: [0, n - r / 2, 0], fill: a.top },
6212
6212
  // The drawer: a box under the top on the left, sliding forward on its control.
@@ -6244,18 +6244,18 @@ function Wc(e = {}) {
6244
6244
  }
6245
6245
  }
6246
6246
  },
6247
- acting: Rc,
6247
+ acting: Lc,
6248
6248
  colors: { body: a.top }
6249
6249
  };
6250
6250
  }
6251
- const Rc = {
6251
+ const Lc = {
6252
6252
  depth: { drawer: 1, roll: 1, squash: 1, size: 0 },
6253
6253
  limits: { drawer: 0.08, roll: 1, squash: 0.04 },
6254
6254
  eyes: [],
6255
6255
  headTurns: {},
6256
6256
  drift: []
6257
6257
  };
6258
- function zc(e = {}) {
6258
+ function Fc(e = {}) {
6259
6259
  const t = e.length ?? 2, o = e.width ?? 1, n = e.height ?? 0.55, a = e.headboard ?? 0.95, r = { wood: "#8a5a3b", mattress: "#f1ece2", blanket: "#5b7fb0", pillow: "#fbf8f2", ...e.colors }, s = 0.3, i = n - s, c = {
6260
6260
  parts: [
6261
6261
  { id: "frame", shape: { type: "box", size: [o, s, t] }, at: [0, s / 2, 0], fill: r.wood },
@@ -6292,18 +6292,18 @@ function zc(e = {}) {
6292
6292
  }
6293
6293
  }
6294
6294
  },
6295
- acting: Lc,
6295
+ acting: Dc,
6296
6296
  colors: { body: r.blanket }
6297
6297
  };
6298
6298
  }
6299
- const Lc = {
6299
+ const Dc = {
6300
6300
  depth: { give: 1, roll: 1, squash: 1, size: 0 },
6301
6301
  limits: { give: 0.03, roll: 0.5, squash: 0.03 },
6302
6302
  eyes: [],
6303
6303
  headTurns: {},
6304
6304
  drift: []
6305
6305
  };
6306
- function Fc(e = {}) {
6306
+ function qc(e = {}) {
6307
6307
  const t = e.width ?? 0.9, o = e.height ?? 2.05, n = e.hinge ?? "left", a = { frame: "#d9d2c3", door: "#7a4b2a", handle: "#c9a227", beyond: "#2a2f3a", ...e.colors }, r = 0.1, s = n === "left" ? 1 : -1, i = s > 0 ? [[0, 0], [-t, 0], [-t, o], [0, o]] : [[0, 0], [t, 0], [t, o], [0, o]], c = {
6308
6308
  parts: [
6309
6309
  { id: "post-left", shape: { type: "box", size: [r, o + r, r] }, at: [t / 2 + r / 2, (o + r) / 2, 0], fill: a.frame },
@@ -6331,19 +6331,19 @@ function Fc(e = {}) {
6331
6331
  family: "furniture",
6332
6332
  summary: e.summary ?? "A door in its frame: opens and shuts on its hinge (`open`), slams, rattles when knocked; a figure goes through the `doorway` from `front` to `beyond`.",
6333
6333
  rig: c,
6334
- actions: qc(),
6335
- acting: Dc,
6334
+ actions: Gc(),
6335
+ acting: Bc,
6336
6336
  colors: { body: a.door }
6337
6337
  };
6338
6338
  }
6339
- const Dc = {
6339
+ const Bc = {
6340
6340
  depth: { open: 1, roll: 1, squash: 1, size: 0 },
6341
6341
  limits: { open: 0.08, roll: 0.6, squash: 0.03 },
6342
6342
  eyes: [],
6343
6343
  headTurns: {},
6344
6344
  drift: []
6345
6345
  };
6346
- function qc() {
6346
+ function Gc() {
6347
6347
  return {
6348
6348
  open: {
6349
6349
  summary: "Opens the door (`open: true`, default) or shuts it (`open: false`), over `for` ms (default 600).",
@@ -6377,7 +6377,7 @@ function qc() {
6377
6377
  };
6378
6378
  }
6379
6379
  const Gr = 1.4;
6380
- function Bc(e = {}) {
6380
+ function Yc(e = {}) {
6381
6381
  const t = e.width ?? 0.5, o = e.seatHeight ?? 0.5, n = e.wheelRadius ?? 0.3, a = 0.08, r = { frame: "#2b2f36", seat: "#3c6ea5", tyre: "#1f2328", ...e.colors }, s = 0.04, i = 0.018, h = 0.44, c = o + 0.5, l = -0.08, d = t / 2 + 0.06, f = [
6382
6382
  { id: "seat", shape: { type: "box", size: [t, s, h] }, at: [0, o - s / 2, 0], fill: r.seat },
6383
6383
  { id: "back", shape: { type: "box", size: [t, c - o - 0.02, s] }, at: [0, (c + o) / 2, -h / 2 + s / 2], fill: r.seat },
@@ -6435,25 +6435,25 @@ function Bc(e = {}) {
6435
6435
  family: "furniture",
6436
6436
  summary: e.summary ?? "A wheelchair: rolls to `to` with its wheels turning the distance (roll), brakes, tips back on its big wheels (wheelie); its `seat` is ridden in the `wheeling` pose and a pusher stands at `handles`.",
6437
6437
  rig: p,
6438
- actions: Yc(n),
6439
- acting: Gc,
6438
+ actions: Xc(n),
6439
+ acting: Uc,
6440
6440
  colors: { body: r.seat, ink: r.frame },
6441
6441
  wheelRadius: n,
6442
6442
  moves: { roll: { speed: Gr, perMetre: { wheelSpin: 180 / (Math.PI * n) } } }
6443
6443
  };
6444
6444
  }
6445
- const Gc = {
6445
+ const Uc = {
6446
6446
  depth: { wheelSpin: 0, tip: 1, roll: 1, squash: 1, size: 0 },
6447
6447
  limits: { tip: 2, roll: 1, squash: 0.03 },
6448
6448
  eyes: [],
6449
6449
  headTurns: {},
6450
6450
  drift: []
6451
6451
  };
6452
- function Ws(e, t, o, n, a, r, s = !1) {
6452
+ function Rs(e, t, o, n, a, r, s = !1) {
6453
6453
  const i = e.facing() || Math.sign(n - e.x) || 1, h = e.values.wheelSpin ?? 0, c = (n - e.x) * i / e.scale;
6454
6454
  e.set("wheelSpin", t, h), e.move(t, o, n, { easing: a }), e.set("wheelSpin", o, s ? h : h + c / r * (180 / Math.PI), a);
6455
6455
  }
6456
- function Yc(e) {
6456
+ function Xc(e) {
6457
6457
  return {
6458
6458
  roll: {
6459
6459
  summary: "Rolls to `to` at `speed` px/ms (or over `for` ms): a small push-off, the wheels turning exactly the distance, and a gentle stop.",
@@ -6465,7 +6465,7 @@ function Yc(e) {
6465
6465
  let r = n;
6466
6466
  t.facing() !== a && (r = t.turnTo(r, a > 0 ? "right" : "left"));
6467
6467
  const s = Math.abs(o.to - t.x), i = o.for ?? Math.max(300, s / (o.speed ?? Gr * t.scale / 1e3));
6468
- return t.key(r + 150, { tip: 1.5 * t.exaggeration }, { act: !1, easing: "ease-out" }), Ws(t, r, r + i, o.to, "ease-in-out", e), t.key(r + i, { tip: 0 }, { easing: "ease-out" }), { end: r + i };
6468
+ return t.key(r + 150, { tip: 1.5 * t.exaggeration }, { act: !1, easing: "ease-out" }), Rs(t, r, r + i, o.to, "ease-in-out", e), t.key(r + i, { tip: 0 }, { easing: "ease-out" }), { end: r + i };
6469
6469
  }
6470
6470
  },
6471
6471
  brake: {
@@ -6475,7 +6475,7 @@ function Yc(e) {
6475
6475
  run(t, o, n) {
6476
6476
  if (Math.sign(o.to - t.x) === 0) return { end: n };
6477
6477
  const r = o.for ?? 500;
6478
- return Ws(t, n, n + r, o.to, "ease-out", e, !0), t.key(n + r, { tip: 0 }, { easing: "ease-out" }), t.effect({ kind: "dust", time: n + r * 0.5, x: o.to, y: t.floor, length: 500 }), { end: n + r, contact: n + r };
6478
+ return Rs(t, n, n + r, o.to, "ease-out", e, !0), t.key(n + r, { tip: 0 }, { easing: "ease-out" }), t.effect({ kind: "dust", time: n + r * 0.5, x: o.to, y: t.floor, length: 500 }), { end: n + r, contact: n + r };
6479
6479
  }
6480
6480
  },
6481
6481
  wheelie: {
@@ -6488,7 +6488,7 @@ function Yc(e) {
6488
6488
  }
6489
6489
  };
6490
6490
  }
6491
- function Uc(e = {}) {
6491
+ function Vc(e = {}) {
6492
6492
  const t = { body: "#3f86c8", glass: "#cfeaf5", trim: "#2c2c33", rotor: "#3b3b44", ...e.colors }, o = 2.15, a = {
6493
6493
  parts: [
6494
6494
  {
@@ -6541,11 +6541,11 @@ function Uc(e = {}) {
6541
6541
  family: "aircraft",
6542
6542
  summary: e.summary ?? "A cartoon helicopter: spools up and takes off, flies nose-down banking into its moves, hovers with a bob, and lands with a squash.",
6543
6543
  rig: a,
6544
- actions: Xc(),
6544
+ actions: Jc(),
6545
6545
  acting: Yr,
6546
6546
  colors: { body: t.body, ink: "#26262b" },
6547
6547
  // In world metres: flies with its rotor spinning (a blur), at the height a beat gives.
6548
- moves: { fly: { speed: 15, flies: !0, hold: { blur: 1 }, perSecond: { rotor: We * 1e3 } } }
6548
+ moves: { fly: { speed: 15, flies: !0, hold: { blur: 1 }, perSecond: { rotor: Re * 1e3 } } }
6549
6549
  };
6550
6550
  }
6551
6551
  const Yr = {
@@ -6554,8 +6554,8 @@ const Yr = {
6554
6554
  eyes: [],
6555
6555
  headTurns: {},
6556
6556
  drift: []
6557
- }, We = 2.6;
6558
- function Xc() {
6557
+ }, Re = 2.6;
6558
+ function Jc() {
6559
6559
  const e = (o, n, a, r, s) => {
6560
6560
  const i = o.values.rotor ?? 0;
6561
6561
  o.set("rotor", n, i);
@@ -6568,9 +6568,9 @@ function Xc() {
6568
6568
  uses: ["height"],
6569
6569
  run(o, n, a) {
6570
6570
  const r = o.exaggeration, s = n.height ?? 3;
6571
- e(o, a, a + 900, We, "ease-in"), o.key(a + 900, { blur: 1 }, { act: !1, easing: "ease-in" }), o.key(a + 700, { squash: 1 - 0.08 * r }, { act: !1, easing: "ease-in" });
6571
+ e(o, a, a + 900, Re, "ease-in"), o.key(a + 900, { blur: 1 }, { act: !1, easing: "ease-in" }), o.key(a + 700, { squash: 1 - 0.08 * r }, { act: !1, easing: "ease-in" });
6572
6572
  const i = a + 1e3;
6573
- return o.key(i + 150, { squash: 1 + 0.06 * r, lift: 0.3 }, { act: !1, easing: "ease-out" }), o.key(i + 1300, { squash: 1, lift: s, pitch: -4 * r }, { act: !1, easing: "ease-in-out" }), o.key(i + 1700, { pitch: 0 }), e(o, a + 900, i + 1700, We), o.effect({ kind: "dust", time: i, x: o.x, y: o.floor, length: 900 }), { end: i + 1700, contact: i };
6573
+ return o.key(i + 150, { squash: 1 + 0.06 * r, lift: 0.3 }, { act: !1, easing: "ease-out" }), o.key(i + 1300, { squash: 1, lift: s, pitch: -4 * r }, { act: !1, easing: "ease-in-out" }), o.key(i + 1700, { pitch: 0 }), e(o, a + 900, i + 1700, Re), o.effect({ kind: "dust", time: i, x: o.x, y: o.floor, length: 900 }), { end: i + 1700, contact: i };
6574
6574
  }
6575
6575
  },
6576
6576
  fly: {
@@ -6582,7 +6582,7 @@ function Xc() {
6582
6582
  let i = a;
6583
6583
  s !== 0 && o.facing() !== s && (i = o.turnTo(i, s > 0 ? "right" : "left"));
6584
6584
  const h = Math.abs(n.to - o.x), c = n.for ?? Math.max(700, h / (n.speed ?? 0.3)), l = n.height ?? o.values.lift;
6585
- return o.key(i + 300, { pitch: -9 * r, roll: 6 * r }, { act: !1, easing: "ease-out" }), o.key(i + c - 250, { pitch: -4 * r, roll: 3 * r, lift: l }, { act: !1 }), o.key(i + c, { pitch: 7 * r, roll: 0 }, { act: !1, easing: "ease-out" }), o.key(i + c + 450, { pitch: 0 }), o.move(i, i + c, n.to, { easing: "ease-in-out" }), e(o, a, i + c + 450, We), { end: i + c + 450, contact: i, release: i + c };
6585
+ return o.key(i + 300, { pitch: -9 * r, roll: 6 * r }, { act: !1, easing: "ease-out" }), o.key(i + c - 250, { pitch: -4 * r, roll: 3 * r, lift: l }, { act: !1 }), o.key(i + c, { pitch: 7 * r, roll: 0 }, { act: !1, easing: "ease-out" }), o.key(i + c + 450, { pitch: 0 }), o.move(i, i + c, n.to, { easing: "ease-in-out" }), e(o, a, i + c + 450, Re), { end: i + c + 450, contact: i, release: i + c };
6586
6586
  }
6587
6587
  },
6588
6588
  hover: {
@@ -6592,19 +6592,19 @@ function Xc() {
6592
6592
  const r = n.for ?? 2e3, s = o.values.lift, i = o.exaggeration;
6593
6593
  for (let h = 350, c = 0; h < r; h += 350, c++)
6594
6594
  o.key(a + h, { lift: s + (c % 2 === 0 ? 0.12 : -0.06) * i, roll: (c % 2 === 0 ? 1.5 : -1.5) * i }, { act: !1, easing: "ease-in-out" });
6595
- return o.key(a + r, { lift: s, roll: 0 }, { act: !1, easing: "ease-in-out" }), (t(o) || s > 0) && e(o, a, a + r, We), { end: a + r };
6595
+ return o.key(a + r, { lift: s, roll: 0 }, { act: !1, easing: "ease-in-out" }), (t(o) || s > 0) && e(o, a, a + r, Re), { end: a + r };
6596
6596
  }
6597
6597
  },
6598
6598
  land: {
6599
6599
  summary: "Settles down onto its skids: a flare, a squash on touchdown with dust, and the rotor spools down.",
6600
6600
  run(o, n, a) {
6601
6601
  const r = o.exaggeration, s = a + Math.max(900, o.values.lift * 450);
6602
- return o.key(a + 400, { pitch: 3 * r }, { act: !1, easing: "ease-out" }), o.key(s, { lift: 0, pitch: 0, squash: 1 - 0.14 * r }, { act: !1, easing: "ease-in" }), o.key(s + 280, { squash: 1 }), e(o, a, s, We), e(o, s, s + 1600, We, "ease-out"), o.key(s + 1600, { blur: 0 }, { act: !1, easing: "ease-out" }), o.effect({ kind: "dust", time: s, x: o.x, y: o.floor, length: 800 }), { end: s + 1600, contact: s };
6602
+ return o.key(a + 400, { pitch: 3 * r }, { act: !1, easing: "ease-out" }), o.key(s, { lift: 0, pitch: 0, squash: 1 - 0.14 * r }, { act: !1, easing: "ease-in" }), o.key(s + 280, { squash: 1 }), e(o, a, s, Re), e(o, s, s + 1600, Re, "ease-out"), o.key(s + 1600, { blur: 0 }, { act: !1, easing: "ease-out" }), o.effect({ kind: "dust", time: s, x: o.x, y: o.floor, length: 800 }), { end: s + 1600, contact: s };
6603
6603
  }
6604
6604
  }
6605
6605
  };
6606
6606
  }
6607
- function Vc(e = {}) {
6607
+ function Zc(e = {}) {
6608
6608
  const t = { body: "#e9e4d8", wings: "#d9483b", glass: "#cfeaf5", trim: "#2c2c33", ...e.colors }, o = 3.15, a = {
6609
6609
  parts: [
6610
6610
  { id: "fuselage", shape: { type: "extrude", profile: [[-3.7, 1.55], [-2.6, 1.05], [2.4, 0.85], [3, 1], [3.1, 1.4], [2.7, 1.75], [1.4, 1.9], [-2.9, 1.85]], width: 1 }, fill: t.body },
@@ -6645,17 +6645,17 @@ function Vc(e = {}) {
6645
6645
  family: "aircraft",
6646
6646
  summary: e.summary ?? "A propeller plane: takes off from a run, flies banked, loops the loop, and lands with a flare and a squash.",
6647
6647
  rig: a,
6648
- actions: Zc(),
6648
+ actions: e0(),
6649
6649
  acting: Yr,
6650
6650
  colors: { body: t.body, ink: "#26262b" },
6651
- moves: { fly: { speed: 30, flies: !0, hold: { blur: 1 }, perSecond: { rotor: We * 1e3 } } }
6651
+ moves: { fly: { speed: 30, flies: !0, hold: { blur: 1 }, perSecond: { rotor: Re * 1e3 } } }
6652
6652
  };
6653
6653
  }
6654
- const Jc = 3.2;
6655
- function Zc() {
6654
+ const Qc = 3.2;
6655
+ function e0() {
6656
6656
  const e = (o, n, a, r) => {
6657
6657
  const s = o.values.rotor ?? 0;
6658
- o.set("rotor", n, s), o.set("rotor", a, s + Jc * (a - n) * (r ? 0.5 : 1), r);
6658
+ o.set("rotor", n, s), o.set("rotor", a, s + Qc * (a - n) * (r ? 0.5 : 1), r);
6659
6659
  }, t = (o, n, a) => {
6660
6660
  const r = Math.sign(a - o.x);
6661
6661
  return r !== 0 && o.facing() !== r ? o.turnTo(n, r > 0 ? "right" : "left") : n;
@@ -6704,7 +6704,7 @@ function Zc() {
6704
6704
  }
6705
6705
  };
6706
6706
  }
6707
- const _t = ["walk", "trot", "canter", "gallop"], rf = _t, Ur = ["fl", "fr", "hl", "hr"], po = {
6707
+ const _t = ["walk", "trot", "canter", "gallop"], lf = _t, Ur = ["fl", "fr", "hl", "hr"], po = {
6708
6708
  walk: { offsets: { hl: 0, fl: 0.25, hr: 0.5, fr: 0.75 }, swing: 16, lift: 45, bob: 0.02, rock: 0, cycle: 1100 },
6709
6709
  trot: { offsets: { fl: 0, hr: 0, fr: 0.5, hl: 0.5 }, swing: 22, lift: 75, bob: 0.05, rock: 0, cycle: 640 },
6710
6710
  canter: { offsets: { hr: 0, hl: 0.33, fr: 0.33, fl: 0.66 }, swing: 30, lift: 70, bob: 0.08, rock: 5, cycle: 560 },
@@ -6719,7 +6719,7 @@ function Ze(e) {
6719
6719
  // The neck tapers from the shoulders up to the head.
6720
6720
  { id: "neck", shape: { type: "tube", points: e.neck.points, radius: e.neck.points.map((d, f, u) => e.neck.radius * (1.25 - 0.4 * f / Math.max(1, u.length - 1))), segments: 12 }, at: e.neck.at, fill: o.coat },
6721
6721
  { id: "head", parent: "neck", shape: { type: "ellipsoid", radii: e.head.radii, segments: 14 }, at: e.head.at, rotate: e.head.rotate, fill: o.coat },
6722
- ...e0(e, o, a)
6722
+ ...o0(e, o, a)
6723
6723
  ];
6724
6724
  e.mane && s.push({ id: "mane", parent: "neck", shape: { type: "tube", points: e.mane.points, radius: e.mane.radius, segments: 6 }, fill: o.dark, outline: 0.7 }), e.muzzle && s.push({ id: "muzzle", parent: "head", shape: { type: "ellipsoid", radii: e.muzzle.radii, segments: 10 }, at: e.muzzle.at, fill: o.muzzle, outline: 0.8 });
6725
6725
  for (const d of [1, -1]) {
@@ -6766,7 +6766,7 @@ function Ze(e) {
6766
6766
  front: { at: [0, a, e.body.radii[2]] },
6767
6767
  ...e.anchors
6768
6768
  },
6769
- derive: (d) => t0(d, e, n)
6769
+ derive: (d) => n0(d, e, n)
6770
6770
  }, l = {
6771
6771
  legLength: n,
6772
6772
  upper: t.upper,
@@ -6785,17 +6785,17 @@ function Ze(e) {
6785
6785
  family: "animal",
6786
6786
  summary: e.summary,
6787
6787
  rig: c,
6788
- actions: { ...n0(e, l), ...e.actions?.(l) },
6788
+ actions: { ...r0(e, l), ...e.actions?.(l) },
6789
6789
  acting: Xr,
6790
6790
  colors: { body: o.coat, ink: "#26262b" },
6791
6791
  follow: [
6792
6792
  { control: "tail", of: "x", per: 0.6, stiffness: 90, damping: 6, limit: 40 },
6793
6793
  { control: "ears", of: "x", per: 1.4, stiffness: 150, damping: 8, limit: 45 }
6794
6794
  ],
6795
- moves: Qc(e, n)
6795
+ moves: t0(e, n)
6796
6796
  };
6797
6797
  }
6798
- function Qc(e, t) {
6798
+ function t0(e, t) {
6799
6799
  const o = (a) => {
6800
6800
  const r = An(t, a);
6801
6801
  return {
@@ -6808,7 +6808,7 @@ function Qc(e, t) {
6808
6808
  return e.gaits.includes("gallop") && !n.gallop && (n.gallop = o("gallop")), n;
6809
6809
  }
6810
6810
  const Ee = Array.from({ length: 7 }, (e, t) => t === 0 ? "tail" : `tail-${t}`);
6811
- function e0(e, t, o) {
6811
+ function o0(e, t, o) {
6812
6812
  const n = yr(e.tail.points, Ee.length + 1), [, a, r] = e.body.radii, s = (e.tail.at[1] - o) / a, i = Math.abs(s) < 1 ? -r * Math.sqrt(1 - s * s) : e.tail.at[2], h = [e.tail.at[0], e.tail.at[1], i + Math.min(0.04, r * 0.08)], c = (u) => e.tail.radius * (1 - 0.5 * u / Ee.length), l = Ee.map((u, p) => {
6813
6813
  const g = n[p], b = n[p + 1], T = [b[0] - g[0], b[1] - g[1], b[2] - g[2]], H = p === 0 ? void 0 : n[p - 1];
6814
6814
  return {
@@ -6831,7 +6831,7 @@ function e0(e, t, o) {
6831
6831
  solidOnly: !0
6832
6832
  }), l;
6833
6833
  }
6834
- function t0(e, t, o) {
6834
+ function n0(e, t, o) {
6835
6835
  const n = Math.max(0, Math.min(1, e.walking ?? 0));
6836
6836
  if (n === 0) return {};
6837
6837
  const a = _t[Math.max(0, Math.min(3, Math.round(e.gait ?? 0)))], r = po[t.gaits.includes(a) ? a : t.gaits[0]], s = e.walk ?? 0, i = {};
@@ -6842,7 +6842,7 @@ function t0(e, t, o) {
6842
6842
  const h = Math.PI * 2 * s;
6843
6843
  return i.lift = (e.lift ?? 0) + n * r.bob * o * Math.abs(Math.sin(h * 2)), i.pitch = (e.pitch ?? 0) + n * r.rock * Math.sin(h), i.neck = (e.neck ?? 0) + n * (r.rock > 0 ? -r.rock * 1.4 : 5) * Math.sin(h * 2), i;
6844
6844
  }
6845
- function Rs(e) {
6845
+ function Ws(e) {
6846
6846
  const o = Math.sin(32 * ze), n = e.legLength - (e.front - e.hind) * o, a = 72, s = (n - e.upper * Math.cos(a * ze) - e.foot) / e.lower, i = s >= 1 ? 0 : s <= -1 ? 180 : Math.acos(s) / ze, h = {
6847
6847
  pitch: 32,
6848
6848
  // The front hips stay at standing height: tipping up raises them by front · sin, and swinging them round the
@@ -6864,8 +6864,8 @@ const Xr = {
6864
6864
  eyes: [],
6865
6865
  headTurns: {},
6866
6866
  drift: []
6867
- }, af = Xr;
6868
- function o0(e) {
6867
+ }, hf = Xr;
6868
+ function s0(e) {
6869
6869
  const t = (e.upper + e.lower) * 0.32, o = Math.asin(Math.min(1, t / (e.upper + e.lower + e.foot))) / ze, n = {
6870
6870
  pitch: 0,
6871
6871
  lift: t - e.legLength,
@@ -6882,7 +6882,7 @@ function o0(e) {
6882
6882
  n[`${a}.swing`] = 70, n[`${a}.knee`] = -155, n[`${a}.ankle`] = 85;
6883
6883
  return n;
6884
6884
  }
6885
- function n0(e, t) {
6885
+ function r0(e, t) {
6886
6886
  const o = e.cycleScale ?? 1, n = (s) => ({
6887
6887
  summary: {
6888
6888
  walk: "Walks to `to` (four beats), its head bobbing.",
@@ -6917,7 +6917,7 @@ function n0(e, t) {
6917
6917
  summary: "Sits on its haunches for `for` ms (default 1500): the rump goes down onto folded hind legs, paws flat on the ground, the front legs stay planted; then it gets up.",
6918
6918
  uses: ["for"],
6919
6919
  run(s, i, h) {
6920
- const c = Rs(t), l = h + 450;
6920
+ const c = Ws(t), l = h + 450;
6921
6921
  s.key(l, c, { act: !1, easing: "ease-in-out" }), s.key(l + (i.for ?? 1500), c, { act: !1 });
6922
6922
  const d = l + (i.for ?? 1500) + 450, f = {};
6923
6923
  for (const u of Object.keys(c)) f[u] = 0;
@@ -6928,7 +6928,7 @@ function n0(e, t) {
6928
6928
  summary: "Lies down for `for` ms (default 2000), head up and front paws forward (sinking back onto its haunches first), then gets up.",
6929
6929
  uses: ["for"],
6930
6930
  run(s, i, h) {
6931
- const c = o0(t), l = { ...Rs(t) }, d = h + 400, f = d + 450;
6931
+ const c = s0(t), l = { ...Ws(t) }, d = h + 400, f = d + 450;
6932
6932
  s.key(d, l, { act: !1, easing: "ease-in-out" }), s.key(f, c, { act: !1, easing: "ease-in-out" }), s.key(f + (i.for ?? 2e3), c, { act: !1 });
6933
6933
  const u = f + (i.for ?? 2e3) + 600, p = {};
6934
6934
  for (const g of /* @__PURE__ */ new Set([...Object.keys(c), ...Object.keys(l)])) p[g] = 0;
@@ -6974,7 +6974,7 @@ function n0(e, t) {
6974
6974
  }
6975
6975
  }), r;
6976
6976
  }
6977
- function s0(e = {}) {
6977
+ function a0(e = {}) {
6978
6978
  return Ze({
6979
6979
  kind: e.kind ?? "horse",
6980
6980
  summary: e.summary ?? "A cartoon horse: walks, trots, canters and gallops with its hooves in step with the ground, rears, bucks, neighs, grazes and swishes its tail.",
@@ -7014,7 +7014,7 @@ function s0(e = {}) {
7014
7014
  })
7015
7015
  });
7016
7016
  }
7017
- function r0(e = {}) {
7017
+ function i0(e = {}) {
7018
7018
  return Ze({
7019
7019
  kind: e.kind ?? "dog",
7020
7020
  summary: e.summary ?? "A cartoon dog: walks, trots and runs, barks, wags its tail, sits, jumps, sniffs the ground.",
@@ -7056,7 +7056,7 @@ function r0(e = {}) {
7056
7056
  })
7057
7057
  });
7058
7058
  }
7059
- function a0(e = {}) {
7059
+ function l0(e = {}) {
7060
7060
  return Ze({
7061
7061
  kind: e.kind ?? "cat",
7062
7062
  summary: e.summary ?? "A cartoon cat: walks, trots and runs, meows, arches its back, pounces, sits and swishes its tail.",
@@ -7101,7 +7101,7 @@ function a0(e = {}) {
7101
7101
  })
7102
7102
  });
7103
7103
  }
7104
- function i0(e = {}) {
7104
+ function h0(e = {}) {
7105
7105
  return Ze({
7106
7106
  kind: e.kind ?? "cow",
7107
7107
  summary: e.summary ?? "A cartoon cow: walks and trots, moos, grazes, sits and swishes its tail.",
@@ -7128,10 +7128,10 @@ function i0(e = {}) {
7128
7128
  grazes: !0
7129
7129
  });
7130
7130
  }
7131
- function lf(e) {
7131
+ function cf(e) {
7132
7132
  return An(1, e);
7133
7133
  }
7134
- function l0(e = {}) {
7134
+ function c0(e = {}) {
7135
7135
  return Ze({
7136
7136
  kind: e.kind ?? "goat",
7137
7137
  summary: e.summary ?? "A goat: walks, trots and gallops, bleats, grazes, sits, lies, jumps, and swishes its stubby tail.",
@@ -7157,7 +7157,7 @@ function l0(e = {}) {
7157
7157
  grazes: !0
7158
7158
  });
7159
7159
  }
7160
- function h0(e = {}) {
7160
+ function d0(e = {}) {
7161
7161
  return Ze({
7162
7162
  kind: e.kind ?? "rabbit",
7163
7163
  summary: e.summary ?? "A rabbit: walks and hops (gallop), squeaks, nibbles the ground (graze), sits, lies and jumps; long ears and a puff of a tail.",
@@ -7178,7 +7178,7 @@ function h0(e = {}) {
7178
7178
  grazes: !0
7179
7179
  });
7180
7180
  }
7181
- function c0(e = {}) {
7181
+ function f0(e = {}) {
7182
7182
  return Ze({
7183
7183
  kind: e.kind ?? "squirrel",
7184
7184
  summary: e.summary ?? "A squirrel: scampers (gallop) and walks, chatters, sits up, nibbles (graze), with a bushy tail curled over its back.",
@@ -7198,7 +7198,7 @@ function c0(e = {}) {
7198
7198
  grazes: !0
7199
7199
  });
7200
7200
  }
7201
- const Ne = 0.6, Vr = 75, Wo = 80;
7201
+ const Ne = 0.6, Vr = 75, Ro = 80;
7202
7202
  function Qe(e) {
7203
7203
  const { colors: t } = e, [o, n, a] = e.body.radii, r = (e.tail.raised ?? 15) * Math.PI / 180, s = e.tail.length * 0.4, i = [
7204
7204
  { id: "body", shape: { type: "ellipsoid", radii: e.body.radii, segments: 16 }, at: [0, e.body.height, 0], fill: t.body },
@@ -7243,7 +7243,7 @@ function Qe(e) {
7243
7243
  shape: { type: "ellipsoid", radii: [e.wing.span * Ne / 2, e.wing.chord * 0.1, e.wing.chord / 2], segments: 12 },
7244
7244
  at: [l * e.wing.span * Ne / 2, 0, -e.wing.chord * 0.1],
7245
7245
  // Folded, the blade is rolled about its length so it lies flat against the body's side.
7246
- rotate: [-Wo, 0, 0],
7246
+ rotate: [-Ro, 0, 0],
7247
7247
  fill: t.wing,
7248
7248
  outline: 0.8
7249
7249
  }), i.push({
@@ -7265,8 +7265,8 @@ function Qe(e) {
7265
7265
  bind: [
7266
7266
  { parts: ["wing-left"], rotate: { axis: "y", degrees: -90 } },
7267
7267
  { parts: ["wing-right"], rotate: { axis: "y", degrees: 90 } },
7268
- { parts: ["wing-left-blade"], translate: [e.wing.span * (1 - Ne) / 2, 0, 0], rotate: { axis: "x", degrees: Wo }, scale: [1 / Ne, 1, 1] },
7269
- { parts: ["wing-right-blade"], translate: [-e.wing.span * (1 - Ne) / 2, 0, 0], rotate: { axis: "x", degrees: Wo }, scale: [1 / Ne, 1, 1] }
7268
+ { parts: ["wing-left-blade"], translate: [e.wing.span * (1 - Ne) / 2, 0, 0], rotate: { axis: "x", degrees: Ro }, scale: [1 / Ne, 1, 1] },
7269
+ { parts: ["wing-right-blade"], translate: [-e.wing.span * (1 - Ne) / 2, 0, 0], rotate: { axis: "x", degrees: Ro }, scale: [1 / Ne, 1, 1] }
7270
7270
  ]
7271
7271
  },
7272
7272
  flap: {
@@ -7318,24 +7318,24 @@ function Qe(e) {
7318
7318
  family: "bird",
7319
7319
  summary: e.summary,
7320
7320
  rig: c,
7321
- actions: u0(e),
7322
- acting: f0,
7321
+ actions: p0(e),
7322
+ acting: g0,
7323
7323
  colors: { body: t.body, ink: "#26262b" },
7324
- moves: d0(e)
7324
+ moves: u0(e)
7325
7325
  };
7326
7326
  }
7327
- function d0(e) {
7327
+ function u0(e) {
7328
7328
  const t = e.legs.length * 1.2, o = { walk: { speed: t / 0.42, hold: { stepping: 1 }, perMetre: { step: 0.5 / t } } };
7329
7329
  return e.flies !== !1 && (o.fly = { speed: 4 + e.wing.span * 12, flies: !0, hold: { flapping: 1, spread: 1 }, perSecond: { wingbeat: e.beatsPerSecond ?? 4 } }), o;
7330
7330
  }
7331
- const f0 = {
7331
+ const g0 = {
7332
7332
  depth: { turn: 0, lift: 0, pitch: 1, roll: 1, squash: 1, spread: 1, flap: 2, peck: 2 },
7333
7333
  limits: { pitch: 6, roll: 6, squash: 0.06, peck: 8, flap: 10, lift: 0 },
7334
7334
  eyes: [],
7335
7335
  headTurns: {},
7336
7336
  drift: []
7337
7337
  };
7338
- function u0(e) {
7338
+ function p0(e) {
7339
7339
  const t = (e.beatsPerSecond ?? 4) / 1e3, o = (s, i, h) => {
7340
7340
  const c = s.values.wingbeat ?? 0;
7341
7341
  s.set("wingbeat", i, c), s.set("wingbeat", h, c + (h - i) * t);
@@ -7431,7 +7431,7 @@ function u0(e) {
7431
7431
  }
7432
7432
  }, r;
7433
7433
  }
7434
- function g0(e = {}) {
7434
+ function m0(e = {}) {
7435
7435
  return Qe({
7436
7436
  kind: "songbird",
7437
7437
  summary: "A small songbird: hops, pecks, tweets, flaps, flies and lands (on the ground, a branch or a roof).",
@@ -7446,7 +7446,7 @@ function g0(e = {}) {
7446
7446
  beatsPerSecond: 9
7447
7447
  });
7448
7448
  }
7449
- function p0(e = {}) {
7449
+ function y0(e = {}) {
7450
7450
  return Qe({
7451
7451
  kind: "crow",
7452
7452
  summary: "A crow: walks and hops, pecks, caws, flaps, flies and lands (on the ground, a branch or a roof).",
@@ -7461,7 +7461,7 @@ function p0(e = {}) {
7461
7461
  beatsPerSecond: 4
7462
7462
  });
7463
7463
  }
7464
- function m0(e = {}) {
7464
+ function b0(e = {}) {
7465
7465
  return Qe({
7466
7466
  kind: "chicken",
7467
7467
  summary: "A chicken: walks with a bobbing head, pecks, clucks, and flutters up and down (it cannot really fly).",
@@ -7479,7 +7479,7 @@ function m0(e = {}) {
7479
7479
  flies: !1
7480
7480
  });
7481
7481
  }
7482
- function y0(e = {}) {
7482
+ function w0(e = {}) {
7483
7483
  return Qe({
7484
7484
  kind: "pigeon",
7485
7485
  summary: "A pigeon: walks with a bobbing head, pecks at crumbs, coos, flaps, flies and lands (on the ground, a ledge or a branch).",
@@ -7495,7 +7495,7 @@ function y0(e = {}) {
7495
7495
  stoop: 16
7496
7496
  });
7497
7497
  }
7498
- function b0(e = {}) {
7498
+ function k0(e = {}) {
7499
7499
  return Qe({
7500
7500
  kind: "duck",
7501
7501
  summary: "A duck: waddles, dabbles with its bill (peck), quacks, flaps, flies and lands (on the ground or the water’s edge).",
@@ -7512,7 +7512,7 @@ function b0(e = {}) {
7512
7512
  neckReach: 0.04
7513
7513
  });
7514
7514
  }
7515
- function w0(e = {}) {
7515
+ function v0(e = {}) {
7516
7516
  return Qe({
7517
7517
  kind: "owl",
7518
7518
  summary: "An owl: a big round head, slow silent wingbeats; hoots, turns its head, flies and lands on a branch.",
@@ -7528,7 +7528,7 @@ function w0(e = {}) {
7528
7528
  stoop: 6
7529
7529
  });
7530
7530
  }
7531
- function k0(e = {}) {
7531
+ function S0(e = {}) {
7532
7532
  return Qe({
7533
7533
  kind: "parrot",
7534
7534
  summary: "A parrot: bright, with a big hooked beak and a long tail; squawks, bobs, flies and lands on a perch, gripping it.",
@@ -7544,13 +7544,13 @@ function k0(e = {}) {
7544
7544
  stoop: 10
7545
7545
  });
7546
7546
  }
7547
- const Ht = { car: vc, truck: Sc, bus: Mc, tractor: $c, cart: Ec, trainCar: Ac, bike: Tc, motorbike: Pc, tree: Oc, house: xc, chair: Kc, desk: Wc, bed: zc, door: Fc, wheelchair: Bc, helicopter: Uc, airplane: Vc, horse: s0, dog: r0, cat: a0, cow: i0, goat: l0, rabbit: h0, squirrel: c0, songbird: g0, crow: p0, chicken: m0, pigeon: y0, duck: b0, owl: w0, parrot: k0 };
7547
+ const Ht = { car: Mc, truck: $c, bus: Ec, tractor: Ac, cart: Tc, trainCar: Pc, bike: Oc, motorbike: Hc, tree: Ic, house: _c, chair: Cc, desk: zc, bed: Fc, door: qc, wheelchair: Yc, helicopter: Vc, airplane: Zc, horse: a0, dog: i0, cat: l0, cow: h0, goat: c0, rabbit: d0, squirrel: f0, songbird: m0, crow: y0, chicken: b0, pigeon: w0, duck: k0, owl: v0, parrot: S0 };
7548
7548
  function Jr(e, t = {}) {
7549
7549
  const o = Ht[e];
7550
7550
  if (!o) throw new Error(fe("prop preset", e, Object.keys(Ht)));
7551
7551
  return o(t);
7552
7552
  }
7553
- const en = ["do", "at", "for", "to", "toward", "speed", "open", "on", "height", "wind"], tn = { viewer: 0, right: 1, away: 2, left: 3 }, v0 = 420, Zr = {
7553
+ const en = ["do", "at", "for", "to", "toward", "speed", "open", "on", "height", "wind"], tn = { viewer: 0, right: 1, away: 2, left: 3 }, M0 = 420, Zr = {
7554
7554
  hold: {
7555
7555
  summary: "Holds still (`for` ms, default 1000).",
7556
7556
  run: (e, t, o) => ({ end: o + (t.for ?? 1e3) })
@@ -7580,8 +7580,8 @@ const en = ["do", "at", "for", "to", "toward", "speed", "open", "on", "height",
7580
7580
  function Tn(e) {
7581
7581
  return { ...Zr, ...e.actions };
7582
7582
  }
7583
- const Ro = (e) => typeof e == "number" && Number.isFinite(e);
7584
- function S0(e, t) {
7583
+ const Wo = (e) => typeof e == "number" && Number.isFinite(e);
7584
+ function $0(e, t) {
7585
7585
  if (!Array.isArray(e)) return [{ level: "error", beat: -1, message: `Beats must be an array of { do: … } objects (got ${typeof e}).` }];
7586
7586
  const o = Tn(t), n = Object.keys(o), a = [];
7587
7587
  return e.forEach((r, s) => {
@@ -7593,8 +7593,8 @@ function S0(e, t) {
7593
7593
  if (typeof h.do != "string" || !n.includes(h.do)) return i(fe(`${t.kind} action`, h.do, n));
7594
7594
  for (const c of o[h.do].needs ?? []) h[c] === void 0 && i(`\`${h.do}\` needs \`${c}\`.`);
7595
7595
  for (const c of ["at", "for", "speed", "height", "wind"])
7596
- h[c] !== void 0 && !(Ro(h[c]) && h[c] >= 0) && i(`\`${c}\` must be a number ≥ 0 (got ${JSON.stringify(h[c])}).`);
7597
- if (h.to !== void 0 && !Ro(h.to) && i(`\`to\` is a scene x in px (got ${JSON.stringify(h.to)}).`), h.toward !== void 0 && !Ro(h.toward) && !(typeof h.toward == "string" && h.toward in tn)) {
7596
+ h[c] !== void 0 && !(Wo(h[c]) && h[c] >= 0) && i(`\`${c}\` must be a number ≥ 0 (got ${JSON.stringify(h[c])}).`);
7597
+ if (h.to !== void 0 && !Wo(h.to) && i(`\`to\` is a scene x in px (got ${JSON.stringify(h.to)}).`), h.toward !== void 0 && !Wo(h.toward) && !(typeof h.toward == "string" && h.toward in tn)) {
7598
7598
  const c = typeof h.toward == "string" ? Fo(h.toward, Object.keys(tn)) : void 0;
7599
7599
  i(`\`toward\` is viewer, right, away, left or a quarter-turn number${c ? ` (did you mean "${c}"?)` : ""} (got ${JSON.stringify(h.toward)}).`);
7600
7600
  }
@@ -7602,8 +7602,8 @@ function S0(e, t) {
7602
7602
  h[c] !== void 0 && typeof h[c] != "boolean" && i(`\`${c}\` is true or false (got ${JSON.stringify(h[c])}).`);
7603
7603
  }), a;
7604
7604
  }
7605
- function M0(e, t, o, n = {}) {
7606
- const a = S0(o, t).filter((v) => v.level === "error");
7605
+ function E0(e, t, o, n = {}) {
7606
+ const a = $0(o, t).filter((v) => v.level === "error");
7607
7607
  if (a.length > 0) throw new Error(`propScript (${t.kind}): ${a.length} problem(s) in the beats:
7608
7608
  ${a.map((v) => ` beat ${v.beat}: ${v.message}`).join(`
7609
7609
  `)}`);
@@ -7644,8 +7644,8 @@ ${a.map((v) => ` beat ${v.beat}: ${v.message}`).join(`
7644
7644
  turnTo(v, w) {
7645
7645
  const E = typeof w == "number" ? w : tn[w], O = l.turn, x = [E - 4, E, E + 4].map((G) => ({ t: G, d: Math.abs(G - O) })).sort((G, Y) => G.d - Y.d || Math.abs(G.t) - Math.abs(Y.t))[0];
7646
7646
  if (x.d < 1e-3) return v;
7647
- const R = v + v0 * Math.max(1, x.d);
7648
- return H.key(R, { turn: x.t }), R;
7647
+ const W = v + M0 * Math.max(1, x.d);
7648
+ return H.key(W, { turn: x.t }), W;
7649
7649
  },
7650
7650
  effect(v) {
7651
7651
  u.push(v);
@@ -7661,12 +7661,12 @@ ${a.map((v) => ` beat ${v.beat}: ${v.message}`).join(`
7661
7661
  const w = Math.max(v.at ?? m, d[d.length - 1].time), E = c[v.do].run(H, v, w);
7662
7662
  E.end > d[d.length - 1].time && d.push({ time: E.end, pose: { ...l } }), M.push({ start: w, end: E.end, ...E.contact !== void 0 ? { contact: E.contact } : {}, ...E.release !== void 0 ? { release: E.release } : {} }), m = E.end;
7663
7663
  }
7664
- const P = Hr(n.style ?? "snappy"), A = { ...P, anticipation: P.anticipation * h, overshoot: P.overshoot * h }, k = kn(T0(d), t.acting, { style: A }), y = [
7664
+ const P = Hr(n.style ?? "snappy"), A = { ...P, anticipation: P.anticipation * h, overshoot: P.overshoot * h }, k = kn(O0(d), t.acting, { style: A }), y = [
7665
7665
  // Controls keyed exactly (wheels, rotors) are not acted.
7666
7666
  ...Object.entries(k).filter(([v]) => !f.has(v)).map(([v, w]) => ({ id: `${e}-${v}`, target: e, property: v, keyframes: w })),
7667
- ...[...f].map(([v, w]) => ({ id: `${e}-${v}`, target: e, property: v, keyframes: P0(w) }))
7667
+ ...[...f].map(([v, w]) => ({ id: `${e}-${v}`, target: e, property: v, keyframes: H0(w) }))
7668
7668
  ];
7669
- for (const v of E0(e, t, y, m, d[0].pose)) {
7669
+ for (const v of T0(e, t, y, m, d[0].pose)) {
7670
7670
  const w = y.findIndex((j) => j.property === v.property);
7671
7671
  if (w < 0) {
7672
7672
  y.push(v);
@@ -7677,37 +7677,37 @@ ${a.map((v) => ` beat ${v.beat}: ${v.message}`).join(`
7677
7677
  }
7678
7678
  return { tracks: y, duration: m, beats: M, effects: u };
7679
7679
  }
7680
- const $0 = 1500;
7681
- function E0(e, t, o, n, a) {
7680
+ const A0 = 1500;
7681
+ function T0(e, t, o, n, a) {
7682
7682
  if (!t.follow?.length) return [];
7683
7683
  const r = new ve({ id: `${e}-follow`, tracks: o.filter((i) => i.property === "turn" || t.follow.some((h) => h.of === i.property)) }), s = (i, h) => {
7684
7684
  const c = r.getStateAtTime(i).values.get(e)?.get(h);
7685
7685
  return typeof c == "number" ? c : a[h] ?? 0;
7686
7686
  };
7687
7687
  return t.follow.map((i) => {
7688
- const h = n + $0, c = Bt((f) => s(f, i.of), { start: 0, end: h, stiffness: i.stiffness, damping: i.damping }), l = i.limit ?? 1 / 0, d = c.map(({ time: f, value: u }) => {
7688
+ const h = n + A0, c = Bt((f) => s(f, i.of), { start: 0, end: h, stiffness: i.stiffness, damping: i.damping }), l = i.limit ?? 1 / 0, d = c.map(({ time: f, value: u }) => {
7689
7689
  const p = Math.sin(s(f, "turn") * Math.PI / 2), g = (u - s(f, i.of)) * p;
7690
7690
  return { time: f, value: Math.max(-l, Math.min(l, g * i.per)) };
7691
7691
  });
7692
7692
  return { id: `${e}-${i.control}`, target: e, property: i.control, keyframes: d };
7693
7693
  });
7694
7694
  }
7695
- const A0 = 20;
7696
- function T0(e) {
7695
+ const P0 = 20;
7696
+ function O0(e) {
7697
7697
  const t = [...e].sort((n, a) => n.time - a.time), o = [];
7698
7698
  for (const n of t) {
7699
7699
  const a = o[o.length - 1];
7700
- a && n.time - a.time < A0 ? o[o.length - 1] = { ...n, time: a.time } : o.push(n);
7700
+ a && n.time - a.time < P0 ? o[o.length - 1] = { ...n, time: a.time } : o.push(n);
7701
7701
  }
7702
7702
  return o;
7703
7703
  }
7704
- function P0(e) {
7704
+ function H0(e) {
7705
7705
  const t = e.map((n, a) => ({ k: n, i: a })).sort((n, a) => n.k.time - a.k.time || n.i - a.i), o = [];
7706
7706
  for (const { k: n } of t)
7707
7707
  o.length > 0 && o[o.length - 1].time === n.time ? o[o.length - 1] = n : o.push(n);
7708
7708
  return o;
7709
7709
  }
7710
- const O0 = {
7710
+ const I0 = {
7711
7711
  linear: !0,
7712
7712
  "ease-in": !0,
7713
7713
  "ease-out": !0,
@@ -7719,18 +7719,18 @@ const O0 = {
7719
7719
  "ease-out-cubic": !0,
7720
7720
  "ease-in-out-cubic": !0
7721
7721
  };
7722
- function H0(e, t = {}) {
7722
+ function x0(e, t = {}) {
7723
7723
  const o = {};
7724
7724
  for (const n of Object.keys(Ke)) o[n] = { summary: `Walks to \`to\` in the ${n} gait.`, needs: ["to"] };
7725
7725
  for (const n of Object.keys(Ae)) o[n] = { summary: `Moves into the ${n} pose and holds it (\`for\` ms).` };
7726
7726
  for (const n of Object.keys(Ve)) o[n] = { summary: `The ${n} gag (${so(n)} ms).` };
7727
7727
  for (const [n, a] of Object.entries(go)) o[n] = { ...a };
7728
7728
  return {
7729
- sports: { cricket: { actions: { ...Aa }, formats: { ...Ea }, casts: { ...$a }, fieldingPositions: { ...Ma }, markingProfiles: { ...Sa }, cameras: { ...va } } },
7729
+ sports: { cricket: { actions: { ...Pa }, formats: { ...Ta }, casts: { ...Aa }, fieldingPositions: { ...Ea }, markingProfiles: { ...$a }, cameras: { ...Ma }, playComponents: Sa, playExamples: va } },
7730
7730
  ...e ? { version: e } : {},
7731
7731
  timing: "JSON timelines and tracks are in milliseconds; the GSAP-style API (live.to, tf.timeline) takes seconds. Scene x grows right, y grows down, in px.",
7732
7732
  easings: {
7733
- named: Object.keys(O0),
7733
+ named: Object.keys(I0),
7734
7734
  parametric: {
7735
7735
  "cubic-bezier": '{ type: "cubic-bezier", points: [x1, y1, x2, y2] }',
7736
7736
  steps: '{ type: "steps", count, position?: start | end | none | both }',
@@ -7746,7 +7746,7 @@ function H0(e, t = {}) {
7746
7746
  motionPath: '{ property: "motionPath", path, align? }: moves along an SVG path',
7747
7747
  text: '{ property: "text", … }: types or scrambles text'
7748
7748
  },
7749
- canvasProperties: Na,
7749
+ canvasProperties: Ra,
7750
7750
  stickFigure: {
7751
7751
  poseFields: ka,
7752
7752
  props: wa,
@@ -7827,19 +7827,19 @@ function H0(e, t = {}) {
7827
7827
  },
7828
7828
  poses: Object.keys(_e),
7829
7829
  dances: Object.keys(ft),
7830
- expressions: Object.keys(ja),
7830
+ expressions: Object.keys(Ka),
7831
7831
  faceStyles: ["simple", "anime"],
7832
7832
  faceShapes: ["round", "angular"],
7833
7833
  gags: Object.keys(Xs),
7834
- builds: Object.keys(xa),
7835
- hair: Object.keys(Ia),
7834
+ builds: Object.keys(_a),
7835
+ hair: Object.keys(ja),
7836
7836
  hairColors: { ...xe },
7837
- facialHair: Object.keys(Ha),
7838
- glasses: Object.keys(Oa),
7839
- hats: Object.keys(Pa),
7837
+ facialHair: Object.keys(xa),
7838
+ glasses: Object.keys(Ia),
7839
+ hats: Object.keys(Ha),
7840
7840
  feet: [...ya],
7841
7841
  cast: Object.keys(Or),
7842
- heldItems: Object.fromEntries(Object.entries(Ta).map(([n, a]) => [n, a.hands])),
7842
+ heldItems: Object.fromEntries(Object.entries(Oa).map(([n, a]) => [n, a.hands])),
7843
7843
  handMeetings: Object.keys(no)
7844
7844
  },
7845
7845
  codePanel: {
@@ -7884,8 +7884,8 @@ function H0(e, t = {}) {
7884
7884
  }
7885
7885
  const ue = (e) => e.map((t) => `\`${t}\``).join(", "), zs = (e) => Object.entries(e).map(([t, o]) => `| \`${t}\` | ${o.unit ?? o.kind ?? ""} | ${o.description} |`).join(`
7886
7886
  `);
7887
- function hf(e, t = {}) {
7888
- const o = H0(e, t), n = o.stickFigure;
7887
+ function df(e, t = {}) {
7888
+ const o = x0(e, t), n = o.stickFigure;
7889
7889
  return [
7890
7890
  `# tinyfly capabilities${o.version ? ` (v${o.version})` : ""}`,
7891
7891
  "",
@@ -8045,6 +8045,11 @@ function hf(e, t = {}) {
8045
8045
  "",
8046
8046
  `Marking profiles: ${ue(Object.keys(o.sports.cricket.markingProfiles))}; default ICC men, independently of cast. Limited-over ICC profiles draw a wicket-centred capsule; Test/MCC have no restriction-area line. \`cricketFieldingAreaContains(field, point)\` returns true/false/null; \`cricketFieldingPositions\` and \`cricketFieldingOverlay\` provide owned setup markers, not umpiring decisions.`,
8047
8047
  "",
8048
+ "`cricketPlay(field, options)` / `cricketPlayClip(options)` independently author delivery style/legality, shot, finish, fielding, current free-hit context and candidate dismissal. Omitted dismissal means no dismissal. Unsupported motion combinations throw; no-ball/free-hit protection changes result/signals without removing physical catches or wicket breaks. Run-out remains available. Illegal free hits carry forward; legal ones consume context. Test rejects free-hit context. Keep innings/score/strike in the consuming app.",
8049
+ "",
8050
+ ...Object.entries(o.sports.cricket.playComponents).map(([r, s]) => `Play ${r}: ${ue(s)}`),
8051
+ ...Object.entries(o.sports.cricket.playExamples).map(([r, s]) => `- Composed example \`${r}\`: ${s.name}`),
8052
+ "",
8048
8053
  ...Object.entries(o.sports.cricket.actions).map(([r, s]) => `- \`${r}\`: ${s.summary}`),
8049
8054
  "",
8050
8055
  `Formats: ${ue(Object.keys(o.sports.cricket.formats))}. Casts: ${ue(Object.keys(o.sports.cricket.casts))}. Cameras: ${ue(Object.keys(o.sports.cricket.cameras))}. Orbit turns 360° around the whole ground. \`cricketCameraTracks(clip, { view, zoom })\` supports 0.25–4× optical magnification (default 1) in every view.`,
@@ -8066,16 +8071,16 @@ function hf(e, t = {}) {
8066
8071
  ].join(`
8067
8072
  `);
8068
8073
  }
8069
- function cf(e, t, o, n = {}) {
8074
+ function ff(e, t, o, n = {}) {
8070
8075
  const a = n.color ?? "#555", r = n.size ?? 60;
8071
8076
  for (const s of t) {
8072
8077
  const i = (o - s.time) / s.length;
8073
8078
  if (i <= 0 || i >= 1) continue;
8074
8079
  const h = Fe(`${s.kind}:${s.time}:${s.x}`);
8075
- s.kind === "dust" ? nh(e, { x: s.x, y: s.y }, i, { size: r, color: a, seed: h }) : s.kind === "exhaust" ? j0(e, s, i, r, a, h) : s.kind === "skid" ? _0(e, s, i, o, a) : s.kind === "honk" ? K0(e, s, i, r, a) : s.kind === "smoke" ? I0(e, s, o, r, a) : s.kind === "leaves" && x0(e, s, i, r, n.leafColor ?? "#5cae5a", a, h);
8080
+ s.kind === "dust" ? rh(e, { x: s.x, y: s.y }, i, { size: r, color: a, seed: h }) : s.kind === "exhaust" ? K0(e, s, i, r, a, h) : s.kind === "skid" ? N0(e, s, i, o, a) : s.kind === "honk" ? C0(e, s, i, r, a) : s.kind === "smoke" ? j0(e, s, o, r, a) : s.kind === "leaves" && _0(e, s, i, r, n.leafColor ?? "#5cae5a", a, h);
8076
8081
  }
8077
8082
  }
8078
- function I0(e, t, o, n, a, r) {
8083
+ function j0(e, t, o, n, a, r) {
8079
8084
  const s = t.direction ?? 1, i = 380, h = 1500;
8080
8085
  e.save(), e.strokeStyle = a, e.lineWidth = Math.max(1, n * 0.025);
8081
8086
  for (let c = t.time; c <= t.time + t.length - h; c += i) {
@@ -8086,7 +8091,7 @@ function I0(e, t, o, n, a, r) {
8086
8091
  }
8087
8092
  e.restore();
8088
8093
  }
8089
- function x0(e, t, o, n, a, r, s) {
8094
+ function _0(e, t, o, n, a, r, s) {
8090
8095
  const i = t.direction ?? 1, h = t.toY ?? t.y + n * 3;
8091
8096
  e.save(), e.lineWidth = Math.max(1, n * 0.02), e.strokeStyle = r, e.fillStyle = a;
8092
8097
  for (let c = 0; c < 4; c++) {
@@ -8095,7 +8100,7 @@ function x0(e, t, o, n, a, r, s) {
8095
8100
  }
8096
8101
  e.restore();
8097
8102
  }
8098
- function j0(e, t, o, n, a, r) {
8103
+ function K0(e, t, o, n, a, r) {
8099
8104
  const s = t.direction ?? -1;
8100
8105
  e.save(), e.strokeStyle = a, e.lineWidth = Math.max(1, n * 0.025);
8101
8106
  for (let i = 0; i < 3; i++) {
@@ -8106,14 +8111,14 @@ function j0(e, t, o, n, a, r) {
8106
8111
  }
8107
8112
  e.restore();
8108
8113
  }
8109
- function _0(e, t, o, n, a) {
8114
+ function N0(e, t, o, n, a) {
8110
8115
  const r = t.toX ?? t.x, s = Math.min(1, (n - t.time) / t.length * 3), i = t.x + (r - t.x) * s;
8111
8116
  e.save(), e.strokeStyle = a, e.lineCap = "round", e.globalAlpha = o < 0.6 ? 0.8 : 0.8 * (1 - (o - 0.6) / 0.4), e.lineWidth = 3;
8112
8117
  for (const h of [-2, 4])
8113
8118
  e.beginPath(), e.moveTo(t.x, t.y + h), e.lineTo(i, t.y + h), e.stroke();
8114
8119
  e.restore();
8115
8120
  }
8116
- function K0(e, t, o, n, a) {
8121
+ function C0(e, t, o, n, a) {
8117
8122
  const r = t.direction ?? 1;
8118
8123
  e.save(), e.strokeStyle = a, e.lineWidth = Math.max(1.5, n * 0.04), e.lineCap = "round", e.globalAlpha = o < 0.7 ? 1 : (1 - o) / 0.3;
8119
8124
  const s = n * (0.15 + 0.5 * (1 - (1 - o) ** 2));
@@ -8123,7 +8128,7 @@ function K0(e, t, o, n, a) {
8123
8128
  }
8124
8129
  e.restore();
8125
8130
  }
8126
- function df(e) {
8131
+ function uf(e) {
8127
8132
  const t = new ve({ id: `${e.propId}-ride`, tracks: e.propTracks.filter((l) => l.target === e.propId) }), o = e.every ?? 33, n = [], a = [], r = [], s = [];
8128
8133
  let i = 1;
8129
8134
  for (let l = e.start; ; l = Math.min(e.end, l + o)) {
@@ -8136,9 +8141,9 @@ function df(e) {
8136
8141
  { id: `${h}-x`, target: h, property: "x", keyframes: n },
8137
8142
  { id: `${h}-y`, target: h, property: "y", keyframes: a }
8138
8143
  ];
8139
- return e.turn !== !1 && c.push({ id: `${h}-turn`, target: h, property: "turn", keyframes: r }, { id: `${h}-facing`, target: h, property: "facing", keyframes: N0(s) }), c;
8144
+ return e.turn !== !1 && c.push({ id: `${h}-turn`, target: h, property: "turn", keyframes: r }, { id: `${h}-facing`, target: h, property: "facing", keyframes: R0(s) }), c;
8140
8145
  }
8141
- function N0(e) {
8146
+ function R0(e) {
8142
8147
  const t = [];
8143
8148
  for (const o of e) {
8144
8149
  const n = t[t.length - 1];
@@ -8146,7 +8151,7 @@ function N0(e) {
8146
8151
  }
8147
8152
  return t;
8148
8153
  }
8149
- function ff(e, t, o) {
8154
+ function gf(e, t, o) {
8150
8155
  const n = (s) => `${s.target}\0${s.property}`, a = new Map(t.map((s) => [n(s), s]));
8151
8156
  return [...e.map((s) => {
8152
8157
  const i = a.get(n(s));
@@ -8156,7 +8161,7 @@ function ff(e, t, o) {
8156
8161
  return { ...s, keyframes: c };
8157
8162
  }), ...a.values()];
8158
8163
  }
8159
- function uf(e) {
8164
+ function pf(e) {
8160
8165
  const t = new ve({ id: `${e.leaderId}-tow`, tracks: e.leaderTracks.filter((u) => u.target === e.leaderId) }), o = e.every ?? 33, n = e.towed, a = n.x + n.width / 2, r = n.props, s = n.prop.wheelRadius, i = [], h = [], c = [];
8161
8166
  let l = r.wheelSpin ?? 0, d;
8162
8167
  for (let u = e.start; ; u = Math.min(e.end, u + o)) {
@@ -8177,7 +8182,7 @@ function uf(e) {
8177
8182
  ];
8178
8183
  }
8179
8184
  const Ls = /* @__PURE__ */ new WeakMap();
8180
- function C0(e, t) {
8185
+ function W0(e, t) {
8181
8186
  const o = t?.some(Boolean) ? t.map((f) => f ? 1 : 0).join("") : "";
8182
8187
  let n = Ls.get(e);
8183
8188
  n || Ls.set(e, n = /* @__PURE__ */ new Map());
@@ -8198,8 +8203,8 @@ function C0(e, t) {
8198
8203
  }), d = Vt({ positions: i, normals: l, indices: c });
8199
8204
  return n.size >= 16 && n.clear(), n.set(o, d), d;
8200
8205
  }
8201
- function W0(e, t, o = {}) {
8202
- const n = e.ink ?? o.ink ?? "#26262b", a = (o.outline ?? 2) * (e.outline ?? 1), r = e.glow && t.glow > 0 ? R0(e.glow.color, t.glow) : void 0;
8206
+ function z0(e, t, o = {}) {
8207
+ const n = e.ink ?? o.ink ?? "#26262b", a = (o.outline ?? 2) * (e.outline ?? 1), r = e.glow && t.glow > 0 ? L0(e.glow.color, t.glow) : void 0;
8203
8208
  return {
8204
8209
  // A part with no fill (a spoked wheel's wire) is drawn in its ink.
8205
8210
  color: e.fill ?? n,
@@ -8211,20 +8216,20 @@ function W0(e, t, o = {}) {
8211
8216
  ...e.seeThrough ? { opacity: 0.45 * t.opacity } : t.opacity < 1 ? { opacity: t.opacity } : {}
8212
8217
  };
8213
8218
  }
8214
- function R0(e, t) {
8219
+ function L0(e, t) {
8215
8220
  const o = /^#([0-9a-f]{6})$/i.exec(e.trim());
8216
8221
  return o ? `#${[0, 2, 4].map((a) => Math.round(parseInt(o[1].slice(a, a + 2), 16) * Math.max(0, Math.min(1, t)))).map((a) => a.toString(16).padStart(2, "0")).join("")}` : e;
8217
8222
  }
8218
- const z0 = Vt(er(1, 2e-3, 28));
8219
- function L0(e, t, o) {
8223
+ const F0 = Vt(er(1, 2e-3, 28));
8224
+ function D0(e, t, o) {
8220
8225
  const n = e.rig, [a, r] = n.footprint ?? [n.length * 0.45, n.length], s = Math.max(0, be(n, t, "lift")), i = Math.max(0, be(n, t, "size")) / (1 + s * 0.8);
8221
8226
  return {
8222
- mesh: z0,
8227
+ mesh: F0,
8223
8228
  world: ne.multiply(o, ne.compose([0, 4e-3, 0], [0, 0, 0, 1], [a * 0.55 * i || 1e-4, 1, r * 0.55 * i || 1e-4])),
8224
8229
  material: { color: "#000000", shading: "unlit", opacity: 0.16 * i }
8225
8230
  };
8226
8231
  }
8227
- const F0 = /* @__PURE__ */ new Set([
8232
+ const q0 = /* @__PURE__ */ new Set([
8228
8233
  "x",
8229
8234
  "y",
8230
8235
  "z",
@@ -8240,7 +8245,7 @@ const F0 = /* @__PURE__ */ new Set([
8240
8245
  "visible",
8241
8246
  "opacity",
8242
8247
  "color"
8243
- ]), D0 = 1, gf = {
8248
+ ]), B0 = 1, mf = {
8244
8249
  kind: "prop",
8245
8250
  validate(e) {
8246
8251
  const t = e, o = typeof t.prop == "string" && t.prop in Ht ? [] : [fe("prop preset", t.prop, Object.keys(Ht))];
@@ -8256,7 +8261,7 @@ const F0 = /* @__PURE__ */ new Set([
8256
8261
  resolve({ object: e, prepared: t, values: o, world: n, camera: a, lights: r = [], fog: s, toScreen: i }) {
8257
8262
  const h = e, c = t, l = { ...h.values };
8258
8263
  for (const [k, y] of o)
8259
- typeof y == "number" && !F0.has(k) && (l[k] = y);
8264
+ typeof y == "number" && !q0.has(k) && (l[k] = y);
8260
8265
  l.turn = 0, l.tilt = 0;
8261
8266
  const d = ne.multiply(a.view, n), f = {
8262
8267
  toView: (k) => ne.transformPoint(d, k),
@@ -8264,37 +8269,37 @@ const F0 = /* @__PURE__ */ new Set([
8264
8269
  }, u = f.toView([0, c.rig.height / 2, 0]);
8265
8270
  if (-u[2] <= a.near) return null;
8266
8271
  if (h.look === "mesh") {
8267
- const k = cc(c.rig, l), y = k.map(({ part: E, local: O }) => ({ part: E.id, mesh: ao(E.shape), ...Mn(ao(E.shape), O) })), v = zr(y), w = k.map((E, O) => ({ ...E, hidden: Lr(E.part.id, y[O].mesh, E.local, y[O].key, v) })).filter(({ opacity: E }) => E > 0.01).map(({ part: E, matrix: O, glow: j, opacity: x, hidden: R }) => ({
8268
- mesh: C0(E.shape, R),
8272
+ const k = fc(c.rig, l), y = k.map(({ part: E, local: O }) => ({ part: E.id, mesh: ao(E.shape), ...Mn(ao(E.shape), O) })), v = zr(y), w = k.map((E, O) => ({ ...E, hidden: Lr(E.part.id, y[O].mesh, E.local, y[O].key, v) })).filter(({ opacity: E }) => E > 0.01).map(({ part: E, matrix: O, glow: j, opacity: x, hidden: W }) => ({
8273
+ mesh: W0(E.shape, W),
8269
8274
  world: ne.multiply(n, O),
8270
- material: W0(E, { glow: j, opacity: x }, { shading: h.shading, ink: h.ink, outline: h.outline })
8275
+ material: z0(E, { glow: j, opacity: x }, { shading: h.shading, ink: h.ink, outline: h.outline })
8271
8276
  }));
8272
- return { meshes: h.shadow === !1 ? w : [L0(c, l, n), ...w] };
8277
+ return { meshes: h.shadow === !1 ? w : [D0(c, l, n), ...w] };
8273
8278
  }
8274
8279
  const p = i(u), g = i(f.toView([0, c.rig.height / 2 + 1, 0])), b = Math.hypot(g.x - p.x, g.y - p.y), T = r.length === 0 ? void 0 : (k, y) => {
8275
8280
  const v = ne.transformPoint(n, k), w = [n[0] * y[0] + n[4] * y[1] + n[8] * y[2], n[1] * y[0] + n[5] * y[1] + n[9] * y[2], n[2] * y[0] + n[6] * y[1] + n[10] * y[2]], E = Math.hypot(...w) || 1;
8276
8281
  return { light: tr(v, [w[0] / E, w[1] / E, w[2] / E], r), fog: or(s, Math.hypot(v[0] - a.position[0], v[1] - a.position[1], v[2] - a.position[2])) };
8277
- }, H = Fr(c.rig, l, f, b, { perspective: !0, near: a.near, slice: D0, light: T }), M = { look: h.look, style: h.style, ink: h.ink, paper: h.paper, fog: s?.color }, m = dr(H), P = H.cells ?? [], A = Math.max(...P.map((k) => -k.depth), -u[2]);
8282
+ }, H = Fr(c.rig, l, f, b, { perspective: !0, near: a.near, slice: B0, light: T }), M = { look: h.look, style: h.style, ink: h.ink, paper: h.paper, fog: s?.color }, m = dr(H), P = H.cells ?? [], A = Math.max(...P.map((k) => -k.depth), -u[2]);
8278
8283
  return {
8279
8284
  drawables: [
8280
8285
  ...h.shadow === !1 ? [] : [{ depth: A + c.rig.length, draw: (k) => fr(k, H, M) }],
8281
8286
  ...P.map((k) => ({
8282
8287
  depth: -k.depth,
8283
8288
  draw(y, v) {
8284
- y.lineCap = "round", y.lineJoin = "round", Mi(y, k.parts, m, { ...M, time: v.time });
8289
+ y.lineCap = "round", y.lineJoin = "round", Ei(y, k.parts, m, { ...M, time: v.time });
8285
8290
  }
8286
8291
  }))
8287
8292
  ]
8288
8293
  };
8289
8294
  }
8290
- }, Fs = ["do", "at", "for", "to", "through", "toward", "speed", "height", "open", "on", "wind"], q0 = 0.25, B0 = 800 / 180, G0 = 220, Y0 = 300, U0 = ["turn"];
8291
- function X0(e) {
8295
+ }, Fs = ["do", "at", "for", "to", "through", "toward", "speed", "height", "open", "on", "wind"], G0 = 0.25, Y0 = 800 / 180, U0 = 220, X0 = 300, V0 = ["turn"];
8296
+ function J0(e) {
8292
8297
  const t = Tn(e), o = Object.keys(e.moves ?? {});
8293
- return Object.keys(t).filter((n) => !o.includes(n) && !U0.includes(n) && !(t[n].needs ?? []).includes("to"));
8298
+ return Object.keys(t).filter((n) => !o.includes(n) && !V0.includes(n) && !(t[n].needs ?? []).includes("to"));
8294
8299
  }
8295
- function V0(e, t) {
8300
+ function Z0(e, t) {
8296
8301
  if (!Array.isArray(e)) return [{ beat: -1, message: `Beats must be an array of { do: … } objects (got ${typeof e}).` }];
8297
- const o = Object.keys(t.moves ?? {}), n = X0(t), a = [...o, "face", "hold", ...n.filter((s) => s !== "hold")], r = [];
8302
+ const o = Object.keys(t.moves ?? {}), n = J0(t), a = [...o, "face", "hold", ...n.filter((s) => s !== "hold")], r = [];
8298
8303
  return e.forEach((s, i) => {
8299
8304
  const h = (d) => r.push({ beat: i, message: d });
8300
8305
  if (!s || typeof s != "object" || Array.isArray(s)) return h(`Each beat must be an object like { do: '${a[0] ?? "hold"}' }.`);
@@ -8307,8 +8312,8 @@ function V0(e, t) {
8307
8312
  o.includes(c.do) && (c.to === void 0 && c.through === void 0 && h(`\`${c.do}\` needs \`to\` ([x, z] metres) or \`through\` (a list of them).`), c.to !== void 0 && !Ge(c.to) && h(`\`to\` is a point on the ground, [x, z] metres (got ${JSON.stringify(c.to)}).`), c.through !== void 0 && !(Array.isArray(c.through) && c.through.length > 0 && c.through.every(Ge)) && h("`through` is a list of points on the ground, each [x, z] metres.")), c.do === "face" && !(Ge(c.toward) || typeof c.toward == "number") && h("`face` needs `toward`: a point [x, z] or a heading in degrees.");
8308
8313
  }), r;
8309
8314
  }
8310
- function pf(e, t, o, n) {
8311
- const a = V0(o, t);
8315
+ function yf(e, t, o, n) {
8316
+ const a = Z0(o, t);
8312
8317
  if (a.length > 0) throw new Error(`propScript3D (${t.kind}): ${a.length} problem(s) in the beats:
8313
8318
  ${a.map((M) => ` beat ${M.beat}: ${M.message}`).join(`
8314
8319
  `)}`);
@@ -8323,12 +8328,12 @@ ${a.map((M) => ` beat ${M.beat}: ${M.message}`).join(`
8323
8328
  const f = (M, m) => {
8324
8329
  const P = to(h, m);
8325
8330
  if (Math.abs(P) < 1) return M;
8326
- const A = Math.max(G0, Math.abs(P) * B0);
8331
+ const A = Math.max(U0, Math.abs(P) * Y0);
8327
8332
  return d("rotateY", M, h), h += P, l("rotateY", M + A, h, "ease-in-out"), M + A;
8328
8333
  }, u = (M, m, P) => {
8329
8334
  const A = wr([[s, i], ...m.through ?? [m.to]]);
8330
8335
  if (A.length < 2) return P;
8331
- const k = f(P, lt(A[0].point, A[1].point)), y = A[A.length - 1].at, v = m.for ?? y / (m.speed ?? M.speed) * 1e3, w = mt("ease-in-out"), E = Math.min(Y0, v / 4);
8336
+ const k = f(P, lt(A[0].point, A[1].point)), y = A[A.length - 1].at, v = m.for ?? y / (m.speed ?? M.speed) * 1e3, w = mt("ease-in-out"), E = Math.min(X0, v / 4);
8332
8337
  for (const [Y, oe] of Object.entries(M.set ?? {}))
8333
8338
  d(Y, k, r[Y]), l(Y, k + 1, oe), r[Y] = oe;
8334
8339
  const O = M.flies ? m.height ?? (r.lift > 0.05 ? r.lift : 2) : void 0, j = O !== void 0 && O > 0.05;
@@ -8336,21 +8341,21 @@ ${a.map((M) => ` beat ${M.beat}: ${M.message}`).join(`
8336
8341
  d(Y, k, r[Y]), l(Y, k + E, oe, "ease-out"), j || (l(Y, k + v - E, oe), l(Y, k + v, 0, "ease-in")), r[Y] = j ? oe : 0;
8337
8342
  O !== void 0 && (d("lift", k, r.lift), l("lift", k + Math.min(v * 0.35, 1400), O, "ease-out"), l("lift", k + v, O), r.lift = O);
8338
8343
  const x = { ...r };
8339
- let R = h;
8340
- for (let Y = 0; ; Y = Math.min(y, Y + q0)) {
8344
+ let W = h;
8345
+ for (let Y = 0; ; Y = Math.min(y, Y + G0)) {
8341
8346
  const oe = k + vr(w, Y / y) * v, { point: q, direction: I } = kr(A, Y);
8342
- R += to(R, lt([0, 0], I)), l("x", oe, q[0]), l("z", oe, q[1]), l("rotateY", oe, R);
8347
+ W += to(W, lt([0, 0], I)), l("x", oe, q[0]), l("z", oe, q[1]), l("rotateY", oe, W);
8343
8348
  for (const [N, C] of Object.entries(M.perMetre ?? {})) l(N, oe, x[N] + Y * C);
8344
8349
  for (const [N, C] of Object.entries(M.perSecond ?? {})) l(N, oe, x[N] + (oe - k) / 1e3 * C);
8345
8350
  if (Y >= y) break;
8346
8351
  }
8347
8352
  for (const [Y, oe] of Object.entries(M.perMetre ?? {})) r[Y] = x[Y] + y * oe;
8348
8353
  for (const [Y, oe] of Object.entries(M.perSecond ?? {})) r[Y] = x[Y] + v / 1e3 * oe;
8349
- return [s, i] = A[A.length - 1].point, h = R, k + v;
8354
+ return [s, i] = A[A.length - 1].point, h = W, k + v;
8350
8355
  }, p = (M, m) => {
8351
- const P = Object.fromEntries(Object.entries(M).filter(([k]) => !["at", "to", "through", "toward"].includes(k))), A = M0(e, t, [P], { start: { ...r, turn: 1 }, scale: 100, style: n.style, exaggeration: n.exaggeration });
8356
+ const P = Object.fromEntries(Object.entries(M).filter(([k]) => !["at", "to", "through", "toward"].includes(k))), A = E0(e, t, [P], { start: { ...r, turn: 1 }, scale: 100, style: n.style, exaggeration: n.exaggeration });
8352
8357
  for (const k of A.tracks) {
8353
- if (J0.includes(k.property)) continue;
8358
+ if (Q0.includes(k.property)) continue;
8354
8359
  const y = k.keyframes ?? [], v = r[k.property];
8355
8360
  if (!y.every((w) => w.value === v)) {
8356
8361
  d(k.property, m, v);
@@ -8375,16 +8380,16 @@ ${a.map((M) => ` beat ${M.beat}: ${M.message}`).join(`
8375
8380
  keyframes: br(m)
8376
8381
  })), duration: b, beats: g, end: { position: [s, i], heading: h, values: { ...r } } };
8377
8382
  }
8378
- const J0 = ["x", "y", "turn", "facing", "tilt"], Z0 = 0.35, Qr = {
8383
+ const Q0 = ["x", "y", "turn", "facing", "tilt"], ed = 0.35, Qr = {
8379
8384
  seated: _e.sit,
8380
8385
  astride: { ..._e.sit, "leg.left.spread": 26, "leg.right.spread": 26, "leg.left.swing": 40, "leg.right.swing": 40, "leg.left.knee": 70, "leg.right.knee": 70 },
8381
8386
  driving: { ..._e.sit, "arm.left.swing": 52, "arm.right.swing": 52, "arm.left.spread": 8, "arm.right.spread": 8, "arm.left.elbow": 38, "arm.right.elbow": 38, lean: 4 },
8382
8387
  wheeling: { ..._e.sit, "arm.left.swing": -6, "arm.right.swing": -6, "arm.left.spread": 16, "arm.right.spread": 16, "arm.left.elbow": 28, "arm.right.elbow": 28, "leg.left.knee": 80, "leg.right.knee": 80 },
8383
8388
  cycling: { ..._e.sit, lean: 22, bend: 10, "head.nod": -14, "arm.left.swing": 58, "arm.right.swing": 58, "arm.left.spread": 10, "arm.right.spread": 10, "arm.left.elbow": 22, "arm.right.elbow": 22, "leg.left.spread": 6, "leg.right.spread": 6 }
8384
- }, Q0 = 22, Ds = 38;
8389
+ }, td = 22, Ds = 38;
8385
8390
  function qs(e, t = Qr.cycling) {
8386
8391
  const o = e * Math.PI * 2, n = (s) => ({
8387
- swing: (t["leg.left.swing"] ?? 40) + Q0 * Math.cos(o + s),
8392
+ swing: (t["leg.left.swing"] ?? 40) + td * Math.cos(o + s),
8388
8393
  // The knee straightens as the foot pushes down and over the bottom of the stroke.
8389
8394
  knee: (t["leg.left.knee"] ?? 70) + Ds * (0.5 + 0.5 * Math.cos(o + s)) - Ds * 0.5,
8390
8395
  ankle: 12 * Math.sin(o + s)
@@ -8399,7 +8404,7 @@ function qs(e, t = Qr.cycling) {
8399
8404
  "leg.right.ankle": r.ankle
8400
8405
  };
8401
8406
  }
8402
- function mf(e) {
8407
+ function bf(e) {
8403
8408
  const t = e.cadence ?? 1.2, o = Math.max(2, e.samplesPerTurn ?? 8), n = 1e3 / t / o, a = [];
8404
8409
  for (let r = e.start, s = 0; r < e.end; r += n, s++)
8405
8410
  a.push({ time: Math.round(r), pose: qs((r - e.start) / 1e3 * t, e.base), ...s > 0 ? { act: !1 } : {} });
@@ -8409,29 +8414,29 @@ const Bs = (e, t) => {
8409
8414
  const o = t * Math.PI / 180;
8410
8415
  return [e[0] * Math.cos(o) + e[2] * Math.sin(o), e[1], -e[0] * Math.sin(o) + e[2] * Math.cos(o)];
8411
8416
  };
8412
- function yf(e) {
8417
+ function wf(e) {
8413
8418
  const t = `${e.scene}/${e.propId}`, o = new ve({ id: `${e.propId}-ride-3d`, tracks: e.propTracks.filter((b) => b.target === t) }), n = e.placement ?? {}, [a, r, s] = n.position ?? [0, 0, 0], i = e.prop.rig, h = sn({ ...e.character, height: 1 }), c = { ...ye, ...e.pose ?? Qr.seated }, l = nn(h.plan, c, { height: e.height ?? 1.7, contact: h.contact }).hip, d = e.facing ?? 0, f = e.every ?? 33, u = { x: [], y: [], z: [], rotateY: [] };
8414
8419
  for (let b = e.start; ; b = Math.min(e.end, b + f)) {
8415
- const T = o.getStateAtTime(b).values.get(t) ?? /* @__PURE__ */ new Map(), H = (x, R) => {
8420
+ const T = o.getStateAtTime(b).values.get(t) ?? /* @__PURE__ */ new Map(), H = (x, W) => {
8416
8421
  const G = T.get(x);
8417
- return typeof G == "number" ? G : R;
8422
+ return typeof G == "number" ? G : W;
8418
8423
  }, M = { ...n.values };
8419
8424
  for (const x of Object.keys(i.controls)) M[x] = H(x, n.values?.[x] ?? be(i, {}, x));
8420
8425
  for (const x of ["pitch", "roll", "squash", "lift", "lean", "size"]) M[x] = H(x, n.values?.[x] ?? be(i, {}, x));
8421
- const m = dc(i, M)[e.anchor];
8426
+ const m = uc(i, M)[e.anchor];
8422
8427
  if (!m) throw new Error(`propRide3D: ${e.prop.kind} has no anchor "${e.anchor}" (it has ${Object.keys(i.anchors ?? {}).join(", ") || "none"})`);
8423
8428
  const P = H("rotateY", n.heading ?? 0), A = Bs(m, P), k = [H("x", a) + A[0], H("y", r) + A[1], H("z", s) + A[2]], y = P + d, v = Bs(l, y);
8424
8429
  let w = [k[0] - v[0], k[1] - v[1], k[2] - v[2]];
8425
- const E = (x, R) => {
8426
- const G = R * R * (3 - 2 * R);
8427
- return [x[0] + (w[0] - x[0]) * G, w[1] * G + Z0 * Math.sin(Math.PI * R), x[1] + (w[2] - x[1]) * G];
8430
+ const E = (x, W) => {
8431
+ const G = W * W * (3 - 2 * W);
8432
+ return [x[0] + (w[0] - x[0]) * G, w[1] * G + ed * Math.sin(Math.PI * W), x[1] + (w[2] - x[1]) * G];
8428
8433
  }, O = e.mount ? Math.max(1, e.mount.for ?? 450) : 0, j = e.dismount ? Math.max(1, e.dismount.for ?? 450) : 0;
8429
8434
  if (e.mount && b < e.start + O ? w = E(e.mount.from, (b - e.start) / O) : e.dismount && b > e.end - j && (w = E(e.dismount.to, (e.end - b) / j)), u.x.push({ time: b, value: w[0] }), u.y.push({ time: b, value: w[1] }), u.z.push({ time: b, value: w[2] }), u.rotateY.push({ time: b, value: y }), b >= e.end) break;
8430
8435
  }
8431
8436
  const p = e.riderId, g = `${e.scene}/${p}`;
8432
8437
  return Object.keys(u).map((b) => ({ id: `${p}-${b}`, target: g, property: b, keyframes: u[b] }));
8433
8438
  }
8434
- const ed = {
8439
+ const od = {
8435
8440
  ground: "#7fb56a",
8436
8441
  hills: "#5f9a58",
8437
8442
  city: "#4b5468",
@@ -8457,11 +8462,11 @@ const ed = {
8457
8462
  ], Tt = (e, t, o) => {
8458
8463
  const n = (s) => [1, 3, 5].map((i) => parseInt(s.slice(i, i + 2), 16)), [a, r] = [n(e), n(t)];
8459
8464
  return `#${a.map((s, i) => Math.round(s + (r[i] - s) * o).toString(16).padStart(2, "0")).join("")}`;
8460
- }, td = (e) => {
8465
+ }, nd = (e) => {
8461
8466
  const t = (e % 24 + 24) % 24;
8462
8467
  return t < 5 || t > 20 ? 0 : t < 7 ? (t - 5) / 2 : t > 18 ? (20 - t) / 2 : 1;
8463
8468
  };
8464
- function od(e) {
8469
+ function sd(e) {
8465
8470
  const t = (e % 24 + 24) % 24;
8466
8471
  for (let o = 1; o < St.length; o++) {
8467
8472
  const [n, a, r] = St[o - 1], [s, i, h] = St[o];
@@ -8472,31 +8477,31 @@ function od(e) {
8472
8477
  }
8473
8478
  return { top: St[0][1], bottom: St[0][2] };
8474
8479
  }
8475
- const nd = (e, t) => {
8480
+ const rd = (e, t) => {
8476
8481
  const o = ((e - t) % 24 + 24) % 24;
8477
8482
  return o <= 12 ? o / 12 : -1;
8478
- }, sd = 9, rd = 55, ad = 28;
8479
- function id(e) {
8480
- const { x: t, y: o, width: n, height: a } = e, r = e.kind ?? "sky", s = e.ground ?? o + a * 0.85, i = { ...ed, ...e.colors }, h = e.horizon ?? "hills", c = e.window !== !1, l = rn(e.seed ?? 1), d = n * a / 1e5, f = Array.from({ length: Math.ceil(sd * d) + 2 }, () => ({ u: l.next(), v: l.next(), size: 0.6 + l.next() * 0.8, puffs: 2 + Math.floor(l.next() * 3) })), u = Array.from({ length: Math.ceil(rd * d) + 4 }, () => ({ u: l.next(), v: l.next(), speed: 0.8 + l.next() * 0.5 })), p = Array.from({ length: Math.ceil(ad * d) + 4 }, () => ({ u: l.next(), v: l.next(), speed: 0.7 + l.next() * 0.6, sway: l.next() * Math.PI * 2, size: 1.5 + l.next() * 2 })), g = Array.from({ length: Math.ceil(30 * d) + 10 }, () => ({ u: l.next(), v: l.next() * 0.6, size: 0.6 + l.next() * 1.2 })), b = Array.from({ length: 6 }, () => ({ phase: l.next() * Math.PI * 2, amp: 0.5 + l.next() })), T = Array.from({ length: 24 }, () => ({ h: 0.35 + l.next() * 0.65, w: 0.6 + l.next() * 0.8, windows: l.next() > 0.3 })), H = {
8483
+ }, ad = 9, id = 55, ld = 28;
8484
+ function hd(e) {
8485
+ const { x: t, y: o, width: n, height: a } = e, r = e.kind ?? "sky", s = e.ground ?? o + a * 0.85, i = { ...od, ...e.colors }, h = e.horizon ?? "hills", c = e.window !== !1, l = rn(e.seed ?? 1), d = n * a / 1e5, f = Array.from({ length: Math.ceil(ad * d) + 2 }, () => ({ u: l.next(), v: l.next(), size: 0.6 + l.next() * 0.8, puffs: 2 + Math.floor(l.next() * 3) })), u = Array.from({ length: Math.ceil(id * d) + 4 }, () => ({ u: l.next(), v: l.next(), speed: 0.8 + l.next() * 0.5 })), p = Array.from({ length: Math.ceil(ld * d) + 4 }, () => ({ u: l.next(), v: l.next(), speed: 0.7 + l.next() * 0.6, sway: l.next() * Math.PI * 2, size: 1.5 + l.next() * 2 })), g = Array.from({ length: Math.ceil(30 * d) + 10 }, () => ({ u: l.next(), v: l.next() * 0.6, size: 0.6 + l.next() * 1.2 })), b = Array.from({ length: 6 }, () => ({ phase: l.next() * Math.PI * 2, amp: 0.5 + l.next() })), T = Array.from({ length: 24 }, () => ({ h: 0.35 + l.next() * 0.65, w: 0.6 + l.next() * 0.8, windows: l.next() > 0.3 })), H = {
8481
8486
  hour: e.hour ?? 12,
8482
8487
  clouds: e.clouds ?? 0.3,
8483
8488
  wind: e.wind ?? 0,
8484
8489
  rain: e.rain ?? 0,
8485
8490
  snow: e.snow ?? 0
8486
8491
  }, M = It(), m = (w, E) => M.keys(w)?.length ? M.valueAt(w, E) : H[w], P = (w, E) => {
8487
- const O = nd(w, E), j = O < 0 ? 0.5 : O, x = s - o;
8492
+ const O = rd(w, E), j = O < 0 ? 0.5 : O, x = s - o;
8488
8493
  return { x: 0.1 * n + 0.8 * n * j, y: O < 0 ? x + a * 0.2 : x - Math.sin(j * Math.PI) * x * 0.8, up: O >= 0 };
8489
8494
  }, A = (w, E, O, j, x) => {
8490
- const R = E("hour"), { top: G, bottom: Y } = od(R), oe = w.createLinearGradient(0, j.y, 0, j.ground);
8495
+ const W = E("hour"), { top: G, bottom: Y } = sd(W), oe = w.createLinearGradient(0, j.y, 0, j.ground);
8491
8496
  oe.addColorStop(0, G), oe.addColorStop(1, Y), w.fillStyle = oe, w.fillRect(j.x, j.y, j.w, j.ground - j.y);
8492
- const q = td(R);
8497
+ const q = nd(W);
8493
8498
  if (q < 0.6) {
8494
8499
  w.fillStyle = "#ffffff", w.globalAlpha = (0.6 - q) / 0.6 * 0.9;
8495
8500
  for (const L of g)
8496
8501
  w.beginPath(), w.arc(j.x + L.u * j.w, j.y + L.v * (j.ground - j.y), L.size, 0, Math.PI * 2), w.fill();
8497
8502
  w.globalAlpha = 1;
8498
8503
  }
8499
- const I = P(R, 6), N = P(R, 18), C = Math.min(j.w, j.h) * 0.06;
8504
+ const I = P(W, 6), N = P(W, 18), C = Math.min(j.w, j.h) * 0.06;
8500
8505
  if (I.up && (w.fillStyle = i.sun, w.beginPath(), w.arc(j.x + I.x / n * j.w, j.y + I.y / a * j.h, C, 0, Math.PI * 2), w.fill()), N.up) {
8501
8506
  const L = j.x + N.x / n * j.w, Q = j.y + N.y / a * j.h;
8502
8507
  w.fillStyle = i.moon, w.beginPath(), w.arc(L, Q, C * 0.8, 0, Math.PI * 2), w.fill(), w.fillStyle = G, w.beginPath(), w.arc(L - C * 0.35, Q - C * 0.15, C * 0.7, 0, Math.PI * 2), w.fill();
@@ -8536,10 +8541,10 @@ function id(e) {
8536
8541
  }
8537
8542
  w.fillStyle = ee(i.ground), w.fillRect(j.x, j.ground, j.w, j.y + j.h - j.ground);
8538
8543
  }, k = (w, E, O, j) => {
8539
- const x = Math.max(-1, Math.min(1, E("wind"))), R = Math.max(0, Math.min(1, E("rain"))), G = Math.max(0, Math.min(1, E("snow")));
8540
- if (R > 0) {
8541
- w.strokeStyle = i.rain, w.globalAlpha = 0.35 + 0.45 * R, w.lineWidth = 1.2, w.lineCap = "round";
8542
- const Y = j.h * 0.05, oe = x * 0.45, q = Math.round(R * u.length);
8544
+ const x = Math.max(-1, Math.min(1, E("wind"))), W = Math.max(0, Math.min(1, E("rain"))), G = Math.max(0, Math.min(1, E("snow")));
8545
+ if (W > 0) {
8546
+ w.strokeStyle = i.rain, w.globalAlpha = 0.35 + 0.45 * W, w.lineWidth = 1.2, w.lineCap = "round";
8547
+ const Y = j.h * 0.05, oe = x * 0.45, q = Math.round(W * u.length);
8543
8548
  w.beginPath();
8544
8549
  for (let I = 0; I < q; I++) {
8545
8550
  const N = u[I], C = ((N.v * j.h + O * N.speed * 0.9) % j.h + j.h) % j.h, S = ((N.u * j.w + C * oe) % j.w + j.w) % j.w;
@@ -8568,16 +8573,16 @@ function id(e) {
8568
8573
  about: {
8569
8574
  kind: r === "room" ? "room" : "sky",
8570
8575
  summary: r === "room" ? "A room: a wall, a floor and a window on the sky. Its values are tracks: hour, clouds, wind, rain, snow (seen through the window)." : `A sky over ${h === "flat" ? "the ground" : h}: the sun and moon on their arcs, stars, clouds on the wind, rain and snow. Its values are tracks: hour (0–24), clouds, wind (−1..1), rain, snow (0..1).`,
8571
- props: Object.fromEntries(Object.keys(H).map((w) => [w, ld(w)]))
8576
+ props: Object.fromEntries(Object.keys(H).map((w) => [w, cd(w)]))
8572
8577
  },
8573
8578
  draw(w, E, O) {
8574
8579
  const j = E.props ?? {}, x = (G) => Number(j[G] ?? H[G] ?? 0);
8575
8580
  w.save();
8576
- const R = { x: 0, y: 0, w: n, h: a, ground: s - o };
8581
+ const W = { x: 0, y: 0, w: n, h: a, ground: s - o };
8577
8582
  if (r === "sky")
8578
- A(w, x, O, R), k(w, x, O, R);
8579
- else if (w.fillStyle = i.wall, w.fillRect(0, 0, n, R.ground), w.fillStyle = i.floor, w.fillRect(0, R.ground, n, a - R.ground), w.fillStyle = i.skirting, w.fillRect(0, R.ground - a * 0.012, n, a * 0.012), c) {
8580
- const G = n * 0.26, Y = R.ground * 0.5, oe = n * 0.62, q = R.ground * 0.14;
8583
+ A(w, x, O, W), k(w, x, O, W);
8584
+ else if (w.fillStyle = i.wall, w.fillRect(0, 0, n, W.ground), w.fillStyle = i.floor, w.fillRect(0, W.ground, n, a - W.ground), w.fillStyle = i.skirting, w.fillRect(0, W.ground - a * 0.012, n, a * 0.012), c) {
8585
+ const G = n * 0.26, Y = W.ground * 0.5, oe = n * 0.62, q = W.ground * 0.14;
8581
8586
  w.fillStyle = i.frame, w.fillRect(oe - 6, q - 6, G + 12, Y + 12), w.save(), w.beginPath(), w.rect(oe, q, G, Y), w.clip(), A(w, x, O, { x: oe, y: q, w: G, h: Y, ground: q + Y * 0.8 }), k(w, x, O, { x: oe, y: q, w: G, h: Y }), w.restore(), w.strokeStyle = i.frame, w.lineWidth = 4, w.beginPath(), w.moveTo(oe + G / 2, q), w.lineTo(oe + G / 2, q + Y), w.moveTo(oe, q + Y / 2), w.lineTo(oe + G, q + Y / 2), w.stroke();
8582
8587
  }
8583
8588
  w.restore();
@@ -8603,7 +8608,7 @@ function id(e) {
8603
8608
  };
8604
8609
  return v;
8605
8610
  }
8606
- function ld(e) {
8611
+ function cd(e) {
8607
8612
  switch (e) {
8608
8613
  case "hour":
8609
8614
  return { description: "The time of day, 0–24: the sky’s colours, the sun and the moon on their arcs, stars at night", unit: "hours", min: 0, max: 24 };
@@ -8617,7 +8622,7 @@ function ld(e) {
8617
8622
  return { description: "How hard it snows", unit: "0..1", min: 0, max: 1 };
8618
8623
  }
8619
8624
  }
8620
- function hd(e, t) {
8625
+ function dd(e, t) {
8621
8626
  const { width: o, height: n } = t, a = t.ground ?? n * 0.85, r = t.scale ?? n / 4.5, s = { x: 0, y: 0, width: o, height: n, ground: a }, i = (h, c, l = {}) => ({ preset: h, x: o * c, scale: r, ...l });
8622
8627
  switch (e) {
8623
8628
  case "park":
@@ -8644,70 +8649,70 @@ function hd(e, t) {
8644
8649
  throw new Error(fe("scene preset", e, ["park", "street", "office", "home"]));
8645
8650
  }
8646
8651
  }
8647
- function bf(e, t) {
8648
- const o = hd(e, t), n = id(o.scenery), a = o.props.map((r) => pc({ x: r.x, y: n.ground, prop: Jr(r.preset), scale: r.scale, values: { turn: r.turn ?? 0, ...r.values } }));
8652
+ function kf(e, t) {
8653
+ const o = dd(e, t), n = hd(o.scenery), a = o.props.map((r) => yc({ x: r.x, y: n.ground, prop: Jr(r.preset), scale: r.scale, values: { turn: r.turn ?? 0, ...r.values } }));
8649
8654
  return { scenery: n, props: a, ground: n.ground };
8650
8655
  }
8651
8656
  export {
8652
8657
  ht as ACTING_STYLES,
8653
8658
  Yr as AIRCRAFT_ACTING,
8654
8659
  _t as ANIMAL_GAITS,
8655
- Ol as ANIME_CAST,
8660
+ Il as ANIME_CAST,
8656
8661
  Jo as BEAT_FIELDS,
8657
8662
  At as BEAT_MOMENTS,
8658
- Lc as BED_ACTING,
8659
- f0 as BIRD_ACTING,
8663
+ Dc as BED_ACTING,
8664
+ g0 as BIRD_ACTING,
8660
8665
  Jn as BOARD_MARKS,
8661
- Wt as BOARD_THEMES,
8662
- Na as CANVAS_PROPERTIES,
8663
- Nc as CHAIR_ACTING,
8666
+ Rt as BOARD_THEMES,
8667
+ Ra as CANVAS_PROPERTIES,
8668
+ Rc as CHAIR_ACTING,
8664
8669
  Bn as CHARACTER_BEAT_3D_FIELDS,
8665
8670
  Or as CHARACTER_CAST,
8666
- Yi as CHARACTER_GAIT_SPEEDS,
8671
+ Xi as CHARACTER_GAIT_SPEEDS,
8667
8672
  ns as CHART_KINDS,
8668
8673
  st as CHART_SURFACE,
8669
- Rt as CHART_THEMES,
8674
+ Wt as CHART_THEMES,
8670
8675
  Uo as CODE_LANGUAGES,
8671
8676
  Pr as CODE_PANEL_EDITS,
8672
8677
  Gt as CODE_SURFACE,
8673
- al as CODE_THEME,
8678
+ ll as CODE_THEME,
8674
8679
  Je as DANCE_STYLES,
8675
- Rc as DESK_ACTING,
8676
- Dc as DOOR_ACTING,
8680
+ Lc as DESK_ACTING,
8681
+ Bc as DOOR_ACTING,
8677
8682
  Xo as EMBRACE,
8678
8683
  $e as EXPRESSIONS,
8679
- Ha as FACIAL_HAIR_STYLES,
8680
- vf as FINGERS,
8684
+ xa as FACIAL_HAIR_STYLES,
8685
+ Mf as FINGERS,
8681
8686
  ho as FLIPS,
8682
8687
  ya as FOOT_SHAPES,
8683
8688
  Ve as GAGS,
8684
8689
  Ke as GAITS,
8685
8690
  fs as GAIT_CYCLE_MS,
8686
- Oa as GLASSES_STYLES,
8691
+ Ia as GLASSES_STYLES,
8687
8692
  xe as HAIR_COLORS,
8688
- Sf as HAIR_STILL,
8689
- Ia as HAIR_STYLES,
8693
+ $f as HAIR_STILL,
8694
+ ja as HAIR_STYLES,
8690
8695
  no as HAND_MEETINGS,
8691
8696
  Pe as HAND_REST,
8692
8697
  we as HAND_SHAPES,
8693
- Pa as HAT_STYLES,
8694
- Ta as HELD_ITEMS,
8698
+ Ha as HAT_STYLES,
8699
+ Oa as HELD_ITEMS,
8695
8700
  rt as HELP_UP,
8696
- af as HORSE_ACTING,
8697
- rf as HORSE_GAITS,
8698
- jc as HOUSE_ACTING,
8699
- Jl as HUMAN_ACTING_RIG,
8700
- xa as HUMAN_BUILDS,
8701
- Mf as HUMAN_CYCLES,
8701
+ hf as HORSE_ACTING,
8702
+ lf as HORSE_GAITS,
8703
+ Kc as HOUSE_ACTING,
8704
+ Ql as HUMAN_ACTING_RIG,
8705
+ _a as HUMAN_BUILDS,
8706
+ Ef as HUMAN_CYCLES,
8702
8707
  ft as HUMAN_DANCES,
8703
- ja as HUMAN_EXPRESSIONS,
8708
+ Ka as HUMAN_EXPRESSIONS,
8704
8709
  Xs as HUMAN_GAGS,
8705
8710
  _e as HUMAN_POSES,
8706
8711
  ye as HUMAN_REST,
8707
- Hu as IDENTITY_CAMERA,
8708
- Hl as MANGA_CAST,
8712
+ xu as IDENTITY_CAMERA,
8713
+ xl as MANGA_CAST,
8709
8714
  Do as MUDRAS,
8710
- $f as OUTFIT_PRESETS,
8715
+ Af as OUTFIT_PRESETS,
8711
8716
  Ae as POSES,
8712
8717
  Fs as PROP_BEAT_3D_FIELDS,
8713
8718
  en as PROP_BEAT_FIELDS,
@@ -8720,294 +8725,294 @@ export {
8720
8725
  ce as REST_POSE,
8721
8726
  Qr as RIDING_POSES,
8722
8727
  Ye as SAMPLE_STEP,
8723
- ed as SCENERY_COLORS,
8728
+ od as SCENERY_COLORS,
8724
8729
  go as SCRIPT_ACTIONS,
8725
- Ef as SOFT_CARTOON_CAST,
8726
- Ul as STICK_ACTING_RIG,
8727
- Hc as TREE_ACTING,
8728
- wc as VEHICLE_ACTING,
8730
+ Tf as SOFT_CARTOON_CAST,
8731
+ Vl as STICK_ACTING_RIG,
8732
+ xc as TREE_ACTING,
8733
+ vc as VEHICLE_ACTING,
8729
8734
  Be as VISEMES,
8730
- Gc as WHEELCHAIR_ACTING,
8735
+ Uc as WHEELCHAIR_ACTING,
8731
8736
  Ce as WHITEBOARD_SURFACE,
8732
- Ql as actCharacterTracks,
8737
+ th as actCharacterTracks,
8733
8738
  kn as actKeyframes,
8734
- Zl as actTracks,
8739
+ eh as actTracks,
8735
8740
  jr as actionNames,
8736
- Vc as airplane,
8741
+ Zc as airplane,
8737
8742
  Ue as anchorError,
8738
8743
  An as animalStrideLength,
8739
- Iu as animatableProperties,
8740
- xu as applyCamera,
8741
- Da as applyGroove,
8744
+ ju as animatableProperties,
8745
+ _u as applyCamera,
8746
+ Ba as applyGroove,
8742
8747
  cs as assertBeats,
8743
- vd as bakeDanceTracks,
8744
- Af as basicOutfit,
8745
- bd as beatAt,
8746
- zc as bed,
8747
- Tc as bike,
8748
+ Md as bakeDanceTracks,
8749
+ Pf as basicOutfit,
8750
+ kd as beatAt,
8751
+ Fc as bed,
8752
+ Oc as bike,
8748
8753
  Qe as bird,
8749
8754
  on as blendPose,
8750
- Tf as bodyProfileWidth,
8751
- Tu as boilFrame,
8752
- Wi as boxMesh,
8753
- Pf as brushingPose,
8754
- bf as buildScene,
8755
- Mc as bus,
8756
- ju as cameraFromValues,
8757
- _u as cameraPoint,
8758
- H0 as capabilities,
8759
- hf as capabilitiesMarkdown,
8760
- vc as car,
8761
- Ec as cart,
8762
- Ld as castMember,
8763
- a0 as cat,
8764
- Kc as chair,
8755
+ Of as bodyProfileWidth,
8756
+ Ou as boilFrame,
8757
+ zi as boxMesh,
8758
+ Hf as brushingPose,
8759
+ kf as buildScene,
8760
+ Ec as bus,
8761
+ Ku as cameraFromValues,
8762
+ Nu as cameraPoint,
8763
+ x0 as capabilities,
8764
+ df as capabilitiesMarkdown,
8765
+ Mc as car,
8766
+ Tc as cart,
8767
+ Dd as castMember,
8768
+ l0 as cat,
8769
+ Cc as chair,
8765
8770
  Pt as changingWindows,
8766
8771
  sn as character,
8767
- Of as characterAt,
8768
- Hf as characterHandPose,
8772
+ If as characterAt,
8773
+ xf as characterHandPose,
8769
8774
  Oe as characterJoints,
8770
- If as characterJointsInView,
8771
- Hd as characterLookAtTracks,
8772
- Td as characterObjects,
8775
+ jf as characterJointsInView,
8776
+ xd as characterLookAtTracks,
8777
+ Od as characterObjects,
8773
8778
  ia as characterPartsInView,
8774
8779
  da as characterPoseOf,
8775
- xf as characterPoseTracks,
8776
- of as characterScript,
8777
- Od as characterScript3D,
8778
- zh as characterStrideLength,
8779
- jf as characterTarget,
8780
- zd as chart,
8780
+ _f as characterPoseTracks,
8781
+ sf as characterScript,
8782
+ Id as characterScript3D,
8783
+ Fh as characterStrideLength,
8784
+ Kf as characterTarget,
8785
+ Fd as chart,
8781
8786
  ro as checkBeats,
8782
8787
  _r as checkCast,
8783
- Zi as checkCharacterBeats3D,
8784
- S0 as checkPropBeats,
8785
- V0 as checkPropBeats3D,
8786
- Ch as checkSurfaceBeats,
8787
- Ku as checkTracks,
8788
- m0 as chicken,
8789
- jd as circlePath,
8788
+ el as checkCharacterBeats3D,
8789
+ $0 as checkPropBeats,
8790
+ Z0 as checkPropBeats3D,
8791
+ Wh as checkSurfaceBeats,
8792
+ Cu as checkTracks,
8793
+ b0 as chicken,
8794
+ Kd as circlePath,
8790
8795
  Tr as clipErased,
8791
- Wd as codePanel,
8792
- fl as codeTokens,
8796
+ zd as codePanel,
8797
+ gl as codeTokens,
8793
8798
  be as controlValue,
8794
- i0 as cow,
8799
+ h0 as cow,
8795
8800
  ra as createPen,
8796
- p0 as crow,
8797
- Ri as cylinderMesh,
8798
- li as danceCircleAt,
8799
- $d as danceCircleTracks,
8801
+ y0 as crow,
8802
+ Li as cylinderMesh,
8803
+ ci as danceCircleAt,
8804
+ Ad as danceCircleTracks,
8800
8805
  hn as danceFrame,
8801
8806
  ut as danceJoint,
8802
- md as dancePose,
8807
+ bd as dancePose,
8803
8808
  qo as danceStance,
8804
- yd as danceTaps,
8805
- kd as danceTracks,
8809
+ wd as danceTaps,
8810
+ Sd as danceTracks,
8806
8811
  ko as danceTravel,
8807
- Ya as danceTravelTrack,
8808
- wd as dancer,
8809
- Zd as defineAction,
8810
- Qd as defineGait,
8811
- Nu as describeTarget,
8812
- Wc as desk,
8813
- r0 as dog,
8814
- Fc as door,
8812
+ Xa as danceTravelTrack,
8813
+ vd as dancer,
8814
+ ef as defineAction,
8815
+ tf as defineGait,
8816
+ Ru as describeTarget,
8817
+ zc as desk,
8818
+ i0 as dog,
8819
+ qc as door,
8815
8820
  ha as drawCartoonHand,
8816
- _f as drawCharacter,
8817
- Kf as drawCharacterHead,
8818
- Nf as drawCharacterInView,
8819
- nh as drawDustPuff,
8821
+ Nf as drawCharacter,
8822
+ Cf as drawCharacterHead,
8823
+ Rf as drawCharacterInView,
8824
+ rh as drawDustPuff,
8820
8825
  Mr as drawEraser,
8821
8826
  Er as drawHand,
8822
- Cf as drawHeldItem,
8823
- Jd as drawImpactStars,
8824
- Qi as drawPencil,
8825
- nf as drawProp,
8826
- cf as drawPropEffects,
8827
+ Wf as drawHeldItem,
8828
+ Qd as drawImpactStars,
8829
+ tl as drawPencil,
8830
+ rf as drawProp,
8831
+ ff as drawPropEffects,
8827
8832
  fr as drawPropShadow,
8828
- Mi as drawSolvedFaces,
8829
- Ad as drawSolvedPart,
8833
+ Ei as drawSolvedFaces,
8834
+ Pd as drawSolvedPart,
8830
8835
  cr as drawSolvedProp,
8831
- th as drawSpeedLines,
8832
- Wf as drawStickFigure,
8833
- Vd as drawStickSmear,
8834
- _d as drawnPathTarget,
8835
- b0 as duck,
8836
+ nh as drawSpeedLines,
8837
+ zf as drawStickFigure,
8838
+ Zd as drawStickSmear,
8839
+ Nd as drawnPathTarget,
8840
+ k0 as duck,
8836
8841
  uo as editError,
8837
8842
  It as editLog,
8838
- Rf as ellipsePoints,
8839
- zi as ellipsoidMesh,
8840
- Bd as embrace,
8841
- qd as embraceSpacing,
8842
- Cd as erasable,
8843
+ Lf as ellipsePoints,
8844
+ Fi as ellipsoidMesh,
8845
+ Yd as embrace,
8846
+ Gd as embraceSpacing,
8847
+ Wd as erasable,
8843
8848
  vn as expandBeats,
8844
- Fi as extrudeMesh,
8845
- ui as flipPose,
8846
- Ed as flipTracks,
8847
- gi as flipTravel,
8849
+ qi as extrudeMesh,
8850
+ pi as flipPose,
8851
+ Td as flipTracks,
8852
+ mi as flipTravel,
8848
8853
  hs as gag,
8849
8854
  so as gagDuration,
8850
- zf as gaitPose,
8855
+ Ff as gaitPose,
8851
8856
  Lo as gaitStrideLength,
8852
- l0 as goat,
8853
- zl as hairFollow,
8854
- Xd as hairFollowTracks,
8857
+ c0 as goat,
8858
+ Fl as hairFollow,
8859
+ Jd as hairFollowTracks,
8855
8860
  ca as hairHangs,
8856
- Ud as hairMotionAt,
8857
- Lf as hairMotionOf,
8858
- Ff as hairlineAt,
8859
- xd as handAt,
8860
- Df as handGrip,
8861
+ Vd as hairMotionAt,
8862
+ Df as hairMotionOf,
8863
+ qf as hairlineAt,
8864
+ _d as handAt,
8865
+ Bf as handGrip,
8861
8866
  Pn as handJoints,
8862
- qf as handJointsAt,
8867
+ Gf as handJointsAt,
8863
8868
  Nr as handPath,
8864
8869
  bt as handPose,
8865
8870
  ta as handProp,
8866
- Bf as headPoint,
8867
- Uc as helicopter,
8868
- Yd as helpUp,
8869
- Gd as helpUpSpacing,
8870
- Gf as holdingLayers,
8871
- s0 as horse,
8872
- lf as horseStrideLength,
8873
- xc as house,
8874
- Yf as humanCyclePose,
8871
+ Yf as headPoint,
8872
+ Vc as helicopter,
8873
+ Xd as helpUp,
8874
+ Ud as helpUpSpacing,
8875
+ Uf as holdingLayers,
8876
+ a0 as horse,
8877
+ cf as horseStrideLength,
8878
+ _c as house,
8879
+ Xf as humanCyclePose,
8875
8880
  Zt as humanDanceFrame,
8876
- Sd as humanDanceTracks,
8877
- Uf as humanFieldLabel,
8881
+ $d as humanDanceTracks,
8882
+ Vf as humanFieldLabel,
8878
8883
  la as humanGag,
8879
8884
  aa as humanGaitPose,
8880
8885
  Us as humanGaitStrideLength,
8881
8886
  oa as humanPlan,
8882
8887
  Qs as humanPose,
8883
- Xf as isHeld,
8884
- Vf as jointsInScene,
8885
- Jf as jointsToScene,
8886
- Zf as leafOutfit,
8887
- Qf as leafOutfitContours,
8888
+ Jf as isHeld,
8889
+ Zf as jointsInScene,
8890
+ Qf as jointsToScene,
8891
+ eu as leafOutfit,
8892
+ tu as leafOutfitContours,
8888
8893
  mr as lipSyncKeyframes,
8889
8894
  yn as lipSyncOver,
8890
- Pd as lipSyncTracks,
8895
+ Hd as lipSyncTracks,
8891
8896
  gr as lit,
8892
8897
  Sr as lookFields,
8893
8898
  Dr as loosePartsOf,
8894
- o0 as lyingPose,
8895
- Md as meetDandiya,
8896
- Dd as meetHands,
8897
- Fd as meetingSpacing,
8899
+ s0 as lyingPose,
8900
+ Ed as meetDandiya,
8901
+ Bd as meetHands,
8902
+ qd as meetingSpacing,
8898
8903
  pa as mirrorHumanPose,
8899
- La as mirrorPose,
8904
+ Da as mirrorPose,
8900
8905
  pr as mixColors,
8901
8906
  Xt as mixHandPoses,
8902
8907
  Ys as mixPoses,
8903
- Pc as motorbike,
8904
- El as niceCeiling,
8908
+ Hc as motorbike,
8909
+ Tl as niceCeiling,
8905
8910
  Un as objectPositionAt,
8906
- eu as organicBodyContours,
8907
- tu as organicCenterLine,
8908
- ou as outfitPreset,
8909
- w0 as owl,
8910
- Di as panelMesh,
8911
- k0 as parrot,
8911
+ ou as organicBodyContours,
8912
+ nu as organicCenterLine,
8913
+ su as outfitPreset,
8914
+ v0 as owl,
8915
+ Bi as panelMesh,
8916
+ S0 as parrot,
8912
8917
  pt as parseAnchor,
8913
8918
  nr as partialPath,
8914
- Pu as pathLength,
8915
- mf as pedallingKeys,
8919
+ Hu as pathLength,
8920
+ bf as pedallingKeys,
8916
8921
  qs as pedallingPose,
8917
- tf as persona,
8922
+ nf as persona,
8918
8923
  fo as pieceMotion,
8919
- y0 as pigeon,
8920
- ii as plantDanceFoot,
8924
+ w0 as pigeon,
8925
+ hi as plantDanceFoot,
8921
8926
  an as pointAlong,
8922
- nu as pointOnHead,
8927
+ ru as pointOnHead,
8923
8928
  ga as pose,
8924
- su as poseTracks,
8929
+ au as poseTracks,
8925
8930
  Tn as propActions,
8926
- dc as propAnchors3D,
8931
+ uc as propAnchors3D,
8927
8932
  En as propAt,
8928
8933
  qr as propControls,
8929
8934
  dr as propLineWidth,
8930
- gf as propObjects,
8931
- cc as propPartsInSpace,
8935
+ mf as propObjects,
8936
+ fc as propPartsInSpace,
8932
8937
  Jr as propPreset,
8933
- df as propRide,
8934
- yf as propRide3D,
8935
- M0 as propScript,
8936
- pf as propScript3D,
8938
+ uf as propRide,
8939
+ wf as propRide3D,
8940
+ E0 as propScript,
8941
+ yf as propScript3D,
8937
8942
  ao as propShapeMesh,
8938
- sf as propSurface,
8939
- pc as propTarget,
8940
- uf as propTow,
8941
- ic as propView,
8943
+ af as propSurface,
8944
+ yc as propTarget,
8945
+ pf as propTow,
8946
+ hc as propView,
8942
8947
  Ze as quadruped,
8943
- h0 as rabbit,
8948
+ d0 as rabbit,
8944
8949
  Le as reachCharacter,
8945
- Lh as reachOf,
8950
+ Dh as reachOf,
8946
8951
  Hr as resolveActingStyle,
8947
8952
  fa as resolveCharacterPoseKeys,
8948
- ru as resolveFacialHair,
8949
- au as resolveGait,
8950
- iu as resolveGlasses,
8951
- lu as resolveHair,
8952
- hu as resolveHat,
8953
- cu as resolveHeadLook,
8954
- du as resolveHolding,
8955
- fu as resolveOrganicBody,
8953
+ iu as resolveFacialHair,
8954
+ lu as resolveGait,
8955
+ hu as resolveGlasses,
8956
+ cu as resolveHair,
8957
+ du as resolveHat,
8958
+ fu as resolveHeadLook,
8959
+ uu as resolveHolding,
8960
+ gu as resolveOrganicBody,
8956
8961
  Vs as resolvePoseKeys,
8957
- uu as resolveStickFrame,
8958
- gu as resolveStickPose,
8962
+ pu as resolveStickFrame,
8963
+ mu as resolveStickPose,
8959
8964
  wn as rideFloors,
8960
- pu as rotateAbout,
8965
+ yu as rotateAbout,
8961
8966
  cn as routineBeats,
8962
- mu as rubberLimb,
8963
- hd as scenePreset,
8964
- id as scenery,
8967
+ bu as rubberLimb,
8968
+ dd as scenePreset,
8969
+ hd as scenery,
8965
8970
  Kr as scriptActionSummaries,
8966
8971
  Sn as scriptTracks,
8967
- Kd as scrubPath,
8968
- yu as seatHeight,
8972
+ Cd as scrubPath,
8973
+ wu as seatHeight,
8969
8974
  mn as shade,
8970
- Bi as shapeMesh,
8971
- Rs as sittingPose,
8972
- bu as skeletonInView,
8973
- Ka as sketchPen,
8974
- od as skyColors,
8975
+ Yi as shapeMesh,
8976
+ Ws as sittingPose,
8977
+ ku as skeletonInView,
8978
+ Ca as sketchPen,
8979
+ sd as skyColors,
8975
8980
  yr as smoothPath,
8976
- wu as softCartoonCharacter,
8981
+ vu as softCartoonCharacter,
8977
8982
  jt as solveAt,
8978
8983
  na as solvePlanSpace,
8979
8984
  Fr as solveProp,
8980
- g0 as songbird,
8981
- Ci as soundsOf,
8982
- Oh as speechDuration,
8983
- Gi as speechLength,
8984
- ff as spliceTracks,
8985
- c0 as squirrel,
8985
+ m0 as songbird,
8986
+ Wi as soundsOf,
8987
+ Ih as speechDuration,
8988
+ Ui as speechLength,
8989
+ gf as spliceTracks,
8990
+ f0 as squirrel,
8986
8991
  nn as stagePlanSpace,
8987
- Id as stageSpots,
8988
- ah as stepsDuration,
8992
+ jd as stageSpots,
8993
+ lh as stepsDuration,
8989
8994
  xr as stepsToKeys,
8990
8995
  Js as stickFigureAt,
8991
8996
  je as stickFigureJoints,
8992
8997
  Zs as stickFigureTarget,
8993
- wi as stickToHuman,
8994
- ku as strideLength,
8998
+ vi as stickToHuman,
8999
+ Su as strideLength,
8995
9000
  me as surfaceBox,
8996
- ef as surfaceScript,
8997
- vu as sweepingPose,
8998
- Su as talkingMouth,
8999
- Mu as taperedLine,
9000
- $u as taperedOutline,
9001
- $c as tractor,
9002
- Ac as trainCar,
9003
- Oc as tree,
9004
- Sc as truck,
9005
- qi as tubeMesh,
9001
+ of as surfaceScript,
9002
+ Mu as sweepingPose,
9003
+ $u as talkingMouth,
9004
+ Eu as taperedLine,
9005
+ Au as taperedOutline,
9006
+ Ac as tractor,
9007
+ Pc as trainCar,
9008
+ Ic as tree,
9009
+ $c as truck,
9010
+ Gi as tubeMesh,
9006
9011
  bn as valueAt,
9007
9012
  De as vehicle,
9008
- Eu as walkPose,
9009
- Bc as wheelchair,
9010
- Rd as whiteboard,
9011
- Nd as withErased,
9013
+ Tu as walkPose,
9014
+ Yc as wheelchair,
9015
+ Ld as whiteboard,
9016
+ Rd as withErased,
9012
9017
  at as withExpression
9013
9018
  };