virtua 0.53.2 → 0.53.4

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.
Files changed (49) hide show
  1. package/README.md +37 -32
  2. package/lib/angular/VGrid.d.ts +1 -1
  3. package/lib/angular/VList.d.ts +1 -1
  4. package/lib/angular/VMasonry.d.ts +1 -1
  5. package/lib/angular/Virtualizer.d.ts +1 -1
  6. package/lib/angular/WindowVirtualizer.d.ts +1 -1
  7. package/lib/angular/index.js +586 -586
  8. package/lib/angular/index.js.map +1 -1
  9. package/lib/core/index.cjs +405 -404
  10. package/lib/core/index.cjs.map +1 -1
  11. package/lib/core/index.d.ts +1 -1
  12. package/lib/core/index.js +416 -415
  13. package/lib/core/index.js.map +1 -1
  14. package/lib/index.cjs +645 -645
  15. package/lib/index.cjs.map +1 -1
  16. package/lib/index.js +639 -639
  17. package/lib/index.js.map +1 -1
  18. package/lib/react/VGrid.d.ts +1 -1
  19. package/lib/react/VMasonry.d.ts +1 -1
  20. package/lib/react/Virtualizer.d.ts +1 -1
  21. package/lib/react/WindowVirtualizer.d.ts +1 -1
  22. package/lib/solid/VGrid.d.ts +1 -1
  23. package/lib/solid/VMasonry.d.ts +1 -1
  24. package/lib/solid/Virtualizer.d.ts +1 -1
  25. package/lib/solid/WindowVirtualizer.d.ts +1 -1
  26. package/lib/solid/index.cjs +672 -671
  27. package/lib/solid/index.cjs.map +1 -1
  28. package/lib/solid/index.js +671 -671
  29. package/lib/solid/index.js.map +1 -1
  30. package/lib/solid/index.jsx +165 -214
  31. package/lib/solid/index.jsx.map +1 -1
  32. package/lib/svelte/VGrid.svelte +15 -20
  33. package/lib/svelte/VGrid.type.d.ts +1 -1
  34. package/lib/svelte/VMasonry.svelte +10 -13
  35. package/lib/svelte/VMasonry.type.d.ts +1 -1
  36. package/lib/svelte/Virtualizer.svelte +8 -8
  37. package/lib/svelte/Virtualizer.type.d.ts +1 -1
  38. package/lib/svelte/WindowVirtualizer.svelte +5 -7
  39. package/lib/svelte/WindowVirtualizer.type.d.ts +1 -1
  40. package/lib/vue/VGrid.d.ts +1 -1
  41. package/lib/vue/VMasonry.d.ts +1 -1
  42. package/lib/vue/Virtualizer.d.ts +1 -1
  43. package/lib/vue/WindowVirtualizer.d.ts +1 -1
  44. package/lib/vue/index.cjs +800 -797
  45. package/lib/vue/index.cjs.map +1 -1
  46. package/lib/vue/index.js +771 -768
  47. package/lib/vue/index.js.map +1 -1
  48. package/package.json +1 -1
  49. package/lib/core/observer.d.ts +0 -1
@@ -1,10 +1,10 @@
1
1
  import * as e from "@angular/core";
2
2
 
3
- import { ApplicationRef as t, ChangeDetectionStrategy as i, DestroyRef as s, ElementRef as r, HostAttributeToken as n, InjectionToken as o, TemplateRef as l, afterNextRender as a, afterRenderEffect as c, computed as u, contentChild as p, effect as m, inject as d, input as h, output as f, signal as g, untracked as S, viewChild as y } from "@angular/core";
3
+ import { ApplicationRef as t, ChangeDetectionStrategy as i, DestroyRef as s, ElementRef as n, HostAttributeToken as r, InjectionToken as o, TemplateRef as l, afterNextRender as a, afterRenderEffect as c, computed as u, contentChild as p, effect as m, inject as d, input as h, output as f, signal as g, untracked as S, viewChild as y } from "@angular/core";
4
4
 
5
5
  import { NgTemplateOutlet as v } from "@angular/common";
6
6
 
7
- var z, N = [], {min: w, max: b, abs: $, floor: R} = Math, P = (e, t, i) => w(i, b(t, e)), I = e => e.sort((e, t) => e - t), x = setTimeout, q = clearTimeout, F = "function" == typeof queueMicrotask ? queueMicrotask : e => {
7
+ var z, N = [], {min: w, max: b, abs: $, floor: R} = Math, I = (e, t, i) => w(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;
@@ -12,167 +12,177 @@ var z, N = [], {min: w, max: b, abs: $, floor: R} = Math, P = (e, t, i) => w(i,
12
12
  e = t;
13
13
  }), e ];
14
14
  }, O = e => e.ownerDocument, C = e => e.defaultView, T = () => (null == z && (z = /iP(hone|od|ad)/.test(navigator.userAgent) || "MacIntel" === navigator.platform && navigator.maxTouchPoints > 0),
15
- z), M = e => b(e.$getTotalSize(), e.$getViewportSize()), _ = ({$getRange: e, $getItemOffset: t, $getItemSize: i, $isSizeEqual: s, $getTotalSize: r, $getLength: n, $setLength: o, $isEstimating: l, $resize: a}, c = 0) => {
15
+ z), M = e => b(e.$getTotalSize(), e.$getViewportSize()), _ = (e, t, i, s) => {
16
+ const n = e.t(), r = t.$getItemOffset(n);
17
+ t.$relayout(i, s) && e.$update(6, t.$getItemOffset(n) - r);
18
+ }, V = ({$getRange: e, $findIndex: t, $getItemOffset: i, $getItemSize: s, $setItemSizes: n, $getTotalSize: r, $getLength: o, $setLength: l, $isEstimating: a}, c = 0) => {
16
19
  let u = !!c, p = 1, m = 0, d = 0, h = 0, f = 0, g = 0, S = 0, y = 0, v = 0, z = null, N = [ 0, u ? b(c - 1, 0) : -1 ], R = !1;
17
- const P = /* @__PURE__ */ new Set, I = () => h - d, x = () => I() + g + f, q = e => t(e) - g, F = e => {
18
- if (2 === v) return !0;
19
- if (z && 1 === v) return e < z[0];
20
- const t = I(), s = q(e), r = i(e);
21
- return 1 !== y && 0 === v ? s + r <= t : s < t && s + r < t + m;
22
- }, k = e => {
20
+ const I = /* @__PURE__ */ new Set, P = () => h - d, x = () => P() + g + f, q = (e, t) => {
21
+ const n = i(e), r = s(e);
22
+ return 1 !== y && 0 === v ? n + r <= t : n < t && n + r < t + m;
23
+ }, F = e => {
23
24
  e && (T() && 0 !== y || z && 1 === v ? g += e : f += e);
25
+ }, k = () => {
26
+ const e = o();
27
+ if (2 === v) return e;
28
+ if (z && 1 === v) return w(z[0], e);
29
+ const i = x();
30
+ let s = t(i);
31
+ for (;s > 0 && !q(s - 1, i); ) s--;
32
+ for (;s < e && q(s, i); ) s++;
33
+ return s;
24
34
  };
25
35
  return {
26
36
  $dispose: () => {
27
- P.clear();
37
+ I.clear();
28
38
  },
29
39
  $getStateVersion: () => p,
30
40
  $getRange: (t = 200) => {
31
41
  if (!R || u) return N;
32
42
  let i, s;
33
43
  if (S) [i, s] = N; else {
34
- let r = b(0, x()), n = r + m;
35
- l() || (t = b(0, t), 1 !== y && (r -= t), 2 !== y && (n += t)), [i, s] = N = e(b(0, r), b(0, n)),
44
+ let n = b(0, x()), r = n + m;
45
+ a() || (t = b(0, t), 1 !== y && (n -= t), 2 !== y && (r += t)), [i, s] = N = e(b(0, n), b(0, r)),
36
46
  z && (i = w(i, z[0]), s = b(s, z[1]));
37
47
  }
38
- return [ b(i, 0), w(s, n() - 1) ];
48
+ return [ b(i, 0), w(s, o() - 1) ];
39
49
  },
40
- $isUnmeasuredItem: s,
41
- $getItemOffset: q,
42
- $getItemSize: i,
43
- $getItemsLength: n,
50
+ t: k,
51
+ $getItemOffset: e => i(e) - g,
44
52
  $getScrollOffset: () => h,
45
- $getVisibleOffset: x,
46
53
  $isScrolling: () => 0 !== y,
47
54
  $getViewportSize: () => m,
48
55
  $getStartSpacerSize: () => d,
49
56
  $getTotalSize: r,
50
- t: () => (S = f, f = 0, [ S, 2 === v ]),
57
+ i: () => (S = f, f = 0, [ S, 2 === v ]),
51
58
  $subscribe: (e, t) => {
52
59
  const i = [ e, t ];
53
- return P.add(i), () => {
54
- P.delete(i);
60
+ return I.add(i), () => {
61
+ I.delete(i);
55
62
  };
56
63
  },
57
- $update: (t, i) => {
58
- let n, l, c = 0;
64
+ $update: (t, s, a) => {
65
+ let c, N, w = 0;
59
66
  switch (t) {
60
67
  case 1:
61
68
  {
62
- if (i === h && 0 === v) break;
69
+ if (s === h && 0 === v) break;
63
70
  const e = S;
64
71
  S = 0;
65
- const t = i - h, s = $(t);
66
- e && s < $(e) + 1 || 0 !== v || (y = t < 0 ? 2 : 1), u && (u = !1), h = i, c = 4;
67
- const n = I();
68
- n >= -m && n <= r() && (c += 1, l = s > m);
72
+ const t = s - h, i = $(t);
73
+ e && i < $(e) + 1 || 0 !== v || (y = t < 0 ? 2 : 1), u && (u = !1), h = s, w = 4;
74
+ const n = P();
75
+ n >= -m && n <= r() && (w += 1, N = i > m);
69
76
  break;
70
77
  }
71
78
 
72
79
  case 2:
73
- c = 8, 0 !== y && (n = !0, c += 1), y = 0, v = 0, z = null;
80
+ w = 8, 0 !== y && (c = !0, w += 1), y = 0, v = 0, z = null;
74
81
  break;
75
82
 
76
83
  case 3:
77
- {
78
- const e = i.filter(([e, t]) => !s(e, t));
79
- if (!e.length) break;
80
- k(a(e, F, x(), m)), c = 3, l = !0;
81
- break;
84
+ if (s.length) {
85
+ const e = k(), t = i(e);
86
+ n(s, m), F(i(e) - t), w = 3, N = !0;
82
87
  }
88
+ break;
83
89
 
84
90
  case 4:
85
- m !== i && (m || (R = l = !0), m = i, c = 3);
91
+ m !== s && (m || (R = N = !0), m = s, w = 3);
86
92
  break;
87
93
 
88
94
  case 5:
89
- i[1] ? (k(o(i[0], !0)), v = 2, c = 1) : (o(i[0]), c = 1);
95
+ if (s !== o()) {
96
+ if (a) {
97
+ const e = r();
98
+ l(s, !0), F(r() - e), v = 2;
99
+ } else l(s);
100
+ w = 1;
101
+ }
90
102
  break;
91
103
 
92
104
  case 6:
93
- d = i;
105
+ F(s), w = 1;
94
106
  break;
95
107
 
96
108
  case 7:
97
- v = 1;
109
+ d = s;
98
110
  break;
99
111
 
100
- case 9:
101
- null != i && (k(i), c = 3);
112
+ case 8:
113
+ v = 1;
102
114
  break;
103
115
 
104
- case 8:
105
- z = e(i, i + m), c = 1;
116
+ case 9:
117
+ z = e(s, s + m), w = 1;
106
118
  }
107
- c && (p = 1 + (2147483647 & p), n && g && (f += g, g = 0), P.forEach(([e, t]) => {
108
- c & e && t(l);
119
+ w && (p = 1 + (2147483647 & p), c && g && (f += g, g = 0), I.forEach(([e, t]) => {
120
+ w & e && t(N);
109
121
  }));
110
122
  }
111
123
  };
112
- }, V = (e, t, i) => {
124
+ }, E = (e, t, i) => {
113
125
  const s = i ? "unshift" : "push";
114
126
  for (let i = 0; i < t; i++) e[s](-1);
115
127
  return e;
116
- }, E = (e, t, i, s = 0, r = t - 1) => {
117
- let n = s;
118
- for (;s <= r; ) {
119
- const t = R((s + r) / 2);
120
- e(t) <= i ? (n = t, s = t + 1) : r = t - 1;
128
+ }, K = (e, t, i, s = 0, n = t - 1) => {
129
+ let r = s;
130
+ for (;s <= n; ) {
131
+ const t = R((s + n) / 2);
132
+ e(t) <= i ? (r = t, s = t + 1) : n = t - 1;
121
133
  }
122
- return P(n, 0, t - 1);
134
+ return I(r, 0, t - 1);
123
135
  }, L = (e, t, i) => {
124
- let s = i && i[1] || t || 40, r = -1, n = 0, o = !t, l = 0;
125
- const a = i && i[0], c = a ? V(a.slice(0, w(e, a.length)), b(0, e - a.length)) : V([], e), u = V([], e + 1), p = e => {
126
- const t = c[e];
136
+ let s = i && i[1] || t || 40, n = -1, r = 0, o = !t, l = 0;
137
+ const a = i ? i[0].slice(0, e) : [];
138
+ E(a, e - a.length);
139
+ const c = E([], e + 1), u = e => {
140
+ const t = a[e];
127
141
  return -1 === t ? s : t;
128
- }, m = t => {
142
+ }, p = t => {
129
143
  if (!e) return 0;
130
- if (r >= t) return u[t];
131
- r < 0 && (u[0] = 0, r = 0);
132
- let i = r, s = u[i];
133
- for (;i < t; ) s += p(i), u[++i] = s;
134
- return r = t, s;
144
+ if (n >= t) return c[t];
145
+ n < 0 && (c[0] = 0, n = 0);
146
+ let i = n, s = c[i];
147
+ for (;i < t; ) s += u(i), c[++i] = s;
148
+ return n = t, s;
135
149
  };
136
150
  return {
137
151
  $getRange: (t, i) => {
138
- let s, r;
139
- return l = w(l, e - 1), m(l) <= t ? (r = E(m, e, i, l), s = E(m, e, t, l, r)) : (s = E(m, e, t, void 0, l),
140
- r = E(m, e, i, s)), l = s, [ s, r ];
152
+ let s, n;
153
+ return l = w(l, e - 1), p(l) <= t ? (n = K(p, e, i, l), s = K(p, e, t, l, n)) : (s = K(p, e, t, void 0, l),
154
+ n = K(p, e, i, s)), l = s, [ s, n ];
141
155
  },
142
- $findIndex: t => E(m, e, t),
143
- $getItemOffset: m,
144
- $getItemSize: p,
145
- $isSizeEqual: (e, t = -1) => c[e] === t,
146
- $resize: (t, i, l, a) => {
147
- let u = t.reduce((e, [t, s]) => i(t) ? e + (s - p(t)) : e, 0);
148
- for (const [e, i] of t) n += -1 === c[e] ? i : i - p(e), c[e] = i, r = w(e, r);
149
- if (o && a && n > a) {
150
- let t = 0;
151
- const i = E(m, e, l + u), n = [];
152
- c.forEach((e, s) => {
153
- -1 !== e && (e && n.push(e), s < i && t++);
154
- }), r = -1, I(n);
155
- const a = n.length, p = a / 2 | 0, d = a % 2 == 0 ? (n[p - 1] + n[p]) / 2 : n[p], h = s;
156
- u += ((s = d) - h) * b(i - t, 0), o = !1;
156
+ $findIndex: t => K(p, e, t),
157
+ $getItemOffset: p,
158
+ $getItemSize: u,
159
+ $isSizeEqual: (e, t = -1) => a[e] === t,
160
+ $setItemSizes: (e, t) => {
161
+ for (const [t, i] of e) r += -1 === a[t] ? i : i - u(t), a[t] = i, n = w(t, n);
162
+ if (o && t && r > t) {
163
+ const e = [];
164
+ a.forEach(t => {
165
+ -1 !== t && t && e.push(t);
166
+ }), n = -1, P(e);
167
+ const t = e.length, i = t / 2 | 0;
168
+ s = t % 2 == 0 ? (e[i - 1] + e[i]) / 2 : e[i], o = !1;
157
169
  }
158
- return u;
159
170
  },
160
- $getTotalSize: () => m(e),
171
+ $getTotalSize: () => p(e),
161
172
  $getLength: () => e,
162
173
  $setLength: (t, i) => {
163
- const n = t - e;
164
- return r = i ? -1 : w(t - 1, r), e = t, n > 0 ? (V(u, n), V(c, n, i), s * n) : (u.splice(n),
165
- (i ? c.splice(0, -n) : c.splice(n)).reduce((e, t) => e - (-1 === t ? s : t), 0));
174
+ const s = t - e;
175
+ n = i ? -1 : w(t - 1, n), e = t, s > 0 ? (E(c, s), E(a, s, i)) : (c.splice(s), i ? a.splice(0, -s) : a.splice(s));
166
176
  },
167
177
  $isEstimating: () => o,
168
- $snapshot: () => [ c.slice(), s ]
178
+ $snapshot: () => [ a.slice(), s ]
169
179
  };
170
- }, K = e => "number" == typeof e ? e : e.length, D = (e, t) => "number" == typeof e ? t : e[t], G = (e, t, i = 0) => {
171
- let s = K(e);
172
- const r = "number" == typeof t, n = "auto" === t;
173
- let o = (r ? t : 40) + i, l = -1, a = 0, c = n, u = 0, p = 0, m = null;
174
- const d = [], h = [], f = [], g = e => n || !!f[e], S = () => {
175
- d.length || V(d, s);
180
+ }, D = e => "number" == typeof e ? e : e.length, G = (e, t) => "number" == typeof e ? t : e[t], W = (e, t, i = 0) => {
181
+ let s = D(e);
182
+ const n = "number" == typeof t, r = "auto" === t;
183
+ let o = (n ? t : 40) + i, l = -1, a = 0, c = r, u = 0, p = 0, m = null;
184
+ const d = [], h = [], f = [], g = e => r || !!f[e], S = () => {
185
+ d.length || E(d, s);
176
186
  }, y = e => {
177
187
  const t = d[e];
178
188
  return -1 === t ? o : t;
@@ -186,28 +196,25 @@ z), M = e => b(e.$getTotalSize(), e.$getViewportSize()), _ = ({$getRange: e, $ge
186
196
  return l = e, i;
187
197
  }, z = (e, t) => {
188
198
  d[e] = t, l = w(e, l);
189
- }, N = e => d.length ? E(v, s, e) : o ? P(R(e / o), 0, s - 1) : 0, $ = () => w(u, s), x = () => b(s - p, $()), q = e => (d.length ? y(e) : o) - i;
199
+ }, N = e => d.length ? K(v, s, e) : o ? I(R(e / o), 0, s - 1) : 0, $ = () => w(u, s), x = () => b(s - p, $()), q = e => (d.length ? y(e) : o) - i;
190
200
  return {
191
201
  $getRange: (e, t) => {
192
- const r = v($()), n = v(s) - v(x()), o = e + (r ? r - i : 0);
193
- return [ N(o), N(b(o, t - (n ? n - i : 0))) ];
202
+ const n = v($()), r = v(s) - v(x()), o = e + (n ? n - i : 0);
203
+ return [ N(o), N(b(o, t - (r ? r - i : 0))) ];
194
204
  },
195
205
  $findIndex: N,
196
206
  $getItemOffset: v,
197
207
  $getItemSize: q,
198
- $resize: (e, t, s, r) => {
199
- let n = e.reduce((e, [i, s]) => g(i) && t(i) ? e + (s - q(i)) : e, 0);
208
+ $setItemSizes: (e, t) => {
200
209
  for (const [t, s] of e) g(t) && (S(), a += -1 === d[t] ? s : s - q(t), z(t, s + i));
201
- if (c && r && a > r) {
202
- let e = 0;
203
- const t = N(s + n), i = [];
204
- d.forEach((s, r) => {
205
- -1 !== s && (s && i.push(s), r < t && e++);
206
- }), l = -1, I(i);
207
- const r = i.length, a = r / 2 | 0, u = r % 2 == 0 ? (i[a - 1] + i[a]) / 2 : i[a], p = o;
208
- n += ((o = u) - p) * b(t - e, 0), c = !1;
210
+ if (c && t && a > t) {
211
+ const e = [];
212
+ d.forEach(t => {
213
+ -1 !== t && t && e.push(t);
214
+ }), l = -1, P(e);
215
+ const t = e.length, i = t / 2 | 0;
216
+ o = t % 2 == 0 ? (e[i - 1] + e[i]) / 2 : e[i], c = !1;
209
217
  }
210
- return n;
211
218
  },
212
219
  $isSizeEqual: (e, t = -1) => {
213
220
  const s = d.length ? d[e] : -1;
@@ -217,7 +224,7 @@ z), M = e => b(e.$getTotalSize(), e.$getViewportSize()), _ = ({$getRange: e, $ge
217
224
  $getLength: () => s,
218
225
  $setLength: e => {
219
226
  const t = e - s;
220
- return l = w(e - 1, l), s = e, d.length && (t > 0 ? V(d, t) : d.splice(t)), 0;
227
+ l = w(e - 1, l), s = e, d.length && (t > 0 ? E(d, t) : d.splice(t));
221
228
  },
222
229
  $isEstimating: () => c,
223
230
  $isMeasurable: g,
@@ -226,234 +233,234 @@ z), M = e => b(e.$getTotalSize(), e.$getViewportSize()), _ = ({$getRange: e, $ge
226
233
  },
227
234
  $getPinnedStart: $,
228
235
  $getTrailStart: x,
229
- $getSizes: (e, t) => "number" == typeof t ? r ? t : null : r || n || "auto" === t ? null : e.map(e => null != e ? e[t] : null),
230
- $relayout: (e, t) => {
231
- if (null == e) return;
236
+ $getSizes: (e, t) => "number" == typeof t ? n ? t : null : n || r || "auto" === t ? null : e.map(e => null != e ? e[t] : null),
237
+ $relayout: e => {
238
+ if (null == e) return !1;
232
239
  if ("number" == typeof e) {
233
- const s = e + i;
234
- if (s === o) return;
235
- const r = N(t) * (s - o);
236
- return o = s, r;
240
+ const t = e + i;
241
+ return t !== o && (o = t, !0);
237
242
  }
238
- if (e === m && s === f.length) return;
243
+ if (e === m && s === f.length) return !1;
239
244
  m = e, f.length = s, S();
240
- const r = N(t), n = v(r);
241
- let l;
242
- for (let t = 0; t < s; t++) {
243
- const s = e[t], r = "number" != typeof s;
244
- if (!r || !f[t]) {
245
- f[t] = r;
245
+ let t = !1;
246
+ for (let n = 0; n < s; n++) {
247
+ const s = e[n], r = "number" != typeof s;
248
+ if (!r || !f[n]) {
249
+ f[n] = r;
246
250
  const e = r ? -1 : s + i;
247
- d[t] !== e && (z(t, e), l = !0);
251
+ d[n] !== e && (z(n, e), t = !0);
248
252
  }
249
253
  }
250
- return l ? v(r) - n : void 0;
254
+ return t;
251
255
  }
252
256
  };
253
- }, W = /*#__PURE__*/ new WeakMap, B = (e, t, i) => {
257
+ }, B = /*#__PURE__*/ new WeakMap, H = (e, t, i) => {
254
258
  const s = [];
255
- for (const r of e) r >= t && r < i && s.push(r);
256
- return I(s);
257
- }, H = (e, t, i) => {
259
+ for (const n of e) n >= t && n < i && s.push(n);
260
+ return P(s);
261
+ }, j = (e, t, i) => {
258
262
  if (t >= i) return -1;
259
- let s = 0, r = e.length;
260
- for (;s < r; ) {
261
- const i = s + r >> 1;
262
- e[i] <= t ? s = i + 1 : r = i;
263
+ let s = 0, n = e.length;
264
+ for (;s < n; ) {
265
+ const i = s + n >> 1;
266
+ e[i] <= t ? s = i + 1 : n = i;
263
267
  }
264
268
  return s - 1;
265
- }, j = (e, t, i, s, r) => {
266
- const n = t.length;
267
- for (;i < n && t[i] < s; i++) {
269
+ }, A = (e, t, i, s, n) => {
270
+ const r = t.length;
271
+ for (;i < r && t[i] < s; i++) {
268
272
  const s = t[i];
269
- s > r && (e.push(s), r = s);
273
+ s > n && (e.push(s), n = s);
270
274
  }
271
275
  return i;
272
- }, A = (e, t, i, s, r, n) => {
276
+ }, Q = (e, t, i, s, n, r) => {
273
277
  const o = [];
274
278
  for (let e = 0; e < i; e++) o.push(e);
275
- const l = j(o, e, 0, s, i - 1);
276
- for (let e = s; e <= r; e++) o.push(e);
277
- j(o, e, l, n, r);
278
- for (let e = n; e < t; e++) o.push(e);
279
+ const l = A(o, e, 0, s, i - 1);
280
+ for (let e = s; e <= n; e++) o.push(e);
281
+ A(o, e, l, r, n);
282
+ for (let e = r; e < t; e++) o.push(e);
279
283
  return o;
280
- }, Q = (e, t) => w(e.rowIndex + (e.rowSpan || 1), t), J = (e, t) => w(e.colIndex + (e.colSpan || 1), t), X = (e, t, i, s, r, n) => {
284
+ }, J = (e, t) => w(e.rowIndex + (e.rowSpan || 1), t), X = (e, t) => w(e.colIndex + (e.colSpan || 1), t), Y = (e, t, i, s, n, r) => {
281
285
  const o = t.length, l = s.length;
282
286
  let a = "[l0]", c = 0, u = 0, p = 0;
283
- for (;c < n; ) {
287
+ for (;c < r; ) {
284
288
  for (;p < l && s[p] <= c; ) p++;
285
- const m = u < o ? t[u] : n;
289
+ const m = u < o ? t[u] : r;
286
290
  let d, h;
287
291
  if (m === c) {
288
292
  d = c + 1;
289
293
  const t = i[u];
290
- h = null == t ? e.$getItemSize(c) + "px" : t ? r : "minmax(" + e.$getItemSize(c) + "px,auto)",
294
+ h = null == t ? e.$getItemSize(c) + "px" : t ? n : "minmax(" + e.$getItemSize(c) + "px,auto)",
291
295
  u++;
292
- } else d = w(m, p < l ? s[p] : n), h = "minmax(" + (e.$getItemOffset(d - 1) + e.$getItemSize(d - 1) - e.$getItemOffset(c)) + "px,auto)";
296
+ } else d = w(m, p < l ? s[p] : r), h = "minmax(" + (e.$getItemOffset(d - 1) + e.$getItemSize(d - 1) - e.$getItemOffset(c)) + "px,auto)";
293
297
  a += " " + h + " [l" + d + "]", c = d;
294
298
  }
295
299
  return a;
296
- }, Y = (e, t, i, s, r) => {
297
- const n = {
300
+ }, U = (e, t, i, s, n) => {
301
+ const r = {
298
302
  display: "grid",
299
303
  gridTemplateRows: "subgrid",
300
304
  gridTemplateColumns: "subgrid",
301
305
  gridColumn: "1/-1",
302
306
  gridRow: "l" + e + "/l" + t
303
307
  };
304
- return null != i && (n.position = "sticky", n[s] = i + "px", n.zIndex = r), n;
305
- }, U = e => {
308
+ return null != i && (r.position = "sticky", r[s] = i + "px", r.zIndex = n), r;
309
+ }, Z = e => {
306
310
  let t;
307
311
  return {
308
- i(i) {
312
+ o(i) {
309
313
  (t || (t = new (C(O(i)).ResizeObserver)(e))).observe(i);
310
314
  },
311
- o(e) {
315
+ l(e) {
312
316
  t.unobserve(e);
313
317
  },
314
- l() {
318
+ u() {
315
319
  t && t.disconnect();
316
320
  }
317
321
  };
318
- }, Z = (e, t, i, s, r, n, o) => {
319
- let l, a, c = 0, u = !1, p = !1, m = !1, d = !1;
320
- const h = Date.now, f = s ? "scrollLeft" : "scrollTop", g = s ? "left" : "top", S = e => r ? -e : e, y = () => S(i[f]), v = (e, t) => {
321
- i.scrollTo({
322
- [g]: S(e),
322
+ }, ee = (e, t, i, s, n, r, o, l) => {
323
+ let a, c, u = 0, p = !1, m = !1, d = !1, h = !1;
324
+ const f = Date.now, g = n ? "scrollLeft" : "scrollTop", S = n ? "left" : "top", y = e => r ? -e : e, v = () => y(s[g]), z = (e, t) => {
325
+ s.scrollTo({
326
+ [S]: y(e),
323
327
  behavior: t ? "smooth" : "instant"
324
328
  });
325
- }, z = () => {
326
- if (u || p) return u = !1, void N();
327
- m = !1, e.$update(2);
328
329
  }, N = () => {
329
- q(a), a = x(z, 150);
330
+ if (p || m) return p = !1, void w();
331
+ d = !1, e.$update(2);
330
332
  }, w = () => {
331
- c = h(), m && (d = !0), o && e.$update(6, o()), e.$update(1, y()), N();
332
- }, b = t => {
333
- if (u || !e.$isScrolling() || t.ctrlKey) return;
334
- const i = h() - c;
335
- 150 > i && 50 < i && (s ? t.deltaX : t.deltaY) && (u = !0);
336
- }, $ = () => {
337
- p = !0, m = d = !1;
333
+ q(c), c = x(N, 150);
334
+ }, b = () => {
335
+ u = f(), d && (h = !0), l && e.$update(7, l()), e.$update(1, v()), w();
336
+ }, $ = t => {
337
+ if (p || !e.$isScrolling() || t.ctrlKey) return;
338
+ const i = f() - u;
339
+ 150 > i && 50 < i && (n ? t.deltaX : t.deltaY) && (p = !0);
338
340
  }, R = () => {
339
- p = !1, T() && (m = !0);
341
+ m = !0, d = h = !1;
342
+ }, I = () => {
343
+ m = !1, T() && (d = !0);
340
344
  };
341
- return t.addEventListener("scroll", w), t.addEventListener("wheel", b, {
345
+ return i.addEventListener("scroll", b), i.addEventListener("wheel", $, {
342
346
  passive: !0
343
- }), t.addEventListener("touchstart", $, {
347
+ }), i.addEventListener("touchstart", R, {
344
348
  passive: !0
345
- }), t.addEventListener("touchend", R, {
349
+ }), i.addEventListener("touchend", I, {
346
350
  passive: !0
347
351
  }), {
348
- u: w,
349
- l: () => {
350
- t.removeEventListener("scroll", w), t.removeEventListener("wheel", b), t.removeEventListener("touchstart", $),
351
- t.removeEventListener("touchend", R), q(a);
352
+ p: b,
353
+ u: () => {
354
+ i.removeEventListener("scroll", b), i.removeEventListener("wheel", $), i.removeEventListener("touchstart", R),
355
+ i.removeEventListener("touchend", I), q(c);
352
356
  },
353
- p: () => {
354
- const [t, s] = e.t();
357
+ m: () => {
358
+ const [t, i] = e.i();
355
359
  if (!t) return;
356
- d && n && n(), d = !1;
357
- const r = e.$getScrollOffset(), o = r + t, a = e.$getStartSpacerSize() + e.$getTotalSize() - e.$getViewportSize();
358
- o <= 0 || o >= a || r >= a ? v(o) : i.scrollBy({
359
- [g]: S(t),
360
+ h && o && o(), h = !1;
361
+ const n = e.$getScrollOffset(), r = n + t, l = e.$getStartSpacerSize() + e.$getTotalSize() - e.$getViewportSize();
362
+ r <= 0 || r >= l || n >= l ? z(r) : s.scrollBy({
363
+ [S]: y(t),
360
364
  behavior: "instant"
361
- }), s && (l && l(), e.$getViewportSize() > e.$getTotalSize() && e.$update(1, y()));
365
+ }), i && (a && a(), e.$getViewportSize() > e.$getTotalSize() && e.$update(1, v()));
362
366
  },
363
- m: (t, i) => {
364
- let s, r, n;
365
- l && l();
366
- const o = l = () => {
367
- s = !0, q(r), n && n();
368
- }, a = () => {
369
- if (!s) {
370
- if (e.$getViewportSize() && (q(r), r = x(o, 150)), i) {
371
- for (let [t, i] = e.$getRange(0); t <= i; t++) if (e.$isUnmeasuredItem(t)) return;
372
- o();
367
+ h: (i, s) => {
368
+ let n, r, o;
369
+ a && a();
370
+ const l = a = () => {
371
+ n = !0, q(r), o && o();
372
+ }, c = () => {
373
+ if (!n) {
374
+ if (e.$getViewportSize() && (q(r), r = x(l, 150)), s) {
375
+ for (let [i, s] = e.$getRange(0); i <= s; i++) if (t.$isSizeEqual(i)) return;
376
+ l();
373
377
  }
374
- e.$update(7), v(t(), i);
378
+ e.$update(8), z(i(), s);
375
379
  }
376
380
  };
377
- i && e.$update(8, t()), (() => {
378
- if (s) return;
381
+ s && e.$update(9, i()), (() => {
382
+ if (n) return;
379
383
  let t;
380
- n = e.$subscribe(2, () => {
384
+ o = e.$subscribe(2, () => {
381
385
  t || (t = !0, F(() => {
382
- t = !1, a();
386
+ t = !1, c();
383
387
  }));
384
- }), a();
388
+ }), c();
385
389
  })();
386
390
  }
387
391
  };
388
- }, ee = (e, t) => {
389
- let i, s, r = k(), n = !0;
390
- const o = /* @__PURE__ */ new WeakMap, l = U(r => {
391
- const l = [];
392
- for (const {target: a, contentRect: {width: c, height: u}} of r) if (a === i) c || u ? (n || s.u(),
393
- n = !0, e.$update(4, t ? c : u)) : n = !1; else if (a.offsetParent) {
394
- const e = o.get(a);
395
- null != e && l.push([ e, t ? c : u ]);
392
+ }, te = (e, t, i) => {
393
+ let s, n, r = k(), o = !0;
394
+ const l = /* @__PURE__ */ new WeakMap, a = Z(r => {
395
+ const a = [];
396
+ for (const {target: c, contentRect: {width: u, height: p}} of r) if (c === s) u || p ? (o || n.p(),
397
+ o = !0, e.$update(4, i ? u : p)) : o = !1; else if (c.offsetParent) {
398
+ const e = l.get(c);
399
+ if (null != e) {
400
+ const s = i ? u : p;
401
+ t.$isSizeEqual(e, s) || a.push([ e, s ]);
402
+ }
396
403
  }
397
- l.length && e.$update(3, l);
404
+ e.$update(3, a);
398
405
  });
399
406
  return {
400
- $observe(n, o = n.parentElement) {
401
- l.i(i = o), s = Z(e, o, o, t, t && "rtl" === getComputedStyle(o).direction, () => {
402
- const e = t ? "overflowX" : "overflowY", i = o.style, s = i[e];
403
- i[e] = "hidden", x(() => {
404
- i[e] = s;
407
+ $observe(o, l = o.parentElement) {
408
+ a.o(s = l), n = ee(e, t, l, l, i, i && "rtl" === getComputedStyle(l).direction, () => {
409
+ const e = i ? "overflowX" : "overflowY", t = l.style, s = t[e];
410
+ t[e] = "hidden", x(() => {
411
+ t[e] = s;
405
412
  });
406
413
  }), r[1](!0);
407
414
  },
408
415
  $dispose() {
409
- l.l(), s && s.l(), r[1](!1), r = k();
416
+ a.u(), n && n.u(), r[1](!1), r = k();
410
417
  },
411
- $observeItem: (e, t) => (o.set(e, t), l.i(e), () => {
412
- o.delete(e), l.o(e);
418
+ $observeItem: (e, t) => (l.set(e, t), a.o(e), () => {
419
+ l.delete(e), a.l(e);
413
420
  }),
414
421
  async $scroll(e, t) {
415
- await r[0] && s.m(e, t);
422
+ await r[0] && n.h(e, t);
416
423
  },
417
424
  $effect() {
418
- s && s.p();
425
+ n && n.m();
419
426
  },
420
427
  $getBaseOffset: e.$getStartSpacerSize
421
428
  };
422
- }, te = (e, t) => {
429
+ }, ie = (e, t) => {
423
430
  e.$scroll(() => t);
424
- }, ie = (e, t, i) => {
425
- te(e, i + t.$getScrollOffset());
426
- }, se = (e, t, i, {align: s, smooth: r, offset: n = 0} = {}) => {
427
- if (i = P(i, 0, t.$getItemsLength() - 1), "nearest" === s) {
428
- const e = t.$getItemOffset(i), r = t.$getScrollOffset();
429
- if (e < r) s = "start"; else {
430
- if (!(e + t.$getItemSize(i) > r + t.$getViewportSize())) return;
431
- s = "end";
431
+ }, se = (e, t, i) => {
432
+ ie(e, i + t.$getScrollOffset());
433
+ }, ne = (e, t, i, s, {align: n, smooth: r, offset: o = 0} = {}) => {
434
+ if (s = I(s, 0, i.$getLength() - 1), "nearest" === n) {
435
+ const e = t.$getItemOffset(s), r = t.$getScrollOffset();
436
+ if (e < r) n = "start"; else {
437
+ if (!(e + i.$getItemSize(s) > r + t.$getViewportSize())) return;
438
+ n = "end";
432
439
  }
433
440
  }
434
- 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);
435
- }, re = (e, t, i, s, r, n, o) => {
436
- const l = t.$getItemsLength(), a = i.$getPinnedStart(), c = i.$getTrailStart();
437
- r = P(r, 0, l - 1);
438
- const u = B(s, a, c), p = H(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);
439
- if ("nearest" === n) {
440
- if (r < a || r >= c) return;
441
- const e = d(), i = t.$getScrollOffset() + e, s = t.$getViewportSize() - e - h(), o = t.$getItemSize(r);
442
- let l = t.$getItemOffset(r);
443
- if (m === r) {
441
+ e.$scroll(() => o + e.$getBaseOffset() + t.$getItemOffset(s) + ("end" === n ? i.$getItemSize(s) - t.$getViewportSize() : "center" === n ? (i.$getItemSize(s) - t.$getViewportSize()) / 2 : 0), r);
442
+ }, re = (e, t, i, s, n, r, o) => {
443
+ const l = i.$getLength(), a = i.$getPinnedStart(), c = i.$getTrailStart();
444
+ n = I(n, 0, l - 1);
445
+ const u = H(s, a, c), p = j(u, n, c), m = p < 0 ? -1 : u[p], d = () => i.$getItemOffset(a) + (m < 0 || m === n ? 0 : i.$getItemOffset(m + 1) - i.$getItemOffset(m)), h = () => i.$getItemOffset(l) - i.$getItemOffset(c);
446
+ if ("nearest" === r) {
447
+ if (n < a || n >= c) return;
448
+ const e = d(), s = t.$getScrollOffset() + e, o = t.$getViewportSize() - e - h(), l = i.$getItemSize(n);
449
+ let f = t.$getItemOffset(n);
450
+ if (m === n) {
444
451
  const e = (p + 1 < u.length ? u[p + 1] : c) - 1;
445
- l = b(l, w(i, t.$getItemOffset(e) + t.$getItemSize(e) - o));
452
+ f = b(f, w(s, t.$getItemOffset(e) + i.$getItemSize(e) - l));
446
453
  }
447
- if (l < i) n = "start"; else {
448
- if (!(l + o > i + s)) return;
449
- n = "end";
454
+ if (f < s) r = "start"; else {
455
+ if (!(f + l > s + o)) return;
456
+ r = "end";
450
457
  }
451
458
  }
452
459
  e.$scroll(o, () => {
453
- const e = d(), i = t.$getItemSize(r) - (t.$getViewportSize() - e - h());
454
- return t.$getItemOffset(r) - e + ("end" === n ? i : "center" === n ? i / 2 : 0);
460
+ const e = d(), s = i.$getItemSize(n) - (t.$getViewportSize() - e - h());
461
+ return t.$getItemOffset(n) - e + ("end" === r ? s : "center" === r ? s / 2 : 0);
455
462
  });
456
- }, ne = class t {
463
+ }, oe = class t {
457
464
  index=h.required();
458
465
  offset=h.required();
459
466
  hide=h.required();
@@ -474,7 +481,7 @@ z), M = e => b(e.$getTotalSize(), e.$getViewportSize()), _ = ({$getRange: e, $ge
474
481
  return e && (s.display = "inline-flex"), s;
475
482
  });
476
483
  constructor() {
477
- const e = d(r).nativeElement;
484
+ const e = d(n).nativeElement;
478
485
  let t;
479
486
  c({
480
487
  read: () => {
@@ -565,9 +572,9 @@ z), M = e => b(e.$getTotalSize(), e.$getViewportSize()), _ = ({$getRange: e, $ge
565
572
  },
566
573
  ngImport: e
567
574
  });
568
- }, oe = (e, t) => "_" + t, le = /*#__PURE__*/ new o("virtua-item-template"), ae = class i {
575
+ }, le = (e, t) => "_" + t, ae = /*#__PURE__*/ new o("virtua-item-template"), ce = class i {
569
576
  data=h.required();
570
- getKey=h(oe);
577
+ getKey=h(le);
571
578
  itemProps=h();
572
579
  bufferSize=h();
573
580
  scrollRef=h();
@@ -584,48 +591,48 @@ z), M = e => b(e.$getTotalSize(), e.$getViewportSize()), _ = ({$getRange: e, $ge
584
591
  scrollEnded=f();
585
592
  resized=f();
586
593
  contentTemplate=p(l);
587
- h=d(le, {
594
+ S=d(ae, {
588
595
  optional: !0
589
596
  });
590
- template=u(() => this.h?.() ?? this.contentTemplate());
591
- S;
597
+ template=u(() => this.S?.() ?? this.contentTemplate());
592
598
  v;
599
+ N;
593
600
  driver;
594
- N=d(r).nativeElement;
595
- $=d(t);
596
- R=g(void 0);
601
+ $=d(n).nativeElement;
602
+ R=d(t);
603
+ I=g(void 0);
597
604
  isSSR=g(!1);
598
605
  P=u(() => {
599
- this.R();
600
- const e = this.data().length, [t, i] = this.S.$getRange(this.bufferSize()), s = this.keepMounted(), r = [];
606
+ this.I();
607
+ const e = this.data().length, [t, i] = this.v.$getRange(this.bufferSize()), s = this.keepMounted(), n = [];
601
608
  if (s) {
602
- const n = new Set(s);
603
- for (let e = t; e <= i; e++) n.add(e);
604
- for (const t of I([ ...n ])) t < e && r.push(t);
605
- } else for (let e = t; e <= i; e++) r.push(e);
606
- return r;
609
+ const r = new Set(s);
610
+ for (let e = t; e <= i; e++) r.add(e);
611
+ for (const t of P([ ...r ])) t < e && n.push(t);
612
+ } else for (let e = t; e <= i; e++) n.push(e);
613
+ return n;
607
614
  });
608
615
  items=u(() => {
609
- this.R();
610
- const e = this.S, t = this.data(), i = this.getKey(), s = this.itemProps();
611
- return this.P().map(r => {
612
- const n = t[r];
616
+ this.I();
617
+ const e = this.v, t = this.data(), i = this.getKey(), s = this.itemProps();
618
+ return this.P().map(n => {
619
+ const r = t[n];
613
620
  return {
614
- key: i(n, r),
615
- index: r,
616
- data: n,
617
- offset: e.$getItemOffset(r),
618
- hide: e.$isUnmeasuredItem(r),
621
+ key: i(r, n),
622
+ index: n,
623
+ data: r,
624
+ offset: e.$getItemOffset(n),
625
+ hide: this.N.$isSizeEqual(n),
619
626
  attrs: s?.({
620
- item: n,
621
- index: r
627
+ item: r,
628
+ index: n
622
629
  })
623
630
  };
624
631
  });
625
632
  });
626
633
  containerStyle=u(() => {
627
- this.R();
628
- const e = this.horizontal(), t = this.S.$getTotalSize();
634
+ this.I();
635
+ const e = this.horizontal(), t = this.v.$getTotalSize();
629
636
  return {
630
637
  display: "block",
631
638
  contain: "size style",
@@ -634,71 +641,71 @@ z), M = e => b(e.$getTotalSize(), e.$getViewportSize()), _ = ({$getRange: e, $ge
634
641
  position: "relative",
635
642
  width: e ? t + "px" : "100%",
636
643
  height: e ? "100%" : t + "px",
637
- "pointer-events": this.S.$isScrolling() ? "none" : void 0
644
+ "pointer-events": this.v.$isScrolling() ? "none" : void 0
638
645
  };
639
646
  });
640
647
  constructor() {
641
648
  m(() => {
642
649
  const e = this.data().length;
643
- this.S && e !== this.S.$getItemsLength() && this.S.$update(5, [ e, S(this.shift) ]);
650
+ this.v && this.v.$update(5, e, S(this.shift));
644
651
  }), m(() => {
645
652
  const e = this.startMargin();
646
- this.S && e !== this.S.$getStartSpacerSize() && this.S.$update(6, e);
653
+ this.v && e !== this.v.$getStartSpacerSize() && this.v.$update(7, e);
647
654
  }), a({
648
655
  read: () => {
649
- this.isSSR.set(!1), this.driver.$observe(this.N, this.scrollRef());
656
+ this.isSSR.set(!1), this.driver.$observe(this.$, this.scrollRef());
650
657
  }
651
658
  }), c({
652
659
  read: () => {
653
- this.R(), this.driver.$effect();
660
+ this.I(), this.driver.$effect();
654
661
  }
655
662
  }), d(s).onDestroy(() => {
656
- this.S?.$dispose(), this.driver?.$dispose();
663
+ this.v?.$dispose(), this.driver?.$dispose();
657
664
  });
658
665
  }
659
666
  ngOnInit() {
660
667
  const e = this.itemSize(), t = this.ssrCount();
661
668
  this.isSSR.set(!!t);
662
- const i = this.v = L(this.data().length, e, this.cacheProp()), s = this.S = _(i, t);
663
- this.driver = ee(s, this.horizontal()), s.$subscribe(1, e => {
664
- this.R.set(s.$getStateVersion()), e && this.$.tick();
669
+ const i = this.N = L(this.data().length, e, this.cacheProp()), s = this.v = V(i, t);
670
+ this.driver = te(s, i, this.horizontal()), s.$subscribe(1, e => {
671
+ this.I.set(s.$getStateVersion()), e && this.R.tick();
665
672
  }), s.$subscribe(4, () => {
666
673
  this.scrolled.emit(s.$getScrollOffset());
667
674
  }), s.$subscribe(8, () => {
668
675
  this.scrollEnded.emit();
669
676
  }), s.$subscribe(2, () => {
670
677
  this.resized.emit();
671
- }), this.R.set(s.$getStateVersion());
678
+ }), this.I.set(s.$getStateVersion());
672
679
  }
673
680
  get cache() {
674
- return this.v.$snapshot();
681
+ return this.N.$snapshot();
675
682
  }
676
683
  get scrollOffset() {
677
- return this.S.$getScrollOffset();
684
+ return this.v.$getScrollOffset();
678
685
  }
679
686
  get scrollSize() {
680
- return M(this.S);
687
+ return M(this.v);
681
688
  }
682
689
  get viewportSize() {
683
- return this.S.$getViewportSize();
690
+ return this.v.$getViewportSize();
684
691
  }
685
692
  findItemIndex(e) {
686
- return this.v.$findIndex(e - this.S.$getStartSpacerSize());
693
+ return this.N.$findIndex(e - this.v.$getStartSpacerSize());
687
694
  }
688
695
  getItemOffset(e) {
689
- return this.S.$getItemOffset(e);
696
+ return this.v.$getItemOffset(e);
690
697
  }
691
698
  getItemSize(e) {
692
- return this.S.$getItemSize(e);
699
+ return this.N.$getItemSize(e);
693
700
  }
694
701
  scrollToIndex(e, t) {
695
- se(this.driver, this.S, e, t);
702
+ ne(this.driver, this.v, this.N, e, t);
696
703
  }
697
704
  scrollTo(e) {
698
- te(this.driver, e);
705
+ ie(this.driver, e);
699
706
  }
700
707
  scrollBy(e) {
701
- ie(this.driver, this.S, e);
708
+ se(this.driver, this.v, e);
702
709
  }
703
710
  static ɵfac=/*@__PURE__*/ e.ɵɵngDeclareFactory({
704
711
  minVersion: "12.0.0",
@@ -823,7 +830,7 @@ z), M = e => b(e.$getTotalSize(), e.$getViewportSize()), _ = ({$getRange: e, $ge
823
830
  isInline: !0,
824
831
  dependencies: [ {
825
832
  kind: "directive",
826
- type: e.forwardRef(() => ne),
833
+ type: e.forwardRef(() => oe),
827
834
  selector: "div[virtuaListItem]",
828
835
  inputs: [ "index", "offset", "hide", "horizontal", "isSSR", "resizer", "attrs" ]
829
836
  }, {
@@ -838,9 +845,9 @@ z), M = e => b(e.$getTotalSize(), e.$getViewportSize()), _ = ({$getRange: e, $ge
838
845
 
839
846
  i.OnPush;
840
847
 
841
- var ce = class t {
848
+ var ue = class t {
842
849
  data=h.required();
843
- getKey=h(oe);
850
+ getKey=h(le);
844
851
  itemProps=h();
845
852
  bufferSize=h();
846
853
  itemSize=h();
@@ -855,10 +862,10 @@ var ce = class t {
855
862
  scrollEnded=f();
856
863
  resized=f();
857
864
  template=p.required(l);
858
- virtualizer=y.required(ae);
859
- N=d(r).nativeElement;
865
+ virtualizer=y.required(ce);
866
+ $=d(n).nativeElement;
860
867
  ngOnInit() {
861
- const e = this.horizontal(), t = this.N;
868
+ const e = this.horizontal(), t = this.$;
862
869
  t.setAttribute("style", `display:block;${e ? "overflow-x" : "overflow-y"}:auto;contain:strict;width:100%;height:100%;` + (t.getAttribute("style") || ""));
863
870
  }
864
871
  get cache() {
@@ -993,7 +1000,7 @@ var ce = class t {
993
1000
  viewQueries: [ {
994
1001
  propertyName: "virtualizer",
995
1002
  first: !0,
996
- predicate: ae,
1003
+ predicate: ce,
997
1004
  emitDistinctChangesOnly: !1,
998
1005
  descendants: !0,
999
1006
  isSignal: !0
@@ -1003,13 +1010,13 @@ var ce = class t {
1003
1010
  isInline: !0,
1004
1011
  dependencies: [ {
1005
1012
  kind: "directive",
1006
- type: e.forwardRef(() => ae),
1013
+ type: e.forwardRef(() => ce),
1007
1014
  selector: "virtua-virtualizer",
1008
1015
  inputs: [ "data", "getKey", "itemProps", "bufferSize", "scrollRef", "itemSize", "ssrCount", "shift", "horizontal", "keepMounted", "cache", "startMargin" ],
1009
1016
  outputs: [ "scrolled", "scrollEnded", "resized" ]
1010
1017
  } ],
1011
1018
  viewProviders: [ {
1012
- provide: le,
1019
+ provide: ae,
1013
1020
  useFactory: () => d(t).template
1014
1021
  } ],
1015
1022
  changeDetection: e.ChangeDetectionStrategy.OnPush
@@ -1018,9 +1025,9 @@ var ce = class t {
1018
1025
 
1019
1026
  i.OnPush;
1020
1027
 
1021
- var ue = class i {
1028
+ var pe = class i {
1022
1029
  data=h.required();
1023
- getKey=h(oe);
1030
+ getKey=h(le);
1024
1031
  bufferSize=h();
1025
1032
  itemSize=h();
1026
1033
  ssrCount=h();
@@ -1033,31 +1040,31 @@ var ue = class i {
1033
1040
  scrollEnded=f();
1034
1041
  resized=f();
1035
1042
  template=p.required(l);
1036
- S;
1037
1043
  v;
1044
+ N;
1038
1045
  driver;
1039
- N=d(r).nativeElement;
1040
- $=d(t);
1041
- R=g(void 0);
1046
+ $=d(n).nativeElement;
1047
+ R=d(t);
1048
+ I=g(void 0);
1042
1049
  isSSR=g(!1);
1043
1050
  items=u(() => {
1044
- this.R();
1045
- const e = this.S, t = this.data(), i = this.getKey(), [s, r] = e.$getRange(this.bufferSize()), n = [];
1046
- for (let o = s; o <= r; o++) {
1051
+ this.I();
1052
+ const e = this.v, t = this.data(), i = this.getKey(), [s, n] = e.$getRange(this.bufferSize()), r = [];
1053
+ for (let o = s; o <= n; o++) {
1047
1054
  const s = t[o];
1048
- n.push({
1055
+ r.push({
1049
1056
  key: i(s, o),
1050
1057
  index: o,
1051
1058
  data: s,
1052
1059
  offset: e.$getItemOffset(o),
1053
- hide: e.$isUnmeasuredItem(o)
1060
+ hide: this.N.$isSizeEqual(o)
1054
1061
  });
1055
1062
  }
1056
- return n;
1063
+ return r;
1057
1064
  });
1058
1065
  containerStyle=u(() => {
1059
- this.R();
1060
- const e = this.horizontal(), t = this.S.$getTotalSize();
1066
+ this.I();
1067
+ const e = this.horizontal(), t = this.v.$getTotalSize();
1061
1068
  return {
1062
1069
  display: "block",
1063
1070
  contain: "size style",
@@ -1066,95 +1073,98 @@ var ue = class i {
1066
1073
  position: "relative",
1067
1074
  width: e ? t + "px" : "100%",
1068
1075
  height: e ? "100%" : t + "px",
1069
- "pointer-events": this.S.$isScrolling() ? "none" : void 0
1076
+ "pointer-events": this.v.$isScrolling() ? "none" : void 0
1070
1077
  };
1071
1078
  });
1072
1079
  constructor() {
1073
1080
  m(() => {
1074
1081
  const e = this.data().length;
1075
- this.S && e !== this.S.$getItemsLength() && this.S.$update(5, [ e, S(this.shift) ]);
1082
+ this.v && this.v.$update(5, e, S(this.shift));
1076
1083
  }), a({
1077
1084
  read: () => {
1078
- this.isSSR.set(!1), this.driver.$observe(this.N);
1085
+ this.isSSR.set(!1), this.driver.$observe(this.$);
1079
1086
  }
1080
1087
  }), c({
1081
1088
  read: () => {
1082
- this.R(), this.driver.$effect();
1089
+ this.I(), this.driver.$effect();
1083
1090
  }
1084
1091
  }), d(s).onDestroy(() => {
1085
- this.S?.$dispose(), this.driver?.$dispose();
1092
+ this.v?.$dispose(), this.driver?.$dispose();
1086
1093
  });
1087
1094
  }
1088
1095
  ngOnInit() {
1089
1096
  const e = this.itemSize(), t = this.ssrCount();
1090
1097
  this.isSSR.set(!!t);
1091
- const i = this.v = L(this.data().length, e, this.cacheProp()), s = this.S = _(i, t);
1092
- this.driver = ((e, t) => {
1093
- let i, s, r, n, o, l = k();
1094
- const a = /* @__PURE__ */ new WeakMap, c = U(s => {
1098
+ const i = this.N = L(this.data().length, e, this.cacheProp()), s = this.v = V(i, t);
1099
+ this.driver = ((e, t, i) => {
1100
+ let s, n, r, o, l, a = k();
1101
+ const c = /* @__PURE__ */ new WeakMap, u = Z(n => {
1095
1102
  const r = [];
1096
- for (const {target: e, contentRect: {width: n, height: l}} of s) if (e === i) o && o(); else if (e.offsetParent) {
1097
- const i = a.get(e);
1098
- null != i && r.push([ i, t ? n : l ]);
1103
+ for (const {target: e, contentRect: {width: o, height: a}} of n) if (e === s) l && l(); else if (e.offsetParent) {
1104
+ const s = c.get(e);
1105
+ if (null != s) {
1106
+ const e = i ? o : a;
1107
+ t.$isSizeEqual(s, e) || r.push([ s, e ]);
1108
+ }
1099
1109
  }
1100
- r.length && e.$update(3, r);
1110
+ e.$update(3, r);
1101
1111
  });
1102
1112
  return {
1103
- $observe(a) {
1104
- const u = O(a), p = C(u), m = i = u.scrollingElement, d = t && "rtl" === getComputedStyle(m).direction, h = (e, t, i, s, r = 0) => {
1105
- const n = s ? "offsetLeft" : "offsetTop", o = r + (d ? t.clientWidth - e[n] - e.offsetWidth : e[n]), l = e.offsetParent;
1106
- return e !== i && l ? h(l, t, i, s, o) : o;
1107
- }, f = n = () => h(a, m, u.body, t), g = o = () => {
1108
- e.$update(4, m[t ? "clientWidth" : "clientHeight"]);
1113
+ $observe(c) {
1114
+ const p = O(c), m = C(p), d = s = p.scrollingElement, h = i && "rtl" === getComputedStyle(d).direction, f = (e, t, i, s, n = 0) => {
1115
+ const r = s ? "offsetLeft" : "offsetTop", o = n + (h ? t.clientWidth - e[r] - e.offsetWidth : e[r]), l = e.offsetParent;
1116
+ return e !== i && l ? f(l, t, i, s, o) : o;
1117
+ }, g = o = () => f(c, d, p.body, i), S = l = () => {
1118
+ e.$update(4, d[i ? "clientWidth" : "clientHeight"]);
1109
1119
  };
1110
- p.addEventListener("resize", g), c.i(m), r = () => {
1111
- p.removeEventListener("resize", g);
1112
- }, s = Z(e, p, m, t, d, null, f), l[1](!0);
1120
+ m.addEventListener("resize", S), u.o(d), r = () => {
1121
+ m.removeEventListener("resize", S);
1122
+ }, n = ee(e, t, m, d, i, h, null, g), a[1](!0);
1113
1123
  },
1114
1124
  $dispose() {
1115
- r && r(), c.l(), s && s.l(), l[1](!1), l = k();
1125
+ r && r(), u.u(), n && n.u(), a[1](!1), a = k();
1116
1126
  },
1117
- $observeItem: (e, t) => (a.set(e, t), c.i(e), () => {
1118
- a.delete(e), c.o(e);
1127
+ $observeItem: (e, t) => (c.set(e, t), u.o(e), () => {
1128
+ c.delete(e), u.l(e);
1119
1129
  }),
1120
1130
  async $scroll(e, t) {
1121
- await l[0] && s.m(e, t);
1131
+ await a[0] && n.h(e, t);
1122
1132
  },
1123
1133
  $effect() {
1124
- s && s.p();
1134
+ n && n.m();
1125
1135
  },
1126
- $getBaseOffset: () => n()
1136
+ $getBaseOffset: () => o()
1127
1137
  };
1128
- })(s, this.horizontal()), s.$subscribe(1, e => {
1129
- this.R.set(s.$getStateVersion()), e && this.$.tick();
1138
+ })(s, i, this.horizontal()), s.$subscribe(1, e => {
1139
+ this.I.set(s.$getStateVersion()), e && this.R.tick();
1130
1140
  }), s.$subscribe(4, () => {
1131
1141
  this.scrolled.emit();
1132
1142
  }), s.$subscribe(8, () => {
1133
1143
  this.scrollEnded.emit();
1134
1144
  }), s.$subscribe(2, () => {
1135
1145
  this.resized.emit();
1136
- }), this.R.set(s.$getStateVersion());
1146
+ }), this.I.set(s.$getStateVersion());
1137
1147
  }
1138
1148
  get cache() {
1139
- return this.v.$snapshot();
1149
+ return this.N.$snapshot();
1140
1150
  }
1141
1151
  get scrollOffset() {
1142
- return this.S.$getScrollOffset();
1152
+ return this.v.$getScrollOffset();
1143
1153
  }
1144
1154
  get viewportSize() {
1145
- return this.S.$getViewportSize();
1155
+ return this.v.$getViewportSize();
1146
1156
  }
1147
1157
  findItemIndex(e) {
1148
- return this.v.$findIndex(e - this.S.$getStartSpacerSize());
1158
+ return this.N.$findIndex(e - this.v.$getStartSpacerSize());
1149
1159
  }
1150
1160
  getItemOffset(e) {
1151
- return this.S.$getItemOffset(e);
1161
+ return this.v.$getItemOffset(e);
1152
1162
  }
1153
1163
  getItemSize(e) {
1154
- return this.S.$getItemSize(e);
1164
+ return this.N.$getItemSize(e);
1155
1165
  }
1156
1166
  scrollToIndex(e, t) {
1157
- se(this.driver, this.S, e, t);
1167
+ ne(this.driver, this.v, this.N, e, t);
1158
1168
  }
1159
1169
  static ɵfac=/*@__PURE__*/ e.ɵɵngDeclareFactory({
1160
1170
  minVersion: "12.0.0",
@@ -1251,7 +1261,7 @@ var ue = class i {
1251
1261
  isInline: !0,
1252
1262
  dependencies: [ {
1253
1263
  kind: "directive",
1254
- type: e.forwardRef(() => ne),
1264
+ type: e.forwardRef(() => oe),
1255
1265
  selector: "div[virtuaListItem]",
1256
1266
  inputs: [ "index", "offset", "hide", "horizontal", "isSSR", "resizer", "attrs" ]
1257
1267
  }, {
@@ -1266,19 +1276,19 @@ var ue = class i {
1266
1276
 
1267
1277
  i.OnPush;
1268
1278
 
1269
- var pe = class t {
1279
+ var me = class t {
1270
1280
  state=h.required();
1271
1281
  resizer=h.required();
1272
1282
  constructor() {
1273
- const e = d(r).nativeElement, t = u(() => this.state().$measureRow), i = u(() => this.state().$measureCol);
1274
- let n;
1283
+ const e = d(n).nativeElement, t = u(() => this.state().$measureRow), i = u(() => this.state().$measureCol);
1284
+ let r;
1275
1285
  c({
1276
1286
  read: () => {
1277
- const s = t(), r = i();
1278
- n && n(), n = null == s && null == r ? void 0 : S(this.resizer)(e, s, r);
1287
+ const s = t(), n = i();
1288
+ r && r(), r = null == s && null == n ? void 0 : S(this.resizer)(e, s, n);
1279
1289
  }
1280
1290
  }), d(s).onDestroy(() => {
1281
- n && n();
1291
+ r && r();
1282
1292
  });
1283
1293
  }
1284
1294
  static ɵfac=/*@__PURE__*/ e.ɵɵngDeclareFactory({
@@ -1323,14 +1333,14 @@ var pe = class t {
1323
1333
  },
1324
1334
  ngImport: e
1325
1335
  });
1326
- }, me = class t {
1336
+ }, de = class t {
1327
1337
  state=h.required();
1328
1338
  template=h.required();
1329
1339
  row=h.required();
1330
1340
  cols=h.required();
1331
1341
  resizer=h.required();
1332
1342
  colItem(e) {
1333
- return D(this.cols(), e);
1343
+ return G(this.cols(), e);
1334
1344
  }
1335
1345
  static ɵfac=/*@__PURE__*/ e.ɵɵngDeclareFactory({
1336
1346
  minVersion: "12.0.0",
@@ -1397,7 +1407,7 @@ var pe = class t {
1397
1407
  isInline: !0,
1398
1408
  dependencies: [ {
1399
1409
  kind: "directive",
1400
- type: e.forwardRef(() => pe),
1410
+ type: e.forwardRef(() => me),
1401
1411
  selector: "div[virtuaGridCell]",
1402
1412
  inputs: [ "state", "resizer" ]
1403
1413
  }, {
@@ -1408,14 +1418,14 @@ var pe = class t {
1408
1418
  } ],
1409
1419
  changeDetection: e.ChangeDetectionStrategy.OnPush
1410
1420
  });
1411
- }, de = class t {
1421
+ }, he = class t {
1412
1422
  state=h.required();
1413
1423
  template=h.required();
1414
1424
  rows=h.required();
1415
1425
  cols=h.required();
1416
1426
  resizer=h.required();
1417
1427
  rowItem(e) {
1418
- return D(this.rows(), e);
1428
+ return G(this.rows(), e);
1419
1429
  }
1420
1430
  static ɵfac=/*@__PURE__*/ e.ɵɵngDeclareFactory({
1421
1431
  minVersion: "12.0.0",
@@ -1481,13 +1491,13 @@ var pe = class t {
1481
1491
  isInline: !0,
1482
1492
  dependencies: [ {
1483
1493
  kind: "directive",
1484
- type: e.forwardRef(() => me),
1494
+ type: e.forwardRef(() => de),
1485
1495
  selector: "div[virtuaGridRow]",
1486
1496
  inputs: [ "state", "template", "row", "cols", "resizer" ]
1487
1497
  } ],
1488
1498
  changeDetection: e.ChangeDetectionStrategy.OnPush
1489
1499
  });
1490
- }, he = class i {
1500
+ }, fe = class i {
1491
1501
  rows=h.required();
1492
1502
  cols=h.required();
1493
1503
  rowHeight=h.required();
@@ -1508,25 +1518,25 @@ var pe = class t {
1508
1518
  resized=f();
1509
1519
  template=p.required(l);
1510
1520
  container=y.required("container");
1511
- I;
1512
1521
  q;
1513
1522
  F;
1514
1523
  k;
1524
+ O;
1515
1525
  driver;
1516
- N=d(r).nativeElement;
1517
- $=d(t);
1518
- R=g(void 0);
1519
- ariaRowCount=d(new n("aria-rowcount"), {
1526
+ $=d(n).nativeElement;
1527
+ R=d(t);
1528
+ I=g(void 0);
1529
+ ariaRowCount=d(new r("aria-rowcount"), {
1520
1530
  optional: !0
1521
1531
  });
1522
- ariaColCount=d(new n("aria-colcount"), {
1532
+ ariaColCount=d(new r("aria-colcount"), {
1523
1533
  optional: !0
1524
1534
  });
1525
- rowCount=u(() => this.R() && this.I.$getItemsLength());
1526
- colCount=u(() => this.R() && this.q.$getItemsLength());
1527
- O=u(() => this.F.$getSizes(this.rows(), this.rowHeight()));
1528
- C=u(() => this.k.$getSizes(this.cols(), this.colWidth()));
1529
- T=u(() => ((e = N) => {
1535
+ rowCount=u(() => this.I() && this.k.$getLength());
1536
+ colCount=u(() => this.I() && this.O.$getLength());
1537
+ C=u(() => this.k.$getSizes(this.rows(), this.rowHeight()));
1538
+ T=u(() => this.O.$getSizes(this.cols(), this.colWidth()));
1539
+ M=u(() => ((e = N) => {
1530
1540
  const t = /* @__PURE__ */ new Map;
1531
1541
  for (const i of e) {
1532
1542
  const e = i.rowIndex + (i.rowSpan || 1);
@@ -1537,18 +1547,18 @@ var pe = class t {
1537
1547
  }
1538
1548
  return t;
1539
1549
  })(this.spans()));
1540
- plan=u(() => (this.R(), ((e, t, [i, s], [r, n], o, l = N, a = N, c) => {
1550
+ plan=u(() => (this.I(), ((e, t, [i, s], [n, r], o, l = N, a = N, c) => {
1541
1551
  const u = e.$getLength(), p = t.$getLength(), m = e.$getPinnedStart(), d = e.$getTrailStart(), h = t.$getPinnedStart(), f = t.$getTrailStart();
1542
- i = P(i, m, d), s = w(s, d - 1), r = P(r, h, f), n = w(n, f - 1);
1543
- const g = B(l, m, d), S = b(h - 1, 0), y = [], v = [], z = [];
1552
+ i = I(i, m, d), s = w(s, d - 1), n = I(n, h, f), r = w(r, f - 1);
1553
+ const g = H(l, m, d), S = b(h - 1, 0), y = [], v = [], z = [];
1544
1554
  for (const e of a) e.rowIndex < u && e.colIndex < p && (z.push(e), y.push(e.rowIndex));
1545
- const $ = z.length, R = H(g, i, d), x = R < 0 ? -1 : g[R];
1555
+ const $ = z.length, R = j(g, i, d), x = R < 0 ? -1 : g[R];
1546
1556
  x >= 0 && y.push(x);
1547
- const q = A(I(y), u, m, i, s, d);
1557
+ const q = Q(P(y), u, m, i, s, d);
1548
1558
  for (let e = 0; e < q.length; e++) for (const t of o.get(q[e]) || N) {
1549
- const {rowIndex: o, colIndex: l} = t, a = Q(t, u), c = J(t, p);
1559
+ const {rowIndex: o, colIndex: l} = t, a = J(t, u), c = X(t, p);
1550
1560
  if ((e < 1 || q[e - 1] < o) && l < p && (a - o > 1 || c - l > 1)) {
1551
- let e = (o < m || b(o, i) < w(a, s + 1) || d < a || x >= o && x < a) && (l < h || b(l, r) < w(c, n + 1) || f < c);
1561
+ let e = (o < m || b(o, i) < w(a, s + 1) || d < a || x >= o && x < a) && (l < h || b(l, n) < w(c, r + 1) || f < c);
1552
1562
  for (let t = 0; !e && t < $; t++) {
1553
1563
  const i = z[t];
1554
1564
  e = i.rowIndex >= o && i.rowIndex < a && i.colIndex >= l && i.colIndex < c;
@@ -1557,57 +1567,57 @@ var pe = class t {
1557
1567
  }
1558
1568
  }
1559
1569
  for (const {rowIndex: e, colIndex: t} of z) {
1560
- const i = H(g, e, d);
1570
+ const i = j(g, e, d);
1561
1571
  y.push(e), i >= 0 && y.push(g[i]), v.push(t);
1562
1572
  }
1563
- I(y), I(v);
1564
- const F = A(y, u, m, i, s, d), k = A(v, p, h, r, n, f), O = F.length, C = k.length, T = /* @__PURE__ */ new Map, M = [], _ = [];
1573
+ P(y), P(v);
1574
+ const F = Q(y, u, m, i, s, d), k = Q(v, p, h, n, r, f), O = F.length, C = k.length, T = /* @__PURE__ */ new Map, M = [], _ = [];
1565
1575
  for (const e of z) {
1566
- const t = Q(e, u), i = J(e, p);
1576
+ const t = J(e, u), i = X(e, p);
1567
1577
  M.push(t), _.push(i);
1568
1578
  const s = k.indexOf(e.colIndex);
1569
- for (let r = F.indexOf(e.rowIndex); r < O && F[r] < t; r++) {
1570
- const t = F[r] * p;
1571
- for (let r = s; r < C && k[r] < i; r++) T.set(t + k[r], e);
1579
+ for (let n = F.indexOf(e.rowIndex); n < O && F[n] < t; n++) {
1580
+ const t = F[n] * p;
1581
+ for (let n = s; n < C && k[n] < i; n++) T.set(t + k[n], e);
1572
1582
  }
1573
1583
  }
1574
1584
  const V = [];
1575
1585
  for (const e of k) V.push(!t.$isMeasurable(e) && null);
1576
- const E = [], L = e.$getItemOffset(m), K = [];
1577
- let D = K;
1578
- const G = W.get(e), j = /* @__PURE__ */ new Map;
1586
+ const E = [], K = e.$getItemOffset(m), L = [];
1587
+ let D = L;
1588
+ const G = B.get(e), W = /* @__PURE__ */ new Map;
1579
1589
  for (const o of F) {
1580
- const l = o < m, a = o >= d, y = H(g, o, d), v = l ? 0 : a ? d : y < 0 ? -1 : g[y];
1590
+ const l = o < m, a = o >= d, y = j(g, o, d), v = l ? 0 : a ? d : y < 0 ? -1 : g[y];
1581
1591
  if (o === v) {
1582
1592
  const e = l ? m : a ? u : y + 1 < g.length ? g[y + 1] : d;
1583
1593
  M.push(e);
1584
1594
  const t = [];
1585
- K.push({
1595
+ L.push({
1586
1596
  $key: l ? -1 : a ? -2 : -3 - v,
1587
1597
  $rows: t,
1588
- $style: Y(v, e, l || a ? 0 : null, a ? "bottom" : "top", 4)
1598
+ $style: U(v, e, l || a ? 0 : null, a ? "bottom" : "top", 4)
1589
1599
  }), D = t;
1590
- } else v < 0 && (D = K);
1591
- const z = y >= 0 && o === v, N = l || a || o === x || o >= i && o <= s, w = z ? L : null, $ = o * p, R = G && G.get(o), P = R && R.$cells, I = [];
1600
+ } else v < 0 && (D = L);
1601
+ const z = y >= 0 && o === v, N = l || a || o === x || o >= i && o <= s, w = z ? K : null, $ = o * p, R = G && G.get(o), I = R && R.$cells, P = [];
1592
1602
  let q = 0, F = !e.$isMeasurable(o) && null, O = o + 1, _ = !1;
1593
1603
  for (let e = 0; e < C; e++) {
1594
- const i = k[e], s = i < h, a = i >= f, m = s || a || i >= r && i <= n, d = T.get($ + i);
1604
+ const i = k[e], s = i < h, a = i >= f, m = s || a || i >= n && i <= r, d = T.get($ + i);
1595
1605
  if (d ? d.rowIndex === o && d.colIndex === i : N && m) {
1596
- const r = d ? Q(d, u) : o + 1, n = d ? J(d, p) : i + 1, m = r - o, h = n - i, f = m > 1, g = h > 1, y = f || g;
1606
+ const n = d ? J(d, u) : o + 1, r = d ? X(d, p) : i + 1, m = n - o, h = r - i, f = m > 1, g = h > 1, y = f || g;
1597
1607
  let v, N;
1598
- O = b(O, r);
1599
- const w = s ? t.$getItemOffset(i) : null, $ = a ? t.$getItemOffset(p) - t.$getItemOffset(n) : null;
1608
+ O = b(O, n);
1609
+ const w = s ? t.$getItemOffset(i) : null, $ = a ? t.$getItemOffset(p) - t.$getItemOffset(r) : null;
1600
1610
  !1 !== F || f || (v = o, F = !0), !1 !== V[e] || g || (N = i, V[e] = !0);
1601
1611
  const R = l ? "columnheader" : i === S && (s || z) ? "rowheader" : "cell", x = y ? m : void 0, k = y ? h : void 0, C = "cell" !== R && c && c.rowIndex === o && c.colIndex === i ? c.order : void 0;
1602
1612
  let T;
1603
- if (P) {
1604
- const e = P.length;
1605
- for (;q < e && P[q].$col < i; ) q++;
1606
- q < e && P[q].$col === i && (T = P[q]);
1613
+ if (I) {
1614
+ const e = I.length;
1615
+ for (;q < e && I[q].$col < i; ) q++;
1616
+ q < e && I[q].$col === i && (T = I[q]);
1607
1617
  }
1608
1618
  if (!T || T.$rowSpan !== x || T.$colSpan !== k || T.$start !== w || T.$end !== $ || T.$measureRow !== v || T.$measureCol !== N || T.$role !== R || T.$sort !== C) {
1609
1619
  let e = "1/l" + i;
1610
- y && (e += "/l" + r + "/l" + n);
1620
+ y && (e += "/l" + n + "/l" + r);
1611
1621
  const t = {
1612
1622
  contain: "layout style",
1613
1623
  display: "grid",
@@ -1628,31 +1638,31 @@ var pe = class t {
1628
1638
  $end: $
1629
1639
  }, _ = !0;
1630
1640
  }
1631
- I.push(T);
1641
+ P.push(T);
1632
1642
  }
1633
1643
  }
1634
- if (E.push(F), I.length) {
1635
- const e = R && !_ && R.$cells.length === I.length && R.$top === w ? R : {
1644
+ if (E.push(F), P.length) {
1645
+ const e = R && !_ && R.$cells.length === P.length && R.$top === w ? R : {
1636
1646
  $row: o,
1637
- $cells: I,
1638
- $style: Y(o, O, w, "top", 3),
1647
+ $cells: P,
1648
+ $style: U(o, O, w, "top", 3),
1639
1649
  $top: w
1640
1650
  };
1641
- j.set(o, e), D.push(e);
1651
+ W.set(o, e), D.push(e);
1642
1652
  }
1643
1653
  }
1644
- return W.set(e, j), {
1645
- $rowTemplate: X(e, F, E, I(M), "max-content", u),
1646
- $colTemplate: X(t, k, V, I(_), "minmax(max-content,auto)", p),
1647
- $groups: K
1654
+ return B.set(e, W), {
1655
+ $rowTemplate: Y(e, F, E, P(M), "max-content", u),
1656
+ $colTemplate: Y(t, k, V, P(_), "minmax(max-content,auto)", p),
1657
+ $groups: L
1648
1658
  };
1649
- })(this.F, this.k, this.I.$getRange(this.bufferSize()), this.q.$getRange(this.bufferSize()), this.T(), this.sectionRows(), this.keepMounted(), this.ariaSort())));
1659
+ })(this.k, this.O, this.q.$getRange(this.bufferSize()), this.F.$getRange(this.bufferSize()), this.M(), this.sectionRows(), this.keepMounted(), this.ariaSort())));
1650
1660
  rowItem(e) {
1651
- return D(this.rows(), e);
1661
+ return G(this.rows(), e);
1652
1662
  }
1653
1663
  containerStyle=u(() => {
1654
- this.R();
1655
- const {$rowTemplate: e, $colTemplate: t} = this.plan(), i = this.I.$getItemOffset(0), s = this.q.$getItemOffset(0);
1664
+ this.I();
1665
+ const {$rowTemplate: e, $colTemplate: t} = this.plan(), i = this.q.$getItemOffset(0), s = this.F.$getItemOffset(0);
1656
1666
  return {
1657
1667
  contain: "size style",
1658
1668
  "overflow-anchor": "none",
@@ -1663,20 +1673,19 @@ var pe = class t {
1663
1673
  gap: this.gap() + "px",
1664
1674
  "margin-top": i + "px",
1665
1675
  "margin-inline-start": s + "px",
1666
- height: M(this.I) - i + "px",
1667
- "pointer-events": this.I.$isScrolling() || this.q.$isScrolling() ? "none" : void 0
1676
+ height: M(this.q) - i + "px",
1677
+ "pointer-events": this.q.$isScrolling() || this.F.$isScrolling() ? "none" : void 0
1668
1678
  };
1669
1679
  });
1670
1680
  constructor() {
1671
1681
  m(() => {
1672
- const e = this.rows(), t = this.cols(), i = this.headerRows(), s = this.footerRows(), r = this.headerCols(), n = this.footerCols();
1673
- if (!this.I) return;
1674
- const o = this.O(), l = this.C();
1682
+ const e = this.rows(), t = this.cols(), i = this.headerRows(), s = this.footerRows(), n = this.headerCols(), r = this.footerCols();
1683
+ if (!this.q) return;
1684
+ const o = this.C(), l = this.T();
1675
1685
  S(() => {
1676
- this.F.$setPinned(i, s), this.k.$setPinned(r, n);
1677
- const a = K(e), c = K(t);
1678
- a !== this.I.$getItemsLength() && this.I.$update(5, [ a ]), c !== this.q.$getItemsLength() && this.q.$update(5, [ c ]),
1679
- this.I.$update(9, this.F.$relayout(o, this.I.$getVisibleOffset())), this.q.$update(9, this.k.$relayout(l, this.q.$getVisibleOffset()));
1686
+ this.k.$setPinned(i, s), this.O.$setPinned(n, r);
1687
+ const a = D(e), c = D(t);
1688
+ this.q.$update(5, a), this.F.$update(5, c), _(this.q, this.k, o), _(this.F, this.O, l);
1680
1689
  });
1681
1690
  }), a({
1682
1691
  read: () => {
@@ -1684,115 +1693,115 @@ var pe = class t {
1684
1693
  }
1685
1694
  }), c({
1686
1695
  read: () => {
1687
- this.R(), this.driver.$effect();
1696
+ this.I(), this.driver.$effect();
1688
1697
  }
1689
1698
  }), d(s).onDestroy(() => {
1690
- this.I?.$dispose(), this.q?.$dispose(), this.driver?.$dispose();
1699
+ this.q?.$dispose(), this.F?.$dispose(), this.driver?.$dispose();
1691
1700
  });
1692
1701
  }
1693
1702
  ngOnInit() {
1694
- const e = this.N;
1703
+ const e = this.$;
1695
1704
  e.setAttribute("style", "display:block;overflow:auto;contain:strict;width:100%;height:100%;" + (e.getAttribute("style") || ""));
1696
- const t = this.gap(), i = this.F = G(this.rows(), this.rowHeight(), t), s = this.k = G(this.cols(), this.colWidth(), t), r = this.I = _(i), n = this.q = _(s);
1697
- this.driver = ((e, t) => {
1698
- let i, s, r, n = k(), o = !0;
1699
- const l = /* @__PURE__ */ new WeakMap, a = /* @__PURE__ */ new WeakMap, c = U(n => {
1700
- const c = [], u = [];
1701
- for (const {target: p, contentRect: {width: m, height: d}} of n) if (p === i) m || d ? (o || (s.u(),
1702
- r.u()), o = !0, e.$update(4, d), t.$update(4, m)) : o = !1; else if (p.offsetParent) {
1703
- const e = l.get(p), t = a.get(p);
1704
- null != e && c.push([ e, d ]), null != t && u.push([ t, m ]);
1705
+ const t = this.gap(), i = this.k = W(this.rows(), this.rowHeight(), t), s = this.O = W(this.cols(), this.colWidth(), t), n = this.q = V(i), r = this.F = V(s);
1706
+ this.driver = ((e, t, i, s) => {
1707
+ let n, r, o, l = k(), a = !0;
1708
+ const c = /* @__PURE__ */ new WeakMap, u = /* @__PURE__ */ new WeakMap, p = Z(l => {
1709
+ const p = [], m = [];
1710
+ for (const {target: d, contentRect: {width: h, height: f}} of l) if (d === n) h || f ? (a || (r.p(),
1711
+ o.p()), a = !0, e.$update(4, f), t.$update(4, h)) : a = !1; else if (d.offsetParent) {
1712
+ const e = c.get(d), t = u.get(d);
1713
+ null == e || i.$isSizeEqual(e, f) || p.push([ e, f ]), null == t || s.$isSizeEqual(t, h) || m.push([ t, h ]);
1705
1714
  }
1706
- c.length && e.$update(3, c), u.length && t.$update(3, u);
1715
+ e.$update(3, p), t.$update(3, m);
1707
1716
  });
1708
1717
  return {
1709
1718
  async $scroll(e, t) {
1710
- await n[0] && (e ? r : s).m(t);
1719
+ await l[0] && (e ? o : r).h(t);
1711
1720
  },
1712
- $observe(o, l = o.parentElement) {
1713
- c.i(i = l);
1714
- const a = (e, t) => Z(e, l, l, t, t && "rtl" === getComputedStyle(l).direction, () => {
1715
- const e = t ? "overflowX" : "overflowY", i = l.style, s = i[e];
1716
- i[e] = "hidden", x(() => {
1717
- i[e] = s;
1721
+ $observe(a, c = a.parentElement) {
1722
+ p.o(n = c);
1723
+ const u = (e, t, i) => ee(e, t, c, c, i, i && "rtl" === getComputedStyle(c).direction, () => {
1724
+ const e = i ? "overflowX" : "overflowY", t = c.style, s = t[e];
1725
+ t[e] = "hidden", x(() => {
1726
+ t[e] = s;
1718
1727
  });
1719
1728
  });
1720
- s = a(e, !1), r = a(t, !0), n[1](!0);
1729
+ r = u(e, i, !1), o = u(t, s, !0), l[1](!0);
1721
1730
  },
1722
1731
  $dispose() {
1723
- c.l(), s && s.l(), r && r.l(), n[1](!1), n = k();
1732
+ p.u(), r && r.u(), o && o.u(), l[1](!1), l = k();
1724
1733
  },
1725
- $observeItem: (e, t, i) => (null != t && l.set(e, t), null != i && a.set(e, i),
1726
- c.i(e), () => {
1727
- l.delete(e), a.delete(e), c.o(e);
1734
+ $observeItem: (e, t, i) => (null != t && c.set(e, t), null != i && u.set(e, i),
1735
+ p.o(e), () => {
1736
+ c.delete(e), u.delete(e), p.l(e);
1728
1737
  }),
1729
1738
  $effect() {
1730
- s && s.p(), r && r.p();
1739
+ r && r.m(), o && o.m();
1731
1740
  }
1732
1741
  };
1733
- })(r, n);
1742
+ })(n, r, i, s);
1734
1743
  const o = e => {
1735
- this.R.set(r.$getStateVersion() + n.$getStateVersion()), e && this.$.tick();
1744
+ this.I.set(n.$getStateVersion() + r.$getStateVersion()), e && this.R.tick();
1736
1745
  };
1737
- r.$subscribe(1, o), n.$subscribe(1, o);
1746
+ n.$subscribe(1, o), r.$subscribe(1, o);
1738
1747
  let l = !1;
1739
- r.$subscribe(4, () => {
1740
- l = !0, this.verticalScrolled.emit(r.$getScrollOffset());
1741
- }), n.$subscribe(4, () => {
1742
- l = !0, this.horizontalScrolled.emit(n.$getScrollOffset());
1748
+ n.$subscribe(4, () => {
1749
+ l = !0, this.verticalScrolled.emit(n.$getScrollOffset());
1750
+ }), r.$subscribe(4, () => {
1751
+ l = !0, this.horizontalScrolled.emit(r.$getScrollOffset());
1743
1752
  });
1744
1753
  const a = () => {
1745
- !l || r.$isScrolling() || n.$isScrolling() || (l = !1, this.scrollEnded.emit());
1754
+ !l || n.$isScrolling() || r.$isScrolling() || (l = !1, this.scrollEnded.emit());
1746
1755
  };
1747
1756
  let c;
1748
- r.$subscribe(8, a), n.$subscribe(8, a);
1757
+ n.$subscribe(8, a), r.$subscribe(8, a);
1749
1758
  const u = () => {
1750
1759
  c || (c = !0, F(() => {
1751
1760
  c = !1, this.resized.emit();
1752
1761
  }));
1753
1762
  };
1754
- r.$subscribe(2, u), n.$subscribe(2, u), o();
1763
+ n.$subscribe(2, u), r.$subscribe(2, u), o();
1755
1764
  }
1756
1765
  get verticalScrollOffset() {
1757
- return this.I.$getScrollOffset();
1766
+ return this.q.$getScrollOffset();
1758
1767
  }
1759
1768
  get horizontalScrollOffset() {
1760
- return this.q.$getScrollOffset();
1769
+ return this.F.$getScrollOffset();
1761
1770
  }
1762
1771
  get scrollHeight() {
1763
- return M(this.I);
1772
+ return M(this.q);
1764
1773
  }
1765
1774
  get scrollWidth() {
1766
- return M(this.q);
1775
+ return M(this.F);
1767
1776
  }
1768
1777
  get viewportHeight() {
1769
- return this.I.$getViewportSize();
1778
+ return this.q.$getViewportSize();
1770
1779
  }
1771
1780
  get viewportWidth() {
1772
- return this.q.$getViewportSize();
1781
+ return this.F.$getViewportSize();
1773
1782
  }
1774
1783
  findRowIndex(e) {
1775
- return this.F.$findIndex(e);
1784
+ return this.k.$findIndex(e);
1776
1785
  }
1777
1786
  findColIndex(e) {
1778
- return this.k.$findIndex(e);
1787
+ return this.O.$findIndex(e);
1779
1788
  }
1780
1789
  getRowOffset(e) {
1781
- return this.I.$getItemOffset(e);
1790
+ return this.q.$getItemOffset(e);
1782
1791
  }
1783
1792
  getColOffset(e) {
1784
- return this.q.$getItemOffset(e);
1793
+ return this.F.$getItemOffset(e);
1785
1794
  }
1786
1795
  getRowSize(e) {
1787
- return this.I.$getItemSize(e);
1796
+ return this.k.$getItemSize(e);
1788
1797
  }
1789
1798
  getColSize(e) {
1790
- return this.q.$getItemSize(e);
1799
+ return this.O.$getItemSize(e);
1791
1800
  }
1792
1801
  scrollToIndex(e) {
1793
- ((e, t, i, s, r, n = N, {rowIndex: o, colIndex: l, rowAlign: a, colAlign: c}) => {
1794
- null != o && re(e, t, s, n, o, a, !1), null != l && re(e, i, r, N, l, c, !0);
1795
- })(this.driver, this.I, this.q, this.F, this.k, this.sectionRows(), e);
1802
+ ((e, t, i, s, n, r = N, {rowIndex: o, colIndex: l, rowAlign: a, colAlign: c}) => {
1803
+ null != o && re(e, t, s, r, o, a, !1), null != l && re(e, i, n, N, l, c, !0);
1804
+ })(this.driver, this.q, this.F, this.k, this.O, this.sectionRows(), e);
1796
1805
  }
1797
1806
  scrollTo({vertical: e, horizontal: t}) {
1798
1807
  ((e, t, i) => {
@@ -1800,16 +1809,16 @@ var pe = class t {
1800
1809
  })(this.driver, e, t);
1801
1810
  }
1802
1811
  scrollBy({vertical: e, horizontal: t}) {
1803
- ((e, t, i, s, r) => {
1812
+ ((e, t, i, s, n) => {
1804
1813
  if (null != s) {
1805
1814
  const i = s + t.$getScrollOffset();
1806
1815
  e.$scroll(!1, () => i);
1807
1816
  }
1808
- if (null != r) {
1809
- const t = r + i.$getScrollOffset();
1817
+ if (null != n) {
1818
+ const t = n + i.$getScrollOffset();
1810
1819
  e.$scroll(!0, () => t);
1811
1820
  }
1812
- })(this.driver, this.I, this.q, e, t);
1821
+ })(this.driver, this.q, this.F, e, t);
1813
1822
  }
1814
1823
  static ɵfac=/*@__PURE__*/ e.ɵɵngDeclareFactory({
1815
1824
  minVersion: "12.0.0",
@@ -1961,12 +1970,12 @@ var pe = class t {
1961
1970
  isInline: !0,
1962
1971
  dependencies: [ {
1963
1972
  kind: "directive",
1964
- type: e.forwardRef(() => de),
1973
+ type: e.forwardRef(() => he),
1965
1974
  selector: "div[virtuaGridRowGroup]",
1966
1975
  inputs: [ "state", "template", "rows", "cols", "resizer" ]
1967
1976
  }, {
1968
1977
  kind: "directive",
1969
- type: e.forwardRef(() => me),
1978
+ type: e.forwardRef(() => de),
1970
1979
  selector: "div[virtuaGridRow]",
1971
1980
  inputs: [ "state", "template", "row", "cols", "resizer" ]
1972
1981
  } ],
@@ -1976,7 +1985,7 @@ var pe = class t {
1976
1985
 
1977
1986
  i.OnPush, i.OnPush, i.OnPush;
1978
1987
 
1979
- var fe = (e, t) => t ? `calc(${100 * e}% + ${t}px)` : 100 * e + "%", ge = class t {
1988
+ var ge = (e, t) => t ? `calc(${100 * e}% + ${t}px)` : 100 * e + "%", Se = class t {
1980
1989
  index=h.required();
1981
1990
  offset=h.required();
1982
1991
  crossOffset=h.required();
@@ -1992,7 +2001,7 @@ var fe = (e, t) => t ? `calc(${100 * e}% + ${t}px)` : 100 * e + "%", ge = class
1992
2001
  visibility: this.hide() ? "hidden" : void 0
1993
2002
  }));
1994
2003
  constructor() {
1995
- const e = d(r).nativeElement;
2004
+ const e = d(n).nativeElement;
1996
2005
  let t;
1997
2006
  c({
1998
2007
  read: () => {
@@ -2068,9 +2077,9 @@ var fe = (e, t) => t ? `calc(${100 * e}% + ${t}px)` : 100 * e + "%", ge = class
2068
2077
  },
2069
2078
  ngImport: e
2070
2079
  });
2071
- }, Se = class i {
2080
+ }, ye = class i {
2072
2081
  data=h.required();
2073
- getKey=h(oe);
2082
+ getKey=h(le);
2074
2083
  lanes=h.required();
2075
2084
  gap=h();
2076
2085
  itemSize=h();
@@ -2084,25 +2093,25 @@ var fe = (e, t) => t ? `calc(${100 * e}% + ${t}px)` : 100 * e + "%", ge = class
2084
2093
  resized=f();
2085
2094
  template=p.required(l);
2086
2095
  container=y.required("container");
2087
- S;
2088
2096
  v;
2097
+ N;
2089
2098
  driver;
2090
- N=d(r).nativeElement;
2091
- $=d(t);
2092
- R=g(void 0);
2099
+ $=d(n).nativeElement;
2100
+ R=d(t);
2101
+ I=g(void 0);
2093
2102
  P=u(() => {
2094
- this.R();
2095
- const e = this.data().length, [t, i] = this.S.$getRange(this.bufferSize()), s = this.keepMounted(), r = [];
2103
+ this.I();
2104
+ const e = this.data().length, [t, i] = this.v.$getRange(this.bufferSize()), s = this.keepMounted(), n = [];
2096
2105
  if (s) {
2097
- const n = new Set(s);
2098
- for (let e = t; e <= i; e++) n.add(e);
2099
- for (const t of I([ ...n ])) t < e && r.push(t);
2100
- } else for (let e = t; e <= i; e++) r.push(e);
2101
- return r;
2106
+ const r = new Set(s);
2107
+ for (let e = t; e <= i; e++) r.add(e);
2108
+ for (const t of P([ ...r ])) t < e && n.push(t);
2109
+ } else for (let e = t; e <= i; e++) n.push(e);
2110
+ return n;
2102
2111
  });
2103
2112
  items=u(() => {
2104
- this.R();
2105
- const e = this.S, t = this.v, i = this.data(), s = this.getKey(), r = t.$getGap(), n = t.$getLanes(), o = fe(1 / n, r / n - r), l = [];
2113
+ this.I();
2114
+ const e = this.v, t = this.N, i = this.data(), s = this.getKey(), n = t.$getGap(), r = t.$getLanes(), o = ge(1 / r, n / r - n), l = [];
2106
2115
  for (const a of this.P()) {
2107
2116
  const c = i[a], u = t.$getItemLane(a);
2108
2117
  l.push({
@@ -2110,32 +2119,32 @@ var fe = (e, t) => t ? `calc(${100 * e}% + ${t}px)` : 100 * e + "%", ge = class
2110
2119
  index: a,
2111
2120
  data: c,
2112
2121
  offset: e.$getItemOffset(a),
2113
- crossOffset: fe(u / n, u * r / n),
2122
+ crossOffset: ge(u / r, u * n / r),
2114
2123
  crossSize: o,
2115
- hide: e.$isUnmeasuredItem(a)
2124
+ hide: t.$isSizeEqual(a)
2116
2125
  });
2117
2126
  }
2118
2127
  return l;
2119
2128
  });
2120
- containerStyle=u(() => (this.R(), {
2129
+ containerStyle=u(() => (this.I(), {
2121
2130
  contain: "size style",
2122
2131
  "overflow-anchor": "none",
2123
2132
  flex: "none",
2124
2133
  position: "relative",
2125
2134
  width: "100%",
2126
- height: this.S.$getTotalSize() + "px",
2127
- "pointer-events": this.S.$isScrolling() ? "none" : void 0
2135
+ height: this.v.$getTotalSize() + "px",
2136
+ "pointer-events": this.v.$isScrolling() ? "none" : void 0
2128
2137
  }));
2129
2138
  constructor() {
2130
2139
  m(() => {
2131
2140
  const e = this.data();
2132
- this.S && S(() => {
2133
- e.length !== this.S.$getItemsLength() && this.S.$update(5, [ e.length ]);
2141
+ this.v && S(() => {
2142
+ this.v.$update(5, e.length);
2134
2143
  });
2135
2144
  }), m(() => {
2136
2145
  const e = this.lanes(), t = this.gap();
2137
- this.S && S(() => {
2138
- this.S.$update(9, this.v.$relayout(e, t, this.S.$getVisibleOffset()));
2146
+ this.v && S(() => {
2147
+ _(this.v, this.N, e, t);
2139
2148
  });
2140
2149
  }), a({
2141
2150
  read: () => {
@@ -2143,125 +2152,116 @@ var fe = (e, t) => t ? `calc(${100 * e}% + ${t}px)` : 100 * e + "%", ge = class
2143
2152
  }
2144
2153
  }), c({
2145
2154
  read: () => {
2146
- this.R(), this.driver.$effect();
2155
+ this.I(), this.driver.$effect();
2147
2156
  }
2148
2157
  }), d(s).onDestroy(() => {
2149
- this.S?.$dispose(), this.driver?.$dispose();
2158
+ this.v?.$dispose(), this.driver?.$dispose();
2150
2159
  });
2151
2160
  }
2152
2161
  ngOnInit() {
2153
- const e = this.N;
2162
+ const e = this.$;
2154
2163
  e.setAttribute("style", "display:block;overflow-y:auto;contain:strict;width:100%;height:100%;" + (e.getAttribute("style") || ""));
2155
- const t = this.v = ((e, t, i = 0, s, r) => {
2156
- let n = b(t, 1), o = r && r[1] || s || 40, l = -1, a = s ? void 0 : /* @__PURE__ */ new Set, c = !s;
2157
- const u = r && r[0], p = u ? V(u.slice(0, w(e, u.length)), b(0, e - u.length)) : V([], e), m = [], d = [], h = [], f = e => {
2158
- const t = p[e];
2164
+ const t = this.N = ((e, t, i = 0, s, n) => {
2165
+ let r = b(t, 1), o = n && n[1] || s || 40, l = -1, a = s ? void 0 : /* @__PURE__ */ new Set, c = !s;
2166
+ const u = n ? n[0].slice(0, e) : [];
2167
+ E(u, e - u.length);
2168
+ const p = [], m = [], d = [ 0 ], h = e => {
2169
+ const t = u[e];
2159
2170
  return -1 === t ? o : t;
2160
- }, g = t => {
2161
- if (t = w(t, e - 1), l >= t) return;
2162
- const s = [], r = [];
2163
- for (let e = 0; e < n; e++) s.push(0), r.push(-1);
2164
- for (let e = l, t = n; e >= 0 && t; e--) {
2165
- const i = d[e];
2166
- -1 === r[i] && (r[i] = e, s[i] = m[e] + f(e), t--);
2171
+ }, f = () => {
2172
+ if (l >= e - 1) return;
2173
+ const t = [], s = [];
2174
+ for (let e = 0; e < r; e++) t.push(0), s.push(-1);
2175
+ for (let e = l, n = r; e >= 0 && n; e--) {
2176
+ const r = m[e];
2177
+ -1 === s[r] && (s[r] = e, t[r] = p[e] + h(e) + i, n--);
2167
2178
  }
2168
- for (;l < t; ) {
2179
+ for (;l < e - 1; ) {
2169
2180
  const e = ++l;
2170
- let t = 0, o = 1 / 0, a = 1 / 0;
2171
- for (let e = 0; e < n; e++) {
2172
- const n = s[e] + (r[e] >= 0 ? i : 0);
2173
- (n < o || n === o && r[e] < a) && (t = e, o = n, a = r[e]);
2181
+ let n = 0, o = 1 / 0, a = 1 / 0;
2182
+ for (let e = 0; e < r; e++) {
2183
+ const i = t[e];
2184
+ (i < o || i === o && s[e] < a) && (n = e, o = i, a = s[e]);
2174
2185
  }
2175
- m[e] = o, d[e] = t, s[t] = o + f(e), r[t] = e, h[e] = b(e ? h[e - 1] : 0, s[t]);
2186
+ const c = o + h(e);
2187
+ p[e] = o, m[e] = n, t[n] = c + i, s[n] = e, d[e + 1] = b(d[e], c);
2176
2188
  }
2177
- }, S = t => t >= e ? v() : (g(t), m[t]), y = e => (g(e), h[e]), v = () => e ? y(e - 1) : 0, z = t => {
2178
- if (!e) return 0;
2179
- const i = E(y, e, t);
2180
- return y(i) <= t ? i + 1 : i;
2181
- };
2189
+ }, g = t => t >= e ? y() : (f(), p[t]), S = e => (f(), d[e]), y = () => S(e), v = t => K(S, e + 1, t);
2182
2190
  return {
2183
2191
  $getRange: (t, i) => {
2184
- const s = E(S, e, i);
2185
- return [ w(z(t), s), s ];
2192
+ const s = K(g, e, i);
2193
+ return [ w(v(t), s), s ];
2186
2194
  },
2187
- $getItemOffset: S,
2188
- $getItemSize: f,
2189
- $isSizeEqual: (e, t = -1) => p[e] === t,
2190
- $resize: (t, s, r, u) => {
2191
- let m = z(r);
2192
- for (;m > 0 && !s(m - 1); ) m--;
2193
- for (;m < e && s(m); ) m++;
2194
- const d = S(m);
2195
- for (const [e, i] of t) p[e] = i, a && a.add(e), l = w(e - 1, l);
2196
- let h = S(m) - d;
2197
- if (a && u) {
2195
+ $findIndex: v,
2196
+ $getItemOffset: g,
2197
+ $getItemSize: h,
2198
+ $isSizeEqual: (e, t = -1) => u[e] === t,
2199
+ $setItemSizes: (e, t) => {
2200
+ for (const [t, i] of e) u[t] = i, a && a.add(t), l = w(t - 1, l);
2201
+ if (a && t) {
2198
2202
  const e = [];
2199
- let t = 0;
2200
- if (a.forEach(s => {
2201
- const r = p[s];
2202
- r > 0 && (e.push(r), t += r + i);
2203
- }), t > u * n) {
2204
- I(e);
2205
- const t = e.length, i = t / 2 | 0, s = t % 2 == 0 ? (e[i - 1] + e[i]) / 2 : e[i], n = z(r + h), u = S(n);
2206
- o = s, l = -1, h += S(n) - u, a = void 0, c = !1;
2203
+ let s = 0;
2204
+ if (a.forEach(t => {
2205
+ const n = u[t];
2206
+ -1 !== n && n && (e.push(n), s += n + i);
2207
+ }), s > t * r) {
2208
+ P(e);
2209
+ const t = e.length, i = t / 2 | 0;
2210
+ o = t % 2 == 0 ? (e[i - 1] + e[i]) / 2 : e[i], l = -1, a = void 0, c = !1;
2207
2211
  }
2208
2212
  }
2209
- return h;
2210
2213
  },
2211
- $getTotalSize: v,
2214
+ $getTotalSize: y,
2212
2215
  $getLength: () => e,
2213
2216
  $setLength: t => {
2214
2217
  const i = t - e;
2215
- return l = w(t - 1, l), e = t, i > 0 ? V(p, i) : p.splice(i), 0;
2216
- },
2217
- $relayout: (e, t = 0, r) => {
2218
- if ((e = b(e, 1)) === n && t === i) return;
2219
- const o = z(r), c = S(o);
2220
- return n = e, i = t, l = -1, a = s ? void 0 : /* @__PURE__ */ new Set, S(o) - c;
2218
+ l = w(t - 1, l), e = t, i > 0 ? E(u, i) : u.splice(i);
2221
2219
  },
2220
+ $relayout: (e, t = 0) => ((e = b(e, 1)) !== r || t !== i) && (r = e, i = t, l = -1,
2221
+ a = s ? void 0 : /* @__PURE__ */ new Set, !0),
2222
2222
  $isEstimating: () => c,
2223
- $snapshot: () => [ p.slice(), o ],
2224
- $getLanes: () => n,
2223
+ $snapshot: () => [ u.slice(), o ],
2224
+ $getLanes: () => r,
2225
2225
  $getGap: () => i,
2226
- $getItemLane: e => (g(e), d[e])
2226
+ $getItemLane: e => (f(), m[e])
2227
2227
  };
2228
- })(this.data().length, this.lanes(), this.gap(), this.itemSize(), this.cacheProp()), i = this.S = _(t);
2229
- this.driver = ee(i, !1), i.$subscribe(1, e => {
2230
- this.R.set(i.$getStateVersion()), e && this.$.tick();
2228
+ })(this.data().length, this.lanes(), this.gap(), this.itemSize(), this.cacheProp()), i = this.v = V(t);
2229
+ this.driver = te(i, t, !1), i.$subscribe(1, e => {
2230
+ this.I.set(i.$getStateVersion()), e && this.R.tick();
2231
2231
  }), i.$subscribe(4, () => {
2232
2232
  this.scrolled.emit(i.$getScrollOffset());
2233
2233
  }), i.$subscribe(8, () => {
2234
2234
  this.scrollEnded.emit();
2235
2235
  }), i.$subscribe(2, () => {
2236
2236
  this.resized.emit();
2237
- }), this.R.set(i.$getStateVersion());
2237
+ }), this.I.set(i.$getStateVersion());
2238
2238
  }
2239
2239
  get cache() {
2240
- return this.v.$snapshot();
2240
+ return this.N.$snapshot();
2241
2241
  }
2242
2242
  get scrollOffset() {
2243
- return this.S.$getScrollOffset();
2243
+ return this.v.$getScrollOffset();
2244
2244
  }
2245
2245
  get scrollSize() {
2246
- return M(this.S);
2246
+ return M(this.v);
2247
2247
  }
2248
2248
  get viewportSize() {
2249
- return this.S.$getViewportSize();
2249
+ return this.v.$getViewportSize();
2250
2250
  }
2251
2251
  getItemOffset(e) {
2252
- return this.S.$getItemOffset(e);
2252
+ return this.v.$getItemOffset(e);
2253
2253
  }
2254
2254
  getItemSize(e) {
2255
- return this.S.$getItemSize(e);
2255
+ return this.N.$getItemSize(e);
2256
2256
  }
2257
2257
  scrollToIndex(e, t) {
2258
- se(this.driver, this.S, e, t);
2258
+ ne(this.driver, this.v, this.N, e, t);
2259
2259
  }
2260
2260
  scrollTo(e) {
2261
- te(this.driver, e);
2261
+ ie(this.driver, e);
2262
2262
  }
2263
2263
  scrollBy(e) {
2264
- ie(this.driver, this.S, e);
2264
+ se(this.driver, this.v, e);
2265
2265
  }
2266
2266
  static ɵfac=/*@__PURE__*/ e.ɵɵngDeclareFactory({
2267
2267
  minVersion: "12.0.0",
@@ -2361,7 +2361,7 @@ var fe = (e, t) => t ? `calc(${100 * e}% + ${t}px)` : 100 * e + "%", ge = class
2361
2361
  isInline: !0,
2362
2362
  dependencies: [ {
2363
2363
  kind: "directive",
2364
- type: e.forwardRef(() => ge),
2364
+ type: e.forwardRef(() => Se),
2365
2365
  selector: "div[virtuaMasonryItem]",
2366
2366
  inputs: [ "index", "offset", "crossOffset", "crossSize", "hide", "resizer" ]
2367
2367
  }, {
@@ -2376,5 +2376,5 @@ var fe = (e, t) => t ? `calc(${100 * e}% + ${t}px)` : 100 * e + "%", ge = class
2376
2376
 
2377
2377
  i.OnPush;
2378
2378
 
2379
- export { he as VGrid, ce as VList, Se as VMasonry, ae as Virtualizer, ue as WindowVirtualizer };
2379
+ export { fe as VGrid, ue as VList, ye as VMasonry, ce as Virtualizer, pe as WindowVirtualizer };
2380
2380
  //# sourceMappingURL=index.js.map