soonspacejs 3.0.0-alpha.5 → 3.0.0-alpha.6
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/index.esm.js +1073 -1064
- package/package.json +1 -1
package/dist/index.esm.js
CHANGED
|
@@ -26,7 +26,7 @@ import * as fi from "three/examples/jsm/utils/SkeletonUtils.js";
|
|
|
26
26
|
import * as Sl from "three/examples/jsm/libs/fflate.module.js";
|
|
27
27
|
import { NURBSCurve as Tl } from "three/examples/jsm/curves/NURBSCurve.js";
|
|
28
28
|
import { RectAreaLightHelper as Cl } from "three/examples/jsm/helpers/RectAreaLightHelper.js";
|
|
29
|
-
const Dl = "soonspacejs", Il = "3.0.0-alpha.
|
|
29
|
+
const Dl = "soonspacejs", Il = "3.0.0-alpha.6", mi = {
|
|
30
30
|
name: Dl,
|
|
31
31
|
version: Il
|
|
32
32
|
}, ha = "[soonspacejs]: ";
|
|
@@ -892,12 +892,12 @@ function Ia(a) {
|
|
|
892
892
|
h = l * c + s;
|
|
893
893
|
let m = !1;
|
|
894
894
|
h > 1 ? (h = 1, m = !0) : h < 0 && (h = 0, m = !0), p = e.getPointAt(h), f = p.distanceTo(o), u = Math.abs(t - f) > n;
|
|
895
|
-
const
|
|
896
|
-
if (m && u &&
|
|
895
|
+
const g = t / f;
|
|
896
|
+
if (m && u && g > 1) {
|
|
897
897
|
d = !1;
|
|
898
898
|
break;
|
|
899
899
|
}
|
|
900
|
-
c *=
|
|
900
|
+
c *= g;
|
|
901
901
|
} while (u);
|
|
902
902
|
return {
|
|
903
903
|
succeed: d,
|
|
@@ -981,15 +981,15 @@ function vh(a) {
|
|
|
981
981
|
h.applyMatrix4(u);
|
|
982
982
|
const f = [], d = [];
|
|
983
983
|
for (let m = 0; m < p; m++) {
|
|
984
|
-
const
|
|
985
|
-
if (
|
|
984
|
+
const g = h.getX(m);
|
|
985
|
+
if (g < 0) {
|
|
986
986
|
f.push(0, 0, 0, 0), d.push(1, 0, 0, 0);
|
|
987
987
|
continue;
|
|
988
988
|
}
|
|
989
|
-
const
|
|
990
|
-
if (
|
|
991
|
-
const
|
|
992
|
-
f.push(
|
|
989
|
+
const v = Math.trunc(g / o);
|
|
990
|
+
if (v < c) {
|
|
991
|
+
const x = g % o / o * t;
|
|
992
|
+
f.push(v, v + 1, 0, 0), d.push(1 - x, x, 0, 0);
|
|
993
993
|
continue;
|
|
994
994
|
}
|
|
995
995
|
f.push(c, 0, 0, 0), d.push(1, 0, 0, 0);
|
|
@@ -1017,8 +1017,8 @@ function Oa(a) {
|
|
|
1017
1017
|
}), o = Gn(i), c = t.getAttribute("position"), l = c.count, u = [], h = [], p = new I();
|
|
1018
1018
|
for (let f = 0; f < l; f++) {
|
|
1019
1019
|
p.fromBufferAttribute(c, f);
|
|
1020
|
-
const { index: d, clampT: m } = dh(p, o),
|
|
1021
|
-
u.push(d, d + 1, 0, 0), h.push(1 -
|
|
1020
|
+
const { index: d, clampT: m } = dh(p, o), g = m * s;
|
|
1021
|
+
u.push(d, d + 1, 0, 0), h.push(1 - g, g, 0, 0);
|
|
1022
1022
|
}
|
|
1023
1023
|
return t.setAttribute("skinIndex", new ys(u, 4)), t.setAttribute("skinWeight", new me(h, 4)), t;
|
|
1024
1024
|
}
|
|
@@ -1083,16 +1083,16 @@ function ka(a) {
|
|
|
1083
1083
|
const { curve: e, lookDistance: t } = a, s = a.targetPath ?? "", r = Un(a).division, n = Ir(a, e.getLength()), i = br, o = [], c = Wn(r), l = { ...a, duration: n, division: r, ts: c, lookPoint: { distance: t } }, u = qn(l), { points: h, rotates: p, ...f } = Hn(l);
|
|
1084
1084
|
if (h.length) {
|
|
1085
1085
|
const d = [];
|
|
1086
|
-
h.forEach((
|
|
1087
|
-
|
|
1086
|
+
h.forEach((g, v) => {
|
|
1087
|
+
g.toArray(d, v * 3);
|
|
1088
1088
|
});
|
|
1089
1089
|
const m = new Et(`${s}.position`, u, d, i);
|
|
1090
1090
|
o.push(m);
|
|
1091
1091
|
}
|
|
1092
1092
|
if (p.length) {
|
|
1093
1093
|
const d = [];
|
|
1094
|
-
p.forEach((
|
|
1095
|
-
|
|
1094
|
+
p.forEach((g, v) => {
|
|
1095
|
+
g.toArray(d, v * 4);
|
|
1096
1096
|
});
|
|
1097
1097
|
const m = new Pt(`${s}.quaternion`, u, d, i);
|
|
1098
1098
|
o.push(m);
|
|
@@ -1119,26 +1119,26 @@ function Hn(a) {
|
|
|
1119
1119
|
const f = (a.anchor ?? fr).clone(), d = a.ts ?? a.us, m = !a.ts;
|
|
1120
1120
|
if (!d)
|
|
1121
1121
|
throw "缺少参数:至少传递 ts 和 us 任意之一";
|
|
1122
|
-
let
|
|
1123
|
-
r && (r.updateWorldMatrix(!0, !1),
|
|
1124
|
-
const A =
|
|
1122
|
+
let g = qs.clone(), v = qs.clone(), x = Ea.clone(), b = De.DEFAULT_UP;
|
|
1123
|
+
r && (r.updateWorldMatrix(!0, !1), g = r.matrix, v = r.matrixWorld, x = r.scale, b = r.up);
|
|
1124
|
+
const A = g.clone().invert(), D = v.clone().multiply(A).clone().invert(), E = s.getTangent(0);
|
|
1125
1125
|
E.transformDirection(D);
|
|
1126
|
-
const
|
|
1127
|
-
let U =
|
|
1126
|
+
const O = ((e = a.front) == null ? void 0 : e.clone().normalize()) ?? E, k = ((t = a.up) == null ? void 0 : t.clone().normalize()) ?? b.clone().transformDirection(D);
|
|
1127
|
+
let U = g.clone().setPosition(0, 0, 0), q = (H) => s.getPoint(H), J = (H) => s.getTangent(H);
|
|
1128
1128
|
m && (q = (H) => s.getPointAt(H), J = (H) => s.getTangentAt(H));
|
|
1129
1129
|
const $ = d.length, F = $ - 1;
|
|
1130
1130
|
let { distance: P, curveLength: Q, lengths: R } = n ?? {};
|
|
1131
1131
|
P = P ?? 0;
|
|
1132
|
-
let
|
|
1133
|
-
P !== 0 && (R || (R = lh(s, d, m).lengths), Q == null && (Q = R[F]),
|
|
1132
|
+
let L = J;
|
|
1133
|
+
P !== 0 && (R || (R = lh(s, d, m).lengths), Q == null && (Q = R[F]), L = (H, _) => {
|
|
1134
1134
|
const G = q(H);
|
|
1135
1135
|
let Y = (R[_] + P) / Q;
|
|
1136
1136
|
return Y > 1 && (Y = 1), s.getPointAt(Y).sub(G).normalize();
|
|
1137
1137
|
});
|
|
1138
1138
|
let K = (H) => {
|
|
1139
|
-
const _ = d[H], G =
|
|
1139
|
+
const _ = d[H], G = L(_, H);
|
|
1140
1140
|
G.transformDirection(D), p.push(G);
|
|
1141
|
-
const Y = H - 1, te = Y < 0, Z = te ?
|
|
1141
|
+
const Y = H - 1, te = Y < 0, Z = te ? O : p[Y], ne = new he().setFromUnitVectors(Z, G);
|
|
1142
1142
|
if (!te) {
|
|
1143
1143
|
const ge = u[Y];
|
|
1144
1144
|
ne.multiply(ge);
|
|
@@ -1148,22 +1148,22 @@ function Hn(a) {
|
|
|
1148
1148
|
if (i) {
|
|
1149
1149
|
const H = new I(0, 1, 0);
|
|
1150
1150
|
K = o ? function(_) {
|
|
1151
|
-
const G = d[_], Y =
|
|
1151
|
+
const G = d[_], Y = L(G, _);
|
|
1152
1152
|
Y.transformDirection(D), p.push(Y);
|
|
1153
1153
|
const te = _ - 1, Z = te < 0;
|
|
1154
1154
|
let ne;
|
|
1155
1155
|
if (Z)
|
|
1156
|
-
ne = new he().setFromUnitVectors(
|
|
1156
|
+
ne = new he().setFromUnitVectors(O, Y);
|
|
1157
1157
|
else {
|
|
1158
|
-
const se = u[te], Se =
|
|
1158
|
+
const se = u[te], Se = O.clone().applyQuaternion(se).normalize();
|
|
1159
1159
|
ne = new he().setFromUnitVectors(Se, Y), ne.multiply(se);
|
|
1160
1160
|
}
|
|
1161
1161
|
const ge = k.clone().applyQuaternion(ne).normalize(), ie = new he().setFromUnitVectors(ge, H);
|
|
1162
1162
|
return ne.premultiply(ie), ne.normalize();
|
|
1163
1163
|
} : function(_) {
|
|
1164
|
-
const G = d[_], Y =
|
|
1164
|
+
const G = d[_], Y = L(G, _);
|
|
1165
1165
|
Y.transformDirection(D), p.push(Y);
|
|
1166
|
-
const te = _ - 1, Z = te < 0, ne = Z ?
|
|
1166
|
+
const te = _ - 1, Z = te < 0, ne = Z ? O : p[te], ge = new he().setFromUnitVectors(ne, Y);
|
|
1167
1167
|
if (Z) {
|
|
1168
1168
|
const ie = k.clone().applyQuaternion(ge);
|
|
1169
1169
|
ie.projectOnPlane(Y).normalize();
|
|
@@ -1180,7 +1180,7 @@ function Hn(a) {
|
|
|
1180
1180
|
const _ = d[H];
|
|
1181
1181
|
if (l) {
|
|
1182
1182
|
const G = K(H);
|
|
1183
|
-
u.push(G), U = new X().compose(fr, G,
|
|
1183
|
+
u.push(G), U = new X().compose(fr, G, x);
|
|
1184
1184
|
}
|
|
1185
1185
|
if (c) {
|
|
1186
1186
|
const G = q(_);
|
|
@@ -1216,16 +1216,16 @@ function Sh(a) {
|
|
|
1216
1216
|
const e = a.targetPath ?? "", t = a.points, { lines: s, length: r, lengths: n } = uh(t), i = Ir(a, r), o = [], c = n.map((f) => f / r * i), { points: l, pointTimes: u, rotates: h, rotateTimes: p } = Th({ ...a, times: c }, s);
|
|
1217
1217
|
if (l.length) {
|
|
1218
1218
|
const f = [];
|
|
1219
|
-
l.forEach((m,
|
|
1220
|
-
m.toArray(f,
|
|
1219
|
+
l.forEach((m, g) => {
|
|
1220
|
+
m.toArray(f, g * 3);
|
|
1221
1221
|
});
|
|
1222
1222
|
const d = new Et(`${e}.position`, u, f, br);
|
|
1223
1223
|
o.push(d);
|
|
1224
1224
|
}
|
|
1225
1225
|
if (h.length) {
|
|
1226
1226
|
const f = [];
|
|
1227
|
-
h.forEach((m,
|
|
1228
|
-
m.toArray(f,
|
|
1227
|
+
h.forEach((m, g) => {
|
|
1228
|
+
m.toArray(f, g * 4);
|
|
1229
1229
|
});
|
|
1230
1230
|
const d = new Pt(`${e}.quaternion`, p, f, tc);
|
|
1231
1231
|
o.push(d);
|
|
@@ -1236,19 +1236,19 @@ function Th(a, e) {
|
|
|
1236
1236
|
var t, s;
|
|
1237
1237
|
const { points: r, target: n, times: i, enableUp: o, fixUp: c } = a, l = a.position ?? !0, u = a.rotate ?? !0, h = r.length, p = h - 1;
|
|
1238
1238
|
e = e ?? Gn(r);
|
|
1239
|
-
const f = [], d = i, m = [],
|
|
1239
|
+
const f = [], d = i, m = [], g = [], v = [], x = { rotates: f, points: m, rotateTimes: d, pointTimes: g };
|
|
1240
1240
|
if (!(l || u))
|
|
1241
|
-
return
|
|
1242
|
-
const
|
|
1243
|
-
let A = qs.clone(), D = qs.clone(), E = Ea.clone(),
|
|
1244
|
-
n && (n.updateWorldMatrix(!0, !1), A = n.matrix, D = n.matrixWorld, E = n.scale,
|
|
1241
|
+
return x;
|
|
1242
|
+
const b = (a.anchor ?? fr).clone();
|
|
1243
|
+
let A = qs.clone(), D = qs.clone(), E = Ea.clone(), O = De.DEFAULT_UP;
|
|
1244
|
+
n && (n.updateWorldMatrix(!0, !1), A = n.matrix, D = n.matrixWorld, E = n.scale, O = n.up);
|
|
1245
1245
|
const k = A.clone().invert(), U = D.clone().multiply(k).clone().invert(), q = e[0].delta(new I());
|
|
1246
1246
|
q.transformDirection(U);
|
|
1247
|
-
const J = ((t = a.front) == null ? void 0 : t.clone().normalize()) ?? q, $ = ((s = a.up) == null ? void 0 : s.clone().normalize()) ??
|
|
1247
|
+
const J = ((t = a.front) == null ? void 0 : t.clone().normalize()) ?? q, $ = ((s = a.up) == null ? void 0 : s.clone().normalize()) ?? O.clone().transformDirection(U);
|
|
1248
1248
|
let F = A.clone().setPosition(0, 0, 0), P = F, Q = (R) => {
|
|
1249
|
-
const
|
|
1250
|
-
|
|
1251
|
-
const K = R - 1, H = K < 0, _ = H ? J :
|
|
1249
|
+
const L = e[R].delta(new I()).normalize();
|
|
1250
|
+
L.transformDirection(U), v.push(L);
|
|
1251
|
+
const K = R - 1, H = K < 0, _ = H ? J : v[K], G = new he().setFromUnitVectors(_, L);
|
|
1252
1252
|
if (!H) {
|
|
1253
1253
|
const Y = f[K];
|
|
1254
1254
|
G.multiply(Y);
|
|
@@ -1257,10 +1257,10 @@ function Th(a, e) {
|
|
|
1257
1257
|
};
|
|
1258
1258
|
if (o) {
|
|
1259
1259
|
const R = new I(0, 1, 0);
|
|
1260
|
-
Q = c ? function(
|
|
1261
|
-
const K = e[
|
|
1262
|
-
K.transformDirection(U),
|
|
1263
|
-
const H =
|
|
1260
|
+
Q = c ? function(L) {
|
|
1261
|
+
const K = e[L].delta(new I()).normalize();
|
|
1262
|
+
K.transformDirection(U), v.push(K);
|
|
1263
|
+
const H = L - 1, _ = H < 0;
|
|
1264
1264
|
let G;
|
|
1265
1265
|
if (_)
|
|
1266
1266
|
G = new he().setFromUnitVectors(J, K);
|
|
@@ -1270,10 +1270,10 @@ function Th(a, e) {
|
|
|
1270
1270
|
}
|
|
1271
1271
|
const Y = $.clone().applyQuaternion(G).normalize(), te = new he().setFromUnitVectors(Y, R);
|
|
1272
1272
|
return G.premultiply(te), G.normalize();
|
|
1273
|
-
} : function(
|
|
1274
|
-
const K = e[
|
|
1275
|
-
K.transformDirection(U),
|
|
1276
|
-
const H =
|
|
1273
|
+
} : function(L) {
|
|
1274
|
+
const K = e[L].delta(new I()).normalize();
|
|
1275
|
+
K.transformDirection(U), v.push(K);
|
|
1276
|
+
const H = L - 1, _ = H < 0, G = _ ? J : v[H], Y = new he().setFromUnitVectors(G, K);
|
|
1277
1277
|
if (_) {
|
|
1278
1278
|
const te = $.clone().applyQuaternion(Y);
|
|
1279
1279
|
te.projectOnPlane(K).normalize();
|
|
@@ -1289,22 +1289,22 @@ function Th(a, e) {
|
|
|
1289
1289
|
for (let R = 0; R < h; R++) {
|
|
1290
1290
|
if (u)
|
|
1291
1291
|
if (R < p) {
|
|
1292
|
-
const
|
|
1293
|
-
f.push(
|
|
1292
|
+
const L = Q(R);
|
|
1293
|
+
f.push(L), F = new X().compose(fr, L, E);
|
|
1294
1294
|
} else
|
|
1295
1295
|
f.push(f[R - 1].clone());
|
|
1296
1296
|
if (l) {
|
|
1297
|
-
const
|
|
1297
|
+
const L = i[R], K = r[R].clone();
|
|
1298
1298
|
if (K.applyMatrix4(U), R > 0) {
|
|
1299
|
-
const _ =
|
|
1300
|
-
m.push(G),
|
|
1299
|
+
const _ = b.clone().applyMatrix4(P), G = K.clone().sub(_);
|
|
1300
|
+
m.push(G), g.push(L);
|
|
1301
1301
|
}
|
|
1302
|
-
const H =
|
|
1303
|
-
K.sub(H), m.push(K),
|
|
1302
|
+
const H = b.clone().applyMatrix4(F);
|
|
1303
|
+
K.sub(H), m.push(K), g.push(L);
|
|
1304
1304
|
}
|
|
1305
1305
|
P = F;
|
|
1306
1306
|
}
|
|
1307
|
-
return
|
|
1307
|
+
return x;
|
|
1308
1308
|
}
|
|
1309
1309
|
function Ch(a) {
|
|
1310
1310
|
const e = a.mixer, t = Ba(a), { model: s, skeleton: r } = t, n = { ...a, target: s, skeleton: r }, { clip: i, ...o } = a.posOnBone ? za(n) : Ah(n);
|
|
@@ -1318,16 +1318,16 @@ function za(a) {
|
|
|
1318
1318
|
}
|
|
1319
1319
|
function Dh(a) {
|
|
1320
1320
|
const { skeleton: e, targetPath: t } = a, s = e.bones, { times: r, boneSampleDatas: n, duration: i, ...o } = Ih(a), c = r.length, l = br, u = n.map((h, p) => {
|
|
1321
|
-
const { points: f, rotates: d } = h, m = s[p],
|
|
1321
|
+
const { points: f, rotates: d } = h, m = s[p], g = t ? `${t}.skeleton.bones[${p}]` : `${m.name || m.uuid}`, v = [], x = [];
|
|
1322
1322
|
for (let D = 0; D < c; D++)
|
|
1323
|
-
f && f[D].toArray(
|
|
1324
|
-
const
|
|
1323
|
+
f && f[D].toArray(v, D * 3), d[D].toArray(x, D * 4);
|
|
1324
|
+
const b = [];
|
|
1325
1325
|
if (f) {
|
|
1326
|
-
const D = new Et(`${
|
|
1327
|
-
|
|
1326
|
+
const D = new Et(`${g}.position`, r, v, l);
|
|
1327
|
+
b.push(D);
|
|
1328
1328
|
}
|
|
1329
|
-
const A = new Pt(`${
|
|
1330
|
-
return
|
|
1329
|
+
const A = new Pt(`${g}.quaternion`, r, x, l);
|
|
1330
|
+
return b.push(A), b;
|
|
1331
1331
|
});
|
|
1332
1332
|
return { ...o, boneTracks: u, duration: i };
|
|
1333
1333
|
}
|
|
@@ -1345,24 +1345,24 @@ function Ih(a) {
|
|
|
1345
1345
|
const Z = G.clone().multiply(te);
|
|
1346
1346
|
return m.push(Z), Y;
|
|
1347
1347
|
}, f);
|
|
1348
|
-
const
|
|
1349
|
-
|
|
1350
|
-
const A = Ir(a, h), D = Wn(u), E = qn({ curve: t, division: u, duration: A }),
|
|
1351
|
-
for (let G = 0; G <
|
|
1348
|
+
const g = m[0], v = new I(), x = new he(), b = new I();
|
|
1349
|
+
g.decompose(v, x, b);
|
|
1350
|
+
const A = Ir(a, h), D = Wn(u), E = qn({ curve: t, division: u, duration: A }), O = D.length, k = [], U = new I().setFromMatrixPosition(m[1]).negate(), q = i[0], J = (e = a.up) == null ? void 0 : e.clone().applyMatrix4(p).transformDirection(q), { points: $, rotates: F, ...P } = Hn({ ...a, curve: t, ts: D, target: o, rotate: !0, front: U, up: J, anchor: null });
|
|
1351
|
+
for (let G = 0; G < O; G++)
|
|
1352
1352
|
k.push(p.clone());
|
|
1353
1353
|
const Q = $.map((G, Y) => {
|
|
1354
1354
|
const te = F[Y];
|
|
1355
|
-
te.premultiply(
|
|
1356
|
-
const Z = new X().compose(G, te,
|
|
1355
|
+
te.premultiply(x).normalize();
|
|
1356
|
+
const Z = new X().compose(G, te, b);
|
|
1357
1357
|
return Z.premultiply(p), Z;
|
|
1358
|
-
}), R = t.getLengths(u).map((G) => G / h),
|
|
1359
|
-
const Z =
|
|
1358
|
+
}), R = t.getLengths(u).map((G) => G / h), L = [{ points: $, rotates: F, us: R, matrixs: Q }], K = r ? function(G, Y, te) {
|
|
1359
|
+
const Z = L[G].us[Y] - te / h;
|
|
1360
1360
|
return {
|
|
1361
1361
|
u: Z,
|
|
1362
1362
|
point: Z < 0 ? null : t.getPointAt(Z)
|
|
1363
1363
|
};
|
|
1364
1364
|
} : function(G, Y, te) {
|
|
1365
|
-
const Z =
|
|
1365
|
+
const Z = L[G].us[Y], { u: ne, point: ge, succeed: ie } = Ia({
|
|
1366
1366
|
curve: t,
|
|
1367
1367
|
distance: te,
|
|
1368
1368
|
fromU: Z,
|
|
@@ -1374,11 +1374,11 @@ function Ih(a) {
|
|
|
1374
1374
|
}, H = i.length, _ = H - 1;
|
|
1375
1375
|
for (let G = 1; G < H; G++) {
|
|
1376
1376
|
const Y = [], te = [], Z = [], ne = [];
|
|
1377
|
-
|
|
1378
|
-
const ge = m[G], ie = d[G], se = G - 1, Se =
|
|
1377
|
+
L.push({ points: Y, rotates: te, us: Z, matrixs: ne });
|
|
1378
|
+
const ge = m[G], ie = d[G], se = G - 1, Se = L[se], Ht = m[se], St = d[se], { matrixs: Cs, points: Ds, rotates: Is } = Se, Ge = new I().setFromMatrixScale(Ht), Wt = se - 1, ns = Wt < 0 ? k : L[Wt].matrixs, Ve = new I(), tt = new he(), st = new I();
|
|
1379
1379
|
ge.decompose(Ve, tt, st);
|
|
1380
1380
|
const Ot = new I().setFromMatrixPosition(ie).sub(new I().setFromMatrixPosition(St)).length(), is = Ve.length();
|
|
1381
|
-
for (let Pe = 0; Pe <
|
|
1381
|
+
for (let Pe = 0; Pe < O; Pe++) {
|
|
1382
1382
|
const { point: Oe, u: ot } = K(se, Pe, Ot);
|
|
1383
1383
|
Z.push(ot), te.push(tt.clone());
|
|
1384
1384
|
const ct = Cs[Pe];
|
|
@@ -1408,7 +1408,7 @@ function Ih(a) {
|
|
|
1408
1408
|
Tt.premultiply(ct), ne.push(Tt);
|
|
1409
1409
|
}
|
|
1410
1410
|
}
|
|
1411
|
-
return { ...P, times: E, boneSampleDatas:
|
|
1411
|
+
return { ...P, times: E, boneSampleDatas: L, duration: A };
|
|
1412
1412
|
}
|
|
1413
1413
|
function Ah(a) {
|
|
1414
1414
|
const { boneTracks: e, targetTracks: t, duration: s, ...r } = Eh(a), n = t.concat(e.flat()), i = new xt(a.name, s, n);
|
|
@@ -1418,10 +1418,10 @@ function Eh(a) {
|
|
|
1418
1418
|
const { skeleton: e, targetPath: t } = a, { times: s, boneSampleDatas: r, duration: n, targetSampleDatas: i, ...o } = Ph(a), c = s.length, l = e.bones, u = br, h = [], p = [], { points: f, rotates: d } = i;
|
|
1419
1419
|
for (let A = 0; A < c; A++)
|
|
1420
1420
|
f[A].toArray(h, A * 3), d[A].toArray(p, A * 4);
|
|
1421
|
-
const m = t ?? "",
|
|
1422
|
-
const { points: E, rotates:
|
|
1421
|
+
const m = t ?? "", g = new Et(`${m}.position`, s, h, u), v = new Pt(`${m}.quaternion`, s, p, u), x = [g, v], b = r.map((A, D) => {
|
|
1422
|
+
const { points: E, rotates: O } = A, k = l[D], U = t ? `${t}.skeleton.bones[${D}]` : `${k.name || k.uuid}`, q = [], J = [];
|
|
1423
1423
|
for (let P = 0; P < c; P++)
|
|
1424
|
-
E && E[P].toArray(q, P * 3),
|
|
1424
|
+
E && E[P].toArray(q, P * 3), O[P].toArray(J, P * 4);
|
|
1425
1425
|
const $ = [];
|
|
1426
1426
|
if (E) {
|
|
1427
1427
|
const P = new Et(`${U}.position`, s, q, u);
|
|
@@ -1430,7 +1430,7 @@ function Eh(a) {
|
|
|
1430
1430
|
const F = new Pt(`${U}.quaternion`, s, J, u);
|
|
1431
1431
|
return $.push(F), $;
|
|
1432
1432
|
});
|
|
1433
|
-
return { ...o, boneTracks:
|
|
1433
|
+
return { ...o, boneTracks: b, targetTracks: x, duration: n };
|
|
1434
1434
|
}
|
|
1435
1435
|
function Ph(a) {
|
|
1436
1436
|
const { curve: e, skeleton: t, stretch: s } = a, { bones: r, boneInverses: n } = t, i = r[0], o = a.target ?? i.parent;
|
|
@@ -1438,19 +1438,19 @@ function Ph(a) {
|
|
|
1438
1438
|
throw "target 或 根骨骼的 parent 不存在";
|
|
1439
1439
|
const c = a.tolerance ?? 0.1;
|
|
1440
1440
|
i.updateWorldMatrix(!0, !0);
|
|
1441
|
-
const { division: l, length: u } = Un(a), { matrix: h, matrixWorld: p, scale: f } = o, d = p.clone().multiply(h.clone().invert()), m = p.clone().invert(),
|
|
1441
|
+
const { division: l, length: u } = Un(a), { matrix: h, matrixWorld: p, scale: f } = o, d = p.clone().multiply(h.clone().invert()), m = p.clone().invert(), g = [], v = [];
|
|
1442
1442
|
n.reduce((Z, ne) => {
|
|
1443
1443
|
const ge = ne.clone().invert();
|
|
1444
|
-
|
|
1444
|
+
g.push(ge);
|
|
1445
1445
|
const ie = Z.clone().multiply(ge);
|
|
1446
|
-
return
|
|
1446
|
+
return v.push(ie), ne;
|
|
1447
1447
|
}, m);
|
|
1448
|
-
const
|
|
1449
|
-
|
|
1450
|
-
const E = Ir(a, u),
|
|
1448
|
+
const x = v[0], b = new I(), A = new he(), D = new I();
|
|
1449
|
+
x.decompose(b, A, D);
|
|
1450
|
+
const E = Ir(a, u), O = Wn(l), k = g[0], U = new I().setFromMatrixPosition(v[1]).negate().transformDirection(k).transformDirection(m), { rotates: q, points: J, ...$ } = Hn({ ...a, curve: e, target: o, position: !0, rotate: !0, anchor: b, front: U, ts: O }), F = qn({ curve: e, division: l, duration: E }), P = J.map((Z, ne) => {
|
|
1451
1451
|
const ge = q[ne], ie = new X().compose(Z, ge, f);
|
|
1452
1452
|
return ie.premultiply(d), ie;
|
|
1453
|
-
}), Q = { points: J, rotates: q, matrixs: P }, R = [],
|
|
1453
|
+
}), Q = { points: J, rotates: q, matrixs: P }, R = [], L = P.map((Z) => (R.push(A.clone()), Z.clone().multiply(x))), K = O.length, H = e.getLengths(l).map((Z) => Z / u), _ = [{ rotates: R, us: H, matrixs: L }], G = s ? function(Z, ne, ge) {
|
|
1454
1454
|
const ie = _[Z].us[ne] - ge / u;
|
|
1455
1455
|
return {
|
|
1456
1456
|
u: ie,
|
|
@@ -1470,7 +1470,7 @@ function Ph(a) {
|
|
|
1470
1470
|
for (let Z = 1; Z < Y; Z++) {
|
|
1471
1471
|
const ne = [], ge = [], ie = [], se = [];
|
|
1472
1472
|
_.push({ points: ne, rotates: ge, us: ie, matrixs: se });
|
|
1473
|
-
const Se =
|
|
1473
|
+
const Se = v[Z], Ht = g[Z], St = Z - 1, Cs = _[St], Ds = v[St], Is = g[St], { matrixs: Ge, points: Wt, rotates: ns } = Cs, Ve = new I(), tt = new he(), st = new I();
|
|
1474
1474
|
Ds.decompose(Ve, tt, st);
|
|
1475
1475
|
const Ot = St - 1, is = Ot < 0 ? P : _[Ot].matrixs, Pe = new I(), Oe = new he(), ot = new I();
|
|
1476
1476
|
Se.decompose(Pe, Oe, ot);
|
|
@@ -2698,26 +2698,26 @@ function Vh() {
|
|
|
2698
2698
|
h.port2.postMessage(0);
|
|
2699
2699
|
};
|
|
2700
2700
|
} else "document" in n && "onreadystatechange" in n.document.createElement("script") ? o = function() {
|
|
2701
|
-
var
|
|
2702
|
-
|
|
2703
|
-
d(),
|
|
2704
|
-
}, n.document.documentElement.appendChild(
|
|
2701
|
+
var g = n.document.createElement("script");
|
|
2702
|
+
g.onreadystatechange = function() {
|
|
2703
|
+
d(), g.onreadystatechange = null, g.parentNode.removeChild(g), g = null;
|
|
2704
|
+
}, n.document.documentElement.appendChild(g);
|
|
2705
2705
|
} : o = function() {
|
|
2706
2706
|
setTimeout(d, 0);
|
|
2707
2707
|
};
|
|
2708
2708
|
var p, f = [];
|
|
2709
2709
|
function d() {
|
|
2710
2710
|
p = !0;
|
|
2711
|
-
for (var
|
|
2712
|
-
for (
|
|
2713
|
-
|
|
2714
|
-
|
|
2711
|
+
for (var g, v, x = f.length; x; ) {
|
|
2712
|
+
for (v = f, f = [], g = -1; ++g < x; )
|
|
2713
|
+
v[g]();
|
|
2714
|
+
x = f.length;
|
|
2715
2715
|
}
|
|
2716
2716
|
p = !1;
|
|
2717
2717
|
}
|
|
2718
2718
|
s.exports = m;
|
|
2719
|
-
function m(
|
|
2720
|
-
f.push(
|
|
2719
|
+
function m(g) {
|
|
2720
|
+
f.push(g) === 1 && !p && o();
|
|
2721
2721
|
}
|
|
2722
2722
|
}).call(this, typeof er < "u" ? er : typeof self < "u" ? self : typeof window < "u" ? window : {});
|
|
2723
2723
|
}, {}], 2: [function(t, s, r) {
|
|
@@ -2736,16 +2736,16 @@ function Vh() {
|
|
|
2736
2736
|
}, h.prototype.then = function(D, E) {
|
|
2737
2737
|
if (typeof D != "function" && this.state === l || typeof E != "function" && this.state === c)
|
|
2738
2738
|
return this;
|
|
2739
|
-
var
|
|
2739
|
+
var O = new this.constructor(i);
|
|
2740
2740
|
if (this.state !== u) {
|
|
2741
2741
|
var k = this.state === l ? D : E;
|
|
2742
|
-
f(
|
|
2742
|
+
f(O, k, this.outcome);
|
|
2743
2743
|
} else
|
|
2744
|
-
this.queue.push(new p(
|
|
2745
|
-
return
|
|
2744
|
+
this.queue.push(new p(O, D, E));
|
|
2745
|
+
return O;
|
|
2746
2746
|
};
|
|
2747
|
-
function p(D, E,
|
|
2748
|
-
this.promise = D, typeof E == "function" && (this.onFulfilled = E, this.callFulfilled = this.otherCallFulfilled), typeof
|
|
2747
|
+
function p(D, E, O) {
|
|
2748
|
+
this.promise = D, typeof E == "function" && (this.onFulfilled = E, this.callFulfilled = this.otherCallFulfilled), typeof O == "function" && (this.onRejected = O, this.callRejected = this.otherCallRejected);
|
|
2749
2749
|
}
|
|
2750
2750
|
p.prototype.callFulfilled = function(D) {
|
|
2751
2751
|
o.resolve(this.promise, D);
|
|
@@ -2756,11 +2756,11 @@ function Vh() {
|
|
|
2756
2756
|
}, p.prototype.otherCallRejected = function(D) {
|
|
2757
2757
|
f(this.promise, this.onRejected, D);
|
|
2758
2758
|
};
|
|
2759
|
-
function f(D, E,
|
|
2759
|
+
function f(D, E, O) {
|
|
2760
2760
|
n(function() {
|
|
2761
2761
|
var k;
|
|
2762
2762
|
try {
|
|
2763
|
-
k = E(
|
|
2763
|
+
k = E(O);
|
|
2764
2764
|
} catch (U) {
|
|
2765
2765
|
return o.reject(D, U);
|
|
2766
2766
|
}
|
|
@@ -2768,10 +2768,10 @@ function Vh() {
|
|
|
2768
2768
|
});
|
|
2769
2769
|
}
|
|
2770
2770
|
o.resolve = function(D, E) {
|
|
2771
|
-
var
|
|
2772
|
-
if (
|
|
2773
|
-
return o.reject(D,
|
|
2774
|
-
var k =
|
|
2771
|
+
var O = g(d, E);
|
|
2772
|
+
if (O.status === "error")
|
|
2773
|
+
return o.reject(D, O.value);
|
|
2774
|
+
var k = O.value;
|
|
2775
2775
|
if (k)
|
|
2776
2776
|
m(D, k);
|
|
2777
2777
|
else {
|
|
@@ -2782,8 +2782,8 @@ function Vh() {
|
|
|
2782
2782
|
return D;
|
|
2783
2783
|
}, o.reject = function(D, E) {
|
|
2784
2784
|
D.state = c, D.outcome = E;
|
|
2785
|
-
for (var
|
|
2786
|
-
D.queue[
|
|
2785
|
+
for (var O = -1, k = D.queue.length; ++O < k; )
|
|
2786
|
+
D.queue[O].callRejected(E);
|
|
2787
2787
|
return D;
|
|
2788
2788
|
};
|
|
2789
2789
|
function d(D) {
|
|
@@ -2794,54 +2794,54 @@ function Vh() {
|
|
|
2794
2794
|
};
|
|
2795
2795
|
}
|
|
2796
2796
|
function m(D, E) {
|
|
2797
|
-
var
|
|
2797
|
+
var O = !1;
|
|
2798
2798
|
function k($) {
|
|
2799
|
-
|
|
2799
|
+
O || (O = !0, o.reject(D, $));
|
|
2800
2800
|
}
|
|
2801
2801
|
function U($) {
|
|
2802
|
-
|
|
2802
|
+
O || (O = !0, o.resolve(D, $));
|
|
2803
2803
|
}
|
|
2804
2804
|
function q() {
|
|
2805
2805
|
E(U, k);
|
|
2806
2806
|
}
|
|
2807
|
-
var J =
|
|
2807
|
+
var J = g(q);
|
|
2808
2808
|
J.status === "error" && k(J.value);
|
|
2809
2809
|
}
|
|
2810
|
-
function
|
|
2811
|
-
var
|
|
2810
|
+
function g(D, E) {
|
|
2811
|
+
var O = {};
|
|
2812
2812
|
try {
|
|
2813
|
-
|
|
2813
|
+
O.value = D(E), O.status = "success";
|
|
2814
2814
|
} catch (k) {
|
|
2815
|
-
|
|
2815
|
+
O.status = "error", O.value = k;
|
|
2816
2816
|
}
|
|
2817
|
-
return
|
|
2817
|
+
return O;
|
|
2818
2818
|
}
|
|
2819
|
-
h.resolve =
|
|
2820
|
-
function
|
|
2819
|
+
h.resolve = v;
|
|
2820
|
+
function v(D) {
|
|
2821
2821
|
return D instanceof this ? D : o.resolve(new this(i), D);
|
|
2822
2822
|
}
|
|
2823
|
-
h.reject =
|
|
2824
|
-
function
|
|
2823
|
+
h.reject = x;
|
|
2824
|
+
function x(D) {
|
|
2825
2825
|
var E = new this(i);
|
|
2826
2826
|
return o.reject(E, D);
|
|
2827
2827
|
}
|
|
2828
|
-
h.all =
|
|
2829
|
-
function
|
|
2828
|
+
h.all = b;
|
|
2829
|
+
function b(D) {
|
|
2830
2830
|
var E = this;
|
|
2831
2831
|
if (Object.prototype.toString.call(D) !== "[object Array]")
|
|
2832
2832
|
return this.reject(new TypeError("must be an array"));
|
|
2833
|
-
var
|
|
2834
|
-
if (!
|
|
2833
|
+
var O = D.length, k = !1;
|
|
2834
|
+
if (!O)
|
|
2835
2835
|
return this.resolve([]);
|
|
2836
|
-
for (var U = new Array(
|
|
2836
|
+
for (var U = new Array(O), q = 0, J = -1, $ = new this(i); ++J < O; )
|
|
2837
2837
|
F(D[J], J);
|
|
2838
2838
|
return $;
|
|
2839
2839
|
function F(P, Q) {
|
|
2840
|
-
E.resolve(P).then(R, function(
|
|
2841
|
-
k || (k = !0, o.reject($,
|
|
2840
|
+
E.resolve(P).then(R, function(L) {
|
|
2841
|
+
k || (k = !0, o.reject($, L));
|
|
2842
2842
|
});
|
|
2843
|
-
function R(
|
|
2844
|
-
U[Q] =
|
|
2843
|
+
function R(L) {
|
|
2844
|
+
U[Q] = L, ++q === O && !k && (k = !0, o.resolve($, U));
|
|
2845
2845
|
}
|
|
2846
2846
|
}
|
|
2847
2847
|
}
|
|
@@ -2850,10 +2850,10 @@ function Vh() {
|
|
|
2850
2850
|
var E = this;
|
|
2851
2851
|
if (Object.prototype.toString.call(D) !== "[object Array]")
|
|
2852
2852
|
return this.reject(new TypeError("must be an array"));
|
|
2853
|
-
var
|
|
2854
|
-
if (!
|
|
2853
|
+
var O = D.length, k = !1;
|
|
2854
|
+
if (!O)
|
|
2855
2855
|
return this.resolve([]);
|
|
2856
|
-
for (var U = -1, q = new this(i); ++U <
|
|
2856
|
+
for (var U = -1, q = new this(i); ++U < O; )
|
|
2857
2857
|
J(D[U]);
|
|
2858
2858
|
return q;
|
|
2859
2859
|
function J($) {
|
|
@@ -2869,13 +2869,13 @@ function Vh() {
|
|
|
2869
2869
|
typeof n.Promise != "function" && (n.Promise = t(2));
|
|
2870
2870
|
}).call(this, typeof er < "u" ? er : typeof self < "u" ? self : typeof window < "u" ? window : {});
|
|
2871
2871
|
}, { 2: 2 }], 4: [function(t, s, r) {
|
|
2872
|
-
var n = typeof Symbol == "function" && typeof Symbol.iterator == "symbol" ? function(
|
|
2873
|
-
return typeof
|
|
2874
|
-
} : function(
|
|
2875
|
-
return
|
|
2872
|
+
var n = typeof Symbol == "function" && typeof Symbol.iterator == "symbol" ? function(y) {
|
|
2873
|
+
return typeof y;
|
|
2874
|
+
} : function(y) {
|
|
2875
|
+
return y && typeof Symbol == "function" && y.constructor === Symbol && y !== Symbol.prototype ? "symbol" : typeof y;
|
|
2876
2876
|
};
|
|
2877
|
-
function i(
|
|
2878
|
-
if (!(
|
|
2877
|
+
function i(y, M) {
|
|
2878
|
+
if (!(y instanceof M))
|
|
2879
2879
|
throw new TypeError("Cannot call a class as a function");
|
|
2880
2880
|
}
|
|
2881
2881
|
function o() {
|
|
@@ -2899,8 +2899,8 @@ function Vh() {
|
|
|
2899
2899
|
try {
|
|
2900
2900
|
if (!c || !c.open)
|
|
2901
2901
|
return !1;
|
|
2902
|
-
var
|
|
2903
|
-
return (!
|
|
2902
|
+
var y = typeof openDatabase < "u" && /(Safari|iPhone|iPad|iPod)/.test(navigator.userAgent) && !/Chrome/.test(navigator.userAgent) && !/BlackBerry/.test(navigator.platform), M = typeof fetch == "function" && fetch.toString().indexOf("[native code") !== -1;
|
|
2903
|
+
return (!y || M) && typeof indexedDB < "u" && // some outdated implementations of IDB that appear on Samsung
|
|
2904
2904
|
// and HTC Android devices <4.4 are missing IDBKeyRange
|
|
2905
2905
|
// See: https://github.com/mozilla/localForage/issues/128
|
|
2906
2906
|
// See: https://github.com/mozilla/localForage/issues/272
|
|
@@ -2909,49 +2909,49 @@ function Vh() {
|
|
|
2909
2909
|
return !1;
|
|
2910
2910
|
}
|
|
2911
2911
|
}
|
|
2912
|
-
function u(
|
|
2913
|
-
|
|
2912
|
+
function u(y, M) {
|
|
2913
|
+
y = y || [], M = M || {};
|
|
2914
2914
|
try {
|
|
2915
|
-
return new Blob(
|
|
2915
|
+
return new Blob(y, M);
|
|
2916
2916
|
} catch (S) {
|
|
2917
2917
|
if (S.name !== "TypeError")
|
|
2918
2918
|
throw S;
|
|
2919
|
-
for (var
|
|
2920
|
-
T.append(
|
|
2919
|
+
for (var w = typeof BlobBuilder < "u" ? BlobBuilder : typeof MSBlobBuilder < "u" ? MSBlobBuilder : typeof MozBlobBuilder < "u" ? MozBlobBuilder : WebKitBlobBuilder, T = new w(), C = 0; C < y.length; C += 1)
|
|
2920
|
+
T.append(y[C]);
|
|
2921
2921
|
return T.getBlob(M.type);
|
|
2922
2922
|
}
|
|
2923
2923
|
}
|
|
2924
2924
|
typeof Promise > "u" && t(3);
|
|
2925
2925
|
var h = Promise;
|
|
2926
|
-
function p(
|
|
2927
|
-
M &&
|
|
2928
|
-
M(null,
|
|
2929
|
-
}, function(
|
|
2930
|
-
M(
|
|
2926
|
+
function p(y, M) {
|
|
2927
|
+
M && y.then(function(w) {
|
|
2928
|
+
M(null, w);
|
|
2929
|
+
}, function(w) {
|
|
2930
|
+
M(w);
|
|
2931
2931
|
});
|
|
2932
2932
|
}
|
|
2933
|
-
function f(
|
|
2934
|
-
typeof M == "function" &&
|
|
2933
|
+
function f(y, M, w) {
|
|
2934
|
+
typeof M == "function" && y.then(M), typeof w == "function" && y.catch(w);
|
|
2935
2935
|
}
|
|
2936
|
-
function d(
|
|
2937
|
-
return typeof
|
|
2936
|
+
function d(y) {
|
|
2937
|
+
return typeof y != "string" && (console.warn(y + " used as a key, but it is not a string."), y = String(y)), y;
|
|
2938
2938
|
}
|
|
2939
2939
|
function m() {
|
|
2940
2940
|
if (arguments.length && typeof arguments[arguments.length - 1] == "function")
|
|
2941
2941
|
return arguments[arguments.length - 1];
|
|
2942
2942
|
}
|
|
2943
|
-
var
|
|
2944
|
-
function E(
|
|
2945
|
-
for (var M =
|
|
2946
|
-
T[C] =
|
|
2947
|
-
return
|
|
2943
|
+
var g = "local-forage-detect-blob-support", v = void 0, x = {}, b = Object.prototype.toString, A = "readonly", D = "readwrite";
|
|
2944
|
+
function E(y) {
|
|
2945
|
+
for (var M = y.length, w = new ArrayBuffer(M), T = new Uint8Array(w), C = 0; C < M; C++)
|
|
2946
|
+
T[C] = y.charCodeAt(C);
|
|
2947
|
+
return w;
|
|
2948
2948
|
}
|
|
2949
|
-
function
|
|
2949
|
+
function O(y) {
|
|
2950
2950
|
return new h(function(M) {
|
|
2951
|
-
var
|
|
2952
|
-
|
|
2951
|
+
var w = y.transaction(g, D), T = u([""]);
|
|
2952
|
+
w.objectStore(g).put(T, "key"), w.onabort = function(C) {
|
|
2953
2953
|
C.preventDefault(), C.stopPropagation(), M(!1);
|
|
2954
|
-
},
|
|
2954
|
+
}, w.oncomplete = function() {
|
|
2955
2955
|
var C = navigator.userAgent.match(/Chrome\/(\d+)/), S = navigator.userAgent.match(/Edge\//);
|
|
2956
2956
|
M(S || !C || parseInt(C[1], 10) >= 43);
|
|
2957
2957
|
};
|
|
@@ -2959,46 +2959,46 @@ function Vh() {
|
|
|
2959
2959
|
return !1;
|
|
2960
2960
|
});
|
|
2961
2961
|
}
|
|
2962
|
-
function k(
|
|
2963
|
-
return typeof
|
|
2964
|
-
return
|
|
2962
|
+
function k(y) {
|
|
2963
|
+
return typeof v == "boolean" ? h.resolve(v) : O(y).then(function(M) {
|
|
2964
|
+
return v = M, v;
|
|
2965
2965
|
});
|
|
2966
2966
|
}
|
|
2967
|
-
function U(
|
|
2968
|
-
var M =
|
|
2969
|
-
|
|
2970
|
-
|
|
2971
|
-
}), M.deferredOperations.push(
|
|
2972
|
-
return
|
|
2973
|
-
}) : M.dbReady =
|
|
2967
|
+
function U(y) {
|
|
2968
|
+
var M = x[y.name], w = {};
|
|
2969
|
+
w.promise = new h(function(T, C) {
|
|
2970
|
+
w.resolve = T, w.reject = C;
|
|
2971
|
+
}), M.deferredOperations.push(w), M.dbReady ? M.dbReady = M.dbReady.then(function() {
|
|
2972
|
+
return w.promise;
|
|
2973
|
+
}) : M.dbReady = w.promise;
|
|
2974
2974
|
}
|
|
2975
|
-
function q(
|
|
2976
|
-
var M =
|
|
2977
|
-
if (
|
|
2978
|
-
return
|
|
2975
|
+
function q(y) {
|
|
2976
|
+
var M = x[y.name], w = M.deferredOperations.pop();
|
|
2977
|
+
if (w)
|
|
2978
|
+
return w.resolve(), w.promise;
|
|
2979
2979
|
}
|
|
2980
|
-
function J(
|
|
2981
|
-
var
|
|
2980
|
+
function J(y, M) {
|
|
2981
|
+
var w = x[y.name], T = w.deferredOperations.pop();
|
|
2982
2982
|
if (T)
|
|
2983
2983
|
return T.reject(M), T.promise;
|
|
2984
2984
|
}
|
|
2985
|
-
function $(
|
|
2986
|
-
return new h(function(
|
|
2987
|
-
if (
|
|
2985
|
+
function $(y, M) {
|
|
2986
|
+
return new h(function(w, T) {
|
|
2987
|
+
if (x[y.name] = x[y.name] || Y(), y.db)
|
|
2988
2988
|
if (M)
|
|
2989
|
-
U(
|
|
2989
|
+
U(y), y.db.close();
|
|
2990
2990
|
else
|
|
2991
|
-
return
|
|
2992
|
-
var C = [
|
|
2993
|
-
M && C.push(
|
|
2991
|
+
return w(y.db);
|
|
2992
|
+
var C = [y.name];
|
|
2993
|
+
M && C.push(y.version);
|
|
2994
2994
|
var S = c.open.apply(c, C);
|
|
2995
2995
|
M && (S.onupgradeneeded = function(B) {
|
|
2996
2996
|
var z = S.result;
|
|
2997
2997
|
try {
|
|
2998
|
-
z.createObjectStore(
|
|
2998
|
+
z.createObjectStore(y.storeName), B.oldVersion <= 1 && z.createObjectStore(g);
|
|
2999
2999
|
} catch (N) {
|
|
3000
3000
|
if (N.name === "ConstraintError")
|
|
3001
|
-
console.warn('The database "' +
|
|
3001
|
+
console.warn('The database "' + y.name + '" has been upgraded from version ' + B.oldVersion + " to version " + B.newVersion + ', but the storage "' + y.storeName + '" already exists.');
|
|
3002
3002
|
else
|
|
3003
3003
|
throw N;
|
|
3004
3004
|
}
|
|
@@ -3008,89 +3008,89 @@ function Vh() {
|
|
|
3008
3008
|
var B = S.result;
|
|
3009
3009
|
B.onversionchange = function(z) {
|
|
3010
3010
|
z.target.close();
|
|
3011
|
-
},
|
|
3011
|
+
}, w(B), q(y);
|
|
3012
3012
|
};
|
|
3013
3013
|
});
|
|
3014
3014
|
}
|
|
3015
|
-
function F(
|
|
3016
|
-
return $(
|
|
3015
|
+
function F(y) {
|
|
3016
|
+
return $(y, !1);
|
|
3017
3017
|
}
|
|
3018
|
-
function P(
|
|
3019
|
-
return $(
|
|
3018
|
+
function P(y) {
|
|
3019
|
+
return $(y, !0);
|
|
3020
3020
|
}
|
|
3021
|
-
function Q(
|
|
3022
|
-
if (!
|
|
3021
|
+
function Q(y, M) {
|
|
3022
|
+
if (!y.db)
|
|
3023
3023
|
return !0;
|
|
3024
|
-
var
|
|
3025
|
-
if (T && (
|
|
3026
|
-
if (
|
|
3027
|
-
var S =
|
|
3028
|
-
S >
|
|
3024
|
+
var w = !y.db.objectStoreNames.contains(y.storeName), T = y.version < y.db.version, C = y.version > y.db.version;
|
|
3025
|
+
if (T && (y.version !== M && console.warn('The database "' + y.name + `" can't be downgraded from version ` + y.db.version + " to version " + y.version + "."), y.version = y.db.version), C || w) {
|
|
3026
|
+
if (w) {
|
|
3027
|
+
var S = y.db.version + 1;
|
|
3028
|
+
S > y.version && (y.version = S);
|
|
3029
3029
|
}
|
|
3030
3030
|
return !0;
|
|
3031
3031
|
}
|
|
3032
3032
|
return !1;
|
|
3033
3033
|
}
|
|
3034
|
-
function R(
|
|
3035
|
-
return new h(function(M,
|
|
3034
|
+
function R(y) {
|
|
3035
|
+
return new h(function(M, w) {
|
|
3036
3036
|
var T = new FileReader();
|
|
3037
|
-
T.onerror =
|
|
3037
|
+
T.onerror = w, T.onloadend = function(C) {
|
|
3038
3038
|
var S = btoa(C.target.result || "");
|
|
3039
3039
|
M({
|
|
3040
3040
|
__local_forage_encoded_blob: !0,
|
|
3041
3041
|
data: S,
|
|
3042
|
-
type:
|
|
3042
|
+
type: y.type
|
|
3043
3043
|
});
|
|
3044
|
-
}, T.readAsBinaryString(
|
|
3044
|
+
}, T.readAsBinaryString(y);
|
|
3045
3045
|
});
|
|
3046
3046
|
}
|
|
3047
|
-
function
|
|
3048
|
-
var M = E(atob(
|
|
3049
|
-
return u([M], { type:
|
|
3047
|
+
function L(y) {
|
|
3048
|
+
var M = E(atob(y.data));
|
|
3049
|
+
return u([M], { type: y.type });
|
|
3050
3050
|
}
|
|
3051
|
-
function K(
|
|
3052
|
-
return
|
|
3051
|
+
function K(y) {
|
|
3052
|
+
return y && y.__local_forage_encoded_blob;
|
|
3053
3053
|
}
|
|
3054
|
-
function H(
|
|
3055
|
-
var M = this,
|
|
3056
|
-
var T =
|
|
3054
|
+
function H(y) {
|
|
3055
|
+
var M = this, w = M._initReady().then(function() {
|
|
3056
|
+
var T = x[M._dbInfo.name];
|
|
3057
3057
|
if (T && T.dbReady)
|
|
3058
3058
|
return T.dbReady;
|
|
3059
3059
|
});
|
|
3060
|
-
return f(
|
|
3060
|
+
return f(w, y, y), w;
|
|
3061
3061
|
}
|
|
3062
|
-
function _(
|
|
3063
|
-
U(
|
|
3064
|
-
for (var M =
|
|
3065
|
-
var C =
|
|
3062
|
+
function _(y) {
|
|
3063
|
+
U(y);
|
|
3064
|
+
for (var M = x[y.name], w = M.forages, T = 0; T < w.length; T++) {
|
|
3065
|
+
var C = w[T];
|
|
3066
3066
|
C._dbInfo.db && (C._dbInfo.db.close(), C._dbInfo.db = null);
|
|
3067
3067
|
}
|
|
3068
|
-
return
|
|
3069
|
-
return
|
|
3068
|
+
return y.db = null, F(y).then(function(S) {
|
|
3069
|
+
return y.db = S, Q(y) ? P(y) : S;
|
|
3070
3070
|
}).then(function(S) {
|
|
3071
|
-
|
|
3072
|
-
for (var B = 0; B <
|
|
3073
|
-
|
|
3071
|
+
y.db = M.db = S;
|
|
3072
|
+
for (var B = 0; B < w.length; B++)
|
|
3073
|
+
w[B]._dbInfo.db = S;
|
|
3074
3074
|
}).catch(function(S) {
|
|
3075
|
-
throw J(
|
|
3075
|
+
throw J(y, S), S;
|
|
3076
3076
|
});
|
|
3077
3077
|
}
|
|
3078
|
-
function G(
|
|
3078
|
+
function G(y, M, w, T) {
|
|
3079
3079
|
T === void 0 && (T = 1);
|
|
3080
3080
|
try {
|
|
3081
|
-
var C =
|
|
3082
|
-
|
|
3081
|
+
var C = y.db.transaction(y.storeName, M);
|
|
3082
|
+
w(null, C);
|
|
3083
3083
|
} catch (S) {
|
|
3084
|
-
if (T > 0 && (!
|
|
3084
|
+
if (T > 0 && (!y.db || S.name === "InvalidStateError" || S.name === "NotFoundError"))
|
|
3085
3085
|
return h.resolve().then(function() {
|
|
3086
|
-
if (!
|
|
3087
|
-
return
|
|
3086
|
+
if (!y.db || S.name === "NotFoundError" && !y.db.objectStoreNames.contains(y.storeName) && y.version <= y.db.version)
|
|
3087
|
+
return y.db && (y.version = y.db.version + 1), P(y);
|
|
3088
3088
|
}).then(function() {
|
|
3089
|
-
return _(
|
|
3090
|
-
G(
|
|
3089
|
+
return _(y).then(function() {
|
|
3090
|
+
G(y, M, w, T - 1);
|
|
3091
3091
|
});
|
|
3092
|
-
}).catch(
|
|
3093
|
-
|
|
3092
|
+
}).catch(w);
|
|
3093
|
+
w(S);
|
|
3094
3094
|
}
|
|
3095
3095
|
}
|
|
3096
3096
|
function Y() {
|
|
@@ -3105,15 +3105,15 @@ function Vh() {
|
|
|
3105
3105
|
deferredOperations: []
|
|
3106
3106
|
};
|
|
3107
3107
|
}
|
|
3108
|
-
function te(
|
|
3109
|
-
var M = this,
|
|
3108
|
+
function te(y) {
|
|
3109
|
+
var M = this, w = {
|
|
3110
3110
|
db: null
|
|
3111
3111
|
};
|
|
3112
|
-
if (
|
|
3113
|
-
for (var T in
|
|
3114
|
-
|
|
3115
|
-
var C =
|
|
3116
|
-
C || (C = Y(),
|
|
3112
|
+
if (y)
|
|
3113
|
+
for (var T in y)
|
|
3114
|
+
w[T] = y[T];
|
|
3115
|
+
var C = x[w.name];
|
|
3116
|
+
C || (C = Y(), x[w.name] = C), C.forages.push(M), M._initReady || (M._initReady = M.ready, M.ready = H);
|
|
3117
3117
|
var S = [];
|
|
3118
3118
|
function B() {
|
|
3119
3119
|
return h.resolve();
|
|
@@ -3124,30 +3124,30 @@ function Vh() {
|
|
|
3124
3124
|
}
|
|
3125
3125
|
var j = C.forages.slice(0);
|
|
3126
3126
|
return h.all(S).then(function() {
|
|
3127
|
-
return
|
|
3127
|
+
return w.db = C.db, F(w);
|
|
3128
3128
|
}).then(function(W) {
|
|
3129
|
-
return
|
|
3129
|
+
return w.db = W, Q(w, M._defaultConfig.version) ? P(w) : W;
|
|
3130
3130
|
}).then(function(W) {
|
|
3131
|
-
|
|
3131
|
+
w.db = C.db = W, M._dbInfo = w;
|
|
3132
3132
|
for (var ee = 0; ee < j.length; ee++) {
|
|
3133
3133
|
var de = j[ee];
|
|
3134
|
-
de !== M && (de._dbInfo.db =
|
|
3134
|
+
de !== M && (de._dbInfo.db = w.db, de._dbInfo.version = w.version);
|
|
3135
3135
|
}
|
|
3136
3136
|
});
|
|
3137
3137
|
}
|
|
3138
|
-
function Z(
|
|
3139
|
-
var
|
|
3140
|
-
|
|
3138
|
+
function Z(y, M) {
|
|
3139
|
+
var w = this;
|
|
3140
|
+
y = d(y);
|
|
3141
3141
|
var T = new h(function(C, S) {
|
|
3142
|
-
|
|
3143
|
-
G(
|
|
3142
|
+
w.ready().then(function() {
|
|
3143
|
+
G(w._dbInfo, A, function(B, z) {
|
|
3144
3144
|
if (B)
|
|
3145
3145
|
return S(B);
|
|
3146
3146
|
try {
|
|
3147
|
-
var N = z.objectStore(
|
|
3147
|
+
var N = z.objectStore(w._dbInfo.storeName), j = N.get(y);
|
|
3148
3148
|
j.onsuccess = function() {
|
|
3149
3149
|
var W = j.result;
|
|
3150
|
-
W === void 0 && (W = null), K(W) && (W =
|
|
3150
|
+
W === void 0 && (W = null), K(W) && (W = L(W)), C(W);
|
|
3151
3151
|
}, j.onerror = function() {
|
|
3152
3152
|
S(j.error);
|
|
3153
3153
|
};
|
|
@@ -3159,20 +3159,20 @@ function Vh() {
|
|
|
3159
3159
|
});
|
|
3160
3160
|
return p(T, M), T;
|
|
3161
3161
|
}
|
|
3162
|
-
function ne(
|
|
3163
|
-
var
|
|
3164
|
-
|
|
3165
|
-
G(
|
|
3162
|
+
function ne(y, M) {
|
|
3163
|
+
var w = this, T = new h(function(C, S) {
|
|
3164
|
+
w.ready().then(function() {
|
|
3165
|
+
G(w._dbInfo, A, function(B, z) {
|
|
3166
3166
|
if (B)
|
|
3167
3167
|
return S(B);
|
|
3168
3168
|
try {
|
|
3169
|
-
var N = z.objectStore(
|
|
3169
|
+
var N = z.objectStore(w._dbInfo.storeName), j = N.openCursor(), W = 1;
|
|
3170
3170
|
j.onsuccess = function() {
|
|
3171
3171
|
var ee = j.result;
|
|
3172
3172
|
if (ee) {
|
|
3173
3173
|
var de = ee.value;
|
|
3174
|
-
K(de) && (de =
|
|
3175
|
-
var we =
|
|
3174
|
+
K(de) && (de = L(de));
|
|
3175
|
+
var we = y(de, ee.key, W++);
|
|
3176
3176
|
we !== void 0 ? C(we) : ee.continue();
|
|
3177
3177
|
} else
|
|
3178
3178
|
C();
|
|
@@ -3187,13 +3187,13 @@ function Vh() {
|
|
|
3187
3187
|
});
|
|
3188
3188
|
return p(T, M), T;
|
|
3189
3189
|
}
|
|
3190
|
-
function ge(
|
|
3190
|
+
function ge(y, M, w) {
|
|
3191
3191
|
var T = this;
|
|
3192
|
-
|
|
3192
|
+
y = d(y);
|
|
3193
3193
|
var C = new h(function(S, B) {
|
|
3194
3194
|
var z;
|
|
3195
3195
|
T.ready().then(function() {
|
|
3196
|
-
return z = T._dbInfo,
|
|
3196
|
+
return z = T._dbInfo, b.call(M) === "[object Blob]" ? k(z.db).then(function(N) {
|
|
3197
3197
|
return N ? M : R(M);
|
|
3198
3198
|
}) : M;
|
|
3199
3199
|
}).then(function(N) {
|
|
@@ -3203,7 +3203,7 @@ function Vh() {
|
|
|
3203
3203
|
try {
|
|
3204
3204
|
var ee = W.objectStore(T._dbInfo.storeName);
|
|
3205
3205
|
N === null && (N = void 0);
|
|
3206
|
-
var de = ee.put(N,
|
|
3206
|
+
var de = ee.put(N, y);
|
|
3207
3207
|
W.oncomplete = function() {
|
|
3208
3208
|
N === void 0 && (N = null), S(N);
|
|
3209
3209
|
}, W.onabort = W.onerror = function() {
|
|
@@ -3216,18 +3216,18 @@ function Vh() {
|
|
|
3216
3216
|
});
|
|
3217
3217
|
}).catch(B);
|
|
3218
3218
|
});
|
|
3219
|
-
return p(C,
|
|
3219
|
+
return p(C, w), C;
|
|
3220
3220
|
}
|
|
3221
|
-
function ie(
|
|
3222
|
-
var
|
|
3223
|
-
|
|
3221
|
+
function ie(y, M) {
|
|
3222
|
+
var w = this;
|
|
3223
|
+
y = d(y);
|
|
3224
3224
|
var T = new h(function(C, S) {
|
|
3225
|
-
|
|
3226
|
-
G(
|
|
3225
|
+
w.ready().then(function() {
|
|
3226
|
+
G(w._dbInfo, D, function(B, z) {
|
|
3227
3227
|
if (B)
|
|
3228
3228
|
return S(B);
|
|
3229
3229
|
try {
|
|
3230
|
-
var N = z.objectStore(
|
|
3230
|
+
var N = z.objectStore(w._dbInfo.storeName), j = N.delete(y);
|
|
3231
3231
|
z.oncomplete = function() {
|
|
3232
3232
|
C();
|
|
3233
3233
|
}, z.onerror = function() {
|
|
@@ -3244,8 +3244,8 @@ function Vh() {
|
|
|
3244
3244
|
});
|
|
3245
3245
|
return p(T, M), T;
|
|
3246
3246
|
}
|
|
3247
|
-
function se(
|
|
3248
|
-
var M = this,
|
|
3247
|
+
function se(y) {
|
|
3248
|
+
var M = this, w = new h(function(T, C) {
|
|
3249
3249
|
M.ready().then(function() {
|
|
3250
3250
|
G(M._dbInfo, D, function(S, B) {
|
|
3251
3251
|
if (S)
|
|
@@ -3264,10 +3264,10 @@ function Vh() {
|
|
|
3264
3264
|
});
|
|
3265
3265
|
}).catch(C);
|
|
3266
3266
|
});
|
|
3267
|
-
return p(
|
|
3267
|
+
return p(w, y), w;
|
|
3268
3268
|
}
|
|
3269
|
-
function Se(
|
|
3270
|
-
var M = this,
|
|
3269
|
+
function Se(y) {
|
|
3270
|
+
var M = this, w = new h(function(T, C) {
|
|
3271
3271
|
M.ready().then(function() {
|
|
3272
3272
|
G(M._dbInfo, A, function(S, B) {
|
|
3273
3273
|
if (S)
|
|
@@ -3285,27 +3285,27 @@ function Vh() {
|
|
|
3285
3285
|
});
|
|
3286
3286
|
}).catch(C);
|
|
3287
3287
|
});
|
|
3288
|
-
return p(
|
|
3288
|
+
return p(w, y), w;
|
|
3289
3289
|
}
|
|
3290
|
-
function Ht(
|
|
3291
|
-
var
|
|
3292
|
-
if (
|
|
3290
|
+
function Ht(y, M) {
|
|
3291
|
+
var w = this, T = new h(function(C, S) {
|
|
3292
|
+
if (y < 0) {
|
|
3293
3293
|
C(null);
|
|
3294
3294
|
return;
|
|
3295
3295
|
}
|
|
3296
|
-
|
|
3297
|
-
G(
|
|
3296
|
+
w.ready().then(function() {
|
|
3297
|
+
G(w._dbInfo, A, function(B, z) {
|
|
3298
3298
|
if (B)
|
|
3299
3299
|
return S(B);
|
|
3300
3300
|
try {
|
|
3301
|
-
var N = z.objectStore(
|
|
3301
|
+
var N = z.objectStore(w._dbInfo.storeName), j = !1, W = N.openKeyCursor();
|
|
3302
3302
|
W.onsuccess = function() {
|
|
3303
3303
|
var ee = W.result;
|
|
3304
3304
|
if (!ee) {
|
|
3305
3305
|
C(null);
|
|
3306
3306
|
return;
|
|
3307
3307
|
}
|
|
3308
|
-
|
|
3308
|
+
y === 0 || j ? C(ee.key) : (j = !0, ee.advance(y));
|
|
3309
3309
|
}, W.onerror = function() {
|
|
3310
3310
|
S(W.error);
|
|
3311
3311
|
};
|
|
@@ -3317,8 +3317,8 @@ function Vh() {
|
|
|
3317
3317
|
});
|
|
3318
3318
|
return p(T, M), T;
|
|
3319
3319
|
}
|
|
3320
|
-
function St(
|
|
3321
|
-
var M = this,
|
|
3320
|
+
function St(y) {
|
|
3321
|
+
var M = this, w = new h(function(T, C) {
|
|
3322
3322
|
M.ready().then(function() {
|
|
3323
3323
|
G(M._dbInfo, A, function(S, B) {
|
|
3324
3324
|
if (S)
|
|
@@ -3341,41 +3341,41 @@ function Vh() {
|
|
|
3341
3341
|
});
|
|
3342
3342
|
}).catch(C);
|
|
3343
3343
|
});
|
|
3344
|
-
return p(
|
|
3344
|
+
return p(w, y), w;
|
|
3345
3345
|
}
|
|
3346
|
-
function Cs(
|
|
3346
|
+
function Cs(y, M) {
|
|
3347
3347
|
M = m.apply(this, arguments);
|
|
3348
|
-
var
|
|
3349
|
-
|
|
3348
|
+
var w = this.config();
|
|
3349
|
+
y = typeof y != "function" && y || {}, y.name || (y.name = y.name || w.name, y.storeName = y.storeName || w.storeName);
|
|
3350
3350
|
var T = this, C;
|
|
3351
|
-
if (!
|
|
3351
|
+
if (!y.name)
|
|
3352
3352
|
C = h.reject("Invalid arguments");
|
|
3353
3353
|
else {
|
|
3354
|
-
var S =
|
|
3355
|
-
var N =
|
|
3354
|
+
var S = y.name === w.name && T._dbInfo.db, B = S ? h.resolve(T._dbInfo.db) : F(y).then(function(z) {
|
|
3355
|
+
var N = x[y.name], j = N.forages;
|
|
3356
3356
|
N.db = z;
|
|
3357
3357
|
for (var W = 0; W < j.length; W++)
|
|
3358
3358
|
j[W]._dbInfo.db = z;
|
|
3359
3359
|
return z;
|
|
3360
3360
|
});
|
|
3361
|
-
|
|
3362
|
-
if (z.objectStoreNames.contains(
|
|
3361
|
+
y.storeName ? C = B.then(function(z) {
|
|
3362
|
+
if (z.objectStoreNames.contains(y.storeName)) {
|
|
3363
3363
|
var N = z.version + 1;
|
|
3364
|
-
U(
|
|
3365
|
-
var j =
|
|
3364
|
+
U(y);
|
|
3365
|
+
var j = x[y.name], W = j.forages;
|
|
3366
3366
|
z.close();
|
|
3367
3367
|
for (var ee = 0; ee < W.length; ee++) {
|
|
3368
3368
|
var de = W[ee];
|
|
3369
3369
|
de._dbInfo.db = null, de._dbInfo.version = N;
|
|
3370
3370
|
}
|
|
3371
3371
|
var we = new h(function(xe, Ae) {
|
|
3372
|
-
var Te = c.open(
|
|
3372
|
+
var Te = c.open(y.name, N);
|
|
3373
3373
|
Te.onerror = function(Qe) {
|
|
3374
3374
|
var Ps = Te.result;
|
|
3375
3375
|
Ps.close(), Ae(Qe);
|
|
3376
3376
|
}, Te.onupgradeneeded = function() {
|
|
3377
3377
|
var Qe = Te.result;
|
|
3378
|
-
Qe.deleteObjectStore(
|
|
3378
|
+
Qe.deleteObjectStore(y.storeName);
|
|
3379
3379
|
}, Te.onsuccess = function() {
|
|
3380
3380
|
var Qe = Te.result;
|
|
3381
3381
|
Qe.close(), xe(Qe);
|
|
@@ -3388,25 +3388,25 @@ function Vh() {
|
|
|
3388
3388
|
Te._dbInfo.db = xe, q(Te._dbInfo);
|
|
3389
3389
|
}
|
|
3390
3390
|
}).catch(function(xe) {
|
|
3391
|
-
throw (J(
|
|
3391
|
+
throw (J(y, xe) || h.resolve()).catch(function() {
|
|
3392
3392
|
}), xe;
|
|
3393
3393
|
});
|
|
3394
3394
|
}
|
|
3395
3395
|
}) : C = B.then(function(z) {
|
|
3396
|
-
U(
|
|
3397
|
-
var N =
|
|
3396
|
+
U(y);
|
|
3397
|
+
var N = x[y.name], j = N.forages;
|
|
3398
3398
|
z.close();
|
|
3399
3399
|
for (var W = 0; W < j.length; W++) {
|
|
3400
3400
|
var ee = j[W];
|
|
3401
3401
|
ee._dbInfo.db = null;
|
|
3402
3402
|
}
|
|
3403
3403
|
var de = new h(function(we, xe) {
|
|
3404
|
-
var Ae = c.deleteDatabase(
|
|
3404
|
+
var Ae = c.deleteDatabase(y.name);
|
|
3405
3405
|
Ae.onerror = function() {
|
|
3406
3406
|
var Te = Ae.result;
|
|
3407
3407
|
Te && Te.close(), xe(Ae.error);
|
|
3408
3408
|
}, Ae.onblocked = function() {
|
|
3409
|
-
console.warn('dropInstance blocked for database "' +
|
|
3409
|
+
console.warn('dropInstance blocked for database "' + y.name + '" until all open connections are closed');
|
|
3410
3410
|
}, Ae.onsuccess = function() {
|
|
3411
3411
|
var Te = Ae.result;
|
|
3412
3412
|
Te && Te.close(), we(Te);
|
|
@@ -3419,7 +3419,7 @@ function Vh() {
|
|
|
3419
3419
|
q(Ae._dbInfo);
|
|
3420
3420
|
}
|
|
3421
3421
|
}).catch(function(we) {
|
|
3422
|
-
throw (J(
|
|
3422
|
+
throw (J(y, we) || h.resolve()).catch(function() {
|
|
3423
3423
|
}), we;
|
|
3424
3424
|
});
|
|
3425
3425
|
});
|
|
@@ -3444,48 +3444,48 @@ function Vh() {
|
|
|
3444
3444
|
return typeof openDatabase == "function";
|
|
3445
3445
|
}
|
|
3446
3446
|
var Ge = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/", Wt = "~~local_forage_type~", ns = /^~~local_forage_type~([^~]+)~/, Ve = "__lfsc__:", tt = Ve.length, st = "arbf", Ot = "blob", is = "si08", Pe = "ui08", Oe = "uic8", ot = "si16", ct = "si32", qt = "ur16", He = "ui32", Fe = "fl32", lt = "fl64", Xe = tt + st.length, Kt = Object.prototype.toString;
|
|
3447
|
-
function as(
|
|
3448
|
-
var M =
|
|
3449
|
-
|
|
3447
|
+
function as(y) {
|
|
3448
|
+
var M = y.length * 0.75, w = y.length, T, C = 0, S, B, z, N;
|
|
3449
|
+
y[y.length - 1] === "=" && (M--, y[y.length - 2] === "=" && M--);
|
|
3450
3450
|
var j = new ArrayBuffer(M), W = new Uint8Array(j);
|
|
3451
|
-
for (T = 0; T <
|
|
3452
|
-
S = Ge.indexOf(
|
|
3451
|
+
for (T = 0; T < w; T += 4)
|
|
3452
|
+
S = Ge.indexOf(y[T]), B = Ge.indexOf(y[T + 1]), z = Ge.indexOf(y[T + 2]), N = Ge.indexOf(y[T + 3]), W[C++] = S << 2 | B >> 4, W[C++] = (B & 15) << 4 | z >> 2, W[C++] = (z & 3) << 6 | N & 63;
|
|
3453
3453
|
return j;
|
|
3454
3454
|
}
|
|
3455
|
-
function Lt(
|
|
3456
|
-
var M = new Uint8Array(
|
|
3455
|
+
function Lt(y) {
|
|
3456
|
+
var M = new Uint8Array(y), w = "", T;
|
|
3457
3457
|
for (T = 0; T < M.length; T += 3)
|
|
3458
|
-
|
|
3459
|
-
return M.length % 3 === 2 ?
|
|
3458
|
+
w += Ge[M[T] >> 2], w += Ge[(M[T] & 3) << 4 | M[T + 1] >> 4], w += Ge[(M[T + 1] & 15) << 2 | M[T + 2] >> 6], w += Ge[M[T + 2] & 63];
|
|
3459
|
+
return M.length % 3 === 2 ? w = w.substring(0, w.length - 1) + "=" : M.length % 3 === 1 && (w = w.substring(0, w.length - 2) + "=="), w;
|
|
3460
3460
|
}
|
|
3461
|
-
function Bt(
|
|
3462
|
-
var
|
|
3463
|
-
if (
|
|
3461
|
+
function Bt(y, M) {
|
|
3462
|
+
var w = "";
|
|
3463
|
+
if (y && (w = Kt.call(y)), y && (w === "[object ArrayBuffer]" || y.buffer && Kt.call(y.buffer) === "[object ArrayBuffer]")) {
|
|
3464
3464
|
var T, C = Ve;
|
|
3465
|
-
|
|
3466
|
-
} else if (
|
|
3465
|
+
y instanceof ArrayBuffer ? (T = y, C += st) : (T = y.buffer, w === "[object Int8Array]" ? C += is : w === "[object Uint8Array]" ? C += Pe : w === "[object Uint8ClampedArray]" ? C += Oe : w === "[object Int16Array]" ? C += ot : w === "[object Uint16Array]" ? C += qt : w === "[object Int32Array]" ? C += ct : w === "[object Uint32Array]" ? C += He : w === "[object Float32Array]" ? C += Fe : w === "[object Float64Array]" ? C += lt : M(new Error("Failed to get type for BinaryArray"))), M(C + Lt(T));
|
|
3466
|
+
} else if (w === "[object Blob]") {
|
|
3467
3467
|
var S = new FileReader();
|
|
3468
3468
|
S.onload = function() {
|
|
3469
|
-
var B = Wt +
|
|
3469
|
+
var B = Wt + y.type + "~" + Lt(this.result);
|
|
3470
3470
|
M(Ve + Ot + B);
|
|
3471
|
-
}, S.readAsArrayBuffer(
|
|
3471
|
+
}, S.readAsArrayBuffer(y);
|
|
3472
3472
|
} else
|
|
3473
3473
|
try {
|
|
3474
|
-
M(JSON.stringify(
|
|
3474
|
+
M(JSON.stringify(y));
|
|
3475
3475
|
} catch (B) {
|
|
3476
|
-
console.error("Couldn't convert value into a JSON string: ",
|
|
3476
|
+
console.error("Couldn't convert value into a JSON string: ", y), M(null, B);
|
|
3477
3477
|
}
|
|
3478
3478
|
}
|
|
3479
|
-
function Ft(
|
|
3480
|
-
if (
|
|
3481
|
-
return JSON.parse(
|
|
3482
|
-
var M =
|
|
3483
|
-
if (
|
|
3479
|
+
function Ft(y) {
|
|
3480
|
+
if (y.substring(0, tt) !== Ve)
|
|
3481
|
+
return JSON.parse(y);
|
|
3482
|
+
var M = y.substring(Xe), w = y.substring(tt, Xe), T;
|
|
3483
|
+
if (w === Ot && ns.test(M)) {
|
|
3484
3484
|
var C = M.match(ns);
|
|
3485
3485
|
T = C[1], M = M.substring(C[0].length);
|
|
3486
3486
|
}
|
|
3487
3487
|
var S = as(M);
|
|
3488
|
-
switch (
|
|
3488
|
+
switch (w) {
|
|
3489
3489
|
case st:
|
|
3490
3490
|
return S;
|
|
3491
3491
|
case Ot:
|
|
@@ -3509,7 +3509,7 @@ function Vh() {
|
|
|
3509
3509
|
case lt:
|
|
3510
3510
|
return new Float64Array(S);
|
|
3511
3511
|
default:
|
|
3512
|
-
throw new Error("Unkown type: " +
|
|
3512
|
+
throw new Error("Unkown type: " + w);
|
|
3513
3513
|
}
|
|
3514
3514
|
}
|
|
3515
3515
|
var Tt = {
|
|
@@ -3518,49 +3518,49 @@ function Vh() {
|
|
|
3518
3518
|
stringToBuffer: as,
|
|
3519
3519
|
bufferToString: Lt
|
|
3520
3520
|
};
|
|
3521
|
-
function Ct(
|
|
3522
|
-
|
|
3521
|
+
function Ct(y, M, w, T) {
|
|
3522
|
+
y.executeSql("CREATE TABLE IF NOT EXISTS " + M.storeName + " (id INTEGER PRIMARY KEY, key unique, value)", [], w, T);
|
|
3523
3523
|
}
|
|
3524
|
-
function kt(
|
|
3525
|
-
var M = this,
|
|
3524
|
+
function kt(y) {
|
|
3525
|
+
var M = this, w = {
|
|
3526
3526
|
db: null
|
|
3527
3527
|
};
|
|
3528
|
-
if (
|
|
3529
|
-
for (var T in
|
|
3530
|
-
|
|
3528
|
+
if (y)
|
|
3529
|
+
for (var T in y)
|
|
3530
|
+
w[T] = typeof y[T] != "string" ? y[T].toString() : y[T];
|
|
3531
3531
|
var C = new h(function(S, B) {
|
|
3532
3532
|
try {
|
|
3533
|
-
|
|
3533
|
+
w.db = openDatabase(w.name, String(w.version), w.description, w.size);
|
|
3534
3534
|
} catch (z) {
|
|
3535
3535
|
return B(z);
|
|
3536
3536
|
}
|
|
3537
|
-
|
|
3538
|
-
Ct(z,
|
|
3539
|
-
M._dbInfo =
|
|
3537
|
+
w.db.transaction(function(z) {
|
|
3538
|
+
Ct(z, w, function() {
|
|
3539
|
+
M._dbInfo = w, S();
|
|
3540
3540
|
}, function(N, j) {
|
|
3541
3541
|
B(j);
|
|
3542
3542
|
});
|
|
3543
3543
|
}, B);
|
|
3544
3544
|
});
|
|
3545
|
-
return
|
|
3545
|
+
return w.serializer = Tt, C;
|
|
3546
3546
|
}
|
|
3547
|
-
function ht(
|
|
3548
|
-
|
|
3547
|
+
function ht(y, M, w, T, C, S) {
|
|
3548
|
+
y.executeSql(w, T, C, function(B, z) {
|
|
3549
3549
|
z.code === z.SYNTAX_ERR ? B.executeSql("SELECT name FROM sqlite_master WHERE type='table' AND name = ?", [M.storeName], function(N, j) {
|
|
3550
3550
|
j.rows.length ? S(N, z) : Ct(N, M, function() {
|
|
3551
|
-
N.executeSql(
|
|
3551
|
+
N.executeSql(w, T, C, S);
|
|
3552
3552
|
}, S);
|
|
3553
3553
|
}, S) : S(B, z);
|
|
3554
3554
|
}, S);
|
|
3555
3555
|
}
|
|
3556
|
-
function As(
|
|
3557
|
-
var
|
|
3558
|
-
|
|
3556
|
+
function As(y, M) {
|
|
3557
|
+
var w = this;
|
|
3558
|
+
y = d(y);
|
|
3559
3559
|
var T = new h(function(C, S) {
|
|
3560
|
-
|
|
3561
|
-
var B =
|
|
3560
|
+
w.ready().then(function() {
|
|
3561
|
+
var B = w._dbInfo;
|
|
3562
3562
|
B.db.transaction(function(z) {
|
|
3563
|
-
ht(z, B, "SELECT * FROM " + B.storeName + " WHERE key = ? LIMIT 1", [
|
|
3563
|
+
ht(z, B, "SELECT * FROM " + B.storeName + " WHERE key = ? LIMIT 1", [y], function(N, j) {
|
|
3564
3564
|
var W = j.rows.length ? j.rows.item(0).value : null;
|
|
3565
3565
|
W && (W = B.serializer.deserialize(W)), C(W);
|
|
3566
3566
|
}, function(N, j) {
|
|
@@ -3571,15 +3571,15 @@ function Vh() {
|
|
|
3571
3571
|
});
|
|
3572
3572
|
return p(T, M), T;
|
|
3573
3573
|
}
|
|
3574
|
-
function os(
|
|
3575
|
-
var
|
|
3576
|
-
|
|
3577
|
-
var B =
|
|
3574
|
+
function os(y, M) {
|
|
3575
|
+
var w = this, T = new h(function(C, S) {
|
|
3576
|
+
w.ready().then(function() {
|
|
3577
|
+
var B = w._dbInfo;
|
|
3578
3578
|
B.db.transaction(function(z) {
|
|
3579
3579
|
ht(z, B, "SELECT * FROM " + B.storeName, [], function(N, j) {
|
|
3580
3580
|
for (var W = j.rows, ee = W.length, de = 0; de < ee; de++) {
|
|
3581
3581
|
var we = W.item(de), xe = we.value;
|
|
3582
|
-
if (xe && (xe = B.serializer.deserialize(xe)), xe =
|
|
3582
|
+
if (xe && (xe = B.serializer.deserialize(xe)), xe = y(xe, we.key, de + 1), xe !== void 0) {
|
|
3583
3583
|
C(xe);
|
|
3584
3584
|
return;
|
|
3585
3585
|
}
|
|
@@ -3593,16 +3593,16 @@ function Vh() {
|
|
|
3593
3593
|
});
|
|
3594
3594
|
return p(T, M), T;
|
|
3595
3595
|
}
|
|
3596
|
-
function cs(
|
|
3596
|
+
function cs(y, M, w, T) {
|
|
3597
3597
|
var C = this;
|
|
3598
|
-
|
|
3598
|
+
y = d(y);
|
|
3599
3599
|
var S = new h(function(B, z) {
|
|
3600
3600
|
C.ready().then(function() {
|
|
3601
3601
|
M === void 0 && (M = null);
|
|
3602
3602
|
var N = M, j = C._dbInfo;
|
|
3603
3603
|
j.serializer.serialize(M, function(W, ee) {
|
|
3604
3604
|
ee ? z(ee) : j.db.transaction(function(de) {
|
|
3605
|
-
ht(de, j, "INSERT OR REPLACE INTO " + j.storeName + " (key, value) VALUES (?, ?)", [
|
|
3605
|
+
ht(de, j, "INSERT OR REPLACE INTO " + j.storeName + " (key, value) VALUES (?, ?)", [y, W], function() {
|
|
3606
3606
|
B(N);
|
|
3607
3607
|
}, function(we, xe) {
|
|
3608
3608
|
z(xe);
|
|
@@ -3610,7 +3610,7 @@ function Vh() {
|
|
|
3610
3610
|
}, function(de) {
|
|
3611
3611
|
if (de.code === de.QUOTA_ERR) {
|
|
3612
3612
|
if (T > 0) {
|
|
3613
|
-
B(cs.apply(C, [
|
|
3613
|
+
B(cs.apply(C, [y, N, w, T - 1]));
|
|
3614
3614
|
return;
|
|
3615
3615
|
}
|
|
3616
3616
|
z(de);
|
|
@@ -3619,19 +3619,19 @@ function Vh() {
|
|
|
3619
3619
|
});
|
|
3620
3620
|
}).catch(z);
|
|
3621
3621
|
});
|
|
3622
|
-
return p(S,
|
|
3622
|
+
return p(S, w), S;
|
|
3623
3623
|
}
|
|
3624
|
-
function go(
|
|
3625
|
-
return cs.apply(this, [
|
|
3624
|
+
function go(y, M, w) {
|
|
3625
|
+
return cs.apply(this, [y, M, w, 1]);
|
|
3626
3626
|
}
|
|
3627
|
-
function yo(
|
|
3628
|
-
var
|
|
3629
|
-
|
|
3627
|
+
function yo(y, M) {
|
|
3628
|
+
var w = this;
|
|
3629
|
+
y = d(y);
|
|
3630
3630
|
var T = new h(function(C, S) {
|
|
3631
|
-
|
|
3632
|
-
var B =
|
|
3631
|
+
w.ready().then(function() {
|
|
3632
|
+
var B = w._dbInfo;
|
|
3633
3633
|
B.db.transaction(function(z) {
|
|
3634
|
-
ht(z, B, "DELETE FROM " + B.storeName + " WHERE key = ?", [
|
|
3634
|
+
ht(z, B, "DELETE FROM " + B.storeName + " WHERE key = ?", [y], function() {
|
|
3635
3635
|
C();
|
|
3636
3636
|
}, function(N, j) {
|
|
3637
3637
|
S(j);
|
|
@@ -3641,8 +3641,8 @@ function Vh() {
|
|
|
3641
3641
|
});
|
|
3642
3642
|
return p(T, M), T;
|
|
3643
3643
|
}
|
|
3644
|
-
function vo(
|
|
3645
|
-
var M = this,
|
|
3644
|
+
function vo(y) {
|
|
3645
|
+
var M = this, w = new h(function(T, C) {
|
|
3646
3646
|
M.ready().then(function() {
|
|
3647
3647
|
var S = M._dbInfo;
|
|
3648
3648
|
S.db.transaction(function(B) {
|
|
@@ -3654,10 +3654,10 @@ function Vh() {
|
|
|
3654
3654
|
});
|
|
3655
3655
|
}).catch(C);
|
|
3656
3656
|
});
|
|
3657
|
-
return p(
|
|
3657
|
+
return p(w, y), w;
|
|
3658
3658
|
}
|
|
3659
|
-
function wo(
|
|
3660
|
-
var M = this,
|
|
3659
|
+
function wo(y) {
|
|
3660
|
+
var M = this, w = new h(function(T, C) {
|
|
3661
3661
|
M.ready().then(function() {
|
|
3662
3662
|
var S = M._dbInfo;
|
|
3663
3663
|
S.db.transaction(function(B) {
|
|
@@ -3670,14 +3670,14 @@ function Vh() {
|
|
|
3670
3670
|
});
|
|
3671
3671
|
}).catch(C);
|
|
3672
3672
|
});
|
|
3673
|
-
return p(
|
|
3673
|
+
return p(w, y), w;
|
|
3674
3674
|
}
|
|
3675
|
-
function xo(
|
|
3676
|
-
var
|
|
3677
|
-
|
|
3678
|
-
var B =
|
|
3675
|
+
function xo(y, M) {
|
|
3676
|
+
var w = this, T = new h(function(C, S) {
|
|
3677
|
+
w.ready().then(function() {
|
|
3678
|
+
var B = w._dbInfo;
|
|
3679
3679
|
B.db.transaction(function(z) {
|
|
3680
|
-
ht(z, B, "SELECT key FROM " + B.storeName + " WHERE id = ? LIMIT 1", [
|
|
3680
|
+
ht(z, B, "SELECT key FROM " + B.storeName + " WHERE id = ? LIMIT 1", [y + 1], function(N, j) {
|
|
3681
3681
|
var W = j.rows.length ? j.rows.item(0).key : null;
|
|
3682
3682
|
C(W);
|
|
3683
3683
|
}, function(N, j) {
|
|
@@ -3688,8 +3688,8 @@ function Vh() {
|
|
|
3688
3688
|
});
|
|
3689
3689
|
return p(T, M), T;
|
|
3690
3690
|
}
|
|
3691
|
-
function bo(
|
|
3692
|
-
var M = this,
|
|
3691
|
+
function bo(y) {
|
|
3692
|
+
var M = this, w = new h(function(T, C) {
|
|
3693
3693
|
M.ready().then(function() {
|
|
3694
3694
|
var S = M._dbInfo;
|
|
3695
3695
|
S.db.transaction(function(B) {
|
|
@@ -3703,36 +3703,36 @@ function Vh() {
|
|
|
3703
3703
|
});
|
|
3704
3704
|
}).catch(C);
|
|
3705
3705
|
});
|
|
3706
|
-
return p(
|
|
3706
|
+
return p(w, y), w;
|
|
3707
3707
|
}
|
|
3708
|
-
function Mo(
|
|
3709
|
-
return new h(function(M,
|
|
3710
|
-
|
|
3708
|
+
function Mo(y) {
|
|
3709
|
+
return new h(function(M, w) {
|
|
3710
|
+
y.transaction(function(T) {
|
|
3711
3711
|
T.executeSql("SELECT name FROM sqlite_master WHERE type='table' AND name <> '__WebKitDatabaseInfoTable__'", [], function(C, S) {
|
|
3712
3712
|
for (var B = [], z = 0; z < S.rows.length; z++)
|
|
3713
3713
|
B.push(S.rows.item(z).name);
|
|
3714
3714
|
M({
|
|
3715
|
-
db:
|
|
3715
|
+
db: y,
|
|
3716
3716
|
storeNames: B
|
|
3717
3717
|
});
|
|
3718
3718
|
}, function(C, S) {
|
|
3719
|
-
|
|
3719
|
+
w(S);
|
|
3720
3720
|
});
|
|
3721
3721
|
}, function(T) {
|
|
3722
|
-
|
|
3722
|
+
w(T);
|
|
3723
3723
|
});
|
|
3724
3724
|
});
|
|
3725
3725
|
}
|
|
3726
|
-
function So(
|
|
3726
|
+
function So(y, M) {
|
|
3727
3727
|
M = m.apply(this, arguments);
|
|
3728
|
-
var
|
|
3729
|
-
|
|
3728
|
+
var w = this.config();
|
|
3729
|
+
y = typeof y != "function" && y || {}, y.name || (y.name = y.name || w.name, y.storeName = y.storeName || w.storeName);
|
|
3730
3730
|
var T = this, C;
|
|
3731
|
-
return
|
|
3731
|
+
return y.name ? C = new h(function(S) {
|
|
3732
3732
|
var B;
|
|
3733
|
-
|
|
3733
|
+
y.name === w.name ? B = T._dbInfo.db : B = openDatabase(y.name, "", "", 0), y.storeName ? S({
|
|
3734
3734
|
db: B,
|
|
3735
|
-
storeNames: [
|
|
3735
|
+
storeNames: [y.storeName]
|
|
3736
3736
|
}) : S(Mo(B));
|
|
3737
3737
|
}).then(function(S) {
|
|
3738
3738
|
return new h(function(B, z) {
|
|
@@ -3781,14 +3781,14 @@ function Vh() {
|
|
|
3781
3781
|
return !1;
|
|
3782
3782
|
}
|
|
3783
3783
|
}
|
|
3784
|
-
function si(
|
|
3785
|
-
var
|
|
3786
|
-
return
|
|
3784
|
+
function si(y, M) {
|
|
3785
|
+
var w = y.name + "/";
|
|
3786
|
+
return y.storeName !== M.storeName && (w += y.storeName + "/"), w;
|
|
3787
3787
|
}
|
|
3788
3788
|
function Do() {
|
|
3789
|
-
var
|
|
3789
|
+
var y = "_localforage_support_test";
|
|
3790
3790
|
try {
|
|
3791
|
-
return localStorage.setItem(
|
|
3791
|
+
return localStorage.setItem(y, !0), localStorage.removeItem(y), !1;
|
|
3792
3792
|
} catch {
|
|
3793
3793
|
return !0;
|
|
3794
3794
|
}
|
|
@@ -3796,49 +3796,49 @@ function Vh() {
|
|
|
3796
3796
|
function Io() {
|
|
3797
3797
|
return !Do() || localStorage.length > 0;
|
|
3798
3798
|
}
|
|
3799
|
-
function Ao(
|
|
3800
|
-
var M = this,
|
|
3801
|
-
if (
|
|
3802
|
-
for (var T in
|
|
3803
|
-
|
|
3804
|
-
return
|
|
3799
|
+
function Ao(y) {
|
|
3800
|
+
var M = this, w = {};
|
|
3801
|
+
if (y)
|
|
3802
|
+
for (var T in y)
|
|
3803
|
+
w[T] = y[T];
|
|
3804
|
+
return w.keyPrefix = si(y, M._defaultConfig), Io() ? (M._dbInfo = w, w.serializer = Tt, h.resolve()) : h.reject();
|
|
3805
3805
|
}
|
|
3806
|
-
function Eo(
|
|
3807
|
-
var M = this,
|
|
3806
|
+
function Eo(y) {
|
|
3807
|
+
var M = this, w = M.ready().then(function() {
|
|
3808
3808
|
for (var T = M._dbInfo.keyPrefix, C = localStorage.length - 1; C >= 0; C--) {
|
|
3809
3809
|
var S = localStorage.key(C);
|
|
3810
3810
|
S.indexOf(T) === 0 && localStorage.removeItem(S);
|
|
3811
3811
|
}
|
|
3812
3812
|
});
|
|
3813
|
-
return p(
|
|
3813
|
+
return p(w, y), w;
|
|
3814
3814
|
}
|
|
3815
|
-
function Po(
|
|
3816
|
-
var
|
|
3817
|
-
|
|
3818
|
-
var T =
|
|
3819
|
-
var C =
|
|
3815
|
+
function Po(y, M) {
|
|
3816
|
+
var w = this;
|
|
3817
|
+
y = d(y);
|
|
3818
|
+
var T = w.ready().then(function() {
|
|
3819
|
+
var C = w._dbInfo, S = localStorage.getItem(C.keyPrefix + y);
|
|
3820
3820
|
return S && (S = C.serializer.deserialize(S)), S;
|
|
3821
3821
|
});
|
|
3822
3822
|
return p(T, M), T;
|
|
3823
3823
|
}
|
|
3824
|
-
function Oo(
|
|
3825
|
-
var
|
|
3826
|
-
for (var C =
|
|
3824
|
+
function Oo(y, M) {
|
|
3825
|
+
var w = this, T = w.ready().then(function() {
|
|
3826
|
+
for (var C = w._dbInfo, S = C.keyPrefix, B = S.length, z = localStorage.length, N = 1, j = 0; j < z; j++) {
|
|
3827
3827
|
var W = localStorage.key(j);
|
|
3828
3828
|
if (W.indexOf(S) === 0) {
|
|
3829
3829
|
var ee = localStorage.getItem(W);
|
|
3830
|
-
if (ee && (ee = C.serializer.deserialize(ee)), ee =
|
|
3830
|
+
if (ee && (ee = C.serializer.deserialize(ee)), ee = y(ee, W.substring(B), N++), ee !== void 0)
|
|
3831
3831
|
return ee;
|
|
3832
3832
|
}
|
|
3833
3833
|
}
|
|
3834
3834
|
});
|
|
3835
3835
|
return p(T, M), T;
|
|
3836
3836
|
}
|
|
3837
|
-
function Lo(
|
|
3838
|
-
var
|
|
3839
|
-
var C =
|
|
3837
|
+
function Lo(y, M) {
|
|
3838
|
+
var w = this, T = w.ready().then(function() {
|
|
3839
|
+
var C = w._dbInfo, S;
|
|
3840
3840
|
try {
|
|
3841
|
-
S = localStorage.key(
|
|
3841
|
+
S = localStorage.key(y);
|
|
3842
3842
|
} catch {
|
|
3843
3843
|
S = null;
|
|
3844
3844
|
}
|
|
@@ -3846,34 +3846,34 @@ function Vh() {
|
|
|
3846
3846
|
});
|
|
3847
3847
|
return p(T, M), T;
|
|
3848
3848
|
}
|
|
3849
|
-
function Bo(
|
|
3850
|
-
var M = this,
|
|
3849
|
+
function Bo(y) {
|
|
3850
|
+
var M = this, w = M.ready().then(function() {
|
|
3851
3851
|
for (var T = M._dbInfo, C = localStorage.length, S = [], B = 0; B < C; B++) {
|
|
3852
3852
|
var z = localStorage.key(B);
|
|
3853
3853
|
z.indexOf(T.keyPrefix) === 0 && S.push(z.substring(T.keyPrefix.length));
|
|
3854
3854
|
}
|
|
3855
3855
|
return S;
|
|
3856
3856
|
});
|
|
3857
|
-
return p(
|
|
3857
|
+
return p(w, y), w;
|
|
3858
3858
|
}
|
|
3859
|
-
function Fo(
|
|
3860
|
-
var M = this,
|
|
3859
|
+
function Fo(y) {
|
|
3860
|
+
var M = this, w = M.keys().then(function(T) {
|
|
3861
3861
|
return T.length;
|
|
3862
3862
|
});
|
|
3863
|
-
return p(
|
|
3863
|
+
return p(w, y), w;
|
|
3864
3864
|
}
|
|
3865
|
-
function ko(
|
|
3866
|
-
var
|
|
3867
|
-
|
|
3868
|
-
var T =
|
|
3869
|
-
var C =
|
|
3870
|
-
localStorage.removeItem(C.keyPrefix +
|
|
3865
|
+
function ko(y, M) {
|
|
3866
|
+
var w = this;
|
|
3867
|
+
y = d(y);
|
|
3868
|
+
var T = w.ready().then(function() {
|
|
3869
|
+
var C = w._dbInfo;
|
|
3870
|
+
localStorage.removeItem(C.keyPrefix + y);
|
|
3871
3871
|
});
|
|
3872
3872
|
return p(T, M), T;
|
|
3873
3873
|
}
|
|
3874
|
-
function zo(
|
|
3874
|
+
function zo(y, M, w) {
|
|
3875
3875
|
var T = this;
|
|
3876
|
-
|
|
3876
|
+
y = d(y);
|
|
3877
3877
|
var C = T.ready().then(function() {
|
|
3878
3878
|
M === void 0 && (M = null);
|
|
3879
3879
|
var S = M;
|
|
@@ -3884,23 +3884,23 @@ function Vh() {
|
|
|
3884
3884
|
z(W);
|
|
3885
3885
|
else
|
|
3886
3886
|
try {
|
|
3887
|
-
localStorage.setItem(N.keyPrefix +
|
|
3887
|
+
localStorage.setItem(N.keyPrefix + y, j), B(S);
|
|
3888
3888
|
} catch (ee) {
|
|
3889
3889
|
(ee.name === "QuotaExceededError" || ee.name === "NS_ERROR_DOM_QUOTA_REACHED") && z(ee), z(ee);
|
|
3890
3890
|
}
|
|
3891
3891
|
});
|
|
3892
3892
|
});
|
|
3893
3893
|
});
|
|
3894
|
-
return p(C,
|
|
3894
|
+
return p(C, w), C;
|
|
3895
3895
|
}
|
|
3896
|
-
function Ro(
|
|
3897
|
-
if (M = m.apply(this, arguments),
|
|
3898
|
-
var
|
|
3899
|
-
|
|
3896
|
+
function Ro(y, M) {
|
|
3897
|
+
if (M = m.apply(this, arguments), y = typeof y != "function" && y || {}, !y.name) {
|
|
3898
|
+
var w = this.config();
|
|
3899
|
+
y.name = y.name || w.name, y.storeName = y.storeName || w.storeName;
|
|
3900
3900
|
}
|
|
3901
3901
|
var T = this, C;
|
|
3902
|
-
return
|
|
3903
|
-
|
|
3902
|
+
return y.name ? C = new h(function(S) {
|
|
3903
|
+
y.storeName ? S(si(y, T._defaultConfig)) : S(y.name + "/");
|
|
3904
3904
|
}).then(function(S) {
|
|
3905
3905
|
for (var B = localStorage.length - 1; B >= 0; B--) {
|
|
3906
3906
|
var z = localStorage.key(B);
|
|
@@ -3921,17 +3921,17 @@ function Vh() {
|
|
|
3921
3921
|
key: Lo,
|
|
3922
3922
|
keys: Bo,
|
|
3923
3923
|
dropInstance: Ro
|
|
3924
|
-
}, Uo = function(M,
|
|
3925
|
-
return M ===
|
|
3926
|
-
}, jo = function(M,
|
|
3924
|
+
}, Uo = function(M, w) {
|
|
3925
|
+
return M === w || typeof M == "number" && typeof w == "number" && isNaN(M) && isNaN(w);
|
|
3926
|
+
}, jo = function(M, w) {
|
|
3927
3927
|
for (var T = M.length, C = 0; C < T; ) {
|
|
3928
|
-
if (Uo(M[C],
|
|
3928
|
+
if (Uo(M[C], w))
|
|
3929
3929
|
return !0;
|
|
3930
3930
|
C++;
|
|
3931
3931
|
}
|
|
3932
3932
|
return !1;
|
|
3933
|
-
}, ri = Array.isArray || function(
|
|
3934
|
-
return Object.prototype.toString.call(
|
|
3933
|
+
}, ri = Array.isArray || function(y) {
|
|
3934
|
+
return Object.prototype.toString.call(y) === "[object Array]";
|
|
3935
3935
|
}, Es = {}, ni = {}, ls = {
|
|
3936
3936
|
INDEXEDDB: Ds,
|
|
3937
3937
|
WEBSQL: To,
|
|
@@ -3946,56 +3946,56 @@ function Vh() {
|
|
|
3946
3946
|
storeName: "keyvaluepairs",
|
|
3947
3947
|
version: 1
|
|
3948
3948
|
};
|
|
3949
|
-
function Ho(
|
|
3950
|
-
|
|
3951
|
-
var
|
|
3952
|
-
return
|
|
3953
|
-
return
|
|
3949
|
+
function Ho(y, M) {
|
|
3950
|
+
y[M] = function() {
|
|
3951
|
+
var w = arguments;
|
|
3952
|
+
return y.ready().then(function() {
|
|
3953
|
+
return y[M].apply(y, w);
|
|
3954
3954
|
});
|
|
3955
3955
|
};
|
|
3956
3956
|
}
|
|
3957
3957
|
function Pr() {
|
|
3958
|
-
for (var
|
|
3959
|
-
var M = arguments[
|
|
3958
|
+
for (var y = 1; y < arguments.length; y++) {
|
|
3959
|
+
var M = arguments[y];
|
|
3960
3960
|
if (M)
|
|
3961
|
-
for (var
|
|
3962
|
-
M.hasOwnProperty(
|
|
3961
|
+
for (var w in M)
|
|
3962
|
+
M.hasOwnProperty(w) && (ri(M[w]) ? arguments[0][w] = M[w].slice() : arguments[0][w] = M[w]);
|
|
3963
3963
|
}
|
|
3964
3964
|
return arguments[0];
|
|
3965
3965
|
}
|
|
3966
3966
|
var Wo = (function() {
|
|
3967
|
-
function
|
|
3968
|
-
i(this,
|
|
3969
|
-
for (var
|
|
3970
|
-
if (ls.hasOwnProperty(
|
|
3971
|
-
var T = ls[
|
|
3972
|
-
this[
|
|
3967
|
+
function y(M) {
|
|
3968
|
+
i(this, y);
|
|
3969
|
+
for (var w in ls)
|
|
3970
|
+
if (ls.hasOwnProperty(w)) {
|
|
3971
|
+
var T = ls[w], C = T._driver;
|
|
3972
|
+
this[w] = C, Es[C] || this.defineDriver(T);
|
|
3973
3973
|
}
|
|
3974
3974
|
this._defaultConfig = Pr({}, Vo), this._config = Pr({}, this._defaultConfig, M), this._driverSet = null, this._initDriver = null, this._ready = !1, this._dbInfo = null, this._wrapLibraryMethodsWithReady(), this.setDriver(this._config.driver).catch(function() {
|
|
3975
3975
|
});
|
|
3976
3976
|
}
|
|
3977
|
-
return
|
|
3978
|
-
if ((typeof
|
|
3977
|
+
return y.prototype.config = function(w) {
|
|
3978
|
+
if ((typeof w > "u" ? "undefined" : n(w)) === "object") {
|
|
3979
3979
|
if (this._ready)
|
|
3980
3980
|
return new Error("Can't call config() after localforage has been used.");
|
|
3981
|
-
for (var T in
|
|
3982
|
-
if (T === "storeName" && (
|
|
3981
|
+
for (var T in w) {
|
|
3982
|
+
if (T === "storeName" && (w[T] = w[T].replace(/\W/g, "_")), T === "version" && typeof w[T] != "number")
|
|
3983
3983
|
return new Error("Database version must be a number.");
|
|
3984
|
-
this._config[T] =
|
|
3984
|
+
this._config[T] = w[T];
|
|
3985
3985
|
}
|
|
3986
|
-
return "driver" in
|
|
3987
|
-
} else return typeof
|
|
3988
|
-
},
|
|
3986
|
+
return "driver" in w && w.driver ? this.setDriver(this._config.driver) : !0;
|
|
3987
|
+
} else return typeof w == "string" ? this._config[w] : this._config;
|
|
3988
|
+
}, y.prototype.defineDriver = function(w, T, C) {
|
|
3989
3989
|
var S = new h(function(B, z) {
|
|
3990
3990
|
try {
|
|
3991
|
-
var N =
|
|
3992
|
-
if (!
|
|
3991
|
+
var N = w._driver, j = new Error("Custom driver not compliant; see https://mozilla.github.io/localForage/#definedriver");
|
|
3992
|
+
if (!w._driver) {
|
|
3993
3993
|
z(j);
|
|
3994
3994
|
return;
|
|
3995
3995
|
}
|
|
3996
3996
|
for (var W = Er.concat("_initStorage"), ee = 0, de = W.length; ee < de; ee++) {
|
|
3997
3997
|
var we = W[ee], xe = !jo(Js, we);
|
|
3998
|
-
if ((xe ||
|
|
3998
|
+
if ((xe || w[we]) && typeof w[we] != "function") {
|
|
3999
3999
|
z(j);
|
|
4000
4000
|
return;
|
|
4001
4001
|
}
|
|
@@ -4008,36 +4008,36 @@ function Vh() {
|
|
|
4008
4008
|
};
|
|
4009
4009
|
}, Or = 0, Ko = Js.length; Or < Ko; Or++) {
|
|
4010
4010
|
var Lr = Js[Or];
|
|
4011
|
-
|
|
4011
|
+
w[Lr] || (w[Lr] = Ps(Lr));
|
|
4012
4012
|
}
|
|
4013
4013
|
};
|
|
4014
4014
|
Ae();
|
|
4015
4015
|
var Te = function(Ps) {
|
|
4016
|
-
Es[N] && console.info("Redefining LocalForage driver: " + N), Es[N] =
|
|
4016
|
+
Es[N] && console.info("Redefining LocalForage driver: " + N), Es[N] = w, ni[N] = Ps, B();
|
|
4017
4017
|
};
|
|
4018
|
-
"_support" in
|
|
4018
|
+
"_support" in w ? w._support && typeof w._support == "function" ? w._support().then(Te, z) : Te(!!w._support) : Te(!0);
|
|
4019
4019
|
} catch (Qe) {
|
|
4020
4020
|
z(Qe);
|
|
4021
4021
|
}
|
|
4022
4022
|
});
|
|
4023
4023
|
return f(S, T, C), S;
|
|
4024
|
-
},
|
|
4024
|
+
}, y.prototype.driver = function() {
|
|
4025
4025
|
return this._driver || null;
|
|
4026
|
-
},
|
|
4027
|
-
var S = Es[
|
|
4026
|
+
}, y.prototype.getDriver = function(w, T, C) {
|
|
4027
|
+
var S = Es[w] ? h.resolve(Es[w]) : h.reject(new Error("Driver not found."));
|
|
4028
4028
|
return f(S, T, C), S;
|
|
4029
|
-
},
|
|
4029
|
+
}, y.prototype.getSerializer = function(w) {
|
|
4030
4030
|
var T = h.resolve(Tt);
|
|
4031
|
-
return f(T,
|
|
4032
|
-
},
|
|
4031
|
+
return f(T, w), T;
|
|
4032
|
+
}, y.prototype.ready = function(w) {
|
|
4033
4033
|
var T = this, C = T._driverSet.then(function() {
|
|
4034
4034
|
return T._ready === null && (T._ready = T._initDriver()), T._ready;
|
|
4035
4035
|
});
|
|
4036
|
-
return f(C,
|
|
4037
|
-
},
|
|
4036
|
+
return f(C, w, w), C;
|
|
4037
|
+
}, y.prototype.setDriver = function(w, T, C) {
|
|
4038
4038
|
var S = this;
|
|
4039
|
-
ri(
|
|
4040
|
-
var B = this._getSupportedDrivers(
|
|
4039
|
+
ri(w) || (w = [w]);
|
|
4040
|
+
var B = this._getSupportedDrivers(w);
|
|
4041
4041
|
function z() {
|
|
4042
4042
|
S._config.driver = S.driver();
|
|
4043
4043
|
}
|
|
@@ -4072,22 +4072,22 @@ function Vh() {
|
|
|
4072
4072
|
var ee = new Error("No available storage method found.");
|
|
4073
4073
|
return S._driverSet = h.reject(ee), S._driverSet;
|
|
4074
4074
|
}), f(this._driverSet, T, C), this._driverSet;
|
|
4075
|
-
},
|
|
4076
|
-
return !!ni[
|
|
4077
|
-
},
|
|
4078
|
-
Pr(this,
|
|
4079
|
-
},
|
|
4080
|
-
for (var T = [], C = 0, S =
|
|
4081
|
-
var B =
|
|
4075
|
+
}, y.prototype.supports = function(w) {
|
|
4076
|
+
return !!ni[w];
|
|
4077
|
+
}, y.prototype._extend = function(w) {
|
|
4078
|
+
Pr(this, w);
|
|
4079
|
+
}, y.prototype._getSupportedDrivers = function(w) {
|
|
4080
|
+
for (var T = [], C = 0, S = w.length; C < S; C++) {
|
|
4081
|
+
var B = w[C];
|
|
4082
4082
|
this.supports(B) && T.push(B);
|
|
4083
4083
|
}
|
|
4084
4084
|
return T;
|
|
4085
|
-
},
|
|
4086
|
-
for (var
|
|
4087
|
-
Ho(this, Er[
|
|
4088
|
-
},
|
|
4089
|
-
return new
|
|
4090
|
-
},
|
|
4085
|
+
}, y.prototype._wrapLibraryMethodsWithReady = function() {
|
|
4086
|
+
for (var w = 0, T = Er.length; w < T; w++)
|
|
4087
|
+
Ho(this, Er[w]);
|
|
4088
|
+
}, y.prototype.createInstance = function(w) {
|
|
4089
|
+
return new y(w);
|
|
4090
|
+
}, y;
|
|
4091
4091
|
})(), qo = new Wo();
|
|
4092
4092
|
s.exports = qo;
|
|
4093
4093
|
}, { 3: 3 }] }, {}, [4])(4);
|
|
@@ -4210,43 +4210,43 @@ class qh {
|
|
|
4210
4210
|
});
|
|
4211
4211
|
f.material = d, p.add(f);
|
|
4212
4212
|
let m = null;
|
|
4213
|
-
const
|
|
4214
|
-
const
|
|
4215
|
-
if ((l ? h.children[0] : h).traverse((
|
|
4216
|
-
if (
|
|
4217
|
-
const
|
|
4218
|
-
|
|
4213
|
+
const g = () => {
|
|
4214
|
+
const v = [];
|
|
4215
|
+
if ((l ? h.children[0] : h).traverse((x) => {
|
|
4216
|
+
if (x.type === "Mesh" && x instanceof ye) {
|
|
4217
|
+
const b = new lc(
|
|
4218
|
+
x.geometry,
|
|
4219
4219
|
89
|
|
4220
4220
|
);
|
|
4221
|
-
|
|
4222
|
-
const A =
|
|
4223
|
-
|
|
4221
|
+
x.updateWorldMatrix(!0, !1);
|
|
4222
|
+
const A = x.matrixWorld.clone().premultiply(h.matrixWorld.clone().invert());
|
|
4223
|
+
b.applyMatrix4(A), v.push(b);
|
|
4224
4224
|
}
|
|
4225
|
-
}),
|
|
4226
|
-
return ul(
|
|
4225
|
+
}), v.length !== 0)
|
|
4226
|
+
return ul(v);
|
|
4227
4227
|
};
|
|
4228
4228
|
if (c && h instanceof Dt && h.sid) {
|
|
4229
|
-
const
|
|
4229
|
+
const v = `${h.sid}_stroke`;
|
|
4230
4230
|
await this.strokeStore.ready();
|
|
4231
|
-
const
|
|
4232
|
-
if (
|
|
4231
|
+
const x = await this.strokeStore.getItem(v);
|
|
4232
|
+
if (x)
|
|
4233
4233
|
m = new Ie(), m.setAttribute(
|
|
4234
4234
|
"position",
|
|
4235
|
-
new me(
|
|
4235
|
+
new me(x, 3)
|
|
4236
4236
|
);
|
|
4237
4237
|
else {
|
|
4238
|
-
const
|
|
4239
|
-
if (
|
|
4240
|
-
m =
|
|
4241
|
-
const A =
|
|
4238
|
+
const b = g();
|
|
4239
|
+
if (b) {
|
|
4240
|
+
m = b;
|
|
4241
|
+
const A = b.getAttribute(
|
|
4242
4242
|
"position"
|
|
4243
4243
|
);
|
|
4244
|
-
A.array instanceof Float32Array && this.strokeStore.setItem(
|
|
4244
|
+
A.array instanceof Float32Array && this.strokeStore.setItem(v, A.array.buffer);
|
|
4245
4245
|
}
|
|
4246
4246
|
}
|
|
4247
4247
|
} else {
|
|
4248
|
-
const
|
|
4249
|
-
|
|
4248
|
+
const v = g();
|
|
4249
|
+
v && (m = v);
|
|
4250
4250
|
}
|
|
4251
4251
|
if (m !== null)
|
|
4252
4252
|
return f.geometry = m, h.userData.strokeGroup = p, h.userData.strokeOptions = t, this.addObject(p, h), this.selectedObjects.stroke.add(h), s && this.opacityShow(l ? h.children[0] : h, {
|
|
@@ -4410,8 +4410,8 @@ class Kh {
|
|
|
4410
4410
|
us.setFromMatrixPosition(p.matrixWorld), us.applyMatrix4(bi);
|
|
4411
4411
|
const d = Qs(p) && us.z >= -1 && us.z <= 1 && p.layers.test(h.layers) === !0;
|
|
4412
4412
|
if (p.userData.prevVisible !== d && (f.onChange?.(d), f.elementAutoDisplay && (p.element.style.display = d === !0 ? "" : "none")), p.userData.prevVisible = d, d === !0 || f.elementAutoDisplay === !1) {
|
|
4413
|
-
const
|
|
4414
|
-
|
|
4413
|
+
const g = p.element;
|
|
4414
|
+
g.style.transform = "translate(-50%,-50%) translate(" + (us.x * r + r) + "px," + (-us.y * n + n) + "px)", g.parentNode !== this.domElement && this.domElement.appendChild(g);
|
|
4415
4415
|
}
|
|
4416
4416
|
const m = {
|
|
4417
4417
|
distanceToCameraSquared: c(h, p)
|
|
@@ -4426,8 +4426,8 @@ class Kh {
|
|
|
4426
4426
|
const h = u.sort(function(f, d) {
|
|
4427
4427
|
if (f.renderOrder !== d.renderOrder)
|
|
4428
4428
|
return d.renderOrder - f.renderOrder;
|
|
4429
|
-
const m = i.objects.get(f).distanceToCameraSquared,
|
|
4430
|
-
return m -
|
|
4429
|
+
const m = i.objects.get(f).distanceToCameraSquared, g = i.objects.get(d).distanceToCameraSquared;
|
|
4430
|
+
return m - g;
|
|
4431
4431
|
}), p = h.length;
|
|
4432
4432
|
for (let f = 0, d = h.length; f < d; f++)
|
|
4433
4433
|
h[f].element.style.zIndex = `${p - f}`;
|
|
@@ -4482,11 +4482,11 @@ class Yh {
|
|
|
4482
4482
|
}), this.render = (f, d) => {
|
|
4483
4483
|
const m = d.projectionMatrix.elements[5] * n;
|
|
4484
4484
|
d.view && d.view.enabled ? (o.style.transform = `translate( ${-d.view.offsetX * (t / d.view.width)}px, ${-d.view.offsetY * (s / d.view.height)}px )`, o.style.transform += `scale( ${d.view.fullWidth / d.view.width}, ${d.view.fullHeight / d.view.height} )`) : o.style.transform = "", d.parent === null && d.matrixWorldAutoUpdate === !0 && d.updateMatrixWorld();
|
|
4485
|
-
let
|
|
4486
|
-
d instanceof es && (
|
|
4487
|
-
const
|
|
4485
|
+
let g = 0, v = 0;
|
|
4486
|
+
d instanceof es && (g = -(d.right + d.left) / 2, v = (d.top + d.bottom) / 2);
|
|
4487
|
+
const x = d.view && d.view.enabled ? d.view.height / d.view.fullHeight : 1, b = d instanceof es ? `scale( ${x} )scale(` + m + ")translate(" + l(g) + "px," + l(v) + "px)" + u(d.matrixWorldInverse) : `scale( ${x} )translateZ(` + m + "px)" + u(d.matrixWorldInverse), D = (d instanceof Mr ? "perspective(" + m + "px) " : "") + b + "translate(" + r + "px," + n + "px)";
|
|
4488
4488
|
i.camera.style !== D && (c.style.transform = D, i.camera.style = D);
|
|
4489
|
-
const E = [...f].filter((
|
|
4489
|
+
const E = [...f].filter((O) => Zn(O.elementType) || _n(O.elementType)).map((O) => O.children[0]);
|
|
4490
4490
|
p(E, d);
|
|
4491
4491
|
}, this.setSize = (f, d) => {
|
|
4492
4492
|
t = f, s = d, r = t / 2, n = s / 2, this.domElement.style.width = f + "px", this.domElement.style.height = d + "px", o.style.width = f + "px", o.style.height = d + "px", c.style.width = f + "px", c.style.height = d + "px";
|
|
@@ -4506,17 +4506,17 @@ class Yh {
|
|
|
4506
4506
|
f.forEach((m) => {
|
|
4507
4507
|
if (m instanceof Zs) {
|
|
4508
4508
|
zn(m, this.viewport);
|
|
4509
|
-
const
|
|
4510
|
-
if (m.userData.prevVisible !==
|
|
4511
|
-
let
|
|
4512
|
-
m instanceof Va ? (pt.copy(d.matrixWorldInverse), pt.transpose(), m.rotation2D !== 0 && pt.multiply(Qh.makeRotationZ(m.rotation2D)), m.matrixWorld.decompose(Ti, Xh, Ci), pt.setPosition(Ti), pt.scale(Ci), pt.elements[3] = 0, pt.elements[7] = 0, pt.elements[11] = 0, pt.elements[15] = 1,
|
|
4513
|
-
const
|
|
4514
|
-
if (A === void 0 || A.style !==
|
|
4515
|
-
|
|
4516
|
-
const D = { style:
|
|
4509
|
+
const g = m.parent, v = Qs(m) && m.layers.test(d.layers) === !0;
|
|
4510
|
+
if (m.userData.prevVisible !== v && (g.onChange?.(v), g.elementAutoDisplay && (m.element.style.display = v === !0 ? "" : "none")), m.userData.prevVisible = v, v === !0 || g.elementAutoDisplay === !1) {
|
|
4511
|
+
let x;
|
|
4512
|
+
m instanceof Va ? (pt.copy(d.matrixWorldInverse), pt.transpose(), m.rotation2D !== 0 && pt.multiply(Qh.makeRotationZ(m.rotation2D)), m.matrixWorld.decompose(Ti, Xh, Ci), pt.setPosition(Ti), pt.scale(Ci), pt.elements[3] = 0, pt.elements[7] = 0, pt.elements[11] = 0, pt.elements[15] = 1, x = h(pt)) : x = h(m.matrixWorld);
|
|
4513
|
+
const b = m.element, A = i.objects.get(m);
|
|
4514
|
+
if (A === void 0 || A.style !== x) {
|
|
4515
|
+
b.style.transform = x;
|
|
4516
|
+
const D = { style: x };
|
|
4517
4517
|
i.objects.set(m, D);
|
|
4518
4518
|
}
|
|
4519
|
-
|
|
4519
|
+
b.parentNode !== c && c.appendChild(b);
|
|
4520
4520
|
}
|
|
4521
4521
|
}
|
|
4522
4522
|
});
|
|
@@ -4698,8 +4698,8 @@ class eu {
|
|
|
4698
4698
|
const p = Ha[t.toLocaleUpperCase()];
|
|
4699
4699
|
let f = p.theta, d = p.phi;
|
|
4700
4700
|
if (i === "local" && e instanceof De) {
|
|
4701
|
-
const m = new I(0, 0, 1),
|
|
4702
|
-
m.applyQuaternion(
|
|
4701
|
+
const m = new I(0, 0, 1), g = e.getWorldQuaternion(new he()), v = new ke();
|
|
4702
|
+
m.applyQuaternion(g), v.setFromVector3(m), v.phi -= Math.PI / 2, f = p.theta + v.theta, d = p.phi + v.phi;
|
|
4703
4703
|
}
|
|
4704
4704
|
h.push(u.rotateTo(f, d, n));
|
|
4705
4705
|
} else {
|
|
@@ -6251,8 +6251,8 @@ class hu {
|
|
|
6251
6251
|
if (e.attributes.position instanceof vc ? e.attributes.position.data.array = f : e.attributes.position instanceof qe && (e.attributes.position.array = f), e.index)
|
|
6252
6252
|
e.index.array = p.index;
|
|
6253
6253
|
else {
|
|
6254
|
-
const
|
|
6255
|
-
e.setIndex(
|
|
6254
|
+
const g = new qe(p.index, 1, !1);
|
|
6255
|
+
e.setIndex(g);
|
|
6256
6256
|
}
|
|
6257
6257
|
m.setBoundingBox && (e.boundingBox = d.getBoundingBox(new wt())), o(r, d);
|
|
6258
6258
|
} else t.onProgress && t.onProgress(h.progress);
|
|
@@ -6326,31 +6326,31 @@ class pu {
|
|
|
6326
6326
|
if (m && !s)
|
|
6327
6327
|
return c.set(f, m), m;
|
|
6328
6328
|
if (!s && this.computedGeometriesUuid.has(f)) {
|
|
6329
|
-
const
|
|
6330
|
-
return c.set(f,
|
|
6329
|
+
const b = Promise.resolve();
|
|
6330
|
+
return c.set(f, b), b;
|
|
6331
6331
|
}
|
|
6332
|
-
const
|
|
6332
|
+
const g = () => {
|
|
6333
6333
|
if (this.disposed) throw this._createAbortError();
|
|
6334
6334
|
this.computedGeometriesUuid.set(f, f);
|
|
6335
6335
|
};
|
|
6336
|
-
let
|
|
6336
|
+
let v;
|
|
6337
6337
|
if (m)
|
|
6338
|
-
|
|
6338
|
+
v = m.catch(() => {
|
|
6339
6339
|
}).then(() => {
|
|
6340
6340
|
if (this.disposed) throw this._createAbortError();
|
|
6341
6341
|
return p(h);
|
|
6342
|
-
}).then(
|
|
6342
|
+
}).then(g);
|
|
6343
6343
|
else
|
|
6344
6344
|
try {
|
|
6345
|
-
|
|
6346
|
-
} catch (
|
|
6347
|
-
|
|
6345
|
+
v = p(h).then(g);
|
|
6346
|
+
} catch (b) {
|
|
6347
|
+
v = Promise.reject(b);
|
|
6348
6348
|
}
|
|
6349
|
-
c.set(f,
|
|
6350
|
-
const
|
|
6351
|
-
this.inFlightGeometryBuilds.get(f) ===
|
|
6349
|
+
c.set(f, v), this.inFlightGeometryBuilds.set(f, v);
|
|
6350
|
+
const x = () => {
|
|
6351
|
+
this.inFlightGeometryBuilds.get(f) === v && this.inFlightGeometryBuilds.delete(f);
|
|
6352
6352
|
};
|
|
6353
|
-
return
|
|
6353
|
+
return v.then(x, x), v;
|
|
6354
6354
|
};
|
|
6355
6355
|
if (t === "block")
|
|
6356
6356
|
return Promise.all(o.map((h) => l(h))).then(() => {
|
|
@@ -6358,32 +6358,32 @@ class pu {
|
|
|
6358
6358
|
if (t === "slice")
|
|
6359
6359
|
return new Promise((h, p) => {
|
|
6360
6360
|
let f = 0;
|
|
6361
|
-
const d = [], m = (
|
|
6362
|
-
this.sliceRejectors.delete(m), p(
|
|
6361
|
+
const d = [], m = (v) => {
|
|
6362
|
+
this.sliceRejectors.delete(m), p(v);
|
|
6363
6363
|
};
|
|
6364
6364
|
this.sliceRejectors.add(m);
|
|
6365
|
-
const
|
|
6365
|
+
const g = () => {
|
|
6366
6366
|
if (this.disposed) {
|
|
6367
6367
|
m(this._createAbortError());
|
|
6368
6368
|
return;
|
|
6369
6369
|
}
|
|
6370
6370
|
if (this.cameraChanging) {
|
|
6371
|
-
this._requestFrame(
|
|
6371
|
+
this._requestFrame(g);
|
|
6372
6372
|
return;
|
|
6373
6373
|
}
|
|
6374
|
-
const
|
|
6375
|
-
let
|
|
6376
|
-
for (; f < o.length &&
|
|
6377
|
-
d.push(l(o[f])), f += 1,
|
|
6374
|
+
const v = performance.now();
|
|
6375
|
+
let x = 0;
|
|
6376
|
+
for (; f < o.length && x < i && (x === 0 || performance.now() - v < du); )
|
|
6377
|
+
d.push(l(o[f])), f += 1, x += 1;
|
|
6378
6378
|
if (f >= o.length) {
|
|
6379
6379
|
Promise.all(d).then(() => {
|
|
6380
6380
|
this.sliceRejectors.delete(m), h();
|
|
6381
6381
|
}, m);
|
|
6382
6382
|
return;
|
|
6383
6383
|
}
|
|
6384
|
-
this._requestFrame(
|
|
6384
|
+
this._requestFrame(g);
|
|
6385
6385
|
};
|
|
6386
|
-
o.length === 0 ? (this.sliceRejectors.delete(m), h()) : this._requestFrame(
|
|
6386
|
+
o.length === 0 ? (this.sliceRejectors.delete(m), h()) : this._requestFrame(g);
|
|
6387
6387
|
});
|
|
6388
6388
|
if (!n) return Promise.reject(new Error("请设置 workerCreator"));
|
|
6389
6389
|
this.generateMeshBVHWorker.workerPool.setWorkerCreator(n);
|
|
@@ -6489,9 +6489,9 @@ class gu {
|
|
|
6489
6489
|
_triggerSceneEventInAllObject(e, t, s = this.viewport.scener.intersectsList.getAll()) {
|
|
6490
6490
|
const r = this.viewport.getIntersects(t, s);
|
|
6491
6491
|
if (r.length === 0) {
|
|
6492
|
-
this.hoverSelectMap.forEach((m,
|
|
6493
|
-
const
|
|
6494
|
-
|
|
6492
|
+
this.hoverSelectMap.forEach((m, g) => {
|
|
6493
|
+
const v = Xr(g), x = this.signals[`${v}Hover`];
|
|
6494
|
+
x && x.numListeners > 0 && sr(this.signals, `${v}UnHover`).dispatch(m);
|
|
6495
6495
|
}), this.hoverSelectMap.clear(), e === "click" && this.signals.sceneClick.dispatch({
|
|
6496
6496
|
type: e,
|
|
6497
6497
|
event: t
|
|
@@ -6504,25 +6504,25 @@ class gu {
|
|
|
6504
6504
|
point: null
|
|
6505
6505
|
}, i = /* @__PURE__ */ new Map();
|
|
6506
6506
|
r.forEach((m) => {
|
|
6507
|
-
const
|
|
6508
|
-
if (!
|
|
6509
|
-
const
|
|
6510
|
-
n.object || (n.type =
|
|
6511
|
-
const
|
|
6512
|
-
|
|
6507
|
+
const g = mu(m.object, this.eventExcludeStypes);
|
|
6508
|
+
if (!g) return;
|
|
6509
|
+
const v = g.stype;
|
|
6510
|
+
n.object || (n.type = v, n.object = m.object, n.point = m.point);
|
|
6511
|
+
const x = i.get(v) || [];
|
|
6512
|
+
x.some((b) => b.target.uuid === g.uuid) || x.push({ target: g, sourceData: m }), i.set(v, x);
|
|
6513
6513
|
}), e === "click" && n.point && this.signals.selectPosition.dispatch(n.point);
|
|
6514
|
-
const o = e.slice(0, 1).toUpperCase() + e.slice(1), c = (m,
|
|
6514
|
+
const o = e.slice(0, 1).toUpperCase() + e.slice(1), c = (m, g, v) => {
|
|
6515
6515
|
if (!m) return;
|
|
6516
6516
|
if (o === "Hover") {
|
|
6517
|
-
this.hoverSelectMap.get(m.stype)?.uuid !== m.uuid && (sr(this.signals,
|
|
6517
|
+
this.hoverSelectMap.get(m.stype)?.uuid !== m.uuid && (sr(this.signals, g).dispatch(v), this.hoverSelectMap.set(m.stype, m));
|
|
6518
6518
|
return;
|
|
6519
6519
|
}
|
|
6520
|
-
const
|
|
6521
|
-
|
|
6520
|
+
const x = m[`on${o}`];
|
|
6521
|
+
x ? x(m) : m.isEventPropagation = !0, m.isEventPropagation && (sr(this.signals, g).dispatch(v), m.isEventPropagation = !1), e !== "hover" && m.dispatchEvent({ type: e });
|
|
6522
6522
|
};
|
|
6523
|
-
o === "Hover" && this.hoverSelectMap.forEach((m,
|
|
6524
|
-
const
|
|
6525
|
-
|
|
6523
|
+
o === "Hover" && this.hoverSelectMap.forEach((m, g) => {
|
|
6524
|
+
const v = Xr(g), x = i.get(g);
|
|
6525
|
+
x && x.length > 0 ? m.uuid !== x[0].target.uuid && (sr(this.signals, `${v}UnHover`).dispatch(m), this.hoverSelectMap.delete(g)) : (this.signals[`${v}UnHover`]?.dispatch(m), this.hoverSelectMap.delete(g));
|
|
6526
6526
|
});
|
|
6527
6527
|
const l = n.type;
|
|
6528
6528
|
if (!l) return;
|
|
@@ -6701,7 +6701,7 @@ class Mu {
|
|
|
6701
6701
|
this.container.appendChild(n("objects", !1)), this.container.appendChild(o), this.container.appendChild(i()), this.container.appendChild(n("meshes", !1)), this.container.appendChild(c), this.container.appendChild(i()), this.container.appendChild(n("vertices", !1)), this.container.appendChild(u), this.container.appendChild(i()), this.container.appendChild(n("triangles", !1)), this.container.appendChild(l), this.container.appendChild(i()), this.container.appendChild(n("frametime", !1)), this.container.appendChild(h), this.container.appendChild(i());
|
|
6702
6702
|
const p = /* @__PURE__ */ new Map(), f = /* @__PURE__ */ new Map([[e, new Set(e.children)]]), d = /* @__PURE__ */ new Map();
|
|
6703
6703
|
let m = /* @__PURE__ */ new WeakMap();
|
|
6704
|
-
const
|
|
6704
|
+
const g = (F) => {
|
|
6705
6705
|
const P = F.attributes.position, Q = F.index, R = [
|
|
6706
6706
|
P,
|
|
6707
6707
|
P?.count,
|
|
@@ -6711,17 +6711,17 @@ class Mu {
|
|
|
6711
6711
|
Q?.version,
|
|
6712
6712
|
F.drawRange.start,
|
|
6713
6713
|
F.drawRange.count
|
|
6714
|
-
],
|
|
6715
|
-
if (
|
|
6714
|
+
], L = m.get(F);
|
|
6715
|
+
if (L?.key.every((H, _) => H === R[_])) return L.value;
|
|
6716
6716
|
const K = wu(F);
|
|
6717
6717
|
return m.set(F, { key: R, value: K }), K;
|
|
6718
|
-
},
|
|
6718
|
+
}, v = () => {
|
|
6719
6719
|
r() || this.renderStateFrame !== null || (this.renderStateFrame = requestAnimationFrame(() => {
|
|
6720
6720
|
r() || (this.renderStateFrame = null, o.textContent = `${Math.trunc(this.state.objects)}`, c.textContent = `${Math.trunc(this.state.meshes)}`, u.textContent = `${Math.trunc(this.state.vertices)}`, l.textContent = `${Math.trunc(this.state.triangles)}`);
|
|
6721
6721
|
}));
|
|
6722
|
-
}, b = (F, P) => {
|
|
6723
|
-
this.state.objects += P * F.objects, this.state.meshes += P * F.meshes, this.state.vertices += P * F.vertices, this.state.triangles += P * F.triangles;
|
|
6724
6722
|
}, x = (F, P) => {
|
|
6723
|
+
this.state.objects += P * F.objects, this.state.meshes += P * F.meshes, this.state.vertices += P * F.vertices, this.state.triangles += P * F.triangles;
|
|
6724
|
+
}, b = (F, P) => {
|
|
6725
6725
|
if (!P) return;
|
|
6726
6726
|
const Q = d.get(P);
|
|
6727
6727
|
Q?.delete(F), Q?.size || d.delete(P);
|
|
@@ -6730,12 +6730,12 @@ class Mu {
|
|
|
6730
6730
|
const P = p.get(F);
|
|
6731
6731
|
if (!P) return;
|
|
6732
6732
|
const Q = Di(F);
|
|
6733
|
-
if (P.geometry !== Q && (
|
|
6734
|
-
const
|
|
6735
|
-
|
|
6733
|
+
if (P.geometry !== Q && (b(F, P.geometry), P.geometry = Q, Q)) {
|
|
6734
|
+
const L = d.get(Q) ?? /* @__PURE__ */ new Set();
|
|
6735
|
+
L.add(F), d.set(Q, L);
|
|
6736
6736
|
}
|
|
6737
|
-
const R = bu(F,
|
|
6738
|
-
r() || p.get(F) !== P || (
|
|
6737
|
+
const R = bu(F, g);
|
|
6738
|
+
r() || p.get(F) !== P || (x(P.contribution, -1), P.contribution = R, x(P.contribution, 1), v());
|
|
6739
6739
|
}, D = (F) => {
|
|
6740
6740
|
if (r() || F !== e && !p.has(F)) return;
|
|
6741
6741
|
const P = f.get(F) ?? /* @__PURE__ */ new Set(), Q = new Set(F.children);
|
|
@@ -6752,7 +6752,7 @@ class Mu {
|
|
|
6752
6752
|
const Q = f.get(this) ?? /* @__PURE__ */ new Set();
|
|
6753
6753
|
Q.add(P), f.set(this, Q), k(P, 1, !0);
|
|
6754
6754
|
}
|
|
6755
|
-
function
|
|
6755
|
+
function O(F) {
|
|
6756
6756
|
if (r() || this !== e && !p.has(this)) return;
|
|
6757
6757
|
const P = F.child;
|
|
6758
6758
|
if (!P) return D(this);
|
|
@@ -6762,36 +6762,36 @@ class Mu {
|
|
|
6762
6762
|
if (r() || p.has(F) === (P === 1)) return;
|
|
6763
6763
|
let R = F;
|
|
6764
6764
|
for (; R && R !== e; ) R = R.parent;
|
|
6765
|
-
(P === 1 ? R !== e && !Q : R === e) || (F.traverse((
|
|
6765
|
+
(P === 1 ? R !== e && !Q : R === e) || (F.traverse((L) => {
|
|
6766
6766
|
if (!r())
|
|
6767
6767
|
if (P === 1) {
|
|
6768
|
-
if (p.has(
|
|
6769
|
-
p.set(
|
|
6768
|
+
if (p.has(L)) return;
|
|
6769
|
+
p.set(L, {
|
|
6770
6770
|
contribution: { objects: 0, meshes: 0, vertices: 0, triangles: 0 },
|
|
6771
|
-
unobserve: vu(
|
|
6772
|
-
}),
|
|
6771
|
+
unobserve: vu(L, () => A(L))
|
|
6772
|
+
}), L.children.length && f.set(L, new Set(L.children)), L.addEventListener("childadded", E), L.addEventListener("childremoved", O), A(L);
|
|
6773
6773
|
} else {
|
|
6774
|
-
const K = p.get(
|
|
6774
|
+
const K = p.get(L);
|
|
6775
6775
|
if (!K) return;
|
|
6776
|
-
|
|
6776
|
+
x(K.contribution, -1), b(L, K.geometry), K.unobserve(), p.delete(L), f.delete(L), L.removeEventListener("childadded", E), L.removeEventListener("childremoved", O);
|
|
6777
6777
|
}
|
|
6778
|
-
}),
|
|
6778
|
+
}), v());
|
|
6779
6779
|
}, U = (F) => {
|
|
6780
6780
|
if (r()) return;
|
|
6781
6781
|
if (!F || F === e) {
|
|
6782
|
-
m = /* @__PURE__ */ new WeakMap(), p.forEach((R,
|
|
6782
|
+
m = /* @__PURE__ */ new WeakMap(), p.forEach((R, L) => A(L));
|
|
6783
6783
|
return;
|
|
6784
6784
|
}
|
|
6785
6785
|
const P = /* @__PURE__ */ new Set(), Q = /* @__PURE__ */ new Set();
|
|
6786
6786
|
for (const R of Array.isArray(F) ? F : [F])
|
|
6787
|
-
R instanceof Ie ? Q.add(R) : p.has(R) && R.traverse((
|
|
6788
|
-
if (!p.has(
|
|
6789
|
-
P.add(
|
|
6790
|
-
const K = Di(
|
|
6787
|
+
R instanceof Ie ? Q.add(R) : p.has(R) && R.traverse((L) => {
|
|
6788
|
+
if (!p.has(L)) return;
|
|
6789
|
+
P.add(L);
|
|
6790
|
+
const K = Di(L);
|
|
6791
6791
|
K && Q.add(K);
|
|
6792
6792
|
});
|
|
6793
6793
|
Q.forEach((R) => {
|
|
6794
|
-
m.delete(R), d.get(R)?.forEach((
|
|
6794
|
+
m.delete(R), d.get(R)?.forEach((L) => P.add(L));
|
|
6795
6795
|
}), P.forEach(A);
|
|
6796
6796
|
}, q = (F) => {
|
|
6797
6797
|
if (!F || F === e) return U();
|
|
@@ -6800,9 +6800,9 @@ class Mu {
|
|
|
6800
6800
|
if (!F || F === e) return U();
|
|
6801
6801
|
k(F, -1);
|
|
6802
6802
|
};
|
|
6803
|
-
e.addEventListener("childadded", E), e.addEventListener("childremoved",
|
|
6804
|
-
s = !0, e.removeEventListener("childadded", E), e.removeEventListener("childremoved",
|
|
6805
|
-
F.unobserve(), P.removeEventListener("childadded", E), P.removeEventListener("childremoved",
|
|
6803
|
+
e.addEventListener("childadded", E), e.addEventListener("childremoved", O), t.objectAdded.add(q), t.objectRemoved.add(J), t.geometryChanged.add(U), e.children.forEach((F) => k(F, 1)), v(), this.cleanups.push(() => {
|
|
6804
|
+
s = !0, e.removeEventListener("childadded", E), e.removeEventListener("childremoved", O), t.objectAdded.remove(q), t.objectRemoved.remove(J), t.geometryChanged.remove(U), p.forEach((F, P) => {
|
|
6805
|
+
F.unobserve(), P.removeEventListener("childadded", E), P.removeEventListener("childremoved", O);
|
|
6806
6806
|
}), p.clear(), f.clear(), d.clear(), m = /* @__PURE__ */ new WeakMap();
|
|
6807
6807
|
});
|
|
6808
6808
|
const $ = (F) => {
|
|
@@ -6819,23 +6819,23 @@ class Su extends De {
|
|
|
6819
6819
|
super(), this.camera = e, this.controls = s;
|
|
6820
6820
|
const r = new ce("#ff3653"), n = new ce("#8adb00"), i = new ce("#2c8fff"), o = new ce("#000000"), c = {}, l = [], u = new Xs(), h = new oe(), p = new es(-2, 2, 2, -2, 0, 4);
|
|
6821
6821
|
p.position.set(0, 0, 2);
|
|
6822
|
-
const f = new wc(0.8, 0.05, 0.05).translate(0.4, 0, 0), d = new ye(f, P(r)), m = new ye(f, P(n)),
|
|
6823
|
-
m.rotation.z = Math.PI / 2,
|
|
6824
|
-
const
|
|
6825
|
-
D.userData.type = "right", E.userData.type = "top",
|
|
6822
|
+
const f = new wc(0.8, 0.05, 0.05).translate(0.4, 0, 0), d = new ye(f, P(r)), m = new ye(f, P(n)), g = new ye(f, P(i));
|
|
6823
|
+
m.rotation.z = Math.PI / 2, g.rotation.y = -Math.PI / 2, this.add(d), this.add(g), this.add(m);
|
|
6824
|
+
const v = Q(r), x = Q(n), b = Q(i), A = Q(o), D = new Yt(v), E = new Yt(x), O = new Yt(b), k = new Yt(A), U = new Yt(A), q = new Yt(A);
|
|
6825
|
+
D.userData.type = "right", E.userData.type = "top", O.userData.type = "front", k.userData.type = "left", U.userData.type = "bottom", q.userData.type = "back", D.position.x = 1, E.position.y = 1, O.position.z = 1, k.position.x = -1, k.scale.setScalar(0.8), U.position.y = -1, U.scale.setScalar(0.8), q.position.z = -1, q.scale.setScalar(0.8), this.add(D), this.add(E), this.add(O), this.add(k), this.add(U), this.add(q), l.push(D), l.push(E), l.push(O), l.push(k), l.push(U), l.push(q);
|
|
6826
6826
|
const J = new I(), $ = new xr(), F = 128;
|
|
6827
|
-
this.setLabels = function(
|
|
6828
|
-
c.labelX =
|
|
6829
|
-
}, this.setLabelStyle = function(
|
|
6830
|
-
c.font =
|
|
6831
|
-
}, this.render = function(
|
|
6832
|
-
this.quaternion.copy(this.camera.quaternion).invert(), this.updateMatrixWorld(), J.set(0, 0, 1), J.applyQuaternion(this.camera.quaternion), J.x >= 0 ? (D.material.opacity = 1, k.material.opacity = 0.5) : (D.material.opacity = 0.5, k.material.opacity = 1), J.y >= 0 ? (E.material.opacity = 1, U.material.opacity = 0.5) : (E.material.opacity = 0.5, U.material.opacity = 1), J.z >= 0 ? (
|
|
6827
|
+
this.setLabels = function(L, K, H) {
|
|
6828
|
+
c.labelX = L, c.labelY = K, c.labelZ = H, R();
|
|
6829
|
+
}, this.setLabelStyle = function(L, K, H) {
|
|
6830
|
+
c.font = L, c.color = K, c.radius = H, R();
|
|
6831
|
+
}, this.render = function(L) {
|
|
6832
|
+
this.quaternion.copy(this.camera.quaternion).invert(), this.updateMatrixWorld(), J.set(0, 0, 1), J.applyQuaternion(this.camera.quaternion), J.x >= 0 ? (D.material.opacity = 1, k.material.opacity = 0.5) : (D.material.opacity = 0.5, k.material.opacity = 1), J.y >= 0 ? (E.material.opacity = 1, U.material.opacity = 0.5) : (E.material.opacity = 0.5, U.material.opacity = 1), J.z >= 0 ? (O.material.opacity = 1, q.material.opacity = 0.5) : (O.material.opacity = 0.5, q.material.opacity = 1);
|
|
6833
6833
|
const K = t.offsetWidth - F;
|
|
6834
|
-
|
|
6835
|
-
}, this.handleClick = async function(
|
|
6834
|
+
L.clearDepth(), L.getViewport($), L.setViewport(K, 0, F, F), L.render(this, p), L.setViewport($.x, $.y, $.z, $.w);
|
|
6835
|
+
}, this.handleClick = async function(L) {
|
|
6836
6836
|
if (this.animating === !0) return !1;
|
|
6837
6837
|
const K = t.getBoundingClientRect(), H = K.left + (t.offsetWidth - F), _ = K.top + (t.offsetHeight - F);
|
|
6838
|
-
h.x = (
|
|
6838
|
+
h.x = (L.clientX - H) / (K.right - H) * 2 - 1, h.y = -((L.clientY - _) / (K.bottom - _)) * 2 + 1, u.setFromCamera(h, p);
|
|
6839
6839
|
const G = u.intersectObjects(l);
|
|
6840
6840
|
if (G.length > 0) {
|
|
6841
6841
|
const te = G[0].object, { type: Z } = te.userData, ne = Ha[Z.toLocaleUpperCase()];
|
|
@@ -6843,21 +6843,21 @@ class Su extends De {
|
|
|
6843
6843
|
} else
|
|
6844
6844
|
return !1;
|
|
6845
6845
|
}, this.dispose = function() {
|
|
6846
|
-
f.dispose(), d.material.dispose(), m.material.dispose(),
|
|
6846
|
+
f.dispose(), d.material.dispose(), m.material.dispose(), g.material.dispose(), D.material.map?.dispose(), E.material.map?.dispose(), O.material.map?.dispose(), k.material.map?.dispose(), U.material.map?.dispose(), q.material.map?.dispose(), D.material.dispose(), E.material.dispose(), O.material.dispose(), k.material.dispose(), U.material.dispose(), q.material.dispose();
|
|
6847
6847
|
};
|
|
6848
|
-
function P(
|
|
6849
|
-
return new ts({ color:
|
|
6848
|
+
function P(L) {
|
|
6849
|
+
return new ts({ color: L, toneMapped: !1 });
|
|
6850
6850
|
}
|
|
6851
|
-
function Q(
|
|
6851
|
+
function Q(L, K) {
|
|
6852
6852
|
const { font: H = "24px Arial", color: _ = "#000000", radius: G = 16 } = c, Y = document.createElement("canvas");
|
|
6853
6853
|
Y.width = 64, Y.height = 64;
|
|
6854
6854
|
const te = Y.getContext("2d");
|
|
6855
|
-
te.beginPath(), te.arc(32, 32, G, 0, 2 * Math.PI), te.closePath(), te.fillStyle =
|
|
6855
|
+
te.beginPath(), te.arc(32, 32, G, 0, 2 * Math.PI), te.closePath(), te.fillStyle = L.getStyle(), te.fill(), K && (te.font = H, te.textAlign = "center", te.fillStyle = _, te.fillText(K, 32, 41));
|
|
6856
6856
|
const Z = new En(Y);
|
|
6857
6857
|
return Z.colorSpace = yt, new nn({ map: Z, toneMapped: !1 });
|
|
6858
6858
|
}
|
|
6859
6859
|
function R() {
|
|
6860
|
-
D.material.map?.dispose(), E.material.map?.dispose(),
|
|
6860
|
+
D.material.map?.dispose(), E.material.map?.dispose(), O.material.map?.dispose(), D.material.dispose(), E.material.dispose(), O.material.dispose(), D.material = Q(r, c.labelX), E.material = Q(n, c.labelY), O.material = Q(i, c.labelZ);
|
|
6861
6861
|
}
|
|
6862
6862
|
}
|
|
6863
6863
|
setLabels;
|
|
@@ -6928,15 +6928,15 @@ class $p {
|
|
|
6928
6928
|
e.updateMatrixWorld(!0);
|
|
6929
6929
|
const r = (d, m) => {
|
|
6930
6930
|
if (d instanceof Ke && d.renderOrder !== 0) return;
|
|
6931
|
-
const
|
|
6932
|
-
Ka(d) && (t.push(d), s.push(
|
|
6931
|
+
const g = m.clone().multiply(d.matrix);
|
|
6932
|
+
Ka(d) && (t.push(d), s.push(g)), d.children.forEach((v) => r(v, g));
|
|
6933
6933
|
};
|
|
6934
6934
|
if (r(e, new X()), !t.length) return { ...Ii(e), release: () => {
|
|
6935
6935
|
} };
|
|
6936
6936
|
const n = t.map((d, m) => {
|
|
6937
|
-
let
|
|
6938
|
-
for (let
|
|
6939
|
-
(
|
|
6937
|
+
let g = !0;
|
|
6938
|
+
for (let v = d; v; v = v === e ? null : v.parent)
|
|
6939
|
+
(v !== e || !this.options.ignoreRootVisibility) && (g &&= v.visible);
|
|
6940
6940
|
return {
|
|
6941
6941
|
kind: d instanceof vt ? "line-segments" : "mesh",
|
|
6942
6942
|
pickable: d instanceof vt ? this.options.pickableLines : void 0,
|
|
@@ -6944,7 +6944,7 @@ class $p {
|
|
|
6944
6944
|
material: Du(d.material),
|
|
6945
6945
|
matrix: s[m].elements,
|
|
6946
6946
|
color: yn(d.material)?.toArray(),
|
|
6947
|
-
visible:
|
|
6947
|
+
visible: g,
|
|
6948
6948
|
name: d.name,
|
|
6949
6949
|
castShadow: d.castShadow,
|
|
6950
6950
|
receiveShadow: d.receiveShadow,
|
|
@@ -6957,11 +6957,11 @@ class $p {
|
|
|
6957
6957
|
if (!o) {
|
|
6958
6958
|
const d = [], m = /* @__PURE__ */ new Set();
|
|
6959
6959
|
try {
|
|
6960
|
-
const
|
|
6961
|
-
const
|
|
6962
|
-
let A = this.materials.get(
|
|
6960
|
+
const g = t.map((v, x) => {
|
|
6961
|
+
const b = n[x];
|
|
6962
|
+
let A = this.materials.get(b.material);
|
|
6963
6963
|
if (!A) {
|
|
6964
|
-
const J =
|
|
6964
|
+
const J = v.material.clone(), $ = /* @__PURE__ */ new Map();
|
|
6965
6965
|
yn(J)?.setRGB(1, 1, 1);
|
|
6966
6966
|
for (const [F, P] of Object.entries(J))
|
|
6967
6967
|
P instanceof et && ($.has(P) || $.set(P, P.clone()), J[F] = $.get(P));
|
|
@@ -6970,22 +6970,22 @@ class $p {
|
|
|
6970
6970
|
} catch (F) {
|
|
6971
6971
|
throw J.dispose(), $.forEach((P) => P.dispose()), F;
|
|
6972
6972
|
}
|
|
6973
|
-
this.materials.set(
|
|
6973
|
+
this.materials.set(b.material, A);
|
|
6974
6974
|
}
|
|
6975
|
-
const { geometry: D, material: E, matrix:
|
|
6976
|
-
return d.push(q), m.add(
|
|
6975
|
+
const { geometry: D, material: E, matrix: O, ...k } = b, U = v.material, q = v.geometry.clone();
|
|
6976
|
+
return d.push(q), m.add(b.material), {
|
|
6977
6977
|
...k,
|
|
6978
6978
|
geometry: q,
|
|
6979
6979
|
material: A.lease,
|
|
6980
|
-
matrix: s[
|
|
6980
|
+
matrix: s[x],
|
|
6981
6981
|
transparentBatch: U.transparent && U.side === vs && U.blending === ta && !U.transmission ? "sorted" : void 0
|
|
6982
6982
|
};
|
|
6983
6983
|
});
|
|
6984
|
-
o = { lease: this.resources.register({ parts:
|
|
6985
|
-
this.materials.get(
|
|
6984
|
+
o = { lease: this.resources.register({ parts: g }, { ownership: "transfer" }), users: 0, materials: m }, m.forEach((v) => {
|
|
6985
|
+
this.materials.get(v).users++;
|
|
6986
6986
|
}), this.models.set(i, o);
|
|
6987
|
-
} catch (
|
|
6988
|
-
throw d.forEach((
|
|
6987
|
+
} catch (g) {
|
|
6988
|
+
throw d.forEach((v) => v.dispose()), g;
|
|
6989
6989
|
}
|
|
6990
6990
|
}
|
|
6991
6991
|
const c = t.map((d) => ({ mesh: d, parent: d.parent, index: d.parent?.children.indexOf(d) ?? -1 }));
|
|
@@ -7000,8 +7000,8 @@ class $p {
|
|
|
7000
7000
|
--m.users || (m.lease.release(), this.materials.delete(d));
|
|
7001
7001
|
})));
|
|
7002
7002
|
}, restore: () => {
|
|
7003
|
-
l || (l = !0, u.restore(), c.forEach(({ mesh: d, parent: m, index:
|
|
7004
|
-
m && (m.add(d), m.children.splice(m.children.indexOf(d), 1), m.children.splice(
|
|
7003
|
+
l || (l = !0, u.restore(), c.forEach(({ mesh: d, parent: m, index: g }) => {
|
|
7004
|
+
m && (m.add(d), m.children.splice(m.children.indexOf(d), 1), m.children.splice(g, 0, d));
|
|
7005
7005
|
}));
|
|
7006
7006
|
} };
|
|
7007
7007
|
}
|
|
@@ -7043,20 +7043,20 @@ function Ii(a) {
|
|
|
7043
7043
|
visible: c.visible
|
|
7044
7044
|
}), c.removeFromParent(), c.matrix.copy(l), c.matrixAutoUpdate = !1, c.matrixWorldNeedsUpdate = !0, c.visible = u;
|
|
7045
7045
|
}, r = (c, l, u, h) => {
|
|
7046
|
-
const p = l.clone().multiply(c.matrix), f = u && c.visible, d = c, m = c instanceof Ke && c.renderOrder !== h,
|
|
7047
|
-
|
|
7046
|
+
const p = l.clone().multiply(c.matrix), f = u && c.visible, d = c, m = c instanceof Ke && c.renderOrder !== h, g = !!(d.isMesh || d.isLine || d.isPoints || d.isSprite), v = [...c.children].flatMap((x) => r(
|
|
7047
|
+
x,
|
|
7048
7048
|
m ? new X() : p,
|
|
7049
7049
|
m ? !0 : f,
|
|
7050
7050
|
c instanceof Ke ? c.renderOrder : h
|
|
7051
7051
|
));
|
|
7052
7052
|
if (m) {
|
|
7053
|
-
if (!
|
|
7054
|
-
const
|
|
7055
|
-
return
|
|
7053
|
+
if (!v.length) return [];
|
|
7054
|
+
const x = new Ke();
|
|
7055
|
+
return x.name = c.name, x.renderOrder = c.renderOrder, x.matrixAutoUpdate = !1, x.matrix.copy(p), x.visible = f, x.add(...v), [x];
|
|
7056
7056
|
}
|
|
7057
|
-
if (!
|
|
7058
|
-
for (const
|
|
7059
|
-
return s(c, p, f), [c, ...
|
|
7057
|
+
if (!g) return v;
|
|
7058
|
+
for (const x of [...c.children]) s(x, x.matrix, x.visible);
|
|
7059
|
+
return s(c, p, f), [c, ...v];
|
|
7060
7060
|
}, n = r(a, new X(), !0, 0), i = n.length === 1 ? n[0] : new Ke();
|
|
7061
7061
|
n.length > 1 && i.add(...n);
|
|
7062
7062
|
let o = !1;
|
|
@@ -7306,45 +7306,52 @@ class Eu {
|
|
|
7306
7306
|
i.add(e), this.groups.set(n, i), e.key = n, this.dirtyGroups.add(n);
|
|
7307
7307
|
}
|
|
7308
7308
|
rebuildGroup(e) {
|
|
7309
|
-
for (const
|
|
7310
|
-
|
|
7309
|
+
for (const m of this.groupBatches.get(e) ?? [])
|
|
7310
|
+
m.object instanceof ye && this.sideVariants?.unregister(m.object), m.object.removeFromParent(), (m.object instanceof Ue || m.object instanceof rt) && m.object.dispose(), m.ownedMaterial?.dispose(), m.ownedGeometry?.dispose(), this.batches.delete(m), this.countBatch(m, -1), this.mappings.delete(m.object);
|
|
7311
7311
|
const t = [...this.groups.get(e) ?? []], s = [];
|
|
7312
7312
|
if (t.length === 0) {
|
|
7313
7313
|
this.groups.delete(e), this.groupBatches.delete(e);
|
|
7314
7314
|
return;
|
|
7315
7315
|
}
|
|
7316
7316
|
if (t[0].input.parts[t[0].partIndex].kind === "line-segments") {
|
|
7317
|
-
const
|
|
7318
|
-
for (let
|
|
7317
|
+
const m = this.enabled && this.batchedEnabled && t[0].eligible ? 512 : 1;
|
|
7318
|
+
for (let g = 0; g < t.length; g += m) this.createLineBatch(t.slice(g, g + m), s);
|
|
7319
7319
|
this.groupBatches.set(e, s), this.rebuilds++;
|
|
7320
7320
|
return;
|
|
7321
7321
|
}
|
|
7322
7322
|
const r = /* @__PURE__ */ new Map();
|
|
7323
|
-
t.forEach((
|
|
7324
|
-
const
|
|
7325
|
-
|
|
7323
|
+
t.forEach((m) => {
|
|
7324
|
+
const g = m.input.parts[m.partIndex].geometry.uuid, v = r.get(g) ?? [];
|
|
7325
|
+
v.push(m), r.set(g, v);
|
|
7326
7326
|
});
|
|
7327
|
-
const n = []
|
|
7328
|
-
|
|
7329
|
-
if (
|
|
7330
|
-
|
|
7331
|
-
|
|
7332
|
-
|
|
7333
|
-
|
|
7327
|
+
const n = [], i = /* @__PURE__ */ new Map(), o = (m) => {
|
|
7328
|
+
const g = i.get(m);
|
|
7329
|
+
if (g) return g;
|
|
7330
|
+
const v = m.getAttribute("position")?.count ?? 0, x = m.index?.count ?? 0, b = m.drawRange.start === 0 && m.drawRange.count >= (m.index ? x : v), A = Object.values(m.attributes).every((O) => O instanceof qe && !(O instanceof ai) && O.gpuType === ea), D = A ? Object.values(m.attributes).reduce((O, k) => O + k.array.byteLength, m.index?.array.byteLength ?? 0) : 1 / 0, E = { vertices: v, indices: x, bytes: D, compatible: b && A, fits: v <= 262144 && x <= 786432 && D <= 32 * 1024 * 1024 };
|
|
7331
|
+
return i.set(m, E), E;
|
|
7332
|
+
}, c = this.enabled && this.batchedEnabled && r.size > 1;
|
|
7333
|
+
for (const m of r.values()) {
|
|
7334
|
+
const g = m[0].input.parts[m[0].partIndex], v = o(g.geometry);
|
|
7335
|
+
if (m.length === 1 || g.material.transparent || c && v.compatible && v.fits) n.push(...m);
|
|
7336
|
+
else for (let x = 0; x < m.length; x += 512) this.createBatch(m.slice(x, x + 512), s, !1);
|
|
7337
|
+
}
|
|
7338
|
+
let l = [], u = 0, h = 0, p = 0;
|
|
7339
|
+
const f = /* @__PURE__ */ new Set(), d = () => {
|
|
7340
|
+
l.length && this.createBatch(l, s, this.enabled && this.batchedEnabled && l.length > 1 && l[0].eligible), l = [], u = 0, h = 0, p = 0, f.clear();
|
|
7334
7341
|
};
|
|
7335
|
-
n.forEach((
|
|
7336
|
-
const
|
|
7337
|
-
if (!
|
|
7338
|
-
|
|
7342
|
+
n.forEach((m) => {
|
|
7343
|
+
const g = m.input.parts[m.partIndex].geometry, v = o(g);
|
|
7344
|
+
if (!v.compatible) {
|
|
7345
|
+
d(), this.createBatch([m], s, !1);
|
|
7339
7346
|
return;
|
|
7340
7347
|
}
|
|
7341
|
-
|
|
7342
|
-
|
|
7343
|
-
this.createBatch([h], s, !1);
|
|
7348
|
+
if (!v.fits) {
|
|
7349
|
+
this.createBatch([m], s, !1);
|
|
7344
7350
|
return;
|
|
7345
7351
|
}
|
|
7346
|
-
|
|
7347
|
-
|
|
7352
|
+
const x = f.has(g);
|
|
7353
|
+
(l.length >= 512 || u + (x ? 0 : v.vertices) > 262144 || h + (x ? 0 : v.indices) > 786432 || p + (x ? 0 : v.bytes) > 32 * 1024 * 1024) && d(), f.has(g) || (f.add(g), u += v.vertices, h += v.indices, p += v.bytes), l.push(m);
|
|
7354
|
+
}), d(), this.groupBatches.set(e, s), this.rebuilds++;
|
|
7348
7355
|
}
|
|
7349
7356
|
createBatch(e, t, s) {
|
|
7350
7357
|
const r = e[0].input.parts[e[0].partIndex];
|
|
@@ -7354,13 +7361,13 @@ class Eu {
|
|
|
7354
7361
|
}
|
|
7355
7362
|
let n;
|
|
7356
7363
|
if (s) {
|
|
7357
|
-
const o = e.
|
|
7358
|
-
n = new Ei(e.length,
|
|
7359
|
-
const
|
|
7360
|
-
e.forEach((
|
|
7361
|
-
const
|
|
7362
|
-
let
|
|
7363
|
-
|
|
7364
|
+
const o = new Set(e.map((h) => h.input.parts[h.partIndex].geometry)), c = [...o].reduce((h, p) => h + p.getAttribute("position").count, 0), l = [...o].reduce((h, p) => h + (p.index?.count ?? 0), 0);
|
|
7365
|
+
n = new Ei(e.length, c, l, r.material), n.perObjectFrustumCulled = r.frustumCulled ?? !0;
|
|
7366
|
+
const u = /* @__PURE__ */ new Map();
|
|
7367
|
+
e.forEach((h) => {
|
|
7368
|
+
const p = h.input.parts[h.partIndex].geometry;
|
|
7369
|
+
let f = u.get(p.uuid);
|
|
7370
|
+
f === void 0 && (f = n.addGeometry(p), u.set(p.uuid, f)), n.addInstance(f);
|
|
7364
7371
|
});
|
|
7365
7372
|
} else if (e.length > 1 && r.material.transparent) {
|
|
7366
7373
|
e.forEach((o) => this.createBatch([o], t, !1));
|
|
@@ -7390,10 +7397,10 @@ class Eu {
|
|
|
7390
7397
|
for (const i of e.entries) {
|
|
7391
7398
|
if (!i.visible) continue;
|
|
7392
7399
|
const o = i.input.parts[i.partIndex], c = o.material, l = o.geometry.getAttribute("position"), u = o.geometry.index, h = c.vertexColors ? o.geometry.getAttribute("color") : void 0, p = c.color.clone().multiply(new ce().fromArray(o.color ?? [1, 1, 1])), f = Math.min(u?.count ?? l.count, o.geometry.drawRange.start + o.geometry.drawRange.count), d = t.length / 3;
|
|
7393
|
-
for (let
|
|
7394
|
-
for (let
|
|
7395
|
-
const
|
|
7396
|
-
r.fromBufferAttribute(l,
|
|
7400
|
+
for (let g = o.geometry.drawRange.start; g + 1 < f; g += 2) {
|
|
7401
|
+
for (let v = g; v < g + 2; v++) {
|
|
7402
|
+
const x = u ? u.getX(v) : v;
|
|
7403
|
+
r.fromBufferAttribute(l, x).applyMatrix4(i.matrix), t.push(r.x, r.y, r.z), s.push(p.r * (h?.getX(x) ?? 1), p.g * (h?.getY(x) ?? 1), p.b * (h?.getZ(x) ?? 1));
|
|
7397
7404
|
}
|
|
7398
7405
|
e.slots.push(i);
|
|
7399
7406
|
}
|
|
@@ -7475,8 +7482,8 @@ async function Qa(a, e, t, s) {
|
|
|
7475
7482
|
}, c = o(a.resourcePath || s.rootURL);
|
|
7476
7483
|
let l;
|
|
7477
7484
|
const u = (f) => {
|
|
7478
|
-
const d = f.options.manager, m = (
|
|
7479
|
-
const k = d.resolveURL(
|
|
7485
|
+
const d = f.options.manager, m = (b, A, D, E, O) => {
|
|
7486
|
+
const k = d.resolveURL(b), U = c !== null && o(k) === c, q = U && (i || A === "include"), J = new AbortController(), $ = [s.signal, d.abortController.signal].filter((P) => !!P), F = () => J.abort();
|
|
7480
7487
|
$.forEach((P) => {
|
|
7481
7488
|
P.aborted ? F() : P.addEventListener("abort", F, { once: !0 });
|
|
7482
7489
|
}), d.itemStart(k), fetch(k, {
|
|
@@ -7488,26 +7495,26 @@ async function Qa(a, e, t, s) {
|
|
|
7488
7495
|
if (!P.ok) throw new Error(`GLTF dependency request failed: ${P.status} ${k}`);
|
|
7489
7496
|
return D(P);
|
|
7490
7497
|
}).then((P) => E?.(P)).catch((P) => {
|
|
7491
|
-
(q || J.signal.aborted) && (l ??= P),
|
|
7498
|
+
(q || J.signal.aborted) && (l ??= P), O?.(P), d.itemError(k);
|
|
7492
7499
|
}).finally(() => {
|
|
7493
7500
|
$.forEach((P) => P.removeEventListener("abort", F)), d.itemEnd(k);
|
|
7494
7501
|
});
|
|
7495
7502
|
};
|
|
7496
|
-
class
|
|
7497
|
-
load(A, D, E,
|
|
7498
|
-
m(this.path + A, this.withCredentials ? "include" : "same-origin", (k) => k.arrayBuffer(), D,
|
|
7503
|
+
class g extends wr {
|
|
7504
|
+
load(A, D, E, O) {
|
|
7505
|
+
m(this.path + A, this.withCredentials ? "include" : "same-origin", (k) => k.arrayBuffer(), D, O);
|
|
7499
7506
|
}
|
|
7500
7507
|
}
|
|
7501
|
-
const
|
|
7502
|
-
f.fileLoader = new
|
|
7503
|
-
const
|
|
7504
|
-
if (
|
|
7505
|
-
class
|
|
7506
|
-
load(D, E,
|
|
7508
|
+
const v = f.fileLoader;
|
|
7509
|
+
f.fileLoader = new g(d).setPath(v.path).setResponseType("arraybuffer").setWithCredentials(v.withCredentials);
|
|
7510
|
+
const x = f.textureLoader;
|
|
7511
|
+
if (x instanceof oi) {
|
|
7512
|
+
class b extends oi {
|
|
7513
|
+
load(D, E, O, k) {
|
|
7507
7514
|
m(this.path + D, this.crossOrigin === "anonymous" ? "same-origin" : "include", async (U) => createImageBitmap(await U.blob(), { ...this.options, colorSpaceConversion: "none" }), E, k);
|
|
7508
7515
|
}
|
|
7509
7516
|
}
|
|
7510
|
-
f.textureLoader = new
|
|
7517
|
+
f.textureLoader = new b(d).setPath(x.path).setCrossOrigin(x.crossOrigin).setOptions({ ...x.options });
|
|
7511
7518
|
}
|
|
7512
7519
|
return f.options.requestHeader = { ...n }, { name: "SOONSPACE_scoped_dependencies" };
|
|
7513
7520
|
};
|
|
@@ -7658,36 +7665,36 @@ class Bu {
|
|
|
7658
7665
|
const f = [];
|
|
7659
7666
|
h.scene.updateMatrixWorld(!0);
|
|
7660
7667
|
const d = /* @__PURE__ */ new Set();
|
|
7661
|
-
if (Lu(h.scene, h.animations) && d.add("animation-clips"), h.scene.traverse((
|
|
7662
|
-
if (
|
|
7668
|
+
if (Lu(h.scene, h.animations) && d.add("animation-clips"), h.scene.traverse((g) => {
|
|
7669
|
+
if (g instanceof Pn || g instanceof Rs) {
|
|
7663
7670
|
d.add("line-or-points");
|
|
7664
7671
|
return;
|
|
7665
7672
|
}
|
|
7666
|
-
if (!(
|
|
7667
|
-
if (Array.isArray(
|
|
7668
|
-
Array.isArray(
|
|
7673
|
+
if (!(g instanceof ye)) return;
|
|
7674
|
+
if (Array.isArray(g.material) || g.isSkinnedMesh || g.morphTargetInfluences?.length || g instanceof Ue || g instanceof rt) {
|
|
7675
|
+
Array.isArray(g.material) && d.add("material-array"), g.isSkinnedMesh && d.add("skinning"), g.morphTargetInfluences?.length && d.add("morph-targets"), g instanceof Ue && d.add("instanced-mesh"), g instanceof rt && d.add("batched-mesh");
|
|
7669
7676
|
return;
|
|
7670
7677
|
}
|
|
7671
|
-
let
|
|
7672
|
-
for (let
|
|
7678
|
+
let v = !0;
|
|
7679
|
+
for (let x = g; x; x = x.parent) v = v && x.visible;
|
|
7673
7680
|
f.push({
|
|
7674
|
-
geometry:
|
|
7675
|
-
material:
|
|
7676
|
-
matrix:
|
|
7677
|
-
visible:
|
|
7678
|
-
name:
|
|
7679
|
-
castShadow:
|
|
7680
|
-
receiveShadow:
|
|
7681
|
-
renderOrder:
|
|
7682
|
-
layersMask:
|
|
7683
|
-
frustumCulled:
|
|
7681
|
+
geometry: g.geometry,
|
|
7682
|
+
material: g.material,
|
|
7683
|
+
matrix: g.matrixWorld.clone(),
|
|
7684
|
+
visible: v,
|
|
7685
|
+
name: g.name,
|
|
7686
|
+
castShadow: g.castShadow,
|
|
7687
|
+
receiveShadow: g.receiveShadow,
|
|
7688
|
+
renderOrder: g.renderOrder,
|
|
7689
|
+
layersMask: g.layers.mask,
|
|
7690
|
+
frustumCulled: g.frustumCulled
|
|
7684
7691
|
});
|
|
7685
7692
|
}), d.size) throw new Pu(e, [...d]);
|
|
7686
7693
|
c = this.register({ parts: f }, { ownership: "transfer" }), o = void 0;
|
|
7687
|
-
const m = [...this.records].find((
|
|
7694
|
+
const m = [...this.records].find((g) => g.value === c.value);
|
|
7688
7695
|
this.urls.set(e, m);
|
|
7689
|
-
for (const
|
|
7690
|
-
|
|
7696
|
+
for (const g of t.waiters)
|
|
7697
|
+
g.cleanup(), g.resolve(c.retain());
|
|
7691
7698
|
} catch (l) {
|
|
7692
7699
|
t.controller.signal.aborted || s.manager.itemError(r);
|
|
7693
7700
|
for (const u of t.waiters)
|
|
@@ -7783,27 +7790,29 @@ class Fu {
|
|
|
7783
7790
|
parent: t?.entity ?? null,
|
|
7784
7791
|
children: /* @__PURE__ */ new Set(),
|
|
7785
7792
|
world: new X(),
|
|
7786
|
-
local: new X(),
|
|
7787
|
-
ownVisible:
|
|
7793
|
+
local: new X().compose(s.position, s.quaternion.clone().normalize(), s.scale),
|
|
7794
|
+
ownVisible: s.visible,
|
|
7788
7795
|
visible: !0,
|
|
7789
|
-
contentVisible:
|
|
7796
|
+
contentVisible: s.contentVisible,
|
|
7790
7797
|
parts: r?.value ?? [],
|
|
7791
7798
|
lease: r,
|
|
7792
7799
|
attachments: /* @__PURE__ */ new Set(),
|
|
7793
7800
|
loadState: r ? "ready" : "idle"
|
|
7794
7801
|
};
|
|
7795
|
-
return this.nodes.set(s, n), this.selected.size && (this.selectionDirty = !0), this.ids.set(s.id, s), t?.children.add(s), this.renderer.add(n), this.
|
|
7802
|
+
return this.nodes.set(s, n), this.selected.size && (this.selectionDirty = !0), this.ids.set(s.id, s), t?.children.add(s), this.renderer.add(n), this.structureDirty.add(s), this.schedule(), s;
|
|
7796
7803
|
}
|
|
7797
7804
|
notify(e, t) {
|
|
7798
|
-
this.node(e);
|
|
7799
|
-
const s = this.pending.get(e) ?? {};
|
|
7805
|
+
const s = this.node(e), r = this.pending.get(e) ?? {};
|
|
7800
7806
|
if (t === "transform") {
|
|
7801
7807
|
if (![...e.position.toArray(), ...e.quaternion.toArray(), ...e.scale.toArray()].every(Number.isFinite) || e.quaternion.lengthSq() === 0) throw new Error("Invalid Entity transform");
|
|
7802
|
-
|
|
7803
|
-
|
|
7804
|
-
s.
|
|
7805
|
-
else
|
|
7806
|
-
|
|
7808
|
+
const i = new X().compose(e.position, e.quaternion.clone().normalize(), e.scale);
|
|
7809
|
+
if (i.equals(r.matrix ?? s.local)) return;
|
|
7810
|
+
i.equals(s.local) ? delete r.matrix : r.matrix = i;
|
|
7811
|
+
} else if (t === "visibility") {
|
|
7812
|
+
if (e.visible === (r.visible ?? s.ownVisible) && e.contentVisible === (r.contentVisible ?? s.contentVisible)) return;
|
|
7813
|
+
e.visible === s.ownVisible ? delete r.visible : r.visible = e.visible, e.contentVisible === s.contentVisible ? delete r.contentVisible : r.contentVisible = e.contentVisible;
|
|
7814
|
+
} else throw new Error("Unknown Entity change type");
|
|
7815
|
+
r.matrix || r.visible !== void 0 || r.contentVisible !== void 0 ? this.pending.set(e, r) : this.pending.delete(e), this.schedule();
|
|
7807
7816
|
}
|
|
7808
7817
|
schedule() {
|
|
7809
7818
|
this.batchDepth === 0 && this.requestRender();
|
|
@@ -8118,14 +8127,14 @@ class zu {
|
|
|
8118
8127
|
f.enabled !== t && (f.enabled = t, h.effectsNeedsUpdate = !0);
|
|
8119
8128
|
const { effect: d } = f;
|
|
8120
8129
|
d.intensity = n;
|
|
8121
|
-
const { mipmapBlurPass: m, renderTarget:
|
|
8130
|
+
const { mipmapBlurPass: m, renderTarget: g } = d;
|
|
8122
8131
|
m.enabled = s, m.radius = r;
|
|
8123
|
-
const
|
|
8124
|
-
|
|
8125
|
-
|
|
8126
|
-
}), d.luminanceMaterial.userData.bloomSelection = /* @__PURE__ */ new Set(), t && u.forEach((
|
|
8127
|
-
|
|
8128
|
-
|
|
8132
|
+
const v = d.uniforms.get("map");
|
|
8133
|
+
v && (v.value = s ? m.texture : g.texture), d.luminanceMaterial.threshold = i, d.luminanceMaterial.smoothing = o, d.blendMode.opacity.value = l, d.luminanceMaterial.userData.bloomSelection?.forEach((x) => {
|
|
8134
|
+
x.toneMapped = !0, p.add(x), x.userData.prevEmissive && (x.emissive.copy(x.userData.prevEmissive), Reflect.deleteProperty(x.userData, "prevEmissive"));
|
|
8135
|
+
}), d.luminanceMaterial.userData.bloomSelection = /* @__PURE__ */ new Set(), t && u.forEach((x) => {
|
|
8136
|
+
x.traverse((b) => {
|
|
8137
|
+
b instanceof ye && b.material.color && !d.luminanceMaterial.userData.bloomSelection.has(b.material) && (b.material.toneMapped = !1, b.material.userData.prevEmissive = b.material.emissive.clone(), b.material.emissive.copy(b.material.color), b.material.emissive.multiplyScalar(c), d.luminanceMaterial.userData.bloomSelection.add(b.material), p.add(b.material));
|
|
8129
8138
|
});
|
|
8130
8139
|
}), this.signals.materialChanged.dispatch([...p]);
|
|
8131
8140
|
}
|
|
@@ -8389,14 +8398,14 @@ class zu {
|
|
|
8389
8398
|
...o
|
|
8390
8399
|
}, { effectManager: p } = this, f = p.effectsMap.get(_e.CONSTANTS.outlineEffect), d = i.length > 0;
|
|
8391
8400
|
f.enabled !== d && (f.enabled = d, p.effectsNeedsUpdate = !0);
|
|
8392
|
-
const { effect: m } = f, { uniforms:
|
|
8401
|
+
const { effect: m } = f, { uniforms: g } = m, v = [];
|
|
8393
8402
|
i.forEach((D) => {
|
|
8394
8403
|
D.traverse((E) => {
|
|
8395
|
-
E instanceof ye &&
|
|
8404
|
+
E instanceof ye && v.push(E);
|
|
8396
8405
|
});
|
|
8397
|
-
}), m.selection.set(
|
|
8398
|
-
const
|
|
8399
|
-
|
|
8406
|
+
}), m.selection.set(v), m.blur = u > 0, m.blurPass.kernelSize = u;
|
|
8407
|
+
const x = g.get("visibleEdgeColor"), b = g.get("hiddenEdgeColor"), A = g.get("edgeStrength");
|
|
8408
|
+
x && x.value.set(c), b && b.value.set(l), A && (A.value = h), this._triggerRender();
|
|
8400
8409
|
};
|
|
8401
8410
|
this.signals.outlineChange.add(s);
|
|
8402
8411
|
}
|
|
@@ -8420,9 +8429,9 @@ class Ee extends De {
|
|
|
8420
8429
|
onRightClick;
|
|
8421
8430
|
constructor(e = { id: We() }) {
|
|
8422
8431
|
super();
|
|
8423
|
-
const { id: t, sid: s, uuid: r, name: n = "", level: i = { max: null, min: null }, visible: o = !0, position: c = { x: 0, y: 0, z: 0 }, rotation: l = { x: 0, y: 0, z: 0 }, scale: u = { x: 1, y: 1, z: 1 }, userData: h = {}, extraIds: p = [], onLoad: f, onClick: d, onDblClick: m, onRightClick:
|
|
8432
|
+
const { id: t, sid: s, uuid: r, name: n = "", level: i = { max: null, min: null }, visible: o = !0, position: c = { x: 0, y: 0, z: 0 }, rotation: l = { x: 0, y: 0, z: 0 }, scale: u = { x: 1, y: 1, z: 1 }, userData: h = {}, extraIds: p = [], onLoad: f, onClick: d, onDblClick: m, onRightClick: g } = { ...Ru, ...e };
|
|
8424
8433
|
if (t === void 0) throw new Error("In soonspacejs: 空间对象实例化失败,缺少必要字段 'id'!");
|
|
8425
|
-
this.sid = t, this.name = n, this.stype = "BaseObject3D", this.level = i, this.visible = o ?? !0, this.handleHide = !o, this.position.set(c.x ?? 0, c.y ?? 0, c.z ?? 0), this.rotation.set(l.x ?? 0, l.y ?? 0, l.z ?? 0), this.scale.set(u.x ?? 1, u.y ?? 1, u.z ?? 1), this.castShadow = !0, this.receiveShadow = !0, this.userData = h, s && p.push(s), r && p.push(r), this.extraIds = p, this.onLoad = f?.bind(this) || null, this.onClick = d?.bind(this) || null, this.onDblClick = m?.bind(this) || null, this.onRightClick =
|
|
8434
|
+
this.sid = t, this.name = n, this.stype = "BaseObject3D", this.level = i, this.visible = o ?? !0, this.handleHide = !o, this.position.set(c.x ?? 0, c.y ?? 0, c.z ?? 0), this.rotation.set(l.x ?? 0, l.y ?? 0, l.z ?? 0), this.scale.set(u.x ?? 1, u.y ?? 1, u.z ?? 1), this.castShadow = !0, this.receiveShadow = !0, this.userData = h, s && p.push(s), r && p.push(r), this.extraIds = p, this.onLoad = f?.bind(this) || null, this.onClick = d?.bind(this) || null, this.onDblClick = m?.bind(this) || null, this.onRightClick = g?.bind(this) || null;
|
|
8426
8435
|
}
|
|
8427
8436
|
eventPropagation() {
|
|
8428
8437
|
this.isEventPropagation = !0;
|
|
@@ -8752,22 +8761,22 @@ class mt extends Ee {
|
|
|
8752
8761
|
}
|
|
8753
8762
|
if (t)
|
|
8754
8763
|
for (let f = 0; f < h.graphs.length; f++) {
|
|
8755
|
-
const { linkInfo: d, targetNodeId: m, passable:
|
|
8756
|
-
if (!u.includes(
|
|
8757
|
-
u.push(
|
|
8758
|
-
const A = Qr(r,
|
|
8759
|
-
id:
|
|
8760
|
-
name:
|
|
8764
|
+
const { linkInfo: d, targetNodeId: m, passable: g } = h.graphs[f], { id: v, name: x } = d, b = this.info.nodes.find((A) => A.id === m);
|
|
8765
|
+
if (!u.includes(v) && b) {
|
|
8766
|
+
u.push(v);
|
|
8767
|
+
const A = Qr(r, g), D = this.createLink({
|
|
8768
|
+
id: v,
|
|
8769
|
+
name: x,
|
|
8761
8770
|
start: h.position,
|
|
8762
|
-
end:
|
|
8771
|
+
end: b.position,
|
|
8763
8772
|
width: s,
|
|
8764
8773
|
color: A,
|
|
8765
8774
|
imgUrl: c,
|
|
8766
8775
|
transparent: !!c,
|
|
8767
|
-
passable:
|
|
8776
|
+
passable: g,
|
|
8768
8777
|
userData: {
|
|
8769
8778
|
startNodeId: h.id,
|
|
8770
|
-
endNodeId:
|
|
8779
|
+
endNodeId: b.id
|
|
8771
8780
|
}
|
|
8772
8781
|
});
|
|
8773
8782
|
this.links.push(D);
|
|
@@ -8876,24 +8885,24 @@ class mt extends Ee {
|
|
|
8876
8885
|
for (const l of this.info.nodes)
|
|
8877
8886
|
if (e)
|
|
8878
8887
|
for (let u = 0; u < l.graphs.length; u++) {
|
|
8879
|
-
const { linkInfo: h, targetNodeId: p, passable: f } = l.graphs[u], { id: d, name: m } = h,
|
|
8880
|
-
if (!i.has(d) &&
|
|
8888
|
+
const { linkInfo: h, targetNodeId: p, passable: f } = l.graphs[u], { id: d, name: m } = h, g = o.get(p);
|
|
8889
|
+
if (!i.has(d) && g) {
|
|
8881
8890
|
i.set(d, d);
|
|
8882
|
-
const
|
|
8891
|
+
const v = Qr(s, f), x = {
|
|
8883
8892
|
id: d,
|
|
8884
8893
|
name: m,
|
|
8885
8894
|
start: l.position,
|
|
8886
|
-
end:
|
|
8895
|
+
end: g.position,
|
|
8887
8896
|
width: t,
|
|
8888
|
-
color:
|
|
8897
|
+
color: v,
|
|
8889
8898
|
imgUrl: r,
|
|
8890
8899
|
transparent: !!r,
|
|
8891
8900
|
passable: f
|
|
8892
|
-
},
|
|
8893
|
-
if (
|
|
8894
|
-
|
|
8901
|
+
}, b = c.find((A) => A.sid === d);
|
|
8902
|
+
if (b)
|
|
8903
|
+
b.updateGeometry({ start: x.start, end: x.end }), v && b.material.color.set(v), b.passable = f;
|
|
8895
8904
|
else {
|
|
8896
|
-
const A = this.createLink(
|
|
8905
|
+
const A = this.createLink(x);
|
|
8897
8906
|
this.links.push(A);
|
|
8898
8907
|
}
|
|
8899
8908
|
}
|
|
@@ -8935,28 +8944,28 @@ class Ja extends Re {
|
|
|
8935
8944
|
h.lookAt(o, c, this.up), p.applyMatrix4(h), l.subVectors(c, o), l.normalize(), u.crossVectors(l, p);
|
|
8936
8945
|
const f = new I(u.x * s, u.y * s, u.z * s), d = new I(-u.x * s, -u.y * s, -u.z * s), m = new I();
|
|
8937
8946
|
m.addVectors(o, f);
|
|
8938
|
-
const
|
|
8939
|
-
|
|
8940
|
-
const
|
|
8941
|
-
|
|
8942
|
-
const
|
|
8943
|
-
|
|
8947
|
+
const g = new I();
|
|
8948
|
+
g.addVectors(o, d);
|
|
8949
|
+
const v = new I();
|
|
8950
|
+
v.addVectors(c, d);
|
|
8951
|
+
const x = new I();
|
|
8952
|
+
x.addVectors(c, f), r = [
|
|
8944
8953
|
...r,
|
|
8945
8954
|
m.x,
|
|
8946
8955
|
m.y,
|
|
8947
8956
|
m.z,
|
|
8948
|
-
|
|
8949
|
-
|
|
8950
|
-
|
|
8951
|
-
|
|
8952
|
-
|
|
8953
|
-
|
|
8954
|
-
|
|
8955
|
-
|
|
8956
|
-
|
|
8957
|
-
|
|
8958
|
-
|
|
8959
|
-
|
|
8957
|
+
g.x,
|
|
8958
|
+
g.y,
|
|
8959
|
+
g.z,
|
|
8960
|
+
v.x,
|
|
8961
|
+
v.y,
|
|
8962
|
+
v.z,
|
|
8963
|
+
v.x,
|
|
8964
|
+
v.y,
|
|
8965
|
+
v.z,
|
|
8966
|
+
x.x,
|
|
8967
|
+
x.y,
|
|
8968
|
+
x.z,
|
|
8960
8969
|
m.x,
|
|
8961
8970
|
m.y,
|
|
8962
8971
|
m.z
|
|
@@ -9147,37 +9156,37 @@ function ro(a, e, t, s = !1) {
|
|
|
9147
9156
|
}), r;
|
|
9148
9157
|
}
|
|
9149
9158
|
function Ku(a, e = {}) {
|
|
9150
|
-
const { indexes: t, a: s, b: r, c: n, equalVertexIndexMap: i, faceIndex: o, onlyC: c, maxCount: l = c ? 2 : 3, positions: u, getParentMidpoint: h, isAncestor: p, getDepth: f } = a, d = t.length / 3, m = o ?? Math.trunc(d / 2),
|
|
9159
|
+
const { indexes: t, a: s, b: r, c: n, equalVertexIndexMap: i, faceIndex: o, onlyC: c, maxCount: l = c ? 2 : 3, positions: u, getParentMidpoint: h, isAncestor: p, getDepth: f } = a, d = t.length / 3, m = o ?? Math.trunc(d / 2), g = i ? (L) => i[L] : (L) => L, v = g(s), x = g(r), b = g(n), A = [];
|
|
9151
9160
|
let D = () => 0, E = 0;
|
|
9152
|
-
o != null && f && (E = f(o) + 1, D = (
|
|
9153
|
-
const [
|
|
9161
|
+
o != null && f && (E = f(o) + 1, D = (L) => E - f(L));
|
|
9162
|
+
const [O, k, U] = At;
|
|
9154
9163
|
let q = () => null;
|
|
9155
|
-
u && (
|
|
9156
|
-
U.fromArray(u,
|
|
9157
|
-
}),
|
|
9164
|
+
u && (O.set(0, 0, 0), [s, r, n].forEach((L) => {
|
|
9165
|
+
U.fromArray(u, L * 3), O.add(U);
|
|
9166
|
+
}), O.multiplyScalar(1 / 3), q = (L, K) => {
|
|
9158
9167
|
k.set(0, 0, 0);
|
|
9159
9168
|
for (let G = 0; G < K.length; G++)
|
|
9160
9169
|
U.fromArray(u, G * 3), k.add(U);
|
|
9161
9170
|
k.multiplyScalar(1 / 3);
|
|
9162
|
-
const H = k.distanceToSquared(
|
|
9171
|
+
const H = k.distanceToSquared(O), _ = k.distanceToSquared(h(L));
|
|
9163
9172
|
return H < _ ? { posIndexes: K, consumed: !0 } : null;
|
|
9164
9173
|
});
|
|
9165
|
-
function J(
|
|
9166
|
-
const K =
|
|
9167
|
-
if (e[
|
|
9168
|
-
const _ = D(
|
|
9169
|
-
return _ > 0 ? null : _ < 0 ? { posIndexes: H, consumed: !0 } : q(
|
|
9174
|
+
function J(L) {
|
|
9175
|
+
const K = L * 3, H = t.slice(K, K + 3);
|
|
9176
|
+
if (e[L]) {
|
|
9177
|
+
const _ = D(L);
|
|
9178
|
+
return _ > 0 ? null : _ < 0 ? { posIndexes: H, consumed: !0 } : q(L, H);
|
|
9170
9179
|
}
|
|
9171
9180
|
return { posIndexes: H };
|
|
9172
9181
|
}
|
|
9173
|
-
const $ = c ? function(
|
|
9174
|
-
const K = J(
|
|
9182
|
+
const $ = c ? function(L) {
|
|
9183
|
+
const K = J(L);
|
|
9175
9184
|
if (!K)
|
|
9176
9185
|
return !1;
|
|
9177
|
-
const { posIndexes: H, consumed: _ } = K, G = H.map(
|
|
9186
|
+
const { posIndexes: H, consumed: _ } = K, G = H.map(g), Y = G.indexOf(b);
|
|
9178
9187
|
if (Y === -1)
|
|
9179
9188
|
return !1;
|
|
9180
|
-
const te = G.indexOf(
|
|
9189
|
+
const te = G.indexOf(v), Z = G.indexOf(x), ne = te === -1, ge = Z === -1;
|
|
9181
9190
|
if (ne + ge !== 1)
|
|
9182
9191
|
return !1;
|
|
9183
9192
|
switch (!0) {
|
|
@@ -9185,23 +9194,23 @@ function Ku(a, e = {}) {
|
|
|
9185
9194
|
const ie = [Y, Z];
|
|
9186
9195
|
ie.push(3 - ie[0] - ie[1]);
|
|
9187
9196
|
const se = { a: H[ie[0]], b: H[ie[1]], c: H[ie[2]] };
|
|
9188
|
-
A.push({ a: n, b: r, c: se.c, d: s, order: ie, real: se, faceIndex:
|
|
9197
|
+
A.push({ a: n, b: r, c: se.c, d: s, order: ie, real: se, faceIndex: L, consumed: _ });
|
|
9189
9198
|
break;
|
|
9190
9199
|
}
|
|
9191
9200
|
case ge: {
|
|
9192
9201
|
const ie = [te, Y];
|
|
9193
9202
|
ie.push(3 - ie[0] - ie[1]);
|
|
9194
9203
|
const se = { a: H[ie[0]], b: H[ie[1]], c: H[ie[2]] };
|
|
9195
|
-
A.push({ a: s, b: n, c: se.c, d: r, order: ie, real: se, faceIndex:
|
|
9204
|
+
A.push({ a: s, b: n, c: se.c, d: r, order: ie, real: se, faceIndex: L, consumed: _ });
|
|
9196
9205
|
break;
|
|
9197
9206
|
}
|
|
9198
9207
|
}
|
|
9199
9208
|
return A.length === l;
|
|
9200
|
-
} : function(
|
|
9201
|
-
const K = J(
|
|
9209
|
+
} : function(L) {
|
|
9210
|
+
const K = J(L);
|
|
9202
9211
|
if (!K)
|
|
9203
9212
|
return !1;
|
|
9204
|
-
const { posIndexes: H, consumed: _ } = K, G = H.map(
|
|
9213
|
+
const { posIndexes: H, consumed: _ } = K, G = H.map(g), Y = G.indexOf(v), te = G.indexOf(x), Z = G.indexOf(b), ne = Y === -1, ge = te === -1, ie = Z === -1;
|
|
9205
9214
|
if (ne + ge + ie !== 1)
|
|
9206
9215
|
return !1;
|
|
9207
9216
|
switch (!0) {
|
|
@@ -9209,21 +9218,21 @@ function Ku(a, e = {}) {
|
|
|
9209
9218
|
const se = [Z, te];
|
|
9210
9219
|
se.push(3 - se[0] - se[1]);
|
|
9211
9220
|
const Se = { a: H[se[0]], b: H[se[1]], c: H[se[2]] };
|
|
9212
|
-
A.push({ a: n, b: r, c: Se.c, d: s, order: se, real: Se, faceIndex:
|
|
9221
|
+
A.push({ a: n, b: r, c: Se.c, d: s, order: se, real: Se, faceIndex: L, consumed: _ });
|
|
9213
9222
|
break;
|
|
9214
9223
|
}
|
|
9215
9224
|
case ge: {
|
|
9216
9225
|
const se = [Y, Z];
|
|
9217
9226
|
se.push(3 - se[0] - se[1]);
|
|
9218
9227
|
const Se = { a: H[se[0]], b: H[se[1]], c: H[se[2]] };
|
|
9219
|
-
A.push({ a: s, b: n, c: Se.c, d: r, order: se, real: Se, faceIndex:
|
|
9228
|
+
A.push({ a: s, b: n, c: Se.c, d: r, order: se, real: Se, faceIndex: L, consumed: _ });
|
|
9220
9229
|
break;
|
|
9221
9230
|
}
|
|
9222
9231
|
default: {
|
|
9223
9232
|
const se = [te, Y];
|
|
9224
9233
|
se.push(3 - se[0] - se[1]);
|
|
9225
9234
|
const Se = { a: H[se[0]], b: H[se[1]], c: H[se[2]] };
|
|
9226
|
-
A.push({ a: r, b: s, c: Se.c, d: n, order: se, real: Se, faceIndex:
|
|
9235
|
+
A.push({ a: r, b: s, c: Se.c, d: n, order: se, real: Se, faceIndex: L, consumed: _ });
|
|
9227
9236
|
}
|
|
9228
9237
|
}
|
|
9229
9238
|
return A.length === l;
|
|
@@ -9262,8 +9271,8 @@ function Xu(a, e) {
|
|
|
9262
9271
|
for (let u = 0; u < r; u += 3) {
|
|
9263
9272
|
const h = e[u], p = e[u + 1], f = e[u + 2];
|
|
9264
9273
|
n.fromArray(a, h * 3), i.fromArray(a, p * 3), o.fromArray(a, f * 3), n.sub(i), o.sub(i), o.cross(n).normalize();
|
|
9265
|
-
const { x: d, y: m, z:
|
|
9266
|
-
(c[h] || (c[h] = [])).push(d, m,
|
|
9274
|
+
const { x: d, y: m, z: g } = o;
|
|
9275
|
+
(c[h] || (c[h] = [])).push(d, m, g), (c[p] || (c[p] = [])).push(d, m, g), (c[f] || (c[f] = [])).push(d, m, g);
|
|
9267
9276
|
}
|
|
9268
9277
|
const l = new Array(t);
|
|
9269
9278
|
for (let u = 0; u < s; u++) {
|
|
@@ -9272,12 +9281,12 @@ function Xu(a, e) {
|
|
|
9272
9281
|
if (h.length > 3) {
|
|
9273
9282
|
p = [0, 0, 0];
|
|
9274
9283
|
const d = h.length;
|
|
9275
|
-
for (let
|
|
9276
|
-
p[0] += h[
|
|
9284
|
+
for (let v = 0; v < d; v += 3)
|
|
9285
|
+
p[0] += h[v], p[1] += h[v + 1], p[2] += h[v + 2];
|
|
9277
9286
|
const m = 1 / (d / 3);
|
|
9278
9287
|
p[0] *= m, p[1] *= m, p[2] *= m;
|
|
9279
|
-
const
|
|
9280
|
-
p[0] *=
|
|
9288
|
+
const g = 1 / Math.hypot(...p);
|
|
9289
|
+
p[0] *= g, p[1] *= g, p[2] *= g;
|
|
9281
9290
|
}
|
|
9282
9291
|
const f = u * 3;
|
|
9283
9292
|
l[f] = p[0], l[f + 1] = p[1], l[f + 2] = p[2];
|
|
@@ -9765,14 +9774,14 @@ class vr extends gr {
|
|
|
9765
9774
|
appendVertex(e, t, s, r, n = !0) {
|
|
9766
9775
|
const { positions: i, normals: o, uvs: c } = t, { [e]: l, real: { [e]: u }, normalMatrix: h, matrixWorld: p, geometry: f } = this, { [e]: d } = n ? this.flatTriangle : this.triangle, m = s[r ? u : l] = i.length;
|
|
9767
9776
|
i.push(d.clone());
|
|
9768
|
-
const { attributes: { normal:
|
|
9777
|
+
const { attributes: { normal: g, uv: v } } = f;
|
|
9769
9778
|
if (o) {
|
|
9770
|
-
const
|
|
9771
|
-
n ? this.flatTriangle.getNormal(
|
|
9779
|
+
const x = new I();
|
|
9780
|
+
n ? this.flatTriangle.getNormal(x) : x.fromBufferAttribute(g, u), o.push(x);
|
|
9772
9781
|
}
|
|
9773
9782
|
if (c) {
|
|
9774
|
-
const
|
|
9775
|
-
c.push(
|
|
9783
|
+
const x = new oe().fromBufferAttribute(v, u);
|
|
9784
|
+
c.push(x);
|
|
9776
9785
|
}
|
|
9777
9786
|
return m;
|
|
9778
9787
|
}
|
|
@@ -9838,14 +9847,14 @@ class vr extends gr {
|
|
|
9838
9847
|
}
|
|
9839
9848
|
const [p, f] = At, d = to[0];
|
|
9840
9849
|
h.decompose(p, d, f);
|
|
9841
|
-
const m = [s, s + t],
|
|
9842
|
-
i.toArray(
|
|
9843
|
-
const
|
|
9844
|
-
o.toArray(
|
|
9845
|
-
const
|
|
9846
|
-
c.toArray(
|
|
9847
|
-
const
|
|
9848
|
-
return [
|
|
9850
|
+
const m = [s, s + t], g = [];
|
|
9851
|
+
i.toArray(g), p.toArray(g, g.length);
|
|
9852
|
+
const v = [];
|
|
9853
|
+
o.toArray(v), d.toArray(v, v.length);
|
|
9854
|
+
const x = [];
|
|
9855
|
+
c.toArray(x), f.toArray(x, x.length);
|
|
9856
|
+
const b = new Et(`${n}.position`, m, g), A = new Pt(`${n}.quaternion`, m, v), D = new Et(`${n}.scale`, m, x);
|
|
9857
|
+
return [b, A, D];
|
|
9849
9858
|
}
|
|
9850
9859
|
/**
|
|
9851
9860
|
* 为当前的三角面创建一个Mesh
|
|
@@ -9891,10 +9900,10 @@ class ei extends vr {
|
|
|
9891
9900
|
h || (h = no(s.attributes.position.count), s.index = new ys(h, 1));
|
|
9892
9901
|
const p = r * 3, f = h[p], d = h[p + 1], m = h[p + 2];
|
|
9893
9902
|
super({ geometry: s, a: f, b: d, c: m, faceIndex: r, order: [0, 1, 2] }), re(this, "origin", new I()), re(this, "normal"), re(this, "angle"), re(this, "xyPlane"), re(this, "xyPlaneMatrix", new X()), re(this, "meshMatrix", null), re(this, "flatRange", null), re(this, "_isBounded", !1);
|
|
9894
|
-
const { triangle:
|
|
9895
|
-
if (this.origin.copy(n ||
|
|
9896
|
-
let
|
|
9897
|
-
|
|
9903
|
+
const { triangle: g } = this;
|
|
9904
|
+
if (this.origin.copy(n || g.b), this.normal = i || g.getNormal(new I()), this.angle = o, this.meshMatrix = l, this.flatRange = u, u && l) {
|
|
9905
|
+
let v = l.getMaxScaleOnAxis();
|
|
9906
|
+
v = v === 0 ? 1 : 1 / v, this.flatRange = u.map((x) => x.multiplyScalar(v));
|
|
9898
9907
|
}
|
|
9899
9908
|
this.xyPlane = u ? !0 : c, this.updateFace(), this.updateChildrenBFS(e, this.flatRange);
|
|
9900
9909
|
}
|
|
@@ -9910,9 +9919,9 @@ class ei extends vr {
|
|
|
9910
9919
|
const { object: u, instanceId: h, point: p, normal: f, faceIndex: d, face: m } = l;
|
|
9911
9920
|
if (m == null)
|
|
9912
9921
|
return null;
|
|
9913
|
-
const { geometry:
|
|
9914
|
-
h == null ?
|
|
9915
|
-
const
|
|
9922
|
+
const { geometry: g, matrixWorld: v } = u, x = new X();
|
|
9923
|
+
h == null ? x.copy(v) : (u.getMatrixAt(h, x), x.premultiply(v));
|
|
9924
|
+
const b = Hu[0].copy(x).invert();
|
|
9916
9925
|
let A;
|
|
9917
9926
|
switch (i) {
|
|
9918
9927
|
case 1: {
|
|
@@ -9920,13 +9929,13 @@ class ei extends vr {
|
|
|
9920
9929
|
break;
|
|
9921
9930
|
}
|
|
9922
9931
|
case 2: {
|
|
9923
|
-
A = r.clone().negate(), A.transformDirection(
|
|
9932
|
+
A = r.clone().negate(), A.transformDirection(b);
|
|
9924
9933
|
break;
|
|
9925
9934
|
}
|
|
9926
9935
|
default:
|
|
9927
9936
|
A = m.normal;
|
|
9928
9937
|
}
|
|
9929
|
-
return p.applyMatrix4(
|
|
9938
|
+
return p.applyMatrix4(b), new ei({ ...o, geometry: g, origin: p, faceIndex: d, normal: A, angle: n, meshMatrix: x });
|
|
9930
9939
|
}
|
|
9931
9940
|
updateMatrix() {
|
|
9932
9941
|
if (!this.xyPlane)
|
|
@@ -10121,30 +10130,30 @@ function Fi(a, e, t, s, r) {
|
|
|
10121
10130
|
for (let c = 0; c < i; c += 3) {
|
|
10122
10131
|
const l = [], u = [], h = [];
|
|
10123
10132
|
for (let E = 0; E < n; E++) {
|
|
10124
|
-
const
|
|
10133
|
+
const O = a[E], k = o[E];
|
|
10125
10134
|
let U = c * k, q = U + k;
|
|
10126
|
-
l[E] =
|
|
10135
|
+
l[E] = O.slice(U, q), U = q, q += k, u[E] = O.slice(U, q), U = q, q += k, h[E] = O.slice(U, q);
|
|
10127
10136
|
}
|
|
10128
10137
|
const p = l[0][t] - s, f = u[0][t] - s, d = h[0][t] - s;
|
|
10129
|
-
let m = p > 0,
|
|
10130
|
-
s < 0 && (m = !m,
|
|
10131
|
-
let
|
|
10132
|
-
switch (m +
|
|
10138
|
+
let m = p > 0, g = f > 0, v = d > 0;
|
|
10139
|
+
s < 0 && (m = !m, g = !g, v = !v);
|
|
10140
|
+
let x, b, A, D;
|
|
10141
|
+
switch (m + g + v) {
|
|
10133
10142
|
case 0: {
|
|
10134
10143
|
for (let E = 0; E < n; E++)
|
|
10135
10144
|
r[E].push(...l[E], ...u[E], ...h[E]);
|
|
10136
10145
|
break;
|
|
10137
10146
|
}
|
|
10138
10147
|
case 1: {
|
|
10139
|
-
m ? (
|
|
10148
|
+
m ? (x = u, b = h, A = Ye(h, l, t, s), D = Ye(u, l, t, s)) : g ? (x = h, b = l, A = Ye(l, u, t, s), D = Ye(h, u, t, s)) : (x = l, b = u, A = Ye(u, h, t, s), D = Ye(l, h, t, s));
|
|
10140
10149
|
for (let E = 0; E < n; E++)
|
|
10141
|
-
r[E].push(...
|
|
10150
|
+
r[E].push(...x[E], ...b[E], ...A[E]), r[E].push(...A[E], ...D[E], ...x[E]);
|
|
10142
10151
|
break;
|
|
10143
10152
|
}
|
|
10144
10153
|
case 2: {
|
|
10145
|
-
m ?
|
|
10154
|
+
m ? g ? (x = h, b = Ye(l, h, t, s), A = Ye(u, h, t, s)) : (x = u, b = Ye(h, u, t, s), A = Ye(l, u, t, s)) : (x = l, b = Ye(u, l, t, s), A = Ye(h, l, t, s));
|
|
10146
10155
|
for (let E = 0; E < n; E++)
|
|
10147
|
-
r[E].push(...
|
|
10156
|
+
r[E].push(...x[E], ...b[E], ...A[E]);
|
|
10148
10157
|
break;
|
|
10149
10158
|
}
|
|
10150
10159
|
}
|
|
@@ -10226,19 +10235,19 @@ class cd extends Ie {
|
|
|
10226
10235
|
t.boundingBox || t.computeBoundingBox();
|
|
10227
10236
|
let c = o.normal;
|
|
10228
10237
|
if (!c) {
|
|
10229
|
-
const
|
|
10230
|
-
o.normal = c = new me(
|
|
10238
|
+
const x = Xu(e, (s = this.index) == null ? void 0 : s.array);
|
|
10239
|
+
o.normal = c = new me(x, 3);
|
|
10231
10240
|
}
|
|
10232
|
-
const { array: l, itemSize: u, count: h } = c, p = ro(l, u, i, !0), [f, d, m,
|
|
10233
|
-
t.boundingBox.getCenter(
|
|
10234
|
-
const
|
|
10235
|
-
for (let
|
|
10236
|
-
const
|
|
10237
|
-
f.fromArray(p,
|
|
10241
|
+
const { array: l, itemSize: u, count: h } = c, p = ro(l, u, i, !0), [f, d, m, g] = At;
|
|
10242
|
+
t.boundingBox.getCenter(g);
|
|
10243
|
+
const v = new Array(e.length);
|
|
10244
|
+
for (let x = 0; x < h; x++) {
|
|
10245
|
+
const b = x * u;
|
|
10246
|
+
f.fromArray(p, b), d.fromArray(e, b);
|
|
10238
10247
|
let A = r;
|
|
10239
|
-
n !== 0 && (m.subVectors(d,
|
|
10248
|
+
n !== 0 && (m.subVectors(d, g), A += m.dot(f) * n), A !== 0 && (m.copy(f).multiplyScalar(A), d.add(m)), d.toArray(v, b);
|
|
10240
10249
|
}
|
|
10241
|
-
return
|
|
10250
|
+
return v;
|
|
10242
10251
|
}
|
|
10243
10252
|
/**
|
|
10244
10253
|
* 生成距离uv
|
|
@@ -10362,8 +10371,8 @@ class ld extends cd {
|
|
|
10362
10371
|
const u = o.length, h = r.positions.length;
|
|
10363
10372
|
for (let f = 0; f < u; f++) {
|
|
10364
10373
|
const d = o[f], m = l[f] = [];
|
|
10365
|
-
for (let
|
|
10366
|
-
d[
|
|
10374
|
+
for (let g = 0; g < h; g++)
|
|
10375
|
+
d[g].toArray(m, m.length);
|
|
10367
10376
|
}
|
|
10368
10377
|
c && l.push(r.averagePositions), l = this.clipGeometryData(l, 3);
|
|
10369
10378
|
const p = {
|
|
@@ -10577,14 +10586,14 @@ function gd(a, e) {
|
|
|
10577
10586
|
class oo extends Re {
|
|
10578
10587
|
image;
|
|
10579
10588
|
constructor(e, t) {
|
|
10580
|
-
const { image: s, color: r, width: n, height: i, position: o, rotation: c, needLight: l, id: u, name: h, userData: p, level: f, visible: d, cache: m = !0, ...
|
|
10589
|
+
const { image: s, color: r, width: n, height: i, position: o, rotation: c, needLight: l, id: u, name: h, userData: p, level: f, visible: d, cache: m = !0, ...g } = e;
|
|
10581
10590
|
super({ id: u, name: h, position: o, rotation: c, userData: p, level: f, visible: d });
|
|
10582
|
-
const
|
|
10591
|
+
const v = s ? {
|
|
10583
10592
|
transparent: !0,
|
|
10584
|
-
...
|
|
10593
|
+
...g,
|
|
10585
10594
|
map: ti(s, m, t)
|
|
10586
|
-
} :
|
|
10587
|
-
this.geometry = new xs(n, i), this.material = l ? new An(
|
|
10595
|
+
} : g;
|
|
10596
|
+
this.geometry = new xs(n, i), this.material = l ? new An(v) : new ts(v), this.material.depthWrite = !this.material.transparent, this.image = s;
|
|
10588
10597
|
}
|
|
10589
10598
|
}
|
|
10590
10599
|
class co extends Re {
|
|
@@ -10594,8 +10603,8 @@ class co extends Re {
|
|
|
10594
10603
|
transparent: !0,
|
|
10595
10604
|
...f,
|
|
10596
10605
|
map: ti(r, p ?? !0, t)
|
|
10597
|
-
} : f,
|
|
10598
|
-
super(
|
|
10606
|
+
} : f, g = i ? new An(m) : new ts(m), { geometry: v, position: x } = hd(d), b = { id: o, name: c, userData: l, level: u, visible: h };
|
|
10607
|
+
super(b, v, g), this.position.copy(x), this.material = g, this.geometry = v, this.image = r;
|
|
10599
10608
|
}
|
|
10600
10609
|
}
|
|
10601
10610
|
const zi = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
@@ -10704,7 +10713,7 @@ class bd extends _i {
|
|
|
10704
10713
|
position: e[s - 1].position,
|
|
10705
10714
|
rotation: e[s - 1].rotation,
|
|
10706
10715
|
scale: e[s - 1].scale
|
|
10707
|
-
}, n = e[s], i = r.position, o = r.rotation, c = r.scale, l = n.position, u = n.rotation, h = n.scale, p = n.delay ?? 0, f = n.duration ?? 1e3, d = n.easing, m = n.repeat === -1 ? 1 / 0 : n.repeat ?? 0,
|
|
10716
|
+
}, n = e[s], i = r.position, o = r.rotation, c = r.scale, l = n.position, u = n.rotation, h = n.scale, p = n.delay ?? 0, f = n.duration ?? 1e3, d = n.easing, m = n.repeat === -1 ? 1 / 0 : n.repeat ?? 0, g = n.yoyo ?? !1, v = {
|
|
10708
10717
|
x: i.x,
|
|
10709
10718
|
y: i.y,
|
|
10710
10719
|
z: i.z,
|
|
@@ -10714,7 +10723,7 @@ class bd extends _i {
|
|
|
10714
10723
|
scaleX: c.x,
|
|
10715
10724
|
scaleY: c.y,
|
|
10716
10725
|
scaleZ: c.z
|
|
10717
|
-
},
|
|
10726
|
+
}, x = {
|
|
10718
10727
|
x: l.x,
|
|
10719
10728
|
y: l.y,
|
|
10720
10729
|
z: l.z,
|
|
@@ -10727,14 +10736,14 @@ class bd extends _i {
|
|
|
10727
10736
|
};
|
|
10728
10737
|
try {
|
|
10729
10738
|
await this.ssp.animation(
|
|
10730
|
-
|
|
10731
|
-
|
|
10732
|
-
{ delay: p, duration: f, mode: d, repeat: m, yoyo:
|
|
10733
|
-
(
|
|
10734
|
-
this.target.position.set(
|
|
10739
|
+
v,
|
|
10740
|
+
x,
|
|
10741
|
+
{ delay: p, duration: f, mode: d, repeat: m, yoyo: g },
|
|
10742
|
+
(b, A) => {
|
|
10743
|
+
this.target.position.set(b.x, b.y, b.z), this.target.rotation.set(b.rotationX, b.rotationY, b.rotationZ), this.target.scale.set(b.scaleX, b.scaleY, b.scaleZ), this.dispatchEvent({ type: "update", source: b, tween: A });
|
|
10735
10744
|
},
|
|
10736
|
-
(
|
|
10737
|
-
this.tweenSet.add(
|
|
10745
|
+
(b) => {
|
|
10746
|
+
this.tweenSet.add(b), this.dispatchEvent({ type: "start", tween: b });
|
|
10738
10747
|
}
|
|
10739
10748
|
);
|
|
10740
10749
|
} catch {
|
|
@@ -11673,43 +11682,43 @@ class Id {
|
|
|
11673
11682
|
let s = 0, r = 0, n = !1, i = [], o = [], c = [], l = [], u = [], h = [];
|
|
11674
11683
|
const p = this;
|
|
11675
11684
|
return e.vertexIndices.forEach(function(f, d) {
|
|
11676
|
-
let m,
|
|
11677
|
-
f < 0 && (f = f ^ -1,
|
|
11678
|
-
let
|
|
11685
|
+
let m, g = !1;
|
|
11686
|
+
f < 0 && (f = f ^ -1, g = !0);
|
|
11687
|
+
let v = [], x = [];
|
|
11679
11688
|
if (i.push(f * 3, f * 3 + 1, f * 3 + 2), e.color) {
|
|
11680
|
-
const
|
|
11681
|
-
c.push(
|
|
11689
|
+
const b = rr(d, s, f, e.color);
|
|
11690
|
+
c.push(b[0], b[1], b[2]);
|
|
11682
11691
|
}
|
|
11683
11692
|
if (e.skeleton) {
|
|
11684
|
-
if (e.weightTable[f] !== void 0 && e.weightTable[f].forEach(function(
|
|
11685
|
-
|
|
11686
|
-
}),
|
|
11693
|
+
if (e.weightTable[f] !== void 0 && e.weightTable[f].forEach(function(b) {
|
|
11694
|
+
x.push(b.weight), v.push(b.id);
|
|
11695
|
+
}), x.length > 4) {
|
|
11687
11696
|
n || (console.warn("THREE.FBXLoader: Vertex has more than 4 skinning weights assigned to vertex. Deleting additional weights."), n = !0);
|
|
11688
|
-
const
|
|
11689
|
-
|
|
11690
|
-
let
|
|
11697
|
+
const b = [0, 0, 0, 0], A = [0, 0, 0, 0];
|
|
11698
|
+
x.forEach(function(D, E) {
|
|
11699
|
+
let O = D, k = v[E];
|
|
11691
11700
|
A.forEach(function(U, q, J) {
|
|
11692
|
-
if (
|
|
11693
|
-
J[q] =
|
|
11694
|
-
const $ =
|
|
11695
|
-
|
|
11701
|
+
if (O > U) {
|
|
11702
|
+
J[q] = O, O = U;
|
|
11703
|
+
const $ = b[q];
|
|
11704
|
+
b[q] = k, k = $;
|
|
11696
11705
|
}
|
|
11697
11706
|
});
|
|
11698
|
-
}),
|
|
11707
|
+
}), v = b, x = A;
|
|
11699
11708
|
}
|
|
11700
|
-
for (;
|
|
11701
|
-
|
|
11702
|
-
for (let
|
|
11703
|
-
u.push(b
|
|
11709
|
+
for (; x.length < 4; )
|
|
11710
|
+
x.push(0), v.push(0);
|
|
11711
|
+
for (let b = 0; b < 4; ++b)
|
|
11712
|
+
u.push(x[b]), h.push(v[b]);
|
|
11704
11713
|
}
|
|
11705
11714
|
if (e.normal) {
|
|
11706
|
-
const
|
|
11707
|
-
o.push(
|
|
11715
|
+
const b = rr(d, s, f, e.normal);
|
|
11716
|
+
o.push(b[0], b[1], b[2]);
|
|
11708
11717
|
}
|
|
11709
|
-
e.material && e.material.mappingType !== "AllSame" && (m = rr(d, s, f, e.material)[0], m < 0 && (p.negativeMaterialIndices = !0, m = 0)), e.uv && e.uv.forEach(function(
|
|
11710
|
-
const D = rr(d, s, f,
|
|
11718
|
+
e.material && e.material.mappingType !== "AllSame" && (m = rr(d, s, f, e.material)[0], m < 0 && (p.negativeMaterialIndices = !0, m = 0)), e.uv && e.uv.forEach(function(b, A) {
|
|
11719
|
+
const D = rr(d, s, f, b);
|
|
11711
11720
|
l[A] === void 0 && (l[A] = []), l[A].push(D[0]), l[A].push(D[1]);
|
|
11712
|
-
}), r++,
|
|
11721
|
+
}), r++, g && (p.genFace(t, e, i, m, o, c, l, u, h, r), s++, r = 0, i = [], o = [], c = [], l = [], u = [], h = []);
|
|
11713
11722
|
}), t;
|
|
11714
11723
|
}
|
|
11715
11724
|
// See https://www.khronos.org/opengl/wiki/Calculating_a_Surface_Normal
|
|
@@ -11740,21 +11749,21 @@ class Id {
|
|
|
11740
11749
|
let h;
|
|
11741
11750
|
if (u > 3) {
|
|
11742
11751
|
const p = [];
|
|
11743
|
-
for (let
|
|
11752
|
+
for (let g = 0; g < s.length; g += 3)
|
|
11744
11753
|
p.push(new I(
|
|
11745
|
-
t.vertexPositions[s[
|
|
11746
|
-
t.vertexPositions[s[
|
|
11747
|
-
t.vertexPositions[s[
|
|
11754
|
+
t.vertexPositions[s[g]],
|
|
11755
|
+
t.vertexPositions[s[g + 1]],
|
|
11756
|
+
t.vertexPositions[s[g + 2]]
|
|
11748
11757
|
));
|
|
11749
11758
|
const { tangent: f, bitangent: d } = this.getNormalTangentAndBitangent(p), m = [];
|
|
11750
|
-
for (const
|
|
11751
|
-
m.push(this.flattenVertex(
|
|
11759
|
+
for (const g of p)
|
|
11760
|
+
m.push(this.flattenVertex(g, f, d));
|
|
11752
11761
|
h = jc.triangulateShape(m, []);
|
|
11753
11762
|
} else
|
|
11754
11763
|
h = [[0, 1, 2]];
|
|
11755
11764
|
for (const [p, f, d] of h)
|
|
11756
|
-
e.vertex.push(t.vertexPositions[s[p * 3]]), e.vertex.push(t.vertexPositions[s[p * 3 + 1]]), e.vertex.push(t.vertexPositions[s[p * 3 + 2]]), e.vertex.push(t.vertexPositions[s[f * 3]]), e.vertex.push(t.vertexPositions[s[f * 3 + 1]]), e.vertex.push(t.vertexPositions[s[f * 3 + 2]]), e.vertex.push(t.vertexPositions[s[d * 3]]), e.vertex.push(t.vertexPositions[s[d * 3 + 1]]), e.vertex.push(t.vertexPositions[s[d * 3 + 2]]), t.skeleton && (e.vertexWeights.push(c[p * 4]), e.vertexWeights.push(c[p * 4 + 1]), e.vertexWeights.push(c[p * 4 + 2]), e.vertexWeights.push(c[p * 4 + 3]), e.vertexWeights.push(c[f * 4]), e.vertexWeights.push(c[f * 4 + 1]), e.vertexWeights.push(c[f * 4 + 2]), e.vertexWeights.push(c[f * 4 + 3]), e.vertexWeights.push(c[d * 4]), e.vertexWeights.push(c[d * 4 + 1]), e.vertexWeights.push(c[d * 4 + 2]), e.vertexWeights.push(c[d * 4 + 3]), e.weightsIndices.push(l[p * 4]), e.weightsIndices.push(l[p * 4 + 1]), e.weightsIndices.push(l[p * 4 + 2]), e.weightsIndices.push(l[p * 4 + 3]), e.weightsIndices.push(l[f * 4]), e.weightsIndices.push(l[f * 4 + 1]), e.weightsIndices.push(l[f * 4 + 2]), e.weightsIndices.push(l[f * 4 + 3]), e.weightsIndices.push(l[d * 4]), e.weightsIndices.push(l[d * 4 + 1]), e.weightsIndices.push(l[d * 4 + 2]), e.weightsIndices.push(l[d * 4 + 3])), t.color && (e.colors.push(i[p * 3]), e.colors.push(i[p * 3 + 1]), e.colors.push(i[p * 3 + 2]), e.colors.push(i[f * 3]), e.colors.push(i[f * 3 + 1]), e.colors.push(i[f * 3 + 2]), e.colors.push(i[d * 3]), e.colors.push(i[d * 3 + 1]), e.colors.push(i[d * 3 + 2])), t.material && t.material.mappingType !== "AllSame" && (e.materialIndex.push(r), e.materialIndex.push(r), e.materialIndex.push(r)), t.normal && (e.normal.push(n[p * 3]), e.normal.push(n[p * 3 + 1]), e.normal.push(n[p * 3 + 2]), e.normal.push(n[f * 3]), e.normal.push(n[f * 3 + 1]), e.normal.push(n[f * 3 + 2]), e.normal.push(n[d * 3]), e.normal.push(n[d * 3 + 1]), e.normal.push(n[d * 3 + 2])), t.uv && t.uv.forEach(function(m,
|
|
11757
|
-
e.uvs[
|
|
11765
|
+
e.vertex.push(t.vertexPositions[s[p * 3]]), e.vertex.push(t.vertexPositions[s[p * 3 + 1]]), e.vertex.push(t.vertexPositions[s[p * 3 + 2]]), e.vertex.push(t.vertexPositions[s[f * 3]]), e.vertex.push(t.vertexPositions[s[f * 3 + 1]]), e.vertex.push(t.vertexPositions[s[f * 3 + 2]]), e.vertex.push(t.vertexPositions[s[d * 3]]), e.vertex.push(t.vertexPositions[s[d * 3 + 1]]), e.vertex.push(t.vertexPositions[s[d * 3 + 2]]), t.skeleton && (e.vertexWeights.push(c[p * 4]), e.vertexWeights.push(c[p * 4 + 1]), e.vertexWeights.push(c[p * 4 + 2]), e.vertexWeights.push(c[p * 4 + 3]), e.vertexWeights.push(c[f * 4]), e.vertexWeights.push(c[f * 4 + 1]), e.vertexWeights.push(c[f * 4 + 2]), e.vertexWeights.push(c[f * 4 + 3]), e.vertexWeights.push(c[d * 4]), e.vertexWeights.push(c[d * 4 + 1]), e.vertexWeights.push(c[d * 4 + 2]), e.vertexWeights.push(c[d * 4 + 3]), e.weightsIndices.push(l[p * 4]), e.weightsIndices.push(l[p * 4 + 1]), e.weightsIndices.push(l[p * 4 + 2]), e.weightsIndices.push(l[p * 4 + 3]), e.weightsIndices.push(l[f * 4]), e.weightsIndices.push(l[f * 4 + 1]), e.weightsIndices.push(l[f * 4 + 2]), e.weightsIndices.push(l[f * 4 + 3]), e.weightsIndices.push(l[d * 4]), e.weightsIndices.push(l[d * 4 + 1]), e.weightsIndices.push(l[d * 4 + 2]), e.weightsIndices.push(l[d * 4 + 3])), t.color && (e.colors.push(i[p * 3]), e.colors.push(i[p * 3 + 1]), e.colors.push(i[p * 3 + 2]), e.colors.push(i[f * 3]), e.colors.push(i[f * 3 + 1]), e.colors.push(i[f * 3 + 2]), e.colors.push(i[d * 3]), e.colors.push(i[d * 3 + 1]), e.colors.push(i[d * 3 + 2])), t.material && t.material.mappingType !== "AllSame" && (e.materialIndex.push(r), e.materialIndex.push(r), e.materialIndex.push(r)), t.normal && (e.normal.push(n[p * 3]), e.normal.push(n[p * 3 + 1]), e.normal.push(n[p * 3 + 2]), e.normal.push(n[f * 3]), e.normal.push(n[f * 3 + 1]), e.normal.push(n[f * 3 + 2]), e.normal.push(n[d * 3]), e.normal.push(n[d * 3 + 1]), e.normal.push(n[d * 3 + 2])), t.uv && t.uv.forEach(function(m, g) {
|
|
11766
|
+
e.uvs[g] === void 0 && (e.uvs[g] = []), e.uvs[g].push(o[g][p * 2]), e.uvs[g].push(o[g][p * 2 + 1]), e.uvs[g].push(o[g][f * 2]), e.uvs[g].push(o[g][f * 2 + 1]), e.uvs[g].push(o[g][d * 2]), e.uvs[g].push(o[g][d * 2 + 1]);
|
|
11758
11767
|
});
|
|
11759
11768
|
}
|
|
11760
11769
|
addMorphTargets(e, t, s, r) {
|
|
@@ -11954,13 +11963,13 @@ class Ad {
|
|
|
11954
11963
|
n[l] && (n[l][u.attr] = u);
|
|
11955
11964
|
} else if (u.curves.morph !== void 0) {
|
|
11956
11965
|
if (n[l] === void 0) {
|
|
11957
|
-
const h = Ce.get(c.ID).parents.filter(function(
|
|
11958
|
-
return
|
|
11959
|
-
})[0].ID, p = Ce.get(h).parents[0].ID, f = Ce.get(p).parents[0].ID, d = Ce.get(f).parents[0].ID, m = pe.Objects.Model[d],
|
|
11966
|
+
const h = Ce.get(c.ID).parents.filter(function(v) {
|
|
11967
|
+
return v.relationship !== void 0;
|
|
11968
|
+
})[0].ID, p = Ce.get(h).parents[0].ID, f = Ce.get(p).parents[0].ID, d = Ce.get(f).parents[0].ID, m = pe.Objects.Model[d], g = {
|
|
11960
11969
|
modelName: m.attrName ? ws.sanitizeNodeName(m.attrName) : "",
|
|
11961
11970
|
morphName: pe.Objects.Deformer[h].attrName
|
|
11962
11971
|
};
|
|
11963
|
-
n[l] =
|
|
11972
|
+
n[l] = g;
|
|
11964
11973
|
}
|
|
11965
11974
|
n[l][u.attr] = u;
|
|
11966
11975
|
}
|
|
@@ -12106,11 +12115,11 @@ class Ad {
|
|
|
12106
12115
|
Math.abs(p[2])
|
|
12107
12116
|
];
|
|
12108
12117
|
if (f[0] >= 180 || f[1] >= 180 || f[2] >= 180) {
|
|
12109
|
-
const m = Math.max(...f) / 180,
|
|
12110
|
-
|
|
12111
|
-
const A = e.times[o - 1], D = e.times[o] - A, E = new he(),
|
|
12118
|
+
const m = Math.max(...f) / 180, g = new fe(...l, r), v = new fe(...h, r), x = new he().setFromEuler(g), b = new he().setFromEuler(v);
|
|
12119
|
+
x.dot(b) && b.set(-b.x, -b.y, -b.z, -b.w);
|
|
12120
|
+
const A = e.times[o - 1], D = e.times[o] - A, E = new he(), O = new fe();
|
|
12112
12121
|
for (let k = 0; k < 1; k += 1 / m)
|
|
12113
|
-
E.copy(
|
|
12122
|
+
E.copy(x.clone().slerp(b.clone(), k)), n.push(A + k * D), O.setFromQuaternion(E, r), i.push(O.x), i.push(O.y), i.push(O.z);
|
|
12114
12123
|
} else
|
|
12115
12124
|
n.push(e.times[o]), i.push(Le.degToRad(e.values[o])), i.push(Le.degToRad(t.values[o])), i.push(Le.degToRad(s.values[o]));
|
|
12116
12125
|
}
|
|
@@ -12507,21 +12516,21 @@ function uo(a) {
|
|
|
12507
12516
|
a.scale && n.scale(ds.fromArray(a.scale)), a.scalingOffset && o.setPosition(ds.fromArray(a.scalingOffset)), a.scalingPivot && i.setPosition(ds.fromArray(a.scalingPivot)), a.rotationOffset && c.setPosition(ds.fromArray(a.rotationOffset)), a.rotationPivot && l.setPosition(ds.fromArray(a.rotationPivot)), a.parentMatrixWorld && (h.copy(a.parentMatrix), u.copy(a.parentMatrixWorld));
|
|
12508
12517
|
const d = t.clone().multiply(s).multiply(r), m = new X();
|
|
12509
12518
|
m.extractRotation(u);
|
|
12510
|
-
const
|
|
12511
|
-
|
|
12512
|
-
const
|
|
12519
|
+
const g = new X();
|
|
12520
|
+
g.copyPosition(u);
|
|
12521
|
+
const v = g.clone().invert().multiply(u), x = m.clone().invert().multiply(v), b = n, A = new X();
|
|
12513
12522
|
if (f === 0)
|
|
12514
|
-
A.copy(m).multiply(d).multiply(
|
|
12523
|
+
A.copy(m).multiply(d).multiply(x).multiply(b);
|
|
12515
12524
|
else if (f === 1)
|
|
12516
|
-
A.copy(m).multiply(
|
|
12525
|
+
A.copy(m).multiply(x).multiply(d).multiply(b);
|
|
12517
12526
|
else {
|
|
12518
|
-
const J = new X().scale(new I().setFromMatrixScale(h)).clone().invert(), $ =
|
|
12519
|
-
A.copy(m).multiply(d).multiply($).multiply(
|
|
12527
|
+
const J = new X().scale(new I().setFromMatrixScale(h)).clone().invert(), $ = x.clone().multiply(J);
|
|
12528
|
+
A.copy(m).multiply(d).multiply($).multiply(b);
|
|
12520
12529
|
}
|
|
12521
12530
|
const D = l.clone().invert(), E = i.clone().invert();
|
|
12522
|
-
let
|
|
12523
|
-
const k = new X().copyPosition(
|
|
12524
|
-
return p.copyPosition(U),
|
|
12531
|
+
let O = e.clone().multiply(c).multiply(l).multiply(t).multiply(s).multiply(r).multiply(D).multiply(o).multiply(i).multiply(n).multiply(E);
|
|
12532
|
+
const k = new X().copyPosition(O), U = u.clone().multiply(k);
|
|
12533
|
+
return p.copyPosition(U), O = p.clone().multiply(A), O.premultiply(u.invert()), O;
|
|
12525
12534
|
}
|
|
12526
12535
|
function po(a) {
|
|
12527
12536
|
a = a || 0;
|
|
@@ -12781,26 +12790,26 @@ class Vd extends ur {
|
|
|
12781
12790
|
}
|
|
12782
12791
|
} else if (u === "f") {
|
|
12783
12792
|
const p = l.slice(1).trim().split(Ui), f = [];
|
|
12784
|
-
for (let m = 0,
|
|
12785
|
-
const
|
|
12786
|
-
if (
|
|
12787
|
-
const
|
|
12788
|
-
f.push(
|
|
12793
|
+
for (let m = 0, g = p.length; m < g; m++) {
|
|
12794
|
+
const v = p[m];
|
|
12795
|
+
if (v.length > 0) {
|
|
12796
|
+
const x = v.split("/");
|
|
12797
|
+
f.push(x);
|
|
12789
12798
|
}
|
|
12790
12799
|
}
|
|
12791
12800
|
const d = f[0];
|
|
12792
|
-
for (let m = 1,
|
|
12793
|
-
const
|
|
12801
|
+
for (let m = 1, g = f.length - 1; m < g; m++) {
|
|
12802
|
+
const v = f[m], x = f[m + 1];
|
|
12794
12803
|
t.addFace(
|
|
12795
12804
|
d[0],
|
|
12796
|
-
|
|
12797
|
-
|
|
12805
|
+
v[0],
|
|
12806
|
+
x[0],
|
|
12798
12807
|
d[1],
|
|
12799
|
-
|
|
12800
|
-
|
|
12808
|
+
v[1],
|
|
12809
|
+
x[1],
|
|
12801
12810
|
d[2],
|
|
12802
|
-
|
|
12803
|
-
|
|
12811
|
+
v[2],
|
|
12812
|
+
x[2]
|
|
12804
12813
|
);
|
|
12805
12814
|
}
|
|
12806
12815
|
} else if (u === "l") {
|
|
@@ -12811,8 +12820,8 @@ class Vd extends ur {
|
|
|
12811
12820
|
p = h;
|
|
12812
12821
|
else
|
|
12813
12822
|
for (let d = 0, m = h.length; d < m; d++) {
|
|
12814
|
-
const
|
|
12815
|
-
|
|
12823
|
+
const g = h[d].split("/");
|
|
12824
|
+
g[0] !== "" && p.push(g[0]), g[1] !== "" && f.push(g[1]);
|
|
12816
12825
|
}
|
|
12817
12826
|
t.addLineGeometry(p, f);
|
|
12818
12827
|
} else if (u === "p") {
|
|
@@ -12849,31 +12858,31 @@ class Vd extends ur {
|
|
|
12849
12858
|
if (u.vertices.length === 0) continue;
|
|
12850
12859
|
const m = new Ie();
|
|
12851
12860
|
m.setAttribute("position", new me(u.vertices, 3)), u.normals.length > 0 && m.setAttribute("normal", new me(u.normals, 3)), u.colors.length > 0 && (d = !0, m.setAttribute("color", new me(u.colors, 3))), u.hasUVIndices === !0 && m.setAttribute("uv", new me(u.uvs, 2));
|
|
12852
|
-
const
|
|
12853
|
-
for (let
|
|
12854
|
-
const A = h[
|
|
12861
|
+
const g = [];
|
|
12862
|
+
for (let x = 0, b = h.length; x < b; x++) {
|
|
12863
|
+
const A = h[x], D = A.name + "_" + A.smooth + "_" + d;
|
|
12855
12864
|
let E = t.materials[D];
|
|
12856
12865
|
if (this.materials !== null) {
|
|
12857
12866
|
if (E = this.materials.create(A.name), p && E && !(E instanceof Gt)) {
|
|
12858
|
-
const
|
|
12859
|
-
$e.prototype.copy.call(
|
|
12867
|
+
const O = new Gt();
|
|
12868
|
+
$e.prototype.copy.call(O, E), O.color.copy(E.color), E = O;
|
|
12860
12869
|
} else if (f && E && !(E instanceof $s)) {
|
|
12861
|
-
const
|
|
12862
|
-
$e.prototype.copy.call(
|
|
12870
|
+
const O = new $s({ size: 10, sizeAttenuation: !1 });
|
|
12871
|
+
$e.prototype.copy.call(O, E), O.color.copy(E.color), O.map = E.map, E = O;
|
|
12863
12872
|
}
|
|
12864
12873
|
}
|
|
12865
|
-
E === void 0 && (p ? E = new Gt() : f ? E = new $s({ size: 1, sizeAttenuation: !1 }) : E = new Be(), E.name = A.name, E.flatShading = !A.smooth, E.vertexColors = d, t.materials[D] = E),
|
|
12874
|
+
E === void 0 && (p ? E = new Gt() : f ? E = new $s({ size: 1, sizeAttenuation: !1 }) : E = new Be(), E.name = A.name, E.flatShading = !A.smooth, E.vertexColors = d, t.materials[D] = E), g.push(E);
|
|
12866
12875
|
}
|
|
12867
|
-
let
|
|
12868
|
-
if (
|
|
12869
|
-
for (let
|
|
12870
|
-
const A = h[
|
|
12871
|
-
m.addGroup(A.groupStart, A.groupCount,
|
|
12876
|
+
let v;
|
|
12877
|
+
if (g.length > 1) {
|
|
12878
|
+
for (let x = 0, b = h.length; x < b; x++) {
|
|
12879
|
+
const A = h[x];
|
|
12880
|
+
m.addGroup(A.groupStart, A.groupCount, x);
|
|
12872
12881
|
}
|
|
12873
|
-
p ?
|
|
12882
|
+
p ? v = new vt(m, g) : f ? v = new Rs(m, g) : v = new ye(m, g);
|
|
12874
12883
|
} else
|
|
12875
|
-
p ?
|
|
12876
|
-
|
|
12884
|
+
p ? v = new vt(m, g[0]) : f ? v = new Rs(m, g[0]) : v = new ye(m, g[0]);
|
|
12885
|
+
v.name = l.name, n.add(v);
|
|
12877
12886
|
}
|
|
12878
12887
|
else if (t.vertices.length > 0) {
|
|
12879
12888
|
const o = new $s({ size: 1, sizeAttenuation: !1 }), c = new Ie();
|
|
@@ -13012,24 +13021,24 @@ class sp {
|
|
|
13012
13021
|
}, e.getFloat32(t, this.isLE), t += 4, e.getFloat32(t, this.isLE), t += 4, e.getFloat32(t, this.isLE), t += 4, e.getFloat32(t, this.isLE), t += 4;
|
|
13013
13022
|
const m = e.getFloat32(t, this.isLE);
|
|
13014
13023
|
t += 4;
|
|
13015
|
-
const
|
|
13024
|
+
const g = e.getFloat32(t, this.isLE);
|
|
13016
13025
|
t += 4;
|
|
13017
|
-
const
|
|
13026
|
+
const v = e.getFloat32(t, this.isLE);
|
|
13018
13027
|
t += 4;
|
|
13019
|
-
const
|
|
13028
|
+
const x = e.getFloat32(t, this.isLE);
|
|
13020
13029
|
t += 4, e.getFloat32(t, this.isLE), t += 4, e.getFloat32(t, this.isLE), t += 4, e.getFloat32(t, this.isLE), t += 4, e.getFloat32(t, this.isLE), t += 4;
|
|
13021
|
-
let
|
|
13022
|
-
t += 1,
|
|
13030
|
+
let b = e.getUint8(t);
|
|
13031
|
+
t += 1, b === 0 ? b = vs : b === 1 ? b = Ns : b === 2 && (b = nt);
|
|
13023
13032
|
const A = e.getUint16(t, this.isLE);
|
|
13024
13033
|
t += 2;
|
|
13025
13034
|
const D = A > 0 ? Hi(e, A, t) : "";
|
|
13026
13035
|
if (t += A, !this.materials.has(d)) {
|
|
13027
|
-
const E = [m,
|
|
13028
|
-
if (this.materials.set(d,
|
|
13036
|
+
const E = [m, g, v, x, b], O = Cn(d, E, Sn(D));
|
|
13037
|
+
if (this.materials.set(d, O), u[d].materialInfo = E, D) {
|
|
13029
13038
|
const {
|
|
13030
13039
|
url: k
|
|
13031
13040
|
} = this.sbmInfo, U = Wi(k, D);
|
|
13032
|
-
u[d].textureUrl = U, Tn(
|
|
13041
|
+
u[d].textureUrl = U, Tn(O, U);
|
|
13033
13042
|
}
|
|
13034
13043
|
}
|
|
13035
13044
|
}
|
|
@@ -13043,11 +13052,11 @@ class sp {
|
|
|
13043
13052
|
position: new ArrayBuffer(0),
|
|
13044
13053
|
uv: new ArrayBuffer(0)
|
|
13045
13054
|
};
|
|
13046
|
-
const
|
|
13055
|
+
const g = [], v = [], x = [], b = [], A = e.getUint16(t, this.isLE);
|
|
13047
13056
|
if (t += 2, A > 0)
|
|
13048
13057
|
for (let P = 0; P < A; P++) {
|
|
13049
13058
|
const Q = new I();
|
|
13050
|
-
Q.setX(e.getFloat32(t, this.isLE)), t += 4, Q.setY(e.getFloat32(t, this.isLE)), t += 4, Q.setZ(e.getFloat32(t, this.isLE)), t += 4,
|
|
13059
|
+
Q.setX(e.getFloat32(t, this.isLE)), t += 4, Q.setY(e.getFloat32(t, this.isLE)), t += 4, Q.setZ(e.getFloat32(t, this.isLE)), t += 4, g.push(Q);
|
|
13051
13060
|
}
|
|
13052
13061
|
const D = e.getUint16(t, this.isLE);
|
|
13053
13062
|
if (t += 2, D > 0)
|
|
@@ -13057,30 +13066,30 @@ class sp {
|
|
|
13057
13066
|
if (t += 2, E > 0)
|
|
13058
13067
|
for (let P = 0; P < E; P++) {
|
|
13059
13068
|
const Q = new oe();
|
|
13060
|
-
Q.setX(e.getFloat32(t, this.isLE)), t += 4, Q.setY(e.getFloat32(t, this.isLE)), t += 4,
|
|
13069
|
+
Q.setX(e.getFloat32(t, this.isLE)), t += 4, Q.setY(e.getFloat32(t, this.isLE)), t += 4, v.push(Q);
|
|
13061
13070
|
}
|
|
13062
|
-
const
|
|
13063
|
-
if (t += 2,
|
|
13064
|
-
for (let P = 0; P <
|
|
13071
|
+
const O = e.getUint16(t, this.isLE);
|
|
13072
|
+
if (t += 2, O > 0)
|
|
13073
|
+
for (let P = 0; P < O; P++) {
|
|
13065
13074
|
const Q = e.getUint16(t, this.isLE);
|
|
13066
13075
|
t += 2;
|
|
13067
13076
|
const R = e.getUint16(t, this.isLE);
|
|
13068
13077
|
t += 2;
|
|
13069
|
-
const
|
|
13078
|
+
const L = e.getUint16(t, this.isLE);
|
|
13070
13079
|
t += 2;
|
|
13071
|
-
const K = [Q, R,
|
|
13072
|
-
|
|
13073
|
-
|
|
13074
|
-
|
|
13075
|
-
|
|
13080
|
+
const K = [Q, R, L];
|
|
13081
|
+
x.push(K), v.length > 0 && b.push([
|
|
13082
|
+
v[K[0]],
|
|
13083
|
+
v[K[1]],
|
|
13084
|
+
v[K[2]]
|
|
13076
13085
|
]);
|
|
13077
13086
|
}
|
|
13078
13087
|
const k = [], U = [];
|
|
13079
|
-
for (let P = 0; P <
|
|
13080
|
-
const Q =
|
|
13081
|
-
k.push(...R.toArray(), ...
|
|
13088
|
+
for (let P = 0; P < x.length; P++) {
|
|
13089
|
+
const Q = x[P], R = g[Q[0]], L = g[Q[1]], K = g[Q[2]];
|
|
13090
|
+
k.push(...R.toArray(), ...L.toArray(), ...K.toArray());
|
|
13082
13091
|
let H = new oe(), _ = new oe(), G = new oe();
|
|
13083
|
-
const Y =
|
|
13092
|
+
const Y = b[P];
|
|
13084
13093
|
Y !== void 0 && (H = Y[0], _ = Y[1], G = Y[2]), U.push(...H.toArray(), ..._.toArray(), ...G.toArray());
|
|
13085
13094
|
}
|
|
13086
13095
|
const q = new Float32Array(k), J = new Float32Array(U);
|
|
@@ -13123,24 +13132,24 @@ class sp {
|
|
|
13123
13132
|
}, e.getFloat32(t, this.isLE), t += 4, e.getFloat32(t, this.isLE), t += 4, e.getFloat32(t, this.isLE), t += 4, e.getFloat32(t, this.isLE), t += 4;
|
|
13124
13133
|
const m = e.getFloat32(t, this.isLE);
|
|
13125
13134
|
t += 4;
|
|
13126
|
-
const
|
|
13135
|
+
const g = e.getFloat32(t, this.isLE);
|
|
13127
13136
|
t += 4;
|
|
13128
|
-
const
|
|
13137
|
+
const v = e.getFloat32(t, this.isLE);
|
|
13129
13138
|
t += 4;
|
|
13130
|
-
const
|
|
13139
|
+
const x = e.getFloat32(t, this.isLE);
|
|
13131
13140
|
t += 4, e.getFloat32(t, this.isLE), t += 4, e.getFloat32(t, this.isLE), t += 4, e.getFloat32(t, this.isLE), t += 4, e.getFloat32(t, this.isLE), t += 4;
|
|
13132
|
-
let
|
|
13133
|
-
t += 1,
|
|
13141
|
+
let b = e.getUint8(t);
|
|
13142
|
+
t += 1, b === 0 ? b = vs : b === 1 ? b = Ns : b === 2 && (b = nt);
|
|
13134
13143
|
const A = e.getUint16(t, this.isLE);
|
|
13135
13144
|
t += 2;
|
|
13136
13145
|
const D = A > 0 ? Hi(e, A, t) : "";
|
|
13137
13146
|
if (t += A, !this.materials.has(d)) {
|
|
13138
|
-
const E = [m,
|
|
13139
|
-
if (this.materials.set(d,
|
|
13147
|
+
const E = [m, g, v, x, b], O = Cn(d, E, Sn(D));
|
|
13148
|
+
if (this.materials.set(d, O), u[d].materialInfo = E, D) {
|
|
13140
13149
|
const {
|
|
13141
13150
|
url: k
|
|
13142
13151
|
} = this.sbmInfo, U = Wi(k, D);
|
|
13143
|
-
u[d].textureUrl = U, Tn(
|
|
13152
|
+
u[d].textureUrl = U, Tn(O, U);
|
|
13144
13153
|
}
|
|
13145
13154
|
}
|
|
13146
13155
|
}
|
|
@@ -13150,55 +13159,55 @@ class sp {
|
|
|
13150
13159
|
t += 2;
|
|
13151
13160
|
const m = e.getUint16(t, this.isLE);
|
|
13152
13161
|
t += 2;
|
|
13153
|
-
let
|
|
13162
|
+
let g = "";
|
|
13154
13163
|
if (m > 0) {
|
|
13155
13164
|
const R = new Uint8Array(e.buffer, t, m);
|
|
13156
|
-
|
|
13165
|
+
g = tp.decode(R), t += m;
|
|
13157
13166
|
}
|
|
13158
|
-
const
|
|
13167
|
+
const v = e.getUint16(t, this.isLE).toString();
|
|
13159
13168
|
t += 2, h[d] = {
|
|
13160
|
-
meshName:
|
|
13161
|
-
materialId:
|
|
13169
|
+
meshName: g,
|
|
13170
|
+
materialId: v,
|
|
13162
13171
|
position: new ArrayBuffer(0),
|
|
13163
13172
|
uv: new ArrayBuffer(0)
|
|
13164
13173
|
};
|
|
13165
|
-
const
|
|
13174
|
+
const x = [], b = [], A = [], D = [], E = e.getUint32(t, this.isLE);
|
|
13166
13175
|
if (t += 4, E > 0)
|
|
13167
13176
|
for (let R = 0; R < E; R++) {
|
|
13168
|
-
const
|
|
13169
|
-
|
|
13177
|
+
const L = new I();
|
|
13178
|
+
L.setX(e.getFloat32(t, this.isLE)), t += 4, L.setY(e.getFloat32(t, this.isLE)), t += 4, L.setZ(e.getFloat32(t, this.isLE)), t += 4, x.push(L);
|
|
13170
13179
|
}
|
|
13171
|
-
const
|
|
13172
|
-
if (t += 4,
|
|
13173
|
-
for (let R = 0; R <
|
|
13174
|
-
const
|
|
13175
|
-
|
|
13180
|
+
const O = e.getUint32(t, this.isLE);
|
|
13181
|
+
if (t += 4, O > 0)
|
|
13182
|
+
for (let R = 0; R < O; R++) {
|
|
13183
|
+
const L = new I();
|
|
13184
|
+
L.setX(e.getFloat32(t, this.isLE)), t += 4, L.setY(e.getFloat32(t, this.isLE)), t += 4, L.setZ(e.getFloat32(t, this.isLE)), t += 4;
|
|
13176
13185
|
}
|
|
13177
13186
|
const k = e.getUint32(t, this.isLE);
|
|
13178
13187
|
if (t += 4, k > 0)
|
|
13179
13188
|
for (let R = 0; R < k; R++) {
|
|
13180
|
-
const
|
|
13181
|
-
|
|
13189
|
+
const L = new oe();
|
|
13190
|
+
L.setX(e.getFloat32(t, this.isLE)), t += 4, L.setY(e.getFloat32(t, this.isLE)), t += 4, b.push(L);
|
|
13182
13191
|
}
|
|
13183
13192
|
const U = e.getUint32(t, this.isLE);
|
|
13184
13193
|
if (t += 4, U > 0)
|
|
13185
13194
|
for (let R = 0; R < U; R++) {
|
|
13186
|
-
const
|
|
13195
|
+
const L = e.getUint32(t, this.isLE);
|
|
13187
13196
|
t += 4;
|
|
13188
13197
|
const K = e.getUint32(t, this.isLE);
|
|
13189
13198
|
t += 4;
|
|
13190
13199
|
const H = e.getUint32(t, this.isLE);
|
|
13191
13200
|
t += 4;
|
|
13192
|
-
const _ = [
|
|
13193
|
-
A.push(_),
|
|
13194
|
-
|
|
13195
|
-
|
|
13196
|
-
|
|
13201
|
+
const _ = [L, K, H];
|
|
13202
|
+
A.push(_), b.length > 0 && D.push([
|
|
13203
|
+
b[_[0]],
|
|
13204
|
+
b[_[1]],
|
|
13205
|
+
b[_[2]]
|
|
13197
13206
|
]);
|
|
13198
13207
|
}
|
|
13199
13208
|
const q = [], J = [];
|
|
13200
13209
|
for (let R = 0; R < A.length; R++) {
|
|
13201
|
-
const
|
|
13210
|
+
const L = A[R], K = x[L[0]], H = x[L[1]], _ = x[L[2]];
|
|
13202
13211
|
q.push(...K.toArray(), ...H.toArray(), ..._.toArray());
|
|
13203
13212
|
let G = new oe(), Y = new oe(), te = new oe();
|
|
13204
13213
|
const Z = D[R];
|
|
@@ -13209,9 +13218,9 @@ class sp {
|
|
|
13209
13218
|
const P = new Ie();
|
|
13210
13219
|
$.length > 0 && P.setAttribute("position", new qe($, 3)), F.length > 0 && P.setAttribute("uv", new qe(F, 2)), P.computeVertexNormals();
|
|
13211
13220
|
const Q = P.getAttribute("normal").array.buffer;
|
|
13212
|
-
if (h[d].normal = Q, this.materials.has(
|
|
13213
|
-
const R = new ye(P, this.materials.get(
|
|
13214
|
-
R.name =
|
|
13221
|
+
if (h[d].normal = Q, this.materials.has(v)) {
|
|
13222
|
+
const R = new ye(P, this.materials.get(v));
|
|
13223
|
+
R.name = g || d, R.castShadow = !0, R.receiveShadow = !0, o.add(R);
|
|
13215
13224
|
}
|
|
13216
13225
|
n.loaded++, n.timeStamp = performance.now() - r, s?.(n);
|
|
13217
13226
|
}
|
|
@@ -13272,10 +13281,10 @@ class ip {
|
|
|
13272
13281
|
for (const [o, c] of Object.entries(i)) {
|
|
13273
13282
|
const { meshName: l, materialId: u, position: h, uv: p, normal: f } = c, d = this.materials.get(u.toString());
|
|
13274
13283
|
if (d) {
|
|
13275
|
-
const m = new Ie(),
|
|
13276
|
-
|
|
13277
|
-
const
|
|
13278
|
-
|
|
13284
|
+
const m = new Ie(), g = new Float32Array(h), v = new Float32Array(p), x = f && new Float32Array(f);
|
|
13285
|
+
g.length > 0 && m.setAttribute("position", new qe(g, 3)), v.length > 0 && m.setAttribute("uv", new qe(v, 2)), x && x.length > 0 ? m.setAttribute("normal", new qe(x, 3)) : m.computeVertexNormals();
|
|
13286
|
+
const b = new ye(m, d);
|
|
13287
|
+
b.name = l || o, b.castShadow = !0, b.receiveShadow = !0, r.add(b);
|
|
13279
13288
|
}
|
|
13280
13289
|
}
|
|
13281
13290
|
return s;
|
|
@@ -13382,11 +13391,11 @@ class ap extends Mt {
|
|
|
13382
13391
|
onClick: f,
|
|
13383
13392
|
onDblClick: d,
|
|
13384
13393
|
onRightClick: m,
|
|
13385
|
-
onLoad:
|
|
13386
|
-
userData:
|
|
13387
|
-
extraIds:
|
|
13388
|
-
} = t,
|
|
13389
|
-
|
|
13394
|
+
onLoad: g,
|
|
13395
|
+
userData: v,
|
|
13396
|
+
extraIds: x
|
|
13397
|
+
} = t, b = fi.clone(e);
|
|
13398
|
+
b.animations = b.animations.map((A) => A.clone()), i && (b.sid = i), o && (b.name = o), c && (b.level = c), l === !1 ? b.hide() : l === !0 && b.show(), u && b.position.set(u.x, u.y, u.z), h && b.rotation.set(h.x, h.y, h.z), p && b.scale.set(p.x, p.y, p.z), f ? b.onClick = f.bind(b) : b.onClick = null, d ? b.onDblClick = d.bind(b) : b.onDblClick = null, m ? b.onRightClick = m.bind(b) : b.onRightClick = null, g ? b.onLoad = g.bind(b) : b.onLoad = null, b.onLoad?.(b), v && (b.userData = v), x && (b.extraIds = x), s !== null && this.viewport.scener.addObject(b, s || this.scene || e.parent), r(b);
|
|
13390
13399
|
});
|
|
13391
13400
|
}
|
|
13392
13401
|
async loadToGroup(e, t) {
|
|
@@ -13594,8 +13603,8 @@ class op extends Mt {
|
|
|
13594
13603
|
borderWidth: p = 3
|
|
13595
13604
|
} = t, f = document.createElement("canvas");
|
|
13596
13605
|
f.width = s, f.height = r;
|
|
13597
|
-
const d = f.getContext("2d"), m = s * 0.5,
|
|
13598
|
-
return d && (u && (d.fillStyle = u, d.fillRect(0, 0, s, r)), h && (d.strokeStyle = h, d.lineWidth = p, d.strokeRect(0, 0, s, r), d.lineWidth = 1), d.font = n, d.fillStyle = i, d.strokeStyle = o, d.textAlign = c, d.textBaseline = l, d.strokeText(e, m,
|
|
13606
|
+
const d = f.getContext("2d"), m = s * 0.5, g = r * 0.5;
|
|
13607
|
+
return d && (u && (d.fillStyle = u, d.fillRect(0, 0, s, r)), h && (d.strokeStyle = h, d.lineWidth = p, d.strokeRect(0, 0, s, r), d.lineWidth = 1), d.font = n, d.fillStyle = i, d.strokeStyle = o, d.textAlign = c, d.textBaseline = l, d.strokeText(e, m, g, s), d.fillText(e, m, g, s)), f;
|
|
13599
13608
|
}
|
|
13600
13609
|
_computeMaterialSizeAttenuation(e, t) {
|
|
13601
13610
|
return t === "2D" || t === "2d" ? e.sizeAttenuation = !1 : (t === "2.5D" || t === "2.5d") && (e.sizeAttenuation = !0), e;
|
|
@@ -13634,15 +13643,15 @@ class op extends Mt {
|
|
|
13634
13643
|
rotation: f,
|
|
13635
13644
|
scale: d,
|
|
13636
13645
|
onClick: m,
|
|
13637
|
-
onDblClick:
|
|
13638
|
-
onRightClick:
|
|
13639
|
-
userData:
|
|
13640
|
-
} = t,
|
|
13641
|
-
if (n !==
|
|
13642
|
-
const A =
|
|
13643
|
-
A.map?.dispose(), A.map = this._createTextTexture(t),
|
|
13646
|
+
onDblClick: g,
|
|
13647
|
+
onRightClick: v,
|
|
13648
|
+
userData: x
|
|
13649
|
+
} = t, b = e.clone();
|
|
13650
|
+
if (n !== b.name && b.text) {
|
|
13651
|
+
const A = b.text.material.clone();
|
|
13652
|
+
A.map?.dispose(), A.map = this._createTextTexture(t), b.text.material = A;
|
|
13644
13653
|
}
|
|
13645
|
-
return o &&
|
|
13654
|
+
return o && b.text?.position.set(o.x, o.y, o.z), c && b.text?.scale.set(c.x, c.y, c.z), l && b.icon?.scale.set(l.x, l.y, l.z), r && (b.sid = r), n && (b.name = n), i && (b.level = i), u && (b.scaleFixed = u), Dr(h) && (b.visible = h), p && b.position.set(p.x, p.y, p.z), f && b.rotation.set(f.x, f.y, f.z), d && b.scale.set(d.x, d.y, d.z), m ? b.onClick = m.bind(b) : b.onClick = null, g ? b.onDblClick = g.bind(b) : b.onDblClick = null, v ? b.onRightClick = v.bind(b) : b.onRightClick = null, x && (b.userData = x), s !== null && this.viewport.scener.addObject(b, s || this.scene || e.parent), b;
|
|
13646
13655
|
}
|
|
13647
13656
|
createToGroup(e, t) {
|
|
13648
13657
|
const s = this.createGroup(e, null);
|
|
@@ -13836,33 +13845,33 @@ class pp extends Mt {
|
|
|
13836
13845
|
ze(p) ? p.forEach((d) => {
|
|
13837
13846
|
u = [...u, ...d.state], h = [...h, ...d.transition];
|
|
13838
13847
|
}) : (u = [...u, ...p.state], h = [...h, ...p.transition]), u.forEach((d, m) => {
|
|
13839
|
-
const
|
|
13848
|
+
const g = d.State._attributes["gml:id"], v = d.State.topoNode["gml:Node"].node_name;
|
|
13840
13849
|
c.push({
|
|
13841
|
-
id: Vt(
|
|
13842
|
-
name: Vt(
|
|
13850
|
+
id: Vt(g) ? g : "",
|
|
13851
|
+
name: Vt(v) ? v : "",
|
|
13843
13852
|
position: {
|
|
13844
13853
|
x: Number(d.State.topoNode["gml:Node"].xcoord["#text"]),
|
|
13845
13854
|
y: Number(d.State.topoNode["gml:Node"].zcoord["#text"]),
|
|
13846
13855
|
z: Number(d.State.topoNode["gml:Node"].ycoord["#text"]) * -1
|
|
13847
13856
|
},
|
|
13848
13857
|
graphs: []
|
|
13849
|
-
}), l.set(
|
|
13858
|
+
}), l.set(g, m);
|
|
13850
13859
|
}), h.forEach((d) => {
|
|
13851
|
-
const m = d.Transition.topoEdge["gml:Edge"]["gml:directedNode"][0]._attributes["xlink:href"],
|
|
13852
|
-
|
|
13853
|
-
targetNodeId:
|
|
13860
|
+
const m = d.Transition.topoEdge["gml:Edge"]["gml:directedNode"][0]._attributes["xlink:href"], g = d.Transition.topoEdge["gml:Edge"]["gml:directedNode"][1]._attributes["xlink:href"], v = d.Transition.topoEdge["gml:Edge"].passable["#text"], x = l.get(m), b = l.get(g), A = d.Transition._attributes["gml:id"], D = d.Transition.topoEdge["gml:Edge"].link_name["#text"];
|
|
13861
|
+
x !== void 0 && b !== void 0 && (v !== "2" && v !== "3" && c[x].graphs.push({
|
|
13862
|
+
targetNodeId: g,
|
|
13854
13863
|
linkInfo: {
|
|
13855
13864
|
id: A,
|
|
13856
13865
|
name: D
|
|
13857
13866
|
},
|
|
13858
|
-
passable: +
|
|
13859
|
-
}),
|
|
13867
|
+
passable: +v
|
|
13868
|
+
}), v !== "1" && v !== "3" && c[b].graphs.push({
|
|
13860
13869
|
targetNodeId: m,
|
|
13861
13870
|
linkInfo: {
|
|
13862
13871
|
id: A,
|
|
13863
13872
|
name: D
|
|
13864
13873
|
},
|
|
13865
|
-
passable: +
|
|
13874
|
+
passable: +v
|
|
13866
13875
|
}));
|
|
13867
13876
|
});
|
|
13868
13877
|
const f = new mt({
|
|
@@ -13962,8 +13971,8 @@ class pp extends Mt {
|
|
|
13962
13971
|
const l = e.nodes.reduce((d, m) => (d.set(m.sid, m), d), /* @__PURE__ */ new Map());
|
|
13963
13972
|
for (const [, d] of l) {
|
|
13964
13973
|
if (d.graphs.length === 0) continue;
|
|
13965
|
-
const m = d.getWorldPosition(new I()),
|
|
13966
|
-
|
|
13974
|
+
const m = d.getWorldPosition(new I()), g = m.distanceTo(s), v = m.distanceTo(r);
|
|
13975
|
+
g < i && (i = g, n = d), v < c && (c = v, o = d);
|
|
13967
13976
|
}
|
|
13968
13977
|
if (!n || !o || n.sid === o.sid) return null;
|
|
13969
13978
|
const u = n.sid, h = o.sid, p = this.dijkstra.getPath(u, h);
|
|
@@ -13985,8 +13994,8 @@ class pp extends Mt {
|
|
|
13985
13994
|
const l = e.nodes.reduce((d, m) => (d.set(m.sid, m), d), /* @__PURE__ */ new Map());
|
|
13986
13995
|
for (const [, d] of l) {
|
|
13987
13996
|
if (d.graphs.length === 0) continue;
|
|
13988
|
-
const m = d.getWorldPosition(new I()),
|
|
13989
|
-
|
|
13997
|
+
const m = d.getWorldPosition(new I()), g = m.distanceTo(s), v = m.distanceTo(r);
|
|
13998
|
+
g < i && (i = g, n = d), v < c && (c = v, o = d);
|
|
13990
13999
|
}
|
|
13991
14000
|
if (!n || !o || n.sid === o.sid) return null;
|
|
13992
14001
|
const u = n.sid, h = o.sid, p = await this.dijkstraWorker.getPath(u, h);
|
|
@@ -14338,18 +14347,18 @@ class yp extends Mt {
|
|
|
14338
14347
|
scale: new I()
|
|
14339
14348
|
};
|
|
14340
14349
|
c.matrixWorld.decompose(d.position, d.quaternion, d.scale), d.scale.multiply(e.textureAspect), c.getWorldPosition(h), p.set(-f[8], -f[9], -f[10]).normalize(), ar.set(h, p), ar.near = 0, ar.far = n;
|
|
14341
|
-
const [m] = ar.intersectObjects(i).filter(({ object:
|
|
14350
|
+
const [m] = ar.intersectObjects(i).filter(({ object: g }) => !(g instanceof Mn));
|
|
14342
14351
|
if (m) {
|
|
14343
|
-
const { object:
|
|
14352
|
+
const { object: g } = m, v = new fe().setFromRotationMatrix(c.matrixWorld, "XYZ"), x = new ld({
|
|
14344
14353
|
offsetUnits: o,
|
|
14345
14354
|
...t,
|
|
14346
|
-
object:
|
|
14355
|
+
object: g,
|
|
14347
14356
|
origin: h,
|
|
14348
14357
|
direction: p,
|
|
14349
|
-
angle:
|
|
14358
|
+
angle: v.z,
|
|
14350
14359
|
size: new oe().copy(d.scale)
|
|
14351
|
-
}),
|
|
14352
|
-
return
|
|
14360
|
+
}), b = c.matrixWorld.clone().invert();
|
|
14361
|
+
return x.meshMatrix && b.multiply(x.meshMatrix), x.applyMatrix4(b), c.geometry = x, e;
|
|
14353
14362
|
}
|
|
14354
14363
|
}
|
|
14355
14364
|
const { x: l, y: u } = e.textureAspect;
|