@idetik/core 0.10.0 → 0.11.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/index.d.ts +11 -4
- package/dist/index.js +522 -483
- package/dist/index.js.map +1 -1
- package/dist/index.umd.cjs +30 -30
- package/dist/index.umd.cjs.map +1 -1
- package/dist/types/src/layers/volume_layer.d.ts +12 -5
- package/dist/types/src/layers/volume_layer.d.ts.map +1 -1
- package/dist/types/src/objects/renderable/volume_renderable.d.ts +5 -1
- package/dist/types/src/objects/renderable/volume_renderable.d.ts.map +1 -1
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -188,7 +188,7 @@ out vec2 TexCoords;
|
|
|
188
188
|
void main() {
|
|
189
189
|
TexCoords = inUV;
|
|
190
190
|
gl_Position = Projection * ModelView * vec4(inPosition, 1.0);
|
|
191
|
-
}`,
|
|
191
|
+
}`, xI = `#version 300 es
|
|
192
192
|
#pragma inject_defines
|
|
193
193
|
|
|
194
194
|
precision mediump float;
|
|
@@ -214,7 +214,7 @@ void main() {
|
|
|
214
214
|
float texel = float(texture(ImageSampler, TexCoords).r);
|
|
215
215
|
float value = (texel + ValueOffset) * ValueScale;
|
|
216
216
|
fragColor = vec4(value * Color, u_opacity);
|
|
217
|
-
}`,
|
|
217
|
+
}`, bI = `#version 300 es
|
|
218
218
|
#pragma inject_defines
|
|
219
219
|
|
|
220
220
|
precision mediump float;
|
|
@@ -312,7 +312,7 @@ uniform vec3 u_color;
|
|
|
312
312
|
|
|
313
313
|
void main() {
|
|
314
314
|
fragColor = vec4(u_color, u_opacity);
|
|
315
|
-
}`,
|
|
315
|
+
}`, ZI = `#version 300 es
|
|
316
316
|
|
|
317
317
|
precision highp float;
|
|
318
318
|
|
|
@@ -325,7 +325,7 @@ out highp vec3 PositionModel;
|
|
|
325
325
|
void main() {
|
|
326
326
|
PositionModel = inPosition;
|
|
327
327
|
gl_Position = Projection * ModelView * vec4(inPosition, 1.0);
|
|
328
|
-
}`,
|
|
328
|
+
}`, PI = `#version 300 es
|
|
329
329
|
#pragma inject_defines
|
|
330
330
|
|
|
331
331
|
precision highp float;
|
|
@@ -347,11 +347,12 @@ vec3 boundingboxMin = vec3(-0.50);
|
|
|
347
347
|
vec3 boundingboxMax = vec3(0.50);
|
|
348
348
|
|
|
349
349
|
uniform bool DebugShowDegenerateRays;
|
|
350
|
-
uniform float MaxIntensity;
|
|
351
350
|
uniform float OpacityMultiplier;
|
|
352
351
|
uniform float EarlyTerminationAlpha;
|
|
353
|
-
uniform vec3 VolumeColor;
|
|
354
352
|
uniform float RelativeStepSize;
|
|
353
|
+
uniform float ValueScale;
|
|
354
|
+
uniform float ValueOffset;
|
|
355
|
+
uniform vec3 Color;
|
|
355
356
|
uniform vec3 VoxelScale;
|
|
356
357
|
|
|
357
358
|
vec2 findBoxIntersectionsAlongRay(vec3 rayOrigin, vec3 rayDir, vec3 boxMin, vec3 boxMax) {
|
|
@@ -418,18 +419,17 @@ void main() {
|
|
|
418
419
|
|
|
419
420
|
|
|
420
421
|
|
|
421
|
-
|
|
422
|
-
float intensityScale = (OpacityMultiplier / MaxIntensity) * worldSpaceStepSize;
|
|
422
|
+
float intensityScale = OpacityMultiplier * worldSpaceStepSize * ValueScale;
|
|
423
423
|
|
|
424
424
|
|
|
425
425
|
for (int i = 0; i < numSamples && accumulatedColor.a < EarlyTerminationAlpha; i++) {
|
|
426
426
|
sampledData = vec4(texture(ImageSampler, position)).r;
|
|
427
|
-
sampleAlpha = sampledData * intensityScale;
|
|
427
|
+
sampleAlpha = (sampledData + ValueOffset) * intensityScale;
|
|
428
428
|
blendedSampleAlpha = (1.0 - accumulatedColor.a) * sampleAlpha;
|
|
429
429
|
|
|
430
430
|
|
|
431
431
|
accumulatedColor.a += blendedSampleAlpha;
|
|
432
|
-
accumulatedColor.rgb +=
|
|
432
|
+
accumulatedColor.rgb += Color * blendedSampleAlpha;
|
|
433
433
|
position += stepIncrement;
|
|
434
434
|
}
|
|
435
435
|
|
|
@@ -539,30 +539,30 @@ const hC = {
|
|
|
539
539
|
},
|
|
540
540
|
floatScalarImage: {
|
|
541
541
|
vertex: rA,
|
|
542
|
-
fragment:
|
|
542
|
+
fragment: xI
|
|
543
543
|
},
|
|
544
544
|
floatScalarImageArray: {
|
|
545
545
|
vertex: rA,
|
|
546
|
-
fragment:
|
|
546
|
+
fragment: bI
|
|
547
547
|
},
|
|
548
548
|
intScalarImage: {
|
|
549
549
|
vertex: rA,
|
|
550
|
-
fragment:
|
|
550
|
+
fragment: xI,
|
|
551
551
|
fragmentDefines: /* @__PURE__ */ new Map([["TEXTURE_DATA_TYPE_INT", "1"]])
|
|
552
552
|
},
|
|
553
553
|
intScalarImageArray: {
|
|
554
554
|
vertex: rA,
|
|
555
|
-
fragment:
|
|
555
|
+
fragment: bI,
|
|
556
556
|
fragmentDefines: /* @__PURE__ */ new Map([["TEXTURE_DATA_TYPE_INT", "1"]])
|
|
557
557
|
},
|
|
558
558
|
uintScalarImage: {
|
|
559
559
|
vertex: rA,
|
|
560
|
-
fragment:
|
|
560
|
+
fragment: xI,
|
|
561
561
|
fragmentDefines: /* @__PURE__ */ new Map([["TEXTURE_DATA_TYPE_UINT", "1"]])
|
|
562
562
|
},
|
|
563
563
|
uintScalarImageArray: {
|
|
564
564
|
vertex: rA,
|
|
565
|
-
fragment:
|
|
565
|
+
fragment: bI,
|
|
566
566
|
fragmentDefines: /* @__PURE__ */ new Map([["TEXTURE_DATA_TYPE_UINT", "1"]])
|
|
567
567
|
},
|
|
568
568
|
labelImage: {
|
|
@@ -570,20 +570,20 @@ const hC = {
|
|
|
570
570
|
fragment: sC
|
|
571
571
|
},
|
|
572
572
|
floatVolume: {
|
|
573
|
-
vertex:
|
|
574
|
-
fragment:
|
|
573
|
+
vertex: ZI,
|
|
574
|
+
fragment: PI
|
|
575
575
|
},
|
|
576
576
|
intVolume: {
|
|
577
|
-
vertex:
|
|
578
|
-
fragment:
|
|
577
|
+
vertex: ZI,
|
|
578
|
+
fragment: PI,
|
|
579
579
|
fragmentDefines: /* @__PURE__ */ new Map([["TEXTURE_DATA_TYPE_INT", "1"]])
|
|
580
580
|
},
|
|
581
581
|
uintVolume: {
|
|
582
|
-
vertex:
|
|
583
|
-
fragment:
|
|
582
|
+
vertex: ZI,
|
|
583
|
+
fragment: PI,
|
|
584
584
|
fragmentDefines: /* @__PURE__ */ new Map([["TEXTURE_DATA_TYPE_UINT", "1"]])
|
|
585
585
|
}
|
|
586
|
-
},
|
|
586
|
+
}, Wg = {
|
|
587
587
|
debug: 10,
|
|
588
588
|
info: 20,
|
|
589
589
|
warn: 30,
|
|
@@ -627,7 +627,7 @@ class U {
|
|
|
627
627
|
U.log("error", A, I, ...B);
|
|
628
628
|
}
|
|
629
629
|
static log(A, I, B, ...C) {
|
|
630
|
-
if (
|
|
630
|
+
if (Wg[A] < Wg[U.logLevel_]) return;
|
|
631
631
|
const Q = (/* @__PURE__ */ new Date()).toISOString(), E = tC[A], i = `[${Q}][${A.toUpperCase()}][${I}]`, o = [`${E}${i}`, B, ...C];
|
|
632
632
|
switch (A) {
|
|
633
633
|
case "debug":
|
|
@@ -724,7 +724,7 @@ class eC {
|
|
|
724
724
|
for (let I = 0; I < A; I++) {
|
|
725
725
|
const B = this.gl_.getActiveUniform(this.program_, I);
|
|
726
726
|
if (B) {
|
|
727
|
-
if (!
|
|
727
|
+
if (!nC.has(B.type))
|
|
728
728
|
throw new Error(
|
|
729
729
|
`Unsupported uniform type "${B.type}" (GLenum) found in shader program for uniform "${B.name}"`
|
|
730
730
|
);
|
|
@@ -789,10 +789,10 @@ const GC = typeof window < "u" ? [
|
|
|
789
789
|
WebGL2RenderingContext.UNSIGNED_INT_SAMPLER_3D,
|
|
790
790
|
WebGL2RenderingContext.UNSIGNED_INT_SAMPLER_CUBE,
|
|
791
791
|
WebGL2RenderingContext.UNSIGNED_INT_SAMPLER_2D_ARRAY
|
|
792
|
-
] : [],
|
|
792
|
+
] : [], nC = new Set(
|
|
793
793
|
GC
|
|
794
|
-
),
|
|
795
|
-
class
|
|
794
|
+
), OI = "#pragma inject_defines";
|
|
795
|
+
class wC {
|
|
796
796
|
gl_;
|
|
797
797
|
programs_ = /* @__PURE__ */ new Map();
|
|
798
798
|
constructor(A) {
|
|
@@ -801,10 +801,10 @@ class nC {
|
|
|
801
801
|
use(A) {
|
|
802
802
|
let I = this.programs_.get(A);
|
|
803
803
|
if (I === void 0) {
|
|
804
|
-
const B = hC[A], C =
|
|
804
|
+
const B = hC[A], C = xg(
|
|
805
805
|
B.vertex,
|
|
806
806
|
B.vertexDefines
|
|
807
|
-
), Q =
|
|
807
|
+
), Q = xg(
|
|
808
808
|
B.fragment,
|
|
809
809
|
B.fragmentDefines
|
|
810
810
|
);
|
|
@@ -822,16 +822,16 @@ class nC {
|
|
|
822
822
|
return I;
|
|
823
823
|
}
|
|
824
824
|
}
|
|
825
|
-
function
|
|
825
|
+
function xg(g, A) {
|
|
826
826
|
if (A === void 0 || A.size == 0) return g;
|
|
827
|
-
if (!g.includes(
|
|
827
|
+
if (!g.includes(OI))
|
|
828
828
|
throw new Error(
|
|
829
|
-
`Shader source does not contain "${
|
|
829
|
+
`Shader source does not contain "${OI}" directive`
|
|
830
830
|
);
|
|
831
831
|
const I = Array(A.entries()).map(([E, i]) => `#define ${E} ${i}`).join(`
|
|
832
832
|
`), C = `#line __LINE__ + ${1 - A.size}`, Q = `${I}
|
|
833
833
|
${C}`;
|
|
834
|
-
return g.replace(
|
|
834
|
+
return g.replace(OI, Q);
|
|
835
835
|
}
|
|
836
836
|
const v = [
|
|
837
837
|
"00",
|
|
@@ -1095,7 +1095,7 @@ function NB() {
|
|
|
1095
1095
|
const g = Math.random() * 4294967295 | 0, A = Math.random() * 4294967295 | 0, I = Math.random() * 4294967295 | 0, B = Math.random() * 4294967295 | 0;
|
|
1096
1096
|
return (v[g & 255] + v[g >> 8 & 255] + v[g >> 16 & 255] + v[g >> 24 & 255] + "-" + v[A & 255] + v[A >> 8 & 255] + "-" + v[A >> 16 & 15 | 64] + v[A >> 24 & 255] + "-" + v[I & 63 | 128] + v[I >> 8 & 255] + "-" + v[I >> 16 & 255] + v[I >> 24 & 255] + v[B & 255] + v[B >> 8 & 255] + v[B >> 16 & 255] + v[B >> 24 & 255]).toLowerCase();
|
|
1097
1097
|
}
|
|
1098
|
-
class
|
|
1098
|
+
class sg {
|
|
1099
1099
|
uuid = NB();
|
|
1100
1100
|
}
|
|
1101
1101
|
var p = 1e-6, b = typeof Float32Array < "u" ? Float32Array : Array, FC = Math.PI / 180;
|
|
@@ -1118,20 +1118,20 @@ function _() {
|
|
|
1118
1118
|
var g = new b(16);
|
|
1119
1119
|
return b != Float32Array && (g[1] = 0, g[2] = 0, g[3] = 0, g[4] = 0, g[6] = 0, g[7] = 0, g[8] = 0, g[9] = 0, g[11] = 0, g[12] = 0, g[13] = 0, g[14] = 0), g[0] = 1, g[5] = 1, g[10] = 1, g[15] = 1, g;
|
|
1120
1120
|
}
|
|
1121
|
-
function
|
|
1122
|
-
var I = A[0], B = A[1], C = A[2], Q = A[3], E = A[4], i = A[5], o = A[6], a = A[7], D = A[8], h = A[9], t = A[10], y = A[11],
|
|
1123
|
-
return u ? (u = 1 / u, g[0] = (i * oA - o * iA + a * V) * u, g[1] = (C * iA - B * oA - Q * V) * u, g[2] = (
|
|
1121
|
+
function fI(g, A) {
|
|
1122
|
+
var I = A[0], B = A[1], C = A[2], Q = A[3], E = A[4], i = A[5], o = A[6], a = A[7], D = A[8], h = A[9], t = A[10], y = A[11], n = A[12], w = A[13], r = A[14], G = A[15], c = I * i - B * E, N = I * o - C * E, d = I * a - Q * E, L = B * o - C * i, k = B * a - Q * i, T = C * a - Q * o, P = D * w - h * n, O = D * r - t * n, Z = D * G - y * n, V = h * r - t * w, iA = h * G - y * w, oA = t * G - y * r, u = c * oA - N * iA + d * V + L * Z - k * O + T * P;
|
|
1123
|
+
return u ? (u = 1 / u, g[0] = (i * oA - o * iA + a * V) * u, g[1] = (C * iA - B * oA - Q * V) * u, g[2] = (w * T - r * k + G * L) * u, g[3] = (t * k - h * T - y * L) * u, g[4] = (o * Z - E * oA - a * O) * u, g[5] = (I * oA - C * Z + Q * O) * u, g[6] = (r * d - n * T - G * N) * u, g[7] = (D * T - t * d + y * N) * u, g[8] = (E * iA - i * Z + a * P) * u, g[9] = (B * Z - I * iA - Q * P) * u, g[10] = (n * k - w * d + G * c) * u, g[11] = (h * d - D * k - y * c) * u, g[12] = (i * O - E * V - o * P) * u, g[13] = (I * V - B * O + C * P) * u, g[14] = (w * N - n * L - r * c) * u, g[15] = (D * L - h * N + t * c) * u, g) : null;
|
|
1124
1124
|
}
|
|
1125
1125
|
function VA(g, A, I) {
|
|
1126
|
-
var B = A[0], C = A[1], Q = A[2], E = A[3], i = A[4], o = A[5], a = A[6], D = A[7], h = A[8], t = A[9], y = A[10],
|
|
1127
|
-
return g[0] = N * B + d * i + L * h + k *
|
|
1126
|
+
var B = A[0], C = A[1], Q = A[2], E = A[3], i = A[4], o = A[5], a = A[6], D = A[7], h = A[8], t = A[9], y = A[10], n = A[11], w = A[12], r = A[13], G = A[14], c = A[15], N = I[0], d = I[1], L = I[2], k = I[3];
|
|
1127
|
+
return g[0] = N * B + d * i + L * h + k * w, g[1] = N * C + d * o + L * t + k * r, g[2] = N * Q + d * a + L * y + k * G, g[3] = N * E + d * D + L * n + k * c, N = I[4], d = I[5], L = I[6], k = I[7], g[4] = N * B + d * i + L * h + k * w, g[5] = N * C + d * o + L * t + k * r, g[6] = N * Q + d * a + L * y + k * G, g[7] = N * E + d * D + L * n + k * c, N = I[8], d = I[9], L = I[10], k = I[11], g[8] = N * B + d * i + L * h + k * w, g[9] = N * C + d * o + L * t + k * r, g[10] = N * Q + d * a + L * y + k * G, g[11] = N * E + d * D + L * n + k * c, N = I[12], d = I[13], L = I[14], k = I[15], g[12] = N * B + d * i + L * h + k * w, g[13] = N * C + d * o + L * t + k * r, g[14] = N * Q + d * a + L * y + k * G, g[15] = N * E + d * D + L * n + k * c, g;
|
|
1128
1128
|
}
|
|
1129
1129
|
function RC(g, A) {
|
|
1130
1130
|
return g[0] = A[0], g[1] = 0, g[2] = 0, g[3] = 0, g[4] = 0, g[5] = A[1], g[6] = 0, g[7] = 0, g[8] = 0, g[9] = 0, g[10] = A[2], g[11] = 0, g[12] = 0, g[13] = 0, g[14] = 0, g[15] = 1, g;
|
|
1131
1131
|
}
|
|
1132
1132
|
function NC(g, A, I, B) {
|
|
1133
|
-
var C = A[0], Q = A[1], E = A[2], i = A[3], o = C + C, a = Q + Q, D = E + E, h = C * o, t = C * a, y = C * D,
|
|
1134
|
-
return g[0] = (1 - (
|
|
1133
|
+
var C = A[0], Q = A[1], E = A[2], i = A[3], o = C + C, a = Q + Q, D = E + E, h = C * o, t = C * a, y = C * D, n = Q * a, w = Q * D, r = E * D, G = i * o, c = i * a, N = i * D, d = B[0], L = B[1], k = B[2];
|
|
1134
|
+
return g[0] = (1 - (n + r)) * d, g[1] = (t + N) * d, g[2] = (y - c) * d, g[3] = 0, g[4] = (t - N) * L, g[5] = (1 - (h + r)) * L, g[6] = (w + G) * L, g[7] = 0, g[8] = (y + c) * k, g[9] = (w - G) * k, g[10] = (1 - (h + n)) * k, g[11] = 0, g[12] = I[0], g[13] = I[1], g[14] = I[2], g[15] = 1, g;
|
|
1135
1135
|
}
|
|
1136
1136
|
function cC(g, A, I, B, C) {
|
|
1137
1137
|
var Q = 1 / Math.tan(A / 2), E;
|
|
@@ -1146,12 +1146,12 @@ var LC = kC;
|
|
|
1146
1146
|
function JC(g, A, I, B) {
|
|
1147
1147
|
var C = A[0], Q = A[1], E = A[2], i = B[0], o = B[1], a = B[2], D = C - I[0], h = Q - I[1], t = E - I[2], y = D * D + h * h + t * t;
|
|
1148
1148
|
y > 0 && (y = 1 / Math.sqrt(y), D *= y, h *= y, t *= y);
|
|
1149
|
-
var
|
|
1150
|
-
return y =
|
|
1149
|
+
var n = o * t - a * h, w = a * D - i * t, r = i * h - o * D;
|
|
1150
|
+
return y = n * n + w * w + r * r, y > 0 && (y = 1 / Math.sqrt(y), n *= y, w *= y, r *= y), g[0] = n, g[1] = w, g[2] = r, g[3] = 0, g[4] = h * r - t * w, g[5] = t * n - D * r, g[6] = D * w - h * n, g[7] = 0, g[8] = D, g[9] = h, g[10] = t, g[11] = 0, g[12] = C, g[13] = Q, g[14] = E, g[15] = 1, g;
|
|
1151
1151
|
}
|
|
1152
1152
|
function YC(g, A) {
|
|
1153
|
-
var I = g[0], B = g[1], C = g[2], Q = g[3], E = g[4], i = g[5], o = g[6], a = g[7], D = g[8], h = g[9], t = g[10], y = g[11],
|
|
1154
|
-
return Math.abs(I - c) <= p * Math.max(1, Math.abs(I), Math.abs(c)) && Math.abs(B - N) <= p * Math.max(1, Math.abs(B), Math.abs(N)) && Math.abs(C - d) <= p * Math.max(1, Math.abs(C), Math.abs(d)) && Math.abs(Q - L) <= p * Math.max(1, Math.abs(Q), Math.abs(L)) && Math.abs(E - k) <= p * Math.max(1, Math.abs(E), Math.abs(k)) && Math.abs(i - T) <= p * Math.max(1, Math.abs(i), Math.abs(T)) && Math.abs(o - P) <= p * Math.max(1, Math.abs(o), Math.abs(P)) && Math.abs(a - O) <= p * Math.max(1, Math.abs(a), Math.abs(O)) && Math.abs(D - Z) <= p * Math.max(1, Math.abs(D), Math.abs(Z)) && Math.abs(h - V) <= p * Math.max(1, Math.abs(h), Math.abs(V)) && Math.abs(t - iA) <= p * Math.max(1, Math.abs(t), Math.abs(iA)) && Math.abs(y - oA) <= p * Math.max(1, Math.abs(y), Math.abs(oA)) && Math.abs(
|
|
1153
|
+
var I = g[0], B = g[1], C = g[2], Q = g[3], E = g[4], i = g[5], o = g[6], a = g[7], D = g[8], h = g[9], t = g[10], y = g[11], n = g[12], w = g[13], r = g[14], G = g[15], c = A[0], N = A[1], d = A[2], L = A[3], k = A[4], T = A[5], P = A[6], O = A[7], Z = A[8], V = A[9], iA = A[10], oA = A[11], u = A[12], mg = A[13], ug = A[14], Tg = A[15];
|
|
1154
|
+
return Math.abs(I - c) <= p * Math.max(1, Math.abs(I), Math.abs(c)) && Math.abs(B - N) <= p * Math.max(1, Math.abs(B), Math.abs(N)) && Math.abs(C - d) <= p * Math.max(1, Math.abs(C), Math.abs(d)) && Math.abs(Q - L) <= p * Math.max(1, Math.abs(Q), Math.abs(L)) && Math.abs(E - k) <= p * Math.max(1, Math.abs(E), Math.abs(k)) && Math.abs(i - T) <= p * Math.max(1, Math.abs(i), Math.abs(T)) && Math.abs(o - P) <= p * Math.max(1, Math.abs(o), Math.abs(P)) && Math.abs(a - O) <= p * Math.max(1, Math.abs(a), Math.abs(O)) && Math.abs(D - Z) <= p * Math.max(1, Math.abs(D), Math.abs(Z)) && Math.abs(h - V) <= p * Math.max(1, Math.abs(h), Math.abs(V)) && Math.abs(t - iA) <= p * Math.max(1, Math.abs(t), Math.abs(iA)) && Math.abs(y - oA) <= p * Math.max(1, Math.abs(y), Math.abs(oA)) && Math.abs(n - u) <= p * Math.max(1, Math.abs(n), Math.abs(u)) && Math.abs(w - mg) <= p * Math.max(1, Math.abs(w), Math.abs(mg)) && Math.abs(r - ug) <= p * Math.max(1, Math.abs(r), Math.abs(ug)) && Math.abs(G - Tg) <= p * Math.max(1, Math.abs(G), Math.abs(Tg));
|
|
1155
1155
|
}
|
|
1156
1156
|
function f() {
|
|
1157
1157
|
var g = new b(3);
|
|
@@ -1175,7 +1175,7 @@ function PA(g, A) {
|
|
|
1175
1175
|
function SA(g, A, I, B) {
|
|
1176
1176
|
return g[0] = A, g[1] = I, g[2] = B, g;
|
|
1177
1177
|
}
|
|
1178
|
-
function
|
|
1178
|
+
function SI(g, A, I) {
|
|
1179
1179
|
return g[0] = A[0] + I[0], g[1] = A[1] + I[1], g[2] = A[2] + I[2], g;
|
|
1180
1180
|
}
|
|
1181
1181
|
function dC(g, A, I) {
|
|
@@ -1184,17 +1184,17 @@ function dC(g, A, I) {
|
|
|
1184
1184
|
function MC(g, A, I) {
|
|
1185
1185
|
return g[0] = A[0] * I[0], g[1] = A[1] * I[1], g[2] = A[2] * I[2], g;
|
|
1186
1186
|
}
|
|
1187
|
-
function
|
|
1187
|
+
function RI(g, A, I) {
|
|
1188
1188
|
return g[0] = A[0] * I, g[1] = A[1] * I, g[2] = A[2] * I, g;
|
|
1189
1189
|
}
|
|
1190
|
-
function
|
|
1190
|
+
function bg(g, A, I, B) {
|
|
1191
1191
|
return g[0] = A[0] + I[0] * B, g[1] = A[1] + I[1] * B, g[2] = A[2] + I[2] * B, g;
|
|
1192
1192
|
}
|
|
1193
|
-
function
|
|
1193
|
+
function Zg(g, A) {
|
|
1194
1194
|
var I = A[0] - g[0], B = A[1] - g[1], C = A[2] - g[2];
|
|
1195
1195
|
return Math.hypot(I, B, C);
|
|
1196
1196
|
}
|
|
1197
|
-
function
|
|
1197
|
+
function Pg(g, A) {
|
|
1198
1198
|
var I = A[0] - g[0], B = A[1] - g[1], C = A[2] - g[2];
|
|
1199
1199
|
return I * I + B * B + C * C;
|
|
1200
1200
|
}
|
|
@@ -1205,7 +1205,7 @@ function KC(g, A) {
|
|
|
1205
1205
|
function kB(g, A) {
|
|
1206
1206
|
return g[0] * A[0] + g[1] * A[1] + g[2] * A[2];
|
|
1207
1207
|
}
|
|
1208
|
-
function
|
|
1208
|
+
function VI(g, A, I) {
|
|
1209
1209
|
var B = A[0], C = A[1], Q = A[2], E = I[0], i = I[1], o = I[2];
|
|
1210
1210
|
return g[0] = C * o - Q * i, g[1] = Q * E - B * o, g[2] = B * i - C * E, g;
|
|
1211
1211
|
}
|
|
@@ -1213,7 +1213,7 @@ function HC(g, A, I, B, C, Q) {
|
|
|
1213
1213
|
var E = 1 - Q, i = E * E, o = Q * Q, a = i * E, D = 3 * Q * i, h = 3 * o * E, t = o * Q;
|
|
1214
1214
|
return g[0] = A[0] * a + I[0] * D + B[0] * h + C[0] * t, g[1] = A[1] * a + I[1] * D + B[1] * h + C[1] * t, g[2] = A[2] * a + I[2] * D + B[2] * h + C[2] * t, g;
|
|
1215
1215
|
}
|
|
1216
|
-
function
|
|
1216
|
+
function pI(g, A, I) {
|
|
1217
1217
|
var B = A[0], C = A[1], Q = A[2], E = I[3] * B + I[7] * C + I[11] * Q + I[15];
|
|
1218
1218
|
return E = E || 1, g[0] = (I[0] * B + I[4] * C + I[8] * Q + I[12]) / E, g[1] = (I[1] * B + I[5] * C + I[9] * Q + I[13]) / E, g[2] = (I[2] * B + I[6] * C + I[10] * Q + I[14]) / E, g;
|
|
1219
1219
|
}
|
|
@@ -1221,7 +1221,7 @@ function qC(g, A) {
|
|
|
1221
1221
|
var I = g[0], B = g[1], C = g[2], Q = A[0], E = A[1], i = A[2];
|
|
1222
1222
|
return Math.abs(I - Q) <= p * Math.max(1, Math.abs(I), Math.abs(Q)) && Math.abs(B - E) <= p * Math.max(1, Math.abs(B), Math.abs(E)) && Math.abs(C - i) <= p * Math.max(1, Math.abs(C), Math.abs(i));
|
|
1223
1223
|
}
|
|
1224
|
-
var
|
|
1224
|
+
var Ig = dC, lC = UB;
|
|
1225
1225
|
(function() {
|
|
1226
1226
|
var g = f();
|
|
1227
1227
|
return function(A, I, B, C, Q, E) {
|
|
@@ -1239,7 +1239,7 @@ function fC(g) {
|
|
|
1239
1239
|
var A = new b(4);
|
|
1240
1240
|
return A[0] = g[0], A[1] = g[1], A[2] = g[2], A[3] = g[3], A;
|
|
1241
1241
|
}
|
|
1242
|
-
function
|
|
1242
|
+
function NI(g, A, I, B) {
|
|
1243
1243
|
var C = new b(4);
|
|
1244
1244
|
return C[0] = g, C[1] = A, C[2] = I, C[3] = B, C;
|
|
1245
1245
|
}
|
|
@@ -1266,7 +1266,7 @@ function vA(g, A, I) {
|
|
|
1266
1266
|
return A;
|
|
1267
1267
|
};
|
|
1268
1268
|
})();
|
|
1269
|
-
function
|
|
1269
|
+
function gg() {
|
|
1270
1270
|
var g = new b(4);
|
|
1271
1271
|
return b != Float32Array && (g[0] = 0, g[1] = 0, g[2] = 0), g[3] = 1, g;
|
|
1272
1272
|
}
|
|
@@ -1279,9 +1279,9 @@ function WC(g, A, I) {
|
|
|
1279
1279
|
var B = A[0], C = A[1], Q = A[2], E = A[3], i = I[0], o = I[1], a = I[2], D = I[3];
|
|
1280
1280
|
return g[0] = B * D + E * i + C * a - Q * o, g[1] = C * D + E * o + Q * i - B * a, g[2] = Q * D + E * a + B * o - C * i, g[3] = E * D - B * i - C * o - Q * a, g;
|
|
1281
1281
|
}
|
|
1282
|
-
function
|
|
1283
|
-
var C = A[0], Q = A[1], E = A[2], i = A[3], o = I[0], a = I[1], D = I[2], h = I[3], t, y,
|
|
1284
|
-
return y = C * o + Q * a + E * D + i * h, y < 0 && (y = -y, o = -o, a = -a, D = -D, h = -h), 1 - y > p ? (t = Math.acos(y),
|
|
1282
|
+
function vI(g, A, I, B) {
|
|
1283
|
+
var C = A[0], Q = A[1], E = A[2], i = A[3], o = I[0], a = I[1], D = I[2], h = I[3], t, y, n, w, r;
|
|
1284
|
+
return y = C * o + Q * a + E * D + i * h, y < 0 && (y = -y, o = -o, a = -a, D = -D, h = -h), 1 - y > p ? (t = Math.acos(y), n = Math.sin(t), w = Math.sin((1 - B) * t) / n, r = Math.sin(B * t) / n) : (w = 1 - B, r = B), g[0] = w * C + r * o, g[1] = w * Q + r * a, g[2] = w * E + r * D, g[3] = w * i + r * h, g;
|
|
1285
1285
|
}
|
|
1286
1286
|
function LB(g, A) {
|
|
1287
1287
|
var I = A[0] + A[4] + A[8], B;
|
|
@@ -1295,31 +1295,31 @@ function LB(g, A) {
|
|
|
1295
1295
|
}
|
|
1296
1296
|
return g;
|
|
1297
1297
|
}
|
|
1298
|
-
var xC = fC, bC = pC,
|
|
1298
|
+
var xC = fC, bC = pC, hg = uC;
|
|
1299
1299
|
(function() {
|
|
1300
1300
|
var g = f(), A = q(1, 0, 0), I = q(0, 1, 0);
|
|
1301
1301
|
return function(B, C, Q) {
|
|
1302
1302
|
var E = kB(C, Q);
|
|
1303
|
-
return E < -0.999999 ? (
|
|
1303
|
+
return E < -0.999999 ? (VI(g, A, C), lC(g) < 1e-6 && VI(g, I, C), KC(g, g), TC(B, g, Math.PI), B) : E > 0.999999 ? (B[0] = 0, B[1] = 0, B[2] = 0, B[3] = 1, B) : (VI(g, C, Q), B[0] = g[0], B[1] = g[1], B[2] = g[2], B[3] = 1 + E, hg(B, B));
|
|
1304
1304
|
};
|
|
1305
1305
|
})();
|
|
1306
1306
|
(function() {
|
|
1307
|
-
var g =
|
|
1307
|
+
var g = gg(), A = gg();
|
|
1308
1308
|
return function(I, B, C, Q, E, i) {
|
|
1309
|
-
return
|
|
1309
|
+
return vI(g, B, E, i), vI(A, C, Q, i), vI(I, g, A, 2 * i * (1 - i)), I;
|
|
1310
1310
|
};
|
|
1311
1311
|
})();
|
|
1312
1312
|
(function() {
|
|
1313
1313
|
var g = cB();
|
|
1314
1314
|
return function(A, I, B, C) {
|
|
1315
|
-
return g[0] = B[0], g[3] = B[1], g[6] = B[2], g[1] = C[0], g[4] = C[1], g[7] = C[2], g[2] = -I[0], g[5] = -I[1], g[8] = -I[2],
|
|
1315
|
+
return g[0] = B[0], g[3] = B[1], g[6] = B[2], g[1] = C[0], g[4] = C[1], g[7] = C[2], g[2] = -I[0], g[5] = -I[1], g[8] = -I[2], hg(A, LB(A, g));
|
|
1316
1316
|
};
|
|
1317
1317
|
})();
|
|
1318
1318
|
function JB() {
|
|
1319
1319
|
var g = new b(2);
|
|
1320
1320
|
return b != Float32Array && (g[0] = 0, g[1] = 0), g;
|
|
1321
1321
|
}
|
|
1322
|
-
function
|
|
1322
|
+
function Og(g) {
|
|
1323
1323
|
var A = new b(2);
|
|
1324
1324
|
return A[0] = g[0], A[1] = g[1], A;
|
|
1325
1325
|
}
|
|
@@ -1339,10 +1339,10 @@ function OC(g, A, I, B) {
|
|
|
1339
1339
|
var C = A[0], Q = A[1];
|
|
1340
1340
|
return g[0] = C + B * (I[0] - C), g[1] = Q + B * (I[1] - Q), g;
|
|
1341
1341
|
}
|
|
1342
|
-
function
|
|
1342
|
+
function Vg(g, A) {
|
|
1343
1343
|
return g[0] === A[0] && g[1] === A[1];
|
|
1344
1344
|
}
|
|
1345
|
-
function
|
|
1345
|
+
function XI(g, A) {
|
|
1346
1346
|
var I = g[0], B = g[1], C = A[0], Q = A[1];
|
|
1347
1347
|
return Math.abs(I - C) <= p * Math.max(1, Math.abs(I), Math.abs(C)) && Math.abs(B - Q) <= p * Math.max(1, Math.abs(B), Math.abs(Q));
|
|
1348
1348
|
}
|
|
@@ -1394,7 +1394,7 @@ class RA {
|
|
|
1394
1394
|
this.min = q(1 / 0, 1 / 0, 1 / 0), this.max = q(-1 / 0, -1 / 0, -1 / 0);
|
|
1395
1395
|
const Q = f();
|
|
1396
1396
|
for (const E of C)
|
|
1397
|
-
|
|
1397
|
+
pI(Q, E, A), this.expandWithPoint(Q);
|
|
1398
1398
|
}
|
|
1399
1399
|
}
|
|
1400
1400
|
const VC = {
|
|
@@ -1409,7 +1409,7 @@ const VC = {
|
|
|
1409
1409
|
size: 8,
|
|
1410
1410
|
marker: 9
|
|
1411
1411
|
};
|
|
1412
|
-
class uA extends
|
|
1412
|
+
class uA extends sg {
|
|
1413
1413
|
boundingBox_ = null;
|
|
1414
1414
|
primitive_;
|
|
1415
1415
|
attributes_;
|
|
@@ -1770,7 +1770,7 @@ class AA {
|
|
|
1770
1770
|
* the first element, and avoids biasing toward (0,0).
|
|
1771
1771
|
*/
|
|
1772
1772
|
constructor(A, I) {
|
|
1773
|
-
this.min = A ?
|
|
1773
|
+
this.min = A ? Og(A) : x(1 / 0, 1 / 0), this.max = I ? Og(I) : x(-1 / 0, -1 / 0);
|
|
1774
1774
|
}
|
|
1775
1775
|
clone() {
|
|
1776
1776
|
return new AA(this.min, this.max);
|
|
@@ -1783,7 +1783,7 @@ class AA {
|
|
|
1783
1783
|
return !(A.max[0] <= I.min[0] || A.min[0] >= I.max[0] || A.max[1] <= I.min[1] || A.min[1] >= I.max[1]);
|
|
1784
1784
|
}
|
|
1785
1785
|
static equals(A, I) {
|
|
1786
|
-
return
|
|
1786
|
+
return Vg(A.min, I.min) && Vg(A.max, I.max);
|
|
1787
1787
|
}
|
|
1788
1788
|
floor() {
|
|
1789
1789
|
return new AA(
|
|
@@ -1916,7 +1916,7 @@ class _C extends CC {
|
|
|
1916
1916
|
this.gl_ = I, U.info(
|
|
1917
1917
|
"WebGLRenderer",
|
|
1918
1918
|
`WebGL version ${I.getParameter(I.VERSION)}`
|
|
1919
|
-
), this.programs_ = new
|
|
1919
|
+
), this.programs_ = new wC(I), this.bindings_ = new vC(I), this.textures_ = new XC(I), this.state_ = new jC(I), this.initStencil(), this.resize(this.canvas.width, this.canvas.height);
|
|
1920
1920
|
}
|
|
1921
1921
|
render(A) {
|
|
1922
1922
|
const I = A.getBoxRelativeTo(this.canvas), B = new AA(
|
|
@@ -1992,28 +1992,28 @@ class _C extends CC {
|
|
|
1992
1992
|
...B.getUniforms(),
|
|
1993
1993
|
...a
|
|
1994
1994
|
};
|
|
1995
|
-
for (const
|
|
1996
|
-
switch (
|
|
1995
|
+
for (const n of C.uniformNames)
|
|
1996
|
+
switch (n) {
|
|
1997
1997
|
case "ModelView":
|
|
1998
|
-
C.setUniform(
|
|
1998
|
+
C.setUniform(n, E);
|
|
1999
1999
|
break;
|
|
2000
2000
|
case "Projection":
|
|
2001
|
-
C.setUniform(
|
|
2001
|
+
C.setUniform(n, i);
|
|
2002
2002
|
break;
|
|
2003
2003
|
case "Resolution":
|
|
2004
|
-
C.setUniform(
|
|
2004
|
+
C.setUniform(n, o);
|
|
2005
2005
|
break;
|
|
2006
2006
|
case "u_opacity":
|
|
2007
|
-
C.setUniform(
|
|
2007
|
+
C.setUniform(n, B.opacity);
|
|
2008
2008
|
break;
|
|
2009
2009
|
case "CameraPositionModel": {
|
|
2010
|
-
const
|
|
2010
|
+
const w = fI(_(), E), r = NI(0, 0, 0, 1), G = vA(
|
|
2011
2011
|
HA(),
|
|
2012
2012
|
r,
|
|
2013
|
-
|
|
2013
|
+
w
|
|
2014
2014
|
);
|
|
2015
2015
|
C.setUniform(
|
|
2016
|
-
|
|
2016
|
+
n,
|
|
2017
2017
|
q(
|
|
2018
2018
|
G[0],
|
|
2019
2019
|
G[1],
|
|
@@ -2023,7 +2023,7 @@ class _C extends CC {
|
|
|
2023
2023
|
break;
|
|
2024
2024
|
}
|
|
2025
2025
|
default:
|
|
2026
|
-
|
|
2026
|
+
n in h && C.setUniform(n, h[n]);
|
|
2027
2027
|
}
|
|
2028
2028
|
const t = this.glGetPrimitive(A.primitive), y = A.indexData;
|
|
2029
2029
|
y.length ? this.gl_.drawElements(t, y.length, this.gl_.UNSIGNED_INT, 0) : this.gl_.drawArrays(t, 0, A.vertexCount);
|
|
@@ -2106,7 +2106,7 @@ class AQ {
|
|
|
2106
2106
|
this.running_.set(I, { controller: C, promise: Q });
|
|
2107
2107
|
}
|
|
2108
2108
|
}
|
|
2109
|
-
const
|
|
2109
|
+
const vg = [
|
|
2110
2110
|
Int8Array,
|
|
2111
2111
|
Int16Array,
|
|
2112
2112
|
Int32Array,
|
|
@@ -2115,10 +2115,10 @@ const Vg = [
|
|
|
2115
2115
|
Uint32Array,
|
|
2116
2116
|
Float32Array
|
|
2117
2117
|
];
|
|
2118
|
-
function
|
|
2119
|
-
if (
|
|
2118
|
+
function Xg(g) {
|
|
2119
|
+
if (vg.some((I) => g instanceof I))
|
|
2120
2120
|
return !0;
|
|
2121
|
-
const A =
|
|
2121
|
+
const A = vg.map((I) => I.name);
|
|
2122
2122
|
return U.debug(
|
|
2123
2123
|
"Chunk",
|
|
2124
2124
|
`Unsupported chunk data type: ${g}. Supported data types: ${A}`
|
|
@@ -2127,13 +2127,13 @@ function vg(g) {
|
|
|
2127
2127
|
function IQ(g, A) {
|
|
2128
2128
|
return Math.round((A - g.translation) / g.scale);
|
|
2129
2129
|
}
|
|
2130
|
-
function
|
|
2130
|
+
function Bg(g, A, I = 1e-6) {
|
|
2131
2131
|
return Math.abs(g - A) <= I;
|
|
2132
2132
|
}
|
|
2133
2133
|
function XA(g, A, I) {
|
|
2134
2134
|
return Math.max(A, Math.min(I, g));
|
|
2135
2135
|
}
|
|
2136
|
-
const
|
|
2136
|
+
const tg = Symbol("INTERNAL_POLICY_KEY");
|
|
2137
2137
|
class gQ {
|
|
2138
2138
|
store_;
|
|
2139
2139
|
policy_;
|
|
@@ -2202,22 +2202,22 @@ class gQ {
|
|
|
2202
2202
|
), this.chunkViewStates_.clear();
|
|
2203
2203
|
return;
|
|
2204
2204
|
}
|
|
2205
|
-
const
|
|
2206
|
-
OC(
|
|
2205
|
+
const w = JB();
|
|
2206
|
+
OC(w, Q.min, Q.max, 0.5);
|
|
2207
2207
|
const [r, G] = this.getZBounds(A), c = new RA(
|
|
2208
2208
|
q(Q.min[0], Q.min[1], r),
|
|
2209
2209
|
q(Q.max[0], Q.max[1], G)
|
|
2210
2210
|
);
|
|
2211
|
-
this.chunkViewStates_.forEach(
|
|
2211
|
+
this.chunkViewStates_.forEach(jI), this.updateChunksAtTimeIndex(
|
|
2212
2212
|
y,
|
|
2213
2213
|
A,
|
|
2214
2214
|
c,
|
|
2215
|
-
|
|
2215
|
+
w
|
|
2216
2216
|
), A.t !== void 0 && this.markTimeChunksForPrefetchImage(
|
|
2217
2217
|
y,
|
|
2218
2218
|
A,
|
|
2219
2219
|
c,
|
|
2220
|
-
|
|
2220
|
+
w
|
|
2221
2221
|
), this.policyChanged_ = !1, this.lastViewBounds2D_ = Q.clone(), this.lastZBounds_ = h, this.lastTCoord_ = A.t;
|
|
2222
2222
|
}
|
|
2223
2223
|
updateChunksForVolume(A, I) {
|
|
@@ -2235,7 +2235,7 @@ class gQ {
|
|
|
2235
2235
|
), this.chunkViewStates_.clear();
|
|
2236
2236
|
return;
|
|
2237
2237
|
}
|
|
2238
|
-
this.currentLOD_ = this.policy_.lod.min, this.chunkViewStates_.forEach(
|
|
2238
|
+
this.currentLOD_ = this.policy_.lod.min, this.chunkViewStates_.forEach(jI);
|
|
2239
2239
|
const i = this.fallbackLOD();
|
|
2240
2240
|
for (const o of E) {
|
|
2241
2241
|
const a = o.lod === this.currentLOD_, D = o.lod === i;
|
|
@@ -2272,10 +2272,10 @@ class gQ {
|
|
|
2272
2272
|
I && (I.visible || I.prefetch || I.priority !== null) || this.chunkViewStates_.delete(A);
|
|
2273
2273
|
}
|
|
2274
2274
|
dispose() {
|
|
2275
|
-
this.isDisposed_ = !0, this.chunkViewStates_.forEach(
|
|
2275
|
+
this.isDisposed_ = !0, this.chunkViewStates_.forEach(jI);
|
|
2276
2276
|
}
|
|
2277
2277
|
setImageSourcePolicy(A, I) {
|
|
2278
|
-
if (I !==
|
|
2278
|
+
if (I !== tg)
|
|
2279
2279
|
throw new Error("Unauthorized policy mutation");
|
|
2280
2280
|
this.policy_ !== A && (this.policy_ = A, this.policyChanged_ = !0, U.info(
|
|
2281
2281
|
"ChunkStoreView",
|
|
@@ -2303,19 +2303,19 @@ class gQ {
|
|
|
2303
2303
|
if (!a && !D) continue;
|
|
2304
2304
|
const h = this.isChunkChannelInSlice(o, I);
|
|
2305
2305
|
if (!h) continue;
|
|
2306
|
-
const t = this.isChunkWithinBounds(o, B), y = !t && h && a && this.isChunkWithinBounds(o, Q),
|
|
2306
|
+
const t = this.isChunkWithinBounds(o, B), y = !t && h && a && this.isChunkWithinBounds(o, Q), n = t && h, w = this.computePriority(
|
|
2307
2307
|
D,
|
|
2308
2308
|
a,
|
|
2309
2309
|
t,
|
|
2310
2310
|
y,
|
|
2311
2311
|
h
|
|
2312
2312
|
);
|
|
2313
|
-
if (
|
|
2313
|
+
if (w !== null) {
|
|
2314
2314
|
const r = this.squareDistance2D(o, C);
|
|
2315
2315
|
this.chunkViewStates_.set(o, {
|
|
2316
|
-
visible:
|
|
2316
|
+
visible: n,
|
|
2317
2317
|
prefetch: y,
|
|
2318
|
-
priority:
|
|
2318
|
+
priority: w,
|
|
2319
2319
|
orderKey: r
|
|
2320
2320
|
});
|
|
2321
2321
|
}
|
|
@@ -2398,13 +2398,13 @@ class gQ {
|
|
|
2398
2398
|
];
|
|
2399
2399
|
}
|
|
2400
2400
|
viewBounds2DChanged(A) {
|
|
2401
|
-
return this.lastViewBounds2D_ === null || !
|
|
2401
|
+
return this.lastViewBounds2D_ === null || !XI(this.lastViewBounds2D_.min, A.min) || !XI(this.lastViewBounds2D_.max, A.max);
|
|
2402
2402
|
}
|
|
2403
2403
|
hasViewProjectionChanged(A) {
|
|
2404
2404
|
return this.lastViewProjection_ === null || !YC(this.lastViewProjection_, A);
|
|
2405
2405
|
}
|
|
2406
2406
|
zBoundsChanged(A) {
|
|
2407
|
-
return !this.lastZBounds_ || !
|
|
2407
|
+
return !this.lastZBounds_ || !XI(this.lastZBounds_, A);
|
|
2408
2408
|
}
|
|
2409
2409
|
getPaddedBounds(A) {
|
|
2410
2410
|
const I = this.store_.dimensions, B = I.x.lods[this.currentLOD_], C = I.y.lods[this.currentLOD_], Q = I.z?.lods[this.currentLOD_], E = B.chunkSize * B.scale * this.policy_.prefetch.x, i = C.chunkSize * C.scale * this.policy_.prefetch.y;
|
|
@@ -2430,7 +2430,7 @@ class gQ {
|
|
|
2430
2430
|
return C * C + Q * Q;
|
|
2431
2431
|
}
|
|
2432
2432
|
}
|
|
2433
|
-
function
|
|
2433
|
+
function jI(g) {
|
|
2434
2434
|
g.visible = !1, g.prefetch = !1, g.priority = null, g.orderKey = null;
|
|
2435
2435
|
}
|
|
2436
2436
|
class BQ {
|
|
@@ -2447,13 +2447,13 @@ class BQ {
|
|
|
2447
2447
|
for (let C = 0; C < I; ++C) {
|
|
2448
2448
|
const Q = this.chunks_[C];
|
|
2449
2449
|
for (let E = 0; E < this.dimensions_.numLods; ++E) {
|
|
2450
|
-
const i = this.dimensions_.x.lods[E], o = this.dimensions_.y.lods[E], a = this.dimensions_.z?.lods[E], D = i.chunkSize, h = o.chunkSize, t = a?.chunkSize ?? 1, y = Math.ceil(i.size / D),
|
|
2450
|
+
const i = this.dimensions_.x.lods[E], o = this.dimensions_.y.lods[E], a = this.dimensions_.z?.lods[E], D = i.chunkSize, h = o.chunkSize, t = a?.chunkSize ?? 1, y = Math.ceil(i.size / D), n = Math.ceil(o.size / h), w = Math.ceil((a?.size ?? 1) / t);
|
|
2451
2451
|
for (let r = 0; r < B; ++r)
|
|
2452
2452
|
for (let G = 0; G < y; ++G) {
|
|
2453
2453
|
const c = i.translation + G * i.chunkSize * i.scale;
|
|
2454
|
-
for (let N = 0; N <
|
|
2454
|
+
for (let N = 0; N < n; ++N) {
|
|
2455
2455
|
const d = o.translation + N * o.chunkSize * o.scale;
|
|
2456
|
-
for (let L = 0; L <
|
|
2456
|
+
for (let L = 0; L < w; ++L) {
|
|
2457
2457
|
const k = a !== void 0 ? a.translation + L * t * a.scale : 0;
|
|
2458
2458
|
Q.push({
|
|
2459
2459
|
state: "unloaded",
|
|
@@ -2557,7 +2557,7 @@ class BQ {
|
|
|
2557
2557
|
const A = this.dimensions_.x, I = this.dimensions_.y;
|
|
2558
2558
|
for (let B = 1; B < this.dimensions_.numLods; B++) {
|
|
2559
2559
|
const C = A.lods[B].scale / A.lods[B - 1].scale, Q = I.lods[B].scale / I.lods[B - 1].scale;
|
|
2560
|
-
if (!
|
|
2560
|
+
if (!Bg(C, 2, 0.02) || !Bg(Q, 2, 0.02))
|
|
2561
2561
|
throw new Error(
|
|
2562
2562
|
`Invalid downsampling factor between levels ${B - 1} → ${B}: expected (2× in X and Y), but got (${C.toFixed(2)}×, ${Q.toFixed(2)}×) from scale [${A.lods[B - 1].scale}, ${I.lods[B - 1].scale}] → [${A.lods[B].scale}, ${I.lods[B].scale}]`
|
|
2563
2563
|
);
|
|
@@ -2686,13 +2686,13 @@ var OA = function(g = 1) {
|
|
|
2686
2686
|
};
|
|
2687
2687
|
};
|
|
2688
2688
|
OA.Panel = function(g, A, I, B) {
|
|
2689
|
-
var C = 1 / 0, Q = 0, E = Math.round, i = E(window.devicePixelRatio || 1), o = E(80 * i * B), a = E(48 * i * B), D = E(3 * i * B), h = E(2 * i * B), t = E(3 * i * B), y = E(15 * i * B),
|
|
2689
|
+
var C = 1 / 0, Q = 0, E = Math.round, i = E(window.devicePixelRatio || 1), o = E(80 * i * B), a = E(48 * i * B), D = E(3 * i * B), h = E(2 * i * B), t = E(3 * i * B), y = E(15 * i * B), n = E(74 * i * B), w = E(30 * i * B), r = document.createElement("canvas");
|
|
2690
2690
|
r.width = o, r.height = a, r.style.cssText = `width:${E(B * 80)}px;height:${E(B * 48)}px`;
|
|
2691
2691
|
var G = r.getContext("2d");
|
|
2692
|
-
return G.font = "bold " + E(9 * i * B) + "px Helvetica,Arial,sans-serif", G.textBaseline = "top", G.fillStyle = I, G.fillRect(0, 0, o, a), G.fillStyle = A, G.fillText(g, D, h), G.fillRect(t, y,
|
|
2692
|
+
return G.font = "bold " + E(9 * i * B) + "px Helvetica,Arial,sans-serif", G.textBaseline = "top", G.fillStyle = I, G.fillRect(0, 0, o, a), G.fillStyle = A, G.fillText(g, D, h), G.fillRect(t, y, n, w), G.fillStyle = I, G.globalAlpha = 0.9, G.fillRect(t, y, n, w), {
|
|
2693
2693
|
dom: r,
|
|
2694
2694
|
update: function(c, N) {
|
|
2695
|
-
C = Math.min(C, c), Q = Math.max(Q, c), G.fillStyle = I, G.globalAlpha = 1, G.fillRect(0, 0, o, y), G.fillStyle = A, G.fillText(E(c) + " " + g + " (" + E(C) + "-" + E(Q) + ")", D, h), G.drawImage(r, t + i, y,
|
|
2695
|
+
C = Math.min(C, c), Q = Math.max(Q, c), G.fillStyle = I, G.globalAlpha = 1, G.fillRect(0, 0, o, y), G.fillStyle = A, G.fillText(E(c) + " " + g + " (" + E(C) + "-" + E(Q) + ")", D, h), G.drawImage(r, t + i, y, n - i, w, t, y, n - i, w), G.fillRect(t + n - i, y, i, w), G.fillStyle = I, G.globalAlpha = 0.9, G.fillRect(t + n - i, y, i, E((1 - c / N) * w));
|
|
2696
2696
|
}
|
|
2697
2697
|
};
|
|
2698
2698
|
};
|
|
@@ -2753,7 +2753,7 @@ class EQ {
|
|
|
2753
2753
|
this.callbacks_.splice(I, 1);
|
|
2754
2754
|
}
|
|
2755
2755
|
}
|
|
2756
|
-
const
|
|
2756
|
+
const Cg = [
|
|
2757
2757
|
"pointerdown",
|
|
2758
2758
|
"pointermove",
|
|
2759
2759
|
"pointerup",
|
|
@@ -2761,7 +2761,7 @@ const gg = [
|
|
|
2761
2761
|
"wheel"
|
|
2762
2762
|
];
|
|
2763
2763
|
function iQ(g) {
|
|
2764
|
-
return
|
|
2764
|
+
return Cg.includes(g);
|
|
2765
2765
|
}
|
|
2766
2766
|
class oQ {
|
|
2767
2767
|
propagationStopped_ = !1;
|
|
@@ -2798,7 +2798,7 @@ class aQ {
|
|
|
2798
2798
|
);
|
|
2799
2799
|
return;
|
|
2800
2800
|
}
|
|
2801
|
-
this.isConnected_ = !0,
|
|
2801
|
+
this.isConnected_ = !0, Cg.forEach((A) => {
|
|
2802
2802
|
this.element_.addEventListener(A, this.handleEvent, {
|
|
2803
2803
|
passive: !1
|
|
2804
2804
|
});
|
|
@@ -2813,7 +2813,7 @@ class aQ {
|
|
|
2813
2813
|
);
|
|
2814
2814
|
return;
|
|
2815
2815
|
}
|
|
2816
|
-
this.isConnected_ = !1,
|
|
2816
|
+
this.isConnected_ = !1, Cg.forEach((A) => {
|
|
2817
2817
|
this.element_.removeEventListener(A, this.handleEvent);
|
|
2818
2818
|
});
|
|
2819
2819
|
}
|
|
@@ -2961,7 +2961,7 @@ class tQ {
|
|
|
2961
2961
|
this.resizeObserver_?.disconnect(), this.mediaQuery_ && this.onMediaQueryChange_ && this.mediaQuery_.removeEventListener("change", this.onMediaQueryChange_);
|
|
2962
2962
|
}
|
|
2963
2963
|
}
|
|
2964
|
-
class
|
|
2964
|
+
class wo {
|
|
2965
2965
|
chunkManager_;
|
|
2966
2966
|
context_;
|
|
2967
2967
|
renderer_;
|
|
@@ -3122,7 +3122,7 @@ const eQ = q(0, 1, 0);
|
|
|
3122
3122
|
class GQ {
|
|
3123
3123
|
dirty_ = !0;
|
|
3124
3124
|
matrix_ = _();
|
|
3125
|
-
rotation_ =
|
|
3125
|
+
rotation_ = gg();
|
|
3126
3126
|
translation_ = f();
|
|
3127
3127
|
scale_ = q(1, 1, 1);
|
|
3128
3128
|
addRotation(A) {
|
|
@@ -3135,7 +3135,7 @@ class GQ {
|
|
|
3135
3135
|
return xC(this.rotation_);
|
|
3136
3136
|
}
|
|
3137
3137
|
addTranslation(A) {
|
|
3138
|
-
|
|
3138
|
+
SI(this.translation_, this.translation_, A), this.dirty_ = !0;
|
|
3139
3139
|
}
|
|
3140
3140
|
setTranslation(A) {
|
|
3141
3141
|
PA(this.translation_, A), this.dirty_ = !0;
|
|
@@ -3152,7 +3152,7 @@ class GQ {
|
|
|
3152
3152
|
targetTo(A) {
|
|
3153
3153
|
qC(this.translation_, A) && (A = BA(A), A[2] += p);
|
|
3154
3154
|
const I = JC(_(), this.translation_, A, eQ), B = SC(cB(), I);
|
|
3155
|
-
LB(this.rotation_, B),
|
|
3155
|
+
LB(this.rotation_, B), hg(this.rotation_, this.rotation_), this.dirty_ = !0;
|
|
3156
3156
|
}
|
|
3157
3157
|
get scale() {
|
|
3158
3158
|
return BA(this.scale_);
|
|
@@ -3161,7 +3161,7 @@ class GQ {
|
|
|
3161
3161
|
return this.dirty_ && (this.computeMatrix(), this.dirty_ = !1), this.matrix_;
|
|
3162
3162
|
}
|
|
3163
3163
|
get inverse() {
|
|
3164
|
-
return
|
|
3164
|
+
return fI(_(), this.matrix);
|
|
3165
3165
|
}
|
|
3166
3166
|
computeMatrix() {
|
|
3167
3167
|
NC(
|
|
@@ -3172,7 +3172,7 @@ class GQ {
|
|
|
3172
3172
|
);
|
|
3173
3173
|
}
|
|
3174
3174
|
}
|
|
3175
|
-
class TA extends
|
|
3175
|
+
class TA extends sg {
|
|
3176
3176
|
wireframeEnabled = !1;
|
|
3177
3177
|
wireframeColor = l.WHITE;
|
|
3178
3178
|
depthTest = !0;
|
|
@@ -3248,11 +3248,11 @@ class YA {
|
|
|
3248
3248
|
const A = UB(this.normal);
|
|
3249
3249
|
if (A > 0) {
|
|
3250
3250
|
const I = 1 / A;
|
|
3251
|
-
|
|
3251
|
+
RI(this.normal, this.normal, I), this.signedDistance *= I;
|
|
3252
3252
|
}
|
|
3253
3253
|
}
|
|
3254
3254
|
}
|
|
3255
|
-
class
|
|
3255
|
+
class nQ {
|
|
3256
3256
|
planes_;
|
|
3257
3257
|
constructor(A) {
|
|
3258
3258
|
this.planes_ = [
|
|
@@ -3320,7 +3320,7 @@ class YB extends TA {
|
|
|
3320
3320
|
return q(A[4], A[5], A[6]);
|
|
3321
3321
|
}
|
|
3322
3322
|
get frustum() {
|
|
3323
|
-
return new
|
|
3323
|
+
return new nQ(
|
|
3324
3324
|
VA(_(), this.projectionMatrix, this.viewMatrix)
|
|
3325
3325
|
);
|
|
3326
3326
|
}
|
|
@@ -3331,7 +3331,7 @@ class YB extends TA {
|
|
|
3331
3331
|
return this.transform.translation;
|
|
3332
3332
|
}
|
|
3333
3333
|
clipToWorld(A) {
|
|
3334
|
-
const I =
|
|
3334
|
+
const I = NI(A[0], A[1], A[2], 1), B = fI(
|
|
3335
3335
|
_(),
|
|
3336
3336
|
this.projectionMatrix_
|
|
3337
3337
|
), C = vA(
|
|
@@ -3348,13 +3348,13 @@ class YB extends TA {
|
|
|
3348
3348
|
return q(Q[0], Q[1], Q[2]);
|
|
3349
3349
|
}
|
|
3350
3350
|
}
|
|
3351
|
-
const dB = 1.77,
|
|
3351
|
+
const dB = 1.77, jg = 128, zg = 128 / dB;
|
|
3352
3352
|
class Fo extends YB {
|
|
3353
3353
|
// width_ and height_ should always be defined by constructor (see setFrame)
|
|
3354
|
-
width_ =
|
|
3355
|
-
height_ =
|
|
3354
|
+
width_ = jg;
|
|
3355
|
+
height_ = zg;
|
|
3356
3356
|
viewportAspectRatio_ = dB;
|
|
3357
|
-
viewportSize_ = [
|
|
3357
|
+
viewportSize_ = [jg, zg];
|
|
3358
3358
|
constructor(A, I, B, C, Q = 0, E = 100) {
|
|
3359
3359
|
super(), this.near_ = Q, this.far_ = E, this.setFrame(A, I, C, B), this.updateProjectionMatrix();
|
|
3360
3360
|
}
|
|
@@ -3379,12 +3379,12 @@ class Fo extends YB {
|
|
|
3379
3379
|
this.transform.addScale([I, I, 1]);
|
|
3380
3380
|
}
|
|
3381
3381
|
getWorldViewRect() {
|
|
3382
|
-
let A =
|
|
3382
|
+
let A = NI(-1, -1, 0, 1), I = NI(1, 1, 0, 1);
|
|
3383
3383
|
const B = VA(
|
|
3384
3384
|
_(),
|
|
3385
3385
|
this.projectionMatrix,
|
|
3386
3386
|
this.viewMatrix
|
|
3387
|
-
), C =
|
|
3387
|
+
), C = fI(_(), B);
|
|
3388
3388
|
return A = vA(HA(), A, C), I = vA(HA(), I, C), new AA(
|
|
3389
3389
|
x(A[0], A[1]),
|
|
3390
3390
|
x(I[0], I[1])
|
|
@@ -3404,21 +3404,21 @@ class Fo extends YB {
|
|
|
3404
3404
|
);
|
|
3405
3405
|
}
|
|
3406
3406
|
}
|
|
3407
|
-
const
|
|
3407
|
+
const wQ = 60, FQ = 1.77, nI = 0.1, zI = 180 - nI;
|
|
3408
3408
|
class ro extends YB {
|
|
3409
3409
|
fov_;
|
|
3410
3410
|
aspectRatio_;
|
|
3411
3411
|
constructor(A = {}) {
|
|
3412
3412
|
const {
|
|
3413
|
-
fov: I =
|
|
3413
|
+
fov: I = wQ,
|
|
3414
3414
|
aspectRatio: B = FQ,
|
|
3415
3415
|
near: C = 0.1,
|
|
3416
3416
|
far: Q = 1e4,
|
|
3417
3417
|
position: E = q(0, 0, 0)
|
|
3418
3418
|
} = A;
|
|
3419
|
-
if (I <
|
|
3419
|
+
if (I < nI || I > zI)
|
|
3420
3420
|
throw new Error(
|
|
3421
|
-
`Invalid field of view: ${I}, must be in [${
|
|
3421
|
+
`Invalid field of view: ${I}, must be in [${nI}, ${zI}] degrees`
|
|
3422
3422
|
);
|
|
3423
3423
|
super(), this.fov_ = I, this.aspectRatio_ = B, this.near_ = C, this.far_ = Q, this.transform.setTranslation(E), this.updateProjectionMatrix();
|
|
3424
3424
|
}
|
|
@@ -3434,7 +3434,7 @@ class ro extends YB {
|
|
|
3434
3434
|
zoom(A) {
|
|
3435
3435
|
if (A <= 0)
|
|
3436
3436
|
throw new Error(`Invalid zoom factor: ${A}`);
|
|
3437
|
-
this.fov_ = Math.max(
|
|
3437
|
+
this.fov_ = Math.max(nI, Math.min(zI, this.fov_ / A)), this.updateProjectionMatrix();
|
|
3438
3438
|
}
|
|
3439
3439
|
updateProjectionMatrix() {
|
|
3440
3440
|
UC(
|
|
@@ -3446,7 +3446,7 @@ class ro extends YB {
|
|
|
3446
3446
|
);
|
|
3447
3447
|
}
|
|
3448
3448
|
}
|
|
3449
|
-
const
|
|
3449
|
+
const _g = 0;
|
|
3450
3450
|
class So {
|
|
3451
3451
|
camera_;
|
|
3452
3452
|
dragActive_ = !1;
|
|
@@ -3482,21 +3482,21 @@ class So {
|
|
|
3482
3482
|
I.preventDefault();
|
|
3483
3483
|
const B = BA(A.worldPos), C = I.deltaY < 0 ? 1.05 : 0.95;
|
|
3484
3484
|
this.camera_.zoom(C);
|
|
3485
|
-
const Q = this.camera_.clipToWorld(A.clipPos), E =
|
|
3485
|
+
const Q = this.camera_.clipToWorld(A.clipPos), E = Ig(f(), B, Q);
|
|
3486
3486
|
this.camera_.pan(E);
|
|
3487
3487
|
}
|
|
3488
3488
|
onPointerDown(A) {
|
|
3489
3489
|
const I = A.event;
|
|
3490
|
-
!A.worldPos || I.button !==
|
|
3490
|
+
!A.worldPos || I.button !== _g || (this.dragStart_ = BA(A.worldPos), this.dragActive_ = !0, I.target?.setPointerCapture?.(I.pointerId));
|
|
3491
3491
|
}
|
|
3492
3492
|
onPointerMove(A) {
|
|
3493
3493
|
if (!this.dragActive_ || !A.worldPos) return;
|
|
3494
|
-
const I =
|
|
3494
|
+
const I = Ig(f(), this.dragStart_, A.worldPos);
|
|
3495
3495
|
this.camera_.pan(I);
|
|
3496
3496
|
}
|
|
3497
3497
|
onPointerEnd(A) {
|
|
3498
3498
|
const I = A.event;
|
|
3499
|
-
!this.dragActive_ || I.button !==
|
|
3499
|
+
!this.dragActive_ || I.button !== _g || (this.dragActive_ = !1, I.target?.releasePointerCapture?.(I.pointerId));
|
|
3500
3500
|
}
|
|
3501
3501
|
}
|
|
3502
3502
|
class FA {
|
|
@@ -3575,7 +3575,7 @@ class FA {
|
|
|
3575
3575
|
return {};
|
|
3576
3576
|
}
|
|
3577
3577
|
}
|
|
3578
|
-
class
|
|
3578
|
+
class cI extends uA {
|
|
3579
3579
|
// this creates the geometry for a screen-space projected line
|
|
3580
3580
|
// each point on the input path is split into two vertices
|
|
3581
3581
|
// these are pushed in opposite directions in screen-space to create width
|
|
@@ -3609,7 +3609,7 @@ class NI extends uA {
|
|
|
3609
3609
|
createVertices(A) {
|
|
3610
3610
|
const I = new Float32Array(2 * A.length * 11);
|
|
3611
3611
|
let B = 0, C = 0;
|
|
3612
|
-
const Q = A.reduce((E, i, o) => E +
|
|
3612
|
+
const Q = A.reduce((E, i, o) => E + Zg(i, A[o + 1] ?? i), 0);
|
|
3613
3613
|
for (const E of [...Array(A.length).keys()]) {
|
|
3614
3614
|
for (const i of [-1, 1]) {
|
|
3615
3615
|
const o = A[E];
|
|
@@ -3619,7 +3619,7 @@ class NI extends uA {
|
|
|
3619
3619
|
const D = A[E + 1] ?? A[E];
|
|
3620
3620
|
I[B++] = D[0], I[B++] = D[1], I[B++] = D[2], I[B++] = i, I[B++] = C;
|
|
3621
3621
|
}
|
|
3622
|
-
C +=
|
|
3622
|
+
C += Zg(A[E], A[E + 1] ?? A[E]) / Q;
|
|
3623
3623
|
}
|
|
3624
3624
|
return I;
|
|
3625
3625
|
}
|
|
@@ -3631,7 +3631,7 @@ class NI extends uA {
|
|
|
3631
3631
|
return I;
|
|
3632
3632
|
}
|
|
3633
3633
|
}
|
|
3634
|
-
class
|
|
3634
|
+
class yg extends TA {
|
|
3635
3635
|
color_;
|
|
3636
3636
|
width_;
|
|
3637
3637
|
taperOffset_ = 0.5;
|
|
@@ -3687,19 +3687,19 @@ class Ro extends FA {
|
|
|
3687
3687
|
super();
|
|
3688
3688
|
const { length: I, width: B } = A;
|
|
3689
3689
|
this.addObject(
|
|
3690
|
-
|
|
3690
|
+
_I({
|
|
3691
3691
|
end: [I, 0, 0],
|
|
3692
3692
|
width: B,
|
|
3693
3693
|
color: [1, 0, 0]
|
|
3694
3694
|
})
|
|
3695
3695
|
), this.addObject(
|
|
3696
|
-
|
|
3696
|
+
_I({
|
|
3697
3697
|
end: [0, I, 0],
|
|
3698
3698
|
width: B,
|
|
3699
3699
|
color: [0, 1, 0]
|
|
3700
3700
|
})
|
|
3701
3701
|
), this.addObject(
|
|
3702
|
-
|
|
3702
|
+
_I({
|
|
3703
3703
|
end: [0, 0, I],
|
|
3704
3704
|
width: B,
|
|
3705
3705
|
color: [0, 0, 1]
|
|
@@ -3709,9 +3709,9 @@ class Ro extends FA {
|
|
|
3709
3709
|
update() {
|
|
3710
3710
|
}
|
|
3711
3711
|
}
|
|
3712
|
-
function
|
|
3713
|
-
const { end: A, width: I, color: B } = g, C = new
|
|
3714
|
-
return new
|
|
3712
|
+
function _I(g) {
|
|
3713
|
+
const { end: A, width: I, color: B } = g, C = new cI([[0, 0, 0], A]);
|
|
3714
|
+
return new yg({
|
|
3715
3715
|
geometry: C,
|
|
3716
3716
|
color: B,
|
|
3717
3717
|
width: I
|
|
@@ -3726,8 +3726,8 @@ class No extends FA {
|
|
|
3726
3726
|
addLine(A) {
|
|
3727
3727
|
const { path: I, color: B, width: C } = A;
|
|
3728
3728
|
this.paths_.push(I);
|
|
3729
|
-
const Q = new
|
|
3730
|
-
this.addObject(new
|
|
3729
|
+
const Q = new cI(I);
|
|
3730
|
+
this.addObject(new yg({ geometry: Q, color: B, width: C }));
|
|
3731
3731
|
}
|
|
3732
3732
|
update() {
|
|
3733
3733
|
}
|
|
@@ -3760,12 +3760,12 @@ class co extends FA {
|
|
|
3760
3760
|
pointsPerSegment: A.interpolation.pointsPerSegment,
|
|
3761
3761
|
tangentFactor: A.interpolation.tangentFactor
|
|
3762
3762
|
});
|
|
3763
|
-
I = new
|
|
3763
|
+
I = new cI(i);
|
|
3764
3764
|
} else
|
|
3765
|
-
I = new
|
|
3765
|
+
I = new cI(A.path);
|
|
3766
3766
|
const { color: B, width: C } = A, Q = 0.5, E = 1.5;
|
|
3767
3767
|
this.addObject(
|
|
3768
|
-
new
|
|
3768
|
+
new yg({ geometry: I, color: B, width: C, taperOffset: Q, taperPower: E })
|
|
3769
3769
|
);
|
|
3770
3770
|
}
|
|
3771
3771
|
setTimeIndex(A) {
|
|
@@ -3805,9 +3805,9 @@ function RQ({
|
|
|
3805
3805
|
const B = NQ(g), C = Array((g.length - 1) * A);
|
|
3806
3806
|
for (let Q = 0; Q < g.length - 1; Q++) {
|
|
3807
3807
|
const E = g[Q], i = g[Q + 1], o = BA(B[Q]);
|
|
3808
|
-
|
|
3808
|
+
bg(o, E, o, I);
|
|
3809
3809
|
const a = BA(B[Q + 1]);
|
|
3810
|
-
|
|
3810
|
+
bg(a, i, a, -I);
|
|
3811
3811
|
for (let D = 0; D < A; D++) {
|
|
3812
3812
|
const h = D / A, t = C[Q * A + D] = f();
|
|
3813
3813
|
HC(t, E, o, a, i, h);
|
|
@@ -3821,7 +3821,7 @@ function NQ(g) {
|
|
|
3821
3821
|
const A = Array(g.length), I = f(), B = f();
|
|
3822
3822
|
for (let C = 0; C < g.length; C++) {
|
|
3823
3823
|
const Q = g[C], E = g[C + 1] ?? g[C];
|
|
3824
|
-
A[C] = f(), C !== 0 && PA(I, B), C !== g.length - 1 &&
|
|
3824
|
+
A[C] = f(), C !== 0 && PA(I, B), C !== g.length - 1 && Ig(B, E, Q), C === 0 ? PA(A[C], B) : C == g.length - 1 ? PA(A[C], I) : (SI(A[C], I, B), RI(A[C], A[C], 0.5));
|
|
3825
3825
|
}
|
|
3826
3826
|
return A;
|
|
3827
3827
|
}
|
|
@@ -3830,16 +3830,16 @@ class MB extends uA {
|
|
|
3830
3830
|
super();
|
|
3831
3831
|
const Q = [], E = [], i = B, o = C, a = i + 1, D = o + 1, h = A / i, t = I / o;
|
|
3832
3832
|
for (let y = 0; y < D; ++y) {
|
|
3833
|
-
const
|
|
3834
|
-
for (let
|
|
3835
|
-
const r =
|
|
3833
|
+
const n = y * t;
|
|
3834
|
+
for (let w = 0; w < a; ++w) {
|
|
3835
|
+
const r = w * h, G = w / i, c = y / o, N = [r, n, 0], d = [0, 0, 1], L = [G, c];
|
|
3836
3836
|
Q.push(...N, ...d, ...L);
|
|
3837
3837
|
}
|
|
3838
3838
|
}
|
|
3839
3839
|
for (let y = 0; y < o; ++y)
|
|
3840
|
-
for (let
|
|
3841
|
-
const
|
|
3842
|
-
E.push(
|
|
3840
|
+
for (let n = 0; n < i; ++n) {
|
|
3841
|
+
const w = n + a * y, r = n + a * (y + 1), G = n + 1 + a * (y + 1), c = n + 1 + a * y;
|
|
3842
|
+
E.push(w, r, c), E.push(r, G, c);
|
|
3843
3843
|
}
|
|
3844
3844
|
this.vertexData_ = new Float32Array(Q), this.indexData_ = new Uint32Array(E), this.addAttribute({
|
|
3845
3845
|
type: "position",
|
|
@@ -3856,7 +3856,7 @@ class MB extends uA {
|
|
|
3856
3856
|
});
|
|
3857
3857
|
}
|
|
3858
3858
|
}
|
|
3859
|
-
function
|
|
3859
|
+
function $g(g) {
|
|
3860
3860
|
return g === 1 || g === 2 || g === 4 || g === 8;
|
|
3861
3861
|
}
|
|
3862
3862
|
function qA(g) {
|
|
@@ -3896,7 +3896,7 @@ function cQ(g) {
|
|
|
3896
3896
|
return [0, 1];
|
|
3897
3897
|
}
|
|
3898
3898
|
}
|
|
3899
|
-
class
|
|
3899
|
+
class eg extends sg {
|
|
3900
3900
|
dataFormat = "rgba";
|
|
3901
3901
|
dataType = "unsigned_byte";
|
|
3902
3902
|
maxFilter = "nearest";
|
|
@@ -3911,8 +3911,8 @@ class yg extends Dg {
|
|
|
3911
3911
|
return "Texture";
|
|
3912
3912
|
}
|
|
3913
3913
|
}
|
|
3914
|
-
const
|
|
3915
|
-
function
|
|
3914
|
+
const AB = 32;
|
|
3915
|
+
function jA(g, { visible: A, color: I, contrastLimits: B }) {
|
|
3916
3916
|
return A === void 0 && (A = !0), I === void 0 ? I = l.WHITE : I = l.from(I), g !== null ? B = UQ(B, g) : B === void 0 && (U.debug(
|
|
3917
3917
|
"Channel",
|
|
3918
3918
|
"No texture provided, defaulting channel contrast limits to [0, 1]."
|
|
@@ -3922,9 +3922,9 @@ function Bg(g, { visible: A, color: I, contrastLimits: B }) {
|
|
|
3922
3922
|
contrastLimits: B
|
|
3923
3923
|
};
|
|
3924
3924
|
}
|
|
3925
|
-
function
|
|
3926
|
-
if (A.length >
|
|
3927
|
-
throw new Error(`Maximum number of channels is ${
|
|
3925
|
+
function UI(g, A) {
|
|
3926
|
+
if (A.length > AB)
|
|
3927
|
+
throw new Error(`Maximum number of channels is ${AB}`);
|
|
3928
3928
|
if (g?.type === "Texture2DArray") {
|
|
3929
3929
|
const I = g.depth;
|
|
3930
3930
|
if (A.length !== I)
|
|
@@ -3932,7 +3932,7 @@ function AB(g, A) {
|
|
|
3932
3932
|
`Number of channels (${A.length}) must match depth of texture (${I}).`
|
|
3933
3933
|
);
|
|
3934
3934
|
}
|
|
3935
|
-
return A.map((I) =>
|
|
3935
|
+
return A.map((I) => jA(g, I));
|
|
3936
3936
|
}
|
|
3937
3937
|
function UQ(g, A) {
|
|
3938
3938
|
if (g === void 0)
|
|
@@ -3943,19 +3943,19 @@ function UQ(g, A) {
|
|
|
3943
3943
|
);
|
|
3944
3944
|
return g;
|
|
3945
3945
|
}
|
|
3946
|
-
class
|
|
3946
|
+
class Gg extends TA {
|
|
3947
3947
|
channels_;
|
|
3948
3948
|
constructor(A, I, B, C = []) {
|
|
3949
|
-
super(), this.geometry = new MB(A, I, 1, 1), this.setTexture(0, B), this.channels_ =
|
|
3949
|
+
super(), this.geometry = new MB(A, I, 1, 1), this.setTexture(0, B), this.channels_ = UI(B, C), this.programName = kQ(B);
|
|
3950
3950
|
}
|
|
3951
3951
|
get type() {
|
|
3952
3952
|
return "ImageRenderable";
|
|
3953
3953
|
}
|
|
3954
3954
|
setChannelProps(A) {
|
|
3955
|
-
this.channels_ =
|
|
3955
|
+
this.channels_ = UI(this.textures[0], A);
|
|
3956
3956
|
}
|
|
3957
3957
|
setChannelProperty(A, I, B) {
|
|
3958
|
-
const C =
|
|
3958
|
+
const C = jA(this.textures[0], {
|
|
3959
3959
|
...this.channels_[A],
|
|
3960
3960
|
[I]: B
|
|
3961
3961
|
});
|
|
@@ -3966,7 +3966,7 @@ class eg extends TA {
|
|
|
3966
3966
|
if (!A)
|
|
3967
3967
|
throw new Error("No texture set");
|
|
3968
3968
|
if (A.type === "Texture2D") {
|
|
3969
|
-
const { color: I, contrastLimits: B } = this.channels_[0] ??
|
|
3969
|
+
const { color: I, contrastLimits: B } = this.channels_[0] ?? jA(A, {});
|
|
3970
3970
|
return {
|
|
3971
3971
|
ImageSampler: 0,
|
|
3972
3972
|
Color: I.rgb,
|
|
@@ -4026,7 +4026,7 @@ function JQ(g) {
|
|
|
4026
4026
|
return "floatScalarImageArray";
|
|
4027
4027
|
}
|
|
4028
4028
|
}
|
|
4029
|
-
class
|
|
4029
|
+
class sI extends eg {
|
|
4030
4030
|
data_;
|
|
4031
4031
|
width_;
|
|
4032
4032
|
height_;
|
|
@@ -4070,11 +4070,11 @@ class DI extends yg {
|
|
|
4070
4070
|
throw new Error(
|
|
4071
4071
|
"Unable to create texture, chunk data is not initialized."
|
|
4072
4072
|
);
|
|
4073
|
-
const C = new
|
|
4073
|
+
const C = new sI(B, A.shape.x, A.shape.y);
|
|
4074
4074
|
return C.unpackAlignment = A.rowAlignmentBytes, C;
|
|
4075
4075
|
}
|
|
4076
4076
|
}
|
|
4077
|
-
function
|
|
4077
|
+
function ng(g, A, I, B, C = 3) {
|
|
4078
4078
|
switch (g.type) {
|
|
4079
4079
|
case "pointerdown": {
|
|
4080
4080
|
const Q = g.event;
|
|
@@ -4205,7 +4205,7 @@ class HB extends FA {
|
|
|
4205
4205
|
}
|
|
4206
4206
|
}
|
|
4207
4207
|
onEvent(A) {
|
|
4208
|
-
this.pointerDownPos_ =
|
|
4208
|
+
this.pointerDownPos_ = ng(
|
|
4209
4209
|
A,
|
|
4210
4210
|
this.pointerDownPos_,
|
|
4211
4211
|
(I) => this.getValueAtWorld(I),
|
|
@@ -4228,13 +4228,13 @@ class HB extends FA {
|
|
|
4228
4228
|
set imageSourcePolicy(A) {
|
|
4229
4229
|
this.policy_ !== A && (this.policy_ = A, this.chunkStoreView_ && this.chunkStoreView_.setImageSourcePolicy(
|
|
4230
4230
|
A,
|
|
4231
|
-
|
|
4231
|
+
tg
|
|
4232
4232
|
));
|
|
4233
4233
|
}
|
|
4234
4234
|
slicePlane(A, I) {
|
|
4235
4235
|
if (!A.data) return;
|
|
4236
4236
|
const B = (I - A.offset.z) / A.scale.z, C = Math.round(B), Q = XA(C, 0, A.shape.z - 1);
|
|
4237
|
-
|
|
4237
|
+
Bg(B, Q, 1 + 1e-6) || U.error("ImageLayer", "slicePlane zValue outside extent");
|
|
4238
4238
|
const E = A.shape.x * A.shape.y, i = E * Q;
|
|
4239
4239
|
return A.data.slice(i, i + E);
|
|
4240
4240
|
}
|
|
@@ -4245,10 +4245,10 @@ class HB extends FA {
|
|
|
4245
4245
|
return B ? (B.textures[0].updateWithChunk(A, this.getDataForImage(A)), this.updateImageChunk(B, A), this.channelProps_ && B.setChannelProps(this.channelProps_), B) : this.createImage(A);
|
|
4246
4246
|
}
|
|
4247
4247
|
createImage(A) {
|
|
4248
|
-
const I = new
|
|
4248
|
+
const I = new Gg(
|
|
4249
4249
|
A.shape.x,
|
|
4250
4250
|
A.shape.y,
|
|
4251
|
-
|
|
4251
|
+
sI.createWithChunk(A, this.getDataForImage(A)),
|
|
4252
4252
|
this.channelProps_ ?? [{}]
|
|
4253
4253
|
);
|
|
4254
4254
|
return this.updateImageChunk(I, A), I;
|
|
@@ -4280,7 +4280,7 @@ class HB extends FA {
|
|
|
4280
4280
|
}
|
|
4281
4281
|
getValueFromChunk(A, I, B) {
|
|
4282
4282
|
if (!A.data) return null;
|
|
4283
|
-
const C =
|
|
4283
|
+
const C = pI(
|
|
4284
4284
|
f(),
|
|
4285
4285
|
B,
|
|
4286
4286
|
I.transform.inverse
|
|
@@ -4354,11 +4354,11 @@ class YQ extends uA {
|
|
|
4354
4354
|
});
|
|
4355
4355
|
}
|
|
4356
4356
|
buildFace(A, I, B, C, Q, E, i, o, a, D, h, t, y) {
|
|
4357
|
-
const
|
|
4357
|
+
const n = E / a, w = i / D, r = E / 2, G = i / 2, c = o / 2 * h, N = a + 1, d = D + 1, L = t.length / 8;
|
|
4358
4358
|
for (let k = 0; k < d; k++) {
|
|
4359
|
-
const T = -G + k *
|
|
4359
|
+
const T = -G + k * w;
|
|
4360
4360
|
for (let P = 0; P < N; P++) {
|
|
4361
|
-
const O = -r + P *
|
|
4361
|
+
const O = -r + P * n, Z = { x: 0, y: 0, z: 0 };
|
|
4362
4362
|
Z[A] = O * C, Z[I] = T * Q, Z[B] = c;
|
|
4363
4363
|
const V = { x: 0, y: 0, z: 0 };
|
|
4364
4364
|
V[B] = h;
|
|
@@ -4384,17 +4384,32 @@ class YQ extends uA {
|
|
|
4384
4384
|
}
|
|
4385
4385
|
class dQ extends TA {
|
|
4386
4386
|
voxelScale = q(1, 1, 1);
|
|
4387
|
-
|
|
4388
|
-
|
|
4387
|
+
channels_;
|
|
4388
|
+
constructor(A, I = []) {
|
|
4389
|
+
super(), this.geometry = new YQ(1, 1, 1, 1, 1, 1), this.setTexture(0, A), this.programName = MQ(A.dataType), this.cullFaceMode = "front", this.depthTest = !1, this.channels_ = UI(A, I);
|
|
4389
4390
|
}
|
|
4390
4391
|
get type() {
|
|
4391
4392
|
return "VolumeRenderable";
|
|
4392
4393
|
}
|
|
4393
4394
|
getUniforms() {
|
|
4395
|
+
const A = this.channels_[0] ?? jA(this.textures[0], {}), { color: I, contrastLimits: B } = A;
|
|
4394
4396
|
return {
|
|
4395
|
-
VoxelScale: this.voxelScale
|
|
4397
|
+
VoxelScale: this.voxelScale,
|
|
4398
|
+
Color: I.rgb,
|
|
4399
|
+
ValueOffset: -B[0],
|
|
4400
|
+
ValueScale: 1 / (B[1] - B[0])
|
|
4396
4401
|
};
|
|
4397
4402
|
}
|
|
4403
|
+
setChannelProps(A) {
|
|
4404
|
+
this.channels_ = UI(this.textures[0], A);
|
|
4405
|
+
}
|
|
4406
|
+
setChannelProperty(A, I, B) {
|
|
4407
|
+
const C = jA(this.textures[0], {
|
|
4408
|
+
...this.channels_[A],
|
|
4409
|
+
[I]: B
|
|
4410
|
+
});
|
|
4411
|
+
this.channels_[A] = C;
|
|
4412
|
+
}
|
|
4398
4413
|
}
|
|
4399
4414
|
function MQ(g) {
|
|
4400
4415
|
switch (g) {
|
|
@@ -4410,7 +4425,7 @@ function MQ(g) {
|
|
|
4410
4425
|
return "floatVolume";
|
|
4411
4426
|
}
|
|
4412
4427
|
}
|
|
4413
|
-
class wg extends
|
|
4428
|
+
class wg extends eg {
|
|
4414
4429
|
data_;
|
|
4415
4430
|
width_;
|
|
4416
4431
|
height_;
|
|
@@ -4470,16 +4485,17 @@ class Uo extends FA {
|
|
|
4470
4485
|
sliceCoords_;
|
|
4471
4486
|
currentChunks_ = /* @__PURE__ */ new Map();
|
|
4472
4487
|
pool_ = new KB();
|
|
4488
|
+
initialChannelProps_;
|
|
4489
|
+
channelChangeCallbacks_ = [];
|
|
4473
4490
|
sourcePolicy_;
|
|
4474
4491
|
chunkStoreView_;
|
|
4492
|
+
channelProps_;
|
|
4475
4493
|
lastLoadedTime_ = void 0;
|
|
4476
4494
|
interactiveStepSizeScale_ = 1;
|
|
4477
4495
|
// TODO: Make a debug config object to manage debug options
|
|
4478
4496
|
debugShowWireframes_ = !1;
|
|
4479
4497
|
debugShowDegenerateRays = !1;
|
|
4480
|
-
color = q(1, 1, 1);
|
|
4481
4498
|
relativeStepSize = 1;
|
|
4482
|
-
maxIntensity = 255;
|
|
4483
4499
|
opacityMultiplier = 0.1;
|
|
4484
4500
|
earlyTerminationAlpha = 0.99;
|
|
4485
4501
|
get debugShowWireframes() {
|
|
@@ -4495,21 +4511,46 @@ class Uo extends FA {
|
|
|
4495
4511
|
set sourcePolicy(A) {
|
|
4496
4512
|
this.sourcePolicy_ !== A && (this.sourcePolicy_ = A, this.chunkStoreView_ && this.chunkStoreView_.setImageSourcePolicy(
|
|
4497
4513
|
A,
|
|
4498
|
-
|
|
4514
|
+
tg
|
|
4499
4515
|
));
|
|
4500
4516
|
}
|
|
4517
|
+
setChannelProps(A) {
|
|
4518
|
+
this.channelProps_ = A, this.currentChunks_.forEach((I) => {
|
|
4519
|
+
I.setChannelProps(A);
|
|
4520
|
+
}), this.channelChangeCallbacks_.forEach((I) => {
|
|
4521
|
+
I();
|
|
4522
|
+
});
|
|
4523
|
+
}
|
|
4524
|
+
get channelProps() {
|
|
4525
|
+
return this.channelProps_;
|
|
4526
|
+
}
|
|
4527
|
+
resetChannelProps() {
|
|
4528
|
+
this.initialChannelProps_ !== void 0 && this.setChannelProps(this.initialChannelProps_);
|
|
4529
|
+
}
|
|
4530
|
+
addChannelChangeCallback(A) {
|
|
4531
|
+
this.channelChangeCallbacks_.push(A);
|
|
4532
|
+
}
|
|
4533
|
+
removeChannelChangeCallback(A) {
|
|
4534
|
+
const I = this.channelChangeCallbacks_.indexOf(A);
|
|
4535
|
+
if (I === void 0)
|
|
4536
|
+
throw new Error(`Callback to remove could not be found: ${A}`);
|
|
4537
|
+
this.channelChangeCallbacks_.splice(I, 1);
|
|
4538
|
+
}
|
|
4501
4539
|
createVolume(A) {
|
|
4502
|
-
const I = new dQ(
|
|
4540
|
+
const I = new dQ(
|
|
4541
|
+
wg.createWithChunk(A),
|
|
4542
|
+
this.channelProps_
|
|
4543
|
+
);
|
|
4503
4544
|
return this.updateVolumeChunk(I, A), I;
|
|
4504
4545
|
}
|
|
4505
|
-
constructor({ source: A, sliceCoords: I, policy: B }) {
|
|
4506
|
-
super({ transparent: !0, blendMode: "premultiplied" }), this.source_ = A, this.sliceCoords_ = I, this.sourcePolicy_ = B, this.setState("initialized");
|
|
4546
|
+
constructor({ source: A, sliceCoords: I, policy: B, channelProps: C }) {
|
|
4547
|
+
super({ transparent: !0, blendMode: "premultiplied" }), this.source_ = A, this.sliceCoords_ = I, this.sourcePolicy_ = B, this.initialChannelProps_ = C, this.channelProps_ = C, this.setState("initialized");
|
|
4507
4548
|
}
|
|
4508
4549
|
getVolumeForChunk(A) {
|
|
4509
4550
|
const I = this.currentChunks_.get(A);
|
|
4510
4551
|
if (I) return I;
|
|
4511
4552
|
const B = this.pool_.acquire(gB(A));
|
|
4512
|
-
return B ? (B.textures[0].updateWithChunk(A), this.updateVolumeChunk(B, A), B) : this.createVolume(A);
|
|
4553
|
+
return B ? (B.textures[0].updateWithChunk(A), this.updateVolumeChunk(B, A), this.channelProps_ && B.setChannelProps(this.channelProps_), B) : this.createVolume(A);
|
|
4513
4554
|
}
|
|
4514
4555
|
async onAttached(A) {
|
|
4515
4556
|
this.chunkStoreView_ = await A.chunkManager.addView(
|
|
@@ -4576,8 +4617,8 @@ class Uo extends FA {
|
|
|
4576
4617
|
reorderObjects(A) {
|
|
4577
4618
|
const I = A.position, B = f(), C = f();
|
|
4578
4619
|
this.objects.sort((Q, E) => {
|
|
4579
|
-
|
|
4580
|
-
const i =
|
|
4620
|
+
SI(B, Q.boundingBox.max, Q.boundingBox.min), RI(B, B, 0.5), SI(C, E.boundingBox.max, E.boundingBox.min), RI(C, C, 0.5);
|
|
4621
|
+
const i = Pg(I, B), a = Pg(I, C) - i;
|
|
4581
4622
|
return Math.abs(a) < p ? 0 : a;
|
|
4582
4623
|
});
|
|
4583
4624
|
}
|
|
@@ -4585,9 +4626,7 @@ class Uo extends FA {
|
|
|
4585
4626
|
return {
|
|
4586
4627
|
DebugShowDegenerateRays: Number(this.debugShowDegenerateRays),
|
|
4587
4628
|
RelativeStepSize: this.relativeStepSize * this.interactiveStepSizeScale_,
|
|
4588
|
-
MaxIntensity: this.maxIntensity,
|
|
4589
4629
|
OpacityMultiplier: this.opacityMultiplier,
|
|
4590
|
-
VolumeColor: this.color,
|
|
4591
4630
|
EarlyTerminationAlpha: this.earlyTerminationAlpha
|
|
4592
4631
|
};
|
|
4593
4632
|
}
|
|
@@ -4637,7 +4676,7 @@ class ko extends FA {
|
|
|
4637
4676
|
}
|
|
4638
4677
|
}
|
|
4639
4678
|
onEvent(A) {
|
|
4640
|
-
this.pointerDownPos_ =
|
|
4679
|
+
this.pointerDownPos_ = ng(
|
|
4641
4680
|
A,
|
|
4642
4681
|
this.pointerDownPos_,
|
|
4643
4682
|
(I) => this.getValueAtWorld(I),
|
|
@@ -4680,17 +4719,17 @@ class ko extends FA {
|
|
|
4680
4719
|
return this.extent_;
|
|
4681
4720
|
}
|
|
4682
4721
|
createImage(A) {
|
|
4683
|
-
const I = new
|
|
4722
|
+
const I = new Gg(
|
|
4684
4723
|
A.shape.x,
|
|
4685
4724
|
A.shape.y,
|
|
4686
|
-
|
|
4725
|
+
sI.createWithChunk(A),
|
|
4687
4726
|
this.channelProps
|
|
4688
4727
|
);
|
|
4689
4728
|
return I.transform.setScale([A.scale.x, A.scale.y, 1]), I.transform.setTranslation([A.offset.x, A.offset.y, 0]), I;
|
|
4690
4729
|
}
|
|
4691
4730
|
getValueAtWorld(A) {
|
|
4692
4731
|
if (!this.image_ || !this.chunk_?.data) return null;
|
|
4693
|
-
const I =
|
|
4732
|
+
const I = pI(
|
|
4694
4733
|
f(),
|
|
4695
4734
|
A,
|
|
4696
4735
|
this.image_.transform.inverse
|
|
@@ -4702,7 +4741,7 @@ class ko extends FA {
|
|
|
4702
4741
|
return null;
|
|
4703
4742
|
}
|
|
4704
4743
|
}
|
|
4705
|
-
class
|
|
4744
|
+
class zA extends eg {
|
|
4706
4745
|
data_;
|
|
4707
4746
|
width_;
|
|
4708
4747
|
height_;
|
|
@@ -4742,7 +4781,7 @@ class jA extends yg {
|
|
|
4742
4781
|
throw new Error(
|
|
4743
4782
|
"Unable to create texture, chunk data is not initialized."
|
|
4744
4783
|
);
|
|
4745
|
-
const C = new
|
|
4784
|
+
const C = new zA(B, A.shape.x, A.shape.y);
|
|
4746
4785
|
return C.unpackAlignment = A.rowAlignmentBytes, C;
|
|
4747
4786
|
}
|
|
4748
4787
|
}
|
|
@@ -4821,13 +4860,13 @@ class mQ extends TA {
|
|
|
4821
4860
|
makeColorCycleTexture(A) {
|
|
4822
4861
|
const I = new Uint8Array(
|
|
4823
4862
|
A.flatMap((C) => C.rgba).map((C) => Math.round(C * 255))
|
|
4824
|
-
), B = new
|
|
4863
|
+
), B = new zA(I, A.length, 1);
|
|
4825
4864
|
return B.dataFormat = "rgba", B;
|
|
4826
4865
|
}
|
|
4827
4866
|
makeColorLookupTableTexture(A) {
|
|
4828
4867
|
A === void 0 ? A = /* @__PURE__ */ new Map([[0, l.TRANSPARENT]]) : A.has(0) || (A = new Map([[0, l.TRANSPARENT], ...A]));
|
|
4829
4868
|
const I = Array.from(A.keys()), B = Array.from(A.values()).map((E) => E.packed), C = A.size, Q = new Uint32Array(C * 2);
|
|
4830
|
-
return Q.set(I, 0), Q.set(B, C), new
|
|
4869
|
+
return Q.set(I, 0), Q.set(B, C), new zA(Q, C, 2);
|
|
4831
4870
|
}
|
|
4832
4871
|
}
|
|
4833
4872
|
class Lo extends FA {
|
|
@@ -4877,7 +4916,7 @@ class Lo extends FA {
|
|
|
4877
4916
|
this.selectedValue_ = A, this.image_ && this.image_.setSelectedValue(this.selectedValue_);
|
|
4878
4917
|
}
|
|
4879
4918
|
onEvent(A) {
|
|
4880
|
-
this.pointerDownPos_ =
|
|
4919
|
+
this.pointerDownPos_ = ng(
|
|
4881
4920
|
A,
|
|
4882
4921
|
this.pointerDownPos_,
|
|
4883
4922
|
(I) => this.getValueAtWorld(I),
|
|
@@ -4898,7 +4937,7 @@ class Lo extends FA {
|
|
|
4898
4937
|
const I = new mQ({
|
|
4899
4938
|
width: A.shape.x,
|
|
4900
4939
|
height: A.shape.y,
|
|
4901
|
-
imageData:
|
|
4940
|
+
imageData: zA.createWithChunk(A),
|
|
4902
4941
|
colorMap: this.colorMap_,
|
|
4903
4942
|
outlineSelected: this.outlineSelected_,
|
|
4904
4943
|
selectedValue: this.selectedValue_
|
|
@@ -4908,7 +4947,7 @@ class Lo extends FA {
|
|
|
4908
4947
|
getValueAtWorld(A) {
|
|
4909
4948
|
if (!this.image_ || !this.imageChunk_?.data)
|
|
4910
4949
|
return null;
|
|
4911
|
-
const I =
|
|
4950
|
+
const I = pI(
|
|
4912
4951
|
f(),
|
|
4913
4952
|
A,
|
|
4914
4953
|
this.image_.transform.inverse
|
|
@@ -4919,9 +4958,9 @@ class Lo extends FA {
|
|
|
4919
4958
|
return this.imageChunk_.data[Q];
|
|
4920
4959
|
}
|
|
4921
4960
|
}
|
|
4922
|
-
class
|
|
4961
|
+
class mI extends Error {
|
|
4923
4962
|
constructor(A) {
|
|
4924
|
-
super(A), this.name = "AbortError", Object.setPrototypeOf(this,
|
|
4963
|
+
super(A), this.name = "AbortError", Object.setPrototypeOf(this, mI.prototype);
|
|
4925
4964
|
}
|
|
4926
4965
|
}
|
|
4927
4966
|
class uQ {
|
|
@@ -4959,7 +4998,7 @@ class uQ {
|
|
|
4959
4998
|
return this.abortController_.signal;
|
|
4960
4999
|
}
|
|
4961
5000
|
shutdown() {
|
|
4962
|
-
this.abortController_.abort(new
|
|
5001
|
+
this.abortController_.abort(new mI("shutdown"));
|
|
4963
5002
|
}
|
|
4964
5003
|
get numRunning() {
|
|
4965
5004
|
return this.numRunning_;
|
|
@@ -5074,7 +5113,7 @@ class TQ {
|
|
|
5074
5113
|
const B = await Promise.allSettled(I);
|
|
5075
5114
|
for (const C of B)
|
|
5076
5115
|
if (C.status === "rejected") {
|
|
5077
|
-
if (C.reason instanceof
|
|
5116
|
+
if (C.reason instanceof mI)
|
|
5078
5117
|
return Promise.reject(C.reason);
|
|
5079
5118
|
U.error(
|
|
5080
5119
|
"ImageSeriesLoader",
|
|
@@ -5154,13 +5193,13 @@ class Jo extends FA {
|
|
|
5154
5193
|
return A.chunk && (this.setData(A.chunk), this.setState("ready")), A;
|
|
5155
5194
|
}
|
|
5156
5195
|
setData(A) {
|
|
5157
|
-
!this.texture_ || !this.image_ ? (this.texture_ =
|
|
5196
|
+
!this.texture_ || !this.image_ ? (this.texture_ = sI.createWithChunk(A), this.image_ = this.createImage(A, this.texture_, this.channelProps_), this.addObject(this.image_), this.extent_ = {
|
|
5158
5197
|
x: A.shape.x * A.scale.x,
|
|
5159
5198
|
y: A.shape.y * A.scale.y
|
|
5160
5199
|
}) : A.data && this.texture_.updateWithChunk(A);
|
|
5161
5200
|
}
|
|
5162
5201
|
createImage(A, I, B) {
|
|
5163
|
-
const C = new
|
|
5202
|
+
const C = new Gg(
|
|
5164
5203
|
A.shape.x,
|
|
5165
5204
|
A.shape.y,
|
|
5166
5205
|
I,
|
|
@@ -5267,7 +5306,7 @@ class lB {
|
|
|
5267
5306
|
yield this.get(A);
|
|
5268
5307
|
}
|
|
5269
5308
|
}
|
|
5270
|
-
class
|
|
5309
|
+
class Fg {
|
|
5271
5310
|
_data;
|
|
5272
5311
|
chars;
|
|
5273
5312
|
#A;
|
|
@@ -5316,7 +5355,7 @@ class ng {
|
|
|
5316
5355
|
yield this.get(A);
|
|
5317
5356
|
}
|
|
5318
5357
|
}
|
|
5319
|
-
class
|
|
5358
|
+
class hI {
|
|
5320
5359
|
#A;
|
|
5321
5360
|
chars;
|
|
5322
5361
|
constructor(A, I, B, C) {
|
|
@@ -5325,7 +5364,7 @@ class sI {
|
|
|
5325
5364
|
else if (I instanceof ArrayBuffer)
|
|
5326
5365
|
C && (C *= A), this.#A = new Int32Array(I, B, C);
|
|
5327
5366
|
else {
|
|
5328
|
-
const Q = I, E = new
|
|
5367
|
+
const Q = I, E = new hI(A, 1);
|
|
5329
5368
|
this.#A = new Int32Array(function* () {
|
|
5330
5369
|
for (let i of Q)
|
|
5331
5370
|
E.set(0, i), yield* E.#A;
|
|
@@ -5371,7 +5410,7 @@ class sI {
|
|
|
5371
5410
|
yield this.get(A);
|
|
5372
5411
|
}
|
|
5373
5412
|
}
|
|
5374
|
-
function
|
|
5413
|
+
function tI(g) {
|
|
5375
5414
|
const A = new TextDecoder().decode(g);
|
|
5376
5415
|
return JSON.parse(A);
|
|
5377
5416
|
}
|
|
@@ -5388,7 +5427,7 @@ function fB(g) {
|
|
|
5388
5427
|
let A = g.match(/v2:([US])(\d+)/);
|
|
5389
5428
|
if (A) {
|
|
5390
5429
|
let [, B, C] = A;
|
|
5391
|
-
return (B === "U" ?
|
|
5430
|
+
return (B === "U" ? hI : Fg).bind(null, Number(C));
|
|
5392
5431
|
}
|
|
5393
5432
|
let I = {
|
|
5394
5433
|
int8: Int8Array,
|
|
@@ -5522,13 +5561,13 @@ async function uB(g, { format: A, signal: I }) {
|
|
|
5522
5561
|
throw I?.throwIfAborted(), new Error(`Failed to decode ${A}`);
|
|
5523
5562
|
}
|
|
5524
5563
|
}
|
|
5525
|
-
class
|
|
5564
|
+
class rg {
|
|
5526
5565
|
kind = "array_to_array";
|
|
5527
5566
|
constructor(A, I) {
|
|
5528
5567
|
W(A.keepbits >= 0, "keepbits must be zero or positive");
|
|
5529
5568
|
}
|
|
5530
5569
|
static fromConfig(A, I) {
|
|
5531
|
-
return new
|
|
5570
|
+
return new rg(A, I);
|
|
5532
5571
|
}
|
|
5533
5572
|
/**
|
|
5534
5573
|
* Encode a chunk of data with bit-rounding.
|
|
@@ -5554,7 +5593,7 @@ function XQ() {
|
|
|
5554
5593
|
function oB(g) {
|
|
5555
5594
|
return "BYTES_PER_ELEMENT" in g ? g.BYTES_PER_ELEMENT : 4;
|
|
5556
5595
|
}
|
|
5557
|
-
class
|
|
5596
|
+
class uI {
|
|
5558
5597
|
kind = "array_to_bytes";
|
|
5559
5598
|
#A;
|
|
5560
5599
|
#I;
|
|
@@ -5567,7 +5606,7 @@ class pI {
|
|
|
5567
5606
|
this.#g = B.BYTES_PER_ELEMENT;
|
|
5568
5607
|
}
|
|
5569
5608
|
static fromConfig(A, I) {
|
|
5570
|
-
return new
|
|
5609
|
+
return new uI(A, I);
|
|
5571
5610
|
}
|
|
5572
5611
|
encode(A) {
|
|
5573
5612
|
let I = new Uint8Array(A.data.buffer);
|
|
@@ -5581,10 +5620,10 @@ class pI {
|
|
|
5581
5620
|
};
|
|
5582
5621
|
}
|
|
5583
5622
|
}
|
|
5584
|
-
class
|
|
5623
|
+
class Sg {
|
|
5585
5624
|
kind = "bytes_to_bytes";
|
|
5586
5625
|
static fromConfig() {
|
|
5587
|
-
return new
|
|
5626
|
+
return new Sg();
|
|
5588
5627
|
}
|
|
5589
5628
|
encode(A) {
|
|
5590
5629
|
throw new Error("Not implemented");
|
|
@@ -5593,10 +5632,10 @@ class rg {
|
|
|
5593
5632
|
return new Uint8Array(A.buffer, A.byteOffset, A.byteLength - 4);
|
|
5594
5633
|
}
|
|
5595
5634
|
}
|
|
5596
|
-
class
|
|
5635
|
+
class Rg {
|
|
5597
5636
|
kind = "bytes_to_bytes";
|
|
5598
5637
|
static fromConfig(A) {
|
|
5599
|
-
return new
|
|
5638
|
+
return new Rg();
|
|
5600
5639
|
}
|
|
5601
5640
|
encode(A) {
|
|
5602
5641
|
throw new Error("Gzip encoding is not enabled by default. Please register a custom codec with `numcodecs/gzip`.");
|
|
@@ -5612,7 +5651,7 @@ function jQ(g, A) {
|
|
|
5612
5651
|
function zQ(g, A) {
|
|
5613
5652
|
return A instanceof Object && !Array.isArray(A) ? Object.keys(A).sort().reduce((I, B) => (I[B] = A[B], I), {}) : A;
|
|
5614
5653
|
}
|
|
5615
|
-
class
|
|
5654
|
+
class Ng {
|
|
5616
5655
|
configuration;
|
|
5617
5656
|
kind = "array_to_bytes";
|
|
5618
5657
|
#A;
|
|
@@ -5633,7 +5672,7 @@ class Rg {
|
|
|
5633
5672
|
}, this.#I = { strict: a };
|
|
5634
5673
|
}
|
|
5635
5674
|
static fromConfig(A) {
|
|
5636
|
-
return new
|
|
5675
|
+
return new Ng(A);
|
|
5637
5676
|
}
|
|
5638
5677
|
encode(A) {
|
|
5639
5678
|
const { indent: I, encoding: B, ensure_ascii: C, check_circular: Q, allow_nan: E, sort_keys: i } = this.#A;
|
|
@@ -5644,10 +5683,10 @@ class Rg {
|
|
|
5644
5683
|
a.push("|O"), a.push(A.shape);
|
|
5645
5684
|
let D;
|
|
5646
5685
|
o.length && (D = (t, y) => {
|
|
5647
|
-
let
|
|
5648
|
-
for (let
|
|
5649
|
-
|
|
5650
|
-
return
|
|
5686
|
+
let n = y;
|
|
5687
|
+
for (let w of o)
|
|
5688
|
+
n = w(t, n);
|
|
5689
|
+
return n;
|
|
5651
5690
|
});
|
|
5652
5691
|
let h = JSON.stringify(a, D, I);
|
|
5653
5692
|
return C && (h = h.replace(/[\u007F-\uFFFF]/g, (t) => {
|
|
@@ -5658,14 +5697,14 @@ class Rg {
|
|
|
5658
5697
|
decode(A) {
|
|
5659
5698
|
const { strict: I } = this.#I;
|
|
5660
5699
|
W(I, "JsonCodec does not yet support non-strict decoding.");
|
|
5661
|
-
const B =
|
|
5700
|
+
const B = tI(A), C = B.pop();
|
|
5662
5701
|
B.pop(), W(C, "0D not implemented for JsonCodec.");
|
|
5663
5702
|
const Q = cA(C, "C");
|
|
5664
5703
|
return { data: B, shape: C, stride: Q };
|
|
5665
5704
|
}
|
|
5666
5705
|
}
|
|
5667
5706
|
function aB(g) {
|
|
5668
|
-
return g instanceof lB || g instanceof
|
|
5707
|
+
return g instanceof lB || g instanceof Fg || g instanceof hI ? new Proxy(g, {
|
|
5669
5708
|
get(I, B) {
|
|
5670
5709
|
return I.get(Number(B));
|
|
5671
5710
|
},
|
|
@@ -5676,7 +5715,7 @@ function aB(g) {
|
|
|
5676
5715
|
}
|
|
5677
5716
|
function _Q(g, A) {
|
|
5678
5717
|
let I;
|
|
5679
|
-
return g.data instanceof
|
|
5718
|
+
return g.data instanceof Fg || g.data instanceof hI ? I = new g.constructor(
|
|
5680
5719
|
// @ts-expect-error
|
|
5681
5720
|
g.data.length,
|
|
5682
5721
|
g.data.chars
|
|
@@ -5710,7 +5749,7 @@ function IE(g, A) {
|
|
|
5710
5749
|
let I = AE(g);
|
|
5711
5750
|
return W(I.length === A.length, "Orders must match"), I.every((B, C) => B === A[C]);
|
|
5712
5751
|
}
|
|
5713
|
-
class
|
|
5752
|
+
class cg {
|
|
5714
5753
|
kind = "array_to_array";
|
|
5715
5754
|
#A;
|
|
5716
5755
|
#I;
|
|
@@ -5729,7 +5768,7 @@ class Ng {
|
|
|
5729
5768
|
this.#A = Q, this.#I = E;
|
|
5730
5769
|
}
|
|
5731
5770
|
static fromConfig(A, I) {
|
|
5732
|
-
return new
|
|
5771
|
+
return new cg(A, I);
|
|
5733
5772
|
}
|
|
5734
5773
|
encode(A) {
|
|
5735
5774
|
return IE(A, this.#I) ? A : $Q(A, this.#I);
|
|
@@ -5742,7 +5781,7 @@ class Ng {
|
|
|
5742
5781
|
};
|
|
5743
5782
|
}
|
|
5744
5783
|
}
|
|
5745
|
-
class
|
|
5784
|
+
class Ug {
|
|
5746
5785
|
kind = "array_to_bytes";
|
|
5747
5786
|
#A;
|
|
5748
5787
|
#I;
|
|
@@ -5750,7 +5789,7 @@ class cg {
|
|
|
5750
5789
|
this.#A = A, this.#I = cA(A, "C");
|
|
5751
5790
|
}
|
|
5752
5791
|
static fromConfig(A, I) {
|
|
5753
|
-
return new
|
|
5792
|
+
return new Ug(I.shape);
|
|
5754
5793
|
}
|
|
5755
5794
|
encode(A) {
|
|
5756
5795
|
throw new Error("Method not implemented.");
|
|
@@ -5764,10 +5803,10 @@ class cg {
|
|
|
5764
5803
|
return { data: C, shape: this.#A, stride: this.#I };
|
|
5765
5804
|
}
|
|
5766
5805
|
}
|
|
5767
|
-
class
|
|
5806
|
+
class kg {
|
|
5768
5807
|
kind = "bytes_to_bytes";
|
|
5769
5808
|
static fromConfig(A) {
|
|
5770
|
-
return new
|
|
5809
|
+
return new kg();
|
|
5771
5810
|
}
|
|
5772
5811
|
encode(A) {
|
|
5773
5812
|
throw new Error("Zlib encoding is not enabled by default. Please register a codec with `numcodecs/zlib`.");
|
|
@@ -5778,10 +5817,10 @@ class Ug {
|
|
|
5778
5817
|
}
|
|
5779
5818
|
}
|
|
5780
5819
|
function gE() {
|
|
5781
|
-
return (/* @__PURE__ */ new Map()).set("blosc", () => import("./blosc-BOWv2fO7.js").then((g) => g.default)).set("lz4", () => import("./lz4-DUlZKApi.js").then((g) => g.default)).set("zstd", () => import("./zstd-DnzmycJs.js").then((g) => g.default)).set("gzip", () =>
|
|
5820
|
+
return (/* @__PURE__ */ new Map()).set("blosc", () => import("./blosc-BOWv2fO7.js").then((g) => g.default)).set("lz4", () => import("./lz4-DUlZKApi.js").then((g) => g.default)).set("zstd", () => import("./zstd-DnzmycJs.js").then((g) => g.default)).set("gzip", () => Rg).set("zlib", () => kg).set("transpose", () => cg).set("bytes", () => uI).set("crc32c", () => Sg).set("vlen-utf8", () => Ug).set("json2", () => Ng).set("bitround", () => rg);
|
|
5782
5821
|
}
|
|
5783
5822
|
const BE = gE();
|
|
5784
|
-
function
|
|
5823
|
+
function Qg(g) {
|
|
5785
5824
|
let A;
|
|
5786
5825
|
return {
|
|
5787
5826
|
async encode(I) {
|
|
@@ -5822,17 +5861,17 @@ async function DB(g) {
|
|
|
5822
5861
|
C.push(i);
|
|
5823
5862
|
}
|
|
5824
5863
|
}
|
|
5825
|
-
return B || (W(CE(g), `Cannot encode ${g.data_type} to bytes without a codec`), B =
|
|
5864
|
+
return B || (W(CE(g), `Cannot encode ${g.data_type} to bytes without a codec`), B = uI.fromConfig({ endian: "little" }, g)), { array_to_array: I, array_to_bytes: B, bytes_to_bytes: C };
|
|
5826
5865
|
}
|
|
5827
5866
|
function CE(g) {
|
|
5828
5867
|
return g.data_type !== "v2:object";
|
|
5829
5868
|
}
|
|
5830
|
-
class
|
|
5869
|
+
class yI extends Error {
|
|
5831
5870
|
constructor(A, I = {}) {
|
|
5832
5871
|
super(`Node not found: ${A}`, I), this.name = "NodeNotFoundError";
|
|
5833
5872
|
}
|
|
5834
5873
|
}
|
|
5835
|
-
class
|
|
5874
|
+
class Lg extends Error {
|
|
5836
5875
|
constructor(A) {
|
|
5837
5876
|
super(`Missing key: ${A}`), this.name = "KeyError";
|
|
5838
5877
|
}
|
|
@@ -5840,7 +5879,7 @@ class kg extends Error {
|
|
|
5840
5879
|
const sB = 18446744073709551615n;
|
|
5841
5880
|
function QE(g, A, I, B) {
|
|
5842
5881
|
W(g.store.getRange, "Store does not support range requests");
|
|
5843
|
-
let C = g.store.getRange.bind(g.store), Q = A.map((o, a) => o / B.chunk_shape[a]), E =
|
|
5882
|
+
let C = g.store.getRange.bind(g.store), Q = A.map((o, a) => o / B.chunk_shape[a]), E = Qg({
|
|
5844
5883
|
data_type: "uint64",
|
|
5845
5884
|
shape: [...Q, 2],
|
|
5846
5885
|
codecs: B.index_codecs
|
|
@@ -5857,7 +5896,7 @@ function QE(g, A, I, B) {
|
|
|
5857
5896
|
}
|
|
5858
5897
|
if (h === null)
|
|
5859
5898
|
return;
|
|
5860
|
-
let { data: t, shape: y, stride:
|
|
5899
|
+
let { data: t, shape: y, stride: n } = h, w = o.map((c, N) => c % y[N]).reduce((c, N, d) => c + N * n[d], 0), r = t[w], G = t[w + 1];
|
|
5861
5900
|
if (!(r === sB && G === sB))
|
|
5862
5901
|
return C(D, {
|
|
5863
5902
|
offset: Number(r),
|
|
@@ -5876,7 +5915,7 @@ class z {
|
|
|
5876
5915
|
return new z(this.store, decodeURIComponent(new URL(A, I).pathname));
|
|
5877
5916
|
}
|
|
5878
5917
|
}
|
|
5879
|
-
class
|
|
5918
|
+
class Jg extends z {
|
|
5880
5919
|
kind = "group";
|
|
5881
5920
|
#A;
|
|
5882
5921
|
constructor(A, I, B) {
|
|
@@ -5905,7 +5944,7 @@ function iE(g, A) {
|
|
|
5905
5944
|
...B,
|
|
5906
5945
|
kind: "sharded",
|
|
5907
5946
|
chunk_shape: I.chunk_shape,
|
|
5908
|
-
codec:
|
|
5947
|
+
codec: Qg({
|
|
5909
5948
|
data_type: A.data_type,
|
|
5910
5949
|
shape: I.chunk_shape,
|
|
5911
5950
|
codecs: I.codecs
|
|
@@ -5921,7 +5960,7 @@ function iE(g, A) {
|
|
|
5921
5960
|
...B,
|
|
5922
5961
|
kind: "regular",
|
|
5923
5962
|
chunk_shape: A.chunk_grid.configuration.chunk_shape,
|
|
5924
|
-
codec:
|
|
5963
|
+
codec: Qg({
|
|
5925
5964
|
data_type: A.data_type,
|
|
5926
5965
|
shape: A.chunk_grid.configuration.chunk_shape,
|
|
5927
5966
|
codecs: A.codecs
|
|
@@ -5935,7 +5974,7 @@ function iE(g, A) {
|
|
|
5935
5974
|
}
|
|
5936
5975
|
};
|
|
5937
5976
|
}
|
|
5938
|
-
let
|
|
5977
|
+
let kI = class extends z {
|
|
5939
5978
|
kind = "array";
|
|
5940
5979
|
#A;
|
|
5941
5980
|
[xA];
|
|
@@ -6017,7 +6056,7 @@ function DE({ start: g, stop: A, step: I }, B) {
|
|
|
6017
6056
|
const C = I < 0, [Q, E] = C ? [-1, B - 1] : [0, B];
|
|
6018
6057
|
return g === null ? g = C ? E : Q : g < 0 ? (g += B, g < Q && (g = Q)) : g > E && (g = E), A === null ? A = C ? Q : E : A < 0 ? (A += B, A < Q && (A = Q)) : A > E && (A = E), [g, A, I];
|
|
6019
6058
|
}
|
|
6020
|
-
function
|
|
6059
|
+
function LI(g, A, I = null) {
|
|
6021
6060
|
return A === void 0 && (A = g, g = null), {
|
|
6022
6061
|
start: g,
|
|
6023
6062
|
stop: A,
|
|
@@ -6031,19 +6070,19 @@ function sE() {
|
|
|
6031
6070
|
onIdle: () => Promise.all(g)
|
|
6032
6071
|
};
|
|
6033
6072
|
}
|
|
6034
|
-
class
|
|
6073
|
+
class Yg extends Error {
|
|
6035
6074
|
constructor(A) {
|
|
6036
6075
|
super(A), this.name = "IndexError";
|
|
6037
6076
|
}
|
|
6038
6077
|
}
|
|
6039
6078
|
function hE(g, A) {
|
|
6040
|
-
throw new
|
|
6079
|
+
throw new Yg(`too many indicies for array; expected ${A.length}, got ${g.length}`);
|
|
6041
6080
|
}
|
|
6042
6081
|
function tE(g) {
|
|
6043
|
-
throw new
|
|
6082
|
+
throw new Yg(`index out of bounds for dimension with length ${g}`);
|
|
6044
6083
|
}
|
|
6045
6084
|
function yE() {
|
|
6046
|
-
throw new
|
|
6085
|
+
throw new Yg("only slices with step >= 1 are supported");
|
|
6047
6086
|
}
|
|
6048
6087
|
function eE(g, A) {
|
|
6049
6088
|
g.length > A.length && hE(g, A);
|
|
@@ -6051,7 +6090,7 @@ function eE(g, A) {
|
|
|
6051
6090
|
function GE(g, A) {
|
|
6052
6091
|
return g = Math.trunc(g), g < 0 && (g = A + g), (g >= A || g < 0) && tE(A), g;
|
|
6053
6092
|
}
|
|
6054
|
-
class
|
|
6093
|
+
class nE {
|
|
6055
6094
|
dim_sel;
|
|
6056
6095
|
dim_len;
|
|
6057
6096
|
dim_chunk_len;
|
|
@@ -6099,15 +6138,15 @@ class tB {
|
|
|
6099
6138
|
}
|
|
6100
6139
|
}
|
|
6101
6140
|
}
|
|
6102
|
-
function
|
|
6141
|
+
function wE(g, A) {
|
|
6103
6142
|
let I = [];
|
|
6104
|
-
return g === null ? I = A.map((B) =>
|
|
6143
|
+
return g === null ? I = A.map((B) => LI(null)) : Array.isArray(g) && (I = g.map((B) => B ?? LI(null))), eE(I, A), I;
|
|
6105
6144
|
}
|
|
6106
6145
|
class FE {
|
|
6107
6146
|
dim_indexers;
|
|
6108
6147
|
shape;
|
|
6109
6148
|
constructor({ selection: A, shape: I, chunk_shape: B }) {
|
|
6110
|
-
this.dim_indexers =
|
|
6149
|
+
this.dim_indexers = wE(A, I).map((C, Q) => new (typeof C == "number" ? nE : tB)({
|
|
6111
6150
|
// @ts-expect-error ts inference not strong enough to know correct chunk
|
|
6112
6151
|
dim_sel: C,
|
|
6113
6152
|
dim_len: I[Q],
|
|
@@ -6137,12 +6176,12 @@ async function SE(g, A, I, B) {
|
|
|
6137
6176
|
});
|
|
6138
6177
|
return await i.onIdle(), Q.shape.length === 0 ? rE(E.data, 0) : E;
|
|
6139
6178
|
}
|
|
6140
|
-
function
|
|
6179
|
+
function dg(g, A = 0, I) {
|
|
6141
6180
|
let B = I ?? g.length - A;
|
|
6142
6181
|
return {
|
|
6143
6182
|
length: B,
|
|
6144
6183
|
subarray(C, Q = B) {
|
|
6145
|
-
return
|
|
6184
|
+
return dg(g, A + C, Q - C);
|
|
6146
6185
|
},
|
|
6147
6186
|
set(C, Q = 0) {
|
|
6148
6187
|
for (let E = 0; E < C.length; E++)
|
|
@@ -6153,10 +6192,10 @@ function Yg(g, A = 0, I) {
|
|
|
6153
6192
|
}
|
|
6154
6193
|
};
|
|
6155
6194
|
}
|
|
6156
|
-
function
|
|
6195
|
+
function $I(g) {
|
|
6157
6196
|
return globalThis.Array.isArray(g.data) ? {
|
|
6158
6197
|
// @ts-expect-error
|
|
6159
|
-
data:
|
|
6198
|
+
data: dg(g.data),
|
|
6160
6199
|
stride: g.stride,
|
|
6161
6200
|
bytes_per_element: 1
|
|
6162
6201
|
} : {
|
|
@@ -6170,7 +6209,7 @@ function RE(g) {
|
|
|
6170
6209
|
}
|
|
6171
6210
|
function NE(g, A) {
|
|
6172
6211
|
if (globalThis.Array.isArray(g.data))
|
|
6173
|
-
return
|
|
6212
|
+
return dg([A]);
|
|
6174
6213
|
let I = RE(g.data), B = new I([A]);
|
|
6175
6214
|
return new Uint8Array(B.buffer, B.byteOffset, B.byteLength);
|
|
6176
6215
|
}
|
|
@@ -6179,12 +6218,12 @@ const cE = {
|
|
|
6179
6218
|
return { data: g, shape: A, stride: I };
|
|
6180
6219
|
},
|
|
6181
6220
|
set_scalar(g, A, I) {
|
|
6182
|
-
let B =
|
|
6183
|
-
|
|
6221
|
+
let B = $I(g);
|
|
6222
|
+
Eg(B, A, NE(g, I), B.bytes_per_element);
|
|
6184
6223
|
},
|
|
6185
6224
|
set_from_chunk(g, A, I) {
|
|
6186
|
-
let B =
|
|
6187
|
-
wI(B,
|
|
6225
|
+
let B = $I(g);
|
|
6226
|
+
wI(B, $I(A), B.bytes_per_element, I);
|
|
6188
6227
|
}
|
|
6189
6228
|
};
|
|
6190
6229
|
async function UE(g, A = null, I = {}) {
|
|
@@ -6193,7 +6232,7 @@ async function UE(g, A = null, I = {}) {
|
|
|
6193
6232
|
function TB(g, A, I) {
|
|
6194
6233
|
return I < 0 && A < g ? Math.floor((g - A - 1) / -I) + 1 : g < A ? Math.floor((A - g - 1) / I) + 1 : 0;
|
|
6195
6234
|
}
|
|
6196
|
-
function
|
|
6235
|
+
function Eg(g, A, I, B) {
|
|
6197
6236
|
if (A.length === 0) {
|
|
6198
6237
|
g.data.set(I, 0);
|
|
6199
6238
|
return;
|
|
@@ -6201,7 +6240,7 @@ function Qg(g, A, I, B) {
|
|
|
6201
6240
|
const [C, ...Q] = A, [E, ...i] = g.stride;
|
|
6202
6241
|
if (typeof C == "number") {
|
|
6203
6242
|
const t = g.data.subarray(E * C * B);
|
|
6204
|
-
|
|
6243
|
+
Eg({ data: t, stride: i }, Q, I, B);
|
|
6205
6244
|
return;
|
|
6206
6245
|
}
|
|
6207
6246
|
const [o, a, D] = C, h = TB(o, a, D);
|
|
@@ -6212,7 +6251,7 @@ function Qg(g, A, I, B) {
|
|
|
6212
6251
|
}
|
|
6213
6252
|
for (let t = 0; t < h; t++) {
|
|
6214
6253
|
const y = g.data.subarray(E * (o + D * t) * B);
|
|
6215
|
-
|
|
6254
|
+
Eg({ data: y, stride: i }, Q, I, B);
|
|
6216
6255
|
}
|
|
6217
6256
|
}
|
|
6218
6257
|
function wI(g, A, I, B) {
|
|
@@ -6240,15 +6279,15 @@ function wI(g, A, I, B) {
|
|
|
6240
6279
|
}, I, Q);
|
|
6241
6280
|
return;
|
|
6242
6281
|
}
|
|
6243
|
-
const [D, h, t] = C.to, [y,
|
|
6282
|
+
const [D, h, t] = C.to, [y, n, w] = C.from, r = TB(D, h, t);
|
|
6244
6283
|
if (Q.length === 0) {
|
|
6245
|
-
if (t === 1 &&
|
|
6284
|
+
if (t === 1 && w === 1 && E === 1 && o === 1) {
|
|
6246
6285
|
let G = y * I, c = r * I;
|
|
6247
6286
|
g.data.set(A.data.subarray(G, G + c), D * I);
|
|
6248
6287
|
return;
|
|
6249
6288
|
}
|
|
6250
6289
|
for (let G = 0; G < r; G++) {
|
|
6251
|
-
let c = o * (y +
|
|
6290
|
+
let c = o * (y + w * G) * I;
|
|
6252
6291
|
g.data.set(A.data.subarray(c, c + I), E * (D + t * G) * I);
|
|
6253
6292
|
}
|
|
6254
6293
|
return;
|
|
@@ -6258,11 +6297,11 @@ function wI(g, A, I, B) {
|
|
|
6258
6297
|
data: g.data.subarray(E * (D + G * t) * I),
|
|
6259
6298
|
stride: i
|
|
6260
6299
|
}, {
|
|
6261
|
-
data: A.data.subarray(o * (y + G *
|
|
6300
|
+
data: A.data.subarray(o * (y + G * w) * I),
|
|
6262
6301
|
stride: a
|
|
6263
6302
|
}, I, Q);
|
|
6264
6303
|
}
|
|
6265
|
-
let
|
|
6304
|
+
let TI = kE();
|
|
6266
6305
|
function kE() {
|
|
6267
6306
|
let g = /* @__PURE__ */ new WeakMap();
|
|
6268
6307
|
function A(I) {
|
|
@@ -6281,47 +6320,47 @@ function kE() {
|
|
|
6281
6320
|
}
|
|
6282
6321
|
async function LE(g) {
|
|
6283
6322
|
let A = await g.store.get(g.resolve(".zattrs").path);
|
|
6284
|
-
return A ?
|
|
6323
|
+
return A ? tI(A) : {};
|
|
6285
6324
|
}
|
|
6286
6325
|
async function JE(g, A = {}) {
|
|
6287
6326
|
let I = "store" in g ? g : new z(g), B = {};
|
|
6288
|
-
return (A.attrs ?? !0) && (B = await LE(I)), A.kind === "array" ? yB(I, B) : A.kind === "group" ? eB(I, B) : yB(I, B).catch((C) => (mB(C,
|
|
6327
|
+
return (A.attrs ?? !0) && (B = await LE(I)), A.kind === "array" ? yB(I, B) : A.kind === "group" ? eB(I, B) : yB(I, B).catch((C) => (mB(C, yI), eB(I, B)));
|
|
6289
6328
|
}
|
|
6290
6329
|
async function yB(g, A) {
|
|
6291
6330
|
let { path: I } = g.resolve(".zarray"), B = await g.store.get(I);
|
|
6292
6331
|
if (!B)
|
|
6293
|
-
throw new
|
|
6294
|
-
cause: new
|
|
6332
|
+
throw new yI("v2 array", {
|
|
6333
|
+
cause: new Lg(I)
|
|
6295
6334
|
});
|
|
6296
|
-
return
|
|
6335
|
+
return TI.increment(g.store, "v2"), new kI(g.store, g.path, PQ(tI(B), A));
|
|
6297
6336
|
}
|
|
6298
6337
|
async function eB(g, A) {
|
|
6299
6338
|
let { path: I } = g.resolve(".zgroup"), B = await g.store.get(I);
|
|
6300
6339
|
if (!B)
|
|
6301
|
-
throw new
|
|
6302
|
-
cause: new
|
|
6340
|
+
throw new yI("v2 group", {
|
|
6341
|
+
cause: new Lg(I)
|
|
6303
6342
|
});
|
|
6304
|
-
return
|
|
6343
|
+
return TI.increment(g.store, "v2"), new Jg(g.store, g.path, OQ(tI(B), A));
|
|
6305
6344
|
}
|
|
6306
6345
|
async function YE(g) {
|
|
6307
6346
|
let { store: A, path: I } = g.resolve("zarr.json"), B = await g.store.get(I);
|
|
6308
6347
|
if (!B)
|
|
6309
|
-
throw new
|
|
6310
|
-
cause: new
|
|
6348
|
+
throw new yI("v3 array or group", {
|
|
6349
|
+
cause: new Lg(I)
|
|
6311
6350
|
});
|
|
6312
|
-
let C =
|
|
6313
|
-
return C.node_type === "array" && (C.fill_value = pB(C)), C.node_type === "array" ? new
|
|
6351
|
+
let C = tI(B);
|
|
6352
|
+
return C.node_type === "array" && (C.fill_value = pB(C)), C.node_type === "array" ? new kI(A, g.path, C) : new Jg(A, g.path, C);
|
|
6314
6353
|
}
|
|
6315
6354
|
async function dE(g, A = {}) {
|
|
6316
6355
|
let I = "store" in g ? g : new z(g), B = await YE(I);
|
|
6317
|
-
if (
|
|
6356
|
+
if (TI.increment(I.store, "v3"), A.kind === void 0 || A.kind === "array" && B instanceof kI || A.kind === "group" && B instanceof Jg)
|
|
6318
6357
|
return B;
|
|
6319
|
-
let C = B instanceof
|
|
6358
|
+
let C = B instanceof kI ? "array" : "group";
|
|
6320
6359
|
throw new Error(`Expected node of kind ${A.kind}, found ${C}.`);
|
|
6321
6360
|
}
|
|
6322
6361
|
async function IA(g, A = {}) {
|
|
6323
|
-
let I = "store" in g ? g.store : g, B =
|
|
6324
|
-
return C(g, A).catch((E) => (mB(E,
|
|
6362
|
+
let I = "store" in g ? g.store : g, B = TI.version_max(I), C = B === "v2" ? IA.v2 : IA.v3, Q = B === "v2" ? IA.v3 : IA.v2;
|
|
6363
|
+
return C(g, A).catch((E) => (mB(E, yI), Q(g, A)));
|
|
6325
6364
|
}
|
|
6326
6365
|
IA.v2 = JE;
|
|
6327
6366
|
IA.v3 = dE;
|
|
@@ -6333,7 +6372,7 @@ async function ME(g, A) {
|
|
|
6333
6372
|
g = await g.getDirectoryHandle(C);
|
|
6334
6373
|
return g.getFileHandle(B);
|
|
6335
6374
|
}
|
|
6336
|
-
class
|
|
6375
|
+
class Mg {
|
|
6337
6376
|
#A;
|
|
6338
6377
|
constructor(A) {
|
|
6339
6378
|
this.#A = A;
|
|
@@ -6361,7 +6400,7 @@ function KE() {
|
|
|
6361
6400
|
throw new Error(I);
|
|
6362
6401
|
}
|
|
6363
6402
|
}
|
|
6364
|
-
class
|
|
6403
|
+
class Kg extends WA {
|
|
6365
6404
|
credentials;
|
|
6366
6405
|
region;
|
|
6367
6406
|
// Cache signing keys per date/region combination (valid for 24 hours)
|
|
@@ -6397,14 +6436,14 @@ class Mg extends WA {
|
|
|
6397
6436
|
async getRange(A, I, B) {
|
|
6398
6437
|
if (this.credentials && this.region) {
|
|
6399
6438
|
const Q = `${this.url.toString().replace(/\/$/, "")}${A}`, E = await this.generateAuthHeaders(Q, "HEAD"), i = await this.generateAuthHeaders(Q, "GET"), o = globalThis.fetch, a = async (h, t) => {
|
|
6400
|
-
const
|
|
6439
|
+
const n = (t?.method || "GET") === "HEAD" ? E : i, w = {
|
|
6401
6440
|
...t,
|
|
6402
6441
|
headers: {
|
|
6403
6442
|
...t?.headers,
|
|
6404
|
-
...
|
|
6443
|
+
...n
|
|
6405
6444
|
}
|
|
6406
6445
|
};
|
|
6407
|
-
return o(h,
|
|
6446
|
+
return o(h, w);
|
|
6408
6447
|
}, D = globalThis.fetch;
|
|
6409
6448
|
globalThis.fetch = a;
|
|
6410
6449
|
try {
|
|
@@ -6422,15 +6461,15 @@ class Mg extends WA {
|
|
|
6422
6461
|
async generateAuthHeaders(A, I = "GET") {
|
|
6423
6462
|
if (!this.credentials || !this.region)
|
|
6424
6463
|
return {};
|
|
6425
|
-
const { accessKeyId: B, secretAccessKey: C, sessionToken: Q } = this.credentials, E = this.region, i = "s3", o = this.getAmzDate(), a = o.slice(0, 8), D = new URL(A), h = D.host, t = D.pathname, y = D.search.slice(1),
|
|
6464
|
+
const { accessKeyId: B, secretAccessKey: C, sessionToken: Q } = this.credentials, E = this.region, i = "s3", o = this.getAmzDate(), a = o.slice(0, 8), D = new URL(A), h = D.host, t = D.pathname, y = D.search.slice(1), n = `host:${h}
|
|
6426
6465
|
x-amz-content-sha256:UNSIGNED-PAYLOAD
|
|
6427
6466
|
x-amz-date:${o}
|
|
6428
6467
|
` + (Q ? `x-amz-security-token:${Q}
|
|
6429
|
-
` : ""),
|
|
6468
|
+
` : ""), w = Q ? "host;x-amz-content-sha256;x-amz-date;x-amz-security-token" : "host;x-amz-content-sha256;x-amz-date", r = "UNSIGNED-PAYLOAD", G = `${I}
|
|
6430
6469
|
${t}
|
|
6431
6470
|
${y}
|
|
6432
|
-
${w}
|
|
6433
6471
|
${n}
|
|
6472
|
+
${w}
|
|
6434
6473
|
${r}`, c = "AWS4-HMAC-SHA256", N = `${a}/${E}/${i}/aws4_request`, d = await this.sha256(G), L = `${c}
|
|
6435
6474
|
${o}
|
|
6436
6475
|
${N}
|
|
@@ -6440,7 +6479,7 @@ ${d}`, k = await this.getSignatureKey(
|
|
|
6440
6479
|
E,
|
|
6441
6480
|
i
|
|
6442
6481
|
), T = await this.hmacSha256(k, L), O = {
|
|
6443
|
-
Authorization: `${c} Credential=${B}/${N}, SignedHeaders=${
|
|
6482
|
+
Authorization: `${c} Credential=${B}/${N}, SignedHeaders=${w}, Signature=${T}`,
|
|
6444
6483
|
"X-Amz-Date": o,
|
|
6445
6484
|
"X-Amz-Content-Sha256": r
|
|
6446
6485
|
};
|
|
@@ -6488,7 +6527,7 @@ ${d}`, k = await this.getSignatureKey(
|
|
|
6488
6527
|
return Array.from(A).map((I) => I.toString(16).padStart(2, "0")).join("");
|
|
6489
6528
|
}
|
|
6490
6529
|
}
|
|
6491
|
-
async function
|
|
6530
|
+
async function eI(g, A) {
|
|
6492
6531
|
if (A === "v2")
|
|
6493
6532
|
try {
|
|
6494
6533
|
return IA.v2(g, { kind: "group", attrs: !0 });
|
|
@@ -6535,13 +6574,13 @@ async function qE(g) {
|
|
|
6535
6574
|
break;
|
|
6536
6575
|
}
|
|
6537
6576
|
case "s3": {
|
|
6538
|
-
const B = new
|
|
6577
|
+
const B = new Kg(g);
|
|
6539
6578
|
A = new z(B);
|
|
6540
6579
|
break;
|
|
6541
6580
|
}
|
|
6542
6581
|
case "filesystem": {
|
|
6543
6582
|
A = new z(
|
|
6544
|
-
new
|
|
6583
|
+
new Mg(g.directoryHandle),
|
|
6545
6584
|
g.path
|
|
6546
6585
|
);
|
|
6547
6586
|
break;
|
|
@@ -6555,7 +6594,7 @@ async function qE(g) {
|
|
|
6555
6594
|
return HE(I, g.zarrVersion);
|
|
6556
6595
|
}
|
|
6557
6596
|
function lE(g, A, I) {
|
|
6558
|
-
if (g.store instanceof
|
|
6597
|
+
if (g.store instanceof Kg)
|
|
6559
6598
|
return {
|
|
6560
6599
|
type: "s3",
|
|
6561
6600
|
arrayPath: A,
|
|
@@ -6573,7 +6612,7 @@ function lE(g, A, I) {
|
|
|
6573
6612
|
zarrVersion: I,
|
|
6574
6613
|
url: g.store.url.toString()
|
|
6575
6614
|
};
|
|
6576
|
-
if (g.store instanceof
|
|
6615
|
+
if (g.store instanceof Mg)
|
|
6577
6616
|
return {
|
|
6578
6617
|
type: "filesystem",
|
|
6579
6618
|
arrayPath: A,
|
|
@@ -9752,7 +9791,7 @@ function fE(g) {
|
|
|
9752
9791
|
}
|
|
9753
9792
|
const pE = Math.min(navigator.hardwareConcurrency, 8);
|
|
9754
9793
|
let CA = [], mE = 0, xB = 0;
|
|
9755
|
-
const UA = /* @__PURE__ */ new Map(),
|
|
9794
|
+
const UA = /* @__PURE__ */ new Map(), JI = /* @__PURE__ */ new Set();
|
|
9756
9795
|
function bB(g) {
|
|
9757
9796
|
const A = CA.find((I) => I.worker === g);
|
|
9758
9797
|
return A || U.error(
|
|
@@ -9763,7 +9802,7 @@ function bB(g) {
|
|
|
9763
9802
|
function uE(g, A) {
|
|
9764
9803
|
const { id: I, success: B } = g.data, C = UA.get(I);
|
|
9765
9804
|
if (!C) {
|
|
9766
|
-
|
|
9805
|
+
JI.has(I) ? JI.delete(I) : U.warn(
|
|
9767
9806
|
"ZarrWorker",
|
|
9768
9807
|
`Received response for unknown message ID ${I}:`,
|
|
9769
9808
|
g.data
|
|
@@ -9777,7 +9816,7 @@ function uE(g, A) {
|
|
|
9777
9816
|
"Received message but no pending tasks - this should not happen"
|
|
9778
9817
|
), B && g.data.type === "getChunk" ? C.resolve(g.data.chunk) : B || C.reject(new Error(g.data.error || "Unknown worker error"));
|
|
9779
9818
|
}
|
|
9780
|
-
function
|
|
9819
|
+
function nB(g, A) {
|
|
9781
9820
|
if (g instanceof MessageEvent) {
|
|
9782
9821
|
U.error(
|
|
9783
9822
|
"ZarrWorker",
|
|
@@ -9812,9 +9851,9 @@ function wB(g, A) {
|
|
|
9812
9851
|
}
|
|
9813
9852
|
function ZB() {
|
|
9814
9853
|
const g = new fE();
|
|
9815
|
-
return g.addEventListener("message", (A) => uE(A, g)), g.addEventListener("error", (A) =>
|
|
9854
|
+
return g.addEventListener("message", (A) => uE(A, g)), g.addEventListener("error", (A) => nB(A, g)), g.addEventListener(
|
|
9816
9855
|
"messageerror",
|
|
9817
|
-
(A) =>
|
|
9856
|
+
(A) => nB(A, g)
|
|
9818
9857
|
), g;
|
|
9819
9858
|
}
|
|
9820
9859
|
function TE() {
|
|
@@ -9834,10 +9873,10 @@ async function WE(g, A, I) {
|
|
|
9834
9873
|
Q.worker.postMessage({
|
|
9835
9874
|
id: E,
|
|
9836
9875
|
type: "cancel"
|
|
9837
|
-
}), UA.delete(E),
|
|
9876
|
+
}), UA.delete(E), JI.add(E), Q.pendingCount--, C(new DOMException("Operation was aborted", "AbortError"));
|
|
9838
9877
|
};
|
|
9839
9878
|
if (I.signal.aborted) {
|
|
9840
|
-
o(),
|
|
9879
|
+
o(), JI.delete(E);
|
|
9841
9880
|
return;
|
|
9842
9881
|
}
|
|
9843
9882
|
I.signal.addEventListener("abort", o, { once: !0 }), i.abortListener = o, i.abortSignal = I.signal;
|
|
@@ -9915,7 +9954,7 @@ class OE {
|
|
|
9915
9954
|
const C = this.arrays_[A.lod], Q = this.arrayParams_[A.lod], E = await bE(C, Q, B, {
|
|
9916
9955
|
signal: I
|
|
9917
9956
|
});
|
|
9918
|
-
if (!
|
|
9957
|
+
if (!Xg(E.data))
|
|
9919
9958
|
throw new Error(
|
|
9920
9959
|
`Received chunk has an unsupported data type, data=${E.data.constructor.name}`
|
|
9921
9960
|
);
|
|
@@ -9935,7 +9974,7 @@ class OE {
|
|
|
9935
9974
|
E.stride
|
|
9936
9975
|
) : A.data = E.data;
|
|
9937
9976
|
const D = A.data.BYTES_PER_ELEMENT;
|
|
9938
|
-
if (
|
|
9977
|
+
if (!$g(D))
|
|
9939
9978
|
throw new Error(
|
|
9940
9979
|
"Invalid row alignment value. Possible values are 1, 2, 4, or 8"
|
|
9941
9980
|
);
|
|
@@ -9966,7 +10005,7 @@ class OE {
|
|
|
9966
10005
|
opts: { signal: B.abortSignal }
|
|
9967
10006
|
});
|
|
9968
10007
|
const i = await UE(Q, C, E);
|
|
9969
|
-
if (!
|
|
10008
|
+
if (!Xg(i.data))
|
|
9970
10009
|
throw new Error(
|
|
9971
10010
|
`Subarray has an unsupported data type, data=${i.data.constructor.name}`
|
|
9972
10011
|
);
|
|
@@ -9975,11 +10014,11 @@ class OE {
|
|
|
9975
10014
|
`Expected to receive a 2D or 3D subarray. Instead chunk has shape ${i.shape}`
|
|
9976
10015
|
);
|
|
9977
10016
|
const o = i.data.BYTES_PER_ELEMENT;
|
|
9978
|
-
if (
|
|
10017
|
+
if (!$g(o))
|
|
9979
10018
|
throw new Error(
|
|
9980
10019
|
"Invalid row alignment value. Possible values are 1, 2, 4, or 8"
|
|
9981
10020
|
);
|
|
9982
|
-
const a = (G, c) => typeof G == "number" ? G * c.scale + c.translation : G.start === null ? c.translation : G.start * c.scale + c.translation, D = this.dimensions_.x.lods[I], h = C[this.dimensions_.x.index], t = a(h, D), y = C[this.dimensions_.y.index],
|
|
10021
|
+
const a = (G, c) => typeof G == "number" ? G * c.scale + c.translation : G.start === null ? c.translation : G.start * c.scale + c.translation, D = this.dimensions_.x.lods[I], h = C[this.dimensions_.x.index], t = a(h, D), y = C[this.dimensions_.y.index], n = this.dimensions_.y.lods[I], w = a(y, n);
|
|
9983
10022
|
return {
|
|
9984
10023
|
state: "loaded",
|
|
9985
10024
|
lod: I,
|
|
@@ -9998,10 +10037,10 @@ class OE {
|
|
|
9998
10037
|
rowAlignmentBytes: o,
|
|
9999
10038
|
scale: {
|
|
10000
10039
|
x: D.scale,
|
|
10001
|
-
y:
|
|
10040
|
+
y: n.scale,
|
|
10002
10041
|
z: 1
|
|
10003
10042
|
},
|
|
10004
|
-
offset: { x: t, y:
|
|
10043
|
+
offset: { x: t, y: w, z: 0 }
|
|
10005
10044
|
};
|
|
10006
10045
|
}
|
|
10007
10046
|
regionToIndices(A, I) {
|
|
@@ -10019,7 +10058,7 @@ class OE {
|
|
|
10019
10058
|
const i = Q.lods[I];
|
|
10020
10059
|
let o;
|
|
10021
10060
|
const a = E.index;
|
|
10022
|
-
a.type === "full" ? o =
|
|
10061
|
+
a.type === "full" ? o = LI(null) : a.type === "point" ? o = Math.round((a.value - i.translation) / i.scale) : o = LI(
|
|
10023
10062
|
Math.floor((a.start - i.translation) / i.scale),
|
|
10024
10063
|
Math.ceil((a.stop - i.translation) / i.scale)
|
|
10025
10064
|
), C.push(o);
|
|
@@ -10028,10 +10067,10 @@ class OE {
|
|
|
10028
10067
|
}
|
|
10029
10068
|
}
|
|
10030
10069
|
function VE(g, A) {
|
|
10031
|
-
const I = g.axes.map((h) => h.name), B = g.axes.length, C =
|
|
10070
|
+
const I = g.axes.map((h) => h.name), B = g.axes.length, C = wB(I, "x"), Q = wB(I, "y"), E = (h, t) => {
|
|
10032
10071
|
const y = [];
|
|
10033
|
-
for (let
|
|
10034
|
-
const
|
|
10072
|
+
for (let n = 0; n < g.datasets.length; n++) {
|
|
10073
|
+
const w = g.datasets[n], r = A[n], G = w.coordinateTransformations[0].scale, c = w.coordinateTransformations.length === 2 ? w.coordinateTransformations[1].translation : new Array(B).fill(0);
|
|
10035
10074
|
y.push({
|
|
10036
10075
|
size: r.shape[t],
|
|
10037
10076
|
chunkSize: r.chunks[t],
|
|
@@ -10049,25 +10088,25 @@ function VE(g, A) {
|
|
|
10049
10088
|
x: E(I[C], C),
|
|
10050
10089
|
y: E(I[Q], Q),
|
|
10051
10090
|
numLods: A.length
|
|
10052
|
-
}, o =
|
|
10091
|
+
}, o = FI(I, "z");
|
|
10053
10092
|
o !== -1 && (i.z = E(I[o], o));
|
|
10054
|
-
const a =
|
|
10093
|
+
const a = FI(I, "c");
|
|
10055
10094
|
a !== -1 && (i.c = E(I[a], a));
|
|
10056
|
-
const D =
|
|
10095
|
+
const D = FI(I, "t");
|
|
10057
10096
|
return D !== -1 && (i.t = E(I[D], D)), i;
|
|
10058
10097
|
}
|
|
10059
10098
|
function PB(g, A) {
|
|
10060
10099
|
return g.toLowerCase() === A.toLowerCase();
|
|
10061
10100
|
}
|
|
10062
|
-
function
|
|
10063
|
-
const I =
|
|
10101
|
+
function wB(g, A) {
|
|
10102
|
+
const I = FI(g, A);
|
|
10064
10103
|
if (I === -1)
|
|
10065
10104
|
throw new Error(
|
|
10066
10105
|
`Could not find "${A}" dimension in [${g.join(", ")}]`
|
|
10067
10106
|
);
|
|
10068
10107
|
return I;
|
|
10069
10108
|
}
|
|
10070
|
-
function
|
|
10109
|
+
function FI(g, A) {
|
|
10071
10110
|
return g.findIndex((I) => PB(I, A));
|
|
10072
10111
|
}
|
|
10073
10112
|
function FB(g) {
|
|
@@ -10116,14 +10155,14 @@ var H;
|
|
|
10116
10155
|
}
|
|
10117
10156
|
g.joinValues = B, g.jsonStringifyReplacer = (C, Q) => typeof Q == "bigint" ? Q.toString() : Q;
|
|
10118
10157
|
})(H || (H = {}));
|
|
10119
|
-
var
|
|
10158
|
+
var ig;
|
|
10120
10159
|
(function(g) {
|
|
10121
10160
|
g.mergeShapes = (A, I) => ({
|
|
10122
10161
|
...A,
|
|
10123
10162
|
...I
|
|
10124
10163
|
// second overwrites first
|
|
10125
10164
|
});
|
|
10126
|
-
})(
|
|
10165
|
+
})(ig || (ig = {}));
|
|
10127
10166
|
const S = H.arrayToEnum([
|
|
10128
10167
|
"string",
|
|
10129
10168
|
"nan",
|
|
@@ -10304,10 +10343,10 @@ let OB = lA;
|
|
|
10304
10343
|
function XE(g) {
|
|
10305
10344
|
OB = g;
|
|
10306
10345
|
}
|
|
10307
|
-
function
|
|
10346
|
+
function YI() {
|
|
10308
10347
|
return OB;
|
|
10309
10348
|
}
|
|
10310
|
-
const
|
|
10349
|
+
const dI = (g) => {
|
|
10311
10350
|
const { data: A, path: I, errorMaps: B, issueData: C } = g, Q = [...I, ...C.path || []], E = {
|
|
10312
10351
|
...C,
|
|
10313
10352
|
path: Q
|
|
@@ -10329,7 +10368,7 @@ const JI = (g) => {
|
|
|
10329
10368
|
};
|
|
10330
10369
|
}, jE = [];
|
|
10331
10370
|
function F(g, A) {
|
|
10332
|
-
const I =
|
|
10371
|
+
const I = YI(), B = dI({
|
|
10333
10372
|
issueData: A,
|
|
10334
10373
|
data: g.data,
|
|
10335
10374
|
path: g.path,
|
|
@@ -10389,8 +10428,8 @@ class X {
|
|
|
10389
10428
|
}
|
|
10390
10429
|
const Y = Object.freeze({
|
|
10391
10430
|
status: "aborted"
|
|
10392
|
-
}), MA = (g) => ({ status: "dirty", value: g }), j = (g) => ({ status: "valid", value: g }),
|
|
10393
|
-
function
|
|
10431
|
+
}), MA = (g) => ({ status: "dirty", value: g }), j = (g) => ({ status: "valid", value: g }), og = (g) => g.status === "aborted", ag = (g) => g.status === "dirty", kA = (g) => g.status === "valid", _A = (g) => typeof Promise < "u" && g instanceof Promise;
|
|
10432
|
+
function MI(g, A, I, B) {
|
|
10394
10433
|
if (typeof A == "function" ? g !== A || !0 : !A.has(g)) throw new TypeError("Cannot read private member from an object whose class did not declare it");
|
|
10395
10434
|
return A.get(g);
|
|
10396
10435
|
}
|
|
@@ -10470,7 +10509,7 @@ class K {
|
|
|
10470
10509
|
}
|
|
10471
10510
|
_parseSync(A) {
|
|
10472
10511
|
const I = this._parse(A);
|
|
10473
|
-
if (
|
|
10512
|
+
if (_A(I))
|
|
10474
10513
|
throw new Error("Synchronous parse encountered promise.");
|
|
10475
10514
|
return I;
|
|
10476
10515
|
}
|
|
@@ -10551,7 +10590,7 @@ class K {
|
|
|
10551
10590
|
parent: null,
|
|
10552
10591
|
data: A,
|
|
10553
10592
|
parsedType: tA(A)
|
|
10554
|
-
}, C = this._parse({ data: A, path: B.path, parent: B }), Q = await (
|
|
10593
|
+
}, C = this._parse({ data: A, path: B.path, parent: B }), Q = await (_A(C) ? C : Promise.resolve(C));
|
|
10555
10594
|
return rB(B, Q);
|
|
10556
10595
|
}
|
|
10557
10596
|
refine(A, I) {
|
|
@@ -10588,7 +10627,7 @@ class K {
|
|
|
10588
10627
|
return aA.create(this, this._def);
|
|
10589
10628
|
}
|
|
10590
10629
|
nullable() {
|
|
10591
|
-
return
|
|
10630
|
+
return wA.create(this, this._def);
|
|
10592
10631
|
}
|
|
10593
10632
|
nullish() {
|
|
10594
10633
|
return this.nullable().optional();
|
|
@@ -10600,10 +10639,10 @@ class K {
|
|
|
10600
10639
|
return pA.create(this, this._def);
|
|
10601
10640
|
}
|
|
10602
10641
|
or(A) {
|
|
10603
|
-
return
|
|
10642
|
+
return gI.create([this, A], this._def);
|
|
10604
10643
|
}
|
|
10605
10644
|
and(A) {
|
|
10606
|
-
return
|
|
10645
|
+
return BI.create(this, A, this._def);
|
|
10607
10646
|
}
|
|
10608
10647
|
transform(A) {
|
|
10609
10648
|
return new EA({
|
|
@@ -10615,7 +10654,7 @@ class K {
|
|
|
10615
10654
|
}
|
|
10616
10655
|
default(A) {
|
|
10617
10656
|
const I = typeof A == "function" ? A : () => A;
|
|
10618
|
-
return new
|
|
10657
|
+
return new oI({
|
|
10619
10658
|
...M(this._def),
|
|
10620
10659
|
innerType: this,
|
|
10621
10660
|
defaultValue: I,
|
|
@@ -10623,7 +10662,7 @@ class K {
|
|
|
10623
10662
|
});
|
|
10624
10663
|
}
|
|
10625
10664
|
brand() {
|
|
10626
|
-
return new
|
|
10665
|
+
return new Hg({
|
|
10627
10666
|
typeName: J.ZodBranded,
|
|
10628
10667
|
type: this,
|
|
10629
10668
|
...M(this._def)
|
|
@@ -10631,7 +10670,7 @@ class K {
|
|
|
10631
10670
|
}
|
|
10632
10671
|
catch(A) {
|
|
10633
10672
|
const I = typeof A == "function" ? A : () => A;
|
|
10634
|
-
return new
|
|
10673
|
+
return new aI({
|
|
10635
10674
|
...M(this._def),
|
|
10636
10675
|
innerType: this,
|
|
10637
10676
|
catchValue: I,
|
|
@@ -10646,10 +10685,10 @@ class K {
|
|
|
10646
10685
|
});
|
|
10647
10686
|
}
|
|
10648
10687
|
pipe(A) {
|
|
10649
|
-
return
|
|
10688
|
+
return GI.create(this, A);
|
|
10650
10689
|
}
|
|
10651
10690
|
readonly() {
|
|
10652
|
-
return
|
|
10691
|
+
return DI.create(this);
|
|
10653
10692
|
}
|
|
10654
10693
|
isOptional() {
|
|
10655
10694
|
return this.safeParse(void 0).success;
|
|
@@ -10659,7 +10698,7 @@ class K {
|
|
|
10659
10698
|
}
|
|
10660
10699
|
}
|
|
10661
10700
|
const zE = /^c[^\s-]{8,}$/i, _E = /^[0-9a-z]+$/, $E = /^[0-9A-HJKMNP-TV-Z]{26}$/i, Ai = /^[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, Ii = /^[a-z0-9_-]{21}$/i, gi = /^[A-Za-z0-9-_]+\.[A-Za-z0-9-_]+\.[A-Za-z0-9-_]*$/, Bi = /^[-+]?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)?)??$/, Ci = /^(?!\.)(?!.*\.\.)([A-Z0-9_'+\-\.]*)[A-Z0-9_+-]@([A-Z0-9][A-Z0-9\-]*\.)+[A-Z]{2,}$/i, Qi = "^(\\p{Extended_Pictographic}|\\p{Emoji_Component})+$";
|
|
10662
|
-
let
|
|
10701
|
+
let Ag;
|
|
10663
10702
|
const Ei = /^(?:(?: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])$/, ii = /^(?:(?: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])$/, oi = /^(([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]))$/, ai = /^(([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])$/, Di = /^([0-9a-zA-Z+/]{4})*(([0-9a-zA-Z+/]{2}==)|([0-9a-zA-Z+/]{3}=))?$/, si = /^([0-9a-zA-Z-_]{4})*(([0-9a-zA-Z-_]{2}(==)?)|([0-9a-zA-Z-_]{3}(=)?))?$/, vB = "((\\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])))", hi = new RegExp(`^${vB}$`);
|
|
10664
10703
|
function XB(g) {
|
|
10665
10704
|
let A = "([01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d";
|
|
@@ -10744,7 +10783,7 @@ class gA extends K {
|
|
|
10744
10783
|
message: Q.message
|
|
10745
10784
|
}), B.dirty());
|
|
10746
10785
|
else if (Q.kind === "emoji")
|
|
10747
|
-
|
|
10786
|
+
Ag || (Ag = new RegExp(Qi, "u")), Ag.test(A.data) || (C = this._getOrReturnCtx(A, C), F(C, {
|
|
10748
10787
|
validation: "emoji",
|
|
10749
10788
|
code: e.invalid_string,
|
|
10750
10789
|
message: Q.message
|
|
@@ -11076,7 +11115,7 @@ gA.create = (g) => {
|
|
|
11076
11115
|
...M(g)
|
|
11077
11116
|
});
|
|
11078
11117
|
};
|
|
11079
|
-
function
|
|
11118
|
+
function ni(g, A) {
|
|
11080
11119
|
const I = (g.toString().split(".")[1] || "").length, B = (A.toString().split(".")[1] || "").length, C = I > B ? I : B, Q = parseInt(g.toFixed(C).replace(".", "")), E = parseInt(A.toFixed(C).replace(".", ""));
|
|
11081
11120
|
return Q % E / Math.pow(10, C);
|
|
11082
11121
|
}
|
|
@@ -11115,7 +11154,7 @@ class eA extends K {
|
|
|
11115
11154
|
inclusive: Q.inclusive,
|
|
11116
11155
|
exact: !1,
|
|
11117
11156
|
message: Q.message
|
|
11118
|
-
}), C.dirty()) : Q.kind === "multipleOf" ?
|
|
11157
|
+
}), C.dirty()) : Q.kind === "multipleOf" ? ni(A.data, Q.value) !== 0 && (B = this._getOrReturnCtx(A, B), F(B, {
|
|
11119
11158
|
code: e.not_multiple_of,
|
|
11120
11159
|
multipleOf: Q.value,
|
|
11121
11160
|
message: Q.message
|
|
@@ -11388,7 +11427,7 @@ GA.create = (g) => {
|
|
|
11388
11427
|
...M(g)
|
|
11389
11428
|
});
|
|
11390
11429
|
};
|
|
11391
|
-
class
|
|
11430
|
+
class $A extends K {
|
|
11392
11431
|
_parse(A) {
|
|
11393
11432
|
if (this._def.coerce && (A.data = !!A.data), this._getType(A) !== S.boolean) {
|
|
11394
11433
|
const B = this._getOrReturnCtx(A);
|
|
@@ -11401,7 +11440,7 @@ class _A extends K {
|
|
|
11401
11440
|
return j(A.data);
|
|
11402
11441
|
}
|
|
11403
11442
|
}
|
|
11404
|
-
|
|
11443
|
+
$A.create = (g) => new $A({
|
|
11405
11444
|
typeName: J.ZodBoolean,
|
|
11406
11445
|
coerce: g?.coerce || !1,
|
|
11407
11446
|
...M(g)
|
|
@@ -11484,7 +11523,7 @@ LA.create = (g) => new LA({
|
|
|
11484
11523
|
typeName: J.ZodDate,
|
|
11485
11524
|
...M(g)
|
|
11486
11525
|
});
|
|
11487
|
-
class
|
|
11526
|
+
class KI extends K {
|
|
11488
11527
|
_parse(A) {
|
|
11489
11528
|
if (this._getType(A) !== S.symbol) {
|
|
11490
11529
|
const B = this._getOrReturnCtx(A);
|
|
@@ -11497,11 +11536,11 @@ class dI extends K {
|
|
|
11497
11536
|
return j(A.data);
|
|
11498
11537
|
}
|
|
11499
11538
|
}
|
|
11500
|
-
|
|
11539
|
+
KI.create = (g) => new KI({
|
|
11501
11540
|
typeName: J.ZodSymbol,
|
|
11502
11541
|
...M(g)
|
|
11503
11542
|
});
|
|
11504
|
-
class
|
|
11543
|
+
class AI extends K {
|
|
11505
11544
|
_parse(A) {
|
|
11506
11545
|
if (this._getType(A) !== S.undefined) {
|
|
11507
11546
|
const B = this._getOrReturnCtx(A);
|
|
@@ -11514,11 +11553,11 @@ class $A extends K {
|
|
|
11514
11553
|
return j(A.data);
|
|
11515
11554
|
}
|
|
11516
11555
|
}
|
|
11517
|
-
|
|
11556
|
+
AI.create = (g) => new AI({
|
|
11518
11557
|
typeName: J.ZodUndefined,
|
|
11519
11558
|
...M(g)
|
|
11520
11559
|
});
|
|
11521
|
-
class
|
|
11560
|
+
class II extends K {
|
|
11522
11561
|
_parse(A) {
|
|
11523
11562
|
if (this._getType(A) !== S.null) {
|
|
11524
11563
|
const B = this._getOrReturnCtx(A);
|
|
@@ -11531,7 +11570,7 @@ class AI extends K {
|
|
|
11531
11570
|
return j(A.data);
|
|
11532
11571
|
}
|
|
11533
11572
|
}
|
|
11534
|
-
|
|
11573
|
+
II.create = (g) => new II({
|
|
11535
11574
|
typeName: J.ZodNull,
|
|
11536
11575
|
...M(g)
|
|
11537
11576
|
});
|
|
@@ -11573,7 +11612,7 @@ yA.create = (g) => new yA({
|
|
|
11573
11612
|
typeName: J.ZodNever,
|
|
11574
11613
|
...M(g)
|
|
11575
11614
|
});
|
|
11576
|
-
class
|
|
11615
|
+
class HI extends K {
|
|
11577
11616
|
_parse(A) {
|
|
11578
11617
|
if (this._getType(A) !== S.undefined) {
|
|
11579
11618
|
const B = this._getOrReturnCtx(A);
|
|
@@ -11586,7 +11625,7 @@ class MI extends K {
|
|
|
11586
11625
|
return j(A.data);
|
|
11587
11626
|
}
|
|
11588
11627
|
}
|
|
11589
|
-
|
|
11628
|
+
HI.create = (g) => new HI({
|
|
11590
11629
|
typeName: J.ZodVoid,
|
|
11591
11630
|
...M(g)
|
|
11592
11631
|
});
|
|
@@ -11677,7 +11716,7 @@ function dA(g) {
|
|
|
11677
11716
|
} else return g instanceof QA ? new QA({
|
|
11678
11717
|
...g._def,
|
|
11679
11718
|
type: dA(g.element)
|
|
11680
|
-
}) : g instanceof aA ? aA.create(dA(g.unwrap())) : g instanceof
|
|
11719
|
+
}) : g instanceof aA ? aA.create(dA(g.unwrap())) : g instanceof wA ? wA.create(dA(g.unwrap())) : g instanceof sA ? sA.create(g.items.map((A) => dA(A))) : g;
|
|
11681
11720
|
}
|
|
11682
11721
|
class m extends K {
|
|
11683
11722
|
constructor() {
|
|
@@ -11966,7 +12005,7 @@ m.lazycreate = (g, A) => new m({
|
|
|
11966
12005
|
typeName: J.ZodObject,
|
|
11967
12006
|
...M(A)
|
|
11968
12007
|
});
|
|
11969
|
-
class
|
|
12008
|
+
class gI extends K {
|
|
11970
12009
|
_parse(A) {
|
|
11971
12010
|
const { ctx: I } = this._processInputParams(A), B = this._def.options;
|
|
11972
12011
|
function C(Q) {
|
|
@@ -12034,13 +12073,13 @@ class II extends K {
|
|
|
12034
12073
|
return this._def.options;
|
|
12035
12074
|
}
|
|
12036
12075
|
}
|
|
12037
|
-
|
|
12076
|
+
gI.create = (g, A) => new gI({
|
|
12038
12077
|
options: g,
|
|
12039
12078
|
typeName: J.ZodUnion,
|
|
12040
12079
|
...M(A)
|
|
12041
12080
|
});
|
|
12042
|
-
const hA = (g) => g instanceof
|
|
12043
|
-
class
|
|
12081
|
+
const hA = (g) => g instanceof QI ? hA(g.schema) : g instanceof EA ? hA(g.innerType()) : g instanceof EI ? [g.value] : g instanceof nA ? g.options : g instanceof iI ? H.objectValues(g.enum) : g instanceof oI ? hA(g._def.innerType) : g instanceof AI ? [void 0] : g instanceof II ? [null] : g instanceof aA ? [void 0, ...hA(g.unwrap())] : g instanceof wA ? [null, ...hA(g.unwrap())] : g instanceof Hg || g instanceof DI ? hA(g.unwrap()) : g instanceof aI ? hA(g._def.innerType) : [];
|
|
12082
|
+
class WI extends K {
|
|
12044
12083
|
_parse(A) {
|
|
12045
12084
|
const { ctx: I } = this._processInputParams(A);
|
|
12046
12085
|
if (I.parsedType !== S.object)
|
|
@@ -12093,7 +12132,7 @@ class uI extends K {
|
|
|
12093
12132
|
C.set(i, Q);
|
|
12094
12133
|
}
|
|
12095
12134
|
}
|
|
12096
|
-
return new
|
|
12135
|
+
return new WI({
|
|
12097
12136
|
typeName: J.ZodDiscriminatedUnion,
|
|
12098
12137
|
discriminator: A,
|
|
12099
12138
|
options: I,
|
|
@@ -12102,14 +12141,14 @@ class uI extends K {
|
|
|
12102
12141
|
});
|
|
12103
12142
|
}
|
|
12104
12143
|
}
|
|
12105
|
-
function
|
|
12144
|
+
function Dg(g, A) {
|
|
12106
12145
|
const I = tA(g), B = tA(A);
|
|
12107
12146
|
if (g === A)
|
|
12108
12147
|
return { valid: !0, data: g };
|
|
12109
12148
|
if (I === S.object && B === S.object) {
|
|
12110
12149
|
const C = H.objectKeys(A), Q = H.objectKeys(g).filter((i) => C.indexOf(i) !== -1), E = { ...g, ...A };
|
|
12111
12150
|
for (const i of Q) {
|
|
12112
|
-
const o =
|
|
12151
|
+
const o = Dg(g[i], A[i]);
|
|
12113
12152
|
if (!o.valid)
|
|
12114
12153
|
return { valid: !1 };
|
|
12115
12154
|
E[i] = o.data;
|
|
@@ -12120,7 +12159,7 @@ function ag(g, A) {
|
|
|
12120
12159
|
return { valid: !1 };
|
|
12121
12160
|
const C = [];
|
|
12122
12161
|
for (let Q = 0; Q < g.length; Q++) {
|
|
12123
|
-
const E = g[Q], i = A[Q], o =
|
|
12162
|
+
const E = g[Q], i = A[Q], o = Dg(E, i);
|
|
12124
12163
|
if (!o.valid)
|
|
12125
12164
|
return { valid: !1 };
|
|
12126
12165
|
C.push(o.data);
|
|
@@ -12128,13 +12167,13 @@ function ag(g, A) {
|
|
|
12128
12167
|
return { valid: !0, data: C };
|
|
12129
12168
|
} else return I === S.date && B === S.date && +g == +A ? { valid: !0, data: g } : { valid: !1 };
|
|
12130
12169
|
}
|
|
12131
|
-
class
|
|
12170
|
+
class BI extends K {
|
|
12132
12171
|
_parse(A) {
|
|
12133
12172
|
const { status: I, ctx: B } = this._processInputParams(A), C = (Q, E) => {
|
|
12134
|
-
if (
|
|
12173
|
+
if (og(Q) || og(E))
|
|
12135
12174
|
return Y;
|
|
12136
|
-
const i =
|
|
12137
|
-
return i.valid ? ((
|
|
12175
|
+
const i = Dg(Q.value, E.value);
|
|
12176
|
+
return i.valid ? ((ag(Q) || ag(E)) && I.dirty(), { status: I.value, value: i.data }) : (F(B, {
|
|
12138
12177
|
code: e.invalid_intersection_types
|
|
12139
12178
|
}), Y);
|
|
12140
12179
|
};
|
|
@@ -12160,7 +12199,7 @@ class gI extends K {
|
|
|
12160
12199
|
}));
|
|
12161
12200
|
}
|
|
12162
12201
|
}
|
|
12163
|
-
|
|
12202
|
+
BI.create = (g, A, I) => new BI({
|
|
12164
12203
|
left: g,
|
|
12165
12204
|
right: A,
|
|
12166
12205
|
typeName: J.ZodIntersection,
|
|
@@ -12216,7 +12255,7 @@ sA.create = (g, A) => {
|
|
|
12216
12255
|
...M(A)
|
|
12217
12256
|
});
|
|
12218
12257
|
};
|
|
12219
|
-
class
|
|
12258
|
+
class CI extends K {
|
|
12220
12259
|
get keySchema() {
|
|
12221
12260
|
return this._def.keyType;
|
|
12222
12261
|
}
|
|
@@ -12244,12 +12283,12 @@ class BI extends K {
|
|
|
12244
12283
|
return this._def.valueType;
|
|
12245
12284
|
}
|
|
12246
12285
|
static create(A, I, B) {
|
|
12247
|
-
return I instanceof K ? new
|
|
12286
|
+
return I instanceof K ? new CI({
|
|
12248
12287
|
keyType: A,
|
|
12249
12288
|
valueType: I,
|
|
12250
12289
|
typeName: J.ZodRecord,
|
|
12251
12290
|
...M(B)
|
|
12252
|
-
}) : new
|
|
12291
|
+
}) : new CI({
|
|
12253
12292
|
keyType: gA.create(),
|
|
12254
12293
|
valueType: A,
|
|
12255
12294
|
typeName: J.ZodRecord,
|
|
@@ -12257,7 +12296,7 @@ class BI extends K {
|
|
|
12257
12296
|
});
|
|
12258
12297
|
}
|
|
12259
12298
|
}
|
|
12260
|
-
class
|
|
12299
|
+
class qI extends K {
|
|
12261
12300
|
get keySchema() {
|
|
12262
12301
|
return this._def.keyType;
|
|
12263
12302
|
}
|
|
@@ -12299,7 +12338,7 @@ class KI extends K {
|
|
|
12299
12338
|
}
|
|
12300
12339
|
}
|
|
12301
12340
|
}
|
|
12302
|
-
|
|
12341
|
+
qI.create = (g, A, I) => new qI({
|
|
12303
12342
|
valueType: A,
|
|
12304
12343
|
keyType: g,
|
|
12305
12344
|
typeName: J.ZodMap,
|
|
@@ -12382,13 +12421,13 @@ class KA extends K {
|
|
|
12382
12421
|
received: I.parsedType
|
|
12383
12422
|
}), Y;
|
|
12384
12423
|
function B(i, o) {
|
|
12385
|
-
return
|
|
12424
|
+
return dI({
|
|
12386
12425
|
data: i,
|
|
12387
12426
|
path: I.path,
|
|
12388
12427
|
errorMaps: [
|
|
12389
12428
|
I.common.contextualErrorMap,
|
|
12390
12429
|
I.schemaErrorMap,
|
|
12391
|
-
|
|
12430
|
+
YI(),
|
|
12392
12431
|
lA
|
|
12393
12432
|
].filter((a) => !!a),
|
|
12394
12433
|
issueData: {
|
|
@@ -12398,13 +12437,13 @@ class KA extends K {
|
|
|
12398
12437
|
});
|
|
12399
12438
|
}
|
|
12400
12439
|
function C(i, o) {
|
|
12401
|
-
return
|
|
12440
|
+
return dI({
|
|
12402
12441
|
data: i,
|
|
12403
12442
|
path: I.path,
|
|
12404
12443
|
errorMaps: [
|
|
12405
12444
|
I.common.contextualErrorMap,
|
|
12406
12445
|
I.schemaErrorMap,
|
|
12407
|
-
|
|
12446
|
+
YI(),
|
|
12408
12447
|
lA
|
|
12409
12448
|
].filter((a) => !!a),
|
|
12410
12449
|
issueData: {
|
|
@@ -12470,7 +12509,7 @@ class KA extends K {
|
|
|
12470
12509
|
});
|
|
12471
12510
|
}
|
|
12472
12511
|
}
|
|
12473
|
-
class
|
|
12512
|
+
class QI extends K {
|
|
12474
12513
|
get schema() {
|
|
12475
12514
|
return this._def.getter();
|
|
12476
12515
|
}
|
|
@@ -12479,12 +12518,12 @@ class CI extends K {
|
|
|
12479
12518
|
return this._def.getter()._parse({ data: I.data, path: I.path, parent: I });
|
|
12480
12519
|
}
|
|
12481
12520
|
}
|
|
12482
|
-
|
|
12521
|
+
QI.create = (g, A) => new QI({
|
|
12483
12522
|
getter: g,
|
|
12484
12523
|
typeName: J.ZodLazy,
|
|
12485
12524
|
...M(A)
|
|
12486
12525
|
});
|
|
12487
|
-
class
|
|
12526
|
+
class EI extends K {
|
|
12488
12527
|
_parse(A) {
|
|
12489
12528
|
if (A.data !== this._def.value) {
|
|
12490
12529
|
const I = this._getOrReturnCtx(A);
|
|
@@ -12500,19 +12539,19 @@ class QI extends K {
|
|
|
12500
12539
|
return this._def.value;
|
|
12501
12540
|
}
|
|
12502
12541
|
}
|
|
12503
|
-
|
|
12542
|
+
EI.create = (g, A) => new EI({
|
|
12504
12543
|
value: g,
|
|
12505
12544
|
typeName: J.ZodLiteral,
|
|
12506
12545
|
...M(A)
|
|
12507
12546
|
});
|
|
12508
12547
|
function zB(g, A) {
|
|
12509
|
-
return new
|
|
12548
|
+
return new nA({
|
|
12510
12549
|
values: g,
|
|
12511
12550
|
typeName: J.ZodEnum,
|
|
12512
12551
|
...M(A)
|
|
12513
12552
|
});
|
|
12514
12553
|
}
|
|
12515
|
-
class
|
|
12554
|
+
class nA extends K {
|
|
12516
12555
|
constructor() {
|
|
12517
12556
|
super(...arguments), bA.set(this, void 0);
|
|
12518
12557
|
}
|
|
@@ -12525,7 +12564,7 @@ class wA extends K {
|
|
|
12525
12564
|
code: e.invalid_type
|
|
12526
12565
|
}), Y;
|
|
12527
12566
|
}
|
|
12528
|
-
if (
|
|
12567
|
+
if (MI(this, bA) || VB(this, bA, new Set(this._def.values)), !MI(this, bA).has(A.data)) {
|
|
12529
12568
|
const I = this._getOrReturnCtx(A), B = this._def.values;
|
|
12530
12569
|
return F(I, {
|
|
12531
12570
|
received: I.data,
|
|
@@ -12557,21 +12596,21 @@ class wA extends K {
|
|
|
12557
12596
|
return A;
|
|
12558
12597
|
}
|
|
12559
12598
|
extract(A, I = this._def) {
|
|
12560
|
-
return
|
|
12599
|
+
return nA.create(A, {
|
|
12561
12600
|
...this._def,
|
|
12562
12601
|
...I
|
|
12563
12602
|
});
|
|
12564
12603
|
}
|
|
12565
12604
|
exclude(A, I = this._def) {
|
|
12566
|
-
return
|
|
12605
|
+
return nA.create(this.options.filter((B) => !A.includes(B)), {
|
|
12567
12606
|
...this._def,
|
|
12568
12607
|
...I
|
|
12569
12608
|
});
|
|
12570
12609
|
}
|
|
12571
12610
|
}
|
|
12572
12611
|
bA = /* @__PURE__ */ new WeakMap();
|
|
12573
|
-
|
|
12574
|
-
class
|
|
12612
|
+
nA.create = zB;
|
|
12613
|
+
class iI extends K {
|
|
12575
12614
|
constructor() {
|
|
12576
12615
|
super(...arguments), ZA.set(this, void 0);
|
|
12577
12616
|
}
|
|
@@ -12585,7 +12624,7 @@ class EI extends K {
|
|
|
12585
12624
|
code: e.invalid_type
|
|
12586
12625
|
}), Y;
|
|
12587
12626
|
}
|
|
12588
|
-
if (
|
|
12627
|
+
if (MI(this, ZA) || VB(this, ZA, new Set(H.getValidEnumValues(this._def.values))), !MI(this, ZA).has(A.data)) {
|
|
12589
12628
|
const C = H.objectValues(I);
|
|
12590
12629
|
return F(B, {
|
|
12591
12630
|
received: B.data,
|
|
@@ -12600,7 +12639,7 @@ class EI extends K {
|
|
|
12600
12639
|
}
|
|
12601
12640
|
}
|
|
12602
12641
|
ZA = /* @__PURE__ */ new WeakMap();
|
|
12603
|
-
|
|
12642
|
+
iI.create = (g, A) => new iI({
|
|
12604
12643
|
values: g,
|
|
12605
12644
|
typeName: J.ZodNativeEnum,
|
|
12606
12645
|
...M(A)
|
|
@@ -12731,7 +12770,7 @@ aA.create = (g, A) => new aA({
|
|
|
12731
12770
|
typeName: J.ZodOptional,
|
|
12732
12771
|
...M(A)
|
|
12733
12772
|
});
|
|
12734
|
-
class
|
|
12773
|
+
class wA extends K {
|
|
12735
12774
|
_parse(A) {
|
|
12736
12775
|
return this._getType(A) === S.null ? j(null) : this._def.innerType._parse(A);
|
|
12737
12776
|
}
|
|
@@ -12739,12 +12778,12 @@ class nA extends K {
|
|
|
12739
12778
|
return this._def.innerType;
|
|
12740
12779
|
}
|
|
12741
12780
|
}
|
|
12742
|
-
|
|
12781
|
+
wA.create = (g, A) => new wA({
|
|
12743
12782
|
innerType: g,
|
|
12744
12783
|
typeName: J.ZodNullable,
|
|
12745
12784
|
...M(A)
|
|
12746
12785
|
});
|
|
12747
|
-
class
|
|
12786
|
+
class oI extends K {
|
|
12748
12787
|
_parse(A) {
|
|
12749
12788
|
const { ctx: I } = this._processInputParams(A);
|
|
12750
12789
|
let B = I.data;
|
|
@@ -12758,13 +12797,13 @@ class iI extends K {
|
|
|
12758
12797
|
return this._def.innerType;
|
|
12759
12798
|
}
|
|
12760
12799
|
}
|
|
12761
|
-
|
|
12800
|
+
oI.create = (g, A) => new oI({
|
|
12762
12801
|
innerType: g,
|
|
12763
12802
|
typeName: J.ZodDefault,
|
|
12764
12803
|
defaultValue: typeof A.default == "function" ? A.default : () => A.default,
|
|
12765
12804
|
...M(A)
|
|
12766
12805
|
});
|
|
12767
|
-
class
|
|
12806
|
+
class aI extends K {
|
|
12768
12807
|
_parse(A) {
|
|
12769
12808
|
const { ctx: I } = this._processInputParams(A), B = {
|
|
12770
12809
|
...I,
|
|
@@ -12779,7 +12818,7 @@ class oI extends K {
|
|
|
12779
12818
|
...B
|
|
12780
12819
|
}
|
|
12781
12820
|
});
|
|
12782
|
-
return
|
|
12821
|
+
return _A(C) ? C.then((Q) => ({
|
|
12783
12822
|
status: "valid",
|
|
12784
12823
|
value: Q.status === "valid" ? Q.value : this._def.catchValue({
|
|
12785
12824
|
get error() {
|
|
@@ -12801,13 +12840,13 @@ class oI extends K {
|
|
|
12801
12840
|
return this._def.innerType;
|
|
12802
12841
|
}
|
|
12803
12842
|
}
|
|
12804
|
-
|
|
12843
|
+
aI.create = (g, A) => new aI({
|
|
12805
12844
|
innerType: g,
|
|
12806
12845
|
typeName: J.ZodCatch,
|
|
12807
12846
|
catchValue: typeof A.catch == "function" ? A.catch : () => A.catch,
|
|
12808
12847
|
...M(A)
|
|
12809
12848
|
});
|
|
12810
|
-
class
|
|
12849
|
+
class lI extends K {
|
|
12811
12850
|
_parse(A) {
|
|
12812
12851
|
if (this._getType(A) !== S.nan) {
|
|
12813
12852
|
const B = this._getOrReturnCtx(A);
|
|
@@ -12820,12 +12859,12 @@ class HI extends K {
|
|
|
12820
12859
|
return { status: "valid", value: A.data };
|
|
12821
12860
|
}
|
|
12822
12861
|
}
|
|
12823
|
-
|
|
12862
|
+
lI.create = (g) => new lI({
|
|
12824
12863
|
typeName: J.ZodNaN,
|
|
12825
12864
|
...M(g)
|
|
12826
12865
|
});
|
|
12827
|
-
const
|
|
12828
|
-
class
|
|
12866
|
+
const wi = Symbol("zod_brand");
|
|
12867
|
+
class Hg extends K {
|
|
12829
12868
|
_parse(A) {
|
|
12830
12869
|
const { ctx: I } = this._processInputParams(A), B = I.data;
|
|
12831
12870
|
return this._def.type._parse({
|
|
@@ -12838,7 +12877,7 @@ class Kg extends K {
|
|
|
12838
12877
|
return this._def.type;
|
|
12839
12878
|
}
|
|
12840
12879
|
}
|
|
12841
|
-
class
|
|
12880
|
+
class GI extends K {
|
|
12842
12881
|
_parse(A) {
|
|
12843
12882
|
const { status: I, ctx: B } = this._processInputParams(A);
|
|
12844
12883
|
if (B.common.async)
|
|
@@ -12871,23 +12910,23 @@ class eI extends K {
|
|
|
12871
12910
|
}
|
|
12872
12911
|
}
|
|
12873
12912
|
static create(A, I) {
|
|
12874
|
-
return new
|
|
12913
|
+
return new GI({
|
|
12875
12914
|
in: A,
|
|
12876
12915
|
out: I,
|
|
12877
12916
|
typeName: J.ZodPipeline
|
|
12878
12917
|
});
|
|
12879
12918
|
}
|
|
12880
12919
|
}
|
|
12881
|
-
class
|
|
12920
|
+
class DI extends K {
|
|
12882
12921
|
_parse(A) {
|
|
12883
12922
|
const I = this._def.innerType._parse(A), B = (C) => (kA(C) && (C.value = Object.freeze(C.value)), C);
|
|
12884
|
-
return
|
|
12923
|
+
return _A(I) ? I.then((C) => B(C)) : B(I);
|
|
12885
12924
|
}
|
|
12886
12925
|
unwrap() {
|
|
12887
12926
|
return this._def.innerType;
|
|
12888
12927
|
}
|
|
12889
12928
|
}
|
|
12890
|
-
|
|
12929
|
+
DI.create = (g, A) => new DI({
|
|
12891
12930
|
innerType: g,
|
|
12892
12931
|
typeName: J.ZodReadonly,
|
|
12893
12932
|
...M(A)
|
|
@@ -12923,10 +12962,10 @@ var J;
|
|
|
12923
12962
|
})(J || (J = {}));
|
|
12924
12963
|
const ri = (g, A = {
|
|
12925
12964
|
message: `Input not instance of ${g.name}`
|
|
12926
|
-
}) => _B((I) => I instanceof g, A), $B = gA.create, AC = eA.create, Si =
|
|
12965
|
+
}) => _B((I) => I instanceof g, A), $B = gA.create, AC = eA.create, Si = lI.create, Ri = GA.create, IC = $A.create, Ni = LA.create, ci = KI.create, Ui = AI.create, ki = II.create, Li = fA.create, Ji = NA.create, Yi = yA.create, di = HI.create, Mi = QA.create, Ki = m.create, Hi = m.strictCreate, qi = gI.create, li = WI.create, fi = BI.create, pi = sA.create, mi = CI.create, ui = qI.create, Ti = JA.create, Wi = KA.create, xi = QI.create, bi = EI.create, Zi = nA.create, Pi = iI.create, Oi = pA.create, RB = EA.create, Vi = aA.create, vi = wA.create, Xi = EA.createWithPreprocess, ji = GI.create, zi = () => $B().optional(), _i = () => AC().optional(), $i = () => IC().optional(), Ao = {
|
|
12927
12966
|
string: (g) => gA.create({ ...g, coerce: !0 }),
|
|
12928
12967
|
number: (g) => eA.create({ ...g, coerce: !0 }),
|
|
12929
|
-
boolean: (g) =>
|
|
12968
|
+
boolean: (g) => $A.create({
|
|
12930
12969
|
...g,
|
|
12931
12970
|
coerce: !0
|
|
12932
12971
|
}),
|
|
@@ -12937,23 +12976,23 @@ var s = /* @__PURE__ */ Object.freeze({
|
|
|
12937
12976
|
__proto__: null,
|
|
12938
12977
|
defaultErrorMap: lA,
|
|
12939
12978
|
setErrorMap: XE,
|
|
12940
|
-
getErrorMap:
|
|
12941
|
-
makeIssue:
|
|
12979
|
+
getErrorMap: YI,
|
|
12980
|
+
makeIssue: dI,
|
|
12942
12981
|
EMPTY_PATH: jE,
|
|
12943
12982
|
addIssueToContext: F,
|
|
12944
12983
|
ParseStatus: X,
|
|
12945
12984
|
INVALID: Y,
|
|
12946
12985
|
DIRTY: MA,
|
|
12947
12986
|
OK: j,
|
|
12948
|
-
isAborted:
|
|
12949
|
-
isDirty:
|
|
12987
|
+
isAborted: og,
|
|
12988
|
+
isDirty: ag,
|
|
12950
12989
|
isValid: kA,
|
|
12951
|
-
isAsync:
|
|
12990
|
+
isAsync: _A,
|
|
12952
12991
|
get util() {
|
|
12953
12992
|
return H;
|
|
12954
12993
|
},
|
|
12955
12994
|
get objectUtil() {
|
|
12956
|
-
return
|
|
12995
|
+
return ig;
|
|
12957
12996
|
},
|
|
12958
12997
|
ZodParsedType: S,
|
|
12959
12998
|
getParsedType: tA,
|
|
@@ -12962,41 +13001,41 @@ var s = /* @__PURE__ */ Object.freeze({
|
|
|
12962
13001
|
ZodString: gA,
|
|
12963
13002
|
ZodNumber: eA,
|
|
12964
13003
|
ZodBigInt: GA,
|
|
12965
|
-
ZodBoolean:
|
|
13004
|
+
ZodBoolean: $A,
|
|
12966
13005
|
ZodDate: LA,
|
|
12967
|
-
ZodSymbol:
|
|
12968
|
-
ZodUndefined:
|
|
12969
|
-
ZodNull:
|
|
13006
|
+
ZodSymbol: KI,
|
|
13007
|
+
ZodUndefined: AI,
|
|
13008
|
+
ZodNull: II,
|
|
12970
13009
|
ZodAny: fA,
|
|
12971
13010
|
ZodUnknown: NA,
|
|
12972
13011
|
ZodNever: yA,
|
|
12973
|
-
ZodVoid:
|
|
13012
|
+
ZodVoid: HI,
|
|
12974
13013
|
ZodArray: QA,
|
|
12975
13014
|
ZodObject: m,
|
|
12976
|
-
ZodUnion:
|
|
12977
|
-
ZodDiscriminatedUnion:
|
|
12978
|
-
ZodIntersection:
|
|
13015
|
+
ZodUnion: gI,
|
|
13016
|
+
ZodDiscriminatedUnion: WI,
|
|
13017
|
+
ZodIntersection: BI,
|
|
12979
13018
|
ZodTuple: sA,
|
|
12980
|
-
ZodRecord:
|
|
12981
|
-
ZodMap:
|
|
13019
|
+
ZodRecord: CI,
|
|
13020
|
+
ZodMap: qI,
|
|
12982
13021
|
ZodSet: JA,
|
|
12983
13022
|
ZodFunction: KA,
|
|
12984
|
-
ZodLazy:
|
|
12985
|
-
ZodLiteral:
|
|
12986
|
-
ZodEnum:
|
|
12987
|
-
ZodNativeEnum:
|
|
13023
|
+
ZodLazy: QI,
|
|
13024
|
+
ZodLiteral: EI,
|
|
13025
|
+
ZodEnum: nA,
|
|
13026
|
+
ZodNativeEnum: iI,
|
|
12988
13027
|
ZodPromise: pA,
|
|
12989
13028
|
ZodEffects: EA,
|
|
12990
13029
|
ZodTransformer: EA,
|
|
12991
13030
|
ZodOptional: aA,
|
|
12992
|
-
ZodNullable:
|
|
12993
|
-
ZodDefault:
|
|
12994
|
-
ZodCatch:
|
|
12995
|
-
ZodNaN:
|
|
12996
|
-
BRAND:
|
|
12997
|
-
ZodBranded:
|
|
12998
|
-
ZodPipeline:
|
|
12999
|
-
ZodReadonly:
|
|
13031
|
+
ZodNullable: wA,
|
|
13032
|
+
ZodDefault: oI,
|
|
13033
|
+
ZodCatch: aI,
|
|
13034
|
+
ZodNaN: lI,
|
|
13035
|
+
BRAND: wi,
|
|
13036
|
+
ZodBranded: Hg,
|
|
13037
|
+
ZodPipeline: GI,
|
|
13038
|
+
ZodReadonly: DI,
|
|
13000
13039
|
custom: _B,
|
|
13001
13040
|
Schema: K,
|
|
13002
13041
|
ZodSchema: K,
|
|
@@ -13468,7 +13507,7 @@ function Do(g) {
|
|
|
13468
13507
|
if ("version" in A && typeof A.version == "string" && ao.has(A.version))
|
|
13469
13508
|
return A.version;
|
|
13470
13509
|
}
|
|
13471
|
-
function
|
|
13510
|
+
function qg(g) {
|
|
13472
13511
|
const A = Do(g);
|
|
13473
13512
|
return A === void 0 ? "0.4" : A;
|
|
13474
13513
|
}
|
|
@@ -13486,7 +13525,7 @@ function gC(g, A) {
|
|
|
13486
13525
|
return delete I[A], I;
|
|
13487
13526
|
}
|
|
13488
13527
|
async function Mo(g, A) {
|
|
13489
|
-
const I = new WA(g), B = new z(I), C = mA(A), Q = await
|
|
13528
|
+
const I = new WA(g), B = new z(I), C = mA(A), Q = await eI(B, C);
|
|
13490
13529
|
try {
|
|
13491
13530
|
return so(Q.attrs);
|
|
13492
13531
|
} catch {
|
|
@@ -13497,7 +13536,7 @@ ${JSON.stringify(Q.attrs)}`
|
|
|
13497
13536
|
}
|
|
13498
13537
|
}
|
|
13499
13538
|
function so(g) {
|
|
13500
|
-
switch (
|
|
13539
|
+
switch (qg(g)) {
|
|
13501
13540
|
case "0.5":
|
|
13502
13541
|
return {
|
|
13503
13542
|
...Eo.parse(g).ome,
|
|
@@ -13531,7 +13570,7 @@ function to(g) {
|
|
|
13531
13570
|
};
|
|
13532
13571
|
}
|
|
13533
13572
|
function yo(g) {
|
|
13534
|
-
switch (
|
|
13573
|
+
switch (qg(g)) {
|
|
13535
13574
|
case "0.5":
|
|
13536
13575
|
return {
|
|
13537
13576
|
...io.parse(g).ome,
|
|
@@ -13545,7 +13584,7 @@ function yo(g) {
|
|
|
13545
13584
|
}
|
|
13546
13585
|
}
|
|
13547
13586
|
async function Ko(g, A, I) {
|
|
13548
|
-
const B = g + "/" + A, C = new WA(B), Q = new z(C), E = mA(I), i = await
|
|
13587
|
+
const B = g + "/" + A, C = new WA(B), Q = new z(C), E = mA(I), i = await eI(Q, E);
|
|
13549
13588
|
try {
|
|
13550
13589
|
return yo(i.attrs);
|
|
13551
13590
|
} catch {
|
|
@@ -13556,12 +13595,12 @@ ${JSON.stringify(i.attrs)}`
|
|
|
13556
13595
|
}
|
|
13557
13596
|
}
|
|
13558
13597
|
async function Ho(g) {
|
|
13559
|
-
const A = mA(g.version), I = await
|
|
13560
|
-
return
|
|
13598
|
+
const A = mA(g.version), I = await eI(g.location, A);
|
|
13599
|
+
return lg(I.attrs).omero?.channels ?? [];
|
|
13561
13600
|
}
|
|
13562
13601
|
async function qo(g) {
|
|
13563
|
-
const A = mA(g.version), I = await
|
|
13564
|
-
return
|
|
13602
|
+
const A = mA(g.version), I = await eI(g.location, A);
|
|
13603
|
+
return lg(I.attrs).omero?.rdefs;
|
|
13565
13604
|
}
|
|
13566
13605
|
function eo(g) {
|
|
13567
13606
|
return {
|
|
@@ -13573,7 +13612,7 @@ function eo(g) {
|
|
|
13573
13612
|
};
|
|
13574
13613
|
}
|
|
13575
13614
|
function Go(g) {
|
|
13576
|
-
switch (
|
|
13615
|
+
switch (qg(g)) {
|
|
13577
13616
|
case "0.5":
|
|
13578
13617
|
return {
|
|
13579
13618
|
...Qo.parse(g).ome,
|
|
@@ -13586,7 +13625,7 @@ function Go(g) {
|
|
|
13586
13625
|
};
|
|
13587
13626
|
}
|
|
13588
13627
|
}
|
|
13589
|
-
function
|
|
13628
|
+
function lg(g) {
|
|
13590
13629
|
try {
|
|
13591
13630
|
return Go(g);
|
|
13592
13631
|
} catch {
|
|
@@ -13594,7 +13633,7 @@ function qg(g) {
|
|
|
13594
13633
|
${JSON.stringify(g)}`);
|
|
13595
13634
|
}
|
|
13596
13635
|
}
|
|
13597
|
-
class
|
|
13636
|
+
class rI {
|
|
13598
13637
|
location;
|
|
13599
13638
|
version;
|
|
13600
13639
|
constructor(A) {
|
|
@@ -13602,7 +13641,7 @@ class FI {
|
|
|
13602
13641
|
}
|
|
13603
13642
|
async open() {
|
|
13604
13643
|
let A = mA(this.version);
|
|
13605
|
-
const I = await
|
|
13644
|
+
const I = await eI(this.location, A), B = lg(I.attrs), C = B.multiscales;
|
|
13606
13645
|
if (C.length !== 1)
|
|
13607
13646
|
throw new Error(
|
|
13608
13647
|
`Exactly one multiscale image is supported. Found ${C.length} images.`
|
|
@@ -13634,7 +13673,7 @@ class FI {
|
|
|
13634
13673
|
*/
|
|
13635
13674
|
static fromHttp(A) {
|
|
13636
13675
|
const I = new WA(A.url);
|
|
13637
|
-
return new
|
|
13676
|
+
return new rI({
|
|
13638
13677
|
location: new z(I),
|
|
13639
13678
|
version: A.version
|
|
13640
13679
|
});
|
|
@@ -13650,8 +13689,8 @@ class FI {
|
|
|
13650
13689
|
* @param useSuffixRequest Whether to use suffix requests for range queries
|
|
13651
13690
|
*/
|
|
13652
13691
|
static fromS3(A) {
|
|
13653
|
-
const I = new
|
|
13654
|
-
return new
|
|
13692
|
+
const I = new Kg(A);
|
|
13693
|
+
return new rI({
|
|
13655
13694
|
location: new z(I),
|
|
13656
13695
|
version: A.version
|
|
13657
13696
|
});
|
|
@@ -13666,8 +13705,8 @@ class FI {
|
|
|
13666
13705
|
* ask the user once for permission to the root directory
|
|
13667
13706
|
*/
|
|
13668
13707
|
static fromFileSystem(A) {
|
|
13669
|
-
const I = new
|
|
13670
|
-
return new
|
|
13708
|
+
const I = new Mg(A.directory);
|
|
13709
|
+
return new rI({
|
|
13671
13710
|
location: new z(I, A.path),
|
|
13672
13711
|
version: A.version
|
|
13673
13712
|
});
|
|
@@ -13680,8 +13719,8 @@ const BC = [
|
|
|
13680
13719
|
"fallbackBackground",
|
|
13681
13720
|
"prefetchSpace"
|
|
13682
13721
|
];
|
|
13683
|
-
function
|
|
13684
|
-
|
|
13722
|
+
function fg(g) {
|
|
13723
|
+
no(g);
|
|
13685
13724
|
const A = {
|
|
13686
13725
|
x: g.prefetch.x,
|
|
13687
13726
|
y: g.prefetch.y,
|
|
@@ -13709,7 +13748,7 @@ function lg(g) {
|
|
|
13709
13748
|
return Object.freeze(C);
|
|
13710
13749
|
}
|
|
13711
13750
|
function lo(g = {}) {
|
|
13712
|
-
return
|
|
13751
|
+
return fg(pg({
|
|
13713
13752
|
profile: "exploration",
|
|
13714
13753
|
prefetch: { x: 1, y: 1, z: 1, t: 0 },
|
|
13715
13754
|
priorityOrder: [
|
|
@@ -13722,7 +13761,7 @@ function lo(g = {}) {
|
|
|
13722
13761
|
}, g));
|
|
13723
13762
|
}
|
|
13724
13763
|
function fo(g = {}) {
|
|
13725
|
-
return
|
|
13764
|
+
return fg(pg({
|
|
13726
13765
|
profile: "playback",
|
|
13727
13766
|
prefetch: { x: 0, y: 0, z: 0, t: 20 },
|
|
13728
13767
|
priorityOrder: [
|
|
@@ -13735,7 +13774,7 @@ function fo(g = {}) {
|
|
|
13735
13774
|
}, g));
|
|
13736
13775
|
}
|
|
13737
13776
|
function po(g = {}) {
|
|
13738
|
-
return
|
|
13777
|
+
return fg(pg({
|
|
13739
13778
|
profile: "no-prefetch",
|
|
13740
13779
|
prefetch: { x: 0, y: 0, z: 0, t: 0 },
|
|
13741
13780
|
priorityOrder: [
|
|
@@ -13747,7 +13786,7 @@ function po(g = {}) {
|
|
|
13747
13786
|
]
|
|
13748
13787
|
}, g));
|
|
13749
13788
|
}
|
|
13750
|
-
function
|
|
13789
|
+
function no(g) {
|
|
13751
13790
|
for (const [B, C] of Object.entries(g.prefetch))
|
|
13752
13791
|
if (C !== void 0 && C < 0)
|
|
13753
13792
|
throw new Error(`prefetch.${B} must be a non-negative number`);
|
|
@@ -13758,7 +13797,7 @@ function wo(g) {
|
|
|
13758
13797
|
if (I.length !== BC.length || new Set(I).size !== I.length)
|
|
13759
13798
|
throw new Error("priorityOrder must include all categories exactly once");
|
|
13760
13799
|
}
|
|
13761
|
-
function
|
|
13800
|
+
function pg(g, A = {}) {
|
|
13762
13801
|
return {
|
|
13763
13802
|
profile: A.profile ?? g.profile,
|
|
13764
13803
|
prefetch: { ...g.prefetch, ...A.prefetch ?? {} },
|
|
@@ -13831,14 +13870,14 @@ export {
|
|
|
13831
13870
|
RA as Box3,
|
|
13832
13871
|
HB as ChunkedImageLayer,
|
|
13833
13872
|
l as Color,
|
|
13834
|
-
|
|
13835
|
-
|
|
13873
|
+
nQ as Frustum,
|
|
13874
|
+
wo as Idetik,
|
|
13836
13875
|
ko as ImageLayer,
|
|
13837
13876
|
Jo as ImageSeriesLayer,
|
|
13838
13877
|
Lo as LabelImageLayer,
|
|
13839
13878
|
FA as Layer,
|
|
13840
13879
|
EQ as LayerManager,
|
|
13841
|
-
|
|
13880
|
+
rI as OmeZarrImageSource,
|
|
13842
13881
|
Fo as OrthographicCamera,
|
|
13843
13882
|
So as PanZoomControls,
|
|
13844
13883
|
ro as PerspectiveCamera,
|
|
@@ -13846,14 +13885,14 @@ export {
|
|
|
13846
13885
|
uo as Points,
|
|
13847
13886
|
No as ProjectedLineLayer,
|
|
13848
13887
|
mo as Spherical,
|
|
13849
|
-
|
|
13888
|
+
sI as Texture2DArray,
|
|
13850
13889
|
wg as Texture3D,
|
|
13851
13890
|
co as TracksLayer,
|
|
13852
13891
|
DQ as Viewport,
|
|
13853
13892
|
Uo as VolumeLayer,
|
|
13854
13893
|
_C as WebGLRenderer,
|
|
13855
13894
|
lo as createExplorationPolicy,
|
|
13856
|
-
|
|
13895
|
+
fg as createImageSourcePolicy,
|
|
13857
13896
|
po as createNoPrefetchPolicy,
|
|
13858
13897
|
fo as createPlaybackPolicy,
|
|
13859
13898
|
Mo as loadOmeZarrPlate,
|