@kolkrabbi/design-editor 0.20.0 → 0.21.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,73 +1,12 @@
1
- import { Ft as e, S as t, V as n, Xt as r, Zt as i, a, c as o, i as s, j as c, l, n as u, o as d, s as f, t as p, u as m, x as h, z as g } from "./rolls-CkmuE-Ya.js";
2
- import { A as ee, F as _, I as te, L as ne, M as v, N as y, P as b, Q as x, R as re, X as S, Y as C, Z as w, a as ie, c as ae, d as T, f as E, i as oe, j as D, l as O, n as k, o as se, p as ce, s as A, u as j } from "./registry-CSOtIU7o.js";
3
- import { a as M, i as le, n as N, t as ue, y as P } from "./TreePicker-D5XZT0Zi.js";
4
- import { n as F, t as de } from "./useLayerEdit-B-NfMWe-.js";
5
- import { i as fe, t as pe } from "./RuleRow-DNVlUgGV.js";
6
- import { Button as I, CurveEditor as L, Dropdown as R, KeyframeEditor as me, LabeledControl as z, LabeledControlSection as he, SegmentedToggle as ge, SettingsRow as _e, Slider as ve, Tooltip as B, ViewToggle as ye, XYPad as be } from "@kolkrabbi/kol-component";
7
- import { useEffect as xe, useRef as Se, useState as Ce } from "react";
1
+ import { Ft as e, It as t, Rt as n, S as r, V as i, a, c as o, dn as s, i as c, j as l, l as u, mn as d, n as f, o as p, pn as m, s as h, t as ee, u as g, x as _, z as te } from "./rolls-Bg1XHuvJ.js";
2
+ import { $ as ne, B as re, F as v, I as y, L as b, N as x, P as S, Q as C, R as ie, V as ae, a as w, c as oe, d as T, et as E, f as D, g as se, h as O, l as ce, m as k, n as A, p as j, s as M, t as le, tt as N, u as ue, z as de } from "./useLayerEdit-ieOjHx6x.js";
3
+ import { a as P, c as fe, i as pe, o as me, s as F, t as he } from "./RuleRow-BXkjpTyN.js";
4
+ import { n as I, t as ge } from "./TreePicker-DLmMl0aU.js";
5
+ import { Button as L, CurveEditor as _e, Dropdown as R, KeyframeEditor as ve, LabeledControl as z, LabeledControlSection as ye, SegmentedToggle as be, SettingsRow as xe, Slider as Se, Tooltip as B, ViewToggle as Ce, XYPad as we } from "@kolkrabbi/kol-component";
6
+ import { useEffect as Te, useRef as Ee, useState as De } from "react";
8
7
  import { Fragment as V, jsx as H, jsxs as U } from "react/jsx-runtime";
9
- //#region src/loops/taxonomy.js
10
- var we = [
11
- {
12
- label: "Scanline",
13
- groups: ["scanline"]
14
- },
15
- {
16
- label: "Pattern",
17
- groups: ["pattern"]
18
- },
19
- {
20
- label: "Loops",
21
- groups: [
22
- "shape",
23
- "field",
24
- "patternloop"
25
- ]
26
- },
27
- {
28
- label: "Math",
29
- groups: ["math"]
30
- },
31
- {
32
- label: "Penrose",
33
- groups: ["penrose"]
34
- },
35
- {
36
- label: "Drift",
37
- groups: ["drift"]
38
- },
39
- {
40
- label: "Gradients",
41
- groups: ["gradients"]
42
- },
43
- {
44
- label: "Soft Forms",
45
- groups: ["softforms"]
46
- },
47
- {
48
- label: "Soft Forms 3D",
49
- groups: ["softforms3d"]
50
- },
51
- {
52
- label: "3D Scene",
53
- groups: [
54
- "scene",
55
- "ribbon",
56
- "forms",
57
- "environment",
58
- "abstract"
59
- ],
60
- labels: { scene: "Primitive" }
61
- }
62
- ], Te = [{
63
- label: "Para Type",
64
- groups: ["paratype"]
65
- }], Ee = we, De = {
66
- optic: "Pattern · Effects",
67
- paratype: "Para Type · Misc",
68
- distress: "Distressor · Vector",
69
- modulator: "Modulator · Vector"
70
- }, Oe = Object.fromEntries(ee.params.map((e) => [e.key, e.default]));
8
+ //#region src/loops/paratype/flatten.js
9
+ var Oe = Object.fromEntries(x.params.map((e) => [e.key, e.default]));
71
10
  function ke(e) {
72
11
  let t = { ...Oe };
73
12
  for (let n of Object.keys(Oe)) {
@@ -83,7 +22,7 @@ function Ae(e, t) {
83
22
  var W = (e) => Number(e.toFixed(2));
84
23
  function je(e, t, n) {
85
24
  if (!e || e.loopId !== "paratype-glyph") return null;
86
- let r = Math.max(1, e.w ?? 480), i = Math.max(1, e.h ?? 480), a = ke(e), o = D(a, r, i);
25
+ let r = Math.max(1, e.w ?? 480), i = Math.max(1, e.h ?? 480), a = ke(e), o = S(a, r, i);
87
26
  if (!o.length) return null;
88
27
  let s = [];
89
28
  t.bg && s.push({
@@ -132,8 +71,8 @@ function je(e, t, n) {
132
71
  }
133
72
  //#endregion
134
73
  //#region src/editor/compose/inspectors/LoopPicker.jsx
135
- function Me({ layer: e, tree: t = Ee, inline: n = !1 }) {
136
- let { updateLayer: r } = c(), i = e.loopGroup ?? "shape", a = t.find((e) => e.groups.includes(i)) ?? null, o = T(i), s = o.find((t) => t.id === e.presetId), l = [...new Set(o.map((e) => e.sub).filter(Boolean))], u = s?.sub ?? l[0], d = l.length ? o.filter((e) => e.sub === u) : o, f = (t, n = i) => {
74
+ function Me({ layer: e, tree: t = fe, inline: n = !1 }) {
75
+ let { updateLayer: r } = l(), i = e.loopGroup ?? "shape", a = t.find((e) => e.groups.includes(i)) ?? null, o = k(i), s = o.find((t) => t.id === e.presetId), c = [...new Set(o.map((e) => e.sub).filter(Boolean))], u = s?.sub ?? c[0], d = c.length ? o.filter((e) => e.sub === u) : o, f = (t, n = i) => {
137
76
  t && r(e.id, {
138
77
  loopGroup: n,
139
78
  presetId: t.id,
@@ -146,12 +85,12 @@ function Me({ layer: e, tree: t = Ee, inline: n = !1 }) {
146
85
  });
147
86
  };
148
87
  return /* @__PURE__ */ U(V, { children: [
149
- t.length > 1 || !a ? /* @__PURE__ */ H(N, {
88
+ t.length > 1 || !a ? /* @__PURE__ */ H(I, {
150
89
  label: "Type",
151
90
  inline: n,
152
91
  children: /* @__PURE__ */ U("div", {
153
92
  className: "flex flex-col gap-1 w-full",
154
- children: [a ? /* @__PURE__ */ H(ue, {
93
+ children: [a ? /* @__PURE__ */ H(ge, {
155
94
  options: t.map((e) => ({
156
95
  value: e.label,
157
96
  label: e.label
@@ -159,32 +98,32 @@ function Me({ layer: e, tree: t = Ee, inline: n = !1 }) {
159
98
  value: a.label,
160
99
  onChange: (e) => {
161
100
  let n = t.find((t) => t.label === e);
162
- n && f(T(n.groups[0])[0], n.groups[0]);
101
+ n && f(k(n.groups[0])[0], n.groups[0]);
163
102
  }
164
103
  }) : /* @__PURE__ */ H("span", {
165
104
  className: "kol-helper-12 text-meta px-1",
166
- children: De[i] ?? k(i).label
167
- }), a && a.groups.length > 1 && /* @__PURE__ */ H(ue, {
105
+ children: me[i] ?? w(i).label
106
+ }), a && a.groups.length > 1 && /* @__PURE__ */ H(ge, {
168
107
  options: a.groups.map((e) => ({
169
108
  value: e,
170
- label: a.labels?.[e] ?? k(e).label
109
+ label: a.labels?.[e] ?? w(e).label
171
110
  })),
172
111
  value: i,
173
- onChange: (e) => f(T(e)[0], e)
112
+ onChange: (e) => f(k(e)[0], e)
174
113
  })]
175
114
  })
176
115
  }) : null,
177
- l.length > 1 && /* @__PURE__ */ H(N, {
116
+ c.length > 1 && /* @__PURE__ */ H(I, {
178
117
  inline: n,
179
118
  label: "Category",
180
- options: l.map((e) => ({
119
+ options: c.map((e) => ({
181
120
  value: e,
182
121
  label: e
183
122
  })),
184
123
  value: u,
185
124
  onChange: (e) => f(o.find((t) => t.sub === e))
186
125
  }),
187
- /* @__PURE__ */ H(N, {
126
+ /* @__PURE__ */ H(I, {
188
127
  inline: n,
189
128
  label: "Preset",
190
129
  options: d.map((e) => ({
@@ -198,7 +137,7 @@ function Me({ layer: e, tree: t = Ee, inline: n = !1 }) {
198
137
  }
199
138
  //#endregion
200
139
  //#region src/editor/params/motionPresets.js
201
- var Ne = (e) => r("generators")?.loopById(e) ?? null, Pe = {
140
+ var Ne = (e) => m("generators")?.loopById(e) ?? null, Pe = {
202
141
  frame: [
203
142
  {
204
143
  id: "static",
@@ -405,7 +344,7 @@ var Ne = (e) => r("generators")?.loopById(e) ?? null, Pe = {
405
344
  },
406
345
  {
407
346
  id: "colour-sweep",
408
- label: "Colour Sweep",
347
+ label: "Color Sweep",
409
348
  params: {
410
349
  spin: 0,
411
350
  animAxis: "diag",
@@ -1215,9 +1154,9 @@ var Ze = {
1215
1154
  value: e,
1216
1155
  label: Qe[e] || e
1217
1156
  })), et = (e, t, n) => [
1218
- P(e[0], t[0], n),
1219
- P(e[1], t[1], n),
1220
- P(e[2], t[2], n)
1157
+ s(e[0], t[0], n),
1158
+ s(e[1], t[1], n),
1159
+ s(e[2], t[2], n)
1221
1160
  ], tt = (e) => ({
1222
1161
  rot: e.rot || [
1223
1162
  0,
@@ -1256,7 +1195,7 @@ function nt(e, t) {
1256
1195
  0,
1257
1196
  0
1258
1197
  ], o),
1259
- scale: P(r.scale ?? 1, i.scale ?? 1, o)
1198
+ scale: s(r.scale ?? 1, i.scale ?? 1, o)
1260
1199
  };
1261
1200
  }
1262
1201
  var rt = [{
@@ -1299,14 +1238,14 @@ function at(e, t) {
1299
1238
  }
1300
1239
  //#endregion
1301
1240
  //#region src/editor/compose/inspectors/KeyframeEditor.jsx
1302
- function ot({ layer: t, patch: n, defaultDuration: r = 8 }) {
1303
- let i = () => it(t.duration ?? r, e.getLoopSeconds());
1304
- return /* @__PURE__ */ H(me, {
1305
- keyframes: t.keyframes,
1306
- onChange: (e) => n({ keyframes: e }),
1307
- t: () => e.getT() * i() % 1,
1308
- onPause: () => e.pause(),
1309
- onSeek: (t) => e.seek(t / i()),
1241
+ function ot({ layer: e, patch: t, defaultDuration: r = 8 }) {
1242
+ let i = () => it(e.duration ?? r, n.getLoopSeconds());
1243
+ return /* @__PURE__ */ H(ve, {
1244
+ keyframes: e.keyframes,
1245
+ onChange: (e) => t({ keyframes: e }),
1246
+ t: () => n.getT() * i() % 1,
1247
+ onPause: () => n.pause(),
1248
+ onSeek: (e) => n.seek(e / i()),
1310
1249
  easeOptions: $e,
1311
1250
  defaultKeyframes: rt
1312
1251
  });
@@ -1333,21 +1272,21 @@ function st({ layer: e, patch: t, camParams: n, isEngine: r, showHeader: i = !1
1333
1272
  className: "flex items-center gap-1",
1334
1273
  children: [n.length > 0 && o.map((e, t) => /* @__PURE__ */ H(B, {
1335
1274
  label: e ? "Recall pose (shift-click = overwrite)" : "Save pose",
1336
- children: /* @__PURE__ */ H(I, {
1275
+ children: /* @__PURE__ */ H(L, {
1337
1276
  "aria-label": e ? "Recall pose (shift-click = overwrite)" : "Save pose",
1338
1277
  tone: e ? "inverted" : "ghost",
1339
1278
  size: "sm",
1340
1279
  onClick: (n) => n.shiftKey || !e ? s(t) : c(t),
1341
1280
  children: t + 1
1342
1281
  })
1343
- }, t)), /* @__PURE__ */ H(I, {
1282
+ }, t)), /* @__PURE__ */ H(L, {
1344
1283
  tone: "primary",
1345
1284
  size: "sm",
1346
1285
  className: "ml-auto",
1347
1286
  onClick: () => {
1348
1287
  let i = {};
1349
1288
  for (let e of n) i[e.key] = e.default;
1350
- t(i), r && import("./host-BE7dtdx9.js").then((t) => t.hostAction?.(e.id, "resetCamera")).catch(() => {});
1289
+ t(i), r && import("./host-B4SRaN9h.js").then((t) => t.hostAction?.(e.id, "resetCamera")).catch(() => {});
1351
1290
  },
1352
1291
  children: "Reset"
1353
1292
  })]
@@ -1359,10 +1298,10 @@ function ct({ layer: e, patch: t, seed: n }) {
1359
1298
  let r = e.rules ?? [], i = (e, n) => t({
1360
1299
  rules: e,
1361
1300
  ...n
1362
- }), a = () => i([...r, S()]), o = (e, t) => i(r.map((n, r) => r === e ? t : n)), s = (e) => i(r.filter((t, n) => n !== e)), c = (e) => {
1363
- let t = n.take(), a = l(t >>> 0);
1301
+ }), a = () => i([...r, ne()]), o = (e, t) => i(r.map((n, r) => r === e ? t : n)), s = (e) => i(r.filter((t, n) => n !== e)), c = (e) => {
1302
+ let t = n.take(), a = u(t >>> 0);
1364
1303
  i(r.map((t, n) => n === e ? {
1365
- ...w(a),
1304
+ ...E(a),
1366
1305
  id: t.id
1367
1306
  } : t), { _rollSeed: t });
1368
1307
  };
@@ -1370,25 +1309,25 @@ function ct({ layer: e, patch: t, seed: n }) {
1370
1309
  label: `Rules · ${r.length}`,
1371
1310
  children: /* @__PURE__ */ U("div", {
1372
1311
  className: "flex flex-col gap-2",
1373
- children: [r.map((e, t) => /* @__PURE__ */ H(pe, {
1312
+ children: [r.map((e, t) => /* @__PURE__ */ H(he, {
1374
1313
  rule: e,
1375
1314
  onChange: (e) => o(t, e),
1376
1315
  onRemove: () => s(t),
1377
1316
  onReroll: () => c(t)
1378
1317
  }, e.id ?? t)), /* @__PURE__ */ U("div", {
1379
1318
  className: "grid grid-cols-2 gap-2",
1380
- children: [/* @__PURE__ */ H(I, {
1319
+ children: [/* @__PURE__ */ H(L, {
1381
1320
  tone: "primary",
1382
1321
  size: "sm",
1383
1322
  iconLeft: "plus",
1384
1323
  onClick: a,
1385
1324
  children: "Add rule"
1386
- }), /* @__PURE__ */ H(I, {
1325
+ }), /* @__PURE__ */ H(L, {
1387
1326
  tone: "primary",
1388
1327
  size: "sm",
1389
1328
  onClick: () => {
1390
- let e = n.take(), t = l(e >>> 0), r = 1 + Math.floor(t() * 3);
1391
- i(Array.from({ length: r }, () => w(t)), { _rollSeed: e });
1329
+ let e = n.take(), t = u(e >>> 0), r = 1 + Math.floor(t() * 3);
1330
+ i(Array.from({ length: r }, () => E(t)), { _rollSeed: e });
1392
1331
  },
1393
1332
  children: "Randomize"
1394
1333
  })]
@@ -1400,7 +1339,7 @@ function ct({ layer: e, patch: t, seed: n }) {
1400
1339
  //#region src/editor/compose/inspectors/ProfileEditor.jsx
1401
1340
  var G = 240, K = 120, lt = 12, q = (e, t, n) => Math.max(t, Math.min(n, e)), J = (e) => e * G, Y = (e) => K / 2 - e * (K / 2 - lt);
1402
1341
  function ut({ value: e, onChange: t }) {
1403
- let n = Array.isArray(e) && e.length > 1 ? e : C, r = Se(null), i = Se(null), a = (e) => {
1342
+ let n = Array.isArray(e) && e.length > 1 ? e : C, r = Ee(null), i = Ee(null), a = (e) => {
1404
1343
  let t = r.current, n = t.createSVGPoint();
1405
1344
  n.x = e.clientX, n.y = e.clientY;
1406
1345
  let i = n.matrixTransform(t.getScreenCTM().inverse());
@@ -1532,14 +1471,14 @@ function dt({ layer: e, patch: t }) {
1532
1471
  //#endregion
1533
1472
  //#region src/editor/compose/inspectors/CurveEditor.jsx
1534
1473
  function ft({ layer: e, patch: t }) {
1535
- let n = e.clip === "custom", r = n ? null : _(e.clip), i = n ? null : {
1474
+ let n = e.clip === "custom", r = n ? null : ie(e.clip), i = n ? null : {
1536
1475
  label: (v.find((t) => t.id === e.clip) || v[0]).label,
1537
1476
  copies: r.copies,
1538
1477
  spiral: r.spiral,
1539
1478
  layerCopies: e.copies,
1540
1479
  layerSpiral: e.spiral
1541
1480
  };
1542
- return /* @__PURE__ */ H(L, {
1481
+ return /* @__PURE__ */ H(_e, {
1543
1482
  value: n ? e.custom ?? b("polar") : r.def,
1544
1483
  stock: i,
1545
1484
  onChange: (e, { extras: n }) => t({
@@ -1547,7 +1486,7 @@ function ft({ layer: e, patch: t }) {
1547
1486
  ...n,
1548
1487
  custom: e
1549
1488
  }),
1550
- validate: te,
1489
+ validate: de,
1551
1490
  kinds: y,
1552
1491
  defaultFor: b
1553
1492
  });
@@ -1561,10 +1500,10 @@ function pt({ layer: e, patch: t, tab: n }) {
1561
1500
  }) : null : null;
1562
1501
  }
1563
1502
  function mt({ layer: e }) {
1564
- let { flattenParatype: t } = c();
1503
+ let { flattenParatype: t } = l();
1565
1504
  return t ? /* @__PURE__ */ H(B, {
1566
1505
  label: "Flatten the glyph(s) to vector shape layers (one-way)",
1567
- children: /* @__PURE__ */ H(I, {
1506
+ children: /* @__PURE__ */ H(L, {
1568
1507
  "aria-label": "Flatten the glyph(s) to vector shape layers (one-way)",
1569
1508
  tone: "primary",
1570
1509
  size: "sm",
@@ -1575,14 +1514,14 @@ function mt({ layer: e }) {
1575
1514
  }) : null;
1576
1515
  }
1577
1516
  function ht({ layer: e, patch: t }) {
1578
- let r = n(se(e.loopId)?.params ?? [], e).filter((e) => e.type === "range");
1579
- if (r.length < 2) return null;
1580
- let i = (e, t) => r.some((t) => t.key === e) && e !== t ? e : r.find((e) => e.key !== t)?.key, a = i(e._xyX ?? "stemWidth", null), o = i(e._xyY ?? "oWidth", a), s = r.find((e) => e.key === a), c = r.find((e) => e.key === o);
1517
+ let n = i(ce(e.loopId)?.params ?? [], e).filter((e) => e.type === "range");
1518
+ if (n.length < 2) return null;
1519
+ let r = (e, t) => n.some((t) => t.key === e) && e !== t ? e : n.find((e) => e.key !== t)?.key, a = r(e._xyX ?? "stemWidth", null), o = r(e._xyY ?? "oWidth", a), s = n.find((e) => e.key === a), c = n.find((e) => e.key === o);
1581
1520
  if (!s || !c) return null;
1582
1521
  let l = (t, n) => typeof e[t] == "number" ? e[t] : n.default, u = (e, t) => {
1583
1522
  let n = t.step ?? 1;
1584
1523
  return n < 1 ? Number((Math.round(e / n) * n).toFixed(4)) : Math.round(e);
1585
- }, d = r.map((e) => ({
1524
+ }, d = n.map((e) => ({
1586
1525
  value: e.key,
1587
1526
  label: e.label
1588
1527
  }));
@@ -1615,7 +1554,7 @@ function ht({ layer: e, patch: t }) {
1615
1554
  })
1616
1555
  })]
1617
1556
  }),
1618
- /* @__PURE__ */ H(be, {
1557
+ /* @__PURE__ */ H(we, {
1619
1558
  xValue: l(a, s),
1620
1559
  yValue: l(o, c),
1621
1560
  xMin: s.min ?? 0,
@@ -1829,24 +1768,24 @@ var X = 5, gt = [
1829
1768
  }));
1830
1769
  }, Et = (e, t) => e.find((e) => e.value === t)?.label ?? t;
1831
1770
  function Dt({ layer: e }) {
1832
- let { updateLayer: t } = c(), n = de(e.id, { history: "coalesce" }), r = e.loopId === "softforms3d", i = r && !!e.metaball, a = r ? _t : gt, o = r ? yt : vt, s = i ? 2 : 1, u = Array.isArray(e.forms) ? e.forms : [], [d, f] = Ce(-1), p = d >= 0 && d < u.length ? u[d] : null, h = (t) => {
1771
+ let { updateLayer: t } = l(), n = le(e.id, { history: "coalesce" }), r = e.loopId === "softforms3d", i = r && !!e.metaball, a = r ? _t : gt, o = r ? yt : vt, s = i ? 2 : 1, c = Array.isArray(e.forms) ? e.forms : [], [d, f] = De(-1), p = d >= 0 && d < c.length ? c[d] : null, m = (t) => {
1833
1772
  f(t), window.dispatchEvent(new CustomEvent("kol:softform-select", { detail: {
1834
1773
  id: e.id,
1835
1774
  index: t,
1836
1775
  from: "panel"
1837
1776
  } }));
1838
1777
  };
1839
- xe(() => {
1778
+ Te(() => {
1840
1779
  let t = (t) => {
1841
1780
  t.detail?.id === e.id && t.detail.from === "canvas" && f(t.detail.index);
1842
1781
  };
1843
1782
  return window.addEventListener("kol:softform-select", t), () => window.removeEventListener("kol:softform-select", t);
1844
1783
  }, [e.id]);
1845
- let g = (n) => t(e.id, { forms: n }), ee = (e, t) => n.patch({ forms: u.map((n, r) => r === d ? {
1784
+ let h = (n) => t(e.id, { forms: n }), ee = (e, t) => n.patch({ forms: c.map((n, r) => r === d ? {
1846
1785
  ...n,
1847
1786
  [e]: t
1848
1787
  } : n) }), _ = () => {
1849
- if (u.length >= X) return;
1788
+ if (c.length >= X) return;
1850
1789
  let e = r ? {
1851
1790
  t: "sphere",
1852
1791
  x: 0,
@@ -1866,25 +1805,25 @@ function Dt({ layer: e }) {
1866
1805
  rot: 0,
1867
1806
  hue: Z(Math.random())
1868
1807
  };
1869
- g([...u, e]), h(u.length);
1808
+ h([...c, e]), m(c.length);
1870
1809
  }, te = (e) => {
1871
- if (u.length >= X) return;
1810
+ if (c.length >= X) return;
1872
1811
  let t = {
1873
- ...u[e],
1874
- x: xt((u[e].x ?? 0) + .12, -1.2, 1.2),
1875
- y: xt((u[e].y ?? 0) - .1, -1.2, 1.2)
1812
+ ...c[e],
1813
+ x: xt((c[e].x ?? 0) + .12, -1.2, 1.2),
1814
+ y: xt((c[e].y ?? 0) - .1, -1.2, 1.2)
1876
1815
  };
1877
- g([
1878
- ...u.slice(0, e + 1),
1816
+ h([
1817
+ ...c.slice(0, e + 1),
1879
1818
  t,
1880
- ...u.slice(e + 1)
1881
- ]), h(e + 1);
1819
+ ...c.slice(e + 1)
1820
+ ]), m(e + 1);
1882
1821
  }, ne = (e) => {
1883
- u.length <= s || (g(u.filter((t, n) => n !== e)), h(-1));
1884
- }, v = (e, t) => {
1885
- if (t < 0 || t >= u.length) return;
1886
- let n = [...u];
1887
- [n[e], n[t]] = [n[t], n[e]], g(n), h(t);
1822
+ c.length <= s || (h(c.filter((t, n) => n !== e)), m(-1));
1823
+ }, re = (e, t) => {
1824
+ if (t < 0 || t >= c.length) return;
1825
+ let n = [...c];
1826
+ [n[e], n[t]] = [n[t], n[e]], h(n), m(t);
1888
1827
  };
1889
1828
  return /* @__PURE__ */ U("div", {
1890
1829
  className: "flex flex-col gap-2",
@@ -1895,10 +1834,10 @@ function Dt({ layer: e }) {
1895
1834
  }),
1896
1835
  /* @__PURE__ */ H("div", {
1897
1836
  className: "flex flex-col gap-1",
1898
- children: u.map((e, t) => {
1899
- let n = u.length - 1 - t, r = u[n];
1837
+ children: c.map((e, t) => {
1838
+ let n = c.length - 1 - t, r = c[n];
1900
1839
  return /* @__PURE__ */ U("div", {
1901
- onClick: () => h(n),
1840
+ onClick: () => m(n),
1902
1841
  className: `flex items-center gap-2 pl-2 pr-1 py-1 rounded cursor-pointer kol-helper-12 ${n === d ? "bg-[color-mix(in_srgb,var(--kol-accent-primary)_26%,transparent)] text-emphasis" : "text-body hover:bg-oq-04 hover:text-emphasis"}`,
1903
1842
  children: [
1904
1843
  /* @__PURE__ */ H("span", {
@@ -1911,23 +1850,23 @@ function Dt({ layer: e }) {
1911
1850
  }),
1912
1851
  /* @__PURE__ */ H(B, {
1913
1852
  label: "Move form up",
1914
- children: /* @__PURE__ */ H(I, {
1853
+ children: /* @__PURE__ */ H(L, {
1915
1854
  tone: "ghost",
1916
1855
  size: "sm",
1917
1856
  quiet: !0,
1918
1857
  iconOnly: "chevron-down",
1919
1858
  iconSize: 12,
1920
1859
  "aria-label": "Move form up",
1921
- disabled: n >= u.length - 1,
1860
+ disabled: n >= c.length - 1,
1922
1861
  onClick: (e) => {
1923
- e.stopPropagation(), v(n, n + 1);
1862
+ e.stopPropagation(), re(n, n + 1);
1924
1863
  },
1925
1864
  style: { transform: "rotate(180deg)" }
1926
1865
  })
1927
1866
  }),
1928
1867
  /* @__PURE__ */ H(B, {
1929
1868
  label: "Move form down",
1930
- children: /* @__PURE__ */ H(I, {
1869
+ children: /* @__PURE__ */ H(L, {
1931
1870
  tone: "ghost",
1932
1871
  size: "sm",
1933
1872
  quiet: !0,
@@ -1936,20 +1875,20 @@ function Dt({ layer: e }) {
1936
1875
  "aria-label": "Move form down",
1937
1876
  disabled: n <= 0,
1938
1877
  onClick: (e) => {
1939
- e.stopPropagation(), v(n, n - 1);
1878
+ e.stopPropagation(), re(n, n - 1);
1940
1879
  }
1941
1880
  })
1942
1881
  }),
1943
1882
  /* @__PURE__ */ H(B, {
1944
1883
  label: "Duplicate form",
1945
- children: /* @__PURE__ */ H(I, {
1884
+ children: /* @__PURE__ */ H(L, {
1946
1885
  tone: "ghost",
1947
1886
  size: "sm",
1948
1887
  quiet: !0,
1949
1888
  iconOnly: "copy",
1950
1889
  iconSize: 12,
1951
1890
  "aria-label": "Duplicate form",
1952
- disabled: u.length >= X,
1891
+ disabled: c.length >= X,
1953
1892
  onClick: (e) => {
1954
1893
  e.stopPropagation(), te(n);
1955
1894
  }
@@ -1957,14 +1896,14 @@ function Dt({ layer: e }) {
1957
1896
  }),
1958
1897
  /* @__PURE__ */ H(B, {
1959
1898
  label: "Delete form",
1960
- children: /* @__PURE__ */ H(I, {
1899
+ children: /* @__PURE__ */ H(L, {
1961
1900
  tone: "ghost",
1962
1901
  size: "sm",
1963
1902
  quiet: !0,
1964
1903
  iconOnly: "trash",
1965
1904
  iconSize: 12,
1966
1905
  "aria-label": "Delete form",
1967
- disabled: u.length <= s,
1906
+ disabled: c.length <= s,
1968
1907
  onClick: (e) => {
1969
1908
  e.stopPropagation(), ne(n);
1970
1909
  }
@@ -1974,19 +1913,19 @@ function Dt({ layer: e }) {
1974
1913
  }, n);
1975
1914
  })
1976
1915
  }),
1977
- /* @__PURE__ */ H(I, {
1916
+ /* @__PURE__ */ H(L, {
1978
1917
  tone: "primary",
1979
1918
  size: "sm",
1980
1919
  className: "w-full",
1981
1920
  iconLeft: "plus",
1982
1921
  iconSize: 12,
1983
- disabled: u.length >= X,
1922
+ disabled: c.length >= X,
1984
1923
  onClick: _,
1985
1924
  children: "Add form"
1986
1925
  }),
1987
1926
  !r && /* @__PURE__ */ H(B, {
1988
1927
  label: "Edit forms on the canvas (click to select, drag to move, corners to scale, knob to rotate)",
1989
- children: /* @__PURE__ */ H(I, {
1928
+ children: /* @__PURE__ */ H(L, {
1990
1929
  "aria-label": "Edit forms on the canvas (click to select, drag to move, corners to scale, knob to rotate)",
1991
1930
  tone: "primary",
1992
1931
  size: "sm",
@@ -2013,7 +1952,7 @@ function Dt({ layer: e }) {
2013
1952
  className: "w-full",
2014
1953
  options: a,
2015
1954
  value: p.t,
2016
- onChange: (e) => g(u.map((t, n) => n === d ? {
1955
+ onChange: (e) => h(c.map((t, n) => n === d ? {
2017
1956
  ...t,
2018
1957
  t: e
2019
1958
  } : t))
@@ -2023,7 +1962,7 @@ function Dt({ layer: e }) {
2023
1962
  let t = p[e.k] ?? (e.fallback ? p[e.fallback] : void 0), n = typeof t == "number" ? t : e.def;
2024
1963
  return /* @__PURE__ */ H(z, {
2025
1964
  label: e.label,
2026
- children: /* @__PURE__ */ H(ve, {
1965
+ children: /* @__PURE__ */ H(Se, {
2027
1966
  min: e.min,
2028
1967
  max: e.max,
2029
1968
  step: e.step,
@@ -2041,24 +1980,24 @@ function Dt({ layer: e }) {
2041
1980
  /* @__PURE__ */ U("div", {
2042
1981
  className: "grid grid-cols-2 gap-2",
2043
1982
  children: [
2044
- /* @__PURE__ */ H(I, {
1983
+ /* @__PURE__ */ H(L, {
2045
1984
  tone: "primary",
2046
1985
  size: "sm",
2047
1986
  onClick: () => {
2048
- let e = l(m());
2049
- g(u.map((t) => ({
1987
+ let e = u(g());
1988
+ h(c.map((t) => ({
2050
1989
  ...t,
2051
1990
  hue: Z(e())
2052
1991
  })));
2053
1992
  },
2054
1993
  children: "Color"
2055
1994
  }),
2056
- /* @__PURE__ */ H(I, {
1995
+ /* @__PURE__ */ H(L, {
2057
1996
  tone: "primary",
2058
1997
  size: "sm",
2059
1998
  onClick: () => {
2060
- let e = l(m());
2061
- g(u.map((t) => r ? {
1999
+ let e = u(g());
2000
+ h(c.map((t) => r ? {
2062
2001
  ...t,
2063
2002
  x: Z(Q(e, -.7, .7)),
2064
2003
  y: Z(Q(e, -.7, .7)),
@@ -2073,12 +2012,12 @@ function Dt({ layer: e }) {
2073
2012
  },
2074
2013
  children: "Transform"
2075
2014
  }),
2076
- /* @__PURE__ */ H(I, {
2015
+ /* @__PURE__ */ H(L, {
2077
2016
  tone: "primary",
2078
2017
  size: "sm",
2079
2018
  onClick: () => {
2080
- let e = l(m());
2081
- g(u.map((t) => {
2019
+ let e = u(g());
2020
+ h(c.map((t) => {
2082
2021
  let n = Z(Q(e, .35, .95)), i = Z(Q(e, .35, .95));
2083
2022
  return r ? {
2084
2023
  ...t,
@@ -2094,11 +2033,11 @@ function Dt({ layer: e }) {
2094
2033
  },
2095
2034
  children: "Scale"
2096
2035
  }),
2097
- /* @__PURE__ */ H(I, {
2036
+ /* @__PURE__ */ H(L, {
2098
2037
  tone: "primary",
2099
2038
  size: "sm",
2100
2039
  onClick: () => {
2101
- let n = l(m());
2040
+ let n = u(g());
2102
2041
  t(e.id, {
2103
2042
  motion: Z(Q(n, 0, 1.1)),
2104
2043
  sweep: Math.round(Q(n, 0, 360))
@@ -2108,16 +2047,16 @@ function Dt({ layer: e }) {
2108
2047
  })
2109
2048
  ]
2110
2049
  }),
2111
- /* @__PURE__ */ H(I, {
2050
+ /* @__PURE__ */ H(L, {
2112
2051
  tone: "primary",
2113
2052
  size: "sm",
2114
2053
  className: "w-full",
2115
2054
  onClick: () => {
2116
- let e = l(m());
2055
+ let e = u(g());
2117
2056
  if (r) {
2118
2057
  if (i) {
2119
2058
  let t = 2 + Math.floor(e() * 4), n = Q(e, .45, .9);
2120
- g(Tt(Array.from({ length: t }, (r, i) => {
2059
+ h(Tt(Array.from({ length: t }, (r, i) => {
2121
2060
  let [a, o, s] = Ct(e, n), c = Z(Q(e, .5, .92));
2122
2061
  return {
2123
2062
  t: "sphere",
@@ -2133,7 +2072,7 @@ function Dt({ layer: e }) {
2133
2072
  })));
2134
2073
  } else {
2135
2074
  let t = Q(e, .6, 1.15);
2136
- g(Tt(u.map((n) => {
2075
+ h(Tt(c.map((n) => {
2137
2076
  let [r, i, a] = Ct(e, t);
2138
2077
  return {
2139
2078
  ...n,
@@ -2147,7 +2086,7 @@ function Dt({ layer: e }) {
2147
2086
  return;
2148
2087
  }
2149
2088
  let t = 2 + Math.floor(e() * 4), n = Q(e, .45, .85);
2150
- g(wt(Array.from({ length: t }, (r, i) => {
2089
+ h(wt(Array.from({ length: t }, (r, i) => {
2151
2090
  let [a, o] = St(e, n);
2152
2091
  return {
2153
2092
  t: gt[Math.floor(e() * gt.length)].value,
@@ -2167,16 +2106,16 @@ function Dt({ layer: e }) {
2167
2106
  }
2168
2107
  //#endregion
2169
2108
  //#region src/loops/theme.js
2170
- function Ot(e, t, n, r) {
2171
- let i = M(n, r), a = {
2172
- bg: i.bg,
2173
- fg: i.fg,
2174
- accent: i.accent,
2175
- dim: i.dim ?? i.accent,
2176
- warm: i.warm ?? i.accent
2177
- }, o = { ...e };
2178
- for (let e of t || []) e.type === "color" && e.role && a[e.role] && (o[e.key] = a[e.role]);
2179
- return o;
2109
+ function Ot(e, n, r, i) {
2110
+ let a = t(r, i), o = {
2111
+ bg: a.bg,
2112
+ fg: a.fg,
2113
+ accent: a.accent,
2114
+ dim: a.dim ?? a.accent,
2115
+ warm: a.warm ?? a.accent
2116
+ }, s = { ...e };
2117
+ for (let e of n || []) e.type === "color" && e.role && o[e.role] && (s[e.key] = o[e.role]);
2118
+ return s;
2180
2119
  }
2181
2120
  //#endregion
2182
2121
  //#region src/editor/compose/inspectors/LoopFields.jsx
@@ -2191,10 +2130,10 @@ var kt = (e, t) => {
2191
2130
  }, ...n] : n;
2192
2131
  };
2193
2132
  function $({ inline: e, label: t, align: n = "fill", children: r }) {
2194
- return e ? /* @__PURE__ */ H(_e, {
2133
+ return e ? /* @__PURE__ */ H(xe, {
2195
2134
  label: t,
2196
2135
  align: n,
2197
- labelWidth: 96,
2136
+ labelWidth: 112,
2198
2137
  children: r
2199
2138
  }) : /* @__PURE__ */ H(z, {
2200
2139
  label: t,
@@ -2209,64 +2148,64 @@ var At = [{
2209
2148
  label: "On"
2210
2149
  }];
2211
2150
  function jt({ inline: e, cs: t, on: n, onChange: r }) {
2212
- return e ? /* @__PURE__ */ H(ge, {
2151
+ return e ? /* @__PURE__ */ H(be, {
2213
2152
  size: t,
2214
- className: `w-full ${h(t) ?? ""}`,
2153
+ className: `w-full ${_(t) ?? ""}`,
2215
2154
  options: At,
2216
2155
  value: n ? "on" : "off",
2217
2156
  onChange: (e) => r(e === "on")
2218
- }) : /* @__PURE__ */ H(ye, {
2157
+ }) : /* @__PURE__ */ H(Ce, {
2219
2158
  size: t,
2220
2159
  options: At,
2221
2160
  viewMode: n ? "on" : "off",
2222
2161
  onViewChange: (e) => r(e === "on")
2223
2162
  });
2224
2163
  }
2225
- function Mt({ layer: e, setProp: n, patch: r, updateLayer: i, palette: c, renderAnimate: m, tab: h, tabStrip: ee, tree: _, picker: te = !0, inline: v = !1 }) {
2226
- let y = t(), b = se(e.loopId), x = b?.params ?? [], S = e.themeId ?? "kol", C = !!e.themeInvert, w = (t) => i(e.id, {
2227
- themeId: t,
2228
- ...Ot(e, b?.params, t, C)
2229
- }), ae = (t) => i(e.id, {
2230
- themeInvert: t,
2231
- ...Ot(e, b?.params, S, t)
2232
- }), E = Ye(e.loopId), oe = E ? Object.keys(E).map((e) => ({
2164
+ function Mt({ layer: t, setProp: n, patch: i, updateLayer: s, palette: l, renderAnimate: d, tab: m, tabStrip: g, tree: _, picker: ne = !0, inline: v = !1 }) {
2165
+ let y = r(), b = ce(t.loopId), x = b?.params ?? [], S = t.themeId ?? "kol", C = !!t.themeInvert, ie = (e) => s(t.id, {
2166
+ themeId: e,
2167
+ ...Ot(t, b?.params, e, C)
2168
+ }), w = (e) => s(t.id, {
2169
+ themeInvert: e,
2170
+ ...Ot(t, b?.params, S, e)
2171
+ }), T = Ye(t.loopId), E = T ? Object.keys(T).map((e) => ({
2233
2172
  id: e,
2234
2173
  label: e
2235
- })) : null, D = E ? new Set(Object.values(E).flatMap((e) => Object.keys(e))) : null, O = o(e), k = d(x, e), A = Ke(e.loopId, e), j = (t, n, r) => {
2236
- let o = a(e, t, O.take(), {
2174
+ })) : null, D = T ? new Set(Object.values(T).flatMap((e) => Object.keys(e))) : null, O = o(t), j = p(x, t), M = Ke(t.loopId, t), le = (e, n, r) => {
2175
+ let i = a(t, e, O.take(), {
2237
2176
  stripNoRandom: !!n?.motion,
2238
2177
  ...r
2239
2178
  });
2240
- A && n?.motion && (n.id !== "Form" && (o._framePreset = "custom"), n.id !== "Frame" && (o._formPreset = "custom")), D && Object.keys(o).some((e) => D.has(e)) && (o._lookPreset = "custom"), i(e.id, o);
2241
- }, M = (t) => {
2242
- let n = T(e.loopGroup).find((t) => t.id === e.presetId)?.params ?? {}, r = {};
2243
- for (let e of t) {
2244
- let t = n[e.key] === void 0 ? e.default : n[e.key];
2245
- t !== void 0 && (r[e.key] = t);
2179
+ M && n?.motion && (n.id !== "Form" && (i._framePreset = "custom"), n.id !== "Frame" && (i._formPreset = "custom")), D && Object.keys(i).some((e) => D.has(e)) && (i._lookPreset = "custom"), s(t.id, i);
2180
+ }, N = (e) => {
2181
+ let n = k(t.loopGroup).find((e) => e.id === t.presetId)?.params ?? {}, r = {};
2182
+ for (let t of e) {
2183
+ let e = n[t.key] === void 0 ? t.default : n[t.key];
2184
+ e !== void 0 && (r[t.key] = e);
2246
2185
  }
2247
- i(e.id, r);
2248
- }, N = A ? qe(A.frame) : null, ue = A ? qe(A.form) : null, P = (e, t) => {
2186
+ s(t.id, r);
2187
+ }, ue = M ? qe(M.frame) : null, de = M ? qe(M.form) : null, P = (e, t) => {
2249
2188
  let n = {};
2250
- N?.has(e) && (n._framePreset = "custom"), ue?.has(e) && (n._formPreset = "custom"), D?.has(e) && (n._lookPreset = "custom"), r({
2189
+ ue?.has(e) && (n._framePreset = "custom"), de?.has(e) && (n._formPreset = "custom"), D?.has(e) && (n._lookPreset = "custom"), i({
2251
2190
  [e]: t,
2252
2191
  ...n
2253
2192
  });
2254
- }, de = (e, t) => (n) => {
2255
- let i = t.find((e) => e.id === n);
2256
- r({
2193
+ }, fe = (e, t) => (n) => {
2194
+ let r = t.find((e) => e.id === n);
2195
+ i({
2257
2196
  [e]: n,
2258
- ...i?.params ?? {}
2197
+ ...r?.params ?? {}
2259
2198
  });
2260
- }, pe = (e) => r({
2199
+ }, me = (e) => i({
2261
2200
  _lookPreset: e,
2262
- ...E?.[e] ?? {}
2263
- }), L = b?.camera ? b.camera.map((e) => ({
2201
+ ...T?.[e] ?? {}
2202
+ }), F = b?.camera ? b.camera.map((e) => ({
2264
2203
  ...e,
2265
2204
  section: "Camera"
2266
- })) : null, me = [...b?.camera ?? [], ...x.filter((e) => g(e) === "Camera")], z = b?.kind === "engine", ge = me.length > 0 || z && b?.orbit, _e = b?.engine === "scene" && (e.animMode === "keyframes" || e.animMode === "keyframe"), ve = b?.orbit ? {
2205
+ })) : null, he = [...b?.camera ?? [], ...x.filter((e) => te(e) === "Camera")], I = b?.kind === "engine", ge = he.length > 0 || I && b?.orbit, _e = b?.engine === "scene" && (t.animMode === "keyframes" || t.animMode === "keyframe"), ve = b?.orbit ? {
2267
2206
  yaw: 1,
2268
2207
  dist: 1
2269
- } : ce(b), B = ve ? /* @__PURE__ */ U("p", {
2208
+ } : se(b), z = ve ? /* @__PURE__ */ U("p", {
2270
2209
  className: `kol-mono-10 text-meta${v ? "" : " col-span-2"}`,
2271
2210
  children: [
2272
2211
  "Press C (Orbit tool) to move the camera — ",
@@ -2275,45 +2214,45 @@ function Mt({ layer: e, setProp: n, patch: r, updateLayer: i, palette: c, render
2275
2214
  ]
2276
2215
  }) : null;
2277
2216
  return /* @__PURE__ */ U(V, { children: [
2278
- te && (v ? /* @__PURE__ */ H(he, {
2217
+ ne && (v ? m === "generate" && /* @__PURE__ */ H(ye, {
2279
2218
  divided: !0,
2280
2219
  children: /* @__PURE__ */ H(Me, {
2281
- layer: e,
2220
+ layer: t,
2282
2221
  tree: _,
2283
2222
  inline: !0
2284
2223
  })
2285
2224
  }) : /* @__PURE__ */ H(Me, {
2286
- layer: e,
2225
+ layer: t,
2287
2226
  tree: _
2288
2227
  })),
2289
- ee,
2290
- (h === "generate" || h === "labs-effect") && /* @__PURE__ */ U(V, { children: [
2291
- (e.loopId === "softforms" || e.loopId === "softforms3d") && /* @__PURE__ */ H(Dt, { layer: e }),
2292
- E && !v && /* @__PURE__ */ H($, {
2228
+ g,
2229
+ (m === "generate" || m === "labs-effect") && /* @__PURE__ */ U(V, { children: [
2230
+ (t.loopId === "softforms" || t.loopId === "softforms3d") && /* @__PURE__ */ H(Dt, { layer: t }),
2231
+ T && !v && /* @__PURE__ */ H($, {
2293
2232
  inline: v,
2294
2233
  label: "Look",
2295
2234
  children: /* @__PURE__ */ H(R, {
2296
2235
  variant: "subtle",
2297
2236
  size: y,
2298
2237
  className: "w-full",
2299
- options: kt(oe, e._lookPreset),
2300
- value: e._lookPreset ?? "custom",
2301
- onChange: pe
2238
+ options: kt(E, t._lookPreset),
2239
+ value: t._lookPreset ?? "custom",
2240
+ onChange: me
2302
2241
  })
2303
2242
  }),
2304
- v && /* @__PURE__ */ U(he, {
2243
+ v && /* @__PURE__ */ U(ye, {
2305
2244
  divided: !0,
2306
2245
  children: [
2307
- E && /* @__PURE__ */ H($, {
2246
+ T && /* @__PURE__ */ H($, {
2308
2247
  inline: !0,
2309
2248
  label: "Look",
2310
2249
  children: /* @__PURE__ */ H(R, {
2311
2250
  variant: "subtle",
2312
2251
  size: y,
2313
2252
  className: "w-full",
2314
- options: kt(oe, e._lookPreset),
2315
- value: e._lookPreset ?? "custom",
2316
- onChange: pe
2253
+ options: kt(E, t._lookPreset),
2254
+ value: t._lookPreset ?? "custom",
2255
+ onChange: me
2317
2256
  })
2318
2257
  }),
2319
2258
  /* @__PURE__ */ H($, {
@@ -2323,9 +2262,9 @@ function Mt({ layer: e, setProp: n, patch: r, updateLayer: i, palette: c, render
2323
2262
  variant: "subtle",
2324
2263
  size: y,
2325
2264
  className: "w-full",
2326
- options: le,
2265
+ options: e,
2327
2266
  value: S,
2328
- onChange: w
2267
+ onChange: ie
2329
2268
  })
2330
2269
  }),
2331
2270
  /* @__PURE__ */ H($, {
@@ -2335,20 +2274,20 @@ function Mt({ layer: e, setProp: n, patch: r, updateLayer: i, palette: c, render
2335
2274
  inline: !0,
2336
2275
  cs: y,
2337
2276
  on: C,
2338
- onChange: ae
2277
+ onChange: w
2339
2278
  })
2340
2279
  }),
2341
- ie(b) && /* @__PURE__ */ H($, {
2280
+ oe(b) && /* @__PURE__ */ H($, {
2342
2281
  inline: !0,
2343
2282
  label: "Background",
2344
2283
  children: /* @__PURE__ */ H(jt, {
2345
2284
  inline: !0,
2346
2285
  cs: y,
2347
- on: e.bgOn !== !1,
2286
+ on: t.bgOn !== !1,
2348
2287
  onChange: (e) => n("bgOn", e)
2349
2288
  })
2350
2289
  }),
2351
- B
2290
+ z
2352
2291
  ]
2353
2292
  }),
2354
2293
  !v && /* @__PURE__ */ U("div", {
@@ -2361,9 +2300,9 @@ function Mt({ layer: e, setProp: n, patch: r, updateLayer: i, palette: c, render
2361
2300
  variant: "subtle",
2362
2301
  size: y,
2363
2302
  className: "w-full",
2364
- options: le,
2303
+ options: e,
2365
2304
  value: S,
2366
- onChange: w
2305
+ onChange: ie
2367
2306
  })
2368
2307
  }),
2369
2308
  /* @__PURE__ */ H($, {
@@ -2373,111 +2312,111 @@ function Mt({ layer: e, setProp: n, patch: r, updateLayer: i, palette: c, render
2373
2312
  inline: !1,
2374
2313
  cs: y,
2375
2314
  on: C,
2376
- onChange: ae
2315
+ onChange: w
2377
2316
  })
2378
2317
  }),
2379
- ie(b) && /* @__PURE__ */ H($, {
2318
+ oe(b) && /* @__PURE__ */ H($, {
2380
2319
  inline: !1,
2381
2320
  label: "Background",
2382
2321
  children: /* @__PURE__ */ H(jt, {
2383
2322
  inline: !1,
2384
2323
  cs: y,
2385
- on: e.bgOn !== !1,
2324
+ on: t.bgOn !== !1,
2386
2325
  onChange: (e) => n("bgOn", e)
2387
2326
  })
2388
2327
  }),
2389
- B
2328
+ z
2390
2329
  ]
2391
2330
  }),
2392
- /* @__PURE__ */ H(F, {
2331
+ /* @__PURE__ */ H(A, {
2393
2332
  schema: x,
2394
- layer: e,
2333
+ layer: t,
2395
2334
  setProp: P,
2396
- palette: c,
2397
- renderAnimate: m,
2335
+ palette: l,
2336
+ renderAnimate: d,
2398
2337
  tab: "generate",
2399
2338
  inline: v
2400
2339
  }),
2401
- f(e).length > 0 && /* @__PURE__ */ H(I, {
2340
+ h(t).length > 0 && /* @__PURE__ */ H(L, {
2402
2341
  tone: "primary",
2403
2342
  size: y,
2404
2343
  className: "w-full",
2405
2344
  onClick: () => {
2406
- let t = s(e, O.take());
2407
- t && i(e.id, t);
2345
+ let e = c(t, O.take());
2346
+ e && s(t.id, e);
2408
2347
  },
2409
2348
  children: "Randomize preset"
2410
2349
  }),
2411
- /* @__PURE__ */ H(I, {
2350
+ /* @__PURE__ */ H(L, {
2412
2351
  tone: "primary",
2413
2352
  size: y,
2414
2353
  className: "w-full",
2415
- onClick: (t) => t.altKey ? M(u(x, e)) : j(u(x, e), void 0, { withFilters: !0 }),
2354
+ onClick: (e) => e.altKey ? N(f(x, t)) : le(f(x, t), void 0, { withFilters: !0 }),
2416
2355
  children: "Randomize all"
2417
2356
  }),
2418
- k.length > 0 && /* @__PURE__ */ U("div", {
2357
+ j.length > 0 && /* @__PURE__ */ U("div", {
2419
2358
  className: "grid grid-cols-2 gap-2",
2420
- children: [k.map((e) => /* @__PURE__ */ H(I, {
2359
+ children: [j.map((e) => /* @__PURE__ */ H(L, {
2421
2360
  tone: "primary",
2422
2361
  size: y,
2423
- onClick: (t) => t.altKey ? M(e.params) : j(e.params, e),
2362
+ onClick: (t) => t.altKey ? N(e.params) : le(e.params, e),
2424
2363
  children: e.label
2425
- }, e.id)), e.loopId === "math-expression" && /* @__PURE__ */ H(I, {
2364
+ }, e.id)), t.loopId === "math-expression" && /* @__PURE__ */ H(L, {
2426
2365
  tone: "primary",
2427
2366
  size: y,
2428
- onClick: (t) => {
2429
- if (t.altKey) return M(k.find((e) => e.id === "Expression")?.params ?? []);
2367
+ onClick: (e) => {
2368
+ if (e.altKey) return N(j.find((e) => e.id === "Expression")?.params ?? []);
2430
2369
  let n = O.take();
2431
- i(e.id, {
2432
- expr: re(l(n >>> 0)),
2370
+ s(t.id, {
2371
+ expr: ae(u(n >>> 0)),
2433
2372
  _rollSeed: n
2434
2373
  });
2435
2374
  },
2436
2375
  children: "Wild"
2437
2376
  })]
2438
2377
  }),
2439
- !v && /* @__PURE__ */ H(p, { seed: O }),
2440
- e.loopId === "pattern-rules" && (e.render ?? "tiles") === "tiles" && /* @__PURE__ */ H(ct, {
2441
- layer: e,
2442
- patch: r,
2378
+ !v && /* @__PURE__ */ H(ee, { seed: O }),
2379
+ t.loopId === "pattern-rules" && (t.render ?? "tiles") === "tiles" && /* @__PURE__ */ H(ct, {
2380
+ layer: t,
2381
+ patch: i,
2443
2382
  seed: O
2444
2383
  })
2445
2384
  ] }),
2446
- (h === "style" || h === "labs-effect") && /* @__PURE__ */ U(V, { children: [
2447
- /* @__PURE__ */ H(F, {
2385
+ (m === "style" || m === "labs-effect") && /* @__PURE__ */ U(V, { children: [
2386
+ /* @__PURE__ */ H(A, {
2448
2387
  schema: x,
2449
- layer: e,
2388
+ layer: t,
2450
2389
  setProp: P,
2451
- palette: c,
2452
- renderAnimate: m,
2390
+ palette: l,
2391
+ renderAnimate: d,
2453
2392
  tab: "style",
2454
2393
  inline: v
2455
2394
  }),
2456
- e.loopId === "pattern-rules" && /* @__PURE__ */ H(dt, {
2457
- layer: e,
2458
- patch: r
2395
+ t.loopId === "pattern-rules" && /* @__PURE__ */ H(dt, {
2396
+ layer: t,
2397
+ patch: i
2459
2398
  }),
2460
- e.loopId === "math-curves" && /* @__PURE__ */ H(ft, {
2461
- layer: e,
2462
- patch: r
2399
+ t.loopId === "math-curves" && /* @__PURE__ */ H(ft, {
2400
+ layer: t,
2401
+ patch: i
2463
2402
  }),
2464
- e.loopId === "math-expression" && /* @__PURE__ */ U("div", {
2403
+ t.loopId === "math-expression" && /* @__PURE__ */ U("div", {
2465
2404
  className: "grid grid-cols-2 gap-2",
2466
- children: [/* @__PURE__ */ H(I, {
2405
+ children: [/* @__PURE__ */ H(L, {
2467
2406
  tone: "primary",
2468
2407
  size: y,
2469
- onClick: () => i(e.id, ne(e)),
2408
+ onClick: () => s(t.id, re(t)),
2470
2409
  children: "Fit"
2471
- }), /* @__PURE__ */ H(I, {
2410
+ }), /* @__PURE__ */ H(L, {
2472
2411
  tone: "primary",
2473
2412
  size: y,
2474
- onClick: () => M(k.find((e) => e.id === "View")?.params ?? []),
2413
+ onClick: () => N(j.find((e) => e.id === "View")?.params ?? []),
2475
2414
  children: "Reset"
2476
2415
  })]
2477
2416
  })
2478
2417
  ] }),
2479
- h === "anim" && /* @__PURE__ */ U(V, { children: [
2480
- A && /* @__PURE__ */ U(V, { children: [
2418
+ m === "anim" && /* @__PURE__ */ U(V, { children: [
2419
+ M && /* @__PURE__ */ U(V, { children: [
2481
2420
  /* @__PURE__ */ H("span", {
2482
2421
  className: "kol-helper-10 text-meta",
2483
2422
  children: "Motion"
@@ -2489,9 +2428,9 @@ function Mt({ layer: e, setProp: n, patch: r, updateLayer: i, palette: c, render
2489
2428
  variant: "subtle",
2490
2429
  size: y,
2491
2430
  className: "w-full",
2492
- options: kt(A.frame, e._framePreset),
2493
- value: e._framePreset ?? "custom",
2494
- onChange: de("_framePreset", A.frame)
2431
+ options: kt(M.frame, t._framePreset),
2432
+ value: t._framePreset ?? "custom",
2433
+ onChange: fe("_framePreset", M.frame)
2495
2434
  })
2496
2435
  }),
2497
2436
  /* @__PURE__ */ H($, {
@@ -2501,51 +2440,51 @@ function Mt({ layer: e, setProp: n, patch: r, updateLayer: i, palette: c, render
2501
2440
  variant: "subtle",
2502
2441
  size: y,
2503
2442
  className: "w-full",
2504
- options: kt(A.form, e._formPreset),
2505
- value: e._formPreset ?? "custom",
2506
- onChange: de("_formPreset", A.form)
2443
+ options: kt(M.form, t._formPreset),
2444
+ value: t._formPreset ?? "custom",
2445
+ onChange: fe("_formPreset", M.form)
2507
2446
  })
2508
2447
  })
2509
2448
  ] }),
2510
- /* @__PURE__ */ H(fe, {
2511
- layer: e,
2449
+ /* @__PURE__ */ H(pe, {
2450
+ layer: t,
2512
2451
  schema: x,
2513
2452
  setProp: P
2514
2453
  }),
2515
- /* @__PURE__ */ H(F, {
2454
+ /* @__PURE__ */ H(A, {
2516
2455
  schema: x,
2517
- layer: e,
2456
+ layer: t,
2518
2457
  setProp: P,
2519
- palette: c,
2520
- renderAnimate: m,
2458
+ palette: l,
2459
+ renderAnimate: d,
2521
2460
  tab: "anim",
2522
2461
  inline: v
2523
2462
  }),
2524
2463
  _e && /* @__PURE__ */ H(ot, {
2525
- layer: e,
2526
- patch: r,
2464
+ layer: t,
2465
+ patch: i,
2527
2466
  defaultDuration: b?.duration ?? 8
2528
2467
  }),
2529
- L && /* @__PURE__ */ H(F, {
2530
- schema: L,
2531
- layer: e,
2468
+ F && /* @__PURE__ */ H(A, {
2469
+ schema: F,
2470
+ layer: t,
2532
2471
  setProp: n,
2533
- palette: c,
2534
- renderAnimate: m,
2472
+ palette: l,
2473
+ renderAnimate: d,
2535
2474
  inline: v
2536
2475
  }),
2537
2476
  ge && /* @__PURE__ */ H(st, {
2538
- layer: e,
2539
- patch: r,
2540
- camParams: me,
2541
- isEngine: z,
2542
- showHeader: !L
2477
+ layer: t,
2478
+ patch: i,
2479
+ camParams: he,
2480
+ isEngine: I,
2481
+ showHeader: !F
2543
2482
  })
2544
2483
  ] }),
2545
2484
  /* @__PURE__ */ H(pt, {
2546
- layer: e,
2547
- patch: r,
2548
- tab: h === "labs-effect" ? "style" : h
2485
+ layer: t,
2486
+ patch: i,
2487
+ tab: m === "labs-effect" ? "style" : m
2549
2488
  })
2550
2489
  ] });
2551
2490
  }
@@ -2553,26 +2492,26 @@ function Mt({ layer: e, setProp: n, patch: r, updateLayer: i, palette: c, render
2553
2492
  //#region src/packs/generators.js
2554
2493
  var Nt = {
2555
2494
  layerTypes: ["loop", "misc"],
2556
- loopById: se,
2557
- loopDrawParams: A,
2558
- resolveCameraKeys: ce,
2559
- loopBgToggleable: ie,
2560
- presetById: ae,
2495
+ loopById: ce,
2496
+ loopDrawParams: ue,
2497
+ resolveCameraKeys: se,
2498
+ loopBgToggleable: oe,
2499
+ presetById: T,
2561
2500
  presetParams: j,
2562
- presetsInGroup: T,
2563
- presetsInSub: E,
2564
- presetLayerPatch: O,
2565
- isToolPreset: oe,
2566
- groupById: k,
2567
- drawLoopFrame: x,
2568
- GENERATIVE_TREE: we,
2569
- MISC_TREE: Te,
2570
- THEME_OPTIONS: le,
2501
+ presetsInGroup: k,
2502
+ presetsInSub: O,
2503
+ presetLayerPatch: D,
2504
+ isToolPreset: M,
2505
+ groupById: w,
2506
+ drawLoopFrame: N,
2507
+ GENERATIVE_TREE: P,
2508
+ MISC_TREE: F,
2509
+ THEME_OPTIONS: e,
2571
2510
  buildParatypeFlattenGroup: je,
2572
2511
  LoopPicker: Me,
2573
2512
  LoopFields: Mt,
2574
- loadGlHost: () => import("./host-BE7dtdx9.js")
2513
+ loadGlHost: () => import("./host-B4SRaN9h.js")
2575
2514
  };
2576
- i("generators", Nt);
2515
+ d("generators", Nt);
2577
2516
  //#endregion
2578
- export { rt as a, Te as c, at as i, Mt as n, nt as o, it as r, we as s, Nt as t };
2517
+ export { rt as a, at as i, Mt as n, nt as o, it as r, Nt as t };