react-window 2.5.0 → 2.5.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,8 +1,8 @@
1
1
  "use client";
2
- import { jsx as de } from "react/jsx-runtime";
3
- import { useLayoutEffect as Ne, useEffect as le, useState as j, useSyncExternalStore as Be, useMemo as C, useRef as U, useCallback as Y, memo as Te, useImperativeHandle as Le, createElement as ve, Fragment as be } from "react";
4
- const _ = typeof window < "u" ? Ne : le;
5
- function Me(e) {
2
+ import { jsx as ue } from "react/jsx-runtime";
3
+ import { useLayoutEffect as _e, useEffect as le, useState as C, useSyncExternalStore as Be, useMemo as q, useRef as P, useCallback as X, memo as Le, useImperativeHandle as Me, createElement as he, Fragment as be } from "react";
4
+ const B = typeof window < "u" ? _e : le;
5
+ function Ae(e) {
6
6
  let t = e;
7
7
  for (; t; ) {
8
8
  if (t.dir)
@@ -11,30 +11,30 @@ function Me(e) {
11
11
  }
12
12
  return !1;
13
13
  }
14
- function Ae(e, t) {
15
- const [r, o] = j(t === "rtl");
16
- return _(() => {
17
- t ? o(t === "rtl") : e && o(Me(e));
14
+ function Ee(e, t) {
15
+ const [r, o] = C(t === "rtl");
16
+ return B(() => {
17
+ t ? o(t === "rtl") : e && o(Ae(e));
18
18
  }, [t, e]), r;
19
19
  }
20
20
  function Pe() {
21
21
  return () => {
22
22
  };
23
23
  }
24
- function Ee() {
24
+ function We() {
25
25
  return Be(
26
26
  Pe,
27
27
  () => !1,
28
28
  () => !0
29
29
  );
30
30
  }
31
- function J(e) {
31
+ function Z(e) {
32
32
  return e?.ownerDocument.defaultView ?? window;
33
33
  }
34
- function pe(e) {
35
- return J(e).ResizeObserver ?? (typeof ResizeObserver < "u" ? ResizeObserver : void 0);
34
+ function we(e) {
35
+ return Z(e).ResizeObserver ?? (typeof ResizeObserver < "u" ? ResizeObserver : void 0);
36
36
  }
37
- function xe(e) {
37
+ function me(e) {
38
38
  if (e !== void 0)
39
39
  switch (typeof e) {
40
40
  case "number":
@@ -46,7 +46,7 @@ function xe(e) {
46
46
  }
47
47
  }
48
48
  }
49
- function _e({
49
+ function De({
50
50
  box: e,
51
51
  defaultHeight: t,
52
52
  defaultWidth: r,
@@ -55,58 +55,58 @@ function _e({
55
55
  mode: i,
56
56
  style: n
57
57
  }) {
58
- const { styleHeight: u, styleWidth: v } = C(
58
+ const { styleHeight: d, styleWidth: v } = q(
59
59
  () => ({
60
- styleHeight: xe(n?.height),
61
- styleWidth: xe(n?.width)
60
+ styleHeight: me(n?.height),
61
+ styleWidth: me(n?.width)
62
62
  }),
63
63
  [n?.height, n?.width]
64
- ), [h, f] = j({
64
+ ), [h, f] = C({
65
65
  height: t,
66
66
  width: r
67
- }), d = o || i === "only-height" && u !== void 0 || i === "only-width" && v !== void 0 || u !== void 0 && v !== void 0;
68
- return _(() => {
69
- if (s === null || d)
67
+ }), u = o || i === "only-height" && d !== void 0 || i === "only-width" && v !== void 0 || d !== void 0 && v !== void 0;
68
+ return B(() => {
69
+ if (s === null || u)
70
70
  return;
71
- const a = pe(s);
71
+ const a = we(s);
72
72
  if (!a)
73
73
  return;
74
- const l = new a((c) => {
75
- for (const g of c) {
76
- const { contentRect: w, target: b } = g;
77
- s === b && f((x) => x.height === w.height && x.width === w.width ? x : {
78
- height: w.height,
79
- width: w.width
74
+ const c = new a((l) => {
75
+ for (const p of l) {
76
+ const { contentRect: b, target: S } = p;
77
+ s === S && f((w) => w.height === b.height && w.width === b.width ? w : {
78
+ height: b.height,
79
+ width: b.width
80
80
  });
81
81
  }
82
82
  });
83
- return l.observe(s, { box: e }), () => {
84
- l?.unobserve(s);
83
+ return c.observe(s, { box: e }), () => {
84
+ c?.unobserve(s);
85
85
  };
86
- }, [e, d, s, u, v]), C(
86
+ }, [e, u, s, d, v]), q(
87
87
  () => ({
88
- height: u ?? h.height,
88
+ height: d ?? h.height,
89
89
  width: v ?? h.width
90
90
  }),
91
- [h, u, v]
91
+ [h, d, v]
92
92
  );
93
93
  }
94
94
  function ie(e) {
95
- const t = U(() => {
95
+ const t = P(() => {
96
96
  throw new Error("Cannot call an event handler while rendering.");
97
97
  });
98
- return _(() => {
98
+ return B(() => {
99
99
  t.current = e;
100
- }, [e]), Y((...r) => t.current?.(...r), [t]);
100
+ }, [e]), X((...r) => t.current?.(...r), [t]);
101
101
  }
102
- const me = /* @__PURE__ */ new WeakMap();
102
+ const xe = /* @__PURE__ */ new WeakMap();
103
103
  function Ue(e = !1, t = document) {
104
- let r = me.get(t);
104
+ let r = xe.get(t);
105
105
  if (r === void 0 || e) {
106
106
  const o = t.createElement("div"), s = o.style;
107
107
  s.width = "50px", s.height = "50px", s.overflow = "scroll", s.direction = "rtl";
108
108
  const i = t.createElement("div"), n = i.style;
109
- n.width = "100px", n.height = "100px", o.appendChild(i), t.body.appendChild(o), o.scrollLeft > 0 ? r = "positive-descending" : (o.scrollLeft = 1, o.scrollLeft === 0 ? r = "negative" : r = "positive-ascending"), t.body.removeChild(o), me.set(t, r);
109
+ n.width = "100px", n.height = "100px", o.appendChild(i), t.body.appendChild(o), o.scrollLeft > 0 ? r = "positive-descending" : (o.scrollLeft = 1, o.scrollLeft === 0 ? r = "negative" : r = "positive-ascending"), t.body.removeChild(o), xe.set(t, r);
110
110
  }
111
111
  return r;
112
112
  }
@@ -130,29 +130,29 @@ function ne({
130
130
  }
131
131
  return o;
132
132
  }
133
- function De({
133
+ function Ce({
134
134
  container: e,
135
135
  element: t,
136
136
  onChange: r
137
137
  }) {
138
- const o = J(t), s = pe(t), i = o.MutationObserver ?? (typeof MutationObserver < "u" ? MutationObserver : void 0), n = s ? new s(r) : void 0, u = (d) => !d.isConnected || (d.compareDocumentPosition(t) & Node.DOCUMENT_POSITION_FOLLOWING) !== 0, v = i ? new i((d) => {
139
- d.some(
140
- (l) => Array.from(l.addedNodes).some(u) || // Removed nodes preceded the element if the node after them still does (or contains the element)
141
- l.removedNodes.length > 0 && l.nextSibling !== null && u(l.nextSibling)
138
+ const o = Z(t), s = we(t), i = o.MutationObserver ?? (typeof MutationObserver < "u" ? MutationObserver : void 0), n = s ? new s(r) : void 0, d = (u) => !u.isConnected || (u.compareDocumentPosition(t) & Node.DOCUMENT_POSITION_FOLLOWING) !== 0, v = i ? new i((u) => {
139
+ u.some(
140
+ (c) => Array.from(c.addedNodes).some(d) || // Removed nodes preceded the element if the node after them still does (or contains the element)
141
+ c.removedNodes.length > 0 && c.nextSibling !== null && d(c.nextSibling)
142
142
  ) && (f(), r());
143
143
  }) : void 0, h = /* @__PURE__ */ new Set(), f = () => {
144
144
  for (const a of h)
145
145
  n?.unobserve(a);
146
146
  h.clear(), v?.disconnect();
147
- let d = t;
148
- for (; d !== e; ) {
149
- const a = d.parentElement;
147
+ let u = t;
148
+ for (; u !== e; ) {
149
+ const a = u.parentElement;
150
150
  if (a === null)
151
151
  break;
152
152
  if (n)
153
- for (let l = d.previousElementSibling; l !== null; l = l.previousElementSibling)
154
- h.add(l), n.observe(l);
155
- v?.observe(a, { childList: !0 }), d = a;
153
+ for (let c = u.previousElementSibling; c !== null; c = c.previousElementSibling)
154
+ h.add(c), n.observe(c);
155
+ v?.observe(a, { childList: !0 }), u = a;
156
156
  }
157
157
  };
158
158
  return f(), () => {
@@ -163,9 +163,9 @@ function ce(e) {
163
163
  return e.window === e;
164
164
  }
165
165
  function $e(e, t) {
166
- return t === "window" ? e ? J(e) : null : t ?? null;
166
+ return t === "window" ? e ? Z(e) : null : t ?? null;
167
167
  }
168
- function we(e, t) {
168
+ function de(e, t) {
169
169
  return ce(e) ? t === "vertical" ? e.scrollY : e.scrollX : t === "vertical" ? e.scrollTop : e.scrollLeft;
170
170
  }
171
171
  function je(e, t) {
@@ -176,10 +176,10 @@ function ae(e, t) {
176
176
  e && typeof e.scrollTo == "function" && e.scrollTo(t);
177
177
  }
178
178
  function qe(e, t) {
179
- const { overflowX: r, overflowY: o } = J(e).getComputedStyle(e), s = t === "vertical" ? o : r;
179
+ const { overflowX: r, overflowY: o } = Z(e).getComputedStyle(e), s = t === "vertical" ? o : r;
180
180
  return s === "visible" || s === "clip" ? !1 : t === "vertical" ? e.scrollHeight - e.clientHeight > 1 : e.scrollWidth - e.clientWidth > 1;
181
181
  }
182
- function Ie({
182
+ function Oe({
183
183
  containerElement: e,
184
184
  direction: t,
185
185
  isRtl: r,
@@ -188,32 +188,32 @@ function Ie({
188
188
  const s = t === "vertical";
189
189
  let i, n;
190
190
  if (ce(o)) {
191
- const { documentElement: x } = o.document;
192
- i = 0, n = s ? x.clientHeight : x.clientWidth;
191
+ const { documentElement: w } = o.document;
192
+ i = 0, n = s ? w.clientHeight : w.clientWidth;
193
193
  } else {
194
- const x = o.getBoundingClientRect();
195
- i = s ? x.top + o.clientTop : x.left + o.clientLeft, n = s ? o.clientHeight : o.clientWidth;
194
+ const w = o.getBoundingClientRect();
195
+ i = s ? w.top + o.clientTop : w.left + o.clientLeft, n = s ? o.clientHeight : o.clientWidth;
196
196
  }
197
- const u = i + n, v = e.getBoundingClientRect(), h = s ? v.top + e.clientTop : v.left + e.clientLeft, f = s ? e.clientHeight : e.clientWidth, d = h + f, a = ne({
197
+ const d = i + n, v = e.getBoundingClientRect(), h = s ? v.top + e.clientTop : v.left + e.clientLeft, f = s ? e.clientHeight : e.clientWidth, u = h + f, a = ne({
198
198
  containerElement: e,
199
199
  direction: t,
200
200
  isRtl: r,
201
201
  scrollOffset: s ? e.scrollTop : e.scrollLeft
202
- }), c = !s && r ? d - u : i - h, g = c + n, w = Math.max(0, c), b = Math.min(f, g);
202
+ }), l = !s && r ? u - d : i - h, p = l + n, b = Math.max(0, l), S = Math.min(f, p);
203
203
  return {
204
- offset: a + w,
205
- size: Math.max(0, b - w),
206
- viewportOffset: a + c,
204
+ offset: a + b,
205
+ size: Math.max(0, S - b),
206
+ viewportOffset: a + l,
207
207
  viewportSize: n
208
208
  };
209
209
  }
210
- function Oe({
210
+ function Ie({
211
211
  direction: e,
212
212
  isRtl: t,
213
213
  scrollTarget: r,
214
214
  viewportSize: o
215
215
  }) {
216
- const s = ce(r) ? r.document.documentElement : r, i = J(s).getComputedStyle(s), n = (h) => {
216
+ const s = ce(r) ? r.document.documentElement : r, i = Z(s).getComputedStyle(s), n = (h) => {
217
217
  const f = parseFloat(h ?? "");
218
218
  return !Number.isFinite(f) || f < 0 ? 0 : h.endsWith("px") ? f : h.endsWith("%") ? f * o / 100 : 0;
219
219
  };
@@ -222,24 +222,24 @@ function Oe({
222
222
  end: n(i.scrollPaddingBottom),
223
223
  start: n(i.scrollPaddingTop)
224
224
  };
225
- const u = n(i.scrollPaddingLeft), v = n(i.scrollPaddingRight);
226
- return t ? { end: u, start: v } : { end: v, start: u };
225
+ const d = n(i.scrollPaddingLeft), v = n(i.scrollPaddingRight);
226
+ return t ? { end: d, start: v } : { end: v, start: d };
227
227
  }
228
- function Z(e, t = "Assertion error") {
228
+ function Y(e, t = "Assertion error") {
229
229
  if (!e)
230
230
  throw console.error(t), Error(t);
231
231
  }
232
232
  function se(e, t) {
233
233
  if (e === t)
234
234
  return !0;
235
- if (!!e != !!t || (Z(e !== void 0), Z(t !== void 0), Object.keys(e).length !== Object.keys(t).length))
235
+ if (!!e != !!t || (Y(e !== void 0), Y(t !== void 0), Object.keys(e).length !== Object.keys(t).length))
236
236
  return !1;
237
237
  for (const r in e)
238
238
  if (!Object.hasOwn(t, r) || !Object.is(t[r], e[r]))
239
239
  return !1;
240
240
  return !0;
241
241
  }
242
- function We({
242
+ function Ve({
243
243
  cachedBounds: e,
244
244
  itemCount: t,
245
245
  itemSize: r
@@ -252,7 +252,7 @@ function We({
252
252
  const o = e.get(
253
253
  e.size === 0 ? 0 : e.size - 1
254
254
  );
255
- Z(o !== void 0, "Unexpected bounds cache miss");
255
+ Y(o !== void 0, "Unexpected bounds cache miss");
256
256
  const s = (o.scrollOffset + o.size) / e.size;
257
257
  return t * s;
258
258
  }
@@ -265,29 +265,29 @@ function Se({
265
265
  itemCount: s,
266
266
  itemSize: i,
267
267
  containerScrollOffset: n,
268
- containerSize: u
268
+ containerSize: d
269
269
  }) {
270
270
  if (o < 0 || o >= s)
271
271
  throw RangeError(`Invalid index specified: ${o}`, {
272
272
  cause: `Index ${o} is not within the range of 0 - ${s - 1}`
273
273
  });
274
- const v = t.get(o), h = We({
274
+ const v = t.get(o), h = Ve({
275
275
  cachedBounds: t,
276
276
  itemCount: s,
277
277
  itemSize: i
278
- }), f = (c) => r ? Math.max(0, Math.min(h - u, c)) : c, d = f(v.scrollOffset), a = r ? Math.max(0, v.scrollOffset - u + v.size) : v.scrollOffset - u + v.size, l = v.size > u ? n >= v.scrollOffset && n <= a : n >= a && n <= v.scrollOffset;
279
- switch (e === "smart" && (e = l ? "auto" : "center"), e) {
278
+ }), f = (l) => r ? Math.max(0, Math.min(h - d, l)) : l, u = f(v.scrollOffset), a = r ? Math.max(0, v.scrollOffset - d + v.size) : v.scrollOffset - d + v.size, c = v.size > d ? n >= v.scrollOffset && n <= a : n >= a && n <= v.scrollOffset;
279
+ switch (e === "smart" && (e = c ? "auto" : "center"), e) {
280
280
  case "start":
281
- return d;
281
+ return u;
282
282
  case "end":
283
283
  return a;
284
284
  case "center":
285
285
  return f(
286
- v.scrollOffset + v.size / 2 - u / 2
286
+ v.scrollOffset + v.size / 2 - d / 2
287
287
  );
288
288
  case "auto":
289
289
  default:
290
- return l ? n : n < a ? a : d;
290
+ return c ? n : n < a ? a : u;
291
291
  }
292
292
  }
293
293
  function fe({
@@ -305,45 +305,45 @@ function fe({
305
305
  startIndexOverscan: 0,
306
306
  stopIndexOverscan: -1
307
307
  };
308
- let n, u;
308
+ let n, d;
309
309
  const { itemSize: v } = e;
310
310
  if (v !== void 0)
311
311
  v > 0 ? (n = Math.max(
312
312
  0,
313
313
  Math.min(i, Math.floor(t / v))
314
- ), u = Math.max(
314
+ ), d = Math.max(
315
315
  n,
316
316
  Math.min(
317
317
  i,
318
318
  Math.ceil((t + r) / v) - 1
319
319
  )
320
- )) : (n = 0, u = 0);
320
+ )) : (n = 0, d = 0);
321
321
  else {
322
322
  let h = 0, f = Math.min(i, Math.max(0, e.size - 1));
323
323
  for (; h < f; ) {
324
- const d = Math.floor((h + f) / 2), a = e.get(d);
325
- a.scrollOffset + a.size > t ? f = d : h = d + 1;
324
+ const u = Math.floor((h + f) / 2), a = e.get(u);
325
+ a.scrollOffset + a.size > t ? f = u : h = u + 1;
326
326
  }
327
327
  for (; h < i; ) {
328
- const d = e.get(h);
329
- if (d.scrollOffset + d.size > t) break;
328
+ const u = e.get(h);
329
+ if (u.scrollOffset + u.size > t) break;
330
330
  h++;
331
331
  }
332
- for (n = h, u = h; u < i; ) {
333
- const d = e.get(u);
334
- if (d.scrollOffset + d.size >= t + r)
332
+ for (n = h, d = h; d < i; ) {
333
+ const u = e.get(d);
334
+ if (u.scrollOffset + u.size >= t + r)
335
335
  break;
336
- u++;
336
+ d++;
337
337
  }
338
338
  }
339
339
  return {
340
340
  startIndexVisible: n,
341
- stopIndexVisible: u,
341
+ stopIndexVisible: d,
342
342
  startIndexOverscan: Math.max(0, n - s),
343
- stopIndexOverscan: Math.min(i, u + s)
343
+ stopIndexOverscan: Math.min(i, d + s)
344
344
  };
345
345
  }
346
- function Ce({
346
+ function Ge({
347
347
  itemCount: e,
348
348
  itemProps: t,
349
349
  itemSize: r
@@ -352,28 +352,28 @@ function Ce({
352
352
  return {
353
353
  itemSize: typeof r == "number" ? r : void 0,
354
354
  get(s) {
355
- if (Z(s < e, `Invalid index ${s}`), typeof r == "number")
356
- return Z(s >= 0, `Invalid index ${s}`), { size: r, scrollOffset: s * r };
355
+ if (Y(s < e, `Invalid index ${s}`), typeof r == "number")
356
+ return Y(s >= 0, `Invalid index ${s}`), { size: r, scrollOffset: s * r };
357
357
  for (; o.size - 1 < s; ) {
358
- const n = o.size, u = r(n, t);
358
+ const n = o.size, d = r(n, t);
359
359
  if (n === 0)
360
360
  o.set(n, {
361
- size: u,
361
+ size: d,
362
362
  scrollOffset: 0
363
363
  });
364
364
  else {
365
365
  const v = o.get(n - 1);
366
- Z(
366
+ Y(
367
367
  v !== void 0,
368
368
  `Unexpected bounds cache miss for index ${s}`
369
369
  ), o.set(n, {
370
370
  scrollOffset: v.scrollOffset + v.size,
371
- size: u
371
+ size: d
372
372
  });
373
373
  }
374
374
  }
375
375
  const i = o.get(s);
376
- return Z(
376
+ return Y(
377
377
  i !== void 0,
378
378
  `Unexpected bounds cache miss for index ${s}`
379
379
  ), i;
@@ -386,13 +386,13 @@ function Ce({
386
386
  }
387
387
  };
388
388
  }
389
- function Ge({
389
+ function Xe({
390
390
  itemCount: e,
391
391
  itemProps: t,
392
392
  itemSize: r
393
393
  }) {
394
- return C(
395
- () => Ce({
394
+ return q(
395
+ () => Ge({
396
396
  itemCount: e,
397
397
  itemProps: t,
398
398
  itemSize: r
@@ -400,17 +400,17 @@ function Ge({
400
400
  [e, t, r]
401
401
  );
402
402
  }
403
- function Xe({
403
+ function Ye({
404
404
  containerSize: e,
405
405
  itemSize: t
406
406
  }) {
407
407
  let r;
408
408
  switch (typeof t) {
409
409
  case "string": {
410
- Z(
410
+ Y(
411
411
  t.endsWith("%"),
412
412
  `Invalid item size: "${t}"; string values must be percentages (e.g. "100%")`
413
- ), Z(
413
+ ), Y(
414
414
  e !== void 0,
415
415
  "Container size must be defined if a percentage item size is specified"
416
416
  ), r = e * parseFloat(t) / 100;
@@ -423,7 +423,7 @@ function Xe({
423
423
  }
424
424
  return typeof r == "number" && !(Number.isFinite(r) && r > 0) && (r = 0), r;
425
425
  }
426
- function he({
426
+ function pe({
427
427
  containerElement: e,
428
428
  containerStyle: t,
429
429
  defaultContainerSize: r = 0,
@@ -431,80 +431,80 @@ function he({
431
431
  direction: s,
432
432
  isRtl: i = !1,
433
433
  itemCount: n,
434
- itemProps: u,
434
+ itemProps: d,
435
435
  itemSize: v,
436
436
  onResize: h,
437
437
  overscanCount: f,
438
- scrollElement: d
438
+ scrollElement: u
439
439
  }) {
440
- const a = d !== void 0, l = a ? $e(e, d) : e, { height: c = r, width: g = r } = _e({
440
+ const a = u !== void 0, c = a ? $e(e, u) : e, { height: l = r, width: p = r } = De({
441
441
  defaultHeight: s === "vertical" ? r : void 0,
442
442
  defaultWidth: s === "horizontal" ? r : void 0,
443
443
  element: e,
444
444
  mode: s === "vertical" ? "only-height" : "only-width",
445
445
  style: t
446
- }), w = U({
446
+ }), b = P({
447
447
  height: 0,
448
448
  width: 0
449
- }), [b, x] = j(r), m = a ? b : s === "vertical" ? c : g, V = Xe({ containerSize: m, itemSize: v });
450
- _(() => {
449
+ }), [S, w] = C(r), m = a ? S : s === "vertical" ? l : p, T = Ye({ containerSize: m, itemSize: v });
450
+ B(() => {
451
451
  if (typeof h == "function") {
452
- const S = w.current;
453
- (S.height !== c || S.width !== g) && (h({ height: c, width: g }, { ...S }), S.height = c, S.width = g);
452
+ const z = b.current;
453
+ (z.height !== l || z.width !== p) && (h({ height: l, width: p }, { ...z }), z.height = l, z.width = p);
454
454
  }
455
- }, [c, h, g]);
456
- const z = Ge({
455
+ }, [l, h, p]);
456
+ const g = Xe({
457
457
  itemCount: n,
458
- itemProps: u,
459
- itemSize: V
460
- }), N = Ee(), [L] = j(
461
- () => N || a ? 0 : o
462
- ), B = Y(
463
- (S) => z.get(S),
464
- [z]
465
- ), [F, G] = j(
458
+ itemProps: d,
459
+ itemSize: T
460
+ }), J = We(), [k] = C(
461
+ () => J || a ? 0 : o
462
+ ), E = X(
463
+ (z) => g.get(z),
464
+ [g]
465
+ ), [L, $] = C(
466
466
  () => fe({
467
- cachedBounds: z,
468
- containerScrollOffset: L,
467
+ cachedBounds: g,
468
+ containerScrollOffset: k,
469
469
  containerSize: m,
470
470
  itemCount: n,
471
471
  overscanCount: f
472
472
  })
473
473
  ), {
474
- startIndexVisible: P,
474
+ startIndexVisible: _,
475
475
  startIndexOverscan: Q,
476
476
  stopIndexVisible: te,
477
477
  stopIndexOverscan: R
478
478
  } = {
479
- startIndexVisible: Math.min(n - 1, F.startIndexVisible),
480
- startIndexOverscan: Math.min(n - 1, F.startIndexOverscan),
481
- stopIndexVisible: Math.min(n - 1, F.stopIndexVisible),
482
- stopIndexOverscan: Math.min(n - 1, F.stopIndexOverscan)
483
- }, I = Y(
484
- () => We({
485
- cachedBounds: z,
479
+ startIndexVisible: Math.min(n - 1, L.startIndexVisible),
480
+ startIndexOverscan: Math.min(n - 1, L.startIndexOverscan),
481
+ stopIndexVisible: Math.min(n - 1, L.stopIndexVisible),
482
+ stopIndexOverscan: Math.min(n - 1, L.stopIndexOverscan)
483
+ }, O = X(
484
+ () => Ve({
485
+ cachedBounds: g,
486
486
  itemCount: n,
487
- itemSize: V
487
+ itemSize: T
488
488
  }),
489
- [z, n, V]
490
- ), H = Y(
491
- (S) => {
492
- const p = ne({
489
+ [g, n, T]
490
+ ), H = X(
491
+ (z) => {
492
+ const x = ne({
493
493
  containerElement: e,
494
494
  direction: s,
495
495
  isRtl: i,
496
- scrollOffset: S
496
+ scrollOffset: z
497
497
  });
498
498
  return fe({
499
- cachedBounds: z,
500
- containerScrollOffset: p,
499
+ cachedBounds: g,
500
+ containerScrollOffset: x,
501
501
  containerSize: m,
502
502
  itemCount: n,
503
503
  overscanCount: f
504
504
  });
505
505
  },
506
506
  [
507
- z,
507
+ g,
508
508
  e,
509
509
  m,
510
510
  s,
@@ -512,77 +512,77 @@ function he({
512
512
  n,
513
513
  f
514
514
  ]
515
- ), O = U(!1);
516
- _(() => {
517
- if (!e || n === 0 || a || O.current || (O.current = !0, o <= 0))
515
+ ), I = P(!1);
516
+ B(() => {
517
+ if (!e || n === 0 || a || I.current || (I.current = !0, o <= 0))
518
518
  return;
519
- const S = s === "horizontal" && Me(e);
519
+ const z = s === "horizontal" && Ae(e);
520
520
  if (ne({
521
521
  containerElement: e,
522
522
  direction: s,
523
- isRtl: S,
523
+ isRtl: z,
524
524
  scrollOffset: s === "vertical" ? e.scrollTop : e.scrollLeft
525
525
  }) !== 0)
526
526
  return;
527
- const M = ne({
527
+ const A = ne({
528
528
  containerElement: e,
529
529
  direction: s,
530
- isRtl: S,
530
+ isRtl: z,
531
531
  scrollOffset: o
532
532
  });
533
533
  typeof e.scrollTo == "function" ? e.scrollTo({
534
534
  behavior: "instant",
535
- [s === "vertical" ? "top" : "left"]: M
536
- }) : s === "vertical" ? e.scrollTop = M : e.scrollLeft = M;
537
- }, [e, n]), _(() => {
538
- if (a && e && l)
535
+ [s === "vertical" ? "top" : "left"]: A
536
+ }) : s === "vertical" ? e.scrollTop = A : e.scrollLeft = A;
537
+ }, [e, n]), B(() => {
538
+ if (a && e && c)
539
539
  return;
540
- const S = e && !a ? H(
540
+ const z = e && !a ? H(
541
541
  s === "vertical" ? e.scrollTop : e.scrollLeft
542
542
  ) : fe({
543
- cachedBounds: z,
544
- containerScrollOffset: L,
543
+ cachedBounds: g,
544
+ containerScrollOffset: k,
545
545
  containerSize: m,
546
546
  itemCount: n,
547
547
  overscanCount: f
548
548
  });
549
- G((p) => se(S, p) ? p : S);
549
+ $((x) => se(z, x) ? x : z);
550
550
  }, [
551
- z,
551
+ g,
552
552
  e,
553
553
  m,
554
554
  s,
555
555
  H,
556
- L,
556
+ k,
557
557
  a,
558
558
  n,
559
559
  f,
560
- l
561
- ]), _(() => {
560
+ c
561
+ ]), B(() => {
562
562
  if (!e || a)
563
563
  return;
564
- const S = () => {
565
- G((p) => {
566
- const { scrollLeft: M, scrollTop: k } = e, A = ne({
564
+ const z = () => {
565
+ $((x) => {
566
+ const { scrollLeft: A, scrollTop: N } = e, W = ne({
567
567
  containerElement: e,
568
568
  direction: s,
569
569
  isRtl: i,
570
- scrollOffset: s === "vertical" ? k : M
570
+ scrollOffset: s === "vertical" ? N : A
571
571
  }), D = fe({
572
- cachedBounds: z,
573
- containerScrollOffset: A,
572
+ cachedBounds: g,
573
+ containerScrollOffset: W,
574
574
  containerSize: m,
575
575
  itemCount: n,
576
576
  overscanCount: f
577
577
  });
578
- return se(D, p) ? p : D;
578
+ return se(D, x) ? x : D;
579
579
  });
580
580
  };
581
- return e.addEventListener("scroll", S), () => {
582
- e.removeEventListener("scroll", S);
581
+ return e.addEventListener("scroll", z), () => {
582
+ e.removeEventListener("scroll", z);
583
583
  };
584
584
  }, [
585
- z,
585
+ g,
586
586
  e,
587
587
  m,
588
588
  s,
@@ -592,154 +592,154 @@ function he({
592
592
  f
593
593
  ]);
594
594
  const K = ie(() => {
595
- if (!e || !l)
595
+ if (!e || !c)
596
596
  return;
597
- const { offset: S, size: p, viewportSize: M } = Ie({
597
+ const { offset: z, size: x, viewportSize: A } = Oe({
598
598
  containerElement: e,
599
599
  direction: s,
600
600
  isRtl: i,
601
- scrollTarget: l
601
+ scrollTarget: c
602
602
  });
603
- x(M);
604
- const k = fe({
605
- cachedBounds: z,
606
- containerScrollOffset: S,
607
- containerSize: p,
603
+ w(A);
604
+ const N = fe({
605
+ cachedBounds: g,
606
+ containerScrollOffset: z,
607
+ containerSize: x,
608
608
  itemCount: n,
609
609
  overscanCount: f
610
610
  });
611
- G((A) => se(k, A) ? A : k);
611
+ $((W) => se(N, W) ? W : N);
612
612
  });
613
- _(() => {
613
+ B(() => {
614
614
  a && K();
615
- }), _(() => {
616
- if (!a || !e || !l)
615
+ }), B(() => {
616
+ if (!a || !e || !c)
617
617
  return;
618
- const S = J(e), p = () => K();
619
- l.addEventListener("scroll", p, { passive: !0 }), e.addEventListener("scroll", p, { passive: !0 }), S.addEventListener("resize", p);
620
- let M;
621
- const k = pe(e);
622
- k && !ce(l) && (M = new k(p), M.observe(l));
623
- const A = De({
624
- container: ce(l) ? l.document.documentElement : l,
618
+ const z = Z(e), x = () => K();
619
+ c.addEventListener("scroll", x, { passive: !0 }), e.addEventListener("scroll", x, { passive: !0 }), z.addEventListener("resize", x);
620
+ let A;
621
+ const N = we(e);
622
+ N && !ce(c) && (A = new N(x), A.observe(c));
623
+ const W = Ce({
624
+ container: ce(c) ? c.document.documentElement : c,
625
625
  element: e,
626
- onChange: p
626
+ onChange: x
627
627
  });
628
628
  return () => {
629
- l.removeEventListener("scroll", p), e.removeEventListener("scroll", p), S.removeEventListener("resize", p), M?.disconnect(), A();
629
+ c.removeEventListener("scroll", x), e.removeEventListener("scroll", x), z.removeEventListener("resize", x), A?.disconnect(), W();
630
630
  };
631
631
  }, [
632
632
  e,
633
633
  a,
634
- l,
634
+ c,
635
635
  K
636
636
  ]);
637
637
  const re = ie(
638
638
  ({
639
- align: S = "auto",
640
- index: p
639
+ align: z = "auto",
640
+ index: x
641
641
  }) => {
642
- const M = ({
643
- clamp: E,
644
- containerScrollOffset: W,
645
- containerSize: T,
642
+ const A = ({
643
+ clamp: V,
644
+ containerScrollOffset: F,
645
+ containerSize: M,
646
646
  padding: y
647
647
  }) => {
648
648
  if (y.start === 0 && y.end === 0)
649
649
  return Se({
650
- align: S,
651
- cachedBounds: z,
652
- clamp: E,
653
- containerScrollOffset: W,
654
- containerSize: T,
655
- index: p,
650
+ align: z,
651
+ cachedBounds: g,
652
+ clamp: V,
653
+ containerScrollOffset: F,
654
+ containerSize: M,
655
+ index: x,
656
656
  itemCount: n,
657
- itemSize: V
657
+ itemSize: T
658
658
  });
659
- const $ = Se({
660
- align: S,
661
- cachedBounds: z,
659
+ const U = Se({
660
+ align: z,
661
+ cachedBounds: g,
662
662
  clamp: !1,
663
- containerScrollOffset: W + y.start,
663
+ containerScrollOffset: F + y.start,
664
664
  containerSize: Math.max(
665
665
  0,
666
- T - y.start - y.end
666
+ M - y.start - y.end
667
667
  ),
668
- index: p,
668
+ index: x,
669
669
  itemCount: n,
670
- itemSize: V
670
+ itemSize: T
671
671
  }) - y.start;
672
- return E ? Math.max(0, Math.min(I() - T, $)) : $;
672
+ return V ? Math.max(0, Math.min(O() - M, U)) : U;
673
673
  };
674
- if (a && e && l && !qe(e, s)) {
675
- const { viewportOffset: E, viewportSize: W } = Ie({
674
+ if (a && e && c && !qe(e, s)) {
675
+ const { viewportOffset: V, viewportSize: F } = Oe({
676
676
  containerElement: e,
677
677
  direction: s,
678
678
  isRtl: i,
679
- scrollTarget: l
680
- }), y = M({
679
+ scrollTarget: c
680
+ }), y = A({
681
681
  clamp: !1,
682
- containerScrollOffset: E,
683
- containerSize: W,
684
- padding: Oe({
682
+ containerScrollOffset: V,
683
+ containerSize: F,
684
+ padding: Ie({
685
685
  direction: s,
686
686
  isRtl: i,
687
- scrollTarget: l,
688
- viewportSize: W
687
+ scrollTarget: c,
688
+ viewportSize: F
689
689
  })
690
- }) - E, $ = s === "horizontal" && i ? -y : y;
690
+ }) - V, U = s === "horizontal" && i ? -y : y;
691
691
  return {
692
- scrollOffset: we(l, s) + $,
693
- scrollTarget: l
692
+ scrollOffset: de(c, s) + U,
693
+ scrollTarget: c
694
694
  };
695
695
  }
696
- const k = e ? s === "vertical" ? e.scrollTop : e.scrollLeft : 0, A = a && e ? s === "vertical" ? e.clientHeight : e.clientWidth : m;
697
- let D = M({
696
+ const N = e ? s === "vertical" ? e.scrollTop : e.scrollLeft : 0, W = a && e ? s === "vertical" ? e.clientHeight : e.clientWidth : m;
697
+ let D = A({
698
698
  clamp: !0,
699
699
  containerScrollOffset: ne({
700
700
  containerElement: e,
701
701
  direction: s,
702
702
  isRtl: i,
703
- scrollOffset: k
703
+ scrollOffset: N
704
704
  }),
705
- containerSize: A,
706
- padding: e ? Oe({
705
+ containerSize: W,
706
+ padding: e ? Ie({
707
707
  direction: s,
708
708
  isRtl: i,
709
709
  scrollTarget: e,
710
- viewportSize: A
710
+ viewportSize: W
711
711
  }) : { end: 0, start: 0 }
712
712
  });
713
- if (e && (!a || l)) {
713
+ if (e && (!a || c)) {
714
714
  if (D = ne({
715
715
  containerElement: e,
716
716
  direction: s,
717
717
  isRtl: i,
718
718
  scrollOffset: D
719
719
  }), !a && typeof e.scrollTo != "function") {
720
- const E = H(D);
721
- se(F, E) || G(E);
720
+ const V = H(D);
721
+ se(L, V) || $(V);
722
722
  }
723
723
  return { scrollOffset: D, scrollTarget: e };
724
724
  }
725
725
  }
726
726
  );
727
727
  return {
728
- getCellBounds: B,
729
- getEstimatedSize: I,
728
+ getCellBounds: E,
729
+ getEstimatedSize: O,
730
730
  getScrollPositionForIndex: re,
731
- scrollTarget: l,
731
+ scrollTarget: c,
732
732
  startIndexOverscan: Q,
733
- startIndexVisible: P,
733
+ startIndexVisible: _,
734
734
  stopIndexOverscan: R,
735
735
  stopIndexVisible: te
736
736
  };
737
737
  }
738
- function Ve(e) {
739
- const [t, r] = j(e);
738
+ function Fe(e) {
739
+ const [t, r] = C(e);
740
740
  return se(t, e) ? t : (r(e), e);
741
741
  }
742
- function Fe(e, t) {
742
+ function He(e, t) {
743
743
  const {
744
744
  ariaAttributes: r,
745
745
  style: o,
@@ -747,11 +747,11 @@ function Fe(e, t) {
747
747
  } = e, {
748
748
  ariaAttributes: i,
749
749
  style: n,
750
- ...u
750
+ ...d
751
751
  } = t;
752
- return se(r, i) && se(o, n) && se(s, u);
752
+ return se(r, i) && se(o, n) && se(s, d);
753
753
  }
754
- function et({
754
+ function rt({
755
755
  cellComponent: e,
756
756
  cellProps: t,
757
757
  children: r,
@@ -759,162 +759,162 @@ function et({
759
759
  columnCount: s,
760
760
  columnKey: i,
761
761
  columnWidth: n,
762
- defaultHeight: u = 0,
762
+ defaultHeight: d = 0,
763
763
  defaultScrollLeft: v = 0,
764
764
  defaultScrollTop: h = 0,
765
765
  defaultWidth: f = 0,
766
- dir: d,
766
+ dir: u,
767
767
  gridRef: a,
768
- onCellsRendered: l,
769
- onResize: c,
770
- overscanCount: g = 3,
771
- rowCount: w,
772
- rowHeight: b,
773
- rowKey: x,
768
+ onCellsRendered: c,
769
+ onResize: l,
770
+ overscanCount: p = 3,
771
+ rowCount: b,
772
+ rowHeight: S,
773
+ rowKey: w,
774
774
  scrollElement: m,
775
- style: V,
776
- tagName: z = "div",
777
- ...N
775
+ style: T,
776
+ tagName: g = "div",
777
+ ...J
778
778
  }) {
779
- const L = Ve(t), B = C(
780
- () => Te(e, Fe),
779
+ const k = Fe(t), E = q(
780
+ () => Le(e, He),
781
781
  [e]
782
- ), [F, G] = j(null), P = Ae(F, d), {
782
+ ), [L, $] = C(null), _ = Ee(L, u), {
783
783
  getCellBounds: Q,
784
784
  getEstimatedSize: te,
785
785
  startIndexOverscan: R,
786
- startIndexVisible: I,
786
+ startIndexVisible: O,
787
787
  getScrollPositionForIndex: H,
788
- stopIndexOverscan: O,
788
+ stopIndexOverscan: I,
789
789
  stopIndexVisible: K
790
- } = he({
791
- containerElement: F,
792
- containerStyle: V,
790
+ } = pe({
791
+ containerElement: L,
792
+ containerStyle: T,
793
793
  defaultContainerSize: f,
794
794
  defaultScrollOffset: v,
795
795
  direction: "horizontal",
796
- isRtl: P,
796
+ isRtl: _,
797
797
  itemCount: s,
798
- itemProps: L,
798
+ itemProps: k,
799
799
  itemSize: n,
800
- onResize: c,
801
- overscanCount: g,
800
+ onResize: l,
801
+ overscanCount: p,
802
802
  scrollElement: m
803
803
  }), {
804
804
  getCellBounds: re,
805
- getEstimatedSize: S,
806
- startIndexOverscan: p,
807
- startIndexVisible: M,
808
- getScrollPositionForIndex: k,
809
- stopIndexOverscan: A,
805
+ getEstimatedSize: z,
806
+ startIndexOverscan: x,
807
+ startIndexVisible: A,
808
+ getScrollPositionForIndex: N,
809
+ stopIndexOverscan: W,
810
810
  stopIndexVisible: D
811
- } = he({
812
- containerElement: F,
813
- containerStyle: V,
814
- defaultContainerSize: u,
811
+ } = pe({
812
+ containerElement: L,
813
+ containerStyle: T,
814
+ defaultContainerSize: d,
815
815
  defaultScrollOffset: h,
816
816
  direction: "vertical",
817
- itemCount: w,
818
- itemProps: L,
819
- itemSize: b,
820
- onResize: c,
821
- overscanCount: g,
817
+ itemCount: b,
818
+ itemProps: k,
819
+ itemSize: S,
820
+ onResize: l,
821
+ overscanCount: p,
822
822
  scrollElement: m
823
823
  });
824
- Le(
824
+ Me(
825
825
  a,
826
826
  () => ({
827
827
  get element() {
828
- return F;
828
+ return L;
829
829
  },
830
830
  scrollToCell({
831
- behavior: T = "auto",
831
+ behavior: M = "auto",
832
832
  columnAlign: y = "auto",
833
- columnIndex: $,
834
- rowAlign: q = "auto",
833
+ columnIndex: U,
834
+ rowAlign: j = "auto",
835
835
  rowIndex: ee
836
836
  }) {
837
- const X = H({
837
+ const G = H({
838
838
  align: y,
839
- index: $
840
- }), oe = k({
841
- align: q,
839
+ index: U
840
+ }), oe = N({
841
+ align: j,
842
842
  index: ee
843
843
  });
844
- X && oe && X.scrollTarget === oe.scrollTarget ? ae(oe.scrollTarget, {
845
- behavior: T,
846
- left: X.scrollOffset,
844
+ G && oe && G.scrollTarget === oe.scrollTarget ? ae(oe.scrollTarget, {
845
+ behavior: M,
846
+ left: G.scrollOffset,
847
847
  top: oe.scrollOffset
848
- }) : (X && ae(X.scrollTarget, {
849
- behavior: T,
850
- left: X.scrollOffset
848
+ }) : (G && ae(G.scrollTarget, {
849
+ behavior: M,
850
+ left: G.scrollOffset
851
851
  }), oe && ae(oe.scrollTarget, {
852
- behavior: T,
852
+ behavior: M,
853
853
  top: oe.scrollOffset
854
854
  }));
855
855
  },
856
856
  scrollToColumn({
857
- align: T = "auto",
857
+ align: M = "auto",
858
858
  behavior: y = "auto",
859
- index: $
859
+ index: U
860
860
  }) {
861
- const q = H({ align: T, index: $ });
862
- q && ae(q.scrollTarget, {
861
+ const j = H({ align: M, index: U });
862
+ j && ae(j.scrollTarget, {
863
863
  behavior: y,
864
- left: q.scrollOffset
864
+ left: j.scrollOffset
865
865
  });
866
866
  },
867
867
  scrollToRow({
868
- align: T = "auto",
868
+ align: M = "auto",
869
869
  behavior: y = "auto",
870
- index: $
870
+ index: U
871
871
  }) {
872
- const q = k({ align: T, index: $ });
873
- q && ae(q.scrollTarget, {
872
+ const j = N({ align: M, index: U });
873
+ j && ae(j.scrollTarget, {
874
874
  behavior: y,
875
- top: q.scrollOffset
875
+ top: j.scrollOffset
876
876
  });
877
877
  }
878
878
  }),
879
- [F, H, k]
879
+ [L, H, N]
880
880
  ), le(() => {
881
- R >= 0 && O >= 0 && p >= 0 && A >= 0 && l && l(
881
+ R >= 0 && I >= 0 && x >= 0 && W >= 0 && c && c(
882
882
  {
883
- columnStartIndex: I,
883
+ columnStartIndex: O,
884
884
  columnStopIndex: K,
885
- rowStartIndex: M,
885
+ rowStartIndex: A,
886
886
  rowStopIndex: D
887
887
  },
888
888
  {
889
889
  columnStartIndex: R,
890
- columnStopIndex: O,
891
- rowStartIndex: p,
892
- rowStopIndex: A
890
+ columnStopIndex: I,
891
+ rowStartIndex: x,
892
+ rowStopIndex: W
893
893
  }
894
894
  );
895
895
  }, [
896
- l,
896
+ c,
897
897
  R,
898
- I,
899
898
  O,
899
+ I,
900
900
  K,
901
- p,
902
- M,
901
+ x,
903
902
  A,
903
+ W,
904
904
  D
905
905
  ]);
906
- const E = C(() => {
907
- const T = [];
908
- if (s > 0 && w > 0)
909
- for (let y = p; y <= A; y++) {
910
- const $ = re(y), q = [];
911
- for (let ee = R; ee <= O; ee++) {
912
- const X = Q(ee);
913
- q.push(
914
- /* @__PURE__ */ ve(
915
- B,
906
+ const V = q(() => {
907
+ const M = [];
908
+ if (s > 0 && b > 0)
909
+ for (let y = x; y <= W; y++) {
910
+ const U = re(y), j = [];
911
+ for (let ee = R; ee <= I; ee++) {
912
+ const G = Q(ee);
913
+ j.push(
914
+ /* @__PURE__ */ he(
915
+ E,
916
916
  {
917
- ...L,
917
+ ...k,
918
918
  ariaAttributes: {
919
919
  "aria-colindex": ee + 1,
920
920
  role: "gridcell"
@@ -922,73 +922,73 @@ function et({
922
922
  columnIndex: ee,
923
923
  key: i ? i({
924
924
  columnIndex: ee,
925
- data: L,
925
+ data: k,
926
926
  rowIndex: y
927
927
  }) : ee,
928
928
  rowIndex: y,
929
929
  style: {
930
930
  position: "absolute",
931
- left: P ? void 0 : 0,
932
- right: P ? 0 : void 0,
933
- transform: `translate(${P ? -X.scrollOffset : X.scrollOffset}px, ${$.scrollOffset}px)`,
934
- height: $.size,
935
- width: X.size
931
+ left: _ ? void 0 : 0,
932
+ right: _ ? 0 : void 0,
933
+ transform: `translate(${_ ? -G.scrollOffset : G.scrollOffset}px, ${U.scrollOffset}px)`,
934
+ height: U.size,
935
+ width: G.size
936
936
  }
937
937
  }
938
938
  )
939
939
  );
940
940
  }
941
- T.push(
942
- /* @__PURE__ */ de(
941
+ M.push(
942
+ /* @__PURE__ */ ue(
943
943
  "div",
944
944
  {
945
945
  role: "row",
946
946
  "aria-rowindex": y + 1,
947
- children: q
947
+ children: j
948
948
  },
949
- x ? x({
950
- data: L,
949
+ w ? w({
950
+ data: k,
951
951
  rowIndex: y
952
952
  }) : y
953
953
  )
954
954
  );
955
955
  }
956
- return T;
956
+ return M;
957
957
  }, [
958
- B,
959
- L,
958
+ E,
959
+ k,
960
960
  s,
961
961
  i,
962
962
  R,
963
- O,
963
+ I,
964
964
  Q,
965
965
  re,
966
- P,
966
+ _,
967
+ b,
967
968
  w,
968
969
  x,
969
- p,
970
- A
971
- ]), W = /* @__PURE__ */ de(
970
+ W
971
+ ]), F = /* @__PURE__ */ ue(
972
972
  "div",
973
973
  {
974
974
  "aria-hidden": !0,
975
975
  style: {
976
- height: S(),
976
+ height: z(),
977
977
  width: te(),
978
978
  zIndex: -1
979
979
  }
980
980
  }
981
981
  );
982
- return ve(
983
- z,
982
+ return he(
983
+ g,
984
984
  {
985
985
  "aria-colcount": s,
986
- "aria-rowcount": w,
986
+ "aria-rowcount": b,
987
987
  role: "grid",
988
- ...N,
988
+ ...J,
989
989
  className: o,
990
- dir: d,
991
- ref: G,
990
+ dir: u,
991
+ ref: $,
992
992
  style: {
993
993
  position: "relative",
994
994
  // Grids that scroll with an outer element render at their full height,
@@ -999,20 +999,24 @@ function et({
999
999
  },
1000
1000
  flexGrow: 1,
1001
1001
  overflow: "auto",
1002
- ...V
1002
+ ...T
1003
1003
  }
1004
1004
  },
1005
- E,
1005
+ V,
1006
1006
  r,
1007
- W
1007
+ F
1008
1008
  );
1009
1009
  }
1010
- const tt = j, st = U, He = "data-react-window-index", Ye = "data-index";
1010
+ const ot = C, nt = P, ke = "data-react-window-index", Ze = "data-index";
1011
1011
  function ge(e) {
1012
- const t = e.getAttribute(He) ?? e.getAttribute(Ye);
1012
+ const t = e.getAttribute(ke) ?? e.getAttribute(Ze);
1013
1013
  return t !== null && /^\d+$/.test(t) ? Number(t) : void 0;
1014
1014
  }
1015
- function ke({
1015
+ const Je = 1e3, ze = 500;
1016
+ function Qe(e) {
1017
+ return 1 - Math.pow(1 - e, 3);
1018
+ }
1019
+ function Ne({
1016
1020
  direction: e,
1017
1021
  element: t,
1018
1022
  getCellBounds: r,
@@ -1020,65 +1024,81 @@ function ke({
1020
1024
  itemCount: s,
1021
1025
  itemElements: i,
1022
1026
  scrollTarget: n,
1023
- getScrollPositionForIndex: u
1027
+ getScrollPositionForIndex: d
1024
1028
  }) {
1025
- const v = e === "vertical", h = U(null), f = U(
1029
+ const v = e === "vertical", h = P(null), f = P(
1026
1030
  void 0
1027
- ), d = ie(() => {
1031
+ ), u = ie(() => {
1028
1032
  h.current = null, f.current !== void 0 && (f.current.view.cancelAnimationFrame(f.current.id), f.current = void 0);
1029
1033
  }), a = ie(() => {
1030
- const c = J(t);
1034
+ const l = Z(t);
1031
1035
  f.current = {
1032
- id: c.requestAnimationFrame(l),
1033
- view: c
1036
+ id: l.requestAnimationFrame(c),
1037
+ view: l
1034
1038
  };
1035
- }), l = ie(() => {
1039
+ }), c = ie(() => {
1036
1040
  f.current = void 0;
1037
- const c = h.current;
1038
- if (!c) return;
1039
- if (!t || !o || c.index >= s || performance.now() >= c.deadline) {
1040
- d();
1041
+ const l = h.current;
1042
+ if (!l) return;
1043
+ const p = performance.now();
1044
+ if (!t || !o || l.index >= s || l.animation !== void 0 && p >= l.animation.deadline) {
1045
+ u();
1041
1046
  return;
1042
1047
  }
1043
- const g = u({
1044
- align: c.align,
1045
- index: c.index
1048
+ const b = d({
1049
+ align: l.align,
1050
+ index: l.index
1046
1051
  });
1047
- if (g !== void 0) {
1048
- const { scrollOffset: w, scrollTarget: b } = g, x = Math.max(
1052
+ if (b !== void 0) {
1053
+ const { scrollOffset: S, scrollTarget: w } = b, m = Math.max(
1049
1054
  0,
1050
- Math.min(w, je(b, e))
1055
+ Math.min(S, je(w, e))
1051
1056
  );
1052
- if (Math.abs(x - we(b, e)) > 1)
1053
- c.stableFrames = 0, b.scrollTo({
1057
+ if (l.animation === void 0) {
1058
+ const g = l.smooth ? ze : 0;
1059
+ l.animation = {
1060
+ deadline: p + g + Je,
1061
+ startOffset: de(w, e),
1062
+ startTime: p
1063
+ };
1064
+ }
1065
+ const T = l.smooth ? (p - l.animation.startTime) / ze : 1;
1066
+ if (T < 1) {
1067
+ const { startOffset: g } = l.animation;
1068
+ l.stableFrames = 0, w.scrollTo({
1054
1069
  behavior: "instant",
1055
- [v ? "top" : "left"]: x
1070
+ [v ? "top" : "left"]: g + (m - g) * Qe(T)
1071
+ });
1072
+ } else if (Math.abs(m - de(w, e)) > 1)
1073
+ l.stableFrames = 0, w.scrollTo({
1074
+ behavior: "instant",
1075
+ [v ? "top" : "left"]: m
1056
1076
  });
1057
1077
  else {
1058
- const m = i.current;
1059
- if (!(m.some(
1060
- (N) => ge(N) === c.index
1061
- ) && m.every((N) => {
1062
- const L = ge(N);
1078
+ const g = i.current;
1079
+ if (!(g.some(
1080
+ (E) => ge(E) === l.index
1081
+ ) && g.every((E) => {
1082
+ const L = ge(E);
1063
1083
  if (L === void 0 || L >= s)
1064
1084
  return !0;
1065
- const B = v ? N.offsetHeight : N.offsetWidth;
1066
- return Math.abs(r(L).size - B) <= 1;
1085
+ const $ = v ? E.offsetHeight : E.offsetWidth;
1086
+ return Math.abs(r(L).size - $) <= 1;
1067
1087
  })))
1068
- c.stableFrames = 0;
1069
- else if (++c.stableFrames >= 2) {
1070
- d();
1088
+ l.stableFrames = 0;
1089
+ else if (++l.stableFrames >= 2) {
1090
+ u();
1071
1091
  return;
1072
1092
  }
1073
1093
  }
1074
1094
  }
1075
1095
  a();
1076
1096
  });
1077
- return _(() => {
1078
- const c = n ?? t;
1079
- if (!c) return;
1080
- const g = (w) => {
1081
- switch (w.key) {
1097
+ return B(() => {
1098
+ const l = n ?? t;
1099
+ if (!l) return;
1100
+ const p = (b) => {
1101
+ switch (b.key) {
1082
1102
  case "ArrowUp":
1083
1103
  case "ArrowDown":
1084
1104
  case "ArrowLeft":
@@ -1088,47 +1108,53 @@ function ke({
1088
1108
  case "Home":
1089
1109
  case "End":
1090
1110
  case " ":
1091
- d();
1111
+ u();
1092
1112
  }
1093
1113
  };
1094
- return c.addEventListener("wheel", d, { passive: !0 }), c.addEventListener("touchstart", d, { passive: !0 }), c.addEventListener("pointerdown", d), c.addEventListener("keydown", g), () => {
1095
- d(), c.removeEventListener("wheel", d), c.removeEventListener("touchstart", d), c.removeEventListener("pointerdown", d), c.removeEventListener("keydown", g);
1114
+ return l.addEventListener("wheel", u, { passive: !0 }), l.addEventListener("touchstart", u, { passive: !0 }), l.addEventListener("pointerdown", u), l.addEventListener("keydown", p), () => {
1115
+ u(), l.removeEventListener("wheel", u), l.removeEventListener("touchstart", u), l.removeEventListener("pointerdown", u), l.removeEventListener("keydown", p);
1096
1116
  };
1097
- }, [d, t, n]), Y(
1117
+ }, [u, t, n]), X(
1098
1118
  ({
1099
- align: c = "auto",
1100
- behavior: g = "auto",
1101
- index: w
1119
+ align: l = "auto",
1120
+ behavior: p = "auto",
1121
+ index: b
1102
1122
  }) => {
1103
- if (o && c === "smart") {
1104
- const x = u({ align: "auto", index: w });
1105
- c = x === void 0 || x.scrollOffset === we(x.scrollTarget, e) ? "auto" : "center";
1123
+ if (o && l === "smart") {
1124
+ const w = d({ align: "auto", index: b });
1125
+ l = w === void 0 || w.scrollOffset === de(w.scrollTarget, e) ? "auto" : "center";
1106
1126
  }
1107
- const b = u({ align: c, index: w });
1108
- if (d(), b && typeof b.scrollTarget.scrollTo == "function") {
1109
- const { scrollOffset: x, scrollTarget: m } = b;
1110
- o && (h.current = {
1111
- align: c,
1112
- index: w,
1113
- deadline: performance.now() + 1e3,
1114
- stableFrames: 0
1115
- }, a()), m.scrollTo({
1116
- behavior: o ? "instant" : g,
1117
- [v ? "top" : "left"]: x
1127
+ const S = d({ align: l, index: b });
1128
+ if (u(), S && typeof S.scrollTarget.scrollTo == "function") {
1129
+ const { scrollOffset: w, scrollTarget: m } = S;
1130
+ if (o) {
1131
+ const T = p === "smooth" && t?.ownerDocument.visibilityState !== "hidden";
1132
+ if (h.current = {
1133
+ align: l,
1134
+ index: b,
1135
+ smooth: T,
1136
+ stableFrames: 0
1137
+ }, a(), T)
1138
+ return;
1139
+ }
1140
+ m.scrollTo({
1141
+ behavior: o ? "instant" : p,
1142
+ [v ? "top" : "left"]: w
1118
1143
  });
1119
1144
  }
1120
1145
  },
1121
1146
  [
1122
- d,
1147
+ u,
1123
1148
  e,
1149
+ t,
1124
1150
  o,
1125
1151
  v,
1126
1152
  a,
1127
- u
1153
+ d
1128
1154
  ]
1129
1155
  );
1130
1156
  }
1131
- function Ze({
1157
+ function Ke({
1132
1158
  callback: e,
1133
1159
  element: t,
1134
1160
  enabled: r = !0
@@ -1137,7 +1163,7 @@ function Ze({
1137
1163
  le(() => {
1138
1164
  if (!r || !t)
1139
1165
  return;
1140
- const s = J(t);
1166
+ const s = Z(t);
1141
1167
  let i = s.requestAnimationFrame(() => {
1142
1168
  i = s.requestAnimationFrame(o);
1143
1169
  });
@@ -1146,11 +1172,11 @@ function Ze({
1146
1172
  };
1147
1173
  }, [t, r, o]);
1148
1174
  }
1149
- function ue(e) {
1175
+ function ve(e) {
1150
1176
  return e != null && typeof e == "object" && "getAverageRowHeight" in e && typeof e.getAverageRowHeight == "function";
1151
1177
  }
1152
- const ze = "data-react-window-sizer";
1153
- function rt({
1178
+ const ye = "data-react-window-sizer";
1179
+ function it({
1154
1180
  children: e,
1155
1181
  className: t,
1156
1182
  defaultHeight: r = 0,
@@ -1158,283 +1184,283 @@ function rt({
1158
1184
  listRef: s,
1159
1185
  onResize: i,
1160
1186
  onRowsRendered: n,
1161
- overscanCount: u = 3,
1187
+ overscanCount: d = 3,
1162
1188
  rowComponent: v,
1163
1189
  rowCount: h,
1164
1190
  rowHeight: f,
1165
- rowKey: d,
1191
+ rowKey: u,
1166
1192
  rowProps: a,
1167
- scrollElement: l,
1168
- tagName: c = "div",
1169
- style: g,
1170
- ...w
1193
+ scrollElement: c,
1194
+ tagName: l = "div",
1195
+ style: p,
1196
+ ...b
1171
1197
  }) {
1172
- const b = Ve(a), x = C(
1173
- () => Te(v, Fe),
1198
+ const S = Fe(a), w = q(
1199
+ () => Le(v, He),
1174
1200
  [v]
1175
- ), [m, V] = j(null), z = ue(f), N = C(() => z ? (E) => f.getRowHeight(E) ?? f.getAverageRowHeight() : f, [z, f]), L = Ee(), [B, F] = j(
1176
- () => L && z
1177
- ), G = U(f);
1178
- _(() => {
1179
- B && G.current !== f && F(!1);
1180
- }, [B, f]), Ze({
1181
- callback: () => F(!1),
1201
+ ), [m, T] = C(null), g = ve(f), J = q(() => g ? (V) => f.getRowHeight(V) ?? f.getAverageRowHeight() : f, [g, f]), k = We(), [E, L] = C(
1202
+ () => k && g
1203
+ ), $ = P(f);
1204
+ B(() => {
1205
+ E && $.current !== f && L(!1);
1206
+ }, [E, f]), Ke({
1207
+ callback: () => L(!1),
1182
1208
  element: m,
1183
- enabled: B
1209
+ enabled: E
1184
1210
  });
1185
1211
  const {
1186
- getCellBounds: P,
1212
+ getCellBounds: _,
1187
1213
  getEstimatedSize: Q,
1188
1214
  scrollTarget: te,
1189
1215
  getScrollPositionForIndex: R,
1190
- startIndexOverscan: I,
1216
+ startIndexOverscan: O,
1191
1217
  startIndexVisible: H,
1192
- stopIndexOverscan: O,
1218
+ stopIndexOverscan: I,
1193
1219
  stopIndexVisible: K
1194
- } = he({
1220
+ } = pe({
1195
1221
  containerElement: m,
1196
- containerStyle: g,
1222
+ containerStyle: p,
1197
1223
  defaultContainerSize: r,
1198
1224
  defaultScrollOffset: o,
1199
1225
  direction: "vertical",
1200
1226
  itemCount: h,
1201
- itemProps: b,
1202
- itemSize: N,
1227
+ itemProps: S,
1228
+ itemSize: J,
1203
1229
  onResize: i,
1204
- overscanCount: u,
1205
- scrollElement: l
1206
- }), re = U([]), S = ke({
1230
+ overscanCount: d,
1231
+ scrollElement: c
1232
+ }), re = P([]), z = Ne({
1207
1233
  direction: "vertical",
1208
1234
  element: m,
1209
- getCellBounds: P,
1210
- isDynamicSize: z,
1235
+ getCellBounds: _,
1236
+ isDynamicSize: g,
1211
1237
  itemCount: h,
1212
1238
  itemElements: re,
1213
1239
  scrollTarget: te,
1214
1240
  getScrollPositionForIndex: R
1215
1241
  });
1216
- Le(
1242
+ Me(
1217
1243
  s,
1218
1244
  () => ({
1219
1245
  get element() {
1220
1246
  return m;
1221
1247
  },
1222
- scrollToRow: S
1248
+ scrollToRow: z
1223
1249
  }),
1224
- [m, S]
1225
- ), _(() => {
1250
+ [m, z]
1251
+ ), B(() => {
1226
1252
  if (!m)
1227
1253
  return;
1228
- const E = Array.from(m.children).slice(
1254
+ const V = Array.from(m.children).slice(
1229
1255
  0,
1230
- I < 0 ? 0 : O - I + 1
1231
- ).filter((W, T) => {
1232
- if (W.hasAttribute(ze))
1256
+ O < 0 ? 0 : I - O + 1
1257
+ ).filter((F, M) => {
1258
+ if (F.hasAttribute(ye))
1233
1259
  return !1;
1234
- const y = `${I + T}`;
1235
- return W.setAttribute(He, y), !0;
1260
+ const y = `${O + M}`;
1261
+ return F.setAttribute(ke, y), !0;
1236
1262
  });
1237
- if (re.current = E, z)
1238
- return f.observeRowElements(E);
1263
+ if (re.current = V, g)
1264
+ return f.observeRowElements(V);
1239
1265
  }, [
1240
- x,
1266
+ w,
1241
1267
  m,
1242
- z,
1268
+ g,
1243
1269
  h,
1244
1270
  f,
1245
- d,
1246
- b,
1247
- I,
1248
- O
1271
+ u,
1272
+ S,
1273
+ O,
1274
+ I
1249
1275
  ]), le(() => {
1250
- I >= 0 && O >= 0 && n && n(
1276
+ O >= 0 && I >= 0 && n && n(
1251
1277
  {
1252
1278
  startIndex: H,
1253
1279
  stopIndex: K
1254
1280
  },
1255
1281
  {
1256
- startIndex: I,
1257
- stopIndex: O
1282
+ startIndex: O,
1283
+ stopIndex: I
1258
1284
  }
1259
1285
  );
1260
1286
  }, [
1261
1287
  n,
1262
- I,
1263
- H,
1264
1288
  O,
1289
+ H,
1290
+ I,
1265
1291
  K
1266
1292
  ]);
1267
- const p = B && z && I === 0, M = C(() => {
1268
- const E = [];
1293
+ const x = E && g && O === 0, A = q(() => {
1294
+ const V = [];
1269
1295
  if (h > 0)
1270
- for (let W = I; W <= O; W++) {
1271
- const T = P(W);
1272
- E.push(
1273
- /* @__PURE__ */ ve(
1274
- x,
1296
+ for (let F = O; F <= I; F++) {
1297
+ const M = _(F);
1298
+ V.push(
1299
+ /* @__PURE__ */ he(
1300
+ w,
1275
1301
  {
1276
- ...b,
1302
+ ...S,
1277
1303
  ariaAttributes: {
1278
- "aria-posinset": W + 1,
1304
+ "aria-posinset": F + 1,
1279
1305
  "aria-setsize": h,
1280
1306
  role: "listitem"
1281
1307
  },
1282
- key: d ? d(W, b) : W,
1283
- index: W,
1284
- style: p ? { width: "100%" } : {
1308
+ key: u ? u(F, S) : F,
1309
+ index: F,
1310
+ style: x ? { width: "100%" } : {
1285
1311
  position: "absolute",
1286
1312
  left: 0,
1287
- transform: `translateY(${T.scrollOffset}px)`,
1313
+ transform: `translateY(${M.scrollOffset}px)`,
1288
1314
  // In case of dynamic row heights, don't specify a height style
1289
1315
  // otherwise a default/estimated height would mask the actual height
1290
- height: z ? void 0 : T.size,
1316
+ height: g ? void 0 : M.size,
1291
1317
  width: "100%"
1292
1318
  }
1293
1319
  }
1294
1320
  )
1295
1321
  );
1296
1322
  }
1297
- return E;
1323
+ return V;
1298
1324
  }, [
1325
+ w,
1326
+ _,
1327
+ g,
1299
1328
  x,
1300
- P,
1301
- z,
1302
- p,
1303
1329
  h,
1304
- d,
1305
- b,
1306
- I,
1307
- O
1308
- ]), k = /* @__PURE__ */ de(
1330
+ u,
1331
+ S,
1332
+ O,
1333
+ I
1334
+ ]), N = /* @__PURE__ */ ue(
1309
1335
  "div",
1310
1336
  {
1311
1337
  "aria-hidden": !0,
1312
- [ze]: "",
1338
+ [ye]: "",
1313
1339
  style: {
1314
1340
  // Rows rendered in flow layout already take up space
1315
- position: p ? "absolute" : void 0,
1316
- top: p ? 0 : void 0,
1341
+ position: x ? "absolute" : void 0,
1342
+ top: x ? 0 : void 0,
1317
1343
  height: Q(),
1318
1344
  width: "100%",
1319
1345
  zIndex: -1
1320
1346
  }
1321
1347
  },
1322
1348
  "sizer"
1323
- ), A = /* @__PURE__ */ de(be, { children: e }, "children"), D = /* @__PURE__ */ de(be, { children: M }, "rows");
1324
- return ve(
1325
- c,
1349
+ ), W = /* @__PURE__ */ ue(be, { children: e }, "children"), D = /* @__PURE__ */ ue(be, { children: A }, "rows");
1350
+ return he(
1351
+ l,
1326
1352
  {
1327
1353
  role: "list",
1328
- ...w,
1354
+ ...b,
1329
1355
  className: t,
1330
- ref: V,
1356
+ ref: T,
1331
1357
  style: {
1332
1358
  position: "relative",
1333
1359
  flexGrow: 1,
1334
1360
  // Lists that scroll with an outer element render at their full height (and must not clip sticky rows)
1335
- ...l === void 0 && {
1361
+ ...c === void 0 && {
1336
1362
  maxHeight: "100%",
1337
1363
  overflowY: "auto"
1338
1364
  },
1339
- ...g
1365
+ ...p
1340
1366
  }
1341
1367
  },
1342
- ...p ? [A, D] : [D, A],
1343
- k
1368
+ ...x ? [W, D] : [D, W],
1369
+ N
1344
1370
  );
1345
1371
  }
1346
- function ye(e) {
1372
+ function Re(e) {
1347
1373
  const t = /* @__PURE__ */ new Map();
1348
1374
  return e !== void 0 && e.forEach((r, o) => {
1349
1375
  Number.isFinite(r) && r > 0 && t.set(o, r);
1350
1376
  }), t;
1351
1377
  }
1352
- function ot({
1378
+ function lt({
1353
1379
  defaultRowHeight: e,
1354
1380
  initialRowHeights: t,
1355
1381
  key: r
1356
1382
  }) {
1357
- const [o, s] = j(() => ({
1383
+ const [o, s] = C(() => ({
1358
1384
  key: r,
1359
- map: ye(t)
1385
+ map: Re(t)
1360
1386
  }));
1361
1387
  o.key !== r && s({
1362
1388
  key: r,
1363
- map: ye(t)
1389
+ map: Re(t)
1364
1390
  });
1365
- const { map: i } = o, n = Y(() => {
1391
+ const { map: i } = o, n = X(() => {
1366
1392
  let a = 0;
1367
- return i.forEach((l) => {
1368
- a += l;
1393
+ return i.forEach((c) => {
1394
+ a += c;
1369
1395
  }), a === 0 ? e : a / i.size;
1370
- }, [e, i]), u = Y(
1396
+ }, [e, i]), d = X(
1371
1397
  (a) => {
1372
- const l = i.get(a);
1373
- return l !== void 0 ? l : e;
1398
+ const c = i.get(a);
1399
+ return c !== void 0 ? c : e;
1374
1400
  },
1375
1401
  [e, i]
1376
- ), v = Y((a, l) => {
1377
- s((c) => {
1378
- if (c.map.get(a) === l)
1379
- return c;
1380
- const g = new Map(c.map);
1381
- return g.set(a, l), {
1382
- ...c,
1383
- map: g
1402
+ ), v = X((a, c) => {
1403
+ s((l) => {
1404
+ if (l.map.get(a) === c)
1405
+ return l;
1406
+ const p = new Map(l.map);
1407
+ return p.set(a, c), {
1408
+ ...l,
1409
+ map: p
1384
1410
  };
1385
1411
  });
1386
1412
  }, []), h = ie(
1387
1413
  (a) => {
1388
- a.length !== 0 && a.forEach((l) => {
1389
- const { borderBoxSize: c, target: g } = l, w = ge(g);
1390
- if (w === void 0)
1414
+ a.length !== 0 && a.forEach((c) => {
1415
+ const { borderBoxSize: l, target: p } = c, b = ge(p);
1416
+ if (b === void 0)
1391
1417
  return;
1392
- const { blockSize: b } = c[0];
1393
- b && v(w, b);
1418
+ const { blockSize: S } = l[0];
1419
+ S && v(b, S);
1394
1420
  });
1395
1421
  }
1396
- ), f = U(null);
1422
+ ), f = P(null);
1397
1423
  le(
1398
1424
  () => () => {
1399
1425
  f.current?.resizeObserver.disconnect(), f.current = null;
1400
1426
  },
1401
1427
  []
1402
1428
  );
1403
- const d = Y(
1429
+ const u = X(
1404
1430
  (a) => {
1405
- const l = [];
1406
- return a.forEach((c) => {
1407
- const g = J(c);
1408
- if (f.current?.view !== g) {
1431
+ const c = [];
1432
+ return a.forEach((l) => {
1433
+ const p = Z(l);
1434
+ if (f.current?.view !== p) {
1409
1435
  f.current?.resizeObserver.disconnect();
1410
- const b = pe(c);
1411
- f.current = b ? {
1412
- resizeObserver: new b(h),
1413
- view: g
1436
+ const S = we(l);
1437
+ f.current = S ? {
1438
+ resizeObserver: new S(h),
1439
+ view: p
1414
1440
  } : null;
1415
1441
  }
1416
- const w = f.current?.resizeObserver;
1417
- w && (w.observe(c), l.push([c, w]));
1442
+ const b = f.current?.resizeObserver;
1443
+ b && (b.observe(l), c.push([l, b]));
1418
1444
  }), () => {
1419
- l.forEach(
1420
- ([c, g]) => g.unobserve(c)
1445
+ c.forEach(
1446
+ ([l, p]) => p.unobserve(l)
1421
1447
  );
1422
1448
  };
1423
1449
  },
1424
1450
  [h]
1425
1451
  );
1426
- return C(
1452
+ return q(
1427
1453
  () => ({
1428
1454
  getAverageRowHeight: n,
1429
- getRowHeight: u,
1455
+ getRowHeight: d,
1430
1456
  setRowHeight: v,
1431
- observeRowElements: d
1457
+ observeRowElements: u
1432
1458
  }),
1433
- [n, u, v, d]
1459
+ [n, d, v, u]
1434
1460
  );
1435
1461
  }
1436
- const nt = j, it = U, Je = {};
1437
- function lt({
1462
+ const ct = C, at = P, et = {};
1463
+ function ft({
1438
1464
  count: e,
1439
1465
  defaultScrollOffset: t = 0,
1440
1466
  defaultSize: r = 0,
@@ -1442,160 +1468,160 @@ function lt({
1442
1468
  direction: s = "vertical",
1443
1469
  element: i,
1444
1470
  itemSize: n,
1445
- onItemsRendered: u,
1471
+ onItemsRendered: d,
1446
1472
  overscanCount: v = 3,
1447
1473
  scrollElement: h
1448
1474
  }) {
1449
- const f = ue(n);
1450
- Z(
1475
+ const f = ve(n);
1476
+ Y(
1451
1477
  !f || s === "vertical",
1452
1478
  "Dynamic item sizes are only supported for vertical content"
1453
1479
  );
1454
- const d = C(() => ue(n) ? (R) => n.getRowHeight(R) ?? n.getAverageRowHeight() : n, [n]), a = Ae(i, o), {
1455
- getCellBounds: l,
1456
- getEstimatedSize: c,
1457
- scrollTarget: g,
1458
- getScrollPositionForIndex: w,
1459
- startIndexOverscan: b,
1460
- startIndexVisible: x,
1480
+ const u = q(() => ve(n) ? (R) => n.getRowHeight(R) ?? n.getAverageRowHeight() : n, [n]), a = Ee(i, o), {
1481
+ getCellBounds: c,
1482
+ getEstimatedSize: l,
1483
+ scrollTarget: p,
1484
+ getScrollPositionForIndex: b,
1485
+ startIndexOverscan: S,
1486
+ startIndexVisible: w,
1461
1487
  stopIndexOverscan: m,
1462
- stopIndexVisible: V
1463
- } = he({
1488
+ stopIndexVisible: T
1489
+ } = pe({
1464
1490
  containerElement: i,
1465
1491
  defaultContainerSize: r,
1466
1492
  defaultScrollOffset: t,
1467
1493
  direction: s,
1468
1494
  isRtl: s === "horizontal" && a,
1469
1495
  itemCount: e,
1470
- itemProps: Je,
1471
- itemSize: d,
1496
+ itemProps: et,
1497
+ itemSize: u,
1472
1498
  onResize: void 0,
1473
1499
  overscanCount: v,
1474
1500
  scrollElement: h
1475
- }), z = U(/* @__PURE__ */ new Set()), N = U(/* @__PURE__ */ new WeakSet()), L = U([]), B = U({ dynamicRowHeight: null, unobserve: /* @__PURE__ */ new Map() }), F = Y((R) => {
1476
- R !== null && z.current.add(R);
1477
- }, []), G = i;
1478
- _(() => {
1479
- const R = z.current, I = B.current, H = ue(n) ? n : null;
1480
- I.dynamicRowHeight?.observeRowElements !== H?.observeRowElements && (I.unobserve.forEach((O) => O()), I.unobserve.clear()), I.dynamicRowHeight = H, R.forEach((O) => {
1481
- if (!O.isConnected)
1482
- R.delete(O), I.unobserve.get(O)?.(), I.unobserve.delete(O);
1501
+ }), g = P(/* @__PURE__ */ new Set()), J = P(/* @__PURE__ */ new WeakSet()), k = P([]), E = P({ dynamicRowHeight: null, unobserve: /* @__PURE__ */ new Map() }), L = X((R) => {
1502
+ R !== null && g.current.add(R);
1503
+ }, []), $ = i;
1504
+ B(() => {
1505
+ const R = g.current, O = E.current, H = ve(n) ? n : null;
1506
+ O.dynamicRowHeight?.observeRowElements !== H?.observeRowElements && (O.unobserve.forEach((I) => I()), O.unobserve.clear()), O.dynamicRowHeight = H, R.forEach((I) => {
1507
+ if (!I.isConnected)
1508
+ R.delete(I), O.unobserve.get(I)?.(), O.unobserve.delete(I);
1483
1509
  else if (H && // Like List, measure items once the element has mounted
1484
1510
  // (e.g. so the dynamic row height cache has finished mounting too)
1485
- G !== null && !I.unobserve.has(O)) {
1486
- if (ge(O) === void 0) {
1487
- N.current.has(O) || (N.current.add(O), console.warn(
1511
+ $ !== null && !O.unobserve.has(I)) {
1512
+ if (ge(I) === void 0) {
1513
+ J.current.has(I) || (J.current.add(I), console.warn(
1488
1514
  "useVirtualizer: Items passed to measureElement must specify their index with a data-index attribute",
1489
- O
1515
+ I
1490
1516
  ));
1491
1517
  return;
1492
1518
  }
1493
- I.unobserve.set(
1494
- O,
1495
- H.observeRowElements([O])
1519
+ O.unobserve.set(
1520
+ I,
1521
+ H.observeRowElements([I])
1496
1522
  );
1497
1523
  }
1498
- }), L.current = Array.from(R);
1524
+ }), k.current = Array.from(R);
1499
1525
  }), le(() => {
1500
- const R = B.current;
1526
+ const R = E.current;
1501
1527
  return () => {
1502
- R.unobserve.forEach((I) => I()), R.unobserve.clear(), R.dynamicRowHeight = null;
1528
+ R.unobserve.forEach((O) => O()), R.unobserve.clear(), R.dynamicRowHeight = null;
1503
1529
  };
1504
1530
  }, []);
1505
- const P = ke({
1531
+ const _ = Ne({
1506
1532
  direction: s,
1507
1533
  element: i,
1508
- getCellBounds: l,
1534
+ getCellBounds: c,
1509
1535
  isDynamicSize: f,
1510
1536
  itemCount: e,
1511
- itemElements: L,
1512
- scrollTarget: g,
1513
- getScrollPositionForIndex: w
1537
+ itemElements: k,
1538
+ scrollTarget: p,
1539
+ getScrollPositionForIndex: b
1514
1540
  });
1515
1541
  le(() => {
1516
- b >= 0 && m >= 0 && u && u(
1517
- { startIndex: x, stopIndex: V },
1518
- { startIndex: b, stopIndex: m }
1542
+ S >= 0 && m >= 0 && d && d(
1543
+ { startIndex: w, stopIndex: T },
1544
+ { startIndex: S, stopIndex: m }
1519
1545
  );
1520
1546
  }, [
1521
- u,
1522
- b,
1523
- x,
1547
+ d,
1548
+ S,
1549
+ w,
1524
1550
  m,
1525
- V
1551
+ T
1526
1552
  ]);
1527
- const Q = C(() => {
1553
+ const Q = q(() => {
1528
1554
  const R = [];
1529
1555
  if (e > 0)
1530
- for (let I = b; I <= m; I++) {
1531
- const { scrollOffset: H, size: O } = l(I);
1532
- R.push({ index: I, offset: H, size: O });
1556
+ for (let O = S; O <= m; O++) {
1557
+ const { scrollOffset: H, size: I } = c(O);
1558
+ R.push({ index: O, offset: H, size: I });
1533
1559
  }
1534
1560
  return R;
1535
- }, [e, l, b, m]), te = c();
1536
- return C(
1561
+ }, [e, c, S, m]), te = l();
1562
+ return q(
1537
1563
  () => ({
1538
1564
  items: Q,
1539
- measureElement: F,
1540
- scrollToIndex: P,
1565
+ measureElement: L,
1566
+ scrollToIndex: _,
1541
1567
  totalSize: te,
1542
1568
  visibleRange: {
1543
- startIndex: x,
1544
- stopIndex: V
1569
+ startIndex: w,
1570
+ stopIndex: T
1545
1571
  }
1546
1572
  }),
1547
1573
  [
1548
1574
  Q,
1549
- F,
1550
- P,
1551
- x,
1552
- V,
1575
+ L,
1576
+ _,
1577
+ w,
1578
+ T,
1553
1579
  te
1554
1580
  ]
1555
1581
  );
1556
1582
  }
1557
- function ct(e, {
1583
+ function ut(e, {
1558
1584
  delay: t = 150
1559
1585
  } = {}) {
1560
- const [r, o] = j(!1);
1561
- return _(() => {
1586
+ const [r, o] = C(!1);
1587
+ return B(() => {
1562
1588
  if (!e)
1563
1589
  return;
1564
- const s = e === "window" ? window : J(e), i = e === "window" ? s : e, n = "onscrollend" in s;
1565
- let u, v = 0;
1590
+ const s = e === "window" ? window : Z(e), i = e === "window" ? s : e, n = "onscrollend" in s;
1591
+ let d, v = 0;
1566
1592
  const h = () => {
1567
- performance.now() - v >= t ? (u = void 0, o(!1)) : u = s.requestAnimationFrame(h);
1593
+ performance.now() - v >= t ? (d = void 0, o(!1)) : d = s.requestAnimationFrame(h);
1568
1594
  }, f = () => {
1569
- o(!0), n || (v = performance.now(), u === void 0 && (u = s.requestAnimationFrame(h)));
1570
- }, d = () => {
1595
+ o(!0), n || (v = performance.now(), d === void 0 && (d = s.requestAnimationFrame(h)));
1596
+ }, u = () => {
1571
1597
  o(!1);
1572
1598
  };
1573
- return i.addEventListener("scroll", f, { passive: !0 }), n && i.addEventListener("scrollend", d), () => {
1574
- i.removeEventListener("scroll", f), i.removeEventListener("scrollend", d), u !== void 0 && s.cancelAnimationFrame(u), o(!1);
1599
+ return i.addEventListener("scroll", f, { passive: !0 }), n && i.addEventListener("scrollend", u), () => {
1600
+ i.removeEventListener("scroll", f), i.removeEventListener("scrollend", u), d !== void 0 && s.cancelAnimationFrame(d), o(!1);
1575
1601
  };
1576
1602
  }, [t, e]), r;
1577
1603
  }
1578
- const Re = /* @__PURE__ */ new WeakMap();
1579
- function at(e = !1, t = typeof document < "u" ? document : void 0) {
1604
+ const Te = /* @__PURE__ */ new WeakMap();
1605
+ function dt(e = !1, t = typeof document < "u" ? document : void 0) {
1580
1606
  if (t === void 0)
1581
1607
  return 0;
1582
- let r = Re.get(t);
1608
+ let r = Te.get(t);
1583
1609
  if (r === void 0 || e) {
1584
1610
  const o = t.createElement("div"), s = o.style;
1585
- s.width = "50px", s.height = "50px", s.overflow = "scroll", t.body.appendChild(o), r = o.offsetWidth - o.clientWidth, t.body.removeChild(o), Re.set(t, r);
1611
+ s.width = "50px", s.height = "50px", s.overflow = "scroll", t.body.appendChild(o), r = o.offsetWidth - o.clientWidth, t.body.removeChild(o), Te.set(t, r);
1586
1612
  }
1587
1613
  return r;
1588
1614
  }
1589
1615
  export {
1590
- et as Grid,
1591
- rt as List,
1592
- at as getScrollbarSize,
1593
- ot as useDynamicRowHeight,
1594
- tt as useGridCallbackRef,
1595
- st as useGridRef,
1596
- ct as useIsScrolling,
1597
- nt as useListCallbackRef,
1598
- it as useListRef,
1599
- lt as useVirtualizer
1616
+ rt as Grid,
1617
+ it as List,
1618
+ dt as getScrollbarSize,
1619
+ lt as useDynamicRowHeight,
1620
+ ot as useGridCallbackRef,
1621
+ nt as useGridRef,
1622
+ ut as useIsScrolling,
1623
+ ct as useListCallbackRef,
1624
+ at as useListRef,
1625
+ ft as useVirtualizer
1600
1626
  };
1601
1627
  //# sourceMappingURL=react-window.js.map