@idetik/core 0.29.1 → 0.31.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/assets/worker_kernel-CBlE4MBI.js.map +1 -1
- package/dist/index.d.ts +5 -0
- package/dist/index.js +647 -633
- package/dist/index.js.map +1 -1
- package/dist/index.umd.cjs +24 -24
- package/dist/index.umd.cjs.map +1 -1
- package/dist/types/src/data/chunk.d.ts +1 -0
- package/dist/types/src/data/chunk.d.ts.map +1 -1
- package/dist/types/src/data/chunk_manager.d.ts +4 -0
- package/dist/types/src/data/chunk_manager.d.ts.map +1 -1
- package/dist/types/src/data/chunk_store.d.ts.map +1 -1
- package/dist/types/src/data/chunk_store_view.d.ts.map +1 -1
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -102,7 +102,7 @@ class FQ {
|
|
|
102
102
|
this.backgroundColor_ = X.from(A);
|
|
103
103
|
}
|
|
104
104
|
}
|
|
105
|
-
var
|
|
105
|
+
var dE = `#version 300 es
|
|
106
106
|
|
|
107
107
|
layout (location = 0) in vec3 a_position;
|
|
108
108
|
layout (location = 3) in vec3 a_prevPosition;
|
|
@@ -162,7 +162,7 @@ void main() {
|
|
|
162
162
|
|
|
163
163
|
|
|
164
164
|
gl_PointSize = 5.0;
|
|
165
|
-
}`,
|
|
165
|
+
}`, UE = `#version 300 es
|
|
166
166
|
|
|
167
167
|
precision mediump float;
|
|
168
168
|
|
|
@@ -173,7 +173,7 @@ uniform float u_opacity;
|
|
|
173
173
|
|
|
174
174
|
void main() {
|
|
175
175
|
fragColor = vec4(u_lineColor, u_opacity);
|
|
176
|
-
}`,
|
|
176
|
+
}`, XI = `#version 300 es
|
|
177
177
|
|
|
178
178
|
layout (location = 0) in vec3 a_position;
|
|
179
179
|
layout (location = 1) in vec3 a_normal;
|
|
@@ -187,7 +187,7 @@ out vec2 v_texCoords;
|
|
|
187
187
|
void main() {
|
|
188
188
|
v_texCoords = a_uv;
|
|
189
189
|
gl_Position = u_projection * u_modelView * vec4(a_position, 1.0);
|
|
190
|
-
}`,
|
|
190
|
+
}`, Mg = `#version 300 es
|
|
191
191
|
#pragma inject_defines
|
|
192
192
|
|
|
193
193
|
precision mediump float;
|
|
@@ -275,7 +275,7 @@ uniform vec3 u_color;
|
|
|
275
275
|
|
|
276
276
|
void main() {
|
|
277
277
|
fragColor = vec4(u_color, u_opacity);
|
|
278
|
-
}`,
|
|
278
|
+
}`, ug = `#version 300 es
|
|
279
279
|
|
|
280
280
|
precision highp float;
|
|
281
281
|
|
|
@@ -288,7 +288,7 @@ out highp vec3 v_positionModel;
|
|
|
288
288
|
void main() {
|
|
289
289
|
v_positionModel = a_position;
|
|
290
290
|
gl_Position = u_projection * u_modelView * vec4(a_position, 1.0);
|
|
291
|
-
}`,
|
|
291
|
+
}`, fg = `#version 300 es
|
|
292
292
|
#pragma inject_defines
|
|
293
293
|
precision highp float;
|
|
294
294
|
|
|
@@ -523,8 +523,8 @@ void main() {
|
|
|
523
523
|
}`;
|
|
524
524
|
const uE = {
|
|
525
525
|
projectedLine: {
|
|
526
|
-
vertex:
|
|
527
|
-
fragment:
|
|
526
|
+
vertex: dE,
|
|
527
|
+
fragment: UE
|
|
528
528
|
},
|
|
529
529
|
points: {
|
|
530
530
|
vertex: lE,
|
|
@@ -535,35 +535,35 @@ const uE = {
|
|
|
535
535
|
fragment: YE
|
|
536
536
|
},
|
|
537
537
|
floatScalarImage: {
|
|
538
|
-
vertex:
|
|
539
|
-
fragment:
|
|
538
|
+
vertex: XI,
|
|
539
|
+
fragment: Mg
|
|
540
540
|
},
|
|
541
541
|
intScalarImage: {
|
|
542
|
-
vertex:
|
|
543
|
-
fragment:
|
|
542
|
+
vertex: XI,
|
|
543
|
+
fragment: Mg,
|
|
544
544
|
fragmentDefines: /* @__PURE__ */ new Map([["TEXTURE_DATA_TYPE_INT", "1"]])
|
|
545
545
|
},
|
|
546
546
|
uintScalarImage: {
|
|
547
|
-
vertex:
|
|
548
|
-
fragment:
|
|
547
|
+
vertex: XI,
|
|
548
|
+
fragment: Mg,
|
|
549
549
|
fragmentDefines: /* @__PURE__ */ new Map([["TEXTURE_DATA_TYPE_UINT", "1"]])
|
|
550
550
|
},
|
|
551
551
|
labelImage: {
|
|
552
|
-
vertex:
|
|
552
|
+
vertex: XI,
|
|
553
553
|
fragment: ME
|
|
554
554
|
},
|
|
555
555
|
floatVolume: {
|
|
556
|
-
vertex:
|
|
557
|
-
fragment:
|
|
556
|
+
vertex: ug,
|
|
557
|
+
fragment: fg
|
|
558
558
|
},
|
|
559
559
|
intVolume: {
|
|
560
|
-
vertex:
|
|
561
|
-
fragment:
|
|
560
|
+
vertex: ug,
|
|
561
|
+
fragment: fg,
|
|
562
562
|
fragmentDefines: /* @__PURE__ */ new Map([["TEXTURE_DATA_TYPE_INT", "1"]])
|
|
563
563
|
},
|
|
564
564
|
uintVolume: {
|
|
565
|
-
vertex:
|
|
566
|
-
fragment:
|
|
565
|
+
vertex: ug,
|
|
566
|
+
fragment: fg,
|
|
567
567
|
fragmentDefines: /* @__PURE__ */ new Map([["TEXTURE_DATA_TYPE_UINT", "1"]])
|
|
568
568
|
}
|
|
569
569
|
}, EC = {
|
|
@@ -778,7 +778,7 @@ const qE = typeof window < "u" ? [
|
|
|
778
778
|
WebGL2RenderingContext.UNSIGNED_INT_SAMPLER_2D_ARRAY
|
|
779
779
|
] : [], pE = new Set(
|
|
780
780
|
qE
|
|
781
|
-
),
|
|
781
|
+
), Kg = "#pragma inject_defines";
|
|
782
782
|
class mE {
|
|
783
783
|
gl_;
|
|
784
784
|
programs_ = /* @__PURE__ */ new Map();
|
|
@@ -811,19 +811,19 @@ class mE {
|
|
|
811
811
|
}
|
|
812
812
|
function iC(C, A) {
|
|
813
813
|
if (A === void 0 || A.size == 0) return C;
|
|
814
|
-
if (!C.includes(
|
|
814
|
+
if (!C.includes(Kg))
|
|
815
815
|
throw new Error(
|
|
816
|
-
`Shader source does not contain "${
|
|
816
|
+
`Shader source does not contain "${Kg}" directive`
|
|
817
817
|
);
|
|
818
818
|
const I = Array.from(A.entries()).map(([E, i]) => `#define ${E} ${i}`).join(`
|
|
819
819
|
`), B = `#line __LINE__ + ${1 - A.size}`, Q = `${I}
|
|
820
820
|
${B}`;
|
|
821
|
-
return C.replace(
|
|
821
|
+
return C.replace(Kg, Q);
|
|
822
822
|
}
|
|
823
|
-
const
|
|
823
|
+
const jI = {};
|
|
824
824
|
function SQ(C) {
|
|
825
825
|
const A = C ?? "";
|
|
826
|
-
return
|
|
826
|
+
return jI[A] = (jI[A] ?? 0) + 1, C ? `${C}-${jI[A]}` : String(jI[A]);
|
|
827
827
|
}
|
|
828
828
|
class GB {
|
|
829
829
|
id = SQ();
|
|
@@ -843,24 +843,24 @@ function SA() {
|
|
|
843
843
|
var C = new DA(16);
|
|
844
844
|
return DA != Float32Array && (C[1] = 0, C[2] = 0, C[3] = 0, C[4] = 0, C[6] = 0, C[7] = 0, C[8] = 0, C[9] = 0, C[11] = 0, C[12] = 0, C[13] = 0, C[14] = 0), C[0] = 1, C[5] = 1, C[10] = 1, C[15] = 1, C;
|
|
845
845
|
}
|
|
846
|
-
function WE(C, A, I, g, B, Q, E, i, o, s, t, e, n, D, F,
|
|
846
|
+
function WE(C, A, I, g, B, Q, E, i, o, s, t, e, n, D, F, k) {
|
|
847
847
|
var S = new DA(16);
|
|
848
|
-
return S[0] = C, S[1] = A, S[2] = I, S[3] = g, S[4] = B, S[5] = Q, S[6] = E, S[7] = i, S[8] = o, S[9] = s, S[10] = t, S[11] = e, S[12] = n, S[13] = D, S[14] = F, S[15] =
|
|
848
|
+
return S[0] = C, S[1] = A, S[2] = I, S[3] = g, S[4] = B, S[5] = Q, S[6] = E, S[7] = i, S[8] = o, S[9] = s, S[10] = t, S[11] = e, S[12] = n, S[13] = D, S[14] = F, S[15] = k, S;
|
|
849
849
|
}
|
|
850
|
-
function
|
|
851
|
-
var I = A[0], g = A[1], B = A[2], Q = A[3], E = A[4], i = A[5], o = A[6], s = A[7], t = A[8], e = A[9], n = A[10], D = A[11], F = A[12],
|
|
852
|
-
return oA ? (oA = 1 / oA, C[0] = (i * fA - o * uA + s * iA) * oA, C[1] = (B * uA - g * fA - Q * iA) * oA, C[2] = (
|
|
850
|
+
function dg(C, A) {
|
|
851
|
+
var I = A[0], g = A[1], B = A[2], Q = A[3], E = A[4], i = A[5], o = A[6], s = A[7], t = A[8], e = A[9], n = A[10], D = A[11], F = A[12], k = A[13], S = A[14], l = A[15], f = I * i - g * E, d = I * o - B * E, R = I * s - Q * E, L = g * o - B * i, M = g * s - Q * i, W = B * s - Q * o, $ = t * k - e * F, BA = t * S - n * F, IA = t * l - D * F, iA = e * S - n * k, uA = e * l - D * k, fA = n * l - D * S, oA = f * fA - d * uA + R * iA + L * IA - M * BA + W * $;
|
|
852
|
+
return oA ? (oA = 1 / oA, C[0] = (i * fA - o * uA + s * iA) * oA, C[1] = (B * uA - g * fA - Q * iA) * oA, C[2] = (k * W - S * M + l * L) * oA, C[3] = (n * M - e * W - D * L) * oA, C[4] = (o * IA - E * fA - s * BA) * oA, C[5] = (I * fA - B * IA + Q * BA) * oA, C[6] = (S * R - F * W - l * d) * oA, C[7] = (t * W - n * R + D * d) * oA, C[8] = (E * uA - i * IA + s * $) * oA, C[9] = (g * IA - I * uA - Q * $) * oA, C[10] = (F * M - k * R + l * f) * oA, C[11] = (e * R - t * M - D * f) * oA, C[12] = (i * BA - E * iA - o * $) * oA, C[13] = (I * iA - g * BA + B * $) * oA, C[14] = (k * d - F * L - S * f) * oA, C[15] = (t * L - e * d + n * f) * oA, C) : null;
|
|
853
853
|
}
|
|
854
854
|
function eI(C, A, I) {
|
|
855
|
-
var g = A[0], B = A[1], Q = A[2], E = A[3], i = A[4], o = A[5], s = A[6], t = A[7], e = A[8], n = A[9], D = A[10], F = A[11],
|
|
856
|
-
return C[0] =
|
|
855
|
+
var g = A[0], B = A[1], Q = A[2], E = A[3], i = A[4], o = A[5], s = A[6], t = A[7], e = A[8], n = A[9], D = A[10], F = A[11], k = A[12], S = A[13], l = A[14], f = A[15], d = I[0], R = I[1], L = I[2], M = I[3];
|
|
856
|
+
return C[0] = d * g + R * i + L * e + M * k, C[1] = d * B + R * o + L * n + M * S, C[2] = d * Q + R * s + L * D + M * l, C[3] = d * E + R * t + L * F + M * f, d = I[4], R = I[5], L = I[6], M = I[7], C[4] = d * g + R * i + L * e + M * k, C[5] = d * B + R * o + L * n + M * S, C[6] = d * Q + R * s + L * D + M * l, C[7] = d * E + R * t + L * F + M * f, d = I[8], R = I[9], L = I[10], M = I[11], C[8] = d * g + R * i + L * e + M * k, C[9] = d * B + R * o + L * n + M * S, C[10] = d * Q + R * s + L * D + M * l, C[11] = d * E + R * t + L * F + M * f, d = I[12], R = I[13], L = I[14], M = I[15], C[12] = d * g + R * i + L * e + M * k, C[13] = d * B + R * o + L * n + M * S, C[14] = d * Q + R * s + L * D + M * l, C[15] = d * E + R * t + L * F + M * f, C;
|
|
857
857
|
}
|
|
858
858
|
function vE(C, A) {
|
|
859
859
|
return C[0] = A[0], C[1] = 0, C[2] = 0, C[3] = 0, C[4] = 0, C[5] = A[1], C[6] = 0, C[7] = 0, C[8] = 0, C[9] = 0, C[10] = A[2], C[11] = 0, C[12] = 0, C[13] = 0, C[14] = 0, C[15] = 1, C;
|
|
860
860
|
}
|
|
861
861
|
function ZE(C, A, I, g) {
|
|
862
|
-
var B = A[0], Q = A[1], E = A[2], i = A[3], o = B + B, s = Q + Q, t = E + E, e = B * o, n = B * s, D = B * t, F = Q * s,
|
|
863
|
-
return C[0] = (1 - (F + S)) * R, C[1] = (n +
|
|
862
|
+
var B = A[0], Q = A[1], E = A[2], i = A[3], o = B + B, s = Q + Q, t = E + E, e = B * o, n = B * s, D = B * t, F = Q * s, k = Q * t, S = E * t, l = i * o, f = i * s, d = i * t, R = g[0], L = g[1], M = g[2];
|
|
863
|
+
return C[0] = (1 - (F + S)) * R, C[1] = (n + d) * R, C[2] = (D - f) * R, C[3] = 0, C[4] = (n - d) * L, C[5] = (1 - (e + S)) * L, C[6] = (k + l) * L, C[7] = 0, C[8] = (D + f) * M, C[9] = (k - l) * M, C[10] = (1 - (e + F)) * M, C[11] = 0, C[12] = I[0], C[13] = I[1], C[14] = I[2], C[15] = 1, C;
|
|
864
864
|
}
|
|
865
865
|
function PE(C, A, I, g, B) {
|
|
866
866
|
var Q = 1 / Math.tan(A / 2);
|
|
@@ -880,12 +880,12 @@ var _E = VE;
|
|
|
880
880
|
function XE(C, A, I, g) {
|
|
881
881
|
var B = A[0], Q = A[1], E = A[2], i = g[0], o = g[1], s = g[2], t = B - I[0], e = Q - I[1], n = E - I[2], D = t * t + e * e + n * n;
|
|
882
882
|
D > 0 && (D = 1 / Math.sqrt(D), t *= D, e *= D, n *= D);
|
|
883
|
-
var F = o * n - s * e,
|
|
884
|
-
return D = F * F +
|
|
883
|
+
var F = o * n - s * e, k = s * t - i * n, S = i * e - o * t;
|
|
884
|
+
return D = F * F + k * k + S * S, D > 0 && (D = 1 / Math.sqrt(D), F *= D, k *= D, S *= D), C[0] = F, C[1] = k, C[2] = S, C[3] = 0, C[4] = e * S - n * k, C[5] = n * F - t * S, C[6] = t * k - e * F, C[7] = 0, C[8] = t, C[9] = e, C[10] = n, C[11] = 0, C[12] = B, C[13] = Q, C[14] = E, C[15] = 1, C;
|
|
885
885
|
}
|
|
886
886
|
function jE(C, A) {
|
|
887
|
-
var I = C[0], g = C[1], B = C[2], Q = C[3], E = C[4], i = C[5], o = C[6], s = C[7], t = C[8], e = C[9], n = C[10], D = C[11], F = C[12],
|
|
888
|
-
return Math.abs(I - f) <= AA * Math.max(1, Math.abs(I), Math.abs(f)) && Math.abs(g -
|
|
887
|
+
var I = C[0], g = C[1], B = C[2], Q = C[3], E = C[4], i = C[5], o = C[6], s = C[7], t = C[8], e = C[9], n = C[10], D = C[11], F = C[12], k = C[13], S = C[14], l = C[15], f = A[0], d = A[1], R = A[2], L = A[3], M = A[4], W = A[5], $ = A[6], BA = A[7], IA = A[8], iA = A[9], uA = A[10], fA = A[11], oA = A[12], BC = A[13], CC = A[14], QC = A[15];
|
|
888
|
+
return Math.abs(I - f) <= AA * Math.max(1, Math.abs(I), Math.abs(f)) && Math.abs(g - d) <= AA * Math.max(1, Math.abs(g), Math.abs(d)) && Math.abs(B - R) <= AA * Math.max(1, Math.abs(B), Math.abs(R)) && Math.abs(Q - L) <= AA * Math.max(1, Math.abs(Q), Math.abs(L)) && Math.abs(E - M) <= AA * Math.max(1, Math.abs(E), Math.abs(M)) && Math.abs(i - W) <= AA * Math.max(1, Math.abs(i), Math.abs(W)) && Math.abs(o - $) <= AA * Math.max(1, Math.abs(o), Math.abs($)) && Math.abs(s - BA) <= AA * Math.max(1, Math.abs(s), Math.abs(BA)) && Math.abs(t - IA) <= AA * Math.max(1, Math.abs(t), Math.abs(IA)) && Math.abs(e - iA) <= AA * Math.max(1, Math.abs(e), Math.abs(iA)) && Math.abs(n - uA) <= AA * Math.max(1, Math.abs(n), Math.abs(uA)) && Math.abs(D - fA) <= AA * Math.max(1, Math.abs(D), Math.abs(fA)) && Math.abs(F - oA) <= AA * Math.max(1, Math.abs(F), Math.abs(oA)) && Math.abs(k - BC) <= AA * Math.max(1, Math.abs(k), Math.abs(BC)) && Math.abs(S - CC) <= AA * Math.max(1, Math.abs(S), Math.abs(CC)) && Math.abs(l - QC) <= AA * Math.max(1, Math.abs(l), Math.abs(QC));
|
|
889
889
|
}
|
|
890
890
|
function QA() {
|
|
891
891
|
var C = new DA(3);
|
|
@@ -903,13 +903,13 @@ function P(C, A, I) {
|
|
|
903
903
|
var g = new DA(3);
|
|
904
904
|
return g[0] = C, g[1] = A, g[2] = I, g;
|
|
905
905
|
}
|
|
906
|
-
function
|
|
906
|
+
function $g(C, A) {
|
|
907
907
|
return C[0] = A[0], C[1] = A[1], C[2] = A[2], C;
|
|
908
908
|
}
|
|
909
909
|
function $A(C, A, I, g) {
|
|
910
910
|
return C[0] = A, C[1] = I, C[2] = g, C;
|
|
911
911
|
}
|
|
912
|
-
function
|
|
912
|
+
function HI(C, A, I) {
|
|
913
913
|
return C[0] = A[0] + I[0], C[1] = A[1] + I[1], C[2] = A[2] + I[2], C;
|
|
914
914
|
}
|
|
915
915
|
function zE(C, A, I) {
|
|
@@ -918,7 +918,7 @@ function zE(C, A, I) {
|
|
|
918
918
|
function $E(C, A, I) {
|
|
919
919
|
return C[0] = A[0] * I[0], C[1] = A[1] * I[1], C[2] = A[2] * I[2], C;
|
|
920
920
|
}
|
|
921
|
-
function
|
|
921
|
+
function qI(C, A, I) {
|
|
922
922
|
return C[0] = A[0] * I, C[1] = A[1] * I, C[2] = A[2] * I, C;
|
|
923
923
|
}
|
|
924
924
|
function oC(C, A, I, g) {
|
|
@@ -935,7 +935,7 @@ function Ai(C, A) {
|
|
|
935
935
|
function RQ(C, A) {
|
|
936
936
|
return C[0] * A[0] + C[1] * A[1] + C[2] * A[2];
|
|
937
937
|
}
|
|
938
|
-
function
|
|
938
|
+
function Hg(C, A, I) {
|
|
939
939
|
var g = A[0], B = A[1], Q = A[2], E = I[0], i = I[1], o = I[2];
|
|
940
940
|
return C[0] = B * o - Q * i, C[1] = Q * E - g * o, C[2] = g * i - B * E, C;
|
|
941
941
|
}
|
|
@@ -950,7 +950,7 @@ function NB(C, A) {
|
|
|
950
950
|
var I = C[0], g = C[1], B = C[2], Q = A[0], E = A[1], i = A[2];
|
|
951
951
|
return Math.abs(I - Q) <= AA * Math.max(1, Math.abs(I), Math.abs(Q)) && Math.abs(g - E) <= AA * Math.max(1, Math.abs(g), Math.abs(E)) && Math.abs(B - i) <= AA * Math.max(1, Math.abs(B), Math.abs(i));
|
|
952
952
|
}
|
|
953
|
-
var
|
|
953
|
+
var AB = zE, gi = FB;
|
|
954
954
|
(function() {
|
|
955
955
|
var C = QA();
|
|
956
956
|
return function(A, I, g, B, Q, E) {
|
|
@@ -968,7 +968,7 @@ function Bi(C) {
|
|
|
968
968
|
var A = new DA(4);
|
|
969
969
|
return A[0] = C[0], A[1] = C[1], A[2] = C[2], A[3] = C[3], A;
|
|
970
970
|
}
|
|
971
|
-
function
|
|
971
|
+
function Qg(C, A, I, g) {
|
|
972
972
|
var B = new DA(4);
|
|
973
973
|
return B[0] = C, B[1] = A, B[2] = I, B[3] = g, B;
|
|
974
974
|
}
|
|
@@ -982,7 +982,7 @@ function Ei(C, A) {
|
|
|
982
982
|
var I = A[0], g = A[1], B = A[2], Q = A[3], E = I * I + g * g + B * B + Q * Q;
|
|
983
983
|
return E > 0 && (E = 1 / Math.sqrt(E)), C[0] = I * E, C[1] = g * E, C[2] = B * E, C[3] = Q * E, C;
|
|
984
984
|
}
|
|
985
|
-
function
|
|
985
|
+
function pI(C, A, I) {
|
|
986
986
|
var g = A[0], B = A[1], Q = A[2], E = A[3];
|
|
987
987
|
return C[0] = I[0] * g + I[4] * B + I[8] * Q + I[12] * E, C[1] = I[1] * g + I[5] * B + I[9] * Q + I[13] * E, C[2] = I[2] * g + I[6] * B + I[10] * Q + I[14] * E, C[3] = I[3] * g + I[7] * B + I[11] * Q + I[15] * E, C;
|
|
988
988
|
}
|
|
@@ -995,7 +995,7 @@ function qI(C, A, I) {
|
|
|
995
995
|
return A;
|
|
996
996
|
};
|
|
997
997
|
})();
|
|
998
|
-
function
|
|
998
|
+
function IB() {
|
|
999
999
|
var C = new DA(4);
|
|
1000
1000
|
return DA != Float32Array && (C[0] = 0, C[1] = 0, C[2] = 0), C[3] = 1, C;
|
|
1001
1001
|
}
|
|
@@ -1008,9 +1008,9 @@ function oi(C, A, I) {
|
|
|
1008
1008
|
var g = A[0], B = A[1], Q = A[2], E = A[3], i = I[0], o = I[1], s = I[2], t = I[3];
|
|
1009
1009
|
return C[0] = g * t + E * i + B * s - Q * o, C[1] = B * t + E * o + Q * i - g * s, C[2] = Q * t + E * s + g * o - B * i, C[3] = E * t - g * i - B * o - Q * s, C;
|
|
1010
1010
|
}
|
|
1011
|
-
function
|
|
1012
|
-
var B = A[0], Q = A[1], E = A[2], i = A[3], o = I[0], s = I[1], t = I[2], e = I[3], n, D, F,
|
|
1013
|
-
return D = B * o + Q * s + E * t + i * e, D < 0 && (D = -D, o = -o, s = -s, t = -t, e = -e), 1 - D > AA ? (n = Math.acos(D), F = Math.sin(n),
|
|
1011
|
+
function qg(C, A, I, g) {
|
|
1012
|
+
var B = A[0], Q = A[1], E = A[2], i = A[3], o = I[0], s = I[1], t = I[2], e = I[3], n, D, F, k, S;
|
|
1013
|
+
return D = B * o + Q * s + E * t + i * e, D < 0 && (D = -D, o = -o, s = -s, t = -t, e = -e), 1 - D > AA ? (n = Math.acos(D), F = Math.sin(n), k = Math.sin((1 - g) * n) / F, S = Math.sin(g * n) / F) : (k = 1 - g, S = g), C[0] = k * B + S * o, C[1] = k * Q + S * s, C[2] = k * E + S * t, C[3] = k * i + S * e, C;
|
|
1014
1014
|
}
|
|
1015
1015
|
function kQ(C, A) {
|
|
1016
1016
|
var I = A[0] + A[4] + A[8], g;
|
|
@@ -1029,13 +1029,13 @@ var si = Bi, ti = Ci, RB = Ei;
|
|
|
1029
1029
|
var C = QA(), A = P(1, 0, 0), I = P(0, 1, 0);
|
|
1030
1030
|
return function(g, B, Q) {
|
|
1031
1031
|
var E = RQ(B, Q);
|
|
1032
|
-
return E < -0.999999 ? (
|
|
1032
|
+
return E < -0.999999 ? (Hg(C, A, B), gi(C) < 1e-6 && Hg(C, I, B), Ai(C, C), ii(g, C, Math.PI), g) : E > 0.999999 ? (g[0] = 0, g[1] = 0, g[2] = 0, g[3] = 1, g) : (Hg(C, B, Q), g[0] = C[0], g[1] = C[1], g[2] = C[2], g[3] = 1 + E, RB(g, g));
|
|
1033
1033
|
};
|
|
1034
1034
|
})();
|
|
1035
1035
|
(function() {
|
|
1036
|
-
var C =
|
|
1036
|
+
var C = IB(), A = IB();
|
|
1037
1037
|
return function(I, g, B, Q, E, i) {
|
|
1038
|
-
return
|
|
1038
|
+
return qg(C, g, E, i), qg(A, B, Q, i), qg(I, C, A, 2 * i * (1 - i)), I;
|
|
1039
1039
|
};
|
|
1040
1040
|
})();
|
|
1041
1041
|
(function() {
|
|
@@ -1044,7 +1044,7 @@ var si = Bi, ti = Ci, RB = Ei;
|
|
|
1044
1044
|
return C[0] = g[0], C[3] = g[1], C[6] = g[2], C[1] = B[0], C[4] = B[1], C[7] = B[2], C[2] = -I[0], C[5] = -I[1], C[8] = -I[2], RB(A, kQ(A, C));
|
|
1045
1045
|
};
|
|
1046
1046
|
})();
|
|
1047
|
-
function
|
|
1047
|
+
function dQ() {
|
|
1048
1048
|
var C = new DA(2);
|
|
1049
1049
|
return DA != Float32Array && (C[0] = 0, C[1] = 0), C;
|
|
1050
1050
|
}
|
|
@@ -1071,12 +1071,12 @@ function ni(C, A, I, g) {
|
|
|
1071
1071
|
function eC(C, A) {
|
|
1072
1072
|
return C[0] === A[0] && C[1] === A[1];
|
|
1073
1073
|
}
|
|
1074
|
-
function
|
|
1074
|
+
function pg(C, A) {
|
|
1075
1075
|
var I = C[0], g = C[1], B = A[0], Q = A[1];
|
|
1076
1076
|
return Math.abs(I - B) <= AA * Math.max(1, Math.abs(I), Math.abs(B)) && Math.abs(g - Q) <= AA * Math.max(1, Math.abs(g), Math.abs(Q));
|
|
1077
1077
|
}
|
|
1078
1078
|
(function() {
|
|
1079
|
-
var C =
|
|
1079
|
+
var C = dQ();
|
|
1080
1080
|
return function(A, I, g, B, Q, E) {
|
|
1081
1081
|
var i, o;
|
|
1082
1082
|
for (I || (I = 2), g || (g = 0), B ? o = Math.min(B * I + g, A.length) : o = A.length, i = g; i < o; i += I)
|
|
@@ -1126,7 +1126,7 @@ class AI {
|
|
|
1126
1126
|
SB(Q, E, A), this.expandWithPoint(Q);
|
|
1127
1127
|
}
|
|
1128
1128
|
}
|
|
1129
|
-
const
|
|
1129
|
+
const UQ = {
|
|
1130
1130
|
position: 0,
|
|
1131
1131
|
normal: 1,
|
|
1132
1132
|
uv: 2,
|
|
@@ -1225,7 +1225,7 @@ class ri {
|
|
|
1225
1225
|
this.gl_.bindBuffer(B, Q), this.gl_.bufferData(B, g, this.gl_.STATIC_DRAW);
|
|
1226
1226
|
const { attributes: E, strideBytes: i } = A;
|
|
1227
1227
|
E.forEach((t) => {
|
|
1228
|
-
const e =
|
|
1228
|
+
const e = UQ[t.type];
|
|
1229
1229
|
this.gl_.vertexAttribPointer(
|
|
1230
1230
|
e,
|
|
1231
1231
|
t.itemSize,
|
|
@@ -1288,7 +1288,7 @@ function LQ(C) {
|
|
|
1288
1288
|
return 4;
|
|
1289
1289
|
}
|
|
1290
1290
|
}
|
|
1291
|
-
function
|
|
1291
|
+
function mI(C) {
|
|
1292
1292
|
const A = lQ(C) * LQ(C), I = Math.max(1, C.mipmapLevels);
|
|
1293
1293
|
let g = Math.max(1, C.width), B = Math.max(1, C.height), Q = Math.max(1, C.depth), E = 0;
|
|
1294
1294
|
for (let i = 0; i < I; ++i)
|
|
@@ -1315,7 +1315,7 @@ function hi(C) {
|
|
|
1315
1315
|
return [0, 1];
|
|
1316
1316
|
}
|
|
1317
1317
|
}
|
|
1318
|
-
class
|
|
1318
|
+
class dB extends GB {
|
|
1319
1319
|
dataFormat = "rgba";
|
|
1320
1320
|
dataType = "unsigned_byte";
|
|
1321
1321
|
maxFilter = "nearest";
|
|
@@ -1424,7 +1424,7 @@ class yi {
|
|
|
1424
1424
|
const I = this.textures_.get(A);
|
|
1425
1425
|
if (I) {
|
|
1426
1426
|
this.gl_.deleteTexture(I), this.textures_.delete(A), A.readTexel = void 0, this.currentTexture_ === A && (this.currentTexture_ = null);
|
|
1427
|
-
const g =
|
|
1427
|
+
const g = mI(A);
|
|
1428
1428
|
this.gpuTextureBytes_ = Math.max(0, this.gpuTextureBytes_ - g), this.textureCount_ = Math.max(0, this.textureCount_ - 1);
|
|
1429
1429
|
}
|
|
1430
1430
|
}
|
|
@@ -1458,7 +1458,7 @@ class yi {
|
|
|
1458
1458
|
);
|
|
1459
1459
|
else
|
|
1460
1460
|
throw new Error(`Unknown texture type ${A.type}`);
|
|
1461
|
-
this.gpuTextureBytes_ +=
|
|
1461
|
+
this.gpuTextureBytes_ += mI(A), this.textureCount_ += 1, this.textures_.set(A, B), this.gl_.bindTexture(g, null), A.readTexel = (Q, E, i) => Promise.resolve(this.readTexel(A, Q, E, i));
|
|
1462
1462
|
}
|
|
1463
1463
|
configureTextureParameters(A, I) {
|
|
1464
1464
|
const g = this.gl_, B = this.getFilter(A.minFilter, A), Q = this.getFilter(A.maxFilter, A);
|
|
@@ -1871,10 +1871,10 @@ class aC extends FQ {
|
|
|
1871
1871
|
);
|
|
1872
1872
|
break;
|
|
1873
1873
|
case "u_cameraPositionModel": {
|
|
1874
|
-
const
|
|
1874
|
+
const k = dg(SA(), E), S = Qg(0, 0, 0, 1), l = pI(
|
|
1875
1875
|
nI(),
|
|
1876
1876
|
S,
|
|
1877
|
-
|
|
1877
|
+
k
|
|
1878
1878
|
);
|
|
1879
1879
|
B.setUniform(
|
|
1880
1880
|
F,
|
|
@@ -2062,7 +2062,7 @@ class ki {
|
|
|
2062
2062
|
usage: GPUBufferUsage.INDEX,
|
|
2063
2063
|
mappedAtCreation: !0
|
|
2064
2064
|
}), new Uint32Array(B.getMappedRange()).set(A.indexData), B.unmap());
|
|
2065
|
-
const { attributes: Q, attributesKey: E } =
|
|
2065
|
+
const { attributes: Q, attributesKey: E } = Ui(A), i = {
|
|
2066
2066
|
geometry: A,
|
|
2067
2067
|
vertexBuffer: g,
|
|
2068
2068
|
indexBuffer: B,
|
|
@@ -2083,7 +2083,7 @@ class ki {
|
|
|
2083
2083
|
this.buffers_.length = 0;
|
|
2084
2084
|
}
|
|
2085
2085
|
}
|
|
2086
|
-
function
|
|
2086
|
+
function di(C) {
|
|
2087
2087
|
switch (C) {
|
|
2088
2088
|
case 2:
|
|
2089
2089
|
return "float32x2";
|
|
@@ -2095,18 +2095,18 @@ function Ui(C) {
|
|
|
2095
2095
|
throw new Error("Unsupported vertex format size");
|
|
2096
2096
|
}
|
|
2097
2097
|
}
|
|
2098
|
-
function
|
|
2098
|
+
function Ui(C) {
|
|
2099
2099
|
const A = [];
|
|
2100
2100
|
let I = "";
|
|
2101
2101
|
for (const g of C.attributes)
|
|
2102
2102
|
A.push({
|
|
2103
|
-
shaderLocation:
|
|
2103
|
+
shaderLocation: UQ[g.type],
|
|
2104
2104
|
offset: g.offset,
|
|
2105
|
-
format:
|
|
2105
|
+
format: di(g.itemSize)
|
|
2106
2106
|
}), I += `${g.type},${g.offset},${g.itemSize}|`;
|
|
2107
2107
|
return { attributes: A, attributesKey: I };
|
|
2108
2108
|
}
|
|
2109
|
-
class
|
|
2109
|
+
class vI extends dB {
|
|
2110
2110
|
width_;
|
|
2111
2111
|
height_;
|
|
2112
2112
|
depth_;
|
|
@@ -2131,7 +2131,7 @@ class TI extends UB {
|
|
|
2131
2131
|
throw new Error(
|
|
2132
2132
|
"Unable to create texture, chunk data is not initialized."
|
|
2133
2133
|
);
|
|
2134
|
-
const g = new
|
|
2134
|
+
const g = new vI(
|
|
2135
2135
|
I,
|
|
2136
2136
|
A.shape.x,
|
|
2137
2137
|
A.shape.y,
|
|
@@ -2156,11 +2156,11 @@ class li {
|
|
|
2156
2156
|
if (!I) {
|
|
2157
2157
|
const g = this.device_.createTexture({
|
|
2158
2158
|
size: nC(A),
|
|
2159
|
-
dimension: A instanceof
|
|
2159
|
+
dimension: A instanceof vI ? "3d" : "2d",
|
|
2160
2160
|
format: Ji(A),
|
|
2161
2161
|
usage: GPUTextureUsage.TEXTURE_BINDING | GPUTextureUsage.COPY_DST | GPUTextureUsage.COPY_SRC
|
|
2162
2162
|
}), B = { entry: A, texture: g };
|
|
2163
|
-
I = B, this.textures_.push(B), this.textureCount_ += 1, this.gpuTextureBytes_ +=
|
|
2163
|
+
I = B, this.textures_.push(B), this.textureCount_ += 1, this.gpuTextureBytes_ += mI(A);
|
|
2164
2164
|
}
|
|
2165
2165
|
return this.upload(A, I.texture), A.readTexel = (g, B, Q) => this.readTexel(I.texture, A.dataType, g, B, Q), I.texture;
|
|
2166
2166
|
}
|
|
@@ -2200,7 +2200,7 @@ class li {
|
|
|
2200
2200
|
const I = this.textures_.findIndex((B) => B.entry === A);
|
|
2201
2201
|
if (I === -1) return;
|
|
2202
2202
|
this.textures_[I].texture.destroy(), this.textures_.splice(I, 1), A.readTexel = void 0;
|
|
2203
|
-
const g =
|
|
2203
|
+
const g = mI(A);
|
|
2204
2204
|
this.gpuTextureBytes_ = Math.max(0, this.gpuTextureBytes_ - g), this.textureCount_ = Math.max(0, this.textureCount_ - 1);
|
|
2205
2205
|
}
|
|
2206
2206
|
disposeAll() {
|
|
@@ -2212,7 +2212,7 @@ function nC(C) {
|
|
|
2212
2212
|
return {
|
|
2213
2213
|
width: C.width,
|
|
2214
2214
|
height: C.height,
|
|
2215
|
-
depthOrArrayLayers: C instanceof
|
|
2215
|
+
depthOrArrayLayers: C instanceof vI ? C.depth : 1
|
|
2216
2216
|
};
|
|
2217
2217
|
}
|
|
2218
2218
|
function Li(C, A) {
|
|
@@ -2270,7 +2270,7 @@ function Ji(C) {
|
|
|
2270
2270
|
return "rgba32float";
|
|
2271
2271
|
}
|
|
2272
2272
|
}
|
|
2273
|
-
const
|
|
2273
|
+
const UB = (C, A) => ((C + A - 1) / A | 0) * A;
|
|
2274
2274
|
function Yi(C) {
|
|
2275
2275
|
return Object.keys(C);
|
|
2276
2276
|
}
|
|
@@ -2370,14 +2370,14 @@ function Ki(C) {
|
|
|
2370
2370
|
return C.size * B;
|
|
2371
2371
|
{
|
|
2372
2372
|
const Q = C, { align: E } = SI[Q.type];
|
|
2373
|
-
return B > 1 ?
|
|
2373
|
+
return B > 1 ? UB(C.size, E) * B : C.size;
|
|
2374
2374
|
}
|
|
2375
2375
|
}
|
|
2376
2376
|
}
|
|
2377
2377
|
function DC(C, A, I, g) {
|
|
2378
2378
|
const { size: B, type: Q } = C;
|
|
2379
2379
|
try {
|
|
2380
|
-
const { View: E, align: i, size: o } = SI[Q], s = g !== void 0, t = s ?
|
|
2380
|
+
const { View: E, align: i, size: o } = SI[Q], s = g !== void 0, t = s ? UB(B, i) : o, e = t / E.BYTES_PER_ELEMENT, n = s ? g === 0 ? (A.byteLength - I) / t : g : 1;
|
|
2381
2381
|
return new E(A, I, e * n);
|
|
2382
2382
|
} catch {
|
|
2383
2383
|
throw new Error(`unknown type: ${Q}`);
|
|
@@ -2413,7 +2413,7 @@ function qi(C, A, I) {
|
|
|
2413
2413
|
};
|
|
2414
2414
|
return { views: Q(C, g), arrayBuffer: B };
|
|
2415
2415
|
}
|
|
2416
|
-
function
|
|
2416
|
+
function gB(C, A) {
|
|
2417
2417
|
if (C !== void 0)
|
|
2418
2418
|
if (rC(A)) {
|
|
2419
2419
|
const I = A;
|
|
@@ -2430,13 +2430,13 @@ function IB(C, A) {
|
|
|
2430
2430
|
} else if (Array.isArray(A)) {
|
|
2431
2431
|
const I = A;
|
|
2432
2432
|
C.forEach((g, B) => {
|
|
2433
|
-
|
|
2433
|
+
gB(g, I[B]);
|
|
2434
2434
|
});
|
|
2435
2435
|
} else {
|
|
2436
2436
|
const I = A;
|
|
2437
2437
|
for (const [g, B] of Object.entries(C)) {
|
|
2438
2438
|
const Q = I[g];
|
|
2439
|
-
Q &&
|
|
2439
|
+
Q && gB(B, Q);
|
|
2440
2440
|
}
|
|
2441
2441
|
}
|
|
2442
2442
|
}
|
|
@@ -2445,28 +2445,28 @@ function pi(C, A, I = 0) {
|
|
|
2445
2445
|
return {
|
|
2446
2446
|
...Q,
|
|
2447
2447
|
set(E) {
|
|
2448
|
-
|
|
2448
|
+
gB(E, Q.views);
|
|
2449
2449
|
}
|
|
2450
2450
|
};
|
|
2451
2451
|
}
|
|
2452
|
-
function
|
|
2452
|
+
function BB(C) {
|
|
2453
2453
|
const I = C.elementType;
|
|
2454
2454
|
if (I)
|
|
2455
|
-
return
|
|
2455
|
+
return BB(I);
|
|
2456
2456
|
const B = C.fields;
|
|
2457
2457
|
if (B)
|
|
2458
|
-
return Object.values(B).reduce((i, { type: o }) => Math.max(i,
|
|
2458
|
+
return Object.values(B).reduce((i, { type: o }) => Math.max(i, BB(o)), 0);
|
|
2459
2459
|
const { type: Q } = C, { align: E } = SI[Q];
|
|
2460
2460
|
return E;
|
|
2461
2461
|
}
|
|
2462
2462
|
function YQ(C) {
|
|
2463
2463
|
const I = C.elementType;
|
|
2464
2464
|
if (I) {
|
|
2465
|
-
const Q = I.size, E =
|
|
2465
|
+
const Q = I.size, E = BB(I);
|
|
2466
2466
|
return {
|
|
2467
2467
|
unalignedSize: Q,
|
|
2468
2468
|
align: E,
|
|
2469
|
-
size:
|
|
2469
|
+
size: UB(Q, E)
|
|
2470
2470
|
};
|
|
2471
2471
|
}
|
|
2472
2472
|
const B = C.fields;
|
|
@@ -2549,7 +2549,7 @@ class VA extends kA {
|
|
|
2549
2549
|
return `array<${this.format.getTypeName()}, ${this.count}>`;
|
|
2550
2550
|
}
|
|
2551
2551
|
}
|
|
2552
|
-
class
|
|
2552
|
+
class CB extends kA {
|
|
2553
2553
|
constructor(A, I, g) {
|
|
2554
2554
|
super(A, g), this.format = I;
|
|
2555
2555
|
}
|
|
@@ -2586,7 +2586,7 @@ var sA;
|
|
|
2586
2586
|
((C) => {
|
|
2587
2587
|
C[C.Uniform = 0] = "Uniform", C[C.Storage = 1] = "Storage", C[C.Immediate = 2] = "Immediate", C[C.Texture = 3] = "Texture", C[C.Sampler = 4] = "Sampler", C[C.StorageTexture = 5] = "StorageTexture";
|
|
2588
2588
|
})(sA || (sA = {}));
|
|
2589
|
-
class
|
|
2589
|
+
class dI {
|
|
2590
2590
|
constructor(A, I, g, B, Q, E, i) {
|
|
2591
2591
|
this.relations = null, this.name = A, this.type = I, this.group = g, this.binding = B, this.attributes = Q, this.resourceType = E, this.access = i;
|
|
2592
2592
|
}
|
|
@@ -2870,10 +2870,10 @@ function _(C, A, I, g, B) {
|
|
|
2870
2870
|
}
|
|
2871
2871
|
return B;
|
|
2872
2872
|
}
|
|
2873
|
-
const pg = { r8unorm: { bytesPerBlock: 1, blockWidth: 1, blockHeight: 1, isCompressed: !1, channels: 1 }, r8snorm: { bytesPerBlock: 1, blockWidth: 1, blockHeight: 1, isCompressed: !1, channels: 1 }, r8uint: { bytesPerBlock: 1, blockWidth: 1, blockHeight: 1, isCompressed: !1, channels: 1 }, r8sint: { bytesPerBlock: 1, blockWidth: 1, blockHeight: 1, isCompressed: !1, channels: 1 }, rg8unorm: { bytesPerBlock: 2, blockWidth: 1, blockHeight: 1, isCompressed: !1, channels: 2 }, rg8snorm: { bytesPerBlock: 2, blockWidth: 1, blockHeight: 1, isCompressed: !1, channels: 2 }, rg8uint: { bytesPerBlock: 2, blockWidth: 1, blockHeight: 1, isCompressed: !1, channels: 2 }, rg8sint: { bytesPerBlock: 2, blockWidth: 1, blockHeight: 1, isCompressed: !1, channels: 2 }, rgba8unorm: { bytesPerBlock: 4, blockWidth: 1, blockHeight: 1, isCompressed: !1, channels: 4 }, "rgba8unorm-srgb": { bytesPerBlock: 4, blockWidth: 1, blockHeight: 1, isCompressed: !1, channels: 4 }, rgba8snorm: { bytesPerBlock: 4, blockWidth: 1, blockHeight: 1, isCompressed: !1, channels: 4 }, rgba8uint: { bytesPerBlock: 4, blockWidth: 1, blockHeight: 1, isCompressed: !1, channels: 4 }, rgba8sint: { bytesPerBlock: 4, blockWidth: 1, blockHeight: 1, isCompressed: !1, channels: 4 }, bgra8unorm: { bytesPerBlock: 4, blockWidth: 1, blockHeight: 1, isCompressed: !1, channels: 4 }, "bgra8unorm-srgb": { bytesPerBlock: 4, blockWidth: 1, blockHeight: 1, isCompressed: !1, channels: 4 }, r16uint: { bytesPerBlock: 2, blockWidth: 1, blockHeight: 1, isCompressed: !1, channels: 1 }, r16sint: { bytesPerBlock: 2, blockWidth: 1, blockHeight: 1, isCompressed: !1, channels: 1 }, r16float: { bytesPerBlock: 2, blockWidth: 1, blockHeight: 1, isCompressed: !1, channels: 1 }, rg16uint: { bytesPerBlock: 4, blockWidth: 1, blockHeight: 1, isCompressed: !1, channels: 2 }, rg16sint: { bytesPerBlock: 4, blockWidth: 1, blockHeight: 1, isCompressed: !1, channels: 2 }, rg16float: { bytesPerBlock: 4, blockWidth: 1, blockHeight: 1, isCompressed: !1, channels: 2 }, rgba16uint: { bytesPerBlock: 8, blockWidth: 1, blockHeight: 1, isCompressed: !1, channels: 4 }, rgba16sint: { bytesPerBlock: 8, blockWidth: 1, blockHeight: 1, isCompressed: !1, channels: 4 }, rgba16float: { bytesPerBlock: 8, blockWidth: 1, blockHeight: 1, isCompressed: !1, channels: 4 }, r32uint: { bytesPerBlock: 4, blockWidth: 1, blockHeight: 1, isCompressed: !1, channels: 1 }, r32sint: { bytesPerBlock: 4, blockWidth: 1, blockHeight: 1, isCompressed: !1, channels: 1 }, r32float: { bytesPerBlock: 4, blockWidth: 1, blockHeight: 1, isCompressed: !1, channels: 1 }, rg32uint: { bytesPerBlock: 8, blockWidth: 1, blockHeight: 1, isCompressed: !1, channels: 2 }, rg32sint: { bytesPerBlock: 8, blockWidth: 1, blockHeight: 1, isCompressed: !1, channels: 2 }, rg32float: { bytesPerBlock: 8, blockWidth: 1, blockHeight: 1, isCompressed: !1, channels: 2 }, rgba32uint: { bytesPerBlock: 16, blockWidth: 1, blockHeight: 1, isCompressed: !1, channels: 4 }, rgba32sint: { bytesPerBlock: 16, blockWidth: 1, blockHeight: 1, isCompressed: !1, channels: 4 }, rgba32float: { bytesPerBlock: 16, blockWidth: 1, blockHeight: 1, isCompressed: !1, channels: 4 }, rgb10a2uint: { bytesPerBlock: 4, blockWidth: 1, blockHeight: 1, isCompressed: !1, channels: 4 }, rgb10a2unorm: { bytesPerBlock: 4, blockWidth: 1, blockHeight: 1, isCompressed: !1, channels: 4 }, rg11b10ufloat: { bytesPerBlock: 4, blockWidth: 1, blockHeight: 1, isCompressed: !1, channels: 4 }, stencil8: { bytesPerBlock: 1, blockWidth: 1, blockHeight: 1, isCompressed: !1, isDepthStencil: !0, hasDepth: !1, hasStencil: !0, channels: 1 }, depth16unorm: { bytesPerBlock: 2, blockWidth: 1, blockHeight: 1, isCompressed: !1, isDepthStencil: !0, hasDepth: !0, hasStencil: !1, channels: 1 }, depth24plus: { bytesPerBlock: 4, blockWidth: 1, blockHeight: 1, isCompressed: !1, isDepthStencil: !0, hasDepth: !0, hasStencil: !1, depthOnlyFormat: "depth32float", channels: 1 }, "depth24plus-stencil8": { bytesPerBlock: 8, blockWidth: 1, blockHeight: 1, isCompressed: !1, isDepthStencil: !0, hasDepth: !0, hasStencil: !0, depthOnlyFormat: "depth32float", channels: 1 }, depth32float: { bytesPerBlock: 4, blockWidth: 1, blockHeight: 1, isCompressed: !1, isDepthStencil: !0, hasDepth: !0, hasStencil: !1, channels: 1 }, "depth32float-stencil8": { bytesPerBlock: 8, blockWidth: 1, blockHeight: 1, isCompressed: !1, isDepthStencil: !0, hasDepth: !0, hasStencil: !0, stencilOnlyFormat: "depth32float", channels: 1 }, rgb9e5ufloat: { bytesPerBlock: 4, blockWidth: 1, blockHeight: 1, isCompressed: !1, channels: 4 }, "bc1-rgba-unorm": { bytesPerBlock: 8, blockWidth: 4, blockHeight: 4, isCompressed: !0, channels: 4 }, "bc1-rgba-unorm-srgb": { bytesPerBlock: 8, blockWidth: 4, blockHeight: 4, isCompressed: !0, channels: 4 }, "bc2-rgba-unorm": { bytesPerBlock: 16, blockWidth: 4, blockHeight: 4, isCompressed: !0, channels: 4 }, "bc2-rgba-unorm-srgb": { bytesPerBlock: 16, blockWidth: 4, blockHeight: 4, isCompressed: !0, channels: 4 }, "bc3-rgba-unorm": { bytesPerBlock: 16, blockWidth: 4, blockHeight: 4, isCompressed: !0, channels: 4 }, "bc3-rgba-unorm-srgb": { bytesPerBlock: 16, blockWidth: 4, blockHeight: 4, isCompressed: !0, channels: 4 }, "bc4-r-unorm": { bytesPerBlock: 8, blockWidth: 4, blockHeight: 4, isCompressed: !0, channels: 1 }, "bc4-r-snorm": { bytesPerBlock: 8, blockWidth: 4, blockHeight: 4, isCompressed: !0, channels: 1 }, "bc5-rg-unorm": { bytesPerBlock: 16, blockWidth: 4, blockHeight: 4, isCompressed: !0, channels: 2 }, "bc5-rg-snorm": { bytesPerBlock: 16, blockWidth: 4, blockHeight: 4, isCompressed: !0, channels: 2 }, "bc6h-rgb-ufloat": { bytesPerBlock: 16, blockWidth: 4, blockHeight: 4, isCompressed: !0, channels: 4 }, "bc6h-rgb-float": { bytesPerBlock: 16, blockWidth: 4, blockHeight: 4, isCompressed: !0, channels: 4 }, "bc7-rgba-unorm": { bytesPerBlock: 16, blockWidth: 4, blockHeight: 4, isCompressed: !0, channels: 4 }, "bc7-rgba-unorm-srgb": { bytesPerBlock: 16, blockWidth: 4, blockHeight: 4, isCompressed: !0, channels: 4 }, "etc2-rgb8unorm": { bytesPerBlock: 8, blockWidth: 4, blockHeight: 4, isCompressed: !0, channels: 4 }, "etc2-rgb8unorm-srgb": { bytesPerBlock: 8, blockWidth: 4, blockHeight: 4, isCompressed: !0, channels: 4 }, "etc2-rgb8a1unorm": { bytesPerBlock: 8, blockWidth: 4, blockHeight: 4, isCompressed: !0, channels: 4 }, "etc2-rgb8a1unorm-srgb": { bytesPerBlock: 8, blockWidth: 4, blockHeight: 4, isCompressed: !0, channels: 4 }, "etc2-rgba8unorm": { bytesPerBlock: 16, blockWidth: 4, blockHeight: 4, isCompressed: !0, channels: 4 }, "etc2-rgba8unorm-srgb": { bytesPerBlock: 16, blockWidth: 4, blockHeight: 4, isCompressed: !0, channels: 4 }, "eac-r11unorm": { bytesPerBlock: 8, blockWidth: 1, blockHeight: 1, isCompressed: !0, channels: 1 }, "eac-r11snorm": { bytesPerBlock: 8, blockWidth: 1, blockHeight: 1, isCompressed: !0, channels: 1 }, "eac-rg11unorm": { bytesPerBlock: 16, blockWidth: 1, blockHeight: 1, isCompressed: !0, channels: 2 }, "eac-rg11snorm": { bytesPerBlock: 16, blockWidth: 1, blockHeight: 1, isCompressed: !0, channels: 2 }, "astc-4x4-unorm": { bytesPerBlock: 16, blockWidth: 4, blockHeight: 4, isCompressed: !0, channels: 4 }, "astc-4x4-unorm-srgb": { bytesPerBlock: 16, blockWidth: 4, blockHeight: 4, isCompressed: !0, channels: 4 }, "astc-5x4-unorm": { bytesPerBlock: 16, blockWidth: 5, blockHeight: 4, isCompressed: !0, channels: 4 }, "astc-5x4-unorm-srgb": { bytesPerBlock: 16, blockWidth: 5, blockHeight: 4, isCompressed: !0, channels: 4 }, "astc-5x5-unorm": { bytesPerBlock: 16, blockWidth: 5, blockHeight: 5, isCompressed: !0, channels: 4 }, "astc-5x5-unorm-srgb": { bytesPerBlock: 16, blockWidth: 5, blockHeight: 5, isCompressed: !0, channels: 4 }, "astc-6x5-unorm": { bytesPerBlock: 16, blockWidth: 6, blockHeight: 5, isCompressed: !0, channels: 4 }, "astc-6x5-unorm-srgb": { bytesPerBlock: 16, blockWidth: 6, blockHeight: 5, isCompressed: !0, channels: 4 }, "astc-6x6-unorm": { bytesPerBlock: 16, blockWidth: 6, blockHeight: 6, isCompressed: !0, channels: 4 }, "astc-6x6-unorm-srgb": { bytesPerBlock: 16, blockWidth: 6, blockHeight: 6, isCompressed: !0, channels: 4 }, "astc-8x5-unorm": { bytesPerBlock: 16, blockWidth: 8, blockHeight: 5, isCompressed: !0, channels: 4 }, "astc-8x5-unorm-srgb": { bytesPerBlock: 16, blockWidth: 8, blockHeight: 5, isCompressed: !0, channels: 4 }, "astc-8x6-unorm": { bytesPerBlock: 16, blockWidth: 8, blockHeight: 6, isCompressed: !0, channels: 4 }, "astc-8x6-unorm-srgb": { bytesPerBlock: 16, blockWidth: 8, blockHeight: 6, isCompressed: !0, channels: 4 }, "astc-8x8-unorm": { bytesPerBlock: 16, blockWidth: 8, blockHeight: 8, isCompressed: !0, channels: 4 }, "astc-8x8-unorm-srgb": { bytesPerBlock: 16, blockWidth: 8, blockHeight: 8, isCompressed: !0, channels: 4 }, "astc-10x5-unorm": { bytesPerBlock: 16, blockWidth: 10, blockHeight: 5, isCompressed: !0, channels: 4 }, "astc-10x5-unorm-srgb": { bytesPerBlock: 16, blockWidth: 10, blockHeight: 5, isCompressed: !0, channels: 4 }, "astc-10x6-unorm": { bytesPerBlock: 16, blockWidth: 10, blockHeight: 6, isCompressed: !0, channels: 4 }, "astc-10x6-unorm-srgb": { bytesPerBlock: 16, blockWidth: 10, blockHeight: 6, isCompressed: !0, channels: 4 }, "astc-10x8-unorm": { bytesPerBlock: 16, blockWidth: 10, blockHeight: 8, isCompressed: !0, channels: 4 }, "astc-10x8-unorm-srgb": { bytesPerBlock: 16, blockWidth: 10, blockHeight: 8, isCompressed: !0, channels: 4 }, "astc-10x10-unorm": { bytesPerBlock: 16, blockWidth: 10, blockHeight: 10, isCompressed: !0, channels: 4 }, "astc-10x10-unorm-srgb": { bytesPerBlock: 16, blockWidth: 10, blockHeight: 10, isCompressed: !0, channels: 4 }, "astc-12x10-unorm": { bytesPerBlock: 16, blockWidth: 12, blockHeight: 10, isCompressed: !0, channels: 4 }, "astc-12x10-unorm-srgb": { bytesPerBlock: 16, blockWidth: 12, blockHeight: 10, isCompressed: !0, channels: 4 }, "astc-12x12-unorm": { bytesPerBlock: 16, blockWidth: 12, blockHeight: 12, isCompressed: !0, channels: 4 }, "astc-12x12-unorm-srgb": { bytesPerBlock: 16, blockWidth: 12, blockHeight: 12, isCompressed: !0, channels: 4 } };
|
|
2874
|
-
class
|
|
2873
|
+
const mg = { r8unorm: { bytesPerBlock: 1, blockWidth: 1, blockHeight: 1, isCompressed: !1, channels: 1 }, r8snorm: { bytesPerBlock: 1, blockWidth: 1, blockHeight: 1, isCompressed: !1, channels: 1 }, r8uint: { bytesPerBlock: 1, blockWidth: 1, blockHeight: 1, isCompressed: !1, channels: 1 }, r8sint: { bytesPerBlock: 1, blockWidth: 1, blockHeight: 1, isCompressed: !1, channels: 1 }, rg8unorm: { bytesPerBlock: 2, blockWidth: 1, blockHeight: 1, isCompressed: !1, channels: 2 }, rg8snorm: { bytesPerBlock: 2, blockWidth: 1, blockHeight: 1, isCompressed: !1, channels: 2 }, rg8uint: { bytesPerBlock: 2, blockWidth: 1, blockHeight: 1, isCompressed: !1, channels: 2 }, rg8sint: { bytesPerBlock: 2, blockWidth: 1, blockHeight: 1, isCompressed: !1, channels: 2 }, rgba8unorm: { bytesPerBlock: 4, blockWidth: 1, blockHeight: 1, isCompressed: !1, channels: 4 }, "rgba8unorm-srgb": { bytesPerBlock: 4, blockWidth: 1, blockHeight: 1, isCompressed: !1, channels: 4 }, rgba8snorm: { bytesPerBlock: 4, blockWidth: 1, blockHeight: 1, isCompressed: !1, channels: 4 }, rgba8uint: { bytesPerBlock: 4, blockWidth: 1, blockHeight: 1, isCompressed: !1, channels: 4 }, rgba8sint: { bytesPerBlock: 4, blockWidth: 1, blockHeight: 1, isCompressed: !1, channels: 4 }, bgra8unorm: { bytesPerBlock: 4, blockWidth: 1, blockHeight: 1, isCompressed: !1, channels: 4 }, "bgra8unorm-srgb": { bytesPerBlock: 4, blockWidth: 1, blockHeight: 1, isCompressed: !1, channels: 4 }, r16uint: { bytesPerBlock: 2, blockWidth: 1, blockHeight: 1, isCompressed: !1, channels: 1 }, r16sint: { bytesPerBlock: 2, blockWidth: 1, blockHeight: 1, isCompressed: !1, channels: 1 }, r16float: { bytesPerBlock: 2, blockWidth: 1, blockHeight: 1, isCompressed: !1, channels: 1 }, rg16uint: { bytesPerBlock: 4, blockWidth: 1, blockHeight: 1, isCompressed: !1, channels: 2 }, rg16sint: { bytesPerBlock: 4, blockWidth: 1, blockHeight: 1, isCompressed: !1, channels: 2 }, rg16float: { bytesPerBlock: 4, blockWidth: 1, blockHeight: 1, isCompressed: !1, channels: 2 }, rgba16uint: { bytesPerBlock: 8, blockWidth: 1, blockHeight: 1, isCompressed: !1, channels: 4 }, rgba16sint: { bytesPerBlock: 8, blockWidth: 1, blockHeight: 1, isCompressed: !1, channels: 4 }, rgba16float: { bytesPerBlock: 8, blockWidth: 1, blockHeight: 1, isCompressed: !1, channels: 4 }, r32uint: { bytesPerBlock: 4, blockWidth: 1, blockHeight: 1, isCompressed: !1, channels: 1 }, r32sint: { bytesPerBlock: 4, blockWidth: 1, blockHeight: 1, isCompressed: !1, channels: 1 }, r32float: { bytesPerBlock: 4, blockWidth: 1, blockHeight: 1, isCompressed: !1, channels: 1 }, rg32uint: { bytesPerBlock: 8, blockWidth: 1, blockHeight: 1, isCompressed: !1, channels: 2 }, rg32sint: { bytesPerBlock: 8, blockWidth: 1, blockHeight: 1, isCompressed: !1, channels: 2 }, rg32float: { bytesPerBlock: 8, blockWidth: 1, blockHeight: 1, isCompressed: !1, channels: 2 }, rgba32uint: { bytesPerBlock: 16, blockWidth: 1, blockHeight: 1, isCompressed: !1, channels: 4 }, rgba32sint: { bytesPerBlock: 16, blockWidth: 1, blockHeight: 1, isCompressed: !1, channels: 4 }, rgba32float: { bytesPerBlock: 16, blockWidth: 1, blockHeight: 1, isCompressed: !1, channels: 4 }, rgb10a2uint: { bytesPerBlock: 4, blockWidth: 1, blockHeight: 1, isCompressed: !1, channels: 4 }, rgb10a2unorm: { bytesPerBlock: 4, blockWidth: 1, blockHeight: 1, isCompressed: !1, channels: 4 }, rg11b10ufloat: { bytesPerBlock: 4, blockWidth: 1, blockHeight: 1, isCompressed: !1, channels: 4 }, stencil8: { bytesPerBlock: 1, blockWidth: 1, blockHeight: 1, isCompressed: !1, isDepthStencil: !0, hasDepth: !1, hasStencil: !0, channels: 1 }, depth16unorm: { bytesPerBlock: 2, blockWidth: 1, blockHeight: 1, isCompressed: !1, isDepthStencil: !0, hasDepth: !0, hasStencil: !1, channels: 1 }, depth24plus: { bytesPerBlock: 4, blockWidth: 1, blockHeight: 1, isCompressed: !1, isDepthStencil: !0, hasDepth: !0, hasStencil: !1, depthOnlyFormat: "depth32float", channels: 1 }, "depth24plus-stencil8": { bytesPerBlock: 8, blockWidth: 1, blockHeight: 1, isCompressed: !1, isDepthStencil: !0, hasDepth: !0, hasStencil: !0, depthOnlyFormat: "depth32float", channels: 1 }, depth32float: { bytesPerBlock: 4, blockWidth: 1, blockHeight: 1, isCompressed: !1, isDepthStencil: !0, hasDepth: !0, hasStencil: !1, channels: 1 }, "depth32float-stencil8": { bytesPerBlock: 8, blockWidth: 1, blockHeight: 1, isCompressed: !1, isDepthStencil: !0, hasDepth: !0, hasStencil: !0, stencilOnlyFormat: "depth32float", channels: 1 }, rgb9e5ufloat: { bytesPerBlock: 4, blockWidth: 1, blockHeight: 1, isCompressed: !1, channels: 4 }, "bc1-rgba-unorm": { bytesPerBlock: 8, blockWidth: 4, blockHeight: 4, isCompressed: !0, channels: 4 }, "bc1-rgba-unorm-srgb": { bytesPerBlock: 8, blockWidth: 4, blockHeight: 4, isCompressed: !0, channels: 4 }, "bc2-rgba-unorm": { bytesPerBlock: 16, blockWidth: 4, blockHeight: 4, isCompressed: !0, channels: 4 }, "bc2-rgba-unorm-srgb": { bytesPerBlock: 16, blockWidth: 4, blockHeight: 4, isCompressed: !0, channels: 4 }, "bc3-rgba-unorm": { bytesPerBlock: 16, blockWidth: 4, blockHeight: 4, isCompressed: !0, channels: 4 }, "bc3-rgba-unorm-srgb": { bytesPerBlock: 16, blockWidth: 4, blockHeight: 4, isCompressed: !0, channels: 4 }, "bc4-r-unorm": { bytesPerBlock: 8, blockWidth: 4, blockHeight: 4, isCompressed: !0, channels: 1 }, "bc4-r-snorm": { bytesPerBlock: 8, blockWidth: 4, blockHeight: 4, isCompressed: !0, channels: 1 }, "bc5-rg-unorm": { bytesPerBlock: 16, blockWidth: 4, blockHeight: 4, isCompressed: !0, channels: 2 }, "bc5-rg-snorm": { bytesPerBlock: 16, blockWidth: 4, blockHeight: 4, isCompressed: !0, channels: 2 }, "bc6h-rgb-ufloat": { bytesPerBlock: 16, blockWidth: 4, blockHeight: 4, isCompressed: !0, channels: 4 }, "bc6h-rgb-float": { bytesPerBlock: 16, blockWidth: 4, blockHeight: 4, isCompressed: !0, channels: 4 }, "bc7-rgba-unorm": { bytesPerBlock: 16, blockWidth: 4, blockHeight: 4, isCompressed: !0, channels: 4 }, "bc7-rgba-unorm-srgb": { bytesPerBlock: 16, blockWidth: 4, blockHeight: 4, isCompressed: !0, channels: 4 }, "etc2-rgb8unorm": { bytesPerBlock: 8, blockWidth: 4, blockHeight: 4, isCompressed: !0, channels: 4 }, "etc2-rgb8unorm-srgb": { bytesPerBlock: 8, blockWidth: 4, blockHeight: 4, isCompressed: !0, channels: 4 }, "etc2-rgb8a1unorm": { bytesPerBlock: 8, blockWidth: 4, blockHeight: 4, isCompressed: !0, channels: 4 }, "etc2-rgb8a1unorm-srgb": { bytesPerBlock: 8, blockWidth: 4, blockHeight: 4, isCompressed: !0, channels: 4 }, "etc2-rgba8unorm": { bytesPerBlock: 16, blockWidth: 4, blockHeight: 4, isCompressed: !0, channels: 4 }, "etc2-rgba8unorm-srgb": { bytesPerBlock: 16, blockWidth: 4, blockHeight: 4, isCompressed: !0, channels: 4 }, "eac-r11unorm": { bytesPerBlock: 8, blockWidth: 1, blockHeight: 1, isCompressed: !0, channels: 1 }, "eac-r11snorm": { bytesPerBlock: 8, blockWidth: 1, blockHeight: 1, isCompressed: !0, channels: 1 }, "eac-rg11unorm": { bytesPerBlock: 16, blockWidth: 1, blockHeight: 1, isCompressed: !0, channels: 2 }, "eac-rg11snorm": { bytesPerBlock: 16, blockWidth: 1, blockHeight: 1, isCompressed: !0, channels: 2 }, "astc-4x4-unorm": { bytesPerBlock: 16, blockWidth: 4, blockHeight: 4, isCompressed: !0, channels: 4 }, "astc-4x4-unorm-srgb": { bytesPerBlock: 16, blockWidth: 4, blockHeight: 4, isCompressed: !0, channels: 4 }, "astc-5x4-unorm": { bytesPerBlock: 16, blockWidth: 5, blockHeight: 4, isCompressed: !0, channels: 4 }, "astc-5x4-unorm-srgb": { bytesPerBlock: 16, blockWidth: 5, blockHeight: 4, isCompressed: !0, channels: 4 }, "astc-5x5-unorm": { bytesPerBlock: 16, blockWidth: 5, blockHeight: 5, isCompressed: !0, channels: 4 }, "astc-5x5-unorm-srgb": { bytesPerBlock: 16, blockWidth: 5, blockHeight: 5, isCompressed: !0, channels: 4 }, "astc-6x5-unorm": { bytesPerBlock: 16, blockWidth: 6, blockHeight: 5, isCompressed: !0, channels: 4 }, "astc-6x5-unorm-srgb": { bytesPerBlock: 16, blockWidth: 6, blockHeight: 5, isCompressed: !0, channels: 4 }, "astc-6x6-unorm": { bytesPerBlock: 16, blockWidth: 6, blockHeight: 6, isCompressed: !0, channels: 4 }, "astc-6x6-unorm-srgb": { bytesPerBlock: 16, blockWidth: 6, blockHeight: 6, isCompressed: !0, channels: 4 }, "astc-8x5-unorm": { bytesPerBlock: 16, blockWidth: 8, blockHeight: 5, isCompressed: !0, channels: 4 }, "astc-8x5-unorm-srgb": { bytesPerBlock: 16, blockWidth: 8, blockHeight: 5, isCompressed: !0, channels: 4 }, "astc-8x6-unorm": { bytesPerBlock: 16, blockWidth: 8, blockHeight: 6, isCompressed: !0, channels: 4 }, "astc-8x6-unorm-srgb": { bytesPerBlock: 16, blockWidth: 8, blockHeight: 6, isCompressed: !0, channels: 4 }, "astc-8x8-unorm": { bytesPerBlock: 16, blockWidth: 8, blockHeight: 8, isCompressed: !0, channels: 4 }, "astc-8x8-unorm-srgb": { bytesPerBlock: 16, blockWidth: 8, blockHeight: 8, isCompressed: !0, channels: 4 }, "astc-10x5-unorm": { bytesPerBlock: 16, blockWidth: 10, blockHeight: 5, isCompressed: !0, channels: 4 }, "astc-10x5-unorm-srgb": { bytesPerBlock: 16, blockWidth: 10, blockHeight: 5, isCompressed: !0, channels: 4 }, "astc-10x6-unorm": { bytesPerBlock: 16, blockWidth: 10, blockHeight: 6, isCompressed: !0, channels: 4 }, "astc-10x6-unorm-srgb": { bytesPerBlock: 16, blockWidth: 10, blockHeight: 6, isCompressed: !0, channels: 4 }, "astc-10x8-unorm": { bytesPerBlock: 16, blockWidth: 10, blockHeight: 8, isCompressed: !0, channels: 4 }, "astc-10x8-unorm-srgb": { bytesPerBlock: 16, blockWidth: 10, blockHeight: 8, isCompressed: !0, channels: 4 }, "astc-10x10-unorm": { bytesPerBlock: 16, blockWidth: 10, blockHeight: 10, isCompressed: !0, channels: 4 }, "astc-10x10-unorm-srgb": { bytesPerBlock: 16, blockWidth: 10, blockHeight: 10, isCompressed: !0, channels: 4 }, "astc-12x10-unorm": { bytesPerBlock: 16, blockWidth: 12, blockHeight: 10, isCompressed: !0, channels: 4 }, "astc-12x10-unorm-srgb": { bytesPerBlock: 16, blockWidth: 12, blockHeight: 10, isCompressed: !0, channels: 4 }, "astc-12x12-unorm": { bytesPerBlock: 16, blockWidth: 12, blockHeight: 12, isCompressed: !0, channels: 4 }, "astc-12x12-unorm-srgb": { bytesPerBlock: 16, blockWidth: 12, blockHeight: 12, isCompressed: !0, channels: 4 } };
|
|
2874
|
+
class UA {
|
|
2875
2875
|
constructor() {
|
|
2876
|
-
this.id =
|
|
2876
|
+
this.id = UA._id++, this.line = 0;
|
|
2877
2877
|
}
|
|
2878
2878
|
get isAstNode() {
|
|
2879
2879
|
return !0;
|
|
@@ -2886,9 +2886,9 @@ class dA {
|
|
|
2886
2886
|
}
|
|
2887
2887
|
searchBlock(A, I) {
|
|
2888
2888
|
if (A) {
|
|
2889
|
-
I(Qg.instance);
|
|
2890
|
-
for (const g of A) g instanceof Array ? this.searchBlock(g, I) : g.search(I);
|
|
2891
2889
|
I(Eg.instance);
|
|
2890
|
+
for (const g of A) g instanceof Array ? this.searchBlock(g, I) : g.search(I);
|
|
2891
|
+
I(ig.instance);
|
|
2892
2892
|
}
|
|
2893
2893
|
}
|
|
2894
2894
|
constEvaluate(A, I) {
|
|
@@ -2899,17 +2899,17 @@ class dA {
|
|
|
2899
2899
|
return (g = (I = this.constEvaluate(A)) === null || I === void 0 ? void 0 : I.toString()) !== null && g !== void 0 ? g : "";
|
|
2900
2900
|
}
|
|
2901
2901
|
}
|
|
2902
|
-
|
|
2903
|
-
class
|
|
2904
|
-
}
|
|
2905
|
-
Qg.instance = new Qg();
|
|
2906
|
-
class Eg extends dA {
|
|
2902
|
+
UA._id = 0;
|
|
2903
|
+
class Eg extends UA {
|
|
2907
2904
|
}
|
|
2908
2905
|
Eg.instance = new Eg();
|
|
2906
|
+
class ig extends UA {
|
|
2907
|
+
}
|
|
2908
|
+
ig.instance = new ig();
|
|
2909
2909
|
const fQ = /* @__PURE__ */ new Set(["all", "any", "select", "arrayLength", "abs", "acos", "acosh", "asin", "asinh", "atan", "atanh", "atan2", "ceil", "clamp", "cos", "cosh", "countLeadingZeros", "countOneBits", "countTrailingZeros", "cross", "degrees", "determinant", "distance", "dot", "dot4U8Packed", "dot4I8Packed", "exp", "exp2", "extractBits", "faceForward", "firstLeadingBit", "firstTrailingBit", "floor", "fma", "fract", "frexp", "insertBits", "inverseSqrt", "ldexp", "length", "log", "log2", "max", "min", "mix", "modf", "normalize", "pow", "quantizeToF16", "radians", "reflect", "refract", "reverseBits", "round", "saturate", "sign", "sin", "sinh", "smoothstep", "sqrt", "step", "tan", "tanh", "transpose", "trunc", "dpdx", "dpdxCoarse", "dpdxFine", "dpdy", "dpdyCoarse", "dpdyFine", "fwidth", "fwidthCoarse", "fwidthFine", "textureDimensions", "textureGather", "textureGatherCompare", "textureLoad", "textureNumLayers", "textureNumLevels", "textureNumSamples", "textureSample", "textureSampleBias", "textureSampleCompare", "textureSampleCompareLevel", "textureSampleGrad", "textureSampleLevel", "textureSampleBaseClampToEdge", "textureStore", "atomicLoad", "atomicStore", "atomicAdd", "atomicSub", "atomicMax", "atomicMin", "atomicAnd", "atomicOr", "atomicXor", "atomicExchange", "atomicCompareExchangeWeak", "pack4x8snorm", "pack4x8unorm", "pack4xI8", "pack4xU8", "pack4x8Clamp", "pack4xU8Clamp", "pack2x16snorm", "pack2x16unorm", "pack2x16float", "unpack4x8snorm", "unpack4x8unorm", "unpack4xI8", "unpack4xU8", "unpack2x16snorm", "unpack2x16unorm", "unpack2x16float", "storageBarrier", "textureBarrier", "workgroupBarrier", "workgroupUniformLoad", "subgroupAdd", "subgroupExclusiveAdd", "subgroupInclusiveAdd", "subgroupAll", "subgroupAnd", "subgroupAny", "subgroupBallot", "subgroupBroadcast", "subgroupBroadcastFirst", "subgroupElect", "subgroupMax", "subgroupMin", "subgroupMul", "subgroupExclusiveMul", "subgroupInclusiveMul", "subgroupOr", "subgroupShuffle", "subgroupShuffleDown", "subgroupShuffleUp", "subgroupShuffleXor", "subgroupXor", "quadBroadcast", "quadSwapDiagonal", "quadSwapX", "quadSwapY"]);
|
|
2910
|
-
class EA extends
|
|
2910
|
+
class EA extends UA {
|
|
2911
2911
|
}
|
|
2912
|
-
class
|
|
2912
|
+
class xI extends EA {
|
|
2913
2913
|
constructor(A, I, g, B, Q, E) {
|
|
2914
2914
|
super(), this.calls = /* @__PURE__ */ new Set(), this.name = A, this.args = I, this.returnType = g, this.body = B, this.startLine = Q, this.endLine = E;
|
|
2915
2915
|
}
|
|
@@ -2945,7 +2945,7 @@ class KQ extends EA {
|
|
|
2945
2945
|
this.condition.search(A), this.searchBlock(this.body, A);
|
|
2946
2946
|
}
|
|
2947
2947
|
}
|
|
2948
|
-
class
|
|
2948
|
+
class QB extends EA {
|
|
2949
2949
|
constructor(A, I) {
|
|
2950
2950
|
super(), this.body = A, this.loopId = I;
|
|
2951
2951
|
}
|
|
@@ -2992,7 +2992,7 @@ class LB extends EA {
|
|
|
2992
2992
|
(I = this.value) === null || I === void 0 || I.search(A);
|
|
2993
2993
|
}
|
|
2994
2994
|
}
|
|
2995
|
-
class
|
|
2995
|
+
class uI extends EA {
|
|
2996
2996
|
constructor(A, I, g, B, Q) {
|
|
2997
2997
|
super(), this.attributes = null, this.name = A, this.type = I, this.storage = g, this.access = B, this.value = Q;
|
|
2998
2998
|
}
|
|
@@ -3004,7 +3004,7 @@ class MI extends EA {
|
|
|
3004
3004
|
A(this), (I = this.value) === null || I === void 0 || I.search(A);
|
|
3005
3005
|
}
|
|
3006
3006
|
}
|
|
3007
|
-
class
|
|
3007
|
+
class Ag extends EA {
|
|
3008
3008
|
constructor(A, I, g, B, Q) {
|
|
3009
3009
|
super(), this.attributes = null, this.name = A, this.type = I, this.storage = g, this.access = B, this.value = Q;
|
|
3010
3010
|
}
|
|
@@ -3248,7 +3248,7 @@ class w extends N {
|
|
|
3248
3248
|
}
|
|
3249
3249
|
}
|
|
3250
3250
|
w.vec2f = new w("vec2", N.f32, null), w.vec3f = new w("vec3", N.f32, null), w.vec4f = new w("vec4", N.f32, null), w.vec2i = new w("vec2", N.i32, null), w.vec3i = new w("vec3", N.i32, null), w.vec4i = new w("vec4", N.i32, null), w.vec2u = new w("vec2", N.u32, null), w.vec3u = new w("vec3", N.u32, null), w.vec4u = new w("vec4", N.u32, null), w.vec2h = new w("vec2", N.f16, null), w.vec3h = new w("vec3", N.f16, null), w.vec4h = new w("vec4", N.f16, null), w.vec2b = new w("vec2", N.bool, null), w.vec3b = new w("vec3", N.bool, null), w.vec4b = new w("vec4", N.bool, null), w.mat2x2f = new w("mat2x2", N.f32, null), w.mat2x3f = new w("mat2x3", N.f32, null), w.mat2x4f = new w("mat2x4", N.f32, null), w.mat3x2f = new w("mat3x2", N.f32, null), w.mat3x3f = new w("mat3x3", N.f32, null), w.mat3x4f = new w("mat3x4", N.f32, null), w.mat4x2f = new w("mat4x2", N.f32, null), w.mat4x3f = new w("mat4x3", N.f32, null), w.mat4x4f = new w("mat4x4", N.f32, null), w.mat2x2h = new w("mat2x2", N.f16, null), w.mat2x3h = new w("mat2x3", N.f16, null), w.mat2x4h = new w("mat2x4", N.f16, null), w.mat3x2h = new w("mat3x2", N.f16, null), w.mat3x3h = new w("mat3x3", N.f16, null), w.mat3x4h = new w("mat3x4", N.f16, null), w.mat4x2h = new w("mat4x2", N.f16, null), w.mat4x3h = new w("mat4x3", N.f16, null), w.mat4x4h = new w("mat4x4", N.f16, null), w.mat2x2i = new w("mat2x2", N.i32, null), w.mat2x3i = new w("mat2x3", N.i32, null), w.mat2x4i = new w("mat2x4", N.i32, null), w.mat3x2i = new w("mat3x2", N.i32, null), w.mat3x3i = new w("mat3x3", N.i32, null), w.mat3x4i = new w("mat3x4", N.i32, null), w.mat4x2i = new w("mat4x2", N.i32, null), w.mat4x3i = new w("mat4x3", N.i32, null), w.mat4x4i = new w("mat4x4", N.i32, null), w.mat2x2u = new w("mat2x2", N.u32, null), w.mat2x3u = new w("mat2x3", N.u32, null), w.mat2x4u = new w("mat2x4", N.u32, null), w.mat3x2u = new w("mat3x2", N.u32, null), w.mat3x3u = new w("mat3x3", N.u32, null), w.mat3x4u = new w("mat3x4", N.u32, null), w.mat4x2u = new w("mat4x2", N.u32, null), w.mat4x3u = new w("mat4x3", N.u32, null), w.mat4x4u = new w("mat4x4", N.u32, null);
|
|
3251
|
-
class
|
|
3251
|
+
class Ig extends N {
|
|
3252
3252
|
constructor(A, I, g, B) {
|
|
3253
3253
|
super(A), this.storage = I, this.type = g, this.access = B;
|
|
3254
3254
|
}
|
|
@@ -3256,7 +3256,7 @@ class $I extends N {
|
|
|
3256
3256
|
return "pointer";
|
|
3257
3257
|
}
|
|
3258
3258
|
}
|
|
3259
|
-
class
|
|
3259
|
+
class fI extends N {
|
|
3260
3260
|
constructor(A, I, g, B) {
|
|
3261
3261
|
super(A), this.attributes = I, this.format = g, this.count = B;
|
|
3262
3262
|
}
|
|
@@ -3275,7 +3275,7 @@ class LI extends N {
|
|
|
3275
3275
|
return "sampler";
|
|
3276
3276
|
}
|
|
3277
3277
|
}
|
|
3278
|
-
class YA extends
|
|
3278
|
+
class YA extends UA {
|
|
3279
3279
|
constructor() {
|
|
3280
3280
|
super(), this.postfix = null, this.hasParen = !1;
|
|
3281
3281
|
}
|
|
@@ -3436,7 +3436,7 @@ class LA extends VQ {
|
|
|
3436
3436
|
this.left.search(A), this.right.search(A);
|
|
3437
3437
|
}
|
|
3438
3438
|
}
|
|
3439
|
-
class _Q extends
|
|
3439
|
+
class _Q extends UA {
|
|
3440
3440
|
constructor(A) {
|
|
3441
3441
|
super(), this.body = A;
|
|
3442
3442
|
}
|
|
@@ -3444,7 +3444,7 @@ class _Q extends dA {
|
|
|
3444
3444
|
A(this), this.searchBlock(this.body, A);
|
|
3445
3445
|
}
|
|
3446
3446
|
}
|
|
3447
|
-
class
|
|
3447
|
+
class gg extends YA {
|
|
3448
3448
|
get astNodeType() {
|
|
3449
3449
|
return "default";
|
|
3450
3450
|
}
|
|
@@ -3471,7 +3471,7 @@ class jQ extends _Q {
|
|
|
3471
3471
|
this.searchBlock(this.body, A);
|
|
3472
3472
|
}
|
|
3473
3473
|
}
|
|
3474
|
-
class FC extends
|
|
3474
|
+
class FC extends UA {
|
|
3475
3475
|
constructor(A, I, g) {
|
|
3476
3476
|
super(), this.name = A, this.type = I, this.attributes = g;
|
|
3477
3477
|
}
|
|
@@ -3479,7 +3479,7 @@ class FC extends dA {
|
|
|
3479
3479
|
return "argument";
|
|
3480
3480
|
}
|
|
3481
3481
|
}
|
|
3482
|
-
class zi extends
|
|
3482
|
+
class zi extends UA {
|
|
3483
3483
|
constructor(A, I) {
|
|
3484
3484
|
super(), this.condition = A, this.body = I;
|
|
3485
3485
|
}
|
|
@@ -3490,7 +3490,7 @@ class zi extends dA {
|
|
|
3490
3490
|
this.condition.search(A), this.searchBlock(this.body, A);
|
|
3491
3491
|
}
|
|
3492
3492
|
}
|
|
3493
|
-
class SC extends
|
|
3493
|
+
class SC extends UA {
|
|
3494
3494
|
constructor(A, I, g) {
|
|
3495
3495
|
super(), this.name = A, this.type = I, this.attributes = g;
|
|
3496
3496
|
}
|
|
@@ -3498,7 +3498,7 @@ class SC extends dA {
|
|
|
3498
3498
|
return "member";
|
|
3499
3499
|
}
|
|
3500
3500
|
}
|
|
3501
|
-
class zQ extends
|
|
3501
|
+
class zQ extends UA {
|
|
3502
3502
|
constructor(A, I) {
|
|
3503
3503
|
super(), this.name = A, this.value = I;
|
|
3504
3504
|
}
|
|
@@ -3532,7 +3532,7 @@ class NC extends MA {
|
|
|
3532
3532
|
return this.typeInfo.name;
|
|
3533
3533
|
}
|
|
3534
3534
|
}
|
|
3535
|
-
class
|
|
3535
|
+
class EB extends MA {
|
|
3536
3536
|
constructor() {
|
|
3537
3537
|
super(new kA("void", null), null);
|
|
3538
3538
|
}
|
|
@@ -3543,10 +3543,10 @@ class QB extends MA {
|
|
|
3543
3543
|
return "void";
|
|
3544
3544
|
}
|
|
3545
3545
|
}
|
|
3546
|
-
|
|
3546
|
+
EB.void = new EB();
|
|
3547
3547
|
class iI extends MA {
|
|
3548
3548
|
constructor(A) {
|
|
3549
|
-
super(new
|
|
3549
|
+
super(new CB("pointer", A.typeInfo, null), null), this.reference = A;
|
|
3550
3550
|
}
|
|
3551
3551
|
clone() {
|
|
3552
3552
|
return this;
|
|
@@ -3920,13 +3920,13 @@ class CA extends MA {
|
|
|
3920
3920
|
let n = "f";
|
|
3921
3921
|
const D = [];
|
|
3922
3922
|
for (let F = 0; F < t.length; ++F) {
|
|
3923
|
-
const
|
|
3923
|
+
const k = t[F].toLowerCase();
|
|
3924
3924
|
let S = 0;
|
|
3925
|
-
if (
|
|
3926
|
-
else if (
|
|
3927
|
-
else if (
|
|
3925
|
+
if (k === "x" || k === "r") S = 0;
|
|
3926
|
+
else if (k === "y" || k === "g") S = 1;
|
|
3927
|
+
else if (k === "z" || k === "b") S = 2;
|
|
3928
3928
|
else {
|
|
3929
|
-
if (
|
|
3929
|
+
if (k !== "w" && k !== "a") return console.error(`Unknown member ${t}`), null;
|
|
3930
3930
|
S = 3;
|
|
3931
3931
|
}
|
|
3932
3932
|
if (t.length === 1) {
|
|
@@ -4044,18 +4044,18 @@ class xA extends MA {
|
|
|
4044
4044
|
return I;
|
|
4045
4045
|
}
|
|
4046
4046
|
get texelByteSize() {
|
|
4047
|
-
const A = this.format, I =
|
|
4047
|
+
const A = this.format, I = mg[A];
|
|
4048
4048
|
return I ? I.isDepthStencil ? 4 : I.bytesPerBlock : 0;
|
|
4049
4049
|
}
|
|
4050
4050
|
get bytesPerRow() {
|
|
4051
4051
|
return this.width * this.texelByteSize;
|
|
4052
4052
|
}
|
|
4053
4053
|
get isDepthStencil() {
|
|
4054
|
-
const A = this.format, I =
|
|
4054
|
+
const A = this.format, I = mg[A];
|
|
4055
4055
|
return !!I && I.isDepthStencil;
|
|
4056
4056
|
}
|
|
4057
4057
|
getGpuSize() {
|
|
4058
|
-
const A = this.format, I =
|
|
4058
|
+
const A = this.format, I = mg[A], g = this.width;
|
|
4059
4059
|
if (!A || g <= 0 || !I) return -1;
|
|
4060
4060
|
const B = this.height, Q = this.depthOrArrayLayers, E = this.dimension;
|
|
4061
4061
|
return g / I.blockWidth * (E === "1d" ? 1 : B / I.blockHeight) * I.bytesPerBlock * Q;
|
|
@@ -4066,77 +4066,77 @@ class xA extends MA {
|
|
|
4066
4066
|
}
|
|
4067
4067
|
setPixel(A, I, g, B, Q) {
|
|
4068
4068
|
const E = this.texelByteSize, i = this.bytesPerRow, o = this.height, s = this.data[B];
|
|
4069
|
-
(function(t, e, n, D, F,
|
|
4070
|
-
const R = D * (S >>= F) * (
|
|
4069
|
+
(function(t, e, n, D, F, k, S, l, f, d) {
|
|
4070
|
+
const R = D * (S >>= F) * (k >>= F) + n * S + e * l;
|
|
4071
4071
|
switch (f) {
|
|
4072
4072
|
case "r8unorm":
|
|
4073
|
-
return void _(t, R, "8unorm", 1,
|
|
4073
|
+
return void _(t, R, "8unorm", 1, d);
|
|
4074
4074
|
case "r8snorm":
|
|
4075
|
-
return void _(t, R, "8snorm", 1,
|
|
4075
|
+
return void _(t, R, "8snorm", 1, d);
|
|
4076
4076
|
case "r8uint":
|
|
4077
|
-
return void _(t, R, "8uint", 1,
|
|
4077
|
+
return void _(t, R, "8uint", 1, d);
|
|
4078
4078
|
case "r8sint":
|
|
4079
|
-
return void _(t, R, "8sint", 1,
|
|
4079
|
+
return void _(t, R, "8sint", 1, d);
|
|
4080
4080
|
case "rg8unorm":
|
|
4081
|
-
return void _(t, R, "8unorm", 2,
|
|
4081
|
+
return void _(t, R, "8unorm", 2, d);
|
|
4082
4082
|
case "rg8snorm":
|
|
4083
|
-
return void _(t, R, "8snorm", 2,
|
|
4083
|
+
return void _(t, R, "8snorm", 2, d);
|
|
4084
4084
|
case "rg8uint":
|
|
4085
|
-
return void _(t, R, "8uint", 2,
|
|
4085
|
+
return void _(t, R, "8uint", 2, d);
|
|
4086
4086
|
case "rg8sint":
|
|
4087
|
-
return void _(t, R, "8sint", 2,
|
|
4087
|
+
return void _(t, R, "8sint", 2, d);
|
|
4088
4088
|
case "rgba8unorm-srgb":
|
|
4089
4089
|
case "rgba8unorm":
|
|
4090
4090
|
case "bgra8unorm-srgb":
|
|
4091
4091
|
case "bgra8unorm":
|
|
4092
|
-
return void _(t, R, "8unorm", 4,
|
|
4092
|
+
return void _(t, R, "8unorm", 4, d);
|
|
4093
4093
|
case "rgba8snorm":
|
|
4094
|
-
return void _(t, R, "8snorm", 4,
|
|
4094
|
+
return void _(t, R, "8snorm", 4, d);
|
|
4095
4095
|
case "rgba8uint":
|
|
4096
|
-
return void _(t, R, "8uint", 4,
|
|
4096
|
+
return void _(t, R, "8uint", 4, d);
|
|
4097
4097
|
case "rgba8sint":
|
|
4098
|
-
return void _(t, R, "8sint", 4,
|
|
4098
|
+
return void _(t, R, "8sint", 4, d);
|
|
4099
4099
|
case "r16uint":
|
|
4100
|
-
return void _(t, R, "16uint", 1,
|
|
4100
|
+
return void _(t, R, "16uint", 1, d);
|
|
4101
4101
|
case "r16sint":
|
|
4102
|
-
return void _(t, R, "16sint", 1,
|
|
4102
|
+
return void _(t, R, "16sint", 1, d);
|
|
4103
4103
|
case "r16float":
|
|
4104
|
-
return void _(t, R, "16float", 1,
|
|
4104
|
+
return void _(t, R, "16float", 1, d);
|
|
4105
4105
|
case "rg16uint":
|
|
4106
|
-
return void _(t, R, "16uint", 2,
|
|
4106
|
+
return void _(t, R, "16uint", 2, d);
|
|
4107
4107
|
case "rg16sint":
|
|
4108
|
-
return void _(t, R, "16sint", 2,
|
|
4108
|
+
return void _(t, R, "16sint", 2, d);
|
|
4109
4109
|
case "rg16float":
|
|
4110
|
-
return void _(t, R, "16float", 2,
|
|
4110
|
+
return void _(t, R, "16float", 2, d);
|
|
4111
4111
|
case "rgba16uint":
|
|
4112
|
-
return void _(t, R, "16uint", 4,
|
|
4112
|
+
return void _(t, R, "16uint", 4, d);
|
|
4113
4113
|
case "rgba16sint":
|
|
4114
|
-
return void _(t, R, "16sint", 4,
|
|
4114
|
+
return void _(t, R, "16sint", 4, d);
|
|
4115
4115
|
case "rgba16float":
|
|
4116
|
-
return void _(t, R, "16float", 4,
|
|
4116
|
+
return void _(t, R, "16float", 4, d);
|
|
4117
4117
|
case "r32uint":
|
|
4118
|
-
return void _(t, R, "32uint", 1,
|
|
4118
|
+
return void _(t, R, "32uint", 1, d);
|
|
4119
4119
|
case "r32sint":
|
|
4120
|
-
return void _(t, R, "32sint", 1,
|
|
4120
|
+
return void _(t, R, "32sint", 1, d);
|
|
4121
4121
|
case "depth16unorm":
|
|
4122
4122
|
case "depth24plus":
|
|
4123
4123
|
case "depth24plus-stencil8":
|
|
4124
4124
|
case "depth32float":
|
|
4125
4125
|
case "depth32float-stencil8":
|
|
4126
4126
|
case "r32float":
|
|
4127
|
-
return void _(t, R, "32float", 1,
|
|
4127
|
+
return void _(t, R, "32float", 1, d);
|
|
4128
4128
|
case "rg32uint":
|
|
4129
|
-
return void _(t, R, "32uint", 2,
|
|
4129
|
+
return void _(t, R, "32uint", 2, d);
|
|
4130
4130
|
case "rg32sint":
|
|
4131
|
-
return void _(t, R, "32sint", 2,
|
|
4131
|
+
return void _(t, R, "32sint", 2, d);
|
|
4132
4132
|
case "rg32float":
|
|
4133
|
-
return void _(t, R, "32float", 2,
|
|
4133
|
+
return void _(t, R, "32float", 2, d);
|
|
4134
4134
|
case "rgba32uint":
|
|
4135
|
-
return void _(t, R, "32uint", 4,
|
|
4135
|
+
return void _(t, R, "32uint", 4, d);
|
|
4136
4136
|
case "rgba32sint":
|
|
4137
|
-
return void _(t, R, "32sint", 4,
|
|
4137
|
+
return void _(t, R, "32sint", 4, d);
|
|
4138
4138
|
case "rgba32float":
|
|
4139
|
-
return void _(t, R, "32float", 4,
|
|
4139
|
+
return void _(t, R, "32float", 4, d);
|
|
4140
4140
|
case "rg11b10ufloat":
|
|
4141
4141
|
console.error("TODO: rg11b10ufloat not supported for writing");
|
|
4142
4142
|
}
|
|
@@ -4298,18 +4298,18 @@ function J(C) {
|
|
|
4298
4298
|
}
|
|
4299
4299
|
Ug._operators = /* @__PURE__ */ new Set([".", "(", ")", "[", "]", "{", "}", ",", ";", ":", "=", "!", "<", ">", "+", "-", "*", "/", "%", "&", "|", "^", "~", "@", "#", "?", "'", "`", '"', "\\", `
|
|
4300
4300
|
`, "\r", " ", "\0"]);
|
|
4301
|
-
const
|
|
4301
|
+
const og = new Float32Array(1), Ao = new Uint32Array(og.buffer), Io = new Uint32Array(og.buffer), sg = new Int32Array(1), go = new Float32Array(sg.buffer), Bo = new Uint32Array(sg.buffer), tg = new Uint32Array(1), Co = new Float32Array(tg.buffer), Qo = new Int32Array(tg.buffer);
|
|
4302
4302
|
function kC(C, A, I) {
|
|
4303
4303
|
if (A === I) return C;
|
|
4304
4304
|
if (A === "f32") {
|
|
4305
|
-
if (I === "i32" || I === "x32") return
|
|
4306
|
-
if (I === "u32") return
|
|
4305
|
+
if (I === "i32" || I === "x32") return og[0] = C, Ao[0];
|
|
4306
|
+
if (I === "u32") return og[0] = C, Io[0];
|
|
4307
4307
|
} else if (A === "i32" || A === "x32") {
|
|
4308
|
-
if (I === "f32") return
|
|
4309
|
-
if (I === "u32") return
|
|
4308
|
+
if (I === "f32") return sg[0] = C, go[0];
|
|
4309
|
+
if (I === "u32") return sg[0] = C, Bo[0];
|
|
4310
4310
|
} else if (A === "u32") {
|
|
4311
|
-
if (I === "f32") return
|
|
4312
|
-
if (I === "i32" || I === "x32") return
|
|
4311
|
+
if (I === "f32") return tg[0] = C, Co[0];
|
|
4312
|
+
if (I === "i32" || I === "x32") return tg[0] = C, Qo[0];
|
|
4313
4313
|
}
|
|
4314
4314
|
return console.error(`Unsupported cast from ${A} to ${I}`), C;
|
|
4315
4315
|
}
|
|
@@ -4318,7 +4318,7 @@ class Eo {
|
|
|
4318
4318
|
this.resources = null, this.inUse = !1, this.info = null, this.node = A;
|
|
4319
4319
|
}
|
|
4320
4320
|
}
|
|
4321
|
-
class
|
|
4321
|
+
class zI {
|
|
4322
4322
|
constructor(A, I) {
|
|
4323
4323
|
this.align = A, this.size = I;
|
|
4324
4324
|
}
|
|
@@ -4331,7 +4331,7 @@ class qA {
|
|
|
4331
4331
|
return A.name == "texture_storage_1d" || A.name == "texture_storage_2d" || A.name == "texture_storage_2d_array" || A.name == "texture_storage_3d";
|
|
4332
4332
|
}
|
|
4333
4333
|
updateAST(A) {
|
|
4334
|
-
for (const I of A) I instanceof
|
|
4334
|
+
for (const I of A) I instanceof xI && this._functions.set(I.name, new Eo(I));
|
|
4335
4335
|
for (const I of A) if (I instanceof mA) {
|
|
4336
4336
|
const g = this.getTypeInfo(I, null);
|
|
4337
4337
|
g instanceof ZA && this.structs.push(g);
|
|
@@ -4344,32 +4344,32 @@ class qA {
|
|
|
4344
4344
|
continue;
|
|
4345
4345
|
}
|
|
4346
4346
|
if (this._isUniformVar(I)) {
|
|
4347
|
-
const g = I, B = this._getAttributeNum(g.attributes, "group", 0), Q = this._getAttributeNum(g.attributes, "binding", 0), E = this.getTypeInfo(g.type, g.attributes), i = new
|
|
4347
|
+
const g = I, B = this._getAttributeNum(g.attributes, "group", 0), Q = this._getAttributeNum(g.attributes, "binding", 0), E = this.getTypeInfo(g.type, g.attributes), i = new dI(g.name, E, B, Q, g.attributes, sA.Uniform, g.access);
|
|
4348
4348
|
i.access || (i.access = "read"), this.uniforms.push(i);
|
|
4349
4349
|
continue;
|
|
4350
4350
|
}
|
|
4351
4351
|
if (this._isImmediateVar(I)) {
|
|
4352
|
-
const g = I, B = this._getAttributeNum(g.attributes, "group", 0), Q = this._getAttributeNum(g.attributes, "binding", 0), E = this.getTypeInfo(g.type, g.attributes), i = new
|
|
4352
|
+
const g = I, B = this._getAttributeNum(g.attributes, "group", 0), Q = this._getAttributeNum(g.attributes, "binding", 0), E = this.getTypeInfo(g.type, g.attributes), i = new dI(g.name, E, B, Q, g.attributes, sA.Immediate, g.access);
|
|
4353
4353
|
i.access || (i.access = "read"), this.immediates.push(i);
|
|
4354
4354
|
continue;
|
|
4355
4355
|
}
|
|
4356
4356
|
if (this._isStorageVar(I)) {
|
|
4357
|
-
const g = I, B = this._getAttributeNum(g.attributes, "group", 0), Q = this._getAttributeNum(g.attributes, "binding", 0), E = this.getTypeInfo(g.type, g.attributes), i = this._isStorageTexture(E), o = new
|
|
4357
|
+
const g = I, B = this._getAttributeNum(g.attributes, "group", 0), Q = this._getAttributeNum(g.attributes, "binding", 0), E = this.getTypeInfo(g.type, g.attributes), i = this._isStorageTexture(E), o = new dI(g.name, E, B, Q, g.attributes, i ? sA.StorageTexture : sA.Storage, g.access);
|
|
4358
4358
|
o.access || (o.access = "read"), this.storage.push(o);
|
|
4359
4359
|
continue;
|
|
4360
4360
|
}
|
|
4361
4361
|
if (this._isTextureVar(I)) {
|
|
4362
|
-
const g = I, B = this._getAttributeNum(g.attributes, "group", 0), Q = this._getAttributeNum(g.attributes, "binding", 0), E = this.getTypeInfo(g.type, g.attributes), i = this._isStorageTexture(E), o = i ? E.access : g.access, s = new
|
|
4362
|
+
const g = I, B = this._getAttributeNum(g.attributes, "group", 0), Q = this._getAttributeNum(g.attributes, "binding", 0), E = this.getTypeInfo(g.type, g.attributes), i = this._isStorageTexture(E), o = i ? E.access : g.access, s = new dI(g.name, E, B, Q, g.attributes, i ? sA.StorageTexture : sA.Texture, o || g.access);
|
|
4363
4363
|
s.access || (s.access = "read"), i ? this.storage.push(s) : this.textures.push(s);
|
|
4364
4364
|
continue;
|
|
4365
4365
|
}
|
|
4366
4366
|
if (this._isSamplerVar(I)) {
|
|
4367
|
-
const g = I, B = this._getAttributeNum(g.attributes, "group", 0), Q = this._getAttributeNum(g.attributes, "binding", 0), E = this.getTypeInfo(g.type, g.attributes), i = new
|
|
4367
|
+
const g = I, B = this._getAttributeNum(g.attributes, "group", 0), Q = this._getAttributeNum(g.attributes, "binding", 0), E = this.getTypeInfo(g.type, g.attributes), i = new dI(g.name, E, B, Q, g.attributes, sA.Sampler, g.access);
|
|
4368
4368
|
this.samplers.push(i);
|
|
4369
4369
|
continue;
|
|
4370
4370
|
}
|
|
4371
4371
|
}
|
|
4372
|
-
for (const I of A) if (I instanceof
|
|
4372
|
+
for (const I of A) if (I instanceof xI) {
|
|
4373
4373
|
const g = this._getAttribute(I, "vertex"), B = this._getAttribute(I, "fragment"), Q = this._getAttribute(I, "compute"), E = g || B || Q, i = new Wi(I.name, E?.name, I.attributes);
|
|
4374
4374
|
i.attributes = I.attributes, i.startLine = I.startLine, i.endLine = I.endLine, this.functions.push(i), this._functions.get(I.name).info = i, E && (this._functions.get(I.name).inUse = !0, i.inUse = !0, i.inputs = this._getInputs(I.args), i.outputs = this._getOutputs(I.returnType), this.entry[E.name].push(i)), i.resources = this._findResources(I, !!E), i.arguments = I.args.map((o) => new Ti(o.name, this.getTypeInfo(o.type, o.attributes), o.attributes)), i.returnType = I.returnType ? this.getTypeInfo(I.returnType, I.attributes) : null;
|
|
4375
4375
|
continue;
|
|
@@ -4446,15 +4446,15 @@ class qA {
|
|
|
4446
4446
|
_findResources(A, I) {
|
|
4447
4447
|
const g = [], B = this, Q = [];
|
|
4448
4448
|
return A.search((E) => {
|
|
4449
|
-
if (E instanceof
|
|
4450
|
-
else if (E instanceof
|
|
4449
|
+
if (E instanceof Eg) Q.push({});
|
|
4450
|
+
else if (E instanceof ig) Q.pop();
|
|
4451
4451
|
else if (E instanceof HA) {
|
|
4452
4452
|
const i = E;
|
|
4453
4453
|
I && i.type !== null && this._markStructsFromAST(i.type), Q.length > 0 && (Q[Q.length - 1][i.name] = i);
|
|
4454
4454
|
} else if (E instanceof KA) {
|
|
4455
4455
|
const i = E;
|
|
4456
4456
|
I && i.type !== null && this._markStructsFromAST(i.type);
|
|
4457
|
-
} else if (E instanceof
|
|
4457
|
+
} else if (E instanceof uI) {
|
|
4458
4458
|
const i = E;
|
|
4459
4459
|
I && i.type !== null && this._markStructsFromAST(i.type), Q.length > 0 && (Q[Q.length - 1][i.name] = i);
|
|
4460
4460
|
} else if (E instanceof wA) {
|
|
@@ -4573,11 +4573,11 @@ class qA {
|
|
|
4573
4573
|
}
|
|
4574
4574
|
getTypeInfo(A, I = null) {
|
|
4575
4575
|
if (this._types.has(A)) return this._types.get(A);
|
|
4576
|
-
if (A instanceof
|
|
4577
|
-
const B = A.type ? this.getTypeInfo(A.type, A.attributes) : null, Q = new
|
|
4576
|
+
if (A instanceof Ig) {
|
|
4577
|
+
const B = A.type ? this.getTypeInfo(A.type, A.attributes) : null, Q = new CB(A.name, B, I);
|
|
4578
4578
|
return this._types.set(A, Q), this._updateTypeInfo(Q), Q;
|
|
4579
4579
|
}
|
|
4580
|
-
if (A instanceof
|
|
4580
|
+
if (A instanceof fI) {
|
|
4581
4581
|
const B = A, Q = B.format ? this.getTypeInfo(B.format, B.attributes) : null, E = new VA(B.name, I);
|
|
4582
4582
|
return E.format = Q, E.count = B.count, this._types.set(A, E), this._updateTypeInfo(E), E;
|
|
4583
4583
|
}
|
|
@@ -4608,7 +4608,7 @@ class qA {
|
|
|
4608
4608
|
const E = this._getTypeSize(A.format);
|
|
4609
4609
|
A.stride = Math.max((g = E?.size) !== null && g !== void 0 ? g : 0, (B = E?.align) !== null && B !== void 0 ? B : 0), this._updateTypeInfo(A.format);
|
|
4610
4610
|
}
|
|
4611
|
-
A instanceof
|
|
4611
|
+
A instanceof CB && this._updateTypeInfo(A.format), A instanceof ZA && this._updateStructInfo(A);
|
|
4612
4612
|
}
|
|
4613
4613
|
_updateStructInfo(A) {
|
|
4614
4614
|
var I;
|
|
@@ -4634,20 +4634,20 @@ class qA {
|
|
|
4634
4634
|
const E = qA._typeInfo[A.name];
|
|
4635
4635
|
if (E !== void 0) {
|
|
4636
4636
|
const i = ((I = A.format) === null || I === void 0 ? void 0 : I.name) === "f16" ? 2 : 1;
|
|
4637
|
-
return new
|
|
4637
|
+
return new zI(Math.max(Q, E.align / i), Math.max(B, E.size / i));
|
|
4638
4638
|
}
|
|
4639
4639
|
}
|
|
4640
4640
|
{
|
|
4641
4641
|
const E = qA._typeInfo[A.name.substring(0, A.name.length - 1)];
|
|
4642
4642
|
if (E) {
|
|
4643
4643
|
const i = A.name[A.name.length - 1] === "h" ? 2 : 1;
|
|
4644
|
-
return new
|
|
4644
|
+
return new zI(Math.max(Q, E.align / i), Math.max(B, E.size / i));
|
|
4645
4645
|
}
|
|
4646
4646
|
}
|
|
4647
4647
|
if (A instanceof VA) {
|
|
4648
4648
|
let E = A, i = 8, o = 8;
|
|
4649
4649
|
const s = this._getTypeSize(E.format);
|
|
4650
|
-
return s !== null && (o = s.size, i = s.align), o = E.count * this._getAttributeNum((g = A?.attributes) !== null && g !== void 0 ? g : null, "stride", this._roundUp(i, o)), B && (o = B), new
|
|
4650
|
+
return s !== null && (o = s.size, i = s.align), o = E.count * this._getAttributeNum((g = A?.attributes) !== null && g !== void 0 ? g : null, "stride", this._roundUp(i, o)), B && (o = B), new zI(Math.max(Q, i), Math.max(B, o));
|
|
4651
4651
|
}
|
|
4652
4652
|
if (A instanceof ZA) {
|
|
4653
4653
|
let E = 0, i = 0, o = 0, s = 0, t = 0;
|
|
@@ -4655,7 +4655,7 @@ class qA {
|
|
|
4655
4655
|
const n = this._getTypeSize(e.type);
|
|
4656
4656
|
n !== null && (E = Math.max(n.align, E), o = this._roundUp(n.align, o + s), s = n.size, t = o);
|
|
4657
4657
|
}
|
|
4658
|
-
return i = this._roundUp(E, t + s), new
|
|
4658
|
+
return i = this._roundUp(E, t + s), new zI(Math.max(Q, E), Math.max(B, i));
|
|
4659
4659
|
}
|
|
4660
4660
|
return null;
|
|
4661
4661
|
}
|
|
@@ -5579,7 +5579,7 @@ class oo {
|
|
|
5579
5579
|
return console.error("TODO: quadSwapY"), null;
|
|
5580
5580
|
}
|
|
5581
5581
|
}
|
|
5582
|
-
const
|
|
5582
|
+
const xg = { vec2: 2, vec2f: 2, vec2i: 2, vec2u: 2, vec2b: 2, vec2h: 2, vec3: 3, vec3f: 3, vec3i: 3, vec3u: 3, vec3b: 3, vec3h: 3, vec4: 4, vec4f: 4, vec4i: 4, vec4u: 4, vec4b: 4, vec4h: 4 }, cA = { mat2x2: [2, 2, 4], mat2x2f: [2, 2, 4], mat2x2h: [2, 2, 4], mat2x3: [2, 3, 6], mat2x3f: [2, 3, 6], mat2x3h: [2, 3, 6], mat2x4: [2, 4, 8], mat2x4f: [2, 4, 8], mat2x4h: [2, 4, 8], mat3x2: [3, 2, 6], mat3x2f: [3, 2, 6], mat3x2h: [3, 2, 6], mat3x3: [3, 3, 9], mat3x3f: [3, 3, 9], mat3x3h: [3, 3, 9], mat3x4: [3, 4, 12], mat3x4f: [3, 4, 12], mat3x4h: [3, 4, 12], mat4x2: [4, 2, 8], mat4x2f: [4, 2, 8], mat4x2h: [4, 2, 8], mat4x3: [4, 3, 12], mat4x3f: [4, 3, 12], mat4x3h: [4, 3, 12], mat4x4: [4, 4, 16], mat4x4f: [4, 4, 16], mat4x4h: [4, 4, 16] };
|
|
5583
5583
|
class gA extends io {
|
|
5584
5584
|
constructor(A, I) {
|
|
5585
5585
|
var g;
|
|
@@ -5617,22 +5617,22 @@ class gA extends io {
|
|
|
5617
5617
|
e === null && console.error(`Function ${A} not found in reflection data`);
|
|
5618
5618
|
for (const n in g) for (const D in g[n]) {
|
|
5619
5619
|
const F = g[n][D];
|
|
5620
|
-
Q.variables.forEach((
|
|
5620
|
+
Q.variables.forEach((k) => {
|
|
5621
5621
|
var S;
|
|
5622
|
-
const l =
|
|
5622
|
+
const l = k.node;
|
|
5623
5623
|
if (l?.attributes) {
|
|
5624
|
-
let f = null,
|
|
5625
|
-
for (const R of l.attributes) R.name === "binding" ? f = R.value : R.name === "group" && (
|
|
5626
|
-
if (D === f && n ===
|
|
5624
|
+
let f = null, d = null;
|
|
5625
|
+
for (const R of l.attributes) R.name === "binding" ? f = R.value : R.name === "group" && (d = R.value);
|
|
5626
|
+
if (D === f && n === d) {
|
|
5627
5627
|
let R = !1;
|
|
5628
|
-
for (const L of e.resources) if (L.name ===
|
|
5628
|
+
for (const L of e.resources) if (L.name === k.name && L.group === parseInt(n) && L.binding === parseInt(D)) {
|
|
5629
5629
|
R = !0;
|
|
5630
5630
|
break;
|
|
5631
5631
|
}
|
|
5632
5632
|
if (R) if (F.texture !== void 0 && F.descriptor !== void 0) {
|
|
5633
5633
|
const L = new xA(F.texture, this.getTypeInfo(l.type), F.descriptor, (S = F.texture.view) !== null && S !== void 0 ? S : null);
|
|
5634
|
-
|
|
5635
|
-
} else F.uniform !== void 0 ?
|
|
5634
|
+
k.value = L;
|
|
5635
|
+
} else F.uniform !== void 0 ? k.value = new CA(F.uniform, this.getTypeInfo(l.type)) : k.value = new CA(F, this.getTypeInfo(l.type));
|
|
5636
5636
|
}
|
|
5637
5637
|
}
|
|
5638
5638
|
});
|
|
@@ -5650,18 +5650,18 @@ class gA extends io {
|
|
|
5650
5650
|
return gA._breakObj;
|
|
5651
5651
|
}
|
|
5652
5652
|
if (A instanceof ZQ) return gA._continueObj;
|
|
5653
|
-
if (A instanceof
|
|
5653
|
+
if (A instanceof uI) this._let(A, I);
|
|
5654
5654
|
else if (A instanceof HA) this._var(A, I);
|
|
5655
|
-
else if (A instanceof
|
|
5655
|
+
else if (A instanceof Ag) this._const(A, I);
|
|
5656
5656
|
else if (A instanceof LB) this._override(A, I);
|
|
5657
|
-
else if (A instanceof
|
|
5657
|
+
else if (A instanceof xI) this._function(A, I);
|
|
5658
5658
|
else {
|
|
5659
5659
|
if (A instanceof bQ) return this._if(A, I);
|
|
5660
5660
|
if (A instanceof xQ) return this._switch(A, I);
|
|
5661
5661
|
if (A instanceof HQ) return this._for(A, I);
|
|
5662
5662
|
if (A instanceof KQ) return this._while(A, I);
|
|
5663
5663
|
if (A instanceof mQ) return this._loop(A, I);
|
|
5664
|
-
if (A instanceof
|
|
5664
|
+
if (A instanceof QB) {
|
|
5665
5665
|
const g = I.clone();
|
|
5666
5666
|
return g.currentFunctionName = I.currentFunctionName, this._execStatements(A.body, g);
|
|
5667
5667
|
}
|
|
@@ -5716,8 +5716,8 @@ class gA extends io {
|
|
|
5716
5716
|
g.setVariable("@workgroup_size", new r(B, Q));
|
|
5717
5717
|
const i = B[0], o = B[1], s = B[2];
|
|
5718
5718
|
for (let t = 0, e = 0; t < s; ++t) for (let n = 0; n < o; ++n) for (let D = 0; D < i; ++D, ++e) {
|
|
5719
|
-
const F = [D, n, t],
|
|
5720
|
-
g.setVariable("@local_invocation_id", new r(F, Q)), g.setVariable("@global_invocation_id", new r(
|
|
5719
|
+
const F = [D, n, t], k = [D + I[0] * B[0], n + I[1] * B[1], t + I[2] * B[2]];
|
|
5720
|
+
g.setVariable("@local_invocation_id", new r(F, Q)), g.setVariable("@global_invocation_id", new r(k, Q)), g.setVariable("@local_invocation_index", new c(e, E)), this._dispatchExec(A, g);
|
|
5721
5721
|
}
|
|
5722
5722
|
}
|
|
5723
5723
|
_dispatchExec(A, I) {
|
|
@@ -5975,7 +5975,7 @@ class gA extends io {
|
|
|
5975
5975
|
} else {
|
|
5976
5976
|
if (A.type === null) return void console.error(`Variable ${A.name} has no type. Line ${A.line}`);
|
|
5977
5977
|
const B = A.type.name;
|
|
5978
|
-
if (gA._defaultableTypes.has(B) || A.type instanceof
|
|
5978
|
+
if (gA._defaultableTypes.has(B) || A.type instanceof fI || A.type instanceof mA || A.type instanceof w) {
|
|
5979
5979
|
const Q = new KA(A.type, []);
|
|
5980
5980
|
g = this._evalCreate(Q, I);
|
|
5981
5981
|
}
|
|
@@ -5988,7 +5988,7 @@ class gA extends io {
|
|
|
5988
5988
|
if (!(g instanceof c)) return console.error(`Invalid if condition. Line ${A.line}`), null;
|
|
5989
5989
|
let B = null;
|
|
5990
5990
|
for (const Q of A.cases) if (Q instanceof XQ) for (const E of Q.selectors) {
|
|
5991
|
-
if (E instanceof
|
|
5991
|
+
if (E instanceof gg) {
|
|
5992
5992
|
B = Q;
|
|
5993
5993
|
continue;
|
|
5994
5994
|
}
|
|
@@ -6085,7 +6085,7 @@ class gA extends io {
|
|
|
6085
6085
|
_evalCreate(A, I) {
|
|
6086
6086
|
var g;
|
|
6087
6087
|
if (A instanceof KA) {
|
|
6088
|
-
if (A.type === null) return
|
|
6088
|
+
if (A.type === null) return EB.void;
|
|
6089
6089
|
switch (A.type.getTypeName()) {
|
|
6090
6090
|
case "bool":
|
|
6091
6091
|
case "i32":
|
|
@@ -6267,10 +6267,10 @@ class gA extends io {
|
|
|
6267
6267
|
if (J(Q) && J(E)) {
|
|
6268
6268
|
const t = Q, e = E;
|
|
6269
6269
|
if (this._isMatrixType(g) && this._isMatrixType(B)) {
|
|
6270
|
-
const n = (function(S, l, f,
|
|
6271
|
-
if (cA[l.name] === void 0 || cA[
|
|
6272
|
-
const R = cA[l.name][0], L = cA[l.name][1], M = cA[
|
|
6273
|
-
if (R !== cA[
|
|
6270
|
+
const n = (function(S, l, f, d) {
|
|
6271
|
+
if (cA[l.name] === void 0 || cA[d.name] === void 0) return null;
|
|
6272
|
+
const R = cA[l.name][0], L = cA[l.name][1], M = cA[d.name][0];
|
|
6273
|
+
if (R !== cA[d.name][1]) return null;
|
|
6274
6274
|
const W = new Array(M * L);
|
|
6275
6275
|
for (let $ = 0; $ < L; $++) for (let BA = 0; BA < M; BA++) {
|
|
6276
6276
|
let IA = 0;
|
|
@@ -6280,36 +6280,36 @@ class gA extends io {
|
|
|
6280
6280
|
return W;
|
|
6281
6281
|
})(t, g.typeInfo, e, B.typeInfo);
|
|
6282
6282
|
if (n === null) return console.error(`Matrix multiplication failed. Line ${A.line}.`), null;
|
|
6283
|
-
const D = cA[B.typeInfo.name][0], F = cA[g.typeInfo.name][1],
|
|
6284
|
-
return new p(n,
|
|
6283
|
+
const D = cA[B.typeInfo.name][0], F = cA[g.typeInfo.name][1], k = this.getTypeInfo(`mat${D}x${F}f`);
|
|
6284
|
+
return new p(n, k);
|
|
6285
6285
|
}
|
|
6286
6286
|
if (this._isMatrixType(g) && this._isVectorType(B)) {
|
|
6287
|
-
const n = (function(D, F,
|
|
6288
|
-
if (cA[F.name] === void 0 ||
|
|
6287
|
+
const n = (function(D, F, k, S) {
|
|
6288
|
+
if (cA[F.name] === void 0 || xg[S.name] === void 0) return null;
|
|
6289
6289
|
const l = cA[F.name][0], f = cA[F.name][1];
|
|
6290
|
-
if (l !==
|
|
6291
|
-
const
|
|
6290
|
+
if (l !== k.length) return null;
|
|
6291
|
+
const d = new Array(f);
|
|
6292
6292
|
for (let R = 0; R < f; R++) {
|
|
6293
6293
|
let L = 0;
|
|
6294
|
-
for (let M = 0; M < l; M++) L += D[M * f + R] *
|
|
6295
|
-
|
|
6294
|
+
for (let M = 0; M < l; M++) L += D[M * f + R] * k[M];
|
|
6295
|
+
d[R] = L;
|
|
6296
6296
|
}
|
|
6297
|
-
return
|
|
6297
|
+
return d;
|
|
6298
6298
|
})(t, g.typeInfo, e, B.typeInfo);
|
|
6299
6299
|
return n === null ? (console.error(`Matrix vector multiplication failed. Line ${A.line}.`), null) : new r(n, B.typeInfo);
|
|
6300
6300
|
}
|
|
6301
6301
|
if (this._isVectorType(g) && this._isMatrixType(B)) {
|
|
6302
|
-
const n = (function(D, F,
|
|
6303
|
-
if (
|
|
6302
|
+
const n = (function(D, F, k, S) {
|
|
6303
|
+
if (xg[F.name] === void 0 || cA[S.name] === void 0) return null;
|
|
6304
6304
|
const l = cA[S.name][0], f = cA[S.name][1];
|
|
6305
6305
|
if (f !== D.length) return null;
|
|
6306
|
-
const
|
|
6306
|
+
const d = [];
|
|
6307
6307
|
for (let R = 0; R < l; R++) {
|
|
6308
6308
|
let L = 0;
|
|
6309
|
-
for (let M = 0; M < f; M++) L += D[M] *
|
|
6310
|
-
|
|
6309
|
+
for (let M = 0; M < f; M++) L += D[M] * k[M * l + R];
|
|
6310
|
+
d[R] = L;
|
|
6311
6311
|
}
|
|
6312
|
-
return
|
|
6312
|
+
return d;
|
|
6313
6313
|
})(t, g.typeInfo, e, B.typeInfo);
|
|
6314
6314
|
return n === null ? (console.error(`Matrix vector multiplication failed. Line ${A.line}.`), null) : new r(n, g.typeInfo);
|
|
6315
6315
|
}
|
|
@@ -6910,7 +6910,7 @@ class gA extends io {
|
|
|
6910
6910
|
return g.typeInfo = this.getTypeInfo(A.type), g.getSubData(this, A.postfix, I).clone();
|
|
6911
6911
|
}
|
|
6912
6912
|
_callConstructorVec(A, I) {
|
|
6913
|
-
const g = this.getTypeInfo(A.type), B = A.type.getTypeName(), Q =
|
|
6913
|
+
const g = this.getTypeInfo(A.type), B = A.type.getTypeName(), Q = xg[B];
|
|
6914
6914
|
if (Q === void 0) return console.error(`Invalid vec constructor ${B}. Line ${A.line}`), null;
|
|
6915
6915
|
const E = [];
|
|
6916
6916
|
if (A instanceof rA) if (A.isVector) {
|
|
@@ -6989,7 +6989,7 @@ class to {
|
|
|
6989
6989
|
this._deferArrayCountEval.length = 0;
|
|
6990
6990
|
}
|
|
6991
6991
|
if (this._forwardTypeCount > 0) for (const g of I) g.search((B) => {
|
|
6992
|
-
B instanceof SC || B instanceof
|
|
6992
|
+
B instanceof SC || B instanceof Ig ? B.type = this._forwardType(B.type) : B instanceof fI ? B.format = this._forwardType(B.format) : B instanceof HA || B instanceof uI || B instanceof Ag ? B.type = this._forwardType(B.type) : B instanceof xI ? B.returnType = this._forwardType(B.returnType) : B instanceof FC && (B.type = this._forwardType(B.type));
|
|
6993
6993
|
});
|
|
6994
6994
|
return I;
|
|
6995
6995
|
}
|
|
@@ -6997,7 +6997,7 @@ class to {
|
|
|
6997
6997
|
if (A instanceof GC) {
|
|
6998
6998
|
const I = this._getType(A.name);
|
|
6999
6999
|
if (I) return I;
|
|
7000
|
-
} else A instanceof
|
|
7000
|
+
} else A instanceof Ig ? A.type = this._forwardType(A.type) : A instanceof fI && (A.format = this._forwardType(A.format));
|
|
7001
7001
|
return A;
|
|
7002
7002
|
}
|
|
7003
7003
|
_initialize(A) {
|
|
@@ -7130,7 +7130,7 @@ class to {
|
|
|
7130
7130
|
B = this._type_decl(), B != null && (B.attributes = i);
|
|
7131
7131
|
}
|
|
7132
7132
|
const Q = this._compound_statement(), E = this._currentLine;
|
|
7133
|
-
return this._updateNode(new
|
|
7133
|
+
return this._updateNode(new xI(I, g, B, Q, A, E), A);
|
|
7134
7134
|
}
|
|
7135
7135
|
_compound_statement() {
|
|
7136
7136
|
const A = [];
|
|
@@ -7190,7 +7190,7 @@ class to {
|
|
|
7190
7190
|
const A = this._currentLoop.length > 0 ? this._currentLoop[this._currentLoop.length - 1].id : -1;
|
|
7191
7191
|
if (!this._match(a.keywords.continuing)) return null;
|
|
7192
7192
|
const I = this._currentLine, g = this._compound_statement();
|
|
7193
|
-
return this._updateNode(new
|
|
7193
|
+
return this._updateNode(new QB(g, A), I);
|
|
7194
7194
|
}
|
|
7195
7195
|
_for_statement() {
|
|
7196
7196
|
if (!this._match(a.keywords.for)) return null;
|
|
@@ -7220,7 +7220,7 @@ class to {
|
|
|
7220
7220
|
}
|
|
7221
7221
|
this._consume(a.tokens.equal, "Expected '=' for let.");
|
|
7222
7222
|
const B = this._short_circuit_or_expression();
|
|
7223
|
-
return this._updateNode(new
|
|
7223
|
+
return this._updateNode(new uI(I, g, null, null, B), A);
|
|
7224
7224
|
}
|
|
7225
7225
|
if (this._match(a.keywords.const)) {
|
|
7226
7226
|
const A = this._currentLine, I = this._consume(a.tokens.name, "Expected name for const.").toString();
|
|
@@ -7231,7 +7231,7 @@ class to {
|
|
|
7231
7231
|
}
|
|
7232
7232
|
this._consume(a.tokens.equal, "Expected '=' for const.");
|
|
7233
7233
|
const B = this._short_circuit_or_expression();
|
|
7234
|
-
return g === null && B instanceof rA && (g = B.type), this._updateNode(new
|
|
7234
|
+
return g === null && B instanceof rA && (g = B.type), this._updateNode(new Ag(I, g, null, null, B), A);
|
|
7235
7235
|
}
|
|
7236
7236
|
return null;
|
|
7237
7237
|
}
|
|
@@ -7265,7 +7265,7 @@ class to {
|
|
|
7265
7265
|
for (; I !== null; ) {
|
|
7266
7266
|
if (Array.isArray(I)) for (let g of I) A.body.push(g);
|
|
7267
7267
|
else A.body.push(I);
|
|
7268
|
-
if (I instanceof
|
|
7268
|
+
if (I instanceof QB) {
|
|
7269
7269
|
A.continuing = I;
|
|
7270
7270
|
break;
|
|
7271
7271
|
}
|
|
@@ -7285,7 +7285,7 @@ class to {
|
|
|
7285
7285
|
for (; this._check([a.keywords.default, a.keywords.case]); ) {
|
|
7286
7286
|
if (this._match(a.keywords.case)) {
|
|
7287
7287
|
const g = this._case_selectors();
|
|
7288
|
-
for (const Q of g) if (Q instanceof
|
|
7288
|
+
for (const Q of g) if (Q instanceof gg) {
|
|
7289
7289
|
if (I) throw this._error(this._previous(), "Multiple default cases in switch statement.");
|
|
7290
7290
|
I = !0;
|
|
7291
7291
|
break;
|
|
@@ -7305,7 +7305,7 @@ class to {
|
|
|
7305
7305
|
}
|
|
7306
7306
|
_case_selectors() {
|
|
7307
7307
|
const A = [];
|
|
7308
|
-
for (this._match(a.keywords.default) ? A.push(this._updateNode(new
|
|
7308
|
+
for (this._match(a.keywords.default) ? A.push(this._updateNode(new gg())) : A.push(this._shift_expression()); this._match(a.tokens.comma); ) this._match(a.keywords.default) ? A.push(this._updateNode(new gg())) : A.push(this._shift_expression());
|
|
7309
7309
|
return A;
|
|
7310
7310
|
}
|
|
7311
7311
|
_case_body() {
|
|
@@ -7661,7 +7661,7 @@ class to {
|
|
|
7661
7661
|
throw this._error(this._peek(), `Invalid cast from ${Q.type.name} to ${B.name}`);
|
|
7662
7662
|
Q.type = B, Q.isScalar && this._validateTypeRange(Q.scalarValue, Q.type);
|
|
7663
7663
|
} else B === null && Q instanceof rA && (B = (A = Q?.type) !== null && A !== void 0 ? A : N.f32, B === N.x32 && (B = N.i32));
|
|
7664
|
-
const i = this._updateNode(new
|
|
7664
|
+
const i = this._updateNode(new Ag(I.toString(), B, "", "", Q), g);
|
|
7665
7665
|
return this._context.constants.set(i.name, i), i;
|
|
7666
7666
|
}
|
|
7667
7667
|
_global_let_decl() {
|
|
@@ -7678,7 +7678,7 @@ class to {
|
|
|
7678
7678
|
throw this._error(this._peek(), `Invalid cast from ${B.type.name} to ${g.name}`);
|
|
7679
7679
|
B.type = g;
|
|
7680
7680
|
} else g === null && B instanceof rA && (g = B.type.name === "x32" ? N.i32 : B.type);
|
|
7681
|
-
return B instanceof rA && B.isScalar && this._validateTypeRange(B.scalarValue, g), this._updateNode(new
|
|
7681
|
+
return B instanceof rA && B.isScalar && this._validateTypeRange(B.scalarValue, g), this._updateNode(new uI(I.toString(), g, "", "", B), A);
|
|
7682
7682
|
}
|
|
7683
7683
|
_const_expression() {
|
|
7684
7684
|
return this._short_circuit_or_expression();
|
|
@@ -7759,7 +7759,7 @@ class to {
|
|
|
7759
7759
|
this._consume(a.tokens.comma, "Expected ',' for pointer.");
|
|
7760
7760
|
const o = this._type_decl();
|
|
7761
7761
|
let s = null;
|
|
7762
|
-
return this._match(a.tokens.comma) && (s = this._consume(a.access_mode, "Expected access_mode for pointer").toString()), this._consume(a.tokens.greater_than, "Expected '>' for pointer."), this._updateNode(new
|
|
7762
|
+
return this._match(a.tokens.comma) && (s = this._consume(a.access_mode, "Expected access_mode for pointer").toString()), this._consume(a.tokens.greater_than, "Expected '>' for pointer."), this._updateNode(new Ig(E, i.toString(), o, s));
|
|
7763
7763
|
}
|
|
7764
7764
|
const Q = this._attribute();
|
|
7765
7765
|
if (this._match(a.keywords.array)) {
|
|
@@ -7779,7 +7779,7 @@ class to {
|
|
|
7779
7779
|
}
|
|
7780
7780
|
this._consume(a.tokens.greater_than, "Expected '>' for array."), i = e ? parseInt(e) : 0;
|
|
7781
7781
|
}
|
|
7782
|
-
const t = this._updateNode(new
|
|
7782
|
+
const t = this._updateNode(new fI(o.toString(), Q, E, i));
|
|
7783
7783
|
return s && this._deferArrayCountEval.push({ arrayType: t, countNode: s }), t;
|
|
7784
7784
|
}
|
|
7785
7785
|
return null;
|
|
@@ -7839,16 +7839,16 @@ function ao(C, A, I) {
|
|
|
7839
7839
|
}
|
|
7840
7840
|
return Object.values(C.entryPoints).filter((B) => B.stage === I)[0];
|
|
7841
7841
|
}
|
|
7842
|
-
function
|
|
7842
|
+
function bg(C, A, I) {
|
|
7843
7843
|
return A ? ao(C, A, I)?.resources || [] : [];
|
|
7844
7844
|
}
|
|
7845
7845
|
const no = (C, A) => Math.sign(C.binding - A.binding);
|
|
7846
7846
|
function ro(C, A) {
|
|
7847
7847
|
C = Array.isArray(C) ? C : [C];
|
|
7848
7848
|
const I = [
|
|
7849
|
-
...
|
|
7850
|
-
...
|
|
7851
|
-
...
|
|
7849
|
+
...bg(C[0], A.vertex, GPUShaderStage.VERTEX),
|
|
7850
|
+
...bg(C[C.length - 1], A.fragment, GPUShaderStage.FRAGMENT),
|
|
7851
|
+
...bg(C[0], A.compute, GPUShaderStage.COMPUTE)
|
|
7852
7852
|
], g = [];
|
|
7853
7853
|
for (const Q of I) {
|
|
7854
7854
|
const E = g[Q.group] || /* @__PURE__ */ new Map();
|
|
@@ -7902,7 +7902,7 @@ function Do(C) {
|
|
|
7902
7902
|
throw new Error("unknown texture sample type");
|
|
7903
7903
|
}
|
|
7904
7904
|
}
|
|
7905
|
-
function
|
|
7905
|
+
function dC(C) {
|
|
7906
7906
|
return C.name.includes("2d_array") ? "2d-array" : C.name.includes("cube_array") ? "cube-array" : C.name.includes("3d") ? "3d" : C.name.includes("1d") ? "1d" : C.name.includes("cube") ? "cube" : "2d";
|
|
7907
7907
|
}
|
|
7908
7908
|
function ho(C) {
|
|
@@ -7953,7 +7953,7 @@ function co(C, A) {
|
|
|
7953
7953
|
visibility: A,
|
|
7954
7954
|
texture: {
|
|
7955
7955
|
sampleType: Do(B),
|
|
7956
|
-
viewDimension:
|
|
7956
|
+
viewDimension: dC(B),
|
|
7957
7957
|
multisampled: Q
|
|
7958
7958
|
}
|
|
7959
7959
|
};
|
|
@@ -7973,14 +7973,14 @@ function co(C, A) {
|
|
|
7973
7973
|
storageTexture: {
|
|
7974
7974
|
access: ho(B),
|
|
7975
7975
|
format: B.format.name,
|
|
7976
|
-
viewDimension:
|
|
7976
|
+
viewDimension: dC(B)
|
|
7977
7977
|
}
|
|
7978
7978
|
};
|
|
7979
7979
|
default:
|
|
7980
7980
|
throw new Error("unknown resource type");
|
|
7981
7981
|
}
|
|
7982
7982
|
}
|
|
7983
|
-
function
|
|
7983
|
+
function Tg(C, A) {
|
|
7984
7984
|
const I = {};
|
|
7985
7985
|
for (const g of C)
|
|
7986
7986
|
I[g.name] = {
|
|
@@ -7998,9 +7998,9 @@ function bg(C, A) {
|
|
|
7998
7998
|
}
|
|
7999
7999
|
function wo(C) {
|
|
8000
8000
|
const A = new eo(C), I = Object.fromEntries(A.structs.map((e) => [e.name, $Q(A, e, 0)])), g = zA(A, A.uniforms), B = zA(A, A.immediates), Q = zA(A, A.storage.filter((e) => e.resourceType === sA.Storage)), E = zA(A, A.storage.filter((e) => e.resourceType === sA.StorageTexture)), i = zA(A, A.textures.filter((e) => e.type.name !== "texture_external")), o = zA(A, A.textures.filter((e) => e.type.name === "texture_external")), s = zA(A, A.samplers), t = {
|
|
8001
|
-
...
|
|
8002
|
-
...
|
|
8003
|
-
...
|
|
8001
|
+
...Tg(A.entry.vertex, GPUShaderStage.VERTEX),
|
|
8002
|
+
...Tg(A.entry.fragment, GPUShaderStage.FRAGMENT),
|
|
8003
|
+
...Tg(A.entry.compute, GPUShaderStage.COMPUTE)
|
|
8004
8004
|
};
|
|
8005
8005
|
return {
|
|
8006
8006
|
externalTextures: o,
|
|
@@ -8014,7 +8014,7 @@ function wo(C) {
|
|
|
8014
8014
|
entryPoints: t
|
|
8015
8015
|
};
|
|
8016
8016
|
}
|
|
8017
|
-
function
|
|
8017
|
+
function Wg(C, A = "") {
|
|
8018
8018
|
if (!C)
|
|
8019
8019
|
throw new Error(A);
|
|
8020
8020
|
}
|
|
@@ -8034,7 +8034,7 @@ function Go(C, A, I) {
|
|
|
8034
8034
|
}
|
|
8035
8035
|
function qB(C, A, I) {
|
|
8036
8036
|
if (A.isArray) {
|
|
8037
|
-
|
|
8037
|
+
Wg(!A.isStruct, "struct array is invalid"), Wg(!A.isStruct, "template array is invalid");
|
|
8038
8038
|
const g = A;
|
|
8039
8039
|
return {
|
|
8040
8040
|
size: g.size,
|
|
@@ -8043,7 +8043,7 @@ function qB(C, A, I) {
|
|
|
8043
8043
|
};
|
|
8044
8044
|
} else {
|
|
8045
8045
|
if (A.isStruct)
|
|
8046
|
-
return
|
|
8046
|
+
return Wg(!A.isTemplate, "template struct is invalid"), $Q(C, A, I);
|
|
8047
8047
|
{
|
|
8048
8048
|
const g = A, B = A.isTemplate ? `${g.name}<${g.format.name}>` : A.name;
|
|
8049
8049
|
return {
|
|
@@ -8646,7 +8646,7 @@ function Ho(C) {
|
|
|
8646
8646
|
return "image_scalar_u32";
|
|
8647
8647
|
}
|
|
8648
8648
|
}
|
|
8649
|
-
function
|
|
8649
|
+
function JI(C, A) {
|
|
8650
8650
|
const I = C.priority ?? Number.MAX_SAFE_INTEGER, g = A.priority ?? Number.MAX_SAFE_INTEGER;
|
|
8651
8651
|
return I === g ? (C.orderKey ?? Number.MAX_SAFE_INTEGER) - (A.orderKey ?? Number.MAX_SAFE_INTEGER) : I - g;
|
|
8652
8652
|
}
|
|
@@ -8680,7 +8680,7 @@ class qo {
|
|
|
8680
8680
|
}
|
|
8681
8681
|
pump() {
|
|
8682
8682
|
if (!(this.running_.size >= this.maxConcurrent_ || this.pending_.length === 0))
|
|
8683
|
-
for (this.pending_.sort((A, I) =>
|
|
8683
|
+
for (this.pending_.sort((A, I) => JI(A.chunk, I.chunk)); this.running_.size < this.maxConcurrent_ && this.pending_.length > 0; )
|
|
8684
8684
|
this.start(this.pending_.shift());
|
|
8685
8685
|
}
|
|
8686
8686
|
start(A) {
|
|
@@ -8699,15 +8699,15 @@ class qo {
|
|
|
8699
8699
|
this.running_.set(I, { controller: B, promise: Q });
|
|
8700
8700
|
}
|
|
8701
8701
|
}
|
|
8702
|
-
let
|
|
8702
|
+
let eg = 0, ag = 0;
|
|
8703
8703
|
function po(C, A) {
|
|
8704
|
-
C.data && (
|
|
8704
|
+
C.data && (eg -= C.data.byteLength, ag -= 1), C.data = A, eg += A.byteLength, ag += 1;
|
|
8705
8705
|
}
|
|
8706
|
-
function
|
|
8707
|
-
C.data && (
|
|
8706
|
+
function UC(C) {
|
|
8707
|
+
C.data && (eg -= C.data.byteLength, ag -= 1), C.data = void 0, C.texture?.releaseCpuData();
|
|
8708
8708
|
}
|
|
8709
8709
|
function mo() {
|
|
8710
|
-
return { cpuChunkBytes:
|
|
8710
|
+
return { cpuChunkBytes: eg, cpuChunkCount: ag };
|
|
8711
8711
|
}
|
|
8712
8712
|
function lC(C, A, I = 1e-6) {
|
|
8713
8713
|
return Math.abs(C - A) <= I;
|
|
@@ -8736,7 +8736,7 @@ function bo(C, A) {
|
|
|
8736
8736
|
function TA(C, A, I) {
|
|
8737
8737
|
return Math.max(A, Math.min(I, C));
|
|
8738
8738
|
}
|
|
8739
|
-
const
|
|
8739
|
+
const lg = Symbol("INTERNAL_POLICY_KEY");
|
|
8740
8740
|
class To {
|
|
8741
8741
|
store_;
|
|
8742
8742
|
policy_;
|
|
@@ -8789,28 +8789,28 @@ class To {
|
|
|
8789
8789
|
H.warn(
|
|
8790
8790
|
"ChunkStoreView",
|
|
8791
8791
|
"updateChunkViewStates called with no chunks initialized"
|
|
8792
|
-
), this.chunkViewStates_.forEach(
|
|
8792
|
+
), this.chunkViewStates_.forEach(UI);
|
|
8793
8793
|
return;
|
|
8794
8794
|
}
|
|
8795
|
-
const t =
|
|
8795
|
+
const t = dQ();
|
|
8796
8796
|
ni(t, g.min, g.max, 0.5);
|
|
8797
8797
|
const [e, n] = this.getZBounds(A), D = new AI(
|
|
8798
8798
|
P(g.min[0], g.min[1], e),
|
|
8799
8799
|
P(g.max[0], g.max[1], n)
|
|
8800
8800
|
);
|
|
8801
|
-
this.chunkViewStates_.forEach(
|
|
8802
|
-
const F = this.channelsOfInterest(A),
|
|
8801
|
+
this.chunkViewStates_.forEach(UI);
|
|
8802
|
+
const F = this.channelsOfInterest(A), k = this.fallbackLOD(), S = this.getPaddedBounds(D), l = this.currentLOD_ === k ? [this.currentLOD_] : [this.currentLOD_, k];
|
|
8803
8803
|
for (const f of l) {
|
|
8804
|
-
const
|
|
8804
|
+
const d = f === this.currentLOD_, R = f === k;
|
|
8805
8805
|
this.iterateChunksInBox(
|
|
8806
8806
|
s,
|
|
8807
8807
|
f,
|
|
8808
8808
|
F,
|
|
8809
8809
|
S,
|
|
8810
8810
|
(L, M) => {
|
|
8811
|
-
const W = AI.intersects(M, D), $ =
|
|
8811
|
+
const W = AI.intersects(M, D), $ = d && !W, BA = this.computePriority(
|
|
8812
8812
|
R,
|
|
8813
|
-
|
|
8813
|
+
d,
|
|
8814
8814
|
W,
|
|
8815
8815
|
$,
|
|
8816
8816
|
!0
|
|
@@ -8838,10 +8838,10 @@ class To {
|
|
|
8838
8838
|
H.warn(
|
|
8839
8839
|
"ChunkStoreView",
|
|
8840
8840
|
"updateChunksForVolume called with no chunks initialized"
|
|
8841
|
-
), this.chunkViewStates_.forEach(
|
|
8841
|
+
), this.chunkViewStates_.forEach(UI);
|
|
8842
8842
|
return;
|
|
8843
8843
|
}
|
|
8844
|
-
this.currentLOD_ = this.policy_.lod.min, this.chunkViewStates_.forEach(
|
|
8844
|
+
this.currentLOD_ = this.policy_.lod.min, this.chunkViewStates_.forEach(UI);
|
|
8845
8845
|
const Q = this.channelsOfInterest(A), E = this.fallbackLOD(), i = (o) => {
|
|
8846
8846
|
const s = o.lod === E, t = o.lod === this.currentLOD_, e = this.computePriority(
|
|
8847
8847
|
s,
|
|
@@ -8873,7 +8873,7 @@ class To {
|
|
|
8873
8873
|
const A = this.fallbackLOD();
|
|
8874
8874
|
let I = !1;
|
|
8875
8875
|
for (const [g, B] of this.chunkViewStates_)
|
|
8876
|
-
if (!(!B.visible || g.lod !== A) && (I = !0, g.
|
|
8876
|
+
if (!(!B.visible || g.lod !== A) && (I = !0, g.texture === void 0))
|
|
8877
8877
|
return !1;
|
|
8878
8878
|
return I;
|
|
8879
8879
|
}
|
|
@@ -8885,10 +8885,10 @@ class To {
|
|
|
8885
8885
|
I && (I.visible || I.prefetch || I.priority !== null) || this.chunkViewStates_.delete(A);
|
|
8886
8886
|
}
|
|
8887
8887
|
dispose() {
|
|
8888
|
-
this.isDisposed_ = !0, this.chunkViewStates_.forEach(
|
|
8888
|
+
this.isDisposed_ = !0, this.chunkViewStates_.forEach(UI);
|
|
8889
8889
|
}
|
|
8890
8890
|
setImageSourcePolicy(A, I) {
|
|
8891
|
-
if (I !==
|
|
8891
|
+
if (I !== lg)
|
|
8892
8892
|
throw new Error("Unauthorized policy mutation");
|
|
8893
8893
|
this.policy_ !== A && (this.policy_ = A, this.policyChanged_ = !0, H.info(
|
|
8894
8894
|
"ChunkStoreView",
|
|
@@ -8907,49 +8907,47 @@ class To {
|
|
|
8907
8907
|
t !== this.currentLOD_ && (this.currentLOD_ = t);
|
|
8908
8908
|
}
|
|
8909
8909
|
markTimeChunksForPrefetchImage(A, I, g, B) {
|
|
8910
|
-
const Q = this.store_.dimensions.t?.lods[0].size ?? 1, E = Math.min(
|
|
8911
|
-
|
|
8912
|
-
A +
|
|
8913
|
-
), i = this.fallbackLOD(), o = this.policy_.priorityMap.prefetchTime, s = this.channelsOfInterest(I);
|
|
8914
|
-
for (let t = A + 1; t <= E; ++t)
|
|
8910
|
+
const Q = this.store_.dimensions.t?.lods[0].size ?? 1, E = Math.min(this.policy_.prefetch.t, Q - 1), i = this.fallbackLOD(), o = this.policy_.priorityMap.prefetchTime, s = this.channelsOfInterest(I);
|
|
8911
|
+
for (let t = 1; t <= E; ++t) {
|
|
8912
|
+
const e = (A + t) % Q;
|
|
8915
8913
|
this.iterateChunksInBox(
|
|
8916
|
-
|
|
8914
|
+
e,
|
|
8917
8915
|
i,
|
|
8918
8916
|
s,
|
|
8919
8917
|
g,
|
|
8920
|
-
(
|
|
8921
|
-
const
|
|
8922
|
-
|
|
8918
|
+
(n) => {
|
|
8919
|
+
const D = this.squareDistance2D(
|
|
8920
|
+
n,
|
|
8923
8921
|
B
|
|
8924
|
-
),
|
|
8925
|
-
|
|
8922
|
+
), F = TA(
|
|
8923
|
+
D / this.sourceMaxSquareDistance2D_,
|
|
8926
8924
|
0,
|
|
8927
8925
|
1 - Number.EPSILON
|
|
8928
|
-
),
|
|
8929
|
-
this.chunkViewStates_.set(
|
|
8926
|
+
), k = t + F;
|
|
8927
|
+
this.chunkViewStates_.set(n, {
|
|
8930
8928
|
visible: !1,
|
|
8931
8929
|
prefetch: !0,
|
|
8932
8930
|
priority: o,
|
|
8933
|
-
orderKey:
|
|
8931
|
+
orderKey: k
|
|
8934
8932
|
});
|
|
8935
8933
|
}
|
|
8936
8934
|
);
|
|
8935
|
+
}
|
|
8937
8936
|
}
|
|
8938
8937
|
markTimeChunksForPrefetchVolume(A, I) {
|
|
8939
|
-
const g = this.store_.dimensions.t?.lods[0].size ?? 1, B = Math.min(
|
|
8940
|
-
|
|
8941
|
-
A +
|
|
8942
|
-
|
|
8943
|
-
|
|
8944
|
-
|
|
8945
|
-
const t = o - A;
|
|
8946
|
-
this.chunkViewStates_.set(s, {
|
|
8938
|
+
const g = this.store_.dimensions.t?.lods[0].size ?? 1, B = Math.min(this.policy_.prefetch.t, g - 1), Q = this.fallbackLOD(), E = this.policy_.priorityMap.prefetchTime, i = this.channelsOfInterest(I);
|
|
8939
|
+
for (let o = 1; o <= B; ++o) {
|
|
8940
|
+
const s = (A + o) % g;
|
|
8941
|
+
this.iterateAllChunksAtLod(s, Q, i, (t) => {
|
|
8942
|
+
const e = o;
|
|
8943
|
+
this.chunkViewStates_.set(t, {
|
|
8947
8944
|
visible: !1,
|
|
8948
8945
|
prefetch: !0,
|
|
8949
8946
|
priority: E,
|
|
8950
|
-
orderKey:
|
|
8947
|
+
orderKey: e
|
|
8951
8948
|
});
|
|
8952
8949
|
});
|
|
8950
|
+
}
|
|
8953
8951
|
}
|
|
8954
8952
|
computePriority(A, I, g, B, Q) {
|
|
8955
8953
|
if (!Q) return null;
|
|
@@ -8962,8 +8960,8 @@ class To {
|
|
|
8962
8960
|
// Half-open chunk-index range [min, max) at a given LOD that covers `bounds`.
|
|
8963
8961
|
// Returns null if the bounds don't overlap the data grid.
|
|
8964
8962
|
chunkIndexRange(A, I) {
|
|
8965
|
-
const g = this.store_.dimensions, B = g.x.lods[I], Q = g.y.lods[I], E = g.z?.lods[I], i = Math.ceil(B.size / B.chunkSize), o = Math.ceil(Q.size / Q.chunkSize), s = E ? Math.ceil(E.size / E.chunkSize) : 1, t = B.chunkSize * B.scale, e = Q.chunkSize * Q.scale, n = E ? E.chunkSize * E.scale : 1, D = B.translation, F = Q.translation,
|
|
8966
|
-
return S >= l || f >=
|
|
8963
|
+
const g = this.store_.dimensions, B = g.x.lods[I], Q = g.y.lods[I], E = g.z?.lods[I], i = Math.ceil(B.size / B.chunkSize), o = Math.ceil(Q.size / Q.chunkSize), s = E ? Math.ceil(E.size / E.chunkSize) : 1, t = B.chunkSize * B.scale, e = Q.chunkSize * Q.scale, n = E ? E.chunkSize * E.scale : 1, D = B.translation, F = Q.translation, k = E?.translation ?? 0, S = Math.max(0, Math.floor((A.min[0] - D) / t)), l = Math.min(i, Math.ceil((A.max[0] - D) / t)), f = Math.max(0, Math.floor((A.min[1] - F) / e)), d = Math.min(o, Math.ceil((A.max[1] - F) / e)), R = E ? Math.max(0, Math.floor((A.min[2] - k) / n)) : 0, L = E ? Math.min(s, Math.ceil((A.max[2] - k) / n)) : 1;
|
|
8964
|
+
return S >= l || f >= d || R >= L ? null : { xMin: S, xMax: l, yMin: f, yMax: d, zMin: R, zMax: L };
|
|
8967
8965
|
}
|
|
8968
8966
|
iterateChunksInBox(A, I, g, B, Q) {
|
|
8969
8967
|
const E = this.chunkIndexRange(B, I);
|
|
@@ -9030,13 +9028,13 @@ class To {
|
|
|
9030
9028
|
];
|
|
9031
9029
|
}
|
|
9032
9030
|
viewBounds2DChanged(A) {
|
|
9033
|
-
return this.lastViewBounds2D_ === null || !
|
|
9031
|
+
return this.lastViewBounds2D_ === null || !pg(this.lastViewBounds2D_.min, A.min) || !pg(this.lastViewBounds2D_.max, A.max);
|
|
9034
9032
|
}
|
|
9035
9033
|
hasViewProjectionChanged(A) {
|
|
9036
9034
|
return this.lastViewProjection_ === null || !jE(this.lastViewProjection_, A);
|
|
9037
9035
|
}
|
|
9038
9036
|
zBoundsChanged(A) {
|
|
9039
|
-
return !this.lastZBounds_ || !
|
|
9037
|
+
return !this.lastZBounds_ || !pg(this.lastZBounds_, A);
|
|
9040
9038
|
}
|
|
9041
9039
|
cCoordsChanged(A) {
|
|
9042
9040
|
return !this.lastCCoords_ && !A ? !1 : !this.lastCCoords_ || !A || this.lastCCoords_.length !== A.length ? !0 : !this.lastCCoords_.every((I, g) => I === A[g]);
|
|
@@ -9065,7 +9063,7 @@ class To {
|
|
|
9065
9063
|
return B * B + Q * Q;
|
|
9066
9064
|
}
|
|
9067
9065
|
}
|
|
9068
|
-
function
|
|
9066
|
+
function UI(C) {
|
|
9069
9067
|
C.visible = !1, C.prefetch = !1, C.priority = null, C.orderKey = null;
|
|
9070
9068
|
}
|
|
9071
9069
|
class Wo {
|
|
@@ -9080,17 +9078,17 @@ class Wo {
|
|
|
9080
9078
|
const { size: I } = this.getAndValidateTimeDimension(), { size: g } = this.getAndValidateChannelDimension(), B = this.dimensions_.numLods;
|
|
9081
9079
|
this.chunks_ = new Array(B);
|
|
9082
9080
|
for (let Q = 0; Q < B; ++Q) {
|
|
9083
|
-
const E = this.dimensions_.x.lods[Q], i = this.dimensions_.y.lods[Q], o = this.dimensions_.z?.lods[Q], s = E.chunkSize, t = i.chunkSize, e = o?.chunkSize ?? 1, n = Math.ceil(E.size / s), D = Math.ceil(i.size / t), F = o ? Math.ceil(o.size / e) : 1,
|
|
9084
|
-
this.chunks_[Q] =
|
|
9081
|
+
const E = this.dimensions_.x.lods[Q], i = this.dimensions_.y.lods[Q], o = this.dimensions_.z?.lods[Q], s = E.chunkSize, t = i.chunkSize, e = o?.chunkSize ?? 1, n = Math.ceil(E.size / s), D = Math.ceil(i.size / t), F = o ? Math.ceil(o.size / e) : 1, k = new Array(I);
|
|
9082
|
+
this.chunks_[Q] = k;
|
|
9085
9083
|
for (let S = 0; S < I; ++S) {
|
|
9086
9084
|
const l = new Array(g);
|
|
9087
|
-
|
|
9085
|
+
k[S] = l;
|
|
9088
9086
|
for (let f = 0; f < g; ++f) {
|
|
9089
|
-
const
|
|
9090
|
-
l[f] =
|
|
9087
|
+
const d = new Array(F);
|
|
9088
|
+
l[f] = d;
|
|
9091
9089
|
for (let R = 0; R < F; ++R) {
|
|
9092
9090
|
const L = o !== void 0 ? o.translation + R * e * o.scale : 0, M = new Array(D);
|
|
9093
|
-
|
|
9091
|
+
d[R] = M;
|
|
9094
9092
|
for (let W = 0; W < D; ++W) {
|
|
9095
9093
|
const $ = i.translation + W * t * i.scale, BA = new Array(n);
|
|
9096
9094
|
M[W] = BA;
|
|
@@ -9172,28 +9170,15 @@ class Wo {
|
|
|
9172
9170
|
}
|
|
9173
9171
|
aggregateChunkViewStates(A) {
|
|
9174
9172
|
let I = !1, g = !1, B = null, Q = null;
|
|
9175
|
-
for (const
|
|
9176
|
-
const
|
|
9177
|
-
|
|
9173
|
+
for (const o of this.views_) {
|
|
9174
|
+
const s = o.chunkViewStates.get(A);
|
|
9175
|
+
s && (s.visible && (I = !0), s.prefetch && (g = !0), s.priority !== null && (B === null || s.priority < B) && (B = s.priority, Q = s.orderKey), !s.visible && !s.prefetch && s.priority === null && o.maybeForgetChunk(A));
|
|
9178
9176
|
}
|
|
9179
9177
|
if (A.visible = I, A.prefetch = g, A.priority = B, A.orderKey = Q, A.priority !== null && A.state === "unloaded") {
|
|
9180
9178
|
A.state = "queued";
|
|
9181
9179
|
return;
|
|
9182
9180
|
}
|
|
9183
|
-
|
|
9184
|
-
A.state = "unloaded";
|
|
9185
|
-
return;
|
|
9186
|
-
}
|
|
9187
|
-
if (A.state === "loaded" && A.priority === null) {
|
|
9188
|
-
if (A.visible || A.prefetch)
|
|
9189
|
-
throw new Error(
|
|
9190
|
-
`Chunk state inconsistency detected: priority is null but visible=${A.visible} or prefetch=${A.prefetch} for chunk ${JSON.stringify(A.chunkIndex)} in LOD ${A.lod}`
|
|
9191
|
-
);
|
|
9192
|
-
A.state = "unloaded", A.orderKey = null, H.debug(
|
|
9193
|
-
"ChunkStore",
|
|
9194
|
-
`Disposing chunk ${JSON.stringify(A.chunkIndex)} in LOD ${A.lod}`
|
|
9195
|
-
);
|
|
9196
|
-
}
|
|
9181
|
+
A.priority === null && A.state === "queued" && (A.state = "unloaded");
|
|
9197
9182
|
}
|
|
9198
9183
|
validateXYScaleRatios() {
|
|
9199
9184
|
const A = this.dimensions_.x, I = this.dimensions_.y;
|
|
@@ -9250,6 +9235,7 @@ class Po {
|
|
|
9250
9235
|
getGpuResidentBytes_;
|
|
9251
9236
|
memoryLimitBytes_;
|
|
9252
9237
|
maxGpuUploadsPerUpdate_;
|
|
9238
|
+
resident_ = /* @__PURE__ */ new Set();
|
|
9253
9239
|
constructor(A, I, g = () => 0, B = 1 / 0, Q = vo, E = Zo) {
|
|
9254
9240
|
this.uploadTexture_ = A, this.disposeTexture_ = I, this.getGpuResidentBytes_ = g, this.memoryLimitBytes_ = B, this.maxGpuUploadsPerUpdate_ = Math.max(1, E), this.queue_ = new qo(Q);
|
|
9255
9241
|
}
|
|
@@ -9274,25 +9260,53 @@ class Po {
|
|
|
9274
9260
|
for (const { source: I, store: g } of this.stores_) {
|
|
9275
9261
|
const B = g.updateAndCollectChunkChanges();
|
|
9276
9262
|
for (const Q of B)
|
|
9277
|
-
Q.priority === null ?
|
|
9263
|
+
Q.priority === null ? this.releaseChunk(Q) : (Q.releasedAt = void 0, Q.state === "queued" && A.push({ source: I, chunk: Q }));
|
|
9278
9264
|
this.uploadLoadedChunks(B);
|
|
9279
9265
|
}
|
|
9280
9266
|
this.enqueueWithinBudget(A), this.queue_.flush();
|
|
9281
9267
|
for (let I = this.stores_.length - 1; I >= 0; I--)
|
|
9282
9268
|
this.stores_[I].store.canDispose() && this.stores_.splice(I, 1);
|
|
9283
9269
|
}
|
|
9270
|
+
releaseChunk(A) {
|
|
9271
|
+
if (this.queue_.cancel(A), A.texture !== void 0) {
|
|
9272
|
+
A.releasedAt ??= performance.now();
|
|
9273
|
+
return;
|
|
9274
|
+
}
|
|
9275
|
+
UC(A), A.state === "loaded" && (A.state = "unloaded");
|
|
9276
|
+
}
|
|
9284
9277
|
enqueueWithinBudget(A) {
|
|
9285
9278
|
if (A.length === 0) return;
|
|
9286
|
-
A.sort((
|
|
9287
|
-
let I = this.getGpuResidentBytes_();
|
|
9288
|
-
for (const { source:
|
|
9289
|
-
const
|
|
9290
|
-
I +
|
|
9291
|
-
|
|
9292
|
-
|
|
9293
|
-
|
|
9279
|
+
A.sort((B, Q) => JI(B.chunk, Q.chunk));
|
|
9280
|
+
let I = this.getGpuResidentBytes_(), g = null;
|
|
9281
|
+
for (const { source: B, chunk: Q } of A) {
|
|
9282
|
+
const E = this.chunkBytes(B, Q);
|
|
9283
|
+
E > this.memoryLimitBytes_ || (I + E > this.memoryLimitBytes_ && (g ??= this.evictionCandidates(), I = this.evictWorseChunks(
|
|
9284
|
+
I,
|
|
9285
|
+
E,
|
|
9286
|
+
Q,
|
|
9287
|
+
g
|
|
9288
|
+
)), !(I + E > this.memoryLimitBytes_) && (I += E, this.queue_.enqueue(
|
|
9289
|
+
Q,
|
|
9290
|
+
(i) => B.loader.loadChunkData(Q, i)
|
|
9291
|
+
)));
|
|
9294
9292
|
}
|
|
9295
9293
|
}
|
|
9294
|
+
evictionCandidates() {
|
|
9295
|
+
const A = [];
|
|
9296
|
+
for (const I of this.resident_)
|
|
9297
|
+
I.visible || A.push(I);
|
|
9298
|
+
return A.sort((I, g) => {
|
|
9299
|
+
const B = -JI(I, g);
|
|
9300
|
+
return B !== 0 ? B : (I.releasedAt ?? 0) - (g.releasedAt ?? 0);
|
|
9301
|
+
});
|
|
9302
|
+
}
|
|
9303
|
+
evictWorseChunks(A, I, g, B) {
|
|
9304
|
+
for (; A + I > this.memoryLimitBytes_ && B.length > 0 && JI(B[0], g) > 0; ) {
|
|
9305
|
+
const Q = B.shift();
|
|
9306
|
+
Q.texture !== void 0 && (A -= mI(Q.texture), this.disposeChunkTexture(Q), Q.state = "unloaded", Q.releasedAt = void 0);
|
|
9307
|
+
}
|
|
9308
|
+
return A;
|
|
9309
|
+
}
|
|
9296
9310
|
chunkBytes(A, I) {
|
|
9297
9311
|
const g = A.loader.getBytesPerElement();
|
|
9298
9312
|
return I.shape.x * I.shape.y * I.shape.z * g;
|
|
@@ -9303,18 +9317,18 @@ class Po {
|
|
|
9303
9317
|
for (const B of A)
|
|
9304
9318
|
B.state === "loaded" && B.texture === void 0 && I.push(B);
|
|
9305
9319
|
if (I.length === 0) return;
|
|
9306
|
-
I.sort(
|
|
9320
|
+
I.sort(JI);
|
|
9307
9321
|
const g = Math.min(I.length, this.maxGpuUploadsPerUpdate_);
|
|
9308
9322
|
for (let B = 0; B < g; B++) {
|
|
9309
|
-
const Q = I[B], E =
|
|
9310
|
-
this.uploadTexture_(E), Q.texture = E,
|
|
9323
|
+
const Q = I[B], E = vI.createWithChunk(Q);
|
|
9324
|
+
this.uploadTexture_(E), Q.texture = E, this.resident_.add(Q), UC(Q);
|
|
9311
9325
|
}
|
|
9312
9326
|
}
|
|
9313
9327
|
disposeChunkTexture(A) {
|
|
9314
|
-
this.disposeTexture_ && A.texture !== void 0 && (this.disposeTexture_(A.texture), A.texture = void 0);
|
|
9328
|
+
this.disposeTexture_ && A.texture !== void 0 && (this.disposeTexture_(A.texture), A.texture = void 0, this.resident_.delete(A));
|
|
9315
9329
|
}
|
|
9316
9330
|
}
|
|
9317
|
-
var
|
|
9331
|
+
var KI = function(C = 1) {
|
|
9318
9332
|
var A = 0, I = document.createElement("div");
|
|
9319
9333
|
I.style.cssText = "position:fixed;top:0;left:0;cursor:pointer;opacity:0.9;z-index:10000", I.addEventListener("click", function(e) {
|
|
9320
9334
|
e.preventDefault(), B(++A % I.children.length);
|
|
@@ -9327,9 +9341,9 @@ var fI = function(C = 1) {
|
|
|
9327
9341
|
I.children[n].style.display = n === e ? "block" : "none";
|
|
9328
9342
|
A = e;
|
|
9329
9343
|
}
|
|
9330
|
-
var Q = (performance || Date).now(), E = Q, i = 0, o = g(new
|
|
9344
|
+
var Q = (performance || Date).now(), E = Q, i = 0, o = g(new KI.Panel("FPS", "#0ff", "#002", C)), s = g(new KI.Panel("MS", "#0f0", "#020", C));
|
|
9331
9345
|
if (self.performance && self.performance.memory)
|
|
9332
|
-
var t = g(new
|
|
9346
|
+
var t = g(new KI.Panel("MB", "#f08", "#201", C));
|
|
9333
9347
|
return B(0), {
|
|
9334
9348
|
REVISION: 16,
|
|
9335
9349
|
dom: I,
|
|
@@ -9355,19 +9369,19 @@ var fI = function(C = 1) {
|
|
|
9355
9369
|
setMode: B
|
|
9356
9370
|
};
|
|
9357
9371
|
};
|
|
9358
|
-
|
|
9359
|
-
var B = 1 / 0, Q = 0, E = Math.round, i = E(window.devicePixelRatio || 1), o = E(80 * i * g), s = E(48 * i * g), t = E(3 * i * g), e = E(2 * i * g), n = E(3 * i * g), D = E(15 * i * g), F = E(74 * i * g),
|
|
9372
|
+
KI.Panel = function(C, A, I, g) {
|
|
9373
|
+
var B = 1 / 0, Q = 0, E = Math.round, i = E(window.devicePixelRatio || 1), o = E(80 * i * g), s = E(48 * i * g), t = E(3 * i * g), e = E(2 * i * g), n = E(3 * i * g), D = E(15 * i * g), F = E(74 * i * g), k = E(30 * i * g), S = document.createElement("canvas");
|
|
9360
9374
|
S.width = o, S.height = s, S.style.cssText = `width:${E(g * 80)}px;height:${E(g * 48)}px`;
|
|
9361
9375
|
var l = S.getContext("2d");
|
|
9362
|
-
return l.font = "bold " + E(9 * i * g) + "px Helvetica,Arial,sans-serif", l.textBaseline = "top", l.fillStyle = I, l.fillRect(0, 0, o, s), l.fillStyle = A, l.fillText(C, t, e), l.fillRect(n, D, F,
|
|
9376
|
+
return l.font = "bold " + E(9 * i * g) + "px Helvetica,Arial,sans-serif", l.textBaseline = "top", l.fillStyle = I, l.fillRect(0, 0, o, s), l.fillStyle = A, l.fillText(C, t, e), l.fillRect(n, D, F, k), l.fillStyle = I, l.globalAlpha = 0.9, l.fillRect(n, D, F, k), {
|
|
9363
9377
|
dom: S,
|
|
9364
|
-
update: function(f,
|
|
9365
|
-
B = Math.min(B, f), Q = Math.max(Q, f), l.fillStyle = I, l.globalAlpha = 1, l.fillRect(0, 0, o, D), l.fillStyle = A, l.fillText(E(f) + " " + C + " (" + E(B) + "-" + E(Q) + ")", t, e), l.drawImage(S, n + i, D, F - i,
|
|
9378
|
+
update: function(f, d) {
|
|
9379
|
+
B = Math.min(B, f), Q = Math.max(Q, f), l.fillStyle = I, l.globalAlpha = 1, l.fillRect(0, 0, o, D), l.fillStyle = A, l.fillText(E(f) + " " + C + " (" + E(B) + "-" + E(Q) + ")", t, e), l.drawImage(S, n + i, D, F - i, k, n, D, F - i, k), l.fillRect(n + F - i, D, i, k), l.fillStyle = I, l.globalAlpha = 0.9, l.fillRect(n + F - i, D, i, E((1 - f / d) * k));
|
|
9366
9380
|
}
|
|
9367
9381
|
};
|
|
9368
9382
|
};
|
|
9369
9383
|
function Oo({ scale: C } = { scale: 1.5 }) {
|
|
9370
|
-
const A = new
|
|
9384
|
+
const A = new KI(C);
|
|
9371
9385
|
return A.showPanel(
|
|
9372
9386
|
0
|
|
9373
9387
|
/* 0 = fps, 1 = ms, 2 = mb */
|
|
@@ -9817,7 +9831,7 @@ async function MC(C) {
|
|
|
9817
9831
|
throw new Error(`Unexpected response status ${C.status} ${C.statusText}`);
|
|
9818
9832
|
}
|
|
9819
9833
|
}
|
|
9820
|
-
class
|
|
9834
|
+
class ZI {
|
|
9821
9835
|
url;
|
|
9822
9836
|
#A;
|
|
9823
9837
|
#I;
|
|
@@ -9872,9 +9886,9 @@ class WI {
|
|
|
9872
9886
|
return this.#A(this.#B(A, s));
|
|
9873
9887
|
}
|
|
9874
9888
|
}
|
|
9875
|
-
class
|
|
9889
|
+
class PI extends Error {
|
|
9876
9890
|
}
|
|
9877
|
-
class NI extends
|
|
9891
|
+
class NI extends PI {
|
|
9878
9892
|
_tag = "NotFoundError";
|
|
9879
9893
|
name = "NotFoundError";
|
|
9880
9894
|
path;
|
|
@@ -9883,7 +9897,7 @@ class NI extends vI {
|
|
|
9883
9897
|
super(`Not found: ${A}`, { cause: I.cause }), this.path = I.path, this.found = I.found;
|
|
9884
9898
|
}
|
|
9885
9899
|
}
|
|
9886
|
-
class nA extends
|
|
9900
|
+
class nA extends PI {
|
|
9887
9901
|
_tag = "InvalidMetadataError";
|
|
9888
9902
|
name = "InvalidMetadataError";
|
|
9889
9903
|
path;
|
|
@@ -9891,7 +9905,7 @@ class nA extends vI {
|
|
|
9891
9905
|
super(A, { cause: I.cause }), this.path = I.path;
|
|
9892
9906
|
}
|
|
9893
9907
|
}
|
|
9894
|
-
class gs extends
|
|
9908
|
+
class gs extends PI {
|
|
9895
9909
|
_tag = "UnknownCodecError";
|
|
9896
9910
|
name = "UnknownCodecError";
|
|
9897
9911
|
codec;
|
|
@@ -9899,7 +9913,7 @@ class gs extends vI {
|
|
|
9899
9913
|
super(`Unknown codec: ${A}`), this.codec = A;
|
|
9900
9914
|
}
|
|
9901
9915
|
}
|
|
9902
|
-
class Bs extends
|
|
9916
|
+
class Bs extends PI {
|
|
9903
9917
|
_tag = "CodecPipelineError";
|
|
9904
9918
|
name = "CodecPipelineError";
|
|
9905
9919
|
direction;
|
|
@@ -9914,7 +9928,7 @@ class Bs extends vI {
|
|
|
9914
9928
|
super(I.join(" "), { cause: A.cause }), this.direction = A.direction, this.codec = A.codec, this.chunkPath = A.chunkPath;
|
|
9915
9929
|
}
|
|
9916
9930
|
}
|
|
9917
|
-
class pB extends
|
|
9931
|
+
class pB extends PI {
|
|
9918
9932
|
_tag = "UnsupportedError";
|
|
9919
9933
|
name = "UnsupportedError";
|
|
9920
9934
|
feature;
|
|
@@ -9927,14 +9941,14 @@ function EI(C) {
|
|
|
9927
9941
|
throw new pB(`${C} encode`);
|
|
9928
9942
|
};
|
|
9929
9943
|
}
|
|
9930
|
-
class
|
|
9944
|
+
class ng {
|
|
9931
9945
|
kind = "array_to_array";
|
|
9932
9946
|
constructor(A, I) {
|
|
9933
9947
|
if (A.keepbits < 0)
|
|
9934
9948
|
throw new nA("keepbits must be zero or positive");
|
|
9935
9949
|
}
|
|
9936
9950
|
static fromConfig(A, I) {
|
|
9937
|
-
return new
|
|
9951
|
+
return new ng(A, I);
|
|
9938
9952
|
}
|
|
9939
9953
|
encode = EI("bitround");
|
|
9940
9954
|
/**
|
|
@@ -10033,7 +10047,7 @@ class xB {
|
|
|
10033
10047
|
yield this.get(A);
|
|
10034
10048
|
}
|
|
10035
10049
|
}
|
|
10036
|
-
class
|
|
10050
|
+
class OI {
|
|
10037
10051
|
#A;
|
|
10038
10052
|
chars;
|
|
10039
10053
|
constructor(A, I, g, B) {
|
|
@@ -10042,7 +10056,7 @@ class ZI {
|
|
|
10042
10056
|
else if (mB(I))
|
|
10043
10057
|
B && (B *= A), this.#A = new Int32Array(I, g, B);
|
|
10044
10058
|
else {
|
|
10045
|
-
const Q = I, E = new
|
|
10059
|
+
const Q = I, E = new OI(A, 1);
|
|
10046
10060
|
this.#A = new Int32Array((function* () {
|
|
10047
10061
|
for (let i of Q)
|
|
10048
10062
|
E.set(0, i), yield* E.#A;
|
|
@@ -10095,7 +10109,7 @@ function Cs() {
|
|
|
10095
10109
|
function Qs(C, A) {
|
|
10096
10110
|
return new SharedArrayBuffer(C);
|
|
10097
10111
|
}
|
|
10098
|
-
function
|
|
10112
|
+
function VI(C) {
|
|
10099
10113
|
const A = new TextDecoder().decode(C);
|
|
10100
10114
|
try {
|
|
10101
10115
|
return JSON.parse(A);
|
|
@@ -10116,7 +10130,7 @@ function RI(C) {
|
|
|
10116
10130
|
let A = C.match(/v2:([US])(\d+)/);
|
|
10117
10131
|
if (A) {
|
|
10118
10132
|
let [, g, B] = A;
|
|
10119
|
-
return (g === "U" ?
|
|
10133
|
+
return (g === "U" ? OI : xB).bind(null, Number(B));
|
|
10120
10134
|
}
|
|
10121
10135
|
if (C === "string")
|
|
10122
10136
|
return globalThis.Array;
|
|
@@ -10318,7 +10332,7 @@ function es() {
|
|
|
10318
10332
|
function HC(C) {
|
|
10319
10333
|
return "BYTES_PER_ELEMENT" in C ? C.BYTES_PER_ELEMENT : 4;
|
|
10320
10334
|
}
|
|
10321
|
-
class
|
|
10335
|
+
class Lg {
|
|
10322
10336
|
kind = "array_to_bytes";
|
|
10323
10337
|
#A;
|
|
10324
10338
|
#I;
|
|
@@ -10331,7 +10345,7 @@ class lg {
|
|
|
10331
10345
|
this.#g = g.BYTES_PER_ELEMENT;
|
|
10332
10346
|
}
|
|
10333
10347
|
static fromConfig(A, I) {
|
|
10334
|
-
return new
|
|
10348
|
+
return new Lg(A, I);
|
|
10335
10349
|
}
|
|
10336
10350
|
encode(A) {
|
|
10337
10351
|
let I = new Uint8Array(A.data.buffer);
|
|
@@ -10357,7 +10371,7 @@ const qC = {
|
|
|
10357
10371
|
float32: 4,
|
|
10358
10372
|
float64: 8
|
|
10359
10373
|
};
|
|
10360
|
-
function
|
|
10374
|
+
function rg(C) {
|
|
10361
10375
|
return C in EE;
|
|
10362
10376
|
}
|
|
10363
10377
|
function sB(C) {
|
|
@@ -10372,18 +10386,18 @@ function as(C, A) {
|
|
|
10372
10386
|
}
|
|
10373
10387
|
return A === 4 ? (B.setUint32(0, Number(I)), B.getFloat32(0)) : (B.setBigUint64(0, I), B.getFloat64(0));
|
|
10374
10388
|
}
|
|
10375
|
-
function
|
|
10389
|
+
function Dg(C, A) {
|
|
10376
10390
|
if (sB(C)) {
|
|
10377
10391
|
if (typeof A != "number" || !Number.isInteger(A))
|
|
10378
10392
|
throw new nA(`Expected an integer value for data type "${C}", got ${JSON.stringify(A)}`);
|
|
10379
10393
|
return BigInt(A);
|
|
10380
10394
|
}
|
|
10381
10395
|
if (typeof A == "number") {
|
|
10382
|
-
if (!
|
|
10396
|
+
if (!rg(C) && !Number.isInteger(A))
|
|
10383
10397
|
throw new nA(`Expected an integer value for data type "${C}", got ${A}`);
|
|
10384
10398
|
return A;
|
|
10385
10399
|
}
|
|
10386
|
-
if (!
|
|
10400
|
+
if (!rg(C))
|
|
10387
10401
|
throw new nA(`String-encoded scalar "${A}" is not valid for non-float data type "${C}"`);
|
|
10388
10402
|
return A in qC ? qC[A] : as(A, EE[C]);
|
|
10389
10403
|
}
|
|
@@ -10399,21 +10413,21 @@ const pC = /* @__PURE__ */ new Set([
|
|
|
10399
10413
|
"float16",
|
|
10400
10414
|
"float32",
|
|
10401
10415
|
"float64"
|
|
10402
|
-
]),
|
|
10416
|
+
]), vg = {
|
|
10403
10417
|
int8: [-128, 2 ** 7 - 1],
|
|
10404
10418
|
uint8: [0, 2 ** 8 - 1],
|
|
10405
10419
|
int16: [-32768, 2 ** 15 - 1],
|
|
10406
10420
|
uint16: [0, 2 ** 16 - 1],
|
|
10407
10421
|
int32: [-2147483648, 2 ** 31 - 1],
|
|
10408
10422
|
uint32: [0, 2 ** 32 - 1]
|
|
10409
|
-
},
|
|
10423
|
+
}, Zg = {
|
|
10410
10424
|
int64: [-(2n ** 63n), 2n ** 63n - 1n],
|
|
10411
10425
|
uint64: [0n, 2n ** 64n - 1n]
|
|
10412
10426
|
};
|
|
10413
10427
|
function mC(C, A, I) {
|
|
10414
10428
|
return C.map(([g, B]) => ({
|
|
10415
|
-
src:
|
|
10416
|
-
tgt:
|
|
10429
|
+
src: Dg(A, g),
|
|
10430
|
+
tgt: Dg(I, B)
|
|
10417
10431
|
}));
|
|
10418
10432
|
}
|
|
10419
10433
|
function ns(C, A) {
|
|
@@ -10450,7 +10464,7 @@ function xC(C) {
|
|
|
10450
10464
|
return Ds;
|
|
10451
10465
|
}
|
|
10452
10466
|
}
|
|
10453
|
-
function
|
|
10467
|
+
function Pg(C, A, I) {
|
|
10454
10468
|
const g = A - C + 1;
|
|
10455
10469
|
switch (I) {
|
|
10456
10470
|
case "clamp":
|
|
@@ -10465,7 +10479,7 @@ function Zg(C, A, I) {
|
|
|
10465
10479
|
};
|
|
10466
10480
|
}
|
|
10467
10481
|
}
|
|
10468
|
-
function
|
|
10482
|
+
function Og(C, A, I) {
|
|
10469
10483
|
const g = A - C + 1n;
|
|
10470
10484
|
switch (I) {
|
|
10471
10485
|
case "clamp":
|
|
@@ -10512,21 +10526,21 @@ class bB {
|
|
|
10512
10526
|
}
|
|
10513
10527
|
}
|
|
10514
10528
|
function bC(C, A, I, g, B) {
|
|
10515
|
-
const Q =
|
|
10529
|
+
const Q = rg(C), E = sB(C), i = rg(A), o = sB(A);
|
|
10516
10530
|
let s;
|
|
10517
10531
|
if (Q && i) {
|
|
10518
10532
|
if (I !== "nearest-even")
|
|
10519
10533
|
throw new nA(`cast_value float -> float only supports "nearest-even" rounding, got "${I}"`);
|
|
10520
10534
|
s = (e) => e;
|
|
10521
10535
|
} else if (Q && !i && !o) {
|
|
10522
|
-
const e = xC(I), n =
|
|
10536
|
+
const e = xC(I), n = Pg(...vg[A], g);
|
|
10523
10537
|
s = (D) => {
|
|
10524
10538
|
if (!Number.isFinite(D))
|
|
10525
10539
|
throw new Error(`Cannot cast ${D} to integer type without scalar_map`);
|
|
10526
10540
|
return n(e(D));
|
|
10527
10541
|
};
|
|
10528
10542
|
} else if (Q && o) {
|
|
10529
|
-
const e = xC(I), n =
|
|
10543
|
+
const e = xC(I), n = Og(...Zg[A], g);
|
|
10530
10544
|
s = (D) => {
|
|
10531
10545
|
if (!Number.isFinite(D))
|
|
10532
10546
|
throw new Error(`Cannot cast ${D} to integer type without scalar_map`);
|
|
@@ -10537,15 +10551,15 @@ function bC(C, A, I, g, B) {
|
|
|
10537
10551
|
else if (E && i)
|
|
10538
10552
|
s = (e) => Number(e);
|
|
10539
10553
|
else if (!Q && !E && !i && !o)
|
|
10540
|
-
s =
|
|
10554
|
+
s = Pg(...vg[A], g);
|
|
10541
10555
|
else if (!Q && !E && o) {
|
|
10542
|
-
const e =
|
|
10556
|
+
const e = Og(...Zg[A], g);
|
|
10543
10557
|
s = (n) => e(BigInt(n));
|
|
10544
10558
|
} else if (E && !i && !o) {
|
|
10545
|
-
const e =
|
|
10559
|
+
const e = Pg(...vg[A], g);
|
|
10546
10560
|
s = (n) => e(Number(n));
|
|
10547
10561
|
} else if (E && o)
|
|
10548
|
-
s =
|
|
10562
|
+
s = Og(...Zg[A], g);
|
|
10549
10563
|
else
|
|
10550
10564
|
throw new Error(`Unhandled type combination: ${C} -> ${A}`);
|
|
10551
10565
|
return B.length === 0 ? s : (e) => {
|
|
@@ -10637,7 +10651,7 @@ function ys(C, A) {
|
|
|
10637
10651
|
function cs(C, A) {
|
|
10638
10652
|
return A instanceof Object && !Array.isArray(A) ? Object.keys(A).sort().reduce((I, g) => (I[g] = A[g], I), {}) : A;
|
|
10639
10653
|
}
|
|
10640
|
-
class
|
|
10654
|
+
class hg {
|
|
10641
10655
|
configuration;
|
|
10642
10656
|
kind = "array_to_bytes";
|
|
10643
10657
|
#A;
|
|
@@ -10658,7 +10672,7 @@ class Dg {
|
|
|
10658
10672
|
}, this.#I = { strict: s };
|
|
10659
10673
|
}
|
|
10660
10674
|
static fromConfig(A) {
|
|
10661
|
-
return new
|
|
10675
|
+
return new hg(A);
|
|
10662
10676
|
}
|
|
10663
10677
|
encode(A) {
|
|
10664
10678
|
const { indent: I, encoding: g, ensure_ascii: B, check_circular: Q, allow_nan: E, sort_keys: i } = this.#A;
|
|
@@ -10670,8 +10684,8 @@ class Dg {
|
|
|
10670
10684
|
let t;
|
|
10671
10685
|
o.length && (t = (n, D) => {
|
|
10672
10686
|
let F = D;
|
|
10673
|
-
for (let
|
|
10674
|
-
F =
|
|
10687
|
+
for (let k of o)
|
|
10688
|
+
F = k(n, F);
|
|
10675
10689
|
return F;
|
|
10676
10690
|
});
|
|
10677
10691
|
let e = JSON.stringify(s, t, I);
|
|
@@ -10683,7 +10697,7 @@ class Dg {
|
|
|
10683
10697
|
decode(A) {
|
|
10684
10698
|
const { strict: I } = this.#I;
|
|
10685
10699
|
FA(I, "JsonCodec does not yet support non-strict decoding.");
|
|
10686
|
-
const g =
|
|
10700
|
+
const g = VI(A), B = g.pop();
|
|
10687
10701
|
g.pop(), FA(B, "0D not implemented for JsonCodec.");
|
|
10688
10702
|
const Q = BI(B, "C");
|
|
10689
10703
|
return { data: g, shape: B, stride: Q };
|
|
@@ -10713,7 +10727,7 @@ class ZB {
|
|
|
10713
10727
|
static fromConfig(A, I) {
|
|
10714
10728
|
if (!ws.has(I.dataType))
|
|
10715
10729
|
throw new nA(`scale_offset codec does not support data type: ${I.dataType}`);
|
|
10716
|
-
return new ZB(
|
|
10730
|
+
return new ZB(Dg(I.dataType, A.scale ?? 1), Dg(I.dataType, A.offset ?? 0), RI(I.dataType));
|
|
10717
10731
|
}
|
|
10718
10732
|
encode = EI("scale_offset");
|
|
10719
10733
|
decode(A) {
|
|
@@ -10758,7 +10772,7 @@ function Fs(C, A) {
|
|
|
10758
10772
|
return B;
|
|
10759
10773
|
}
|
|
10760
10774
|
function WC(C) {
|
|
10761
|
-
return C instanceof gE || C instanceof xB || C instanceof
|
|
10775
|
+
return C instanceof gE || C instanceof xB || C instanceof OI ? new Proxy(C, {
|
|
10762
10776
|
get(I, g) {
|
|
10763
10777
|
return I.get(Number(g));
|
|
10764
10778
|
},
|
|
@@ -10769,7 +10783,7 @@ function WC(C) {
|
|
|
10769
10783
|
}
|
|
10770
10784
|
function Ss(C, A) {
|
|
10771
10785
|
let I;
|
|
10772
|
-
return C.data instanceof xB || C.data instanceof
|
|
10786
|
+
return C.data instanceof xB || C.data instanceof OI ? I = new C.constructor(
|
|
10773
10787
|
// @ts-expect-error
|
|
10774
10788
|
C.data.length,
|
|
10775
10789
|
C.data.chars
|
|
@@ -10835,7 +10849,7 @@ class OB {
|
|
|
10835
10849
|
};
|
|
10836
10850
|
}
|
|
10837
10851
|
}
|
|
10838
|
-
class
|
|
10852
|
+
class yg {
|
|
10839
10853
|
kind = "array_to_bytes";
|
|
10840
10854
|
#A;
|
|
10841
10855
|
#I;
|
|
@@ -10843,7 +10857,7 @@ class hg {
|
|
|
10843
10857
|
this.#A = A, this.#I = BI(A, "C");
|
|
10844
10858
|
}
|
|
10845
10859
|
static fromConfig(A, I) {
|
|
10846
|
-
return new
|
|
10860
|
+
return new yg(I.shape);
|
|
10847
10861
|
}
|
|
10848
10862
|
encode = EI("vlen-utf8");
|
|
10849
10863
|
decode(A) {
|
|
@@ -10866,11 +10880,11 @@ class VB {
|
|
|
10866
10880
|
return new Uint8Array(I);
|
|
10867
10881
|
}
|
|
10868
10882
|
}
|
|
10869
|
-
function
|
|
10883
|
+
function ds() {
|
|
10870
10884
|
let C = () => import("./blosc-D1xNXZJs.js").then((Q) => Q.default), A = () => import("./lz4-1Ws5oVWR.js").then((Q) => Q.default), I = () => import("./zstd-C4EcZnjq.js").then((Q) => Q.default), g = () => vB, B = () => VB;
|
|
10871
|
-
return (/* @__PURE__ */ new Map()).set("blosc", C).set("lz4", A).set("zstd", I).set("gzip", g).set("zlib", B).set("transpose", () => OB).set("bytes", () =>
|
|
10885
|
+
return (/* @__PURE__ */ new Map()).set("blosc", C).set("lz4", A).set("zstd", I).set("gzip", g).set("zlib", B).set("transpose", () => OB).set("bytes", () => Lg).set("crc32c", () => TB).set("vlen-utf8", () => yg).set("json2", () => hg).set("bitround", () => ng).set("cast_value", () => bB).set("scale_offset", () => ZB).set("numcodecs.blosc", C).set("numcodecs.lz4", A).set("numcodecs.zstd", I).set("numcodecs.gzip", g).set("numcodecs.zlib", B).set("numcodecs.vlen-utf8", () => yg).set("numcodecs.shuffle", () => PB).set("numcodecs.delta", () => WB).set("numcodecs.bitround", () => ng).set("numcodecs.json2", () => hg);
|
|
10872
10886
|
}
|
|
10873
|
-
const
|
|
10887
|
+
const Us = ds();
|
|
10874
10888
|
function tB(C) {
|
|
10875
10889
|
let A;
|
|
10876
10890
|
function I() {
|
|
@@ -10921,7 +10935,7 @@ function vC(C, A, I) {
|
|
|
10921
10935
|
}
|
|
10922
10936
|
async function ls(C) {
|
|
10923
10937
|
let A = C.codecs.map(async (E) => {
|
|
10924
|
-
let i = await
|
|
10938
|
+
let i = await Us.get(E.name)?.();
|
|
10925
10939
|
if (!i)
|
|
10926
10940
|
throw new gs(E.name);
|
|
10927
10941
|
return { Codec: i, meta: E };
|
|
@@ -10953,7 +10967,7 @@ async function ls(C) {
|
|
|
10953
10967
|
throw new nA(`Cannot encode ${Q.dataType} to bytes without a codec`);
|
|
10954
10968
|
g = {
|
|
10955
10969
|
name: "bytes",
|
|
10956
|
-
codec:
|
|
10970
|
+
codec: Lg.fromConfig({ endian: "little" }, Q)
|
|
10957
10971
|
};
|
|
10958
10972
|
}
|
|
10959
10973
|
return {
|
|
@@ -10986,15 +11000,15 @@ function Js(C, A, I, g) {
|
|
|
10986
11000
|
let D = await o[n];
|
|
10987
11001
|
if (D === null)
|
|
10988
11002
|
return;
|
|
10989
|
-
let { data: F, shape:
|
|
10990
|
-
if (!(f === ZC &&
|
|
11003
|
+
let { data: F, shape: k, stride: S } = D, l = s.map((R, L) => R % k[L]).reduce((R, L, M) => R + L * S[M], 0), f = F[l], d = F[l + 1];
|
|
11004
|
+
if (!(f === ZC && d === ZC))
|
|
10991
11005
|
return B(n, {
|
|
10992
11006
|
offset: Number(f),
|
|
10993
|
-
length: Number(
|
|
11007
|
+
length: Number(d)
|
|
10994
11008
|
}, t);
|
|
10995
11009
|
};
|
|
10996
11010
|
}
|
|
10997
|
-
class
|
|
11011
|
+
class dA {
|
|
10998
11012
|
store;
|
|
10999
11013
|
path;
|
|
11000
11014
|
constructor(A, I = "/") {
|
|
@@ -11002,10 +11016,10 @@ class UA {
|
|
|
11002
11016
|
}
|
|
11003
11017
|
resolve(A) {
|
|
11004
11018
|
let I = new URL(`file://${this.path.endsWith("/") ? this.path : `${this.path}/`}`);
|
|
11005
|
-
return new
|
|
11019
|
+
return new dA(this.store, decodeURIComponent(new URL(A, I).pathname));
|
|
11006
11020
|
}
|
|
11007
11021
|
}
|
|
11008
|
-
class _B extends
|
|
11022
|
+
class _B extends dA {
|
|
11009
11023
|
kind = "group";
|
|
11010
11024
|
#A;
|
|
11011
11025
|
constructor(A, I, g) {
|
|
@@ -11018,7 +11032,7 @@ class _B extends UA {
|
|
|
11018
11032
|
function PC(C) {
|
|
11019
11033
|
return C.find((I) => I.name === "transpose")?.configuration?.order ?? "C";
|
|
11020
11034
|
}
|
|
11021
|
-
const
|
|
11035
|
+
const $I = Symbol("zarrita.context");
|
|
11022
11036
|
function Ys(C, A) {
|
|
11023
11037
|
let { configuration: I } = A.codecs.find(ts) ?? {}, g = {
|
|
11024
11038
|
encodeChunkKey: Es(A.chunk_key_encoding),
|
|
@@ -11063,15 +11077,15 @@ function Ys(C, A) {
|
|
|
11063
11077
|
}
|
|
11064
11078
|
};
|
|
11065
11079
|
}
|
|
11066
|
-
let
|
|
11080
|
+
let cg = class extends dA {
|
|
11067
11081
|
kind = "array";
|
|
11068
11082
|
#A;
|
|
11069
|
-
[
|
|
11083
|
+
[$I];
|
|
11070
11084
|
constructor(A, I, g) {
|
|
11071
11085
|
super(A, I), this.#A = {
|
|
11072
11086
|
...g,
|
|
11073
11087
|
fill_value: BE(g)
|
|
11074
|
-
}, this[
|
|
11088
|
+
}, this[$I] = Ys(this, this.#A);
|
|
11075
11089
|
}
|
|
11076
11090
|
get attrs() {
|
|
11077
11091
|
return this.#A.attributes;
|
|
@@ -11086,14 +11100,14 @@ let yg = class extends UA {
|
|
|
11086
11100
|
return this.#A.shape;
|
|
11087
11101
|
}
|
|
11088
11102
|
get chunks() {
|
|
11089
|
-
return this[
|
|
11103
|
+
return this[$I].chunkShape;
|
|
11090
11104
|
}
|
|
11091
11105
|
get dtype() {
|
|
11092
11106
|
return this.#A.data_type;
|
|
11093
11107
|
}
|
|
11094
11108
|
async getChunk(A, I, g) {
|
|
11095
11109
|
g?.useSharedArrayBuffer && Cs();
|
|
11096
|
-
let B = this[
|
|
11110
|
+
let B = this[$I], Q = await B.getChunkBytes(A, I);
|
|
11097
11111
|
if (!Q) {
|
|
11098
11112
|
let E = B.chunkShape.reduce((o, s) => o * s, 1), i;
|
|
11099
11113
|
if (g?.useSharedArrayBuffer) {
|
|
@@ -11148,7 +11162,7 @@ async function iE(C) {
|
|
|
11148
11162
|
let A = C.store.arrayExtensions;
|
|
11149
11163
|
return A?.length ? await us(C, ...A) : C;
|
|
11150
11164
|
}
|
|
11151
|
-
let
|
|
11165
|
+
let Jg = fs();
|
|
11152
11166
|
function fs() {
|
|
11153
11167
|
let C = /* @__PURE__ */ new WeakMap();
|
|
11154
11168
|
function A(I) {
|
|
@@ -11169,43 +11183,43 @@ async function Ks(C, A) {
|
|
|
11169
11183
|
let I = await C.store.get(C.resolve(".zattrs").path, {
|
|
11170
11184
|
signal: A
|
|
11171
11185
|
});
|
|
11172
|
-
return I ?
|
|
11186
|
+
return I ? VI(I) : {};
|
|
11173
11187
|
}
|
|
11174
11188
|
async function Hs(C, A = {}) {
|
|
11175
|
-
let I = "store" in C ? C : new
|
|
11189
|
+
let I = "store" in C ? C : new dA(C), { signal: g } = A, B = {};
|
|
11176
11190
|
return (A.attrs ?? !0) && (B = await Ks(I, g)), g?.throwIfAborted(), A.kind === "array" ? OC(I, B, g) : A.kind === "group" ? VC(I, B, g) : OC(I, B, g).catch((Q) => (CE(Q, NI, nA), VC(I, B, g)));
|
|
11177
11191
|
}
|
|
11178
11192
|
async function OC(C, A, I) {
|
|
11179
11193
|
let { path: g } = C.resolve(".zarray"), B = await C.store.get(g, { signal: I });
|
|
11180
11194
|
if (!B)
|
|
11181
11195
|
throw new NI("v2 array", { path: g });
|
|
11182
|
-
return
|
|
11196
|
+
return Jg.increment(C.store, "v2"), iE(new cg(C.store, C.path, os(VI(B), A)));
|
|
11183
11197
|
}
|
|
11184
11198
|
async function VC(C, A, I) {
|
|
11185
11199
|
let { path: g } = C.resolve(".zgroup"), B = await C.store.get(g, { signal: I });
|
|
11186
11200
|
if (!B)
|
|
11187
11201
|
throw new NI("v2 group", { path: g });
|
|
11188
|
-
return
|
|
11202
|
+
return Jg.increment(C.store, "v2"), new _B(C.store, C.path, ss(VI(B), A));
|
|
11189
11203
|
}
|
|
11190
11204
|
async function qs(C, A) {
|
|
11191
11205
|
let { store: I, path: g } = C.resolve("zarr.json"), B = await C.store.get(g, { signal: A });
|
|
11192
11206
|
if (!B)
|
|
11193
11207
|
throw new NI("v3 array or group", { path: g });
|
|
11194
|
-
let Q =
|
|
11195
|
-
return Q.node_type === "array" && (Q.fill_value = BE(Q)), Q.node_type === "array" ? iE(new
|
|
11208
|
+
let Q = VI(B);
|
|
11209
|
+
return Q.node_type === "array" && (Q.fill_value = BE(Q)), Q.node_type === "array" ? iE(new cg(I, C.path, Q)) : new _B(I, C.path, Q);
|
|
11196
11210
|
}
|
|
11197
11211
|
async function ps(C, A = {}) {
|
|
11198
|
-
let I = "store" in C ? C : new
|
|
11199
|
-
if (
|
|
11212
|
+
let I = "store" in C ? C : new dA(C), g = await qs(I, A.signal);
|
|
11213
|
+
if (Jg.increment(I.store, "v3"), A.kind === void 0 || A.kind === "array" && g instanceof cg || A.kind === "group" && g instanceof _B)
|
|
11200
11214
|
return g;
|
|
11201
|
-
let B = g instanceof
|
|
11215
|
+
let B = g instanceof cg ? "array" : "group";
|
|
11202
11216
|
throw new NI(`${A.kind} at ${I.path}`, {
|
|
11203
11217
|
path: I.path,
|
|
11204
11218
|
found: B
|
|
11205
11219
|
});
|
|
11206
11220
|
}
|
|
11207
11221
|
async function RA(C, A = {}) {
|
|
11208
|
-
let I = "store" in C ? C.store : C, g =
|
|
11222
|
+
let I = "store" in C ? C.store : C, g = Jg.versionMax(I), B = g === "v2" ? RA.v2 : RA.v3, Q = g === "v2" ? RA.v3 : RA.v2;
|
|
11209
11223
|
return B(C, A).catch((E) => (CE(E, NI, nA), Q(C, A)));
|
|
11210
11224
|
}
|
|
11211
11225
|
RA.v2 = Hs;
|
|
@@ -11237,7 +11251,7 @@ class XB {
|
|
|
11237
11251
|
return new Uint8Array(B);
|
|
11238
11252
|
}
|
|
11239
11253
|
}
|
|
11240
|
-
async function
|
|
11254
|
+
async function _I(C, A) {
|
|
11241
11255
|
if (A === "v2")
|
|
11242
11256
|
try {
|
|
11243
11257
|
return RA.v2(C, { kind: "group", attrs: !0 });
|
|
@@ -11279,12 +11293,12 @@ async function bs(C) {
|
|
|
11279
11293
|
let A;
|
|
11280
11294
|
switch (C.type) {
|
|
11281
11295
|
case "fetch": {
|
|
11282
|
-
const g = new
|
|
11283
|
-
A = new
|
|
11296
|
+
const g = new ZI(C.url);
|
|
11297
|
+
A = new dA(g);
|
|
11284
11298
|
break;
|
|
11285
11299
|
}
|
|
11286
11300
|
case "filesystem": {
|
|
11287
|
-
A = new
|
|
11301
|
+
A = new dA(
|
|
11288
11302
|
new XB(C.directoryHandle),
|
|
11289
11303
|
C.path
|
|
11290
11304
|
);
|
|
@@ -11299,7 +11313,7 @@ async function bs(C) {
|
|
|
11299
11313
|
return xs(I, C.zarrVersion);
|
|
11300
11314
|
}
|
|
11301
11315
|
function Ts(C, A, I) {
|
|
11302
|
-
if (C.store instanceof
|
|
11316
|
+
if (C.store instanceof ZI)
|
|
11303
11317
|
return {
|
|
11304
11318
|
type: "fetch",
|
|
11305
11319
|
arrayPath: A,
|
|
@@ -11340,17 +11354,17 @@ function vs(C, A, I, g) {
|
|
|
11340
11354
|
throw new Error(
|
|
11341
11355
|
`Received chunk too small: expected ${JSON.stringify(B)}, got ${JSON.stringify(o)}`
|
|
11342
11356
|
);
|
|
11343
|
-
const s = g.cChunkSize ? Q.c % g.cChunkSize : 0, t = g.tChunkSize ? Q.t % g.tChunkSize : 0, e = B.x * B.y * B.z, n = E.c !== void 0 ? I[E.c] : 0, D = E.t !== void 0 ? I[E.t] : 0, F = t * D + s * n,
|
|
11344
|
-
if (F === 0 && C.length === e &&
|
|
11357
|
+
const s = g.cChunkSize ? Q.c % g.cChunkSize : 0, t = g.tChunkSize ? Q.t % g.tChunkSize : 0, e = B.x * B.y * B.z, n = E.c !== void 0 ? I[E.c] : 0, D = E.t !== void 0 ? I[E.t] : 0, F = t * D + s * n, k = o.x === B.x && o.y === B.y && o.z === B.z;
|
|
11358
|
+
if (F === 0 && C.length === e && k)
|
|
11345
11359
|
return C;
|
|
11346
11360
|
const l = new C.constructor(
|
|
11347
11361
|
e
|
|
11348
|
-
), f = E.z !== void 0 ? I[E.z] : 0,
|
|
11362
|
+
), f = E.z !== void 0 ? I[E.z] : 0, d = I[E.y];
|
|
11349
11363
|
let R = 0;
|
|
11350
11364
|
for (let L = 0; L < B.z; L++) {
|
|
11351
11365
|
const M = F + L * f;
|
|
11352
11366
|
for (let W = 0; W < B.y; W++) {
|
|
11353
|
-
const $ = M + W *
|
|
11367
|
+
const $ = M + W * d, BA = $ + B.x;
|
|
11354
11368
|
l.set(C.subarray($, BA), R), R += B.x;
|
|
11355
11369
|
}
|
|
11356
11370
|
}
|
|
@@ -15034,7 +15048,7 @@ function Zs(C) {
|
|
|
15034
15048
|
}
|
|
15035
15049
|
const Ps = Math.max(1, navigator.hardwareConcurrency - 2);
|
|
15036
15050
|
let JA = [], Os = 0, sE = 0;
|
|
15037
|
-
const CI = /* @__PURE__ */ new Map(),
|
|
15051
|
+
const CI = /* @__PURE__ */ new Map(), wg = /* @__PURE__ */ new Set();
|
|
15038
15052
|
function tE(C) {
|
|
15039
15053
|
const A = JA.find((I) => I.worker === C);
|
|
15040
15054
|
return A || H.error(
|
|
@@ -15045,7 +15059,7 @@ function tE(C) {
|
|
|
15045
15059
|
function Vs(C, A) {
|
|
15046
15060
|
const { id: I, success: g } = C.data, B = CI.get(I);
|
|
15047
15061
|
if (!B) {
|
|
15048
|
-
|
|
15062
|
+
wg.has(I) ? wg.delete(I) : H.warn(
|
|
15049
15063
|
"ZarrWorker",
|
|
15050
15064
|
`Received response for unknown message ID ${I}:`,
|
|
15051
15065
|
C.data
|
|
@@ -15116,10 +15130,10 @@ async function Xs(C, A, I, g) {
|
|
|
15116
15130
|
E.worker.postMessage({
|
|
15117
15131
|
id: i,
|
|
15118
15132
|
type: "cancel"
|
|
15119
|
-
}), CI.delete(i),
|
|
15133
|
+
}), CI.delete(i), wg.add(i), E.pendingCount--, Q(new DOMException("Operation was aborted", "AbortError"));
|
|
15120
15134
|
};
|
|
15121
15135
|
if (g.signal.aborted) {
|
|
15122
|
-
s(),
|
|
15136
|
+
s(), wg.delete(i);
|
|
15123
15137
|
return;
|
|
15124
15138
|
}
|
|
15125
15139
|
g.signal.addEventListener("abort", s, { once: !0 }), o.abortListener = s, o.abortSignal = g.signal;
|
|
@@ -15260,7 +15274,7 @@ function gt(C, A) {
|
|
|
15260
15274
|
const I = C.axes.map((e) => e.name), g = C.axes.length, B = zC(I, "x"), Q = zC(I, "y"), E = (e, n) => {
|
|
15261
15275
|
const D = [];
|
|
15262
15276
|
for (let F = 0; F < C.datasets.length; F++) {
|
|
15263
|
-
const
|
|
15277
|
+
const k = C.datasets[F], S = A[F], l = k.coordinateTransformations[0].scale, f = k.coordinateTransformations.length === 2 ? k.coordinateTransformations[1].translation : new Array(g).fill(0);
|
|
15264
15278
|
D.push({
|
|
15265
15279
|
size: S.shape[n],
|
|
15266
15280
|
chunkSize: S.chunks[n],
|
|
@@ -15280,25 +15294,25 @@ function gt(C, A) {
|
|
|
15280
15294
|
x: E(I[B], B),
|
|
15281
15295
|
y: E(I[Q], Q),
|
|
15282
15296
|
numLods: A.length
|
|
15283
|
-
}, o =
|
|
15297
|
+
}, o = Bg(I, "z");
|
|
15284
15298
|
o !== -1 && (i.z = E(I[o], o));
|
|
15285
|
-
const s =
|
|
15299
|
+
const s = Bg(I, "c");
|
|
15286
15300
|
s !== -1 && (i.c = E(I[s], s));
|
|
15287
|
-
const t =
|
|
15301
|
+
const t = Bg(I, "t");
|
|
15288
15302
|
return t !== -1 && (i.t = E(I[t], t)), i;
|
|
15289
15303
|
}
|
|
15290
15304
|
function Bt(C, A) {
|
|
15291
15305
|
return C.toLowerCase() === A.toLowerCase();
|
|
15292
15306
|
}
|
|
15293
15307
|
function zC(C, A) {
|
|
15294
|
-
const I =
|
|
15308
|
+
const I = Bg(C, A);
|
|
15295
15309
|
if (I === -1)
|
|
15296
15310
|
throw new Error(
|
|
15297
15311
|
`Could not find "${A}" dimension in [${C.join(", ")}]`
|
|
15298
15312
|
);
|
|
15299
15313
|
return I;
|
|
15300
15314
|
}
|
|
15301
|
-
function
|
|
15315
|
+
function Bg(C, A) {
|
|
15302
15316
|
return C.findIndex((I) => Bt(I, A));
|
|
15303
15317
|
}
|
|
15304
15318
|
function Ct(C) {
|
|
@@ -15396,7 +15410,7 @@ const u = O.arrayToEnum([
|
|
|
15396
15410
|
default:
|
|
15397
15411
|
return u.unknown;
|
|
15398
15412
|
}
|
|
15399
|
-
},
|
|
15413
|
+
}, U = O.arrayToEnum([
|
|
15400
15414
|
"invalid_type",
|
|
15401
15415
|
"invalid_literal",
|
|
15402
15416
|
"custom",
|
|
@@ -15481,52 +15495,52 @@ WA.create = (C) => new WA(C);
|
|
|
15481
15495
|
const eB = (C, A) => {
|
|
15482
15496
|
let I;
|
|
15483
15497
|
switch (C.code) {
|
|
15484
|
-
case
|
|
15498
|
+
case U.invalid_type:
|
|
15485
15499
|
C.received === u.undefined ? I = "Required" : I = `Expected ${C.expected}, received ${C.received}`;
|
|
15486
15500
|
break;
|
|
15487
|
-
case
|
|
15501
|
+
case U.invalid_literal:
|
|
15488
15502
|
I = `Invalid literal value, expected ${JSON.stringify(C.expected, O.jsonStringifyReplacer)}`;
|
|
15489
15503
|
break;
|
|
15490
|
-
case
|
|
15504
|
+
case U.unrecognized_keys:
|
|
15491
15505
|
I = `Unrecognized key(s) in object: ${O.joinValues(C.keys, ", ")}`;
|
|
15492
15506
|
break;
|
|
15493
|
-
case
|
|
15507
|
+
case U.invalid_union:
|
|
15494
15508
|
I = "Invalid input";
|
|
15495
15509
|
break;
|
|
15496
|
-
case
|
|
15510
|
+
case U.invalid_union_discriminator:
|
|
15497
15511
|
I = `Invalid discriminator value. Expected ${O.joinValues(C.options)}`;
|
|
15498
15512
|
break;
|
|
15499
|
-
case
|
|
15513
|
+
case U.invalid_enum_value:
|
|
15500
15514
|
I = `Invalid enum value. Expected ${O.joinValues(C.options)}, received '${C.received}'`;
|
|
15501
15515
|
break;
|
|
15502
|
-
case
|
|
15516
|
+
case U.invalid_arguments:
|
|
15503
15517
|
I = "Invalid function arguments";
|
|
15504
15518
|
break;
|
|
15505
|
-
case
|
|
15519
|
+
case U.invalid_return_type:
|
|
15506
15520
|
I = "Invalid function return type";
|
|
15507
15521
|
break;
|
|
15508
|
-
case
|
|
15522
|
+
case U.invalid_date:
|
|
15509
15523
|
I = "Invalid date";
|
|
15510
15524
|
break;
|
|
15511
|
-
case
|
|
15525
|
+
case U.invalid_string:
|
|
15512
15526
|
typeof C.validation == "object" ? "includes" in C.validation ? (I = `Invalid input: must include "${C.validation.includes}"`, typeof C.validation.position == "number" && (I = `${I} at one or more positions greater than or equal to ${C.validation.position}`)) : "startsWith" in C.validation ? I = `Invalid input: must start with "${C.validation.startsWith}"` : "endsWith" in C.validation ? I = `Invalid input: must end with "${C.validation.endsWith}"` : O.assertNever(C.validation) : C.validation !== "regex" ? I = `Invalid ${C.validation}` : I = "Invalid";
|
|
15513
15527
|
break;
|
|
15514
|
-
case
|
|
15528
|
+
case U.too_small:
|
|
15515
15529
|
C.type === "array" ? I = `Array must contain ${C.exact ? "exactly" : C.inclusive ? "at least" : "more than"} ${C.minimum} element(s)` : C.type === "string" ? I = `String must contain ${C.exact ? "exactly" : C.inclusive ? "at least" : "over"} ${C.minimum} character(s)` : C.type === "number" ? I = `Number must be ${C.exact ? "exactly equal to " : C.inclusive ? "greater than or equal to " : "greater than "}${C.minimum}` : C.type === "bigint" ? I = `Number must be ${C.exact ? "exactly equal to " : C.inclusive ? "greater than or equal to " : "greater than "}${C.minimum}` : C.type === "date" ? I = `Date must be ${C.exact ? "exactly equal to " : C.inclusive ? "greater than or equal to " : "greater than "}${new Date(Number(C.minimum))}` : I = "Invalid input";
|
|
15516
15530
|
break;
|
|
15517
|
-
case
|
|
15531
|
+
case U.too_big:
|
|
15518
15532
|
C.type === "array" ? I = `Array must contain ${C.exact ? "exactly" : C.inclusive ? "at most" : "less than"} ${C.maximum} element(s)` : C.type === "string" ? I = `String must contain ${C.exact ? "exactly" : C.inclusive ? "at most" : "under"} ${C.maximum} character(s)` : C.type === "number" ? I = `Number must be ${C.exact ? "exactly" : C.inclusive ? "less than or equal to" : "less than"} ${C.maximum}` : C.type === "bigint" ? I = `BigInt must be ${C.exact ? "exactly" : C.inclusive ? "less than or equal to" : "less than"} ${C.maximum}` : C.type === "date" ? I = `Date must be ${C.exact ? "exactly" : C.inclusive ? "smaller than or equal to" : "smaller than"} ${new Date(Number(C.maximum))}` : I = "Invalid input";
|
|
15519
15533
|
break;
|
|
15520
|
-
case
|
|
15534
|
+
case U.custom:
|
|
15521
15535
|
I = "Invalid input";
|
|
15522
15536
|
break;
|
|
15523
|
-
case
|
|
15537
|
+
case U.invalid_intersection_types:
|
|
15524
15538
|
I = "Intersection results could not be merged";
|
|
15525
15539
|
break;
|
|
15526
|
-
case
|
|
15540
|
+
case U.not_multiple_of:
|
|
15527
15541
|
I = `Number must be a multiple of ${C.multipleOf}`;
|
|
15528
15542
|
break;
|
|
15529
|
-
case
|
|
15543
|
+
case U.not_finite:
|
|
15530
15544
|
I = "Number must be finite";
|
|
15531
15545
|
break;
|
|
15532
15546
|
default:
|
|
@@ -15620,7 +15634,7 @@ class NA {
|
|
|
15620
15634
|
}
|
|
15621
15635
|
const m = Object.freeze({
|
|
15622
15636
|
status: "aborted"
|
|
15623
|
-
}),
|
|
15637
|
+
}), YI = (C) => ({ status: "dirty", value: C }), lA = (C) => ({ status: "valid", value: C }), AQ = (C) => C.status === "aborted", IQ = (C) => C.status === "dirty", DI = (C) => C.status === "valid", Gg = (C) => typeof Promise < "u" && C instanceof Promise;
|
|
15624
15638
|
var K;
|
|
15625
15639
|
(function(C) {
|
|
15626
15640
|
C.errToObj = (A) => typeof A == "string" ? { message: A } : A || {}, C.toString = (A) => typeof A == "string" ? A : A?.message;
|
|
@@ -15691,7 +15705,7 @@ class Z {
|
|
|
15691
15705
|
}
|
|
15692
15706
|
_parseSync(A) {
|
|
15693
15707
|
const I = this._parse(A);
|
|
15694
|
-
if (
|
|
15708
|
+
if (Gg(I))
|
|
15695
15709
|
throw new Error("Synchronous parse encountered promise.");
|
|
15696
15710
|
return I;
|
|
15697
15711
|
}
|
|
@@ -15770,14 +15784,14 @@ class Z {
|
|
|
15770
15784
|
parent: null,
|
|
15771
15785
|
data: A,
|
|
15772
15786
|
parsedType: vA(A)
|
|
15773
|
-
}, B = this._parse({ data: A, path: g.path, parent: g }), Q = await (
|
|
15787
|
+
}, B = this._parse({ data: A, path: g.path, parent: g }), Q = await (Gg(B) ? B : Promise.resolve(B));
|
|
15774
15788
|
return gQ(g, Q);
|
|
15775
15789
|
}
|
|
15776
15790
|
refine(A, I) {
|
|
15777
15791
|
const g = (B) => typeof I == "string" || typeof I > "u" ? { message: I } : typeof I == "function" ? I(B) : I;
|
|
15778
15792
|
return this._refinement((B, Q) => {
|
|
15779
15793
|
const E = A(B), i = () => Q.addIssue({
|
|
15780
|
-
code:
|
|
15794
|
+
code: U.custom,
|
|
15781
15795
|
...g(B)
|
|
15782
15796
|
});
|
|
15783
15797
|
return typeof Promise < "u" && E instanceof Promise ? E.then((o) => o ? !0 : (i(), !1)) : E ? !0 : (i(), !1);
|
|
@@ -15816,13 +15830,13 @@ class Z {
|
|
|
15816
15830
|
return pA.create(this);
|
|
15817
15831
|
}
|
|
15818
15832
|
promise() {
|
|
15819
|
-
return
|
|
15833
|
+
return Rg.create(this, this._def);
|
|
15820
15834
|
}
|
|
15821
15835
|
or(A) {
|
|
15822
|
-
return
|
|
15836
|
+
return Sg.create([this, A], this._def);
|
|
15823
15837
|
}
|
|
15824
15838
|
and(A) {
|
|
15825
|
-
return
|
|
15839
|
+
return Ng.create(this, A, this._def);
|
|
15826
15840
|
}
|
|
15827
15841
|
transform(A) {
|
|
15828
15842
|
return new cI({
|
|
@@ -15878,7 +15892,7 @@ class Z {
|
|
|
15878
15892
|
}
|
|
15879
15893
|
}
|
|
15880
15894
|
const ot = /^c[^\s-]{8,}$/i, st = /^[0-9a-z]+$/, tt = /^[0-9A-HJKMNP-TV-Z]{26}$/i, et = /^[0-9a-fA-F]{8}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{12}$/i, at = /^[a-z0-9_-]{21}$/i, nt = /^[A-Za-z0-9-_]+\.[A-Za-z0-9-_]+\.[A-Za-z0-9-_]*$/, rt = /^[-+]?P(?!$)(?:(?:[-+]?\d+Y)|(?:[-+]?\d+[.,]\d+Y$))?(?:(?:[-+]?\d+M)|(?:[-+]?\d+[.,]\d+M$))?(?:(?:[-+]?\d+W)|(?:[-+]?\d+[.,]\d+W$))?(?:(?:[-+]?\d+D)|(?:[-+]?\d+[.,]\d+D$))?(?:T(?=[\d+-])(?:(?:[-+]?\d+H)|(?:[-+]?\d+[.,]\d+H$))?(?:(?:[-+]?\d+M)|(?:[-+]?\d+[.,]\d+M$))?(?:[-+]?\d+(?:[.,]\d+)?S)?)??$/, Dt = /^(?!\.)(?!.*\.\.)([A-Z0-9_'+\-\.]*)[A-Z0-9_+-]@([A-Z0-9][A-Z0-9\-]*\.)+[A-Z]{2,}$/i, ht = "^(\\p{Extended_Pictographic}|\\p{Emoji_Component})+$";
|
|
15881
|
-
let
|
|
15895
|
+
let Vg;
|
|
15882
15896
|
const yt = /^(?:(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.){3}(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])$/, ct = /^(?:(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.){3}(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\/(3[0-2]|[12]?[0-9])$/, wt = /^(([0-9a-fA-F]{1,4}:){7,7}[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,7}:|([0-9a-fA-F]{1,4}:){1,6}:[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,5}(:[0-9a-fA-F]{1,4}){1,2}|([0-9a-fA-F]{1,4}:){1,4}(:[0-9a-fA-F]{1,4}){1,3}|([0-9a-fA-F]{1,4}:){1,3}(:[0-9a-fA-F]{1,4}){1,4}|([0-9a-fA-F]{1,4}:){1,2}(:[0-9a-fA-F]{1,4}){1,5}|[0-9a-fA-F]{1,4}:((:[0-9a-fA-F]{1,4}){1,6})|:((:[0-9a-fA-F]{1,4}){1,7}|:)|fe80:(:[0-9a-fA-F]{0,4}){0,4}%[0-9a-zA-Z]{1,}|::(ffff(:0{1,4}){0,1}:){0,1}((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])|([0-9a-fA-F]{1,4}:){1,4}:((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9]))$/, Gt = /^(([0-9a-fA-F]{1,4}:){7,7}[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,7}:|([0-9a-fA-F]{1,4}:){1,6}:[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,5}(:[0-9a-fA-F]{1,4}){1,2}|([0-9a-fA-F]{1,4}:){1,4}(:[0-9a-fA-F]{1,4}){1,3}|([0-9a-fA-F]{1,4}:){1,3}(:[0-9a-fA-F]{1,4}){1,4}|([0-9a-fA-F]{1,4}:){1,2}(:[0-9a-fA-F]{1,4}){1,5}|[0-9a-fA-F]{1,4}:((:[0-9a-fA-F]{1,4}){1,6})|:((:[0-9a-fA-F]{1,4}){1,7}|:)|fe80:(:[0-9a-fA-F]{0,4}){0,4}%[0-9a-zA-Z]{1,}|::(ffff(:0{1,4}){0,1}:){0,1}((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])|([0-9a-fA-F]{1,4}:){1,4}:((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9]))\/(12[0-8]|1[01][0-9]|[1-9]?[0-9])$/, Ft = /^([0-9a-zA-Z+/]{4})*(([0-9a-zA-Z+/]{2}==)|([0-9a-zA-Z+/]{3}=))?$/, St = /^([0-9a-zA-Z-_]{4})*(([0-9a-zA-Z-_]{2}(==)?)|([0-9a-zA-Z-_]{3}(=)?))?$/, aE = "((\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-((0[13578]|1[02])-(0[1-9]|[12]\\d|3[01])|(0[469]|11)-(0[1-9]|[12]\\d|30)|(02)-(0[1-9]|1\\d|2[0-8])))", Nt = new RegExp(`^${aE}$`);
|
|
15883
15897
|
function nE(C) {
|
|
15884
15898
|
let A = "[0-5]\\d";
|
|
@@ -15894,10 +15908,10 @@ function kt(C) {
|
|
|
15894
15908
|
const I = [];
|
|
15895
15909
|
return I.push(C.local ? "Z?" : "Z"), C.offset && I.push("([+-]\\d{2}:?\\d{2})"), A = `${A}(${I.join("|")})`, new RegExp(`^${A}$`);
|
|
15896
15910
|
}
|
|
15897
|
-
function
|
|
15911
|
+
function dt(C, A) {
|
|
15898
15912
|
return !!((A === "v4" || !A) && yt.test(C) || (A === "v6" || !A) && wt.test(C));
|
|
15899
15913
|
}
|
|
15900
|
-
function
|
|
15914
|
+
function Ut(C, A) {
|
|
15901
15915
|
if (!nt.test(C))
|
|
15902
15916
|
return !1;
|
|
15903
15917
|
try {
|
|
@@ -15918,7 +15932,7 @@ class PA extends Z {
|
|
|
15918
15932
|
if (this._def.coerce && (A.data = String(A.data)), this._getType(A) !== u.string) {
|
|
15919
15933
|
const Q = this._getOrReturnCtx(A);
|
|
15920
15934
|
return Y(Q, {
|
|
15921
|
-
code:
|
|
15935
|
+
code: U.invalid_type,
|
|
15922
15936
|
expected: u.string,
|
|
15923
15937
|
received: Q.parsedType
|
|
15924
15938
|
}), m;
|
|
@@ -15928,7 +15942,7 @@ class PA extends Z {
|
|
|
15928
15942
|
for (const Q of this._def.checks)
|
|
15929
15943
|
if (Q.kind === "min")
|
|
15930
15944
|
A.data.length < Q.value && (B = this._getOrReturnCtx(A, B), Y(B, {
|
|
15931
|
-
code:
|
|
15945
|
+
code: U.too_small,
|
|
15932
15946
|
minimum: Q.value,
|
|
15933
15947
|
type: "string",
|
|
15934
15948
|
inclusive: !0,
|
|
@@ -15937,7 +15951,7 @@ class PA extends Z {
|
|
|
15937
15951
|
}), g.dirty());
|
|
15938
15952
|
else if (Q.kind === "max")
|
|
15939
15953
|
A.data.length > Q.value && (B = this._getOrReturnCtx(A, B), Y(B, {
|
|
15940
|
-
code:
|
|
15954
|
+
code: U.too_big,
|
|
15941
15955
|
maximum: Q.value,
|
|
15942
15956
|
type: "string",
|
|
15943
15957
|
inclusive: !0,
|
|
@@ -15947,14 +15961,14 @@ class PA extends Z {
|
|
|
15947
15961
|
else if (Q.kind === "length") {
|
|
15948
15962
|
const E = A.data.length > Q.value, i = A.data.length < Q.value;
|
|
15949
15963
|
(E || i) && (B = this._getOrReturnCtx(A, B), E ? Y(B, {
|
|
15950
|
-
code:
|
|
15964
|
+
code: U.too_big,
|
|
15951
15965
|
maximum: Q.value,
|
|
15952
15966
|
type: "string",
|
|
15953
15967
|
inclusive: !0,
|
|
15954
15968
|
exact: !0,
|
|
15955
15969
|
message: Q.message
|
|
15956
15970
|
}) : i && Y(B, {
|
|
15957
|
-
code:
|
|
15971
|
+
code: U.too_small,
|
|
15958
15972
|
minimum: Q.value,
|
|
15959
15973
|
type: "string",
|
|
15960
15974
|
inclusive: !0,
|
|
@@ -15964,43 +15978,43 @@ class PA extends Z {
|
|
|
15964
15978
|
} else if (Q.kind === "email")
|
|
15965
15979
|
Dt.test(A.data) || (B = this._getOrReturnCtx(A, B), Y(B, {
|
|
15966
15980
|
validation: "email",
|
|
15967
|
-
code:
|
|
15981
|
+
code: U.invalid_string,
|
|
15968
15982
|
message: Q.message
|
|
15969
15983
|
}), g.dirty());
|
|
15970
15984
|
else if (Q.kind === "emoji")
|
|
15971
|
-
|
|
15985
|
+
Vg || (Vg = new RegExp(ht, "u")), Vg.test(A.data) || (B = this._getOrReturnCtx(A, B), Y(B, {
|
|
15972
15986
|
validation: "emoji",
|
|
15973
|
-
code:
|
|
15987
|
+
code: U.invalid_string,
|
|
15974
15988
|
message: Q.message
|
|
15975
15989
|
}), g.dirty());
|
|
15976
15990
|
else if (Q.kind === "uuid")
|
|
15977
15991
|
et.test(A.data) || (B = this._getOrReturnCtx(A, B), Y(B, {
|
|
15978
15992
|
validation: "uuid",
|
|
15979
|
-
code:
|
|
15993
|
+
code: U.invalid_string,
|
|
15980
15994
|
message: Q.message
|
|
15981
15995
|
}), g.dirty());
|
|
15982
15996
|
else if (Q.kind === "nanoid")
|
|
15983
15997
|
at.test(A.data) || (B = this._getOrReturnCtx(A, B), Y(B, {
|
|
15984
15998
|
validation: "nanoid",
|
|
15985
|
-
code:
|
|
15999
|
+
code: U.invalid_string,
|
|
15986
16000
|
message: Q.message
|
|
15987
16001
|
}), g.dirty());
|
|
15988
16002
|
else if (Q.kind === "cuid")
|
|
15989
16003
|
ot.test(A.data) || (B = this._getOrReturnCtx(A, B), Y(B, {
|
|
15990
16004
|
validation: "cuid",
|
|
15991
|
-
code:
|
|
16005
|
+
code: U.invalid_string,
|
|
15992
16006
|
message: Q.message
|
|
15993
16007
|
}), g.dirty());
|
|
15994
16008
|
else if (Q.kind === "cuid2")
|
|
15995
16009
|
st.test(A.data) || (B = this._getOrReturnCtx(A, B), Y(B, {
|
|
15996
16010
|
validation: "cuid2",
|
|
15997
|
-
code:
|
|
16011
|
+
code: U.invalid_string,
|
|
15998
16012
|
message: Q.message
|
|
15999
16013
|
}), g.dirty());
|
|
16000
16014
|
else if (Q.kind === "ulid")
|
|
16001
16015
|
tt.test(A.data) || (B = this._getOrReturnCtx(A, B), Y(B, {
|
|
16002
16016
|
validation: "ulid",
|
|
16003
|
-
code:
|
|
16017
|
+
code: U.invalid_string,
|
|
16004
16018
|
message: Q.message
|
|
16005
16019
|
}), g.dirty());
|
|
16006
16020
|
else if (Q.kind === "url")
|
|
@@ -16009,61 +16023,61 @@ class PA extends Z {
|
|
|
16009
16023
|
} catch {
|
|
16010
16024
|
B = this._getOrReturnCtx(A, B), Y(B, {
|
|
16011
16025
|
validation: "url",
|
|
16012
|
-
code:
|
|
16026
|
+
code: U.invalid_string,
|
|
16013
16027
|
message: Q.message
|
|
16014
16028
|
}), g.dirty();
|
|
16015
16029
|
}
|
|
16016
16030
|
else Q.kind === "regex" ? (Q.regex.lastIndex = 0, Q.regex.test(A.data) || (B = this._getOrReturnCtx(A, B), Y(B, {
|
|
16017
16031
|
validation: "regex",
|
|
16018
|
-
code:
|
|
16032
|
+
code: U.invalid_string,
|
|
16019
16033
|
message: Q.message
|
|
16020
16034
|
}), g.dirty())) : Q.kind === "trim" ? A.data = A.data.trim() : Q.kind === "includes" ? A.data.includes(Q.value, Q.position) || (B = this._getOrReturnCtx(A, B), Y(B, {
|
|
16021
|
-
code:
|
|
16035
|
+
code: U.invalid_string,
|
|
16022
16036
|
validation: { includes: Q.value, position: Q.position },
|
|
16023
16037
|
message: Q.message
|
|
16024
16038
|
}), g.dirty()) : Q.kind === "toLowerCase" ? A.data = A.data.toLowerCase() : Q.kind === "toUpperCase" ? A.data = A.data.toUpperCase() : Q.kind === "startsWith" ? A.data.startsWith(Q.value) || (B = this._getOrReturnCtx(A, B), Y(B, {
|
|
16025
|
-
code:
|
|
16039
|
+
code: U.invalid_string,
|
|
16026
16040
|
validation: { startsWith: Q.value },
|
|
16027
16041
|
message: Q.message
|
|
16028
16042
|
}), g.dirty()) : Q.kind === "endsWith" ? A.data.endsWith(Q.value) || (B = this._getOrReturnCtx(A, B), Y(B, {
|
|
16029
|
-
code:
|
|
16043
|
+
code: U.invalid_string,
|
|
16030
16044
|
validation: { endsWith: Q.value },
|
|
16031
16045
|
message: Q.message
|
|
16032
16046
|
}), g.dirty()) : Q.kind === "datetime" ? kt(Q).test(A.data) || (B = this._getOrReturnCtx(A, B), Y(B, {
|
|
16033
|
-
code:
|
|
16047
|
+
code: U.invalid_string,
|
|
16034
16048
|
validation: "datetime",
|
|
16035
16049
|
message: Q.message
|
|
16036
16050
|
}), g.dirty()) : Q.kind === "date" ? Nt.test(A.data) || (B = this._getOrReturnCtx(A, B), Y(B, {
|
|
16037
|
-
code:
|
|
16051
|
+
code: U.invalid_string,
|
|
16038
16052
|
validation: "date",
|
|
16039
16053
|
message: Q.message
|
|
16040
16054
|
}), g.dirty()) : Q.kind === "time" ? Rt(Q).test(A.data) || (B = this._getOrReturnCtx(A, B), Y(B, {
|
|
16041
|
-
code:
|
|
16055
|
+
code: U.invalid_string,
|
|
16042
16056
|
validation: "time",
|
|
16043
16057
|
message: Q.message
|
|
16044
16058
|
}), g.dirty()) : Q.kind === "duration" ? rt.test(A.data) || (B = this._getOrReturnCtx(A, B), Y(B, {
|
|
16045
16059
|
validation: "duration",
|
|
16046
|
-
code:
|
|
16060
|
+
code: U.invalid_string,
|
|
16047
16061
|
message: Q.message
|
|
16048
|
-
}), g.dirty()) : Q.kind === "ip" ?
|
|
16062
|
+
}), g.dirty()) : Q.kind === "ip" ? dt(A.data, Q.version) || (B = this._getOrReturnCtx(A, B), Y(B, {
|
|
16049
16063
|
validation: "ip",
|
|
16050
|
-
code:
|
|
16064
|
+
code: U.invalid_string,
|
|
16051
16065
|
message: Q.message
|
|
16052
|
-
}), g.dirty()) : Q.kind === "jwt" ?
|
|
16066
|
+
}), g.dirty()) : Q.kind === "jwt" ? Ut(A.data, Q.alg) || (B = this._getOrReturnCtx(A, B), Y(B, {
|
|
16053
16067
|
validation: "jwt",
|
|
16054
|
-
code:
|
|
16068
|
+
code: U.invalid_string,
|
|
16055
16069
|
message: Q.message
|
|
16056
16070
|
}), g.dirty()) : Q.kind === "cidr" ? lt(A.data, Q.version) || (B = this._getOrReturnCtx(A, B), Y(B, {
|
|
16057
16071
|
validation: "cidr",
|
|
16058
|
-
code:
|
|
16072
|
+
code: U.invalid_string,
|
|
16059
16073
|
message: Q.message
|
|
16060
16074
|
}), g.dirty()) : Q.kind === "base64" ? Ft.test(A.data) || (B = this._getOrReturnCtx(A, B), Y(B, {
|
|
16061
16075
|
validation: "base64",
|
|
16062
|
-
code:
|
|
16076
|
+
code: U.invalid_string,
|
|
16063
16077
|
message: Q.message
|
|
16064
16078
|
}), g.dirty()) : Q.kind === "base64url" ? St.test(A.data) || (B = this._getOrReturnCtx(A, B), Y(B, {
|
|
16065
16079
|
validation: "base64url",
|
|
16066
|
-
code:
|
|
16080
|
+
code: U.invalid_string,
|
|
16067
16081
|
message: Q.message
|
|
16068
16082
|
}), g.dirty()) : O.assertNever(Q);
|
|
16069
16083
|
return { status: g.value, value: A.data };
|
|
@@ -16071,7 +16085,7 @@ class PA extends Z {
|
|
|
16071
16085
|
_regex(A, I, g) {
|
|
16072
16086
|
return this.refinement((B) => A.test(B), {
|
|
16073
16087
|
validation: I,
|
|
16074
|
-
code:
|
|
16088
|
+
code: U.invalid_string,
|
|
16075
16089
|
...K.errToObj(g)
|
|
16076
16090
|
});
|
|
16077
16091
|
}
|
|
@@ -16308,7 +16322,7 @@ class hI extends Z {
|
|
|
16308
16322
|
if (this._def.coerce && (A.data = Number(A.data)), this._getType(A) !== u.number) {
|
|
16309
16323
|
const Q = this._getOrReturnCtx(A);
|
|
16310
16324
|
return Y(Q, {
|
|
16311
|
-
code:
|
|
16325
|
+
code: U.invalid_type,
|
|
16312
16326
|
expected: u.number,
|
|
16313
16327
|
received: Q.parsedType
|
|
16314
16328
|
}), m;
|
|
@@ -16317,30 +16331,30 @@ class hI extends Z {
|
|
|
16317
16331
|
const B = new NA();
|
|
16318
16332
|
for (const Q of this._def.checks)
|
|
16319
16333
|
Q.kind === "int" ? O.isInteger(A.data) || (g = this._getOrReturnCtx(A, g), Y(g, {
|
|
16320
|
-
code:
|
|
16334
|
+
code: U.invalid_type,
|
|
16321
16335
|
expected: "integer",
|
|
16322
16336
|
received: "float",
|
|
16323
16337
|
message: Q.message
|
|
16324
16338
|
}), B.dirty()) : Q.kind === "min" ? (Q.inclusive ? A.data < Q.value : A.data <= Q.value) && (g = this._getOrReturnCtx(A, g), Y(g, {
|
|
16325
|
-
code:
|
|
16339
|
+
code: U.too_small,
|
|
16326
16340
|
minimum: Q.value,
|
|
16327
16341
|
type: "number",
|
|
16328
16342
|
inclusive: Q.inclusive,
|
|
16329
16343
|
exact: !1,
|
|
16330
16344
|
message: Q.message
|
|
16331
16345
|
}), B.dirty()) : Q.kind === "max" ? (Q.inclusive ? A.data > Q.value : A.data >= Q.value) && (g = this._getOrReturnCtx(A, g), Y(g, {
|
|
16332
|
-
code:
|
|
16346
|
+
code: U.too_big,
|
|
16333
16347
|
maximum: Q.value,
|
|
16334
16348
|
type: "number",
|
|
16335
16349
|
inclusive: Q.inclusive,
|
|
16336
16350
|
exact: !1,
|
|
16337
16351
|
message: Q.message
|
|
16338
16352
|
}), B.dirty()) : Q.kind === "multipleOf" ? Lt(A.data, Q.value) !== 0 && (g = this._getOrReturnCtx(A, g), Y(g, {
|
|
16339
|
-
code:
|
|
16353
|
+
code: U.not_multiple_of,
|
|
16340
16354
|
multipleOf: Q.value,
|
|
16341
16355
|
message: Q.message
|
|
16342
16356
|
}), B.dirty()) : Q.kind === "finite" ? Number.isFinite(A.data) || (g = this._getOrReturnCtx(A, g), Y(g, {
|
|
16343
|
-
code:
|
|
16357
|
+
code: U.not_finite,
|
|
16344
16358
|
message: Q.message
|
|
16345
16359
|
}), B.dirty()) : O.assertNever(Q);
|
|
16346
16360
|
return { status: B.value, value: A.data };
|
|
@@ -16472,7 +16486,7 @@ hI.create = (C) => new hI({
|
|
|
16472
16486
|
coerce: C?.coerce || !1,
|
|
16473
16487
|
...b(C)
|
|
16474
16488
|
});
|
|
16475
|
-
class
|
|
16489
|
+
class bI extends Z {
|
|
16476
16490
|
constructor() {
|
|
16477
16491
|
super(...arguments), this.min = this.gte, this.max = this.lte;
|
|
16478
16492
|
}
|
|
@@ -16489,19 +16503,19 @@ class mI extends Z {
|
|
|
16489
16503
|
const B = new NA();
|
|
16490
16504
|
for (const Q of this._def.checks)
|
|
16491
16505
|
Q.kind === "min" ? (Q.inclusive ? A.data < Q.value : A.data <= Q.value) && (g = this._getOrReturnCtx(A, g), Y(g, {
|
|
16492
|
-
code:
|
|
16506
|
+
code: U.too_small,
|
|
16493
16507
|
type: "bigint",
|
|
16494
16508
|
minimum: Q.value,
|
|
16495
16509
|
inclusive: Q.inclusive,
|
|
16496
16510
|
message: Q.message
|
|
16497
16511
|
}), B.dirty()) : Q.kind === "max" ? (Q.inclusive ? A.data > Q.value : A.data >= Q.value) && (g = this._getOrReturnCtx(A, g), Y(g, {
|
|
16498
|
-
code:
|
|
16512
|
+
code: U.too_big,
|
|
16499
16513
|
type: "bigint",
|
|
16500
16514
|
maximum: Q.value,
|
|
16501
16515
|
inclusive: Q.inclusive,
|
|
16502
16516
|
message: Q.message
|
|
16503
16517
|
}), B.dirty()) : Q.kind === "multipleOf" ? A.data % Q.value !== BigInt(0) && (g = this._getOrReturnCtx(A, g), Y(g, {
|
|
16504
|
-
code:
|
|
16518
|
+
code: U.not_multiple_of,
|
|
16505
16519
|
multipleOf: Q.value,
|
|
16506
16520
|
message: Q.message
|
|
16507
16521
|
}), B.dirty()) : O.assertNever(Q);
|
|
@@ -16510,7 +16524,7 @@ class mI extends Z {
|
|
|
16510
16524
|
_getInvalidInput(A) {
|
|
16511
16525
|
const I = this._getOrReturnCtx(A);
|
|
16512
16526
|
return Y(I, {
|
|
16513
|
-
code:
|
|
16527
|
+
code: U.invalid_type,
|
|
16514
16528
|
expected: u.bigint,
|
|
16515
16529
|
received: I.parsedType
|
|
16516
16530
|
}), m;
|
|
@@ -16528,7 +16542,7 @@ class mI extends Z {
|
|
|
16528
16542
|
return this.setLimit("max", A, !1, K.toString(I));
|
|
16529
16543
|
}
|
|
16530
16544
|
setLimit(A, I, g, B) {
|
|
16531
|
-
return new
|
|
16545
|
+
return new bI({
|
|
16532
16546
|
...this._def,
|
|
16533
16547
|
checks: [
|
|
16534
16548
|
...this._def.checks,
|
|
@@ -16542,7 +16556,7 @@ class mI extends Z {
|
|
|
16542
16556
|
});
|
|
16543
16557
|
}
|
|
16544
16558
|
_addCheck(A) {
|
|
16545
|
-
return new
|
|
16559
|
+
return new bI({
|
|
16546
16560
|
...this._def,
|
|
16547
16561
|
checks: [...this._def.checks, A]
|
|
16548
16562
|
});
|
|
@@ -16599,7 +16613,7 @@ class mI extends Z {
|
|
|
16599
16613
|
return A;
|
|
16600
16614
|
}
|
|
16601
16615
|
}
|
|
16602
|
-
|
|
16616
|
+
bI.create = (C) => new bI({
|
|
16603
16617
|
checks: [],
|
|
16604
16618
|
typeName: x.ZodBigInt,
|
|
16605
16619
|
coerce: C?.coerce ?? !1,
|
|
@@ -16610,7 +16624,7 @@ class aB extends Z {
|
|
|
16610
16624
|
if (this._def.coerce && (A.data = !!A.data), this._getType(A) !== u.boolean) {
|
|
16611
16625
|
const g = this._getOrReturnCtx(A);
|
|
16612
16626
|
return Y(g, {
|
|
16613
|
-
code:
|
|
16627
|
+
code: U.invalid_type,
|
|
16614
16628
|
expected: u.boolean,
|
|
16615
16629
|
received: g.parsedType
|
|
16616
16630
|
}), m;
|
|
@@ -16623,12 +16637,12 @@ aB.create = (C) => new aB({
|
|
|
16623
16637
|
coerce: C?.coerce || !1,
|
|
16624
16638
|
...b(C)
|
|
16625
16639
|
});
|
|
16626
|
-
class
|
|
16640
|
+
class Fg extends Z {
|
|
16627
16641
|
_parse(A) {
|
|
16628
16642
|
if (this._def.coerce && (A.data = new Date(A.data)), this._getType(A) !== u.date) {
|
|
16629
16643
|
const Q = this._getOrReturnCtx(A);
|
|
16630
16644
|
return Y(Q, {
|
|
16631
|
-
code:
|
|
16645
|
+
code: U.invalid_type,
|
|
16632
16646
|
expected: u.date,
|
|
16633
16647
|
received: Q.parsedType
|
|
16634
16648
|
}), m;
|
|
@@ -16636,21 +16650,21 @@ class Gg extends Z {
|
|
|
16636
16650
|
if (Number.isNaN(A.data.getTime())) {
|
|
16637
16651
|
const Q = this._getOrReturnCtx(A);
|
|
16638
16652
|
return Y(Q, {
|
|
16639
|
-
code:
|
|
16653
|
+
code: U.invalid_date
|
|
16640
16654
|
}), m;
|
|
16641
16655
|
}
|
|
16642
16656
|
const g = new NA();
|
|
16643
16657
|
let B;
|
|
16644
16658
|
for (const Q of this._def.checks)
|
|
16645
16659
|
Q.kind === "min" ? A.data.getTime() < Q.value && (B = this._getOrReturnCtx(A, B), Y(B, {
|
|
16646
|
-
code:
|
|
16660
|
+
code: U.too_small,
|
|
16647
16661
|
message: Q.message,
|
|
16648
16662
|
inclusive: !0,
|
|
16649
16663
|
exact: !1,
|
|
16650
16664
|
minimum: Q.value,
|
|
16651
16665
|
type: "date"
|
|
16652
16666
|
}), g.dirty()) : Q.kind === "max" ? A.data.getTime() > Q.value && (B = this._getOrReturnCtx(A, B), Y(B, {
|
|
16653
|
-
code:
|
|
16667
|
+
code: U.too_big,
|
|
16654
16668
|
message: Q.message,
|
|
16655
16669
|
inclusive: !0,
|
|
16656
16670
|
exact: !1,
|
|
@@ -16663,7 +16677,7 @@ class Gg extends Z {
|
|
|
16663
16677
|
};
|
|
16664
16678
|
}
|
|
16665
16679
|
_addCheck(A) {
|
|
16666
|
-
return new
|
|
16680
|
+
return new Fg({
|
|
16667
16681
|
...this._def,
|
|
16668
16682
|
checks: [...this._def.checks, A]
|
|
16669
16683
|
});
|
|
@@ -16695,7 +16709,7 @@ class Gg extends Z {
|
|
|
16695
16709
|
return A != null ? new Date(A) : null;
|
|
16696
16710
|
}
|
|
16697
16711
|
}
|
|
16698
|
-
|
|
16712
|
+
Fg.create = (C) => new Fg({
|
|
16699
16713
|
checks: [],
|
|
16700
16714
|
coerce: C?.coerce || !1,
|
|
16701
16715
|
typeName: x.ZodDate,
|
|
@@ -16706,7 +16720,7 @@ class BQ extends Z {
|
|
|
16706
16720
|
if (this._getType(A) !== u.symbol) {
|
|
16707
16721
|
const g = this._getOrReturnCtx(A);
|
|
16708
16722
|
return Y(g, {
|
|
16709
|
-
code:
|
|
16723
|
+
code: U.invalid_type,
|
|
16710
16724
|
expected: u.symbol,
|
|
16711
16725
|
received: g.parsedType
|
|
16712
16726
|
}), m;
|
|
@@ -16723,7 +16737,7 @@ class CQ extends Z {
|
|
|
16723
16737
|
if (this._getType(A) !== u.undefined) {
|
|
16724
16738
|
const g = this._getOrReturnCtx(A);
|
|
16725
16739
|
return Y(g, {
|
|
16726
|
-
code:
|
|
16740
|
+
code: U.invalid_type,
|
|
16727
16741
|
expected: u.undefined,
|
|
16728
16742
|
received: g.parsedType
|
|
16729
16743
|
}), m;
|
|
@@ -16740,7 +16754,7 @@ class QQ extends Z {
|
|
|
16740
16754
|
if (this._getType(A) !== u.null) {
|
|
16741
16755
|
const g = this._getOrReturnCtx(A);
|
|
16742
16756
|
return Y(g, {
|
|
16743
|
-
code:
|
|
16757
|
+
code: U.invalid_type,
|
|
16744
16758
|
expected: u.null,
|
|
16745
16759
|
received: g.parsedType
|
|
16746
16760
|
}), m;
|
|
@@ -16780,7 +16794,7 @@ class jA extends Z {
|
|
|
16780
16794
|
_parse(A) {
|
|
16781
16795
|
const I = this._getOrReturnCtx(A);
|
|
16782
16796
|
return Y(I, {
|
|
16783
|
-
code:
|
|
16797
|
+
code: U.invalid_type,
|
|
16784
16798
|
expected: u.never,
|
|
16785
16799
|
received: I.parsedType
|
|
16786
16800
|
}), m;
|
|
@@ -16795,7 +16809,7 @@ class iQ extends Z {
|
|
|
16795
16809
|
if (this._getType(A) !== u.undefined) {
|
|
16796
16810
|
const g = this._getOrReturnCtx(A);
|
|
16797
16811
|
return Y(g, {
|
|
16798
|
-
code:
|
|
16812
|
+
code: U.invalid_type,
|
|
16799
16813
|
expected: u.void,
|
|
16800
16814
|
received: g.parsedType
|
|
16801
16815
|
}), m;
|
|
@@ -16812,14 +16826,14 @@ class pA extends Z {
|
|
|
16812
16826
|
const { ctx: I, status: g } = this._processInputParams(A), B = this._def;
|
|
16813
16827
|
if (I.parsedType !== u.array)
|
|
16814
16828
|
return Y(I, {
|
|
16815
|
-
code:
|
|
16829
|
+
code: U.invalid_type,
|
|
16816
16830
|
expected: u.array,
|
|
16817
16831
|
received: I.parsedType
|
|
16818
16832
|
}), m;
|
|
16819
16833
|
if (B.exactLength !== null) {
|
|
16820
16834
|
const E = I.data.length > B.exactLength.value, i = I.data.length < B.exactLength.value;
|
|
16821
16835
|
(E || i) && (Y(I, {
|
|
16822
|
-
code: E ?
|
|
16836
|
+
code: E ? U.too_big : U.too_small,
|
|
16823
16837
|
minimum: i ? B.exactLength.value : void 0,
|
|
16824
16838
|
maximum: E ? B.exactLength.value : void 0,
|
|
16825
16839
|
type: "array",
|
|
@@ -16829,14 +16843,14 @@ class pA extends Z {
|
|
|
16829
16843
|
}), g.dirty());
|
|
16830
16844
|
}
|
|
16831
16845
|
if (B.minLength !== null && I.data.length < B.minLength.value && (Y(I, {
|
|
16832
|
-
code:
|
|
16846
|
+
code: U.too_small,
|
|
16833
16847
|
minimum: B.minLength.value,
|
|
16834
16848
|
type: "array",
|
|
16835
16849
|
inclusive: !0,
|
|
16836
16850
|
exact: !1,
|
|
16837
16851
|
message: B.minLength.message
|
|
16838
16852
|
}), g.dirty()), B.maxLength !== null && I.data.length > B.maxLength.value && (Y(I, {
|
|
16839
|
-
code:
|
|
16853
|
+
code: U.too_big,
|
|
16840
16854
|
maximum: B.maxLength.value,
|
|
16841
16855
|
type: "array",
|
|
16842
16856
|
inclusive: !0,
|
|
@@ -16910,7 +16924,7 @@ class eA extends Z {
|
|
|
16910
16924
|
if (this._getType(A) !== u.object) {
|
|
16911
16925
|
const s = this._getOrReturnCtx(A);
|
|
16912
16926
|
return Y(s, {
|
|
16913
|
-
code:
|
|
16927
|
+
code: U.invalid_type,
|
|
16914
16928
|
expected: u.object,
|
|
16915
16929
|
received: s.parsedType
|
|
16916
16930
|
}), m;
|
|
@@ -16938,7 +16952,7 @@ class eA extends Z {
|
|
|
16938
16952
|
});
|
|
16939
16953
|
else if (s === "strict")
|
|
16940
16954
|
i.length > 0 && (Y(B, {
|
|
16941
|
-
code:
|
|
16955
|
+
code: U.unrecognized_keys,
|
|
16942
16956
|
keys: i
|
|
16943
16957
|
}), g.dirty());
|
|
16944
16958
|
else if (s !== "strip") throw new Error("Internal ZodObject error: invalid unknownKeys value.");
|
|
@@ -17183,7 +17197,7 @@ eA.lazycreate = (C, A) => new eA({
|
|
|
17183
17197
|
typeName: x.ZodObject,
|
|
17184
17198
|
...b(A)
|
|
17185
17199
|
});
|
|
17186
|
-
class
|
|
17200
|
+
class Sg extends Z {
|
|
17187
17201
|
_parse(A) {
|
|
17188
17202
|
const { ctx: I } = this._processInputParams(A), g = this._def.options;
|
|
17189
17203
|
function B(Q) {
|
|
@@ -17195,7 +17209,7 @@ class Fg extends Z {
|
|
|
17195
17209
|
return I.common.issues.push(...i.ctx.common.issues), i.result;
|
|
17196
17210
|
const E = Q.map((i) => new WA(i.ctx.common.issues));
|
|
17197
17211
|
return Y(I, {
|
|
17198
|
-
code:
|
|
17212
|
+
code: U.invalid_union,
|
|
17199
17213
|
unionErrors: E
|
|
17200
17214
|
}), m;
|
|
17201
17215
|
}
|
|
@@ -17242,7 +17256,7 @@ class Fg extends Z {
|
|
|
17242
17256
|
return I.common.issues.push(...Q.ctx.common.issues), Q.result;
|
|
17243
17257
|
const i = E.map((o) => new WA(o));
|
|
17244
17258
|
return Y(I, {
|
|
17245
|
-
code:
|
|
17259
|
+
code: U.invalid_union,
|
|
17246
17260
|
unionErrors: i
|
|
17247
17261
|
}), m;
|
|
17248
17262
|
}
|
|
@@ -17251,7 +17265,7 @@ class Fg extends Z {
|
|
|
17251
17265
|
return this._def.options;
|
|
17252
17266
|
}
|
|
17253
17267
|
}
|
|
17254
|
-
|
|
17268
|
+
Sg.create = (C, A) => new Sg({
|
|
17255
17269
|
options: C,
|
|
17256
17270
|
typeName: x.ZodUnion,
|
|
17257
17271
|
...b(A)
|
|
@@ -17282,14 +17296,14 @@ function rB(C, A) {
|
|
|
17282
17296
|
return { valid: !0, data: B };
|
|
17283
17297
|
} else return I === u.date && g === u.date && +C == +A ? { valid: !0, data: C } : { valid: !1 };
|
|
17284
17298
|
}
|
|
17285
|
-
class
|
|
17299
|
+
class Ng extends Z {
|
|
17286
17300
|
_parse(A) {
|
|
17287
17301
|
const { status: I, ctx: g } = this._processInputParams(A), B = (Q, E) => {
|
|
17288
17302
|
if (AQ(Q) || AQ(E))
|
|
17289
17303
|
return m;
|
|
17290
17304
|
const i = rB(Q.value, E.value);
|
|
17291
17305
|
return i.valid ? ((IQ(Q) || IQ(E)) && I.dirty(), { status: I.value, value: i.data }) : (Y(g, {
|
|
17292
|
-
code:
|
|
17306
|
+
code: U.invalid_intersection_types
|
|
17293
17307
|
}), m);
|
|
17294
17308
|
};
|
|
17295
17309
|
return g.common.async ? Promise.all([
|
|
@@ -17314,7 +17328,7 @@ class Sg extends Z {
|
|
|
17314
17328
|
}));
|
|
17315
17329
|
}
|
|
17316
17330
|
}
|
|
17317
|
-
|
|
17331
|
+
Ng.create = (C, A, I) => new Ng({
|
|
17318
17332
|
left: C,
|
|
17319
17333
|
right: A,
|
|
17320
17334
|
typeName: x.ZodIntersection,
|
|
@@ -17325,20 +17339,20 @@ class QI extends Z {
|
|
|
17325
17339
|
const { status: I, ctx: g } = this._processInputParams(A);
|
|
17326
17340
|
if (g.parsedType !== u.array)
|
|
17327
17341
|
return Y(g, {
|
|
17328
|
-
code:
|
|
17342
|
+
code: U.invalid_type,
|
|
17329
17343
|
expected: u.array,
|
|
17330
17344
|
received: g.parsedType
|
|
17331
17345
|
}), m;
|
|
17332
17346
|
if (g.data.length < this._def.items.length)
|
|
17333
17347
|
return Y(g, {
|
|
17334
|
-
code:
|
|
17348
|
+
code: U.too_small,
|
|
17335
17349
|
minimum: this._def.items.length,
|
|
17336
17350
|
inclusive: !0,
|
|
17337
17351
|
exact: !1,
|
|
17338
17352
|
type: "array"
|
|
17339
17353
|
}), m;
|
|
17340
17354
|
!this._def.rest && g.data.length > this._def.items.length && (Y(g, {
|
|
17341
|
-
code:
|
|
17355
|
+
code: U.too_big,
|
|
17342
17356
|
maximum: this._def.items.length,
|
|
17343
17357
|
inclusive: !0,
|
|
17344
17358
|
exact: !1,
|
|
@@ -17381,7 +17395,7 @@ class oQ extends Z {
|
|
|
17381
17395
|
const { status: I, ctx: g } = this._processInputParams(A);
|
|
17382
17396
|
if (g.parsedType !== u.map)
|
|
17383
17397
|
return Y(g, {
|
|
17384
|
-
code:
|
|
17398
|
+
code: U.invalid_type,
|
|
17385
17399
|
expected: u.map,
|
|
17386
17400
|
received: g.parsedType
|
|
17387
17401
|
}), m;
|
|
@@ -17418,25 +17432,25 @@ oQ.create = (C, A, I) => new oQ({
|
|
|
17418
17432
|
typeName: x.ZodMap,
|
|
17419
17433
|
...b(I)
|
|
17420
17434
|
});
|
|
17421
|
-
class
|
|
17435
|
+
class TI extends Z {
|
|
17422
17436
|
_parse(A) {
|
|
17423
17437
|
const { status: I, ctx: g } = this._processInputParams(A);
|
|
17424
17438
|
if (g.parsedType !== u.set)
|
|
17425
17439
|
return Y(g, {
|
|
17426
|
-
code:
|
|
17440
|
+
code: U.invalid_type,
|
|
17427
17441
|
expected: u.set,
|
|
17428
17442
|
received: g.parsedType
|
|
17429
17443
|
}), m;
|
|
17430
17444
|
const B = this._def;
|
|
17431
17445
|
B.minSize !== null && g.data.size < B.minSize.value && (Y(g, {
|
|
17432
|
-
code:
|
|
17446
|
+
code: U.too_small,
|
|
17433
17447
|
minimum: B.minSize.value,
|
|
17434
17448
|
type: "set",
|
|
17435
17449
|
inclusive: !0,
|
|
17436
17450
|
exact: !1,
|
|
17437
17451
|
message: B.minSize.message
|
|
17438
17452
|
}), I.dirty()), B.maxSize !== null && g.data.size > B.maxSize.value && (Y(g, {
|
|
17439
|
-
code:
|
|
17453
|
+
code: U.too_big,
|
|
17440
17454
|
maximum: B.maxSize.value,
|
|
17441
17455
|
type: "set",
|
|
17442
17456
|
inclusive: !0,
|
|
@@ -17457,13 +17471,13 @@ class xI extends Z {
|
|
|
17457
17471
|
return g.common.async ? Promise.all(i).then((o) => E(o)) : E(i);
|
|
17458
17472
|
}
|
|
17459
17473
|
min(A, I) {
|
|
17460
|
-
return new
|
|
17474
|
+
return new TI({
|
|
17461
17475
|
...this._def,
|
|
17462
17476
|
minSize: { value: A, message: K.toString(I) }
|
|
17463
17477
|
});
|
|
17464
17478
|
}
|
|
17465
17479
|
max(A, I) {
|
|
17466
|
-
return new
|
|
17480
|
+
return new TI({
|
|
17467
17481
|
...this._def,
|
|
17468
17482
|
maxSize: { value: A, message: K.toString(I) }
|
|
17469
17483
|
});
|
|
@@ -17475,7 +17489,7 @@ class xI extends Z {
|
|
|
17475
17489
|
return this.min(1, A);
|
|
17476
17490
|
}
|
|
17477
17491
|
}
|
|
17478
|
-
|
|
17492
|
+
TI.create = (C, A) => new TI({
|
|
17479
17493
|
valueType: C,
|
|
17480
17494
|
minSize: null,
|
|
17481
17495
|
maxSize: null,
|
|
@@ -17502,7 +17516,7 @@ class DB extends Z {
|
|
|
17502
17516
|
const I = this._getOrReturnCtx(A);
|
|
17503
17517
|
return Y(I, {
|
|
17504
17518
|
received: I.data,
|
|
17505
|
-
code:
|
|
17519
|
+
code: U.invalid_literal,
|
|
17506
17520
|
expected: this._def.value
|
|
17507
17521
|
}), m;
|
|
17508
17522
|
}
|
|
@@ -17531,14 +17545,14 @@ class yI extends Z {
|
|
|
17531
17545
|
return Y(I, {
|
|
17532
17546
|
expected: O.joinValues(g),
|
|
17533
17547
|
received: I.parsedType,
|
|
17534
|
-
code:
|
|
17548
|
+
code: U.invalid_type
|
|
17535
17549
|
}), m;
|
|
17536
17550
|
}
|
|
17537
17551
|
if (this._cache || (this._cache = new Set(this._def.values)), !this._cache.has(A.data)) {
|
|
17538
17552
|
const I = this._getOrReturnCtx(A), g = this._def.values;
|
|
17539
17553
|
return Y(I, {
|
|
17540
17554
|
received: I.data,
|
|
17541
|
-
code:
|
|
17555
|
+
code: U.invalid_enum_value,
|
|
17542
17556
|
options: g
|
|
17543
17557
|
}), m;
|
|
17544
17558
|
}
|
|
@@ -17587,14 +17601,14 @@ class tQ extends Z {
|
|
|
17587
17601
|
return Y(g, {
|
|
17588
17602
|
expected: O.joinValues(B),
|
|
17589
17603
|
received: g.parsedType,
|
|
17590
|
-
code:
|
|
17604
|
+
code: U.invalid_type
|
|
17591
17605
|
}), m;
|
|
17592
17606
|
}
|
|
17593
17607
|
if (this._cache || (this._cache = new Set(O.getValidEnumValues(this._def.values))), !this._cache.has(A.data)) {
|
|
17594
17608
|
const B = O.objectValues(I);
|
|
17595
17609
|
return Y(g, {
|
|
17596
17610
|
received: g.data,
|
|
17597
|
-
code:
|
|
17611
|
+
code: U.invalid_enum_value,
|
|
17598
17612
|
options: B
|
|
17599
17613
|
}), m;
|
|
17600
17614
|
}
|
|
@@ -17609,7 +17623,7 @@ tQ.create = (C, A) => new tQ({
|
|
|
17609
17623
|
typeName: x.ZodNativeEnum,
|
|
17610
17624
|
...b(A)
|
|
17611
17625
|
});
|
|
17612
|
-
class
|
|
17626
|
+
class Rg extends Z {
|
|
17613
17627
|
unwrap() {
|
|
17614
17628
|
return this._def.type;
|
|
17615
17629
|
}
|
|
@@ -17617,7 +17631,7 @@ class Ng extends Z {
|
|
|
17617
17631
|
const { ctx: I } = this._processInputParams(A);
|
|
17618
17632
|
if (I.parsedType !== u.promise && I.common.async === !1)
|
|
17619
17633
|
return Y(I, {
|
|
17620
|
-
code:
|
|
17634
|
+
code: U.invalid_type,
|
|
17621
17635
|
expected: u.promise,
|
|
17622
17636
|
received: I.parsedType
|
|
17623
17637
|
}), m;
|
|
@@ -17628,7 +17642,7 @@ class Ng extends Z {
|
|
|
17628
17642
|
})));
|
|
17629
17643
|
}
|
|
17630
17644
|
}
|
|
17631
|
-
|
|
17645
|
+
Rg.create = (C, A) => new Rg({
|
|
17632
17646
|
type: C,
|
|
17633
17647
|
typeName: x.ZodPromise,
|
|
17634
17648
|
...b(A)
|
|
@@ -17660,7 +17674,7 @@ class cI extends Z {
|
|
|
17660
17674
|
path: g.path,
|
|
17661
17675
|
parent: g
|
|
17662
17676
|
});
|
|
17663
|
-
return o.status === "aborted" ? m : o.status === "dirty" || I.value === "dirty" ?
|
|
17677
|
+
return o.status === "aborted" ? m : o.status === "dirty" || I.value === "dirty" ? YI(o.value) : o;
|
|
17664
17678
|
});
|
|
17665
17679
|
{
|
|
17666
17680
|
if (I.value === "aborted")
|
|
@@ -17670,7 +17684,7 @@ class cI extends Z {
|
|
|
17670
17684
|
path: g.path,
|
|
17671
17685
|
parent: g
|
|
17672
17686
|
});
|
|
17673
|
-
return i.status === "aborted" ? m : i.status === "dirty" || I.value === "dirty" ?
|
|
17687
|
+
return i.status === "aborted" ? m : i.status === "dirty" || I.value === "dirty" ? YI(i.value) : i;
|
|
17674
17688
|
}
|
|
17675
17689
|
}
|
|
17676
17690
|
if (B.type === "refinement") {
|
|
@@ -17786,7 +17800,7 @@ class yB extends Z {
|
|
|
17786
17800
|
...g
|
|
17787
17801
|
}
|
|
17788
17802
|
});
|
|
17789
|
-
return
|
|
17803
|
+
return Gg(B) ? B.then((Q) => ({
|
|
17790
17804
|
status: "valid",
|
|
17791
17805
|
value: Q.status === "valid" ? Q.value : this._def.catchValue({
|
|
17792
17806
|
get error() {
|
|
@@ -17819,7 +17833,7 @@ class eQ extends Z {
|
|
|
17819
17833
|
if (this._getType(A) !== u.nan) {
|
|
17820
17834
|
const g = this._getOrReturnCtx(A);
|
|
17821
17835
|
return Y(g, {
|
|
17822
|
-
code:
|
|
17836
|
+
code: U.invalid_type,
|
|
17823
17837
|
expected: u.nan,
|
|
17824
17838
|
received: g.parsedType
|
|
17825
17839
|
}), m;
|
|
@@ -17854,7 +17868,7 @@ class jB extends Z {
|
|
|
17854
17868
|
path: g.path,
|
|
17855
17869
|
parent: g
|
|
17856
17870
|
});
|
|
17857
|
-
return Q.status === "aborted" ? m : Q.status === "dirty" ? (I.dirty(),
|
|
17871
|
+
return Q.status === "aborted" ? m : Q.status === "dirty" ? (I.dirty(), YI(Q.value)) : this._def.out._parseAsync({
|
|
17858
17872
|
data: Q.value,
|
|
17859
17873
|
path: g.path,
|
|
17860
17874
|
parent: g
|
|
@@ -17887,7 +17901,7 @@ class jB extends Z {
|
|
|
17887
17901
|
class cB extends Z {
|
|
17888
17902
|
_parse(A) {
|
|
17889
17903
|
const I = this._def.innerType._parse(A), g = (B) => (DI(B) && (B.value = Object.freeze(B.value)), B);
|
|
17890
|
-
return
|
|
17904
|
+
return Gg(I) ? I.then((B) => g(B)) : g(I);
|
|
17891
17905
|
}
|
|
17892
17906
|
unwrap() {
|
|
17893
17907
|
return this._def.innerType;
|
|
@@ -17905,11 +17919,11 @@ var x;
|
|
|
17905
17919
|
const z = PA.create, T = hI.create, DE = aB.create, OA = nB.create;
|
|
17906
17920
|
jA.create;
|
|
17907
17921
|
const j = pA.create, q = eA.create;
|
|
17908
|
-
Fg.create;
|
|
17909
17922
|
Sg.create;
|
|
17923
|
+
Ng.create;
|
|
17910
17924
|
QI.create;
|
|
17911
17925
|
const yA = DB.create, aI = yI.create;
|
|
17912
|
-
|
|
17926
|
+
Rg.create;
|
|
17913
17927
|
_A.create;
|
|
17914
17928
|
wI.create;
|
|
17915
17929
|
const Yt = q({
|
|
@@ -18348,8 +18362,8 @@ function hE(C, A) {
|
|
|
18348
18362
|
const I = { ...C };
|
|
18349
18363
|
return delete I[A], I;
|
|
18350
18364
|
}
|
|
18351
|
-
async function
|
|
18352
|
-
const I = new
|
|
18365
|
+
async function Ue(C, A) {
|
|
18366
|
+
const I = new ZI(C), g = new dA(I), B = GI(A), Q = await _I(g, B);
|
|
18353
18367
|
try {
|
|
18354
18368
|
return xt(Q.attrs);
|
|
18355
18369
|
} catch {
|
|
@@ -18408,7 +18422,7 @@ function Wt(C) {
|
|
|
18408
18422
|
}
|
|
18409
18423
|
}
|
|
18410
18424
|
async function le(C, A, I) {
|
|
18411
|
-
const g = C + "/" + A, B = new
|
|
18425
|
+
const g = C + "/" + A, B = new ZI(g), Q = new dA(B), E = GI(I), i = await _I(Q, E);
|
|
18412
18426
|
try {
|
|
18413
18427
|
return Wt(i.attrs);
|
|
18414
18428
|
} catch {
|
|
@@ -18419,11 +18433,11 @@ ${JSON.stringify(i.attrs)}`
|
|
|
18419
18433
|
}
|
|
18420
18434
|
}
|
|
18421
18435
|
async function Le(C) {
|
|
18422
|
-
const A = GI(C.version), I = await
|
|
18436
|
+
const A = GI(C.version), I = await _I(C.location, A);
|
|
18423
18437
|
return $B(I.attrs).omero?.channels ?? [];
|
|
18424
18438
|
}
|
|
18425
18439
|
async function Je(C) {
|
|
18426
|
-
const A = GI(C.version), I = await
|
|
18440
|
+
const A = GI(C.version), I = await _I(C.location, A);
|
|
18427
18441
|
return $B(I.attrs).omero?.rdefs;
|
|
18428
18442
|
}
|
|
18429
18443
|
function vt(C) {
|
|
@@ -18457,7 +18471,7 @@ function $B(C) {
|
|
|
18457
18471
|
${JSON.stringify(C)}`);
|
|
18458
18472
|
}
|
|
18459
18473
|
}
|
|
18460
|
-
class
|
|
18474
|
+
class MI {
|
|
18461
18475
|
location;
|
|
18462
18476
|
version;
|
|
18463
18477
|
loader_;
|
|
@@ -18466,7 +18480,7 @@ class YI {
|
|
|
18466
18480
|
}
|
|
18467
18481
|
static async openLoader(A, I) {
|
|
18468
18482
|
let g = GI(I);
|
|
18469
|
-
const B = await
|
|
18483
|
+
const B = await _I(A, g), Q = $B(B.attrs), E = Q.multiscales;
|
|
18470
18484
|
if (E.length !== 1)
|
|
18471
18485
|
throw new Error(
|
|
18472
18486
|
`Exactly one multiscale image is supported. Found ${E.length} images.`
|
|
@@ -18502,8 +18516,8 @@ class YI {
|
|
|
18502
18516
|
* @param props.version OME-Zarr version
|
|
18503
18517
|
*/
|
|
18504
18518
|
static async fromHttp(A) {
|
|
18505
|
-
const I = new
|
|
18506
|
-
return new
|
|
18519
|
+
const I = new dA(new ZI(A.url)), g = await MI.openLoader(I, A.version);
|
|
18520
|
+
return new MI({ location: I, version: A.version, loader: g });
|
|
18507
18521
|
}
|
|
18508
18522
|
/**
|
|
18509
18523
|
* Creates and opens an OmeZarrImageSource from a local filesystem directory.
|
|
@@ -18515,14 +18529,14 @@ class YI {
|
|
|
18515
18529
|
* ask the user once for permission to the root directory
|
|
18516
18530
|
*/
|
|
18517
18531
|
static async fromFileSystem(A) {
|
|
18518
|
-
const I = new
|
|
18532
|
+
const I = new dA(
|
|
18519
18533
|
new XB(A.directory),
|
|
18520
18534
|
A.path
|
|
18521
|
-
), g = await
|
|
18522
|
-
return new
|
|
18535
|
+
), g = await MI.openLoader(I, A.version);
|
|
18536
|
+
return new MI({ location: I, version: A.version, loader: g });
|
|
18523
18537
|
}
|
|
18524
18538
|
}
|
|
18525
|
-
class
|
|
18539
|
+
class Yg {
|
|
18526
18540
|
objects_ = [];
|
|
18527
18541
|
state_ = "initialized";
|
|
18528
18542
|
attached_ = !1;
|
|
@@ -18675,7 +18689,7 @@ const Vt = P(0, 1, 0);
|
|
|
18675
18689
|
class _t {
|
|
18676
18690
|
dirty_ = !0;
|
|
18677
18691
|
matrix_ = SA();
|
|
18678
|
-
rotation_ =
|
|
18692
|
+
rotation_ = IB();
|
|
18679
18693
|
translation_ = QA();
|
|
18680
18694
|
scale_ = P(1, 1, 1);
|
|
18681
18695
|
addRotation(A) {
|
|
@@ -18688,10 +18702,10 @@ class _t {
|
|
|
18688
18702
|
return si(this.rotation_);
|
|
18689
18703
|
}
|
|
18690
18704
|
addTranslation(A) {
|
|
18691
|
-
|
|
18705
|
+
HI(this.translation_, this.translation_, A), this.dirty_ = !0;
|
|
18692
18706
|
}
|
|
18693
18707
|
setTranslation(A) {
|
|
18694
|
-
|
|
18708
|
+
$g(this.translation_, A), this.dirty_ = !0;
|
|
18695
18709
|
}
|
|
18696
18710
|
get translation() {
|
|
18697
18711
|
return bA(this.translation_);
|
|
@@ -18700,7 +18714,7 @@ class _t {
|
|
|
18700
18714
|
$E(this.scale_, this.scale_, A), this.dirty_ = !0;
|
|
18701
18715
|
}
|
|
18702
18716
|
setScale(A) {
|
|
18703
|
-
|
|
18717
|
+
$g(this.scale_, A), this.dirty_ = !0;
|
|
18704
18718
|
}
|
|
18705
18719
|
targetTo(A) {
|
|
18706
18720
|
NB(this.translation_, A) && (A = bA(A), A[2] += AA);
|
|
@@ -18714,7 +18728,7 @@ class _t {
|
|
|
18714
18728
|
return this.dirty_ && (this.computeMatrix(), this.dirty_ = !1), this.matrix_;
|
|
18715
18729
|
}
|
|
18716
18730
|
get inverse() {
|
|
18717
|
-
return
|
|
18731
|
+
return dg(SA(), this.matrix);
|
|
18718
18732
|
}
|
|
18719
18733
|
computeMatrix() {
|
|
18720
18734
|
ZE(
|
|
@@ -18816,25 +18830,25 @@ class Xt extends kI {
|
|
|
18816
18830
|
};
|
|
18817
18831
|
}
|
|
18818
18832
|
}
|
|
18819
|
-
class Ye extends
|
|
18833
|
+
class Ye extends Yg {
|
|
18820
18834
|
type = "AxesLayer";
|
|
18821
18835
|
constructor(A) {
|
|
18822
18836
|
super();
|
|
18823
18837
|
const { length: I, width: g } = A;
|
|
18824
18838
|
this.addObject(
|
|
18825
|
-
|
|
18839
|
+
_g({
|
|
18826
18840
|
end: [I, 0, 0],
|
|
18827
18841
|
width: g,
|
|
18828
18842
|
color: [1, 0, 0]
|
|
18829
18843
|
})
|
|
18830
18844
|
), this.addObject(
|
|
18831
|
-
|
|
18845
|
+
_g({
|
|
18832
18846
|
end: [0, I, 0],
|
|
18833
18847
|
width: g,
|
|
18834
18848
|
color: [0, 1, 0]
|
|
18835
18849
|
})
|
|
18836
18850
|
), this.addObject(
|
|
18837
|
-
|
|
18851
|
+
_g({
|
|
18838
18852
|
end: [0, 0, I],
|
|
18839
18853
|
width: g,
|
|
18840
18854
|
color: [0, 0, 1]
|
|
@@ -18844,7 +18858,7 @@ class Ye extends Jg {
|
|
|
18844
18858
|
update() {
|
|
18845
18859
|
}
|
|
18846
18860
|
}
|
|
18847
|
-
function
|
|
18861
|
+
function _g(C) {
|
|
18848
18862
|
const { end: A, width: I, color: g } = C, B = new Pt([[0, 0, 0], A]);
|
|
18849
18863
|
return new Xt({
|
|
18850
18864
|
geometry: B,
|
|
@@ -18853,7 +18867,7 @@ function Vg(C) {
|
|
|
18853
18867
|
});
|
|
18854
18868
|
}
|
|
18855
18869
|
const aQ = 32;
|
|
18856
|
-
function
|
|
18870
|
+
function WI(C, { visible: A, color: I, contrastLimits: g, opacity: B }) {
|
|
18857
18871
|
return A ??= !0, I = I === void 0 ? X.WHITE : X.from(I), B = B === void 0 ? 1 : TA(B, 0, 1), C !== null ? g = jt(g, C) : g === void 0 && (H.debug(
|
|
18858
18872
|
"Channel",
|
|
18859
18873
|
"No texture provided, defaulting channel contrast limits to [0, 1]."
|
|
@@ -18867,7 +18881,7 @@ function bI(C, { visible: A, color: I, contrastLimits: g, opacity: B }) {
|
|
|
18867
18881
|
function wB(C, A) {
|
|
18868
18882
|
if (A.length > aQ)
|
|
18869
18883
|
throw new Error(`Maximum number of channels is ${aQ}`);
|
|
18870
|
-
return A.map((I) =>
|
|
18884
|
+
return A.map((I) => WI(C, I));
|
|
18871
18885
|
}
|
|
18872
18886
|
function yE(C, A) {
|
|
18873
18887
|
if (C && C.length !== A)
|
|
@@ -18890,15 +18904,15 @@ class cE extends FI {
|
|
|
18890
18904
|
const Q = [], E = [], i = g, o = B, s = i + 1, t = o + 1, e = A / i, n = I / o;
|
|
18891
18905
|
for (let D = 0; D < t; ++D) {
|
|
18892
18906
|
const F = D * n;
|
|
18893
|
-
for (let
|
|
18894
|
-
const S =
|
|
18895
|
-
Q.push(...
|
|
18907
|
+
for (let k = 0; k < s; ++k) {
|
|
18908
|
+
const S = k * e, l = k / i, f = D / o, d = [S, F, 0], R = [0, 0, 1], L = [l, f];
|
|
18909
|
+
Q.push(...d, ...R, ...L);
|
|
18896
18910
|
}
|
|
18897
18911
|
}
|
|
18898
18912
|
for (let D = 0; D < o; ++D)
|
|
18899
18913
|
for (let F = 0; F < i; ++F) {
|
|
18900
|
-
const
|
|
18901
|
-
E.push(
|
|
18914
|
+
const k = F + s * D, S = F + s * (D + 1), l = F + 1 + s * (D + 1), f = F + 1 + s * D;
|
|
18915
|
+
E.push(k, S, f), E.push(S, l, f);
|
|
18902
18916
|
}
|
|
18903
18917
|
this.vertexData_ = new Float32Array(Q), this.indexData_ = new Uint32Array(E), this.addAttribute({
|
|
18904
18918
|
type: "position",
|
|
@@ -18930,7 +18944,7 @@ class zt extends kI {
|
|
|
18930
18944
|
this.channels_ = wB(this.textures[0], A);
|
|
18931
18945
|
}
|
|
18932
18946
|
setChannelProperty(A, I, g) {
|
|
18933
|
-
const B =
|
|
18947
|
+
const B = WI(this.textures[0], {
|
|
18934
18948
|
...this.channels_[A],
|
|
18935
18949
|
[I]: g
|
|
18936
18950
|
});
|
|
@@ -18940,7 +18954,7 @@ class zt extends kI {
|
|
|
18940
18954
|
const A = this.textures[0];
|
|
18941
18955
|
if (!A)
|
|
18942
18956
|
throw new Error("No texture set");
|
|
18943
|
-
const { color: I, contrastLimits: g, opacity: B } = this.channels_[0] ??
|
|
18957
|
+
const { color: I, contrastLimits: g, opacity: B } = this.channels_[0] ?? WI(A, {});
|
|
18944
18958
|
return {
|
|
18945
18959
|
u_imageSampler: 0,
|
|
18946
18960
|
u_color: I.rgb,
|
|
@@ -19006,7 +19020,7 @@ class AC {
|
|
|
19006
19020
|
this.bins_.clear();
|
|
19007
19021
|
}
|
|
19008
19022
|
}
|
|
19009
|
-
class GE extends
|
|
19023
|
+
class GE extends Yg {
|
|
19010
19024
|
type = "ImageLayer";
|
|
19011
19025
|
source_;
|
|
19012
19026
|
sliceCoords_;
|
|
@@ -19118,13 +19132,13 @@ class GE extends Jg {
|
|
|
19118
19132
|
set imageSourcePolicy(A) {
|
|
19119
19133
|
this.policy_ !== A && (this.policy_ = A, this.chunkStoreView_ && this.chunkStoreView_.setImageSourcePolicy(
|
|
19120
19134
|
A,
|
|
19121
|
-
|
|
19135
|
+
lg
|
|
19122
19136
|
));
|
|
19123
19137
|
}
|
|
19124
19138
|
getImageForChunk(A, I) {
|
|
19125
19139
|
const g = this.visibleChunks_.get(A);
|
|
19126
19140
|
if (g) return g;
|
|
19127
|
-
const B = this.pool_.acquire(
|
|
19141
|
+
const B = this.pool_.acquire(kg(A));
|
|
19128
19142
|
return B ? (B.setTexture(0, I), B.zTexCoord = this.zTexCoordForChunk(A), B.setChannelProps(this.getChannelPropsForChunk(A)), this.updateImageChunk(B, A), B) : this.createImage(A, I);
|
|
19129
19143
|
}
|
|
19130
19144
|
getChannelPropsForChunk(A) {
|
|
@@ -19205,11 +19219,11 @@ class GE extends Jg {
|
|
|
19205
19219
|
releaseAndRemoveChunks(A) {
|
|
19206
19220
|
for (const I of A) {
|
|
19207
19221
|
const g = this.visibleChunks_.get(I);
|
|
19208
|
-
g && (this.pool_.release(
|
|
19222
|
+
g && (this.pool_.release(kg(I), g), this.visibleChunks_.delete(I));
|
|
19209
19223
|
}
|
|
19210
19224
|
}
|
|
19211
19225
|
}
|
|
19212
|
-
function
|
|
19226
|
+
function kg(C) {
|
|
19213
19227
|
return [
|
|
19214
19228
|
`lod${C.lod}`,
|
|
19215
19229
|
`shape${C.shape.x}x${C.shape.y}x${C.shape.z}`,
|
|
@@ -19235,10 +19249,10 @@ class Ae extends FI {
|
|
|
19235
19249
|
});
|
|
19236
19250
|
}
|
|
19237
19251
|
buildFace(A, I, g, B, Q, E, i, o, s, t, e, n, D) {
|
|
19238
|
-
const F = E / s,
|
|
19252
|
+
const F = E / s, k = i / t, S = E / 2, l = i / 2, f = o / 2 * e, d = s + 1, R = t + 1, L = n.length / 8;
|
|
19239
19253
|
for (let M = 0; M < R; M++) {
|
|
19240
|
-
const W = -l + M *
|
|
19241
|
-
for (let $ = 0; $ <
|
|
19254
|
+
const W = -l + M * k;
|
|
19255
|
+
for (let $ = 0; $ < d; $++) {
|
|
19242
19256
|
const BA = -S + $ * F, IA = { x: 0, y: 0, z: 0 };
|
|
19243
19257
|
IA[A] = BA * B, IA[I] = W * Q, IA[g] = f;
|
|
19244
19258
|
const iA = { x: 0, y: 0, z: 0 };
|
|
@@ -19258,7 +19272,7 @@ class Ae extends FI {
|
|
|
19258
19272
|
}
|
|
19259
19273
|
for (let M = 0; M < t; M++)
|
|
19260
19274
|
for (let W = 0; W < s; W++) {
|
|
19261
|
-
const $ = L + W +
|
|
19275
|
+
const $ = L + W + d * M, BA = L + W + d * (M + 1), IA = L + (W + 1) + d * (M + 1), iA = L + (W + 1) + d * M;
|
|
19262
19276
|
D.push($, BA, iA, BA, IA, iA);
|
|
19263
19277
|
}
|
|
19264
19278
|
}
|
|
@@ -19319,7 +19333,7 @@ class Ie extends kI {
|
|
|
19319
19333
|
for (let o = 0; o < i && E.length < 4; o++) {
|
|
19320
19334
|
const s = this.channelToTextureIndex_.get(o);
|
|
19321
19335
|
if (s === void 0 || !this.loadedChannels_.has(o)) continue;
|
|
19322
|
-
const t = this.textures[s], e =
|
|
19336
|
+
const t = this.textures[s], e = WI(t, this.channels_[o] || {});
|
|
19323
19337
|
if (!e.visible) continue;
|
|
19324
19338
|
const n = E.length;
|
|
19325
19339
|
I[n * 3] = e.color.rgb[0], I[n * 3 + 1] = e.color.rgb[1], I[n * 3 + 2] = e.color.rgb[2], E.push(s), g[n] = -e.contrastLimits[0], B[n] = 1 / (e.contrastLimits[1] - e.contrastLimits[0]), A[n] = 1, Q[n] = e.opacity;
|
|
@@ -19358,7 +19372,7 @@ class Ie extends kI {
|
|
|
19358
19372
|
);
|
|
19359
19373
|
}
|
|
19360
19374
|
setChannelProperty(A, I, g) {
|
|
19361
|
-
const B =
|
|
19375
|
+
const B = WI(
|
|
19362
19376
|
this.getAvailableChannelTexture(A),
|
|
19363
19377
|
{
|
|
19364
19378
|
...this.channels_[A],
|
|
@@ -19385,13 +19399,13 @@ function ge(C) {
|
|
|
19385
19399
|
function Be(C, A) {
|
|
19386
19400
|
const I = A.position, g = QA(), B = QA();
|
|
19387
19401
|
return C.sort((Q, E) => {
|
|
19388
|
-
|
|
19402
|
+
HI(g, Q.boundingBox.max, Q.boundingBox.min), qI(g, g, 0.5), HI(B, E.boundingBox.max, E.boundingBox.min), qI(B, B, 0.5);
|
|
19389
19403
|
const i = sC(I, g), o = sC(I, B);
|
|
19390
19404
|
return i - o;
|
|
19391
19405
|
}), C;
|
|
19392
19406
|
}
|
|
19393
19407
|
const Ce = 2;
|
|
19394
|
-
class Me extends
|
|
19408
|
+
class Me extends Yg {
|
|
19395
19409
|
type = "VolumeLayer";
|
|
19396
19410
|
source_;
|
|
19397
19411
|
sliceCoords_;
|
|
@@ -19425,7 +19439,7 @@ class Me extends Jg {
|
|
|
19425
19439
|
set sourcePolicy(A) {
|
|
19426
19440
|
this.sourcePolicy_ !== A && (this.sourcePolicy_ = A, this.chunkStoreView_ && this.chunkStoreView_.setImageSourcePolicy(
|
|
19427
19441
|
A,
|
|
19428
|
-
|
|
19442
|
+
lg
|
|
19429
19443
|
));
|
|
19430
19444
|
}
|
|
19431
19445
|
setChannelProps(A) {
|
|
@@ -19553,7 +19567,7 @@ function ie(C) {
|
|
|
19553
19567
|
`align${C.rowAlignmentBytes}`
|
|
19554
19568
|
].join(":");
|
|
19555
19569
|
}
|
|
19556
|
-
class nQ extends
|
|
19570
|
+
class nQ extends dB {
|
|
19557
19571
|
width_;
|
|
19558
19572
|
height_;
|
|
19559
19573
|
constructor(A, I, g) {
|
|
@@ -19657,7 +19671,7 @@ class rQ {
|
|
|
19657
19671
|
this.lookupTable = ae(A.lookupTable), this.cycle = ne(A.cycle);
|
|
19658
19672
|
}
|
|
19659
19673
|
}
|
|
19660
|
-
class FE extends
|
|
19674
|
+
class FE extends Yg {
|
|
19661
19675
|
type = "LabelLayer";
|
|
19662
19676
|
source_;
|
|
19663
19677
|
sliceCoords_;
|
|
@@ -19766,7 +19780,7 @@ class FE extends Jg {
|
|
|
19766
19780
|
set imageSourcePolicy(A) {
|
|
19767
19781
|
this.policy_ !== A && (this.policy_ = A, this.chunkStoreView_ && this.chunkStoreView_.setImageSourcePolicy(
|
|
19768
19782
|
A,
|
|
19769
|
-
|
|
19783
|
+
lg
|
|
19770
19784
|
));
|
|
19771
19785
|
}
|
|
19772
19786
|
// exposed for use in chunk info overlay
|
|
@@ -19800,7 +19814,7 @@ class FE extends Jg {
|
|
|
19800
19814
|
getLabelForChunk(A, I) {
|
|
19801
19815
|
const g = this.visibleChunks_.get(A);
|
|
19802
19816
|
if (g) return g;
|
|
19803
|
-
const B = this.pool_.acquire(
|
|
19817
|
+
const B = this.pool_.acquire(kg(A));
|
|
19804
19818
|
return B ? (B.setTexture(0, I), B.zTexCoord = this.zTexCoordForChunk(A), B.setColorMap(this.colorMap_), B.setSelectedValue(this.selectedValue_), this.updateLabelChunk(B, A), B) : this.createLabel(A, I);
|
|
19805
19819
|
}
|
|
19806
19820
|
createLabel(A, I) {
|
|
@@ -19829,11 +19843,11 @@ class FE extends Jg {
|
|
|
19829
19843
|
releaseAndRemoveChunks(A) {
|
|
19830
19844
|
for (const I of A) {
|
|
19831
19845
|
const g = this.visibleChunks_.get(I);
|
|
19832
|
-
g && (this.pool_.release(
|
|
19846
|
+
g && (this.pool_.release(kg(I), g), this.visibleChunks_.delete(I));
|
|
19833
19847
|
}
|
|
19834
19848
|
}
|
|
19835
19849
|
}
|
|
19836
|
-
class re extends
|
|
19850
|
+
class re extends dB {
|
|
19837
19851
|
width_;
|
|
19838
19852
|
height_;
|
|
19839
19853
|
depth_;
|
|
@@ -19897,9 +19911,9 @@ class ue extends kI {
|
|
|
19897
19911
|
return "Points";
|
|
19898
19912
|
}
|
|
19899
19913
|
}
|
|
19900
|
-
let
|
|
19914
|
+
let Xg;
|
|
19901
19915
|
function De() {
|
|
19902
|
-
return
|
|
19916
|
+
return Xg || (Xg = he()), Xg;
|
|
19903
19917
|
}
|
|
19904
19918
|
function he() {
|
|
19905
19919
|
const C = (s) => {
|
|
@@ -19943,7 +19957,7 @@ class DQ {
|
|
|
19943
19957
|
);
|
|
19944
19958
|
}
|
|
19945
19959
|
}
|
|
19946
|
-
const
|
|
19960
|
+
const jg = -1, hQ = 0, ye = 1, yQ = 9e-3, ce = 1e-3, we = 9e-4, Ge = 0.5, Fe = 60;
|
|
19947
19961
|
class fe {
|
|
19948
19962
|
camera_;
|
|
19949
19963
|
orbitVelocity_ = new DQ(0, 0, 0);
|
|
@@ -19951,13 +19965,13 @@ class fe {
|
|
|
19951
19965
|
currPos_;
|
|
19952
19966
|
currCenter_ = QA();
|
|
19953
19967
|
dampingFactor_;
|
|
19954
|
-
currMouseButton_ =
|
|
19968
|
+
currMouseButton_ = jg;
|
|
19955
19969
|
constructor(A, I) {
|
|
19956
19970
|
this.camera_ = A, this.currPos_ = new DQ(
|
|
19957
19971
|
I?.radius ?? 1,
|
|
19958
19972
|
I?.yaw ?? 0,
|
|
19959
19973
|
I?.pitch ?? 0
|
|
19960
|
-
), I?.target &&
|
|
19974
|
+
), I?.target && $g(this.currCenter_, I.target), this.dampingFactor_ = TA(
|
|
19961
19975
|
I?.dampingFactor ?? Ge,
|
|
19962
19976
|
0,
|
|
19963
19977
|
1
|
|
@@ -19986,18 +20000,18 @@ class fe {
|
|
|
19986
20000
|
onUpdate(A) {
|
|
19987
20001
|
if (this.orbitVelocity_.phi === 0 && this.orbitVelocity_.theta === 0 && this.orbitVelocity_.radius === 0 && NB(this.panVelocity_, P(0, 0, 0)))
|
|
19988
20002
|
return;
|
|
19989
|
-
this.currPos_.phi += this.orbitVelocity_.phi, this.currPos_.theta += this.orbitVelocity_.theta, this.currPos_.radius += this.orbitVelocity_.radius * this.currPos_.radius,
|
|
20003
|
+
this.currPos_.phi += this.orbitVelocity_.phi, this.currPos_.theta += this.orbitVelocity_.theta, this.currPos_.radius += this.orbitVelocity_.radius * this.currPos_.radius, HI(this.currCenter_, this.currCenter_, this.panVelocity_);
|
|
19990
20004
|
const I = Math.PI / 2 - AA;
|
|
19991
20005
|
this.currPos_.theta = TA(this.currPos_.theta, -I, I), this.currPos_.radius = Math.max(0.01, this.currPos_.radius), this.updateCamera();
|
|
19992
20006
|
const g = Math.pow(1 - this.dampingFactor_, A * Fe);
|
|
19993
|
-
this.orbitVelocity_.phi *= g, this.orbitVelocity_.theta *= g, this.orbitVelocity_.radius *= g,
|
|
20007
|
+
this.orbitVelocity_.phi *= g, this.orbitVelocity_.theta *= g, this.orbitVelocity_.radius *= g, qI(this.panVelocity_, this.panVelocity_, g), this.cutoffLowVelocity();
|
|
19994
20008
|
}
|
|
19995
20009
|
onPointerDown(A) {
|
|
19996
20010
|
const I = A.event;
|
|
19997
20011
|
this.currMouseButton_ = I.button, I.target?.setPointerCapture?.(I.pointerId);
|
|
19998
20012
|
}
|
|
19999
20013
|
onPointerMove(A) {
|
|
20000
|
-
if (this.currMouseButton_ ==
|
|
20014
|
+
if (this.currMouseButton_ == jg) return;
|
|
20001
20015
|
const I = A.event, g = I.movementX ?? 0, B = I.movementY ?? 0, Q = this.currMouseButton_ === hQ && !I.shiftKey, E = this.currMouseButton_ === hQ && I.shiftKey || this.currMouseButton_ === ye;
|
|
20002
20016
|
Q && this.orbit(g, B), E && this.pan(g, B);
|
|
20003
20017
|
}
|
|
@@ -20008,7 +20022,7 @@ class fe {
|
|
|
20008
20022
|
this.zoom(g);
|
|
20009
20023
|
}
|
|
20010
20024
|
onPointerEnd(A) {
|
|
20011
|
-
this.currMouseButton_ =
|
|
20025
|
+
this.currMouseButton_ = jg;
|
|
20012
20026
|
const I = A.event;
|
|
20013
20027
|
I.target?.releasePointerCapture?.(I.pointerId);
|
|
20014
20028
|
}
|
|
@@ -20017,13 +20031,13 @@ class fe {
|
|
|
20017
20031
|
}
|
|
20018
20032
|
pan(A, I) {
|
|
20019
20033
|
const g = this.currPos_.radius * ce, B = QA();
|
|
20020
|
-
oC(B, B, this.camera_.right, A), oC(B, B, this.camera_.up, I),
|
|
20034
|
+
oC(B, B, this.camera_.right, A), oC(B, B, this.camera_.up, I), qI(B, B, g), AB(this.panVelocity_, this.panVelocity_, B);
|
|
20021
20035
|
}
|
|
20022
20036
|
zoom(A) {
|
|
20023
20037
|
this.orbitVelocity_.radius += A * we;
|
|
20024
20038
|
}
|
|
20025
20039
|
updateCamera() {
|
|
20026
|
-
const A =
|
|
20040
|
+
const A = HI(QA(), this.currCenter_, this.currPos_.toVec3());
|
|
20027
20041
|
this.camera_.transform.setTranslation(A), this.camera_.transform.targetTo(this.currCenter_);
|
|
20028
20042
|
}
|
|
20029
20043
|
cutoffLowVelocity() {
|
|
@@ -20046,7 +20060,7 @@ class oI {
|
|
|
20046
20060
|
const A = FB(this.normal);
|
|
20047
20061
|
if (A > 0) {
|
|
20048
20062
|
const I = 1 / A;
|
|
20049
|
-
|
|
20063
|
+
qI(this.normal, this.normal, I), this.signedDistance *= I;
|
|
20050
20064
|
}
|
|
20051
20065
|
}
|
|
20052
20066
|
}
|
|
@@ -20130,16 +20144,16 @@ class NE extends kI {
|
|
|
20130
20144
|
return this.transform.translation;
|
|
20131
20145
|
}
|
|
20132
20146
|
clipToWorld(A) {
|
|
20133
|
-
const I =
|
|
20147
|
+
const I = Qg(A[0], A[1], A[2], 1), g = dg(
|
|
20134
20148
|
SA(),
|
|
20135
20149
|
this.projectionMatrix_
|
|
20136
|
-
), B =
|
|
20150
|
+
), B = pI(
|
|
20137
20151
|
nI(),
|
|
20138
20152
|
I,
|
|
20139
20153
|
g
|
|
20140
20154
|
);
|
|
20141
20155
|
Qi(B, B, 1 / B[3]);
|
|
20142
|
-
const Q =
|
|
20156
|
+
const Q = pI(
|
|
20143
20157
|
nI(),
|
|
20144
20158
|
B,
|
|
20145
20159
|
this.transform.matrix
|
|
@@ -20188,9 +20202,9 @@ class Ke extends NE {
|
|
|
20188
20202
|
this.transform.addScale([I, I, 1]);
|
|
20189
20203
|
}
|
|
20190
20204
|
getWorldViewRect() {
|
|
20191
|
-
let A =
|
|
20192
|
-
const g =
|
|
20193
|
-
return A =
|
|
20205
|
+
let A = Qg(-1, -1, 0, 1), I = Qg(1, 1, 0, 1);
|
|
20206
|
+
const g = dg(SA(), this.getViewProjection());
|
|
20207
|
+
return A = pI(nI(), A, g), I = pI(nI(), I, g), new GA(
|
|
20194
20208
|
aA(A[0], A[1]),
|
|
20195
20209
|
aA(I[0], I[1])
|
|
20196
20210
|
);
|
|
@@ -20245,7 +20259,7 @@ class He {
|
|
|
20245
20259
|
I.preventDefault();
|
|
20246
20260
|
const g = bA(A.worldPos), B = I.deltaY < 0 ? 1.05 : 0.95;
|
|
20247
20261
|
this.camera_.zoom(B);
|
|
20248
|
-
const Q = this.camera_.clipToWorld(A.clipPos), E =
|
|
20262
|
+
const Q = this.camera_.clipToWorld(A.clipPos), E = AB(QA(), g, Q);
|
|
20249
20263
|
this.camera_.pan(E);
|
|
20250
20264
|
}
|
|
20251
20265
|
onPointerDown(A) {
|
|
@@ -20254,7 +20268,7 @@ class He {
|
|
|
20254
20268
|
}
|
|
20255
20269
|
onPointerMove(A) {
|
|
20256
20270
|
if (!this.dragActive_ || !A.worldPos) return;
|
|
20257
|
-
const I =
|
|
20271
|
+
const I = AB(QA(), this.dragStart_, A.worldPos);
|
|
20258
20272
|
this.camera_.pan(I);
|
|
20259
20273
|
}
|
|
20260
20274
|
onPointerEnd(A) {
|
|
@@ -20262,7 +20276,7 @@ class He {
|
|
|
20262
20276
|
!this.dragActive_ || I.button !== GQ || (this.dragActive_ = !1, I.target?.releasePointerCapture?.(I.pointerId));
|
|
20263
20277
|
}
|
|
20264
20278
|
}
|
|
20265
|
-
const Ne = 60, Re = 1.77,
|
|
20279
|
+
const Ne = 60, Re = 1.77, Cg = 0.1, zg = 180 - Cg;
|
|
20266
20280
|
class qe extends NE {
|
|
20267
20281
|
fov_;
|
|
20268
20282
|
aspectRatio_;
|
|
@@ -20274,9 +20288,9 @@ class qe extends NE {
|
|
|
20274
20288
|
far: Q = 1e4,
|
|
20275
20289
|
position: E = P(0, 0, 0)
|
|
20276
20290
|
} = A;
|
|
20277
|
-
if (I <
|
|
20291
|
+
if (I < Cg || I > zg)
|
|
20278
20292
|
throw new Error(
|
|
20279
|
-
`Invalid field of view: ${I}, must be in [${
|
|
20293
|
+
`Invalid field of view: ${I}, must be in [${Cg}, ${zg}] degrees`
|
|
20280
20294
|
);
|
|
20281
20295
|
super(), this.fov_ = I, this.aspectRatio_ = g, this.near_ = B, this.far_ = Q, this.transform.setTranslation(E), this.updateProjectionMatrix();
|
|
20282
20296
|
}
|
|
@@ -20292,7 +20306,7 @@ class qe extends NE {
|
|
|
20292
20306
|
zoom(A) {
|
|
20293
20307
|
if (A <= 0)
|
|
20294
20308
|
throw new Error(`Invalid zoom factor: ${A}`);
|
|
20295
|
-
this.fov_ = Math.max(
|
|
20309
|
+
this.fov_ = Math.max(Cg, Math.min(zg, this.fov_ / A)), this.updateProjectionMatrix();
|
|
20296
20310
|
}
|
|
20297
20311
|
updateProjectionMatrix() {
|
|
20298
20312
|
OE(
|
|
@@ -20406,8 +20420,8 @@ export {
|
|
|
20406
20420
|
rQ as LabelColorMap,
|
|
20407
20421
|
te as LabelImageRenderable,
|
|
20408
20422
|
FE as LabelLayer,
|
|
20409
|
-
|
|
20410
|
-
|
|
20423
|
+
Yg as Layer,
|
|
20424
|
+
MI as OmeZarrImageSource,
|
|
20411
20425
|
fe as OrbitControls,
|
|
20412
20426
|
Ke as OrthographicCamera,
|
|
20413
20427
|
He as PanZoomControls,
|
|
@@ -20420,7 +20434,7 @@ export {
|
|
|
20420
20434
|
IC as createImageSourcePolicy,
|
|
20421
20435
|
xe as createNoPrefetchPolicy,
|
|
20422
20436
|
me as createPlaybackPolicy,
|
|
20423
|
-
|
|
20437
|
+
Ue as loadOmeZarrPlate,
|
|
20424
20438
|
le as loadOmeZarrWell,
|
|
20425
20439
|
Le as loadOmeroChannels,
|
|
20426
20440
|
Je as loadOmeroDefaults
|