@tomorrowevening/hermes 0.0.2 → 0.0.3

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