@tomorrowevening/hermes 0.0.11 → 0.0.13

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (64) hide show
  1. package/dist/hermes.js +1541 -1446
  2. package/dist/hermes.umd.cjs +16 -16
  3. package/dist/style.css +1 -1
  4. package/package.json +3 -2
  5. package/src/core/Application.ts +1 -1
  6. package/src/core/RemoteController.ts +4 -151
  7. package/src/core/remote/RemoteComponents.ts +15 -1
  8. package/src/core/remote/RemoteTheatre.ts +114 -3
  9. package/src/core/remote/RemoteThree.ts +57 -2
  10. package/src/core/remote/RemoteTweakpane.ts +28 -2
  11. package/src/core/types.ts +2 -0
  12. package/src/editor/global.ts +3 -0
  13. package/src/editor/multiView/CameraWindow.tsx +20 -7
  14. package/src/editor/multiView/MultiView.scss +2 -0
  15. package/src/editor/multiView/MultiView.tsx +203 -9
  16. package/src/editor/scss/{_sceneHierarchy.scss → _sidePanel.scss} +1 -1
  17. package/src/editor/scss/index.scss +1 -1
  18. package/src/editor/{sceneHierarchy/SceneHierarchy.tsx → sidePanel/SidePanel.tsx} +8 -10
  19. package/src/editor/sidePanel/inspector/Inspector.tsx +111 -0
  20. package/src/editor/sidePanel/inspector/utils/InspectAnimation.tsx +51 -0
  21. package/src/editor/{sceneHierarchy → sidePanel}/types.ts +10 -1
  22. package/src/editor/{sceneHierarchy → sidePanel}/utils.ts +11 -2
  23. package/src/index.ts +6 -6
  24. package/types/core/Application.d.ts +1 -1
  25. package/types/core/RemoteController.d.ts +1 -1
  26. package/types/core/remote/RemoteComponents.d.ts +3 -0
  27. package/types/core/remote/RemoteTheatre.d.ts +3 -0
  28. package/types/core/remote/RemoteThree.d.ts +7 -1
  29. package/types/core/remote/RemoteTweakpane.d.ts +2 -0
  30. package/types/core/types.d.ts +1 -1
  31. package/types/editor/global.d.ts +2 -0
  32. package/types/editor/multiView/CameraWindow.d.ts +2 -0
  33. package/types/editor/multiView/MultiView.d.ts +4 -0
  34. package/types/editor/sidePanel/SidePanel.d.ts +11 -0
  35. package/types/editor/sidePanel/inspector/utils/InspectAnimation.d.ts +3 -0
  36. package/types/editor/{sceneHierarchy → sidePanel}/types.d.ts +7 -1
  37. package/types/index.d.ts +6 -6
  38. package/src/editor/sceneHierarchy/inspector/Inspector.tsx +0 -97
  39. package/types/editor/sceneHierarchy/SceneHierarchy.d.ts +0 -11
  40. /package/src/editor/{sceneHierarchy → sidePanel}/Accordion.tsx +0 -0
  41. /package/src/editor/{sceneHierarchy → sidePanel}/ChildObject.tsx +0 -0
  42. /package/src/editor/{sceneHierarchy → sidePanel}/ContainerObject.tsx +0 -0
  43. /package/src/editor/{sceneHierarchy → sidePanel}/ToggleBtn.tsx +0 -0
  44. /package/src/editor/{sceneHierarchy → sidePanel}/inspector/InspectorField.tsx +0 -0
  45. /package/src/editor/{sceneHierarchy → sidePanel}/inspector/InspectorGroup.tsx +0 -0
  46. /package/src/editor/{sceneHierarchy → sidePanel}/inspector/SceneInspector.tsx +0 -0
  47. /package/src/editor/{sceneHierarchy → sidePanel}/inspector/inspector.scss +0 -0
  48. /package/src/editor/{sceneHierarchy → sidePanel}/inspector/utils/InspectCamera.tsx +0 -0
  49. /package/src/editor/{sceneHierarchy → sidePanel}/inspector/utils/InspectLight.tsx +0 -0
  50. /package/src/editor/{sceneHierarchy → sidePanel}/inspector/utils/InspectMaterial.tsx +0 -0
  51. /package/src/editor/{sceneHierarchy → sidePanel}/inspector/utils/InspectTransform.tsx +0 -0
  52. /package/types/editor/{sceneHierarchy → sidePanel}/Accordion.d.ts +0 -0
  53. /package/types/editor/{sceneHierarchy → sidePanel}/ChildObject.d.ts +0 -0
  54. /package/types/editor/{sceneHierarchy → sidePanel}/ContainerObject.d.ts +0 -0
  55. /package/types/editor/{sceneHierarchy → sidePanel}/ToggleBtn.d.ts +0 -0
  56. /package/types/editor/{sceneHierarchy → sidePanel}/inspector/Inspector.d.ts +0 -0
  57. /package/types/editor/{sceneHierarchy → sidePanel}/inspector/InspectorField.d.ts +0 -0
  58. /package/types/editor/{sceneHierarchy → sidePanel}/inspector/InspectorGroup.d.ts +0 -0
  59. /package/types/editor/{sceneHierarchy → sidePanel}/inspector/SceneInspector.d.ts +0 -0
  60. /package/types/editor/{sceneHierarchy → sidePanel}/inspector/utils/InspectCamera.d.ts +0 -0
  61. /package/types/editor/{sceneHierarchy → sidePanel}/inspector/utils/InspectLight.d.ts +0 -0
  62. /package/types/editor/{sceneHierarchy → sidePanel}/inspector/utils/InspectMaterial.d.ts +0 -0
  63. /package/types/editor/{sceneHierarchy → sidePanel}/inspector/utils/InspectTransform.d.ts +0 -0
  64. /package/types/editor/{sceneHierarchy → sidePanel}/utils.d.ts +0 -0
package/dist/hermes.js CHANGED
@@ -1,74 +1,74 @@
1
- var bn = Object.defineProperty;
2
- var yn = (t, n, a) => n in t ? bn(t, n, { enumerable: !0, configurable: !0, writable: !0, value: a }) : t[n] = a;
3
- var $ = (t, n, a) => (yn(t, typeof n != "symbol" ? n + "" : n, a), a);
4
- import { PositionalAudio as En, EventDispatcher as Zt, Texture as Jt, CubeTexture as xn, RepeatWrapping as Lt, ShaderMaterial as Qt, GLSL3 as wn, DoubleSide as Cn, Color as kt, Mesh as Sn, PlaneGeometry as On, Matrix4 as Tn, Vector3 as L, Euler as Rn, Ray as Mn, Plane as Pn, MathUtils as jn, MOUSE as Ne, TOUCH as Le, Quaternion as Ft, Spherical as Ut, Vector2 as oe, PerspectiveCamera as Tt, MeshDepthMaterial as _n, MeshNormalMaterial as kn, MeshBasicMaterial as Dn, OrthographicCamera as en, Scene as tn, AxesHelper as An, WebGLRenderer as In, CameraHelper as Nn } from "three";
5
- import { getProject as Ln } from "@theatre/core";
6
- import { Pane as Fn } from "tweakpane";
7
- import * as Un from "@tweakpane/plugin-essentials";
8
- import nn, { useState as ne, useRef as ye, useEffect as Be, Component as Bn, forwardRef as $n } from "react";
9
- import { Reorder as an } from "framer-motion";
10
- import Ze from "@theatre/studio";
11
- function Ba(t, n, a) {
12
- return Math.min(n, Math.max(t, a));
1
+ var On = Object.defineProperty;
2
+ var Tn = (t, n, i) => n in t ? On(t, n, { enumerable: !0, configurable: !0, writable: !0, value: i }) : t[n] = i;
3
+ var q = (t, n, i) => (Tn(t, typeof n != "symbol" ? n + "" : n, i), i);
4
+ import { PositionalAudio as Mn, EventDispatcher as rn, Texture as an, CubeTexture as Rn, RepeatWrapping as $t, ShaderMaterial as on, GLSL3 as Pn, DoubleSide as jn, Color as It, Mesh as _n, PlaneGeometry as Dn, Matrix4 as kn, Vector3 as G, Euler as An, Ray as In, Plane as Nn, MathUtils as Ln, MOUSE as ze, TOUCH as Ye, Quaternion as Vt, Spherical as Gt, Vector2 as ue, PerspectiveCamera as _t, MeshDepthMaterial as Fn, MeshNormalMaterial as Un, MeshBasicMaterial as Bn, OrthographicCamera as sn, Scene as cn, Group as $n, AxesHelper as ln, WebGLRenderer as Vn, Raycaster as Gn, CameraHelper as zn } from "three";
5
+ import { getProject as Yn } from "@theatre/core";
6
+ import "@theatre/studio";
7
+ import { Pane as Wn } from "tweakpane";
8
+ import * as Hn from "@tweakpane/plugin-essentials";
9
+ import un, { useState as ae, useRef as we, useEffect as Ne, Component as Kn, forwardRef as Xn } from "react";
10
+ import { Reorder as dn } from "framer-motion";
11
+ function Ki(t, n, i) {
12
+ return Math.min(n, Math.max(t, i));
13
13
  }
14
- function $a(t, n) {
15
- const a = t - n;
16
- return Math.sqrt(a * a);
14
+ function Xi(t, n) {
15
+ const i = t - n;
16
+ return Math.sqrt(i * i);
17
17
  }
18
- function Gn() {
18
+ function Zn() {
19
19
  return Math.round(Math.random() * 1e6).toString();
20
20
  }
21
- function Vn(t) {
21
+ function qn(t) {
22
22
  return t.r !== void 0 && t.g !== void 0 && t.b !== void 0;
23
23
  }
24
- function Yn(t) {
25
- const n = Math.round(t.r * 255), a = Math.round(t.g * 255), e = Math.round(t.b * 255), o = (d) => {
26
- const p = d.toString(16);
27
- return p.length === 1 ? "0" + p : p;
28
- }, u = o(n), c = o(a), s = o(e);
29
- return "#" + u + c + s;
24
+ function Qn(t) {
25
+ const n = Math.round(t.r * 255), i = Math.round(t.g * 255), e = Math.round(t.b * 255), a = (d) => {
26
+ const m = d.toString(16);
27
+ return m.length === 1 ? "0" + m : m;
28
+ }, s = a(n), h = a(i), l = a(e);
29
+ return "#" + s + h + l;
30
30
  }
31
- function Ct(t, n = 1) {
31
+ function Mt(t, n = 1) {
32
32
  return Number(t.toFixed(n));
33
33
  }
34
- let Rt = 0;
35
- const zn = () => {
36
- Rt = 0;
37
- }, rn = (t) => {
34
+ let Dt = 0;
35
+ const Jn = () => {
36
+ Dt = 0;
37
+ }, fn = (t) => {
38
38
  if (!t)
39
39
  return;
40
40
  let n = t.name.replace(" ", "");
41
- n.length === 0 && (n = `obj_${Rt}`, Rt++), t.parent !== null && (n = `${t.parent.uuid}.${n}`), t.uuid = n, t.children.forEach((a) => {
42
- rn(a);
41
+ n.length === 0 && (n = `obj_${Dt}`, Dt++), t.parent !== null && (n = `${t.parent.uuid}.${n}`), t.uuid = n, t.children.forEach((i) => {
42
+ fn(i);
43
43
  });
44
- }, Ga = (t) => {
44
+ }, Zi = (t) => {
45
45
  t == null || t.dispose();
46
- }, Wn = (t) => {
46
+ }, ei = (t) => {
47
47
  t && (Array.isArray(t) ? t.forEach((n) => n.dispose()) : t.dispose());
48
- }, on = (t) => {
48
+ }, hn = (t) => {
49
49
  var n;
50
50
  if (t) {
51
51
  for (; t.children.length > 0; ) {
52
- const a = t.children[0];
53
- a instanceof En ? (a.pause(), a.parent && a.parent.remove(a)) : on(a);
52
+ const i = t.children[0];
53
+ i instanceof Mn ? (i.pause(), i.parent && i.parent.remove(i)) : hn(i);
54
54
  }
55
55
  if (t.parent && t.parent.remove(t), t.isMesh) {
56
- const a = t;
57
- (n = a.geometry) == null || n.dispose(), Wn(a.material);
56
+ const i = t;
57
+ (n = i.geometry) == null || n.dispose(), ei(i.material);
58
58
  }
59
59
  t.dispose !== void 0 && t.dispose();
60
60
  }
61
61
  };
62
- class Va {
63
- constructor(n, a, e) {
64
- $(this, "channel");
65
- $(this, "components", /* @__PURE__ */ new Map());
62
+ class qi {
63
+ constructor(n, i, e = "editor") {
64
+ q(this, "channel");
65
+ q(this, "components", /* @__PURE__ */ new Map());
66
66
  // Protected
67
- $(this, "_mode", "app");
68
- this.editor = a && document.location.hash.search(e) > -1, a && (this.channel = new BroadcastChannel(n));
67
+ q(this, "_mode", "app");
68
+ this.editor = i && document.location.hash.search(e) > -1, i && (this.channel = new BroadcastChannel(n));
69
69
  }
70
- addComponent(n, a) {
71
- this.components.set(n, a);
70
+ addComponent(n, i) {
71
+ this.components.set(n, i);
72
72
  }
73
73
  dispose() {
74
74
  this.components.forEach((n) => {
@@ -80,8 +80,8 @@ class Va {
80
80
  this.channel !== void 0 && this._mode !== n.target && this.channel.postMessage(n);
81
81
  }
82
82
  listen(n) {
83
- this.channel !== void 0 && (this.channel.onmessage = (a) => {
84
- n(a.data);
83
+ this.channel !== void 0 && (this.channel.onmessage = (i) => {
84
+ n(i.data);
85
85
  });
86
86
  }
87
87
  // Getters / Setters
@@ -95,7 +95,7 @@ class Va {
95
95
  n && (this._mode = "editor", document.title += " - Editor");
96
96
  }
97
97
  }
98
- const I = new Zt(), N = {
98
+ const z = new rn(), Y = {
99
99
  CUSTOM: "ToolEvents::custom",
100
100
  // Components
101
101
  SELECT_DROPDOWN: "ToolEvents::selectDropdown",
@@ -106,80 +106,83 @@ const I = new Zt(), N = {
106
106
  SET_OBJECT: "ToolEvents::setObject",
107
107
  UPDATE_OBJECT: "ToolEvents::updateObject",
108
108
  CREATE_TEXTURE: "ToolEvents::createTexture",
109
- REQUEST_METHOD: "ToolEvents::requestMethod"
109
+ REQUEST_METHOD: "ToolEvents::requestMethod",
110
+ // MultiView
111
+ ADD_CAMERA: "ToolEvents::addCamera",
112
+ REMOVE_CAMERA: "ToolEvents::removeCamera"
110
113
  };
111
- class gt {
114
+ class Et {
112
115
  constructor(n) {
113
- $(this, "app");
116
+ q(this, "app");
114
117
  this.app = n;
115
118
  }
116
119
  dispose() {
117
120
  }
118
121
  }
119
- class Ya extends gt {
120
- selectDropdown(n, a) {
122
+ class Qi extends Et {
123
+ selectDropdown(n, i) {
121
124
  this.app.send({
122
125
  event: "selectComponent",
123
126
  target: "app",
124
127
  data: {
125
128
  dropdown: n,
126
- value: a
129
+ value: i
127
130
  }
128
131
  });
129
132
  }
130
- updateDropdown(n, a) {
133
+ updateDropdown(n, i) {
131
134
  this.app.send({
132
135
  event: "draggableListUpdate",
133
136
  target: "app",
134
137
  data: {
135
138
  dropdown: n,
136
- value: a
139
+ value: i
137
140
  }
138
141
  });
139
142
  }
140
143
  }
141
- const sn = () => {
144
+ const pn = () => {
142
145
  };
143
- class za extends gt {
144
- constructor(a, e, o) {
145
- super(a);
146
- $(this, "project");
147
- $(this, "sheets");
148
- $(this, "sheetObjects");
149
- $(this, "sheetObjectCBs");
150
- $(this, "sheetObjectUnsubscribe");
151
- this.project = Ln(e, o), this.sheets = /* @__PURE__ */ new Map(), this.sheetObjects = /* @__PURE__ */ new Map(), this.sheetObjectCBs = /* @__PURE__ */ new Map(), this.sheetObjectUnsubscribe = /* @__PURE__ */ new Map();
146
+ class Ji extends Et {
147
+ constructor(i, e, a) {
148
+ super(i);
149
+ q(this, "project");
150
+ q(this, "sheets");
151
+ q(this, "sheetObjects");
152
+ q(this, "sheetObjectCBs");
153
+ q(this, "sheetObjectUnsubscribe");
154
+ this.project = Yn(e, a), this.sheets = /* @__PURE__ */ new Map(), this.sheetObjects = /* @__PURE__ */ new Map(), this.sheetObjectCBs = /* @__PURE__ */ new Map(), this.sheetObjectUnsubscribe = /* @__PURE__ */ new Map();
152
155
  }
153
156
  dispose() {
154
157
  this.project = void 0, this.sheets = /* @__PURE__ */ new Map(), this.sheetObjects = /* @__PURE__ */ new Map(), this.sheetObjectCBs = /* @__PURE__ */ new Map(), this.sheetObjectUnsubscribe = /* @__PURE__ */ new Map();
155
158
  }
156
- sheet(a) {
157
- var o;
159
+ sheet(i) {
160
+ var a;
158
161
  if (this.project === void 0) {
159
162
  console.error("Theatre Project hasn't been created yet.");
160
163
  return;
161
164
  }
162
- let e = this.sheets.get(a);
163
- return e !== void 0 || (e = (o = this.project) == null ? void 0 : o.sheet(a), this.sheets.set(a, e)), e;
165
+ let e = this.sheets.get(i);
166
+ return e !== void 0 || (e = (a = this.project) == null ? void 0 : a.sheet(i), this.sheets.set(i, e)), e;
164
167
  }
165
- sheetObject(a, e, o, u) {
168
+ sheetObject(i, e, a, s) {
166
169
  if (this.project === void 0) {
167
170
  console.error("Theatre Project hasn't been created yet.");
168
171
  return;
169
172
  }
170
- const c = this.sheets.get(a);
171
- if (c === void 0)
173
+ const h = this.sheets.get(i);
174
+ if (h === void 0)
172
175
  return;
173
- const s = `${a}_${e}`;
174
- let d = this.sheetObjects.get(s);
176
+ const l = `${i}_${e}`;
177
+ let d = this.sheetObjects.get(l);
175
178
  if (d !== void 0)
176
- return d = c.object(e, { ...o, ...d.value }, { reconfigure: !0 }), d;
177
- d = c.object(e, o), this.sheetObjects.set(s, d), this.sheetObjectCBs.set(s, u !== void 0 ? u : sn);
178
- const p = d.onValuesChange((h) => {
179
+ return d = h.object(e, { ...a, ...d.value }, { reconfigure: !0 }), d;
180
+ d = h.object(e, a), this.sheetObjects.set(l, d), this.sheetObjectCBs.set(l, s !== void 0 ? s : pn);
181
+ const m = d.onValuesChange((v) => {
179
182
  if (this.app.editor) {
180
- for (const b in h) {
181
- const x = h[b];
182
- typeof x == "object" && Vn(x) && (h[b] = {
183
+ for (const E in v) {
184
+ const x = v[E];
185
+ typeof x == "object" && qn(x) && (v[E] = {
183
186
  r: x.r,
184
187
  g: x.g,
185
188
  b: x.b,
@@ -190,27 +193,27 @@ class za extends gt {
190
193
  event: "updateSheetObject",
191
194
  target: "app",
192
195
  data: {
193
- sheetObject: s,
194
- values: h
196
+ sheetObject: l,
197
+ values: v
195
198
  }
196
199
  });
197
200
  } else {
198
- const b = this.sheetObjectCBs.get(s);
199
- b !== void 0 && b(h);
201
+ const E = this.sheetObjectCBs.get(l);
202
+ E !== void 0 && E(v);
200
203
  }
201
204
  });
202
- return this.sheetObjectUnsubscribe.set(s, p), d;
205
+ return this.sheetObjectUnsubscribe.set(l, m), d;
203
206
  }
204
- unsubscribe(a) {
207
+ unsubscribe(i) {
205
208
  if (this.project === void 0) {
206
209
  console.error("Theatre Project hasn't been created yet.");
207
210
  return;
208
211
  }
209
- const e = `${a.address.sheetId}_${a.address.objectKey}`, o = this.sheetObjectUnsubscribe.get(e);
210
- o !== void 0 && o();
212
+ const e = `${i.address.sheetId}_${i.address.objectKey}`, a = this.sheetObjectUnsubscribe.get(e);
213
+ a !== void 0 && a();
211
214
  }
212
215
  }
213
- function Hn(t) {
216
+ function ti(t) {
214
217
  if (t.name === "cameras")
215
218
  return "camera";
216
219
  if (t.name === "interactive")
@@ -224,26 +227,26 @@ function Hn(t) {
224
227
  const n = t.type;
225
228
  return n.search("Helper") > -1 ? "icon_utils" : n.search("Camera") > -1 ? "camera" : n.search("Light") > -1 ? "light" : "obj3D";
226
229
  }
227
- function cn(t) {
230
+ function mn(t) {
228
231
  const n = {
229
232
  name: t.name,
230
233
  type: t.type,
231
234
  uuid: t.uuid,
232
235
  children: []
233
236
  };
234
- return t.children.forEach((a) => {
235
- n.children.push(cn(a));
237
+ return t.children.forEach((i) => {
238
+ n.children.push(mn(i));
236
239
  }), n;
237
240
  }
238
- function Kn(t) {
241
+ function ni(t) {
239
242
  const n = {};
240
- for (const a in t) {
241
- const e = t[a].value;
242
- n[a] = { value: e }, e === null ? n[a].value = { src: "" } : e.isTexture && (n[a].value = { src: e.image.src });
243
+ for (const i in t) {
244
+ const e = t[i].value;
245
+ n[i] = { value: e }, e === null ? n[i].value = { src: "" } : e.isTexture && (n[i].value = { src: e.image.src });
243
246
  }
244
247
  return n;
245
248
  }
246
- function Xn(t) {
249
+ function ii(t) {
247
250
  switch (t) {
248
251
  case "blendSrcAlpha":
249
252
  case "blendDstAlpha":
@@ -255,36 +258,36 @@ function Xn(t) {
255
258
  }
256
259
  return !1;
257
260
  }
258
- function Bt(t) {
261
+ function zt(t) {
259
262
  const n = {};
260
- for (const a in t) {
261
- if (a.substring(0, 1) === "_" || a.substring(0, 2) === "is" || Xn(a))
263
+ for (const i in t) {
264
+ if (i.substring(0, 1) === "_" || i.substring(0, 2) === "is" || ii(i))
262
265
  continue;
263
- const e = typeof t[a], o = t[a];
266
+ const e = typeof t[i], a = t[i];
264
267
  switch (e) {
265
268
  case "boolean":
266
269
  case "number":
267
270
  case "string":
268
- n[a] = o;
271
+ n[i] = a;
269
272
  break;
270
273
  case "object":
271
- if (o !== null)
272
- if (n[a] = o, o.isTexture)
273
- if (o instanceof Jt) {
274
- const u = o.source.toJSON();
275
- n[a] = { src: u.url };
274
+ if (a !== null)
275
+ if (n[i] = a, a.isTexture)
276
+ if (a instanceof an) {
277
+ const s = a.source.toJSON();
278
+ n[i] = { src: s.url };
276
279
  } else
277
- o instanceof xn && (console.log("env map"), console.log(o.source.data), console.log(o.source.toJSON()), n[a] = { src: "" });
280
+ a instanceof Rn && (console.log("env map"), console.log(a.source.data), console.log(a.source.toJSON()), n[i] = { src: "" });
278
281
  else
279
- a === "uniforms" && (n[a] = Kn(n[a]));
282
+ i === "uniforms" && (n[i] = ni(n[i]));
280
283
  else
281
- n[a] = { src: "" };
284
+ n[i] = { src: "" };
282
285
  break;
283
286
  }
284
287
  }
285
288
  return n;
286
289
  }
287
- function qn(t) {
290
+ function Rt(t) {
288
291
  t.updateMatrix();
289
292
  const n = {
290
293
  name: t.name,
@@ -292,22 +295,31 @@ function qn(t) {
292
295
  uuid: t.uuid,
293
296
  visible: t.visible,
294
297
  matrix: t.matrix.elements,
298
+ animations: [],
295
299
  material: void 0,
296
300
  perspectiveCameraInfo: void 0,
297
301
  orthographicCameraInfo: void 0,
298
302
  lightInfo: void 0
299
- }, a = t.type.toLowerCase();
300
- if (a.search("mesh") > -1) {
303
+ };
304
+ t.animations.forEach((e) => {
305
+ n.animations.push({
306
+ name: e.name,
307
+ duration: e.duration,
308
+ blendMode: e.blendMode
309
+ });
310
+ });
311
+ const i = t.type.toLowerCase();
312
+ if (i.search("mesh") > -1) {
301
313
  const e = t;
302
314
  if (Array.isArray(e.material)) {
303
- const o = [];
304
- e.material.forEach((u) => {
305
- o.push(Bt(u));
306
- }), n.material = o;
315
+ const a = [];
316
+ e.material.forEach((s) => {
317
+ a.push(zt(s));
318
+ }), n.material = a;
307
319
  } else
308
- n.material = Bt(e.material);
320
+ n.material = zt(e.material);
309
321
  } else
310
- a.search("camera") > -1 ? t.type === "PerspectiveCamera" ? n.perspectiveCameraInfo = {
322
+ i.search("camera") > -1 ? t.type === "PerspectiveCamera" ? n.perspectiveCameraInfo = {
311
323
  fov: t.fov,
312
324
  zoom: t.zoom,
313
325
  near: t.near,
@@ -324,7 +336,7 @@ function qn(t) {
324
336
  right: t.right,
325
337
  top: t.top,
326
338
  bottom: t.bottom
327
- }) : a.search("light") > -1 && (n.lightInfo = {
339
+ }) : i.search("light") > -1 && (n.lightInfo = {
328
340
  color: t.color,
329
341
  intensity: t.intensity,
330
342
  decay: t.decay,
@@ -335,131 +347,147 @@ function qn(t) {
335
347
  });
336
348
  return n;
337
349
  }
338
- function q(t, n, a) {
350
+ function J(t, n, i) {
339
351
  const e = n.split(".");
340
352
  switch (e.length) {
341
353
  case 1:
342
- t[e[0]] = a;
354
+ t[e[0]] = i;
343
355
  break;
344
356
  case 2:
345
- t[e[0]][e[1]] = a;
357
+ t[e[0]][e[1]] = i;
346
358
  break;
347
359
  case 3:
348
- t[e[0]][e[1]][e[2]] = a;
360
+ t[e[0]][e[1]][e[2]] = i;
349
361
  break;
350
362
  case 4:
351
- t[e[0]][e[1]][e[2]][e[3]] = a;
363
+ t[e[0]][e[1]][e[2]][e[3]] = i;
352
364
  break;
353
365
  case 5:
354
- t[e[0]][e[1]][e[2]][e[3]][e[4]] = a;
366
+ t[e[0]][e[1]][e[2]][e[3]][e[4]] = i;
355
367
  break;
356
368
  }
357
369
  }
358
- function Mt(t) {
359
- return new Promise((n, a) => {
370
+ function kt(t) {
371
+ return new Promise((n, i) => {
360
372
  const e = new Image();
361
373
  e.onload = () => {
362
- const o = new Jt(e);
363
- o.wrapS = Lt, o.wrapT = Lt, o.needsUpdate = !0, n(o);
364
- }, e.onerror = a, e.src = t;
374
+ const a = new an(e);
375
+ a.wrapS = $t, a.wrapT = $t, a.needsUpdate = !0, n(a);
376
+ }, e.onerror = i, e.src = t;
365
377
  });
366
378
  }
367
- class Wa extends gt {
379
+ class er extends Et {
368
380
  constructor() {
369
381
  super(...arguments);
370
- $(this, "scene");
382
+ q(this, "scene");
371
383
  }
372
- getObject(a) {
384
+ getObject(i) {
373
385
  this.app.send({
374
386
  event: "getObject",
375
387
  target: "app",
376
- data: a
388
+ data: i
377
389
  });
378
390
  }
379
- setObject(a) {
380
- const e = qn(a);
391
+ setObject(i) {
392
+ const e = Rt(i);
381
393
  this.app.send({
382
394
  event: "setObject",
383
395
  target: "editor",
384
396
  data: e
385
397
  });
386
398
  }
387
- requestMethod(a, e, o) {
399
+ requestMethod(i, e, a) {
388
400
  this.app.send({
389
401
  event: "requestMethod",
390
402
  target: "app",
391
403
  data: {
392
- uuid: a,
404
+ uuid: i,
393
405
  key: e,
394
- value: o
406
+ value: a
395
407
  }
396
408
  });
397
409
  }
398
- updateObject(a, e, o) {
410
+ updateObject(i, e, a) {
399
411
  this.app.send({
400
412
  event: "updateObject",
401
413
  target: "app",
402
414
  data: {
403
- uuid: a,
415
+ uuid: i,
404
416
  key: e,
405
- value: o
417
+ value: a
406
418
  }
407
419
  });
408
420
  }
409
- createTexture(a, e, o) {
421
+ createTexture(i, e, a) {
410
422
  this.app.send({
411
423
  event: "createTexture",
412
424
  target: "app",
413
425
  data: {
414
- uuid: a,
426
+ uuid: i,
415
427
  key: e,
416
- value: o
428
+ value: a
417
429
  }
418
430
  });
419
431
  }
420
- setScene(a) {
421
- if (a === void 0)
432
+ setScene(i) {
433
+ if (i === void 0)
422
434
  return;
423
- this.scene = a, zn(), rn(this.scene);
424
- const e = cn(this.scene);
435
+ this.scene = i, Jn(), fn(this.scene);
436
+ const e = mn(this.scene);
425
437
  this.app.send({
426
438
  event: "setScene",
427
439
  target: "editor",
428
440
  data: e
429
441
  });
430
442
  }
443
+ addCamera(i) {
444
+ const e = Rt(i);
445
+ this.app.send({
446
+ event: "addCamera",
447
+ target: "editor",
448
+ data: e
449
+ });
450
+ }
451
+ removeCamera(i) {
452
+ const e = Rt(i);
453
+ this.app.send({
454
+ event: "removeCamera",
455
+ target: "editor",
456
+ data: e
457
+ });
458
+ }
431
459
  }
432
- class Ha extends gt {
433
- constructor(a) {
434
- super(a);
435
- $(this, "bindCBs");
436
- $(this, "buttonCBs");
437
- $(this, "pane");
438
- $(this, "appCallbacks", 0);
439
- $(this, "editorCallbacks", 0);
440
- $(this, "inspectorFolder");
441
- this.bindCBs = /* @__PURE__ */ new Map(), this.buttonCBs = /* @__PURE__ */ new Map(), a.editor && this.createGUI();
460
+ class tr extends Et {
461
+ constructor(i) {
462
+ super(i);
463
+ q(this, "bindCBs");
464
+ q(this, "buttonCBs");
465
+ q(this, "pane");
466
+ q(this, "appCallbacks", 0);
467
+ q(this, "editorCallbacks", 0);
468
+ q(this, "inspectorFolder");
469
+ this.bindCBs = /* @__PURE__ */ new Map(), this.buttonCBs = /* @__PURE__ */ new Map(), i.editor && this.createGUI();
442
470
  }
443
471
  createGUI() {
444
- this.pane = new Fn({ title: "GUI" }), this.pane.registerPlugin(Un);
472
+ this.pane = new Wn({ title: "GUI" }), this.pane.registerPlugin(Hn);
445
473
  }
446
474
  dispose() {
447
- var a;
448
- this.bindCBs.clear(), this.buttonCBs.clear(), this.appCallbacks = 0, this.editorCallbacks = 0, this.app.editor && ((a = this.pane) == null || a.dispose(), this.pane = void 0);
475
+ var i;
476
+ this.bindCBs.clear(), this.buttonCBs.clear(), this.appCallbacks = 0, this.editorCallbacks = 0, this.app.editor && ((i = this.pane) == null || i.dispose(), this.pane = void 0);
449
477
  }
450
- addFolder(a, e = void 0, o = void 0) {
478
+ addFolder(i, e = void 0, a = void 0) {
451
479
  if (this.app.editor)
452
- return this.pane === void 0 && this.createGUI(), (o !== void 0 ? o : this.pane).addFolder({
453
- title: a,
480
+ return this.pane === void 0 && this.createGUI(), (a !== void 0 ? a : this.pane).addFolder({
481
+ title: i,
454
482
  ...e
455
483
  });
456
484
  this.app.send({
457
485
  event: "addFolder",
458
486
  target: "app",
459
487
  data: {
460
- name: a,
488
+ name: i,
461
489
  params: e,
462
- parent: o
490
+ parent: a
463
491
  }
464
492
  });
465
493
  }
@@ -467,56 +495,56 @@ class Ha extends gt {
467
495
  return `debug_${Math.max(this.appCallbacks, this.editorCallbacks)}`;
468
496
  }
469
497
  // Binding
470
- bind(a, e, o, u = void 0) {
471
- const c = this.bindID, s = o.onChange !== void 0 ? o.onChange : sn;
472
- this.bindCBs.set(c, s), this.app.editor ? (this.pane === void 0 && this.createGUI(), (u !== void 0 ? u : this.pane).addBinding(a, e, o).on("change", (p) => {
498
+ bind(i, e, a, s = void 0) {
499
+ const h = this.bindID, l = a.onChange !== void 0 ? a.onChange : pn;
500
+ this.bindCBs.set(h, l), this.app.editor ? (this.pane === void 0 && this.createGUI(), (s !== void 0 ? s : this.pane).addBinding(i, e, a).on("change", (m) => {
473
501
  this.app.send({
474
502
  event: "updateBind",
475
503
  target: "app",
476
504
  data: {
477
- id: c,
478
- value: p.value
505
+ id: h,
506
+ value: m.value
479
507
  }
480
508
  });
481
509
  }), this.editorCallbacks++) : (this.app.send({
482
510
  event: "bindObject",
483
511
  target: "app",
484
512
  data: {
485
- id: c,
513
+ id: h,
486
514
  name: e,
487
- params: o,
488
- parent: u
515
+ params: a,
516
+ parent: s
489
517
  }
490
518
  }), this.appCallbacks++);
491
519
  }
492
- triggerBind(a, e) {
493
- const o = this.bindCBs.get(a);
494
- o !== void 0 ? o(e) : console.warn(`No callback for: ${a}`, e);
520
+ triggerBind(i, e) {
521
+ const a = this.bindCBs.get(i);
522
+ a !== void 0 ? a(e) : console.warn(`No callback for: ${i}`, e);
495
523
  }
496
524
  // Buttons
497
- button(a, e, o = void 0) {
498
- const u = this.bindID;
499
- this.buttonCBs.set(u, e), this.app.editor ? (this.pane === void 0 && this.createGUI(), (o !== void 0 ? o : this.pane).addButton({ title: a }).on("click", () => {
525
+ button(i, e, a = void 0) {
526
+ const s = this.bindID;
527
+ this.buttonCBs.set(s, e), this.app.editor ? (this.pane === void 0 && this.createGUI(), (a !== void 0 ? a : this.pane).addButton({ title: i }).on("click", () => {
500
528
  this.app.send({
501
529
  event: "clickButton",
502
530
  target: "app",
503
531
  data: {
504
- id: u
532
+ id: s
505
533
  }
506
534
  });
507
535
  }), this.editorCallbacks++) : (this.app.send({
508
536
  event: "addButton",
509
537
  target: "app",
510
538
  data: {
511
- id: u,
512
- name: a,
539
+ id: s,
540
+ name: i,
513
541
  callback: e,
514
- parent: o
542
+ parent: a
515
543
  }
516
544
  }), this.appCallbacks++);
517
545
  }
518
- triggerButton(a) {
519
- const e = this.buttonCBs.get(a);
546
+ triggerButton(i) {
547
+ const e = this.buttonCBs.get(i);
520
548
  e !== void 0 && e();
521
549
  }
522
550
  // Inspector
@@ -524,12 +552,12 @@ class Ha extends gt {
524
552
  this.inspectorFolder = this.addFolder("Inspector", this.pane);
525
553
  }
526
554
  clearInspector() {
527
- const a = this.inspectorFolder.children.length - 1;
528
- for (let e = a; e > -1; --e)
555
+ const i = this.inspectorFolder.children.length - 1;
556
+ for (let e = i; e > -1; --e)
529
557
  this.inspectorFolder.remove(this.inspectorFolder.children[e]);
530
558
  }
531
559
  }
532
- var Pt = { exports: {} }, Je = {};
560
+ var At = { exports: {} }, et = {};
533
561
  /**
534
562
  * @license React
535
563
  * react-jsx-runtime.production.min.js
@@ -539,25 +567,25 @@ var Pt = { exports: {} }, Je = {};
539
567
  * This source code is licensed under the MIT license found in the
540
568
  * LICENSE file in the root directory of this source tree.
541
569
  */
542
- var $t;
543
- function Zn() {
544
- if ($t)
545
- return Je;
546
- $t = 1;
547
- var t = nn, n = Symbol.for("react.element"), a = Symbol.for("react.fragment"), e = Object.prototype.hasOwnProperty, o = t.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.ReactCurrentOwner, u = { key: !0, ref: !0, __self: !0, __source: !0 };
548
- function c(s, d, p) {
549
- var h, b = {}, x = null, S = null;
550
- p !== void 0 && (x = "" + p), d.key !== void 0 && (x = "" + d.key), d.ref !== void 0 && (S = d.ref);
551
- for (h in d)
552
- e.call(d, h) && !u.hasOwnProperty(h) && (b[h] = d[h]);
553
- if (s && s.defaultProps)
554
- for (h in d = s.defaultProps, d)
555
- b[h] === void 0 && (b[h] = d[h]);
556
- return { $$typeof: n, type: s, key: x, ref: S, props: b, _owner: o.current };
570
+ var Yt;
571
+ function ri() {
572
+ if (Yt)
573
+ return et;
574
+ Yt = 1;
575
+ var t = un, n = Symbol.for("react.element"), i = Symbol.for("react.fragment"), e = Object.prototype.hasOwnProperty, a = t.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.ReactCurrentOwner, s = { key: !0, ref: !0, __self: !0, __source: !0 };
576
+ function h(l, d, m) {
577
+ var v, E = {}, x = null, R = null;
578
+ m !== void 0 && (x = "" + m), d.key !== void 0 && (x = "" + d.key), d.ref !== void 0 && (R = d.ref);
579
+ for (v in d)
580
+ e.call(d, v) && !s.hasOwnProperty(v) && (E[v] = d[v]);
581
+ if (l && l.defaultProps)
582
+ for (v in d = l.defaultProps, d)
583
+ E[v] === void 0 && (E[v] = d[v]);
584
+ return { $$typeof: n, type: l, key: x, ref: R, props: E, _owner: a.current };
557
585
  }
558
- return Je.Fragment = a, Je.jsx = c, Je.jsxs = c, Je;
586
+ return et.Fragment = i, et.jsx = h, et.jsxs = h, et;
559
587
  }
560
- var Qe = {};
588
+ var tt = {};
561
589
  /**
562
590
  * @license React
563
591
  * react-jsx-runtime.development.js
@@ -567,91 +595,91 @@ var Qe = {};
567
595
  * This source code is licensed under the MIT license found in the
568
596
  * LICENSE file in the root directory of this source tree.
569
597
  */
570
- var Gt;
571
- function Jn() {
572
- return Gt || (Gt = 1, process.env.NODE_ENV !== "production" && function() {
573
- var t = nn, n = Symbol.for("react.element"), a = Symbol.for("react.portal"), e = Symbol.for("react.fragment"), o = Symbol.for("react.strict_mode"), u = Symbol.for("react.profiler"), c = Symbol.for("react.provider"), s = Symbol.for("react.context"), d = Symbol.for("react.forward_ref"), p = Symbol.for("react.suspense"), h = Symbol.for("react.suspense_list"), b = Symbol.for("react.memo"), x = Symbol.for("react.lazy"), S = Symbol.for("react.offscreen"), O = Symbol.iterator, m = "@@iterator";
574
- function v(r) {
598
+ var Wt;
599
+ function ai() {
600
+ return Wt || (Wt = 1, process.env.NODE_ENV !== "production" && function() {
601
+ var t = un, n = Symbol.for("react.element"), i = Symbol.for("react.portal"), e = Symbol.for("react.fragment"), a = Symbol.for("react.strict_mode"), s = Symbol.for("react.profiler"), h = Symbol.for("react.provider"), l = Symbol.for("react.context"), d = Symbol.for("react.forward_ref"), m = Symbol.for("react.suspense"), v = Symbol.for("react.suspense_list"), E = Symbol.for("react.memo"), x = Symbol.for("react.lazy"), R = Symbol.for("react.offscreen"), T = Symbol.iterator, B = "@@iterator";
602
+ function oe(r) {
575
603
  if (r === null || typeof r != "object")
576
604
  return null;
577
- var f = O && r[O] || r[m];
605
+ var f = T && r[T] || r[B];
578
606
  return typeof f == "function" ? f : null;
579
607
  }
580
- var y = t.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED;
581
- function w(r) {
608
+ var H = t.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED;
609
+ function C(r) {
582
610
  {
583
- for (var f = arguments.length, g = new Array(f > 1 ? f - 1 : 0), C = 1; C < f; C++)
584
- g[C - 1] = arguments[C];
585
- F("error", r, g);
611
+ for (var f = arguments.length, g = new Array(f > 1 ? f - 1 : 0), w = 1; w < f; w++)
612
+ g[w - 1] = arguments[w];
613
+ K("error", r, g);
586
614
  }
587
615
  }
588
- function F(r, f, g) {
616
+ function K(r, f, g) {
589
617
  {
590
- var C = y.ReactDebugCurrentFrame, M = C.getStackAddendum();
591
- M !== "" && (f += "%s", g = g.concat([M]));
592
- var k = g.map(function(R) {
593
- return String(R);
618
+ var w = H.ReactDebugCurrentFrame, j = w.getStackAddendum();
619
+ j !== "" && (f += "%s", g = g.concat([j]));
620
+ var I = g.map(function(P) {
621
+ return String(P);
594
622
  });
595
- k.unshift("Warning: " + f), Function.prototype.apply.call(console[r], console, k);
623
+ I.unshift("Warning: " + f), Function.prototype.apply.call(console[r], console, I);
596
624
  }
597
625
  }
598
- var V = !1, Z = !1, se = !1, Y = !1, fe = !1, j;
599
- j = Symbol.for("react.module.reference");
600
- function D(r) {
601
- return !!(typeof r == "string" || typeof r == "function" || r === e || r === u || fe || r === o || r === p || r === h || Y || r === S || V || Z || se || typeof r == "object" && r !== null && (r.$$typeof === x || r.$$typeof === b || r.$$typeof === c || r.$$typeof === s || r.$$typeof === d || // This needs to include all possible module reference object
626
+ var de = !1, ce = !1, ee = !1, u = !1, p = !1, b;
627
+ b = Symbol.for("react.module.reference");
628
+ function S(r) {
629
+ return !!(typeof r == "string" || typeof r == "function" || r === e || r === s || p || r === a || r === m || r === v || u || r === R || de || ce || ee || typeof r == "object" && r !== null && (r.$$typeof === x || r.$$typeof === E || r.$$typeof === h || r.$$typeof === l || r.$$typeof === d || // This needs to include all possible module reference object
602
630
  // types supported by any Flight configuration anywhere since
603
631
  // we don't know which Flight build this will end up being used
604
632
  // with.
605
- r.$$typeof === j || r.getModuleId !== void 0));
633
+ r.$$typeof === b || r.getModuleId !== void 0));
606
634
  }
607
- function z(r, f, g) {
608
- var C = r.displayName;
609
- if (C)
610
- return C;
611
- var M = f.displayName || f.name || "";
612
- return M !== "" ? g + "(" + M + ")" : g;
635
+ function F(r, f, g) {
636
+ var w = r.displayName;
637
+ if (w)
638
+ return w;
639
+ var j = f.displayName || f.name || "";
640
+ return j !== "" ? g + "(" + j + ")" : g;
613
641
  }
614
- function ce(r) {
642
+ function U(r) {
615
643
  return r.displayName || "Context";
616
644
  }
617
- function ae(r) {
645
+ function N(r) {
618
646
  if (r == null)
619
647
  return null;
620
- if (typeof r.tag == "number" && w("Received an unexpected object in getComponentNameFromType(). This is likely a bug in React. Please file an issue."), typeof r == "function")
648
+ if (typeof r.tag == "number" && C("Received an unexpected object in getComponentNameFromType(). This is likely a bug in React. Please file an issue."), typeof r == "function")
621
649
  return r.displayName || r.name || null;
622
650
  if (typeof r == "string")
623
651
  return r;
624
652
  switch (r) {
625
653
  case e:
626
654
  return "Fragment";
627
- case a:
655
+ case i:
628
656
  return "Portal";
629
- case u:
657
+ case s:
630
658
  return "Profiler";
631
- case o:
659
+ case a:
632
660
  return "StrictMode";
633
- case p:
661
+ case m:
634
662
  return "Suspense";
635
- case h:
663
+ case v:
636
664
  return "SuspenseList";
637
665
  }
638
666
  if (typeof r == "object")
639
667
  switch (r.$$typeof) {
640
- case s:
668
+ case l:
641
669
  var f = r;
642
- return ce(f) + ".Consumer";
643
- case c:
670
+ return U(f) + ".Consumer";
671
+ case h:
644
672
  var g = r;
645
- return ce(g._context) + ".Provider";
673
+ return U(g._context) + ".Provider";
646
674
  case d:
647
- return z(r, r.render, "ForwardRef");
648
- case b:
649
- var C = r.displayName || null;
650
- return C !== null ? C : ae(r.type) || "Memo";
675
+ return F(r, r.render, "ForwardRef");
676
+ case E:
677
+ var w = r.displayName || null;
678
+ return w !== null ? w : N(r.type) || "Memo";
651
679
  case x: {
652
- var M = r, k = M._payload, R = M._init;
680
+ var j = r, I = j._payload, P = j._init;
653
681
  try {
654
- return ae(R(k));
682
+ return N(P(I));
655
683
  } catch {
656
684
  return null;
657
685
  }
@@ -659,14 +687,14 @@ function Jn() {
659
687
  }
660
688
  return null;
661
689
  }
662
- var le = Object.assign, re = 0, Me, Ge, Pe, je, Ve, nt, Ye;
690
+ var D = Object.assign, L = 0, Q, M, k, X, pe, Te, He;
663
691
  function at() {
664
692
  }
665
693
  at.__reactDisabledLog = !0;
666
- function bt() {
694
+ function wt() {
667
695
  {
668
- if (re === 0) {
669
- Me = console.log, Ge = console.info, Pe = console.warn, je = console.error, Ve = console.group, nt = console.groupCollapsed, Ye = console.groupEnd;
696
+ if (L === 0) {
697
+ Q = console.log, M = console.info, k = console.warn, X = console.error, pe = console.group, Te = console.groupCollapsed, He = console.groupEnd;
670
698
  var r = {
671
699
  configurable: !0,
672
700
  enumerable: !0,
@@ -683,254 +711,254 @@ function Jn() {
683
711
  groupEnd: r
684
712
  });
685
713
  }
686
- re++;
714
+ L++;
687
715
  }
688
716
  }
689
- function yt() {
717
+ function Ct() {
690
718
  {
691
- if (re--, re === 0) {
719
+ if (L--, L === 0) {
692
720
  var r = {
693
721
  configurable: !0,
694
722
  enumerable: !0,
695
723
  writable: !0
696
724
  };
697
725
  Object.defineProperties(console, {
698
- log: le({}, r, {
699
- value: Me
726
+ log: D({}, r, {
727
+ value: Q
700
728
  }),
701
- info: le({}, r, {
702
- value: Ge
729
+ info: D({}, r, {
730
+ value: M
703
731
  }),
704
- warn: le({}, r, {
705
- value: Pe
732
+ warn: D({}, r, {
733
+ value: k
706
734
  }),
707
- error: le({}, r, {
708
- value: je
735
+ error: D({}, r, {
736
+ value: X
709
737
  }),
710
- group: le({}, r, {
711
- value: Ve
738
+ group: D({}, r, {
739
+ value: pe
712
740
  }),
713
- groupCollapsed: le({}, r, {
714
- value: nt
741
+ groupCollapsed: D({}, r, {
742
+ value: Te
715
743
  }),
716
- groupEnd: le({}, r, {
717
- value: Ye
744
+ groupEnd: D({}, r, {
745
+ value: He
718
746
  })
719
747
  });
720
748
  }
721
- re < 0 && w("disabledDepth fell below zero. This is a bug in React. Please file an issue.");
749
+ L < 0 && C("disabledDepth fell below zero. This is a bug in React. Please file an issue.");
722
750
  }
723
751
  }
724
- var ze = y.ReactCurrentDispatcher, We;
725
- function Ee(r, f, g) {
752
+ var Ke = H.ReactCurrentDispatcher, Xe;
753
+ function Me(r, f, g) {
726
754
  {
727
- if (We === void 0)
755
+ if (Xe === void 0)
728
756
  try {
729
757
  throw Error();
730
- } catch (M) {
731
- var C = M.stack.trim().match(/\n( *(at )?)/);
732
- We = C && C[1] || "";
758
+ } catch (j) {
759
+ var w = j.stack.trim().match(/\n( *(at )?)/);
760
+ Xe = w && w[1] || "";
733
761
  }
734
762
  return `
735
- ` + We + r;
763
+ ` + Xe + r;
736
764
  }
737
765
  }
738
- var _e = !1, xe;
766
+ var Ue = !1, Re;
739
767
  {
740
- var Et = typeof WeakMap == "function" ? WeakMap : Map;
741
- xe = new Et();
768
+ var St = typeof WeakMap == "function" ? WeakMap : Map;
769
+ Re = new St();
742
770
  }
743
- function rt(r, f) {
744
- if (!r || _e)
771
+ function ot(r, f) {
772
+ if (!r || Ue)
745
773
  return "";
746
774
  {
747
- var g = xe.get(r);
775
+ var g = Re.get(r);
748
776
  if (g !== void 0)
749
777
  return g;
750
778
  }
751
- var C;
752
- _e = !0;
753
- var M = Error.prepareStackTrace;
779
+ var w;
780
+ Ue = !0;
781
+ var j = Error.prepareStackTrace;
754
782
  Error.prepareStackTrace = void 0;
755
- var k;
756
- k = ze.current, ze.current = null, bt();
783
+ var I;
784
+ I = Ke.current, Ke.current = null, wt();
757
785
  try {
758
786
  if (f) {
759
- var R = function() {
787
+ var P = function() {
760
788
  throw Error();
761
789
  };
762
- if (Object.defineProperty(R.prototype, "props", {
790
+ if (Object.defineProperty(P.prototype, "props", {
763
791
  set: function() {
764
792
  throw Error();
765
793
  }
766
794
  }), typeof Reflect == "object" && Reflect.construct) {
767
795
  try {
768
- Reflect.construct(R, []);
769
- } catch (pe) {
770
- C = pe;
796
+ Reflect.construct(P, []);
797
+ } catch (ye) {
798
+ w = ye;
771
799
  }
772
- Reflect.construct(r, [], R);
800
+ Reflect.construct(r, [], P);
773
801
  } else {
774
802
  try {
775
- R.call();
776
- } catch (pe) {
777
- C = pe;
803
+ P.call();
804
+ } catch (ye) {
805
+ w = ye;
778
806
  }
779
- r.call(R.prototype);
807
+ r.call(P.prototype);
780
808
  }
781
809
  } else {
782
810
  try {
783
811
  throw Error();
784
- } catch (pe) {
785
- C = pe;
812
+ } catch (ye) {
813
+ w = ye;
786
814
  }
787
815
  r();
788
816
  }
789
- } catch (pe) {
790
- if (pe && C && typeof pe.stack == "string") {
791
- for (var T = pe.stack.split(`
792
- `), K = C.stack.split(`
793
- `), U = T.length - 1, B = K.length - 1; U >= 1 && B >= 0 && T[U] !== K[B]; )
794
- B--;
795
- for (; U >= 1 && B >= 0; U--, B--)
796
- if (T[U] !== K[B]) {
797
- if (U !== 1 || B !== 1)
817
+ } catch (ye) {
818
+ if (ye && w && typeof ye.stack == "string") {
819
+ for (var O = ye.stack.split(`
820
+ `), se = w.stack.split(`
821
+ `), W = O.length - 1, Z = se.length - 1; W >= 1 && Z >= 0 && O[W] !== se[Z]; )
822
+ Z--;
823
+ for (; W >= 1 && Z >= 0; W--, Z--)
824
+ if (O[W] !== se[Z]) {
825
+ if (W !== 1 || Z !== 1)
798
826
  do
799
- if (U--, B--, B < 0 || T[U] !== K[B]) {
800
- var ie = `
801
- ` + T[U].replace(" at new ", " at ");
802
- return r.displayName && ie.includes("<anonymous>") && (ie = ie.replace("<anonymous>", r.displayName)), typeof r == "function" && xe.set(r, ie), ie;
827
+ if (W--, Z--, Z < 0 || O[W] !== se[Z]) {
828
+ var me = `
829
+ ` + O[W].replace(" at new ", " at ");
830
+ return r.displayName && me.includes("<anonymous>") && (me = me.replace("<anonymous>", r.displayName)), typeof r == "function" && Re.set(r, me), me;
803
831
  }
804
- while (U >= 1 && B >= 0);
832
+ while (W >= 1 && Z >= 0);
805
833
  break;
806
834
  }
807
835
  }
808
836
  } finally {
809
- _e = !1, ze.current = k, yt(), Error.prepareStackTrace = M;
837
+ Ue = !1, Ke.current = I, Ct(), Error.prepareStackTrace = j;
810
838
  }
811
- var Ie = r ? r.displayName || r.name : "", Nt = Ie ? Ee(Ie) : "";
812
- return typeof r == "function" && xe.set(r, Nt), Nt;
839
+ var Ge = r ? r.displayName || r.name : "", Bt = Ge ? Me(Ge) : "";
840
+ return typeof r == "function" && Re.set(r, Bt), Bt;
813
841
  }
814
- function it(r, f, g) {
815
- return rt(r, !1);
842
+ function st(r, f, g) {
843
+ return ot(r, !1);
816
844
  }
817
- function ot(r) {
845
+ function ct(r) {
818
846
  var f = r.prototype;
819
847
  return !!(f && f.isReactComponent);
820
848
  }
821
- function we(r, f, g) {
849
+ function Pe(r, f, g) {
822
850
  if (r == null)
823
851
  return "";
824
852
  if (typeof r == "function")
825
- return rt(r, ot(r));
853
+ return ot(r, ct(r));
826
854
  if (typeof r == "string")
827
- return Ee(r);
855
+ return Me(r);
828
856
  switch (r) {
829
- case p:
830
- return Ee("Suspense");
831
- case h:
832
- return Ee("SuspenseList");
857
+ case m:
858
+ return Me("Suspense");
859
+ case v:
860
+ return Me("SuspenseList");
833
861
  }
834
862
  if (typeof r == "object")
835
863
  switch (r.$$typeof) {
836
864
  case d:
837
- return it(r.render);
838
- case b:
839
- return we(r.type, f, g);
865
+ return st(r.render);
866
+ case E:
867
+ return Pe(r.type, f, g);
840
868
  case x: {
841
- var C = r, M = C._payload, k = C._init;
869
+ var w = r, j = w._payload, I = w._init;
842
870
  try {
843
- return we(k(M), f, g);
871
+ return Pe(I(j), f, g);
844
872
  } catch {
845
873
  }
846
874
  }
847
875
  }
848
876
  return "";
849
877
  }
850
- var ke = Object.prototype.hasOwnProperty, st = {}, He = y.ReactDebugCurrentFrame;
851
- function ge(r) {
878
+ var Be = Object.prototype.hasOwnProperty, lt = {}, Ze = H.ReactDebugCurrentFrame;
879
+ function Ce(r) {
852
880
  if (r) {
853
- var f = r._owner, g = we(r.type, r._source, f ? f.type : null);
854
- He.setExtraStackFrame(g);
881
+ var f = r._owner, g = Pe(r.type, r._source, f ? f.type : null);
882
+ Ze.setExtraStackFrame(g);
855
883
  } else
856
- He.setExtraStackFrame(null);
884
+ Ze.setExtraStackFrame(null);
857
885
  }
858
- function Ce(r, f, g, C, M) {
886
+ function je(r, f, g, w, j) {
859
887
  {
860
- var k = Function.call.bind(ke);
861
- for (var R in r)
862
- if (k(r, R)) {
863
- var T = void 0;
888
+ var I = Function.call.bind(Be);
889
+ for (var P in r)
890
+ if (I(r, P)) {
891
+ var O = void 0;
864
892
  try {
865
- if (typeof r[R] != "function") {
866
- var K = Error((C || "React class") + ": " + g + " type `" + R + "` is invalid; it must be a function, usually from the `prop-types` package, but received `" + typeof r[R] + "`.This often happens because of typos such as `PropTypes.function` instead of `PropTypes.func`.");
867
- throw K.name = "Invariant Violation", K;
893
+ if (typeof r[P] != "function") {
894
+ var se = Error((w || "React class") + ": " + g + " type `" + P + "` is invalid; it must be a function, usually from the `prop-types` package, but received `" + typeof r[P] + "`.This often happens because of typos such as `PropTypes.function` instead of `PropTypes.func`.");
895
+ throw se.name = "Invariant Violation", se;
868
896
  }
869
- T = r[R](f, R, C, g, null, "SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED");
870
- } catch (U) {
871
- T = U;
897
+ O = r[P](f, P, w, g, null, "SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED");
898
+ } catch (W) {
899
+ O = W;
872
900
  }
873
- T && !(T instanceof Error) && (ge(M), w("%s: type specification of %s `%s` is invalid; the type checker function must return `null` or an `Error` but returned a %s. You may have forgotten to pass an argument to the type checker creator (arrayOf, instanceOf, objectOf, oneOf, oneOfType, and shape all require an argument).", C || "React class", g, R, typeof T), ge(null)), T instanceof Error && !(T.message in st) && (st[T.message] = !0, ge(M), w("Failed %s type: %s", g, T.message), ge(null));
901
+ O && !(O instanceof Error) && (Ce(j), C("%s: type specification of %s `%s` is invalid; the type checker function must return `null` or an `Error` but returned a %s. You may have forgotten to pass an argument to the type checker creator (arrayOf, instanceOf, objectOf, oneOf, oneOfType, and shape all require an argument).", w || "React class", g, P, typeof O), Ce(null)), O instanceof Error && !(O.message in lt) && (lt[O.message] = !0, Ce(j), C("Failed %s type: %s", g, O.message), Ce(null));
874
902
  }
875
903
  }
876
904
  }
877
- var xt = Array.isArray;
878
- function Ke(r) {
879
- return xt(r);
905
+ var Ot = Array.isArray;
906
+ function qe(r) {
907
+ return Ot(r);
880
908
  }
881
- function ct(r) {
909
+ function ut(r) {
882
910
  {
883
911
  var f = typeof Symbol == "function" && Symbol.toStringTag, g = f && r[Symbol.toStringTag] || r.constructor.name || "Object";
884
912
  return g;
885
913
  }
886
914
  }
887
- function Xe(r) {
915
+ function Qe(r) {
888
916
  try {
889
- return lt(r), !1;
917
+ return dt(r), !1;
890
918
  } catch {
891
919
  return !0;
892
920
  }
893
921
  }
894
- function lt(r) {
922
+ function dt(r) {
895
923
  return "" + r;
896
924
  }
897
- function ut(r) {
898
- if (Xe(r))
899
- return w("The provided key is an unsupported type %s. This value must be coerced to a string before before using it here.", ct(r)), lt(r);
925
+ function ft(r) {
926
+ if (Qe(r))
927
+ return C("The provided key is an unsupported type %s. This value must be coerced to a string before before using it here.", ut(r)), dt(r);
900
928
  }
901
- var ve = y.ReactCurrentOwner, wt = {
929
+ var Se = H.ReactCurrentOwner, Tt = {
902
930
  key: !0,
903
931
  ref: !0,
904
932
  __self: !0,
905
933
  __source: !0
906
- }, dt, qe, ue;
907
- ue = {};
908
- function i(r) {
909
- if (ke.call(r, "ref")) {
934
+ }, ht, Je, ge;
935
+ ge = {};
936
+ function o(r) {
937
+ if (Be.call(r, "ref")) {
910
938
  var f = Object.getOwnPropertyDescriptor(r, "ref").get;
911
939
  if (f && f.isReactWarning)
912
940
  return !1;
913
941
  }
914
942
  return r.ref !== void 0;
915
943
  }
916
- function E(r) {
917
- if (ke.call(r, "key")) {
944
+ function y(r) {
945
+ if (Be.call(r, "key")) {
918
946
  var f = Object.getOwnPropertyDescriptor(r, "key").get;
919
947
  if (f && f.isReactWarning)
920
948
  return !1;
921
949
  }
922
950
  return r.key !== void 0;
923
951
  }
924
- function P(r, f) {
925
- if (typeof r.ref == "string" && ve.current && f && ve.current.stateNode !== f) {
926
- var g = ae(ve.current.type);
927
- ue[g] || (w('Component "%s" contains the string ref "%s". Support for string refs will be removed in a future major release. This case cannot be automatically converted to an arrow function. We ask you to manually fix this case by using useRef() or createRef() instead. Learn more about using refs safely here: https://reactjs.org/link/strict-mode-string-ref', ae(ve.current.type), r.ref), ue[g] = !0);
952
+ function _(r, f) {
953
+ if (typeof r.ref == "string" && Se.current && f && Se.current.stateNode !== f) {
954
+ var g = N(Se.current.type);
955
+ ge[g] || (C('Component "%s" contains the string ref "%s". Support for string refs will be removed in a future major release. This case cannot be automatically converted to an arrow function. We ask you to manually fix this case by using useRef() or createRef() instead. Learn more about using refs safely here: https://reactjs.org/link/strict-mode-string-ref', N(Se.current.type), r.ref), ge[g] = !0);
928
956
  }
929
957
  }
930
- function _(r, f) {
958
+ function A(r, f) {
931
959
  {
932
960
  var g = function() {
933
- dt || (dt = !0, w("%s: `key` is not a prop. Trying to access it will result in `undefined` being returned. If you need to access the same value within the child component, you should pass it as a different prop. (https://reactjs.org/link/special-props)", f));
961
+ ht || (ht = !0, C("%s: `key` is not a prop. Trying to access it will result in `undefined` being returned. If you need to access the same value within the child component, you should pass it as a different prop. (https://reactjs.org/link/special-props)", f));
934
962
  };
935
963
  g.isReactWarning = !0, Object.defineProperty(r, "key", {
936
964
  get: g,
@@ -938,10 +966,10 @@ function Jn() {
938
966
  });
939
967
  }
940
968
  }
941
- function W(r, f) {
969
+ function te(r, f) {
942
970
  {
943
971
  var g = function() {
944
- qe || (qe = !0, w("%s: `ref` is not a prop. Trying to access it will result in `undefined` being returned. If you need to access the same value within the child component, you should pass it as a different prop. (https://reactjs.org/link/special-props)", f));
972
+ Je || (Je = !0, C("%s: `ref` is not a prop. Trying to access it will result in `undefined` being returned. If you need to access the same value within the child component, you should pass it as a different prop. (https://reactjs.org/link/special-props)", f));
945
973
  };
946
974
  g.isReactWarning = !0, Object.defineProperty(r, "ref", {
947
975
  get: g,
@@ -949,70 +977,70 @@ function Jn() {
949
977
  });
950
978
  }
951
979
  }
952
- var de = function(r, f, g, C, M, k, R) {
953
- var T = {
980
+ var ve = function(r, f, g, w, j, I, P) {
981
+ var O = {
954
982
  // This tag allows us to uniquely identify this as a React Element
955
983
  $$typeof: n,
956
984
  // Built-in properties that belong on the element
957
985
  type: r,
958
986
  key: f,
959
987
  ref: g,
960
- props: R,
988
+ props: P,
961
989
  // Record the component responsible for creating this element.
962
- _owner: k
990
+ _owner: I
963
991
  };
964
- return T._store = {}, Object.defineProperty(T._store, "validated", {
992
+ return O._store = {}, Object.defineProperty(O._store, "validated", {
965
993
  configurable: !1,
966
994
  enumerable: !1,
967
995
  writable: !0,
968
996
  value: !1
969
- }), Object.defineProperty(T, "_self", {
997
+ }), Object.defineProperty(O, "_self", {
970
998
  configurable: !1,
971
999
  enumerable: !1,
972
1000
  writable: !1,
973
- value: C
974
- }), Object.defineProperty(T, "_source", {
1001
+ value: w
1002
+ }), Object.defineProperty(O, "_source", {
975
1003
  configurable: !1,
976
1004
  enumerable: !1,
977
1005
  writable: !1,
978
- value: M
979
- }), Object.freeze && (Object.freeze(T.props), Object.freeze(T)), T;
1006
+ value: j
1007
+ }), Object.freeze && (Object.freeze(O.props), Object.freeze(O)), O;
980
1008
  };
981
- function J(r, f, g, C, M) {
1009
+ function le(r, f, g, w, j) {
982
1010
  {
983
- var k, R = {}, T = null, K = null;
984
- g !== void 0 && (ut(g), T = "" + g), E(f) && (ut(f.key), T = "" + f.key), i(f) && (K = f.ref, P(f, M));
985
- for (k in f)
986
- ke.call(f, k) && !wt.hasOwnProperty(k) && (R[k] = f[k]);
1011
+ var I, P = {}, O = null, se = null;
1012
+ g !== void 0 && (ft(g), O = "" + g), y(f) && (ft(f.key), O = "" + f.key), o(f) && (se = f.ref, _(f, j));
1013
+ for (I in f)
1014
+ Be.call(f, I) && !Tt.hasOwnProperty(I) && (P[I] = f[I]);
987
1015
  if (r && r.defaultProps) {
988
- var U = r.defaultProps;
989
- for (k in U)
990
- R[k] === void 0 && (R[k] = U[k]);
1016
+ var W = r.defaultProps;
1017
+ for (I in W)
1018
+ P[I] === void 0 && (P[I] = W[I]);
991
1019
  }
992
- if (T || K) {
993
- var B = typeof r == "function" ? r.displayName || r.name || "Unknown" : r;
994
- T && _(R, B), K && W(R, B);
1020
+ if (O || se) {
1021
+ var Z = typeof r == "function" ? r.displayName || r.name || "Unknown" : r;
1022
+ O && A(P, Z), se && te(P, Z);
995
1023
  }
996
- return de(r, T, K, M, C, ve.current, R);
1024
+ return ve(r, O, se, j, w, Se.current, P);
997
1025
  }
998
1026
  }
999
- var ft = y.ReactCurrentOwner, ht = y.ReactDebugCurrentFrame;
1000
- function he(r) {
1027
+ var pt = H.ReactCurrentOwner, mt = H.ReactDebugCurrentFrame;
1028
+ function be(r) {
1001
1029
  if (r) {
1002
- var f = r._owner, g = we(r.type, r._source, f ? f.type : null);
1003
- ht.setExtraStackFrame(g);
1030
+ var f = r._owner, g = Pe(r.type, r._source, f ? f.type : null);
1031
+ mt.setExtraStackFrame(g);
1004
1032
  } else
1005
- ht.setExtraStackFrame(null);
1033
+ mt.setExtraStackFrame(null);
1006
1034
  }
1007
- var Q;
1008
- Q = !1;
1009
- function ee(r) {
1035
+ var fe;
1036
+ fe = !1;
1037
+ function he(r) {
1010
1038
  return typeof r == "object" && r !== null && r.$$typeof === n;
1011
1039
  }
1012
- function De() {
1040
+ function $e() {
1013
1041
  {
1014
- if (ft.current) {
1015
- var r = ae(ft.current.type);
1042
+ if (pt.current) {
1043
+ var r = N(pt.current.type);
1016
1044
  if (r)
1017
1045
  return `
1018
1046
 
@@ -1021,7 +1049,7 @@ Check the render method of \`` + r + "`.";
1021
1049
  return "";
1022
1050
  }
1023
1051
  }
1024
- function Se(r) {
1052
+ function _e(r) {
1025
1053
  {
1026
1054
  if (r !== void 0) {
1027
1055
  var f = r.fileName.replace(/^.*[\\\/]/, ""), g = r.lineNumber;
@@ -1032,10 +1060,10 @@ Check your code at ` + f + ":" + g + ".";
1032
1060
  return "";
1033
1061
  }
1034
1062
  }
1035
- var be = {};
1036
- function Ae(r) {
1063
+ var Oe = {};
1064
+ function Ve(r) {
1037
1065
  {
1038
- var f = De();
1066
+ var f = $e();
1039
1067
  if (!f) {
1040
1068
  var g = typeof r == "string" ? r : r.displayName || r.name;
1041
1069
  g && (f = `
@@ -1045,39 +1073,39 @@ Check the top-level render call using <` + g + ">.");
1045
1073
  return f;
1046
1074
  }
1047
1075
  }
1048
- function Dt(r, f) {
1076
+ function Lt(r, f) {
1049
1077
  {
1050
1078
  if (!r._store || r._store.validated || r.key != null)
1051
1079
  return;
1052
1080
  r._store.validated = !0;
1053
- var g = Ae(f);
1054
- if (be[g])
1081
+ var g = Ve(f);
1082
+ if (Oe[g])
1055
1083
  return;
1056
- be[g] = !0;
1057
- var C = "";
1058
- r && r._owner && r._owner !== ft.current && (C = " It was passed a child from " + ae(r._owner.type) + "."), he(r), w('Each child in a list should have a unique "key" prop.%s%s See https://reactjs.org/link/warning-keys for more information.', g, C), he(null);
1084
+ Oe[g] = !0;
1085
+ var w = "";
1086
+ r && r._owner && r._owner !== pt.current && (w = " It was passed a child from " + N(r._owner.type) + "."), be(r), C('Each child in a list should have a unique "key" prop.%s%s See https://reactjs.org/link/warning-keys for more information.', g, w), be(null);
1059
1087
  }
1060
1088
  }
1061
- function At(r, f) {
1089
+ function Ft(r, f) {
1062
1090
  {
1063
1091
  if (typeof r != "object")
1064
1092
  return;
1065
- if (Ke(r))
1093
+ if (qe(r))
1066
1094
  for (var g = 0; g < r.length; g++) {
1067
- var C = r[g];
1068
- ee(C) && Dt(C, f);
1095
+ var w = r[g];
1096
+ he(w) && Lt(w, f);
1069
1097
  }
1070
- else if (ee(r))
1098
+ else if (he(r))
1071
1099
  r._store && (r._store.validated = !0);
1072
1100
  else if (r) {
1073
- var M = v(r);
1074
- if (typeof M == "function" && M !== r.entries)
1075
- for (var k = M.call(r), R; !(R = k.next()).done; )
1076
- ee(R.value) && Dt(R.value, f);
1101
+ var j = oe(r);
1102
+ if (typeof j == "function" && j !== r.entries)
1103
+ for (var I = j.call(r), P; !(P = I.next()).done; )
1104
+ he(P.value) && Lt(P.value, f);
1077
1105
  }
1078
1106
  }
1079
1107
  }
1080
- function fn(r) {
1108
+ function yn(r) {
1081
1109
  {
1082
1110
  var f = r.type;
1083
1111
  if (f == null || typeof f == "string")
@@ -1087,83 +1115,83 @@ Check the top-level render call using <` + g + ">.");
1087
1115
  g = f.propTypes;
1088
1116
  else if (typeof f == "object" && (f.$$typeof === d || // Note: Memo only checks outer props here.
1089
1117
  // Inner props are checked in the reconciler.
1090
- f.$$typeof === b))
1118
+ f.$$typeof === E))
1091
1119
  g = f.propTypes;
1092
1120
  else
1093
1121
  return;
1094
1122
  if (g) {
1095
- var C = ae(f);
1096
- Ce(g, r.props, "prop", C, r);
1097
- } else if (f.PropTypes !== void 0 && !Q) {
1098
- Q = !0;
1099
- var M = ae(f);
1100
- w("Component %s declared `PropTypes` instead of `propTypes`. Did you misspell the property assignment?", M || "Unknown");
1123
+ var w = N(f);
1124
+ je(g, r.props, "prop", w, r);
1125
+ } else if (f.PropTypes !== void 0 && !fe) {
1126
+ fe = !0;
1127
+ var j = N(f);
1128
+ C("Component %s declared `PropTypes` instead of `propTypes`. Did you misspell the property assignment?", j || "Unknown");
1101
1129
  }
1102
- typeof f.getDefaultProps == "function" && !f.getDefaultProps.isReactClassApproved && w("getDefaultProps is only used on classic React.createClass definitions. Use a static property named `defaultProps` instead.");
1130
+ typeof f.getDefaultProps == "function" && !f.getDefaultProps.isReactClassApproved && C("getDefaultProps is only used on classic React.createClass definitions. Use a static property named `defaultProps` instead.");
1103
1131
  }
1104
1132
  }
1105
- function hn(r) {
1133
+ function En(r) {
1106
1134
  {
1107
1135
  for (var f = Object.keys(r.props), g = 0; g < f.length; g++) {
1108
- var C = f[g];
1109
- if (C !== "children" && C !== "key") {
1110
- he(r), w("Invalid prop `%s` supplied to `React.Fragment`. React.Fragment can only have `key` and `children` props.", C), he(null);
1136
+ var w = f[g];
1137
+ if (w !== "children" && w !== "key") {
1138
+ be(r), C("Invalid prop `%s` supplied to `React.Fragment`. React.Fragment can only have `key` and `children` props.", w), be(null);
1111
1139
  break;
1112
1140
  }
1113
1141
  }
1114
- r.ref !== null && (he(r), w("Invalid attribute `ref` supplied to `React.Fragment`."), he(null));
1142
+ r.ref !== null && (be(r), C("Invalid attribute `ref` supplied to `React.Fragment`."), be(null));
1115
1143
  }
1116
1144
  }
1117
- function It(r, f, g, C, M, k) {
1145
+ function Ut(r, f, g, w, j, I) {
1118
1146
  {
1119
- var R = D(r);
1120
- if (!R) {
1121
- var T = "";
1122
- (r === void 0 || typeof r == "object" && r !== null && Object.keys(r).length === 0) && (T += " You likely forgot to export your component from the file it's defined in, or you might have mixed up default and named imports.");
1123
- var K = Se(M);
1124
- K ? T += K : T += De();
1125
- var U;
1126
- r === null ? U = "null" : Ke(r) ? U = "array" : r !== void 0 && r.$$typeof === n ? (U = "<" + (ae(r.type) || "Unknown") + " />", T = " Did you accidentally export a JSX literal instead of a component?") : U = typeof r, w("React.jsx: type is invalid -- expected a string (for built-in components) or a class/function (for composite components) but got: %s.%s", U, T);
1147
+ var P = S(r);
1148
+ if (!P) {
1149
+ var O = "";
1150
+ (r === void 0 || typeof r == "object" && r !== null && Object.keys(r).length === 0) && (O += " You likely forgot to export your component from the file it's defined in, or you might have mixed up default and named imports.");
1151
+ var se = _e(j);
1152
+ se ? O += se : O += $e();
1153
+ var W;
1154
+ r === null ? W = "null" : qe(r) ? W = "array" : r !== void 0 && r.$$typeof === n ? (W = "<" + (N(r.type) || "Unknown") + " />", O = " Did you accidentally export a JSX literal instead of a component?") : W = typeof r, C("React.jsx: type is invalid -- expected a string (for built-in components) or a class/function (for composite components) but got: %s.%s", W, O);
1127
1155
  }
1128
- var B = J(r, f, g, M, k);
1129
- if (B == null)
1130
- return B;
1131
- if (R) {
1132
- var ie = f.children;
1133
- if (ie !== void 0)
1134
- if (C)
1135
- if (Ke(ie)) {
1136
- for (var Ie = 0; Ie < ie.length; Ie++)
1137
- At(ie[Ie], r);
1138
- Object.freeze && Object.freeze(ie);
1156
+ var Z = le(r, f, g, j, I);
1157
+ if (Z == null)
1158
+ return Z;
1159
+ if (P) {
1160
+ var me = f.children;
1161
+ if (me !== void 0)
1162
+ if (w)
1163
+ if (qe(me)) {
1164
+ for (var Ge = 0; Ge < me.length; Ge++)
1165
+ Ft(me[Ge], r);
1166
+ Object.freeze && Object.freeze(me);
1139
1167
  } else
1140
- w("React.jsx: Static children should always be an array. You are likely explicitly calling React.jsxs or React.jsxDEV. Use the Babel transform instead.");
1168
+ C("React.jsx: Static children should always be an array. You are likely explicitly calling React.jsxs or React.jsxDEV. Use the Babel transform instead.");
1141
1169
  else
1142
- At(ie, r);
1170
+ Ft(me, r);
1143
1171
  }
1144
- return r === e ? hn(B) : fn(B), B;
1172
+ return r === e ? En(Z) : yn(Z), Z;
1145
1173
  }
1146
1174
  }
1147
- function pn(r, f, g) {
1148
- return It(r, f, g, !0);
1175
+ function xn(r, f, g) {
1176
+ return Ut(r, f, g, !0);
1149
1177
  }
1150
- function mn(r, f, g) {
1151
- return It(r, f, g, !1);
1178
+ function wn(r, f, g) {
1179
+ return Ut(r, f, g, !1);
1152
1180
  }
1153
- var gn = mn, vn = pn;
1154
- Qe.Fragment = e, Qe.jsx = gn, Qe.jsxs = vn;
1155
- }()), Qe;
1181
+ var Cn = wn, Sn = xn;
1182
+ tt.Fragment = e, tt.jsx = Cn, tt.jsxs = Sn;
1183
+ }()), tt;
1156
1184
  }
1157
- process.env.NODE_ENV === "production" ? Pt.exports = Zn() : Pt.exports = Jn();
1158
- var l = Pt.exports;
1159
- function ln(t) {
1160
- return t.title.search("<") > -1 ? /* @__PURE__ */ l.jsx("button", { className: "svg", dangerouslySetInnerHTML: { __html: t.title } }) : /* @__PURE__ */ l.jsx("button", { children: t.title });
1185
+ process.env.NODE_ENV === "production" ? At.exports = ri() : At.exports = ai();
1186
+ var c = At.exports;
1187
+ function gn(t) {
1188
+ return t.title.search("<") > -1 ? /* @__PURE__ */ c.jsx("button", { className: "svg", dangerouslySetInnerHTML: { __html: t.title } }) : /* @__PURE__ */ c.jsx("button", { children: t.title });
1161
1189
  }
1162
- const Qn = /* @__PURE__ */ l.jsxs("svg", { className: "closeIcon", width: "14", height: "14", fill: "none", stroke: "#666666", strokeMiterlimit: "10", children: [
1163
- /* @__PURE__ */ l.jsx("circle", { cx: "7", cy: "7", r: "6" }),
1164
- /* @__PURE__ */ l.jsx("line", { x1: "4", y1: "4", x2: "10", y2: "10" }),
1165
- /* @__PURE__ */ l.jsx("line", { x1: "4", y1: "10", x2: "10", y2: "4" })
1166
- ] }), ea = /* @__PURE__ */ l.jsx("svg", { className: "dragIcon", width: "14", height: "14", fill: "#666666", stroke: "none", children: /* @__PURE__ */ l.jsx(
1190
+ const oi = /* @__PURE__ */ c.jsxs("svg", { className: "closeIcon", width: "14", height: "14", fill: "none", stroke: "#666666", strokeMiterlimit: "10", children: [
1191
+ /* @__PURE__ */ c.jsx("circle", { cx: "7", cy: "7", r: "6" }),
1192
+ /* @__PURE__ */ c.jsx("line", { x1: "4", y1: "4", x2: "10", y2: "10" }),
1193
+ /* @__PURE__ */ c.jsx("line", { x1: "4", y1: "10", x2: "10", y2: "4" })
1194
+ ] }), si = /* @__PURE__ */ c.jsx("svg", { className: "dragIcon", width: "14", height: "14", fill: "#666666", stroke: "none", children: /* @__PURE__ */ c.jsx(
1167
1195
  "path",
1168
1196
  {
1169
1197
  d: `M10.43,4H3.57C3.26,4,3,4.22,3,4.5v1C3,5.78,3.26,6,3.57,6h6.86C10.74,6,11,5.78,11,5.5v-1
@@ -1171,46 +1199,46 @@ C11,4.22,10.74,4,10.43,4z M10.43,8H3.57C3.26,8,3,8.22,3,8.5v1C3,9.78,3.26,10,3.5
1171
1199
  C11,8.22,10.74,8,10.43,8z`
1172
1200
  }
1173
1201
  ) });
1174
- function ta(t) {
1175
- return /* @__PURE__ */ l.jsx(an.Item, { value: t.title, children: /* @__PURE__ */ l.jsxs("div", { children: [
1176
- ea,
1177
- /* @__PURE__ */ l.jsx("span", { children: t.title }),
1178
- /* @__PURE__ */ l.jsx("button", { className: "closeIcon", onClick: () => {
1202
+ function ci(t) {
1203
+ return /* @__PURE__ */ c.jsx(dn.Item, { value: t.title, children: /* @__PURE__ */ c.jsxs("div", { children: [
1204
+ si,
1205
+ /* @__PURE__ */ c.jsx("span", { children: t.title }),
1206
+ /* @__PURE__ */ c.jsx("button", { className: "closeIcon", onClick: () => {
1179
1207
  t.onDelete(t.index);
1180
- }, children: Qn })
1208
+ }, children: oi })
1181
1209
  ] }) }, t.title);
1182
1210
  }
1183
- function na(t) {
1184
- const [n, a] = ne(!1), [e, o] = ne(t.options), u = (p) => {
1185
- t.onDragComplete(p), o(p);
1186
- }, c = (p) => {
1187
- const h = [...e];
1188
- h.splice(p, 1), u(h);
1189
- }, s = [];
1190
- e.forEach((p, h) => {
1191
- s.push(/* @__PURE__ */ l.jsx(ta, { index: h, title: p, onDelete: c }, p));
1211
+ function li(t) {
1212
+ const [n, i] = ae(!1), [e, a] = ae(t.options), s = (m) => {
1213
+ t.onDragComplete(m), a(m);
1214
+ }, h = (m) => {
1215
+ const v = [...e];
1216
+ v.splice(m, 1), s(v);
1217
+ }, l = [];
1218
+ e.forEach((m, v) => {
1219
+ l.push(/* @__PURE__ */ c.jsx(ci, { index: v, title: m, onDelete: h }, m));
1192
1220
  });
1193
1221
  let d = "dropdown draggable";
1194
- return t.subdropdown && (d += " subdropdown"), /* @__PURE__ */ l.jsxs("div", { className: d, onMouseEnter: () => a(!0), onMouseLeave: () => a(!1), children: [
1195
- /* @__PURE__ */ l.jsx(ln, { title: t.title }),
1196
- /* @__PURE__ */ l.jsx(an.Group, { axis: "y", values: e, onReorder: u, style: { visibility: n ? "visible" : "hidden" }, children: s })
1222
+ return t.subdropdown && (d += " subdropdown"), /* @__PURE__ */ c.jsxs("div", { className: d, onMouseEnter: () => i(!0), onMouseLeave: () => i(!1), children: [
1223
+ /* @__PURE__ */ c.jsx(gn, { title: t.title }),
1224
+ /* @__PURE__ */ c.jsx(dn.Group, { axis: "y", values: e, onReorder: s, style: { visibility: n ? "visible" : "hidden" }, children: l })
1197
1225
  ] });
1198
1226
  }
1199
- function aa(t) {
1200
- const [n, a] = ne(!1), e = [];
1201
- t.options.map((u, c) => {
1202
- t.onSelect !== void 0 && (u.onSelect = t.onSelect), e.push(/* @__PURE__ */ l.jsx(ra, { option: u }, c));
1227
+ function ui(t) {
1228
+ const [n, i] = ae(!1), e = [];
1229
+ t.options.map((s, h) => {
1230
+ t.onSelect !== void 0 && (s.onSelect = t.onSelect), e.push(/* @__PURE__ */ c.jsx(di, { option: s }, h));
1203
1231
  });
1204
- let o = "dropdown";
1205
- return t.subdropdown && (o += " subdropdown"), /* @__PURE__ */ l.jsxs(
1232
+ let a = "dropdown";
1233
+ return t.subdropdown && (a += " subdropdown"), /* @__PURE__ */ c.jsxs(
1206
1234
  "div",
1207
1235
  {
1208
- className: o,
1209
- onMouseEnter: () => a(!0),
1210
- onMouseLeave: () => a(!1),
1236
+ className: a,
1237
+ onMouseEnter: () => i(!0),
1238
+ onMouseLeave: () => i(!1),
1211
1239
  children: [
1212
- /* @__PURE__ */ l.jsx(ln, { title: t.title }),
1213
- /* @__PURE__ */ l.jsx(
1240
+ /* @__PURE__ */ c.jsx(gn, { title: t.title }),
1241
+ /* @__PURE__ */ c.jsx(
1214
1242
  "ul",
1215
1243
  {
1216
1244
  style: { visibility: n ? "visible" : "hidden" },
@@ -1221,26 +1249,26 @@ function aa(t) {
1221
1249
  }
1222
1250
  );
1223
1251
  }
1224
- function ra(t) {
1225
- const { option: n } = t, [a, e] = ne("");
1226
- let o;
1252
+ function di(t) {
1253
+ const { option: n } = t, [i, e] = ae("");
1254
+ let a;
1227
1255
  switch (n.type) {
1228
1256
  case "draggable":
1229
- o = /* @__PURE__ */ l.jsx(
1230
- na,
1257
+ a = /* @__PURE__ */ c.jsx(
1258
+ li,
1231
1259
  {
1232
1260
  title: n.title,
1233
1261
  options: n.value,
1234
- onDragComplete: (u) => {
1235
- n.onDragComplete !== void 0 && n.onDragComplete(u);
1262
+ onDragComplete: (s) => {
1263
+ n.onDragComplete !== void 0 && n.onDragComplete(s);
1236
1264
  },
1237
1265
  subdropdown: !0
1238
1266
  }
1239
1267
  );
1240
1268
  break;
1241
1269
  case "dropdown":
1242
- o = /* @__PURE__ */ l.jsx(
1243
- aa,
1270
+ a = /* @__PURE__ */ c.jsx(
1271
+ ui,
1244
1272
  {
1245
1273
  title: n.title,
1246
1274
  options: n.value,
@@ -1250,137 +1278,39 @@ function ra(t) {
1250
1278
  );
1251
1279
  break;
1252
1280
  case "option":
1253
- o = /* @__PURE__ */ l.jsx(
1281
+ a = /* @__PURE__ */ c.jsx(
1254
1282
  "button",
1255
1283
  {
1256
1284
  onClick: () => {
1257
- n.onSelect !== void 0 && n.onSelect(n.value), n.selectable && (a !== n.title ? e(n.title) : e(""));
1285
+ n.onSelect !== void 0 && n.onSelect(n.value), n.selectable && (i !== n.title ? e(n.title) : e(""));
1258
1286
  },
1259
1287
  children: n.title
1260
1288
  }
1261
1289
  );
1262
1290
  break;
1263
1291
  }
1264
- return /* @__PURE__ */ l.jsx("li", { className: a === n.title ? "selected" : "", children: o }, Gn());
1292
+ return /* @__PURE__ */ c.jsx("li", { className: i === n.title ? "selected" : "", children: a }, Zn());
1265
1293
  }
1266
- function Ka(t) {
1267
- let n;
1268
- function a(c) {
1269
- var d, p, h, b, x, S, O, m, v;
1270
- let s;
1271
- switch (c.event) {
1294
+ function nr(t, n, i) {
1295
+ function e(s) {
1296
+ switch (n.forEach((h) => h(t, s)), s.event) {
1272
1297
  case "custom":
1273
- I.dispatchEvent({ type: N.CUSTOM, value: c.data });
1274
- break;
1275
- case "selectComponent":
1276
- I.dispatchEvent({ type: N.SELECT_DROPDOWN, value: c.data });
1277
- break;
1278
- case "draggableListUpdate":
1279
- I.dispatchEvent({ type: N.DRAG_UPDATE, value: c.data });
1280
- break;
1281
- case "addFolder":
1282
- (d = t.components.get("debug")) == null || d.addFolder(c.data.name, c.data.params, c.data.parent);
1283
- break;
1284
- case "bindObject":
1285
- (p = t.components.get("debug")) == null || p.bind(c.data.name, c.data.params, c.data.parent);
1286
- break;
1287
- case "updateBind":
1288
- (h = t.components.get("debug")) == null || h.triggerBind(c.data.id, c.data.value);
1289
- break;
1290
- case "addButton":
1291
- (b = t.components.get("debug")) == null || b.button(c.data.name, c.data.callback, c.data.parent);
1292
- break;
1293
- case "clickButton":
1294
- (x = t.components.get("debug")) == null || x.triggerButton(c.data.id);
1295
- break;
1296
- case "setSheet":
1297
- s = (S = t.components.get("theatre")) == null ? void 0 : S.sheets.get(c.data.sheet), s !== void 0 && (n = s, Ze.setSelection([s]));
1298
- break;
1299
- case "setSheetObject":
1300
- s = (O = t.components.get("theatre")) == null ? void 0 : O.sheetObjects.get(`${c.data.sheet}_${c.data.key}`), s !== void 0 && Ze.setSelection([s]);
1301
- break;
1302
- case "updateSheetObject":
1303
- s = (m = t.components.get("theatre")) == null ? void 0 : m.sheetObjectCBs.get(c.data.sheetObject), s !== void 0 && s(c.data.values);
1304
- break;
1305
- case "updateTimeline":
1306
- n = (v = t.components.get("theatre")) == null ? void 0 : v.sheets.get(c.data.sheet), n !== void 0 && (n.sequence.position = c.data.position);
1307
- break;
1308
- case "getObject":
1309
- I.dispatchEvent({ type: N.GET_OBJECT, value: c.data });
1310
- break;
1311
- case "updateObject":
1312
- I.dispatchEvent({ type: N.UPDATE_OBJECT, value: c.data });
1313
- break;
1314
- case "createTexture":
1315
- I.dispatchEvent({ type: N.CREATE_TEXTURE, value: c.data });
1316
- break;
1317
- case "requestMethod":
1318
- I.dispatchEvent({ type: N.REQUEST_METHOD, value: c.data });
1298
+ z.dispatchEvent({ type: Y.CUSTOM, value: s.data });
1319
1299
  break;
1320
1300
  }
1321
1301
  }
1322
- function e(c) {
1323
- switch (c.event) {
1302
+ function a(s) {
1303
+ switch (i.forEach((h) => h(t, s)), s.event) {
1324
1304
  case "custom":
1325
- I.dispatchEvent({ type: N.CUSTOM, value: c.data });
1326
- break;
1327
- case "setObject":
1328
- I.dispatchEvent({ type: N.SET_OBJECT, value: c.data });
1329
- break;
1330
- case "setScene":
1331
- I.dispatchEvent({ type: N.SET_SCENE, value: c.data });
1305
+ z.dispatchEvent({ type: Y.CUSTOM, value: s.data });
1332
1306
  break;
1333
1307
  }
1334
1308
  }
1335
- function o() {
1336
- Ze.ui.hide();
1337
- }
1338
- function u() {
1339
- Ze.ui.restore(), Ze.onSelectionChange((p) => {
1340
- p.length < 1 || p.forEach((h) => {
1341
- var O;
1342
- let b = h.address.sheetId, x = "setSheet", S = {};
1343
- switch (h.type) {
1344
- case "Theatre_Sheet_PublicAPI":
1345
- x = "setSheet", S = {
1346
- sheet: h.address.sheetId
1347
- }, n = (O = t.components.get("theatre")) == null ? void 0 : O.sheets.get(h.address.sheetId);
1348
- break;
1349
- case "Theatre_SheetObject_PublicAPI":
1350
- x = "setSheetObject", b += `_${h.address.objectKey}`, S = {
1351
- id: b,
1352
- sheet: h.address.sheetId,
1353
- key: h.address.objectKey
1354
- };
1355
- break;
1356
- }
1357
- t.send({ event: x, target: "app", data: S });
1358
- });
1359
- });
1360
- let c = 0;
1361
- const s = () => {
1362
- if (n !== void 0 && c !== n.sequence.position) {
1363
- c = n.sequence.position;
1364
- const p = n;
1365
- t.send({
1366
- event: "updateTimeline",
1367
- target: "app",
1368
- data: {
1369
- position: c,
1370
- sheet: p.address.sheetId
1371
- }
1372
- });
1373
- }
1374
- }, d = () => {
1375
- s(), requestAnimationFrame(d);
1376
- };
1377
- s(), d();
1378
- }
1379
- t.listen((c) => {
1380
- t.editor ? e(c) : a(c);
1381
- }), t.editor ? u() : o();
1309
+ t.listen((s) => {
1310
+ t.editor ? a(s) : e(s);
1311
+ });
1382
1312
  }
1383
- const ia = `out vec3 worldPosition;
1313
+ const fi = `out vec3 worldPosition;
1384
1314
  uniform float uDistance;
1385
1315
 
1386
1316
  void main() {
@@ -1389,7 +1319,7 @@ void main() {
1389
1319
  worldPosition.xz += cameraPosition.xz;
1390
1320
 
1391
1321
  gl_Position = projectionMatrix * modelViewMatrix * vec4(worldPosition, 1.0);
1392
- }`, oa = `out vec4 fragColor;
1322
+ }`, hi = `out vec4 fragColor;
1393
1323
  in vec3 worldPosition;
1394
1324
 
1395
1325
  uniform float uDivisions;
@@ -1457,14 +1387,14 @@ void main() {
1457
1387
 
1458
1388
  if (fragColor.a <= 0.0) discard;
1459
1389
  }`;
1460
- class sa extends Qt {
1390
+ class pi extends on {
1461
1391
  constructor(n) {
1462
1392
  super({
1463
1393
  extensions: {
1464
1394
  derivatives: !0
1465
1395
  },
1466
- glslVersion: wn,
1467
- side: Cn,
1396
+ glslVersion: Pn,
1397
+ side: jn,
1468
1398
  transparent: !0,
1469
1399
  uniforms: {
1470
1400
  uScale: {
@@ -1474,7 +1404,7 @@ class sa extends Qt {
1474
1404
  value: (n == null ? void 0 : n.divisions) !== void 0 ? n == null ? void 0 : n.divisions : 10
1475
1405
  },
1476
1406
  uColor: {
1477
- value: (n == null ? void 0 : n.color) !== void 0 ? n == null ? void 0 : n.color : new kt(16777215)
1407
+ value: (n == null ? void 0 : n.color) !== void 0 ? n == null ? void 0 : n.color : new It(16777215)
1478
1408
  },
1479
1409
  uDistance: {
1480
1410
  value: (n == null ? void 0 : n.distance) !== void 0 ? n == null ? void 0 : n.distance : 1e4
@@ -1486,25 +1416,25 @@ class sa extends Qt {
1486
1416
  value: (n == null ? void 0 : n.gridOpacity) !== void 0 ? n == null ? void 0 : n.gridOpacity : 0.25
1487
1417
  }
1488
1418
  },
1489
- vertexShader: ia,
1490
- fragmentShader: oa,
1419
+ vertexShader: fi,
1420
+ fragmentShader: hi,
1491
1421
  name: "InfiniteGrid",
1492
1422
  depthWrite: !1
1493
1423
  });
1494
1424
  }
1495
1425
  }
1496
- class ca extends Sn {
1426
+ class mi extends _n {
1497
1427
  constructor() {
1498
- const a = new sa();
1499
- super(new On(2, 2), a);
1500
- $(this, "gridMaterial");
1501
- this.gridMaterial = a, this.frustumCulled = !1, this.name = "InfiniteGridHelper", this.position.y = 0.1;
1428
+ const i = new pi();
1429
+ super(new Dn(2, 2), i);
1430
+ q(this, "gridMaterial");
1431
+ this.gridMaterial = i, this.frustumCulled = !1, this.name = "InfiniteGridHelper", this.position.y = 0.1;
1502
1432
  }
1503
1433
  update() {
1504
1434
  this.gridMaterial.needsUpdate = !0;
1505
1435
  }
1506
1436
  }
1507
- const la = `#include <common>
1437
+ const gi = `#include <common>
1508
1438
  #include <batching_pars_vertex>
1509
1439
  #include <uv_pars_vertex>
1510
1440
  #include <color_pars_vertex>
@@ -1534,7 +1464,7 @@ void main() {
1534
1464
  #include <logdepthbuf_vertex>
1535
1465
  #include <clipping_planes_vertex>
1536
1466
  #include <worldpos_vertex>
1537
- }`, ua = `
1467
+ }`, vi = `
1538
1468
  #include <common>
1539
1469
  #include <uv_pars_fragment>
1540
1470
  #include <clipping_planes_pars_fragment>
@@ -1543,51 +1473,51 @@ void main() {
1543
1473
  #include <clipping_planes_fragment>
1544
1474
  gl_FragColor = vec4(vec3(vUv, 0.0), 1.0);
1545
1475
  }`;
1546
- class da extends Qt {
1476
+ class bi extends on {
1547
1477
  constructor() {
1548
1478
  super({
1549
1479
  defines: {
1550
1480
  USE_UV: ""
1551
1481
  },
1552
- vertexShader: la,
1553
- fragmentShader: ua
1482
+ vertexShader: gi,
1483
+ fragmentShader: vi
1554
1484
  });
1555
1485
  }
1556
1486
  }
1557
- function jt(t) {
1558
- const [n, a] = ne(t.open !== void 0 ? t.open : !0), e = !n || t.children === void 0;
1559
- return /* @__PURE__ */ l.jsxs("div", { className: `accordion ${e ? "hide" : ""}`, children: [
1560
- /* @__PURE__ */ l.jsxs(
1487
+ function Nt(t) {
1488
+ const [n, i] = ae(t.open !== void 0 ? t.open : !0), e = !n || t.children === void 0;
1489
+ return /* @__PURE__ */ c.jsxs("div", { className: `accordion ${e ? "hide" : ""}`, children: [
1490
+ /* @__PURE__ */ c.jsxs(
1561
1491
  "button",
1562
1492
  {
1563
1493
  className: "toggle",
1564
1494
  onClick: () => {
1565
- const o = !n;
1566
- t.onToggle !== void 0 && t.onToggle(o), a(o);
1495
+ const a = !n;
1496
+ t.onToggle !== void 0 && t.onToggle(a), i(a);
1567
1497
  },
1568
1498
  children: [
1569
- /* @__PURE__ */ l.jsx(
1499
+ /* @__PURE__ */ c.jsx(
1570
1500
  "p",
1571
1501
  {
1572
1502
  className: `status ${n ? "open" : ""}`,
1573
1503
  children: "Toggle"
1574
1504
  }
1575
1505
  ),
1576
- /* @__PURE__ */ l.jsx("p", { className: "label", children: t.label })
1506
+ /* @__PURE__ */ c.jsx("p", { className: "label", children: t.label })
1577
1507
  ]
1578
1508
  }
1579
1509
  ),
1580
1510
  t.button,
1581
- /* @__PURE__ */ l.jsx("div", { className: n ? "open" : "", children: /* @__PURE__ */ l.jsx("div", { children: t.children }) })
1511
+ /* @__PURE__ */ c.jsx("div", { className: n ? "open" : "", children: /* @__PURE__ */ c.jsx("div", { children: t.children }) })
1582
1512
  ] });
1583
1513
  }
1584
- function un(t) {
1585
- const [n, a] = ne(!1), e = t.child.children.length > 0, o = [];
1586
- return t.child.children.length > 0 && t.child.children.map((u) => {
1587
- o.push(/* @__PURE__ */ l.jsx(un, { child: u, three: t.three }, Math.random()));
1588
- }), /* @__PURE__ */ l.jsxs("div", { className: "childObject", children: [
1589
- /* @__PURE__ */ l.jsxs("div", { className: "child", children: [
1590
- e ? /* @__PURE__ */ l.jsx(
1514
+ function vn(t) {
1515
+ const [n, i] = ae(!1), e = t.child.children.length > 0, a = [];
1516
+ return t.child.children.length > 0 && t.child.children.map((s) => {
1517
+ a.push(/* @__PURE__ */ c.jsx(vn, { child: s, three: t.three }, Math.random()));
1518
+ }), /* @__PURE__ */ c.jsxs("div", { className: "childObject", children: [
1519
+ /* @__PURE__ */ c.jsxs("div", { className: "child", children: [
1520
+ e ? /* @__PURE__ */ c.jsx(
1591
1521
  "button",
1592
1522
  {
1593
1523
  className: "status",
@@ -1595,11 +1525,11 @@ function un(t) {
1595
1525
  backgroundPositionX: n ? "-14px" : "2px"
1596
1526
  },
1597
1527
  onClick: () => {
1598
- a(!n);
1528
+ i(!n);
1599
1529
  }
1600
1530
  }
1601
1531
  ) : null,
1602
- /* @__PURE__ */ l.jsx(
1532
+ /* @__PURE__ */ c.jsx(
1603
1533
  "button",
1604
1534
  {
1605
1535
  className: "name",
@@ -1612,32 +1542,32 @@ function un(t) {
1612
1542
  children: t.child.name.length > 0 ? `${t.child.name} (${t.child.type})` : `${t.child.type}::${t.child.uuid}`
1613
1543
  }
1614
1544
  ),
1615
- /* @__PURE__ */ l.jsx("div", { className: `icon ${Hn(t.child)}` })
1545
+ /* @__PURE__ */ c.jsx("div", { className: `icon ${ti(t.child)}` })
1616
1546
  ] }),
1617
- /* @__PURE__ */ l.jsx("div", { className: n ? "open" : "", children: /* @__PURE__ */ l.jsx("div", { className: "container", children: o }) })
1547
+ /* @__PURE__ */ c.jsx("div", { className: n ? "open" : "", children: /* @__PURE__ */ c.jsx("div", { className: "container", children: a }) })
1618
1548
  ] }, Math.random());
1619
1549
  }
1620
- function fa(t) {
1550
+ function yi(t) {
1621
1551
  const n = [];
1622
- return t.child.children.map((a) => {
1623
- n.push(/* @__PURE__ */ l.jsx(un, { child: a, three: t.three }, Math.random()));
1624
- }), /* @__PURE__ */ l.jsx("div", { className: `scene ${t.class !== void 0 ? t.class : ""}`, children: n });
1552
+ return t.child.children.map((i) => {
1553
+ n.push(/* @__PURE__ */ c.jsx(vn, { child: i, three: t.three }, Math.random()));
1554
+ }), /* @__PURE__ */ c.jsx("div", { className: `scene ${t.class !== void 0 ? t.class : ""}`, children: n });
1625
1555
  }
1626
- const ha = "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAADIAAAAyCAYAAAAeP4ixAAAACXBIWXMAAAsTAAALEwEAmpwYAAAA5klEQVRoge2Y0Q6EIAwE6cX//+X6cCFpSMEKVTdk501OpRNKiyelFC0b8Ps6gCwoggZF0KAIGhRBgyJoUAQNiqCxjciR9SLV//eZiAyvK3U8i/QVaQO2YyLSFVvlkdTKDjJCukh2ykR5ZEW+kHmlatl90RaBtDkK/w7CYhuRUEO0ee3l+J3m55Vm+17vtwjTnV1V3QA8qfbeUXCzRWDpiLLS+OyzvRW7IzW9R+okvclsqR09743bo0yUpc1+lSJvNsa002+Euk9GKzV7SmZDRIMiaFAEDYqgQRE0KIIGRdCgCBoUQeMEMERadX7YUz8AAAAASUVORK5CYII=";
1627
- function pa(t) {
1556
+ const Ei = "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAADIAAAAyCAYAAAAeP4ixAAAACXBIWXMAAAsTAAALEwEAmpwYAAAA5klEQVRoge2Y0Q6EIAwE6cX//+X6cCFpSMEKVTdk501OpRNKiyelFC0b8Ps6gCwoggZF0KAIGhRBgyJoUAQNiqCxjciR9SLV//eZiAyvK3U8i/QVaQO2YyLSFVvlkdTKDjJCukh2ykR5ZEW+kHmlatl90RaBtDkK/w7CYhuRUEO0ee3l+J3m55Vm+17vtwjTnV1V3QA8qfbeUXCzRWDpiLLS+OyzvRW7IzW9R+okvclsqR09743bo0yUpc1+lSJvNsa002+Euk9GKzV7SmZDRIMiaFAEDYqgQRE0KIIGRdCgCBoUQeMEMERadX7YUz8AAAAASUVORK5CYII=";
1557
+ function xi(t) {
1628
1558
  return "items" in t;
1629
1559
  }
1630
- function $e(t) {
1631
- function n(e, o) {
1632
- console.log("onChange:", e, o);
1560
+ function Le(t) {
1561
+ function n(e, a) {
1562
+ console.log("onChange:", e, a);
1633
1563
  }
1634
- const a = [];
1564
+ const i = [];
1635
1565
  return t.items.forEach((e) => {
1636
- pa(e) ? a.push(
1637
- /* @__PURE__ */ l.jsx($e, { title: e.title, items: e.items }, Math.random())
1638
- ) : a.push(
1639
- /* @__PURE__ */ l.jsx(
1640
- et,
1566
+ xi(e) ? i.push(
1567
+ /* @__PURE__ */ c.jsx(Le, { title: e.title, items: e.items }, Math.random())
1568
+ ) : i.push(
1569
+ /* @__PURE__ */ c.jsx(
1570
+ nt,
1641
1571
  {
1642
1572
  title: e.title,
1643
1573
  prop: e.prop,
@@ -1647,19 +1577,19 @@ function $e(t) {
1647
1577
  max: e.max,
1648
1578
  step: e.step,
1649
1579
  disabled: e.disabled,
1650
- onChange: (o, u) => {
1651
- e.onChange !== void 0 ? e.onChange(o, u) : n(o, u);
1580
+ onChange: (a, s) => {
1581
+ e.onChange !== void 0 ? e.onChange(a, s) : n(a, s);
1652
1582
  }
1653
1583
  },
1654
1584
  Math.random()
1655
1585
  )
1656
1586
  );
1657
- }), /* @__PURE__ */ l.jsx(jt, { label: t.title, open: !1, children: a });
1587
+ }), /* @__PURE__ */ c.jsx(Nt, { label: t.title, open: !1, children: i });
1658
1588
  }
1659
- function ma(t) {
1589
+ function wi(t) {
1660
1590
  return !(t === "alphaHash" || t === "alphaToCoverage" || t === "attenuationDistance" || t === "colorWrite" || t === "combine" || t === "defaultAttributeValues" || t === "depthFunc" || t === "forceSinglePass" || t === "glslVersion" || t === "linewidth" || t === "normalMapType" || t === "precision" || t === "premultipliedAlpha" || t === "shadowSide" || t === "side" || t === "toneMapped" || t === "uniformsGroups" || t === "uniformsNeedUpdate" || t === "userData" || t === "vertexColors" || t === "version" || t === "wireframeLinecap" || t === "wireframeLinejoin" || t === "wireframeLinewidth" || t.slice(0, 5) === "blend" || t.slice(0, 4) === "clip" || t.slice(0, 7) === "polygon" || t.slice(0, 7) === "stencil" || t.slice(0, 2) === "is");
1661
1591
  }
1662
- function Oe(t) {
1592
+ function De(t) {
1663
1593
  switch (t) {
1664
1594
  case "alphaMap":
1665
1595
  return "Alpha Map";
@@ -1808,271 +1738,271 @@ function Oe(t) {
1808
1738
  }
1809
1739
  return t;
1810
1740
  }
1811
- function ga(t) {
1741
+ function Ci(t) {
1812
1742
  return t.toLowerCase().search("intensity") > -1 || t === "anisotropyRotation" || t === "bumpScale" || t === "clearcoatRoughness" || t === "displacementBias" || t === "displacementScale" || t === "metalness" || t === "opacity" || t === "reflectivity" || t === "refractionRatio" || t === "roughness" || t === "sheenRoughness" || t === "thickness";
1813
1743
  }
1814
- function va() {
1744
+ function Si() {
1815
1745
  const t = document.createElement("input");
1816
- return t.type = "file", new Promise((n, a) => {
1746
+ return t.type = "file", new Promise((n, i) => {
1817
1747
  t.addEventListener("change", function() {
1818
1748
  if (t.files === null)
1819
- a();
1749
+ i();
1820
1750
  else {
1821
- const e = t.files[0], o = new FileReader();
1822
- o.onload = function(u) {
1823
- n(u.target.result);
1824
- }, o.readAsDataURL(e);
1751
+ const e = t.files[0], a = new FileReader();
1752
+ a.onload = function(s) {
1753
+ n(s.target.result);
1754
+ }, a.readAsDataURL(e);
1825
1755
  }
1826
1756
  }), t.click();
1827
1757
  });
1828
1758
  }
1829
- function Vt(t, n, a) {
1759
+ function Ht(t, n, i) {
1830
1760
  const e = [];
1831
- for (const o in t) {
1832
- if (!ma(o))
1761
+ for (const a in t) {
1762
+ if (!wi(a))
1833
1763
  continue;
1834
- const u = typeof t[o], c = t[o];
1835
- if (u === "boolean" || u === "number" || u === "string") {
1836
- const s = {
1837
- title: Oe(o),
1838
- prop: o,
1839
- type: u,
1840
- value: c,
1764
+ const s = typeof t[a], h = t[a];
1765
+ if (s === "boolean" || s === "number" || s === "string") {
1766
+ const l = {
1767
+ title: De(a),
1768
+ prop: a,
1769
+ type: s,
1770
+ value: h,
1841
1771
  min: void 0,
1842
1772
  max: void 0,
1843
- onChange: (d, p) => {
1844
- var b;
1845
- a.updateObject(n.uuid, `material.${d}`, p), u === "boolean" && a.updateObject(n.uuid, "material.needsUpdate", !0);
1846
- const h = (b = a.scene) == null ? void 0 : b.getObjectByProperty("uuid", n.uuid);
1847
- h !== void 0 && q(h, `material.${d}`, p);
1773
+ onChange: (d, m) => {
1774
+ var E;
1775
+ i.updateObject(n.uuid, `material.${d}`, m), s === "boolean" && i.updateObject(n.uuid, "material.needsUpdate", !0);
1776
+ const v = (E = i.scene) == null ? void 0 : E.getObjectByProperty("uuid", n.uuid);
1777
+ v !== void 0 && J(v, `material.${d}`, m);
1848
1778
  }
1849
1779
  };
1850
- ga(o) && (s.value = Number(c), s.type = "range", s.min = 0, s.max = 1, s.step = 0.01), e.push(s);
1851
- } else if (u === "object")
1852
- if (c.isColor)
1780
+ Ci(a) && (l.value = Number(h), l.type = "range", l.min = 0, l.max = 1, l.step = 0.01), e.push(l);
1781
+ } else if (s === "object")
1782
+ if (h.isColor)
1853
1783
  e.push({
1854
- title: Oe(o),
1855
- prop: o,
1784
+ title: De(a),
1785
+ prop: a,
1856
1786
  type: "color",
1857
- value: c,
1858
- onChange: (s, d) => {
1859
- var b;
1860
- const p = new kt(d);
1861
- a.updateObject(n.uuid, `material.${s}`, p);
1862
- const h = (b = a.scene) == null ? void 0 : b.getObjectByProperty("uuid", n.uuid);
1863
- h !== void 0 && q(h, `material.${s}`, p);
1787
+ value: h,
1788
+ onChange: (l, d) => {
1789
+ var E;
1790
+ const m = new It(d);
1791
+ i.updateObject(n.uuid, `material.${l}`, m);
1792
+ const v = (E = i.scene) == null ? void 0 : E.getObjectByProperty("uuid", n.uuid);
1793
+ v !== void 0 && J(v, `material.${l}`, m);
1864
1794
  }
1865
1795
  });
1866
- else if (Array.isArray(c)) {
1867
- const s = [];
1868
- for (const d in c)
1869
- s.push({
1796
+ else if (Array.isArray(h)) {
1797
+ const l = [];
1798
+ for (const d in h)
1799
+ l.push({
1870
1800
  title: `${d}`,
1871
- type: `${typeof c[d]}`,
1872
- value: c[d],
1873
- onChange: (p, h) => {
1801
+ type: `${typeof h[d]}`,
1802
+ value: h[d],
1803
+ onChange: (m, v) => {
1874
1804
  var x;
1875
- a.updateObject(n.uuid, `material.${o}`, h);
1876
- const b = (x = a.scene) == null ? void 0 : x.getObjectByProperty("uuid", n.uuid);
1877
- b !== void 0 && q(b, `material.${o}`, h);
1805
+ i.updateObject(n.uuid, `material.${a}`, v);
1806
+ const E = (x = i.scene) == null ? void 0 : x.getObjectByProperty("uuid", n.uuid);
1807
+ E !== void 0 && J(E, `material.${a}`, v);
1878
1808
  }
1879
1809
  });
1880
1810
  e.push({
1881
- title: Oe(o),
1882
- items: s
1811
+ title: De(a),
1812
+ items: l
1883
1813
  });
1884
1814
  } else {
1885
- const s = [];
1886
- for (const d in c) {
1887
- const p = c[d];
1888
- switch (typeof p) {
1815
+ const l = [];
1816
+ for (const d in h) {
1817
+ const m = h[d];
1818
+ switch (typeof m) {
1889
1819
  case "boolean":
1890
1820
  case "number":
1891
1821
  case "string":
1892
1822
  d === "src" ? e.push({
1893
- title: Oe(o),
1823
+ title: De(a),
1894
1824
  type: "image",
1895
- value: p,
1896
- onChange: (b, x) => {
1897
- var O;
1898
- a.createTexture(n.uuid, `material.${o}`, x);
1899
- const S = (O = a.scene) == null ? void 0 : O.getObjectByProperty("uuid", n.uuid);
1900
- S !== void 0 && Mt(x).then((m) => {
1901
- q(S, `material.${o}`, m), q(S, "material.needsUpdate", !0);
1825
+ value: m,
1826
+ onChange: (E, x) => {
1827
+ var T;
1828
+ i.createTexture(n.uuid, `material.${a}`, x);
1829
+ const R = (T = i.scene) == null ? void 0 : T.getObjectByProperty("uuid", n.uuid);
1830
+ R !== void 0 && kt(x).then((B) => {
1831
+ J(R, `material.${a}`, B), J(R, "material.needsUpdate", !0);
1902
1832
  });
1903
1833
  }
1904
- }) : s.push({
1905
- title: `${Oe(d)}`,
1906
- prop: `material.${o}.${d}`,
1907
- type: `${typeof t[o][d]}`,
1908
- value: c[d],
1909
- onChange: (b, x) => {
1910
- var O;
1911
- a.updateObject(n.uuid, `material.${o}.${d}`, x);
1912
- const S = (O = a.scene) == null ? void 0 : O.getObjectByProperty("uuid", n.uuid);
1913
- S !== void 0 && q(S, `material.${o}.${d}`, x);
1834
+ }) : l.push({
1835
+ title: `${De(d)}`,
1836
+ prop: `material.${a}.${d}`,
1837
+ type: `${typeof t[a][d]}`,
1838
+ value: h[d],
1839
+ onChange: (E, x) => {
1840
+ var T;
1841
+ i.updateObject(n.uuid, `material.${a}.${d}`, x);
1842
+ const R = (T = i.scene) == null ? void 0 : T.getObjectByProperty("uuid", n.uuid);
1843
+ R !== void 0 && J(R, `material.${a}.${d}`, x);
1914
1844
  }
1915
1845
  });
1916
1846
  break;
1917
1847
  case "object":
1918
- p.value !== void 0 && p.value.src !== void 0 ? s.push({
1919
- title: Oe(d),
1848
+ m.value !== void 0 && m.value.src !== void 0 ? l.push({
1849
+ title: De(d),
1920
1850
  type: "image",
1921
- value: p.value.src,
1922
- onChange: (b, x) => {
1923
- var O;
1924
- a.createTexture(n.uuid, `material.${o}.${d}.value`, x);
1925
- const S = (O = a.scene) == null ? void 0 : O.getObjectByProperty("uuid", n.uuid);
1926
- S !== void 0 && Mt(x).then((m) => {
1927
- q(S, `material.${o}.${d}.value`, m);
1851
+ value: m.value.src,
1852
+ onChange: (E, x) => {
1853
+ var T;
1854
+ i.createTexture(n.uuid, `material.${a}.${d}.value`, x);
1855
+ const R = (T = i.scene) == null ? void 0 : T.getObjectByProperty("uuid", n.uuid);
1856
+ R !== void 0 && kt(x).then((B) => {
1857
+ J(R, `material.${a}.${d}.value`, B);
1928
1858
  });
1929
1859
  }
1930
- }) : s.push({
1860
+ }) : l.push({
1931
1861
  title: d,
1932
- type: `${typeof p.value}`,
1933
- value: p.value,
1934
- onChange: (b, x) => {
1935
- var O;
1936
- a.updateObject(n.uuid, `material.${o}.${d}.value`, x);
1937
- const S = (O = a.scene) == null ? void 0 : O.getObjectByProperty("uuid", n.uuid);
1938
- S !== void 0 && q(S, `material.${o}.${d}.value`, x);
1862
+ type: `${typeof m.value}`,
1863
+ value: m.value,
1864
+ onChange: (E, x) => {
1865
+ var T;
1866
+ i.updateObject(n.uuid, `material.${a}.${d}.value`, x);
1867
+ const R = (T = i.scene) == null ? void 0 : T.getObjectByProperty("uuid", n.uuid);
1868
+ R !== void 0 && J(R, `material.${a}.${d}.value`, x);
1939
1869
  }
1940
1870
  });
1941
1871
  break;
1942
1872
  }
1943
1873
  }
1944
- s.length > 0 && e.push({
1945
- title: Oe(o),
1946
- items: s
1874
+ l.length > 0 && e.push({
1875
+ title: De(a),
1876
+ items: l
1947
1877
  });
1948
1878
  }
1949
1879
  else
1950
- c !== void 0 && console.log("other:", o, u, c);
1880
+ h !== void 0 && console.log("other:", a, s, h);
1951
1881
  }
1952
- return e.sort((o, u) => o.title < u.title ? -1 : o.title > u.title ? 1 : 0), e.push({
1882
+ return e.sort((a, s) => a.title < s.title ? -1 : a.title > s.title ? 1 : 0), e.push({
1953
1883
  title: "Update Material",
1954
1884
  type: "button",
1955
1885
  onChange: () => {
1956
- a.updateObject(n.uuid, "material.needsUpdate", !0);
1886
+ i.updateObject(n.uuid, "material.needsUpdate", !0);
1957
1887
  }
1958
1888
  }), e;
1959
1889
  }
1960
- function ba(t, n) {
1961
- const a = t.material;
1962
- if (Array.isArray(a)) {
1963
- const e = [], o = a.length;
1964
- for (let u = 0; u < o; u++)
1890
+ function Oi(t, n) {
1891
+ const i = t.material;
1892
+ if (Array.isArray(i)) {
1893
+ const e = [], a = i.length;
1894
+ for (let s = 0; s < a; s++)
1965
1895
  e.push(
1966
- /* @__PURE__ */ l.jsx(
1967
- $e,
1896
+ /* @__PURE__ */ c.jsx(
1897
+ Le,
1968
1898
  {
1969
- title: `Material ${u}`,
1970
- items: Vt(a[u], t, n)
1899
+ title: `Material ${s}`,
1900
+ items: Ht(i[s], t, n)
1971
1901
  },
1972
- `Material ${u}`
1902
+ `Material ${s}`
1973
1903
  )
1974
1904
  );
1975
- return /* @__PURE__ */ l.jsx(l.Fragment, { children: e });
1905
+ return /* @__PURE__ */ c.jsx(c.Fragment, { children: e });
1976
1906
  } else
1977
- return /* @__PURE__ */ l.jsx(
1978
- $e,
1907
+ return /* @__PURE__ */ c.jsx(
1908
+ Le,
1979
1909
  {
1980
1910
  title: "Material",
1981
- items: Vt(a, t, n)
1911
+ items: Ht(i, t, n)
1982
1912
  }
1983
1913
  );
1984
1914
  }
1985
- function et(t) {
1915
+ function nt(t) {
1986
1916
  let n = t.value;
1987
- n !== void 0 && n.isColor !== void 0 && (n = Yn(t.value));
1988
- const [a, e] = ne(n), o = ye(null), u = ye(null), c = ye(null);
1989
- Be(() => {
1990
- var F;
1991
- let h = !1, b = -1, x = 0, S = Number(a);
1992
- const O = (V) => {
1993
- h = !0, x = S, b = V.clientX;
1994
- }, m = (V) => {
1995
- if (!h)
1917
+ n !== void 0 && n.isColor !== void 0 && (n = Qn(t.value));
1918
+ const [i, e] = ae(n), a = we(null), s = we(null), h = we(null);
1919
+ Ne(() => {
1920
+ var K;
1921
+ let v = !1, E = -1, x = 0, R = Number(i);
1922
+ const T = (de) => {
1923
+ v = !0, x = R, E = de.clientX;
1924
+ }, B = (de) => {
1925
+ if (!v)
1996
1926
  return;
1997
- const Z = t.step !== void 0 ? t.step : 1, se = (V.clientX - b) * Z;
1998
- S = Number((x + se).toFixed(4)), u.current !== null && (u.current.value = S.toString()), t.onChange !== void 0 && t.onChange(t.prop !== void 0 ? t.prop : t.title, S);
1999
- }, v = () => {
2000
- h = !1;
2001
- }, y = () => {
2002
- h = !1;
2003
- }, w = t.type === "number";
2004
- return w && ((F = o.current) == null || F.addEventListener("mousedown", O, !1), document.addEventListener("mouseup", v, !1), document.addEventListener("mousemove", m, !1), document.addEventListener("contextmenu", y, !1)), () => {
2005
- var V;
2006
- w && ((V = o.current) == null || V.removeEventListener("mousedown", O), document.removeEventListener("mouseup", v), document.removeEventListener("mousemove", m), document.removeEventListener("contextmenu", y));
1927
+ const ce = t.step !== void 0 ? t.step : 1, ee = (de.clientX - E) * ce;
1928
+ R = Number((x + ee).toFixed(4)), s.current !== null && (s.current.value = R.toString()), t.onChange !== void 0 && t.onChange(t.prop !== void 0 ? t.prop : t.title, R);
1929
+ }, oe = () => {
1930
+ v = !1;
1931
+ }, H = () => {
1932
+ v = !1;
1933
+ }, C = t.type === "number";
1934
+ return C && ((K = a.current) == null || K.addEventListener("mousedown", T, !1), document.addEventListener("mouseup", oe, !1), document.addEventListener("mousemove", B, !1), document.addEventListener("contextmenu", H, !1)), () => {
1935
+ var de;
1936
+ C && ((de = a.current) == null || de.removeEventListener("mousedown", T), document.removeEventListener("mouseup", oe), document.removeEventListener("mousemove", B), document.removeEventListener("contextmenu", H));
2007
1937
  };
2008
- }, [a]);
2009
- const s = t.type === "string" && (a.length > 100 || a.search(`
2010
- `) > -1), d = s || t.type === "image", p = (h) => {
2011
- let b = h.target.value;
2012
- t.type === "boolean" && (b = h.target.checked), e(b), t.onChange !== void 0 && t.onChange(t.prop !== void 0 ? t.prop : t.title, b);
1938
+ }, [i]);
1939
+ const l = t.type === "string" && (i.length > 100 || i.search(`
1940
+ `) > -1), d = l || t.type === "image", m = (v) => {
1941
+ let E = v.target.value;
1942
+ t.type === "boolean" && (E = v.target.checked), e(E), t.onChange !== void 0 && t.onChange(t.prop !== void 0 ? t.prop : t.title, E);
2013
1943
  };
2014
- return /* @__PURE__ */ l.jsxs("div", { className: `field ${d ? "block" : ""}`, children: [
2015
- t.type !== "button" && /* @__PURE__ */ l.jsx("label", { ref: o, children: t.title }, "fieldLabel"),
2016
- t.type === "string" && !s && /* @__PURE__ */ l.jsx(
1944
+ return /* @__PURE__ */ c.jsxs("div", { className: `field ${d ? "block" : ""}`, children: [
1945
+ t.type !== "button" && /* @__PURE__ */ c.jsx("label", { ref: a, children: t.title }, "fieldLabel"),
1946
+ t.type === "string" && !l && /* @__PURE__ */ c.jsx(
2017
1947
  "input",
2018
1948
  {
2019
1949
  type: "text",
2020
1950
  disabled: t.disabled,
2021
- onChange: p,
2022
- value: a
1951
+ onChange: m,
1952
+ value: i
2023
1953
  }
2024
1954
  ),
2025
- t.type === "string" && s && /* @__PURE__ */ l.jsx(
1955
+ t.type === "string" && l && /* @__PURE__ */ c.jsx(
2026
1956
  "textarea",
2027
1957
  {
2028
1958
  cols: 50,
2029
1959
  rows: 10,
2030
1960
  disabled: !0,
2031
- onChange: p,
2032
- value: a
1961
+ onChange: m,
1962
+ value: i
2033
1963
  }
2034
1964
  ),
2035
- t.type === "boolean" && /* @__PURE__ */ l.jsx(
1965
+ t.type === "boolean" && /* @__PURE__ */ c.jsx(
2036
1966
  "input",
2037
1967
  {
2038
1968
  type: "checkbox",
2039
1969
  disabled: t.disabled,
2040
- onChange: p,
2041
- checked: a
1970
+ onChange: m,
1971
+ checked: i
2042
1972
  }
2043
1973
  ),
2044
- t.type === "number" && /* @__PURE__ */ l.jsx(
1974
+ t.type === "number" && /* @__PURE__ */ c.jsx(
2045
1975
  "input",
2046
1976
  {
2047
- ref: u,
1977
+ ref: s,
2048
1978
  type: "number",
2049
- value: a,
1979
+ value: i,
2050
1980
  min: t.min,
2051
1981
  max: t.max,
2052
1982
  step: t.step,
2053
- onChange: p
1983
+ onChange: m
2054
1984
  }
2055
1985
  ),
2056
- t.type === "range" && /* @__PURE__ */ l.jsxs(l.Fragment, { children: [
2057
- /* @__PURE__ */ l.jsx("input", { type: "text", value: a.toString(), onChange: p, className: "min" }),
2058
- /* @__PURE__ */ l.jsx(
1986
+ t.type === "range" && /* @__PURE__ */ c.jsxs(c.Fragment, { children: [
1987
+ /* @__PURE__ */ c.jsx("input", { type: "text", value: i.toString(), onChange: m, className: "min" }),
1988
+ /* @__PURE__ */ c.jsx(
2059
1989
  "input",
2060
1990
  {
2061
1991
  disabled: t.disabled,
2062
1992
  type: "range",
2063
- value: a,
1993
+ value: i,
2064
1994
  min: t.min,
2065
1995
  max: t.max,
2066
1996
  step: t.step,
2067
- onChange: p
1997
+ onChange: m
2068
1998
  }
2069
1999
  )
2070
2000
  ] }),
2071
- t.type === "color" && /* @__PURE__ */ l.jsxs(l.Fragment, { children: [
2072
- /* @__PURE__ */ l.jsx("input", { type: "text", value: a.toString(), onChange: p, className: "color" }),
2073
- /* @__PURE__ */ l.jsx("input", { type: "color", value: a, onChange: p })
2001
+ t.type === "color" && /* @__PURE__ */ c.jsxs(c.Fragment, { children: [
2002
+ /* @__PURE__ */ c.jsx("input", { type: "text", value: i.toString(), onChange: m, className: "color" }),
2003
+ /* @__PURE__ */ c.jsx("input", { type: "color", value: i, onChange: m })
2074
2004
  ] }),
2075
- t.type === "button" && /* @__PURE__ */ l.jsx(
2005
+ t.type === "button" && /* @__PURE__ */ c.jsx(
2076
2006
  "button",
2077
2007
  {
2078
2008
  onClick: () => {
@@ -2081,14 +2011,14 @@ function et(t) {
2081
2011
  children: t.title
2082
2012
  }
2083
2013
  ),
2084
- t.type === "image" && /* @__PURE__ */ l.jsx("img", { ref: c, onClick: () => {
2085
- va().then((h) => {
2086
- c.current.src = h, t.onChange !== void 0 && t.onChange(t.prop !== void 0 ? t.prop : t.title, h);
2014
+ t.type === "image" && /* @__PURE__ */ c.jsx("img", { ref: h, onClick: () => {
2015
+ Si().then((v) => {
2016
+ h.current.src = v, t.onChange !== void 0 && t.onChange(t.prop !== void 0 ? t.prop : t.title, v);
2087
2017
  });
2088
- }, src: a.length > 0 ? a : ha })
2018
+ }, src: i.length > 0 ? i : Ei })
2089
2019
  ] });
2090
2020
  }
2091
- function Yt(t) {
2021
+ function Kt(t) {
2092
2022
  switch (t) {
2093
2023
  case "fov":
2094
2024
  return "FOV";
@@ -2117,68 +2047,71 @@ function Yt(t) {
2117
2047
  }
2118
2048
  return t;
2119
2049
  }
2120
- function ya(t, n) {
2121
- const a = [];
2050
+ function Ti(t, n) {
2051
+ const i = [];
2122
2052
  if (t.perspectiveCameraInfo !== void 0)
2123
2053
  for (const e in t.perspectiveCameraInfo)
2124
- a.push({
2125
- title: Yt(e),
2054
+ i.push({
2055
+ title: Kt(e),
2126
2056
  prop: e,
2127
2057
  type: "number",
2128
2058
  step: 0.01,
2129
2059
  value: t.perspectiveCameraInfo[e],
2130
- onChange: (o, u) => {
2131
- var s;
2132
- n.updateObject(t.uuid, o, u), n.requestMethod(t.uuid, "updateProjectionMatrix");
2133
- const c = (s = n.scene) == null ? void 0 : s.getObjectByProperty("uuid", t.uuid);
2134
- c !== void 0 && (q(c, o, u), c.updateProjectionMatrix());
2060
+ onChange: (a, s) => {
2061
+ var l;
2062
+ n.updateObject(t.uuid, a, s), n.requestMethod(t.uuid, "updateProjectionMatrix");
2063
+ const h = (l = n.scene) == null ? void 0 : l.getObjectByProperty("uuid", t.uuid);
2064
+ h !== void 0 && (J(h, a, s), h.updateProjectionMatrix());
2135
2065
  }
2136
2066
  });
2137
2067
  else if (t.orthographicCameraInfo !== void 0)
2138
2068
  for (const e in t.orthographicCameraInfo)
2139
- a.push({
2140
- title: Yt(e),
2069
+ i.push({
2070
+ title: Kt(e),
2141
2071
  prop: e,
2142
2072
  type: "number",
2143
2073
  step: 0.01,
2144
2074
  value: t.perspectiveCameraInfo[e],
2145
- onChange: (o, u) => {
2146
- var s;
2147
- n.updateObject(t.uuid, o, u), n.requestMethod(t.uuid, "updateProjectionMatrix");
2148
- const c = (s = n.scene) == null ? void 0 : s.getObjectByProperty("uuid", t.uuid);
2149
- c !== void 0 && (q(c, o, u), c.updateProjectionMatrix());
2075
+ onChange: (a, s) => {
2076
+ var l;
2077
+ n.updateObject(t.uuid, a, s), n.requestMethod(t.uuid, "updateProjectionMatrix");
2078
+ const h = (l = n.scene) == null ? void 0 : l.getObjectByProperty("uuid", t.uuid);
2079
+ h !== void 0 && (J(h, a, s), h.updateProjectionMatrix());
2150
2080
  }
2151
2081
  });
2152
- return /* @__PURE__ */ l.jsx(
2153
- $e,
2082
+ return /* @__PURE__ */ c.jsx(
2083
+ Le,
2154
2084
  {
2155
2085
  title: "Camera",
2156
- items: a
2086
+ items: i
2157
2087
  }
2158
2088
  );
2159
2089
  }
2160
- const Ea = Math.PI / 180, xa = 180 / Math.PI;
2161
- function wa(t) {
2162
- return t * Ea;
2090
+ const Mi = Math.PI / 180, Ri = 180 / Math.PI;
2091
+ function We(t, n, i, e, a) {
2092
+ return e + (t - n) * (a - e) / (i - n);
2093
+ }
2094
+ function Pi(t) {
2095
+ return t * Mi;
2163
2096
  }
2164
- function St(t) {
2165
- return t * xa;
2097
+ function Pt(t) {
2098
+ return t * Ri;
2166
2099
  }
2167
- function Ca(t, n) {
2168
- const a = new Tn();
2169
- a.elements = t.matrix;
2170
- const e = new L(), o = new Rn(), u = new L();
2171
- t.uuid.length > 0 && (e.setFromMatrixPosition(a), o.setFromRotationMatrix(a), u.setFromMatrixScale(a));
2172
- const c = (d, p) => {
2173
- var b;
2174
- n.updateObject(t.uuid, d, p);
2175
- const h = (b = n.scene) == null ? void 0 : b.getObjectByProperty("uuid", t.uuid);
2176
- h !== void 0 && q(h, d, p);
2177
- }, s = (d, p) => {
2178
- c(d, wa(p));
2100
+ function ji(t, n) {
2101
+ const i = new kn();
2102
+ i.elements = t.matrix;
2103
+ const e = new G(), a = new An(), s = new G();
2104
+ t.uuid.length > 0 && (e.setFromMatrixPosition(i), a.setFromRotationMatrix(i), s.setFromMatrixScale(i));
2105
+ const h = (d, m) => {
2106
+ var E;
2107
+ n.updateObject(t.uuid, d, m);
2108
+ const v = (E = n.scene) == null ? void 0 : E.getObjectByProperty("uuid", t.uuid);
2109
+ v !== void 0 && J(v, d, m);
2110
+ }, l = (d, m) => {
2111
+ h(d, Pi(m));
2179
2112
  };
2180
- return /* @__PURE__ */ l.jsx(
2181
- $e,
2113
+ return /* @__PURE__ */ c.jsx(
2114
+ Le,
2182
2115
  {
2183
2116
  title: "Transform",
2184
2117
  items: [
@@ -2187,81 +2120,81 @@ function Ca(t, n) {
2187
2120
  prop: "position.x",
2188
2121
  type: "number",
2189
2122
  value: e.x,
2190
- onChange: c
2123
+ onChange: h
2191
2124
  },
2192
2125
  {
2193
2126
  title: "Position Y",
2194
2127
  prop: "position.y",
2195
2128
  type: "number",
2196
2129
  value: e.y,
2197
- onChange: c
2130
+ onChange: h
2198
2131
  },
2199
2132
  {
2200
2133
  title: "Position Z",
2201
2134
  prop: "position.z",
2202
2135
  type: "number",
2203
2136
  value: e.z,
2204
- onChange: c
2137
+ onChange: h
2205
2138
  },
2206
2139
  {
2207
2140
  title: "Rotation X",
2208
2141
  prop: "rotation.x",
2209
2142
  type: "number",
2210
- value: Ct(St(o.x)),
2143
+ value: Mt(Pt(a.x)),
2211
2144
  min: -360,
2212
2145
  max: 360,
2213
2146
  step: 0.1,
2214
- onChange: s
2147
+ onChange: l
2215
2148
  },
2216
2149
  {
2217
2150
  title: "Rotation Y",
2218
2151
  prop: "rotation.y",
2219
2152
  type: "number",
2220
- value: Ct(St(o.y)),
2153
+ value: Mt(Pt(a.y)),
2221
2154
  min: -360,
2222
2155
  max: 360,
2223
2156
  step: 0.1,
2224
- onChange: s
2157
+ onChange: l
2225
2158
  },
2226
2159
  {
2227
2160
  title: "Rotation Z",
2228
2161
  prop: "rotation.z",
2229
2162
  type: "number",
2230
- value: Ct(St(o.z)),
2163
+ value: Mt(Pt(a.z)),
2231
2164
  min: -360,
2232
2165
  max: 360,
2233
2166
  step: 0.1,
2234
- onChange: s
2167
+ onChange: l
2235
2168
  },
2236
2169
  {
2237
2170
  title: "Scale X",
2238
2171
  prop: "scale.x",
2239
2172
  type: "number",
2240
- value: u.x,
2173
+ value: s.x,
2241
2174
  step: 0.01,
2242
- onChange: c
2175
+ onChange: h
2243
2176
  },
2244
2177
  {
2245
2178
  title: "Scale Y",
2246
2179
  prop: "scale.y",
2247
2180
  type: "number",
2248
- value: u.y,
2181
+ value: s.y,
2249
2182
  step: 0.01,
2250
- onChange: c
2183
+ onChange: h
2251
2184
  },
2252
2185
  {
2253
2186
  title: "Scale Z",
2254
2187
  prop: "scale.z",
2255
2188
  type: "number",
2256
- value: u.z,
2189
+ value: s.z,
2257
2190
  step: 0.01,
2258
- onChange: c
2191
+ onChange: h
2259
2192
  }
2260
2193
  ]
2261
2194
  }
2262
2195
  );
2263
2196
  }
2264
- function zt(t) {
2197
+ function Xt(t) {
2265
2198
  switch (t) {
2266
2199
  case "color":
2267
2200
  return "Color";
@@ -2280,245 +2213,293 @@ function zt(t) {
2280
2213
  }
2281
2214
  return t;
2282
2215
  }
2283
- function Sa(t, n) {
2284
- const a = [];
2216
+ function _i(t, n) {
2217
+ const i = [];
2285
2218
  if (t.lightInfo !== void 0)
2286
2219
  for (const e in t.lightInfo) {
2287
- const o = t.lightInfo[e];
2288
- o !== void 0 && (o.isColor !== void 0 ? a.push({
2289
- title: zt(e),
2220
+ const a = t.lightInfo[e];
2221
+ a !== void 0 && (a.isColor !== void 0 ? i.push({
2222
+ title: Xt(e),
2290
2223
  prop: e,
2291
2224
  type: "color",
2292
- value: o,
2293
- onChange: (u, c) => {
2294
- var p;
2295
- const s = new kt(c);
2296
- n.updateObject(t.uuid, u, s);
2297
- const d = (p = n.scene) == null ? void 0 : p.getObjectByProperty("uuid", t.uuid);
2298
- d !== void 0 && q(d, u, s);
2225
+ value: a,
2226
+ onChange: (s, h) => {
2227
+ var m;
2228
+ const l = new It(h);
2229
+ n.updateObject(t.uuid, s, l);
2230
+ const d = (m = n.scene) == null ? void 0 : m.getObjectByProperty("uuid", t.uuid);
2231
+ d !== void 0 && J(d, s, l);
2299
2232
  }
2300
- }) : a.push({
2301
- title: zt(e),
2233
+ }) : i.push({
2234
+ title: Xt(e),
2302
2235
  prop: e,
2303
- type: typeof o,
2304
- value: o,
2305
- step: typeof o == "number" ? 0.01 : void 0,
2306
- onChange: (u, c) => {
2236
+ type: typeof a,
2237
+ value: a,
2238
+ step: typeof a == "number" ? 0.01 : void 0,
2239
+ onChange: (s, h) => {
2307
2240
  var d;
2308
- n.updateObject(t.uuid, u, c);
2309
- const s = (d = n.scene) == null ? void 0 : d.getObjectByProperty("uuid", t.uuid);
2310
- s !== void 0 && q(s, u, c);
2241
+ n.updateObject(t.uuid, s, h);
2242
+ const l = (d = n.scene) == null ? void 0 : d.getObjectByProperty("uuid", t.uuid);
2243
+ l !== void 0 && J(l, s, h);
2311
2244
  }
2312
2245
  }));
2313
2246
  }
2314
- return /* @__PURE__ */ l.jsx(
2315
- $e,
2247
+ return /* @__PURE__ */ c.jsx(
2248
+ Le,
2316
2249
  {
2317
2250
  title: "Light",
2318
- items: a
2251
+ items: i
2319
2252
  }
2320
2253
  );
2321
2254
  }
2322
- function Oa(t) {
2323
- const [n, a] = ne(-1), [e, o] = ne({
2324
- name: "",
2325
- uuid: "",
2326
- type: "",
2327
- visible: !1,
2328
- matrix: [1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1],
2329
- material: void 0,
2330
- perspectiveCameraInfo: void 0,
2331
- orthographicCameraInfo: void 0,
2332
- lightInfo: void 0
2333
- });
2334
- Be(() => {
2335
- function c(s) {
2336
- const d = s.value;
2337
- o(d), a(Date.now());
2338
- }
2339
- return I.addEventListener(N.SET_OBJECT, c), () => {
2340
- I.removeEventListener(N.SET_OBJECT, c);
2255
+ function Di(t, n) {
2256
+ const i = [];
2257
+ return t.animations.forEach((e) => {
2258
+ i.push({
2259
+ title: "Name",
2260
+ type: "string",
2261
+ prop: "name",
2262
+ value: e.name,
2263
+ disabled: !0,
2264
+ onChange: (a, s) => {
2265
+ var l;
2266
+ n.updateObject(t.uuid, a, s);
2267
+ const h = (l = n.scene) == null ? void 0 : l.getObjectByProperty("uuid", t.uuid);
2268
+ h !== void 0 && J(h, a, s);
2269
+ }
2270
+ }), i.push({
2271
+ title: "Duration",
2272
+ type: "number",
2273
+ prop: "duration",
2274
+ value: e.duration,
2275
+ disabled: !0,
2276
+ onChange: (a, s) => {
2277
+ var l;
2278
+ n.updateObject(t.uuid, a, s);
2279
+ const h = (l = n.scene) == null ? void 0 : l.getObjectByProperty("uuid", t.uuid);
2280
+ h !== void 0 && J(h, a, s);
2281
+ }
2282
+ }), i.push({
2283
+ title: "Blend Mode",
2284
+ type: "number",
2285
+ prop: "blendMode",
2286
+ value: e.blendMode,
2287
+ disabled: !0,
2288
+ onChange: (a, s) => {
2289
+ var l;
2290
+ n.updateObject(t.uuid, a, s);
2291
+ const h = (l = n.scene) == null ? void 0 : l.getObjectByProperty("uuid", t.uuid);
2292
+ h !== void 0 && J(h, a, s);
2293
+ }
2294
+ });
2295
+ }), /* @__PURE__ */ c.jsx(Le, { title: "Animations", items: i });
2296
+ }
2297
+ const Zt = {
2298
+ name: "",
2299
+ uuid: "",
2300
+ type: "",
2301
+ visible: !1,
2302
+ matrix: [1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1],
2303
+ animations: [],
2304
+ material: void 0,
2305
+ perspectiveCameraInfo: void 0,
2306
+ orthographicCameraInfo: void 0,
2307
+ lightInfo: void 0
2308
+ };
2309
+ function ki(t) {
2310
+ const [n, i] = ae(Zt);
2311
+ Ne(() => {
2312
+ function a(h) {
2313
+ const l = h.value;
2314
+ i(l);
2315
+ }
2316
+ function s() {
2317
+ i(Zt);
2318
+ }
2319
+ return z.addEventListener(Y.SET_SCENE, s), z.addEventListener(Y.SET_OBJECT, a), () => {
2320
+ z.removeEventListener(Y.SET_SCENE, s), z.removeEventListener(Y.SET_OBJECT, a);
2341
2321
  };
2342
2322
  }, []);
2343
- const u = e.type.toLowerCase();
2344
- return /* @__PURE__ */ l.jsx("div", { id: "Inspector", className: t.class, children: e.uuid.length > 0 && /* @__PURE__ */ l.jsxs(l.Fragment, { children: [
2345
- /* @__PURE__ */ l.jsxs(l.Fragment, { children: [
2346
- /* @__PURE__ */ l.jsx(
2347
- et,
2323
+ const e = n.type.toLowerCase();
2324
+ return /* @__PURE__ */ c.jsx(Nt, { label: "Inspector", children: /* @__PURE__ */ c.jsx("div", { id: "Inspector", className: t.class, children: n.uuid.length > 0 && /* @__PURE__ */ c.jsxs(c.Fragment, { children: [
2325
+ /* @__PURE__ */ c.jsxs(c.Fragment, { children: [
2326
+ /* @__PURE__ */ c.jsx(
2327
+ nt,
2348
2328
  {
2349
2329
  type: "string",
2350
2330
  title: "Name",
2351
2331
  prop: "name",
2352
- value: e.name,
2332
+ value: n.name,
2353
2333
  disabled: !0
2354
2334
  }
2355
2335
  ),
2356
- /* @__PURE__ */ l.jsx(
2357
- et,
2336
+ /* @__PURE__ */ c.jsx(
2337
+ nt,
2358
2338
  {
2359
2339
  type: "string",
2360
2340
  title: "Type",
2361
2341
  prop: "type",
2362
- value: e.type,
2342
+ value: n.type,
2363
2343
  disabled: !0
2364
2344
  }
2365
2345
  ),
2366
- /* @__PURE__ */ l.jsx(
2367
- et,
2346
+ /* @__PURE__ */ c.jsx(
2347
+ nt,
2368
2348
  {
2369
2349
  type: "string",
2370
2350
  title: "UUID",
2371
2351
  prop: "uuid",
2372
- value: e.uuid,
2352
+ value: n.uuid,
2373
2353
  disabled: !0
2374
2354
  }
2375
2355
  ),
2376
- /* @__PURE__ */ l.jsx(
2377
- et,
2356
+ /* @__PURE__ */ c.jsx(
2357
+ nt,
2378
2358
  {
2379
2359
  type: "boolean",
2380
2360
  title: "Visible",
2381
2361
  prop: "visible",
2382
- value: e.visible,
2383
- onChange: (c, s) => {
2384
- var p;
2385
- t.three.updateObject(e.uuid, c, s);
2386
- const d = (p = t.three.scene) == null ? void 0 : p.getObjectByProperty("uuid", e.uuid);
2387
- d !== void 0 && q(d, c, s);
2362
+ value: n.visible,
2363
+ onChange: (a, s) => {
2364
+ var l;
2365
+ t.three.updateObject(n.uuid, a, s);
2366
+ const h = (l = t.three.scene) == null ? void 0 : l.getObjectByProperty("uuid", n.uuid);
2367
+ h !== void 0 && J(h, a, s);
2388
2368
  }
2389
2369
  }
2390
2370
  )
2391
2371
  ] }),
2392
- /* @__PURE__ */ l.jsxs(l.Fragment, { children: [
2393
- Ca(e, t.three),
2394
- u.search("camera") > -1 ? ya(e, t.three) : null,
2395
- u.search("light") > -1 ? Sa(e, t.three) : null,
2396
- u.search("mesh") > -1 ? ba(e, t.three) : null
2372
+ /* @__PURE__ */ c.jsxs(c.Fragment, { children: [
2373
+ ji(n, t.three),
2374
+ n.animations.length > 0 ? Di(n, t.three) : null,
2375
+ e.search("camera") > -1 ? Ti(n, t.three) : null,
2376
+ e.search("light") > -1 ? _i(n, t.three) : null,
2377
+ e.search("mesh") > -1 ? Oi(n, t.three) : null
2397
2378
  ] })
2398
- ] }) }, n);
2379
+ ] }) }) }, "Inspector");
2399
2380
  }
2400
- class Xa extends Bn {
2401
- constructor(a) {
2402
- super(a);
2403
- $(this, "three");
2381
+ class ir extends Kn {
2382
+ constructor(i) {
2383
+ super(i);
2384
+ q(this, "three");
2404
2385
  // Private
2405
- $(this, "setScene", (a) => {
2386
+ q(this, "setScene", (i) => {
2406
2387
  this.setState(() => ({
2407
- scene: a.value
2388
+ scene: i.value
2408
2389
  }));
2409
2390
  });
2410
2391
  this.state = {
2411
- scene: a.scene !== void 0 ? a.scene : null
2412
- }, this.three = a.three, I.addEventListener(N.SET_SCENE, this.setScene);
2392
+ scene: i.scene !== void 0 ? i.scene : null
2393
+ }, this.three = i.three, z.addEventListener(Y.SET_SCENE, this.setScene);
2413
2394
  }
2414
2395
  componentWillUnmount() {
2415
- I.removeEventListener(N.SET_SCENE, this.setScene);
2396
+ z.removeEventListener(Y.SET_SCENE, this.setScene);
2416
2397
  }
2417
2398
  render() {
2418
- var o;
2419
- const a = this.componentState.scene !== null, e = "Hierarchy - " + (a ? `${(o = this.componentState.scene) == null ? void 0 : o.name}` : "No Scene");
2420
- return /* @__PURE__ */ l.jsx("div", { id: "SceneHierarchy", children: /* @__PURE__ */ l.jsxs(l.Fragment, { children: [
2421
- /* @__PURE__ */ l.jsx(jt, { label: e, open: !0, children: /* @__PURE__ */ l.jsx(l.Fragment, { children: a && /* @__PURE__ */ l.jsx(fa, { child: this.componentState.scene, three: this.three }) }) }),
2422
- /* @__PURE__ */ l.jsx(jt, { label: "Inspector", children: /* @__PURE__ */ l.jsx(Oa, { three: this.three }, "Inspector") })
2423
- ] }) }, "SceneHierarchy");
2399
+ var a;
2400
+ const i = this.componentState.scene !== null, e = "Hierarchy - " + (i ? `${(a = this.componentState.scene) == null ? void 0 : a.name}` : "No Scene");
2401
+ return /* @__PURE__ */ c.jsx("div", { id: "SidePanel", children: /* @__PURE__ */ c.jsxs(c.Fragment, { children: [
2402
+ /* @__PURE__ */ c.jsx(Nt, { label: e, open: !0, children: /* @__PURE__ */ c.jsx(c.Fragment, { children: i && /* @__PURE__ */ c.jsx(yi, { child: this.componentState.scene, three: this.three }) }) }),
2403
+ /* @__PURE__ */ c.jsx(ki, { three: this.three })
2404
+ ] }) }, "SidePanel");
2424
2405
  }
2425
2406
  // Getters / Setters
2426
2407
  get componentState() {
2427
2408
  return this.state;
2428
2409
  }
2429
2410
  }
2430
- function qa(t) {
2411
+ function rr(t) {
2431
2412
  function n() {
2432
2413
  return t.three.scene === void 0 ? (console.log("No scene:", t.three), !1) : !0;
2433
2414
  }
2434
- const a = (s) => {
2435
- var p;
2415
+ const i = (l) => {
2416
+ var m;
2436
2417
  if (!n())
2437
2418
  return;
2438
- const d = (p = t.three.scene) == null ? void 0 : p.getObjectByProperty("uuid", s.value);
2419
+ const d = (m = t.three.scene) == null ? void 0 : m.getObjectByProperty("uuid", l.value);
2439
2420
  d !== void 0 && t.three.setObject(d);
2440
- }, e = (s, d, p) => {
2441
- var b;
2421
+ }, e = (l, d, m) => {
2422
+ var E;
2442
2423
  if (!n())
2443
2424
  return;
2444
- const h = (b = t.three.scene) == null ? void 0 : b.getObjectByProperty("uuid", s);
2445
- h !== void 0 && q(h, d, p);
2446
- }, o = (s) => {
2425
+ const v = (E = t.three.scene) == null ? void 0 : E.getObjectByProperty("uuid", l);
2426
+ v !== void 0 && J(v, d, m);
2427
+ }, a = (l) => {
2447
2428
  if (!n())
2448
2429
  return;
2449
- const d = s.value, { key: p, value: h, uuid: b } = d;
2450
- e(b, p, h);
2451
- }, u = (s) => {
2430
+ const d = l.value, { key: m, value: v, uuid: E } = d;
2431
+ e(E, m, v);
2432
+ }, s = (l) => {
2452
2433
  if (!n())
2453
2434
  return;
2454
- const d = s.value;
2455
- Mt(d.value).then((p) => {
2456
- e(d.uuid, d.key, p), e(d.uuid, "material.needsUpdate", !0);
2435
+ const d = l.value;
2436
+ kt(d.value).then((m) => {
2437
+ e(d.uuid, d.key, m), e(d.uuid, "material.needsUpdate", !0);
2457
2438
  });
2458
- }, c = (s) => {
2439
+ }, h = (l) => {
2459
2440
  var x;
2460
2441
  if (!n())
2461
2442
  return;
2462
- const { key: d, uuid: p, value: h } = s.value, b = (x = t.three.scene) == null ? void 0 : x.getObjectByProperty("uuid", p);
2463
- if (b !== void 0)
2443
+ const { key: d, uuid: m, value: v } = l.value, E = (x = t.three.scene) == null ? void 0 : x.getObjectByProperty("uuid", m);
2444
+ if (E !== void 0)
2464
2445
  try {
2465
- b[d](h);
2466
- } catch (S) {
2467
- console.log("Error requesting method:"), console.log(S), console.log(d), console.log(h);
2446
+ E[d](v);
2447
+ } catch (R) {
2448
+ console.log("Error requesting method:"), console.log(R), console.log(d), console.log(v);
2468
2449
  }
2469
2450
  };
2470
- return Be(() => (I.addEventListener(N.GET_OBJECT, a), I.addEventListener(N.UPDATE_OBJECT, o), I.addEventListener(N.CREATE_TEXTURE, u), I.addEventListener(N.REQUEST_METHOD, c), () => {
2471
- I.removeEventListener(N.GET_OBJECT, a), I.removeEventListener(N.UPDATE_OBJECT, o), I.removeEventListener(N.CREATE_TEXTURE, u), I.removeEventListener(N.REQUEST_METHOD, c);
2451
+ return Ne(() => (z.addEventListener(Y.GET_OBJECT, i), z.addEventListener(Y.UPDATE_OBJECT, a), z.addEventListener(Y.CREATE_TEXTURE, s), z.addEventListener(Y.REQUEST_METHOD, h), () => {
2452
+ z.removeEventListener(Y.GET_OBJECT, i), z.removeEventListener(Y.UPDATE_OBJECT, a), z.removeEventListener(Y.CREATE_TEXTURE, s), z.removeEventListener(Y.REQUEST_METHOD, h);
2472
2453
  }), []), null;
2473
2454
  }
2474
- const Wt = { type: "change" }, Ot = { type: "start" }, Ht = { type: "end" }, pt = new Mn(), Kt = new Pn(), Ta = Math.cos(70 * jn.DEG2RAD);
2475
- class Ra extends Zt {
2476
- constructor(n, a) {
2477
- super(), this.object = n, this.domElement = a, this.domElement.style.touchAction = "none", this.enabled = !0, this.target = new L(), this.cursor = new L(), this.minDistance = 0, this.maxDistance = 1 / 0, this.minZoom = 0, this.maxZoom = 1 / 0, this.minTargetRadius = 0, this.maxTargetRadius = 1 / 0, this.minPolarAngle = 0, this.maxPolarAngle = Math.PI, this.minAzimuthAngle = -1 / 0, this.maxAzimuthAngle = 1 / 0, this.enableDamping = !1, this.dampingFactor = 0.05, this.enableZoom = !0, this.zoomSpeed = 1, this.enableRotate = !0, this.rotateSpeed = 1, this.enablePan = !0, this.panSpeed = 1, this.screenSpacePanning = !0, this.keyPanSpeed = 7, this.zoomToCursor = !1, this.autoRotate = !1, this.autoRotateSpeed = 2, this.keys = { LEFT: "ArrowLeft", UP: "ArrowUp", RIGHT: "ArrowRight", BOTTOM: "ArrowDown" }, this.mouseButtons = { LEFT: Ne.ROTATE, MIDDLE: Ne.DOLLY, RIGHT: Ne.PAN }, this.touches = { ONE: Le.ROTATE, TWO: Le.DOLLY_PAN }, this.target0 = this.target.clone(), this.position0 = this.object.position.clone(), this.zoom0 = this.object.zoom, this._domElementKeyEvents = null, this.getPolarAngle = function() {
2478
- return s.phi;
2455
+ const qt = { type: "change" }, jt = { type: "start" }, Qt = { type: "end" }, gt = new In(), Jt = new Nn(), Ai = Math.cos(70 * Ln.DEG2RAD);
2456
+ class Ii extends rn {
2457
+ constructor(n, i) {
2458
+ super(), this.object = n, this.domElement = i, this.domElement.style.touchAction = "none", this.enabled = !0, this.target = new G(), this.cursor = new G(), this.minDistance = 0, this.maxDistance = 1 / 0, this.minZoom = 0, this.maxZoom = 1 / 0, this.minTargetRadius = 0, this.maxTargetRadius = 1 / 0, this.minPolarAngle = 0, this.maxPolarAngle = Math.PI, this.minAzimuthAngle = -1 / 0, this.maxAzimuthAngle = 1 / 0, this.enableDamping = !1, this.dampingFactor = 0.05, this.enableZoom = !0, this.zoomSpeed = 1, this.enableRotate = !0, this.rotateSpeed = 1, this.enablePan = !0, this.panSpeed = 1, this.screenSpacePanning = !0, this.keyPanSpeed = 7, this.zoomToCursor = !1, this.autoRotate = !1, this.autoRotateSpeed = 2, this.keys = { LEFT: "ArrowLeft", UP: "ArrowUp", RIGHT: "ArrowRight", BOTTOM: "ArrowDown" }, this.mouseButtons = { LEFT: ze.ROTATE, MIDDLE: ze.DOLLY, RIGHT: ze.PAN }, this.touches = { ONE: Ye.ROTATE, TWO: Ye.DOLLY_PAN }, this.target0 = this.target.clone(), this.position0 = this.object.position.clone(), this.zoom0 = this.object.zoom, this._domElementKeyEvents = null, this.getPolarAngle = function() {
2459
+ return l.phi;
2479
2460
  }, this.getAzimuthalAngle = function() {
2480
- return s.theta;
2461
+ return l.theta;
2481
2462
  }, this.getDistance = function() {
2482
2463
  return this.object.position.distanceTo(this.target);
2483
- }, this.listenToKeyEvents = function(i) {
2484
- i.addEventListener("keydown", Xe), this._domElementKeyEvents = i;
2464
+ }, this.listenToKeyEvents = function(o) {
2465
+ o.addEventListener("keydown", Qe), this._domElementKeyEvents = o;
2485
2466
  }, this.stopListenToKeyEvents = function() {
2486
- this._domElementKeyEvents.removeEventListener("keydown", Xe), this._domElementKeyEvents = null;
2467
+ this._domElementKeyEvents.removeEventListener("keydown", Qe), this._domElementKeyEvents = null;
2487
2468
  }, this.saveState = function() {
2488
2469
  e.target0.copy(e.target), e.position0.copy(e.object.position), e.zoom0 = e.object.zoom;
2489
2470
  }, this.reset = function() {
2490
- e.target.copy(e.target0), e.object.position.copy(e.position0), e.object.zoom = e.zoom0, e.object.updateProjectionMatrix(), e.dispatchEvent(Wt), e.update(), u = o.NONE;
2471
+ e.target.copy(e.target0), e.object.position.copy(e.position0), e.object.zoom = e.zoom0, e.object.updateProjectionMatrix(), e.dispatchEvent(qt), e.update(), s = a.NONE;
2491
2472
  }, this.update = function() {
2492
- const i = new L(), E = new Ft().setFromUnitVectors(n.up, new L(0, 1, 0)), P = E.clone().invert(), _ = new L(), W = new Ft(), de = new L(), J = 2 * Math.PI;
2493
- return function(ht = null) {
2494
- const he = e.object.position;
2495
- i.copy(he).sub(e.target), i.applyQuaternion(E), s.setFromVector3(i), e.autoRotate && u === o.NONE && z(j(ht)), e.enableDamping ? (s.theta += d.theta * e.dampingFactor, s.phi += d.phi * e.dampingFactor) : (s.theta += d.theta, s.phi += d.phi);
2496
- let Q = e.minAzimuthAngle, ee = e.maxAzimuthAngle;
2497
- isFinite(Q) && isFinite(ee) && (Q < -Math.PI ? Q += J : Q > Math.PI && (Q -= J), ee < -Math.PI ? ee += J : ee > Math.PI && (ee -= J), Q <= ee ? s.theta = Math.max(Q, Math.min(ee, s.theta)) : s.theta = s.theta > (Q + ee) / 2 ? Math.max(Q, s.theta) : Math.min(ee, s.theta)), s.phi = Math.max(e.minPolarAngle, Math.min(e.maxPolarAngle, s.phi)), s.makeSafe(), e.enableDamping === !0 ? e.target.addScaledVector(h, e.dampingFactor) : e.target.add(h), e.target.sub(e.cursor), e.target.clampLength(e.minTargetRadius, e.maxTargetRadius), e.target.add(e.cursor), e.zoomToCursor && se || e.object.isOrthographicCamera ? s.radius = je(s.radius) : s.radius = je(s.radius * p), i.setFromSpherical(s), i.applyQuaternion(P), he.copy(e.target).add(i), e.object.lookAt(e.target), e.enableDamping === !0 ? (d.theta *= 1 - e.dampingFactor, d.phi *= 1 - e.dampingFactor, h.multiplyScalar(1 - e.dampingFactor)) : (d.set(0, 0, 0), h.set(0, 0, 0));
2498
- let De = !1;
2499
- if (e.zoomToCursor && se) {
2500
- let Se = null;
2473
+ const o = new G(), y = new Vt().setFromUnitVectors(n.up, new G(0, 1, 0)), _ = y.clone().invert(), A = new G(), te = new Vt(), ve = new G(), le = 2 * Math.PI;
2474
+ return function(mt = null) {
2475
+ const be = e.object.position;
2476
+ o.copy(be).sub(e.target), o.applyQuaternion(y), l.setFromVector3(o), e.autoRotate && s === a.NONE && F(b(mt)), e.enableDamping ? (l.theta += d.theta * e.dampingFactor, l.phi += d.phi * e.dampingFactor) : (l.theta += d.theta, l.phi += d.phi);
2477
+ let fe = e.minAzimuthAngle, he = e.maxAzimuthAngle;
2478
+ isFinite(fe) && isFinite(he) && (fe < -Math.PI ? fe += le : fe > Math.PI && (fe -= le), he < -Math.PI ? he += le : he > Math.PI && (he -= le), fe <= he ? l.theta = Math.max(fe, Math.min(he, l.theta)) : l.theta = l.theta > (fe + he) / 2 ? Math.max(fe, l.theta) : Math.min(he, l.theta)), l.phi = Math.max(e.minPolarAngle, Math.min(e.maxPolarAngle, l.phi)), l.makeSafe(), e.enableDamping === !0 ? e.target.addScaledVector(v, e.dampingFactor) : e.target.add(v), e.target.sub(e.cursor), e.target.clampLength(e.minTargetRadius, e.maxTargetRadius), e.target.add(e.cursor), e.zoomToCursor && ee || e.object.isOrthographicCamera ? l.radius = X(l.radius) : l.radius = X(l.radius * m), o.setFromSpherical(l), o.applyQuaternion(_), be.copy(e.target).add(o), e.object.lookAt(e.target), e.enableDamping === !0 ? (d.theta *= 1 - e.dampingFactor, d.phi *= 1 - e.dampingFactor, v.multiplyScalar(1 - e.dampingFactor)) : (d.set(0, 0, 0), v.set(0, 0, 0));
2479
+ let $e = !1;
2480
+ if (e.zoomToCursor && ee) {
2481
+ let _e = null;
2501
2482
  if (e.object.isPerspectiveCamera) {
2502
- const be = i.length();
2503
- Se = je(be * p);
2504
- const Ae = be - Se;
2505
- e.object.position.addScaledVector(V, Ae), e.object.updateMatrixWorld();
2483
+ const Oe = o.length();
2484
+ _e = X(Oe * m);
2485
+ const Ve = Oe - _e;
2486
+ e.object.position.addScaledVector(de, Ve), e.object.updateMatrixWorld();
2506
2487
  } else if (e.object.isOrthographicCamera) {
2507
- const be = new L(Z.x, Z.y, 0);
2508
- be.unproject(e.object), e.object.zoom = Math.max(e.minZoom, Math.min(e.maxZoom, e.object.zoom / p)), e.object.updateProjectionMatrix(), De = !0;
2509
- const Ae = new L(Z.x, Z.y, 0);
2510
- Ae.unproject(e.object), e.object.position.sub(Ae).add(be), e.object.updateMatrixWorld(), Se = i.length();
2488
+ const Oe = new G(ce.x, ce.y, 0);
2489
+ Oe.unproject(e.object), e.object.zoom = Math.max(e.minZoom, Math.min(e.maxZoom, e.object.zoom / m)), e.object.updateProjectionMatrix(), $e = !0;
2490
+ const Ve = new G(ce.x, ce.y, 0);
2491
+ Ve.unproject(e.object), e.object.position.sub(Ve).add(Oe), e.object.updateMatrixWorld(), _e = o.length();
2511
2492
  } else
2512
2493
  console.warn("WARNING: OrbitControls.js encountered an unknown camera type - zoom to cursor disabled."), e.zoomToCursor = !1;
2513
- Se !== null && (this.screenSpacePanning ? e.target.set(0, 0, -1).transformDirection(e.object.matrix).multiplyScalar(Se).add(e.object.position) : (pt.origin.copy(e.object.position), pt.direction.set(0, 0, -1).transformDirection(e.object.matrix), Math.abs(e.object.up.dot(pt.direction)) < Ta ? n.lookAt(e.target) : (Kt.setFromNormalAndCoplanarPoint(e.object.up, e.target), pt.intersectPlane(Kt, e.target))));
2494
+ _e !== null && (this.screenSpacePanning ? e.target.set(0, 0, -1).transformDirection(e.object.matrix).multiplyScalar(_e).add(e.object.position) : (gt.origin.copy(e.object.position), gt.direction.set(0, 0, -1).transformDirection(e.object.matrix), Math.abs(e.object.up.dot(gt.direction)) < Ai ? n.lookAt(e.target) : (Jt.setFromNormalAndCoplanarPoint(e.object.up, e.target), gt.intersectPlane(Jt, e.target))));
2514
2495
  } else
2515
- e.object.isOrthographicCamera && (e.object.zoom = Math.max(e.minZoom, Math.min(e.maxZoom, e.object.zoom / p)), e.object.updateProjectionMatrix(), De = !0);
2516
- return p = 1, se = !1, De || _.distanceToSquared(e.object.position) > c || 8 * (1 - W.dot(e.object.quaternion)) > c || de.distanceToSquared(e.target) > 0 ? (e.dispatchEvent(Wt), _.copy(e.object.position), W.copy(e.object.quaternion), de.copy(e.target), !0) : !1;
2496
+ e.object.isOrthographicCamera && (e.object.zoom = Math.max(e.minZoom, Math.min(e.maxZoom, e.object.zoom / m)), e.object.updateProjectionMatrix(), $e = !0);
2497
+ return m = 1, ee = !1, $e || A.distanceToSquared(e.object.position) > h || 8 * (1 - te.dot(e.object.quaternion)) > h || ve.distanceToSquared(e.target) > 0 ? (e.dispatchEvent(qt), A.copy(e.object.position), te.copy(e.object.quaternion), ve.copy(e.target), !0) : !1;
2517
2498
  };
2518
2499
  }(), this.dispose = function() {
2519
- e.domElement.removeEventListener("contextmenu", ve), e.domElement.removeEventListener("pointerdown", He), e.domElement.removeEventListener("pointercancel", Ce), e.domElement.removeEventListener("wheel", ct), e.domElement.removeEventListener("pointermove", ge), e.domElement.removeEventListener("pointerup", Ce), e._domElementKeyEvents !== null && (e._domElementKeyEvents.removeEventListener("keydown", Xe), e._domElementKeyEvents = null);
2500
+ e.domElement.removeEventListener("contextmenu", Se), e.domElement.removeEventListener("pointerdown", Ze), e.domElement.removeEventListener("pointercancel", je), e.domElement.removeEventListener("wheel", ut), e.domElement.removeEventListener("pointermove", Ce), e.domElement.removeEventListener("pointerup", je), e._domElementKeyEvents !== null && (e._domElementKeyEvents.removeEventListener("keydown", Qe), e._domElementKeyEvents = null);
2520
2501
  };
2521
- const e = this, o = {
2502
+ const e = this, a = {
2522
2503
  NONE: -1,
2523
2504
  ROTATE: 0,
2524
2505
  DOLLY: 1,
@@ -2528,403 +2509,424 @@ class Ra extends Zt {
2528
2509
  TOUCH_DOLLY_PAN: 5,
2529
2510
  TOUCH_DOLLY_ROTATE: 6
2530
2511
  };
2531
- let u = o.NONE;
2532
- const c = 1e-6, s = new Ut(), d = new Ut();
2533
- let p = 1;
2534
- const h = new L(), b = new oe(), x = new oe(), S = new oe(), O = new oe(), m = new oe(), v = new oe(), y = new oe(), w = new oe(), F = new oe(), V = new L(), Z = new oe();
2535
- let se = !1;
2536
- const Y = [], fe = {};
2537
- function j(i) {
2538
- return i !== null ? 2 * Math.PI / 60 * e.autoRotateSpeed * i : 2 * Math.PI / 60 / 60 * e.autoRotateSpeed;
2539
- }
2540
- function D(i) {
2541
- const E = Math.abs(i) / (100 * (window.devicePixelRatio | 0));
2542
- return Math.pow(0.95, e.zoomSpeed * E);
2543
- }
2544
- function z(i) {
2545
- d.theta -= i;
2546
- }
2547
- function ce(i) {
2548
- d.phi -= i;
2549
- }
2550
- const ae = function() {
2551
- const i = new L();
2552
- return function(P, _) {
2553
- i.setFromMatrixColumn(_, 0), i.multiplyScalar(-P), h.add(i);
2512
+ let s = a.NONE;
2513
+ const h = 1e-6, l = new Gt(), d = new Gt();
2514
+ let m = 1;
2515
+ const v = new G(), E = new ue(), x = new ue(), R = new ue(), T = new ue(), B = new ue(), oe = new ue(), H = new ue(), C = new ue(), K = new ue(), de = new G(), ce = new ue();
2516
+ let ee = !1;
2517
+ const u = [], p = {};
2518
+ function b(o) {
2519
+ return o !== null ? 2 * Math.PI / 60 * e.autoRotateSpeed * o : 2 * Math.PI / 60 / 60 * e.autoRotateSpeed;
2520
+ }
2521
+ function S(o) {
2522
+ const y = Math.abs(o) / (100 * (window.devicePixelRatio | 0));
2523
+ return Math.pow(0.95, e.zoomSpeed * y);
2524
+ }
2525
+ function F(o) {
2526
+ d.theta -= o;
2527
+ }
2528
+ function U(o) {
2529
+ d.phi -= o;
2530
+ }
2531
+ const N = function() {
2532
+ const o = new G();
2533
+ return function(_, A) {
2534
+ o.setFromMatrixColumn(A, 0), o.multiplyScalar(-_), v.add(o);
2554
2535
  };
2555
- }(), le = function() {
2556
- const i = new L();
2557
- return function(P, _) {
2558
- e.screenSpacePanning === !0 ? i.setFromMatrixColumn(_, 1) : (i.setFromMatrixColumn(_, 0), i.crossVectors(e.object.up, i)), i.multiplyScalar(P), h.add(i);
2536
+ }(), D = function() {
2537
+ const o = new G();
2538
+ return function(_, A) {
2539
+ e.screenSpacePanning === !0 ? o.setFromMatrixColumn(A, 1) : (o.setFromMatrixColumn(A, 0), o.crossVectors(e.object.up, o)), o.multiplyScalar(_), v.add(o);
2559
2540
  };
2560
- }(), re = function() {
2561
- const i = new L();
2562
- return function(P, _) {
2563
- const W = e.domElement;
2541
+ }(), L = function() {
2542
+ const o = new G();
2543
+ return function(_, A) {
2544
+ const te = e.domElement;
2564
2545
  if (e.object.isPerspectiveCamera) {
2565
- const de = e.object.position;
2566
- i.copy(de).sub(e.target);
2567
- let J = i.length();
2568
- J *= Math.tan(e.object.fov / 2 * Math.PI / 180), ae(2 * P * J / W.clientHeight, e.object.matrix), le(2 * _ * J / W.clientHeight, e.object.matrix);
2546
+ const ve = e.object.position;
2547
+ o.copy(ve).sub(e.target);
2548
+ let le = o.length();
2549
+ le *= Math.tan(e.object.fov / 2 * Math.PI / 180), N(2 * _ * le / te.clientHeight, e.object.matrix), D(2 * A * le / te.clientHeight, e.object.matrix);
2569
2550
  } else
2570
- e.object.isOrthographicCamera ? (ae(P * (e.object.right - e.object.left) / e.object.zoom / W.clientWidth, e.object.matrix), le(_ * (e.object.top - e.object.bottom) / e.object.zoom / W.clientHeight, e.object.matrix)) : (console.warn("WARNING: OrbitControls.js encountered an unknown camera type - pan disabled."), e.enablePan = !1);
2551
+ e.object.isOrthographicCamera ? (N(_ * (e.object.right - e.object.left) / e.object.zoom / te.clientWidth, e.object.matrix), D(A * (e.object.top - e.object.bottom) / e.object.zoom / te.clientHeight, e.object.matrix)) : (console.warn("WARNING: OrbitControls.js encountered an unknown camera type - pan disabled."), e.enablePan = !1);
2571
2552
  };
2572
2553
  }();
2573
- function Me(i) {
2574
- e.object.isPerspectiveCamera || e.object.isOrthographicCamera ? p /= i : (console.warn("WARNING: OrbitControls.js encountered an unknown camera type - dolly/zoom disabled."), e.enableZoom = !1);
2554
+ function Q(o) {
2555
+ e.object.isPerspectiveCamera || e.object.isOrthographicCamera ? m /= o : (console.warn("WARNING: OrbitControls.js encountered an unknown camera type - dolly/zoom disabled."), e.enableZoom = !1);
2575
2556
  }
2576
- function Ge(i) {
2577
- e.object.isPerspectiveCamera || e.object.isOrthographicCamera ? p *= i : (console.warn("WARNING: OrbitControls.js encountered an unknown camera type - dolly/zoom disabled."), e.enableZoom = !1);
2557
+ function M(o) {
2558
+ e.object.isPerspectiveCamera || e.object.isOrthographicCamera ? m *= o : (console.warn("WARNING: OrbitControls.js encountered an unknown camera type - dolly/zoom disabled."), e.enableZoom = !1);
2578
2559
  }
2579
- function Pe(i, E) {
2560
+ function k(o, y) {
2580
2561
  if (!e.zoomToCursor)
2581
2562
  return;
2582
- se = !0;
2583
- const P = e.domElement.getBoundingClientRect(), _ = i - P.left, W = E - P.top, de = P.width, J = P.height;
2584
- Z.x = _ / de * 2 - 1, Z.y = -(W / J) * 2 + 1, V.set(Z.x, Z.y, 1).unproject(e.object).sub(e.object.position).normalize();
2563
+ ee = !0;
2564
+ const _ = e.domElement.getBoundingClientRect(), A = o - _.left, te = y - _.top, ve = _.width, le = _.height;
2565
+ ce.x = A / ve * 2 - 1, ce.y = -(te / le) * 2 + 1, de.set(ce.x, ce.y, 1).unproject(e.object).sub(e.object.position).normalize();
2585
2566
  }
2586
- function je(i) {
2587
- return Math.max(e.minDistance, Math.min(e.maxDistance, i));
2567
+ function X(o) {
2568
+ return Math.max(e.minDistance, Math.min(e.maxDistance, o));
2588
2569
  }
2589
- function Ve(i) {
2590
- b.set(i.clientX, i.clientY);
2570
+ function pe(o) {
2571
+ E.set(o.clientX, o.clientY);
2591
2572
  }
2592
- function nt(i) {
2593
- Pe(i.clientX, i.clientX), y.set(i.clientX, i.clientY);
2573
+ function Te(o) {
2574
+ k(o.clientX, o.clientX), H.set(o.clientX, o.clientY);
2594
2575
  }
2595
- function Ye(i) {
2596
- O.set(i.clientX, i.clientY);
2576
+ function He(o) {
2577
+ T.set(o.clientX, o.clientY);
2597
2578
  }
2598
- function at(i) {
2599
- x.set(i.clientX, i.clientY), S.subVectors(x, b).multiplyScalar(e.rotateSpeed);
2600
- const E = e.domElement;
2601
- z(2 * Math.PI * S.x / E.clientHeight), ce(2 * Math.PI * S.y / E.clientHeight), b.copy(x), e.update();
2579
+ function at(o) {
2580
+ x.set(o.clientX, o.clientY), R.subVectors(x, E).multiplyScalar(e.rotateSpeed);
2581
+ const y = e.domElement;
2582
+ F(2 * Math.PI * R.x / y.clientHeight), U(2 * Math.PI * R.y / y.clientHeight), E.copy(x), e.update();
2602
2583
  }
2603
- function bt(i) {
2604
- w.set(i.clientX, i.clientY), F.subVectors(w, y), F.y > 0 ? Me(D(F.y)) : F.y < 0 && Ge(D(F.y)), y.copy(w), e.update();
2584
+ function wt(o) {
2585
+ C.set(o.clientX, o.clientY), K.subVectors(C, H), K.y > 0 ? Q(S(K.y)) : K.y < 0 && M(S(K.y)), H.copy(C), e.update();
2605
2586
  }
2606
- function yt(i) {
2607
- m.set(i.clientX, i.clientY), v.subVectors(m, O).multiplyScalar(e.panSpeed), re(v.x, v.y), O.copy(m), e.update();
2587
+ function Ct(o) {
2588
+ B.set(o.clientX, o.clientY), oe.subVectors(B, T).multiplyScalar(e.panSpeed), L(oe.x, oe.y), T.copy(B), e.update();
2608
2589
  }
2609
- function ze(i) {
2610
- Pe(i.clientX, i.clientY), i.deltaY < 0 ? Ge(D(i.deltaY)) : i.deltaY > 0 && Me(D(i.deltaY)), e.update();
2590
+ function Ke(o) {
2591
+ k(o.clientX, o.clientY), o.deltaY < 0 ? M(S(o.deltaY)) : o.deltaY > 0 && Q(S(o.deltaY)), e.update();
2611
2592
  }
2612
- function We(i) {
2613
- let E = !1;
2614
- switch (i.code) {
2593
+ function Xe(o) {
2594
+ let y = !1;
2595
+ switch (o.code) {
2615
2596
  case e.keys.UP:
2616
- i.ctrlKey || i.metaKey || i.shiftKey ? ce(2 * Math.PI * e.rotateSpeed / e.domElement.clientHeight) : re(0, e.keyPanSpeed), E = !0;
2597
+ o.ctrlKey || o.metaKey || o.shiftKey ? U(2 * Math.PI * e.rotateSpeed / e.domElement.clientHeight) : L(0, e.keyPanSpeed), y = !0;
2617
2598
  break;
2618
2599
  case e.keys.BOTTOM:
2619
- i.ctrlKey || i.metaKey || i.shiftKey ? ce(-2 * Math.PI * e.rotateSpeed / e.domElement.clientHeight) : re(0, -e.keyPanSpeed), E = !0;
2600
+ o.ctrlKey || o.metaKey || o.shiftKey ? U(-2 * Math.PI * e.rotateSpeed / e.domElement.clientHeight) : L(0, -e.keyPanSpeed), y = !0;
2620
2601
  break;
2621
2602
  case e.keys.LEFT:
2622
- i.ctrlKey || i.metaKey || i.shiftKey ? z(2 * Math.PI * e.rotateSpeed / e.domElement.clientHeight) : re(e.keyPanSpeed, 0), E = !0;
2603
+ o.ctrlKey || o.metaKey || o.shiftKey ? F(2 * Math.PI * e.rotateSpeed / e.domElement.clientHeight) : L(e.keyPanSpeed, 0), y = !0;
2623
2604
  break;
2624
2605
  case e.keys.RIGHT:
2625
- i.ctrlKey || i.metaKey || i.shiftKey ? z(-2 * Math.PI * e.rotateSpeed / e.domElement.clientHeight) : re(-e.keyPanSpeed, 0), E = !0;
2606
+ o.ctrlKey || o.metaKey || o.shiftKey ? F(-2 * Math.PI * e.rotateSpeed / e.domElement.clientHeight) : L(-e.keyPanSpeed, 0), y = !0;
2626
2607
  break;
2627
2608
  }
2628
- E && (i.preventDefault(), e.update());
2609
+ y && (o.preventDefault(), e.update());
2629
2610
  }
2630
- function Ee(i) {
2631
- if (Y.length === 1)
2632
- b.set(i.pageX, i.pageY);
2611
+ function Me(o) {
2612
+ if (u.length === 1)
2613
+ E.set(o.pageX, o.pageY);
2633
2614
  else {
2634
- const E = ue(i), P = 0.5 * (i.pageX + E.x), _ = 0.5 * (i.pageY + E.y);
2635
- b.set(P, _);
2615
+ const y = ge(o), _ = 0.5 * (o.pageX + y.x), A = 0.5 * (o.pageY + y.y);
2616
+ E.set(_, A);
2636
2617
  }
2637
2618
  }
2638
- function _e(i) {
2639
- if (Y.length === 1)
2640
- O.set(i.pageX, i.pageY);
2619
+ function Ue(o) {
2620
+ if (u.length === 1)
2621
+ T.set(o.pageX, o.pageY);
2641
2622
  else {
2642
- const E = ue(i), P = 0.5 * (i.pageX + E.x), _ = 0.5 * (i.pageY + E.y);
2643
- O.set(P, _);
2623
+ const y = ge(o), _ = 0.5 * (o.pageX + y.x), A = 0.5 * (o.pageY + y.y);
2624
+ T.set(_, A);
2644
2625
  }
2645
2626
  }
2646
- function xe(i) {
2647
- const E = ue(i), P = i.pageX - E.x, _ = i.pageY - E.y, W = Math.sqrt(P * P + _ * _);
2648
- y.set(0, W);
2627
+ function Re(o) {
2628
+ const y = ge(o), _ = o.pageX - y.x, A = o.pageY - y.y, te = Math.sqrt(_ * _ + A * A);
2629
+ H.set(0, te);
2649
2630
  }
2650
- function Et(i) {
2651
- e.enableZoom && xe(i), e.enablePan && _e(i);
2631
+ function St(o) {
2632
+ e.enableZoom && Re(o), e.enablePan && Ue(o);
2652
2633
  }
2653
- function rt(i) {
2654
- e.enableZoom && xe(i), e.enableRotate && Ee(i);
2634
+ function ot(o) {
2635
+ e.enableZoom && Re(o), e.enableRotate && Me(o);
2655
2636
  }
2656
- function it(i) {
2657
- if (Y.length == 1)
2658
- x.set(i.pageX, i.pageY);
2637
+ function st(o) {
2638
+ if (u.length == 1)
2639
+ x.set(o.pageX, o.pageY);
2659
2640
  else {
2660
- const P = ue(i), _ = 0.5 * (i.pageX + P.x), W = 0.5 * (i.pageY + P.y);
2661
- x.set(_, W);
2641
+ const _ = ge(o), A = 0.5 * (o.pageX + _.x), te = 0.5 * (o.pageY + _.y);
2642
+ x.set(A, te);
2662
2643
  }
2663
- S.subVectors(x, b).multiplyScalar(e.rotateSpeed);
2664
- const E = e.domElement;
2665
- z(2 * Math.PI * S.x / E.clientHeight), ce(2 * Math.PI * S.y / E.clientHeight), b.copy(x);
2644
+ R.subVectors(x, E).multiplyScalar(e.rotateSpeed);
2645
+ const y = e.domElement;
2646
+ F(2 * Math.PI * R.x / y.clientHeight), U(2 * Math.PI * R.y / y.clientHeight), E.copy(x);
2666
2647
  }
2667
- function ot(i) {
2668
- if (Y.length === 1)
2669
- m.set(i.pageX, i.pageY);
2648
+ function ct(o) {
2649
+ if (u.length === 1)
2650
+ B.set(o.pageX, o.pageY);
2670
2651
  else {
2671
- const E = ue(i), P = 0.5 * (i.pageX + E.x), _ = 0.5 * (i.pageY + E.y);
2672
- m.set(P, _);
2652
+ const y = ge(o), _ = 0.5 * (o.pageX + y.x), A = 0.5 * (o.pageY + y.y);
2653
+ B.set(_, A);
2673
2654
  }
2674
- v.subVectors(m, O).multiplyScalar(e.panSpeed), re(v.x, v.y), O.copy(m);
2655
+ oe.subVectors(B, T).multiplyScalar(e.panSpeed), L(oe.x, oe.y), T.copy(B);
2675
2656
  }
2676
- function we(i) {
2677
- const E = ue(i), P = i.pageX - E.x, _ = i.pageY - E.y, W = Math.sqrt(P * P + _ * _);
2678
- w.set(0, W), F.set(0, Math.pow(w.y / y.y, e.zoomSpeed)), Me(F.y), y.copy(w);
2679
- const de = (i.pageX + E.x) * 0.5, J = (i.pageY + E.y) * 0.5;
2680
- Pe(de, J);
2657
+ function Pe(o) {
2658
+ const y = ge(o), _ = o.pageX - y.x, A = o.pageY - y.y, te = Math.sqrt(_ * _ + A * A);
2659
+ C.set(0, te), K.set(0, Math.pow(C.y / H.y, e.zoomSpeed)), Q(K.y), H.copy(C);
2660
+ const ve = (o.pageX + y.x) * 0.5, le = (o.pageY + y.y) * 0.5;
2661
+ k(ve, le);
2681
2662
  }
2682
- function ke(i) {
2683
- e.enableZoom && we(i), e.enablePan && ot(i);
2663
+ function Be(o) {
2664
+ e.enableZoom && Pe(o), e.enablePan && ct(o);
2684
2665
  }
2685
- function st(i) {
2686
- e.enableZoom && we(i), e.enableRotate && it(i);
2666
+ function lt(o) {
2667
+ e.enableZoom && Pe(o), e.enableRotate && st(o);
2687
2668
  }
2688
- function He(i) {
2689
- e.enabled !== !1 && (Y.length === 0 && (e.domElement.setPointerCapture(i.pointerId), e.domElement.addEventListener("pointermove", ge), e.domElement.addEventListener("pointerup", Ce)), wt(i), i.pointerType === "touch" ? lt(i) : xt(i));
2669
+ function Ze(o) {
2670
+ e.enabled !== !1 && (u.length === 0 && (e.domElement.setPointerCapture(o.pointerId), e.domElement.addEventListener("pointermove", Ce), e.domElement.addEventListener("pointerup", je)), Tt(o), o.pointerType === "touch" ? dt(o) : Ot(o));
2690
2671
  }
2691
- function ge(i) {
2692
- e.enabled !== !1 && (i.pointerType === "touch" ? ut(i) : Ke(i));
2672
+ function Ce(o) {
2673
+ e.enabled !== !1 && (o.pointerType === "touch" ? ft(o) : qe(o));
2693
2674
  }
2694
- function Ce(i) {
2695
- dt(i), Y.length === 0 && (e.domElement.releasePointerCapture(i.pointerId), e.domElement.removeEventListener("pointermove", ge), e.domElement.removeEventListener("pointerup", Ce)), e.dispatchEvent(Ht), u = o.NONE;
2675
+ function je(o) {
2676
+ ht(o), u.length === 0 && (e.domElement.releasePointerCapture(o.pointerId), e.domElement.removeEventListener("pointermove", Ce), e.domElement.removeEventListener("pointerup", je)), e.dispatchEvent(Qt), s = a.NONE;
2696
2677
  }
2697
- function xt(i) {
2698
- let E;
2699
- switch (i.button) {
2678
+ function Ot(o) {
2679
+ let y;
2680
+ switch (o.button) {
2700
2681
  case 0:
2701
- E = e.mouseButtons.LEFT;
2682
+ y = e.mouseButtons.LEFT;
2702
2683
  break;
2703
2684
  case 1:
2704
- E = e.mouseButtons.MIDDLE;
2685
+ y = e.mouseButtons.MIDDLE;
2705
2686
  break;
2706
2687
  case 2:
2707
- E = e.mouseButtons.RIGHT;
2688
+ y = e.mouseButtons.RIGHT;
2708
2689
  break;
2709
2690
  default:
2710
- E = -1;
2691
+ y = -1;
2711
2692
  }
2712
- switch (E) {
2713
- case Ne.DOLLY:
2693
+ switch (y) {
2694
+ case ze.DOLLY:
2714
2695
  if (e.enableZoom === !1)
2715
2696
  return;
2716
- nt(i), u = o.DOLLY;
2697
+ Te(o), s = a.DOLLY;
2717
2698
  break;
2718
- case Ne.ROTATE:
2719
- if (i.ctrlKey || i.metaKey || i.shiftKey) {
2699
+ case ze.ROTATE:
2700
+ if (o.ctrlKey || o.metaKey || o.shiftKey) {
2720
2701
  if (e.enablePan === !1)
2721
2702
  return;
2722
- Ye(i), u = o.PAN;
2703
+ He(o), s = a.PAN;
2723
2704
  } else {
2724
2705
  if (e.enableRotate === !1)
2725
2706
  return;
2726
- Ve(i), u = o.ROTATE;
2707
+ pe(o), s = a.ROTATE;
2727
2708
  }
2728
2709
  break;
2729
- case Ne.PAN:
2730
- if (i.ctrlKey || i.metaKey || i.shiftKey) {
2710
+ case ze.PAN:
2711
+ if (o.ctrlKey || o.metaKey || o.shiftKey) {
2731
2712
  if (e.enableRotate === !1)
2732
2713
  return;
2733
- Ve(i), u = o.ROTATE;
2714
+ pe(o), s = a.ROTATE;
2734
2715
  } else {
2735
2716
  if (e.enablePan === !1)
2736
2717
  return;
2737
- Ye(i), u = o.PAN;
2718
+ He(o), s = a.PAN;
2738
2719
  }
2739
2720
  break;
2740
2721
  default:
2741
- u = o.NONE;
2722
+ s = a.NONE;
2742
2723
  }
2743
- u !== o.NONE && e.dispatchEvent(Ot);
2724
+ s !== a.NONE && e.dispatchEvent(jt);
2744
2725
  }
2745
- function Ke(i) {
2746
- switch (u) {
2747
- case o.ROTATE:
2726
+ function qe(o) {
2727
+ switch (s) {
2728
+ case a.ROTATE:
2748
2729
  if (e.enableRotate === !1)
2749
2730
  return;
2750
- at(i);
2731
+ at(o);
2751
2732
  break;
2752
- case o.DOLLY:
2733
+ case a.DOLLY:
2753
2734
  if (e.enableZoom === !1)
2754
2735
  return;
2755
- bt(i);
2736
+ wt(o);
2756
2737
  break;
2757
- case o.PAN:
2738
+ case a.PAN:
2758
2739
  if (e.enablePan === !1)
2759
2740
  return;
2760
- yt(i);
2741
+ Ct(o);
2761
2742
  break;
2762
2743
  }
2763
2744
  }
2764
- function ct(i) {
2765
- e.enabled === !1 || e.enableZoom === !1 || u !== o.NONE || (i.preventDefault(), e.dispatchEvent(Ot), ze(i), e.dispatchEvent(Ht));
2745
+ function ut(o) {
2746
+ e.enabled === !1 || e.enableZoom === !1 || s !== a.NONE || (o.preventDefault(), e.dispatchEvent(jt), Ke(o), e.dispatchEvent(Qt));
2766
2747
  }
2767
- function Xe(i) {
2768
- e.enabled === !1 || e.enablePan === !1 || We(i);
2748
+ function Qe(o) {
2749
+ e.enabled === !1 || e.enablePan === !1 || Xe(o);
2769
2750
  }
2770
- function lt(i) {
2771
- switch (qe(i), Y.length) {
2751
+ function dt(o) {
2752
+ switch (Je(o), u.length) {
2772
2753
  case 1:
2773
2754
  switch (e.touches.ONE) {
2774
- case Le.ROTATE:
2755
+ case Ye.ROTATE:
2775
2756
  if (e.enableRotate === !1)
2776
2757
  return;
2777
- Ee(i), u = o.TOUCH_ROTATE;
2758
+ Me(o), s = a.TOUCH_ROTATE;
2778
2759
  break;
2779
- case Le.PAN:
2760
+ case Ye.PAN:
2780
2761
  if (e.enablePan === !1)
2781
2762
  return;
2782
- _e(i), u = o.TOUCH_PAN;
2763
+ Ue(o), s = a.TOUCH_PAN;
2783
2764
  break;
2784
2765
  default:
2785
- u = o.NONE;
2766
+ s = a.NONE;
2786
2767
  }
2787
2768
  break;
2788
2769
  case 2:
2789
2770
  switch (e.touches.TWO) {
2790
- case Le.DOLLY_PAN:
2771
+ case Ye.DOLLY_PAN:
2791
2772
  if (e.enableZoom === !1 && e.enablePan === !1)
2792
2773
  return;
2793
- Et(i), u = o.TOUCH_DOLLY_PAN;
2774
+ St(o), s = a.TOUCH_DOLLY_PAN;
2794
2775
  break;
2795
- case Le.DOLLY_ROTATE:
2776
+ case Ye.DOLLY_ROTATE:
2796
2777
  if (e.enableZoom === !1 && e.enableRotate === !1)
2797
2778
  return;
2798
- rt(i), u = o.TOUCH_DOLLY_ROTATE;
2779
+ ot(o), s = a.TOUCH_DOLLY_ROTATE;
2799
2780
  break;
2800
2781
  default:
2801
- u = o.NONE;
2782
+ s = a.NONE;
2802
2783
  }
2803
2784
  break;
2804
2785
  default:
2805
- u = o.NONE;
2786
+ s = a.NONE;
2806
2787
  }
2807
- u !== o.NONE && e.dispatchEvent(Ot);
2788
+ s !== a.NONE && e.dispatchEvent(jt);
2808
2789
  }
2809
- function ut(i) {
2810
- switch (qe(i), u) {
2811
- case o.TOUCH_ROTATE:
2790
+ function ft(o) {
2791
+ switch (Je(o), s) {
2792
+ case a.TOUCH_ROTATE:
2812
2793
  if (e.enableRotate === !1)
2813
2794
  return;
2814
- it(i), e.update();
2795
+ st(o), e.update();
2815
2796
  break;
2816
- case o.TOUCH_PAN:
2797
+ case a.TOUCH_PAN:
2817
2798
  if (e.enablePan === !1)
2818
2799
  return;
2819
- ot(i), e.update();
2800
+ ct(o), e.update();
2820
2801
  break;
2821
- case o.TOUCH_DOLLY_PAN:
2802
+ case a.TOUCH_DOLLY_PAN:
2822
2803
  if (e.enableZoom === !1 && e.enablePan === !1)
2823
2804
  return;
2824
- ke(i), e.update();
2805
+ Be(o), e.update();
2825
2806
  break;
2826
- case o.TOUCH_DOLLY_ROTATE:
2807
+ case a.TOUCH_DOLLY_ROTATE:
2827
2808
  if (e.enableZoom === !1 && e.enableRotate === !1)
2828
2809
  return;
2829
- st(i), e.update();
2810
+ lt(o), e.update();
2830
2811
  break;
2831
2812
  default:
2832
- u = o.NONE;
2813
+ s = a.NONE;
2833
2814
  }
2834
2815
  }
2835
- function ve(i) {
2836
- e.enabled !== !1 && i.preventDefault();
2816
+ function Se(o) {
2817
+ e.enabled !== !1 && o.preventDefault();
2837
2818
  }
2838
- function wt(i) {
2839
- Y.push(i.pointerId);
2819
+ function Tt(o) {
2820
+ u.push(o.pointerId);
2840
2821
  }
2841
- function dt(i) {
2842
- delete fe[i.pointerId];
2843
- for (let E = 0; E < Y.length; E++)
2844
- if (Y[E] == i.pointerId) {
2845
- Y.splice(E, 1);
2822
+ function ht(o) {
2823
+ delete p[o.pointerId];
2824
+ for (let y = 0; y < u.length; y++)
2825
+ if (u[y] == o.pointerId) {
2826
+ u.splice(y, 1);
2846
2827
  return;
2847
2828
  }
2848
2829
  }
2849
- function qe(i) {
2850
- let E = fe[i.pointerId];
2851
- E === void 0 && (E = new oe(), fe[i.pointerId] = E), E.set(i.pageX, i.pageY);
2830
+ function Je(o) {
2831
+ let y = p[o.pointerId];
2832
+ y === void 0 && (y = new ue(), p[o.pointerId] = y), y.set(o.pageX, o.pageY);
2852
2833
  }
2853
- function ue(i) {
2854
- const E = i.pointerId === Y[0] ? Y[1] : Y[0];
2855
- return fe[E];
2834
+ function ge(o) {
2835
+ const y = o.pointerId === u[0] ? u[1] : u[0];
2836
+ return p[y];
2856
2837
  }
2857
- e.domElement.addEventListener("contextmenu", ve), e.domElement.addEventListener("pointerdown", He), e.domElement.addEventListener("pointercancel", Ce), e.domElement.addEventListener("wheel", ct, { passive: !1 }), this.update();
2838
+ e.domElement.addEventListener("contextmenu", Se), e.domElement.addEventListener("pointerdown", Ze), e.domElement.addEventListener("pointercancel", je), e.domElement.addEventListener("wheel", ut, { passive: !1 }), this.update();
2858
2839
  }
2859
2840
  }
2860
- const _t = (t) => {
2861
- const [n, a] = ne(!1), [e, o] = ne(t.options[t.index]), u = () => {
2862
- a(!n);
2863
- }, c = (s) => {
2864
- s !== e && (t.onSelect(s), o(s)), a(!1);
2841
+ const yt = (t) => {
2842
+ const [n, i] = ae(t.options[t.index]), e = () => {
2843
+ t.onToggle(!t.open);
2844
+ }, a = (s) => {
2845
+ s !== n && (t.onSelect(s), i(s)), t.onToggle(!1);
2865
2846
  };
2866
- return /* @__PURE__ */ l.jsxs("div", { className: `dropdown ${t.up === !0 ? "up" : ""}`, children: [
2867
- /* @__PURE__ */ l.jsx("div", { className: "dropdown-toggle", onClick: u, children: e }),
2868
- n && /* @__PURE__ */ l.jsx("ul", { className: "dropdown-menu", children: t.options.map((s) => /* @__PURE__ */ l.jsx("li", { onClick: () => c(s), children: s }, s)) })
2847
+ return /* @__PURE__ */ c.jsxs("div", { className: `dropdown ${t.up === !0 ? "up" : ""}`, children: [
2848
+ /* @__PURE__ */ c.jsx("div", { className: "dropdown-toggle", onClick: e, children: n }),
2849
+ t.open && /* @__PURE__ */ c.jsx("ul", { className: "dropdown-menu", children: t.options.map((s) => /* @__PURE__ */ c.jsx("li", { onClick: () => a(s), children: s }, s)) })
2869
2850
  ] });
2870
- }, Te = $n(function(n, a) {
2871
- const e = n.options.indexOf(n.camera.name);
2872
- return /* @__PURE__ */ l.jsxs("div", { className: "CameraWindow", children: [
2873
- /* @__PURE__ */ l.jsx("div", { ref: a, className: "clickable" }),
2874
- /* @__PURE__ */ l.jsx(_t, { index: e, options: n.options, onSelect: n.onSelect, up: !0 })
2851
+ }, ke = Xn(function(n, i) {
2852
+ const [e, a] = ae(!1), s = n.options.indexOf(n.camera.name);
2853
+ return /* @__PURE__ */ c.jsxs("div", { className: "CameraWindow", children: [
2854
+ /* @__PURE__ */ c.jsx("div", { ref: i, className: "clickable", onClick: () => {
2855
+ e && a(!1);
2856
+ } }),
2857
+ /* @__PURE__ */ c.jsx(
2858
+ yt,
2859
+ {
2860
+ index: s,
2861
+ open: e,
2862
+ options: n.options,
2863
+ onSelect: n.onSelect,
2864
+ onToggle: (h) => {
2865
+ a(h);
2866
+ },
2867
+ up: !0
2868
+ }
2869
+ )
2875
2870
  ] });
2876
- }), Xt = [
2871
+ }), en = [
2877
2872
  "Single",
2878
2873
  "Side by Side",
2879
2874
  "Stacked",
2880
2875
  "Quad"
2881
- ], X = /* @__PURE__ */ new Map(), H = /* @__PURE__ */ new Map(), me = /* @__PURE__ */ new Map();
2882
- function Re(t, n) {
2883
- const a = new en(-100, 100, 100, -100, 50, 3e3);
2884
- return a.name = t, a.position.copy(n), a.lookAt(0, 0, 0), X.set(t, a), a;
2876
+ ], ne = /* @__PURE__ */ new Map(), ie = /* @__PURE__ */ new Map(), Ee = /* @__PURE__ */ new Map();
2877
+ function Fe(t, n) {
2878
+ const i = new sn(-100, 100, 100, -100, 50, 3e3);
2879
+ return i.name = t, i.position.copy(n), i.lookAt(0, 0, 0), ne.set(t, i), i;
2885
2880
  }
2886
- Re("Top", new L(0, 1e3, 0));
2887
- Re("Bottom", new L(0, -1e3, 0));
2888
- Re("Left", new L(-1e3, 0, 0));
2889
- Re("Right", new L(1e3, 0, 0));
2890
- Re("Front", new L(0, 0, 1e3));
2891
- Re("Back", new L(0, 0, -1e3));
2892
- Re("Orthographic", new L(1e3, 1e3, 1e3));
2893
- const vt = new Tt(60, 1, 50, 3e3);
2894
- vt.name = "Debug";
2895
- vt.position.set(500, 500, 500);
2896
- vt.lookAt(0, 0, 0);
2897
- X.set("Debug", vt);
2898
- const qt = [
2881
+ Fe("Top", new G(0, 1e3, 0));
2882
+ Fe("Bottom", new G(0, -1e3, 0));
2883
+ Fe("Left", new G(-1e3, 0, 0));
2884
+ Fe("Right", new G(1e3, 0, 0));
2885
+ Fe("Front", new G(0, 0, 1e3));
2886
+ Fe("Back", new G(0, 0, -1e3));
2887
+ Fe("Orthographic", new G(1e3, 1e3, 1e3));
2888
+ const xt = new _t(60, 1, 50, 3e3);
2889
+ xt.name = "Debug";
2890
+ xt.position.set(500, 500, 500);
2891
+ xt.lookAt(0, 0, 0);
2892
+ ne.set("Debug", xt);
2893
+ const tn = [
2899
2894
  "Renderer",
2900
2895
  "Depth",
2901
2896
  "Normals",
2902
2897
  "UVs",
2903
2898
  "Wireframe"
2904
- ], Ma = new _n(), Pa = new kn(), ja = new da(), _a = new Dn({
2899
+ ], Ni = new Fn(), Li = new Un(), Fi = new bi(), Ui = new Bn({
2905
2900
  opacity: 0.33,
2906
2901
  transparent: !0,
2907
2902
  wireframe: !0
2908
2903
  });
2909
- let mt = "Renderer";
2910
- const A = new tn();
2911
- A.name = "Debug Scene";
2912
- let tt = new tn();
2913
- A.add(tt);
2914
- const ka = new ca();
2915
- A.add(ka);
2916
- const dn = new An(500);
2917
- dn.name = "axisHelper";
2918
- A.add(dn);
2919
- let G = X.get("Debug"), te = X.get("Orthographic"), Fe = X.get("Front"), Ue = X.get("Top");
2920
- function Za(t) {
2921
- const [n, a] = ne(t.mode !== void 0 ? t.mode : "Quad"), [e, o] = ne(null), u = ye(null), c = ye(null), s = ye(null), d = ye(null), p = ye(null), h = (m, v) => {
2922
- const y = H.get(m.name);
2923
- y !== void 0 && y.dispose(), H.delete(m.name);
2924
- const w = me.get(m.name);
2925
- w !== void 0 && (A.remove(w), w.dispose()), me.delete(m.name);
2926
- const F = new Ra(m, v);
2927
- switch (F.enableDamping = !0, F.dampingFactor = 0.05, m.name) {
2904
+ let vt = "Renderer";
2905
+ const V = new cn();
2906
+ V.name = "Debug Scene";
2907
+ let xe = new cn();
2908
+ V.add(xe);
2909
+ const rt = new $n();
2910
+ rt.name = "helpers";
2911
+ V.add(rt);
2912
+ const Bi = new mi();
2913
+ rt.add(Bi);
2914
+ const bn = new ln(500);
2915
+ bn.name = "axisHelper";
2916
+ rt.add(bn);
2917
+ const it = new ln(100);
2918
+ it.name = "interactionHelper";
2919
+ rt.add(it);
2920
+ it.visible = !1;
2921
+ let bt = !1, $ = ne.get("Debug"), re = ne.get("Orthographic"), Ae = ne.get("Front"), Ie = ne.get("Top"), nn = !1;
2922
+ function ar(t) {
2923
+ const [n, i] = ae(t.mode !== void 0 ? t.mode : "Single"), [e, a] = ae(null), [s, h] = ae(!1), [l, d] = ae(!1), [m, v] = ae(!1), [, E] = ae(Date.now()), x = we(null), R = we(null), T = we(null), B = we(null), oe = we(null), H = we(null), C = (u, p) => {
2924
+ const b = ie.get(u.name);
2925
+ b !== void 0 && b.dispose(), ie.delete(u.name);
2926
+ const S = Ee.get(u.name);
2927
+ S !== void 0 && (V.remove(S), S.dispose()), Ee.delete(u.name);
2928
+ const F = new Ii(u, p);
2929
+ switch (F.enableDamping = !0, F.dampingFactor = 0.05, u.name) {
2928
2930
  case "Top":
2929
2931
  case "Bottom":
2930
2932
  case "Left":
@@ -2934,240 +2936,333 @@ function Za(t) {
2934
2936
  F.enableRotate = !1;
2935
2937
  break;
2936
2938
  }
2937
- if (H.set(m.name, F), m instanceof Tt) {
2938
- const V = new Nn(m);
2939
- me.set(m.name, V), A.add(V);
2940
- }
2941
- }, b = (m) => {
2942
- const v = me.get(m.name);
2943
- v !== void 0 && (A.remove(v), v.dispose(), me.delete(m.name));
2944
- const y = H.get(m.name);
2945
- y !== void 0 && (y.dispose(), H.delete(m.name));
2946
- }, x = () => {
2947
- H.forEach((m, v) => {
2948
- m.dispose();
2949
- const y = me.get(v);
2950
- y !== void 0 && (A.remove(y), y.dispose()), me.delete(v), H.delete(v);
2951
- }), H.clear(), me.clear();
2952
- }, S = () => {
2939
+ if (ie.set(u.name, F), u instanceof _t) {
2940
+ const U = new zn(u);
2941
+ Ee.set(u.name, U), V.add(U);
2942
+ }
2943
+ }, K = (u) => {
2944
+ const p = Ee.get(u.name);
2945
+ p !== void 0 && (V.remove(p), p.dispose(), Ee.delete(u.name));
2946
+ const b = ie.get(u.name);
2947
+ b !== void 0 && (b.dispose(), ie.delete(u.name));
2948
+ }, de = () => {
2949
+ ie.forEach((u, p) => {
2950
+ u.dispose();
2951
+ const b = Ee.get(p);
2952
+ b !== void 0 && (V.remove(b), b.dispose()), Ee.delete(p), ie.delete(p);
2953
+ }), ie.clear(), Ee.clear();
2954
+ }, ce = () => {
2953
2955
  switch (n) {
2954
2956
  case "Single":
2955
- h(G, c.current);
2957
+ C($, T.current);
2956
2958
  break;
2957
2959
  case "Side by Side":
2958
2960
  case "Stacked":
2959
- h(G, c.current), h(te, s.current);
2961
+ C($, T.current), C(re, B.current);
2960
2962
  break;
2961
2963
  case "Quad":
2962
- h(G, c.current), h(te, s.current), h(Fe, d.current), h(Ue, p.current);
2964
+ C($, T.current), C(re, B.current), C(Ae, oe.current), C(Ie, H.current);
2963
2965
  break;
2964
2966
  }
2965
2967
  };
2966
- Be(() => {
2967
- const m = new In({
2968
- canvas: u.current,
2968
+ Ne(() => {
2969
+ const u = new Vn({
2970
+ canvas: x.current,
2969
2971
  stencil: !1
2970
2972
  });
2971
- m.autoClear = !1, m.shadowMap.enabled = !0, m.setPixelRatio(devicePixelRatio), m.setClearColor(0), o(m);
2972
- }, []), Be(() => {
2973
- const m = () => {
2974
- on(tt), A.remove(tt), t.three.scene !== void 0 && (tt = t.three.scene, A.add(tt));
2973
+ u.autoClear = !1, u.shadowMap.enabled = !0, u.setPixelRatio(devicePixelRatio), u.setClearColor(0), a(u);
2974
+ }, []), Ne(() => {
2975
+ const u = (S) => {
2976
+ hn(xe), V.remove(xe);
2977
+ const F = t.scenes.get(S.value.name);
2978
+ if (F !== void 0) {
2979
+ const U = new F();
2980
+ t.onSceneSet !== void 0 && t.onSceneSet(U), xe = U, t.three.scene = xe, V.add(xe), nn = !0;
2981
+ }
2982
+ }, p = (S) => {
2983
+ var N;
2984
+ const F = S.value, U = (N = t.three.scene) == null ? void 0 : N.getObjectByProperty("uuid", F.uuid);
2985
+ U !== void 0 && ne.set(F.name, U), E(Date.now());
2986
+ }, b = (S) => {
2987
+ ne.delete(S.value.name), E(Date.now());
2975
2988
  };
2976
- return I.addEventListener(N.SET_SCENE, m), () => {
2977
- I.removeEventListener(N.SET_SCENE, m);
2989
+ return z.addEventListener(Y.SET_SCENE, u), z.addEventListener(Y.ADD_CAMERA, p), z.addEventListener(Y.REMOVE_CAMERA, b), () => {
2990
+ z.removeEventListener(Y.SET_SCENE, u), z.removeEventListener(Y.ADD_CAMERA, p), z.removeEventListener(Y.REMOVE_CAMERA, b);
2978
2991
  };
2979
- }, []), Be(() => {
2992
+ }, []), Ne(() => {
2980
2993
  if (e === null)
2981
2994
  return;
2982
- let m = window.innerWidth, v = window.innerHeight, y = Math.floor(m / 2), w = Math.floor(v / 2), F = -1;
2983
- const V = () => {
2984
- m = window.innerWidth - 300, v = window.innerHeight, y = Math.floor(m / 2), w = Math.floor(v / 2), e.setSize(m, v);
2985
- let j = m, D = v;
2995
+ let u = window.innerWidth, p = window.innerHeight, b = Math.floor(u / 2), S = Math.floor(p / 2), F = -1;
2996
+ const U = () => {
2997
+ u = window.innerWidth - 300, p = window.innerHeight, b = Math.floor(u / 2), S = Math.floor(p / 2), e.setSize(u, p);
2998
+ let M = u, k = p;
2986
2999
  switch (n) {
2987
3000
  case "Side by Side":
2988
- j = y, D = v;
3001
+ M = b, k = p;
2989
3002
  break;
2990
3003
  case "Stacked":
2991
- j = m, D = w;
3004
+ M = u, k = S;
2992
3005
  break;
2993
3006
  case "Quad":
2994
- j = y, D = w;
3007
+ M = b, k = S;
2995
3008
  break;
2996
3009
  }
2997
- X.forEach((z) => {
2998
- var ce;
2999
- z instanceof en ? (z.left = j / -2, z.right = j / 2, z.top = D / 2, z.bottom = D / -2, z.updateProjectionMatrix()) : z instanceof Tt && (z.aspect = j / D, z.updateProjectionMatrix(), (ce = me.get(z.name)) == null || ce.update());
3010
+ ne.forEach((X) => {
3011
+ var pe;
3012
+ X instanceof sn ? (X.left = M / -2, X.right = M / 2, X.top = k / 2, X.bottom = k / -2, X.updateProjectionMatrix()) : X instanceof _t && (X.aspect = M / k, X.updateProjectionMatrix(), (pe = Ee.get(X.name)) == null || pe.update());
3000
3013
  });
3001
- }, Z = () => {
3002
- e.setViewport(0, 0, m, v), e.setScissor(0, 0, m, v), e.render(A, G);
3003
- }, se = () => {
3014
+ }, N = () => {
3015
+ e.setViewport(0, 0, u, p), e.setScissor(0, 0, u, p), e.render(V, $);
3016
+ }, D = () => {
3004
3017
  if (n === "Side by Side")
3005
- e.setViewport(0, 0, y, v), e.setScissor(0, 0, y, v), e.render(A, G), e.setViewport(y, 0, y, v), e.setScissor(y, 0, y, v), e.render(A, te);
3018
+ e.setViewport(0, 0, b, p), e.setScissor(0, 0, b, p), e.render(V, $), e.setViewport(b, 0, b, p), e.setScissor(b, 0, b, p), e.render(V, re);
3006
3019
  else {
3007
- const j = v - w;
3008
- e.setViewport(0, j, m, w), e.setScissor(0, j, m, w), e.render(A, G), e.setViewport(0, 0, m, w), e.setScissor(0, 0, m, w), e.render(A, te);
3020
+ const M = p - S;
3021
+ e.setViewport(0, M, u, S), e.setScissor(0, M, u, S), e.render(V, $), e.setViewport(0, 0, u, S), e.setScissor(0, 0, u, S), e.render(V, re);
3009
3022
  }
3010
- }, Y = () => {
3011
- let j = 0, D = 0;
3012
- D = v - w, j = 0, e.setViewport(j, D, y, w), e.setScissor(j, D, y, w), e.render(A, G), j = y, e.setViewport(j, D, y, w), e.setScissor(j, D, y, w), e.render(A, te), D = 0, j = 0, e.setViewport(j, D, y, w), e.setScissor(j, D, y, w), e.render(A, Fe), j = y, e.setViewport(j, D, y, w), e.setScissor(j, D, y, w), e.render(A, Ue);
3013
- }, fe = () => {
3014
- switch (H.forEach((j) => {
3015
- j.update();
3016
- }), e.clear(), n) {
3023
+ }, L = () => {
3024
+ let M = 0, k = 0;
3025
+ k = p - S, M = 0, e.setViewport(M, k, b, S), e.setScissor(M, k, b, S), e.render(V, $), M = b, e.setViewport(M, k, b, S), e.setScissor(M, k, b, S), e.render(V, re), k = 0, M = 0, e.setViewport(M, k, b, S), e.setScissor(M, k, b, S), e.render(V, Ae), M = b, e.setViewport(M, k, b, S), e.setScissor(M, k, b, S), e.render(V, Ie);
3026
+ }, Q = () => {
3027
+ switch (ie.forEach((M) => {
3028
+ M.update();
3029
+ }), t.onSceneUpdate !== void 0 && nn && t.onSceneUpdate(xe), e.clear(), n) {
3017
3030
  case "Single":
3018
- Z();
3031
+ N();
3019
3032
  break;
3020
3033
  case "Side by Side":
3021
3034
  case "Stacked":
3022
- se();
3035
+ D();
3023
3036
  break;
3024
3037
  case "Quad":
3025
- Y();
3038
+ L();
3026
3039
  break;
3027
3040
  }
3028
- F = requestAnimationFrame(fe);
3041
+ F = requestAnimationFrame(Q);
3029
3042
  };
3030
- return S(), window.addEventListener("resize", V), V(), fe(), () => {
3031
- window.removeEventListener("resize", V), cancelAnimationFrame(F), F = -1;
3043
+ return ce(), window.addEventListener("resize", U), U(), Q(), () => {
3044
+ window.removeEventListener("resize", U), cancelAnimationFrame(F), F = -1;
3032
3045
  };
3046
+ }, [n, e]), Ne(() => {
3047
+ if (e !== null) {
3048
+ const u = new Gn(), p = new ue(), b = (N, D, L, Q) => {
3049
+ switch (n) {
3050
+ case "Quad":
3051
+ N < L ? D < Q ? u.setFromCamera(p, $) : u.setFromCamera(p, Ae) : D < Q ? u.setFromCamera(p, re) : u.setFromCamera(p, Ie);
3052
+ break;
3053
+ case "Side by Side":
3054
+ N < L ? u.setFromCamera(p, $) : u.setFromCamera(p, re);
3055
+ break;
3056
+ case "Single":
3057
+ u.setFromCamera(p, $);
3058
+ break;
3059
+ case "Stacked":
3060
+ D < Q ? u.setFromCamera(p, $) : u.setFromCamera(p, re);
3061
+ break;
3062
+ }
3063
+ }, S = (N) => {
3064
+ if (!bt)
3065
+ return;
3066
+ const D = new ue();
3067
+ e.getSize(D);
3068
+ const L = Math.min(N.clientX, D.x), Q = Math.min(N.clientY, D.y);
3069
+ p.x = We(L, 0, D.x, -1, 1), p.y = We(Q, 0, D.y, 1, -1);
3070
+ const M = D.x / 2, k = D.y / 2, X = () => {
3071
+ L < M ? p.x = We(L, 0, M, -1, 1) : p.x = We(L, M, D.x, -1, 1);
3072
+ }, pe = () => {
3073
+ Q < k ? p.y = We(Q, 0, k, 1, -1) : p.y = We(Q, k, D.y, 1, -1);
3074
+ };
3075
+ switch (n) {
3076
+ case "Quad":
3077
+ X(), pe();
3078
+ break;
3079
+ case "Side by Side":
3080
+ X();
3081
+ break;
3082
+ case "Stacked":
3083
+ pe(), pe();
3084
+ break;
3085
+ }
3086
+ b(L, Q, M, k);
3087
+ const Te = u.intersectObjects(xe.children);
3088
+ Te.length > 0 && it.position.copy(Te[0].point);
3089
+ }, F = (N) => {
3090
+ if (!bt)
3091
+ return;
3092
+ const D = new ue();
3093
+ if (e.getSize(D), N.clientX >= D.x)
3094
+ return;
3095
+ S(N);
3096
+ const L = u.intersectObjects(xe.children);
3097
+ L.length > 0 && t.three.getObject(L[0].object.uuid);
3098
+ }, U = R.current;
3099
+ return U.addEventListener("mousemove", S, !1), U.addEventListener("click", F, !1), () => {
3100
+ U.removeEventListener("mousemove", S), U.removeEventListener("click", F);
3101
+ };
3102
+ }
3033
3103
  }, [n, e]);
3034
- const O = [];
3035
- return X.forEach((m, v) => {
3036
- O.push(v);
3037
- }), /* @__PURE__ */ l.jsxs("div", { className: "multiview", children: [
3038
- /* @__PURE__ */ l.jsx("canvas", { ref: u }),
3039
- /* @__PURE__ */ l.jsxs("div", { className: `cameras ${n === "Single" || n === "Stacked" ? "single" : ""}`, children: [
3040
- n === "Single" && /* @__PURE__ */ l.jsx(l.Fragment, { children: /* @__PURE__ */ l.jsx(Te, { camera: G, options: O, ref: c, onSelect: (m) => {
3041
- var y;
3042
- (y = H.get(G.name)) == null || y.dispose();
3043
- const v = X.get(m);
3044
- v !== void 0 && (b(G), G = v, h(v, c.current));
3104
+ const ee = [];
3105
+ return ne.forEach((u, p) => {
3106
+ ee.push(p);
3107
+ }), /* @__PURE__ */ c.jsxs("div", { className: "multiview", children: [
3108
+ /* @__PURE__ */ c.jsx("canvas", { ref: x }),
3109
+ /* @__PURE__ */ c.jsxs("div", { className: `cameras ${n === "Single" || n === "Stacked" ? "single" : ""}`, ref: R, children: [
3110
+ n === "Single" && /* @__PURE__ */ c.jsx(c.Fragment, { children: /* @__PURE__ */ c.jsx(ke, { camera: $, options: ee, ref: T, onSelect: (u) => {
3111
+ var b;
3112
+ (b = ie.get($.name)) == null || b.dispose();
3113
+ const p = ne.get(u);
3114
+ p !== void 0 && (K($), $ = p, C(p, T.current));
3045
3115
  } }) }),
3046
- (n === "Side by Side" || n === "Stacked") && /* @__PURE__ */ l.jsxs(l.Fragment, { children: [
3047
- /* @__PURE__ */ l.jsx(Te, { camera: G, options: O, ref: c, onSelect: (m) => {
3048
- var y;
3049
- (y = H.get(G.name)) == null || y.dispose();
3050
- const v = X.get(m);
3051
- v !== void 0 && (b(G), G = v, h(v, c.current));
3116
+ (n === "Side by Side" || n === "Stacked") && /* @__PURE__ */ c.jsxs(c.Fragment, { children: [
3117
+ /* @__PURE__ */ c.jsx(ke, { camera: $, options: ee, ref: T, onSelect: (u) => {
3118
+ var b;
3119
+ (b = ie.get($.name)) == null || b.dispose();
3120
+ const p = ne.get(u);
3121
+ p !== void 0 && (K($), $ = p, C(p, T.current));
3052
3122
  } }),
3053
- /* @__PURE__ */ l.jsx(Te, { camera: te, options: O, ref: s, onSelect: (m) => {
3054
- var y;
3055
- (y = H.get(te.name)) == null || y.dispose();
3056
- const v = X.get(m);
3057
- v !== void 0 && (b(te), te = v, h(v, s.current));
3123
+ /* @__PURE__ */ c.jsx(ke, { camera: re, options: ee, ref: B, onSelect: (u) => {
3124
+ var b;
3125
+ (b = ie.get(re.name)) == null || b.dispose();
3126
+ const p = ne.get(u);
3127
+ p !== void 0 && (K(re), re = p, C(p, B.current));
3058
3128
  } })
3059
3129
  ] }),
3060
- n === "Quad" && /* @__PURE__ */ l.jsxs(l.Fragment, { children: [
3061
- /* @__PURE__ */ l.jsx(Te, { camera: G, options: O, ref: c, onSelect: (m) => {
3062
- var y;
3063
- (y = H.get(G.name)) == null || y.dispose();
3064
- const v = X.get(m);
3065
- v !== void 0 && (b(G), G = v, h(v, c.current));
3130
+ n === "Quad" && /* @__PURE__ */ c.jsxs(c.Fragment, { children: [
3131
+ /* @__PURE__ */ c.jsx(ke, { camera: $, options: ee, ref: T, onSelect: (u) => {
3132
+ var b;
3133
+ (b = ie.get($.name)) == null || b.dispose();
3134
+ const p = ne.get(u);
3135
+ p !== void 0 && (K($), $ = p, C(p, T.current));
3066
3136
  } }),
3067
- /* @__PURE__ */ l.jsx(Te, { camera: te, options: O, ref: s, onSelect: (m) => {
3068
- var y;
3069
- (y = H.get(te.name)) == null || y.dispose();
3070
- const v = X.get(m);
3071
- v !== void 0 && (b(te), te = v, h(v, s.current));
3137
+ /* @__PURE__ */ c.jsx(ke, { camera: re, options: ee, ref: B, onSelect: (u) => {
3138
+ var b;
3139
+ (b = ie.get(re.name)) == null || b.dispose();
3140
+ const p = ne.get(u);
3141
+ p !== void 0 && (K(re), re = p, C(p, B.current));
3072
3142
  } }),
3073
- /* @__PURE__ */ l.jsx(Te, { camera: Fe, options: O, ref: d, onSelect: (m) => {
3074
- var y;
3075
- (y = H.get(Fe.name)) == null || y.dispose();
3076
- const v = X.get(m);
3077
- v !== void 0 && (b(Fe), Fe = v, h(v, d.current));
3143
+ /* @__PURE__ */ c.jsx(ke, { camera: Ae, options: ee, ref: oe, onSelect: (u) => {
3144
+ var b;
3145
+ (b = ie.get(Ae.name)) == null || b.dispose();
3146
+ const p = ne.get(u);
3147
+ p !== void 0 && (K(Ae), Ae = p, C(p, oe.current));
3078
3148
  } }),
3079
- /* @__PURE__ */ l.jsx(Te, { camera: Ue, options: O, ref: p, onSelect: (m) => {
3080
- var y;
3081
- (y = H.get(Ue.name)) == null || y.dispose();
3082
- const v = X.get(m);
3083
- v !== void 0 && (b(Ue), Ue = v, h(v, p.current));
3149
+ /* @__PURE__ */ c.jsx(ke, { camera: Ie, options: ee, ref: H, onSelect: (u) => {
3150
+ var b;
3151
+ (b = ie.get(Ie.name)) == null || b.dispose();
3152
+ const p = ne.get(u);
3153
+ p !== void 0 && (K(Ie), Ie = p, C(p, H.current));
3084
3154
  } })
3085
3155
  ] })
3086
3156
  ] }),
3087
- /* @__PURE__ */ l.jsxs("div", { className: "settings", children: [
3088
- /* @__PURE__ */ l.jsx(
3089
- _t,
3157
+ /* @__PURE__ */ c.jsxs("div", { className: "settings", children: [
3158
+ /* @__PURE__ */ c.jsx(
3159
+ yt,
3090
3160
  {
3091
- index: Xt.indexOf(n),
3092
- options: Xt,
3093
- onSelect: (m) => {
3094
- m !== n && (x(), a(m));
3161
+ index: en.indexOf(n),
3162
+ options: en,
3163
+ onSelect: (u) => {
3164
+ u !== n && (de(), i(u));
3165
+ },
3166
+ open: s,
3167
+ onToggle: (u) => {
3168
+ h(u), l && d(!1), m && v(!1);
3095
3169
  }
3096
3170
  }
3097
3171
  ),
3098
- /* @__PURE__ */ l.jsx(
3099
- _t,
3172
+ /* @__PURE__ */ c.jsx(
3173
+ yt,
3100
3174
  {
3101
- index: qt.indexOf(mt),
3102
- options: qt,
3103
- onSelect: (m) => {
3104
- if (m !== mt)
3105
- switch (mt = m, mt) {
3175
+ index: tn.indexOf(vt),
3176
+ options: tn,
3177
+ onSelect: (u) => {
3178
+ if (u !== vt)
3179
+ switch (vt = u, vt) {
3106
3180
  case "Depth":
3107
- A.overrideMaterial = Ma;
3181
+ V.overrideMaterial = Ni;
3108
3182
  break;
3109
3183
  case "Normals":
3110
- A.overrideMaterial = Pa;
3184
+ V.overrideMaterial = Li;
3111
3185
  break;
3112
3186
  default:
3113
3187
  case "Renderer":
3114
- A.overrideMaterial = null;
3188
+ V.overrideMaterial = null;
3115
3189
  break;
3116
3190
  case "Wireframe":
3117
- A.overrideMaterial = _a;
3191
+ V.overrideMaterial = Ui;
3118
3192
  break;
3119
3193
  case "UVs":
3120
- A.overrideMaterial = ja;
3194
+ V.overrideMaterial = Fi;
3121
3195
  break;
3122
3196
  }
3197
+ },
3198
+ open: l,
3199
+ onToggle: (u) => {
3200
+ s && h(!1), d(u), m && v(!1);
3201
+ }
3202
+ }
3203
+ ),
3204
+ /* @__PURE__ */ c.jsx(
3205
+ yt,
3206
+ {
3207
+ index: 0,
3208
+ options: [
3209
+ "Orbit Mode",
3210
+ "Selection Mode"
3211
+ ],
3212
+ onSelect: (u) => {
3213
+ bt = u === "Selection Mode", it.visible = bt;
3214
+ },
3215
+ open: m,
3216
+ onToggle: (u) => {
3217
+ s && h(!1), l && d(!1), v(u);
3123
3218
  }
3124
3219
  }
3125
3220
  )
3126
3221
  ] })
3127
3222
  ] });
3128
3223
  }
3129
- function Ja(t) {
3130
- return /* @__PURE__ */ l.jsxs("div", { className: "editor", ref: t.ref, style: t.style, children: [
3131
- /* @__PURE__ */ l.jsx("header", { children: t.header }),
3224
+ function or(t) {
3225
+ return /* @__PURE__ */ c.jsxs("div", { className: "editor", ref: t.ref, style: t.style, children: [
3226
+ /* @__PURE__ */ c.jsx("header", { children: t.header }),
3132
3227
  t.children,
3133
- /* @__PURE__ */ l.jsx("footer", { children: t.footer })
3228
+ /* @__PURE__ */ c.jsx("footer", { children: t.footer })
3134
3229
  ] });
3135
3230
  }
3136
3231
  export {
3137
- jt as Accordion,
3138
- Va as Application,
3139
- gt as BaseRemote,
3140
- un as ChildObject,
3141
- fa as ContainerObject,
3142
- na as Draggable,
3143
- ta as DraggableItem,
3144
- aa as Dropdown,
3145
- ra as DropdownItem,
3146
- Ja as Editor,
3147
- ca as InfiniteGridHelper,
3148
- Oa as Inspector,
3149
- Za as MultiView,
3150
- ln as NavButton,
3151
- Ya as RemoteComponents,
3152
- Ka as RemoteController,
3153
- za as RemoteTheatre,
3154
- Wa as RemoteThree,
3155
- Ha as RemoteTweakpane,
3156
- Xa as SceneHierarchy,
3157
- qa as SceneInspector,
3158
- N as ToolEvents,
3159
- da as UVMaterial,
3160
- Ba as clamp,
3161
- Yn as colorToHex,
3162
- I as debugDispatcher,
3163
- on as dispose,
3164
- Wn as disposeMaterial,
3165
- Ga as disposeTexture,
3166
- $a as distance,
3167
- rn as hierarchyUUID,
3168
- Vn as isColor,
3169
- Gn as randomID,
3170
- zn as resetThreeObjects,
3171
- Ct as round,
3172
- Rt as totalThreeObjects
3232
+ Nt as Accordion,
3233
+ qi as Application,
3234
+ Et as BaseRemote,
3235
+ vn as ChildObject,
3236
+ yi as ContainerObject,
3237
+ li as Draggable,
3238
+ ci as DraggableItem,
3239
+ ui as Dropdown,
3240
+ di as DropdownItem,
3241
+ or as Editor,
3242
+ mi as InfiniteGridHelper,
3243
+ ki as Inspector,
3244
+ ar as MultiView,
3245
+ gn as NavButton,
3246
+ Qi as RemoteComponents,
3247
+ nr as RemoteController,
3248
+ Ji as RemoteTheatre,
3249
+ er as RemoteThree,
3250
+ tr as RemoteTweakpane,
3251
+ rr as SceneInspector,
3252
+ ir as SidePanel,
3253
+ Y as ToolEvents,
3254
+ bi as UVMaterial,
3255
+ Ki as clamp,
3256
+ Qn as colorToHex,
3257
+ z as debugDispatcher,
3258
+ hn as dispose,
3259
+ ei as disposeMaterial,
3260
+ Zi as disposeTexture,
3261
+ Xi as distance,
3262
+ fn as hierarchyUUID,
3263
+ qn as isColor,
3264
+ Zn as randomID,
3265
+ Jn as resetThreeObjects,
3266
+ Mt as round,
3267
+ Dt as totalThreeObjects
3173
3268
  };