@kolkrabbi/design-editor 0.48.0 → 0.49.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.
- package/README.md +18 -0
- package/dist/{BindDot-Cx-M0iQt.js → BindDot-BAAc-KSs.js} +1 -1
- package/dist/{KolboxView-BjYfn_tl.js → KolboxView-DxcGz6MC.js} +3137 -5182
- package/dist/{Timeline-CRr43b4B.js → Timeline-BH3BF2m4.js} +2 -2
- package/dist/{TreePicker-DXsAlHK6.js → TreePicker-RImJ6I_0.js} +11 -11
- package/dist/{core-BbKj9Svq.js → core-DyfKZlBI.js} +2213 -2185
- package/dist/core.js +5 -5
- package/dist/design-editor.css +1 -1
- package/dist/design-editor.js +6 -6
- package/dist/{effectCategories-wHY9ih8L.js → effectCategories-B5jhXEyy.js} +21 -21
- package/dist/effects-BAwNQ8Kj.js +447 -0
- package/dist/effects.js +1 -1
- package/dist/{generators-BtRZ3Stj.js → generators-OCg5XjTX.js} +838 -838
- package/dist/generators.js +1 -1
- package/dist/{host-II9SeVCH.js → host-DS-pAjP0.js} +2 -2
- package/dist/kolbox-pages.js +2218 -0
- package/dist/kolbox.css +1 -1
- package/dist/{morphStore-s-rjCe-y.js → morphStore-D6xiYiR_.js} +1 -1
- package/dist/{motion-CKtZAccJ.js → motion-p5pHH9_J.js} +95 -95
- package/dist/motion.js +1 -1
- package/dist/portable-Bs8ieXiu.js +2128 -0
- package/dist/{rolls-Cnu6g8th.js → rolls-ZToBSscx.js} +1 -1
- package/dist/{src-3UkpFoNW.js → src-DEx6Oh0D.js} +416 -416
- package/dist/{store-YIW6P2zN.js → store-BDAxvWTE.js} +1 -1
- package/dist/{useLayerEdit-W_Tf3adq.js → useLayerEdit-D6vwfIoB.js} +90 -90
- package/package.json +9 -6
- package/dist/effects-D7J0e5xl.js +0 -447
|
@@ -1,16 +1,16 @@
|
|
|
1
1
|
import { E as e, O as t, i as n, j as r, o as i, r as a, w as o } from "./__vite-browser-external-y2xWjzgx.js";
|
|
2
|
-
import { B as s, Bt as c, C as l, D as u, F as d, Ft as f,
|
|
3
|
-
import { c as
|
|
4
|
-
import { C as
|
|
5
|
-
import { n as
|
|
6
|
-
import { B as
|
|
7
|
-
import { h as
|
|
8
|
-
import { BezierPathEditor as
|
|
2
|
+
import { B as s, Bt as c, C as l, D as u, F as d, Ft as f, Ht as p, I as m, It as h, J as g, Jn as _, Kn as v, L as y, Lt as b, Nr as x, Nt as S, Pr as C, Pt as w, Qn as T, Qt as E, Rt as D, S as ee, Ut as O, Vt as te, Wt as ne, X as re, Xn as ie, Zn as ae, a as oe, an as se, at as ce, c as le, d as ue, en as de, f as k, gr as fe, hn as pe, l as me, m as he, n as ge, nr as A, o as _e, p as ve, q as ye, qn as be, s as xe, t as Se, u as Ce, x as we, xn as j, zt as Te } from "./rolls-ZToBSscx.js";
|
|
3
|
+
import { c as Ee, n as De, t as Oe } from "./useLayerEdit-D6vwfIoB.js";
|
|
4
|
+
import { C as ke, Ct as Ae, D as je, E as Me, F as Ne, I as Pe, L as Fe, M as Ie, O as Le, P as Re, S as ze, St as Be, T as Ve, _ as He, _t as Ue, b as We, bt as Ge, d as Ke, dt as qe, f as Je, ft as Ye, gt as Xe, h as Ze, ht as Qe, l as $e, m as et, mt as tt, n as nt, pt as rt, r as it, t as at, ut as ot, v as st, vt as ct, w as lt, wt as ut, x as dt, xt as ft, y as pt } from "./effectCategories-B5jhXEyy.js";
|
|
5
|
+
import { n as mt, t as ht } from "./TreePicker-RImJ6I_0.js";
|
|
6
|
+
import { B as gt, I as _t, a as vt, c as yt, g as bt, i as xt, o as St, r as Ct, s as wt, u as Tt } from "./store-BDAxvWTE.js";
|
|
7
|
+
import { h as Et, r as Dt, s as Ot, t as kt, u as At } from "./morphStore-D6xiYiR_.js";
|
|
8
|
+
import { BezierPathEditor as jt, Button as M, ButtonGroup as Mt, CurveEditor as Nt, Divider as Pt, Dropdown as Ft, FullscreenOverlay as It, Input as Lt, KeyframeEditor as Rt, LabeledControl as N, LabeledControlSection as zt, ModalDialog as Bt, ModalShell as Vt, SettingsDisclosure as Ht, SettingsFieldMap as Ut, SettingsGrid as Wt, SettingsLights as Gt, SettingsPoint as Kt, SettingsRamp as qt, SettingsRampHead as Jt, SettingsRow as Yt, ShellSearchOverlay as Xt, Slider as Zt, StepList as Qt, TabsRow as $t, ToggleSwitch as en, Tooltip as tn, XYPad as nn } from "@kolkrabbi/kol-component";
|
|
9
9
|
import { Fragment as rn, useCallback as an, useEffect as on, useId as sn, useMemo as cn, useRef as ln, useState as un } from "react";
|
|
10
|
-
import { Fragment as
|
|
11
|
-
import { PropertyRail as
|
|
10
|
+
import { Fragment as P, jsx as F, jsxs as I } from "react/jsx-runtime";
|
|
11
|
+
import { PropertyRail as dn } from "@kolkrabbi/kol-shell";
|
|
12
12
|
//#region src/loops/taxonomy.js
|
|
13
|
-
var
|
|
13
|
+
var fn = [
|
|
14
14
|
{
|
|
15
15
|
label: "Scanline",
|
|
16
16
|
groups: ["scanline"]
|
|
@@ -75,31 +75,31 @@ var pn = [
|
|
|
75
75
|
softforms3d: "Soft forms"
|
|
76
76
|
}
|
|
77
77
|
}
|
|
78
|
-
],
|
|
78
|
+
], pn = [{
|
|
79
79
|
label: "Para Type",
|
|
80
80
|
groups: ["paratype"]
|
|
81
|
-
}],
|
|
81
|
+
}], mn = fn, hn = {
|
|
82
82
|
optic: "Pattern · Effects",
|
|
83
83
|
paratype: "Para Type · Misc",
|
|
84
84
|
distress: "Distressor · Vector",
|
|
85
85
|
modulator: "Modulator · Vector"
|
|
86
|
-
},
|
|
87
|
-
function
|
|
88
|
-
let t = { ...
|
|
89
|
-
for (let n of Object.keys(
|
|
86
|
+
}, gn = Object.fromEntries(ot.params.map((e) => [e.key, e.default]));
|
|
87
|
+
function _n(e) {
|
|
88
|
+
let t = { ...gn };
|
|
89
|
+
for (let n of Object.keys(gn)) {
|
|
90
90
|
let r = e[n];
|
|
91
91
|
r != null && typeof r != "object" && (t[n] = r);
|
|
92
92
|
}
|
|
93
93
|
return t;
|
|
94
94
|
}
|
|
95
|
-
function
|
|
95
|
+
function vn(e, t) {
|
|
96
96
|
let n = t.stemWidth ?? 18, r = 0;
|
|
97
97
|
return (t.serif ?? 0) > 0 && (r = Math.max(2, n * .7) * t.serif + (t.jut ?? 0) * n * 1.5 + 1), e === "i" && (r = Math.max(r, n * .1 + 1)), r;
|
|
98
98
|
}
|
|
99
|
-
var
|
|
100
|
-
function
|
|
99
|
+
var yn = (e) => Number(e.toFixed(2));
|
|
100
|
+
function bn(e, t, n) {
|
|
101
101
|
if (!e || e.loopId !== "paratype-glyph") return null;
|
|
102
|
-
let r = Math.max(1, e.w ?? 480), i = Math.max(1, e.h ?? 480), a =
|
|
102
|
+
let r = Math.max(1, e.w ?? 480), i = Math.max(1, e.h ?? 480), a = _n(e), o = qe(a, r, i);
|
|
103
103
|
if (!o.length) return null;
|
|
104
104
|
let s = [];
|
|
105
105
|
t.bg && s.push({
|
|
@@ -116,7 +116,7 @@ function xn(e, t, n) {
|
|
|
116
116
|
blend: "normal"
|
|
117
117
|
});
|
|
118
118
|
for (let e of o) {
|
|
119
|
-
let r =
|
|
119
|
+
let r = vn(e.name, a) + 1.5, i = 1.5, o = e.gw + r * 2, c = e.gh + i * 2, l = e.g.paths.map((e) => `<path d="${e.d.replace(/\s+/g, " ").trim()}"${e.fillRule ? ` fill-rule="${e.fillRule}"` : ""} fill="currentColor"/>`).join(""), u = `<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 ${yn(o)} ${yn(c)}" preserveAspectRatio="none"><g transform="translate(${yn(r)} ${yn(e.y1 + i)}) scale(1 -1)">${l}</g></svg>`;
|
|
120
120
|
s.push({
|
|
121
121
|
id: n("shape"),
|
|
122
122
|
type: "shape",
|
|
@@ -124,10 +124,10 @@ function xn(e, t, n) {
|
|
|
124
124
|
svg: u,
|
|
125
125
|
fit: "fill",
|
|
126
126
|
color: t.fg,
|
|
127
|
-
x:
|
|
128
|
-
y:
|
|
129
|
-
w: Math.max(1,
|
|
130
|
-
h: Math.max(1,
|
|
127
|
+
x: yn(e.tx - r * e.s),
|
|
128
|
+
y: yn(e.ty - (e.y1 + i) * e.s),
|
|
129
|
+
w: Math.max(1, yn(o * e.s)),
|
|
130
|
+
h: Math.max(1, yn(c * e.s)),
|
|
131
131
|
visible: !0,
|
|
132
132
|
opacity: 1,
|
|
133
133
|
blend: "normal"
|
|
@@ -148,7 +148,7 @@ function xn(e, t, n) {
|
|
|
148
148
|
}
|
|
149
149
|
//#endregion
|
|
150
150
|
//#region src/editor/labs/presetStep.js
|
|
151
|
-
function
|
|
151
|
+
function xn(e, t) {
|
|
152
152
|
return {
|
|
153
153
|
loopGroup: t,
|
|
154
154
|
presetId: e.id,
|
|
@@ -157,24 +157,24 @@ function Sn(e, t) {
|
|
|
157
157
|
_framePreset: "custom",
|
|
158
158
|
_formPreset: "custom",
|
|
159
159
|
_lookPreset: "custom",
|
|
160
|
-
...
|
|
160
|
+
...Ve(e)
|
|
161
161
|
};
|
|
162
162
|
}
|
|
163
|
-
function
|
|
163
|
+
function Sn(e, t, n = "preset") {
|
|
164
164
|
if (!e?.loopGroup) return null;
|
|
165
|
-
let r = e.loopGroup, i =
|
|
165
|
+
let r = e.loopGroup, i = Me(r);
|
|
166
166
|
if (!i.length) return null;
|
|
167
167
|
let a = i.find((t) => t.id === e.presetId) ?? i[0], o = (e, t) => (e % t + t) % t;
|
|
168
168
|
if (n === "category") {
|
|
169
169
|
let e = [...new Set(i.map((e) => e.sub).filter(Boolean))];
|
|
170
170
|
if (e.length < 2) return null;
|
|
171
171
|
let n = e[o(e.indexOf(a.sub) + t, e.length)];
|
|
172
|
-
return
|
|
172
|
+
return xn(i.find((e) => e.sub === n), r);
|
|
173
173
|
}
|
|
174
174
|
let s = a.sub ? i.filter((e) => e.sub === a.sub) : i;
|
|
175
|
-
return s.length < 2 ? null :
|
|
175
|
+
return s.length < 2 ? null : xn(s[o(s.indexOf(a) + t, s.length)], r);
|
|
176
176
|
}
|
|
177
|
-
var
|
|
177
|
+
var Cn = {
|
|
178
178
|
h: ["preset", -1],
|
|
179
179
|
ArrowLeft: ["preset", -1],
|
|
180
180
|
l: ["preset", 1],
|
|
@@ -184,33 +184,33 @@ var wn = {
|
|
|
184
184
|
j: ["category", 1],
|
|
185
185
|
ArrowDown: ["category", 1]
|
|
186
186
|
};
|
|
187
|
-
function
|
|
187
|
+
function wn(e, t, n) {
|
|
188
188
|
let r = e?.loopGroup;
|
|
189
189
|
if (!r) return !1;
|
|
190
|
-
let i =
|
|
191
|
-
return t === "type" ? n.some((e) => e !== r &&
|
|
190
|
+
let i = Me(r).filter((e) => !pt(e)), a = i.find((t) => t.id === e.presetId) ?? i[0];
|
|
191
|
+
return t === "type" ? n.some((e) => e !== r && Me(e).some((e) => !pt(e))) : t === "category" ? new Set(i.map((e) => e.sub).filter((e) => e && e !== a?.sub)).size > 0 : i.some((e) => e.id !== a?.id && (!a?.sub || e.sub === a.sub));
|
|
192
192
|
}
|
|
193
|
-
function
|
|
193
|
+
function Tn(e, t, n, r) {
|
|
194
194
|
let i = e?.loopGroup;
|
|
195
195
|
if (!i) return null;
|
|
196
|
-
let a = (e) => e[Math.floor(n() * e.length)], o = (e) =>
|
|
196
|
+
let a = (e) => e[Math.floor(n() * e.length)], o = (e) => Me(e).filter((e) => !pt(e));
|
|
197
197
|
if (t === "type") {
|
|
198
198
|
let e = r.filter((e) => e !== i && o(e).length);
|
|
199
199
|
if (!e.length) return null;
|
|
200
200
|
let t = a(e);
|
|
201
|
-
return
|
|
201
|
+
return xn(a(o(t)), t);
|
|
202
202
|
}
|
|
203
203
|
let s = o(i), c = s.find((t) => t.id === e.presetId) ?? s[0];
|
|
204
204
|
if (t === "category") {
|
|
205
205
|
let e = [...new Set(s.map((e) => e.sub).filter((e) => e && e !== c?.sub))];
|
|
206
206
|
if (!e.length) return null;
|
|
207
207
|
let t = a(e);
|
|
208
|
-
return
|
|
208
|
+
return xn(a(s.filter((e) => e.sub === t)), i);
|
|
209
209
|
}
|
|
210
210
|
let l = s.filter((e) => e.id !== c?.id && (!c?.sub || e.sub === c.sub));
|
|
211
|
-
return l.length ?
|
|
211
|
+
return l.length ? xn(a(l), i) : null;
|
|
212
212
|
}
|
|
213
|
-
function
|
|
213
|
+
function En(e, t, n) {
|
|
214
214
|
let r = {};
|
|
215
215
|
for (let i of t) {
|
|
216
216
|
if (i.type !== "range" || i.noRandom || i.min == null || i.max == null) continue;
|
|
@@ -221,33 +221,33 @@ function Dn(e, t, n) {
|
|
|
221
221
|
}
|
|
222
222
|
return r;
|
|
223
223
|
}
|
|
224
|
-
var
|
|
224
|
+
var Dn = null, On = () => Dn ??= [...it(Je).filter((e) => !e.rack).map((e) => ({
|
|
225
225
|
id: e.id,
|
|
226
226
|
filters: e.filters
|
|
227
|
-
})), ...
|
|
227
|
+
})), ...at.map((e) => ({
|
|
228
228
|
id: e.id,
|
|
229
|
-
filters:
|
|
229
|
+
filters: Ke(e, Je)
|
|
230
230
|
}))].filter((e) => e.filters.length);
|
|
231
|
-
function
|
|
232
|
-
let r = (e) => e[Math.floor(n() * e.length)], i =
|
|
231
|
+
function kn(e, t, n) {
|
|
232
|
+
let r = (e) => e[Math.floor(n() * e.length)], i = nt(e);
|
|
233
233
|
if (t === "type") {
|
|
234
|
-
let e =
|
|
234
|
+
let e = On().filter((e) => e.id !== i);
|
|
235
235
|
return e.length ? r(r(e).filters).id : null;
|
|
236
236
|
}
|
|
237
|
-
let a =
|
|
237
|
+
let a = On().find((e) => e.id === i)?.filters.filter((t) => t.id !== e) ?? [];
|
|
238
238
|
return a.length ? r(a).id : null;
|
|
239
239
|
}
|
|
240
|
-
function
|
|
241
|
-
let r =
|
|
240
|
+
function An(e, t, n) {
|
|
241
|
+
let r = $e(e?.id), i = (e?.params.find((e) => e.key === r)?.options ?? []).map((e) => typeof e == "object" ? e.value : e).filter((e) => e !== t[r]);
|
|
242
242
|
return i.length ? i[Math.floor(n() * i.length)] : null;
|
|
243
243
|
}
|
|
244
|
-
function
|
|
245
|
-
return e ? t === "type" ?
|
|
244
|
+
function jn(e, t) {
|
|
245
|
+
return e ? t === "type" ? On().length > 1 : t === "category" ? (On().find((t) => t.id === nt(e.id))?.filters.length ?? 0) > 1 : t === "preset" ? !!$e(e.id) : !0 : !1;
|
|
246
246
|
}
|
|
247
247
|
//#endregion
|
|
248
248
|
//#region src/editor/compose/inspectors/LoopPicker.jsx
|
|
249
|
-
function
|
|
250
|
-
let { updateLayer: i } =
|
|
249
|
+
function Mn({ layer: e, tree: t = mn, inline: n = !0, about: r = null }) {
|
|
250
|
+
let { updateLayer: i } = g(), a = y(), o = e.loopGroup ?? "shape", s = t.find((e) => e.groups.includes(o)) ?? null, c = Me(o), l = c.find((t) => t.id === e.presetId), u = [...new Set(c.map((e) => e.sub).filter(Boolean))], d = l?.sub ?? u[0], f = u.length ? c.filter((e) => e.sub === d) : c, p = (t, n = o) => {
|
|
251
251
|
t && i(e.id, {
|
|
252
252
|
loopGroup: n,
|
|
253
253
|
presetId: t.id,
|
|
@@ -256,16 +256,16 @@ function Nn({ layer: e, tree: t = hn, inline: n = !0, about: r = null }) {
|
|
|
256
256
|
_framePreset: "custom",
|
|
257
257
|
_formPreset: "custom",
|
|
258
258
|
_lookPreset: "custom",
|
|
259
|
-
...
|
|
259
|
+
...Ve(t)
|
|
260
260
|
});
|
|
261
261
|
};
|
|
262
|
-
return /* @__PURE__ */
|
|
263
|
-
t.length > 1 || !s ? /* @__PURE__ */
|
|
262
|
+
return /* @__PURE__ */ I(P, { children: [
|
|
263
|
+
t.length > 1 || !s ? /* @__PURE__ */ F(mt, {
|
|
264
264
|
label: "Type",
|
|
265
265
|
inline: n,
|
|
266
|
-
children: /* @__PURE__ */
|
|
266
|
+
children: /* @__PURE__ */ I("div", {
|
|
267
267
|
className: "flex flex-col gap-1 w-full",
|
|
268
|
-
children: [s ? /* @__PURE__ */
|
|
268
|
+
children: [s ? /* @__PURE__ */ F(ht, {
|
|
269
269
|
options: t.map((e) => ({
|
|
270
270
|
value: e.label,
|
|
271
271
|
label: e.label
|
|
@@ -273,22 +273,22 @@ function Nn({ layer: e, tree: t = hn, inline: n = !0, about: r = null }) {
|
|
|
273
273
|
value: s.label,
|
|
274
274
|
onChange: (e) => {
|
|
275
275
|
let n = t.find((t) => t.label === e);
|
|
276
|
-
n &&
|
|
276
|
+
n && p(Me(n.groups[0])[0], n.groups[0]);
|
|
277
277
|
}
|
|
278
|
-
}) : /* @__PURE__ */
|
|
278
|
+
}) : /* @__PURE__ */ F("span", {
|
|
279
279
|
className: "kol-helper-12 text-meta px-1",
|
|
280
|
-
children:
|
|
281
|
-
}), s && s.groups.length > 1 && /* @__PURE__ */
|
|
280
|
+
children: hn[o] ?? He(o).label
|
|
281
|
+
}), s && s.groups.length > 1 && /* @__PURE__ */ F(ht, {
|
|
282
282
|
options: s.groups.map((e) => ({
|
|
283
283
|
value: e,
|
|
284
|
-
label: s.labels?.[e] ??
|
|
284
|
+
label: s.labels?.[e] ?? He(e).label
|
|
285
285
|
})),
|
|
286
286
|
value: o,
|
|
287
|
-
onChange: (e) =>
|
|
287
|
+
onChange: (e) => p(Me(e)[0], e)
|
|
288
288
|
})]
|
|
289
289
|
})
|
|
290
290
|
}) : null,
|
|
291
|
-
u.length > 1 && /* @__PURE__ */
|
|
291
|
+
u.length > 1 && /* @__PURE__ */ F(mt, {
|
|
292
292
|
inline: n,
|
|
293
293
|
label: "Category",
|
|
294
294
|
options: u.map((e) => ({
|
|
@@ -296,38 +296,38 @@ function Nn({ layer: e, tree: t = hn, inline: n = !0, about: r = null }) {
|
|
|
296
296
|
label: e
|
|
297
297
|
})),
|
|
298
298
|
value: d,
|
|
299
|
-
onChange: (e) =>
|
|
299
|
+
onChange: (e) => p(c.find((t) => t.sub === e))
|
|
300
300
|
}),
|
|
301
|
-
/* @__PURE__ */
|
|
301
|
+
/* @__PURE__ */ F(mt, {
|
|
302
302
|
inline: n,
|
|
303
303
|
label: "Preset",
|
|
304
|
-
children: /* @__PURE__ */
|
|
304
|
+
children: /* @__PURE__ */ I("div", {
|
|
305
305
|
className: "flex w-full gap-1",
|
|
306
306
|
children: [
|
|
307
|
-
f.length > 1 && /* @__PURE__ */
|
|
307
|
+
f.length > 1 && /* @__PURE__ */ F(v, {
|
|
308
308
|
size: a,
|
|
309
309
|
iconOnly: "chevron-left",
|
|
310
310
|
"aria-label": "Previous preset (H)",
|
|
311
311
|
onClick: () => {
|
|
312
|
-
let t =
|
|
312
|
+
let t = Sn(e, -1);
|
|
313
313
|
t && i(e.id, t);
|
|
314
314
|
}
|
|
315
315
|
}),
|
|
316
|
-
/* @__PURE__ */
|
|
316
|
+
/* @__PURE__ */ F(ht, {
|
|
317
317
|
className: "flex-1 min-w-0",
|
|
318
318
|
options: f.map((e) => ({
|
|
319
319
|
value: e.id,
|
|
320
320
|
label: e.label
|
|
321
321
|
})),
|
|
322
322
|
value: e.presetId,
|
|
323
|
-
onChange: (e) =>
|
|
323
|
+
onChange: (e) => p(c.find((t) => t.id === e))
|
|
324
324
|
}),
|
|
325
|
-
f.length > 1 && /* @__PURE__ */
|
|
325
|
+
f.length > 1 && /* @__PURE__ */ F(v, {
|
|
326
326
|
size: a,
|
|
327
327
|
iconOnly: "chevron-right",
|
|
328
328
|
"aria-label": "Next preset (L)",
|
|
329
329
|
onClick: () => {
|
|
330
|
-
let t =
|
|
330
|
+
let t = Sn(e, 1);
|
|
331
331
|
t && i(e.id, t);
|
|
332
332
|
}
|
|
333
333
|
}),
|
|
@@ -339,45 +339,45 @@ function Nn({ layer: e, tree: t = hn, inline: n = !0, about: r = null }) {
|
|
|
339
339
|
}
|
|
340
340
|
//#endregion
|
|
341
341
|
//#region src/editor/params/RollScopesDialog.jsx
|
|
342
|
-
function
|
|
342
|
+
function Nn({ open: t, onClose: n, schema: r, layer: i, size: a = "md" }) {
|
|
343
343
|
if (e(), !t) return null;
|
|
344
|
-
let s =
|
|
345
|
-
return /* @__PURE__ */
|
|
344
|
+
let s = _e(r ?? [], i);
|
|
345
|
+
return /* @__PURE__ */ F(It, {
|
|
346
346
|
open: !0,
|
|
347
347
|
scrim: !0,
|
|
348
348
|
onClose: n,
|
|
349
|
-
children: /* @__PURE__ */
|
|
349
|
+
children: /* @__PURE__ */ I(Vt, {
|
|
350
350
|
variant: "bordered",
|
|
351
351
|
className: "kol-roll-scopes gap-4 p-5",
|
|
352
352
|
style: { width: "min(420px, calc(100vw - 32px))" },
|
|
353
353
|
children: [
|
|
354
|
-
/* @__PURE__ */
|
|
354
|
+
/* @__PURE__ */ F("p", {
|
|
355
355
|
className: "kol-eyebrow text-fg-96",
|
|
356
356
|
children: "Randomize all rolls"
|
|
357
357
|
}),
|
|
358
|
-
/* @__PURE__ */
|
|
358
|
+
/* @__PURE__ */ I(zt, {
|
|
359
359
|
divided: !0,
|
|
360
|
-
children: [s.map((e) => /* @__PURE__ */
|
|
360
|
+
children: [s.map((e) => /* @__PURE__ */ F(Yt, {
|
|
361
361
|
label: e.label,
|
|
362
|
-
children: /* @__PURE__ */
|
|
363
|
-
checked:
|
|
364
|
-
onChange: (t) =>
|
|
362
|
+
children: /* @__PURE__ */ F(en, {
|
|
363
|
+
checked: le(e.id),
|
|
364
|
+
onChange: (t) => me(e.id, t),
|
|
365
365
|
"aria-label": e.label
|
|
366
366
|
})
|
|
367
|
-
}, e.id)), /* @__PURE__ */
|
|
367
|
+
}, e.id)), /* @__PURE__ */ F(Yt, {
|
|
368
368
|
label: "Effects",
|
|
369
|
-
children: /* @__PURE__ */
|
|
370
|
-
checked:
|
|
369
|
+
children: /* @__PURE__ */ F(en, {
|
|
370
|
+
checked: xe(),
|
|
371
371
|
onChange: (e) => o("rollEffects", !!e),
|
|
372
372
|
"aria-label": "Effects"
|
|
373
373
|
})
|
|
374
374
|
})]
|
|
375
375
|
}),
|
|
376
|
-
/* @__PURE__ */
|
|
376
|
+
/* @__PURE__ */ F("p", {
|
|
377
377
|
className: "kol-mono-12 text-meta",
|
|
378
378
|
children: "A scope switched off still rolls from its own button."
|
|
379
379
|
}),
|
|
380
|
-
/* @__PURE__ */
|
|
380
|
+
/* @__PURE__ */ F(M, {
|
|
381
381
|
tone: "primary",
|
|
382
382
|
size: a,
|
|
383
383
|
className: "w-full",
|
|
@@ -390,7 +390,7 @@ function Pn({ open: t, onClose: n, schema: r, layer: i, size: a = "md" }) {
|
|
|
390
390
|
}
|
|
391
391
|
//#endregion
|
|
392
392
|
//#region src/editor/params/motionPresets.js
|
|
393
|
-
var
|
|
393
|
+
var Pn = (e) => x("generators")?.loopById(e) ?? null, Fn = {
|
|
394
394
|
frame: [
|
|
395
395
|
{
|
|
396
396
|
id: "static",
|
|
@@ -456,7 +456,7 @@ var Fn = (e) => x("generators")?.loopById(e) ?? null, In = {
|
|
|
456
456
|
}
|
|
457
457
|
}
|
|
458
458
|
]
|
|
459
|
-
},
|
|
459
|
+
}, In = [
|
|
460
460
|
{
|
|
461
461
|
id: "static",
|
|
462
462
|
label: "Static",
|
|
@@ -510,7 +510,7 @@ var Fn = (e) => x("generators")?.loopById(e) ?? null, In = {
|
|
|
510
510
|
panDir: "anti"
|
|
511
511
|
}
|
|
512
512
|
}
|
|
513
|
-
],
|
|
513
|
+
], Ln = [
|
|
514
514
|
{
|
|
515
515
|
id: "static",
|
|
516
516
|
label: "Static",
|
|
@@ -623,7 +623,7 @@ var Fn = (e) => x("generators")?.loopById(e) ?? null, In = {
|
|
|
623
623
|
colorMix: 0
|
|
624
624
|
}
|
|
625
625
|
}
|
|
626
|
-
],
|
|
626
|
+
], Rn = [
|
|
627
627
|
{
|
|
628
628
|
id: "static",
|
|
629
629
|
label: "Static",
|
|
@@ -691,7 +691,7 @@ var Fn = (e) => x("generators")?.loopById(e) ?? null, In = {
|
|
|
691
691
|
stripeAngle: 135
|
|
692
692
|
}
|
|
693
693
|
}
|
|
694
|
-
],
|
|
694
|
+
], zn = [
|
|
695
695
|
{
|
|
696
696
|
id: "static",
|
|
697
697
|
label: "Static",
|
|
@@ -756,7 +756,7 @@ var Fn = (e) => x("generators")?.loopById(e) ?? null, In = {
|
|
|
756
756
|
stripeAngle: 45
|
|
757
757
|
}
|
|
758
758
|
}
|
|
759
|
-
],
|
|
759
|
+
], Bn = [
|
|
760
760
|
{
|
|
761
761
|
id: "static",
|
|
762
762
|
label: "Static",
|
|
@@ -793,7 +793,7 @@ var Fn = (e) => x("generators")?.loopById(e) ?? null, In = {
|
|
|
793
793
|
fieldCycles: 1
|
|
794
794
|
}
|
|
795
795
|
}
|
|
796
|
-
],
|
|
796
|
+
], Vn = [
|
|
797
797
|
{
|
|
798
798
|
id: "static",
|
|
799
799
|
label: "Static",
|
|
@@ -838,7 +838,7 @@ var Fn = (e) => x("generators")?.loopById(e) ?? null, In = {
|
|
|
838
838
|
fade: .4
|
|
839
839
|
}
|
|
840
840
|
}
|
|
841
|
-
],
|
|
841
|
+
], Hn = {
|
|
842
842
|
frame: [
|
|
843
843
|
{
|
|
844
844
|
id: "static",
|
|
@@ -981,7 +981,7 @@ var Fn = (e) => x("generators")?.loopById(e) ?? null, In = {
|
|
|
981
981
|
}
|
|
982
982
|
}
|
|
983
983
|
]
|
|
984
|
-
},
|
|
984
|
+
}, Un = {
|
|
985
985
|
frame: [
|
|
986
986
|
{
|
|
987
987
|
id: "static",
|
|
@@ -1055,7 +1055,7 @@ var Fn = (e) => x("generators")?.loopById(e) ?? null, In = {
|
|
|
1055
1055
|
}
|
|
1056
1056
|
}
|
|
1057
1057
|
]
|
|
1058
|
-
},
|
|
1058
|
+
}, Wn = {
|
|
1059
1059
|
frame: [
|
|
1060
1060
|
{
|
|
1061
1061
|
id: "static",
|
|
@@ -1142,7 +1142,7 @@ var Fn = (e) => x("generators")?.loopById(e) ?? null, In = {
|
|
|
1142
1142
|
}
|
|
1143
1143
|
}
|
|
1144
1144
|
]
|
|
1145
|
-
},
|
|
1145
|
+
}, Gn = {
|
|
1146
1146
|
frame: [
|
|
1147
1147
|
{
|
|
1148
1148
|
id: "static",
|
|
@@ -1224,7 +1224,7 @@ var Fn = (e) => x("generators")?.loopById(e) ?? null, In = {
|
|
|
1224
1224
|
}
|
|
1225
1225
|
}
|
|
1226
1226
|
]
|
|
1227
|
-
},
|
|
1227
|
+
}, Kn = {
|
|
1228
1228
|
frame: [
|
|
1229
1229
|
{
|
|
1230
1230
|
id: "static",
|
|
@@ -1294,30 +1294,30 @@ var Fn = (e) => x("generators")?.loopById(e) ?? null, In = {
|
|
|
1294
1294
|
}
|
|
1295
1295
|
]
|
|
1296
1296
|
};
|
|
1297
|
-
function
|
|
1297
|
+
function qn(e, t = {}) {
|
|
1298
1298
|
switch (e) {
|
|
1299
|
-
case "scanline": return
|
|
1299
|
+
case "scanline": return Fn;
|
|
1300
1300
|
case "pattern-rules": {
|
|
1301
1301
|
let e = t.render ?? "tiles", n = e === "field" && t.field === "organic";
|
|
1302
1302
|
return {
|
|
1303
|
-
frame: e === "tiles" ?
|
|
1304
|
-
form: e === "tiles" ?
|
|
1303
|
+
frame: e === "tiles" ? In : n ? zn : Rn,
|
|
1304
|
+
form: e === "tiles" ? Ln : e === "weave" ? Vn : Bn
|
|
1305
1305
|
};
|
|
1306
1306
|
}
|
|
1307
|
-
case "math-waveform": return
|
|
1308
|
-
case "math-surface": return
|
|
1309
|
-
case "math-field": return (t.kind ?? "scalar") === "complex" ?
|
|
1310
|
-
default: return
|
|
1307
|
+
case "math-waveform": return Hn;
|
|
1308
|
+
case "math-surface": return Un;
|
|
1309
|
+
case "math-field": return (t.kind ?? "scalar") === "complex" ? Gn : Wn;
|
|
1310
|
+
default: return Pn(e)?.params?.some((e) => e.key === "vpSpin") ? Kn : null;
|
|
1311
1311
|
}
|
|
1312
1312
|
}
|
|
1313
|
-
function
|
|
1313
|
+
function Jn(e) {
|
|
1314
1314
|
let t = /* @__PURE__ */ new Set();
|
|
1315
1315
|
for (let n of e ?? []) for (let e of Object.keys(n.params ?? {})) t.add(e);
|
|
1316
1316
|
return t;
|
|
1317
1317
|
}
|
|
1318
1318
|
//#endregion
|
|
1319
1319
|
//#region src/editor/params/lookPresets.js
|
|
1320
|
-
var
|
|
1320
|
+
var Yn = {
|
|
1321
1321
|
Spectrum: {
|
|
1322
1322
|
palette: "spectrum",
|
|
1323
1323
|
spectral: !0,
|
|
@@ -1356,16 +1356,16 @@ var Xn = {
|
|
|
1356
1356
|
rim: 1
|
|
1357
1357
|
}
|
|
1358
1358
|
};
|
|
1359
|
-
function
|
|
1360
|
-
return e === "softforms" || e === "softforms3d" ?
|
|
1359
|
+
function Xn(e) {
|
|
1360
|
+
return e === "softforms" || e === "softforms3d" ? Yn : null;
|
|
1361
1361
|
}
|
|
1362
1362
|
//#endregion
|
|
1363
1363
|
//#region src/loops/gl/primitiveEasing.js
|
|
1364
|
-
function
|
|
1364
|
+
function Zn(e) {
|
|
1365
1365
|
let t = 7.5625, n = 2.75;
|
|
1366
1366
|
return e < 1 / n ? t * e * e : e < 2 / n ? (e -= 1.5 / n, t * e * e + .75) : e < 2.5 / n ? (e -= 2.25 / n, t * e * e + .9375) : (e -= 2.625 / n, t * e * e + .984375);
|
|
1367
1367
|
}
|
|
1368
|
-
var
|
|
1368
|
+
var Qn = {
|
|
1369
1369
|
linear: (e) => e,
|
|
1370
1370
|
in: (e) => e * e,
|
|
1371
1371
|
out: (e) => 1 - (1 - e) * (1 - e),
|
|
@@ -1387,8 +1387,8 @@ var $n = {
|
|
|
1387
1387
|
let t = 2 * Math.PI / 3;
|
|
1388
1388
|
return 2 ** (-10 * e) * Math.sin((e * 10 - .75) * t) + 1;
|
|
1389
1389
|
},
|
|
1390
|
-
bounceOut:
|
|
1391
|
-
},
|
|
1390
|
+
bounceOut: Zn
|
|
1391
|
+
}, $n = {
|
|
1392
1392
|
linear: "Linear",
|
|
1393
1393
|
in: "Ease in",
|
|
1394
1394
|
out: "Ease out",
|
|
@@ -1403,14 +1403,14 @@ var $n = {
|
|
|
1403
1403
|
backInOut: "Back in-out",
|
|
1404
1404
|
elasticOut: "Elastic out",
|
|
1405
1405
|
bounceOut: "Bounce out"
|
|
1406
|
-
},
|
|
1406
|
+
}, er = Object.keys(Qn).map((e) => ({
|
|
1407
1407
|
value: e,
|
|
1408
|
-
label:
|
|
1409
|
-
})),
|
|
1408
|
+
label: $n[e] || e
|
|
1409
|
+
})), tr = (e, t, n) => [
|
|
1410
1410
|
r(e[0], t[0], n),
|
|
1411
1411
|
r(e[1], t[1], n),
|
|
1412
1412
|
r(e[2], t[2], n)
|
|
1413
|
-
],
|
|
1413
|
+
], nr = (e) => ({
|
|
1414
1414
|
rot: e.rot || [
|
|
1415
1415
|
0,
|
|
1416
1416
|
0,
|
|
@@ -1423,14 +1423,14 @@ var $n = {
|
|
|
1423
1423
|
],
|
|
1424
1424
|
scale: e.scale ?? 1
|
|
1425
1425
|
});
|
|
1426
|
-
function
|
|
1426
|
+
function rr(e, t) {
|
|
1427
1427
|
if (!e || !e.length) return {};
|
|
1428
|
-
if (e.length === 1) return
|
|
1428
|
+
if (e.length === 1) return nr(e[0]);
|
|
1429
1429
|
let n = 0;
|
|
1430
1430
|
for (; n < e.length - 1 && t > e[n + 1].t;) n++;
|
|
1431
1431
|
let i = e[n], a = e[n + 1] || i, o = a.t - i.t || 1, s = Math.max(0, Math.min(1, (t - i.t) / o));
|
|
1432
|
-
return s = (
|
|
1433
|
-
rot:
|
|
1432
|
+
return s = (Qn[a.ease] || Qn.inout)(s), {
|
|
1433
|
+
rot: tr(i.rot || [
|
|
1434
1434
|
0,
|
|
1435
1435
|
0,
|
|
1436
1436
|
0
|
|
@@ -1439,7 +1439,7 @@ function ir(e, t) {
|
|
|
1439
1439
|
0,
|
|
1440
1440
|
0
|
|
1441
1441
|
], s),
|
|
1442
|
-
pos:
|
|
1442
|
+
pos: tr(i.pos || [
|
|
1443
1443
|
0,
|
|
1444
1444
|
0,
|
|
1445
1445
|
0
|
|
@@ -1451,7 +1451,7 @@ function ir(e, t) {
|
|
|
1451
1451
|
scale: r(i.scale ?? 1, a.scale ?? 1, s)
|
|
1452
1452
|
};
|
|
1453
1453
|
}
|
|
1454
|
-
var
|
|
1454
|
+
var ir = [{
|
|
1455
1455
|
t: 0,
|
|
1456
1456
|
rot: [
|
|
1457
1457
|
0,
|
|
@@ -1482,30 +1482,30 @@ var ar = [{
|
|
|
1482
1482
|
}];
|
|
1483
1483
|
//#endregion
|
|
1484
1484
|
//#region src/loops/gl/phase.js
|
|
1485
|
-
function
|
|
1485
|
+
function ar(e, t) {
|
|
1486
1486
|
let n = Number(e), r = Number(t);
|
|
1487
1487
|
return !n || n <= 0 || !r || r <= 0 ? 1 : Math.max(1, Math.round(r / n));
|
|
1488
1488
|
}
|
|
1489
|
-
function
|
|
1489
|
+
function or(e, t) {
|
|
1490
1490
|
return e * t % 1;
|
|
1491
1491
|
}
|
|
1492
1492
|
//#endregion
|
|
1493
1493
|
//#region src/editor/compose/inspectors/KeyframeEditor.jsx
|
|
1494
|
-
function
|
|
1495
|
-
let r = () =>
|
|
1496
|
-
return /* @__PURE__ */
|
|
1494
|
+
function sr({ layer: e, patch: t, defaultDuration: n = 8 }) {
|
|
1495
|
+
let r = () => ar(e.duration ?? n, i.getLoopSeconds());
|
|
1496
|
+
return /* @__PURE__ */ F(Rt, {
|
|
1497
1497
|
keyframes: e.keyframes,
|
|
1498
1498
|
onChange: (e) => t({ keyframes: e }),
|
|
1499
1499
|
t: () => i.getT() * r() % 1,
|
|
1500
1500
|
onPause: () => i.pause(),
|
|
1501
1501
|
onSeek: (e) => i.seek(e / r()),
|
|
1502
|
-
easeOptions:
|
|
1503
|
-
defaultKeyframes:
|
|
1502
|
+
easeOptions: er,
|
|
1503
|
+
defaultKeyframes: ir
|
|
1504
1504
|
});
|
|
1505
1505
|
}
|
|
1506
1506
|
//#endregion
|
|
1507
1507
|
//#region src/editor/compose/inspectors/CameraPoseSlots.jsx
|
|
1508
|
-
function
|
|
1508
|
+
function cr({ layer: e, patch: t, camParams: n, isEngine: r, showHeader: i = !1 }) {
|
|
1509
1509
|
let a = y(), o = Array.isArray(e._camSlots) ? e._camSlots : [], s = [
|
|
1510
1510
|
o[0] ?? null,
|
|
1511
1511
|
o[1] ?? null,
|
|
@@ -1518,28 +1518,28 @@ function lr({ layer: e, patch: t, camParams: n, isEngine: r, showHeader: i = !1
|
|
|
1518
1518
|
}, l = (e) => {
|
|
1519
1519
|
s[e] && t({ ...s[e] });
|
|
1520
1520
|
};
|
|
1521
|
-
return /* @__PURE__ */
|
|
1521
|
+
return /* @__PURE__ */ I(P, { children: [i && /* @__PURE__ */ F("span", {
|
|
1522
1522
|
className: "kol-eyebrow text-fg-80",
|
|
1523
1523
|
children: "Camera"
|
|
1524
|
-
}), /* @__PURE__ */
|
|
1524
|
+
}), /* @__PURE__ */ I("div", {
|
|
1525
1525
|
className: "flex items-center gap-1",
|
|
1526
|
-
children: [n.length > 0 && s.map((e, t) => /* @__PURE__ */
|
|
1526
|
+
children: [n.length > 0 && s.map((e, t) => /* @__PURE__ */ F(tn, {
|
|
1527
1527
|
label: e ? "Recall pose (shift-click = overwrite)" : "Save pose",
|
|
1528
|
-
children: /* @__PURE__ */
|
|
1528
|
+
children: /* @__PURE__ */ F(M, {
|
|
1529
1529
|
"aria-label": e ? "Recall pose (shift-click = overwrite)" : "Save pose",
|
|
1530
1530
|
tone: e ? "inverted" : "ghost",
|
|
1531
1531
|
size: a,
|
|
1532
1532
|
onClick: (n) => n.shiftKey || !e ? c(t) : l(t),
|
|
1533
1533
|
children: t + 1
|
|
1534
1534
|
})
|
|
1535
|
-
}, t)), /* @__PURE__ */
|
|
1535
|
+
}, t)), /* @__PURE__ */ F(M, {
|
|
1536
1536
|
tone: "primary",
|
|
1537
1537
|
size: a,
|
|
1538
1538
|
className: "ml-auto",
|
|
1539
1539
|
onClick: () => {
|
|
1540
1540
|
let i = {};
|
|
1541
1541
|
for (let e of n) i[e.key] = e.default;
|
|
1542
|
-
t(i), r && import("./host-
|
|
1542
|
+
t(i), r && import("./host-DS-pAjP0.js").then((t) => t.hostAction?.(e.id, "resetCamera")).catch(() => {});
|
|
1543
1543
|
},
|
|
1544
1544
|
children: "Reset"
|
|
1545
1545
|
})]
|
|
@@ -1547,40 +1547,40 @@ function lr({ layer: e, patch: t, camParams: n, isEngine: r, showHeader: i = !1
|
|
|
1547
1547
|
}
|
|
1548
1548
|
//#endregion
|
|
1549
1549
|
//#region src/editor/compose/inspectors/RulesEditor.jsx
|
|
1550
|
-
function
|
|
1550
|
+
function lr({ layer: e, patch: t, seed: n }) {
|
|
1551
1551
|
let r = y(), i = e.rules ?? [], a = (e, n) => t({
|
|
1552
1552
|
rules: e,
|
|
1553
1553
|
...n
|
|
1554
|
-
}), o = () => a([...i,
|
|
1555
|
-
let t = n.take(), r =
|
|
1554
|
+
}), o = () => a([...i, Ae()]), s = (e, t) => a(i.map((n, r) => r === e ? t : n)), c = (e) => a(i.filter((t, n) => n !== e)), l = (e) => {
|
|
1555
|
+
let t = n.take(), r = k(t >>> 0);
|
|
1556
1556
|
a(i.map((t, n) => n === e ? {
|
|
1557
|
-
...
|
|
1557
|
+
...ut(r),
|
|
1558
1558
|
id: t.id
|
|
1559
1559
|
} : t), { _rollSeed: t });
|
|
1560
1560
|
};
|
|
1561
|
-
return /* @__PURE__ */
|
|
1561
|
+
return /* @__PURE__ */ F(N, {
|
|
1562
1562
|
label: `Rules · ${i.length}`,
|
|
1563
|
-
children: /* @__PURE__ */
|
|
1563
|
+
children: /* @__PURE__ */ I("div", {
|
|
1564
1564
|
className: "flex flex-col gap-2",
|
|
1565
|
-
children: [i.map((e, t) => /* @__PURE__ */
|
|
1565
|
+
children: [i.map((e, t) => /* @__PURE__ */ F(_t, {
|
|
1566
1566
|
rule: e,
|
|
1567
1567
|
onChange: (e) => s(t, e),
|
|
1568
1568
|
onRemove: () => c(t),
|
|
1569
1569
|
onReroll: () => l(t)
|
|
1570
|
-
}, e.id ?? t)), /* @__PURE__ */
|
|
1570
|
+
}, e.id ?? t)), /* @__PURE__ */ I("div", {
|
|
1571
1571
|
className: "grid grid-cols-2 gap-2",
|
|
1572
|
-
children: [/* @__PURE__ */
|
|
1572
|
+
children: [/* @__PURE__ */ F(M, {
|
|
1573
1573
|
tone: "primary",
|
|
1574
1574
|
size: r,
|
|
1575
1575
|
iconLeft: "plus",
|
|
1576
1576
|
onClick: o,
|
|
1577
1577
|
children: "Add rule"
|
|
1578
|
-
}), /* @__PURE__ */
|
|
1578
|
+
}), /* @__PURE__ */ F(M, {
|
|
1579
1579
|
tone: "primary",
|
|
1580
1580
|
size: r,
|
|
1581
1581
|
onClick: () => {
|
|
1582
|
-
let e = n.take(), t =
|
|
1583
|
-
a(Array.from({ length: r }, () =>
|
|
1582
|
+
let e = n.take(), t = k(e >>> 0), r = 1 + Math.floor(t() * 3);
|
|
1583
|
+
a(Array.from({ length: r }, () => ut(t)), { _rollSeed: e });
|
|
1584
1584
|
},
|
|
1585
1585
|
children: "Randomize"
|
|
1586
1586
|
})]
|
|
@@ -1590,7 +1590,7 @@ function ur({ layer: e, patch: t, seed: n }) {
|
|
|
1590
1590
|
}
|
|
1591
1591
|
//#endregion
|
|
1592
1592
|
//#region src/editor/compose/inspectors/ProfileEditor.jsx
|
|
1593
|
-
var
|
|
1593
|
+
var ur = (e) => e.map((e) => ({
|
|
1594
1594
|
x: e.x,
|
|
1595
1595
|
y: (1 - e.y) / 2,
|
|
1596
1596
|
hl: {
|
|
@@ -1601,7 +1601,7 @@ var dr = (e) => e.map((e) => ({
|
|
|
1601
1601
|
x: e.hrx ?? 0,
|
|
1602
1602
|
y: -(e.hry ?? 0) / 2
|
|
1603
1603
|
}
|
|
1604
|
-
})),
|
|
1604
|
+
})), dr = (e) => e.map((e) => ({
|
|
1605
1605
|
x: e.x,
|
|
1606
1606
|
y: t(1 - 2 * e.y, -1, 1),
|
|
1607
1607
|
hlx: e.hl?.x ?? 0,
|
|
@@ -1609,12 +1609,12 @@ var dr = (e) => e.map((e) => ({
|
|
|
1609
1609
|
hrx: e.hr?.x ?? 0,
|
|
1610
1610
|
hry: -2 * (e.hr?.y ?? 0)
|
|
1611
1611
|
}));
|
|
1612
|
-
function
|
|
1613
|
-
let r = Array.isArray(e) && e.length > 1 ? e :
|
|
1614
|
-
return /* @__PURE__ */
|
|
1615
|
-
value:
|
|
1612
|
+
function fr({ value: e, onChange: n }) {
|
|
1613
|
+
let r = Array.isArray(e) && e.length > 1 ? e : Be, i = y();
|
|
1614
|
+
return /* @__PURE__ */ F(jt, {
|
|
1615
|
+
value: ur(r),
|
|
1616
1616
|
onChange: (e) => {
|
|
1617
|
-
let i =
|
|
1617
|
+
let i = dr(e);
|
|
1618
1618
|
if (i.length < 3 || i[0].x > .001 || i[i.length - 1].x < .999) return;
|
|
1619
1619
|
i[0].x = 0, i[i.length - 1].x = 1;
|
|
1620
1620
|
let a = Math.abs(i[0].y - r[0].y) > 1e-6 ? i[0].y : i[i.length - 1].y;
|
|
@@ -1628,52 +1628,52 @@ function pr({ value: e, onChange: n }) {
|
|
|
1628
1628
|
ariaLabel: "Profile curve"
|
|
1629
1629
|
});
|
|
1630
1630
|
}
|
|
1631
|
-
function
|
|
1632
|
-
return e.render !== "field" || e.field !== "organic" || e.waveProfile !== "custom" ? null : /* @__PURE__ */
|
|
1631
|
+
function pr({ layer: e, patch: t }) {
|
|
1632
|
+
return e.render !== "field" || e.field !== "organic" || e.waveProfile !== "custom" ? null : /* @__PURE__ */ F(N, {
|
|
1633
1633
|
label: "Profile curve",
|
|
1634
|
-
children: /* @__PURE__ */
|
|
1635
|
-
value: Array.isArray(e.waveCurve) && e.waveCurve.length > 1 ? e.waveCurve :
|
|
1634
|
+
children: /* @__PURE__ */ F(fr, {
|
|
1635
|
+
value: Array.isArray(e.waveCurve) && e.waveCurve.length > 1 ? e.waveCurve : Be,
|
|
1636
1636
|
onChange: (e) => t({ waveCurve: e })
|
|
1637
1637
|
})
|
|
1638
1638
|
});
|
|
1639
1639
|
}
|
|
1640
1640
|
//#endregion
|
|
1641
1641
|
//#region src/editor/compose/inspectors/CurveEditor.jsx
|
|
1642
|
-
function
|
|
1643
|
-
let n = e.clip === "custom", r = n ? null :
|
|
1644
|
-
label: (
|
|
1642
|
+
function mr({ layer: e, patch: t }) {
|
|
1643
|
+
let n = e.clip === "custom", r = n ? null : Qe(e.clip), i = n ? null : {
|
|
1644
|
+
label: (Ye.find((t) => t.id === e.clip) || Ye[0]).label,
|
|
1645
1645
|
copies: r.copies,
|
|
1646
1646
|
spiral: r.spiral,
|
|
1647
1647
|
layerCopies: e.copies,
|
|
1648
1648
|
layerSpiral: e.spiral
|
|
1649
1649
|
};
|
|
1650
|
-
return /* @__PURE__ */
|
|
1651
|
-
value: n ? e.custom ??
|
|
1650
|
+
return /* @__PURE__ */ F(Nt, {
|
|
1651
|
+
value: n ? e.custom ?? tt("polar") : r.def,
|
|
1652
1652
|
stock: i,
|
|
1653
1653
|
onChange: (e, { extras: n }) => t({
|
|
1654
1654
|
clip: "custom",
|
|
1655
1655
|
...n,
|
|
1656
1656
|
custom: e
|
|
1657
1657
|
}),
|
|
1658
|
-
validate:
|
|
1659
|
-
kinds:
|
|
1660
|
-
defaultFor:
|
|
1658
|
+
validate: Xe,
|
|
1659
|
+
kinds: rt,
|
|
1660
|
+
defaultFor: tt
|
|
1661
1661
|
});
|
|
1662
1662
|
}
|
|
1663
1663
|
//#endregion
|
|
1664
1664
|
//#region src/editor/compose/inspectors/ParatypeTools.jsx
|
|
1665
|
-
function
|
|
1666
|
-
return e?.loopId === "paratype-glyph" ? n === "generate" ? /* @__PURE__ */
|
|
1665
|
+
function hr({ layer: e, patch: t, tab: n, renderAnimate: r }) {
|
|
1666
|
+
return e?.loopId === "paratype-glyph" ? n === "generate" ? /* @__PURE__ */ F(gr, { layer: e }) : n === "style" ? /* @__PURE__ */ F(_r, {
|
|
1667
1667
|
layer: e,
|
|
1668
1668
|
patch: t,
|
|
1669
1669
|
renderAnimate: r
|
|
1670
1670
|
}) : null : null;
|
|
1671
1671
|
}
|
|
1672
|
-
function
|
|
1673
|
-
let t = y(), { flattenParatype: n } =
|
|
1674
|
-
return n ? /* @__PURE__ */
|
|
1672
|
+
function gr({ layer: e }) {
|
|
1673
|
+
let t = y(), { flattenParatype: n } = g();
|
|
1674
|
+
return n ? /* @__PURE__ */ F(tn, {
|
|
1675
1675
|
label: "Flatten the glyph(s) to vector shape layers (one-way)",
|
|
1676
|
-
children: /* @__PURE__ */
|
|
1676
|
+
children: /* @__PURE__ */ F(M, {
|
|
1677
1677
|
"aria-label": "Flatten the glyph(s) to vector shape layers (one-way)",
|
|
1678
1678
|
tone: "primary",
|
|
1679
1679
|
size: t,
|
|
@@ -1683,8 +1683,8 @@ function _r({ layer: e }) {
|
|
|
1683
1683
|
})
|
|
1684
1684
|
}) : null;
|
|
1685
1685
|
}
|
|
1686
|
-
function
|
|
1687
|
-
let r = y(), i =
|
|
1686
|
+
function _r({ layer: e, patch: t, renderAnimate: n }) {
|
|
1687
|
+
let r = y(), i = de(dt(e.loopId)?.params ?? [], e).filter((e) => e.type === "range");
|
|
1688
1688
|
if (i.length < 2) return null;
|
|
1689
1689
|
let a = (e, t) => i.some((t) => t.key === e) && e !== t ? e : i.find((e) => e.key !== t)?.key, o = a(e._xyX ?? "stemWidth", null), s = a(e._xyY ?? "oWidth", o), c = i.find((e) => e.key === o), l = i.find((e) => e.key === s);
|
|
1690
1690
|
if (!c || !l) return null;
|
|
@@ -1695,18 +1695,18 @@ function vr({ layer: e, patch: t, renderAnimate: n }) {
|
|
|
1695
1695
|
value: e.key,
|
|
1696
1696
|
label: e.label
|
|
1697
1697
|
}));
|
|
1698
|
-
return /* @__PURE__ */
|
|
1699
|
-
/* @__PURE__ */
|
|
1698
|
+
return /* @__PURE__ */ I(P, { children: [
|
|
1699
|
+
/* @__PURE__ */ F("span", {
|
|
1700
1700
|
className: "kol-eyebrow text-fg-80",
|
|
1701
1701
|
children: "Explore"
|
|
1702
1702
|
}),
|
|
1703
|
-
/* @__PURE__ */
|
|
1703
|
+
/* @__PURE__ */ I("div", {
|
|
1704
1704
|
className: "grid grid-cols-2 gap-2",
|
|
1705
|
-
children: [/* @__PURE__ */
|
|
1705
|
+
children: [/* @__PURE__ */ F(N, {
|
|
1706
1706
|
label: "X axis",
|
|
1707
|
-
children: /* @__PURE__ */
|
|
1707
|
+
children: /* @__PURE__ */ I("div", {
|
|
1708
1708
|
className: "flex items-center gap-2",
|
|
1709
|
-
children: [/* @__PURE__ */
|
|
1709
|
+
children: [/* @__PURE__ */ F(Ft, {
|
|
1710
1710
|
variant: "subtle",
|
|
1711
1711
|
size: r,
|
|
1712
1712
|
className: "w-full min-w-0",
|
|
@@ -1715,11 +1715,11 @@ function vr({ layer: e, patch: t, renderAnimate: n }) {
|
|
|
1715
1715
|
onChange: (e) => t({ _xyX: e })
|
|
1716
1716
|
}), n?.(c)]
|
|
1717
1717
|
})
|
|
1718
|
-
}), /* @__PURE__ */
|
|
1718
|
+
}), /* @__PURE__ */ F(N, {
|
|
1719
1719
|
label: "Y axis",
|
|
1720
|
-
children: /* @__PURE__ */
|
|
1720
|
+
children: /* @__PURE__ */ I("div", {
|
|
1721
1721
|
className: "flex items-center gap-2",
|
|
1722
|
-
children: [/* @__PURE__ */
|
|
1722
|
+
children: [/* @__PURE__ */ F(Ft, {
|
|
1723
1723
|
variant: "subtle",
|
|
1724
1724
|
size: r,
|
|
1725
1725
|
className: "w-full min-w-0",
|
|
@@ -1730,7 +1730,7 @@ function vr({ layer: e, patch: t, renderAnimate: n }) {
|
|
|
1730
1730
|
})
|
|
1731
1731
|
})]
|
|
1732
1732
|
}),
|
|
1733
|
-
/* @__PURE__ */
|
|
1733
|
+
/* @__PURE__ */ F(nn, {
|
|
1734
1734
|
xValue: d(o, c),
|
|
1735
1735
|
yValue: d(s, l),
|
|
1736
1736
|
xMin: c.min ?? 0,
|
|
@@ -1748,7 +1748,7 @@ function vr({ layer: e, patch: t, renderAnimate: n }) {
|
|
|
1748
1748
|
}
|
|
1749
1749
|
//#endregion
|
|
1750
1750
|
//#region src/editor/compose/inspectors/SoftformsLayers.jsx
|
|
1751
|
-
var
|
|
1751
|
+
var vr = 5, yr = [
|
|
1752
1752
|
{
|
|
1753
1753
|
value: "teardrop",
|
|
1754
1754
|
label: "Teardrop"
|
|
@@ -1769,7 +1769,7 @@ var yr = 5, br = [
|
|
|
1769
1769
|
value: "super",
|
|
1770
1770
|
label: "Lozenge"
|
|
1771
1771
|
}
|
|
1772
|
-
],
|
|
1772
|
+
], br = [
|
|
1773
1773
|
{
|
|
1774
1774
|
value: "sphere",
|
|
1775
1775
|
label: "Sphere"
|
|
@@ -1786,7 +1786,7 @@ var yr = 5, br = [
|
|
|
1786
1786
|
value: "lozenge",
|
|
1787
1787
|
label: "Lozenge"
|
|
1788
1788
|
}
|
|
1789
|
-
],
|
|
1789
|
+
], xr = [
|
|
1790
1790
|
{
|
|
1791
1791
|
k: "x",
|
|
1792
1792
|
label: "Position X",
|
|
@@ -1836,7 +1836,7 @@ var yr = 5, br = [
|
|
|
1836
1836
|
step: .01,
|
|
1837
1837
|
def: 0
|
|
1838
1838
|
}
|
|
1839
|
-
],
|
|
1839
|
+
], Sr = [
|
|
1840
1840
|
{
|
|
1841
1841
|
k: "x",
|
|
1842
1842
|
label: "Position X",
|
|
@@ -1903,17 +1903,17 @@ var yr = 5, br = [
|
|
|
1903
1903
|
step: .01,
|
|
1904
1904
|
def: 0
|
|
1905
1905
|
}
|
|
1906
|
-
],
|
|
1907
|
-
let n = t * Math.sqrt(e()), r = e() *
|
|
1906
|
+
], Cr = Math.PI * 2, L = (e) => Math.round(e * 100) / 100, R = (e, t, n) => t + e() * (n - t), wr = (e, t) => {
|
|
1907
|
+
let n = t * Math.sqrt(e()), r = e() * Cr;
|
|
1908
1908
|
return [n * Math.cos(r), n * Math.sin(r)];
|
|
1909
|
-
},
|
|
1910
|
-
let n = t * Math.cbrt(e()), r = e() *
|
|
1909
|
+
}, Tr = (e, t) => {
|
|
1910
|
+
let n = t * Math.cbrt(e()), r = e() * Cr, i = Math.acos(2 * e() - 1);
|
|
1911
1911
|
return [
|
|
1912
1912
|
n * Math.sin(i) * Math.cos(r),
|
|
1913
1913
|
n * Math.sin(i) * Math.sin(r),
|
|
1914
1914
|
n * Math.cos(i) * .8
|
|
1915
1915
|
];
|
|
1916
|
-
},
|
|
1916
|
+
}, Er = (e) => {
|
|
1917
1917
|
let t = e.length || 1, n = e.reduce((e, n) => ({
|
|
1918
1918
|
x: e.x + n.x / t,
|
|
1919
1919
|
y: e.y + n.y / t
|
|
@@ -1923,10 +1923,10 @@ var yr = 5, br = [
|
|
|
1923
1923
|
});
|
|
1924
1924
|
return e.map((e) => ({
|
|
1925
1925
|
...e,
|
|
1926
|
-
x:
|
|
1927
|
-
y:
|
|
1926
|
+
x: L(e.x - n.x),
|
|
1927
|
+
y: L(e.y - n.y)
|
|
1928
1928
|
}));
|
|
1929
|
-
},
|
|
1929
|
+
}, Dr = (e) => {
|
|
1930
1930
|
let t = e.length || 1, n = e.reduce((e, n) => ({
|
|
1931
1931
|
x: e.x + n.x / t,
|
|
1932
1932
|
y: e.y + n.y / t,
|
|
@@ -1938,13 +1938,13 @@ var yr = 5, br = [
|
|
|
1938
1938
|
});
|
|
1939
1939
|
return e.map((e) => ({
|
|
1940
1940
|
...e,
|
|
1941
|
-
x:
|
|
1942
|
-
y:
|
|
1943
|
-
z:
|
|
1941
|
+
x: L(e.x - n.x),
|
|
1942
|
+
y: L(e.y - n.y),
|
|
1943
|
+
z: L(e.z - n.z)
|
|
1944
1944
|
}));
|
|
1945
|
-
},
|
|
1946
|
-
function
|
|
1947
|
-
let n = y(), { updateLayer: r } =
|
|
1945
|
+
}, Or = (e, t) => e.find((e) => e.value === t)?.label ?? t;
|
|
1946
|
+
function kr({ layer: e }) {
|
|
1947
|
+
let n = y(), { updateLayer: r } = g(), i = Oe(e.id, { history: "coalesce" }), a = e.loopId === "softforms3d", o = a && !!e.metaball, s = a ? br : yr, c = a ? Sr : xr, l = o ? 2 : 1, u = Array.isArray(e.forms) ? e.forms : [], [d, f] = un(-1), p = d >= 0 && d < u.length ? u[d] : null, m = (t) => {
|
|
1948
1948
|
f(t), window.dispatchEvent(new CustomEvent("kol:softform-select", { detail: {
|
|
1949
1949
|
id: e.id,
|
|
1950
1950
|
index: t,
|
|
@@ -1957,11 +1957,11 @@ function Ar({ layer: e }) {
|
|
|
1957
1957
|
};
|
|
1958
1958
|
return window.addEventListener("kol:softform-select", t), () => window.removeEventListener("kol:softform-select", t);
|
|
1959
1959
|
}, [e.id]);
|
|
1960
|
-
let h = (t) => r(e.id, { forms: t }),
|
|
1960
|
+
let h = (t) => r(e.id, { forms: t }), _ = (e, t) => i.patch({ forms: u.map((n, r) => r === d ? {
|
|
1961
1961
|
...n,
|
|
1962
1962
|
[e]: t
|
|
1963
1963
|
} : n) }), v = () => {
|
|
1964
|
-
if (u.length >=
|
|
1964
|
+
if (u.length >= vr) return;
|
|
1965
1965
|
let e = a ? {
|
|
1966
1966
|
t: "sphere",
|
|
1967
1967
|
x: 0,
|
|
@@ -1971,7 +1971,7 @@ function Ar({ layer: e }) {
|
|
|
1971
1971
|
sy: .7,
|
|
1972
1972
|
sz: .7,
|
|
1973
1973
|
rot: 0,
|
|
1974
|
-
hue:
|
|
1974
|
+
hue: L(Math.random())
|
|
1975
1975
|
} : {
|
|
1976
1976
|
t: "dome",
|
|
1977
1977
|
x: 0,
|
|
@@ -1979,11 +1979,11 @@ function Ar({ layer: e }) {
|
|
|
1979
1979
|
sx: .6,
|
|
1980
1980
|
sy: .6,
|
|
1981
1981
|
rot: 0,
|
|
1982
|
-
hue:
|
|
1982
|
+
hue: L(Math.random())
|
|
1983
1983
|
};
|
|
1984
1984
|
h([...u, e]), m(u.length);
|
|
1985
1985
|
}, b = (e) => {
|
|
1986
|
-
if (u.length >=
|
|
1986
|
+
if (u.length >= vr) return;
|
|
1987
1987
|
let n = {
|
|
1988
1988
|
...u[e],
|
|
1989
1989
|
x: t((u[e].x ?? 0) + .12, -1.2, 1.2),
|
|
@@ -2001,14 +2001,14 @@ function Ar({ layer: e }) {
|
|
|
2001
2001
|
let n = [...u];
|
|
2002
2002
|
[n[e], n[t]] = [n[t], n[e]], h(n), m(t);
|
|
2003
2003
|
};
|
|
2004
|
-
return /* @__PURE__ */
|
|
2004
|
+
return /* @__PURE__ */ I("div", {
|
|
2005
2005
|
className: "flex flex-col gap-2",
|
|
2006
2006
|
children: [
|
|
2007
|
-
/* @__PURE__ */
|
|
2007
|
+
/* @__PURE__ */ F("span", {
|
|
2008
2008
|
className: "kol-eyebrow text-fg-80",
|
|
2009
2009
|
children: "Forms"
|
|
2010
2010
|
}),
|
|
2011
|
-
/* @__PURE__ */
|
|
2011
|
+
/* @__PURE__ */ F(Qt, {
|
|
2012
2012
|
size: n,
|
|
2013
2013
|
reorder: "grab",
|
|
2014
2014
|
activeIndex: d >= 0 ? u.length - 1 - d : null,
|
|
@@ -2016,11 +2016,11 @@ function Ar({ layer: e }) {
|
|
|
2016
2016
|
let n = u.length - 1 - t;
|
|
2017
2017
|
return {
|
|
2018
2018
|
id: n,
|
|
2019
|
-
label:
|
|
2019
|
+
label: Or(s, u[n].t),
|
|
2020
2020
|
actions: [{
|
|
2021
2021
|
icon: "copy",
|
|
2022
2022
|
label: "Duplicate form",
|
|
2023
|
-
hidden: u.length >=
|
|
2023
|
+
hidden: u.length >= vr,
|
|
2024
2024
|
onClick: () => b(n)
|
|
2025
2025
|
}, {
|
|
2026
2026
|
icon: "trash",
|
|
@@ -2033,7 +2033,7 @@ function Ar({ layer: e }) {
|
|
|
2033
2033
|
onSelect: (e) => m(u.length - 1 - e),
|
|
2034
2034
|
onMove: (e, t) => S(u.length - 1 - e, u.length - 1 - t)
|
|
2035
2035
|
}),
|
|
2036
|
-
u.length <
|
|
2036
|
+
u.length < vr && /* @__PURE__ */ F(M, {
|
|
2037
2037
|
tone: "primary",
|
|
2038
2038
|
size: n,
|
|
2039
2039
|
className: "w-full",
|
|
@@ -2042,9 +2042,9 @@ function Ar({ layer: e }) {
|
|
|
2042
2042
|
onClick: v,
|
|
2043
2043
|
children: "Add form"
|
|
2044
2044
|
}),
|
|
2045
|
-
!a && /* @__PURE__ */
|
|
2045
|
+
!a && /* @__PURE__ */ F(tn, {
|
|
2046
2046
|
label: "Edit forms on the canvas (click to select, drag to move, corners to scale, knob to rotate)",
|
|
2047
|
-
children: /* @__PURE__ */
|
|
2047
|
+
children: /* @__PURE__ */ F(M, {
|
|
2048
2048
|
"aria-label": "Edit forms on the canvas (click to select, drag to move, corners to scale, knob to rotate)",
|
|
2049
2049
|
tone: "primary",
|
|
2050
2050
|
size: n,
|
|
@@ -2056,16 +2056,16 @@ function Ar({ layer: e }) {
|
|
|
2056
2056
|
children: "Edit forms on canvas"
|
|
2057
2057
|
})
|
|
2058
2058
|
}),
|
|
2059
|
-
p && /* @__PURE__ */
|
|
2059
|
+
p && /* @__PURE__ */ I("div", {
|
|
2060
2060
|
className: "flex flex-col gap-2 pt-1",
|
|
2061
2061
|
children: [
|
|
2062
|
-
/* @__PURE__ */
|
|
2062
|
+
/* @__PURE__ */ F("span", {
|
|
2063
2063
|
className: "kol-eyebrow text-fg-80",
|
|
2064
2064
|
children: "Selected form"
|
|
2065
2065
|
}),
|
|
2066
|
-
/* @__PURE__ */
|
|
2066
|
+
/* @__PURE__ */ F(N, {
|
|
2067
2067
|
label: "Type",
|
|
2068
|
-
children: /* @__PURE__ */
|
|
2068
|
+
children: /* @__PURE__ */ F(Ft, {
|
|
2069
2069
|
variant: "subtle",
|
|
2070
2070
|
size: n,
|
|
2071
2071
|
className: "w-full",
|
|
@@ -2079,70 +2079,70 @@ function Ar({ layer: e }) {
|
|
|
2079
2079
|
}),
|
|
2080
2080
|
c.map((e) => {
|
|
2081
2081
|
let t = p[e.k] ?? (e.fallback ? p[e.fallback] : void 0), n = typeof t == "number" ? t : e.def;
|
|
2082
|
-
return /* @__PURE__ */
|
|
2082
|
+
return /* @__PURE__ */ F(N, {
|
|
2083
2083
|
label: e.label,
|
|
2084
|
-
children: /* @__PURE__ */
|
|
2084
|
+
children: /* @__PURE__ */ F(Zt, {
|
|
2085
2085
|
min: e.min,
|
|
2086
2086
|
max: e.max,
|
|
2087
2087
|
step: e.step,
|
|
2088
2088
|
value: n,
|
|
2089
|
-
onChange: (t) =>
|
|
2089
|
+
onChange: (t) => _(e.k, t)
|
|
2090
2090
|
})
|
|
2091
2091
|
}, e.k);
|
|
2092
2092
|
})
|
|
2093
2093
|
]
|
|
2094
2094
|
}),
|
|
2095
|
-
/* @__PURE__ */
|
|
2095
|
+
/* @__PURE__ */ F("span", {
|
|
2096
2096
|
className: "kol-helper-10 text-meta pt-1",
|
|
2097
2097
|
children: "Randomize forms"
|
|
2098
2098
|
}),
|
|
2099
|
-
/* @__PURE__ */
|
|
2099
|
+
/* @__PURE__ */ I("div", {
|
|
2100
2100
|
className: "grid grid-cols-2 gap-2",
|
|
2101
2101
|
children: [
|
|
2102
|
-
/* @__PURE__ */
|
|
2102
|
+
/* @__PURE__ */ F(M, {
|
|
2103
2103
|
tone: "primary",
|
|
2104
2104
|
size: n,
|
|
2105
2105
|
onClick: () => {
|
|
2106
|
-
let e =
|
|
2106
|
+
let e = k(ve());
|
|
2107
2107
|
h(u.map((t) => ({
|
|
2108
2108
|
...t,
|
|
2109
|
-
hue:
|
|
2109
|
+
hue: L(e())
|
|
2110
2110
|
})));
|
|
2111
2111
|
},
|
|
2112
2112
|
children: "Color"
|
|
2113
2113
|
}),
|
|
2114
|
-
/* @__PURE__ */
|
|
2114
|
+
/* @__PURE__ */ F(M, {
|
|
2115
2115
|
tone: "primary",
|
|
2116
2116
|
size: n,
|
|
2117
2117
|
onClick: () => {
|
|
2118
|
-
let e =
|
|
2118
|
+
let e = k(ve());
|
|
2119
2119
|
h(u.map((t) => a ? {
|
|
2120
2120
|
...t,
|
|
2121
|
-
x:
|
|
2122
|
-
y:
|
|
2123
|
-
z:
|
|
2124
|
-
rot: Math.round(
|
|
2121
|
+
x: L(R(e, -.7, .7)),
|
|
2122
|
+
y: L(R(e, -.7, .7)),
|
|
2123
|
+
z: L(R(e, -.5, .5)),
|
|
2124
|
+
rot: Math.round(R(e, 0, 360))
|
|
2125
2125
|
} : {
|
|
2126
2126
|
...t,
|
|
2127
|
-
x:
|
|
2128
|
-
y:
|
|
2129
|
-
rot: Math.round(
|
|
2127
|
+
x: L(R(e, -.55, .55)),
|
|
2128
|
+
y: L(R(e, -.75, .75)),
|
|
2129
|
+
rot: Math.round(R(e, 0, 360))
|
|
2130
2130
|
}));
|
|
2131
2131
|
},
|
|
2132
2132
|
children: "Transform"
|
|
2133
2133
|
}),
|
|
2134
|
-
/* @__PURE__ */
|
|
2134
|
+
/* @__PURE__ */ F(M, {
|
|
2135
2135
|
tone: "primary",
|
|
2136
2136
|
size: n,
|
|
2137
2137
|
onClick: () => {
|
|
2138
|
-
let e =
|
|
2138
|
+
let e = k(ve());
|
|
2139
2139
|
h(u.map((t) => {
|
|
2140
|
-
let n =
|
|
2140
|
+
let n = L(R(e, .35, .95)), r = L(R(e, .35, .95));
|
|
2141
2141
|
return a ? {
|
|
2142
2142
|
...t,
|
|
2143
2143
|
sx: n,
|
|
2144
2144
|
sy: r,
|
|
2145
|
-
sz:
|
|
2145
|
+
sz: L(R(e, .35, .95))
|
|
2146
2146
|
} : {
|
|
2147
2147
|
...t,
|
|
2148
2148
|
sx: n,
|
|
@@ -2152,69 +2152,69 @@ function Ar({ layer: e }) {
|
|
|
2152
2152
|
},
|
|
2153
2153
|
children: "Scale"
|
|
2154
2154
|
}),
|
|
2155
|
-
/* @__PURE__ */
|
|
2155
|
+
/* @__PURE__ */ F(M, {
|
|
2156
2156
|
tone: "primary",
|
|
2157
2157
|
size: n,
|
|
2158
2158
|
onClick: () => {
|
|
2159
|
-
let t =
|
|
2159
|
+
let t = k(ve());
|
|
2160
2160
|
r(e.id, {
|
|
2161
|
-
motion:
|
|
2162
|
-
sweep: Math.round(
|
|
2161
|
+
motion: L(R(t, 0, 1.1)),
|
|
2162
|
+
sweep: Math.round(R(t, 0, 360))
|
|
2163
2163
|
});
|
|
2164
2164
|
},
|
|
2165
2165
|
children: "Animation"
|
|
2166
2166
|
})
|
|
2167
2167
|
]
|
|
2168
2168
|
}),
|
|
2169
|
-
/* @__PURE__ */
|
|
2169
|
+
/* @__PURE__ */ F(M, {
|
|
2170
2170
|
tone: "primary",
|
|
2171
2171
|
size: n,
|
|
2172
2172
|
className: "w-full",
|
|
2173
2173
|
onClick: () => {
|
|
2174
|
-
let e =
|
|
2174
|
+
let e = k(ve());
|
|
2175
2175
|
if (a) {
|
|
2176
2176
|
if (o) {
|
|
2177
|
-
let t = 2 + Math.floor(e() * 4), n =
|
|
2178
|
-
h(
|
|
2179
|
-
let [a, o, s] =
|
|
2177
|
+
let t = 2 + Math.floor(e() * 4), n = R(e, .45, .9);
|
|
2178
|
+
h(Dr(Array.from({ length: t }, (r, i) => {
|
|
2179
|
+
let [a, o, s] = Tr(e, n), c = L(R(e, .5, .92));
|
|
2180
2180
|
return {
|
|
2181
2181
|
t: "sphere",
|
|
2182
|
-
x:
|
|
2183
|
-
y:
|
|
2184
|
-
z:
|
|
2182
|
+
x: L(a),
|
|
2183
|
+
y: L(o),
|
|
2184
|
+
z: L(s),
|
|
2185
2185
|
sx: c,
|
|
2186
2186
|
sy: c,
|
|
2187
2187
|
sz: c,
|
|
2188
2188
|
rot: 0,
|
|
2189
|
-
hue:
|
|
2189
|
+
hue: L(i / t)
|
|
2190
2190
|
};
|
|
2191
2191
|
})));
|
|
2192
2192
|
} else {
|
|
2193
|
-
let t =
|
|
2194
|
-
h(
|
|
2195
|
-
let [r, i, a] =
|
|
2193
|
+
let t = R(e, .6, 1.15);
|
|
2194
|
+
h(Dr(u.map((n) => {
|
|
2195
|
+
let [r, i, a] = Tr(e, t);
|
|
2196
2196
|
return {
|
|
2197
2197
|
...n,
|
|
2198
|
-
x:
|
|
2199
|
-
y:
|
|
2200
|
-
z:
|
|
2201
|
-
rot: Math.round(
|
|
2198
|
+
x: L(r),
|
|
2199
|
+
y: L(i),
|
|
2200
|
+
z: L(a),
|
|
2201
|
+
rot: Math.round(R(e, 0, 360))
|
|
2202
2202
|
};
|
|
2203
2203
|
})));
|
|
2204
2204
|
}
|
|
2205
2205
|
return;
|
|
2206
2206
|
}
|
|
2207
|
-
let t = 2 + Math.floor(e() * 4), n =
|
|
2208
|
-
h(
|
|
2209
|
-
let [a, o] =
|
|
2207
|
+
let t = 2 + Math.floor(e() * 4), n = R(e, .45, .85);
|
|
2208
|
+
h(Er(Array.from({ length: t }, (r, i) => {
|
|
2209
|
+
let [a, o] = wr(e, n);
|
|
2210
2210
|
return {
|
|
2211
|
-
t:
|
|
2212
|
-
x:
|
|
2213
|
-
y:
|
|
2214
|
-
sx:
|
|
2215
|
-
sy:
|
|
2216
|
-
rot: Math.round(
|
|
2217
|
-
hue:
|
|
2211
|
+
t: yr[Math.floor(e() * yr.length)].value,
|
|
2212
|
+
x: L(a),
|
|
2213
|
+
y: L(o),
|
|
2214
|
+
sx: L(R(e, .4, .85)),
|
|
2215
|
+
sy: L(R(e, .4, .85)),
|
|
2216
|
+
rot: Math.round(R(e, 0, 360)),
|
|
2217
|
+
hue: L(i / t)
|
|
2218
2218
|
};
|
|
2219
2219
|
})));
|
|
2220
2220
|
},
|
|
@@ -2225,7 +2225,7 @@ function Ar({ layer: e }) {
|
|
|
2225
2225
|
}
|
|
2226
2226
|
//#endregion
|
|
2227
2227
|
//#region src/editor/compose/inspectors/PenroseLayers.jsx
|
|
2228
|
-
var
|
|
2228
|
+
var Ar = [
|
|
2229
2229
|
{
|
|
2230
2230
|
role: "fg",
|
|
2231
2231
|
label: "Foreground"
|
|
@@ -2242,31 +2242,31 @@ var jr = [
|
|
|
2242
2242
|
role: "warm",
|
|
2243
2243
|
label: "Warm"
|
|
2244
2244
|
}
|
|
2245
|
-
],
|
|
2245
|
+
], jr = {
|
|
2246
2246
|
fg: 1,
|
|
2247
2247
|
accent: 1,
|
|
2248
2248
|
dim: 5,
|
|
2249
2249
|
warm: 1
|
|
2250
2250
|
};
|
|
2251
|
-
function
|
|
2251
|
+
function Mr({ layer: e, setProp: t, patch: n }) {
|
|
2252
2252
|
let r = y();
|
|
2253
|
-
|
|
2254
|
-
let i =
|
|
2253
|
+
ft();
|
|
2254
|
+
let i = Ge(e.loopId), a = Ar.filter((e) => i?.has(e.role));
|
|
2255
2255
|
if (!a.length) return null;
|
|
2256
2256
|
let o = e._layerPrev ?? {};
|
|
2257
|
-
return /* @__PURE__ */
|
|
2257
|
+
return /* @__PURE__ */ F(zt, {
|
|
2258
2258
|
label: "Layers",
|
|
2259
2259
|
divided: !0,
|
|
2260
|
-
children: /* @__PURE__ */
|
|
2260
|
+
children: /* @__PURE__ */ F(Qt, {
|
|
2261
2261
|
size: r,
|
|
2262
2262
|
items: a.map(({ role: n, label: r }) => {
|
|
2263
|
-
let i = `${n}Opacity`, a = Number(e[i] ??
|
|
2263
|
+
let i = `${n}Opacity`, a = Number(e[i] ?? jr[n]);
|
|
2264
2264
|
return {
|
|
2265
2265
|
id: n,
|
|
2266
2266
|
label: r,
|
|
2267
2267
|
swatch: e[n] ?? null,
|
|
2268
2268
|
shown: a > 0,
|
|
2269
|
-
control: /* @__PURE__ */
|
|
2269
|
+
control: /* @__PURE__ */ F(Zt, {
|
|
2270
2270
|
min: 0,
|
|
2271
2271
|
max: 5,
|
|
2272
2272
|
step: .1,
|
|
@@ -2281,21 +2281,21 @@ function Nr({ layer: e, setProp: t, patch: n }) {
|
|
|
2281
2281
|
};
|
|
2282
2282
|
}),
|
|
2283
2283
|
onToggleShown: (t) => {
|
|
2284
|
-
let { role: r } = a[t], i = `${r}Opacity`, s = Number(e[i] ??
|
|
2284
|
+
let { role: r } = a[t], i = `${r}Opacity`, s = Number(e[i] ?? jr[r]);
|
|
2285
2285
|
n(s > 0 ? {
|
|
2286
2286
|
[i]: 0,
|
|
2287
2287
|
_layerPrev: {
|
|
2288
2288
|
...o,
|
|
2289
2289
|
[r]: s
|
|
2290
2290
|
}
|
|
2291
|
-
} : { [i]: o[r] ||
|
|
2291
|
+
} : { [i]: o[r] || jr[r] });
|
|
2292
2292
|
}
|
|
2293
2293
|
})
|
|
2294
2294
|
});
|
|
2295
2295
|
}
|
|
2296
2296
|
//#endregion
|
|
2297
2297
|
//#region src/loops/about.js
|
|
2298
|
-
var
|
|
2298
|
+
var Nr = {
|
|
2299
2299
|
"morph-circle": "Shape interpolation — a circle eased into polygons, point by point",
|
|
2300
2300
|
"square-circle": "Superellipse morph between a square and a circle",
|
|
2301
2301
|
"star-morph": "Star polygon whose inner radius and point count are tweened",
|
|
@@ -2433,44 +2433,44 @@ var Pr = {
|
|
|
2433
2433
|
"filter-outline": "Outline around shapes",
|
|
2434
2434
|
"filter-reflection": "Water reflection with waves",
|
|
2435
2435
|
"filter-convolution": "Custom 3×3 convolution kernel"
|
|
2436
|
-
},
|
|
2436
|
+
}, Pr = new Set([
|
|
2437
2437
|
"drift",
|
|
2438
2438
|
"iridescent",
|
|
2439
2439
|
"softforms",
|
|
2440
2440
|
"mesh"
|
|
2441
|
-
]),
|
|
2441
|
+
]), Fr = new Set([
|
|
2442
2442
|
"scene",
|
|
2443
2443
|
"forms",
|
|
2444
2444
|
"environment",
|
|
2445
2445
|
"ribbon"
|
|
2446
2446
|
]);
|
|
2447
|
-
function
|
|
2448
|
-
return t ? e.pixi || /^filter-/.test(e.id) ? "WebGL shader (PixiJS)" : e.kind === "engine" || /^gl-/.test(e.id) ? "WebGL shader" : "canvas 2D" : e.group === "field" && e.id !== "halftone" || e.id === "optic-moire" ? "WebGL shader" :
|
|
2447
|
+
function Ir(e, t = !1) {
|
|
2448
|
+
return t ? e.pixi || /^filter-/.test(e.id) ? "WebGL shader (PixiJS)" : e.kind === "engine" || /^gl-/.test(e.id) ? "WebGL shader" : "canvas 2D" : e.group === "field" && e.id !== "halftone" || e.id === "optic-moire" ? "WebGL shader" : Fr.has(e.engine) ? "three.js" : e.engine === "softforms3d" ? "WebGL shader (ray-marched)" : Pr.has(e.engine) ? "WebGL shader" : "canvas 2D";
|
|
2449
2449
|
}
|
|
2450
|
-
function
|
|
2450
|
+
function Lr(e, t = !1) {
|
|
2451
2451
|
if (!e) return null;
|
|
2452
2452
|
let n = e.about ?? {};
|
|
2453
2453
|
return {
|
|
2454
2454
|
kind: n.kind ?? (t ? "effect" : "generative"),
|
|
2455
|
-
basis: n.basis ??
|
|
2456
|
-
engine: n.engine ??
|
|
2455
|
+
basis: n.basis ?? Nr[e.id] ?? null,
|
|
2456
|
+
engine: n.engine ?? Ir(e, t),
|
|
2457
2457
|
dimension: n.dimension ?? (e.is3D ? "3D" : "2D")
|
|
2458
2458
|
};
|
|
2459
2459
|
}
|
|
2460
2460
|
//#endregion
|
|
2461
2461
|
//#region src/editor/compose/inspectors/AboutLine.jsx
|
|
2462
|
-
function
|
|
2463
|
-
let n = sn(), r = y(), i =
|
|
2464
|
-
return i ? /* @__PURE__ */
|
|
2462
|
+
function Rr({ def: e, isFilter: t = !1 }) {
|
|
2463
|
+
let n = sn(), r = y(), i = Lr(e, t);
|
|
2464
|
+
return i ? /* @__PURE__ */ I(P, { children: [/* @__PURE__ */ F(M, {
|
|
2465
2465
|
size: r,
|
|
2466
2466
|
iconOnly: "info",
|
|
2467
2467
|
"aria-label": "About this preset",
|
|
2468
2468
|
popoverTarget: n
|
|
2469
|
-
}), /* @__PURE__ */
|
|
2469
|
+
}), /* @__PURE__ */ I("div", {
|
|
2470
2470
|
id: n,
|
|
2471
2471
|
popover: "auto",
|
|
2472
2472
|
className: "m-auto w-[min(320px,calc(100vw-32px))] rounded-[var(--kol-radius-sm)] border-0 bg-surface-primary p-4 text-body shadow-[var(--kol-shadow-rail-up)]",
|
|
2473
|
-
children: [/* @__PURE__ */
|
|
2473
|
+
children: [/* @__PURE__ */ I("p", {
|
|
2474
2474
|
className: "kol-eyebrow text-meta",
|
|
2475
2475
|
children: [
|
|
2476
2476
|
i.kind,
|
|
@@ -2479,7 +2479,7 @@ function zr({ def: e, isFilter: t = !1 }) {
|
|
|
2479
2479
|
" · ",
|
|
2480
2480
|
i.dimension
|
|
2481
2481
|
]
|
|
2482
|
-
}), i.basis && /* @__PURE__ */
|
|
2482
|
+
}), i.basis && /* @__PURE__ */ F("p", {
|
|
2483
2483
|
className: "kol-sans-body-03 mt-2",
|
|
2484
2484
|
children: i.basis
|
|
2485
2485
|
})]
|
|
@@ -2487,12 +2487,12 @@ function zr({ def: e, isFilter: t = !1 }) {
|
|
|
2487
2487
|
}
|
|
2488
2488
|
//#endregion
|
|
2489
2489
|
//#region src/loops/theme.js
|
|
2490
|
-
function
|
|
2491
|
-
return
|
|
2490
|
+
function zr(e, t, r, i) {
|
|
2491
|
+
return we(e, t, l(n(r, i)));
|
|
2492
2492
|
}
|
|
2493
2493
|
//#endregion
|
|
2494
2494
|
//#region src/editor/compose/inspectors/LoopFields.jsx
|
|
2495
|
-
var
|
|
2495
|
+
var Br = fn.flatMap((e) => e.groups), Vr = (e, t) => {
|
|
2496
2496
|
let n = e.map((e) => ({
|
|
2497
2497
|
value: e.id,
|
|
2498
2498
|
label: e.label
|
|
@@ -2502,288 +2502,288 @@ var Vr = pn.flatMap((e) => e.groups), Hr = (e, t) => {
|
|
|
2502
2502
|
label: "Custom"
|
|
2503
2503
|
}, ...n] : n;
|
|
2504
2504
|
};
|
|
2505
|
-
function
|
|
2506
|
-
return e ? /* @__PURE__ */
|
|
2505
|
+
function z({ inline: e, label: t, align: n = "fill", children: r }) {
|
|
2506
|
+
return e ? /* @__PURE__ */ F(T, {
|
|
2507
2507
|
label: t,
|
|
2508
2508
|
align: n,
|
|
2509
2509
|
labelWidth: d,
|
|
2510
2510
|
children: r
|
|
2511
|
-
}) : /* @__PURE__ */
|
|
2511
|
+
}) : /* @__PURE__ */ F(ie, {
|
|
2512
2512
|
label: t,
|
|
2513
2513
|
children: r
|
|
2514
2514
|
});
|
|
2515
2515
|
}
|
|
2516
|
-
var
|
|
2516
|
+
var Hr = [{
|
|
2517
2517
|
value: "off",
|
|
2518
2518
|
label: "Off"
|
|
2519
2519
|
}, {
|
|
2520
2520
|
value: "on",
|
|
2521
2521
|
label: "On"
|
|
2522
2522
|
}];
|
|
2523
|
-
function
|
|
2524
|
-
return e ? /* @__PURE__ */
|
|
2523
|
+
function Ur({ inline: e, cs: t, on: n, onChange: r }) {
|
|
2524
|
+
return e ? /* @__PURE__ */ F(be, {
|
|
2525
2525
|
layout: "joined",
|
|
2526
2526
|
tone: "sunken",
|
|
2527
2527
|
size: t,
|
|
2528
|
-
className: `w-full ${
|
|
2529
|
-
options:
|
|
2528
|
+
className: `w-full ${m(t) ?? ""}`,
|
|
2529
|
+
options: Hr,
|
|
2530
2530
|
value: n ? "on" : "off",
|
|
2531
2531
|
onChange: (e) => r(e === "on")
|
|
2532
|
-
}) : /* @__PURE__ */
|
|
2532
|
+
}) : /* @__PURE__ */ F(A, {
|
|
2533
2533
|
size: t,
|
|
2534
|
-
options:
|
|
2534
|
+
options: Hr,
|
|
2535
2535
|
viewMode: n ? "on" : "off",
|
|
2536
2536
|
onViewChange: (e) => r(e === "on")
|
|
2537
2537
|
});
|
|
2538
2538
|
}
|
|
2539
|
-
function
|
|
2540
|
-
let
|
|
2541
|
-
|
|
2542
|
-
},
|
|
2543
|
-
...
|
|
2539
|
+
function Wr({ layer: t, setProp: n, patch: r, updateLayer: i, palette: s, renderAnimate: c, tab: l, tabStrip: u, tree: d, picker: f = !0, inline: p = !1, showSeed: m = !p, onReset: h }) {
|
|
2540
|
+
let g = y(), b = dt(t.loopId), x = e(), S = (b?.params ?? []).some((e) => e.key === "orbit"), C = (e) => {
|
|
2541
|
+
Oe("orbit", e), e && !x.grab && o("grab", !0);
|
|
2542
|
+
}, w = b?.params ?? [], T = t.themeId ?? "kol", D = !!t.themeInvert, O = (e) => i(t.id, {
|
|
2543
|
+
...zr(t, b?.params, e, D),
|
|
2544
2544
|
themeId: e
|
|
2545
|
-
}),
|
|
2546
|
-
...
|
|
2545
|
+
}), te = (e) => i(t.id, {
|
|
2546
|
+
...zr(t, b?.params, T, e),
|
|
2547
2547
|
themeInvert: e
|
|
2548
|
-
}),
|
|
2549
|
-
let r =
|
|
2548
|
+
}), ne = t._paletteRelation ?? "analogous", re = (b?.params ?? []).filter((e) => e.type === "color"), ie = new Set(t._rollKeep ?? []), se = (e = ne, n = {}) => {
|
|
2549
|
+
let r = ee(k(ve()), e), a = we(t, b?.params, r, { rotate: !0 });
|
|
2550
2550
|
i(t.id, {
|
|
2551
2551
|
...n,
|
|
2552
|
-
...Object.fromEntries(
|
|
2552
|
+
...Object.fromEntries(re.filter((e) => !ie.has(e.key)).map((e) => [e.key, a[e.key]]))
|
|
2553
2553
|
});
|
|
2554
|
-
},
|
|
2554
|
+
}, ce = (e) => n("_rollKeep", ie.has(e) ? [...ie].filter((t) => t !== e) : [...ie, e]), le = Xn(t.loopId), de = le ? Object.keys(le).map((e) => ({
|
|
2555
2555
|
id: e,
|
|
2556
2556
|
label: e
|
|
2557
|
-
})) : null,
|
|
2558
|
-
let a =
|
|
2557
|
+
})) : null, fe = le ? new Set(Object.values(le).flatMap((e) => Object.keys(e))) : null, pe = ue(t), me = Ce(_e(w, t), ge(w, t)), A = qn(t.loopId, t), [ye, be] = un(!1), xe = (e, n, r) => {
|
|
2558
|
+
let a = oe(t, e, pe.take(), {
|
|
2559
2559
|
stripNoRandom: !!n?.motion,
|
|
2560
2560
|
...r
|
|
2561
2561
|
});
|
|
2562
|
-
|
|
2563
|
-
},
|
|
2564
|
-
let n =
|
|
2562
|
+
A && n?.motion && (n.id !== "Form" && (a._framePreset = "custom"), n.id !== "Frame" && (a._formPreset = "custom")), fe && Object.keys(a).some((e) => fe.has(e)) && (a._lookPreset = "custom"), i(t.id, a);
|
|
2563
|
+
}, j = (e) => {
|
|
2564
|
+
let n = Me(t.loopGroup).find((e) => e.id === t.presetId)?.params ?? {}, r = {};
|
|
2565
2565
|
for (let t of e) {
|
|
2566
2566
|
let e = n[t.key] === void 0 ? t.default : n[t.key];
|
|
2567
2567
|
e !== void 0 && (r[t.key] = e);
|
|
2568
2568
|
}
|
|
2569
2569
|
i(t.id, r);
|
|
2570
|
-
},
|
|
2570
|
+
}, Te = A ? Jn(A.frame) : null, Ee = A ? Jn(A.form) : null, Oe = (e, t) => {
|
|
2571
2571
|
let n = {};
|
|
2572
|
-
|
|
2572
|
+
Te?.has(e) && (n._framePreset = "custom"), Ee?.has(e) && (n._formPreset = "custom"), fe?.has(e) && (n._lookPreset = "custom"), r({
|
|
2573
2573
|
[e]: t,
|
|
2574
2574
|
...n
|
|
2575
2575
|
});
|
|
2576
|
-
},
|
|
2576
|
+
}, ke = (e, t) => (n) => {
|
|
2577
2577
|
let i = t.find((e) => e.id === n);
|
|
2578
2578
|
r({
|
|
2579
2579
|
[e]: n,
|
|
2580
2580
|
...i?.params ?? {}
|
|
2581
2581
|
});
|
|
2582
|
-
},
|
|
2582
|
+
}, Ae = (e) => r({
|
|
2583
2583
|
_lookPreset: e,
|
|
2584
|
-
...
|
|
2585
|
-
}),
|
|
2584
|
+
...le?.[e] ?? {}
|
|
2585
|
+
}), je = b?.camera ? b.camera.map((e) => ({
|
|
2586
2586
|
...e,
|
|
2587
2587
|
section: "Camera"
|
|
2588
|
-
})) : null,
|
|
2588
|
+
})) : null, Ne = [...b?.camera ?? [], ...w.filter((e) => E(e) === "Camera")], Pe = b?.kind === "engine", Fe = Ne.length > 0 || Pe && b?.orbit, Ie = b?.engine === "scene" && (t.animMode === "keyframes" || t.animMode === "keyframe"), Re = b?.orbit ? {
|
|
2589
2589
|
yaw: 1,
|
|
2590
2590
|
dist: 1
|
|
2591
|
-
} :
|
|
2592
|
-
className: `kol-mono-10 text-meta${
|
|
2593
|
-
children:
|
|
2591
|
+
} : Le(b), ze = Re ? /* @__PURE__ */ F("p", {
|
|
2592
|
+
className: `kol-mono-10 text-meta${p ? "" : " col-span-2"}`,
|
|
2593
|
+
children: b?.orbit ? "Press C, then drag to orbit the camera and scroll to zoom." : Re.yaw ? "Press C, then drag to rotate and scroll to zoom." : "Press C, then scroll to zoom."
|
|
2594
2594
|
}) : null;
|
|
2595
|
-
return /* @__PURE__ */
|
|
2595
|
+
return /* @__PURE__ */ I(P, { children: [
|
|
2596
2596
|
u,
|
|
2597
|
-
f && (
|
|
2597
|
+
f && (p ? l === "generate" && /* @__PURE__ */ F(ae, {
|
|
2598
2598
|
divided: !0,
|
|
2599
|
-
children: /* @__PURE__ */
|
|
2599
|
+
children: /* @__PURE__ */ F(Mn, {
|
|
2600
2600
|
layer: t,
|
|
2601
2601
|
tree: d,
|
|
2602
2602
|
inline: !0,
|
|
2603
|
-
about: /* @__PURE__ */
|
|
2603
|
+
about: /* @__PURE__ */ F(Rr, { def: b })
|
|
2604
2604
|
})
|
|
2605
|
-
}) : /* @__PURE__ */
|
|
2605
|
+
}) : /* @__PURE__ */ F(Mn, {
|
|
2606
2606
|
layer: t,
|
|
2607
2607
|
tree: d,
|
|
2608
|
-
about: /* @__PURE__ */
|
|
2608
|
+
about: /* @__PURE__ */ F(Rr, { def: b })
|
|
2609
2609
|
})),
|
|
2610
|
-
(l === "generate" || l === "labs-effect") && /* @__PURE__ */
|
|
2611
|
-
(t.loopId === "softforms" || t.loopId === "softforms3d") && /* @__PURE__ */
|
|
2612
|
-
|
|
2613
|
-
inline:
|
|
2610
|
+
(l === "generate" || l === "labs-effect") && /* @__PURE__ */ I(P, { children: [
|
|
2611
|
+
(t.loopId === "softforms" || t.loopId === "softforms3d") && /* @__PURE__ */ F(kr, { layer: t }),
|
|
2612
|
+
le && !p && /* @__PURE__ */ F(z, {
|
|
2613
|
+
inline: p,
|
|
2614
2614
|
label: "Look",
|
|
2615
|
-
children: /* @__PURE__ */
|
|
2615
|
+
children: /* @__PURE__ */ F(_, {
|
|
2616
2616
|
variant: "subtle",
|
|
2617
|
-
size:
|
|
2617
|
+
size: g,
|
|
2618
2618
|
className: "w-full",
|
|
2619
|
-
options:
|
|
2619
|
+
options: Vr(de, t._lookPreset),
|
|
2620
2620
|
value: t._lookPreset ?? "custom",
|
|
2621
|
-
onChange:
|
|
2621
|
+
onChange: Ae
|
|
2622
2622
|
})
|
|
2623
2623
|
}),
|
|
2624
|
-
|
|
2624
|
+
p && /* @__PURE__ */ I(ae, {
|
|
2625
2625
|
divided: !0,
|
|
2626
2626
|
children: [
|
|
2627
|
-
|
|
2627
|
+
le && /* @__PURE__ */ F(z, {
|
|
2628
2628
|
inline: !0,
|
|
2629
2629
|
label: "Look",
|
|
2630
|
-
children: /* @__PURE__ */
|
|
2630
|
+
children: /* @__PURE__ */ F(_, {
|
|
2631
2631
|
variant: "subtle",
|
|
2632
|
-
size:
|
|
2632
|
+
size: g,
|
|
2633
2633
|
className: "w-full",
|
|
2634
|
-
options:
|
|
2634
|
+
options: Vr(de, t._lookPreset),
|
|
2635
2635
|
value: t._lookPreset ?? "custom",
|
|
2636
|
-
onChange:
|
|
2636
|
+
onChange: Ae
|
|
2637
2637
|
})
|
|
2638
2638
|
}),
|
|
2639
|
-
/* @__PURE__ */
|
|
2639
|
+
/* @__PURE__ */ F(z, {
|
|
2640
2640
|
inline: !0,
|
|
2641
2641
|
label: "Theme",
|
|
2642
|
-
children: /* @__PURE__ */
|
|
2642
|
+
children: /* @__PURE__ */ F(_, {
|
|
2643
2643
|
variant: "subtle",
|
|
2644
|
-
size:
|
|
2644
|
+
size: g,
|
|
2645
2645
|
className: "w-full",
|
|
2646
2646
|
options: a,
|
|
2647
|
-
value:
|
|
2647
|
+
value: T,
|
|
2648
2648
|
onChange: O
|
|
2649
2649
|
})
|
|
2650
2650
|
}),
|
|
2651
|
-
/* @__PURE__ */
|
|
2651
|
+
/* @__PURE__ */ F(z, {
|
|
2652
2652
|
inline: !0,
|
|
2653
2653
|
label: "Invert",
|
|
2654
|
-
children: /* @__PURE__ */
|
|
2654
|
+
children: /* @__PURE__ */ F(Ur, {
|
|
2655
2655
|
inline: !0,
|
|
2656
|
-
cs:
|
|
2657
|
-
on:
|
|
2658
|
-
onChange:
|
|
2656
|
+
cs: g,
|
|
2657
|
+
on: D,
|
|
2658
|
+
onChange: te
|
|
2659
2659
|
})
|
|
2660
2660
|
}),
|
|
2661
|
-
|
|
2661
|
+
re.length > 0 && /* @__PURE__ */ F(z, {
|
|
2662
2662
|
inline: !0,
|
|
2663
2663
|
label: "Palette",
|
|
2664
|
-
children: /* @__PURE__ */
|
|
2664
|
+
children: /* @__PURE__ */ I("div", {
|
|
2665
2665
|
className: "flex w-full gap-2",
|
|
2666
2666
|
children: [
|
|
2667
|
-
/* @__PURE__ */
|
|
2667
|
+
/* @__PURE__ */ F(_, {
|
|
2668
2668
|
variant: "subtle",
|
|
2669
|
-
size:
|
|
2669
|
+
size: g,
|
|
2670
2670
|
className: "flex-1 min-w-0",
|
|
2671
|
-
options:
|
|
2671
|
+
options: he.map((e) => ({
|
|
2672
2672
|
value: e.id,
|
|
2673
2673
|
label: e.label
|
|
2674
2674
|
})),
|
|
2675
|
-
value:
|
|
2676
|
-
onChange: (e) =>
|
|
2675
|
+
value: ne,
|
|
2676
|
+
onChange: (e) => se(e, { _paletteRelation: e })
|
|
2677
2677
|
}),
|
|
2678
|
-
/* @__PURE__ */
|
|
2678
|
+
/* @__PURE__ */ F(v, {
|
|
2679
2679
|
tone: "primary",
|
|
2680
|
-
size:
|
|
2681
|
-
onClick: () =>
|
|
2680
|
+
size: g,
|
|
2681
|
+
onClick: () => se(),
|
|
2682
2682
|
children: "Roll"
|
|
2683
2683
|
}),
|
|
2684
|
-
/* @__PURE__ */
|
|
2684
|
+
/* @__PURE__ */ F(tn, {
|
|
2685
2685
|
label: "Edit in Color Modes",
|
|
2686
|
-
children: /* @__PURE__ */
|
|
2686
|
+
children: /* @__PURE__ */ F(v, {
|
|
2687
2687
|
tone: "primary",
|
|
2688
|
-
size:
|
|
2688
|
+
size: g,
|
|
2689
2689
|
iconOnly: "clr-tri",
|
|
2690
2690
|
"aria-label": "Edit in Color Modes",
|
|
2691
|
-
onClick:
|
|
2691
|
+
onClick: Tt
|
|
2692
2692
|
})
|
|
2693
2693
|
})
|
|
2694
2694
|
]
|
|
2695
2695
|
})
|
|
2696
2696
|
}),
|
|
2697
|
-
|
|
2697
|
+
re.length > 1 && /* @__PURE__ */ F(z, {
|
|
2698
2698
|
inline: !0,
|
|
2699
2699
|
label: "Rolls",
|
|
2700
|
-
children: /* @__PURE__ */
|
|
2700
|
+
children: /* @__PURE__ */ F("div", {
|
|
2701
2701
|
className: "flex w-full flex-wrap gap-1",
|
|
2702
|
-
children:
|
|
2703
|
-
size:
|
|
2704
|
-
tone:
|
|
2705
|
-
pressed: !
|
|
2702
|
+
children: re.map((e) => /* @__PURE__ */ F(v, {
|
|
2703
|
+
size: g,
|
|
2704
|
+
tone: ie.has(e.key) ? "ghost" : "primary",
|
|
2705
|
+
pressed: !ie.has(e.key),
|
|
2706
2706
|
"aria-label": `Roll ${e.label}`,
|
|
2707
|
-
onClick: () =>
|
|
2707
|
+
onClick: () => ce(e.key),
|
|
2708
2708
|
children: e.label
|
|
2709
2709
|
}, e.key))
|
|
2710
2710
|
})
|
|
2711
2711
|
}),
|
|
2712
|
-
|
|
2712
|
+
We(b) && /* @__PURE__ */ F(z, {
|
|
2713
2713
|
inline: !0,
|
|
2714
2714
|
label: "Background",
|
|
2715
|
-
children: /* @__PURE__ */
|
|
2715
|
+
children: /* @__PURE__ */ F(Ur, {
|
|
2716
2716
|
inline: !0,
|
|
2717
|
-
cs:
|
|
2717
|
+
cs: g,
|
|
2718
2718
|
on: t.bgOn !== !1,
|
|
2719
2719
|
onChange: (e) => n("bgOn", e)
|
|
2720
2720
|
})
|
|
2721
2721
|
}),
|
|
2722
|
-
|
|
2722
|
+
ze
|
|
2723
2723
|
]
|
|
2724
2724
|
}),
|
|
2725
|
-
!
|
|
2725
|
+
!p && /* @__PURE__ */ I("div", {
|
|
2726
2726
|
className: "grid grid-cols-2 gap-2",
|
|
2727
2727
|
children: [
|
|
2728
|
-
/* @__PURE__ */
|
|
2728
|
+
/* @__PURE__ */ F(z, {
|
|
2729
2729
|
inline: !1,
|
|
2730
2730
|
label: "Theme",
|
|
2731
|
-
children: /* @__PURE__ */
|
|
2731
|
+
children: /* @__PURE__ */ F(_, {
|
|
2732
2732
|
variant: "subtle",
|
|
2733
|
-
size:
|
|
2733
|
+
size: g,
|
|
2734
2734
|
className: "w-full",
|
|
2735
2735
|
options: a,
|
|
2736
|
-
value:
|
|
2736
|
+
value: T,
|
|
2737
2737
|
onChange: O
|
|
2738
2738
|
})
|
|
2739
2739
|
}),
|
|
2740
|
-
/* @__PURE__ */
|
|
2740
|
+
/* @__PURE__ */ F(z, {
|
|
2741
2741
|
inline: !1,
|
|
2742
2742
|
label: "Invert",
|
|
2743
|
-
children: /* @__PURE__ */
|
|
2743
|
+
children: /* @__PURE__ */ F(Ur, {
|
|
2744
2744
|
inline: !1,
|
|
2745
|
-
cs:
|
|
2746
|
-
on:
|
|
2747
|
-
onChange:
|
|
2745
|
+
cs: g,
|
|
2746
|
+
on: D,
|
|
2747
|
+
onChange: te
|
|
2748
2748
|
})
|
|
2749
2749
|
}),
|
|
2750
|
-
|
|
2750
|
+
We(b) && /* @__PURE__ */ F(z, {
|
|
2751
2751
|
inline: !1,
|
|
2752
2752
|
label: "Background",
|
|
2753
|
-
children: /* @__PURE__ */
|
|
2753
|
+
children: /* @__PURE__ */ F(Ur, {
|
|
2754
2754
|
inline: !1,
|
|
2755
|
-
cs:
|
|
2755
|
+
cs: g,
|
|
2756
2756
|
on: t.bgOn !== !1,
|
|
2757
2757
|
onChange: (e) => n("bgOn", e)
|
|
2758
2758
|
})
|
|
2759
2759
|
}),
|
|
2760
|
-
|
|
2760
|
+
ze
|
|
2761
2761
|
]
|
|
2762
2762
|
}),
|
|
2763
|
-
/* @__PURE__ */
|
|
2764
|
-
schema:
|
|
2763
|
+
/* @__PURE__ */ F(De, {
|
|
2764
|
+
schema: w,
|
|
2765
2765
|
layer: t,
|
|
2766
|
-
setProp:
|
|
2766
|
+
setProp: Oe,
|
|
2767
2767
|
palette: s,
|
|
2768
2768
|
renderAnimate: c,
|
|
2769
2769
|
tab: "generate",
|
|
2770
|
-
inline:
|
|
2770
|
+
inline: p
|
|
2771
2771
|
}),
|
|
2772
|
-
|
|
2773
|
-
/* @__PURE__ */
|
|
2772
|
+
p && /* @__PURE__ */ F(Pt, {}),
|
|
2773
|
+
/* @__PURE__ */ I("div", {
|
|
2774
2774
|
className: "flex gap-2",
|
|
2775
2775
|
children: [
|
|
2776
2776
|
[
|
|
2777
2777
|
["type", "Type"],
|
|
2778
2778
|
["category", "Category"],
|
|
2779
2779
|
["preset", "Preset"]
|
|
2780
|
-
].filter(([e]) =>
|
|
2780
|
+
].filter(([e]) => wn(t, e, Br)).map(([e, n]) => /* @__PURE__ */ F(v, {
|
|
2781
2781
|
tone: "primary",
|
|
2782
|
-
size:
|
|
2782
|
+
size: g,
|
|
2783
2783
|
className: "flex-1 min-w-0",
|
|
2784
2784
|
"aria-label": `Randomize ${n.toLowerCase()}`,
|
|
2785
2785
|
onClick: () => {
|
|
2786
|
-
let n =
|
|
2786
|
+
let n = pe.take(), r = Tn(t, e, k(n >>> 0), Br);
|
|
2787
2787
|
r && i(t.id, {
|
|
2788
2788
|
...r,
|
|
2789
2789
|
_rollSeed: n
|
|
@@ -2791,219 +2791,219 @@ function Gr({ layer: t, setProp: n, patch: r, updateLayer: i, palette: s, render
|
|
|
2791
2791
|
},
|
|
2792
2792
|
children: n
|
|
2793
2793
|
}, e)),
|
|
2794
|
-
/* @__PURE__ */
|
|
2794
|
+
/* @__PURE__ */ F(v, {
|
|
2795
2795
|
tone: "primary",
|
|
2796
|
-
size:
|
|
2796
|
+
size: g,
|
|
2797
2797
|
className: "flex-1 min-w-0",
|
|
2798
2798
|
"aria-label": "Randomize settings",
|
|
2799
2799
|
onClick: (e) => {
|
|
2800
|
-
if (e.altKey) return
|
|
2801
|
-
let n =
|
|
2800
|
+
if (e.altKey) return j(ge(w, t));
|
|
2801
|
+
let n = pe.take();
|
|
2802
2802
|
i(t.id, {
|
|
2803
|
-
...
|
|
2803
|
+
...En(t, ge(w, t), k(n >>> 0)),
|
|
2804
2804
|
_rollSeed: n
|
|
2805
2805
|
});
|
|
2806
2806
|
},
|
|
2807
2807
|
children: "Settings"
|
|
2808
2808
|
}),
|
|
2809
|
-
/* @__PURE__ */
|
|
2809
|
+
/* @__PURE__ */ F(v, {
|
|
2810
2810
|
tone: "primary",
|
|
2811
|
-
size:
|
|
2811
|
+
size: g,
|
|
2812
2812
|
iconOnly: "nav-settings",
|
|
2813
2813
|
"aria-label": "What Settings rolls",
|
|
2814
|
-
onClick: () =>
|
|
2814
|
+
onClick: () => be(!0),
|
|
2815
2815
|
className: "shrink-0"
|
|
2816
2816
|
}),
|
|
2817
|
-
/* @__PURE__ */
|
|
2817
|
+
/* @__PURE__ */ F(tn, {
|
|
2818
2818
|
label: "Reset to defaults",
|
|
2819
2819
|
shortcut: "R",
|
|
2820
|
-
children: /* @__PURE__ */
|
|
2820
|
+
children: /* @__PURE__ */ F(v, {
|
|
2821
2821
|
tone: "primary",
|
|
2822
|
-
size:
|
|
2822
|
+
size: g,
|
|
2823
2823
|
iconOnly: "refresh",
|
|
2824
2824
|
"aria-label": "Reset to defaults",
|
|
2825
|
-
onClick:
|
|
2825
|
+
onClick: h ?? (() => j(ge(w, t))),
|
|
2826
2826
|
className: "shrink-0"
|
|
2827
2827
|
})
|
|
2828
2828
|
})
|
|
2829
2829
|
]
|
|
2830
2830
|
}),
|
|
2831
|
-
/* @__PURE__ */
|
|
2832
|
-
open:
|
|
2833
|
-
onClose: () =>
|
|
2834
|
-
schema:
|
|
2831
|
+
/* @__PURE__ */ F(Nn, {
|
|
2832
|
+
open: ye,
|
|
2833
|
+
onClose: () => be(!1),
|
|
2834
|
+
schema: w,
|
|
2835
2835
|
layer: t,
|
|
2836
|
-
size:
|
|
2836
|
+
size: g
|
|
2837
2837
|
}),
|
|
2838
|
-
|
|
2839
|
-
className: `grid ${
|
|
2840
|
-
children: [
|
|
2838
|
+
me.length > 0 && /* @__PURE__ */ I("div", {
|
|
2839
|
+
className: `grid ${p ? "grid-cols-3" : "grid-cols-2"} gap-2`,
|
|
2840
|
+
children: [me.map((e) => /* @__PURE__ */ F(v, {
|
|
2841
2841
|
tone: "primary",
|
|
2842
|
-
size:
|
|
2843
|
-
onClick: (t) => t.altKey ?
|
|
2842
|
+
size: g,
|
|
2843
|
+
onClick: (t) => t.altKey ? j(e.params) : xe(e.params, e),
|
|
2844
2844
|
children: e.label
|
|
2845
|
-
}, e.id)), t.loopId === "math-expression" && /* @__PURE__ */
|
|
2845
|
+
}, e.id)), t.loopId === "math-expression" && /* @__PURE__ */ F(v, {
|
|
2846
2846
|
tone: "primary",
|
|
2847
|
-
size:
|
|
2847
|
+
size: g,
|
|
2848
2848
|
onClick: (e) => {
|
|
2849
|
-
if (e.altKey) return
|
|
2850
|
-
let n =
|
|
2849
|
+
if (e.altKey) return j(me.find((e) => e.id === "Expression")?.params ?? []);
|
|
2850
|
+
let n = pe.take();
|
|
2851
2851
|
i(t.id, {
|
|
2852
|
-
expr:
|
|
2852
|
+
expr: ct(k(n >>> 0)),
|
|
2853
2853
|
_rollSeed: n
|
|
2854
2854
|
});
|
|
2855
2855
|
},
|
|
2856
2856
|
children: "Wild"
|
|
2857
2857
|
})]
|
|
2858
2858
|
}),
|
|
2859
|
-
|
|
2860
|
-
seed:
|
|
2861
|
-
inline:
|
|
2859
|
+
m && ge(w, t).length >= 5 && /* @__PURE__ */ F(Se, {
|
|
2860
|
+
seed: pe,
|
|
2861
|
+
inline: p
|
|
2862
2862
|
}),
|
|
2863
|
-
t.loopId === "pattern-rules" && (t.render ?? "tiles") === "tiles" && /* @__PURE__ */
|
|
2863
|
+
t.loopId === "pattern-rules" && (t.render ?? "tiles") === "tiles" && /* @__PURE__ */ F(lr, {
|
|
2864
2864
|
layer: t,
|
|
2865
2865
|
patch: r,
|
|
2866
|
-
seed:
|
|
2866
|
+
seed: pe
|
|
2867
2867
|
})
|
|
2868
2868
|
] }),
|
|
2869
|
-
(l === "style" || l === "labs-effect") && /* @__PURE__ */
|
|
2870
|
-
/* @__PURE__ */
|
|
2871
|
-
schema:
|
|
2869
|
+
(l === "style" || l === "labs-effect") && /* @__PURE__ */ I(P, { children: [
|
|
2870
|
+
/* @__PURE__ */ F(De, {
|
|
2871
|
+
schema: w,
|
|
2872
2872
|
layer: t,
|
|
2873
|
-
setProp:
|
|
2873
|
+
setProp: Oe,
|
|
2874
2874
|
palette: s,
|
|
2875
2875
|
renderAnimate: c,
|
|
2876
2876
|
tab: "style",
|
|
2877
|
-
inline:
|
|
2877
|
+
inline: p
|
|
2878
2878
|
}),
|
|
2879
|
-
|
|
2879
|
+
b?.group === "penrose" && t.loopId?.startsWith("penrose-") && /* @__PURE__ */ F(Mr, {
|
|
2880
2880
|
layer: t,
|
|
2881
|
-
setProp:
|
|
2881
|
+
setProp: Oe,
|
|
2882
2882
|
patch: r
|
|
2883
2883
|
}),
|
|
2884
|
-
t.loopId === "pattern-rules" && /* @__PURE__ */
|
|
2884
|
+
t.loopId === "pattern-rules" && /* @__PURE__ */ F(pr, {
|
|
2885
2885
|
layer: t,
|
|
2886
2886
|
patch: r
|
|
2887
2887
|
}),
|
|
2888
|
-
t.loopId === "math-curves" && /* @__PURE__ */
|
|
2888
|
+
t.loopId === "math-curves" && /* @__PURE__ */ F(mr, {
|
|
2889
2889
|
layer: t,
|
|
2890
2890
|
patch: r
|
|
2891
2891
|
}),
|
|
2892
|
-
t.loopId === "math-expression" && /* @__PURE__ */
|
|
2892
|
+
t.loopId === "math-expression" && /* @__PURE__ */ I("div", {
|
|
2893
2893
|
className: "grid grid-cols-2 gap-2",
|
|
2894
|
-
children: [/* @__PURE__ */
|
|
2894
|
+
children: [/* @__PURE__ */ F(v, {
|
|
2895
2895
|
tone: "primary",
|
|
2896
|
-
size:
|
|
2897
|
-
onClick: () => i(t.id,
|
|
2896
|
+
size: g,
|
|
2897
|
+
onClick: () => i(t.id, Ue(t)),
|
|
2898
2898
|
children: "Fit"
|
|
2899
|
-
}), /* @__PURE__ */
|
|
2899
|
+
}), /* @__PURE__ */ F(v, {
|
|
2900
2900
|
tone: "primary",
|
|
2901
|
-
size:
|
|
2902
|
-
onClick: () =>
|
|
2901
|
+
size: g,
|
|
2902
|
+
onClick: () => j(me.find((e) => e.id === "View")?.params ?? []),
|
|
2903
2903
|
children: "Reset"
|
|
2904
2904
|
})]
|
|
2905
2905
|
})
|
|
2906
2906
|
] }),
|
|
2907
|
-
l === "anim" && /* @__PURE__ */
|
|
2908
|
-
|
|
2907
|
+
l === "anim" && /* @__PURE__ */ I(P, { children: [
|
|
2908
|
+
A && /* @__PURE__ */ I(ae, {
|
|
2909
2909
|
label: "Motion",
|
|
2910
2910
|
divided: !0,
|
|
2911
|
-
children: [/* @__PURE__ */
|
|
2912
|
-
inline:
|
|
2911
|
+
children: [/* @__PURE__ */ F(z, {
|
|
2912
|
+
inline: p,
|
|
2913
2913
|
label: "Frame",
|
|
2914
|
-
children: /* @__PURE__ */
|
|
2914
|
+
children: /* @__PURE__ */ F(_, {
|
|
2915
2915
|
variant: "subtle",
|
|
2916
|
-
size:
|
|
2916
|
+
size: g,
|
|
2917
2917
|
className: "w-full",
|
|
2918
|
-
options:
|
|
2918
|
+
options: Vr(A.frame, t._framePreset),
|
|
2919
2919
|
value: t._framePreset ?? "custom",
|
|
2920
|
-
onChange:
|
|
2920
|
+
onChange: ke("_framePreset", A.frame)
|
|
2921
2921
|
})
|
|
2922
|
-
}), /* @__PURE__ */
|
|
2923
|
-
inline:
|
|
2922
|
+
}), /* @__PURE__ */ F(z, {
|
|
2923
|
+
inline: p,
|
|
2924
2924
|
label: "Form",
|
|
2925
|
-
children: /* @__PURE__ */
|
|
2925
|
+
children: /* @__PURE__ */ F(_, {
|
|
2926
2926
|
variant: "subtle",
|
|
2927
|
-
size:
|
|
2927
|
+
size: g,
|
|
2928
2928
|
className: "w-full",
|
|
2929
|
-
options:
|
|
2929
|
+
options: Vr(A.form, t._formPreset),
|
|
2930
2930
|
value: t._formPreset ?? "custom",
|
|
2931
|
-
onChange:
|
|
2931
|
+
onChange: ke("_formPreset", A.form)
|
|
2932
2932
|
})
|
|
2933
2933
|
})]
|
|
2934
2934
|
}),
|
|
2935
|
-
/* @__PURE__ */
|
|
2935
|
+
/* @__PURE__ */ F(gt, {
|
|
2936
2936
|
layer: t,
|
|
2937
|
-
schema:
|
|
2938
|
-
setProp:
|
|
2937
|
+
schema: w,
|
|
2938
|
+
setProp: Oe
|
|
2939
2939
|
}),
|
|
2940
|
-
|
|
2940
|
+
S && !b?.is3D && /* @__PURE__ */ F(ae, {
|
|
2941
2941
|
label: "Interaction",
|
|
2942
2942
|
divided: !0,
|
|
2943
|
-
children: /* @__PURE__ */
|
|
2944
|
-
inline:
|
|
2943
|
+
children: /* @__PURE__ */ F(z, {
|
|
2944
|
+
inline: p,
|
|
2945
2945
|
label: "Drag (C)",
|
|
2946
|
-
children: /* @__PURE__ */
|
|
2947
|
-
inline:
|
|
2948
|
-
cs:
|
|
2949
|
-
on: !!
|
|
2950
|
-
onChange:
|
|
2946
|
+
children: /* @__PURE__ */ F(Ur, {
|
|
2947
|
+
inline: p,
|
|
2948
|
+
cs: g,
|
|
2949
|
+
on: !!x.grab && t.orbit !== !1,
|
|
2950
|
+
onChange: C
|
|
2951
2951
|
})
|
|
2952
2952
|
})
|
|
2953
2953
|
}),
|
|
2954
|
-
|
|
2954
|
+
b?.is3D && /* @__PURE__ */ I(ae, {
|
|
2955
2955
|
label: "3D",
|
|
2956
2956
|
divided: !0,
|
|
2957
|
-
children: [/* @__PURE__ */
|
|
2958
|
-
inline:
|
|
2957
|
+
children: [/* @__PURE__ */ F(z, {
|
|
2958
|
+
inline: p,
|
|
2959
2959
|
label: "Orbit (C)",
|
|
2960
|
-
children: /* @__PURE__ */
|
|
2961
|
-
inline:
|
|
2962
|
-
cs:
|
|
2963
|
-
on: !!
|
|
2964
|
-
onChange:
|
|
2960
|
+
children: /* @__PURE__ */ F(Ur, {
|
|
2961
|
+
inline: p,
|
|
2962
|
+
cs: g,
|
|
2963
|
+
on: !!x.grab && t.orbit !== !1,
|
|
2964
|
+
onChange: C
|
|
2965
2965
|
})
|
|
2966
|
-
}),
|
|
2967
|
-
schema:
|
|
2966
|
+
}), b.zoom3dKey && /* @__PURE__ */ F(De, {
|
|
2967
|
+
schema: w.filter((e) => e.key === b.zoom3dKey).map(({ section: e, ...t }) => t),
|
|
2968
2968
|
layer: t,
|
|
2969
|
-
setProp:
|
|
2969
|
+
setProp: Oe,
|
|
2970
2970
|
palette: s,
|
|
2971
2971
|
renderAnimate: c,
|
|
2972
2972
|
tab: "anim",
|
|
2973
|
-
inline:
|
|
2973
|
+
inline: p
|
|
2974
2974
|
})]
|
|
2975
2975
|
}),
|
|
2976
|
-
/* @__PURE__ */
|
|
2977
|
-
schema:
|
|
2976
|
+
/* @__PURE__ */ F(De, {
|
|
2977
|
+
schema: b?.is3D && b.zoom3dKey ? w.filter((e) => e.key !== b.zoom3dKey) : w,
|
|
2978
2978
|
layer: t,
|
|
2979
|
-
setProp:
|
|
2979
|
+
setProp: Oe,
|
|
2980
2980
|
palette: s,
|
|
2981
2981
|
renderAnimate: c,
|
|
2982
2982
|
tab: "anim",
|
|
2983
|
-
inline:
|
|
2983
|
+
inline: p
|
|
2984
2984
|
}),
|
|
2985
|
-
|
|
2985
|
+
Ie && /* @__PURE__ */ F(sr, {
|
|
2986
2986
|
layer: t,
|
|
2987
2987
|
patch: r,
|
|
2988
|
-
defaultDuration:
|
|
2988
|
+
defaultDuration: b?.duration ?? 8
|
|
2989
2989
|
}),
|
|
2990
|
-
|
|
2991
|
-
schema:
|
|
2990
|
+
je && /* @__PURE__ */ F(De, {
|
|
2991
|
+
schema: je,
|
|
2992
2992
|
layer: t,
|
|
2993
2993
|
setProp: n,
|
|
2994
2994
|
palette: s,
|
|
2995
2995
|
renderAnimate: c,
|
|
2996
|
-
inline:
|
|
2996
|
+
inline: p
|
|
2997
2997
|
}),
|
|
2998
|
-
|
|
2998
|
+
Fe && /* @__PURE__ */ F(cr, {
|
|
2999
2999
|
layer: t,
|
|
3000
3000
|
patch: r,
|
|
3001
|
-
camParams:
|
|
3002
|
-
isEngine:
|
|
3003
|
-
showHeader: !
|
|
3001
|
+
camParams: Ne,
|
|
3002
|
+
isEngine: Pe,
|
|
3003
|
+
showHeader: !je
|
|
3004
3004
|
})
|
|
3005
3005
|
] }),
|
|
3006
|
-
/* @__PURE__ */
|
|
3006
|
+
/* @__PURE__ */ F(hr, {
|
|
3007
3007
|
layer: t,
|
|
3008
3008
|
patch: r,
|
|
3009
3009
|
renderAnimate: c,
|
|
@@ -3013,8 +3013,8 @@ function Gr({ layer: t, setProp: n, patch: r, updateLayer: i, palette: s, render
|
|
|
3013
3013
|
}
|
|
3014
3014
|
//#endregion
|
|
3015
3015
|
//#region src/editor/labs/useLabsLayer.js
|
|
3016
|
-
function
|
|
3017
|
-
let { layers: e, addLayer: t, removeLayer: n, updateLayer: r, select: i, beginTransaction: a, commitTransaction: o } =
|
|
3016
|
+
function Gr() {
|
|
3017
|
+
let { layers: e, addLayer: t, removeLayer: n, updateLayer: r, select: i, beginTransaction: a, commitTransaction: o } = g(), s = an((s, c) => {
|
|
3018
3018
|
let [l, ...u] = e;
|
|
3019
3019
|
a();
|
|
3020
3020
|
for (let e of u) n(e.id);
|
|
@@ -3036,14 +3036,14 @@ function Kr() {
|
|
|
3036
3036
|
}
|
|
3037
3037
|
//#endregion
|
|
3038
3038
|
//#region src/editor/morph/StepPicker.jsx
|
|
3039
|
-
function
|
|
3040
|
-
let t =
|
|
3039
|
+
function Kr(e) {
|
|
3040
|
+
let t = st(e.id), n = dt(e.loop)?.params ?? [];
|
|
3041
3041
|
return {
|
|
3042
3042
|
loopId: e.loop,
|
|
3043
3043
|
loopGroup: t,
|
|
3044
3044
|
presetId: e.id,
|
|
3045
3045
|
presetLabel: e.label,
|
|
3046
|
-
params:
|
|
3046
|
+
params: Dt(Ve(e), n),
|
|
3047
3047
|
source: {
|
|
3048
3048
|
kind: "preset",
|
|
3049
3049
|
id: e.id,
|
|
@@ -3051,16 +3051,16 @@ function qr(e) {
|
|
|
3051
3051
|
}
|
|
3052
3052
|
};
|
|
3053
3053
|
}
|
|
3054
|
-
function
|
|
3055
|
-
let n = t ?
|
|
3054
|
+
function qr(e, t) {
|
|
3055
|
+
let n = t ? Et(e, t) : (e.layers ?? []).find((e) => e?.type === "loop");
|
|
3056
3056
|
if (!n) return null;
|
|
3057
|
-
let r =
|
|
3057
|
+
let r = dt(n.loopId)?.params ?? [];
|
|
3058
3058
|
return {
|
|
3059
3059
|
loopId: n.loopId,
|
|
3060
3060
|
loopGroup: n.loopGroup,
|
|
3061
3061
|
presetId: n.presetId,
|
|
3062
3062
|
presetLabel: n.presetLabel,
|
|
3063
|
-
params:
|
|
3063
|
+
params: Dt(n, r),
|
|
3064
3064
|
source: {
|
|
3065
3065
|
kind: "file",
|
|
3066
3066
|
id: e.id,
|
|
@@ -3068,22 +3068,22 @@ function Jr(e, t) {
|
|
|
3068
3068
|
}
|
|
3069
3069
|
};
|
|
3070
3070
|
}
|
|
3071
|
-
function
|
|
3072
|
-
let t =
|
|
3071
|
+
function Jr(e) {
|
|
3072
|
+
let t = dt(e.loopId)?.params ?? [];
|
|
3073
3073
|
return {
|
|
3074
3074
|
loopId: e.loopId,
|
|
3075
3075
|
loopGroup: e.loopGroup,
|
|
3076
3076
|
presetId: e.presetId,
|
|
3077
3077
|
presetLabel: e.presetLabel,
|
|
3078
|
-
params:
|
|
3078
|
+
params: Dt(e, t),
|
|
3079
3079
|
source: {
|
|
3080
3080
|
kind: "stage",
|
|
3081
3081
|
label: e.presetLabel || "Stage"
|
|
3082
3082
|
}
|
|
3083
3083
|
};
|
|
3084
3084
|
}
|
|
3085
|
-
function
|
|
3086
|
-
let e =
|
|
3085
|
+
function Yr() {
|
|
3086
|
+
let e = At(), { layer: t, setOnly: n } = Gr(), r = !!e.picker, i = e.mode === "blend" ? e.loopId : null, [a, o] = un(""), s = t?.type === "loop" && (e.steps.length < 2 || e.editing != null), { rows: c, make: l } = cn(() => {
|
|
3087
3087
|
let e = [], n = /* @__PURE__ */ new Map();
|
|
3088
3088
|
if (!r) return {
|
|
3089
3089
|
rows: e,
|
|
@@ -3093,26 +3093,26 @@ function Xr() {
|
|
|
3093
3093
|
id: "stage",
|
|
3094
3094
|
label: t.presetLabel || "Current stage",
|
|
3095
3095
|
group: "Current stage",
|
|
3096
|
-
hint:
|
|
3097
|
-
}), n.set("stage", () =>
|
|
3098
|
-
for (let t of (
|
|
3099
|
-
if (t.mode === "morph" || !(i ?
|
|
3096
|
+
hint: He(t.loopGroup)?.label
|
|
3097
|
+
}), n.set("stage", () => Jr(t)));
|
|
3098
|
+
for (let t of (bt().preset ?? []).filter((e) => !e.shipped)) {
|
|
3099
|
+
if (t.mode === "morph" || !(i ? Et(t, i) : (t.layers ?? []).some((e) => e?.type === "loop"))) continue;
|
|
3100
3100
|
let r = `file:${t.id}`;
|
|
3101
3101
|
e.push({
|
|
3102
3102
|
id: r,
|
|
3103
3103
|
label: t.name || "Untitled",
|
|
3104
3104
|
group: "My files"
|
|
3105
|
-
}), n.set(r, () =>
|
|
3105
|
+
}), n.set(r, () => qr(t, i));
|
|
3106
3106
|
}
|
|
3107
|
-
for (let t of
|
|
3108
|
-
if (
|
|
3107
|
+
for (let t of Ze) {
|
|
3108
|
+
if (pt(t) || i && t.loop !== i) continue;
|
|
3109
3109
|
let r = `preset:${t.id}`;
|
|
3110
3110
|
e.push({
|
|
3111
3111
|
id: r,
|
|
3112
3112
|
label: t.label,
|
|
3113
|
-
group:
|
|
3113
|
+
group: He(st(t.id))?.label ?? t.loop,
|
|
3114
3114
|
hint: t.sub
|
|
3115
|
-
}), n.set(r, () =>
|
|
3115
|
+
}), n.set(r, () => Kr(t));
|
|
3116
3116
|
}
|
|
3117
3117
|
return {
|
|
3118
3118
|
rows: e,
|
|
@@ -3146,10 +3146,10 @@ function Xr() {
|
|
|
3146
3146
|
}, [c, u]);
|
|
3147
3147
|
if (!r) return null;
|
|
3148
3148
|
let p = a.trim().toLowerCase();
|
|
3149
|
-
return /* @__PURE__ */
|
|
3149
|
+
return /* @__PURE__ */ F(Xt, {
|
|
3150
3150
|
open: !0,
|
|
3151
3151
|
onClose: () => {
|
|
3152
|
-
|
|
3152
|
+
Ot({ picker: null }), o(""), d(null);
|
|
3153
3153
|
},
|
|
3154
3154
|
suggestions: f,
|
|
3155
3155
|
results: p ? c.filter((e) => [
|
|
@@ -3171,7 +3171,7 @@ function Xr() {
|
|
|
3171
3171
|
presetLabel: r.presetLabel,
|
|
3172
3172
|
loopId: r.loopId,
|
|
3173
3173
|
...r.params
|
|
3174
|
-
}),
|
|
3174
|
+
}), kt(r));
|
|
3175
3175
|
},
|
|
3176
3176
|
placeholder: "Search presets and files",
|
|
3177
3177
|
selectLabel: "Add step"
|
|
@@ -3179,35 +3179,35 @@ function Xr() {
|
|
|
3179
3179
|
}
|
|
3180
3180
|
//#endregion
|
|
3181
3181
|
//#region src/generate/field.js
|
|
3182
|
-
var
|
|
3183
|
-
function
|
|
3182
|
+
var B = (e) => e < 0 ? 0 : e > 1 ? 1 : e, Xr = (e) => e * e * (3 - 2 * e);
|
|
3183
|
+
function Zr(e, t, n) {
|
|
3184
3184
|
let r = e * 374761393 + t * 668265263 + n * 2147483647 | 0;
|
|
3185
3185
|
return r = Math.imul(r ^ r >>> 13, 1274126177), ((r ^ r >>> 16) >>> 0) / 4294967295;
|
|
3186
3186
|
}
|
|
3187
|
-
function
|
|
3188
|
-
let r = Math.floor(e), i = Math.floor(t), a =
|
|
3187
|
+
function Qr(e, t, n = 1) {
|
|
3188
|
+
let r = Math.floor(e), i = Math.floor(t), a = Xr(e - r), o = Xr(t - i), s = Zr(r, i, n), c = Zr(r + 1, i, n), l = Zr(r, i + 1, n), u = Zr(r + 1, i + 1, n);
|
|
3189
3189
|
return s + (c - s) * a + (l - s) * o + (s - c - l + u) * a * o;
|
|
3190
3190
|
}
|
|
3191
|
-
function
|
|
3191
|
+
function $r(e, t, n = 1, r = 3) {
|
|
3192
3192
|
let i = 0, a = .5, o = 0;
|
|
3193
|
-
for (let s = 0; s < r; s++) i += a *
|
|
3193
|
+
for (let s = 0; s < r; s++) i += a * Qr(e, t, n + s * 17), o += a, e *= 2, t *= 2, a *= .5;
|
|
3194
3194
|
return i / o;
|
|
3195
3195
|
}
|
|
3196
|
-
function
|
|
3196
|
+
function ei(e, t, n, r = null) {
|
|
3197
3197
|
let i = e[`${t}Kind`] ?? "flat", a = e[`${t}X`] ?? .5, o = e[`${t}Y`] ?? .5, s = (e[`${t}Angle`] ?? 0) * Math.PI / 180, c = e[`${t}Freq`] ?? 1, l = (e[`${t}Phase`] ?? 0) * Math.PI / 180, u = e[`${t}Rx`] ?? .5, d = e[`${t}Ry`] ?? .5, f = Math.cos(s), p = Math.sin(s);
|
|
3198
3198
|
switch (i) {
|
|
3199
3199
|
case "linear": return (n, r) => {
|
|
3200
3200
|
let i = (n - .5) * f + (r - .5) * p, a = -(n - .5) * p + (r - .5) * f;
|
|
3201
|
-
return
|
|
3201
|
+
return B((i + (e[`${t}Bend`] ?? 0) * a * a * 4) * (e[`${t}Span`] ?? 1) + .5 + (e[`${t}Offset`] ?? 0));
|
|
3202
3202
|
};
|
|
3203
|
-
case "diamond": return (e, t) =>
|
|
3203
|
+
case "diamond": return (e, t) => B(1 - Math.abs(e - a) / u - Math.abs(t - o) / d);
|
|
3204
3204
|
case "radial": return (e, t) => {
|
|
3205
3205
|
let r = (e - a) * n, i = t - o;
|
|
3206
|
-
return
|
|
3206
|
+
return B(1 - Math.hypot(r, i) / (u * Math.min(n, 1)));
|
|
3207
3207
|
};
|
|
3208
3208
|
case "ellipse": return (n, r) => {
|
|
3209
3209
|
let i = n - a, s = r - o, c = i * f + s * p, l = -i * p + s * f, m = e[`${t}Sq`] ?? 2;
|
|
3210
|
-
return
|
|
3210
|
+
return B(1 - (m === 2 ? Math.hypot(c / u, l / d) : (Math.abs(c / u) ** m + Math.abs(l / d) ** m) ** (1 / m)));
|
|
3211
3211
|
};
|
|
3212
3212
|
case "blob": return (e, t) => {
|
|
3213
3213
|
let n = (e - a) / u, r = (t - o) / d;
|
|
@@ -3216,10 +3216,10 @@ function ti(e, t, n, r = null) {
|
|
|
3216
3216
|
case "sine": return (e, t) => .5 + .5 * Math.sin(((e - .5) * f + (t - .5) * p) * c * 2 * Math.PI + l);
|
|
3217
3217
|
case "ridge": return (e, t) => Math.abs(Math.sin(((e - .5) * f + (t - .5) * p) * c * Math.PI + l));
|
|
3218
3218
|
case "waves": return (n, r) => .5 + .5 * Math.sin(n * c * 2 * Math.PI + l) * Math.sin(r * (e[`${t}Freq2`] ?? c) * 2 * Math.PI);
|
|
3219
|
-
case "noise": return (r, i) =>
|
|
3219
|
+
case "noise": return (r, i) => $r(r * c * n, i * (e[`${t}Freq2`] ?? c), e[`${t}Seed`] ?? 1, 3);
|
|
3220
3220
|
case "ribbon": return (n, r) => {
|
|
3221
3221
|
let i = e[`${t}Amp`] ?? .25, a = (n - .5) * f + (r - .5) * p, o = -(n - .5) * p + (r - .5) * f, s = i * Math.sin(a * c * 2 * Math.PI + l), d = u * Math.max(.05, 1 + Math.abs(a) * 2 * (e[`${t}Flare`] ?? 0));
|
|
3222
|
-
return
|
|
3222
|
+
return B(1 - Math.abs(o - s) / d);
|
|
3223
3223
|
};
|
|
3224
3224
|
case "conic": return (e, t) => ((Math.atan2(t - o, (e - a) * n) - s) / (2 * Math.PI) % 1 + 1) % 1;
|
|
3225
3225
|
case "lights": {
|
|
@@ -3253,7 +3253,7 @@ function ti(e, t, n, r = null) {
|
|
|
3253
3253
|
let t = Math.hypot((r - e.x) * n, (a - e.y) / s) / e.r;
|
|
3254
3254
|
o += e.w * Math.exp(-t * t * 2);
|
|
3255
3255
|
}
|
|
3256
|
-
return
|
|
3256
|
+
return B(o);
|
|
3257
3257
|
};
|
|
3258
3258
|
}
|
|
3259
3259
|
case "interfere": return (r, i) => {
|
|
@@ -3261,8 +3261,8 @@ function ti(e, t, n, r = null) {
|
|
|
3261
3261
|
return .5 + .5 * Math.cos(2 * Math.PI * c * (d - f) + l);
|
|
3262
3262
|
};
|
|
3263
3263
|
case "surface": {
|
|
3264
|
-
let n =
|
|
3265
|
-
return (e, t) =>
|
|
3264
|
+
let n = ti(e[`${t}Surface`]);
|
|
3265
|
+
return (e, t) => B(n(e, t));
|
|
3266
3266
|
}
|
|
3267
3267
|
case "poly": {
|
|
3268
3268
|
let n = String(e[`${t}Poly`] ?? "").split(";").map((e) => {
|
|
@@ -3274,46 +3274,46 @@ function ti(e, t, n, r = null) {
|
|
|
3274
3274
|
}).filter((e) => e.pts.length >= 3 && Number.isFinite(e.val));
|
|
3275
3275
|
return n.length ? (e, t) => {
|
|
3276
3276
|
let r = 0;
|
|
3277
|
-
for (let i of n)
|
|
3277
|
+
for (let i of n) oi([i.pts], e, t) && (r = i.val);
|
|
3278
3278
|
return r;
|
|
3279
3279
|
} : () => 0;
|
|
3280
3280
|
}
|
|
3281
3281
|
case "mesh": {
|
|
3282
|
-
let n =
|
|
3283
|
-
return (e, t) =>
|
|
3282
|
+
let n = ni(e[`${t}Mesh`]);
|
|
3283
|
+
return (e, t) => B(n(e, t));
|
|
3284
3284
|
}
|
|
3285
|
-
case "image": return r ? (e, t) =>
|
|
3285
|
+
case "image": return r ? (e, t) => B(r(e, t)) : () => 0;
|
|
3286
3286
|
default: return () => e[`${t}Value`] ?? 1;
|
|
3287
3287
|
}
|
|
3288
3288
|
}
|
|
3289
|
-
var
|
|
3289
|
+
var ti = (e) => {
|
|
3290
3290
|
let t = String(e ?? "").split(",").map(Number), n = (e) => Number.isFinite(t[e]) ? t[e] : 0;
|
|
3291
3291
|
return (e, t) => n(0) + n(1) * e + n(2) * t + n(3) * e * e + n(4) * t * t + n(5) * e * t + n(6) * e * e * e + n(7) * t * t * t + n(8) * e * e * t + n(9) * e * t * t;
|
|
3292
|
-
},
|
|
3292
|
+
}, ni = (e, t = 1) => {
|
|
3293
3293
|
let n = String(e ?? "").split("|"), [r, i] = (n[0] || "").split("x").map(Number), a = (n[t] || "").split(",").map(Number);
|
|
3294
3294
|
return !(r >= 2 && i >= 2) || a.length < r * i ? () => 0 : (e, t) => {
|
|
3295
3295
|
let n = Math.min(Math.max(e, 0), 1) * (r - 1), o = Math.min(Math.max(t, 0), 1) * (i - 1), s = Math.min(Math.floor(n), r - 2), c = Math.min(Math.floor(o), i - 2), l = n - s, u = o - c;
|
|
3296
3296
|
return (1 - l) * (1 - u) * a[c * r + s] + l * (1 - u) * a[c * r + s + 1] + (1 - l) * u * a[(c + 1) * r + s] + l * u * a[(c + 1) * r + s + 1];
|
|
3297
3297
|
};
|
|
3298
|
-
},
|
|
3298
|
+
}, ri = {
|
|
3299
3299
|
add: (e, t) => e + t,
|
|
3300
3300
|
multiply: (e, t) => e * t,
|
|
3301
3301
|
max: (e, t) => Math.max(e, t),
|
|
3302
3302
|
min: (e, t) => Math.min(e, t),
|
|
3303
3303
|
screen: (e, t) => 1 - (1 - e) * (1 - t),
|
|
3304
3304
|
diff: (e, t) => Math.abs(e - t)
|
|
3305
|
-
},
|
|
3306
|
-
let i =
|
|
3305
|
+
}, ii = (e, t, n, r) => {
|
|
3306
|
+
let i = ei(e, t, n, r);
|
|
3307
3307
|
return e[`${t}Inv`] ? (e, t) => 1 - i(e, t) : i;
|
|
3308
3308
|
};
|
|
3309
|
-
function
|
|
3310
|
-
let r =
|
|
3309
|
+
function ai(e, t = 1, n = null) {
|
|
3310
|
+
let r = ii(e, "f", t, n), i = e.gKind && e.gKind !== "none" ? ii(e, "g", t, n) : null, a = ri[e.fOp ?? "max"] ?? ri.max, o = e.gWeight ?? 1, s = e.fLo ?? 0, c = e.fHi ?? 1, l = e.fContrast ?? 1, u = e.fGamma ?? 1, d = e.fFrom ?? 0, f = e.fTo ?? 1, p = Math.round(e.fSteps ?? 0), m = !!e.fInvert, h = e.fSplit ?? 0;
|
|
3311
3311
|
return (e, t) => {
|
|
3312
3312
|
let n = r(e, t);
|
|
3313
|
-
return i && (n = a(n, i(e, t) * o)), h > 0 && t > h && (n = 1 - n), (d !== 0 || f !== 1) && (n =
|
|
3313
|
+
return i && (n = a(n, i(e, t) * o)), h > 0 && t > h && (n = 1 - n), (d !== 0 || f !== 1) && (n = B((n - d) / (f - d || 1e-6))), n = B((n - .5) * l + .5), u !== 1 && (n **= +u), m && (n = 1 - n), p >= 2 && (n = Math.min(p - 1, Math.floor(n * p)) / (p - 1)), s + (c - s) * B(n);
|
|
3314
3314
|
};
|
|
3315
3315
|
}
|
|
3316
|
-
function
|
|
3316
|
+
function oi(e, t, n) {
|
|
3317
3317
|
let r = !1;
|
|
3318
3318
|
for (let i of e) for (let e = 0, a = i.length - 1; e < i.length; a = e++) {
|
|
3319
3319
|
let [o, s] = i[e], [c, l] = i[a];
|
|
@@ -3321,10 +3321,10 @@ function si(e, t, n) {
|
|
|
3321
3321
|
}
|
|
3322
3322
|
return r;
|
|
3323
3323
|
}
|
|
3324
|
-
var
|
|
3324
|
+
var si = 512, ci = /* @__PURE__ */ new WeakMap();
|
|
3325
3325
|
function li(e) {
|
|
3326
3326
|
if (ci.has(e)) return ci.get(e);
|
|
3327
|
-
let t = new Uint8Array(
|
|
3327
|
+
let t = new Uint8Array(si * si), n = [];
|
|
3328
3328
|
for (let t of e) for (let e = 0, r = t.length - 1; e < t.length; r = e++) {
|
|
3329
3329
|
let [i, a] = t[e], [o, s] = t[r];
|
|
3330
3330
|
if (a === s) continue;
|
|
@@ -3338,14 +3338,14 @@ function li(e) {
|
|
|
3338
3338
|
}
|
|
3339
3339
|
n.sort((e, t) => e.y0 - t.y0);
|
|
3340
3340
|
let r = 0, i = [];
|
|
3341
|
-
for (let e = 0; e <
|
|
3342
|
-
let a = (e + .5) /
|
|
3341
|
+
for (let e = 0; e < si; e++) {
|
|
3342
|
+
let a = (e + .5) / si;
|
|
3343
3343
|
for (; r < n.length && n[r].y0 <= a;) i.push(n[r++]);
|
|
3344
3344
|
if (i = i.filter((e) => e.y1 > a), !i.length) continue;
|
|
3345
3345
|
let o = i.map((e) => e.x0 + (a - e.y0) * e.k).sort((e, t) => e - t);
|
|
3346
|
-
for (let n = 0; n + 1 < o.length; n += 2) for (let r = Math.max(0, Math.ceil(o[n] *
|
|
3346
|
+
for (let n = 0; n + 1 < o.length; n += 2) for (let r = Math.max(0, Math.ceil(o[n] * si - .5)); r <= Math.min(si - 1, Math.floor(o[n + 1] * si - .5)); r++) t[e * si + r] = 1;
|
|
3347
3347
|
}
|
|
3348
|
-
let a = (e, n) => e >= 0 && e < 1 && n >= 0 && n < 1 && t[Math.floor(n *
|
|
3348
|
+
let a = (e, n) => e >= 0 && e < 1 && n >= 0 && n < 1 && t[Math.floor(n * si) * si + Math.floor(e * si)] === 1;
|
|
3349
3349
|
return ci.set(e, a), a;
|
|
3350
3350
|
}
|
|
3351
3351
|
function ui(e, t = 1, n = null) {
|
|
@@ -3394,11 +3394,11 @@ function fi(e, t, n) {
|
|
|
3394
3394
|
};
|
|
3395
3395
|
}
|
|
3396
3396
|
if (r === "mesh") {
|
|
3397
|
-
let t =
|
|
3397
|
+
let t = ni(e.wMesh, 1), n = ni(e.wMesh, 2);
|
|
3398
3398
|
return (e, r) => [e + i * t(e, r), r + i * n(e, r)];
|
|
3399
3399
|
}
|
|
3400
3400
|
if (r === "surface") {
|
|
3401
|
-
let t =
|
|
3401
|
+
let t = ti(e.wSurfX), n = ti(e.wSurfY);
|
|
3402
3402
|
return (e, r) => [e + i * t(e, r), r + i * n(e, r)];
|
|
3403
3403
|
}
|
|
3404
3404
|
let a = e.wFreq ?? 1, o = e.wSeed ?? 3, s = e.wX ?? .5, c = e.wY ?? .5;
|
|
@@ -3416,9 +3416,9 @@ function fi(e, t, n) {
|
|
|
3416
3416
|
let r = (e - s) * t, o = n - c, l = i * Math.exp(-((Math.hypot(r, o) * 3 * a) ** 2)), u = Math.cos(l), d = Math.sin(l);
|
|
3417
3417
|
return [s + (r * u - o * d) / t, c + r * d + o * u];
|
|
3418
3418
|
};
|
|
3419
|
-
case "noise": return (e, t) => [e + i * (
|
|
3419
|
+
case "noise": return (e, t) => [e + i * ($r(e * a * 3, t * a * 3, o) - .5), t + i * ($r(e * a * 3 + 9, t * a * 3, o + 5) - .5)];
|
|
3420
3420
|
case "flow": return (e, t) => {
|
|
3421
|
-
let n =
|
|
3421
|
+
let n = $r(e * a, t * a, o) * Math.PI * 4, r = $r(e * a + 5, t * a + 5, o + 2);
|
|
3422
3422
|
return [e + i * r * Math.cos(n), t + i * r * Math.sin(n)];
|
|
3423
3423
|
};
|
|
3424
3424
|
default: return null;
|
|
@@ -4513,13 +4513,13 @@ var pi = [
|
|
|
4513
4513
|
}
|
|
4514
4514
|
],
|
|
4515
4515
|
draw(e, t, n, { field: r, mask: i, warp: a }) {
|
|
4516
|
-
let o = Math.max(1, Math.round(t.cols ?? 40)), s = n.w / o, c = Math.max(1, Math.round(t.rows || n.h / s)), l = n.h / c, u = Math.min(s, l) * (t.size ?? .9) / 2, d = t.min ?? .05, f = t.stretch ?? 1,
|
|
4516
|
+
let o = Math.max(1, Math.round(t.cols ?? 40)), s = n.w / o, c = Math.max(1, Math.round(t.rows || n.h / s)), l = n.h / c, u = Math.min(s, l) * (t.size ?? .9) / 2, d = t.min ?? .05, f = t.stretch ?? 1, m = f >= 1 ? 1 / Math.sqrt(f) : 1, h = f >= 1 ? Math.sqrt(f) : f, g = t.shape ?? "circle";
|
|
4517
4517
|
for (let s = 0; s < c; s++) {
|
|
4518
4518
|
let l = t.stagger && s % 2 ? .5 : 0;
|
|
4519
4519
|
for (let f = 0; f < o + (l ? -1 : 0); f++) {
|
|
4520
4520
|
let _ = (f + .5 + l) / o, v = (s + .5) / c;
|
|
4521
4521
|
if (t.justify) {
|
|
4522
|
-
let e = u *
|
|
4522
|
+
let e = u * m / n.w, t = u * h / n.h;
|
|
4523
4523
|
_ = e + (f + l) * (1 - 2 * e) / Math.max(1, o - 1), v = t + s * (1 - 2 * t) / Math.max(1, c - 1);
|
|
4524
4524
|
}
|
|
4525
4525
|
let y = _, x = v;
|
|
@@ -4531,8 +4531,8 @@ var pi = [
|
|
|
4531
4531
|
let S = r(y, x), C = t.floor ?? 0;
|
|
4532
4532
|
if (C > 0) S = C + (1 - C) * S;
|
|
4533
4533
|
else if (S < d) continue;
|
|
4534
|
-
let w = u * S *
|
|
4535
|
-
g === "square" ?
|
|
4534
|
+
let w = u * S * m, T = u * S * h, E = n.x + _ * n.w, D = n.y + v * n.h;
|
|
4535
|
+
g === "square" ? ne(e, E, D, 2 * w, 2 * T, 0) : g === "diamond" ? p(e, [
|
|
4536
4536
|
[E, D - T * 1.25],
|
|
4537
4537
|
[E + w * 1.25, D],
|
|
4538
4538
|
[E, D + T * 1.25],
|
|
@@ -4791,14 +4791,14 @@ var pi = [
|
|
|
4791
4791
|
y: n.y + n.h / 2 - a / 2,
|
|
4792
4792
|
w: a,
|
|
4793
4793
|
h: a
|
|
4794
|
-
} : n, s = r ? o.w : o.h, c = r ? o.h : o.w, l = Math.max(1, Math.round(t.count ?? 16)), u = s / l, d = Math.round(t.period ?? 0) || l, f = t.lead ?? 1,
|
|
4794
|
+
} : n, s = r ? o.w : o.h, c = r ? o.h : o.w, l = Math.max(1, Math.round(t.count ?? 16)), u = s / l, d = Math.round(t.period ?? 0) || l, f = t.lead ?? 1, m = (e) => d > 1 ? e % d / (d - 1) : 0, h = (e) => Math.max(0, Ei(t, "w", m(e))) * (e % d === 0 ? f : 1), g, _;
|
|
4795
4795
|
if (t.spread === "packed" || t.spread === "units") {
|
|
4796
|
-
let e = Array.from({ length: l }, (e, t) => h(t)), r = Array.from({ length: l }, (e, n) => Math.max(0, Ei(t, "g",
|
|
4796
|
+
let e = Array.from({ length: l }, (e, t) => h(t)), r = Array.from({ length: l }, (e, n) => Math.max(0, Ei(t, "g", m(n)))), i = t.spread === "units" ? Math.min(n.w, n.h) / 800 : s / (e.reduce((e, t) => e + t, 0) + r.slice(0, -1).reduce((e, t) => e + t, 0) || 1), a = t.spread === "units" ? (t.offset ?? 0) * s : 0;
|
|
4797
4797
|
g = [], _ = [];
|
|
4798
4798
|
for (let t = 0; t < l; t++) _.push(e[t] * i), g.push(a + e[t] * i / 2), a += (e[t] + r[t]) * i;
|
|
4799
4799
|
} else {
|
|
4800
4800
|
_ = Array.from({ length: l }, (e, t) => h(t) * u);
|
|
4801
|
-
let e = Math.max(...Array.from({ length: l }, (e, n) => Math.abs(Ei(t, "a",
|
|
4801
|
+
let e = Math.max(...Array.from({ length: l }, (e, n) => Math.abs(Ei(t, "a", m(n))))) * s, n = _[0] / 2 + e, r = s - _[l - 1] / 2 - e;
|
|
4802
4802
|
g = _.map((e, t) => l > 1 ? n + (r - n) * t / (l - 1) : s / 2);
|
|
4803
4803
|
}
|
|
4804
4804
|
let v = n.x + n.w / 2, y = n.y + n.h / 2, b = Math.cos(i), x = Math.sin(i), S = (e, t) => {
|
|
@@ -4807,19 +4807,19 @@ var pi = [
|
|
|
4807
4807
|
let a = n[0] - v, s = n[1] - y;
|
|
4808
4808
|
return [v + a * b - s * x, y + a * x + s * b];
|
|
4809
4809
|
}, C = (t) => {
|
|
4810
|
-
i && (t =
|
|
4810
|
+
i && (t = D(t, n)), p(e, t);
|
|
4811
4811
|
};
|
|
4812
4812
|
for (let e = 0; e < l; e++) {
|
|
4813
|
-
let n =
|
|
4813
|
+
let n = m(e), r = _[e];
|
|
4814
4814
|
if (r <= .05) continue;
|
|
4815
4815
|
let i = Ei(t, "s", n) * c, a = Ei(t, "e", n) * c;
|
|
4816
4816
|
if (a - i <= .5) continue;
|
|
4817
|
-
let o = Ei(t, "k", n), l = Ei(t, "a", n) * s, u = Ei(t, "ph", n), d = Ei(t, "b", n) * s, f = t.freq ?? 3,
|
|
4817
|
+
let o = Ei(t, "k", n), l = Ei(t, "a", n) * s, u = Ei(t, "ph", n), d = Ei(t, "b", n) * s, f = t.freq ?? 3, p = (t) => {
|
|
4818
4818
|
let n = t / c;
|
|
4819
4819
|
return g[e] + l * Math.sin(2 * Math.PI * (n * f + u)) + d * 4 * (n - .5) * (n - .5);
|
|
4820
4820
|
}, h = [], v = (t.dash ?? 0) * c, y = (t.gap ?? .05) * c, b = String(t.edges ?? "").split(";").map((e) => e.split(":").map(Number)).filter((e) => e.length >= 1 && Number.isFinite(e[0])), x = t.edgeNoise ?? 0;
|
|
4821
4821
|
if (b.length >= 2) {
|
|
4822
|
-
let e = b.map(([e, r = 0, i = 0, a = 0], o) => (e + r * Math.sin(2 * Math.PI * i * n + a * Math.PI / 180) + (x ? x * (
|
|
4822
|
+
let e = b.map(([e, r = 0, i = 0, a = 0], o) => (e + r * Math.sin(2 * Math.PI * i * n + a * Math.PI / 180) + (x ? x * ($r(n * (t.edgeNoiseFreq ?? 3), o * 7.3, t.edgeSeed ?? 1) - .5) * 2 : 0)) * c);
|
|
4823
4823
|
for (let t = 0; t + 1 < e.length; t += 2) h.push([Math.max(i, Math.min(e[t], e[t + 1])), Math.min(a, Math.max(e[t], e[t + 1]))]);
|
|
4824
4824
|
} else if (v > 0) {
|
|
4825
4825
|
let e = (u % 1 + 1) % 1 * (v + y);
|
|
@@ -4829,7 +4829,7 @@ var pi = [
|
|
|
4829
4829
|
if (t - e <= .3) continue;
|
|
4830
4830
|
let n = [], i = [], a = l || d ? Math.max(2, Math.ceil(96 * (t - e) / c)) : 1;
|
|
4831
4831
|
for (let s = 0; s <= a; s++) {
|
|
4832
|
-
let c = e + (t - e) * s / a, l =
|
|
4832
|
+
let c = e + (t - e) * s / a, l = p(c), u = s === 0 || s === a ? r / 2 * o : 0;
|
|
4833
4833
|
n.push(S(c + (s === 0 || s === a ? u : 0), l - r / 2)), i.push(S(c - (s === 0 || s === a ? u : 0), l + r / 2));
|
|
4834
4834
|
}
|
|
4835
4835
|
C([...n, ...i.reverse()]);
|
|
@@ -4837,7 +4837,7 @@ var pi = [
|
|
|
4837
4837
|
if ((v > 0 || b.length >= 2) && (t.link ?? 0) > 0) {
|
|
4838
4838
|
let e = t.link / 2, n = [], r = [];
|
|
4839
4839
|
for (let t = 0; t <= 96; t++) {
|
|
4840
|
-
let o = i + (a - i) * t / 96, s =
|
|
4840
|
+
let o = i + (a - i) * t / 96, s = p(o);
|
|
4841
4841
|
n.push(S(o, s - e)), r.push(S(o, s + e));
|
|
4842
4842
|
}
|
|
4843
4843
|
C([...n, ...r.reverse()]);
|
|
@@ -5110,9 +5110,9 @@ var pi = [
|
|
|
5110
5110
|
}
|
|
5111
5111
|
],
|
|
5112
5112
|
draw(e, t, n, { field: r, mask: i }) {
|
|
5113
|
-
let a = Math.max(1, Math.round(t.count ?? 36)), o = Math.min(n.w, n.h) / 2, s = n.x + (t.cx ?? .5) * n.w, c = n.y + (t.cy ?? .5) * n.h, l = (t.start ?? -90) * Math.PI / 180, u = (t.span ?? 360) * Math.PI / 180, d = (t.span ?? 360) >= 360, f = (t) =>
|
|
5113
|
+
let a = Math.max(1, Math.round(t.count ?? 36)), o = Math.min(n.w, n.h) / 2, s = n.x + (t.cx ?? .5) * n.w, c = n.y + (t.cy ?? .5) * n.h, l = (t.start ?? -90) * Math.PI / 180, u = (t.span ?? 360) * Math.PI / 180, d = (t.span ?? 360) >= 360, f = (t) => p(e, D(t, n)), m = (e, t) => [s + Math.cos(e) * t, c + Math.sin(e) * t], h = (e) => a > 1 ? e / (a - 1) : 0;
|
|
5114
5114
|
if (t.mode === "rings") {
|
|
5115
|
-
let e = Math.max(1, Math.round(t.segments ?? 1)), n = t.segGap ?? .1, r = t.zig ?? 0, i = Math.round(t.zigN ?? 8),
|
|
5115
|
+
let e = Math.max(1, Math.round(t.segments ?? 1)), n = t.segGap ?? .1, r = t.zig ?? 0, i = Math.round(t.zigN ?? 8), p = (e) => 4 * Math.abs((e % 1 + 1) % 1 - .5) - 1;
|
|
5116
5116
|
for (let g = 0; g < a; g++) {
|
|
5117
5117
|
let a = h(g), _ = ji(t, "r1", a, g) * o, v = ji(t, "w", a, g) * o;
|
|
5118
5118
|
if (v <= .05 || _ <= 0) continue;
|
|
@@ -5120,8 +5120,8 @@ var pi = [
|
|
|
5120
5120
|
for (let a = 0; a < e; a++) {
|
|
5121
5121
|
let u = l + y + a * b + (e > 1 ? b * n / 2 : 0), h = l + y + (a + 1) * b - (e > 1 ? b * n / 2 : 0), g = Math.max(8, Math.ceil((h - u) * _ / 6)) * (r ? 4 : 1), x = [], S = [];
|
|
5122
5122
|
for (let e = 0; e <= g; e++) {
|
|
5123
|
-
let n = u + (h - u) * e / g, a = e / g, s = r ? r * o * .25 *
|
|
5124
|
-
x.push(
|
|
5123
|
+
let n = u + (h - u) * e / g, a = e / g, s = r ? r * o * .25 * p((n - l) / (2 * Math.PI) * i) : 0;
|
|
5124
|
+
x.push(m(n, _ + s)), S.push(v * Math.max(0, 1 + (t.taper ?? 0) * (2 * a ** (t.taperPow ?? 1) - 1)));
|
|
5125
5125
|
}
|
|
5126
5126
|
let C = [], w = [];
|
|
5127
5127
|
for (let e = 0; e < x.length; e++) {
|
|
@@ -5140,19 +5140,19 @@ var pi = [
|
|
|
5140
5140
|
}
|
|
5141
5141
|
let g = d ? u / a : u / Math.max(1, a - 1);
|
|
5142
5142
|
for (let e = 0; e < a; e++) {
|
|
5143
|
-
let a = h(e), u = l + e * g + ji(t, "rot", a, e) * Math.PI / 180, d = ji(t, "r0", a, e) * o,
|
|
5144
|
-
if (
|
|
5143
|
+
let a = h(e), u = l + e * g + ji(t, "rot", a, e) * Math.PI / 180, d = ji(t, "r0", a, e) * o, p = ji(t, "r1", a, e) * o;
|
|
5144
|
+
if (p - d <= .3) continue;
|
|
5145
5145
|
let _ = ji(t, "w", a, e);
|
|
5146
5146
|
if (!(_ <= 0)) if (t.byField && r) {
|
|
5147
|
-
let e = Math.max(1, t.raySample ?? 4), a = Math.abs(g) *
|
|
5147
|
+
let e = Math.max(1, t.raySample ?? 4), a = Math.abs(g) * p * _ / 2, o = Math.cos(u), l = Math.sin(u), m = -l, h = o, v = [], y = () => {
|
|
5148
5148
|
if (v.length) {
|
|
5149
|
-
let e = v.map(([e, t]) => [s + o * e +
|
|
5149
|
+
let e = v.map(([e, t]) => [s + o * e + m * t, c + l * e + h * t]), t = v.map(([e, t]) => [s + o * e - m * t, c + l * e - h * t]).reverse();
|
|
5150
5150
|
f([...e, ...t]);
|
|
5151
5151
|
}
|
|
5152
5152
|
v = [];
|
|
5153
5153
|
};
|
|
5154
|
-
for (let t = d; t <
|
|
5155
|
-
let u = Math.min(
|
|
5154
|
+
for (let t = d; t < p; t += e) {
|
|
5155
|
+
let u = Math.min(p, t + e), d = (t + u) / 2, f = s + o * d, m = c + l * d, h = (f - n.x) / n.w, g = (m - n.y) / n.h, _ = i(h, g) ? a * r(h, g) : 0;
|
|
5156
5156
|
if (_ <= .05) {
|
|
5157
5157
|
y();
|
|
5158
5158
|
continue;
|
|
@@ -5161,26 +5161,26 @@ var pi = [
|
|
|
5161
5161
|
}
|
|
5162
5162
|
y();
|
|
5163
5163
|
} else if (t.shape === "spike") {
|
|
5164
|
-
let e = Math.abs(g) *
|
|
5164
|
+
let e = Math.abs(g) * p * _ / 2, t = Math.cos(u), n = Math.sin(u), r = -n, i = t;
|
|
5165
5165
|
f([
|
|
5166
5166
|
[s + t * d, c + n * d],
|
|
5167
|
-
[s + t *
|
|
5168
|
-
[s + t *
|
|
5167
|
+
[s + t * p + r * e, c + n * p + i * e],
|
|
5168
|
+
[s + t * p - r * e, c + n * p - i * e]
|
|
5169
5169
|
]);
|
|
5170
5170
|
} else if (t.shape === "wedge") {
|
|
5171
5171
|
let e = Math.abs(g) * _ / 2;
|
|
5172
5172
|
f([
|
|
5173
|
-
|
|
5174
|
-
|
|
5175
|
-
|
|
5176
|
-
|
|
5173
|
+
m(u - e, d),
|
|
5174
|
+
m(u - e, p),
|
|
5175
|
+
m(u + e, p),
|
|
5176
|
+
m(u + e, d)
|
|
5177
5177
|
]);
|
|
5178
5178
|
} else {
|
|
5179
|
-
let e = Math.abs(g) *
|
|
5179
|
+
let e = Math.abs(g) * p * _ / 2, t = Math.cos(u), n = Math.sin(u), r = -n, i = t;
|
|
5180
5180
|
f([
|
|
5181
5181
|
[s + t * d + r * e, c + n * d + i * e],
|
|
5182
|
-
[s + t *
|
|
5183
|
-
[s + t *
|
|
5182
|
+
[s + t * p + r * e, c + n * p + i * e],
|
|
5183
|
+
[s + t * p - r * e, c + n * p - i * e],
|
|
5184
5184
|
[s + t * d - r * e, c + n * d - i * e]
|
|
5185
5185
|
]);
|
|
5186
5186
|
}
|
|
@@ -5191,7 +5191,7 @@ var pi = [
|
|
|
5191
5191
|
return n = Math.imul(n ^ n >>> 15, 2246822519), n ^= n >>> 13, (n >>> 0) / 4294967296;
|
|
5192
5192
|
}, Fi = (e, t, n, r, i, a) => {
|
|
5193
5193
|
let o = r - t, s = i - n, c = Math.hypot(o, s) || 1, l = -s / c * (a / 2), u = o / c * (a / 2);
|
|
5194
|
-
|
|
5194
|
+
p(e, [
|
|
5195
5195
|
[t + l, n + u],
|
|
5196
5196
|
[r + l, i + u],
|
|
5197
5197
|
[r - l, i - u],
|
|
@@ -5203,8 +5203,8 @@ var pi = [
|
|
|
5203
5203
|
let s = e / 24 * 2 * Math.PI;
|
|
5204
5204
|
a.push([t + Math.cos(s) * r, n + Math.sin(s) * r]), o.push([t + Math.cos(s) * (r - i), n + Math.sin(s) * (r - i)]);
|
|
5205
5205
|
}
|
|
5206
|
-
|
|
5207
|
-
}, Li = (e, t, n, r, i, a) =>
|
|
5206
|
+
Te(e, [a, o]);
|
|
5207
|
+
}, Li = (e, t, n, r, i, a) => Te(e, [[
|
|
5208
5208
|
[t - r, n - i],
|
|
5209
5209
|
[t + r, n - i],
|
|
5210
5210
|
[t + r, n + i],
|
|
@@ -5613,7 +5613,7 @@ var zi = {
|
|
|
5613
5613
|
if (C < b || C > x) continue;
|
|
5614
5614
|
let w = (p ? p * Math.sin(2 * Math.PI * (C * (t.waveFreq ?? 2) + y)) : 0) + (g ? g * (Pi(S + 1001, u) - .5) : 0), T = n.x + (h + .5) * s, E = n.y + (v + .5) * c + w, D = (E - n.y) / n.h;
|
|
5615
5615
|
if (!i(C, D)) continue;
|
|
5616
|
-
let
|
|
5616
|
+
let ee = r(C, D);
|
|
5617
5617
|
if ((t.accent ?? 0) > 0 && Pi(S + 31, u) < t.accent) {
|
|
5618
5618
|
let n = Math.round(t.accentLen ?? 3);
|
|
5619
5619
|
O(e, T - s * .45, E - c * .18, s * (n - .1), c * .36), h += n - 1;
|
|
@@ -5626,7 +5626,7 @@ var zi = {
|
|
|
5626
5626
|
continue;
|
|
5627
5627
|
}
|
|
5628
5628
|
}
|
|
5629
|
-
|
|
5629
|
+
ee < f || Ri(e, t.pick === "random" ? d[Math.floor(Pi(S, u) * d.length)] : t.pick === "row" ? d[v % d.length] : d[Math.min(d.length - 1, Math.floor(ee * d.length))], T, E, s, c, ee, _ ? l * (1 - _ + _ * ee) : l);
|
|
5630
5630
|
}
|
|
5631
5631
|
}
|
|
5632
5632
|
for (let r = 0; r < Math.round(t.rules ?? 0); r++) {
|
|
@@ -5814,7 +5814,7 @@ var Ui = {
|
|
|
5814
5814
|
],
|
|
5815
5815
|
draw(e, t, n) {
|
|
5816
5816
|
let r = Math.max(1, Math.round(t.cols ?? 4)), i = Math.max(1, Math.round(t.rows ?? 6)), a = t.seed ?? 1, o = t.tex ?? 8, s = t.texSize ?? .45, c = (e, n, r) => (t.alt === "row" ? n % 2 : t.alt === "col" ? e % 2 : t.alt === "random" ? Bi(r, a) < .5 : (e + n) % 2) ? t.fillB ?? "dots" : t.fillA ?? "solid", l = n, u = (t.frame ?? 0) * Math.min(n.w, n.h);
|
|
5817
|
-
u > 0 && (
|
|
5817
|
+
u > 0 && (Te(e, [[
|
|
5818
5818
|
[n.x, n.y],
|
|
5819
5819
|
[n.x + n.w, n.y],
|
|
5820
5820
|
[n.x + n.w, n.y + n.h],
|
|
@@ -5834,7 +5834,7 @@ var Ui = {
|
|
|
5834
5834
|
if (m === "maze") {
|
|
5835
5835
|
let t = Math.max(1, o * s * .4), n = l.x, r = l.y, c = l.x + l.w, u = l.y + l.h;
|
|
5836
5836
|
for (let o = 0; o < i && c - n > 4 * t && u - r > 4 * t; o++) {
|
|
5837
|
-
|
|
5837
|
+
Te(e, [[
|
|
5838
5838
|
[n, r],
|
|
5839
5839
|
[c, r],
|
|
5840
5840
|
[c, u],
|
|
@@ -5883,13 +5883,13 @@ function Ji(e, t) {
|
|
|
5883
5883
|
if (Gi.has(n)) return Gi.get(n);
|
|
5884
5884
|
let r = Wi.get(e), i;
|
|
5885
5885
|
if (!r || e === "pixel") i = {
|
|
5886
|
-
rings:
|
|
5886
|
+
rings: Ne(t),
|
|
5887
5887
|
advance: 5 / 7
|
|
5888
5888
|
};
|
|
5889
5889
|
else {
|
|
5890
5890
|
let e = r.unitsPerEm, n = r.ascender, a = -r.descender, o = r.charToGlyph(t), s = o.getPath(0, n, e).toPathData(2), c = n + a;
|
|
5891
5891
|
i = {
|
|
5892
|
-
rings:
|
|
5892
|
+
rings: Pe(s, 4).map((e) => e.map(([e, t]) => [e / c, t / c])),
|
|
5893
5893
|
advance: (o.advanceWidth || e * .6) / c
|
|
5894
5894
|
};
|
|
5895
5895
|
}
|
|
@@ -6118,8 +6118,8 @@ var ra = {
|
|
|
6118
6118
|
if (!E || E === " ") continue;
|
|
6119
6119
|
let D = Ji(f, E);
|
|
6120
6120
|
if (!D.rings.length) continue;
|
|
6121
|
-
let
|
|
6122
|
-
|
|
6121
|
+
let ee = (t.sizeBy ? (t.sizeMin ?? .2) + (1 - (t.sizeMin ?? .2)) * T : 1) * v, O = c * ee, te = t.fitCell ? s * ee : D.advance * O, ne = t.fitCell ? te / Math.max(1e-6, D.advance) : O, re = n.x + x * n.w - te / 2, ie = n.y + S * n.h - O / 2;
|
|
6122
|
+
Te(e, D.rings.map((e) => e.map(([e, t]) => [re + e * ne, ie + t * O])));
|
|
6123
6123
|
}
|
|
6124
6124
|
}
|
|
6125
6125
|
}, ia = (e) => {
|
|
@@ -6282,7 +6282,7 @@ var oa = {
|
|
|
6282
6282
|
draw(e, t, n, { field: r, mask: i, warp: a }) {
|
|
6283
6283
|
let o = Math.max(1, Math.round(t.cols ?? 40)), s = (t.tile ?? "hex") === "hex", c = n.w / o, l = s ? c / Math.sqrt(3) : c / 2, u = s ? l * 1.5 : c, d = Math.ceil(n.h / u) + 1;
|
|
6284
6284
|
for (let f = 0; f < d; f++) for (let d = 0; d <= o; d++) {
|
|
6285
|
-
let o = (d + (s && f % 2 ? .5 : 0)) * c,
|
|
6285
|
+
let o = (d + (s && f % 2 ? .5 : 0)) * c, m = f * u, h = o / n.w, g = m / n.h, _ = h, v = g;
|
|
6286
6286
|
if (a) {
|
|
6287
6287
|
let [e, n] = a(h, g);
|
|
6288
6288
|
t.wTarget === "field" ? (_ = e, v = n) : (h = _ = e, g = v = n);
|
|
@@ -6291,10 +6291,10 @@ var oa = {
|
|
|
6291
6291
|
let y = r(_, v);
|
|
6292
6292
|
if (y < (t.min ?? .05)) continue;
|
|
6293
6293
|
let b = y * (1 - (t.gap ?? .08)), x = n.x + h * n.w, S = n.y + g * n.h;
|
|
6294
|
-
s ?
|
|
6294
|
+
s ? p(e, Array.from({ length: 6 }, (e, t) => {
|
|
6295
6295
|
let n = Math.PI / 3 * t + Math.PI / 6;
|
|
6296
6296
|
return [x + Math.cos(n) * l * b, S + Math.sin(n) * l * b];
|
|
6297
|
-
})) :
|
|
6297
|
+
})) : p(e, [
|
|
6298
6298
|
[x - c / 2 * b, S - c / 2 * b],
|
|
6299
6299
|
[x + c / 2 * b, S - c / 2 * b],
|
|
6300
6300
|
[x + c / 2 * b, S + c / 2 * b],
|
|
@@ -7667,7 +7667,7 @@ var da = [
|
|
|
7667
7667
|
Ui,
|
|
7668
7668
|
oa,
|
|
7669
7669
|
sa,
|
|
7670
|
-
|
|
7670
|
+
Ie
|
|
7671
7671
|
], fa = (e) => da.find((t) => t.id === e) ?? da[0], pa = [
|
|
7672
7672
|
{
|
|
7673
7673
|
key: "jPos",
|
|
@@ -7743,7 +7743,7 @@ function ha(e, t) {
|
|
|
7743
7743
|
}
|
|
7744
7744
|
function ga(e, t, n, r) {
|
|
7745
7745
|
if (!t.repOn) return e;
|
|
7746
|
-
let i =
|
|
7746
|
+
let i = h(t, {
|
|
7747
7747
|
x: 0,
|
|
7748
7748
|
y: 0,
|
|
7749
7749
|
w: n,
|
|
@@ -7899,7 +7899,7 @@ function Ca(e, t, n, { rings: r = null, image: i = null } = {}) {
|
|
|
7899
7899
|
rings: r,
|
|
7900
7900
|
image: i
|
|
7901
7901
|
};
|
|
7902
|
-
return a.sampled && (u.field =
|
|
7902
|
+
return a.sampled && (u.field = ai(e, l, i), u.mask = ui(e, l, r), u.warp = a.warp === !1 ? null : di(e, l, u.field)), a.draw(o, e, s, u), ga(ha(o, e), e, t, n);
|
|
7903
7903
|
}
|
|
7904
7904
|
//#endregion
|
|
7905
7905
|
//#region src/editor/generate/generateCore.js
|
|
@@ -7940,7 +7940,7 @@ function Da(e, t = wa.get(e.id) ?? null, n = Ta.get(e.id) ?? null) {
|
|
|
7940
7940
|
};
|
|
7941
7941
|
}
|
|
7942
7942
|
function Oa(e, t, n = Da(e)) {
|
|
7943
|
-
let r = e.w ?? 0, i = e.h ?? 0, a = t.bg ? `<rect width="${r}" height="${i}" fill="${t.bg}"/>` : "", o =
|
|
7943
|
+
let r = e.w ?? 0, i = e.h ?? 0, a = t.bg ? `<rect width="${r}" height="${i}" fill="${t.bg}"/>` : "", o = te(n);
|
|
7944
7944
|
return a + (o ? `<path d="${o}" fill="${t.ink ?? "#FFFFFF"}"/>` : "");
|
|
7945
7945
|
}
|
|
7946
7946
|
//#endregion
|
|
@@ -7948,13 +7948,13 @@ function Oa(e, t, n = Da(e)) {
|
|
|
7948
7948
|
function ka(e) {
|
|
7949
7949
|
if (!e) return null;
|
|
7950
7950
|
let t = e.x ?? 0, n = e.y ?? 0, r = (e) => e.map((e) => e.map(([e, r]) => [e + t, r + n]));
|
|
7951
|
-
if (e.type === "shape") return r(
|
|
7952
|
-
if (e.type === "path") return r(
|
|
7951
|
+
if (e.type === "shape") return r(Pe(se(e) || "", 8));
|
|
7952
|
+
if (e.type === "path") return r(Pe([e.nodes ?? [], ...e.holes ?? []].map((e) => pe(e, !0)).join(" "), 8));
|
|
7953
7953
|
if (e.type === "misc" && e.loopId === "paratype-glyph") {
|
|
7954
|
-
let r = { ...
|
|
7955
|
-
for (let t of Object.keys(
|
|
7954
|
+
let r = { ...Re };
|
|
7955
|
+
for (let t of Object.keys(Re)) e[t] != null && typeof e[t] != "object" && (r[t] = e[t]);
|
|
7956
7956
|
let i = [];
|
|
7957
|
-
for (let a of
|
|
7957
|
+
for (let a of qe(r, Math.max(1, e.w ?? 480), Math.max(1, e.h ?? 480))) for (let e of a.g.paths) for (let r of Pe(e.d, 6)) i.push(r.map(([e, r]) => [t + a.tx + e * a.s, n + a.ty - r * a.s]));
|
|
7958
7958
|
return i;
|
|
7959
7959
|
}
|
|
7960
7960
|
return null;
|
|
@@ -7966,14 +7966,14 @@ function Aa(e, t) {
|
|
|
7966
7966
|
}
|
|
7967
7967
|
function ja(e, t, n = .9) {
|
|
7968
7968
|
if (!e?.length) return null;
|
|
7969
|
-
let r = Sa(t, t.w ?? 0, t.h ?? 0), i =
|
|
7969
|
+
let r = Sa(t, t.w ?? 0, t.h ?? 0), i = Fe(e), a = Math.min(r.w * n / (i.w || 1), r.h * n / (i.h || 1));
|
|
7970
7970
|
return e.map((e) => e.map(([e, t]) => [(r.w / 2 + (e - i.x - i.w / 2) * a) / r.w, (r.h / 2 + (t - i.y - i.h / 2) * a) / r.h]));
|
|
7971
7971
|
}
|
|
7972
7972
|
async function Ma(e, t = "inter", n = 700) {
|
|
7973
|
-
return
|
|
7973
|
+
return Pe((await fe(t, n, !1)).getPath(e || "A", 0, 0, 1e3).toPathData(2), 8);
|
|
7974
7974
|
}
|
|
7975
7975
|
function Na(e) {
|
|
7976
|
-
let { layers: t } =
|
|
7976
|
+
let { layers: t } = g(), n = e.mKind, [r, i] = un(null), a = e.mChar, o = vi(e), s = e.mWeight;
|
|
7977
7977
|
on(() => {
|
|
7978
7978
|
if (n !== "letter") return;
|
|
7979
7979
|
let e = !0;
|
|
@@ -7990,7 +7990,7 @@ function Na(e) {
|
|
|
7990
7990
|
o,
|
|
7991
7991
|
s
|
|
7992
7992
|
]);
|
|
7993
|
-
let c = n === "layer" && e.mLayer ?
|
|
7993
|
+
let c = n === "layer" && e.mLayer ? j(t, e.mLayer) : null, l = [
|
|
7994
7994
|
e.x,
|
|
7995
7995
|
e.y,
|
|
7996
7996
|
e.w,
|
|
@@ -8056,7 +8056,7 @@ function La(e, t, n) {
|
|
|
8056
8056
|
};
|
|
8057
8057
|
}
|
|
8058
8058
|
function Ra(e) {
|
|
8059
|
-
let { layers: t } =
|
|
8059
|
+
let { layers: t } = g(), n = (e.fKind === "image" || e.gKind === "image") && e.fImgLayer ? ce(j(t, e.fImgLayer)) : null, r = n?.src ?? null, [i, a] = un(null);
|
|
8060
8060
|
return on(() => {
|
|
8061
8061
|
if (!r) {
|
|
8062
8062
|
a(null);
|
|
@@ -8083,13 +8083,13 @@ function Ra(e) {
|
|
|
8083
8083
|
//#endregion
|
|
8084
8084
|
//#region src/editor/generate/GenerateLayer.jsx
|
|
8085
8085
|
function za({ layer: e, palette: t, layerStyle: n }) {
|
|
8086
|
-
let r = Na(e), i = Pa(e), a = Ra(e), o = cn(() => (wa.set(e.id, r), Ta.set(e.id, a),
|
|
8086
|
+
let r = Na(e), i = Pa(e), a = Ra(e), o = cn(() => (wa.set(e.id, r), Ta.set(e.id, a), te(Da(e, r, a))), [
|
|
8087
8087
|
Ea(e),
|
|
8088
8088
|
r,
|
|
8089
8089
|
i,
|
|
8090
8090
|
a
|
|
8091
|
-
]), s =
|
|
8092
|
-
return /* @__PURE__ */
|
|
8091
|
+
]), s = ye(e.color, t) ?? "#FFFFFF", c = e.bg == null ? null : ye(e.bg, t), l = Math.max(1, e.w ?? 1), u = Math.max(1, e.h ?? 1);
|
|
8092
|
+
return /* @__PURE__ */ I("svg", {
|
|
8093
8093
|
"data-layer-id": e.id,
|
|
8094
8094
|
width: l,
|
|
8095
8095
|
height: u,
|
|
@@ -8102,11 +8102,11 @@ function za({ layer: e, palette: t, layerStyle: n }) {
|
|
|
8102
8102
|
cursor: "move",
|
|
8103
8103
|
...n
|
|
8104
8104
|
},
|
|
8105
|
-
children: [c && /* @__PURE__ */
|
|
8105
|
+
children: [c && /* @__PURE__ */ F("rect", {
|
|
8106
8106
|
width: l,
|
|
8107
8107
|
height: u,
|
|
8108
8108
|
fill: c
|
|
8109
|
-
}), o && /* @__PURE__ */
|
|
8109
|
+
}), o && /* @__PURE__ */ F("path", {
|
|
8110
8110
|
d: o,
|
|
8111
8111
|
fill: s
|
|
8112
8112
|
})]
|
|
@@ -9579,7 +9579,7 @@ var ko = [{
|
|
|
9579
9579
|
kind: "Repeat",
|
|
9580
9580
|
title: () => "Repeat",
|
|
9581
9581
|
init: () => ({
|
|
9582
|
-
...
|
|
9582
|
+
...S,
|
|
9583
9583
|
sourceId: null
|
|
9584
9584
|
}),
|
|
9585
9585
|
header: [qa("Expand", { act: "expand" })],
|
|
@@ -9905,17 +9905,17 @@ function ts(e, t, n = e.key) {
|
|
|
9905
9905
|
};
|
|
9906
9906
|
}
|
|
9907
9907
|
var ns = (e, t) => e.key === "style" ? `style:${oo(t.genStyle)}` : e.key, rs = (e) => e.flatMap((e) => [e, ...e.children ? rs(e.children) : []]), is = {
|
|
9908
|
-
photo: (e) => !!
|
|
9908
|
+
photo: (e) => !!ce(e),
|
|
9909
9909
|
shape: (e) => e.type === "shape",
|
|
9910
9910
|
path: (e) => e.type === "path",
|
|
9911
9911
|
misc: (e) => e.type === "misc" && e.loopId === "paratype-glyph"
|
|
9912
9912
|
};
|
|
9913
9913
|
function as(e) {
|
|
9914
|
-
let t = qo[e], n = x("generators"), r =
|
|
9914
|
+
let t = qo[e], n = x("generators"), r = g(), i = () => n ? n.presetParams({
|
|
9915
9915
|
id: "type",
|
|
9916
9916
|
loop: t.loop,
|
|
9917
9917
|
params: {}
|
|
9918
|
-
}) : {}, { params: a, layerId: o, live: c, contentKey: l } =
|
|
9918
|
+
}) : {}, { params: a, layerId: o, live: c, contentKey: l } = wt(e, t.init ?? i), u = (t) => vt(e, (e) => ({ params: t(e.params) })), d = (e) => (n) => u((r) => ({
|
|
9919
9919
|
...r,
|
|
9920
9920
|
...Yo(t, e, n, r)
|
|
9921
9921
|
})), f = t.sections(a), p = rs(r.layers ?? []), m = (e) => e.name || e.genLabel || e.presetLabel || e.kind || e.type, h = (e) => p.filter((t) => t.type !== "background" && t.id !== o && (e.kinds ? e.kinds.some((e) => is[e]?.(t)) : t.type !== "repeat" && t.w != null)).map((e) => ({
|
|
@@ -9924,7 +9924,7 @@ function as(e) {
|
|
|
9924
9924
|
}));
|
|
9925
9925
|
on(() => {
|
|
9926
9926
|
if (e !== "repeat" || a.sourceId) return;
|
|
9927
|
-
let t = r.selectedId && r.selectedId !== "canvas" ?
|
|
9927
|
+
let t = r.selectedId && r.selectedId !== "canvas" ? j(r.layers, r.selectedId) : null;
|
|
9928
9928
|
t && t.type !== "repeat" && t.w != null && u((e) => ({
|
|
9929
9929
|
...e,
|
|
9930
9930
|
sourceId: t.id
|
|
@@ -9934,7 +9934,7 @@ function as(e) {
|
|
|
9934
9934
|
a.sourceId,
|
|
9935
9935
|
r.selectedId
|
|
9936
9936
|
]);
|
|
9937
|
-
let
|
|
9937
|
+
let _ = e === "generate" ? [...a.genPreset ? [] : [{
|
|
9938
9938
|
value: "custom",
|
|
9939
9939
|
label: "Custom"
|
|
9940
9940
|
}], ...Ro(a.genStyle).map((e) => ({
|
|
@@ -9948,7 +9948,7 @@ function as(e) {
|
|
|
9948
9948
|
if (e !== "generate") return n;
|
|
9949
9949
|
let r = "";
|
|
9950
9950
|
try {
|
|
9951
|
-
r =
|
|
9951
|
+
r = te(Ca({
|
|
9952
9952
|
...n,
|
|
9953
9953
|
x: 0,
|
|
9954
9954
|
y: 0,
|
|
@@ -9982,7 +9982,7 @@ function as(e) {
|
|
|
9982
9982
|
...a,
|
|
9983
9983
|
...e === "generate" ? { genPreset: null } : {}
|
|
9984
9984
|
};
|
|
9985
|
-
}, S = o ?
|
|
9985
|
+
}, S = o ? j(r.layers ?? [], o) : null, C = e === "repeat" ? !!a.sourceId : e === "type" ? !!n : !0, w = () => {
|
|
9986
9986
|
if (!C) return null;
|
|
9987
9987
|
if (e === "type") {
|
|
9988
9988
|
if (S) return r.updateLayer(S.id, a), S.id;
|
|
@@ -9993,20 +9993,20 @@ function as(e) {
|
|
|
9993
9993
|
loopId: t.loop,
|
|
9994
9994
|
...a
|
|
9995
9995
|
});
|
|
9996
|
-
return
|
|
9996
|
+
return vt(e, { layerId: n }), n;
|
|
9997
9997
|
}
|
|
9998
9998
|
let n = e === "generate" ? "generate" : "repeat";
|
|
9999
|
-
if (l &&
|
|
9999
|
+
if (l && re(S).some((e) => e.key === l)) return r.updateContent(S.id, l, a), S.id;
|
|
10000
10000
|
if (S?.type === n) return r.updateLayer(S.id, a), S.id;
|
|
10001
10001
|
let i = r.addLayer(n, {
|
|
10002
10002
|
...a,
|
|
10003
10003
|
...e === "repeat" ? { name: "Repeat" } : {}
|
|
10004
10004
|
});
|
|
10005
|
-
return
|
|
10005
|
+
return vt(e, { layerId: i }), i;
|
|
10006
10006
|
}, T = () => {
|
|
10007
10007
|
let t = w();
|
|
10008
10008
|
t && setTimeout(() => {
|
|
10009
|
-
e === "generate" ? r.flattenGenerate(t) : e === "repeat" ? r.flattenRepeat(t) : r.flattenParatype(t),
|
|
10009
|
+
e === "generate" ? r.flattenGenerate(t) : e === "repeat" ? r.flattenRepeat(t) : r.flattenParatype(t), vt(e, { layerId: null });
|
|
10010
10010
|
}, 0);
|
|
10011
10011
|
};
|
|
10012
10012
|
return {
|
|
@@ -10018,22 +10018,22 @@ function as(e) {
|
|
|
10018
10018
|
setParams: u,
|
|
10019
10019
|
set: d,
|
|
10020
10020
|
sections: f,
|
|
10021
|
-
presets:
|
|
10021
|
+
presets: _,
|
|
10022
10022
|
setPreset: v,
|
|
10023
10023
|
randomise: y,
|
|
10024
10024
|
layersFor: h,
|
|
10025
10025
|
apply: w,
|
|
10026
10026
|
expand: T,
|
|
10027
10027
|
run: (e) => {
|
|
10028
|
-
e === "expand" ? T() : e === "open-type" &&
|
|
10028
|
+
e === "expand" ? T() : e === "open-type" && xt("type");
|
|
10029
10029
|
},
|
|
10030
|
-
reset: () =>
|
|
10030
|
+
reset: () => vt(e, {
|
|
10031
10031
|
params: (t.init ?? i)(),
|
|
10032
10032
|
layerId: null,
|
|
10033
10033
|
contentKey: null
|
|
10034
10034
|
}),
|
|
10035
10035
|
live: c,
|
|
10036
|
-
setLive: (t) =>
|
|
10036
|
+
setLive: (t) => vt(e, { live: t }),
|
|
10037
10037
|
canApply: C,
|
|
10038
10038
|
target: S,
|
|
10039
10039
|
contentKey: l,
|
|
@@ -10056,7 +10056,7 @@ function os({ t: e, className: t = "" }) {
|
|
|
10056
10056
|
]), l = Na(c), u = Pa(c), d = Ra(c), f = ln(""), p = cn(() => {
|
|
10057
10057
|
if (!i) return f.current;
|
|
10058
10058
|
try {
|
|
10059
|
-
f.current =
|
|
10059
|
+
f.current = te(Ca(c, a, o, {
|
|
10060
10060
|
rings: l,
|
|
10061
10061
|
image: d
|
|
10062
10062
|
}));
|
|
@@ -10070,24 +10070,24 @@ function os({ t: e, className: t = "" }) {
|
|
|
10070
10070
|
i,
|
|
10071
10071
|
a,
|
|
10072
10072
|
o
|
|
10073
|
-
]), m =
|
|
10074
|
-
return /* @__PURE__ */
|
|
10073
|
+
]), m = ye(n.color, r.palette) ?? "#FFFFFF", h = n.bg == null ? null : ye(n.bg, r.palette);
|
|
10074
|
+
return /* @__PURE__ */ I("svg", {
|
|
10075
10075
|
viewBox: `0 0 ${a} ${o}`,
|
|
10076
10076
|
preserveAspectRatio: "xMidYMid meet",
|
|
10077
10077
|
className: t,
|
|
10078
10078
|
"data-preview": !0,
|
|
10079
|
-
children: [h && /* @__PURE__ */
|
|
10079
|
+
children: [h && /* @__PURE__ */ F("rect", {
|
|
10080
10080
|
width: a,
|
|
10081
10081
|
height: o,
|
|
10082
10082
|
fill: h
|
|
10083
|
-
}), p && /* @__PURE__ */
|
|
10083
|
+
}), p && /* @__PURE__ */ F("path", {
|
|
10084
10084
|
d: p,
|
|
10085
10085
|
fill: m
|
|
10086
10086
|
})]
|
|
10087
10087
|
});
|
|
10088
10088
|
}
|
|
10089
10089
|
function ss({ t: e, className: t = "" }) {
|
|
10090
|
-
let { params: n, state: r } = e, i = n.sourceId ?
|
|
10090
|
+
let { params: n, state: r } = e, i = n.sourceId ? j(r.layers ?? [], n.sourceId) : null, a = i && i.w != null ? {
|
|
10091
10091
|
x: i.x ?? 0,
|
|
10092
10092
|
y: i.y ?? 0,
|
|
10093
10093
|
w: i.w,
|
|
@@ -10097,37 +10097,37 @@ function ss({ t: e, className: t = "" }) {
|
|
|
10097
10097
|
y: 440,
|
|
10098
10098
|
w: 200,
|
|
10099
10099
|
h: 200
|
|
10100
|
-
}, o =
|
|
10100
|
+
}, o = h(n, a), s = [[a.x, a.y], [a.x + a.w, a.y + a.h]];
|
|
10101
10101
|
for (let e of o) for (let [t, n] of [
|
|
10102
10102
|
[a.x, a.y],
|
|
10103
10103
|
[a.x + a.w, a.y],
|
|
10104
10104
|
[a.x, a.y + a.h],
|
|
10105
10105
|
[a.x + a.w, a.y + a.h]
|
|
10106
10106
|
]) s.push([e[0] * t + e[2] * n + e[4], e[1] * t + e[3] * n + e[5]]);
|
|
10107
|
-
let c = s.map((e) => e[0]), l = s.map((e) => e[1]), u = Math.min(...c) - 24, d = Math.min(...l) - 24, f = Math.max(...c) - u + 24, p = Math.max(...l) - d + 24, m = Math.max(f, p) / 200,
|
|
10107
|
+
let c = s.map((e) => e[0]), l = s.map((e) => e[1]), u = Math.min(...c) - 24, d = Math.min(...l) - 24, f = Math.max(...c) - u + 24, p = Math.max(...l) - d + 24, m = Math.max(f, p) / 200, g = /* @__PURE__ */ F("rect", {
|
|
10108
10108
|
x: a.x,
|
|
10109
10109
|
y: a.y,
|
|
10110
10110
|
width: a.w,
|
|
10111
10111
|
height: a.h,
|
|
10112
10112
|
rx: a.w / 12
|
|
10113
10113
|
});
|
|
10114
|
-
return /* @__PURE__ */
|
|
10114
|
+
return /* @__PURE__ */ I("svg", {
|
|
10115
10115
|
viewBox: `${u} ${d} ${f} ${p}`,
|
|
10116
10116
|
preserveAspectRatio: "xMidYMid meet",
|
|
10117
10117
|
className: t,
|
|
10118
10118
|
"data-preview": !0,
|
|
10119
10119
|
"data-copies": o.length,
|
|
10120
|
-
children: [/* @__PURE__ */
|
|
10120
|
+
children: [/* @__PURE__ */ F("g", {
|
|
10121
10121
|
fill: "var(--kol-oq-16)",
|
|
10122
10122
|
stroke: "var(--kol-fg-64)",
|
|
10123
10123
|
strokeWidth: m,
|
|
10124
|
-
children: o.map((e, t) => /* @__PURE__ */
|
|
10124
|
+
children: o.map((e, t) => /* @__PURE__ */ F("g", {
|
|
10125
10125
|
transform: `matrix(${e.join(" ")})`,
|
|
10126
|
-
children:
|
|
10126
|
+
children: g
|
|
10127
10127
|
}, t))
|
|
10128
|
-
}), /* @__PURE__ */
|
|
10128
|
+
}), /* @__PURE__ */ F("g", {
|
|
10129
10129
|
fill: "var(--kol-fg-96)",
|
|
10130
|
-
children:
|
|
10130
|
+
children: g
|
|
10131
10131
|
})]
|
|
10132
10132
|
});
|
|
10133
10133
|
}
|
|
@@ -10146,7 +10146,7 @@ function cs({ t: e, size: t = 512, className: n = "" }) {
|
|
|
10146
10146
|
s,
|
|
10147
10147
|
i,
|
|
10148
10148
|
t
|
|
10149
|
-
]), /* @__PURE__ */
|
|
10149
|
+
]), /* @__PURE__ */ F("canvas", {
|
|
10150
10150
|
ref: r,
|
|
10151
10151
|
width: t,
|
|
10152
10152
|
height: t,
|
|
@@ -10154,19 +10154,19 @@ function cs({ t: e, size: t = 512, className: n = "" }) {
|
|
|
10154
10154
|
"data-preview": !0
|
|
10155
10155
|
});
|
|
10156
10156
|
}
|
|
10157
|
-
var ls = ({ t: e, className: t }) => e.id === "generate" ? /* @__PURE__ */
|
|
10157
|
+
var ls = ({ t: e, className: t }) => e.id === "generate" ? /* @__PURE__ */ F(os, {
|
|
10158
10158
|
t: e,
|
|
10159
10159
|
className: t
|
|
10160
|
-
}) : e.id === "repeat" ? /* @__PURE__ */
|
|
10160
|
+
}) : e.id === "repeat" ? /* @__PURE__ */ F(ss, {
|
|
10161
10161
|
t: e,
|
|
10162
10162
|
className: t
|
|
10163
|
-
}) : /* @__PURE__ */
|
|
10163
|
+
}) : /* @__PURE__ */ F(cs, {
|
|
10164
10164
|
t: e,
|
|
10165
10165
|
className: t
|
|
10166
10166
|
}), us = {
|
|
10167
10167
|
Lights: "Lights / Point editor",
|
|
10168
10168
|
Image: "Image / Layer source"
|
|
10169
|
-
}, ds = "[--kol-slider-float-run:var(--kol-accent-primary)]", fs = "h-7 !rounded-md", ps = (e, t = !1) => `calc(${e}ch + ${t ? 38 : 22}px)`, ms = (e, t, n, r, i) => /* @__PURE__ */
|
|
10169
|
+
}, ds = "[--kol-slider-float-run:var(--kol-accent-primary)]", fs = "h-7 !rounded-md", ps = (e, t = !1) => `calc(${e}ch + ${t ? 38 : 22}px)`, ms = (e, t, n, r, i) => /* @__PURE__ */ F(Ft, {
|
|
10170
10170
|
size: "sm",
|
|
10171
10171
|
options: e,
|
|
10172
10172
|
value: t,
|
|
@@ -10178,7 +10178,7 @@ var ls = ({ t: e, className: t }) => e.id === "generate" ? /* @__PURE__ */ P(os,
|
|
|
10178
10178
|
function hs({ x: e, t }) {
|
|
10179
10179
|
let n = t.valueOf(e), r = e.bind ? t.set(e) : () => {}, i = !t.isLive(e);
|
|
10180
10180
|
switch (e.type) {
|
|
10181
|
-
case "slider": return /* @__PURE__ */
|
|
10181
|
+
case "slider": return /* @__PURE__ */ F(Zt, {
|
|
10182
10182
|
readout: "input",
|
|
10183
10183
|
value: Number(n),
|
|
10184
10184
|
onChange: r,
|
|
@@ -10190,7 +10190,7 @@ function hs({ x: e, t }) {
|
|
|
10190
10190
|
"aria-label": e.name,
|
|
10191
10191
|
className: "flex-1 min-w-0"
|
|
10192
10192
|
});
|
|
10193
|
-
case "range": return /* @__PURE__ */
|
|
10193
|
+
case "range": return /* @__PURE__ */ I(P, { children: [/* @__PURE__ */ F(Zt, {
|
|
10194
10194
|
variant: "dual",
|
|
10195
10195
|
value: n[0],
|
|
10196
10196
|
value2: n[1],
|
|
@@ -10204,7 +10204,7 @@ function hs({ x: e, t }) {
|
|
|
10204
10204
|
onChange: (e) => r([Math.min(e, n[1]), n[1]]),
|
|
10205
10205
|
onChange2: (e) => r([n[0], Math.max(e, n[0])]),
|
|
10206
10206
|
className: "flex-1 min-w-0"
|
|
10207
|
-
}), /* @__PURE__ */
|
|
10207
|
+
}), /* @__PURE__ */ I("span", {
|
|
10208
10208
|
className: "kol-float-timecode text-fg-emphasis w-[66px] shrink-0 text-right text-[11px]",
|
|
10209
10209
|
children: [
|
|
10210
10210
|
(e.format ?? String)(n[0]),
|
|
@@ -10212,7 +10212,7 @@ function hs({ x: e, t }) {
|
|
|
10212
10212
|
(e.format ?? String)(n[1])
|
|
10213
10213
|
]
|
|
10214
10214
|
})] });
|
|
10215
|
-
case "point": return ["X", "Y"].map((t, a) => /* @__PURE__ */
|
|
10215
|
+
case "point": return ["X", "Y"].map((t, a) => /* @__PURE__ */ F(Lt, {
|
|
10216
10216
|
size: "sm",
|
|
10217
10217
|
prefix: t,
|
|
10218
10218
|
disabled: i,
|
|
@@ -10225,7 +10225,7 @@ function hs({ x: e, t }) {
|
|
|
10225
10225
|
}
|
|
10226
10226
|
}, t));
|
|
10227
10227
|
case "select": return ms(e.options, n, r, e.name, i);
|
|
10228
|
-
case "segmented": return /* @__PURE__ */
|
|
10228
|
+
case "segmented": return /* @__PURE__ */ F($t, {
|
|
10229
10229
|
size: "xs",
|
|
10230
10230
|
tabs: e.options,
|
|
10231
10231
|
value: n,
|
|
@@ -10233,9 +10233,9 @@ function hs({ x: e, t }) {
|
|
|
10233
10233
|
ariaLabel: e.name,
|
|
10234
10234
|
className: "w-full [&>*]:flex-1"
|
|
10235
10235
|
});
|
|
10236
|
-
case "toggle": return /* @__PURE__ */
|
|
10236
|
+
case "toggle": return /* @__PURE__ */ F("span", {
|
|
10237
10237
|
className: "flex-1 flex justify-end",
|
|
10238
|
-
children: /* @__PURE__ */
|
|
10238
|
+
children: /* @__PURE__ */ F(en, {
|
|
10239
10239
|
checked: !!n,
|
|
10240
10240
|
onChange: r,
|
|
10241
10241
|
disabled: i,
|
|
@@ -10243,7 +10243,7 @@ function hs({ x: e, t }) {
|
|
|
10243
10243
|
})
|
|
10244
10244
|
});
|
|
10245
10245
|
case "text":
|
|
10246
|
-
case "color": return /* @__PURE__ */
|
|
10246
|
+
case "color": return /* @__PURE__ */ F(Lt, {
|
|
10247
10247
|
size: "sm",
|
|
10248
10248
|
value: n ?? "",
|
|
10249
10249
|
disabled: i,
|
|
@@ -10255,7 +10255,7 @@ function hs({ x: e, t }) {
|
|
|
10255
10255
|
value: "",
|
|
10256
10256
|
label: e.kinds?.includes("photo") ? "Choose photo layer…" : "None"
|
|
10257
10257
|
}, ...t.layersFor(e)], n ?? "", r, e.name, i);
|
|
10258
|
-
case "button": return /* @__PURE__ */
|
|
10258
|
+
case "button": return /* @__PURE__ */ F(M, {
|
|
10259
10259
|
tone: "secondary",
|
|
10260
10260
|
size: "sm",
|
|
10261
10261
|
disabled: i,
|
|
@@ -10263,8 +10263,8 @@ function hs({ x: e, t }) {
|
|
|
10263
10263
|
className: "w-full",
|
|
10264
10264
|
children: e.name
|
|
10265
10265
|
});
|
|
10266
|
-
case "ramp": return /* @__PURE__ */
|
|
10267
|
-
/* @__PURE__ */
|
|
10266
|
+
case "ramp": return /* @__PURE__ */ I(P, { children: [
|
|
10267
|
+
/* @__PURE__ */ F(Lt, {
|
|
10268
10268
|
size: "sm",
|
|
10269
10269
|
"aria-label": `${e.name} A`,
|
|
10270
10270
|
width: ps(5),
|
|
@@ -10279,14 +10279,14 @@ function hs({ x: e, t }) {
|
|
|
10279
10279
|
});
|
|
10280
10280
|
}
|
|
10281
10281
|
}),
|
|
10282
|
-
/* @__PURE__ */
|
|
10282
|
+
/* @__PURE__ */ F("div", {
|
|
10283
10283
|
className: "flex-1 min-w-0",
|
|
10284
10284
|
children: ms(e.curves ?? Xa, n.curve, (e) => r({
|
|
10285
10285
|
...n,
|
|
10286
10286
|
curve: e
|
|
10287
10287
|
}), `${e.name} curve`, i)
|
|
10288
10288
|
}),
|
|
10289
|
-
/* @__PURE__ */
|
|
10289
|
+
/* @__PURE__ */ F(Lt, {
|
|
10290
10290
|
size: "sm",
|
|
10291
10291
|
"aria-label": `${e.name} B`,
|
|
10292
10292
|
width: ps(5),
|
|
@@ -10310,7 +10310,7 @@ function _s({ x: e, t }) {
|
|
|
10310
10310
|
let n = t.valueOf(e), r = t.set(e), i = (e, t, i) => r(n.map((n, r) => r === e ? {
|
|
10311
10311
|
...n,
|
|
10312
10312
|
[t]: i
|
|
10313
|
-
} : n)), a = (e, t, r) => /* @__PURE__ */
|
|
10313
|
+
} : n)), a = (e, t, r) => /* @__PURE__ */ F(Lt, {
|
|
10314
10314
|
size: "sm",
|
|
10315
10315
|
prefix: r,
|
|
10316
10316
|
"aria-label": `Light ${e + 1} ${r ?? t}`,
|
|
@@ -10321,34 +10321,34 @@ function _s({ x: e, t }) {
|
|
|
10321
10321
|
Number.isFinite(r) && i(e, t, r);
|
|
10322
10322
|
}
|
|
10323
10323
|
});
|
|
10324
|
-
return /* @__PURE__ */
|
|
10324
|
+
return /* @__PURE__ */ I("div", {
|
|
10325
10325
|
className: "flex flex-col gap-2",
|
|
10326
10326
|
"data-control": "Lights",
|
|
10327
10327
|
children: [
|
|
10328
|
-
/* @__PURE__ */
|
|
10328
|
+
/* @__PURE__ */ I("div", {
|
|
10329
10329
|
className: "grid items-center gap-x-1.5 kol-mono-12 text-oq-64",
|
|
10330
10330
|
style: { gridTemplateColumns: gs },
|
|
10331
10331
|
children: [
|
|
10332
|
-
/* @__PURE__ */
|
|
10333
|
-
/* @__PURE__ */
|
|
10332
|
+
/* @__PURE__ */ F("span", {}),
|
|
10333
|
+
/* @__PURE__ */ F("span", {
|
|
10334
10334
|
className: "col-span-2 kol-float-label",
|
|
10335
10335
|
children: "Position"
|
|
10336
10336
|
}),
|
|
10337
|
-
/* @__PURE__ */
|
|
10337
|
+
/* @__PURE__ */ F("span", {
|
|
10338
10338
|
className: "kol-float-label",
|
|
10339
10339
|
children: "Radius"
|
|
10340
10340
|
}),
|
|
10341
|
-
/* @__PURE__ */
|
|
10341
|
+
/* @__PURE__ */ F("span", {
|
|
10342
10342
|
className: "col-span-3 kol-float-label",
|
|
10343
10343
|
children: "Intensity"
|
|
10344
10344
|
})
|
|
10345
10345
|
]
|
|
10346
10346
|
}),
|
|
10347
|
-
/* @__PURE__ */
|
|
10347
|
+
/* @__PURE__ */ F("div", {
|
|
10348
10348
|
className: "grid items-center gap-x-1.5 gap-y-2 kol-mono-12",
|
|
10349
10349
|
style: { gridTemplateColumns: gs },
|
|
10350
|
-
children: n.map((e, t) => /* @__PURE__ */
|
|
10351
|
-
/* @__PURE__ */
|
|
10350
|
+
children: n.map((e, t) => /* @__PURE__ */ I(rn, { children: [
|
|
10351
|
+
/* @__PURE__ */ F("span", {
|
|
10352
10352
|
className: "text-oq-48 select-none",
|
|
10353
10353
|
"aria-hidden": !0,
|
|
10354
10354
|
children: "⠿"
|
|
@@ -10356,7 +10356,7 @@ function _s({ x: e, t }) {
|
|
|
10356
10356
|
a(t, "x", "X"),
|
|
10357
10357
|
a(t, "y", "Y"),
|
|
10358
10358
|
a(t, "radius"),
|
|
10359
|
-
/* @__PURE__ */
|
|
10359
|
+
/* @__PURE__ */ F(Zt, {
|
|
10360
10360
|
value: e.intensity,
|
|
10361
10361
|
min: 0,
|
|
10362
10362
|
max: 2,
|
|
@@ -10365,11 +10365,11 @@ function _s({ x: e, t }) {
|
|
|
10365
10365
|
"aria-label": `Light ${t + 1} intensity`,
|
|
10366
10366
|
className: "w-full min-w-0"
|
|
10367
10367
|
}),
|
|
10368
|
-
/* @__PURE__ */
|
|
10368
|
+
/* @__PURE__ */ F("span", {
|
|
10369
10369
|
className: "kol-float-timecode text-fg-emphasis text-[11px] text-right",
|
|
10370
10370
|
children: e.intensity.toFixed(1)
|
|
10371
10371
|
}),
|
|
10372
|
-
/* @__PURE__ */
|
|
10372
|
+
/* @__PURE__ */ F(M, {
|
|
10373
10373
|
tone: "ghost",
|
|
10374
10374
|
size: "sm",
|
|
10375
10375
|
iconOnly: "close",
|
|
@@ -10379,7 +10379,7 @@ function _s({ x: e, t }) {
|
|
|
10379
10379
|
})
|
|
10380
10380
|
] }, t))
|
|
10381
10381
|
}),
|
|
10382
|
-
/* @__PURE__ */
|
|
10382
|
+
/* @__PURE__ */ F(M, {
|
|
10383
10383
|
tone: "ghost",
|
|
10384
10384
|
size: "sm",
|
|
10385
10385
|
iconLeft: "plus",
|
|
@@ -10397,16 +10397,16 @@ function _s({ x: e, t }) {
|
|
|
10397
10397
|
});
|
|
10398
10398
|
}
|
|
10399
10399
|
function vs({ x: e, t }) {
|
|
10400
|
-
let n = t.valueOf(e), r = n ?
|
|
10401
|
-
return /* @__PURE__ */
|
|
10400
|
+
let n = t.valueOf(e), r = n ? j(t.state.layers ?? [], n) : null;
|
|
10401
|
+
return /* @__PURE__ */ I("div", {
|
|
10402
10402
|
className: "flex items-center gap-2",
|
|
10403
10403
|
"data-control": e.name,
|
|
10404
|
-
children: [/* @__PURE__ */
|
|
10404
|
+
children: [/* @__PURE__ */ F("span", {
|
|
10405
10405
|
className: "size-[38px] shrink-0 rounded-md bg-(--kol-float-well) bg-cover bg-center",
|
|
10406
10406
|
style: r?.src ? { backgroundImage: `url(${r.src})` } : void 0
|
|
10407
|
-
}), /* @__PURE__ */
|
|
10407
|
+
}), /* @__PURE__ */ F("div", {
|
|
10408
10408
|
className: "flex-1 min-w-0",
|
|
10409
|
-
children: /* @__PURE__ */
|
|
10409
|
+
children: /* @__PURE__ */ F(hs, {
|
|
10410
10410
|
x: e,
|
|
10411
10411
|
t
|
|
10412
10412
|
})
|
|
@@ -10420,7 +10420,7 @@ function ys({ t: e }) {
|
|
|
10420
10420
|
if (!n || !e.live) return;
|
|
10421
10421
|
let r = n.width, i = n.height, a = n.getContext("2d"), o = a.createImageData(r, i), s;
|
|
10422
10422
|
try {
|
|
10423
|
-
s =
|
|
10423
|
+
s = ai(e.params, r / i);
|
|
10424
10424
|
} catch {
|
|
10425
10425
|
return;
|
|
10426
10426
|
}
|
|
@@ -10429,7 +10429,7 @@ function ys({ t: e }) {
|
|
|
10429
10429
|
o.data[a] = o.data[a + 1] = o.data[a + 2] = n, o.data[a + 3] = 255;
|
|
10430
10430
|
}
|
|
10431
10431
|
a.putImageData(o, 0, 0);
|
|
10432
|
-
}, [e.params, e.live]), /* @__PURE__ */
|
|
10432
|
+
}, [e.params, e.live]), /* @__PURE__ */ F("canvas", {
|
|
10433
10433
|
ref: t,
|
|
10434
10434
|
width: 176,
|
|
10435
10435
|
height: 22,
|
|
@@ -10439,22 +10439,22 @@ function ys({ t: e }) {
|
|
|
10439
10439
|
}
|
|
10440
10440
|
var bs = (e, t) => e.type === "lights" ? {
|
|
10441
10441
|
id: e.id,
|
|
10442
|
-
render: () => /* @__PURE__ */
|
|
10442
|
+
render: () => /* @__PURE__ */ F(_s, {
|
|
10443
10443
|
x: e,
|
|
10444
10444
|
t
|
|
10445
10445
|
}, e.id)
|
|
10446
10446
|
} : e.type === "button" ? {
|
|
10447
10447
|
id: e.id,
|
|
10448
|
-
render: () => /* @__PURE__ */
|
|
10448
|
+
render: () => /* @__PURE__ */ F("div", {
|
|
10449
10449
|
"data-control": e.name,
|
|
10450
|
-
children: /* @__PURE__ */
|
|
10450
|
+
children: /* @__PURE__ */ F(hs, {
|
|
10451
10451
|
x: e,
|
|
10452
10452
|
t
|
|
10453
10453
|
})
|
|
10454
10454
|
}, e.id)
|
|
10455
10455
|
} : e.type === "picker" && e.kinds?.includes("photo") ? {
|
|
10456
10456
|
id: e.id,
|
|
10457
|
-
render: () => /* @__PURE__ */
|
|
10457
|
+
render: () => /* @__PURE__ */ F(vs, {
|
|
10458
10458
|
x: e,
|
|
10459
10459
|
t
|
|
10460
10460
|
}, e.id)
|
|
@@ -10462,7 +10462,7 @@ var bs = (e, t) => e.type === "lights" ? {
|
|
|
10462
10462
|
type: "labeled",
|
|
10463
10463
|
id: e.id,
|
|
10464
10464
|
label: e.name,
|
|
10465
|
-
render: () => /* @__PURE__ */
|
|
10465
|
+
render: () => /* @__PURE__ */ F(hs, {
|
|
10466
10466
|
x: e,
|
|
10467
10467
|
t
|
|
10468
10468
|
})
|
|
@@ -10475,7 +10475,7 @@ function xs(e, t) {
|
|
|
10475
10475
|
type: "labeled",
|
|
10476
10476
|
id: i.id,
|
|
10477
10477
|
label: o[1],
|
|
10478
|
-
render: () => [i, a].map((e, n) => /* @__PURE__ */
|
|
10478
|
+
render: () => [i, a].map((e, n) => /* @__PURE__ */ F(Lt, {
|
|
10479
10479
|
size: "sm",
|
|
10480
10480
|
prefix: n ? "Y" : "X",
|
|
10481
10481
|
"aria-label": e.name,
|
|
@@ -10515,25 +10515,25 @@ function Ss({ id: e, onClose: t, className: n = "" }) {
|
|
|
10515
10515
|
type: "labeled",
|
|
10516
10516
|
id: `${t}-rampcols`,
|
|
10517
10517
|
label: "",
|
|
10518
|
-
render: () => /* @__PURE__ */
|
|
10518
|
+
render: () => /* @__PURE__ */ I("div", {
|
|
10519
10519
|
className: "flex w-full gap-1.5 kol-mono-12 text-oq-64",
|
|
10520
10520
|
children: [
|
|
10521
|
-
/* @__PURE__ */
|
|
10521
|
+
/* @__PURE__ */ F("span", {
|
|
10522
10522
|
className: "shrink-0",
|
|
10523
10523
|
style: { width: ps(5) },
|
|
10524
|
-
children: /* @__PURE__ */
|
|
10524
|
+
children: /* @__PURE__ */ F("span", {
|
|
10525
10525
|
className: "kol-float-label",
|
|
10526
10526
|
children: "Value A"
|
|
10527
10527
|
})
|
|
10528
10528
|
}),
|
|
10529
|
-
/* @__PURE__ */
|
|
10529
|
+
/* @__PURE__ */ F("span", {
|
|
10530
10530
|
className: "flex-1 kol-float-label",
|
|
10531
10531
|
children: "Curve"
|
|
10532
10532
|
}),
|
|
10533
|
-
/* @__PURE__ */
|
|
10533
|
+
/* @__PURE__ */ F("span", {
|
|
10534
10534
|
className: "shrink-0",
|
|
10535
10535
|
style: { width: ps(5) },
|
|
10536
|
-
children: /* @__PURE__ */
|
|
10536
|
+
children: /* @__PURE__ */ F("span", {
|
|
10537
10537
|
className: "kol-float-label",
|
|
10538
10538
|
children: "Value B"
|
|
10539
10539
|
})
|
|
@@ -10543,11 +10543,11 @@ function Ss({ id: e, onClose: t, className: n = "" }) {
|
|
|
10543
10543
|
}] : [],
|
|
10544
10544
|
...xs(e.controls, r)
|
|
10545
10545
|
]), ...o]
|
|
10546
|
-
}), f, p, m = /* @__PURE__ */
|
|
10546
|
+
}), f, p, m = /* @__PURE__ */ F(N, {
|
|
10547
10547
|
horizontal: !0,
|
|
10548
10548
|
label: "Live update",
|
|
10549
10549
|
className: "flex-1",
|
|
10550
|
-
children: /* @__PURE__ */
|
|
10550
|
+
children: /* @__PURE__ */ F(en, {
|
|
10551
10551
|
checked: r.live,
|
|
10552
10552
|
onChange: r.setLive,
|
|
10553
10553
|
"aria-label": "Live update"
|
|
@@ -10565,7 +10565,7 @@ function Ss({ id: e, onClose: t, className: n = "" }) {
|
|
|
10565
10565
|
type: "labeled",
|
|
10566
10566
|
id: "description",
|
|
10567
10567
|
label: e.name,
|
|
10568
|
-
render: () => /* @__PURE__ */
|
|
10568
|
+
render: () => /* @__PURE__ */ F("span", {
|
|
10569
10569
|
className: "kol-float-hint text-fg-emphasis truncate",
|
|
10570
10570
|
title: r.valueOf(e),
|
|
10571
10571
|
children: r.valueOf(e)
|
|
@@ -10583,7 +10583,7 @@ function Ss({ id: e, onClose: t, className: n = "" }) {
|
|
|
10583
10583
|
meta: r.live ? "LIVE" : "PAUSED"
|
|
10584
10584
|
}, {
|
|
10585
10585
|
id: "field-map-strip",
|
|
10586
|
-
render: () => /* @__PURE__ */
|
|
10586
|
+
render: () => /* @__PURE__ */ F(ys, { t: r })
|
|
10587
10587
|
}]
|
|
10588
10588
|
}),
|
|
10589
10589
|
d(t("ramp")),
|
|
@@ -10598,15 +10598,15 @@ function Ss({ id: e, onClose: t, className: n = "" }) {
|
|
|
10598
10598
|
meta: t("random").state(a).toUpperCase()
|
|
10599
10599
|
}),
|
|
10600
10600
|
d(t("frame"), { def: !1 })
|
|
10601
|
-
] : [s, ...e.map((e) => d(e, { meta: e.state?.(a)?.toUpperCase() }))], p = /* @__PURE__ */
|
|
10601
|
+
] : [s, ...e.map((e) => d(e, { meta: e.state?.(a)?.toUpperCase() }))], p = /* @__PURE__ */ I("div", {
|
|
10602
10602
|
className: "flex flex-col gap-3",
|
|
10603
|
-
children: [/* @__PURE__ */
|
|
10603
|
+
children: [/* @__PURE__ */ I("div", {
|
|
10604
10604
|
className: "flex items-center gap-2",
|
|
10605
|
-
children: [m, /* @__PURE__ */
|
|
10605
|
+
children: [m, /* @__PURE__ */ F("span", {
|
|
10606
10606
|
className: "kol-float-timecode text-oq-64 text-[11px]",
|
|
10607
10607
|
children: "512 × 512 px"
|
|
10608
10608
|
})]
|
|
10609
|
-
}), /* @__PURE__ */
|
|
10609
|
+
}), /* @__PURE__ */ F(M, {
|
|
10610
10610
|
tone: "primary",
|
|
10611
10611
|
size: "md",
|
|
10612
10612
|
className: "w-full [--kol-tone-bg:var(--kol-accent-primary)] [--kol-tone-fg:var(--kol-accent-on-primary)]",
|
|
@@ -10616,12 +10616,12 @@ function Ss({ id: e, onClose: t, className: n = "" }) {
|
|
|
10616
10616
|
})]
|
|
10617
10617
|
});
|
|
10618
10618
|
} else if (e === "repeat") {
|
|
10619
|
-
let [e, t] = r.sections, n =
|
|
10619
|
+
let [e, t] = r.sections, n = h(a, {
|
|
10620
10620
|
x: 0,
|
|
10621
10621
|
y: 0,
|
|
10622
10622
|
w: 1,
|
|
10623
10623
|
h: 1
|
|
10624
|
-
}).length + 1, i = a.sourceId ?
|
|
10624
|
+
}).length + 1, i = a.sourceId ? j(r.state.layers ?? [], a.sourceId) : null;
|
|
10625
10625
|
f = [{
|
|
10626
10626
|
id: "head",
|
|
10627
10627
|
rows: xs(e.groups[0].controls, r)
|
|
@@ -10629,9 +10629,9 @@ function Ss({ id: e, onClose: t, className: n = "" }) {
|
|
|
10629
10629
|
meta: `${n} COPIES`,
|
|
10630
10630
|
extra: [{
|
|
10631
10631
|
id: "copy-grid",
|
|
10632
|
-
render: () => /* @__PURE__ */
|
|
10632
|
+
render: () => /* @__PURE__ */ F("div", {
|
|
10633
10633
|
className: "h-[110px] rounded-md bg-(--kol-float-well) p-3 flex",
|
|
10634
|
-
children: /* @__PURE__ */
|
|
10634
|
+
children: /* @__PURE__ */ F(ss, {
|
|
10635
10635
|
t: r,
|
|
10636
10636
|
className: "w-full h-full"
|
|
10637
10637
|
})
|
|
@@ -10639,12 +10639,12 @@ function Ss({ id: e, onClose: t, className: n = "" }) {
|
|
|
10639
10639
|
}]
|
|
10640
10640
|
})];
|
|
10641
10641
|
let o = a.repMode === "grid" ? `${a.repCols} × ${a.repRows} grid` : a.repMode === "mirror" ? a.repPoint ? "point mirror" : "axis mirror" : `${a.repCount} around`;
|
|
10642
|
-
p = /* @__PURE__ */
|
|
10642
|
+
p = /* @__PURE__ */ I("div", {
|
|
10643
10643
|
className: "flex items-center justify-between kol-float-label",
|
|
10644
|
-
children: [/* @__PURE__ */
|
|
10644
|
+
children: [/* @__PURE__ */ I("span", {
|
|
10645
10645
|
className: "flex items-center gap-2 text-oq-64",
|
|
10646
|
-
children: [/* @__PURE__ */
|
|
10647
|
-
}), /* @__PURE__ */
|
|
10646
|
+
children: [/* @__PURE__ */ F("span", { className: `size-1.5 rounded-full ${i ? "bg-(--kol-accent-primary)" : "bg-(--kol-oq-24)"}` }), i ? "Source linked" : "No source"]
|
|
10647
|
+
}), /* @__PURE__ */ F("span", {
|
|
10648
10648
|
className: "text-oq-64",
|
|
10649
10649
|
children: o
|
|
10650
10650
|
})]
|
|
@@ -10653,45 +10653,45 @@ function Ss({ id: e, onClose: t, className: n = "" }) {
|
|
|
10653
10653
|
let [e, ...t] = r.sections;
|
|
10654
10654
|
f = [d(e, { extra: [{
|
|
10655
10655
|
id: "glyph-preview",
|
|
10656
|
-
render: () => /* @__PURE__ */
|
|
10656
|
+
render: () => /* @__PURE__ */ I("div", {
|
|
10657
10657
|
className: "relative h-[132px] rounded-md bg-(--kol-float-well) overflow-hidden flex items-center justify-center",
|
|
10658
10658
|
children: [
|
|
10659
|
-
/* @__PURE__ */
|
|
10660
|
-
/* @__PURE__ */
|
|
10659
|
+
/* @__PURE__ */ F("span", { className: "absolute inset-x-3 top-[38%] border-t border-dashed border-(--kol-oq-24)" }),
|
|
10660
|
+
/* @__PURE__ */ F("span", {
|
|
10661
10661
|
className: "absolute right-3 top-[38%] -translate-y-full kol-float-label text-oq-48",
|
|
10662
10662
|
children: "x-height"
|
|
10663
10663
|
}),
|
|
10664
|
-
/* @__PURE__ */
|
|
10665
|
-
/* @__PURE__ */
|
|
10664
|
+
/* @__PURE__ */ F("span", { className: "absolute inset-x-3 top-[72%] border-t border-(--kol-oq-24)" }),
|
|
10665
|
+
/* @__PURE__ */ F("span", {
|
|
10666
10666
|
className: "absolute right-3 top-[72%] -translate-y-full kol-float-label text-oq-48",
|
|
10667
10667
|
children: "baseline"
|
|
10668
10668
|
}),
|
|
10669
|
-
/* @__PURE__ */
|
|
10669
|
+
/* @__PURE__ */ F(cs, {
|
|
10670
10670
|
t: r,
|
|
10671
10671
|
size: 256,
|
|
10672
10672
|
className: "h-full aspect-square"
|
|
10673
10673
|
})
|
|
10674
10674
|
]
|
|
10675
10675
|
})
|
|
10676
|
-
}] }), ...t.map((e) => d(e))], p = /* @__PURE__ */
|
|
10676
|
+
}] }), ...t.map((e) => d(e))], p = /* @__PURE__ */ I("div", {
|
|
10677
10677
|
className: "flex items-center justify-between kol-float-label",
|
|
10678
|
-
children: [/* @__PURE__ */
|
|
10678
|
+
children: [/* @__PURE__ */ I("span", {
|
|
10679
10679
|
className: "flex items-center gap-2 text-oq-64",
|
|
10680
|
-
children: [/* @__PURE__ */
|
|
10681
|
-
}), /* @__PURE__ */
|
|
10680
|
+
children: [/* @__PURE__ */ F("span", { className: `size-1.5 rounded-full ${r.target ? "bg-(--kol-accent-primary)" : "bg-(--kol-oq-24)"}` }), r.target ? "Linked to letter mask" : "Not placed"]
|
|
10681
|
+
}), /* @__PURE__ */ F("span", {
|
|
10682
10682
|
className: "text-oq-64",
|
|
10683
10683
|
children: "1 glyph"
|
|
10684
10684
|
})]
|
|
10685
10685
|
});
|
|
10686
10686
|
}
|
|
10687
|
-
return /* @__PURE__ */
|
|
10687
|
+
return /* @__PURE__ */ F(dn, {
|
|
10688
10688
|
title: i.id === "type" ? "Paratype Letter" : i.kind,
|
|
10689
10689
|
wide: !0,
|
|
10690
10690
|
density: "compact",
|
|
10691
10691
|
sections: f,
|
|
10692
10692
|
footer: p,
|
|
10693
10693
|
surface: "solid",
|
|
10694
|
-
onExpand: () =>
|
|
10694
|
+
onExpand: () => xt(e, "dialog"),
|
|
10695
10695
|
onCollapseH: t,
|
|
10696
10696
|
className: `kol-generator-rail ${ds} ${n}`.trim()
|
|
10697
10697
|
});
|
|
@@ -10702,7 +10702,7 @@ var Cs = "w-full [&_.kol-dd-trigger]:w-full [&_.kol-dd-trigger]:justify-between"
|
|
|
10702
10702
|
function ws({ x: e, t }) {
|
|
10703
10703
|
let n = t.valueOf(e), r = e.bind ? t.set(e) : () => {}, i = !t.isLive(e), a = e.name, o = e.format ?? String;
|
|
10704
10704
|
switch (e.type) {
|
|
10705
|
-
case "slider": return /* @__PURE__ */
|
|
10705
|
+
case "slider": return /* @__PURE__ */ F(Zt, {
|
|
10706
10706
|
readout: "input",
|
|
10707
10707
|
value: Number(n),
|
|
10708
10708
|
onChange: r,
|
|
@@ -10714,7 +10714,7 @@ function ws({ x: e, t }) {
|
|
|
10714
10714
|
"aria-label": a,
|
|
10715
10715
|
className: "w-full [--kol-float-h-sm:26px] [--kol-slider-float-run:var(--kol-fg-96)] [&_.kol-control]:!px-2"
|
|
10716
10716
|
});
|
|
10717
|
-
case "range": return /* @__PURE__ */
|
|
10717
|
+
case "range": return /* @__PURE__ */ F(Zt, {
|
|
10718
10718
|
variant: "dual",
|
|
10719
10719
|
value: n[0],
|
|
10720
10720
|
value2: n[1],
|
|
@@ -10728,7 +10728,7 @@ function ws({ x: e, t }) {
|
|
|
10728
10728
|
onChange: (e) => r([Math.min(e, n[1]), n[1]]),
|
|
10729
10729
|
onChange2: (e) => r([n[0], Math.max(e, n[0])])
|
|
10730
10730
|
});
|
|
10731
|
-
case "segmented": return /* @__PURE__ */
|
|
10731
|
+
case "segmented": return /* @__PURE__ */ F($t, {
|
|
10732
10732
|
size: "xs",
|
|
10733
10733
|
tabs: e.options,
|
|
10734
10734
|
value: n,
|
|
@@ -10736,7 +10736,7 @@ function ws({ x: e, t }) {
|
|
|
10736
10736
|
ariaLabel: a,
|
|
10737
10737
|
className: "w-full [&>*]:flex-1"
|
|
10738
10738
|
});
|
|
10739
|
-
case "select": return /* @__PURE__ */
|
|
10739
|
+
case "select": return /* @__PURE__ */ F(Ft, {
|
|
10740
10740
|
size: "sm",
|
|
10741
10741
|
value: n,
|
|
10742
10742
|
onChange: r,
|
|
@@ -10744,13 +10744,13 @@ function ws({ x: e, t }) {
|
|
|
10744
10744
|
ariaLabel: a,
|
|
10745
10745
|
className: Cs
|
|
10746
10746
|
});
|
|
10747
|
-
case "toggle": return /* @__PURE__ */
|
|
10747
|
+
case "toggle": return /* @__PURE__ */ F(en, {
|
|
10748
10748
|
checked: !!n,
|
|
10749
10749
|
onChange: r,
|
|
10750
10750
|
disabled: i,
|
|
10751
10751
|
"aria-label": a
|
|
10752
10752
|
});
|
|
10753
|
-
case "point": return /* @__PURE__ */
|
|
10753
|
+
case "point": return /* @__PURE__ */ F(Kt, {
|
|
10754
10754
|
value: n,
|
|
10755
10755
|
onChange: r,
|
|
10756
10756
|
min: e.min,
|
|
@@ -10759,7 +10759,7 @@ function ws({ x: e, t }) {
|
|
|
10759
10759
|
"aria-label": a
|
|
10760
10760
|
});
|
|
10761
10761
|
case "text":
|
|
10762
|
-
case "color": return /* @__PURE__ */
|
|
10762
|
+
case "color": return /* @__PURE__ */ F(Lt, {
|
|
10763
10763
|
size: "sm",
|
|
10764
10764
|
value: n ?? "",
|
|
10765
10765
|
onChange: (e) => r(e.target.value),
|
|
@@ -10767,12 +10767,12 @@ function ws({ x: e, t }) {
|
|
|
10767
10767
|
"aria-label": a,
|
|
10768
10768
|
width: "100%"
|
|
10769
10769
|
});
|
|
10770
|
-
case "lights": return /* @__PURE__ */
|
|
10770
|
+
case "lights": return /* @__PURE__ */ F(Gt, {
|
|
10771
10771
|
value: n,
|
|
10772
10772
|
onChange: r,
|
|
10773
10773
|
disabled: i
|
|
10774
10774
|
});
|
|
10775
|
-
case "picker": return /* @__PURE__ */
|
|
10775
|
+
case "picker": return /* @__PURE__ */ F(Ft, {
|
|
10776
10776
|
size: "sm",
|
|
10777
10777
|
value: n ?? "",
|
|
10778
10778
|
onChange: r,
|
|
@@ -10783,7 +10783,7 @@ function ws({ x: e, t }) {
|
|
|
10783
10783
|
ariaLabel: a,
|
|
10784
10784
|
className: Cs
|
|
10785
10785
|
});
|
|
10786
|
-
case "button": return /* @__PURE__ */
|
|
10786
|
+
case "button": return /* @__PURE__ */ F(M, {
|
|
10787
10787
|
tone: "secondary",
|
|
10788
10788
|
size: "sm",
|
|
10789
10789
|
disabled: i,
|
|
@@ -10796,17 +10796,17 @@ function ws({ x: e, t }) {
|
|
|
10796
10796
|
}
|
|
10797
10797
|
function Ts({ x: e, t }) {
|
|
10798
10798
|
let n = !t.isLive(e), r = e.type === "toggle";
|
|
10799
|
-
return /* @__PURE__ */
|
|
10799
|
+
return /* @__PURE__ */ F("fieldset", {
|
|
10800
10800
|
disabled: n || void 0,
|
|
10801
10801
|
className: `contents ${e.type === "lights" ? "[&>*]:col-span-2" : ""}`.trim(),
|
|
10802
|
-
children: /* @__PURE__ */
|
|
10802
|
+
children: /* @__PURE__ */ F(N, {
|
|
10803
10803
|
variant: "settings",
|
|
10804
10804
|
horizontal: r,
|
|
10805
10805
|
labelWidth: r ? "auto" : void 0,
|
|
10806
10806
|
label: e.type === "lights" ? null : e.name,
|
|
10807
10807
|
"data-control": e.name,
|
|
10808
10808
|
className: n ? "opacity-40" : "",
|
|
10809
|
-
children: /* @__PURE__ */
|
|
10809
|
+
children: /* @__PURE__ */ F(ws, {
|
|
10810
10810
|
x: e,
|
|
10811
10811
|
t
|
|
10812
10812
|
})
|
|
@@ -10814,9 +10814,9 @@ function Ts({ x: e, t }) {
|
|
|
10814
10814
|
});
|
|
10815
10815
|
}
|
|
10816
10816
|
function Es({ g: e, t, more: n, setMore: r }) {
|
|
10817
|
-
let i = e.controls.filter((e) => e.type === "ramp"), a = e.controls.filter((e) => e.type !== "ramp"), o = i.length > 0 && /* @__PURE__ */
|
|
10817
|
+
let i = e.controls.filter((e) => e.type === "ramp"), a = e.controls.filter((e) => e.type !== "ramp"), o = i.length > 0 && /* @__PURE__ */ I("div", {
|
|
10818
10818
|
className: "flex flex-col gap-1",
|
|
10819
|
-
children: [/* @__PURE__ */
|
|
10819
|
+
children: [/* @__PURE__ */ F(Jt, {}), i.map((e) => /* @__PURE__ */ F(qt, {
|
|
10820
10820
|
label: e.name,
|
|
10821
10821
|
value: t.valueOf(e),
|
|
10822
10822
|
onChange: e.bind ? t.set(e) : () => {},
|
|
@@ -10824,11 +10824,11 @@ function Es({ g: e, t, more: n, setMore: r }) {
|
|
|
10824
10824
|
disabled: !t.isLive(e),
|
|
10825
10825
|
"data-control": e.name
|
|
10826
10826
|
}, e.id))]
|
|
10827
|
-
}), s = a.length > 0 && /* @__PURE__ */
|
|
10827
|
+
}), s = a.length > 0 && /* @__PURE__ */ F(Wt, { children: a.map((e) => /* @__PURE__ */ F(Ts, {
|
|
10828
10828
|
x: e,
|
|
10829
10829
|
t
|
|
10830
10830
|
}, e.id)) });
|
|
10831
|
-
return e.kind === "more" ? /* @__PURE__ */
|
|
10831
|
+
return e.kind === "more" ? /* @__PURE__ */ I(Ht, {
|
|
10832
10832
|
label: e.title,
|
|
10833
10833
|
note: e.note,
|
|
10834
10834
|
open: !!n[e.title],
|
|
@@ -10836,39 +10836,39 @@ function Es({ g: e, t, more: n, setMore: r }) {
|
|
|
10836
10836
|
...n,
|
|
10837
10837
|
[e.title]: t
|
|
10838
10838
|
})),
|
|
10839
|
-
children: [o, s && /* @__PURE__ */
|
|
10839
|
+
children: [o, s && /* @__PURE__ */ F("div", {
|
|
10840
10840
|
className: o ? "pt-3" : "",
|
|
10841
10841
|
children: s
|
|
10842
10842
|
})]
|
|
10843
|
-
}) : /* @__PURE__ */
|
|
10843
|
+
}) : /* @__PURE__ */ I(zt, {
|
|
10844
10844
|
variant: "settings",
|
|
10845
10845
|
label: e.title,
|
|
10846
10846
|
end: e.note,
|
|
10847
10847
|
divided: !0,
|
|
10848
|
-
children: [s, o && /* @__PURE__ */
|
|
10848
|
+
children: [s, o && /* @__PURE__ */ F("div", {
|
|
10849
10849
|
className: s ? "pt-3" : "",
|
|
10850
10850
|
children: o
|
|
10851
10851
|
})]
|
|
10852
10852
|
});
|
|
10853
10853
|
}
|
|
10854
10854
|
function Ds({ t: e, caption: t }) {
|
|
10855
|
-
return /* @__PURE__ */
|
|
10855
|
+
return /* @__PURE__ */ I(zt, {
|
|
10856
10856
|
variant: "settings",
|
|
10857
10857
|
label: "Preview",
|
|
10858
10858
|
end: e.live ? "● Live" : "○ Paused",
|
|
10859
10859
|
className: "[&>div:first-child]:pr-0",
|
|
10860
|
-
children: [/* @__PURE__ */
|
|
10860
|
+
children: [/* @__PURE__ */ F("div", {
|
|
10861
10861
|
className: "size-[248px] rounded-md border border-oq-16 bg-surface-primary overflow-hidden flex items-center justify-center",
|
|
10862
|
-
children: /* @__PURE__ */
|
|
10862
|
+
children: /* @__PURE__ */ F(ls, {
|
|
10863
10863
|
t: e,
|
|
10864
10864
|
className: "size-full"
|
|
10865
10865
|
})
|
|
10866
|
-
}), /* @__PURE__ */
|
|
10866
|
+
}), /* @__PURE__ */ I("div", {
|
|
10867
10867
|
className: "flex justify-between pt-3 pb-[19px] pr-[7px] border-b border-oq-16",
|
|
10868
|
-
children: [/* @__PURE__ */
|
|
10868
|
+
children: [/* @__PURE__ */ F("span", {
|
|
10869
10869
|
className: "text-[10px] leading-[12px] text-oq-64",
|
|
10870
10870
|
children: t
|
|
10871
|
-
}), /* @__PURE__ */
|
|
10871
|
+
}), /* @__PURE__ */ F("span", {
|
|
10872
10872
|
className: "font-(family-name:--kol-font-family-mono) text-[10px] leading-[13px] text-fg-64",
|
|
10873
10873
|
children: "512 × 512 px"
|
|
10874
10874
|
})]
|
|
@@ -10888,7 +10888,7 @@ function ks({ id: e, open: t, onClose: n }) {
|
|
|
10888
10888
|
};
|
|
10889
10889
|
return Object.assign(Os, n), n;
|
|
10890
10890
|
}), _ = i.header.find((e) => e.id === "style"), v = i.header.find((e) => e.id === "description"), y = i.header.find((e) => e.id === "expand"), b = i.fieldMap?.(a);
|
|
10891
|
-
return /* @__PURE__ */
|
|
10891
|
+
return /* @__PURE__ */ F(Bt, {
|
|
10892
10892
|
variant: "settings",
|
|
10893
10893
|
open: t,
|
|
10894
10894
|
movable: "generator",
|
|
@@ -10898,12 +10898,12 @@ function ks({ id: e, open: t, onClose: n }) {
|
|
|
10898
10898
|
sectionsLabel: "Steps",
|
|
10899
10899
|
width: 880,
|
|
10900
10900
|
height: 656,
|
|
10901
|
-
headerEnd: /* @__PURE__ */
|
|
10901
|
+
headerEnd: /* @__PURE__ */ I("div", {
|
|
10902
10902
|
className: "flex items-center gap-2",
|
|
10903
10903
|
children: [
|
|
10904
|
-
y && /* @__PURE__ */
|
|
10904
|
+
y && /* @__PURE__ */ F(tn, {
|
|
10905
10905
|
label: "Expand to editable paths",
|
|
10906
|
-
children: /* @__PURE__ */
|
|
10906
|
+
children: /* @__PURE__ */ F(M, {
|
|
10907
10907
|
tone: "ghost",
|
|
10908
10908
|
size: "sm",
|
|
10909
10909
|
disabled: !r.canApply,
|
|
@@ -10914,15 +10914,15 @@ function ks({ id: e, open: t, onClose: n }) {
|
|
|
10914
10914
|
children: "Expand"
|
|
10915
10915
|
})
|
|
10916
10916
|
}),
|
|
10917
|
-
_ && /* @__PURE__ */
|
|
10917
|
+
_ && /* @__PURE__ */ F(N, {
|
|
10918
10918
|
horizontal: !0,
|
|
10919
10919
|
label: "Style",
|
|
10920
10920
|
labelWidth: "fit-content",
|
|
10921
10921
|
className: "gap-2",
|
|
10922
|
-
children: /* @__PURE__ */
|
|
10922
|
+
children: /* @__PURE__ */ F("div", {
|
|
10923
10923
|
className: "w-[140px]",
|
|
10924
10924
|
"data-control": "Style",
|
|
10925
|
-
children: /* @__PURE__ */
|
|
10925
|
+
children: /* @__PURE__ */ F(Ft, {
|
|
10926
10926
|
size: "sm",
|
|
10927
10927
|
value: r.valueOf(_),
|
|
10928
10928
|
onChange: (e) => {
|
|
@@ -10934,15 +10934,15 @@ function ks({ id: e, open: t, onClose: n }) {
|
|
|
10934
10934
|
})
|
|
10935
10935
|
})
|
|
10936
10936
|
}),
|
|
10937
|
-
r.presets && /* @__PURE__ */
|
|
10937
|
+
r.presets && /* @__PURE__ */ F(N, {
|
|
10938
10938
|
horizontal: !0,
|
|
10939
10939
|
label: "Preset",
|
|
10940
10940
|
labelWidth: "fit-content",
|
|
10941
10941
|
className: "gap-2",
|
|
10942
|
-
children: /* @__PURE__ */
|
|
10942
|
+
children: /* @__PURE__ */ F("div", {
|
|
10943
10943
|
className: "w-[140px]",
|
|
10944
10944
|
"data-control": "Preset",
|
|
10945
|
-
children: /* @__PURE__ */
|
|
10945
|
+
children: /* @__PURE__ */ F(Ft, {
|
|
10946
10946
|
size: "sm",
|
|
10947
10947
|
value: a.genPreset ?? "custom",
|
|
10948
10948
|
onChange: r.setPreset,
|
|
@@ -10961,67 +10961,67 @@ function ks({ id: e, open: t, onClose: n }) {
|
|
|
10961
10961
|
})),
|
|
10962
10962
|
section: d.key,
|
|
10963
10963
|
onSection: c,
|
|
10964
|
-
aside: /* @__PURE__ */
|
|
10964
|
+
aside: /* @__PURE__ */ I("div", {
|
|
10965
10965
|
className: "flex flex-col",
|
|
10966
10966
|
children: [
|
|
10967
|
-
/* @__PURE__ */
|
|
10967
|
+
/* @__PURE__ */ F(Ds, {
|
|
10968
10968
|
t: r,
|
|
10969
10969
|
caption: d.state?.(a) ?? ""
|
|
10970
10970
|
}),
|
|
10971
|
-
b && /* @__PURE__ */
|
|
10971
|
+
b && /* @__PURE__ */ F("div", {
|
|
10972
10972
|
className: "pt-[18px]",
|
|
10973
|
-
children: /* @__PURE__ */
|
|
10973
|
+
children: /* @__PURE__ */ F(Ut, {
|
|
10974
10974
|
background: b.background,
|
|
10975
10975
|
left: b.left,
|
|
10976
10976
|
right: b.right
|
|
10977
10977
|
})
|
|
10978
10978
|
}),
|
|
10979
|
-
v && /* @__PURE__ */
|
|
10979
|
+
v && /* @__PURE__ */ F("p", {
|
|
10980
10980
|
className: "pt-6 text-[10px] leading-[14px] text-fg-64",
|
|
10981
10981
|
"data-control": "Description",
|
|
10982
10982
|
children: r.valueOf(v)
|
|
10983
10983
|
}),
|
|
10984
|
-
/* @__PURE__ */
|
|
10984
|
+
/* @__PURE__ */ F("p", {
|
|
10985
10985
|
className: "pt-2 text-[10px] leading-[12px] text-oq-64",
|
|
10986
10986
|
children: "Updates as you adjust settings."
|
|
10987
10987
|
})
|
|
10988
10988
|
]
|
|
10989
10989
|
}),
|
|
10990
|
-
footer: /* @__PURE__ */
|
|
10991
|
-
/* @__PURE__ */
|
|
10990
|
+
footer: /* @__PURE__ */ I(P, { children: [
|
|
10991
|
+
/* @__PURE__ */ F(N, {
|
|
10992
10992
|
horizontal: !0,
|
|
10993
10993
|
label: "Live preview",
|
|
10994
10994
|
labelWidth: "fit-content",
|
|
10995
10995
|
className: "gap-3 mr-[36px]",
|
|
10996
|
-
children: /* @__PURE__ */
|
|
10996
|
+
children: /* @__PURE__ */ F(en, {
|
|
10997
10997
|
checked: r.live,
|
|
10998
10998
|
onChange: r.setLive,
|
|
10999
10999
|
"aria-label": "Live preview",
|
|
11000
11000
|
className: "flex gap-0"
|
|
11001
11001
|
})
|
|
11002
11002
|
}),
|
|
11003
|
-
/* @__PURE__ */
|
|
11003
|
+
/* @__PURE__ */ F(M, {
|
|
11004
11004
|
tone: "grey",
|
|
11005
11005
|
size: "sm",
|
|
11006
11006
|
onClick: r.reset,
|
|
11007
11007
|
children: "Reset"
|
|
11008
11008
|
}),
|
|
11009
|
-
/* @__PURE__ */
|
|
11009
|
+
/* @__PURE__ */ F(M, {
|
|
11010
11010
|
tone: "grey",
|
|
11011
11011
|
size: "sm",
|
|
11012
11012
|
onClick: r.randomise,
|
|
11013
11013
|
"data-control": "Randomise",
|
|
11014
11014
|
children: "Randomise"
|
|
11015
11015
|
}),
|
|
11016
|
-
/* @__PURE__ */
|
|
11016
|
+
/* @__PURE__ */ I(Mt, {
|
|
11017
11017
|
align: "right",
|
|
11018
11018
|
className: "flex-1",
|
|
11019
|
-
children: [/* @__PURE__ */
|
|
11019
|
+
children: [/* @__PURE__ */ F(M, {
|
|
11020
11020
|
tone: "grey",
|
|
11021
11021
|
size: "sm",
|
|
11022
11022
|
onClick: n,
|
|
11023
11023
|
children: "Cancel"
|
|
11024
|
-
}), /* @__PURE__ */
|
|
11024
|
+
}), /* @__PURE__ */ F(M, {
|
|
11025
11025
|
size: "sm",
|
|
11026
11026
|
onClick: () => {
|
|
11027
11027
|
r.apply(), n();
|
|
@@ -11031,19 +11031,19 @@ function ks({ id: e, open: t, onClose: n }) {
|
|
|
11031
11031
|
})]
|
|
11032
11032
|
})
|
|
11033
11033
|
] }),
|
|
11034
|
-
children: /* @__PURE__ */
|
|
11034
|
+
children: /* @__PURE__ */ I("div", {
|
|
11035
11035
|
"data-section-body": d.key,
|
|
11036
|
-
children: [p.map((e, t) => /* @__PURE__ */
|
|
11036
|
+
children: [p.map((e, t) => /* @__PURE__ */ F(Es, {
|
|
11037
11037
|
g: e,
|
|
11038
11038
|
t: r,
|
|
11039
11039
|
more: l,
|
|
11040
11040
|
setMore: u
|
|
11041
|
-
}, `${d.key}-${t}`)), m.length > 0 && /* @__PURE__ */
|
|
11041
|
+
}, `${d.key}-${t}`)), m.length > 0 && /* @__PURE__ */ F(Ht, {
|
|
11042
11042
|
label: "Advanced",
|
|
11043
11043
|
note: `${m.reduce((e, t) => e + t.controls.length, 0)} more`,
|
|
11044
11044
|
open: !!l[f],
|
|
11045
11045
|
onToggle: g,
|
|
11046
|
-
children: m.map((e, t) => /* @__PURE__ */
|
|
11046
|
+
children: m.map((e, t) => /* @__PURE__ */ F(Es, {
|
|
11047
11047
|
g: e,
|
|
11048
11048
|
t: r,
|
|
11049
11049
|
more: l,
|
|
@@ -11054,20 +11054,20 @@ function ks({ id: e, open: t, onClose: n }) {
|
|
|
11054
11054
|
});
|
|
11055
11055
|
}
|
|
11056
11056
|
function As() {
|
|
11057
|
-
let { dialog: e } =
|
|
11057
|
+
let { dialog: e } = yt();
|
|
11058
11058
|
return on(() => {
|
|
11059
11059
|
let e = (e) => {
|
|
11060
11060
|
let t = e.detail?.family;
|
|
11061
|
-
t && Ao(
|
|
11061
|
+
t && Ao(Ct("generate")?.params ?? {}).id !== t && vt("generate", {
|
|
11062
11062
|
params: Fo(t),
|
|
11063
11063
|
layerId: null
|
|
11064
|
-
}),
|
|
11064
|
+
}), xt(e.detail?.window ?? "generate", e.detail?.form ?? "rail");
|
|
11065
11065
|
};
|
|
11066
11066
|
return window.addEventListener("kol:open-generator-window", e), () => window.removeEventListener("kol:open-generator-window", e);
|
|
11067
|
-
}, []), e ? /* @__PURE__ */
|
|
11067
|
+
}, []), e ? /* @__PURE__ */ F(ks, {
|
|
11068
11068
|
id: e,
|
|
11069
11069
|
open: !0,
|
|
11070
|
-
onClose: () =>
|
|
11070
|
+
onClose: () => St({ dialog: null })
|
|
11071
11071
|
}, e) : null;
|
|
11072
11072
|
}
|
|
11073
11073
|
//#endregion
|
|
@@ -11078,26 +11078,26 @@ var js = {
|
|
|
11078
11078
|
"misc",
|
|
11079
11079
|
"generate"
|
|
11080
11080
|
],
|
|
11081
|
-
GROUPS:
|
|
11082
|
-
loopById:
|
|
11083
|
-
loopDrawParams:
|
|
11084
|
-
resolveCameraKeys:
|
|
11085
|
-
loopBgToggleable:
|
|
11086
|
-
presetById:
|
|
11087
|
-
presetParams:
|
|
11088
|
-
presetsInGroup:
|
|
11089
|
-
presetsInSub:
|
|
11090
|
-
presetLayerPatch:
|
|
11091
|
-
isToolPreset:
|
|
11092
|
-
groupById:
|
|
11093
|
-
drawLoopFrame:
|
|
11094
|
-
GENERATIVE_TREE:
|
|
11095
|
-
MISC_TREE:
|
|
11081
|
+
GROUPS: et,
|
|
11082
|
+
loopById: dt,
|
|
11083
|
+
loopDrawParams: ze,
|
|
11084
|
+
resolveCameraKeys: Le,
|
|
11085
|
+
loopBgToggleable: We,
|
|
11086
|
+
presetById: ke,
|
|
11087
|
+
presetParams: Ve,
|
|
11088
|
+
presetsInGroup: Me,
|
|
11089
|
+
presetsInSub: je,
|
|
11090
|
+
presetLayerPatch: lt,
|
|
11091
|
+
isToolPreset: pt,
|
|
11092
|
+
groupById: He,
|
|
11093
|
+
drawLoopFrame: Ee,
|
|
11094
|
+
GENERATIVE_TREE: fn,
|
|
11095
|
+
MISC_TREE: pn,
|
|
11096
11096
|
THEME_OPTIONS: a,
|
|
11097
|
-
buildParatypeFlattenGroup:
|
|
11098
|
-
LoopPicker:
|
|
11099
|
-
LoopFields:
|
|
11100
|
-
stepFromPreset:
|
|
11097
|
+
buildParatypeFlattenGroup: bn,
|
|
11098
|
+
LoopPicker: Mn,
|
|
11099
|
+
LoopFields: Wr,
|
|
11100
|
+
stepFromPreset: Kr,
|
|
11101
11101
|
generateParamsFor: ba,
|
|
11102
11102
|
generateMarks: Da,
|
|
11103
11103
|
generateBody: Oa,
|
|
@@ -11105,8 +11105,8 @@ var js = {
|
|
|
11105
11105
|
RailSettings: Ss,
|
|
11106
11106
|
GeneratorWindows: As,
|
|
11107
11107
|
GeneratorRail: Ss,
|
|
11108
|
-
loadGlHost: () => import("./host-
|
|
11108
|
+
loadGlHost: () => import("./host-DS-pAjP0.js")
|
|
11109
11109
|
};
|
|
11110
|
-
|
|
11110
|
+
C("generators", js);
|
|
11111
11111
|
//#endregion
|
|
11112
|
-
export {
|
|
11112
|
+
export { Nn as A, hn as B, ar as C, Xn as D, rr as E, kn as F, mn as H, An as I, Tn as L, jn as M, wn as N, Jn as O, En as P, Sn as R, Lr as S, ir as T, pn as V, Kr as _, ko as a, zr as b, Fo as c, ns as d, Jo as f, Jr as g, Yr as h, Xa as i, Cn as j, qn as k, No as l, Ma as m, ls as n, Ao as o, es as p, as as r, jo as s, js as t, ts as u, Gr as v, or as w, Rr as x, Wr as y, fn as z };
|