react-virtuoso 4.18.11 → 4.18.13

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 (3) hide show
  1. package/dist/index.cjs +1 -1
  2. package/dist/index.mjs +1469 -1447
  3. package/package.json +1 -1
package/dist/index.mjs CHANGED
@@ -1,8 +1,8 @@
1
1
  import { jsx as G, jsxs as $t } from "react/jsx-runtime";
2
2
  import E, { createElement as Dt } from "react";
3
3
  import go from "react-dom";
4
- const we = 0, Pt = 1, Xt = 2, Vn = 4;
5
- function fn(t) {
4
+ const we = 0, Wt = 1, Xt = 2, Pn = 4;
5
+ function mn(t) {
6
6
  return () => t;
7
7
  }
8
8
  function Io(t) {
@@ -11,13 +11,13 @@ function Io(t) {
11
11
  function re(t, e) {
12
12
  return (n) => t(e(n));
13
13
  }
14
- function mn(t, e) {
14
+ function pn(t, e) {
15
15
  return () => t(e);
16
16
  }
17
17
  function So(t, e) {
18
18
  return (n) => t(e, n);
19
19
  }
20
- function _e(t) {
20
+ function Ne(t) {
21
21
  return t !== void 0;
22
22
  }
23
23
  function xo(...t) {
@@ -33,31 +33,31 @@ function ye(t, e) {
33
33
  function vo(t, e) {
34
34
  return e(t);
35
35
  }
36
- function rt(...t) {
36
+ function it(...t) {
37
37
  return t;
38
38
  }
39
- function Y(t, e) {
40
- return t(Pt, e);
39
+ function J(t, e) {
40
+ return t(Wt, e);
41
41
  }
42
42
  function M(t, e) {
43
43
  t(we, e);
44
44
  }
45
- function Ne(t) {
45
+ function De(t) {
46
46
  t(Xt);
47
47
  }
48
- function it(t) {
49
- return t(Vn);
48
+ function ot(t) {
49
+ return t(Pn);
50
50
  }
51
- function z(t, e) {
52
- return Y(t, So(e, we));
51
+ function L(t, e) {
52
+ return J(t, So(e, we));
53
53
  }
54
- function yt(t, e) {
55
- const n = t(Pt, (o) => {
54
+ function bt(t, e) {
55
+ const n = t(Wt, (o) => {
56
56
  n(), e(o);
57
57
  });
58
58
  return n;
59
59
  }
60
- function pn(t) {
60
+ function hn(t) {
61
61
  let e, n;
62
62
  return (o) => (r) => {
63
63
  e = r, n && clearTimeout(n), n = setTimeout(() => {
@@ -68,13 +68,13 @@ function pn(t) {
68
68
  function Wn(t, e) {
69
69
  return t === e;
70
70
  }
71
- function nt(t = Wn) {
71
+ function rt(t = Wn) {
72
72
  let e;
73
73
  return (n) => (o) => {
74
74
  t(e, o) || (e = o, n(o));
75
75
  };
76
76
  }
77
- function P(t) {
77
+ function W(t) {
78
78
  return (e) => (n) => {
79
79
  t(n) && e(n);
80
80
  };
@@ -87,19 +87,19 @@ function Bt(t) {
87
87
  e(t);
88
88
  };
89
89
  }
90
- function x(t, ...e) {
90
+ function S(t, ...e) {
91
91
  const n = To(...e);
92
92
  return ((o, r) => {
93
93
  switch (o) {
94
94
  case Xt:
95
- Ne(t);
95
+ De(t);
96
96
  return;
97
- case Pt:
98
- return Y(t, n(r));
97
+ case Wt:
98
+ return J(t, n(r));
99
99
  }
100
100
  });
101
101
  }
102
- function Ot(t, e) {
102
+ function kt(t, e) {
103
103
  return (n) => (o) => {
104
104
  n(e = t(e, o));
105
105
  };
@@ -117,13 +117,13 @@ function zt(t) {
117
117
  }, t));
118
118
  };
119
119
  }
120
- function $(...t) {
120
+ function D(...t) {
121
121
  const e = Array.from({ length: t.length });
122
122
  let n = 0, o = null;
123
123
  const r = 2 ** t.length - 1;
124
124
  return t.forEach((s, i) => {
125
125
  const l = 2 ** i;
126
- Y(s, (c) => {
126
+ J(s, (c) => {
127
127
  const d = n;
128
128
  n |= l, e[i] = c, d !== r && n === r && o && (o(), o = null);
129
129
  });
@@ -142,36 +142,36 @@ function Co(t) {
142
142
  const o = () => e?.();
143
143
  return function(r, s) {
144
144
  switch (r) {
145
- case Pt:
146
- return s ? n === s ? void 0 : (o(), n = s, e = Y(t, s), e) : (o(), Jt);
145
+ case Wt:
146
+ return s ? n === s ? void 0 : (o(), n = s, e = J(t, s), e) : (o(), Jt);
147
147
  case Xt:
148
148
  o(), n = null;
149
149
  return;
150
150
  }
151
151
  };
152
152
  }
153
- function T(t) {
153
+ function w(t) {
154
154
  let e = t;
155
- const n = U();
155
+ const n = K();
156
156
  return ((o, r) => {
157
157
  switch (o) {
158
158
  case we:
159
159
  e = r;
160
160
  break;
161
- case Pt: {
161
+ case Wt: {
162
162
  r(e);
163
163
  break;
164
164
  }
165
- case Vn:
165
+ case Pn:
166
166
  return e;
167
167
  }
168
168
  return n(o, r);
169
169
  });
170
170
  }
171
171
  function ht(t, e) {
172
- return ye(T(e), (n) => z(t, n));
172
+ return ye(w(e), (n) => L(t, n));
173
173
  }
174
- function U() {
174
+ function K() {
175
175
  const t = [];
176
176
  return ((e, n) => {
177
177
  switch (e) {
@@ -183,7 +183,7 @@ function U() {
183
183
  case Xt:
184
184
  t.splice(0);
185
185
  return;
186
- case Pt:
186
+ case Wt:
187
187
  return t.push(n), () => {
188
188
  const o = t.indexOf(n);
189
189
  o > -1 && t.splice(o, 1);
@@ -191,11 +191,11 @@ function U() {
191
191
  }
192
192
  });
193
193
  }
194
- function Tt(t) {
195
- return ye(U(), (e) => z(t, e));
194
+ function Ct(t) {
195
+ return ye(K(), (e) => L(t, e));
196
196
  }
197
197
  const wo = { singleton: !0 };
198
- function j(t, e = [], n = wo) {
198
+ function Z(t, e = [], n = wo) {
199
199
  const { singleton: o } = n;
200
200
  return {
201
201
  constructor: t,
@@ -214,40 +214,40 @@ function bo(t) {
214
214
  };
215
215
  return n(t);
216
216
  }
217
- function at(...t) {
218
- const e = U(), n = Array.from({ length: t.length });
217
+ function dt(...t) {
218
+ const e = K(), n = Array.from({ length: t.length });
219
219
  let o = 0;
220
220
  const r = 2 ** t.length - 1;
221
221
  return t.forEach((s, i) => {
222
222
  const l = 2 ** i;
223
- Y(s, (c) => {
223
+ J(s, (c) => {
224
224
  n[i] = c, o |= l, o === r && M(e, n);
225
225
  });
226
226
  }), function(s, i) {
227
227
  switch (s) {
228
228
  case Xt: {
229
- Ne(e);
229
+ De(e);
230
230
  return;
231
231
  }
232
- case Pt:
233
- return o === r && i(n), Y(e, i);
232
+ case Wt:
233
+ return o === r && i(n), J(e, i);
234
234
  }
235
235
  };
236
236
  }
237
- function W(t, e = Wn) {
238
- return x(t, nt(e));
237
+ function P(t, e = Wn) {
238
+ return S(t, rt(e));
239
239
  }
240
- function Fe(...t) {
240
+ function Ve(...t) {
241
241
  return function(e, n) {
242
242
  switch (e) {
243
243
  case Xt:
244
244
  return;
245
- case Pt:
246
- return xo(...t.map((o) => Y(o, n)));
245
+ case Wt:
246
+ return xo(...t.map((o) => J(o, n)));
247
247
  }
248
248
  };
249
249
  }
250
- const ft = {
250
+ const mt = {
251
251
  /** Detailed debugging information including item measurements */
252
252
  DEBUG: 0,
253
253
  /** General informational messages */
@@ -257,16 +257,16 @@ const ft = {
257
257
  /** Error messages for failures (default level) */
258
258
  ERROR: 3
259
259
  }, Ro = {
260
- [ft.DEBUG]: "debug",
261
- [ft.ERROR]: "error",
262
- [ft.INFO]: "log",
263
- [ft.WARN]: "warn"
264
- }, Ho = () => typeof globalThis > "u" ? window : globalThis, Gt = j(
260
+ [mt.DEBUG]: "debug",
261
+ [mt.ERROR]: "error",
262
+ [mt.INFO]: "log",
263
+ [mt.WARN]: "warn"
264
+ }, Ho = () => typeof globalThis > "u" ? window : globalThis, Gt = Z(
265
265
  () => {
266
- const t = T(ft.ERROR);
266
+ const t = w(mt.ERROR);
267
267
  return {
268
- log: T((n, o, r = ft.INFO) => {
269
- const s = Ho().VIRTUOSO_LOG_LEVEL ?? it(t);
268
+ log: w((n, o, r = mt.INFO) => {
269
+ const s = Ho().VIRTUOSO_LOG_LEVEL ?? ot(t);
270
270
  r >= s && console[Ro[r]](
271
271
  "%creact-virtuoso: %c%s %o",
272
272
  "color: #0253b3; font-weight: bold",
@@ -284,20 +284,20 @@ const ft = {
284
284
  function Eo(t) {
285
285
  return "self" in t ? t.document.documentElement : t;
286
286
  }
287
- function Pn(t) {
287
+ function Gn(t) {
288
288
  const e = Eo(t);
289
289
  return e.ownerDocument.defaultView.getComputedStyle(e).direction === "rtl";
290
290
  }
291
291
  function _t(t, e) {
292
- return Pn(t) ? -e : e;
292
+ return Gn(t) ? -e : e;
293
293
  }
294
- function hn(t, e) {
295
- return Pn(t) ? -e : e;
294
+ function gn(t, e) {
295
+ return Gn(t) ? -e : e;
296
296
  }
297
- function kt(t, e, n) {
298
- return De(t, e, n).callbackRef;
297
+ function Ot(t, e, n) {
298
+ return $e(t, e, n).callbackRef;
299
299
  }
300
- function De(t, e, n) {
300
+ function $e(t, e, n) {
301
301
  const o = E.useRef(null);
302
302
  let r = (i) => {
303
303
  };
@@ -312,28 +312,28 @@ function De(t, e, n) {
312
312
  i && e ? (s?.observe(i), o.current = i) : (o.current && s?.unobserve(o.current), o.current = null);
313
313
  }, { callbackRef: r, ref: o };
314
314
  }
315
- function Gn(t, e, n, o, r, s, i, l, c) {
315
+ function An(t, e, n, o, r, s, i, l, c) {
316
316
  const d = E.useCallback(
317
- (m) => {
318
- const v = Bo(m.children, e, l ? "offsetWidth" : "offsetHeight", r);
319
- let p = m.parentElement;
320
- for (; p.dataset.virtuosoScroller === void 0; )
321
- p = p.parentElement;
322
- const I = p.lastElementChild?.dataset.viewportType === "window";
323
- let w;
324
- I && (w = p.ownerDocument.defaultView);
325
- const R = i ? l ? i.scrollWidth : i.scrollHeight : I ? l ? w.document.documentElement.scrollWidth : w.document.documentElement.scrollHeight : l ? p.scrollWidth : p.scrollHeight, h = i ? l ? i.offsetWidth : i.offsetHeight : I ? l ? w.innerWidth : w.innerHeight : l ? p.offsetWidth : p.offsetHeight, f = i ? l ? _t(i, i.scrollLeft) : i.scrollTop : I ? l ? _t(w, w.scrollX || w.document.documentElement.scrollLeft) : w.scrollY || w.document.documentElement.scrollTop : l ? _t(p, p.scrollLeft) : p.scrollTop;
317
+ (f) => {
318
+ const v = Bo(f.children, e, l ? "offsetWidth" : "offsetHeight", r);
319
+ let m = f.parentElement;
320
+ for (; m.dataset.virtuosoScroller === void 0; )
321
+ m = m.parentElement;
322
+ const g = m.lastElementChild?.dataset.viewportType === "window";
323
+ let y;
324
+ g && (y = m.ownerDocument.defaultView);
325
+ const R = i ? l ? i.scrollWidth : i.scrollHeight : g ? l ? y.document.documentElement.scrollWidth : y.document.documentElement.scrollHeight : l ? m.scrollWidth : m.scrollHeight, I = i ? l ? i.offsetWidth : i.offsetHeight : g ? l ? y.innerWidth : y.innerHeight : l ? m.offsetWidth : m.offsetHeight, h = i ? l ? _t(i, i.scrollLeft) : i.scrollTop : g ? l ? _t(y, y.scrollX || y.document.documentElement.scrollLeft) : y.scrollY || y.document.documentElement.scrollTop : l ? _t(m, m.scrollLeft) : m.scrollTop;
326
326
  o({
327
327
  scrollHeight: R,
328
- scrollTop: Math.max(f, 0),
329
- viewportHeight: h
328
+ scrollTop: Math.max(h, 0),
329
+ viewportHeight: I
330
330
  }), s?.(
331
- l ? gn("column-gap", getComputedStyle(m).columnGap, r) : gn("row-gap", getComputedStyle(m).rowGap, r)
331
+ l ? In("column-gap", getComputedStyle(f).columnGap, r) : In("row-gap", getComputedStyle(f).rowGap, r)
332
332
  ), v !== null && t(v);
333
333
  },
334
334
  [t, e, r, s, i, o, l]
335
335
  );
336
- return De(d, n, c);
336
+ return $e(d, n, c);
337
337
  }
338
338
  function Bo(t, e, n, o) {
339
339
  const r = t.length;
@@ -344,41 +344,42 @@ function Bo(t, e, n, o) {
344
344
  const l = t.item(i);
345
345
  if (l.dataset.index === void 0)
346
346
  continue;
347
- const c = parseInt(l.dataset.index, 10), d = parseFloat(l.dataset.knownSize), m = e(l, n);
348
- if (m === 0 && o("Zero-sized element, this should not happen", { child: l }, ft.ERROR), m === d)
347
+ const c = parseInt(l.dataset.index, 10), d = parseFloat(l.dataset.knownSize), f = e(l, n);
348
+ if (f === 0 && o("Zero-sized element, this should not happen", { child: l }, mt.ERROR), f === d)
349
349
  continue;
350
350
  const v = s[s.length - 1];
351
- s.length === 0 || v.size !== m || v.endIndex !== c - 1 ? s.push({ endIndex: c, size: m, startIndex: c }) : s[s.length - 1].endIndex++;
351
+ s.length === 0 || v.size !== f || v.endIndex !== c - 1 ? s.push({ endIndex: c, size: f, startIndex: c }) : s[s.length - 1].endIndex++;
352
352
  }
353
353
  return s;
354
354
  }
355
- function gn(t, e, n) {
356
- return e !== "normal" && e?.endsWith("px") !== !0 && n(`${t} was not resolved to pixel value correctly`, e, ft.WARN), e === "normal" ? 0 : parseInt(e ?? "0", 10);
355
+ function In(t, e, n) {
356
+ return e !== "normal" && e?.endsWith("px") !== !0 && n(`${t} was not resolved to pixel value correctly`, e, mt.WARN), e === "normal" ? 0 : parseInt(e ?? "0", 10);
357
357
  }
358
- function $e(t, e, n) {
358
+ const be = typeof document > "u" ? E.useEffect : E.useLayoutEffect;
359
+ function Ue(t, e, n) {
359
360
  const o = E.useRef(null), r = E.useCallback(
360
361
  (c) => {
361
362
  if (!c?.offsetParent)
362
363
  return;
363
- const d = c.getBoundingClientRect(), m = d.width;
364
- let v, p;
364
+ const d = c.getBoundingClientRect(), f = d.width;
365
+ let v, m;
365
366
  if (e) {
366
- const I = e.getBoundingClientRect(), w = d.top - I.top;
367
- p = I.height - Math.max(0, w), v = w + e.scrollTop;
367
+ const g = e.getBoundingClientRect(), y = d.top - g.top;
368
+ m = g.height - Math.max(0, y), v = y + e.scrollTop;
368
369
  } else {
369
- const I = i.current.ownerDocument.defaultView;
370
- p = I.innerHeight - Math.max(0, d.top), v = d.top + I.scrollY;
370
+ const g = i.current.ownerDocument.defaultView;
371
+ m = g.innerHeight - Math.max(0, d.top), v = d.top + g.scrollY;
371
372
  }
372
373
  o.current = {
373
374
  listHeight: d.height,
374
375
  offsetTop: v,
375
- visibleHeight: p,
376
- visibleWidth: m
376
+ visibleHeight: m,
377
+ visibleWidth: f
377
378
  }, t(o.current);
378
379
  },
379
380
  // oxlint-disable-next-line exhaustive-deps
380
381
  [t, e]
381
- ), { callbackRef: s, ref: i } = De(r, !0, n), l = E.useCallback(() => {
382
+ ), { callbackRef: s, ref: i } = $e(r, !0, n), l = E.useCallback(() => {
382
383
  r(i.current);
383
384
  }, [r, i]);
384
385
  return E.useEffect(() => {
@@ -397,47 +398,48 @@ function $e(t, e, n) {
397
398
  };
398
399
  }, [l, e, i]), s;
399
400
  }
400
- const It = j(
401
+ const It = Z(
401
402
  () => {
402
- const t = U(), e = U(), n = T(0), o = U(), r = T(0), s = U(), i = U(), l = T(0), c = T(0), d = T(0), m = T(0), v = U(), p = U(), I = T(!1), w = T(!1), R = T(!1);
403
- return z(
404
- x(
403
+ const t = K(), e = K(), n = w(0), o = K(), r = K(), s = w(0), i = K(), l = K(), c = w(0), d = w(0), f = w(0), v = w(0), m = K(), g = K(), y = w(!1), R = w(!1), I = w(!1);
404
+ return L(
405
+ S(
405
406
  t,
406
407
  B(({ scrollTop: h }) => h)
407
408
  ),
408
409
  e
409
- ), z(
410
- x(
410
+ ), L(
411
+ S(
411
412
  t,
412
413
  B(({ scrollHeight: h }) => h)
413
414
  ),
414
- i
415
- ), z(e, r), {
415
+ l
416
+ ), L(e, s), {
416
417
  deviation: n,
417
- fixedFooterHeight: d,
418
- fixedHeaderHeight: c,
419
- footerHeight: m,
420
- headerHeight: l,
421
- horizontalDirection: w,
422
- scrollBy: p,
418
+ deviationCommitted: o,
419
+ fixedFooterHeight: f,
420
+ fixedHeaderHeight: d,
421
+ footerHeight: v,
422
+ headerHeight: c,
423
+ horizontalDirection: R,
424
+ scrollBy: g,
423
425
  // input
424
426
  scrollContainerState: t,
425
- scrollHeight: i,
426
- scrollingInProgress: I,
427
+ scrollHeight: l,
428
+ scrollingInProgress: y,
427
429
  // signals
428
- scrollTo: v,
430
+ scrollTo: m,
429
431
  scrollTop: e,
430
- skipAnimationFrameInResizeObserver: R,
431
- smoothScrollTargetReached: o,
432
+ skipAnimationFrameInResizeObserver: I,
433
+ smoothScrollTargetReached: r,
432
434
  // state
433
- statefulScrollTop: r,
434
- viewportHeight: s
435
+ statefulScrollTop: s,
436
+ viewportHeight: i
435
437
  };
436
438
  },
437
439
  [],
438
440
  { singleton: !0 }
439
441
  ), se = { lvl: 0 };
440
- function An(t, e) {
442
+ function Mn(t, e) {
441
443
  const n = t.length;
442
444
  if (n === 0)
443
445
  return [];
@@ -449,15 +451,15 @@ function An(t, e) {
449
451
  }
450
452
  return s.push({ end: 1 / 0, start: o, value: r }), s;
451
453
  }
452
- function J(t) {
454
+ function tt(t) {
453
455
  return t === se;
454
456
  }
455
457
  function ie(t, e) {
456
- if (!J(t))
458
+ if (!tt(t))
457
459
  return e === t.k ? t.v : e < t.k ? ie(t.l, e) : ie(t.r, e);
458
460
  }
459
461
  function Rt(t, e, n = "k") {
460
- if (J(t))
462
+ if (tt(t))
461
463
  return [-1 / 0, void 0];
462
464
  if (Number(t[n]) === e)
463
465
  return [t.k, t.v];
@@ -468,36 +470,36 @@ function Rt(t, e, n = "k") {
468
470
  return Rt(t.l, e, n);
469
471
  }
470
472
  function vt(t, e, n) {
471
- return J(t) ? Nn(e, n, 1) : e === t.k ? dt(t, { k: e, v: n }) : e < t.k ? In(dt(t, { l: vt(t.l, e, n) })) : In(dt(t, { r: vt(t.r, e, n) }));
473
+ return tt(t) ? Dn(e, n, 1) : e === t.k ? ft(t, { k: e, v: n }) : e < t.k ? Sn(ft(t, { l: vt(t.l, e, n) })) : Sn(ft(t, { r: vt(t.r, e, n) }));
472
474
  }
473
475
  function Yt() {
474
476
  return se;
475
477
  }
476
478
  function Zt(t, e, n) {
477
- if (J(t))
479
+ if (tt(t))
478
480
  return [];
479
481
  const o = Rt(t, e)[0];
480
- return Oo(We(t, o, n));
482
+ return ko(We(t, o, n));
481
483
  }
482
- function Ve(t, e) {
483
- if (J(t))
484
+ function Pe(t, e) {
485
+ if (tt(t))
484
486
  return se;
485
487
  const { k: n, l: o, r } = t;
486
488
  if (e === n) {
487
- if (J(o))
489
+ if (tt(o))
488
490
  return r;
489
- if (J(r))
491
+ if (tt(r))
490
492
  return o;
491
- const [s, i] = _n(o);
492
- return xe(dt(t, { k: s, l: Mn(o), v: i }));
493
+ const [s, i] = Nn(o);
494
+ return xe(ft(t, { k: s, l: _n(o), v: i }));
493
495
  }
494
- return e < n ? xe(dt(t, { l: Ve(o, e) })) : xe(dt(t, { r: Ve(r, e) }));
496
+ return e < n ? xe(ft(t, { l: Pe(o, e) })) : xe(ft(t, { r: Pe(r, e) }));
495
497
  }
496
498
  function Nt(t) {
497
- return J(t) ? [] : [...Nt(t.l), { k: t.k, v: t.v }, ...Nt(t.r)];
499
+ return tt(t) ? [] : [...Nt(t.l), { k: t.k, v: t.v }, ...Nt(t.r)];
498
500
  }
499
501
  function We(t, e, n) {
500
- if (J(t))
502
+ if (tt(t))
501
503
  return [];
502
504
  const { k: o, l: r, r: s, v: i } = t;
503
505
  let l = [];
@@ -508,36 +510,36 @@ function xe(t) {
508
510
  if (o.lvl >= n - 1 && e.lvl >= n - 1)
509
511
  return t;
510
512
  if (n > o.lvl + 1) {
511
- if (Be(e))
512
- return Dn(dt(t, { lvl: n - 1 }));
513
- if (!J(e) && !J(e.r))
514
- return dt(e.r, {
515
- l: dt(e, { r: e.r.l }),
513
+ if (ke(e))
514
+ return $n(ft(t, { lvl: n - 1 }));
515
+ if (!tt(e) && !tt(e.r))
516
+ return ft(e.r, {
517
+ l: ft(e, { r: e.r.l }),
516
518
  lvl: n,
517
- r: dt(t, {
519
+ r: ft(t, {
518
520
  l: e.r.r,
519
521
  lvl: n - 1
520
522
  })
521
523
  });
522
524
  throw new Error("Unexpected empty nodes");
523
525
  }
524
- if (Be(t))
525
- return Pe(dt(t, { lvl: n - 1 }));
526
- if (!J(o) && !J(o.l)) {
527
- const r = o.l, s = Be(r) ? o.lvl - 1 : o.lvl;
528
- return dt(r, {
529
- l: dt(t, {
526
+ if (ke(t))
527
+ return Ge(ft(t, { lvl: n - 1 }));
528
+ if (!tt(o) && !tt(o.l)) {
529
+ const r = o.l, s = ke(r) ? o.lvl - 1 : o.lvl;
530
+ return ft(r, {
531
+ l: ft(t, {
530
532
  lvl: n - 1,
531
533
  r: r.l
532
534
  }),
533
535
  lvl: r.lvl + 1,
534
- r: Pe(dt(o, { l: r.r, lvl: s }))
536
+ r: Ge(ft(o, { l: r.r, lvl: s }))
535
537
  });
536
538
  }
537
539
  throw new Error("Unexpected empty nodes");
538
540
  }
539
- function dt(t, e) {
540
- return Nn(
541
+ function ft(t, e) {
542
+ return Dn(
541
543
  e.k === void 0 ? t.k : e.k,
542
544
  e.v === void 0 ? t.v : e.v,
543
545
  e.lvl === void 0 ? t.lvl : e.lvl,
@@ -545,44 +547,44 @@ function dt(t, e) {
545
547
  e.r === void 0 ? t.r : e.r
546
548
  );
547
549
  }
548
- function Mn(t) {
549
- return J(t.r) ? t.l : xe(dt(t, { r: Mn(t.r) }));
550
+ function _n(t) {
551
+ return tt(t.r) ? t.l : xe(ft(t, { r: _n(t.r) }));
550
552
  }
551
- function Be(t) {
552
- return J(t) || t.lvl > t.r.lvl;
553
+ function ke(t) {
554
+ return tt(t) || t.lvl > t.r.lvl;
553
555
  }
554
- function _n(t) {
555
- return J(t.r) ? [t.k, t.v] : _n(t.r);
556
+ function Nn(t) {
557
+ return tt(t.r) ? [t.k, t.v] : Nn(t.r);
556
558
  }
557
- function Nn(t, e, n, o = se, r = se) {
559
+ function Dn(t, e, n, o = se, r = se) {
558
560
  return { k: t, l: o, lvl: n, r, v: e };
559
561
  }
560
- function In(t) {
561
- return Pe(Dn(t));
562
+ function Sn(t) {
563
+ return Ge($n(t));
562
564
  }
563
- function Dn(t) {
565
+ function $n(t) {
564
566
  const { l: e } = t;
565
- return !J(e) && e.lvl === t.lvl ? dt(e, { r: dt(t, { l: e.r }) }) : t;
567
+ return !tt(e) && e.lvl === t.lvl ? ft(e, { r: ft(t, { l: e.r }) }) : t;
566
568
  }
567
- function Pe(t) {
569
+ function Ge(t) {
568
570
  const { lvl: e, r: n } = t;
569
- return !J(n) && !J(n.r) && n.lvl === e && n.r.lvl === e ? dt(n, { l: dt(t, { r: n.l }), lvl: e + 1 }) : t;
571
+ return !tt(n) && !tt(n.r) && n.lvl === e && n.r.lvl === e ? ft(n, { l: ft(t, { r: n.l }), lvl: e + 1 }) : t;
570
572
  }
571
- function Oo(t) {
572
- return An(t, ({ k: e, v: n }) => ({ index: e, value: n }));
573
+ function ko(t) {
574
+ return Mn(t, ({ k: e, v: n }) => ({ index: e, value: n }));
573
575
  }
574
- function $n(t, e) {
576
+ function Un(t, e) {
575
577
  return !!(t && t.startIndex === e.startIndex && t.endIndex === e.endIndex);
576
578
  }
577
579
  function le(t, e) {
578
580
  return !!(t && t[0] === e[0] && t[1] === e[1]);
579
581
  }
580
- const Ue = j(
581
- () => ({ recalcInProgress: T(!1) }),
582
+ const Ke = Z(
583
+ () => ({ recalcInProgress: w(!1) }),
582
584
  [],
583
585
  { singleton: !0 }
584
586
  );
585
- function Un(t, e, n) {
587
+ function Kn(t, e, n) {
586
588
  return t[Te(t, e, n)];
587
589
  }
588
590
  function Te(t, e, n, o = 0) {
@@ -603,17 +605,17 @@ function Te(t, e, n, o = 0) {
603
605
  }
604
606
  throw new Error(`Failed binary finding record in array - ${t.join(",")}, searched for ${e}`);
605
607
  }
606
- function ko(t, e, n, o) {
608
+ function Oo(t, e, n, o) {
607
609
  const r = Te(t, e, o), s = Te(t, n, o, r);
608
610
  return t.slice(r, s + 1);
609
611
  }
610
612
  function Ht(t, e) {
611
613
  return Math.round(t.getBoundingClientRect()[e]);
612
614
  }
613
- function be(t) {
614
- return !J(t.groupOffsetTree);
615
+ function Re(t) {
616
+ return !tt(t.groupOffsetTree);
615
617
  }
616
- function Ke({ index: t }, e) {
618
+ function je({ index: t }, e) {
617
619
  return e === t ? 0 : e < t ? -1 : 1;
618
620
  }
619
621
  function Lo() {
@@ -628,10 +630,10 @@ function Lo() {
628
630
  };
629
631
  }
630
632
  function zo(t, e) {
631
- let n = J(t) ? 0 : 1 / 0;
633
+ let n = tt(t) ? 0 : 1 / 0;
632
634
  for (const o of e) {
633
635
  const { endIndex: r, size: s, startIndex: i } = o;
634
- if (n = Math.min(n, i), J(t)) {
636
+ if (n = Math.min(n, i), tt(t)) {
635
637
  t = vt(t, 0, s);
636
638
  continue;
637
639
  }
@@ -639,8 +641,8 @@ function zo(t, e) {
639
641
  if (l.some(Mo(o)))
640
642
  continue;
641
643
  let c = !1, d = !1;
642
- for (const { end: m, start: v, value: p } of l)
643
- c ? (r >= v || s === p) && (t = Ve(t, v)) : (d = p !== s, c = !0), m > r && r >= v && p !== s && (t = vt(t, r + 1, p));
644
+ for (const { end: f, start: v, value: m } of l)
645
+ c ? (r >= v || s === m) && (t = Pe(t, v)) : (d = m !== s, c = !0), f > r && r >= v && m !== s && (t = vt(t, r + 1, m));
644
646
  d && (t = vt(t, i, s));
645
647
  }
646
648
  return [t, n];
@@ -654,45 +656,45 @@ function Vo({ offset: t }, e) {
654
656
  function ce(t, e, n) {
655
657
  if (e.length === 0)
656
658
  return 0;
657
- const { index: o, offset: r, size: s } = Un(e, t, Ke), i = t - o, l = s * i + (i - 1) * n + r;
659
+ const { index: o, offset: r, size: s } = Kn(e, t, je), i = t - o, l = s * i + (i - 1) * n + r;
658
660
  return l > 0 ? l + n : l;
659
661
  }
660
- function Kn(t, e) {
661
- if (!be(e))
662
+ function jn(t, e) {
663
+ if (!Re(e))
662
664
  return t;
663
665
  let n = 0;
664
666
  for (; e.groupIndices[n] <= t + n; )
665
667
  n++;
666
668
  return t + n;
667
669
  }
668
- function jn(t, e, n) {
670
+ function qn(t, e, n) {
669
671
  if (Fo(t))
670
672
  return e.groupIndices[t.groupIndex] + 1;
671
673
  const o = t.index === "LAST" ? n : t.index;
672
- let r = Kn(o, e);
674
+ let r = jn(o, e);
673
675
  return r = Math.max(0, Math.min(n, r)), r;
674
676
  }
675
- function Wo(t, e, n, o = 0) {
676
- return o > 0 && (e = Math.max(e, Un(t, o, Ke).offset)), An(ko(t, e, n, Vo), Ao);
677
+ function Po(t, e, n, o = 0) {
678
+ return o > 0 && (e = Math.max(e, Kn(t, o, je).offset)), Mn(Oo(t, e, n, Vo), Ao);
677
679
  }
678
- function Po(t, [e, n, o, r]) {
679
- e.length > 0 && o("received item sizes", e, ft.DEBUG);
680
+ function Wo(t, [e, n, o, r]) {
681
+ e.length > 0 && o("received item sizes", e, mt.DEBUG);
680
682
  const s = t.sizeTree;
681
683
  let i = s, l = 0;
682
- if (n.length > 0 && J(s) && e.length === 2) {
683
- const p = e[0].size, I = e[1].size;
684
- i = n.reduce((w, R) => vt(vt(w, R, p), R + 1, I), i);
684
+ if (n.length > 0 && tt(s) && e.length === 2) {
685
+ const m = e[0].size, g = e[1].size;
686
+ i = n.reduce((y, R) => vt(vt(y, R, m), R + 1, g), i);
685
687
  } else
686
688
  [i, l] = zo(i, e);
687
689
  if (i === s)
688
690
  return t;
689
- const { lastIndex: c, lastOffset: d, lastSize: m, offsetTree: v } = Ge(t.offsetTree, l, i, r);
691
+ const { lastIndex: c, lastOffset: d, lastSize: f, offsetTree: v } = Ae(t.offsetTree, l, i, r);
690
692
  return {
691
693
  groupIndices: n,
692
- groupOffsetTree: n.reduce((p, I) => vt(p, I, ce(I, v, r)), Yt()),
694
+ groupOffsetTree: n.reduce((m, g) => vt(m, g, ce(g, v, r)), Yt()),
693
695
  lastIndex: c,
694
696
  lastOffset: d,
695
- lastSize: m,
697
+ lastSize: f,
696
698
  offsetTree: v,
697
699
  sizeTree: i
698
700
  };
@@ -703,28 +705,28 @@ function Go(t) {
703
705
  return { endIndex: s === void 0 ? 1 / 0 : s.k - 1, size: n, startIndex: e };
704
706
  });
705
707
  }
706
- function Sn(t, e) {
708
+ function xn(t, e) {
707
709
  let n = 0, o = 0;
708
710
  for (; n < t; )
709
711
  n += e[o + 1] - e[o] - 1, o++;
710
712
  return o - (n === t ? 0 : 1);
711
713
  }
712
- function Ge(t, e, n, o) {
714
+ function Ae(t, e, n, o) {
713
715
  let r = t, s = 0, i = 0, l = 0, c = 0;
714
716
  if (e === 0)
715
717
  r = [];
716
718
  else {
717
- c = Te(r, e - 1, Ke), l = r[c].offset;
718
- const m = Rt(n, e - 1);
719
- s = m[0], i = m[1], r.length && r[c].size === Rt(n, e)[1] && (c -= 1), r = r.slice(0, c + 1);
719
+ c = Te(r, e - 1, je), l = r[c].offset;
720
+ const f = Rt(n, e - 1);
721
+ s = f[0], i = f[1], r.length && r[c].size === Rt(n, e)[1] && (c -= 1), r = r.slice(0, c + 1);
720
722
  }
721
- for (const { start: d, value: m } of Zt(n, e, 1 / 0)) {
722
- const v = d - s, p = v * i + l + v * o;
723
+ for (const { start: d, value: f } of Zt(n, e, 1 / 0)) {
724
+ const v = d - s, m = v * i + l + v * o;
723
725
  r.push({
724
726
  index: d,
725
- offset: p,
726
- size: m
727
- }), s = d, l = p, i = m;
727
+ offset: m,
728
+ size: f
729
+ }), s = d, l = m, i = f;
728
730
  }
729
731
  return {
730
732
  lastIndex: s,
@@ -743,16 +745,16 @@ function Mo(t) {
743
745
  const _o = {
744
746
  offsetHeight: "height",
745
747
  offsetWidth: "width"
746
- }, Lt = j(
748
+ }, Lt = Z(
747
749
  ([{ log: t }, { recalcInProgress: e }]) => {
748
- const n = U(), o = U(), r = ht(o, 0), s = U(), i = U(), l = T(0), c = T([]), d = T(void 0), m = T(void 0), v = T(void 0), p = T(void 0), I = T((u, g) => Ht(u, _o[g])), w = T(void 0), R = T(0), h = Lo(), f = ht(
749
- x(n, $(c, t, R), Ot(Po, h), nt()),
750
- h
750
+ const n = K(), o = K(), r = ht(o, 0), s = K(), i = K(), l = w(0), c = w([]), d = w(void 0), f = w(void 0), v = w(void 0), m = w(void 0), g = w((u, p) => Ht(u, _o[p])), y = w(void 0), R = w(0), I = Lo(), h = ht(
751
+ S(n, D(c, t, R), kt(Wo, I), rt()),
752
+ I
751
753
  ), a = ht(
752
- x(
754
+ S(
753
755
  c,
754
- nt(),
755
- Ot((u, g) => ({ current: g, prev: u.current }), {
756
+ rt(),
757
+ kt((u, p) => ({ current: p, prev: u.current }), {
756
758
  current: [],
757
759
  prev: []
758
760
  }),
@@ -760,197 +762,197 @@ const _o = {
760
762
  ),
761
763
  []
762
764
  );
763
- z(
764
- x(
765
+ L(
766
+ S(
765
767
  c,
766
- P((u) => u.length > 0),
767
- $(f, R),
768
- B(([u, g, C]) => {
769
- const L = u.reduce((O, V, N) => vt(O, V, ce(V, g.offsetTree, C) || N), Yt());
768
+ W((u) => u.length > 0),
769
+ D(h, R),
770
+ B(([u, p, b]) => {
771
+ const z = u.reduce((F, O, V) => vt(F, O, ce(O, p.offsetTree, b) || V), Yt());
770
772
  return {
771
- ...g,
773
+ ...p,
772
774
  groupIndices: u,
773
- groupOffsetTree: L
775
+ groupOffsetTree: z
774
776
  };
775
777
  })
776
778
  ),
777
- f
778
- ), z(
779
- x(
779
+ h
780
+ ), L(
781
+ S(
780
782
  o,
781
- $(f),
782
- P(([u, { lastIndex: g }]) => u < g),
783
- B(([u, { lastIndex: g, lastSize: C }]) => [
783
+ D(h),
784
+ W(([u, { lastIndex: p }]) => u < p),
785
+ B(([u, { lastIndex: p, lastSize: b }]) => [
784
786
  {
785
- endIndex: g,
786
- size: C,
787
+ endIndex: p,
788
+ size: b,
787
789
  startIndex: u
788
790
  }
789
791
  ])
790
792
  ),
791
793
  n
792
- ), z(d, m);
793
- const S = ht(
794
- x(
794
+ ), L(d, f);
795
+ const T = ht(
796
+ S(
795
797
  d,
796
798
  B((u) => u === void 0)
797
799
  ),
798
800
  !0
799
801
  );
800
- z(
801
- x(
802
- m,
803
- P((u) => u !== void 0 && J(it(f).sizeTree)),
802
+ L(
803
+ S(
804
+ f,
805
+ W((u) => u !== void 0 && tt(ot(h).sizeTree)),
804
806
  B((u) => {
805
- const g = it(v), C = it(c).length > 0;
806
- return g !== void 0 && g !== 0 ? C ? [
807
- { endIndex: 0, size: g, startIndex: 0 },
807
+ const p = ot(v), b = ot(c).length > 0;
808
+ return p !== void 0 && p !== 0 ? b ? [
809
+ { endIndex: 0, size: p, startIndex: 0 },
808
810
  { endIndex: 1, size: u, startIndex: 1 }
809
811
  ] : [] : [{ endIndex: 0, size: u, startIndex: 0 }];
810
812
  })
811
813
  ),
812
814
  n
813
- ), z(
814
- x(
815
- p,
816
- P((u) => u !== void 0 && u.length > 0 && J(it(f).sizeTree)),
815
+ ), L(
816
+ S(
817
+ m,
818
+ W((u) => u !== void 0 && u.length > 0 && tt(ot(h).sizeTree)),
817
819
  B((u) => {
818
- const g = [];
819
- let C = u[0], L = 0;
820
- for (let O = 1; O < u.length; O++) {
821
- const V = u[O];
822
- V !== C && (g.push({
823
- endIndex: O - 1,
824
- size: C,
825
- startIndex: L
826
- }), C = V, L = O);
820
+ const p = [];
821
+ let b = u[0], z = 0;
822
+ for (let F = 1; F < u.length; F++) {
823
+ const O = u[F];
824
+ O !== b && (p.push({
825
+ endIndex: F - 1,
826
+ size: b,
827
+ startIndex: z
828
+ }), b = O, z = F);
827
829
  }
828
- return g.push({
830
+ return p.push({
829
831
  endIndex: u.length - 1,
830
- size: C,
831
- startIndex: L
832
- }), g;
832
+ size: b,
833
+ startIndex: z
834
+ }), p;
833
835
  })
834
836
  ),
835
837
  n
836
- ), z(
837
- x(
838
+ ), L(
839
+ S(
838
840
  c,
839
- $(v, m),
840
- P(([, u, g]) => u !== void 0 && g !== void 0),
841
- B(([u, g, C]) => {
842
- const L = [];
843
- for (let O = 0; O < u.length; O++) {
844
- const V = u[O], N = u[O + 1];
845
- L.push({
846
- startIndex: V,
847
- endIndex: V,
848
- size: g
849
- }), N !== void 0 && L.push({
850
- startIndex: V + 1,
851
- endIndex: N - 1,
852
- size: C
841
+ D(v, f),
842
+ W(([, u, p]) => u !== void 0 && p !== void 0),
843
+ B(([u, p, b]) => {
844
+ const z = [];
845
+ for (let F = 0; F < u.length; F++) {
846
+ const O = u[F], V = u[F + 1];
847
+ z.push({
848
+ startIndex: O,
849
+ endIndex: O,
850
+ size: p
851
+ }), V !== void 0 && z.push({
852
+ startIndex: O + 1,
853
+ endIndex: V - 1,
854
+ size: b
853
855
  });
854
856
  }
855
- return L;
857
+ return z;
856
858
  })
857
859
  ),
858
860
  n
859
861
  );
860
- const H = Tt(
861
- x(
862
+ const x = Ct(
863
+ S(
862
864
  n,
863
- $(f),
864
- Ot(
865
- ({ sizes: u }, [g, C]) => ({
866
- changed: C !== u,
867
- sizes: C
865
+ D(h),
866
+ kt(
867
+ ({ sizes: u }, [p, b]) => ({
868
+ changed: b !== u,
869
+ sizes: b
868
870
  }),
869
- { changed: !1, sizes: h }
871
+ { changed: !1, sizes: I }
870
872
  ),
871
873
  B((u) => u.changed)
872
874
  )
873
875
  );
874
- Y(
875
- x(
876
+ J(
877
+ S(
876
878
  l,
877
- Ot(
878
- (u, g) => ({ diff: u.prev - g, prev: g }),
879
+ kt(
880
+ (u, p) => ({ diff: u.prev - p, prev: p }),
879
881
  { diff: 0, prev: 0 }
880
882
  ),
881
883
  B((u) => u.diff)
882
884
  ),
883
885
  (u) => {
884
- const { groupIndices: g } = it(f);
886
+ const { groupIndices: p } = ot(h);
885
887
  if (u > 0)
886
- M(e, !0), M(s, u + Sn(u, g));
888
+ M(e, !0), M(s, u + xn(u, p));
887
889
  else if (u < 0) {
888
- const C = it(a);
889
- C.length > 0 && (u -= Sn(-u, C)), M(i, u);
890
+ const b = ot(a);
891
+ b.length > 0 && (u -= xn(-u, b)), M(i, u);
890
892
  }
891
893
  }
892
- ), Y(x(l, $(t)), ([u, g]) => {
893
- u < 0 && g(
894
+ ), J(S(l, D(t)), ([u, p]) => {
895
+ u < 0 && p(
894
896
  "`firstItemIndex` prop should not be set to less than zero. If you don't know the total count, just use a very high value",
895
897
  { firstItemIndex: l },
896
- ft.ERROR
898
+ mt.ERROR
897
899
  );
898
900
  });
899
- const y = Tt(s);
900
- z(
901
- x(
901
+ const C = Ct(s);
902
+ L(
903
+ S(
902
904
  s,
903
- $(f),
904
- B(([u, g]) => {
905
- const C = g.groupIndices.length > 0, L = [], O = g.lastSize;
906
- if (C) {
907
- const V = ie(g.sizeTree, 0);
908
- let N = 0, Z = 0;
909
- for (; N < u; ) {
910
- const q = g.groupIndices[Z], Q = g.groupIndices.length === Z + 1 ? 1 / 0 : g.groupIndices[Z + 1] - q - 1;
911
- L.push({
912
- endIndex: q,
913
- size: V,
914
- startIndex: q
915
- }), L.push({
916
- endIndex: q + 1 + Q - 1,
905
+ D(h),
906
+ B(([u, p]) => {
907
+ const b = p.groupIndices.length > 0, z = [], F = p.lastSize;
908
+ if (b) {
909
+ const O = ie(p.sizeTree, 0);
910
+ let V = 0, U = 0;
911
+ for (; V < u; ) {
912
+ const j = p.groupIndices[U], X = p.groupIndices.length === U + 1 ? 1 / 0 : p.groupIndices[U + 1] - j - 1;
913
+ z.push({
914
+ endIndex: j,
917
915
  size: O,
918
- startIndex: q + 1
919
- }), Z++, N += Q + 1;
916
+ startIndex: j
917
+ }), z.push({
918
+ endIndex: j + 1 + X - 1,
919
+ size: F,
920
+ startIndex: j + 1
921
+ }), U++, V += X + 1;
920
922
  }
921
- const F = Nt(g.sizeTree);
922
- return N !== u && F.shift(), F.reduce(
923
- (q, { k: Q, v: gt }) => {
924
- let lt = q.ranges;
925
- return q.prevSize !== 0 && (lt = [
926
- ...q.ranges,
923
+ const q = Nt(p.sizeTree);
924
+ return V !== u && q.shift(), q.reduce(
925
+ (j, { k: X, v: gt }) => {
926
+ let ct = j.ranges;
927
+ return j.prevSize !== 0 && (ct = [
928
+ ...j.ranges,
927
929
  {
928
- endIndex: Q + u - 1,
929
- size: q.prevSize,
930
- startIndex: q.prevIndex
930
+ endIndex: X + u - 1,
931
+ size: j.prevSize,
932
+ startIndex: j.prevIndex
931
933
  }
932
934
  ]), {
933
- prevIndex: Q + u,
935
+ prevIndex: X + u,
934
936
  prevSize: gt,
935
- ranges: lt
937
+ ranges: ct
936
938
  };
937
939
  },
938
940
  {
939
941
  prevIndex: u,
940
942
  prevSize: 0,
941
- ranges: L
943
+ ranges: z
942
944
  }
943
945
  ).ranges;
944
946
  }
945
- return Nt(g.sizeTree).reduce(
946
- (V, { k: N, v: Z }) => ({
947
- prevIndex: N + u,
948
- prevSize: Z,
949
- ranges: [...V.ranges, { endIndex: N + u - 1, size: V.prevSize, startIndex: V.prevIndex }]
947
+ return Nt(p.sizeTree).reduce(
948
+ (O, { k: V, v: U }) => ({
949
+ prevIndex: V + u,
950
+ prevSize: U,
951
+ ranges: [...O.ranges, { endIndex: V + u - 1, size: O.prevSize, startIndex: O.prevIndex }]
950
952
  }),
951
953
  {
952
954
  prevIndex: 0,
953
- prevSize: O,
955
+ prevSize: F,
954
956
  ranges: []
955
957
  }
956
958
  ).ranges;
@@ -958,78 +960,78 @@ const _o = {
958
960
  ),
959
961
  n
960
962
  );
961
- const k = Tt(
962
- x(
963
+ const k = Ct(
964
+ S(
963
965
  i,
964
- $(f, R),
965
- B(([u, { offsetTree: g }, C]) => {
966
- const L = -u;
967
- return ce(L, g, C);
966
+ D(h, R),
967
+ B(([u, { offsetTree: p }, b]) => {
968
+ const z = -u;
969
+ return ce(z, p, b);
968
970
  })
969
971
  )
970
972
  );
971
- return z(
972
- x(
973
+ return L(
974
+ S(
973
975
  i,
974
- $(f, R),
975
- B(([u, g, C]) => {
976
- if (g.groupIndices.length > 0) {
977
- if (J(g.sizeTree))
978
- return g;
979
- let V = Yt();
980
- const N = it(a);
981
- let Z = 0, F = 0, mt = 0;
982
- for (; Z < -u; ) {
983
- mt = N[F];
984
- const Q = N[F + 1] - mt - 1;
985
- F++, Z += Q + 1;
976
+ D(h, R),
977
+ B(([u, p, b]) => {
978
+ if (p.groupIndices.length > 0) {
979
+ if (tt(p.sizeTree))
980
+ return p;
981
+ let O = Yt();
982
+ const V = ot(a);
983
+ let U = 0, q = 0, $ = 0;
984
+ for (; U < -u; ) {
985
+ $ = V[q];
986
+ const X = V[q + 1] - $ - 1;
987
+ q++, U += X + 1;
986
988
  }
987
- if (V = Nt(g.sizeTree).reduce((Q, { k: gt, v: lt }) => vt(Q, Math.max(0, gt + u), lt), V), Z !== -u) {
988
- const Q = ie(g.sizeTree, mt);
989
- V = vt(V, 0, Q);
990
- const gt = Rt(g.sizeTree, -u + 1)[1];
991
- V = vt(V, 1, gt);
989
+ if (O = Nt(p.sizeTree).reduce((X, { k: gt, v: ct }) => vt(X, Math.max(0, gt + u), ct), O), U !== -u) {
990
+ const X = ie(p.sizeTree, $);
991
+ O = vt(O, 0, X);
992
+ const gt = Rt(p.sizeTree, -u + 1)[1];
993
+ O = vt(O, 1, gt);
992
994
  }
993
995
  return {
994
- ...g,
995
- sizeTree: V,
996
- ...Ge(g.offsetTree, 0, V, C)
996
+ ...p,
997
+ sizeTree: O,
998
+ ...Ae(p.offsetTree, 0, O, b)
997
999
  };
998
1000
  }
999
- const O = Nt(g.sizeTree).reduce((V, { k: N, v: Z }) => vt(V, Math.max(0, N + u), Z), Yt());
1001
+ const F = Nt(p.sizeTree).reduce((O, { k: V, v: U }) => vt(O, Math.max(0, V + u), U), Yt());
1000
1002
  return {
1001
- ...g,
1002
- sizeTree: O,
1003
- ...Ge(g.offsetTree, 0, O, C)
1003
+ ...p,
1004
+ sizeTree: F,
1005
+ ...Ae(p.offsetTree, 0, F, b)
1004
1006
  };
1005
1007
  })
1006
1008
  ),
1007
- f
1009
+ h
1008
1010
  ), {
1009
- beforeUnshiftWith: y,
1011
+ beforeUnshiftWith: C,
1010
1012
  // input
1011
- data: w,
1012
- defaultItemSize: m,
1013
+ data: y,
1014
+ defaultItemSize: f,
1013
1015
  firstItemIndex: l,
1014
1016
  fixedItemSize: d,
1015
1017
  fixedGroupSize: v,
1016
1018
  gap: R,
1017
1019
  groupIndices: c,
1018
- heightEstimates: p,
1019
- itemSize: I,
1020
- listRefresh: H,
1020
+ heightEstimates: m,
1021
+ itemSize: g,
1022
+ listRefresh: x,
1021
1023
  shiftWith: i,
1022
1024
  shiftWithOffset: k,
1023
1025
  sizeRanges: n,
1024
1026
  // output
1025
- sizes: f,
1027
+ sizes: h,
1026
1028
  statefulTotalCount: r,
1027
1029
  totalCount: o,
1028
- trackItemSizes: S,
1030
+ trackItemSizes: T,
1029
1031
  unshiftWith: s
1030
1032
  };
1031
1033
  },
1032
- rt(Gt, Ue),
1034
+ it(Gt, Ke),
1033
1035
  { singleton: !0 }
1034
1036
  );
1035
1037
  function No(t) {
@@ -1041,54 +1043,54 @@ function No(t) {
1041
1043
  }
1042
1044
  );
1043
1045
  }
1044
- const qn = j(
1046
+ const Yn = Z(
1045
1047
  ([{ groupIndices: t, sizes: e, totalCount: n }, { headerHeight: o, scrollTop: r }]) => {
1046
- const s = U(), i = U(), l = Tt(x(s, B(No)));
1047
- return z(
1048
- x(
1048
+ const s = K(), i = K(), l = Ct(S(s, B(No)));
1049
+ return L(
1050
+ S(
1049
1051
  l,
1050
1052
  B((c) => c.totalCount)
1051
1053
  ),
1052
1054
  n
1053
- ), z(
1054
- x(
1055
+ ), L(
1056
+ S(
1055
1057
  l,
1056
1058
  B((c) => c.groupIndices)
1057
1059
  ),
1058
1060
  t
1059
- ), z(
1060
- x(
1061
- at(r, e, o),
1062
- P(([c, d]) => be(d)),
1063
- B(([c, d, m]) => Rt(d.groupOffsetTree, Math.max(c - m, 0), "v")[0]),
1064
- nt(),
1061
+ ), L(
1062
+ S(
1063
+ dt(r, e, o),
1064
+ W(([c, d]) => Re(d)),
1065
+ B(([c, d, f]) => Rt(d.groupOffsetTree, Math.max(c - f, 0), "v")[0]),
1066
+ rt(),
1065
1067
  B((c) => [c])
1066
1068
  ),
1067
1069
  i
1068
1070
  ), { groupCounts: s, topItemsIndexes: i };
1069
1071
  },
1070
- rt(Lt, It)
1071
- ), At = j(
1072
+ it(Lt, It)
1073
+ ), At = Z(
1072
1074
  ([{ log: t }]) => {
1073
- const e = T(!1), n = Tt(
1074
- x(
1075
+ const e = w(!1), n = Ct(
1076
+ S(
1075
1077
  e,
1076
- P((o) => o),
1077
- nt()
1078
+ W((o) => o),
1079
+ rt()
1078
1080
  )
1079
1081
  );
1080
- return Y(e, (o) => {
1081
- o && it(t)("props updated", {}, ft.DEBUG);
1082
+ return J(e, (o) => {
1083
+ o && ot(t)("props updated", {}, mt.DEBUG);
1082
1084
  }), { didMount: n, propsReady: e };
1083
1085
  },
1084
- rt(Gt),
1086
+ it(Gt),
1085
1087
  { singleton: !0 }
1086
1088
  ), Do = typeof document < "u" && "scrollBehavior" in document.documentElement.style;
1087
- function Yn(t) {
1089
+ function Zn(t) {
1088
1090
  const e = typeof t == "number" ? { index: t } : { ...t };
1089
1091
  return e.align || (e.align = "start"), (!e.behavior || !Do) && (e.behavior = "auto"), e.offset === void 0 && (e.offset = 0), e;
1090
1092
  }
1091
- const fe = j(
1093
+ const fe = Z(
1092
1094
  ([
1093
1095
  { gap: t, listRefresh: e, sizes: n, totalCount: o },
1094
1096
  {
@@ -1098,57 +1100,57 @@ const fe = j(
1098
1100
  headerHeight: l,
1099
1101
  scrollingInProgress: c,
1100
1102
  scrollTo: d,
1101
- smoothScrollTargetReached: m,
1103
+ smoothScrollTargetReached: f,
1102
1104
  viewportHeight: v
1103
1105
  },
1104
- { log: p }
1106
+ { log: m }
1105
1107
  ]) => {
1106
- const I = U(), w = U(), R = T(0);
1107
- let h = null, f = null, a = null;
1108
- function S() {
1109
- h !== null && (h(), h = null), a !== null && (a(), a = null), f && (clearTimeout(f), f = null), M(c, !1);
1108
+ const g = K(), y = K(), R = w(0);
1109
+ let I = null, h = null, a = null;
1110
+ function T() {
1111
+ I !== null && (I(), I = null), a !== null && (a(), a = null), h && (clearTimeout(h), h = null), M(c, !1);
1110
1112
  }
1111
- return z(
1112
- x(
1113
- I,
1114
- $(n, v, o, R, l, i, p),
1115
- $(t, s, r),
1113
+ return L(
1114
+ S(
1115
+ g,
1116
+ D(n, v, o, R, l, i, m),
1117
+ D(t, s, r),
1116
1118
  B(
1117
1119
  ([
1118
- [H, y, k, u, g, C, L, O],
1120
+ [x, C, k, u, p, b, z, F],
1121
+ O,
1119
1122
  V,
1120
- N,
1121
- Z
1123
+ U
1122
1124
  ]) => {
1123
- const F = Yn(H), { align: mt, behavior: q, offset: Q } = F, gt = u - 1, lt = jn(F, y, gt);
1124
- let St = ce(lt, y.offsetTree, V) + C;
1125
- mt === "end" ? (St += N + Rt(y.sizeTree, lt)[1] - k + Z, lt === gt && (St += L)) : mt === "center" ? St += (N + Rt(y.sizeTree, lt)[1] - k + Z) / 2 : St -= g, Q !== void 0 && Q !== 0 && (St += Q);
1125
+ const q = Zn(x), { align: $, behavior: j, offset: X } = q, gt = u - 1, ct = qn(q, C, gt);
1126
+ let St = ce(ct, C.offsetTree, O) + b;
1127
+ $ === "end" ? (St += V + Rt(C.sizeTree, ct)[1] - k + U, ct === gt && (St += z)) : $ === "center" ? St += (V + Rt(C.sizeTree, ct)[1] - k + U) / 2 : St -= p, X !== void 0 && X !== 0 && (St += X);
1126
1128
  const Ft = (pt) => {
1127
- S(), pt ? (O("retrying to scroll to", { location: H }, ft.DEBUG), M(I, H)) : (M(w, !0), O("list did not change, scroll successful", {}, ft.DEBUG));
1129
+ T(), pt ? (F("retrying to scroll to", { location: x }, mt.DEBUG), M(g, x)) : (M(y, !0), F("list did not change, scroll successful", {}, mt.DEBUG));
1128
1130
  };
1129
- if (S(), q === "smooth") {
1131
+ if (T(), j === "smooth") {
1130
1132
  let pt = !1;
1131
- a = Y(e, (jt) => {
1133
+ a = J(e, (jt) => {
1132
1134
  pt = pt || jt;
1133
- }), h = yt(m, () => {
1135
+ }), I = bt(f, () => {
1134
1136
  Ft(pt);
1135
1137
  });
1136
1138
  } else
1137
- h = yt(x(e, $o(150)), Ft);
1138
- return f = setTimeout(() => {
1139
- S();
1140
- }, 1200), M(c, !0), O("scrolling from index to", { behavior: q, index: lt, top: St }, ft.DEBUG), { behavior: q, top: St };
1139
+ I = bt(S(e, $o(150)), Ft);
1140
+ return h = setTimeout(() => {
1141
+ T();
1142
+ }, 1200), M(c, !0), F("scrolling from index to", { behavior: j, index: ct, top: St }, mt.DEBUG), { behavior: j, top: St };
1141
1143
  }
1142
1144
  )
1143
1145
  ),
1144
1146
  d
1145
1147
  ), {
1146
- scrollTargetReached: w,
1147
- scrollToIndex: I,
1148
+ scrollTargetReached: y,
1149
+ scrollToIndex: g,
1148
1150
  topListHeight: R
1149
1151
  };
1150
1152
  },
1151
- rt(Lt, It, Gt),
1153
+ it(Lt, It, Gt),
1152
1154
  { singleton: !0 }
1153
1155
  );
1154
1156
  function $o(t) {
@@ -1161,57 +1163,57 @@ function $o(t) {
1161
1163
  };
1162
1164
  };
1163
1165
  }
1164
- function je(t, e) {
1166
+ function qe(t, e) {
1165
1167
  t === 0 ? e() : requestAnimationFrame(() => {
1166
- je(t - 1, e);
1168
+ qe(t - 1, e);
1167
1169
  });
1168
1170
  }
1169
- function qe(t, e) {
1171
+ function Ye(t, e) {
1170
1172
  if (t === void 0)
1171
1173
  return 0;
1172
1174
  const n = e - 1, o = typeof t == "number" ? t : t.index === "LAST" ? n : t.index;
1173
1175
  return Math.max(0, Math.min(o, n));
1174
1176
  }
1175
- function Ae(t) {
1177
+ function Me(t) {
1176
1178
  return t === void 0 ? !0 : typeof t == "number" ? t === 0 : t.index === 0 && (t.align === void 0 || t.align === "start") && (t.offset === void 0 || t.offset === 0);
1177
1179
  }
1178
- const me = j(
1180
+ const me = Z(
1179
1181
  ([{ defaultItemSize: t, listRefresh: e, sizes: n }, { scrollTop: o }, { scrollTargetReached: r, scrollToIndex: s }, { didMount: i }]) => {
1180
- const l = T(!0), c = T(0), d = T(!0);
1181
- return z(
1182
- x(
1182
+ const l = w(!0), c = w(0), d = w(!0);
1183
+ return L(
1184
+ S(
1183
1185
  i,
1184
- $(c),
1185
- P(([m, v]) => !Ae(v)),
1186
+ D(c),
1187
+ W(([f, v]) => !Me(v)),
1186
1188
  Bt(!1)
1187
1189
  ),
1188
1190
  l
1189
- ), z(
1190
- x(
1191
+ ), L(
1192
+ S(
1191
1193
  i,
1192
- $(c),
1193
- P(([m, v]) => !Ae(v)),
1194
+ D(c),
1195
+ W(([f, v]) => !Me(v)),
1194
1196
  Bt(!1)
1195
1197
  ),
1196
1198
  d
1197
- ), Y(
1198
- x(
1199
- at(e, i),
1200
- $(l, n, t, d),
1201
- P(([[, m], v, { sizeTree: p }, I, w]) => m && (!J(p) || _e(I)) && !v && !w),
1202
- $(c)
1199
+ ), J(
1200
+ S(
1201
+ dt(e, i),
1202
+ D(l, n, t, d),
1203
+ W(([[, f], v, { sizeTree: m }, g, y]) => f && (!tt(m) || Ne(g)) && !v && !y),
1204
+ D(c)
1203
1205
  ),
1204
- ([, m]) => {
1205
- if (m === void 0) {
1206
+ ([, f]) => {
1207
+ if (f === void 0) {
1206
1208
  M(l, !0), M(d, !0);
1207
1209
  return;
1208
1210
  }
1209
- yt(r, () => {
1211
+ bt(r, () => {
1210
1212
  M(d, !0);
1211
- }), je(4, () => {
1212
- yt(o, () => {
1213
+ }), qe(4, () => {
1214
+ bt(o, () => {
1213
1215
  M(l, !0);
1214
- }), M(s, m);
1216
+ }), M(s, f);
1215
1217
  });
1216
1218
  }
1217
1219
  ), {
@@ -1220,10 +1222,10 @@ const me = j(
1220
1222
  scrolledToInitialItem: l
1221
1223
  };
1222
1224
  },
1223
- rt(Lt, It, fe, At),
1225
+ it(Lt, It, fe, At),
1224
1226
  { singleton: !0 }
1225
1227
  );
1226
- function Zn(t, e) {
1228
+ function Xn(t, e) {
1227
1229
  return Math.abs(t - e) < 1.01;
1228
1230
  }
1229
1231
  const ue = "up", ne = "down", Uo = "none", Ko = {
@@ -1235,182 +1237,182 @@ const ue = "up", ne = "down", Uo = "none", Ko = {
1235
1237
  scrollTop: 0,
1236
1238
  viewportHeight: 0
1237
1239
  }
1238
- }, jo = 0, pe = j(([{ footerHeight: t, headerHeight: e, scrollBy: n, scrollContainerState: o, scrollTop: r, viewportHeight: s }]) => {
1239
- const i = T(!1), l = T(!0), c = U(), d = U(), m = T(4), v = T(jo), p = ht(
1240
- x(
1241
- Fe(x(W(r), Ut(1), Bt(!0)), x(W(r), Ut(1), Bt(!1), pn(100))),
1242
- nt()
1240
+ }, jo = 0, pe = Z(([{ footerHeight: t, headerHeight: e, scrollBy: n, scrollContainerState: o, scrollTop: r, viewportHeight: s }]) => {
1241
+ const i = w(!1), l = w(!0), c = K(), d = K(), f = w(4), v = w(jo), m = ht(
1242
+ S(
1243
+ Ve(S(P(r), Ut(1), Bt(!0)), S(P(r), Ut(1), Bt(!1), hn(100))),
1244
+ rt()
1243
1245
  ),
1244
1246
  !1
1245
- ), I = ht(
1246
- x(Fe(x(n, Bt(!0)), x(n, Bt(!1), pn(200))), nt()),
1247
+ ), g = ht(
1248
+ S(Ve(S(n, Bt(!0)), S(n, Bt(!1), hn(200))), rt()),
1247
1249
  !1
1248
1250
  );
1249
- z(
1250
- x(
1251
- at(W(r), W(v)),
1252
- B(([a, S]) => a <= S),
1253
- nt()
1251
+ L(
1252
+ S(
1253
+ dt(P(r), P(v)),
1254
+ B(([a, T]) => a <= T),
1255
+ rt()
1254
1256
  ),
1255
1257
  l
1256
- ), z(x(l, zt(50)), d);
1257
- const w = Tt(
1258
- x(
1259
- at(o, W(s), W(e), W(t), W(m)),
1260
- Ot((a, [{ scrollHeight: S, scrollTop: H }, y, k, u, g]) => {
1261
- const C = H + y - S > -g, L = {
1262
- scrollHeight: S,
1263
- scrollTop: H,
1264
- viewportHeight: y
1258
+ ), L(S(l, zt(50)), d);
1259
+ const y = Ct(
1260
+ S(
1261
+ dt(o, P(s), P(e), P(t), P(f)),
1262
+ kt((a, [{ scrollHeight: T, scrollTop: x }, C, k, u, p]) => {
1263
+ const b = x + C - T > -p, z = {
1264
+ scrollHeight: T,
1265
+ scrollTop: x,
1266
+ viewportHeight: C
1265
1267
  };
1266
- if (C) {
1267
- let V, N;
1268
- return H > a.state.scrollTop ? (V = "SCROLLED_DOWN", N = a.state.scrollTop - H) : (V = "SIZE_DECREASED", N = a.state.scrollTop - H || a.scrollTopDelta), {
1268
+ if (b) {
1269
+ let O, V;
1270
+ return x > a.state.scrollTop ? (O = "SCROLLED_DOWN", V = a.state.scrollTop - x) : (O = "SIZE_DECREASED", V = a.state.scrollTop - x || a.scrollTopDelta), {
1269
1271
  atBottom: !0,
1270
- atBottomBecause: V,
1271
- scrollTopDelta: N,
1272
- state: L
1272
+ atBottomBecause: O,
1273
+ scrollTopDelta: V,
1274
+ state: z
1273
1275
  };
1274
1276
  }
1275
- let O;
1276
- return L.scrollHeight > a.state.scrollHeight ? O = "SIZE_INCREASED" : y < a.state.viewportHeight ? O = "VIEWPORT_HEIGHT_DECREASING" : H < a.state.scrollTop ? O = "SCROLLING_UPWARDS" : O = "NOT_FULLY_SCROLLED_TO_LAST_ITEM_BOTTOM", {
1277
+ let F;
1278
+ return z.scrollHeight > a.state.scrollHeight ? F = "SIZE_INCREASED" : C < a.state.viewportHeight ? F = "VIEWPORT_HEIGHT_DECREASING" : x < a.state.scrollTop ? F = "SCROLLING_UPWARDS" : F = "NOT_FULLY_SCROLLED_TO_LAST_ITEM_BOTTOM", {
1277
1279
  atBottom: !1,
1278
- notAtBottomBecause: O,
1279
- state: L
1280
+ notAtBottomBecause: F,
1281
+ state: z
1280
1282
  };
1281
1283
  }, Ko),
1282
- nt((a, S) => a !== void 0 && a.atBottom === S.atBottom)
1284
+ rt((a, T) => a !== void 0 && a.atBottom === T.atBottom)
1283
1285
  )
1284
1286
  ), R = ht(
1285
- x(
1287
+ S(
1286
1288
  o,
1287
- Ot(
1288
- (a, { scrollHeight: S, scrollTop: H, viewportHeight: y }) => {
1289
- if (!Zn(a.scrollHeight, S)) {
1290
- const k = S - (H + y) < 1;
1291
- return a.scrollTop !== H && k ? {
1289
+ kt(
1290
+ (a, { scrollHeight: T, scrollTop: x, viewportHeight: C }) => {
1291
+ if (!Xn(a.scrollHeight, T)) {
1292
+ const k = T - (x + C) < 1;
1293
+ return a.scrollTop !== x && k ? {
1292
1294
  changed: !0,
1293
- jump: a.scrollTop - H,
1294
- scrollHeight: S,
1295
- scrollTop: H
1295
+ jump: a.scrollTop - x,
1296
+ scrollHeight: T,
1297
+ scrollTop: x
1296
1298
  } : {
1297
1299
  changed: !0,
1298
1300
  jump: 0,
1299
- scrollHeight: S,
1300
- scrollTop: H
1301
+ scrollHeight: T,
1302
+ scrollTop: x
1301
1303
  };
1302
1304
  }
1303
1305
  return {
1304
1306
  changed: !1,
1305
1307
  jump: 0,
1306
- scrollHeight: S,
1307
- scrollTop: H
1308
+ scrollHeight: T,
1309
+ scrollTop: x
1308
1310
  };
1309
1311
  },
1310
1312
  { changed: !1, jump: 0, scrollHeight: 0, scrollTop: 0 }
1311
1313
  ),
1312
- P((a) => a.changed),
1314
+ W((a) => a.changed),
1313
1315
  B((a) => a.jump)
1314
1316
  ),
1315
1317
  0
1316
1318
  );
1317
- z(
1318
- x(
1319
- w,
1319
+ L(
1320
+ S(
1321
+ y,
1320
1322
  B((a) => a.atBottom)
1321
1323
  ),
1322
1324
  i
1323
- ), z(x(i, zt(50)), c);
1324
- const h = T(ne);
1325
- z(
1326
- x(
1325
+ ), L(S(i, zt(50)), c);
1326
+ const I = w(ne);
1327
+ L(
1328
+ S(
1327
1329
  o,
1328
1330
  B(({ scrollTop: a }) => a),
1329
- nt(),
1330
- Ot(
1331
- (a, S) => it(I) ? { direction: a.direction, prevScrollTop: S } : { direction: S < a.prevScrollTop ? ue : ne, prevScrollTop: S },
1331
+ rt(),
1332
+ kt(
1333
+ (a, T) => ot(g) ? { direction: a.direction, prevScrollTop: T } : { direction: T < a.prevScrollTop ? ue : ne, prevScrollTop: T },
1332
1334
  { direction: ne, prevScrollTop: 0 }
1333
1335
  ),
1334
1336
  B((a) => a.direction)
1335
1337
  ),
1336
- h
1337
- ), z(x(o, zt(50), Bt(Uo)), h);
1338
- const f = T(0);
1339
- return z(
1340
- x(
1341
- p,
1342
- P((a) => !a),
1338
+ I
1339
+ ), L(S(o, zt(50), Bt(Uo)), I);
1340
+ const h = w(0);
1341
+ return L(
1342
+ S(
1343
+ m,
1344
+ W((a) => !a),
1343
1345
  Bt(0)
1344
1346
  ),
1345
- f
1346
- ), z(
1347
- x(
1347
+ h
1348
+ ), L(
1349
+ S(
1348
1350
  r,
1349
1351
  zt(100),
1350
- $(p),
1351
- P(([a, S]) => S),
1352
- Ot(([a, S], [H]) => [S, H], [0, 0]),
1353
- B(([a, S]) => S - a)
1352
+ D(m),
1353
+ W(([a, T]) => T),
1354
+ kt(([a, T], [x]) => [T, x], [0, 0]),
1355
+ B(([a, T]) => T - a)
1354
1356
  ),
1355
- f
1357
+ h
1356
1358
  ), {
1357
- atBottomState: w,
1359
+ atBottomState: y,
1358
1360
  atBottomStateChange: c,
1359
- atBottomThreshold: m,
1361
+ atBottomThreshold: f,
1360
1362
  atTopStateChange: d,
1361
1363
  atTopThreshold: v,
1362
1364
  isAtBottom: i,
1363
1365
  isAtTop: l,
1364
- isScrolling: p,
1366
+ isScrolling: m,
1365
1367
  lastJumpDueToItemResize: R,
1366
- scrollDirection: h,
1367
- scrollVelocity: f
1368
+ scrollDirection: I,
1369
+ scrollVelocity: h
1368
1370
  };
1369
- }, rt(It)), ae = "top", de = "bottom", xn = "none";
1370
- function vn(t, e, n) {
1371
+ }, it(It)), ae = "top", de = "bottom", vn = "none";
1372
+ function Tn(t, e, n) {
1371
1373
  return typeof t == "number" ? n === ue && e === ae || n === ne && e === de ? t : 0 : n === ue ? e === ae ? t.main : t.reverse : e === de ? t.main : t.reverse;
1372
1374
  }
1373
- function Tn(t, e) {
1375
+ function Cn(t, e) {
1374
1376
  return typeof t == "number" ? t : t[e] ?? 0;
1375
1377
  }
1376
- const Ye = j(
1378
+ const Ze = Z(
1377
1379
  ([{ deviation: t, fixedHeaderHeight: e, headerHeight: n, scrollTop: o, viewportHeight: r }]) => {
1378
- const s = U(), i = T(0), l = T(0), c = T(0), d = ht(
1379
- x(
1380
- at(
1381
- W(o),
1382
- W(r),
1383
- W(n),
1384
- W(s, le),
1385
- W(c),
1386
- W(i),
1387
- W(e),
1388
- W(t),
1389
- W(l)
1380
+ const s = K(), i = w(0), l = w(0), c = w(0), d = ht(
1381
+ S(
1382
+ dt(
1383
+ P(o),
1384
+ P(r),
1385
+ P(n),
1386
+ P(s, le),
1387
+ P(c),
1388
+ P(i),
1389
+ P(e),
1390
+ P(t),
1391
+ P(l)
1390
1392
  ),
1391
1393
  B(
1392
1394
  ([
1393
- m,
1395
+ f,
1394
1396
  v,
1395
- p,
1396
- [I, w],
1397
+ m,
1398
+ [g, y],
1397
1399
  R,
1400
+ I,
1398
1401
  h,
1399
- f,
1400
1402
  a,
1401
- S
1403
+ T
1402
1404
  ]) => {
1403
- const H = m - a, y = h + f, k = Math.max(p - H, 0);
1404
- let u = xn;
1405
- const g = Tn(S, ae), C = Tn(S, de);
1406
- return I -= a, I += p + f, w += p + f, w -= a, I > m + y - g && (u = ue), w < m - k + v + C && (u = ne), u !== xn ? [
1407
- Math.max(H - p - vn(R, ae, u) - g, 0),
1408
- H - k - f + v + vn(R, de, u) + C
1405
+ const x = f - a, C = I + h, k = Math.max(m - x, 0);
1406
+ let u = vn;
1407
+ const p = Cn(T, ae), b = Cn(T, de);
1408
+ return g -= a, g += m + h, y += m + h, y -= a, g > f + C - p && (u = ue), y < f - k + v + b && (u = ne), u !== vn ? [
1409
+ Math.max(x - m - Tn(R, ae, u) - p, 0),
1410
+ x - k - h + v + Tn(R, de, u) + b
1409
1411
  ] : null;
1410
1412
  }
1411
1413
  ),
1412
- P((m) => m !== null),
1413
- nt(le)
1414
+ W((f) => f !== null),
1415
+ rt(le)
1414
1416
  ),
1415
1417
  [0, 0]
1416
1418
  );
@@ -1424,12 +1426,12 @@ const Ye = j(
1424
1426
  visibleRange: d
1425
1427
  };
1426
1428
  },
1427
- rt(It),
1429
+ it(It),
1428
1430
  { singleton: !0 }
1429
1431
  );
1430
1432
  function qo(t, e, n) {
1431
- if (be(e)) {
1432
- const o = Kn(t, e);
1433
+ if (Re(e)) {
1434
+ const o = jn(t, e);
1433
1435
  return [
1434
1436
  { index: Rt(e.groupOffsetTree, o)[0], offset: 0, size: 0 },
1435
1437
  { data: n?.[0], index: o, offset: 0, size: 0 }
@@ -1450,34 +1452,34 @@ const Oe = {
1450
1452
  };
1451
1453
  function ve(t, e, n, o, r, s) {
1452
1454
  const { lastIndex: i, lastOffset: l, lastSize: c } = r;
1453
- let d = 0, m = 0;
1455
+ let d = 0, f = 0;
1454
1456
  if (t.length > 0) {
1455
1457
  d = t[0].offset;
1456
1458
  const R = t[t.length - 1];
1457
- m = R.offset + R.size;
1459
+ f = R.offset + R.size;
1458
1460
  }
1459
- const v = n - i, p = l + v * c + (v - 1) * o, I = d, w = p - m;
1461
+ const v = n - i, m = l + v * c + (v - 1) * o, g = d, y = m - f;
1460
1462
  return {
1461
- bottom: m,
1463
+ bottom: f,
1462
1464
  firstItemIndex: s,
1463
- items: Cn(t, r, s),
1464
- offsetBottom: w,
1465
+ items: wn(t, r, s),
1466
+ offsetBottom: y,
1465
1467
  offsetTop: d,
1466
- top: I,
1467
- topItems: Cn(e, r, s),
1468
- topListHeight: e.reduce((R, h) => h.size + R, 0),
1468
+ top: g,
1469
+ topItems: wn(e, r, s),
1470
+ topListHeight: e.reduce((R, I) => I.size + R, 0),
1469
1471
  totalCount: n
1470
1472
  };
1471
1473
  }
1472
- function Xn(t, e, n, o, r, s) {
1474
+ function Jn(t, e, n, o, r, s) {
1473
1475
  let i = 0;
1474
1476
  if (n.groupIndices.length > 0)
1475
- for (const m of n.groupIndices) {
1476
- if (m - i >= t)
1477
+ for (const f of n.groupIndices) {
1478
+ if (f - i >= t)
1477
1479
  break;
1478
1480
  i++;
1479
1481
  }
1480
- const l = t + i, c = qe(e, l), d = Array.from({ length: l }).map((m, v) => ({
1482
+ const l = t + i, c = Ye(e, l), d = Array.from({ length: l }).map((f, v) => ({
1481
1483
  data: s[v + c],
1482
1484
  index: v + c,
1483
1485
  offset: 0,
@@ -1485,24 +1487,24 @@ function Xn(t, e, n, o, r, s) {
1485
1487
  }));
1486
1488
  return ve(d, [], l, r, n, o);
1487
1489
  }
1488
- function Cn(t, e, n) {
1490
+ function wn(t, e, n) {
1489
1491
  if (t.length === 0)
1490
1492
  return [];
1491
- if (!be(e))
1493
+ if (!Re(e))
1492
1494
  return t.map((d) => ({ ...d, index: d.index + n, originalIndex: d.index }));
1493
1495
  const o = t[0].index, r = t[t.length - 1].index, s = [], i = Zt(e.groupOffsetTree, o, r);
1494
1496
  let l, c = 0;
1495
1497
  for (const d of t) {
1496
1498
  (!l || l.end < d.index) && (l = i.shift(), c = e.groupIndices.indexOf(l.start));
1497
- let m;
1498
- d.index === l.start ? m = {
1499
+ let f;
1500
+ d.index === l.start ? f = {
1499
1501
  index: c,
1500
1502
  type: "group"
1501
- } : m = {
1503
+ } : f = {
1502
1504
  groupIndex: c,
1503
1505
  index: d.index - (c + 1) + n
1504
1506
  }, s.push({
1505
- ...m,
1507
+ ...f,
1506
1508
  data: d.data,
1507
1509
  offset: d.offset,
1508
1510
  originalIndex: d.index,
@@ -1511,390 +1513,390 @@ function Cn(t, e, n) {
1511
1513
  }
1512
1514
  return s;
1513
1515
  }
1514
- function wn(t, e) {
1516
+ function yn(t, e) {
1515
1517
  return t === void 0 ? 0 : typeof t == "number" ? t : t[e] ?? 0;
1516
1518
  }
1517
- const Kt = j(
1519
+ const Kt = Z(
1518
1520
  ([
1519
1521
  { data: t, firstItemIndex: e, gap: n, sizes: o, totalCount: r },
1520
1522
  s,
1521
1523
  { listBoundary: i, topListHeight: l, visibleRange: c },
1522
- { initialTopMostItemIndex: d, scrolledToInitialItem: m },
1524
+ { initialTopMostItemIndex: d, scrolledToInitialItem: f },
1523
1525
  { topListHeight: v },
1524
- p,
1525
- { didMount: I },
1526
- { recalcInProgress: w }
1526
+ m,
1527
+ { didMount: g },
1528
+ { recalcInProgress: y }
1527
1529
  ]) => {
1528
- const R = T([]), h = T(0), f = U(), a = T(0);
1529
- z(s.topItemsIndexes, R);
1530
- const S = ht(
1531
- x(
1532
- at(
1533
- I,
1534
- w,
1535
- W(c, le),
1536
- W(r),
1537
- W(o),
1538
- W(d),
1539
- m,
1540
- W(R),
1541
- W(e),
1542
- W(n),
1543
- W(a),
1530
+ const R = w([]), I = w(0), h = K(), a = w(0);
1531
+ L(s.topItemsIndexes, R);
1532
+ const T = ht(
1533
+ S(
1534
+ dt(
1535
+ g,
1536
+ y,
1537
+ P(c, le),
1538
+ P(r),
1539
+ P(o),
1540
+ P(d),
1541
+ f,
1542
+ P(R),
1543
+ P(e),
1544
+ P(n),
1545
+ P(a),
1544
1546
  t
1545
1547
  ),
1546
- P(([u, g, , C, , , , , , , , L]) => {
1547
- const O = L !== void 0 && L.length !== C;
1548
- return u && !g && !O;
1548
+ W(([u, p, , b, , , , , , , , z]) => {
1549
+ const F = z !== void 0 && z.length !== b;
1550
+ return u && !p && !F;
1549
1551
  }),
1550
1552
  B(
1551
1553
  ([
1552
1554
  ,
1553
1555
  ,
1554
- [u, g],
1555
- C,
1556
- L,
1556
+ [u, p],
1557
+ b,
1558
+ z,
1559
+ F,
1557
1560
  O,
1558
1561
  V,
1559
- N,
1560
- Z,
1561
- F,
1562
- mt,
1563
- q
1562
+ U,
1563
+ q,
1564
+ $,
1565
+ j
1564
1566
  ]) => {
1565
- const Q = L, { offsetTree: gt, sizeTree: lt } = Q, St = it(h);
1566
- if (C === 0)
1567
- return { ...Oe, totalCount: C };
1568
- if (u === 0 && g === 0)
1569
- return St === 0 ? { ...Oe, totalCount: C } : Xn(St, O, L, Z, F, q || []);
1570
- if (J(lt))
1567
+ const X = z, { offsetTree: gt, sizeTree: ct } = X, St = ot(I);
1568
+ if (b === 0)
1569
+ return { ...Oe, totalCount: b };
1570
+ if (u === 0 && p === 0)
1571
+ return St === 0 ? { ...Oe, totalCount: b } : Jn(St, F, z, U, q, j || []);
1572
+ if (tt(ct))
1571
1573
  return St > 0 ? null : ve(
1572
- qo(qe(O, C), Q, q),
1574
+ qo(Ye(F, b), X, j),
1573
1575
  [],
1574
- C,
1575
- F,
1576
- Q,
1577
- Z
1576
+ b,
1577
+ q,
1578
+ X,
1579
+ U
1578
1580
  );
1579
1581
  const Ft = [];
1580
- if (N.length > 0) {
1581
- const D = N[0], K = N[N.length - 1];
1582
- let st = 0;
1583
- for (const tt of Zt(lt, D, K)) {
1584
- const X = tt.value, ct = Math.max(tt.start, D), xt = Math.min(tt.end, K);
1585
- for (let ut = ct; ut <= xt; ut++)
1586
- Ft.push({ data: q?.[ut], index: ut, offset: st, size: X }), st += X;
1582
+ if (V.length > 0) {
1583
+ const N = V[0], Y = V[V.length - 1];
1584
+ let lt = 0;
1585
+ for (const et of Zt(ct, N, Y)) {
1586
+ const Q = et.value, ut = Math.max(et.start, N), xt = Math.min(et.end, Y);
1587
+ for (let at = ut; at <= xt; at++)
1588
+ Ft.push({ data: j?.[at], index: at, offset: lt, size: Q }), lt += Q;
1587
1589
  }
1588
1590
  }
1589
- if (!V)
1590
- return ve([], Ft, C, F, Q, Z);
1591
- const pt = N.length > 0 ? N[N.length - 1] + 1 : 0, jt = Wo(gt, u, g, pt);
1591
+ if (!O)
1592
+ return ve([], Ft, b, q, X, U);
1593
+ const pt = V.length > 0 ? V[V.length - 1] + 1 : 0, jt = Po(gt, u, p, pt);
1592
1594
  if (jt.length === 0)
1593
1595
  return null;
1594
- const Qt = C - 1, Et = ye([], (D) => {
1595
- for (const K of jt) {
1596
- const st = K.value;
1597
- let tt = st.offset, X = K.start;
1598
- const ct = st.size;
1599
- if (st.offset < u) {
1600
- X += Math.floor((u - st.offset + F) / (ct + F));
1601
- const ut = X - K.start;
1602
- tt += ut * ct + ut * F;
1596
+ const Qt = b - 1, Et = ye([], (N) => {
1597
+ for (const Y of jt) {
1598
+ const lt = Y.value;
1599
+ let et = lt.offset, Q = Y.start;
1600
+ const ut = lt.size;
1601
+ if (lt.offset < u) {
1602
+ Q += Math.floor((u - lt.offset + q) / (ut + q));
1603
+ const at = Q - Y.start;
1604
+ et += at * ut + at * q;
1603
1605
  }
1604
- X < pt && (tt += (pt - X) * ct, X = pt);
1605
- const xt = Math.min(K.end, Qt);
1606
- for (let ut = X; ut <= xt && !(tt >= g); ut++)
1607
- D.push({ data: q?.[ut], index: ut, offset: tt, size: ct }), tt += ct + F;
1606
+ Q < pt && (et += (pt - Q) * ut, Q = pt);
1607
+ const xt = Math.min(Y.end, Qt);
1608
+ for (let at = Q; at <= xt && !(et >= p); at++)
1609
+ N.push({ data: j?.[at], index: at, offset: et, size: ut }), et += ut + q;
1608
1610
  }
1609
- }), te = wn(mt, ae), b = wn(mt, de);
1610
- if (Et.length > 0 && (te > 0 || b > 0)) {
1611
- const D = Et[0], K = Et[Et.length - 1];
1612
- if (te > 0 && D.index > pt) {
1613
- const st = Math.min(te, D.index - pt), tt = [];
1614
- let X = D.offset;
1615
- for (let ct = D.index - 1; ct >= D.index - st; ct--) {
1616
- const ut = Zt(lt, ct, ct)[0]?.value ?? D.size;
1617
- X -= ut + F, tt.unshift({ data: q?.[ct], index: ct, offset: X, size: ut });
1611
+ }), te = yn($, ae), H = yn($, de);
1612
+ if (Et.length > 0 && (te > 0 || H > 0)) {
1613
+ const N = Et[0], Y = Et[Et.length - 1];
1614
+ if (te > 0 && N.index > pt) {
1615
+ const lt = Math.min(te, N.index - pt), et = [];
1616
+ let Q = N.offset;
1617
+ for (let ut = N.index - 1; ut >= N.index - lt; ut--) {
1618
+ const at = Zt(ct, ut, ut)[0]?.value ?? N.size;
1619
+ Q -= at + q, et.unshift({ data: j?.[ut], index: ut, offset: Q, size: at });
1618
1620
  }
1619
- Et.unshift(...tt);
1621
+ Et.unshift(...et);
1620
1622
  }
1621
- if (b > 0 && K.index < Qt) {
1622
- const st = Math.min(b, Qt - K.index);
1623
- let tt = K.offset + K.size + F;
1624
- for (let X = K.index + 1; X <= K.index + st; X++) {
1625
- const xt = Zt(lt, X, X)[0]?.value ?? K.size;
1626
- Et.push({ data: q?.[X], index: X, offset: tt, size: xt }), tt += xt + F;
1623
+ if (H > 0 && Y.index < Qt) {
1624
+ const lt = Math.min(H, Qt - Y.index);
1625
+ let et = Y.offset + Y.size + q;
1626
+ for (let Q = Y.index + 1; Q <= Y.index + lt; Q++) {
1627
+ const xt = Zt(ct, Q, Q)[0]?.value ?? Y.size;
1628
+ Et.push({ data: j?.[Q], index: Q, offset: et, size: xt }), et += xt + q;
1627
1629
  }
1628
1630
  }
1629
1631
  }
1630
- return ve(Et, Ft, C, F, Q, Z);
1632
+ return ve(Et, Ft, b, q, X, U);
1631
1633
  }
1632
1634
  ),
1633
1635
  //@ts-expect-error filter needs to be fixed
1634
- P((u) => u !== null),
1635
- nt()
1636
+ W((u) => u !== null),
1637
+ rt()
1636
1638
  ),
1637
1639
  Oe
1638
1640
  );
1639
- z(
1640
- x(
1641
+ L(
1642
+ S(
1641
1643
  t,
1642
- P(_e),
1644
+ W(Ne),
1643
1645
  B((u) => u?.length)
1644
1646
  ),
1645
1647
  r
1646
- ), z(
1647
- x(
1648
- S,
1648
+ ), L(
1649
+ S(
1650
+ T,
1649
1651
  B((u) => u.topListHeight)
1650
1652
  ),
1651
1653
  v
1652
- ), z(v, l), z(
1653
- x(
1654
- S,
1654
+ ), L(v, l), L(
1655
+ S(
1656
+ T,
1655
1657
  B((u) => [u.top, u.bottom])
1656
1658
  ),
1657
1659
  i
1658
- ), z(
1659
- x(
1660
- S,
1660
+ ), L(
1661
+ S(
1662
+ T,
1661
1663
  B((u) => u.items)
1662
1664
  ),
1663
- f
1665
+ h
1664
1666
  );
1665
- const H = Tt(
1666
- x(
1667
- S,
1668
- P(({ items: u }) => u.length > 0),
1669
- $(r, t),
1670
- P(([{ items: u }, g]) => u[u.length - 1].originalIndex === g - 1),
1671
- B(([, u, g]) => [u - 1, g]),
1672
- nt(le),
1667
+ const x = Ct(
1668
+ S(
1669
+ T,
1670
+ W(({ items: u }) => u.length > 0),
1671
+ D(r, t),
1672
+ W(([{ items: u }, p]) => u[u.length - 1].originalIndex === p - 1),
1673
+ B(([, u, p]) => [u - 1, p]),
1674
+ rt(le),
1673
1675
  B(([u]) => u)
1674
1676
  )
1675
- ), y = Tt(
1676
- x(
1677
- S,
1677
+ ), C = Ct(
1678
+ S(
1679
+ T,
1678
1680
  zt(200),
1679
- P(({ items: u, topItems: g }) => u.length > 0 && u[0].originalIndex === g.length),
1681
+ W(({ items: u, topItems: p }) => u.length > 0 && u[0].originalIndex === p.length),
1680
1682
  B(({ items: u }) => u[0].index),
1681
- nt()
1683
+ rt()
1682
1684
  )
1683
- ), k = Tt(
1684
- x(
1685
- S,
1686
- P(({ items: u }) => u.length > 0),
1685
+ ), k = Ct(
1686
+ S(
1687
+ T,
1688
+ W(({ items: u }) => u.length > 0),
1687
1689
  // oxlint-disable-next-line array-callback-return -- callback always returns after trimming group sentinels
1688
1690
  B(({ items: u }) => {
1689
- let g = 0, C = u.length - 1;
1690
- for (; u[g].type === "group" && g < C; )
1691
- g++;
1692
- for (; u[C].type === "group" && C > g; )
1693
- C--;
1691
+ let p = 0, b = u.length - 1;
1692
+ for (; u[p].type === "group" && p < b; )
1693
+ p++;
1694
+ for (; u[b].type === "group" && b > p; )
1695
+ b--;
1694
1696
  return {
1695
- endIndex: u[C].index,
1696
- startIndex: u[g].index
1697
+ endIndex: u[b].index,
1698
+ startIndex: u[p].index
1697
1699
  };
1698
1700
  }),
1699
- nt($n)
1701
+ rt(Un)
1700
1702
  )
1701
1703
  );
1702
1704
  return {
1703
- endReached: H,
1704
- initialItemCount: h,
1705
- itemsRendered: f,
1706
- listState: S,
1705
+ endReached: x,
1706
+ initialItemCount: I,
1707
+ itemsRendered: h,
1708
+ listState: T,
1707
1709
  minOverscanItemCount: a,
1708
1710
  rangeChanged: k,
1709
- startReached: y,
1711
+ startReached: C,
1710
1712
  topItemsIndexes: R,
1711
- ...p
1713
+ ...m
1712
1714
  };
1713
1715
  },
1714
- rt(
1716
+ it(
1715
1717
  Lt,
1716
- qn,
1717
- Ye,
1718
+ Yn,
1719
+ Ze,
1718
1720
  me,
1719
1721
  fe,
1720
1722
  pe,
1721
1723
  At,
1722
- Ue
1724
+ Ke
1723
1725
  ),
1724
1726
  { singleton: !0 }
1725
- ), Jn = j(
1727
+ ), Qn = Z(
1726
1728
  ([{ fixedFooterHeight: t, fixedHeaderHeight: e, footerHeight: n, headerHeight: o }, { listState: r }]) => {
1727
- const s = U(), i = ht(
1728
- x(
1729
- at(n, t, o, e, r),
1730
- B(([l, c, d, m, v]) => l + c + d + m + v.offsetBottom + v.bottom)
1729
+ const s = K(), i = ht(
1730
+ S(
1731
+ dt(n, t, o, e, r),
1732
+ B(([l, c, d, f, v]) => l + c + d + f + v.offsetBottom + v.bottom)
1731
1733
  ),
1732
1734
  0
1733
1735
  );
1734
- return z(W(i), s), { totalListHeight: i, totalListHeightChanged: s };
1736
+ return L(P(i), s), { totalListHeight: i, totalListHeightChanged: s };
1735
1737
  },
1736
- rt(It, Kt),
1738
+ it(It, Kt),
1737
1739
  { singleton: !0 }
1738
- ), Yo = j(
1740
+ ), Yo = Z(
1739
1741
  ([{ viewportHeight: t }, { totalListHeight: e }]) => {
1740
- const n = T(!1), o = ht(
1741
- x(
1742
- at(n, t, e),
1743
- P(([r]) => r),
1742
+ const n = w(!1), o = ht(
1743
+ S(
1744
+ dt(n, t, e),
1745
+ W(([r]) => r),
1744
1746
  B(([, r, s]) => Math.max(0, r - s)),
1745
1747
  zt(0),
1746
- nt()
1748
+ rt()
1747
1749
  ),
1748
1750
  0
1749
1751
  );
1750
1752
  return { alignToBottom: n, paddingTopAddition: o };
1751
1753
  },
1752
- rt(It, Jn),
1754
+ it(It, Qn),
1753
1755
  { singleton: !0 }
1754
- ), Qn = j(() => ({
1755
- context: T(null)
1756
+ ), to = Z(() => ({
1757
+ context: w(null)
1756
1758
  })), Zo = ({
1757
1759
  itemBottom: t,
1758
1760
  itemTop: e,
1759
1761
  locationParams: { align: n, behavior: o, ...r },
1760
1762
  viewportBottom: s,
1761
1763
  viewportTop: i
1762
- }) => e < i ? { ...r, align: n ?? "start", ...o === void 0 ? {} : { behavior: o } } : t > s ? { ...r, align: n ?? "end", ...o === void 0 ? {} : { behavior: o } } : null, to = j(
1764
+ }) => e < i ? { ...r, align: n ?? "start", ...o === void 0 ? {} : { behavior: o } } : t > s ? { ...r, align: n ?? "end", ...o === void 0 ? {} : { behavior: o } } : null, eo = Z(
1763
1765
  ([
1764
1766
  { gap: t, sizes: e, totalCount: n },
1765
1767
  { fixedFooterHeight: o, fixedHeaderHeight: r, headerHeight: s, scrollingInProgress: i, scrollTop: l, viewportHeight: c },
1766
1768
  { scrollToIndex: d }
1767
1769
  ]) => {
1768
- const m = U();
1769
- return z(
1770
- x(
1771
- m,
1772
- $(e, c, n, s, r, o, l),
1773
- $(t),
1774
- B(([[v, p, I, w, R, h, f, a], S]) => {
1775
- const { calculateViewLocation: H = Zo, done: y, ...k } = v, u = jn(v, p, w - 1), g = ce(u, p.offsetTree, S) + R + h, C = g + Rt(p.sizeTree, u)[1], L = a + h, O = a + I - f, V = H({
1776
- itemBottom: C,
1777
- itemTop: g,
1770
+ const f = K();
1771
+ return L(
1772
+ S(
1773
+ f,
1774
+ D(e, c, n, s, r, o, l),
1775
+ D(t),
1776
+ B(([[v, m, g, y, R, I, h, a], T]) => {
1777
+ const { calculateViewLocation: x = Zo, done: C, ...k } = v, u = qn(v, m, y - 1), p = ce(u, m.offsetTree, T) + R + I, b = p + Rt(m.sizeTree, u)[1], z = a + I, F = a + g - h, O = x({
1778
+ itemBottom: b,
1779
+ itemTop: p,
1778
1780
  locationParams: k,
1779
- viewportBottom: O,
1780
- viewportTop: L
1781
+ viewportBottom: F,
1782
+ viewportTop: z
1781
1783
  });
1782
- return V === null ? y?.() : y && yt(
1783
- x(
1784
+ return O === null ? C?.() : C && bt(
1785
+ S(
1784
1786
  i,
1785
- P((N) => !N),
1787
+ W((V) => !V),
1786
1788
  // skips the initial publish of false, and the cleanup call.
1787
1789
  // but if scrollingInProgress is true, we skip the initial publish.
1788
- Ut(it(i) ? 1 : 2)
1790
+ Ut(ot(i) ? 1 : 2)
1789
1791
  ),
1790
- y
1791
- ), V;
1792
+ C
1793
+ ), O;
1792
1794
  }),
1793
- P((v) => v !== null)
1795
+ W((v) => v !== null)
1794
1796
  ),
1795
1797
  d
1796
1798
  ), {
1797
- scrollIntoView: m
1799
+ scrollIntoView: f
1798
1800
  };
1799
1801
  },
1800
- rt(Lt, It, fe, Kt, Gt),
1802
+ it(Lt, It, fe, Kt, Gt),
1801
1803
  { singleton: !0 }
1802
1804
  );
1803
- function yn(t) {
1805
+ function bn(t) {
1804
1806
  return t === !1 ? !1 : t === "smooth" ? "smooth" : "auto";
1805
1807
  }
1806
- const Xo = (t, e) => typeof t == "function" ? yn(t(e)) : e && yn(t), Jo = j(
1808
+ const Xo = (t, e) => typeof t == "function" ? bn(t(e)) : e && bn(t), Jo = Z(
1807
1809
  ([
1808
1810
  { listRefresh: t, totalCount: e, fixedItemSize: n, data: o },
1809
1811
  { atBottomState: r, isAtBottom: s },
1810
1812
  { scrollToIndex: i },
1811
1813
  { scrolledToInitialItem: l },
1812
1814
  { didMount: c, propsReady: d },
1813
- { log: m },
1815
+ { log: f },
1814
1816
  { scrollingInProgress: v },
1815
- { context: p },
1816
- { scrollIntoView: I }
1817
+ { context: m },
1818
+ { scrollIntoView: g }
1817
1819
  ]) => {
1818
- const w = T(!1), R = U();
1819
- let h = null;
1820
- function f(y) {
1820
+ const y = w(!1), R = K();
1821
+ let I = null;
1822
+ function h(C) {
1821
1823
  M(i, {
1822
1824
  align: "end",
1823
- behavior: y,
1825
+ behavior: C,
1824
1826
  index: "LAST"
1825
1827
  });
1826
1828
  }
1827
- Y(
1828
- x(
1829
- at(x(W(e), Ut(1)), c),
1830
- $(W(w), s, l, v),
1831
- B(([[y, k], u, g, C, L]) => {
1832
- let O = k && C, V = "auto";
1833
- return O && (V = Xo(u, g || L), O = O && V !== !1), { followOutputBehavior: V, shouldFollow: O, totalCount: y };
1829
+ J(
1830
+ S(
1831
+ dt(S(P(e), Ut(1)), c),
1832
+ D(P(y), s, l, v),
1833
+ B(([[C, k], u, p, b, z]) => {
1834
+ let F = k && b, O = "auto";
1835
+ return F && (O = Xo(u, p || z), F = F && O !== !1), { followOutputBehavior: O, shouldFollow: F, totalCount: C };
1834
1836
  }),
1835
- P(({ shouldFollow: y }) => y)
1837
+ W(({ shouldFollow: C }) => C)
1836
1838
  ),
1837
- ({ followOutputBehavior: y, totalCount: k }) => {
1838
- h !== null && (h(), h = null), it(n) === void 0 ? h = yt(t, () => {
1839
- it(m)("following output to ", { totalCount: k }, ft.DEBUG), f(y), h = null;
1839
+ ({ followOutputBehavior: C, totalCount: k }) => {
1840
+ I !== null && (I(), I = null), ot(n) === void 0 ? I = bt(t, () => {
1841
+ ot(f)("following output to ", { totalCount: k }, mt.DEBUG), h(C), I = null;
1840
1842
  }) : requestAnimationFrame(() => {
1841
- it(m)("following output to ", { totalCount: k }, ft.DEBUG), f(y);
1843
+ ot(f)("following output to ", { totalCount: k }, mt.DEBUG), h(C);
1842
1844
  });
1843
1845
  }
1844
1846
  );
1845
- function a(y) {
1846
- const k = yt(r, (u) => {
1847
- y && !u.atBottom && u.notAtBottomBecause === "SIZE_INCREASED" && h === null && (it(m)("scrolling to bottom due to increased size", {}, ft.DEBUG), f("auto"));
1847
+ function a(C) {
1848
+ const k = bt(r, (u) => {
1849
+ C && !u.atBottom && u.notAtBottomBecause === "SIZE_INCREASED" && I === null && (ot(f)("scrolling to bottom due to increased size", {}, mt.DEBUG), h("auto"));
1848
1850
  });
1849
1851
  setTimeout(k, 100);
1850
1852
  }
1851
- Y(
1852
- x(
1853
- at(W(w), e, d),
1854
- P(([y, , k]) => y !== !1 && k),
1855
- Ot(
1856
- ({ value: y }, [, k]) => ({ refreshed: y === k, value: k }),
1853
+ J(
1854
+ S(
1855
+ dt(P(y), e, d),
1856
+ W(([C, , k]) => C !== !1 && k),
1857
+ kt(
1858
+ ({ value: C }, [, k]) => ({ refreshed: C === k, value: k }),
1857
1859
  { refreshed: !1, value: 0 }
1858
1860
  ),
1859
- P(({ refreshed: y }) => y),
1860
- $(w, e)
1861
+ W(({ refreshed: C }) => C),
1862
+ D(y, e)
1861
1863
  ),
1862
- ([, y]) => {
1863
- it(l) && a(y !== !1);
1864
+ ([, C]) => {
1865
+ ot(l) && a(C !== !1);
1864
1866
  }
1865
- ), Y(R, () => {
1866
- a(it(w) !== !1);
1867
- }), Y(at(W(w), r), ([y, k]) => {
1868
- y !== !1 && !k.atBottom && k.notAtBottomBecause === "VIEWPORT_HEIGHT_DECREASING" && f("auto");
1867
+ ), J(R, () => {
1868
+ a(ot(y) !== !1);
1869
+ }), J(dt(P(y), r), ([C, k]) => {
1870
+ C !== !1 && !k.atBottom && k.notAtBottomBecause === "VIEWPORT_HEIGHT_DECREASING" && h("auto");
1869
1871
  });
1870
- const S = T(null), H = U();
1871
- return z(
1872
- Fe(
1873
- x(
1874
- W(o),
1875
- B((y) => y?.length ?? 0)
1872
+ const T = w(null), x = K();
1873
+ return L(
1874
+ Ve(
1875
+ S(
1876
+ P(o),
1877
+ B((C) => C?.length ?? 0)
1876
1878
  ),
1877
- x(W(e))
1879
+ S(P(e))
1878
1880
  ),
1879
- H
1880
- ), Y(
1881
- x(
1882
- at(x(H, Ut(1)), c),
1883
- $(W(S), l, v, p),
1884
- B(([[y, k], u, g, C, L]) => k && g && u?.({ context: L, totalCount: y, scrollingInProgress: C })),
1885
- P((y) => !!y),
1881
+ x
1882
+ ), J(
1883
+ S(
1884
+ dt(S(x, Ut(1)), c),
1885
+ D(P(T), l, v, m),
1886
+ B(([[C, k], u, p, b, z]) => k && p && u?.({ context: z, totalCount: C, scrollingInProgress: b })),
1887
+ W((C) => !!C),
1886
1888
  zt(0)
1887
1889
  ),
1888
- (y) => {
1889
- h !== null && (h(), h = null), it(n) === void 0 ? h = yt(t, () => {
1890
- it(m)("scrolling into view", {}), M(I, y), h = null;
1890
+ (C) => {
1891
+ I !== null && (I(), I = null), ot(n) === void 0 ? I = bt(t, () => {
1892
+ ot(f)("scrolling into view", {}), M(g, C), I = null;
1891
1893
  }) : requestAnimationFrame(() => {
1892
- it(m)("scrolling into view", {}), M(I, y);
1894
+ ot(f)("scrolling into view", {}), M(g, C);
1893
1895
  });
1894
1896
  }
1895
- ), { autoscrollToBottom: R, followOutput: w, scrollIntoViewOnChange: S };
1897
+ ), { autoscrollToBottom: R, followOutput: y, scrollIntoViewOnChange: T };
1896
1898
  },
1897
- rt(
1899
+ it(
1898
1900
  Lt,
1899
1901
  pe,
1900
1902
  fe,
@@ -1902,38 +1904,38 @@ const Xo = (t, e) => typeof t == "function" ? yn(t(e)) : e && yn(t), Jo = j(
1902
1904
  At,
1903
1905
  Gt,
1904
1906
  It,
1905
- Qn,
1906
- to
1907
+ to,
1908
+ eo
1907
1909
  )
1908
- ), Qo = j(
1909
- ([{ data: t, firstItemIndex: e, gap: n, sizes: o }, { initialTopMostItemIndex: r }, { initialItemCount: s, listState: i }, { didMount: l }]) => (z(
1910
- x(
1910
+ ), Qo = Z(
1911
+ ([{ data: t, firstItemIndex: e, gap: n, sizes: o }, { initialTopMostItemIndex: r }, { initialItemCount: s, listState: i }, { didMount: l }]) => (L(
1912
+ S(
1911
1913
  l,
1912
- $(s),
1913
- P(([, c]) => c !== 0),
1914
- $(r, o, e, n, t),
1915
- B(([[, c], d, m, v, p, I = []]) => Xn(c, d, m, v, p, I))
1914
+ D(s),
1915
+ W(([, c]) => c !== 0),
1916
+ D(r, o, e, n, t),
1917
+ B(([[, c], d, f, v, m, g = []]) => Jn(c, d, f, v, m, g))
1916
1918
  ),
1917
1919
  i
1918
1920
  ), {}),
1919
- rt(Lt, me, Kt, At),
1921
+ it(Lt, me, Kt, At),
1920
1922
  { singleton: !0 }
1921
- ), tr = j(
1923
+ ), tr = Z(
1922
1924
  ([{ didMount: t }, { scrollTo: e }, { listState: n }]) => {
1923
- const o = T(0);
1924
- return Y(
1925
- x(
1925
+ const o = w(0);
1926
+ return J(
1927
+ S(
1926
1928
  t,
1927
- $(o),
1928
- P(([, r]) => r !== 0),
1929
+ D(o),
1930
+ W(([, r]) => r !== 0),
1929
1931
  B(([, r]) => ({ top: r }))
1930
1932
  ),
1931
1933
  (r) => {
1932
- yt(
1933
- x(
1934
+ bt(
1935
+ S(
1934
1936
  n,
1935
1937
  Ut(1),
1936
- P((s) => s.items.length > 1)
1938
+ W((s) => s.items.length > 1)
1937
1939
  ),
1938
1940
  () => {
1939
1941
  requestAnimationFrame(() => {
@@ -1946,16 +1948,16 @@ const Xo = (t, e) => typeof t == "function" ? yn(t(e)) : e && yn(t), Jo = j(
1946
1948
  initialScrollTop: o
1947
1949
  };
1948
1950
  },
1949
- rt(At, It, Kt),
1951
+ it(At, It, Kt),
1950
1952
  { singleton: !0 }
1951
- ), eo = j(
1953
+ ), no = Z(
1952
1954
  ([{ scrollVelocity: t }]) => {
1953
- const e = T(!1), n = U(), o = T(!1);
1954
- return z(
1955
- x(
1955
+ const e = w(!1), n = K(), o = w(!1);
1956
+ return L(
1957
+ S(
1956
1958
  t,
1957
- $(o, e, n),
1958
- P(([r, s]) => s !== !1 && s !== void 0),
1959
+ D(o, e, n),
1960
+ W(([r, s]) => s !== !1 && s !== void 0),
1959
1961
  B(([r, s, i, l]) => {
1960
1962
  const { enter: c, exit: d } = s;
1961
1963
  if (i) {
@@ -1965,34 +1967,34 @@ const Xo = (t, e) => typeof t == "function" ? yn(t(e)) : e && yn(t), Jo = j(
1965
1967
  return !0;
1966
1968
  return i;
1967
1969
  }),
1968
- nt()
1970
+ rt()
1969
1971
  ),
1970
1972
  e
1971
- ), Y(
1972
- x(at(e, t, n), $(o)),
1973
+ ), J(
1974
+ S(dt(e, t, n), D(o)),
1973
1975
  ([[r, s, i], l]) => {
1974
1976
  r && l !== !1 && l !== void 0 && l.change && l.change(s, i);
1975
1977
  }
1976
1978
  ), { isSeeking: e, scrollSeekConfiguration: o, scrollSeekRangeChanged: n, scrollVelocity: t };
1977
1979
  },
1978
- rt(pe),
1980
+ it(pe),
1979
1981
  { singleton: !0 }
1980
- ), Ze = j(([{ scrollContainerState: t, scrollTo: e }]) => {
1981
- const n = U(), o = U(), r = U(), s = T(!1), i = T(void 0);
1982
- return z(
1983
- x(
1984
- at(n, o),
1985
- B(([{ scrollTop: l, viewportHeight: c }, { offsetTop: d, listHeight: m }]) => ({
1986
- scrollHeight: m,
1982
+ ), Xe = Z(([{ scrollContainerState: t, scrollTo: e }]) => {
1983
+ const n = K(), o = K(), r = K(), s = w(!1), i = w(void 0);
1984
+ return L(
1985
+ S(
1986
+ dt(n, o),
1987
+ B(([{ scrollTop: l, viewportHeight: c }, { offsetTop: d, listHeight: f }]) => ({
1988
+ scrollHeight: f,
1987
1989
  scrollTop: Math.max(0, l - d),
1988
1990
  viewportHeight: c
1989
1991
  }))
1990
1992
  ),
1991
1993
  t
1992
- ), z(
1993
- x(
1994
+ ), L(
1995
+ S(
1994
1996
  e,
1995
- $(o),
1997
+ D(o),
1996
1998
  B(([l, { offsetTop: c }]) => ({
1997
1999
  ...l,
1998
2000
  top: l.top + c
@@ -2009,7 +2011,7 @@ const Xo = (t, e) => typeof t == "function" ? yn(t(e)) : e && yn(t), Jo = j(
2009
2011
  windowScrollTo: r,
2010
2012
  windowViewportRect: o
2011
2013
  };
2012
- }, rt(It)), er = j(
2014
+ }, it(It)), er = Z(
2013
2015
  ([
2014
2016
  { sizeRanges: t, sizes: e },
2015
2017
  { headerHeight: n, scrollTop: o },
@@ -2017,128 +2019,136 @@ const Xo = (t, e) => typeof t == "function" ? yn(t(e)) : e && yn(t), Jo = j(
2017
2019
  { didMount: s },
2018
2020
  { useWindowScroll: i, windowScrollContainerState: l, windowViewportRect: c }
2019
2021
  ]) => {
2020
- const d = U(), m = T(void 0), v = T(null), p = T(null);
2021
- return z(l, v), z(c, p), Y(
2022
- x(
2022
+ const d = K(), f = w(void 0), v = w(null), m = w(null);
2023
+ return L(l, v), L(c, m), J(
2024
+ S(
2023
2025
  d,
2024
- $(e, o, i, v, p, n)
2026
+ D(e, o, i, v, m, n)
2025
2027
  ),
2026
- ([I, w, R, h, f, a, S]) => {
2027
- const H = Go(w.sizeTree);
2028
- h && f !== null && a !== null && (R = f.scrollTop - a.offsetTop), R -= S, I({ ranges: H, scrollTop: R });
2028
+ ([g, y, R, I, h, a, T]) => {
2029
+ const x = Go(y.sizeTree);
2030
+ I && h !== null && a !== null && (R = h.scrollTop - a.offsetTop), R -= T, g({ ranges: x, scrollTop: R });
2029
2031
  }
2030
- ), z(x(m, P(_e), B(nr)), r), z(
2031
- x(
2032
+ ), L(S(f, W(Ne), B(nr)), r), L(
2033
+ S(
2032
2034
  s,
2033
- $(m),
2034
- P(([, I]) => I !== void 0),
2035
- nt(),
2036
- B(([, I]) => I.ranges)
2035
+ D(f),
2036
+ W(([, g]) => g !== void 0),
2037
+ rt(),
2038
+ B(([, g]) => g.ranges)
2037
2039
  ),
2038
2040
  t
2039
2041
  ), {
2040
2042
  getState: d,
2041
- restoreStateFrom: m
2043
+ restoreStateFrom: f
2042
2044
  };
2043
2045
  },
2044
- rt(Lt, It, me, At, Ze)
2046
+ it(Lt, It, me, At, Xe)
2045
2047
  );
2046
2048
  function nr(t) {
2047
2049
  return { align: "start", index: 0, offset: t.scrollTop };
2048
2050
  }
2049
- const or = j(([{ topItemsIndexes: t }]) => {
2050
- const e = T(0);
2051
- return z(
2052
- x(
2051
+ const or = Z(([{ topItemsIndexes: t }]) => {
2052
+ const e = w(0);
2053
+ return L(
2054
+ S(
2053
2055
  e,
2054
- P((n) => n >= 0),
2056
+ W((n) => n >= 0),
2055
2057
  B((n) => Array.from({ length: n }).map((o, r) => r))
2056
2058
  ),
2057
2059
  t
2058
2060
  ), { topItemCount: e };
2059
- }, rt(Kt));
2060
- function no(t) {
2061
+ }, it(Kt));
2062
+ function oo(t) {
2061
2063
  let e = !1, n;
2062
2064
  return (() => (e || (e = !0, n = t()), n));
2063
2065
  }
2064
- const rr = no(() => /iP(ad|od|hone)/i.test(navigator.userAgent) && /WebKit/i.test(navigator.userAgent)), sr = j(
2066
+ const rr = oo(() => /iP(ad|od|hone)/i.test(navigator.userAgent) && /WebKit/i.test(navigator.userAgent)), sr = Z(
2065
2067
  ([
2066
- { deviation: t, scrollBy: e, scrollingInProgress: n, scrollTop: o },
2067
- { isAtBottom: r, isScrolling: s, lastJumpDueToItemResize: i, scrollDirection: l },
2068
- { listState: c },
2069
- { beforeUnshiftWith: d, gap: m, shiftWithOffset: v, sizes: p },
2070
- { log: I },
2071
- { recalcInProgress: w }
2068
+ { deviation: t, deviationCommitted: e, scrollBy: n, scrollingInProgress: o, scrollTop: r },
2069
+ { isAtBottom: s, isScrolling: i, lastJumpDueToItemResize: l, scrollDirection: c },
2070
+ { listState: d },
2071
+ { beforeUnshiftWith: f, gap: v, shiftWithOffset: m, sizes: g },
2072
+ { log: y },
2073
+ { recalcInProgress: R }
2072
2074
  ]) => {
2073
- const R = Tt(
2074
- x(
2075
- c,
2076
- $(i),
2077
- Ot(
2078
- ([, f, a, S], [{ bottom: H, items: y, offsetBottom: k, totalCount: u }, g]) => {
2079
- const C = H + k;
2080
- let L = 0;
2081
- return a === u && f.length > 0 && y.length > 0 && (y[0].originalIndex === 0 && f[0].originalIndex === 0 || (L = C - S, L !== 0 && (L += g))), [L, y, u, C];
2075
+ const I = Ct(
2076
+ S(
2077
+ d,
2078
+ D(l),
2079
+ kt(
2080
+ ([, x, C, k], [{ bottom: u, items: p, offsetBottom: b, totalCount: z }, F]) => {
2081
+ const O = u + b;
2082
+ let V = 0;
2083
+ return C === z && x.length > 0 && p.length > 0 && (p[0].originalIndex === 0 && x[0].originalIndex === 0 || (V = O - k, V !== 0 && (V += F))), [V, p, z, O];
2082
2084
  },
2083
2085
  [0, [], 0, 0]
2084
2086
  ),
2085
- P(([f]) => f !== 0),
2086
- $(o, l, n, r, I, w),
2087
- P(([, f, a, S, , , H]) => !H && !S && f !== 0 && a === ue),
2088
- B(([[f], , , , , a]) => (a("Upward scrolling compensation", { amount: f }, ft.DEBUG), f))
2087
+ W(([x]) => x !== 0),
2088
+ D(r, c, o, s, y, R),
2089
+ W(([, x, C, k, , , u]) => !u && !k && x !== 0 && C === ue),
2090
+ B(([[x], , , , , C]) => (C("Upward scrolling compensation", { amount: x }, mt.DEBUG), x))
2089
2091
  )
2090
2092
  );
2091
- function h(f) {
2092
- f > 0 ? (M(e, { behavior: "auto", top: -f }), M(t, 0)) : (M(t, 0), M(e, { behavior: "auto", top: -f }));
2093
+ function h(x) {
2094
+ x > 0 ? (M(n, { behavior: "auto", top: -x }), M(t, 0)) : (M(t, 0), M(n, { behavior: "auto", top: -x }));
2093
2095
  }
2094
- return Y(x(R, $(t, s)), ([f, a, S]) => {
2095
- S && rr() ? M(t, a - f) : h(-f);
2096
- }), Y(
2097
- x(
2098
- at(ht(s, !1), t, w),
2099
- P(([f, a, S]) => !f && !S && a !== 0),
2100
- B(([f, a]) => a),
2096
+ J(S(I, D(t, i)), ([x, C, k]) => {
2097
+ k && rr() ? M(t, C - x) : h(-x);
2098
+ }), J(
2099
+ S(
2100
+ dt(ht(i, !1), t, R),
2101
+ W(([x, C, k]) => !x && !k && C !== 0),
2102
+ B(([x, C]) => C),
2101
2103
  zt(1)
2102
2104
  ),
2103
2105
  h
2104
- ), z(
2105
- x(
2106
- v,
2107
- B((f) => ({ top: -f }))
2106
+ ), L(
2107
+ S(
2108
+ m,
2109
+ B((x) => ({ top: -x }))
2108
2110
  ),
2109
- e
2110
- ), Y(
2111
- x(
2112
- d,
2113
- $(p, m),
2114
- B(([f, { groupIndices: a, lastSize: S, sizeTree: H }, y]) => {
2115
- function k(O) {
2116
- return O * (S + y);
2111
+ n
2112
+ );
2113
+ let a = null;
2114
+ function T() {
2115
+ if (a === null)
2116
+ return;
2117
+ const { offset: x } = a;
2118
+ a = null, M(n, { top: x }), requestAnimationFrame(() => {
2119
+ M(t, 0), M(R, !1);
2120
+ });
2121
+ }
2122
+ return J(e, (x) => {
2123
+ a === null || !a.acknowledgeable || x === a.offset && T();
2124
+ }), J(
2125
+ S(
2126
+ f,
2127
+ D(g, v),
2128
+ B(([x, { groupIndices: C, lastSize: k, sizeTree: u }, p]) => {
2129
+ function b(U) {
2130
+ return U * (k + p);
2117
2131
  }
2118
- if (a.length === 0)
2119
- return k(f);
2120
- let u = 0;
2121
- const g = ie(H, 0);
2122
- let C = 0, L = 0;
2123
- for (; C < f; ) {
2124
- C++, u += g;
2125
- let O = a.length === L + 1 ? 1 / 0 : a[L + 1] - a[L] - 1;
2126
- C + O > f && (u -= g, O = f - C + 1), C += O, u += k(O), L++;
2132
+ if (C.length === 0)
2133
+ return b(x);
2134
+ let z = 0;
2135
+ const F = ie(u, 0);
2136
+ let O = 0, V = 0;
2137
+ for (; O < x; ) {
2138
+ O++, z += F;
2139
+ let U = C.length === V + 1 ? 1 / 0 : C[V + 1] - C[V] - 1;
2140
+ O + U > x && (z -= F, U = x - O + 1), O += U, z += b(U), V++;
2127
2141
  }
2128
- return u;
2142
+ return z;
2129
2143
  })
2130
2144
  ),
2131
- (f) => {
2132
- M(t, f), requestAnimationFrame(() => {
2133
- M(e, { top: f }), requestAnimationFrame(() => {
2134
- M(t, 0), M(w, !1);
2135
- });
2136
- });
2145
+ (x) => {
2146
+ a = { acknowledgeable: ot(t) !== x, offset: x }, M(t, x), requestAnimationFrame(T);
2137
2147
  }
2138
2148
  ), { deviation: t };
2139
2149
  },
2140
- rt(It, pe, Kt, Lt, Gt, Ue)
2141
- ), ir = j(
2150
+ it(It, pe, Kt, Lt, Gt, Ke)
2151
+ ), ir = Z(
2142
2152
  ([
2143
2153
  t,
2144
2154
  e,
@@ -2150,7 +2160,7 @@ const rr = no(() => /iP(ad|od|hone)/i.test(navigator.userAgent) && /WebKit/i.tes
2150
2160
  l,
2151
2161
  c,
2152
2162
  d,
2153
- m
2163
+ f
2154
2164
  ]) => ({
2155
2165
  ...t,
2156
2166
  ...e,
@@ -2162,22 +2172,22 @@ const rr = no(() => /iP(ad|od|hone)/i.test(navigator.userAgent) && /WebKit/i.tes
2162
2172
  ...l,
2163
2173
  ...c,
2164
2174
  ...d,
2165
- ...m
2175
+ ...f
2166
2176
  }),
2167
- rt(
2168
- Ye,
2177
+ it(
2178
+ Ze,
2169
2179
  Qo,
2170
2180
  At,
2171
- eo,
2172
- Jn,
2181
+ no,
2182
+ Qn,
2173
2183
  tr,
2174
2184
  Yo,
2175
- Ze,
2176
- to,
2185
+ Xe,
2186
+ eo,
2177
2187
  Gt,
2178
- Qn
2188
+ to
2179
2189
  )
2180
- ), oo = j(
2190
+ ), ro = Z(
2181
2191
  ([
2182
2192
  {
2183
2193
  data: t,
@@ -2190,29 +2200,31 @@ const rr = no(() => /iP(ad|od|hone)/i.test(navigator.userAgent) && /WebKit/i.tes
2190
2200
  heightEstimates: l,
2191
2201
  itemSize: c,
2192
2202
  sizeRanges: d,
2193
- sizes: m,
2203
+ sizes: f,
2194
2204
  statefulTotalCount: v,
2195
- totalCount: p,
2196
- trackItemSizes: I
2205
+ totalCount: m,
2206
+ trackItemSizes: g
2197
2207
  },
2198
- { initialItemFinalLocationReached: w, initialTopMostItemIndex: R, scrolledToInitialItem: h },
2199
- f,
2208
+ { initialItemFinalLocationReached: y, initialTopMostItemIndex: R, scrolledToInitialItem: I },
2209
+ h,
2200
2210
  a,
2201
- S,
2202
- H,
2203
- { scrollToIndex: y },
2211
+ T,
2212
+ x,
2213
+ { scrollToIndex: C },
2204
2214
  k,
2205
2215
  { topItemCount: u },
2206
- { groupCounts: g },
2207
- C
2216
+ { groupCounts: p },
2217
+ b
2208
2218
  ]) => {
2209
- const { listState: L, minOverscanItemCount: O, topItemsIndexes: V, rangeChanged: N, ...Z } = H;
2210
- return z(N, C.scrollSeekRangeChanged), z(
2211
- x(
2212
- C.windowViewportRect,
2213
- B((F) => F.visibleHeight)
2219
+ const { listState: z, minOverscanItemCount: F, topItemsIndexes: O, rangeChanged: V, ...U } = x;
2220
+ return L(V, b.scrollSeekRangeChanged), L(
2221
+ S(
2222
+ dt(b.windowViewportRect, h.headerHeight, h.fixedHeaderHeight),
2223
+ // Keep a measurement range active when a window-scrolling list starts below the viewport.
2224
+ // One content pixel beyond the headers is enough to render the probe item and estimate the full list height.
2225
+ B(([q, $, j]) => Math.max($ + j + 1, q.visibleHeight))
2214
2226
  ),
2215
- f.viewportHeight
2227
+ h.viewportHeight
2216
2228
  ), {
2217
2229
  data: t,
2218
2230
  defaultItemHeight: e,
@@ -2220,36 +2232,36 @@ const rr = no(() => /iP(ad|od|hone)/i.test(navigator.userAgent) && /WebKit/i.tes
2220
2232
  fixedItemHeight: o,
2221
2233
  fixedGroupHeight: r,
2222
2234
  gap: s,
2223
- groupCounts: g,
2235
+ groupCounts: p,
2224
2236
  heightEstimates: l,
2225
- initialItemFinalLocationReached: w,
2237
+ initialItemFinalLocationReached: y,
2226
2238
  initialTopMostItemIndex: R,
2227
- scrolledToInitialItem: h,
2239
+ scrolledToInitialItem: I,
2228
2240
  sizeRanges: d,
2229
2241
  topItemCount: u,
2230
- topItemsIndexes: V,
2242
+ topItemsIndexes: O,
2231
2243
  // input
2232
- totalCount: p,
2233
- ...S,
2244
+ totalCount: m,
2245
+ ...T,
2234
2246
  groupIndices: i,
2235
2247
  itemSize: c,
2236
- listState: L,
2237
- minOverscanItemCount: O,
2238
- scrollToIndex: y,
2248
+ listState: z,
2249
+ minOverscanItemCount: F,
2250
+ scrollToIndex: C,
2239
2251
  // output
2240
2252
  statefulTotalCount: v,
2241
- trackItemSizes: I,
2253
+ trackItemSizes: g,
2242
2254
  // exported from stateFlagsSystem
2243
- rangeChanged: N,
2244
- ...Z,
2255
+ rangeChanged: V,
2256
+ ...U,
2245
2257
  // the bag of IO from featureGroup1System
2246
- ...C,
2247
- ...f,
2248
- sizes: m,
2258
+ ...b,
2259
+ ...h,
2260
+ sizes: f,
2249
2261
  ...a
2250
2262
  };
2251
2263
  },
2252
- rt(
2264
+ it(
2253
2265
  Lt,
2254
2266
  me,
2255
2267
  It,
@@ -2259,7 +2271,7 @@ const rr = no(() => /iP(ad|od|hone)/i.test(navigator.userAgent) && /WebKit/i.tes
2259
2271
  fe,
2260
2272
  sr,
2261
2273
  or,
2262
- qn,
2274
+ Yn,
2263
2275
  ir
2264
2276
  )
2265
2277
  );
@@ -2274,89 +2286,89 @@ function lr(t, e) {
2274
2286
  return n;
2275
2287
  }
2276
2288
  const Ie = typeof document > "u" ? E.useEffect : E.useLayoutEffect;
2277
- function Xe(t, e, n) {
2289
+ function Je(t, e, n) {
2278
2290
  const o = Object.keys(e.required || {}), r = Object.keys(e.optional || {}), s = Object.keys(e.methods || {}), i = Object.keys(e.events || {}), l = E.createContext({});
2279
- function c(f, a) {
2280
- f.propsReady !== void 0 && M(f.propsReady, !1);
2281
- for (const S of o) {
2282
- const H = f[e.required[S]];
2283
- M(H, a[S]);
2291
+ function c(h, a) {
2292
+ h.propsReady !== void 0 && M(h.propsReady, !1);
2293
+ for (const T of o) {
2294
+ const x = h[e.required[T]];
2295
+ M(x, a[T]);
2284
2296
  }
2285
- for (const S of r)
2286
- if (S in a) {
2287
- const H = f[e.optional[S]];
2288
- M(H, a[S]);
2297
+ for (const T of r)
2298
+ if (T in a) {
2299
+ const x = h[e.optional[T]];
2300
+ M(x, a[T]);
2289
2301
  }
2290
- f.propsReady !== void 0 && M(f.propsReady, !0);
2302
+ h.propsReady !== void 0 && M(h.propsReady, !0);
2291
2303
  }
2292
- function d(f) {
2293
- return s.reduce((a, S) => (a[S] = (H) => {
2294
- const y = f[e.methods[S]];
2295
- M(y, H);
2304
+ function d(h) {
2305
+ return s.reduce((a, T) => (a[T] = (x) => {
2306
+ const C = h[e.methods[T]];
2307
+ M(C, x);
2296
2308
  }, a), {});
2297
2309
  }
2298
- function m(f) {
2299
- return i.reduce((a, S) => (a[S] = Co(f[e.events[S]]), a), {});
2310
+ function f(h) {
2311
+ return i.reduce((a, T) => (a[T] = Co(h[e.events[T]]), a), {});
2300
2312
  }
2301
- const v = E.forwardRef(function(a, S) {
2302
- const { children: H, ...y } = a, [k] = E.useState(() => ye(bo(t), (C) => {
2303
- c(C, y);
2304
- })), [u] = E.useState(mn(m, k));
2313
+ const v = E.forwardRef(function(a, T) {
2314
+ const { children: x, ...C } = a, [k] = E.useState(() => ye(bo(t), (b) => {
2315
+ c(b, C);
2316
+ })), [u] = E.useState(pn(f, k));
2305
2317
  Ie(() => {
2306
- for (const C of i)
2307
- C in y && Y(u[C], y[C]);
2318
+ for (const b of i)
2319
+ b in C && J(u[b], C[b]);
2308
2320
  return () => {
2309
- Object.values(u).map(Ne);
2321
+ Object.values(u).map(De);
2310
2322
  };
2311
- }, [y, u, k]), Ie(() => {
2312
- c(k, y);
2313
- }), E.useImperativeHandle(S, fn(d(k)));
2314
- const g = n;
2315
- return /* @__PURE__ */ G(l.Provider, { value: k, children: n === void 0 ? H : /* @__PURE__ */ G(g, { ...lr([...o, ...r, ...i], y), children: H }) });
2316
- }), p = (f) => {
2323
+ }, [C, u, k]), Ie(() => {
2324
+ c(k, C);
2325
+ }), E.useImperativeHandle(T, mn(d(k)));
2326
+ const p = n;
2327
+ return /* @__PURE__ */ G(l.Provider, { value: k, children: n === void 0 ? x : /* @__PURE__ */ G(p, { ...lr([...o, ...r, ...i], C), children: x }) });
2328
+ }), m = (h) => {
2317
2329
  const a = E.useContext(l);
2318
2330
  return E.useCallback(
2319
- (S) => {
2320
- M(a[f], S);
2331
+ (T) => {
2332
+ M(a[h], T);
2321
2333
  },
2322
- [a, f]
2334
+ [a, h]
2323
2335
  );
2324
- }, I = (f) => {
2325
- const S = E.useContext(l)[f], H = E.useCallback(
2326
- (y) => Y(S, y),
2327
- [S]
2336
+ }, g = (h) => {
2337
+ const T = E.useContext(l)[h], x = E.useCallback(
2338
+ (C) => J(T, C),
2339
+ [T]
2328
2340
  );
2329
2341
  return E.useSyncExternalStore(
2330
- H,
2331
- () => it(S),
2332
- () => it(S)
2342
+ x,
2343
+ () => ot(T),
2344
+ () => ot(T)
2333
2345
  );
2334
- }, w = (f) => {
2335
- const S = E.useContext(l)[f], [H, y] = E.useState(mn(it, S));
2346
+ }, y = (h) => {
2347
+ const T = E.useContext(l)[h], [x, C] = E.useState(pn(ot, T));
2336
2348
  return Ie(
2337
- () => Y(S, (k) => {
2338
- k !== H && y(fn(k));
2349
+ () => J(T, (k) => {
2350
+ k !== x && C(mn(k));
2339
2351
  }),
2340
- [S, H]
2341
- ), H;
2342
- }, R = parseInt(E.version, 10) >= 18 ? I : w;
2352
+ [T, x]
2353
+ ), x;
2354
+ }, R = parseInt(E.version, 10) >= 18 ? g : y;
2343
2355
  return {
2344
2356
  Component: v,
2345
- useEmitter: (f, a) => {
2346
- const H = E.useContext(l)[f];
2347
- Ie(() => Y(H, a), [a, H]);
2357
+ useEmitter: (h, a) => {
2358
+ const x = E.useContext(l)[h];
2359
+ Ie(() => J(x, a), [a, x]);
2348
2360
  },
2349
2361
  useEmitterValue: R,
2350
- usePublisher: p
2362
+ usePublisher: m
2351
2363
  };
2352
2364
  }
2353
- const Re = E.createContext(void 0), ro = E.createContext(void 0), ke = "-webkit-sticky", bn = "sticky", Je = no(() => {
2365
+ const He = E.createContext(void 0), so = E.createContext(void 0), Le = "-webkit-sticky", Rn = "sticky", Qe = oo(() => {
2354
2366
  if (typeof document > "u")
2355
- return bn;
2367
+ return Rn;
2356
2368
  const t = document.createElement("div");
2357
- return t.style.position = ke, t.style.position === ke ? ke : bn;
2358
- }), so = typeof document > "u" ? E.useEffect : E.useLayoutEffect;
2359
- function Le(t) {
2369
+ return t.style.position = Le, t.style.position === Le ? Le : Rn;
2370
+ });
2371
+ function ze(t) {
2360
2372
  return "self" in t;
2361
2373
  }
2362
2374
  function cr(t) {
@@ -2364,75 +2376,77 @@ function cr(t) {
2364
2376
  }
2365
2377
  function io(t, e, n, o = Jt, r, s) {
2366
2378
  const i = E.useRef(null), l = E.useRef(null), c = E.useRef(null), d = E.useCallback(
2367
- (p) => {
2368
- let I, w, R;
2369
- const h = p.target;
2370
- if (cr(h) || Le(h)) {
2371
- const a = Le(h) ? h : h.defaultView;
2372
- R = s === !0 ? _t(a, a.scrollX) : a.scrollY, I = s === !0 ? a.document.documentElement.scrollWidth : a.document.documentElement.scrollHeight, w = s === !0 ? a.innerWidth : a.innerHeight;
2379
+ (m) => {
2380
+ let g, y, R;
2381
+ const I = m.target;
2382
+ if (cr(I) || ze(I)) {
2383
+ const a = ze(I) ? I : I.defaultView;
2384
+ R = s === !0 ? _t(a, a.scrollX) : a.scrollY, g = s === !0 ? a.document.documentElement.scrollWidth : a.document.documentElement.scrollHeight, y = s === !0 ? a.innerWidth : a.innerHeight;
2373
2385
  } else
2374
- R = s === !0 ? _t(h, h.scrollLeft) : h.scrollTop, I = s === !0 ? h.scrollWidth : h.scrollHeight, w = s === !0 ? h.offsetWidth : h.offsetHeight;
2375
- const f = () => {
2386
+ R = s === !0 ? _t(I, I.scrollLeft) : I.scrollTop, g = s === !0 ? I.scrollWidth : I.scrollHeight, y = s === !0 ? I.offsetWidth : I.offsetHeight;
2387
+ const h = () => {
2376
2388
  t({
2377
- scrollHeight: I,
2389
+ scrollHeight: g,
2378
2390
  scrollTop: Math.max(R, 0),
2379
- viewportHeight: w
2391
+ viewportHeight: y
2380
2392
  });
2381
2393
  };
2382
- p.suppressFlushSync === !0 ? f() : go.flushSync(f), l.current !== null && (R === l.current || R <= 0 || R === I - w) && (l.current = null, e(!0), c.current && (clearTimeout(c.current), c.current = null));
2394
+ m.suppressFlushSync === !0 ? h() : go.flushSync(h), l.current !== null && (R === l.current || R <= 0 || R === g - y) && (l.current = null, e(!0), c.current && (clearTimeout(c.current), c.current = null));
2383
2395
  },
2384
2396
  [t, e, s]
2385
2397
  );
2386
2398
  E.useEffect(() => {
2387
- const p = r ?? i.current;
2388
- return o(r ?? i.current), d({ suppressFlushSync: !0, target: p }), p.addEventListener("scroll", d, { passive: !0 }), () => {
2389
- o(null), p.removeEventListener("scroll", d);
2399
+ const m = r ?? i.current;
2400
+ return o(r ?? i.current), d({ suppressFlushSync: !0, target: m }), m.addEventListener("scroll", d, { passive: !0 }), () => {
2401
+ o(null), m.removeEventListener("scroll", d);
2390
2402
  };
2391
2403
  }, [i, d, n, o, r]);
2392
- function m(p) {
2393
- const I = i.current;
2394
- if (!I || (s === !0 ? "offsetWidth" in I && I.offsetWidth === 0 : "offsetHeight" in I && I.offsetHeight === 0))
2404
+ function f(m) {
2405
+ const g = i.current;
2406
+ if (!g || (s === !0 ? "offsetWidth" in g && g.offsetWidth === 0 : "offsetHeight" in g && g.offsetHeight === 0))
2395
2407
  return;
2396
- const w = p.behavior === "smooth";
2397
- let R, h, f;
2398
- Le(I) ? (h = Math.max(
2399
- Ht(I.document.documentElement, s === !0 ? "width" : "height"),
2400
- s === !0 ? I.document.documentElement.scrollWidth : I.document.documentElement.scrollHeight
2401
- ), R = s === !0 ? I.innerWidth : I.innerHeight, f = s === !0 ? _t(I, I.scrollX) : I.scrollY) : (h = I[s === !0 ? "scrollWidth" : "scrollHeight"], R = Ht(I, s === !0 ? "width" : "height"), f = s === !0 ? _t(I, I.scrollLeft) : I.scrollTop);
2402
- const a = h - R;
2403
- if (p.top === void 0) {
2404
- I.scrollTo(p);
2408
+ const y = m.behavior === "smooth";
2409
+ let R, I, h;
2410
+ ze(g) ? (I = Math.max(
2411
+ Ht(g.document.documentElement, s === !0 ? "width" : "height"),
2412
+ s === !0 ? g.document.documentElement.scrollWidth : g.document.documentElement.scrollHeight
2413
+ ), R = s === !0 ? g.innerWidth : g.innerHeight, h = s === !0 ? _t(g, g.scrollX) : g.scrollY) : (I = g[s === !0 ? "scrollWidth" : "scrollHeight"], R = Ht(g, s === !0 ? "width" : "height"), h = s === !0 ? _t(g, g.scrollLeft) : g.scrollTop);
2414
+ const a = I - R;
2415
+ if (m.top === void 0) {
2416
+ g.scrollTo(m);
2405
2417
  return;
2406
2418
  }
2407
- const S = Math.ceil(Math.max(Math.min(a, p.top), 0));
2408
- if (p.top = S, Zn(R, h) || S === f) {
2409
- t({ scrollHeight: h, scrollTop: f, viewportHeight: R }), w && e(!0);
2419
+ const T = Math.ceil(Math.max(Math.min(a, m.top), 0));
2420
+ if (m.top = T, Xn(R, I) || T === h) {
2421
+ t({ scrollHeight: I, scrollTop: h, viewportHeight: R }), y && e(!0);
2410
2422
  return;
2411
2423
  }
2412
- w ? (l.current = S, c.current && clearTimeout(c.current), c.current = setTimeout(() => {
2424
+ y ? (l.current = T, c.current && clearTimeout(c.current), c.current = setTimeout(() => {
2413
2425
  c.current = null, l.current = null, e(!0);
2414
- }, 1e3)) : l.current = null, s === !0 && (p = {
2415
- ...p.behavior === void 0 ? {} : { behavior: p.behavior },
2416
- left: hn(I, S)
2417
- }), I.scrollTo(p);
2418
- }
2419
- function v(p) {
2420
- s === !0 && (p = {
2421
- ...p.behavior === void 0 ? {} : { behavior: p.behavior },
2422
- ...p.top === void 0 ? {} : { left: hn(i.current, p.top) }
2423
- }), i.current.scrollBy(p);
2426
+ }, 1e3)) : l.current = null, s === !0 && (m = {
2427
+ ...m.behavior === void 0 ? {} : { behavior: m.behavior },
2428
+ left: gn(g, T)
2429
+ }), g.scrollTo(m);
2424
2430
  }
2425
- return { scrollByCallback: v, scrollerRef: i, scrollToCallback: m };
2431
+ return { scrollByCallback: E.useCallback(
2432
+ (m) => {
2433
+ s === !0 && (m = {
2434
+ ...m.behavior === void 0 ? {} : { behavior: m.behavior },
2435
+ ...m.top === void 0 ? {} : { left: gn(i.current, m.top) }
2436
+ }), i.current.scrollBy(m);
2437
+ },
2438
+ [s]
2439
+ ), scrollerRef: i, scrollToCallback: f };
2426
2440
  }
2427
- function Qe(t) {
2441
+ function tn(t) {
2428
2442
  return t;
2429
2443
  }
2430
- const ur = /* @__PURE__ */ j(() => {
2431
- const t = T((l) => `Item ${l}`), e = T((l) => `Group ${l}`), n = T({}), o = T(Qe), r = T("div"), s = T(Jt), i = (l, c = null) => ht(
2432
- x(
2444
+ const ur = /* @__PURE__ */ Z(() => {
2445
+ const t = w((l) => `Item ${l}`), e = w((l) => `Group ${l}`), n = w({}), o = w(tn), r = w("div"), s = w(Jt), i = (l, c = null) => ht(
2446
+ S(
2433
2447
  n,
2434
2448
  B((d) => d[l]),
2435
- nt()
2449
+ rt()
2436
2450
  ),
2437
2451
  c
2438
2452
  );
@@ -2453,27 +2467,31 @@ const ur = /* @__PURE__ */ j(() => {
2453
2467
  ScrollSeekPlaceholder: i("ScrollSeekPlaceholder"),
2454
2468
  TopItemListComponent: i("TopItemList")
2455
2469
  };
2456
- }), ar = /* @__PURE__ */ j(
2470
+ }), ar = /* @__PURE__ */ Z(
2457
2471
  ([t, e]) => ({ ...t, ...e }),
2458
- rt(oo, ur)
2459
- ), dr = ({ height: t }) => /* @__PURE__ */ G("div", { style: { height: t } }), fr = { overflowAnchor: "none", position: Je(), zIndex: 1 }, lo = { overflowAnchor: "none" }, mr = { ...lo, display: "inline-block", height: "100%" }, Rn = /* @__PURE__ */ E.memo(function({ showTopList: e = !1 }) {
2460
- const n = A("listState"), o = Ct("sizeRanges"), r = A("useWindowScroll"), s = A("customScrollParent"), i = Ct("windowScrollContainerState"), l = Ct("scrollContainerState"), c = s || r ? i : l, d = A("itemContent"), m = A("context"), v = A("groupContent"), p = A("trackItemSizes"), I = A("itemSize"), w = A("log"), R = Ct("gap"), h = A("horizontalDirection"), { callbackRef: f } = Gn(
2472
+ it(ro, ur)
2473
+ ), dr = ({ height: t }) => /* @__PURE__ */ G("div", { style: { height: t } }), fr = { overflowAnchor: "none", position: Qe(), zIndex: 1 }, lo = { overflowAnchor: "none" }, mr = { ...lo, display: "inline-block", height: "100%" }, Hn = /* @__PURE__ */ E.memo(function({ showTopList: e = !1 }) {
2474
+ const n = A("listState"), o = Tt("sizeRanges"), r = A("useWindowScroll"), s = A("customScrollParent"), i = Tt("windowScrollContainerState"), l = Tt("scrollContainerState"), c = s || r ? i : l, d = A("itemContent"), f = A("context"), v = A("groupContent"), m = A("trackItemSizes"), g = A("itemSize"), y = A("log"), R = Tt("gap"), I = A("horizontalDirection"), { callbackRef: h } = An(
2461
2475
  o,
2462
- I,
2463
- p,
2476
+ g,
2477
+ m,
2464
2478
  e ? Jt : c,
2465
- w,
2479
+ y,
2466
2480
  R,
2467
2481
  s,
2468
- h,
2482
+ I,
2469
2483
  A("skipAnimationFrameInResizeObserver")
2470
- ), [a, S] = E.useState(0);
2471
- on("deviation", (F) => {
2472
- a !== F && S(F);
2484
+ ), [a, T] = E.useState(0);
2485
+ rn("deviation", ($) => {
2486
+ a !== $ && T($);
2473
2487
  });
2474
- const H = A("EmptyPlaceholder"), y = A("ScrollSeekPlaceholder") ?? dr, k = A("ListComponent"), u = A("ItemComponent"), g = A("GroupComponent"), C = A("computeItemKey"), L = A("isSeeking"), O = A("groupIndices").length > 0, V = A("alignToBottom"), N = A("initialItemFinalLocationReached"), Z = e ? {} : {
2488
+ const x = Tt("deviationCommitted");
2489
+ be(() => {
2490
+ x(a);
2491
+ }, [a, x]);
2492
+ const C = A("EmptyPlaceholder"), k = A("ScrollSeekPlaceholder") ?? dr, u = A("ListComponent"), p = A("ItemComponent"), b = A("GroupComponent"), z = A("computeItemKey"), F = A("isSeeking"), O = A("groupIndices").length > 0, V = A("alignToBottom"), U = A("initialItemFinalLocationReached"), q = e ? {} : {
2475
2493
  boxSizing: "border-box",
2476
- ...h ? {
2494
+ ...I ? {
2477
2495
  display: "inline-block",
2478
2496
  height: "100%",
2479
2497
  marginInlineStart: a === 0 ? V ? "auto" : 0 : a,
@@ -2485,51 +2503,51 @@ const ur = /* @__PURE__ */ j(() => {
2485
2503
  paddingBottom: n.offsetBottom,
2486
2504
  paddingTop: n.offsetTop
2487
2505
  },
2488
- ...N ? {} : { visibility: "hidden" }
2506
+ ...U ? {} : { visibility: "hidden" }
2489
2507
  };
2490
- return !e && n.totalCount === 0 && H !== null && H !== void 0 ? /* @__PURE__ */ G(H, { ...ot(H, m) }) : /* @__PURE__ */ G(
2491
- k,
2508
+ return !e && n.totalCount === 0 && C !== null && C !== void 0 ? /* @__PURE__ */ G(C, { ...st(C, f) }) : /* @__PURE__ */ G(
2509
+ u,
2492
2510
  {
2493
- ...ot(k, m),
2511
+ ...st(u, f),
2494
2512
  "data-testid": e ? "virtuoso-top-item-list" : "virtuoso-item-list",
2495
- ref: f,
2496
- style: Z,
2497
- children: (e ? n.topItems : n.items).map((F) => {
2498
- const mt = F.originalIndex, q = C(mt + n.firstItemIndex, F.data, m);
2499
- return L ? /* @__PURE__ */ Dt(
2500
- y,
2513
+ ref: h,
2514
+ style: q,
2515
+ children: (e ? n.topItems : n.items).map(($) => {
2516
+ const j = $.originalIndex, X = z(j + n.firstItemIndex, $.data, f);
2517
+ return F ? /* @__PURE__ */ Dt(
2518
+ k,
2501
2519
  {
2502
- ...ot(y, m),
2503
- height: F.size,
2504
- index: F.index,
2505
- key: q,
2506
- type: F.type || "item",
2507
- ...F.type === "group" ? {} : { groupIndex: F.groupIndex }
2520
+ ...st(k, f),
2521
+ height: $.size,
2522
+ index: $.index,
2523
+ key: X,
2524
+ type: $.type || "item",
2525
+ ...$.type === "group" ? {} : { groupIndex: $.groupIndex }
2508
2526
  }
2509
- ) : F.type === "group" ? /* @__PURE__ */ Dt(
2510
- g,
2527
+ ) : $.type === "group" ? /* @__PURE__ */ Dt(
2528
+ b,
2511
2529
  {
2512
- ...ot(g, m),
2513
- "data-index": mt,
2514
- "data-item-index": F.index,
2515
- "data-known-size": F.size,
2516
- key: q,
2530
+ ...st(b, f),
2531
+ "data-index": j,
2532
+ "data-item-index": $.index,
2533
+ "data-known-size": $.size,
2534
+ key: X,
2517
2535
  style: fr
2518
2536
  },
2519
- v(F.index, m)
2537
+ v($.index, f)
2520
2538
  ) : /* @__PURE__ */ Dt(
2521
- u,
2539
+ p,
2522
2540
  {
2523
- ...ot(u, m),
2524
- ...co(u, F.data),
2525
- "data-index": mt,
2526
- "data-item-group-index": F.groupIndex,
2527
- "data-item-index": F.index,
2528
- "data-known-size": F.size,
2529
- key: q,
2530
- style: h ? mr : lo
2541
+ ...st(p, f),
2542
+ ...co(p, $.data),
2543
+ "data-index": j,
2544
+ "data-item-group-index": $.groupIndex,
2545
+ "data-item-index": $.index,
2546
+ "data-known-size": $.size,
2547
+ key: X,
2548
+ style: I ? mr : lo
2531
2549
  },
2532
- O ? d(F.index, F.groupIndex, F.data, m) : d(F.index, F.data, m)
2550
+ O ? d($.index, $.groupIndex, $.data, f) : d($.index, $.data, f)
2533
2551
  );
2534
2552
  })
2535
2553
  }
@@ -2544,23 +2562,23 @@ const ur = /* @__PURE__ */ j(() => {
2544
2562
  outline: "none",
2545
2563
  overflowX: "auto",
2546
2564
  position: "relative"
2547
- }, He = (t) => ({
2565
+ }, Ee = (t) => ({
2548
2566
  height: "100%",
2549
2567
  position: "absolute",
2550
2568
  top: 0,
2551
2569
  width: "100%",
2552
2570
  ...t ? { display: "flex", flexDirection: "column" } : void 0
2553
- }), tn = (t, e, n = 0) => ({
2554
- ...He(t),
2571
+ }), en = (t, e, n = 0) => ({
2572
+ ...Ee(t),
2555
2573
  position: e ? "relative" : "absolute",
2556
2574
  top: e ? -n : 0
2557
2575
  }), gr = {
2558
- position: Je(),
2576
+ position: Qe(),
2559
2577
  top: 0,
2560
2578
  width: "100%",
2561
2579
  zIndex: 1
2562
2580
  };
2563
- function ot(t, e) {
2581
+ function st(t, e) {
2564
2582
  if (typeof t != "string")
2565
2583
  return { context: e };
2566
2584
  }
@@ -2568,7 +2586,7 @@ function co(t, e) {
2568
2586
  return { item: typeof t == "string" ? void 0 : e };
2569
2587
  }
2570
2588
  const Ir = /* @__PURE__ */ E.memo(function() {
2571
- const e = A("HeaderComponent"), n = Ct("headerHeight"), o = A("HeaderFooterTag"), r = kt(
2589
+ const e = A("HeaderComponent"), n = Tt("headerHeight"), o = A("HeaderFooterTag"), r = Ot(
2572
2590
  E.useMemo(
2573
2591
  () => (i) => {
2574
2592
  n(Ht(i, "height"));
@@ -2578,9 +2596,9 @@ const Ir = /* @__PURE__ */ E.memo(function() {
2578
2596
  !0,
2579
2597
  A("skipAnimationFrameInResizeObserver")
2580
2598
  ), s = A("context");
2581
- return e != null ? /* @__PURE__ */ G(o, { ref: r, children: /* @__PURE__ */ G(e, { ...ot(e, s) }) }) : null;
2599
+ return e != null ? /* @__PURE__ */ G(o, { ref: r, children: /* @__PURE__ */ G(e, { ...st(e, s) }) }) : null;
2582
2600
  }), Sr = /* @__PURE__ */ E.memo(function() {
2583
- const e = A("FooterComponent"), n = Ct("footerHeight"), o = A("HeaderFooterTag"), r = kt(
2601
+ const e = A("FooterComponent"), n = Tt("footerHeight"), o = A("HeaderFooterTag"), r = Ot(
2584
2602
  E.useMemo(
2585
2603
  () => (i) => {
2586
2604
  n(Ht(i, "height"));
@@ -2590,93 +2608,93 @@ const Ir = /* @__PURE__ */ E.memo(function() {
2590
2608
  !0,
2591
2609
  A("skipAnimationFrameInResizeObserver")
2592
2610
  ), s = A("context");
2593
- return e != null ? /* @__PURE__ */ G(o, { ref: r, children: /* @__PURE__ */ G(e, { ...ot(e, s) }) }) : null;
2611
+ return e != null ? /* @__PURE__ */ G(o, { ref: r, children: /* @__PURE__ */ G(e, { ...st(e, s) }) }) : null;
2594
2612
  });
2595
- function en({ useEmitter: t, useEmitterValue: e, usePublisher: n }) {
2613
+ function nn({ useEmitter: t, useEmitterValue: e, usePublisher: n }) {
2596
2614
  return E.memo(function({ children: s, style: i, context: l, ...c }) {
2597
- const d = n("scrollContainerState"), m = e("ScrollerComponent"), v = n("smoothScrollTargetReached"), p = e("scrollerRef"), I = e("horizontalDirection") || !1, { scrollByCallback: w, scrollerRef: R, scrollToCallback: h } = io(
2615
+ const d = n("scrollContainerState"), f = e("ScrollerComponent"), v = n("smoothScrollTargetReached"), m = e("scrollerRef"), g = e("horizontalDirection") || !1, { scrollByCallback: y, scrollerRef: R, scrollToCallback: I } = io(
2598
2616
  d,
2599
2617
  v,
2618
+ f,
2600
2619
  m,
2601
- p,
2602
2620
  void 0,
2603
- I
2621
+ g
2604
2622
  );
2605
- return t("scrollTo", h), t("scrollBy", w), /* @__PURE__ */ G(
2606
- m,
2623
+ return t("scrollTo", I), t("scrollBy", y), /* @__PURE__ */ G(
2624
+ f,
2607
2625
  {
2608
2626
  "data-testid": "virtuoso-scroller",
2609
2627
  "data-virtuoso-scroller": !0,
2610
2628
  ref: R,
2611
- style: { ...I ? hr : pr, ...i },
2629
+ style: { ...g ? hr : pr, ...i },
2612
2630
  tabIndex: 0,
2613
2631
  ...c,
2614
- ...ot(m, l),
2632
+ ...st(f, l),
2615
2633
  children: s
2616
2634
  }
2617
2635
  );
2618
2636
  });
2619
2637
  }
2620
- function nn({ useEmitter: t, useEmitterValue: e, usePublisher: n }) {
2638
+ function on({ useEmitter: t, useEmitterValue: e, usePublisher: n }) {
2621
2639
  return E.memo(function({ children: s, style: i, context: l, ...c }) {
2622
- const d = n("windowScrollContainerState"), m = e("ScrollerComponent"), v = n("smoothScrollTargetReached"), p = e("totalListHeight"), I = e("deviation"), w = e("customScrollParent"), R = E.useRef(null), h = e("scrollerRef"), { scrollByCallback: f, scrollerRef: a, scrollToCallback: S } = io(
2640
+ const d = n("windowScrollContainerState"), f = e("ScrollerComponent"), v = n("smoothScrollTargetReached"), m = e("totalListHeight"), g = e("deviation"), y = e("customScrollParent"), R = E.useRef(null), I = e("scrollerRef"), { scrollByCallback: h, scrollerRef: a, scrollToCallback: T } = io(
2623
2641
  d,
2624
2642
  v,
2625
- m,
2626
- h,
2627
- w
2643
+ f,
2644
+ I,
2645
+ y
2628
2646
  );
2629
- return so(() => (a.current = w ?? R.current?.ownerDocument.defaultView, () => {
2647
+ return be(() => (a.current = y ?? R.current?.ownerDocument.defaultView, () => {
2630
2648
  a.current = null;
2631
- }), [a, w]), t("windowScrollTo", S), t("scrollBy", f), /* @__PURE__ */ G(
2632
- m,
2649
+ }), [a, y]), t("windowScrollTo", T), t("scrollBy", h), /* @__PURE__ */ G(
2650
+ f,
2633
2651
  {
2634
2652
  ref: R,
2635
2653
  "data-virtuoso-scroller": !0,
2636
- style: { position: "relative", ...i, ...p === 0 ? void 0 : { height: p + I } },
2654
+ style: { position: "relative", ...i, ...m === 0 ? void 0 : { height: m + g } },
2637
2655
  ...c,
2638
- ...ot(m, l),
2656
+ ...st(f, l),
2639
2657
  children: s
2640
2658
  }
2641
2659
  );
2642
2660
  });
2643
2661
  }
2644
2662
  const xr = ({ children: t }) => {
2645
- const e = E.useContext(Re), n = Ct("viewportHeight"), o = Ct("fixedItemHeight"), r = A("alignToBottom"), s = A("horizontalDirection"), i = E.useMemo(
2663
+ const e = E.useContext(He), n = Tt("viewportHeight"), o = Tt("fixedItemHeight"), r = A("alignToBottom"), s = A("horizontalDirection"), i = E.useMemo(
2646
2664
  () => re(n, (c) => Ht(c, s ? "width" : "height")),
2647
2665
  [n, s]
2648
- ), l = kt(i, !0, A("skipAnimationFrameInResizeObserver"));
2666
+ ), l = Ot(i, !0, A("skipAnimationFrameInResizeObserver"));
2649
2667
  return E.useEffect(() => {
2650
2668
  e && (n(e.viewportHeight), o(e.itemHeight));
2651
- }, [e, n, o]), /* @__PURE__ */ G("div", { "data-viewport-type": "element", ref: l, style: He(r), children: t });
2669
+ }, [e, n, o]), /* @__PURE__ */ G("div", { "data-viewport-type": "element", ref: l, style: Ee(r), children: t });
2652
2670
  }, vr = ({ children: t }) => {
2653
- const e = E.useContext(Re), n = Ct("windowViewportRect"), o = Ct("fixedItemHeight"), r = A("customScrollParent"), s = A("useWindowScroll"), i = A("topListHeight"), l = $e(
2671
+ const e = E.useContext(He), n = Tt("windowViewportRect"), o = Tt("fixedItemHeight"), r = A("customScrollParent"), s = A("useWindowScroll"), i = A("topListHeight"), l = Ue(
2654
2672
  n,
2655
2673
  r,
2656
2674
  A("skipAnimationFrameInResizeObserver")
2657
2675
  ), c = A("alignToBottom");
2658
2676
  return E.useEffect(() => {
2659
2677
  e && (o(e.itemHeight), n({ listHeight: 0, offsetTop: 0, visibleHeight: e.viewportHeight, visibleWidth: 100 }));
2660
- }, [e, n, o]), /* @__PURE__ */ G("div", { "data-viewport-type": "window", ref: l, style: tn(c, s, i), children: t });
2678
+ }, [e, n, o]), /* @__PURE__ */ G("div", { "data-viewport-type": "window", ref: l, style: en(c, s, i), children: t });
2661
2679
  }, Tr = ({ children: t }) => {
2662
2680
  const e = A("TopItemListComponent") ?? "div", n = A("headerHeight"), o = { ...gr, marginTop: `${n}px` }, r = A("context");
2663
- return /* @__PURE__ */ G(e, { style: o, ...ot(e, r), children: t });
2681
+ return /* @__PURE__ */ G(e, { style: o, ...st(e, r), children: t });
2664
2682
  }, Cr = /* @__PURE__ */ E.memo(function(e) {
2665
2683
  const n = A("useWindowScroll"), o = A("topItemsIndexes").length > 0, r = A("customScrollParent"), s = A("context");
2666
2684
  return /* @__PURE__ */ $t(r || n ? yr : wr, { ...e, context: s, children: [
2667
- o && /* @__PURE__ */ G(Tr, { children: /* @__PURE__ */ G(Rn, { showTopList: !0 }) }),
2685
+ o && /* @__PURE__ */ G(Tr, { children: /* @__PURE__ */ G(Hn, { showTopList: !0 }) }),
2668
2686
  /* @__PURE__ */ $t(r || n ? vr : xr, { children: [
2669
2687
  /* @__PURE__ */ G(Ir, {}),
2670
- /* @__PURE__ */ G(Rn, {}),
2688
+ /* @__PURE__ */ G(Hn, {}),
2671
2689
  /* @__PURE__ */ G(Sr, {})
2672
2690
  ] })
2673
2691
  ] });
2674
2692
  }), {
2675
2693
  Component: uo,
2676
- useEmitter: on,
2694
+ useEmitter: rn,
2677
2695
  useEmitterValue: A,
2678
- usePublisher: Ct
2679
- } = /* @__PURE__ */ Xe(
2696
+ usePublisher: Tt
2697
+ } = /* @__PURE__ */ Je(
2680
2698
  ar,
2681
2699
  {
2682
2700
  optional: {
@@ -2738,20 +2756,20 @@ const xr = ({ children: t }) => {
2738
2756
  }
2739
2757
  },
2740
2758
  Cr
2741
- ), wr = /* @__PURE__ */ en({ useEmitter: on, useEmitterValue: A, usePublisher: Ct }), yr = /* @__PURE__ */ nn({ useEmitter: on, useEmitterValue: A, usePublisher: Ct }), es = uo, ns = uo, br = /* @__PURE__ */ j(() => {
2742
- const t = T((d) => /* @__PURE__ */ $t("td", { children: [
2759
+ ), wr = /* @__PURE__ */ nn({ useEmitter: rn, useEmitterValue: A, usePublisher: Tt }), yr = /* @__PURE__ */ on({ useEmitter: rn, useEmitterValue: A, usePublisher: Tt }), es = uo, ns = uo, br = /* @__PURE__ */ Z(() => {
2760
+ const t = w((d) => /* @__PURE__ */ $t("td", { children: [
2743
2761
  "Item $",
2744
2762
  d
2745
- ] })), e = T(null), n = T((d) => /* @__PURE__ */ $t("td", { colSpan: 1e3, children: [
2763
+ ] })), e = w(null), n = w((d) => /* @__PURE__ */ $t("td", { colSpan: 1e3, children: [
2746
2764
  "Group ",
2747
2765
  d
2748
- ] })), o = T(null), r = T(null), s = T({}), i = T(Qe), l = T(Jt), c = (d, m = null) => ht(
2749
- x(
2766
+ ] })), o = w(null), r = w(null), s = w({}), i = w(tn), l = w(Jt), c = (d, f = null) => ht(
2767
+ S(
2750
2768
  s,
2751
2769
  B((v) => v[d]),
2752
- nt()
2770
+ rt()
2753
2771
  ),
2754
- m
2772
+ f
2755
2773
  );
2756
2774
  return {
2757
2775
  components: s,
@@ -2773,55 +2791,55 @@ const xr = ({ children: t }) => {
2773
2791
  TableRowComponent: c("TableRow", "tr"),
2774
2792
  GroupComponent: c("Group", "tr")
2775
2793
  };
2776
- }), Rr = /* @__PURE__ */ j(
2794
+ }), Rr = /* @__PURE__ */ Z(
2777
2795
  ([t, e]) => ({ ...t, ...e }),
2778
- rt(oo, br)
2779
- ), Hr = ({ height: t }) => /* @__PURE__ */ G("tr", { children: /* @__PURE__ */ G("td", { style: { height: t } }) }), Er = ({ height: t }) => /* @__PURE__ */ G("tr", { children: /* @__PURE__ */ G("td", { style: { border: 0, height: t, padding: 0 } }) }), Br = { overflowAnchor: "none" }, Hn = { position: Je(), zIndex: 2, overflowAnchor: "none" }, En = /* @__PURE__ */ E.memo(function({ showTopList: e = !1 }) {
2780
- const n = _("listState"), o = _("computeItemKey"), r = _("firstItemIndex"), s = _("context"), i = _("isSeeking"), l = _("fixedHeaderHeight"), c = _("groupIndices").length > 0, d = _("itemContent"), m = _("groupContent"), v = _("ScrollSeekPlaceholder") ?? Hr, p = _("GroupComponent"), I = _("TableRowComponent"), w = (e ? n.topItems : []).reduce((h, f, a) => (a === 0 ? h.push(f.size) : h.push(h[a - 1] + f.size), h), []);
2781
- return (e ? n.topItems : n.items).map((h) => {
2782
- const f = h.originalIndex, a = o(f + r, h.data, s), S = e ? f === 0 ? 0 : w[f - 1] : 0;
2796
+ it(ro, br)
2797
+ ), Hr = ({ height: t }) => /* @__PURE__ */ G("tr", { children: /* @__PURE__ */ G("td", { style: { height: t } }) }), Er = ({ height: t }) => /* @__PURE__ */ G("tr", { children: /* @__PURE__ */ G("td", { style: { border: 0, height: t, padding: 0 } }) }), Br = { overflowAnchor: "none" }, En = { position: Qe(), zIndex: 2, overflowAnchor: "none" }, Bn = /* @__PURE__ */ E.memo(function({ showTopList: e = !1 }) {
2798
+ const n = _("listState"), o = _("computeItemKey"), r = _("firstItemIndex"), s = _("context"), i = _("isSeeking"), l = _("fixedHeaderHeight"), c = _("groupIndices").length > 0, d = _("itemContent"), f = _("groupContent"), v = _("ScrollSeekPlaceholder") ?? Hr, m = _("GroupComponent"), g = _("TableRowComponent"), y = (e ? n.topItems : []).reduce((I, h, a) => (a === 0 ? I.push(h.size) : I.push(I[a - 1] + h.size), I), []);
2799
+ return (e ? n.topItems : n.items).map((I) => {
2800
+ const h = I.originalIndex, a = o(h + r, I.data, s), T = e ? h === 0 ? 0 : y[h - 1] : 0;
2783
2801
  return i ? /* @__PURE__ */ Dt(
2784
2802
  v,
2785
2803
  {
2786
- ...ot(v, s),
2787
- height: h.size,
2788
- index: h.index,
2804
+ ...st(v, s),
2805
+ height: I.size,
2806
+ index: I.index,
2789
2807
  key: a,
2790
- type: h.type || "item"
2808
+ type: I.type || "item"
2791
2809
  }
2792
- ) : h.type === "group" ? /* @__PURE__ */ Dt(
2793
- p,
2810
+ ) : I.type === "group" ? /* @__PURE__ */ Dt(
2811
+ m,
2794
2812
  {
2795
- ...ot(p, s),
2796
- "data-index": f,
2797
- "data-item-index": h.index,
2798
- "data-known-size": h.size,
2813
+ ...st(m, s),
2814
+ "data-index": h,
2815
+ "data-item-index": I.index,
2816
+ "data-known-size": I.size,
2799
2817
  key: a,
2800
2818
  style: {
2801
- ...Hn,
2819
+ ...En,
2802
2820
  top: l
2803
2821
  }
2804
2822
  },
2805
- m(h.index, s)
2823
+ f(I.index, s)
2806
2824
  ) : /* @__PURE__ */ Dt(
2807
- I,
2825
+ g,
2808
2826
  {
2809
- ...ot(I, s),
2810
- ...co(I, h.data),
2811
- "data-index": f,
2812
- "data-item-index": h.index,
2813
- "data-known-size": h.size,
2814
- "data-item-group-index": h.groupIndex,
2827
+ ...st(g, s),
2828
+ ...co(g, I.data),
2829
+ "data-index": h,
2830
+ "data-item-index": I.index,
2831
+ "data-known-size": I.size,
2832
+ "data-item-group-index": I.groupIndex,
2815
2833
  key: a,
2816
- style: e ? { ...Hn, top: l + S } : Br
2834
+ style: e ? { ...En, top: l + T } : Br
2817
2835
  },
2818
- c ? d(h.index, h.groupIndex, h.data, s) : d(h.index, h.data, s)
2836
+ c ? d(I.index, I.groupIndex, I.data, s) : d(I.index, I.data, s)
2819
2837
  );
2820
2838
  });
2821
- }), Or = /* @__PURE__ */ E.memo(function() {
2822
- const e = _("listState"), n = _("topItemsIndexes").length > 0, o = bt("sizeRanges"), r = _("useWindowScroll"), s = _("customScrollParent"), i = bt("windowScrollContainerState"), l = bt("scrollContainerState"), c = s || r ? i : l, d = _("trackItemSizes"), m = _("itemSize"), v = _("log"), { callbackRef: p, ref: I } = Gn(
2839
+ }), kr = /* @__PURE__ */ E.memo(function() {
2840
+ const e = _("listState"), n = _("topItemsIndexes").length > 0, o = wt("sizeRanges"), r = _("useWindowScroll"), s = _("customScrollParent"), i = wt("windowScrollContainerState"), l = wt("scrollContainerState"), c = s || r ? i : l, d = _("trackItemSizes"), f = _("itemSize"), v = _("log"), { callbackRef: m, ref: g } = An(
2823
2841
  o,
2824
- m,
2842
+ f,
2825
2843
  d,
2826
2844
  c,
2827
2845
  v,
@@ -2829,77 +2847,81 @@ const xr = ({ children: t }) => {
2829
2847
  s,
2830
2848
  !1,
2831
2849
  _("skipAnimationFrameInResizeObserver")
2832
- ), [w, R] = E.useState(0);
2833
- rn("deviation", (O) => {
2834
- w !== O && (I.current.style.marginTop = `${O}px`, R(O));
2850
+ ), [y, R] = E.useState(0);
2851
+ sn("deviation", (O) => {
2852
+ y !== O && (g.current.style.marginTop = `${O}px`, R(O));
2835
2853
  });
2836
- const h = _("EmptyPlaceholder"), f = _("FillerRow") ?? Er, a = _("TableBodyComponent"), S = _("paddingTopAddition"), H = _("statefulTotalCount"), y = _("context");
2837
- if (H === 0 && h !== null && h !== void 0)
2838
- return /* @__PURE__ */ G(h, { ...ot(h, y) });
2839
- const k = (n ? e.topItems : []).reduce((O, V) => O + V.size, 0), u = e.offsetTop + S + w - k, g = e.offsetBottom, C = u > 0 ? /* @__PURE__ */ G(f, { context: y, height: u }, "padding-top") : null, L = g > 0 ? /* @__PURE__ */ G(f, { context: y, height: g }, "padding-bottom") : null;
2840
- return /* @__PURE__ */ $t(a, { "data-testid": "virtuoso-item-list", ref: p, ...ot(a, y), children: [
2841
- C,
2842
- n && /* @__PURE__ */ G(En, { showTopList: !0 }),
2843
- /* @__PURE__ */ G(En, {}),
2844
- L
2854
+ const I = wt("deviationCommitted");
2855
+ be(() => {
2856
+ I(y);
2857
+ }, [y, I]);
2858
+ const h = _("EmptyPlaceholder"), a = _("FillerRow") ?? Er, T = _("TableBodyComponent"), x = _("paddingTopAddition"), C = _("statefulTotalCount"), k = _("context");
2859
+ if (C === 0 && h !== null && h !== void 0)
2860
+ return /* @__PURE__ */ G(h, { ...st(h, k) });
2861
+ const u = (n ? e.topItems : []).reduce((O, V) => O + V.size, 0), p = e.offsetTop + x + y - u, b = e.offsetBottom, z = p > 0 ? /* @__PURE__ */ G(a, { context: k, height: p }, "padding-top") : null, F = b > 0 ? /* @__PURE__ */ G(a, { context: k, height: b }, "padding-bottom") : null;
2862
+ return /* @__PURE__ */ $t(T, { "data-testid": "virtuoso-item-list", ref: m, ...st(T, k), children: [
2863
+ z,
2864
+ n && /* @__PURE__ */ G(Bn, { showTopList: !0 }),
2865
+ /* @__PURE__ */ G(Bn, {}),
2866
+ F
2845
2867
  ] });
2846
- }), kr = ({ children: t }) => {
2847
- const e = E.useContext(Re), n = bt("viewportHeight"), o = bt("fixedItemHeight"), r = kt(
2868
+ }), Or = ({ children: t }) => {
2869
+ const e = E.useContext(He), n = wt("viewportHeight"), o = wt("fixedItemHeight"), r = Ot(
2848
2870
  E.useMemo(() => re(n, (s) => Ht(s, "height")), [n]),
2849
2871
  !0,
2850
2872
  _("skipAnimationFrameInResizeObserver")
2851
2873
  );
2852
2874
  return E.useEffect(() => {
2853
2875
  e && (n(e.viewportHeight), o(e.itemHeight));
2854
- }, [e, n, o]), /* @__PURE__ */ G("div", { "data-viewport-type": "element", ref: r, style: He(!1), children: t });
2876
+ }, [e, n, o]), /* @__PURE__ */ G("div", { "data-viewport-type": "element", ref: r, style: Ee(!1), children: t });
2855
2877
  }, Lr = ({ children: t }) => {
2856
- const e = E.useContext(Re), n = bt("windowViewportRect"), o = bt("fixedItemHeight"), r = _("customScrollParent"), s = _("useWindowScroll"), i = $e(
2878
+ const e = E.useContext(He), n = wt("windowViewportRect"), o = wt("fixedItemHeight"), r = _("customScrollParent"), s = _("useWindowScroll"), i = Ue(
2857
2879
  n,
2858
2880
  r,
2859
2881
  _("skipAnimationFrameInResizeObserver")
2860
2882
  );
2861
2883
  return E.useEffect(() => {
2862
2884
  e && (o(e.itemHeight), n({ listHeight: 0, offsetTop: 0, visibleHeight: e.viewportHeight, visibleWidth: 100 }));
2863
- }, [e, n, o]), /* @__PURE__ */ G("div", { "data-viewport-type": "window", ref: i, style: tn(!1, s), children: t });
2885
+ }, [e, n, o]), /* @__PURE__ */ G("div", { "data-viewport-type": "window", ref: i, style: en(!1, s), children: t });
2864
2886
  }, zr = /* @__PURE__ */ E.memo(function(e) {
2865
- const n = _("useWindowScroll"), o = _("customScrollParent"), r = bt("fixedHeaderHeight"), s = bt("fixedFooterHeight"), i = _("fixedHeaderContent"), l = _("fixedFooterContent"), c = _("context"), d = kt(
2887
+ const n = _("useWindowScroll"), o = _("customScrollParent"), r = wt("fixedHeaderHeight"), s = wt("fixedFooterHeight"), i = _("fixedHeaderContent"), l = _("fixedFooterContent"), c = _("context"), d = Ot(
2866
2888
  E.useMemo(() => re(r, (a) => Ht(a, "height")), [r]),
2867
2889
  !0,
2868
2890
  _("skipAnimationFrameInResizeObserver")
2869
- ), m = kt(
2891
+ ), f = Ot(
2870
2892
  E.useMemo(() => re(s, (a) => Ht(a, "height")), [s]),
2871
2893
  !0,
2872
2894
  _("skipAnimationFrameInResizeObserver")
2873
- ), v = o || n ? Vr : Fr, p = o || n ? Lr : kr, I = _("TableComponent"), w = _("TableHeadComponent"), R = _("TableFooterComponent"), h = i ? /* @__PURE__ */ G(
2874
- w,
2895
+ ), v = o || n ? Vr : Fr, m = o || n ? Lr : Or, g = _("TableComponent"), y = _("TableHeadComponent"), R = _("TableFooterComponent"), I = i ? /* @__PURE__ */ G(
2896
+ y,
2875
2897
  {
2876
2898
  ref: d,
2877
2899
  style: { position: "sticky", top: 0, zIndex: 2 },
2878
- ...ot(w, c),
2900
+ ...st(y, c),
2879
2901
  children: i()
2880
2902
  },
2881
2903
  "TableHead"
2882
- ) : null, f = l ? /* @__PURE__ */ G(
2904
+ ) : null, h = l ? /* @__PURE__ */ G(
2883
2905
  R,
2884
2906
  {
2885
- ref: m,
2907
+ ref: f,
2886
2908
  style: { bottom: 0, position: "sticky", zIndex: 1 },
2887
- ...ot(R, c),
2909
+ ...st(R, c),
2888
2910
  children: l()
2889
2911
  },
2890
2912
  "TableFoot"
2891
2913
  ) : null;
2892
- return /* @__PURE__ */ G(v, { ...e, ...ot(v, c), children: /* @__PURE__ */ G(p, { children: /* @__PURE__ */ $t(I, { style: { borderSpacing: 0, overflowAnchor: "none" }, ...ot(I, c), children: [
2893
- h,
2894
- /* @__PURE__ */ G(Or, {}, "TableBody"),
2895
- f
2914
+ return /* @__PURE__ */ G(v, { ...e, ...st(v, c), children: /* @__PURE__ */ G(m, { children: /* @__PURE__ */ $t(g, { style: { borderSpacing: 0, overflowAnchor: "none" }, ...st(g, c), children: [
2915
+ I,
2916
+ /* @__PURE__ */ G(kr, {}, "TableBody"),
2917
+ h
2896
2918
  ] }) }) });
2897
2919
  }), {
2898
2920
  Component: ao,
2899
- useEmitter: rn,
2921
+ useEmitter: sn,
2900
2922
  useEmitterValue: _,
2901
- usePublisher: bt
2902
- } = /* @__PURE__ */ Xe(
2923
+ usePublisher: wt
2924
+ } = /* @__PURE__ */ Je(
2903
2925
  Rr,
2904
2926
  {
2905
2927
  optional: {
@@ -2957,7 +2979,7 @@ const xr = ({ children: t }) => {
2957
2979
  }
2958
2980
  },
2959
2981
  zr
2960
- ), Fr = /* @__PURE__ */ en({ useEmitter: rn, useEmitterValue: _, usePublisher: bt }), Vr = /* @__PURE__ */ nn({ useEmitter: rn, useEmitterValue: _, usePublisher: bt }), os = ao, rs = ao, Bn = {
2982
+ ), Fr = /* @__PURE__ */ nn({ useEmitter: sn, useEmitterValue: _, usePublisher: wt }), Vr = /* @__PURE__ */ on({ useEmitter: sn, useEmitterValue: _, usePublisher: wt }), os = ao, rs = ao, kn = {
2961
2983
  bottom: 0,
2962
2984
  itemHeight: 0,
2963
2985
  items: [],
@@ -2965,7 +2987,7 @@ const xr = ({ children: t }) => {
2965
2987
  offsetBottom: 0,
2966
2988
  offsetTop: 0,
2967
2989
  top: 0
2968
- }, Wr = {
2990
+ }, Pr = {
2969
2991
  bottom: 0,
2970
2992
  itemHeight: 0,
2971
2993
  items: [{ index: 0 }],
@@ -2973,13 +2995,13 @@ const xr = ({ children: t }) => {
2973
2995
  offsetBottom: 0,
2974
2996
  offsetTop: 0,
2975
2997
  top: 0
2976
- }, { ceil: On, floor: Ce, max: oe, min: ze, round: kn } = Math;
2977
- function Ln(t, e, n) {
2998
+ }, { ceil: On, floor: Ce, max: oe, min: Fe, round: Ln } = Math;
2999
+ function zn(t, e, n) {
2978
3000
  return Array.from({ length: e - t + 1 }).map((o, r) => ({ data: n === null ? null : n[r + t], index: r + t }));
2979
3001
  }
2980
- function Pr(t) {
3002
+ function Wr(t) {
2981
3003
  return {
2982
- ...Wr,
3004
+ ...Pr,
2983
3005
  items: t
2984
3006
  };
2985
3007
  }
@@ -2989,281 +3011,281 @@ function Se(t, e) {
2989
3011
  function Gr(t, e) {
2990
3012
  return t !== void 0 && t.column === e.column && t.row === e.row;
2991
3013
  }
2992
- const Ar = /* @__PURE__ */ j(
3014
+ const Ar = /* @__PURE__ */ Z(
2993
3015
  ([
2994
3016
  { increaseViewportBy: t, listBoundary: e, overscan: n, visibleRange: o },
2995
- { footerHeight: r, headerHeight: s, scrollBy: i, scrollContainerState: l, scrollTo: c, scrollTop: d, smoothScrollTargetReached: m, viewportHeight: v },
2996
- p,
2997
- I,
2998
- { didMount: w, propsReady: R },
2999
- { customScrollParent: h, useWindowScroll: f, windowScrollContainerState: a, windowScrollTo: S, windowViewportRect: H },
3000
- y
3017
+ { footerHeight: r, headerHeight: s, scrollBy: i, scrollContainerState: l, scrollTo: c, scrollTop: d, smoothScrollTargetReached: f, viewportHeight: v },
3018
+ m,
3019
+ g,
3020
+ { didMount: y, propsReady: R },
3021
+ { customScrollParent: I, useWindowScroll: h, windowScrollContainerState: a, windowScrollTo: T, windowViewportRect: x },
3022
+ C
3001
3023
  ]) => {
3002
- const k = T(0), u = T(0), g = T(Bn), C = T({ height: 0, width: 0 }), L = T({ height: 0, width: 0 }), O = U(), V = U(), N = T(0), Z = T(null), F = T({ column: 0, row: 0 }), mt = U(), q = U(), Q = T(!1), gt = T(0), lt = T(!0), St = T(!1), Ft = T(!1);
3003
- Y(
3004
- x(
3005
- w,
3006
- $(gt),
3007
- P(([b, D]) => !Ae(D))
3024
+ const k = w(0), u = w(0), p = w(kn), b = w({ height: 0, width: 0 }), z = w({ height: 0, width: 0 }), F = K(), O = K(), V = w(0), U = w(null), q = w({ column: 0, row: 0 }), $ = K(), j = K(), X = w(!1), gt = w(0), ct = w(!0), St = w(!1), Ft = w(!1);
3025
+ J(
3026
+ S(
3027
+ y,
3028
+ D(gt),
3029
+ W(([H, N]) => !Me(N))
3008
3030
  ),
3009
3031
  () => {
3010
- M(lt, !1);
3032
+ M(ct, !1);
3011
3033
  }
3012
- ), Y(
3013
- x(
3014
- at(w, lt, L, C, gt, St),
3015
- P(([b, D, K, st, , tt]) => b && !D && K.height !== 0 && st.height !== 0 && !tt)
3034
+ ), J(
3035
+ S(
3036
+ dt(y, ct, z, b, gt, St),
3037
+ W(([H, N, Y, lt, , et]) => H && !N && Y.height !== 0 && lt.height !== 0 && !et)
3016
3038
  ),
3017
- ([, , , , b]) => {
3018
- if (b === void 0) {
3019
- M(lt, !0);
3039
+ ([, , , , H]) => {
3040
+ if (H === void 0) {
3041
+ M(ct, !0);
3020
3042
  return;
3021
3043
  }
3022
- M(St, !0), je(1, () => {
3023
- M(O, b);
3024
- }), yt(x(d), () => {
3025
- M(e, [0, 0]), M(lt, !0);
3044
+ M(St, !0), qe(1, () => {
3045
+ M(F, H);
3046
+ }), bt(S(d), () => {
3047
+ M(e, [0, 0]), M(ct, !0);
3026
3048
  });
3027
3049
  }
3028
- ), z(
3029
- x(
3030
- q,
3031
- P((b) => b != null && b.scrollTop > 0),
3050
+ ), L(
3051
+ S(
3052
+ j,
3053
+ W((H) => H != null && H.scrollTop > 0),
3032
3054
  Bt(0)
3033
3055
  ),
3034
3056
  u
3035
- ), Y(
3036
- x(
3037
- w,
3038
- $(q),
3039
- P(([, b]) => b != null)
3057
+ ), J(
3058
+ S(
3059
+ y,
3060
+ D(j),
3061
+ W(([, H]) => H != null)
3040
3062
  ),
3041
- ([, b]) => {
3042
- b && (M(C, b.viewport), M(L, b.item), M(F, b.gap), b.scrollTop > 0 && (M(Q, !0), yt(x(d, Ut(1)), (D) => {
3043
- M(Q, !1);
3044
- }), M(c, { top: b.scrollTop })));
3063
+ ([, H]) => {
3064
+ H && (M(b, H.viewport), M(z, H.item), M(q, H.gap), H.scrollTop > 0 && (M(X, !0), bt(S(d, Ut(1)), (N) => {
3065
+ M(X, !1);
3066
+ }), M(c, { top: H.scrollTop })));
3045
3067
  }
3046
- ), z(
3047
- x(
3048
- C,
3049
- B(({ height: b }) => b)
3068
+ ), L(
3069
+ S(
3070
+ b,
3071
+ B(({ height: H }) => H)
3050
3072
  ),
3051
3073
  v
3052
- ), z(
3053
- x(
3054
- at(
3055
- W(C, Se),
3056
- W(L, Se),
3057
- W(F, (b, D) => b !== void 0 && b.column === D.column && b.row === D.row),
3058
- W(d)
3074
+ ), L(
3075
+ S(
3076
+ dt(
3077
+ P(b, Se),
3078
+ P(z, Se),
3079
+ P(q, (H, N) => H !== void 0 && H.column === N.column && H.row === N.row),
3080
+ P(d)
3059
3081
  ),
3060
- B(([b, D, K, st]) => ({
3061
- gap: K,
3062
- item: D,
3063
- scrollTop: st,
3064
- viewport: b
3082
+ B(([H, N, Y, lt]) => ({
3083
+ gap: Y,
3084
+ item: N,
3085
+ scrollTop: lt,
3086
+ viewport: H
3065
3087
  }))
3066
3088
  ),
3067
- mt
3068
- ), z(
3069
- x(
3070
- at(
3071
- W(k),
3089
+ $
3090
+ ), L(
3091
+ S(
3092
+ dt(
3093
+ P(k),
3072
3094
  o,
3073
- W(F, Gr),
3074
- W(L, Se),
3075
- W(C, Se),
3076
- W(Z),
3077
- W(u),
3078
- W(Q),
3079
- W(lt),
3080
- W(gt)
3095
+ P(q, Gr),
3096
+ P(z, Se),
3097
+ P(b, Se),
3098
+ P(U),
3099
+ P(u),
3100
+ P(X),
3101
+ P(ct),
3102
+ P(gt)
3081
3103
  ),
3082
- P(([, , , , , , , b]) => !b),
3104
+ W(([, , , , , , , H]) => !H),
3083
3105
  B(
3084
3106
  ([
3085
- b,
3086
- [D, K],
3087
- st,
3088
- tt,
3089
- X,
3090
- ct,
3107
+ H,
3108
+ [N, Y],
3109
+ lt,
3110
+ et,
3111
+ Q,
3112
+ ut,
3091
3113
  xt,
3092
3114
  ,
3093
- ut,
3115
+ at,
3094
3116
  Vt
3095
3117
  ]) => {
3096
- const { column: Wt, row: ee } = st, { height: he, width: Ee } = tt, { width: sn } = X;
3097
- if (xt === 0 && (b === 0 || sn === 0))
3098
- return Bn;
3099
- if (Ee === 0) {
3100
- const dn = qe(Vt, b), ho = dn + Math.max(xt - 1, 0);
3101
- return Pr(Ln(dn, ho, ct));
3118
+ const { column: Pt, row: ee } = lt, { height: he, width: Be } = et, { width: ln } = Q;
3119
+ if (xt === 0 && (H === 0 || ln === 0))
3120
+ return kn;
3121
+ if (Be === 0) {
3122
+ const fn = Ye(Vt, H), ho = fn + Math.max(xt - 1, 0);
3123
+ return Wr(zn(fn, ho, ut));
3102
3124
  }
3103
- const ge = fo(sn, Ee, Wt);
3125
+ const ge = fo(ln, Be, Pt);
3104
3126
  let qt, Mt;
3105
- ut ? D === 0 && K === 0 && xt > 0 ? (qt = 0, Mt = xt - 1) : (qt = ge * Ce((D + ee) / (he + ee)), Mt = ge * On((K + ee) / (he + ee)) - 1, Mt = ze(b - 1, oe(Mt, ge - 1)), qt = ze(Mt, oe(0, qt))) : (qt = 0, Mt = -1);
3106
- const ln = Ln(qt, Mt, ct), { bottom: cn, top: un } = zn(X, st, tt, ln), an = On(b / ge), po = an * he + (an - 1) * ee - cn;
3107
- return { bottom: cn, itemHeight: he, items: ln, itemWidth: Ee, offsetBottom: po, offsetTop: un, top: un };
3127
+ at ? N === 0 && Y === 0 && xt > 0 ? (qt = 0, Mt = xt - 1) : (qt = ge * Ce((N + ee) / (he + ee)), Mt = ge * On((Y + ee) / (he + ee)) - 1, Mt = Fe(H - 1, oe(Mt, ge - 1)), qt = Fe(Mt, oe(0, qt))) : (qt = 0, Mt = -1);
3128
+ const cn = zn(qt, Mt, ut), { bottom: un, top: an } = Fn(Q, lt, et, cn), dn = On(H / ge), po = dn * he + (dn - 1) * ee - un;
3129
+ return { bottom: un, itemHeight: he, items: cn, itemWidth: Be, offsetBottom: po, offsetTop: an, top: an };
3108
3130
  }
3109
3131
  )
3110
3132
  ),
3111
- g
3112
- ), z(
3113
- x(
3114
- Z,
3115
- P((b) => b !== null),
3116
- B((b) => b.length)
3133
+ p
3134
+ ), L(
3135
+ S(
3136
+ U,
3137
+ W((H) => H !== null),
3138
+ B((H) => H.length)
3117
3139
  ),
3118
3140
  k
3119
- ), z(
3120
- x(
3121
- at(C, L, g, F),
3122
- P(([b, D, { items: K }]) => K.length > 0 && D.height !== 0 && b.height !== 0),
3123
- B(([b, D, { items: K }, st]) => {
3124
- const { bottom: tt, top: X } = zn(b, st, D, K);
3125
- return [X, tt];
3141
+ ), L(
3142
+ S(
3143
+ dt(b, z, p, q),
3144
+ W(([H, N, { items: Y }]) => Y.length > 0 && N.height !== 0 && H.height !== 0),
3145
+ B(([H, N, { items: Y }, lt]) => {
3146
+ const { bottom: et, top: Q } = Fn(H, lt, N, Y);
3147
+ return [Q, et];
3126
3148
  }),
3127
- nt(le)
3149
+ rt(le)
3128
3150
  ),
3129
3151
  e
3130
3152
  );
3131
- const pt = T(!1);
3132
- z(
3133
- x(
3153
+ const pt = w(!1);
3154
+ L(
3155
+ S(
3134
3156
  d,
3135
- $(pt),
3136
- B(([b, D]) => D || b !== 0)
3157
+ D(pt),
3158
+ B(([H, N]) => N || H !== 0)
3137
3159
  ),
3138
3160
  pt
3139
3161
  );
3140
- const jt = Tt(
3141
- x(
3142
- at(g, k),
3143
- P(([{ items: b }]) => b.length > 0),
3144
- $(pt),
3145
- P(([[b, D], K]) => {
3146
- const tt = b.items[b.items.length - 1].index === D - 1;
3147
- return (K || b.bottom > 0 && b.itemHeight > 0 && b.offsetBottom === 0 && b.items.length === D) && tt;
3162
+ const jt = Ct(
3163
+ S(
3164
+ dt(p, k),
3165
+ W(([{ items: H }]) => H.length > 0),
3166
+ D(pt),
3167
+ W(([[H, N], Y]) => {
3168
+ const et = H.items[H.items.length - 1].index === N - 1;
3169
+ return (Y || H.bottom > 0 && H.itemHeight > 0 && H.offsetBottom === 0 && H.items.length === N) && et;
3148
3170
  }),
3149
- B(([[, b]]) => b - 1),
3150
- nt()
3171
+ B(([[, H]]) => H - 1),
3172
+ rt()
3151
3173
  )
3152
- ), Qt = Tt(
3153
- x(
3154
- W(g),
3155
- P(({ items: b }) => b.length > 0 && b[0].index === 0),
3174
+ ), Qt = Ct(
3175
+ S(
3176
+ P(p),
3177
+ W(({ items: H }) => H.length > 0 && H[0].index === 0),
3156
3178
  Bt(0),
3157
- nt()
3179
+ rt()
3158
3180
  )
3159
- ), Et = Tt(
3160
- x(
3161
- W(g),
3162
- $(Q),
3163
- P(([{ items: b }, D]) => b.length > 0 && !D),
3164
- B(([{ items: b }]) => ({
3165
- endIndex: b[b.length - 1].index,
3166
- startIndex: b[0].index
3181
+ ), Et = Ct(
3182
+ S(
3183
+ P(p),
3184
+ D(X),
3185
+ W(([{ items: H }, N]) => H.length > 0 && !N),
3186
+ B(([{ items: H }]) => ({
3187
+ endIndex: H[H.length - 1].index,
3188
+ startIndex: H[0].index
3167
3189
  })),
3168
- nt($n),
3190
+ rt(Un),
3169
3191
  zt(0)
3170
3192
  )
3171
3193
  );
3172
- z(Et, I.scrollSeekRangeChanged), z(
3173
- x(
3174
- O,
3175
- $(C, L, k, F),
3176
- B(([b, D, K, st, tt]) => {
3177
- const X = Yn(b), { align: ct, behavior: xt, offset: ut } = X;
3178
- let Vt = X.index;
3179
- Vt === "LAST" && (Vt = st - 1), Vt = oe(0, Vt, ze(st - 1, Vt));
3180
- let Wt = Me(D, tt, K, Vt);
3181
- return ct === "end" ? Wt = kn(Wt - D.height + K.height) : ct === "center" && (Wt = kn(Wt - D.height / 2 + K.height / 2)), ut !== void 0 && ut !== 0 && (Wt += ut), { behavior: xt, top: Wt };
3194
+ L(Et, g.scrollSeekRangeChanged), L(
3195
+ S(
3196
+ F,
3197
+ D(b, z, k, q),
3198
+ B(([H, N, Y, lt, et]) => {
3199
+ const Q = Zn(H), { align: ut, behavior: xt, offset: at } = Q;
3200
+ let Vt = Q.index;
3201
+ Vt === "LAST" && (Vt = lt - 1), Vt = oe(0, Vt, Fe(lt - 1, Vt));
3202
+ let Pt = _e(N, et, Y, Vt);
3203
+ return ut === "end" ? Pt = Ln(Pt - N.height + Y.height) : ut === "center" && (Pt = Ln(Pt - N.height / 2 + Y.height / 2)), at !== void 0 && at !== 0 && (Pt += at), { behavior: xt, top: Pt };
3182
3204
  })
3183
3205
  ),
3184
3206
  c
3185
3207
  );
3186
3208
  const te = ht(
3187
- x(
3188
- g,
3189
- B((b) => b.offsetBottom + b.bottom)
3209
+ S(
3210
+ p,
3211
+ B((H) => H.offsetBottom + H.bottom)
3190
3212
  ),
3191
3213
  0
3192
3214
  );
3193
- return z(
3194
- x(
3195
- H,
3196
- B((b) => ({ height: b.visibleHeight, width: b.visibleWidth }))
3215
+ return L(
3216
+ S(
3217
+ x,
3218
+ B((H) => ({ height: H.visibleHeight, width: H.visibleWidth }))
3197
3219
  ),
3198
- C
3220
+ b
3199
3221
  ), {
3200
- customScrollParent: h,
3222
+ customScrollParent: I,
3201
3223
  // input
3202
- data: Z,
3203
- deviation: N,
3224
+ data: U,
3225
+ deviation: V,
3204
3226
  footerHeight: r,
3205
- gap: F,
3227
+ gap: q,
3206
3228
  headerHeight: s,
3207
3229
  increaseViewportBy: t,
3208
3230
  initialItemCount: u,
3209
- itemDimensions: L,
3231
+ itemDimensions: z,
3210
3232
  overscan: n,
3211
- restoreStateFrom: q,
3233
+ restoreStateFrom: j,
3212
3234
  scrollBy: i,
3213
3235
  scrollContainerState: l,
3214
- scrollHeight: V,
3236
+ scrollHeight: O,
3215
3237
  scrollTo: c,
3216
- scrollToIndex: O,
3238
+ scrollToIndex: F,
3217
3239
  scrollTop: d,
3218
- smoothScrollTargetReached: m,
3240
+ smoothScrollTargetReached: f,
3219
3241
  totalCount: k,
3220
- useWindowScroll: f,
3221
- viewportDimensions: C,
3242
+ useWindowScroll: h,
3243
+ viewportDimensions: b,
3222
3244
  windowScrollContainerState: a,
3223
- windowScrollTo: S,
3224
- windowViewportRect: H,
3225
- ...I,
3245
+ windowScrollTo: T,
3246
+ windowViewportRect: x,
3247
+ ...g,
3226
3248
  // output
3227
- gridState: g,
3249
+ gridState: p,
3228
3250
  horizontalDirection: Ft,
3229
3251
  initialTopMostItemIndex: gt,
3230
3252
  totalListHeight: te,
3231
- ...p,
3253
+ ...m,
3232
3254
  endReached: jt,
3233
3255
  propsReady: R,
3234
3256
  rangeChanged: Et,
3235
3257
  startReached: Qt,
3236
- stateChanged: mt,
3237
- stateRestoreInProgress: Q,
3238
- ...y
3258
+ stateChanged: $,
3259
+ stateRestoreInProgress: X,
3260
+ ...C
3239
3261
  };
3240
3262
  },
3241
- rt(Ye, It, pe, eo, At, Ze, Gt)
3263
+ it(Ze, It, pe, no, At, Xe, Gt)
3242
3264
  );
3243
3265
  function fo(t, e, n) {
3244
3266
  return oe(1, Ce((t + n) / (Ce(e) + n)));
3245
3267
  }
3246
- function zn(t, e, n, o) {
3268
+ function Fn(t, e, n, o) {
3247
3269
  const { height: r } = n;
3248
3270
  if (r === void 0 || o.length === 0)
3249
3271
  return { bottom: 0, top: 0 };
3250
- const s = Me(t, e, n, o[0].index);
3251
- return { bottom: Me(t, e, n, o[o.length - 1].index) + r, top: s };
3272
+ const s = _e(t, e, n, o[0].index);
3273
+ return { bottom: _e(t, e, n, o[o.length - 1].index) + r, top: s };
3252
3274
  }
3253
- function Me(t, e, n, o) {
3275
+ function _e(t, e, n, o) {
3254
3276
  const r = fo(t.width, n.width, e.column), s = Ce(o / r), i = s * n.height + oe(0, s - 1) * e.row;
3255
3277
  return i > 0 ? i + e.row : i;
3256
3278
  }
3257
- const Mr = /* @__PURE__ */ j(() => {
3258
- const t = T((v) => `Item ${v}`), e = T({}), n = T(null), o = T("virtuoso-grid-item"), r = T("virtuoso-grid-list"), s = T(Qe), i = T("div"), l = T(Jt), c = (v, p = null) => ht(
3259
- x(
3279
+ const Mr = /* @__PURE__ */ Z(() => {
3280
+ const t = w((v) => `Item ${v}`), e = w({}), n = w(null), o = w("virtuoso-grid-item"), r = w("virtuoso-grid-list"), s = w(tn), i = w("div"), l = w(Jt), c = (v, m = null) => ht(
3281
+ S(
3260
3282
  e,
3261
- B((I) => I[v]),
3262
- nt()
3283
+ B((g) => g[v]),
3284
+ rt()
3263
3285
  ),
3264
- p
3265
- ), d = T(!1), m = T(!1);
3266
- return z(W(m), d), {
3286
+ m
3287
+ ), d = w(!1), f = w(!1);
3288
+ return L(P(f), d), {
3267
3289
  components: e,
3268
3290
  computeItemKey: s,
3269
3291
  context: n,
@@ -3276,63 +3298,63 @@ const Mr = /* @__PURE__ */ j(() => {
3276
3298
  listClassName: r,
3277
3299
  ListComponent: c("List", "div"),
3278
3300
  readyStateChanged: d,
3279
- reportReadyState: m,
3301
+ reportReadyState: f,
3280
3302
  ScrollerComponent: c("Scroller", "div"),
3281
3303
  scrollerRef: l,
3282
3304
  ScrollSeekPlaceholder: c("ScrollSeekPlaceholder", "div")
3283
3305
  };
3284
- }), _r = /* @__PURE__ */ j(
3306
+ }), _r = /* @__PURE__ */ Z(
3285
3307
  ([t, e]) => ({ ...t, ...e }),
3286
- rt(Ar, Mr)
3308
+ it(Ar, Mr)
3287
3309
  ), Nr = /* @__PURE__ */ E.memo(function() {
3288
- const e = et("gridState"), n = et("listClassName"), o = et("itemClassName"), r = et("itemContent"), s = et("computeItemKey"), i = et("isSeeking"), l = wt("scrollHeight"), c = et("ItemComponent"), d = et("ListComponent"), m = et("ScrollSeekPlaceholder"), v = et("context"), p = wt("itemDimensions"), I = wt("gap"), w = et("log"), R = et("stateRestoreInProgress"), h = wt("reportReadyState"), f = kt(
3310
+ const e = nt("gridState"), n = nt("listClassName"), o = nt("itemClassName"), r = nt("itemContent"), s = nt("computeItemKey"), i = nt("isSeeking"), l = yt("scrollHeight"), c = nt("ItemComponent"), d = nt("ListComponent"), f = nt("ScrollSeekPlaceholder"), v = nt("context"), m = yt("itemDimensions"), g = yt("gap"), y = nt("log"), R = nt("stateRestoreInProgress"), I = yt("reportReadyState"), h = Ot(
3289
3311
  E.useMemo(
3290
3312
  () => (a) => {
3291
- const S = a.parentElement.parentElement.scrollHeight;
3292
- l(S);
3293
- const H = a.firstChild;
3294
- if (H !== null) {
3295
- const { height: y, width: k } = H.getBoundingClientRect();
3296
- p({ height: y, width: k });
3313
+ const T = a.parentElement.parentElement.scrollHeight;
3314
+ l(T);
3315
+ const x = a.firstChild;
3316
+ if (x !== null) {
3317
+ const { height: C, width: k } = x.getBoundingClientRect();
3318
+ m({ height: C, width: k });
3297
3319
  }
3298
- I({
3299
- column: Fn("column-gap", getComputedStyle(a).columnGap, w),
3300
- row: Fn("row-gap", getComputedStyle(a).rowGap, w)
3320
+ g({
3321
+ column: Vn("column-gap", getComputedStyle(a).columnGap, y),
3322
+ row: Vn("row-gap", getComputedStyle(a).rowGap, y)
3301
3323
  });
3302
3324
  },
3303
- [l, p, I, w]
3325
+ [l, m, g, y]
3304
3326
  ),
3305
3327
  !0,
3306
3328
  !1
3307
3329
  );
3308
- return so(() => {
3309
- e.itemHeight > 0 && e.itemWidth > 0 && h(!0);
3330
+ return be(() => {
3331
+ e.itemHeight > 0 && e.itemWidth > 0 && I(!0);
3310
3332
  }, [e]), R ? null : /* @__PURE__ */ G(
3311
3333
  d,
3312
3334
  {
3313
3335
  className: n,
3314
- ref: f,
3315
- ...ot(d, v),
3336
+ ref: h,
3337
+ ...st(d, v),
3316
3338
  "data-testid": "virtuoso-item-list",
3317
3339
  style: { paddingBottom: e.offsetBottom, paddingTop: e.offsetTop },
3318
3340
  children: e.items.map((a) => {
3319
- const S = s(a.index, a.data, v);
3341
+ const T = s(a.index, a.data, v);
3320
3342
  return i ? /* @__PURE__ */ G(
3321
- m,
3343
+ f,
3322
3344
  {
3323
- ...ot(m, v),
3345
+ ...st(f, v),
3324
3346
  height: e.itemHeight,
3325
3347
  index: a.index,
3326
3348
  width: e.itemWidth
3327
3349
  },
3328
- S
3350
+ T
3329
3351
  ) : /* @__PURE__ */ Dt(
3330
3352
  c,
3331
3353
  {
3332
- ...ot(c, v),
3354
+ ...st(c, v),
3333
3355
  className: o,
3334
3356
  "data-index": a.index,
3335
- key: S
3357
+ key: T
3336
3358
  },
3337
3359
  r(a.index, a.data, v)
3338
3360
  );
@@ -3340,7 +3362,7 @@ const Mr = /* @__PURE__ */ j(() => {
3340
3362
  }
3341
3363
  );
3342
3364
  }), Dr = E.memo(function() {
3343
- const e = et("HeaderComponent"), n = wt("headerHeight"), o = et("headerFooterTag"), r = kt(
3365
+ const e = nt("HeaderComponent"), n = yt("headerHeight"), o = nt("headerFooterTag"), r = Ot(
3344
3366
  E.useMemo(
3345
3367
  () => (i) => {
3346
3368
  n(Ht(i, "height"));
@@ -3349,10 +3371,10 @@ const Mr = /* @__PURE__ */ j(() => {
3349
3371
  ),
3350
3372
  !0,
3351
3373
  !1
3352
- ), s = et("context");
3353
- return e != null ? /* @__PURE__ */ G(o, { ref: r, children: /* @__PURE__ */ G(e, { ...ot(e, s) }) }) : null;
3374
+ ), s = nt("context");
3375
+ return e != null ? /* @__PURE__ */ G(o, { ref: r, children: /* @__PURE__ */ G(e, { ...st(e, s) }) }) : null;
3354
3376
  }), $r = E.memo(function() {
3355
- const e = et("FooterComponent"), n = wt("footerHeight"), o = et("headerFooterTag"), r = kt(
3377
+ const e = nt("FooterComponent"), n = yt("footerHeight"), o = nt("headerFooterTag"), r = Ot(
3356
3378
  E.useMemo(
3357
3379
  () => (i) => {
3358
3380
  n(Ht(i, "height"));
@@ -3361,10 +3383,10 @@ const Mr = /* @__PURE__ */ j(() => {
3361
3383
  ),
3362
3384
  !0,
3363
3385
  !1
3364
- ), s = et("context");
3365
- return e != null ? /* @__PURE__ */ G(o, { ref: r, children: /* @__PURE__ */ G(e, { ...ot(e, s) }) }) : null;
3386
+ ), s = nt("context");
3387
+ return e != null ? /* @__PURE__ */ G(o, { ref: r, children: /* @__PURE__ */ G(e, { ...st(e, s) }) }) : null;
3366
3388
  }), Ur = ({ children: t }) => {
3367
- const e = E.useContext(ro), n = wt("itemDimensions"), o = wt("viewportDimensions"), r = kt(
3389
+ const e = E.useContext(so), n = yt("itemDimensions"), o = yt("viewportDimensions"), r = Ot(
3368
3390
  E.useMemo(
3369
3391
  () => (s) => {
3370
3392
  o(s.getBoundingClientRect());
@@ -3376,15 +3398,15 @@ const Mr = /* @__PURE__ */ j(() => {
3376
3398
  );
3377
3399
  return E.useEffect(() => {
3378
3400
  e && (o({ height: e.viewportHeight, width: e.viewportWidth }), n({ height: e.itemHeight, width: e.itemWidth }));
3379
- }, [e, o, n]), /* @__PURE__ */ G("div", { ref: r, style: He(!1), children: t });
3401
+ }, [e, o, n]), /* @__PURE__ */ G("div", { ref: r, style: Ee(!1), children: t });
3380
3402
  }, Kr = ({ children: t }) => {
3381
- const e = E.useContext(ro), n = wt("windowViewportRect"), o = wt("itemDimensions"), r = et("customScrollParent"), s = et("useWindowScroll"), i = $e(n, r, !1);
3403
+ const e = E.useContext(so), n = yt("windowViewportRect"), o = yt("itemDimensions"), r = nt("customScrollParent"), s = nt("useWindowScroll"), i = Ue(n, r, !1);
3382
3404
  return E.useEffect(() => {
3383
3405
  e && (o({ height: e.itemHeight, width: e.itemWidth }), n({ listHeight: 0, offsetTop: 0, visibleHeight: e.viewportHeight, visibleWidth: e.viewportWidth }));
3384
- }, [e, n, o]), /* @__PURE__ */ G("div", { ref: i, style: tn(!1, s), children: t });
3406
+ }, [e, n, o]), /* @__PURE__ */ G("div", { ref: i, style: en(!1, s), children: t });
3385
3407
  }, jr = /* @__PURE__ */ E.memo(function({ ...e }) {
3386
- const n = et("useWindowScroll"), o = et("customScrollParent"), r = o || n ? Zr : Yr, s = o || n ? Kr : Ur, i = et("context");
3387
- return /* @__PURE__ */ G(r, { ...e, ...ot(r, i), children: /* @__PURE__ */ $t(s, { children: [
3408
+ const n = nt("useWindowScroll"), o = nt("customScrollParent"), r = o || n ? Zr : Yr, s = o || n ? Kr : Ur, i = nt("context");
3409
+ return /* @__PURE__ */ G(r, { ...e, ...st(r, i), children: /* @__PURE__ */ $t(s, { children: [
3388
3410
  /* @__PURE__ */ G(Dr, {}),
3389
3411
  /* @__PURE__ */ G(Nr, {}),
3390
3412
  /* @__PURE__ */ G($r, {})
@@ -3392,9 +3414,9 @@ const Mr = /* @__PURE__ */ j(() => {
3392
3414
  }), {
3393
3415
  Component: qr,
3394
3416
  useEmitter: mo,
3395
- useEmitterValue: et,
3396
- usePublisher: wt
3397
- } = /* @__PURE__ */ Xe(
3417
+ useEmitterValue: nt,
3418
+ usePublisher: yt
3419
+ } = /* @__PURE__ */ Je(
3398
3420
  _r,
3399
3421
  {
3400
3422
  optional: {
@@ -3435,18 +3457,18 @@ const Mr = /* @__PURE__ */ j(() => {
3435
3457
  }
3436
3458
  },
3437
3459
  jr
3438
- ), Yr = /* @__PURE__ */ en({ useEmitter: mo, useEmitterValue: et, usePublisher: wt }), Zr = /* @__PURE__ */ nn({ useEmitter: mo, useEmitterValue: et, usePublisher: wt });
3439
- function Fn(t, e, n) {
3440
- return e !== "normal" && e?.endsWith("px") !== !0 && n(`${t} was not resolved to pixel value correctly`, e, ft.WARN), e === "normal" ? 0 : parseInt(e ?? "0", 10);
3460
+ ), Yr = /* @__PURE__ */ nn({ useEmitter: mo, useEmitterValue: nt, usePublisher: yt }), Zr = /* @__PURE__ */ on({ useEmitter: mo, useEmitterValue: nt, usePublisher: yt });
3461
+ function Vn(t, e, n) {
3462
+ return e !== "normal" && e?.endsWith("px") !== !0 && n(`${t} was not resolved to pixel value correctly`, e, mt.WARN), e === "normal" ? 0 : parseInt(e ?? "0", 10);
3441
3463
  }
3442
3464
  const ss = qr;
3443
3465
  export {
3444
3466
  rs as GroupedTableVirtuoso,
3445
3467
  ns as GroupedVirtuoso,
3446
- ft as LogLevel,
3468
+ mt as LogLevel,
3447
3469
  os as TableVirtuoso,
3448
3470
  es as Virtuoso,
3449
3471
  ss as VirtuosoGrid,
3450
- ro as VirtuosoGridMockContext,
3451
- Re as VirtuosoMockContext
3472
+ so as VirtuosoGridMockContext,
3473
+ He as VirtuosoMockContext
3452
3474
  };