@idetik/core 0.16.0 → 0.16.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.d.ts +1 -1
- package/dist/index.js +502 -759
- package/dist/index.js.map +1 -1
- package/dist/index.umd.cjs +28 -28
- package/dist/index.umd.cjs.map +1 -1
- package/dist/types/src/core/node.d.ts +1 -1
- package/dist/types/src/core/node.d.ts.map +1 -1
- package/dist/types/src/utilities/id_generator.d.ts +2 -0
- package/dist/types/src/utilities/id_generator.d.ts.map +1 -0
- package/package.json +1 -1
- package/dist/types/src/utilities/uuid_generator.d.ts +0 -2
- package/dist/types/src/utilities/uuid_generator.d.ts.map +0 -1
package/dist/index.js
CHANGED
|
@@ -176,7 +176,7 @@ uniform vec3 LineColor;
|
|
|
176
176
|
|
|
177
177
|
void main() {
|
|
178
178
|
fragColor = vec4(LineColor, 1.0);
|
|
179
|
-
}`,
|
|
179
|
+
}`, FA = `#version 300 es
|
|
180
180
|
|
|
181
181
|
layout (location = 0) in vec3 inPosition;
|
|
182
182
|
layout (location = 1) in vec3 inNormal;
|
|
@@ -572,35 +572,35 @@ const wC = {
|
|
|
572
572
|
fragment: GC
|
|
573
573
|
},
|
|
574
574
|
floatScalarImage: {
|
|
575
|
-
vertex:
|
|
575
|
+
vertex: FA,
|
|
576
576
|
fragment: ZI
|
|
577
577
|
},
|
|
578
578
|
floatScalarImageArray: {
|
|
579
|
-
vertex:
|
|
579
|
+
vertex: FA,
|
|
580
580
|
fragment: PI
|
|
581
581
|
},
|
|
582
582
|
intScalarImage: {
|
|
583
|
-
vertex:
|
|
583
|
+
vertex: FA,
|
|
584
584
|
fragment: ZI,
|
|
585
585
|
fragmentDefines: /* @__PURE__ */ new Map([["TEXTURE_DATA_TYPE_INT", "1"]])
|
|
586
586
|
},
|
|
587
587
|
intScalarImageArray: {
|
|
588
|
-
vertex:
|
|
588
|
+
vertex: FA,
|
|
589
589
|
fragment: PI,
|
|
590
590
|
fragmentDefines: /* @__PURE__ */ new Map([["TEXTURE_DATA_TYPE_INT", "1"]])
|
|
591
591
|
},
|
|
592
592
|
uintScalarImage: {
|
|
593
|
-
vertex:
|
|
593
|
+
vertex: FA,
|
|
594
594
|
fragment: ZI,
|
|
595
595
|
fragmentDefines: /* @__PURE__ */ new Map([["TEXTURE_DATA_TYPE_UINT", "1"]])
|
|
596
596
|
},
|
|
597
597
|
uintScalarImageArray: {
|
|
598
|
-
vertex:
|
|
598
|
+
vertex: FA,
|
|
599
599
|
fragment: PI,
|
|
600
600
|
fragmentDefines: /* @__PURE__ */ new Map([["TEXTURE_DATA_TYPE_UINT", "1"]])
|
|
601
601
|
},
|
|
602
602
|
labelImage: {
|
|
603
|
-
vertex:
|
|
603
|
+
vertex: FA,
|
|
604
604
|
fragment: nC
|
|
605
605
|
},
|
|
606
606
|
floatVolume: {
|
|
@@ -871,270 +871,13 @@ function Pg(g, A) {
|
|
|
871
871
|
${C}`;
|
|
872
872
|
return g.replace(vI, Q);
|
|
873
873
|
}
|
|
874
|
-
const
|
|
875
|
-
|
|
876
|
-
"
|
|
877
|
-
|
|
878
|
-
"03",
|
|
879
|
-
"04",
|
|
880
|
-
"05",
|
|
881
|
-
"06",
|
|
882
|
-
"07",
|
|
883
|
-
"08",
|
|
884
|
-
"09",
|
|
885
|
-
"0a",
|
|
886
|
-
"0b",
|
|
887
|
-
"0c",
|
|
888
|
-
"0d",
|
|
889
|
-
"0e",
|
|
890
|
-
"0f",
|
|
891
|
-
"10",
|
|
892
|
-
"11",
|
|
893
|
-
"12",
|
|
894
|
-
"13",
|
|
895
|
-
"14",
|
|
896
|
-
"15",
|
|
897
|
-
"16",
|
|
898
|
-
"17",
|
|
899
|
-
"18",
|
|
900
|
-
"19",
|
|
901
|
-
"1a",
|
|
902
|
-
"1b",
|
|
903
|
-
"1c",
|
|
904
|
-
"1d",
|
|
905
|
-
"1e",
|
|
906
|
-
"1f",
|
|
907
|
-
"20",
|
|
908
|
-
"21",
|
|
909
|
-
"22",
|
|
910
|
-
"23",
|
|
911
|
-
"24",
|
|
912
|
-
"25",
|
|
913
|
-
"26",
|
|
914
|
-
"27",
|
|
915
|
-
"28",
|
|
916
|
-
"29",
|
|
917
|
-
"2a",
|
|
918
|
-
"2b",
|
|
919
|
-
"2c",
|
|
920
|
-
"2d",
|
|
921
|
-
"2e",
|
|
922
|
-
"2f",
|
|
923
|
-
"30",
|
|
924
|
-
"31",
|
|
925
|
-
"32",
|
|
926
|
-
"33",
|
|
927
|
-
"34",
|
|
928
|
-
"35",
|
|
929
|
-
"36",
|
|
930
|
-
"37",
|
|
931
|
-
"38",
|
|
932
|
-
"39",
|
|
933
|
-
"3a",
|
|
934
|
-
"3b",
|
|
935
|
-
"3c",
|
|
936
|
-
"3d",
|
|
937
|
-
"3e",
|
|
938
|
-
"3f",
|
|
939
|
-
"40",
|
|
940
|
-
"41",
|
|
941
|
-
"42",
|
|
942
|
-
"43",
|
|
943
|
-
"44",
|
|
944
|
-
"45",
|
|
945
|
-
"46",
|
|
946
|
-
"47",
|
|
947
|
-
"48",
|
|
948
|
-
"49",
|
|
949
|
-
"4a",
|
|
950
|
-
"4b",
|
|
951
|
-
"4c",
|
|
952
|
-
"4d",
|
|
953
|
-
"4e",
|
|
954
|
-
"4f",
|
|
955
|
-
"50",
|
|
956
|
-
"51",
|
|
957
|
-
"52",
|
|
958
|
-
"53",
|
|
959
|
-
"54",
|
|
960
|
-
"55",
|
|
961
|
-
"56",
|
|
962
|
-
"57",
|
|
963
|
-
"58",
|
|
964
|
-
"59",
|
|
965
|
-
"5a",
|
|
966
|
-
"5b",
|
|
967
|
-
"5c",
|
|
968
|
-
"5d",
|
|
969
|
-
"5e",
|
|
970
|
-
"5f",
|
|
971
|
-
"60",
|
|
972
|
-
"61",
|
|
973
|
-
"62",
|
|
974
|
-
"63",
|
|
975
|
-
"64",
|
|
976
|
-
"65",
|
|
977
|
-
"66",
|
|
978
|
-
"67",
|
|
979
|
-
"68",
|
|
980
|
-
"69",
|
|
981
|
-
"6a",
|
|
982
|
-
"6b",
|
|
983
|
-
"6c",
|
|
984
|
-
"6d",
|
|
985
|
-
"6e",
|
|
986
|
-
"6f",
|
|
987
|
-
"70",
|
|
988
|
-
"71",
|
|
989
|
-
"72",
|
|
990
|
-
"73",
|
|
991
|
-
"74",
|
|
992
|
-
"75",
|
|
993
|
-
"76",
|
|
994
|
-
"77",
|
|
995
|
-
"78",
|
|
996
|
-
"79",
|
|
997
|
-
"7a",
|
|
998
|
-
"7b",
|
|
999
|
-
"7c",
|
|
1000
|
-
"7d",
|
|
1001
|
-
"7e",
|
|
1002
|
-
"7f",
|
|
1003
|
-
"80",
|
|
1004
|
-
"81",
|
|
1005
|
-
"82",
|
|
1006
|
-
"83",
|
|
1007
|
-
"84",
|
|
1008
|
-
"85",
|
|
1009
|
-
"86",
|
|
1010
|
-
"87",
|
|
1011
|
-
"88",
|
|
1012
|
-
"89",
|
|
1013
|
-
"8a",
|
|
1014
|
-
"8b",
|
|
1015
|
-
"8c",
|
|
1016
|
-
"8d",
|
|
1017
|
-
"8e",
|
|
1018
|
-
"8f",
|
|
1019
|
-
"90",
|
|
1020
|
-
"91",
|
|
1021
|
-
"92",
|
|
1022
|
-
"93",
|
|
1023
|
-
"94",
|
|
1024
|
-
"95",
|
|
1025
|
-
"96",
|
|
1026
|
-
"97",
|
|
1027
|
-
"98",
|
|
1028
|
-
"99",
|
|
1029
|
-
"9a",
|
|
1030
|
-
"9b",
|
|
1031
|
-
"9c",
|
|
1032
|
-
"9d",
|
|
1033
|
-
"9e",
|
|
1034
|
-
"9f",
|
|
1035
|
-
"a0",
|
|
1036
|
-
"a1",
|
|
1037
|
-
"a2",
|
|
1038
|
-
"a3",
|
|
1039
|
-
"a4",
|
|
1040
|
-
"a5",
|
|
1041
|
-
"a6",
|
|
1042
|
-
"a7",
|
|
1043
|
-
"a8",
|
|
1044
|
-
"a9",
|
|
1045
|
-
"aa",
|
|
1046
|
-
"ab",
|
|
1047
|
-
"ac",
|
|
1048
|
-
"ad",
|
|
1049
|
-
"ae",
|
|
1050
|
-
"af",
|
|
1051
|
-
"b0",
|
|
1052
|
-
"b1",
|
|
1053
|
-
"b2",
|
|
1054
|
-
"b3",
|
|
1055
|
-
"b4",
|
|
1056
|
-
"b5",
|
|
1057
|
-
"b6",
|
|
1058
|
-
"b7",
|
|
1059
|
-
"b8",
|
|
1060
|
-
"b9",
|
|
1061
|
-
"ba",
|
|
1062
|
-
"bb",
|
|
1063
|
-
"bc",
|
|
1064
|
-
"bd",
|
|
1065
|
-
"be",
|
|
1066
|
-
"bf",
|
|
1067
|
-
"c0",
|
|
1068
|
-
"c1",
|
|
1069
|
-
"c2",
|
|
1070
|
-
"c3",
|
|
1071
|
-
"c4",
|
|
1072
|
-
"c5",
|
|
1073
|
-
"c6",
|
|
1074
|
-
"c7",
|
|
1075
|
-
"c8",
|
|
1076
|
-
"c9",
|
|
1077
|
-
"ca",
|
|
1078
|
-
"cb",
|
|
1079
|
-
"cc",
|
|
1080
|
-
"cd",
|
|
1081
|
-
"ce",
|
|
1082
|
-
"cf",
|
|
1083
|
-
"d0",
|
|
1084
|
-
"d1",
|
|
1085
|
-
"d2",
|
|
1086
|
-
"d3",
|
|
1087
|
-
"d4",
|
|
1088
|
-
"d5",
|
|
1089
|
-
"d6",
|
|
1090
|
-
"d7",
|
|
1091
|
-
"d8",
|
|
1092
|
-
"d9",
|
|
1093
|
-
"da",
|
|
1094
|
-
"db",
|
|
1095
|
-
"dc",
|
|
1096
|
-
"dd",
|
|
1097
|
-
"de",
|
|
1098
|
-
"df",
|
|
1099
|
-
"e0",
|
|
1100
|
-
"e1",
|
|
1101
|
-
"e2",
|
|
1102
|
-
"e3",
|
|
1103
|
-
"e4",
|
|
1104
|
-
"e5",
|
|
1105
|
-
"e6",
|
|
1106
|
-
"e7",
|
|
1107
|
-
"e8",
|
|
1108
|
-
"e9",
|
|
1109
|
-
"ea",
|
|
1110
|
-
"eb",
|
|
1111
|
-
"ec",
|
|
1112
|
-
"ed",
|
|
1113
|
-
"ee",
|
|
1114
|
-
"ef",
|
|
1115
|
-
"f0",
|
|
1116
|
-
"f1",
|
|
1117
|
-
"f2",
|
|
1118
|
-
"f3",
|
|
1119
|
-
"f4",
|
|
1120
|
-
"f5",
|
|
1121
|
-
"f6",
|
|
1122
|
-
"f7",
|
|
1123
|
-
"f8",
|
|
1124
|
-
"f9",
|
|
1125
|
-
"fa",
|
|
1126
|
-
"fb",
|
|
1127
|
-
"fc",
|
|
1128
|
-
"fd",
|
|
1129
|
-
"fe",
|
|
1130
|
-
"ff"
|
|
1131
|
-
];
|
|
1132
|
-
function JB() {
|
|
1133
|
-
const g = Math.random() * 4294967295 | 0, A = Math.random() * 4294967295 | 0, I = Math.random() * 4294967295 | 0, B = Math.random() * 4294967295 | 0;
|
|
1134
|
-
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();
|
|
874
|
+
const FI = {};
|
|
875
|
+
function JB(g) {
|
|
876
|
+
const A = g ?? "";
|
|
877
|
+
return FI[A] = (FI[A] ?? 0) + 1, g ? `${g}-${FI[A]}` : String(FI[A]);
|
|
1135
878
|
}
|
|
1136
879
|
class yg {
|
|
1137
|
-
|
|
880
|
+
id = JB();
|
|
1138
881
|
}
|
|
1139
882
|
var p = 1e-6, P = typeof Float32Array < "u" ? Float32Array : Array, UC = Math.PI / 180;
|
|
1140
883
|
function kC(g) {
|
|
@@ -1152,15 +895,15 @@ function YB() {
|
|
|
1152
895
|
function LC(g, A) {
|
|
1153
896
|
return g[0] = A[0], g[1] = A[1], g[2] = A[2], g[3] = A[4], g[4] = A[5], g[5] = A[6], g[6] = A[8], g[7] = A[9], g[8] = A[10], g;
|
|
1154
897
|
}
|
|
1155
|
-
function
|
|
898
|
+
function z() {
|
|
1156
899
|
var g = new P(16);
|
|
1157
900
|
return P != 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;
|
|
1158
901
|
}
|
|
1159
902
|
function mI(g, A) {
|
|
1160
|
-
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], s = 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, R = I * o - C * E, Y = I * a - Q * E, k = B * o - C * i, L = B * a - Q * i, m = C * a - Q * o, x = s * w - h * n, b = s * r - t * n, O = s * G - y * n, V = h * r - t * w,
|
|
1161
|
-
return T ? (T = 1 / T, g[0] = (i *
|
|
903
|
+
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], s = 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, R = I * o - C * E, Y = I * a - Q * E, k = B * o - C * i, L = B * a - Q * i, m = C * a - Q * o, x = s * w - h * n, b = s * r - t * n, O = s * G - y * n, V = h * r - t * w, EA = h * G - y * w, iA = t * G - y * r, T = c * iA - R * EA + Y * V + k * O - L * b + m * x;
|
|
904
|
+
return T ? (T = 1 / T, g[0] = (i * iA - o * EA + a * V) * T, g[1] = (C * EA - B * iA - Q * V) * T, g[2] = (w * m - r * L + G * k) * T, g[3] = (t * L - h * m - y * k) * T, g[4] = (o * O - E * iA - a * b) * T, g[5] = (I * iA - C * O + Q * b) * T, g[6] = (r * Y - n * m - G * R) * T, g[7] = (s * m - t * Y + y * R) * T, g[8] = (E * EA - i * O + a * x) * T, g[9] = (B * O - I * EA - Q * x) * T, g[10] = (n * L - w * Y + G * c) * T, g[11] = (h * Y - s * L - y * c) * T, g[12] = (i * b - E * V - o * x) * T, g[13] = (I * V - B * b + C * x) * T, g[14] = (w * R - n * k - r * c) * T, g[15] = (s * k - h * R + t * c) * T, g) : null;
|
|
1162
905
|
}
|
|
1163
|
-
function
|
|
906
|
+
function jA(g, A, I) {
|
|
1164
907
|
var B = A[0], C = A[1], Q = A[2], E = A[3], i = A[4], o = A[5], a = A[6], s = 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], R = I[0], Y = I[1], k = I[2], L = I[3];
|
|
1165
908
|
return g[0] = R * B + Y * i + k * h + L * w, g[1] = R * C + Y * o + k * t + L * r, g[2] = R * Q + Y * a + k * y + L * G, g[3] = R * E + Y * s + k * n + L * c, R = I[4], Y = I[5], k = I[6], L = I[7], g[4] = R * B + Y * i + k * h + L * w, g[5] = R * C + Y * o + k * t + L * r, g[6] = R * Q + Y * a + k * y + L * G, g[7] = R * E + Y * s + k * n + L * c, R = I[8], Y = I[9], k = I[10], L = I[11], g[8] = R * B + Y * i + k * h + L * w, g[9] = R * C + Y * o + k * t + L * r, g[10] = R * Q + Y * a + k * y + L * G, g[11] = R * E + Y * s + k * n + L * c, R = I[12], Y = I[13], k = I[14], L = I[15], g[12] = R * B + Y * i + k * h + L * w, g[13] = R * C + Y * o + k * t + L * r, g[14] = R * Q + Y * a + k * y + L * G, g[15] = R * E + Y * s + k * n + L * c, g;
|
|
1166
909
|
}
|
|
@@ -1188,14 +931,14 @@ function qC(g, A, I, B) {
|
|
|
1188
931
|
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 - s * r, g[6] = s * w - h * n, g[7] = 0, g[8] = s, g[9] = h, g[10] = t, g[11] = 0, g[12] = C, g[13] = Q, g[14] = E, g[15] = 1, g;
|
|
1189
932
|
}
|
|
1190
933
|
function lC(g, A) {
|
|
1191
|
-
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], s = 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], R = A[1], Y = A[2], k = A[3], L = A[4], m = A[5], x = A[6], b = A[7], O = A[8], V = A[9],
|
|
1192
|
-
return Math.abs(I - c) <= p * Math.max(1, Math.abs(I), Math.abs(c)) && Math.abs(B - R) <= p * Math.max(1, Math.abs(B), Math.abs(R)) && Math.abs(C - Y) <= p * Math.max(1, Math.abs(C), Math.abs(Y)) && Math.abs(Q - k) <= p * Math.max(1, Math.abs(Q), Math.abs(k)) && Math.abs(E - L) <= p * Math.max(1, Math.abs(E), Math.abs(L)) && Math.abs(i - m) <= p * Math.max(1, Math.abs(i), Math.abs(m)) && Math.abs(o - x) <= p * Math.max(1, Math.abs(o), Math.abs(x)) && Math.abs(a - b) <= p * Math.max(1, Math.abs(a), Math.abs(b)) && Math.abs(s - O) <= p * Math.max(1, Math.abs(s), Math.abs(O)) && Math.abs(h - V) <= p * Math.max(1, Math.abs(h), Math.abs(V)) && Math.abs(t -
|
|
934
|
+
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], s = 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], R = A[1], Y = A[2], k = A[3], L = A[4], m = A[5], x = A[6], b = A[7], O = A[8], V = A[9], EA = A[10], iA = A[11], T = A[12], xg = A[13], Wg = A[14], bg = A[15];
|
|
935
|
+
return Math.abs(I - c) <= p * Math.max(1, Math.abs(I), Math.abs(c)) && Math.abs(B - R) <= p * Math.max(1, Math.abs(B), Math.abs(R)) && Math.abs(C - Y) <= p * Math.max(1, Math.abs(C), Math.abs(Y)) && Math.abs(Q - k) <= p * Math.max(1, Math.abs(Q), Math.abs(k)) && Math.abs(E - L) <= p * Math.max(1, Math.abs(E), Math.abs(L)) && Math.abs(i - m) <= p * Math.max(1, Math.abs(i), Math.abs(m)) && Math.abs(o - x) <= p * Math.max(1, Math.abs(o), Math.abs(x)) && Math.abs(a - b) <= p * Math.max(1, Math.abs(a), Math.abs(b)) && Math.abs(s - O) <= p * Math.max(1, Math.abs(s), Math.abs(O)) && Math.abs(h - V) <= p * Math.max(1, Math.abs(h), Math.abs(V)) && Math.abs(t - EA) <= p * Math.max(1, Math.abs(t), Math.abs(EA)) && Math.abs(y - iA) <= p * Math.max(1, Math.abs(y), Math.abs(iA)) && Math.abs(n - T) <= p * Math.max(1, Math.abs(n), Math.abs(T)) && Math.abs(w - xg) <= p * Math.max(1, Math.abs(w), Math.abs(xg)) && Math.abs(r - Wg) <= p * Math.max(1, Math.abs(r), Math.abs(Wg)) && Math.abs(G - bg) <= p * Math.max(1, Math.abs(G), Math.abs(bg));
|
|
1193
936
|
}
|
|
1194
937
|
function f() {
|
|
1195
938
|
var g = new P(3);
|
|
1196
939
|
return P != Float32Array && (g[0] = 0, g[1] = 0, g[2] = 0), g;
|
|
1197
940
|
}
|
|
1198
|
-
function
|
|
941
|
+
function gA(g) {
|
|
1199
942
|
var A = new P(3);
|
|
1200
943
|
return A[0] = g[0], A[1] = g[1], A[2] = g[2], A;
|
|
1201
944
|
}
|
|
@@ -1207,13 +950,13 @@ function q(g, A, I) {
|
|
|
1207
950
|
var B = new P(3);
|
|
1208
951
|
return B[0] = g, B[1] = A, B[2] = I, B;
|
|
1209
952
|
}
|
|
1210
|
-
function
|
|
953
|
+
function KA(g, A) {
|
|
1211
954
|
return g[0] = A[0], g[1] = A[1], g[2] = A[2], g;
|
|
1212
955
|
}
|
|
1213
|
-
function
|
|
956
|
+
function rA(g, A, I, B) {
|
|
1214
957
|
return g[0] = A, g[1] = I, g[2] = B, g;
|
|
1215
958
|
}
|
|
1216
|
-
function
|
|
959
|
+
function qA(g, A, I) {
|
|
1217
960
|
return g[0] = A[0] + I[0], g[1] = A[1] + I[1], g[2] = A[2] + I[2], g;
|
|
1218
961
|
}
|
|
1219
962
|
function fC(g, A, I) {
|
|
@@ -1222,7 +965,7 @@ function fC(g, A, I) {
|
|
|
1222
965
|
function pC(g, A, I) {
|
|
1223
966
|
return g[0] = A[0] * I[0], g[1] = A[1] * I[1], g[2] = A[2] * I[2], g;
|
|
1224
967
|
}
|
|
1225
|
-
function
|
|
968
|
+
function lA(g, A, I) {
|
|
1226
969
|
return g[0] = A[0] * I, g[1] = A[1] * I, g[2] = A[2] * I, g;
|
|
1227
970
|
}
|
|
1228
971
|
function cI(g, A, I, B) {
|
|
@@ -1272,7 +1015,7 @@ var UI = fC, xC = eg;
|
|
|
1272
1015
|
return A;
|
|
1273
1016
|
};
|
|
1274
1017
|
})();
|
|
1275
|
-
function
|
|
1018
|
+
function fA() {
|
|
1276
1019
|
var g = new P(4);
|
|
1277
1020
|
return P != Float32Array && (g[0] = 0, g[1] = 0, g[2] = 0, g[3] = 0), g;
|
|
1278
1021
|
}
|
|
@@ -1294,12 +1037,12 @@ function PC(g, A) {
|
|
|
1294
1037
|
var I = A[0], B = A[1], C = A[2], Q = A[3], E = I * I + B * B + C * C + Q * Q;
|
|
1295
1038
|
return E > 0 && (E = 1 / Math.sqrt(E)), g[0] = I * E, g[1] = B * E, g[2] = C * E, g[3] = Q * E, g;
|
|
1296
1039
|
}
|
|
1297
|
-
function
|
|
1040
|
+
function zA(g, A, I) {
|
|
1298
1041
|
var B = A[0], C = A[1], Q = A[2], E = A[3];
|
|
1299
1042
|
return 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[3] = I[3] * B + I[7] * C + I[11] * Q + I[15] * E, g;
|
|
1300
1043
|
}
|
|
1301
1044
|
(function() {
|
|
1302
|
-
var g =
|
|
1045
|
+
var g = fA();
|
|
1303
1046
|
return function(A, I, B, C, Q, E) {
|
|
1304
1047
|
var i, o;
|
|
1305
1048
|
for (I || (I = 4), B || (B = 0), C ? o = Math.min(C * I + B, A.length) : o = A.length, i = B; i < o; i += I)
|
|
@@ -1396,7 +1139,7 @@ function zI(g, A) {
|
|
|
1396
1139
|
return A;
|
|
1397
1140
|
};
|
|
1398
1141
|
})();
|
|
1399
|
-
class
|
|
1142
|
+
class SA {
|
|
1400
1143
|
min;
|
|
1401
1144
|
max;
|
|
1402
1145
|
/**
|
|
@@ -1406,10 +1149,10 @@ class RA {
|
|
|
1406
1149
|
* the first element, and avoids biasing toward (0,0,0).
|
|
1407
1150
|
*/
|
|
1408
1151
|
constructor(A, I) {
|
|
1409
|
-
this.min = A ?
|
|
1152
|
+
this.min = A ? gA(A) : q(1 / 0, 1 / 0, 1 / 0), this.max = I ? gA(I) : q(-1 / 0, -1 / 0, -1 / 0);
|
|
1410
1153
|
}
|
|
1411
1154
|
clone() {
|
|
1412
|
-
return new
|
|
1155
|
+
return new SA(this.min, this.max);
|
|
1413
1156
|
}
|
|
1414
1157
|
isEmpty() {
|
|
1415
1158
|
return this.max[0] <= this.min[0] || this.max[1] <= this.min[1] || this.max[2] <= this.min[2];
|
|
@@ -1450,7 +1193,7 @@ const $C = {
|
|
|
1450
1193
|
size: 8,
|
|
1451
1194
|
marker: 9
|
|
1452
1195
|
};
|
|
1453
|
-
class
|
|
1196
|
+
class WA extends yg {
|
|
1454
1197
|
boundingBox_ = null;
|
|
1455
1198
|
primitive_;
|
|
1456
1199
|
attributes_;
|
|
@@ -1488,7 +1231,7 @@ class bA extends yg {
|
|
|
1488
1231
|
const A = this.getAttribute("position");
|
|
1489
1232
|
if (!A || this.vertexCount === 0)
|
|
1490
1233
|
throw new Error("Failed to generate bounding box");
|
|
1491
|
-
const I = (A.offset ?? 0) / Float32Array.BYTES_PER_ELEMENT, B = new
|
|
1234
|
+
const I = (A.offset ?? 0) / Float32Array.BYTES_PER_ELEMENT, B = new SA(), C = f();
|
|
1492
1235
|
for (let Q = 0; Q < this.vertexData_.length; Q += this.stride)
|
|
1493
1236
|
C[0] = this.vertexData_[Q + I + 0], C[1] = this.vertexData_[Q + I + 1], C[2] = this.vertexData_[Q + I + 2], B.expandWithPoint(C);
|
|
1494
1237
|
this.boundingBox_ = B;
|
|
@@ -1801,7 +1544,7 @@ class IQ {
|
|
|
1801
1544
|
return A.type === "Texture3D";
|
|
1802
1545
|
}
|
|
1803
1546
|
}
|
|
1804
|
-
class
|
|
1547
|
+
class $ {
|
|
1805
1548
|
min;
|
|
1806
1549
|
max;
|
|
1807
1550
|
/**
|
|
@@ -1814,7 +1557,7 @@ class AA {
|
|
|
1814
1557
|
this.min = A ? vg(A) : Z(1 / 0, 1 / 0), this.max = I ? vg(I) : Z(-1 / 0, -1 / 0);
|
|
1815
1558
|
}
|
|
1816
1559
|
clone() {
|
|
1817
|
-
return new
|
|
1560
|
+
return new $(this.min, this.max);
|
|
1818
1561
|
}
|
|
1819
1562
|
isEmpty() {
|
|
1820
1563
|
return this.max[0] <= this.min[0] || this.max[1] <= this.min[1];
|
|
@@ -1827,7 +1570,7 @@ class AA {
|
|
|
1827
1570
|
return Xg(A.min, I.min) && Xg(A.max, I.max);
|
|
1828
1571
|
}
|
|
1829
1572
|
floor() {
|
|
1830
|
-
return new
|
|
1573
|
+
return new $(
|
|
1831
1574
|
Z(Math.floor(this.min[0]), Math.floor(this.min[1])),
|
|
1832
1575
|
Z(Math.floor(this.max[0]), Math.floor(this.max[1]))
|
|
1833
1576
|
);
|
|
@@ -1896,7 +1639,7 @@ class gQ {
|
|
|
1896
1639
|
}
|
|
1897
1640
|
setViewport(A) {
|
|
1898
1641
|
const I = A.floor();
|
|
1899
|
-
if (this.currentViewport_ &&
|
|
1642
|
+
if (this.currentViewport_ && $.equals(I, this.currentViewport_))
|
|
1900
1643
|
return;
|
|
1901
1644
|
const { x: B, y: C, width: Q, height: E } = I.toRect();
|
|
1902
1645
|
this.gl_.viewport(B, C, Q, E), this.currentViewport_ = I;
|
|
@@ -1906,7 +1649,7 @@ class gQ {
|
|
|
1906
1649
|
}
|
|
1907
1650
|
setScissor(A) {
|
|
1908
1651
|
const I = A.floor();
|
|
1909
|
-
if (this.currentScissor_ &&
|
|
1652
|
+
if (this.currentScissor_ && $.equals(I, this.currentScissor_))
|
|
1910
1653
|
return;
|
|
1911
1654
|
const { x: B, y: C, width: Q, height: E } = I.toRect();
|
|
1912
1655
|
this.gl_.scissor(B, C, Q, E), this.currentScissor_ = I;
|
|
@@ -1937,7 +1680,7 @@ class gQ {
|
|
|
1937
1680
|
A ? this.enable(this.gl_.STENCIL_TEST) : this.disable(this.gl_.STENCIL_TEST);
|
|
1938
1681
|
}
|
|
1939
1682
|
}
|
|
1940
|
-
const BQ = JC(
|
|
1683
|
+
const BQ = JC(z(), [1, -1, 1]);
|
|
1941
1684
|
class CQ extends sC {
|
|
1942
1685
|
gl_;
|
|
1943
1686
|
programs_;
|
|
@@ -1961,11 +1704,11 @@ class CQ extends sC {
|
|
|
1961
1704
|
}
|
|
1962
1705
|
render(A) {
|
|
1963
1706
|
let I = getComputedStyle(A.element).visibility !== "hidden";
|
|
1964
|
-
const B = A.getBoxRelativeTo(this.canvas), C = new
|
|
1707
|
+
const B = A.getBoxRelativeTo(this.canvas), C = new $(
|
|
1965
1708
|
Z(0, 0),
|
|
1966
1709
|
Z(this.width, this.height)
|
|
1967
1710
|
);
|
|
1968
|
-
|
|
1711
|
+
$.equals(B.floor(), C.floor()) ? this.state_.setScissorTest(!1) : $.intersects(B, C) ? (this.state_.setScissor(B), this.state_.setScissorTest(!0)) : (U.warn(
|
|
1969
1712
|
"WebGLRenderer",
|
|
1970
1713
|
`Viewport ${A.id} is entirely outside canvas bounds, skipping render`
|
|
1971
1714
|
), I = !1), this.state_.setViewport(B), this.renderedObjectsPerFrame_ = 0, I && this.clear();
|
|
@@ -2015,12 +1758,12 @@ class CQ extends sC {
|
|
|
2015
1758
|
}
|
|
2016
1759
|
}
|
|
2017
1760
|
drawGeometry(A, I, B, C, Q) {
|
|
2018
|
-
const E =
|
|
2019
|
-
|
|
1761
|
+
const E = jA(
|
|
1762
|
+
z(),
|
|
2020
1763
|
Q.viewMatrix,
|
|
2021
1764
|
I.transform.matrix
|
|
2022
|
-
), i =
|
|
2023
|
-
|
|
1765
|
+
), i = jA(
|
|
1766
|
+
z(),
|
|
2024
1767
|
BQ,
|
|
2025
1768
|
Q.projectionMatrix
|
|
2026
1769
|
), o = [this.canvas.width, this.canvas.height], a = I.getUniforms(), h = {
|
|
@@ -2042,8 +1785,8 @@ class CQ extends sC {
|
|
|
2042
1785
|
C.setUniform(n, B.opacity);
|
|
2043
1786
|
break;
|
|
2044
1787
|
case "CameraPositionModel": {
|
|
2045
|
-
const w = mI(
|
|
2046
|
-
|
|
1788
|
+
const w = mI(z(), E), r = kI(0, 0, 0, 1), G = zA(
|
|
1789
|
+
fA(),
|
|
2047
1790
|
r,
|
|
2048
1791
|
w
|
|
2049
1792
|
);
|
|
@@ -2078,7 +1821,7 @@ class CQ extends sC {
|
|
|
2078
1821
|
}
|
|
2079
1822
|
}
|
|
2080
1823
|
resize(A, I) {
|
|
2081
|
-
const B = new
|
|
1824
|
+
const B = new $(
|
|
2082
1825
|
Z(0, 0),
|
|
2083
1826
|
Z(A, I)
|
|
2084
1827
|
);
|
|
@@ -2165,7 +1908,7 @@ function iQ(g, A) {
|
|
|
2165
1908
|
function Qg(g, A, I = 1e-6) {
|
|
2166
1909
|
return Math.abs(g - A) <= I;
|
|
2167
1910
|
}
|
|
2168
|
-
function
|
|
1911
|
+
function NA(g, A, I) {
|
|
2169
1912
|
return Math.max(A, Math.min(I, g));
|
|
2170
1913
|
}
|
|
2171
1914
|
const ng = Symbol("INTERNAL_POLICY_KEY");
|
|
@@ -2239,7 +1982,7 @@ class oQ {
|
|
|
2239
1982
|
}
|
|
2240
1983
|
const w = HB();
|
|
2241
1984
|
_C(w, Q.min, Q.max, 0.5);
|
|
2242
|
-
const [r, G] = this.getZBounds(A), c = new
|
|
1985
|
+
const [r, G] = this.getZBounds(A), c = new SA(
|
|
2243
1986
|
q(Q.min[0], Q.min[1], r),
|
|
2244
1987
|
q(Q.max[0], Q.max[1], G)
|
|
2245
1988
|
);
|
|
@@ -2256,8 +1999,8 @@ class oQ {
|
|
|
2256
1999
|
), this.policyChanged_ = !1, this.lastViewBounds2D_ = Q.clone(), this.lastZBounds_ = h, this.lastTCoord_ = A.t;
|
|
2257
2000
|
}
|
|
2258
2001
|
updateChunksForVolume(A, I) {
|
|
2259
|
-
const B =
|
|
2260
|
-
|
|
2002
|
+
const B = jA(
|
|
2003
|
+
z(),
|
|
2261
2004
|
I.camera.projectionMatrix,
|
|
2262
2005
|
I.camera.viewMatrix
|
|
2263
2006
|
);
|
|
@@ -2325,7 +2068,7 @@ class oQ {
|
|
|
2325
2068
|
), a = Math.max(
|
|
2326
2069
|
o,
|
|
2327
2070
|
Math.min(i, this.policy_.lod.max)
|
|
2328
|
-
), s =
|
|
2071
|
+
), s = NA(E, o, a);
|
|
2329
2072
|
s !== this.currentLOD_ && (this.currentLOD_ = s);
|
|
2330
2073
|
}
|
|
2331
2074
|
isChunkChannelInSlice(A, I) {
|
|
@@ -2364,7 +2107,7 @@ class oQ {
|
|
|
2364
2107
|
for (let a = A + 1; a <= E; ++a)
|
|
2365
2108
|
for (const s of this.store_.getChunksAtTime(a)) {
|
|
2366
2109
|
if (s.lod !== i || !this.isChunkChannelInSlice(s, I) || !this.isChunkWithinBounds(s, B)) continue;
|
|
2367
|
-
const h = this.squareDistance2D(s, C), t =
|
|
2110
|
+
const h = this.squareDistance2D(s, C), t = NA(
|
|
2368
2111
|
h / this.sourceMaxSquareDistance2D_,
|
|
2369
2112
|
0,
|
|
2370
2113
|
1 - Number.EPSILON
|
|
@@ -2400,7 +2143,7 @@ class oQ {
|
|
|
2400
2143
|
return A && B ? E.fallbackVisible : I && B ? E.visibleCurrent : A ? E.fallbackBackground : I && C ? E.prefetchSpace : null;
|
|
2401
2144
|
}
|
|
2402
2145
|
isChunkWithinBounds(A, I) {
|
|
2403
|
-
const B = new
|
|
2146
|
+
const B = new SA(
|
|
2404
2147
|
q(A.offset.x, A.offset.y, A.offset.z),
|
|
2405
2148
|
q(
|
|
2406
2149
|
A.offset.x + A.shape.x * A.scale.x,
|
|
@@ -2408,7 +2151,7 @@ class oQ {
|
|
|
2408
2151
|
A.offset.z + A.shape.z * A.scale.z
|
|
2409
2152
|
)
|
|
2410
2153
|
);
|
|
2411
|
-
return
|
|
2154
|
+
return SA.intersects(B, I);
|
|
2412
2155
|
}
|
|
2413
2156
|
fallbackLOD() {
|
|
2414
2157
|
return Math.min(this.policy_.lod.max, this.store_.getLowestResLOD());
|
|
@@ -2444,7 +2187,7 @@ class oQ {
|
|
|
2444
2187
|
getPaddedBounds(A) {
|
|
2445
2188
|
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;
|
|
2446
2189
|
let o = 0;
|
|
2447
|
-
return Q && (o = Q.chunkSize * Q.scale * this.policy_.prefetch.z), new
|
|
2190
|
+
return Q && (o = Q.chunkSize * Q.scale * this.policy_.prefetch.z), new SA(
|
|
2448
2191
|
q(
|
|
2449
2192
|
A.min[0] - E,
|
|
2450
2193
|
A.min[1] - i,
|
|
@@ -2676,7 +2419,7 @@ class sQ {
|
|
|
2676
2419
|
I.canDispose() && this.stores_.delete(A);
|
|
2677
2420
|
}
|
|
2678
2421
|
}
|
|
2679
|
-
var
|
|
2422
|
+
var vA = function(g = 1) {
|
|
2680
2423
|
var A = 0, I = document.createElement("div");
|
|
2681
2424
|
I.style.cssText = "position:fixed;top:0;left:0;cursor:pointer;opacity:0.9;z-index:10000", I.addEventListener("click", function(h) {
|
|
2682
2425
|
h.preventDefault(), C(++A % I.children.length);
|
|
@@ -2689,9 +2432,9 @@ var XA = function(g = 1) {
|
|
|
2689
2432
|
I.children[t].style.display = t === h ? "block" : "none";
|
|
2690
2433
|
A = h;
|
|
2691
2434
|
}
|
|
2692
|
-
var Q = (performance || Date).now(), E = Q, i = 0, o = B(new
|
|
2435
|
+
var Q = (performance || Date).now(), E = Q, i = 0, o = B(new vA.Panel("FPS", "#0ff", "#002", g)), a = B(new vA.Panel("MS", "#0f0", "#020", g));
|
|
2693
2436
|
if (self.performance && self.performance.memory)
|
|
2694
|
-
var s = B(new
|
|
2437
|
+
var s = B(new vA.Panel("MB", "#f08", "#201", g));
|
|
2695
2438
|
return C(0), {
|
|
2696
2439
|
REVISION: 16,
|
|
2697
2440
|
dom: I,
|
|
@@ -2717,7 +2460,7 @@ var XA = function(g = 1) {
|
|
|
2717
2460
|
setMode: C
|
|
2718
2461
|
};
|
|
2719
2462
|
};
|
|
2720
|
-
|
|
2463
|
+
vA.Panel = function(g, A, I, B) {
|
|
2721
2464
|
var C = 1 / 0, Q = 0, E = Math.round, i = E(window.devicePixelRatio || 1), o = E(80 * i * B), a = E(48 * i * B), s = 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");
|
|
2722
2465
|
r.width = o, r.height = a, r.style.cssText = `width:${E(B * 80)}px;height:${E(B * 48)}px`;
|
|
2723
2466
|
var G = r.getContext("2d");
|
|
@@ -2729,7 +2472,7 @@ XA.Panel = function(g, A, I, B) {
|
|
|
2729
2472
|
};
|
|
2730
2473
|
};
|
|
2731
2474
|
function DQ({ scale: g } = { scale: 1.5 }) {
|
|
2732
|
-
const A = new
|
|
2475
|
+
const A = new vA(g);
|
|
2733
2476
|
return A.showPanel(
|
|
2734
2477
|
0
|
|
2735
2478
|
/* 0 = fps, 1 = ms, 2 = mb */
|
|
@@ -2884,7 +2627,7 @@ class GQ {
|
|
|
2884
2627
|
}
|
|
2885
2628
|
getBoxRelativeTo(A) {
|
|
2886
2629
|
const I = this.getBox().toRect(), B = A.getBoundingClientRect(), C = window.devicePixelRatio || 1, Q = B.left * C, E = B.top * C, i = B.height * C, o = I.x - Q, a = I.y - E, s = Math.floor(o), h = Math.floor(i - a - I.height), t = Math.floor(I.width), y = Math.floor(I.height);
|
|
2887
|
-
return new
|
|
2630
|
+
return new $(
|
|
2888
2631
|
Z(s, h),
|
|
2889
2632
|
Z(s + t, h + y)
|
|
2890
2633
|
);
|
|
@@ -2903,7 +2646,7 @@ class GQ {
|
|
|
2903
2646
|
}
|
|
2904
2647
|
getBox() {
|
|
2905
2648
|
const A = this.element.getBoundingClientRect(), I = window.devicePixelRatio || 1, B = A.left * I, C = A.top * I, Q = A.width * I, E = A.height * I;
|
|
2906
|
-
return new
|
|
2649
|
+
return new $(
|
|
2907
2650
|
Z(B, C),
|
|
2908
2651
|
Z(B + Q, C + E)
|
|
2909
2652
|
);
|
|
@@ -2945,7 +2688,7 @@ function _g(g, A, I) {
|
|
|
2945
2688
|
return {
|
|
2946
2689
|
...C,
|
|
2947
2690
|
element: Q,
|
|
2948
|
-
id: C.id ?? Q.id ?? JB(),
|
|
2691
|
+
id: C.id ?? Q.id ?? JB("viewport"),
|
|
2949
2692
|
layerManager: new hQ(I)
|
|
2950
2693
|
};
|
|
2951
2694
|
});
|
|
@@ -3161,7 +2904,7 @@ class Ho {
|
|
|
3161
2904
|
}
|
|
3162
2905
|
}
|
|
3163
2906
|
}
|
|
3164
|
-
class FQ extends
|
|
2907
|
+
class FQ extends WA {
|
|
3165
2908
|
constructor(A) {
|
|
3166
2909
|
if (super(), A.primitive != "triangles") {
|
|
3167
2910
|
U.warn("WireframeGeometry", "Only indexed geometries are supported");
|
|
@@ -3189,7 +2932,7 @@ class FQ extends bA {
|
|
|
3189
2932
|
const rQ = q(0, 1, 0);
|
|
3190
2933
|
class SQ {
|
|
3191
2934
|
dirty_ = !0;
|
|
3192
|
-
matrix_ =
|
|
2935
|
+
matrix_ = z();
|
|
3193
2936
|
rotation_ = Cg();
|
|
3194
2937
|
translation_ = f();
|
|
3195
2938
|
scale_ = q(1, 1, 1);
|
|
@@ -3203,33 +2946,33 @@ class SQ {
|
|
|
3203
2946
|
return vC(this.rotation_);
|
|
3204
2947
|
}
|
|
3205
2948
|
addTranslation(A) {
|
|
3206
|
-
|
|
2949
|
+
qA(this.translation_, this.translation_, A), this.dirty_ = !0;
|
|
3207
2950
|
}
|
|
3208
2951
|
setTranslation(A) {
|
|
3209
|
-
|
|
2952
|
+
KA(this.translation_, A), this.dirty_ = !0;
|
|
3210
2953
|
}
|
|
3211
2954
|
get translation() {
|
|
3212
|
-
return
|
|
2955
|
+
return gA(this.translation_);
|
|
3213
2956
|
}
|
|
3214
2957
|
addScale(A) {
|
|
3215
2958
|
pC(this.scale_, this.scale_, A), this.dirty_ = !0;
|
|
3216
2959
|
}
|
|
3217
2960
|
setScale(A) {
|
|
3218
|
-
|
|
2961
|
+
KA(this.scale_, A), this.dirty_ = !0;
|
|
3219
2962
|
}
|
|
3220
2963
|
targetTo(A) {
|
|
3221
|
-
MB(this.translation_, A) && (A =
|
|
3222
|
-
const I = qC(
|
|
2964
|
+
MB(this.translation_, A) && (A = gA(A), A[2] += p);
|
|
2965
|
+
const I = qC(z(), this.translation_, A, rQ), B = LC(YB(), I);
|
|
3223
2966
|
KB(this.rotation_, B), Gg(this.rotation_, this.rotation_), this.dirty_ = !0;
|
|
3224
2967
|
}
|
|
3225
2968
|
get scale() {
|
|
3226
|
-
return
|
|
2969
|
+
return gA(this.scale_);
|
|
3227
2970
|
}
|
|
3228
2971
|
get matrix() {
|
|
3229
2972
|
return this.dirty_ && (this.computeMatrix(), this.dirty_ = !1), this.matrix_;
|
|
3230
2973
|
}
|
|
3231
2974
|
get inverse() {
|
|
3232
|
-
return mI(
|
|
2975
|
+
return mI(z(), this.matrix);
|
|
3233
2976
|
}
|
|
3234
2977
|
computeMatrix() {
|
|
3235
2978
|
YC(
|
|
@@ -3240,14 +2983,14 @@ class SQ {
|
|
|
3240
2983
|
);
|
|
3241
2984
|
}
|
|
3242
2985
|
}
|
|
3243
|
-
class
|
|
2986
|
+
class bA extends yg {
|
|
3244
2987
|
wireframeEnabled = !1;
|
|
3245
2988
|
wireframeColor = l.WHITE;
|
|
3246
2989
|
depthTest = !0;
|
|
3247
2990
|
textures_ = [];
|
|
3248
2991
|
staleTextures_ = [];
|
|
3249
2992
|
transform_ = new SQ();
|
|
3250
|
-
geometry_ = new
|
|
2993
|
+
geometry_ = new WA();
|
|
3251
2994
|
wireframeGeometry_ = null;
|
|
3252
2995
|
programName_ = null;
|
|
3253
2996
|
cullFaceMode_ = "none";
|
|
@@ -3298,14 +3041,14 @@ class ZA extends yg {
|
|
|
3298
3041
|
return {};
|
|
3299
3042
|
}
|
|
3300
3043
|
}
|
|
3301
|
-
class
|
|
3044
|
+
class YA {
|
|
3302
3045
|
normal;
|
|
3303
3046
|
signedDistance;
|
|
3304
3047
|
constructor(A = q(0, 1, 0), I = 0) {
|
|
3305
|
-
this.normal =
|
|
3048
|
+
this.normal = gA(A), this.signedDistance = I;
|
|
3306
3049
|
}
|
|
3307
3050
|
set(A, I) {
|
|
3308
|
-
this.normal =
|
|
3051
|
+
this.normal = gA(A), this.signedDistance = I;
|
|
3309
3052
|
}
|
|
3310
3053
|
signedDistanceToPoint(A) {
|
|
3311
3054
|
return dB(this.normal, A) + this.signedDistance;
|
|
@@ -3314,7 +3057,7 @@ class dA {
|
|
|
3314
3057
|
const A = eg(this.normal);
|
|
3315
3058
|
if (A > 0) {
|
|
3316
3059
|
const I = 1 / A;
|
|
3317
|
-
|
|
3060
|
+
lA(this.normal, this.normal, I), this.signedDistance *= I;
|
|
3318
3061
|
}
|
|
3319
3062
|
}
|
|
3320
3063
|
}
|
|
@@ -3322,12 +3065,12 @@ class RQ {
|
|
|
3322
3065
|
planes_;
|
|
3323
3066
|
constructor(A) {
|
|
3324
3067
|
this.planes_ = [
|
|
3325
|
-
new
|
|
3326
|
-
new
|
|
3327
|
-
new
|
|
3328
|
-
new
|
|
3329
|
-
new
|
|
3330
|
-
new
|
|
3068
|
+
new YA(f(), 0),
|
|
3069
|
+
new YA(f(), 0),
|
|
3070
|
+
new YA(f(), 0),
|
|
3071
|
+
new YA(f(), 0),
|
|
3072
|
+
new YA(f(), 0),
|
|
3073
|
+
new YA(f(), 0)
|
|
3331
3074
|
], this.setWithViewProjection(A);
|
|
3332
3075
|
}
|
|
3333
3076
|
// Uses the fast plane-extraction algorithm described in
|
|
@@ -3335,22 +3078,22 @@ class RQ {
|
|
|
3335
3078
|
setWithViewProjection(A) {
|
|
3336
3079
|
const I = f();
|
|
3337
3080
|
this.planes_[0].set(
|
|
3338
|
-
|
|
3081
|
+
rA(I, A[3] + A[0], A[7] + A[4], A[11] + A[8]),
|
|
3339
3082
|
A[15] + A[12]
|
|
3340
3083
|
), this.planes_[1].set(
|
|
3341
|
-
|
|
3084
|
+
rA(I, A[3] - A[0], A[7] - A[4], A[11] - A[8]),
|
|
3342
3085
|
A[15] - A[12]
|
|
3343
3086
|
), this.planes_[2].set(
|
|
3344
|
-
|
|
3087
|
+
rA(I, A[3] - A[1], A[7] - A[5], A[11] - A[9]),
|
|
3345
3088
|
A[15] - A[13]
|
|
3346
3089
|
), this.planes_[3].set(
|
|
3347
|
-
|
|
3090
|
+
rA(I, A[3] + A[1], A[7] + A[5], A[11] + A[9]),
|
|
3348
3091
|
A[15] + A[13]
|
|
3349
3092
|
), this.planes_[4].set(
|
|
3350
|
-
|
|
3093
|
+
rA(I, A[3] + A[2], A[7] + A[6], A[11] + A[10]),
|
|
3351
3094
|
A[15] + A[14]
|
|
3352
3095
|
), this.planes_[5].set(
|
|
3353
|
-
|
|
3096
|
+
rA(I, A[3] - A[2], A[7] - A[6], A[11] - A[10]),
|
|
3354
3097
|
A[15] - A[14]
|
|
3355
3098
|
);
|
|
3356
3099
|
for (const B of this.planes_) B.normalize();
|
|
@@ -3364,8 +3107,8 @@ class RQ {
|
|
|
3364
3107
|
return !0;
|
|
3365
3108
|
}
|
|
3366
3109
|
}
|
|
3367
|
-
class lB extends
|
|
3368
|
-
projectionMatrix_ =
|
|
3110
|
+
class lB extends bA {
|
|
3111
|
+
projectionMatrix_ = z();
|
|
3369
3112
|
near_ = 0;
|
|
3370
3113
|
far_ = 0;
|
|
3371
3114
|
update() {
|
|
@@ -3387,7 +3130,7 @@ class lB extends ZA {
|
|
|
3387
3130
|
}
|
|
3388
3131
|
get frustum() {
|
|
3389
3132
|
return new RQ(
|
|
3390
|
-
|
|
3133
|
+
jA(z(), this.projectionMatrix, this.viewMatrix)
|
|
3391
3134
|
);
|
|
3392
3135
|
}
|
|
3393
3136
|
pan(A) {
|
|
@@ -3398,16 +3141,16 @@ class lB extends ZA {
|
|
|
3398
3141
|
}
|
|
3399
3142
|
clipToWorld(A) {
|
|
3400
3143
|
const I = kI(A[0], A[1], A[2], 1), B = mI(
|
|
3401
|
-
|
|
3144
|
+
z(),
|
|
3402
3145
|
this.projectionMatrix_
|
|
3403
|
-
), C =
|
|
3404
|
-
|
|
3146
|
+
), C = zA(
|
|
3147
|
+
fA(),
|
|
3405
3148
|
I,
|
|
3406
3149
|
B
|
|
3407
3150
|
);
|
|
3408
3151
|
ZC(C, C, 1 / C[3]);
|
|
3409
|
-
const Q =
|
|
3410
|
-
|
|
3152
|
+
const Q = zA(
|
|
3153
|
+
fA(),
|
|
3411
3154
|
C,
|
|
3412
3155
|
this.transform.matrix
|
|
3413
3156
|
);
|
|
@@ -3446,12 +3189,12 @@ class qo extends lB {
|
|
|
3446
3189
|
}
|
|
3447
3190
|
getWorldViewRect() {
|
|
3448
3191
|
let A = kI(-1, -1, 0, 1), I = kI(1, 1, 0, 1);
|
|
3449
|
-
const B =
|
|
3450
|
-
|
|
3192
|
+
const B = jA(
|
|
3193
|
+
z(),
|
|
3451
3194
|
this.projectionMatrix,
|
|
3452
3195
|
this.viewMatrix
|
|
3453
|
-
), C = mI(
|
|
3454
|
-
return A =
|
|
3196
|
+
), C = mI(z(), B);
|
|
3197
|
+
return A = zA(fA(), A, C), I = zA(fA(), I, C), new $(
|
|
3455
3198
|
Z(A[0], A[1]),
|
|
3456
3199
|
Z(I[0], I[1])
|
|
3457
3200
|
);
|
|
@@ -3546,14 +3289,14 @@ class fo {
|
|
|
3546
3289
|
if (!A.worldPos || !A.clipPos) return;
|
|
3547
3290
|
const I = A.event;
|
|
3548
3291
|
I.preventDefault();
|
|
3549
|
-
const B =
|
|
3292
|
+
const B = gA(A.worldPos), C = I.deltaY < 0 ? 1.05 : 0.95;
|
|
3550
3293
|
this.camera_.zoom(C);
|
|
3551
3294
|
const Q = this.camera_.clipToWorld(A.clipPos), E = UI(f(), B, Q);
|
|
3552
3295
|
this.camera_.pan(E);
|
|
3553
3296
|
}
|
|
3554
3297
|
onPointerDown(A) {
|
|
3555
3298
|
const I = A.event;
|
|
3556
|
-
!A.worldPos || I.button !== IB || (this.dragStart_ =
|
|
3299
|
+
!A.worldPos || I.button !== IB || (this.dragStart_ = gA(A.worldPos), this.dragActive_ = !0, I.target?.setPointerCapture?.(I.pointerId));
|
|
3557
3300
|
}
|
|
3558
3301
|
onPointerMove(A) {
|
|
3559
3302
|
if (!this.dragActive_ || !A.worldPos) return;
|
|
@@ -3595,7 +3338,7 @@ class po {
|
|
|
3595
3338
|
I?.radius ?? 1,
|
|
3596
3339
|
I?.yaw ?? 0,
|
|
3597
3340
|
I?.pitch ?? 0
|
|
3598
|
-
), I?.target &&
|
|
3341
|
+
), I?.target && KA(this.currCenter_, I.target), this.dampingFactor_ = NA(
|
|
3599
3342
|
I?.dampingFactor ?? JQ,
|
|
3600
3343
|
0,
|
|
3601
3344
|
1
|
|
@@ -3624,11 +3367,11 @@ class po {
|
|
|
3624
3367
|
onUpdate(A) {
|
|
3625
3368
|
if (this.orbitVelocity_.phi === 0 && this.orbitVelocity_.theta === 0 && this.orbitVelocity_.radius === 0 && MB(this.panVelocity_, q(0, 0, 0)))
|
|
3626
3369
|
return;
|
|
3627
|
-
this.currPos_.phi += this.orbitVelocity_.phi, this.currPos_.theta += this.orbitVelocity_.theta, this.currPos_.radius += this.orbitVelocity_.radius * this.currPos_.radius,
|
|
3370
|
+
this.currPos_.phi += this.orbitVelocity_.phi, this.currPos_.theta += this.orbitVelocity_.theta, this.currPos_.radius += this.orbitVelocity_.radius * this.currPos_.radius, qA(this.currCenter_, this.currCenter_, this.panVelocity_);
|
|
3628
3371
|
const I = Math.PI / 2 - p;
|
|
3629
|
-
this.currPos_.theta =
|
|
3372
|
+
this.currPos_.theta = NA(this.currPos_.theta, -I, I), this.currPos_.radius = Math.max(0.01, this.currPos_.radius), this.updateCamera();
|
|
3630
3373
|
const B = Math.pow(1 - this.dampingFactor_, A * YQ);
|
|
3631
|
-
this.orbitVelocity_.phi *= B, this.orbitVelocity_.theta *= B, this.orbitVelocity_.radius *= B,
|
|
3374
|
+
this.orbitVelocity_.phi *= B, this.orbitVelocity_.theta *= B, this.orbitVelocity_.radius *= B, lA(this.panVelocity_, this.panVelocity_, B), this.cutoffLowVelocity();
|
|
3632
3375
|
}
|
|
3633
3376
|
onPointerDown(A) {
|
|
3634
3377
|
const I = A.event;
|
|
@@ -3655,20 +3398,20 @@ class po {
|
|
|
3655
3398
|
}
|
|
3656
3399
|
pan(A, I) {
|
|
3657
3400
|
const B = this.currPos_.radius * kQ, C = f();
|
|
3658
|
-
cI(C, C, this.camera_.right, A), cI(C, C, this.camera_.up, I),
|
|
3401
|
+
cI(C, C, this.camera_.right, A), cI(C, C, this.camera_.up, I), lA(C, C, B), UI(this.panVelocity_, this.panVelocity_, C);
|
|
3659
3402
|
}
|
|
3660
3403
|
zoom(A) {
|
|
3661
3404
|
this.orbitVelocity_.radius += A * LQ;
|
|
3662
3405
|
}
|
|
3663
3406
|
updateCamera() {
|
|
3664
|
-
const A =
|
|
3407
|
+
const A = qA(f(), this.currCenter_, this.currPos_.toVec3());
|
|
3665
3408
|
this.camera_.transform.setTranslation(A), this.camera_.transform.targetTo(this.currCenter_);
|
|
3666
3409
|
}
|
|
3667
3410
|
cutoffLowVelocity() {
|
|
3668
3411
|
Math.abs(this.orbitVelocity_.phi) < p && (this.orbitVelocity_.phi = 0), Math.abs(this.orbitVelocity_.theta) < p && (this.orbitVelocity_.theta = 0), Math.abs(this.orbitVelocity_.radius) < p && (this.orbitVelocity_.radius = 0), eg(this.panVelocity_) < p && TC(this.panVelocity_);
|
|
3669
3412
|
}
|
|
3670
3413
|
}
|
|
3671
|
-
class
|
|
3414
|
+
class wA {
|
|
3672
3415
|
objects_ = [];
|
|
3673
3416
|
state_ = "initialized";
|
|
3674
3417
|
callbacks_ = [];
|
|
@@ -3683,7 +3426,7 @@ class FA {
|
|
|
3683
3426
|
(I < 0 || I > 1) && U.warn(
|
|
3684
3427
|
"Layer",
|
|
3685
3428
|
`Layer opacity out of bounds: ${I} — clamping to [0.0, 1.0]`
|
|
3686
|
-
), this.transparent = A, this.opacity_ =
|
|
3429
|
+
), this.transparent = A, this.opacity_ = NA(I, 0, 1), this.blendMode = B;
|
|
3687
3430
|
}
|
|
3688
3431
|
get opacity() {
|
|
3689
3432
|
return this.opacity_;
|
|
@@ -3692,7 +3435,7 @@ class FA {
|
|
|
3692
3435
|
(A < 0 || A > 1) && U.warn(
|
|
3693
3436
|
"Layer",
|
|
3694
3437
|
`Opacity out of bounds: ${A} — clamping to [0.0, 1.0]`
|
|
3695
|
-
), this.opacity_ =
|
|
3438
|
+
), this.opacity_ = NA(A, 0, 1);
|
|
3696
3439
|
}
|
|
3697
3440
|
onEvent(A) {
|
|
3698
3441
|
}
|
|
@@ -3744,7 +3487,7 @@ class FA {
|
|
|
3744
3487
|
return {};
|
|
3745
3488
|
}
|
|
3746
3489
|
}
|
|
3747
|
-
class LI extends
|
|
3490
|
+
class LI extends WA {
|
|
3748
3491
|
// this creates the geometry for a screen-space projected line
|
|
3749
3492
|
// each point on the input path is split into two vertices
|
|
3750
3493
|
// these are pushed in opposite directions in screen-space to create width
|
|
@@ -3800,7 +3543,7 @@ class LI extends bA {
|
|
|
3800
3543
|
return I;
|
|
3801
3544
|
}
|
|
3802
3545
|
}
|
|
3803
|
-
class wg extends
|
|
3546
|
+
class wg extends bA {
|
|
3804
3547
|
color_;
|
|
3805
3548
|
width_;
|
|
3806
3549
|
taperOffset_ = 0.5;
|
|
@@ -3850,7 +3593,7 @@ class wg extends ZA {
|
|
|
3850
3593
|
};
|
|
3851
3594
|
}
|
|
3852
3595
|
}
|
|
3853
|
-
class mo extends
|
|
3596
|
+
class mo extends wA {
|
|
3854
3597
|
type = "AxesLayer";
|
|
3855
3598
|
constructor(A) {
|
|
3856
3599
|
super();
|
|
@@ -3886,7 +3629,7 @@ function Ig(g) {
|
|
|
3886
3629
|
width: I
|
|
3887
3630
|
});
|
|
3888
3631
|
}
|
|
3889
|
-
class uo extends
|
|
3632
|
+
class uo extends wA {
|
|
3890
3633
|
type = "ProjectedLineLayer";
|
|
3891
3634
|
paths_ = [];
|
|
3892
3635
|
constructor(A = []) {
|
|
@@ -3914,7 +3657,7 @@ function dQ(g) {
|
|
|
3914
3657
|
const [I, B] = A(0), [C, Q] = A(1), [E, i] = A(2);
|
|
3915
3658
|
return { xMin: I, xMax: B, yMin: C, yMax: Q, zMin: E, zMax: i };
|
|
3916
3659
|
}
|
|
3917
|
-
class To extends
|
|
3660
|
+
class To extends wA {
|
|
3918
3661
|
type = "TracksLayer";
|
|
3919
3662
|
tracks_ = [];
|
|
3920
3663
|
constructor(A = []) {
|
|
@@ -3973,9 +3716,9 @@ function KQ({
|
|
|
3973
3716
|
}) {
|
|
3974
3717
|
const B = HQ(g), C = Array((g.length - 1) * A);
|
|
3975
3718
|
for (let Q = 0; Q < g.length - 1; Q++) {
|
|
3976
|
-
const E = g[Q], i = g[Q + 1], o =
|
|
3719
|
+
const E = g[Q], i = g[Q + 1], o = gA(B[Q]);
|
|
3977
3720
|
cI(o, E, o, I);
|
|
3978
|
-
const a =
|
|
3721
|
+
const a = gA(B[Q + 1]);
|
|
3979
3722
|
cI(a, i, a, -I);
|
|
3980
3723
|
for (let s = 0; s < A; s++) {
|
|
3981
3724
|
const h = s / A, t = C[Q * A + s] = f();
|
|
@@ -3990,11 +3733,11 @@ function HQ(g) {
|
|
|
3990
3733
|
const A = Array(g.length), I = f(), B = f();
|
|
3991
3734
|
for (let C = 0; C < g.length; C++) {
|
|
3992
3735
|
const Q = g[C], E = g[C + 1] ?? g[C];
|
|
3993
|
-
A[C] = f(), C !== 0 &&
|
|
3736
|
+
A[C] = f(), C !== 0 && KA(I, B), C !== g.length - 1 && UI(B, E, Q), C === 0 ? KA(A[C], B) : C == g.length - 1 ? KA(A[C], I) : (qA(A[C], I, B), lA(A[C], A[C], 0.5));
|
|
3994
3737
|
}
|
|
3995
3738
|
return A;
|
|
3996
3739
|
}
|
|
3997
|
-
class pB extends
|
|
3740
|
+
class pB extends WA {
|
|
3998
3741
|
constructor(A, I, B, C) {
|
|
3999
3742
|
super();
|
|
4000
3743
|
const Q = [], E = [], i = B, o = C, a = i + 1, s = o + 1, h = A / i, t = I / o;
|
|
@@ -4028,7 +3771,7 @@ class pB extends bA {
|
|
|
4028
3771
|
function QB(g) {
|
|
4029
3772
|
return g === 1 || g === 2 || g === 4 || g === 8;
|
|
4030
3773
|
}
|
|
4031
|
-
function
|
|
3774
|
+
function pA(g) {
|
|
4032
3775
|
if (g instanceof Int8Array)
|
|
4033
3776
|
return "byte";
|
|
4034
3777
|
if (g instanceof Int16Array)
|
|
@@ -4081,7 +3824,7 @@ class Fg extends yg {
|
|
|
4081
3824
|
}
|
|
4082
3825
|
}
|
|
4083
3826
|
const EB = 32;
|
|
4084
|
-
function
|
|
3827
|
+
function _A(g, { visible: A, color: I, contrastLimits: B }) {
|
|
4085
3828
|
return A === void 0 && (A = !0), I === void 0 ? I = l.WHITE : I = l.from(I), g !== null ? B = lQ(B, g) : B === void 0 && (U.debug(
|
|
4086
3829
|
"Channel",
|
|
4087
3830
|
"No texture provided, defaulting channel contrast limits to [0, 1]."
|
|
@@ -4101,7 +3844,7 @@ function ig(g, A) {
|
|
|
4101
3844
|
`Number of channels (${A.length}) must match depth of texture (${I}).`
|
|
4102
3845
|
);
|
|
4103
3846
|
}
|
|
4104
|
-
return A.map((I) =>
|
|
3847
|
+
return A.map((I) => _A(g, I));
|
|
4105
3848
|
}
|
|
4106
3849
|
function lQ(g, A) {
|
|
4107
3850
|
if (g === void 0)
|
|
@@ -4112,7 +3855,7 @@ function lQ(g, A) {
|
|
|
4112
3855
|
);
|
|
4113
3856
|
return g;
|
|
4114
3857
|
}
|
|
4115
|
-
class rg extends
|
|
3858
|
+
class rg extends bA {
|
|
4116
3859
|
channels_;
|
|
4117
3860
|
constructor(A, I, B, C = []) {
|
|
4118
3861
|
super(), this.geometry = new pB(A, I, 1, 1), this.setTexture(0, B), this.channels_ = ig(B, C), this.programName = fQ(B);
|
|
@@ -4124,7 +3867,7 @@ class rg extends ZA {
|
|
|
4124
3867
|
this.channels_ = ig(this.textures[0], A);
|
|
4125
3868
|
}
|
|
4126
3869
|
setChannelProperty(A, I, B) {
|
|
4127
|
-
const C =
|
|
3870
|
+
const C = _A(this.textures[0], {
|
|
4128
3871
|
...this.channels_[A],
|
|
4129
3872
|
[I]: B
|
|
4130
3873
|
});
|
|
@@ -4135,7 +3878,7 @@ class rg extends ZA {
|
|
|
4135
3878
|
if (!A)
|
|
4136
3879
|
throw new Error("No texture set");
|
|
4137
3880
|
if (A.type === "Texture2D") {
|
|
4138
|
-
const { color: I, contrastLimits: B } = this.channels_[0] ??
|
|
3881
|
+
const { color: I, contrastLimits: B } = this.channels_[0] ?? _A(A, {});
|
|
4139
3882
|
return {
|
|
4140
3883
|
ImageSampler: 0,
|
|
4141
3884
|
Color: I.rgb,
|
|
@@ -4195,13 +3938,13 @@ function mQ(g) {
|
|
|
4195
3938
|
return "floatScalarImageArray";
|
|
4196
3939
|
}
|
|
4197
3940
|
}
|
|
4198
|
-
class
|
|
3941
|
+
class tI extends Fg {
|
|
4199
3942
|
data_;
|
|
4200
3943
|
width_;
|
|
4201
3944
|
height_;
|
|
4202
3945
|
depth_;
|
|
4203
3946
|
constructor(A, I, B) {
|
|
4204
|
-
super(), this.dataFormat = "scalar", this.dataType =
|
|
3947
|
+
super(), this.dataFormat = "scalar", this.dataType = pA(A), this.data_ = A, this.width_ = I, this.height_ = B, this.depth_ = A.length / (I * B);
|
|
4205
3948
|
}
|
|
4206
3949
|
get type() {
|
|
4207
3950
|
return "Texture2DArray";
|
|
@@ -4229,7 +3972,7 @@ class yI extends Fg {
|
|
|
4229
3972
|
);
|
|
4230
3973
|
if (this.data === B) return;
|
|
4231
3974
|
const C = A.shape.x, Q = A.shape.y, E = B.length / (C * Q);
|
|
4232
|
-
if (this.width != C || this.height != Q || this.depth_ != E || this.dataType !=
|
|
3975
|
+
if (this.width != C || this.height != Q || this.depth_ != E || this.dataType != pA(B))
|
|
4233
3976
|
throw new Error("Unable to update texture, texture buffer mismatch.");
|
|
4234
3977
|
this.data = B;
|
|
4235
3978
|
}
|
|
@@ -4239,7 +3982,7 @@ class yI extends Fg {
|
|
|
4239
3982
|
throw new Error(
|
|
4240
3983
|
"Unable to create texture, chunk data is not initialized."
|
|
4241
3984
|
);
|
|
4242
|
-
const C = new
|
|
3985
|
+
const C = new tI(B, A.shape.x, A.shape.y);
|
|
4243
3986
|
return C.unpackAlignment = A.rowAlignmentBytes, C;
|
|
4244
3987
|
}
|
|
4245
3988
|
}
|
|
@@ -4284,7 +4027,7 @@ class mB {
|
|
|
4284
4027
|
this.bins_.clear();
|
|
4285
4028
|
}
|
|
4286
4029
|
}
|
|
4287
|
-
class uB extends
|
|
4030
|
+
class uB extends wA {
|
|
4288
4031
|
type = "ChunkedImageLayer";
|
|
4289
4032
|
source_;
|
|
4290
4033
|
sliceCoords_;
|
|
@@ -4402,7 +4145,7 @@ class uB extends FA {
|
|
|
4402
4145
|
}
|
|
4403
4146
|
slicePlane(A, I) {
|
|
4404
4147
|
if (!A.data) return;
|
|
4405
|
-
const B = (I - A.offset.z) / A.scale.z, C = Math.round(B), Q =
|
|
4148
|
+
const B = (I - A.offset.z) / A.scale.z, C = Math.round(B), Q = NA(C, 0, A.shape.z - 1);
|
|
4406
4149
|
Qg(B, Q, 1 + 1e-6) || U.error("ImageLayer", "slicePlane zValue outside extent");
|
|
4407
4150
|
const E = A.shape.x * A.shape.y, i = E * Q;
|
|
4408
4151
|
return A.data.slice(i, i + E);
|
|
@@ -4417,7 +4160,7 @@ class uB extends FA {
|
|
|
4417
4160
|
const I = new rg(
|
|
4418
4161
|
A.shape.x,
|
|
4419
4162
|
A.shape.y,
|
|
4420
|
-
|
|
4163
|
+
tI.createWithChunk(A, this.getDataForImage(A)),
|
|
4421
4164
|
this.channelProps_ ?? [{}]
|
|
4422
4165
|
);
|
|
4423
4166
|
return this.updateImageChunk(I, A), I;
|
|
@@ -4504,7 +4247,7 @@ function iB(g) {
|
|
|
4504
4247
|
`align${g.rowAlignmentBytes}`
|
|
4505
4248
|
].join(":");
|
|
4506
4249
|
}
|
|
4507
|
-
class uQ extends
|
|
4250
|
+
class uQ extends WA {
|
|
4508
4251
|
constructor(A, I, B, C, Q, E) {
|
|
4509
4252
|
super();
|
|
4510
4253
|
const i = [], o = [], a = Math.floor(C), s = Math.floor(Q), h = Math.floor(E);
|
|
@@ -4531,7 +4274,7 @@ class uQ extends bA {
|
|
|
4531
4274
|
O[A] = b * C, O[I] = m * Q, O[B] = c;
|
|
4532
4275
|
const V = { x: 0, y: 0, z: 0 };
|
|
4533
4276
|
V[B] = h;
|
|
4534
|
-
const
|
|
4277
|
+
const EA = x / a, iA = 1 - L / s;
|
|
4535
4278
|
t.push(
|
|
4536
4279
|
O.x,
|
|
4537
4280
|
O.y,
|
|
@@ -4539,8 +4282,8 @@ class uQ extends bA {
|
|
|
4539
4282
|
V.x,
|
|
4540
4283
|
V.y,
|
|
4541
4284
|
V.z,
|
|
4542
|
-
|
|
4543
|
-
|
|
4285
|
+
EA,
|
|
4286
|
+
iA
|
|
4544
4287
|
);
|
|
4545
4288
|
}
|
|
4546
4289
|
}
|
|
@@ -4551,13 +4294,13 @@ class uQ extends bA {
|
|
|
4551
4294
|
}
|
|
4552
4295
|
}
|
|
4553
4296
|
}
|
|
4554
|
-
class
|
|
4297
|
+
class XA extends Fg {
|
|
4555
4298
|
data_;
|
|
4556
4299
|
width_;
|
|
4557
4300
|
height_;
|
|
4558
4301
|
depth_;
|
|
4559
4302
|
constructor(A, I, B, C) {
|
|
4560
|
-
super(), this.dataFormat = "scalar", this.dataType =
|
|
4303
|
+
super(), this.dataFormat = "scalar", this.dataType = pA(A), this.data_ = A, this.width_ = I, this.height_ = B, this.depth_ = C;
|
|
4561
4304
|
}
|
|
4562
4305
|
set data(A) {
|
|
4563
4306
|
this.data_ = A, this.needsUpdate = !0;
|
|
@@ -4584,7 +4327,7 @@ class jA extends Fg {
|
|
|
4584
4327
|
"Unable to update texture, chunk data is not initialized."
|
|
4585
4328
|
);
|
|
4586
4329
|
if (this.data !== I) {
|
|
4587
|
-
if (this.width != A.shape.x || this.height != A.shape.y || this.depth != A.shape.z || this.dataType !=
|
|
4330
|
+
if (this.width != A.shape.x || this.height != A.shape.y || this.depth != A.shape.z || this.dataType != pA(I))
|
|
4588
4331
|
throw new Error("Unable to update texture, texture buffer mismatch.");
|
|
4589
4332
|
this.data = I;
|
|
4590
4333
|
}
|
|
@@ -4595,7 +4338,7 @@ class jA extends Fg {
|
|
|
4595
4338
|
throw new Error(
|
|
4596
4339
|
"Unable to create texture, chunk data is not initialized."
|
|
4597
4340
|
);
|
|
4598
|
-
const B = new
|
|
4341
|
+
const B = new XA(
|
|
4599
4342
|
I,
|
|
4600
4343
|
A.shape.x,
|
|
4601
4344
|
A.shape.y,
|
|
@@ -4604,7 +4347,7 @@ class jA extends Fg {
|
|
|
4604
4347
|
return B.unpackAlignment = A.rowAlignmentBytes, B;
|
|
4605
4348
|
}
|
|
4606
4349
|
}
|
|
4607
|
-
class TQ extends
|
|
4350
|
+
class TQ extends bA {
|
|
4608
4351
|
voxelScale = q(1, 1, 1);
|
|
4609
4352
|
channels_;
|
|
4610
4353
|
channelToTextureIndex_ = /* @__PURE__ */ new Map();
|
|
@@ -4620,7 +4363,7 @@ class TQ extends ZA {
|
|
|
4620
4363
|
B !== void 0 ? this.updateChannelTexture(B, A) : this.addChannelTexture(I, A), this.loadedChannels_.add(I);
|
|
4621
4364
|
}
|
|
4622
4365
|
addChannelTexture(A, I) {
|
|
4623
|
-
const B =
|
|
4366
|
+
const B = XA.createWithChunk(I), C = this.textures.length;
|
|
4624
4367
|
this.setTexture(C, B), this.channelToTextureIndex_.set(A, C);
|
|
4625
4368
|
const Q = xQ(B.dataType);
|
|
4626
4369
|
if (this.programName && this.programName !== Q)
|
|
@@ -4631,8 +4374,8 @@ class TQ extends ZA {
|
|
|
4631
4374
|
}
|
|
4632
4375
|
updateChannelTexture(A, I) {
|
|
4633
4376
|
const B = this.textures[A];
|
|
4634
|
-
if (!(B instanceof
|
|
4635
|
-
const C =
|
|
4377
|
+
if (!(B instanceof XA)) {
|
|
4378
|
+
const C = XA.createWithChunk(I);
|
|
4636
4379
|
this.setTexture(A, C);
|
|
4637
4380
|
return;
|
|
4638
4381
|
}
|
|
@@ -4662,7 +4405,7 @@ class TQ extends ZA {
|
|
|
4662
4405
|
for (let i = 0; i < E && Q.length < 4; i++) {
|
|
4663
4406
|
const o = this.channelToTextureIndex_.get(i);
|
|
4664
4407
|
if (o === void 0 || !this.loadedChannels_.has(i)) continue;
|
|
4665
|
-
const a = this.textures[o], s =
|
|
4408
|
+
const a = this.textures[o], s = _A(a, this.channels_[i] || {});
|
|
4666
4409
|
if (!s.visible) continue;
|
|
4667
4410
|
const h = Q.length;
|
|
4668
4411
|
I[h * 3] = s.color.rgb[0], I[h * 3 + 1] = s.color.rgb[1], I[h * 3 + 2] = s.color.rgb[2], Q.push(o), B[h] = -s.contrastLimits[0], C[h] = 1 / (s.contrastLimits[1] - s.contrastLimits[0]), A[h] = 1;
|
|
@@ -4700,7 +4443,7 @@ class TQ extends ZA {
|
|
|
4700
4443
|
);
|
|
4701
4444
|
}
|
|
4702
4445
|
setChannelProperty(A, I, B) {
|
|
4703
|
-
const C =
|
|
4446
|
+
const C = _A(
|
|
4704
4447
|
this.getAvailableChannelTexture(A),
|
|
4705
4448
|
{
|
|
4706
4449
|
...this.channels_[A],
|
|
@@ -4727,13 +4470,13 @@ function xQ(g) {
|
|
|
4727
4470
|
function WQ(g, A) {
|
|
4728
4471
|
const I = A.position, B = f(), C = f();
|
|
4729
4472
|
return g.sort((Q, E) => {
|
|
4730
|
-
|
|
4473
|
+
qA(B, Q.boundingBox.max, Q.boundingBox.min), lA(B, B, 0.5), qA(C, E.boundingBox.max, E.boundingBox.min), lA(C, C, 0.5);
|
|
4731
4474
|
const i = Vg(I, B), o = Vg(I, C);
|
|
4732
4475
|
return i - o;
|
|
4733
4476
|
}), g;
|
|
4734
4477
|
}
|
|
4735
4478
|
const bQ = 2;
|
|
4736
|
-
class xo extends
|
|
4479
|
+
class xo extends wA {
|
|
4737
4480
|
type = "VolumeLayer";
|
|
4738
4481
|
source_;
|
|
4739
4482
|
sliceCoords_;
|
|
@@ -4836,7 +4579,7 @@ class xo extends FA {
|
|
|
4836
4579
|
y: I.shape.y * I.scale.y,
|
|
4837
4580
|
z: I.shape.z * I.scale.z
|
|
4838
4581
|
};
|
|
4839
|
-
A.transform.setScale([B.x, B.y, B.z]),
|
|
4582
|
+
A.transform.setScale([B.x, B.y, B.z]), rA(A.voxelScale, I.scale.x, I.scale.y, I.scale.z);
|
|
4840
4583
|
const C = {
|
|
4841
4584
|
x: I.shape.x * I.scale.x / 2,
|
|
4842
4585
|
y: I.shape.y * I.scale.y / 2,
|
|
@@ -4894,7 +4637,7 @@ function OQ(g) {
|
|
|
4894
4637
|
`align${g.rowAlignmentBytes}`
|
|
4895
4638
|
].join(":");
|
|
4896
4639
|
}
|
|
4897
|
-
class Wo extends
|
|
4640
|
+
class Wo extends wA {
|
|
4898
4641
|
type = "ImageLayer";
|
|
4899
4642
|
source_;
|
|
4900
4643
|
region_;
|
|
@@ -4978,7 +4721,7 @@ class Wo extends FA {
|
|
|
4978
4721
|
const I = new rg(
|
|
4979
4722
|
A.shape.x,
|
|
4980
4723
|
A.shape.y,
|
|
4981
|
-
|
|
4724
|
+
tI.createWithChunk(A),
|
|
4982
4725
|
this.channelProps
|
|
4983
4726
|
);
|
|
4984
4727
|
return I.transform.setScale([A.scale.x, A.scale.y, 1]), I.transform.setTranslation([A.offset.x, A.offset.y, 0]), I;
|
|
@@ -4997,12 +4740,12 @@ class Wo extends FA {
|
|
|
4997
4740
|
return null;
|
|
4998
4741
|
}
|
|
4999
4742
|
}
|
|
5000
|
-
class
|
|
4743
|
+
class $A extends Fg {
|
|
5001
4744
|
data_;
|
|
5002
4745
|
width_;
|
|
5003
4746
|
height_;
|
|
5004
4747
|
constructor(A, I, B) {
|
|
5005
|
-
super(), this.dataFormat = "scalar", this.dataType =
|
|
4748
|
+
super(), this.dataFormat = "scalar", this.dataType = pA(A), this.data_ = A, this.width_ = I, this.height_ = B;
|
|
5006
4749
|
}
|
|
5007
4750
|
set data(A) {
|
|
5008
4751
|
this.data_ = A, this.needsUpdate = !0;
|
|
@@ -5026,7 +4769,7 @@ class AI extends Fg {
|
|
|
5026
4769
|
"Unable to update texture, chunk data is not initialized."
|
|
5027
4770
|
);
|
|
5028
4771
|
if (this.data !== B) {
|
|
5029
|
-
if (this.width != A.shape.x || this.height != A.shape.y || this.dataType !=
|
|
4772
|
+
if (this.width != A.shape.x || this.height != A.shape.y || this.dataType != pA(B))
|
|
5030
4773
|
throw new Error("Unable to update texture, texture buffer mismatch.");
|
|
5031
4774
|
this.data = B;
|
|
5032
4775
|
}
|
|
@@ -5037,7 +4780,7 @@ class AI extends Fg {
|
|
|
5037
4780
|
throw new Error(
|
|
5038
4781
|
"Unable to create texture, chunk data is not initialized."
|
|
5039
4782
|
);
|
|
5040
|
-
const C = new
|
|
4783
|
+
const C = new $A(B, A.shape.x, A.shape.y);
|
|
5041
4784
|
return C.unpackAlignment = A.rowAlignmentBytes, C;
|
|
5042
4785
|
}
|
|
5043
4786
|
}
|
|
@@ -5083,7 +4826,7 @@ function zQ(g) {
|
|
|
5083
4826
|
);
|
|
5084
4827
|
return g;
|
|
5085
4828
|
}
|
|
5086
|
-
class _Q extends
|
|
4829
|
+
class _Q extends bA {
|
|
5087
4830
|
outlineSelected_;
|
|
5088
4831
|
selectedValue_;
|
|
5089
4832
|
constructor(A) {
|
|
@@ -5116,16 +4859,16 @@ class _Q extends ZA {
|
|
|
5116
4859
|
makeColorCycleTexture(A) {
|
|
5117
4860
|
const I = new Uint8Array(
|
|
5118
4861
|
A.flatMap((C) => C.rgba).map((C) => Math.round(C * 255))
|
|
5119
|
-
), B = new
|
|
4862
|
+
), B = new $A(I, A.length, 1);
|
|
5120
4863
|
return B.dataFormat = "rgba", B;
|
|
5121
4864
|
}
|
|
5122
4865
|
makeColorLookupTableTexture(A) {
|
|
5123
4866
|
A === void 0 ? A = /* @__PURE__ */ new Map([[0, l.TRANSPARENT]]) : A.has(0) || (A = new Map([[0, l.TRANSPARENT], ...A]));
|
|
5124
4867
|
const I = Array.from(A.keys()), B = Array.from(A.values()).map((E) => E.packed), C = A.size, Q = new Uint32Array(C * 2);
|
|
5125
|
-
return Q.set(I, 0), Q.set(B, C), new
|
|
4868
|
+
return Q.set(I, 0), Q.set(B, C), new $A(Q, C, 2);
|
|
5126
4869
|
}
|
|
5127
4870
|
}
|
|
5128
|
-
class bo extends
|
|
4871
|
+
class bo extends wA {
|
|
5129
4872
|
type = "LabelImageLayer";
|
|
5130
4873
|
source_;
|
|
5131
4874
|
region_;
|
|
@@ -5193,7 +4936,7 @@ class bo extends FA {
|
|
|
5193
4936
|
const I = new _Q({
|
|
5194
4937
|
width: A.shape.x,
|
|
5195
4938
|
height: A.shape.y,
|
|
5196
|
-
imageData:
|
|
4939
|
+
imageData: $A.createWithChunk(A),
|
|
5197
4940
|
colorMap: this.colorMap_,
|
|
5198
4941
|
outlineSelected: this.outlineSelected_,
|
|
5199
4942
|
selectedValue: this.selectedValue_
|
|
@@ -5381,7 +5124,7 @@ class AE {
|
|
|
5381
5124
|
return this.loader_ ??= await this.source_.open(), this.loader_;
|
|
5382
5125
|
}
|
|
5383
5126
|
}
|
|
5384
|
-
class Zo extends
|
|
5127
|
+
class Zo extends wA {
|
|
5385
5128
|
type = "ImageSeriesLayer";
|
|
5386
5129
|
seriesLoader_;
|
|
5387
5130
|
initialChannelProps_;
|
|
@@ -5449,7 +5192,7 @@ class Zo extends FA {
|
|
|
5449
5192
|
return A.chunk && (this.setData(A.chunk), this.setState("ready")), A;
|
|
5450
5193
|
}
|
|
5451
5194
|
setData(A) {
|
|
5452
|
-
!this.texture_ || !this.image_ ? (this.texture_ =
|
|
5195
|
+
!this.texture_ || !this.image_ ? (this.texture_ = tI.createWithChunk(A), this.image_ = this.createImage(A, this.texture_, this.channelProps_), this.addObject(this.image_), this.extent_ = {
|
|
5453
5196
|
x: A.shape.x * A.scale.x,
|
|
5454
5197
|
y: A.shape.y * A.scale.y
|
|
5455
5198
|
}) : A.data && this.texture_.updateWithChunk(A);
|
|
@@ -5508,7 +5251,7 @@ async function gE(g, A, I, B) {
|
|
|
5508
5251
|
let Q = C.headers.get("Content-Length"), E = Number(Q);
|
|
5509
5252
|
return TB(g, E - A, E, I);
|
|
5510
5253
|
}
|
|
5511
|
-
class
|
|
5254
|
+
class ZA {
|
|
5512
5255
|
url;
|
|
5513
5256
|
#A;
|
|
5514
5257
|
#I;
|
|
@@ -5611,7 +5354,7 @@ class Rg {
|
|
|
5611
5354
|
yield this.get(A);
|
|
5612
5355
|
}
|
|
5613
5356
|
}
|
|
5614
|
-
class
|
|
5357
|
+
class yI {
|
|
5615
5358
|
#A;
|
|
5616
5359
|
chars;
|
|
5617
5360
|
constructor(A, I, B, C) {
|
|
@@ -5620,7 +5363,7 @@ class eI {
|
|
|
5620
5363
|
else if (I instanceof ArrayBuffer)
|
|
5621
5364
|
C && (C *= A), this.#A = new Int32Array(I, B, C);
|
|
5622
5365
|
else {
|
|
5623
|
-
const Q = I, E = new
|
|
5366
|
+
const Q = I, E = new yI(A, 1);
|
|
5624
5367
|
this.#A = new Int32Array(function* () {
|
|
5625
5368
|
for (let i of Q)
|
|
5626
5369
|
E.set(0, i), yield* E.#A;
|
|
@@ -5666,7 +5409,7 @@ class eI {
|
|
|
5666
5409
|
yield this.get(A);
|
|
5667
5410
|
}
|
|
5668
5411
|
}
|
|
5669
|
-
function
|
|
5412
|
+
function eI(g) {
|
|
5670
5413
|
const A = new TextDecoder().decode(g);
|
|
5671
5414
|
return JSON.parse(A);
|
|
5672
5415
|
}
|
|
@@ -5683,7 +5426,7 @@ function WB(g) {
|
|
|
5683
5426
|
let A = g.match(/v2:([US])(\d+)/);
|
|
5684
5427
|
if (A) {
|
|
5685
5428
|
let [, B, C] = A;
|
|
5686
|
-
return (B === "U" ?
|
|
5429
|
+
return (B === "U" ? yI : Rg).bind(null, Number(C));
|
|
5687
5430
|
}
|
|
5688
5431
|
let I = {
|
|
5689
5432
|
int8: Int8Array,
|
|
@@ -5701,7 +5444,7 @@ function WB(g) {
|
|
|
5701
5444
|
}[g];
|
|
5702
5445
|
return W(I, `Unknown or unsupported data_type: ${g}`), I;
|
|
5703
5446
|
}
|
|
5704
|
-
function
|
|
5447
|
+
function cA(g, A) {
|
|
5705
5448
|
const I = g.length;
|
|
5706
5449
|
typeof A == "string" && (A = A === "C" ? Array.from({ length: I }, (Q, E) => E) : Array.from({ length: I }, (Q, E) => I - 1 - E)), W(I === A.length, "Order length must match the number of dimensions.");
|
|
5707
5450
|
let B = 1, C = new Array(I);
|
|
@@ -5857,7 +5600,7 @@ class xI {
|
|
|
5857
5600
|
#C;
|
|
5858
5601
|
#B;
|
|
5859
5602
|
constructor(A, I) {
|
|
5860
|
-
this.#B = A?.endian, this.#I = WB(I.data_type), this.#C = I.shape, this.#A =
|
|
5603
|
+
this.#B = A?.endian, this.#I = WB(I.data_type), this.#C = I.shape, this.#A = cA(I.shape, "C");
|
|
5861
5604
|
const B = new this.#I(0);
|
|
5862
5605
|
this.#g = B.BYTES_PER_ELEMENT;
|
|
5863
5606
|
}
|
|
@@ -5953,14 +5696,14 @@ class kg {
|
|
|
5953
5696
|
decode(A) {
|
|
5954
5697
|
const { strict: I } = this.#I;
|
|
5955
5698
|
W(I, "JsonCodec does not yet support non-strict decoding.");
|
|
5956
|
-
const B =
|
|
5699
|
+
const B = eI(A), C = B.pop();
|
|
5957
5700
|
B.pop(), W(C, "0D not implemented for JsonCodec.");
|
|
5958
|
-
const Q =
|
|
5701
|
+
const Q = cA(C, "C");
|
|
5959
5702
|
return { data: B, shape: C, stride: Q };
|
|
5960
5703
|
}
|
|
5961
5704
|
}
|
|
5962
5705
|
function yB(g) {
|
|
5963
|
-
return g instanceof xB || g instanceof Rg || g instanceof
|
|
5706
|
+
return g instanceof xB || g instanceof Rg || g instanceof yI ? new Proxy(g, {
|
|
5964
5707
|
get(I, B) {
|
|
5965
5708
|
return I.get(Number(B));
|
|
5966
5709
|
},
|
|
@@ -5971,14 +5714,14 @@ function yB(g) {
|
|
|
5971
5714
|
}
|
|
5972
5715
|
function hE(g, A) {
|
|
5973
5716
|
let I;
|
|
5974
|
-
return g.data instanceof Rg || g.data instanceof
|
|
5717
|
+
return g.data instanceof Rg || g.data instanceof yI ? I = new g.constructor(
|
|
5975
5718
|
// @ts-expect-error
|
|
5976
5719
|
g.data.length,
|
|
5977
5720
|
g.data.chars
|
|
5978
5721
|
) : I = new g.constructor(g.data.length), {
|
|
5979
5722
|
data: I,
|
|
5980
5723
|
shape: g.shape,
|
|
5981
|
-
stride:
|
|
5724
|
+
stride: cA(g.shape, A)
|
|
5982
5725
|
};
|
|
5983
5726
|
}
|
|
5984
5727
|
function tE(g, A) {
|
|
@@ -6033,7 +5776,7 @@ class Lg {
|
|
|
6033
5776
|
return {
|
|
6034
5777
|
data: A.data,
|
|
6035
5778
|
shape: A.shape,
|
|
6036
|
-
stride:
|
|
5779
|
+
stride: cA(A.shape, this.#A)
|
|
6037
5780
|
};
|
|
6038
5781
|
}
|
|
6039
5782
|
}
|
|
@@ -6042,7 +5785,7 @@ class Jg {
|
|
|
6042
5785
|
#A;
|
|
6043
5786
|
#I;
|
|
6044
5787
|
constructor(A) {
|
|
6045
|
-
this.#A = A, this.#I =
|
|
5788
|
+
this.#A = A, this.#I = cA(A, "C");
|
|
6046
5789
|
}
|
|
6047
5790
|
static fromConfig(A, I) {
|
|
6048
5791
|
return new Jg(I.shape);
|
|
@@ -6122,7 +5865,7 @@ async function eB(g) {
|
|
|
6122
5865
|
function wE(g) {
|
|
6123
5866
|
return g.data_type !== "v2:object";
|
|
6124
5867
|
}
|
|
6125
|
-
class
|
|
5868
|
+
class GI extends Error {
|
|
6126
5869
|
constructor(A, I = {}) {
|
|
6127
5870
|
super(`Node not found: ${A}`, I), this.name = "NodeNotFoundError";
|
|
6128
5871
|
}
|
|
@@ -6160,7 +5903,7 @@ function FE(g, A, I, B) {
|
|
|
6160
5903
|
});
|
|
6161
5904
|
};
|
|
6162
5905
|
}
|
|
6163
|
-
class
|
|
5906
|
+
class j {
|
|
6164
5907
|
store;
|
|
6165
5908
|
path;
|
|
6166
5909
|
constructor(A, I = "/") {
|
|
@@ -6168,10 +5911,10 @@ class z {
|
|
|
6168
5911
|
}
|
|
6169
5912
|
resolve(A) {
|
|
6170
5913
|
let I = new URL(`file://${this.path.endsWith("/") ? this.path : `${this.path}/`}`);
|
|
6171
|
-
return new
|
|
5914
|
+
return new j(this.store, decodeURIComponent(new URL(A, I).pathname));
|
|
6172
5915
|
}
|
|
6173
5916
|
}
|
|
6174
|
-
class Mg extends
|
|
5917
|
+
class Mg extends j {
|
|
6175
5918
|
kind = "group";
|
|
6176
5919
|
#A;
|
|
6177
5920
|
constructor(A, I, B) {
|
|
@@ -6184,9 +5927,9 @@ class Mg extends z {
|
|
|
6184
5927
|
function nB(g) {
|
|
6185
5928
|
return g.find((I) => I.name === "transpose")?.configuration?.order ?? "C";
|
|
6186
5929
|
}
|
|
6187
|
-
const
|
|
5930
|
+
const PA = Symbol("zarrita.context");
|
|
6188
5931
|
function rE(g) {
|
|
6189
|
-
return g[
|
|
5932
|
+
return g[PA];
|
|
6190
5933
|
}
|
|
6191
5934
|
function SE(g, A) {
|
|
6192
5935
|
let { configuration: I } = A.codecs.find(oE) ?? {}, B = {
|
|
@@ -6206,7 +5949,7 @@ function SE(g, A) {
|
|
|
6206
5949
|
codecs: I.codecs
|
|
6207
5950
|
}),
|
|
6208
5951
|
get_strides(E) {
|
|
6209
|
-
return
|
|
5952
|
+
return cA(E, Q);
|
|
6210
5953
|
},
|
|
6211
5954
|
get_chunk_bytes: FE(g, A.chunk_grid.configuration.chunk_shape, B.encode_chunk_key, I)
|
|
6212
5955
|
};
|
|
@@ -6222,7 +5965,7 @@ function SE(g, A) {
|
|
|
6222
5965
|
codecs: A.codecs
|
|
6223
5966
|
}),
|
|
6224
5967
|
get_strides(Q) {
|
|
6225
|
-
return
|
|
5968
|
+
return cA(Q, C);
|
|
6226
5969
|
},
|
|
6227
5970
|
async get_chunk_bytes(Q, E) {
|
|
6228
5971
|
let i = B.encode_chunk_key(Q), o = g.resolve(i).path;
|
|
@@ -6230,15 +5973,15 @@ function SE(g, A) {
|
|
|
6230
5973
|
}
|
|
6231
5974
|
};
|
|
6232
5975
|
}
|
|
6233
|
-
let JI = class extends
|
|
5976
|
+
let JI = class extends j {
|
|
6234
5977
|
kind = "array";
|
|
6235
5978
|
#A;
|
|
6236
|
-
[
|
|
5979
|
+
[PA];
|
|
6237
5980
|
constructor(A, I, B) {
|
|
6238
5981
|
super(A, I), this.#A = {
|
|
6239
5982
|
...B,
|
|
6240
5983
|
fill_value: bB(B)
|
|
6241
|
-
}, this[
|
|
5984
|
+
}, this[PA] = SE(this, B);
|
|
6242
5985
|
}
|
|
6243
5986
|
get attrs() {
|
|
6244
5987
|
return this.#A.attributes;
|
|
@@ -6247,13 +5990,13 @@ let JI = class extends z {
|
|
|
6247
5990
|
return this.#A.shape;
|
|
6248
5991
|
}
|
|
6249
5992
|
get chunks() {
|
|
6250
|
-
return this[
|
|
5993
|
+
return this[PA].chunk_shape;
|
|
6251
5994
|
}
|
|
6252
5995
|
get dtype() {
|
|
6253
5996
|
return this.#A.data_type;
|
|
6254
5997
|
}
|
|
6255
5998
|
async getChunk(A, I) {
|
|
6256
|
-
let B = this[
|
|
5999
|
+
let B = this[PA], C = await B.get_chunk_bytes(A, I);
|
|
6257
6000
|
if (!C) {
|
|
6258
6001
|
let Q = B.chunk_shape.reduce((i, o) => i * o, 1), E = new B.TypedArray(Q);
|
|
6259
6002
|
return E.fill(B.fill_value), {
|
|
@@ -6576,50 +6319,50 @@ function TE() {
|
|
|
6576
6319
|
}
|
|
6577
6320
|
async function xE(g) {
|
|
6578
6321
|
let A = await g.store.get(g.resolve(".zattrs").path);
|
|
6579
|
-
return A ?
|
|
6322
|
+
return A ? eI(A) : {};
|
|
6580
6323
|
}
|
|
6581
6324
|
async function WE(g, A = {}) {
|
|
6582
|
-
let I = "store" in g ? g : new
|
|
6583
|
-
return (A.attrs ?? !0) && (B = await xE(I)), A.kind === "array" ? FB(I, B) : A.kind === "group" ? rB(I, B) : FB(I, B).catch((C) => (ZB(C,
|
|
6325
|
+
let I = "store" in g ? g : new j(g), B = {};
|
|
6326
|
+
return (A.attrs ?? !0) && (B = await xE(I)), A.kind === "array" ? FB(I, B) : A.kind === "group" ? rB(I, B) : FB(I, B).catch((C) => (ZB(C, GI), rB(I, B)));
|
|
6584
6327
|
}
|
|
6585
6328
|
async function FB(g, A) {
|
|
6586
6329
|
let { path: I } = g.resolve(".zarray"), B = await g.store.get(I);
|
|
6587
6330
|
if (!B)
|
|
6588
|
-
throw new
|
|
6331
|
+
throw new GI("v2 array", {
|
|
6589
6332
|
cause: new dg(I)
|
|
6590
6333
|
});
|
|
6591
|
-
return WI.increment(g.store, "v2"), new JI(g.store, g.path, QE(
|
|
6334
|
+
return WI.increment(g.store, "v2"), new JI(g.store, g.path, QE(eI(B), A));
|
|
6592
6335
|
}
|
|
6593
6336
|
async function rB(g, A) {
|
|
6594
6337
|
let { path: I } = g.resolve(".zgroup"), B = await g.store.get(I);
|
|
6595
6338
|
if (!B)
|
|
6596
|
-
throw new
|
|
6339
|
+
throw new GI("v2 group", {
|
|
6597
6340
|
cause: new dg(I)
|
|
6598
6341
|
});
|
|
6599
|
-
return WI.increment(g.store, "v2"), new Mg(g.store, g.path, EE(
|
|
6342
|
+
return WI.increment(g.store, "v2"), new Mg(g.store, g.path, EE(eI(B), A));
|
|
6600
6343
|
}
|
|
6601
6344
|
async function bE(g) {
|
|
6602
6345
|
let { store: A, path: I } = g.resolve("zarr.json"), B = await g.store.get(I);
|
|
6603
6346
|
if (!B)
|
|
6604
|
-
throw new
|
|
6347
|
+
throw new GI("v3 array or group", {
|
|
6605
6348
|
cause: new dg(I)
|
|
6606
6349
|
});
|
|
6607
|
-
let C =
|
|
6350
|
+
let C = eI(B);
|
|
6608
6351
|
return C.node_type === "array" && (C.fill_value = bB(C)), C.node_type === "array" ? new JI(A, g.path, C) : new Mg(A, g.path, C);
|
|
6609
6352
|
}
|
|
6610
6353
|
async function ZE(g, A = {}) {
|
|
6611
|
-
let I = "store" in g ? g : new
|
|
6354
|
+
let I = "store" in g ? g : new j(g), B = await bE(I);
|
|
6612
6355
|
if (WI.increment(I.store, "v3"), A.kind === void 0 || A.kind === "array" && B instanceof JI || A.kind === "group" && B instanceof Mg)
|
|
6613
6356
|
return B;
|
|
6614
6357
|
let C = B instanceof JI ? "array" : "group";
|
|
6615
6358
|
throw new Error(`Expected node of kind ${A.kind}, found ${C}.`);
|
|
6616
6359
|
}
|
|
6617
|
-
async function
|
|
6618
|
-
let I = "store" in g ? g.store : g, B = WI.version_max(I), C = B === "v2" ?
|
|
6619
|
-
return C(g, A).catch((E) => (ZB(E,
|
|
6360
|
+
async function AA(g, A = {}) {
|
|
6361
|
+
let I = "store" in g ? g.store : g, B = WI.version_max(I), C = B === "v2" ? AA.v2 : AA.v3, Q = B === "v2" ? AA.v3 : AA.v2;
|
|
6362
|
+
return C(g, A).catch((E) => (ZB(E, GI), Q(g, A)));
|
|
6620
6363
|
}
|
|
6621
|
-
|
|
6622
|
-
|
|
6364
|
+
AA.v2 = WE;
|
|
6365
|
+
AA.v3 = ZE;
|
|
6623
6366
|
async function PE(g, A) {
|
|
6624
6367
|
const I = A.split("/"), B = I.pop();
|
|
6625
6368
|
if (!B)
|
|
@@ -6656,7 +6399,7 @@ function OE() {
|
|
|
6656
6399
|
throw new Error(I);
|
|
6657
6400
|
}
|
|
6658
6401
|
}
|
|
6659
|
-
class lg extends
|
|
6402
|
+
class lg extends ZA {
|
|
6660
6403
|
credentials;
|
|
6661
6404
|
region;
|
|
6662
6405
|
// Cache signing keys per date/region combination (valid for 24 hours)
|
|
@@ -6783,21 +6526,21 @@ ${Y}`, L = await this.getSignatureKey(
|
|
|
6783
6526
|
return Array.from(A).map((I) => I.toString(16).padStart(2, "0")).join("");
|
|
6784
6527
|
}
|
|
6785
6528
|
}
|
|
6786
|
-
async function
|
|
6529
|
+
async function nI(g, A) {
|
|
6787
6530
|
if (A === "v2")
|
|
6788
6531
|
try {
|
|
6789
|
-
return
|
|
6532
|
+
return AA.v2(g, { kind: "group", attrs: !0 });
|
|
6790
6533
|
} catch {
|
|
6791
6534
|
throw new Error(`Failed to open Zarr v2 group at ${g}`);
|
|
6792
6535
|
}
|
|
6793
6536
|
if (A === "v3")
|
|
6794
6537
|
try {
|
|
6795
|
-
return
|
|
6538
|
+
return AA.v3(g, { kind: "group" });
|
|
6796
6539
|
} catch {
|
|
6797
6540
|
throw new Error(`Failed to open Zarr v3 group at ${g}`);
|
|
6798
6541
|
}
|
|
6799
6542
|
try {
|
|
6800
|
-
return
|
|
6543
|
+
return AA(g, { kind: "group" });
|
|
6801
6544
|
} catch {
|
|
6802
6545
|
throw new Error(`Failed to open Zarr group at ${g}`);
|
|
6803
6546
|
}
|
|
@@ -6805,18 +6548,18 @@ async function wI(g, A) {
|
|
|
6805
6548
|
async function VE(g, A) {
|
|
6806
6549
|
if (A === "v2")
|
|
6807
6550
|
try {
|
|
6808
|
-
return
|
|
6551
|
+
return AA.v2(g, { kind: "array", attrs: !1 });
|
|
6809
6552
|
} catch {
|
|
6810
6553
|
throw new Error(`Failed to open Zarr v2 array at ${g}`);
|
|
6811
6554
|
}
|
|
6812
6555
|
if (A === "v3")
|
|
6813
6556
|
try {
|
|
6814
|
-
return
|
|
6557
|
+
return AA.v3(g, { kind: "array" });
|
|
6815
6558
|
} catch {
|
|
6816
6559
|
throw new Error(`Failed to open Zarr v3 array at ${g}`);
|
|
6817
6560
|
}
|
|
6818
6561
|
try {
|
|
6819
|
-
return
|
|
6562
|
+
return AA(g, { kind: "array" });
|
|
6820
6563
|
} catch {
|
|
6821
6564
|
throw new Error(`Failed to open Zarr array at ${g}`);
|
|
6822
6565
|
}
|
|
@@ -6825,17 +6568,17 @@ async function vE(g) {
|
|
|
6825
6568
|
let A;
|
|
6826
6569
|
switch (g.type) {
|
|
6827
6570
|
case "fetch": {
|
|
6828
|
-
const B = new
|
|
6829
|
-
A = new
|
|
6571
|
+
const B = new ZA(g.url);
|
|
6572
|
+
A = new j(B);
|
|
6830
6573
|
break;
|
|
6831
6574
|
}
|
|
6832
6575
|
case "s3": {
|
|
6833
6576
|
const B = new lg(g);
|
|
6834
|
-
A = new
|
|
6577
|
+
A = new j(B);
|
|
6835
6578
|
break;
|
|
6836
6579
|
}
|
|
6837
6580
|
case "filesystem": {
|
|
6838
|
-
A = new
|
|
6581
|
+
A = new j(
|
|
6839
6582
|
new qg(g.directoryHandle),
|
|
6840
6583
|
g.path
|
|
6841
6584
|
);
|
|
@@ -6861,7 +6604,7 @@ function XE(g, A, I) {
|
|
|
6861
6604
|
overrides: g.store.overrides,
|
|
6862
6605
|
useSuffixRequest: g.store.useSuffixRequest
|
|
6863
6606
|
};
|
|
6864
|
-
if (g.store instanceof
|
|
6607
|
+
if (g.store instanceof ZA)
|
|
6865
6608
|
return {
|
|
6866
6609
|
type: "fetch",
|
|
6867
6610
|
arrayPath: A,
|
|
@@ -10046,17 +9789,17 @@ function jE(g) {
|
|
|
10046
9789
|
}
|
|
10047
9790
|
}
|
|
10048
9791
|
const zE = Math.min(navigator.hardwareConcurrency, 8);
|
|
10049
|
-
let
|
|
10050
|
-
const
|
|
9792
|
+
let BA = [], _E = 0, vB = 0;
|
|
9793
|
+
const UA = /* @__PURE__ */ new Map(), dI = /* @__PURE__ */ new Set();
|
|
10051
9794
|
function XB(g) {
|
|
10052
|
-
const A =
|
|
9795
|
+
const A = BA.find((I) => I.worker === g);
|
|
10053
9796
|
return A || U.error(
|
|
10054
9797
|
"ZarrWorker",
|
|
10055
9798
|
"Worker not found in pool - this should not happen"
|
|
10056
9799
|
), A;
|
|
10057
9800
|
}
|
|
10058
9801
|
function $E(g, A) {
|
|
10059
|
-
const { id: I, success: B } = g.data, C =
|
|
9802
|
+
const { id: I, success: B } = g.data, C = UA.get(I);
|
|
10060
9803
|
if (!C) {
|
|
10061
9804
|
dI.has(I) ? dI.delete(I) : U.warn(
|
|
10062
9805
|
"ZarrWorker",
|
|
@@ -10065,7 +9808,7 @@ function $E(g, A) {
|
|
|
10065
9808
|
);
|
|
10066
9809
|
return;
|
|
10067
9810
|
}
|
|
10068
|
-
|
|
9811
|
+
UA.delete(I), C.abortListener && C.abortSignal && C.abortSignal.removeEventListener("abort", C.abortListener);
|
|
10069
9812
|
const Q = XB(A);
|
|
10070
9813
|
Q && Q.pendingCount > 0 ? Q.pendingCount-- : Q && U.error(
|
|
10071
9814
|
"ZarrWorker",
|
|
@@ -10087,16 +9830,16 @@ function RB(g, A) {
|
|
|
10087
9830
|
);
|
|
10088
9831
|
const I = XB(A);
|
|
10089
9832
|
if (I) {
|
|
10090
|
-
const C =
|
|
10091
|
-
|
|
9833
|
+
const C = BA.indexOf(I);
|
|
9834
|
+
BA.splice(C, 1);
|
|
10092
9835
|
}
|
|
10093
9836
|
const B = I?.workerId;
|
|
10094
9837
|
if (B !== void 0)
|
|
10095
|
-
for (const [C, Q] of
|
|
10096
|
-
Q.workerId === B && (Q.reject(new Error(`Worker error: ${g.message}`)),
|
|
9838
|
+
for (const [C, Q] of UA.entries())
|
|
9839
|
+
Q.workerId === B && (Q.reject(new Error(`Worker error: ${g.message}`)), UA.delete(C));
|
|
10097
9840
|
try {
|
|
10098
9841
|
const C = jB();
|
|
10099
|
-
|
|
9842
|
+
BA.push({
|
|
10100
9843
|
worker: C,
|
|
10101
9844
|
pendingCount: 0,
|
|
10102
9845
|
workerId: vB++
|
|
@@ -10113,9 +9856,9 @@ function jB() {
|
|
|
10113
9856
|
), g;
|
|
10114
9857
|
}
|
|
10115
9858
|
function Ai() {
|
|
10116
|
-
if (
|
|
9859
|
+
if (BA.length === 0)
|
|
10117
9860
|
throw new Error("Worker pool is not initialized");
|
|
10118
|
-
return
|
|
9861
|
+
return BA.sort((g, A) => g.pendingCount - A.pendingCount)[0];
|
|
10119
9862
|
}
|
|
10120
9863
|
async function Ii(g, A, I) {
|
|
10121
9864
|
return new Promise((B, C) => {
|
|
@@ -10124,12 +9867,12 @@ async function Ii(g, A, I) {
|
|
|
10124
9867
|
reject: C,
|
|
10125
9868
|
workerId: Q.workerId
|
|
10126
9869
|
};
|
|
10127
|
-
if (
|
|
9870
|
+
if (UA.set(E, i), I?.signal) {
|
|
10128
9871
|
const o = () => {
|
|
10129
9872
|
Q.worker.postMessage({
|
|
10130
9873
|
id: E,
|
|
10131
9874
|
type: "cancel"
|
|
10132
|
-
}),
|
|
9875
|
+
}), UA.delete(E), dI.add(E), Q.pendingCount--, C(new DOMException("Operation was aborted", "AbortError"));
|
|
10133
9876
|
};
|
|
10134
9877
|
if (I.signal.aborted) {
|
|
10135
9878
|
o(), dI.delete(E);
|
|
@@ -10146,11 +9889,11 @@ async function Ii(g, A, I) {
|
|
|
10146
9889
|
});
|
|
10147
9890
|
}
|
|
10148
9891
|
function gi() {
|
|
10149
|
-
if (!(
|
|
9892
|
+
if (!(BA.length > 0))
|
|
10150
9893
|
try {
|
|
10151
9894
|
for (let g = 0; g < zE; g++) {
|
|
10152
9895
|
const A = jB();
|
|
10153
|
-
|
|
9896
|
+
BA.push({
|
|
10154
9897
|
worker: A,
|
|
10155
9898
|
pendingCount: 0,
|
|
10156
9899
|
workerId: vB++
|
|
@@ -10158,7 +9901,7 @@ function gi() {
|
|
|
10158
9901
|
}
|
|
10159
9902
|
U.debug(
|
|
10160
9903
|
"ZarrWorker",
|
|
10161
|
-
`Initialized worker pool with ${
|
|
9904
|
+
`Initialized worker pool with ${BA.length} workers`
|
|
10162
9905
|
);
|
|
10163
9906
|
} catch {
|
|
10164
9907
|
U.warn("ZarrWorker", "Failed to create workers - clearing pool"), Ci();
|
|
@@ -10176,9 +9919,9 @@ async function Bi(g, A, I, B) {
|
|
|
10176
9919
|
}
|
|
10177
9920
|
}
|
|
10178
9921
|
function Ci() {
|
|
10179
|
-
for (const g of
|
|
9922
|
+
for (const g of BA)
|
|
10180
9923
|
g.worker.terminate();
|
|
10181
|
-
|
|
9924
|
+
BA = [], UA.clear();
|
|
10182
9925
|
}
|
|
10183
9926
|
class Qi {
|
|
10184
9927
|
promises_ = [];
|
|
@@ -10455,7 +10198,7 @@ const S = H.arrayToEnum([
|
|
|
10455
10198
|
"never",
|
|
10456
10199
|
"map",
|
|
10457
10200
|
"set"
|
|
10458
|
-
]),
|
|
10201
|
+
]), hA = (g) => {
|
|
10459
10202
|
switch (typeof g) {
|
|
10460
10203
|
case "undefined":
|
|
10461
10204
|
return S.undefined;
|
|
@@ -10494,7 +10237,7 @@ const S = H.arrayToEnum([
|
|
|
10494
10237
|
"not_multiple_of",
|
|
10495
10238
|
"not_finite"
|
|
10496
10239
|
]), oi = (g) => JSON.stringify(g, null, 2).replace(/"([^"]+)":/g, "$1:");
|
|
10497
|
-
class
|
|
10240
|
+
class _ extends Error {
|
|
10498
10241
|
get errors() {
|
|
10499
10242
|
return this.issues;
|
|
10500
10243
|
}
|
|
@@ -10531,7 +10274,7 @@ class $ extends Error {
|
|
|
10531
10274
|
return C(this), B;
|
|
10532
10275
|
}
|
|
10533
10276
|
static assert(A) {
|
|
10534
|
-
if (!(A instanceof
|
|
10277
|
+
if (!(A instanceof _))
|
|
10535
10278
|
throw new Error(`Not a ZodError: ${A}`);
|
|
10536
10279
|
}
|
|
10537
10280
|
toString() {
|
|
@@ -10553,8 +10296,8 @@ class $ extends Error {
|
|
|
10553
10296
|
return this.flatten();
|
|
10554
10297
|
}
|
|
10555
10298
|
}
|
|
10556
|
-
|
|
10557
|
-
const
|
|
10299
|
+
_.create = (g) => new _(g);
|
|
10300
|
+
const mA = (g, A) => {
|
|
10558
10301
|
let I;
|
|
10559
10302
|
switch (g.code) {
|
|
10560
10303
|
case e.invalid_type:
|
|
@@ -10610,7 +10353,7 @@ const uA = (g, A) => {
|
|
|
10610
10353
|
}
|
|
10611
10354
|
return { message: I };
|
|
10612
10355
|
};
|
|
10613
|
-
let _B =
|
|
10356
|
+
let _B = mA;
|
|
10614
10357
|
function ai(g) {
|
|
10615
10358
|
_B = g;
|
|
10616
10359
|
}
|
|
@@ -10650,13 +10393,13 @@ function F(g, A) {
|
|
|
10650
10393
|
// then schema-bound map if available
|
|
10651
10394
|
I,
|
|
10652
10395
|
// then global override map
|
|
10653
|
-
I ===
|
|
10396
|
+
I === mA ? void 0 : mA
|
|
10654
10397
|
// then global default map
|
|
10655
10398
|
].filter((C) => !!C)
|
|
10656
10399
|
});
|
|
10657
10400
|
g.common.issues.push(B);
|
|
10658
10401
|
}
|
|
10659
|
-
class
|
|
10402
|
+
class v {
|
|
10660
10403
|
constructor() {
|
|
10661
10404
|
this.value = "valid";
|
|
10662
10405
|
}
|
|
@@ -10684,7 +10427,7 @@ class X {
|
|
|
10684
10427
|
value: E
|
|
10685
10428
|
});
|
|
10686
10429
|
}
|
|
10687
|
-
return
|
|
10430
|
+
return v.mergeObjectSync(A, B);
|
|
10688
10431
|
}
|
|
10689
10432
|
static mergeObjectSync(A, I) {
|
|
10690
10433
|
const B = {};
|
|
@@ -10699,7 +10442,7 @@ class X {
|
|
|
10699
10442
|
}
|
|
10700
10443
|
const d = Object.freeze({
|
|
10701
10444
|
status: "aborted"
|
|
10702
|
-
}),
|
|
10445
|
+
}), MA = (g) => ({ status: "dirty", value: g }), X = (g) => ({ status: "valid", value: g }), Dg = (g) => g.status === "aborted", hg = (g) => g.status === "dirty", kA = (g) => g.status === "valid", AI = (g) => typeof Promise < "u" && g instanceof Promise;
|
|
10703
10446
|
function HI(g, A, I, B) {
|
|
10704
10447
|
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");
|
|
10705
10448
|
return A.get(g);
|
|
@@ -10712,8 +10455,8 @@ var N;
|
|
|
10712
10455
|
(function(g) {
|
|
10713
10456
|
g.errToObj = (A) => typeof A == "string" ? { message: A } : A || {}, g.toString = (A) => typeof A == "string" ? A : A?.message;
|
|
10714
10457
|
})(N || (N = {}));
|
|
10715
|
-
var
|
|
10716
|
-
class
|
|
10458
|
+
var OA, VA;
|
|
10459
|
+
class aA {
|
|
10717
10460
|
constructor(A, I, B, C) {
|
|
10718
10461
|
this._cachedPath = [], this.parent = A, this.data = I, this._path = B, this._key = C;
|
|
10719
10462
|
}
|
|
@@ -10722,7 +10465,7 @@ class sA {
|
|
|
10722
10465
|
}
|
|
10723
10466
|
}
|
|
10724
10467
|
const UB = (g, A) => {
|
|
10725
|
-
if (
|
|
10468
|
+
if (kA(A))
|
|
10726
10469
|
return { success: !0, data: A.value };
|
|
10727
10470
|
if (!g.common.issues.length)
|
|
10728
10471
|
throw new Error("Validation failed but no issues detected.");
|
|
@@ -10731,7 +10474,7 @@ const UB = (g, A) => {
|
|
|
10731
10474
|
get error() {
|
|
10732
10475
|
if (this._error)
|
|
10733
10476
|
return this._error;
|
|
10734
|
-
const I = new
|
|
10477
|
+
const I = new _(g.common.issues);
|
|
10735
10478
|
return this._error = I, this._error;
|
|
10736
10479
|
}
|
|
10737
10480
|
};
|
|
@@ -10753,13 +10496,13 @@ class K {
|
|
|
10753
10496
|
return this._def.description;
|
|
10754
10497
|
}
|
|
10755
10498
|
_getType(A) {
|
|
10756
|
-
return
|
|
10499
|
+
return hA(A.data);
|
|
10757
10500
|
}
|
|
10758
10501
|
_getOrReturnCtx(A, I) {
|
|
10759
10502
|
return I || {
|
|
10760
10503
|
common: A.parent.common,
|
|
10761
10504
|
data: A.data,
|
|
10762
|
-
parsedType:
|
|
10505
|
+
parsedType: hA(A.data),
|
|
10763
10506
|
schemaErrorMap: this._def.errorMap,
|
|
10764
10507
|
path: A.path,
|
|
10765
10508
|
parent: A.parent
|
|
@@ -10767,11 +10510,11 @@ class K {
|
|
|
10767
10510
|
}
|
|
10768
10511
|
_processInputParams(A) {
|
|
10769
10512
|
return {
|
|
10770
|
-
status: new
|
|
10513
|
+
status: new v(),
|
|
10771
10514
|
ctx: {
|
|
10772
10515
|
common: A.parent.common,
|
|
10773
10516
|
data: A.data,
|
|
10774
|
-
parsedType:
|
|
10517
|
+
parsedType: hA(A.data),
|
|
10775
10518
|
schemaErrorMap: this._def.errorMap,
|
|
10776
10519
|
path: A.path,
|
|
10777
10520
|
parent: A.parent
|
|
@@ -10780,7 +10523,7 @@ class K {
|
|
|
10780
10523
|
}
|
|
10781
10524
|
_parseSync(A) {
|
|
10782
10525
|
const I = this._parse(A);
|
|
10783
|
-
if (
|
|
10526
|
+
if (AI(I))
|
|
10784
10527
|
throw new Error("Synchronous parse encountered promise.");
|
|
10785
10528
|
return I;
|
|
10786
10529
|
}
|
|
@@ -10806,7 +10549,7 @@ class K {
|
|
|
10806
10549
|
schemaErrorMap: this._def.errorMap,
|
|
10807
10550
|
parent: null,
|
|
10808
10551
|
data: A,
|
|
10809
|
-
parsedType:
|
|
10552
|
+
parsedType: hA(A)
|
|
10810
10553
|
}, Q = this._parseSync({ data: A, path: C.path, parent: C });
|
|
10811
10554
|
return UB(C, Q);
|
|
10812
10555
|
}
|
|
@@ -10821,12 +10564,12 @@ class K {
|
|
|
10821
10564
|
schemaErrorMap: this._def.errorMap,
|
|
10822
10565
|
parent: null,
|
|
10823
10566
|
data: A,
|
|
10824
|
-
parsedType:
|
|
10567
|
+
parsedType: hA(A)
|
|
10825
10568
|
};
|
|
10826
10569
|
if (!this["~standard"].async)
|
|
10827
10570
|
try {
|
|
10828
10571
|
const Q = this._parseSync({ data: A, path: [], parent: C });
|
|
10829
|
-
return
|
|
10572
|
+
return kA(Q) ? {
|
|
10830
10573
|
value: Q.value
|
|
10831
10574
|
} : {
|
|
10832
10575
|
issues: C.common.issues
|
|
@@ -10837,7 +10580,7 @@ class K {
|
|
|
10837
10580
|
async: !0
|
|
10838
10581
|
};
|
|
10839
10582
|
}
|
|
10840
|
-
return this._parseAsync({ data: A, path: [], parent: C }).then((Q) =>
|
|
10583
|
+
return this._parseAsync({ data: A, path: [], parent: C }).then((Q) => kA(Q) ? {
|
|
10841
10584
|
value: Q.value
|
|
10842
10585
|
} : {
|
|
10843
10586
|
issues: C.common.issues
|
|
@@ -10860,8 +10603,8 @@ class K {
|
|
|
10860
10603
|
schemaErrorMap: this._def.errorMap,
|
|
10861
10604
|
parent: null,
|
|
10862
10605
|
data: A,
|
|
10863
|
-
parsedType:
|
|
10864
|
-
}, C = this._parse({ data: A, path: B.path, parent: B }), Q = await (
|
|
10606
|
+
parsedType: hA(A)
|
|
10607
|
+
}, C = this._parse({ data: A, path: B.path, parent: B }), Q = await (AI(C) ? C : Promise.resolve(C));
|
|
10865
10608
|
return UB(B, Q);
|
|
10866
10609
|
}
|
|
10867
10610
|
refine(A, I) {
|
|
@@ -10878,7 +10621,7 @@ class K {
|
|
|
10878
10621
|
return this._refinement((B, C) => A(B) ? !0 : (C.addIssue(typeof I == "function" ? I(B, C) : I), !1));
|
|
10879
10622
|
}
|
|
10880
10623
|
_refinement(A) {
|
|
10881
|
-
return new
|
|
10624
|
+
return new QA({
|
|
10882
10625
|
schema: this,
|
|
10883
10626
|
typeName: J.ZodEffects,
|
|
10884
10627
|
effect: { type: "refinement", refinement: A }
|
|
@@ -10895,28 +10638,28 @@ class K {
|
|
|
10895
10638
|
};
|
|
10896
10639
|
}
|
|
10897
10640
|
optional() {
|
|
10898
|
-
return
|
|
10641
|
+
return oA.create(this, this._def);
|
|
10899
10642
|
}
|
|
10900
10643
|
nullable() {
|
|
10901
|
-
return
|
|
10644
|
+
return nA.create(this, this._def);
|
|
10902
10645
|
}
|
|
10903
10646
|
nullish() {
|
|
10904
10647
|
return this.nullable().optional();
|
|
10905
10648
|
}
|
|
10906
10649
|
array() {
|
|
10907
|
-
return
|
|
10650
|
+
return CA.create(this);
|
|
10908
10651
|
}
|
|
10909
10652
|
promise() {
|
|
10910
|
-
return
|
|
10653
|
+
return TA.create(this, this._def);
|
|
10911
10654
|
}
|
|
10912
10655
|
or(A) {
|
|
10913
|
-
return
|
|
10656
|
+
return CI.create([this, A], this._def);
|
|
10914
10657
|
}
|
|
10915
10658
|
and(A) {
|
|
10916
|
-
return
|
|
10659
|
+
return QI.create(this, A, this._def);
|
|
10917
10660
|
}
|
|
10918
10661
|
transform(A) {
|
|
10919
|
-
return new
|
|
10662
|
+
return new QA({
|
|
10920
10663
|
...M(this._def),
|
|
10921
10664
|
schema: this,
|
|
10922
10665
|
typeName: J.ZodEffects,
|
|
@@ -10925,7 +10668,7 @@ class K {
|
|
|
10925
10668
|
}
|
|
10926
10669
|
default(A) {
|
|
10927
10670
|
const I = typeof A == "function" ? A : () => A;
|
|
10928
|
-
return new
|
|
10671
|
+
return new sI({
|
|
10929
10672
|
...M(this._def),
|
|
10930
10673
|
innerType: this,
|
|
10931
10674
|
defaultValue: I,
|
|
@@ -10941,7 +10684,7 @@ class K {
|
|
|
10941
10684
|
}
|
|
10942
10685
|
catch(A) {
|
|
10943
10686
|
const I = typeof A == "function" ? A : () => A;
|
|
10944
|
-
return new
|
|
10687
|
+
return new DI({
|
|
10945
10688
|
...M(this._def),
|
|
10946
10689
|
innerType: this,
|
|
10947
10690
|
catchValue: I,
|
|
@@ -10956,10 +10699,10 @@ class K {
|
|
|
10956
10699
|
});
|
|
10957
10700
|
}
|
|
10958
10701
|
pipe(A) {
|
|
10959
|
-
return
|
|
10702
|
+
return wI.create(this, A);
|
|
10960
10703
|
}
|
|
10961
10704
|
readonly() {
|
|
10962
|
-
return
|
|
10705
|
+
return hI.create(this);
|
|
10963
10706
|
}
|
|
10964
10707
|
isOptional() {
|
|
10965
10708
|
return this.safeParse(void 0).success;
|
|
@@ -10999,7 +10742,7 @@ function Yi(g, A) {
|
|
|
10999
10742
|
function di(g, A) {
|
|
11000
10743
|
return !!((A === "v4" || !A) && Si.test(g) || (A === "v6" || !A) && Ni.test(g));
|
|
11001
10744
|
}
|
|
11002
|
-
class
|
|
10745
|
+
class IA extends K {
|
|
11003
10746
|
_parse(A) {
|
|
11004
10747
|
if (this._def.coerce && (A.data = String(A.data)), this._getType(A) !== S.string) {
|
|
11005
10748
|
const Q = this._getOrReturnCtx(A);
|
|
@@ -11009,7 +10752,7 @@ class gA extends K {
|
|
|
11009
10752
|
received: Q.parsedType
|
|
11010
10753
|
}), d;
|
|
11011
10754
|
}
|
|
11012
|
-
const B = new
|
|
10755
|
+
const B = new v();
|
|
11013
10756
|
let C;
|
|
11014
10757
|
for (const Q of this._def.checks)
|
|
11015
10758
|
if (Q.kind === "min")
|
|
@@ -11162,7 +10905,7 @@ class gA extends K {
|
|
|
11162
10905
|
});
|
|
11163
10906
|
}
|
|
11164
10907
|
_addCheck(A) {
|
|
11165
|
-
return new
|
|
10908
|
+
return new IA({
|
|
11166
10909
|
...this._def,
|
|
11167
10910
|
checks: [...this._def.checks, A]
|
|
11168
10911
|
});
|
|
@@ -11299,19 +11042,19 @@ class gA extends K {
|
|
|
11299
11042
|
return this.min(1, N.errToObj(A));
|
|
11300
11043
|
}
|
|
11301
11044
|
trim() {
|
|
11302
|
-
return new
|
|
11045
|
+
return new IA({
|
|
11303
11046
|
...this._def,
|
|
11304
11047
|
checks: [...this._def.checks, { kind: "trim" }]
|
|
11305
11048
|
});
|
|
11306
11049
|
}
|
|
11307
11050
|
toLowerCase() {
|
|
11308
|
-
return new
|
|
11051
|
+
return new IA({
|
|
11309
11052
|
...this._def,
|
|
11310
11053
|
checks: [...this._def.checks, { kind: "toLowerCase" }]
|
|
11311
11054
|
});
|
|
11312
11055
|
}
|
|
11313
11056
|
toUpperCase() {
|
|
11314
|
-
return new
|
|
11057
|
+
return new IA({
|
|
11315
11058
|
...this._def,
|
|
11316
11059
|
checks: [...this._def.checks, { kind: "toUpperCase" }]
|
|
11317
11060
|
});
|
|
@@ -11377,9 +11120,9 @@ class gA extends K {
|
|
|
11377
11120
|
return A;
|
|
11378
11121
|
}
|
|
11379
11122
|
}
|
|
11380
|
-
|
|
11123
|
+
IA.create = (g) => {
|
|
11381
11124
|
var A;
|
|
11382
|
-
return new
|
|
11125
|
+
return new IA({
|
|
11383
11126
|
checks: [],
|
|
11384
11127
|
typeName: J.ZodString,
|
|
11385
11128
|
coerce: (A = g?.coerce) !== null && A !== void 0 ? A : !1,
|
|
@@ -11390,7 +11133,7 @@ function Mi(g, A) {
|
|
|
11390
11133
|
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(".", ""));
|
|
11391
11134
|
return Q % E / Math.pow(10, C);
|
|
11392
11135
|
}
|
|
11393
|
-
class
|
|
11136
|
+
class yA extends K {
|
|
11394
11137
|
constructor() {
|
|
11395
11138
|
super(...arguments), this.min = this.gte, this.max = this.lte, this.step = this.multipleOf;
|
|
11396
11139
|
}
|
|
@@ -11404,7 +11147,7 @@ class eA extends K {
|
|
|
11404
11147
|
}), d;
|
|
11405
11148
|
}
|
|
11406
11149
|
let B;
|
|
11407
|
-
const C = new
|
|
11150
|
+
const C = new v();
|
|
11408
11151
|
for (const Q of this._def.checks)
|
|
11409
11152
|
Q.kind === "int" ? H.isInteger(A.data) || (B = this._getOrReturnCtx(A, B), F(B, {
|
|
11410
11153
|
code: e.invalid_type,
|
|
@@ -11448,7 +11191,7 @@ class eA extends K {
|
|
|
11448
11191
|
return this.setLimit("max", A, !1, N.toString(I));
|
|
11449
11192
|
}
|
|
11450
11193
|
setLimit(A, I, B, C) {
|
|
11451
|
-
return new
|
|
11194
|
+
return new yA({
|
|
11452
11195
|
...this._def,
|
|
11453
11196
|
checks: [
|
|
11454
11197
|
...this._def.checks,
|
|
@@ -11462,7 +11205,7 @@ class eA extends K {
|
|
|
11462
11205
|
});
|
|
11463
11206
|
}
|
|
11464
11207
|
_addCheck(A) {
|
|
11465
|
-
return new
|
|
11208
|
+
return new yA({
|
|
11466
11209
|
...this._def,
|
|
11467
11210
|
checks: [...this._def.checks, A]
|
|
11468
11211
|
});
|
|
@@ -11556,13 +11299,13 @@ class eA extends K {
|
|
|
11556
11299
|
return Number.isFinite(I) && Number.isFinite(A);
|
|
11557
11300
|
}
|
|
11558
11301
|
}
|
|
11559
|
-
|
|
11302
|
+
yA.create = (g) => new yA({
|
|
11560
11303
|
checks: [],
|
|
11561
11304
|
typeName: J.ZodNumber,
|
|
11562
11305
|
coerce: g?.coerce || !1,
|
|
11563
11306
|
...M(g)
|
|
11564
11307
|
});
|
|
11565
|
-
class
|
|
11308
|
+
class eA extends K {
|
|
11566
11309
|
constructor() {
|
|
11567
11310
|
super(...arguments), this.min = this.gte, this.max = this.lte;
|
|
11568
11311
|
}
|
|
@@ -11576,7 +11319,7 @@ class GA extends K {
|
|
|
11576
11319
|
if (this._getType(A) !== S.bigint)
|
|
11577
11320
|
return this._getInvalidInput(A);
|
|
11578
11321
|
let B;
|
|
11579
|
-
const C = new
|
|
11322
|
+
const C = new v();
|
|
11580
11323
|
for (const Q of this._def.checks)
|
|
11581
11324
|
Q.kind === "min" ? (Q.inclusive ? A.data < Q.value : A.data <= Q.value) && (B = this._getOrReturnCtx(A, B), F(B, {
|
|
11582
11325
|
code: e.too_small,
|
|
@@ -11618,7 +11361,7 @@ class GA extends K {
|
|
|
11618
11361
|
return this.setLimit("max", A, !1, N.toString(I));
|
|
11619
11362
|
}
|
|
11620
11363
|
setLimit(A, I, B, C) {
|
|
11621
|
-
return new
|
|
11364
|
+
return new eA({
|
|
11622
11365
|
...this._def,
|
|
11623
11366
|
checks: [
|
|
11624
11367
|
...this._def.checks,
|
|
@@ -11632,7 +11375,7 @@ class GA extends K {
|
|
|
11632
11375
|
});
|
|
11633
11376
|
}
|
|
11634
11377
|
_addCheck(A) {
|
|
11635
|
-
return new
|
|
11378
|
+
return new eA({
|
|
11636
11379
|
...this._def,
|
|
11637
11380
|
checks: [...this._def.checks, A]
|
|
11638
11381
|
});
|
|
@@ -11689,16 +11432,16 @@ class GA extends K {
|
|
|
11689
11432
|
return A;
|
|
11690
11433
|
}
|
|
11691
11434
|
}
|
|
11692
|
-
|
|
11435
|
+
eA.create = (g) => {
|
|
11693
11436
|
var A;
|
|
11694
|
-
return new
|
|
11437
|
+
return new eA({
|
|
11695
11438
|
checks: [],
|
|
11696
11439
|
typeName: J.ZodBigInt,
|
|
11697
11440
|
coerce: (A = g?.coerce) !== null && A !== void 0 ? A : !1,
|
|
11698
11441
|
...M(g)
|
|
11699
11442
|
});
|
|
11700
11443
|
};
|
|
11701
|
-
class
|
|
11444
|
+
class II extends K {
|
|
11702
11445
|
_parse(A) {
|
|
11703
11446
|
if (this._def.coerce && (A.data = !!A.data), this._getType(A) !== S.boolean) {
|
|
11704
11447
|
const B = this._getOrReturnCtx(A);
|
|
@@ -11708,15 +11451,15 @@ class gI extends K {
|
|
|
11708
11451
|
received: B.parsedType
|
|
11709
11452
|
}), d;
|
|
11710
11453
|
}
|
|
11711
|
-
return
|
|
11454
|
+
return X(A.data);
|
|
11712
11455
|
}
|
|
11713
11456
|
}
|
|
11714
|
-
|
|
11457
|
+
II.create = (g) => new II({
|
|
11715
11458
|
typeName: J.ZodBoolean,
|
|
11716
11459
|
coerce: g?.coerce || !1,
|
|
11717
11460
|
...M(g)
|
|
11718
11461
|
});
|
|
11719
|
-
class
|
|
11462
|
+
class LA extends K {
|
|
11720
11463
|
_parse(A) {
|
|
11721
11464
|
if (this._def.coerce && (A.data = new Date(A.data)), this._getType(A) !== S.date) {
|
|
11722
11465
|
const Q = this._getOrReturnCtx(A);
|
|
@@ -11732,7 +11475,7 @@ class JA extends K {
|
|
|
11732
11475
|
code: e.invalid_date
|
|
11733
11476
|
}), d;
|
|
11734
11477
|
}
|
|
11735
|
-
const B = new
|
|
11478
|
+
const B = new v();
|
|
11736
11479
|
let C;
|
|
11737
11480
|
for (const Q of this._def.checks)
|
|
11738
11481
|
Q.kind === "min" ? A.data.getTime() < Q.value && (C = this._getOrReturnCtx(A, C), F(C, {
|
|
@@ -11756,7 +11499,7 @@ class JA extends K {
|
|
|
11756
11499
|
};
|
|
11757
11500
|
}
|
|
11758
11501
|
_addCheck(A) {
|
|
11759
|
-
return new
|
|
11502
|
+
return new LA({
|
|
11760
11503
|
...this._def,
|
|
11761
11504
|
checks: [...this._def.checks, A]
|
|
11762
11505
|
});
|
|
@@ -11788,7 +11531,7 @@ class JA extends K {
|
|
|
11788
11531
|
return A != null ? new Date(A) : null;
|
|
11789
11532
|
}
|
|
11790
11533
|
}
|
|
11791
|
-
|
|
11534
|
+
LA.create = (g) => new LA({
|
|
11792
11535
|
checks: [],
|
|
11793
11536
|
coerce: g?.coerce || !1,
|
|
11794
11537
|
typeName: J.ZodDate,
|
|
@@ -11804,14 +11547,14 @@ class qI extends K {
|
|
|
11804
11547
|
received: B.parsedType
|
|
11805
11548
|
}), d;
|
|
11806
11549
|
}
|
|
11807
|
-
return
|
|
11550
|
+
return X(A.data);
|
|
11808
11551
|
}
|
|
11809
11552
|
}
|
|
11810
11553
|
qI.create = (g) => new qI({
|
|
11811
11554
|
typeName: J.ZodSymbol,
|
|
11812
11555
|
...M(g)
|
|
11813
11556
|
});
|
|
11814
|
-
class
|
|
11557
|
+
class gI extends K {
|
|
11815
11558
|
_parse(A) {
|
|
11816
11559
|
if (this._getType(A) !== S.undefined) {
|
|
11817
11560
|
const B = this._getOrReturnCtx(A);
|
|
@@ -11821,14 +11564,14 @@ class BI extends K {
|
|
|
11821
11564
|
received: B.parsedType
|
|
11822
11565
|
}), d;
|
|
11823
11566
|
}
|
|
11824
|
-
return
|
|
11567
|
+
return X(A.data);
|
|
11825
11568
|
}
|
|
11826
11569
|
}
|
|
11827
|
-
|
|
11570
|
+
gI.create = (g) => new gI({
|
|
11828
11571
|
typeName: J.ZodUndefined,
|
|
11829
11572
|
...M(g)
|
|
11830
11573
|
});
|
|
11831
|
-
class
|
|
11574
|
+
class BI extends K {
|
|
11832
11575
|
_parse(A) {
|
|
11833
11576
|
if (this._getType(A) !== S.null) {
|
|
11834
11577
|
const B = this._getOrReturnCtx(A);
|
|
@@ -11838,38 +11581,38 @@ class CI extends K {
|
|
|
11838
11581
|
received: B.parsedType
|
|
11839
11582
|
}), d;
|
|
11840
11583
|
}
|
|
11841
|
-
return
|
|
11584
|
+
return X(A.data);
|
|
11842
11585
|
}
|
|
11843
11586
|
}
|
|
11844
|
-
|
|
11587
|
+
BI.create = (g) => new BI({
|
|
11845
11588
|
typeName: J.ZodNull,
|
|
11846
11589
|
...M(g)
|
|
11847
11590
|
});
|
|
11848
|
-
class
|
|
11591
|
+
class uA extends K {
|
|
11849
11592
|
constructor() {
|
|
11850
11593
|
super(...arguments), this._any = !0;
|
|
11851
11594
|
}
|
|
11852
11595
|
_parse(A) {
|
|
11853
|
-
return
|
|
11596
|
+
return X(A.data);
|
|
11854
11597
|
}
|
|
11855
11598
|
}
|
|
11856
|
-
|
|
11599
|
+
uA.create = (g) => new uA({
|
|
11857
11600
|
typeName: J.ZodAny,
|
|
11858
11601
|
...M(g)
|
|
11859
11602
|
});
|
|
11860
|
-
class
|
|
11603
|
+
class RA extends K {
|
|
11861
11604
|
constructor() {
|
|
11862
11605
|
super(...arguments), this._unknown = !0;
|
|
11863
11606
|
}
|
|
11864
11607
|
_parse(A) {
|
|
11865
|
-
return
|
|
11608
|
+
return X(A.data);
|
|
11866
11609
|
}
|
|
11867
11610
|
}
|
|
11868
|
-
|
|
11611
|
+
RA.create = (g) => new RA({
|
|
11869
11612
|
typeName: J.ZodUnknown,
|
|
11870
11613
|
...M(g)
|
|
11871
11614
|
});
|
|
11872
|
-
class
|
|
11615
|
+
class tA extends K {
|
|
11873
11616
|
_parse(A) {
|
|
11874
11617
|
const I = this._getOrReturnCtx(A);
|
|
11875
11618
|
return F(I, {
|
|
@@ -11879,7 +11622,7 @@ class yA extends K {
|
|
|
11879
11622
|
}), d;
|
|
11880
11623
|
}
|
|
11881
11624
|
}
|
|
11882
|
-
|
|
11625
|
+
tA.create = (g) => new tA({
|
|
11883
11626
|
typeName: J.ZodNever,
|
|
11884
11627
|
...M(g)
|
|
11885
11628
|
});
|
|
@@ -11893,14 +11636,14 @@ class lI extends K {
|
|
|
11893
11636
|
received: B.parsedType
|
|
11894
11637
|
}), d;
|
|
11895
11638
|
}
|
|
11896
|
-
return
|
|
11639
|
+
return X(A.data);
|
|
11897
11640
|
}
|
|
11898
11641
|
}
|
|
11899
11642
|
lI.create = (g) => new lI({
|
|
11900
11643
|
typeName: J.ZodVoid,
|
|
11901
11644
|
...M(g)
|
|
11902
11645
|
});
|
|
11903
|
-
class
|
|
11646
|
+
class CA extends K {
|
|
11904
11647
|
_parse(A) {
|
|
11905
11648
|
const { ctx: I, status: B } = this._processInputParams(A), C = this._def;
|
|
11906
11649
|
if (I.parsedType !== S.array)
|
|
@@ -11936,27 +11679,27 @@ class QA extends K {
|
|
|
11936
11679
|
exact: !1,
|
|
11937
11680
|
message: C.maxLength.message
|
|
11938
11681
|
}), B.dirty()), I.common.async)
|
|
11939
|
-
return Promise.all([...I.data].map((E, i) => C.type._parseAsync(new
|
|
11940
|
-
const Q = [...I.data].map((E, i) => C.type._parseSync(new
|
|
11941
|
-
return
|
|
11682
|
+
return Promise.all([...I.data].map((E, i) => C.type._parseAsync(new aA(I, E, I.path, i)))).then((E) => v.mergeArray(B, E));
|
|
11683
|
+
const Q = [...I.data].map((E, i) => C.type._parseSync(new aA(I, E, I.path, i)));
|
|
11684
|
+
return v.mergeArray(B, Q);
|
|
11942
11685
|
}
|
|
11943
11686
|
get element() {
|
|
11944
11687
|
return this._def.type;
|
|
11945
11688
|
}
|
|
11946
11689
|
min(A, I) {
|
|
11947
|
-
return new
|
|
11690
|
+
return new CA({
|
|
11948
11691
|
...this._def,
|
|
11949
11692
|
minLength: { value: A, message: N.toString(I) }
|
|
11950
11693
|
});
|
|
11951
11694
|
}
|
|
11952
11695
|
max(A, I) {
|
|
11953
|
-
return new
|
|
11696
|
+
return new CA({
|
|
11954
11697
|
...this._def,
|
|
11955
11698
|
maxLength: { value: A, message: N.toString(I) }
|
|
11956
11699
|
});
|
|
11957
11700
|
}
|
|
11958
11701
|
length(A, I) {
|
|
11959
|
-
return new
|
|
11702
|
+
return new CA({
|
|
11960
11703
|
...this._def,
|
|
11961
11704
|
exactLength: { value: A, message: N.toString(I) }
|
|
11962
11705
|
});
|
|
@@ -11965,7 +11708,7 @@ class QA extends K {
|
|
|
11965
11708
|
return this.min(1, A);
|
|
11966
11709
|
}
|
|
11967
11710
|
}
|
|
11968
|
-
|
|
11711
|
+
CA.create = (g, A) => new CA({
|
|
11969
11712
|
type: g,
|
|
11970
11713
|
minLength: null,
|
|
11971
11714
|
maxLength: null,
|
|
@@ -11973,21 +11716,21 @@ QA.create = (g, A) => new QA({
|
|
|
11973
11716
|
typeName: J.ZodArray,
|
|
11974
11717
|
...M(A)
|
|
11975
11718
|
});
|
|
11976
|
-
function
|
|
11719
|
+
function dA(g) {
|
|
11977
11720
|
if (g instanceof u) {
|
|
11978
11721
|
const A = {};
|
|
11979
11722
|
for (const I in g.shape) {
|
|
11980
11723
|
const B = g.shape[I];
|
|
11981
|
-
A[I] =
|
|
11724
|
+
A[I] = oA.create(dA(B));
|
|
11982
11725
|
}
|
|
11983
11726
|
return new u({
|
|
11984
11727
|
...g._def,
|
|
11985
11728
|
shape: () => A
|
|
11986
11729
|
});
|
|
11987
|
-
} else return g instanceof
|
|
11730
|
+
} else return g instanceof CA ? new CA({
|
|
11988
11731
|
...g._def,
|
|
11989
|
-
type:
|
|
11990
|
-
}) : g instanceof
|
|
11732
|
+
type: dA(g.element)
|
|
11733
|
+
}) : g instanceof oA ? oA.create(dA(g.unwrap())) : g instanceof nA ? nA.create(dA(g.unwrap())) : g instanceof sA ? sA.create(g.items.map((A) => dA(A))) : g;
|
|
11991
11734
|
}
|
|
11992
11735
|
class u extends K {
|
|
11993
11736
|
constructor() {
|
|
@@ -12009,7 +11752,7 @@ class u extends K {
|
|
|
12009
11752
|
}), d;
|
|
12010
11753
|
}
|
|
12011
11754
|
const { status: B, ctx: C } = this._processInputParams(A), { shape: Q, keys: E } = this._getCached(), i = [];
|
|
12012
|
-
if (!(this._def.catchall instanceof
|
|
11755
|
+
if (!(this._def.catchall instanceof tA && this._def.unknownKeys === "strip"))
|
|
12013
11756
|
for (const a in C.data)
|
|
12014
11757
|
E.includes(a) || i.push(a);
|
|
12015
11758
|
const o = [];
|
|
@@ -12017,11 +11760,11 @@ class u extends K {
|
|
|
12017
11760
|
const s = Q[a], h = C.data[a];
|
|
12018
11761
|
o.push({
|
|
12019
11762
|
key: { status: "valid", value: a },
|
|
12020
|
-
value: s._parse(new
|
|
11763
|
+
value: s._parse(new aA(C, h, C.path, a)),
|
|
12021
11764
|
alwaysSet: a in C.data
|
|
12022
11765
|
});
|
|
12023
11766
|
}
|
|
12024
|
-
if (this._def.catchall instanceof
|
|
11767
|
+
if (this._def.catchall instanceof tA) {
|
|
12025
11768
|
const a = this._def.unknownKeys;
|
|
12026
11769
|
if (a === "passthrough")
|
|
12027
11770
|
for (const s of i)
|
|
@@ -12042,7 +11785,7 @@ class u extends K {
|
|
|
12042
11785
|
o.push({
|
|
12043
11786
|
key: { status: "valid", value: s },
|
|
12044
11787
|
value: a._parse(
|
|
12045
|
-
new
|
|
11788
|
+
new aA(C, h, C.path, s)
|
|
12046
11789
|
//, ctx.child(key), value, getParsedType(value)
|
|
12047
11790
|
),
|
|
12048
11791
|
alwaysSet: s in C.data
|
|
@@ -12060,7 +11803,7 @@ class u extends K {
|
|
|
12060
11803
|
});
|
|
12061
11804
|
}
|
|
12062
11805
|
return a;
|
|
12063
|
-
}).then((a) =>
|
|
11806
|
+
}).then((a) => v.mergeObjectSync(B, a)) : v.mergeObjectSync(B, o);
|
|
12064
11807
|
}
|
|
12065
11808
|
get shape() {
|
|
12066
11809
|
return this._def.shape();
|
|
@@ -12223,7 +11966,7 @@ class u extends K {
|
|
|
12223
11966
|
* @deprecated
|
|
12224
11967
|
*/
|
|
12225
11968
|
deepPartial() {
|
|
12226
|
-
return
|
|
11969
|
+
return dA(this);
|
|
12227
11970
|
}
|
|
12228
11971
|
partial(A) {
|
|
12229
11972
|
const I = {};
|
|
@@ -12242,7 +11985,7 @@ class u extends K {
|
|
|
12242
11985
|
I[B] = this.shape[B];
|
|
12243
11986
|
else {
|
|
12244
11987
|
let Q = this.shape[B];
|
|
12245
|
-
for (; Q instanceof
|
|
11988
|
+
for (; Q instanceof oA; )
|
|
12246
11989
|
Q = Q._def.innerType;
|
|
12247
11990
|
I[B] = Q;
|
|
12248
11991
|
}
|
|
@@ -12258,25 +12001,25 @@ class u extends K {
|
|
|
12258
12001
|
u.create = (g, A) => new u({
|
|
12259
12002
|
shape: () => g,
|
|
12260
12003
|
unknownKeys: "strip",
|
|
12261
|
-
catchall:
|
|
12004
|
+
catchall: tA.create(),
|
|
12262
12005
|
typeName: J.ZodObject,
|
|
12263
12006
|
...M(A)
|
|
12264
12007
|
});
|
|
12265
12008
|
u.strictCreate = (g, A) => new u({
|
|
12266
12009
|
shape: () => g,
|
|
12267
12010
|
unknownKeys: "strict",
|
|
12268
|
-
catchall:
|
|
12011
|
+
catchall: tA.create(),
|
|
12269
12012
|
typeName: J.ZodObject,
|
|
12270
12013
|
...M(A)
|
|
12271
12014
|
});
|
|
12272
12015
|
u.lazycreate = (g, A) => new u({
|
|
12273
12016
|
shape: g,
|
|
12274
12017
|
unknownKeys: "strip",
|
|
12275
|
-
catchall:
|
|
12018
|
+
catchall: tA.create(),
|
|
12276
12019
|
typeName: J.ZodObject,
|
|
12277
12020
|
...M(A)
|
|
12278
12021
|
});
|
|
12279
|
-
class
|
|
12022
|
+
class CI extends K {
|
|
12280
12023
|
_parse(A) {
|
|
12281
12024
|
const { ctx: I } = this._processInputParams(A), B = this._def.options;
|
|
12282
12025
|
function C(Q) {
|
|
@@ -12286,7 +12029,7 @@ class QI extends K {
|
|
|
12286
12029
|
for (const i of Q)
|
|
12287
12030
|
if (i.result.status === "dirty")
|
|
12288
12031
|
return I.common.issues.push(...i.ctx.common.issues), i.result;
|
|
12289
|
-
const E = Q.map((i) => new
|
|
12032
|
+
const E = Q.map((i) => new _(i.ctx.common.issues));
|
|
12290
12033
|
return F(I, {
|
|
12291
12034
|
code: e.invalid_union,
|
|
12292
12035
|
unionErrors: E
|
|
@@ -12333,7 +12076,7 @@ class QI extends K {
|
|
|
12333
12076
|
}
|
|
12334
12077
|
if (Q)
|
|
12335
12078
|
return I.common.issues.push(...Q.ctx.common.issues), Q.result;
|
|
12336
|
-
const i = E.map((o) => new
|
|
12079
|
+
const i = E.map((o) => new _(o));
|
|
12337
12080
|
return F(I, {
|
|
12338
12081
|
code: e.invalid_union,
|
|
12339
12082
|
unionErrors: i
|
|
@@ -12344,12 +12087,12 @@ class QI extends K {
|
|
|
12344
12087
|
return this._def.options;
|
|
12345
12088
|
}
|
|
12346
12089
|
}
|
|
12347
|
-
|
|
12090
|
+
CI.create = (g, A) => new CI({
|
|
12348
12091
|
options: g,
|
|
12349
12092
|
typeName: J.ZodUnion,
|
|
12350
12093
|
...M(A)
|
|
12351
12094
|
});
|
|
12352
|
-
const
|
|
12095
|
+
const DA = (g) => g instanceof iI ? DA(g.schema) : g instanceof QA ? DA(g.innerType()) : g instanceof oI ? [g.value] : g instanceof GA ? g.options : g instanceof aI ? H.objectValues(g.enum) : g instanceof sI ? DA(g._def.innerType) : g instanceof gI ? [void 0] : g instanceof BI ? [null] : g instanceof oA ? [void 0, ...DA(g.unwrap())] : g instanceof nA ? [null, ...DA(g.unwrap())] : g instanceof fg || g instanceof hI ? DA(g.unwrap()) : g instanceof DI ? DA(g._def.innerType) : [];
|
|
12353
12096
|
class bI extends K {
|
|
12354
12097
|
_parse(A) {
|
|
12355
12098
|
const { ctx: I } = this._processInputParams(A);
|
|
@@ -12394,7 +12137,7 @@ class bI extends K {
|
|
|
12394
12137
|
static create(A, I, B) {
|
|
12395
12138
|
const C = /* @__PURE__ */ new Map();
|
|
12396
12139
|
for (const Q of I) {
|
|
12397
|
-
const E =
|
|
12140
|
+
const E = DA(Q.shape[A]);
|
|
12398
12141
|
if (!E.length)
|
|
12399
12142
|
throw new Error(`A discriminator value for key \`${A}\` could not be extracted from all schema options`);
|
|
12400
12143
|
for (const i of E) {
|
|
@@ -12413,7 +12156,7 @@ class bI extends K {
|
|
|
12413
12156
|
}
|
|
12414
12157
|
}
|
|
12415
12158
|
function tg(g, A) {
|
|
12416
|
-
const I =
|
|
12159
|
+
const I = hA(g), B = hA(A);
|
|
12417
12160
|
if (g === A)
|
|
12418
12161
|
return { valid: !0, data: g };
|
|
12419
12162
|
if (I === S.object && B === S.object) {
|
|
@@ -12438,7 +12181,7 @@ function tg(g, A) {
|
|
|
12438
12181
|
return { valid: !0, data: C };
|
|
12439
12182
|
} else return I === S.date && B === S.date && +g == +A ? { valid: !0, data: g } : { valid: !1 };
|
|
12440
12183
|
}
|
|
12441
|
-
class
|
|
12184
|
+
class QI extends K {
|
|
12442
12185
|
_parse(A) {
|
|
12443
12186
|
const { status: I, ctx: B } = this._processInputParams(A), C = (Q, E) => {
|
|
12444
12187
|
if (Dg(Q) || Dg(E))
|
|
@@ -12470,13 +12213,13 @@ class EI extends K {
|
|
|
12470
12213
|
}));
|
|
12471
12214
|
}
|
|
12472
12215
|
}
|
|
12473
|
-
|
|
12216
|
+
QI.create = (g, A, I) => new QI({
|
|
12474
12217
|
left: g,
|
|
12475
12218
|
right: A,
|
|
12476
12219
|
typeName: J.ZodIntersection,
|
|
12477
12220
|
...M(I)
|
|
12478
12221
|
});
|
|
12479
|
-
class
|
|
12222
|
+
class sA extends K {
|
|
12480
12223
|
_parse(A) {
|
|
12481
12224
|
const { status: I, ctx: B } = this._processInputParams(A);
|
|
12482
12225
|
if (B.parsedType !== S.array)
|
|
@@ -12502,31 +12245,31 @@ class DA extends K {
|
|
|
12502
12245
|
}), I.dirty());
|
|
12503
12246
|
const Q = [...B.data].map((E, i) => {
|
|
12504
12247
|
const o = this._def.items[i] || this._def.rest;
|
|
12505
|
-
return o ? o._parse(new
|
|
12248
|
+
return o ? o._parse(new aA(B, E, B.path, i)) : null;
|
|
12506
12249
|
}).filter((E) => !!E);
|
|
12507
|
-
return B.common.async ? Promise.all(Q).then((E) =>
|
|
12250
|
+
return B.common.async ? Promise.all(Q).then((E) => v.mergeArray(I, E)) : v.mergeArray(I, Q);
|
|
12508
12251
|
}
|
|
12509
12252
|
get items() {
|
|
12510
12253
|
return this._def.items;
|
|
12511
12254
|
}
|
|
12512
12255
|
rest(A) {
|
|
12513
|
-
return new
|
|
12256
|
+
return new sA({
|
|
12514
12257
|
...this._def,
|
|
12515
12258
|
rest: A
|
|
12516
12259
|
});
|
|
12517
12260
|
}
|
|
12518
12261
|
}
|
|
12519
|
-
|
|
12262
|
+
sA.create = (g, A) => {
|
|
12520
12263
|
if (!Array.isArray(g))
|
|
12521
12264
|
throw new Error("You must pass an array of schemas to z.tuple([ ... ])");
|
|
12522
|
-
return new
|
|
12265
|
+
return new sA({
|
|
12523
12266
|
items: g,
|
|
12524
12267
|
typeName: J.ZodTuple,
|
|
12525
12268
|
rest: null,
|
|
12526
12269
|
...M(A)
|
|
12527
12270
|
});
|
|
12528
12271
|
};
|
|
12529
|
-
class
|
|
12272
|
+
class EI extends K {
|
|
12530
12273
|
get keySchema() {
|
|
12531
12274
|
return this._def.keyType;
|
|
12532
12275
|
}
|
|
@@ -12544,23 +12287,23 @@ class iI extends K {
|
|
|
12544
12287
|
const C = [], Q = this._def.keyType, E = this._def.valueType;
|
|
12545
12288
|
for (const i in B.data)
|
|
12546
12289
|
C.push({
|
|
12547
|
-
key: Q._parse(new
|
|
12548
|
-
value: E._parse(new
|
|
12290
|
+
key: Q._parse(new aA(B, i, B.path, i)),
|
|
12291
|
+
value: E._parse(new aA(B, B.data[i], B.path, i)),
|
|
12549
12292
|
alwaysSet: i in B.data
|
|
12550
12293
|
});
|
|
12551
|
-
return B.common.async ?
|
|
12294
|
+
return B.common.async ? v.mergeObjectAsync(I, C) : v.mergeObjectSync(I, C);
|
|
12552
12295
|
}
|
|
12553
12296
|
get element() {
|
|
12554
12297
|
return this._def.valueType;
|
|
12555
12298
|
}
|
|
12556
12299
|
static create(A, I, B) {
|
|
12557
|
-
return I instanceof K ? new
|
|
12300
|
+
return I instanceof K ? new EI({
|
|
12558
12301
|
keyType: A,
|
|
12559
12302
|
valueType: I,
|
|
12560
12303
|
typeName: J.ZodRecord,
|
|
12561
12304
|
...M(B)
|
|
12562
|
-
}) : new
|
|
12563
|
-
keyType:
|
|
12305
|
+
}) : new EI({
|
|
12306
|
+
keyType: IA.create(),
|
|
12564
12307
|
valueType: A,
|
|
12565
12308
|
typeName: J.ZodRecord,
|
|
12566
12309
|
...M(I)
|
|
@@ -12583,8 +12326,8 @@ class fI extends K {
|
|
|
12583
12326
|
received: B.parsedType
|
|
12584
12327
|
}), d;
|
|
12585
12328
|
const C = this._def.keyType, Q = this._def.valueType, E = [...B.data.entries()].map(([i, o], a) => ({
|
|
12586
|
-
key: C._parse(new
|
|
12587
|
-
value: Q._parse(new
|
|
12329
|
+
key: C._parse(new aA(B, i, B.path, [a, "key"])),
|
|
12330
|
+
value: Q._parse(new aA(B, o, B.path, [a, "value"]))
|
|
12588
12331
|
}));
|
|
12589
12332
|
if (B.common.async) {
|
|
12590
12333
|
const i = /* @__PURE__ */ new Map();
|
|
@@ -12615,7 +12358,7 @@ fI.create = (g, A, I) => new fI({
|
|
|
12615
12358
|
typeName: J.ZodMap,
|
|
12616
12359
|
...M(I)
|
|
12617
12360
|
});
|
|
12618
|
-
class
|
|
12361
|
+
class JA extends K {
|
|
12619
12362
|
_parse(A) {
|
|
12620
12363
|
const { status: I, ctx: B } = this._processInputParams(A);
|
|
12621
12364
|
if (B.parsedType !== S.set)
|
|
@@ -12650,17 +12393,17 @@ class YA extends K {
|
|
|
12650
12393
|
}
|
|
12651
12394
|
return { status: I.value, value: a };
|
|
12652
12395
|
}
|
|
12653
|
-
const i = [...B.data.values()].map((o, a) => Q._parse(new
|
|
12396
|
+
const i = [...B.data.values()].map((o, a) => Q._parse(new aA(B, o, B.path, a)));
|
|
12654
12397
|
return B.common.async ? Promise.all(i).then((o) => E(o)) : E(i);
|
|
12655
12398
|
}
|
|
12656
12399
|
min(A, I) {
|
|
12657
|
-
return new
|
|
12400
|
+
return new JA({
|
|
12658
12401
|
...this._def,
|
|
12659
12402
|
minSize: { value: A, message: N.toString(I) }
|
|
12660
12403
|
});
|
|
12661
12404
|
}
|
|
12662
12405
|
max(A, I) {
|
|
12663
|
-
return new
|
|
12406
|
+
return new JA({
|
|
12664
12407
|
...this._def,
|
|
12665
12408
|
maxSize: { value: A, message: N.toString(I) }
|
|
12666
12409
|
});
|
|
@@ -12672,14 +12415,14 @@ class YA extends K {
|
|
|
12672
12415
|
return this.min(1, A);
|
|
12673
12416
|
}
|
|
12674
12417
|
}
|
|
12675
|
-
|
|
12418
|
+
JA.create = (g, A) => new JA({
|
|
12676
12419
|
valueType: g,
|
|
12677
12420
|
minSize: null,
|
|
12678
12421
|
maxSize: null,
|
|
12679
12422
|
typeName: J.ZodSet,
|
|
12680
12423
|
...M(A)
|
|
12681
12424
|
});
|
|
12682
|
-
class
|
|
12425
|
+
class HA extends K {
|
|
12683
12426
|
constructor() {
|
|
12684
12427
|
super(...arguments), this.validate = this.implement;
|
|
12685
12428
|
}
|
|
@@ -12699,7 +12442,7 @@ class qA extends K {
|
|
|
12699
12442
|
I.common.contextualErrorMap,
|
|
12700
12443
|
I.schemaErrorMap,
|
|
12701
12444
|
MI(),
|
|
12702
|
-
|
|
12445
|
+
mA
|
|
12703
12446
|
].filter((a) => !!a),
|
|
12704
12447
|
issueData: {
|
|
12705
12448
|
code: e.invalid_arguments,
|
|
@@ -12715,7 +12458,7 @@ class qA extends K {
|
|
|
12715
12458
|
I.common.contextualErrorMap,
|
|
12716
12459
|
I.schemaErrorMap,
|
|
12717
12460
|
MI(),
|
|
12718
|
-
|
|
12461
|
+
mA
|
|
12719
12462
|
].filter((a) => !!a),
|
|
12720
12463
|
issueData: {
|
|
12721
12464
|
code: e.invalid_return_type,
|
|
@@ -12724,10 +12467,10 @@ class qA extends K {
|
|
|
12724
12467
|
});
|
|
12725
12468
|
}
|
|
12726
12469
|
const Q = { errorMap: I.common.contextualErrorMap }, E = I.data;
|
|
12727
|
-
if (this._def.returns instanceof
|
|
12470
|
+
if (this._def.returns instanceof TA) {
|
|
12728
12471
|
const i = this;
|
|
12729
|
-
return
|
|
12730
|
-
const a = new
|
|
12472
|
+
return X(async function(...o) {
|
|
12473
|
+
const a = new _([]), s = await i._def.args.parseAsync(o, Q).catch((y) => {
|
|
12731
12474
|
throw a.addIssue(B(o, y)), a;
|
|
12732
12475
|
}), h = await Reflect.apply(E, this, s);
|
|
12733
12476
|
return await i._def.returns._def.type.parseAsync(h, Q).catch((y) => {
|
|
@@ -12736,13 +12479,13 @@ class qA extends K {
|
|
|
12736
12479
|
});
|
|
12737
12480
|
} else {
|
|
12738
12481
|
const i = this;
|
|
12739
|
-
return
|
|
12482
|
+
return X(function(...o) {
|
|
12740
12483
|
const a = i._def.args.safeParse(o, Q);
|
|
12741
12484
|
if (!a.success)
|
|
12742
|
-
throw new
|
|
12485
|
+
throw new _([B(o, a.error)]);
|
|
12743
12486
|
const s = Reflect.apply(E, this, a.data), h = i._def.returns.safeParse(s, Q);
|
|
12744
12487
|
if (!h.success)
|
|
12745
|
-
throw new
|
|
12488
|
+
throw new _([C(s, h.error)]);
|
|
12746
12489
|
return h.data;
|
|
12747
12490
|
});
|
|
12748
12491
|
}
|
|
@@ -12754,13 +12497,13 @@ class qA extends K {
|
|
|
12754
12497
|
return this._def.returns;
|
|
12755
12498
|
}
|
|
12756
12499
|
args(...A) {
|
|
12757
|
-
return new
|
|
12500
|
+
return new HA({
|
|
12758
12501
|
...this._def,
|
|
12759
|
-
args:
|
|
12502
|
+
args: sA.create(A).rest(RA.create())
|
|
12760
12503
|
});
|
|
12761
12504
|
}
|
|
12762
12505
|
returns(A) {
|
|
12763
|
-
return new
|
|
12506
|
+
return new HA({
|
|
12764
12507
|
...this._def,
|
|
12765
12508
|
returns: A
|
|
12766
12509
|
});
|
|
@@ -12772,15 +12515,15 @@ class qA extends K {
|
|
|
12772
12515
|
return this.parse(A);
|
|
12773
12516
|
}
|
|
12774
12517
|
static create(A, I, B) {
|
|
12775
|
-
return new
|
|
12776
|
-
args: A ||
|
|
12777
|
-
returns: I ||
|
|
12518
|
+
return new HA({
|
|
12519
|
+
args: A || sA.create([]).rest(RA.create()),
|
|
12520
|
+
returns: I || RA.create(),
|
|
12778
12521
|
typeName: J.ZodFunction,
|
|
12779
12522
|
...M(B)
|
|
12780
12523
|
});
|
|
12781
12524
|
}
|
|
12782
12525
|
}
|
|
12783
|
-
class
|
|
12526
|
+
class iI extends K {
|
|
12784
12527
|
get schema() {
|
|
12785
12528
|
return this._def.getter();
|
|
12786
12529
|
}
|
|
@@ -12789,12 +12532,12 @@ class oI extends K {
|
|
|
12789
12532
|
return this._def.getter()._parse({ data: I.data, path: I.path, parent: I });
|
|
12790
12533
|
}
|
|
12791
12534
|
}
|
|
12792
|
-
|
|
12535
|
+
iI.create = (g, A) => new iI({
|
|
12793
12536
|
getter: g,
|
|
12794
12537
|
typeName: J.ZodLazy,
|
|
12795
12538
|
...M(A)
|
|
12796
12539
|
});
|
|
12797
|
-
class
|
|
12540
|
+
class oI extends K {
|
|
12798
12541
|
_parse(A) {
|
|
12799
12542
|
if (A.data !== this._def.value) {
|
|
12800
12543
|
const I = this._getOrReturnCtx(A);
|
|
@@ -12810,21 +12553,21 @@ class aI extends K {
|
|
|
12810
12553
|
return this._def.value;
|
|
12811
12554
|
}
|
|
12812
12555
|
}
|
|
12813
|
-
|
|
12556
|
+
oI.create = (g, A) => new oI({
|
|
12814
12557
|
value: g,
|
|
12815
12558
|
typeName: J.ZodLiteral,
|
|
12816
12559
|
...M(A)
|
|
12817
12560
|
});
|
|
12818
12561
|
function BC(g, A) {
|
|
12819
|
-
return new
|
|
12562
|
+
return new GA({
|
|
12820
12563
|
values: g,
|
|
12821
12564
|
typeName: J.ZodEnum,
|
|
12822
12565
|
...M(A)
|
|
12823
12566
|
});
|
|
12824
12567
|
}
|
|
12825
|
-
class
|
|
12568
|
+
class GA extends K {
|
|
12826
12569
|
constructor() {
|
|
12827
|
-
super(...arguments),
|
|
12570
|
+
super(...arguments), OA.set(this, void 0);
|
|
12828
12571
|
}
|
|
12829
12572
|
_parse(A) {
|
|
12830
12573
|
if (typeof A.data != "string") {
|
|
@@ -12835,7 +12578,7 @@ class nA extends K {
|
|
|
12835
12578
|
code: e.invalid_type
|
|
12836
12579
|
}), d;
|
|
12837
12580
|
}
|
|
12838
|
-
if (HI(this,
|
|
12581
|
+
if (HI(this, OA) || $B(this, OA, new Set(this._def.values)), !HI(this, OA).has(A.data)) {
|
|
12839
12582
|
const I = this._getOrReturnCtx(A), B = this._def.values;
|
|
12840
12583
|
return F(I, {
|
|
12841
12584
|
received: I.data,
|
|
@@ -12843,7 +12586,7 @@ class nA extends K {
|
|
|
12843
12586
|
options: B
|
|
12844
12587
|
}), d;
|
|
12845
12588
|
}
|
|
12846
|
-
return
|
|
12589
|
+
return X(A.data);
|
|
12847
12590
|
}
|
|
12848
12591
|
get options() {
|
|
12849
12592
|
return this._def.values;
|
|
@@ -12867,23 +12610,23 @@ class nA extends K {
|
|
|
12867
12610
|
return A;
|
|
12868
12611
|
}
|
|
12869
12612
|
extract(A, I = this._def) {
|
|
12870
|
-
return
|
|
12613
|
+
return GA.create(A, {
|
|
12871
12614
|
...this._def,
|
|
12872
12615
|
...I
|
|
12873
12616
|
});
|
|
12874
12617
|
}
|
|
12875
12618
|
exclude(A, I = this._def) {
|
|
12876
|
-
return
|
|
12619
|
+
return GA.create(this.options.filter((B) => !A.includes(B)), {
|
|
12877
12620
|
...this._def,
|
|
12878
12621
|
...I
|
|
12879
12622
|
});
|
|
12880
12623
|
}
|
|
12881
12624
|
}
|
|
12882
|
-
|
|
12883
|
-
|
|
12884
|
-
class
|
|
12625
|
+
OA = /* @__PURE__ */ new WeakMap();
|
|
12626
|
+
GA.create = BC;
|
|
12627
|
+
class aI extends K {
|
|
12885
12628
|
constructor() {
|
|
12886
|
-
super(...arguments),
|
|
12629
|
+
super(...arguments), VA.set(this, void 0);
|
|
12887
12630
|
}
|
|
12888
12631
|
_parse(A) {
|
|
12889
12632
|
const I = H.getValidEnumValues(this._def.values), B = this._getOrReturnCtx(A);
|
|
@@ -12895,7 +12638,7 @@ class sI extends K {
|
|
|
12895
12638
|
code: e.invalid_type
|
|
12896
12639
|
}), d;
|
|
12897
12640
|
}
|
|
12898
|
-
if (HI(this,
|
|
12641
|
+
if (HI(this, VA) || $B(this, VA, new Set(H.getValidEnumValues(this._def.values))), !HI(this, VA).has(A.data)) {
|
|
12899
12642
|
const C = H.objectValues(I);
|
|
12900
12643
|
return F(B, {
|
|
12901
12644
|
received: B.data,
|
|
@@ -12903,19 +12646,19 @@ class sI extends K {
|
|
|
12903
12646
|
options: C
|
|
12904
12647
|
}), d;
|
|
12905
12648
|
}
|
|
12906
|
-
return
|
|
12649
|
+
return X(A.data);
|
|
12907
12650
|
}
|
|
12908
12651
|
get enum() {
|
|
12909
12652
|
return this._def.values;
|
|
12910
12653
|
}
|
|
12911
12654
|
}
|
|
12912
|
-
|
|
12913
|
-
|
|
12655
|
+
VA = /* @__PURE__ */ new WeakMap();
|
|
12656
|
+
aI.create = (g, A) => new aI({
|
|
12914
12657
|
values: g,
|
|
12915
12658
|
typeName: J.ZodNativeEnum,
|
|
12916
12659
|
...M(A)
|
|
12917
12660
|
});
|
|
12918
|
-
class
|
|
12661
|
+
class TA extends K {
|
|
12919
12662
|
unwrap() {
|
|
12920
12663
|
return this._def.type;
|
|
12921
12664
|
}
|
|
@@ -12928,18 +12671,18 @@ class xA extends K {
|
|
|
12928
12671
|
received: I.parsedType
|
|
12929
12672
|
}), d;
|
|
12930
12673
|
const B = I.parsedType === S.promise ? I.data : Promise.resolve(I.data);
|
|
12931
|
-
return
|
|
12674
|
+
return X(B.then((C) => this._def.type.parseAsync(C, {
|
|
12932
12675
|
path: I.path,
|
|
12933
12676
|
errorMap: I.common.contextualErrorMap
|
|
12934
12677
|
})));
|
|
12935
12678
|
}
|
|
12936
12679
|
}
|
|
12937
|
-
|
|
12680
|
+
TA.create = (g, A) => new TA({
|
|
12938
12681
|
type: g,
|
|
12939
12682
|
typeName: J.ZodPromise,
|
|
12940
12683
|
...M(A)
|
|
12941
12684
|
});
|
|
12942
|
-
class
|
|
12685
|
+
class QA extends K {
|
|
12943
12686
|
innerType() {
|
|
12944
12687
|
return this._def.schema;
|
|
12945
12688
|
}
|
|
@@ -12966,7 +12709,7 @@ class EA extends K {
|
|
|
12966
12709
|
path: B.path,
|
|
12967
12710
|
parent: B
|
|
12968
12711
|
});
|
|
12969
|
-
return o.status === "aborted" ? d : o.status === "dirty" || I.value === "dirty" ?
|
|
12712
|
+
return o.status === "aborted" ? d : o.status === "dirty" || I.value === "dirty" ? MA(o.value) : o;
|
|
12970
12713
|
});
|
|
12971
12714
|
{
|
|
12972
12715
|
if (I.value === "aborted")
|
|
@@ -12976,7 +12719,7 @@ class EA extends K {
|
|
|
12976
12719
|
path: B.path,
|
|
12977
12720
|
parent: B
|
|
12978
12721
|
});
|
|
12979
|
-
return i.status === "aborted" ? d : i.status === "dirty" || I.value === "dirty" ?
|
|
12722
|
+
return i.status === "aborted" ? d : i.status === "dirty" || I.value === "dirty" ? MA(i.value) : i;
|
|
12980
12723
|
}
|
|
12981
12724
|
}
|
|
12982
12725
|
if (C.type === "refinement") {
|
|
@@ -13005,56 +12748,56 @@ class EA extends K {
|
|
|
13005
12748
|
path: B.path,
|
|
13006
12749
|
parent: B
|
|
13007
12750
|
});
|
|
13008
|
-
if (!
|
|
12751
|
+
if (!kA(E))
|
|
13009
12752
|
return E;
|
|
13010
12753
|
const i = C.transform(E.value, Q);
|
|
13011
12754
|
if (i instanceof Promise)
|
|
13012
12755
|
throw new Error("Asynchronous transform encountered during synchronous parse operation. Use .parseAsync instead.");
|
|
13013
12756
|
return { status: I.value, value: i };
|
|
13014
12757
|
} else
|
|
13015
|
-
return this._def.schema._parseAsync({ data: B.data, path: B.path, parent: B }).then((E) =>
|
|
12758
|
+
return this._def.schema._parseAsync({ data: B.data, path: B.path, parent: B }).then((E) => kA(E) ? Promise.resolve(C.transform(E.value, Q)).then((i) => ({ status: I.value, value: i })) : E);
|
|
13016
12759
|
H.assertNever(C);
|
|
13017
12760
|
}
|
|
13018
12761
|
}
|
|
13019
|
-
|
|
12762
|
+
QA.create = (g, A, I) => new QA({
|
|
13020
12763
|
schema: g,
|
|
13021
12764
|
typeName: J.ZodEffects,
|
|
13022
12765
|
effect: A,
|
|
13023
12766
|
...M(I)
|
|
13024
12767
|
});
|
|
13025
|
-
|
|
12768
|
+
QA.createWithPreprocess = (g, A, I) => new QA({
|
|
13026
12769
|
schema: A,
|
|
13027
12770
|
effect: { type: "preprocess", transform: g },
|
|
13028
12771
|
typeName: J.ZodEffects,
|
|
13029
12772
|
...M(I)
|
|
13030
12773
|
});
|
|
13031
|
-
class
|
|
12774
|
+
class oA extends K {
|
|
13032
12775
|
_parse(A) {
|
|
13033
|
-
return this._getType(A) === S.undefined ?
|
|
12776
|
+
return this._getType(A) === S.undefined ? X(void 0) : this._def.innerType._parse(A);
|
|
13034
12777
|
}
|
|
13035
12778
|
unwrap() {
|
|
13036
12779
|
return this._def.innerType;
|
|
13037
12780
|
}
|
|
13038
12781
|
}
|
|
13039
|
-
|
|
12782
|
+
oA.create = (g, A) => new oA({
|
|
13040
12783
|
innerType: g,
|
|
13041
12784
|
typeName: J.ZodOptional,
|
|
13042
12785
|
...M(A)
|
|
13043
12786
|
});
|
|
13044
|
-
class
|
|
12787
|
+
class nA extends K {
|
|
13045
12788
|
_parse(A) {
|
|
13046
|
-
return this._getType(A) === S.null ?
|
|
12789
|
+
return this._getType(A) === S.null ? X(null) : this._def.innerType._parse(A);
|
|
13047
12790
|
}
|
|
13048
12791
|
unwrap() {
|
|
13049
12792
|
return this._def.innerType;
|
|
13050
12793
|
}
|
|
13051
12794
|
}
|
|
13052
|
-
|
|
12795
|
+
nA.create = (g, A) => new nA({
|
|
13053
12796
|
innerType: g,
|
|
13054
12797
|
typeName: J.ZodNullable,
|
|
13055
12798
|
...M(A)
|
|
13056
12799
|
});
|
|
13057
|
-
class
|
|
12800
|
+
class sI extends K {
|
|
13058
12801
|
_parse(A) {
|
|
13059
12802
|
const { ctx: I } = this._processInputParams(A);
|
|
13060
12803
|
let B = I.data;
|
|
@@ -13068,13 +12811,13 @@ class DI extends K {
|
|
|
13068
12811
|
return this._def.innerType;
|
|
13069
12812
|
}
|
|
13070
12813
|
}
|
|
13071
|
-
|
|
12814
|
+
sI.create = (g, A) => new sI({
|
|
13072
12815
|
innerType: g,
|
|
13073
12816
|
typeName: J.ZodDefault,
|
|
13074
12817
|
defaultValue: typeof A.default == "function" ? A.default : () => A.default,
|
|
13075
12818
|
...M(A)
|
|
13076
12819
|
});
|
|
13077
|
-
class
|
|
12820
|
+
class DI extends K {
|
|
13078
12821
|
_parse(A) {
|
|
13079
12822
|
const { ctx: I } = this._processInputParams(A), B = {
|
|
13080
12823
|
...I,
|
|
@@ -13089,11 +12832,11 @@ class hI extends K {
|
|
|
13089
12832
|
...B
|
|
13090
12833
|
}
|
|
13091
12834
|
});
|
|
13092
|
-
return
|
|
12835
|
+
return AI(C) ? C.then((Q) => ({
|
|
13093
12836
|
status: "valid",
|
|
13094
12837
|
value: Q.status === "valid" ? Q.value : this._def.catchValue({
|
|
13095
12838
|
get error() {
|
|
13096
|
-
return new
|
|
12839
|
+
return new _(B.common.issues);
|
|
13097
12840
|
},
|
|
13098
12841
|
input: B.data
|
|
13099
12842
|
})
|
|
@@ -13101,7 +12844,7 @@ class hI extends K {
|
|
|
13101
12844
|
status: "valid",
|
|
13102
12845
|
value: C.status === "valid" ? C.value : this._def.catchValue({
|
|
13103
12846
|
get error() {
|
|
13104
|
-
return new
|
|
12847
|
+
return new _(B.common.issues);
|
|
13105
12848
|
},
|
|
13106
12849
|
input: B.data
|
|
13107
12850
|
})
|
|
@@ -13111,7 +12854,7 @@ class hI extends K {
|
|
|
13111
12854
|
return this._def.innerType;
|
|
13112
12855
|
}
|
|
13113
12856
|
}
|
|
13114
|
-
|
|
12857
|
+
DI.create = (g, A) => new DI({
|
|
13115
12858
|
innerType: g,
|
|
13116
12859
|
typeName: J.ZodCatch,
|
|
13117
12860
|
catchValue: typeof A.catch == "function" ? A.catch : () => A.catch,
|
|
@@ -13148,7 +12891,7 @@ class fg extends K {
|
|
|
13148
12891
|
return this._def.type;
|
|
13149
12892
|
}
|
|
13150
12893
|
}
|
|
13151
|
-
class
|
|
12894
|
+
class wI extends K {
|
|
13152
12895
|
_parse(A) {
|
|
13153
12896
|
const { status: I, ctx: B } = this._processInputParams(A);
|
|
13154
12897
|
if (B.common.async)
|
|
@@ -13158,7 +12901,7 @@ class FI extends K {
|
|
|
13158
12901
|
path: B.path,
|
|
13159
12902
|
parent: B
|
|
13160
12903
|
});
|
|
13161
|
-
return Q.status === "aborted" ? d : Q.status === "dirty" ? (I.dirty(),
|
|
12904
|
+
return Q.status === "aborted" ? d : Q.status === "dirty" ? (I.dirty(), MA(Q.value)) : this._def.out._parseAsync({
|
|
13162
12905
|
data: Q.value,
|
|
13163
12906
|
path: B.path,
|
|
13164
12907
|
parent: B
|
|
@@ -13181,23 +12924,23 @@ class FI extends K {
|
|
|
13181
12924
|
}
|
|
13182
12925
|
}
|
|
13183
12926
|
static create(A, I) {
|
|
13184
|
-
return new
|
|
12927
|
+
return new wI({
|
|
13185
12928
|
in: A,
|
|
13186
12929
|
out: I,
|
|
13187
12930
|
typeName: J.ZodPipeline
|
|
13188
12931
|
});
|
|
13189
12932
|
}
|
|
13190
12933
|
}
|
|
13191
|
-
class
|
|
12934
|
+
class hI extends K {
|
|
13192
12935
|
_parse(A) {
|
|
13193
|
-
const I = this._def.innerType._parse(A), B = (C) => (
|
|
13194
|
-
return
|
|
12936
|
+
const I = this._def.innerType._parse(A), B = (C) => (kA(C) && (C.value = Object.freeze(C.value)), C);
|
|
12937
|
+
return AI(I) ? I.then((C) => B(C)) : B(I);
|
|
13195
12938
|
}
|
|
13196
12939
|
unwrap() {
|
|
13197
12940
|
return this._def.innerType;
|
|
13198
12941
|
}
|
|
13199
12942
|
}
|
|
13200
|
-
|
|
12943
|
+
hI.create = (g, A) => new hI({
|
|
13201
12944
|
innerType: g,
|
|
13202
12945
|
typeName: J.ZodReadonly,
|
|
13203
12946
|
...M(A)
|
|
@@ -13207,7 +12950,7 @@ function kB(g, A) {
|
|
|
13207
12950
|
return typeof I == "string" ? { message: I } : I;
|
|
13208
12951
|
}
|
|
13209
12952
|
function CC(g, A = {}, I) {
|
|
13210
|
-
return g ?
|
|
12953
|
+
return g ? uA.create().superRefine((B, C) => {
|
|
13211
12954
|
var Q, E;
|
|
13212
12955
|
const i = g(B);
|
|
13213
12956
|
if (i instanceof Promise)
|
|
@@ -13222,7 +12965,7 @@ function CC(g, A = {}, I) {
|
|
|
13222
12965
|
const o = kB(A, B), a = (E = (Q = o.fatal) !== null && Q !== void 0 ? Q : I) !== null && E !== void 0 ? E : !0;
|
|
13223
12966
|
C.addIssue({ code: "custom", ...o, fatal: a });
|
|
13224
12967
|
}
|
|
13225
|
-
}) :
|
|
12968
|
+
}) : uA.create();
|
|
13226
12969
|
}
|
|
13227
12970
|
const Hi = {
|
|
13228
12971
|
object: u.lazycreate
|
|
@@ -13233,32 +12976,32 @@ var J;
|
|
|
13233
12976
|
})(J || (J = {}));
|
|
13234
12977
|
const qi = (g, A = {
|
|
13235
12978
|
message: `Input not instance of ${g.name}`
|
|
13236
|
-
}) => CC((I) => I instanceof g, A), QC =
|
|
13237
|
-
string: (g) =>
|
|
13238
|
-
number: (g) =>
|
|
13239
|
-
boolean: (g) =>
|
|
12979
|
+
}) => CC((I) => I instanceof g, A), QC = IA.create, EC = yA.create, li = pI.create, fi = eA.create, iC = II.create, pi = LA.create, mi = qI.create, ui = gI.create, Ti = BI.create, xi = uA.create, Wi = RA.create, bi = tA.create, Zi = lI.create, Pi = CA.create, Oi = u.create, Vi = u.strictCreate, vi = CI.create, Xi = bI.create, ji = QI.create, zi = sA.create, _i = EI.create, $i = fI.create, Ao = JA.create, Io = HA.create, go = iI.create, Bo = oI.create, Co = GA.create, Qo = aI.create, Eo = TA.create, LB = QA.create, io = oA.create, oo = nA.create, ao = QA.createWithPreprocess, so = wI.create, Do = () => QC().optional(), ho = () => EC().optional(), to = () => iC().optional(), yo = {
|
|
12980
|
+
string: (g) => IA.create({ ...g, coerce: !0 }),
|
|
12981
|
+
number: (g) => yA.create({ ...g, coerce: !0 }),
|
|
12982
|
+
boolean: (g) => II.create({
|
|
13240
12983
|
...g,
|
|
13241
12984
|
coerce: !0
|
|
13242
12985
|
}),
|
|
13243
|
-
bigint: (g) =>
|
|
13244
|
-
date: (g) =>
|
|
12986
|
+
bigint: (g) => eA.create({ ...g, coerce: !0 }),
|
|
12987
|
+
date: (g) => LA.create({ ...g, coerce: !0 })
|
|
13245
12988
|
}, eo = d;
|
|
13246
12989
|
var D = /* @__PURE__ */ Object.freeze({
|
|
13247
12990
|
__proto__: null,
|
|
13248
|
-
defaultErrorMap:
|
|
12991
|
+
defaultErrorMap: mA,
|
|
13249
12992
|
setErrorMap: ai,
|
|
13250
12993
|
getErrorMap: MI,
|
|
13251
12994
|
makeIssue: KI,
|
|
13252
12995
|
EMPTY_PATH: si,
|
|
13253
12996
|
addIssueToContext: F,
|
|
13254
|
-
ParseStatus:
|
|
12997
|
+
ParseStatus: v,
|
|
13255
12998
|
INVALID: d,
|
|
13256
|
-
DIRTY:
|
|
13257
|
-
OK:
|
|
12999
|
+
DIRTY: MA,
|
|
13000
|
+
OK: X,
|
|
13258
13001
|
isAborted: Dg,
|
|
13259
13002
|
isDirty: hg,
|
|
13260
|
-
isValid:
|
|
13261
|
-
isAsync:
|
|
13003
|
+
isValid: kA,
|
|
13004
|
+
isAsync: AI,
|
|
13262
13005
|
get util() {
|
|
13263
13006
|
return H;
|
|
13264
13007
|
},
|
|
@@ -13266,47 +13009,47 @@ var D = /* @__PURE__ */ Object.freeze({
|
|
|
13266
13009
|
return sg;
|
|
13267
13010
|
},
|
|
13268
13011
|
ZodParsedType: S,
|
|
13269
|
-
getParsedType:
|
|
13012
|
+
getParsedType: hA,
|
|
13270
13013
|
ZodType: K,
|
|
13271
13014
|
datetimeRegex: gC,
|
|
13272
|
-
ZodString:
|
|
13273
|
-
ZodNumber:
|
|
13274
|
-
ZodBigInt:
|
|
13275
|
-
ZodBoolean:
|
|
13276
|
-
ZodDate:
|
|
13015
|
+
ZodString: IA,
|
|
13016
|
+
ZodNumber: yA,
|
|
13017
|
+
ZodBigInt: eA,
|
|
13018
|
+
ZodBoolean: II,
|
|
13019
|
+
ZodDate: LA,
|
|
13277
13020
|
ZodSymbol: qI,
|
|
13278
|
-
ZodUndefined:
|
|
13279
|
-
ZodNull:
|
|
13280
|
-
ZodAny:
|
|
13281
|
-
ZodUnknown:
|
|
13282
|
-
ZodNever:
|
|
13021
|
+
ZodUndefined: gI,
|
|
13022
|
+
ZodNull: BI,
|
|
13023
|
+
ZodAny: uA,
|
|
13024
|
+
ZodUnknown: RA,
|
|
13025
|
+
ZodNever: tA,
|
|
13283
13026
|
ZodVoid: lI,
|
|
13284
|
-
ZodArray:
|
|
13027
|
+
ZodArray: CA,
|
|
13285
13028
|
ZodObject: u,
|
|
13286
|
-
ZodUnion:
|
|
13029
|
+
ZodUnion: CI,
|
|
13287
13030
|
ZodDiscriminatedUnion: bI,
|
|
13288
|
-
ZodIntersection:
|
|
13289
|
-
ZodTuple:
|
|
13290
|
-
ZodRecord:
|
|
13031
|
+
ZodIntersection: QI,
|
|
13032
|
+
ZodTuple: sA,
|
|
13033
|
+
ZodRecord: EI,
|
|
13291
13034
|
ZodMap: fI,
|
|
13292
|
-
ZodSet:
|
|
13293
|
-
ZodFunction:
|
|
13294
|
-
ZodLazy:
|
|
13295
|
-
ZodLiteral:
|
|
13296
|
-
ZodEnum:
|
|
13297
|
-
ZodNativeEnum:
|
|
13298
|
-
ZodPromise:
|
|
13299
|
-
ZodEffects:
|
|
13300
|
-
ZodTransformer:
|
|
13301
|
-
ZodOptional:
|
|
13302
|
-
ZodNullable:
|
|
13303
|
-
ZodDefault:
|
|
13304
|
-
ZodCatch:
|
|
13035
|
+
ZodSet: JA,
|
|
13036
|
+
ZodFunction: HA,
|
|
13037
|
+
ZodLazy: iI,
|
|
13038
|
+
ZodLiteral: oI,
|
|
13039
|
+
ZodEnum: GA,
|
|
13040
|
+
ZodNativeEnum: aI,
|
|
13041
|
+
ZodPromise: TA,
|
|
13042
|
+
ZodEffects: QA,
|
|
13043
|
+
ZodTransformer: QA,
|
|
13044
|
+
ZodOptional: oA,
|
|
13045
|
+
ZodNullable: nA,
|
|
13046
|
+
ZodDefault: sI,
|
|
13047
|
+
ZodCatch: DI,
|
|
13305
13048
|
ZodNaN: pI,
|
|
13306
13049
|
BRAND: Ki,
|
|
13307
13050
|
ZodBranded: fg,
|
|
13308
|
-
ZodPipeline:
|
|
13309
|
-
ZodReadonly:
|
|
13051
|
+
ZodPipeline: wI,
|
|
13052
|
+
ZodReadonly: hI,
|
|
13310
13053
|
custom: CC,
|
|
13311
13054
|
Schema: K,
|
|
13312
13055
|
ZodSchema: K,
|
|
@@ -13357,7 +13100,7 @@ var D = /* @__PURE__ */ Object.freeze({
|
|
|
13357
13100
|
NEVER: eo,
|
|
13358
13101
|
ZodIssueCode: e,
|
|
13359
13102
|
quotelessJson: oi,
|
|
13360
|
-
ZodError:
|
|
13103
|
+
ZodError: _
|
|
13361
13104
|
});
|
|
13362
13105
|
const Go = D.object({
|
|
13363
13106
|
/**The multiscale datasets for this image*/
|
|
@@ -13782,7 +13525,7 @@ function pg(g) {
|
|
|
13782
13525
|
const A = co(g);
|
|
13783
13526
|
return A === void 0 ? "0.4" : A;
|
|
13784
13527
|
}
|
|
13785
|
-
function
|
|
13528
|
+
function xA(g) {
|
|
13786
13529
|
if (g !== void 0)
|
|
13787
13530
|
switch (g) {
|
|
13788
13531
|
case "0.4":
|
|
@@ -13796,7 +13539,7 @@ function oC(g, A) {
|
|
|
13796
13539
|
return delete I[A], I;
|
|
13797
13540
|
}
|
|
13798
13541
|
async function Oo(g, A) {
|
|
13799
|
-
const I = new
|
|
13542
|
+
const I = new ZA(g), B = new j(I), C = xA(A), Q = await nI(B, C);
|
|
13800
13543
|
try {
|
|
13801
13544
|
return Uo(Q.attrs);
|
|
13802
13545
|
} catch {
|
|
@@ -13855,7 +13598,7 @@ function Jo(g) {
|
|
|
13855
13598
|
}
|
|
13856
13599
|
}
|
|
13857
13600
|
async function Vo(g, A, I) {
|
|
13858
|
-
const B = g + "/" + A, C = new
|
|
13601
|
+
const B = g + "/" + A, C = new ZA(B), Q = new j(C), E = xA(I), i = await nI(Q, E);
|
|
13859
13602
|
try {
|
|
13860
13603
|
return Jo(i.attrs);
|
|
13861
13604
|
} catch {
|
|
@@ -13866,11 +13609,11 @@ ${JSON.stringify(i.attrs)}`
|
|
|
13866
13609
|
}
|
|
13867
13610
|
}
|
|
13868
13611
|
async function vo(g) {
|
|
13869
|
-
const A =
|
|
13612
|
+
const A = xA(g.version), I = await nI(g.location, A);
|
|
13870
13613
|
return mg(I.attrs).omero?.channels ?? [];
|
|
13871
13614
|
}
|
|
13872
13615
|
async function Xo(g) {
|
|
13873
|
-
const A =
|
|
13616
|
+
const A = xA(g.version), I = await nI(g.location, A);
|
|
13874
13617
|
return mg(I.attrs).omero?.rdefs;
|
|
13875
13618
|
}
|
|
13876
13619
|
function Yo(g) {
|
|
@@ -13911,8 +13654,8 @@ class NI {
|
|
|
13911
13654
|
this.location = A.location, this.version = A.version;
|
|
13912
13655
|
}
|
|
13913
13656
|
async open() {
|
|
13914
|
-
let A =
|
|
13915
|
-
const I = await
|
|
13657
|
+
let A = xA(this.version);
|
|
13658
|
+
const I = await nI(this.location, A), B = mg(I.attrs), C = B.multiscales;
|
|
13916
13659
|
if (C.length !== 1)
|
|
13917
13660
|
throw new Error(
|
|
13918
13661
|
`Exactly one multiscale image is supported. Found ${C.length} images.`
|
|
@@ -13920,7 +13663,7 @@ class NI {
|
|
|
13920
13663
|
const Q = C[0];
|
|
13921
13664
|
if (Q.datasets.length === 0)
|
|
13922
13665
|
throw new Error("No datasets found in the multiscale image.");
|
|
13923
|
-
A || (A =
|
|
13666
|
+
A || (A = xA(B.originalVersion));
|
|
13924
13667
|
const E = Q.datasets.map(
|
|
13925
13668
|
(s) => XE(this.location, s.path, A)
|
|
13926
13669
|
), i = await Promise.all(
|
|
@@ -13943,9 +13686,9 @@ class NI {
|
|
|
13943
13686
|
* @param version OME-Zarr version
|
|
13944
13687
|
*/
|
|
13945
13688
|
static fromHttp(A) {
|
|
13946
|
-
const I = new
|
|
13689
|
+
const I = new ZA(A.url);
|
|
13947
13690
|
return new NI({
|
|
13948
|
-
location: new
|
|
13691
|
+
location: new j(I),
|
|
13949
13692
|
version: A.version
|
|
13950
13693
|
});
|
|
13951
13694
|
}
|
|
@@ -13962,7 +13705,7 @@ class NI {
|
|
|
13962
13705
|
static fromS3(A) {
|
|
13963
13706
|
const I = new lg(A);
|
|
13964
13707
|
return new NI({
|
|
13965
|
-
location: new
|
|
13708
|
+
location: new j(I),
|
|
13966
13709
|
version: A.version
|
|
13967
13710
|
});
|
|
13968
13711
|
}
|
|
@@ -13978,7 +13721,7 @@ class NI {
|
|
|
13978
13721
|
static fromFileSystem(A) {
|
|
13979
13722
|
const I = new qg(A.directory);
|
|
13980
13723
|
return new NI({
|
|
13981
|
-
location: new
|
|
13724
|
+
location: new j(I, A.path),
|
|
13982
13725
|
version: A.version
|
|
13983
13726
|
});
|
|
13984
13727
|
}
|
|
@@ -14076,7 +13819,7 @@ function Tg(g, A = {}) {
|
|
|
14076
13819
|
priorityOrder: A.priorityOrder ?? g.priorityOrder
|
|
14077
13820
|
};
|
|
14078
13821
|
}
|
|
14079
|
-
class $o extends
|
|
13822
|
+
class $o extends bA {
|
|
14080
13823
|
atlas_;
|
|
14081
13824
|
constructor(A, I) {
|
|
14082
13825
|
super(), this.programName = "points", this.atlas_ = I, A.forEach((Q) => {
|
|
@@ -14096,7 +13839,7 @@ class $o extends ZA {
|
|
|
14096
13839
|
Q.color.a,
|
|
14097
13840
|
Q.size,
|
|
14098
13841
|
Q.markerIndex
|
|
14099
|
-
]), C = new
|
|
13842
|
+
]), C = new WA(B, [], "points");
|
|
14100
13843
|
C.addAttribute({
|
|
14101
13844
|
type: "position",
|
|
14102
13845
|
itemSize: 3,
|
|
@@ -14121,8 +13864,8 @@ class $o extends ZA {
|
|
|
14121
13864
|
}
|
|
14122
13865
|
export {
|
|
14123
13866
|
mo as AxesLayer,
|
|
14124
|
-
|
|
14125
|
-
|
|
13867
|
+
$ as Box2,
|
|
13868
|
+
SA as Box3,
|
|
14126
13869
|
uB as ChunkedImageLayer,
|
|
14127
13870
|
l as Color,
|
|
14128
13871
|
RQ as Frustum,
|
|
@@ -14130,19 +13873,19 @@ export {
|
|
|
14130
13873
|
Wo as ImageLayer,
|
|
14131
13874
|
Zo as ImageSeriesLayer,
|
|
14132
13875
|
bo as LabelImageLayer,
|
|
14133
|
-
|
|
13876
|
+
wA as Layer,
|
|
14134
13877
|
hQ as LayerManager,
|
|
14135
13878
|
NI as OmeZarrImageSource,
|
|
14136
13879
|
po as OrbitControls,
|
|
14137
13880
|
qo as OrthographicCamera,
|
|
14138
13881
|
fo as PanZoomControls,
|
|
14139
13882
|
lo as PerspectiveCamera,
|
|
14140
|
-
|
|
13883
|
+
YA as Plane,
|
|
14141
13884
|
$o as Points,
|
|
14142
13885
|
uo as ProjectedLineLayer,
|
|
14143
13886
|
gB as Spherical,
|
|
14144
|
-
|
|
14145
|
-
|
|
13887
|
+
tI as Texture2DArray,
|
|
13888
|
+
XA as Texture3D,
|
|
14146
13889
|
To as TracksLayer,
|
|
14147
13890
|
GQ as Viewport,
|
|
14148
13891
|
xo as VolumeLayer,
|