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