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