@idetik/core 0.30.0 → 0.32.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.js CHANGED
@@ -102,7 +102,7 @@ class FQ {
102
102
  this.backgroundColor_ = X.from(A);
103
103
  }
104
104
  }
105
- var UE = `#version 300 es
105
+ var dE = `#version 300 es
106
106
 
107
107
  layout (location = 0) in vec3 a_position;
108
108
  layout (location = 3) in vec3 a_prevPosition;
@@ -162,7 +162,7 @@ void main() {
162
162
 
163
163
 
164
164
  gl_PointSize = 5.0;
165
- }`, dE = `#version 300 es
165
+ }`, UE = `#version 300 es
166
166
 
167
167
  precision mediump float;
168
168
 
@@ -523,8 +523,8 @@ void main() {
523
523
  }`;
524
524
  const uE = {
525
525
  projectedLine: {
526
- vertex: UE,
527
- fragment: dE
526
+ vertex: dE,
527
+ fragment: UE
528
528
  },
529
529
  points: {
530
530
  vertex: lE,
@@ -843,24 +843,24 @@ function SA() {
843
843
  var C = new DA(16);
844
844
  return DA != Float32Array && (C[1] = 0, C[2] = 0, C[3] = 0, C[4] = 0, C[6] = 0, C[7] = 0, C[8] = 0, C[9] = 0, C[11] = 0, C[12] = 0, C[13] = 0, C[14] = 0), C[0] = 1, C[5] = 1, C[10] = 1, C[15] = 1, C;
845
845
  }
846
- function WE(C, A, I, g, B, Q, E, i, o, s, t, e, n, D, F, U) {
846
+ function WE(C, A, I, g, B, Q, E, i, o, s, t, e, n, D, F, k) {
847
847
  var S = new DA(16);
848
- return S[0] = C, S[1] = A, S[2] = I, S[3] = g, S[4] = B, S[5] = Q, S[6] = E, S[7] = i, S[8] = o, S[9] = s, S[10] = t, S[11] = e, S[12] = n, S[13] = D, S[14] = F, S[15] = U, S;
848
+ return S[0] = C, S[1] = A, S[2] = I, S[3] = g, S[4] = B, S[5] = Q, S[6] = E, S[7] = i, S[8] = o, S[9] = s, S[10] = t, S[11] = e, S[12] = n, S[13] = D, S[14] = F, S[15] = k, S;
849
849
  }
850
- function Ug(C, A) {
851
- var I = A[0], g = A[1], B = A[2], Q = A[3], E = A[4], i = A[5], o = A[6], s = A[7], t = A[8], e = A[9], n = A[10], D = A[11], F = A[12], U = A[13], S = A[14], l = A[15], f = I * i - g * E, k = I * o - B * E, R = I * s - Q * E, L = g * o - B * i, M = g * s - Q * i, W = B * s - Q * o, $ = t * U - e * F, BA = t * S - n * F, IA = t * l - D * F, iA = e * S - n * U, uA = e * l - D * U, fA = n * l - D * S, oA = f * fA - k * uA + R * iA + L * IA - M * BA + W * $;
852
- return oA ? (oA = 1 / oA, C[0] = (i * fA - o * uA + s * iA) * oA, C[1] = (B * uA - g * fA - Q * iA) * oA, C[2] = (U * W - S * M + l * L) * oA, C[3] = (n * M - e * W - D * L) * oA, C[4] = (o * IA - E * fA - s * BA) * oA, C[5] = (I * fA - B * IA + Q * BA) * oA, C[6] = (S * R - F * W - l * k) * oA, C[7] = (t * W - n * R + D * k) * oA, C[8] = (E * uA - i * IA + s * $) * oA, C[9] = (g * IA - I * uA - Q * $) * oA, C[10] = (F * M - U * R + l * f) * oA, C[11] = (e * R - t * M - D * f) * oA, C[12] = (i * BA - E * iA - o * $) * oA, C[13] = (I * iA - g * BA + B * $) * oA, C[14] = (U * k - F * L - S * f) * oA, C[15] = (t * L - e * k + n * f) * oA, C) : null;
850
+ function dg(C, A) {
851
+ var I = A[0], g = A[1], B = A[2], Q = A[3], E = A[4], i = A[5], o = A[6], s = A[7], t = A[8], e = A[9], n = A[10], D = A[11], F = A[12], k = A[13], S = A[14], l = A[15], f = I * i - g * E, d = I * o - B * E, R = I * s - Q * E, L = g * o - B * i, M = g * s - Q * i, W = B * s - Q * o, $ = t * k - e * F, BA = t * S - n * F, IA = t * l - D * F, iA = e * S - n * k, uA = e * l - D * k, fA = n * l - D * S, oA = f * fA - d * uA + R * iA + L * IA - M * BA + W * $;
852
+ return oA ? (oA = 1 / oA, C[0] = (i * fA - o * uA + s * iA) * oA, C[1] = (B * uA - g * fA - Q * iA) * oA, C[2] = (k * W - S * M + l * L) * oA, C[3] = (n * M - e * W - D * L) * oA, C[4] = (o * IA - E * fA - s * BA) * oA, C[5] = (I * fA - B * IA + Q * BA) * oA, C[6] = (S * R - F * W - l * d) * oA, C[7] = (t * W - n * R + D * d) * oA, C[8] = (E * uA - i * IA + s * $) * oA, C[9] = (g * IA - I * uA - Q * $) * oA, C[10] = (F * M - k * R + l * f) * oA, C[11] = (e * R - t * M - D * f) * oA, C[12] = (i * BA - E * iA - o * $) * oA, C[13] = (I * iA - g * BA + B * $) * oA, C[14] = (k * d - F * L - S * f) * oA, C[15] = (t * L - e * d + n * f) * oA, C) : null;
853
853
  }
854
854
  function eI(C, A, I) {
855
- var g = A[0], B = A[1], Q = A[2], E = A[3], i = A[4], o = A[5], s = A[6], t = A[7], e = A[8], n = A[9], D = A[10], F = A[11], U = A[12], S = A[13], l = A[14], f = A[15], k = I[0], R = I[1], L = I[2], M = I[3];
856
- return C[0] = k * g + R * i + L * e + M * U, C[1] = k * B + R * o + L * n + M * S, C[2] = k * Q + R * s + L * D + M * l, C[3] = k * E + R * t + L * F + M * f, k = I[4], R = I[5], L = I[6], M = I[7], C[4] = k * g + R * i + L * e + M * U, C[5] = k * B + R * o + L * n + M * S, C[6] = k * Q + R * s + L * D + M * l, C[7] = k * E + R * t + L * F + M * f, k = I[8], R = I[9], L = I[10], M = I[11], C[8] = k * g + R * i + L * e + M * U, C[9] = k * B + R * o + L * n + M * S, C[10] = k * Q + R * s + L * D + M * l, C[11] = k * E + R * t + L * F + M * f, k = I[12], R = I[13], L = I[14], M = I[15], C[12] = k * g + R * i + L * e + M * U, C[13] = k * B + R * o + L * n + M * S, C[14] = k * Q + R * s + L * D + M * l, C[15] = k * E + R * t + L * F + M * f, C;
855
+ var g = A[0], B = A[1], Q = A[2], E = A[3], i = A[4], o = A[5], s = A[6], t = A[7], e = A[8], n = A[9], D = A[10], F = A[11], k = A[12], S = A[13], l = A[14], f = A[15], d = I[0], R = I[1], L = I[2], M = I[3];
856
+ return C[0] = d * g + R * i + L * e + M * k, C[1] = d * B + R * o + L * n + M * S, C[2] = d * Q + R * s + L * D + M * l, C[3] = d * E + R * t + L * F + M * f, d = I[4], R = I[5], L = I[6], M = I[7], C[4] = d * g + R * i + L * e + M * k, C[5] = d * B + R * o + L * n + M * S, C[6] = d * Q + R * s + L * D + M * l, C[7] = d * E + R * t + L * F + M * f, d = I[8], R = I[9], L = I[10], M = I[11], C[8] = d * g + R * i + L * e + M * k, C[9] = d * B + R * o + L * n + M * S, C[10] = d * Q + R * s + L * D + M * l, C[11] = d * E + R * t + L * F + M * f, d = I[12], R = I[13], L = I[14], M = I[15], C[12] = d * g + R * i + L * e + M * k, C[13] = d * B + R * o + L * n + M * S, C[14] = d * Q + R * s + L * D + M * l, C[15] = d * E + R * t + L * F + M * f, C;
857
857
  }
858
858
  function vE(C, A) {
859
859
  return C[0] = A[0], C[1] = 0, C[2] = 0, C[3] = 0, C[4] = 0, C[5] = A[1], C[6] = 0, C[7] = 0, C[8] = 0, C[9] = 0, C[10] = A[2], C[11] = 0, C[12] = 0, C[13] = 0, C[14] = 0, C[15] = 1, C;
860
860
  }
861
861
  function ZE(C, A, I, g) {
862
- var B = A[0], Q = A[1], E = A[2], i = A[3], o = B + B, s = Q + Q, t = E + E, e = B * o, n = B * s, D = B * t, F = Q * s, U = Q * t, S = E * t, l = i * o, f = i * s, k = i * t, R = g[0], L = g[1], M = g[2];
863
- return C[0] = (1 - (F + S)) * R, C[1] = (n + k) * R, C[2] = (D - f) * R, C[3] = 0, C[4] = (n - k) * L, C[5] = (1 - (e + S)) * L, C[6] = (U + l) * L, C[7] = 0, C[8] = (D + f) * M, C[9] = (U - l) * M, C[10] = (1 - (e + F)) * M, C[11] = 0, C[12] = I[0], C[13] = I[1], C[14] = I[2], C[15] = 1, C;
862
+ var B = A[0], Q = A[1], E = A[2], i = A[3], o = B + B, s = Q + Q, t = E + E, e = B * o, n = B * s, D = B * t, F = Q * s, k = Q * t, S = E * t, l = i * o, f = i * s, d = i * t, R = g[0], L = g[1], M = g[2];
863
+ return C[0] = (1 - (F + S)) * R, C[1] = (n + d) * R, C[2] = (D - f) * R, C[3] = 0, C[4] = (n - d) * L, C[5] = (1 - (e + S)) * L, C[6] = (k + l) * L, C[7] = 0, C[8] = (D + f) * M, C[9] = (k - l) * M, C[10] = (1 - (e + F)) * M, C[11] = 0, C[12] = I[0], C[13] = I[1], C[14] = I[2], C[15] = 1, C;
864
864
  }
865
865
  function PE(C, A, I, g, B) {
866
866
  var Q = 1 / Math.tan(A / 2);
@@ -880,12 +880,12 @@ var _E = VE;
880
880
  function XE(C, A, I, g) {
881
881
  var B = A[0], Q = A[1], E = A[2], i = g[0], o = g[1], s = g[2], t = B - I[0], e = Q - I[1], n = E - I[2], D = t * t + e * e + n * n;
882
882
  D > 0 && (D = 1 / Math.sqrt(D), t *= D, e *= D, n *= D);
883
- var F = o * n - s * e, U = s * t - i * n, S = i * e - o * t;
884
- return D = F * F + U * U + S * S, D > 0 && (D = 1 / Math.sqrt(D), F *= D, U *= D, S *= D), C[0] = F, C[1] = U, C[2] = S, C[3] = 0, C[4] = e * S - n * U, C[5] = n * F - t * S, C[6] = t * U - e * F, C[7] = 0, C[8] = t, C[9] = e, C[10] = n, C[11] = 0, C[12] = B, C[13] = Q, C[14] = E, C[15] = 1, C;
883
+ var F = o * n - s * e, k = s * t - i * n, S = i * e - o * t;
884
+ return D = F * F + k * k + S * S, D > 0 && (D = 1 / Math.sqrt(D), F *= D, k *= D, S *= D), C[0] = F, C[1] = k, C[2] = S, C[3] = 0, C[4] = e * S - n * k, C[5] = n * F - t * S, C[6] = t * k - e * F, C[7] = 0, C[8] = t, C[9] = e, C[10] = n, C[11] = 0, C[12] = B, C[13] = Q, C[14] = E, C[15] = 1, C;
885
885
  }
886
886
  function jE(C, A) {
887
- var I = C[0], g = C[1], B = C[2], Q = C[3], E = C[4], i = C[5], o = C[6], s = C[7], t = C[8], e = C[9], n = C[10], D = C[11], F = C[12], U = C[13], S = C[14], l = C[15], f = A[0], k = A[1], R = A[2], L = A[3], M = A[4], W = A[5], $ = A[6], BA = A[7], IA = A[8], iA = A[9], uA = A[10], fA = A[11], oA = A[12], BC = A[13], CC = A[14], QC = A[15];
888
- return Math.abs(I - f) <= AA * Math.max(1, Math.abs(I), Math.abs(f)) && Math.abs(g - k) <= AA * Math.max(1, Math.abs(g), Math.abs(k)) && Math.abs(B - R) <= AA * Math.max(1, Math.abs(B), Math.abs(R)) && Math.abs(Q - L) <= AA * Math.max(1, Math.abs(Q), Math.abs(L)) && Math.abs(E - M) <= AA * Math.max(1, Math.abs(E), Math.abs(M)) && Math.abs(i - W) <= AA * Math.max(1, Math.abs(i), Math.abs(W)) && Math.abs(o - $) <= AA * Math.max(1, Math.abs(o), Math.abs($)) && Math.abs(s - BA) <= AA * Math.max(1, Math.abs(s), Math.abs(BA)) && Math.abs(t - IA) <= AA * Math.max(1, Math.abs(t), Math.abs(IA)) && Math.abs(e - iA) <= AA * Math.max(1, Math.abs(e), Math.abs(iA)) && Math.abs(n - uA) <= AA * Math.max(1, Math.abs(n), Math.abs(uA)) && Math.abs(D - fA) <= AA * Math.max(1, Math.abs(D), Math.abs(fA)) && Math.abs(F - oA) <= AA * Math.max(1, Math.abs(F), Math.abs(oA)) && Math.abs(U - BC) <= AA * Math.max(1, Math.abs(U), Math.abs(BC)) && Math.abs(S - CC) <= AA * Math.max(1, Math.abs(S), Math.abs(CC)) && Math.abs(l - QC) <= AA * Math.max(1, Math.abs(l), Math.abs(QC));
887
+ var I = C[0], g = C[1], B = C[2], Q = C[3], E = C[4], i = C[5], o = C[6], s = C[7], t = C[8], e = C[9], n = C[10], D = C[11], F = C[12], k = C[13], S = C[14], l = C[15], f = A[0], d = A[1], R = A[2], L = A[3], M = A[4], W = A[5], $ = A[6], BA = A[7], IA = A[8], iA = A[9], uA = A[10], fA = A[11], oA = A[12], BC = A[13], CC = A[14], QC = A[15];
888
+ return Math.abs(I - f) <= AA * Math.max(1, Math.abs(I), Math.abs(f)) && Math.abs(g - d) <= AA * Math.max(1, Math.abs(g), Math.abs(d)) && Math.abs(B - R) <= AA * Math.max(1, Math.abs(B), Math.abs(R)) && Math.abs(Q - L) <= AA * Math.max(1, Math.abs(Q), Math.abs(L)) && Math.abs(E - M) <= AA * Math.max(1, Math.abs(E), Math.abs(M)) && Math.abs(i - W) <= AA * Math.max(1, Math.abs(i), Math.abs(W)) && Math.abs(o - $) <= AA * Math.max(1, Math.abs(o), Math.abs($)) && Math.abs(s - BA) <= AA * Math.max(1, Math.abs(s), Math.abs(BA)) && Math.abs(t - IA) <= AA * Math.max(1, Math.abs(t), Math.abs(IA)) && Math.abs(e - iA) <= AA * Math.max(1, Math.abs(e), Math.abs(iA)) && Math.abs(n - uA) <= AA * Math.max(1, Math.abs(n), Math.abs(uA)) && Math.abs(D - fA) <= AA * Math.max(1, Math.abs(D), Math.abs(fA)) && Math.abs(F - oA) <= AA * Math.max(1, Math.abs(F), Math.abs(oA)) && Math.abs(k - BC) <= AA * Math.max(1, Math.abs(k), Math.abs(BC)) && Math.abs(S - CC) <= AA * Math.max(1, Math.abs(S), Math.abs(CC)) && Math.abs(l - QC) <= AA * Math.max(1, Math.abs(l), Math.abs(QC));
889
889
  }
890
890
  function QA() {
891
891
  var C = new DA(3);
@@ -1009,8 +1009,8 @@ function oi(C, A, I) {
1009
1009
  return C[0] = g * t + E * i + B * s - Q * o, C[1] = B * t + E * o + Q * i - g * s, C[2] = Q * t + E * s + g * o - B * i, C[3] = E * t - g * i - B * o - Q * s, C;
1010
1010
  }
1011
1011
  function qg(C, A, I, g) {
1012
- var B = A[0], Q = A[1], E = A[2], i = A[3], o = I[0], s = I[1], t = I[2], e = I[3], n, D, F, U, S;
1013
- return D = B * o + Q * s + E * t + i * e, D < 0 && (D = -D, o = -o, s = -s, t = -t, e = -e), 1 - D > AA ? (n = Math.acos(D), F = Math.sin(n), U = Math.sin((1 - g) * n) / F, S = Math.sin(g * n) / F) : (U = 1 - g, S = g), C[0] = U * B + S * o, C[1] = U * Q + S * s, C[2] = U * E + S * t, C[3] = U * i + S * e, C;
1012
+ var B = A[0], Q = A[1], E = A[2], i = A[3], o = I[0], s = I[1], t = I[2], e = I[3], n, D, F, k, S;
1013
+ return D = B * o + Q * s + E * t + i * e, D < 0 && (D = -D, o = -o, s = -s, t = -t, e = -e), 1 - D > AA ? (n = Math.acos(D), F = Math.sin(n), k = Math.sin((1 - g) * n) / F, S = Math.sin(g * n) / F) : (k = 1 - g, S = g), C[0] = k * B + S * o, C[1] = k * Q + S * s, C[2] = k * E + S * t, C[3] = k * i + S * e, C;
1014
1014
  }
1015
1015
  function kQ(C, A) {
1016
1016
  var I = A[0] + A[4] + A[8], g;
@@ -1044,7 +1044,7 @@ var si = Bi, ti = Ci, RB = Ei;
1044
1044
  return C[0] = g[0], C[3] = g[1], C[6] = g[2], C[1] = B[0], C[4] = B[1], C[7] = B[2], C[2] = -I[0], C[5] = -I[1], C[8] = -I[2], RB(A, kQ(A, C));
1045
1045
  };
1046
1046
  })();
1047
- function UQ() {
1047
+ function dQ() {
1048
1048
  var C = new DA(2);
1049
1049
  return DA != Float32Array && (C[0] = 0, C[1] = 0), C;
1050
1050
  }
@@ -1076,7 +1076,7 @@ function pg(C, A) {
1076
1076
  return Math.abs(I - B) <= AA * Math.max(1, Math.abs(I), Math.abs(B)) && Math.abs(g - Q) <= AA * Math.max(1, Math.abs(g), Math.abs(Q));
1077
1077
  }
1078
1078
  (function() {
1079
- var C = UQ();
1079
+ var C = dQ();
1080
1080
  return function(A, I, g, B, Q, E) {
1081
1081
  var i, o;
1082
1082
  for (I || (I = 2), g || (g = 0), B ? o = Math.min(B * I + g, A.length) : o = A.length, i = g; i < o; i += I)
@@ -1126,7 +1126,7 @@ class AI {
1126
1126
  SB(Q, E, A), this.expandWithPoint(Q);
1127
1127
  }
1128
1128
  }
1129
- const dQ = {
1129
+ const UQ = {
1130
1130
  position: 0,
1131
1131
  normal: 1,
1132
1132
  uv: 2,
@@ -1225,7 +1225,7 @@ class ri {
1225
1225
  this.gl_.bindBuffer(B, Q), this.gl_.bufferData(B, g, this.gl_.STATIC_DRAW);
1226
1226
  const { attributes: E, strideBytes: i } = A;
1227
1227
  E.forEach((t) => {
1228
- const e = dQ[t.type];
1228
+ const e = UQ[t.type];
1229
1229
  this.gl_.vertexAttribPointer(
1230
1230
  e,
1231
1231
  t.itemSize,
@@ -1315,7 +1315,7 @@ function hi(C) {
1315
1315
  return [0, 1];
1316
1316
  }
1317
1317
  }
1318
- class UB extends GB {
1318
+ class dB extends GB {
1319
1319
  dataFormat = "rgba";
1320
1320
  dataType = "unsigned_byte";
1321
1321
  maxFilter = "nearest";
@@ -1871,10 +1871,10 @@ class aC extends FQ {
1871
1871
  );
1872
1872
  break;
1873
1873
  case "u_cameraPositionModel": {
1874
- const U = Ug(SA(), E), S = Qg(0, 0, 0, 1), l = pI(
1874
+ const k = dg(SA(), E), S = Qg(0, 0, 0, 1), l = pI(
1875
1875
  nI(),
1876
1876
  S,
1877
- U
1877
+ k
1878
1878
  );
1879
1879
  B.setUniform(
1880
1880
  F,
@@ -2062,7 +2062,7 @@ class ki {
2062
2062
  usage: GPUBufferUsage.INDEX,
2063
2063
  mappedAtCreation: !0
2064
2064
  }), new Uint32Array(B.getMappedRange()).set(A.indexData), B.unmap());
2065
- const { attributes: Q, attributesKey: E } = di(A), i = {
2065
+ const { attributes: Q, attributesKey: E } = Ui(A), i = {
2066
2066
  geometry: A,
2067
2067
  vertexBuffer: g,
2068
2068
  indexBuffer: B,
@@ -2083,7 +2083,7 @@ class ki {
2083
2083
  this.buffers_.length = 0;
2084
2084
  }
2085
2085
  }
2086
- function Ui(C) {
2086
+ function di(C) {
2087
2087
  switch (C) {
2088
2088
  case 2:
2089
2089
  return "float32x2";
@@ -2095,18 +2095,18 @@ function Ui(C) {
2095
2095
  throw new Error("Unsupported vertex format size");
2096
2096
  }
2097
2097
  }
2098
- function di(C) {
2098
+ function Ui(C) {
2099
2099
  const A = [];
2100
2100
  let I = "";
2101
2101
  for (const g of C.attributes)
2102
2102
  A.push({
2103
- shaderLocation: dQ[g.type],
2103
+ shaderLocation: UQ[g.type],
2104
2104
  offset: g.offset,
2105
- format: Ui(g.itemSize)
2105
+ format: di(g.itemSize)
2106
2106
  }), I += `${g.type},${g.offset},${g.itemSize}|`;
2107
2107
  return { attributes: A, attributesKey: I };
2108
2108
  }
2109
- class vI extends UB {
2109
+ class vI extends dB {
2110
2110
  width_;
2111
2111
  height_;
2112
2112
  depth_;
@@ -2270,7 +2270,7 @@ function Ji(C) {
2270
2270
  return "rgba32float";
2271
2271
  }
2272
2272
  }
2273
- const dB = (C, A) => ((C + A - 1) / A | 0) * A;
2273
+ const UB = (C, A) => ((C + A - 1) / A | 0) * A;
2274
2274
  function Yi(C) {
2275
2275
  return Object.keys(C);
2276
2276
  }
@@ -2370,14 +2370,14 @@ function Ki(C) {
2370
2370
  return C.size * B;
2371
2371
  {
2372
2372
  const Q = C, { align: E } = SI[Q.type];
2373
- return B > 1 ? dB(C.size, E) * B : C.size;
2373
+ return B > 1 ? UB(C.size, E) * B : C.size;
2374
2374
  }
2375
2375
  }
2376
2376
  }
2377
2377
  function DC(C, A, I, g) {
2378
2378
  const { size: B, type: Q } = C;
2379
2379
  try {
2380
- const { View: E, align: i, size: o } = SI[Q], s = g !== void 0, t = s ? dB(B, i) : o, e = t / E.BYTES_PER_ELEMENT, n = s ? g === 0 ? (A.byteLength - I) / t : g : 1;
2380
+ const { View: E, align: i, size: o } = SI[Q], s = g !== void 0, t = s ? UB(B, i) : o, e = t / E.BYTES_PER_ELEMENT, n = s ? g === 0 ? (A.byteLength - I) / t : g : 1;
2381
2381
  return new E(A, I, e * n);
2382
2382
  } catch {
2383
2383
  throw new Error(`unknown type: ${Q}`);
@@ -2466,7 +2466,7 @@ function YQ(C) {
2466
2466
  return {
2467
2467
  unalignedSize: Q,
2468
2468
  align: E,
2469
- size: dB(Q, E)
2469
+ size: UB(Q, E)
2470
2470
  };
2471
2471
  }
2472
2472
  const B = C.fields;
@@ -2586,7 +2586,7 @@ var sA;
2586
2586
  ((C) => {
2587
2587
  C[C.Uniform = 0] = "Uniform", C[C.Storage = 1] = "Storage", C[C.Immediate = 2] = "Immediate", C[C.Texture = 3] = "Texture", C[C.Sampler = 4] = "Sampler", C[C.StorageTexture = 5] = "StorageTexture";
2588
2588
  })(sA || (sA = {}));
2589
- class UI {
2589
+ class dI {
2590
2590
  constructor(A, I, g, B, Q, E, i) {
2591
2591
  this.relations = null, this.name = A, this.type = I, this.group = g, this.binding = B, this.attributes = Q, this.resourceType = E, this.access = i;
2592
2592
  }
@@ -2871,9 +2871,9 @@ function _(C, A, I, g, B) {
2871
2871
  return B;
2872
2872
  }
2873
2873
  const mg = { r8unorm: { bytesPerBlock: 1, blockWidth: 1, blockHeight: 1, isCompressed: !1, channels: 1 }, r8snorm: { bytesPerBlock: 1, blockWidth: 1, blockHeight: 1, isCompressed: !1, channels: 1 }, r8uint: { bytesPerBlock: 1, blockWidth: 1, blockHeight: 1, isCompressed: !1, channels: 1 }, r8sint: { bytesPerBlock: 1, blockWidth: 1, blockHeight: 1, isCompressed: !1, channels: 1 }, rg8unorm: { bytesPerBlock: 2, blockWidth: 1, blockHeight: 1, isCompressed: !1, channels: 2 }, rg8snorm: { bytesPerBlock: 2, blockWidth: 1, blockHeight: 1, isCompressed: !1, channels: 2 }, rg8uint: { bytesPerBlock: 2, blockWidth: 1, blockHeight: 1, isCompressed: !1, channels: 2 }, rg8sint: { bytesPerBlock: 2, blockWidth: 1, blockHeight: 1, isCompressed: !1, channels: 2 }, rgba8unorm: { bytesPerBlock: 4, blockWidth: 1, blockHeight: 1, isCompressed: !1, channels: 4 }, "rgba8unorm-srgb": { bytesPerBlock: 4, blockWidth: 1, blockHeight: 1, isCompressed: !1, channels: 4 }, rgba8snorm: { bytesPerBlock: 4, blockWidth: 1, blockHeight: 1, isCompressed: !1, channels: 4 }, rgba8uint: { bytesPerBlock: 4, blockWidth: 1, blockHeight: 1, isCompressed: !1, channels: 4 }, rgba8sint: { bytesPerBlock: 4, blockWidth: 1, blockHeight: 1, isCompressed: !1, channels: 4 }, bgra8unorm: { bytesPerBlock: 4, blockWidth: 1, blockHeight: 1, isCompressed: !1, channels: 4 }, "bgra8unorm-srgb": { bytesPerBlock: 4, blockWidth: 1, blockHeight: 1, isCompressed: !1, channels: 4 }, r16uint: { bytesPerBlock: 2, blockWidth: 1, blockHeight: 1, isCompressed: !1, channels: 1 }, r16sint: { bytesPerBlock: 2, blockWidth: 1, blockHeight: 1, isCompressed: !1, channels: 1 }, r16float: { bytesPerBlock: 2, blockWidth: 1, blockHeight: 1, isCompressed: !1, channels: 1 }, rg16uint: { bytesPerBlock: 4, blockWidth: 1, blockHeight: 1, isCompressed: !1, channels: 2 }, rg16sint: { bytesPerBlock: 4, blockWidth: 1, blockHeight: 1, isCompressed: !1, channels: 2 }, rg16float: { bytesPerBlock: 4, blockWidth: 1, blockHeight: 1, isCompressed: !1, channels: 2 }, rgba16uint: { bytesPerBlock: 8, blockWidth: 1, blockHeight: 1, isCompressed: !1, channels: 4 }, rgba16sint: { bytesPerBlock: 8, blockWidth: 1, blockHeight: 1, isCompressed: !1, channels: 4 }, rgba16float: { bytesPerBlock: 8, blockWidth: 1, blockHeight: 1, isCompressed: !1, channels: 4 }, r32uint: { bytesPerBlock: 4, blockWidth: 1, blockHeight: 1, isCompressed: !1, channels: 1 }, r32sint: { bytesPerBlock: 4, blockWidth: 1, blockHeight: 1, isCompressed: !1, channels: 1 }, r32float: { bytesPerBlock: 4, blockWidth: 1, blockHeight: 1, isCompressed: !1, channels: 1 }, rg32uint: { bytesPerBlock: 8, blockWidth: 1, blockHeight: 1, isCompressed: !1, channels: 2 }, rg32sint: { bytesPerBlock: 8, blockWidth: 1, blockHeight: 1, isCompressed: !1, channels: 2 }, rg32float: { bytesPerBlock: 8, blockWidth: 1, blockHeight: 1, isCompressed: !1, channels: 2 }, rgba32uint: { bytesPerBlock: 16, blockWidth: 1, blockHeight: 1, isCompressed: !1, channels: 4 }, rgba32sint: { bytesPerBlock: 16, blockWidth: 1, blockHeight: 1, isCompressed: !1, channels: 4 }, rgba32float: { bytesPerBlock: 16, blockWidth: 1, blockHeight: 1, isCompressed: !1, channels: 4 }, rgb10a2uint: { bytesPerBlock: 4, blockWidth: 1, blockHeight: 1, isCompressed: !1, channels: 4 }, rgb10a2unorm: { bytesPerBlock: 4, blockWidth: 1, blockHeight: 1, isCompressed: !1, channels: 4 }, rg11b10ufloat: { bytesPerBlock: 4, blockWidth: 1, blockHeight: 1, isCompressed: !1, channels: 4 }, stencil8: { bytesPerBlock: 1, blockWidth: 1, blockHeight: 1, isCompressed: !1, isDepthStencil: !0, hasDepth: !1, hasStencil: !0, channels: 1 }, depth16unorm: { bytesPerBlock: 2, blockWidth: 1, blockHeight: 1, isCompressed: !1, isDepthStencil: !0, hasDepth: !0, hasStencil: !1, channels: 1 }, depth24plus: { bytesPerBlock: 4, blockWidth: 1, blockHeight: 1, isCompressed: !1, isDepthStencil: !0, hasDepth: !0, hasStencil: !1, depthOnlyFormat: "depth32float", channels: 1 }, "depth24plus-stencil8": { bytesPerBlock: 8, blockWidth: 1, blockHeight: 1, isCompressed: !1, isDepthStencil: !0, hasDepth: !0, hasStencil: !0, depthOnlyFormat: "depth32float", channels: 1 }, depth32float: { bytesPerBlock: 4, blockWidth: 1, blockHeight: 1, isCompressed: !1, isDepthStencil: !0, hasDepth: !0, hasStencil: !1, channels: 1 }, "depth32float-stencil8": { bytesPerBlock: 8, blockWidth: 1, blockHeight: 1, isCompressed: !1, isDepthStencil: !0, hasDepth: !0, hasStencil: !0, stencilOnlyFormat: "depth32float", channels: 1 }, rgb9e5ufloat: { bytesPerBlock: 4, blockWidth: 1, blockHeight: 1, isCompressed: !1, channels: 4 }, "bc1-rgba-unorm": { bytesPerBlock: 8, blockWidth: 4, blockHeight: 4, isCompressed: !0, channels: 4 }, "bc1-rgba-unorm-srgb": { bytesPerBlock: 8, blockWidth: 4, blockHeight: 4, isCompressed: !0, channels: 4 }, "bc2-rgba-unorm": { bytesPerBlock: 16, blockWidth: 4, blockHeight: 4, isCompressed: !0, channels: 4 }, "bc2-rgba-unorm-srgb": { bytesPerBlock: 16, blockWidth: 4, blockHeight: 4, isCompressed: !0, channels: 4 }, "bc3-rgba-unorm": { bytesPerBlock: 16, blockWidth: 4, blockHeight: 4, isCompressed: !0, channels: 4 }, "bc3-rgba-unorm-srgb": { bytesPerBlock: 16, blockWidth: 4, blockHeight: 4, isCompressed: !0, channels: 4 }, "bc4-r-unorm": { bytesPerBlock: 8, blockWidth: 4, blockHeight: 4, isCompressed: !0, channels: 1 }, "bc4-r-snorm": { bytesPerBlock: 8, blockWidth: 4, blockHeight: 4, isCompressed: !0, channels: 1 }, "bc5-rg-unorm": { bytesPerBlock: 16, blockWidth: 4, blockHeight: 4, isCompressed: !0, channels: 2 }, "bc5-rg-snorm": { bytesPerBlock: 16, blockWidth: 4, blockHeight: 4, isCompressed: !0, channels: 2 }, "bc6h-rgb-ufloat": { bytesPerBlock: 16, blockWidth: 4, blockHeight: 4, isCompressed: !0, channels: 4 }, "bc6h-rgb-float": { bytesPerBlock: 16, blockWidth: 4, blockHeight: 4, isCompressed: !0, channels: 4 }, "bc7-rgba-unorm": { bytesPerBlock: 16, blockWidth: 4, blockHeight: 4, isCompressed: !0, channels: 4 }, "bc7-rgba-unorm-srgb": { bytesPerBlock: 16, blockWidth: 4, blockHeight: 4, isCompressed: !0, channels: 4 }, "etc2-rgb8unorm": { bytesPerBlock: 8, blockWidth: 4, blockHeight: 4, isCompressed: !0, channels: 4 }, "etc2-rgb8unorm-srgb": { bytesPerBlock: 8, blockWidth: 4, blockHeight: 4, isCompressed: !0, channels: 4 }, "etc2-rgb8a1unorm": { bytesPerBlock: 8, blockWidth: 4, blockHeight: 4, isCompressed: !0, channels: 4 }, "etc2-rgb8a1unorm-srgb": { bytesPerBlock: 8, blockWidth: 4, blockHeight: 4, isCompressed: !0, channels: 4 }, "etc2-rgba8unorm": { bytesPerBlock: 16, blockWidth: 4, blockHeight: 4, isCompressed: !0, channels: 4 }, "etc2-rgba8unorm-srgb": { bytesPerBlock: 16, blockWidth: 4, blockHeight: 4, isCompressed: !0, channels: 4 }, "eac-r11unorm": { bytesPerBlock: 8, blockWidth: 1, blockHeight: 1, isCompressed: !0, channels: 1 }, "eac-r11snorm": { bytesPerBlock: 8, blockWidth: 1, blockHeight: 1, isCompressed: !0, channels: 1 }, "eac-rg11unorm": { bytesPerBlock: 16, blockWidth: 1, blockHeight: 1, isCompressed: !0, channels: 2 }, "eac-rg11snorm": { bytesPerBlock: 16, blockWidth: 1, blockHeight: 1, isCompressed: !0, channels: 2 }, "astc-4x4-unorm": { bytesPerBlock: 16, blockWidth: 4, blockHeight: 4, isCompressed: !0, channels: 4 }, "astc-4x4-unorm-srgb": { bytesPerBlock: 16, blockWidth: 4, blockHeight: 4, isCompressed: !0, channels: 4 }, "astc-5x4-unorm": { bytesPerBlock: 16, blockWidth: 5, blockHeight: 4, isCompressed: !0, channels: 4 }, "astc-5x4-unorm-srgb": { bytesPerBlock: 16, blockWidth: 5, blockHeight: 4, isCompressed: !0, channels: 4 }, "astc-5x5-unorm": { bytesPerBlock: 16, blockWidth: 5, blockHeight: 5, isCompressed: !0, channels: 4 }, "astc-5x5-unorm-srgb": { bytesPerBlock: 16, blockWidth: 5, blockHeight: 5, isCompressed: !0, channels: 4 }, "astc-6x5-unorm": { bytesPerBlock: 16, blockWidth: 6, blockHeight: 5, isCompressed: !0, channels: 4 }, "astc-6x5-unorm-srgb": { bytesPerBlock: 16, blockWidth: 6, blockHeight: 5, isCompressed: !0, channels: 4 }, "astc-6x6-unorm": { bytesPerBlock: 16, blockWidth: 6, blockHeight: 6, isCompressed: !0, channels: 4 }, "astc-6x6-unorm-srgb": { bytesPerBlock: 16, blockWidth: 6, blockHeight: 6, isCompressed: !0, channels: 4 }, "astc-8x5-unorm": { bytesPerBlock: 16, blockWidth: 8, blockHeight: 5, isCompressed: !0, channels: 4 }, "astc-8x5-unorm-srgb": { bytesPerBlock: 16, blockWidth: 8, blockHeight: 5, isCompressed: !0, channels: 4 }, "astc-8x6-unorm": { bytesPerBlock: 16, blockWidth: 8, blockHeight: 6, isCompressed: !0, channels: 4 }, "astc-8x6-unorm-srgb": { bytesPerBlock: 16, blockWidth: 8, blockHeight: 6, isCompressed: !0, channels: 4 }, "astc-8x8-unorm": { bytesPerBlock: 16, blockWidth: 8, blockHeight: 8, isCompressed: !0, channels: 4 }, "astc-8x8-unorm-srgb": { bytesPerBlock: 16, blockWidth: 8, blockHeight: 8, isCompressed: !0, channels: 4 }, "astc-10x5-unorm": { bytesPerBlock: 16, blockWidth: 10, blockHeight: 5, isCompressed: !0, channels: 4 }, "astc-10x5-unorm-srgb": { bytesPerBlock: 16, blockWidth: 10, blockHeight: 5, isCompressed: !0, channels: 4 }, "astc-10x6-unorm": { bytesPerBlock: 16, blockWidth: 10, blockHeight: 6, isCompressed: !0, channels: 4 }, "astc-10x6-unorm-srgb": { bytesPerBlock: 16, blockWidth: 10, blockHeight: 6, isCompressed: !0, channels: 4 }, "astc-10x8-unorm": { bytesPerBlock: 16, blockWidth: 10, blockHeight: 8, isCompressed: !0, channels: 4 }, "astc-10x8-unorm-srgb": { bytesPerBlock: 16, blockWidth: 10, blockHeight: 8, isCompressed: !0, channels: 4 }, "astc-10x10-unorm": { bytesPerBlock: 16, blockWidth: 10, blockHeight: 10, isCompressed: !0, channels: 4 }, "astc-10x10-unorm-srgb": { bytesPerBlock: 16, blockWidth: 10, blockHeight: 10, isCompressed: !0, channels: 4 }, "astc-12x10-unorm": { bytesPerBlock: 16, blockWidth: 12, blockHeight: 10, isCompressed: !0, channels: 4 }, "astc-12x10-unorm-srgb": { bytesPerBlock: 16, blockWidth: 12, blockHeight: 10, isCompressed: !0, channels: 4 }, "astc-12x12-unorm": { bytesPerBlock: 16, blockWidth: 12, blockHeight: 12, isCompressed: !0, channels: 4 }, "astc-12x12-unorm-srgb": { bytesPerBlock: 16, blockWidth: 12, blockHeight: 12, isCompressed: !0, channels: 4 } };
2874
- class dA {
2874
+ class UA {
2875
2875
  constructor() {
2876
- this.id = dA._id++, this.line = 0;
2876
+ this.id = UA._id++, this.line = 0;
2877
2877
  }
2878
2878
  get isAstNode() {
2879
2879
  return !0;
@@ -2899,15 +2899,15 @@ class dA {
2899
2899
  return (g = (I = this.constEvaluate(A)) === null || I === void 0 ? void 0 : I.toString()) !== null && g !== void 0 ? g : "";
2900
2900
  }
2901
2901
  }
2902
- dA._id = 0;
2903
- class Eg extends dA {
2902
+ UA._id = 0;
2903
+ class Eg extends UA {
2904
2904
  }
2905
2905
  Eg.instance = new Eg();
2906
- class ig extends dA {
2906
+ class ig extends UA {
2907
2907
  }
2908
2908
  ig.instance = new ig();
2909
2909
  const fQ = /* @__PURE__ */ new Set(["all", "any", "select", "arrayLength", "abs", "acos", "acosh", "asin", "asinh", "atan", "atanh", "atan2", "ceil", "clamp", "cos", "cosh", "countLeadingZeros", "countOneBits", "countTrailingZeros", "cross", "degrees", "determinant", "distance", "dot", "dot4U8Packed", "dot4I8Packed", "exp", "exp2", "extractBits", "faceForward", "firstLeadingBit", "firstTrailingBit", "floor", "fma", "fract", "frexp", "insertBits", "inverseSqrt", "ldexp", "length", "log", "log2", "max", "min", "mix", "modf", "normalize", "pow", "quantizeToF16", "radians", "reflect", "refract", "reverseBits", "round", "saturate", "sign", "sin", "sinh", "smoothstep", "sqrt", "step", "tan", "tanh", "transpose", "trunc", "dpdx", "dpdxCoarse", "dpdxFine", "dpdy", "dpdyCoarse", "dpdyFine", "fwidth", "fwidthCoarse", "fwidthFine", "textureDimensions", "textureGather", "textureGatherCompare", "textureLoad", "textureNumLayers", "textureNumLevels", "textureNumSamples", "textureSample", "textureSampleBias", "textureSampleCompare", "textureSampleCompareLevel", "textureSampleGrad", "textureSampleLevel", "textureSampleBaseClampToEdge", "textureStore", "atomicLoad", "atomicStore", "atomicAdd", "atomicSub", "atomicMax", "atomicMin", "atomicAnd", "atomicOr", "atomicXor", "atomicExchange", "atomicCompareExchangeWeak", "pack4x8snorm", "pack4x8unorm", "pack4xI8", "pack4xU8", "pack4x8Clamp", "pack4xU8Clamp", "pack2x16snorm", "pack2x16unorm", "pack2x16float", "unpack4x8snorm", "unpack4x8unorm", "unpack4xI8", "unpack4xU8", "unpack2x16snorm", "unpack2x16unorm", "unpack2x16float", "storageBarrier", "textureBarrier", "workgroupBarrier", "workgroupUniformLoad", "subgroupAdd", "subgroupExclusiveAdd", "subgroupInclusiveAdd", "subgroupAll", "subgroupAnd", "subgroupAny", "subgroupBallot", "subgroupBroadcast", "subgroupBroadcastFirst", "subgroupElect", "subgroupMax", "subgroupMin", "subgroupMul", "subgroupExclusiveMul", "subgroupInclusiveMul", "subgroupOr", "subgroupShuffle", "subgroupShuffleDown", "subgroupShuffleUp", "subgroupShuffleXor", "subgroupXor", "quadBroadcast", "quadSwapDiagonal", "quadSwapX", "quadSwapY"]);
2910
- class EA extends dA {
2910
+ class EA extends UA {
2911
2911
  }
2912
2912
  class xI extends EA {
2913
2913
  constructor(A, I, g, B, Q, E) {
@@ -3275,7 +3275,7 @@ class LI extends N {
3275
3275
  return "sampler";
3276
3276
  }
3277
3277
  }
3278
- class YA extends dA {
3278
+ class YA extends UA {
3279
3279
  constructor() {
3280
3280
  super(), this.postfix = null, this.hasParen = !1;
3281
3281
  }
@@ -3436,7 +3436,7 @@ class LA extends VQ {
3436
3436
  this.left.search(A), this.right.search(A);
3437
3437
  }
3438
3438
  }
3439
- class _Q extends dA {
3439
+ class _Q extends UA {
3440
3440
  constructor(A) {
3441
3441
  super(), this.body = A;
3442
3442
  }
@@ -3471,7 +3471,7 @@ class jQ extends _Q {
3471
3471
  this.searchBlock(this.body, A);
3472
3472
  }
3473
3473
  }
3474
- class FC extends dA {
3474
+ class FC extends UA {
3475
3475
  constructor(A, I, g) {
3476
3476
  super(), this.name = A, this.type = I, this.attributes = g;
3477
3477
  }
@@ -3479,7 +3479,7 @@ class FC extends dA {
3479
3479
  return "argument";
3480
3480
  }
3481
3481
  }
3482
- class zi extends dA {
3482
+ class zi extends UA {
3483
3483
  constructor(A, I) {
3484
3484
  super(), this.condition = A, this.body = I;
3485
3485
  }
@@ -3490,7 +3490,7 @@ class zi extends dA {
3490
3490
  this.condition.search(A), this.searchBlock(this.body, A);
3491
3491
  }
3492
3492
  }
3493
- class SC extends dA {
3493
+ class SC extends UA {
3494
3494
  constructor(A, I, g) {
3495
3495
  super(), this.name = A, this.type = I, this.attributes = g;
3496
3496
  }
@@ -3498,7 +3498,7 @@ class SC extends dA {
3498
3498
  return "member";
3499
3499
  }
3500
3500
  }
3501
- class zQ extends dA {
3501
+ class zQ extends UA {
3502
3502
  constructor(A, I) {
3503
3503
  super(), this.name = A, this.value = I;
3504
3504
  }
@@ -3920,13 +3920,13 @@ class CA extends MA {
3920
3920
  let n = "f";
3921
3921
  const D = [];
3922
3922
  for (let F = 0; F < t.length; ++F) {
3923
- const U = t[F].toLowerCase();
3923
+ const k = t[F].toLowerCase();
3924
3924
  let S = 0;
3925
- if (U === "x" || U === "r") S = 0;
3926
- else if (U === "y" || U === "g") S = 1;
3927
- else if (U === "z" || U === "b") S = 2;
3925
+ if (k === "x" || k === "r") S = 0;
3926
+ else if (k === "y" || k === "g") S = 1;
3927
+ else if (k === "z" || k === "b") S = 2;
3928
3928
  else {
3929
- if (U !== "w" && U !== "a") return console.error(`Unknown member ${t}`), null;
3929
+ if (k !== "w" && k !== "a") return console.error(`Unknown member ${t}`), null;
3930
3930
  S = 3;
3931
3931
  }
3932
3932
  if (t.length === 1) {
@@ -4066,77 +4066,77 @@ class xA extends MA {
4066
4066
  }
4067
4067
  setPixel(A, I, g, B, Q) {
4068
4068
  const E = this.texelByteSize, i = this.bytesPerRow, o = this.height, s = this.data[B];
4069
- (function(t, e, n, D, F, U, S, l, f, k) {
4070
- const R = D * (S >>= F) * (U >>= F) + n * S + e * l;
4069
+ (function(t, e, n, D, F, k, S, l, f, d) {
4070
+ const R = D * (S >>= F) * (k >>= F) + n * S + e * l;
4071
4071
  switch (f) {
4072
4072
  case "r8unorm":
4073
- return void _(t, R, "8unorm", 1, k);
4073
+ return void _(t, R, "8unorm", 1, d);
4074
4074
  case "r8snorm":
4075
- return void _(t, R, "8snorm", 1, k);
4075
+ return void _(t, R, "8snorm", 1, d);
4076
4076
  case "r8uint":
4077
- return void _(t, R, "8uint", 1, k);
4077
+ return void _(t, R, "8uint", 1, d);
4078
4078
  case "r8sint":
4079
- return void _(t, R, "8sint", 1, k);
4079
+ return void _(t, R, "8sint", 1, d);
4080
4080
  case "rg8unorm":
4081
- return void _(t, R, "8unorm", 2, k);
4081
+ return void _(t, R, "8unorm", 2, d);
4082
4082
  case "rg8snorm":
4083
- return void _(t, R, "8snorm", 2, k);
4083
+ return void _(t, R, "8snorm", 2, d);
4084
4084
  case "rg8uint":
4085
- return void _(t, R, "8uint", 2, k);
4085
+ return void _(t, R, "8uint", 2, d);
4086
4086
  case "rg8sint":
4087
- return void _(t, R, "8sint", 2, k);
4087
+ return void _(t, R, "8sint", 2, d);
4088
4088
  case "rgba8unorm-srgb":
4089
4089
  case "rgba8unorm":
4090
4090
  case "bgra8unorm-srgb":
4091
4091
  case "bgra8unorm":
4092
- return void _(t, R, "8unorm", 4, k);
4092
+ return void _(t, R, "8unorm", 4, d);
4093
4093
  case "rgba8snorm":
4094
- return void _(t, R, "8snorm", 4, k);
4094
+ return void _(t, R, "8snorm", 4, d);
4095
4095
  case "rgba8uint":
4096
- return void _(t, R, "8uint", 4, k);
4096
+ return void _(t, R, "8uint", 4, d);
4097
4097
  case "rgba8sint":
4098
- return void _(t, R, "8sint", 4, k);
4098
+ return void _(t, R, "8sint", 4, d);
4099
4099
  case "r16uint":
4100
- return void _(t, R, "16uint", 1, k);
4100
+ return void _(t, R, "16uint", 1, d);
4101
4101
  case "r16sint":
4102
- return void _(t, R, "16sint", 1, k);
4102
+ return void _(t, R, "16sint", 1, d);
4103
4103
  case "r16float":
4104
- return void _(t, R, "16float", 1, k);
4104
+ return void _(t, R, "16float", 1, d);
4105
4105
  case "rg16uint":
4106
- return void _(t, R, "16uint", 2, k);
4106
+ return void _(t, R, "16uint", 2, d);
4107
4107
  case "rg16sint":
4108
- return void _(t, R, "16sint", 2, k);
4108
+ return void _(t, R, "16sint", 2, d);
4109
4109
  case "rg16float":
4110
- return void _(t, R, "16float", 2, k);
4110
+ return void _(t, R, "16float", 2, d);
4111
4111
  case "rgba16uint":
4112
- return void _(t, R, "16uint", 4, k);
4112
+ return void _(t, R, "16uint", 4, d);
4113
4113
  case "rgba16sint":
4114
- return void _(t, R, "16sint", 4, k);
4114
+ return void _(t, R, "16sint", 4, d);
4115
4115
  case "rgba16float":
4116
- return void _(t, R, "16float", 4, k);
4116
+ return void _(t, R, "16float", 4, d);
4117
4117
  case "r32uint":
4118
- return void _(t, R, "32uint", 1, k);
4118
+ return void _(t, R, "32uint", 1, d);
4119
4119
  case "r32sint":
4120
- return void _(t, R, "32sint", 1, k);
4120
+ return void _(t, R, "32sint", 1, d);
4121
4121
  case "depth16unorm":
4122
4122
  case "depth24plus":
4123
4123
  case "depth24plus-stencil8":
4124
4124
  case "depth32float":
4125
4125
  case "depth32float-stencil8":
4126
4126
  case "r32float":
4127
- return void _(t, R, "32float", 1, k);
4127
+ return void _(t, R, "32float", 1, d);
4128
4128
  case "rg32uint":
4129
- return void _(t, R, "32uint", 2, k);
4129
+ return void _(t, R, "32uint", 2, d);
4130
4130
  case "rg32sint":
4131
- return void _(t, R, "32sint", 2, k);
4131
+ return void _(t, R, "32sint", 2, d);
4132
4132
  case "rg32float":
4133
- return void _(t, R, "32float", 2, k);
4133
+ return void _(t, R, "32float", 2, d);
4134
4134
  case "rgba32uint":
4135
- return void _(t, R, "32uint", 4, k);
4135
+ return void _(t, R, "32uint", 4, d);
4136
4136
  case "rgba32sint":
4137
- return void _(t, R, "32sint", 4, k);
4137
+ return void _(t, R, "32sint", 4, d);
4138
4138
  case "rgba32float":
4139
- return void _(t, R, "32float", 4, k);
4139
+ return void _(t, R, "32float", 4, d);
4140
4140
  case "rg11b10ufloat":
4141
4141
  console.error("TODO: rg11b10ufloat not supported for writing");
4142
4142
  }
@@ -4174,7 +4174,7 @@ class RC {
4174
4174
  return this.isArrayType() || this.isTemplateType();
4175
4175
  }
4176
4176
  }
4177
- class dg {
4177
+ class Ug {
4178
4178
  constructor(A) {
4179
4179
  this._tokens = [], this._start = 0, this._current = 0, this._line = 1, this._source = A ?? "";
4180
4180
  }
@@ -4270,7 +4270,7 @@ class dg {
4270
4270
  return this._current >= this._source.length;
4271
4271
  }
4272
4272
  _isAlpha(A) {
4273
- return !this._isNumeric(A) && !this._isWhitespace(A) && A !== "_" && !dg._operators.has(A);
4273
+ return !this._isNumeric(A) && !this._isWhitespace(A) && A !== "_" && !Ug._operators.has(A);
4274
4274
  }
4275
4275
  _isNumeric(A) {
4276
4276
  return A >= "0" && A <= "9";
@@ -4296,7 +4296,7 @@ class dg {
4296
4296
  function J(C) {
4297
4297
  return Array.isArray(C) || C?.buffer instanceof ArrayBuffer;
4298
4298
  }
4299
- dg._operators = /* @__PURE__ */ new Set([".", "(", ")", "[", "]", "{", "}", ",", ";", ":", "=", "!", "<", ">", "+", "-", "*", "/", "%", "&", "|", "^", "~", "@", "#", "?", "'", "`", '"', "\\", `
4299
+ Ug._operators = /* @__PURE__ */ new Set([".", "(", ")", "[", "]", "{", "}", ",", ";", ":", "=", "!", "<", ">", "+", "-", "*", "/", "%", "&", "|", "^", "~", "@", "#", "?", "'", "`", '"', "\\", `
4300
4300
  `, "\r", " ", "\0"]);
4301
4301
  const og = new Float32Array(1), Ao = new Uint32Array(og.buffer), Io = new Uint32Array(og.buffer), sg = new Int32Array(1), go = new Float32Array(sg.buffer), Bo = new Uint32Array(sg.buffer), tg = new Uint32Array(1), Co = new Float32Array(tg.buffer), Qo = new Int32Array(tg.buffer);
4302
4302
  function kC(C, A, I) {
@@ -4344,27 +4344,27 @@ class qA {
4344
4344
  continue;
4345
4345
  }
4346
4346
  if (this._isUniformVar(I)) {
4347
- const g = I, B = this._getAttributeNum(g.attributes, "group", 0), Q = this._getAttributeNum(g.attributes, "binding", 0), E = this.getTypeInfo(g.type, g.attributes), i = new UI(g.name, E, B, Q, g.attributes, sA.Uniform, g.access);
4347
+ const g = I, B = this._getAttributeNum(g.attributes, "group", 0), Q = this._getAttributeNum(g.attributes, "binding", 0), E = this.getTypeInfo(g.type, g.attributes), i = new dI(g.name, E, B, Q, g.attributes, sA.Uniform, g.access);
4348
4348
  i.access || (i.access = "read"), this.uniforms.push(i);
4349
4349
  continue;
4350
4350
  }
4351
4351
  if (this._isImmediateVar(I)) {
4352
- const g = I, B = this._getAttributeNum(g.attributes, "group", 0), Q = this._getAttributeNum(g.attributes, "binding", 0), E = this.getTypeInfo(g.type, g.attributes), i = new UI(g.name, E, B, Q, g.attributes, sA.Immediate, g.access);
4352
+ const g = I, B = this._getAttributeNum(g.attributes, "group", 0), Q = this._getAttributeNum(g.attributes, "binding", 0), E = this.getTypeInfo(g.type, g.attributes), i = new dI(g.name, E, B, Q, g.attributes, sA.Immediate, g.access);
4353
4353
  i.access || (i.access = "read"), this.immediates.push(i);
4354
4354
  continue;
4355
4355
  }
4356
4356
  if (this._isStorageVar(I)) {
4357
- const g = I, B = this._getAttributeNum(g.attributes, "group", 0), Q = this._getAttributeNum(g.attributes, "binding", 0), E = this.getTypeInfo(g.type, g.attributes), i = this._isStorageTexture(E), o = new UI(g.name, E, B, Q, g.attributes, i ? sA.StorageTexture : sA.Storage, g.access);
4357
+ const g = I, B = this._getAttributeNum(g.attributes, "group", 0), Q = this._getAttributeNum(g.attributes, "binding", 0), E = this.getTypeInfo(g.type, g.attributes), i = this._isStorageTexture(E), o = new dI(g.name, E, B, Q, g.attributes, i ? sA.StorageTexture : sA.Storage, g.access);
4358
4358
  o.access || (o.access = "read"), this.storage.push(o);
4359
4359
  continue;
4360
4360
  }
4361
4361
  if (this._isTextureVar(I)) {
4362
- const g = I, B = this._getAttributeNum(g.attributes, "group", 0), Q = this._getAttributeNum(g.attributes, "binding", 0), E = this.getTypeInfo(g.type, g.attributes), i = this._isStorageTexture(E), o = i ? E.access : g.access, s = new UI(g.name, E, B, Q, g.attributes, i ? sA.StorageTexture : sA.Texture, o || g.access);
4362
+ const g = I, B = this._getAttributeNum(g.attributes, "group", 0), Q = this._getAttributeNum(g.attributes, "binding", 0), E = this.getTypeInfo(g.type, g.attributes), i = this._isStorageTexture(E), o = i ? E.access : g.access, s = new dI(g.name, E, B, Q, g.attributes, i ? sA.StorageTexture : sA.Texture, o || g.access);
4363
4363
  s.access || (s.access = "read"), i ? this.storage.push(s) : this.textures.push(s);
4364
4364
  continue;
4365
4365
  }
4366
4366
  if (this._isSamplerVar(I)) {
4367
- const g = I, B = this._getAttributeNum(g.attributes, "group", 0), Q = this._getAttributeNum(g.attributes, "binding", 0), E = this.getTypeInfo(g.type, g.attributes), i = new UI(g.name, E, B, Q, g.attributes, sA.Sampler, g.access);
4367
+ const g = I, B = this._getAttributeNum(g.attributes, "group", 0), Q = this._getAttributeNum(g.attributes, "binding", 0), E = this.getTypeInfo(g.type, g.attributes), i = new dI(g.name, E, B, Q, g.attributes, sA.Sampler, g.access);
4368
4368
  this.samplers.push(i);
4369
4369
  continue;
4370
4370
  }
@@ -5617,22 +5617,22 @@ class gA extends io {
5617
5617
  e === null && console.error(`Function ${A} not found in reflection data`);
5618
5618
  for (const n in g) for (const D in g[n]) {
5619
5619
  const F = g[n][D];
5620
- Q.variables.forEach((U) => {
5620
+ Q.variables.forEach((k) => {
5621
5621
  var S;
5622
- const l = U.node;
5622
+ const l = k.node;
5623
5623
  if (l?.attributes) {
5624
- let f = null, k = null;
5625
- for (const R of l.attributes) R.name === "binding" ? f = R.value : R.name === "group" && (k = R.value);
5626
- if (D === f && n === k) {
5624
+ let f = null, d = null;
5625
+ for (const R of l.attributes) R.name === "binding" ? f = R.value : R.name === "group" && (d = R.value);
5626
+ if (D === f && n === d) {
5627
5627
  let R = !1;
5628
- for (const L of e.resources) if (L.name === U.name && L.group === parseInt(n) && L.binding === parseInt(D)) {
5628
+ for (const L of e.resources) if (L.name === k.name && L.group === parseInt(n) && L.binding === parseInt(D)) {
5629
5629
  R = !0;
5630
5630
  break;
5631
5631
  }
5632
5632
  if (R) if (F.texture !== void 0 && F.descriptor !== void 0) {
5633
5633
  const L = new xA(F.texture, this.getTypeInfo(l.type), F.descriptor, (S = F.texture.view) !== null && S !== void 0 ? S : null);
5634
- U.value = L;
5635
- } else F.uniform !== void 0 ? U.value = new CA(F.uniform, this.getTypeInfo(l.type)) : U.value = new CA(F, this.getTypeInfo(l.type));
5634
+ k.value = L;
5635
+ } else F.uniform !== void 0 ? k.value = new CA(F.uniform, this.getTypeInfo(l.type)) : k.value = new CA(F, this.getTypeInfo(l.type));
5636
5636
  }
5637
5637
  }
5638
5638
  });
@@ -5716,8 +5716,8 @@ class gA extends io {
5716
5716
  g.setVariable("@workgroup_size", new r(B, Q));
5717
5717
  const i = B[0], o = B[1], s = B[2];
5718
5718
  for (let t = 0, e = 0; t < s; ++t) for (let n = 0; n < o; ++n) for (let D = 0; D < i; ++D, ++e) {
5719
- const F = [D, n, t], U = [D + I[0] * B[0], n + I[1] * B[1], t + I[2] * B[2]];
5720
- g.setVariable("@local_invocation_id", new r(F, Q)), g.setVariable("@global_invocation_id", new r(U, Q)), g.setVariable("@local_invocation_index", new c(e, E)), this._dispatchExec(A, g);
5719
+ const F = [D, n, t], k = [D + I[0] * B[0], n + I[1] * B[1], t + I[2] * B[2]];
5720
+ g.setVariable("@local_invocation_id", new r(F, Q)), g.setVariable("@global_invocation_id", new r(k, Q)), g.setVariable("@local_invocation_index", new c(e, E)), this._dispatchExec(A, g);
5721
5721
  }
5722
5722
  }
5723
5723
  _dispatchExec(A, I) {
@@ -6267,10 +6267,10 @@ class gA extends io {
6267
6267
  if (J(Q) && J(E)) {
6268
6268
  const t = Q, e = E;
6269
6269
  if (this._isMatrixType(g) && this._isMatrixType(B)) {
6270
- const n = (function(S, l, f, k) {
6271
- if (cA[l.name] === void 0 || cA[k.name] === void 0) return null;
6272
- const R = cA[l.name][0], L = cA[l.name][1], M = cA[k.name][0];
6273
- if (R !== cA[k.name][1]) return null;
6270
+ const n = (function(S, l, f, d) {
6271
+ if (cA[l.name] === void 0 || cA[d.name] === void 0) return null;
6272
+ const R = cA[l.name][0], L = cA[l.name][1], M = cA[d.name][0];
6273
+ if (R !== cA[d.name][1]) return null;
6274
6274
  const W = new Array(M * L);
6275
6275
  for (let $ = 0; $ < L; $++) for (let BA = 0; BA < M; BA++) {
6276
6276
  let IA = 0;
@@ -6280,36 +6280,36 @@ class gA extends io {
6280
6280
  return W;
6281
6281
  })(t, g.typeInfo, e, B.typeInfo);
6282
6282
  if (n === null) return console.error(`Matrix multiplication failed. Line ${A.line}.`), null;
6283
- const D = cA[B.typeInfo.name][0], F = cA[g.typeInfo.name][1], U = this.getTypeInfo(`mat${D}x${F}f`);
6284
- return new p(n, U);
6283
+ const D = cA[B.typeInfo.name][0], F = cA[g.typeInfo.name][1], k = this.getTypeInfo(`mat${D}x${F}f`);
6284
+ return new p(n, k);
6285
6285
  }
6286
6286
  if (this._isMatrixType(g) && this._isVectorType(B)) {
6287
- const n = (function(D, F, U, S) {
6287
+ const n = (function(D, F, k, S) {
6288
6288
  if (cA[F.name] === void 0 || xg[S.name] === void 0) return null;
6289
6289
  const l = cA[F.name][0], f = cA[F.name][1];
6290
- if (l !== U.length) return null;
6291
- const k = new Array(f);
6290
+ if (l !== k.length) return null;
6291
+ const d = new Array(f);
6292
6292
  for (let R = 0; R < f; R++) {
6293
6293
  let L = 0;
6294
- for (let M = 0; M < l; M++) L += D[M * f + R] * U[M];
6295
- k[R] = L;
6294
+ for (let M = 0; M < l; M++) L += D[M * f + R] * k[M];
6295
+ d[R] = L;
6296
6296
  }
6297
- return k;
6297
+ return d;
6298
6298
  })(t, g.typeInfo, e, B.typeInfo);
6299
6299
  return n === null ? (console.error(`Matrix vector multiplication failed. Line ${A.line}.`), null) : new r(n, B.typeInfo);
6300
6300
  }
6301
6301
  if (this._isVectorType(g) && this._isMatrixType(B)) {
6302
- const n = (function(D, F, U, S) {
6302
+ const n = (function(D, F, k, S) {
6303
6303
  if (xg[F.name] === void 0 || cA[S.name] === void 0) return null;
6304
6304
  const l = cA[S.name][0], f = cA[S.name][1];
6305
6305
  if (f !== D.length) return null;
6306
- const k = [];
6306
+ const d = [];
6307
6307
  for (let R = 0; R < l; R++) {
6308
6308
  let L = 0;
6309
- for (let M = 0; M < f; M++) L += D[M] * U[M * l + R];
6310
- k[R] = L;
6309
+ for (let M = 0; M < f; M++) L += D[M] * k[M * l + R];
6310
+ d[R] = L;
6311
6311
  }
6312
- return k;
6312
+ return d;
6313
6313
  })(t, g.typeInfo, e, B.typeInfo);
6314
6314
  return n === null ? (console.error(`Matrix vector multiplication failed. Line ${A.line}.`), null) : new r(n, g.typeInfo);
6315
6315
  }
@@ -7002,7 +7002,7 @@ class to {
7002
7002
  }
7003
7003
  _initialize(A) {
7004
7004
  if (A) if (typeof A == "string") {
7005
- const I = new dg(A);
7005
+ const I = new Ug(A);
7006
7006
  this._tokens = I.scanTokens();
7007
7007
  } else this._tokens = A;
7008
7008
  else this._tokens = [];
@@ -7902,7 +7902,7 @@ function Do(C) {
7902
7902
  throw new Error("unknown texture sample type");
7903
7903
  }
7904
7904
  }
7905
- function UC(C) {
7905
+ function dC(C) {
7906
7906
  return C.name.includes("2d_array") ? "2d-array" : C.name.includes("cube_array") ? "cube-array" : C.name.includes("3d") ? "3d" : C.name.includes("1d") ? "1d" : C.name.includes("cube") ? "cube" : "2d";
7907
7907
  }
7908
7908
  function ho(C) {
@@ -7953,7 +7953,7 @@ function co(C, A) {
7953
7953
  visibility: A,
7954
7954
  texture: {
7955
7955
  sampleType: Do(B),
7956
- viewDimension: UC(B),
7956
+ viewDimension: dC(B),
7957
7957
  multisampled: Q
7958
7958
  }
7959
7959
  };
@@ -7973,7 +7973,7 @@ function co(C, A) {
7973
7973
  storageTexture: {
7974
7974
  access: ho(B),
7975
7975
  format: B.format.name,
7976
- viewDimension: UC(B)
7976
+ viewDimension: dC(B)
7977
7977
  }
7978
7978
  };
7979
7979
  default:
@@ -8703,7 +8703,7 @@ let eg = 0, ag = 0;
8703
8703
  function po(C, A) {
8704
8704
  C.data && (eg -= C.data.byteLength, ag -= 1), C.data = A, eg += A.byteLength, ag += 1;
8705
8705
  }
8706
- function dC(C) {
8706
+ function UC(C) {
8707
8707
  C.data && (eg -= C.data.byteLength, ag -= 1), C.data = void 0, C.texture?.releaseCpuData();
8708
8708
  }
8709
8709
  function mo() {
@@ -8789,28 +8789,28 @@ class To {
8789
8789
  H.warn(
8790
8790
  "ChunkStoreView",
8791
8791
  "updateChunkViewStates called with no chunks initialized"
8792
- ), this.chunkViewStates_.forEach(dI);
8792
+ ), this.chunkViewStates_.forEach(UI);
8793
8793
  return;
8794
8794
  }
8795
- const t = UQ();
8795
+ const t = dQ();
8796
8796
  ni(t, g.min, g.max, 0.5);
8797
8797
  const [e, n] = this.getZBounds(A), D = new AI(
8798
8798
  P(g.min[0], g.min[1], e),
8799
8799
  P(g.max[0], g.max[1], n)
8800
8800
  );
8801
- this.chunkViewStates_.forEach(dI);
8802
- const F = this.channelsOfInterest(A), U = this.fallbackLOD(), S = this.getPaddedBounds(D), l = this.currentLOD_ === U ? [this.currentLOD_] : [this.currentLOD_, U];
8801
+ this.chunkViewStates_.forEach(UI);
8802
+ const F = this.channelsOfInterest(A), k = this.fallbackLOD(), S = this.getPaddedBounds(D), l = this.currentLOD_ === k ? [this.currentLOD_] : [this.currentLOD_, k];
8803
8803
  for (const f of l) {
8804
- const k = f === this.currentLOD_, R = f === U;
8804
+ const d = f === this.currentLOD_, R = f === k;
8805
8805
  this.iterateChunksInBox(
8806
8806
  s,
8807
8807
  f,
8808
8808
  F,
8809
8809
  S,
8810
8810
  (L, M) => {
8811
- const W = AI.intersects(M, D), $ = k && !W, BA = this.computePriority(
8811
+ const W = AI.intersects(M, D), $ = d && !W, BA = this.computePriority(
8812
8812
  R,
8813
- k,
8813
+ d,
8814
8814
  W,
8815
8815
  $,
8816
8816
  !0
@@ -8838,10 +8838,10 @@ class To {
8838
8838
  H.warn(
8839
8839
  "ChunkStoreView",
8840
8840
  "updateChunksForVolume called with no chunks initialized"
8841
- ), this.chunkViewStates_.forEach(dI);
8841
+ ), this.chunkViewStates_.forEach(UI);
8842
8842
  return;
8843
8843
  }
8844
- this.currentLOD_ = this.policy_.lod.min, this.chunkViewStates_.forEach(dI);
8844
+ this.currentLOD_ = this.policy_.lod.min, this.chunkViewStates_.forEach(UI);
8845
8845
  const Q = this.channelsOfInterest(A), E = this.fallbackLOD(), i = (o) => {
8846
8846
  const s = o.lod === E, t = o.lod === this.currentLOD_, e = this.computePriority(
8847
8847
  s,
@@ -8885,7 +8885,7 @@ class To {
8885
8885
  I && (I.visible || I.prefetch || I.priority !== null) || this.chunkViewStates_.delete(A);
8886
8886
  }
8887
8887
  dispose() {
8888
- this.isDisposed_ = !0, this.chunkViewStates_.forEach(dI);
8888
+ this.isDisposed_ = !0, this.chunkViewStates_.forEach(UI);
8889
8889
  }
8890
8890
  setImageSourcePolicy(A, I) {
8891
8891
  if (I !== lg)
@@ -8907,49 +8907,47 @@ class To {
8907
8907
  t !== this.currentLOD_ && (this.currentLOD_ = t);
8908
8908
  }
8909
8909
  markTimeChunksForPrefetchImage(A, I, g, B) {
8910
- const Q = this.store_.dimensions.t?.lods[0].size ?? 1, E = Math.min(
8911
- Q - 1,
8912
- A + this.policy_.prefetch.t
8913
- ), i = this.fallbackLOD(), o = this.policy_.priorityMap.prefetchTime, s = this.channelsOfInterest(I);
8914
- for (let t = A + 1; t <= E; ++t)
8910
+ const Q = this.store_.dimensions.t?.lods[0].size ?? 1, E = Math.min(this.policy_.prefetch.t, Q - 1), i = this.fallbackLOD(), o = this.policy_.priorityMap.prefetchTime, s = this.channelsOfInterest(I);
8911
+ for (let t = 1; t <= E; ++t) {
8912
+ const e = (A + t) % Q;
8915
8913
  this.iterateChunksInBox(
8916
- t,
8914
+ e,
8917
8915
  i,
8918
8916
  s,
8919
8917
  g,
8920
- (e) => {
8921
- const n = this.squareDistance2D(
8922
- e,
8918
+ (n) => {
8919
+ const D = this.squareDistance2D(
8920
+ n,
8923
8921
  B
8924
- ), D = TA(
8925
- n / this.sourceMaxSquareDistance2D_,
8922
+ ), F = TA(
8923
+ D / this.sourceMaxSquareDistance2D_,
8926
8924
  0,
8927
8925
  1 - Number.EPSILON
8928
- ), F = t - A + D;
8929
- this.chunkViewStates_.set(e, {
8926
+ ), k = t + F;
8927
+ this.chunkViewStates_.set(n, {
8930
8928
  visible: !1,
8931
8929
  prefetch: !0,
8932
8930
  priority: o,
8933
- orderKey: F
8931
+ orderKey: k
8934
8932
  });
8935
8933
  }
8936
8934
  );
8935
+ }
8937
8936
  }
8938
8937
  markTimeChunksForPrefetchVolume(A, I) {
8939
- const g = this.store_.dimensions.t?.lods[0].size ?? 1, B = Math.min(
8940
- g - 1,
8941
- A + this.policy_.prefetch.t
8942
- ), Q = this.fallbackLOD(), E = this.policy_.priorityMap.prefetchTime, i = this.channelsOfInterest(I);
8943
- for (let o = A + 1; o <= B; ++o)
8944
- this.iterateAllChunksAtLod(o, Q, i, (s) => {
8945
- const t = o - A;
8946
- this.chunkViewStates_.set(s, {
8938
+ const g = this.store_.dimensions.t?.lods[0].size ?? 1, B = Math.min(this.policy_.prefetch.t, g - 1), Q = this.fallbackLOD(), E = this.policy_.priorityMap.prefetchTime, i = this.channelsOfInterest(I);
8939
+ for (let o = 1; o <= B; ++o) {
8940
+ const s = (A + o) % g;
8941
+ this.iterateAllChunksAtLod(s, Q, i, (t) => {
8942
+ const e = o;
8943
+ this.chunkViewStates_.set(t, {
8947
8944
  visible: !1,
8948
8945
  prefetch: !0,
8949
8946
  priority: E,
8950
- orderKey: t
8947
+ orderKey: e
8951
8948
  });
8952
8949
  });
8950
+ }
8953
8951
  }
8954
8952
  computePriority(A, I, g, B, Q) {
8955
8953
  if (!Q) return null;
@@ -8962,8 +8960,8 @@ class To {
8962
8960
  // Half-open chunk-index range [min, max) at a given LOD that covers `bounds`.
8963
8961
  // Returns null if the bounds don't overlap the data grid.
8964
8962
  chunkIndexRange(A, I) {
8965
- const g = this.store_.dimensions, B = g.x.lods[I], Q = g.y.lods[I], E = g.z?.lods[I], i = Math.ceil(B.size / B.chunkSize), o = Math.ceil(Q.size / Q.chunkSize), s = E ? Math.ceil(E.size / E.chunkSize) : 1, t = B.chunkSize * B.scale, e = Q.chunkSize * Q.scale, n = E ? E.chunkSize * E.scale : 1, D = B.translation, F = Q.translation, U = E?.translation ?? 0, S = Math.max(0, Math.floor((A.min[0] - D) / t)), l = Math.min(i, Math.ceil((A.max[0] - D) / t)), f = Math.max(0, Math.floor((A.min[1] - F) / e)), k = Math.min(o, Math.ceil((A.max[1] - F) / e)), R = E ? Math.max(0, Math.floor((A.min[2] - U) / n)) : 0, L = E ? Math.min(s, Math.ceil((A.max[2] - U) / n)) : 1;
8966
- return S >= l || f >= k || R >= L ? null : { xMin: S, xMax: l, yMin: f, yMax: k, zMin: R, zMax: L };
8963
+ const g = this.store_.dimensions, B = g.x.lods[I], Q = g.y.lods[I], E = g.z?.lods[I], i = Math.ceil(B.size / B.chunkSize), o = Math.ceil(Q.size / Q.chunkSize), s = E ? Math.ceil(E.size / E.chunkSize) : 1, t = B.chunkSize * B.scale, e = Q.chunkSize * Q.scale, n = E ? E.chunkSize * E.scale : 1, D = B.translation, F = Q.translation, k = E?.translation ?? 0, S = Math.max(0, Math.floor((A.min[0] - D) / t)), l = Math.min(i, Math.ceil((A.max[0] - D) / t)), f = Math.max(0, Math.floor((A.min[1] - F) / e)), d = Math.min(o, Math.ceil((A.max[1] - F) / e)), R = E ? Math.max(0, Math.floor((A.min[2] - k) / n)) : 0, L = E ? Math.min(s, Math.ceil((A.max[2] - k) / n)) : 1;
8964
+ return S >= l || f >= d || R >= L ? null : { xMin: S, xMax: l, yMin: f, yMax: d, zMin: R, zMax: L };
8967
8965
  }
8968
8966
  iterateChunksInBox(A, I, g, B, Q) {
8969
8967
  const E = this.chunkIndexRange(B, I);
@@ -9065,7 +9063,7 @@ class To {
9065
9063
  return B * B + Q * Q;
9066
9064
  }
9067
9065
  }
9068
- function dI(C) {
9066
+ function UI(C) {
9069
9067
  C.visible = !1, C.prefetch = !1, C.priority = null, C.orderKey = null;
9070
9068
  }
9071
9069
  class Wo {
@@ -9080,17 +9078,17 @@ class Wo {
9080
9078
  const { size: I } = this.getAndValidateTimeDimension(), { size: g } = this.getAndValidateChannelDimension(), B = this.dimensions_.numLods;
9081
9079
  this.chunks_ = new Array(B);
9082
9080
  for (let Q = 0; Q < B; ++Q) {
9083
- const E = this.dimensions_.x.lods[Q], i = this.dimensions_.y.lods[Q], o = this.dimensions_.z?.lods[Q], s = E.chunkSize, t = i.chunkSize, e = o?.chunkSize ?? 1, n = Math.ceil(E.size / s), D = Math.ceil(i.size / t), F = o ? Math.ceil(o.size / e) : 1, U = new Array(I);
9084
- this.chunks_[Q] = U;
9081
+ const E = this.dimensions_.x.lods[Q], i = this.dimensions_.y.lods[Q], o = this.dimensions_.z?.lods[Q], s = E.chunkSize, t = i.chunkSize, e = o?.chunkSize ?? 1, n = Math.ceil(E.size / s), D = Math.ceil(i.size / t), F = o ? Math.ceil(o.size / e) : 1, k = new Array(I);
9082
+ this.chunks_[Q] = k;
9085
9083
  for (let S = 0; S < I; ++S) {
9086
9084
  const l = new Array(g);
9087
- U[S] = l;
9085
+ k[S] = l;
9088
9086
  for (let f = 0; f < g; ++f) {
9089
- const k = new Array(F);
9090
- l[f] = k;
9087
+ const d = new Array(F);
9088
+ l[f] = d;
9091
9089
  for (let R = 0; R < F; ++R) {
9092
9090
  const L = o !== void 0 ? o.translation + R * e * o.scale : 0, M = new Array(D);
9093
- k[R] = M;
9091
+ d[R] = M;
9094
9092
  for (let W = 0; W < D; ++W) {
9095
9093
  const $ = i.translation + W * t * i.scale, BA = new Array(n);
9096
9094
  M[W] = BA;
@@ -9244,6 +9242,9 @@ class Po {
9244
9242
  get memoryLimitBytes() {
9245
9243
  return this.memoryLimitBytes_;
9246
9244
  }
9245
+ set memoryLimitBytes(A) {
9246
+ this.memoryLimitBytes_ = A;
9247
+ }
9247
9248
  get queueStats() {
9248
9249
  return {
9249
9250
  pending: this.queue_.pendingCount,
@@ -9274,7 +9275,7 @@ class Po {
9274
9275
  A.releasedAt ??= performance.now();
9275
9276
  return;
9276
9277
  }
9277
- dC(A), A.state === "loaded" && (A.state = "unloaded");
9278
+ UC(A), A.state === "loaded" && (A.state = "unloaded");
9278
9279
  }
9279
9280
  enqueueWithinBudget(A) {
9280
9281
  if (A.length === 0) return;
@@ -9323,7 +9324,7 @@ class Po {
9323
9324
  const g = Math.min(I.length, this.maxGpuUploadsPerUpdate_);
9324
9325
  for (let B = 0; B < g; B++) {
9325
9326
  const Q = I[B], E = vI.createWithChunk(Q);
9326
- this.uploadTexture_(E), Q.texture = E, this.resident_.add(Q), dC(Q);
9327
+ this.uploadTexture_(E), Q.texture = E, this.resident_.add(Q), UC(Q);
9327
9328
  }
9328
9329
  }
9329
9330
  disposeChunkTexture(A) {
@@ -9372,13 +9373,13 @@ var KI = function(C = 1) {
9372
9373
  };
9373
9374
  };
9374
9375
  KI.Panel = function(C, A, I, g) {
9375
- var B = 1 / 0, Q = 0, E = Math.round, i = E(window.devicePixelRatio || 1), o = E(80 * i * g), s = E(48 * i * g), t = E(3 * i * g), e = E(2 * i * g), n = E(3 * i * g), D = E(15 * i * g), F = E(74 * i * g), U = E(30 * i * g), S = document.createElement("canvas");
9376
+ var B = 1 / 0, Q = 0, E = Math.round, i = E(window.devicePixelRatio || 1), o = E(80 * i * g), s = E(48 * i * g), t = E(3 * i * g), e = E(2 * i * g), n = E(3 * i * g), D = E(15 * i * g), F = E(74 * i * g), k = E(30 * i * g), S = document.createElement("canvas");
9376
9377
  S.width = o, S.height = s, S.style.cssText = `width:${E(g * 80)}px;height:${E(g * 48)}px`;
9377
9378
  var l = S.getContext("2d");
9378
- return l.font = "bold " + E(9 * i * g) + "px Helvetica,Arial,sans-serif", l.textBaseline = "top", l.fillStyle = I, l.fillRect(0, 0, o, s), l.fillStyle = A, l.fillText(C, t, e), l.fillRect(n, D, F, U), l.fillStyle = I, l.globalAlpha = 0.9, l.fillRect(n, D, F, U), {
9379
+ return l.font = "bold " + E(9 * i * g) + "px Helvetica,Arial,sans-serif", l.textBaseline = "top", l.fillStyle = I, l.fillRect(0, 0, o, s), l.fillStyle = A, l.fillText(C, t, e), l.fillRect(n, D, F, k), l.fillStyle = I, l.globalAlpha = 0.9, l.fillRect(n, D, F, k), {
9379
9380
  dom: S,
9380
- update: function(f, k) {
9381
- B = Math.min(B, f), Q = Math.max(Q, f), l.fillStyle = I, l.globalAlpha = 1, l.fillRect(0, 0, o, D), l.fillStyle = A, l.fillText(E(f) + " " + C + " (" + E(B) + "-" + E(Q) + ")", t, e), l.drawImage(S, n + i, D, F - i, U, n, D, F - i, U), l.fillRect(n + F - i, D, i, U), l.fillStyle = I, l.globalAlpha = 0.9, l.fillRect(n + F - i, D, i, E((1 - f / k) * U));
9381
+ update: function(f, d) {
9382
+ B = Math.min(B, f), Q = Math.max(Q, f), l.fillStyle = I, l.globalAlpha = 1, l.fillRect(0, 0, o, D), l.fillStyle = A, l.fillText(E(f) + " " + C + " (" + E(B) + "-" + E(Q) + ")", t, e), l.drawImage(S, n + i, D, F - i, k, n, D, F - i, k), l.fillRect(n + F - i, D, i, k), l.fillStyle = I, l.globalAlpha = 0.9, l.fillRect(n + F - i, D, i, E((1 - f / d) * k));
9382
9383
  }
9383
9384
  };
9384
9385
  };
@@ -9718,7 +9719,7 @@ class IE {
9718
9719
  A.viewports ?? [],
9719
9720
  this.canvas,
9720
9721
  this.context_
9721
- ), this.overlays = A.overlays ?? [], A.showStats && (this.stats_ = Oo());
9722
+ ), this.overlays = [...A.overlays ?? []], A.showStats && (this.stats_ = Oo());
9722
9723
  const Q = [this.canvas];
9723
9724
  for (const E of this.viewports_)
9724
9725
  E.element !== this.canvas && Q.push(E.element);
@@ -9774,6 +9775,16 @@ class IE {
9774
9775
  `Viewport "${A.id}" not found, nothing to remove`
9775
9776
  ), !1) : (this.running && (A.events.disconnect(), A.element !== this.canvas && this.sizeObserver_.unobserve(A.element)), this.viewports_.splice(I, 1), H.info("Idetik", `Removed viewport "${A.id}"`), !0);
9776
9777
  }
9778
+ addOverlay(A) {
9779
+ this.overlays.push(A);
9780
+ }
9781
+ removeOverlay(A) {
9782
+ const I = this.overlays.indexOf(A);
9783
+ return I === -1 ? (H.warn("Idetik", "Overlay not found, nothing to remove"), !1) : (this.overlays.splice(I, 1), !0);
9784
+ }
9785
+ setMemoryLimitMB(A) {
9786
+ this.chunkManager_.memoryLimitBytes = A * 1024 * 1024;
9787
+ }
9777
9788
  start() {
9778
9789
  if (H.info("Idetik", "Idetik runtime starting"), this.running)
9779
9790
  H.warn("Idetik", "Idetik runtime already started");
@@ -10686,8 +10697,8 @@ class hg {
10686
10697
  let t;
10687
10698
  o.length && (t = (n, D) => {
10688
10699
  let F = D;
10689
- for (let U of o)
10690
- F = U(n, F);
10700
+ for (let k of o)
10701
+ F = k(n, F);
10691
10702
  return F;
10692
10703
  });
10693
10704
  let e = JSON.stringify(s, t, I);
@@ -10882,11 +10893,11 @@ class VB {
10882
10893
  return new Uint8Array(I);
10883
10894
  }
10884
10895
  }
10885
- function Us() {
10896
+ function ds() {
10886
10897
  let C = () => import("./blosc-D1xNXZJs.js").then((Q) => Q.default), A = () => import("./lz4-1Ws5oVWR.js").then((Q) => Q.default), I = () => import("./zstd-C4EcZnjq.js").then((Q) => Q.default), g = () => vB, B = () => VB;
10887
10898
  return (/* @__PURE__ */ new Map()).set("blosc", C).set("lz4", A).set("zstd", I).set("gzip", g).set("zlib", B).set("transpose", () => OB).set("bytes", () => Lg).set("crc32c", () => TB).set("vlen-utf8", () => yg).set("json2", () => hg).set("bitround", () => ng).set("cast_value", () => bB).set("scale_offset", () => ZB).set("numcodecs.blosc", C).set("numcodecs.lz4", A).set("numcodecs.zstd", I).set("numcodecs.gzip", g).set("numcodecs.zlib", B).set("numcodecs.vlen-utf8", () => yg).set("numcodecs.shuffle", () => PB).set("numcodecs.delta", () => WB).set("numcodecs.bitround", () => ng).set("numcodecs.json2", () => hg);
10888
10899
  }
10889
- const ds = Us();
10900
+ const Us = ds();
10890
10901
  function tB(C) {
10891
10902
  let A;
10892
10903
  function I() {
@@ -10937,7 +10948,7 @@ function vC(C, A, I) {
10937
10948
  }
10938
10949
  async function ls(C) {
10939
10950
  let A = C.codecs.map(async (E) => {
10940
- let i = await ds.get(E.name)?.();
10951
+ let i = await Us.get(E.name)?.();
10941
10952
  if (!i)
10942
10953
  throw new gs(E.name);
10943
10954
  return { Codec: i, meta: E };
@@ -11002,15 +11013,15 @@ function Js(C, A, I, g) {
11002
11013
  let D = await o[n];
11003
11014
  if (D === null)
11004
11015
  return;
11005
- let { data: F, shape: U, stride: S } = D, l = s.map((R, L) => R % U[L]).reduce((R, L, M) => R + L * S[M], 0), f = F[l], k = F[l + 1];
11006
- if (!(f === ZC && k === ZC))
11016
+ let { data: F, shape: k, stride: S } = D, l = s.map((R, L) => R % k[L]).reduce((R, L, M) => R + L * S[M], 0), f = F[l], d = F[l + 1];
11017
+ if (!(f === ZC && d === ZC))
11007
11018
  return B(n, {
11008
11019
  offset: Number(f),
11009
- length: Number(k)
11020
+ length: Number(d)
11010
11021
  }, t);
11011
11022
  };
11012
11023
  }
11013
- class UA {
11024
+ class dA {
11014
11025
  store;
11015
11026
  path;
11016
11027
  constructor(A, I = "/") {
@@ -11018,10 +11029,10 @@ class UA {
11018
11029
  }
11019
11030
  resolve(A) {
11020
11031
  let I = new URL(`file://${this.path.endsWith("/") ? this.path : `${this.path}/`}`);
11021
- return new UA(this.store, decodeURIComponent(new URL(A, I).pathname));
11032
+ return new dA(this.store, decodeURIComponent(new URL(A, I).pathname));
11022
11033
  }
11023
11034
  }
11024
- class _B extends UA {
11035
+ class _B extends dA {
11025
11036
  kind = "group";
11026
11037
  #A;
11027
11038
  constructor(A, I, g) {
@@ -11079,7 +11090,7 @@ function Ys(C, A) {
11079
11090
  }
11080
11091
  };
11081
11092
  }
11082
- let cg = class extends UA {
11093
+ let cg = class extends dA {
11083
11094
  kind = "array";
11084
11095
  #A;
11085
11096
  [$I];
@@ -11188,7 +11199,7 @@ async function Ks(C, A) {
11188
11199
  return I ? VI(I) : {};
11189
11200
  }
11190
11201
  async function Hs(C, A = {}) {
11191
- let I = "store" in C ? C : new UA(C), { signal: g } = A, B = {};
11202
+ let I = "store" in C ? C : new dA(C), { signal: g } = A, B = {};
11192
11203
  return (A.attrs ?? !0) && (B = await Ks(I, g)), g?.throwIfAborted(), A.kind === "array" ? OC(I, B, g) : A.kind === "group" ? VC(I, B, g) : OC(I, B, g).catch((Q) => (CE(Q, NI, nA), VC(I, B, g)));
11193
11204
  }
11194
11205
  async function OC(C, A, I) {
@@ -11211,7 +11222,7 @@ async function qs(C, A) {
11211
11222
  return Q.node_type === "array" && (Q.fill_value = BE(Q)), Q.node_type === "array" ? iE(new cg(I, C.path, Q)) : new _B(I, C.path, Q);
11212
11223
  }
11213
11224
  async function ps(C, A = {}) {
11214
- let I = "store" in C ? C : new UA(C), g = await qs(I, A.signal);
11225
+ let I = "store" in C ? C : new dA(C), g = await qs(I, A.signal);
11215
11226
  if (Jg.increment(I.store, "v3"), A.kind === void 0 || A.kind === "array" && g instanceof cg || A.kind === "group" && g instanceof _B)
11216
11227
  return g;
11217
11228
  let B = g instanceof cg ? "array" : "group";
@@ -11296,11 +11307,11 @@ async function bs(C) {
11296
11307
  switch (C.type) {
11297
11308
  case "fetch": {
11298
11309
  const g = new ZI(C.url);
11299
- A = new UA(g);
11310
+ A = new dA(g);
11300
11311
  break;
11301
11312
  }
11302
11313
  case "filesystem": {
11303
- A = new UA(
11314
+ A = new dA(
11304
11315
  new XB(C.directoryHandle),
11305
11316
  C.path
11306
11317
  );
@@ -11356,17 +11367,17 @@ function vs(C, A, I, g) {
11356
11367
  throw new Error(
11357
11368
  `Received chunk too small: expected ${JSON.stringify(B)}, got ${JSON.stringify(o)}`
11358
11369
  );
11359
- const s = g.cChunkSize ? Q.c % g.cChunkSize : 0, t = g.tChunkSize ? Q.t % g.tChunkSize : 0, e = B.x * B.y * B.z, n = E.c !== void 0 ? I[E.c] : 0, D = E.t !== void 0 ? I[E.t] : 0, F = t * D + s * n, U = o.x === B.x && o.y === B.y && o.z === B.z;
11360
- if (F === 0 && C.length === e && U)
11370
+ const s = g.cChunkSize ? Q.c % g.cChunkSize : 0, t = g.tChunkSize ? Q.t % g.tChunkSize : 0, e = B.x * B.y * B.z, n = E.c !== void 0 ? I[E.c] : 0, D = E.t !== void 0 ? I[E.t] : 0, F = t * D + s * n, k = o.x === B.x && o.y === B.y && o.z === B.z;
11371
+ if (F === 0 && C.length === e && k)
11361
11372
  return C;
11362
11373
  const l = new C.constructor(
11363
11374
  e
11364
- ), f = E.z !== void 0 ? I[E.z] : 0, k = I[E.y];
11375
+ ), f = E.z !== void 0 ? I[E.z] : 0, d = I[E.y];
11365
11376
  let R = 0;
11366
11377
  for (let L = 0; L < B.z; L++) {
11367
11378
  const M = F + L * f;
11368
11379
  for (let W = 0; W < B.y; W++) {
11369
- const $ = M + W * k, BA = $ + B.x;
11380
+ const $ = M + W * d, BA = $ + B.x;
11370
11381
  l.set(C.subarray($, BA), R), R += B.x;
11371
11382
  }
11372
11383
  }
@@ -15276,7 +15287,7 @@ function gt(C, A) {
15276
15287
  const I = C.axes.map((e) => e.name), g = C.axes.length, B = zC(I, "x"), Q = zC(I, "y"), E = (e, n) => {
15277
15288
  const D = [];
15278
15289
  for (let F = 0; F < C.datasets.length; F++) {
15279
- const U = C.datasets[F], S = A[F], l = U.coordinateTransformations[0].scale, f = U.coordinateTransformations.length === 2 ? U.coordinateTransformations[1].translation : new Array(g).fill(0);
15290
+ const k = C.datasets[F], S = A[F], l = k.coordinateTransformations[0].scale, f = k.coordinateTransformations.length === 2 ? k.coordinateTransformations[1].translation : new Array(g).fill(0);
15280
15291
  D.push({
15281
15292
  size: S.shape[n],
15282
15293
  chunkSize: S.chunks[n],
@@ -15412,7 +15423,7 @@ const u = O.arrayToEnum([
15412
15423
  default:
15413
15424
  return u.unknown;
15414
15425
  }
15415
- }, d = O.arrayToEnum([
15426
+ }, U = O.arrayToEnum([
15416
15427
  "invalid_type",
15417
15428
  "invalid_literal",
15418
15429
  "custom",
@@ -15497,52 +15508,52 @@ WA.create = (C) => new WA(C);
15497
15508
  const eB = (C, A) => {
15498
15509
  let I;
15499
15510
  switch (C.code) {
15500
- case d.invalid_type:
15511
+ case U.invalid_type:
15501
15512
  C.received === u.undefined ? I = "Required" : I = `Expected ${C.expected}, received ${C.received}`;
15502
15513
  break;
15503
- case d.invalid_literal:
15514
+ case U.invalid_literal:
15504
15515
  I = `Invalid literal value, expected ${JSON.stringify(C.expected, O.jsonStringifyReplacer)}`;
15505
15516
  break;
15506
- case d.unrecognized_keys:
15517
+ case U.unrecognized_keys:
15507
15518
  I = `Unrecognized key(s) in object: ${O.joinValues(C.keys, ", ")}`;
15508
15519
  break;
15509
- case d.invalid_union:
15520
+ case U.invalid_union:
15510
15521
  I = "Invalid input";
15511
15522
  break;
15512
- case d.invalid_union_discriminator:
15523
+ case U.invalid_union_discriminator:
15513
15524
  I = `Invalid discriminator value. Expected ${O.joinValues(C.options)}`;
15514
15525
  break;
15515
- case d.invalid_enum_value:
15526
+ case U.invalid_enum_value:
15516
15527
  I = `Invalid enum value. Expected ${O.joinValues(C.options)}, received '${C.received}'`;
15517
15528
  break;
15518
- case d.invalid_arguments:
15529
+ case U.invalid_arguments:
15519
15530
  I = "Invalid function arguments";
15520
15531
  break;
15521
- case d.invalid_return_type:
15532
+ case U.invalid_return_type:
15522
15533
  I = "Invalid function return type";
15523
15534
  break;
15524
- case d.invalid_date:
15535
+ case U.invalid_date:
15525
15536
  I = "Invalid date";
15526
15537
  break;
15527
- case d.invalid_string:
15538
+ case U.invalid_string:
15528
15539
  typeof C.validation == "object" ? "includes" in C.validation ? (I = `Invalid input: must include "${C.validation.includes}"`, typeof C.validation.position == "number" && (I = `${I} at one or more positions greater than or equal to ${C.validation.position}`)) : "startsWith" in C.validation ? I = `Invalid input: must start with "${C.validation.startsWith}"` : "endsWith" in C.validation ? I = `Invalid input: must end with "${C.validation.endsWith}"` : O.assertNever(C.validation) : C.validation !== "regex" ? I = `Invalid ${C.validation}` : I = "Invalid";
15529
15540
  break;
15530
- case d.too_small:
15541
+ case U.too_small:
15531
15542
  C.type === "array" ? I = `Array must contain ${C.exact ? "exactly" : C.inclusive ? "at least" : "more than"} ${C.minimum} element(s)` : C.type === "string" ? I = `String must contain ${C.exact ? "exactly" : C.inclusive ? "at least" : "over"} ${C.minimum} character(s)` : C.type === "number" ? I = `Number must be ${C.exact ? "exactly equal to " : C.inclusive ? "greater than or equal to " : "greater than "}${C.minimum}` : C.type === "bigint" ? I = `Number must be ${C.exact ? "exactly equal to " : C.inclusive ? "greater than or equal to " : "greater than "}${C.minimum}` : C.type === "date" ? I = `Date must be ${C.exact ? "exactly equal to " : C.inclusive ? "greater than or equal to " : "greater than "}${new Date(Number(C.minimum))}` : I = "Invalid input";
15532
15543
  break;
15533
- case d.too_big:
15544
+ case U.too_big:
15534
15545
  C.type === "array" ? I = `Array must contain ${C.exact ? "exactly" : C.inclusive ? "at most" : "less than"} ${C.maximum} element(s)` : C.type === "string" ? I = `String must contain ${C.exact ? "exactly" : C.inclusive ? "at most" : "under"} ${C.maximum} character(s)` : C.type === "number" ? I = `Number must be ${C.exact ? "exactly" : C.inclusive ? "less than or equal to" : "less than"} ${C.maximum}` : C.type === "bigint" ? I = `BigInt must be ${C.exact ? "exactly" : C.inclusive ? "less than or equal to" : "less than"} ${C.maximum}` : C.type === "date" ? I = `Date must be ${C.exact ? "exactly" : C.inclusive ? "smaller than or equal to" : "smaller than"} ${new Date(Number(C.maximum))}` : I = "Invalid input";
15535
15546
  break;
15536
- case d.custom:
15547
+ case U.custom:
15537
15548
  I = "Invalid input";
15538
15549
  break;
15539
- case d.invalid_intersection_types:
15550
+ case U.invalid_intersection_types:
15540
15551
  I = "Intersection results could not be merged";
15541
15552
  break;
15542
- case d.not_multiple_of:
15553
+ case U.not_multiple_of:
15543
15554
  I = `Number must be a multiple of ${C.multipleOf}`;
15544
15555
  break;
15545
- case d.not_finite:
15556
+ case U.not_finite:
15546
15557
  I = "Number must be finite";
15547
15558
  break;
15548
15559
  default:
@@ -15793,7 +15804,7 @@ class Z {
15793
15804
  const g = (B) => typeof I == "string" || typeof I > "u" ? { message: I } : typeof I == "function" ? I(B) : I;
15794
15805
  return this._refinement((B, Q) => {
15795
15806
  const E = A(B), i = () => Q.addIssue({
15796
- code: d.custom,
15807
+ code: U.custom,
15797
15808
  ...g(B)
15798
15809
  });
15799
15810
  return typeof Promise < "u" && E instanceof Promise ? E.then((o) => o ? !0 : (i(), !1)) : E ? !0 : (i(), !1);
@@ -15910,10 +15921,10 @@ function kt(C) {
15910
15921
  const I = [];
15911
15922
  return I.push(C.local ? "Z?" : "Z"), C.offset && I.push("([+-]\\d{2}:?\\d{2})"), A = `${A}(${I.join("|")})`, new RegExp(`^${A}$`);
15912
15923
  }
15913
- function Ut(C, A) {
15924
+ function dt(C, A) {
15914
15925
  return !!((A === "v4" || !A) && yt.test(C) || (A === "v6" || !A) && wt.test(C));
15915
15926
  }
15916
- function dt(C, A) {
15927
+ function Ut(C, A) {
15917
15928
  if (!nt.test(C))
15918
15929
  return !1;
15919
15930
  try {
@@ -15934,7 +15945,7 @@ class PA extends Z {
15934
15945
  if (this._def.coerce && (A.data = String(A.data)), this._getType(A) !== u.string) {
15935
15946
  const Q = this._getOrReturnCtx(A);
15936
15947
  return Y(Q, {
15937
- code: d.invalid_type,
15948
+ code: U.invalid_type,
15938
15949
  expected: u.string,
15939
15950
  received: Q.parsedType
15940
15951
  }), m;
@@ -15944,7 +15955,7 @@ class PA extends Z {
15944
15955
  for (const Q of this._def.checks)
15945
15956
  if (Q.kind === "min")
15946
15957
  A.data.length < Q.value && (B = this._getOrReturnCtx(A, B), Y(B, {
15947
- code: d.too_small,
15958
+ code: U.too_small,
15948
15959
  minimum: Q.value,
15949
15960
  type: "string",
15950
15961
  inclusive: !0,
@@ -15953,7 +15964,7 @@ class PA extends Z {
15953
15964
  }), g.dirty());
15954
15965
  else if (Q.kind === "max")
15955
15966
  A.data.length > Q.value && (B = this._getOrReturnCtx(A, B), Y(B, {
15956
- code: d.too_big,
15967
+ code: U.too_big,
15957
15968
  maximum: Q.value,
15958
15969
  type: "string",
15959
15970
  inclusive: !0,
@@ -15963,14 +15974,14 @@ class PA extends Z {
15963
15974
  else if (Q.kind === "length") {
15964
15975
  const E = A.data.length > Q.value, i = A.data.length < Q.value;
15965
15976
  (E || i) && (B = this._getOrReturnCtx(A, B), E ? Y(B, {
15966
- code: d.too_big,
15977
+ code: U.too_big,
15967
15978
  maximum: Q.value,
15968
15979
  type: "string",
15969
15980
  inclusive: !0,
15970
15981
  exact: !0,
15971
15982
  message: Q.message
15972
15983
  }) : i && Y(B, {
15973
- code: d.too_small,
15984
+ code: U.too_small,
15974
15985
  minimum: Q.value,
15975
15986
  type: "string",
15976
15987
  inclusive: !0,
@@ -15980,43 +15991,43 @@ class PA extends Z {
15980
15991
  } else if (Q.kind === "email")
15981
15992
  Dt.test(A.data) || (B = this._getOrReturnCtx(A, B), Y(B, {
15982
15993
  validation: "email",
15983
- code: d.invalid_string,
15994
+ code: U.invalid_string,
15984
15995
  message: Q.message
15985
15996
  }), g.dirty());
15986
15997
  else if (Q.kind === "emoji")
15987
15998
  Vg || (Vg = new RegExp(ht, "u")), Vg.test(A.data) || (B = this._getOrReturnCtx(A, B), Y(B, {
15988
15999
  validation: "emoji",
15989
- code: d.invalid_string,
16000
+ code: U.invalid_string,
15990
16001
  message: Q.message
15991
16002
  }), g.dirty());
15992
16003
  else if (Q.kind === "uuid")
15993
16004
  et.test(A.data) || (B = this._getOrReturnCtx(A, B), Y(B, {
15994
16005
  validation: "uuid",
15995
- code: d.invalid_string,
16006
+ code: U.invalid_string,
15996
16007
  message: Q.message
15997
16008
  }), g.dirty());
15998
16009
  else if (Q.kind === "nanoid")
15999
16010
  at.test(A.data) || (B = this._getOrReturnCtx(A, B), Y(B, {
16000
16011
  validation: "nanoid",
16001
- code: d.invalid_string,
16012
+ code: U.invalid_string,
16002
16013
  message: Q.message
16003
16014
  }), g.dirty());
16004
16015
  else if (Q.kind === "cuid")
16005
16016
  ot.test(A.data) || (B = this._getOrReturnCtx(A, B), Y(B, {
16006
16017
  validation: "cuid",
16007
- code: d.invalid_string,
16018
+ code: U.invalid_string,
16008
16019
  message: Q.message
16009
16020
  }), g.dirty());
16010
16021
  else if (Q.kind === "cuid2")
16011
16022
  st.test(A.data) || (B = this._getOrReturnCtx(A, B), Y(B, {
16012
16023
  validation: "cuid2",
16013
- code: d.invalid_string,
16024
+ code: U.invalid_string,
16014
16025
  message: Q.message
16015
16026
  }), g.dirty());
16016
16027
  else if (Q.kind === "ulid")
16017
16028
  tt.test(A.data) || (B = this._getOrReturnCtx(A, B), Y(B, {
16018
16029
  validation: "ulid",
16019
- code: d.invalid_string,
16030
+ code: U.invalid_string,
16020
16031
  message: Q.message
16021
16032
  }), g.dirty());
16022
16033
  else if (Q.kind === "url")
@@ -16025,61 +16036,61 @@ class PA extends Z {
16025
16036
  } catch {
16026
16037
  B = this._getOrReturnCtx(A, B), Y(B, {
16027
16038
  validation: "url",
16028
- code: d.invalid_string,
16039
+ code: U.invalid_string,
16029
16040
  message: Q.message
16030
16041
  }), g.dirty();
16031
16042
  }
16032
16043
  else Q.kind === "regex" ? (Q.regex.lastIndex = 0, Q.regex.test(A.data) || (B = this._getOrReturnCtx(A, B), Y(B, {
16033
16044
  validation: "regex",
16034
- code: d.invalid_string,
16045
+ code: U.invalid_string,
16035
16046
  message: Q.message
16036
16047
  }), g.dirty())) : Q.kind === "trim" ? A.data = A.data.trim() : Q.kind === "includes" ? A.data.includes(Q.value, Q.position) || (B = this._getOrReturnCtx(A, B), Y(B, {
16037
- code: d.invalid_string,
16048
+ code: U.invalid_string,
16038
16049
  validation: { includes: Q.value, position: Q.position },
16039
16050
  message: Q.message
16040
16051
  }), g.dirty()) : Q.kind === "toLowerCase" ? A.data = A.data.toLowerCase() : Q.kind === "toUpperCase" ? A.data = A.data.toUpperCase() : Q.kind === "startsWith" ? A.data.startsWith(Q.value) || (B = this._getOrReturnCtx(A, B), Y(B, {
16041
- code: d.invalid_string,
16052
+ code: U.invalid_string,
16042
16053
  validation: { startsWith: Q.value },
16043
16054
  message: Q.message
16044
16055
  }), g.dirty()) : Q.kind === "endsWith" ? A.data.endsWith(Q.value) || (B = this._getOrReturnCtx(A, B), Y(B, {
16045
- code: d.invalid_string,
16056
+ code: U.invalid_string,
16046
16057
  validation: { endsWith: Q.value },
16047
16058
  message: Q.message
16048
16059
  }), g.dirty()) : Q.kind === "datetime" ? kt(Q).test(A.data) || (B = this._getOrReturnCtx(A, B), Y(B, {
16049
- code: d.invalid_string,
16060
+ code: U.invalid_string,
16050
16061
  validation: "datetime",
16051
16062
  message: Q.message
16052
16063
  }), g.dirty()) : Q.kind === "date" ? Nt.test(A.data) || (B = this._getOrReturnCtx(A, B), Y(B, {
16053
- code: d.invalid_string,
16064
+ code: U.invalid_string,
16054
16065
  validation: "date",
16055
16066
  message: Q.message
16056
16067
  }), g.dirty()) : Q.kind === "time" ? Rt(Q).test(A.data) || (B = this._getOrReturnCtx(A, B), Y(B, {
16057
- code: d.invalid_string,
16068
+ code: U.invalid_string,
16058
16069
  validation: "time",
16059
16070
  message: Q.message
16060
16071
  }), g.dirty()) : Q.kind === "duration" ? rt.test(A.data) || (B = this._getOrReturnCtx(A, B), Y(B, {
16061
16072
  validation: "duration",
16062
- code: d.invalid_string,
16073
+ code: U.invalid_string,
16063
16074
  message: Q.message
16064
- }), g.dirty()) : Q.kind === "ip" ? Ut(A.data, Q.version) || (B = this._getOrReturnCtx(A, B), Y(B, {
16075
+ }), g.dirty()) : Q.kind === "ip" ? dt(A.data, Q.version) || (B = this._getOrReturnCtx(A, B), Y(B, {
16065
16076
  validation: "ip",
16066
- code: d.invalid_string,
16077
+ code: U.invalid_string,
16067
16078
  message: Q.message
16068
- }), g.dirty()) : Q.kind === "jwt" ? dt(A.data, Q.alg) || (B = this._getOrReturnCtx(A, B), Y(B, {
16079
+ }), g.dirty()) : Q.kind === "jwt" ? Ut(A.data, Q.alg) || (B = this._getOrReturnCtx(A, B), Y(B, {
16069
16080
  validation: "jwt",
16070
- code: d.invalid_string,
16081
+ code: U.invalid_string,
16071
16082
  message: Q.message
16072
16083
  }), g.dirty()) : Q.kind === "cidr" ? lt(A.data, Q.version) || (B = this._getOrReturnCtx(A, B), Y(B, {
16073
16084
  validation: "cidr",
16074
- code: d.invalid_string,
16085
+ code: U.invalid_string,
16075
16086
  message: Q.message
16076
16087
  }), g.dirty()) : Q.kind === "base64" ? Ft.test(A.data) || (B = this._getOrReturnCtx(A, B), Y(B, {
16077
16088
  validation: "base64",
16078
- code: d.invalid_string,
16089
+ code: U.invalid_string,
16079
16090
  message: Q.message
16080
16091
  }), g.dirty()) : Q.kind === "base64url" ? St.test(A.data) || (B = this._getOrReturnCtx(A, B), Y(B, {
16081
16092
  validation: "base64url",
16082
- code: d.invalid_string,
16093
+ code: U.invalid_string,
16083
16094
  message: Q.message
16084
16095
  }), g.dirty()) : O.assertNever(Q);
16085
16096
  return { status: g.value, value: A.data };
@@ -16087,7 +16098,7 @@ class PA extends Z {
16087
16098
  _regex(A, I, g) {
16088
16099
  return this.refinement((B) => A.test(B), {
16089
16100
  validation: I,
16090
- code: d.invalid_string,
16101
+ code: U.invalid_string,
16091
16102
  ...K.errToObj(g)
16092
16103
  });
16093
16104
  }
@@ -16324,7 +16335,7 @@ class hI extends Z {
16324
16335
  if (this._def.coerce && (A.data = Number(A.data)), this._getType(A) !== u.number) {
16325
16336
  const Q = this._getOrReturnCtx(A);
16326
16337
  return Y(Q, {
16327
- code: d.invalid_type,
16338
+ code: U.invalid_type,
16328
16339
  expected: u.number,
16329
16340
  received: Q.parsedType
16330
16341
  }), m;
@@ -16333,30 +16344,30 @@ class hI extends Z {
16333
16344
  const B = new NA();
16334
16345
  for (const Q of this._def.checks)
16335
16346
  Q.kind === "int" ? O.isInteger(A.data) || (g = this._getOrReturnCtx(A, g), Y(g, {
16336
- code: d.invalid_type,
16347
+ code: U.invalid_type,
16337
16348
  expected: "integer",
16338
16349
  received: "float",
16339
16350
  message: Q.message
16340
16351
  }), B.dirty()) : Q.kind === "min" ? (Q.inclusive ? A.data < Q.value : A.data <= Q.value) && (g = this._getOrReturnCtx(A, g), Y(g, {
16341
- code: d.too_small,
16352
+ code: U.too_small,
16342
16353
  minimum: Q.value,
16343
16354
  type: "number",
16344
16355
  inclusive: Q.inclusive,
16345
16356
  exact: !1,
16346
16357
  message: Q.message
16347
16358
  }), B.dirty()) : Q.kind === "max" ? (Q.inclusive ? A.data > Q.value : A.data >= Q.value) && (g = this._getOrReturnCtx(A, g), Y(g, {
16348
- code: d.too_big,
16359
+ code: U.too_big,
16349
16360
  maximum: Q.value,
16350
16361
  type: "number",
16351
16362
  inclusive: Q.inclusive,
16352
16363
  exact: !1,
16353
16364
  message: Q.message
16354
16365
  }), B.dirty()) : Q.kind === "multipleOf" ? Lt(A.data, Q.value) !== 0 && (g = this._getOrReturnCtx(A, g), Y(g, {
16355
- code: d.not_multiple_of,
16366
+ code: U.not_multiple_of,
16356
16367
  multipleOf: Q.value,
16357
16368
  message: Q.message
16358
16369
  }), B.dirty()) : Q.kind === "finite" ? Number.isFinite(A.data) || (g = this._getOrReturnCtx(A, g), Y(g, {
16359
- code: d.not_finite,
16370
+ code: U.not_finite,
16360
16371
  message: Q.message
16361
16372
  }), B.dirty()) : O.assertNever(Q);
16362
16373
  return { status: B.value, value: A.data };
@@ -16505,19 +16516,19 @@ class bI extends Z {
16505
16516
  const B = new NA();
16506
16517
  for (const Q of this._def.checks)
16507
16518
  Q.kind === "min" ? (Q.inclusive ? A.data < Q.value : A.data <= Q.value) && (g = this._getOrReturnCtx(A, g), Y(g, {
16508
- code: d.too_small,
16519
+ code: U.too_small,
16509
16520
  type: "bigint",
16510
16521
  minimum: Q.value,
16511
16522
  inclusive: Q.inclusive,
16512
16523
  message: Q.message
16513
16524
  }), B.dirty()) : Q.kind === "max" ? (Q.inclusive ? A.data > Q.value : A.data >= Q.value) && (g = this._getOrReturnCtx(A, g), Y(g, {
16514
- code: d.too_big,
16525
+ code: U.too_big,
16515
16526
  type: "bigint",
16516
16527
  maximum: Q.value,
16517
16528
  inclusive: Q.inclusive,
16518
16529
  message: Q.message
16519
16530
  }), B.dirty()) : Q.kind === "multipleOf" ? A.data % Q.value !== BigInt(0) && (g = this._getOrReturnCtx(A, g), Y(g, {
16520
- code: d.not_multiple_of,
16531
+ code: U.not_multiple_of,
16521
16532
  multipleOf: Q.value,
16522
16533
  message: Q.message
16523
16534
  }), B.dirty()) : O.assertNever(Q);
@@ -16526,7 +16537,7 @@ class bI extends Z {
16526
16537
  _getInvalidInput(A) {
16527
16538
  const I = this._getOrReturnCtx(A);
16528
16539
  return Y(I, {
16529
- code: d.invalid_type,
16540
+ code: U.invalid_type,
16530
16541
  expected: u.bigint,
16531
16542
  received: I.parsedType
16532
16543
  }), m;
@@ -16626,7 +16637,7 @@ class aB extends Z {
16626
16637
  if (this._def.coerce && (A.data = !!A.data), this._getType(A) !== u.boolean) {
16627
16638
  const g = this._getOrReturnCtx(A);
16628
16639
  return Y(g, {
16629
- code: d.invalid_type,
16640
+ code: U.invalid_type,
16630
16641
  expected: u.boolean,
16631
16642
  received: g.parsedType
16632
16643
  }), m;
@@ -16644,7 +16655,7 @@ class Fg extends Z {
16644
16655
  if (this._def.coerce && (A.data = new Date(A.data)), this._getType(A) !== u.date) {
16645
16656
  const Q = this._getOrReturnCtx(A);
16646
16657
  return Y(Q, {
16647
- code: d.invalid_type,
16658
+ code: U.invalid_type,
16648
16659
  expected: u.date,
16649
16660
  received: Q.parsedType
16650
16661
  }), m;
@@ -16652,21 +16663,21 @@ class Fg extends Z {
16652
16663
  if (Number.isNaN(A.data.getTime())) {
16653
16664
  const Q = this._getOrReturnCtx(A);
16654
16665
  return Y(Q, {
16655
- code: d.invalid_date
16666
+ code: U.invalid_date
16656
16667
  }), m;
16657
16668
  }
16658
16669
  const g = new NA();
16659
16670
  let B;
16660
16671
  for (const Q of this._def.checks)
16661
16672
  Q.kind === "min" ? A.data.getTime() < Q.value && (B = this._getOrReturnCtx(A, B), Y(B, {
16662
- code: d.too_small,
16673
+ code: U.too_small,
16663
16674
  message: Q.message,
16664
16675
  inclusive: !0,
16665
16676
  exact: !1,
16666
16677
  minimum: Q.value,
16667
16678
  type: "date"
16668
16679
  }), g.dirty()) : Q.kind === "max" ? A.data.getTime() > Q.value && (B = this._getOrReturnCtx(A, B), Y(B, {
16669
- code: d.too_big,
16680
+ code: U.too_big,
16670
16681
  message: Q.message,
16671
16682
  inclusive: !0,
16672
16683
  exact: !1,
@@ -16722,7 +16733,7 @@ class BQ extends Z {
16722
16733
  if (this._getType(A) !== u.symbol) {
16723
16734
  const g = this._getOrReturnCtx(A);
16724
16735
  return Y(g, {
16725
- code: d.invalid_type,
16736
+ code: U.invalid_type,
16726
16737
  expected: u.symbol,
16727
16738
  received: g.parsedType
16728
16739
  }), m;
@@ -16739,7 +16750,7 @@ class CQ extends Z {
16739
16750
  if (this._getType(A) !== u.undefined) {
16740
16751
  const g = this._getOrReturnCtx(A);
16741
16752
  return Y(g, {
16742
- code: d.invalid_type,
16753
+ code: U.invalid_type,
16743
16754
  expected: u.undefined,
16744
16755
  received: g.parsedType
16745
16756
  }), m;
@@ -16756,7 +16767,7 @@ class QQ extends Z {
16756
16767
  if (this._getType(A) !== u.null) {
16757
16768
  const g = this._getOrReturnCtx(A);
16758
16769
  return Y(g, {
16759
- code: d.invalid_type,
16770
+ code: U.invalid_type,
16760
16771
  expected: u.null,
16761
16772
  received: g.parsedType
16762
16773
  }), m;
@@ -16796,7 +16807,7 @@ class jA extends Z {
16796
16807
  _parse(A) {
16797
16808
  const I = this._getOrReturnCtx(A);
16798
16809
  return Y(I, {
16799
- code: d.invalid_type,
16810
+ code: U.invalid_type,
16800
16811
  expected: u.never,
16801
16812
  received: I.parsedType
16802
16813
  }), m;
@@ -16811,7 +16822,7 @@ class iQ extends Z {
16811
16822
  if (this._getType(A) !== u.undefined) {
16812
16823
  const g = this._getOrReturnCtx(A);
16813
16824
  return Y(g, {
16814
- code: d.invalid_type,
16825
+ code: U.invalid_type,
16815
16826
  expected: u.void,
16816
16827
  received: g.parsedType
16817
16828
  }), m;
@@ -16828,14 +16839,14 @@ class pA extends Z {
16828
16839
  const { ctx: I, status: g } = this._processInputParams(A), B = this._def;
16829
16840
  if (I.parsedType !== u.array)
16830
16841
  return Y(I, {
16831
- code: d.invalid_type,
16842
+ code: U.invalid_type,
16832
16843
  expected: u.array,
16833
16844
  received: I.parsedType
16834
16845
  }), m;
16835
16846
  if (B.exactLength !== null) {
16836
16847
  const E = I.data.length > B.exactLength.value, i = I.data.length < B.exactLength.value;
16837
16848
  (E || i) && (Y(I, {
16838
- code: E ? d.too_big : d.too_small,
16849
+ code: E ? U.too_big : U.too_small,
16839
16850
  minimum: i ? B.exactLength.value : void 0,
16840
16851
  maximum: E ? B.exactLength.value : void 0,
16841
16852
  type: "array",
@@ -16845,14 +16856,14 @@ class pA extends Z {
16845
16856
  }), g.dirty());
16846
16857
  }
16847
16858
  if (B.minLength !== null && I.data.length < B.minLength.value && (Y(I, {
16848
- code: d.too_small,
16859
+ code: U.too_small,
16849
16860
  minimum: B.minLength.value,
16850
16861
  type: "array",
16851
16862
  inclusive: !0,
16852
16863
  exact: !1,
16853
16864
  message: B.minLength.message
16854
16865
  }), g.dirty()), B.maxLength !== null && I.data.length > B.maxLength.value && (Y(I, {
16855
- code: d.too_big,
16866
+ code: U.too_big,
16856
16867
  maximum: B.maxLength.value,
16857
16868
  type: "array",
16858
16869
  inclusive: !0,
@@ -16926,7 +16937,7 @@ class eA extends Z {
16926
16937
  if (this._getType(A) !== u.object) {
16927
16938
  const s = this._getOrReturnCtx(A);
16928
16939
  return Y(s, {
16929
- code: d.invalid_type,
16940
+ code: U.invalid_type,
16930
16941
  expected: u.object,
16931
16942
  received: s.parsedType
16932
16943
  }), m;
@@ -16954,7 +16965,7 @@ class eA extends Z {
16954
16965
  });
16955
16966
  else if (s === "strict")
16956
16967
  i.length > 0 && (Y(B, {
16957
- code: d.unrecognized_keys,
16968
+ code: U.unrecognized_keys,
16958
16969
  keys: i
16959
16970
  }), g.dirty());
16960
16971
  else if (s !== "strip") throw new Error("Internal ZodObject error: invalid unknownKeys value.");
@@ -17211,7 +17222,7 @@ class Sg extends Z {
17211
17222
  return I.common.issues.push(...i.ctx.common.issues), i.result;
17212
17223
  const E = Q.map((i) => new WA(i.ctx.common.issues));
17213
17224
  return Y(I, {
17214
- code: d.invalid_union,
17225
+ code: U.invalid_union,
17215
17226
  unionErrors: E
17216
17227
  }), m;
17217
17228
  }
@@ -17258,7 +17269,7 @@ class Sg extends Z {
17258
17269
  return I.common.issues.push(...Q.ctx.common.issues), Q.result;
17259
17270
  const i = E.map((o) => new WA(o));
17260
17271
  return Y(I, {
17261
- code: d.invalid_union,
17272
+ code: U.invalid_union,
17262
17273
  unionErrors: i
17263
17274
  }), m;
17264
17275
  }
@@ -17305,7 +17316,7 @@ class Ng extends Z {
17305
17316
  return m;
17306
17317
  const i = rB(Q.value, E.value);
17307
17318
  return i.valid ? ((IQ(Q) || IQ(E)) && I.dirty(), { status: I.value, value: i.data }) : (Y(g, {
17308
- code: d.invalid_intersection_types
17319
+ code: U.invalid_intersection_types
17309
17320
  }), m);
17310
17321
  };
17311
17322
  return g.common.async ? Promise.all([
@@ -17341,20 +17352,20 @@ class QI extends Z {
17341
17352
  const { status: I, ctx: g } = this._processInputParams(A);
17342
17353
  if (g.parsedType !== u.array)
17343
17354
  return Y(g, {
17344
- code: d.invalid_type,
17355
+ code: U.invalid_type,
17345
17356
  expected: u.array,
17346
17357
  received: g.parsedType
17347
17358
  }), m;
17348
17359
  if (g.data.length < this._def.items.length)
17349
17360
  return Y(g, {
17350
- code: d.too_small,
17361
+ code: U.too_small,
17351
17362
  minimum: this._def.items.length,
17352
17363
  inclusive: !0,
17353
17364
  exact: !1,
17354
17365
  type: "array"
17355
17366
  }), m;
17356
17367
  !this._def.rest && g.data.length > this._def.items.length && (Y(g, {
17357
- code: d.too_big,
17368
+ code: U.too_big,
17358
17369
  maximum: this._def.items.length,
17359
17370
  inclusive: !0,
17360
17371
  exact: !1,
@@ -17397,7 +17408,7 @@ class oQ extends Z {
17397
17408
  const { status: I, ctx: g } = this._processInputParams(A);
17398
17409
  if (g.parsedType !== u.map)
17399
17410
  return Y(g, {
17400
- code: d.invalid_type,
17411
+ code: U.invalid_type,
17401
17412
  expected: u.map,
17402
17413
  received: g.parsedType
17403
17414
  }), m;
@@ -17439,20 +17450,20 @@ class TI extends Z {
17439
17450
  const { status: I, ctx: g } = this._processInputParams(A);
17440
17451
  if (g.parsedType !== u.set)
17441
17452
  return Y(g, {
17442
- code: d.invalid_type,
17453
+ code: U.invalid_type,
17443
17454
  expected: u.set,
17444
17455
  received: g.parsedType
17445
17456
  }), m;
17446
17457
  const B = this._def;
17447
17458
  B.minSize !== null && g.data.size < B.minSize.value && (Y(g, {
17448
- code: d.too_small,
17459
+ code: U.too_small,
17449
17460
  minimum: B.minSize.value,
17450
17461
  type: "set",
17451
17462
  inclusive: !0,
17452
17463
  exact: !1,
17453
17464
  message: B.minSize.message
17454
17465
  }), I.dirty()), B.maxSize !== null && g.data.size > B.maxSize.value && (Y(g, {
17455
- code: d.too_big,
17466
+ code: U.too_big,
17456
17467
  maximum: B.maxSize.value,
17457
17468
  type: "set",
17458
17469
  inclusive: !0,
@@ -17518,7 +17529,7 @@ class DB extends Z {
17518
17529
  const I = this._getOrReturnCtx(A);
17519
17530
  return Y(I, {
17520
17531
  received: I.data,
17521
- code: d.invalid_literal,
17532
+ code: U.invalid_literal,
17522
17533
  expected: this._def.value
17523
17534
  }), m;
17524
17535
  }
@@ -17547,14 +17558,14 @@ class yI extends Z {
17547
17558
  return Y(I, {
17548
17559
  expected: O.joinValues(g),
17549
17560
  received: I.parsedType,
17550
- code: d.invalid_type
17561
+ code: U.invalid_type
17551
17562
  }), m;
17552
17563
  }
17553
17564
  if (this._cache || (this._cache = new Set(this._def.values)), !this._cache.has(A.data)) {
17554
17565
  const I = this._getOrReturnCtx(A), g = this._def.values;
17555
17566
  return Y(I, {
17556
17567
  received: I.data,
17557
- code: d.invalid_enum_value,
17568
+ code: U.invalid_enum_value,
17558
17569
  options: g
17559
17570
  }), m;
17560
17571
  }
@@ -17603,14 +17614,14 @@ class tQ extends Z {
17603
17614
  return Y(g, {
17604
17615
  expected: O.joinValues(B),
17605
17616
  received: g.parsedType,
17606
- code: d.invalid_type
17617
+ code: U.invalid_type
17607
17618
  }), m;
17608
17619
  }
17609
17620
  if (this._cache || (this._cache = new Set(O.getValidEnumValues(this._def.values))), !this._cache.has(A.data)) {
17610
17621
  const B = O.objectValues(I);
17611
17622
  return Y(g, {
17612
17623
  received: g.data,
17613
- code: d.invalid_enum_value,
17624
+ code: U.invalid_enum_value,
17614
17625
  options: B
17615
17626
  }), m;
17616
17627
  }
@@ -17633,7 +17644,7 @@ class Rg extends Z {
17633
17644
  const { ctx: I } = this._processInputParams(A);
17634
17645
  if (I.parsedType !== u.promise && I.common.async === !1)
17635
17646
  return Y(I, {
17636
- code: d.invalid_type,
17647
+ code: U.invalid_type,
17637
17648
  expected: u.promise,
17638
17649
  received: I.parsedType
17639
17650
  }), m;
@@ -17835,7 +17846,7 @@ class eQ extends Z {
17835
17846
  if (this._getType(A) !== u.nan) {
17836
17847
  const g = this._getOrReturnCtx(A);
17837
17848
  return Y(g, {
17838
- code: d.invalid_type,
17849
+ code: U.invalid_type,
17839
17850
  expected: u.nan,
17840
17851
  received: g.parsedType
17841
17852
  }), m;
@@ -18364,8 +18375,8 @@ function hE(C, A) {
18364
18375
  const I = { ...C };
18365
18376
  return delete I[A], I;
18366
18377
  }
18367
- async function de(C, A) {
18368
- const I = new ZI(C), g = new UA(I), B = GI(A), Q = await _I(g, B);
18378
+ async function Ue(C, A) {
18379
+ const I = new ZI(C), g = new dA(I), B = GI(A), Q = await _I(g, B);
18369
18380
  try {
18370
18381
  return xt(Q.attrs);
18371
18382
  } catch {
@@ -18424,7 +18435,7 @@ function Wt(C) {
18424
18435
  }
18425
18436
  }
18426
18437
  async function le(C, A, I) {
18427
- const g = C + "/" + A, B = new ZI(g), Q = new UA(B), E = GI(I), i = await _I(Q, E);
18438
+ const g = C + "/" + A, B = new ZI(g), Q = new dA(B), E = GI(I), i = await _I(Q, E);
18428
18439
  try {
18429
18440
  return Wt(i.attrs);
18430
18441
  } catch {
@@ -18518,7 +18529,7 @@ class MI {
18518
18529
  * @param props.version OME-Zarr version
18519
18530
  */
18520
18531
  static async fromHttp(A) {
18521
- const I = new UA(new ZI(A.url)), g = await MI.openLoader(I, A.version);
18532
+ const I = new dA(new ZI(A.url)), g = await MI.openLoader(I, A.version);
18522
18533
  return new MI({ location: I, version: A.version, loader: g });
18523
18534
  }
18524
18535
  /**
@@ -18531,7 +18542,7 @@ class MI {
18531
18542
  * ask the user once for permission to the root directory
18532
18543
  */
18533
18544
  static async fromFileSystem(A) {
18534
- const I = new UA(
18545
+ const I = new dA(
18535
18546
  new XB(A.directory),
18536
18547
  A.path
18537
18548
  ), g = await MI.openLoader(I, A.version);
@@ -18730,7 +18741,7 @@ class _t {
18730
18741
  return this.dirty_ && (this.computeMatrix(), this.dirty_ = !1), this.matrix_;
18731
18742
  }
18732
18743
  get inverse() {
18733
- return Ug(SA(), this.matrix);
18744
+ return dg(SA(), this.matrix);
18734
18745
  }
18735
18746
  computeMatrix() {
18736
18747
  ZE(
@@ -18906,15 +18917,15 @@ class cE extends FI {
18906
18917
  const Q = [], E = [], i = g, o = B, s = i + 1, t = o + 1, e = A / i, n = I / o;
18907
18918
  for (let D = 0; D < t; ++D) {
18908
18919
  const F = D * n;
18909
- for (let U = 0; U < s; ++U) {
18910
- const S = U * e, l = U / i, f = D / o, k = [S, F, 0], R = [0, 0, 1], L = [l, f];
18911
- Q.push(...k, ...R, ...L);
18920
+ for (let k = 0; k < s; ++k) {
18921
+ const S = k * e, l = k / i, f = D / o, d = [S, F, 0], R = [0, 0, 1], L = [l, f];
18922
+ Q.push(...d, ...R, ...L);
18912
18923
  }
18913
18924
  }
18914
18925
  for (let D = 0; D < o; ++D)
18915
18926
  for (let F = 0; F < i; ++F) {
18916
- const U = F + s * D, S = F + s * (D + 1), l = F + 1 + s * (D + 1), f = F + 1 + s * D;
18917
- E.push(U, S, f), E.push(S, l, f);
18927
+ const k = F + s * D, S = F + s * (D + 1), l = F + 1 + s * (D + 1), f = F + 1 + s * D;
18928
+ E.push(k, S, f), E.push(S, l, f);
18918
18929
  }
18919
18930
  this.vertexData_ = new Float32Array(Q), this.indexData_ = new Uint32Array(E), this.addAttribute({
18920
18931
  type: "position",
@@ -19251,10 +19262,10 @@ class Ae extends FI {
19251
19262
  });
19252
19263
  }
19253
19264
  buildFace(A, I, g, B, Q, E, i, o, s, t, e, n, D) {
19254
- const F = E / s, U = i / t, S = E / 2, l = i / 2, f = o / 2 * e, k = s + 1, R = t + 1, L = n.length / 8;
19265
+ const F = E / s, k = i / t, S = E / 2, l = i / 2, f = o / 2 * e, d = s + 1, R = t + 1, L = n.length / 8;
19255
19266
  for (let M = 0; M < R; M++) {
19256
- const W = -l + M * U;
19257
- for (let $ = 0; $ < k; $++) {
19267
+ const W = -l + M * k;
19268
+ for (let $ = 0; $ < d; $++) {
19258
19269
  const BA = -S + $ * F, IA = { x: 0, y: 0, z: 0 };
19259
19270
  IA[A] = BA * B, IA[I] = W * Q, IA[g] = f;
19260
19271
  const iA = { x: 0, y: 0, z: 0 };
@@ -19274,7 +19285,7 @@ class Ae extends FI {
19274
19285
  }
19275
19286
  for (let M = 0; M < t; M++)
19276
19287
  for (let W = 0; W < s; W++) {
19277
- const $ = L + W + k * M, BA = L + W + k * (M + 1), IA = L + (W + 1) + k * (M + 1), iA = L + (W + 1) + k * M;
19288
+ const $ = L + W + d * M, BA = L + W + d * (M + 1), IA = L + (W + 1) + d * (M + 1), iA = L + (W + 1) + d * M;
19278
19289
  D.push($, BA, iA, BA, IA, iA);
19279
19290
  }
19280
19291
  }
@@ -19569,7 +19580,7 @@ function ie(C) {
19569
19580
  `align${C.rowAlignmentBytes}`
19570
19581
  ].join(":");
19571
19582
  }
19572
- class nQ extends UB {
19583
+ class nQ extends dB {
19573
19584
  width_;
19574
19585
  height_;
19575
19586
  constructor(A, I, g) {
@@ -19849,7 +19860,7 @@ class FE extends Yg {
19849
19860
  }
19850
19861
  }
19851
19862
  }
19852
- class re extends UB {
19863
+ class re extends dB {
19853
19864
  width_;
19854
19865
  height_;
19855
19866
  depth_;
@@ -20146,7 +20157,7 @@ class NE extends kI {
20146
20157
  return this.transform.translation;
20147
20158
  }
20148
20159
  clipToWorld(A) {
20149
- const I = Qg(A[0], A[1], A[2], 1), g = Ug(
20160
+ const I = Qg(A[0], A[1], A[2], 1), g = dg(
20150
20161
  SA(),
20151
20162
  this.projectionMatrix_
20152
20163
  ), B = pI(
@@ -20205,7 +20216,7 @@ class Ke extends NE {
20205
20216
  }
20206
20217
  getWorldViewRect() {
20207
20218
  let A = Qg(-1, -1, 0, 1), I = Qg(1, 1, 0, 1);
20208
- const g = Ug(SA(), this.getViewProjection());
20219
+ const g = dg(SA(), this.getViewProjection());
20209
20220
  return A = pI(nI(), A, g), I = pI(nI(), I, g), new GA(
20210
20221
  aA(A[0], A[1]),
20211
20222
  aA(I[0], I[1])
@@ -20436,7 +20447,7 @@ export {
20436
20447
  IC as createImageSourcePolicy,
20437
20448
  xe as createNoPrefetchPolicy,
20438
20449
  me as createPlaybackPolicy,
20439
- de as loadOmeZarrPlate,
20450
+ Ue as loadOmeZarrPlate,
20440
20451
  le as loadOmeZarrWell,
20441
20452
  Le as loadOmeroChannels,
20442
20453
  Je as loadOmeroDefaults