virtua 0.48.8 → 0.49.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/lib/index.cjs CHANGED
@@ -1,13 +1,13 @@
1
1
  "use client";
2
2
  var e = require("react/jsx-runtime"), t = require("react"), o = require("react-dom");
3
3
 
4
- const n = null, {min: r, max: s, abs: i, floor: l} = Math, c = (e, t, o) => r(o, s(t, e)), f = e => [ ...e ].sort(((e, t) => e - t)), u = "function" == typeof queueMicrotask ? queueMicrotask : e => {
4
+ const n = null, {min: r, max: s, abs: i, floor: l} = Math, c = (e, t, o) => r(o, s(t, e)), f = e => [ ...e ].sort((e, t) => e - t), u = "function" == typeof queueMicrotask ? queueMicrotask : e => {
5
5
  Promise.resolve().then(e);
6
6
  }, d = () => {
7
7
  let e;
8
- return [ new Promise((t => {
8
+ return [ new Promise(t => {
9
9
  e = t;
10
- })), e ];
10
+ }), e ];
11
11
  }, a = e => {
12
12
  let t;
13
13
  return () => (e && (t = e(), e = void 0), t);
@@ -38,8 +38,8 @@ const n = null, {min: r, max: s, abs: i, floor: l} = Math, c = (e, t, o) => r(o,
38
38
  }, w = (e, t, o) => {
39
39
  const n = t - e.l;
40
40
  return e.i = o ? -1 : r(t - 1, e.i), e.l = t, n > 0 ? (h(e.u, n), h(e.t, n, o),
41
- e.o * n) : (e.u.splice(n), (o ? e.t.splice(0, -n) : e.t.splice(n)).reduce(((t, o) => t - (-1 === o ? e.o : o)), 0));
42
- }, S = "undefined" != typeof window, m = e => e.documentElement, $ = e => e.ownerDocument, z = e => e.defaultView, y = /*#__PURE__*/ a((() => !!/iP(hone|od|ad)/.test(navigator.userAgent) || "MacIntel" === navigator.platform && navigator.maxTouchPoints > 0)), b = /*#__PURE__*/ a((() => "scrollBehavior" in m(document).style)), x = e => s(e.h(), e.p()), I = (e, t = 40, o = 0, l, c = !1) => {
41
+ e.o * n) : (e.u.splice(n), (o ? e.t.splice(0, -n) : e.t.splice(n)).reduce((t, o) => t - (-1 === o ? e.o : o), 0));
42
+ }, S = "undefined" != typeof window, m = e => e.documentElement, $ = e => e.ownerDocument, z = e => e.defaultView, y = /*#__PURE__*/ a(() => !!/iP(hone|od|ad)/.test(navigator.userAgent) || "MacIntel" === navigator.platform && navigator.maxTouchPoints > 0), b = /*#__PURE__*/ a(() => "scrollBehavior" in m(document).style), x = e => s(e.h(), e.p()), I = (e, t = 40, o = 0, l, c = !1) => {
43
43
  let u = !!o, d = 1, a = 0, S = 0, m = 0, $ = 0, z = 0, b = 0, x = 0, I = 0, k = n, R = [ 0, u ? s(o - 1, 0) : -1 ], T = 0, C = !1;
44
44
  const M = ((e, t, o) => ({
45
45
  o: t,
@@ -116,16 +116,16 @@ const n = null, {min: r, max: s, abs: i, floor: l} = Math, c = (e, t, o) => r(o,
116
116
 
117
117
  case 3:
118
118
  {
119
- const e = t.filter((([e, t]) => !A(e, t)));
119
+ const e = t.filter(([e, t]) => !A(e, t));
120
120
  if (!e.length) break;
121
- L(e.reduce(((e, [t, o]) => {
121
+ L(e.reduce((e, [t, o]) => {
122
122
  let n;
123
123
  if (2 === I) n = !0; else if (k && 1 === I) n = t < k[0]; else {
124
124
  const e = E(), o = B(t), r = J(t);
125
125
  n = 1 !== x && 0 === I ? o + r < e : o < e && o + r < e + a;
126
126
  }
127
127
  return n && (e += o - J(t)), e;
128
- }), 0));
128
+ }, 0));
129
129
  for (const [t, o] of e) {
130
130
  const e = J(t), n = p(M, t, o);
131
131
  c && (T += n ? o : o - e);
@@ -133,9 +133,9 @@ const n = null, {min: r, max: s, abs: i, floor: l} = Math, c = (e, t, o) => r(o,
133
133
  c && a && T > a && (L(((e, t) => {
134
134
  let o = 0;
135
135
  const n = [];
136
- e.t.forEach(((e, r) => {
136
+ e.t.forEach((e, r) => {
137
137
  -1 !== e && (n.push(e), r < t && o++);
138
- })), e.i = -1;
138
+ }), e.i = -1;
139
139
  const r = f(n), i = r.length, l = i / 2 | 0, c = i % 2 == 0 ? (r[l - 1] + r[l]) / 2 : r[l], u = e.o;
140
140
  return ((e.o = c) - u) * s(t - o, 0);
141
141
  })(M, _(M, H()))), c = !1), l = 3, r = !0;
@@ -161,9 +161,9 @@ const n = null, {min: r, max: s, abs: i, floor: l} = Math, c = (e, t, o) => r(o,
161
161
  case 8:
162
162
  k = W(t, t + a), l = 1;
163
163
  }
164
- l && (d = 1 + (2147483647 & d), o && z && ($ += z, z = 0), O.forEach((([e, t]) => {
164
+ l && (d = 1 + (2147483647 & d), o && z && ($ += z, z = 0), O.forEach(([e, t]) => {
165
165
  l & e && t(r);
166
- })));
166
+ }));
167
167
  }
168
168
  };
169
169
  }, k = setTimeout, R = (e, t) => t ? -e : e, T = (e, t, o, r, s, i) => {
@@ -174,12 +174,12 @@ const n = null, {min: r, max: s, abs: i, floor: l} = Math, c = (e, t, o) => r(o,
174
174
  const o = () => {
175
175
  t != n && clearTimeout(t);
176
176
  }, r = () => {
177
- o(), t = k((() => {
177
+ o(), t = k(() => {
178
178
  t = n, (() => {
179
179
  if (f || u) return f = !1, void h();
180
180
  d = !1, e.q(2);
181
181
  })();
182
- }), 150);
182
+ }, 150);
183
183
  };
184
184
  return r.B = o, r;
185
185
  })(), g = () => {
@@ -218,11 +218,11 @@ const n = null, {min: r, max: s, abs: i, floor: l} = Math, c = (e, t, o) => r(o,
218
218
  const [t, o] = d();
219
219
  return n = () => {
220
220
  o(!1);
221
- }, e.p() && k(n, 150), [ t, e.W(2, (() => {
221
+ }, e.p() && k(n, 150), [ t, e.W(2, () => {
222
222
  o(!0);
223
- })) ];
223
+ }) ];
224
224
  };
225
- if (s && b()) e.q(8, r()), u((async () => {
225
+ if (s && b()) e.q(8, r()), u(async () => {
226
226
  for (;;) {
227
227
  let t = !0;
228
228
  for (let [o, n] = e.m(); o <= n; o++) if (e.I(o)) {
@@ -238,7 +238,7 @@ const n = null, {min: r, max: s, abs: i, floor: l} = Math, c = (e, t, o) => r(o,
238
238
  }
239
239
  }
240
240
  e.q(7), o(r(), s);
241
- })); else for (;;) {
241
+ }); else for (;;) {
242
242
  const [t, n] = i();
243
243
  try {
244
244
  if (e.q(7), o(r()), !await t) return;
@@ -251,33 +251,33 @@ const n = null, {min: r, max: s, abs: i, floor: l} = Math, c = (e, t, o) => r(o,
251
251
  } ];
252
252
  }, M = (e, t) => {
253
253
  let o, n, r = d(), s = !1;
254
- const i = t ? "scrollLeft" : "scrollTop", l = t ? "overflowX" : "overflowY", [f, u] = C(e, (() => r[0]), ((e, n) => {
254
+ const i = t ? "scrollLeft" : "scrollTop", l = t ? "overflowX" : "overflowY", [f, u] = C(e, () => r[0], (e, n) => {
255
255
  e = R(e, s), n ? o.scrollTo({
256
256
  [t ? "left" : "top"]: e,
257
257
  behavior: "smooth"
258
258
  }) : o[i] = e;
259
- }));
259
+ });
260
260
  return {
261
261
  L(c, f) {
262
- o = f, t && (s = "rtl" === getComputedStyle(f).direction), n = T(e, f, t, (() => R(f[i], s)), ((t, o, n) => {
262
+ o = f, t && (s = "rtl" === getComputedStyle(f).direction), n = T(e, f, t, () => R(f[i], s), (t, o, n) => {
263
263
  if (n) {
264
264
  const e = f.style, t = e[l];
265
- e[l] = "hidden", k((() => {
265
+ e[l] = "hidden", k(() => {
266
266
  e[l] = t;
267
- }));
267
+ });
268
268
  }
269
269
  f[i] = R(e.C() + t, s), o && u();
270
- })), r[1](!0);
270
+ }), r[1](!0);
271
271
  },
272
272
  v() {
273
273
  n && n.J(), r[1](!1), r = d();
274
274
  },
275
275
  N: () => s,
276
276
  P(e) {
277
- f((() => e));
277
+ f(() => e);
278
278
  },
279
279
  X(t) {
280
- t += e.C(), f((() => t));
280
+ t += e.C(), f(() => t);
281
281
  },
282
282
  Y(t, {align: o, smooth: n, offset: r = 0} = {}) {
283
283
  if (t = c(t, 0, e.T() - 1), "nearest" === o) {
@@ -287,7 +287,7 @@ const n = null, {min: r, max: s, abs: i, floor: l} = Math, c = (e, t, o) => r(o,
287
287
  o = "end";
288
288
  }
289
289
  }
290
- f((() => r + e.O() + e.k(t) + ("end" === o ? e.R(t) - e.p() : "center" === o ? (e.R(t) - e.p()) / 2 : 0)), n);
290
+ f(() => r + e.O() + e.k(t) + ("end" === o ? e.R(t) - e.p() : "center" === o ? (e.R(t) - e.p()) / 2 : 0), n);
291
291
  },
292
292
  D: () => {
293
293
  n && n.A();
@@ -295,7 +295,7 @@ const n = null, {min: r, max: s, abs: i, floor: l} = Math, c = (e, t, o) => r(o,
295
295
  };
296
296
  }, O = (e, t) => {
297
297
  let o, n, r = d(), s = !1;
298
- const i = t ? "left" : "top", [l] = C(e, (() => r[0]), ((e, t) => {
298
+ const i = t ? "left" : "top", [l] = C(e, () => r[0], (e, t) => {
299
299
  e = R(e, s);
300
300
  const n = z($(o));
301
301
  t ? n.scroll({
@@ -304,7 +304,7 @@ const n = null, {min: r, max: s, abs: i, floor: l} = Math, c = (e, t, o) => r(o,
304
304
  }) : n.scroll({
305
305
  [i]: e
306
306
  });
307
- })), f = (e, t, o, n, r = 0) => {
307
+ }), f = (e, t, o, n, r = 0) => {
308
308
  const i = n ? "offsetLeft" : "offsetTop", l = r + (n && s ? o.innerWidth - e[i] - e.offsetWidth : e[i]), c = e.offsetParent;
309
309
  return e !== t && c ? f(c, t, o, n, l) : l;
310
310
  };
@@ -312,13 +312,13 @@ const n = null, {min: r, max: s, abs: i, floor: l} = Math, c = (e, t, o) => r(o,
312
312
  L(l) {
313
313
  o = l;
314
314
  const c = t ? "scrollX" : "scrollY", u = $(l), d = z(u);
315
- t && (s = "rtl" === getComputedStyle(m(u)).direction), n = T(e, d, t, (() => R(d[c], s)), ((t, o) => {
315
+ t && (s = "rtl" === getComputedStyle(m(u)).direction), n = T(e, d, t, () => R(d[c], s), (t, o) => {
316
316
  o ? d.scroll({
317
317
  [i]: R(e.C() + t, s)
318
318
  }) : d.scrollBy({
319
319
  [i]: R(t, s)
320
320
  });
321
- }), (() => f(l, u.body, d, t))), r[1](!0);
321
+ }, () => f(l, u.body, d, t)), r[1](!0);
322
322
  },
323
323
  v() {
324
324
  n && n.J(), o = void 0, r[1](!1), r = d();
@@ -337,7 +337,7 @@ const n = null, {min: r, max: s, abs: i, floor: l} = Math, c = (e, t, o) => r(o,
337
337
  }
338
338
  }
339
339
  const u = $(o), d = z(u), a = m(u), h = () => e.p() - (t ? a.clientWidth : a.clientHeight);
340
- l((() => i + f(o, u.body, d, t) + e.k(n) + ("end" === r ? e.R(n) - (e.p() - h()) : "center" === r ? (e.R(n) - (e.p() - h())) / 2 : 0)), s);
340
+ l(() => i + f(o, u.body, d, t) + e.k(n) + ("end" === r ? e.R(n) - (e.p() - h()) : "center" === r ? (e.R(n) - (e.p() - h())) / 2 : 0), s);
341
341
  }
342
342
  };
343
343
  }, E = (e, t) => {
@@ -378,14 +378,14 @@ const n = null, {min: r, max: s, abs: i, floor: l} = Math, c = (e, t, o) => r(o,
378
378
  };
379
379
  }, W = (e, t) => {
380
380
  let o;
381
- const r = t ? "width" : "height", s = new WeakMap, i = H((t => {
381
+ const r = t ? "width" : "height", s = new WeakMap, i = H(t => {
382
382
  const i = [];
383
383
  for (const {target: l, contentRect: c} of t) if (l.offsetParent) if (l === o) e.q(4, c[r]); else {
384
384
  const e = s.get(l);
385
385
  e != n && i.push([ e, c[r] ]);
386
386
  }
387
387
  i.length && e.q(3, i);
388
- }));
388
+ });
389
389
  return {
390
390
  U(e) {
391
391
  i.V(o = e);
@@ -396,7 +396,7 @@ const n = null, {min: r, max: s, abs: i, floor: l} = Math, c = (e, t, o) => r(o,
396
396
  v: i.J
397
397
  };
398
398
  }, q = (e, t) => {
399
- const o = t ? "width" : "height", r = t ? "innerWidth" : "innerHeight", s = new WeakMap, i = H((t => {
399
+ const o = t ? "width" : "height", r = t ? "innerWidth" : "innerHeight", s = new WeakMap, i = H(t => {
400
400
  const r = [];
401
401
  for (const {target: e, contentRect: i} of t) {
402
402
  if (!e.offsetParent) continue;
@@ -404,7 +404,7 @@ const n = null, {min: r, max: s, abs: i, floor: l} = Math, c = (e, t, o) => r(o,
404
404
  t != n && r.push([ t, i[o] ]);
405
405
  }
406
406
  r.length && e.q(3, r);
407
- }));
407
+ });
408
408
  let l;
409
409
  return {
410
410
  U(t) {
@@ -424,7 +424,7 @@ const n = null, {min: r, max: s, abs: i, floor: l} = Math, c = (e, t, o) => r(o,
424
424
  };
425
425
  }, B = (e, t) => {
426
426
  let o;
427
- const n = new WeakMap, r = new Set, i = new Set, l = new Map, c = (e, t) => `${e}-${t}`, f = H((f => {
427
+ const n = new WeakMap, r = new Set, i = new Set, l = new Map, c = (e, t) => `${e}-${t}`, f = H(f => {
428
428
  const u = new Set, d = new Set;
429
429
  for (const {target: r, contentRect: {width: s, height: i}} of f) if (r.offsetParent) if (r === o) e.q(4, i),
430
430
  t.q(4, s); else {
@@ -438,25 +438,25 @@ const n = null, {min: r, max: s, abs: i, floor: l} = Math, c = (e, t, o) => r(o,
438
438
  }
439
439
  if (u.size) {
440
440
  const t = [];
441
- u.forEach((e => {
441
+ u.forEach(e => {
442
442
  let o = 0;
443
- i.forEach((t => {
443
+ i.forEach(t => {
444
444
  const n = l.get(c(e, t));
445
445
  n && (o = s(o, n[0]));
446
- })), o && t.push([ e, o ]);
447
- })), e.q(3, t);
446
+ }), o && t.push([ e, o ]);
447
+ }), e.q(3, t);
448
448
  }
449
449
  if (d.size) {
450
450
  const e = [];
451
- d.forEach((t => {
451
+ d.forEach(t => {
452
452
  let o = 0;
453
- r.forEach((e => {
453
+ r.forEach(e => {
454
454
  const n = l.get(c(e, t));
455
455
  n && (o = s(o, n[1]));
456
- })), o && e.push([ t, o ]);
457
- })), t.q(3, e);
456
+ }), o && e.push([ t, o ]);
457
+ }), t.q(3, e);
458
458
  }
459
- }));
459
+ });
460
460
  return {
461
461
  U(e) {
462
462
  f.V(o = e);
@@ -484,13 +484,13 @@ const n = null, {min: r, max: s, abs: i, floor: l} = Math, c = (e, t, o) => r(o,
484
484
  return o[A] || (o[A] = e());
485
485
  }, X = e => {
486
486
  const o = t.useRef(e);
487
- return J((() => {
487
+ return J(() => {
488
488
  o[A] = e;
489
- }), [ e ]), o;
490
- }, Y = t.memo((({Z: o, ee: n, te: r, oe: s, ne: i, re: l, se: c, ie: f}) => {
489
+ }, [ e ]), o;
490
+ }, Y = t.memo(({Z: o, ee: n, te: r, oe: s, ne: i, re: l, se: c, ie: f}) => {
491
491
  const u = t.useRef(null);
492
- J((() => n(u[A], r)), [ r ]);
493
- const d = t.useMemo((() => {
492
+ J(() => n(u[A], r), [ r ]);
493
+ const d = t.useMemo(() => {
494
494
  const e = {
495
495
  contain: "layout style",
496
496
  position: i && f ? void 0 : "absolute",
@@ -500,7 +500,7 @@ const n = null, {min: r, max: s, abs: i, floor: l} = Math, c = (e, t, o) => r(o,
500
500
  visibility: !i || f ? void 0 : "hidden"
501
501
  };
502
502
  return c && (e.display = "inline-flex"), e;
503
- }), [ s, i, f, c ]);
503
+ }, [ s, i, f, c ]);
504
504
  return "string" == typeof l ? e.jsx(l, {
505
505
  ref: u,
506
506
  style: d,
@@ -511,18 +511,18 @@ const n = null, {min: r, max: s, abs: i, floor: l} = Math, c = (e, t, o) => r(o,
511
511
  index: r,
512
512
  children: o
513
513
  });
514
- })), D = (e, o) => t.useMemo((() => {
514
+ }), D = (e, o) => t.useMemo(() => {
515
515
  if ("function" == typeof e) return [ t => e(o[t], t), o.length ];
516
516
  const t = (e => {
517
517
  const t = [];
518
518
  return L(e, t), t;
519
519
  })(e);
520
520
  return [ e => t[e], t.length ];
521
- }), [ e, o ]), V = t.forwardRef((({children: n, data: r, bufferSize: s, itemSize: i, shift: l, horizontal: c, keepMounted: d, cache: a, startMargin: h = 0, ssrCount: g, as: p = "div", item: v = "div", scrollRef: _, onScroll: w, onScrollEnd: S}, m) => {
522
- const [$, z] = D(n, r), y = t.useRef(null), b = t.useRef(!!g), k = X(w), R = X(S), [T, C, O, E] = P((() => {
521
+ }, [ e, o ]), V = t.forwardRef(({children: n, data: r, bufferSize: s, itemSize: i, shift: l, horizontal: c, keepMounted: d, cache: a, startMargin: h = 0, ssrCount: g, as: p = "div", item: v = "div", scrollRef: _, onScroll: w, onScrollEnd: S}, m) => {
522
+ const [$, z] = D(n, r), y = t.useRef(null), b = t.useRef(!!g), k = X(w), R = X(S), [T, C, O, E] = P(() => {
523
523
  const e = !!c, t = I(z, i, g, a, !i);
524
524
  return [ t, W(t, e), M(t, e), e ];
525
- }));
525
+ });
526
526
  z !== T.T() && T.q(5, [ z, l ]), h !== T.O() && T.q(6, h);
527
527
  const [H, q] = t.useReducer(T._, void 0, T._), B = T.M(), L = T.h(), V = O.N(), j = [], U = t => {
528
528
  const o = $(t);
@@ -537,25 +537,25 @@ const n = null, {min: r, max: s, abs: i, floor: l} = Math, c = (e, t, o) => r(o,
537
537
  ie: b[A]
538
538
  }, N(o, t));
539
539
  };
540
- if (J((() => {
541
- b[A] = !1, T.W(1, (e => {
540
+ if (J(() => {
541
+ b[A] = !1, T.W(1, e => {
542
542
  e ? o.flushSync(q) : q();
543
- })), T.W(4, (() => {
543
+ }), T.W(4, () => {
544
544
  k[A] && k[A](T.C());
545
- })), T.W(8, (() => {
545
+ }), T.W(8, () => {
546
546
  R[A] && R[A]();
547
- }));
547
+ });
548
548
  const e = y[A], t = t => {
549
549
  C.U(t), O.L(e, t);
550
550
  };
551
- return _ ? u((() => {
551
+ return _ ? u(() => {
552
552
  _[A] && t(_[A]);
553
- })) : t(e.parentElement), () => {
553
+ }) : t(e.parentElement), () => {
554
554
  T.v(), C.v(), O.v();
555
555
  };
556
- }), []), J((() => {
556
+ }, []), J(() => {
557
557
  O.D();
558
- }), [ H ]), t.useImperativeHandle(m, (() => ({
558
+ }, [ H ]), t.useImperativeHandle(m, () => ({
559
559
  get cache() {
560
560
  return T.S();
561
561
  },
@@ -574,12 +574,12 @@ const n = null, {min: r, max: s, abs: i, floor: l} = Math, c = (e, t, o) => r(o,
574
574
  scrollToIndex: O.Y,
575
575
  scrollTo: O.P,
576
576
  scrollBy: O.X
577
- })), []), d) {
577
+ }), []), d) {
578
578
  const e = new Set(d);
579
579
  for (let [t, o] = T.m(s); t <= o; t++) e.add(t);
580
- f([ ...e ]).forEach((e => {
580
+ f([ ...e ]).forEach(e => {
581
581
  j.push(U(e));
582
- }));
582
+ });
583
583
  } else for (let [e, t] = T.m(s); e <= t; e++) j.push(U(e));
584
584
  return e.jsx(p, {
585
585
  ref: y,
@@ -594,7 +594,7 @@ const n = null, {min: r, max: s, abs: i, floor: l} = Math, c = (e, t, o) => r(o,
594
594
  },
595
595
  children: j
596
596
  });
597
- })), j = t.forwardRef((({children: t, data: o, bufferSize: n, itemSize: r, shift: s, horizontal: i, keepMounted: l, cache: c, ssrCount: f, item: u, onScroll: d, onScrollEnd: a, style: h, ...g}, p) => e.jsx("div", {
597
+ }), j = t.forwardRef(({children: t, data: o, bufferSize: n, itemSize: r, shift: s, horizontal: i, keepMounted: l, cache: c, ssrCount: f, item: u, onScroll: d, onScrollEnd: a, style: h, ...g}, p) => e.jsx("div", {
598
598
  ...g,
599
599
  style: {
600
600
  display: i ? "inline-block" : "block",
@@ -619,28 +619,28 @@ const n = null, {min: r, max: s, abs: i, floor: l} = Math, c = (e, t, o) => r(o,
619
619
  onScrollEnd: a,
620
620
  children: t
621
621
  })
622
- }))), U = t.forwardRef((({children: n, data: r, bufferSize: s, itemSize: i, shift: l, horizontal: c, cache: f, ssrCount: u, as: d = "div", item: a = "div", onScroll: h, onScrollEnd: g}, p) => {
623
- const [v, _] = D(n, r), w = t.useRef(null), S = X(h), m = X(g), $ = t.useRef(!!u), [z, y, b, x] = P((() => {
622
+ })), U = t.forwardRef(({children: n, data: r, bufferSize: s, itemSize: i, shift: l, horizontal: c, cache: f, ssrCount: u, as: d = "div", item: a = "div", onScroll: h, onScrollEnd: g}, p) => {
623
+ const [v, _] = D(n, r), w = t.useRef(null), S = X(h), m = X(g), $ = t.useRef(!!u), [z, y, b, x] = P(() => {
624
624
  const e = !!c, t = I(_, i, u, f, !i);
625
625
  return [ t, q(t, e), O(t, e), e ];
626
- }));
626
+ });
627
627
  _ !== z.T() && z.q(5, [ _, l ]);
628
628
  const [k, R] = t.useReducer(z._, void 0, z._), T = z.M(), C = z.h(), M = b.N(), E = [];
629
- J((() => {
630
- $[A] = !1, z.W(1, (e => {
629
+ J(() => {
630
+ $[A] = !1, z.W(1, e => {
631
631
  e ? o.flushSync(R) : R();
632
- })), z.W(4, (() => {
632
+ }), z.W(4, () => {
633
633
  S[A] && S[A]();
634
- })), z.W(8, (() => {
634
+ }), z.W(8, () => {
635
635
  m[A] && m[A]();
636
- }));
636
+ });
637
637
  const e = w[A];
638
638
  return y.U(e), b.L(e), () => {
639
639
  z.v(), y.v(), b.v();
640
640
  };
641
- }), []), J((() => {
641
+ }, []), J(() => {
642
642
  b.D();
643
- }), [ k ]), t.useImperativeHandle(p, (() => ({
643
+ }, [ k ]), t.useImperativeHandle(p, () => ({
644
644
  get cache() {
645
645
  return z.S();
646
646
  },
@@ -654,7 +654,7 @@ const n = null, {min: r, max: s, abs: i, floor: l} = Math, c = (e, t, o) => r(o,
654
654
  getItemOffset: z.k,
655
655
  getItemSize: z.R,
656
656
  scrollToIndex: b.Y
657
- })), []);
657
+ }), []);
658
658
  for (let [t, o] = z.m(s); t <= o; t++) {
659
659
  const o = v(t);
660
660
  E.push(e.jsx(Y, {
@@ -681,11 +681,11 @@ const n = null, {min: r, max: s, abs: i, floor: l} = Math, c = (e, t, o) => r(o,
681
681
  },
682
682
  children: E
683
683
  });
684
- })), F = (e, t) => `${e}-${t}`, G = t.memo((({Z: o, ee: n, le: r, ce: s, fe: i, ue: l, de: c, ae: f, ne: u, he: d}) => {
684
+ }), F = (e, t) => `${e}-${t}`, G = t.memo(({Z: o, ee: n, le: r, ce: s, fe: i, ue: l, de: c, ae: f, ne: u, he: d}) => {
685
685
  const a = t.useRef(null);
686
- return J((() => n.F(a[A], r, s)), [ s, r ]), e.jsx(d, {
686
+ return J(() => n.F(a[A], r, s), [ s, r ]), e.jsx(d, {
687
687
  ref: a,
688
- style: t.useMemo((() => ({
688
+ style: t.useMemo(() => ({
689
689
  contain: "layout style",
690
690
  display: "grid",
691
691
  position: "absolute",
@@ -694,33 +694,33 @@ const n = null, {min: r, max: s, abs: i, floor: l} = Math, c = (e, t, o) => r(o,
694
694
  visibility: u ? "hidden" : void 0,
695
695
  minHeight: c,
696
696
  minWidth: f
697
- })), [ i, l, f, c, u ]),
697
+ }), [ i, l, f, c, u ]),
698
698
  children: o
699
699
  });
700
- })), K = t.forwardRef((({children: n, row: r, col: s, cellHeight: i = 40, cellWidth: l = 100, bufferSize: c, ssrRowCount: f, ssrColCount: u, item: d = "div", domRef: a, innerDomRef: h, onScroll: g, onScrollEnd: p, style: v, ..._}, w) => {
701
- const [S, m, $, z] = P((() => {
700
+ }), K = t.forwardRef(({children: n, row: r, col: s, cellHeight: i = 40, cellWidth: l = 100, bufferSize: c, ssrRowCount: f, ssrColCount: u, item: d = "div", domRef: a, innerDomRef: h, onScroll: g, onScrollEnd: p, style: v, ..._}, w) => {
701
+ const [S, m, $, z] = P(() => {
702
702
  const e = I(r, i, f), t = I(s, l, u);
703
703
  return [ e, t, B(e, t), E(e, t) ];
704
- }));
704
+ });
705
705
  r !== S.T() && S.q(5, [ r ]), s !== m.T() && m.q(5, [ s ]);
706
706
  const [y, b] = t.useReducer(S._, void 0, S._), [k, R] = t.useReducer(m._, void 0, m._), T = S.M(), C = m.M(), M = x(S), O = x(m), H = t.useRef(null), W = X(g), q = X(p);
707
- J((() => {
708
- S.W(1, (e => {
707
+ J(() => {
708
+ S.W(1, e => {
709
709
  e ? o.flushSync(b) : b();
710
- })), m.W(1, (e => {
710
+ }), m.W(1, e => {
711
711
  e ? o.flushSync(R) : R();
712
- })), S.W(4, (() => {
712
+ }), S.W(4, () => {
713
713
  W[A] && W[A](S.C());
714
- })), S.W(8, (() => {
714
+ }), S.W(8, () => {
715
715
  q[A] && q[A]();
716
- }));
716
+ });
717
717
  const e = H[A], t = e.parentElement;
718
718
  return $.U(t), z.L(e, t), () => {
719
719
  S.v(), m.v(), $.v(), z.v();
720
720
  };
721
- }), []), J((() => {
721
+ }, []), J(() => {
722
722
  z.D();
723
- }), [ y, k ]), t.useImperativeHandle(w, (() => ({
723
+ }, [ y, k ]), t.useImperativeHandle(w, () => ({
724
724
  get scrollTop() {
725
725
  return S.C();
726
726
  },
@@ -754,8 +754,8 @@ const n = null, {min: r, max: s, abs: i, floor: l} = Math, c = (e, t, o) => r(o,
754
754
  scrollToIndex: z.Y,
755
755
  scrollTo: z.P,
756
756
  scrollBy: z.X
757
- })), []);
758
- const L = t.useMemo((() => {
757
+ }), []);
758
+ const L = t.useMemo(() => {
759
759
  const e = new Map;
760
760
  return (t, o) => {
761
761
  let r = e.get(F(t, o));
@@ -764,7 +764,7 @@ const n = null, {min: r, max: s, abs: i, floor: l} = Math, c = (e, t, o) => r(o,
764
764
  colIndex: o
765
765
  })), r;
766
766
  };
767
- }), [ n ]), N = z.N(), [Y, D] = S.m(c), [V, j] = m.m(c), U = [];
767
+ }, [ n ]), N = z.N(), [Y, D] = S.m(c), [V, j] = m.m(c), U = [];
768
768
  for (let t = Y; t <= D; t++) for (let o = V; o <= j; o++) U.push(e.jsx(G, {
769
769
  ee: $,
770
770
  le: t,
@@ -788,9 +788,9 @@ const n = null, {min: r, max: s, abs: i, floor: l} = Math, c = (e, t, o) => r(o,
788
788
  ...v
789
789
  },
790
790
  children: e.jsx("div", {
791
- ref: (K = [ H, h ], t.useCallback((e => {
791
+ ref: (K = [ H, h ], t.useCallback(e => {
792
792
  for (const t of K) t && ("function" == typeof t ? t(e) : t && (t.current = e));
793
- }), K)),
793
+ }, K)),
794
794
  style: {
795
795
  contain: "size style",
796
796
  overflowAnchor: "none",
@@ -804,7 +804,7 @@ const n = null, {min: r, max: s, abs: i, floor: l} = Math, c = (e, t, o) => r(o,
804
804
  })
805
805
  });
806
806
  var K;
807
- }));
807
+ });
808
808
 
809
809
  exports.VList = j, exports.Virtualizer = V, exports.WindowVirtualizer = U, exports.experimental_VGrid = K;
810
810
  //# sourceMappingURL=index.cjs.map