@tomorrowevening/hermes 0.0.37 → 0.0.39

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 (75) hide show
  1. package/dist/hermes.cjs.js +15 -15
  2. package/dist/hermes.esm.js +809 -811
  3. package/package.json +1 -5
  4. package/types/core/Application.d.ts +5 -4
  5. package/types/core/remote/BaseRemote.d.ts +4 -0
  6. package/types/core/remote/RemoteComponents.d.ts +1 -2
  7. package/types/core/remote/RemoteTheatre.d.ts +3 -4
  8. package/types/core/remote/RemoteThree.d.ts +2 -3
  9. package/types/core/remote/RemoteTweakpane.d.ts +1 -1
  10. package/types/editor/sidePanel/SidePanel.d.ts +1 -9
  11. package/dist/hermes.umd.js +0 -144
  12. package/src/core/Application.ts +0 -111
  13. package/src/core/RemoteController.ts +0 -60
  14. package/src/core/remote/BaseRemote.ts +0 -16
  15. package/src/core/remote/RemoteComponents.ts +0 -45
  16. package/src/core/remote/RemoteTheatre.ts +0 -300
  17. package/src/core/remote/RemoteThree.ts +0 -143
  18. package/src/core/remote/RemoteTweakpane.ts +0 -194
  19. package/src/core/types.ts +0 -56
  20. package/src/editor/Editor.tsx +0 -20
  21. package/src/editor/components/Draggable.tsx +0 -40
  22. package/src/editor/components/DraggableItem.tsx +0 -22
  23. package/src/editor/components/Dropdown.tsx +0 -38
  24. package/src/editor/components/DropdownItem.tsx +0 -64
  25. package/src/editor/components/NavButton.tsx +0 -11
  26. package/src/editor/components/content.ts +0 -2
  27. package/src/editor/components/icons/CloseIcon.tsx +0 -7
  28. package/src/editor/components/icons/DragIcon.tsx +0 -9
  29. package/src/editor/components/types.ts +0 -41
  30. package/src/editor/global.ts +0 -20
  31. package/src/editor/multiView/CameraWindow.tsx +0 -74
  32. package/src/editor/multiView/InfiniteGridHelper.ts +0 -24
  33. package/src/editor/multiView/InfiniteGridMaterial.ts +0 -127
  34. package/src/editor/multiView/MultiView.scss +0 -101
  35. package/src/editor/multiView/MultiView.tsx +0 -636
  36. package/src/editor/multiView/MultiViewData.ts +0 -59
  37. package/src/editor/multiView/UVMaterial.ts +0 -55
  38. package/src/editor/scss/_debug.scss +0 -58
  39. package/src/editor/scss/_draggable.scss +0 -43
  40. package/src/editor/scss/_dropdown.scss +0 -84
  41. package/src/editor/scss/_sidePanel.scss +0 -278
  42. package/src/editor/scss/_theme.scss +0 -9
  43. package/src/editor/scss/index.scss +0 -67
  44. package/src/editor/sidePanel/Accordion.tsx +0 -41
  45. package/src/editor/sidePanel/ChildObject.tsx +0 -57
  46. package/src/editor/sidePanel/ContainerObject.tsx +0 -11
  47. package/src/editor/sidePanel/SidePanel.tsx +0 -64
  48. package/src/editor/sidePanel/ToggleBtn.tsx +0 -27
  49. package/src/editor/sidePanel/inspector/Inspector.tsx +0 -119
  50. package/src/editor/sidePanel/inspector/InspectorField.tsx +0 -198
  51. package/src/editor/sidePanel/inspector/InspectorGroup.tsx +0 -50
  52. package/src/editor/sidePanel/inspector/SceneInspector.tsx +0 -84
  53. package/src/editor/sidePanel/inspector/inspector.scss +0 -161
  54. package/src/editor/sidePanel/inspector/utils/InspectAnimation.tsx +0 -102
  55. package/src/editor/sidePanel/inspector/utils/InspectCamera.tsx +0 -75
  56. package/src/editor/sidePanel/inspector/utils/InspectLight.tsx +0 -62
  57. package/src/editor/sidePanel/inspector/utils/InspectMaterial.tsx +0 -710
  58. package/src/editor/sidePanel/inspector/utils/InspectTransform.tsx +0 -113
  59. package/src/editor/sidePanel/types.ts +0 -130
  60. package/src/editor/sidePanel/utils.ts +0 -278
  61. package/src/editor/utils.ts +0 -117
  62. package/src/example/CustomEditor.tsx +0 -78
  63. package/src/example/components/App.css +0 -6
  64. package/src/example/components/App.tsx +0 -246
  65. package/src/example/constants.ts +0 -52
  66. package/src/example/index.scss +0 -45
  67. package/src/example/main.tsx +0 -37
  68. package/src/example/three/BaseScene.ts +0 -42
  69. package/src/example/three/CustomMaterial.ts +0 -72
  70. package/src/example/three/FBXAnimation.ts +0 -26
  71. package/src/example/three/Scene1.ts +0 -225
  72. package/src/example/three/Scene2.ts +0 -138
  73. package/src/example/three/loader.ts +0 -110
  74. package/src/index.ts +0 -27
  75. package/src/vite-env.d.ts +0 -1
@@ -1,30 +1,30 @@
1
- import { PositionalAudio as Hn, EventDispatcher as un, Texture as dn, CubeTexture as Wn, RepeatWrapping as Kt, ShaderMaterial as fn, GLSL3 as qn, DoubleSide as hn, Color as Tt, Mesh as Kn, PlaneGeometry as Xn, FrontSide as Zn, BackSide as Jn, NoBlending as Qn, NormalBlending as ea, AdditiveBlending as ta, SubtractiveBlending as na, MultiplyBlending as aa, CustomBlending as ia, AddEquation as ra, SubtractEquation as oa, ReverseSubtractEquation as sa, MinEquation as ca, MaxEquation as la, ZeroFactor as pn, OneFactor as mn, SrcColorFactor as vn, OneMinusSrcColorFactor as gn, SrcAlphaFactor as bn, OneMinusSrcAlphaFactor as yn, DstAlphaFactor as En, OneMinusDstAlphaFactor as Cn, DstColorFactor as xn, OneMinusDstColorFactor as Sn, SrcAlphaSaturateFactor as ua, ConstantColorFactor as wn, OneMinusConstantColorFactor as On, ConstantAlphaFactor as Mn, OneMinusConstantAlphaFactor as Tn, Matrix4 as da, Vector3 as X, Euler as fa, Ray as ha, Plane as pa, MathUtils as ma, MOUSE as He, TOUCH as We, Quaternion as Xt, Spherical as Zt, Vector2 as ue, PerspectiveCamera as zt, MeshDepthMaterial as va, MeshNormalMaterial as ga, MeshBasicMaterial as ba, OrthographicCamera as Rn, Scene as Pn, Group as ya, AxesHelper as An, WebGLRenderer as Ea, Raycaster as Ca, CameraHelper as xa } from "three";
2
- import { getProject as Sa, createRafDriver as wa } from "@theatre/core";
3
- import ct from "@theatre/studio";
4
- import { Pane as Oa } from "tweakpane";
5
- import * as Ma from "@tweakpane/plugin-essentials";
6
- import kn, { useState as oe, useRef as ye, useEffect as Be, Component as Ta, forwardRef as Ra } from "react";
7
- import { Reorder as _n } from "framer-motion";
1
+ import { PositionalAudio as Vn, EventDispatcher as un, Texture as dn, CubeTexture as Hn, RepeatWrapping as Kt, ShaderMaterial as hn, GLSL3 as Wn, DoubleSide as fn, Color as Tt, Mesh as qn, PlaneGeometry as Kn, FrontSide as Xn, BackSide as Zn, NoBlending as Jn, NormalBlending as Qn, AdditiveBlending as ea, SubtractiveBlending as ta, MultiplyBlending as na, CustomBlending as aa, AddEquation as ia, SubtractEquation as ra, ReverseSubtractEquation as oa, MinEquation as sa, MaxEquation as ca, ZeroFactor as pn, OneFactor as mn, SrcColorFactor as vn, OneMinusSrcColorFactor as gn, SrcAlphaFactor as bn, OneMinusSrcAlphaFactor as yn, DstAlphaFactor as En, OneMinusDstAlphaFactor as Cn, DstColorFactor as xn, OneMinusDstColorFactor as wn, SrcAlphaSaturateFactor as la, ConstantColorFactor as Sn, OneMinusConstantColorFactor as On, ConstantAlphaFactor as Mn, OneMinusConstantAlphaFactor as Tn, Matrix4 as ua, Vector3 as X, Euler as da, Ray as ha, Plane as fa, MathUtils as pa, MOUSE as Ve, TOUCH as He, Quaternion as Xt, Spherical as Zt, Vector2 as ue, PerspectiveCamera as zt, MeshDepthMaterial as ma, MeshNormalMaterial as va, MeshBasicMaterial as ga, OrthographicCamera as Rn, Scene as _n, Group as ba, AxesHelper as An, WebGLRenderer as ya, Raycaster as Ea, CameraHelper as Ca } from "three";
2
+ import { getProject as xa, createRafDriver as wa } from "@theatre/core";
3
+ import at from "@theatre/studio";
4
+ import { Pane as Sa } from "tweakpane";
5
+ import * as Oa from "@tweakpane/plugin-essentials";
6
+ import Pn, { useState as ae, useRef as Ee, useEffect as Oe, forwardRef as Ma } from "react";
7
+ import { Reorder as kn } from "framer-motion";
8
8
  function lt(t) {
9
9
  return t.substring(0, 1).toUpperCase() + t.substring(1);
10
10
  }
11
- function $i(t, n, a) {
11
+ function Ai(t, n, a) {
12
12
  return Math.min(n, Math.max(t, a));
13
13
  }
14
- function zi(t, n) {
14
+ function Pi(t, n) {
15
15
  const a = t - n;
16
16
  return Math.sqrt(a * a);
17
17
  }
18
- function Pa() {
18
+ function Ta() {
19
19
  return Math.round(Math.random() * 1e6).toString();
20
20
  }
21
- function Aa(t) {
21
+ function Ra(t) {
22
22
  return t.r !== void 0 && t.g !== void 0 && t.b !== void 0;
23
23
  }
24
- function ka(t) {
24
+ function _a(t) {
25
25
  const n = Math.round(t.r * 255), a = Math.round(t.g * 255), e = Math.round(t.b * 255), o = (u) => {
26
- const d = u.toString(16);
27
- return d.length === 1 ? "0" + d : d;
26
+ const f = u.toString(16);
27
+ return f.length === 1 ? "0" + f : f;
28
28
  }, s = o(n), p = o(a), c = o(e);
29
29
  return "#" + s + p + c;
30
30
  }
@@ -32,7 +32,7 @@ function Ft(t, n = 1) {
32
32
  return Number(t.toFixed(n));
33
33
  }
34
34
  let Yt = 0;
35
- const _a = () => {
35
+ const Aa = () => {
36
36
  Yt = 0;
37
37
  }, jn = (t) => {
38
38
  if (!t)
@@ -41,50 +41,58 @@ const _a = () => {
41
41
  n.length === 0 && (n = `obj_${Yt}`, Yt++), t.parent !== null && (n = `${t.parent.uuid}.${n}`), t.uuid = n, t.children.forEach((a) => {
42
42
  jn(a);
43
43
  });
44
- }, Yi = (t) => {
44
+ }, ki = (t) => {
45
45
  t?.dispose();
46
- }, ja = (t) => {
46
+ }, Pa = (t) => {
47
47
  t && (Array.isArray(t) ? t.forEach((n) => n.dispose()) : t.dispose());
48
48
  }, Dn = (t) => {
49
49
  if (t) {
50
50
  for (; t.children.length > 0; ) {
51
51
  const n = t.children[0];
52
- n instanceof Hn ? (n.pause(), n.parent && n.parent.remove(n)) : Dn(n);
52
+ n instanceof Vn ? (n.pause(), n.parent && n.parent.remove(n)) : Dn(n);
53
53
  }
54
54
  if (t.parent && t.parent.remove(t), t.isMesh) {
55
55
  const n = t;
56
- n.geometry?.dispose(), ja(n.material);
56
+ n.geometry?.dispose(), Pa(n.material);
57
57
  }
58
58
  t.dispose !== void 0 && t.dispose();
59
59
  }
60
60
  };
61
- class Gi {
61
+ class ji {
62
62
  components = /* @__PURE__ */ new Map();
63
63
  listen;
64
64
  // Protected
65
65
  _debugEnabled;
66
- broadcastChannel = void 0;
67
- webSocket = void 0;
66
+ _broadcastChannel = void 0;
67
+ _webSocket = void 0;
68
68
  _mode = "app";
69
69
  _connected = !1;
70
- useBC = !1;
71
- constructor(n, a, e = !0, o = "editor") {
72
- this.editor = a && document.location.hash.search(o) > -1, this._debugEnabled = a, a && (this.useBC = e, e ? (this.broadcastChannel = new BroadcastChannel(n), this.broadcastChannel.addEventListener("message", this.messageHandler)) : (this.webSocket = new WebSocket(n), this.webSocket.addEventListener("open", this.openHandler), this.webSocket.addEventListener("close", this.closeHandler), this.webSocket.addEventListener("message", this.messageHandler)));
70
+ _useBC = !1;
71
+ constructor(n, a, e = !0) {
72
+ this._debugEnabled = a, a && (this._useBC = e, e ? (this._broadcastChannel = new BroadcastChannel(n), this._broadcastChannel.addEventListener("message", this.messageHandler)) : (this._webSocket = new WebSocket(n), this._webSocket.addEventListener("open", this.openHandler), this._webSocket.addEventListener("close", this.closeHandler), this._webSocket.addEventListener("message", this.messageHandler)));
73
+ }
74
+ // Set editor and add components here
75
+ init() {
76
+ return new Promise((n) => {
77
+ this.components.forEach((a) => {
78
+ a.handleEditorApp();
79
+ }), n();
80
+ });
73
81
  }
74
82
  addComponent(n, a) {
75
83
  this.components.set(n, a);
76
84
  }
77
85
  dispose() {
78
- this.broadcastChannel !== void 0 && this.broadcastChannel.removeEventListener("message", this.messageHandler), this.webSocket !== void 0 && (this.webSocket.removeEventListener("open", this.openHandler), this.webSocket.removeEventListener("close", this.closeHandler), this.webSocket.removeEventListener("message", this.messageHandler)), this.components.forEach((n) => {
86
+ this._broadcastChannel !== void 0 && this._broadcastChannel.removeEventListener("message", this.messageHandler), this._webSocket !== void 0 && (this._webSocket.removeEventListener("open", this.openHandler), this._webSocket.removeEventListener("close", this.closeHandler), this._webSocket.removeEventListener("message", this.messageHandler)), this.components.forEach((n) => {
79
87
  n.dispose();
80
88
  }), this.components.clear();
81
89
  }
82
90
  // Remote
83
91
  send(n) {
84
- this._mode !== n.target && (this.useBC ? this.broadcastChannel?.postMessage(n) : this._connected && this.webSocket?.send(JSON.stringify(n)));
92
+ this._mode !== n.target && (this._useBC ? this._broadcastChannel?.postMessage(n) : this._connected && this._webSocket?.send(JSON.stringify(n)));
85
93
  }
86
94
  messageHandler = (n) => {
87
- this.listen !== void 0 && (this.useBC ? this.listen(n.data) : this.listen(JSON.parse(n.data)));
95
+ this.listen !== void 0 && (this._useBC ? this.listen(n.data) : this.listen(JSON.parse(n.data)));
88
96
  };
89
97
  openHandler = () => {
90
98
  this._connected = !0;
@@ -109,10 +117,10 @@ class Gi {
109
117
  return this._mode === "editor";
110
118
  }
111
119
  set editor(n) {
112
- n && (this._mode = "editor", document.title += " - Editor");
120
+ n && (this._mode = "editor");
113
121
  }
114
122
  }
115
- const _ = new un(), j = {
123
+ const k = new un(), j = {
116
124
  CUSTOM: "ToolEvents::custom",
117
125
  // Components
118
126
  SELECT_DROPDOWN: "ToolEvents::selectDropdown",
@@ -135,8 +143,18 @@ class Rt {
135
143
  }
136
144
  dispose() {
137
145
  }
146
+ // Remote Controller
147
+ // Receives App events
148
+ handleApp(n) {
149
+ }
150
+ // Receives Editor events
151
+ handleEditor(n) {
152
+ }
153
+ // Runs only in-editor
154
+ handleEditorApp() {
155
+ }
138
156
  }
139
- class Da extends Rt {
157
+ class Di extends Rt {
140
158
  selectDropdown(n, a) {
141
159
  this.app.send({
142
160
  event: "selectComponent",
@@ -157,20 +175,23 @@ class Da extends Rt {
157
175
  }
158
176
  });
159
177
  }
160
- }
161
- function Ia(t, n) {
162
- switch (n.event) {
163
- case "selectComponent":
164
- _.dispatchEvent({ type: j.SELECT_DROPDOWN, value: n.data });
165
- break;
166
- case "draggableListUpdate":
167
- _.dispatchEvent({ type: j.DRAG_UPDATE, value: n.data });
168
- break;
178
+ // Remote Controller
179
+ // Receives App events
180
+ handleApp(n) {
181
+ switch (n.event) {
182
+ case "selectComponent":
183
+ k.dispatchEvent({ type: j.SELECT_DROPDOWN, value: n.data });
184
+ break;
185
+ case "draggableListUpdate":
186
+ k.dispatchEvent({ type: j.DRAG_UPDATE, value: n.data });
187
+ break;
188
+ }
169
189
  }
170
190
  }
171
191
  const In = () => {
172
192
  };
173
- class Oe extends Rt {
193
+ let ge;
194
+ class st extends Rt {
174
195
  project;
175
196
  sheets = /* @__PURE__ */ new Map();
176
197
  sheetObjects = /* @__PURE__ */ new Map();
@@ -178,7 +199,7 @@ class Oe extends Rt {
178
199
  sheetObjectUnsubscribe = /* @__PURE__ */ new Map();
179
200
  static rafDriver = null;
180
201
  init(n, a) {
181
- return this.project = Sa(n, a), this.project.ready;
202
+ return this.project = xa(n, a), this.project.ready;
182
203
  }
183
204
  dispose() {
184
205
  this.project = void 0, this.sheets = /* @__PURE__ */ new Map(), this.sheetObjects = /* @__PURE__ */ new Map(), this.sheetObjectCBs = /* @__PURE__ */ new Map(), this.sheetObjectUnsubscribe = /* @__PURE__ */ new Map();
@@ -226,11 +247,11 @@ class Oe extends Rt {
226
247
  const p = `${n}_${a}`;
227
248
  let c = this.sheetObjects.get(p);
228
249
  c !== void 0 ? c = s.object(a, { ...e, ...c.value }, { reconfigure: !0 }) : c = s.object(a, e), this.sheetObjects.set(p, c), this.sheetObjectCBs.set(p, o !== void 0 ? o : In);
229
- const u = c.onValuesChange((d) => {
250
+ const u = c.onValuesChange((f) => {
230
251
  if (this.app.editor) {
231
- for (const b in d) {
232
- const E = d[b];
233
- typeof E == "object" && Aa(E) && (d[b] = {
252
+ for (const b in f) {
253
+ const E = f[b];
254
+ typeof E == "object" && Ra(E) && (f[b] = {
234
255
  r: E.r,
235
256
  g: E.g,
236
257
  b: E.b,
@@ -243,12 +264,12 @@ class Oe extends Rt {
243
264
  data: {
244
265
  sheet: n,
245
266
  sheetObject: p,
246
- values: d
267
+ values: f
247
268
  }
248
269
  });
249
270
  }
250
271
  const v = this.sheetObjectCBs.get(p);
251
- v !== void 0 && v(d);
272
+ v !== void 0 && v(f);
252
273
  });
253
274
  return this.sheetObjectUnsubscribe.set(p, u), c;
254
275
  }
@@ -262,96 +283,86 @@ class Oe extends Rt {
262
283
  const s = `${a}_${e}`, p = this.sheetObjectUnsubscribe.get(s);
263
284
  p !== void 0 && (this.sheetObjects.delete(s), this.sheetObjectCBs.delete(s), this.sheetObjectUnsubscribe.delete(s), p());
264
285
  }
265
- static getRafDriver() {
266
- return Oe.rafDriver || (Oe.rafDriver = wa()), Oe.rafDriver;
267
- }
268
- }
269
- let we;
270
- function La(t, n) {
271
- t.components.forEach((a) => {
272
- if (a instanceof Oe) {
273
- let e;
274
- const o = a;
275
- switch (n.event) {
276
- case "setSheet":
277
- e = o.sheets.get(n.data.sheet), e !== void 0 && (we = e, ct.setSelection([e]));
278
- break;
279
- case "setSheetObject":
280
- e = o.sheetObjects.get(`${n.data.sheet}_${n.data.key}`), e !== void 0 && ct.setSelection([e]);
281
- break;
282
- case "updateSheetObject":
283
- e = o.sheets.get(n.data.sheet), e !== void 0 && e.sequence.pause(), e = o.sheetObjectCBs.get(n.data.sheetObject), e !== void 0 && e(n.data.values);
284
- break;
285
- case "updateTimeline":
286
- e = o.sheets.get(n.data.sheet), we !== void 0 && (we.sequence.position = n.data.position);
287
- break;
288
- }
286
+ // Remote Controller
287
+ // Receives App events
288
+ handleApp(n) {
289
+ let a;
290
+ switch (n.event) {
291
+ case "setSheet":
292
+ a = this.sheets.get(n.data.sheet), a !== void 0 && (ge = a, at.setSelection([a]));
293
+ break;
294
+ case "setSheetObject":
295
+ a = this.sheetObjects.get(`${n.data.sheet}_${n.data.key}`), a !== void 0 && at.setSelection([a]);
296
+ break;
297
+ case "updateSheetObject":
298
+ a = this.sheets.get(n.data.sheet), a !== void 0 && a.sequence.pause(), a = this.sheetObjectCBs.get(n.data.sheetObject), a !== void 0 && a(n.data.values);
299
+ break;
300
+ case "updateTimeline":
301
+ a = this.sheets.get(n.data.sheet), ge !== void 0 && (ge.sequence.position = n.data.position);
302
+ break;
289
303
  }
290
- });
291
- }
292
- function Na(t) {
293
- if (t.editor) {
294
- let n;
295
- t.components.forEach((s) => {
296
- s instanceof Oe && (n = s);
297
- }), ct.ui.restore(), ct.onSelectionChange((s) => {
298
- s.length < 1 || s.forEach((p) => {
299
- let c = p.address.sheetId, u = "setSheet", d = {};
300
- switch (p.type) {
301
- case "Theatre_Sheet_PublicAPI":
302
- u = "setSheet", d = {
303
- sheet: p.address.sheetId
304
- }, we = n.sheets.get(p.address.sheetId);
305
- break;
306
- case "Theatre_SheetObject_PublicAPI":
307
- u = "setSheetObject", c += `_${p.address.objectKey}`, d = {
308
- id: c,
309
- sheet: p.address.sheetId,
310
- key: p.address.objectKey
311
- };
312
- break;
313
- }
314
- t.send({ event: u, target: "app", data: d });
315
- });
316
- });
317
- let a = 0;
318
- const e = () => {
319
- if (we !== void 0 && a !== we.sequence.position) {
320
- a = we.sequence.position;
321
- const s = we;
322
- t.send({
323
- event: "updateTimeline",
324
- target: "app",
325
- data: {
326
- position: a,
327
- sheet: s.address.sheetId
328
- }
329
- });
330
- }
331
- }, o = () => {
332
- e(), requestAnimationFrame(o);
333
- };
334
- e(), o();
335
- } else
336
- ct.ui.hide();
337
- }
338
- function Fa(t, n) {
339
- t.editor && t.components.forEach((a) => {
340
- if (a instanceof Oe) {
341
- const e = a;
304
+ }
305
+ // Receives Editor events
306
+ handleEditor(n) {
307
+ if (this.app.editor)
342
308
  switch (n.event) {
343
309
  case "playSheet":
344
- e.sheet(n.data.sheet)?.sequence.play(n.data.value);
310
+ this.sheet(n.data.sheet)?.sequence.play(n.data.value);
345
311
  break;
346
312
  case "pauseSheet":
347
- e.sheet(n.data.sheet)?.sequence.pause();
313
+ this.sheet(n.data.sheet)?.sequence.pause();
348
314
  break;
349
315
  }
350
- return;
351
- }
352
- });
316
+ }
317
+ // Runs only in-editor
318
+ handleEditorApp() {
319
+ if (this.app.editor) {
320
+ at.ui.restore(), at.onSelectionChange((o) => {
321
+ o.length < 1 || o.forEach((s) => {
322
+ let p = s.address.sheetId, c = "setSheet", u = {};
323
+ switch (s.type) {
324
+ case "Theatre_Sheet_PublicAPI":
325
+ c = "setSheet", u = {
326
+ sheet: s.address.sheetId
327
+ }, ge = this.sheets.get(s.address.sheetId);
328
+ break;
329
+ case "Theatre_SheetObject_PublicAPI":
330
+ c = "setSheetObject", p += `_${s.address.objectKey}`, u = {
331
+ id: p,
332
+ sheet: s.address.sheetId,
333
+ key: s.address.objectKey
334
+ }, ge = this.sheets.get(s.address.sheetId);
335
+ break;
336
+ }
337
+ this.app.send({ event: c, target: "app", data: u });
338
+ });
339
+ });
340
+ let n = -1;
341
+ const a = () => {
342
+ if (st.getRafDriver().tick(performance.now()), ge !== void 0 && n !== ge.sequence.position) {
343
+ n = ge.sequence.position;
344
+ const o = ge;
345
+ this.app.send({
346
+ event: "updateTimeline",
347
+ target: "app",
348
+ data: {
349
+ position: n,
350
+ sheet: o.address.sheetId
351
+ }
352
+ });
353
+ }
354
+ }, e = () => {
355
+ a(), requestAnimationFrame(e);
356
+ };
357
+ a(), e();
358
+ } else
359
+ at.ui.hide();
360
+ }
361
+ static getRafDriver() {
362
+ return st.rafDriver || (st.rafDriver = wa()), st.rafDriver;
363
+ }
353
364
  }
354
- function Ba(t) {
365
+ function ka(t) {
355
366
  if (t.name === "cameras")
356
367
  return "camera";
357
368
  if (t.name === "interactive")
@@ -376,7 +387,7 @@ function Ln(t) {
376
387
  n.children.push(Ln(a));
377
388
  }), n;
378
389
  }
379
- function Ua(t) {
390
+ function ja(t) {
380
391
  const n = {};
381
392
  for (const a in t) {
382
393
  const e = t[a].value;
@@ -384,7 +395,7 @@ function Ua(t) {
384
395
  }
385
396
  return n;
386
397
  }
387
- function $a(t) {
398
+ function Da(t) {
388
399
  switch (t) {
389
400
  case "blendSrcAlpha":
390
401
  case "blendDstAlpha":
@@ -396,10 +407,10 @@ function $a(t) {
396
407
  }
397
408
  return !1;
398
409
  }
399
- function qe(t) {
410
+ function We(t) {
400
411
  const n = {};
401
412
  for (const a in t) {
402
- if (a.substring(0, 1) === "_" || a.substring(0, 2) === "is" || $a(a))
413
+ if (a.substring(0, 1) === "_" || a.substring(0, 2) === "is" || Da(a))
403
414
  continue;
404
415
  const e = typeof t[a], o = t[a];
405
416
  switch (e) {
@@ -415,9 +426,9 @@ function qe(t) {
415
426
  const s = o.source.toJSON();
416
427
  n[a] = { src: s.url };
417
428
  } else
418
- o instanceof Wn && (console.log("env map"), console.log(o.source.data), console.log(o.source.toJSON()), n[a] = { src: "" });
429
+ o instanceof Hn && (console.log("env map"), console.log(o.source.data), console.log(o.source.toJSON()), n[a] = { src: "" });
419
430
  else
420
- a === "uniforms" && (n[a] = Ua(n[a]));
431
+ a === "uniforms" && (n[a] = ja(n[a]));
421
432
  else
422
433
  n[a] = { src: "" };
423
434
  break;
@@ -452,28 +463,28 @@ function Bt(t) {
452
463
  if (Array.isArray(e.material)) {
453
464
  const o = [];
454
465
  e.material.forEach((s) => {
455
- o.push(qe(s));
466
+ o.push(We(s));
456
467
  }), n.material = o;
457
468
  } else
458
- n.material = qe(e.material);
469
+ n.material = We(e.material);
459
470
  } else if (a.search("points") > -1) {
460
471
  const e = t;
461
472
  if (Array.isArray(e.material)) {
462
473
  const o = [];
463
474
  e.material.forEach((s) => {
464
- o.push(qe(s));
475
+ o.push(We(s));
465
476
  }), n.material = o;
466
477
  } else
467
- n.material = qe(e.material);
478
+ n.material = We(e.material);
468
479
  } else if (a.search("line") > -1) {
469
480
  const e = t;
470
481
  if (Array.isArray(e.material)) {
471
482
  const o = [];
472
483
  e.material.forEach((s) => {
473
- o.push(qe(s));
484
+ o.push(We(s));
474
485
  }), n.material = o;
475
486
  } else
476
- n.material = qe(e.material);
487
+ n.material = We(e.material);
477
488
  } else
478
489
  a.search("camera") > -1 ? t.type === "PerspectiveCamera" ? n.perspectiveCameraInfo = {
479
490
  fov: t.fov,
@@ -503,7 +514,7 @@ function Bt(t) {
503
514
  });
504
515
  return n;
505
516
  }
506
- function za(t, n) {
517
+ function Ia(t, n) {
507
518
  const a = n.split(".");
508
519
  switch (a.length) {
509
520
  case 1:
@@ -549,7 +560,7 @@ function Gt(t) {
549
560
  }, e.onerror = a, e.src = t;
550
561
  });
551
562
  }
552
- class Ya extends Rt {
563
+ class Ii extends Rt {
553
564
  scene = void 0;
554
565
  getObject(n) {
555
566
  this.app.debugEnabled && this.app.send({
@@ -603,7 +614,7 @@ class Ya extends Rt {
603
614
  setScene(n) {
604
615
  if (n === void 0 || (this.scene = n, !this.app.debugEnabled))
605
616
  return;
606
- _a(), jn(this.scene);
617
+ Aa(), jn(this.scene);
607
618
  const a = Ln(this.scene);
608
619
  this.app.send({
609
620
  event: "setScene",
@@ -631,40 +642,43 @@ class Ya extends Rt {
631
642
  data: a
632
643
  });
633
644
  }
634
- }
635
- function Ga(t, n) {
636
- switch (n.event) {
637
- case "getObject":
638
- _.dispatchEvent({ type: j.GET_OBJECT, value: n.data });
639
- break;
640
- case "updateObject":
641
- _.dispatchEvent({ type: j.UPDATE_OBJECT, value: n.data });
642
- break;
643
- case "createTexture":
644
- _.dispatchEvent({ type: j.CREATE_TEXTURE, value: n.data });
645
- break;
646
- case "requestMethod":
647
- _.dispatchEvent({ type: j.REQUEST_METHOD, value: n.data });
648
- break;
645
+ // Remote Controller
646
+ // Receives App events
647
+ handleApp(n) {
648
+ switch (n.event) {
649
+ case "getObject":
650
+ k.dispatchEvent({ type: j.GET_OBJECT, value: n.data });
651
+ break;
652
+ case "updateObject":
653
+ k.dispatchEvent({ type: j.UPDATE_OBJECT, value: n.data });
654
+ break;
655
+ case "createTexture":
656
+ k.dispatchEvent({ type: j.CREATE_TEXTURE, value: n.data });
657
+ break;
658
+ case "requestMethod":
659
+ k.dispatchEvent({ type: j.REQUEST_METHOD, value: n.data });
660
+ break;
661
+ }
649
662
  }
650
- }
651
- function Va(t, n) {
652
- switch (n.event) {
653
- case "setObject":
654
- _.dispatchEvent({ type: j.SET_OBJECT, value: n.data });
655
- break;
656
- case "setScene":
657
- _.dispatchEvent({ type: j.SET_SCENE, value: n.data });
658
- break;
659
- case "addCamera":
660
- _.dispatchEvent({ type: j.ADD_CAMERA, value: n.data });
661
- break;
662
- case "removeCamera":
663
- _.dispatchEvent({ type: j.REMOVE_CAMERA, value: n.data });
664
- break;
663
+ // Receives Editor events
664
+ handleEditor(n) {
665
+ switch (n.event) {
666
+ case "setObject":
667
+ k.dispatchEvent({ type: j.SET_OBJECT, value: n.data });
668
+ break;
669
+ case "setScene":
670
+ k.dispatchEvent({ type: j.SET_SCENE, value: n.data });
671
+ break;
672
+ case "addCamera":
673
+ k.dispatchEvent({ type: j.ADD_CAMERA, value: n.data });
674
+ break;
675
+ case "removeCamera":
676
+ k.dispatchEvent({ type: j.REMOVE_CAMERA, value: n.data });
677
+ break;
678
+ }
665
679
  }
666
680
  }
667
- class Nn extends Rt {
681
+ class Li extends Rt {
668
682
  bindCBs;
669
683
  buttonCBs;
670
684
  pane = void 0;
@@ -675,7 +689,7 @@ class Nn extends Rt {
675
689
  super(n), this.bindCBs = /* @__PURE__ */ new Map(), this.buttonCBs = /* @__PURE__ */ new Map(), n.editor && this.createGUI();
676
690
  }
677
691
  createGUI() {
678
- this.pane = new Oa({ title: "GUI" }), this.pane.registerPlugin(Ma);
692
+ this.pane = new Sa({ title: "GUI" }), this.pane.registerPlugin(Oa);
679
693
  }
680
694
  dispose() {
681
695
  this.bindCBs.clear(), this.buttonCBs.clear(), this.appCallbacks = 0, this.editorCallbacks = 0, this.app.editor && (this.pane?.dispose(), this.pane = void 0);
@@ -761,31 +775,27 @@ class Nn extends Rt {
761
775
  for (let a = n; a > -1; --a)
762
776
  this.inspectorFolder.remove(this.inspectorFolder.children[a]);
763
777
  }
764
- }
765
- function Ha(t, n) {
766
- t.components.forEach((a) => {
767
- if (a instanceof Nn) {
768
- const e = a;
769
- switch (n.event) {
770
- case "addFolder":
771
- e.addFolder(n.data.name, n.data.params, n.data.parent);
772
- break;
773
- case "bindObject":
774
- e.bind(n.data.name, n.data.params, n.data.parent);
775
- break;
776
- case "updateBind":
777
- e.triggerBind(n.data.id, n.data.value);
778
- break;
779
- case "addButton":
780
- e.button(n.data.name, n.data.callback, n.data.parent);
781
- break;
782
- case "clickButton":
783
- e.triggerButton(n.data.id);
784
- break;
785
- }
786
- return;
778
+ // Remote Controller
779
+ // Receives App events
780
+ handleApp(n) {
781
+ switch (n.event) {
782
+ case "addFolder":
783
+ this.addFolder(n.data.name, n.data.params, n.data.parent);
784
+ break;
785
+ case "bindObject":
786
+ this.bind(n.data.name, n.data.params, n.data.parent);
787
+ break;
788
+ case "updateBind":
789
+ this.triggerBind(n.data.id, n.data.value);
790
+ break;
791
+ case "addButton":
792
+ this.button(n.data.name, n.data.callback, n.data.parent);
793
+ break;
794
+ case "clickButton":
795
+ this.triggerButton(n.data.id);
796
+ break;
787
797
  }
788
- });
798
+ }
789
799
  }
790
800
  var Vt = { exports: {} }, it = {};
791
801
  /**
@@ -798,14 +808,14 @@ var Vt = { exports: {} }, it = {};
798
808
  * LICENSE file in the root directory of this source tree.
799
809
  */
800
810
  var Jt;
801
- function Wa() {
811
+ function La() {
802
812
  if (Jt)
803
813
  return it;
804
814
  Jt = 1;
805
- var t = kn, 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, s = { key: !0, ref: !0, __self: !0, __source: !0 };
806
- function p(c, u, d) {
815
+ var t = Pn, 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, s = { key: !0, ref: !0, __self: !0, __source: !0 };
816
+ function p(c, u, f) {
807
817
  var v, b = {}, E = null, x = null;
808
- d !== void 0 && (E = "" + d), u.key !== void 0 && (E = "" + u.key), u.ref !== void 0 && (x = u.ref);
818
+ f !== void 0 && (E = "" + f), u.key !== void 0 && (E = "" + u.key), u.ref !== void 0 && (x = u.ref);
809
819
  for (v in u)
810
820
  e.call(u, v) && !s.hasOwnProperty(v) && (b[v] = u[v]);
811
821
  if (c && c.defaultProps)
@@ -826,17 +836,17 @@ var rt = {};
826
836
  * LICENSE file in the root directory of this source tree.
827
837
  */
828
838
  var Qt;
829
- function qa() {
839
+ function Na() {
830
840
  return Qt || (Qt = 1, process.env.NODE_ENV !== "production" && function() {
831
- var t = kn, n = Symbol.for("react.element"), a = Symbol.for("react.portal"), e = Symbol.for("react.fragment"), o = Symbol.for("react.strict_mode"), s = Symbol.for("react.profiler"), p = Symbol.for("react.provider"), c = Symbol.for("react.context"), u = Symbol.for("react.forward_ref"), d = Symbol.for("react.suspense"), v = Symbol.for("react.suspense_list"), b = Symbol.for("react.memo"), E = Symbol.for("react.lazy"), x = Symbol.for("react.offscreen"), M = Symbol.iterator, k = "@@iterator";
841
+ var t = Pn, n = Symbol.for("react.element"), a = Symbol.for("react.portal"), e = Symbol.for("react.fragment"), o = Symbol.for("react.strict_mode"), s = Symbol.for("react.profiler"), p = Symbol.for("react.provider"), c = Symbol.for("react.context"), u = Symbol.for("react.forward_ref"), f = Symbol.for("react.suspense"), v = Symbol.for("react.suspense_list"), b = Symbol.for("react.memo"), E = Symbol.for("react.lazy"), x = Symbol.for("react.offscreen"), M = Symbol.iterator, P = "@@iterator";
832
842
  function H(i) {
833
843
  if (i === null || typeof i != "object")
834
844
  return null;
835
- var h = M && i[M] || i[k];
845
+ var h = M && i[M] || i[P];
836
846
  return typeof h == "function" ? h : null;
837
847
  }
838
848
  var B = t.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED;
839
- function S(i) {
849
+ function w(i) {
840
850
  {
841
851
  for (var h = arguments.length, g = new Array(h > 1 ? h - 1 : 0), C = 1; C < h; C++)
842
852
  g[C - 1] = arguments[C];
@@ -853,14 +863,14 @@ function qa() {
853
863
  F.unshift("Warning: " + h), Function.prototype.apply.call(console[i], console, F);
854
864
  }
855
865
  }
856
- var Ee = !1, le = !1, se = !1, f = !1, m = !1, w;
857
- w = Symbol.for("react.module.reference");
858
- function P(i) {
859
- return !!(typeof i == "string" || typeof i == "function" || i === e || i === s || m || i === o || i === d || i === v || f || i === x || Ee || le || se || typeof i == "object" && i !== null && (i.$$typeof === E || i.$$typeof === b || i.$$typeof === p || i.$$typeof === c || i.$$typeof === u || // This needs to include all possible module reference object
866
+ var Ce = !1, le = !1, se = !1, d = !1, m = !1, S;
867
+ S = Symbol.for("react.module.reference");
868
+ function _(i) {
869
+ return !!(typeof i == "string" || typeof i == "function" || i === e || i === s || m || i === o || i === f || i === v || d || i === x || Ce || le || se || typeof i == "object" && i !== null && (i.$$typeof === E || i.$$typeof === b || i.$$typeof === p || i.$$typeof === c || i.$$typeof === u || // This needs to include all possible module reference object
860
870
  // types supported by any Flight configuration anywhere since
861
871
  // we don't know which Flight build this will end up being used
862
872
  // with.
863
- i.$$typeof === w || i.getModuleId !== void 0));
873
+ i.$$typeof === S || i.getModuleId !== void 0));
864
874
  }
865
875
  function Y(i, h, g) {
866
876
  var C = i.displayName;
@@ -875,7 +885,7 @@ function qa() {
875
885
  function $(i) {
876
886
  if (i == null)
877
887
  return null;
878
- if (typeof i.tag == "number" && S("Received an unexpected object in getComponentNameFromType(). This is likely a bug in React. Please file an issue."), typeof i == "function")
888
+ if (typeof i.tag == "number" && w("Received an unexpected object in getComponentNameFromType(). This is likely a bug in React. Please file an issue."), typeof i == "function")
879
889
  return i.displayName || i.name || null;
880
890
  if (typeof i == "string")
881
891
  return i;
@@ -888,7 +898,7 @@ function qa() {
888
898
  return "Profiler";
889
899
  case o:
890
900
  return "StrictMode";
891
- case d:
901
+ case f:
892
902
  return "Suspense";
893
903
  case v:
894
904
  return "SuspenseList";
@@ -917,18 +927,18 @@ function qa() {
917
927
  }
918
928
  return null;
919
929
  }
920
- var I = Object.assign, W = 0, q, T, N, J, me, Ce, ft;
921
- function Xe() {
930
+ var I = Object.assign, W = 0, q, T, N, J, me, xe, ht;
931
+ function Ke() {
922
932
  }
923
- Xe.__reactDisabledLog = !0;
933
+ Ke.__reactDisabledLog = !0;
924
934
  function At() {
925
935
  {
926
936
  if (W === 0) {
927
- q = console.log, T = console.info, N = console.warn, J = console.error, me = console.group, Ce = console.groupCollapsed, ft = console.groupEnd;
937
+ q = console.log, T = console.info, N = console.warn, J = console.error, me = console.group, xe = console.groupCollapsed, ht = console.groupEnd;
928
938
  var i = {
929
939
  configurable: !0,
930
940
  enumerable: !0,
931
- value: Xe,
941
+ value: Ke,
932
942
  writable: !0
933
943
  };
934
944
  Object.defineProperties(console, {
@@ -944,7 +954,7 @@ function qa() {
944
954
  W++;
945
955
  }
946
956
  }
947
- function kt() {
957
+ function Pt() {
948
958
  {
949
959
  if (W--, W === 0) {
950
960
  var i = {
@@ -969,37 +979,37 @@ function qa() {
969
979
  value: me
970
980
  }),
971
981
  groupCollapsed: I({}, i, {
972
- value: Ce
982
+ value: xe
973
983
  }),
974
984
  groupEnd: I({}, i, {
975
- value: ft
985
+ value: ht
976
986
  })
977
987
  });
978
988
  }
979
- W < 0 && S("disabledDepth fell below zero. This is a bug in React. Please file an issue.");
989
+ W < 0 && w("disabledDepth fell below zero. This is a bug in React. Please file an issue.");
980
990
  }
981
991
  }
982
- var Ze = B.ReactCurrentDispatcher, Je;
983
- function ze(i, h, g) {
992
+ var Xe = B.ReactCurrentDispatcher, Ze;
993
+ function $e(i, h, g) {
984
994
  {
985
- if (Je === void 0)
995
+ if (Ze === void 0)
986
996
  try {
987
997
  throw Error();
988
998
  } catch (D) {
989
999
  var C = D.stack.trim().match(/\n( *(at )?)/);
990
- Je = C && C[1] || "";
1000
+ Ze = C && C[1] || "";
991
1001
  }
992
1002
  return `
993
- ` + Je + i;
1003
+ ` + Ze + i;
994
1004
  }
995
1005
  }
996
- var Ye = !1, Me;
1006
+ var ze = !1, Me;
997
1007
  {
998
- var ht = typeof WeakMap == "function" ? WeakMap : Map;
999
- Me = new ht();
1008
+ var ft = typeof WeakMap == "function" ? WeakMap : Map;
1009
+ Me = new ft();
1000
1010
  }
1001
1011
  function pt(i, h) {
1002
- if (!i || Ye)
1012
+ if (!i || ze)
1003
1013
  return "";
1004
1014
  {
1005
1015
  var g = Me.get(i);
@@ -1007,11 +1017,11 @@ function qa() {
1007
1017
  return g;
1008
1018
  }
1009
1019
  var C;
1010
- Ye = !0;
1020
+ ze = !0;
1011
1021
  var D = Error.prepareStackTrace;
1012
1022
  Error.prepareStackTrace = void 0;
1013
1023
  var F;
1014
- F = Ze.current, Ze.current = null, At();
1024
+ F = Xe.current, Xe.current = null, At();
1015
1025
  try {
1016
1026
  if (h) {
1017
1027
  var A = function() {
@@ -1055,21 +1065,21 @@ function qa() {
1055
1065
  if (Z !== 1 || Q !== 1)
1056
1066
  do
1057
1067
  if (Z--, Q--, Q < 0 || R[Z] !== ce[Q]) {
1058
- var he = `
1068
+ var fe = `
1059
1069
  ` + R[Z].replace(" at new ", " at ");
1060
- return i.displayName && he.includes("<anonymous>") && (he = he.replace("<anonymous>", i.displayName)), typeof i == "function" && Me.set(i, he), he;
1070
+ return i.displayName && fe.includes("<anonymous>") && (fe = fe.replace("<anonymous>", i.displayName)), typeof i == "function" && Me.set(i, fe), fe;
1061
1071
  }
1062
1072
  while (Z >= 1 && Q >= 0);
1063
1073
  break;
1064
1074
  }
1065
1075
  }
1066
1076
  } finally {
1067
- Ye = !1, Ze.current = F, kt(), Error.prepareStackTrace = D;
1077
+ ze = !1, Xe.current = F, Pt(), Error.prepareStackTrace = D;
1068
1078
  }
1069
- var Ve = i ? i.displayName || i.name : "", qt = Ve ? ze(Ve) : "";
1079
+ var Ge = i ? i.displayName || i.name : "", qt = Ge ? $e(Ge) : "";
1070
1080
  return typeof i == "function" && Me.set(i, qt), qt;
1071
1081
  }
1072
- function _t(i, h, g) {
1082
+ function kt(i, h, g) {
1073
1083
  return pt(i, !1);
1074
1084
  }
1075
1085
  function mt(i) {
@@ -1082,17 +1092,17 @@ function qa() {
1082
1092
  if (typeof i == "function")
1083
1093
  return pt(i, mt(i));
1084
1094
  if (typeof i == "string")
1085
- return ze(i);
1095
+ return $e(i);
1086
1096
  switch (i) {
1087
- case d:
1088
- return ze("Suspense");
1097
+ case f:
1098
+ return $e("Suspense");
1089
1099
  case v:
1090
- return ze("SuspenseList");
1100
+ return $e("SuspenseList");
1091
1101
  }
1092
1102
  if (typeof i == "object")
1093
1103
  switch (i.$$typeof) {
1094
1104
  case u:
1095
- return _t(i.render);
1105
+ return kt(i.render);
1096
1106
  case b:
1097
1107
  return Te(i.type, h, g);
1098
1108
  case E: {
@@ -1106,14 +1116,14 @@ function qa() {
1106
1116
  return "";
1107
1117
  }
1108
1118
  var Re = Object.prototype.hasOwnProperty, vt = {}, gt = B.ReactDebugCurrentFrame;
1109
- function Pe(i) {
1119
+ function _e(i) {
1110
1120
  if (i) {
1111
1121
  var h = i._owner, g = Te(i.type, i._source, h ? h.type : null);
1112
1122
  gt.setExtraStackFrame(g);
1113
1123
  } else
1114
1124
  gt.setExtraStackFrame(null);
1115
1125
  }
1116
- function Qe(i, h, g, C, D) {
1126
+ function Je(i, h, g, C, D) {
1117
1127
  {
1118
1128
  var F = Function.call.bind(Re);
1119
1129
  for (var A in i)
@@ -1128,12 +1138,12 @@ function qa() {
1128
1138
  } catch (Z) {
1129
1139
  R = Z;
1130
1140
  }
1131
- R && !(R instanceof Error) && (Pe(D), S("%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, A, typeof R), Pe(null)), R instanceof Error && !(R.message in vt) && (vt[R.message] = !0, Pe(D), S("Failed %s type: %s", g, R.message), Pe(null));
1141
+ R && !(R instanceof Error) && (_e(D), 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, A, typeof R), _e(null)), R instanceof Error && !(R.message in vt) && (vt[R.message] = !0, _e(D), w("Failed %s type: %s", g, R.message), _e(null));
1132
1142
  }
1133
1143
  }
1134
1144
  }
1135
1145
  var Ae = Array.isArray;
1136
- function et(i) {
1146
+ function Qe(i) {
1137
1147
  return Ae(i);
1138
1148
  }
1139
1149
  function jt(i) {
@@ -1154,15 +1164,15 @@ function qa() {
1154
1164
  }
1155
1165
  function Et(i) {
1156
1166
  if (bt(i))
1157
- return S("The provided key is an unsupported type %s. This value must be coerced to a string before before using it here.", jt(i)), yt(i);
1167
+ return w("The provided key is an unsupported type %s. This value must be coerced to a string before before using it here.", jt(i)), yt(i);
1158
1168
  }
1159
- var xe = B.ReactCurrentOwner, tt = {
1169
+ var we = B.ReactCurrentOwner, et = {
1160
1170
  key: !0,
1161
1171
  ref: !0,
1162
1172
  __self: !0,
1163
1173
  __source: !0
1164
- }, nt, Ct, Ge;
1165
- Ge = {};
1174
+ }, tt, Ct, Ye;
1175
+ Ye = {};
1166
1176
  function Dt(i) {
1167
1177
  if (Re.call(i, "ref")) {
1168
1178
  var h = Object.getOwnPropertyDescriptor(i, "ref").get;
@@ -1180,15 +1190,15 @@ function qa() {
1180
1190
  return i.key !== void 0;
1181
1191
  }
1182
1192
  function xt(i, h) {
1183
- if (typeof i.ref == "string" && xe.current && h && xe.current.stateNode !== h) {
1184
- var g = $(xe.current.type);
1185
- Ge[g] || (S('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', $(xe.current.type), i.ref), Ge[g] = !0);
1193
+ if (typeof i.ref == "string" && we.current && h && we.current.stateNode !== h) {
1194
+ var g = $(we.current.type);
1195
+ Ye[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', $(we.current.type), i.ref), Ye[g] = !0);
1186
1196
  }
1187
1197
  }
1188
1198
  function Se(i, h) {
1189
1199
  {
1190
1200
  var g = function() {
1191
- nt || (nt = !0, S("%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)", h));
1201
+ tt || (tt = !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)", h));
1192
1202
  };
1193
1203
  g.isReactWarning = !0, Object.defineProperty(i, "key", {
1194
1204
  get: g,
@@ -1199,7 +1209,7 @@ function qa() {
1199
1209
  function Wt(i, h) {
1200
1210
  {
1201
1211
  var g = function() {
1202
- Ct || (Ct = !0, S("%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)", h));
1212
+ Ct || (Ct = !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)", h));
1203
1213
  };
1204
1214
  g.isReactWarning = !0, Object.defineProperty(i, "ref", {
1205
1215
  get: g,
@@ -1241,7 +1251,7 @@ function qa() {
1241
1251
  var F, A = {}, R = null, ce = null;
1242
1252
  g !== void 0 && (Et(g), R = "" + g), It(h) && (Et(h.key), R = "" + h.key), Dt(h) && (ce = h.ref, xt(h, D));
1243
1253
  for (F in h)
1244
- Re.call(h, F) && !tt.hasOwnProperty(F) && (A[F] = h[F]);
1254
+ Re.call(h, F) && !et.hasOwnProperty(F) && (A[F] = h[F]);
1245
1255
  if (i && i.defaultProps) {
1246
1256
  var Z = i.defaultProps;
1247
1257
  for (F in Z)
@@ -1251,7 +1261,7 @@ function qa() {
1251
1261
  var Q = typeof i == "function" ? i.displayName || i.name || "Unknown" : i;
1252
1262
  R && Se(A, Q), ce && Wt(A, Q);
1253
1263
  }
1254
- return r(i, R, ce, D, C, xe.current, A);
1264
+ return r(i, R, ce, D, C, we.current, A);
1255
1265
  }
1256
1266
  }
1257
1267
  var O = B.ReactCurrentOwner, L = B.ReactDebugCurrentFrame;
@@ -1264,7 +1274,7 @@ function qa() {
1264
1274
  }
1265
1275
  var de;
1266
1276
  de = !1;
1267
- function ae(i) {
1277
+ function ie(i) {
1268
1278
  return typeof i == "object" && i !== null && i.$$typeof === n;
1269
1279
  }
1270
1280
  function Lt() {
@@ -1290,7 +1300,7 @@ Check your code at ` + h + ":" + g + ".";
1290
1300
  return "";
1291
1301
  }
1292
1302
  }
1293
- var at = {};
1303
+ var nt = {};
1294
1304
  function pe(i) {
1295
1305
  {
1296
1306
  var h = Lt();
@@ -1303,39 +1313,39 @@ Check the top-level render call using <` + g + ">.");
1303
1313
  return h;
1304
1314
  }
1305
1315
  }
1306
- function fe(i, h) {
1316
+ function he(i, h) {
1307
1317
  {
1308
1318
  if (!i._store || i._store.validated || i.key != null)
1309
1319
  return;
1310
1320
  i._store.validated = !0;
1311
1321
  var g = pe(h);
1312
- if (at[g])
1322
+ if (nt[g])
1313
1323
  return;
1314
- at[g] = !0;
1324
+ nt[g] = !0;
1315
1325
  var C = "";
1316
- i && i._owner && i._owner !== O.current && (C = " It was passed a child from " + $(i._owner.type) + "."), K(i), S('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), K(null);
1326
+ i && i._owner && i._owner !== O.current && (C = " It was passed a child from " + $(i._owner.type) + "."), K(i), 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), K(null);
1317
1327
  }
1318
1328
  }
1319
- function ke(i, h) {
1329
+ function Pe(i, h) {
1320
1330
  {
1321
1331
  if (typeof i != "object")
1322
1332
  return;
1323
- if (et(i))
1333
+ if (Qe(i))
1324
1334
  for (var g = 0; g < i.length; g++) {
1325
1335
  var C = i[g];
1326
- ae(C) && fe(C, h);
1336
+ ie(C) && he(C, h);
1327
1337
  }
1328
- else if (ae(i))
1338
+ else if (ie(i))
1329
1339
  i._store && (i._store.validated = !0);
1330
1340
  else if (i) {
1331
1341
  var D = H(i);
1332
1342
  if (typeof D == "function" && D !== i.entries)
1333
1343
  for (var F = D.call(i), A; !(A = F.next()).done; )
1334
- ae(A.value) && fe(A.value, h);
1344
+ ie(A.value) && he(A.value, h);
1335
1345
  }
1336
1346
  }
1337
1347
  }
1338
- function _e(i) {
1348
+ function ke(i) {
1339
1349
  {
1340
1350
  var h = i.type;
1341
1351
  if (h == null || typeof h == "string")
@@ -1351,13 +1361,13 @@ Check the top-level render call using <` + g + ">.");
1351
1361
  return;
1352
1362
  if (g) {
1353
1363
  var C = $(h);
1354
- Qe(g, i.props, "prop", C, i);
1364
+ Je(g, i.props, "prop", C, i);
1355
1365
  } else if (h.PropTypes !== void 0 && !de) {
1356
1366
  de = !0;
1357
1367
  var D = $(h);
1358
- S("Component %s declared `PropTypes` instead of `propTypes`. Did you misspell the property assignment?", D || "Unknown");
1368
+ w("Component %s declared `PropTypes` instead of `propTypes`. Did you misspell the property assignment?", D || "Unknown");
1359
1369
  }
1360
- typeof h.getDefaultProps == "function" && !h.getDefaultProps.isReactClassApproved && S("getDefaultProps is only used on classic React.createClass definitions. Use a static property named `defaultProps` instead.");
1370
+ typeof h.getDefaultProps == "function" && !h.getDefaultProps.isReactClassApproved && w("getDefaultProps is only used on classic React.createClass definitions. Use a static property named `defaultProps` instead.");
1361
1371
  }
1362
1372
  }
1363
1373
  function je(i) {
@@ -1365,63 +1375,63 @@ Check the top-level render call using <` + g + ">.");
1365
1375
  for (var h = Object.keys(i.props), g = 0; g < h.length; g++) {
1366
1376
  var C = h[g];
1367
1377
  if (C !== "children" && C !== "key") {
1368
- K(i), S("Invalid prop `%s` supplied to `React.Fragment`. React.Fragment can only have `key` and `children` props.", C), K(null);
1378
+ K(i), w("Invalid prop `%s` supplied to `React.Fragment`. React.Fragment can only have `key` and `children` props.", C), K(null);
1369
1379
  break;
1370
1380
  }
1371
1381
  }
1372
- i.ref !== null && (K(i), S("Invalid attribute `ref` supplied to `React.Fragment`."), K(null));
1382
+ i.ref !== null && (K(i), w("Invalid attribute `ref` supplied to `React.Fragment`."), K(null));
1373
1383
  }
1374
1384
  }
1375
1385
  function De(i, h, g, C, D, F) {
1376
1386
  {
1377
- var A = P(i);
1387
+ var A = _(i);
1378
1388
  if (!A) {
1379
1389
  var R = "";
1380
1390
  (i === void 0 || typeof i == "object" && i !== null && Object.keys(i).length === 0) && (R += " You likely forgot to export your component from the file it's defined in, or you might have mixed up default and named imports.");
1381
1391
  var ce = Nt(D);
1382
1392
  ce ? R += ce : R += Lt();
1383
1393
  var Z;
1384
- i === null ? Z = "null" : et(i) ? Z = "array" : i !== void 0 && i.$$typeof === n ? (Z = "<" + ($(i.type) || "Unknown") + " />", R = " Did you accidentally export a JSX literal instead of a component?") : Z = typeof i, S("React.jsx: type is invalid -- expected a string (for built-in components) or a class/function (for composite components) but got: %s.%s", Z, R);
1394
+ i === null ? Z = "null" : Qe(i) ? Z = "array" : i !== void 0 && i.$$typeof === n ? (Z = "<" + ($(i.type) || "Unknown") + " />", R = " Did you accidentally export a JSX literal instead of a component?") : Z = typeof i, w("React.jsx: type is invalid -- expected a string (for built-in components) or a class/function (for composite components) but got: %s.%s", Z, R);
1385
1395
  }
1386
1396
  var Q = y(i, h, g, D, F);
1387
1397
  if (Q == null)
1388
1398
  return Q;
1389
1399
  if (A) {
1390
- var he = h.children;
1391
- if (he !== void 0)
1400
+ var fe = h.children;
1401
+ if (fe !== void 0)
1392
1402
  if (C)
1393
- if (et(he)) {
1394
- for (var Ve = 0; Ve < he.length; Ve++)
1395
- ke(he[Ve], i);
1396
- Object.freeze && Object.freeze(he);
1403
+ if (Qe(fe)) {
1404
+ for (var Ge = 0; Ge < fe.length; Ge++)
1405
+ Pe(fe[Ge], i);
1406
+ Object.freeze && Object.freeze(fe);
1397
1407
  } else
1398
- S("React.jsx: Static children should always be an array. You are likely explicitly calling React.jsxs or React.jsxDEV. Use the Babel transform instead.");
1408
+ 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.");
1399
1409
  else
1400
- ke(he, i);
1410
+ Pe(fe, i);
1401
1411
  }
1402
- return i === e ? je(Q) : _e(Q), Q;
1412
+ return i === e ? je(Q) : ke(Q), Q;
1403
1413
  }
1404
1414
  }
1405
- function zn(i, h, g) {
1415
+ function $n(i, h, g) {
1406
1416
  return De(i, h, g, !0);
1407
1417
  }
1408
- function Yn(i, h, g) {
1418
+ function zn(i, h, g) {
1409
1419
  return De(i, h, g, !1);
1410
1420
  }
1411
- var Gn = Yn, Vn = zn;
1412
- rt.Fragment = e, rt.jsx = Gn, rt.jsxs = Vn;
1421
+ var Yn = zn, Gn = $n;
1422
+ rt.Fragment = e, rt.jsx = Yn, rt.jsxs = Gn;
1413
1423
  }()), rt;
1414
1424
  }
1415
- process.env.NODE_ENV === "production" ? Vt.exports = Wa() : Vt.exports = qa();
1425
+ process.env.NODE_ENV === "production" ? Vt.exports = La() : Vt.exports = Na();
1416
1426
  var l = Vt.exports;
1417
- function Fn(t) {
1427
+ function Nn(t) {
1418
1428
  return t.title.search("<") > -1 ? /* @__PURE__ */ l.jsx("button", { className: "svg", dangerouslySetInnerHTML: { __html: t.title } }) : /* @__PURE__ */ l.jsx("button", { children: t.title });
1419
1429
  }
1420
- const Ka = /* @__PURE__ */ l.jsxs("svg", { className: "closeIcon", width: "14", height: "14", fill: "none", stroke: "#666666", strokeMiterlimit: "10", children: [
1430
+ const Fa = /* @__PURE__ */ l.jsxs("svg", { className: "closeIcon", width: "14", height: "14", fill: "none", stroke: "#666666", strokeMiterlimit: "10", children: [
1421
1431
  /* @__PURE__ */ l.jsx("circle", { cx: "7", cy: "7", r: "6" }),
1422
1432
  /* @__PURE__ */ l.jsx("line", { x1: "4", y1: "4", x2: "10", y2: "10" }),
1423
1433
  /* @__PURE__ */ l.jsx("line", { x1: "4", y1: "10", x2: "10", y2: "4" })
1424
- ] }), Xa = /* @__PURE__ */ l.jsx("svg", { className: "dragIcon", width: "14", height: "14", fill: "#666666", stroke: "none", children: /* @__PURE__ */ l.jsx(
1434
+ ] }), Ba = /* @__PURE__ */ l.jsx("svg", { className: "dragIcon", width: "14", height: "14", fill: "#666666", stroke: "none", children: /* @__PURE__ */ l.jsx(
1425
1435
  "path",
1426
1436
  {
1427
1437
  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
@@ -1429,35 +1439,35 @@ 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
1429
1439
  C11,8.22,10.74,8,10.43,8z`
1430
1440
  }
1431
1441
  ) });
1432
- function Za(t) {
1433
- return /* @__PURE__ */ l.jsx(_n.Item, { value: t.title, children: /* @__PURE__ */ l.jsxs("div", { children: [
1434
- Xa,
1442
+ function Ua(t) {
1443
+ return /* @__PURE__ */ l.jsx(kn.Item, { value: t.title, children: /* @__PURE__ */ l.jsxs("div", { children: [
1444
+ Ba,
1435
1445
  /* @__PURE__ */ l.jsx("span", { children: t.title }),
1436
1446
  /* @__PURE__ */ l.jsx("button", { className: "closeIcon", onClick: () => {
1437
1447
  t.onDelete(t.index);
1438
- }, children: Ka })
1448
+ }, children: Fa })
1439
1449
  ] }) }, t.title);
1440
1450
  }
1441
- function Ja(t) {
1442
- const [n, a] = oe(!1), [e, o] = oe(t.options), s = (d) => {
1443
- t.onDragComplete(d), o(d);
1444
- }, p = (d) => {
1451
+ function $a(t) {
1452
+ const [n, a] = ae(!1), [e, o] = ae(t.options), s = (f) => {
1453
+ t.onDragComplete(f), o(f);
1454
+ }, p = (f) => {
1445
1455
  const v = [...e];
1446
- v.splice(d, 1), s(v);
1456
+ v.splice(f, 1), s(v);
1447
1457
  }, c = [];
1448
- e.forEach((d, v) => {
1449
- c.push(/* @__PURE__ */ l.jsx(Za, { index: v, title: d, onDelete: p }, d));
1458
+ e.forEach((f, v) => {
1459
+ c.push(/* @__PURE__ */ l.jsx(Ua, { index: v, title: f, onDelete: p }, f));
1450
1460
  });
1451
1461
  let u = "dropdown draggable";
1452
1462
  return t.subdropdown && (u += " subdropdown"), /* @__PURE__ */ l.jsxs("div", { className: u, onMouseEnter: () => a(!0), onMouseLeave: () => a(!1), children: [
1453
- /* @__PURE__ */ l.jsx(Fn, { title: t.title }),
1454
- /* @__PURE__ */ l.jsx(_n.Group, { axis: "y", values: e, onReorder: s, style: { visibility: n ? "visible" : "hidden" }, children: c })
1463
+ /* @__PURE__ */ l.jsx(Nn, { title: t.title }),
1464
+ /* @__PURE__ */ l.jsx(kn.Group, { axis: "y", values: e, onReorder: s, style: { visibility: n ? "visible" : "hidden" }, children: c })
1455
1465
  ] });
1456
1466
  }
1457
- function Qa(t) {
1458
- const [n, a] = oe(!1), e = [];
1467
+ function za(t) {
1468
+ const [n, a] = ae(!1), e = [];
1459
1469
  t.options.map((s, p) => {
1460
- t.onSelect !== void 0 && (s.onSelect = t.onSelect), e.push(/* @__PURE__ */ l.jsx(ei, { option: s }, p));
1470
+ t.onSelect !== void 0 && (s.onSelect = t.onSelect), e.push(/* @__PURE__ */ l.jsx(Ya, { option: s }, p));
1461
1471
  });
1462
1472
  let o = "dropdown";
1463
1473
  return t.subdropdown && (o += " subdropdown"), /* @__PURE__ */ l.jsxs(
@@ -1467,7 +1477,7 @@ function Qa(t) {
1467
1477
  onMouseEnter: () => a(!0),
1468
1478
  onMouseLeave: () => a(!1),
1469
1479
  children: [
1470
- /* @__PURE__ */ l.jsx(Fn, { title: t.title }),
1480
+ /* @__PURE__ */ l.jsx(Nn, { title: t.title }),
1471
1481
  /* @__PURE__ */ l.jsx(
1472
1482
  "ul",
1473
1483
  {
@@ -1479,13 +1489,13 @@ function Qa(t) {
1479
1489
  }
1480
1490
  );
1481
1491
  }
1482
- function ei(t) {
1483
- const { option: n } = t, [a, e] = oe("");
1492
+ function Ya(t) {
1493
+ const { option: n } = t, [a, e] = ae("");
1484
1494
  let o;
1485
1495
  switch (n.type) {
1486
1496
  case "draggable":
1487
1497
  o = /* @__PURE__ */ l.jsx(
1488
- Ja,
1498
+ $a,
1489
1499
  {
1490
1500
  title: n.title,
1491
1501
  options: n.value,
@@ -1498,7 +1508,7 @@ function ei(t) {
1498
1508
  break;
1499
1509
  case "dropdown":
1500
1510
  o = /* @__PURE__ */ l.jsx(
1501
- Qa,
1511
+ za,
1502
1512
  {
1503
1513
  title: n.title,
1504
1514
  options: n.value,
@@ -1519,32 +1529,32 @@ function ei(t) {
1519
1529
  );
1520
1530
  break;
1521
1531
  }
1522
- return /* @__PURE__ */ l.jsx("li", { className: a === n.title ? "selected" : "", children: o }, Pa());
1532
+ return /* @__PURE__ */ l.jsx("li", { className: a === n.title ? "selected" : "", children: o }, Ta());
1523
1533
  }
1524
- function Vi(t) {
1525
- const n = [], a = [];
1526
- t.components.forEach((s) => {
1527
- s instanceof Da ? n.push(Ia) : s instanceof Oe ? (n.push(La), a.push(Fa), Na(t)) : s instanceof Ya ? (n.push(Ga), a.push(Va)) : s instanceof Nn && n.push(Ha);
1528
- });
1529
- function e(s) {
1530
- switch (n.forEach((p) => p(t, s)), s.event) {
1534
+ function Ni(t) {
1535
+ function n(e) {
1536
+ switch (t.components.forEach((o) => {
1537
+ o.handleApp(e);
1538
+ }), e.event) {
1531
1539
  case "custom":
1532
- _.dispatchEvent({ type: j.CUSTOM, value: s.data });
1540
+ k.dispatchEvent({ type: j.CUSTOM, value: e.data });
1533
1541
  break;
1534
1542
  }
1535
1543
  }
1536
- function o(s) {
1537
- switch (a.forEach((p) => p(t, s)), s.event) {
1544
+ function a(e) {
1545
+ switch (t.components.forEach((o) => {
1546
+ o.handleEditor(e);
1547
+ }), e.event) {
1538
1548
  case "custom":
1539
- _.dispatchEvent({ type: j.CUSTOM, value: s.data });
1549
+ k.dispatchEvent({ type: j.CUSTOM, value: e.data });
1540
1550
  break;
1541
1551
  }
1542
1552
  }
1543
- t.listen = (s) => {
1544
- s.target === "editor" ? o(s) : e(s);
1553
+ t.listen = (e) => {
1554
+ e.target === "editor" ? a(e) : n(e);
1545
1555
  };
1546
1556
  }
1547
- const ti = `out vec3 worldPosition;
1557
+ const Ga = `out vec3 worldPosition;
1548
1558
  uniform float uDistance;
1549
1559
 
1550
1560
  void main() {
@@ -1553,7 +1563,7 @@ void main() {
1553
1563
  worldPosition.xz += cameraPosition.xz;
1554
1564
 
1555
1565
  gl_Position = projectionMatrix * modelViewMatrix * vec4(worldPosition, 1.0);
1556
- }`, ni = `out vec4 fragColor;
1566
+ }`, Va = `out vec4 fragColor;
1557
1567
  in vec3 worldPosition;
1558
1568
 
1559
1569
  uniform float uDivisions;
@@ -1621,14 +1631,14 @@ void main() {
1621
1631
 
1622
1632
  if (fragColor.a <= 0.0) discard;
1623
1633
  }`;
1624
- class ai extends fn {
1634
+ class Ha extends hn {
1625
1635
  constructor(n) {
1626
1636
  super({
1627
1637
  extensions: {
1628
1638
  derivatives: !0
1629
1639
  },
1630
- glslVersion: qn,
1631
- side: hn,
1640
+ glslVersion: Wn,
1641
+ side: fn,
1632
1642
  transparent: !0,
1633
1643
  uniforms: {
1634
1644
  uScale: {
@@ -1650,24 +1660,24 @@ class ai extends fn {
1650
1660
  value: n?.gridOpacity !== void 0 ? n?.gridOpacity : 0.25
1651
1661
  }
1652
1662
  },
1653
- vertexShader: ti,
1654
- fragmentShader: ni,
1663
+ vertexShader: Ga,
1664
+ fragmentShader: Va,
1655
1665
  name: "InfiniteGrid",
1656
1666
  depthWrite: !1
1657
1667
  });
1658
1668
  }
1659
1669
  }
1660
- class ii extends Kn {
1670
+ class Wa extends qn {
1661
1671
  gridMaterial;
1662
1672
  constructor() {
1663
- const n = new ai();
1664
- super(new Xn(2, 2), n), this.gridMaterial = n, this.frustumCulled = !1, this.name = "InfiniteGridHelper", this.position.y = 0.1;
1673
+ const n = new Ha();
1674
+ super(new Kn(2, 2), n), this.gridMaterial = n, this.frustumCulled = !1, this.name = "InfiniteGridHelper", this.position.y = 0.1;
1665
1675
  }
1666
1676
  update() {
1667
1677
  this.gridMaterial.needsUpdate = !0;
1668
1678
  }
1669
1679
  }
1670
- const ri = `#include <common>
1680
+ const qa = `#include <common>
1671
1681
  #include <batching_pars_vertex>
1672
1682
  #include <uv_pars_vertex>
1673
1683
  #include <color_pars_vertex>
@@ -1697,7 +1707,7 @@ void main() {
1697
1707
  #include <logdepthbuf_vertex>
1698
1708
  #include <clipping_planes_vertex>
1699
1709
  #include <worldpos_vertex>
1700
- }`, oi = `
1710
+ }`, Ka = `
1701
1711
  #include <common>
1702
1712
  #include <uv_pars_fragment>
1703
1713
  #include <clipping_planes_pars_fragment>
@@ -1706,19 +1716,19 @@ void main() {
1706
1716
  #include <clipping_planes_fragment>
1707
1717
  gl_FragColor = vec4(vec3(vUv, 0.0), 1.0);
1708
1718
  }`;
1709
- class si extends fn {
1719
+ class Xa extends hn {
1710
1720
  constructor() {
1711
1721
  super({
1712
1722
  defines: {
1713
1723
  USE_UV: ""
1714
1724
  },
1715
- vertexShader: ri,
1716
- fragmentShader: oi
1725
+ vertexShader: qa,
1726
+ fragmentShader: Ka
1717
1727
  });
1718
1728
  }
1719
1729
  }
1720
1730
  function Ht(t) {
1721
- const [n, a] = oe(t.open !== void 0 ? t.open : !0), e = !n || t.children === void 0;
1731
+ const [n, a] = ae(t.open !== void 0 ? t.open : !0), e = !n || t.children === void 0;
1722
1732
  return /* @__PURE__ */ l.jsxs("div", { className: `accordion ${e ? "hide" : ""}`, children: [
1723
1733
  /* @__PURE__ */ l.jsxs(
1724
1734
  "button",
@@ -1744,10 +1754,10 @@ function Ht(t) {
1744
1754
  /* @__PURE__ */ l.jsx("div", { className: n ? "open" : "", children: /* @__PURE__ */ l.jsx("div", { children: t.children }) })
1745
1755
  ] });
1746
1756
  }
1747
- function Bn(t) {
1748
- const [n, a] = oe(!1), e = t.child.children.length > 0, o = [];
1757
+ function Fn(t) {
1758
+ const [n, a] = ae(!1), e = t.child.children.length > 0, o = [];
1749
1759
  return t.child.children.length > 0 && t.child.children.map((s) => {
1750
- o.push(/* @__PURE__ */ l.jsx(Bn, { child: s, three: t.three }, Math.random()));
1760
+ o.push(/* @__PURE__ */ l.jsx(Fn, { child: s, three: t.three }, Math.random()));
1751
1761
  }), /* @__PURE__ */ l.jsxs("div", { className: "childObject", children: [
1752
1762
  /* @__PURE__ */ l.jsxs("div", { className: "child", children: [
1753
1763
  e ? /* @__PURE__ */ l.jsx(
@@ -1775,29 +1785,29 @@ function Bn(t) {
1775
1785
  children: t.child.name.length > 0 ? `${t.child.name} (${t.child.type})` : `${t.child.type}::${t.child.uuid}`
1776
1786
  }
1777
1787
  ),
1778
- /* @__PURE__ */ l.jsx("div", { className: `icon ${Ba(t.child)}` })
1788
+ /* @__PURE__ */ l.jsx("div", { className: `icon ${ka(t.child)}` })
1779
1789
  ] }),
1780
1790
  /* @__PURE__ */ l.jsx("div", { className: n ? "open" : "", children: /* @__PURE__ */ l.jsx("div", { className: "container", children: o }) })
1781
1791
  ] }, Math.random());
1782
1792
  }
1783
- function ci(t) {
1793
+ function Za(t) {
1784
1794
  const n = [];
1785
1795
  return t.child.children.map((a) => {
1786
- n.push(/* @__PURE__ */ l.jsx(Bn, { child: a, three: t.three }, Math.random()));
1796
+ n.push(/* @__PURE__ */ l.jsx(Fn, { child: a, three: t.three }, Math.random()));
1787
1797
  }), /* @__PURE__ */ l.jsx("div", { className: `scene ${t.class !== void 0 ? t.class : ""}`, children: n });
1788
1798
  }
1789
- const li = "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAADIAAAAyCAYAAAAeP4ixAAAACXBIWXMAAAsTAAALEwEAmpwYAAAA5klEQVRoge2Y0Q6EIAwE6cX//+X6cCFpSMEKVTdk501OpRNKiyelFC0b8Ps6gCwoggZF0KAIGhRBgyJoUAQNiqCxjciR9SLV//eZiAyvK3U8i/QVaQO2YyLSFVvlkdTKDjJCukh2ykR5ZEW+kHmlatl90RaBtDkK/w7CYhuRUEO0ee3l+J3m55Vm+17vtwjTnV1V3QA8qfbeUXCzRWDpiLLS+OyzvRW7IzW9R+okvclsqR09743bo0yUpc1+lSJvNsa002+Euk9GKzV7SmZDRIMiaFAEDYqgQRE0KIIGRdCgCBoUQeMEMERadX7YUz8AAAAASUVORK5CYII=";
1790
- function ui(t) {
1799
+ const Ja = "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAADIAAAAyCAYAAAAeP4ixAAAACXBIWXMAAAsTAAALEwEAmpwYAAAA5klEQVRoge2Y0Q6EIAwE6cX//+X6cCFpSMEKVTdk501OpRNKiyelFC0b8Ps6gCwoggZF0KAIGhRBgyJoUAQNiqCxjciR9SLV//eZiAyvK3U8i/QVaQO2YyLSFVvlkdTKDjJCukh2ykR5ZEW+kHmlatl90RaBtDkK/w7CYhuRUEO0ee3l+J3m55Vm+17vtwjTnV1V3QA8qfbeUXCzRWDpiLLS+OyzvRW7IzW9R+okvclsqR09743bo0yUpc1+lSJvNsa002+Euk9GKzV7SmZDRIMiaFAEDYqgQRE0KIIGRdCgCBoUQeMEMERadX7YUz8AAAAASUVORK5CYII=";
1800
+ function Qa(t) {
1791
1801
  return "items" in t;
1792
1802
  }
1793
- function Ue(t) {
1803
+ function Be(t) {
1794
1804
  const n = [];
1795
1805
  return t.items.forEach((a) => {
1796
- ui(a) ? n.push(
1797
- /* @__PURE__ */ l.jsx(Ue, { title: lt(a.title), items: a.items }, Math.random())
1806
+ Qa(a) ? n.push(
1807
+ /* @__PURE__ */ l.jsx(Be, { title: lt(a.title), items: a.items }, Math.random())
1798
1808
  ) : n.push(
1799
1809
  /* @__PURE__ */ l.jsx(
1800
- st,
1810
+ ct,
1801
1811
  {
1802
1812
  title: a.title,
1803
1813
  prop: a.prop,
@@ -1817,7 +1827,7 @@ function Ue(t) {
1817
1827
  );
1818
1828
  }), /* @__PURE__ */ l.jsx(Ht, { label: t.title, open: t.expanded === !0, children: n });
1819
1829
  }
1820
- function di(t) {
1830
+ function ei(t) {
1821
1831
  return !(t === "alphaHash" || t === "alphaToCoverage" || t === "attenuationDistance" || t === "blendDstAlpha" || t === "colorWrite" || t === "combine" || t === "defaultAttributeValues" || t === "depthFunc" || t === "forceSinglePass" || t === "glslVersion" || t === "linecap" || t === "linejoin" || t === "linewidth" || t === "normalMapType" || t === "precision" || t === "premultipliedAlpha" || t === "shadowSide" || t === "toneMapped" || t === "uniformsGroups" || t === "uniformsNeedUpdate" || t === "userData" || t === "vertexColors" || t === "version" || t === "wireframeLinecap" || t === "wireframeLinejoin" || t === "wireframeLinewidth" || t.slice(0, 4) === "clip" || t.slice(0, 7) === "polygon" || t.slice(0, 7) === "stencil" || t.slice(0, 2) === "is");
1822
1832
  }
1823
1833
  function Ie(t) {
@@ -1993,10 +2003,10 @@ function Ie(t) {
1993
2003
  }
1994
2004
  return t;
1995
2005
  }
1996
- function fi(t) {
2006
+ function ti(t) {
1997
2007
  return t.toLowerCase().search("intensity") > -1 || t === "anisotropyRotation" || t === "blendAlpha" || t === "bumpScale" || t === "clearcoatRoughness" || t === "displacementBias" || t === "displacementScale" || t === "metalness" || t === "opacity" || t === "reflectivity" || t === "refractionRatio" || t === "roughness" || t === "sheenRoughness" || t === "thickness";
1998
2008
  }
1999
- function hi() {
2009
+ function ni() {
2000
2010
  const t = document.createElement("input");
2001
2011
  return t.type = "file", new Promise((n, a) => {
2002
2012
  t.addEventListener("change", function() {
@@ -2011,66 +2021,66 @@ function hi() {
2011
2021
  }), t.click();
2012
2022
  });
2013
2023
  }
2014
- const pi = [
2024
+ const ai = [
2015
2025
  {
2016
2026
  title: "Front",
2017
- value: Zn
2027
+ value: Xn
2018
2028
  },
2019
2029
  {
2020
2030
  title: "Back",
2021
- value: Jn
2031
+ value: Zn
2022
2032
  },
2023
2033
  {
2024
2034
  title: "Double",
2025
- value: hn
2035
+ value: fn
2026
2036
  }
2027
- ], mi = [
2037
+ ], ii = [
2028
2038
  {
2029
2039
  title: "No Blending",
2030
- value: Qn
2040
+ value: Jn
2031
2041
  },
2032
2042
  {
2033
2043
  title: "Normal",
2034
- value: ea
2044
+ value: Qn
2035
2045
  },
2036
2046
  {
2037
2047
  title: "Additive",
2038
- value: ta
2048
+ value: ea
2039
2049
  },
2040
2050
  {
2041
2051
  title: "Subtractive",
2042
- value: na
2052
+ value: ta
2043
2053
  },
2044
2054
  {
2045
2055
  title: "Multiply",
2046
- value: aa
2056
+ value: na
2047
2057
  },
2048
2058
  {
2049
2059
  title: "Custom",
2050
- value: ia
2060
+ value: aa
2051
2061
  }
2052
- ], vi = [
2062
+ ], ri = [
2053
2063
  {
2054
2064
  title: "Add",
2055
- value: ra
2065
+ value: ia
2056
2066
  },
2057
2067
  {
2058
2068
  title: "Subtract",
2059
- value: oa
2069
+ value: ra
2060
2070
  },
2061
2071
  {
2062
2072
  title: "Reverse Subtract",
2063
- value: sa
2073
+ value: oa
2064
2074
  },
2065
2075
  {
2066
2076
  title: "Min",
2067
- value: ca
2077
+ value: sa
2068
2078
  },
2069
2079
  {
2070
2080
  title: "Max",
2071
- value: la
2081
+ value: ca
2072
2082
  }
2073
- ], gi = [
2083
+ ], oi = [
2074
2084
  {
2075
2085
  title: "Zero",
2076
2086
  valye: pn
@@ -2109,15 +2119,15 @@ const pi = [
2109
2119
  },
2110
2120
  {
2111
2121
  title: "One Minus Dst Color",
2112
- valye: Sn
2122
+ valye: wn
2113
2123
  },
2114
2124
  {
2115
2125
  title: "Src Alpha Saturate",
2116
- valye: ua
2126
+ valye: la
2117
2127
  },
2118
2128
  {
2119
2129
  title: "Constant Color",
2120
- valye: wn
2130
+ valye: Sn
2121
2131
  },
2122
2132
  {
2123
2133
  title: "One Minus Constant Color",
@@ -2131,7 +2141,7 @@ const pi = [
2131
2141
  title: "One Minus Constant Alpha",
2132
2142
  valye: Tn
2133
2143
  }
2134
- ], bi = [
2144
+ ], si = [
2135
2145
  {
2136
2146
  title: "Zero",
2137
2147
  valye: pn
@@ -2170,11 +2180,11 @@ const pi = [
2170
2180
  },
2171
2181
  {
2172
2182
  title: "One Minus Dst Color",
2173
- valye: Sn
2183
+ valye: wn
2174
2184
  },
2175
2185
  {
2176
2186
  title: "Constant Color",
2177
- valye: wn
2187
+ valye: Sn
2178
2188
  },
2179
2189
  {
2180
2190
  title: "One Minus Constant Color",
@@ -2195,7 +2205,7 @@ function ot(t, n) {
2195
2205
  function en(t, n, a) {
2196
2206
  const e = [];
2197
2207
  for (const o in t) {
2198
- if (!di(o))
2208
+ if (!ei(o))
2199
2209
  continue;
2200
2210
  const s = typeof t[o], p = t[o];
2201
2211
  if (s === "boolean" || s === "number" || s === "string") {
@@ -2207,40 +2217,40 @@ function en(t, n, a) {
2207
2217
  min: void 0,
2208
2218
  max: void 0,
2209
2219
  needsUpdate: s === "boolean",
2210
- onChange: (d, v) => {
2211
- a.updateObject(n.uuid, `material.${d}`, v), c.needsUpdate && a.updateObject(n.uuid, "material.needsUpdate", !0);
2220
+ onChange: (f, v) => {
2221
+ a.updateObject(n.uuid, `material.${f}`, v), c.needsUpdate && a.updateObject(n.uuid, "material.needsUpdate", !0);
2212
2222
  const b = a.scene?.getObjectByProperty("uuid", n.uuid);
2213
- b !== void 0 && ee(b, `material.${d}`, v);
2223
+ b !== void 0 && ee(b, `material.${f}`, v);
2214
2224
  }
2215
2225
  };
2216
2226
  switch (o) {
2217
2227
  case "blending":
2218
- ot(c, mi);
2228
+ ot(c, ii);
2219
2229
  break;
2220
2230
  case "blendDst":
2221
- ot(c, bi);
2231
+ ot(c, si);
2222
2232
  break;
2223
2233
  case "blendEquation":
2224
- ot(c, vi);
2234
+ ot(c, ri);
2225
2235
  break;
2226
2236
  case "blendSrc":
2227
- ot(c, gi);
2237
+ ot(c, oi);
2228
2238
  break;
2229
2239
  case "side":
2230
- ot(c, pi);
2240
+ ot(c, ai);
2231
2241
  break;
2232
2242
  }
2233
- fi(o) && (c.value = Number(p), c.type = "range", c.min = 0, c.max = 1, c.step = 0.01);
2243
+ ti(o) && (c.value = Number(p), c.type = "range", c.min = 0, c.max = 1, c.step = 0.01);
2234
2244
  const u = s === "string" && (o === "vertexShader" || o === "fragmentShader");
2235
- u && (c.disabled = !1, c.latest = c.value, c.onChange = (d, v) => {
2245
+ u && (c.disabled = !1, c.latest = c.value, c.onChange = (f, v) => {
2236
2246
  c.latest = v;
2237
2247
  }), e.push(c), u && e.push({
2238
2248
  title: `${lt(o)} - Update`,
2239
2249
  type: "button",
2240
2250
  onChange: () => {
2241
2251
  a.updateObject(n.uuid, `material.${o}`, c.latest), a.updateObject(n.uuid, "material.needsUpdate", !0);
2242
- const d = a.scene?.getObjectByProperty("uuid", n.uuid);
2243
- d !== void 0 && (ee(d, `material.${o}`, c.latest), d.material.needsUpdate = !0);
2252
+ const f = a.scene?.getObjectByProperty("uuid", n.uuid);
2253
+ f !== void 0 && (ee(f, `material.${o}`, c.latest), f.material.needsUpdate = !0);
2244
2254
  }
2245
2255
  });
2246
2256
  } else if (s === "object")
@@ -2251,10 +2261,10 @@ function en(t, n, a) {
2251
2261
  type: "color",
2252
2262
  value: p,
2253
2263
  onChange: (c, u) => {
2254
- const d = new Tt(u);
2255
- a.updateObject(n.uuid, `material.${c}`, d);
2264
+ const f = new Tt(u);
2265
+ a.updateObject(n.uuid, `material.${c}`, f);
2256
2266
  const v = a.scene?.getObjectByProperty("uuid", n.uuid);
2257
- v !== void 0 && ee(v, `material.${c}`, d);
2267
+ v !== void 0 && ee(v, `material.${c}`, f);
2258
2268
  }
2259
2269
  });
2260
2270
  else if (Array.isArray(p)) {
@@ -2264,7 +2274,7 @@ function en(t, n, a) {
2264
2274
  title: `${u}`,
2265
2275
  type: `${typeof p[u]}`,
2266
2276
  value: p[u],
2267
- onChange: (d, v) => {
2277
+ onChange: (f, v) => {
2268
2278
  a.updateObject(n.uuid, `material.${o}`, v);
2269
2279
  const b = a.scene?.getObjectByProperty("uuid", n.uuid);
2270
2280
  b !== void 0 && ee(b, `material.${o}`, v);
@@ -2277,15 +2287,15 @@ function en(t, n, a) {
2277
2287
  } else {
2278
2288
  const c = [];
2279
2289
  for (const u in p) {
2280
- const d = p[u];
2281
- switch (typeof d) {
2290
+ const f = p[u];
2291
+ switch (typeof f) {
2282
2292
  case "boolean":
2283
2293
  case "number":
2284
2294
  case "string":
2285
2295
  u === "src" ? e.push({
2286
2296
  title: Ie(o),
2287
2297
  type: "image",
2288
- value: d,
2298
+ value: f,
2289
2299
  onChange: (b, E) => {
2290
2300
  a.createTexture(n.uuid, `material.${o}`, E);
2291
2301
  const x = a.scene?.getObjectByProperty("uuid", n.uuid);
@@ -2306,11 +2316,11 @@ function en(t, n, a) {
2306
2316
  });
2307
2317
  break;
2308
2318
  case "object":
2309
- if (d.value !== void 0 && d.value.src !== void 0)
2319
+ if (f.value !== void 0 && f.value.src !== void 0)
2310
2320
  c.push({
2311
2321
  title: Ie(u),
2312
2322
  type: "image",
2313
- value: d.value.src,
2323
+ value: f.value.src,
2314
2324
  onChange: (b, E) => {
2315
2325
  a.createTexture(n.uuid, `material.${o}.${u}.value`, p);
2316
2326
  const x = a.scene?.getObjectByProperty("uuid", n.uuid);
@@ -2320,40 +2330,40 @@ function en(t, n, a) {
2320
2330
  }
2321
2331
  });
2322
2332
  else if (o === "uniforms") {
2323
- const b = d.value, E = (x, M, k) => ({
2333
+ const b = f.value, E = (x, M, P) => ({
2324
2334
  title: x,
2325
2335
  type: "number",
2326
- value: k,
2336
+ value: P,
2327
2337
  step: 0.01,
2328
2338
  onChange: (H, B) => {
2329
- const S = `material.uniforms.${u}.value.${M}`;
2330
- a.updateObject(n.uuid, S, B);
2339
+ const w = `material.uniforms.${u}.value.${M}`;
2340
+ a.updateObject(n.uuid, w, B);
2331
2341
  const z = a.scene?.getObjectByProperty("uuid", n.uuid);
2332
- z !== void 0 && ee(z, S, B);
2342
+ z !== void 0 && ee(z, w, B);
2333
2343
  }
2334
2344
  });
2335
- if (typeof d.value == "number")
2345
+ if (typeof f.value == "number")
2336
2346
  c.push({
2337
2347
  title: u,
2338
2348
  type: "number",
2339
- value: d.value,
2349
+ value: f.value,
2340
2350
  onChange: (x, M) => {
2341
- const k = `material.${o}.${x}.value`;
2342
- a.updateObject(n.uuid, k, M);
2351
+ const P = `material.${o}.${x}.value`;
2352
+ a.updateObject(n.uuid, P, M);
2343
2353
  const H = a.scene?.getObjectByProperty("uuid", n.uuid);
2344
- H !== void 0 && ee(H, k, M);
2354
+ H !== void 0 && ee(H, P, M);
2345
2355
  }
2346
2356
  });
2347
2357
  else if (b.r !== void 0 && b.g !== void 0 && b.b !== void 0)
2348
2358
  c.push({
2349
2359
  title: u,
2350
2360
  type: "color",
2351
- value: d.value,
2361
+ value: f.value,
2352
2362
  onChange: (x, M) => {
2353
- const k = new Tt(M), H = `material.${o}.${x}.value`;
2354
- a.updateObject(n.uuid, H, k);
2363
+ const P = new Tt(M), H = `material.${o}.${x}.value`;
2364
+ a.updateObject(n.uuid, H, P);
2355
2365
  const B = a.scene?.getObjectByProperty("uuid", n.uuid);
2356
- B !== void 0 && ee(B, H, k);
2366
+ B !== void 0 && ee(B, H, P);
2357
2367
  }
2358
2368
  });
2359
2369
  else if (b.x !== void 0 && b.y !== void 0 && b.z === void 0 && b.w === void 0)
@@ -2361,8 +2371,8 @@ function en(t, n, a) {
2361
2371
  {
2362
2372
  title: u,
2363
2373
  items: [
2364
- E("X", "x", d.value.x),
2365
- E("Y", "y", d.value.y)
2374
+ E("X", "x", f.value.x),
2375
+ E("Y", "y", f.value.y)
2366
2376
  ]
2367
2377
  }
2368
2378
  );
@@ -2371,9 +2381,9 @@ function en(t, n, a) {
2371
2381
  {
2372
2382
  title: u,
2373
2383
  items: [
2374
- E("X", "x", d.value.x),
2375
- E("Y", "y", d.value.y),
2376
- E("Z", "z", d.value.z)
2384
+ E("X", "x", f.value.x),
2385
+ E("Y", "y", f.value.y),
2386
+ E("Z", "z", f.value.z)
2377
2387
  ]
2378
2388
  }
2379
2389
  );
@@ -2382,17 +2392,17 @@ function en(t, n, a) {
2382
2392
  {
2383
2393
  title: u,
2384
2394
  items: [
2385
- E("X", "x", d.value.x),
2386
- E("Y", "y", d.value.y),
2387
- E("Z", "z", d.value.z),
2388
- E("W", "w", d.value.w)
2395
+ E("X", "x", f.value.x),
2396
+ E("Y", "y", f.value.y),
2397
+ E("Z", "z", f.value.z),
2398
+ E("W", "w", f.value.w)
2389
2399
  ]
2390
2400
  }
2391
2401
  );
2392
2402
  else if (b.elements !== void 0) {
2393
2403
  const x = b.elements, M = [];
2394
- for (let k = 0; k < x.length; k++)
2395
- M.push(E(k.toString(), k.toString(), x[k]));
2404
+ for (let P = 0; P < x.length; P++)
2405
+ M.push(E(P.toString(), P.toString(), x[P]));
2396
2406
  c.push(
2397
2407
  {
2398
2408
  title: u,
@@ -2404,8 +2414,8 @@ function en(t, n, a) {
2404
2414
  } else
2405
2415
  c.push({
2406
2416
  title: u,
2407
- type: `${typeof d.value}`,
2408
- value: d.value,
2417
+ type: `${typeof f.value}`,
2418
+ value: f.value,
2409
2419
  onChange: (b, E) => {
2410
2420
  a.updateObject(n.uuid, `material.${o}.${u}.value`, E);
2411
2421
  const x = a.scene?.getObjectByProperty("uuid", n.uuid);
@@ -2431,14 +2441,14 @@ function en(t, n, a) {
2431
2441
  }
2432
2442
  }), e;
2433
2443
  }
2434
- function yi(t, n) {
2444
+ function ci(t, n) {
2435
2445
  const a = t.material;
2436
2446
  if (Array.isArray(a)) {
2437
2447
  const e = [], o = a.length;
2438
2448
  for (let s = 0; s < o; s++)
2439
2449
  e.push(
2440
2450
  /* @__PURE__ */ l.jsx(
2441
- Ue,
2451
+ Be,
2442
2452
  {
2443
2453
  title: `Material ${s}`,
2444
2454
  items: en(a[s], t, n)
@@ -2449,37 +2459,37 @@ function yi(t, n) {
2449
2459
  return /* @__PURE__ */ l.jsx(l.Fragment, { children: e });
2450
2460
  } else
2451
2461
  return /* @__PURE__ */ l.jsx(
2452
- Ue,
2462
+ Be,
2453
2463
  {
2454
2464
  title: "Material",
2455
2465
  items: en(a, t, n)
2456
2466
  }
2457
2467
  );
2458
2468
  }
2459
- function st(t) {
2469
+ function ct(t) {
2460
2470
  let n = t.value;
2461
- n !== void 0 && n.isColor !== void 0 && (n = ka(t.value));
2462
- const [a, e] = oe(n), o = ye(null), s = ye(null), p = ye(null);
2463
- Be(() => {
2471
+ n !== void 0 && n.isColor !== void 0 && (n = _a(t.value));
2472
+ const [a, e] = ae(n), o = Ee(null), s = Ee(null), p = Ee(null);
2473
+ Oe(() => {
2464
2474
  let v = !1, b = -1, E = 0, x = Number(a);
2465
2475
  const M = (z) => {
2466
2476
  v = !0, E = x, b = z.clientX;
2467
- }, k = (z) => {
2477
+ }, P = (z) => {
2468
2478
  if (!v)
2469
2479
  return;
2470
- const Ee = t.step !== void 0 ? t.step : 1, le = (z.clientX - b) * Ee;
2480
+ const Ce = t.step !== void 0 ? t.step : 1, le = (z.clientX - b) * Ce;
2471
2481
  x = Number((E + le).toFixed(4)), s.current !== null && (s.current.value = x.toString()), t.onChange !== void 0 && t.onChange(t.prop !== void 0 ? t.prop : t.title, x);
2472
2482
  }, H = () => {
2473
2483
  v = !1;
2474
2484
  }, B = () => {
2475
2485
  v = !1;
2476
- }, S = t.type === "number";
2477
- return S && (o.current?.addEventListener("mousedown", M, !1), document.addEventListener("mouseup", H, !1), document.addEventListener("mousemove", k, !1), document.addEventListener("contextmenu", B, !1)), () => {
2478
- S && (o.current?.removeEventListener("mousedown", M), document.removeEventListener("mouseup", H), document.removeEventListener("mousemove", k), document.removeEventListener("contextmenu", B));
2486
+ }, w = t.type === "number";
2487
+ return w && (o.current?.addEventListener("mousedown", M, !1), document.addEventListener("mouseup", H, !1), document.addEventListener("mousemove", P, !1), document.addEventListener("contextmenu", B, !1)), () => {
2488
+ w && (o.current?.removeEventListener("mousedown", M), document.removeEventListener("mouseup", H), document.removeEventListener("mousemove", P), document.removeEventListener("contextmenu", B));
2479
2489
  };
2480
2490
  }, [a]);
2481
2491
  const c = t.type === "string" && (a.length > 100 || a.search(`
2482
- `) > -1), u = c || t.type === "image", d = (v) => {
2492
+ `) > -1), u = c || t.type === "image", f = (v) => {
2483
2493
  let b = v.target.value;
2484
2494
  t.type === "boolean" ? b = v.target.checked : t.type === "option" && (b = t.options[b].value), e(b), t.onChange !== void 0 && t.onChange(t.prop !== void 0 ? t.prop : t.title, b);
2485
2495
  };
@@ -2490,7 +2500,7 @@ function st(t) {
2490
2500
  {
2491
2501
  type: "text",
2492
2502
  disabled: t.disabled,
2493
- onChange: d,
2503
+ onChange: f,
2494
2504
  value: a
2495
2505
  }
2496
2506
  ),
@@ -2500,7 +2510,7 @@ function st(t) {
2500
2510
  cols: 50,
2501
2511
  rows: 10,
2502
2512
  disabled: t.disabled !== void 0 ? t.disabled : !0,
2503
- onChange: d,
2513
+ onChange: f,
2504
2514
  value: a
2505
2515
  }
2506
2516
  ),
@@ -2509,7 +2519,7 @@ function st(t) {
2509
2519
  {
2510
2520
  type: "checkbox",
2511
2521
  disabled: t.disabled,
2512
- onChange: d,
2522
+ onChange: f,
2513
2523
  checked: a
2514
2524
  }
2515
2525
  ),
@@ -2523,11 +2533,11 @@ function st(t) {
2523
2533
  max: t.max,
2524
2534
  step: t.step,
2525
2535
  disabled: t.disabled,
2526
- onChange: d
2536
+ onChange: f
2527
2537
  }
2528
2538
  ),
2529
2539
  t.type === "range" && /* @__PURE__ */ l.jsxs(l.Fragment, { children: [
2530
- /* @__PURE__ */ l.jsx("input", { type: "text", value: a.toString(), onChange: d, disabled: t.disabled, className: "min" }),
2540
+ /* @__PURE__ */ l.jsx("input", { type: "text", value: a.toString(), onChange: f, disabled: t.disabled, className: "min" }),
2531
2541
  /* @__PURE__ */ l.jsx(
2532
2542
  "input",
2533
2543
  {
@@ -2537,13 +2547,13 @@ function st(t) {
2537
2547
  min: t.min,
2538
2548
  max: t.max,
2539
2549
  step: t.step,
2540
- onChange: d
2550
+ onChange: f
2541
2551
  }
2542
2552
  )
2543
2553
  ] }),
2544
2554
  t.type === "color" && /* @__PURE__ */ l.jsxs(l.Fragment, { children: [
2545
- /* @__PURE__ */ l.jsx("input", { type: "text", value: a.toString(), onChange: d, disabled: t.disabled, className: "color" }),
2546
- /* @__PURE__ */ l.jsx("input", { type: "color", value: a, onChange: d, disabled: t.disabled })
2555
+ /* @__PURE__ */ l.jsx("input", { type: "text", value: a.toString(), onChange: f, disabled: t.disabled, className: "color" }),
2556
+ /* @__PURE__ */ l.jsx("input", { type: "color", value: a, onChange: f, disabled: t.disabled })
2547
2557
  ] }),
2548
2558
  t.type === "button" && /* @__PURE__ */ l.jsx(
2549
2559
  "button",
@@ -2556,11 +2566,11 @@ function st(t) {
2556
2566
  }
2557
2567
  ),
2558
2568
  t.type === "image" && /* @__PURE__ */ l.jsx("img", { ref: p, onClick: () => {
2559
- hi().then((v) => {
2569
+ ni().then((v) => {
2560
2570
  p.current.src = v, t.onChange !== void 0 && t.onChange(t.prop !== void 0 ? t.prop : t.title, v);
2561
2571
  });
2562
- }, src: a.length > 0 ? a : li }),
2563
- t.type === "option" && /* @__PURE__ */ l.jsx(l.Fragment, { children: /* @__PURE__ */ l.jsx("select", { onChange: d, disabled: t.disabled, defaultValue: t.value, children: t.options?.map((v, b) => /* @__PURE__ */ l.jsx("option", { value: v.value, children: lt(v.title) }, b)) }) })
2572
+ }, src: a.length > 0 ? a : Ja }),
2573
+ t.type === "option" && /* @__PURE__ */ l.jsx(l.Fragment, { children: /* @__PURE__ */ l.jsx("select", { onChange: f, disabled: t.disabled, defaultValue: t.value, children: t.options?.map((v, b) => /* @__PURE__ */ l.jsx("option", { value: v.value, children: lt(v.title) }, b)) }) })
2564
2574
  ] });
2565
2575
  }
2566
2576
  function tn(t) {
@@ -2592,7 +2602,7 @@ function tn(t) {
2592
2602
  }
2593
2603
  return t;
2594
2604
  }
2595
- function Ei(t, n) {
2605
+ function li(t, n) {
2596
2606
  const a = [];
2597
2607
  if (t.perspectiveCameraInfo !== void 0)
2598
2608
  for (const e in t.perspectiveCameraInfo)
@@ -2623,37 +2633,37 @@ function Ei(t, n) {
2623
2633
  }
2624
2634
  });
2625
2635
  return /* @__PURE__ */ l.jsx(
2626
- Ue,
2636
+ Be,
2627
2637
  {
2628
2638
  title: "Camera",
2629
2639
  items: a
2630
2640
  }
2631
2641
  );
2632
2642
  }
2633
- const Ci = Math.PI / 180, xi = 180 / Math.PI;
2634
- function Ke(t, n, a, e, o) {
2643
+ const ui = Math.PI / 180, di = 180 / Math.PI;
2644
+ function qe(t, n, a, e, o) {
2635
2645
  return e + (t - n) * (o - e) / (a - n);
2636
2646
  }
2637
- function Si(t) {
2638
- return t * Ci;
2647
+ function hi(t) {
2648
+ return t * ui;
2639
2649
  }
2640
2650
  function Ut(t) {
2641
- return t * xi;
2651
+ return t * di;
2642
2652
  }
2643
- function wi(t, n) {
2644
- const a = new da();
2653
+ function fi(t, n) {
2654
+ const a = new ua();
2645
2655
  a.elements = t.matrix;
2646
- const e = new X(), o = new fa(), s = new X();
2656
+ const e = new X(), o = new da(), s = new X();
2647
2657
  t.uuid.length > 0 && (e.setFromMatrixPosition(a), o.setFromRotationMatrix(a), s.setFromMatrixScale(a));
2648
- const p = (u, d) => {
2649
- n.updateObject(t.uuid, u, d);
2658
+ const p = (u, f) => {
2659
+ n.updateObject(t.uuid, u, f);
2650
2660
  const v = n.scene?.getObjectByProperty("uuid", t.uuid);
2651
- v !== void 0 && ee(v, u, d);
2652
- }, c = (u, d) => {
2653
- p(u, Si(d));
2661
+ v !== void 0 && ee(v, u, f);
2662
+ }, c = (u, f) => {
2663
+ p(u, hi(f));
2654
2664
  };
2655
2665
  return /* @__PURE__ */ l.jsx(
2656
- Ue,
2666
+ Be,
2657
2667
  {
2658
2668
  title: "Transform",
2659
2669
  items: [
@@ -2755,7 +2765,7 @@ function nn(t) {
2755
2765
  }
2756
2766
  return t;
2757
2767
  }
2758
- function Oi(t, n) {
2768
+ function pi(t, n) {
2759
2769
  const a = [];
2760
2770
  if (t.lightInfo !== void 0)
2761
2771
  for (const e in t.lightInfo) {
@@ -2785,14 +2795,14 @@ function Oi(t, n) {
2785
2795
  }));
2786
2796
  }
2787
2797
  return /* @__PURE__ */ l.jsx(
2788
- Ue,
2798
+ Be,
2789
2799
  {
2790
2800
  title: "Light",
2791
2801
  items: a
2792
2802
  }
2793
2803
  );
2794
2804
  }
2795
- function Mi(t, n) {
2805
+ function mi(t, n) {
2796
2806
  const a = [], e = [];
2797
2807
  let o = 0;
2798
2808
  t.animations.forEach((c) => {
@@ -2839,7 +2849,7 @@ function Mi(t, n) {
2839
2849
  step: 0.01,
2840
2850
  min: -1,
2841
2851
  max: 2,
2842
- onChange: (d, v) => {
2852
+ onChange: (f, v) => {
2843
2853
  c.timeScale = v, n.updateObject(t.uuid, "mixer.timeScale", v);
2844
2854
  }
2845
2855
  }
@@ -2856,9 +2866,9 @@ function Mi(t, n) {
2856
2866
  });
2857
2867
  }
2858
2868
  }
2859
- return /* @__PURE__ */ l.jsx(Ue, { title: "Animation", items: a });
2869
+ return /* @__PURE__ */ l.jsx(Be, { title: "Animation", items: a });
2860
2870
  }
2861
- const Un = {
2871
+ const Bn = {
2862
2872
  name: "",
2863
2873
  uuid: "",
2864
2874
  type: "",
@@ -2870,25 +2880,25 @@ const Un = {
2870
2880
  orthographicCameraInfo: void 0,
2871
2881
  lightInfo: void 0
2872
2882
  };
2873
- let te = { ...Un };
2874
- function Ti(t) {
2875
- const [n, a] = oe(-1);
2876
- Be(() => {
2883
+ let te = { ...Bn };
2884
+ function vi(t) {
2885
+ const [n, a] = ae(-1);
2886
+ Oe(() => {
2877
2887
  function p(u) {
2878
2888
  te = { ...u.value }, a(Date.now());
2879
2889
  }
2880
2890
  function c() {
2881
- te = { ...Un }, a(Date.now());
2891
+ te = { ...Bn }, a(Date.now());
2882
2892
  }
2883
- return _.addEventListener(j.SET_SCENE, c), _.addEventListener(j.SET_OBJECT, p), () => {
2884
- _.removeEventListener(j.SET_SCENE, c), _.removeEventListener(j.SET_OBJECT, p);
2893
+ return k.addEventListener(j.SET_SCENE, c), k.addEventListener(j.SET_OBJECT, p), () => {
2894
+ k.removeEventListener(j.SET_SCENE, c), k.removeEventListener(j.SET_OBJECT, p);
2885
2895
  };
2886
2896
  }, []);
2887
2897
  const e = te.type.toLowerCase(), o = te.animations.length > 0 || te.mixer !== void 0, s = e.search("mesh") > -1 || e.search("line") > -1 || e.search("points") > -1;
2888
2898
  return /* @__PURE__ */ l.jsx(Ht, { label: "Inspector", children: /* @__PURE__ */ l.jsx("div", { id: "Inspector", className: t.class, children: te.uuid.length > 0 && /* @__PURE__ */ l.jsxs(l.Fragment, { children: [
2889
2899
  /* @__PURE__ */ l.jsxs(l.Fragment, { children: [
2890
2900
  /* @__PURE__ */ l.jsx(
2891
- st,
2901
+ ct,
2892
2902
  {
2893
2903
  type: "string",
2894
2904
  title: "Name",
@@ -2898,7 +2908,7 @@ function Ti(t) {
2898
2908
  }
2899
2909
  ),
2900
2910
  /* @__PURE__ */ l.jsx(
2901
- st,
2911
+ ct,
2902
2912
  {
2903
2913
  type: "string",
2904
2914
  title: "Type",
@@ -2908,7 +2918,7 @@ function Ti(t) {
2908
2918
  }
2909
2919
  ),
2910
2920
  /* @__PURE__ */ l.jsx(
2911
- st,
2921
+ ct,
2912
2922
  {
2913
2923
  type: "string",
2914
2924
  title: "UUID",
@@ -2918,7 +2928,7 @@ function Ti(t) {
2918
2928
  }
2919
2929
  ),
2920
2930
  /* @__PURE__ */ l.jsx(
2921
- st,
2931
+ ct,
2922
2932
  {
2923
2933
  type: "boolean",
2924
2934
  title: "Visible",
@@ -2933,43 +2943,31 @@ function Ti(t) {
2933
2943
  )
2934
2944
  ] }),
2935
2945
  /* @__PURE__ */ l.jsxs(l.Fragment, { children: [
2936
- wi(te, t.three),
2937
- o ? Mi(te, t.three) : null,
2938
- e.search("camera") > -1 ? Ei(te, t.three) : null,
2939
- e.search("light") > -1 ? Oi(te, t.three) : null,
2940
- s ? yi(te, t.three) : null
2946
+ fi(te, t.three),
2947
+ o ? mi(te, t.three) : null,
2948
+ e.search("camera") > -1 ? li(te, t.three) : null,
2949
+ e.search("light") > -1 ? pi(te, t.three) : null,
2950
+ s ? ci(te, t.three) : null
2941
2951
  ] })
2942
2952
  ] }) }, n) }, "Inspector");
2943
2953
  }
2944
- class Hi extends Ta {
2945
- three;
2946
- constructor(n) {
2947
- super(n), this.state = {
2948
- scene: n.scene !== void 0 ? n.scene : null
2949
- }, this.three = n.three, _.addEventListener(j.SET_SCENE, this.setScene);
2950
- }
2951
- componentWillUnmount() {
2952
- _.removeEventListener(j.SET_SCENE, this.setScene);
2953
- }
2954
- render() {
2955
- const n = this.componentState.scene !== null, a = "Hierarchy - " + (n ? `${this.componentState.scene?.name}` : "No Scene");
2956
- return /* @__PURE__ */ l.jsx("div", { id: "SidePanel", children: /* @__PURE__ */ l.jsxs(l.Fragment, { children: [
2957
- /* @__PURE__ */ l.jsx(Ht, { label: a, open: !0, children: /* @__PURE__ */ l.jsx(l.Fragment, { children: n && /* @__PURE__ */ l.jsx(ci, { child: this.componentState.scene, three: this.three }) }) }),
2958
- /* @__PURE__ */ l.jsx(Ti, { three: this.three })
2959
- ] }) }, "SidePanel");
2960
- }
2961
- // Private
2962
- setScene = (n) => {
2963
- this.setState(() => ({
2964
- scene: n.value
2965
- }));
2966
- };
2967
- // Getters / Setters
2968
- get componentState() {
2969
- return this.state;
2970
- }
2954
+ function Fi(t) {
2955
+ const [n, a] = ae(t.scene);
2956
+ Oe(() => {
2957
+ const s = (p) => {
2958
+ a(p.value);
2959
+ };
2960
+ return k.addEventListener(j.SET_SCENE, s), () => {
2961
+ k.removeEventListener(j.SET_SCENE, s);
2962
+ };
2963
+ }, []);
2964
+ const e = n !== null, o = "Hierarchy - " + (e ? `${n?.name}` : "No Scene");
2965
+ return /* @__PURE__ */ l.jsxs("div", { id: "SidePanel", children: [
2966
+ /* @__PURE__ */ l.jsx(Ht, { label: o, open: !0, children: /* @__PURE__ */ l.jsx(l.Fragment, { children: e && /* @__PURE__ */ l.jsx(Za, { child: n, three: t.three }) }) }),
2967
+ /* @__PURE__ */ l.jsx(vi, { three: t.three })
2968
+ ] }, "SidePanel");
2971
2969
  }
2972
- function Wi(t) {
2970
+ function Bi(t) {
2973
2971
  function n() {
2974
2972
  return t.three.scene === void 0 ? (console.log("No scene:", t.three), !1) : !0;
2975
2973
  }
@@ -2978,84 +2976,84 @@ function Wi(t) {
2978
2976
  return;
2979
2977
  const u = t.three.scene?.getObjectByProperty("uuid", c.value);
2980
2978
  u !== void 0 && t.three.setObject(u);
2981
- }, e = (c, u, d) => {
2979
+ }, e = (c, u, f) => {
2982
2980
  if (!n())
2983
2981
  return;
2984
2982
  const v = t.three.scene?.getObjectByProperty("uuid", c);
2985
- v !== void 0 && ee(v, u, d);
2983
+ v !== void 0 && ee(v, u, f);
2986
2984
  }, o = (c) => {
2987
2985
  if (!n())
2988
2986
  return;
2989
- const u = c.value, { key: d, value: v, uuid: b } = u;
2990
- e(b, d, v);
2987
+ const u = c.value, { key: f, value: v, uuid: b } = u;
2988
+ e(b, f, v);
2991
2989
  }, s = (c) => {
2992
2990
  if (!n())
2993
2991
  return;
2994
2992
  const u = c.value;
2995
- Gt(u.value).then((d) => {
2996
- e(u.uuid, u.key, d), e(u.uuid, "material.needsUpdate", !0);
2993
+ Gt(u.value).then((f) => {
2994
+ e(u.uuid, u.key, f), e(u.uuid, "material.needsUpdate", !0);
2997
2995
  });
2998
2996
  }, p = (c) => {
2999
2997
  if (!n())
3000
2998
  return;
3001
- const { key: u, uuid: d, value: v, subitem: b } = c.value, E = t.three.scene?.getObjectByProperty("uuid", d);
2999
+ const { key: u, uuid: f, value: v, subitem: b } = c.value, E = t.three.scene?.getObjectByProperty("uuid", f);
3002
3000
  if (E !== void 0)
3003
3001
  try {
3004
- b !== void 0 ? za(E, b)[u](v) : E[u](v);
3002
+ b !== void 0 ? Ia(E, b)[u](v) : E[u](v);
3005
3003
  } catch (x) {
3006
3004
  console.log("Error requesting method:"), console.log(x), console.log(u), console.log(v);
3007
3005
  }
3008
3006
  };
3009
- return Be(() => (_.addEventListener(j.GET_OBJECT, a), _.addEventListener(j.UPDATE_OBJECT, o), _.addEventListener(j.CREATE_TEXTURE, s), _.addEventListener(j.REQUEST_METHOD, p), () => {
3010
- _.removeEventListener(j.GET_OBJECT, a), _.removeEventListener(j.UPDATE_OBJECT, o), _.removeEventListener(j.CREATE_TEXTURE, s), _.removeEventListener(j.REQUEST_METHOD, p);
3007
+ return Oe(() => (k.addEventListener(j.GET_OBJECT, a), k.addEventListener(j.UPDATE_OBJECT, o), k.addEventListener(j.CREATE_TEXTURE, s), k.addEventListener(j.REQUEST_METHOD, p), () => {
3008
+ k.removeEventListener(j.GET_OBJECT, a), k.removeEventListener(j.UPDATE_OBJECT, o), k.removeEventListener(j.CREATE_TEXTURE, s), k.removeEventListener(j.REQUEST_METHOD, p);
3011
3009
  }), []), null;
3012
3010
  }
3013
- const an = { type: "change" }, $t = { type: "start" }, rn = { type: "end" }, St = new ha(), on = new pa(), Ri = Math.cos(70 * ma.DEG2RAD);
3014
- class Pi extends un {
3011
+ const an = { type: "change" }, $t = { type: "start" }, rn = { type: "end" }, wt = new ha(), on = new fa(), gi = Math.cos(70 * pa.DEG2RAD);
3012
+ class bi extends un {
3015
3013
  constructor(n, a) {
3016
- super(), this.object = n, this.domElement = a, this.domElement.style.touchAction = "none", this.enabled = !0, this.target = new X(), this.cursor = new X(), 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: He.ROTATE, MIDDLE: He.DOLLY, RIGHT: He.PAN }, this.touches = { ONE: We.ROTATE, TWO: We.DOLLY_PAN }, this.target0 = this.target.clone(), this.position0 = this.object.position.clone(), this.zoom0 = this.object.zoom, this._domElementKeyEvents = null, this.getPolarAngle = function() {
3014
+ super(), this.object = n, this.domElement = a, this.domElement.style.touchAction = "none", this.enabled = !0, this.target = new X(), this.cursor = new X(), 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: Ve.ROTATE, MIDDLE: Ve.DOLLY, RIGHT: Ve.PAN }, this.touches = { ONE: He.ROTATE, TWO: He.DOLLY_PAN }, this.target0 = this.target.clone(), this.position0 = this.object.position.clone(), this.zoom0 = this.object.zoom, this._domElementKeyEvents = null, this.getPolarAngle = function() {
3017
3015
  return c.phi;
3018
3016
  }, this.getAzimuthalAngle = function() {
3019
3017
  return c.theta;
3020
3018
  }, this.getDistance = function() {
3021
3019
  return this.object.position.distanceTo(this.target);
3022
3020
  }, this.listenToKeyEvents = function(r) {
3023
- r.addEventListener("keydown", tt), this._domElementKeyEvents = r;
3021
+ r.addEventListener("keydown", et), this._domElementKeyEvents = r;
3024
3022
  }, this.stopListenToKeyEvents = function() {
3025
- this._domElementKeyEvents.removeEventListener("keydown", tt), this._domElementKeyEvents = null;
3023
+ this._domElementKeyEvents.removeEventListener("keydown", et), this._domElementKeyEvents = null;
3026
3024
  }, this.saveState = function() {
3027
3025
  e.target0.copy(e.target), e.position0.copy(e.object.position), e.zoom0 = e.object.zoom;
3028
3026
  }, this.reset = function() {
3029
3027
  e.target.copy(e.target0), e.object.position.copy(e.position0), e.object.zoom = e.zoom0, e.object.updateProjectionMatrix(), e.dispatchEvent(an), e.update(), s = o.NONE;
3030
3028
  }, this.update = function() {
3031
- const r = new X(), y = new Xt().setFromUnitVectors(n.up, new X(0, 1, 0)), O = y.clone().invert(), L = new X(), K = new Xt(), de = new X(), ae = 2 * Math.PI;
3029
+ const r = new X(), y = new Xt().setFromUnitVectors(n.up, new X(0, 1, 0)), O = y.clone().invert(), L = new X(), K = new Xt(), de = new X(), ie = 2 * Math.PI;
3032
3030
  return function(Nt = null) {
3033
- const at = e.object.position;
3034
- r.copy(at).sub(e.target), r.applyQuaternion(y), c.setFromVector3(r), e.autoRotate && s === o.NONE && U(P(Nt)), e.enableDamping ? (c.theta += u.theta * e.dampingFactor, c.phi += u.phi * e.dampingFactor) : (c.theta += u.theta, c.phi += u.phi);
3035
- let pe = e.minAzimuthAngle, fe = e.maxAzimuthAngle;
3036
- isFinite(pe) && isFinite(fe) && (pe < -Math.PI ? pe += ae : pe > Math.PI && (pe -= ae), fe < -Math.PI ? fe += ae : fe > Math.PI && (fe -= ae), pe <= fe ? c.theta = Math.max(pe, Math.min(fe, c.theta)) : c.theta = c.theta > (pe + fe) / 2 ? Math.max(pe, c.theta) : Math.min(fe, c.theta)), c.phi = Math.max(e.minPolarAngle, Math.min(e.maxPolarAngle, c.phi)), c.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 && se || e.object.isOrthographicCamera ? c.radius = me(c.radius) : c.radius = me(c.radius * d), r.setFromSpherical(c), r.applyQuaternion(O), at.copy(e.target).add(r), e.object.lookAt(e.target), e.enableDamping === !0 ? (u.theta *= 1 - e.dampingFactor, u.phi *= 1 - e.dampingFactor, v.multiplyScalar(1 - e.dampingFactor)) : (u.set(0, 0, 0), v.set(0, 0, 0));
3037
- let ke = !1;
3031
+ const nt = e.object.position;
3032
+ r.copy(nt).sub(e.target), r.applyQuaternion(y), c.setFromVector3(r), e.autoRotate && s === o.NONE && U(_(Nt)), e.enableDamping ? (c.theta += u.theta * e.dampingFactor, c.phi += u.phi * e.dampingFactor) : (c.theta += u.theta, c.phi += u.phi);
3033
+ let pe = e.minAzimuthAngle, he = e.maxAzimuthAngle;
3034
+ isFinite(pe) && isFinite(he) && (pe < -Math.PI ? pe += ie : pe > Math.PI && (pe -= ie), he < -Math.PI ? he += ie : he > Math.PI && (he -= ie), pe <= he ? c.theta = Math.max(pe, Math.min(he, c.theta)) : c.theta = c.theta > (pe + he) / 2 ? Math.max(pe, c.theta) : Math.min(he, c.theta)), c.phi = Math.max(e.minPolarAngle, Math.min(e.maxPolarAngle, c.phi)), c.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 && se || e.object.isOrthographicCamera ? c.radius = me(c.radius) : c.radius = me(c.radius * f), r.setFromSpherical(c), r.applyQuaternion(O), nt.copy(e.target).add(r), e.object.lookAt(e.target), e.enableDamping === !0 ? (u.theta *= 1 - e.dampingFactor, u.phi *= 1 - e.dampingFactor, v.multiplyScalar(1 - e.dampingFactor)) : (u.set(0, 0, 0), v.set(0, 0, 0));
3035
+ let Pe = !1;
3038
3036
  if (e.zoomToCursor && se) {
3039
- let _e = null;
3037
+ let ke = null;
3040
3038
  if (e.object.isPerspectiveCamera) {
3041
3039
  const je = r.length();
3042
- _e = me(je * d);
3043
- const De = je - _e;
3044
- e.object.position.addScaledVector(Ee, De), e.object.updateMatrixWorld();
3040
+ ke = me(je * f);
3041
+ const De = je - ke;
3042
+ e.object.position.addScaledVector(Ce, De), e.object.updateMatrixWorld();
3045
3043
  } else if (e.object.isOrthographicCamera) {
3046
3044
  const je = new X(le.x, le.y, 0);
3047
- je.unproject(e.object), e.object.zoom = Math.max(e.minZoom, Math.min(e.maxZoom, e.object.zoom / d)), e.object.updateProjectionMatrix(), ke = !0;
3045
+ je.unproject(e.object), e.object.zoom = Math.max(e.minZoom, Math.min(e.maxZoom, e.object.zoom / f)), e.object.updateProjectionMatrix(), Pe = !0;
3048
3046
  const De = new X(le.x, le.y, 0);
3049
- De.unproject(e.object), e.object.position.sub(De).add(je), e.object.updateMatrixWorld(), _e = r.length();
3047
+ De.unproject(e.object), e.object.position.sub(De).add(je), e.object.updateMatrixWorld(), ke = r.length();
3050
3048
  } else
3051
3049
  console.warn("WARNING: OrbitControls.js encountered an unknown camera type - zoom to cursor disabled."), e.zoomToCursor = !1;
3052
- _e !== null && (this.screenSpacePanning ? e.target.set(0, 0, -1).transformDirection(e.object.matrix).multiplyScalar(_e).add(e.object.position) : (St.origin.copy(e.object.position), St.direction.set(0, 0, -1).transformDirection(e.object.matrix), Math.abs(e.object.up.dot(St.direction)) < Ri ? n.lookAt(e.target) : (on.setFromNormalAndCoplanarPoint(e.object.up, e.target), St.intersectPlane(on, e.target))));
3050
+ ke !== null && (this.screenSpacePanning ? e.target.set(0, 0, -1).transformDirection(e.object.matrix).multiplyScalar(ke).add(e.object.position) : (wt.origin.copy(e.object.position), wt.direction.set(0, 0, -1).transformDirection(e.object.matrix), Math.abs(e.object.up.dot(wt.direction)) < gi ? n.lookAt(e.target) : (on.setFromNormalAndCoplanarPoint(e.object.up, e.target), wt.intersectPlane(on, e.target))));
3053
3051
  } else
3054
- e.object.isOrthographicCamera && (ke = d !== 1, ke && (e.object.zoom = Math.max(e.minZoom, Math.min(e.maxZoom, e.object.zoom / d)), e.object.updateProjectionMatrix()));
3055
- return d = 1, se = !1, ke || L.distanceToSquared(e.object.position) > p || 8 * (1 - K.dot(e.object.quaternion)) > p || de.distanceToSquared(e.target) > 0 ? (e.dispatchEvent(an), L.copy(e.object.position), K.copy(e.object.quaternion), de.copy(e.target), !0) : !1;
3052
+ e.object.isOrthographicCamera && (Pe = f !== 1, Pe && (e.object.zoom = Math.max(e.minZoom, Math.min(e.maxZoom, e.object.zoom / f)), e.object.updateProjectionMatrix()));
3053
+ return f = 1, se = !1, Pe || L.distanceToSquared(e.object.position) > p || 8 * (1 - K.dot(e.object.quaternion)) > p || de.distanceToSquared(e.target) > 0 ? (e.dispatchEvent(an), L.copy(e.object.position), K.copy(e.object.quaternion), de.copy(e.target), !0) : !1;
3056
3054
  };
3057
3055
  }(), this.dispose = function() {
3058
- e.domElement.removeEventListener("contextmenu", Ge), e.domElement.removeEventListener("pointerdown", Pe), e.domElement.removeEventListener("pointercancel", Ae), e.domElement.removeEventListener("wheel", bt), e.domElement.removeEventListener("pointermove", Qe), e.domElement.removeEventListener("pointerup", Ae), e._domElementKeyEvents !== null && (e._domElementKeyEvents.removeEventListener("keydown", tt), e._domElementKeyEvents = null);
3056
+ e.domElement.removeEventListener("contextmenu", Ye), e.domElement.removeEventListener("pointerdown", _e), e.domElement.removeEventListener("pointercancel", Ae), e.domElement.removeEventListener("wheel", bt), e.domElement.removeEventListener("pointermove", Je), e.domElement.removeEventListener("pointerup", Ae), e._domElementKeyEvents !== null && (e._domElementKeyEvents.removeEventListener("keydown", et), e._domElementKeyEvents = null);
3059
3057
  };
3060
3058
  const e = this, o = {
3061
3059
  NONE: -1,
@@ -3069,12 +3067,12 @@ class Pi extends un {
3069
3067
  };
3070
3068
  let s = o.NONE;
3071
3069
  const p = 1e-6, c = new Zt(), u = new Zt();
3072
- let d = 1;
3073
- const v = new X(), b = new ue(), E = new ue(), x = new ue(), M = new ue(), k = new ue(), H = new ue(), B = new ue(), S = new ue(), z = new ue(), Ee = new X(), le = new ue();
3070
+ let f = 1;
3071
+ const v = new X(), b = new ue(), E = new ue(), x = new ue(), M = new ue(), P = new ue(), H = new ue(), B = new ue(), w = new ue(), z = new ue(), Ce = new X(), le = new ue();
3074
3072
  let se = !1;
3075
- const f = [], m = {};
3076
- let w = !1;
3077
- function P(r) {
3073
+ const d = [], m = {};
3074
+ let S = !1;
3075
+ function _(r) {
3078
3076
  return r !== null ? 2 * Math.PI / 60 * e.autoRotateSpeed * r : 2 * Math.PI / 60 / 60 * e.autoRotateSpeed;
3079
3077
  }
3080
3078
  function Y(r) {
@@ -3104,35 +3102,35 @@ class Pi extends un {
3104
3102
  if (e.object.isPerspectiveCamera) {
3105
3103
  const de = e.object.position;
3106
3104
  r.copy(de).sub(e.target);
3107
- let ae = r.length();
3108
- ae *= Math.tan(e.object.fov / 2 * Math.PI / 180), I(2 * O * ae / K.clientHeight, e.object.matrix), W(2 * L * ae / K.clientHeight, e.object.matrix);
3105
+ let ie = r.length();
3106
+ ie *= Math.tan(e.object.fov / 2 * Math.PI / 180), I(2 * O * ie / K.clientHeight, e.object.matrix), W(2 * L * ie / K.clientHeight, e.object.matrix);
3109
3107
  } else
3110
3108
  e.object.isOrthographicCamera ? (I(O * (e.object.right - e.object.left) / e.object.zoom / K.clientWidth, e.object.matrix), W(L * (e.object.top - e.object.bottom) / e.object.zoom / K.clientHeight, e.object.matrix)) : (console.warn("WARNING: OrbitControls.js encountered an unknown camera type - pan disabled."), e.enablePan = !1);
3111
3109
  };
3112
3110
  }();
3113
3111
  function T(r) {
3114
- e.object.isPerspectiveCamera || e.object.isOrthographicCamera ? d /= r : (console.warn("WARNING: OrbitControls.js encountered an unknown camera type - dolly/zoom disabled."), e.enableZoom = !1);
3112
+ e.object.isPerspectiveCamera || e.object.isOrthographicCamera ? f /= r : (console.warn("WARNING: OrbitControls.js encountered an unknown camera type - dolly/zoom disabled."), e.enableZoom = !1);
3115
3113
  }
3116
3114
  function N(r) {
3117
- e.object.isPerspectiveCamera || e.object.isOrthographicCamera ? d *= r : (console.warn("WARNING: OrbitControls.js encountered an unknown camera type - dolly/zoom disabled."), e.enableZoom = !1);
3115
+ e.object.isPerspectiveCamera || e.object.isOrthographicCamera ? f *= r : (console.warn("WARNING: OrbitControls.js encountered an unknown camera type - dolly/zoom disabled."), e.enableZoom = !1);
3118
3116
  }
3119
3117
  function J(r, y) {
3120
3118
  if (!e.zoomToCursor)
3121
3119
  return;
3122
3120
  se = !0;
3123
- const O = e.domElement.getBoundingClientRect(), L = r - O.left, K = y - O.top, de = O.width, ae = O.height;
3124
- le.x = L / de * 2 - 1, le.y = -(K / ae) * 2 + 1, Ee.set(le.x, le.y, 1).unproject(e.object).sub(e.object.position).normalize();
3121
+ const O = e.domElement.getBoundingClientRect(), L = r - O.left, K = y - O.top, de = O.width, ie = O.height;
3122
+ le.x = L / de * 2 - 1, le.y = -(K / ie) * 2 + 1, Ce.set(le.x, le.y, 1).unproject(e.object).sub(e.object.position).normalize();
3125
3123
  }
3126
3124
  function me(r) {
3127
3125
  return Math.max(e.minDistance, Math.min(e.maxDistance, r));
3128
3126
  }
3129
- function Ce(r) {
3127
+ function xe(r) {
3130
3128
  b.set(r.clientX, r.clientY);
3131
3129
  }
3132
- function ft(r) {
3130
+ function ht(r) {
3133
3131
  J(r.clientX, r.clientX), B.set(r.clientX, r.clientY);
3134
3132
  }
3135
- function Xe(r) {
3133
+ function Ke(r) {
3136
3134
  M.set(r.clientX, r.clientY);
3137
3135
  }
3138
3136
  function At(r) {
@@ -3140,16 +3138,16 @@ class Pi extends un {
3140
3138
  const y = e.domElement;
3141
3139
  U(2 * Math.PI * x.x / y.clientHeight), $(2 * Math.PI * x.y / y.clientHeight), b.copy(E), e.update();
3142
3140
  }
3143
- function kt(r) {
3144
- S.set(r.clientX, r.clientY), z.subVectors(S, B), z.y > 0 ? T(Y(z.y)) : z.y < 0 && N(Y(z.y)), B.copy(S), e.update();
3141
+ function Pt(r) {
3142
+ w.set(r.clientX, r.clientY), z.subVectors(w, B), z.y > 0 ? T(Y(z.y)) : z.y < 0 && N(Y(z.y)), B.copy(w), e.update();
3145
3143
  }
3146
- function Ze(r) {
3147
- k.set(r.clientX, r.clientY), H.subVectors(k, M).multiplyScalar(e.panSpeed), q(H.x, H.y), M.copy(k), e.update();
3144
+ function Xe(r) {
3145
+ P.set(r.clientX, r.clientY), H.subVectors(P, M).multiplyScalar(e.panSpeed), q(H.x, H.y), M.copy(P), e.update();
3148
3146
  }
3149
- function Je(r) {
3147
+ function Ze(r) {
3150
3148
  J(r.clientX, r.clientY), r.deltaY < 0 ? N(Y(r.deltaY)) : r.deltaY > 0 && T(Y(r.deltaY)), e.update();
3151
3149
  }
3152
- function ze(r) {
3150
+ function $e(r) {
3153
3151
  let y = !1;
3154
3152
  switch (r.code) {
3155
3153
  case e.keys.UP:
@@ -3167,8 +3165,8 @@ class Pi extends un {
3167
3165
  }
3168
3166
  y && (r.preventDefault(), e.update());
3169
3167
  }
3170
- function Ye(r) {
3171
- if (f.length === 1)
3168
+ function ze(r) {
3169
+ if (d.length === 1)
3172
3170
  b.set(r.pageX, r.pageY);
3173
3171
  else {
3174
3172
  const y = Se(r), O = 0.5 * (r.pageX + y.x), L = 0.5 * (r.pageY + y.y);
@@ -3176,25 +3174,25 @@ class Pi extends un {
3176
3174
  }
3177
3175
  }
3178
3176
  function Me(r) {
3179
- if (f.length === 1)
3177
+ if (d.length === 1)
3180
3178
  M.set(r.pageX, r.pageY);
3181
3179
  else {
3182
3180
  const y = Se(r), O = 0.5 * (r.pageX + y.x), L = 0.5 * (r.pageY + y.y);
3183
3181
  M.set(O, L);
3184
3182
  }
3185
3183
  }
3186
- function ht(r) {
3184
+ function ft(r) {
3187
3185
  const y = Se(r), O = r.pageX - y.x, L = r.pageY - y.y, K = Math.sqrt(O * O + L * L);
3188
3186
  B.set(0, K);
3189
3187
  }
3190
3188
  function pt(r) {
3191
- e.enableZoom && ht(r), e.enablePan && Me(r);
3189
+ e.enableZoom && ft(r), e.enablePan && Me(r);
3192
3190
  }
3193
- function _t(r) {
3194
- e.enableZoom && ht(r), e.enableRotate && Ye(r);
3191
+ function kt(r) {
3192
+ e.enableZoom && ft(r), e.enableRotate && ze(r);
3195
3193
  }
3196
3194
  function mt(r) {
3197
- if (f.length == 1)
3195
+ if (d.length == 1)
3198
3196
  E.set(r.pageX, r.pageY);
3199
3197
  else {
3200
3198
  const O = Se(r), L = 0.5 * (r.pageX + O.x), K = 0.5 * (r.pageY + O.y);
@@ -3205,19 +3203,19 @@ class Pi extends un {
3205
3203
  U(2 * Math.PI * x.x / y.clientHeight), $(2 * Math.PI * x.y / y.clientHeight), b.copy(E);
3206
3204
  }
3207
3205
  function Te(r) {
3208
- if (f.length === 1)
3209
- k.set(r.pageX, r.pageY);
3206
+ if (d.length === 1)
3207
+ P.set(r.pageX, r.pageY);
3210
3208
  else {
3211
3209
  const y = Se(r), O = 0.5 * (r.pageX + y.x), L = 0.5 * (r.pageY + y.y);
3212
- k.set(O, L);
3210
+ P.set(O, L);
3213
3211
  }
3214
- H.subVectors(k, M).multiplyScalar(e.panSpeed), q(H.x, H.y), M.copy(k);
3212
+ H.subVectors(P, M).multiplyScalar(e.panSpeed), q(H.x, H.y), M.copy(P);
3215
3213
  }
3216
3214
  function Re(r) {
3217
3215
  const y = Se(r), O = r.pageX - y.x, L = r.pageY - y.y, K = Math.sqrt(O * O + L * L);
3218
- S.set(0, K), z.set(0, Math.pow(S.y / B.y, e.zoomSpeed)), T(z.y), B.copy(S);
3219
- const de = (r.pageX + y.x) * 0.5, ae = (r.pageY + y.y) * 0.5;
3220
- J(de, ae);
3216
+ w.set(0, K), z.set(0, Math.pow(w.y / B.y, e.zoomSpeed)), T(z.y), B.copy(w);
3217
+ const de = (r.pageX + y.x) * 0.5, ie = (r.pageY + y.y) * 0.5;
3218
+ J(de, ie);
3221
3219
  }
3222
3220
  function vt(r) {
3223
3221
  e.enableZoom && Re(r), e.enablePan && Te(r);
@@ -3225,24 +3223,24 @@ class Pi extends un {
3225
3223
  function gt(r) {
3226
3224
  e.enableZoom && Re(r), e.enableRotate && mt(r);
3227
3225
  }
3228
- function Pe(r) {
3229
- e.enabled !== !1 && (f.length === 0 && (e.domElement.setPointerCapture(r.pointerId), e.domElement.addEventListener("pointermove", Qe), e.domElement.addEventListener("pointerup", Ae)), Dt(r), r.pointerType === "touch" ? nt(r) : et(r));
3226
+ function _e(r) {
3227
+ e.enabled !== !1 && (d.length === 0 && (e.domElement.setPointerCapture(r.pointerId), e.domElement.addEventListener("pointermove", Je), e.domElement.addEventListener("pointerup", Ae)), Dt(r), r.pointerType === "touch" ? tt(r) : Qe(r));
3230
3228
  }
3231
- function Qe(r) {
3229
+ function Je(r) {
3232
3230
  e.enabled !== !1 && (r.pointerType === "touch" ? Ct(r) : jt(r));
3233
3231
  }
3234
3232
  function Ae(r) {
3235
- switch (It(r), f.length) {
3233
+ switch (It(r), d.length) {
3236
3234
  case 0:
3237
- e.domElement.releasePointerCapture(r.pointerId), e.domElement.removeEventListener("pointermove", Qe), e.domElement.removeEventListener("pointerup", Ae), e.dispatchEvent(rn), s = o.NONE;
3235
+ e.domElement.releasePointerCapture(r.pointerId), e.domElement.removeEventListener("pointermove", Je), e.domElement.removeEventListener("pointerup", Ae), e.dispatchEvent(rn), s = o.NONE;
3238
3236
  break;
3239
3237
  case 1:
3240
- const y = f[0], O = m[y];
3241
- nt({ pointerId: y, pageX: O.x, pageY: O.y });
3238
+ const y = d[0], O = m[y];
3239
+ tt({ pointerId: y, pageX: O.x, pageY: O.y });
3242
3240
  break;
3243
3241
  }
3244
3242
  }
3245
- function et(r) {
3243
+ function Qe(r) {
3246
3244
  let y;
3247
3245
  switch (r.button) {
3248
3246
  case 0:
@@ -3258,31 +3256,31 @@ class Pi extends un {
3258
3256
  y = -1;
3259
3257
  }
3260
3258
  switch (y) {
3261
- case He.DOLLY:
3259
+ case Ve.DOLLY:
3262
3260
  if (e.enableZoom === !1)
3263
3261
  return;
3264
- ft(r), s = o.DOLLY;
3262
+ ht(r), s = o.DOLLY;
3265
3263
  break;
3266
- case He.ROTATE:
3264
+ case Ve.ROTATE:
3267
3265
  if (r.ctrlKey || r.metaKey || r.shiftKey) {
3268
3266
  if (e.enablePan === !1)
3269
3267
  return;
3270
- Xe(r), s = o.PAN;
3268
+ Ke(r), s = o.PAN;
3271
3269
  } else {
3272
3270
  if (e.enableRotate === !1)
3273
3271
  return;
3274
- Ce(r), s = o.ROTATE;
3272
+ xe(r), s = o.ROTATE;
3275
3273
  }
3276
3274
  break;
3277
- case He.PAN:
3275
+ case Ve.PAN:
3278
3276
  if (r.ctrlKey || r.metaKey || r.shiftKey) {
3279
3277
  if (e.enableRotate === !1)
3280
3278
  return;
3281
- Ce(r), s = o.ROTATE;
3279
+ xe(r), s = o.ROTATE;
3282
3280
  } else {
3283
3281
  if (e.enablePan === !1)
3284
3282
  return;
3285
- Xe(r), s = o.PAN;
3283
+ Ke(r), s = o.PAN;
3286
3284
  }
3287
3285
  break;
3288
3286
  default:
@@ -3300,17 +3298,17 @@ class Pi extends un {
3300
3298
  case o.DOLLY:
3301
3299
  if (e.enableZoom === !1)
3302
3300
  return;
3303
- kt(r);
3301
+ Pt(r);
3304
3302
  break;
3305
3303
  case o.PAN:
3306
3304
  if (e.enablePan === !1)
3307
3305
  return;
3308
- Ze(r);
3306
+ Xe(r);
3309
3307
  break;
3310
3308
  }
3311
3309
  }
3312
3310
  function bt(r) {
3313
- e.enabled === !1 || e.enableZoom === !1 || s !== o.NONE || (r.preventDefault(), e.dispatchEvent($t), Je(yt(r)), e.dispatchEvent(rn));
3311
+ e.enabled === !1 || e.enableZoom === !1 || s !== o.NONE || (r.preventDefault(), e.dispatchEvent($t), Ze(yt(r)), e.dispatchEvent(rn));
3314
3312
  }
3315
3313
  function yt(r) {
3316
3314
  const y = r.deltaMode, O = {
@@ -3326,27 +3324,27 @@ class Pi extends un {
3326
3324
  O.deltaY *= 100;
3327
3325
  break;
3328
3326
  }
3329
- return r.ctrlKey && !w && (O.deltaY *= 10), O;
3327
+ return r.ctrlKey && !S && (O.deltaY *= 10), O;
3330
3328
  }
3331
3329
  function Et(r) {
3332
- r.key === "Control" && (w = !0, e.domElement.getRootNode().addEventListener("keyup", xe, { passive: !0, capture: !0 }));
3330
+ r.key === "Control" && (S = !0, e.domElement.getRootNode().addEventListener("keyup", we, { passive: !0, capture: !0 }));
3333
3331
  }
3334
- function xe(r) {
3335
- r.key === "Control" && (w = !1, e.domElement.getRootNode().removeEventListener("keyup", xe, { passive: !0, capture: !0 }));
3332
+ function we(r) {
3333
+ r.key === "Control" && (S = !1, e.domElement.getRootNode().removeEventListener("keyup", we, { passive: !0, capture: !0 }));
3336
3334
  }
3337
- function tt(r) {
3338
- e.enabled === !1 || e.enablePan === !1 || ze(r);
3335
+ function et(r) {
3336
+ e.enabled === !1 || e.enablePan === !1 || $e(r);
3339
3337
  }
3340
- function nt(r) {
3341
- switch (xt(r), f.length) {
3338
+ function tt(r) {
3339
+ switch (xt(r), d.length) {
3342
3340
  case 1:
3343
3341
  switch (e.touches.ONE) {
3344
- case We.ROTATE:
3342
+ case He.ROTATE:
3345
3343
  if (e.enableRotate === !1)
3346
3344
  return;
3347
- Ye(r), s = o.TOUCH_ROTATE;
3345
+ ze(r), s = o.TOUCH_ROTATE;
3348
3346
  break;
3349
- case We.PAN:
3347
+ case He.PAN:
3350
3348
  if (e.enablePan === !1)
3351
3349
  return;
3352
3350
  Me(r), s = o.TOUCH_PAN;
@@ -3357,15 +3355,15 @@ class Pi extends un {
3357
3355
  break;
3358
3356
  case 2:
3359
3357
  switch (e.touches.TWO) {
3360
- case We.DOLLY_PAN:
3358
+ case He.DOLLY_PAN:
3361
3359
  if (e.enableZoom === !1 && e.enablePan === !1)
3362
3360
  return;
3363
3361
  pt(r), s = o.TOUCH_DOLLY_PAN;
3364
3362
  break;
3365
- case We.DOLLY_ROTATE:
3363
+ case He.DOLLY_ROTATE:
3366
3364
  if (e.enableZoom === !1 && e.enableRotate === !1)
3367
3365
  return;
3368
- _t(r), s = o.TOUCH_DOLLY_ROTATE;
3366
+ kt(r), s = o.TOUCH_DOLLY_ROTATE;
3369
3367
  break;
3370
3368
  default:
3371
3369
  s = o.NONE;
@@ -3402,17 +3400,17 @@ class Pi extends un {
3402
3400
  s = o.NONE;
3403
3401
  }
3404
3402
  }
3405
- function Ge(r) {
3403
+ function Ye(r) {
3406
3404
  e.enabled !== !1 && r.preventDefault();
3407
3405
  }
3408
3406
  function Dt(r) {
3409
- f.push(r.pointerId);
3407
+ d.push(r.pointerId);
3410
3408
  }
3411
3409
  function It(r) {
3412
3410
  delete m[r.pointerId];
3413
- for (let y = 0; y < f.length; y++)
3414
- if (f[y] == r.pointerId) {
3415
- f.splice(y, 1);
3411
+ for (let y = 0; y < d.length; y++)
3412
+ if (d[y] == r.pointerId) {
3413
+ d.splice(y, 1);
3416
3414
  return;
3417
3415
  }
3418
3416
  }
@@ -3421,14 +3419,14 @@ class Pi extends un {
3421
3419
  y === void 0 && (y = new ue(), m[r.pointerId] = y), y.set(r.pageX, r.pageY);
3422
3420
  }
3423
3421
  function Se(r) {
3424
- const y = r.pointerId === f[0] ? f[1] : f[0];
3422
+ const y = r.pointerId === d[0] ? d[1] : d[0];
3425
3423
  return m[y];
3426
3424
  }
3427
- e.domElement.addEventListener("contextmenu", Ge), e.domElement.addEventListener("pointerdown", Pe), e.domElement.addEventListener("pointercancel", Ae), e.domElement.addEventListener("wheel", bt, { passive: !1 }), e.domElement.getRootNode().addEventListener("keydown", Et, { passive: !0, capture: !0 }), this.update();
3425
+ e.domElement.addEventListener("contextmenu", Ye), e.domElement.addEventListener("pointerdown", _e), e.domElement.addEventListener("pointercancel", Ae), e.domElement.addEventListener("wheel", bt, { passive: !1 }), e.domElement.getRootNode().addEventListener("keydown", Et, { passive: !0, capture: !0 }), this.update();
3428
3426
  }
3429
3427
  }
3430
3428
  const Mt = (t) => {
3431
- const [n, a] = oe(t.options[t.index]), e = () => {
3429
+ const [n, a] = ae(t.options[t.index]), e = () => {
3432
3430
  t.onToggle(!t.open);
3433
3431
  }, o = (s) => {
3434
3432
  s !== n && (t.onSelect(s), a(s)), t.onToggle(!1);
@@ -3437,8 +3435,8 @@ const Mt = (t) => {
3437
3435
  /* @__PURE__ */ l.jsx("div", { className: "dropdown-toggle", onClick: e, children: n }),
3438
3436
  t.open && /* @__PURE__ */ l.jsx("ul", { className: "dropdown-menu", children: t.options.map((s) => /* @__PURE__ */ l.jsx("li", { onClick: () => o(s), children: s }, s)) })
3439
3437
  ] });
3440
- }, Le = Ra(function(n, a) {
3441
- const [e, o] = oe(!1), s = n.options.indexOf(n.camera.name);
3438
+ }, Le = Ma(function(n, a) {
3439
+ const [e, o] = ae(!1), s = n.options.indexOf(n.camera.name);
3442
3440
  return /* @__PURE__ */ l.jsxs("div", { className: "CameraWindow", children: [
3443
3441
  /* @__PURE__ */ l.jsx("div", { ref: a, className: "clickable", onClick: () => {
3444
3442
  e && o(!1);
@@ -3462,60 +3460,60 @@ const Mt = (t) => {
3462
3460
  "Side by Side",
3463
3461
  "Stacked",
3464
3462
  "Quad"
3465
- ], ne = /* @__PURE__ */ new Map(), ie = /* @__PURE__ */ new Map(), ge = /* @__PURE__ */ new Map();
3466
- function $e(t, n) {
3463
+ ], ne = /* @__PURE__ */ new Map(), re = /* @__PURE__ */ new Map(), be = /* @__PURE__ */ new Map();
3464
+ function Ue(t, n) {
3467
3465
  const a = new Rn(-100, 100, 100, -100, 50, 3e3);
3468
3466
  return a.name = t, a.position.copy(n), a.lookAt(0, 0, 0), ne.set(t, a), a;
3469
3467
  }
3470
- $e("Top", new X(0, 1e3, 0));
3471
- $e("Bottom", new X(0, -1e3, 0));
3472
- $e("Left", new X(-1e3, 0, 0));
3473
- $e("Right", new X(1e3, 0, 0));
3474
- $e("Front", new X(0, 0, 1e3));
3475
- $e("Back", new X(0, 0, -1e3));
3476
- $e("Orthographic", new X(1e3, 1e3, 1e3));
3477
- const Pt = new zt(60, 1, 50, 3e3);
3478
- Pt.name = "Debug";
3479
- Pt.position.set(500, 500, 500);
3480
- Pt.lookAt(0, 0, 0);
3481
- ne.set("Debug", Pt);
3468
+ Ue("Top", new X(0, 1e3, 0));
3469
+ Ue("Bottom", new X(0, -1e3, 0));
3470
+ Ue("Left", new X(-1e3, 0, 0));
3471
+ Ue("Right", new X(1e3, 0, 0));
3472
+ Ue("Front", new X(0, 0, 1e3));
3473
+ Ue("Back", new X(0, 0, -1e3));
3474
+ Ue("Orthographic", new X(1e3, 1e3, 1e3));
3475
+ const _t = new zt(60, 1, 50, 3e3);
3476
+ _t.name = "Debug";
3477
+ _t.position.set(500, 500, 500);
3478
+ _t.lookAt(0, 0, 0);
3479
+ ne.set("Debug", _t);
3482
3480
  const cn = [
3483
3481
  "Renderer",
3484
3482
  "Depth",
3485
3483
  "Normals",
3486
3484
  "UVs",
3487
3485
  "Wireframe"
3488
- ], Ai = new va(), ki = new ga(), _i = new si(), ji = new ba({
3486
+ ], yi = new ma(), Ei = new va(), Ci = new Xa(), xi = new ga({
3489
3487
  opacity: 0.33,
3490
3488
  transparent: !0,
3491
3489
  wireframe: !0
3492
3490
  });
3493
- let wt = "Renderer";
3494
- const V = new Pn();
3491
+ let St = "Renderer";
3492
+ const V = new _n();
3495
3493
  V.name = "Debug Scene";
3496
- let be = new Pn();
3497
- V.add(be);
3498
- const dt = new ya();
3494
+ let ye = new _n();
3495
+ V.add(ye);
3496
+ const dt = new ba();
3499
3497
  dt.name = "helpers";
3500
3498
  V.add(dt);
3501
- const Di = new ii();
3502
- dt.add(Di);
3503
- const $n = new An(500);
3504
- $n.name = "axisHelper";
3505
- dt.add($n);
3499
+ const wi = new Wa();
3500
+ dt.add(wi);
3501
+ const Un = new An(500);
3502
+ Un.name = "axisHelper";
3503
+ dt.add(Un);
3506
3504
  const ut = new An(100);
3507
3505
  ut.name = "interactionHelper";
3508
3506
  dt.add(ut);
3509
3507
  ut.visible = !1;
3510
- let Ot = !1, G = ne.get("Debug"), re = ne.get("Orthographic"), Ne = ne.get("Front"), Fe = ne.get("Top"), ln = !1;
3511
- function qi(t) {
3512
- const [n, a] = oe(t.mode !== void 0 ? t.mode : "Single"), [e, o] = oe(null), [s, p] = oe(!1), [c, u] = oe(!1), [d, v] = oe(!1), [, b] = oe(Date.now()), E = ye(null), x = ye(null), M = ye(null), k = ye(null), H = ye(null), B = ye(null), S = (f, m) => {
3513
- const w = ie.get(f.name);
3514
- w !== void 0 && w.dispose(), ie.delete(f.name);
3515
- const P = ge.get(f.name);
3516
- P !== void 0 && (V.remove(P), P.dispose()), ge.delete(f.name);
3517
- const Y = new Pi(f, m);
3518
- switch (Y.enableDamping = !0, Y.dampingFactor = 0.05, f.name) {
3508
+ let Ot = !1, G = ne.get("Debug"), oe = ne.get("Orthographic"), Ne = ne.get("Front"), Fe = ne.get("Top"), ln = !1;
3509
+ function Ui(t) {
3510
+ const [n, a] = ae(t.mode !== void 0 ? t.mode : "Single"), [e, o] = ae(null), [s, p] = ae(!1), [c, u] = ae(!1), [f, v] = ae(!1), [, b] = ae(Date.now()), E = Ee(null), x = Ee(null), M = Ee(null), P = Ee(null), H = Ee(null), B = Ee(null), w = (d, m) => {
3511
+ const S = re.get(d.name);
3512
+ S !== void 0 && S.dispose(), re.delete(d.name);
3513
+ const _ = be.get(d.name);
3514
+ _ !== void 0 && (V.remove(_), _.dispose()), be.delete(d.name);
3515
+ const Y = new bi(d, m);
3516
+ switch (Y.enableDamping = !0, Y.dampingFactor = 0.05, d.name) {
3519
3517
  case "Top":
3520
3518
  case "Bottom":
3521
3519
  case "Left":
@@ -3525,95 +3523,95 @@ function qi(t) {
3525
3523
  Y.enableRotate = !1;
3526
3524
  break;
3527
3525
  }
3528
- if (ie.set(f.name, Y), f instanceof zt) {
3529
- const U = new xa(f);
3530
- ge.set(f.name, U), V.add(U);
3531
- }
3532
- }, z = (f) => {
3533
- const m = ge.get(f.name);
3534
- m !== void 0 && (V.remove(m), m.dispose(), ge.delete(f.name));
3535
- const w = ie.get(f.name);
3536
- w !== void 0 && (w.dispose(), ie.delete(f.name));
3537
- }, Ee = () => {
3538
- ie.forEach((f, m) => {
3539
- f.dispose();
3540
- const w = ge.get(m);
3541
- w !== void 0 && (V.remove(w), w.dispose()), ge.delete(m), ie.delete(m);
3542
- }), ie.clear(), ge.clear();
3526
+ if (re.set(d.name, Y), d instanceof zt) {
3527
+ const U = new Ca(d);
3528
+ be.set(d.name, U), V.add(U);
3529
+ }
3530
+ }, z = (d) => {
3531
+ const m = be.get(d.name);
3532
+ m !== void 0 && (V.remove(m), m.dispose(), be.delete(d.name));
3533
+ const S = re.get(d.name);
3534
+ S !== void 0 && (S.dispose(), re.delete(d.name));
3535
+ }, Ce = () => {
3536
+ re.forEach((d, m) => {
3537
+ d.dispose();
3538
+ const S = be.get(m);
3539
+ S !== void 0 && (V.remove(S), S.dispose()), be.delete(m), re.delete(m);
3540
+ }), re.clear(), be.clear();
3543
3541
  }, le = () => {
3544
3542
  switch (n) {
3545
3543
  case "Single":
3546
- S(G, M.current);
3544
+ w(G, M.current);
3547
3545
  break;
3548
3546
  case "Side by Side":
3549
3547
  case "Stacked":
3550
- S(G, M.current), S(re, k.current);
3548
+ w(G, M.current), w(oe, P.current);
3551
3549
  break;
3552
3550
  case "Quad":
3553
- S(G, M.current), S(re, k.current), S(Ne, H.current), S(Fe, B.current);
3551
+ w(G, M.current), w(oe, P.current), w(Ne, H.current), w(Fe, B.current);
3554
3552
  break;
3555
3553
  }
3556
3554
  };
3557
- Be(() => {
3558
- const f = new Ea({
3555
+ Oe(() => {
3556
+ const d = new ya({
3559
3557
  canvas: E.current,
3560
3558
  stencil: !1
3561
3559
  });
3562
- f.autoClear = !1, f.shadowMap.enabled = !0, f.setPixelRatio(devicePixelRatio), f.setClearColor(0), o(f);
3563
- }, []), Be(() => {
3564
- const f = (P) => {
3565
- Dn(be), V.remove(be);
3566
- const Y = t.scenes.get(P.value.name);
3560
+ d.autoClear = !1, d.shadowMap.enabled = !0, d.setPixelRatio(devicePixelRatio), d.setClearColor(0), o(d);
3561
+ }, []), Oe(() => {
3562
+ const d = (_) => {
3563
+ Dn(ye), V.remove(ye);
3564
+ const Y = t.scenes.get(_.value.name);
3567
3565
  if (Y !== void 0) {
3568
3566
  const U = new Y();
3569
- t.onSceneSet !== void 0 && t.onSceneSet(U), be = U, t.three.scene = be, V.add(be), ln = !0;
3567
+ t.onSceneSet !== void 0 && t.onSceneSet(U), ye = U, t.three.scene = ye, V.add(ye), ln = !0;
3570
3568
  }
3571
- }, m = (P) => {
3572
- const Y = P.value, U = t.three.scene?.getObjectByProperty("uuid", Y.uuid);
3569
+ }, m = (_) => {
3570
+ const Y = _.value, U = t.three.scene?.getObjectByProperty("uuid", Y.uuid);
3573
3571
  U !== void 0 && ne.set(Y.name, U), b(Date.now());
3574
- }, w = (P) => {
3575
- ne.delete(P.value.name), b(Date.now());
3572
+ }, S = (_) => {
3573
+ ne.delete(_.value.name), b(Date.now());
3576
3574
  };
3577
- return _.addEventListener(j.SET_SCENE, f), _.addEventListener(j.ADD_CAMERA, m), _.addEventListener(j.REMOVE_CAMERA, w), () => {
3578
- _.removeEventListener(j.SET_SCENE, f), _.removeEventListener(j.ADD_CAMERA, m), _.removeEventListener(j.REMOVE_CAMERA, w);
3575
+ return k.addEventListener(j.SET_SCENE, d), k.addEventListener(j.ADD_CAMERA, m), k.addEventListener(j.REMOVE_CAMERA, S), () => {
3576
+ k.removeEventListener(j.SET_SCENE, d), k.removeEventListener(j.ADD_CAMERA, m), k.removeEventListener(j.REMOVE_CAMERA, S);
3579
3577
  };
3580
- }, []), Be(() => {
3578
+ }, []), Oe(() => {
3581
3579
  if (e === null)
3582
3580
  return;
3583
- let f = window.innerWidth, m = window.innerHeight, w = Math.floor(f / 2), P = Math.floor(m / 2), Y = -1;
3581
+ let d = window.innerWidth, m = window.innerHeight, S = Math.floor(d / 2), _ = Math.floor(m / 2), Y = -1;
3584
3582
  const U = () => {
3585
- f = window.innerWidth - 300, m = window.innerHeight, w = Math.floor(f / 2), P = Math.floor(m / 2), e.setSize(f, m);
3586
- let T = f, N = m;
3583
+ d = window.innerWidth - 300, m = window.innerHeight, S = Math.floor(d / 2), _ = Math.floor(m / 2), e.setSize(d, m);
3584
+ let T = d, N = m;
3587
3585
  switch (n) {
3588
3586
  case "Side by Side":
3589
- T = w, N = m;
3587
+ T = S, N = m;
3590
3588
  break;
3591
3589
  case "Stacked":
3592
- T = f, N = P;
3590
+ T = d, N = _;
3593
3591
  break;
3594
3592
  case "Quad":
3595
- T = w, N = P;
3593
+ T = S, N = _;
3596
3594
  break;
3597
3595
  }
3598
3596
  ne.forEach((J) => {
3599
- J instanceof Rn ? (J.left = T / -2, J.right = T / 2, J.top = N / 2, J.bottom = N / -2, J.updateProjectionMatrix()) : J instanceof zt && (J.aspect = T / N, J.updateProjectionMatrix(), ge.get(J.name)?.update());
3597
+ J instanceof Rn ? (J.left = T / -2, J.right = T / 2, J.top = N / 2, J.bottom = N / -2, J.updateProjectionMatrix()) : J instanceof zt && (J.aspect = T / N, J.updateProjectionMatrix(), be.get(J.name)?.update());
3600
3598
  });
3601
3599
  }, $ = () => {
3602
- e.setViewport(0, 0, f, m), e.setScissor(0, 0, f, m), e.render(V, G);
3600
+ e.setViewport(0, 0, d, m), e.setScissor(0, 0, d, m), e.render(V, G);
3603
3601
  }, I = () => {
3604
3602
  if (n === "Side by Side")
3605
- e.setViewport(0, 0, w, m), e.setScissor(0, 0, w, m), e.render(V, G), e.setViewport(w, 0, w, m), e.setScissor(w, 0, w, m), e.render(V, re);
3603
+ e.setViewport(0, 0, S, m), e.setScissor(0, 0, S, m), e.render(V, G), e.setViewport(S, 0, S, m), e.setScissor(S, 0, S, m), e.render(V, oe);
3606
3604
  else {
3607
- const T = m - P;
3608
- e.setViewport(0, T, f, P), e.setScissor(0, T, f, P), e.render(V, G), e.setViewport(0, 0, f, P), e.setScissor(0, 0, f, P), e.render(V, re);
3605
+ const T = m - _;
3606
+ e.setViewport(0, T, d, _), e.setScissor(0, T, d, _), e.render(V, G), e.setViewport(0, 0, d, _), e.setScissor(0, 0, d, _), e.render(V, oe);
3609
3607
  }
3610
3608
  }, W = () => {
3611
3609
  let T = 0, N = 0;
3612
- N = m - P, T = 0, e.setViewport(T, N, w, P), e.setScissor(T, N, w, P), e.render(V, G), T = w, e.setViewport(T, N, w, P), e.setScissor(T, N, w, P), e.render(V, re), N = 0, T = 0, e.setViewport(T, N, w, P), e.setScissor(T, N, w, P), e.render(V, Ne), T = w, e.setViewport(T, N, w, P), e.setScissor(T, N, w, P), e.render(V, Fe);
3610
+ N = m - _, T = 0, e.setViewport(T, N, S, _), e.setScissor(T, N, S, _), e.render(V, G), T = S, e.setViewport(T, N, S, _), e.setScissor(T, N, S, _), e.render(V, oe), N = 0, T = 0, e.setViewport(T, N, S, _), e.setScissor(T, N, S, _), e.render(V, Ne), T = S, e.setViewport(T, N, S, _), e.setScissor(T, N, S, _), e.render(V, Fe);
3613
3611
  }, q = () => {
3614
- switch (ie.forEach((T) => {
3612
+ switch (re.forEach((T) => {
3615
3613
  T.update();
3616
- }), t.onSceneUpdate !== void 0 && ln && t.onSceneUpdate(be), e.clear(), n) {
3614
+ }), t.onSceneUpdate !== void 0 && ln && t.onSceneUpdate(ye), e.clear(), n) {
3617
3615
  case "Single":
3618
3616
  $();
3619
3617
  break;
@@ -3630,34 +3628,34 @@ function qi(t) {
3630
3628
  return le(), window.addEventListener("resize", U), U(), q(), () => {
3631
3629
  window.removeEventListener("resize", U), cancelAnimationFrame(Y), Y = -1;
3632
3630
  };
3633
- }, [n, e]), Be(() => {
3631
+ }, [n, e]), Oe(() => {
3634
3632
  if (e !== null) {
3635
- const f = new Ca(), m = new ue(), w = ($, I, W, q) => {
3633
+ const d = new Ea(), m = new ue(), S = ($, I, W, q) => {
3636
3634
  switch (n) {
3637
3635
  case "Quad":
3638
- $ < W ? I < q ? f.setFromCamera(m, G) : f.setFromCamera(m, Ne) : I < q ? f.setFromCamera(m, re) : f.setFromCamera(m, Fe);
3636
+ $ < W ? I < q ? d.setFromCamera(m, G) : d.setFromCamera(m, Ne) : I < q ? d.setFromCamera(m, oe) : d.setFromCamera(m, Fe);
3639
3637
  break;
3640
3638
  case "Side by Side":
3641
- $ < W ? f.setFromCamera(m, G) : f.setFromCamera(m, re);
3639
+ $ < W ? d.setFromCamera(m, G) : d.setFromCamera(m, oe);
3642
3640
  break;
3643
3641
  case "Single":
3644
- f.setFromCamera(m, G);
3642
+ d.setFromCamera(m, G);
3645
3643
  break;
3646
3644
  case "Stacked":
3647
- I < q ? f.setFromCamera(m, G) : f.setFromCamera(m, re);
3645
+ I < q ? d.setFromCamera(m, G) : d.setFromCamera(m, oe);
3648
3646
  break;
3649
3647
  }
3650
- }, P = ($) => {
3648
+ }, _ = ($) => {
3651
3649
  if (!Ot)
3652
3650
  return;
3653
3651
  const I = new ue();
3654
3652
  e.getSize(I);
3655
3653
  const W = Math.min($.clientX, I.x), q = Math.min($.clientY, I.y);
3656
- m.x = Ke(W, 0, I.x, -1, 1), m.y = Ke(q, 0, I.y, 1, -1);
3654
+ m.x = qe(W, 0, I.x, -1, 1), m.y = qe(q, 0, I.y, 1, -1);
3657
3655
  const T = I.x / 2, N = I.y / 2, J = () => {
3658
- W < T ? m.x = Ke(W, 0, T, -1, 1) : m.x = Ke(W, T, I.x, -1, 1);
3656
+ W < T ? m.x = qe(W, 0, T, -1, 1) : m.x = qe(W, T, I.x, -1, 1);
3659
3657
  }, me = () => {
3660
- q < N ? m.y = Ke(q, 0, N, 1, -1) : m.y = Ke(q, N, I.y, 1, -1);
3658
+ q < N ? m.y = qe(q, 0, N, 1, -1) : m.y = qe(q, N, I.y, 1, -1);
3661
3659
  };
3662
3660
  switch (n) {
3663
3661
  case "Quad":
@@ -3670,67 +3668,67 @@ function qi(t) {
3670
3668
  me(), me();
3671
3669
  break;
3672
3670
  }
3673
- w(W, q, T, N);
3674
- const Ce = f.intersectObjects(be.children);
3675
- Ce.length > 0 && ut.position.copy(Ce[0].point);
3671
+ S(W, q, T, N);
3672
+ const xe = d.intersectObjects(ye.children);
3673
+ xe.length > 0 && ut.position.copy(xe[0].point);
3676
3674
  }, Y = ($) => {
3677
3675
  if (!Ot)
3678
3676
  return;
3679
3677
  const I = new ue();
3680
3678
  if (e.getSize(I), $.clientX >= I.x)
3681
3679
  return;
3682
- P($);
3683
- const W = f.intersectObjects(be.children);
3680
+ _($);
3681
+ const W = d.intersectObjects(ye.children);
3684
3682
  W.length > 0 && t.three.getObject(W[0].object.uuid);
3685
3683
  }, U = x.current;
3686
- return U.addEventListener("mousemove", P, !1), U.addEventListener("click", Y, !1), () => {
3687
- U.removeEventListener("mousemove", P), U.removeEventListener("click", Y);
3684
+ return U.addEventListener("mousemove", _, !1), U.addEventListener("click", Y, !1), () => {
3685
+ U.removeEventListener("mousemove", _), U.removeEventListener("click", Y);
3688
3686
  };
3689
3687
  }
3690
3688
  }, [n, e]);
3691
3689
  const se = [];
3692
- return ne.forEach((f, m) => {
3690
+ return ne.forEach((d, m) => {
3693
3691
  se.push(m);
3694
3692
  }), /* @__PURE__ */ l.jsxs("div", { className: "multiview", children: [
3695
3693
  /* @__PURE__ */ l.jsx("canvas", { ref: E }),
3696
3694
  /* @__PURE__ */ l.jsxs("div", { className: `cameras ${n === "Single" || n === "Stacked" ? "single" : ""}`, ref: x, children: [
3697
- n === "Single" && /* @__PURE__ */ l.jsx(l.Fragment, { children: /* @__PURE__ */ l.jsx(Le, { camera: G, options: se, ref: M, onSelect: (f) => {
3698
- ie.get(G.name)?.dispose();
3699
- const m = ne.get(f);
3700
- m !== void 0 && (z(G), G = m, S(m, M.current));
3695
+ n === "Single" && /* @__PURE__ */ l.jsx(l.Fragment, { children: /* @__PURE__ */ l.jsx(Le, { camera: G, options: se, ref: M, onSelect: (d) => {
3696
+ re.get(G.name)?.dispose();
3697
+ const m = ne.get(d);
3698
+ m !== void 0 && (z(G), G = m, w(m, M.current));
3701
3699
  } }) }),
3702
3700
  (n === "Side by Side" || n === "Stacked") && /* @__PURE__ */ l.jsxs(l.Fragment, { children: [
3703
- /* @__PURE__ */ l.jsx(Le, { camera: G, options: se, ref: M, onSelect: (f) => {
3704
- ie.get(G.name)?.dispose();
3705
- const m = ne.get(f);
3706
- m !== void 0 && (z(G), G = m, S(m, M.current));
3701
+ /* @__PURE__ */ l.jsx(Le, { camera: G, options: se, ref: M, onSelect: (d) => {
3702
+ re.get(G.name)?.dispose();
3703
+ const m = ne.get(d);
3704
+ m !== void 0 && (z(G), G = m, w(m, M.current));
3707
3705
  } }),
3708
- /* @__PURE__ */ l.jsx(Le, { camera: re, options: se, ref: k, onSelect: (f) => {
3709
- ie.get(re.name)?.dispose();
3710
- const m = ne.get(f);
3711
- m !== void 0 && (z(re), re = m, S(m, k.current));
3706
+ /* @__PURE__ */ l.jsx(Le, { camera: oe, options: se, ref: P, onSelect: (d) => {
3707
+ re.get(oe.name)?.dispose();
3708
+ const m = ne.get(d);
3709
+ m !== void 0 && (z(oe), oe = m, w(m, P.current));
3712
3710
  } })
3713
3711
  ] }),
3714
3712
  n === "Quad" && /* @__PURE__ */ l.jsxs(l.Fragment, { children: [
3715
- /* @__PURE__ */ l.jsx(Le, { camera: G, options: se, ref: M, onSelect: (f) => {
3716
- ie.get(G.name)?.dispose();
3717
- const m = ne.get(f);
3718
- m !== void 0 && (z(G), G = m, S(m, M.current));
3713
+ /* @__PURE__ */ l.jsx(Le, { camera: G, options: se, ref: M, onSelect: (d) => {
3714
+ re.get(G.name)?.dispose();
3715
+ const m = ne.get(d);
3716
+ m !== void 0 && (z(G), G = m, w(m, M.current));
3719
3717
  } }),
3720
- /* @__PURE__ */ l.jsx(Le, { camera: re, options: se, ref: k, onSelect: (f) => {
3721
- ie.get(re.name)?.dispose();
3722
- const m = ne.get(f);
3723
- m !== void 0 && (z(re), re = m, S(m, k.current));
3718
+ /* @__PURE__ */ l.jsx(Le, { camera: oe, options: se, ref: P, onSelect: (d) => {
3719
+ re.get(oe.name)?.dispose();
3720
+ const m = ne.get(d);
3721
+ m !== void 0 && (z(oe), oe = m, w(m, P.current));
3724
3722
  } }),
3725
- /* @__PURE__ */ l.jsx(Le, { camera: Ne, options: se, ref: H, onSelect: (f) => {
3726
- ie.get(Ne.name)?.dispose();
3727
- const m = ne.get(f);
3728
- m !== void 0 && (z(Ne), Ne = m, S(m, H.current));
3723
+ /* @__PURE__ */ l.jsx(Le, { camera: Ne, options: se, ref: H, onSelect: (d) => {
3724
+ re.get(Ne.name)?.dispose();
3725
+ const m = ne.get(d);
3726
+ m !== void 0 && (z(Ne), Ne = m, w(m, H.current));
3729
3727
  } }),
3730
- /* @__PURE__ */ l.jsx(Le, { camera: Fe, options: se, ref: B, onSelect: (f) => {
3731
- ie.get(Fe.name)?.dispose();
3732
- const m = ne.get(f);
3733
- m !== void 0 && (z(Fe), Fe = m, S(m, B.current));
3728
+ /* @__PURE__ */ l.jsx(Le, { camera: Fe, options: se, ref: B, onSelect: (d) => {
3729
+ re.get(Fe.name)?.dispose();
3730
+ const m = ne.get(d);
3731
+ m !== void 0 && (z(Fe), Fe = m, w(m, B.current));
3734
3732
  } })
3735
3733
  ] })
3736
3734
  ] }),
@@ -3740,44 +3738,44 @@ function qi(t) {
3740
3738
  {
3741
3739
  index: sn.indexOf(n),
3742
3740
  options: sn,
3743
- onSelect: (f) => {
3744
- f !== n && (Ee(), a(f));
3741
+ onSelect: (d) => {
3742
+ d !== n && (Ce(), a(d));
3745
3743
  },
3746
3744
  open: s,
3747
- onToggle: (f) => {
3748
- p(f), c && u(!1), d && v(!1);
3745
+ onToggle: (d) => {
3746
+ p(d), c && u(!1), f && v(!1);
3749
3747
  }
3750
3748
  }
3751
3749
  ),
3752
3750
  /* @__PURE__ */ l.jsx(
3753
3751
  Mt,
3754
3752
  {
3755
- index: cn.indexOf(wt),
3753
+ index: cn.indexOf(St),
3756
3754
  options: cn,
3757
- onSelect: (f) => {
3758
- if (f !== wt)
3759
- switch (wt = f, wt) {
3755
+ onSelect: (d) => {
3756
+ if (d !== St)
3757
+ switch (St = d, St) {
3760
3758
  case "Depth":
3761
- V.overrideMaterial = Ai;
3759
+ V.overrideMaterial = yi;
3762
3760
  break;
3763
3761
  case "Normals":
3764
- V.overrideMaterial = ki;
3762
+ V.overrideMaterial = Ei;
3765
3763
  break;
3766
3764
  default:
3767
3765
  case "Renderer":
3768
3766
  V.overrideMaterial = null;
3769
3767
  break;
3770
3768
  case "Wireframe":
3771
- V.overrideMaterial = ji;
3769
+ V.overrideMaterial = xi;
3772
3770
  break;
3773
3771
  case "UVs":
3774
- V.overrideMaterial = _i;
3772
+ V.overrideMaterial = Ci;
3775
3773
  break;
3776
3774
  }
3777
3775
  },
3778
3776
  open: c,
3779
- onToggle: (f) => {
3780
- s && p(!1), u(f), d && v(!1);
3777
+ onToggle: (d) => {
3778
+ s && p(!1), u(d), f && v(!1);
3781
3779
  }
3782
3780
  }
3783
3781
  ),
@@ -3789,19 +3787,19 @@ function qi(t) {
3789
3787
  "Orbit Mode",
3790
3788
  "Selection Mode"
3791
3789
  ],
3792
- onSelect: (f) => {
3793
- Ot = f === "Selection Mode", ut.visible = Ot;
3790
+ onSelect: (d) => {
3791
+ Ot = d === "Selection Mode", ut.visible = Ot;
3794
3792
  },
3795
- open: d,
3796
- onToggle: (f) => {
3797
- s && p(!1), c && u(!1), v(f);
3793
+ open: f,
3794
+ onToggle: (d) => {
3795
+ s && p(!1), c && u(!1), v(d);
3798
3796
  }
3799
3797
  }
3800
3798
  )
3801
3799
  ] })
3802
3800
  ] });
3803
3801
  }
3804
- function Ki(t) {
3802
+ function $i(t) {
3805
3803
  return /* @__PURE__ */ l.jsxs("div", { className: "editor", ref: t.ref, style: t.style, children: [
3806
3804
  /* @__PURE__ */ l.jsx("header", { children: t.header }),
3807
3805
  t.children,
@@ -3810,40 +3808,40 @@ function Ki(t) {
3810
3808
  }
3811
3809
  export {
3812
3810
  Ht as Accordion,
3813
- Gi as Application,
3811
+ ji as Application,
3814
3812
  Rt as BaseRemote,
3815
- Bn as ChildObject,
3816
- ci as ContainerObject,
3817
- Ja as Draggable,
3818
- Za as DraggableItem,
3819
- Qa as Dropdown,
3820
- ei as DropdownItem,
3821
- Ki as Editor,
3822
- ii as InfiniteGridHelper,
3823
- Ti as Inspector,
3824
- qi as MultiView,
3825
- Fn as NavButton,
3826
- Da as RemoteComponents,
3827
- Vi as RemoteController,
3828
- Oe as RemoteTheatre,
3829
- Ya as RemoteThree,
3830
- Nn as RemoteTweakpane,
3831
- Wi as SceneInspector,
3832
- Hi as SidePanel,
3813
+ Fn as ChildObject,
3814
+ Za as ContainerObject,
3815
+ $a as Draggable,
3816
+ Ua as DraggableItem,
3817
+ za as Dropdown,
3818
+ Ya as DropdownItem,
3819
+ $i as Editor,
3820
+ Wa as InfiniteGridHelper,
3821
+ vi as Inspector,
3822
+ Ui as MultiView,
3823
+ Nn as NavButton,
3824
+ Di as RemoteComponents,
3825
+ Ni as RemoteController,
3826
+ st as RemoteTheatre,
3827
+ Ii as RemoteThree,
3828
+ Li as RemoteTweakpane,
3829
+ Bi as SceneInspector,
3830
+ Fi as SidePanel,
3833
3831
  j as ToolEvents,
3834
- si as UVMaterial,
3832
+ Xa as UVMaterial,
3835
3833
  lt as capitalize,
3836
- $i as clamp,
3837
- ka as colorToHex,
3838
- _ as debugDispatcher,
3834
+ Ai as clamp,
3835
+ _a as colorToHex,
3836
+ k as debugDispatcher,
3839
3837
  Dn as dispose,
3840
- ja as disposeMaterial,
3841
- Yi as disposeTexture,
3842
- zi as distance,
3838
+ Pa as disposeMaterial,
3839
+ ki as disposeTexture,
3840
+ Pi as distance,
3843
3841
  jn as hierarchyUUID,
3844
- Aa as isColor,
3845
- Pa as randomID,
3846
- _a as resetThreeObjects,
3842
+ Ra as isColor,
3843
+ Ta as randomID,
3844
+ Aa as resetThreeObjects,
3847
3845
  Ft as round,
3848
3846
  Yt as totalThreeObjects
3849
3847
  };