@tresjs/leches 0.1.0 → 0.2.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,65 +1,65 @@
1
1
  /**
2
2
  * name: @tresjs/leches
3
- * version: v0.1.0
3
+ * version: v0.2.0
4
4
  * (c) 2023
5
5
  * description: Tasty GUI for Vue controls 🍰
6
6
  * author: Alvaro Saburido <hola@alvarosaburido.dev> (https://github.com/alvarosabu/)
7
7
  */
8
- import { unref as z, getCurrentScope as st, onScopeDispose as it, toRef as nt, readonly as rt, customRef as ot, ref as w, defineComponent as C, computed as v, reactive as W, h as ht, watch as E, inject as at, isReactive as lt, toRefs as ct, isRef as F, openBlock as g, createElementBlock as b, createElementVNode as d, toDisplayString as $, normalizeClass as q, withDirectives as ut, vShow as yt, normalizeStyle as xt, Fragment as L, renderList as B, createCommentVNode as U, createBlock as k, withCtx as _t } from "vue";
9
- import { useStorage as dt, isClient as mt, useDraggable as gt, useMouse as V, useWindowSize as ft } from "@vueuse/core";
10
- function K(i) {
11
- return st() ? (it(i), !0) : !1;
8
+ import { unref as z, getCurrentScope as ot, onScopeDispose as ht, toRef as at, readonly as lt, customRef as ct, ref as w, defineComponent as C, computed as S, reactive as B, h as ut, watch as E, inject as yt, isReactive as xt, toRefs as _t, isRef as O, openBlock as m, createElementBlock as b, createElementVNode as d, toDisplayString as $, normalizeClass as T, withDirectives as U, vShow as K, normalizeStyle as dt, Fragment as D, renderList as X, createCommentVNode as G, createVNode as mt, Transition as gt, withCtx as J, createBlock as v } from "vue";
9
+ import { useStorage as ft, isClient as pt, useDraggable as zt, useMouse as N, useWindowSize as Mt } from "@vueuse/core";
10
+ function tt(n) {
11
+ return ot() ? (ht(n), !0) : !1;
12
12
  }
13
- function I(i) {
14
- return typeof i == "function" ? i() : z(i);
13
+ function A(n) {
14
+ return typeof n == "function" ? n() : z(n);
15
15
  }
16
- const G = typeof window < "u", J = () => {
17
- }, Y = /* @__PURE__ */ pt();
18
- function pt() {
19
- var i;
20
- return G && ((i = window == null ? void 0 : window.navigator) == null ? void 0 : i.userAgent) && /* @__PURE__ */ /iP(ad|hone|od)/.test(window.navigator.userAgent);
16
+ const et = typeof window < "u", st = () => {
17
+ }, H = /* @__PURE__ */ bt();
18
+ function bt() {
19
+ var n;
20
+ return et && ((n = window == null ? void 0 : window.navigator) == null ? void 0 : n.userAgent) && /* @__PURE__ */ /iP(ad|hone|od)/.test(window.navigator.userAgent);
21
21
  }
22
- function zt(...i) {
23
- if (i.length !== 1)
24
- return nt(...i);
25
- const t = i[0];
26
- return typeof t == "function" ? rt(ot(() => ({ get: t, set: J }))) : w(t);
22
+ function wt(...n) {
23
+ if (n.length !== 1)
24
+ return at(...n);
25
+ const t = n[0];
26
+ return typeof t == "function" ? lt(ct(() => ({ get: t, set: st }))) : w(t);
27
27
  }
28
- function Mt(i) {
28
+ function vt(n) {
29
29
  var t;
30
- const e = I(i);
30
+ const e = A(n);
31
31
  return (t = e == null ? void 0 : e.$el) != null ? t : e;
32
32
  }
33
- const wt = G ? window : void 0;
34
- function bt(...i) {
35
- let t, e, s, n;
36
- if (typeof i[0] == "string" || Array.isArray(i[0]) ? ([e, s, n] = i, t = wt) : [t, e, s, n] = i, !t)
37
- return J;
33
+ const Ct = et ? window : void 0;
34
+ function St(...n) {
35
+ let t, e, s, i;
36
+ if (typeof n[0] == "string" || Array.isArray(n[0]) ? ([e, s, i] = n, t = Ct) : [t, e, s, i] = n, !t)
37
+ return st;
38
38
  Array.isArray(e) || (e = [e]), Array.isArray(s) || (s = [s]);
39
- const r = [], a = () => {
39
+ const r = [], o = () => {
40
40
  r.forEach((l) => l()), r.length = 0;
41
- }, h = (l, o, x, c) => (l.addEventListener(o, x, c), () => l.removeEventListener(o, x, c)), y = E(
42
- () => [Mt(t), I(n)],
43
- ([l, o]) => {
44
- a(), l && r.push(
45
- ...e.flatMap((x) => s.map((c) => h(l, x, c, o)))
41
+ }, h = (l, a, x, c) => (l.addEventListener(a, x, c), () => l.removeEventListener(a, x, c)), y = E(
42
+ () => [vt(t), A(i)],
43
+ ([l, a]) => {
44
+ o(), l && r.push(
45
+ ...e.flatMap((x) => s.map((c) => h(l, x, c, a)))
46
46
  );
47
47
  },
48
48
  { immediate: !0, flush: "post" }
49
49
  ), u = () => {
50
- y(), a();
50
+ y(), o();
51
51
  };
52
- return K(u), u;
52
+ return tt(u), u;
53
53
  }
54
- var vt = Object.defineProperty, Ct = Object.defineProperties, St = Object.getOwnPropertyDescriptors, H = Object.getOwnPropertySymbols, kt = Object.prototype.hasOwnProperty, $t = Object.prototype.propertyIsEnumerable, O = (i, t, e) => t in i ? vt(i, t, { enumerable: !0, configurable: !0, writable: !0, value: e }) : i[t] = e, Et = (i, t) => {
54
+ var kt = Object.defineProperty, $t = Object.defineProperties, Et = Object.getOwnPropertyDescriptors, Q = Object.getOwnPropertySymbols, It = Object.prototype.hasOwnProperty, At = Object.prototype.propertyIsEnumerable, Z = (n, t, e) => t in n ? kt(n, t, { enumerable: !0, configurable: !0, writable: !0, value: e }) : n[t] = e, Tt = (n, t) => {
55
55
  for (var e in t || (t = {}))
56
- kt.call(t, e) && O(i, e, t[e]);
57
- if (H)
58
- for (var e of H(t))
59
- $t.call(t, e) && O(i, e, t[e]);
60
- return i;
61
- }, At = (i, t) => Ct(i, St(t));
62
- const It = /* @__PURE__ */ C({
56
+ It.call(t, e) && Z(n, e, t[e]);
57
+ if (Q)
58
+ for (var e of Q(t))
59
+ At.call(t, e) && Z(n, e, t[e]);
60
+ return n;
61
+ }, qt = (n, t) => $t(n, Et(t));
62
+ const Dt = /* @__PURE__ */ C({
63
63
  name: "UseDraggable",
64
64
  props: [
65
65
  "storageKey",
@@ -73,94 +73,94 @@ const It = /* @__PURE__ */ C({
73
73
  "handle",
74
74
  "axis"
75
75
  ],
76
- setup(i, { slots: t }) {
77
- const e = w(), s = v(() => {
76
+ setup(n, { slots: t }) {
77
+ const e = w(), s = S(() => {
78
78
  var y;
79
- return (y = i.handle) != null ? y : e.value;
80
- }), n = i.storageKey && dt(
81
- i.storageKey,
82
- I(i.initialValue) || { x: 0, y: 0 },
83
- mt ? i.storageType === "session" ? sessionStorage : localStorage : void 0
84
- ), r = n || i.initialValue || { x: 0, y: 0 }, a = (y) => {
85
- n && (n.value.x = y.x, n.value.y = y.y);
86
- }, h = W(gt(e, At(Et({}, i), {
79
+ return (y = n.handle) != null ? y : e.value;
80
+ }), i = n.storageKey && ft(
81
+ n.storageKey,
82
+ A(n.initialValue) || { x: 0, y: 0 },
83
+ pt ? n.storageType === "session" ? sessionStorage : localStorage : void 0
84
+ ), r = i || n.initialValue || { x: 0, y: 0 }, o = (y) => {
85
+ i && (i.value.x = y.x, i.value.y = y.y);
86
+ }, h = B(zt(e, qt(Tt({}, n), {
87
87
  handle: s,
88
88
  initialValue: r,
89
- onEnd: a
89
+ onEnd: o
90
90
  })));
91
91
  return () => {
92
92
  if (t.default)
93
- return ht(i.as || "div", { ref: e, style: `touch-action:none;${h.style}` }, t.default(h));
93
+ return ut(n.as || "div", { ref: e, style: `touch-action:none;${h.style}` }, t.default(h));
94
94
  };
95
95
  }
96
96
  });
97
- function tt(i) {
98
- const t = window.getComputedStyle(i);
99
- if (t.overflowX === "scroll" || t.overflowY === "scroll" || t.overflowX === "auto" && i.clientHeight < i.scrollHeight || t.overflowY === "auto" && i.clientWidth < i.scrollWidth)
97
+ function nt(n) {
98
+ const t = window.getComputedStyle(n);
99
+ if (t.overflowX === "scroll" || t.overflowY === "scroll" || t.overflowX === "auto" && n.clientHeight < n.scrollHeight || t.overflowY === "auto" && n.clientWidth < n.scrollWidth)
100
100
  return !0;
101
101
  {
102
- const e = i.parentNode;
103
- return !e || e.tagName === "BODY" ? !1 : tt(e);
102
+ const e = n.parentNode;
103
+ return !e || e.tagName === "BODY" ? !1 : nt(e);
104
104
  }
105
105
  }
106
- function Tt(i) {
107
- const t = i || window.event, e = t.target;
108
- return tt(e) ? !1 : t.touches.length > 1 ? !0 : (t.preventDefault && t.preventDefault(), !1);
106
+ function jt(n) {
107
+ const t = n || window.event, e = t.target;
108
+ return nt(e) ? !1 : t.touches.length > 1 ? !0 : (t.preventDefault && t.preventDefault(), !1);
109
109
  }
110
- function qt(i, t = !1) {
110
+ function Pt(n, t = !1) {
111
111
  const e = w(t);
112
- let s = null, n;
113
- E(zt(i), (h) => {
112
+ let s = null, i;
113
+ E(wt(n), (h) => {
114
114
  if (h) {
115
115
  const y = h;
116
- n = y.style.overflow, e.value && (y.style.overflow = "hidden");
116
+ i = y.style.overflow, e.value && (y.style.overflow = "hidden");
117
117
  }
118
118
  }, {
119
119
  immediate: !0
120
120
  });
121
121
  const r = () => {
122
- const h = I(i);
123
- !h || e.value || (Y && (s = bt(
122
+ const h = A(n);
123
+ !h || e.value || (H && (s = St(
124
124
  h,
125
125
  "touchmove",
126
126
  (y) => {
127
- Tt(y);
127
+ jt(y);
128
128
  },
129
129
  { passive: !1 }
130
130
  )), h.style.overflow = "hidden", e.value = !0);
131
- }, a = () => {
132
- const h = I(i);
133
- !h || !e.value || (Y && (s == null || s()), h.style.overflow = n, e.value = !1);
131
+ }, o = () => {
132
+ const h = A(n);
133
+ !h || !e.value || (H && (s == null || s()), h.style.overflow = i, e.value = !1);
134
134
  };
135
- return K(a), v({
135
+ return tt(o), S({
136
136
  get() {
137
137
  return e.value;
138
138
  },
139
139
  set(h) {
140
- h ? r() : a();
140
+ h ? r() : o();
141
141
  }
142
142
  });
143
143
  }
144
- function Dt() {
145
- let i = !1;
144
+ function Lt() {
145
+ let n = !1;
146
146
  const t = w(!1);
147
147
  return (e, s) => {
148
- if (t.value = s.value, i)
148
+ if (t.value = s.value, n)
149
149
  return;
150
- i = !0;
151
- const n = qt(e, s.value);
152
- E(t, (r) => n.value = r);
150
+ n = !0;
151
+ const i = Pt(e, s.value);
152
+ E(t, (r) => i.value = r);
153
153
  };
154
154
  }
155
- Dt();
156
- const Pt = Symbol("CONTROLS_CONTEXT_KEY"), j = W({
155
+ Lt();
156
+ const Vt = Symbol("CONTROLS_CONTEXT_KEY"), V = B({
157
157
  controls: []
158
158
  });
159
- function jt() {
160
- return j;
159
+ function Xt() {
160
+ return V;
161
161
  }
162
- function Q(i) {
163
- return Object.entries(i).map(([t, e]) => !F(e) && e.value ? {
162
+ function P(n) {
163
+ return Object.entries(n).map(([t, e]) => !O(e) && e.value ? {
164
164
  ...e,
165
165
  label: e.label || t,
166
166
  value: e.value,
@@ -169,33 +169,39 @@ function Q(i) {
169
169
  } : {
170
170
  label: e.label || t,
171
171
  value: e,
172
- type: F(e) ? typeof e.value : typeof e,
172
+ type: O(e) ? typeof e.value : typeof e,
173
173
  visible: !0
174
174
  });
175
175
  }
176
- function Se(i) {
177
- const t = at(Pt, {});
178
- let e = [];
179
- if (typeof i != "string")
180
- if (lt(i)) {
181
- const s = ct(i);
182
- e = Q(s);
183
- } else
184
- e = Q(i);
185
- return j.controls = [...j.controls, ...e], t;
176
+ function Ee(n, t) {
177
+ const e = yt(Vt, {});
178
+ let s = [];
179
+ if (typeof n == "string")
180
+ s.push({
181
+ label: n,
182
+ visible: !0,
183
+ type: "folder",
184
+ controls: P(t)
185
+ });
186
+ else if (xt(n)) {
187
+ const i = _t(n);
188
+ s = P(i);
189
+ } else
190
+ s = P(n);
191
+ return V.controls = [...V.controls, ...s], e;
186
192
  }
187
193
  /**
188
194
  * @license
189
195
  * Copyright 2010-2023 Three.js Authors
190
196
  * SPDX-License-Identifier: MIT
191
197
  */
192
- const et = "152";
193
- function X(i, t, e) {
194
- return Math.max(t, Math.min(e, i));
198
+ const it = "152";
199
+ function R(n, t, e) {
200
+ return Math.max(t, Math.min(e, n));
195
201
  }
196
- class D {
202
+ class j {
197
203
  constructor(t = 0, e = 0) {
198
- D.prototype.isVector2 = !0, this.x = t, this.y = e;
204
+ j.prototype.isVector2 = !0, this.x = t, this.y = e;
199
205
  }
200
206
  get width() {
201
207
  return this.x;
@@ -284,8 +290,8 @@ class D {
284
290
  return this.multiplyScalar(1 / t);
285
291
  }
286
292
  applyMatrix3(t) {
287
- const e = this.x, s = this.y, n = t.elements;
288
- return this.x = n[0] * e + n[3] * s + n[6], this.y = n[1] * e + n[4] * s + n[7], this;
293
+ const e = this.x, s = this.y, i = t.elements;
294
+ return this.x = i[0] * e + i[3] * s + i[6], this.y = i[1] * e + i[4] * s + i[7], this;
289
295
  }
290
296
  min(t) {
291
297
  return this.x = Math.min(this.x, t.x), this.y = Math.min(this.y, t.y), this;
@@ -344,7 +350,7 @@ class D {
344
350
  if (e === 0)
345
351
  return Math.PI / 2;
346
352
  const s = this.dot(t) / e;
347
- return Math.acos(X(s, -1, 1));
353
+ return Math.acos(R(s, -1, 1));
348
354
  }
349
355
  distanceTo(t) {
350
356
  return Math.sqrt(this.distanceToSquared(t));
@@ -378,8 +384,8 @@ class D {
378
384
  return this.x = t.getX(e), this.y = t.getY(e), this;
379
385
  }
380
386
  rotateAround(t, e) {
381
- const s = Math.cos(e), n = Math.sin(e), r = this.x - t.x, a = this.y - t.y;
382
- return this.x = r * s - a * n + t.x, this.y = r * n + a * s + t.y, this;
387
+ const s = Math.cos(e), i = Math.sin(e), r = this.x - t.x, o = this.y - t.y;
388
+ return this.x = r * s - o * i + t.x, this.y = r * i + o * s + t.y, this;
383
389
  }
384
390
  random() {
385
391
  return this.x = Math.random(), this.y = Math.random(), this;
@@ -388,39 +394,39 @@ class D {
388
394
  yield this.x, yield this.y;
389
395
  }
390
396
  }
391
- class Lt {
392
- constructor(t = 0, e = 0, s = 0, n = 1) {
393
- this.isQuaternion = !0, this._x = t, this._y = e, this._z = s, this._w = n;
397
+ class Nt {
398
+ constructor(t = 0, e = 0, s = 0, i = 1) {
399
+ this.isQuaternion = !0, this._x = t, this._y = e, this._z = s, this._w = i;
394
400
  }
395
- static slerpFlat(t, e, s, n, r, a, h) {
396
- let y = s[n + 0], u = s[n + 1], l = s[n + 2], o = s[n + 3];
397
- const x = r[a + 0], c = r[a + 1], _ = r[a + 2], f = r[a + 3];
401
+ static slerpFlat(t, e, s, i, r, o, h) {
402
+ let y = s[i + 0], u = s[i + 1], l = s[i + 2], a = s[i + 3];
403
+ const x = r[o + 0], c = r[o + 1], _ = r[o + 2], f = r[o + 3];
398
404
  if (h === 0) {
399
- t[e + 0] = y, t[e + 1] = u, t[e + 2] = l, t[e + 3] = o;
405
+ t[e + 0] = y, t[e + 1] = u, t[e + 2] = l, t[e + 3] = a;
400
406
  return;
401
407
  }
402
408
  if (h === 1) {
403
409
  t[e + 0] = x, t[e + 1] = c, t[e + 2] = _, t[e + 3] = f;
404
410
  return;
405
411
  }
406
- if (o !== f || y !== x || u !== c || l !== _) {
412
+ if (a !== f || y !== x || u !== c || l !== _) {
407
413
  let p = 1 - h;
408
- const m = y * x + u * c + l * _ + o * f, M = m >= 0 ? 1 : -1, N = 1 - m * m;
409
- if (N > Number.EPSILON) {
410
- const S = Math.sqrt(N), R = Math.atan2(S, m * M);
411
- p = Math.sin(p * R) / S, h = Math.sin(h * R) / S;
414
+ const g = y * x + u * c + l * _ + a * f, M = g >= 0 ? 1 : -1, F = 1 - g * g;
415
+ if (F > Number.EPSILON) {
416
+ const k = Math.sqrt(F), Y = Math.atan2(k, g * M);
417
+ p = Math.sin(p * Y) / k, h = Math.sin(h * Y) / k;
412
418
  }
413
- const T = h * M;
414
- if (y = y * p + x * T, u = u * p + c * T, l = l * p + _ * T, o = o * p + f * T, p === 1 - h) {
415
- const S = 1 / Math.sqrt(y * y + u * u + l * l + o * o);
416
- y *= S, u *= S, l *= S, o *= S;
419
+ const q = h * M;
420
+ if (y = y * p + x * q, u = u * p + c * q, l = l * p + _ * q, a = a * p + f * q, p === 1 - h) {
421
+ const k = 1 / Math.sqrt(y * y + u * u + l * l + a * a);
422
+ y *= k, u *= k, l *= k, a *= k;
417
423
  }
418
424
  }
419
- t[e] = y, t[e + 1] = u, t[e + 2] = l, t[e + 3] = o;
425
+ t[e] = y, t[e + 1] = u, t[e + 2] = l, t[e + 3] = a;
420
426
  }
421
- static multiplyQuaternionsFlat(t, e, s, n, r, a) {
422
- const h = s[n], y = s[n + 1], u = s[n + 2], l = s[n + 3], o = r[a], x = r[a + 1], c = r[a + 2], _ = r[a + 3];
423
- return t[e] = h * _ + l * o + y * c - u * x, t[e + 1] = y * _ + l * x + u * o - h * c, t[e + 2] = u * _ + l * c + h * x - y * o, t[e + 3] = l * _ - h * o - y * x - u * c, t;
427
+ static multiplyQuaternionsFlat(t, e, s, i, r, o) {
428
+ const h = s[i], y = s[i + 1], u = s[i + 2], l = s[i + 3], a = r[o], x = r[o + 1], c = r[o + 2], _ = r[o + 3];
429
+ return t[e] = h * _ + l * a + y * c - u * x, t[e + 1] = y * _ + l * x + u * a - h * c, t[e + 2] = u * _ + l * c + h * x - y * a, t[e + 3] = l * _ - h * a - y * x - u * c, t;
424
430
  }
425
431
  get x() {
426
432
  return this._x;
@@ -446,8 +452,8 @@ class Lt {
446
452
  set w(t) {
447
453
  this._w = t, this._onChangeCallback();
448
454
  }
449
- set(t, e, s, n) {
450
- return this._x = t, this._y = e, this._z = s, this._w = n, this._onChangeCallback(), this;
455
+ set(t, e, s, i) {
456
+ return this._x = t, this._y = e, this._z = s, this._w = i, this._onChangeCallback(), this;
451
457
  }
452
458
  clone() {
453
459
  return new this.constructor(this._x, this._y, this._z, this._w);
@@ -456,49 +462,49 @@ class Lt {
456
462
  return this._x = t.x, this._y = t.y, this._z = t.z, this._w = t.w, this._onChangeCallback(), this;
457
463
  }
458
464
  setFromEuler(t, e) {
459
- const s = t._x, n = t._y, r = t._z, a = t._order, h = Math.cos, y = Math.sin, u = h(s / 2), l = h(n / 2), o = h(r / 2), x = y(s / 2), c = y(n / 2), _ = y(r / 2);
460
- switch (a) {
465
+ const s = t._x, i = t._y, r = t._z, o = t._order, h = Math.cos, y = Math.sin, u = h(s / 2), l = h(i / 2), a = h(r / 2), x = y(s / 2), c = y(i / 2), _ = y(r / 2);
466
+ switch (o) {
461
467
  case "XYZ":
462
- this._x = x * l * o + u * c * _, this._y = u * c * o - x * l * _, this._z = u * l * _ + x * c * o, this._w = u * l * o - x * c * _;
468
+ this._x = x * l * a + u * c * _, this._y = u * c * a - x * l * _, this._z = u * l * _ + x * c * a, this._w = u * l * a - x * c * _;
463
469
  break;
464
470
  case "YXZ":
465
- this._x = x * l * o + u * c * _, this._y = u * c * o - x * l * _, this._z = u * l * _ - x * c * o, this._w = u * l * o + x * c * _;
471
+ this._x = x * l * a + u * c * _, this._y = u * c * a - x * l * _, this._z = u * l * _ - x * c * a, this._w = u * l * a + x * c * _;
466
472
  break;
467
473
  case "ZXY":
468
- this._x = x * l * o - u * c * _, this._y = u * c * o + x * l * _, this._z = u * l * _ + x * c * o, this._w = u * l * o - x * c * _;
474
+ this._x = x * l * a - u * c * _, this._y = u * c * a + x * l * _, this._z = u * l * _ + x * c * a, this._w = u * l * a - x * c * _;
469
475
  break;
470
476
  case "ZYX":
471
- this._x = x * l * o - u * c * _, this._y = u * c * o + x * l * _, this._z = u * l * _ - x * c * o, this._w = u * l * o + x * c * _;
477
+ this._x = x * l * a - u * c * _, this._y = u * c * a + x * l * _, this._z = u * l * _ - x * c * a, this._w = u * l * a + x * c * _;
472
478
  break;
473
479
  case "YZX":
474
- this._x = x * l * o + u * c * _, this._y = u * c * o + x * l * _, this._z = u * l * _ - x * c * o, this._w = u * l * o - x * c * _;
480
+ this._x = x * l * a + u * c * _, this._y = u * c * a + x * l * _, this._z = u * l * _ - x * c * a, this._w = u * l * a - x * c * _;
475
481
  break;
476
482
  case "XZY":
477
- this._x = x * l * o - u * c * _, this._y = u * c * o - x * l * _, this._z = u * l * _ + x * c * o, this._w = u * l * o + x * c * _;
483
+ this._x = x * l * a - u * c * _, this._y = u * c * a - x * l * _, this._z = u * l * _ + x * c * a, this._w = u * l * a + x * c * _;
478
484
  break;
479
485
  default:
480
- console.warn("THREE.Quaternion: .setFromEuler() encountered an unknown order: " + a);
486
+ console.warn("THREE.Quaternion: .setFromEuler() encountered an unknown order: " + o);
481
487
  }
482
488
  return e !== !1 && this._onChangeCallback(), this;
483
489
  }
484
490
  setFromAxisAngle(t, e) {
485
- const s = e / 2, n = Math.sin(s);
486
- return this._x = t.x * n, this._y = t.y * n, this._z = t.z * n, this._w = Math.cos(s), this._onChangeCallback(), this;
491
+ const s = e / 2, i = Math.sin(s);
492
+ return this._x = t.x * i, this._y = t.y * i, this._z = t.z * i, this._w = Math.cos(s), this._onChangeCallback(), this;
487
493
  }
488
494
  setFromRotationMatrix(t) {
489
- const e = t.elements, s = e[0], n = e[4], r = e[8], a = e[1], h = e[5], y = e[9], u = e[2], l = e[6], o = e[10], x = s + h + o;
495
+ const e = t.elements, s = e[0], i = e[4], r = e[8], o = e[1], h = e[5], y = e[9], u = e[2], l = e[6], a = e[10], x = s + h + a;
490
496
  if (x > 0) {
491
497
  const c = 0.5 / Math.sqrt(x + 1);
492
- this._w = 0.25 / c, this._x = (l - y) * c, this._y = (r - u) * c, this._z = (a - n) * c;
493
- } else if (s > h && s > o) {
494
- const c = 2 * Math.sqrt(1 + s - h - o);
495
- this._w = (l - y) / c, this._x = 0.25 * c, this._y = (n + a) / c, this._z = (r + u) / c;
496
- } else if (h > o) {
497
- const c = 2 * Math.sqrt(1 + h - s - o);
498
- this._w = (r - u) / c, this._x = (n + a) / c, this._y = 0.25 * c, this._z = (y + l) / c;
498
+ this._w = 0.25 / c, this._x = (l - y) * c, this._y = (r - u) * c, this._z = (o - i) * c;
499
+ } else if (s > h && s > a) {
500
+ const c = 2 * Math.sqrt(1 + s - h - a);
501
+ this._w = (l - y) / c, this._x = 0.25 * c, this._y = (i + o) / c, this._z = (r + u) / c;
502
+ } else if (h > a) {
503
+ const c = 2 * Math.sqrt(1 + h - s - a);
504
+ this._w = (r - u) / c, this._x = (i + o) / c, this._y = 0.25 * c, this._z = (y + l) / c;
499
505
  } else {
500
- const c = 2 * Math.sqrt(1 + o - s - h);
501
- this._w = (a - n) / c, this._x = (r + u) / c, this._y = (y + l) / c, this._z = 0.25 * c;
506
+ const c = 2 * Math.sqrt(1 + a - s - h);
507
+ this._w = (o - i) / c, this._x = (r + u) / c, this._y = (y + l) / c, this._z = 0.25 * c;
502
508
  }
503
509
  return this._onChangeCallback(), this;
504
510
  }
@@ -507,14 +513,14 @@ class Lt {
507
513
  return s < Number.EPSILON ? (s = 0, Math.abs(t.x) > Math.abs(t.z) ? (this._x = -t.y, this._y = t.x, this._z = 0, this._w = s) : (this._x = 0, this._y = -t.z, this._z = t.y, this._w = s)) : (this._x = t.y * e.z - t.z * e.y, this._y = t.z * e.x - t.x * e.z, this._z = t.x * e.y - t.y * e.x, this._w = s), this.normalize();
508
514
  }
509
515
  angleTo(t) {
510
- return 2 * Math.acos(Math.abs(X(this.dot(t), -1, 1)));
516
+ return 2 * Math.acos(Math.abs(R(this.dot(t), -1, 1)));
511
517
  }
512
518
  rotateTowards(t, e) {
513
519
  const s = this.angleTo(t);
514
520
  if (s === 0)
515
521
  return this;
516
- const n = Math.min(1, e / s);
517
- return this.slerp(t, n), this;
522
+ const i = Math.min(1, e / s);
523
+ return this.slerp(t, i), this;
518
524
  }
519
525
  identity() {
520
526
  return this.set(0, 0, 0, 1);
@@ -545,36 +551,36 @@ class Lt {
545
551
  return this.multiplyQuaternions(t, this);
546
552
  }
547
553
  multiplyQuaternions(t, e) {
548
- const s = t._x, n = t._y, r = t._z, a = t._w, h = e._x, y = e._y, u = e._z, l = e._w;
549
- return this._x = s * l + a * h + n * u - r * y, this._y = n * l + a * y + r * h - s * u, this._z = r * l + a * u + s * y - n * h, this._w = a * l - s * h - n * y - r * u, this._onChangeCallback(), this;
554
+ const s = t._x, i = t._y, r = t._z, o = t._w, h = e._x, y = e._y, u = e._z, l = e._w;
555
+ return this._x = s * l + o * h + i * u - r * y, this._y = i * l + o * y + r * h - s * u, this._z = r * l + o * u + s * y - i * h, this._w = o * l - s * h - i * y - r * u, this._onChangeCallback(), this;
550
556
  }
551
557
  slerp(t, e) {
552
558
  if (e === 0)
553
559
  return this;
554
560
  if (e === 1)
555
561
  return this.copy(t);
556
- const s = this._x, n = this._y, r = this._z, a = this._w;
557
- let h = a * t._w + s * t._x + n * t._y + r * t._z;
562
+ const s = this._x, i = this._y, r = this._z, o = this._w;
563
+ let h = o * t._w + s * t._x + i * t._y + r * t._z;
558
564
  if (h < 0 ? (this._w = -t._w, this._x = -t._x, this._y = -t._y, this._z = -t._z, h = -h) : this.copy(t), h >= 1)
559
- return this._w = a, this._x = s, this._y = n, this._z = r, this;
565
+ return this._w = o, this._x = s, this._y = i, this._z = r, this;
560
566
  const y = 1 - h * h;
561
567
  if (y <= Number.EPSILON) {
562
568
  const c = 1 - e;
563
- return this._w = c * a + e * this._w, this._x = c * s + e * this._x, this._y = c * n + e * this._y, this._z = c * r + e * this._z, this.normalize(), this._onChangeCallback(), this;
569
+ return this._w = c * o + e * this._w, this._x = c * s + e * this._x, this._y = c * i + e * this._y, this._z = c * r + e * this._z, this.normalize(), this._onChangeCallback(), this;
564
570
  }
565
- const u = Math.sqrt(y), l = Math.atan2(u, h), o = Math.sin((1 - e) * l) / u, x = Math.sin(e * l) / u;
566
- return this._w = a * o + this._w * x, this._x = s * o + this._x * x, this._y = n * o + this._y * x, this._z = r * o + this._z * x, this._onChangeCallback(), this;
571
+ const u = Math.sqrt(y), l = Math.atan2(u, h), a = Math.sin((1 - e) * l) / u, x = Math.sin(e * l) / u;
572
+ return this._w = o * a + this._w * x, this._x = s * a + this._x * x, this._y = i * a + this._y * x, this._z = r * a + this._z * x, this._onChangeCallback(), this;
567
573
  }
568
574
  slerpQuaternions(t, e, s) {
569
575
  return this.copy(t).slerp(e, s);
570
576
  }
571
577
  random() {
572
- const t = Math.random(), e = Math.sqrt(1 - t), s = Math.sqrt(t), n = 2 * Math.PI * Math.random(), r = 2 * Math.PI * Math.random();
578
+ const t = Math.random(), e = Math.sqrt(1 - t), s = Math.sqrt(t), i = 2 * Math.PI * Math.random(), r = 2 * Math.PI * Math.random();
573
579
  return this.set(
574
- e * Math.cos(n),
580
+ e * Math.cos(i),
575
581
  s * Math.sin(r),
576
582
  s * Math.cos(r),
577
- e * Math.sin(n)
583
+ e * Math.sin(i)
578
584
  );
579
585
  }
580
586
  equals(t) {
@@ -601,9 +607,9 @@ class Lt {
601
607
  yield this._x, yield this._y, yield this._z, yield this._w;
602
608
  }
603
609
  }
604
- class A {
610
+ class I {
605
611
  constructor(t = 0, e = 0, s = 0) {
606
- A.prototype.isVector3 = !0, this.x = t, this.y = e, this.z = s;
612
+ I.prototype.isVector3 = !0, this.x = t, this.y = e, this.z = s;
607
613
  }
608
614
  set(t, e, s) {
609
615
  return s === void 0 && (s = this.z), this.x = t, this.y = e, this.z = s, this;
@@ -685,25 +691,25 @@ class A {
685
691
  return this.x = t.x * e.x, this.y = t.y * e.y, this.z = t.z * e.z, this;
686
692
  }
687
693
  applyEuler(t) {
688
- return this.applyQuaternion(Z.setFromEuler(t));
694
+ return this.applyQuaternion(W.setFromEuler(t));
689
695
  }
690
696
  applyAxisAngle(t, e) {
691
- return this.applyQuaternion(Z.setFromAxisAngle(t, e));
697
+ return this.applyQuaternion(W.setFromAxisAngle(t, e));
692
698
  }
693
699
  applyMatrix3(t) {
694
- const e = this.x, s = this.y, n = this.z, r = t.elements;
695
- return this.x = r[0] * e + r[3] * s + r[6] * n, this.y = r[1] * e + r[4] * s + r[7] * n, this.z = r[2] * e + r[5] * s + r[8] * n, this;
700
+ const e = this.x, s = this.y, i = this.z, r = t.elements;
701
+ return this.x = r[0] * e + r[3] * s + r[6] * i, this.y = r[1] * e + r[4] * s + r[7] * i, this.z = r[2] * e + r[5] * s + r[8] * i, this;
696
702
  }
697
703
  applyNormalMatrix(t) {
698
704
  return this.applyMatrix3(t).normalize();
699
705
  }
700
706
  applyMatrix4(t) {
701
- const e = this.x, s = this.y, n = this.z, r = t.elements, a = 1 / (r[3] * e + r[7] * s + r[11] * n + r[15]);
702
- return this.x = (r[0] * e + r[4] * s + r[8] * n + r[12]) * a, this.y = (r[1] * e + r[5] * s + r[9] * n + r[13]) * a, this.z = (r[2] * e + r[6] * s + r[10] * n + r[14]) * a, this;
707
+ const e = this.x, s = this.y, i = this.z, r = t.elements, o = 1 / (r[3] * e + r[7] * s + r[11] * i + r[15]);
708
+ return this.x = (r[0] * e + r[4] * s + r[8] * i + r[12]) * o, this.y = (r[1] * e + r[5] * s + r[9] * i + r[13]) * o, this.z = (r[2] * e + r[6] * s + r[10] * i + r[14]) * o, this;
703
709
  }
704
710
  applyQuaternion(t) {
705
- const e = this.x, s = this.y, n = this.z, r = t.x, a = t.y, h = t.z, y = t.w, u = y * e + a * n - h * s, l = y * s + h * e - r * n, o = y * n + r * s - a * e, x = -r * e - a * s - h * n;
706
- return this.x = u * y + x * -r + l * -h - o * -a, this.y = l * y + x * -a + o * -r - u * -h, this.z = o * y + x * -h + u * -a - l * -r, this;
711
+ const e = this.x, s = this.y, i = this.z, r = t.x, o = t.y, h = t.z, y = t.w, u = y * e + o * i - h * s, l = y * s + h * e - r * i, a = y * i + r * s - o * e, x = -r * e - o * s - h * i;
712
+ return this.x = u * y + x * -r + l * -h - a * -o, this.y = l * y + x * -o + a * -r - u * -h, this.z = a * y + x * -h + u * -o - l * -r, this;
707
713
  }
708
714
  project(t) {
709
715
  return this.applyMatrix4(t.matrixWorldInverse).applyMatrix4(t.projectionMatrix);
@@ -712,8 +718,8 @@ class A {
712
718
  return this.applyMatrix4(t.projectionMatrixInverse).applyMatrix4(t.matrixWorld);
713
719
  }
714
720
  transformDirection(t) {
715
- const e = this.x, s = this.y, n = this.z, r = t.elements;
716
- return this.x = r[0] * e + r[4] * s + r[8] * n, this.y = r[1] * e + r[5] * s + r[9] * n, this.z = r[2] * e + r[6] * s + r[10] * n, this.normalize();
721
+ const e = this.x, s = this.y, i = this.z, r = t.elements;
722
+ return this.x = r[0] * e + r[4] * s + r[8] * i, this.y = r[1] * e + r[5] * s + r[9] * i, this.z = r[2] * e + r[6] * s + r[10] * i, this.normalize();
717
723
  }
718
724
  divide(t) {
719
725
  return this.x /= t.x, this.y /= t.y, this.z /= t.z, this;
@@ -781,8 +787,8 @@ class A {
781
787
  return this.crossVectors(this, t);
782
788
  }
783
789
  crossVectors(t, e) {
784
- const s = t.x, n = t.y, r = t.z, a = e.x, h = e.y, y = e.z;
785
- return this.x = n * y - r * h, this.y = r * a - s * y, this.z = s * h - n * a, this;
790
+ const s = t.x, i = t.y, r = t.z, o = e.x, h = e.y, y = e.z;
791
+ return this.x = i * y - r * h, this.y = r * o - s * y, this.z = s * h - i * o, this;
786
792
  }
787
793
  projectOnVector(t) {
788
794
  const e = t.lengthSq();
@@ -792,24 +798,24 @@ class A {
792
798
  return this.copy(t).multiplyScalar(s);
793
799
  }
794
800
  projectOnPlane(t) {
795
- return P.copy(this).projectOnVector(t), this.sub(P);
801
+ return L.copy(this).projectOnVector(t), this.sub(L);
796
802
  }
797
803
  reflect(t) {
798
- return this.sub(P.copy(t).multiplyScalar(2 * this.dot(t)));
804
+ return this.sub(L.copy(t).multiplyScalar(2 * this.dot(t)));
799
805
  }
800
806
  angleTo(t) {
801
807
  const e = Math.sqrt(this.lengthSq() * t.lengthSq());
802
808
  if (e === 0)
803
809
  return Math.PI / 2;
804
810
  const s = this.dot(t) / e;
805
- return Math.acos(X(s, -1, 1));
811
+ return Math.acos(R(s, -1, 1));
806
812
  }
807
813
  distanceTo(t) {
808
814
  return Math.sqrt(this.distanceToSquared(t));
809
815
  }
810
816
  distanceToSquared(t) {
811
- const e = this.x - t.x, s = this.y - t.y, n = this.z - t.z;
812
- return e * e + s * s + n * n;
817
+ const e = this.x - t.x, s = this.y - t.y, i = this.z - t.z;
818
+ return e * e + s * s + i * i;
813
819
  }
814
820
  manhattanDistanceTo(t) {
815
821
  return Math.abs(this.x - t.x) + Math.abs(this.y - t.y) + Math.abs(this.z - t.z);
@@ -818,8 +824,8 @@ class A {
818
824
  return this.setFromSphericalCoords(t.radius, t.phi, t.theta);
819
825
  }
820
826
  setFromSphericalCoords(t, e, s) {
821
- const n = Math.sin(e) * t;
822
- return this.x = n * Math.sin(s), this.y = Math.cos(e) * t, this.z = n * Math.cos(s), this;
827
+ const i = Math.sin(e) * t;
828
+ return this.x = i * Math.sin(s), this.y = Math.cos(e) * t, this.z = i * Math.cos(s), this;
823
829
  }
824
830
  setFromCylindrical(t) {
825
831
  return this.setFromCylindricalCoords(t.radius, t.theta, t.y);
@@ -832,8 +838,8 @@ class A {
832
838
  return this.x = e[12], this.y = e[13], this.z = e[14], this;
833
839
  }
834
840
  setFromMatrixScale(t) {
835
- const e = this.setFromMatrixColumn(t, 0).length(), s = this.setFromMatrixColumn(t, 1).length(), n = this.setFromMatrixColumn(t, 2).length();
836
- return this.x = e, this.y = s, this.z = n, this;
841
+ const e = this.setFromMatrixColumn(t, 0).length(), s = this.setFromMatrixColumn(t, 1).length(), i = this.setFromMatrixColumn(t, 2).length();
842
+ return this.x = e, this.y = s, this.z = i, this;
837
843
  }
838
844
  setFromMatrixColumn(t, e) {
839
845
  return this.fromArray(t.elements, e * 4);
@@ -870,323 +876,367 @@ class A {
870
876
  yield this.x, yield this.y, yield this.z;
871
877
  }
872
878
  }
873
- const P = /* @__PURE__ */ new A(), Z = /* @__PURE__ */ new Lt();
879
+ const L = /* @__PURE__ */ new I(), W = /* @__PURE__ */ new Nt();
874
880
  typeof __THREE_DEVTOOLS__ < "u" && __THREE_DEVTOOLS__.dispatchEvent(new CustomEvent("register", { detail: {
875
- revision: et
881
+ revision: it
876
882
  } }));
877
- typeof window < "u" && (window.__THREE__ ? console.warn("WARNING: Multiple instances of Three.js being imported.") : window.__THREE__ = et);
878
- const Vt = { class: "flex justify-between gap-4 items-center mb-2" }, Xt = { class: "text-gray-500 w-1/3" }, Nt = ["value", "min", "max", "step"], Rt = /* @__PURE__ */ C({
883
+ typeof window < "u" && (window.__THREE__ ? console.warn("WARNING: Multiple instances of Three.js being imported.") : window.__THREE__ = it);
884
+ const Rt = { class: "flex px-4 justify-between gap-4 items-center mb-2" }, Ft = { class: "text-gray-500 w-1/3" }, Yt = ["value", "min", "max", "step"], Ot = /* @__PURE__ */ C({
879
885
  __name: "NumberControl",
880
886
  props: {
881
887
  label: null,
882
888
  control: null
883
889
  },
884
890
  emits: ["change"],
885
- setup(i, { emit: t }) {
886
- const e = i;
891
+ setup(n, { emit: t }) {
892
+ const e = n;
887
893
  function s(l) {
888
- const { target: o } = l;
889
- t("change", o.valueAsNumber);
894
+ const { target: a } = l;
895
+ t("change", a.valueAsNumber);
890
896
  }
891
- const n = V(), r = w(0), a = w(!1), h = (l) => {
892
- r.value = l.clientX, a.value = !0;
897
+ const i = N(), r = w(0), o = w(!1), h = (l) => {
898
+ r.value = l.clientX, o.value = !0;
893
899
  }, y = () => {
894
- a.value = !1;
900
+ o.value = !1;
895
901
  }, u = (l) => Math.floor(Math.abs(l) / 10);
896
- return E(n.x, (l) => {
897
- if (a.value) {
898
- const o = l - r.value, x = u(o);
899
- o > 0 ? t("change", e.control.value + 1 + x) : o < 0 && t("change", e.control.value - 1 + x), e.control.min !== void 0 && e.control.value < e.control.min && t("change", e.control.min), e.control.max !== void 0 && e.control.value > e.control.max && t("change", e.control.max), r.value = l;
902
+ return E(i.x, (l) => {
903
+ if (o.value) {
904
+ const a = l - r.value, x = u(a);
905
+ a > 0 ? t("change", e.control.value + 1 + x) : a < 0 && t("change", e.control.value - 1 + x), e.control.min !== void 0 && e.control.value < e.control.min && t("change", e.control.min), e.control.max !== void 0 && e.control.value > e.control.max && t("change", e.control.max), r.value = l;
900
906
  }
901
- }), (l, o) => (g(), b("div", Vt, [
902
- d("label", Xt, $(i.label), 1),
907
+ }), (l, a) => (m(), b("div", Rt, [
908
+ d("label", Ft, $(n.label), 1),
903
909
  d("input", {
904
- value: i.control.value,
905
- class: q(["p-2 w-1/3 rounded text-right text-xs text-gray-400 bg-gray-100 focus:border-gray-200 outline-none border-none font-sans", { "cursor-ew-resize": a.value }]),
910
+ value: n.control.value,
911
+ class: T(["p-2 w-1/3 rounded text-right text-xs text-gray-400 bg-gray-100 focus:border-gray-200 outline-none border-none font-sans", { "cursor-ew-resize": o.value }]),
906
912
  type: "number",
907
- min: i.control.min,
908
- max: i.control.max,
909
- step: i.control.step,
913
+ min: n.control.min,
914
+ max: n.control.max,
915
+ step: n.control.step,
910
916
  onInput: s,
911
917
  onMousedown: h,
912
918
  onMouseup: y
913
- }, null, 42, Nt)
919
+ }, null, 42, Yt)
914
920
  ]));
915
921
  }
916
- }), Ft = { class: "flex justify-between gap-4 items-center mb-2 min-h-32px" }, Yt = { class: "text-gray-500 w-1/3" }, Ht = ["value"], Ot = /* @__PURE__ */ C({
922
+ }), Ht = { class: "flex px-4 justify-between gap-4 items-center mb-2 min-h-32px" }, Qt = { class: "text-gray-500 w-1/3" }, Zt = ["value"], Wt = /* @__PURE__ */ C({
917
923
  __name: "TextControl",
918
924
  props: {
919
925
  label: null,
920
926
  control: null
921
927
  },
922
928
  emits: ["change"],
923
- setup(i, { emit: t }) {
929
+ setup(n, { emit: t }) {
924
930
  function e(s) {
925
931
  t("change", s);
926
932
  }
927
- return (s, n) => (g(), b("div", Ft, [
928
- d("label", Yt, $(i.label), 1),
933
+ return (s, i) => (m(), b("div", Ht, [
934
+ d("label", Qt, $(n.label), 1),
929
935
  d("input", {
930
- value: i.control.value,
936
+ value: n.control.value,
931
937
  type: "string",
932
938
  class: "p-2 w-2/3 rounded text-right text-xs text-gray-400 bg-gray-100 focus:border-gray-200 outline-none border-none font-sans",
933
939
  onChange: e
934
- }, null, 40, Ht)
940
+ }, null, 40, Zt)
935
941
  ]));
936
942
  }
937
- }), Qt = { class: "flex justify-start gap-2 items-center mb-2 min-h-32px" }, Zt = { class: "text-gray-500 w-1/3" }, Wt = ["id", "checked"], Bt = ["for"], Ut = { class: "i-ic:baseline-check text-light" }, Kt = /* @__PURE__ */ C({
943
+ }), Bt = { class: "flex px-4 justify-start gap-2 items-center mb-2 min-h-32px" }, Ut = { class: "text-gray-500 w-1/3" }, Kt = ["id", "checked"], Gt = ["for"], Jt = { class: "i-ic:baseline-check text-light" }, te = /* @__PURE__ */ C({
938
944
  __name: "BooleanControl",
939
945
  props: {
940
946
  label: null,
941
947
  control: null
942
948
  },
943
949
  emits: ["change"],
944
- setup(i, { emit: t }) {
950
+ setup(n, { emit: t }) {
945
951
  function e(s) {
946
- const { target: n } = s;
947
- t("change", n.checked);
952
+ const { target: i } = s;
953
+ t("change", i.checked);
948
954
  }
949
- return (s, n) => (g(), b("div", Qt, [
950
- d("label", Zt, $(i.label), 1),
955
+ return (s, i) => (m(), b("div", Bt, [
956
+ d("label", Ut, $(n.label), 1),
951
957
  d("input", {
952
- id: i.control.label,
953
- checked: i.control.value,
958
+ id: n.control.label,
959
+ checked: n.control.value,
954
960
  class: "hidden",
955
961
  type: "checkbox",
956
962
  onInput: e
957
- }, null, 40, Wt),
963
+ }, null, 40, Kt),
958
964
  d("label", {
959
- for: i.control.label,
965
+ for: n.control.label,
960
966
  class: "inline-flex items-center cursor-pointer"
961
967
  }, [
962
968
  d("span", {
963
- class: q([{ "bg-dark-500": i.control.value, "bg-gray-200": !i.control.value }, "w-4 h-4 flex justify-center items-center rounded border border-gray-300 mr-2 transition-colors duration-200"])
969
+ class: T([{ "bg-dark-500": n.control.value, "bg-gray-200": !n.control.value }, "w-4 h-4 flex justify-center items-center rounded border border-gray-300 mr-2 transition-colors duration-200"])
964
970
  }, [
965
- ut(d("i", Ut, null, 512), [
966
- [yt, i.control.value]
971
+ U(d("i", Jt, null, 512), [
972
+ [K, n.control.value]
967
973
  ])
968
974
  ], 2)
969
- ], 8, Bt)
975
+ ], 8, Gt)
970
976
  ]));
971
977
  }
972
- }), Gt = { class: "relative flex justify-between gap-4 items-center mb-2" }, Jt = { class: "text-gray-500 w-1/3" }, te = ["value", "min", "max", "step"], ee = ["value", "min", "max", "step"], se = /* @__PURE__ */ C({
978
+ }), ee = { class: "px-4 relative flex justify-between gap-4 items-center mb-2" }, se = { class: "text-gray-500 w-1/3" }, ne = ["value", "min", "max", "step"], ie = ["value", "min", "max", "step"], re = /* @__PURE__ */ C({
973
979
  __name: "SliderControl",
974
980
  props: {
975
981
  label: null,
976
982
  control: null
977
983
  },
978
984
  emits: ["change"],
979
- setup(i, { emit: t }) {
980
- const e = i;
981
- function s(o) {
982
- const { target: x } = o;
985
+ setup(n, { emit: t }) {
986
+ const e = n;
987
+ function s(a) {
988
+ const { target: x } = a;
983
989
  t("change", x.valueAsNumber);
984
990
  }
985
- const n = v(() => ({
991
+ const i = S(() => ({
986
992
  backgroundImage: `linear-gradient(to right, #333 0% ${100 * (e.control.value - (e.control.min || 0)) / ((e.control.max || 100) - (e.control.min || 0))}%, #e2e2e2 0%)`
987
- })), r = V(), a = w(0), h = w(!1), y = (o) => {
988
- a.value = o.clientX, h.value = !0;
993
+ })), r = N(), o = w(0), h = w(!1), y = (a) => {
994
+ o.value = a.clientX, h.value = !0;
989
995
  }, u = () => {
990
996
  h.value = !1;
991
- }, l = (o) => Math.floor(Math.abs(o) / 10);
992
- return E(r.x, (o) => {
997
+ }, l = (a) => Math.floor(Math.abs(a) / 10);
998
+ return E(r.x, (a) => {
993
999
  if (h.value) {
994
- const x = o - a.value, c = l(x);
995
- x > 0 ? t("change", e.control.value + 1 + c) : x < 0 && t("change", e.control.value - 1 + c), e.control.min !== void 0 && e.control.value < e.control.min && t("change", e.control.min), e.control.max !== void 0 && e.control.value > e.control.max && t("change", e.control.max), a.value = o;
1000
+ const x = a - o.value, c = l(x);
1001
+ x > 0 ? t("change", e.control.value + 1 + c) : x < 0 && t("change", e.control.value - 1 + c), e.control.min !== void 0 && e.control.value < e.control.min && t("change", e.control.min), e.control.max !== void 0 && e.control.value > e.control.max && t("change", e.control.max), o.value = a;
996
1002
  }
997
- }), (o, x) => (g(), b("div", Gt, [
998
- d("label", Jt, $(i.label), 1),
1003
+ }), (a, x) => (m(), b("div", ee, [
1004
+ d("label", se, $(n.label), 1),
999
1005
  d("input", {
1000
- value: i.control.value,
1006
+ value: n.control.value,
1001
1007
  class: "w-1/2 h-0.75 bg-dark-200 rounded-full appearance-none",
1002
- style: xt(z(n)),
1008
+ style: dt(z(i)),
1003
1009
  type: "range",
1004
- min: i.control.min,
1005
- max: i.control.max,
1006
- step: i.control.step,
1010
+ min: n.control.min,
1011
+ max: n.control.max,
1012
+ step: n.control.step,
1007
1013
  onInput: s
1008
- }, null, 44, te),
1014
+ }, null, 44, ne),
1009
1015
  d("input", {
1010
- value: i.control.value,
1011
- class: q(["p-2 w-1/4 rounded text-right text-xs text-gray-400 bg-gray-100 focus:border-gray-200 outline-none border-none font-sans", { "cursor-ew-resize": h.value }]),
1016
+ value: n.control.value,
1017
+ class: T(["p-2 w-1/4 rounded text-right text-xs text-gray-400 bg-gray-100 focus:border-gray-200 outline-none border-none font-sans", { "cursor-ew-resize": h.value }]),
1012
1018
  type: "number",
1013
- min: i.control.min,
1014
- max: i.control.max,
1015
- step: i.control.step,
1019
+ min: n.control.min,
1020
+ max: n.control.max,
1021
+ step: n.control.step,
1016
1022
  onInput: s,
1017
1023
  onMousedown: y,
1018
1024
  onMouseup: u
1019
- }, null, 42, ee)
1025
+ }, null, 42, ie)
1020
1026
  ]));
1021
1027
  }
1022
1028
  });
1023
- const ie = (i, t) => {
1024
- const e = i.__vccOpts || i;
1025
- for (const [s, n] of t)
1026
- e[s] = n;
1029
+ const oe = (n, t) => {
1030
+ const e = n.__vccOpts || n;
1031
+ for (const [s, i] of t)
1032
+ e[s] = i;
1027
1033
  return e;
1028
- }, ne = /* @__PURE__ */ ie(se, [["__scopeId", "data-v-546d47fc"]]), re = { class: "flex justify-between gap-4 items-center mb-2" }, oe = { class: "text-gray-500 w-1/3" }, he = ["value"], ae = ["value"], le = /* @__PURE__ */ C({
1034
+ }, he = /* @__PURE__ */ oe(re, [["__scopeId", "data-v-da7e8146"]]), ae = { class: "flex px-4 justify-between gap-4 items-center mb-2" }, le = { class: "text-gray-500 w-1/3" }, ce = ["value"], ue = ["value"], ye = /* @__PURE__ */ C({
1029
1035
  __name: "ColorControl",
1030
1036
  props: {
1031
1037
  label: null,
1032
1038
  control: null
1033
1039
  },
1034
1040
  emits: ["change"],
1035
- setup(i, { emit: t }) {
1041
+ setup(n, { emit: t }) {
1036
1042
  function e(s) {
1037
- const { target: n } = s;
1038
- t("change", n.value);
1043
+ const { target: i } = s;
1044
+ t("change", i.value);
1039
1045
  }
1040
- return (s, n) => (g(), b("div", re, [
1041
- d("label", oe, $(i.label), 1),
1046
+ return (s, i) => (m(), b("div", ae, [
1047
+ d("label", le, $(n.label), 1),
1042
1048
  d("input", {
1043
- value: i.control.value,
1049
+ value: n.control.value,
1044
1050
  type: "color",
1045
1051
  onInput: e
1046
- }, null, 40, he),
1052
+ }, null, 40, ce),
1047
1053
  d("input", {
1048
- value: i.control.value,
1054
+ value: n.control.value,
1049
1055
  class: "p-2 w-2/3 rounded text-right text-xs text-gray-400 bg-gray-100 focus:border-gray-200 outline-none border-none font-sans",
1050
1056
  type: "text",
1051
1057
  onInput: e
1052
- }, null, 40, ae)
1058
+ }, null, 40, ue)
1053
1059
  ]));
1054
1060
  }
1055
1061
  });
1056
- function ce(i) {
1057
- return typeof i == "number" ? [i, i, i] : i instanceof A ? [i.x, i.y, i.z] : i;
1062
+ function xe(n) {
1063
+ return typeof n == "number" ? [n, n, n] : n instanceof I ? [n.x, n.y, n.z] : n;
1058
1064
  }
1059
- const ue = { class: "flex justify-between gap-2 items-center mb-2" }, ye = { class: "text-gray-500 w-1/3" }, xe = { class: "w-2/3 flex justify-between gap-1" }, _e = {
1065
+ const _e = { class: "flex px-4 justify-between gap-2 items-center mb-2" }, de = { class: "text-gray-500 w-1/3" }, me = { class: "w-2/3 flex justify-between gap-1" }, ge = {
1060
1066
  key: 0,
1061
1067
  class: "font-bold px-0.5 py-1 text-0.65rem text-gray-300"
1062
- }, de = ["value", "onInput", "onMousedown", "onMouseup"], me = /* @__PURE__ */ C({
1068
+ }, fe = ["value", "onInput", "onMousedown", "onMouseup"], pe = /* @__PURE__ */ C({
1063
1069
  __name: "VectorControl",
1064
1070
  props: {
1065
1071
  label: null,
1066
1072
  control: null
1067
1073
  },
1068
1074
  emits: ["change"],
1069
- setup(i, { emit: t }) {
1070
- const e = i, s = V(), n = w(0), r = w(!1), a = w(0), h = (_, f) => {
1071
- a.value = f, n.value = _.clientX, r.value = !0;
1075
+ setup(n, { emit: t }) {
1076
+ const e = n, s = N(), i = w(0), r = w(!1), o = w(0), h = (_, f) => {
1077
+ o.value = f, i.value = _.clientX, r.value = !0;
1072
1078
  }, y = (_, f) => {
1073
- a.value = f, r.value = !1;
1074
- }, u = (_) => Math.floor(Math.abs(_) / 10), l = v(() => ce(e.control.value)), o = v(() => Object.keys(e.control.value)), x = v(() => e.control.value instanceof D || e.control.value instanceof A);
1079
+ o.value = f, r.value = !1;
1080
+ }, u = (_) => Math.floor(Math.abs(_) / 10), l = S(() => xe(e.control.value)), a = S(() => Object.keys(e.control.value)), x = S(() => e.control.value instanceof j || e.control.value instanceof I);
1075
1081
  function c(_, f) {
1076
- const { value: p } = e.control, { target: m } = _;
1077
- a.value = f, p[x.value ? o.value[a.value] : a.value] = parseInt(m.value, 10), t("change", p);
1082
+ const { value: p } = e.control, { target: g } = _;
1083
+ o.value = f, p[x.value ? a.value[o.value] : o.value] = parseInt(g.value, 10), t("change", p);
1078
1084
  }
1079
1085
  return E(s.x, (_) => {
1080
1086
  if (r.value) {
1081
- const f = _ - n.value, p = u(f), { value: m } = e.control, M = x.value ? o.value[a.value] : a.value;
1082
- f > 0 ? m[M] += 1 + p : f < 0 && (m[M] -= 1 + p), e.control.min !== void 0 && m < e.control.min && (m[M] = e.control.min), e.control.max !== void 0 && m > e.control.max && (m[M] = e.control.max), t("change", m), n.value = _;
1087
+ const f = _ - i.value, p = u(f), { value: g } = e.control, M = x.value ? a.value[o.value] : o.value;
1088
+ f > 0 ? g[M] += 1 + p : f < 0 && (g[M] -= 1 + p), e.control.min !== void 0 && g < e.control.min && (g[M] = e.control.min), e.control.max !== void 0 && g > e.control.max && (g[M] = e.control.max), t("change", g), i.value = _;
1083
1089
  }
1084
- }), (_, f) => (g(), b("div", ue, [
1085
- d("label", ye, $(i.label), 1),
1086
- d("div", xe, [
1087
- (g(!0), b(L, null, B(z(l), (p, m) => (g(), b("div", {
1088
- key: i.label + m,
1090
+ }), (_, f) => (m(), b("div", _e, [
1091
+ d("label", de, $(n.label), 1),
1092
+ d("div", me, [
1093
+ (m(!0), b(D, null, X(z(l), (p, g) => (m(), b("div", {
1094
+ key: n.label + g,
1089
1095
  class: "flex items-center w-1/3 bg-gray-100 rounded"
1090
1096
  }, [
1091
- z(o)[m] && z(x) ? (g(), b("span", _e, $(z(o)[m]), 1)) : U("", !0),
1097
+ z(a)[g] && z(x) ? (m(), b("span", ge, $(z(a)[g]), 1)) : G("", !0),
1092
1098
  d("input", {
1093
1099
  type: "text",
1094
- class: q(["w-full pl-0 p-1 text-right text-0.65rem text-gray-400 bg-transparent focus:border-gray-200 outline-none border-none font-sans", { "cursor-ew-resize": r.value }]),
1095
- value: z(l)[m].toFixed(2),
1096
- onInput: (M) => c(M, m),
1097
- onMousedown: (M) => h(M, m),
1098
- onMouseup: (M) => y(M, m)
1099
- }, null, 42, de)
1100
+ class: T(["w-full pl-0 p-1 text-right text-0.65rem text-gray-400 bg-transparent focus:border-gray-200 outline-none border-none font-sans", { "cursor-ew-resize": r.value }]),
1101
+ value: z(l)[g].toFixed(2),
1102
+ onInput: (M) => c(M, g),
1103
+ onMousedown: (M) => h(M, g),
1104
+ onMouseup: (M) => y(M, g)
1105
+ }, null, 42, fe)
1100
1106
  ]))), 128))
1101
1107
  ])
1102
1108
  ]));
1103
1109
  }
1104
- }), ge = /* @__PURE__ */ C({
1110
+ }), ze = { class: "bg-white rounded-b" }, Me = /* @__PURE__ */ C({
1111
+ __name: "Folder",
1112
+ props: {
1113
+ control: null
1114
+ },
1115
+ setup(n) {
1116
+ function t(i, r) {
1117
+ r.value = i;
1118
+ }
1119
+ const e = w(!1), s = () => {
1120
+ e.value = !e.value;
1121
+ };
1122
+ return (i, r) => (m(), b("div", null, [
1123
+ d("button", {
1124
+ class: "flex items-center justify-between w-full p-4 bg-gray-100 border-none text-gray-400 font-bold text-xs focus:outline-none font-sans cursor-pointer",
1125
+ onClick: s
1126
+ }, [
1127
+ d("span", null, $(n.control.label), 1),
1128
+ d("i", {
1129
+ class: T(e.value ? "i-ic:baseline-keyboard-arrow-up" : "i-ic:baseline-keyboard-arrow-down")
1130
+ }, null, 2)
1131
+ ]),
1132
+ mt(gt, {
1133
+ name: "animate__animated",
1134
+ "enter-active-class": "animate__fadeIn",
1135
+ "leave-active-class": "animate__fadeOut"
1136
+ }, {
1137
+ default: J(() => [
1138
+ U(d("div", ze, [
1139
+ (m(!0), b(D, null, X(n.control.controls, (o) => (m(), v(rt, {
1140
+ key: o.label,
1141
+ control: o,
1142
+ onChange: r[0] || (r[0] = (h) => t(h, n.control))
1143
+ }, null, 8, ["control"]))), 128))
1144
+ ], 512), [
1145
+ [K, e.value]
1146
+ ])
1147
+ ]),
1148
+ _: 1
1149
+ })
1150
+ ]));
1151
+ }
1152
+ }), rt = /* @__PURE__ */ C({
1105
1153
  __name: "ControlInput",
1106
1154
  props: {
1107
1155
  control: null
1108
1156
  },
1109
1157
  emits: ["change"],
1110
- setup(i, { emit: t }) {
1111
- const e = i, s = v(
1158
+ setup(n, { emit: t }) {
1159
+ const e = n, s = S(
1112
1160
  () => e.control.type === "number" && (e.control.step || e.control.max || e.control.min)
1113
- ), n = v(() => {
1161
+ ), i = S(() => {
1114
1162
  const h = /^#([A-Fa-f0-9]{6}|[A-Fa-f0-9]{3})$|^0x([A-Fa-f0-9]{6}|[A-Fa-f0-9]{3})$/;
1115
1163
  return e.control.type === "color" || h.test(e.control.value);
1116
- }), r = v(
1117
- () => e.control.value instanceof Array || e.control.value instanceof D || e.control.value instanceof A
1164
+ }), r = S(
1165
+ () => e.control.value instanceof Array || e.control.value instanceof j || e.control.value instanceof I
1118
1166
  );
1119
- function a(h) {
1167
+ function o(h) {
1120
1168
  t("change", h);
1121
1169
  }
1122
- return (h, y) => i.control.visible ? (g(), b(L, { key: 0 }, [
1123
- z(n) ? (g(), k(le, {
1170
+ return (h, y) => n.control.visible ? (m(), b(D, { key: 0 }, [
1171
+ z(i) ? (m(), v(ye, {
1124
1172
  key: 0,
1125
- label: i.control.label,
1126
- control: i.control,
1127
- onChange: a
1128
- }, null, 8, ["label", "control"])) : z(r) ? (g(), k(me, {
1173
+ label: n.control.label,
1174
+ control: n.control,
1175
+ onChange: o
1176
+ }, null, 8, ["label", "control"])) : z(r) ? (m(), v(pe, {
1129
1177
  key: 1,
1130
- label: i.control.label,
1131
- control: i.control,
1132
- onChange: a
1133
- }, null, 8, ["label", "control"])) : i.control.type === "boolean" ? (g(), k(Kt, {
1178
+ label: n.control.label,
1179
+ control: n.control,
1180
+ onChange: o
1181
+ }, null, 8, ["label", "control"])) : n.control.type === "boolean" ? (m(), v(te, {
1134
1182
  key: 2,
1135
- label: i.control.label,
1136
- control: i.control,
1137
- onChange: a
1138
- }, null, 8, ["label", "control"])) : z(s) ? z(s) ? (g(), k(ne, {
1139
- key: 4,
1140
- label: i.control.label,
1141
- control: i.control,
1142
- onChange: a
1143
- }, null, 8, ["label", "control"])) : (g(), k(Ot, {
1144
- key: 5,
1145
- label: i.control.label,
1146
- control: i.control,
1147
- onChange: a
1148
- }, null, 8, ["label", "control"])) : (g(), k(Rt, {
1183
+ label: n.control.label,
1184
+ control: n.control,
1185
+ onChange: o
1186
+ }, null, 8, ["label", "control"])) : n.control.type === "folder" ? (m(), v(Me, {
1149
1187
  key: 3,
1150
- label: i.control.label,
1151
- control: i.control,
1152
- onChange: a
1188
+ label: n.control.label,
1189
+ control: n.control
1190
+ }, null, 8, ["label", "control"])) : z(s) ? z(s) ? (m(), v(he, {
1191
+ key: 5,
1192
+ label: n.control.label,
1193
+ control: n.control,
1194
+ onChange: o
1195
+ }, null, 8, ["label", "control"])) : (m(), v(Wt, {
1196
+ key: 6,
1197
+ label: n.control.label,
1198
+ control: n.control,
1199
+ onChange: o
1200
+ }, null, 8, ["label", "control"])) : (m(), v(Ot, {
1201
+ key: 4,
1202
+ label: n.control.label,
1203
+ control: n.control,
1204
+ onChange: o
1153
1205
  }, null, 8, ["label", "control"]))
1154
- ], 64)) : U("", !0);
1206
+ ], 64)) : G("", !0);
1155
1207
  }
1156
- }), fe = { class: "bg-white shadow-xl rounded border-4 border-solid border-black" }, pe = /* @__PURE__ */ d("i", { class: "h-4 w-4 p-1.5 flex items-center line-height-0 rounded-full bg-gray-100 text-xs" }, "🍰", -1), ze = /* @__PURE__ */ d("div", null, [
1208
+ }), be = { class: "bg-white shadow-xl rounded border-4 border-solid border-black" }, we = /* @__PURE__ */ d("i", { class: "h-4 w-4 p-1.5 flex items-center line-height-0 rounded-full bg-gray-100 text-xs" }, "🍰", -1), ve = /* @__PURE__ */ d("div", null, [
1157
1209
  /* @__PURE__ */ d("i", { class: "i-ic-baseline-drag-indicator" }),
1158
1210
  /* @__PURE__ */ d("i", { class: "i-ic-baseline-drag-indicator" }),
1159
1211
  /* @__PURE__ */ d("i", { class: "i-ic-baseline-drag-indicator" })
1160
- ], -1), Me = /* @__PURE__ */ d("div", null, null, -1), we = [
1161
- pe,
1162
- ze,
1163
- Me
1164
- ], be = { class: "p-4" }, ke = /* @__PURE__ */ C({
1212
+ ], -1), Ce = /* @__PURE__ */ d("div", null, null, -1), Se = [
1213
+ we,
1214
+ ve,
1215
+ Ce
1216
+ ], Ie = /* @__PURE__ */ C({
1165
1217
  __name: "TresLeches",
1166
- setup(i) {
1167
- const { width: t } = ft(), e = 280, s = w(null), n = jt();
1168
- function r(a, h) {
1169
- h.value = a;
1218
+ setup(n) {
1219
+ const { width: t } = Mt(), e = 280, s = w(null), i = Xt();
1220
+ function r(o, h) {
1221
+ h.value = o;
1170
1222
  }
1171
- return (a, h) => (g(), k(z(It), {
1223
+ return (o, h) => (m(), v(z(Dt), {
1172
1224
  "initial-value": { x: z(t) - e - 20, y: 10 },
1173
1225
  class: "fixed select-none z-24 w-280px font-sans text-xs",
1174
1226
  handle: s.value
1175
1227
  }, {
1176
- default: _t(() => [
1177
- d("div", fe, [
1228
+ default: J(() => [
1229
+ d("div", be, [
1178
1230
  d("header", {
1179
1231
  ref_key: "handle",
1180
1232
  ref: s,
1181
1233
  class: "relative cursor-grabbing p-4 flex justify-between text-gray-200 relative"
1182
- }, we, 512),
1183
- d("div", be, [
1184
- (g(!0), b(L, null, B(z(n).controls, (y) => (g(), k(ge, {
1185
- key: y.label,
1186
- control: y,
1187
- onChange: (u) => r(u, y)
1188
- }, null, 8, ["control", "onChange"]))), 128))
1189
- ])
1234
+ }, Se, 512),
1235
+ (m(!0), b(D, null, X(z(i).controls, (y) => (m(), v(rt, {
1236
+ key: y.label,
1237
+ control: y,
1238
+ onChange: (u) => r(u, y)
1239
+ }, null, 8, ["control", "onChange"]))), 128))
1190
1240
  ])
1191
1241
  ]),
1192
1242
  _: 1
@@ -1194,6 +1244,6 @@ const ue = { class: "flex justify-between gap-2 items-center mb-2" }, ye = { cla
1194
1244
  }
1195
1245
  });
1196
1246
  export {
1197
- ke as TresLeches,
1198
- Se as useControls
1247
+ Ie as TresLeches,
1248
+ Ee as useControls
1199
1249
  };