react-virtuoso 4.18.19 → 4.18.21

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