@tomorrowevening/hermes 0.0.36 → 0.0.37
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.cjs.js +16 -16
- package/dist/hermes.esm.js +1446 -1498
- package/dist/hermes.umd.js +16 -16
- package/dist/style.css +1 -1
- package/package.json +2 -1
- package/src/core/Application.ts +111 -0
- package/src/core/RemoteController.ts +60 -0
- package/src/core/remote/BaseRemote.ts +16 -0
- package/src/core/remote/RemoteComponents.ts +45 -0
- package/src/core/remote/RemoteTheatre.ts +300 -0
- package/src/core/remote/RemoteThree.ts +143 -0
- package/src/core/remote/RemoteTweakpane.ts +194 -0
- package/src/core/types.ts +56 -0
- package/src/editor/Editor.tsx +20 -0
- package/src/editor/components/Draggable.tsx +40 -0
- package/src/editor/components/DraggableItem.tsx +22 -0
- package/src/editor/components/Dropdown.tsx +38 -0
- package/src/editor/components/DropdownItem.tsx +64 -0
- package/src/editor/components/NavButton.tsx +11 -0
- package/src/editor/components/content.ts +2 -0
- package/src/editor/components/icons/CloseIcon.tsx +7 -0
- package/src/editor/components/icons/DragIcon.tsx +9 -0
- package/src/editor/components/types.ts +41 -0
- package/src/editor/global.ts +20 -0
- package/src/editor/multiView/CameraWindow.tsx +74 -0
- package/src/editor/multiView/InfiniteGridHelper.ts +24 -0
- package/src/editor/multiView/InfiniteGridMaterial.ts +127 -0
- package/src/editor/multiView/MultiView.scss +101 -0
- package/src/editor/multiView/MultiView.tsx +636 -0
- package/src/editor/multiView/MultiViewData.ts +59 -0
- package/src/editor/multiView/UVMaterial.ts +55 -0
- package/src/editor/scss/_debug.scss +58 -0
- package/src/editor/scss/_draggable.scss +43 -0
- package/src/editor/scss/_dropdown.scss +84 -0
- package/src/editor/scss/_sidePanel.scss +278 -0
- package/src/editor/scss/_theme.scss +9 -0
- package/src/editor/scss/index.scss +67 -0
- package/src/editor/sidePanel/Accordion.tsx +41 -0
- package/src/editor/sidePanel/ChildObject.tsx +57 -0
- package/src/editor/sidePanel/ContainerObject.tsx +11 -0
- package/src/editor/sidePanel/SidePanel.tsx +64 -0
- package/src/editor/sidePanel/ToggleBtn.tsx +27 -0
- package/src/editor/sidePanel/inspector/Inspector.tsx +119 -0
- package/src/editor/sidePanel/inspector/InspectorField.tsx +198 -0
- package/src/editor/sidePanel/inspector/InspectorGroup.tsx +50 -0
- package/src/editor/sidePanel/inspector/SceneInspector.tsx +84 -0
- package/src/editor/sidePanel/inspector/inspector.scss +161 -0
- package/src/editor/sidePanel/inspector/utils/InspectAnimation.tsx +102 -0
- package/src/editor/sidePanel/inspector/utils/InspectCamera.tsx +75 -0
- package/src/editor/sidePanel/inspector/utils/InspectLight.tsx +62 -0
- package/src/editor/sidePanel/inspector/utils/InspectMaterial.tsx +710 -0
- package/src/editor/sidePanel/inspector/utils/InspectTransform.tsx +113 -0
- package/src/editor/sidePanel/types.ts +130 -0
- package/src/editor/sidePanel/utils.ts +278 -0
- package/src/editor/utils.ts +117 -0
- package/src/example/CustomEditor.tsx +78 -0
- package/src/example/components/App.css +6 -0
- package/src/example/components/App.tsx +246 -0
- package/src/example/constants.ts +52 -0
- package/src/example/index.scss +45 -0
- package/src/example/main.tsx +37 -0
- package/src/example/three/BaseScene.ts +42 -0
- package/src/example/three/CustomMaterial.ts +72 -0
- package/src/example/three/FBXAnimation.ts +26 -0
- package/src/example/three/Scene1.ts +225 -0
- package/src/example/three/Scene2.ts +138 -0
- package/src/example/three/loader.ts +110 -0
- package/src/index.ts +27 -0
- package/src/vite-env.d.ts +1 -0
package/dist/hermes.esm.js
CHANGED
@@ -1,88 +1,75 @@
|
|
1
|
-
|
2
|
-
|
3
|
-
|
4
|
-
import {
|
5
|
-
import
|
6
|
-
import
|
7
|
-
import {
|
8
|
-
|
9
|
-
import jn, { useState as le, useRef as Ce, useEffect as Be, Component as ka, forwardRef as _a } from "react";
|
10
|
-
import { Reorder as Dn } from "framer-motion";
|
11
|
-
function dt(t) {
|
1
|
+
import { PositionalAudio as Hn, EventDispatcher as un, Texture as dn, CubeTexture as Wn, RepeatWrapping as Kt, ShaderMaterial as fn, GLSL3 as qn, DoubleSide as hn, Color as Tt, Mesh as Kn, PlaneGeometry as Xn, FrontSide as Zn, BackSide as Jn, NoBlending as Qn, NormalBlending as ea, AdditiveBlending as ta, SubtractiveBlending as na, MultiplyBlending as aa, CustomBlending as ia, AddEquation as ra, SubtractEquation as oa, ReverseSubtractEquation as sa, MinEquation as ca, MaxEquation as la, ZeroFactor as pn, OneFactor as mn, SrcColorFactor as vn, OneMinusSrcColorFactor as gn, SrcAlphaFactor as bn, OneMinusSrcAlphaFactor as yn, DstAlphaFactor as En, OneMinusDstAlphaFactor as Cn, DstColorFactor as xn, OneMinusDstColorFactor as Sn, SrcAlphaSaturateFactor as ua, ConstantColorFactor as wn, OneMinusConstantColorFactor as On, ConstantAlphaFactor as Mn, OneMinusConstantAlphaFactor as Tn, Matrix4 as da, Vector3 as X, Euler as fa, Ray as ha, Plane as pa, MathUtils as ma, MOUSE as He, TOUCH as We, Quaternion as Xt, Spherical as Zt, Vector2 as ue, PerspectiveCamera as zt, MeshDepthMaterial as va, MeshNormalMaterial as ga, MeshBasicMaterial as ba, OrthographicCamera as Rn, Scene as Pn, Group as ya, AxesHelper as An, WebGLRenderer as Ea, Raycaster as Ca, CameraHelper as xa } from "three";
|
2
|
+
import { getProject as Sa, createRafDriver as wa } from "@theatre/core";
|
3
|
+
import ct from "@theatre/studio";
|
4
|
+
import { Pane as Oa } from "tweakpane";
|
5
|
+
import * as Ma from "@tweakpane/plugin-essentials";
|
6
|
+
import kn, { useState as oe, useRef as ye, useEffect as Be, Component as Ta, forwardRef as Ra } from "react";
|
7
|
+
import { Reorder as _n } from "framer-motion";
|
8
|
+
function lt(t) {
|
12
9
|
return t.substring(0, 1).toUpperCase() + t.substring(1);
|
13
10
|
}
|
14
|
-
function
|
11
|
+
function $i(t, n, a) {
|
15
12
|
return Math.min(n, Math.max(t, a));
|
16
13
|
}
|
17
|
-
function
|
14
|
+
function zi(t, n) {
|
18
15
|
const a = t - n;
|
19
16
|
return Math.sqrt(a * a);
|
20
17
|
}
|
21
|
-
function
|
18
|
+
function Pa() {
|
22
19
|
return Math.round(Math.random() * 1e6).toString();
|
23
20
|
}
|
24
|
-
function
|
21
|
+
function Aa(t) {
|
25
22
|
return t.r !== void 0 && t.g !== void 0 && t.b !== void 0;
|
26
23
|
}
|
27
|
-
function
|
28
|
-
const n = Math.round(t.r * 255), a = Math.round(t.g * 255), e = Math.round(t.b * 255),
|
29
|
-
const d =
|
24
|
+
function ka(t) {
|
25
|
+
const n = Math.round(t.r * 255), a = Math.round(t.g * 255), e = Math.round(t.b * 255), o = (u) => {
|
26
|
+
const d = u.toString(16);
|
30
27
|
return d.length === 1 ? "0" + d : d;
|
31
|
-
}, s =
|
32
|
-
return "#" + s +
|
28
|
+
}, s = o(n), p = o(a), c = o(e);
|
29
|
+
return "#" + s + p + c;
|
33
30
|
}
|
34
|
-
function
|
31
|
+
function Ft(t, n = 1) {
|
35
32
|
return Number(t.toFixed(n));
|
36
33
|
}
|
37
|
-
let
|
38
|
-
const
|
39
|
-
|
40
|
-
},
|
34
|
+
let Yt = 0;
|
35
|
+
const _a = () => {
|
36
|
+
Yt = 0;
|
37
|
+
}, jn = (t) => {
|
41
38
|
if (!t)
|
42
39
|
return;
|
43
40
|
let n = t.name.replace(" ", "");
|
44
|
-
n.length === 0 && (n = `obj_${
|
45
|
-
|
41
|
+
n.length === 0 && (n = `obj_${Yt}`, Yt++), t.parent !== null && (n = `${t.parent.uuid}.${n}`), t.uuid = n, t.children.forEach((a) => {
|
42
|
+
jn(a);
|
46
43
|
});
|
47
|
-
},
|
48
|
-
t
|
49
|
-
},
|
44
|
+
}, Yi = (t) => {
|
45
|
+
t?.dispose();
|
46
|
+
}, ja = (t) => {
|
50
47
|
t && (Array.isArray(t) ? t.forEach((n) => n.dispose()) : t.dispose());
|
51
|
-
},
|
52
|
-
var n;
|
48
|
+
}, Dn = (t) => {
|
53
49
|
if (t) {
|
54
50
|
for (; t.children.length > 0; ) {
|
55
|
-
const
|
56
|
-
|
51
|
+
const n = t.children[0];
|
52
|
+
n instanceof Hn ? (n.pause(), n.parent && n.parent.remove(n)) : Dn(n);
|
57
53
|
}
|
58
54
|
if (t.parent && t.parent.remove(t), t.isMesh) {
|
59
|
-
const
|
60
|
-
|
55
|
+
const n = t;
|
56
|
+
n.geometry?.dispose(), ja(n.material);
|
61
57
|
}
|
62
58
|
t.dispose !== void 0 && t.dispose();
|
63
59
|
}
|
64
60
|
};
|
65
|
-
class
|
66
|
-
|
67
|
-
|
68
|
-
|
69
|
-
|
70
|
-
|
71
|
-
|
72
|
-
|
73
|
-
|
74
|
-
|
75
|
-
|
76
|
-
|
77
|
-
this.listen !== void 0 && (this.useBC ? this.listen(n.data) : this.listen(JSON.parse(n.data)));
|
78
|
-
});
|
79
|
-
F(this, "openHandler", () => {
|
80
|
-
this._connected = !0;
|
81
|
-
});
|
82
|
-
F(this, "closeHandler", () => {
|
83
|
-
this._connected = !1;
|
84
|
-
});
|
85
|
-
this.editor = a && document.location.hash.search(r) > -1, this._debugEnabled = a, a && (this.useBC = e, e ? (this.broadcastChannel = new BroadcastChannel(n), this.broadcastChannel.addEventListener("message", this.messageHandler)) : (this.webSocket = new WebSocket(n), this.webSocket.addEventListener("open", this.openHandler), this.webSocket.addEventListener("close", this.closeHandler), this.webSocket.addEventListener("message", this.messageHandler)));
|
61
|
+
class Gi {
|
62
|
+
components = /* @__PURE__ */ new Map();
|
63
|
+
listen;
|
64
|
+
// Protected
|
65
|
+
_debugEnabled;
|
66
|
+
broadcastChannel = void 0;
|
67
|
+
webSocket = void 0;
|
68
|
+
_mode = "app";
|
69
|
+
_connected = !1;
|
70
|
+
useBC = !1;
|
71
|
+
constructor(n, a, e = !0, o = "editor") {
|
72
|
+
this.editor = a && document.location.hash.search(o) > -1, this._debugEnabled = a, a && (this.useBC = e, e ? (this.broadcastChannel = new BroadcastChannel(n), this.broadcastChannel.addEventListener("message", this.messageHandler)) : (this.webSocket = new WebSocket(n), this.webSocket.addEventListener("open", this.openHandler), this.webSocket.addEventListener("close", this.closeHandler), this.webSocket.addEventListener("message", this.messageHandler)));
|
86
73
|
}
|
87
74
|
addComponent(n, a) {
|
88
75
|
this.components.set(n, a);
|
@@ -94,9 +81,17 @@ class Ki {
|
|
94
81
|
}
|
95
82
|
// Remote
|
96
83
|
send(n) {
|
97
|
-
|
98
|
-
this._mode !== n.target && (this.useBC ? (a = this.broadcastChannel) == null || a.postMessage(n) : this._connected && ((e = this.webSocket) == null || e.send(JSON.stringify(n))));
|
84
|
+
this._mode !== n.target && (this.useBC ? this.broadcastChannel?.postMessage(n) : this._connected && this.webSocket?.send(JSON.stringify(n)));
|
99
85
|
}
|
86
|
+
messageHandler = (n) => {
|
87
|
+
this.listen !== void 0 && (this.useBC ? this.listen(n.data) : this.listen(JSON.parse(n.data)));
|
88
|
+
};
|
89
|
+
openHandler = () => {
|
90
|
+
this._connected = !0;
|
91
|
+
};
|
92
|
+
closeHandler = () => {
|
93
|
+
this._connected = !1;
|
94
|
+
};
|
100
95
|
// Getters / Setters
|
101
96
|
get connected() {
|
102
97
|
return this._connected;
|
@@ -117,7 +112,7 @@ class Ki {
|
|
117
112
|
n && (this._mode = "editor", document.title += " - Editor");
|
118
113
|
}
|
119
114
|
}
|
120
|
-
const _ = new
|
115
|
+
const _ = new un(), j = {
|
121
116
|
CUSTOM: "ToolEvents::custom",
|
122
117
|
// Components
|
123
118
|
SELECT_DROPDOWN: "ToolEvents::selectDropdown",
|
@@ -133,15 +128,15 @@ const _ = new fn(), j = {
|
|
133
128
|
ADD_CAMERA: "ToolEvents::addCamera",
|
134
129
|
REMOVE_CAMERA: "ToolEvents::removeCamera"
|
135
130
|
};
|
136
|
-
class
|
131
|
+
class Rt {
|
132
|
+
app;
|
137
133
|
constructor(n) {
|
138
|
-
F(this, "app");
|
139
134
|
this.app = n;
|
140
135
|
}
|
141
136
|
dispose() {
|
142
137
|
}
|
143
138
|
}
|
144
|
-
class
|
139
|
+
class Da extends Rt {
|
145
140
|
selectDropdown(n, a) {
|
146
141
|
this.app.send({
|
147
142
|
event: "selectComponent",
|
@@ -163,7 +158,7 @@ class Fa extends At {
|
|
163
158
|
});
|
164
159
|
}
|
165
160
|
}
|
166
|
-
function
|
161
|
+
function Ia(t, n) {
|
167
162
|
switch (n.event) {
|
168
163
|
case "selectComponent":
|
169
164
|
_.dispatchEvent({ type: j.SELECT_DROPDOWN, value: n.data });
|
@@ -173,162 +168,157 @@ function Ba(t, n) {
|
|
173
168
|
break;
|
174
169
|
}
|
175
170
|
}
|
176
|
-
const
|
177
|
-
}
|
178
|
-
|
179
|
-
|
180
|
-
|
181
|
-
|
182
|
-
|
183
|
-
|
184
|
-
|
185
|
-
|
186
|
-
|
187
|
-
return this.project = Ta(a, e), this.project.ready;
|
171
|
+
const In = () => {
|
172
|
+
};
|
173
|
+
class Oe extends Rt {
|
174
|
+
project;
|
175
|
+
sheets = /* @__PURE__ */ new Map();
|
176
|
+
sheetObjects = /* @__PURE__ */ new Map();
|
177
|
+
sheetObjectCBs = /* @__PURE__ */ new Map();
|
178
|
+
sheetObjectUnsubscribe = /* @__PURE__ */ new Map();
|
179
|
+
static rafDriver = null;
|
180
|
+
init(n, a) {
|
181
|
+
return this.project = Sa(n, a), this.project.ready;
|
188
182
|
}
|
189
183
|
dispose() {
|
190
184
|
this.project = void 0, this.sheets = /* @__PURE__ */ new Map(), this.sheetObjects = /* @__PURE__ */ new Map(), this.sheetObjectCBs = /* @__PURE__ */ new Map(), this.sheetObjectUnsubscribe = /* @__PURE__ */ new Map();
|
191
185
|
}
|
192
|
-
sheet(
|
193
|
-
var r;
|
186
|
+
sheet(n) {
|
194
187
|
if (this.project === void 0) {
|
195
188
|
console.error("Theatre Project hasn't been created yet.");
|
196
189
|
return;
|
197
190
|
}
|
198
|
-
let
|
199
|
-
return
|
191
|
+
let a = this.sheets.get(n);
|
192
|
+
return a !== void 0 || (a = this.project?.sheet(n), this.sheets.set(n, a)), a;
|
200
193
|
}
|
201
|
-
playSheet(
|
202
|
-
|
203
|
-
(r = this.sheet(a)) == null || r.sequence.play(e), this.app.send({
|
194
|
+
playSheet(n, a) {
|
195
|
+
this.sheet(n)?.sequence.play(a), this.app.send({
|
204
196
|
event: "playSheet",
|
205
197
|
target: "editor",
|
206
198
|
data: {
|
207
|
-
sheet:
|
208
|
-
value:
|
199
|
+
sheet: n,
|
200
|
+
value: a
|
209
201
|
}
|
210
202
|
});
|
211
203
|
}
|
212
|
-
pauseSheet(
|
213
|
-
|
214
|
-
(e = this.sheet(a)) == null || e.sequence.pause(), this.app.send({
|
204
|
+
pauseSheet(n) {
|
205
|
+
this.sheet(n)?.sequence.pause(), this.app.send({
|
215
206
|
event: "pauseSheet",
|
216
207
|
target: "editor",
|
217
208
|
data: {
|
218
|
-
sheet:
|
209
|
+
sheet: n
|
219
210
|
}
|
220
211
|
});
|
221
212
|
}
|
222
|
-
clearSheetObjects(
|
223
|
-
this.sheetObjects.forEach((
|
224
|
-
|
213
|
+
clearSheetObjects(n) {
|
214
|
+
this.sheetObjects.forEach((a, e) => {
|
215
|
+
e.search(`${n}_`) > -1 && this.unsubscribe(a);
|
225
216
|
});
|
226
217
|
}
|
227
|
-
sheetObject(a, e,
|
218
|
+
sheetObject(n, a, e, o) {
|
228
219
|
if (this.project === void 0) {
|
229
220
|
console.error("Theatre Project hasn't been created yet.");
|
230
221
|
return;
|
231
222
|
}
|
232
|
-
const
|
233
|
-
if (
|
223
|
+
const s = this.sheet(n);
|
224
|
+
if (s === void 0)
|
234
225
|
return;
|
235
|
-
const
|
236
|
-
let
|
237
|
-
|
238
|
-
const
|
226
|
+
const p = `${n}_${a}`;
|
227
|
+
let c = this.sheetObjects.get(p);
|
228
|
+
c !== void 0 ? c = s.object(a, { ...e, ...c.value }, { reconfigure: !0 }) : c = s.object(a, e), this.sheetObjects.set(p, c), this.sheetObjectCBs.set(p, o !== void 0 ? o : In);
|
229
|
+
const u = c.onValuesChange((d) => {
|
239
230
|
if (this.app.editor) {
|
240
|
-
for (const
|
241
|
-
const
|
242
|
-
typeof
|
243
|
-
r:
|
244
|
-
g:
|
245
|
-
b:
|
246
|
-
a:
|
231
|
+
for (const b in d) {
|
232
|
+
const E = d[b];
|
233
|
+
typeof E == "object" && Aa(E) && (d[b] = {
|
234
|
+
r: E.r,
|
235
|
+
g: E.g,
|
236
|
+
b: E.b,
|
237
|
+
a: E.a
|
247
238
|
});
|
248
239
|
}
|
249
240
|
this.app.send({
|
250
241
|
event: "updateSheetObject",
|
251
242
|
target: "app",
|
252
243
|
data: {
|
253
|
-
sheet:
|
254
|
-
sheetObject:
|
255
|
-
values:
|
244
|
+
sheet: n,
|
245
|
+
sheetObject: p,
|
246
|
+
values: d
|
256
247
|
}
|
257
248
|
});
|
258
249
|
}
|
259
|
-
const
|
260
|
-
|
250
|
+
const v = this.sheetObjectCBs.get(p);
|
251
|
+
v !== void 0 && v(d);
|
261
252
|
});
|
262
|
-
return this.sheetObjectUnsubscribe.set(
|
253
|
+
return this.sheetObjectUnsubscribe.set(p, u), c;
|
263
254
|
}
|
264
|
-
unsubscribe(
|
255
|
+
unsubscribe(n) {
|
265
256
|
if (this.project === void 0) {
|
266
257
|
console.error("Theatre Project hasn't been created yet.");
|
267
258
|
return;
|
268
259
|
}
|
269
|
-
const
|
270
|
-
|
271
|
-
const
|
272
|
-
|
260
|
+
const a = n.address.sheetId, e = n.address.objectKey;
|
261
|
+
this.sheets.get(a)?.detachObject(e);
|
262
|
+
const s = `${a}_${e}`, p = this.sheetObjectUnsubscribe.get(s);
|
263
|
+
p !== void 0 && (this.sheetObjects.delete(s), this.sheetObjectCBs.delete(s), this.sheetObjectUnsubscribe.delete(s), p());
|
273
264
|
}
|
274
265
|
static getRafDriver() {
|
275
|
-
return
|
266
|
+
return Oe.rafDriver || (Oe.rafDriver = wa()), Oe.rafDriver;
|
276
267
|
}
|
277
|
-
}
|
278
|
-
|
279
|
-
|
280
|
-
function Ua(t, n) {
|
268
|
+
}
|
269
|
+
let we;
|
270
|
+
function La(t, n) {
|
281
271
|
t.components.forEach((a) => {
|
282
|
-
if (a instanceof
|
272
|
+
if (a instanceof Oe) {
|
283
273
|
let e;
|
284
|
-
const
|
274
|
+
const o = a;
|
285
275
|
switch (n.event) {
|
286
276
|
case "setSheet":
|
287
|
-
e =
|
277
|
+
e = o.sheets.get(n.data.sheet), e !== void 0 && (we = e, ct.setSelection([e]));
|
288
278
|
break;
|
289
279
|
case "setSheetObject":
|
290
|
-
e =
|
280
|
+
e = o.sheetObjects.get(`${n.data.sheet}_${n.data.key}`), e !== void 0 && ct.setSelection([e]);
|
291
281
|
break;
|
292
282
|
case "updateSheetObject":
|
293
|
-
e =
|
283
|
+
e = o.sheets.get(n.data.sheet), e !== void 0 && e.sequence.pause(), e = o.sheetObjectCBs.get(n.data.sheetObject), e !== void 0 && e(n.data.values);
|
294
284
|
break;
|
295
285
|
case "updateTimeline":
|
296
|
-
e =
|
286
|
+
e = o.sheets.get(n.data.sheet), we !== void 0 && (we.sequence.position = n.data.position);
|
297
287
|
break;
|
298
288
|
}
|
299
289
|
}
|
300
290
|
});
|
301
291
|
}
|
302
|
-
function
|
292
|
+
function Na(t) {
|
303
293
|
if (t.editor) {
|
304
294
|
let n;
|
305
295
|
t.components.forEach((s) => {
|
306
|
-
s instanceof
|
307
|
-
}),
|
308
|
-
s.length < 1 || s.forEach((
|
309
|
-
let c =
|
310
|
-
switch (
|
296
|
+
s instanceof Oe && (n = s);
|
297
|
+
}), ct.ui.restore(), ct.onSelectionChange((s) => {
|
298
|
+
s.length < 1 || s.forEach((p) => {
|
299
|
+
let c = p.address.sheetId, u = "setSheet", d = {};
|
300
|
+
switch (p.type) {
|
311
301
|
case "Theatre_Sheet_PublicAPI":
|
312
|
-
|
313
|
-
sheet:
|
314
|
-
},
|
302
|
+
u = "setSheet", d = {
|
303
|
+
sheet: p.address.sheetId
|
304
|
+
}, we = n.sheets.get(p.address.sheetId);
|
315
305
|
break;
|
316
306
|
case "Theatre_SheetObject_PublicAPI":
|
317
|
-
|
307
|
+
u = "setSheetObject", c += `_${p.address.objectKey}`, d = {
|
318
308
|
id: c,
|
319
|
-
sheet:
|
320
|
-
key:
|
309
|
+
sheet: p.address.sheetId,
|
310
|
+
key: p.address.objectKey
|
321
311
|
};
|
322
312
|
break;
|
323
313
|
}
|
324
|
-
t.send({ event:
|
314
|
+
t.send({ event: u, target: "app", data: d });
|
325
315
|
});
|
326
316
|
});
|
327
317
|
let a = 0;
|
328
318
|
const e = () => {
|
329
|
-
if (
|
330
|
-
a =
|
331
|
-
const s =
|
319
|
+
if (we !== void 0 && a !== we.sequence.position) {
|
320
|
+
a = we.sequence.position;
|
321
|
+
const s = we;
|
332
322
|
t.send({
|
333
323
|
event: "updateTimeline",
|
334
324
|
target: "app",
|
@@ -338,31 +328,30 @@ function $a(t) {
|
|
338
328
|
}
|
339
329
|
});
|
340
330
|
}
|
341
|
-
},
|
342
|
-
e(), requestAnimationFrame(
|
331
|
+
}, o = () => {
|
332
|
+
e(), requestAnimationFrame(o);
|
343
333
|
};
|
344
|
-
e(),
|
334
|
+
e(), o();
|
345
335
|
} else
|
346
|
-
|
336
|
+
ct.ui.hide();
|
347
337
|
}
|
348
|
-
function
|
338
|
+
function Fa(t, n) {
|
349
339
|
t.editor && t.components.forEach((a) => {
|
350
|
-
|
351
|
-
|
352
|
-
const s = a;
|
340
|
+
if (a instanceof Oe) {
|
341
|
+
const e = a;
|
353
342
|
switch (n.event) {
|
354
343
|
case "playSheet":
|
355
|
-
|
344
|
+
e.sheet(n.data.sheet)?.sequence.play(n.data.value);
|
356
345
|
break;
|
357
346
|
case "pauseSheet":
|
358
|
-
|
347
|
+
e.sheet(n.data.sheet)?.sequence.pause();
|
359
348
|
break;
|
360
349
|
}
|
361
350
|
return;
|
362
351
|
}
|
363
352
|
});
|
364
353
|
}
|
365
|
-
function
|
354
|
+
function Ba(t) {
|
366
355
|
if (t.name === "cameras")
|
367
356
|
return "camera";
|
368
357
|
if (t.name === "interactive")
|
@@ -376,7 +365,7 @@ function Ya(t) {
|
|
376
365
|
const n = t.type;
|
377
366
|
return n.search("Helper") > -1 ? "icon_utils" : n.search("Camera") > -1 ? "camera" : n.search("Light") > -1 ? "light" : "obj3D";
|
378
367
|
}
|
379
|
-
function
|
368
|
+
function Ln(t) {
|
380
369
|
const n = {
|
381
370
|
name: t.name,
|
382
371
|
type: t.type,
|
@@ -384,10 +373,10 @@ function Fn(t) {
|
|
384
373
|
children: []
|
385
374
|
};
|
386
375
|
return t.children.forEach((a) => {
|
387
|
-
n.children.push(
|
376
|
+
n.children.push(Ln(a));
|
388
377
|
}), n;
|
389
378
|
}
|
390
|
-
function
|
379
|
+
function Ua(t) {
|
391
380
|
const n = {};
|
392
381
|
for (const a in t) {
|
393
382
|
const e = t[a].value;
|
@@ -395,7 +384,7 @@ function Ga(t) {
|
|
395
384
|
}
|
396
385
|
return n;
|
397
386
|
}
|
398
|
-
function
|
387
|
+
function $a(t) {
|
399
388
|
switch (t) {
|
400
389
|
case "blendSrcAlpha":
|
401
390
|
case "blendDstAlpha":
|
@@ -410,25 +399,25 @@ function Va(t) {
|
|
410
399
|
function qe(t) {
|
411
400
|
const n = {};
|
412
401
|
for (const a in t) {
|
413
|
-
if (a.substring(0, 1) === "_" || a.substring(0, 2) === "is" ||
|
402
|
+
if (a.substring(0, 1) === "_" || a.substring(0, 2) === "is" || $a(a))
|
414
403
|
continue;
|
415
|
-
const e = typeof t[a],
|
404
|
+
const e = typeof t[a], o = t[a];
|
416
405
|
switch (e) {
|
417
406
|
case "boolean":
|
418
407
|
case "number":
|
419
408
|
case "string":
|
420
|
-
n[a] =
|
409
|
+
n[a] = o;
|
421
410
|
break;
|
422
411
|
case "object":
|
423
|
-
if (
|
424
|
-
if (n[a] =
|
425
|
-
if (
|
426
|
-
const s =
|
412
|
+
if (o !== null)
|
413
|
+
if (n[a] = o, o.isTexture)
|
414
|
+
if (o instanceof dn) {
|
415
|
+
const s = o.source.toJSON();
|
427
416
|
n[a] = { src: s.url };
|
428
417
|
} else
|
429
|
-
|
418
|
+
o instanceof Wn && (console.log("env map"), console.log(o.source.data), console.log(o.source.toJSON()), n[a] = { src: "" });
|
430
419
|
else
|
431
|
-
a === "uniforms" && (n[a] =
|
420
|
+
a === "uniforms" && (n[a] = Ua(n[a]));
|
432
421
|
else
|
433
422
|
n[a] = { src: "" };
|
434
423
|
break;
|
@@ -436,7 +425,7 @@ function qe(t) {
|
|
436
425
|
}
|
437
426
|
return n;
|
438
427
|
}
|
439
|
-
function
|
428
|
+
function Bt(t) {
|
440
429
|
t.updateMatrix();
|
441
430
|
const n = {
|
442
431
|
name: t.name,
|
@@ -461,28 +450,28 @@ function $t(t) {
|
|
461
450
|
if (a.search("mesh") > -1) {
|
462
451
|
const e = t;
|
463
452
|
if (Array.isArray(e.material)) {
|
464
|
-
const
|
453
|
+
const o = [];
|
465
454
|
e.material.forEach((s) => {
|
466
|
-
|
467
|
-
}), n.material =
|
455
|
+
o.push(qe(s));
|
456
|
+
}), n.material = o;
|
468
457
|
} else
|
469
458
|
n.material = qe(e.material);
|
470
459
|
} else if (a.search("points") > -1) {
|
471
460
|
const e = t;
|
472
461
|
if (Array.isArray(e.material)) {
|
473
|
-
const
|
462
|
+
const o = [];
|
474
463
|
e.material.forEach((s) => {
|
475
|
-
|
476
|
-
}), n.material =
|
464
|
+
o.push(qe(s));
|
465
|
+
}), n.material = o;
|
477
466
|
} else
|
478
467
|
n.material = qe(e.material);
|
479
468
|
} else if (a.search("line") > -1) {
|
480
469
|
const e = t;
|
481
470
|
if (Array.isArray(e.material)) {
|
482
|
-
const
|
471
|
+
const o = [];
|
483
472
|
e.material.forEach((s) => {
|
484
|
-
|
485
|
-
}), n.material =
|
473
|
+
o.push(qe(s));
|
474
|
+
}), n.material = o;
|
486
475
|
} else
|
487
476
|
n.material = qe(e.material);
|
488
477
|
} else
|
@@ -514,7 +503,7 @@ function $t(t) {
|
|
514
503
|
});
|
515
504
|
return n;
|
516
505
|
}
|
517
|
-
function
|
506
|
+
function za(t, n) {
|
518
507
|
const a = n.split(".");
|
519
508
|
switch (a.length) {
|
520
509
|
case 1:
|
@@ -531,7 +520,7 @@ function Ha(t, n) {
|
|
531
520
|
return t[a[0]][a[1]][a[2]][a[3]][a[4]][a[5]];
|
532
521
|
}
|
533
522
|
}
|
534
|
-
function
|
523
|
+
function ee(t, n, a) {
|
535
524
|
const e = n.split(".");
|
536
525
|
switch (e.length) {
|
537
526
|
case 1:
|
@@ -551,102 +540,99 @@ function ne(t, n, a) {
|
|
551
540
|
break;
|
552
541
|
}
|
553
542
|
}
|
554
|
-
function
|
543
|
+
function Gt(t) {
|
555
544
|
return new Promise((n, a) => {
|
556
545
|
const e = new Image();
|
557
546
|
e.onload = () => {
|
558
|
-
const
|
559
|
-
|
547
|
+
const o = new dn(e);
|
548
|
+
o.wrapS = Kt, o.wrapT = Kt, o.needsUpdate = !0, n(o);
|
560
549
|
}, e.onerror = a, e.src = t;
|
561
550
|
});
|
562
551
|
}
|
563
|
-
class
|
564
|
-
|
565
|
-
|
566
|
-
F(this, "scene");
|
567
|
-
}
|
568
|
-
getObject(a) {
|
552
|
+
class Ya extends Rt {
|
553
|
+
scene = void 0;
|
554
|
+
getObject(n) {
|
569
555
|
this.app.debugEnabled && this.app.send({
|
570
556
|
event: "getObject",
|
571
557
|
target: "app",
|
572
|
-
data:
|
558
|
+
data: n
|
573
559
|
});
|
574
560
|
}
|
575
|
-
setObject(
|
576
|
-
const
|
561
|
+
setObject(n) {
|
562
|
+
const a = Bt(n);
|
577
563
|
this.app.send({
|
578
564
|
event: "setObject",
|
579
565
|
target: "editor",
|
580
|
-
data:
|
566
|
+
data: a
|
581
567
|
});
|
582
568
|
}
|
583
|
-
requestMethod(a, e,
|
569
|
+
requestMethod(n, a, e, o) {
|
584
570
|
this.app.send({
|
585
571
|
event: "requestMethod",
|
586
572
|
target: "app",
|
587
573
|
data: {
|
588
|
-
uuid:
|
589
|
-
key:
|
590
|
-
value:
|
591
|
-
subitem:
|
574
|
+
uuid: n,
|
575
|
+
key: a,
|
576
|
+
value: e,
|
577
|
+
subitem: o
|
592
578
|
}
|
593
579
|
});
|
594
580
|
}
|
595
|
-
updateObject(a, e
|
581
|
+
updateObject(n, a, e) {
|
596
582
|
this.app.send({
|
597
583
|
event: "updateObject",
|
598
584
|
target: "app",
|
599
585
|
data: {
|
600
|
-
uuid:
|
601
|
-
key:
|
602
|
-
value:
|
586
|
+
uuid: n,
|
587
|
+
key: a,
|
588
|
+
value: e
|
603
589
|
}
|
604
590
|
});
|
605
591
|
}
|
606
|
-
createTexture(a, e
|
592
|
+
createTexture(n, a, e) {
|
607
593
|
this.app.send({
|
608
594
|
event: "createTexture",
|
609
595
|
target: "app",
|
610
596
|
data: {
|
611
|
-
uuid:
|
612
|
-
key:
|
613
|
-
value:
|
597
|
+
uuid: n,
|
598
|
+
key: a,
|
599
|
+
value: e
|
614
600
|
}
|
615
601
|
});
|
616
602
|
}
|
617
|
-
setScene(
|
618
|
-
if (
|
603
|
+
setScene(n) {
|
604
|
+
if (n === void 0 || (this.scene = n, !this.app.debugEnabled))
|
619
605
|
return;
|
620
|
-
|
621
|
-
const
|
606
|
+
_a(), jn(this.scene);
|
607
|
+
const a = Ln(this.scene);
|
622
608
|
this.app.send({
|
623
609
|
event: "setScene",
|
624
610
|
target: "editor",
|
625
|
-
data:
|
611
|
+
data: a
|
626
612
|
});
|
627
613
|
}
|
628
|
-
addCamera(
|
614
|
+
addCamera(n) {
|
629
615
|
if (!this.app.debugEnabled)
|
630
616
|
return;
|
631
|
-
const
|
617
|
+
const a = Bt(n);
|
632
618
|
this.app.send({
|
633
619
|
event: "addCamera",
|
634
620
|
target: "editor",
|
635
|
-
data:
|
621
|
+
data: a
|
636
622
|
});
|
637
623
|
}
|
638
|
-
removeCamera(
|
624
|
+
removeCamera(n) {
|
639
625
|
if (!this.app.debugEnabled)
|
640
626
|
return;
|
641
|
-
const
|
627
|
+
const a = Bt(n);
|
642
628
|
this.app.send({
|
643
629
|
event: "removeCamera",
|
644
630
|
target: "editor",
|
645
|
-
data:
|
631
|
+
data: a
|
646
632
|
});
|
647
633
|
}
|
648
634
|
}
|
649
|
-
function
|
635
|
+
function Ga(t, n) {
|
650
636
|
switch (n.event) {
|
651
637
|
case "getObject":
|
652
638
|
_.dispatchEvent({ type: j.GET_OBJECT, value: n.data });
|
@@ -662,7 +648,7 @@ function qa(t, n) {
|
|
662
648
|
break;
|
663
649
|
}
|
664
650
|
}
|
665
|
-
function
|
651
|
+
function Va(t, n) {
|
666
652
|
switch (n.event) {
|
667
653
|
case "setObject":
|
668
654
|
_.dispatchEvent({ type: j.SET_OBJECT, value: n.data });
|
@@ -678,37 +664,35 @@ function Ka(t, n) {
|
|
678
664
|
break;
|
679
665
|
}
|
680
666
|
}
|
681
|
-
class
|
682
|
-
|
683
|
-
|
684
|
-
|
685
|
-
|
686
|
-
|
687
|
-
|
688
|
-
|
689
|
-
|
690
|
-
this.bindCBs = /* @__PURE__ */ new Map(), this.buttonCBs = /* @__PURE__ */ new Map(), a.editor && this.createGUI();
|
667
|
+
class Nn extends Rt {
|
668
|
+
bindCBs;
|
669
|
+
buttonCBs;
|
670
|
+
pane = void 0;
|
671
|
+
appCallbacks = 0;
|
672
|
+
editorCallbacks = 0;
|
673
|
+
inspectorFolder = void 0;
|
674
|
+
constructor(n) {
|
675
|
+
super(n), this.bindCBs = /* @__PURE__ */ new Map(), this.buttonCBs = /* @__PURE__ */ new Map(), n.editor && this.createGUI();
|
691
676
|
}
|
692
677
|
createGUI() {
|
693
|
-
this.pane = new
|
678
|
+
this.pane = new Oa({ title: "GUI" }), this.pane.registerPlugin(Ma);
|
694
679
|
}
|
695
680
|
dispose() {
|
696
|
-
|
697
|
-
this.bindCBs.clear(), this.buttonCBs.clear(), this.appCallbacks = 0, this.editorCallbacks = 0, this.app.editor && ((a = this.pane) == null || a.dispose(), this.pane = void 0);
|
681
|
+
this.bindCBs.clear(), this.buttonCBs.clear(), this.appCallbacks = 0, this.editorCallbacks = 0, this.app.editor && (this.pane?.dispose(), this.pane = void 0);
|
698
682
|
}
|
699
|
-
addFolder(
|
683
|
+
addFolder(n, a = void 0, e = void 0) {
|
700
684
|
if (this.app.editor)
|
701
|
-
return this.pane === void 0 && this.createGUI(), (
|
702
|
-
title:
|
703
|
-
...
|
685
|
+
return this.pane === void 0 && this.createGUI(), (e !== void 0 ? e : this.pane).addFolder({
|
686
|
+
title: n,
|
687
|
+
...a
|
704
688
|
});
|
705
689
|
this.app.send({
|
706
690
|
event: "addFolder",
|
707
691
|
target: "app",
|
708
692
|
data: {
|
709
|
-
name:
|
710
|
-
params:
|
711
|
-
parent:
|
693
|
+
name: n,
|
694
|
+
params: a,
|
695
|
+
parent: e
|
712
696
|
}
|
713
697
|
});
|
714
698
|
}
|
@@ -716,71 +700,71 @@ class Bn extends At {
|
|
716
700
|
return `debug_${Math.max(this.appCallbacks, this.editorCallbacks)}`;
|
717
701
|
}
|
718
702
|
// Binding
|
719
|
-
bind(a, e,
|
720
|
-
const
|
721
|
-
this.bindCBs.set(
|
703
|
+
bind(n, a, e, o = void 0) {
|
704
|
+
const s = this.bindID, p = e.onChange !== void 0 ? e.onChange : In;
|
705
|
+
this.bindCBs.set(s, p), this.app.editor ? (this.pane === void 0 && this.createGUI(), (o !== void 0 ? o : this.pane).addBinding(n, a, e).on("change", (u) => {
|
722
706
|
this.app.send({
|
723
707
|
event: "updateBind",
|
724
708
|
target: "app",
|
725
709
|
data: {
|
726
|
-
id:
|
727
|
-
value:
|
710
|
+
id: s,
|
711
|
+
value: u.value
|
728
712
|
}
|
729
713
|
});
|
730
714
|
}), this.editorCallbacks++) : (this.app.send({
|
731
715
|
event: "bindObject",
|
732
716
|
target: "app",
|
733
717
|
data: {
|
734
|
-
id:
|
735
|
-
name:
|
736
|
-
params:
|
737
|
-
parent:
|
718
|
+
id: s,
|
719
|
+
name: a,
|
720
|
+
params: e,
|
721
|
+
parent: o
|
738
722
|
}
|
739
723
|
}), this.appCallbacks++);
|
740
724
|
}
|
741
|
-
triggerBind(
|
742
|
-
const
|
743
|
-
|
725
|
+
triggerBind(n, a) {
|
726
|
+
const e = this.bindCBs.get(n);
|
727
|
+
e !== void 0 ? e(a) : console.warn(`No callback for: ${n}`, a);
|
744
728
|
}
|
745
729
|
// Buttons
|
746
|
-
button(a, e
|
747
|
-
const
|
748
|
-
this.buttonCBs.set(
|
730
|
+
button(n, a, e = void 0) {
|
731
|
+
const o = this.bindID;
|
732
|
+
this.buttonCBs.set(o, a), this.app.editor ? (this.pane === void 0 && this.createGUI(), (e !== void 0 ? e : this.pane).addButton({ title: n }).on("click", () => {
|
749
733
|
this.app.send({
|
750
734
|
event: "clickButton",
|
751
735
|
target: "app",
|
752
736
|
data: {
|
753
|
-
id:
|
737
|
+
id: o
|
754
738
|
}
|
755
739
|
});
|
756
740
|
}), this.editorCallbacks++) : (this.app.send({
|
757
741
|
event: "addButton",
|
758
742
|
target: "app",
|
759
743
|
data: {
|
760
|
-
id:
|
761
|
-
name:
|
762
|
-
callback:
|
763
|
-
parent:
|
744
|
+
id: o,
|
745
|
+
name: n,
|
746
|
+
callback: a,
|
747
|
+
parent: e
|
764
748
|
}
|
765
749
|
}), this.appCallbacks++);
|
766
750
|
}
|
767
|
-
triggerButton(
|
768
|
-
const
|
769
|
-
|
751
|
+
triggerButton(n) {
|
752
|
+
const a = this.buttonCBs.get(n);
|
753
|
+
a !== void 0 && a();
|
770
754
|
}
|
771
755
|
// Inspector
|
772
756
|
createInspector() {
|
773
757
|
this.inspectorFolder = this.addFolder("Inspector", this.pane);
|
774
758
|
}
|
775
759
|
clearInspector() {
|
776
|
-
const
|
777
|
-
for (let
|
778
|
-
this.inspectorFolder.remove(this.inspectorFolder.children[
|
760
|
+
const n = this.inspectorFolder.children.length - 1;
|
761
|
+
for (let a = n; a > -1; --a)
|
762
|
+
this.inspectorFolder.remove(this.inspectorFolder.children[a]);
|
779
763
|
}
|
780
764
|
}
|
781
|
-
function
|
765
|
+
function Ha(t, n) {
|
782
766
|
t.components.forEach((a) => {
|
783
|
-
if (a instanceof
|
767
|
+
if (a instanceof Nn) {
|
784
768
|
const e = a;
|
785
769
|
switch (n.event) {
|
786
770
|
case "addFolder":
|
@@ -803,7 +787,7 @@ function Xa(t, n) {
|
|
803
787
|
}
|
804
788
|
});
|
805
789
|
}
|
806
|
-
var
|
790
|
+
var Vt = { exports: {} }, it = {};
|
807
791
|
/**
|
808
792
|
* @license React
|
809
793
|
* react-jsx-runtime.production.min.js
|
@@ -813,25 +797,25 @@ var Wt = { exports: {} }, ot = {};
|
|
813
797
|
* This source code is licensed under the MIT license found in the
|
814
798
|
* LICENSE file in the root directory of this source tree.
|
815
799
|
*/
|
816
|
-
var
|
817
|
-
function
|
818
|
-
if (
|
819
|
-
return
|
820
|
-
|
821
|
-
var t =
|
822
|
-
function
|
823
|
-
var
|
824
|
-
d !== void 0 && (E = "" + d),
|
825
|
-
for (
|
826
|
-
e.call(
|
800
|
+
var Jt;
|
801
|
+
function Wa() {
|
802
|
+
if (Jt)
|
803
|
+
return it;
|
804
|
+
Jt = 1;
|
805
|
+
var t = kn, n = Symbol.for("react.element"), a = Symbol.for("react.fragment"), e = Object.prototype.hasOwnProperty, o = t.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.ReactCurrentOwner, s = { key: !0, ref: !0, __self: !0, __source: !0 };
|
806
|
+
function p(c, u, d) {
|
807
|
+
var v, b = {}, E = null, x = null;
|
808
|
+
d !== void 0 && (E = "" + d), u.key !== void 0 && (E = "" + u.key), u.ref !== void 0 && (x = u.ref);
|
809
|
+
for (v in u)
|
810
|
+
e.call(u, v) && !s.hasOwnProperty(v) && (b[v] = u[v]);
|
827
811
|
if (c && c.defaultProps)
|
828
|
-
for (
|
829
|
-
|
830
|
-
return { $$typeof: n, type: c, key: E, ref:
|
812
|
+
for (v in u = c.defaultProps, u)
|
813
|
+
b[v] === void 0 && (b[v] = u[v]);
|
814
|
+
return { $$typeof: n, type: c, key: E, ref: x, props: b, _owner: o.current };
|
831
815
|
}
|
832
|
-
return
|
816
|
+
return it.Fragment = a, it.jsx = p, it.jsxs = p, it;
|
833
817
|
}
|
834
|
-
var
|
818
|
+
var rt = {};
|
835
819
|
/**
|
836
820
|
* @license React
|
837
821
|
* react-jsx-runtime.development.js
|
@@ -841,57 +825,57 @@ var st = {};
|
|
841
825
|
* This source code is licensed under the MIT license found in the
|
842
826
|
* LICENSE file in the root directory of this source tree.
|
843
827
|
*/
|
844
|
-
var
|
845
|
-
function
|
846
|
-
return
|
847
|
-
var t =
|
848
|
-
function
|
828
|
+
var Qt;
|
829
|
+
function qa() {
|
830
|
+
return Qt || (Qt = 1, process.env.NODE_ENV !== "production" && function() {
|
831
|
+
var t = kn, n = Symbol.for("react.element"), a = Symbol.for("react.portal"), e = Symbol.for("react.fragment"), o = Symbol.for("react.strict_mode"), s = Symbol.for("react.profiler"), p = Symbol.for("react.provider"), c = Symbol.for("react.context"), u = Symbol.for("react.forward_ref"), d = Symbol.for("react.suspense"), v = Symbol.for("react.suspense_list"), b = Symbol.for("react.memo"), E = Symbol.for("react.lazy"), x = Symbol.for("react.offscreen"), M = Symbol.iterator, k = "@@iterator";
|
832
|
+
function H(i) {
|
849
833
|
if (i === null || typeof i != "object")
|
850
834
|
return null;
|
851
|
-
var
|
852
|
-
return typeof
|
835
|
+
var h = M && i[M] || i[k];
|
836
|
+
return typeof h == "function" ? h : null;
|
853
837
|
}
|
854
|
-
var
|
855
|
-
function
|
838
|
+
var B = t.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED;
|
839
|
+
function S(i) {
|
856
840
|
{
|
857
|
-
for (var
|
858
|
-
g[
|
859
|
-
|
841
|
+
for (var h = arguments.length, g = new Array(h > 1 ? h - 1 : 0), C = 1; C < h; C++)
|
842
|
+
g[C - 1] = arguments[C];
|
843
|
+
z("error", i, g);
|
860
844
|
}
|
861
845
|
}
|
862
|
-
function
|
846
|
+
function z(i, h, g) {
|
863
847
|
{
|
864
|
-
var
|
865
|
-
D !== "" && (
|
866
|
-
var
|
867
|
-
return String(
|
848
|
+
var C = B.ReactDebugCurrentFrame, D = C.getStackAddendum();
|
849
|
+
D !== "" && (h += "%s", g = g.concat([D]));
|
850
|
+
var F = g.map(function(A) {
|
851
|
+
return String(A);
|
868
852
|
});
|
869
|
-
|
853
|
+
F.unshift("Warning: " + h), Function.prototype.apply.call(console[i], console, F);
|
870
854
|
}
|
871
855
|
}
|
872
|
-
var
|
873
|
-
|
874
|
-
function
|
875
|
-
return !!(typeof i == "string" || typeof i == "function" || i === e || i === s ||
|
856
|
+
var Ee = !1, le = !1, se = !1, f = !1, m = !1, w;
|
857
|
+
w = Symbol.for("react.module.reference");
|
858
|
+
function P(i) {
|
859
|
+
return !!(typeof i == "string" || typeof i == "function" || i === e || i === s || m || i === o || i === d || i === v || f || i === x || Ee || le || se || typeof i == "object" && i !== null && (i.$$typeof === E || i.$$typeof === b || i.$$typeof === p || i.$$typeof === c || i.$$typeof === u || // This needs to include all possible module reference object
|
876
860
|
// types supported by any Flight configuration anywhere since
|
877
861
|
// we don't know which Flight build this will end up being used
|
878
862
|
// with.
|
879
|
-
i.$$typeof ===
|
863
|
+
i.$$typeof === w || i.getModuleId !== void 0));
|
880
864
|
}
|
881
|
-
function Y(i,
|
882
|
-
var
|
883
|
-
if (
|
884
|
-
return
|
885
|
-
var D =
|
865
|
+
function Y(i, h, g) {
|
866
|
+
var C = i.displayName;
|
867
|
+
if (C)
|
868
|
+
return C;
|
869
|
+
var D = h.displayName || h.name || "";
|
886
870
|
return D !== "" ? g + "(" + D + ")" : g;
|
887
871
|
}
|
888
|
-
function
|
872
|
+
function U(i) {
|
889
873
|
return i.displayName || "Context";
|
890
874
|
}
|
891
|
-
function
|
875
|
+
function $(i) {
|
892
876
|
if (i == null)
|
893
877
|
return null;
|
894
|
-
if (typeof i.tag == "number" &&
|
878
|
+
if (typeof i.tag == "number" && S("Received an unexpected object in getComponentNameFromType(). This is likely a bug in React. Please file an issue."), typeof i == "function")
|
895
879
|
return i.displayName || i.name || null;
|
896
880
|
if (typeof i == "string")
|
897
881
|
return i;
|
@@ -902,30 +886,30 @@ function Ja() {
|
|
902
886
|
return "Portal";
|
903
887
|
case s:
|
904
888
|
return "Profiler";
|
905
|
-
case
|
889
|
+
case o:
|
906
890
|
return "StrictMode";
|
907
891
|
case d:
|
908
892
|
return "Suspense";
|
909
|
-
case
|
893
|
+
case v:
|
910
894
|
return "SuspenseList";
|
911
895
|
}
|
912
896
|
if (typeof i == "object")
|
913
897
|
switch (i.$$typeof) {
|
914
898
|
case c:
|
915
|
-
var
|
916
|
-
return
|
917
|
-
case
|
899
|
+
var h = i;
|
900
|
+
return U(h) + ".Consumer";
|
901
|
+
case p:
|
918
902
|
var g = i;
|
919
|
-
return
|
920
|
-
case
|
903
|
+
return U(g._context) + ".Provider";
|
904
|
+
case u:
|
921
905
|
return Y(i, i.render, "ForwardRef");
|
922
|
-
case
|
923
|
-
var
|
924
|
-
return
|
906
|
+
case b:
|
907
|
+
var C = i.displayName || null;
|
908
|
+
return C !== null ? C : $(i.type) || "Memo";
|
925
909
|
case E: {
|
926
|
-
var D = i,
|
910
|
+
var D = i, F = D._payload, A = D._init;
|
927
911
|
try {
|
928
|
-
return
|
912
|
+
return $(A(F));
|
929
913
|
} catch {
|
930
914
|
return null;
|
931
915
|
}
|
@@ -933,18 +917,18 @@ function Ja() {
|
|
933
917
|
}
|
934
918
|
return null;
|
935
919
|
}
|
936
|
-
var
|
937
|
-
function
|
920
|
+
var I = Object.assign, W = 0, q, T, N, J, me, Ce, ft;
|
921
|
+
function Xe() {
|
938
922
|
}
|
939
|
-
|
940
|
-
function
|
923
|
+
Xe.__reactDisabledLog = !0;
|
924
|
+
function At() {
|
941
925
|
{
|
942
|
-
if (
|
943
|
-
|
926
|
+
if (W === 0) {
|
927
|
+
q = console.log, T = console.info, N = console.warn, J = console.error, me = console.group, Ce = console.groupCollapsed, ft = console.groupEnd;
|
944
928
|
var i = {
|
945
929
|
configurable: !0,
|
946
930
|
enumerable: !0,
|
947
|
-
value:
|
931
|
+
value: Xe,
|
948
932
|
writable: !0
|
949
933
|
};
|
950
934
|
Object.defineProperties(console, {
|
@@ -957,64 +941,64 @@ function Ja() {
|
|
957
941
|
groupEnd: i
|
958
942
|
});
|
959
943
|
}
|
960
|
-
|
944
|
+
W++;
|
961
945
|
}
|
962
946
|
}
|
963
|
-
function
|
947
|
+
function kt() {
|
964
948
|
{
|
965
|
-
if (
|
949
|
+
if (W--, W === 0) {
|
966
950
|
var i = {
|
967
951
|
configurable: !0,
|
968
952
|
enumerable: !0,
|
969
953
|
writable: !0
|
970
954
|
};
|
971
955
|
Object.defineProperties(console, {
|
972
|
-
log:
|
973
|
-
value:
|
956
|
+
log: I({}, i, {
|
957
|
+
value: q
|
974
958
|
}),
|
975
|
-
info:
|
976
|
-
value:
|
959
|
+
info: I({}, i, {
|
960
|
+
value: T
|
977
961
|
}),
|
978
|
-
warn:
|
979
|
-
value:
|
962
|
+
warn: I({}, i, {
|
963
|
+
value: N
|
980
964
|
}),
|
981
|
-
error:
|
982
|
-
value:
|
965
|
+
error: I({}, i, {
|
966
|
+
value: J
|
983
967
|
}),
|
984
|
-
group:
|
985
|
-
value:
|
968
|
+
group: I({}, i, {
|
969
|
+
value: me
|
986
970
|
}),
|
987
|
-
groupCollapsed:
|
988
|
-
value:
|
971
|
+
groupCollapsed: I({}, i, {
|
972
|
+
value: Ce
|
989
973
|
}),
|
990
|
-
groupEnd:
|
991
|
-
value:
|
974
|
+
groupEnd: I({}, i, {
|
975
|
+
value: ft
|
992
976
|
})
|
993
977
|
});
|
994
978
|
}
|
995
|
-
|
979
|
+
W < 0 && S("disabledDepth fell below zero. This is a bug in React. Please file an issue.");
|
996
980
|
}
|
997
981
|
}
|
998
|
-
var
|
999
|
-
function ze(i,
|
982
|
+
var Ze = B.ReactCurrentDispatcher, Je;
|
983
|
+
function ze(i, h, g) {
|
1000
984
|
{
|
1001
|
-
if (
|
985
|
+
if (Je === void 0)
|
1002
986
|
try {
|
1003
987
|
throw Error();
|
1004
988
|
} catch (D) {
|
1005
|
-
var
|
1006
|
-
|
989
|
+
var C = D.stack.trim().match(/\n( *(at )?)/);
|
990
|
+
Je = C && C[1] || "";
|
1007
991
|
}
|
1008
992
|
return `
|
1009
|
-
` +
|
993
|
+
` + Je + i;
|
1010
994
|
}
|
1011
995
|
}
|
1012
996
|
var Ye = !1, Me;
|
1013
997
|
{
|
1014
|
-
var
|
1015
|
-
Me = new
|
998
|
+
var ht = typeof WeakMap == "function" ? WeakMap : Map;
|
999
|
+
Me = new ht();
|
1016
1000
|
}
|
1017
|
-
function
|
1001
|
+
function pt(i, h) {
|
1018
1002
|
if (!i || Ye)
|
1019
1003
|
return "";
|
1020
1004
|
{
|
@@ -1022,189 +1006,189 @@ function Ja() {
|
|
1022
1006
|
if (g !== void 0)
|
1023
1007
|
return g;
|
1024
1008
|
}
|
1025
|
-
var
|
1009
|
+
var C;
|
1026
1010
|
Ye = !0;
|
1027
1011
|
var D = Error.prepareStackTrace;
|
1028
1012
|
Error.prepareStackTrace = void 0;
|
1029
|
-
var
|
1030
|
-
|
1013
|
+
var F;
|
1014
|
+
F = Ze.current, Ze.current = null, At();
|
1031
1015
|
try {
|
1032
|
-
if (
|
1033
|
-
var
|
1016
|
+
if (h) {
|
1017
|
+
var A = function() {
|
1034
1018
|
throw Error();
|
1035
1019
|
};
|
1036
|
-
if (Object.defineProperty(
|
1020
|
+
if (Object.defineProperty(A.prototype, "props", {
|
1037
1021
|
set: function() {
|
1038
1022
|
throw Error();
|
1039
1023
|
}
|
1040
1024
|
}), typeof Reflect == "object" && Reflect.construct) {
|
1041
1025
|
try {
|
1042
|
-
Reflect.construct(
|
1043
|
-
} catch (
|
1044
|
-
|
1026
|
+
Reflect.construct(A, []);
|
1027
|
+
} catch (ve) {
|
1028
|
+
C = ve;
|
1045
1029
|
}
|
1046
|
-
Reflect.construct(i, [],
|
1030
|
+
Reflect.construct(i, [], A);
|
1047
1031
|
} else {
|
1048
1032
|
try {
|
1049
|
-
|
1050
|
-
} catch (
|
1051
|
-
|
1033
|
+
A.call();
|
1034
|
+
} catch (ve) {
|
1035
|
+
C = ve;
|
1052
1036
|
}
|
1053
|
-
i.call(
|
1037
|
+
i.call(A.prototype);
|
1054
1038
|
}
|
1055
1039
|
} else {
|
1056
1040
|
try {
|
1057
1041
|
throw Error();
|
1058
|
-
} catch (
|
1059
|
-
|
1042
|
+
} catch (ve) {
|
1043
|
+
C = ve;
|
1060
1044
|
}
|
1061
1045
|
i();
|
1062
1046
|
}
|
1063
|
-
} catch (
|
1064
|
-
if (
|
1065
|
-
for (var
|
1066
|
-
`),
|
1067
|
-
`),
|
1068
|
-
|
1069
|
-
for (;
|
1070
|
-
if (
|
1071
|
-
if (
|
1047
|
+
} catch (ve) {
|
1048
|
+
if (ve && C && typeof ve.stack == "string") {
|
1049
|
+
for (var R = ve.stack.split(`
|
1050
|
+
`), ce = C.stack.split(`
|
1051
|
+
`), Z = R.length - 1, Q = ce.length - 1; Z >= 1 && Q >= 0 && R[Z] !== ce[Q]; )
|
1052
|
+
Q--;
|
1053
|
+
for (; Z >= 1 && Q >= 0; Z--, Q--)
|
1054
|
+
if (R[Z] !== ce[Q]) {
|
1055
|
+
if (Z !== 1 || Q !== 1)
|
1072
1056
|
do
|
1073
|
-
if (
|
1074
|
-
var
|
1075
|
-
` +
|
1076
|
-
return i.displayName &&
|
1057
|
+
if (Z--, Q--, Q < 0 || R[Z] !== ce[Q]) {
|
1058
|
+
var he = `
|
1059
|
+
` + R[Z].replace(" at new ", " at ");
|
1060
|
+
return i.displayName && he.includes("<anonymous>") && (he = he.replace("<anonymous>", i.displayName)), typeof i == "function" && Me.set(i, he), he;
|
1077
1061
|
}
|
1078
|
-
while (
|
1062
|
+
while (Z >= 1 && Q >= 0);
|
1079
1063
|
break;
|
1080
1064
|
}
|
1081
1065
|
}
|
1082
1066
|
} finally {
|
1083
|
-
Ye = !1,
|
1067
|
+
Ye = !1, Ze.current = F, kt(), Error.prepareStackTrace = D;
|
1084
1068
|
}
|
1085
|
-
var Ve = i ? i.displayName || i.name : "",
|
1086
|
-
return typeof i == "function" && Me.set(i,
|
1069
|
+
var Ve = i ? i.displayName || i.name : "", qt = Ve ? ze(Ve) : "";
|
1070
|
+
return typeof i == "function" && Me.set(i, qt), qt;
|
1087
1071
|
}
|
1088
|
-
function
|
1089
|
-
return
|
1072
|
+
function _t(i, h, g) {
|
1073
|
+
return pt(i, !1);
|
1090
1074
|
}
|
1091
|
-
function
|
1092
|
-
var
|
1093
|
-
return !!(
|
1075
|
+
function mt(i) {
|
1076
|
+
var h = i.prototype;
|
1077
|
+
return !!(h && h.isReactComponent);
|
1094
1078
|
}
|
1095
|
-
function Te(i,
|
1079
|
+
function Te(i, h, g) {
|
1096
1080
|
if (i == null)
|
1097
1081
|
return "";
|
1098
1082
|
if (typeof i == "function")
|
1099
|
-
return
|
1083
|
+
return pt(i, mt(i));
|
1100
1084
|
if (typeof i == "string")
|
1101
1085
|
return ze(i);
|
1102
1086
|
switch (i) {
|
1103
1087
|
case d:
|
1104
1088
|
return ze("Suspense");
|
1105
|
-
case
|
1089
|
+
case v:
|
1106
1090
|
return ze("SuspenseList");
|
1107
1091
|
}
|
1108
1092
|
if (typeof i == "object")
|
1109
1093
|
switch (i.$$typeof) {
|
1110
|
-
case
|
1111
|
-
return
|
1112
|
-
case
|
1113
|
-
return Te(i.type,
|
1094
|
+
case u:
|
1095
|
+
return _t(i.render);
|
1096
|
+
case b:
|
1097
|
+
return Te(i.type, h, g);
|
1114
1098
|
case E: {
|
1115
|
-
var
|
1099
|
+
var C = i, D = C._payload, F = C._init;
|
1116
1100
|
try {
|
1117
|
-
return Te(
|
1101
|
+
return Te(F(D), h, g);
|
1118
1102
|
} catch {
|
1119
1103
|
}
|
1120
1104
|
}
|
1121
1105
|
}
|
1122
1106
|
return "";
|
1123
1107
|
}
|
1124
|
-
var Re = Object.prototype.hasOwnProperty,
|
1108
|
+
var Re = Object.prototype.hasOwnProperty, vt = {}, gt = B.ReactDebugCurrentFrame;
|
1125
1109
|
function Pe(i) {
|
1126
1110
|
if (i) {
|
1127
|
-
var
|
1128
|
-
|
1111
|
+
var h = i._owner, g = Te(i.type, i._source, h ? h.type : null);
|
1112
|
+
gt.setExtraStackFrame(g);
|
1129
1113
|
} else
|
1130
|
-
|
1114
|
+
gt.setExtraStackFrame(null);
|
1131
1115
|
}
|
1132
|
-
function
|
1116
|
+
function Qe(i, h, g, C, D) {
|
1133
1117
|
{
|
1134
|
-
var
|
1135
|
-
for (var
|
1136
|
-
if (
|
1137
|
-
var
|
1118
|
+
var F = Function.call.bind(Re);
|
1119
|
+
for (var A in i)
|
1120
|
+
if (F(i, A)) {
|
1121
|
+
var R = void 0;
|
1138
1122
|
try {
|
1139
|
-
if (typeof i[
|
1140
|
-
var
|
1141
|
-
throw
|
1123
|
+
if (typeof i[A] != "function") {
|
1124
|
+
var ce = Error((C || "React class") + ": " + g + " type `" + A + "` is invalid; it must be a function, usually from the `prop-types` package, but received `" + typeof i[A] + "`.This often happens because of typos such as `PropTypes.function` instead of `PropTypes.func`.");
|
1125
|
+
throw ce.name = "Invariant Violation", ce;
|
1142
1126
|
}
|
1143
|
-
|
1144
|
-
} catch (
|
1145
|
-
|
1127
|
+
R = i[A](h, A, C, g, null, "SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED");
|
1128
|
+
} catch (Z) {
|
1129
|
+
R = Z;
|
1146
1130
|
}
|
1147
|
-
|
1131
|
+
R && !(R instanceof Error) && (Pe(D), S("%s: type specification of %s `%s` is invalid; the type checker function must return `null` or an `Error` but returned a %s. You may have forgotten to pass an argument to the type checker creator (arrayOf, instanceOf, objectOf, oneOf, oneOfType, and shape all require an argument).", C || "React class", g, A, typeof R), Pe(null)), R instanceof Error && !(R.message in vt) && (vt[R.message] = !0, Pe(D), S("Failed %s type: %s", g, R.message), Pe(null));
|
1148
1132
|
}
|
1149
1133
|
}
|
1150
1134
|
}
|
1151
1135
|
var Ae = Array.isArray;
|
1152
|
-
function
|
1136
|
+
function et(i) {
|
1153
1137
|
return Ae(i);
|
1154
1138
|
}
|
1155
|
-
function
|
1139
|
+
function jt(i) {
|
1156
1140
|
{
|
1157
|
-
var
|
1141
|
+
var h = typeof Symbol == "function" && Symbol.toStringTag, g = h && i[Symbol.toStringTag] || i.constructor.name || "Object";
|
1158
1142
|
return g;
|
1159
1143
|
}
|
1160
1144
|
}
|
1161
|
-
function
|
1145
|
+
function bt(i) {
|
1162
1146
|
try {
|
1163
|
-
return
|
1147
|
+
return yt(i), !1;
|
1164
1148
|
} catch {
|
1165
1149
|
return !0;
|
1166
1150
|
}
|
1167
1151
|
}
|
1168
|
-
function
|
1152
|
+
function yt(i) {
|
1169
1153
|
return "" + i;
|
1170
1154
|
}
|
1171
|
-
function
|
1172
|
-
if (
|
1173
|
-
return
|
1155
|
+
function Et(i) {
|
1156
|
+
if (bt(i))
|
1157
|
+
return S("The provided key is an unsupported type %s. This value must be coerced to a string before before using it here.", jt(i)), yt(i);
|
1174
1158
|
}
|
1175
|
-
var
|
1159
|
+
var xe = B.ReactCurrentOwner, tt = {
|
1176
1160
|
key: !0,
|
1177
1161
|
ref: !0,
|
1178
1162
|
__self: !0,
|
1179
1163
|
__source: !0
|
1180
|
-
},
|
1164
|
+
}, nt, Ct, Ge;
|
1181
1165
|
Ge = {};
|
1182
|
-
function
|
1166
|
+
function Dt(i) {
|
1183
1167
|
if (Re.call(i, "ref")) {
|
1184
|
-
var
|
1185
|
-
if (
|
1168
|
+
var h = Object.getOwnPropertyDescriptor(i, "ref").get;
|
1169
|
+
if (h && h.isReactWarning)
|
1186
1170
|
return !1;
|
1187
1171
|
}
|
1188
1172
|
return i.ref !== void 0;
|
1189
1173
|
}
|
1190
|
-
function
|
1174
|
+
function It(i) {
|
1191
1175
|
if (Re.call(i, "key")) {
|
1192
|
-
var
|
1193
|
-
if (
|
1176
|
+
var h = Object.getOwnPropertyDescriptor(i, "key").get;
|
1177
|
+
if (h && h.isReactWarning)
|
1194
1178
|
return !1;
|
1195
1179
|
}
|
1196
1180
|
return i.key !== void 0;
|
1197
1181
|
}
|
1198
|
-
function
|
1199
|
-
if (typeof i.ref == "string" &&
|
1200
|
-
var g =
|
1201
|
-
Ge[g] || (
|
1182
|
+
function xt(i, h) {
|
1183
|
+
if (typeof i.ref == "string" && xe.current && h && xe.current.stateNode !== h) {
|
1184
|
+
var g = $(xe.current.type);
|
1185
|
+
Ge[g] || (S('Component "%s" contains the string ref "%s". Support for string refs will be removed in a future major release. This case cannot be automatically converted to an arrow function. We ask you to manually fix this case by using useRef() or createRef() instead. Learn more about using refs safely here: https://reactjs.org/link/strict-mode-string-ref', $(xe.current.type), i.ref), Ge[g] = !0);
|
1202
1186
|
}
|
1203
1187
|
}
|
1204
|
-
function
|
1188
|
+
function Se(i, h) {
|
1205
1189
|
{
|
1206
1190
|
var g = function() {
|
1207
|
-
|
1191
|
+
nt || (nt = !0, S("%s: `key` is not a prop. Trying to access it will result in `undefined` being returned. If you need to access the same value within the child component, you should pass it as a different prop. (https://reactjs.org/link/special-props)", h));
|
1208
1192
|
};
|
1209
1193
|
g.isReactWarning = !0, Object.defineProperty(i, "key", {
|
1210
1194
|
get: g,
|
@@ -1212,10 +1196,10 @@ function Ja() {
|
|
1212
1196
|
});
|
1213
1197
|
}
|
1214
1198
|
}
|
1215
|
-
function
|
1199
|
+
function Wt(i, h) {
|
1216
1200
|
{
|
1217
1201
|
var g = function() {
|
1218
|
-
|
1202
|
+
Ct || (Ct = !0, S("%s: `ref` is not a prop. Trying to access it will result in `undefined` being returned. If you need to access the same value within the child component, you should pass it as a different prop. (https://reactjs.org/link/special-props)", h));
|
1219
1203
|
};
|
1220
1204
|
g.isReactWarning = !0, Object.defineProperty(i, "ref", {
|
1221
1205
|
get: g,
|
@@ -1223,70 +1207,70 @@ function Ja() {
|
|
1223
1207
|
});
|
1224
1208
|
}
|
1225
1209
|
}
|
1226
|
-
var
|
1227
|
-
var
|
1210
|
+
var r = function(i, h, g, C, D, F, A) {
|
1211
|
+
var R = {
|
1228
1212
|
// This tag allows us to uniquely identify this as a React Element
|
1229
1213
|
$$typeof: n,
|
1230
1214
|
// Built-in properties that belong on the element
|
1231
1215
|
type: i,
|
1232
|
-
key:
|
1216
|
+
key: h,
|
1233
1217
|
ref: g,
|
1234
|
-
props:
|
1218
|
+
props: A,
|
1235
1219
|
// Record the component responsible for creating this element.
|
1236
|
-
_owner:
|
1220
|
+
_owner: F
|
1237
1221
|
};
|
1238
|
-
return
|
1222
|
+
return R._store = {}, Object.defineProperty(R._store, "validated", {
|
1239
1223
|
configurable: !1,
|
1240
1224
|
enumerable: !1,
|
1241
1225
|
writable: !0,
|
1242
1226
|
value: !1
|
1243
|
-
}), Object.defineProperty(
|
1227
|
+
}), Object.defineProperty(R, "_self", {
|
1244
1228
|
configurable: !1,
|
1245
1229
|
enumerable: !1,
|
1246
1230
|
writable: !1,
|
1247
|
-
value:
|
1248
|
-
}), Object.defineProperty(
|
1231
|
+
value: C
|
1232
|
+
}), Object.defineProperty(R, "_source", {
|
1249
1233
|
configurable: !1,
|
1250
1234
|
enumerable: !1,
|
1251
1235
|
writable: !1,
|
1252
1236
|
value: D
|
1253
|
-
}), Object.freeze && (Object.freeze(
|
1237
|
+
}), Object.freeze && (Object.freeze(R.props), Object.freeze(R)), R;
|
1254
1238
|
};
|
1255
|
-
function y(i,
|
1239
|
+
function y(i, h, g, C, D) {
|
1256
1240
|
{
|
1257
|
-
var
|
1258
|
-
g !== void 0 && (
|
1259
|
-
for (
|
1260
|
-
Re.call(
|
1241
|
+
var F, A = {}, R = null, ce = null;
|
1242
|
+
g !== void 0 && (Et(g), R = "" + g), It(h) && (Et(h.key), R = "" + h.key), Dt(h) && (ce = h.ref, xt(h, D));
|
1243
|
+
for (F in h)
|
1244
|
+
Re.call(h, F) && !tt.hasOwnProperty(F) && (A[F] = h[F]);
|
1261
1245
|
if (i && i.defaultProps) {
|
1262
|
-
var
|
1263
|
-
for (
|
1264
|
-
|
1246
|
+
var Z = i.defaultProps;
|
1247
|
+
for (F in Z)
|
1248
|
+
A[F] === void 0 && (A[F] = Z[F]);
|
1265
1249
|
}
|
1266
|
-
if (
|
1267
|
-
var
|
1268
|
-
|
1250
|
+
if (R || ce) {
|
1251
|
+
var Q = typeof i == "function" ? i.displayName || i.name || "Unknown" : i;
|
1252
|
+
R && Se(A, Q), ce && Wt(A, Q);
|
1269
1253
|
}
|
1270
|
-
return
|
1254
|
+
return r(i, R, ce, D, C, xe.current, A);
|
1271
1255
|
}
|
1272
1256
|
}
|
1273
|
-
var
|
1274
|
-
function
|
1257
|
+
var O = B.ReactCurrentOwner, L = B.ReactDebugCurrentFrame;
|
1258
|
+
function K(i) {
|
1275
1259
|
if (i) {
|
1276
|
-
var
|
1277
|
-
|
1260
|
+
var h = i._owner, g = Te(i.type, i._source, h ? h.type : null);
|
1261
|
+
L.setExtraStackFrame(g);
|
1278
1262
|
} else
|
1279
|
-
|
1263
|
+
L.setExtraStackFrame(null);
|
1280
1264
|
}
|
1281
|
-
var
|
1282
|
-
|
1283
|
-
function
|
1265
|
+
var de;
|
1266
|
+
de = !1;
|
1267
|
+
function ae(i) {
|
1284
1268
|
return typeof i == "object" && i !== null && i.$$typeof === n;
|
1285
1269
|
}
|
1286
|
-
function
|
1270
|
+
function Lt() {
|
1287
1271
|
{
|
1288
|
-
if (
|
1289
|
-
var i =
|
1272
|
+
if (O.current) {
|
1273
|
+
var i = $(O.current.type);
|
1290
1274
|
if (i)
|
1291
1275
|
return `
|
1292
1276
|
|
@@ -1295,149 +1279,149 @@ Check the render method of \`` + i + "`.";
|
|
1295
1279
|
return "";
|
1296
1280
|
}
|
1297
1281
|
}
|
1298
|
-
function
|
1282
|
+
function Nt(i) {
|
1299
1283
|
{
|
1300
1284
|
if (i !== void 0) {
|
1301
|
-
var
|
1285
|
+
var h = i.fileName.replace(/^.*[\\\/]/, ""), g = i.lineNumber;
|
1302
1286
|
return `
|
1303
1287
|
|
1304
|
-
Check your code at ` +
|
1288
|
+
Check your code at ` + h + ":" + g + ".";
|
1305
1289
|
}
|
1306
1290
|
return "";
|
1307
1291
|
}
|
1308
1292
|
}
|
1309
|
-
var
|
1310
|
-
function
|
1293
|
+
var at = {};
|
1294
|
+
function pe(i) {
|
1311
1295
|
{
|
1312
|
-
var
|
1313
|
-
if (!
|
1296
|
+
var h = Lt();
|
1297
|
+
if (!h) {
|
1314
1298
|
var g = typeof i == "string" ? i : i.displayName || i.name;
|
1315
|
-
g && (
|
1299
|
+
g && (h = `
|
1316
1300
|
|
1317
1301
|
Check the top-level render call using <` + g + ">.");
|
1318
1302
|
}
|
1319
|
-
return
|
1303
|
+
return h;
|
1320
1304
|
}
|
1321
1305
|
}
|
1322
|
-
function
|
1306
|
+
function fe(i, h) {
|
1323
1307
|
{
|
1324
1308
|
if (!i._store || i._store.validated || i.key != null)
|
1325
1309
|
return;
|
1326
1310
|
i._store.validated = !0;
|
1327
|
-
var g =
|
1328
|
-
if (
|
1311
|
+
var g = pe(h);
|
1312
|
+
if (at[g])
|
1329
1313
|
return;
|
1330
|
-
|
1331
|
-
var
|
1332
|
-
i && i._owner && i._owner !==
|
1314
|
+
at[g] = !0;
|
1315
|
+
var C = "";
|
1316
|
+
i && i._owner && i._owner !== O.current && (C = " It was passed a child from " + $(i._owner.type) + "."), K(i), S('Each child in a list should have a unique "key" prop.%s%s See https://reactjs.org/link/warning-keys for more information.', g, C), K(null);
|
1333
1317
|
}
|
1334
1318
|
}
|
1335
|
-
function ke(i,
|
1319
|
+
function ke(i, h) {
|
1336
1320
|
{
|
1337
1321
|
if (typeof i != "object")
|
1338
1322
|
return;
|
1339
|
-
if (
|
1323
|
+
if (et(i))
|
1340
1324
|
for (var g = 0; g < i.length; g++) {
|
1341
|
-
var
|
1342
|
-
|
1325
|
+
var C = i[g];
|
1326
|
+
ae(C) && fe(C, h);
|
1343
1327
|
}
|
1344
|
-
else if (
|
1328
|
+
else if (ae(i))
|
1345
1329
|
i._store && (i._store.validated = !0);
|
1346
1330
|
else if (i) {
|
1347
|
-
var D =
|
1331
|
+
var D = H(i);
|
1348
1332
|
if (typeof D == "function" && D !== i.entries)
|
1349
|
-
for (var
|
1350
|
-
|
1333
|
+
for (var F = D.call(i), A; !(A = F.next()).done; )
|
1334
|
+
ae(A.value) && fe(A.value, h);
|
1351
1335
|
}
|
1352
1336
|
}
|
1353
1337
|
}
|
1354
1338
|
function _e(i) {
|
1355
1339
|
{
|
1356
|
-
var
|
1357
|
-
if (
|
1340
|
+
var h = i.type;
|
1341
|
+
if (h == null || typeof h == "string")
|
1358
1342
|
return;
|
1359
1343
|
var g;
|
1360
|
-
if (typeof
|
1361
|
-
g =
|
1362
|
-
else if (typeof
|
1344
|
+
if (typeof h == "function")
|
1345
|
+
g = h.propTypes;
|
1346
|
+
else if (typeof h == "object" && (h.$$typeof === u || // Note: Memo only checks outer props here.
|
1363
1347
|
// Inner props are checked in the reconciler.
|
1364
|
-
|
1365
|
-
g =
|
1348
|
+
h.$$typeof === b))
|
1349
|
+
g = h.propTypes;
|
1366
1350
|
else
|
1367
1351
|
return;
|
1368
1352
|
if (g) {
|
1369
|
-
var
|
1370
|
-
|
1371
|
-
} else if (
|
1372
|
-
|
1373
|
-
var D =
|
1374
|
-
|
1353
|
+
var C = $(h);
|
1354
|
+
Qe(g, i.props, "prop", C, i);
|
1355
|
+
} else if (h.PropTypes !== void 0 && !de) {
|
1356
|
+
de = !0;
|
1357
|
+
var D = $(h);
|
1358
|
+
S("Component %s declared `PropTypes` instead of `propTypes`. Did you misspell the property assignment?", D || "Unknown");
|
1375
1359
|
}
|
1376
|
-
typeof
|
1360
|
+
typeof h.getDefaultProps == "function" && !h.getDefaultProps.isReactClassApproved && S("getDefaultProps is only used on classic React.createClass definitions. Use a static property named `defaultProps` instead.");
|
1377
1361
|
}
|
1378
1362
|
}
|
1379
1363
|
function je(i) {
|
1380
1364
|
{
|
1381
|
-
for (var
|
1382
|
-
var
|
1383
|
-
if (
|
1384
|
-
|
1365
|
+
for (var h = Object.keys(i.props), g = 0; g < h.length; g++) {
|
1366
|
+
var C = h[g];
|
1367
|
+
if (C !== "children" && C !== "key") {
|
1368
|
+
K(i), S("Invalid prop `%s` supplied to `React.Fragment`. React.Fragment can only have `key` and `children` props.", C), K(null);
|
1385
1369
|
break;
|
1386
1370
|
}
|
1387
1371
|
}
|
1388
|
-
i.ref !== null && (
|
1372
|
+
i.ref !== null && (K(i), S("Invalid attribute `ref` supplied to `React.Fragment`."), K(null));
|
1389
1373
|
}
|
1390
1374
|
}
|
1391
|
-
function De(i,
|
1375
|
+
function De(i, h, g, C, D, F) {
|
1392
1376
|
{
|
1393
|
-
var
|
1394
|
-
if (!
|
1395
|
-
var
|
1396
|
-
(i === void 0 || typeof i == "object" && i !== null && Object.keys(i).length === 0) && (
|
1397
|
-
var
|
1398
|
-
|
1399
|
-
var
|
1400
|
-
i === null ?
|
1377
|
+
var A = P(i);
|
1378
|
+
if (!A) {
|
1379
|
+
var R = "";
|
1380
|
+
(i === void 0 || typeof i == "object" && i !== null && Object.keys(i).length === 0) && (R += " You likely forgot to export your component from the file it's defined in, or you might have mixed up default and named imports.");
|
1381
|
+
var ce = Nt(D);
|
1382
|
+
ce ? R += ce : R += Lt();
|
1383
|
+
var Z;
|
1384
|
+
i === null ? Z = "null" : et(i) ? Z = "array" : i !== void 0 && i.$$typeof === n ? (Z = "<" + ($(i.type) || "Unknown") + " />", R = " Did you accidentally export a JSX literal instead of a component?") : Z = typeof i, S("React.jsx: type is invalid -- expected a string (for built-in components) or a class/function (for composite components) but got: %s.%s", Z, R);
|
1401
1385
|
}
|
1402
|
-
var
|
1403
|
-
if (
|
1404
|
-
return
|
1405
|
-
if (
|
1406
|
-
var
|
1407
|
-
if (
|
1408
|
-
if (
|
1409
|
-
if (
|
1410
|
-
for (var Ve = 0; Ve <
|
1411
|
-
ke(
|
1412
|
-
Object.freeze && Object.freeze(
|
1386
|
+
var Q = y(i, h, g, D, F);
|
1387
|
+
if (Q == null)
|
1388
|
+
return Q;
|
1389
|
+
if (A) {
|
1390
|
+
var he = h.children;
|
1391
|
+
if (he !== void 0)
|
1392
|
+
if (C)
|
1393
|
+
if (et(he)) {
|
1394
|
+
for (var Ve = 0; Ve < he.length; Ve++)
|
1395
|
+
ke(he[Ve], i);
|
1396
|
+
Object.freeze && Object.freeze(he);
|
1413
1397
|
} else
|
1414
|
-
|
1398
|
+
S("React.jsx: Static children should always be an array. You are likely explicitly calling React.jsxs or React.jsxDEV. Use the Babel transform instead.");
|
1415
1399
|
else
|
1416
|
-
ke(
|
1400
|
+
ke(he, i);
|
1417
1401
|
}
|
1418
|
-
return i === e ? je(
|
1402
|
+
return i === e ? je(Q) : _e(Q), Q;
|
1419
1403
|
}
|
1420
1404
|
}
|
1421
|
-
function
|
1422
|
-
return De(i,
|
1405
|
+
function zn(i, h, g) {
|
1406
|
+
return De(i, h, g, !0);
|
1423
1407
|
}
|
1424
|
-
function
|
1425
|
-
return De(i,
|
1408
|
+
function Yn(i, h, g) {
|
1409
|
+
return De(i, h, g, !1);
|
1426
1410
|
}
|
1427
|
-
var
|
1428
|
-
|
1429
|
-
}()),
|
1411
|
+
var Gn = Yn, Vn = zn;
|
1412
|
+
rt.Fragment = e, rt.jsx = Gn, rt.jsxs = Vn;
|
1413
|
+
}()), rt;
|
1430
1414
|
}
|
1431
|
-
process.env.NODE_ENV === "production" ?
|
1432
|
-
var
|
1433
|
-
function
|
1434
|
-
return t.title.search("<") > -1 ? /* @__PURE__ */
|
1415
|
+
process.env.NODE_ENV === "production" ? Vt.exports = Wa() : Vt.exports = qa();
|
1416
|
+
var l = Vt.exports;
|
1417
|
+
function Fn(t) {
|
1418
|
+
return t.title.search("<") > -1 ? /* @__PURE__ */ l.jsx("button", { className: "svg", dangerouslySetInnerHTML: { __html: t.title } }) : /* @__PURE__ */ l.jsx("button", { children: t.title });
|
1435
1419
|
}
|
1436
|
-
const
|
1437
|
-
/* @__PURE__ */
|
1438
|
-
/* @__PURE__ */
|
1439
|
-
/* @__PURE__ */
|
1440
|
-
] }),
|
1420
|
+
const Ka = /* @__PURE__ */ l.jsxs("svg", { className: "closeIcon", width: "14", height: "14", fill: "none", stroke: "#666666", strokeMiterlimit: "10", children: [
|
1421
|
+
/* @__PURE__ */ l.jsx("circle", { cx: "7", cy: "7", r: "6" }),
|
1422
|
+
/* @__PURE__ */ l.jsx("line", { x1: "4", y1: "4", x2: "10", y2: "10" }),
|
1423
|
+
/* @__PURE__ */ l.jsx("line", { x1: "4", y1: "10", x2: "10", y2: "4" })
|
1424
|
+
] }), Xa = /* @__PURE__ */ l.jsx("svg", { className: "dragIcon", width: "14", height: "14", fill: "#666666", stroke: "none", children: /* @__PURE__ */ l.jsx(
|
1441
1425
|
"path",
|
1442
1426
|
{
|
1443
1427
|
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
|
@@ -1445,46 +1429,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
|
|
1445
1429
|
C11,8.22,10.74,8,10.43,8z`
|
1446
1430
|
}
|
1447
1431
|
) });
|
1448
|
-
function
|
1449
|
-
return /* @__PURE__ */
|
1450
|
-
|
1451
|
-
/* @__PURE__ */
|
1452
|
-
/* @__PURE__ */
|
1432
|
+
function Za(t) {
|
1433
|
+
return /* @__PURE__ */ l.jsx(_n.Item, { value: t.title, children: /* @__PURE__ */ l.jsxs("div", { children: [
|
1434
|
+
Xa,
|
1435
|
+
/* @__PURE__ */ l.jsx("span", { children: t.title }),
|
1436
|
+
/* @__PURE__ */ l.jsx("button", { className: "closeIcon", onClick: () => {
|
1453
1437
|
t.onDelete(t.index);
|
1454
|
-
}, children:
|
1438
|
+
}, children: Ka })
|
1455
1439
|
] }) }, t.title);
|
1456
1440
|
}
|
1457
|
-
function
|
1458
|
-
const [n, a] =
|
1459
|
-
t.onDragComplete(d),
|
1460
|
-
},
|
1461
|
-
const
|
1462
|
-
|
1441
|
+
function Ja(t) {
|
1442
|
+
const [n, a] = oe(!1), [e, o] = oe(t.options), s = (d) => {
|
1443
|
+
t.onDragComplete(d), o(d);
|
1444
|
+
}, p = (d) => {
|
1445
|
+
const v = [...e];
|
1446
|
+
v.splice(d, 1), s(v);
|
1463
1447
|
}, c = [];
|
1464
|
-
e.forEach((d,
|
1465
|
-
c.push(/* @__PURE__ */
|
1448
|
+
e.forEach((d, v) => {
|
1449
|
+
c.push(/* @__PURE__ */ l.jsx(Za, { index: v, title: d, onDelete: p }, d));
|
1466
1450
|
});
|
1467
|
-
let
|
1468
|
-
return t.subdropdown && (
|
1469
|
-
/* @__PURE__ */
|
1470
|
-
/* @__PURE__ */
|
1451
|
+
let u = "dropdown draggable";
|
1452
|
+
return t.subdropdown && (u += " subdropdown"), /* @__PURE__ */ l.jsxs("div", { className: u, onMouseEnter: () => a(!0), onMouseLeave: () => a(!1), children: [
|
1453
|
+
/* @__PURE__ */ l.jsx(Fn, { title: t.title }),
|
1454
|
+
/* @__PURE__ */ l.jsx(_n.Group, { axis: "y", values: e, onReorder: s, style: { visibility: n ? "visible" : "hidden" }, children: c })
|
1471
1455
|
] });
|
1472
1456
|
}
|
1473
|
-
function
|
1474
|
-
const [n, a] =
|
1475
|
-
t.options.map((s,
|
1476
|
-
t.onSelect !== void 0 && (s.onSelect = t.onSelect), e.push(/* @__PURE__ */
|
1457
|
+
function Qa(t) {
|
1458
|
+
const [n, a] = oe(!1), e = [];
|
1459
|
+
t.options.map((s, p) => {
|
1460
|
+
t.onSelect !== void 0 && (s.onSelect = t.onSelect), e.push(/* @__PURE__ */ l.jsx(ei, { option: s }, p));
|
1477
1461
|
});
|
1478
|
-
let
|
1479
|
-
return t.subdropdown && (
|
1462
|
+
let o = "dropdown";
|
1463
|
+
return t.subdropdown && (o += " subdropdown"), /* @__PURE__ */ l.jsxs(
|
1480
1464
|
"div",
|
1481
1465
|
{
|
1482
|
-
className:
|
1466
|
+
className: o,
|
1483
1467
|
onMouseEnter: () => a(!0),
|
1484
1468
|
onMouseLeave: () => a(!1),
|
1485
1469
|
children: [
|
1486
|
-
/* @__PURE__ */
|
1487
|
-
/* @__PURE__ */
|
1470
|
+
/* @__PURE__ */ l.jsx(Fn, { title: t.title }),
|
1471
|
+
/* @__PURE__ */ l.jsx(
|
1488
1472
|
"ul",
|
1489
1473
|
{
|
1490
1474
|
style: { visibility: n ? "visible" : "hidden" },
|
@@ -1495,13 +1479,13 @@ function ai(t) {
|
|
1495
1479
|
}
|
1496
1480
|
);
|
1497
1481
|
}
|
1498
|
-
function
|
1499
|
-
const { option: n } = t, [a, e] =
|
1500
|
-
let
|
1482
|
+
function ei(t) {
|
1483
|
+
const { option: n } = t, [a, e] = oe("");
|
1484
|
+
let o;
|
1501
1485
|
switch (n.type) {
|
1502
1486
|
case "draggable":
|
1503
|
-
|
1504
|
-
|
1487
|
+
o = /* @__PURE__ */ l.jsx(
|
1488
|
+
Ja,
|
1505
1489
|
{
|
1506
1490
|
title: n.title,
|
1507
1491
|
options: n.value,
|
@@ -1513,8 +1497,8 @@ function ii(t) {
|
|
1513
1497
|
);
|
1514
1498
|
break;
|
1515
1499
|
case "dropdown":
|
1516
|
-
|
1517
|
-
|
1500
|
+
o = /* @__PURE__ */ l.jsx(
|
1501
|
+
Qa,
|
1518
1502
|
{
|
1519
1503
|
title: n.title,
|
1520
1504
|
options: n.value,
|
@@ -1524,7 +1508,7 @@ function ii(t) {
|
|
1524
1508
|
);
|
1525
1509
|
break;
|
1526
1510
|
case "option":
|
1527
|
-
|
1511
|
+
o = /* @__PURE__ */ l.jsx(
|
1528
1512
|
"button",
|
1529
1513
|
{
|
1530
1514
|
onClick: () => {
|
@@ -1535,32 +1519,32 @@ function ii(t) {
|
|
1535
1519
|
);
|
1536
1520
|
break;
|
1537
1521
|
}
|
1538
|
-
return /* @__PURE__ */
|
1522
|
+
return /* @__PURE__ */ l.jsx("li", { className: a === n.title ? "selected" : "", children: o }, Pa());
|
1539
1523
|
}
|
1540
|
-
function
|
1524
|
+
function Vi(t) {
|
1541
1525
|
const n = [], a = [];
|
1542
1526
|
t.components.forEach((s) => {
|
1543
|
-
s instanceof
|
1527
|
+
s instanceof Da ? n.push(Ia) : s instanceof Oe ? (n.push(La), a.push(Fa), Na(t)) : s instanceof Ya ? (n.push(Ga), a.push(Va)) : s instanceof Nn && n.push(Ha);
|
1544
1528
|
});
|
1545
1529
|
function e(s) {
|
1546
|
-
switch (n.forEach((
|
1530
|
+
switch (n.forEach((p) => p(t, s)), s.event) {
|
1547
1531
|
case "custom":
|
1548
1532
|
_.dispatchEvent({ type: j.CUSTOM, value: s.data });
|
1549
1533
|
break;
|
1550
1534
|
}
|
1551
1535
|
}
|
1552
|
-
function
|
1553
|
-
switch (a.forEach((
|
1536
|
+
function o(s) {
|
1537
|
+
switch (a.forEach((p) => p(t, s)), s.event) {
|
1554
1538
|
case "custom":
|
1555
1539
|
_.dispatchEvent({ type: j.CUSTOM, value: s.data });
|
1556
1540
|
break;
|
1557
1541
|
}
|
1558
1542
|
}
|
1559
1543
|
t.listen = (s) => {
|
1560
|
-
s.target === "editor" ?
|
1544
|
+
s.target === "editor" ? o(s) : e(s);
|
1561
1545
|
};
|
1562
1546
|
}
|
1563
|
-
const
|
1547
|
+
const ti = `out vec3 worldPosition;
|
1564
1548
|
uniform float uDistance;
|
1565
1549
|
|
1566
1550
|
void main() {
|
@@ -1569,7 +1553,7 @@ void main() {
|
|
1569
1553
|
worldPosition.xz += cameraPosition.xz;
|
1570
1554
|
|
1571
1555
|
gl_Position = projectionMatrix * modelViewMatrix * vec4(worldPosition, 1.0);
|
1572
|
-
}`,
|
1556
|
+
}`, ni = `out vec4 fragColor;
|
1573
1557
|
in vec3 worldPosition;
|
1574
1558
|
|
1575
1559
|
uniform float uDivisions;
|
@@ -1637,54 +1621,53 @@ void main() {
|
|
1637
1621
|
|
1638
1622
|
if (fragColor.a <= 0.0) discard;
|
1639
1623
|
}`;
|
1640
|
-
class
|
1624
|
+
class ai extends fn {
|
1641
1625
|
constructor(n) {
|
1642
1626
|
super({
|
1643
1627
|
extensions: {
|
1644
1628
|
derivatives: !0
|
1645
1629
|
},
|
1646
|
-
glslVersion:
|
1647
|
-
side:
|
1630
|
+
glslVersion: qn,
|
1631
|
+
side: hn,
|
1648
1632
|
transparent: !0,
|
1649
1633
|
uniforms: {
|
1650
1634
|
uScale: {
|
1651
|
-
value:
|
1635
|
+
value: n?.scale !== void 0 ? n?.scale : 0.1
|
1652
1636
|
},
|
1653
1637
|
uDivisions: {
|
1654
|
-
value:
|
1638
|
+
value: n?.divisions !== void 0 ? n?.divisions : 10
|
1655
1639
|
},
|
1656
1640
|
uColor: {
|
1657
|
-
value:
|
1641
|
+
value: n?.color !== void 0 ? n?.color : new Tt(16777215)
|
1658
1642
|
},
|
1659
1643
|
uDistance: {
|
1660
|
-
value:
|
1644
|
+
value: n?.distance !== void 0 ? n?.distance : 1e4
|
1661
1645
|
},
|
1662
1646
|
uSubgridOpacity: {
|
1663
|
-
value:
|
1647
|
+
value: n?.subgridOpacity !== void 0 ? n?.subgridOpacity : 0.15
|
1664
1648
|
},
|
1665
1649
|
uGridOpacity: {
|
1666
|
-
value:
|
1650
|
+
value: n?.gridOpacity !== void 0 ? n?.gridOpacity : 0.25
|
1667
1651
|
}
|
1668
1652
|
},
|
1669
|
-
vertexShader:
|
1670
|
-
fragmentShader:
|
1653
|
+
vertexShader: ti,
|
1654
|
+
fragmentShader: ni,
|
1671
1655
|
name: "InfiniteGrid",
|
1672
1656
|
depthWrite: !1
|
1673
1657
|
});
|
1674
1658
|
}
|
1675
1659
|
}
|
1676
|
-
class
|
1660
|
+
class ii extends Kn {
|
1661
|
+
gridMaterial;
|
1677
1662
|
constructor() {
|
1678
|
-
const
|
1679
|
-
super(new
|
1680
|
-
F(this, "gridMaterial");
|
1681
|
-
this.gridMaterial = a, this.frustumCulled = !1, this.name = "InfiniteGridHelper", this.position.y = 0.1;
|
1663
|
+
const n = new ai();
|
1664
|
+
super(new Xn(2, 2), n), this.gridMaterial = n, this.frustumCulled = !1, this.name = "InfiniteGridHelper", this.position.y = 0.1;
|
1682
1665
|
}
|
1683
1666
|
update() {
|
1684
1667
|
this.gridMaterial.needsUpdate = !0;
|
1685
1668
|
}
|
1686
1669
|
}
|
1687
|
-
const
|
1670
|
+
const ri = `#include <common>
|
1688
1671
|
#include <batching_pars_vertex>
|
1689
1672
|
#include <uv_pars_vertex>
|
1690
1673
|
#include <color_pars_vertex>
|
@@ -1714,7 +1697,7 @@ void main() {
|
|
1714
1697
|
#include <logdepthbuf_vertex>
|
1715
1698
|
#include <clipping_planes_vertex>
|
1716
1699
|
#include <worldpos_vertex>
|
1717
|
-
}`,
|
1700
|
+
}`, oi = `
|
1718
1701
|
#include <common>
|
1719
1702
|
#include <uv_pars_fragment>
|
1720
1703
|
#include <clipping_planes_pars_fragment>
|
@@ -1723,51 +1706,51 @@ void main() {
|
|
1723
1706
|
#include <clipping_planes_fragment>
|
1724
1707
|
gl_FragColor = vec4(vec3(vUv, 0.0), 1.0);
|
1725
1708
|
}`;
|
1726
|
-
class
|
1709
|
+
class si extends fn {
|
1727
1710
|
constructor() {
|
1728
1711
|
super({
|
1729
1712
|
defines: {
|
1730
1713
|
USE_UV: ""
|
1731
1714
|
},
|
1732
|
-
vertexShader:
|
1733
|
-
fragmentShader:
|
1715
|
+
vertexShader: ri,
|
1716
|
+
fragmentShader: oi
|
1734
1717
|
});
|
1735
1718
|
}
|
1736
1719
|
}
|
1737
|
-
function
|
1738
|
-
const [n, a] =
|
1739
|
-
return /* @__PURE__ */
|
1740
|
-
/* @__PURE__ */
|
1720
|
+
function Ht(t) {
|
1721
|
+
const [n, a] = oe(t.open !== void 0 ? t.open : !0), e = !n || t.children === void 0;
|
1722
|
+
return /* @__PURE__ */ l.jsxs("div", { className: `accordion ${e ? "hide" : ""}`, children: [
|
1723
|
+
/* @__PURE__ */ l.jsxs(
|
1741
1724
|
"button",
|
1742
1725
|
{
|
1743
1726
|
className: "toggle",
|
1744
1727
|
onClick: () => {
|
1745
|
-
const
|
1746
|
-
t.onToggle !== void 0 && t.onToggle(
|
1728
|
+
const o = !n;
|
1729
|
+
t.onToggle !== void 0 && t.onToggle(o), a(o);
|
1747
1730
|
},
|
1748
1731
|
children: [
|
1749
|
-
/* @__PURE__ */
|
1732
|
+
/* @__PURE__ */ l.jsx(
|
1750
1733
|
"p",
|
1751
1734
|
{
|
1752
1735
|
className: `status ${n ? "open" : ""}`,
|
1753
1736
|
children: "Toggle"
|
1754
1737
|
}
|
1755
1738
|
),
|
1756
|
-
/* @__PURE__ */
|
1739
|
+
/* @__PURE__ */ l.jsx("p", { className: "label", children: lt(t.label) })
|
1757
1740
|
]
|
1758
1741
|
}
|
1759
1742
|
),
|
1760
1743
|
t.button,
|
1761
|
-
/* @__PURE__ */
|
1744
|
+
/* @__PURE__ */ l.jsx("div", { className: n ? "open" : "", children: /* @__PURE__ */ l.jsx("div", { children: t.children }) })
|
1762
1745
|
] });
|
1763
1746
|
}
|
1764
|
-
function
|
1765
|
-
const [n, a] =
|
1747
|
+
function Bn(t) {
|
1748
|
+
const [n, a] = oe(!1), e = t.child.children.length > 0, o = [];
|
1766
1749
|
return t.child.children.length > 0 && t.child.children.map((s) => {
|
1767
|
-
|
1768
|
-
}), /* @__PURE__ */
|
1769
|
-
/* @__PURE__ */
|
1770
|
-
e ? /* @__PURE__ */
|
1750
|
+
o.push(/* @__PURE__ */ l.jsx(Bn, { child: s, three: t.three }, Math.random()));
|
1751
|
+
}), /* @__PURE__ */ l.jsxs("div", { className: "childObject", children: [
|
1752
|
+
/* @__PURE__ */ l.jsxs("div", { className: "child", children: [
|
1753
|
+
e ? /* @__PURE__ */ l.jsx(
|
1771
1754
|
"button",
|
1772
1755
|
{
|
1773
1756
|
className: "status",
|
@@ -1779,7 +1762,7 @@ function $n(t) {
|
|
1779
1762
|
}
|
1780
1763
|
}
|
1781
1764
|
) : null,
|
1782
|
-
/* @__PURE__ */
|
1765
|
+
/* @__PURE__ */ l.jsx(
|
1783
1766
|
"button",
|
1784
1767
|
{
|
1785
1768
|
className: "name",
|
@@ -1792,29 +1775,29 @@ function $n(t) {
|
|
1792
1775
|
children: t.child.name.length > 0 ? `${t.child.name} (${t.child.type})` : `${t.child.type}::${t.child.uuid}`
|
1793
1776
|
}
|
1794
1777
|
),
|
1795
|
-
/* @__PURE__ */
|
1778
|
+
/* @__PURE__ */ l.jsx("div", { className: `icon ${Ba(t.child)}` })
|
1796
1779
|
] }),
|
1797
|
-
/* @__PURE__ */
|
1780
|
+
/* @__PURE__ */ l.jsx("div", { className: n ? "open" : "", children: /* @__PURE__ */ l.jsx("div", { className: "container", children: o }) })
|
1798
1781
|
] }, Math.random());
|
1799
1782
|
}
|
1800
|
-
function
|
1783
|
+
function ci(t) {
|
1801
1784
|
const n = [];
|
1802
1785
|
return t.child.children.map((a) => {
|
1803
|
-
n.push(/* @__PURE__ */
|
1804
|
-
}), /* @__PURE__ */
|
1786
|
+
n.push(/* @__PURE__ */ l.jsx(Bn, { child: a, three: t.three }, Math.random()));
|
1787
|
+
}), /* @__PURE__ */ l.jsx("div", { className: `scene ${t.class !== void 0 ? t.class : ""}`, children: n });
|
1805
1788
|
}
|
1806
|
-
const
|
1807
|
-
function
|
1789
|
+
const li = "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAADIAAAAyCAYAAAAeP4ixAAAACXBIWXMAAAsTAAALEwEAmpwYAAAA5klEQVRoge2Y0Q6EIAwE6cX//+X6cCFpSMEKVTdk501OpRNKiyelFC0b8Ps6gCwoggZF0KAIGhRBgyJoUAQNiqCxjciR9SLV//eZiAyvK3U8i/QVaQO2YyLSFVvlkdTKDjJCukh2ykR5ZEW+kHmlatl90RaBtDkK/w7CYhuRUEO0ee3l+J3m55Vm+17vtwjTnV1V3QA8qfbeUXCzRWDpiLLS+OyzvRW7IzW9R+okvclsqR09743bo0yUpc1+lSJvNsa002+Euk9GKzV7SmZDRIMiaFAEDYqgQRE0KIIGRdCgCBoUQeMEMERadX7YUz8AAAAASUVORK5CYII=";
|
1790
|
+
function ui(t) {
|
1808
1791
|
return "items" in t;
|
1809
1792
|
}
|
1810
1793
|
function Ue(t) {
|
1811
1794
|
const n = [];
|
1812
1795
|
return t.items.forEach((a) => {
|
1813
|
-
|
1814
|
-
/* @__PURE__ */
|
1796
|
+
ui(a) ? n.push(
|
1797
|
+
/* @__PURE__ */ l.jsx(Ue, { title: lt(a.title), items: a.items }, Math.random())
|
1815
1798
|
) : n.push(
|
1816
|
-
/* @__PURE__ */
|
1817
|
-
|
1799
|
+
/* @__PURE__ */ l.jsx(
|
1800
|
+
st,
|
1818
1801
|
{
|
1819
1802
|
title: a.title,
|
1820
1803
|
prop: a.prop,
|
@@ -1825,16 +1808,16 @@ function Ue(t) {
|
|
1825
1808
|
step: a.step,
|
1826
1809
|
disabled: a.disabled,
|
1827
1810
|
options: a.options,
|
1828
|
-
onChange: (e,
|
1829
|
-
a.onChange !== void 0 && a.onChange(e,
|
1811
|
+
onChange: (e, o) => {
|
1812
|
+
a.onChange !== void 0 && a.onChange(e, o);
|
1830
1813
|
}
|
1831
1814
|
},
|
1832
1815
|
Math.random()
|
1833
1816
|
)
|
1834
1817
|
);
|
1835
|
-
}), /* @__PURE__ */
|
1818
|
+
}), /* @__PURE__ */ l.jsx(Ht, { label: t.title, open: t.expanded === !0, children: n });
|
1836
1819
|
}
|
1837
|
-
function
|
1820
|
+
function di(t) {
|
1838
1821
|
return !(t === "alphaHash" || t === "alphaToCoverage" || t === "attenuationDistance" || t === "blendDstAlpha" || t === "colorWrite" || t === "combine" || t === "defaultAttributeValues" || t === "depthFunc" || t === "forceSinglePass" || t === "glslVersion" || t === "linecap" || t === "linejoin" || t === "linewidth" || t === "normalMapType" || t === "precision" || t === "premultipliedAlpha" || t === "shadowSide" || t === "toneMapped" || t === "uniformsGroups" || t === "uniformsNeedUpdate" || t === "userData" || t === "vertexColors" || t === "version" || t === "wireframeLinecap" || t === "wireframeLinejoin" || t === "wireframeLinewidth" || t.slice(0, 4) === "clip" || t.slice(0, 7) === "polygon" || t.slice(0, 7) === "stencil" || t.slice(0, 2) === "is");
|
1839
1822
|
}
|
1840
1823
|
function Ie(t) {
|
@@ -2010,393 +1993,383 @@ function Ie(t) {
|
|
2010
1993
|
}
|
2011
1994
|
return t;
|
2012
1995
|
}
|
2013
|
-
function
|
1996
|
+
function fi(t) {
|
2014
1997
|
return t.toLowerCase().search("intensity") > -1 || t === "anisotropyRotation" || t === "blendAlpha" || t === "bumpScale" || t === "clearcoatRoughness" || t === "displacementBias" || t === "displacementScale" || t === "metalness" || t === "opacity" || t === "reflectivity" || t === "refractionRatio" || t === "roughness" || t === "sheenRoughness" || t === "thickness";
|
2015
1998
|
}
|
2016
|
-
function
|
1999
|
+
function hi() {
|
2017
2000
|
const t = document.createElement("input");
|
2018
2001
|
return t.type = "file", new Promise((n, a) => {
|
2019
2002
|
t.addEventListener("change", function() {
|
2020
2003
|
if (t.files === null)
|
2021
2004
|
a();
|
2022
2005
|
else {
|
2023
|
-
const e = t.files[0],
|
2024
|
-
|
2006
|
+
const e = t.files[0], o = new FileReader();
|
2007
|
+
o.onload = function(s) {
|
2025
2008
|
n(s.target.result);
|
2026
|
-
},
|
2009
|
+
}, o.readAsDataURL(e);
|
2027
2010
|
}
|
2028
2011
|
}), t.click();
|
2029
2012
|
});
|
2030
2013
|
}
|
2031
|
-
const
|
2014
|
+
const pi = [
|
2032
2015
|
{
|
2033
2016
|
title: "Front",
|
2034
|
-
value:
|
2017
|
+
value: Zn
|
2035
2018
|
},
|
2036
2019
|
{
|
2037
2020
|
title: "Back",
|
2038
|
-
value:
|
2021
|
+
value: Jn
|
2039
2022
|
},
|
2040
2023
|
{
|
2041
2024
|
title: "Double",
|
2042
|
-
value:
|
2025
|
+
value: hn
|
2043
2026
|
}
|
2044
|
-
],
|
2027
|
+
], mi = [
|
2045
2028
|
{
|
2046
2029
|
title: "No Blending",
|
2047
|
-
value:
|
2030
|
+
value: Qn
|
2048
2031
|
},
|
2049
2032
|
{
|
2050
2033
|
title: "Normal",
|
2051
|
-
value:
|
2034
|
+
value: ea
|
2052
2035
|
},
|
2053
2036
|
{
|
2054
2037
|
title: "Additive",
|
2055
|
-
value:
|
2038
|
+
value: ta
|
2056
2039
|
},
|
2057
2040
|
{
|
2058
2041
|
title: "Subtractive",
|
2059
|
-
value:
|
2042
|
+
value: na
|
2060
2043
|
},
|
2061
2044
|
{
|
2062
2045
|
title: "Multiply",
|
2063
|
-
value:
|
2046
|
+
value: aa
|
2064
2047
|
},
|
2065
2048
|
{
|
2066
2049
|
title: "Custom",
|
2067
|
-
value:
|
2050
|
+
value: ia
|
2068
2051
|
}
|
2069
|
-
],
|
2052
|
+
], vi = [
|
2070
2053
|
{
|
2071
2054
|
title: "Add",
|
2072
|
-
value:
|
2055
|
+
value: ra
|
2073
2056
|
},
|
2074
2057
|
{
|
2075
2058
|
title: "Subtract",
|
2076
|
-
value:
|
2059
|
+
value: oa
|
2077
2060
|
},
|
2078
2061
|
{
|
2079
2062
|
title: "Reverse Subtract",
|
2080
|
-
value:
|
2063
|
+
value: sa
|
2081
2064
|
},
|
2082
2065
|
{
|
2083
2066
|
title: "Min",
|
2084
|
-
value:
|
2067
|
+
value: ca
|
2085
2068
|
},
|
2086
2069
|
{
|
2087
2070
|
title: "Max",
|
2088
|
-
value:
|
2071
|
+
value: la
|
2089
2072
|
}
|
2090
|
-
],
|
2073
|
+
], gi = [
|
2091
2074
|
{
|
2092
2075
|
title: "Zero",
|
2093
|
-
valye:
|
2076
|
+
valye: pn
|
2094
2077
|
},
|
2095
2078
|
{
|
2096
2079
|
title: "One",
|
2097
|
-
valye:
|
2080
|
+
valye: mn
|
2098
2081
|
},
|
2099
2082
|
{
|
2100
2083
|
title: "Src Color",
|
2101
|
-
valye:
|
2084
|
+
valye: vn
|
2102
2085
|
},
|
2103
2086
|
{
|
2104
2087
|
title: "One Minus Src Color",
|
2105
|
-
valye:
|
2088
|
+
valye: gn
|
2106
2089
|
},
|
2107
2090
|
{
|
2108
2091
|
title: "Src Alpha",
|
2109
|
-
valye:
|
2092
|
+
valye: bn
|
2110
2093
|
},
|
2111
2094
|
{
|
2112
2095
|
title: "One Minus Src Alpha",
|
2113
|
-
valye:
|
2096
|
+
valye: yn
|
2114
2097
|
},
|
2115
2098
|
{
|
2116
2099
|
title: "Dst Alpha",
|
2117
|
-
valye:
|
2100
|
+
valye: En
|
2118
2101
|
},
|
2119
2102
|
{
|
2120
2103
|
title: "One Minus Dst Alpha",
|
2121
|
-
valye:
|
2104
|
+
valye: Cn
|
2122
2105
|
},
|
2123
2106
|
{
|
2124
2107
|
title: "Dst Color",
|
2125
|
-
valye:
|
2108
|
+
valye: xn
|
2126
2109
|
},
|
2127
2110
|
{
|
2128
2111
|
title: "One Minus Dst Color",
|
2129
|
-
valye:
|
2112
|
+
valye: Sn
|
2130
2113
|
},
|
2131
2114
|
{
|
2132
2115
|
title: "Src Alpha Saturate",
|
2133
|
-
valye:
|
2116
|
+
valye: ua
|
2134
2117
|
},
|
2135
2118
|
{
|
2136
2119
|
title: "Constant Color",
|
2137
|
-
valye:
|
2120
|
+
valye: wn
|
2138
2121
|
},
|
2139
2122
|
{
|
2140
2123
|
title: "One Minus Constant Color",
|
2141
|
-
valye:
|
2124
|
+
valye: On
|
2142
2125
|
},
|
2143
2126
|
{
|
2144
2127
|
title: "Constant Alpha",
|
2145
|
-
valye:
|
2128
|
+
valye: Mn
|
2146
2129
|
},
|
2147
2130
|
{
|
2148
2131
|
title: "One Minus Constant Alpha",
|
2149
|
-
valye:
|
2132
|
+
valye: Tn
|
2150
2133
|
}
|
2151
|
-
],
|
2134
|
+
], bi = [
|
2152
2135
|
{
|
2153
2136
|
title: "Zero",
|
2154
|
-
valye:
|
2137
|
+
valye: pn
|
2155
2138
|
},
|
2156
2139
|
{
|
2157
2140
|
title: "One",
|
2158
|
-
valye:
|
2141
|
+
valye: mn
|
2159
2142
|
},
|
2160
2143
|
{
|
2161
2144
|
title: "Src Color",
|
2162
|
-
valye:
|
2145
|
+
valye: vn
|
2163
2146
|
},
|
2164
2147
|
{
|
2165
2148
|
title: "One Minus Src Color",
|
2166
|
-
valye:
|
2149
|
+
valye: gn
|
2167
2150
|
},
|
2168
2151
|
{
|
2169
2152
|
title: "Src Alpha",
|
2170
|
-
valye:
|
2153
|
+
valye: bn
|
2171
2154
|
},
|
2172
2155
|
{
|
2173
2156
|
title: "One Minus Src Alpha",
|
2174
|
-
valye:
|
2157
|
+
valye: yn
|
2175
2158
|
},
|
2176
2159
|
{
|
2177
2160
|
title: "Dst Alpha",
|
2178
|
-
valye:
|
2161
|
+
valye: En
|
2179
2162
|
},
|
2180
2163
|
{
|
2181
2164
|
title: "One Minus Dst Alpha",
|
2182
|
-
valye:
|
2165
|
+
valye: Cn
|
2183
2166
|
},
|
2184
2167
|
{
|
2185
2168
|
title: "Dst Color",
|
2186
|
-
valye:
|
2169
|
+
valye: xn
|
2187
2170
|
},
|
2188
2171
|
{
|
2189
2172
|
title: "One Minus Dst Color",
|
2190
|
-
valye:
|
2173
|
+
valye: Sn
|
2191
2174
|
},
|
2192
2175
|
{
|
2193
2176
|
title: "Constant Color",
|
2194
|
-
valye:
|
2177
|
+
valye: wn
|
2195
2178
|
},
|
2196
2179
|
{
|
2197
2180
|
title: "One Minus Constant Color",
|
2198
|
-
valye:
|
2181
|
+
valye: On
|
2199
2182
|
},
|
2200
2183
|
{
|
2201
2184
|
title: "Constant Alpha",
|
2202
|
-
valye:
|
2185
|
+
valye: Mn
|
2203
2186
|
},
|
2204
2187
|
{
|
2205
2188
|
title: "One Minus Constant Alpha",
|
2206
|
-
valye:
|
2189
|
+
valye: Tn
|
2207
2190
|
}
|
2208
2191
|
];
|
2209
|
-
function
|
2192
|
+
function ot(t, n) {
|
2210
2193
|
t.needsUpdate = !0, t.type = "option", t.options = n;
|
2211
2194
|
}
|
2212
|
-
function
|
2195
|
+
function en(t, n, a) {
|
2213
2196
|
const e = [];
|
2214
|
-
for (const
|
2215
|
-
if (!
|
2197
|
+
for (const o in t) {
|
2198
|
+
if (!di(o))
|
2216
2199
|
continue;
|
2217
|
-
const s = typeof t[
|
2200
|
+
const s = typeof t[o], p = t[o];
|
2218
2201
|
if (s === "boolean" || s === "number" || s === "string") {
|
2219
2202
|
const c = {
|
2220
|
-
title: Ie(
|
2221
|
-
prop:
|
2203
|
+
title: Ie(o),
|
2204
|
+
prop: o,
|
2222
2205
|
type: s,
|
2223
|
-
value:
|
2206
|
+
value: p,
|
2224
2207
|
min: void 0,
|
2225
2208
|
max: void 0,
|
2226
2209
|
needsUpdate: s === "boolean",
|
2227
|
-
onChange: (d,
|
2228
|
-
|
2229
|
-
|
2230
|
-
|
2231
|
-
m !== void 0 && ne(m, `material.${d}`, b);
|
2210
|
+
onChange: (d, v) => {
|
2211
|
+
a.updateObject(n.uuid, `material.${d}`, v), c.needsUpdate && a.updateObject(n.uuid, "material.needsUpdate", !0);
|
2212
|
+
const b = a.scene?.getObjectByProperty("uuid", n.uuid);
|
2213
|
+
b !== void 0 && ee(b, `material.${d}`, v);
|
2232
2214
|
}
|
2233
2215
|
};
|
2234
|
-
switch (
|
2216
|
+
switch (o) {
|
2235
2217
|
case "blending":
|
2236
|
-
|
2218
|
+
ot(c, mi);
|
2237
2219
|
break;
|
2238
2220
|
case "blendDst":
|
2239
|
-
|
2221
|
+
ot(c, bi);
|
2240
2222
|
break;
|
2241
2223
|
case "blendEquation":
|
2242
|
-
|
2224
|
+
ot(c, vi);
|
2243
2225
|
break;
|
2244
2226
|
case "blendSrc":
|
2245
|
-
|
2227
|
+
ot(c, gi);
|
2246
2228
|
break;
|
2247
2229
|
case "side":
|
2248
|
-
|
2230
|
+
ot(c, pi);
|
2249
2231
|
break;
|
2250
2232
|
}
|
2251
|
-
|
2252
|
-
const
|
2253
|
-
|
2254
|
-
c.latest =
|
2255
|
-
}), e.push(c),
|
2256
|
-
title: `${
|
2233
|
+
fi(o) && (c.value = Number(p), c.type = "range", c.min = 0, c.max = 1, c.step = 0.01);
|
2234
|
+
const u = s === "string" && (o === "vertexShader" || o === "fragmentShader");
|
2235
|
+
u && (c.disabled = !1, c.latest = c.value, c.onChange = (d, v) => {
|
2236
|
+
c.latest = v;
|
2237
|
+
}), e.push(c), u && e.push({
|
2238
|
+
title: `${lt(o)} - Update`,
|
2257
2239
|
type: "button",
|
2258
2240
|
onChange: () => {
|
2259
|
-
|
2260
|
-
|
2261
|
-
|
2262
|
-
d !== void 0 && (ne(d, `material.${r}`, c.latest), d.material.needsUpdate = !0);
|
2241
|
+
a.updateObject(n.uuid, `material.${o}`, c.latest), a.updateObject(n.uuid, "material.needsUpdate", !0);
|
2242
|
+
const d = a.scene?.getObjectByProperty("uuid", n.uuid);
|
2243
|
+
d !== void 0 && (ee(d, `material.${o}`, c.latest), d.material.needsUpdate = !0);
|
2263
2244
|
}
|
2264
2245
|
});
|
2265
2246
|
} else if (s === "object")
|
2266
|
-
if (
|
2247
|
+
if (p.isColor)
|
2267
2248
|
e.push({
|
2268
|
-
title: Ie(
|
2269
|
-
prop:
|
2249
|
+
title: Ie(o),
|
2250
|
+
prop: o,
|
2270
2251
|
type: "color",
|
2271
|
-
value:
|
2272
|
-
onChange: (c,
|
2273
|
-
|
2274
|
-
const d = new Pt(l);
|
2252
|
+
value: p,
|
2253
|
+
onChange: (c, u) => {
|
2254
|
+
const d = new Tt(u);
|
2275
2255
|
a.updateObject(n.uuid, `material.${c}`, d);
|
2276
|
-
const
|
2277
|
-
|
2256
|
+
const v = a.scene?.getObjectByProperty("uuid", n.uuid);
|
2257
|
+
v !== void 0 && ee(v, `material.${c}`, d);
|
2278
2258
|
}
|
2279
2259
|
});
|
2280
|
-
else if (Array.isArray(
|
2260
|
+
else if (Array.isArray(p)) {
|
2281
2261
|
const c = [];
|
2282
|
-
for (const
|
2262
|
+
for (const u in p)
|
2283
2263
|
c.push({
|
2284
|
-
title: `${
|
2285
|
-
type: `${typeof
|
2286
|
-
value:
|
2287
|
-
onChange: (d,
|
2288
|
-
|
2289
|
-
a.
|
2290
|
-
|
2291
|
-
m !== void 0 && ne(m, `material.${r}`, b);
|
2264
|
+
title: `${u}`,
|
2265
|
+
type: `${typeof p[u]}`,
|
2266
|
+
value: p[u],
|
2267
|
+
onChange: (d, v) => {
|
2268
|
+
a.updateObject(n.uuid, `material.${o}`, v);
|
2269
|
+
const b = a.scene?.getObjectByProperty("uuid", n.uuid);
|
2270
|
+
b !== void 0 && ee(b, `material.${o}`, v);
|
2292
2271
|
}
|
2293
2272
|
});
|
2294
2273
|
e.push({
|
2295
|
-
title: Ie(
|
2274
|
+
title: Ie(o),
|
2296
2275
|
items: c
|
2297
2276
|
});
|
2298
2277
|
} else {
|
2299
2278
|
const c = [];
|
2300
|
-
for (const
|
2301
|
-
const d =
|
2279
|
+
for (const u in p) {
|
2280
|
+
const d = p[u];
|
2302
2281
|
switch (typeof d) {
|
2303
2282
|
case "boolean":
|
2304
2283
|
case "number":
|
2305
2284
|
case "string":
|
2306
|
-
|
2307
|
-
title: Ie(
|
2285
|
+
u === "src" ? e.push({
|
2286
|
+
title: Ie(o),
|
2308
2287
|
type: "image",
|
2309
2288
|
value: d,
|
2310
|
-
onChange: (
|
2311
|
-
|
2312
|
-
a.
|
2313
|
-
|
2314
|
-
|
2315
|
-
ne(S, `material.${r}`, T), ne(S, "material.needsUpdate", !0);
|
2289
|
+
onChange: (b, E) => {
|
2290
|
+
a.createTexture(n.uuid, `material.${o}`, E);
|
2291
|
+
const x = a.scene?.getObjectByProperty("uuid", n.uuid);
|
2292
|
+
x !== void 0 && Gt(E).then((M) => {
|
2293
|
+
ee(x, `material.${o}`, M), ee(x, "material.needsUpdate", !0);
|
2316
2294
|
});
|
2317
2295
|
}
|
2318
2296
|
}) : c.push({
|
2319
|
-
title: `${Ie(
|
2320
|
-
prop: `material.${
|
2321
|
-
type: `${typeof t[
|
2322
|
-
value:
|
2323
|
-
onChange: (
|
2324
|
-
|
2325
|
-
a.
|
2326
|
-
|
2327
|
-
S !== void 0 && ne(S, `material.${r}.${l}`, E);
|
2297
|
+
title: `${Ie(u)}`,
|
2298
|
+
prop: `material.${o}.${u}`,
|
2299
|
+
type: `${typeof t[o][u]}`,
|
2300
|
+
value: p[u],
|
2301
|
+
onChange: (b, E) => {
|
2302
|
+
a.updateObject(n.uuid, `material.${o}.${u}`, E);
|
2303
|
+
const x = a.scene?.getObjectByProperty("uuid", n.uuid);
|
2304
|
+
x !== void 0 && ee(x, `material.${o}.${u}`, E);
|
2328
2305
|
}
|
2329
2306
|
});
|
2330
2307
|
break;
|
2331
2308
|
case "object":
|
2332
2309
|
if (d.value !== void 0 && d.value.src !== void 0)
|
2333
2310
|
c.push({
|
2334
|
-
title: Ie(
|
2311
|
+
title: Ie(u),
|
2335
2312
|
type: "image",
|
2336
2313
|
value: d.value.src,
|
2337
|
-
onChange: (
|
2338
|
-
|
2339
|
-
a.
|
2340
|
-
|
2341
|
-
|
2342
|
-
ne(S, `material.${r}.${l}.value`, T);
|
2314
|
+
onChange: (b, E) => {
|
2315
|
+
a.createTexture(n.uuid, `material.${o}.${u}.value`, p);
|
2316
|
+
const x = a.scene?.getObjectByProperty("uuid", n.uuid);
|
2317
|
+
x !== void 0 && Gt(E).then((M) => {
|
2318
|
+
ee(x, `material.${o}.${u}.value`, M);
|
2343
2319
|
});
|
2344
2320
|
}
|
2345
2321
|
});
|
2346
|
-
else if (
|
2347
|
-
const
|
2348
|
-
title:
|
2322
|
+
else if (o === "uniforms") {
|
2323
|
+
const b = d.value, E = (x, M, k) => ({
|
2324
|
+
title: x,
|
2349
2325
|
type: "number",
|
2350
|
-
value:
|
2326
|
+
value: k,
|
2351
2327
|
step: 0.01,
|
2352
|
-
onChange: (
|
2353
|
-
|
2354
|
-
|
2355
|
-
a.
|
2356
|
-
|
2357
|
-
G !== void 0 && ne(G, w, I);
|
2328
|
+
onChange: (H, B) => {
|
2329
|
+
const S = `material.uniforms.${u}.value.${M}`;
|
2330
|
+
a.updateObject(n.uuid, S, B);
|
2331
|
+
const z = a.scene?.getObjectByProperty("uuid", n.uuid);
|
2332
|
+
z !== void 0 && ee(z, S, B);
|
2358
2333
|
}
|
2359
2334
|
});
|
2360
2335
|
if (typeof d.value == "number")
|
2361
2336
|
c.push({
|
2362
|
-
title:
|
2337
|
+
title: u,
|
2363
2338
|
type: "number",
|
2364
2339
|
value: d.value,
|
2365
|
-
onChange: (
|
2366
|
-
|
2367
|
-
|
2368
|
-
a.
|
2369
|
-
|
2370
|
-
W !== void 0 && ne(W, T, x);
|
2340
|
+
onChange: (x, M) => {
|
2341
|
+
const k = `material.${o}.${x}.value`;
|
2342
|
+
a.updateObject(n.uuid, k, M);
|
2343
|
+
const H = a.scene?.getObjectByProperty("uuid", n.uuid);
|
2344
|
+
H !== void 0 && ee(H, k, M);
|
2371
2345
|
}
|
2372
2346
|
});
|
2373
|
-
else if (
|
2347
|
+
else if (b.r !== void 0 && b.g !== void 0 && b.b !== void 0)
|
2374
2348
|
c.push({
|
2375
|
-
title:
|
2349
|
+
title: u,
|
2376
2350
|
type: "color",
|
2377
2351
|
value: d.value,
|
2378
|
-
onChange: (
|
2379
|
-
|
2380
|
-
|
2381
|
-
a.
|
2382
|
-
|
2383
|
-
I !== void 0 && ne(I, W, T);
|
2352
|
+
onChange: (x, M) => {
|
2353
|
+
const k = new Tt(M), H = `material.${o}.${x}.value`;
|
2354
|
+
a.updateObject(n.uuid, H, k);
|
2355
|
+
const B = a.scene?.getObjectByProperty("uuid", n.uuid);
|
2356
|
+
B !== void 0 && ee(B, H, k);
|
2384
2357
|
}
|
2385
2358
|
});
|
2386
|
-
else if (
|
2359
|
+
else if (b.x !== void 0 && b.y !== void 0 && b.z === void 0 && b.w === void 0)
|
2387
2360
|
c.push(
|
2388
2361
|
{
|
2389
|
-
title:
|
2362
|
+
title: u,
|
2390
2363
|
items: [
|
2391
2364
|
E("X", "x", d.value.x),
|
2392
2365
|
E("Y", "y", d.value.y)
|
2393
2366
|
]
|
2394
2367
|
}
|
2395
2368
|
);
|
2396
|
-
else if (
|
2369
|
+
else if (b.x !== void 0 && b.y !== void 0 && b.z !== void 0 && b.w === void 0)
|
2397
2370
|
c.push(
|
2398
2371
|
{
|
2399
|
-
title:
|
2372
|
+
title: u,
|
2400
2373
|
items: [
|
2401
2374
|
E("X", "x", d.value.x),
|
2402
2375
|
E("Y", "y", d.value.y),
|
@@ -2404,10 +2377,10 @@ function nn(t, n, a) {
|
|
2404
2377
|
]
|
2405
2378
|
}
|
2406
2379
|
);
|
2407
|
-
else if (
|
2380
|
+
else if (b.x !== void 0 && b.y !== void 0 && b.z !== void 0 && b.w !== void 0)
|
2408
2381
|
c.push(
|
2409
2382
|
{
|
2410
|
-
title:
|
2383
|
+
title: u,
|
2411
2384
|
items: [
|
2412
2385
|
E("X", "x", d.value.x),
|
2413
2386
|
E("Y", "y", d.value.y),
|
@@ -2416,42 +2389,41 @@ function nn(t, n, a) {
|
|
2416
2389
|
]
|
2417
2390
|
}
|
2418
2391
|
);
|
2419
|
-
else if (
|
2420
|
-
const
|
2421
|
-
for (let
|
2422
|
-
|
2392
|
+
else if (b.elements !== void 0) {
|
2393
|
+
const x = b.elements, M = [];
|
2394
|
+
for (let k = 0; k < x.length; k++)
|
2395
|
+
M.push(E(k.toString(), k.toString(), x[k]));
|
2423
2396
|
c.push(
|
2424
2397
|
{
|
2425
|
-
title:
|
2426
|
-
items:
|
2398
|
+
title: u,
|
2399
|
+
items: M
|
2427
2400
|
}
|
2428
2401
|
);
|
2429
2402
|
} else
|
2430
|
-
console.log(">>> need to add this format:",
|
2403
|
+
console.log(">>> need to add this format:", u, b);
|
2431
2404
|
} else
|
2432
2405
|
c.push({
|
2433
|
-
title:
|
2406
|
+
title: u,
|
2434
2407
|
type: `${typeof d.value}`,
|
2435
2408
|
value: d.value,
|
2436
|
-
onChange: (
|
2437
|
-
|
2438
|
-
a.
|
2439
|
-
|
2440
|
-
S !== void 0 && ne(S, `material.${r}.${l}.value`, E);
|
2409
|
+
onChange: (b, E) => {
|
2410
|
+
a.updateObject(n.uuid, `material.${o}.${u}.value`, E);
|
2411
|
+
const x = a.scene?.getObjectByProperty("uuid", n.uuid);
|
2412
|
+
x !== void 0 && ee(x, `material.${o}.${u}.value`, E);
|
2441
2413
|
}
|
2442
2414
|
});
|
2443
2415
|
break;
|
2444
2416
|
}
|
2445
2417
|
}
|
2446
2418
|
c.length > 0 && e.push({
|
2447
|
-
title: Ie(
|
2419
|
+
title: Ie(o),
|
2448
2420
|
items: c
|
2449
2421
|
});
|
2450
2422
|
}
|
2451
2423
|
else
|
2452
|
-
|
2424
|
+
p !== void 0 && console.log("other:", o, s, p);
|
2453
2425
|
}
|
2454
|
-
return e.sort((
|
2426
|
+
return e.sort((o, s) => o.title < s.title ? -1 : o.title > s.title ? 1 : 0), e.push({
|
2455
2427
|
title: "Update Material",
|
2456
2428
|
type: "button",
|
2457
2429
|
onChange: () => {
|
@@ -2459,64 +2431,61 @@ function nn(t, n, a) {
|
|
2459
2431
|
}
|
2460
2432
|
}), e;
|
2461
2433
|
}
|
2462
|
-
function
|
2434
|
+
function yi(t, n) {
|
2463
2435
|
const a = t.material;
|
2464
2436
|
if (Array.isArray(a)) {
|
2465
|
-
const e = [],
|
2466
|
-
for (let s = 0; s <
|
2437
|
+
const e = [], o = a.length;
|
2438
|
+
for (let s = 0; s < o; s++)
|
2467
2439
|
e.push(
|
2468
|
-
/* @__PURE__ */
|
2440
|
+
/* @__PURE__ */ l.jsx(
|
2469
2441
|
Ue,
|
2470
2442
|
{
|
2471
2443
|
title: `Material ${s}`,
|
2472
|
-
items:
|
2444
|
+
items: en(a[s], t, n)
|
2473
2445
|
},
|
2474
2446
|
`Material ${s}`
|
2475
2447
|
)
|
2476
2448
|
);
|
2477
|
-
return /* @__PURE__ */
|
2449
|
+
return /* @__PURE__ */ l.jsx(l.Fragment, { children: e });
|
2478
2450
|
} else
|
2479
|
-
return /* @__PURE__ */
|
2451
|
+
return /* @__PURE__ */ l.jsx(
|
2480
2452
|
Ue,
|
2481
2453
|
{
|
2482
2454
|
title: "Material",
|
2483
|
-
items:
|
2455
|
+
items: en(a, t, n)
|
2484
2456
|
}
|
2485
2457
|
);
|
2486
2458
|
}
|
2487
|
-
function
|
2488
|
-
var b;
|
2459
|
+
function st(t) {
|
2489
2460
|
let n = t.value;
|
2490
|
-
n !== void 0 && n.isColor !== void 0 && (n =
|
2491
|
-
const [a, e] =
|
2461
|
+
n !== void 0 && n.isColor !== void 0 && (n = ka(t.value));
|
2462
|
+
const [a, e] = oe(n), o = ye(null), s = ye(null), p = ye(null);
|
2492
2463
|
Be(() => {
|
2493
|
-
|
2494
|
-
|
2495
|
-
|
2496
|
-
|
2497
|
-
|
2498
|
-
if (!m)
|
2464
|
+
let v = !1, b = -1, E = 0, x = Number(a);
|
2465
|
+
const M = (z) => {
|
2466
|
+
v = !0, E = x, b = z.clientX;
|
2467
|
+
}, k = (z) => {
|
2468
|
+
if (!v)
|
2499
2469
|
return;
|
2500
|
-
const
|
2501
|
-
x = Number((
|
2502
|
-
},
|
2503
|
-
|
2504
|
-
},
|
2505
|
-
|
2506
|
-
},
|
2507
|
-
return
|
2508
|
-
|
2509
|
-
G && ((te = r.current) == null || te.removeEventListener("mousedown", T), document.removeEventListener("mouseup", I), document.removeEventListener("mousemove", W), document.removeEventListener("contextmenu", w));
|
2470
|
+
const Ee = t.step !== void 0 ? t.step : 1, le = (z.clientX - b) * Ee;
|
2471
|
+
x = Number((E + le).toFixed(4)), s.current !== null && (s.current.value = x.toString()), t.onChange !== void 0 && t.onChange(t.prop !== void 0 ? t.prop : t.title, x);
|
2472
|
+
}, H = () => {
|
2473
|
+
v = !1;
|
2474
|
+
}, B = () => {
|
2475
|
+
v = !1;
|
2476
|
+
}, S = t.type === "number";
|
2477
|
+
return S && (o.current?.addEventListener("mousedown", M, !1), document.addEventListener("mouseup", H, !1), document.addEventListener("mousemove", k, !1), document.addEventListener("contextmenu", B, !1)), () => {
|
2478
|
+
S && (o.current?.removeEventListener("mousedown", M), document.removeEventListener("mouseup", H), document.removeEventListener("mousemove", k), document.removeEventListener("contextmenu", B));
|
2510
2479
|
};
|
2511
2480
|
}, [a]);
|
2512
2481
|
const c = t.type === "string" && (a.length > 100 || a.search(`
|
2513
|
-
`) > -1),
|
2514
|
-
let
|
2515
|
-
t.type === "boolean" ?
|
2482
|
+
`) > -1), u = c || t.type === "image", d = (v) => {
|
2483
|
+
let b = v.target.value;
|
2484
|
+
t.type === "boolean" ? b = v.target.checked : t.type === "option" && (b = t.options[b].value), e(b), t.onChange !== void 0 && t.onChange(t.prop !== void 0 ? t.prop : t.title, b);
|
2516
2485
|
};
|
2517
|
-
return /* @__PURE__ */
|
2518
|
-
t.type !== "button" && /* @__PURE__ */
|
2519
|
-
t.type === "string" && !c && /* @__PURE__ */
|
2486
|
+
return /* @__PURE__ */ l.jsxs("div", { className: `field ${u ? "block" : ""}`, children: [
|
2487
|
+
t.type !== "button" && /* @__PURE__ */ l.jsx("label", { ref: o, children: lt(t.title) }, "fieldLabel"),
|
2488
|
+
t.type === "string" && !c && /* @__PURE__ */ l.jsx(
|
2520
2489
|
"input",
|
2521
2490
|
{
|
2522
2491
|
type: "text",
|
@@ -2525,7 +2494,7 @@ function lt(t) {
|
|
2525
2494
|
value: a
|
2526
2495
|
}
|
2527
2496
|
),
|
2528
|
-
t.type === "string" && c && /* @__PURE__ */
|
2497
|
+
t.type === "string" && c && /* @__PURE__ */ l.jsx(
|
2529
2498
|
"textarea",
|
2530
2499
|
{
|
2531
2500
|
cols: 50,
|
@@ -2535,7 +2504,7 @@ function lt(t) {
|
|
2535
2504
|
value: a
|
2536
2505
|
}
|
2537
2506
|
),
|
2538
|
-
t.type === "boolean" && /* @__PURE__ */
|
2507
|
+
t.type === "boolean" && /* @__PURE__ */ l.jsx(
|
2539
2508
|
"input",
|
2540
2509
|
{
|
2541
2510
|
type: "checkbox",
|
@@ -2544,7 +2513,7 @@ function lt(t) {
|
|
2544
2513
|
checked: a
|
2545
2514
|
}
|
2546
2515
|
),
|
2547
|
-
t.type === "number" && /* @__PURE__ */
|
2516
|
+
t.type === "number" && /* @__PURE__ */ l.jsx(
|
2548
2517
|
"input",
|
2549
2518
|
{
|
2550
2519
|
ref: s,
|
@@ -2557,9 +2526,9 @@ function lt(t) {
|
|
2557
2526
|
onChange: d
|
2558
2527
|
}
|
2559
2528
|
),
|
2560
|
-
t.type === "range" && /* @__PURE__ */
|
2561
|
-
/* @__PURE__ */
|
2562
|
-
/* @__PURE__ */
|
2529
|
+
t.type === "range" && /* @__PURE__ */ l.jsxs(l.Fragment, { children: [
|
2530
|
+
/* @__PURE__ */ l.jsx("input", { type: "text", value: a.toString(), onChange: d, disabled: t.disabled, className: "min" }),
|
2531
|
+
/* @__PURE__ */ l.jsx(
|
2563
2532
|
"input",
|
2564
2533
|
{
|
2565
2534
|
disabled: t.disabled,
|
@@ -2572,11 +2541,11 @@ function lt(t) {
|
|
2572
2541
|
}
|
2573
2542
|
)
|
2574
2543
|
] }),
|
2575
|
-
t.type === "color" && /* @__PURE__ */
|
2576
|
-
/* @__PURE__ */
|
2577
|
-
/* @__PURE__ */
|
2544
|
+
t.type === "color" && /* @__PURE__ */ l.jsxs(l.Fragment, { children: [
|
2545
|
+
/* @__PURE__ */ l.jsx("input", { type: "text", value: a.toString(), onChange: d, disabled: t.disabled, className: "color" }),
|
2546
|
+
/* @__PURE__ */ l.jsx("input", { type: "color", value: a, onChange: d, disabled: t.disabled })
|
2578
2547
|
] }),
|
2579
|
-
t.type === "button" && /* @__PURE__ */
|
2548
|
+
t.type === "button" && /* @__PURE__ */ l.jsx(
|
2580
2549
|
"button",
|
2581
2550
|
{
|
2582
2551
|
disabled: t.disabled,
|
@@ -2586,15 +2555,15 @@ function lt(t) {
|
|
2586
2555
|
children: t.title
|
2587
2556
|
}
|
2588
2557
|
),
|
2589
|
-
t.type === "image" && /* @__PURE__ */
|
2590
|
-
|
2591
|
-
|
2558
|
+
t.type === "image" && /* @__PURE__ */ l.jsx("img", { ref: p, onClick: () => {
|
2559
|
+
hi().then((v) => {
|
2560
|
+
p.current.src = v, t.onChange !== void 0 && t.onChange(t.prop !== void 0 ? t.prop : t.title, v);
|
2592
2561
|
});
|
2593
|
-
}, src: a.length > 0 ? a :
|
2594
|
-
t.type === "option" && /* @__PURE__ */
|
2562
|
+
}, src: a.length > 0 ? a : li }),
|
2563
|
+
t.type === "option" && /* @__PURE__ */ l.jsx(l.Fragment, { children: /* @__PURE__ */ l.jsx("select", { onChange: d, disabled: t.disabled, defaultValue: t.value, children: t.options?.map((v, b) => /* @__PURE__ */ l.jsx("option", { value: v.value, children: lt(v.title) }, b)) }) })
|
2595
2564
|
] });
|
2596
2565
|
}
|
2597
|
-
function
|
2566
|
+
function tn(t) {
|
2598
2567
|
switch (t) {
|
2599
2568
|
case "fov":
|
2600
2569
|
return "FOV";
|
@@ -2623,39 +2592,37 @@ function an(t) {
|
|
2623
2592
|
}
|
2624
2593
|
return t;
|
2625
2594
|
}
|
2626
|
-
function
|
2595
|
+
function Ei(t, n) {
|
2627
2596
|
const a = [];
|
2628
2597
|
if (t.perspectiveCameraInfo !== void 0)
|
2629
2598
|
for (const e in t.perspectiveCameraInfo)
|
2630
2599
|
a.push({
|
2631
|
-
title:
|
2600
|
+
title: tn(e),
|
2632
2601
|
prop: e,
|
2633
2602
|
type: "number",
|
2634
2603
|
step: 0.01,
|
2635
2604
|
value: t.perspectiveCameraInfo[e],
|
2636
|
-
onChange: (
|
2637
|
-
|
2638
|
-
n.
|
2639
|
-
|
2640
|
-
h !== void 0 && (ne(h, r, s), h.updateProjectionMatrix());
|
2605
|
+
onChange: (o, s) => {
|
2606
|
+
n.updateObject(t.uuid, o, s), n.requestMethod(t.uuid, "updateProjectionMatrix");
|
2607
|
+
const p = n.scene?.getObjectByProperty("uuid", t.uuid);
|
2608
|
+
p !== void 0 && (ee(p, o, s), p.updateProjectionMatrix());
|
2641
2609
|
}
|
2642
2610
|
});
|
2643
2611
|
else if (t.orthographicCameraInfo !== void 0)
|
2644
2612
|
for (const e in t.orthographicCameraInfo)
|
2645
2613
|
a.push({
|
2646
|
-
title:
|
2614
|
+
title: tn(e),
|
2647
2615
|
prop: e,
|
2648
2616
|
type: "number",
|
2649
2617
|
step: 0.01,
|
2650
2618
|
value: t.perspectiveCameraInfo[e],
|
2651
|
-
onChange: (
|
2652
|
-
|
2653
|
-
n.
|
2654
|
-
|
2655
|
-
h !== void 0 && (ne(h, r, s), h.updateProjectionMatrix());
|
2619
|
+
onChange: (o, s) => {
|
2620
|
+
n.updateObject(t.uuid, o, s), n.requestMethod(t.uuid, "updateProjectionMatrix");
|
2621
|
+
const p = n.scene?.getObjectByProperty("uuid", t.uuid);
|
2622
|
+
p !== void 0 && (ee(p, o, s), p.updateProjectionMatrix());
|
2656
2623
|
}
|
2657
2624
|
});
|
2658
|
-
return /* @__PURE__ */
|
2625
|
+
return /* @__PURE__ */ l.jsx(
|
2659
2626
|
Ue,
|
2660
2627
|
{
|
2661
2628
|
title: "Camera",
|
@@ -2663,30 +2630,29 @@ function wi(t, n) {
|
|
2663
2630
|
}
|
2664
2631
|
);
|
2665
2632
|
}
|
2666
|
-
const
|
2667
|
-
function Ke(t, n, a, e,
|
2668
|
-
return e + (t - n) * (
|
2633
|
+
const Ci = Math.PI / 180, xi = 180 / Math.PI;
|
2634
|
+
function Ke(t, n, a, e, o) {
|
2635
|
+
return e + (t - n) * (o - e) / (a - n);
|
2669
2636
|
}
|
2670
|
-
function
|
2671
|
-
return t *
|
2637
|
+
function Si(t) {
|
2638
|
+
return t * Ci;
|
2672
2639
|
}
|
2673
|
-
function
|
2674
|
-
return t *
|
2640
|
+
function Ut(t) {
|
2641
|
+
return t * xi;
|
2675
2642
|
}
|
2676
|
-
function
|
2677
|
-
const a = new
|
2643
|
+
function wi(t, n) {
|
2644
|
+
const a = new da();
|
2678
2645
|
a.elements = t.matrix;
|
2679
|
-
const e = new
|
2680
|
-
t.uuid.length > 0 && (e.setFromMatrixPosition(a),
|
2681
|
-
const
|
2682
|
-
|
2683
|
-
n.
|
2684
|
-
|
2685
|
-
|
2686
|
-
|
2687
|
-
h(l, Ti(d));
|
2646
|
+
const e = new X(), o = new fa(), s = new X();
|
2647
|
+
t.uuid.length > 0 && (e.setFromMatrixPosition(a), o.setFromRotationMatrix(a), s.setFromMatrixScale(a));
|
2648
|
+
const p = (u, d) => {
|
2649
|
+
n.updateObject(t.uuid, u, d);
|
2650
|
+
const v = n.scene?.getObjectByProperty("uuid", t.uuid);
|
2651
|
+
v !== void 0 && ee(v, u, d);
|
2652
|
+
}, c = (u, d) => {
|
2653
|
+
p(u, Si(d));
|
2688
2654
|
};
|
2689
|
-
return /* @__PURE__ */
|
2655
|
+
return /* @__PURE__ */ l.jsx(
|
2690
2656
|
Ue,
|
2691
2657
|
{
|
2692
2658
|
title: "Transform",
|
@@ -2696,27 +2662,27 @@ function Ri(t, n) {
|
|
2696
2662
|
prop: "position.x",
|
2697
2663
|
type: "number",
|
2698
2664
|
value: e.x,
|
2699
|
-
onChange:
|
2665
|
+
onChange: p
|
2700
2666
|
},
|
2701
2667
|
{
|
2702
2668
|
title: "Position Y",
|
2703
2669
|
prop: "position.y",
|
2704
2670
|
type: "number",
|
2705
2671
|
value: e.y,
|
2706
|
-
onChange:
|
2672
|
+
onChange: p
|
2707
2673
|
},
|
2708
2674
|
{
|
2709
2675
|
title: "Position Z",
|
2710
2676
|
prop: "position.z",
|
2711
2677
|
type: "number",
|
2712
2678
|
value: e.z,
|
2713
|
-
onChange:
|
2679
|
+
onChange: p
|
2714
2680
|
},
|
2715
2681
|
{
|
2716
2682
|
title: "Rotation X",
|
2717
2683
|
prop: "rotation.x",
|
2718
2684
|
type: "number",
|
2719
|
-
value: Ut(
|
2685
|
+
value: Ft(Ut(o.x)),
|
2720
2686
|
min: -360,
|
2721
2687
|
max: 360,
|
2722
2688
|
step: 0.1,
|
@@ -2726,7 +2692,7 @@ function Ri(t, n) {
|
|
2726
2692
|
title: "Rotation Y",
|
2727
2693
|
prop: "rotation.y",
|
2728
2694
|
type: "number",
|
2729
|
-
value: Ut(
|
2695
|
+
value: Ft(Ut(o.y)),
|
2730
2696
|
min: -360,
|
2731
2697
|
max: 360,
|
2732
2698
|
step: 0.1,
|
@@ -2736,7 +2702,7 @@ function Ri(t, n) {
|
|
2736
2702
|
title: "Rotation Z",
|
2737
2703
|
prop: "rotation.z",
|
2738
2704
|
type: "number",
|
2739
|
-
value: Ut(
|
2705
|
+
value: Ft(Ut(o.z)),
|
2740
2706
|
min: -360,
|
2741
2707
|
max: 360,
|
2742
2708
|
step: 0.1,
|
@@ -2748,7 +2714,7 @@ function Ri(t, n) {
|
|
2748
2714
|
type: "number",
|
2749
2715
|
value: s.x,
|
2750
2716
|
step: 0.01,
|
2751
|
-
onChange:
|
2717
|
+
onChange: p
|
2752
2718
|
},
|
2753
2719
|
{
|
2754
2720
|
title: "Scale Y",
|
@@ -2756,7 +2722,7 @@ function Ri(t, n) {
|
|
2756
2722
|
type: "number",
|
2757
2723
|
value: s.y,
|
2758
2724
|
step: 0.01,
|
2759
|
-
onChange:
|
2725
|
+
onChange: p
|
2760
2726
|
},
|
2761
2727
|
{
|
2762
2728
|
title: "Scale Z",
|
@@ -2764,13 +2730,13 @@ function Ri(t, n) {
|
|
2764
2730
|
type: "number",
|
2765
2731
|
value: s.z,
|
2766
2732
|
step: 0.01,
|
2767
|
-
onChange:
|
2733
|
+
onChange: p
|
2768
2734
|
}
|
2769
2735
|
]
|
2770
2736
|
}
|
2771
2737
|
);
|
2772
2738
|
}
|
2773
|
-
function
|
2739
|
+
function nn(t) {
|
2774
2740
|
switch (t) {
|
2775
2741
|
case "color":
|
2776
2742
|
return "Color";
|
@@ -2789,38 +2755,36 @@ function rn(t) {
|
|
2789
2755
|
}
|
2790
2756
|
return t;
|
2791
2757
|
}
|
2792
|
-
function
|
2758
|
+
function Oi(t, n) {
|
2793
2759
|
const a = [];
|
2794
2760
|
if (t.lightInfo !== void 0)
|
2795
2761
|
for (const e in t.lightInfo) {
|
2796
|
-
const
|
2797
|
-
|
2798
|
-
title:
|
2762
|
+
const o = t.lightInfo[e];
|
2763
|
+
o !== void 0 && (o.isColor !== void 0 ? a.push({
|
2764
|
+
title: nn(e),
|
2799
2765
|
prop: e,
|
2800
2766
|
type: "color",
|
2801
|
-
value:
|
2802
|
-
onChange: (s,
|
2803
|
-
|
2804
|
-
const c = new Pt(h);
|
2767
|
+
value: o,
|
2768
|
+
onChange: (s, p) => {
|
2769
|
+
const c = new Tt(p);
|
2805
2770
|
n.updateObject(t.uuid, s, c);
|
2806
|
-
const
|
2807
|
-
|
2771
|
+
const u = n.scene?.getObjectByProperty("uuid", t.uuid);
|
2772
|
+
u !== void 0 && ee(u, s, c);
|
2808
2773
|
}
|
2809
2774
|
}) : a.push({
|
2810
|
-
title:
|
2775
|
+
title: nn(e),
|
2811
2776
|
prop: e,
|
2812
|
-
type: typeof
|
2813
|
-
value:
|
2814
|
-
step: typeof
|
2815
|
-
onChange: (s,
|
2816
|
-
|
2817
|
-
n.
|
2818
|
-
|
2819
|
-
c !== void 0 && ne(c, s, h);
|
2777
|
+
type: typeof o,
|
2778
|
+
value: o,
|
2779
|
+
step: typeof o == "number" ? 0.01 : void 0,
|
2780
|
+
onChange: (s, p) => {
|
2781
|
+
n.updateObject(t.uuid, s, p);
|
2782
|
+
const c = n.scene?.getObjectByProperty("uuid", t.uuid);
|
2783
|
+
c !== void 0 && ee(c, s, p);
|
2820
2784
|
}
|
2821
2785
|
}));
|
2822
2786
|
}
|
2823
|
-
return /* @__PURE__ */
|
2787
|
+
return /* @__PURE__ */ l.jsx(
|
2824
2788
|
Ue,
|
2825
2789
|
{
|
2826
2790
|
title: "Light",
|
@@ -2828,18 +2792,17 @@ function Pi(t, n) {
|
|
2828
2792
|
}
|
2829
2793
|
);
|
2830
2794
|
}
|
2831
|
-
function
|
2832
|
-
var c;
|
2795
|
+
function Mi(t, n) {
|
2833
2796
|
const a = [], e = [];
|
2834
|
-
let
|
2835
|
-
t.animations.forEach((
|
2836
|
-
|
2837
|
-
title:
|
2797
|
+
let o = 0;
|
2798
|
+
t.animations.forEach((c) => {
|
2799
|
+
o = Math.max(o, c.duration), c.duration > 0 && e.push({
|
2800
|
+
title: c.name,
|
2838
2801
|
items: [
|
2839
2802
|
{
|
2840
2803
|
title: "Duration",
|
2841
2804
|
type: "number",
|
2842
|
-
value:
|
2805
|
+
value: c.duration,
|
2843
2806
|
disabled: !0
|
2844
2807
|
},
|
2845
2808
|
{
|
@@ -2863,39 +2826,39 @@ function Ai(t, n) {
|
|
2863
2826
|
title: "Animations",
|
2864
2827
|
items: e
|
2865
2828
|
});
|
2866
|
-
const s =
|
2867
|
-
let
|
2829
|
+
const s = n.scene?.getObjectByProperty("uuid", t.uuid);
|
2830
|
+
let p = !1;
|
2868
2831
|
if (s !== void 0) {
|
2869
|
-
const
|
2870
|
-
if (
|
2871
|
-
const
|
2832
|
+
const c = s.mixer;
|
2833
|
+
if (p = c !== void 0, p) {
|
2834
|
+
const u = [
|
2872
2835
|
{
|
2873
2836
|
title: "Time Scale",
|
2874
2837
|
type: "range",
|
2875
|
-
value:
|
2838
|
+
value: c.timeScale,
|
2876
2839
|
step: 0.01,
|
2877
2840
|
min: -1,
|
2878
2841
|
max: 2,
|
2879
|
-
onChange: (
|
2880
|
-
|
2842
|
+
onChange: (d, v) => {
|
2843
|
+
c.timeScale = v, n.updateObject(t.uuid, "mixer.timeScale", v);
|
2881
2844
|
}
|
2882
2845
|
}
|
2883
2846
|
];
|
2884
|
-
|
2847
|
+
u.push({
|
2885
2848
|
title: "Stop All",
|
2886
2849
|
type: "button",
|
2887
2850
|
onChange: () => {
|
2888
|
-
|
2851
|
+
c.stopAllAction(), n.requestMethod(t.uuid, "stopAllAction", void 0, "mixer");
|
2889
2852
|
}
|
2890
2853
|
}), a.push({
|
2891
2854
|
title: "Mixer",
|
2892
|
-
items:
|
2855
|
+
items: u
|
2893
2856
|
});
|
2894
2857
|
}
|
2895
2858
|
}
|
2896
|
-
return /* @__PURE__ */
|
2859
|
+
return /* @__PURE__ */ l.jsx(Ue, { title: "Animation", items: a });
|
2897
2860
|
}
|
2898
|
-
const
|
2861
|
+
const Un = {
|
2899
2862
|
name: "",
|
2900
2863
|
uuid: "",
|
2901
2864
|
type: "",
|
@@ -2907,200 +2870,194 @@ const zn = {
|
|
2907
2870
|
orthographicCameraInfo: void 0,
|
2908
2871
|
lightInfo: void 0
|
2909
2872
|
};
|
2910
|
-
let
|
2911
|
-
function
|
2912
|
-
const [n, a] =
|
2873
|
+
let te = { ...Un };
|
2874
|
+
function Ti(t) {
|
2875
|
+
const [n, a] = oe(-1);
|
2913
2876
|
Be(() => {
|
2914
|
-
function
|
2915
|
-
|
2877
|
+
function p(u) {
|
2878
|
+
te = { ...u.value }, a(Date.now());
|
2916
2879
|
}
|
2917
2880
|
function c() {
|
2918
|
-
|
2881
|
+
te = { ...Un }, a(Date.now());
|
2919
2882
|
}
|
2920
|
-
return _.addEventListener(j.SET_SCENE, c), _.addEventListener(j.SET_OBJECT,
|
2921
|
-
_.removeEventListener(j.SET_SCENE, c), _.removeEventListener(j.SET_OBJECT,
|
2883
|
+
return _.addEventListener(j.SET_SCENE, c), _.addEventListener(j.SET_OBJECT, p), () => {
|
2884
|
+
_.removeEventListener(j.SET_SCENE, c), _.removeEventListener(j.SET_OBJECT, p);
|
2922
2885
|
};
|
2923
2886
|
}, []);
|
2924
|
-
const e =
|
2925
|
-
return /* @__PURE__ */
|
2926
|
-
/* @__PURE__ */
|
2927
|
-
/* @__PURE__ */
|
2928
|
-
|
2887
|
+
const e = te.type.toLowerCase(), o = te.animations.length > 0 || te.mixer !== void 0, s = e.search("mesh") > -1 || e.search("line") > -1 || e.search("points") > -1;
|
2888
|
+
return /* @__PURE__ */ l.jsx(Ht, { label: "Inspector", children: /* @__PURE__ */ l.jsx("div", { id: "Inspector", className: t.class, children: te.uuid.length > 0 && /* @__PURE__ */ l.jsxs(l.Fragment, { children: [
|
2889
|
+
/* @__PURE__ */ l.jsxs(l.Fragment, { children: [
|
2890
|
+
/* @__PURE__ */ l.jsx(
|
2891
|
+
st,
|
2929
2892
|
{
|
2930
2893
|
type: "string",
|
2931
2894
|
title: "Name",
|
2932
2895
|
prop: "name",
|
2933
|
-
value:
|
2896
|
+
value: te.name,
|
2934
2897
|
disabled: !0
|
2935
2898
|
}
|
2936
2899
|
),
|
2937
|
-
/* @__PURE__ */
|
2938
|
-
|
2900
|
+
/* @__PURE__ */ l.jsx(
|
2901
|
+
st,
|
2939
2902
|
{
|
2940
2903
|
type: "string",
|
2941
2904
|
title: "Type",
|
2942
2905
|
prop: "type",
|
2943
|
-
value:
|
2906
|
+
value: te.type,
|
2944
2907
|
disabled: !0
|
2945
2908
|
}
|
2946
2909
|
),
|
2947
|
-
/* @__PURE__ */
|
2948
|
-
|
2910
|
+
/* @__PURE__ */ l.jsx(
|
2911
|
+
st,
|
2949
2912
|
{
|
2950
2913
|
type: "string",
|
2951
2914
|
title: "UUID",
|
2952
2915
|
prop: "uuid",
|
2953
|
-
value:
|
2916
|
+
value: te.uuid,
|
2954
2917
|
disabled: !0
|
2955
2918
|
}
|
2956
2919
|
),
|
2957
|
-
/* @__PURE__ */
|
2958
|
-
|
2920
|
+
/* @__PURE__ */ l.jsx(
|
2921
|
+
st,
|
2959
2922
|
{
|
2960
2923
|
type: "boolean",
|
2961
2924
|
title: "Visible",
|
2962
2925
|
prop: "visible",
|
2963
|
-
value:
|
2964
|
-
onChange: (
|
2965
|
-
|
2966
|
-
t.three.
|
2967
|
-
|
2968
|
-
l !== void 0 && ne(l, h, c);
|
2926
|
+
value: te.visible,
|
2927
|
+
onChange: (p, c) => {
|
2928
|
+
t.three.updateObject(te.uuid, p, c);
|
2929
|
+
const u = t.three.scene?.getObjectByProperty("uuid", te.uuid);
|
2930
|
+
u !== void 0 && ee(u, p, c);
|
2969
2931
|
}
|
2970
2932
|
}
|
2971
2933
|
)
|
2972
2934
|
] }),
|
2973
|
-
/* @__PURE__ */
|
2974
|
-
|
2975
|
-
|
2976
|
-
e.search("camera") > -1 ?
|
2977
|
-
e.search("light") > -1 ?
|
2978
|
-
s ?
|
2935
|
+
/* @__PURE__ */ l.jsxs(l.Fragment, { children: [
|
2936
|
+
wi(te, t.three),
|
2937
|
+
o ? Mi(te, t.three) : null,
|
2938
|
+
e.search("camera") > -1 ? Ei(te, t.three) : null,
|
2939
|
+
e.search("light") > -1 ? Oi(te, t.three) : null,
|
2940
|
+
s ? yi(te, t.three) : null
|
2979
2941
|
] })
|
2980
2942
|
] }) }, n) }, "Inspector");
|
2981
2943
|
}
|
2982
|
-
class
|
2983
|
-
|
2984
|
-
|
2985
|
-
|
2986
|
-
|
2987
|
-
|
2988
|
-
this.setState(() => ({
|
2989
|
-
scene: a.value
|
2990
|
-
}));
|
2991
|
-
});
|
2992
|
-
this.state = {
|
2993
|
-
scene: a.scene !== void 0 ? a.scene : null
|
2994
|
-
}, this.three = a.three, _.addEventListener(j.SET_SCENE, this.setScene);
|
2944
|
+
class Hi extends Ta {
|
2945
|
+
three;
|
2946
|
+
constructor(n) {
|
2947
|
+
super(n), this.state = {
|
2948
|
+
scene: n.scene !== void 0 ? n.scene : null
|
2949
|
+
}, this.three = n.three, _.addEventListener(j.SET_SCENE, this.setScene);
|
2995
2950
|
}
|
2996
2951
|
componentWillUnmount() {
|
2997
2952
|
_.removeEventListener(j.SET_SCENE, this.setScene);
|
2998
2953
|
}
|
2999
2954
|
render() {
|
3000
|
-
|
3001
|
-
|
3002
|
-
|
3003
|
-
/* @__PURE__ */
|
3004
|
-
/* @__PURE__ */ u.jsx(ki, { three: this.three })
|
2955
|
+
const n = this.componentState.scene !== null, a = "Hierarchy - " + (n ? `${this.componentState.scene?.name}` : "No Scene");
|
2956
|
+
return /* @__PURE__ */ l.jsx("div", { id: "SidePanel", children: /* @__PURE__ */ l.jsxs(l.Fragment, { children: [
|
2957
|
+
/* @__PURE__ */ l.jsx(Ht, { label: a, open: !0, children: /* @__PURE__ */ l.jsx(l.Fragment, { children: n && /* @__PURE__ */ l.jsx(ci, { child: this.componentState.scene, three: this.three }) }) }),
|
2958
|
+
/* @__PURE__ */ l.jsx(Ti, { three: this.three })
|
3005
2959
|
] }) }, "SidePanel");
|
3006
2960
|
}
|
2961
|
+
// Private
|
2962
|
+
setScene = (n) => {
|
2963
|
+
this.setState(() => ({
|
2964
|
+
scene: n.value
|
2965
|
+
}));
|
2966
|
+
};
|
3007
2967
|
// Getters / Setters
|
3008
2968
|
get componentState() {
|
3009
2969
|
return this.state;
|
3010
2970
|
}
|
3011
2971
|
}
|
3012
|
-
function
|
2972
|
+
function Wi(t) {
|
3013
2973
|
function n() {
|
3014
2974
|
return t.three.scene === void 0 ? (console.log("No scene:", t.three), !1) : !0;
|
3015
2975
|
}
|
3016
2976
|
const a = (c) => {
|
3017
|
-
var d;
|
3018
2977
|
if (!n())
|
3019
2978
|
return;
|
3020
|
-
const
|
3021
|
-
|
3022
|
-
}, e = (c,
|
3023
|
-
var m;
|
2979
|
+
const u = t.three.scene?.getObjectByProperty("uuid", c.value);
|
2980
|
+
u !== void 0 && t.three.setObject(u);
|
2981
|
+
}, e = (c, u, d) => {
|
3024
2982
|
if (!n())
|
3025
2983
|
return;
|
3026
|
-
const
|
3027
|
-
|
3028
|
-
},
|
2984
|
+
const v = t.three.scene?.getObjectByProperty("uuid", c);
|
2985
|
+
v !== void 0 && ee(v, u, d);
|
2986
|
+
}, o = (c) => {
|
3029
2987
|
if (!n())
|
3030
2988
|
return;
|
3031
|
-
const
|
3032
|
-
e(
|
2989
|
+
const u = c.value, { key: d, value: v, uuid: b } = u;
|
2990
|
+
e(b, d, v);
|
3033
2991
|
}, s = (c) => {
|
3034
2992
|
if (!n())
|
3035
2993
|
return;
|
3036
|
-
const
|
3037
|
-
|
3038
|
-
e(
|
2994
|
+
const u = c.value;
|
2995
|
+
Gt(u.value).then((d) => {
|
2996
|
+
e(u.uuid, u.key, d), e(u.uuid, "material.needsUpdate", !0);
|
3039
2997
|
});
|
3040
|
-
},
|
3041
|
-
var S;
|
2998
|
+
}, p = (c) => {
|
3042
2999
|
if (!n())
|
3043
3000
|
return;
|
3044
|
-
const { key:
|
3001
|
+
const { key: u, uuid: d, value: v, subitem: b } = c.value, E = t.three.scene?.getObjectByProperty("uuid", d);
|
3045
3002
|
if (E !== void 0)
|
3046
3003
|
try {
|
3047
|
-
|
3004
|
+
b !== void 0 ? za(E, b)[u](v) : E[u](v);
|
3048
3005
|
} catch (x) {
|
3049
|
-
console.log("Error requesting method:"), console.log(x), console.log(
|
3006
|
+
console.log("Error requesting method:"), console.log(x), console.log(u), console.log(v);
|
3050
3007
|
}
|
3051
3008
|
};
|
3052
|
-
return Be(() => (_.addEventListener(j.GET_OBJECT, a), _.addEventListener(j.UPDATE_OBJECT,
|
3053
|
-
_.removeEventListener(j.GET_OBJECT, a), _.removeEventListener(j.UPDATE_OBJECT,
|
3009
|
+
return Be(() => (_.addEventListener(j.GET_OBJECT, a), _.addEventListener(j.UPDATE_OBJECT, o), _.addEventListener(j.CREATE_TEXTURE, s), _.addEventListener(j.REQUEST_METHOD, p), () => {
|
3010
|
+
_.removeEventListener(j.GET_OBJECT, a), _.removeEventListener(j.UPDATE_OBJECT, o), _.removeEventListener(j.CREATE_TEXTURE, s), _.removeEventListener(j.REQUEST_METHOD, p);
|
3054
3011
|
}), []), null;
|
3055
3012
|
}
|
3056
|
-
const
|
3057
|
-
class
|
3013
|
+
const an = { type: "change" }, $t = { type: "start" }, rn = { type: "end" }, St = new ha(), on = new pa(), Ri = Math.cos(70 * ma.DEG2RAD);
|
3014
|
+
class Pi extends un {
|
3058
3015
|
constructor(n, a) {
|
3059
|
-
super(), this.object = n, this.domElement = a, this.domElement.style.touchAction = "none", this.enabled = !0, this.target = new
|
3016
|
+
super(), this.object = n, this.domElement = a, this.domElement.style.touchAction = "none", this.enabled = !0, this.target = new X(), this.cursor = new X(), this.minDistance = 0, this.maxDistance = 1 / 0, this.minZoom = 0, this.maxZoom = 1 / 0, this.minTargetRadius = 0, this.maxTargetRadius = 1 / 0, this.minPolarAngle = 0, this.maxPolarAngle = Math.PI, this.minAzimuthAngle = -1 / 0, this.maxAzimuthAngle = 1 / 0, this.enableDamping = !1, this.dampingFactor = 0.05, this.enableZoom = !0, this.zoomSpeed = 1, this.enableRotate = !0, this.rotateSpeed = 1, this.enablePan = !0, this.panSpeed = 1, this.screenSpacePanning = !0, this.keyPanSpeed = 7, this.zoomToCursor = !1, this.autoRotate = !1, this.autoRotateSpeed = 2, this.keys = { LEFT: "ArrowLeft", UP: "ArrowUp", RIGHT: "ArrowRight", BOTTOM: "ArrowDown" }, this.mouseButtons = { LEFT: He.ROTATE, MIDDLE: He.DOLLY, RIGHT: He.PAN }, this.touches = { ONE: We.ROTATE, TWO: We.DOLLY_PAN }, this.target0 = this.target.clone(), this.position0 = this.object.position.clone(), this.zoom0 = this.object.zoom, this._domElementKeyEvents = null, this.getPolarAngle = function() {
|
3060
3017
|
return c.phi;
|
3061
3018
|
}, this.getAzimuthalAngle = function() {
|
3062
3019
|
return c.theta;
|
3063
3020
|
}, this.getDistance = function() {
|
3064
3021
|
return this.object.position.distanceTo(this.target);
|
3065
|
-
}, this.listenToKeyEvents = function(
|
3066
|
-
|
3022
|
+
}, this.listenToKeyEvents = function(r) {
|
3023
|
+
r.addEventListener("keydown", tt), this._domElementKeyEvents = r;
|
3067
3024
|
}, this.stopListenToKeyEvents = function() {
|
3068
|
-
this._domElementKeyEvents.removeEventListener("keydown",
|
3025
|
+
this._domElementKeyEvents.removeEventListener("keydown", tt), this._domElementKeyEvents = null;
|
3069
3026
|
}, this.saveState = function() {
|
3070
3027
|
e.target0.copy(e.target), e.position0.copy(e.object.position), e.zoom0 = e.object.zoom;
|
3071
3028
|
}, this.reset = function() {
|
3072
|
-
e.target.copy(e.target0), e.object.position.copy(e.position0), e.object.zoom = e.zoom0, e.object.updateProjectionMatrix(), e.dispatchEvent(
|
3029
|
+
e.target.copy(e.target0), e.object.position.copy(e.position0), e.object.zoom = e.zoom0, e.object.updateProjectionMatrix(), e.dispatchEvent(an), e.update(), s = o.NONE;
|
3073
3030
|
}, this.update = function() {
|
3074
|
-
const
|
3075
|
-
return function(
|
3076
|
-
const
|
3077
|
-
|
3078
|
-
let
|
3079
|
-
isFinite(
|
3031
|
+
const r = new X(), y = new Xt().setFromUnitVectors(n.up, new X(0, 1, 0)), O = y.clone().invert(), L = new X(), K = new Xt(), de = new X(), ae = 2 * Math.PI;
|
3032
|
+
return function(Nt = null) {
|
3033
|
+
const at = e.object.position;
|
3034
|
+
r.copy(at).sub(e.target), r.applyQuaternion(y), c.setFromVector3(r), e.autoRotate && s === o.NONE && U(P(Nt)), e.enableDamping ? (c.theta += u.theta * e.dampingFactor, c.phi += u.phi * e.dampingFactor) : (c.theta += u.theta, c.phi += u.phi);
|
3035
|
+
let pe = e.minAzimuthAngle, fe = e.maxAzimuthAngle;
|
3036
|
+
isFinite(pe) && isFinite(fe) && (pe < -Math.PI ? pe += ae : pe > Math.PI && (pe -= ae), fe < -Math.PI ? fe += ae : fe > Math.PI && (fe -= ae), pe <= fe ? c.theta = Math.max(pe, Math.min(fe, c.theta)) : c.theta = c.theta > (pe + fe) / 2 ? Math.max(pe, c.theta) : Math.min(fe, c.theta)), c.phi = Math.max(e.minPolarAngle, Math.min(e.maxPolarAngle, c.phi)), c.makeSafe(), e.enableDamping === !0 ? e.target.addScaledVector(v, e.dampingFactor) : e.target.add(v), e.target.sub(e.cursor), e.target.clampLength(e.minTargetRadius, e.maxTargetRadius), e.target.add(e.cursor), e.zoomToCursor && se || e.object.isOrthographicCamera ? c.radius = me(c.radius) : c.radius = me(c.radius * d), r.setFromSpherical(c), r.applyQuaternion(O), at.copy(e.target).add(r), e.object.lookAt(e.target), e.enableDamping === !0 ? (u.theta *= 1 - e.dampingFactor, u.phi *= 1 - e.dampingFactor, v.multiplyScalar(1 - e.dampingFactor)) : (u.set(0, 0, 0), v.set(0, 0, 0));
|
3080
3037
|
let ke = !1;
|
3081
|
-
if (e.zoomToCursor &&
|
3038
|
+
if (e.zoomToCursor && se) {
|
3082
3039
|
let _e = null;
|
3083
3040
|
if (e.object.isPerspectiveCamera) {
|
3084
|
-
const je =
|
3085
|
-
_e =
|
3041
|
+
const je = r.length();
|
3042
|
+
_e = me(je * d);
|
3086
3043
|
const De = je - _e;
|
3087
|
-
e.object.position.addScaledVector(
|
3044
|
+
e.object.position.addScaledVector(Ee, De), e.object.updateMatrixWorld();
|
3088
3045
|
} else if (e.object.isOrthographicCamera) {
|
3089
|
-
const je = new
|
3046
|
+
const je = new X(le.x, le.y, 0);
|
3090
3047
|
je.unproject(e.object), e.object.zoom = Math.max(e.minZoom, Math.min(e.maxZoom, e.object.zoom / d)), e.object.updateProjectionMatrix(), ke = !0;
|
3091
|
-
const De = new
|
3092
|
-
De.unproject(e.object), e.object.position.sub(De).add(je), e.object.updateMatrixWorld(), _e =
|
3048
|
+
const De = new X(le.x, le.y, 0);
|
3049
|
+
De.unproject(e.object), e.object.position.sub(De).add(je), e.object.updateMatrixWorld(), _e = r.length();
|
3093
3050
|
} else
|
3094
3051
|
console.warn("WARNING: OrbitControls.js encountered an unknown camera type - zoom to cursor disabled."), e.zoomToCursor = !1;
|
3095
|
-
_e !== null && (this.screenSpacePanning ? e.target.set(0, 0, -1).transformDirection(e.object.matrix).multiplyScalar(_e).add(e.object.position) : (
|
3052
|
+
_e !== null && (this.screenSpacePanning ? e.target.set(0, 0, -1).transformDirection(e.object.matrix).multiplyScalar(_e).add(e.object.position) : (St.origin.copy(e.object.position), St.direction.set(0, 0, -1).transformDirection(e.object.matrix), Math.abs(e.object.up.dot(St.direction)) < Ri ? n.lookAt(e.target) : (on.setFromNormalAndCoplanarPoint(e.object.up, e.target), St.intersectPlane(on, e.target))));
|
3096
3053
|
} else
|
3097
3054
|
e.object.isOrthographicCamera && (ke = d !== 1, ke && (e.object.zoom = Math.max(e.minZoom, Math.min(e.maxZoom, e.object.zoom / d)), e.object.updateProjectionMatrix()));
|
3098
|
-
return d = 1,
|
3055
|
+
return d = 1, se = !1, ke || L.distanceToSquared(e.object.position) > p || 8 * (1 - K.dot(e.object.quaternion)) > p || de.distanceToSquared(e.target) > 0 ? (e.dispatchEvent(an), L.copy(e.object.position), K.copy(e.object.quaternion), de.copy(e.target), !0) : !1;
|
3099
3056
|
};
|
3100
3057
|
}(), this.dispose = function() {
|
3101
|
-
e.domElement.removeEventListener("contextmenu", Ge), e.domElement.removeEventListener("pointerdown", Pe), e.domElement.removeEventListener("pointercancel", Ae), e.domElement.removeEventListener("wheel",
|
3058
|
+
e.domElement.removeEventListener("contextmenu", Ge), e.domElement.removeEventListener("pointerdown", Pe), e.domElement.removeEventListener("pointercancel", Ae), e.domElement.removeEventListener("wheel", bt), e.domElement.removeEventListener("pointermove", Qe), e.domElement.removeEventListener("pointerup", Ae), e._domElementKeyEvents !== null && (e._domElementKeyEvents.removeEventListener("keydown", tt), e._domElementKeyEvents = null);
|
3102
3059
|
};
|
3103
|
-
const e = this,
|
3060
|
+
const e = this, o = {
|
3104
3061
|
NONE: -1,
|
3105
3062
|
ROTATE: 0,
|
3106
3063
|
DOLLY: 1,
|
@@ -3110,184 +3067,184 @@ class ji extends fn {
|
|
3110
3067
|
TOUCH_DOLLY_PAN: 5,
|
3111
3068
|
TOUCH_DOLLY_ROTATE: 6
|
3112
3069
|
};
|
3113
|
-
let s =
|
3114
|
-
const
|
3070
|
+
let s = o.NONE;
|
3071
|
+
const p = 1e-6, c = new Zt(), u = new Zt();
|
3115
3072
|
let d = 1;
|
3116
|
-
const
|
3117
|
-
let
|
3118
|
-
const f = [],
|
3119
|
-
let
|
3120
|
-
function
|
3121
|
-
return
|
3122
|
-
}
|
3123
|
-
function Y(
|
3124
|
-
const y = Math.abs(
|
3073
|
+
const v = new X(), b = new ue(), E = new ue(), x = new ue(), M = new ue(), k = new ue(), H = new ue(), B = new ue(), S = new ue(), z = new ue(), Ee = new X(), le = new ue();
|
3074
|
+
let se = !1;
|
3075
|
+
const f = [], m = {};
|
3076
|
+
let w = !1;
|
3077
|
+
function P(r) {
|
3078
|
+
return r !== null ? 2 * Math.PI / 60 * e.autoRotateSpeed * r : 2 * Math.PI / 60 / 60 * e.autoRotateSpeed;
|
3079
|
+
}
|
3080
|
+
function Y(r) {
|
3081
|
+
const y = Math.abs(r * 0.01);
|
3125
3082
|
return Math.pow(0.95, e.zoomSpeed * y);
|
3126
3083
|
}
|
3127
|
-
function
|
3128
|
-
|
3084
|
+
function U(r) {
|
3085
|
+
u.theta -= r;
|
3129
3086
|
}
|
3130
|
-
function
|
3131
|
-
|
3087
|
+
function $(r) {
|
3088
|
+
u.phi -= r;
|
3132
3089
|
}
|
3133
|
-
const
|
3134
|
-
const
|
3135
|
-
return function(
|
3136
|
-
|
3090
|
+
const I = function() {
|
3091
|
+
const r = new X();
|
3092
|
+
return function(O, L) {
|
3093
|
+
r.setFromMatrixColumn(L, 0), r.multiplyScalar(-O), v.add(r);
|
3137
3094
|
};
|
3138
|
-
}(),
|
3139
|
-
const
|
3140
|
-
return function(
|
3141
|
-
e.screenSpacePanning === !0 ?
|
3095
|
+
}(), W = function() {
|
3096
|
+
const r = new X();
|
3097
|
+
return function(O, L) {
|
3098
|
+
e.screenSpacePanning === !0 ? r.setFromMatrixColumn(L, 1) : (r.setFromMatrixColumn(L, 0), r.crossVectors(e.object.up, r)), r.multiplyScalar(O), v.add(r);
|
3142
3099
|
};
|
3143
|
-
}(),
|
3144
|
-
const
|
3145
|
-
return function(
|
3146
|
-
const
|
3100
|
+
}(), q = function() {
|
3101
|
+
const r = new X();
|
3102
|
+
return function(O, L) {
|
3103
|
+
const K = e.domElement;
|
3147
3104
|
if (e.object.isPerspectiveCamera) {
|
3148
|
-
const
|
3149
|
-
|
3150
|
-
let
|
3151
|
-
|
3105
|
+
const de = e.object.position;
|
3106
|
+
r.copy(de).sub(e.target);
|
3107
|
+
let ae = r.length();
|
3108
|
+
ae *= Math.tan(e.object.fov / 2 * Math.PI / 180), I(2 * O * ae / K.clientHeight, e.object.matrix), W(2 * L * ae / K.clientHeight, e.object.matrix);
|
3152
3109
|
} else
|
3153
|
-
e.object.isOrthographicCamera ? (
|
3110
|
+
e.object.isOrthographicCamera ? (I(O * (e.object.right - e.object.left) / e.object.zoom / K.clientWidth, e.object.matrix), W(L * (e.object.top - e.object.bottom) / e.object.zoom / K.clientHeight, e.object.matrix)) : (console.warn("WARNING: OrbitControls.js encountered an unknown camera type - pan disabled."), e.enablePan = !1);
|
3154
3111
|
};
|
3155
3112
|
}();
|
3156
|
-
function
|
3157
|
-
e.object.isPerspectiveCamera || e.object.isOrthographicCamera ? d /=
|
3113
|
+
function T(r) {
|
3114
|
+
e.object.isPerspectiveCamera || e.object.isOrthographicCamera ? d /= r : (console.warn("WARNING: OrbitControls.js encountered an unknown camera type - dolly/zoom disabled."), e.enableZoom = !1);
|
3158
3115
|
}
|
3159
|
-
function
|
3160
|
-
e.object.isPerspectiveCamera || e.object.isOrthographicCamera ? d *=
|
3116
|
+
function N(r) {
|
3117
|
+
e.object.isPerspectiveCamera || e.object.isOrthographicCamera ? d *= r : (console.warn("WARNING: OrbitControls.js encountered an unknown camera type - dolly/zoom disabled."), e.enableZoom = !1);
|
3161
3118
|
}
|
3162
|
-
function
|
3119
|
+
function J(r, y) {
|
3163
3120
|
if (!e.zoomToCursor)
|
3164
3121
|
return;
|
3165
|
-
|
3166
|
-
const
|
3167
|
-
|
3122
|
+
se = !0;
|
3123
|
+
const O = e.domElement.getBoundingClientRect(), L = r - O.left, K = y - O.top, de = O.width, ae = O.height;
|
3124
|
+
le.x = L / de * 2 - 1, le.y = -(K / ae) * 2 + 1, Ee.set(le.x, le.y, 1).unproject(e.object).sub(e.object.position).normalize();
|
3168
3125
|
}
|
3169
|
-
function
|
3170
|
-
return Math.max(e.minDistance, Math.min(e.maxDistance,
|
3126
|
+
function me(r) {
|
3127
|
+
return Math.max(e.minDistance, Math.min(e.maxDistance, r));
|
3171
3128
|
}
|
3172
|
-
function
|
3173
|
-
|
3129
|
+
function Ce(r) {
|
3130
|
+
b.set(r.clientX, r.clientY);
|
3174
3131
|
}
|
3175
|
-
function
|
3176
|
-
|
3132
|
+
function ft(r) {
|
3133
|
+
J(r.clientX, r.clientX), B.set(r.clientX, r.clientY);
|
3177
3134
|
}
|
3178
|
-
function
|
3179
|
-
|
3135
|
+
function Xe(r) {
|
3136
|
+
M.set(r.clientX, r.clientY);
|
3180
3137
|
}
|
3181
|
-
function
|
3182
|
-
E.set(
|
3138
|
+
function At(r) {
|
3139
|
+
E.set(r.clientX, r.clientY), x.subVectors(E, b).multiplyScalar(e.rotateSpeed);
|
3183
3140
|
const y = e.domElement;
|
3184
|
-
|
3141
|
+
U(2 * Math.PI * x.x / y.clientHeight), $(2 * Math.PI * x.y / y.clientHeight), b.copy(E), e.update();
|
3185
3142
|
}
|
3186
|
-
function
|
3187
|
-
|
3143
|
+
function kt(r) {
|
3144
|
+
S.set(r.clientX, r.clientY), z.subVectors(S, B), z.y > 0 ? T(Y(z.y)) : z.y < 0 && N(Y(z.y)), B.copy(S), e.update();
|
3188
3145
|
}
|
3189
|
-
function
|
3190
|
-
|
3146
|
+
function Ze(r) {
|
3147
|
+
k.set(r.clientX, r.clientY), H.subVectors(k, M).multiplyScalar(e.panSpeed), q(H.x, H.y), M.copy(k), e.update();
|
3191
3148
|
}
|
3192
|
-
function
|
3193
|
-
|
3149
|
+
function Je(r) {
|
3150
|
+
J(r.clientX, r.clientY), r.deltaY < 0 ? N(Y(r.deltaY)) : r.deltaY > 0 && T(Y(r.deltaY)), e.update();
|
3194
3151
|
}
|
3195
|
-
function ze(
|
3152
|
+
function ze(r) {
|
3196
3153
|
let y = !1;
|
3197
|
-
switch (
|
3154
|
+
switch (r.code) {
|
3198
3155
|
case e.keys.UP:
|
3199
|
-
|
3156
|
+
r.ctrlKey || r.metaKey || r.shiftKey ? $(2 * Math.PI * e.rotateSpeed / e.domElement.clientHeight) : q(0, e.keyPanSpeed), y = !0;
|
3200
3157
|
break;
|
3201
3158
|
case e.keys.BOTTOM:
|
3202
|
-
|
3159
|
+
r.ctrlKey || r.metaKey || r.shiftKey ? $(-2 * Math.PI * e.rotateSpeed / e.domElement.clientHeight) : q(0, -e.keyPanSpeed), y = !0;
|
3203
3160
|
break;
|
3204
3161
|
case e.keys.LEFT:
|
3205
|
-
|
3162
|
+
r.ctrlKey || r.metaKey || r.shiftKey ? U(2 * Math.PI * e.rotateSpeed / e.domElement.clientHeight) : q(e.keyPanSpeed, 0), y = !0;
|
3206
3163
|
break;
|
3207
3164
|
case e.keys.RIGHT:
|
3208
|
-
|
3165
|
+
r.ctrlKey || r.metaKey || r.shiftKey ? U(-2 * Math.PI * e.rotateSpeed / e.domElement.clientHeight) : q(-e.keyPanSpeed, 0), y = !0;
|
3209
3166
|
break;
|
3210
3167
|
}
|
3211
|
-
y && (
|
3168
|
+
y && (r.preventDefault(), e.update());
|
3212
3169
|
}
|
3213
|
-
function Ye(
|
3170
|
+
function Ye(r) {
|
3214
3171
|
if (f.length === 1)
|
3215
|
-
|
3172
|
+
b.set(r.pageX, r.pageY);
|
3216
3173
|
else {
|
3217
|
-
const y =
|
3218
|
-
|
3174
|
+
const y = Se(r), O = 0.5 * (r.pageX + y.x), L = 0.5 * (r.pageY + y.y);
|
3175
|
+
b.set(O, L);
|
3219
3176
|
}
|
3220
3177
|
}
|
3221
|
-
function Me(
|
3178
|
+
function Me(r) {
|
3222
3179
|
if (f.length === 1)
|
3223
|
-
|
3180
|
+
M.set(r.pageX, r.pageY);
|
3224
3181
|
else {
|
3225
|
-
const y =
|
3226
|
-
|
3182
|
+
const y = Se(r), O = 0.5 * (r.pageX + y.x), L = 0.5 * (r.pageY + y.y);
|
3183
|
+
M.set(O, L);
|
3227
3184
|
}
|
3228
3185
|
}
|
3229
|
-
function
|
3230
|
-
const y =
|
3231
|
-
|
3186
|
+
function ht(r) {
|
3187
|
+
const y = Se(r), O = r.pageX - y.x, L = r.pageY - y.y, K = Math.sqrt(O * O + L * L);
|
3188
|
+
B.set(0, K);
|
3232
3189
|
}
|
3233
|
-
function
|
3234
|
-
e.enableZoom &&
|
3190
|
+
function pt(r) {
|
3191
|
+
e.enableZoom && ht(r), e.enablePan && Me(r);
|
3235
3192
|
}
|
3236
|
-
function
|
3237
|
-
e.enableZoom &&
|
3193
|
+
function _t(r) {
|
3194
|
+
e.enableZoom && ht(r), e.enableRotate && Ye(r);
|
3238
3195
|
}
|
3239
|
-
function
|
3196
|
+
function mt(r) {
|
3240
3197
|
if (f.length == 1)
|
3241
|
-
E.set(
|
3198
|
+
E.set(r.pageX, r.pageY);
|
3242
3199
|
else {
|
3243
|
-
const
|
3244
|
-
E.set(
|
3200
|
+
const O = Se(r), L = 0.5 * (r.pageX + O.x), K = 0.5 * (r.pageY + O.y);
|
3201
|
+
E.set(L, K);
|
3245
3202
|
}
|
3246
|
-
|
3203
|
+
x.subVectors(E, b).multiplyScalar(e.rotateSpeed);
|
3247
3204
|
const y = e.domElement;
|
3248
|
-
|
3205
|
+
U(2 * Math.PI * x.x / y.clientHeight), $(2 * Math.PI * x.y / y.clientHeight), b.copy(E);
|
3249
3206
|
}
|
3250
|
-
function Te(
|
3207
|
+
function Te(r) {
|
3251
3208
|
if (f.length === 1)
|
3252
|
-
|
3209
|
+
k.set(r.pageX, r.pageY);
|
3253
3210
|
else {
|
3254
|
-
const y =
|
3255
|
-
|
3211
|
+
const y = Se(r), O = 0.5 * (r.pageX + y.x), L = 0.5 * (r.pageY + y.y);
|
3212
|
+
k.set(O, L);
|
3256
3213
|
}
|
3257
|
-
|
3214
|
+
H.subVectors(k, M).multiplyScalar(e.panSpeed), q(H.x, H.y), M.copy(k);
|
3258
3215
|
}
|
3259
|
-
function Re(
|
3260
|
-
const y =
|
3261
|
-
|
3262
|
-
const
|
3263
|
-
|
3216
|
+
function Re(r) {
|
3217
|
+
const y = Se(r), O = r.pageX - y.x, L = r.pageY - y.y, K = Math.sqrt(O * O + L * L);
|
3218
|
+
S.set(0, K), z.set(0, Math.pow(S.y / B.y, e.zoomSpeed)), T(z.y), B.copy(S);
|
3219
|
+
const de = (r.pageX + y.x) * 0.5, ae = (r.pageY + y.y) * 0.5;
|
3220
|
+
J(de, ae);
|
3264
3221
|
}
|
3265
|
-
function
|
3266
|
-
e.enableZoom && Re(
|
3222
|
+
function vt(r) {
|
3223
|
+
e.enableZoom && Re(r), e.enablePan && Te(r);
|
3267
3224
|
}
|
3268
|
-
function
|
3269
|
-
e.enableZoom && Re(
|
3225
|
+
function gt(r) {
|
3226
|
+
e.enableZoom && Re(r), e.enableRotate && mt(r);
|
3270
3227
|
}
|
3271
|
-
function Pe(
|
3272
|
-
e.enabled !== !1 && (f.length === 0 && (e.domElement.setPointerCapture(
|
3228
|
+
function Pe(r) {
|
3229
|
+
e.enabled !== !1 && (f.length === 0 && (e.domElement.setPointerCapture(r.pointerId), e.domElement.addEventListener("pointermove", Qe), e.domElement.addEventListener("pointerup", Ae)), Dt(r), r.pointerType === "touch" ? nt(r) : et(r));
|
3273
3230
|
}
|
3274
|
-
function
|
3275
|
-
e.enabled !== !1 && (
|
3231
|
+
function Qe(r) {
|
3232
|
+
e.enabled !== !1 && (r.pointerType === "touch" ? Ct(r) : jt(r));
|
3276
3233
|
}
|
3277
|
-
function Ae(
|
3278
|
-
switch (
|
3234
|
+
function Ae(r) {
|
3235
|
+
switch (It(r), f.length) {
|
3279
3236
|
case 0:
|
3280
|
-
e.domElement.releasePointerCapture(
|
3237
|
+
e.domElement.releasePointerCapture(r.pointerId), e.domElement.removeEventListener("pointermove", Qe), e.domElement.removeEventListener("pointerup", Ae), e.dispatchEvent(rn), s = o.NONE;
|
3281
3238
|
break;
|
3282
3239
|
case 1:
|
3283
|
-
const y = f[0],
|
3284
|
-
|
3240
|
+
const y = f[0], O = m[y];
|
3241
|
+
nt({ pointerId: y, pageX: O.x, pageY: O.y });
|
3285
3242
|
break;
|
3286
3243
|
}
|
3287
3244
|
}
|
3288
|
-
function
|
3245
|
+
function et(r) {
|
3289
3246
|
let y;
|
3290
|
-
switch (
|
3247
|
+
switch (r.button) {
|
3291
3248
|
case 0:
|
3292
3249
|
y = e.mouseButtons.LEFT;
|
3293
3250
|
break;
|
@@ -3304,98 +3261,98 @@ class ji extends fn {
|
|
3304
3261
|
case He.DOLLY:
|
3305
3262
|
if (e.enableZoom === !1)
|
3306
3263
|
return;
|
3307
|
-
|
3264
|
+
ft(r), s = o.DOLLY;
|
3308
3265
|
break;
|
3309
3266
|
case He.ROTATE:
|
3310
|
-
if (
|
3267
|
+
if (r.ctrlKey || r.metaKey || r.shiftKey) {
|
3311
3268
|
if (e.enablePan === !1)
|
3312
3269
|
return;
|
3313
|
-
|
3270
|
+
Xe(r), s = o.PAN;
|
3314
3271
|
} else {
|
3315
3272
|
if (e.enableRotate === !1)
|
3316
3273
|
return;
|
3317
|
-
|
3274
|
+
Ce(r), s = o.ROTATE;
|
3318
3275
|
}
|
3319
3276
|
break;
|
3320
3277
|
case He.PAN:
|
3321
|
-
if (
|
3278
|
+
if (r.ctrlKey || r.metaKey || r.shiftKey) {
|
3322
3279
|
if (e.enableRotate === !1)
|
3323
3280
|
return;
|
3324
|
-
|
3281
|
+
Ce(r), s = o.ROTATE;
|
3325
3282
|
} else {
|
3326
3283
|
if (e.enablePan === !1)
|
3327
3284
|
return;
|
3328
|
-
|
3285
|
+
Xe(r), s = o.PAN;
|
3329
3286
|
}
|
3330
3287
|
break;
|
3331
3288
|
default:
|
3332
|
-
s =
|
3289
|
+
s = o.NONE;
|
3333
3290
|
}
|
3334
|
-
s !==
|
3291
|
+
s !== o.NONE && e.dispatchEvent($t);
|
3335
3292
|
}
|
3336
|
-
function
|
3293
|
+
function jt(r) {
|
3337
3294
|
switch (s) {
|
3338
|
-
case
|
3295
|
+
case o.ROTATE:
|
3339
3296
|
if (e.enableRotate === !1)
|
3340
3297
|
return;
|
3341
|
-
|
3298
|
+
At(r);
|
3342
3299
|
break;
|
3343
|
-
case
|
3300
|
+
case o.DOLLY:
|
3344
3301
|
if (e.enableZoom === !1)
|
3345
3302
|
return;
|
3346
|
-
|
3303
|
+
kt(r);
|
3347
3304
|
break;
|
3348
|
-
case
|
3305
|
+
case o.PAN:
|
3349
3306
|
if (e.enablePan === !1)
|
3350
3307
|
return;
|
3351
|
-
|
3308
|
+
Ze(r);
|
3352
3309
|
break;
|
3353
3310
|
}
|
3354
3311
|
}
|
3355
|
-
function
|
3356
|
-
e.enabled === !1 || e.enableZoom === !1 || s !==
|
3312
|
+
function bt(r) {
|
3313
|
+
e.enabled === !1 || e.enableZoom === !1 || s !== o.NONE || (r.preventDefault(), e.dispatchEvent($t), Je(yt(r)), e.dispatchEvent(rn));
|
3357
3314
|
}
|
3358
|
-
function
|
3359
|
-
const y =
|
3360
|
-
clientX:
|
3361
|
-
clientY:
|
3362
|
-
deltaY:
|
3315
|
+
function yt(r) {
|
3316
|
+
const y = r.deltaMode, O = {
|
3317
|
+
clientX: r.clientX,
|
3318
|
+
clientY: r.clientY,
|
3319
|
+
deltaY: r.deltaY
|
3363
3320
|
};
|
3364
3321
|
switch (y) {
|
3365
3322
|
case 1:
|
3366
|
-
|
3323
|
+
O.deltaY *= 16;
|
3367
3324
|
break;
|
3368
3325
|
case 2:
|
3369
|
-
|
3326
|
+
O.deltaY *= 100;
|
3370
3327
|
break;
|
3371
3328
|
}
|
3372
|
-
return
|
3329
|
+
return r.ctrlKey && !w && (O.deltaY *= 10), O;
|
3373
3330
|
}
|
3374
|
-
function
|
3375
|
-
|
3331
|
+
function Et(r) {
|
3332
|
+
r.key === "Control" && (w = !0, e.domElement.getRootNode().addEventListener("keyup", xe, { passive: !0, capture: !0 }));
|
3376
3333
|
}
|
3377
|
-
function
|
3378
|
-
|
3334
|
+
function xe(r) {
|
3335
|
+
r.key === "Control" && (w = !1, e.domElement.getRootNode().removeEventListener("keyup", xe, { passive: !0, capture: !0 }));
|
3379
3336
|
}
|
3380
|
-
function
|
3381
|
-
e.enabled === !1 || e.enablePan === !1 || ze(
|
3337
|
+
function tt(r) {
|
3338
|
+
e.enabled === !1 || e.enablePan === !1 || ze(r);
|
3382
3339
|
}
|
3383
|
-
function
|
3384
|
-
switch (
|
3340
|
+
function nt(r) {
|
3341
|
+
switch (xt(r), f.length) {
|
3385
3342
|
case 1:
|
3386
3343
|
switch (e.touches.ONE) {
|
3387
3344
|
case We.ROTATE:
|
3388
3345
|
if (e.enableRotate === !1)
|
3389
3346
|
return;
|
3390
|
-
Ye(
|
3347
|
+
Ye(r), s = o.TOUCH_ROTATE;
|
3391
3348
|
break;
|
3392
3349
|
case We.PAN:
|
3393
3350
|
if (e.enablePan === !1)
|
3394
3351
|
return;
|
3395
|
-
Me(
|
3352
|
+
Me(r), s = o.TOUCH_PAN;
|
3396
3353
|
break;
|
3397
3354
|
default:
|
3398
|
-
s =
|
3355
|
+
s = o.NONE;
|
3399
3356
|
}
|
3400
3357
|
break;
|
3401
3358
|
case 2:
|
@@ -3403,161 +3360,161 @@ class ji extends fn {
|
|
3403
3360
|
case We.DOLLY_PAN:
|
3404
3361
|
if (e.enableZoom === !1 && e.enablePan === !1)
|
3405
3362
|
return;
|
3406
|
-
|
3363
|
+
pt(r), s = o.TOUCH_DOLLY_PAN;
|
3407
3364
|
break;
|
3408
3365
|
case We.DOLLY_ROTATE:
|
3409
3366
|
if (e.enableZoom === !1 && e.enableRotate === !1)
|
3410
3367
|
return;
|
3411
|
-
|
3368
|
+
_t(r), s = o.TOUCH_DOLLY_ROTATE;
|
3412
3369
|
break;
|
3413
3370
|
default:
|
3414
|
-
s =
|
3371
|
+
s = o.NONE;
|
3415
3372
|
}
|
3416
3373
|
break;
|
3417
3374
|
default:
|
3418
|
-
s =
|
3375
|
+
s = o.NONE;
|
3419
3376
|
}
|
3420
|
-
s !==
|
3377
|
+
s !== o.NONE && e.dispatchEvent($t);
|
3421
3378
|
}
|
3422
|
-
function
|
3423
|
-
switch (
|
3424
|
-
case
|
3379
|
+
function Ct(r) {
|
3380
|
+
switch (xt(r), s) {
|
3381
|
+
case o.TOUCH_ROTATE:
|
3425
3382
|
if (e.enableRotate === !1)
|
3426
3383
|
return;
|
3427
|
-
|
3384
|
+
mt(r), e.update();
|
3428
3385
|
break;
|
3429
|
-
case
|
3386
|
+
case o.TOUCH_PAN:
|
3430
3387
|
if (e.enablePan === !1)
|
3431
3388
|
return;
|
3432
|
-
Te(
|
3389
|
+
Te(r), e.update();
|
3433
3390
|
break;
|
3434
|
-
case
|
3391
|
+
case o.TOUCH_DOLLY_PAN:
|
3435
3392
|
if (e.enableZoom === !1 && e.enablePan === !1)
|
3436
3393
|
return;
|
3437
|
-
|
3394
|
+
vt(r), e.update();
|
3438
3395
|
break;
|
3439
|
-
case
|
3396
|
+
case o.TOUCH_DOLLY_ROTATE:
|
3440
3397
|
if (e.enableZoom === !1 && e.enableRotate === !1)
|
3441
3398
|
return;
|
3442
|
-
|
3399
|
+
gt(r), e.update();
|
3443
3400
|
break;
|
3444
3401
|
default:
|
3445
|
-
s =
|
3402
|
+
s = o.NONE;
|
3446
3403
|
}
|
3447
3404
|
}
|
3448
|
-
function Ge(
|
3449
|
-
e.enabled !== !1 &&
|
3405
|
+
function Ge(r) {
|
3406
|
+
e.enabled !== !1 && r.preventDefault();
|
3450
3407
|
}
|
3451
|
-
function
|
3452
|
-
f.push(
|
3408
|
+
function Dt(r) {
|
3409
|
+
f.push(r.pointerId);
|
3453
3410
|
}
|
3454
|
-
function
|
3455
|
-
delete
|
3411
|
+
function It(r) {
|
3412
|
+
delete m[r.pointerId];
|
3456
3413
|
for (let y = 0; y < f.length; y++)
|
3457
|
-
if (f[y] ==
|
3414
|
+
if (f[y] == r.pointerId) {
|
3458
3415
|
f.splice(y, 1);
|
3459
3416
|
return;
|
3460
3417
|
}
|
3461
3418
|
}
|
3462
|
-
function
|
3463
|
-
let y =
|
3464
|
-
y === void 0 && (y = new
|
3419
|
+
function xt(r) {
|
3420
|
+
let y = m[r.pointerId];
|
3421
|
+
y === void 0 && (y = new ue(), m[r.pointerId] = y), y.set(r.pageX, r.pageY);
|
3465
3422
|
}
|
3466
|
-
function
|
3467
|
-
const y =
|
3468
|
-
return
|
3423
|
+
function Se(r) {
|
3424
|
+
const y = r.pointerId === f[0] ? f[1] : f[0];
|
3425
|
+
return m[y];
|
3469
3426
|
}
|
3470
|
-
e.domElement.addEventListener("contextmenu", Ge), e.domElement.addEventListener("pointerdown", Pe), e.domElement.addEventListener("pointercancel", Ae), e.domElement.addEventListener("wheel",
|
3427
|
+
e.domElement.addEventListener("contextmenu", Ge), e.domElement.addEventListener("pointerdown", Pe), e.domElement.addEventListener("pointercancel", Ae), e.domElement.addEventListener("wheel", bt, { passive: !1 }), e.domElement.getRootNode().addEventListener("keydown", Et, { passive: !0, capture: !0 }), this.update();
|
3471
3428
|
}
|
3472
3429
|
}
|
3473
|
-
const
|
3474
|
-
const [n, a] =
|
3430
|
+
const Mt = (t) => {
|
3431
|
+
const [n, a] = oe(t.options[t.index]), e = () => {
|
3475
3432
|
t.onToggle(!t.open);
|
3476
|
-
},
|
3433
|
+
}, o = (s) => {
|
3477
3434
|
s !== n && (t.onSelect(s), a(s)), t.onToggle(!1);
|
3478
3435
|
};
|
3479
|
-
return /* @__PURE__ */
|
3480
|
-
/* @__PURE__ */
|
3481
|
-
t.open && /* @__PURE__ */
|
3436
|
+
return /* @__PURE__ */ l.jsxs("div", { className: `dropdown ${t.up === !0 ? "up" : ""}`, children: [
|
3437
|
+
/* @__PURE__ */ l.jsx("div", { className: "dropdown-toggle", onClick: e, children: n }),
|
3438
|
+
t.open && /* @__PURE__ */ l.jsx("ul", { className: "dropdown-menu", children: t.options.map((s) => /* @__PURE__ */ l.jsx("li", { onClick: () => o(s), children: s }, s)) })
|
3482
3439
|
] });
|
3483
|
-
}, Le =
|
3484
|
-
const [e,
|
3485
|
-
return /* @__PURE__ */
|
3486
|
-
/* @__PURE__ */
|
3487
|
-
e &&
|
3440
|
+
}, Le = Ra(function(n, a) {
|
3441
|
+
const [e, o] = oe(!1), s = n.options.indexOf(n.camera.name);
|
3442
|
+
return /* @__PURE__ */ l.jsxs("div", { className: "CameraWindow", children: [
|
3443
|
+
/* @__PURE__ */ l.jsx("div", { ref: a, className: "clickable", onClick: () => {
|
3444
|
+
e && o(!1);
|
3488
3445
|
} }),
|
3489
|
-
/* @__PURE__ */
|
3490
|
-
|
3446
|
+
/* @__PURE__ */ l.jsx(
|
3447
|
+
Mt,
|
3491
3448
|
{
|
3492
3449
|
index: s,
|
3493
3450
|
open: e,
|
3494
3451
|
options: n.options,
|
3495
3452
|
onSelect: n.onSelect,
|
3496
|
-
onToggle: (
|
3497
|
-
|
3453
|
+
onToggle: (p) => {
|
3454
|
+
o(p);
|
3498
3455
|
},
|
3499
3456
|
up: !0
|
3500
3457
|
}
|
3501
3458
|
)
|
3502
3459
|
] });
|
3503
|
-
}),
|
3460
|
+
}), sn = [
|
3504
3461
|
"Single",
|
3505
3462
|
"Side by Side",
|
3506
3463
|
"Stacked",
|
3507
3464
|
"Quad"
|
3508
|
-
],
|
3465
|
+
], ne = /* @__PURE__ */ new Map(), ie = /* @__PURE__ */ new Map(), ge = /* @__PURE__ */ new Map();
|
3509
3466
|
function $e(t, n) {
|
3510
|
-
const a = new
|
3511
|
-
return a.name = t, a.position.copy(n), a.lookAt(0, 0, 0),
|
3512
|
-
}
|
3513
|
-
$e("Top", new
|
3514
|
-
$e("Bottom", new
|
3515
|
-
$e("Left", new
|
3516
|
-
$e("Right", new
|
3517
|
-
$e("Front", new
|
3518
|
-
$e("Back", new
|
3519
|
-
$e("Orthographic", new
|
3520
|
-
const
|
3521
|
-
|
3522
|
-
|
3523
|
-
|
3524
|
-
|
3525
|
-
const
|
3467
|
+
const a = new Rn(-100, 100, 100, -100, 50, 3e3);
|
3468
|
+
return a.name = t, a.position.copy(n), a.lookAt(0, 0, 0), ne.set(t, a), a;
|
3469
|
+
}
|
3470
|
+
$e("Top", new X(0, 1e3, 0));
|
3471
|
+
$e("Bottom", new X(0, -1e3, 0));
|
3472
|
+
$e("Left", new X(-1e3, 0, 0));
|
3473
|
+
$e("Right", new X(1e3, 0, 0));
|
3474
|
+
$e("Front", new X(0, 0, 1e3));
|
3475
|
+
$e("Back", new X(0, 0, -1e3));
|
3476
|
+
$e("Orthographic", new X(1e3, 1e3, 1e3));
|
3477
|
+
const Pt = new zt(60, 1, 50, 3e3);
|
3478
|
+
Pt.name = "Debug";
|
3479
|
+
Pt.position.set(500, 500, 500);
|
3480
|
+
Pt.lookAt(0, 0, 0);
|
3481
|
+
ne.set("Debug", Pt);
|
3482
|
+
const cn = [
|
3526
3483
|
"Renderer",
|
3527
3484
|
"Depth",
|
3528
3485
|
"Normals",
|
3529
3486
|
"UVs",
|
3530
3487
|
"Wireframe"
|
3531
|
-
],
|
3488
|
+
], Ai = new va(), ki = new ga(), _i = new si(), ji = new ba({
|
3532
3489
|
opacity: 0.33,
|
3533
3490
|
transparent: !0,
|
3534
3491
|
wireframe: !0
|
3535
3492
|
});
|
3536
|
-
let
|
3537
|
-
const
|
3538
|
-
|
3539
|
-
let
|
3540
|
-
|
3541
|
-
const
|
3542
|
-
|
3543
|
-
|
3544
|
-
const
|
3545
|
-
|
3546
|
-
const
|
3547
|
-
|
3548
|
-
|
3549
|
-
const
|
3550
|
-
|
3551
|
-
|
3552
|
-
|
3553
|
-
let
|
3554
|
-
function
|
3555
|
-
const [n, a] =
|
3556
|
-
const
|
3557
|
-
|
3558
|
-
const
|
3559
|
-
|
3560
|
-
const Y = new
|
3493
|
+
let wt = "Renderer";
|
3494
|
+
const V = new Pn();
|
3495
|
+
V.name = "Debug Scene";
|
3496
|
+
let be = new Pn();
|
3497
|
+
V.add(be);
|
3498
|
+
const dt = new ya();
|
3499
|
+
dt.name = "helpers";
|
3500
|
+
V.add(dt);
|
3501
|
+
const Di = new ii();
|
3502
|
+
dt.add(Di);
|
3503
|
+
const $n = new An(500);
|
3504
|
+
$n.name = "axisHelper";
|
3505
|
+
dt.add($n);
|
3506
|
+
const ut = new An(100);
|
3507
|
+
ut.name = "interactionHelper";
|
3508
|
+
dt.add(ut);
|
3509
|
+
ut.visible = !1;
|
3510
|
+
let Ot = !1, G = ne.get("Debug"), re = ne.get("Orthographic"), Ne = ne.get("Front"), Fe = ne.get("Top"), ln = !1;
|
3511
|
+
function qi(t) {
|
3512
|
+
const [n, a] = oe(t.mode !== void 0 ? t.mode : "Single"), [e, o] = oe(null), [s, p] = oe(!1), [c, u] = oe(!1), [d, v] = oe(!1), [, b] = oe(Date.now()), E = ye(null), x = ye(null), M = ye(null), k = ye(null), H = ye(null), B = ye(null), S = (f, m) => {
|
3513
|
+
const w = ie.get(f.name);
|
3514
|
+
w !== void 0 && w.dispose(), ie.delete(f.name);
|
3515
|
+
const P = ge.get(f.name);
|
3516
|
+
P !== void 0 && (V.remove(P), P.dispose()), ge.delete(f.name);
|
3517
|
+
const Y = new Pi(f, m);
|
3561
3518
|
switch (Y.enableDamping = !0, Y.dampingFactor = 0.05, f.name) {
|
3562
3519
|
case "Top":
|
3563
3520
|
case "Bottom":
|
@@ -3568,273 +3525,264 @@ function Qi(t) {
|
|
3568
3525
|
Y.enableRotate = !1;
|
3569
3526
|
break;
|
3570
3527
|
}
|
3571
|
-
if (
|
3572
|
-
const
|
3573
|
-
|
3574
|
-
}
|
3575
|
-
},
|
3576
|
-
const
|
3577
|
-
|
3578
|
-
const
|
3579
|
-
|
3580
|
-
},
|
3581
|
-
|
3528
|
+
if (ie.set(f.name, Y), f instanceof zt) {
|
3529
|
+
const U = new xa(f);
|
3530
|
+
ge.set(f.name, U), V.add(U);
|
3531
|
+
}
|
3532
|
+
}, z = (f) => {
|
3533
|
+
const m = ge.get(f.name);
|
3534
|
+
m !== void 0 && (V.remove(m), m.dispose(), ge.delete(f.name));
|
3535
|
+
const w = ie.get(f.name);
|
3536
|
+
w !== void 0 && (w.dispose(), ie.delete(f.name));
|
3537
|
+
}, Ee = () => {
|
3538
|
+
ie.forEach((f, m) => {
|
3582
3539
|
f.dispose();
|
3583
|
-
const
|
3584
|
-
|
3585
|
-
}),
|
3586
|
-
},
|
3540
|
+
const w = ge.get(m);
|
3541
|
+
w !== void 0 && (V.remove(w), w.dispose()), ge.delete(m), ie.delete(m);
|
3542
|
+
}), ie.clear(), ge.clear();
|
3543
|
+
}, le = () => {
|
3587
3544
|
switch (n) {
|
3588
3545
|
case "Single":
|
3589
|
-
|
3546
|
+
S(G, M.current);
|
3590
3547
|
break;
|
3591
3548
|
case "Side by Side":
|
3592
3549
|
case "Stacked":
|
3593
|
-
|
3550
|
+
S(G, M.current), S(re, k.current);
|
3594
3551
|
break;
|
3595
3552
|
case "Quad":
|
3596
|
-
|
3553
|
+
S(G, M.current), S(re, k.current), S(Ne, H.current), S(Fe, B.current);
|
3597
3554
|
break;
|
3598
3555
|
}
|
3599
3556
|
};
|
3600
3557
|
Be(() => {
|
3601
|
-
const f = new
|
3558
|
+
const f = new Ea({
|
3602
3559
|
canvas: E.current,
|
3603
3560
|
stencil: !1
|
3604
3561
|
});
|
3605
|
-
f.autoClear = !1, f.shadowMap.enabled = !0, f.setPixelRatio(devicePixelRatio), f.setClearColor(0),
|
3562
|
+
f.autoClear = !1, f.shadowMap.enabled = !0, f.setPixelRatio(devicePixelRatio), f.setClearColor(0), o(f);
|
3606
3563
|
}, []), Be(() => {
|
3607
|
-
const f = (
|
3608
|
-
|
3609
|
-
const Y = t.scenes.get(
|
3564
|
+
const f = (P) => {
|
3565
|
+
Dn(be), V.remove(be);
|
3566
|
+
const Y = t.scenes.get(P.value.name);
|
3610
3567
|
if (Y !== void 0) {
|
3611
|
-
const
|
3612
|
-
t.onSceneSet !== void 0 && t.onSceneSet(
|
3613
|
-
}
|
3614
|
-
},
|
3615
|
-
|
3616
|
-
|
3617
|
-
|
3618
|
-
|
3619
|
-
re.delete(A.value.name), m(Date.now());
|
3568
|
+
const U = new Y();
|
3569
|
+
t.onSceneSet !== void 0 && t.onSceneSet(U), be = U, t.three.scene = be, V.add(be), ln = !0;
|
3570
|
+
}
|
3571
|
+
}, m = (P) => {
|
3572
|
+
const Y = P.value, U = t.three.scene?.getObjectByProperty("uuid", Y.uuid);
|
3573
|
+
U !== void 0 && ne.set(Y.name, U), b(Date.now());
|
3574
|
+
}, w = (P) => {
|
3575
|
+
ne.delete(P.value.name), b(Date.now());
|
3620
3576
|
};
|
3621
|
-
return _.addEventListener(j.SET_SCENE, f), _.addEventListener(j.ADD_CAMERA,
|
3622
|
-
_.removeEventListener(j.SET_SCENE, f), _.removeEventListener(j.ADD_CAMERA,
|
3577
|
+
return _.addEventListener(j.SET_SCENE, f), _.addEventListener(j.ADD_CAMERA, m), _.addEventListener(j.REMOVE_CAMERA, w), () => {
|
3578
|
+
_.removeEventListener(j.SET_SCENE, f), _.removeEventListener(j.ADD_CAMERA, m), _.removeEventListener(j.REMOVE_CAMERA, w);
|
3623
3579
|
};
|
3624
3580
|
}, []), Be(() => {
|
3625
3581
|
if (e === null)
|
3626
3582
|
return;
|
3627
|
-
let f = window.innerWidth,
|
3628
|
-
const
|
3629
|
-
f = window.innerWidth - 300,
|
3630
|
-
let
|
3583
|
+
let f = window.innerWidth, m = window.innerHeight, w = Math.floor(f / 2), P = Math.floor(m / 2), Y = -1;
|
3584
|
+
const U = () => {
|
3585
|
+
f = window.innerWidth - 300, m = window.innerHeight, w = Math.floor(f / 2), P = Math.floor(m / 2), e.setSize(f, m);
|
3586
|
+
let T = f, N = m;
|
3631
3587
|
switch (n) {
|
3632
3588
|
case "Side by Side":
|
3633
|
-
|
3589
|
+
T = w, N = m;
|
3634
3590
|
break;
|
3635
3591
|
case "Stacked":
|
3636
|
-
|
3592
|
+
T = f, N = P;
|
3637
3593
|
break;
|
3638
3594
|
case "Quad":
|
3639
|
-
|
3595
|
+
T = w, N = P;
|
3640
3596
|
break;
|
3641
3597
|
}
|
3642
|
-
|
3643
|
-
|
3644
|
-
Q instanceof An ? (Q.left = R / -2, Q.right = R / 2, Q.top = U / 2, Q.bottom = U / -2, Q.updateProjectionMatrix()) : Q instanceof Gt && (Q.aspect = R / U, Q.updateProjectionMatrix(), (fe = ye.get(Q.name)) == null || fe.update());
|
3598
|
+
ne.forEach((J) => {
|
3599
|
+
J instanceof Rn ? (J.left = T / -2, J.right = T / 2, J.top = N / 2, J.bottom = N / -2, J.updateProjectionMatrix()) : J instanceof zt && (J.aspect = T / N, J.updateProjectionMatrix(), ge.get(J.name)?.update());
|
3645
3600
|
});
|
3646
|
-
},
|
3647
|
-
e.setViewport(0, 0, f,
|
3648
|
-
},
|
3601
|
+
}, $ = () => {
|
3602
|
+
e.setViewport(0, 0, f, m), e.setScissor(0, 0, f, m), e.render(V, G);
|
3603
|
+
}, I = () => {
|
3649
3604
|
if (n === "Side by Side")
|
3650
|
-
e.setViewport(0, 0,
|
3605
|
+
e.setViewport(0, 0, w, m), e.setScissor(0, 0, w, m), e.render(V, G), e.setViewport(w, 0, w, m), e.setScissor(w, 0, w, m), e.render(V, re);
|
3651
3606
|
else {
|
3652
|
-
const
|
3653
|
-
e.setViewport(0,
|
3607
|
+
const T = m - P;
|
3608
|
+
e.setViewport(0, T, f, P), e.setScissor(0, T, f, P), e.render(V, G), e.setViewport(0, 0, f, P), e.setScissor(0, 0, f, P), e.render(V, re);
|
3654
3609
|
}
|
3610
|
+
}, W = () => {
|
3611
|
+
let T = 0, N = 0;
|
3612
|
+
N = m - P, T = 0, e.setViewport(T, N, w, P), e.setScissor(T, N, w, P), e.render(V, G), T = w, e.setViewport(T, N, w, P), e.setScissor(T, N, w, P), e.render(V, re), N = 0, T = 0, e.setViewport(T, N, w, P), e.setScissor(T, N, w, P), e.render(V, Ne), T = w, e.setViewport(T, N, w, P), e.setScissor(T, N, w, P), e.render(V, Fe);
|
3655
3613
|
}, q = () => {
|
3656
|
-
|
3657
|
-
|
3658
|
-
|
3659
|
-
switch (se.forEach((R) => {
|
3660
|
-
R.update();
|
3661
|
-
}), t.onSceneUpdate !== void 0 && dn && t.onSceneUpdate(Ee), e.clear(), n) {
|
3614
|
+
switch (ie.forEach((T) => {
|
3615
|
+
T.update();
|
3616
|
+
}), t.onSceneUpdate !== void 0 && ln && t.onSceneUpdate(be), e.clear(), n) {
|
3662
3617
|
case "Single":
|
3663
|
-
|
3618
|
+
$();
|
3664
3619
|
break;
|
3665
3620
|
case "Side by Side":
|
3666
3621
|
case "Stacked":
|
3667
|
-
|
3622
|
+
I();
|
3668
3623
|
break;
|
3669
3624
|
case "Quad":
|
3670
|
-
|
3625
|
+
W();
|
3671
3626
|
break;
|
3672
3627
|
}
|
3673
|
-
Y = requestAnimationFrame(
|
3628
|
+
Y = requestAnimationFrame(q);
|
3674
3629
|
};
|
3675
|
-
return
|
3676
|
-
window.removeEventListener("resize",
|
3630
|
+
return le(), window.addEventListener("resize", U), U(), q(), () => {
|
3631
|
+
window.removeEventListener("resize", U), cancelAnimationFrame(Y), Y = -1;
|
3677
3632
|
};
|
3678
3633
|
}, [n, e]), Be(() => {
|
3679
3634
|
if (e !== null) {
|
3680
|
-
const f = new
|
3635
|
+
const f = new Ca(), m = new ue(), w = ($, I, W, q) => {
|
3681
3636
|
switch (n) {
|
3682
3637
|
case "Quad":
|
3683
|
-
|
3638
|
+
$ < W ? I < q ? f.setFromCamera(m, G) : f.setFromCamera(m, Ne) : I < q ? f.setFromCamera(m, re) : f.setFromCamera(m, Fe);
|
3684
3639
|
break;
|
3685
3640
|
case "Side by Side":
|
3686
|
-
|
3641
|
+
$ < W ? f.setFromCamera(m, G) : f.setFromCamera(m, re);
|
3687
3642
|
break;
|
3688
3643
|
case "Single":
|
3689
|
-
f.setFromCamera(
|
3644
|
+
f.setFromCamera(m, G);
|
3690
3645
|
break;
|
3691
3646
|
case "Stacked":
|
3692
|
-
|
3647
|
+
I < q ? f.setFromCamera(m, G) : f.setFromCamera(m, re);
|
3693
3648
|
break;
|
3694
3649
|
}
|
3695
|
-
},
|
3696
|
-
if (!
|
3650
|
+
}, P = ($) => {
|
3651
|
+
if (!Ot)
|
3697
3652
|
return;
|
3698
|
-
const
|
3699
|
-
e.getSize(
|
3700
|
-
const
|
3701
|
-
|
3702
|
-
const
|
3703
|
-
|
3704
|
-
},
|
3705
|
-
|
3653
|
+
const I = new ue();
|
3654
|
+
e.getSize(I);
|
3655
|
+
const W = Math.min($.clientX, I.x), q = Math.min($.clientY, I.y);
|
3656
|
+
m.x = Ke(W, 0, I.x, -1, 1), m.y = Ke(q, 0, I.y, 1, -1);
|
3657
|
+
const T = I.x / 2, N = I.y / 2, J = () => {
|
3658
|
+
W < T ? m.x = Ke(W, 0, T, -1, 1) : m.x = Ke(W, T, I.x, -1, 1);
|
3659
|
+
}, me = () => {
|
3660
|
+
q < N ? m.y = Ke(q, 0, N, 1, -1) : m.y = Ke(q, N, I.y, 1, -1);
|
3706
3661
|
};
|
3707
3662
|
switch (n) {
|
3708
3663
|
case "Quad":
|
3709
|
-
|
3664
|
+
J(), me();
|
3710
3665
|
break;
|
3711
3666
|
case "Side by Side":
|
3712
|
-
|
3667
|
+
J();
|
3713
3668
|
break;
|
3714
3669
|
case "Stacked":
|
3715
|
-
|
3670
|
+
me(), me();
|
3716
3671
|
break;
|
3717
3672
|
}
|
3718
|
-
|
3719
|
-
const
|
3720
|
-
|
3721
|
-
}, Y = (
|
3722
|
-
if (!
|
3673
|
+
w(W, q, T, N);
|
3674
|
+
const Ce = f.intersectObjects(be.children);
|
3675
|
+
Ce.length > 0 && ut.position.copy(Ce[0].point);
|
3676
|
+
}, Y = ($) => {
|
3677
|
+
if (!Ot)
|
3723
3678
|
return;
|
3724
|
-
const
|
3725
|
-
if (e.getSize(
|
3679
|
+
const I = new ue();
|
3680
|
+
if (e.getSize(I), $.clientX >= I.x)
|
3726
3681
|
return;
|
3727
|
-
|
3728
|
-
const
|
3729
|
-
|
3730
|
-
},
|
3731
|
-
return
|
3732
|
-
|
3682
|
+
P($);
|
3683
|
+
const W = f.intersectObjects(be.children);
|
3684
|
+
W.length > 0 && t.three.getObject(W[0].object.uuid);
|
3685
|
+
}, U = x.current;
|
3686
|
+
return U.addEventListener("mousemove", P, !1), U.addEventListener("click", Y, !1), () => {
|
3687
|
+
U.removeEventListener("mousemove", P), U.removeEventListener("click", Y);
|
3733
3688
|
};
|
3734
3689
|
}
|
3735
3690
|
}, [n, e]);
|
3736
|
-
const
|
3737
|
-
return
|
3738
|
-
|
3739
|
-
}), /* @__PURE__ */
|
3740
|
-
/* @__PURE__ */
|
3741
|
-
/* @__PURE__ */
|
3742
|
-
n === "Single" && /* @__PURE__ */
|
3743
|
-
|
3744
|
-
|
3745
|
-
|
3746
|
-
v !== void 0 && (G(V), V = v, w(v, x.current));
|
3691
|
+
const se = [];
|
3692
|
+
return ne.forEach((f, m) => {
|
3693
|
+
se.push(m);
|
3694
|
+
}), /* @__PURE__ */ l.jsxs("div", { className: "multiview", children: [
|
3695
|
+
/* @__PURE__ */ l.jsx("canvas", { ref: E }),
|
3696
|
+
/* @__PURE__ */ l.jsxs("div", { className: `cameras ${n === "Single" || n === "Stacked" ? "single" : ""}`, ref: x, children: [
|
3697
|
+
n === "Single" && /* @__PURE__ */ l.jsx(l.Fragment, { children: /* @__PURE__ */ l.jsx(Le, { camera: G, options: se, ref: M, onSelect: (f) => {
|
3698
|
+
ie.get(G.name)?.dispose();
|
3699
|
+
const m = ne.get(f);
|
3700
|
+
m !== void 0 && (z(G), G = m, S(m, M.current));
|
3747
3701
|
} }) }),
|
3748
|
-
(n === "Side by Side" || n === "Stacked") && /* @__PURE__ */
|
3749
|
-
/* @__PURE__ */
|
3750
|
-
|
3751
|
-
|
3752
|
-
|
3753
|
-
v !== void 0 && (G(V), V = v, w(v, x.current));
|
3702
|
+
(n === "Side by Side" || n === "Stacked") && /* @__PURE__ */ l.jsxs(l.Fragment, { children: [
|
3703
|
+
/* @__PURE__ */ l.jsx(Le, { camera: G, options: se, ref: M, onSelect: (f) => {
|
3704
|
+
ie.get(G.name)?.dispose();
|
3705
|
+
const m = ne.get(f);
|
3706
|
+
m !== void 0 && (z(G), G = m, S(m, M.current));
|
3754
3707
|
} }),
|
3755
|
-
/* @__PURE__ */
|
3756
|
-
|
3757
|
-
|
3758
|
-
|
3759
|
-
v !== void 0 && (G(ce), ce = v, w(v, T.current));
|
3708
|
+
/* @__PURE__ */ l.jsx(Le, { camera: re, options: se, ref: k, onSelect: (f) => {
|
3709
|
+
ie.get(re.name)?.dispose();
|
3710
|
+
const m = ne.get(f);
|
3711
|
+
m !== void 0 && (z(re), re = m, S(m, k.current));
|
3760
3712
|
} })
|
3761
3713
|
] }),
|
3762
|
-
n === "Quad" && /* @__PURE__ */
|
3763
|
-
/* @__PURE__ */
|
3764
|
-
|
3765
|
-
|
3766
|
-
|
3767
|
-
v !== void 0 && (G(V), V = v, w(v, x.current));
|
3714
|
+
n === "Quad" && /* @__PURE__ */ l.jsxs(l.Fragment, { children: [
|
3715
|
+
/* @__PURE__ */ l.jsx(Le, { camera: G, options: se, ref: M, onSelect: (f) => {
|
3716
|
+
ie.get(G.name)?.dispose();
|
3717
|
+
const m = ne.get(f);
|
3718
|
+
m !== void 0 && (z(G), G = m, S(m, M.current));
|
3768
3719
|
} }),
|
3769
|
-
/* @__PURE__ */
|
3770
|
-
|
3771
|
-
|
3772
|
-
|
3773
|
-
v !== void 0 && (G(ce), ce = v, w(v, T.current));
|
3720
|
+
/* @__PURE__ */ l.jsx(Le, { camera: re, options: se, ref: k, onSelect: (f) => {
|
3721
|
+
ie.get(re.name)?.dispose();
|
3722
|
+
const m = ne.get(f);
|
3723
|
+
m !== void 0 && (z(re), re = m, S(m, k.current));
|
3774
3724
|
} }),
|
3775
|
-
/* @__PURE__ */
|
3776
|
-
|
3777
|
-
|
3778
|
-
|
3779
|
-
v !== void 0 && (G(Ne), Ne = v, w(v, W.current));
|
3725
|
+
/* @__PURE__ */ l.jsx(Le, { camera: Ne, options: se, ref: H, onSelect: (f) => {
|
3726
|
+
ie.get(Ne.name)?.dispose();
|
3727
|
+
const m = ne.get(f);
|
3728
|
+
m !== void 0 && (z(Ne), Ne = m, S(m, H.current));
|
3780
3729
|
} }),
|
3781
|
-
/* @__PURE__ */
|
3782
|
-
|
3783
|
-
|
3784
|
-
|
3785
|
-
v !== void 0 && (G(Fe), Fe = v, w(v, I.current));
|
3730
|
+
/* @__PURE__ */ l.jsx(Le, { camera: Fe, options: se, ref: B, onSelect: (f) => {
|
3731
|
+
ie.get(Fe.name)?.dispose();
|
3732
|
+
const m = ne.get(f);
|
3733
|
+
m !== void 0 && (z(Fe), Fe = m, S(m, B.current));
|
3786
3734
|
} })
|
3787
3735
|
] })
|
3788
3736
|
] }),
|
3789
|
-
/* @__PURE__ */
|
3790
|
-
/* @__PURE__ */
|
3791
|
-
|
3737
|
+
/* @__PURE__ */ l.jsxs("div", { className: "settings", children: [
|
3738
|
+
/* @__PURE__ */ l.jsx(
|
3739
|
+
Mt,
|
3792
3740
|
{
|
3793
|
-
index:
|
3794
|
-
options:
|
3741
|
+
index: sn.indexOf(n),
|
3742
|
+
options: sn,
|
3795
3743
|
onSelect: (f) => {
|
3796
|
-
f !== n && (
|
3744
|
+
f !== n && (Ee(), a(f));
|
3797
3745
|
},
|
3798
3746
|
open: s,
|
3799
3747
|
onToggle: (f) => {
|
3800
|
-
|
3748
|
+
p(f), c && u(!1), d && v(!1);
|
3801
3749
|
}
|
3802
3750
|
}
|
3803
3751
|
),
|
3804
|
-
/* @__PURE__ */
|
3805
|
-
|
3752
|
+
/* @__PURE__ */ l.jsx(
|
3753
|
+
Mt,
|
3806
3754
|
{
|
3807
|
-
index:
|
3808
|
-
options:
|
3755
|
+
index: cn.indexOf(wt),
|
3756
|
+
options: cn,
|
3809
3757
|
onSelect: (f) => {
|
3810
|
-
if (f !==
|
3811
|
-
switch (
|
3758
|
+
if (f !== wt)
|
3759
|
+
switch (wt = f, wt) {
|
3812
3760
|
case "Depth":
|
3813
|
-
|
3761
|
+
V.overrideMaterial = Ai;
|
3814
3762
|
break;
|
3815
3763
|
case "Normals":
|
3816
|
-
|
3764
|
+
V.overrideMaterial = ki;
|
3817
3765
|
break;
|
3818
3766
|
default:
|
3819
3767
|
case "Renderer":
|
3820
|
-
|
3768
|
+
V.overrideMaterial = null;
|
3821
3769
|
break;
|
3822
3770
|
case "Wireframe":
|
3823
|
-
|
3771
|
+
V.overrideMaterial = ji;
|
3824
3772
|
break;
|
3825
3773
|
case "UVs":
|
3826
|
-
|
3774
|
+
V.overrideMaterial = _i;
|
3827
3775
|
break;
|
3828
3776
|
}
|
3829
3777
|
},
|
3830
3778
|
open: c,
|
3831
3779
|
onToggle: (f) => {
|
3832
|
-
s &&
|
3780
|
+
s && p(!1), u(f), d && v(!1);
|
3833
3781
|
}
|
3834
3782
|
}
|
3835
3783
|
),
|
3836
|
-
/* @__PURE__ */
|
3837
|
-
|
3784
|
+
/* @__PURE__ */ l.jsx(
|
3785
|
+
Mt,
|
3838
3786
|
{
|
3839
3787
|
index: 0,
|
3840
3788
|
options: [
|
@@ -3842,60 +3790,60 @@ function Qi(t) {
|
|
3842
3790
|
"Selection Mode"
|
3843
3791
|
],
|
3844
3792
|
onSelect: (f) => {
|
3845
|
-
|
3793
|
+
Ot = f === "Selection Mode", ut.visible = Ot;
|
3846
3794
|
},
|
3847
3795
|
open: d,
|
3848
3796
|
onToggle: (f) => {
|
3849
|
-
s &&
|
3797
|
+
s && p(!1), c && u(!1), v(f);
|
3850
3798
|
}
|
3851
3799
|
}
|
3852
3800
|
)
|
3853
3801
|
] })
|
3854
3802
|
] });
|
3855
3803
|
}
|
3856
|
-
function
|
3857
|
-
return /* @__PURE__ */
|
3858
|
-
/* @__PURE__ */
|
3804
|
+
function Ki(t) {
|
3805
|
+
return /* @__PURE__ */ l.jsxs("div", { className: "editor", ref: t.ref, style: t.style, children: [
|
3806
|
+
/* @__PURE__ */ l.jsx("header", { children: t.header }),
|
3859
3807
|
t.children,
|
3860
|
-
/* @__PURE__ */
|
3808
|
+
/* @__PURE__ */ l.jsx("footer", { children: t.footer })
|
3861
3809
|
] });
|
3862
3810
|
}
|
3863
3811
|
export {
|
3864
|
-
|
3865
|
-
|
3866
|
-
|
3867
|
-
|
3868
|
-
|
3869
|
-
|
3870
|
-
|
3871
|
-
|
3872
|
-
|
3873
|
-
|
3874
|
-
|
3875
|
-
|
3876
|
-
|
3877
|
-
|
3878
|
-
|
3879
|
-
|
3880
|
-
|
3881
|
-
|
3882
|
-
|
3883
|
-
|
3884
|
-
|
3812
|
+
Ht as Accordion,
|
3813
|
+
Gi as Application,
|
3814
|
+
Rt as BaseRemote,
|
3815
|
+
Bn as ChildObject,
|
3816
|
+
ci as ContainerObject,
|
3817
|
+
Ja as Draggable,
|
3818
|
+
Za as DraggableItem,
|
3819
|
+
Qa as Dropdown,
|
3820
|
+
ei as DropdownItem,
|
3821
|
+
Ki as Editor,
|
3822
|
+
ii as InfiniteGridHelper,
|
3823
|
+
Ti as Inspector,
|
3824
|
+
qi as MultiView,
|
3825
|
+
Fn as NavButton,
|
3826
|
+
Da as RemoteComponents,
|
3827
|
+
Vi as RemoteController,
|
3828
|
+
Oe as RemoteTheatre,
|
3829
|
+
Ya as RemoteThree,
|
3830
|
+
Nn as RemoteTweakpane,
|
3831
|
+
Wi as SceneInspector,
|
3832
|
+
Hi as SidePanel,
|
3885
3833
|
j as ToolEvents,
|
3886
|
-
|
3887
|
-
|
3888
|
-
|
3889
|
-
|
3834
|
+
si as UVMaterial,
|
3835
|
+
lt as capitalize,
|
3836
|
+
$i as clamp,
|
3837
|
+
ka as colorToHex,
|
3890
3838
|
_ as debugDispatcher,
|
3891
|
-
|
3892
|
-
|
3893
|
-
|
3894
|
-
|
3895
|
-
|
3896
|
-
|
3897
|
-
|
3898
|
-
|
3899
|
-
|
3900
|
-
|
3839
|
+
Dn as dispose,
|
3840
|
+
ja as disposeMaterial,
|
3841
|
+
Yi as disposeTexture,
|
3842
|
+
zi as distance,
|
3843
|
+
jn as hierarchyUUID,
|
3844
|
+
Aa as isColor,
|
3845
|
+
Pa as randomID,
|
3846
|
+
_a as resetThreeObjects,
|
3847
|
+
Ft as round,
|
3848
|
+
Yt as totalThreeObjects
|
3901
3849
|
};
|