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