@tomorrowevening/hermes 0.0.58 → 0.0.59
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 +11 -11
- package/dist/hermes.es.js +1153 -1130
- package/dist/style.css +1 -1
- package/package.json +3 -3
- package/types/core/remote/RemoteThree.d.ts +7 -2
- package/types/editor/components/content.d.ts +1 -1
package/dist/hermes.es.js
CHANGED
@@ -1,71 +1,71 @@
|
|
1
|
-
import { EventDispatcher as
|
2
|
-
import { Pane as
|
3
|
-
import * as
|
4
|
-
import
|
5
|
-
import { Reorder as
|
6
|
-
const
|
7
|
-
},
|
1
|
+
import { EventDispatcher as hn, Texture as fn, CubeTexture as Wn, RepeatWrapping as Ht, WebGLRenderTarget as Hn, Color as Lt, FrontSide as Yn, BackSide as mn, DoubleSide as pn, NoBlending as Vn, NormalBlending as qn, AdditiveBlending as Zn, SubtractiveBlending as Xn, MultiplyBlending as Jn, CustomBlending as Kn, AddEquation as Qn, SubtractEquation as ea, ReverseSubtractEquation as ta, MinEquation as na, MaxEquation as aa, ZeroFactor as gn, OneFactor as vn, SrcColorFactor as bn, OneMinusSrcColorFactor as yn, SrcAlphaFactor as xn, OneMinusSrcAlphaFactor as En, DstAlphaFactor as Cn, OneMinusDstAlphaFactor as Sn, DstColorFactor as wn, OneMinusDstColorFactor as Mn, SrcAlphaSaturateFactor as ia, ConstantColorFactor as On, OneMinusConstantColorFactor as Tn, ConstantAlphaFactor as _n, OneMinusConstantAlphaFactor as Rn, Matrix4 as ra, Vector3 as Y, Euler as sa, Line as oa, BufferGeometry as Yt, Float32BufferAttribute as Vt, LineBasicMaterial as ca, Mesh as Pn, MeshBasicMaterial as kn, Ray as la, Plane as ua, MathUtils as da, MOUSE as nt, TOUCH as at, Quaternion as qt, Spherical as Zt, Vector2 as fe, ShaderMaterial as jn, GLSL3 as ha, PlaneGeometry as fa, Scene as ma, Group as pa, AxesHelper as Xt, MeshDepthMaterial as ga, MeshNormalMaterial as va, WebGLRenderer as ba, PerspectiveCamera as kt, Raycaster as ya, OrthographicCamera as Jt, CameraHelper as xa, SpotLightHelper as Ea, PointLightHelper as Ca, HemisphereLightHelper as Sa, DirectionalLightHelper as wa } from "three";
|
2
|
+
import { Pane as Ma } from "tweakpane";
|
3
|
+
import * as Oa from "@tweakpane/plugin-essentials";
|
4
|
+
import An, { useState as X, useEffect as Ae, useRef as J, useMemo as ie, forwardRef as Ta } from "react";
|
5
|
+
import { Reorder as Dn } from "framer-motion";
|
6
|
+
const Bt = () => {
|
7
|
+
}, Pi = () => {
|
8
8
|
};
|
9
9
|
function Mt(e) {
|
10
10
|
return e.substring(0, 1).toUpperCase() + e.substring(1);
|
11
11
|
}
|
12
|
-
function
|
12
|
+
function Ze(e, n, a) {
|
13
13
|
return Math.min(n, Math.max(e, a));
|
14
14
|
}
|
15
|
-
function
|
15
|
+
function Kt(e, n, a) {
|
16
16
|
return (a - e) / (n - e);
|
17
17
|
}
|
18
|
-
function
|
18
|
+
function Qt(e, n, a) {
|
19
19
|
return e * (1 - a) + n * a;
|
20
20
|
}
|
21
|
-
function
|
21
|
+
function ki(e, n) {
|
22
22
|
const a = e - n;
|
23
23
|
return Math.sqrt(a * a);
|
24
24
|
}
|
25
25
|
function _a() {
|
26
26
|
return Math.round(Math.random() * 1e6).toString();
|
27
27
|
}
|
28
|
-
function
|
28
|
+
function Ra(e) {
|
29
29
|
return e.r !== void 0 && e.g !== void 0 && e.b !== void 0;
|
30
30
|
}
|
31
|
-
function
|
32
|
-
const n = Math.round(e.r * 255), a = Math.round(e.g * 255), t = Math.round(e.b * 255), i = (
|
33
|
-
const
|
34
|
-
return
|
35
|
-
},
|
36
|
-
return "#" +
|
31
|
+
function Pa(e) {
|
32
|
+
const n = Math.round(e.r * 255), a = Math.round(e.g * 255), t = Math.round(e.b * 255), i = (d) => {
|
33
|
+
const h = d.toString(16);
|
34
|
+
return h.length === 1 ? "0" + h : h;
|
35
|
+
}, c = i(n), u = i(a), o = i(t);
|
36
|
+
return "#" + c + u + o;
|
37
37
|
}
|
38
|
-
function
|
38
|
+
function en(e, n = 1) {
|
39
39
|
return Number(e.toFixed(n));
|
40
40
|
}
|
41
41
|
let Dt = 0;
|
42
|
-
const
|
42
|
+
const ka = () => {
|
43
43
|
Dt = 0;
|
44
|
-
},
|
44
|
+
}, In = (e) => {
|
45
45
|
if (!e)
|
46
46
|
return;
|
47
47
|
let n = e.name.replace(" ", "");
|
48
48
|
n.length === 0 && (n = `obj_${Dt}`, Dt++), e.parent !== null && e.parent.uuid.length > 0 && (n = `${e.parent.uuid}.${n}`), e.uuid = n, e.children.forEach((a) => {
|
49
|
-
|
49
|
+
In(a);
|
50
50
|
});
|
51
|
-
},
|
51
|
+
}, ji = (e) => {
|
52
52
|
e?.dispose();
|
53
|
-
},
|
53
|
+
}, ja = (e) => {
|
54
54
|
e && (Array.isArray(e) ? e.forEach((n) => n.dispose()) : e.dispose());
|
55
|
-
},
|
55
|
+
}, Ft = (e) => {
|
56
56
|
if (e) {
|
57
57
|
for (; e.children.length > 0; ) {
|
58
58
|
const n = e.children[0];
|
59
|
-
n.type === "Audio" ? (n.pause(), n.parent && n.parent.remove(n)) :
|
59
|
+
n.type === "Audio" ? (n.pause(), n.parent && n.parent.remove(n)) : Ft(n);
|
60
60
|
}
|
61
61
|
if (e.parent && e.parent.remove(e), e.isMesh) {
|
62
62
|
const n = e;
|
63
|
-
n.geometry?.dispose(),
|
63
|
+
n.geometry?.dispose(), ja(n.material);
|
64
64
|
}
|
65
65
|
e.dispose !== void 0 && e.dispose();
|
66
66
|
}
|
67
67
|
};
|
68
|
-
class
|
68
|
+
class Ai {
|
69
69
|
components = /* @__PURE__ */ new Map();
|
70
70
|
listen;
|
71
71
|
// Protected
|
@@ -123,7 +123,7 @@ class Pi {
|
|
123
123
|
n && (this._mode = "editor");
|
124
124
|
}
|
125
125
|
}
|
126
|
-
const
|
126
|
+
const j = new hn(), A = {
|
127
127
|
CUSTOM: "ToolEvents::custom",
|
128
128
|
// Components
|
129
129
|
SELECT_DROPDOWN: "ToolEvents::selectDropdown",
|
@@ -151,7 +151,7 @@ class Ot {
|
|
151
151
|
handleEditor(n, a, t) {
|
152
152
|
}
|
153
153
|
}
|
154
|
-
class
|
154
|
+
class Di extends Ot {
|
155
155
|
selectDropdown(n, a) {
|
156
156
|
this.app.send({
|
157
157
|
event: "selectComponent",
|
@@ -175,15 +175,15 @@ class ji extends Ot {
|
|
175
175
|
handleApp(n, a, t) {
|
176
176
|
switch (t.event) {
|
177
177
|
case "selectComponent":
|
178
|
-
|
178
|
+
j.dispatchEvent({ type: A.SELECT_DROPDOWN, value: t.data });
|
179
179
|
break;
|
180
180
|
case "draggableListUpdate":
|
181
|
-
|
181
|
+
j.dispatchEvent({ type: A.DRAG_UPDATE, value: t.data });
|
182
182
|
break;
|
183
183
|
}
|
184
184
|
}
|
185
185
|
}
|
186
|
-
class
|
186
|
+
class Ut extends Ot {
|
187
187
|
project;
|
188
188
|
sheets = /* @__PURE__ */ new Map();
|
189
189
|
sheetObjects = /* @__PURE__ */ new Map();
|
@@ -232,17 +232,17 @@ class Bt extends Ot {
|
|
232
232
|
console.error("Theatre Project hasn't been created yet.");
|
233
233
|
return;
|
234
234
|
}
|
235
|
-
const
|
236
|
-
if (
|
235
|
+
const c = this.sheet(n);
|
236
|
+
if (c === void 0)
|
237
237
|
return;
|
238
238
|
const u = `${n}_${a}`;
|
239
|
-
let
|
240
|
-
|
241
|
-
const
|
239
|
+
let o = this.sheetObjects.get(u);
|
240
|
+
o !== void 0 ? o = c.object(a, { ...t, ...o.value }, { reconfigure: !0 }) : o = c.object(a, t), this.sheetObjects.set(u, o), this.sheetObjectCBs.set(u, i !== void 0 ? i : Bt);
|
241
|
+
const d = o.onValuesChange((h) => {
|
242
242
|
if (this.app.editor) {
|
243
|
-
for (const m in
|
244
|
-
const x =
|
245
|
-
typeof x == "object" &&
|
243
|
+
for (const m in h) {
|
244
|
+
const x = h[m];
|
245
|
+
typeof x == "object" && Ra(x) && (h[m] = {
|
246
246
|
r: x.r,
|
247
247
|
g: x.g,
|
248
248
|
b: x.b,
|
@@ -255,14 +255,14 @@ class Bt extends Ot {
|
|
255
255
|
data: {
|
256
256
|
sheet: n,
|
257
257
|
sheetObject: u,
|
258
|
-
values:
|
258
|
+
values: h
|
259
259
|
}
|
260
260
|
});
|
261
261
|
}
|
262
262
|
const f = this.sheetObjectCBs.get(u);
|
263
|
-
f !== void 0 && f(
|
263
|
+
f !== void 0 && f(h);
|
264
264
|
});
|
265
|
-
return this.sheetObjectUnsubscribe.set(u,
|
265
|
+
return this.sheetObjectUnsubscribe.set(u, d), o;
|
266
266
|
}
|
267
267
|
unsubscribe(n) {
|
268
268
|
if (this.project === void 0) {
|
@@ -271,24 +271,24 @@ class Bt extends Ot {
|
|
271
271
|
}
|
272
272
|
const a = n.address.sheetId, t = n.address.objectKey;
|
273
273
|
this.sheets.get(a)?.detachObject(t);
|
274
|
-
const
|
275
|
-
u !== void 0 && (this.sheetObjects.delete(
|
274
|
+
const c = `${a}_${t}`, u = this.sheetObjectUnsubscribe.get(c);
|
275
|
+
u !== void 0 && (this.sheetObjects.delete(c), this.sheetObjectCBs.delete(c), this.sheetObjectUnsubscribe.delete(c), u());
|
276
276
|
}
|
277
277
|
handleApp(n, a, t) {
|
278
278
|
const i = a;
|
279
|
-
let
|
279
|
+
let c;
|
280
280
|
switch (t.event) {
|
281
281
|
case "setSheet":
|
282
|
-
|
282
|
+
c = i.sheets.get(t.data.sheet), c !== void 0 && (i.activeSheet = c, this.studio?.setSelection([c]));
|
283
283
|
break;
|
284
284
|
case "setSheetObject":
|
285
|
-
|
285
|
+
c = i.sheetObjects.get(`${t.data.sheet}_${t.data.key}`), c !== void 0 && this.studio?.setSelection([c]);
|
286
286
|
break;
|
287
287
|
case "updateSheetObject":
|
288
|
-
|
288
|
+
c = i.sheets.get(t.data.sheet), c !== void 0 && c.sequence.pause(), c = i.sheetObjectCBs.get(t.data.sheetObject), c !== void 0 && c(t.data.values);
|
289
289
|
break;
|
290
290
|
case "updateTimeline":
|
291
|
-
|
291
|
+
c = i.sheets.get(t.data.sheet), i.activeSheet !== void 0 && (i.activeSheet.sequence.position = t.data.position);
|
292
292
|
break;
|
293
293
|
}
|
294
294
|
}
|
@@ -308,28 +308,28 @@ class Bt extends Ot {
|
|
308
308
|
handleEditorApp(n, a) {
|
309
309
|
if (n.editor) {
|
310
310
|
this.studio?.ui.restore(), this.studio?.onSelectionChange((u) => {
|
311
|
-
u.length < 1 || u.forEach((
|
312
|
-
let
|
313
|
-
switch (
|
311
|
+
u.length < 1 || u.forEach((o) => {
|
312
|
+
let d = o.address.sheetId, h = "setSheet", f = {};
|
313
|
+
switch (o.type) {
|
314
314
|
case "Theatre_Sheet_PublicAPI":
|
315
|
-
|
316
|
-
sheet:
|
317
|
-
}, a.activeSheet = a.sheets.get(
|
315
|
+
h = "setSheet", f = {
|
316
|
+
sheet: o.address.sheetId
|
317
|
+
}, a.activeSheet = a.sheets.get(o.address.sheetId);
|
318
318
|
break;
|
319
319
|
case "Theatre_SheetObject_PublicAPI":
|
320
|
-
|
321
|
-
id:
|
322
|
-
sheet:
|
323
|
-
key:
|
324
|
-
}, a.activeSheet = a.sheets.get(
|
320
|
+
h = "setSheetObject", d += `_${o.address.objectKey}`, f = {
|
321
|
+
id: d,
|
322
|
+
sheet: o.address.sheetId,
|
323
|
+
key: o.address.objectKey
|
324
|
+
}, a.activeSheet = a.sheets.get(o.address.sheetId);
|
325
325
|
break;
|
326
326
|
}
|
327
|
-
n.send({ event:
|
327
|
+
n.send({ event: h, target: "app", data: f });
|
328
328
|
});
|
329
329
|
});
|
330
330
|
let t = -1;
|
331
331
|
const i = () => {
|
332
|
-
if (
|
332
|
+
if (Ut.rafDriver?.tick(performance.now()), a.activeSheet !== void 0 && t !== a.activeSheet.sequence.position) {
|
333
333
|
t = a.activeSheet.sequence.position;
|
334
334
|
const u = a.activeSheet;
|
335
335
|
n.send({
|
@@ -341,39 +341,39 @@ class Bt extends Ot {
|
|
341
341
|
}
|
342
342
|
});
|
343
343
|
}
|
344
|
-
},
|
345
|
-
i(), requestAnimationFrame(
|
344
|
+
}, c = () => {
|
345
|
+
i(), requestAnimationFrame(c);
|
346
346
|
};
|
347
|
-
i(),
|
347
|
+
i(), c();
|
348
348
|
} else
|
349
349
|
this.studio?.ui.hide();
|
350
350
|
}
|
351
351
|
}
|
352
|
-
function
|
352
|
+
function Ii(e, n, a) {
|
353
353
|
if (e.editor) {
|
354
354
|
a.ui.restore(), a.onSelectionChange((u) => {
|
355
|
-
u.length < 1 || u.forEach((
|
356
|
-
let
|
357
|
-
switch (
|
355
|
+
u.length < 1 || u.forEach((o) => {
|
356
|
+
let d = o.address.sheetId, h = "setSheet", f = {};
|
357
|
+
switch (o.type) {
|
358
358
|
case "Theatre_Sheet_PublicAPI":
|
359
|
-
|
360
|
-
sheet:
|
361
|
-
}, n.activeSheet = n.sheets.get(
|
359
|
+
h = "setSheet", f = {
|
360
|
+
sheet: o.address.sheetId
|
361
|
+
}, n.activeSheet = n.sheets.get(o.address.sheetId);
|
362
362
|
break;
|
363
363
|
case "Theatre_SheetObject_PublicAPI":
|
364
|
-
|
365
|
-
id:
|
366
|
-
sheet:
|
367
|
-
key:
|
368
|
-
}, n.activeSheet = n.sheets.get(
|
364
|
+
h = "setSheetObject", d += `_${o.address.objectKey}`, f = {
|
365
|
+
id: d,
|
366
|
+
sheet: o.address.sheetId,
|
367
|
+
key: o.address.objectKey
|
368
|
+
}, n.activeSheet = n.sheets.get(o.address.sheetId);
|
369
369
|
break;
|
370
370
|
}
|
371
|
-
e.send({ event:
|
371
|
+
e.send({ event: h, target: "app", data: f });
|
372
372
|
});
|
373
373
|
});
|
374
374
|
let t = -1;
|
375
375
|
const i = () => {
|
376
|
-
if (
|
376
|
+
if (Ut.rafDriver?.tick(performance.now()), n.activeSheet !== void 0 && t !== n.activeSheet.sequence.position) {
|
377
377
|
t = n.activeSheet.sequence.position;
|
378
378
|
const u = n.activeSheet;
|
379
379
|
e.send({
|
@@ -385,14 +385,14 @@ function Di(e, n, a) {
|
|
385
385
|
}
|
386
386
|
});
|
387
387
|
}
|
388
|
-
},
|
389
|
-
i(), requestAnimationFrame(
|
388
|
+
}, c = () => {
|
389
|
+
i(), requestAnimationFrame(c);
|
390
390
|
};
|
391
|
-
i(),
|
391
|
+
i(), c();
|
392
392
|
} else
|
393
393
|
a.ui.hide();
|
394
394
|
}
|
395
|
-
function
|
395
|
+
function Aa(e) {
|
396
396
|
if (e.name === "cameras")
|
397
397
|
return "camera";
|
398
398
|
if (e.name === "interactive")
|
@@ -417,7 +417,7 @@ function Nn(e) {
|
|
417
417
|
n.children.push(Nn(a));
|
418
418
|
}), n;
|
419
419
|
}
|
420
|
-
function
|
420
|
+
function Da(e) {
|
421
421
|
const n = {};
|
422
422
|
for (const a in e) {
|
423
423
|
const t = e[a].value;
|
@@ -425,7 +425,7 @@ function ja(e) {
|
|
425
425
|
}
|
426
426
|
return n;
|
427
427
|
}
|
428
|
-
function
|
428
|
+
function Ia(e) {
|
429
429
|
switch (e) {
|
430
430
|
case "blendSrcAlpha":
|
431
431
|
case "blendDstAlpha":
|
@@ -440,7 +440,7 @@ function Da(e) {
|
|
440
440
|
function it(e) {
|
441
441
|
const n = {};
|
442
442
|
for (const a in e) {
|
443
|
-
if (a.substring(0, 1) === "_" || a.substring(0, 2) === "is" ||
|
443
|
+
if (a.substring(0, 1) === "_" || a.substring(0, 2) === "is" || Ia(a))
|
444
444
|
continue;
|
445
445
|
const t = typeof e[a], i = e[a];
|
446
446
|
switch (t) {
|
@@ -452,13 +452,13 @@ function it(e) {
|
|
452
452
|
case "object":
|
453
453
|
if (i !== null)
|
454
454
|
if (n[a] = i, i.isTexture)
|
455
|
-
if (i instanceof
|
456
|
-
const
|
457
|
-
n[a] = { src:
|
455
|
+
if (i instanceof fn) {
|
456
|
+
const c = i.source.toJSON();
|
457
|
+
n[a] = { src: c.url };
|
458
458
|
} else
|
459
|
-
i instanceof
|
459
|
+
i instanceof Wn && (console.log("env map"), console.log(i.source.data), console.log(i.source.toJSON()), n[a] = { src: "" });
|
460
460
|
else
|
461
|
-
a === "uniforms" && (n[a] =
|
461
|
+
a === "uniforms" && (n[a] = Da(n[a]));
|
462
462
|
else
|
463
463
|
n[a] = { src: "" };
|
464
464
|
break;
|
@@ -466,7 +466,7 @@ function it(e) {
|
|
466
466
|
}
|
467
467
|
return n;
|
468
468
|
}
|
469
|
-
function
|
469
|
+
function jt(e) {
|
470
470
|
e.updateMatrix();
|
471
471
|
const n = {
|
472
472
|
name: e.name,
|
@@ -492,8 +492,8 @@ function Pt(e) {
|
|
492
492
|
const t = e;
|
493
493
|
if (Array.isArray(t.material)) {
|
494
494
|
const i = [];
|
495
|
-
t.material.forEach((
|
496
|
-
i.push(it(
|
495
|
+
t.material.forEach((c) => {
|
496
|
+
i.push(it(c));
|
497
497
|
}), n.material = i;
|
498
498
|
} else
|
499
499
|
n.material = it(t.material);
|
@@ -501,8 +501,8 @@ function Pt(e) {
|
|
501
501
|
const t = e;
|
502
502
|
if (Array.isArray(t.material)) {
|
503
503
|
const i = [];
|
504
|
-
t.material.forEach((
|
505
|
-
i.push(it(
|
504
|
+
t.material.forEach((c) => {
|
505
|
+
i.push(it(c));
|
506
506
|
}), n.material = i;
|
507
507
|
} else
|
508
508
|
n.material = it(t.material);
|
@@ -510,8 +510,8 @@ function Pt(e) {
|
|
510
510
|
const t = e;
|
511
511
|
if (Array.isArray(t.material)) {
|
512
512
|
const i = [];
|
513
|
-
t.material.forEach((
|
514
|
-
i.push(it(
|
513
|
+
t.material.forEach((c) => {
|
514
|
+
i.push(it(c));
|
515
515
|
}), n.material = i;
|
516
516
|
} else
|
517
517
|
n.material = it(t.material);
|
@@ -546,7 +546,7 @@ function Pt(e) {
|
|
546
546
|
});
|
547
547
|
return n;
|
548
548
|
}
|
549
|
-
function
|
549
|
+
function Na(e, n) {
|
550
550
|
const a = n.split(".");
|
551
551
|
switch (a.length) {
|
552
552
|
case 1:
|
@@ -563,11 +563,11 @@ function Ia(e, n) {
|
|
563
563
|
return e[a[0]][a[1]][a[2]][a[3]][a[4]][a[5]];
|
564
564
|
}
|
565
565
|
}
|
566
|
-
function
|
566
|
+
function La(e, n) {
|
567
567
|
for (const a in n)
|
568
568
|
e[a] = n[a];
|
569
569
|
}
|
570
|
-
function
|
570
|
+
function V(e, n, a) {
|
571
571
|
const t = n.split("."), i = t.length;
|
572
572
|
if (typeof a != "object")
|
573
573
|
switch (i) {
|
@@ -606,21 +606,27 @@ function Q(e, n, a) {
|
|
606
606
|
u = e[t[0]][t[1]][t[2]][t[3]][t[4]];
|
607
607
|
break;
|
608
608
|
}
|
609
|
-
u !== void 0 &&
|
609
|
+
u !== void 0 && La(u, a);
|
610
610
|
}
|
611
611
|
}
|
612
612
|
function Ln(e) {
|
613
613
|
return new Promise((n, a) => {
|
614
614
|
const t = new Image();
|
615
615
|
t.onload = () => {
|
616
|
-
const i = new
|
616
|
+
const i = new fn(t);
|
617
617
|
i.wrapS = Ht, i.wrapT = Ht, i.needsUpdate = !0, n(i);
|
618
618
|
}, t.onerror = a, t.src = e;
|
619
619
|
});
|
620
620
|
}
|
621
|
-
class
|
621
|
+
class Ni extends Ot {
|
622
622
|
scene = void 0;
|
623
623
|
renderer = void 0;
|
624
|
+
renderTargets = /* @__PURE__ */ new Map();
|
625
|
+
dispose() {
|
626
|
+
this.renderTargets.forEach((n) => {
|
627
|
+
n.dispose();
|
628
|
+
}), this.renderTargets.clear(), this.scene && Ft(this.scene), this.renderer?.dispose();
|
629
|
+
}
|
624
630
|
getObject(n) {
|
625
631
|
this.app.debugEnabled && this.app.send({
|
626
632
|
event: "getObject",
|
@@ -629,7 +635,7 @@ class Ii extends Ot {
|
|
629
635
|
});
|
630
636
|
}
|
631
637
|
setObject(n) {
|
632
|
-
const a =
|
638
|
+
const a = jt(n);
|
633
639
|
this.app.send({
|
634
640
|
event: "setObject",
|
635
641
|
target: "editor",
|
@@ -673,7 +679,7 @@ class Ii extends Ot {
|
|
673
679
|
setScene(n) {
|
674
680
|
if (n === void 0 || (this.scene = n, !this.app.debugEnabled))
|
675
681
|
return;
|
676
|
-
|
682
|
+
ka(), In(this.scene);
|
677
683
|
const a = Nn(this.scene);
|
678
684
|
this.app.send({
|
679
685
|
event: "setScene",
|
@@ -684,7 +690,7 @@ class Ii extends Ot {
|
|
684
690
|
addCamera(n) {
|
685
691
|
if (!this.app.debugEnabled)
|
686
692
|
return;
|
687
|
-
const a =
|
693
|
+
const a = jt(n);
|
688
694
|
this.app.send({
|
689
695
|
event: "addCamera",
|
690
696
|
target: "editor",
|
@@ -694,7 +700,7 @@ class Ii extends Ot {
|
|
694
700
|
removeCamera(n) {
|
695
701
|
if (!this.app.debugEnabled)
|
696
702
|
return;
|
697
|
-
const a =
|
703
|
+
const a = jt(n);
|
698
704
|
this.app.send({
|
699
705
|
event: "removeCamera",
|
700
706
|
target: "editor",
|
@@ -704,56 +710,65 @@ class Ii extends Ot {
|
|
704
710
|
handleApp(n, a, t) {
|
705
711
|
switch (t.event) {
|
706
712
|
case "getObject":
|
707
|
-
|
713
|
+
j.dispatchEvent({ type: A.GET_OBJECT, value: t.data });
|
708
714
|
break;
|
709
715
|
case "updateObject":
|
710
|
-
|
716
|
+
j.dispatchEvent({ type: A.UPDATE_OBJECT, value: t.data });
|
711
717
|
break;
|
712
718
|
case "createTexture":
|
713
|
-
|
719
|
+
j.dispatchEvent({ type: A.CREATE_TEXTURE, value: t.data });
|
714
720
|
break;
|
715
721
|
case "requestMethod":
|
716
|
-
|
722
|
+
j.dispatchEvent({ type: A.REQUEST_METHOD, value: t.data });
|
717
723
|
break;
|
718
724
|
}
|
719
725
|
}
|
720
726
|
handleEditor(n, a, t) {
|
721
727
|
switch (t.event) {
|
722
728
|
case "setObject":
|
723
|
-
|
729
|
+
j.dispatchEvent({ type: A.SET_OBJECT, value: t.data });
|
724
730
|
break;
|
725
731
|
case "setScene":
|
726
|
-
|
732
|
+
j.dispatchEvent({ type: A.SET_SCENE, value: t.data });
|
727
733
|
break;
|
728
734
|
case "addCamera":
|
729
|
-
|
735
|
+
j.dispatchEvent({ type: A.ADD_CAMERA, value: t.data });
|
730
736
|
break;
|
731
737
|
case "removeCamera":
|
732
|
-
|
738
|
+
j.dispatchEvent({ type: A.REMOVE_CAMERA, value: t.data });
|
733
739
|
break;
|
734
740
|
}
|
735
741
|
}
|
736
742
|
// Renderer
|
743
|
+
rendererWidth = 0;
|
744
|
+
rendererHeight = 0;
|
745
|
+
addRT(n, a) {
|
746
|
+
const t = new Hn(32, 32, a);
|
747
|
+
t.texture.name = n, this.renderTargets.set(n, t);
|
748
|
+
}
|
737
749
|
resize(n, a) {
|
738
|
-
this.
|
750
|
+
const t = this.dpr;
|
751
|
+
this.rendererWidth = n, this.rendererHeight = a, this.renderTargets.forEach((i) => {
|
752
|
+
i.setSize(n * t, a * t);
|
753
|
+
}), this.renderer?.setSize(n, a);
|
739
754
|
}
|
740
755
|
set dpr(n) {
|
741
|
-
this.renderer?.setPixelRatio(
|
756
|
+
this.renderer?.setPixelRatio(Ze(1, 2, n));
|
742
757
|
}
|
743
758
|
get dpr() {
|
744
759
|
return this.renderer !== void 0 ? this.renderer?.getPixelRatio() : 1;
|
745
760
|
}
|
746
761
|
get width() {
|
747
|
-
return this.
|
762
|
+
return this.rendererWidth;
|
748
763
|
}
|
749
764
|
get height() {
|
750
|
-
return this.
|
765
|
+
return this.rendererHeight;
|
751
766
|
}
|
752
767
|
get canvas() {
|
753
768
|
return this.renderer !== void 0 ? this.renderer?.domElement : null;
|
754
769
|
}
|
755
770
|
}
|
756
|
-
class
|
771
|
+
class Li extends Ot {
|
757
772
|
bindCBs;
|
758
773
|
buttonCBs;
|
759
774
|
pane = void 0;
|
@@ -764,7 +779,7 @@ class Ni extends Ot {
|
|
764
779
|
super(n), this.bindCBs = /* @__PURE__ */ new Map(), this.buttonCBs = /* @__PURE__ */ new Map(), n.editor && this.createGUI();
|
765
780
|
}
|
766
781
|
createGUI() {
|
767
|
-
this.pane = new
|
782
|
+
this.pane = new Ma({ title: "GUI" }), this.pane.registerPlugin(Oa);
|
768
783
|
}
|
769
784
|
dispose() {
|
770
785
|
this.bindCBs.clear(), this.buttonCBs.clear(), this.appCallbacks = 0, this.editorCallbacks = 0, this.app.editor && (this.pane?.dispose(), this.pane = void 0);
|
@@ -790,21 +805,21 @@ class Ni extends Ot {
|
|
790
805
|
}
|
791
806
|
// Binding
|
792
807
|
bind(n, a, t, i = void 0) {
|
793
|
-
const
|
794
|
-
this.bindCBs.set(
|
808
|
+
const c = this.bindID, u = t.onChange !== void 0 ? t.onChange : Bt;
|
809
|
+
this.bindCBs.set(c, u), this.app.editor ? (this.pane === void 0 && this.createGUI(), (i !== void 0 ? i : this.pane).addBinding(n, a, t).on("change", (d) => {
|
795
810
|
this.app.send({
|
796
811
|
event: "updateBind",
|
797
812
|
target: "app",
|
798
813
|
data: {
|
799
|
-
id:
|
800
|
-
value:
|
814
|
+
id: c,
|
815
|
+
value: d.value
|
801
816
|
}
|
802
817
|
});
|
803
818
|
}), this.editorCallbacks++) : (this.app.send({
|
804
819
|
event: "bindObject",
|
805
820
|
target: "app",
|
806
821
|
data: {
|
807
|
-
id:
|
822
|
+
id: c,
|
808
823
|
name: a,
|
809
824
|
params: t,
|
810
825
|
parent: i
|
@@ -881,21 +896,21 @@ var It = { exports: {} }, lt = {};
|
|
881
896
|
* This source code is licensed under the MIT license found in the
|
882
897
|
* LICENSE file in the root directory of this source tree.
|
883
898
|
*/
|
884
|
-
var
|
885
|
-
function
|
886
|
-
if (
|
899
|
+
var tn;
|
900
|
+
function Ba() {
|
901
|
+
if (tn)
|
887
902
|
return lt;
|
888
|
-
|
889
|
-
var e =
|
890
|
-
function u(
|
891
|
-
var f, m = {}, x = null,
|
892
|
-
|
893
|
-
for (f in
|
894
|
-
t.call(
|
895
|
-
if (
|
896
|
-
for (f in
|
897
|
-
m[f] === void 0 && (m[f] =
|
898
|
-
return { $$typeof: n, type:
|
903
|
+
tn = 1;
|
904
|
+
var e = An, n = Symbol.for("react.element"), a = Symbol.for("react.fragment"), t = Object.prototype.hasOwnProperty, i = e.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.ReactCurrentOwner, c = { key: !0, ref: !0, __self: !0, __source: !0 };
|
905
|
+
function u(o, d, h) {
|
906
|
+
var f, m = {}, x = null, T = null;
|
907
|
+
h !== void 0 && (x = "" + h), d.key !== void 0 && (x = "" + d.key), d.ref !== void 0 && (T = d.ref);
|
908
|
+
for (f in d)
|
909
|
+
t.call(d, f) && !c.hasOwnProperty(f) && (m[f] = d[f]);
|
910
|
+
if (o && o.defaultProps)
|
911
|
+
for (f in d = o.defaultProps, d)
|
912
|
+
m[f] === void 0 && (m[f] = d[f]);
|
913
|
+
return { $$typeof: n, type: o, key: x, ref: T, props: m, _owner: i.current };
|
899
914
|
}
|
900
915
|
return lt.Fragment = a, lt.jsx = u, lt.jsxs = u, lt;
|
901
916
|
}
|
@@ -909,10 +924,10 @@ var ut = {};
|
|
909
924
|
* This source code is licensed under the MIT license found in the
|
910
925
|
* LICENSE file in the root directory of this source tree.
|
911
926
|
*/
|
912
|
-
var
|
927
|
+
var nn;
|
913
928
|
function Fa() {
|
914
|
-
return
|
915
|
-
var e =
|
929
|
+
return nn || (nn = 1, process.env.NODE_ENV !== "production" && function() {
|
930
|
+
var e = An, n = Symbol.for("react.element"), a = Symbol.for("react.portal"), t = Symbol.for("react.fragment"), i = Symbol.for("react.strict_mode"), c = Symbol.for("react.profiler"), u = Symbol.for("react.provider"), o = Symbol.for("react.context"), d = Symbol.for("react.forward_ref"), h = Symbol.for("react.suspense"), f = Symbol.for("react.suspense_list"), m = Symbol.for("react.memo"), x = Symbol.for("react.lazy"), T = Symbol.for("react.offscreen"), H = Symbol.iterator, te = "@@iterator";
|
916
931
|
function me(r) {
|
917
932
|
if (r === null || typeof r != "object")
|
918
933
|
return null;
|
@@ -922,41 +937,41 @@ function Fa() {
|
|
922
937
|
var re = e.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED;
|
923
938
|
function $(r) {
|
924
939
|
{
|
925
|
-
for (var p = arguments.length, b = new Array(p > 1 ? p - 1 : 0),
|
926
|
-
b[
|
927
|
-
|
940
|
+
for (var p = arguments.length, b = new Array(p > 1 ? p - 1 : 0), S = 1; S < p; S++)
|
941
|
+
b[S - 1] = arguments[S];
|
942
|
+
I("error", r, b);
|
928
943
|
}
|
929
944
|
}
|
930
|
-
function
|
945
|
+
function I(r, p, b) {
|
931
946
|
{
|
932
|
-
var
|
933
|
-
|
934
|
-
var U = b.map(function(
|
935
|
-
return String(
|
947
|
+
var S = re.ReactDebugCurrentFrame, L = S.getStackAddendum();
|
948
|
+
L !== "" && (p += "%s", b = b.concat([L]));
|
949
|
+
var U = b.map(function(k) {
|
950
|
+
return String(k);
|
936
951
|
});
|
937
952
|
U.unshift("Warning: " + p), Function.prototype.apply.call(console[r], console, U);
|
938
953
|
}
|
939
954
|
}
|
940
|
-
var
|
941
|
-
|
942
|
-
function
|
943
|
-
return !!(typeof r == "string" || typeof r == "function" || r === t || r ===
|
955
|
+
var q = !1, ne = !1, Se = !1, z = !1, pe = !1, ce;
|
956
|
+
ce = Symbol.for("react.module.reference");
|
957
|
+
function Te(r) {
|
958
|
+
return !!(typeof r == "string" || typeof r == "function" || r === t || r === c || pe || r === i || r === h || r === f || z || r === T || q || ne || Se || typeof r == "object" && r !== null && (r.$$typeof === x || r.$$typeof === m || r.$$typeof === u || r.$$typeof === o || r.$$typeof === d || // This needs to include all possible module reference object
|
944
959
|
// types supported by any Flight configuration anywhere since
|
945
960
|
// we don't know which Flight build this will end up being used
|
946
961
|
// with.
|
947
|
-
r.$$typeof ===
|
962
|
+
r.$$typeof === ce || r.getModuleId !== void 0));
|
948
963
|
}
|
949
|
-
function
|
950
|
-
var
|
951
|
-
if (
|
952
|
-
return
|
953
|
-
var
|
954
|
-
return
|
964
|
+
function _e(r, p, b) {
|
965
|
+
var S = r.displayName;
|
966
|
+
if (S)
|
967
|
+
return S;
|
968
|
+
var L = p.displayName || p.name || "";
|
969
|
+
return L !== "" ? b + "(" + L + ")" : b;
|
955
970
|
}
|
956
971
|
function ve(r) {
|
957
972
|
return r.displayName || "Context";
|
958
973
|
}
|
959
|
-
function
|
974
|
+
function N(r) {
|
960
975
|
if (r == null)
|
961
976
|
return null;
|
962
977
|
if (typeof r.tag == "number" && $("Received an unexpected object in getComponentNameFromType(). This is likely a bug in React. Please file an issue."), typeof r == "function")
|
@@ -968,32 +983,32 @@ function Fa() {
|
|
968
983
|
return "Fragment";
|
969
984
|
case a:
|
970
985
|
return "Portal";
|
971
|
-
case
|
986
|
+
case c:
|
972
987
|
return "Profiler";
|
973
988
|
case i:
|
974
989
|
return "StrictMode";
|
975
|
-
case
|
990
|
+
case h:
|
976
991
|
return "Suspense";
|
977
992
|
case f:
|
978
993
|
return "SuspenseList";
|
979
994
|
}
|
980
995
|
if (typeof r == "object")
|
981
996
|
switch (r.$$typeof) {
|
982
|
-
case
|
997
|
+
case o:
|
983
998
|
var p = r;
|
984
999
|
return ve(p) + ".Consumer";
|
985
1000
|
case u:
|
986
1001
|
var b = r;
|
987
1002
|
return ve(b._context) + ".Provider";
|
988
|
-
case
|
989
|
-
return
|
1003
|
+
case d:
|
1004
|
+
return _e(r, r.render, "ForwardRef");
|
990
1005
|
case m:
|
991
|
-
var
|
992
|
-
return
|
1006
|
+
var S = r.displayName || null;
|
1007
|
+
return S !== null ? S : N(r.type) || "Memo";
|
993
1008
|
case x: {
|
994
|
-
var
|
1009
|
+
var L = r, U = L._payload, k = L._init;
|
995
1010
|
try {
|
996
|
-
return
|
1011
|
+
return N(k(U));
|
997
1012
|
} catch {
|
998
1013
|
return null;
|
999
1014
|
}
|
@@ -1001,18 +1016,18 @@ function Fa() {
|
|
1001
1016
|
}
|
1002
1017
|
return null;
|
1003
1018
|
}
|
1004
|
-
var be = Object.assign,
|
1005
|
-
function
|
1019
|
+
var be = Object.assign, w = 0, we, Re, De, Pe, ke, Ie, Be;
|
1020
|
+
function Fe() {
|
1006
1021
|
}
|
1007
|
-
|
1022
|
+
Fe.__reactDisabledLog = !0;
|
1008
1023
|
function ae() {
|
1009
1024
|
{
|
1010
|
-
if (
|
1011
|
-
we = console.log, Re = console.info,
|
1025
|
+
if (w === 0) {
|
1026
|
+
we = console.log, Re = console.info, De = console.warn, Pe = console.error, ke = console.group, Ie = console.groupCollapsed, Be = console.groupEnd;
|
1012
1027
|
var r = {
|
1013
1028
|
configurable: !0,
|
1014
1029
|
enumerable: !0,
|
1015
|
-
value:
|
1030
|
+
value: Fe,
|
1016
1031
|
writable: !0
|
1017
1032
|
};
|
1018
1033
|
Object.defineProperties(console, {
|
@@ -1025,12 +1040,12 @@ function Fa() {
|
|
1025
1040
|
groupEnd: r
|
1026
1041
|
});
|
1027
1042
|
}
|
1028
|
-
|
1043
|
+
w++;
|
1029
1044
|
}
|
1030
1045
|
}
|
1031
1046
|
function Me() {
|
1032
1047
|
{
|
1033
|
-
if (
|
1048
|
+
if (w--, w === 0) {
|
1034
1049
|
var r = {
|
1035
1050
|
configurable: !0,
|
1036
1051
|
enumerable: !0,
|
@@ -1044,45 +1059,45 @@ function Fa() {
|
|
1044
1059
|
value: Re
|
1045
1060
|
}),
|
1046
1061
|
warn: be({}, r, {
|
1047
|
-
value:
|
1062
|
+
value: De
|
1048
1063
|
}),
|
1049
1064
|
error: be({}, r, {
|
1050
|
-
value:
|
1065
|
+
value: Pe
|
1051
1066
|
}),
|
1052
1067
|
group: be({}, r, {
|
1053
1068
|
value: ke
|
1054
1069
|
}),
|
1055
1070
|
groupCollapsed: be({}, r, {
|
1056
|
-
value:
|
1071
|
+
value: Ie
|
1057
1072
|
}),
|
1058
1073
|
groupEnd: be({}, r, {
|
1059
|
-
value:
|
1074
|
+
value: Be
|
1060
1075
|
})
|
1061
1076
|
});
|
1062
1077
|
}
|
1063
|
-
|
1078
|
+
w < 0 && $("disabledDepth fell below zero. This is a bug in React. Please file an issue.");
|
1064
1079
|
}
|
1065
1080
|
}
|
1066
|
-
var
|
1081
|
+
var He = re.ReactCurrentDispatcher, Ye;
|
1067
1082
|
function ue(r, p, b) {
|
1068
1083
|
{
|
1069
|
-
if (
|
1084
|
+
if (Ye === void 0)
|
1070
1085
|
try {
|
1071
1086
|
throw Error();
|
1072
|
-
} catch (
|
1073
|
-
var
|
1074
|
-
|
1087
|
+
} catch (L) {
|
1088
|
+
var S = L.stack.trim().match(/\n( *(at )?)/);
|
1089
|
+
Ye = S && S[1] || "";
|
1075
1090
|
}
|
1076
1091
|
return `
|
1077
|
-
` +
|
1092
|
+
` + Ye + r;
|
1078
1093
|
}
|
1079
1094
|
}
|
1080
1095
|
var g = !1, v;
|
1081
1096
|
{
|
1082
|
-
var
|
1083
|
-
v = new
|
1097
|
+
var M = typeof WeakMap == "function" ? WeakMap : Map;
|
1098
|
+
v = new M();
|
1084
1099
|
}
|
1085
|
-
function
|
1100
|
+
function P(r, p) {
|
1086
1101
|
if (!r || g)
|
1087
1102
|
return "";
|
1088
1103
|
{
|
@@ -1090,137 +1105,137 @@ function Fa() {
|
|
1090
1105
|
if (b !== void 0)
|
1091
1106
|
return b;
|
1092
1107
|
}
|
1093
|
-
var
|
1108
|
+
var S;
|
1094
1109
|
g = !0;
|
1095
|
-
var
|
1110
|
+
var L = Error.prepareStackTrace;
|
1096
1111
|
Error.prepareStackTrace = void 0;
|
1097
1112
|
var U;
|
1098
|
-
U =
|
1113
|
+
U = He.current, He.current = null, ae();
|
1099
1114
|
try {
|
1100
1115
|
if (p) {
|
1101
|
-
var
|
1116
|
+
var k = function() {
|
1102
1117
|
throw Error();
|
1103
1118
|
};
|
1104
|
-
if (Object.defineProperty(
|
1119
|
+
if (Object.defineProperty(k.prototype, "props", {
|
1105
1120
|
set: function() {
|
1106
1121
|
throw Error();
|
1107
1122
|
}
|
1108
1123
|
}), typeof Reflect == "object" && Reflect.construct) {
|
1109
1124
|
try {
|
1110
|
-
Reflect.construct(
|
1111
|
-
} catch (
|
1112
|
-
|
1125
|
+
Reflect.construct(k, []);
|
1126
|
+
} catch (Le) {
|
1127
|
+
S = Le;
|
1113
1128
|
}
|
1114
|
-
Reflect.construct(r, [],
|
1129
|
+
Reflect.construct(r, [], k);
|
1115
1130
|
} else {
|
1116
1131
|
try {
|
1117
|
-
|
1118
|
-
} catch (
|
1119
|
-
|
1132
|
+
k.call();
|
1133
|
+
} catch (Le) {
|
1134
|
+
S = Le;
|
1120
1135
|
}
|
1121
|
-
r.call(
|
1136
|
+
r.call(k.prototype);
|
1122
1137
|
}
|
1123
1138
|
} else {
|
1124
1139
|
try {
|
1125
1140
|
throw Error();
|
1126
|
-
} catch (
|
1127
|
-
|
1141
|
+
} catch (Le) {
|
1142
|
+
S = Le;
|
1128
1143
|
}
|
1129
1144
|
r();
|
1130
1145
|
}
|
1131
|
-
} catch (
|
1132
|
-
if (
|
1133
|
-
for (var R =
|
1134
|
-
`), he =
|
1135
|
-
`),
|
1136
|
-
|
1137
|
-
for (;
|
1138
|
-
if (R[
|
1139
|
-
if (
|
1146
|
+
} catch (Le) {
|
1147
|
+
if (Le && S && typeof Le.stack == "string") {
|
1148
|
+
for (var R = Le.stack.split(`
|
1149
|
+
`), he = S.stack.split(`
|
1150
|
+
`), Z = R.length - 1, Q = he.length - 1; Z >= 1 && Q >= 0 && R[Z] !== he[Q]; )
|
1151
|
+
Q--;
|
1152
|
+
for (; Z >= 1 && Q >= 0; Z--, Q--)
|
1153
|
+
if (R[Z] !== he[Q]) {
|
1154
|
+
if (Z !== 1 || Q !== 1)
|
1140
1155
|
do
|
1141
|
-
if (
|
1156
|
+
if (Z--, Q--, Q < 0 || R[Z] !== he[Q]) {
|
1142
1157
|
var Ce = `
|
1143
|
-
` + R[
|
1158
|
+
` + R[Z].replace(" at new ", " at ");
|
1144
1159
|
return r.displayName && Ce.includes("<anonymous>") && (Ce = Ce.replace("<anonymous>", r.displayName)), typeof r == "function" && v.set(r, Ce), Ce;
|
1145
1160
|
}
|
1146
|
-
while (
|
1161
|
+
while (Z >= 1 && Q >= 0);
|
1147
1162
|
break;
|
1148
1163
|
}
|
1149
1164
|
}
|
1150
1165
|
} finally {
|
1151
|
-
g = !1,
|
1166
|
+
g = !1, He.current = U, Me(), Error.prepareStackTrace = L;
|
1152
1167
|
}
|
1153
|
-
var tt = r ? r.displayName || r.name : "",
|
1154
|
-
return typeof r == "function" && v.set(r,
|
1168
|
+
var tt = r ? r.displayName || r.name : "", Wt = tt ? ue(tt) : "";
|
1169
|
+
return typeof r == "function" && v.set(r, Wt), Wt;
|
1155
1170
|
}
|
1156
1171
|
function ge(r, p, b) {
|
1157
|
-
return
|
1172
|
+
return P(r, !1);
|
1158
1173
|
}
|
1159
|
-
function
|
1174
|
+
function le(r) {
|
1160
1175
|
var p = r.prototype;
|
1161
1176
|
return !!(p && p.isReactComponent);
|
1162
1177
|
}
|
1163
|
-
function
|
1178
|
+
function C(r, p, b) {
|
1164
1179
|
if (r == null)
|
1165
1180
|
return "";
|
1166
1181
|
if (typeof r == "function")
|
1167
|
-
return
|
1182
|
+
return P(r, le(r));
|
1168
1183
|
if (typeof r == "string")
|
1169
1184
|
return ue(r);
|
1170
1185
|
switch (r) {
|
1171
|
-
case
|
1186
|
+
case h:
|
1172
1187
|
return ue("Suspense");
|
1173
1188
|
case f:
|
1174
1189
|
return ue("SuspenseList");
|
1175
1190
|
}
|
1176
1191
|
if (typeof r == "object")
|
1177
1192
|
switch (r.$$typeof) {
|
1178
|
-
case
|
1193
|
+
case d:
|
1179
1194
|
return ge(r.render);
|
1180
1195
|
case m:
|
1181
|
-
return
|
1196
|
+
return C(r.type, p, b);
|
1182
1197
|
case x: {
|
1183
|
-
var
|
1198
|
+
var S = r, L = S._payload, U = S._init;
|
1184
1199
|
try {
|
1185
|
-
return
|
1200
|
+
return C(U(L), p, b);
|
1186
1201
|
} catch {
|
1187
1202
|
}
|
1188
1203
|
}
|
1189
1204
|
}
|
1190
1205
|
return "";
|
1191
1206
|
}
|
1192
|
-
var
|
1193
|
-
function
|
1207
|
+
var E = Object.prototype.hasOwnProperty, F = {}, K = re.ReactDebugCurrentFrame;
|
1208
|
+
function O(r) {
|
1194
1209
|
if (r) {
|
1195
|
-
var p = r._owner, b =
|
1196
|
-
|
1210
|
+
var p = r._owner, b = C(r.type, r._source, p ? p.type : null);
|
1211
|
+
K.setExtraStackFrame(b);
|
1197
1212
|
} else
|
1198
|
-
|
1213
|
+
K.setExtraStackFrame(null);
|
1199
1214
|
}
|
1200
|
-
function B(r, p, b,
|
1215
|
+
function B(r, p, b, S, L) {
|
1201
1216
|
{
|
1202
|
-
var U = Function.call.bind(
|
1203
|
-
for (var
|
1204
|
-
if (U(r,
|
1217
|
+
var U = Function.call.bind(E);
|
1218
|
+
for (var k in r)
|
1219
|
+
if (U(r, k)) {
|
1205
1220
|
var R = void 0;
|
1206
1221
|
try {
|
1207
|
-
if (typeof r[
|
1208
|
-
var he = Error((
|
1222
|
+
if (typeof r[k] != "function") {
|
1223
|
+
var he = Error((S || "React class") + ": " + b + " type `" + k + "` is invalid; it must be a function, usually from the `prop-types` package, but received `" + typeof r[k] + "`.This often happens because of typos such as `PropTypes.function` instead of `PropTypes.func`.");
|
1209
1224
|
throw he.name = "Invariant Violation", he;
|
1210
1225
|
}
|
1211
|
-
R = r[
|
1212
|
-
} catch (
|
1213
|
-
R =
|
1226
|
+
R = r[k](p, k, S, b, null, "SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED");
|
1227
|
+
} catch (Z) {
|
1228
|
+
R = Z;
|
1214
1229
|
}
|
1215
|
-
R && !(R instanceof Error) && (
|
1230
|
+
R && !(R instanceof Error) && (O(L), $("%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).", S || "React class", b, k, typeof R), O(null)), R instanceof Error && !(R.message in F) && (F[R.message] = !0, O(L), $("Failed %s type: %s", b, R.message), O(null));
|
1216
1231
|
}
|
1217
1232
|
}
|
1218
1233
|
}
|
1219
|
-
var
|
1220
|
-
function
|
1221
|
-
return
|
1234
|
+
var G = Array.isArray;
|
1235
|
+
function Ne(r) {
|
1236
|
+
return G(r);
|
1222
1237
|
}
|
1223
|
-
function
|
1238
|
+
function Ke(r) {
|
1224
1239
|
{
|
1225
1240
|
var p = typeof Symbol == "function" && Symbol.toStringTag, b = p && r[Symbol.toStringTag] || r.constructor.name || "Object";
|
1226
1241
|
return b;
|
@@ -1238,7 +1253,7 @@ function Fa() {
|
|
1238
1253
|
}
|
1239
1254
|
function st(r) {
|
1240
1255
|
if (mt(r))
|
1241
|
-
return $("The provided key is an unsupported type %s. This value must be coerced to a string before before using it here.",
|
1256
|
+
return $("The provided key is an unsupported type %s. This value must be coerced to a string before before using it here.", Ke(r)), pt(r);
|
1242
1257
|
}
|
1243
1258
|
var Ue = re.ReactCurrentOwner, ot = {
|
1244
1259
|
key: !0,
|
@@ -1247,8 +1262,8 @@ function Fa() {
|
|
1247
1262
|
__source: !0
|
1248
1263
|
}, ct, gt, Qe;
|
1249
1264
|
Qe = {};
|
1250
|
-
function
|
1251
|
-
if (
|
1265
|
+
function _t(r) {
|
1266
|
+
if (E.call(r, "ref")) {
|
1252
1267
|
var p = Object.getOwnPropertyDescriptor(r, "ref").get;
|
1253
1268
|
if (p && p.isReactWarning)
|
1254
1269
|
return !1;
|
@@ -1256,17 +1271,17 @@ function Fa() {
|
|
1256
1271
|
return r.ref !== void 0;
|
1257
1272
|
}
|
1258
1273
|
function Rt(r) {
|
1259
|
-
if (
|
1274
|
+
if (E.call(r, "key")) {
|
1260
1275
|
var p = Object.getOwnPropertyDescriptor(r, "key").get;
|
1261
1276
|
if (p && p.isReactWarning)
|
1262
1277
|
return !1;
|
1263
1278
|
}
|
1264
1279
|
return r.key !== void 0;
|
1265
1280
|
}
|
1266
|
-
function
|
1281
|
+
function Pt(r, p) {
|
1267
1282
|
if (typeof r.ref == "string" && Ue.current && p && Ue.current.stateNode !== p) {
|
1268
|
-
var b =
|
1269
|
-
Qe[b] || ($('Component "%s" contains the string ref "%s". Support for string refs will be removed in a future major release. This case cannot be automatically converted to an arrow function. We ask you to manually fix this case by using useRef() or createRef() instead. Learn more about using refs safely here: https://reactjs.org/link/strict-mode-string-ref',
|
1283
|
+
var b = N(Ue.current.type);
|
1284
|
+
Qe[b] || ($('Component "%s" contains the string ref "%s". Support for string refs will be removed in a future major release. This case cannot be automatically converted to an arrow function. We ask you to manually fix this case by using useRef() or createRef() instead. Learn more about using refs safely here: https://reactjs.org/link/strict-mode-string-ref', N(Ue.current.type), r.ref), Qe[b] = !0);
|
1270
1285
|
}
|
1271
1286
|
}
|
1272
1287
|
function vt(r, p) {
|
@@ -1291,7 +1306,7 @@ function Fa() {
|
|
1291
1306
|
});
|
1292
1307
|
}
|
1293
1308
|
}
|
1294
|
-
var
|
1309
|
+
var zt = function(r, p, b, S, L, U, k) {
|
1295
1310
|
var R = {
|
1296
1311
|
// This tag allows us to uniquely identify this as a React Element
|
1297
1312
|
$$typeof: n,
|
@@ -1299,7 +1314,7 @@ function Fa() {
|
|
1299
1314
|
type: r,
|
1300
1315
|
key: p,
|
1301
1316
|
ref: b,
|
1302
|
-
props:
|
1317
|
+
props: k,
|
1303
1318
|
// Record the component responsible for creating this element.
|
1304
1319
|
_owner: U
|
1305
1320
|
};
|
@@ -1312,39 +1327,39 @@ function Fa() {
|
|
1312
1327
|
configurable: !1,
|
1313
1328
|
enumerable: !1,
|
1314
1329
|
writable: !1,
|
1315
|
-
value:
|
1330
|
+
value: S
|
1316
1331
|
}), Object.defineProperty(R, "_source", {
|
1317
1332
|
configurable: !1,
|
1318
1333
|
enumerable: !1,
|
1319
1334
|
writable: !1,
|
1320
|
-
value:
|
1335
|
+
value: L
|
1321
1336
|
}), Object.freeze && (Object.freeze(R.props), Object.freeze(R)), R;
|
1322
1337
|
};
|
1323
|
-
function s(r, p, b,
|
1338
|
+
function s(r, p, b, S, L) {
|
1324
1339
|
{
|
1325
|
-
var U,
|
1326
|
-
b !== void 0 && (st(b), R = "" + b), Rt(p) && (st(p.key), R = "" + p.key),
|
1340
|
+
var U, k = {}, R = null, he = null;
|
1341
|
+
b !== void 0 && (st(b), R = "" + b), Rt(p) && (st(p.key), R = "" + p.key), _t(p) && (he = p.ref, Pt(p, L));
|
1327
1342
|
for (U in p)
|
1328
|
-
|
1343
|
+
E.call(p, U) && !ot.hasOwnProperty(U) && (k[U] = p[U]);
|
1329
1344
|
if (r && r.defaultProps) {
|
1330
|
-
var
|
1331
|
-
for (U in
|
1332
|
-
|
1345
|
+
var Z = r.defaultProps;
|
1346
|
+
for (U in Z)
|
1347
|
+
k[U] === void 0 && (k[U] = Z[U]);
|
1333
1348
|
}
|
1334
1349
|
if (R || he) {
|
1335
|
-
var
|
1336
|
-
R && vt(
|
1350
|
+
var Q = typeof r == "function" ? r.displayName || r.name || "Unknown" : r;
|
1351
|
+
R && vt(k, Q), he && $e(k, Q);
|
1337
1352
|
}
|
1338
|
-
return
|
1353
|
+
return zt(r, R, he, L, S, Ue.current, k);
|
1339
1354
|
}
|
1340
1355
|
}
|
1341
|
-
var y = re.ReactCurrentOwner,
|
1342
|
-
function
|
1356
|
+
var y = re.ReactCurrentOwner, _ = re.ReactDebugCurrentFrame;
|
1357
|
+
function D(r) {
|
1343
1358
|
if (r) {
|
1344
|
-
var p = r._owner, b =
|
1345
|
-
|
1359
|
+
var p = r._owner, b = C(r.type, r._source, p ? p.type : null);
|
1360
|
+
_.setExtraStackFrame(b);
|
1346
1361
|
} else
|
1347
|
-
|
1362
|
+
_.setExtraStackFrame(null);
|
1348
1363
|
}
|
1349
1364
|
var ee;
|
1350
1365
|
ee = !1;
|
@@ -1354,7 +1369,7 @@ function Fa() {
|
|
1354
1369
|
function de() {
|
1355
1370
|
{
|
1356
1371
|
if (y.current) {
|
1357
|
-
var r =
|
1372
|
+
var r = N(y.current.type);
|
1358
1373
|
if (r)
|
1359
1374
|
return `
|
1360
1375
|
|
@@ -1363,7 +1378,7 @@ Check the render method of \`` + r + "`.";
|
|
1363
1378
|
return "";
|
1364
1379
|
}
|
1365
1380
|
}
|
1366
|
-
function
|
1381
|
+
function Gt(r) {
|
1367
1382
|
{
|
1368
1383
|
if (r !== void 0) {
|
1369
1384
|
var p = r.fileName.replace(/^.*[\\\/]/, ""), b = r.lineNumber;
|
@@ -1396,30 +1411,30 @@ Check the top-level render call using <` + b + ">.");
|
|
1396
1411
|
if (bt[b])
|
1397
1412
|
return;
|
1398
1413
|
bt[b] = !0;
|
1399
|
-
var
|
1400
|
-
r && r._owner && r._owner !== y.current && (
|
1414
|
+
var S = "";
|
1415
|
+
r && r._owner && r._owner !== y.current && (S = " It was passed a child from " + N(r._owner.type) + "."), D(r), $('Each child in a list should have a unique "key" prop.%s%s See https://reactjs.org/link/warning-keys for more information.', b, S), D(null);
|
1401
1416
|
}
|
1402
1417
|
}
|
1403
1418
|
function Ee(r, p) {
|
1404
1419
|
{
|
1405
1420
|
if (typeof r != "object")
|
1406
1421
|
return;
|
1407
|
-
if (
|
1422
|
+
if (Ne(r))
|
1408
1423
|
for (var b = 0; b < r.length; b++) {
|
1409
|
-
var
|
1410
|
-
ye(
|
1424
|
+
var S = r[b];
|
1425
|
+
ye(S) && xe(S, p);
|
1411
1426
|
}
|
1412
1427
|
else if (ye(r))
|
1413
1428
|
r._store && (r._store.validated = !0);
|
1414
1429
|
else if (r) {
|
1415
|
-
var
|
1416
|
-
if (typeof
|
1417
|
-
for (var U =
|
1418
|
-
ye(
|
1430
|
+
var L = me(r);
|
1431
|
+
if (typeof L == "function" && L !== r.entries)
|
1432
|
+
for (var U = L.call(r), k; !(k = U.next()).done; )
|
1433
|
+
ye(k.value) && xe(k.value, p);
|
1419
1434
|
}
|
1420
1435
|
}
|
1421
1436
|
}
|
1422
|
-
function
|
1437
|
+
function Ve(r) {
|
1423
1438
|
{
|
1424
1439
|
var p = r.type;
|
1425
1440
|
if (p == null || typeof p == "string")
|
@@ -1427,19 +1442,19 @@ Check the top-level render call using <` + b + ">.");
|
|
1427
1442
|
var b;
|
1428
1443
|
if (typeof p == "function")
|
1429
1444
|
b = p.propTypes;
|
1430
|
-
else if (typeof p == "object" && (p.$$typeof ===
|
1445
|
+
else if (typeof p == "object" && (p.$$typeof === d || // Note: Memo only checks outer props here.
|
1431
1446
|
// Inner props are checked in the reconciler.
|
1432
1447
|
p.$$typeof === m))
|
1433
1448
|
b = p.propTypes;
|
1434
1449
|
else
|
1435
1450
|
return;
|
1436
1451
|
if (b) {
|
1437
|
-
var
|
1438
|
-
B(b, r.props, "prop",
|
1452
|
+
var S = N(p);
|
1453
|
+
B(b, r.props, "prop", S, r);
|
1439
1454
|
} else if (p.PropTypes !== void 0 && !ee) {
|
1440
1455
|
ee = !0;
|
1441
|
-
var
|
1442
|
-
$("Component %s declared `PropTypes` instead of `propTypes`. Did you misspell the property assignment?",
|
1456
|
+
var L = N(p);
|
1457
|
+
$("Component %s declared `PropTypes` instead of `propTypes`. Did you misspell the property assignment?", L || "Unknown");
|
1443
1458
|
}
|
1444
1459
|
typeof p.getDefaultProps == "function" && !p.getDefaultProps.isReactClassApproved && $("getDefaultProps is only used on classic React.createClass definitions. Use a static property named `defaultProps` instead.");
|
1445
1460
|
}
|
@@ -1447,34 +1462,34 @@ Check the top-level render call using <` + b + ">.");
|
|
1447
1462
|
function Oe(r) {
|
1448
1463
|
{
|
1449
1464
|
for (var p = Object.keys(r.props), b = 0; b < p.length; b++) {
|
1450
|
-
var
|
1451
|
-
if (
|
1452
|
-
|
1465
|
+
var S = p[b];
|
1466
|
+
if (S !== "children" && S !== "key") {
|
1467
|
+
D(r), $("Invalid prop `%s` supplied to `React.Fragment`. React.Fragment can only have `key` and `children` props.", S), D(null);
|
1453
1468
|
break;
|
1454
1469
|
}
|
1455
1470
|
}
|
1456
|
-
r.ref !== null && (
|
1471
|
+
r.ref !== null && (D(r), $("Invalid attribute `ref` supplied to `React.Fragment`."), D(null));
|
1457
1472
|
}
|
1458
1473
|
}
|
1459
|
-
function
|
1474
|
+
function ze(r, p, b, S, L, U) {
|
1460
1475
|
{
|
1461
|
-
var
|
1462
|
-
if (!
|
1476
|
+
var k = Te(r);
|
1477
|
+
if (!k) {
|
1463
1478
|
var R = "";
|
1464
1479
|
(r === void 0 || typeof r == "object" && r !== null && Object.keys(r).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.");
|
1465
|
-
var he =
|
1480
|
+
var he = Gt(L);
|
1466
1481
|
he ? R += he : R += de();
|
1467
|
-
var
|
1468
|
-
r === null ?
|
1482
|
+
var Z;
|
1483
|
+
r === null ? Z = "null" : Ne(r) ? Z = "array" : r !== void 0 && r.$$typeof === n ? (Z = "<" + (N(r.type) || "Unknown") + " />", R = " Did you accidentally export a JSX literal instead of a component?") : Z = typeof r, $("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);
|
1469
1484
|
}
|
1470
|
-
var
|
1471
|
-
if (
|
1472
|
-
return
|
1473
|
-
if (
|
1485
|
+
var Q = s(r, p, b, L, U);
|
1486
|
+
if (Q == null)
|
1487
|
+
return Q;
|
1488
|
+
if (k) {
|
1474
1489
|
var Ce = p.children;
|
1475
1490
|
if (Ce !== void 0)
|
1476
|
-
if (
|
1477
|
-
if (
|
1491
|
+
if (S)
|
1492
|
+
if (Ne(Ce)) {
|
1478
1493
|
for (var tt = 0; tt < Ce.length; tt++)
|
1479
1494
|
Ee(Ce[tt], r);
|
1480
1495
|
Object.freeze && Object.freeze(Ce);
|
@@ -1483,29 +1498,29 @@ Check the top-level render call using <` + b + ">.");
|
|
1483
1498
|
else
|
1484
1499
|
Ee(Ce, r);
|
1485
1500
|
}
|
1486
|
-
return r === t ? Oe(
|
1501
|
+
return r === t ? Oe(Q) : Ve(Q), Q;
|
1487
1502
|
}
|
1488
1503
|
}
|
1489
1504
|
function et(r, p, b) {
|
1490
|
-
return
|
1505
|
+
return ze(r, p, b, !0);
|
1491
1506
|
}
|
1492
1507
|
function xt(r, p, b) {
|
1493
|
-
return
|
1508
|
+
return ze(r, p, b, !1);
|
1494
1509
|
}
|
1495
|
-
var
|
1496
|
-
ut.Fragment = t, ut.jsx =
|
1510
|
+
var zn = xt, Gn = et;
|
1511
|
+
ut.Fragment = t, ut.jsx = zn, ut.jsxs = Gn;
|
1497
1512
|
}()), ut;
|
1498
1513
|
}
|
1499
|
-
process.env.NODE_ENV === "production" ? It.exports =
|
1514
|
+
process.env.NODE_ENV === "production" ? It.exports = Ba() : It.exports = Fa();
|
1500
1515
|
var l = It.exports;
|
1501
|
-
function
|
1516
|
+
function Bn(e) {
|
1502
1517
|
return e.title.search("<") > -1 ? /* @__PURE__ */ l.jsx("button", { className: "svg", dangerouslySetInnerHTML: { __html: e.title } }) : /* @__PURE__ */ l.jsx("button", { children: e.title });
|
1503
1518
|
}
|
1504
|
-
const
|
1519
|
+
const Ua = /* @__PURE__ */ l.jsxs("svg", { className: "closeIcon", width: "14", height: "14", fill: "none", stroke: "#666666", strokeMiterlimit: "10", children: [
|
1505
1520
|
/* @__PURE__ */ l.jsx("circle", { cx: "7", cy: "7", r: "6" }),
|
1506
1521
|
/* @__PURE__ */ l.jsx("line", { x1: "4", y1: "4", x2: "10", y2: "10" }),
|
1507
1522
|
/* @__PURE__ */ l.jsx("line", { x1: "4", y1: "10", x2: "10", y2: "4" })
|
1508
|
-
] }),
|
1523
|
+
] }), $a = /* @__PURE__ */ l.jsx("svg", { className: "dragIcon", width: "14", height: "14", fill: "#666666", stroke: "none", children: /* @__PURE__ */ l.jsx(
|
1509
1524
|
"path",
|
1510
1525
|
{
|
1511
1526
|
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
|
@@ -1513,35 +1528,35 @@ 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
|
|
1513
1528
|
C11,8.22,10.74,8,10.43,8z`
|
1514
1529
|
}
|
1515
1530
|
) });
|
1516
|
-
function
|
1517
|
-
return /* @__PURE__ */ l.jsx(
|
1518
|
-
|
1531
|
+
function za(e) {
|
1532
|
+
return /* @__PURE__ */ l.jsx(Dn.Item, { value: e.title, children: /* @__PURE__ */ l.jsxs("div", { children: [
|
1533
|
+
$a,
|
1519
1534
|
/* @__PURE__ */ l.jsx("span", { children: e.title }),
|
1520
1535
|
/* @__PURE__ */ l.jsx("button", { className: "closeIcon", onClick: () => {
|
1521
1536
|
e.onDelete(e.index);
|
1522
|
-
}, children:
|
1537
|
+
}, children: Ua })
|
1523
1538
|
] }) }, e.title);
|
1524
1539
|
}
|
1525
|
-
function
|
1526
|
-
const [n, a] =
|
1527
|
-
e.onDragComplete(
|
1528
|
-
}, u = (
|
1540
|
+
function Ga(e) {
|
1541
|
+
const [n, a] = X(!1), [t, i] = X(e.options), c = (h) => {
|
1542
|
+
e.onDragComplete(h), i(h);
|
1543
|
+
}, u = (h) => {
|
1529
1544
|
const f = [...t];
|
1530
|
-
f.splice(
|
1531
|
-
},
|
1532
|
-
t.forEach((
|
1533
|
-
|
1545
|
+
f.splice(h, 1), c(f);
|
1546
|
+
}, o = [];
|
1547
|
+
t.forEach((h, f) => {
|
1548
|
+
o.push(/* @__PURE__ */ l.jsx(za, { index: f, title: h, onDelete: u }, h));
|
1534
1549
|
});
|
1535
|
-
let
|
1536
|
-
return e.subdropdown && (
|
1537
|
-
/* @__PURE__ */ l.jsx(
|
1538
|
-
/* @__PURE__ */ l.jsx(
|
1550
|
+
let d = "dropdown draggable";
|
1551
|
+
return e.subdropdown && (d += " subdropdown"), /* @__PURE__ */ l.jsxs("div", { className: d, onMouseEnter: () => a(!0), onMouseLeave: () => a(!1), children: [
|
1552
|
+
/* @__PURE__ */ l.jsx(Bn, { title: e.title }),
|
1553
|
+
/* @__PURE__ */ l.jsx(Dn.Group, { axis: "y", values: t, onReorder: c, style: { visibility: n ? "visible" : "hidden" }, children: o })
|
1539
1554
|
] });
|
1540
1555
|
}
|
1541
|
-
function
|
1542
|
-
const [n, a] =
|
1543
|
-
e.options.map((
|
1544
|
-
e.onSelect !== void 0 && (
|
1556
|
+
function Wa(e) {
|
1557
|
+
const [n, a] = X(!1), t = [];
|
1558
|
+
e.options.map((c, u) => {
|
1559
|
+
e.onSelect !== void 0 && (c.onSelect = e.onSelect), t.push(/* @__PURE__ */ l.jsx(Ha, { option: c }, u));
|
1545
1560
|
});
|
1546
1561
|
let i = "dropdown";
|
1547
1562
|
return e.subdropdown && (i += " subdropdown"), /* @__PURE__ */ l.jsxs(
|
@@ -1551,7 +1566,7 @@ function za(e) {
|
|
1551
1566
|
onMouseEnter: () => a(!0),
|
1552
1567
|
onMouseLeave: () => a(!1),
|
1553
1568
|
children: [
|
1554
|
-
/* @__PURE__ */ l.jsx(
|
1569
|
+
/* @__PURE__ */ l.jsx(Bn, { title: e.title }),
|
1555
1570
|
/* @__PURE__ */ l.jsx(
|
1556
1571
|
"ul",
|
1557
1572
|
{
|
@@ -1564,17 +1579,17 @@ function za(e) {
|
|
1564
1579
|
);
|
1565
1580
|
}
|
1566
1581
|
function Ha(e) {
|
1567
|
-
const { option: n } = e, [a, t] =
|
1582
|
+
const { option: n } = e, [a, t] = X("");
|
1568
1583
|
let i;
|
1569
1584
|
switch (n.type) {
|
1570
1585
|
case "draggable":
|
1571
1586
|
i = /* @__PURE__ */ l.jsx(
|
1572
|
-
|
1587
|
+
Ga,
|
1573
1588
|
{
|
1574
1589
|
title: n.title,
|
1575
1590
|
options: n.value,
|
1576
|
-
onDragComplete: (
|
1577
|
-
n.onDragComplete !== void 0 && n.onDragComplete(
|
1591
|
+
onDragComplete: (c) => {
|
1592
|
+
n.onDragComplete !== void 0 && n.onDragComplete(c);
|
1578
1593
|
},
|
1579
1594
|
subdropdown: !0
|
1580
1595
|
}
|
@@ -1582,7 +1597,7 @@ function Ha(e) {
|
|
1582
1597
|
break;
|
1583
1598
|
case "dropdown":
|
1584
1599
|
i = /* @__PURE__ */ l.jsx(
|
1585
|
-
|
1600
|
+
Wa,
|
1586
1601
|
{
|
1587
1602
|
title: n.title,
|
1588
1603
|
options: n.value,
|
@@ -1605,31 +1620,31 @@ function Ha(e) {
|
|
1605
1620
|
}
|
1606
1621
|
return /* @__PURE__ */ l.jsx("li", { className: a === n.title ? "selected" : "", children: i }, _a());
|
1607
1622
|
}
|
1608
|
-
function
|
1609
|
-
function t(
|
1623
|
+
function Bi(e, n, a) {
|
1624
|
+
function t(c) {
|
1610
1625
|
switch (n.forEach((u) => {
|
1611
|
-
u.callback(e, u.remote,
|
1612
|
-
}),
|
1626
|
+
u.callback(e, u.remote, c);
|
1627
|
+
}), c.event) {
|
1613
1628
|
case "custom":
|
1614
|
-
|
1629
|
+
j.dispatchEvent({ type: A.CUSTOM, value: c.data });
|
1615
1630
|
break;
|
1616
1631
|
}
|
1617
1632
|
}
|
1618
|
-
function i(
|
1633
|
+
function i(c) {
|
1619
1634
|
switch (a.forEach((u) => {
|
1620
|
-
u.callback(e, u.remote,
|
1621
|
-
}),
|
1635
|
+
u.callback(e, u.remote, c);
|
1636
|
+
}), c.event) {
|
1622
1637
|
case "custom":
|
1623
|
-
|
1638
|
+
j.dispatchEvent({ type: A.CUSTOM, value: c.data });
|
1624
1639
|
break;
|
1625
1640
|
}
|
1626
1641
|
}
|
1627
|
-
e.listen = (
|
1628
|
-
|
1642
|
+
e.listen = (c) => {
|
1643
|
+
c.target === "editor" ? i(c) : t(c);
|
1629
1644
|
};
|
1630
1645
|
}
|
1631
|
-
function
|
1632
|
-
const [n, a] =
|
1646
|
+
function $t(e) {
|
1647
|
+
const [n, a] = X(e.open !== void 0 ? e.open : !0), t = !n || e.children === void 0;
|
1633
1648
|
return /* @__PURE__ */ l.jsxs("div", { className: `accordion ${t ? "hide" : ""}`, children: [
|
1634
1649
|
/* @__PURE__ */ l.jsxs(
|
1635
1650
|
"button",
|
@@ -1655,10 +1670,10 @@ function Ut(e) {
|
|
1655
1670
|
/* @__PURE__ */ l.jsx("div", { className: n ? "open" : "", children: /* @__PURE__ */ l.jsx("div", { children: e.children }) })
|
1656
1671
|
] });
|
1657
1672
|
}
|
1658
|
-
function
|
1659
|
-
const [n, a] =
|
1660
|
-
return e.child !== void 0 && e.child.children.length > 0 && e.child.children.map((
|
1661
|
-
i.push(/* @__PURE__ */ l.jsx(
|
1673
|
+
function Fn(e) {
|
1674
|
+
const [n, a] = X(!1), t = e.child !== void 0 && e.child.children.length > 0, i = [];
|
1675
|
+
return e.child !== void 0 && e.child.children.length > 0 && e.child.children.map((c) => {
|
1676
|
+
i.push(/* @__PURE__ */ l.jsx(Fn, { child: c, three: e.three }, Math.random()));
|
1662
1677
|
}), /* @__PURE__ */ l.jsx(l.Fragment, { children: e.child !== void 0 && /* @__PURE__ */ l.jsxs("div", { className: "childObject", children: [
|
1663
1678
|
/* @__PURE__ */ l.jsxs("div", { className: "child", children: [
|
1664
1679
|
t ? /* @__PURE__ */ l.jsx(
|
@@ -1686,7 +1701,7 @@ function Bn(e) {
|
|
1686
1701
|
children: e.child.name.length > 0 ? `${e.child.name} (${e.child.type})` : `${e.child.type}::${e.child.uuid}`
|
1687
1702
|
}
|
1688
1703
|
),
|
1689
|
-
/* @__PURE__ */ l.jsx("div", { className: `icon ${
|
1704
|
+
/* @__PURE__ */ l.jsx("div", { className: `icon ${Aa(e.child)}` })
|
1690
1705
|
] }),
|
1691
1706
|
/* @__PURE__ */ l.jsx("div", { className: n ? "open" : "", children: /* @__PURE__ */ l.jsx("div", { className: "container", children: i }) })
|
1692
1707
|
] }, Math.random()) });
|
@@ -1694,18 +1709,18 @@ function Bn(e) {
|
|
1694
1709
|
function Ya(e) {
|
1695
1710
|
const n = [];
|
1696
1711
|
return e.child?.children.map((a) => {
|
1697
|
-
n.push(/* @__PURE__ */ l.jsx(
|
1712
|
+
n.push(/* @__PURE__ */ l.jsx(Fn, { child: a, three: e.three }, Math.random()));
|
1698
1713
|
}), /* @__PURE__ */ l.jsx("div", { className: `scene ${e.class !== void 0 ? e.class : ""}`, children: n });
|
1699
1714
|
}
|
1700
|
-
const
|
1701
|
-
function
|
1715
|
+
const Va = "data:image/gif;base64,R0lGODlhDgFkAIAAAP///wAAACH/C1hNUCBEYXRhWE1QPD94cGFja2V0IGJlZ2luPSLvu78iIGlkPSJXNU0wTXBDZWhpSHpyZVN6TlRjemtjOWQiPz4gPHg6eG1wbWV0YSB4bWxuczp4PSJhZG9iZTpuczptZXRhLyIgeDp4bXB0az0iQWRvYmUgWE1QIENvcmUgOS4xLWMwMDIgNzkuZGJhM2RhM2I1LCAyMDIzLzEyLzE1LTEwOjQyOjM3ICAgICAgICAiPiA8cmRmOlJERiB4bWxuczpyZGY9Imh0dHA6Ly93d3cudzMub3JnLzE5OTkvMDIvMjItcmRmLXN5bnRheC1ucyMiPiA8cmRmOkRlc2NyaXB0aW9uIHJkZjphYm91dD0iIiB4bWxuczp4bXA9Imh0dHA6Ly9ucy5hZG9iZS5jb20veGFwLzEuMC8iIHhtbG5zOnhtcE1NPSJodHRwOi8vbnMuYWRvYmUuY29tL3hhcC8xLjAvbW0vIiB4bWxuczpzdFJlZj0iaHR0cDovL25zLmFkb2JlLmNvbS94YXAvMS4wL3NUeXBlL1Jlc291cmNlUmVmIyIgeG1wOkNyZWF0b3JUb29sPSJBZG9iZSBQaG90b3Nob3AgMjUuNiAoTWFjaW50b3NoKSIgeG1wTU06SW5zdGFuY2VJRD0ieG1wLmlpZDoyMDk3M0NEODAxQjQxMUVGODVGNENDMkUyMUExNDk1NSIgeG1wTU06RG9jdW1lbnRJRD0ieG1wLmRpZDoyMDk3M0NEOTAxQjQxMUVGODVGNENDMkUyMUExNDk1NSI+IDx4bXBNTTpEZXJpdmVkRnJvbSBzdFJlZjppbnN0YW5jZUlEPSJ4bXAuaWlkOkE4ODc3Qzg5MDFCMzExRUY4NUY0Q0MyRTIxQTE0OTU1IiBzdFJlZjpkb2N1bWVudElEPSJ4bXAuZGlkOkE4ODc3QzhBMDFCMzExRUY4NUY0Q0MyRTIxQTE0OTU1Ii8+IDwvcmRmOkRlc2NyaXB0aW9uPiA8L3JkZjpSREY+IDwveDp4bXBtZXRhPiA8P3hwYWNrZXQgZW5kPSJyIj8+Af/+/fz7+vn49/b19PPy8fDv7u3s6+rp6Ofm5eTj4uHg397d3Nva2djX1tXU09LR0M/OzczLysnIx8bFxMPCwcC/vr28u7q5uLe2tbSzsrGwr66trKuqqainpqWko6KhoJ+enZybmpmYl5aVlJOSkZCPjo2Mi4qJiIeGhYSDgoGAf359fHt6eXh3dnV0c3JxcG9ubWxramloZ2ZlZGNiYWBfXl1cW1pZWFdWVVRTUlFQT05NTEtKSUhHRkVEQ0JBQD8+PTw7Ojk4NzY1NDMyMTAvLi0sKyopKCcmJSQjIiEgHx4dHBsaGRgXFhUUExIREA8ODQwLCgkIBwYFBAMCAQAAIfkEAAAAAAAsAAAAAA4BZAAAAv+Mj6nL7Q+jnLTai7PevPsPhuJIluaJpurKtu4Lx/JM1/aN5/rO9/4PDAqHxKLxiEwql8ym8wmNSqfUqvWKzWq33K73Cw6Lx+Sy+YxOq9fstvsNj8vn9Lr9js/r9/y+/w8YKDhIWGh4iJiouMjY6PgIGSk5SVlpeYmZqTkJAGDQ+dnpuekmGgAKejpKuiZqmprKqoZKGyrbOlqrejub6xvLGyw8TFzcprurGuvqybxq7ETbrItsCz0l7Zpc+6p9/cS967w9/S2FTF0u/mzehK4Oqz3eTl9vf4+fr7/P3+//DzCgwIEECxo8iDChwoUMGzp8CDGixIkUK1q8iDGjxo0XHDt6/AgypMiRJEuaPIkypcqVLFt+KwAAOw==";
|
1716
|
+
function qa(e) {
|
1702
1717
|
return "items" in e;
|
1703
1718
|
}
|
1704
|
-
function
|
1719
|
+
function Je(e) {
|
1705
1720
|
const n = [];
|
1706
1721
|
return e.items.forEach((a) => {
|
1707
|
-
|
1708
|
-
/* @__PURE__ */ l.jsx(
|
1722
|
+
qa(a) ? n.push(
|
1723
|
+
/* @__PURE__ */ l.jsx(Je, { title: Mt(a.title), items: a.items }, Math.random())
|
1709
1724
|
) : n.push(
|
1710
1725
|
/* @__PURE__ */ l.jsx(
|
1711
1726
|
ft,
|
@@ -1726,12 +1741,12 @@ function Ze(e) {
|
|
1726
1741
|
Math.random()
|
1727
1742
|
)
|
1728
1743
|
);
|
1729
|
-
}), /* @__PURE__ */ l.jsx(
|
1744
|
+
}), /* @__PURE__ */ l.jsx($t, { label: e.title, open: e.expanded === !0, children: n });
|
1730
1745
|
}
|
1731
|
-
function
|
1746
|
+
function Za(e) {
|
1732
1747
|
return !(e === "alphaHash" || e === "alphaToCoverage" || e === "attenuationDistance" || e === "blendAlpha" || e === "blendColor" || e === "blendDstAlpha" || e === "colorWrite" || e === "combine" || e === "defaultAttributeValues" || e === "depthFunc" || e === "forceSinglePass" || e === "glslVersion" || e === "linecap" || e === "linejoin" || e === "linewidth" || e === "normalMapType" || e === "precision" || e === "premultipliedAlpha" || e === "shadowSide" || e === "toneMapped" || e === "uniformsGroups" || e === "uniformsNeedUpdate" || e === "userData" || e === "vertexColors" || e === "version" || e === "wireframeLinecap" || e === "wireframeLinejoin" || e === "wireframeLinewidth" || e.slice(0, 4) === "clip" || e.slice(0, 7) === "polygon" || e.slice(0, 7) === "stencil" || e.slice(0, 2) === "is");
|
1733
1748
|
}
|
1734
|
-
function
|
1749
|
+
function Xa(e) {
|
1735
1750
|
switch (e) {
|
1736
1751
|
case "Alpha Map":
|
1737
1752
|
return "alphaMap";
|
@@ -1778,7 +1793,7 @@ function Ka(e) {
|
|
1778
1793
|
}
|
1779
1794
|
return e;
|
1780
1795
|
}
|
1781
|
-
function
|
1796
|
+
function Tt(e) {
|
1782
1797
|
switch (e) {
|
1783
1798
|
case "alphaMap":
|
1784
1799
|
return "Alpha Map";
|
@@ -1955,7 +1970,7 @@ function Un(e) {
|
|
1955
1970
|
const n = e.toLowerCase();
|
1956
1971
|
return n.search("intensity") > -1 || n === "anisotropyrotation" || n === "blendalpha" || n === "bumpscale" || n === "clearcoatroughness" || n === "displacementbias" || n === "displacementscale" || n === "metalness" || n === "opacity" || n === "reflectivity" || n === "refractionratio" || n === "roughness" || n === "sheenroughness" || n === "thickness";
|
1957
1972
|
}
|
1958
|
-
function
|
1973
|
+
function Ja() {
|
1959
1974
|
const e = document.createElement("input");
|
1960
1975
|
return e.type = "file", new Promise((n, a) => {
|
1961
1976
|
e.addEventListener("change", function() {
|
@@ -1963,124 +1978,124 @@ function Xa() {
|
|
1963
1978
|
a();
|
1964
1979
|
else {
|
1965
1980
|
const t = e.files[0], i = new FileReader();
|
1966
|
-
i.onload = function(
|
1967
|
-
n(
|
1981
|
+
i.onload = function(c) {
|
1982
|
+
n(c.target.result);
|
1968
1983
|
}, i.readAsDataURL(t);
|
1969
1984
|
}
|
1970
1985
|
}), e.click();
|
1971
1986
|
});
|
1972
1987
|
}
|
1973
|
-
const
|
1988
|
+
const Ka = [
|
1974
1989
|
{
|
1975
1990
|
title: "Front",
|
1976
1991
|
value: Yn
|
1977
1992
|
},
|
1978
1993
|
{
|
1979
1994
|
title: "Back",
|
1980
|
-
value:
|
1995
|
+
value: mn
|
1981
1996
|
},
|
1982
1997
|
{
|
1983
1998
|
title: "Double",
|
1984
|
-
value:
|
1999
|
+
value: pn
|
1985
2000
|
}
|
1986
|
-
],
|
2001
|
+
], Qa = [
|
1987
2002
|
{
|
1988
2003
|
title: "No Blending",
|
1989
|
-
value:
|
2004
|
+
value: Vn
|
1990
2005
|
},
|
1991
2006
|
{
|
1992
2007
|
title: "Normal",
|
1993
|
-
value:
|
2008
|
+
value: qn
|
1994
2009
|
},
|
1995
2010
|
{
|
1996
2011
|
title: "Additive",
|
1997
|
-
value:
|
2012
|
+
value: Zn
|
1998
2013
|
},
|
1999
2014
|
{
|
2000
2015
|
title: "Subtractive",
|
2001
|
-
value:
|
2016
|
+
value: Xn
|
2002
2017
|
},
|
2003
2018
|
{
|
2004
2019
|
title: "Multiply",
|
2005
|
-
value:
|
2020
|
+
value: Jn
|
2006
2021
|
},
|
2007
2022
|
{
|
2008
2023
|
title: "Custom",
|
2009
|
-
value:
|
2024
|
+
value: Kn
|
2010
2025
|
}
|
2011
|
-
],
|
2026
|
+
], ei = [
|
2012
2027
|
{
|
2013
2028
|
title: "Add",
|
2014
|
-
value:
|
2029
|
+
value: Qn
|
2015
2030
|
},
|
2016
2031
|
{
|
2017
2032
|
title: "Subtract",
|
2018
|
-
value:
|
2033
|
+
value: ea
|
2019
2034
|
},
|
2020
2035
|
{
|
2021
2036
|
title: "Reverse Subtract",
|
2022
|
-
value:
|
2037
|
+
value: ta
|
2023
2038
|
},
|
2024
2039
|
{
|
2025
2040
|
title: "Min",
|
2026
|
-
value:
|
2041
|
+
value: na
|
2027
2042
|
},
|
2028
2043
|
{
|
2029
2044
|
title: "Max",
|
2030
|
-
value:
|
2045
|
+
value: aa
|
2031
2046
|
}
|
2032
|
-
],
|
2047
|
+
], ti = [
|
2033
2048
|
{
|
2034
2049
|
title: "Zero",
|
2035
|
-
valye:
|
2050
|
+
valye: gn
|
2036
2051
|
},
|
2037
2052
|
{
|
2038
2053
|
title: "One",
|
2039
|
-
valye:
|
2054
|
+
valye: vn
|
2040
2055
|
},
|
2041
2056
|
{
|
2042
2057
|
title: "Src Color",
|
2043
|
-
valye:
|
2058
|
+
valye: bn
|
2044
2059
|
},
|
2045
2060
|
{
|
2046
2061
|
title: "One Minus Src Color",
|
2047
|
-
valye:
|
2062
|
+
valye: yn
|
2048
2063
|
},
|
2049
2064
|
{
|
2050
2065
|
title: "Src Alpha",
|
2051
|
-
valye:
|
2066
|
+
valye: xn
|
2052
2067
|
},
|
2053
2068
|
{
|
2054
2069
|
title: "One Minus Src Alpha",
|
2055
|
-
valye:
|
2070
|
+
valye: En
|
2056
2071
|
},
|
2057
2072
|
{
|
2058
2073
|
title: "Dst Alpha",
|
2059
|
-
valye:
|
2074
|
+
valye: Cn
|
2060
2075
|
},
|
2061
2076
|
{
|
2062
2077
|
title: "One Minus Dst Alpha",
|
2063
|
-
valye:
|
2078
|
+
valye: Sn
|
2064
2079
|
},
|
2065
2080
|
{
|
2066
2081
|
title: "Dst Color",
|
2067
|
-
valye:
|
2082
|
+
valye: wn
|
2068
2083
|
},
|
2069
2084
|
{
|
2070
2085
|
title: "One Minus Dst Color",
|
2071
|
-
valye:
|
2086
|
+
valye: Mn
|
2072
2087
|
},
|
2073
2088
|
{
|
2074
2089
|
title: "Src Alpha Saturate",
|
2075
|
-
valye:
|
2090
|
+
valye: ia
|
2076
2091
|
},
|
2077
2092
|
{
|
2078
2093
|
title: "Constant Color",
|
2079
|
-
valye:
|
2094
|
+
valye: On
|
2080
2095
|
},
|
2081
2096
|
{
|
2082
2097
|
title: "One Minus Constant Color",
|
2083
|
-
valye:
|
2098
|
+
valye: Tn
|
2084
2099
|
},
|
2085
2100
|
{
|
2086
2101
|
title: "Constant Alpha",
|
@@ -2088,56 +2103,56 @@ const Za = [
|
|
2088
2103
|
},
|
2089
2104
|
{
|
2090
2105
|
title: "One Minus Constant Alpha",
|
2091
|
-
valye:
|
2106
|
+
valye: Rn
|
2092
2107
|
}
|
2093
|
-
],
|
2108
|
+
], ni = [
|
2094
2109
|
{
|
2095
2110
|
title: "Zero",
|
2096
|
-
valye:
|
2111
|
+
valye: gn
|
2097
2112
|
},
|
2098
2113
|
{
|
2099
2114
|
title: "One",
|
2100
|
-
valye:
|
2115
|
+
valye: vn
|
2101
2116
|
},
|
2102
2117
|
{
|
2103
2118
|
title: "Src Color",
|
2104
|
-
valye:
|
2119
|
+
valye: bn
|
2105
2120
|
},
|
2106
2121
|
{
|
2107
2122
|
title: "One Minus Src Color",
|
2108
|
-
valye:
|
2123
|
+
valye: yn
|
2109
2124
|
},
|
2110
2125
|
{
|
2111
2126
|
title: "Src Alpha",
|
2112
|
-
valye:
|
2127
|
+
valye: xn
|
2113
2128
|
},
|
2114
2129
|
{
|
2115
2130
|
title: "One Minus Src Alpha",
|
2116
|
-
valye:
|
2131
|
+
valye: En
|
2117
2132
|
},
|
2118
2133
|
{
|
2119
2134
|
title: "Dst Alpha",
|
2120
|
-
valye:
|
2135
|
+
valye: Cn
|
2121
2136
|
},
|
2122
2137
|
{
|
2123
2138
|
title: "One Minus Dst Alpha",
|
2124
|
-
valye:
|
2139
|
+
valye: Sn
|
2125
2140
|
},
|
2126
2141
|
{
|
2127
2142
|
title: "Dst Color",
|
2128
|
-
valye:
|
2143
|
+
valye: wn
|
2129
2144
|
},
|
2130
2145
|
{
|
2131
2146
|
title: "One Minus Dst Color",
|
2132
|
-
valye:
|
2147
|
+
valye: Mn
|
2133
2148
|
},
|
2134
2149
|
{
|
2135
2150
|
title: "Constant Color",
|
2136
|
-
valye:
|
2151
|
+
valye: On
|
2137
2152
|
},
|
2138
2153
|
{
|
2139
2154
|
title: "One Minus Constant Color",
|
2140
|
-
valye:
|
2155
|
+
valye: Tn
|
2141
2156
|
},
|
2142
2157
|
{
|
2143
2158
|
title: "Constant Alpha",
|
@@ -2145,203 +2160,205 @@ const Za = [
|
|
2145
2160
|
},
|
2146
2161
|
{
|
2147
2162
|
title: "One Minus Constant Alpha",
|
2148
|
-
valye:
|
2163
|
+
valye: Rn
|
2149
2164
|
}
|
2150
2165
|
];
|
2151
2166
|
function dt(e, n) {
|
2152
2167
|
e.needsUpdate = !0, e.type = "option", e.options = n;
|
2153
2168
|
}
|
2154
|
-
function
|
2169
|
+
function ai(e, n, a, t) {
|
2155
2170
|
return {
|
2156
2171
|
type: "boolean",
|
2157
|
-
title:
|
2172
|
+
title: Tt(e),
|
2158
2173
|
prop: e,
|
2159
2174
|
value: n,
|
2160
2175
|
needsUpdate: !0,
|
2161
|
-
onChange: (i,
|
2162
|
-
t.updateObject(a.uuid, `material.${e}`,
|
2176
|
+
onChange: (i, c) => {
|
2177
|
+
t.updateObject(a.uuid, `material.${e}`, c), t.updateObject(a.uuid, "material.needsUpdate", !0);
|
2163
2178
|
const u = t.scene?.getObjectByProperty("uuid", a.uuid);
|
2164
|
-
u !== void 0 &&
|
2179
|
+
u !== void 0 && V(u, `material.${e}`, c);
|
2165
2180
|
}
|
2166
2181
|
};
|
2167
2182
|
}
|
2168
|
-
function
|
2183
|
+
function ii(e, n, a, t) {
|
2169
2184
|
const i = {
|
2170
2185
|
type: "number",
|
2171
|
-
title:
|
2186
|
+
title: Tt(e),
|
2172
2187
|
prop: e,
|
2173
2188
|
value: n,
|
2174
2189
|
min: void 0,
|
2175
2190
|
max: void 0,
|
2176
2191
|
step: 0.01,
|
2177
2192
|
needsUpdate: !0,
|
2178
|
-
onChange: (
|
2193
|
+
onChange: (c, u) => {
|
2179
2194
|
t.updateObject(a.uuid, `material.${e}`, u), t.updateObject(a.uuid, "material.needsUpdate", !0);
|
2180
|
-
const
|
2181
|
-
|
2195
|
+
const o = t.scene?.getObjectByProperty("uuid", a.uuid);
|
2196
|
+
o !== void 0 && V(o, `material.${e}`, u);
|
2182
2197
|
}
|
2183
2198
|
};
|
2184
2199
|
switch (e) {
|
2185
2200
|
case "blending":
|
2186
|
-
dt(i,
|
2201
|
+
dt(i, Qa);
|
2187
2202
|
break;
|
2188
2203
|
case "blendDst":
|
2189
|
-
dt(i,
|
2204
|
+
dt(i, ni);
|
2190
2205
|
break;
|
2191
2206
|
case "blendEquation":
|
2192
|
-
dt(i,
|
2207
|
+
dt(i, ei);
|
2193
2208
|
break;
|
2194
2209
|
case "blendSrc":
|
2195
|
-
dt(i,
|
2210
|
+
dt(i, ti);
|
2196
2211
|
break;
|
2197
2212
|
case "side":
|
2198
|
-
dt(i,
|
2213
|
+
dt(i, Ka);
|
2199
2214
|
break;
|
2200
2215
|
}
|
2201
2216
|
return Un(e) && (i.value = Number(n), i.type = "range", i.min = Math.min(0, i.value), i.max = Math.max(1, i.value), i.step = 0.01), i;
|
2202
2217
|
}
|
2203
|
-
function
|
2218
|
+
function ri(e, n, a, t) {
|
2204
2219
|
const i = {
|
2205
2220
|
type: "string",
|
2206
|
-
title:
|
2221
|
+
title: Tt(e),
|
2207
2222
|
prop: e,
|
2208
2223
|
value: n,
|
2209
2224
|
needsUpdate: !0,
|
2210
|
-
onChange: (u,
|
2211
|
-
t.updateObject(a.uuid, `material.${e}`,
|
2212
|
-
const
|
2213
|
-
|
2225
|
+
onChange: (u, o) => {
|
2226
|
+
t.updateObject(a.uuid, `material.${e}`, o), t.updateObject(a.uuid, "material.needsUpdate", !0);
|
2227
|
+
const d = t.scene?.getObjectByProperty("uuid", a.uuid);
|
2228
|
+
d !== void 0 && V(d, `material.${e}`, o);
|
2214
2229
|
}
|
2215
2230
|
};
|
2216
|
-
return (e === "vertexShader" || e === "fragmentShader") && (i.disabled = !1, i.latest = i.value, i.onChange = (u,
|
2217
|
-
i.latest =
|
2231
|
+
return (e === "vertexShader" || e === "fragmentShader") && (i.disabled = !1, i.latest = i.value, i.onChange = (u, o) => {
|
2232
|
+
i.latest = o, t.updateObject(a.uuid, `material.${e}`, o);
|
2233
|
+
const d = t.scene?.getObjectByProperty("uuid", a.uuid);
|
2234
|
+
d !== void 0 && V(d, `material.${e}`, o);
|
2218
2235
|
}), i;
|
2219
2236
|
}
|
2220
|
-
function
|
2237
|
+
function si(e) {
|
2221
2238
|
return e.x !== void 0 && e.y !== void 0 && e.z === void 0;
|
2222
2239
|
}
|
2223
|
-
function
|
2240
|
+
function oi(e) {
|
2224
2241
|
return e.x !== void 0 && e.y !== void 0 && e.z !== void 0 && e.w === void 0;
|
2225
2242
|
}
|
2226
|
-
function
|
2243
|
+
function ci(e) {
|
2227
2244
|
return e.x !== void 0 && e.y !== void 0 && e.z !== void 0 && e.w !== void 0;
|
2228
2245
|
}
|
2229
2246
|
function Nt(e) {
|
2230
2247
|
e.sort((n, a) => n.title < a.title ? -1 : n.title > a.title ? 1 : 0);
|
2231
2248
|
}
|
2232
|
-
function ht(e, n, a, t, i = "",
|
2233
|
-
const u =
|
2234
|
-
if (
|
2249
|
+
function ht(e, n, a, t, i = "", c = !1) {
|
2250
|
+
const u = Tt(e).split(".")[0].replaceAll("[", "").replaceAll("]", ""), o = i.length > 0 ? `${i}.${e}` : e, d = typeof n;
|
2251
|
+
if (d === "boolean" || d === "string")
|
2235
2252
|
return {
|
2236
2253
|
title: u,
|
2237
|
-
prop:
|
2238
|
-
type:
|
2254
|
+
prop: o,
|
2255
|
+
type: d,
|
2239
2256
|
value: n,
|
2240
|
-
disabled:
|
2241
|
-
onChange: (
|
2242
|
-
t.updateObject(a.uuid, `material.${
|
2257
|
+
disabled: c,
|
2258
|
+
onChange: (h, f) => {
|
2259
|
+
t.updateObject(a.uuid, `material.${o}`, f);
|
2243
2260
|
const m = t.scene?.getObjectByProperty("uuid", a.uuid);
|
2244
|
-
m !== void 0 &&
|
2261
|
+
m !== void 0 && V(m, `material.${o}`, f);
|
2245
2262
|
}
|
2246
2263
|
};
|
2247
|
-
if (
|
2248
|
-
const
|
2264
|
+
if (d === "number") {
|
2265
|
+
const h = {
|
2249
2266
|
title: u,
|
2250
|
-
prop:
|
2267
|
+
prop: o,
|
2251
2268
|
type: "number",
|
2252
2269
|
value: n,
|
2253
2270
|
step: 0.01,
|
2254
|
-
disabled:
|
2271
|
+
disabled: c,
|
2255
2272
|
onChange: (f, m) => {
|
2256
|
-
t.updateObject(a.uuid, `material.${
|
2273
|
+
t.updateObject(a.uuid, `material.${o}`, m);
|
2257
2274
|
const x = t.scene?.getObjectByProperty("uuid", a.uuid);
|
2258
|
-
x !== void 0 &&
|
2275
|
+
x !== void 0 && V(x, `material.${o}`, m);
|
2259
2276
|
}
|
2260
2277
|
};
|
2261
|
-
return Un(u) && (
|
2278
|
+
return Un(u) && (h.type = "range", h.min = 0, h.max = 1), h;
|
2262
2279
|
} else {
|
2263
2280
|
if (n.isColor)
|
2264
2281
|
return {
|
2265
2282
|
title: u,
|
2266
|
-
prop:
|
2283
|
+
prop: o,
|
2267
2284
|
type: "color",
|
2268
2285
|
value: n,
|
2269
|
-
disabled:
|
2270
|
-
onChange: (
|
2286
|
+
disabled: c,
|
2287
|
+
onChange: (h, f) => {
|
2271
2288
|
const m = new Lt(f);
|
2272
|
-
t.updateObject(a.uuid, `material.${
|
2289
|
+
t.updateObject(a.uuid, `material.${o}`, m);
|
2273
2290
|
const x = t.scene?.getObjectByProperty("uuid", a.uuid);
|
2274
|
-
x !== void 0 &&
|
2291
|
+
x !== void 0 && V(x, `material.${o}`, m);
|
2275
2292
|
}
|
2276
2293
|
};
|
2277
2294
|
if (Array.isArray(n)) {
|
2278
|
-
const
|
2295
|
+
const h = [];
|
2279
2296
|
for (const f in n) {
|
2280
2297
|
const m = n[f], x = `[${f.toString()}]`;
|
2281
2298
|
if (m.value !== void 0) {
|
2282
|
-
const
|
2283
|
-
|
2299
|
+
const T = ht(`${x}.value`, m.value, a, t, o, c);
|
2300
|
+
T !== void 0 && h.push(T);
|
2284
2301
|
} else {
|
2285
|
-
const
|
2286
|
-
|
2302
|
+
const T = ht(x, m, a, t, o, c);
|
2303
|
+
T !== void 0 && h.push(T);
|
2287
2304
|
}
|
2288
2305
|
}
|
2289
|
-
if (
|
2290
|
-
return Nt(
|
2306
|
+
if (h.length > 0)
|
2307
|
+
return Nt(h), {
|
2291
2308
|
title: u,
|
2292
|
-
items:
|
2309
|
+
items: h
|
2293
2310
|
};
|
2294
2311
|
} else {
|
2295
|
-
if (
|
2312
|
+
if (si(n))
|
2296
2313
|
return {
|
2297
2314
|
title: u,
|
2298
|
-
prop:
|
2315
|
+
prop: o,
|
2299
2316
|
type: "vector2",
|
2300
2317
|
value: n,
|
2301
|
-
disabled:
|
2302
|
-
onChange: (
|
2303
|
-
t.updateObject(a.uuid, `material.${
|
2318
|
+
disabled: c,
|
2319
|
+
onChange: (h, f) => {
|
2320
|
+
t.updateObject(a.uuid, `material.${o}`, f);
|
2304
2321
|
const m = t.scene?.getObjectByProperty("uuid", a.uuid);
|
2305
|
-
m !== void 0 &&
|
2322
|
+
m !== void 0 && V(m, `material.${o}`, f);
|
2306
2323
|
}
|
2307
2324
|
};
|
2308
|
-
if (
|
2325
|
+
if (oi(n))
|
2309
2326
|
return {
|
2310
2327
|
title: u,
|
2311
|
-
prop:
|
2328
|
+
prop: o,
|
2312
2329
|
type: "grid3",
|
2313
2330
|
value: n,
|
2314
|
-
disabled:
|
2315
|
-
onChange: (
|
2316
|
-
t.updateObject(a.uuid, `material.${
|
2331
|
+
disabled: c,
|
2332
|
+
onChange: (h, f) => {
|
2333
|
+
t.updateObject(a.uuid, `material.${o}`, f);
|
2317
2334
|
const m = t.scene?.getObjectByProperty("uuid", a.uuid);
|
2318
|
-
m !== void 0 &&
|
2335
|
+
m !== void 0 && V(m, `material.${o}`, f);
|
2319
2336
|
}
|
2320
2337
|
};
|
2321
|
-
if (
|
2338
|
+
if (ci(n))
|
2322
2339
|
return {
|
2323
2340
|
title: u,
|
2324
|
-
prop:
|
2341
|
+
prop: o,
|
2325
2342
|
type: "grid4",
|
2326
2343
|
value: n,
|
2327
|
-
disabled:
|
2328
|
-
onChange: (
|
2329
|
-
t.updateObject(a.uuid, `material.${
|
2344
|
+
disabled: c,
|
2345
|
+
onChange: (h, f) => {
|
2346
|
+
t.updateObject(a.uuid, `material.${o}`, f);
|
2330
2347
|
const m = t.scene?.getObjectByProperty("uuid", a.uuid);
|
2331
|
-
m !== void 0 &&
|
2348
|
+
m !== void 0 && V(m, `material.${o}`, f);
|
2332
2349
|
}
|
2333
2350
|
};
|
2334
2351
|
if (n.isEuler)
|
2335
2352
|
return {
|
2336
2353
|
title: u,
|
2337
|
-
prop:
|
2354
|
+
prop: o,
|
2338
2355
|
type: "euler",
|
2339
2356
|
value: n,
|
2340
|
-
disabled:
|
2341
|
-
onChange: (
|
2342
|
-
t.updateObject(a.uuid, `material.${
|
2357
|
+
disabled: c,
|
2358
|
+
onChange: (h, f) => {
|
2359
|
+
t.updateObject(a.uuid, `material.${o}`, f);
|
2343
2360
|
const m = t.scene?.getObjectByProperty("uuid", a.uuid);
|
2344
|
-
m !== void 0 &&
|
2361
|
+
m !== void 0 && V(m, `material.${o}`, f);
|
2345
2362
|
}
|
2346
2363
|
};
|
2347
2364
|
if (n.src !== void 0)
|
@@ -2349,133 +2366,135 @@ function ht(e, n, a, t, i = "", o = !1) {
|
|
2349
2366
|
title: u,
|
2350
2367
|
type: "image",
|
2351
2368
|
value: n,
|
2352
|
-
disabled:
|
2353
|
-
onChange: (
|
2354
|
-
const m =
|
2369
|
+
disabled: c,
|
2370
|
+
onChange: (h, f) => {
|
2371
|
+
const m = Xa(e), x = i.length > 0 ? `${i}.${m}` : m;
|
2355
2372
|
t.createTexture(a.uuid, `material.${x}`, f);
|
2356
|
-
const
|
2357
|
-
|
2358
|
-
|
2373
|
+
const T = t.scene?.getObjectByProperty("uuid", a.uuid);
|
2374
|
+
T !== void 0 && Ln(f).then((H) => {
|
2375
|
+
V(T, `material.${x}`, H), V(T, "material.needsUpdate", !0);
|
2359
2376
|
});
|
2360
2377
|
}
|
2361
2378
|
};
|
2362
2379
|
if (n.elements !== void 0)
|
2363
2380
|
return {
|
2364
2381
|
title: u,
|
2365
|
-
prop:
|
2382
|
+
prop: o,
|
2366
2383
|
type: n.elements.length > 9 ? "grid4" : "grid3",
|
2367
2384
|
value: n,
|
2368
|
-
disabled:
|
2369
|
-
onChange: (
|
2370
|
-
t.updateObject(a.uuid, `material.${
|
2385
|
+
disabled: c,
|
2386
|
+
onChange: (h, f) => {
|
2387
|
+
t.updateObject(a.uuid, `material.${o}`, f);
|
2371
2388
|
const m = t.scene?.getObjectByProperty("uuid", a.uuid);
|
2372
|
-
m !== void 0 &&
|
2389
|
+
m !== void 0 && V(m, `material.${o}`, f);
|
2373
2390
|
}
|
2374
2391
|
};
|
2375
2392
|
{
|
2376
|
-
const
|
2393
|
+
const h = [], f = e === "defines" || e === "extensions";
|
2377
2394
|
try {
|
2378
2395
|
for (const m in n) {
|
2379
2396
|
const x = n[m];
|
2380
2397
|
if (x !== void 0)
|
2381
2398
|
if (x.value !== void 0) {
|
2382
|
-
const
|
2383
|
-
|
2399
|
+
const T = ht(`${m}.value`, x.value, a, t, o, f);
|
2400
|
+
T !== void 0 && h.push(T);
|
2384
2401
|
} else {
|
2385
|
-
const
|
2386
|
-
|
2402
|
+
const T = ht(m, x, a, t, o, f);
|
2403
|
+
T !== void 0 && h.push(T);
|
2387
2404
|
}
|
2388
2405
|
}
|
2389
2406
|
} catch {
|
2390
2407
|
console.log("Issue cycling through material object:", e, n);
|
2391
2408
|
}
|
2392
|
-
if (
|
2393
|
-
return Nt(
|
2409
|
+
if (h.length > 0)
|
2410
|
+
return Nt(h), {
|
2394
2411
|
title: u,
|
2395
|
-
items:
|
2412
|
+
items: h
|
2396
2413
|
};
|
2397
2414
|
}
|
2398
2415
|
}
|
2399
2416
|
}
|
2400
2417
|
}
|
2401
|
-
function
|
2418
|
+
function an(e, n, a) {
|
2402
2419
|
const t = [];
|
2403
2420
|
for (const i in e) {
|
2404
|
-
if (!
|
2421
|
+
if (!Za(i))
|
2405
2422
|
continue;
|
2406
|
-
const
|
2407
|
-
if (
|
2408
|
-
t.push(ni(i, u, n, a));
|
2409
|
-
else if (o === "number")
|
2423
|
+
const c = typeof e[i], u = e[i];
|
2424
|
+
if (c === "boolean")
|
2410
2425
|
t.push(ai(i, u, n, a));
|
2411
|
-
else if (
|
2426
|
+
else if (c === "number")
|
2412
2427
|
t.push(ii(i, u, n, a));
|
2413
|
-
else if (
|
2414
|
-
|
2415
|
-
|
2428
|
+
else if (c === "string")
|
2429
|
+
t.push(ri(i, u, n, a));
|
2430
|
+
else if (c === "object") {
|
2431
|
+
const o = ht(i, u, n, a);
|
2432
|
+
o !== void 0 && t.push(o);
|
2416
2433
|
} else
|
2417
|
-
u !== void 0 && console.log("other:", i,
|
2434
|
+
u !== void 0 && console.log("other:", i, c, u);
|
2418
2435
|
}
|
2419
2436
|
return Nt(t), t.push({
|
2420
2437
|
title: "Update Material",
|
2421
2438
|
type: "button",
|
2422
2439
|
onChange: () => {
|
2423
2440
|
a.updateObject(n.uuid, "material.needsUpdate", !0);
|
2441
|
+
const i = a.scene?.getObjectByProperty("uuid", n.uuid);
|
2442
|
+
i !== void 0 && V(i, "material.needsUpdate", !0);
|
2424
2443
|
}
|
2425
2444
|
}), t;
|
2426
2445
|
}
|
2427
|
-
function
|
2446
|
+
function li(e, n) {
|
2428
2447
|
const a = e.material;
|
2429
2448
|
if (Array.isArray(a)) {
|
2430
2449
|
const t = [], i = a.length;
|
2431
|
-
for (let
|
2450
|
+
for (let c = 0; c < i; c++)
|
2432
2451
|
t.push(
|
2433
2452
|
/* @__PURE__ */ l.jsx(
|
2434
|
-
|
2453
|
+
Je,
|
2435
2454
|
{
|
2436
|
-
title: `Material ${
|
2437
|
-
items:
|
2455
|
+
title: `Material ${c}`,
|
2456
|
+
items: an(a[c], e, n)
|
2438
2457
|
},
|
2439
|
-
`Material ${
|
2458
|
+
`Material ${c}`
|
2440
2459
|
)
|
2441
2460
|
);
|
2442
2461
|
return /* @__PURE__ */ l.jsx(l.Fragment, { children: t });
|
2443
2462
|
} else
|
2444
2463
|
return /* @__PURE__ */ l.jsx(
|
2445
|
-
|
2464
|
+
Je,
|
2446
2465
|
{
|
2447
2466
|
title: "Material",
|
2448
|
-
items:
|
2467
|
+
items: an(a, e, n)
|
2449
2468
|
}
|
2450
2469
|
);
|
2451
2470
|
}
|
2452
|
-
function
|
2453
|
-
const [n, a] =
|
2454
|
-
return
|
2455
|
-
let t = !1, i = -1,
|
2456
|
-
const
|
2457
|
-
t = !0,
|
2458
|
-
},
|
2471
|
+
function ui(e) {
|
2472
|
+
const [n, a] = X(e.defaultValue);
|
2473
|
+
return Ae(() => {
|
2474
|
+
let t = !1, i = -1, c = 0, u = e.defaultValue;
|
2475
|
+
const o = (x) => {
|
2476
|
+
t = !0, c = Number(e.input.current?.value), i = x.clientX, document.addEventListener("mouseup", h, !1), document.addEventListener("mousemove", d, !1), document.addEventListener("contextmenu", h, !1);
|
2477
|
+
}, d = (x) => {
|
2459
2478
|
if (!t)
|
2460
2479
|
return;
|
2461
|
-
const
|
2462
|
-
u = Number((
|
2463
|
-
},
|
2464
|
-
t = !1, document.removeEventListener("mouseup",
|
2480
|
+
const T = e.step !== void 0 ? e.step : 1, H = (x.clientX - i) * T;
|
2481
|
+
u = Number((c + H).toFixed(4)), e.min !== void 0 && (u = Math.max(u, e.min)), e.max !== void 0 && (u = Math.min(u, e.max)), e.onChange !== void 0 && e.onChange(u), a(u);
|
2482
|
+
}, h = () => {
|
2483
|
+
t = !1, document.removeEventListener("mouseup", h), document.removeEventListener("mousemove", d), document.removeEventListener("contextmenu", h);
|
2465
2484
|
}, f = (x) => {
|
2466
|
-
const
|
2467
|
-
a(
|
2485
|
+
const T = Number(x.target.value);
|
2486
|
+
a(T);
|
2468
2487
|
}, m = (x) => {
|
2469
|
-
const
|
2470
|
-
e.onChange !== void 0 && e.onChange(
|
2488
|
+
const T = Number(x.target.value);
|
2489
|
+
e.onChange !== void 0 && e.onChange(T), a(T);
|
2471
2490
|
};
|
2472
|
-
return e.input.current?.addEventListener("input", f), e.label.current?.addEventListener("mousedown",
|
2473
|
-
e.input.current?.removeEventListener("input", f), e.label.current?.removeEventListener("mousedown",
|
2491
|
+
return e.input.current?.addEventListener("input", f), e.label.current?.addEventListener("mousedown", o, !1), e.sliderRef !== void 0 && e.sliderRef.current?.addEventListener("input", m), () => {
|
2492
|
+
e.input.current?.removeEventListener("input", f), e.label.current?.removeEventListener("mousedown", o), e.sliderRef !== void 0 && e.sliderRef.current?.removeEventListener("input", m), document.removeEventListener("mouseup", h), document.removeEventListener("mousemove", d), document.removeEventListener("contextmenu", h);
|
2474
2493
|
};
|
2475
2494
|
}, []), n;
|
2476
2495
|
}
|
2477
2496
|
function Xe(e) {
|
2478
|
-
const n =
|
2497
|
+
const n = J(null), a = J(null), t = ui({
|
2479
2498
|
label: e.labelRef,
|
2480
2499
|
input: n,
|
2481
2500
|
sliderRef: a,
|
@@ -2501,8 +2520,8 @@ function Xe(e) {
|
|
2501
2520
|
step: e.step,
|
2502
2521
|
disabled: e.disabled,
|
2503
2522
|
onChange: (i) => {
|
2504
|
-
const
|
2505
|
-
e.onChange !== void 0 && e.onChange(e.prop,
|
2523
|
+
const c = Number(i.target.value);
|
2524
|
+
e.onChange !== void 0 && e.onChange(e.prop, c);
|
2506
2525
|
}
|
2507
2526
|
}
|
2508
2527
|
),
|
@@ -2516,8 +2535,8 @@ function Xe(e) {
|
|
2516
2535
|
ref: n,
|
2517
2536
|
className: "min",
|
2518
2537
|
onChange: (i) => {
|
2519
|
-
const
|
2520
|
-
e.onChange !== void 0 && e.onChange(e.prop,
|
2538
|
+
const c = Number(i.target.value);
|
2539
|
+
e.onChange !== void 0 && e.onChange(e.prop, c);
|
2521
2540
|
}
|
2522
2541
|
}
|
2523
2542
|
),
|
@@ -2531,43 +2550,43 @@ function Xe(e) {
|
|
2531
2550
|
max: e.max,
|
2532
2551
|
step: e.step,
|
2533
2552
|
ref: a,
|
2534
|
-
onChange:
|
2553
|
+
onChange: Bt
|
2535
2554
|
}
|
2536
2555
|
)
|
2537
2556
|
] })
|
2538
2557
|
] });
|
2539
2558
|
}
|
2540
|
-
function
|
2541
|
-
const n =
|
2559
|
+
function di(e) {
|
2560
|
+
const n = J(null), a = J(null), t = J(null), i = J(null), c = J(null), u = J(null), [o, d] = X(e.value), [h, f] = X({
|
2542
2561
|
min: Math.min(e.min, Math.min(e.value.x, e.value.y)),
|
2543
2562
|
max: Math.max(e.max, Math.max(e.value.x, e.value.y))
|
2544
|
-
}), [m, x] =
|
2545
|
-
function
|
2563
|
+
}), [m, x] = X(!1);
|
2564
|
+
function T() {
|
2546
2565
|
m || (window.addEventListener("mousemove", te), window.addEventListener("mouseup", H), window.addEventListener("mouseup", H), x(!0));
|
2547
2566
|
}
|
2548
2567
|
function H() {
|
2549
2568
|
window.removeEventListener("mousemove", te), window.removeEventListener("mouseup", H), x(!1);
|
2550
2569
|
}
|
2551
|
-
function te(
|
2552
|
-
const
|
2553
|
-
e.onChange({ target: { value: { x:
|
2570
|
+
function te(I) {
|
2571
|
+
const q = c.current.getBoundingClientRect(), ne = Ze(0, 99, I.clientX - q.left) / 99, Se = Ze(0, 99, I.clientY - q.top) / 99, z = en(Qt(h.min, h.max, ne), 3), pe = en(Qt(h.min, h.max, Se), 3);
|
2572
|
+
e.onChange({ target: { value: { x: z, y: pe } } }), d({ x: z, y: pe });
|
2554
2573
|
}
|
2555
|
-
function me(
|
2556
|
-
let
|
2557
|
-
|
2574
|
+
function me(I) {
|
2575
|
+
let q = o.x, ne = o.y;
|
2576
|
+
I.target === n.current ? q = Number(I.target.value) : ne = Number(I.target.value), d({ x: q, y: ne });
|
2558
2577
|
}
|
2559
2578
|
function re() {
|
2560
|
-
const
|
2561
|
-
f({ min:
|
2579
|
+
const I = Number(t.current.value);
|
2580
|
+
f({ min: I, max: h.max }), (o.x < I || o.y < I) && d({ x: Ze(I, h.max, o.x), y: Ze(I, h.max, o.y) });
|
2562
2581
|
}
|
2563
2582
|
function $() {
|
2564
|
-
const
|
2565
|
-
f({ min:
|
2583
|
+
const I = Number(i.current.value);
|
2584
|
+
f({ min: h.min, max: I }), (o.x > I || o.y > I) && d({ x: Ze(h.min, I, o.x), y: Ze(h.min, I, o.y) });
|
2566
2585
|
}
|
2567
|
-
return
|
2568
|
-
const
|
2569
|
-
u.current.style.left = `${
|
2570
|
-
}, [
|
2586
|
+
return Ae(() => {
|
2587
|
+
const I = Kt(h.min, h.max, o.x), q = Kt(h.min, h.max, o.y);
|
2588
|
+
u.current.style.left = `${I * 100}%`, u.current.style.top = `${q * 100}%`;
|
2589
|
+
}, [h, o]), /* @__PURE__ */ l.jsxs("div", { className: "vector2", children: [
|
2571
2590
|
/* @__PURE__ */ l.jsxs("div", { className: "fields", children: [
|
2572
2591
|
/* @__PURE__ */ l.jsxs("div", { children: [
|
2573
2592
|
/* @__PURE__ */ l.jsx("label", { children: "X:" }),
|
@@ -2576,9 +2595,9 @@ function ui(e) {
|
|
2576
2595
|
{
|
2577
2596
|
ref: n,
|
2578
2597
|
type: "number",
|
2579
|
-
value:
|
2580
|
-
min:
|
2581
|
-
max:
|
2598
|
+
value: o.x,
|
2599
|
+
min: h.min,
|
2600
|
+
max: h.max,
|
2582
2601
|
step: 0.01,
|
2583
2602
|
onChange: me
|
2584
2603
|
}
|
@@ -2591,9 +2610,9 @@ function ui(e) {
|
|
2591
2610
|
{
|
2592
2611
|
ref: a,
|
2593
2612
|
type: "number",
|
2594
|
-
value:
|
2595
|
-
min:
|
2596
|
-
max:
|
2613
|
+
value: o.y,
|
2614
|
+
min: h.min,
|
2615
|
+
max: h.max,
|
2597
2616
|
step: 0.01,
|
2598
2617
|
onChange: me
|
2599
2618
|
}
|
@@ -2606,7 +2625,7 @@ function ui(e) {
|
|
2606
2625
|
{
|
2607
2626
|
ref: t,
|
2608
2627
|
type: "number",
|
2609
|
-
value:
|
2628
|
+
value: h.min,
|
2610
2629
|
step: 0.01,
|
2611
2630
|
onChange: re
|
2612
2631
|
}
|
@@ -2619,106 +2638,106 @@ function ui(e) {
|
|
2619
2638
|
{
|
2620
2639
|
ref: i,
|
2621
2640
|
type: "number",
|
2622
|
-
value:
|
2641
|
+
value: h.max,
|
2623
2642
|
step: 0.01,
|
2624
2643
|
onChange: $
|
2625
2644
|
}
|
2626
2645
|
)
|
2627
2646
|
] })
|
2628
2647
|
] }),
|
2629
|
-
/* @__PURE__ */ l.jsxs("div", { className: "input", ref:
|
2648
|
+
/* @__PURE__ */ l.jsxs("div", { className: "input", ref: c, onMouseDown: T, onMouseUp: H, children: [
|
2630
2649
|
/* @__PURE__ */ l.jsx("div", { className: "x" }),
|
2631
2650
|
/* @__PURE__ */ l.jsx("div", { className: "y" }),
|
2632
2651
|
/* @__PURE__ */ l.jsx("div", { className: "pt", ref: u })
|
2633
2652
|
] })
|
2634
2653
|
] });
|
2635
2654
|
}
|
2636
|
-
function
|
2655
|
+
function rn(e) {
|
2637
2656
|
const n = e.value.isVector3 !== void 0, a = e.value.isEuler !== void 0, t = e.value.elements !== void 0, i = [];
|
2638
2657
|
if (n) {
|
2639
|
-
const
|
2640
|
-
|
2658
|
+
const c = ie(() => e.value, []), u = (d, h) => {
|
2659
|
+
c[d] = h, e.onChange({ target: { value: c } });
|
2641
2660
|
};
|
2642
|
-
["x", "y", "z"].forEach((
|
2643
|
-
const
|
2661
|
+
["x", "y", "z"].forEach((d) => {
|
2662
|
+
const h = J(null);
|
2644
2663
|
i.push(
|
2645
2664
|
/* @__PURE__ */ l.jsxs("div", { children: [
|
2646
|
-
/* @__PURE__ */ l.jsx("label", { ref:
|
2665
|
+
/* @__PURE__ */ l.jsx("label", { ref: h, children: d.toUpperCase() }),
|
2647
2666
|
/* @__PURE__ */ l.jsx(
|
2648
2667
|
Xe,
|
2649
2668
|
{
|
2650
|
-
value:
|
2669
|
+
value: c[d],
|
2651
2670
|
type: "number",
|
2652
|
-
prop:
|
2671
|
+
prop: d,
|
2653
2672
|
step: 0.01,
|
2654
|
-
labelRef:
|
2673
|
+
labelRef: h,
|
2655
2674
|
onChange: u
|
2656
2675
|
}
|
2657
2676
|
)
|
2658
|
-
] },
|
2677
|
+
] }, d)
|
2659
2678
|
);
|
2660
2679
|
});
|
2661
2680
|
} else if (a) {
|
2662
|
-
const
|
2663
|
-
|
2681
|
+
const c = ie(() => e.value, []), u = (d, h) => {
|
2682
|
+
c[d] = h, e.onChange({ target: { value: c } });
|
2664
2683
|
};
|
2665
|
-
["_x", "_y", "_z"].forEach((
|
2666
|
-
const
|
2684
|
+
["_x", "_y", "_z"].forEach((d) => {
|
2685
|
+
const h = J(null);
|
2667
2686
|
i.push(
|
2668
2687
|
/* @__PURE__ */ l.jsxs("div", { children: [
|
2669
|
-
/* @__PURE__ */ l.jsx("label", { ref:
|
2688
|
+
/* @__PURE__ */ l.jsx("label", { ref: h, children: d.substring(1).toUpperCase() }),
|
2670
2689
|
/* @__PURE__ */ l.jsx(
|
2671
2690
|
Xe,
|
2672
2691
|
{
|
2673
|
-
value:
|
2692
|
+
value: c[d],
|
2674
2693
|
type: "number",
|
2675
|
-
prop:
|
2694
|
+
prop: d,
|
2676
2695
|
step: 0.01,
|
2677
|
-
labelRef:
|
2696
|
+
labelRef: h,
|
2678
2697
|
onChange: u
|
2679
2698
|
}
|
2680
2699
|
)
|
2681
|
-
] },
|
2700
|
+
] }, d)
|
2682
2701
|
);
|
2683
2702
|
});
|
2684
2703
|
} else if (t) {
|
2685
|
-
const
|
2686
|
-
const
|
2687
|
-
|
2704
|
+
const c = ie(() => e.value, []), u = (o, d) => {
|
2705
|
+
const h = Number(o);
|
2706
|
+
c.elements[h] = d, e.onChange({ target: { value: c } });
|
2688
2707
|
};
|
2689
|
-
for (let
|
2690
|
-
const
|
2708
|
+
for (let o = 0; o < 9; o++) {
|
2709
|
+
const d = J(null);
|
2691
2710
|
i.push(
|
2692
2711
|
/* @__PURE__ */ l.jsxs("div", { children: [
|
2693
|
-
/* @__PURE__ */ l.jsx("label", { ref:
|
2712
|
+
/* @__PURE__ */ l.jsx("label", { ref: d, children: o + 1 }),
|
2694
2713
|
/* @__PURE__ */ l.jsx(
|
2695
2714
|
Xe,
|
2696
2715
|
{
|
2697
|
-
value:
|
2716
|
+
value: c.elements[o],
|
2698
2717
|
type: "number",
|
2699
|
-
prop:
|
2718
|
+
prop: o.toString(),
|
2700
2719
|
step: 0.01,
|
2701
|
-
labelRef:
|
2720
|
+
labelRef: d,
|
2702
2721
|
onChange: u
|
2703
2722
|
}
|
2704
2723
|
)
|
2705
|
-
] },
|
2724
|
+
] }, o.toString())
|
2706
2725
|
);
|
2707
2726
|
}
|
2708
2727
|
}
|
2709
2728
|
return /* @__PURE__ */ l.jsx("div", { className: "grid3", children: i }, Math.random().toString());
|
2710
2729
|
}
|
2711
|
-
function
|
2730
|
+
function hi(e) {
|
2712
2731
|
const n = e.value.x !== void 0, a = [];
|
2713
2732
|
if (n) {
|
2714
|
-
const t = ie(() => e.value, []), i = (u,
|
2715
|
-
t[u] =
|
2733
|
+
const t = ie(() => e.value, []), i = (u, o) => {
|
2734
|
+
t[u] = o, e.onChange({ target: { value: t } });
|
2716
2735
|
};
|
2717
2736
|
["x", "y", "z", "w"].forEach((u) => {
|
2718
|
-
const
|
2737
|
+
const o = J(null);
|
2719
2738
|
a.push(
|
2720
2739
|
/* @__PURE__ */ l.jsxs("div", { children: [
|
2721
|
-
/* @__PURE__ */ l.jsx("label", { ref:
|
2740
|
+
/* @__PURE__ */ l.jsx("label", { ref: o, children: u.toUpperCase() }),
|
2722
2741
|
/* @__PURE__ */ l.jsx(
|
2723
2742
|
Xe,
|
2724
2743
|
{
|
@@ -2726,7 +2745,7 @@ function di(e) {
|
|
2726
2745
|
type: "number",
|
2727
2746
|
prop: u,
|
2728
2747
|
step: 0.01,
|
2729
|
-
labelRef:
|
2748
|
+
labelRef: o,
|
2730
2749
|
onChange: i
|
2731
2750
|
}
|
2732
2751
|
)
|
@@ -2734,27 +2753,27 @@ function di(e) {
|
|
2734
2753
|
);
|
2735
2754
|
});
|
2736
2755
|
} else {
|
2737
|
-
const t = ie(() => e.value, []), i = (
|
2738
|
-
const
|
2739
|
-
t.elements[
|
2756
|
+
const t = ie(() => e.value, []), i = (c, u) => {
|
2757
|
+
const o = Number(c);
|
2758
|
+
t.elements[o] = u, e.onChange({ target: { value: t } });
|
2740
2759
|
};
|
2741
|
-
for (let
|
2742
|
-
const u =
|
2760
|
+
for (let c = 0; c < 16; c++) {
|
2761
|
+
const u = J(null);
|
2743
2762
|
a.push(
|
2744
2763
|
/* @__PURE__ */ l.jsxs("div", { children: [
|
2745
|
-
/* @__PURE__ */ l.jsx("label", { ref: u, children:
|
2764
|
+
/* @__PURE__ */ l.jsx("label", { ref: u, children: c + 1 }),
|
2746
2765
|
/* @__PURE__ */ l.jsx(
|
2747
2766
|
Xe,
|
2748
2767
|
{
|
2749
|
-
value: t.elements[
|
2768
|
+
value: t.elements[c],
|
2750
2769
|
type: "number",
|
2751
|
-
prop:
|
2770
|
+
prop: c.toString(),
|
2752
2771
|
step: 0.01,
|
2753
2772
|
labelRef: u,
|
2754
2773
|
onChange: i
|
2755
2774
|
}
|
2756
2775
|
)
|
2757
|
-
] },
|
2776
|
+
] }, c.toString())
|
2758
2777
|
);
|
2759
2778
|
}
|
2760
2779
|
}
|
@@ -2762,17 +2781,17 @@ function di(e) {
|
|
2762
2781
|
}
|
2763
2782
|
function ft(e) {
|
2764
2783
|
let n = e.value;
|
2765
|
-
n !== void 0 && n.isColor !== void 0 && (n =
|
2766
|
-
const [a, t] =
|
2784
|
+
n !== void 0 && n.isColor !== void 0 && (n = Pa(e.value));
|
2785
|
+
const [a, t] = X(n), i = J(null), c = J(null), u = (f) => {
|
2767
2786
|
let m = f.target.value;
|
2768
2787
|
e.type === "boolean" ? m = f.target.checked : e.type === "option" && (m = e.options[m].value), t(m), e.onChange !== void 0 && e.onChange(e.prop !== void 0 ? e.prop : e.title, m);
|
2769
|
-
},
|
2770
|
-
e.disabled && (
|
2771
|
-
const
|
2772
|
-
`) > -1),
|
2773
|
-
return /* @__PURE__ */ l.jsxs("div", { className: `field ${
|
2788
|
+
}, o = {};
|
2789
|
+
e.disabled && (o.opacity = 0.8);
|
2790
|
+
const d = e.type === "string" && (a.length > 100 || a.search(`
|
2791
|
+
`) > -1), h = d || e.type === "image" || e.type === "vector2";
|
2792
|
+
return /* @__PURE__ */ l.jsxs("div", { className: `field ${h ? "block" : ""}`, style: o, children: [
|
2774
2793
|
e.type !== "button" && /* @__PURE__ */ l.jsx("label", { ref: i, children: Mt(e.title) }, "fieldLabel"),
|
2775
|
-
e.type === "string" && !
|
2794
|
+
e.type === "string" && !d && /* @__PURE__ */ l.jsx(
|
2776
2795
|
"input",
|
2777
2796
|
{
|
2778
2797
|
type: "text",
|
@@ -2781,7 +2800,7 @@ function ft(e) {
|
|
2781
2800
|
value: a
|
2782
2801
|
}
|
2783
2802
|
),
|
2784
|
-
e.type === "string" &&
|
2803
|
+
e.type === "string" && d && /* @__PURE__ */ l.jsx(
|
2785
2804
|
"textarea",
|
2786
2805
|
{
|
2787
2806
|
cols: 50,
|
@@ -2842,19 +2861,19 @@ function ft(e) {
|
|
2842
2861
|
children: e.title
|
2843
2862
|
}
|
2844
2863
|
),
|
2845
|
-
e.type === "image" && /* @__PURE__ */ l.jsx("img", { ref:
|
2846
|
-
|
2847
|
-
|
2864
|
+
e.type === "image" && /* @__PURE__ */ l.jsx("img", { alt: e.title, ref: c, onClick: () => {
|
2865
|
+
Ja().then((f) => {
|
2866
|
+
c.current.src = f, e.onChange !== void 0 && e.onChange(e.prop !== void 0 ? e.prop : e.title, f);
|
2848
2867
|
});
|
2849
|
-
}, src: a.length > 0 ? a :
|
2868
|
+
}, src: a.src.length > 0 ? a.src : Va }),
|
2850
2869
|
e.type === "option" && /* @__PURE__ */ l.jsx(l.Fragment, { children: /* @__PURE__ */ l.jsx("select", { onChange: u, disabled: e.disabled, defaultValue: e.value, children: e.options?.map((f, m) => /* @__PURE__ */ l.jsx("option", { value: f.value, children: Mt(f.title) }, m)) }) }),
|
2851
|
-
e.type === "vector2" && /* @__PURE__ */ l.jsx(
|
2852
|
-
e.type === "grid3" && /* @__PURE__ */ l.jsx(
|
2853
|
-
e.type === "grid4" && /* @__PURE__ */ l.jsx(
|
2854
|
-
e.type === "euler" && /* @__PURE__ */ l.jsx(
|
2870
|
+
e.type === "vector2" && /* @__PURE__ */ l.jsx(di, { value: a, min: 0, max: 1, onChange: u }),
|
2871
|
+
e.type === "grid3" && /* @__PURE__ */ l.jsx(rn, { value: a, onChange: u }),
|
2872
|
+
e.type === "grid4" && /* @__PURE__ */ l.jsx(hi, { value: a, onChange: u }),
|
2873
|
+
e.type === "euler" && /* @__PURE__ */ l.jsx(rn, { value: a, onChange: u })
|
2855
2874
|
] });
|
2856
2875
|
}
|
2857
|
-
function
|
2876
|
+
function sn(e) {
|
2858
2877
|
switch (e) {
|
2859
2878
|
case "fov":
|
2860
2879
|
return "FOV";
|
@@ -2883,57 +2902,57 @@ function rn(e) {
|
|
2883
2902
|
}
|
2884
2903
|
return e;
|
2885
2904
|
}
|
2886
|
-
function
|
2905
|
+
function fi(e, n) {
|
2887
2906
|
const a = [];
|
2888
2907
|
if (e.perspectiveCameraInfo !== void 0)
|
2889
2908
|
for (const t in e.perspectiveCameraInfo)
|
2890
2909
|
a.push({
|
2891
|
-
title:
|
2910
|
+
title: sn(t),
|
2892
2911
|
prop: t,
|
2893
2912
|
type: "number",
|
2894
2913
|
step: 0.01,
|
2895
2914
|
value: e.perspectiveCameraInfo[t],
|
2896
|
-
onChange: (i,
|
2897
|
-
n.updateObject(e.uuid, i,
|
2915
|
+
onChange: (i, c) => {
|
2916
|
+
n.updateObject(e.uuid, i, c), n.requestMethod(e.uuid, "updateProjectionMatrix");
|
2898
2917
|
const u = n.scene?.getObjectByProperty("uuid", e.uuid);
|
2899
|
-
u !== void 0 && (
|
2918
|
+
u !== void 0 && (V(u, i, c), u.updateProjectionMatrix());
|
2900
2919
|
}
|
2901
2920
|
});
|
2902
2921
|
else if (e.orthographicCameraInfo !== void 0)
|
2903
2922
|
for (const t in e.orthographicCameraInfo)
|
2904
2923
|
a.push({
|
2905
|
-
title:
|
2924
|
+
title: sn(t),
|
2906
2925
|
prop: t,
|
2907
2926
|
type: "number",
|
2908
2927
|
step: 0.01,
|
2909
2928
|
value: e.perspectiveCameraInfo[t],
|
2910
|
-
onChange: (i,
|
2911
|
-
n.updateObject(e.uuid, i,
|
2929
|
+
onChange: (i, c) => {
|
2930
|
+
n.updateObject(e.uuid, i, c), n.requestMethod(e.uuid, "updateProjectionMatrix");
|
2912
2931
|
const u = n.scene?.getObjectByProperty("uuid", e.uuid);
|
2913
|
-
u !== void 0 && (
|
2932
|
+
u !== void 0 && (V(u, i, c), u.updateProjectionMatrix());
|
2914
2933
|
}
|
2915
2934
|
});
|
2916
2935
|
return /* @__PURE__ */ l.jsx(
|
2917
|
-
|
2936
|
+
Je,
|
2918
2937
|
{
|
2919
2938
|
title: "Camera",
|
2920
2939
|
items: a
|
2921
2940
|
}
|
2922
2941
|
);
|
2923
2942
|
}
|
2924
|
-
function
|
2925
|
-
const a = new
|
2943
|
+
function mi(e, n) {
|
2944
|
+
const a = new ra();
|
2926
2945
|
a.elements = e.matrix;
|
2927
|
-
const t = new Y(), i = new
|
2928
|
-
e.uuid.length > 0 && (t.setFromMatrixPosition(a), i.setFromRotationMatrix(a),
|
2929
|
-
const u = (
|
2930
|
-
const
|
2931
|
-
n.updateObject(e.uuid,
|
2946
|
+
const t = new Y(), i = new sa(), c = new Y();
|
2947
|
+
e.uuid.length > 0 && (t.setFromMatrixPosition(a), i.setFromRotationMatrix(a), c.setFromMatrixScale(a));
|
2948
|
+
const u = (o, d) => {
|
2949
|
+
const h = o === "rotation" ? { x: d._x, y: d._y, z: d._z } : d;
|
2950
|
+
n.updateObject(e.uuid, o, h);
|
2932
2951
|
const f = n.scene?.getObjectByProperty("uuid", e.uuid);
|
2933
|
-
f !== void 0 &&
|
2952
|
+
f !== void 0 && V(f, o, h);
|
2934
2953
|
};
|
2935
2954
|
return /* @__PURE__ */ l.jsx(
|
2936
|
-
|
2955
|
+
Je,
|
2937
2956
|
{
|
2938
2957
|
title: "Transform",
|
2939
2958
|
items: [
|
@@ -2955,14 +2974,14 @@ function fi(e, n) {
|
|
2955
2974
|
title: "Scale",
|
2956
2975
|
prop: "scale",
|
2957
2976
|
type: "grid3",
|
2958
|
-
value:
|
2977
|
+
value: c,
|
2959
2978
|
onChange: u
|
2960
2979
|
}
|
2961
2980
|
]
|
2962
2981
|
}
|
2963
2982
|
);
|
2964
2983
|
}
|
2965
|
-
function
|
2984
|
+
function on(e) {
|
2966
2985
|
switch (e) {
|
2967
2986
|
case "color":
|
2968
2987
|
return "Color";
|
@@ -2985,54 +3004,54 @@ function sn(e) {
|
|
2985
3004
|
}
|
2986
3005
|
return e;
|
2987
3006
|
}
|
2988
|
-
function
|
3007
|
+
function pi(e, n) {
|
2989
3008
|
const a = [];
|
2990
3009
|
if (e.lightInfo !== void 0)
|
2991
3010
|
for (const t in e.lightInfo) {
|
2992
3011
|
const i = e.lightInfo[t];
|
2993
3012
|
i !== void 0 && (i.isColor !== void 0 ? a.push({
|
2994
|
-
title:
|
3013
|
+
title: on(t),
|
2995
3014
|
prop: t,
|
2996
3015
|
type: "color",
|
2997
3016
|
value: i,
|
2998
|
-
onChange: (
|
2999
|
-
const
|
3000
|
-
n.updateObject(e.uuid,
|
3001
|
-
const
|
3002
|
-
|
3017
|
+
onChange: (c, u) => {
|
3018
|
+
const o = new Lt(u);
|
3019
|
+
n.updateObject(e.uuid, c, o);
|
3020
|
+
const d = n.scene?.getObjectByProperty("uuid", e.uuid);
|
3021
|
+
d !== void 0 && V(d, c, o);
|
3003
3022
|
}
|
3004
3023
|
}) : a.push({
|
3005
|
-
title:
|
3024
|
+
title: on(t),
|
3006
3025
|
prop: t,
|
3007
3026
|
type: typeof i,
|
3008
3027
|
value: i,
|
3009
3028
|
step: typeof i == "number" ? 0.01 : void 0,
|
3010
|
-
onChange: (
|
3011
|
-
n.updateObject(e.uuid,
|
3012
|
-
const
|
3013
|
-
|
3029
|
+
onChange: (c, u) => {
|
3030
|
+
n.updateObject(e.uuid, c, u);
|
3031
|
+
const o = n.scene?.getObjectByProperty("uuid", e.uuid);
|
3032
|
+
o !== void 0 && V(o, c, u);
|
3014
3033
|
}
|
3015
3034
|
}));
|
3016
3035
|
}
|
3017
3036
|
return /* @__PURE__ */ l.jsx(
|
3018
|
-
|
3037
|
+
Je,
|
3019
3038
|
{
|
3020
3039
|
title: "Light",
|
3021
3040
|
items: a
|
3022
3041
|
}
|
3023
3042
|
);
|
3024
3043
|
}
|
3025
|
-
function
|
3044
|
+
function gi(e, n) {
|
3026
3045
|
const a = [], t = [];
|
3027
3046
|
let i = 0;
|
3028
|
-
e.animations.forEach((
|
3029
|
-
i = Math.max(i,
|
3030
|
-
title:
|
3047
|
+
e.animations.forEach((o) => {
|
3048
|
+
i = Math.max(i, o.duration), o.duration > 0 && t.push({
|
3049
|
+
title: o.name,
|
3031
3050
|
items: [
|
3032
3051
|
{
|
3033
3052
|
title: "Duration",
|
3034
3053
|
type: "number",
|
3035
|
-
value:
|
3054
|
+
value: o.duration,
|
3036
3055
|
disabled: !0
|
3037
3056
|
},
|
3038
3057
|
{
|
@@ -3056,37 +3075,37 @@ function pi(e, n) {
|
|
3056
3075
|
title: "Animations",
|
3057
3076
|
items: t
|
3058
3077
|
});
|
3059
|
-
const
|
3078
|
+
const c = n.scene?.getObjectByProperty("uuid", e.uuid);
|
3060
3079
|
let u = !1;
|
3061
|
-
if (
|
3062
|
-
const
|
3063
|
-
if (u =
|
3064
|
-
const
|
3080
|
+
if (c !== void 0) {
|
3081
|
+
const o = c.mixer;
|
3082
|
+
if (u = o !== void 0, u) {
|
3083
|
+
const d = [
|
3065
3084
|
{
|
3066
3085
|
title: "Time Scale",
|
3067
3086
|
type: "range",
|
3068
|
-
value:
|
3087
|
+
value: o.timeScale,
|
3069
3088
|
step: 0.01,
|
3070
3089
|
min: -1,
|
3071
3090
|
max: 2,
|
3072
|
-
onChange: (
|
3073
|
-
|
3091
|
+
onChange: (h, f) => {
|
3092
|
+
o.timeScale = f, n.updateObject(e.uuid, "mixer.timeScale", f);
|
3074
3093
|
}
|
3075
3094
|
}
|
3076
3095
|
];
|
3077
|
-
|
3096
|
+
d.push({
|
3078
3097
|
title: "Stop All",
|
3079
3098
|
type: "button",
|
3080
3099
|
onChange: () => {
|
3081
|
-
|
3100
|
+
o.stopAllAction(), n.requestMethod(e.uuid, "stopAllAction", void 0, "mixer");
|
3082
3101
|
}
|
3083
3102
|
}), a.push({
|
3084
3103
|
title: "Mixer",
|
3085
|
-
items:
|
3104
|
+
items: d
|
3086
3105
|
});
|
3087
3106
|
}
|
3088
3107
|
}
|
3089
|
-
return /* @__PURE__ */ l.jsx(
|
3108
|
+
return /* @__PURE__ */ l.jsx(Je, { title: "Animation", items: a });
|
3090
3109
|
}
|
3091
3110
|
const $n = {
|
3092
3111
|
name: "",
|
@@ -3100,22 +3119,22 @@ const $n = {
|
|
3100
3119
|
orthographicCameraInfo: void 0,
|
3101
3120
|
lightInfo: void 0
|
3102
3121
|
};
|
3103
|
-
let
|
3104
|
-
function
|
3105
|
-
const [n, a] =
|
3106
|
-
|
3107
|
-
function u(
|
3108
|
-
|
3122
|
+
let se = { ...$n };
|
3123
|
+
function vi(e) {
|
3124
|
+
const [n, a] = X(-1);
|
3125
|
+
Ae(() => {
|
3126
|
+
function u(d) {
|
3127
|
+
se = { ...d.value }, a(Date.now());
|
3109
3128
|
}
|
3110
|
-
function
|
3111
|
-
|
3129
|
+
function o() {
|
3130
|
+
se = { ...$n }, a(Date.now());
|
3112
3131
|
}
|
3113
|
-
return
|
3114
|
-
|
3132
|
+
return j.addEventListener(A.SET_SCENE, o), j.addEventListener(A.SET_OBJECT, u), () => {
|
3133
|
+
j.removeEventListener(A.SET_SCENE, o), j.removeEventListener(A.SET_OBJECT, u);
|
3115
3134
|
};
|
3116
3135
|
}, []);
|
3117
|
-
const t =
|
3118
|
-
return /* @__PURE__ */ l.jsx(
|
3136
|
+
const t = se.type.toLowerCase(), i = se.animations.length > 0 || se.mixer !== void 0, c = t.search("mesh") > -1 || t.search("line") > -1 || t.search("points") > -1;
|
3137
|
+
return /* @__PURE__ */ l.jsx($t, { label: "Inspector", children: /* @__PURE__ */ l.jsx("div", { id: "Inspector", className: e.class, children: se.uuid.length > 0 && /* @__PURE__ */ l.jsxs(l.Fragment, { children: [
|
3119
3138
|
/* @__PURE__ */ l.jsxs(l.Fragment, { children: [
|
3120
3139
|
/* @__PURE__ */ l.jsx(
|
3121
3140
|
ft,
|
@@ -3123,7 +3142,7 @@ function gi(e) {
|
|
3123
3142
|
type: "string",
|
3124
3143
|
title: "Name",
|
3125
3144
|
prop: "name",
|
3126
|
-
value:
|
3145
|
+
value: se.name,
|
3127
3146
|
disabled: !0
|
3128
3147
|
}
|
3129
3148
|
),
|
@@ -3133,7 +3152,7 @@ function gi(e) {
|
|
3133
3152
|
type: "string",
|
3134
3153
|
title: "Type",
|
3135
3154
|
prop: "type",
|
3136
|
-
value:
|
3155
|
+
value: se.type,
|
3137
3156
|
disabled: !0
|
3138
3157
|
}
|
3139
3158
|
),
|
@@ -3143,7 +3162,7 @@ function gi(e) {
|
|
3143
3162
|
type: "string",
|
3144
3163
|
title: "UUID",
|
3145
3164
|
prop: "uuid",
|
3146
|
-
value:
|
3165
|
+
value: se.uuid,
|
3147
3166
|
disabled: !0
|
3148
3167
|
}
|
3149
3168
|
),
|
@@ -3153,89 +3172,89 @@ function gi(e) {
|
|
3153
3172
|
type: "boolean",
|
3154
3173
|
title: "Visible",
|
3155
3174
|
prop: "visible",
|
3156
|
-
value:
|
3157
|
-
onChange: (u,
|
3158
|
-
e.three.updateObject(
|
3159
|
-
const
|
3160
|
-
|
3175
|
+
value: se.visible,
|
3176
|
+
onChange: (u, o) => {
|
3177
|
+
e.three.updateObject(se.uuid, u, o);
|
3178
|
+
const d = e.three.scene?.getObjectByProperty("uuid", se.uuid);
|
3179
|
+
d !== void 0 && V(d, u, o);
|
3161
3180
|
}
|
3162
3181
|
}
|
3163
3182
|
)
|
3164
3183
|
] }),
|
3165
3184
|
/* @__PURE__ */ l.jsxs(l.Fragment, { children: [
|
3166
|
-
|
3167
|
-
i ?
|
3168
|
-
t.search("camera") > -1 ?
|
3169
|
-
t.search("light") > -1 ?
|
3170
|
-
|
3185
|
+
mi(se, e.three),
|
3186
|
+
i ? gi(se, e.three) : null,
|
3187
|
+
t.search("camera") > -1 ? fi(se, e.three) : null,
|
3188
|
+
t.search("light") > -1 ? pi(se, e.three) : null,
|
3189
|
+
c ? li(se, e.three) : null
|
3171
3190
|
] })
|
3172
3191
|
] }) }, n) }, "Inspector");
|
3173
3192
|
}
|
3174
3193
|
function Fi(e) {
|
3175
|
-
const [n, a] =
|
3176
|
-
|
3177
|
-
const
|
3194
|
+
const [n, a] = X(e.scene);
|
3195
|
+
Ae(() => {
|
3196
|
+
const c = (u) => {
|
3178
3197
|
a(u.value);
|
3179
3198
|
};
|
3180
|
-
return
|
3181
|
-
|
3199
|
+
return j.addEventListener(A.SET_SCENE, c), () => {
|
3200
|
+
j.removeEventListener(A.SET_SCENE, c);
|
3182
3201
|
};
|
3183
3202
|
}, []);
|
3184
3203
|
const t = n !== null, i = "Hierarchy - " + (t ? `${n?.name}` : "No Scene");
|
3185
3204
|
return /* @__PURE__ */ l.jsxs("div", { id: "SidePanel", children: [
|
3186
|
-
/* @__PURE__ */ l.jsx(
|
3187
|
-
/* @__PURE__ */ l.jsx(
|
3205
|
+
/* @__PURE__ */ l.jsx($t, { label: i, open: !0, children: /* @__PURE__ */ l.jsx(l.Fragment, { children: t && /* @__PURE__ */ l.jsx(Ya, { child: n, three: e.three }) }) }),
|
3206
|
+
/* @__PURE__ */ l.jsx(vi, { three: e.three })
|
3188
3207
|
] }, "SidePanel");
|
3189
3208
|
}
|
3190
|
-
function
|
3209
|
+
function Ui(e) {
|
3191
3210
|
function n() {
|
3192
3211
|
return e.three.scene === void 0 ? (console.log("No scene:", e.three), !1) : !0;
|
3193
3212
|
}
|
3194
|
-
const a = (
|
3213
|
+
const a = (o) => {
|
3195
3214
|
if (!n())
|
3196
3215
|
return;
|
3197
|
-
const
|
3198
|
-
|
3199
|
-
}, t = (
|
3216
|
+
const d = e.three.scene?.getObjectByProperty("uuid", o.value);
|
3217
|
+
d !== void 0 && e.three.setObject(d);
|
3218
|
+
}, t = (o, d, h) => {
|
3200
3219
|
if (!n())
|
3201
3220
|
return;
|
3202
|
-
const f = e.three.scene?.getObjectByProperty("uuid",
|
3203
|
-
f !== void 0 &&
|
3204
|
-
}, i = (
|
3221
|
+
const f = e.three.scene?.getObjectByProperty("uuid", o);
|
3222
|
+
f !== void 0 && V(f, d, h);
|
3223
|
+
}, i = (o) => {
|
3205
3224
|
if (!n())
|
3206
3225
|
return;
|
3207
|
-
const
|
3208
|
-
t(m,
|
3209
|
-
},
|
3226
|
+
const d = o.value, { key: h, value: f, uuid: m } = d;
|
3227
|
+
t(m, h, f);
|
3228
|
+
}, c = (o) => {
|
3210
3229
|
if (!n())
|
3211
3230
|
return;
|
3212
|
-
const
|
3213
|
-
Ln(
|
3214
|
-
t(
|
3231
|
+
const d = o.value;
|
3232
|
+
Ln(d.value).then((h) => {
|
3233
|
+
t(d.uuid, d.key, h), t(d.uuid, "material.needsUpdate", !0);
|
3215
3234
|
});
|
3216
|
-
}, u = (
|
3235
|
+
}, u = (o) => {
|
3217
3236
|
if (!n())
|
3218
3237
|
return;
|
3219
|
-
const { key:
|
3238
|
+
const { key: d, uuid: h, value: f, subitem: m } = o.value, x = e.three.scene?.getObjectByProperty("uuid", h);
|
3220
3239
|
if (x !== void 0)
|
3221
3240
|
try {
|
3222
|
-
m !== void 0 ?
|
3223
|
-
} catch (
|
3224
|
-
console.log("Error requesting method:"), console.log(
|
3241
|
+
m !== void 0 ? Na(x, m)[d](f) : x[d](f);
|
3242
|
+
} catch (T) {
|
3243
|
+
console.log("Error requesting method:"), console.log(T), console.log(d), console.log(f);
|
3225
3244
|
}
|
3226
3245
|
};
|
3227
|
-
return
|
3228
|
-
|
3246
|
+
return Ae(() => (j.addEventListener(A.GET_OBJECT, a), j.addEventListener(A.UPDATE_OBJECT, i), j.addEventListener(A.CREATE_TEXTURE, c), j.addEventListener(A.REQUEST_METHOD, u), () => {
|
3247
|
+
j.removeEventListener(A.GET_OBJECT, a), j.removeEventListener(A.UPDATE_OBJECT, i), j.removeEventListener(A.CREATE_TEXTURE, c), j.removeEventListener(A.REQUEST_METHOD, u);
|
3229
3248
|
}), []), null;
|
3230
3249
|
}
|
3231
|
-
class
|
3250
|
+
class bi extends oa {
|
3232
3251
|
constructor(n, a) {
|
3233
3252
|
const t = [1, 1, 0, -1, 1, 0, -1, -1, 0, 1, -1, 0, 1, 1, 0], i = new Yt();
|
3234
|
-
i.setAttribute("position", new
|
3235
|
-
const
|
3236
|
-
super(i,
|
3237
|
-
const u = [1, 1, 0, -1, 1, 0, -1, -1, 0, 1, 1, 0, -1, -1, 0, 1, -1, 0],
|
3238
|
-
|
3253
|
+
i.setAttribute("position", new Vt(t, 3)), i.computeBoundingSphere();
|
3254
|
+
const c = new ca({ fog: !1 });
|
3255
|
+
super(i, c), this.light = n, this.color = a, this.type = "RectAreaLightHelper";
|
3256
|
+
const u = [1, 1, 0, -1, 1, 0, -1, -1, 0, 1, 1, 0, -1, -1, 0, 1, -1, 0], o = new Yt();
|
3257
|
+
o.setAttribute("position", new Vt(u, 3)), o.computeBoundingSphere(), this.add(new Pn(o, new kn({ side: mn, fog: !1 })));
|
3239
3258
|
}
|
3240
3259
|
updateMatrixWorld() {
|
3241
3260
|
if (this.scale.set(0.5 * this.light.width, 0.5 * this.light.height, 1), this.color !== void 0)
|
@@ -3251,13 +3270,13 @@ class vi extends sa {
|
|
3251
3270
|
this.geometry.dispose(), this.material.dispose(), this.children[0].geometry.dispose(), this.children[0].material.dispose();
|
3252
3271
|
}
|
3253
3272
|
}
|
3254
|
-
const
|
3255
|
-
class
|
3273
|
+
const cn = { type: "change" }, At = { type: "start" }, ln = { type: "end" }, Et = new la(), un = new ua(), yi = Math.cos(70 * da.DEG2RAD);
|
3274
|
+
class xi extends hn {
|
3256
3275
|
constructor(n, a) {
|
3257
3276
|
super(), this.object = n, this.domElement = a, this.domElement.style.touchAction = "none", this.enabled = !0, this.target = new Y(), this.cursor = new Y(), 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: nt.ROTATE, MIDDLE: nt.DOLLY, RIGHT: nt.PAN }, this.touches = { ONE: at.ROTATE, TWO: at.DOLLY_PAN }, this.target0 = this.target.clone(), this.position0 = this.object.position.clone(), this.zoom0 = this.object.zoom, this._domElementKeyEvents = null, this.getPolarAngle = function() {
|
3258
|
-
return
|
3277
|
+
return o.phi;
|
3259
3278
|
}, this.getAzimuthalAngle = function() {
|
3260
|
-
return
|
3279
|
+
return o.theta;
|
3261
3280
|
}, this.getDistance = function() {
|
3262
3281
|
return this.object.position.distanceTo(this.target);
|
3263
3282
|
}, this.listenToKeyEvents = function(s) {
|
@@ -3267,46 +3286,46 @@ class yi extends dn {
|
|
3267
3286
|
}, this.saveState = function() {
|
3268
3287
|
t.target0.copy(t.target), t.position0.copy(t.object.position), t.zoom0 = t.object.zoom;
|
3269
3288
|
}, this.reset = function() {
|
3270
|
-
t.target.copy(t.target0), t.object.position.copy(t.position0), t.object.zoom = t.zoom0, t.object.updateProjectionMatrix(), t.dispatchEvent(
|
3289
|
+
t.target.copy(t.target0), t.object.position.copy(t.position0), t.object.zoom = t.zoom0, t.object.updateProjectionMatrix(), t.dispatchEvent(cn), t.update(), c = i.NONE;
|
3271
3290
|
}, this.update = function() {
|
3272
|
-
const s = new Y(), y = new
|
3291
|
+
const s = new Y(), y = new qt().setFromUnitVectors(n.up, new Y(0, 1, 0)), _ = y.clone().invert(), D = new Y(), ee = new qt(), ye = new Y(), de = 2 * Math.PI;
|
3273
3292
|
return function(bt = null) {
|
3274
3293
|
const yt = t.object.position;
|
3275
|
-
s.copy(yt).sub(t.target), s.applyQuaternion(y),
|
3294
|
+
s.copy(yt).sub(t.target), s.applyQuaternion(y), o.setFromVector3(s), t.autoRotate && c === i.NONE && ve(Te(bt)), t.enableDamping ? (o.theta += d.theta * t.dampingFactor, o.phi += d.phi * t.dampingFactor) : (o.theta += d.theta, o.phi += d.phi);
|
3276
3295
|
let xe = t.minAzimuthAngle, Ee = t.maxAzimuthAngle;
|
3277
|
-
isFinite(xe) && isFinite(Ee) && (xe < -Math.PI ? xe += de : xe > Math.PI && (xe -= de), Ee < -Math.PI ? Ee += de : Ee > Math.PI && (Ee -= de), xe <= Ee ?
|
3278
|
-
let
|
3296
|
+
isFinite(xe) && isFinite(Ee) && (xe < -Math.PI ? xe += de : xe > Math.PI && (xe -= de), Ee < -Math.PI ? Ee += de : Ee > Math.PI && (Ee -= de), xe <= Ee ? o.theta = Math.max(xe, Math.min(Ee, o.theta)) : o.theta = o.theta > (xe + Ee) / 2 ? Math.max(xe, o.theta) : Math.min(Ee, o.theta)), o.phi = Math.max(t.minPolarAngle, Math.min(t.maxPolarAngle, o.phi)), o.makeSafe(), t.enableDamping === !0 ? t.target.addScaledVector(f, t.dampingFactor) : t.target.add(f), t.target.sub(t.cursor), t.target.clampLength(t.minTargetRadius, t.maxTargetRadius), t.target.add(t.cursor);
|
3297
|
+
let Ve = !1;
|
3279
3298
|
if (t.zoomToCursor && Se || t.object.isOrthographicCamera)
|
3280
|
-
|
3299
|
+
o.radius = ke(o.radius);
|
3281
3300
|
else {
|
3282
|
-
const Oe =
|
3283
|
-
|
3301
|
+
const Oe = o.radius;
|
3302
|
+
o.radius = ke(o.radius * h), Ve = Oe != o.radius;
|
3284
3303
|
}
|
3285
|
-
if (s.setFromSpherical(
|
3304
|
+
if (s.setFromSpherical(o), s.applyQuaternion(_), yt.copy(t.target).add(s), t.object.lookAt(t.target), t.enableDamping === !0 ? (d.theta *= 1 - t.dampingFactor, d.phi *= 1 - t.dampingFactor, f.multiplyScalar(1 - t.dampingFactor)) : (d.set(0, 0, 0), f.set(0, 0, 0)), t.zoomToCursor && Se) {
|
3286
3305
|
let Oe = null;
|
3287
3306
|
if (t.object.isPerspectiveCamera) {
|
3288
|
-
const
|
3289
|
-
Oe = ke(
|
3290
|
-
const et =
|
3291
|
-
t.object.position.addScaledVector(
|
3307
|
+
const ze = s.length();
|
3308
|
+
Oe = ke(ze * h);
|
3309
|
+
const et = ze - Oe;
|
3310
|
+
t.object.position.addScaledVector(q, et), t.object.updateMatrixWorld(), Ve = !!et;
|
3292
3311
|
} else if (t.object.isOrthographicCamera) {
|
3293
|
-
const
|
3294
|
-
|
3312
|
+
const ze = new Y(ne.x, ne.y, 0);
|
3313
|
+
ze.unproject(t.object);
|
3295
3314
|
const et = t.object.zoom;
|
3296
|
-
t.object.zoom = Math.max(t.minZoom, Math.min(t.maxZoom, t.object.zoom /
|
3315
|
+
t.object.zoom = Math.max(t.minZoom, Math.min(t.maxZoom, t.object.zoom / h)), t.object.updateProjectionMatrix(), Ve = et !== t.object.zoom;
|
3297
3316
|
const xt = new Y(ne.x, ne.y, 0);
|
3298
|
-
xt.unproject(t.object), t.object.position.sub(xt).add(
|
3317
|
+
xt.unproject(t.object), t.object.position.sub(xt).add(ze), t.object.updateMatrixWorld(), Oe = s.length();
|
3299
3318
|
} else
|
3300
3319
|
console.warn("WARNING: OrbitControls.js encountered an unknown camera type - zoom to cursor disabled."), t.zoomToCursor = !1;
|
3301
|
-
Oe !== null && (this.screenSpacePanning ? t.target.set(0, 0, -1).transformDirection(t.object.matrix).multiplyScalar(Oe).add(t.object.position) : (Et.origin.copy(t.object.position), Et.direction.set(0, 0, -1).transformDirection(t.object.matrix), Math.abs(t.object.up.dot(Et.direction)) <
|
3320
|
+
Oe !== null && (this.screenSpacePanning ? t.target.set(0, 0, -1).transformDirection(t.object.matrix).multiplyScalar(Oe).add(t.object.position) : (Et.origin.copy(t.object.position), Et.direction.set(0, 0, -1).transformDirection(t.object.matrix), Math.abs(t.object.up.dot(Et.direction)) < yi ? n.lookAt(t.target) : (un.setFromNormalAndCoplanarPoint(t.object.up, t.target), Et.intersectPlane(un, t.target))));
|
3302
3321
|
} else if (t.object.isOrthographicCamera) {
|
3303
3322
|
const Oe = t.object.zoom;
|
3304
|
-
t.object.zoom = Math.max(t.minZoom, Math.min(t.maxZoom, t.object.zoom /
|
3323
|
+
t.object.zoom = Math.max(t.minZoom, Math.min(t.maxZoom, t.object.zoom / h)), Oe !== t.object.zoom && (t.object.updateProjectionMatrix(), Ve = !0);
|
3305
3324
|
}
|
3306
|
-
return
|
3325
|
+
return h = 1, Se = !1, Ve || D.distanceToSquared(t.object.position) > u || 8 * (1 - ee.dot(t.object.quaternion)) > u || ye.distanceToSquared(t.target) > u ? (t.dispatchEvent(cn), D.copy(t.object.position), ee.copy(t.object.quaternion), ye.copy(t.target), !0) : !1;
|
3307
3326
|
};
|
3308
3327
|
}(), this.dispose = function() {
|
3309
|
-
t.domElement.removeEventListener("contextmenu", Qe), t.domElement.removeEventListener("pointerdown",
|
3328
|
+
t.domElement.removeEventListener("contextmenu", Qe), t.domElement.removeEventListener("pointerdown", O), t.domElement.removeEventListener("pointercancel", G), t.domElement.removeEventListener("wheel", mt), t.domElement.removeEventListener("pointermove", B), t.domElement.removeEventListener("pointerup", G), t.domElement.getRootNode().removeEventListener("keydown", st, { capture: !0 }), t._domElementKeyEvents !== null && (t._domElementKeyEvents.removeEventListener("keydown", ot), t._domElementKeyEvents = null);
|
3310
3329
|
};
|
3311
3330
|
const t = this, i = {
|
3312
3331
|
NONE: -1,
|
@@ -3318,96 +3337,96 @@ class yi extends dn {
|
|
3318
3337
|
TOUCH_DOLLY_PAN: 5,
|
3319
3338
|
TOUCH_DOLLY_ROTATE: 6
|
3320
3339
|
};
|
3321
|
-
let
|
3322
|
-
const u = 1e-6,
|
3323
|
-
let
|
3324
|
-
const f = new Y(), m = new fe(), x = new fe(),
|
3340
|
+
let c = i.NONE;
|
3341
|
+
const u = 1e-6, o = new Zt(), d = new Zt();
|
3342
|
+
let h = 1;
|
3343
|
+
const f = new Y(), m = new fe(), x = new fe(), T = new fe(), H = new fe(), te = new fe(), me = new fe(), re = new fe(), $ = new fe(), I = new fe(), q = new Y(), ne = new fe();
|
3325
3344
|
let Se = !1;
|
3326
|
-
const
|
3327
|
-
let
|
3328
|
-
function
|
3345
|
+
const z = [], pe = {};
|
3346
|
+
let ce = !1;
|
3347
|
+
function Te(s) {
|
3329
3348
|
return s !== null ? 2 * Math.PI / 60 * t.autoRotateSpeed * s : 2 * Math.PI / 60 / 60 * t.autoRotateSpeed;
|
3330
3349
|
}
|
3331
|
-
function
|
3350
|
+
function _e(s) {
|
3332
3351
|
const y = Math.abs(s * 0.01);
|
3333
3352
|
return Math.pow(0.95, t.zoomSpeed * y);
|
3334
3353
|
}
|
3335
3354
|
function ve(s) {
|
3336
|
-
|
3355
|
+
d.theta -= s;
|
3337
3356
|
}
|
3338
|
-
function
|
3339
|
-
|
3357
|
+
function N(s) {
|
3358
|
+
d.phi -= s;
|
3340
3359
|
}
|
3341
3360
|
const be = function() {
|
3342
3361
|
const s = new Y();
|
3343
|
-
return function(
|
3344
|
-
s.setFromMatrixColumn(
|
3362
|
+
return function(_, D) {
|
3363
|
+
s.setFromMatrixColumn(D, 0), s.multiplyScalar(-_), f.add(s);
|
3345
3364
|
};
|
3346
|
-
}(),
|
3365
|
+
}(), w = function() {
|
3347
3366
|
const s = new Y();
|
3348
|
-
return function(
|
3349
|
-
t.screenSpacePanning === !0 ? s.setFromMatrixColumn(
|
3367
|
+
return function(_, D) {
|
3368
|
+
t.screenSpacePanning === !0 ? s.setFromMatrixColumn(D, 1) : (s.setFromMatrixColumn(D, 0), s.crossVectors(t.object.up, s)), s.multiplyScalar(_), f.add(s);
|
3350
3369
|
};
|
3351
3370
|
}(), we = function() {
|
3352
3371
|
const s = new Y();
|
3353
|
-
return function(
|
3372
|
+
return function(_, D) {
|
3354
3373
|
const ee = t.domElement;
|
3355
3374
|
if (t.object.isPerspectiveCamera) {
|
3356
3375
|
const ye = t.object.position;
|
3357
3376
|
s.copy(ye).sub(t.target);
|
3358
3377
|
let de = s.length();
|
3359
|
-
de *= Math.tan(t.object.fov / 2 * Math.PI / 180), be(2 *
|
3378
|
+
de *= Math.tan(t.object.fov / 2 * Math.PI / 180), be(2 * _ * de / ee.clientHeight, t.object.matrix), w(2 * D * de / ee.clientHeight, t.object.matrix);
|
3360
3379
|
} else
|
3361
|
-
t.object.isOrthographicCamera ? (be(
|
3380
|
+
t.object.isOrthographicCamera ? (be(_ * (t.object.right - t.object.left) / t.object.zoom / ee.clientWidth, t.object.matrix), w(D * (t.object.top - t.object.bottom) / t.object.zoom / ee.clientHeight, t.object.matrix)) : (console.warn("WARNING: OrbitControls.js encountered an unknown camera type - pan disabled."), t.enablePan = !1);
|
3362
3381
|
};
|
3363
3382
|
}();
|
3364
3383
|
function Re(s) {
|
3365
|
-
t.object.isPerspectiveCamera || t.object.isOrthographicCamera ?
|
3384
|
+
t.object.isPerspectiveCamera || t.object.isOrthographicCamera ? h /= s : (console.warn("WARNING: OrbitControls.js encountered an unknown camera type - dolly/zoom disabled."), t.enableZoom = !1);
|
3366
3385
|
}
|
3367
|
-
function
|
3368
|
-
t.object.isPerspectiveCamera || t.object.isOrthographicCamera ?
|
3386
|
+
function De(s) {
|
3387
|
+
t.object.isPerspectiveCamera || t.object.isOrthographicCamera ? h *= s : (console.warn("WARNING: OrbitControls.js encountered an unknown camera type - dolly/zoom disabled."), t.enableZoom = !1);
|
3369
3388
|
}
|
3370
|
-
function
|
3389
|
+
function Pe(s, y) {
|
3371
3390
|
if (!t.zoomToCursor)
|
3372
3391
|
return;
|
3373
3392
|
Se = !0;
|
3374
|
-
const
|
3375
|
-
ne.x =
|
3393
|
+
const _ = t.domElement.getBoundingClientRect(), D = s - _.left, ee = y - _.top, ye = _.width, de = _.height;
|
3394
|
+
ne.x = D / ye * 2 - 1, ne.y = -(ee / de) * 2 + 1, q.set(ne.x, ne.y, 1).unproject(t.object).sub(t.object.position).normalize();
|
3376
3395
|
}
|
3377
3396
|
function ke(s) {
|
3378
3397
|
return Math.max(t.minDistance, Math.min(t.maxDistance, s));
|
3379
3398
|
}
|
3380
|
-
function
|
3399
|
+
function Ie(s) {
|
3381
3400
|
m.set(s.clientX, s.clientY);
|
3382
3401
|
}
|
3383
|
-
function Fe(s) {
|
3384
|
-
Ae(s.clientX, s.clientX), re.set(s.clientX, s.clientY);
|
3385
|
-
}
|
3386
3402
|
function Be(s) {
|
3403
|
+
Pe(s.clientX, s.clientX), re.set(s.clientX, s.clientY);
|
3404
|
+
}
|
3405
|
+
function Fe(s) {
|
3387
3406
|
H.set(s.clientX, s.clientY);
|
3388
3407
|
}
|
3389
3408
|
function ae(s) {
|
3390
|
-
x.set(s.clientX, s.clientY),
|
3409
|
+
x.set(s.clientX, s.clientY), T.subVectors(x, m).multiplyScalar(t.rotateSpeed);
|
3391
3410
|
const y = t.domElement;
|
3392
|
-
ve(2 * Math.PI *
|
3411
|
+
ve(2 * Math.PI * T.x / y.clientHeight), N(2 * Math.PI * T.y / y.clientHeight), m.copy(x), t.update();
|
3393
3412
|
}
|
3394
3413
|
function Me(s) {
|
3395
|
-
$.set(s.clientX, s.clientY),
|
3414
|
+
$.set(s.clientX, s.clientY), I.subVectors($, re), I.y > 0 ? Re(_e(I.y)) : I.y < 0 && De(_e(I.y)), re.copy($), t.update();
|
3396
3415
|
}
|
3397
|
-
function
|
3416
|
+
function He(s) {
|
3398
3417
|
te.set(s.clientX, s.clientY), me.subVectors(te, H).multiplyScalar(t.panSpeed), we(me.x, me.y), H.copy(te), t.update();
|
3399
3418
|
}
|
3400
|
-
function
|
3401
|
-
|
3419
|
+
function Ye(s) {
|
3420
|
+
Pe(s.clientX, s.clientY), s.deltaY < 0 ? De(_e(s.deltaY)) : s.deltaY > 0 && Re(_e(s.deltaY)), t.update();
|
3402
3421
|
}
|
3403
3422
|
function ue(s) {
|
3404
3423
|
let y = !1;
|
3405
3424
|
switch (s.code) {
|
3406
3425
|
case t.keys.UP:
|
3407
|
-
s.ctrlKey || s.metaKey || s.shiftKey ?
|
3426
|
+
s.ctrlKey || s.metaKey || s.shiftKey ? N(2 * Math.PI * t.rotateSpeed / t.domElement.clientHeight) : we(0, t.keyPanSpeed), y = !0;
|
3408
3427
|
break;
|
3409
3428
|
case t.keys.BOTTOM:
|
3410
|
-
s.ctrlKey || s.metaKey || s.shiftKey ?
|
3429
|
+
s.ctrlKey || s.metaKey || s.shiftKey ? N(-2 * Math.PI * t.rotateSpeed / t.domElement.clientHeight) : we(0, -t.keyPanSpeed), y = !0;
|
3411
3430
|
break;
|
3412
3431
|
case t.keys.LEFT:
|
3413
3432
|
s.ctrlKey || s.metaKey || s.shiftKey ? ve(2 * Math.PI * t.rotateSpeed / t.domElement.clientHeight) : we(t.keyPanSpeed, 0), y = !0;
|
@@ -3419,81 +3438,81 @@ class yi extends dn {
|
|
3419
3438
|
y && (s.preventDefault(), t.update());
|
3420
3439
|
}
|
3421
3440
|
function g(s) {
|
3422
|
-
if (
|
3441
|
+
if (z.length === 1)
|
3423
3442
|
m.set(s.pageX, s.pageY);
|
3424
3443
|
else {
|
3425
|
-
const y = $e(s),
|
3426
|
-
m.set(
|
3444
|
+
const y = $e(s), _ = 0.5 * (s.pageX + y.x), D = 0.5 * (s.pageY + y.y);
|
3445
|
+
m.set(_, D);
|
3427
3446
|
}
|
3428
3447
|
}
|
3429
3448
|
function v(s) {
|
3430
|
-
if (
|
3449
|
+
if (z.length === 1)
|
3431
3450
|
H.set(s.pageX, s.pageY);
|
3432
3451
|
else {
|
3433
|
-
const y = $e(s),
|
3434
|
-
H.set(
|
3452
|
+
const y = $e(s), _ = 0.5 * (s.pageX + y.x), D = 0.5 * (s.pageY + y.y);
|
3453
|
+
H.set(_, D);
|
3435
3454
|
}
|
3436
3455
|
}
|
3437
|
-
function
|
3438
|
-
const y = $e(s),
|
3456
|
+
function M(s) {
|
3457
|
+
const y = $e(s), _ = s.pageX - y.x, D = s.pageY - y.y, ee = Math.sqrt(_ * _ + D * D);
|
3439
3458
|
re.set(0, ee);
|
3440
3459
|
}
|
3441
|
-
function
|
3442
|
-
t.enableZoom &&
|
3460
|
+
function P(s) {
|
3461
|
+
t.enableZoom && M(s), t.enablePan && v(s);
|
3443
3462
|
}
|
3444
3463
|
function ge(s) {
|
3445
|
-
t.enableZoom &&
|
3464
|
+
t.enableZoom && M(s), t.enableRotate && g(s);
|
3446
3465
|
}
|
3447
|
-
function
|
3448
|
-
if (
|
3466
|
+
function le(s) {
|
3467
|
+
if (z.length == 1)
|
3449
3468
|
x.set(s.pageX, s.pageY);
|
3450
3469
|
else {
|
3451
|
-
const
|
3452
|
-
x.set(
|
3470
|
+
const _ = $e(s), D = 0.5 * (s.pageX + _.x), ee = 0.5 * (s.pageY + _.y);
|
3471
|
+
x.set(D, ee);
|
3453
3472
|
}
|
3454
|
-
|
3473
|
+
T.subVectors(x, m).multiplyScalar(t.rotateSpeed);
|
3455
3474
|
const y = t.domElement;
|
3456
|
-
ve(2 * Math.PI *
|
3475
|
+
ve(2 * Math.PI * T.x / y.clientHeight), N(2 * Math.PI * T.y / y.clientHeight), m.copy(x);
|
3457
3476
|
}
|
3458
|
-
function
|
3459
|
-
if (
|
3477
|
+
function C(s) {
|
3478
|
+
if (z.length === 1)
|
3460
3479
|
te.set(s.pageX, s.pageY);
|
3461
3480
|
else {
|
3462
|
-
const y = $e(s),
|
3463
|
-
te.set(
|
3481
|
+
const y = $e(s), _ = 0.5 * (s.pageX + y.x), D = 0.5 * (s.pageY + y.y);
|
3482
|
+
te.set(_, D);
|
3464
3483
|
}
|
3465
3484
|
me.subVectors(te, H).multiplyScalar(t.panSpeed), we(me.x, me.y), H.copy(te);
|
3466
3485
|
}
|
3467
|
-
function
|
3468
|
-
const y = $e(s),
|
3469
|
-
$.set(0, ee),
|
3486
|
+
function E(s) {
|
3487
|
+
const y = $e(s), _ = s.pageX - y.x, D = s.pageY - y.y, ee = Math.sqrt(_ * _ + D * D);
|
3488
|
+
$.set(0, ee), I.set(0, Math.pow($.y / re.y, t.zoomSpeed)), Re(I.y), re.copy($);
|
3470
3489
|
const ye = (s.pageX + y.x) * 0.5, de = (s.pageY + y.y) * 0.5;
|
3471
|
-
|
3490
|
+
Pe(ye, de);
|
3472
3491
|
}
|
3473
|
-
function
|
3474
|
-
t.enableZoom &&
|
3492
|
+
function F(s) {
|
3493
|
+
t.enableZoom && E(s), t.enablePan && C(s);
|
3475
3494
|
}
|
3476
|
-
function
|
3477
|
-
t.enableZoom &&
|
3495
|
+
function K(s) {
|
3496
|
+
t.enableZoom && E(s), t.enableRotate && le(s);
|
3478
3497
|
}
|
3479
|
-
function
|
3480
|
-
t.enabled !== !1 && (
|
3498
|
+
function O(s) {
|
3499
|
+
t.enabled !== !1 && (z.length === 0 && (t.domElement.setPointerCapture(s.pointerId), t.domElement.addEventListener("pointermove", B), t.domElement.addEventListener("pointerup", G)), !Pt(s) && (_t(s), s.pointerType === "touch" ? ct(s) : Ne(s)));
|
3481
3500
|
}
|
3482
3501
|
function B(s) {
|
3483
|
-
t.enabled !== !1 && (s.pointerType === "touch" ? gt(s) :
|
3502
|
+
t.enabled !== !1 && (s.pointerType === "touch" ? gt(s) : Ke(s));
|
3484
3503
|
}
|
3485
|
-
function
|
3486
|
-
switch (Rt(s),
|
3504
|
+
function G(s) {
|
3505
|
+
switch (Rt(s), z.length) {
|
3487
3506
|
case 0:
|
3488
|
-
t.domElement.releasePointerCapture(s.pointerId), t.domElement.removeEventListener("pointermove", B), t.domElement.removeEventListener("pointerup",
|
3507
|
+
t.domElement.releasePointerCapture(s.pointerId), t.domElement.removeEventListener("pointermove", B), t.domElement.removeEventListener("pointerup", G), t.dispatchEvent(ln), c = i.NONE;
|
3489
3508
|
break;
|
3490
3509
|
case 1:
|
3491
|
-
const y =
|
3492
|
-
ct({ pointerId: y, pageX:
|
3510
|
+
const y = z[0], _ = pe[y];
|
3511
|
+
ct({ pointerId: y, pageX: _.x, pageY: _.y });
|
3493
3512
|
break;
|
3494
3513
|
}
|
3495
3514
|
}
|
3496
|
-
function
|
3515
|
+
function Ne(s) {
|
3497
3516
|
let y;
|
3498
3517
|
switch (s.button) {
|
3499
3518
|
case 0:
|
@@ -3512,37 +3531,37 @@ class yi extends dn {
|
|
3512
3531
|
case nt.DOLLY:
|
3513
3532
|
if (t.enableZoom === !1)
|
3514
3533
|
return;
|
3515
|
-
|
3534
|
+
Be(s), c = i.DOLLY;
|
3516
3535
|
break;
|
3517
3536
|
case nt.ROTATE:
|
3518
3537
|
if (s.ctrlKey || s.metaKey || s.shiftKey) {
|
3519
3538
|
if (t.enablePan === !1)
|
3520
3539
|
return;
|
3521
|
-
|
3540
|
+
Fe(s), c = i.PAN;
|
3522
3541
|
} else {
|
3523
3542
|
if (t.enableRotate === !1)
|
3524
3543
|
return;
|
3525
|
-
|
3544
|
+
Ie(s), c = i.ROTATE;
|
3526
3545
|
}
|
3527
3546
|
break;
|
3528
3547
|
case nt.PAN:
|
3529
3548
|
if (s.ctrlKey || s.metaKey || s.shiftKey) {
|
3530
3549
|
if (t.enableRotate === !1)
|
3531
3550
|
return;
|
3532
|
-
|
3551
|
+
Ie(s), c = i.ROTATE;
|
3533
3552
|
} else {
|
3534
3553
|
if (t.enablePan === !1)
|
3535
3554
|
return;
|
3536
|
-
|
3555
|
+
Fe(s), c = i.PAN;
|
3537
3556
|
}
|
3538
3557
|
break;
|
3539
3558
|
default:
|
3540
|
-
|
3559
|
+
c = i.NONE;
|
3541
3560
|
}
|
3542
|
-
|
3561
|
+
c !== i.NONE && t.dispatchEvent(At);
|
3543
3562
|
}
|
3544
|
-
function
|
3545
|
-
switch (
|
3563
|
+
function Ke(s) {
|
3564
|
+
switch (c) {
|
3546
3565
|
case i.ROTATE:
|
3547
3566
|
if (t.enableRotate === !1)
|
3548
3567
|
return;
|
@@ -3556,54 +3575,54 @@ class yi extends dn {
|
|
3556
3575
|
case i.PAN:
|
3557
3576
|
if (t.enablePan === !1)
|
3558
3577
|
return;
|
3559
|
-
|
3578
|
+
He(s);
|
3560
3579
|
break;
|
3561
3580
|
}
|
3562
3581
|
}
|
3563
3582
|
function mt(s) {
|
3564
|
-
t.enabled === !1 || t.enableZoom === !1 ||
|
3583
|
+
t.enabled === !1 || t.enableZoom === !1 || c !== i.NONE || (s.preventDefault(), t.dispatchEvent(At), Ye(pt(s)), t.dispatchEvent(ln));
|
3565
3584
|
}
|
3566
3585
|
function pt(s) {
|
3567
|
-
const y = s.deltaMode,
|
3586
|
+
const y = s.deltaMode, _ = {
|
3568
3587
|
clientX: s.clientX,
|
3569
3588
|
clientY: s.clientY,
|
3570
3589
|
deltaY: s.deltaY
|
3571
3590
|
};
|
3572
3591
|
switch (y) {
|
3573
3592
|
case 1:
|
3574
|
-
|
3593
|
+
_.deltaY *= 16;
|
3575
3594
|
break;
|
3576
3595
|
case 2:
|
3577
|
-
|
3596
|
+
_.deltaY *= 100;
|
3578
3597
|
break;
|
3579
3598
|
}
|
3580
|
-
return s.ctrlKey && !
|
3599
|
+
return s.ctrlKey && !ce && (_.deltaY *= 10), _;
|
3581
3600
|
}
|
3582
3601
|
function st(s) {
|
3583
|
-
s.key === "Control" && (
|
3602
|
+
s.key === "Control" && (ce = !0, t.domElement.getRootNode().addEventListener("keyup", Ue, { passive: !0, capture: !0 }));
|
3584
3603
|
}
|
3585
3604
|
function Ue(s) {
|
3586
|
-
s.key === "Control" && (
|
3605
|
+
s.key === "Control" && (ce = !1, t.domElement.getRootNode().removeEventListener("keyup", Ue, { passive: !0, capture: !0 }));
|
3587
3606
|
}
|
3588
3607
|
function ot(s) {
|
3589
3608
|
t.enabled === !1 || t.enablePan === !1 || ue(s);
|
3590
3609
|
}
|
3591
3610
|
function ct(s) {
|
3592
|
-
switch (vt(s),
|
3611
|
+
switch (vt(s), z.length) {
|
3593
3612
|
case 1:
|
3594
3613
|
switch (t.touches.ONE) {
|
3595
3614
|
case at.ROTATE:
|
3596
3615
|
if (t.enableRotate === !1)
|
3597
3616
|
return;
|
3598
|
-
g(s),
|
3617
|
+
g(s), c = i.TOUCH_ROTATE;
|
3599
3618
|
break;
|
3600
3619
|
case at.PAN:
|
3601
3620
|
if (t.enablePan === !1)
|
3602
3621
|
return;
|
3603
|
-
v(s),
|
3622
|
+
v(s), c = i.TOUCH_PAN;
|
3604
3623
|
break;
|
3605
3624
|
default:
|
3606
|
-
|
3625
|
+
c = i.NONE;
|
3607
3626
|
}
|
3608
3627
|
break;
|
3609
3628
|
case 2:
|
@@ -3611,65 +3630,65 @@ class yi extends dn {
|
|
3611
3630
|
case at.DOLLY_PAN:
|
3612
3631
|
if (t.enableZoom === !1 && t.enablePan === !1)
|
3613
3632
|
return;
|
3614
|
-
|
3633
|
+
P(s), c = i.TOUCH_DOLLY_PAN;
|
3615
3634
|
break;
|
3616
3635
|
case at.DOLLY_ROTATE:
|
3617
3636
|
if (t.enableZoom === !1 && t.enableRotate === !1)
|
3618
3637
|
return;
|
3619
|
-
ge(s),
|
3638
|
+
ge(s), c = i.TOUCH_DOLLY_ROTATE;
|
3620
3639
|
break;
|
3621
3640
|
default:
|
3622
|
-
|
3641
|
+
c = i.NONE;
|
3623
3642
|
}
|
3624
3643
|
break;
|
3625
3644
|
default:
|
3626
|
-
|
3645
|
+
c = i.NONE;
|
3627
3646
|
}
|
3628
|
-
|
3647
|
+
c !== i.NONE && t.dispatchEvent(At);
|
3629
3648
|
}
|
3630
3649
|
function gt(s) {
|
3631
|
-
switch (vt(s),
|
3650
|
+
switch (vt(s), c) {
|
3632
3651
|
case i.TOUCH_ROTATE:
|
3633
3652
|
if (t.enableRotate === !1)
|
3634
3653
|
return;
|
3635
|
-
|
3654
|
+
le(s), t.update();
|
3636
3655
|
break;
|
3637
3656
|
case i.TOUCH_PAN:
|
3638
3657
|
if (t.enablePan === !1)
|
3639
3658
|
return;
|
3640
|
-
|
3659
|
+
C(s), t.update();
|
3641
3660
|
break;
|
3642
3661
|
case i.TOUCH_DOLLY_PAN:
|
3643
3662
|
if (t.enableZoom === !1 && t.enablePan === !1)
|
3644
3663
|
return;
|
3645
|
-
|
3664
|
+
F(s), t.update();
|
3646
3665
|
break;
|
3647
3666
|
case i.TOUCH_DOLLY_ROTATE:
|
3648
3667
|
if (t.enableZoom === !1 && t.enableRotate === !1)
|
3649
3668
|
return;
|
3650
|
-
|
3669
|
+
K(s), t.update();
|
3651
3670
|
break;
|
3652
3671
|
default:
|
3653
|
-
|
3672
|
+
c = i.NONE;
|
3654
3673
|
}
|
3655
3674
|
}
|
3656
3675
|
function Qe(s) {
|
3657
3676
|
t.enabled !== !1 && s.preventDefault();
|
3658
3677
|
}
|
3659
|
-
function
|
3660
|
-
|
3678
|
+
function _t(s) {
|
3679
|
+
z.push(s.pointerId);
|
3661
3680
|
}
|
3662
3681
|
function Rt(s) {
|
3663
3682
|
delete pe[s.pointerId];
|
3664
|
-
for (let y = 0; y <
|
3665
|
-
if (
|
3666
|
-
|
3683
|
+
for (let y = 0; y < z.length; y++)
|
3684
|
+
if (z[y] == s.pointerId) {
|
3685
|
+
z.splice(y, 1);
|
3667
3686
|
return;
|
3668
3687
|
}
|
3669
3688
|
}
|
3670
|
-
function
|
3671
|
-
for (let y = 0; y <
|
3672
|
-
if (
|
3689
|
+
function Pt(s) {
|
3690
|
+
for (let y = 0; y < z.length; y++)
|
3691
|
+
if (z[y] == s.pointerId)
|
3673
3692
|
return !0;
|
3674
3693
|
return !1;
|
3675
3694
|
}
|
@@ -3678,27 +3697,27 @@ class yi extends dn {
|
|
3678
3697
|
y === void 0 && (y = new fe(), pe[s.pointerId] = y), y.set(s.pageX, s.pageY);
|
3679
3698
|
}
|
3680
3699
|
function $e(s) {
|
3681
|
-
const y = s.pointerId ===
|
3700
|
+
const y = s.pointerId === z[0] ? z[1] : z[0];
|
3682
3701
|
return pe[y];
|
3683
3702
|
}
|
3684
|
-
t.domElement.addEventListener("contextmenu", Qe), t.domElement.addEventListener("pointerdown",
|
3703
|
+
t.domElement.addEventListener("contextmenu", Qe), t.domElement.addEventListener("pointerdown", O), t.domElement.addEventListener("pointercancel", G), t.domElement.addEventListener("wheel", mt, { passive: !1 }), t.domElement.getRootNode().addEventListener("keydown", st, { passive: !0, capture: !0 }), this.update();
|
3685
3704
|
}
|
3686
3705
|
}
|
3687
3706
|
function rt(e, n, a, t, i) {
|
3688
3707
|
return t + (e - n) * (i - t) / (a - n);
|
3689
3708
|
}
|
3690
3709
|
const wt = (e) => {
|
3691
|
-
const [n, a] =
|
3710
|
+
const [n, a] = X(e.options[e.index]), t = () => {
|
3692
3711
|
e.onToggle(!e.open);
|
3693
|
-
}, i = (
|
3694
|
-
|
3712
|
+
}, i = (c) => {
|
3713
|
+
c !== n && (e.onSelect(c), a(c)), e.onToggle(!1);
|
3695
3714
|
};
|
3696
3715
|
return /* @__PURE__ */ l.jsxs("div", { className: `dropdown ${e.up === !0 ? "up" : ""}`, children: [
|
3697
3716
|
/* @__PURE__ */ l.jsx("div", { className: "dropdown-toggle", onClick: t, children: n }),
|
3698
|
-
e.open && /* @__PURE__ */ l.jsx("ul", { className: "dropdown-menu", children: e.options.map((
|
3717
|
+
e.open && /* @__PURE__ */ l.jsx("ul", { className: "dropdown-menu", children: e.options.map((c) => /* @__PURE__ */ l.jsx("li", { onClick: () => i(c), children: c }, c)) })
|
3699
3718
|
] });
|
3700
|
-
}, qe =
|
3701
|
-
const [t, i] =
|
3719
|
+
}, qe = Ta(function(n, a) {
|
3720
|
+
const [t, i] = X(!1), c = n.options.indexOf(n.camera.name);
|
3702
3721
|
return /* @__PURE__ */ l.jsxs("div", { className: "CameraWindow", children: [
|
3703
3722
|
/* @__PURE__ */ l.jsx("div", { ref: a, className: "clickable", onClick: () => {
|
3704
3723
|
t && i(!1);
|
@@ -3706,7 +3725,7 @@ const wt = (e) => {
|
|
3706
3725
|
/* @__PURE__ */ l.jsx(
|
3707
3726
|
wt,
|
3708
3727
|
{
|
3709
|
-
index:
|
3728
|
+
index: c,
|
3710
3729
|
open: t,
|
3711
3730
|
options: n.options,
|
3712
3731
|
onSelect: n.onSelect,
|
@@ -3718,15 +3737,15 @@ const wt = (e) => {
|
|
3718
3737
|
)
|
3719
3738
|
] });
|
3720
3739
|
});
|
3721
|
-
class
|
3740
|
+
class Ei extends jn {
|
3722
3741
|
constructor(n) {
|
3723
3742
|
super({
|
3724
3743
|
extensions: {
|
3725
3744
|
// @ts-ignore
|
3726
3745
|
derivatives: !0
|
3727
3746
|
},
|
3728
|
-
glslVersion:
|
3729
|
-
side:
|
3747
|
+
glslVersion: ha,
|
3748
|
+
side: pn,
|
3730
3749
|
transparent: !0,
|
3731
3750
|
uniforms: {
|
3732
3751
|
uScale: {
|
@@ -3831,17 +3850,17 @@ class xi extends kn {
|
|
3831
3850
|
});
|
3832
3851
|
}
|
3833
3852
|
}
|
3834
|
-
class
|
3853
|
+
class Ci extends Pn {
|
3835
3854
|
gridMaterial;
|
3836
3855
|
constructor() {
|
3837
|
-
const n = new
|
3838
|
-
super(new
|
3856
|
+
const n = new Ei();
|
3857
|
+
super(new fa(2, 2), n), this.gridMaterial = n, this.frustumCulled = !1, this.name = "InfiniteGridHelper", this.position.y = 0.1;
|
3839
3858
|
}
|
3840
3859
|
update() {
|
3841
3860
|
this.gridMaterial.needsUpdate = !0;
|
3842
3861
|
}
|
3843
3862
|
}
|
3844
|
-
const
|
3863
|
+
const Si = `#include <common>
|
3845
3864
|
#include <batching_pars_vertex>
|
3846
3865
|
#include <uv_pars_vertex>
|
3847
3866
|
#include <color_pars_vertex>
|
@@ -3871,7 +3890,7 @@ void main() {
|
|
3871
3890
|
#include <logdepthbuf_vertex>
|
3872
3891
|
#include <clipping_planes_vertex>
|
3873
3892
|
#include <worldpos_vertex>
|
3874
|
-
}`,
|
3893
|
+
}`, wi = `
|
3875
3894
|
#include <common>
|
3876
3895
|
#include <uv_pars_fragment>
|
3877
3896
|
#include <clipping_planes_pars_fragment>
|
@@ -3880,27 +3899,27 @@ void main() {
|
|
3880
3899
|
#include <clipping_planes_fragment>
|
3881
3900
|
gl_FragColor = vec4(vec3(vUv, 0.0), 1.0);
|
3882
3901
|
}`;
|
3883
|
-
class
|
3902
|
+
class Mi extends jn {
|
3884
3903
|
constructor() {
|
3885
3904
|
super({
|
3886
3905
|
defines: {
|
3887
3906
|
USE_UV: ""
|
3888
3907
|
},
|
3889
|
-
vertexShader:
|
3890
|
-
fragmentShader:
|
3908
|
+
vertexShader: Si,
|
3909
|
+
fragmentShader: wi
|
3891
3910
|
});
|
3892
3911
|
}
|
3893
3912
|
}
|
3894
|
-
let Ct = "Renderer",
|
3895
|
-
function
|
3896
|
-
const n = e.three.app.appID, a = localStorage.getItem(`${n}_mode`), t = localStorage.getItem(`${n}_tlCam`) !== null ? localStorage.getItem(`${n}_tlCam`) : "Debug", i = localStorage.getItem(`${n}_trCam`) !== null ? localStorage.getItem(`${n}_trCam`) : "Orthographic",
|
3913
|
+
let Ct = "Renderer", je, St = !1, dn = !1, W = null, oe = null, Ge = null, We = null;
|
3914
|
+
function $i(e) {
|
3915
|
+
const n = e.three.app.appID, a = localStorage.getItem(`${n}_mode`), t = localStorage.getItem(`${n}_tlCam`) !== null ? localStorage.getItem(`${n}_tlCam`) : "Debug", i = localStorage.getItem(`${n}_trCam`) !== null ? localStorage.getItem(`${n}_trCam`) : "Orthographic", c = localStorage.getItem(`${n}_blCam`) !== null ? localStorage.getItem(`${n}_blCam`) : "Front", u = localStorage.getItem(`${n}_brCam`) !== null ? localStorage.getItem(`${n}_brCam`) : "Top", o = ie(() => /* @__PURE__ */ new Map(), []), d = ie(() => /* @__PURE__ */ new Map(), []), h = ie(() => /* @__PURE__ */ new Map(), []), f = ie(() => /* @__PURE__ */ new Map(), []), m = ie(() => new ma(), []), x = ie(() => new pa(), []), T = ie(() => new Ci(), []), H = ie(() => new Xt(500), []), te = ie(() => new Xt(100), []), me = ie(() => new ga(), []), re = ie(() => new va(), []), $ = ie(() => new Mi(), []), I = ie(() => new kn({
|
3897
3916
|
opacity: 0.33,
|
3898
3917
|
transparent: !0,
|
3899
3918
|
wireframe: !0
|
3900
3919
|
}), []);
|
3901
|
-
function
|
3902
|
-
const
|
3903
|
-
return
|
3920
|
+
function q(g, v) {
|
3921
|
+
const M = new Jt(-100, 100, 100, -100, 50, 5e3);
|
3922
|
+
return M.name = g, M.position.copy(v), M.lookAt(0, 0, 0), o.set(g, M), M;
|
3904
3923
|
}
|
3905
3924
|
const ne = [
|
3906
3925
|
"Renderer",
|
@@ -3913,266 +3932,270 @@ function Ui(e) {
|
|
3913
3932
|
"Side by Side",
|
3914
3933
|
"Stacked",
|
3915
3934
|
"Quad"
|
3916
|
-
],
|
3917
|
-
localStorage.setItem(`${n}_mode`,
|
3935
|
+
], z = J(null), pe = J(null), ce = J(null), Te = J(null), _e = J(null), ve = J(null), [N, be] = X(a !== null ? a : "Single"), [w, we] = X(null), [Re, De] = X(!1), [Pe, ke] = X(!1), [Ie, Be] = X(!1), [, Fe] = X(Date.now());
|
3936
|
+
localStorage.setItem(`${n}_mode`, N), localStorage.setItem(`${n}_tlCam`, t), localStorage.setItem(`${n}_trCam`, i), localStorage.setItem(`${n}_blCam`, c), localStorage.setItem(`${n}_brCam`, u);
|
3918
3937
|
const ae = (g, v) => {
|
3919
|
-
const
|
3920
|
-
|
3921
|
-
|
3922
|
-
|
3938
|
+
const M = d.get(g.name);
|
3939
|
+
if (M !== void 0 && M.dispose(), d.delete(g.name), g.name === "UI")
|
3940
|
+
return;
|
3941
|
+
const P = new xi(g, v);
|
3942
|
+
switch (P.enableDamping = !0, P.dampingFactor = 0.05, g.name) {
|
3923
3943
|
case "Top":
|
3924
3944
|
case "Bottom":
|
3925
3945
|
case "Left":
|
3926
3946
|
case "Right":
|
3927
3947
|
case "Front":
|
3928
3948
|
case "Back":
|
3929
|
-
|
3949
|
+
P.enableRotate = !1;
|
3930
3950
|
break;
|
3931
3951
|
}
|
3932
|
-
|
3952
|
+
d.set(g.name, P);
|
3933
3953
|
}, Me = (g) => {
|
3934
|
-
const v =
|
3935
|
-
v !== void 0 && (m.remove(v), v.dispose(),
|
3936
|
-
const
|
3937
|
-
|
3938
|
-
},
|
3939
|
-
|
3954
|
+
const v = h.get(g.name);
|
3955
|
+
v !== void 0 && (m.remove(v), v.dispose(), h.delete(g.name));
|
3956
|
+
const M = d.get(g.name);
|
3957
|
+
M !== void 0 && (M.dispose(), d.delete(g.name));
|
3958
|
+
}, He = () => {
|
3959
|
+
d.forEach((g, v) => {
|
3940
3960
|
g.dispose();
|
3941
|
-
const
|
3942
|
-
|
3943
|
-
}),
|
3944
|
-
},
|
3945
|
-
switch (
|
3961
|
+
const M = h.get(v);
|
3962
|
+
M !== void 0 && (m.remove(M), M.dispose()), h.delete(v), d.delete(v);
|
3963
|
+
}), d.clear(), h.clear();
|
3964
|
+
}, Ye = () => {
|
3965
|
+
switch (N) {
|
3946
3966
|
case "Single":
|
3947
|
-
ae(
|
3967
|
+
ae(W, ce.current);
|
3948
3968
|
break;
|
3949
3969
|
case "Side by Side":
|
3950
3970
|
case "Stacked":
|
3951
|
-
ae(
|
3971
|
+
ae(W, ce.current), ae(oe, Te.current);
|
3952
3972
|
break;
|
3953
3973
|
case "Quad":
|
3954
|
-
ae(
|
3974
|
+
ae(W, ce.current), ae(oe, Te.current), ae(Ge, _e.current), ae(We, ve.current);
|
3955
3975
|
break;
|
3956
3976
|
}
|
3957
3977
|
};
|
3958
|
-
|
3959
|
-
const g = new
|
3960
|
-
canvas:
|
3978
|
+
Ae(() => {
|
3979
|
+
const g = new ba({
|
3980
|
+
canvas: z.current,
|
3961
3981
|
stencil: !1
|
3962
3982
|
});
|
3963
3983
|
g.autoClear = !1, g.shadowMap.enabled = !0, g.setPixelRatio(devicePixelRatio), g.setClearColor(0), e.three.renderer = g, we(g);
|
3964
|
-
}, []),
|
3965
|
-
m.name = "Debug Scene", m.uuid = "", x.name = "helpers", m.add(x), x.add(
|
3966
|
-
const g = new kt(60, 1, 50,
|
3967
|
-
g.name = "Debug", g.position.set(500, 500, 500), g.lookAt(0, 0, 0),
|
3968
|
-
}, []),
|
3984
|
+
}, []), Ae(() => {
|
3985
|
+
m.name = "Debug Scene", m.uuid = "", x.name = "helpers", m.add(x), x.add(T), H.name = "axisHelper", x.add(H), te.name = "interactionHelper", x.add(te), te.visible = !1, q("Top", new Y(0, 1e3, 0)), q("Bottom", new Y(0, -1e3, 0)), q("Left", new Y(-1e3, 0, 0)), q("Right", new Y(1e3, 0, 0)), q("Front", new Y(0, 0, 1e3)), q("Back", new Y(0, 0, -1e3)), q("Orthographic", new Y(1e3, 1e3, 1e3)), q("UI", new Y());
|
3986
|
+
const g = new kt(60, 1, 50, 5e3);
|
3987
|
+
g.name = "Debug", g.position.set(500, 500, 500), g.lookAt(0, 0, 0), o.set("Debug", g), W = o.get(localStorage.getItem(`${n}_tlCam`)), oe = o.get(localStorage.getItem(`${n}_trCam`)), Ge = o.get(localStorage.getItem(`${n}_blCam`)), We = o.get(localStorage.getItem(`${n}_brCam`));
|
3988
|
+
}, []), Ae(() => {
|
3969
3989
|
const g = () => {
|
3970
|
-
f.forEach((
|
3971
|
-
x.remove(
|
3990
|
+
f.forEach((C) => {
|
3991
|
+
x.remove(C), C.dispose();
|
3972
3992
|
}), f.clear();
|
3973
3993
|
}, v = () => {
|
3974
|
-
|
3975
|
-
if (
|
3994
|
+
je.traverse((C) => {
|
3995
|
+
if (C.type.search("Light") > -1) {
|
3976
3996
|
let E;
|
3977
|
-
switch (
|
3997
|
+
switch (C.type) {
|
3978
3998
|
case "DirectionalLight":
|
3979
|
-
E = new
|
3999
|
+
E = new wa(C, 100), E.name = `${C.name}Helper`, f.set(C.name, E), x.add(E);
|
3980
4000
|
break;
|
3981
4001
|
case "HemisphereLight":
|
3982
|
-
E = new
|
4002
|
+
E = new Sa(C, 250), E.name = `${C.name}Helper`, f.set(C.name, E), x.add(E);
|
3983
4003
|
break;
|
3984
4004
|
case "RectAreaLight":
|
3985
|
-
E = new
|
4005
|
+
E = new bi(C), E.name = `${C.name}Helper`, f.set(C.name, E), x.add(E);
|
3986
4006
|
break;
|
3987
4007
|
case "PointLight":
|
3988
|
-
E = new
|
4008
|
+
E = new Ca(C, 100), E.name = `${C.name}Helper`, f.set(C.name, E), x.add(E);
|
3989
4009
|
break;
|
3990
4010
|
case "SpotLight":
|
3991
|
-
E = new
|
4011
|
+
E = new Ea(C), E.name = `${C.name}Helper`, f.set(C.name, E), x.add(E);
|
3992
4012
|
break;
|
3993
4013
|
}
|
3994
4014
|
}
|
3995
4015
|
});
|
3996
|
-
},
|
3997
|
-
g(),
|
3998
|
-
const E = e.scenes.get(
|
4016
|
+
}, M = (C) => {
|
4017
|
+
g(), Ft(je), m.remove(je);
|
4018
|
+
const E = e.scenes.get(C.value.name);
|
3999
4019
|
if (E !== void 0) {
|
4000
|
-
const
|
4001
|
-
e.onSceneSet !== void 0 && e.onSceneSet(
|
4020
|
+
const F = new E();
|
4021
|
+
e.onSceneSet !== void 0 && e.onSceneSet(F), je = F, e.three.scene = je, m.add(je), dn = !0, v();
|
4002
4022
|
}
|
4003
|
-
},
|
4004
|
-
const E =
|
4005
|
-
if (
|
4006
|
-
const
|
4007
|
-
|
4023
|
+
}, P = (C) => {
|
4024
|
+
const E = C.value, F = e.three.scene?.getObjectByProperty("uuid", E.uuid);
|
4025
|
+
if (F !== void 0 && o.set(E.name, F), F instanceof kt) {
|
4026
|
+
const K = new xa(F);
|
4027
|
+
h.set(F.name, K), m.add(K);
|
4008
4028
|
}
|
4009
|
-
|
4010
|
-
}, ge = (
|
4011
|
-
const E =
|
4012
|
-
E !== void 0 && (m.remove(E), E.dispose()),
|
4029
|
+
Fe(Date.now());
|
4030
|
+
}, ge = (C) => {
|
4031
|
+
const E = h.get(C.value.name);
|
4032
|
+
E !== void 0 && (m.remove(E), E.dispose()), o.delete(C.value.name), Fe(Date.now());
|
4033
|
+
}, le = (C) => {
|
4034
|
+
const E = je.getObjectByProperty("uuid", C.value.uuid);
|
4035
|
+
E && E.add(H);
|
4013
4036
|
};
|
4014
|
-
return
|
4015
|
-
|
4037
|
+
return j.addEventListener(A.SET_SCENE, M), j.addEventListener(A.ADD_CAMERA, P), j.addEventListener(A.REMOVE_CAMERA, ge), j.addEventListener(A.SET_OBJECT, le), () => {
|
4038
|
+
j.removeEventListener(A.SET_SCENE, M), j.removeEventListener(A.ADD_CAMERA, P), j.removeEventListener(A.REMOVE_CAMERA, ge), j.removeEventListener(A.SET_OBJECT, le);
|
4016
4039
|
};
|
4017
|
-
}, []),
|
4018
|
-
if (
|
4040
|
+
}, []), Ae(() => {
|
4041
|
+
if (w === null)
|
4019
4042
|
return;
|
4020
|
-
let g = window.innerWidth, v = window.innerHeight,
|
4021
|
-
const
|
4022
|
-
g = window.innerWidth - 300, v = window.innerHeight,
|
4023
|
-
let
|
4024
|
-
switch (
|
4043
|
+
let g = window.innerWidth, v = window.innerHeight, M = Math.floor(g / 2), P = Math.floor(v / 2), ge = -1;
|
4044
|
+
const le = () => {
|
4045
|
+
g = window.innerWidth - 300, v = window.innerHeight, M = Math.floor(g / 2), P = Math.floor(v / 2), w.setSize(g, v);
|
4046
|
+
let O = g, B = v;
|
4047
|
+
switch (N) {
|
4025
4048
|
case "Side by Side":
|
4026
|
-
|
4049
|
+
O = M, B = v;
|
4027
4050
|
break;
|
4028
4051
|
case "Stacked":
|
4029
|
-
|
4052
|
+
O = g, B = P;
|
4030
4053
|
break;
|
4031
4054
|
case "Quad":
|
4032
|
-
|
4055
|
+
O = M, B = P;
|
4033
4056
|
break;
|
4034
4057
|
}
|
4035
|
-
|
4036
|
-
|
4058
|
+
o.forEach((G) => {
|
4059
|
+
G instanceof Jt ? (G.left = O / -2, G.right = O / 2, G.top = B / 2, G.bottom = B / -2, G.name === "UI" && (G.position.x = g / 2, G.position.y = v / -2, G.position.z = 100), G.updateProjectionMatrix()) : G instanceof kt && (G.aspect = O / B, G.updateProjectionMatrix(), h.get(G.name)?.update());
|
4037
4060
|
});
|
4061
|
+
}, C = () => {
|
4062
|
+
w.setViewport(0, 0, g, v), w.setScissor(0, 0, g, v), w.render(m, W);
|
4038
4063
|
}, E = () => {
|
4039
|
-
|
4040
|
-
|
4041
|
-
if (I === "Side by Side")
|
4042
|
-
S.setViewport(0, 0, w, v), S.setScissor(0, 0, w, v), S.render(m, z), S.setViewport(w, 0, w, v), S.setScissor(w, 0, w, v), S.render(m, ce);
|
4064
|
+
if (N === "Side by Side")
|
4065
|
+
w.setViewport(0, 0, M, v), w.setScissor(0, 0, M, v), w.render(m, W), w.setViewport(M, 0, M, v), w.setScissor(M, 0, M, v), w.render(m, oe);
|
4043
4066
|
else {
|
4044
|
-
const
|
4045
|
-
|
4067
|
+
const O = v - P;
|
4068
|
+
w.setViewport(0, O, g, P), w.setScissor(0, O, g, P), w.render(m, W), w.setViewport(0, 0, g, P), w.setScissor(0, 0, g, P), w.render(m, oe);
|
4046
4069
|
}
|
4047
|
-
},
|
4048
|
-
let
|
4049
|
-
B = v -
|
4050
|
-
},
|
4051
|
-
switch (
|
4052
|
-
|
4053
|
-
}),
|
4054
|
-
|
4055
|
-
}), f.forEach((
|
4056
|
-
|
4057
|
-
}), e.onSceneUpdate !== void 0 &&
|
4070
|
+
}, F = () => {
|
4071
|
+
let O = 0, B = 0;
|
4072
|
+
B = v - P, O = 0, w.setViewport(O, B, M, P), w.setScissor(O, B, M, P), w.render(m, W), O = M, w.setViewport(O, B, M, P), w.setScissor(O, B, M, P), w.render(m, oe), B = 0, O = 0, w.setViewport(O, B, M, P), w.setScissor(O, B, M, P), w.render(m, Ge), O = M, w.setViewport(O, B, M, P), w.setScissor(O, B, M, P), w.render(m, We);
|
4073
|
+
}, K = () => {
|
4074
|
+
switch (d.forEach((O) => {
|
4075
|
+
O.update();
|
4076
|
+
}), h.forEach((O) => {
|
4077
|
+
O.update();
|
4078
|
+
}), f.forEach((O) => {
|
4079
|
+
O.update !== void 0 && O.update();
|
4080
|
+
}), e.onSceneUpdate !== void 0 && dn && e.onSceneUpdate(je), w.clear(), N) {
|
4058
4081
|
case "Single":
|
4059
|
-
|
4082
|
+
C();
|
4060
4083
|
break;
|
4061
4084
|
case "Side by Side":
|
4062
4085
|
case "Stacked":
|
4063
|
-
|
4086
|
+
E();
|
4064
4087
|
break;
|
4065
4088
|
case "Quad":
|
4066
|
-
|
4089
|
+
F();
|
4067
4090
|
break;
|
4068
4091
|
}
|
4069
|
-
ge = requestAnimationFrame(
|
4092
|
+
ge = requestAnimationFrame(K);
|
4070
4093
|
};
|
4071
|
-
return
|
4072
|
-
window.removeEventListener("resize",
|
4094
|
+
return Ye(), window.addEventListener("resize", le), le(), K(), () => {
|
4095
|
+
window.removeEventListener("resize", le), cancelAnimationFrame(ge), ge = -1;
|
4073
4096
|
};
|
4074
|
-
}, [
|
4075
|
-
if (
|
4076
|
-
const g = new
|
4077
|
-
switch (
|
4097
|
+
}, [N, w]), Ae(() => {
|
4098
|
+
if (w !== null) {
|
4099
|
+
const g = new ya(), v = new fe(), M = (C, E, F, K) => {
|
4100
|
+
switch (N) {
|
4078
4101
|
case "Quad":
|
4079
|
-
|
4102
|
+
C < F ? E < K ? g.setFromCamera(v, W) : g.setFromCamera(v, Ge) : E < K ? g.setFromCamera(v, oe) : g.setFromCamera(v, We);
|
4080
4103
|
break;
|
4081
4104
|
case "Side by Side":
|
4082
|
-
|
4105
|
+
C < F ? g.setFromCamera(v, W) : g.setFromCamera(v, oe);
|
4083
4106
|
break;
|
4084
4107
|
case "Single":
|
4085
|
-
g.setFromCamera(v,
|
4108
|
+
g.setFromCamera(v, W);
|
4086
4109
|
break;
|
4087
4110
|
case "Stacked":
|
4088
|
-
|
4111
|
+
E < K ? g.setFromCamera(v, W) : g.setFromCamera(v, oe);
|
4089
4112
|
break;
|
4090
4113
|
}
|
4091
|
-
},
|
4114
|
+
}, P = (C) => {
|
4092
4115
|
if (!St)
|
4093
4116
|
return;
|
4094
|
-
const
|
4095
|
-
|
4096
|
-
const
|
4097
|
-
v.x = rt(
|
4098
|
-
const
|
4099
|
-
|
4100
|
-
},
|
4101
|
-
|
4117
|
+
const E = new fe();
|
4118
|
+
w.getSize(E);
|
4119
|
+
const F = Math.min(C.clientX, E.x), K = Math.min(C.clientY, E.y);
|
4120
|
+
v.x = rt(F, 0, E.x, -1, 1), v.y = rt(K, 0, E.y, 1, -1);
|
4121
|
+
const O = E.x / 2, B = E.y / 2, G = () => {
|
4122
|
+
F < O ? v.x = rt(F, 0, O, -1, 1) : v.x = rt(F, O, E.x, -1, 1);
|
4123
|
+
}, Ne = () => {
|
4124
|
+
K < B ? v.y = rt(K, 0, B, 1, -1) : v.y = rt(K, B, E.y, 1, -1);
|
4102
4125
|
};
|
4103
|
-
switch (
|
4126
|
+
switch (N) {
|
4104
4127
|
case "Quad":
|
4105
|
-
|
4128
|
+
G(), Ne();
|
4106
4129
|
break;
|
4107
4130
|
case "Side by Side":
|
4108
|
-
|
4131
|
+
G();
|
4109
4132
|
break;
|
4110
4133
|
case "Stacked":
|
4111
|
-
|
4134
|
+
Ne(), Ne();
|
4112
4135
|
break;
|
4113
4136
|
}
|
4114
|
-
|
4115
|
-
const
|
4116
|
-
|
4117
|
-
}, ge = (
|
4137
|
+
M(F, K, O, B);
|
4138
|
+
const Ke = g.intersectObjects(je.children);
|
4139
|
+
Ke.length > 0 && te.position.copy(Ke[0].point);
|
4140
|
+
}, ge = (C) => {
|
4118
4141
|
if (!St)
|
4119
4142
|
return;
|
4120
|
-
const
|
4121
|
-
if (
|
4143
|
+
const E = new fe();
|
4144
|
+
if (w.getSize(E), C.clientX >= E.x)
|
4122
4145
|
return;
|
4123
|
-
|
4124
|
-
const
|
4125
|
-
|
4126
|
-
},
|
4127
|
-
return
|
4128
|
-
|
4146
|
+
P(C);
|
4147
|
+
const F = g.intersectObjects(je.children);
|
4148
|
+
F.length > 0 && e.three.getObject(F[0].object.uuid);
|
4149
|
+
}, le = pe.current;
|
4150
|
+
return le.addEventListener("mousemove", P, !1), le.addEventListener("click", ge, !1), () => {
|
4151
|
+
le.removeEventListener("mousemove", P), le.removeEventListener("click", ge);
|
4129
4152
|
};
|
4130
4153
|
}
|
4131
|
-
}, [
|
4154
|
+
}, [N, w]);
|
4132
4155
|
const ue = [];
|
4133
|
-
return
|
4156
|
+
return o.forEach((g, v) => {
|
4134
4157
|
ue.push(v);
|
4135
4158
|
}), /* @__PURE__ */ l.jsxs("div", { className: "multiview", children: [
|
4136
|
-
/* @__PURE__ */ l.jsx("canvas", { ref:
|
4137
|
-
|
4138
|
-
/* @__PURE__ */ l.jsxs("div", { className: `cameras ${
|
4139
|
-
|
4140
|
-
|
4141
|
-
const v =
|
4142
|
-
v !== void 0 && (Me(
|
4159
|
+
/* @__PURE__ */ l.jsx("canvas", { ref: z }),
|
4160
|
+
w !== null && /* @__PURE__ */ l.jsxs(l.Fragment, { children: [
|
4161
|
+
/* @__PURE__ */ l.jsxs("div", { className: `cameras ${N === "Single" || N === "Stacked" ? "single" : ""}`, ref: pe, children: [
|
4162
|
+
N === "Single" && /* @__PURE__ */ l.jsx(l.Fragment, { children: /* @__PURE__ */ l.jsx(qe, { camera: W, options: ue, ref: ce, onSelect: (g) => {
|
4163
|
+
d.get(W.name)?.dispose();
|
4164
|
+
const v = o.get(g);
|
4165
|
+
v !== void 0 && (Me(W), W = v, localStorage.setItem(`${n}_tlCam`, v.name), ae(v, ce.current));
|
4143
4166
|
} }) }),
|
4144
|
-
(
|
4145
|
-
/* @__PURE__ */ l.jsx(qe, { camera:
|
4146
|
-
|
4147
|
-
const v =
|
4148
|
-
v !== void 0 && (Me(
|
4167
|
+
(N === "Side by Side" || N === "Stacked") && /* @__PURE__ */ l.jsxs(l.Fragment, { children: [
|
4168
|
+
/* @__PURE__ */ l.jsx(qe, { camera: W, options: ue, ref: ce, onSelect: (g) => {
|
4169
|
+
d.get(W.name)?.dispose();
|
4170
|
+
const v = o.get(g);
|
4171
|
+
v !== void 0 && (Me(W), W = v, localStorage.setItem(`${n}_tlCam`, v.name), ae(v, ce.current));
|
4149
4172
|
} }),
|
4150
|
-
/* @__PURE__ */ l.jsx(qe, { camera:
|
4151
|
-
|
4152
|
-
const v =
|
4153
|
-
v !== void 0 && (Me(
|
4173
|
+
/* @__PURE__ */ l.jsx(qe, { camera: oe, options: ue, ref: Te, onSelect: (g) => {
|
4174
|
+
d.get(oe.name)?.dispose();
|
4175
|
+
const v = o.get(g);
|
4176
|
+
v !== void 0 && (Me(oe), oe = v, localStorage.setItem(`${n}_trCam`, v.name), ae(v, Te.current));
|
4154
4177
|
} })
|
4155
4178
|
] }),
|
4156
|
-
|
4157
|
-
/* @__PURE__ */ l.jsx(qe, { camera:
|
4158
|
-
|
4159
|
-
const v =
|
4160
|
-
v !== void 0 && (Me(
|
4179
|
+
N === "Quad" && /* @__PURE__ */ l.jsxs(l.Fragment, { children: [
|
4180
|
+
/* @__PURE__ */ l.jsx(qe, { camera: W, options: ue, ref: ce, onSelect: (g) => {
|
4181
|
+
d.get(W.name)?.dispose();
|
4182
|
+
const v = o.get(g);
|
4183
|
+
v !== void 0 && (Me(W), W = v, localStorage.setItem(`${n}_tlCam`, v.name), ae(v, ce.current));
|
4161
4184
|
} }),
|
4162
|
-
/* @__PURE__ */ l.jsx(qe, { camera:
|
4163
|
-
|
4164
|
-
const v =
|
4165
|
-
v !== void 0 && (Me(
|
4185
|
+
/* @__PURE__ */ l.jsx(qe, { camera: oe, options: ue, ref: Te, onSelect: (g) => {
|
4186
|
+
d.get(oe.name)?.dispose();
|
4187
|
+
const v = o.get(g);
|
4188
|
+
v !== void 0 && (Me(oe), oe = v, localStorage.setItem(`${n}_trCam`, v.name), ae(v, Te.current));
|
4166
4189
|
} }),
|
4167
|
-
/* @__PURE__ */ l.jsx(qe, { camera:
|
4168
|
-
|
4169
|
-
const v =
|
4170
|
-
v !== void 0 && (Me(
|
4190
|
+
/* @__PURE__ */ l.jsx(qe, { camera: Ge, options: ue, ref: _e, onSelect: (g) => {
|
4191
|
+
d.get(Ge.name)?.dispose();
|
4192
|
+
const v = o.get(g);
|
4193
|
+
v !== void 0 && (Me(Ge), Ge = v, localStorage.setItem(`${n}_blCam`, v.name), ae(v, _e.current));
|
4171
4194
|
} }),
|
4172
|
-
/* @__PURE__ */ l.jsx(qe, { camera:
|
4173
|
-
|
4174
|
-
const v =
|
4175
|
-
v !== void 0 && (Me(
|
4195
|
+
/* @__PURE__ */ l.jsx(qe, { camera: We, options: ue, ref: ve, onSelect: (g) => {
|
4196
|
+
d.get(We.name)?.dispose();
|
4197
|
+
const v = o.get(g);
|
4198
|
+
v !== void 0 && (Me(We), We = v, localStorage.setItem(`${n}_brCam`, v.name), ae(v, ve.current));
|
4176
4199
|
} })
|
4177
4200
|
] })
|
4178
4201
|
] }),
|
@@ -4180,14 +4203,14 @@ function Ui(e) {
|
|
4180
4203
|
/* @__PURE__ */ l.jsx(
|
4181
4204
|
wt,
|
4182
4205
|
{
|
4183
|
-
index: Se.indexOf(
|
4206
|
+
index: Se.indexOf(N),
|
4184
4207
|
options: Se,
|
4185
4208
|
onSelect: (g) => {
|
4186
|
-
g !==
|
4209
|
+
g !== N && (He(), be(g));
|
4187
4210
|
},
|
4188
4211
|
open: Re,
|
4189
4212
|
onToggle: (g) => {
|
4190
|
-
|
4213
|
+
De(g), Pe && ke(!1), Ie && Be(!1);
|
4191
4214
|
}
|
4192
4215
|
}
|
4193
4216
|
),
|
@@ -4210,16 +4233,16 @@ function Ui(e) {
|
|
4210
4233
|
m.overrideMaterial = null;
|
4211
4234
|
break;
|
4212
4235
|
case "Wireframe":
|
4213
|
-
m.overrideMaterial =
|
4236
|
+
m.overrideMaterial = I;
|
4214
4237
|
break;
|
4215
4238
|
case "UVs":
|
4216
4239
|
m.overrideMaterial = $;
|
4217
4240
|
break;
|
4218
4241
|
}
|
4219
4242
|
},
|
4220
|
-
open:
|
4243
|
+
open: Pe,
|
4221
4244
|
onToggle: (g) => {
|
4222
|
-
Re &&
|
4245
|
+
Re && De(!1), ke(g), Ie && Be(!1);
|
4223
4246
|
}
|
4224
4247
|
}
|
4225
4248
|
),
|
@@ -4234,9 +4257,9 @@ function Ui(e) {
|
|
4234
4257
|
onSelect: (g) => {
|
4235
4258
|
St = g === "Selection Mode", te.visible = St;
|
4236
4259
|
},
|
4237
|
-
open:
|
4260
|
+
open: Ie,
|
4238
4261
|
onToggle: (g) => {
|
4239
|
-
Re &&
|
4262
|
+
Re && De(!1), Pe && ke(!1), Be(g);
|
4240
4263
|
}
|
4241
4264
|
}
|
4242
4265
|
)
|
@@ -4244,7 +4267,7 @@ function Ui(e) {
|
|
4244
4267
|
] })
|
4245
4268
|
] });
|
4246
4269
|
}
|
4247
|
-
function
|
4270
|
+
function zi(e) {
|
4248
4271
|
return /* @__PURE__ */ l.jsxs("div", { className: "editor", ref: e.ref, style: e.style, children: [
|
4249
4272
|
/* @__PURE__ */ l.jsx("div", { className: "header", children: e.header }),
|
4250
4273
|
e.children,
|
@@ -4252,44 +4275,44 @@ function $i(e) {
|
|
4252
4275
|
] });
|
4253
4276
|
}
|
4254
4277
|
export {
|
4255
|
-
|
4256
|
-
|
4278
|
+
$t as Accordion,
|
4279
|
+
Ai as Application,
|
4257
4280
|
Ot as BaseRemote,
|
4258
|
-
|
4281
|
+
Fn as ChildObject,
|
4259
4282
|
Ya as ContainerObject,
|
4260
|
-
|
4261
|
-
|
4262
|
-
|
4283
|
+
Ga as Draggable,
|
4284
|
+
za as DraggableItem,
|
4285
|
+
Wa as Dropdown,
|
4263
4286
|
Ha as DropdownItem,
|
4264
|
-
|
4265
|
-
|
4266
|
-
|
4267
|
-
|
4268
|
-
|
4269
|
-
|
4270
|
-
|
4271
|
-
|
4272
|
-
|
4273
|
-
|
4287
|
+
zi as Editor,
|
4288
|
+
vi as Inspector,
|
4289
|
+
$i as MultiView,
|
4290
|
+
Bn as NavButton,
|
4291
|
+
Di as RemoteComponents,
|
4292
|
+
Bi as RemoteController,
|
4293
|
+
Ut as RemoteTheatre,
|
4294
|
+
Ni as RemoteThree,
|
4295
|
+
Li as RemoteTweakpane,
|
4296
|
+
Ui as SceneInspector,
|
4274
4297
|
Fi as SidePanel,
|
4275
|
-
|
4298
|
+
A as ToolEvents,
|
4276
4299
|
Mt as capitalize,
|
4277
|
-
|
4278
|
-
|
4279
|
-
|
4280
|
-
|
4281
|
-
|
4282
|
-
|
4283
|
-
|
4284
|
-
|
4285
|
-
|
4286
|
-
|
4287
|
-
|
4288
|
-
|
4289
|
-
|
4300
|
+
Ze as clamp,
|
4301
|
+
Pa as colorToHex,
|
4302
|
+
j as debugDispatcher,
|
4303
|
+
Pi as defaultTheatreCallback,
|
4304
|
+
Ft as dispose,
|
4305
|
+
ja as disposeMaterial,
|
4306
|
+
ji as disposeTexture,
|
4307
|
+
ki as distance,
|
4308
|
+
In as hierarchyUUID,
|
4309
|
+
Ra as isColor,
|
4310
|
+
Qt as mix,
|
4311
|
+
Bt as noop,
|
4312
|
+
Kt as normalize,
|
4290
4313
|
_a as randomID,
|
4291
|
-
|
4292
|
-
|
4293
|
-
|
4314
|
+
ka as resetThreeObjects,
|
4315
|
+
en as round,
|
4316
|
+
Ii as theatreEditorApp,
|
4294
4317
|
Dt as totalThreeObjects
|
4295
4318
|
};
|