virtua 0.52.5 → 0.52.7

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.
@@ -4,7 +4,7 @@ import { ApplicationRef as t, ChangeDetectionStrategy as i, DestroyRef as s, Ele
4
4
 
5
5
  import { NgTemplateOutlet as v } from "@angular/common";
6
6
 
7
- var w, z = [], {min: $, max: b, abs: N, floor: R} = Math, I = (e, t, i) => $(i, b(t, e)), P = e => e.sort((e, t) => e - t), x = setTimeout, q = clearTimeout, F = "function" == typeof queueMicrotask ? queueMicrotask : e => {
7
+ var w, z = [], {min: N, max: b, abs: $, floor: R} = Math, I = (e, t, i) => N(i, b(t, e)), P = e => e.sort((e, t) => e - t), x = setTimeout, q = clearTimeout, F = "function" == typeof queueMicrotask ? queueMicrotask : e => {
8
8
  Promise.resolve().then(e);
9
9
  }, k = () => {
10
10
  let e;
@@ -28,9 +28,9 @@ w), M = e => b(e.$getTotalSize(), e.$getViewportSize()), _ = ({$getRange: e, $fi
28
28
  if (v) [i, s] = I; else {
29
29
  let r = b(0, k()), n = r + h;
30
30
  p || (t = b(0, t), 1 !== w && (r -= t), 2 !== w && (n += t)), [i, s] = I = e(b(0, r), b(0, n)),
31
- R && (i = $(i, R[0]), s = b(s, R[1]));
31
+ R && (i = N(i, R[0]), s = b(s, R[1]));
32
32
  }
33
- return [ b(i, 0), $(s, l() - 1) ];
33
+ return [ b(i, 0), N(s, l() - 1) ];
34
34
  },
35
35
  $findItemIndex: e => t(e - f),
36
36
  $isUnmeasuredItem: n,
@@ -50,17 +50,17 @@ w), M = e => b(e.$getTotalSize(), e.$getViewportSize()), _ = ({$getRange: e, $fi
50
50
  };
51
51
  },
52
52
  $update: (i, l) => {
53
- let u, $, b = 0;
53
+ let u, N, b = 0;
54
54
  switch (i) {
55
55
  case 1:
56
56
  {
57
57
  if (l === g && 0 === z) break;
58
58
  const e = v;
59
59
  v = 0;
60
- const t = l - g, i = N(t);
61
- e && i < N(e) + 1 || 0 !== z || (w = t < 0 ? 2 : 1), m && (m = !1), g = l, b = 4;
60
+ const t = l - g, i = $(t);
61
+ e && i < $(e) + 1 || 0 !== z || (w = t < 0 ? 2 : 1), m && (m = !1), g = l, b = 4;
62
62
  const s = F();
63
- s >= -h && s <= o() && (b += 1, $ = i > h);
63
+ s >= -h && s <= o() && (b += 1, N = i > h);
64
64
  break;
65
65
  }
66
66
 
@@ -84,12 +84,12 @@ w), M = e => b(e.$getTotalSize(), e.$getViewportSize()), _ = ({$getRange: e, $fi
84
84
  const e = s(t), n = r(t, i);
85
85
  p && (P += n ? i : i - e);
86
86
  }
87
- p && h && P > h && (O(c(t(k()))), p = !1), b = 3, $ = !0;
87
+ p && h && P > h && (O(c(t(k()))), p = !1), b = 3, N = !0;
88
88
  break;
89
89
  }
90
90
 
91
91
  case 4:
92
- h !== l && (h || (x = $ = !0), h = l, b = 3);
92
+ h !== l && (h || (x = N = !0), h = l, b = 3);
93
93
  break;
94
94
 
95
95
  case 5:
@@ -112,24 +112,24 @@ w), M = e => b(e.$getTotalSize(), e.$getViewportSize()), _ = ({$getRange: e, $fi
112
112
  R = e(l, l + h), b = 1;
113
113
  }
114
114
  b && (d = 1 + (2147483647 & d), u && y && (S += y, y = 0), q.forEach(([e, t]) => {
115
- b & e && t($);
115
+ b & e && t(N);
116
116
  }));
117
117
  }
118
118
  };
119
- }, V = (e, t, i, s = 0, r = t - 1) => {
119
+ }, V = (e, t, i) => {
120
+ const s = i ? "unshift" : "push";
121
+ for (let i = 0; i < t; i++) e[s](-1);
122
+ return e;
123
+ }, E = (e, t, i, s = 0, r = t - 1) => {
120
124
  let n = s;
121
125
  for (;s <= r; ) {
122
126
  const t = R((s + r) / 2);
123
127
  e(t) <= i ? (n = t, s = t + 1) : r = t - 1;
124
128
  }
125
129
  return I(n, 0, t - 1);
126
- }, E = (e, t, i) => {
127
- const s = i ? "unshift" : "push";
128
- for (let i = 0; i < t; i++) e[s](-1);
129
- return e;
130
- }, L = (e, t, i) => {
130
+ }, D = (e, t, i) => {
131
131
  let s = i && i[1] || t || 40, r = -1, n = 0;
132
- const o = i && i[0], l = o ? E(o.slice(0, $(e, o.length)), b(0, e - o.length)) : E([], e), a = E([], e + 1), c = e => {
132
+ const o = i && i[0], l = o ? V(o.slice(0, N(e, o.length)), b(0, e - o.length)) : V([], e), a = V([], e + 1), c = e => {
133
133
  const t = l[e];
134
134
  return -1 === t ? s : t;
135
135
  }, u = t => {
@@ -143,22 +143,22 @@ w), M = e => b(e.$getTotalSize(), e.$getViewportSize()), _ = ({$getRange: e, $fi
143
143
  return {
144
144
  $getRange: (t, i) => {
145
145
  let s, r;
146
- return n = $(n, e - 1), u(n) <= t ? (r = V(u, e, i, n), s = V(u, e, t, n, r)) : (s = V(u, e, t, void 0, n),
147
- r = V(u, e, i, s)), n = s, [ s, r ];
146
+ return n = N(n, e - 1), u(n) <= t ? (r = E(u, e, i, n), s = E(u, e, t, n, r)) : (s = E(u, e, t, void 0, n),
147
+ r = E(u, e, i, s)), n = s, [ s, r ];
148
148
  },
149
- $findIndex: t => V(u, e, t),
149
+ $findIndex: t => E(u, e, t),
150
150
  $getItemOffset: u,
151
151
  $getItemSize: c,
152
152
  $setItemSize: (e, t) => {
153
153
  const i = -1 === l[e];
154
- return l[e] = t, r = $(e, r), i;
154
+ return l[e] = t, r = N(e, r), i;
155
155
  },
156
156
  $isSizeEqual: (e, t = -1) => l[e] === t,
157
157
  $getTotalSize: () => u(e),
158
158
  $getLength: () => e,
159
159
  $setLength: (t, i) => {
160
160
  const n = t - e;
161
- return r = i ? -1 : $(t - 1, r), e = t, n > 0 ? (E(a, n), E(l, n, i), s * n) : (a.splice(n),
161
+ return r = i ? -1 : N(t - 1, r), e = t, n > 0 ? (V(a, n), V(l, n, i), s * n) : (a.splice(n),
162
162
  (i ? l.splice(0, -n) : l.splice(n)).reduce((e, t) => e - (-1 === t ? s : t), 0));
163
163
  },
164
164
  $estimateDefaultSize: t ? void 0 : e => {
@@ -172,84 +172,96 @@ w), M = e => b(e.$getTotalSize(), e.$getViewportSize()), _ = ({$getRange: e, $fi
172
172
  },
173
173
  $snapshot: () => [ l.slice(), s ]
174
174
  };
175
- }, D = e => "number" == typeof e ? e : e.length, K = (e, t) => "number" == typeof e ? t : e[t], G = (e, t, i = 0) => {
176
- let s = 0, r = 0;
177
- const n = (e = 0, t = 0) => {
178
- s = e, r = t;
179
- }, o = e => $(s, e), l = e => b(e - r, o(e)), a = (e, t, s, r, n) => {
180
- const a = t(o(s)), c = t(s) - t(l(s)), u = r + (a ? a - i : 0);
181
- return e(u, b(u, n - (c ? c - i : 0)));
182
- };
183
- if ("number" == typeof t) {
184
- let s = D(e), r = t;
185
- const c = e => r + i ? I(R(e / (r + i)), 0, s - 1) : 0, u = e => e * (r + i), p = (e, t) => [ c(e), c(t) ];
186
- return {
187
- $getRange: (e, t) => a(p, u, s, e, t),
188
- $findIndex: c,
189
- $getItemOffset: u,
190
- $getItemSize: () => r,
191
- $setItemSize: () => !1,
192
- $isSizeEqual: () => !1,
193
- $getTotalSize: () => s ? s * (r + i) - i : 0,
194
- $getLength: () => s,
195
- $setLength: e => (s = e, 0),
196
- $isMeasurable: () => !1,
197
- $setPinned: n,
198
- $getPinnedStart: () => o(s),
199
- $getTrailStart: () => l(s),
200
- $setAxis: (e, t, i) => {
201
- if ("number" != typeof t || t === r) return;
202
- const s = c(i) * (t - r);
203
- return r = t, s;
175
+ }, L = e => "number" == typeof e ? e : e.length, K = (e, t) => "number" == typeof e ? t : e[t], G = (e, t, i = 0) => {
176
+ let s = L(e);
177
+ const r = "number" == typeof t, n = "auto" === t;
178
+ let o = (r ? t : 40) + i, l = -1, a = 0, c = 0, u = null;
179
+ const p = [], m = [], d = [], h = e => n || !!d[e], f = () => {
180
+ p.length || V(p, s);
181
+ }, g = e => {
182
+ const t = p[e];
183
+ return -1 === t ? o : t;
184
+ }, S = e => {
185
+ if (!s) return 0;
186
+ if (!p.length) return e * o;
187
+ if (l >= e) return m[e];
188
+ l < 0 && (m[0] = 0, l = 0);
189
+ let t = l, i = m[t];
190
+ for (;t < e; ) i += g(t), m[++t] = i;
191
+ return l = e, i;
192
+ }, y = (e, t) => {
193
+ p[e] = t, l = N(e, l);
194
+ }, v = e => p.length ? E(S, s, e) : o ? I(R(e / o), 0, s - 1) : 0, w = () => N(a, s), z = () => b(s - c, w());
195
+ return {
196
+ $getRange: (e, t) => {
197
+ const r = S(w()), n = S(s) - S(z()), o = e + (r ? r - i : 0);
198
+ return [ v(o), v(b(o, t - (n ? n - i : 0))) ];
199
+ },
200
+ $findIndex: v,
201
+ $getItemOffset: S,
202
+ $getItemSize: e => (p.length ? g(e) : o) - i,
203
+ $setItemSize: (e, t) => {
204
+ if (!h(e)) return !1;
205
+ f();
206
+ const s = -1 === p[e];
207
+ return y(e, t + i), s;
208
+ },
209
+ $isSizeEqual: (e, t) => (p.length ? p[e] : -1) === t + i,
210
+ $getTotalSize: () => s ? S(s) - i : 0,
211
+ $getLength: () => s,
212
+ $setLength: e => {
213
+ const t = e - s;
214
+ return l = N(e - 1, l), s = e, p.length && (t > 0 ? V(p, t) : p.splice(t)), 0;
215
+ },
216
+ $estimateDefaultSize: n ? e => {
217
+ let t = 0;
218
+ const i = [];
219
+ p.forEach((s, r) => {
220
+ -1 !== s && (s && i.push(s), r < e && t++);
221
+ }), l = -1, P(i);
222
+ const s = i.length, r = s / 2 | 0, n = s % 2 == 0 ? (i[r - 1] + i[r]) / 2 : i[r], a = o;
223
+ return ((o = n) - a) * b(e - t, 0);
224
+ } : void 0,
225
+ $isMeasurable: h,
226
+ $setPinned: (e = 0, t = 0) => {
227
+ a = e, c = t;
228
+ },
229
+ $getPinnedStart: w,
230
+ $getTrailStart: z,
231
+ $getSizes: (e, t) => "number" == typeof t ? r ? t : null : r || n || "auto" === t ? null : e.map(e => null != e ? e[t] : null),
232
+ $setAxis: (e, t) => {
233
+ if (null == e) return;
234
+ if ("number" == typeof e) {
235
+ const s = e + i;
236
+ if (s === o) return;
237
+ const r = v(t) * (s - o);
238
+ return o = s, r;
204
239
  }
205
- };
206
- }
207
- const c = "auto" === t;
208
- let u, p = t;
209
- const m = D(e), d = [], h = L(m, void 0, [ [], 40 + i ]), f = e => c || !!d[e], g = {
210
- $getRange: (e, t) => a(h.$getRange, h.$getItemOffset, h.$getLength(), e, t),
211
- $findIndex: h.$findIndex,
212
- $getItemOffset: h.$getItemOffset,
213
- $getItemSize: e => h.$getItemSize(e) - i,
214
- $setItemSize: (e, t) => f(e) && h.$setItemSize(e, t + i),
215
- $isSizeEqual: (e, t) => h.$isSizeEqual(e, t + i),
216
- $getTotalSize: () => h.$getLength() ? h.$getTotalSize() - i : 0,
217
- $getLength: h.$getLength,
218
- $setLength: h.$setLength,
219
- $estimateDefaultSize: c ? h.$estimateDefaultSize : void 0,
220
- $isMeasurable: f,
221
- $setPinned: n,
222
- $getPinnedStart: () => o(h.$getLength()),
223
- $getTrailStart: () => l(h.$getLength()),
224
- $setAxis: (e, t, s, r) => {
225
- if (c) return;
226
- const n = "number" == typeof t || "auto" === t ? p : t, o = h.$getLength();
227
- if (!r && e === u && n === p && o === d.length) return;
228
- u = e, p = n, d.length = o;
229
- const l = h.$findIndex(s), a = h.$getItemOffset(l);
230
- let m;
231
- for (let t = 0; t < o; t++) {
232
- const s = e[t], r = null !== s && "object" == typeof s ? s[n] : null, o = "number" != typeof r;
233
- if (!o || !d[t]) {
234
- d[t] = o;
235
- const e = o ? -1 : r + i;
236
- h.$isSizeEqual(t, e) || (h.$setItemSize(t, e), m = !0);
240
+ if (e === u && s === d.length) return;
241
+ u = e, d.length = s, f();
242
+ const r = v(t), n = S(r);
243
+ let l;
244
+ for (let t = 0; t < s; t++) {
245
+ const s = e[t], r = "number" != typeof s;
246
+ if (!r || !d[t]) {
247
+ d[t] = r;
248
+ const e = r ? -1 : s + i;
249
+ p[t] !== e && (y(t, e), l = !0);
237
250
  }
238
251
  }
239
- return m ? h.$getItemOffset(l) - a : void 0;
252
+ return l ? S(r) - n : void 0;
240
253
  }
241
254
  };
242
- return g.$setAxis(e, t, 0), g;
243
- }, W = (e, t, i, s, r, n, o) => {
244
- const l = D(i);
245
- t.$setPinned(r, n), l !== e.$getItemsLength() && e.$update(5, [ l ]);
246
- const a = t.$setAxis(i, s, e.$getScrollOffset() - e.$getItemOffset(0), o);
247
- null != a && e.$update(9, a);
248
- }, H = /*#__PURE__*/ new WeakMap, A = (e, t, i, s, r, n) => e < i || b(e, s) < $(t, r + 1) || n < t, B = (e, t, i) => {
255
+ }, W = (e, t, i, s, r, n) => {
256
+ const o = L(i);
257
+ t.$setPinned(r, n), o !== e.$getItemsLength() && e.$update(5, [ o ]);
258
+ const l = t.$setAxis(s, e.$getScrollOffset() - e.$getItemOffset(0));
259
+ null != l && e.$update(9, l);
260
+ }, H = /*#__PURE__*/ new WeakMap, B = (e, t, i) => {
249
261
  const s = [];
250
262
  for (const r of e) r >= t && r < i && s.push(r);
251
263
  return P(s);
252
- }, j = (e, t, i) => {
264
+ }, A = (e, t, i) => {
253
265
  if (t >= i) return -1;
254
266
  let s = 0, r = e.length;
255
267
  for (;s < r; ) {
@@ -257,22 +269,22 @@ w), M = e => b(e.$getTotalSize(), e.$getViewportSize()), _ = ({$getRange: e, $fi
257
269
  e[i] <= t ? s = i + 1 : r = i;
258
270
  }
259
271
  return s - 1;
260
- }, J = (e, t, i, s, r) => {
272
+ }, j = (e, t, i, s, r) => {
261
273
  const n = t.length;
262
274
  for (;i < n && t[i] < s; i++) {
263
275
  const s = t[i];
264
276
  s > r && (e.push(s), r = s);
265
277
  }
266
278
  return i;
267
- }, Q = (e, t, i, s, r, n) => {
279
+ }, J = (e, t, i, s, r, n) => {
268
280
  const o = [];
269
281
  for (let e = 0; e < i; e++) o.push(e);
270
- const l = J(o, e, 0, s, i - 1);
282
+ const l = j(o, e, 0, s, i - 1);
271
283
  for (let e = s; e <= r; e++) o.push(e);
272
- J(o, e, l, n, r);
284
+ j(o, e, l, n, r);
273
285
  for (let e = n; e < t; e++) o.push(e);
274
286
  return o;
275
- }, X = (e, t) => $(e.rowIndex + (e.rowSpan || 1), t), Y = (e, t) => $(e.colIndex + (e.colSpan || 1), t), U = (e, t, i, s, r, n) => {
287
+ }, Q = (e, t) => N(e.rowIndex + (e.rowSpan || 1), t), X = (e, t) => N(e.colIndex + (e.colSpan || 1), t), Y = (e, t, i, s, r, n) => {
276
288
  const o = t.length, l = s.length;
277
289
  let a = "[l0]", c = 0, u = 0, p = 0;
278
290
  for (;c < n; ) {
@@ -284,11 +296,11 @@ w), M = e => b(e.$getTotalSize(), e.$getViewportSize()), _ = ({$getRange: e, $fi
284
296
  const t = i[u];
285
297
  h = null == t ? e.$getItemSize(c) + "px" : t ? r : "minmax(" + e.$getItemSize(c) + "px,auto)",
286
298
  u++;
287
- } else d = $(m, p < l ? s[p] : n), h = "minmax(" + (e.$getItemOffset(d - 1) + e.$getItemSize(d - 1) - e.$getItemOffset(c)) + "px,auto)";
299
+ } else d = N(m, p < l ? s[p] : n), h = "minmax(" + (e.$getItemOffset(d - 1) + e.$getItemSize(d - 1) - e.$getItemOffset(c)) + "px,auto)";
288
300
  a += " " + h + " [l" + d + "]", c = d;
289
301
  }
290
302
  return a;
291
- }, Z = (e, t, i, s, r) => {
303
+ }, U = (e, t, i, s, r) => {
292
304
  const n = {
293
305
  display: "grid",
294
306
  gridTemplateRows: "subgrid",
@@ -297,7 +309,7 @@ w), M = e => b(e.$getTotalSize(), e.$getViewportSize()), _ = ({$getRange: e, $fi
297
309
  gridRow: "l" + e + "/l" + t
298
310
  };
299
311
  return null != i && (n.position = "sticky", n[s] = i + "px", n.zIndex = r), n;
300
- }, ee = e => {
312
+ }, Z = e => {
301
313
  let t;
302
314
  return {
303
315
  i(i) {
@@ -310,7 +322,7 @@ w), M = e => b(e.$getTotalSize(), e.$getViewportSize()), _ = ({$getRange: e, $fi
310
322
  t && t.disconnect();
311
323
  }
312
324
  };
313
- }, te = (e, t, i, s, r, n, o) => {
325
+ }, ee = (e, t, i, s, r, n, o) => {
314
326
  let l, a, c = 0, u = !1, p = !1, m = !1, d = !1;
315
327
  const h = Date.now, f = s ? "scrollLeft" : "scrollTop", g = s ? "left" : "top", S = e => r ? -e : e, y = () => S(i[f]), v = (e, t) => {
316
328
  i.scrollTo({
@@ -322,26 +334,26 @@ w), M = e => b(e.$getTotalSize(), e.$getViewportSize()), _ = ({$getRange: e, $fi
322
334
  m = !1, e.$update(2);
323
335
  }, z = () => {
324
336
  q(a), a = x(w, 150);
325
- }, $ = () => {
337
+ }, N = () => {
326
338
  c = h(), m && (d = !0), o && e.$update(6, o()), e.$update(1, y()), z();
327
339
  }, b = t => {
328
340
  if (u || !e.$isScrolling() || t.ctrlKey) return;
329
341
  const i = h() - c;
330
342
  150 > i && 50 < i && (s ? t.deltaX : t.deltaY) && (u = !0);
331
- }, N = () => {
343
+ }, $ = () => {
332
344
  p = !0, m = d = !1;
333
345
  }, R = () => {
334
346
  p = !1, T() && (m = !0);
335
347
  };
336
- return t.addEventListener("scroll", $), t.addEventListener("wheel", b, {
348
+ return t.addEventListener("scroll", N), t.addEventListener("wheel", b, {
337
349
  passive: !0
338
- }), t.addEventListener("touchstart", N, {
350
+ }), t.addEventListener("touchstart", $, {
339
351
  passive: !0
340
352
  }), t.addEventListener("touchend", R, {
341
353
  passive: !0
342
354
  }), {
343
355
  l: () => {
344
- t.removeEventListener("scroll", $), t.removeEventListener("wheel", b), t.removeEventListener("touchstart", N),
356
+ t.removeEventListener("scroll", N), t.removeEventListener("wheel", b), t.removeEventListener("touchstart", $),
345
357
  t.removeEventListener("touchend", R), q(a);
346
358
  },
347
359
  u: () => {
@@ -379,9 +391,9 @@ w), M = e => b(e.$getTotalSize(), e.$getViewportSize()), _ = ({$getRange: e, $fi
379
391
  i ? (e.$update(8, t()), F(c)) : c();
380
392
  }
381
393
  };
382
- }, ie = (e, t) => {
394
+ }, te = (e, t) => {
383
395
  e.$scroll(() => t);
384
- }, se = (e, t, i, {align: s, smooth: r, offset: n = 0} = {}) => {
396
+ }, ie = (e, t, i, {align: s, smooth: r, offset: n = 0} = {}) => {
385
397
  if (i = I(i, 0, t.$getItemsLength() - 1), "nearest" === s) {
386
398
  const e = t.$getItemOffset(i), r = t.$getScrollOffset();
387
399
  if (e < r) s = "start"; else {
@@ -390,17 +402,17 @@ w), M = e => b(e.$getTotalSize(), e.$getViewportSize()), _ = ({$getRange: e, $fi
390
402
  }
391
403
  }
392
404
  e.$scroll(() => n + e.$getBaseOffset() + t.$getItemOffset(i) + ("end" === s ? t.$getItemSize(i) - t.$getViewportSize() : "center" === s ? (t.$getItemSize(i) - t.$getViewportSize()) / 2 : 0), r);
393
- }, re = (e, t, i, s, r, n, o) => {
405
+ }, se = (e, t, i, s, r, n, o) => {
394
406
  const l = t.$getItemsLength(), a = i.$getPinnedStart(), c = i.$getTrailStart();
395
407
  r = I(r, 0, l - 1);
396
- const u = B(s, a, c), p = j(u, r, c), m = p < 0 ? -1 : u[p], d = () => i.$getItemOffset(a) + (m < 0 || m === r ? 0 : i.$getItemOffset(m + 1) - i.$getItemOffset(m)), h = () => i.$getItemOffset(l) - i.$getItemOffset(c);
408
+ const u = B(s, a, c), p = A(u, r, c), m = p < 0 ? -1 : u[p], d = () => i.$getItemOffset(a) + (m < 0 || m === r ? 0 : i.$getItemOffset(m + 1) - i.$getItemOffset(m)), h = () => i.$getItemOffset(l) - i.$getItemOffset(c);
397
409
  if ("nearest" === n) {
398
410
  if (r < a || r >= c) return;
399
411
  const e = d(), i = t.$getScrollOffset() + e, s = t.$getViewportSize() - e - h(), o = t.$getItemSize(r);
400
412
  let l = t.$getItemOffset(r);
401
413
  if (m === r) {
402
414
  const e = (p + 1 < u.length ? u[p + 1] : c) - 1;
403
- l = b(l, $(i, t.$getItemOffset(e) + t.$getItemSize(e) - o));
415
+ l = b(l, N(i, t.$getItemOffset(e) + t.$getItemSize(e) - o));
404
416
  }
405
417
  if (l < i) n = "start"; else {
406
418
  if (!(l + o > i + s)) return;
@@ -411,7 +423,7 @@ w), M = e => b(e.$getTotalSize(), e.$getViewportSize()), _ = ({$getRange: e, $fi
411
423
  const e = d(), i = t.$getItemSize(r) - (t.$getViewportSize() - e - h());
412
424
  return t.$getItemOffset(r) - e + ("end" === n ? i : "center" === n ? i / 2 : 0);
413
425
  });
414
- }, ne = class t {
426
+ }, re = class t {
415
427
  index=h.required();
416
428
  offset=h.required();
417
429
  hide=h.required();
@@ -523,9 +535,9 @@ w), M = e => b(e.$getTotalSize(), e.$getViewportSize()), _ = ({$getRange: e, $fi
523
535
  },
524
536
  ngImport: e
525
537
  });
526
- }, oe = (e, t) => "_" + t, le = /*#__PURE__*/ new o("virtua-item-template"), ae = class i {
538
+ }, ne = (e, t) => "_" + t, oe = /*#__PURE__*/ new o("virtua-item-template"), le = class i {
527
539
  data=h.required();
528
- getKey=h(oe);
540
+ getKey=h(ne);
529
541
  itemProps=h();
530
542
  bufferSize=h();
531
543
  scrollRef=h();
@@ -541,7 +553,7 @@ w), M = e => b(e.$getTotalSize(), e.$getViewportSize()), _ = ({$getRange: e, $fi
541
553
  scrolled=f();
542
554
  scrollEnded=f();
543
555
  contentTemplate=p(l);
544
- m=d(le, {
556
+ m=d(oe, {
545
557
  optional: !0
546
558
  });
547
559
  template=u(() => this.m?.() ?? this.contentTemplate());
@@ -549,11 +561,11 @@ w), M = e => b(e.$getTotalSize(), e.$getViewportSize()), _ = ({$getRange: e, $fi
549
561
  S;
550
562
  driver;
551
563
  v=d(r).nativeElement;
552
- $=d(t);
553
- N=g(void 0);
564
+ N=d(t);
565
+ $=g(void 0);
554
566
  isSSR=g(!1);
555
567
  R=u(() => {
556
- this.N();
568
+ this.$();
557
569
  const e = this.data().length, [t, i] = this.h.$getRange(this.bufferSize()), s = this.keepMounted(), r = [];
558
570
  if (s) {
559
571
  const n = new Set(s);
@@ -563,7 +575,7 @@ w), M = e => b(e.$getTotalSize(), e.$getViewportSize()), _ = ({$getRange: e, $fi
563
575
  return r;
564
576
  });
565
577
  items=u(() => {
566
- this.N();
578
+ this.$();
567
579
  const e = this.h, t = this.data(), i = this.getKey(), s = this.itemProps();
568
580
  return this.R().map(r => {
569
581
  const n = t[r];
@@ -581,7 +593,7 @@ w), M = e => b(e.$getTotalSize(), e.$getViewportSize()), _ = ({$getRange: e, $fi
581
593
  });
582
594
  });
583
595
  containerStyle=u(() => {
584
- this.N();
596
+ this.$();
585
597
  const e = this.horizontal(), t = this.h.$getTotalSize();
586
598
  return {
587
599
  display: "block",
@@ -607,7 +619,7 @@ w), M = e => b(e.$getTotalSize(), e.$getViewportSize()), _ = ({$getRange: e, $fi
607
619
  }
608
620
  }), c({
609
621
  read: () => {
610
- this.N(), this.driver.$effect();
622
+ this.$(), this.driver.$effect();
611
623
  }
612
624
  }), d(s).onDestroy(() => {
613
625
  this.h?.$dispose(), this.driver?.$dispose();
@@ -616,10 +628,10 @@ w), M = e => b(e.$getTotalSize(), e.$getViewportSize()), _ = ({$getRange: e, $fi
616
628
  ngOnInit() {
617
629
  const e = this.itemSize(), t = this.ssrCount();
618
630
  this.isSSR.set(!!t);
619
- const i = this.S = L(this.data().length, e, this.cacheProp()), s = this.h = _(i, t);
631
+ const i = this.S = D(this.data().length, e, this.cacheProp()), s = this.h = _(i, t);
620
632
  this.driver = ((e, t) => {
621
633
  let i, s, r = k();
622
- const n = /* @__PURE__ */ new WeakMap, o = ee(s => {
634
+ const n = /* @__PURE__ */ new WeakMap, o = Z(s => {
623
635
  const r = [];
624
636
  for (const {target: o, contentRect: {width: l, height: a}} of s) if (o === i) (l || a) && e.$update(4, t ? l : a); else if (o.offsetParent) {
625
637
  const e = n.get(o);
@@ -629,7 +641,7 @@ w), M = e => b(e.$getTotalSize(), e.$getViewportSize()), _ = ({$getRange: e, $fi
629
641
  });
630
642
  return {
631
643
  $observe(n, l = n.parentElement) {
632
- o.i(i = l), s = te(e, l, l, t, t && "rtl" === getComputedStyle(l).direction, () => {
644
+ o.i(i = l), s = ee(e, l, l, t, t && "rtl" === getComputedStyle(l).direction, () => {
633
645
  const e = t ? "overflowX" : "overflowY", i = l.style, s = i[e];
634
646
  i[e] = "hidden", x(() => {
635
647
  i[e] = s;
@@ -651,12 +663,12 @@ w), M = e => b(e.$getTotalSize(), e.$getViewportSize()), _ = ({$getRange: e, $fi
651
663
  $getBaseOffset: e.$getStartSpacerSize
652
664
  };
653
665
  })(s, this.horizontal()), s.$subscribe(1, e => {
654
- this.N.set(s.$getStateVersion()), e && this.$.tick();
666
+ this.$.set(s.$getStateVersion()), e && this.N.tick();
655
667
  }), s.$subscribe(4, () => {
656
668
  this.scrolled.emit(s.$getScrollOffset());
657
669
  }), s.$subscribe(8, () => {
658
670
  this.scrollEnded.emit();
659
- }), this.N.set(s.$getStateVersion());
671
+ }), this.$.set(s.$getStateVersion());
660
672
  }
661
673
  get cache() {
662
674
  return this.S.$snapshot();
@@ -680,14 +692,14 @@ w), M = e => b(e.$getTotalSize(), e.$getViewportSize()), _ = ({$getRange: e, $fi
680
692
  return this.h.$getItemSize(e);
681
693
  }
682
694
  scrollToIndex(e, t) {
683
- se(this.driver, this.h, e, t);
695
+ ie(this.driver, this.h, e, t);
684
696
  }
685
697
  scrollTo(e) {
686
- ie(this.driver, e);
698
+ te(this.driver, e);
687
699
  }
688
700
  scrollBy(e) {
689
701
  ((e, t, i) => {
690
- ie(e, i + t.$getScrollOffset());
702
+ te(e, i + t.$getScrollOffset());
691
703
  })(this.driver, this.h, e);
692
704
  }
693
705
  static ɵfac=/*@__PURE__*/ e.ɵɵngDeclareFactory({
@@ -812,7 +824,7 @@ w), M = e => b(e.$getTotalSize(), e.$getViewportSize()), _ = ({$getRange: e, $fi
812
824
  isInline: !0,
813
825
  dependencies: [ {
814
826
  kind: "directive",
815
- type: e.forwardRef(() => ne),
827
+ type: e.forwardRef(() => re),
816
828
  selector: "div[virtuaListItem]",
817
829
  inputs: [ "index", "offset", "hide", "horizontal", "isSSR", "resizer", "attrs" ]
818
830
  }, {
@@ -827,9 +839,9 @@ w), M = e => b(e.$getTotalSize(), e.$getViewportSize()), _ = ({$getRange: e, $fi
827
839
 
828
840
  i.OnPush;
829
841
 
830
- var ce = class t {
842
+ var ae = class t {
831
843
  data=h.required();
832
- getKey=h(oe);
844
+ getKey=h(ne);
833
845
  itemProps=h();
834
846
  bufferSize=h();
835
847
  itemSize=h();
@@ -843,7 +855,7 @@ var ce = class t {
843
855
  scrolled=f();
844
856
  scrollEnded=f();
845
857
  template=p.required(l);
846
- virtualizer=y.required(ae);
858
+ virtualizer=y.required(le);
847
859
  v=d(r).nativeElement;
848
860
  ngOnInit() {
849
861
  const e = this.horizontal(), t = this.v;
@@ -980,7 +992,7 @@ var ce = class t {
980
992
  viewQueries: [ {
981
993
  propertyName: "virtualizer",
982
994
  first: !0,
983
- predicate: ae,
995
+ predicate: le,
984
996
  emitDistinctChangesOnly: !1,
985
997
  descendants: !0,
986
998
  isSignal: !0
@@ -990,13 +1002,13 @@ var ce = class t {
990
1002
  isInline: !0,
991
1003
  dependencies: [ {
992
1004
  kind: "directive",
993
- type: e.forwardRef(() => ae),
1005
+ type: e.forwardRef(() => le),
994
1006
  selector: "virtua-virtualizer",
995
1007
  inputs: [ "data", "getKey", "itemProps", "bufferSize", "scrollRef", "itemSize", "ssrCount", "shift", "horizontal", "keepMounted", "cache", "startMargin" ],
996
1008
  outputs: [ "scrolled", "scrollEnded" ]
997
1009
  } ],
998
1010
  viewProviders: [ {
999
- provide: le,
1011
+ provide: oe,
1000
1012
  useFactory: () => d(t).template
1001
1013
  } ],
1002
1014
  changeDetection: e.ChangeDetectionStrategy.OnPush
@@ -1005,9 +1017,9 @@ var ce = class t {
1005
1017
 
1006
1018
  i.OnPush;
1007
1019
 
1008
- var ue = class i {
1020
+ var ce = class i {
1009
1021
  data=h.required();
1010
- getKey=h(oe);
1022
+ getKey=h(ne);
1011
1023
  bufferSize=h();
1012
1024
  itemSize=h();
1013
1025
  ssrCount=h();
@@ -1023,11 +1035,11 @@ var ue = class i {
1023
1035
  S;
1024
1036
  driver;
1025
1037
  v=d(r).nativeElement;
1026
- $=d(t);
1027
- N=g(void 0);
1038
+ N=d(t);
1039
+ $=g(void 0);
1028
1040
  isSSR=g(!1);
1029
1041
  items=u(() => {
1030
- this.N();
1042
+ this.$();
1031
1043
  const e = this.h, t = this.data(), i = this.getKey(), [s, r] = e.$getRange(this.bufferSize()), n = [];
1032
1044
  for (let o = s; o <= r; o++) {
1033
1045
  const s = t[o];
@@ -1042,7 +1054,7 @@ var ue = class i {
1042
1054
  return n;
1043
1055
  });
1044
1056
  containerStyle=u(() => {
1045
- this.N();
1057
+ this.$();
1046
1058
  const e = this.horizontal(), t = this.h.$getTotalSize();
1047
1059
  return {
1048
1060
  display: "block",
@@ -1065,7 +1077,7 @@ var ue = class i {
1065
1077
  }
1066
1078
  }), c({
1067
1079
  read: () => {
1068
- this.N(), this.driver.$effect();
1080
+ this.$(), this.driver.$effect();
1069
1081
  }
1070
1082
  }), d(s).onDestroy(() => {
1071
1083
  this.h?.$dispose(), this.driver?.$dispose();
@@ -1074,10 +1086,10 @@ var ue = class i {
1074
1086
  ngOnInit() {
1075
1087
  const e = this.itemSize(), t = this.ssrCount();
1076
1088
  this.isSSR.set(!!t);
1077
- const i = this.S = L(this.data().length, e, this.cacheProp()), s = this.h = _(i, t);
1089
+ const i = this.S = D(this.data().length, e, this.cacheProp()), s = this.h = _(i, t);
1078
1090
  this.driver = ((e, t) => {
1079
1091
  let i, s, r, n, o, l = k();
1080
- const a = /* @__PURE__ */ new WeakMap, c = ee(s => {
1092
+ const a = /* @__PURE__ */ new WeakMap, c = Z(s => {
1081
1093
  const r = [];
1082
1094
  for (const {target: e, contentRect: {width: n, height: l}} of s) if (e === i) o && o(); else if (e.offsetParent) {
1083
1095
  const i = a.get(e);
@@ -1095,7 +1107,7 @@ var ue = class i {
1095
1107
  };
1096
1108
  p.addEventListener("resize", g), c.i(m), r = () => {
1097
1109
  p.removeEventListener("resize", g);
1098
- }, s = te(e, p, m, t, d, null, f), l[1](!0);
1110
+ }, s = ee(e, p, m, t, d, null, f), l[1](!0);
1099
1111
  },
1100
1112
  $dispose() {
1101
1113
  r && r(), c.l(), s && s.l(), l[1](!1), l = k();
@@ -1112,12 +1124,12 @@ var ue = class i {
1112
1124
  $getBaseOffset: () => n()
1113
1125
  };
1114
1126
  })(s, this.horizontal()), s.$subscribe(1, e => {
1115
- this.N.set(s.$getStateVersion()), e && this.$.tick();
1127
+ this.$.set(s.$getStateVersion()), e && this.N.tick();
1116
1128
  }), s.$subscribe(4, () => {
1117
1129
  this.scrolled.emit();
1118
1130
  }), s.$subscribe(8, () => {
1119
1131
  this.scrollEnded.emit();
1120
- }), this.N.set(s.$getStateVersion());
1132
+ }), this.$.set(s.$getStateVersion());
1121
1133
  }
1122
1134
  get cache() {
1123
1135
  return this.S.$snapshot();
@@ -1138,7 +1150,7 @@ var ue = class i {
1138
1150
  return this.h.$getItemSize(e);
1139
1151
  }
1140
1152
  scrollToIndex(e, t) {
1141
- se(this.driver, this.h, e, t);
1153
+ ie(this.driver, this.h, e, t);
1142
1154
  }
1143
1155
  static ɵfac=/*@__PURE__*/ e.ɵɵngDeclareFactory({
1144
1156
  minVersion: "12.0.0",
@@ -1234,7 +1246,7 @@ var ue = class i {
1234
1246
  isInline: !0,
1235
1247
  dependencies: [ {
1236
1248
  kind: "directive",
1237
- type: e.forwardRef(() => ne),
1249
+ type: e.forwardRef(() => re),
1238
1250
  selector: "div[virtuaListItem]",
1239
1251
  inputs: [ "index", "offset", "hide", "horizontal", "isSSR", "resizer", "attrs" ]
1240
1252
  }, {
@@ -1249,7 +1261,7 @@ var ue = class i {
1249
1261
 
1250
1262
  i.OnPush;
1251
1263
 
1252
- var pe = class t {
1264
+ var ue = class t {
1253
1265
  state=h.required();
1254
1266
  resizer=h.required();
1255
1267
  constructor() {
@@ -1306,7 +1318,7 @@ var pe = class t {
1306
1318
  },
1307
1319
  ngImport: e
1308
1320
  });
1309
- }, me = class t {
1321
+ }, pe = class t {
1310
1322
  state=h.required();
1311
1323
  template=h.required();
1312
1324
  row=h.required();
@@ -1380,7 +1392,7 @@ var pe = class t {
1380
1392
  isInline: !0,
1381
1393
  dependencies: [ {
1382
1394
  kind: "directive",
1383
- type: e.forwardRef(() => pe),
1395
+ type: e.forwardRef(() => ue),
1384
1396
  selector: "div[virtuaGridCell]",
1385
1397
  inputs: [ "state", "resizer" ]
1386
1398
  }, {
@@ -1391,7 +1403,7 @@ var pe = class t {
1391
1403
  } ],
1392
1404
  changeDetection: e.ChangeDetectionStrategy.OnPush
1393
1405
  });
1394
- }, de = class t {
1406
+ }, me = class t {
1395
1407
  state=h.required();
1396
1408
  template=h.required();
1397
1409
  rows=h.required();
@@ -1464,13 +1476,13 @@ var pe = class t {
1464
1476
  isInline: !0,
1465
1477
  dependencies: [ {
1466
1478
  kind: "directive",
1467
- type: e.forwardRef(() => me),
1479
+ type: e.forwardRef(() => pe),
1468
1480
  selector: "div[virtuaGridRow]",
1469
1481
  inputs: [ "state", "template", "row", "cols", "resizer" ]
1470
1482
  } ],
1471
1483
  changeDetection: e.ChangeDetectionStrategy.OnPush
1472
1484
  });
1473
- }, he = class i {
1485
+ }, de = class i {
1474
1486
  rows=h.required();
1475
1487
  cols=h.required();
1476
1488
  rowHeight=h.required();
@@ -1496,128 +1508,144 @@ var pe = class t {
1496
1508
  F;
1497
1509
  driver;
1498
1510
  v=d(r).nativeElement;
1499
- $=d(t);
1500
- N=g(void 0);
1511
+ N=d(t);
1512
+ $=g(void 0);
1501
1513
  ariaRowCount=d(new n("aria-rowcount"), {
1502
1514
  optional: !0
1503
1515
  });
1504
1516
  ariaColCount=d(new n("aria-colcount"), {
1505
1517
  optional: !0
1506
1518
  });
1507
- rowCount=u(() => this.N() && this.I.$getItemsLength());
1508
- colCount=u(() => this.N() && this.P.$getItemsLength());
1509
- plan=u(() => (this.N(), ((e, t, i, s, r = z, n = z, o = z, l) => {
1510
- const a = e.$getLength(), c = t.$getLength(), u = e.$getPinnedStart(), p = e.$getTrailStart(), m = t.$getPinnedStart(), d = t.$getTrailStart(), h = I(i[0], u, p), f = $(i[1], p - 1), g = I(s[0], m, d), S = $(s[1], d - 1), y = B(r, u, p), v = b(m - 1, 0), w = [], N = [], R = [];
1511
- for (const e of o) e.rowIndex < a && e.colIndex < c && R.push(e);
1512
- const x = R.length, q = y.length, F = j(y, h, p), k = F < 0 ? -1 : y[F];
1513
- k >= 0 && w.push(k);
1514
- for (const e of n) {
1515
- const t = e.rowIndex, i = e.colIndex, s = X(e, a), r = Y(e, c);
1516
- if (t < a && i < c && (s - t > 1 || r - i > 1)) {
1517
- let n = (A(t, s, u, h, f, p) || k >= t && k < s) && A(i, r, m, g, S, d);
1518
- for (let e = 0; !n && e < x; e++) {
1519
- const {rowIndex: o, colIndex: l} = R[e];
1520
- n = o >= t && o < s && l >= i && l < r;
1519
+ rowCount=u(() => this.$() && this.I.$getItemsLength());
1520
+ colCount=u(() => this.$() && this.P.$getItemsLength());
1521
+ k=u(() => this.q.$getSizes(this.rows(), this.rowHeight()));
1522
+ C=u(() => this.F.$getSizes(this.cols(), this.colWidth()));
1523
+ O=u(() => ((e = z) => {
1524
+ const t = /* @__PURE__ */ new Map;
1525
+ for (const i of e) {
1526
+ const e = i.rowIndex + (i.rowSpan || 1);
1527
+ for (let s = i.rowIndex; s < e; s++) {
1528
+ const e = t.get(s);
1529
+ e ? e.push(i) : t.set(s, [ i ]);
1530
+ }
1531
+ }
1532
+ return t;
1533
+ })(this.spans()));
1534
+ plan=u(() => (this.$(), ((e, t, [i, s], [r, n], o, l = z, a = z, c) => {
1535
+ const u = e.$getLength(), p = t.$getLength(), m = e.$getPinnedStart(), d = e.$getTrailStart(), h = t.$getPinnedStart(), f = t.$getTrailStart();
1536
+ i = I(i, m, d), s = N(s, d - 1), r = I(r, h, f), n = N(n, f - 1);
1537
+ const g = B(l, m, d), S = b(h - 1, 0), y = [], v = [], w = [];
1538
+ for (const e of a) e.rowIndex < u && e.colIndex < p && (w.push(e), y.push(e.rowIndex));
1539
+ const $ = w.length, R = A(g, i, d), x = R < 0 ? -1 : g[R];
1540
+ x >= 0 && y.push(x);
1541
+ const q = J(P(y), u, m, i, s, d);
1542
+ for (let e = 0; e < q.length; e++) for (const t of o.get(q[e]) || z) {
1543
+ const {rowIndex: o, colIndex: l} = t, a = Q(t, u), c = X(t, p);
1544
+ if ((e < 1 || q[e - 1] < o) && l < p && (a - o > 1 || c - l > 1)) {
1545
+ let e = (o < m || b(o, i) < N(a, s + 1) || d < a || x >= o && x < a) && (l < h || b(l, r) < N(c, n + 1) || f < c);
1546
+ for (let t = 0; !e && t < $; t++) {
1547
+ const i = w[t];
1548
+ e = i.rowIndex >= o && i.rowIndex < a && i.colIndex >= l && i.colIndex < c;
1521
1549
  }
1522
- n && R.push(e);
1550
+ e && w.push(t);
1523
1551
  }
1524
1552
  }
1525
- for (const {rowIndex: e, colIndex: t} of R) {
1526
- const i = j(y, e, p);
1527
- w.push(e), i >= 0 && w.push(y[i]), N.push(t);
1553
+ for (const {rowIndex: e, colIndex: t} of w) {
1554
+ const i = A(g, e, d);
1555
+ y.push(e), i >= 0 && y.push(g[i]), v.push(t);
1528
1556
  }
1529
- P(w), P(N);
1530
- const C = Q(w, a, u, h, f, p), O = Q(N, c, m, g, S, d), T = C.length, M = O.length, _ = /* @__PURE__ */ new Map, V = [], E = [];
1531
- for (const e of R) {
1532
- const t = X(e, a), i = Y(e, c);
1533
- V.push(t), E.push(i);
1534
- const s = O.indexOf(e.colIndex);
1535
- for (let r = C.indexOf(e.rowIndex); r < T && C[r] < t; r++) {
1536
- const t = C[r] * c;
1537
- for (let r = s; r < M && O[r] < i; r++) _.set(t + O[r], e);
1557
+ P(y), P(v);
1558
+ const F = J(y, u, m, i, s, d), k = J(v, p, h, r, n, f), C = F.length, O = k.length, T = /* @__PURE__ */ new Map, M = [], _ = [];
1559
+ for (const e of w) {
1560
+ const t = Q(e, u), i = X(e, p);
1561
+ M.push(t), _.push(i);
1562
+ const s = k.indexOf(e.colIndex);
1563
+ for (let r = F.indexOf(e.rowIndex); r < C && F[r] < t; r++) {
1564
+ const t = F[r] * p;
1565
+ for (let r = s; r < O && k[r] < i; r++) T.set(t + k[r], e);
1538
1566
  }
1539
1567
  }
1540
- const L = [];
1541
- for (const e of O) L.push(!t.$isMeasurable(e) && null);
1542
- const D = [], K = e.$getItemOffset(u), G = [];
1543
- let W = G;
1544
- const J = H.get(e), ee = /* @__PURE__ */ new Map;
1545
- for (const i of C) {
1546
- const s = i < u, r = i >= p, n = j(y, i, p), o = s ? 0 : r ? p : n < 0 ? -1 : y[n];
1547
- if (i === o) {
1548
- const e = s ? u : r ? a : n + 1 < q ? y[n + 1] : p;
1549
- V.push(e);
1568
+ const V = [];
1569
+ for (const e of k) V.push(!t.$isMeasurable(e) && null);
1570
+ const E = [], D = e.$getItemOffset(m), L = [];
1571
+ let K = L;
1572
+ const G = H.get(e), W = /* @__PURE__ */ new Map;
1573
+ for (const o of F) {
1574
+ const l = o < m, a = o >= d, y = A(g, o, d), v = l ? 0 : a ? d : y < 0 ? -1 : g[y];
1575
+ if (o === v) {
1576
+ const e = l ? m : a ? u : y + 1 < g.length ? g[y + 1] : d;
1577
+ M.push(e);
1550
1578
  const t = [];
1551
- G.push({
1552
- $key: s ? -1 : r ? -2 : -3 - o,
1579
+ L.push({
1580
+ $key: l ? -1 : a ? -2 : -3 - v,
1553
1581
  $rows: t,
1554
- $style: Z(o, e, s || r ? 0 : null, r ? "bottom" : "top", 4)
1555
- }), W = t;
1556
- } else o < 0 && (W = G);
1557
- const w = n >= 0 && i === o, z = s || r || i === k || i >= h && i <= f, $ = w ? K : null, N = i * c, R = J && J.get(i), I = R && R.$cells, P = [];
1558
- let x = 0, F = !e.$isMeasurable(i) && null, C = i + 1, T = !1;
1559
- for (let e = 0; e < M; e++) {
1560
- const r = O[e], n = r < m, o = r >= d, u = n || o || r >= g && r <= S, p = _.get(N + r);
1561
- if (p ? p.rowIndex === i && p.colIndex === r : z && u) {
1562
- const u = p ? X(p, a) : i + 1, m = p ? Y(p, c) : r + 1, d = u - i, h = m - r, f = d > 1, g = h > 1, S = f || g;
1563
- let y, z;
1564
- C = b(C, u);
1565
- const $ = n ? t.$getItemOffset(r) : null, N = o ? t.$getTotalSize() - t.$getItemOffset(m - 1) - t.$getItemSize(m - 1) : null;
1566
- !1 !== F || f || (y = i, F = !0), !1 !== L[e] || g || (z = r, L[e] = !0);
1567
- const R = s ? "columnheader" : r === v && (n || w) ? "rowheader" : "cell", q = S ? d : void 0, k = S ? h : void 0, O = "cell" !== R && l && l.rowIndex === i && l.colIndex === r ? l.order : void 0;
1568
- let M;
1582
+ $style: U(v, e, l || a ? 0 : null, a ? "bottom" : "top", 4)
1583
+ }), K = t;
1584
+ } else v < 0 && (K = L);
1585
+ const w = y >= 0 && o === v, z = l || a || o === x || o >= i && o <= s, N = w ? D : null, $ = o * p, R = G && G.get(o), I = R && R.$cells, P = [];
1586
+ let q = 0, F = !e.$isMeasurable(o) && null, C = o + 1, _ = !1;
1587
+ for (let e = 0; e < O; e++) {
1588
+ const i = k[e], s = i < h, a = i >= f, m = s || a || i >= r && i <= n, d = T.get($ + i);
1589
+ if (d ? d.rowIndex === o && d.colIndex === i : z && m) {
1590
+ const r = d ? Q(d, u) : o + 1, n = d ? X(d, p) : i + 1, m = r - o, h = n - i, f = m > 1, g = h > 1, y = f || g;
1591
+ let v, z;
1592
+ C = b(C, r);
1593
+ const N = s ? t.$getItemOffset(i) : null, $ = a ? t.$getItemOffset(p) - t.$getItemOffset(n) : null;
1594
+ !1 !== F || f || (v = o, F = !0), !1 !== V[e] || g || (z = i, V[e] = !0);
1595
+ const R = l ? "columnheader" : i === S && (s || w) ? "rowheader" : "cell", x = y ? m : void 0, k = y ? h : void 0, O = "cell" !== R && c && c.rowIndex === o && c.colIndex === i ? c.order : void 0;
1596
+ let T;
1569
1597
  if (I) {
1570
1598
  const e = I.length;
1571
- for (;x < e && I[x].$col < r; ) x++;
1572
- x < e && I[x].$col === r && (M = I[x]);
1599
+ for (;q < e && I[q].$col < i; ) q++;
1600
+ q < e && I[q].$col === i && (T = I[q]);
1573
1601
  }
1574
- if (!M || M.$rowSpan !== q || M.$colSpan !== k || M.$start !== $ || M.$end !== N || M.$measureRow !== y || M.$measureCol !== z || M.$role !== R || M.$sort !== O) {
1575
- let e = "1/l" + r;
1576
- S && (e += "/l" + u + "/l" + m);
1602
+ if (!T || T.$rowSpan !== x || T.$colSpan !== k || T.$start !== N || T.$end !== $ || T.$measureRow !== v || T.$measureCol !== z || T.$role !== R || T.$sort !== O) {
1603
+ let e = "1/l" + i;
1604
+ y && (e += "/l" + r + "/l" + n);
1577
1605
  const t = {
1578
1606
  contain: "layout style",
1579
1607
  display: "grid",
1580
1608
  gridArea: e
1581
1609
  };
1582
1610
  f && (t.height = "0px", t.minHeight = "100%", t.zIndex = 1), g && (t.width = "0px",
1583
- t.minWidth = "100%"), (n || o) && (t[n ? "insetInlineStart" : "insetInlineEnd"] = (n ? $ : N) + "px",
1584
- t.position = "sticky", t.zIndex = 2), M = {
1585
- $col: r,
1586
- $rowSpan: q,
1611
+ t.minWidth = "100%"), (s || a) && (t[s ? "insetInlineStart" : "insetInlineEnd"] = (s ? N : $) + "px",
1612
+ t.position = "sticky", t.zIndex = 2), T = {
1613
+ $col: i,
1614
+ $rowSpan: x,
1587
1615
  $colSpan: k,
1588
- $measureRow: y,
1616
+ $measureRow: v,
1589
1617
  $measureCol: z,
1590
1618
  $role: R,
1591
1619
  $sort: O,
1592
1620
  $style: t,
1593
- $start: $,
1594
- $end: N
1595
- }, T = !0;
1621
+ $start: N,
1622
+ $end: $
1623
+ }, _ = !0;
1596
1624
  }
1597
- P.push(M);
1625
+ P.push(T);
1598
1626
  }
1599
1627
  }
1600
- if (D.push(F), P.length) {
1601
- const e = R && !T && R.$cells.length === P.length && R.$top === $ ? R : {
1602
- $row: i,
1628
+ if (E.push(F), P.length) {
1629
+ const e = R && !_ && R.$cells.length === P.length && R.$top === N ? R : {
1630
+ $row: o,
1603
1631
  $cells: P,
1604
- $style: Z(i, C, $, "top", 3),
1605
- $top: $
1632
+ $style: U(o, C, N, "top", 3),
1633
+ $top: N
1606
1634
  };
1607
- ee.set(i, e), W.push(e);
1635
+ W.set(o, e), K.push(e);
1608
1636
  }
1609
1637
  }
1610
- return H.set(e, ee), {
1611
- $rowTemplate: U(e, C, D, P(V), "max-content", a),
1612
- $colTemplate: U(t, O, L, P(E), "minmax(max-content,auto)", c),
1613
- $groups: G
1638
+ return H.set(e, W), {
1639
+ $rowTemplate: Y(e, F, E, P(M), "max-content", u),
1640
+ $colTemplate: Y(t, k, V, P(_), "minmax(max-content,auto)", p),
1641
+ $groups: L
1614
1642
  };
1615
- })(this.q, this.F, this.I.$getRange(this.bufferSize()), this.P.$getRange(this.bufferSize()), this.sectionRows(), this.spans(), this.keepMounted(), this.ariaSort())));
1643
+ })(this.q, this.F, this.I.$getRange(this.bufferSize()), this.P.$getRange(this.bufferSize()), this.O(), this.sectionRows(), this.keepMounted(), this.ariaSort())));
1616
1644
  rowItem(e) {
1617
1645
  return K(this.rows(), e);
1618
1646
  }
1619
1647
  containerStyle=u(() => {
1620
- this.N();
1648
+ this.$();
1621
1649
  const {$rowTemplate: e, $colTemplate: t} = this.plan(), i = this.I.$getItemOffset(0), s = this.P.$getItemOffset(0);
1622
1650
  return {
1623
1651
  contain: "size style",
@@ -1635,9 +1663,11 @@ var pe = class t {
1635
1663
  });
1636
1664
  constructor() {
1637
1665
  m(() => {
1638
- const e = this.rows(), t = this.cols(), i = this.rowHeight(), s = this.colWidth(), r = this.headerRows(), n = this.footerRows(), o = this.headerCols(), l = this.footerCols();
1639
- this.I && S(() => {
1640
- W(this.I, this.q, e, i, r, n), W(this.P, this.F, t, s, o, l);
1666
+ const e = this.rows(), t = this.cols(), i = this.headerRows(), s = this.footerRows(), r = this.headerCols(), n = this.footerCols();
1667
+ if (!this.I) return;
1668
+ const o = this.k(), l = this.C();
1669
+ S(() => {
1670
+ W(this.I, this.q, e, o, i, s), W(this.P, this.F, t, l, r, n);
1641
1671
  });
1642
1672
  }), a({
1643
1673
  read: () => {
@@ -1645,7 +1675,7 @@ var pe = class t {
1645
1675
  }
1646
1676
  }), c({
1647
1677
  read: () => {
1648
- this.N(), this.driver.$effect();
1678
+ this.$(), this.driver.$effect();
1649
1679
  }
1650
1680
  }), d(s).onDestroy(() => {
1651
1681
  this.I?.$dispose(), this.P?.$dispose(), this.driver?.$dispose();
@@ -1657,7 +1687,7 @@ var pe = class t {
1657
1687
  const t = this.gap(), i = this.q = G(this.rows(), this.rowHeight(), t), s = this.F = G(this.cols(), this.colWidth(), t), r = this.I = _(i), n = this.P = _(s);
1658
1688
  this.driver = ((e, t) => {
1659
1689
  let i, s, r, n = k();
1660
- const o = /* @__PURE__ */ new WeakMap, l = /* @__PURE__ */ new WeakMap, a = ee(s => {
1690
+ const o = /* @__PURE__ */ new WeakMap, l = /* @__PURE__ */ new WeakMap, a = Z(s => {
1661
1691
  const r = [], n = [];
1662
1692
  for (const {target: a, contentRect: {width: c, height: u}} of s) if (a === i) (c || u) && (e.$update(4, u),
1663
1693
  t.$update(4, c)); else if (a.offsetParent) {
@@ -1673,7 +1703,7 @@ var pe = class t {
1673
1703
  $observe(o) {
1674
1704
  const l = i = o.parentElement;
1675
1705
  a.i(l);
1676
- const c = (e, t) => te(e, l, l, t, t && "rtl" === getComputedStyle(l).direction, () => {
1706
+ const c = (e, t) => ee(e, l, l, t, t && "rtl" === getComputedStyle(l).direction, () => {
1677
1707
  const e = t ? "overflowX" : "overflowY", i = l.style, s = i[e];
1678
1708
  i[e] = "hidden", x(() => {
1679
1709
  i[e] = s;
@@ -1694,7 +1724,7 @@ var pe = class t {
1694
1724
  };
1695
1725
  })(r, n);
1696
1726
  const o = e => {
1697
- this.N.set(r.$getStateVersion() + n.$getStateVersion()), e && this.$.tick();
1727
+ this.$.set(r.$getStateVersion() + n.$getStateVersion()), e && this.N.tick();
1698
1728
  };
1699
1729
  r.$subscribe(1, o), n.$subscribe(1, o);
1700
1730
  let l = !1;
@@ -1746,7 +1776,7 @@ var pe = class t {
1746
1776
  }
1747
1777
  scrollToIndex(e) {
1748
1778
  ((e, t, i, s, r, n = z, {rowIndex: o, colIndex: l, rowAlign: a, colAlign: c}) => {
1749
- null != o && re(e, t, s, n, o, a, !1), null != l && re(e, i, r, z, l, c, !0);
1779
+ null != o && se(e, t, s, n, o, a, !1), null != l && se(e, i, r, z, l, c, !0);
1750
1780
  })(this.driver, this.I, this.P, this.q, this.F, this.sectionRows(), e);
1751
1781
  }
1752
1782
  scrollTo({vertical: e, horizontal: t}) {
@@ -1915,12 +1945,12 @@ var pe = class t {
1915
1945
  isInline: !0,
1916
1946
  dependencies: [ {
1917
1947
  kind: "directive",
1918
- type: e.forwardRef(() => de),
1948
+ type: e.forwardRef(() => me),
1919
1949
  selector: "div[virtuaGridRowGroup]",
1920
1950
  inputs: [ "state", "template", "rows", "cols", "resizer" ]
1921
1951
  }, {
1922
1952
  kind: "directive",
1923
- type: e.forwardRef(() => me),
1953
+ type: e.forwardRef(() => pe),
1924
1954
  selector: "div[virtuaGridRow]",
1925
1955
  inputs: [ "state", "template", "row", "cols", "resizer" ]
1926
1956
  } ],
@@ -1930,5 +1960,5 @@ var pe = class t {
1930
1960
 
1931
1961
  i.OnPush, i.OnPush, i.OnPush;
1932
1962
 
1933
- export { he as VGrid, ce as VList, ae as Virtualizer, ue as WindowVirtualizer };
1963
+ export { de as VGrid, ae as VList, le as Virtualizer, ce as WindowVirtualizer };
1934
1964
  //# sourceMappingURL=index.js.map