@realsee/five 6.4.0 → 6.4.2
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/docs/classes/five.Tile3DModel.html +1 -1
- package/five/index.js +4 -4
- package/five/index.mjs +6 -6
- package/gltf-loader/index.js +3 -3
- package/gltf-loader/index.mjs +3 -3
- package/line/index.js +3 -3
- package/line/index.mjs +3 -3
- package/package.json +1 -1
- package/plugins/index.js +2 -2
- package/plugins/index.mjs +2 -2
- package/react/index.js +2 -2
- package/react/index.mjs +2 -2
- package/shader-lib/index.js +34 -21
- package/shader-lib/index.mjs +140 -127
- package/sticker/index.js +3 -3
- package/sticker/index.mjs +3 -3
- package/umd/five-gltf-loader.js +3 -3
- package/umd/five-line.js +3 -3
- package/umd/five-plugins.js +2 -2
- package/umd/five-react.js +2 -2
- package/umd/five-shader-lib.js +34 -21
- package/umd/five-sticker.js +3 -3
- package/umd/five-vfx.js +2 -2
- package/umd/five-vue.js +2 -2
- package/umd/five.js +4 -4
- package/vfx/index.js +2 -2
- package/vfx/index.mjs +2 -2
- package/vue/index.js +2 -2
- package/vue/index.mjs +2 -2
- package/work-downloader/index.d.ts +1 -0
- package/work-downloader/index.js +3 -3
- package/work-downloader/index.mjs +230 -266
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* @license
|
|
3
3
|
* @realsee/five
|
|
4
|
-
* Generated:
|
|
5
|
-
* Version: 6.4.
|
|
4
|
+
* Generated: 6/20/2025
|
|
5
|
+
* Version: 6.4.2
|
|
6
6
|
* Terms:
|
|
7
7
|
* Realsee SDK License Agreement
|
|
8
8
|
* Update: July 28, 2021
|
|
@@ -252,22 +252,13 @@
|
|
|
252
252
|
* No amendment to or modification of this Agreement will be binding unless in
|
|
253
253
|
* writing and signed by Realsee. You and Realsee hereto confirm that this
|
|
254
254
|
* Agreement and all related documents shall be drafted in English.
|
|
255
|
-
*/import { createWriteStream as
|
|
256
|
-
import {
|
|
257
|
-
import { dirname as
|
|
258
|
-
import { Readable as
|
|
259
|
-
import
|
|
260
|
-
|
|
261
|
-
|
|
262
|
-
for (var r, i = 1, s = arguments.length; i < s; i++) {
|
|
263
|
-
r = arguments[i];
|
|
264
|
-
for (var n in r) Object.prototype.hasOwnProperty.call(r, n) && (e[n] = r[n]);
|
|
265
|
-
}
|
|
266
|
-
return e;
|
|
267
|
-
}, I.apply(this, arguments);
|
|
268
|
-
};
|
|
269
|
-
function y(t, e, r, i) {
|
|
270
|
-
function s(n) {
|
|
255
|
+
*/import { createWriteStream as q, existsSync as D } from "node:fs";
|
|
256
|
+
import { writeFile as M, mkdir as A, readFile as H } from "node:fs/promises";
|
|
257
|
+
import { dirname as K, extname as Q, join as _, resolve as B } from "node:path";
|
|
258
|
+
import { Readable as V } from "node:stream";
|
|
259
|
+
import Y from "sharp";
|
|
260
|
+
function k(t, e, r, i) {
|
|
261
|
+
function a(n) {
|
|
271
262
|
return n instanceof r ? n : new r(function(o) {
|
|
272
263
|
o(n);
|
|
273
264
|
});
|
|
@@ -275,183 +266,155 @@ function y(t, e, r, i) {
|
|
|
275
266
|
return new (r || (r = Promise))(function(n, o) {
|
|
276
267
|
function u(c) {
|
|
277
268
|
try {
|
|
278
|
-
|
|
279
|
-
} catch (
|
|
280
|
-
o(
|
|
269
|
+
s(i.next(c));
|
|
270
|
+
} catch (l) {
|
|
271
|
+
o(l);
|
|
281
272
|
}
|
|
282
273
|
}
|
|
283
|
-
function
|
|
274
|
+
function f(c) {
|
|
284
275
|
try {
|
|
285
|
-
|
|
286
|
-
} catch (
|
|
287
|
-
o(
|
|
276
|
+
s(i.throw(c));
|
|
277
|
+
} catch (l) {
|
|
278
|
+
o(l);
|
|
288
279
|
}
|
|
289
280
|
}
|
|
290
|
-
function
|
|
291
|
-
c.done ? n(c.value) :
|
|
281
|
+
function s(c) {
|
|
282
|
+
c.done ? n(c.value) : a(c.value).then(u, f);
|
|
292
283
|
}
|
|
293
|
-
|
|
284
|
+
s((i = i.apply(t, e || [])).next());
|
|
294
285
|
});
|
|
295
286
|
}
|
|
296
|
-
function
|
|
287
|
+
function y(t, e) {
|
|
297
288
|
var r = { label: 0, sent: function() {
|
|
298
289
|
if (n[0] & 1) throw n[1];
|
|
299
290
|
return n[1];
|
|
300
|
-
}, trys: [], ops: [] }, i,
|
|
291
|
+
}, trys: [], ops: [] }, i, a, n, o = Object.create((typeof Iterator == "function" ? Iterator : Object).prototype);
|
|
301
292
|
return o.next = u(0), o.throw = u(1), o.return = u(2), typeof Symbol == "function" && (o[Symbol.iterator] = function() {
|
|
302
293
|
return this;
|
|
303
294
|
}), o;
|
|
304
|
-
function u(
|
|
295
|
+
function u(s) {
|
|
305
296
|
return function(c) {
|
|
306
|
-
return
|
|
297
|
+
return f([s, c]);
|
|
307
298
|
};
|
|
308
299
|
}
|
|
309
|
-
function
|
|
300
|
+
function f(s) {
|
|
310
301
|
if (i) throw new TypeError("Generator is already executing.");
|
|
311
|
-
for (; o && (o = 0,
|
|
312
|
-
if (i = 1,
|
|
313
|
-
switch (
|
|
302
|
+
for (; o && (o = 0, s[0] && (r = 0)), r; ) try {
|
|
303
|
+
if (i = 1, a && (n = s[0] & 2 ? a.return : s[0] ? a.throw || ((n = a.return) && n.call(a), 0) : a.next) && !(n = n.call(a, s[1])).done) return n;
|
|
304
|
+
switch (a = 0, n && (s = [s[0] & 2, n.value]), s[0]) {
|
|
314
305
|
case 0:
|
|
315
306
|
case 1:
|
|
316
|
-
n =
|
|
307
|
+
n = s;
|
|
317
308
|
break;
|
|
318
309
|
case 4:
|
|
319
|
-
return r.label++, { value:
|
|
310
|
+
return r.label++, { value: s[1], done: !1 };
|
|
320
311
|
case 5:
|
|
321
|
-
r.label++,
|
|
312
|
+
r.label++, a = s[1], s = [0];
|
|
322
313
|
continue;
|
|
323
314
|
case 7:
|
|
324
|
-
|
|
315
|
+
s = r.ops.pop(), r.trys.pop();
|
|
325
316
|
continue;
|
|
326
317
|
default:
|
|
327
|
-
if (n = r.trys, !(n = n.length > 0 && n[n.length - 1]) && (
|
|
318
|
+
if (n = r.trys, !(n = n.length > 0 && n[n.length - 1]) && (s[0] === 6 || s[0] === 2)) {
|
|
328
319
|
r = 0;
|
|
329
320
|
continue;
|
|
330
321
|
}
|
|
331
|
-
if (
|
|
332
|
-
r.label =
|
|
322
|
+
if (s[0] === 3 && (!n || s[1] > n[0] && s[1] < n[3])) {
|
|
323
|
+
r.label = s[1];
|
|
333
324
|
break;
|
|
334
325
|
}
|
|
335
|
-
if (
|
|
336
|
-
r.label = n[1], n =
|
|
326
|
+
if (s[0] === 6 && r.label < n[1]) {
|
|
327
|
+
r.label = n[1], n = s;
|
|
337
328
|
break;
|
|
338
329
|
}
|
|
339
330
|
if (n && r.label < n[2]) {
|
|
340
|
-
r.label = n[2], r.ops.push(
|
|
331
|
+
r.label = n[2], r.ops.push(s);
|
|
341
332
|
break;
|
|
342
333
|
}
|
|
343
334
|
n[2] && r.ops.pop(), r.trys.pop();
|
|
344
335
|
continue;
|
|
345
336
|
}
|
|
346
|
-
|
|
337
|
+
s = e.call(t, r);
|
|
347
338
|
} catch (c) {
|
|
348
|
-
|
|
339
|
+
s = [6, c], a = 0;
|
|
349
340
|
} finally {
|
|
350
341
|
i = n = 0;
|
|
351
342
|
}
|
|
352
|
-
if (
|
|
353
|
-
return { value:
|
|
343
|
+
if (s[0] & 5) throw s[1];
|
|
344
|
+
return { value: s[0] ? s[1] : void 0, done: !0 };
|
|
354
345
|
}
|
|
355
346
|
}
|
|
356
|
-
function
|
|
347
|
+
function j(t, e) {
|
|
357
348
|
if (e && e[e.length - 1] !== "/" && (e += "/"), t.length > e.length && t.startsWith(e))
|
|
358
349
|
return t.slice(e.length);
|
|
359
350
|
throw new Error("".concat(t, " is not starting with ").concat(e));
|
|
360
351
|
}
|
|
361
|
-
|
|
362
|
-
|
|
363
|
-
|
|
364
|
-
|
|
365
|
-
|
|
366
|
-
function A(t, e) {
|
|
367
|
-
return y(this, void 0, void 0, function() {
|
|
368
|
-
var r, i, s, n, o;
|
|
369
|
-
return p(this, function(u) {
|
|
352
|
+
var Z = 1024 * 1024 * 5;
|
|
353
|
+
function S(t, e, r) {
|
|
354
|
+
return k(this, void 0, void 0, function() {
|
|
355
|
+
var i, a, n, o;
|
|
356
|
+
return y(this, function(u) {
|
|
370
357
|
switch (u.label) {
|
|
371
358
|
case 0:
|
|
372
|
-
return
|
|
359
|
+
return D(e) ? [2, e] : [4, r(t)];
|
|
373
360
|
case 1:
|
|
374
|
-
|
|
375
|
-
return [2, r];
|
|
376
|
-
throw new Error(r.statusText);
|
|
361
|
+
return i = u.sent(), i.ok && i.body ? [4, A(K(e), { recursive: !0 })] : [3, 6];
|
|
377
362
|
case 2:
|
|
378
|
-
|
|
379
|
-
|
|
363
|
+
return u.sent(), a = Number((o = i.headers.get("content-length")) !== null && o !== void 0 ? o : "Infinity"), a > Z ? [2, new Promise(function(f, s) {
|
|
364
|
+
var c = V.fromWeb(i.body), l = q(e);
|
|
365
|
+
c.pipe(l), c.on("error", s), l.on("finish", function() {
|
|
366
|
+
return f(e);
|
|
367
|
+
});
|
|
368
|
+
})] : [3, 3];
|
|
380
369
|
case 3:
|
|
381
|
-
return
|
|
370
|
+
return [4, i.arrayBuffer()];
|
|
382
371
|
case 4:
|
|
383
|
-
return u.sent(), [4,
|
|
372
|
+
return n = u.sent(), [4, M(e, Buffer.from(n))];
|
|
384
373
|
case 5:
|
|
385
|
-
return
|
|
374
|
+
return u.sent(), [2, e];
|
|
386
375
|
case 6:
|
|
387
|
-
|
|
388
|
-
case 7:
|
|
389
|
-
return [
|
|
390
|
-
2
|
|
391
|
-
/*return*/
|
|
392
|
-
];
|
|
376
|
+
throw new Error("url: ".concat(t, "(").concat(i.statusText, ")"));
|
|
393
377
|
}
|
|
394
378
|
});
|
|
395
379
|
});
|
|
396
380
|
}
|
|
397
|
-
function
|
|
398
|
-
return
|
|
399
|
-
var r, i, s;
|
|
400
|
-
return
|
|
401
|
-
|
|
402
|
-
case 0:
|
|
403
|
-
return U(e) ? [2, e] : [4, A(t)];
|
|
404
|
-
case 1:
|
|
405
|
-
return r = n.sent(), r.ok && r.body ? (i = Z.fromWeb(r.body), [4, q(X(e), { recursive: !0 })]) : [3, 3];
|
|
406
|
-
case 2:
|
|
407
|
-
return n.sent(), s = K(e), [2, new Promise(function(o, u) {
|
|
408
|
-
i.pipe(s), i.on("error", u), s.on("finish", function() {
|
|
409
|
-
return o(e);
|
|
410
|
-
});
|
|
411
|
-
})];
|
|
412
|
-
case 3:
|
|
413
|
-
throw new Error(r.statusText);
|
|
414
|
-
}
|
|
415
|
-
});
|
|
416
|
-
});
|
|
417
|
-
}
|
|
418
|
-
function J(t, e) {
|
|
419
|
-
return y(this, void 0, void 0, function() {
|
|
420
|
-
var r, i, s, n, o, u, l, a, c, f;
|
|
421
|
-
return p(this, function(m) {
|
|
422
|
-
return r = Y(t).slice(1) || "jpg", i = e.cut, s = e.size, n = e.format, o = n === void 0 ? r : n, u = x(t), i && (u = u.extract({
|
|
381
|
+
function W(t, e) {
|
|
382
|
+
return k(this, void 0, void 0, function() {
|
|
383
|
+
var r, i, a, n, o, u, f, s, c, l;
|
|
384
|
+
return y(this, function(d) {
|
|
385
|
+
return r = Q(t).slice(1) || "jpg", i = e.cut, a = e.size, n = e.format, o = n === void 0 ? r : n, u = Y(t), i && (u = u.extract({
|
|
423
386
|
left: i[0],
|
|
424
387
|
top: i[1],
|
|
425
388
|
width: i[2],
|
|
426
389
|
height: i[3]
|
|
427
|
-
})),
|
|
428
|
-
return
|
|
429
|
-
}).join(".")),
|
|
430
|
-
return
|
|
431
|
-
})] : [2,
|
|
390
|
+
})), a && (u = u.resize(a)), o && (u = u.toFormat(o)), f = "", e.toFilename ? f = e.toFilename(t, { cut: e.cut, size: e.size, format: e.format }) : (s = "", c = "", l = o, i && (s = i.join("x")), a && (c = "".concat(a, "x")), l === r && !c && !s && (l = ""), f = [t, s, c, l].filter(function(m) {
|
|
391
|
+
return m.length > 0;
|
|
392
|
+
}).join(".")), f !== t && !D(f) ? [2, u.toFile(f).then(function() {
|
|
393
|
+
return f;
|
|
394
|
+
})] : [2, f];
|
|
432
395
|
});
|
|
433
396
|
});
|
|
434
397
|
}
|
|
435
|
-
function
|
|
398
|
+
function G(t) {
|
|
436
399
|
var e = [];
|
|
437
400
|
if (t.content && (t.content.uri ? e.push(t.content.uri) : t.content.url && e.push(t.content.url)), t.children)
|
|
438
401
|
for (var r = 0, i = t.children; r < i.length; r++) {
|
|
439
|
-
var
|
|
402
|
+
var a = i[r], n = G(a);
|
|
440
403
|
n.length > 0 && e.push.apply(e, n);
|
|
441
404
|
}
|
|
442
405
|
return e;
|
|
443
406
|
}
|
|
444
|
-
function
|
|
445
|
-
return
|
|
446
|
-
var i,
|
|
447
|
-
return
|
|
407
|
+
function x(t, e, r) {
|
|
408
|
+
return k(this, void 0, void 0, function() {
|
|
409
|
+
var i, a, n;
|
|
410
|
+
return y(this, function(o) {
|
|
448
411
|
switch (o.label) {
|
|
449
412
|
case 0:
|
|
450
|
-
return i = new URL(t, e).href,
|
|
413
|
+
return i = new URL(t, e).href, a = _(r.distPath, j(i, r.baseURL)), n = S(i, a, r.fetch), r.log(function(u) {
|
|
451
414
|
return "download: ".concat(i, " -> ").concat(u);
|
|
452
415
|
}, n), [4, n];
|
|
453
416
|
case 1:
|
|
454
|
-
return o.sent(), /\.json$/.test(t) ? [4,
|
|
417
|
+
return o.sent(), /\.json$/.test(t) ? [4, X(i, r)] : [3, 3];
|
|
455
418
|
case 2:
|
|
456
419
|
o.sent(), o.label = 3;
|
|
457
420
|
case 3:
|
|
@@ -463,53 +426,53 @@ function re(t, e, r) {
|
|
|
463
426
|
});
|
|
464
427
|
});
|
|
465
428
|
}
|
|
466
|
-
function
|
|
467
|
-
return
|
|
468
|
-
var r, i,
|
|
469
|
-
return
|
|
470
|
-
switch (
|
|
429
|
+
function X(t, e) {
|
|
430
|
+
return k(this, void 0, void 0, function() {
|
|
431
|
+
var r, i, a, n, o, u, f, s, c, l, d, m, w, v, h, p, P, z;
|
|
432
|
+
return y(this, function(g) {
|
|
433
|
+
switch (g.label) {
|
|
471
434
|
case 0:
|
|
472
|
-
return r = _(e.distPath,
|
|
473
|
-
return "download: ".concat(t, " -> ").concat(
|
|
435
|
+
return r = _(e.distPath, j(t, e.baseURL)), i = S(t, r, e.fetch), e.log(function(b) {
|
|
436
|
+
return "download: ".concat(t, " -> ").concat(b);
|
|
474
437
|
}, i), [4, i];
|
|
475
438
|
case 1:
|
|
476
|
-
return
|
|
439
|
+
return g.sent(), o = (n = JSON).parse, [4, H(r, "utf8")];
|
|
477
440
|
case 2:
|
|
478
|
-
return
|
|
479
|
-
return "download: ".concat(u, " -> ").concat(
|
|
480
|
-
},
|
|
441
|
+
return a = o.apply(n, [g.sent()]), a.asset.overview ? (u = new URL(a.asset.overview.imageFile, t).href, f = _(e.distPath, j(u, e.baseURL)), s = S(u, f, e.fetch), e.log(function(b) {
|
|
442
|
+
return "download: ".concat(u, " -> ").concat(b);
|
|
443
|
+
}, s), [4, s]) : [3, 4];
|
|
481
444
|
case 3:
|
|
482
|
-
|
|
445
|
+
g.sent(), g.label = 4;
|
|
483
446
|
case 4:
|
|
484
|
-
if (!
|
|
485
|
-
c = function(
|
|
486
|
-
var
|
|
487
|
-
return
|
|
488
|
-
switch (
|
|
447
|
+
if (!a.asset.trajectories) return [3, 8];
|
|
448
|
+
c = function(b) {
|
|
449
|
+
var F, O, R;
|
|
450
|
+
return y(this, function(I) {
|
|
451
|
+
switch (I.label) {
|
|
489
452
|
case 0:
|
|
490
|
-
return
|
|
491
|
-
return "download: ".concat(
|
|
492
|
-
},
|
|
453
|
+
return F = new URL(b.file, t).href, O = _(e.distPath, j(F, e.baseURL)), R = S(F, O, e.fetch), e.log(function(E) {
|
|
454
|
+
return "download: ".concat(F, " -> ").concat(E);
|
|
455
|
+
}, R), [4, R];
|
|
493
456
|
case 1:
|
|
494
|
-
return
|
|
457
|
+
return I.sent(), [
|
|
495
458
|
2
|
|
496
459
|
/*return*/
|
|
497
460
|
];
|
|
498
461
|
}
|
|
499
462
|
});
|
|
500
|
-
},
|
|
463
|
+
}, l = 0, d = a.asset.trajectories.list, g.label = 5;
|
|
501
464
|
case 5:
|
|
502
|
-
return
|
|
465
|
+
return l < d.length ? (m = d[l], [5, c(m)]) : [3, 8];
|
|
503
466
|
case 6:
|
|
504
|
-
|
|
467
|
+
g.sent(), g.label = 7;
|
|
505
468
|
case 7:
|
|
506
|
-
return
|
|
469
|
+
return l++, [3, 5];
|
|
507
470
|
case 8:
|
|
508
|
-
for (w =
|
|
509
|
-
P =
|
|
510
|
-
return [4, Promise.all(
|
|
471
|
+
for (w = G(a.root), v = [], h = 0, p = w; h < p.length; h++)
|
|
472
|
+
P = p[h], z = x(P, t, e), v.push(z);
|
|
473
|
+
return [4, Promise.all(v)];
|
|
511
474
|
case 9:
|
|
512
|
-
return
|
|
475
|
+
return g.sent(), [
|
|
513
476
|
2
|
|
514
477
|
/*return*/
|
|
515
478
|
];
|
|
@@ -517,59 +480,59 @@ function H(t, e) {
|
|
|
517
480
|
});
|
|
518
481
|
});
|
|
519
482
|
}
|
|
520
|
-
function
|
|
521
|
-
return
|
|
522
|
-
var r, i,
|
|
523
|
-
return
|
|
524
|
-
switch (
|
|
483
|
+
function ee(t, e) {
|
|
484
|
+
return k(this, void 0, void 0, function() {
|
|
485
|
+
var r, i, a, n, o, u, f, s, c, l, d, m, w, v;
|
|
486
|
+
return y(this, function(h) {
|
|
487
|
+
switch (h.label) {
|
|
525
488
|
case 0:
|
|
526
|
-
return e.log("process model"), t.model ? (r = t.model, i = r.textures,
|
|
527
|
-
return "download: ".concat(n, " -> ").concat(
|
|
489
|
+
return e.log("process model"), t.model ? (r = t.model, i = r.textures, a = r.layers, n = r.file, n ? (e.log("process model file"), o = _(e.distPath, j(n, e.baseURL)), u = S(n, o, e.fetch), e.log(function(p) {
|
|
490
|
+
return "download: ".concat(n, " -> ").concat(p);
|
|
528
491
|
}, u), [4, u]) : [3, 5]) : [3, 9];
|
|
529
492
|
case 1:
|
|
530
|
-
if (
|
|
531
|
-
|
|
532
|
-
var P,
|
|
533
|
-
return
|
|
534
|
-
switch (
|
|
493
|
+
if (h.sent(), !i) return [3, 5];
|
|
494
|
+
f = function(p) {
|
|
495
|
+
var P, z, g, b, F, O, R, I, E, $, J, N;
|
|
496
|
+
return y(this, function(C) {
|
|
497
|
+
switch (C.label) {
|
|
535
498
|
case 0:
|
|
536
|
-
return P = _(e.distPath,
|
|
537
|
-
return "download: ".concat(
|
|
538
|
-
},
|
|
499
|
+
return P = _(e.distPath, j(p, e.baseURL)), z = S(p, P, e.fetch), e.log(function(U) {
|
|
500
|
+
return "download: ".concat(p, " -> ").concat(U);
|
|
501
|
+
}, z), [4, z];
|
|
539
502
|
case 1:
|
|
540
|
-
for (
|
|
541
|
-
for (
|
|
542
|
-
|
|
543
|
-
format:
|
|
544
|
-
size:
|
|
503
|
+
for (C.sent(), g = e.imageOptions.format, g.length === 0 && g.push(void 0), b = e.imageOptions.size, b.length === 0 && b.push(void 0), F = [], O = 0, R = g; O < R.length; O++)
|
|
504
|
+
for (I = R[O], E = 0, $ = b; E < $.length; E++)
|
|
505
|
+
J = $[E], N = W(P, {
|
|
506
|
+
format: I,
|
|
507
|
+
size: J,
|
|
545
508
|
toFilename: e.imageProcessingFilename
|
|
546
|
-
}), e.log(function(
|
|
547
|
-
return "imageProcessing: ".concat(P, " -> ").concat(
|
|
548
|
-
}, N),
|
|
549
|
-
return [4, Promise.all(
|
|
509
|
+
}), e.log(function(U) {
|
|
510
|
+
return "imageProcessing: ".concat(P, " -> ").concat(U);
|
|
511
|
+
}, N), F.push(N);
|
|
512
|
+
return [4, Promise.all(F)];
|
|
550
513
|
case 2:
|
|
551
|
-
return
|
|
514
|
+
return C.sent(), [
|
|
552
515
|
2
|
|
553
516
|
/*return*/
|
|
554
517
|
];
|
|
555
518
|
}
|
|
556
519
|
});
|
|
557
|
-
},
|
|
520
|
+
}, s = 0, c = i, h.label = 2;
|
|
558
521
|
case 2:
|
|
559
|
-
return
|
|
522
|
+
return s < c.length ? (l = c[s], [5, f(l)]) : [3, 5];
|
|
560
523
|
case 3:
|
|
561
|
-
|
|
524
|
+
h.sent(), h.label = 4;
|
|
562
525
|
case 4:
|
|
563
|
-
return
|
|
526
|
+
return s++, [3, 2];
|
|
564
527
|
case 5:
|
|
565
|
-
if (!
|
|
566
|
-
|
|
528
|
+
if (!a) return [3, 9];
|
|
529
|
+
d = 0, m = a, h.label = 6;
|
|
567
530
|
case 6:
|
|
568
|
-
return
|
|
531
|
+
return d < m.length ? (w = m[d], v = w.tileset, e.log("process model layer"), [4, X(v, e)]) : [3, 9];
|
|
569
532
|
case 7:
|
|
570
|
-
|
|
533
|
+
h.sent(), h.label = 8;
|
|
571
534
|
case 8:
|
|
572
|
-
return
|
|
535
|
+
return d++, [3, 6];
|
|
573
536
|
case 9:
|
|
574
537
|
return [
|
|
575
538
|
2
|
|
@@ -579,36 +542,36 @@ function ne(t, e) {
|
|
|
579
542
|
});
|
|
580
543
|
});
|
|
581
544
|
}
|
|
582
|
-
function
|
|
583
|
-
return
|
|
584
|
-
var i,
|
|
585
|
-
return
|
|
586
|
-
switch (
|
|
545
|
+
function L(t, e, r) {
|
|
546
|
+
return k(this, void 0, void 0, function() {
|
|
547
|
+
var i, a, n, o, u, f, s, c, l, d, m, w, v;
|
|
548
|
+
return y(this, function(h) {
|
|
549
|
+
switch (h.label) {
|
|
587
550
|
case 0:
|
|
588
|
-
return i = _(r.distPath,
|
|
589
|
-
return "download: ".concat(t, " -> ").concat(
|
|
590
|
-
},
|
|
551
|
+
return i = _(r.distPath, j(t, r.baseURL)), a = S(t, i, r.fetch), r.log(function(p) {
|
|
552
|
+
return "download: ".concat(t, " -> ").concat(p);
|
|
553
|
+
}, a), [4, a];
|
|
591
554
|
case 1:
|
|
592
|
-
if (
|
|
593
|
-
for (
|
|
594
|
-
for (
|
|
595
|
-
for (c = 0,
|
|
596
|
-
|
|
597
|
-
e.size / n *
|
|
598
|
-
e.size / n *
|
|
555
|
+
if (h.sent(), n = Math.pow(2, e.level), o = r.imageOptions.format, o.length === 0 && o.push(void 0), u = [], n > 1)
|
|
556
|
+
for (f = 0; f < n; f++)
|
|
557
|
+
for (s = 0; s < n; s++)
|
|
558
|
+
for (c = 0, l = o; c < l.length; c++)
|
|
559
|
+
d = l[c], m = [
|
|
560
|
+
e.size / n * s,
|
|
561
|
+
e.size / n * f,
|
|
599
562
|
e.size / n,
|
|
600
563
|
e.size / n
|
|
601
|
-
], w = e.scale >= 1 ? void 0 : e.scale * e.size / n, e.level === 1 && e.scale >= 0.5 && (
|
|
602
|
-
format:
|
|
564
|
+
], w = e.scale >= 1 ? void 0 : e.scale * e.size / n, e.level === 1 && e.scale >= 0.5 && (d === "jpg" || /\.jpg$/.test(i)) && (w = void 0), v = W(i, {
|
|
565
|
+
format: d,
|
|
603
566
|
size: w,
|
|
604
|
-
cut:
|
|
567
|
+
cut: m,
|
|
605
568
|
toFilename: r.imageProcessingFilename
|
|
606
|
-
}), r.log(function(
|
|
607
|
-
return "imageProcessing: ".concat(i, " -> ").concat(
|
|
608
|
-
},
|
|
569
|
+
}), r.log(function(p) {
|
|
570
|
+
return "imageProcessing: ".concat(i, " -> ").concat(p);
|
|
571
|
+
}, v), u.push(v);
|
|
609
572
|
return [4, Promise.all(u)];
|
|
610
573
|
case 2:
|
|
611
|
-
return
|
|
574
|
+
return h.sent(), [
|
|
612
575
|
2
|
|
613
576
|
/*return*/
|
|
614
577
|
];
|
|
@@ -616,18 +579,18 @@ function E(t, e, r) {
|
|
|
616
579
|
});
|
|
617
580
|
});
|
|
618
581
|
}
|
|
619
|
-
function
|
|
620
|
-
return
|
|
621
|
-
return
|
|
582
|
+
function re(t, e) {
|
|
583
|
+
return k(this, void 0, void 0, function() {
|
|
584
|
+
return y(this, function(r) {
|
|
622
585
|
switch (r.label) {
|
|
623
586
|
case 0:
|
|
624
587
|
return [4, Promise.all([
|
|
625
|
-
|
|
626
|
-
|
|
627
|
-
|
|
628
|
-
|
|
629
|
-
|
|
630
|
-
|
|
588
|
+
L(t.front, t, e),
|
|
589
|
+
L(t.back, t, e),
|
|
590
|
+
L(t.left, t, e),
|
|
591
|
+
L(t.right, t, e),
|
|
592
|
+
L(t.up, t, e),
|
|
593
|
+
L(t.down, t, e)
|
|
631
594
|
])];
|
|
632
595
|
case 1:
|
|
633
596
|
return r.sent(), [
|
|
@@ -638,25 +601,25 @@ function te(t, e) {
|
|
|
638
601
|
});
|
|
639
602
|
});
|
|
640
603
|
}
|
|
641
|
-
function
|
|
642
|
-
return
|
|
643
|
-
var r, i,
|
|
644
|
-
return
|
|
604
|
+
function T(t, e) {
|
|
605
|
+
return k(this, void 0, void 0, function() {
|
|
606
|
+
var r, i, a, n, o, u, f, s, c, l, d, m;
|
|
607
|
+
return y(this, function(w) {
|
|
645
608
|
switch (w.label) {
|
|
646
609
|
case 0:
|
|
647
|
-
return r = _(e.distPath,
|
|
648
|
-
return "download: ".concat(t, " -> ").concat(
|
|
610
|
+
return r = _(e.distPath, j(t, e.baseURL)), i = S(t, r, e.fetch), e.log(function(v) {
|
|
611
|
+
return "download: ".concat(t, " -> ").concat(v);
|
|
649
612
|
}, i), [4, i];
|
|
650
613
|
case 1:
|
|
651
|
-
for (w.sent(),
|
|
652
|
-
for (
|
|
653
|
-
|
|
654
|
-
format:
|
|
655
|
-
size:
|
|
614
|
+
for (w.sent(), a = e.imageOptions.format, a.length === 0 && a.push(void 0), n = e.imageOptions.size, n.length === 0 && n.push(void 0), o = [], u = 0, f = a; u < f.length; u++)
|
|
615
|
+
for (s = f[u], c = 0, l = n; c < l.length; c++)
|
|
616
|
+
d = l[c], m = W(r, {
|
|
617
|
+
format: s,
|
|
618
|
+
size: d,
|
|
656
619
|
toFilename: e.imageProcessingFilename
|
|
657
|
-
}), e.log(function(
|
|
658
|
-
return "imageProcessing: ".concat(r, " -> ").concat(
|
|
659
|
-
},
|
|
620
|
+
}), e.log(function(v) {
|
|
621
|
+
return "imageProcessing: ".concat(r, " -> ").concat(v);
|
|
622
|
+
}, m), o.push(m);
|
|
660
623
|
return [4, Promise.all(o)];
|
|
661
624
|
case 2:
|
|
662
625
|
return w.sent(), [
|
|
@@ -667,23 +630,23 @@ function L(t, e) {
|
|
|
667
630
|
});
|
|
668
631
|
});
|
|
669
632
|
}
|
|
670
|
-
function
|
|
671
|
-
return
|
|
633
|
+
function ne(t, e) {
|
|
634
|
+
return k(this, void 0, void 0, function() {
|
|
672
635
|
var r;
|
|
673
|
-
return
|
|
636
|
+
return y(this, function(i) {
|
|
674
637
|
switch (i.label) {
|
|
675
638
|
case 0:
|
|
676
639
|
return r = t.images, [4, Promise.all([
|
|
677
|
-
|
|
678
|
-
|
|
679
|
-
|
|
680
|
-
|
|
681
|
-
|
|
682
|
-
|
|
640
|
+
T(r.front, e),
|
|
641
|
+
T(r.back, e),
|
|
642
|
+
T(r.left, e),
|
|
643
|
+
T(r.right, e),
|
|
644
|
+
T(r.up, e),
|
|
645
|
+
T(r.down, e)
|
|
683
646
|
])];
|
|
684
647
|
case 1:
|
|
685
|
-
return i.sent(), r.tiles ? [4, Promise.all(r.tiles.map(function(
|
|
686
|
-
return
|
|
648
|
+
return i.sent(), r.tiles ? [4, Promise.all(r.tiles.map(function(a) {
|
|
649
|
+
return re(a, e);
|
|
687
650
|
}))] : [3, 3];
|
|
688
651
|
case 2:
|
|
689
652
|
i.sent(), i.label = 3;
|
|
@@ -696,15 +659,15 @@ function se(t, e) {
|
|
|
696
659
|
});
|
|
697
660
|
});
|
|
698
661
|
}
|
|
699
|
-
function
|
|
700
|
-
return
|
|
701
|
-
var r, i,
|
|
702
|
-
return
|
|
662
|
+
function te(t, e) {
|
|
663
|
+
return k(this, void 0, void 0, function() {
|
|
664
|
+
var r, i, a, n, o;
|
|
665
|
+
return y(this, function(u) {
|
|
703
666
|
switch (u.label) {
|
|
704
667
|
case 0:
|
|
705
|
-
r = t.observers, i = 0,
|
|
668
|
+
r = t.observers, i = 0, a = r, u.label = 1;
|
|
706
669
|
case 1:
|
|
707
|
-
return i <
|
|
670
|
+
return i < a.length ? (n = a[i], o = ne(n, e), e.log("process observer #".concat(n.index, " derived: ").concat(n.derivedIdStr), o), [4, o]) : [3, 4];
|
|
708
671
|
case 2:
|
|
709
672
|
u.sent(), u.label = 3;
|
|
710
673
|
case 3:
|
|
@@ -718,11 +681,11 @@ function ie(t, e) {
|
|
|
718
681
|
});
|
|
719
682
|
});
|
|
720
683
|
}
|
|
721
|
-
function
|
|
684
|
+
function ie(t, e) {
|
|
722
685
|
if (e) {
|
|
723
686
|
var r = Date.now();
|
|
724
|
-
e.then(function(
|
|
725
|
-
var n = Date.now() - r, o = typeof t == "function" ? t(
|
|
687
|
+
e.then(function(a) {
|
|
688
|
+
var n = Date.now() - r, o = typeof t == "function" ? t(a) : t;
|
|
726
689
|
console.log(o + "(".concat(n, "ms)"));
|
|
727
690
|
}).catch(function() {
|
|
728
691
|
});
|
|
@@ -731,49 +694,50 @@ function ae(t, e) {
|
|
|
731
694
|
console.log(i);
|
|
732
695
|
}
|
|
733
696
|
}
|
|
734
|
-
function
|
|
735
|
-
return
|
|
736
|
-
var i,
|
|
737
|
-
return r === void 0 && (r = {}),
|
|
738
|
-
switch (
|
|
697
|
+
function fe(t) {
|
|
698
|
+
return k(this, arguments, void 0, function(e, r) {
|
|
699
|
+
var i, a, n, o, u, f, s, c, l, d, m, w, v, h, p, P, z, g;
|
|
700
|
+
return r === void 0 && (r = {}), y(this, function(b) {
|
|
701
|
+
switch (b.label) {
|
|
739
702
|
case 0:
|
|
740
|
-
if (i = e.baseURL,
|
|
741
|
-
|
|
703
|
+
if (i = e.baseURL, a = "", r.distPath)
|
|
704
|
+
a = B(process.cwd(), r.distPath);
|
|
742
705
|
else
|
|
743
|
-
for (
|
|
744
|
-
/.-(\d+)$/.test(
|
|
706
|
+
for (a = B(process.cwd(), (l = e.workCode) !== null && l !== void 0 ? l : "work-".concat(Date.now())); D(a); )
|
|
707
|
+
/.-(\d+)$/.test(a) ? a = a.replace(/.-(\d+)$/, function(F, O) {
|
|
745
708
|
return "-" + (Number(O) + 1);
|
|
746
|
-
}) :
|
|
709
|
+
}) : a = a + "-1";
|
|
747
710
|
return n = {
|
|
748
711
|
baseURL: i,
|
|
749
|
-
distPath:
|
|
712
|
+
distPath: a,
|
|
713
|
+
fetch: (d = r.fetch) !== null && d !== void 0 ? d : fetch,
|
|
750
714
|
imageOptions: {
|
|
751
|
-
size: (
|
|
752
|
-
format: (
|
|
715
|
+
size: (w = (m = r.imageOptions) === null || m === void 0 ? void 0 : m.size) !== null && w !== void 0 ? w : [],
|
|
716
|
+
format: (h = (v = r.imageOptions) === null || v === void 0 ? void 0 : v.format) !== null && h !== void 0 ? h : []
|
|
753
717
|
},
|
|
754
718
|
textureOptions: {
|
|
755
|
-
size: (
|
|
756
|
-
format: (
|
|
719
|
+
size: (P = (p = r.textureOptions) === null || p === void 0 ? void 0 : p.size) !== null && P !== void 0 ? P : [],
|
|
720
|
+
format: (g = (z = r.textureOptions) === null || z === void 0 ? void 0 : z.format) !== null && g !== void 0 ? g : []
|
|
757
721
|
},
|
|
758
|
-
log: r.log ?
|
|
722
|
+
log: r.log ? ie : function() {
|
|
759
723
|
return Promise.resolve();
|
|
760
724
|
},
|
|
761
725
|
imageProcessingFilename: r.imageProcessingFilename
|
|
762
|
-
}, n.log(JSON.stringify(n, null, " ")), [4,
|
|
726
|
+
}, n.log(JSON.stringify(n, null, " ")), [4, A(a, { recursive: !0 })];
|
|
763
727
|
case 1:
|
|
764
|
-
|
|
728
|
+
b.sent(), o = 0, b.label = 2;
|
|
765
729
|
case 2:
|
|
766
|
-
return o < e.raw.works.length ? (u = e.raw.works[o],
|
|
730
|
+
return o < e.raw.works.length ? (u = e.raw.works[o], f = o > 0 ? "-".concat(o) : "", s = "work".concat(f, ".json"), c = B(a, s), [4, M(c, u)]) : [3, 5];
|
|
767
731
|
case 3:
|
|
768
|
-
|
|
732
|
+
b.sent(), b.label = 4;
|
|
769
733
|
case 4:
|
|
770
734
|
return o++, [3, 2];
|
|
771
735
|
case 5:
|
|
772
|
-
return [4,
|
|
736
|
+
return [4, te(e, n)];
|
|
773
737
|
case 6:
|
|
774
|
-
return
|
|
738
|
+
return b.sent(), [4, ee(e, n)];
|
|
775
739
|
case 7:
|
|
776
|
-
return
|
|
740
|
+
return b.sent(), [
|
|
777
741
|
2
|
|
778
742
|
/*return*/
|
|
779
743
|
];
|
|
@@ -782,5 +746,5 @@ function he(t) {
|
|
|
782
746
|
});
|
|
783
747
|
}
|
|
784
748
|
export {
|
|
785
|
-
|
|
749
|
+
fe as download
|
|
786
750
|
};
|