react-virtuoso 4.12.5 → 4.12.6

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