@needle-tools/engine 4.13.0-next.e6dcd1c → 4.13.0
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/{materialx-DTdTjiOL.min.js → materialx-B9ddsHcF.min.js} +18 -18
- package/dist/{materialx-CnsT47BY.umd.cjs → materialx-BF23AVE8.umd.cjs} +9 -9
- package/dist/{materialx-DUlX6ZVi.js → materialx-fkoFuRh3.js} +215 -221
- package/dist/{needle-engine.bundle-zcyz7kwz.min.js → needle-engine.bundle-CxaKFQVS.min.js} +4 -4
- package/dist/{needle-engine.bundle-_--DT-Vr.js → needle-engine.bundle-Dl3TFYyv.js} +9 -8
- package/dist/{needle-engine.bundle-DGrKAD9m.umd.cjs → needle-engine.bundle-J4k4znv8.umd.cjs} +6 -6
- package/dist/needle-engine.d.ts +15 -15
- package/dist/needle-engine.js +2 -2
- package/dist/needle-engine.min.js +1 -1
- package/dist/needle-engine.umd.cjs +1 -1
- package/lib/engine-components/ReflectionProbe.js +11 -7
- package/lib/engine-components/ReflectionProbe.js.map +1 -1
- package/package.json +3 -3
- package/src/engine-components/ReflectionProbe.ts +12 -8
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { Texture as tI, WebGLRenderTarget as TE, RepeatWrapping as Rg, LinearFilter as aB, LinearMipMapLinearFilter as ZB, FloatType as pE, RGBAFormat as LE, PlaneGeometry as NB, OrthographicCamera as xE, ShaderMaterial as RB, Scene as jE, Mesh as Fg, EquirectangularReflectionMapping as uE, Uniform$1 as qE, LinearSRGBColorSpace as vE, Vector3 as hI, Quaternion as tE, Color as BB, Cache as XA, MirroredRepeatWrapping as nE, ClampToEdgeWrapping as zE, NearestMipMapNearestFilter as fE, NearestFilter as OE, MeshBasicMaterial as eE, PMREMGenerator$1 as rE, cloneUniforms as _E, cloneUniformsGroups as $E, GLSL3 as AG, Matrix4 as
|
|
1
|
+
import { Texture as tI, WebGLRenderTarget as TE, RepeatWrapping as Rg, LinearFilter as aB, LinearMipMapLinearFilter as ZB, FloatType as pE, RGBAFormat as LE, PlaneGeometry as NB, OrthographicCamera as xE, ShaderMaterial as RB, Scene as jE, Mesh as Fg, EquirectangularReflectionMapping as uE, Uniform$1 as qE, LinearSRGBColorSpace as vE, Vector3 as hI, Quaternion as tE, Color as BB, Cache as XA, MirroredRepeatWrapping as nE, ClampToEdgeWrapping as zE, NearestMipMapNearestFilter as fE, NearestFilter as OE, MeshBasicMaterial as eE, PMREMGenerator$1 as rE, cloneUniforms as _E, cloneUniformsGroups as $E, GLSL3 as AG, Matrix4 as xI, Matrix3 as IG, MeshStandardMaterial as uI, DoubleSide as gG, FrontSide as BG } from "./three-VvRoMeIN.js";
|
|
2
2
|
import "./three-examples-BhfOE7NG.js";
|
|
3
3
|
var qI = (function() {
|
|
4
4
|
var l = typeof document < "u" && document.currentScript ? document.currentScript.src : void 0;
|
|
@@ -82,10 +82,10 @@ var qI = (function() {
|
|
|
82
82
|
var M = {}, F;
|
|
83
83
|
for (F in E)
|
|
84
84
|
E.hasOwnProperty(F) && (M[F] = E[F]);
|
|
85
|
-
var x = "./this.program", U = !1, s = !1, m = !1,
|
|
86
|
-
U = typeof window == "object", s = typeof importScripts == "function", m = typeof process == "object" && typeof process.versions == "object" && typeof process.versions.node == "string",
|
|
85
|
+
var x = "./this.program", U = !1, s = !1, m = !1, AA = !1;
|
|
86
|
+
U = typeof window == "object", s = typeof importScripts == "function", m = typeof process == "object" && typeof process.versions == "object" && typeof process.versions.node == "string", AA = !U && !m && !s;
|
|
87
87
|
var O = "";
|
|
88
|
-
function
|
|
88
|
+
function IA(A) {
|
|
89
89
|
return E.locateFile ? E.locateFile(A, O) : O + A;
|
|
90
90
|
}
|
|
91
91
|
var v, hA, UA, jA, rA;
|
|
@@ -99,7 +99,7 @@ var qI = (function() {
|
|
|
99
99
|
throw A;
|
|
100
100
|
}), process.on("unhandledRejection", CA), E.inspect = function() {
|
|
101
101
|
return "[Emscripten Module object]";
|
|
102
|
-
}) :
|
|
102
|
+
}) : AA ? (typeof read < "u" && (v = function(I) {
|
|
103
103
|
return read(I);
|
|
104
104
|
}), UA = function(I) {
|
|
105
105
|
var g;
|
|
@@ -133,7 +133,7 @@ var qI = (function() {
|
|
|
133
133
|
return lg;
|
|
134
134
|
}, _A;
|
|
135
135
|
E.wasmBinary && (_A = E.wasmBinary), E.noExitRuntime, typeof WebAssembly != "object" && CA("no native wasm support detected");
|
|
136
|
-
var
|
|
136
|
+
var oI, Sg = !1;
|
|
137
137
|
function eI(A, I) {
|
|
138
138
|
A || CA("Assertion failed: " + I);
|
|
139
139
|
}
|
|
@@ -193,7 +193,7 @@ var qI = (function() {
|
|
|
193
193
|
function _I(A, I, g) {
|
|
194
194
|
return rI(A, oA, I, g);
|
|
195
195
|
}
|
|
196
|
-
function
|
|
196
|
+
function YI(A) {
|
|
197
197
|
for (var I = 0, g = 0; g < A.length; ++g) {
|
|
198
198
|
var B = A.charCodeAt(g);
|
|
199
199
|
B >= 55296 && B <= 57343 && (B = 65536 + ((B & 1023) << 10) | A.charCodeAt(++g) & 1023), B <= 127 ? ++I : B <= 2047 ? I += 2 : B <= 65535 ? I += 3 : I += 4;
|
|
@@ -266,9 +266,9 @@ var qI = (function() {
|
|
|
266
266
|
function VB(A, I) {
|
|
267
267
|
return A % I > 0 && (A += I - A % I), A;
|
|
268
268
|
}
|
|
269
|
-
var
|
|
269
|
+
var wI, GA, oA, cA, $A, S, lA, Ug, $I;
|
|
270
270
|
function cg(A) {
|
|
271
|
-
|
|
271
|
+
wI = A, E.HEAP8 = GA = new Int8Array(A), E.HEAP16 = cA = new Int16Array(A), E.HEAP32 = S = new Int32Array(A), E.HEAPU8 = oA = new Uint8Array(A), E.HEAPU16 = $A = new Uint16Array(A), E.HEAPU32 = lA = new Uint32Array(A), E.HEAPF32 = Ug = new Float32Array(A), E.HEAPF64 = $I = new Float64Array(A);
|
|
272
272
|
}
|
|
273
273
|
E.INITIAL_MEMORY;
|
|
274
274
|
var T, yg = [], Wg = [], dg = [];
|
|
@@ -300,7 +300,7 @@ var qI = (function() {
|
|
|
300
300
|
function Ag(A) {
|
|
301
301
|
PA++, E.monitorRunDependencies && E.monitorRunDependencies(PA);
|
|
302
302
|
}
|
|
303
|
-
function
|
|
303
|
+
function kI(A) {
|
|
304
304
|
if (PA--, E.monitorRunDependencies && E.monitorRunDependencies(PA), PA == 0 && AI) {
|
|
305
305
|
var I = AI;
|
|
306
306
|
AI = null, I();
|
|
@@ -320,7 +320,7 @@ var qI = (function() {
|
|
|
320
320
|
return A.startsWith("file://");
|
|
321
321
|
}
|
|
322
322
|
var NA = "JsMaterialXGenShader.wasm";
|
|
323
|
-
Hg(NA) || (NA =
|
|
323
|
+
Hg(NA) || (NA = IA(NA));
|
|
324
324
|
function mg(A) {
|
|
325
325
|
try {
|
|
326
326
|
if (A == NA && _A)
|
|
@@ -357,7 +357,7 @@ var qI = (function() {
|
|
|
357
357
|
var A = { a: eC };
|
|
358
358
|
function I(i, D) {
|
|
359
359
|
var h = i.exports;
|
|
360
|
-
E.asm = h,
|
|
360
|
+
E.asm = h, oI = E.asm.Xa, cg(oI.buffer), T = E.asm._a, xB(E.asm.Ya), kI();
|
|
361
361
|
}
|
|
362
362
|
Ag();
|
|
363
363
|
function g(i) {
|
|
@@ -388,7 +388,7 @@ var qI = (function() {
|
|
|
388
388
|
}
|
|
389
389
|
return Q().catch(H), {};
|
|
390
390
|
}
|
|
391
|
-
var
|
|
391
|
+
var _, wA, tB = { 218952: function() {
|
|
392
392
|
E.TreeIterator.prototype[Symbol.iterator] = function() {
|
|
393
393
|
return this;
|
|
394
394
|
};
|
|
@@ -471,14 +471,14 @@ var qI = (function() {
|
|
|
471
471
|
return new vA(this.get_base_ptr());
|
|
472
472
|
}, A === void 0 ? (this.ptr = OA(8), this.set_adjusted_ptr(0)) : this.ptr = A;
|
|
473
473
|
}
|
|
474
|
-
var
|
|
474
|
+
var aI = [];
|
|
475
475
|
function fB(A) {
|
|
476
476
|
A.add_ref();
|
|
477
477
|
}
|
|
478
|
-
var
|
|
478
|
+
var ZI = 0;
|
|
479
479
|
function OB(A) {
|
|
480
480
|
var I = new II(A), g = I.get_exception_info();
|
|
481
|
-
return g.get_caught() || (g.set_caught(!0),
|
|
481
|
+
return g.get_caught() || (g.set_caught(!0), ZI--), g.set_rethrown(!1), aI.push(I), fB(g), I.get_exception_ptr();
|
|
482
482
|
}
|
|
483
483
|
var HA = 0;
|
|
484
484
|
function Kg(A) {
|
|
@@ -492,7 +492,7 @@ var qI = (function() {
|
|
|
492
492
|
}
|
|
493
493
|
function rB() {
|
|
494
494
|
n(0);
|
|
495
|
-
var A =
|
|
495
|
+
var A = aI.pop();
|
|
496
496
|
eB(A.get_exception_info()), A.free(), HA = 0;
|
|
497
497
|
}
|
|
498
498
|
function _B(A) {
|
|
@@ -506,13 +506,13 @@ var qI = (function() {
|
|
|
506
506
|
var I = new vA(A), g = I.get_type(), B = new II();
|
|
507
507
|
if (B.set_base_ptr(A), !g)
|
|
508
508
|
return ZA(0), B.ptr | 0;
|
|
509
|
-
var Q = Array.prototype.slice.call(arguments), G = j(), i =
|
|
509
|
+
var Q = Array.prototype.slice.call(arguments), G = j(), i = XI(4);
|
|
510
510
|
S[i >> 2] = A;
|
|
511
511
|
for (var D = 0; D < Q.length; D++) {
|
|
512
512
|
var h = Q[D];
|
|
513
513
|
if (h === 0 || h === g)
|
|
514
514
|
break;
|
|
515
|
-
if (
|
|
515
|
+
if (VI(h, g, i)) {
|
|
516
516
|
var o = S[i >> 2];
|
|
517
517
|
return A !== o && B.set_adjusted_ptr(o), ZA(h), B.ptr | 0;
|
|
518
518
|
}
|
|
@@ -526,13 +526,13 @@ var qI = (function() {
|
|
|
526
526
|
var I = new vA(A), g = I.get_type(), B = new II();
|
|
527
527
|
if (B.set_base_ptr(A), !g)
|
|
528
528
|
return ZA(0), B.ptr | 0;
|
|
529
|
-
var Q = Array.prototype.slice.call(arguments), G = j(), i =
|
|
529
|
+
var Q = Array.prototype.slice.call(arguments), G = j(), i = XI(4);
|
|
530
530
|
S[i >> 2] = A;
|
|
531
531
|
for (var D = 0; D < Q.length; D++) {
|
|
532
532
|
var h = Q[D];
|
|
533
533
|
if (h === 0 || h === g)
|
|
534
534
|
break;
|
|
535
|
-
if (
|
|
535
|
+
if (VI(h, g, i)) {
|
|
536
536
|
var o = S[i >> 2];
|
|
537
537
|
return A !== o && B.set_adjusted_ptr(o), ZA(h), B.ptr | 0;
|
|
538
538
|
}
|
|
@@ -546,13 +546,13 @@ var qI = (function() {
|
|
|
546
546
|
var I = new vA(A), g = I.get_type(), B = new II();
|
|
547
547
|
if (B.set_base_ptr(A), !g)
|
|
548
548
|
return ZA(0), B.ptr | 0;
|
|
549
|
-
var Q = Array.prototype.slice.call(arguments), G = j(), i =
|
|
549
|
+
var Q = Array.prototype.slice.call(arguments), G = j(), i = XI(4);
|
|
550
550
|
S[i >> 2] = A;
|
|
551
551
|
for (var D = 0; D < Q.length; D++) {
|
|
552
552
|
var h = Q[D];
|
|
553
553
|
if (h === 0 || h === g)
|
|
554
554
|
break;
|
|
555
|
-
if (
|
|
555
|
+
if (VI(h, g, i)) {
|
|
556
556
|
var o = S[i >> 2];
|
|
557
557
|
return A !== o && B.set_adjusted_ptr(o), ZA(h), B.ptr | 0;
|
|
558
558
|
}
|
|
@@ -560,22 +560,22 @@ var qI = (function() {
|
|
|
560
560
|
return u(G), ZA(g), B.ptr | 0;
|
|
561
561
|
}
|
|
562
562
|
function gQ() {
|
|
563
|
-
var A =
|
|
563
|
+
var A = aI.pop();
|
|
564
564
|
A || CA("no exception to throw");
|
|
565
565
|
var I = A.get_exception_info(), g = A.get_base_ptr();
|
|
566
|
-
throw I.get_rethrown() ? A.free() : (
|
|
566
|
+
throw I.get_rethrown() ? A.free() : (aI.push(A), I.set_rethrown(!0), I.set_caught(!1), ZI++), HA = g, g;
|
|
567
567
|
}
|
|
568
568
|
function BQ(A, I, g) {
|
|
569
569
|
var B = new vA(A);
|
|
570
|
-
throw B.init(I, g), HA = A,
|
|
570
|
+
throw B.init(I, g), HA = A, ZI++, A;
|
|
571
571
|
}
|
|
572
572
|
function QQ() {
|
|
573
|
-
return
|
|
573
|
+
return ZI;
|
|
574
574
|
}
|
|
575
575
|
function CQ(A) {
|
|
576
576
|
return S[Og() >> 2] = A, A;
|
|
577
577
|
}
|
|
578
|
-
var
|
|
578
|
+
var r = { splitPath: function(A) {
|
|
579
579
|
var I = /^(\/?|)([\s\S]*?)((?:\.{1,2}|[^\/]+?|)(\.[^.\/]*|))(?:[\/]*)$/;
|
|
580
580
|
return I.exec(A).slice(1);
|
|
581
581
|
}, normalizeArray: function(A, I) {
|
|
@@ -589,24 +589,24 @@ var qI = (function() {
|
|
|
589
589
|
return A;
|
|
590
590
|
}, normalize: function(A) {
|
|
591
591
|
var I = A.charAt(0) === "/", g = A.substr(-1) === "/";
|
|
592
|
-
return A =
|
|
592
|
+
return A = r.normalizeArray(A.split("/").filter(function(B) {
|
|
593
593
|
return !!B;
|
|
594
594
|
}), !I).join("/"), !A && !I && (A = "."), A && g && (A += "/"), (I ? "/" : "") + A;
|
|
595
595
|
}, dirname: function(A) {
|
|
596
|
-
var I =
|
|
596
|
+
var I = r.splitPath(A), g = I[0], B = I[1];
|
|
597
597
|
return !g && !B ? "." : (B && (B = B.substr(0, B.length - 1)), g + B);
|
|
598
598
|
}, basename: function(A) {
|
|
599
599
|
if (A === "/") return "/";
|
|
600
|
-
A =
|
|
600
|
+
A = r.normalize(A), A = A.replace(/\/$/, "");
|
|
601
601
|
var I = A.lastIndexOf("/");
|
|
602
602
|
return I === -1 ? A : A.substr(I + 1);
|
|
603
603
|
}, extname: function(A) {
|
|
604
|
-
return
|
|
604
|
+
return r.splitPath(A)[3];
|
|
605
605
|
}, join: function() {
|
|
606
606
|
var A = Array.prototype.slice.call(arguments, 0);
|
|
607
|
-
return
|
|
607
|
+
return r.normalize(A.join("/"));
|
|
608
608
|
}, join2: function(A, I) {
|
|
609
|
-
return
|
|
609
|
+
return r.normalize(A + "/" + I);
|
|
610
610
|
} };
|
|
611
611
|
function EQ() {
|
|
612
612
|
if (typeof crypto == "object" && typeof crypto.getRandomValues == "function") {
|
|
@@ -635,7 +635,7 @@ var qI = (function() {
|
|
|
635
635
|
return "";
|
|
636
636
|
A = B + "/" + A, I = B.charAt(0) === "/";
|
|
637
637
|
}
|
|
638
|
-
return A =
|
|
638
|
+
return A = r.normalizeArray(A.split("/").filter(function(Q) {
|
|
639
639
|
return !!Q;
|
|
640
640
|
}), !I).join("/"), (I ? "/" : "") + A || ".";
|
|
641
641
|
}, relative: function(A, I) {
|
|
@@ -711,7 +711,7 @@ var qI = (function() {
|
|
|
711
711
|
`));
|
|
712
712
|
if (!I)
|
|
713
713
|
return null;
|
|
714
|
-
A.input =
|
|
714
|
+
A.input = KI(I, !0);
|
|
715
715
|
}
|
|
716
716
|
return A.input.shift();
|
|
717
717
|
}, put_char: function(A, I) {
|
|
@@ -832,7 +832,7 @@ var qI = (function() {
|
|
|
832
832
|
if (!C.isFile(A.node.mode))
|
|
833
833
|
throw new C.ErrnoError(43);
|
|
834
834
|
var i, D, h = A.node.contents;
|
|
835
|
-
if (!(G & 2) && h.buffer ===
|
|
835
|
+
if (!(G & 2) && h.buffer === wI)
|
|
836
836
|
D = !1, i = h.byteOffset;
|
|
837
837
|
else {
|
|
838
838
|
if ((B > 0 || B + g < h.length) && (h.subarray ? h = h.subarray(B, B + g) : h = Array.prototype.slice.call(h, B, B + g)), D = !0, i = GQ(g), !i)
|
|
@@ -851,16 +851,16 @@ var qI = (function() {
|
|
|
851
851
|
I[B] === void 0 && (I[B] = g[B]);
|
|
852
852
|
if (I.recurse_count > 8)
|
|
853
853
|
throw new C.ErrnoError(32);
|
|
854
|
-
for (var Q =
|
|
854
|
+
for (var Q = r.normalizeArray(A.split("/").filter(function(k) {
|
|
855
855
|
return !!k;
|
|
856
856
|
}), !1), G = C.root, i = "/", D = 0; D < Q.length; D++) {
|
|
857
857
|
var h = D === Q.length - 1;
|
|
858
858
|
if (h && I.parent)
|
|
859
859
|
break;
|
|
860
|
-
if (G = C.lookupNode(G, Q[D]), i =
|
|
860
|
+
if (G = C.lookupNode(G, Q[D]), i = r.join2(i, Q[D]), C.isMountpoint(G) && (!h || h && I.follow_mount) && (G = G.mounted.root), !h || I.follow)
|
|
861
861
|
for (var o = 0; C.isLink(G.mode); ) {
|
|
862
862
|
var Y = C.readlink(i);
|
|
863
|
-
i = yA.resolve(
|
|
863
|
+
i = yA.resolve(r.dirname(i), Y);
|
|
864
864
|
var a = C.lookupPath(i, { recurse_count: I.recurse_count });
|
|
865
865
|
if (G = a.node, o++ > 40)
|
|
866
866
|
throw new C.ErrnoError(32);
|
|
@@ -1062,7 +1062,7 @@ var qI = (function() {
|
|
|
1062
1062
|
}, lookup: function(A, I) {
|
|
1063
1063
|
return A.node_ops.lookup(A, I);
|
|
1064
1064
|
}, mknod: function(A, I, g) {
|
|
1065
|
-
var B = C.lookupPath(A, { parent: !0 }), Q = B.node, G =
|
|
1065
|
+
var B = C.lookupPath(A, { parent: !0 }), Q = B.node, G = r.basename(A);
|
|
1066
1066
|
if (!G || G === "." || G === "..")
|
|
1067
1067
|
throw new C.ErrnoError(28);
|
|
1068
1068
|
var i = C.mayCreate(Q, G);
|
|
@@ -1093,14 +1093,14 @@ var qI = (function() {
|
|
|
1093
1093
|
var g = C.lookupPath(I, { parent: !0 }), B = g.node;
|
|
1094
1094
|
if (!B)
|
|
1095
1095
|
throw new C.ErrnoError(44);
|
|
1096
|
-
var Q =
|
|
1096
|
+
var Q = r.basename(I), G = C.mayCreate(B, Q);
|
|
1097
1097
|
if (G)
|
|
1098
1098
|
throw new C.ErrnoError(G);
|
|
1099
1099
|
if (!B.node_ops.symlink)
|
|
1100
1100
|
throw new C.ErrnoError(63);
|
|
1101
1101
|
return B.node_ops.symlink(B, Q, A);
|
|
1102
1102
|
}, rename: function(A, I) {
|
|
1103
|
-
var g =
|
|
1103
|
+
var g = r.dirname(A), B = r.dirname(I), Q = r.basename(A), G = r.basename(I), i, D, h;
|
|
1104
1104
|
if (i = C.lookupPath(A, { parent: !0 }), D = i.node, i = C.lookupPath(I, { parent: !0 }), h = i.node, !D || !h) throw new C.ErrnoError(44);
|
|
1105
1105
|
if (D.mount !== h.mount)
|
|
1106
1106
|
throw new C.ErrnoError(75);
|
|
@@ -1146,7 +1146,7 @@ var qI = (function() {
|
|
|
1146
1146
|
}
|
|
1147
1147
|
}
|
|
1148
1148
|
}, rmdir: function(A) {
|
|
1149
|
-
var I = C.lookupPath(A, { parent: !0 }), g = I.node, B =
|
|
1149
|
+
var I = C.lookupPath(A, { parent: !0 }), g = I.node, B = r.basename(A), Q = C.lookupNode(g, B), G = C.mayDelete(g, B, !0);
|
|
1150
1150
|
if (G)
|
|
1151
1151
|
throw new C.ErrnoError(G);
|
|
1152
1152
|
if (!g.node_ops.rmdir)
|
|
@@ -1170,7 +1170,7 @@ var qI = (function() {
|
|
|
1170
1170
|
throw new C.ErrnoError(54);
|
|
1171
1171
|
return g.node_ops.readdir(g);
|
|
1172
1172
|
}, unlink: function(A) {
|
|
1173
|
-
var I = C.lookupPath(A, { parent: !0 }), g = I.node, B =
|
|
1173
|
+
var I = C.lookupPath(A, { parent: !0 }), g = I.node, B = r.basename(A), Q = C.lookupNode(g, B), G = C.mayDelete(g, B, !1);
|
|
1174
1174
|
if (G)
|
|
1175
1175
|
throw new C.ErrnoError(G);
|
|
1176
1176
|
if (!g.node_ops.unlink)
|
|
@@ -1275,7 +1275,7 @@ var qI = (function() {
|
|
|
1275
1275
|
if (typeof A == "object")
|
|
1276
1276
|
G = A;
|
|
1277
1277
|
else {
|
|
1278
|
-
A =
|
|
1278
|
+
A = r.normalize(A);
|
|
1279
1279
|
try {
|
|
1280
1280
|
var i = C.lookupPath(A, { follow: !(I & 131072) });
|
|
1281
1281
|
G = i.node;
|
|
@@ -1412,7 +1412,7 @@ var qI = (function() {
|
|
|
1412
1412
|
g = g || {}, g.flags = g.flags || 577;
|
|
1413
1413
|
var B = C.open(A, g.flags, g.mode);
|
|
1414
1414
|
if (typeof I == "string") {
|
|
1415
|
-
var Q = new Uint8Array(
|
|
1415
|
+
var Q = new Uint8Array(YI(I) + 1), G = rI(I, Q, 0, Q.length);
|
|
1416
1416
|
C.write(B, Q, 0, G, void 0, g.canOwn);
|
|
1417
1417
|
} else if (ArrayBuffer.isView(I))
|
|
1418
1418
|
C.write(B, I, 0, I.byteLength, void 0, g.canOwn);
|
|
@@ -1492,7 +1492,7 @@ var qI = (function() {
|
|
|
1492
1492
|
var B = { isRoot: !1, exists: !1, error: 0, name: null, path: null, object: null, parentExists: !1, parentPath: null, parentObject: null };
|
|
1493
1493
|
try {
|
|
1494
1494
|
var g = C.lookupPath(A, { parent: !0 });
|
|
1495
|
-
B.parentExists = !0, B.parentPath = g.path, B.parentObject = g.node, B.name =
|
|
1495
|
+
B.parentExists = !0, B.parentPath = g.path, B.parentObject = g.node, B.name = r.basename(A), g = C.lookupPath(A, { follow: !I }), B.exists = !0, B.path = g.path, B.object = g.node, B.name = g.node.name, B.isRoot = g.path === "/";
|
|
1496
1496
|
} catch (Q) {
|
|
1497
1497
|
B.error = Q.errno;
|
|
1498
1498
|
}
|
|
@@ -1502,7 +1502,7 @@ var qI = (function() {
|
|
|
1502
1502
|
for (var Q = I.split("/").reverse(); Q.length; ) {
|
|
1503
1503
|
var G = Q.pop();
|
|
1504
1504
|
if (G) {
|
|
1505
|
-
var i =
|
|
1505
|
+
var i = r.join2(A, G);
|
|
1506
1506
|
try {
|
|
1507
1507
|
C.mkdir(i);
|
|
1508
1508
|
} catch {
|
|
@@ -1512,10 +1512,10 @@ var qI = (function() {
|
|
|
1512
1512
|
}
|
|
1513
1513
|
return i;
|
|
1514
1514
|
}, createFile: function(A, I, g, B, Q) {
|
|
1515
|
-
var G =
|
|
1515
|
+
var G = r.join2(typeof A == "string" ? A : C.getPath(A), I), i = C.getMode(B, Q);
|
|
1516
1516
|
return C.create(G, i);
|
|
1517
1517
|
}, createDataFile: function(A, I, g, B, Q, G) {
|
|
1518
|
-
var i = I ?
|
|
1518
|
+
var i = I ? r.join2(typeof A == "string" ? A : C.getPath(A), I) : A, D = C.getMode(B, Q), h = C.create(i, D);
|
|
1519
1519
|
if (g) {
|
|
1520
1520
|
if (typeof g == "string") {
|
|
1521
1521
|
for (var o = new Array(g.length), Y = 0, a = g.length; Y < a; ++Y) o[Y] = g.charCodeAt(Y);
|
|
@@ -1527,7 +1527,7 @@ var qI = (function() {
|
|
|
1527
1527
|
}
|
|
1528
1528
|
return h;
|
|
1529
1529
|
}, createDevice: function(A, I, g, B) {
|
|
1530
|
-
var Q =
|
|
1530
|
+
var Q = r.join2(typeof A == "string" ? A : C.getPath(A), I), G = C.getMode(!!g, !!B);
|
|
1531
1531
|
C.createDevice.major || (C.createDevice.major = 64);
|
|
1532
1532
|
var i = C.makedev(C.createDevice.major++, 0);
|
|
1533
1533
|
return C.registerDevice(i, { open: function(D) {
|
|
@@ -1563,7 +1563,7 @@ var qI = (function() {
|
|
|
1563
1563
|
throw new Error("Lazy loading should have been performed (contents set) in createLazyFile, but it was not. Lazy loading only works in web workers. Use --embed-file or --preload-file in emcc on the main thread.");
|
|
1564
1564
|
if (v)
|
|
1565
1565
|
try {
|
|
1566
|
-
A.contents =
|
|
1566
|
+
A.contents = KI(v(A.url), !0), A.usedBytes = A.contents.length;
|
|
1567
1567
|
} catch {
|
|
1568
1568
|
throw new C.ErrnoError(29);
|
|
1569
1569
|
}
|
|
@@ -1590,7 +1590,7 @@ var qI = (function() {
|
|
|
1590
1590
|
if (p > N - 1) throw new Error("only " + N + " bytes available! programmer error!");
|
|
1591
1591
|
var z = new XMLHttpRequest();
|
|
1592
1592
|
if (z.open("GET", g, !1), N !== V && z.setRequestHeader("Range", "bytes=" + q + "-" + p), typeof Uint8Array < "u" && (z.responseType = "arraybuffer"), z.overrideMimeType && z.overrideMimeType("text/plain; charset=x-user-defined"), z.send(null), !(z.status >= 200 && z.status < 300 || z.status === 304)) throw new Error("Couldn't load " + g + ". Status: " + z.status);
|
|
1593
|
-
return z.response !== void 0 ? new Uint8Array(z.response || []) :
|
|
1593
|
+
return z.response !== void 0 ? new Uint8Array(z.response || []) : KI(z.responseText || "", !0);
|
|
1594
1594
|
}, J = this;
|
|
1595
1595
|
J.setDataGetter(function(q) {
|
|
1596
1596
|
var p = q * V, z = (q + 1) * V - 1;
|
|
@@ -1633,15 +1633,15 @@ var qI = (function() {
|
|
|
1633
1633
|
}, h.stream_ops = o, h;
|
|
1634
1634
|
}, createPreloadedFile: function(A, I, g, B, Q, G, i, D, h, o) {
|
|
1635
1635
|
Browser.init();
|
|
1636
|
-
var Y = I ? yA.resolve(
|
|
1636
|
+
var Y = I ? yA.resolve(r.join2(A, I)) : A;
|
|
1637
1637
|
function a(k) {
|
|
1638
1638
|
function N(y) {
|
|
1639
|
-
o && o(), D || C.createDataFile(A, I, y, B, Q, h), G && G(),
|
|
1639
|
+
o && o(), D || C.createDataFile(A, I, y, B, Q, h), G && G(), kI();
|
|
1640
1640
|
}
|
|
1641
1641
|
var b = !1;
|
|
1642
1642
|
E.preloadPlugins.forEach(function(y) {
|
|
1643
1643
|
b || y.canHandle(Y) && (y.handle(k, Y, N, function() {
|
|
1644
|
-
i && i(),
|
|
1644
|
+
i && i(), kI();
|
|
1645
1645
|
}), b = !0);
|
|
1646
1646
|
}), b || N(k);
|
|
1647
1647
|
}
|
|
@@ -1705,7 +1705,7 @@ var qI = (function() {
|
|
|
1705
1705
|
A.forEach(function(N) {
|
|
1706
1706
|
var b = h.get(N);
|
|
1707
1707
|
b.onsuccess = function() {
|
|
1708
|
-
C.analyzePath(N).exists && C.unlink(N), C.createDataFile(
|
|
1708
|
+
C.analyzePath(N).exists && C.unlink(N), C.createDataFile(r.dirname(N), r.basename(N), b.result, !0, !0, !0), o++, o + Y == a && k();
|
|
1709
1709
|
}, b.onerror = function() {
|
|
1710
1710
|
Y++, o + Y == a && k();
|
|
1711
1711
|
};
|
|
@@ -1727,21 +1727,21 @@ var qI = (function() {
|
|
|
1727
1727
|
throw new C.ErrnoError(44);
|
|
1728
1728
|
return B;
|
|
1729
1729
|
}
|
|
1730
|
-
return
|
|
1730
|
+
return r.join2(B, I);
|
|
1731
1731
|
}, doStat: function(A, I, g) {
|
|
1732
1732
|
try {
|
|
1733
1733
|
var B = A(I);
|
|
1734
1734
|
} catch (Q) {
|
|
1735
|
-
if (Q && Q.node &&
|
|
1735
|
+
if (Q && Q.node && r.normalize(I) !== r.normalize(C.getPath(Q.node)))
|
|
1736
1736
|
return -54;
|
|
1737
1737
|
throw Q;
|
|
1738
1738
|
}
|
|
1739
|
-
return S[g >> 2] = B.dev, S[g + 4 >> 2] = 0, S[g + 8 >> 2] = B.ino, S[g + 12 >> 2] = B.mode, S[g + 16 >> 2] = B.nlink, S[g + 20 >> 2] = B.uid, S[g + 24 >> 2] = B.gid, S[g + 28 >> 2] = B.rdev, S[g + 32 >> 2] = 0, wA = [B.size >>> 0, (
|
|
1739
|
+
return S[g >> 2] = B.dev, S[g + 4 >> 2] = 0, S[g + 8 >> 2] = B.ino, S[g + 12 >> 2] = B.mode, S[g + 16 >> 2] = B.nlink, S[g + 20 >> 2] = B.uid, S[g + 24 >> 2] = B.gid, S[g + 28 >> 2] = B.rdev, S[g + 32 >> 2] = 0, wA = [B.size >>> 0, (_ = B.size, +Math.abs(_) >= 1 ? _ > 0 ? (Math.min(+Math.floor(_ / 4294967296), 4294967295) | 0) >>> 0 : ~~+Math.ceil((_ - +(~~_ >>> 0)) / 4294967296) >>> 0 : 0)], S[g + 40 >> 2] = wA[0], S[g + 44 >> 2] = wA[1], S[g + 48 >> 2] = 4096, S[g + 52 >> 2] = B.blocks, S[g + 56 >> 2] = B.atime.getTime() / 1e3 | 0, S[g + 60 >> 2] = 0, S[g + 64 >> 2] = B.mtime.getTime() / 1e3 | 0, S[g + 68 >> 2] = 0, S[g + 72 >> 2] = B.ctime.getTime() / 1e3 | 0, S[g + 76 >> 2] = 0, wA = [B.ino >>> 0, (_ = B.ino, +Math.abs(_) >= 1 ? _ > 0 ? (Math.min(+Math.floor(_ / 4294967296), 4294967295) | 0) >>> 0 : ~~+Math.ceil((_ - +(~~_ >>> 0)) / 4294967296) >>> 0 : 0)], S[g + 80 >> 2] = wA[0], S[g + 84 >> 2] = wA[1], 0;
|
|
1740
1740
|
}, doMsync: function(A, I, g, B, Q) {
|
|
1741
1741
|
var G = oA.slice(A, A + g);
|
|
1742
1742
|
C.msync(I, G, Q, g, B);
|
|
1743
1743
|
}, doMkdir: function(A, I) {
|
|
1744
|
-
return A =
|
|
1744
|
+
return A = r.normalize(A), A[A.length - 1] === "/" && (A = A.substr(0, A.length - 1)), C.mkdir(A, I, 0), 0;
|
|
1745
1745
|
}, doMknod: function(A, I, g) {
|
|
1746
1746
|
switch (I & 61440) {
|
|
1747
1747
|
case 32768:
|
|
@@ -1756,7 +1756,7 @@ var qI = (function() {
|
|
|
1756
1756
|
return C.mknod(A, I, g), 0;
|
|
1757
1757
|
}, doReadlink: function(A, I, g) {
|
|
1758
1758
|
if (g <= 0) return -28;
|
|
1759
|
-
var B = C.readlink(A), Q = Math.min(g,
|
|
1759
|
+
var B = C.readlink(A), Q = Math.min(g, YI(B)), G = GA[I + Q];
|
|
1760
1760
|
return _I(B, I, g + 1), GA[I + Q] = G, Q;
|
|
1761
1761
|
}, doAccess: function(A, I) {
|
|
1762
1762
|
if (I & -8)
|
|
@@ -1849,7 +1849,7 @@ var qI = (function() {
|
|
|
1849
1849
|
var a = C.lookupNode(B.node, Y);
|
|
1850
1850
|
h = a.id, o = C.isChrdev(a.mode) ? 2 : C.isDir(a.mode) ? 4 : C.isLink(a.mode) ? 10 : 8;
|
|
1851
1851
|
}
|
|
1852
|
-
wA = [h >>> 0, (
|
|
1852
|
+
wA = [h >>> 0, (_ = h, +Math.abs(_) >= 1 ? _ > 0 ? (Math.min(+Math.floor(_ / 4294967296), 4294967295) | 0) >>> 0 : ~~+Math.ceil((_ - +(~~_ >>> 0)) / 4294967296) >>> 0 : 0)], S[I + G >> 2] = wA[0], S[I + G + 4 >> 2] = wA[1], wA = [(D + 1) * Q >>> 0, (_ = (D + 1) * Q, +Math.abs(_) >= 1 ? _ > 0 ? (Math.min(+Math.floor(_ / 4294967296), 4294967295) | 0) >>> 0 : ~~+Math.ceil((_ - +(~~_ >>> 0)) / 4294967296) >>> 0 : 0)], S[I + G + 8 >> 2] = wA[0], S[I + G + 12 >> 2] = wA[1], cA[I + G + 16 >> 1] = 280, GA[I + G + 18 >> 0] = o, _I(Y, I + G + 19, 256), G += Q, D += 1;
|
|
1853
1853
|
}
|
|
1854
1854
|
return C.llseek(B, D * Q, 0), G;
|
|
1855
1855
|
} catch (k) {
|
|
@@ -1909,7 +1909,7 @@ var qI = (function() {
|
|
|
1909
1909
|
return (typeof C > "u" || !(g instanceof C.ErrnoError)) && CA(g), -g.errno;
|
|
1910
1910
|
}
|
|
1911
1911
|
}
|
|
1912
|
-
var
|
|
1912
|
+
var NI = {};
|
|
1913
1913
|
function tA(A) {
|
|
1914
1914
|
for (; A.length; ) {
|
|
1915
1915
|
var I = A.pop(), g = A.pop();
|
|
@@ -1919,22 +1919,22 @@ var qI = (function() {
|
|
|
1919
1919
|
function gI(A) {
|
|
1920
1920
|
return this.fromWireType(lA[A >> 2]);
|
|
1921
1921
|
}
|
|
1922
|
-
var nA = {}, pA = {},
|
|
1923
|
-
function
|
|
1922
|
+
var nA = {}, pA = {}, RI = {}, wQ = 48, kQ = 57;
|
|
1923
|
+
function FI(A) {
|
|
1924
1924
|
if (A === void 0)
|
|
1925
1925
|
return "_unknown";
|
|
1926
1926
|
A = A.replace(/[^a-zA-Z0-9_]/g, "$");
|
|
1927
1927
|
var I = A.charCodeAt(0);
|
|
1928
1928
|
return I >= wQ && I <= kQ ? "_" + A : A;
|
|
1929
1929
|
}
|
|
1930
|
-
function
|
|
1931
|
-
return A =
|
|
1930
|
+
function bI(A, I) {
|
|
1931
|
+
return A = FI(A), new Function("body", "return function " + A + `() {
|
|
1932
1932
|
"use strict"; return body.apply(this, arguments);
|
|
1933
1933
|
};
|
|
1934
1934
|
`)(I);
|
|
1935
1935
|
}
|
|
1936
1936
|
function gg(A, I) {
|
|
1937
|
-
var g =
|
|
1937
|
+
var g = bI(I, function(B) {
|
|
1938
1938
|
this.name = I, this.message = B;
|
|
1939
1939
|
var Q = new Error(B).stack;
|
|
1940
1940
|
Q !== void 0 && (this.stack = this.toString() + `
|
|
@@ -1945,16 +1945,16 @@ var qI = (function() {
|
|
|
1945
1945
|
}, g;
|
|
1946
1946
|
}
|
|
1947
1947
|
var Xg = void 0;
|
|
1948
|
-
function
|
|
1948
|
+
function lI(A) {
|
|
1949
1949
|
throw new Xg(A);
|
|
1950
1950
|
}
|
|
1951
1951
|
function kA(A, I, g) {
|
|
1952
1952
|
A.forEach(function(D) {
|
|
1953
|
-
|
|
1953
|
+
RI[D] = I;
|
|
1954
1954
|
});
|
|
1955
1955
|
function B(D) {
|
|
1956
1956
|
var h = g(D);
|
|
1957
|
-
h.length !== A.length &&
|
|
1957
|
+
h.length !== A.length && lI("Mismatched type converter count");
|
|
1958
1958
|
for (var o = 0; o < A.length; ++o)
|
|
1959
1959
|
SA(A[o], h[o]);
|
|
1960
1960
|
}
|
|
@@ -1966,8 +1966,8 @@ var qI = (function() {
|
|
|
1966
1966
|
}), G.length === 0 && B(Q);
|
|
1967
1967
|
}
|
|
1968
1968
|
function aQ(A) {
|
|
1969
|
-
var I =
|
|
1970
|
-
delete
|
|
1969
|
+
var I = NI[A];
|
|
1970
|
+
delete NI[A];
|
|
1971
1971
|
var g = I.elements, B = g.length, Q = g.map(function(D) {
|
|
1972
1972
|
return D.getterReturnType;
|
|
1973
1973
|
}).concat(g.map(function(D) {
|
|
@@ -1997,7 +1997,7 @@ var qI = (function() {
|
|
|
1997
1997
|
}
|
|
1998
1998
|
function ZQ(A, I, g, B, Q) {
|
|
1999
1999
|
}
|
|
2000
|
-
function
|
|
2000
|
+
function SI(A) {
|
|
2001
2001
|
switch (A) {
|
|
2002
2002
|
case 1:
|
|
2003
2003
|
return 0;
|
|
@@ -2035,7 +2035,7 @@ var qI = (function() {
|
|
|
2035
2035
|
return;
|
|
2036
2036
|
t("Cannot register type '" + B + "' twice");
|
|
2037
2037
|
}
|
|
2038
|
-
if (pA[A] = I, delete
|
|
2038
|
+
if (pA[A] = I, delete RI[A], nA.hasOwnProperty(A)) {
|
|
2039
2039
|
var Q = nA[A];
|
|
2040
2040
|
delete nA[A], Q.forEach(function(G) {
|
|
2041
2041
|
G();
|
|
@@ -2043,7 +2043,7 @@ var qI = (function() {
|
|
|
2043
2043
|
}
|
|
2044
2044
|
}
|
|
2045
2045
|
function RQ(A, I, g, B, Q) {
|
|
2046
|
-
var G =
|
|
2046
|
+
var G = SI(g);
|
|
2047
2047
|
I = QA(I), SA(A, { name: I, fromWireType: function(i) {
|
|
2048
2048
|
return !!i;
|
|
2049
2049
|
}, toWireType: function(i, D) {
|
|
@@ -2146,7 +2146,7 @@ var qI = (function() {
|
|
|
2146
2146
|
function yQ(A, I, g, B, Q, G, i, D) {
|
|
2147
2147
|
this.name = A, this.constructor = I, this.instancePrototype = g, this.rawDestructor = B, this.baseClass = Q, this.getActualType = G, this.upcast = i, this.downcast = D, this.pureVirtualFunctions = [];
|
|
2148
2148
|
}
|
|
2149
|
-
function
|
|
2149
|
+
function JI(A, I, g) {
|
|
2150
2150
|
for (; I !== g; )
|
|
2151
2151
|
I.upcast || t("Expected null or instance of " + g.name + ", got an instance of " + I.name), A = I.upcast(A), I = I.baseClass;
|
|
2152
2152
|
return A;
|
|
@@ -2155,7 +2155,7 @@ var qI = (function() {
|
|
|
2155
2155
|
if (I === null)
|
|
2156
2156
|
return this.isReference && t("null is not a valid " + this.name), 0;
|
|
2157
2157
|
I.$$ || t('Cannot pass "' + fA(I) + '" as a ' + this.name), I.$$.ptr || t("Cannot pass deleted object as a pointer of type " + this.name);
|
|
2158
|
-
var g = I.$$.ptrType.registeredClass, B =
|
|
2158
|
+
var g = I.$$.ptrType.registeredClass, B = JI(I.$$.ptr, g, this.registeredClass);
|
|
2159
2159
|
return B;
|
|
2160
2160
|
}
|
|
2161
2161
|
function dQ(A, I) {
|
|
@@ -2164,7 +2164,7 @@ var qI = (function() {
|
|
|
2164
2164
|
return this.isReference && t("null is not a valid " + this.name), this.isSmartPointer ? (g = this.rawConstructor(), A !== null && A.push(this.rawDestructor, g), g) : 0;
|
|
2165
2165
|
I.$$ || t('Cannot pass "' + fA(I) + '" as a ' + this.name), I.$$.ptr || t("Cannot pass deleted object as a pointer of type " + this.name), !this.isConst && I.$$.ptrType.isConst && t("Cannot convert argument of type " + (I.$$.smartPtrType ? I.$$.smartPtrType.name : I.$$.ptrType.name) + " to parameter type " + this.name);
|
|
2166
2166
|
var B = I.$$.ptrType.registeredClass;
|
|
2167
|
-
if (g =
|
|
2167
|
+
if (g = JI(I.$$.ptr, B, this.registeredClass), this.isSmartPointer)
|
|
2168
2168
|
switch (I.$$.smartPtr === void 0 && t("Passing raw pointer to smart pointer is illegal"), this.sharingPolicy) {
|
|
2169
2169
|
case 0:
|
|
2170
2170
|
I.$$.smartPtrType === this ? g = I.$$.smartPtr : t("Cannot convert argument of type " + (I.$$.smartPtrType ? I.$$.smartPtrType.name : I.$$.ptrType.name) + " to parameter type " + this.name);
|
|
@@ -2191,7 +2191,7 @@ var qI = (function() {
|
|
|
2191
2191
|
if (I === null)
|
|
2192
2192
|
return this.isReference && t("null is not a valid " + this.name), 0;
|
|
2193
2193
|
I.$$ || t('Cannot pass "' + fA(I) + '" as a ' + this.name), I.$$.ptr || t("Cannot pass deleted object as a pointer of type " + this.name), I.$$.ptrType.isConst && t("Cannot convert argument of type " + I.$$.ptrType.name + " to parameter type " + this.name);
|
|
2194
|
-
var g = I.$$.ptrType.registeredClass, B =
|
|
2194
|
+
var g = I.$$.ptrType.registeredClass, B = JI(I.$$.ptr, g, this.registeredClass);
|
|
2195
2195
|
return B;
|
|
2196
2196
|
}
|
|
2197
2197
|
function sQ(A) {
|
|
@@ -2235,10 +2235,10 @@ var qI = (function() {
|
|
|
2235
2235
|
function LQ(A, I) {
|
|
2236
2236
|
return I = pQ(A, I), EI[I];
|
|
2237
2237
|
}
|
|
2238
|
-
function
|
|
2239
|
-
(!I.ptrType || !I.ptr) &&
|
|
2238
|
+
function MI(A, I) {
|
|
2239
|
+
(!I.ptrType || !I.ptr) && lI("makeClassHandle requires ptr and ptrType");
|
|
2240
2240
|
var g = !!I.smartPtrType, B = !!I.smartPtr;
|
|
2241
|
-
return g !== B &&
|
|
2241
|
+
return g !== B && lI("Both smartPtrType and smartPtr must be specified"), I.count = { value: 1 }, BI(Object.create(A, { $$: { value: I } }));
|
|
2242
2242
|
}
|
|
2243
2243
|
function xQ(A) {
|
|
2244
2244
|
var I = this.getPointee(A);
|
|
@@ -2252,7 +2252,7 @@ var qI = (function() {
|
|
|
2252
2252
|
return this.destructor(A), B;
|
|
2253
2253
|
}
|
|
2254
2254
|
function Q() {
|
|
2255
|
-
return this.isSmartPointer ?
|
|
2255
|
+
return this.isSmartPointer ? MI(this.registeredClass.instancePrototype, { ptrType: this.pointeeType, ptr: I, smartPtrType: this, smartPtr: A }) : MI(this.registeredClass.instancePrototype, { ptrType: this, ptr: A });
|
|
2256
2256
|
}
|
|
2257
2257
|
var G = this.registeredClass.getActualType(I), i = pg[G];
|
|
2258
2258
|
if (!i)
|
|
@@ -2260,7 +2260,7 @@ var qI = (function() {
|
|
|
2260
2260
|
var D;
|
|
2261
2261
|
this.isConst ? D = i.constPointerType : D = i.pointerType;
|
|
2262
2262
|
var h = Lg(I, this.registeredClass, D.registeredClass);
|
|
2263
|
-
return h === null ? Q.call(this) : this.isSmartPointer ?
|
|
2263
|
+
return h === null ? Q.call(this) : this.isSmartPointer ? MI(D.registeredClass.instancePrototype, { ptrType: D, ptr: h, smartPtrType: this, smartPtr: A }) : MI(D.registeredClass.instancePrototype, { ptrType: D, ptr: h });
|
|
2264
2264
|
}
|
|
2265
2265
|
function jQ() {
|
|
2266
2266
|
JA.prototype.getPointee = sQ, JA.prototype.destructor = mQ, JA.prototype.argPackAdvance = 8, JA.prototype.readValueFromPointer = gI, JA.prototype.deleteObject = KQ, JA.prototype.fromWireType = xQ;
|
|
@@ -2269,7 +2269,7 @@ var qI = (function() {
|
|
|
2269
2269
|
this.name = A, this.registeredClass = I, this.isReference = g, this.isConst = B, this.isSmartPointer = Q, this.pointeeType = G, this.sharingPolicy = i, this.rawGetPointee = D, this.rawConstructor = h, this.rawShare = o, this.rawDestructor = Y, !Q && I.baseClass === void 0 ? B ? (this.toWireType = WQ, this.destructorFunction = null) : (this.toWireType = HQ, this.destructorFunction = null) : this.toWireType = dQ;
|
|
2270
2270
|
}
|
|
2271
2271
|
function xg(A, I, g) {
|
|
2272
|
-
E.hasOwnProperty(A) ||
|
|
2272
|
+
E.hasOwnProperty(A) || lI("Replacing nonexistant public symbol"), E[A].overloadTable !== void 0 && g !== void 0 ? E[A].overloadTable[g] = I : (E[A] = I, E[A].argCount = g);
|
|
2273
2273
|
}
|
|
2274
2274
|
function uQ(A, I, g) {
|
|
2275
2275
|
var B = E["dynCall_" + A];
|
|
@@ -2304,8 +2304,8 @@ var qI = (function() {
|
|
|
2304
2304
|
var g = [], B = {};
|
|
2305
2305
|
function Q(G) {
|
|
2306
2306
|
if (!B[G] && !pA[G]) {
|
|
2307
|
-
if (
|
|
2308
|
-
|
|
2307
|
+
if (RI[G]) {
|
|
2308
|
+
RI[G].forEach(Q);
|
|
2309
2309
|
return;
|
|
2310
2310
|
}
|
|
2311
2311
|
g.push(G), B[G] = !0;
|
|
@@ -2315,14 +2315,14 @@ var qI = (function() {
|
|
|
2315
2315
|
}
|
|
2316
2316
|
function tQ(A, I, g, B, Q, G, i, D, h, o, Y, a, k) {
|
|
2317
2317
|
Y = QA(Y), G = EA(Q, G), D && (D = EA(i, D)), o && (o = EA(h, o)), k = EA(a, k);
|
|
2318
|
-
var N =
|
|
2318
|
+
var N = FI(Y);
|
|
2319
2319
|
Gg(N, function() {
|
|
2320
2320
|
WA("Cannot construct " + Y + " due to unbound types", [B]);
|
|
2321
2321
|
}), kA([A, I, g], B ? [B] : [], function(b) {
|
|
2322
2322
|
b = b[0];
|
|
2323
2323
|
var y, X;
|
|
2324
2324
|
B ? (y = b.registeredClass, X = y.instancePrototype) : X = sA.prototype;
|
|
2325
|
-
var V =
|
|
2325
|
+
var V = bI(N, function() {
|
|
2326
2326
|
if (Object.getPrototypeOf(this) !== Z)
|
|
2327
2327
|
throw new zA("Use 'new' to construct " + Y);
|
|
2328
2328
|
if (J.constructor_body === void 0)
|
|
@@ -2340,7 +2340,7 @@ var qI = (function() {
|
|
|
2340
2340
|
function qg(A, I) {
|
|
2341
2341
|
if (!(A instanceof Function))
|
|
2342
2342
|
throw new TypeError("new_ called with constructor type " + typeof A + " which is not a function");
|
|
2343
|
-
var g =
|
|
2343
|
+
var g = bI(A.name || "unknownFunctionName", function() {
|
|
2344
2344
|
});
|
|
2345
2345
|
g.prototype = A.prototype;
|
|
2346
2346
|
var B = new g(), Q = A.apply(B, I);
|
|
@@ -2356,7 +2356,7 @@ var qI = (function() {
|
|
|
2356
2356
|
}
|
|
2357
2357
|
for (var o = I[0].name !== "void", Y = "", a = "", h = 0; h < G - 2; ++h)
|
|
2358
2358
|
Y += (h !== 0 ? ", " : "") + "arg" + h, a += (h !== 0 ? ", " : "") + "arg" + h + "Wired";
|
|
2359
|
-
var k = "return function " +
|
|
2359
|
+
var k = "return function " + FI(A) + "(" + Y + `) {
|
|
2360
2360
|
if (arguments.length !== ` + (G - 2) + `) {
|
|
2361
2361
|
throwBindingError('function ` + A + " called with ' + arguments.length + ' arguments, expected " + (G - 2) + ` args!');
|
|
2362
2362
|
}
|
|
@@ -2386,13 +2386,13 @@ return ret;
|
|
|
2386
2386
|
var V = qg(Function, b).apply(null, y);
|
|
2387
2387
|
return V;
|
|
2388
2388
|
}
|
|
2389
|
-
function
|
|
2389
|
+
function UI(A, I) {
|
|
2390
2390
|
for (var g = [], B = 0; B < A; B++)
|
|
2391
2391
|
g.push(S[(I >> 2) + B]);
|
|
2392
2392
|
return g;
|
|
2393
2393
|
}
|
|
2394
2394
|
function nQ(A, I, g, B, Q, G, i) {
|
|
2395
|
-
var D =
|
|
2395
|
+
var D = UI(g, B);
|
|
2396
2396
|
I = QA(I), G = EA(Q, G), kA([], [A], function(h) {
|
|
2397
2397
|
h = h[0];
|
|
2398
2398
|
var o = h.name + "." + I;
|
|
@@ -2407,7 +2407,7 @@ return ret;
|
|
|
2407
2407
|
});
|
|
2408
2408
|
}
|
|
2409
2409
|
function vg(A, I, g) {
|
|
2410
|
-
return A instanceof Object || t(g + ' with invalid "this": ' + A), A instanceof I.registeredClass.constructor || t(g + ' incompatible with "this" of type ' + A.constructor.name), A.$$.ptr || t("cannot call emscripten binding method " + g + " on deleted object"),
|
|
2410
|
+
return A instanceof Object || t(g + ' with invalid "this": ' + A), A instanceof I.registeredClass.constructor || t(g + ' incompatible with "this" of type ' + A.constructor.name), A.$$.ptr || t("cannot call emscripten binding method " + g + " on deleted object"), JI(A.$$.ptr, A.$$.ptrType.registeredClass, I.registeredClass);
|
|
2411
2411
|
}
|
|
2412
2412
|
function zQ(A, I, g, B, Q, G, i, D) {
|
|
2413
2413
|
I = QA(I), G = EA(Q, G), kA([], [A], function(h) {
|
|
@@ -2433,7 +2433,7 @@ return ret;
|
|
|
2433
2433
|
}
|
|
2434
2434
|
function fQ(A, I, g, B, Q, G) {
|
|
2435
2435
|
eI(I > 0);
|
|
2436
|
-
var i =
|
|
2436
|
+
var i = UI(I, g);
|
|
2437
2437
|
Q = EA(B, Q);
|
|
2438
2438
|
var D = [G], h = [];
|
|
2439
2439
|
kA([], [A], function(o) {
|
|
@@ -2455,7 +2455,7 @@ return ret;
|
|
|
2455
2455
|
});
|
|
2456
2456
|
}
|
|
2457
2457
|
function OQ(A, I, g, B, Q, G, i, D) {
|
|
2458
|
-
var h =
|
|
2458
|
+
var h = UI(g, B);
|
|
2459
2459
|
I = QA(I), G = EA(Q, G), kA([], [A], function(o) {
|
|
2460
2460
|
o = o[0];
|
|
2461
2461
|
var Y = o.name + "." + I;
|
|
@@ -2566,7 +2566,7 @@ return ret;
|
|
|
2566
2566
|
}
|
|
2567
2567
|
}
|
|
2568
2568
|
function BC(A, I, g, B) {
|
|
2569
|
-
var Q =
|
|
2569
|
+
var Q = SI(g);
|
|
2570
2570
|
I = QA(I);
|
|
2571
2571
|
function G() {
|
|
2572
2572
|
}
|
|
@@ -2576,14 +2576,14 @@ return ret;
|
|
|
2576
2576
|
return D.value;
|
|
2577
2577
|
}, argPackAdvance: 8, readValueFromPointer: gC(I, Q, B), destructorFunction: null }), Gg(I, G);
|
|
2578
2578
|
}
|
|
2579
|
-
function
|
|
2579
|
+
function cI(A, I) {
|
|
2580
2580
|
var g = pA[A];
|
|
2581
2581
|
return g === void 0 && t(I + " has unknown type " + ug(A)), g;
|
|
2582
2582
|
}
|
|
2583
2583
|
function QC(A, I, g) {
|
|
2584
|
-
var B =
|
|
2584
|
+
var B = cI(A, "enum");
|
|
2585
2585
|
I = QA(I);
|
|
2586
|
-
var Q = B.constructor, G = Object.create(B.constructor.prototype, { value: { value: g }, constructor: { value:
|
|
2586
|
+
var Q = B.constructor, G = Object.create(B.constructor.prototype, { value: { value: g }, constructor: { value: bI(B.name + "_" + I, function() {
|
|
2587
2587
|
}) } });
|
|
2588
2588
|
Q.values[g] = G, Q[I] = G;
|
|
2589
2589
|
}
|
|
@@ -2608,7 +2608,7 @@ return ret;
|
|
|
2608
2608
|
}
|
|
2609
2609
|
}
|
|
2610
2610
|
function EC(A, I, g) {
|
|
2611
|
-
var B =
|
|
2611
|
+
var B = SI(g);
|
|
2612
2612
|
I = QA(I), SA(A, { name: I, fromWireType: function(Q) {
|
|
2613
2613
|
return Q;
|
|
2614
2614
|
}, toWireType: function(Q, G) {
|
|
@@ -2618,7 +2618,7 @@ return ret;
|
|
|
2618
2618
|
}, argPackAdvance: 8, readValueFromPointer: CC(I, B), destructorFunction: null });
|
|
2619
2619
|
}
|
|
2620
2620
|
function GC(A, I, g, B, Q, G) {
|
|
2621
|
-
var i =
|
|
2621
|
+
var i = UI(I, g);
|
|
2622
2622
|
A = QA(A), Q = EA(B, Q), Gg(A, function() {
|
|
2623
2623
|
WA("Cannot call " + A + " due to unbound types", i);
|
|
2624
2624
|
}, I - 1), kA([], i, function(D) {
|
|
@@ -2652,7 +2652,7 @@ return ret;
|
|
|
2652
2652
|
}
|
|
2653
2653
|
function DC(A, I, g, B, Q) {
|
|
2654
2654
|
I = QA(I), Q === -1 && (Q = 4294967295);
|
|
2655
|
-
var G =
|
|
2655
|
+
var G = SI(g), i = function(o) {
|
|
2656
2656
|
return o;
|
|
2657
2657
|
};
|
|
2658
2658
|
if (B === 0) {
|
|
@@ -2675,7 +2675,7 @@ return ret;
|
|
|
2675
2675
|
function G(i) {
|
|
2676
2676
|
i = i >> 2;
|
|
2677
2677
|
var D = lA, h = D[i], o = D[i + 1];
|
|
2678
|
-
return new Q(
|
|
2678
|
+
return new Q(wI, o, h);
|
|
2679
2679
|
}
|
|
2680
2680
|
g = QA(g), SA(A, { name: g, fromWireType: G, argPackAdvance: 8, readValueFromPointer: G }, { ignoreDuplicateRegistrations: !0 });
|
|
2681
2681
|
}
|
|
@@ -2709,7 +2709,7 @@ return ret;
|
|
|
2709
2709
|
Q instanceof ArrayBuffer && (Q = new Uint8Array(Q));
|
|
2710
2710
|
var G, i = typeof Q == "string";
|
|
2711
2711
|
i || Q instanceof Uint8Array || Q instanceof Uint8ClampedArray || Q instanceof Int8Array || t("Cannot pass non-string to std::string"), g && i ? G = function() {
|
|
2712
|
-
return
|
|
2712
|
+
return YI(Q);
|
|
2713
2713
|
} : G = function() {
|
|
2714
2714
|
return Q.length;
|
|
2715
2715
|
};
|
|
@@ -2754,10 +2754,10 @@ return ret;
|
|
|
2754
2754
|
} });
|
|
2755
2755
|
}
|
|
2756
2756
|
function kC(A, I, g, B, Q, G) {
|
|
2757
|
-
|
|
2757
|
+
NI[A] = { name: QA(I), rawConstructor: EA(g, B), rawDestructor: EA(Q, G), elements: [] };
|
|
2758
2758
|
}
|
|
2759
2759
|
function aC(A, I, g, B, Q, G, i, D, h) {
|
|
2760
|
-
|
|
2760
|
+
NI[A].elements.push({ getterReturnType: I, getter: EA(g, B), getterContext: Q, setterArgumentType: G, setter: EA(i, D), setterContext: h });
|
|
2761
2761
|
}
|
|
2762
2762
|
function ZC(A, I) {
|
|
2763
2763
|
I = QA(I), SA(A, { isVoid: !0, name: I, argPackAdvance: 0, fromWireType: function() {
|
|
@@ -2768,13 +2768,13 @@ return ret;
|
|
|
2768
2768
|
return A || t("Cannot use deleted val. handle = " + A), RA[A].value;
|
|
2769
2769
|
}
|
|
2770
2770
|
function NC(A, I, g) {
|
|
2771
|
-
A = dA(A), I =
|
|
2771
|
+
A = dA(A), I = cI(I, "emval::as");
|
|
2772
2772
|
var B = [], Q = MA(B);
|
|
2773
2773
|
return S[g >> 2] = Q, I.toWireType(B, A);
|
|
2774
2774
|
}
|
|
2775
2775
|
function tg(A, I) {
|
|
2776
2776
|
for (var g = new Array(A), B = 0; B < A; ++B)
|
|
2777
|
-
g[B] =
|
|
2777
|
+
g[B] = cI(S[(I >> 2) + B], "parameter " + B);
|
|
2778
2778
|
return g;
|
|
2779
2779
|
}
|
|
2780
2780
|
function RC(A, I, g, B) {
|
|
@@ -2804,7 +2804,7 @@ return ret;
|
|
|
2804
2804
|
return N.name;
|
|
2805
2805
|
}).join("_") + "$", G = ["retType"], i = [B], D = "", h = 0; h < A - 1; ++h)
|
|
2806
2806
|
D += (h !== 0 ? ", " : "") + "arg" + h, G.push("argType" + h), i.push(g[1 + h]);
|
|
2807
|
-
for (var o =
|
|
2807
|
+
for (var o = FI("methodCaller_" + Q), Y = "return function " + o + `(handle, name, destructors, args) {
|
|
2808
2808
|
`, a = 0, h = 0; h < A - 1; ++h)
|
|
2809
2809
|
Y += " var arg" + h + " = argType" + h + ".readValueFromPointer(args" + (a ? "+" + a : "") + `);
|
|
2810
2810
|
`, a += g[h + 1].argPackAdvance;
|
|
@@ -2842,7 +2842,7 @@ return ret;
|
|
|
2842
2842
|
A = dA(A), I = dA(I), g = dA(g), A[I] = g;
|
|
2843
2843
|
}
|
|
2844
2844
|
function HC(A, I) {
|
|
2845
|
-
A =
|
|
2845
|
+
A = cI(A, "_emval_take_value");
|
|
2846
2846
|
var g = A.readValueFromPointer(I);
|
|
2847
2847
|
return MA(g);
|
|
2848
2848
|
}
|
|
@@ -2871,7 +2871,7 @@ return ret;
|
|
|
2871
2871
|
}
|
|
2872
2872
|
function PC(A) {
|
|
2873
2873
|
try {
|
|
2874
|
-
return
|
|
2874
|
+
return oI.grow(A - wI.byteLength + 65535 >>> 16), cg(oI.buffer), 1;
|
|
2875
2875
|
} catch {
|
|
2876
2876
|
}
|
|
2877
2877
|
}
|
|
@@ -2946,7 +2946,7 @@ return ret;
|
|
|
2946
2946
|
function qC(A, I, g, B, Q) {
|
|
2947
2947
|
try {
|
|
2948
2948
|
var G = gA.getStreamFromFD(A), i = 4294967296, D = g * i + (I >>> 0), h = 9007199254740992;
|
|
2949
|
-
return D <= -h || D >= h ? -61 : (C.llseek(G, D, B), wA = [G.position >>> 0, (
|
|
2949
|
+
return D <= -h || D >= h ? -61 : (C.llseek(G, D, B), wA = [G.position >>> 0, (_ = G.position, +Math.abs(_) >= 1 ? _ > 0 ? (Math.min(+Math.floor(_ / 4294967296), 4294967295) | 0) >>> 0 : ~~+Math.ceil((_ - +(~~_ >>> 0)) / 4294967296) >>> 0 : 0)], S[Q >> 2] = wA[0], S[Q + 4 >> 2] = wA[1], G.getdents && D === 0 && B === 0 && (G.getdents = null), 0);
|
|
2950
2950
|
} catch (o) {
|
|
2951
2951
|
return (typeof C > "u" || !(o instanceof C.ErrnoError)) && CA(o), o.errno;
|
|
2952
2952
|
}
|
|
@@ -2968,7 +2968,7 @@ return ret;
|
|
|
2968
2968
|
function zC(A) {
|
|
2969
2969
|
ZA(A);
|
|
2970
2970
|
}
|
|
2971
|
-
function
|
|
2971
|
+
function yI(A) {
|
|
2972
2972
|
return A % 4 === 0 && (A % 100 !== 0 || A % 400 === 0);
|
|
2973
2973
|
}
|
|
2974
2974
|
function wg(A, I) {
|
|
@@ -2976,10 +2976,10 @@ return ret;
|
|
|
2976
2976
|
;
|
|
2977
2977
|
return g;
|
|
2978
2978
|
}
|
|
2979
|
-
var
|
|
2980
|
-
function
|
|
2979
|
+
var WI = [31, 29, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31], dI = [31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31];
|
|
2980
|
+
function HI(A, I) {
|
|
2981
2981
|
for (var g = new Date(A.getTime()); I > 0; ) {
|
|
2982
|
-
var B =
|
|
2982
|
+
var B = yI(g.getFullYear()), Q = g.getMonth(), G = (B ? WI : dI)[Q];
|
|
2983
2983
|
if (I > G - g.getDate())
|
|
2984
2984
|
I -= G - g.getDate() + 1, g.setDate(1), Q < 11 ? g.setMonth(Q + 1) : (g.setMonth(0), g.setFullYear(g.getFullYear() + 1));
|
|
2985
2985
|
else
|
|
@@ -3026,7 +3026,7 @@ return ret;
|
|
|
3026
3026
|
}
|
|
3027
3027
|
}
|
|
3028
3028
|
function y(Z) {
|
|
3029
|
-
var J =
|
|
3029
|
+
var J = HI(new Date(Z.tm_year + 1900, 0, 1), Z.tm_yday), q = new Date(J.getFullYear(), 0, 4), p = new Date(J.getFullYear() + 1, 0, 4), z = b(q), W = b(p);
|
|
3030
3030
|
return N(z, J) <= 0 ? N(W, J) <= 0 ? J.getFullYear() + 1 : J.getFullYear() : J.getFullYear() - 1;
|
|
3031
3031
|
}
|
|
3032
3032
|
var X = { "%a": function(Z) {
|
|
@@ -3054,7 +3054,7 @@ return ret;
|
|
|
3054
3054
|
var J = Z.tm_hour;
|
|
3055
3055
|
return J == 0 ? J = 12 : J > 12 && (J -= 12), k(J, 2);
|
|
3056
3056
|
}, "%j": function(Z) {
|
|
3057
|
-
return k(Z.tm_mday + wg(
|
|
3057
|
+
return k(Z.tm_mday + wg(yI(Z.tm_year + 1900) ? WI : dI, Z.tm_mon - 1), 3);
|
|
3058
3058
|
}, "%m": function(Z) {
|
|
3059
3059
|
return k(Z.tm_mon + 1, 2);
|
|
3060
3060
|
}, "%M": function(Z) {
|
|
@@ -3071,14 +3071,14 @@ return ret;
|
|
|
3071
3071
|
}, "%u": function(Z) {
|
|
3072
3072
|
return Z.tm_wday || 7;
|
|
3073
3073
|
}, "%U": function(Z) {
|
|
3074
|
-
var J = new Date(Z.tm_year + 1900, 0, 1), q = J.getDay() === 0 ? J :
|
|
3074
|
+
var J = new Date(Z.tm_year + 1900, 0, 1), q = J.getDay() === 0 ? J : HI(J, 7 - J.getDay()), p = new Date(Z.tm_year + 1900, Z.tm_mon, Z.tm_mday);
|
|
3075
3075
|
if (N(q, p) < 0) {
|
|
3076
|
-
var z = wg(
|
|
3076
|
+
var z = wg(yI(p.getFullYear()) ? WI : dI, p.getMonth() - 1) - 31, W = 31 - q.getDate(), c = W + z + p.getDate();
|
|
3077
3077
|
return k(Math.ceil(c / 7), 2);
|
|
3078
3078
|
}
|
|
3079
3079
|
return N(q, J) === 0 ? "01" : "00";
|
|
3080
3080
|
}, "%V": function(Z) {
|
|
3081
|
-
var J = new Date(Z.tm_year + 1900, 0, 4), q = new Date(Z.tm_year + 1901, 0, 4), p = b(J), z = b(q), W =
|
|
3081
|
+
var J = new Date(Z.tm_year + 1900, 0, 4), q = new Date(Z.tm_year + 1901, 0, 4), p = b(J), z = b(q), W = HI(new Date(Z.tm_year + 1900, 0, 1), Z.tm_yday);
|
|
3082
3082
|
if (N(W, p) < 0)
|
|
3083
3083
|
return "53";
|
|
3084
3084
|
if (N(z, W) <= 0)
|
|
@@ -3088,9 +3088,9 @@ return ret;
|
|
|
3088
3088
|
}, "%w": function(Z) {
|
|
3089
3089
|
return Z.tm_wday;
|
|
3090
3090
|
}, "%W": function(Z) {
|
|
3091
|
-
var J = new Date(Z.tm_year, 0, 1), q = J.getDay() === 1 ? J :
|
|
3091
|
+
var J = new Date(Z.tm_year, 0, 1), q = J.getDay() === 1 ? J : HI(J, J.getDay() === 0 ? 1 : 7 - J.getDay() + 1), p = new Date(Z.tm_year + 1900, Z.tm_mon, Z.tm_mday);
|
|
3092
3092
|
if (N(q, p) < 0) {
|
|
3093
|
-
var z = wg(
|
|
3093
|
+
var z = wg(yI(p.getFullYear()) ? WI : dI, p.getMonth() - 1) - 31, W = 31 - q.getDate(), c = W + z + p.getDate();
|
|
3094
3094
|
return k(Math.ceil(c / 7), 2);
|
|
3095
3095
|
}
|
|
3096
3096
|
return N(q, J) === 0 ? "01" : "00";
|
|
@@ -3108,7 +3108,7 @@ return ret;
|
|
|
3108
3108
|
} };
|
|
3109
3109
|
for (var h in X)
|
|
3110
3110
|
i.includes(h) && (i = i.replace(new RegExp(h, "g"), X[h](G)));
|
|
3111
|
-
var V =
|
|
3111
|
+
var V = KI(i, !1);
|
|
3112
3112
|
return V.length > I ? 0 : (KB(V, A), V.length - 1);
|
|
3113
3113
|
}
|
|
3114
3114
|
function OC(A, I, g, B) {
|
|
@@ -3116,22 +3116,22 @@ return ret;
|
|
|
3116
3116
|
}
|
|
3117
3117
|
var fg = function(A, I, g, B) {
|
|
3118
3118
|
A || (A = this), this.parent = A, this.mount = A.mount, this.mounted = null, this.id = C.nextInode++, this.name = I, this.mode = g, this.node_ops = {}, this.stream_ops = {}, this.rdev = B;
|
|
3119
|
-
},
|
|
3119
|
+
}, sI = 365, mI = 146;
|
|
3120
3120
|
Object.defineProperties(fg.prototype, { read: { get: function() {
|
|
3121
|
-
return (this.mode &
|
|
3121
|
+
return (this.mode & sI) === sI;
|
|
3122
3122
|
}, set: function(A) {
|
|
3123
|
-
A ? this.mode |=
|
|
3123
|
+
A ? this.mode |= sI : this.mode &= ~sI;
|
|
3124
3124
|
} }, write: { get: function() {
|
|
3125
|
-
return (this.mode &
|
|
3125
|
+
return (this.mode & mI) === mI;
|
|
3126
3126
|
}, set: function(A) {
|
|
3127
|
-
A ? this.mode |=
|
|
3127
|
+
A ? this.mode |= mI : this.mode &= ~mI;
|
|
3128
3128
|
} }, isFolder: { get: function() {
|
|
3129
3129
|
return C.isDir(this.mode);
|
|
3130
3130
|
} }, isDevice: { get: function() {
|
|
3131
3131
|
return C.isChrdev(this.mode);
|
|
3132
3132
|
} } }), C.FSNode = fg, C.staticInit(), E.FS_createPath = C.createPath, E.FS_createDataFile = C.createDataFile, E.FS_createPreloadedFile = C.createPreloadedFile, E.FS_createLazyFile = C.createLazyFile, E.FS_createDevice = C.createDevice, E.FS_unlink = C.unlink, Xg = E.InternalError = gg(Error, "InternalError"), NQ(), zA = E.BindingError = gg(Error, "BindingError"), cQ(), jQ(), TQ(), jg = E.UnboundTypeError = gg(Error, "UnboundTypeError"), AC();
|
|
3133
|
-
function
|
|
3134
|
-
var B =
|
|
3133
|
+
function KI(A, I, g) {
|
|
3134
|
+
var B = YI(A) + 1, Q = new Array(B), G = rI(A, Q, 0, Q.length);
|
|
3135
3135
|
return I && (Q.length = G), Q;
|
|
3136
3136
|
}
|
|
3137
3137
|
var eC = { B: nB, o: zB, q: OB, A: rB, b: $B, h: AQ, Ka: IQ, p: Kg, fa: gQ, M: BQ, ua: QQ, e: _B, ha: iQ, Da: DQ, Ba: hQ, ja: oQ, Ca: YQ, Qa: aQ, Va: ZQ, Fa: RQ, u: tQ, y: nQ, r: zQ, z: fQ, j: OQ, H: eQ, U: rQ, Ea: IC, T: BC, S: QC, ka: EC, G: GC, O: DC, N: hC, s: oC, la: YC, ba: wC, pa: kC, $: aC, Ga: ZC, Q: NC, Ra: RC, _: bC, ia: hg, Z: SC, Pa: JC, ma: MC, Ta: UC, Oa: cC, La: yC, Na: WC, Sa: dC, C: HC, Ma: sC, wa: mC, ea: XC, ta: VC, aa: TC, xa: LC, ya: xC, X: jC, Aa: uC, Ua: qC, za: vC, a: tC, Ha: ZE, da: aE, Ja: oE, ra: yE, oa: lE, x: EE, g: rC, Ia: wE, L: YE, na: SE, Y: RE, c: IE, i: BE, v: AE, ga: WE, t: iE, K: kE, F: bE, I: UE, W: dE, l: DE, m: CE, sa: cE, P: hE, f: $C, qa: sE, d: _C, k: gE, ca: JE, n: QE, w: GE, D: FE, J: ME, R: NE, V: HE, E: nC, Wa: zC, va: OC };
|
|
@@ -3154,12 +3154,12 @@ return ret;
|
|
|
3154
3154
|
return (j = E.stackSave = E.asm.db).apply(null, arguments);
|
|
3155
3155
|
}, u = E.stackRestore = function() {
|
|
3156
3156
|
return (u = E.stackRestore = E.asm.eb).apply(null, arguments);
|
|
3157
|
-
},
|
|
3158
|
-
return (
|
|
3157
|
+
}, XI = E.stackAlloc = function() {
|
|
3158
|
+
return (XI = E.stackAlloc = E.asm.fb).apply(null, arguments);
|
|
3159
3159
|
}, n = E._setThrew = function() {
|
|
3160
3160
|
return (n = E._setThrew = E.asm.gb).apply(null, arguments);
|
|
3161
|
-
},
|
|
3162
|
-
return (
|
|
3161
|
+
}, VI = E.___cxa_can_catch = function() {
|
|
3162
|
+
return (VI = E.___cxa_can_catch = E.asm.hb).apply(null, arguments);
|
|
3163
3163
|
}, rg = E.___cxa_is_pointer_type = function() {
|
|
3164
3164
|
return (rg = E.___cxa_is_pointer_type = E.asm.ib).apply(null, arguments);
|
|
3165
3165
|
};
|
|
@@ -3489,19 +3489,19 @@ return ret;
|
|
|
3489
3489
|
n(1, 0);
|
|
3490
3490
|
}
|
|
3491
3491
|
}
|
|
3492
|
-
E.addRunDependency = Ag, E.removeRunDependency =
|
|
3493
|
-
var
|
|
3492
|
+
E.addRunDependency = Ag, E.removeRunDependency = kI, E.FS_createPath = C.createPath, E.FS_createDataFile = C.createDataFile, E.FS_createPreloadedFile = C.createPreloadedFile, E.FS_createLazyFile = C.createLazyFile, E.FS_createDevice = C.createDevice, E.FS_unlink = C.unlink;
|
|
3493
|
+
var PI;
|
|
3494
3494
|
function mE(A) {
|
|
3495
3495
|
this.name = "ExitStatus", this.message = "Program terminated with exit(" + A + ")", this.status = A;
|
|
3496
3496
|
}
|
|
3497
3497
|
AI = function A() {
|
|
3498
|
-
|
|
3498
|
+
PI || kg(), PI || (AI = A);
|
|
3499
3499
|
};
|
|
3500
3500
|
function kg(A) {
|
|
3501
3501
|
if (PA > 0 || (PB(), PA > 0))
|
|
3502
3502
|
return;
|
|
3503
3503
|
function I() {
|
|
3504
|
-
|
|
3504
|
+
PI || (PI = !0, E.calledRun = !0, !Sg && (TB(), R(E), E.onRuntimeInitialized && E.onRuntimeInitialized(), pB()));
|
|
3505
3505
|
}
|
|
3506
3506
|
E.setStatus ? (E.setStatus("Running..."), setTimeout(function() {
|
|
3507
3507
|
setTimeout(function() {
|
|
@@ -3539,8 +3539,8 @@ return ret;
|
|
|
3539
3539
|
return fetch(L).then(function(BA) {
|
|
3540
3540
|
if (BA.status === 200)
|
|
3541
3541
|
return BA.text().then(function(iA) {
|
|
3542
|
-
var
|
|
3543
|
-
return aA = aA.replace(new RegExp(B, "g"), Q), { data: iA, filePath: aA, fullPath:
|
|
3542
|
+
var $ = new URL(BA.url), aA = $.pathname.substring(1);
|
|
3543
|
+
return aA = aA.replace(new RegExp(B, "g"), Q), { data: iA, filePath: aA, fullPath: $.origin + $.pathname };
|
|
3544
3544
|
});
|
|
3545
3545
|
if (d < c.length)
|
|
3546
3546
|
return K();
|
|
@@ -3554,8 +3554,8 @@ return ret;
|
|
|
3554
3554
|
function K() {
|
|
3555
3555
|
var L = a(W, c[d++]);
|
|
3556
3556
|
return L = I.resolve(L), new Promise(function(BA, iA) {
|
|
3557
|
-
A.readFile(L, "utf8", function(
|
|
3558
|
-
if (
|
|
3557
|
+
A.readFile(L, "utf8", function($, aA) {
|
|
3558
|
+
if ($)
|
|
3559
3559
|
d < c.length ? BA(K()) : iA(new Error("MaterialX file not found: " + W));
|
|
3560
3560
|
else {
|
|
3561
3561
|
var mA = I.parse(L), FA = L.substring(mA.root.length), iI = B === "\\" ? "\\\\" : B;
|
|
@@ -3584,8 +3584,8 @@ return ret;
|
|
|
3584
3584
|
var iA = B === "\\" ? "\\\\" : B;
|
|
3585
3585
|
L.replace(new RegExp(iA, "g"), Q);
|
|
3586
3586
|
} else if (G) {
|
|
3587
|
-
var
|
|
3588
|
-
|
|
3587
|
+
var $ = document.createElement("a");
|
|
3588
|
+
$.href = L, $.origin + $.pathname + $.search + $.hash === L && (L = c + $.pathname);
|
|
3589
3589
|
} else
|
|
3590
3590
|
throw new Error("Unknown environment!");
|
|
3591
3591
|
d[K] = L;
|
|
@@ -3618,8 +3618,8 @@ return ret;
|
|
|
3618
3618
|
function q(W, c, d, K, L = !0) {
|
|
3619
3619
|
var BA;
|
|
3620
3620
|
L ? BA = W.substring(1, W.lastIndexOf(Q)).split(Q) : BA = W.substring(K.length).split(Q);
|
|
3621
|
-
for (var iA = K,
|
|
3622
|
-
iA += Q + BA[
|
|
3621
|
+
for (var iA = K, $ = 1; $ < BA.length; ++$) {
|
|
3622
|
+
iA += Q + BA[$];
|
|
3623
3623
|
var aA;
|
|
3624
3624
|
try {
|
|
3625
3625
|
var mA = C.stat(iA);
|
|
@@ -3668,24 +3668,24 @@ return ret;
|
|
|
3668
3668
|
KE(function() {
|
|
3669
3669
|
G = typeof window == "object", i = typeof process == "object" && typeof process.versions == "object" && typeof process.versions.node == "string", G && (B = "/"), i && (A = require("fs"), I = require("path"), g = require("process"), B = I.sep);
|
|
3670
3670
|
function W(c, d, K, L, BA = [], iA = "") {
|
|
3671
|
-
var
|
|
3671
|
+
var $ = "/readFromXml" + h++ % o, aA = b(K);
|
|
3672
3672
|
try {
|
|
3673
|
-
C.mkdir(
|
|
3673
|
+
C.mkdir($);
|
|
3674
3674
|
} catch {
|
|
3675
3675
|
throw new Error("Failed to create folder in WASM FS.");
|
|
3676
3676
|
}
|
|
3677
3677
|
var mA = [];
|
|
3678
3678
|
(!L || L.readXIncludes) && (mA = V(d));
|
|
3679
|
-
var FA = { files: [], folders: [] }, iI = p(
|
|
3679
|
+
var FA = { files: [], folders: [] }, iI = p($), DI = iI + "/ChosenToHopefullyNotClashWithAnyOtherFile123";
|
|
3680
3680
|
if (iA) {
|
|
3681
3681
|
var XE = B === "\\" ? "\\\\" : B;
|
|
3682
|
-
DI = iA.replace(new RegExp(XE, "g"), Q), DI = a(DI,
|
|
3682
|
+
DI = iA.replace(new RegExp(XE, "g"), Q), DI = a(DI, $, Q), q(iI, null, FA, $, !1);
|
|
3683
3683
|
}
|
|
3684
|
-
q(DI, d, FA,
|
|
3685
|
-
function $g(
|
|
3686
|
-
var
|
|
3684
|
+
q(DI, d, FA, $);
|
|
3685
|
+
function $g(TI, eA, ag) {
|
|
3686
|
+
var pI = [Promise.resolve()];
|
|
3687
3687
|
for (var Zg of eA) {
|
|
3688
|
-
var LA =
|
|
3688
|
+
var LA = TI.slice(), LI = ag.slice(), VE = Z(Zg, LI).then(function(KA) {
|
|
3689
3689
|
if (LA.includes(KA.fullPath))
|
|
3690
3690
|
throw new Error(`Cycle detected!
|
|
3691
3691
|
` + LA.join(`
|
|
@@ -3693,34 +3693,34 @@ return ret;
|
|
|
3693
3693
|
-> ` + KA.fullPath);
|
|
3694
3694
|
LA.push(KA.fullPath);
|
|
3695
3695
|
var AB = KA.fullPath.lastIndexOf(B), IB = KA.fullPath.substring(0, AB > -1 ? AB : 0);
|
|
3696
|
-
|
|
3697
|
-
var PE = V(KA.data), gB = a(KA.filePath,
|
|
3698
|
-
return FA.files.includes(gB) || q(gB, KA.data, FA,
|
|
3696
|
+
LI.includes(IB) || LI.splice(0, 0, IB);
|
|
3697
|
+
var PE = V(KA.data), gB = a(KA.filePath, $, Q);
|
|
3698
|
+
return FA.files.includes(gB) || q(gB, KA.data, FA, $), $g(LA, PE, LI);
|
|
3699
3699
|
});
|
|
3700
|
-
|
|
3700
|
+
pI.push(VE);
|
|
3701
3701
|
}
|
|
3702
|
-
return Promise.all(
|
|
3702
|
+
return Promise.all(pI);
|
|
3703
3703
|
}
|
|
3704
3704
|
return $g(BA, mA, aA).then(function() {
|
|
3705
|
-
var
|
|
3705
|
+
var TI = X(K, $);
|
|
3706
3706
|
C.chdir(iI);
|
|
3707
3707
|
try {
|
|
3708
3708
|
var eA = E.getEnviron(E.MATERIALX_SEARCH_PATH_ENV_VAR);
|
|
3709
3709
|
if (eA) {
|
|
3710
|
-
var ag = y(eA,
|
|
3710
|
+
var ag = y(eA, $);
|
|
3711
3711
|
E.setEnviron(E.MATERIALX_SEARCH_PATH_ENV_VAR, ag);
|
|
3712
3712
|
}
|
|
3713
|
-
E._readFromXmlFile(c, DI,
|
|
3713
|
+
E._readFromXmlFile(c, DI, TI, L), eA && E.setEnviron(E.MATERIALX_SEARCH_PATH_ENV_VAR, eA);
|
|
3714
3714
|
} catch (LA) {
|
|
3715
3715
|
throw new Error("Failed to read MaterialX files from WASM FS: " + E.getExceptionMessage(LA));
|
|
3716
3716
|
}
|
|
3717
3717
|
try {
|
|
3718
|
-
for (var
|
|
3719
|
-
C.unlink(
|
|
3718
|
+
for (var pI of FA.files)
|
|
3719
|
+
C.unlink(pI);
|
|
3720
3720
|
C.chdir("/");
|
|
3721
3721
|
for (var Zg of FA.folders)
|
|
3722
3722
|
C.rmdir(Zg);
|
|
3723
|
-
C.rmdir(
|
|
3723
|
+
C.rmdir($);
|
|
3724
3724
|
} catch {
|
|
3725
3725
|
throw new Error("Failed to delete temporary files from WASM FS.");
|
|
3726
3726
|
}
|
|
@@ -3735,8 +3735,8 @@ return ret;
|
|
|
3735
3735
|
throw new Error("Function readFromXmlFile called with an invalid number of arguments (" + arguments.length + ") - expects 2 to 4!");
|
|
3736
3736
|
var BA = b(K);
|
|
3737
3737
|
return Z(d, BA).then(function(iA) {
|
|
3738
|
-
var
|
|
3739
|
-
return K = K.concat(D, mA), W(c, iA.data, K, L,
|
|
3738
|
+
var $ = [iA.fullPath], aA = iA.fullPath.lastIndexOf(B), mA = iA.fullPath.substring(0, aA > -1 ? aA : 0);
|
|
3739
|
+
return K = K.concat(D, mA), W(c, iA.data, K, L, $, iA.filePath);
|
|
3740
3740
|
});
|
|
3741
3741
|
}, E.writeToXmlFile = function(c, d, K = null) {
|
|
3742
3742
|
if (arguments.length < 2 || arguments.length > 3)
|
|
@@ -3797,7 +3797,7 @@ function EB(l, w, E = 0, R = 1024, H = 512, M) {
|
|
|
3797
3797
|
generateMipmaps: !0,
|
|
3798
3798
|
wrapS: Rg,
|
|
3799
3799
|
anisotropy: l.capabilities.getMaxAnisotropy()
|
|
3800
|
-
}),
|
|
3800
|
+
}), AA = new NB(2, 2), O = new xE(-1, 1, 1, -1, 0, 1), IA = new RB({
|
|
3801
3801
|
defines: {
|
|
3802
3802
|
USE_ENVMAP: "",
|
|
3803
3803
|
ENVMAP_TYPE_CUBE_UV: "",
|
|
@@ -3853,14 +3853,14 @@ function EB(l, w, E = 0, R = 1024, H = 512, M) {
|
|
|
3853
3853
|
gl_FragColor = vec4(envColor.rgb, 1.0);
|
|
3854
3854
|
}
|
|
3855
3855
|
`
|
|
3856
|
-
}), v = new jE(), hA = new Fg(
|
|
3856
|
+
}), v = new jE(), hA = new Fg(AA, IA);
|
|
3857
3857
|
v.add(hA);
|
|
3858
3858
|
const UA = l.getRenderTarget(), jA = l.autoClear, rA = l.xr.enabled, uA = l.shadowMap.enabled;
|
|
3859
3859
|
m.texture.generateMipmaps = !0;
|
|
3860
3860
|
try {
|
|
3861
3861
|
l.xr.enabled = !1, l.shadowMap.enabled = !1, l.autoClear = !0, l.setRenderTarget(m), l.clear(), l.render(v, O);
|
|
3862
3862
|
} finally {
|
|
3863
|
-
l.setRenderTarget(UA), l.autoClear = jA, l.xr.enabled = rA, l.shadowMap.enabled = uA,
|
|
3863
|
+
l.setRenderTarget(UA), l.autoClear = jA, l.xr.enabled = rA, l.shadowMap.enabled = uA, AA.dispose(), IA.dispose(), v.remove(hA);
|
|
3864
3864
|
}
|
|
3865
3865
|
return m.texture.name = "PMREM_Equirectangular_Texture_" + E.toFixed(2), m.texture.mapping = uE, iG && console.log("[MaterialX] PMREM to Equirect Render Target:", {
|
|
3866
3866
|
width: m.width,
|
|
@@ -3947,17 +3947,17 @@ function YG(l, w, E, R, H, M) {
|
|
|
3947
3947
|
if (E) {
|
|
3948
3948
|
let U = !0, s = M + DG + E;
|
|
3949
3949
|
E.startsWith("blob:") || E.startsWith("data:") ? (s = E, U = !1) : E.startsWith("http") && (s = E, U = !0);
|
|
3950
|
-
const m = H.cacheKey?.length ? `${H.cacheKey}-${s}` : s,
|
|
3951
|
-
if (
|
|
3952
|
-
f && console.log("[MaterialX] Use cached texture: ", m,
|
|
3950
|
+
const m = H.cacheKey?.length ? `${H.cacheKey}-${s}` : s, AA = U ? hG(m) : null;
|
|
3951
|
+
if (AA)
|
|
3952
|
+
f && console.log("[MaterialX] Use cached texture: ", m, AA), AA instanceof Promise ? AA.then((O) => {
|
|
3953
3953
|
O ? F.value = O : console.warn(`[MaterialX] Failed to load texture ${R} '${s}'`);
|
|
3954
|
-
}) : F.value =
|
|
3954
|
+
}) : F.value = AA;
|
|
3955
3955
|
else {
|
|
3956
3956
|
f && console.log("[MaterialX] Load texture:", s), R.toLowerCase().includes("normal") ? F.value = /** @type {any} */
|
|
3957
3957
|
OI : F.value = /** @type {any} */
|
|
3958
3958
|
fI;
|
|
3959
|
-
const O = F.value,
|
|
3960
|
-
U && oG(m,
|
|
3959
|
+
const O = F.value, IA = H.getTexture(s)?.then((v) => (v && (v = v.clone(), v.colorSpace = vE, wG(v, R, l)), v)).catch((v) => (console.error(`[MaterialX] Failed to load texture ${R} '${s}'`, v), O));
|
|
3960
|
+
U && oG(m, IA), IA?.then((v) => {
|
|
3961
3961
|
v ? F.value = /** @type {any} */
|
|
3962
3962
|
v : console.warn(`[MaterialX] Failed to load texture ${R} '${s}'`);
|
|
3963
3963
|
});
|
|
@@ -4041,8 +4041,8 @@ async function aG(l, w) {
|
|
|
4041
4041
|
for (let s of U) {
|
|
4042
4042
|
const m = s.getNodeDef();
|
|
4043
4043
|
if (f && console.log("Default light node definition", m), !m) continue;
|
|
4044
|
-
const
|
|
4045
|
-
f && console.log("Registering default light", { lightName:
|
|
4044
|
+
const AA = m.getName();
|
|
4045
|
+
f && console.log("Registering default light", { lightName: AA, lightDef: m }), xA[AA] || (f && console.log("Bind light shader for node", { lightName: AA, lightId: R, lightDef: m }), xA[AA] = R, l.HwShaderGenerator.bindLightShader(m, R++, w));
|
|
4046
4046
|
}
|
|
4047
4047
|
f && console.log("Light types bound in MaterialX context", xA);
|
|
4048
4048
|
}
|
|
@@ -4070,8 +4070,8 @@ function NG(l, w) {
|
|
|
4070
4070
|
const x = M.getWorldPosition(new hI()), U = M.getWorldQuaternion(new tE()), s = new hI(0, 0, -1).applyQuaternion(U), m = (
|
|
4071
4071
|
/** @type {THREE.SpotLight} */
|
|
4072
4072
|
M.angle
|
|
4073
|
-
),
|
|
4074
|
-
M.penumbra), O = Math.cos(
|
|
4073
|
+
), AA = m * (1 - /** @type {THREE.SpotLight} */
|
|
4074
|
+
M.penumbra), O = Math.cos(AA), IA = Math.cos(m);
|
|
4075
4075
|
E.push({
|
|
4076
4076
|
type: xA[F],
|
|
4077
4077
|
position: x.clone(),
|
|
@@ -4085,7 +4085,7 @@ function NG(l, w) {
|
|
|
4085
4085
|
decay_rate: 2,
|
|
4086
4086
|
// Approximations for testing – the relevant light has 61.57986...129.4445 as inner/outer spot angle
|
|
4087
4087
|
inner_angle: O,
|
|
4088
|
-
outer_angle:
|
|
4088
|
+
outer_angle: IA
|
|
4089
4089
|
});
|
|
4090
4090
|
}
|
|
4091
4091
|
const H = E.length;
|
|
@@ -4110,12 +4110,12 @@ function kB(l, w, E) {
|
|
|
4110
4110
|
for (const [M, F] of Object.entries(H))
|
|
4111
4111
|
if (M !== "LightData" && !F.empty())
|
|
4112
4112
|
for (let x = 0; x < F.size(); ++x) {
|
|
4113
|
-
const U = F.get(x), s = U.getValue()?.getData(), m = U.getVariable(),
|
|
4114
|
-
R[m] = YG(F,
|
|
4113
|
+
const U = F.get(x), s = U.getValue()?.getData(), m = U.getVariable(), AA = U.getType().getName();
|
|
4114
|
+
R[m] = YG(F, AA, s, m, w, E), f && console.log("Adding uniform", { path: U.getPath(), type: AA, name: m, value: R[m] });
|
|
4115
4115
|
}
|
|
4116
4116
|
return R;
|
|
4117
4117
|
}
|
|
4118
|
-
function
|
|
4118
|
+
function jI(l, w) {
|
|
4119
4119
|
const E = w.getUniformBlocks();
|
|
4120
4120
|
for (const [R, H] of Object.entries(E))
|
|
4121
4121
|
if (R !== "LightData" && !H.empty())
|
|
@@ -4356,7 +4356,7 @@ class JB extends RB {
|
|
|
4356
4356
|
* @returns {this}
|
|
4357
4357
|
*/
|
|
4358
4358
|
copy(w) {
|
|
4359
|
-
return super.copy(w), this._context = w._context, this._shader = w._shader, this.uniforms = _E(w.uniforms), this.uniformsGroups = $E(w.uniformsGroups), this.envMapIntensity = w.envMapIntensity, this.envMap = w.envMap,
|
|
4359
|
+
return super.copy(w), this._context = w._context, this._shader = w._shader, this.uniforms = _E(w.uniforms), this.uniformsGroups = $E(w.uniformsGroups), this.envMapIntensity = w.envMapIntensity, this.envMap = w.envMap, jI(this, this._shader.getStage("pixel")), jI(this, this._shader.getStage("vertex")), this.needsUpdate = !0, this;
|
|
4360
4360
|
}
|
|
4361
4361
|
/** @type {import('./materialx.js').MaterialXContext | null} */
|
|
4362
4362
|
_context = null;
|
|
@@ -4382,11 +4382,11 @@ class JB extends RB {
|
|
|
4382
4382
|
E = E.replace(/in\s+vec3\s+uv1;/g, "");
|
|
4383
4383
|
var m = E.includes("in vec3 uv2;");
|
|
4384
4384
|
E = E.replace(/in\s+vec3\s+uv2;/g, "");
|
|
4385
|
-
var
|
|
4385
|
+
var AA = E.includes("in vec3 uv3;");
|
|
4386
4386
|
E = E.replace(/in\s+vec3\s+uv3;/g, "");
|
|
4387
4387
|
var O = E.includes("in vec4 tangent;");
|
|
4388
4388
|
E = E.replace(/in\s+vec4\s+tangent;/g, "");
|
|
4389
|
-
var
|
|
4389
|
+
var IA = E.includes("in vec4 color;");
|
|
4390
4390
|
E = E.replace(/in\s+vec4\s+color;/g, ""), M || (E = E.replace(/texcoord_0 = uv;/g, "texcoord_0 = vec3(uv, 0.0);")), F || (E = E.replace(/texcoord_1 = uv1;/g, "texcoord_1 = vec3(uv1, 0.0);")), x || (E = E.replace(/texcoord_2 = uv2;/g, "texcoord_2 = vec3(uv2, 0.0);")), U || (E = E.replace(/texcoord_3 = uv3;/g, "texcoord_3 = vec3(uv3, 0.0);")), R = R.replace(
|
|
4391
4391
|
/result\.direction\s*=\s*light\.position\s*-\s*position;/g,
|
|
4392
4392
|
"result.direction = (light.position - position) * 10.0 / 1.0;"
|
|
@@ -4399,7 +4399,7 @@ class JB extends RB {
|
|
|
4399
4399
|
#include <tonemapping_fragment>
|
|
4400
4400
|
#include <colorspace_fragment>`);
|
|
4401
4401
|
const v = {};
|
|
4402
|
-
s && (v.USE_UV1 = ""), m && (v.USE_UV2 = ""),
|
|
4402
|
+
s && (v.USE_UV1 = ""), m && (v.USE_UV2 = ""), AA && (v.USE_UV3 = ""), O && (v.USE_TANGENT = ""), IA && (v.USE_COLOR = "");
|
|
4403
4403
|
const hA = "", UA = w.parameters?.transparent ?? !1;
|
|
4404
4404
|
super({
|
|
4405
4405
|
name: w.name,
|
|
@@ -4415,13 +4415,13 @@ class JB extends RB {
|
|
|
4415
4415
|
}), this.shaderName = w.shaderName || null, this._context = w.context, this._shader = w.shader, this._needsTangents = E.includes("in vec4 tangent;") || E.includes("in vec3 tangent;"), Object.assign(this.uniforms, {
|
|
4416
4416
|
...kB(w.shader.getStage("vertex"), w.loaders, hA),
|
|
4417
4417
|
...kB(w.shader.getStage("pixel"), w.loaders, hA),
|
|
4418
|
-
u_worldMatrix: { value: new
|
|
4419
|
-
u_viewProjectionMatrix: { value: new
|
|
4418
|
+
u_worldMatrix: { value: new xI() },
|
|
4419
|
+
u_viewProjectionMatrix: { value: new xI() },
|
|
4420
4420
|
u_viewPosition: { value: new hI() },
|
|
4421
|
-
u_worldInverseTransposeMatrix: { value: new
|
|
4421
|
+
u_worldInverseTransposeMatrix: { value: new xI() },
|
|
4422
4422
|
// u_shadowMatrix: { value: new Matrix4() },
|
|
4423
4423
|
// u_shadowMap: { value: null, type: 't' }, // Shadow map
|
|
4424
|
-
u_envMatrix: { value: new
|
|
4424
|
+
u_envMatrix: { value: new xI() },
|
|
4425
4425
|
u_envRadiance: { value: null, type: "t" },
|
|
4426
4426
|
u_envRadianceMips: { value: 8, type: "i" },
|
|
4427
4427
|
// TODO we need to figure out how we can set a PMREM here... doing many texture samples is prohibitively expensive
|
|
@@ -4431,7 +4431,7 @@ class JB extends RB {
|
|
|
4431
4431
|
u_numActiveLightSources: { value: 0 },
|
|
4432
4432
|
u_lightData: { value: [], needsUpdate: !1 }
|
|
4433
4433
|
// Array of light data. We need to set needsUpdate to false until we actually update it
|
|
4434
|
-
}),
|
|
4434
|
+
}), jI(this, w.shader.getStage("pixel")), jI(this, w.shader.getStage("vertex")), (f || w.debug) && (console.group("[MaterialX]: ", this.name), console.log(`Vertex shader length: ${E.length}
|
|
4435
4435
|
`, E), console.log(`Fragment shader length: ${R.length}
|
|
4436
4436
|
`, R), console.groupEnd());
|
|
4437
4437
|
}
|
|
@@ -4539,11 +4539,11 @@ class FG {
|
|
|
4539
4539
|
getTexture: async (s) => {
|
|
4540
4540
|
const m = s.split("/").pop()?.split(".").shift() || "";
|
|
4541
4541
|
if (M) {
|
|
4542
|
-
const
|
|
4542
|
+
const AA = M.textures || [];
|
|
4543
4543
|
let O = -1;
|
|
4544
|
-
for (const
|
|
4545
|
-
if (
|
|
4546
|
-
const v =
|
|
4544
|
+
for (const IA of AA)
|
|
4545
|
+
if (IA.name === m) {
|
|
4546
|
+
const v = IA.pointer, hA = v.substring(10);
|
|
4547
4547
|
if (O = parseInt(hA), isNaN(O) || O < 0) {
|
|
4548
4548
|
console.error("[MaterialX] Invalid texture index in pointer:", v);
|
|
4549
4549
|
return;
|
|
@@ -4560,7 +4560,7 @@ class FG {
|
|
|
4560
4560
|
}
|
|
4561
4561
|
}, U, this.context).then((s) => (s instanceof JB && this._generatedMaterials.push(s), s));
|
|
4562
4562
|
}
|
|
4563
|
-
const x = new
|
|
4563
|
+
const x = new uI();
|
|
4564
4564
|
return x.name = "MaterialX_Fallback", x;
|
|
4565
4565
|
}
|
|
4566
4566
|
}
|
|
@@ -4579,42 +4579,36 @@ async function MB(l, w, E, R, H) {
|
|
|
4579
4579
|
const M = await bG(l);
|
|
4580
4580
|
if (!e.materialXModule || !e.materialXGenerator || !e.materialXGenContext) {
|
|
4581
4581
|
console.warn("[MaterialX] WASM module not ready, returning fallback material");
|
|
4582
|
-
const
|
|
4583
|
-
return
|
|
4582
|
+
const IA = new uI();
|
|
4583
|
+
return IA.name = `MaterialX_Fallback_${w}`, IA;
|
|
4584
4584
|
}
|
|
4585
4585
|
let F = null, x = !1;
|
|
4586
4586
|
f && console.log("[MaterialX] document", M);
|
|
4587
4587
|
const U = M.getMaterialNodes();
|
|
4588
4588
|
f && console.log(`[MaterialX] Found ${U.length} material nodes in document`, U);
|
|
4589
|
-
for (let
|
|
4590
|
-
const v = U[
|
|
4589
|
+
for (let IA = 0; IA < U.length; ++IA) {
|
|
4590
|
+
const v = U[IA];
|
|
4591
4591
|
if (v) {
|
|
4592
4592
|
const hA = v.getNamePath();
|
|
4593
|
-
if (f && console.log(`[MaterialX] Scan material[${
|
|
4593
|
+
if (f && console.log(`[MaterialX] Scan material[${IA}]: ${hA}`), U.length === 1 || hA == w || IA === w) {
|
|
4594
4594
|
w = hA, F = v, x = !0, f && console.log(`[MaterialX] Use material node: '${hA}'`);
|
|
4595
4595
|
break;
|
|
4596
4596
|
}
|
|
4597
4597
|
}
|
|
4598
4598
|
}
|
|
4599
|
-
if (F) {
|
|
4600
|
-
|
|
4601
|
-
|
|
4602
|
-
|
|
4603
|
-
return r.color.set(16711935), r.name = `MaterialX_NodeNotFound_${w}`, r;
|
|
4604
|
-
}
|
|
4605
|
-
} else {
|
|
4606
|
-
console.warn(`[MaterialX] No renderable element found in MaterialX document (${w}) → Please provide a name or index. Options: ${U.map((v) => v.getNamePath()).join(", ")}`);
|
|
4607
|
-
const r = new oI();
|
|
4608
|
-
return r.color.set(16711935), r.name = `MaterialX_NoRenderable_${w}`, r;
|
|
4599
|
+
if (!F) {
|
|
4600
|
+
U.length <= 0 ? console.warn("[MaterialX] No material nodes found in MaterialX document.") : console.warn(`[MaterialX] No renderable element found in MaterialX document (${w}) → Please provide a name or index. ${U.length} options: ${U.map((v) => v.getNamePath()).join(", ")}`);
|
|
4601
|
+
const IA = new uI();
|
|
4602
|
+
return IA.color.set(16711935), IA.name = `MaterialX_NoRenderable_${w}`, IA;
|
|
4609
4603
|
}
|
|
4610
4604
|
f && console.log("[MaterialX] Using renderable element for shader generation");
|
|
4611
4605
|
const s = e.materialXModule.isTransparentSurface(F, e.materialXGenerator.getTarget());
|
|
4612
4606
|
e.materialXGenContext.getOptions().hwTransparency = s, f && console.log("[MaterialX] Generating MaterialX shaders...");
|
|
4613
|
-
const m = F.getNamePath ? F.getNamePath() : F.getName(),
|
|
4607
|
+
const m = F.getNamePath ? F.getNamePath() : F.getName(), AA = e.materialXGenerator.generate(m, F, e.materialXGenContext), O = new JB({
|
|
4614
4608
|
name: w,
|
|
4615
4609
|
shaderName: null,
|
|
4616
4610
|
//shaderInfo?.originalName || shaderInfo?.name || null,
|
|
4617
|
-
shader:
|
|
4611
|
+
shader: AA,
|
|
4618
4612
|
context: H || {},
|
|
4619
4613
|
parameters: {
|
|
4620
4614
|
transparent: s,
|
|
@@ -4625,7 +4619,7 @@ async function MB(l, w, E, R, H) {
|
|
|
4625
4619
|
return f && console.log("[MaterialX] material created:", O.name), O;
|
|
4626
4620
|
} catch (M) {
|
|
4627
4621
|
console.error(`[MaterialX] Error creating MaterialX material (${w}):`, M);
|
|
4628
|
-
const F = new
|
|
4622
|
+
const F = new uI();
|
|
4629
4623
|
return F.color.set(16711935), F.name = `MaterialX_Error_${w}`, F;
|
|
4630
4624
|
}
|
|
4631
4625
|
}
|