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