@aiquants/virtualscroll 1.22.1 → 1.23.0

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.js CHANGED
@@ -1,6 +1,6 @@
1
- import { jsx as it, jsxs as de, Fragment as je } from "react/jsx-runtime";
2
- import Je, { memo as Qe, forwardRef as Ye, useState as Zt, useRef as T, useCallback as v, useImperativeHandle as Be, useMemo as At, useLayoutEffect as xe, useEffect as Y, useId as tr } from "react";
3
- import { twMerge as ue } from "tailwind-merge";
1
+ import { jsx as ot, jsxs as he, Fragment as Ge } from "react/jsx-runtime";
2
+ import Qe, { memo as tr, forwardRef as Be, useState as Jt, useRef as I, useCallback as S, useImperativeHandle as qe, useMemo as Lt, useLayoutEffect as Te, useEffect as q, useId as er } from "react";
3
+ import { twMerge as pe } from "tailwind-merge";
4
4
  class C {
5
5
  level;
6
6
  prefix;
@@ -146,17 +146,17 @@ class C {
146
146
  this.level <= 3 && this.impl.error(...this.formatMessage(C.resolveLazy(t)), ...e.map(C.resolveLazy));
147
147
  }
148
148
  }
149
- const qe = {
149
+ const He = {
150
150
  active: !1,
151
151
  offsetX: 0,
152
152
  offsetY: 0,
153
153
  distance: 0,
154
154
  direction: 0,
155
155
  pointerId: null
156
- }, Le = 6, er = 8, rr = ({ dragState: n, normalizedDistance: t }) => {
156
+ }, _e = 6, rr = 8, nr = ({ dragState: n, normalizedDistance: t }) => {
157
157
  const e = 1 + t * 0.18, r = 0.16 + t * 0.24, i = 0.38 + t * 0.28, s = n.active ? "80ms ease-out" : "220ms ease";
158
- return /* @__PURE__ */ de(je, { children: [
159
- /* @__PURE__ */ it(
158
+ return /* @__PURE__ */ he(Ge, { children: [
159
+ /* @__PURE__ */ ot(
160
160
  "div",
161
161
  {
162
162
  className: "aqvs-tap-scroll-circle-visual-outer",
@@ -168,7 +168,7 @@ const qe = {
168
168
  }
169
169
  }
170
170
  ),
171
- /* @__PURE__ */ it(
171
+ /* @__PURE__ */ ot(
172
172
  "div",
173
173
  {
174
174
  className: "aqvs-tap-scroll-circle-inner",
@@ -181,154 +181,154 @@ const qe = {
181
181
  }
182
182
  )
183
183
  ] });
184
- }, Ge = Qe(
185
- Ye(({ onDragChange: n, className: t, maxVisualDistance: e = 160, size: r = 40, style: i, opacity: s = 1, renderVisual: l }, c) => {
186
- const [f, x] = Zt(qe), I = T(null), P = T(null), E = T({ x: 0, y: 0 }), g = T(null), _ = T(0), z = v(
187
- (h) => {
188
- x(h), n(h);
184
+ }, Ze = tr(
185
+ Be(({ onDragChange: n, className: t, maxVisualDistance: e = 160, size: r = 40, style: i, opacity: s = 1, renderVisual: a }, c) => {
186
+ const [d, b] = Jt(He), x = I(null), v = I(null), E = I({ x: 0, y: 0 }), m = I(null), _ = I(0), B = S(
187
+ (T) => {
188
+ b(T), n(T);
189
189
  },
190
190
  [n]
191
- ), j = v(
192
- (h, $, Tt = !1) => {
193
- const { x: wt, y: Z } = E.current, k = h - wt, Rt = $ - Z, U = Math.abs(Rt), Ct = U < Le ? 0 : Rt < 0 ? -1 : 1, w = _.current;
194
- let Yt = Ct;
195
- const Xt = Le + er;
196
- Ct === 0 ? w !== 0 && U < Xt ? Yt = w : (Yt = 0, Tt || (_.current = 0)) : Ct !== w && w !== 0 && U < Xt ? Yt = w : _.current = Ct, z({
197
- active: Tt || U >= Le,
198
- offsetX: k,
199
- offsetY: Rt,
200
- distance: U,
201
- direction: Yt,
202
- pointerId: I.current
191
+ ), Z = S(
192
+ (T, V, Tt = !1) => {
193
+ const { x: Yt, y: yt } = E.current, J = T - Yt, F = V - yt, Ct = Math.abs(F), W = Ct < _e ? 0 : F < 0 ? -1 : 1, At = _.current;
194
+ let y = W;
195
+ const Kt = _e + rr;
196
+ W === 0 ? At !== 0 && Ct < Kt ? y = At : (y = 0, Tt || (_.current = 0)) : W !== At && At !== 0 && Ct < Kt ? y = At : _.current = W, B({
197
+ active: Tt || Ct >= _e,
198
+ offsetX: J,
199
+ offsetY: F,
200
+ distance: Ct,
201
+ direction: y,
202
+ pointerId: x.current
203
203
  });
204
204
  },
205
- [z]
206
- ), ft = v((h) => {
207
- if (h === null)
205
+ [B]
206
+ ), ut = S((T) => {
207
+ if (T === null)
208
208
  return;
209
- const $ = g.current;
210
- $?.hasPointerCapture(h) && $.releasePointerCapture(h);
211
- }, []), Q = v(
212
- (h = !1) => {
213
- h && ft(I.current), I.current = null, P.current = null, _.current = 0, z(qe);
209
+ const V = m.current;
210
+ V?.hasPointerCapture(T) && V.releasePointerCapture(T);
211
+ }, []), rt = S(
212
+ (T = !1) => {
213
+ T && ut(x.current), x.current = null, v.current = null, _.current = 0, B(He);
214
214
  },
215
- [z, ft]
216
- ), tt = v(
217
- (h) => {
218
- if (I.current !== null && I.current !== h.pointerId) {
219
- P.current = { pointerId: h.pointerId, clientX: h.clientX, clientY: h.clientY }, h.preventDefault(), h.stopPropagation();
215
+ [B, ut]
216
+ ), nt = S(
217
+ (T) => {
218
+ if (x.current !== null && x.current !== T.pointerId) {
219
+ v.current = { pointerId: T.pointerId, clientX: T.clientX, clientY: T.clientY }, T.preventDefault(), T.stopPropagation();
220
220
  return;
221
221
  }
222
- h.preventDefault(), h.stopPropagation();
223
- const $ = g.current ?? h.currentTarget, { left: Tt, top: wt, width: Z, height: k } = $.getBoundingClientRect();
224
- E.current = { x: Tt + Z / 2, y: wt + k / 2 }, I.current = h.pointerId;
222
+ T.preventDefault(), T.stopPropagation();
223
+ const V = m.current ?? T.currentTarget, { left: Tt, top: Yt, width: yt, height: J } = V.getBoundingClientRect();
224
+ E.current = { x: Tt + yt / 2, y: Yt + J / 2 }, x.current = T.pointerId;
225
225
  try {
226
- $.setPointerCapture(h.pointerId);
226
+ V.setPointerCapture(T.pointerId);
227
227
  } catch {
228
228
  }
229
- j(h.clientX, h.clientY, !0);
229
+ Z(T.clientX, T.clientY, !0);
230
230
  },
231
- [j]
232
- ), pt = v(
233
- (h) => {
234
- if (I.current !== h.pointerId) {
235
- P.current !== null && P.current.pointerId === h.pointerId && (P.current = { pointerId: h.pointerId, clientX: h.clientX, clientY: h.clientY });
231
+ [Z]
232
+ ), pt = S(
233
+ (T) => {
234
+ if (x.current !== T.pointerId) {
235
+ v.current !== null && v.current.pointerId === T.pointerId && (v.current = { pointerId: T.pointerId, clientX: T.clientX, clientY: T.clientY });
236
236
  return;
237
237
  }
238
- h.preventDefault(), j(h.clientX, h.clientY);
238
+ T.preventDefault(), Z(T.clientX, T.clientY);
239
239
  },
240
- [j]
241
- ), It = v(
242
- (h) => {
243
- if (I.current !== h.pointerId) {
244
- P.current !== null && P.current.pointerId === h.pointerId && (P.current = null);
240
+ [Z]
241
+ ), Pt = S(
242
+ (T) => {
243
+ if (x.current !== T.pointerId) {
244
+ v.current !== null && v.current.pointerId === T.pointerId && (v.current = null);
245
245
  return;
246
246
  }
247
- h.preventDefault(), h.stopPropagation();
248
- const $ = P.current;
249
- if (P.current = null, $ !== null) {
250
- ft(h.pointerId);
251
- const Tt = g.current;
252
- let wt = !0;
247
+ T.preventDefault(), T.stopPropagation();
248
+ const V = v.current;
249
+ if (v.current = null, V !== null) {
250
+ ut(T.pointerId);
251
+ const Tt = m.current;
252
+ let Yt = !0;
253
253
  if (Tt !== null && typeof Tt.setPointerCapture == "function")
254
254
  try {
255
- Tt.setPointerCapture($.pointerId);
256
- } catch (Z) {
257
- (typeof Z == "object" && Z !== null && "name" in Z ? Z.name : void 0) === "NotFoundError" && (wt = !1);
255
+ Tt.setPointerCapture(V.pointerId);
256
+ } catch (yt) {
257
+ (typeof yt == "object" && yt !== null && "name" in yt ? yt.name : void 0) === "NotFoundError" && (Yt = !1);
258
258
  }
259
- if (wt) {
260
- I.current = $.pointerId, j($.clientX, $.clientY, !0);
259
+ if (Yt) {
260
+ x.current = V.pointerId, Z(V.clientX, V.clientY, !0);
261
261
  return;
262
262
  }
263
263
  }
264
- Q(!0);
264
+ rt(!0);
265
265
  },
266
- [Q, ft, j]
267
- ), D = v(
268
- (h) => {
269
- h.target === h.currentTarget && I.current === h.pointerId && Q(!1);
266
+ [rt, ut, Z]
267
+ ), D = S(
268
+ (T) => {
269
+ T.target === T.currentTarget && x.current === T.pointerId && rt(!1);
270
270
  },
271
- [Q]
271
+ [rt]
272
272
  );
273
- Be(
273
+ qe(
274
274
  c,
275
275
  () => ({
276
276
  reset: () => {
277
- Q(!0);
277
+ rt(!0);
278
278
  },
279
- getElement: () => g.current
279
+ getElement: () => m.current
280
280
  }),
281
- [Q]
281
+ [rt]
282
282
  );
283
- const O = Math.min(Math.max(s, 0), 1), M = r / 64, B = Math.min(f.distance, e) / e, N = f.direction * B * 10 * M, q = l ?? rr, et = {
284
- dragState: f,
285
- normalizedDistance: B,
286
- sizeScale: M,
283
+ const k = Math.min(Math.max(s, 0), 1), P = r / 64, X = Math.min(d.distance, e) / e, $ = d.direction * X * 10 * P, N = a ?? nr, lt = {
284
+ dragState: d,
285
+ normalizedDistance: X,
286
+ sizeScale: P,
287
287
  size: r,
288
- opacity: O
289
- }, G = {
288
+ opacity: k
289
+ }, K = {
290
290
  ...i,
291
291
  width: r,
292
292
  height: r,
293
- transform: `translateY(${N}px)`
293
+ transform: `translateY(${$}px)`
294
294
  };
295
- return G.opacity = O, /* @__PURE__ */ it(
295
+ return K.opacity = k, /* @__PURE__ */ ot(
296
296
  "div",
297
297
  {
298
- ref: g,
298
+ ref: m,
299
299
  "data-testid": "virtual-scroll-tap-circle",
300
- className: ue("aqvs-tap-scroll-circle", t),
301
- style: G,
300
+ className: pe("aqvs-tap-scroll-circle", t),
301
+ style: K,
302
302
  tabIndex: -1,
303
- onPointerDown: tt,
303
+ onPointerDown: nt,
304
304
  onPointerMove: pt,
305
- onPointerUp: It,
306
- onPointerCancel: It,
305
+ onPointerUp: Pt,
306
+ onPointerCancel: Pt,
307
307
  onLostPointerCapture: D,
308
308
  role: "presentation",
309
- children: q(et)
309
+ children: N(lt)
310
310
  }
311
311
  );
312
312
  })
313
313
  );
314
- Ge.displayName = "TapScrollCircle";
315
- const xt = (n, t, e) => Math.max(t, Math.min(e, n)), ze = "virtualscroll:tap-scroll-cancel", He = 20, nr = 250, ir = 60, sr = 20, or = 20, Ze = {
314
+ Ze.displayName = "TapScrollCircle";
315
+ const vt = (n, t, e) => Math.max(t, Math.min(e, n)), Ye = "virtualscroll:tap-scroll-cancel", Xe = 20, ir = 250, sr = 60, or = 20, ar = 20, Je = {
316
316
  /** 速度が最大に達する引き距離 (px)。`maxVisualDistance` の既定値。 */
317
317
  maxDistance: 240,
318
318
  /** 最小速度倍率 (ビューポート比)。 */
319
319
  minSpeedMultiplier: 0.2
320
- }, ar = Ze.maxDistance, Xe = { active: !1, offsetX: 0, offsetY: 0, distance: 0, direction: 0, pointerId: null }, _e = 2.2, lr = 8, cr = 120, ur = 1 / 10, Gt = {
320
+ }, lr = Je.maxDistance, $e = { active: !1, offsetX: 0, offsetY: 0, distance: 0, direction: 0, pointerId: null }, ke = 2.2, cr = 8, ur = 120, dr = 1 / 10, Zt = {
321
321
  enabled: !0,
322
322
  size: 40,
323
323
  offsetX: -80,
324
324
  offsetY: 0,
325
325
  className: void 0,
326
- maxVisualDistance: ar,
327
- minSpeedMultiplier: Ze.minSpeedMultiplier,
326
+ maxVisualDistance: lr,
327
+ minSpeedMultiplier: Je.minSpeedMultiplier,
328
328
  opacity: 0.9,
329
329
  renderVisual: void 0,
330
330
  maxSpeedCurve: void 0
331
- }, dr = (n) => n ? {
331
+ }, fr = (n) => n ? {
332
332
  mainSizeKey: "width",
333
333
  crossSizeKey: "height",
334
334
  positionKey: "left",
@@ -348,319 +348,319 @@ const xt = (n, t, e) => Math.max(t, Math.min(e, n)), ze = "virtualscroll:tap-scr
348
348
  arrowIcons: ["▲", "▼"],
349
349
  directionClass: "aqvs-scrollbar-vertical",
350
350
  orientation: "vertical"
351
- }, fr = (n, t) => {
352
- const e = n?.maxSpeedMultiplier, r = typeof e == "number" ? e : br(t);
351
+ }, mr = (n, t) => {
352
+ const e = n?.maxSpeedMultiplier, r = typeof e == "number" ? e : xr(t);
353
353
  return {
354
- enabled: n?.enabled ?? Gt.enabled,
355
- size: n?.size ?? Gt.size,
356
- offsetX: n?.offsetX ?? Gt.offsetX,
357
- offsetY: n?.offsetY ?? Gt.offsetY,
358
- className: n?.className ?? Gt.className,
359
- maxVisualDistance: n?.maxVisualDistance ?? Gt.maxVisualDistance,
354
+ enabled: n?.enabled ?? Zt.enabled,
355
+ size: n?.size ?? Zt.size,
356
+ offsetX: n?.offsetX ?? Zt.offsetX,
357
+ offsetY: n?.offsetY ?? Zt.offsetY,
358
+ className: n?.className ?? Zt.className,
359
+ maxVisualDistance: n?.maxVisualDistance ?? Zt.maxVisualDistance,
360
360
  maxSpeedMultiplier: r,
361
- minSpeedMultiplier: Math.max(n?.minSpeedMultiplier ?? Gt.minSpeedMultiplier, 0),
362
- opacity: xt(n?.opacity ?? Gt.opacity, 0, 1),
363
- renderVisual: n?.renderVisual ?? Gt.renderVisual,
364
- maxSpeedCurve: n?.maxSpeedCurve ?? Gt.maxSpeedCurve
361
+ minSpeedMultiplier: Math.max(n?.minSpeedMultiplier ?? Zt.minSpeedMultiplier, 0),
362
+ opacity: vt(n?.opacity ?? Zt.opacity, 0, 1),
363
+ renderVisual: n?.renderVisual ?? Zt.renderVisual,
364
+ maxSpeedCurve: n?.maxSpeedCurve ?? Zt.maxSpeedCurve
365
365
  };
366
- }, mr = ({ isDragging: n, isThumbHovered: t, enableThumbDrag: e }) => At(() => e ? n ? "dragging" : t ? "hover" : "idle" : "disabled", [e, n, t]), pr = ({ canUseArrowButtons: n, enableArrowButtons: t, resetTapScroll: e, scrollByStep: r }) => {
367
- const i = T(null), s = T(null), l = T(null), c = v(() => {
368
- i.current !== null && (window.clearInterval(i.current), i.current = null), s.current !== null && (window.clearTimeout(s.current), s.current = null), l.current !== null && (window.removeEventListener("pointerup", l.current), window.removeEventListener("pointercancel", l.current), window.removeEventListener("blur", l.current), l.current = null);
369
- }, []), f = v(() => {
366
+ }, pr = ({ isDragging: n, isThumbHovered: t, enableThumbDrag: e }) => Lt(() => e ? n ? "dragging" : t ? "hover" : "idle" : "disabled", [e, n, t]), hr = ({ canUseArrowButtons: n, enableArrowButtons: t, resetTapScroll: e, scrollByStep: r }) => {
367
+ const i = I(null), s = I(null), a = I(null), c = S(() => {
368
+ i.current !== null && (window.clearInterval(i.current), i.current = null), s.current !== null && (window.clearTimeout(s.current), s.current = null), a.current !== null && (window.removeEventListener("pointerup", a.current), window.removeEventListener("pointercancel", a.current), window.removeEventListener("blur", a.current), a.current = null);
369
+ }, []), d = S(() => {
370
370
  c();
371
- }, [c]), x = v(
372
- (P) => (E) => {
371
+ }, [c]), b = S(
372
+ (v) => (E) => {
373
373
  if (!n)
374
374
  return;
375
- E.cancelable && E.preventDefault(), E.stopPropagation(), e(), c(), r(P), s.current = window.setTimeout(() => {
375
+ E.cancelable && E.preventDefault(), E.stopPropagation(), e(), c(), r(v), s.current = window.setTimeout(() => {
376
376
  i.current = window.setInterval(() => {
377
- r(P);
378
- }, ir);
379
- }, nr);
380
- const g = () => c();
381
- l.current = g, window.addEventListener("pointerup", g), window.addEventListener("pointercancel", g), window.addEventListener("blur", g);
377
+ r(v);
378
+ }, sr);
379
+ }, ir);
380
+ const m = () => c();
381
+ a.current = m, window.addEventListener("pointerup", m), window.addEventListener("pointercancel", m), window.addEventListener("blur", m);
382
382
  },
383
383
  [n, c, e, r]
384
- ), I = v(
385
- (P) => (E) => {
386
- t && (E.key === "Enter" || E.key === " " || E.key === "Spacebar") && (E.preventDefault(), r(P));
384
+ ), x = S(
385
+ (v) => (E) => {
386
+ t && (E.key === "Enter" || E.key === " " || E.key === "Spacebar") && (E.preventDefault(), r(v));
387
387
  },
388
388
  [t, r]
389
389
  );
390
- return Y(() => {
390
+ return q(() => {
391
391
  n || c();
392
- }, [n, c]), Y(() => () => {
392
+ }, [n, c]), q(() => () => {
393
393
  c();
394
- }, [c]), { handleArrowPointerDown: x, handleArrowPointerUp: f, handleArrowKeyDown: I };
395
- }, hr = 700, oe = (n, t) => typeof n == "number" && Number.isFinite(n) ? n : t, gr = ({ distance: n, maxDistance: t, viewportSize: e, minSpeedMultiplier: r, maxSpeedMultiplier: i, hasCustomMaxSpeedMultiplier: s, curve: l }) => {
396
- const c = Math.max(oe(n, 0), 0), f = oe(t, 0), x = f > 0 ? Math.min(c, f) / f : 1, I = Math.max(oe(e, 0), 0), P = Math.max(oe(r, 0), 0), E = Math.max(oe(i, 0), 0), g = Math.max(I * P, 40), _ = s ? g : 1200, z = Math.max(I * E, _), j = l ? Math.max(oe(l.exponentialScale, E), 0) : 0, ft = l ? Math.min(z, Math.max(I * j, g)) : z, Q = Math.max(ft, g);
397
- let tt = x ** 1.1;
398
- if (l) {
399
- const It = Math.min(Math.max(oe(l.exponentialSteepness, 0), 0), hr);
400
- if (It === 0)
401
- tt = x;
394
+ }, [c]), { handleArrowPointerDown: b, handleArrowPointerUp: d, handleArrowKeyDown: x };
395
+ }, gr = 700, fe = (n, t) => typeof n == "number" && Number.isFinite(n) ? n : t, br = ({ distance: n, maxDistance: t, viewportSize: e, minSpeedMultiplier: r, maxSpeedMultiplier: i, hasCustomMaxSpeedMultiplier: s, curve: a }) => {
396
+ const c = Math.max(fe(n, 0), 0), d = fe(t, 0), b = d > 0 ? Math.min(c, d) / d : 1, x = Math.max(fe(e, 0), 0), v = Math.max(fe(r, 0), 0), E = Math.max(fe(i, 0), 0), m = Math.max(x * v, 40), _ = s ? m : 1200, B = Math.max(x * E, _), Z = a ? Math.max(fe(a.exponentialScale, E), 0) : 0, ut = a ? Math.min(B, Math.max(x * Z, m)) : B, rt = Math.max(ut, m);
397
+ let nt = b ** 1.1;
398
+ if (a) {
399
+ const Pt = Math.min(Math.max(fe(a.exponentialSteepness, 0), 0), gr);
400
+ if (Pt === 0)
401
+ nt = b;
402
402
  else {
403
- const D = Math.expm1(It) || 1;
404
- tt = Math.min(Math.max(Math.expm1(It * x) / D, 0), 1);
403
+ const D = Math.expm1(Pt) || 1;
404
+ nt = Math.min(Math.max(Math.expm1(Pt * b) / D, 0), 1);
405
405
  }
406
406
  }
407
- const pt = Math.min(Math.max(oe(l?.easedOffset, 0), 0), 1);
408
- return g + (Q - g) * (pt + (1 - pt) * tt);
409
- }, br = (n) => {
407
+ const pt = Math.min(Math.max(fe(a?.easedOffset, 0), 0), 1);
408
+ return m + (rt - m) * (pt + (1 - pt) * nt);
409
+ }, xr = (n) => {
410
410
  if (!n || n <= 0)
411
- return _e;
412
- const t = Math.max(1, n), e = Math.log10(t), r = _e + e * lr;
413
- return xt(r, _e, cr);
414
- }, xr = ({
411
+ return ke;
412
+ const t = Math.max(1, n), e = Math.log10(t), r = ke + e * cr;
413
+ return vt(r, ke, ur);
414
+ }, Ir = ({
415
415
  contentSize: n,
416
416
  viewportSize: t,
417
417
  scrollPosition: e,
418
418
  onScroll: r,
419
419
  enableThumbDrag: i = !0,
420
420
  enableTrackClick: s = !0,
421
- enableArrowButtons: l = !0,
421
+ enableArrowButtons: a = !0,
422
422
  horizontal: c = !1,
423
- scrollBarWidth: f = 12,
424
- className: x,
425
- ariaControls: I,
426
- tapScrollCircleOptions: P,
423
+ scrollBarWidth: d = 12,
424
+ className: b,
425
+ ariaControls: x,
426
+ tapScrollCircleOptions: v,
427
427
  itemCount: E,
428
- renderThumbOverlay: g,
428
+ renderThumbOverlay: m,
429
429
  visibleStartIndex: _,
430
- visibleEndIndex: z
430
+ visibleEndIndex: B
431
431
  }) => {
432
- const [j, ft] = Zt(!1), [Q, tt] = Zt(!1), [pt, It] = Zt(!1), D = T(null), O = T({
432
+ const [Z, ut] = Jt(!1), [rt, nt] = Jt(!1), [pt, Pt] = Jt(!1), D = I(null), k = I({
433
433
  pointerId: null,
434
434
  startThumbPosition: 0,
435
435
  startClientX: 0,
436
436
  startClientY: 0,
437
437
  scale: 1,
438
438
  captureTarget: null
439
- }), M = T({ pointerId: null, startThumbPosition: 0, startClientX: 0, startClientY: 0, scale: 1 }), B = T(e), N = T(r), q = T(Xe), et = T(null), G = T(null), h = T(null), $ = T(0), Tt = T(0), wt = At(() => fr(P, E), [E, P]), Z = At(() => dr(c), [c]), {
440
- enabled: k,
441
- size: Rt,
442
- offsetX: U,
443
- offsetY: Ct,
444
- className: w,
445
- maxVisualDistance: Yt,
446
- maxSpeedMultiplier: Xt,
447
- minSpeedMultiplier: S,
448
- opacity: $t,
449
- renderVisual: Bt,
450
- maxSpeedCurve: Jt
451
- } = wt, lt = T({
439
+ }), P = I({ pointerId: null, startThumbPosition: 0, startClientX: 0, startClientY: 0, scale: 1 }), X = I(e), $ = I(r), N = I($e), lt = I(null), K = I(null), T = I(null), V = I(0), Tt = I(0), Yt = Lt(() => mr(v, E), [E, v]), yt = Lt(() => fr(c), [c]), {
440
+ enabled: J,
441
+ size: F,
442
+ offsetX: Ct,
443
+ offsetY: W,
444
+ className: At,
445
+ maxVisualDistance: y,
446
+ maxSpeedMultiplier: Kt,
447
+ minSpeedMultiplier: ae,
448
+ opacity: A,
449
+ renderVisual: j,
450
+ maxSpeedCurve: Bt
451
+ } = Yt, _t = I({
452
452
  viewportSize: t,
453
453
  maxScrollPosition: Math.max(n - t, 0),
454
454
  scrollBarVisible: n > t,
455
- effectiveTapMaxDistance: Math.max(Yt, 1),
456
- tapCircleMaxSpeedMultiplier: Xt,
457
- tapCircleMinSpeedMultiplier: S,
458
- tapCircleMaxSpeedCurve: Jt,
459
- tapScrollCircleOptions: P,
455
+ effectiveTapMaxDistance: Math.max(y, 1),
456
+ tapCircleMaxSpeedMultiplier: Kt,
457
+ tapCircleMinSpeedMultiplier: ae,
458
+ tapCircleMaxSpeedCurve: Bt,
459
+ tapScrollCircleOptions: v,
460
460
  effectiveTrackLength: 0,
461
461
  onScroll: r,
462
462
  scrollPosition: e
463
- }), { mainSizeKey: Wt, crossSizeKey: d, positionKey: mt, selectDelta: ct, getPointerCoordinate: H, arrowLabels: nt, arrowIcons: J, directionClass: Pt, orientation: Mt } = Z, Et = Math.max(Yt, 1), st = t / n, St = Math.max(t - f * 2, 0), yt = st * St, ut = Math.min(Math.max(He, yt || 0), St || He), ot = n - t, Dt = Math.max(St - ut, 0), qt = ot <= 0 || Dt <= 0 ? 0 : xt(e / ot * Dt, 0, Dt), le = qt + ut / 2, dt = n > t || j, Qt = dt && l;
464
- xe(() => {
465
- lt.current = {
463
+ }), { mainSizeKey: Et, crossSizeKey: Xt, positionKey: dt, selectDelta: p, getPointerCoordinate: ft, arrowLabels: mt, arrowIcons: z, directionClass: et, orientation: ct } = yt, kt = Math.max(y, 1), Ot = t / n, Mt = Math.max(t - d * 2, 0), it = Ot * Mt, ht = Math.min(Math.max(Xe, it || 0), Mt || Xe), st = n - t, Q = Math.max(Mt - ht, 0), qt = st <= 0 || Q <= 0 ? 0 : vt(e / st * Q, 0, Q), le = qt + ht / 2, Nt = n > t || Z, $t = Nt && a;
464
+ Te(() => {
465
+ _t.current = {
466
466
  viewportSize: t,
467
- maxScrollPosition: ot,
468
- scrollBarVisible: dt,
469
- effectiveTapMaxDistance: Et,
470
- tapCircleMaxSpeedMultiplier: Xt,
471
- tapCircleMinSpeedMultiplier: S,
472
- tapCircleMaxSpeedCurve: Jt,
473
- tapScrollCircleOptions: P,
474
- effectiveTrackLength: Dt,
467
+ maxScrollPosition: st,
468
+ scrollBarVisible: Nt,
469
+ effectiveTapMaxDistance: kt,
470
+ tapCircleMaxSpeedMultiplier: Kt,
471
+ tapCircleMinSpeedMultiplier: ae,
472
+ tapCircleMaxSpeedCurve: Bt,
473
+ tapScrollCircleOptions: v,
474
+ effectiveTrackLength: Q,
475
475
  onScroll: r,
476
476
  scrollPosition: e
477
477
  };
478
- }), xe(() => {
479
- B.current = e;
480
- }, [e]), xe(() => {
481
- N.current = r;
482
- }, [r]), Y(() => {
483
- i || tt(!1);
478
+ }), Te(() => {
479
+ X.current = e;
480
+ }, [e]), Te(() => {
481
+ $.current = r;
482
+ }, [r]), q(() => {
483
+ i || nt(!1);
484
484
  }, [i]);
485
- const m = mr({ isDragging: j, isThumbHovered: Q, enableThumbDrag: i }), y = v((o, b) => {
486
- const R = lt.current, L = b ?? B.current;
487
- if (N.current) {
488
- const p = N.current(o, L);
489
- if (typeof p == "number" && Number.isFinite(p))
490
- return B.current = p, p;
485
+ const Gt = pr({ isDragging: Z, isThumbHovered: rt, enableThumbDrag: i }), Vt = S((o, g) => {
486
+ const M = _t.current, L = g ?? X.current;
487
+ if ($.current) {
488
+ const u = $.current(o, L);
489
+ if (typeof u == "number" && Number.isFinite(u))
490
+ return X.current = u, u;
491
491
  }
492
- const X = typeof o == "function" ? o(L) : o, a = Math.max(R.maxScrollPosition, 0), u = R.scrollBarVisible ? xt(X, 0, a) : 0;
493
- return B.current = u, u;
494
- }, []), Nt = v(
492
+ const H = typeof o == "function" ? o(L) : o, St = Math.max(M.maxScrollPosition, 0), l = M.scrollBarVisible ? vt(H, 0, St) : 0;
493
+ return X.current = l, l;
494
+ }, []), f = S(
495
495
  (o) => {
496
- const b = lt.current, R = B.current;
497
- if (!b.scrollBarVisible || b.maxScrollPosition <= 0) {
498
- const A = y(0, R), F = A - R;
499
- return { nextPosition: A, actualDelta: F, reachedBoundary: !0 };
496
+ const g = _t.current, M = X.current;
497
+ if (!g.scrollBarVisible || g.maxScrollPosition <= 0) {
498
+ const R = Vt(0, M), O = R - M;
499
+ return { nextPosition: R, actualDelta: O, reachedBoundary: !0 };
500
500
  }
501
501
  if (o === 0)
502
- return { nextPosition: R, actualDelta: 0, reachedBoundary: !1 };
503
- const X = y((A) => xt(A + o, 0, b.maxScrollPosition), R), a = X - R, u = o < 0 && R + o <= 0, p = o > 0 && R + o >= b.maxScrollPosition, V = o < 0 && (X <= 0 || u && a === 0) || o > 0 && (X >= b.maxScrollPosition || p && a === 0);
504
- return { nextPosition: X, actualDelta: a, reachedBoundary: V };
502
+ return { nextPosition: M, actualDelta: 0, reachedBoundary: !1 };
503
+ const H = Vt((R) => vt(R + o, 0, g.maxScrollPosition), M), St = H - M, l = o < 0 && M + o <= 0, u = o > 0 && M + o >= g.maxScrollPosition, h = o < 0 && (H <= 0 || l && St === 0) || o > 0 && (H >= g.maxScrollPosition || u && St === 0);
504
+ return { nextPosition: H, actualDelta: St, reachedBoundary: h };
505
505
  },
506
- [y]
507
- ), Lt = v(
508
- (o, b) => {
509
- o.current += b;
510
- const R = Math.max(lt.current.maxScrollPosition, 0);
511
- R > 0 && (o.current = xt(o.current, -R, R));
512
- const L = Nt(o.current);
506
+ [Vt]
507
+ ), w = S(
508
+ (o, g) => {
509
+ o.current += g;
510
+ const M = Math.max(_t.current.maxScrollPosition, 0);
511
+ M > 0 && (o.current = vt(o.current, -M, M));
512
+ const L = f(o.current);
513
513
  return o.current -= L.actualDelta, L.reachedBoundary && (o.current = 0), L;
514
514
  },
515
- [Nt]
516
- ), at = v(() => {
517
- G.current !== null && (window.cancelAnimationFrame(G.current), G.current = null), h.current = null, $.current = 0, Tt.current = 0;
518
- }, []), _t = v(() => {
519
- q.current = { ...Xe }, It(!1), et.current?.reset(), at();
520
- }, [at]), Ht = v(
515
+ [f]
516
+ ), at = S(() => {
517
+ K.current !== null && (window.cancelAnimationFrame(K.current), K.current = null), T.current = null, V.current = 0, Tt.current = 0;
518
+ }, []), gt = S(() => {
519
+ N.current = { ...$e }, Pt(!1), lt.current?.reset(), at();
520
+ }, [at]), wt = S(
521
521
  (o) => {
522
- const b = q.current, R = lt.current;
523
- if (!b.active || b.direction === 0) {
522
+ const g = N.current, M = _t.current;
523
+ if (!g.active || g.direction === 0) {
524
524
  at();
525
525
  return;
526
526
  }
527
- if (!R.scrollBarVisible || R.maxScrollPosition <= 0) {
527
+ if (!M.scrollBarVisible || M.maxScrollPosition <= 0) {
528
528
  at();
529
529
  return;
530
530
  }
531
- const L = h.current ?? o, X = Math.max((o - L) / 1e3, 0), a = Math.min(X, ur);
532
- if (h.current = o, a <= 0) {
533
- G.current = window.requestAnimationFrame(Ht);
531
+ const L = T.current ?? o, H = Math.max((o - L) / 1e3, 0), St = Math.min(H, dr);
532
+ if (T.current = o, St <= 0) {
533
+ K.current = window.requestAnimationFrame(wt);
534
534
  return;
535
535
  }
536
- const u = gr({
537
- distance: b.distance,
538
- maxDistance: R.effectiveTapMaxDistance,
539
- viewportSize: R.viewportSize,
540
- minSpeedMultiplier: R.tapCircleMinSpeedMultiplier,
541
- maxSpeedMultiplier: R.tapCircleMaxSpeedMultiplier,
542
- hasCustomMaxSpeedMultiplier: typeof R.tapScrollCircleOptions?.maxSpeedMultiplier == "number",
543
- curve: R.tapCircleMaxSpeedCurve
536
+ const l = br({
537
+ distance: g.distance,
538
+ maxDistance: M.effectiveTapMaxDistance,
539
+ viewportSize: M.viewportSize,
540
+ minSpeedMultiplier: M.tapCircleMinSpeedMultiplier,
541
+ maxSpeedMultiplier: M.tapCircleMaxSpeedMultiplier,
542
+ hasCustomMaxSpeedMultiplier: typeof M.tapScrollCircleOptions?.maxSpeedMultiplier == "number",
543
+ curve: M.tapCircleMaxSpeedCurve
544
544
  });
545
- Tt.current !== b.direction && (Tt.current = b.direction, $.current = 0);
546
- const { reachedBoundary: p } = Lt($, b.direction * u * a);
547
- if (p) {
545
+ Tt.current !== g.direction && (Tt.current = g.direction, V.current = 0);
546
+ const { reachedBoundary: u } = w(V, g.direction * l * St);
547
+ if (u) {
548
548
  at();
549
549
  return;
550
550
  }
551
- G.current = window.requestAnimationFrame(Ht);
551
+ K.current = window.requestAnimationFrame(wt);
552
552
  },
553
- [Lt, at]
554
- ), kt = v(() => {
555
- G.current === null && (h.current = null, $.current = 0, G.current = window.requestAnimationFrame(Ht));
556
- }, [Ht]);
557
- Y(() => {
558
- const o = q.current;
559
- !o.active || o.direction === 0 || kt();
560
- }, [n, t, kt]), Y(() => () => {
553
+ [w, at]
554
+ ), Qt = S(() => {
555
+ K.current === null && (T.current = null, V.current = 0, K.current = window.requestAnimationFrame(wt));
556
+ }, [wt]);
557
+ q(() => {
558
+ const o = N.current;
559
+ !o.active || o.direction === 0 || Qt();
560
+ }, [n, t, Qt]), q(() => () => {
561
561
  at();
562
562
  }, [at]);
563
- const jt = v(
563
+ const Ht = S(
564
564
  (o) => {
565
- q.current = o, It(o.active), o.active && o.direction !== 0 ? kt() : at();
565
+ N.current = o, Pt(o.active), o.active && o.direction !== 0 ? Qt() : at();
566
566
  },
567
- [kt, at]
567
+ [Qt, at]
568
568
  );
569
- Y(() => {
570
- k || _t();
571
- }, [_t, k]), Y(() => {
572
- const o = (b) => {
573
- const L = b.detail?.paneId;
574
- L && I && L !== I || _t();
569
+ q(() => {
570
+ J || gt();
571
+ }, [gt, J]), q(() => {
572
+ const o = (g) => {
573
+ const L = g.detail?.paneId;
574
+ L && x && L !== x || gt();
575
575
  };
576
- return window.addEventListener(ze, o), () => {
577
- window.removeEventListener(ze, o);
576
+ return window.addEventListener(Ye, o), () => {
577
+ window.removeEventListener(Ye, o);
578
578
  };
579
- }, [I, _t]), Y(() => {
580
- if (!k)
579
+ }, [x, gt]), q(() => {
580
+ if (!J)
581
581
  return;
582
- const o = (b) => {
583
- if (!q.current.active || q.current.pointerId === b.pointerId)
582
+ const o = (g) => {
583
+ if (!N.current.active || N.current.pointerId === g.pointerId)
584
584
  return;
585
- const R = b.target;
586
- if (!(R instanceof Node)) {
587
- _t();
585
+ const M = g.target;
586
+ if (!(M instanceof Node)) {
587
+ gt();
588
588
  return;
589
589
  }
590
- et.current?.getElement()?.contains(R) || _t();
590
+ lt.current?.getElement()?.contains(M) || gt();
591
591
  };
592
592
  return document.addEventListener("pointerdown", o, !0), () => {
593
593
  document.removeEventListener("pointerdown", o, !0);
594
594
  };
595
- }, [_t, k]);
596
- const ce = (o) => {
597
- if (!dt || Dt <= 0 || ot <= 0)
595
+ }, [gt, J]);
596
+ const Ut = (o) => {
597
+ if (!Nt || Q <= 0 || st <= 0)
598
598
  return 0;
599
- const b = xt(o, 0, Dt);
600
- return xt(b / Dt * ot, 0, ot);
601
- }, fe = v((o) => {
602
- const { scrollBarVisible: b, effectiveTrackLength: R, maxScrollPosition: L } = lt.current;
603
- if (C.debug("[ScrollBar] calculateScrollPositionFromThumb", () => ({ thumbPos: o, trackLen: R, maxScroll: L })), R <= 0 || L <= 0)
599
+ const g = vt(o, 0, Q);
600
+ return vt(g / Q * st, 0, st);
601
+ }, te = S((o) => {
602
+ const { scrollBarVisible: g, effectiveTrackLength: M, maxScrollPosition: L } = _t.current;
603
+ if (C.debug("[ScrollBar] calculateScrollPositionFromThumb", () => ({ thumbPos: o, trackLen: M, maxScroll: L })), M <= 0 || L <= 0)
604
604
  return null;
605
- const X = xt(o, 0, R);
606
- return xt(X / R * L, 0, L);
607
- }, []), Ie = v(
605
+ const H = vt(o, 0, M);
606
+ return vt(H / M * L, 0, L);
607
+ }, []), ce = S(
608
608
  (o) => {
609
- const b = o.getBoundingClientRect(), R = c ? b.width : b.height, L = (V) => {
610
- const A = Number.parseFloat(V);
611
- return Number.isFinite(A) ? A : 0;
612
- }, X = window.getComputedStyle(o), a = L(c ? X.width : X.height), u = a > 0 ? a + L(c ? X.paddingLeft : X.paddingTop) + L(c ? X.paddingRight : X.paddingBottom) + L(c ? X.borderLeftWidth : X.borderTopWidth) + L(c ? X.borderRightWidth : X.borderBottomWidth) : 0, p = u > 0 ? u : c ? o.offsetWidth : o.offsetHeight;
613
- return p <= 0 || R <= 0 ? 1 : R / p;
609
+ const g = o.getBoundingClientRect(), M = c ? g.width : g.height, L = (h) => {
610
+ const R = Number.parseFloat(h);
611
+ return Number.isFinite(R) ? R : 0;
612
+ }, H = window.getComputedStyle(o), St = L(c ? H.width : H.height), l = St > 0 ? St + L(c ? H.paddingLeft : H.paddingTop) + L(c ? H.paddingRight : H.paddingBottom) + L(c ? H.borderLeftWidth : H.borderTopWidth) + L(c ? H.borderRightWidth : H.borderBottomWidth) : 0, u = l > 0 ? l : c ? o.offsetWidth : o.offsetHeight;
613
+ return u <= 0 || M <= 0 ? 1 : M / u;
614
614
  },
615
615
  [c]
616
- ), rt = v(
616
+ ), ue = S(
617
617
  (o) => {
618
- const b = O.current;
619
- if (b.pointerId !== o.pointerId)
618
+ const g = k.current;
619
+ if (g.pointerId !== o.pointerId)
620
620
  return;
621
- const R = o.clientX - b.startClientX, L = o.clientY - b.startClientY, X = ct(R, L) / (b.scale || 1);
621
+ const M = o.clientX - g.startClientX, L = o.clientY - g.startClientY, H = p(M, L) / (g.scale || 1);
622
622
  C.debug("[ScrollBar] handleThumbPointerMove", () => ({
623
- delta: X,
624
- startThumbPosition: b.startThumbPosition,
623
+ delta: H,
624
+ startThumbPosition: g.startThumbPosition,
625
625
  clientY: o.clientY,
626
- startClientY: b.startClientY,
627
- metrics: lt.current
626
+ startClientY: g.startClientY,
627
+ metrics: _t.current
628
628
  }));
629
- const a = fe(b.startThumbPosition + X);
630
- a !== null && y(a), o.cancelable && o.preventDefault();
629
+ const St = te(g.startThumbPosition + H);
630
+ St !== null && Vt(St), o.cancelable && o.preventDefault();
631
631
  },
632
- [ct, fe, y]
633
- ), zt = v(
632
+ [p, te, Vt]
633
+ ), tt = S(
634
634
  (o) => {
635
- const b = O.current;
636
- if (b.pointerId !== o.pointerId)
635
+ const g = k.current;
636
+ if (g.pointerId !== o.pointerId)
637
637
  return;
638
- document.removeEventListener("pointermove", rt), document.removeEventListener("pointerup", zt), document.removeEventListener("pointercancel", zt);
639
- const R = b.captureTarget;
640
- if (R?.hasPointerCapture?.(o.pointerId) && R.releasePointerCapture(o.pointerId), O.current = { pointerId: null, startThumbPosition: 0, startClientX: 0, startClientY: 0, scale: 1, captureTarget: null }, ft(!1), D.current) {
638
+ document.removeEventListener("pointermove", ue), document.removeEventListener("pointerup", tt), document.removeEventListener("pointercancel", tt);
639
+ const M = g.captureTarget;
640
+ if (M?.hasPointerCapture?.(o.pointerId) && M.releasePointerCapture(o.pointerId), k.current = { pointerId: null, startThumbPosition: 0, startClientX: 0, startClientY: 0, scale: 1, captureTarget: null }, ut(!1), D.current) {
641
641
  const L = D.current.getBoundingClientRect();
642
- o.clientX >= L.left && o.clientX <= L.right && o.clientY >= L.top && o.clientY <= L.bottom || tt(!1);
642
+ o.clientX >= L.left && o.clientX <= L.right && o.clientY >= L.top && o.clientY <= L.bottom || nt(!1);
643
643
  } else
644
- tt(!1);
644
+ nt(!1);
645
645
  },
646
- [rt]
646
+ [ue]
647
647
  );
648
- Y(() => () => {
649
- document.removeEventListener("pointermove", rt), document.removeEventListener("pointerup", zt), document.removeEventListener("pointercancel", zt);
650
- }, [rt, zt]);
651
- const Te = T(0), Se = T(0), Kt = v(
648
+ q(() => () => {
649
+ document.removeEventListener("pointermove", ue), document.removeEventListener("pointerup", tt), document.removeEventListener("pointercancel", tt);
650
+ }, [ue, tt]);
651
+ const ee = I(0), Se = I(0), we = S(
652
652
  (o) => {
653
- const b = Math.max(Math.round(lt.current.viewportSize / or), sr);
654
- Se.current !== o && (Se.current = o, Te.current = 0), Lt(Te, o * b);
653
+ const g = Math.max(Math.round(_t.current.viewportSize / ar), or);
654
+ Se.current !== o && (Se.current = o, ee.current = 0), w(ee, o * g);
655
655
  },
656
- [Lt]
657
- ), { handleArrowPointerDown: ye, handleArrowPointerUp: me, handleArrowKeyDown: Ae } = pr({
658
- canUseArrowButtons: Qt,
659
- enableArrowButtons: l,
660
- resetTapScroll: _t,
661
- scrollByStep: Kt
662
- }), te = (o) => {
663
- if (!dt)
656
+ [w]
657
+ ), { handleArrowPointerDown: Wt, handleArrowPointerUp: ge, handleArrowKeyDown: Re } = hr({
658
+ canUseArrowButtons: $t,
659
+ enableArrowButtons: a,
660
+ resetTapScroll: gt,
661
+ scrollByStep: we
662
+ }), De = (o) => {
663
+ if (!Nt)
664
664
  return;
665
665
  if (!i) {
666
666
  o.preventDefault(), o.stopPropagation();
@@ -668,25 +668,25 @@ const xt = (n, t, e) => Math.max(t, Math.min(e, n)), ze = "virtualscroll:tap-scr
668
668
  }
669
669
  if (o.pointerType === "mouse" && o.button !== 0 || o.ctrlKey)
670
670
  return;
671
- _t();
672
- const b = o.currentTarget, R = Ie(b);
671
+ gt();
672
+ const g = o.currentTarget, M = ce(g);
673
673
  let L = null;
674
- if (b.setPointerCapture)
674
+ if (g.setPointerCapture)
675
675
  try {
676
- b.setPointerCapture(o.pointerId), L = b;
676
+ g.setPointerCapture(o.pointerId), L = g;
677
677
  } catch {
678
678
  L = null;
679
679
  }
680
- O.current = {
680
+ k.current = {
681
681
  pointerId: o.pointerId,
682
682
  startThumbPosition: qt,
683
683
  startClientX: o.clientX,
684
684
  startClientY: o.clientY,
685
- scale: R,
685
+ scale: M,
686
686
  captureTarget: L
687
- }, document.addEventListener("pointermove", rt), document.addEventListener("pointerup", zt), document.addEventListener("pointercancel", zt), ft(!0), tt(!0), o.preventDefault(), o.stopPropagation();
688
- }, ie = (o) => {
689
- if (!dt)
687
+ }, document.addEventListener("pointermove", ue), document.addEventListener("pointerup", tt), document.addEventListener("pointercancel", tt), ut(!0), nt(!0), o.preventDefault(), o.stopPropagation();
688
+ }, re = (o) => {
689
+ if (!Nt)
690
690
  return;
691
691
  if (!s) {
692
692
  o.preventDefault(), o.stopPropagation();
@@ -694,166 +694,166 @@ const xt = (n, t, e) => Math.max(t, Math.min(e, n)), ze = "virtualscroll:tap-scr
694
694
  }
695
695
  if (o.pointerType === "mouse" && o.button !== 0 || o.ctrlKey)
696
696
  return;
697
- const b = o.currentTarget, R = b.getBoundingClientRect(), L = H(o), X = Ie(b), a = (L - (c ? R.left : R.top)) / X;
698
- _t();
699
- const u = a - ut / 2, p = ce(u);
700
- if (y(p), b.setPointerCapture)
697
+ const g = o.currentTarget, M = g.getBoundingClientRect(), L = ft(o), H = ce(g), St = (L - (c ? M.left : M.top)) / H;
698
+ gt();
699
+ const l = St - ht / 2, u = Ut(l);
700
+ if (Vt(u), g.setPointerCapture)
701
701
  try {
702
- b.setPointerCapture(o.pointerId);
702
+ g.setPointerCapture(o.pointerId);
703
703
  } catch {
704
704
  }
705
- M.current = {
705
+ P.current = {
706
706
  pointerId: o.pointerId,
707
- startThumbPosition: u,
707
+ startThumbPosition: l,
708
708
  startClientX: o.clientX,
709
709
  startClientY: o.clientY,
710
- scale: X
710
+ scale: H
711
711
  }, o.preventDefault(), o.stopPropagation();
712
- }, Ut = () => {
713
- M.current = { pointerId: null, startThumbPosition: 0, startClientX: 0, startClientY: 0, scale: 1 };
714
- }, ee = (o) => {
715
- const b = M.current;
716
- if (b.pointerId !== o.pointerId)
712
+ }, jt = () => {
713
+ P.current = { pointerId: null, startThumbPosition: 0, startClientX: 0, startClientY: 0, scale: 1 };
714
+ }, ne = (o) => {
715
+ const g = P.current;
716
+ if (g.pointerId !== o.pointerId)
717
717
  return;
718
718
  if (o.pointerType === "mouse" && o.buttons === 0) {
719
- Ut();
719
+ jt();
720
720
  return;
721
721
  }
722
- const R = o.clientX - b.startClientX, L = o.clientY - b.startClientY, X = ct(R, L) / (b.scale || 1), a = ce(b.startThumbPosition + X);
723
- y(a), o.cancelable && o.preventDefault();
724
- }, se = (o) => {
725
- if (M.current.pointerId !== o.pointerId)
722
+ const M = o.clientX - g.startClientX, L = o.clientY - g.startClientY, H = p(M, L) / (g.scale || 1), St = Ut(g.startThumbPosition + H);
723
+ Vt(St), o.cancelable && o.preventDefault();
724
+ }, ie = (o) => {
725
+ if (P.current.pointerId !== o.pointerId)
726
726
  return;
727
- const b = o.currentTarget;
728
- b.hasPointerCapture?.(o.pointerId) && b.releasePointerCapture(o.pointerId), Ut(), o.preventDefault(), o.stopPropagation();
729
- }, pe = (o) => {
730
- if (M.current.pointerId !== o.pointerId)
727
+ const g = o.currentTarget;
728
+ g.hasPointerCapture?.(o.pointerId) && g.releasePointerCapture(o.pointerId), jt(), o.preventDefault(), o.stopPropagation();
729
+ }, de = (o) => {
730
+ if (P.current.pointerId !== o.pointerId)
731
731
  return;
732
- const b = o.currentTarget;
733
- b.hasPointerCapture?.(o.pointerId) && b.releasePointerCapture(o.pointerId), Ut();
734
- }, re = (o) => {
735
- o.target === o.currentTarget && M.current.pointerId === o.pointerId && Ut();
736
- }, we = At(() => xt((pt ? 1 : 0.8) * $t, 0, 1), [pt, $t]), Re = At(() => {
737
- const b = `calc(50% - ${Rt / 2}px + ${Ct}px)`;
732
+ const g = o.currentTarget;
733
+ g.hasPointerCapture?.(o.pointerId) && g.releasePointerCapture(o.pointerId), jt();
734
+ }, be = (o) => {
735
+ o.target === o.currentTarget && P.current.pointerId === o.pointerId && jt();
736
+ }, se = Lt(() => vt((pt ? 1 : 0.8) * A, 0, 1), [pt, A]), Ce = Lt(() => {
737
+ const g = `calc(50% - ${F / 2}px + ${W}px)`;
738
738
  return {
739
- left: U,
740
- top: b
739
+ left: Ct,
740
+ top: g
741
741
  };
742
- }, [U, Ct, Rt]), Ce = (o, b, R, L) => /* @__PURE__ */ it(
742
+ }, [Ct, W, F]), ve = (o, g, M, L) => /* @__PURE__ */ ot(
743
743
  "button",
744
744
  {
745
745
  type: "button",
746
746
  tabIndex: 0,
747
747
  className: "aqvs-scrollbar-arrow-button",
748
748
  style: {
749
- [Wt]: f,
750
- [d]: f
749
+ [Et]: d,
750
+ [Xt]: d
751
751
  },
752
- "aria-label": b,
753
- onPointerDown: ye(o),
754
- onPointerUp: me,
755
- onPointerLeave: me,
756
- onPointerCancel: me,
757
- onKeyDown: Ae(o),
758
- "aria-disabled": !l,
759
- disabled: !Qt,
760
- children: /* @__PURE__ */ it("span", { "aria-hidden": "true", children: R })
752
+ "aria-label": g,
753
+ onPointerDown: Wt(o),
754
+ onPointerUp: ge,
755
+ onPointerLeave: ge,
756
+ onPointerCancel: ge,
757
+ onKeyDown: Re(o),
758
+ "aria-disabled": !a,
759
+ disabled: !$t,
760
+ children: /* @__PURE__ */ ot("span", { "aria-hidden": "true", children: M })
761
761
  },
762
762
  L
763
- ), he = g && dt ? {
764
- orientation: Mt,
763
+ ), Ee = m && Nt ? {
764
+ orientation: ct,
765
765
  scrollPosition: e,
766
- maxScrollPosition: ot,
766
+ maxScrollPosition: st,
767
767
  contentSize: n,
768
768
  viewportSize: t,
769
- thumbSize: ut,
769
+ thumbSize: ht,
770
770
  thumbPosition: qt,
771
771
  thumbCenter: le,
772
- trackSize: St,
773
- isDragging: j,
772
+ trackSize: Mt,
773
+ isDragging: Z,
774
774
  isTapScrollActive: pt,
775
775
  visibleStartIndex: _,
776
- visibleEndIndex: z
776
+ visibleEndIndex: B
777
777
  } : null;
778
- return /* @__PURE__ */ de(
778
+ return /* @__PURE__ */ he(
779
779
  "div",
780
780
  {
781
- className: ue("aqvs-scrollbar", Pt, !dt && "pointer-events-none opacity-0", x),
781
+ className: pe("aqvs-scrollbar", et, !Nt && "pointer-events-none opacity-0", b),
782
782
  style: {
783
- [Wt]: t,
784
- [d]: f
783
+ [Et]: t,
784
+ [Xt]: d
785
785
  },
786
786
  role: "scrollbar",
787
787
  tabIndex: -1,
788
- "aria-controls": I,
788
+ "aria-controls": x,
789
789
  "aria-valuenow": e,
790
790
  "aria-valuemin": 0,
791
- "aria-valuemax": ot,
791
+ "aria-valuemax": st,
792
792
  "aria-orientation": c ? "horizontal" : "vertical",
793
793
  children: [
794
- !c && dt && k && /* @__PURE__ */ it(
795
- Ge,
794
+ !c && Nt && J && /* @__PURE__ */ ot(
795
+ Ze,
796
796
  {
797
- ref: et,
798
- className: ue("aqvs-scrollbar-tap-circle-wrapper", w),
799
- size: Rt,
800
- maxVisualDistance: Et,
801
- style: Re,
802
- opacity: we,
803
- renderVisual: Bt,
804
- onDragChange: jt
797
+ ref: lt,
798
+ className: pe("aqvs-scrollbar-tap-circle-wrapper", At),
799
+ size: F,
800
+ maxVisualDistance: kt,
801
+ style: Ce,
802
+ opacity: se,
803
+ renderVisual: j,
804
+ onDragChange: Ht
805
805
  },
806
806
  "tap-circle"
807
807
  ),
808
- Ce(-1, nt[0], J[0], "arrow-start"),
809
- /* @__PURE__ */ de(
808
+ ve(-1, mt[0], z[0], "arrow-start"),
809
+ /* @__PURE__ */ he(
810
810
  "div",
811
811
  {
812
812
  className: "aqvs-scrollbar-track",
813
813
  style: {
814
- borderRadius: f / 2
814
+ borderRadius: d / 2
815
815
  },
816
- onPointerDown: ie,
817
- onPointerMove: ee,
818
- onPointerUp: se,
819
- onPointerCancel: pe,
820
- onLostPointerCapture: re,
816
+ onPointerDown: re,
817
+ onPointerMove: ne,
818
+ onPointerUp: ie,
819
+ onPointerCancel: de,
820
+ onLostPointerCapture: be,
821
821
  "aria-disabled": !s,
822
822
  children: [
823
- he && /* @__PURE__ */ it("div", { className: "aqvs-scrollbar-overlay", "aria-hidden": !0, children: g?.(he) }, "overlay"),
824
- /* @__PURE__ */ it(
823
+ Ee && /* @__PURE__ */ ot("div", { className: "aqvs-scrollbar-overlay", "aria-hidden": !0, children: m?.(Ee) }, "overlay"),
824
+ /* @__PURE__ */ ot(
825
825
  "div",
826
826
  {
827
- className: ue("aqvs-scrollbar-thumb-wrapper", !(dt || j) && "pointer-events-none opacity-0"),
827
+ className: pe("aqvs-scrollbar-thumb-wrapper", !(Nt || Z) && "pointer-events-none opacity-0"),
828
828
  style: {
829
- [Wt]: ut,
830
- [mt]: qt,
829
+ [Et]: ht,
830
+ [dt]: qt,
831
831
  ...c ? { top: 0, bottom: 0 } : { left: 0, right: 0 }
832
832
  },
833
- onPointerDown: te,
833
+ onPointerDown: De,
834
834
  role: "slider",
835
835
  "aria-orientation": c ? "horizontal" : "vertical",
836
836
  "aria-valuenow": e,
837
837
  "aria-valuemin": 0,
838
- "aria-valuemax": ot,
838
+ "aria-valuemax": st,
839
839
  "aria-disabled": !i,
840
840
  tabIndex: -1,
841
- children: /* @__PURE__ */ it(
841
+ children: /* @__PURE__ */ ot(
842
842
  "div",
843
843
  {
844
844
  ref: D,
845
- className: ue("aqvs-scrollbar-thumb", c ? "aqvs-scrollbar-thumb-horizontal" : "aqvs-scrollbar-thumb-vertical"),
845
+ className: pe("aqvs-scrollbar-thumb", c ? "aqvs-scrollbar-thumb-horizontal" : "aqvs-scrollbar-thumb-vertical"),
846
846
  "data-testid": "aqvs-scrollbar-thumb",
847
- "data-thumb-state": m,
847
+ "data-thumb-state": Gt,
848
848
  style: {
849
- borderRadius: f - 1,
849
+ borderRadius: d - 1,
850
850
  cursor: i ? "pointer" : "default"
851
851
  },
852
852
  onMouseEnter: () => {
853
- i && tt(!0);
853
+ i && nt(!0);
854
854
  },
855
855
  onMouseLeave: () => {
856
- i && tt(!1);
856
+ i && nt(!1);
857
857
  }
858
858
  },
859
859
  "thumb"
@@ -865,20 +865,20 @@ const xt = (n, t, e) => Math.max(t, Math.min(e, n)), ze = "virtualscroll:tap-scr
865
865
  },
866
866
  "track"
867
867
  ),
868
- Ce(1, nt[1], J[1], "arrow-end")
868
+ ve(1, mt[1], z[1], "arrow-end")
869
869
  ]
870
870
  }
871
871
  );
872
- }, Ir = ["mouse", "pen", "touch"], ke = (n, t) => !(n === "mouse" || n === "pen" || n === "touch") || t.includes(n), Tr = (n) => n === "mouse" || n === "pen", Pe = {
872
+ }, Tr = ["mouse", "pen", "touch"], Oe = (n, t) => !(n === "mouse" || n === "pen" || n === "touch") || t.includes(n), Sr = (n) => n === "mouse" || n === "pen", Me = {
873
873
  maxVelocity: 6,
874
874
  minVelocity: 0.02,
875
875
  deceleration: 25e-4,
876
876
  velocitySampleWindow: 90,
877
877
  startVelocityThreshold: 0.04
878
- }, Ee = (n, t, e) => {
878
+ }, Ne = (n, t, e) => {
879
879
  for (const [r, i, s] of t)
880
880
  e === "add" ? n.addEventListener(r, i, s) : n.removeEventListener(r, i, s);
881
- }, Sr = Ye(
881
+ }, vr = Be(
882
882
  ({
883
883
  children: n,
884
884
  contentSize: t,
@@ -886,45 +886,46 @@ const xt = (n, t, e) => Math.max(t, Math.min(e, n)), ze = "virtualscroll:tap-scr
886
886
  scrollBarWidth: r = 12,
887
887
  enableThumbDrag: i = !0,
888
888
  enableTrackClick: s = !0,
889
- enableArrowButtons: l = !0,
889
+ enableArrowButtons: a = !0,
890
890
  enablePointerDrag: c = !0,
891
- pointerDragInputs: f = Ir,
892
- onScroll: x,
893
- className: I,
894
- testId: P,
891
+ pointerDragInputs: d = Tr,
892
+ onScroll: b,
893
+ className: x,
894
+ testId: v,
895
895
  style: E,
896
- background: g,
896
+ background: m,
897
897
  tapScrollCircleOptions: _,
898
- inertiaOptions: z,
899
- itemCount: j,
900
- renderThumbOverlay: ft,
901
- wheelSpeedMultiplier: Q = 1,
902
- onWheelHorizontal: tt,
898
+ inertiaOptions: B,
899
+ itemCount: Z,
900
+ renderThumbOverlay: ut,
901
+ wheelSpeedMultiplier: rt = 1,
902
+ onWheelHorizontal: nt,
903
903
  contentInsets: pt,
904
- visibleStartIndex: It,
904
+ visibleStartIndex: Pt,
905
905
  visibleEndIndex: D,
906
- renderOverlay: O,
907
- initialScrollPosition: M = 0
908
- }, B) => {
909
- const N = T(Number.isFinite(M) ? Math.max(0, M) : 0), q = T(null), et = T(null), G = T(tt);
910
- Y(() => {
911
- G.current = tt;
912
- }, [tt]);
913
- const h = T({
906
+ renderOverlay: k,
907
+ initialScrollPosition: P = 0,
908
+ contentProps: X
909
+ }, $) => {
910
+ const N = I(Number.isFinite(P) ? Math.max(0, P) : 0), lt = I(null), K = I(null), T = I(nt);
911
+ q(() => {
912
+ T.current = nt;
913
+ }, [nt]);
914
+ const V = I({
914
915
  frame: null,
915
916
  velocity: 0,
916
917
  lastTimestamp: null,
917
918
  generation: 0
918
- }), $ = At(
919
+ }), Tt = Lt(
919
920
  () => ({
920
- maxVelocity: z?.maxVelocity ?? Pe.maxVelocity,
921
- minVelocity: z?.minVelocity ?? Pe.minVelocity,
922
- deceleration: z?.deceleration ?? Pe.deceleration,
923
- velocitySampleWindow: z?.velocitySampleWindow ?? Pe.velocitySampleWindow,
924
- startVelocityThreshold: z?.startVelocityThreshold ?? Pe.startVelocityThreshold
921
+ maxVelocity: B?.maxVelocity ?? Me.maxVelocity,
922
+ minVelocity: B?.minVelocity ?? Me.minVelocity,
923
+ deceleration: B?.deceleration ?? Me.deceleration,
924
+ velocitySampleWindow: B?.velocitySampleWindow ?? Me.velocitySampleWindow,
925
+ startVelocityThreshold: B?.startVelocityThreshold ?? Me.startVelocityThreshold
925
926
  }),
926
- [z]
927
- ), Tt = At(() => ({
927
+ [B]
928
+ ), Yt = Lt(() => ({
928
929
  top: Math.max(0, pt?.top ?? 0),
929
930
  bottom: Math.max(0, pt?.bottom ?? 0)
930
931
  }), [pt]);
@@ -932,134 +933,134 @@ const xt = (n, t, e) => Math.max(t, Math.min(e, n)), ze = "virtualscroll:tap-scr
932
933
  contentSize: t,
933
934
  viewportSize: e,
934
935
  scrollBarWidth: r,
935
- className: I,
936
+ className: x,
936
937
  style: E,
937
938
  tapScrollCircleOptions: _,
938
- inertiaOptions: z,
939
+ inertiaOptions: B,
939
940
  enablePointerDrag: c,
940
- contentInsets: Tt
941
+ contentInsets: Yt
941
942
  }));
942
- const wt = T({ contentSize: t, viewportSize: e });
943
- wt.current = { contentSize: t, viewportSize: e };
944
- const Z = At(() => t > e, [t, e]), k = v(
945
- (d) => {
946
- const { contentSize: mt, viewportSize: ct } = wt.current, H = mt > ct, nt = N.current;
947
- if (C.debug("[ScrollPane] scrollTo called", () => ({ newPosition: d, contentSize: mt, viewportSize: ct, currentIsScrollable: H, prevPosition: nt })), !H)
948
- return N.current !== 0 && (N.current = 0, x?.(0, nt)), N.current;
949
- const J = typeof d == "function" ? d(N.current) : d;
950
- if (!Number.isFinite(J))
951
- return C.warn("[ScrollPane] scrollTo received a non-finite position; keeping the current position", { nextPosition: J }), N.current;
952
- const Pt = Math.max(mt - ct, 0), Mt = xt(J, 0, Pt);
953
- return N.current !== Mt && (N.current = Mt, x?.(Mt, nt)), N.current;
943
+ const yt = I({ contentSize: t, viewportSize: e });
944
+ yt.current = { contentSize: t, viewportSize: e };
945
+ const J = Lt(() => t > e, [t, e]), F = S(
946
+ (p) => {
947
+ const { contentSize: ft, viewportSize: mt } = yt.current, z = ft > mt, et = N.current;
948
+ if (C.debug("[ScrollPane] scrollTo called", () => ({ newPosition: p, contentSize: ft, viewportSize: mt, currentIsScrollable: z, prevPosition: et })), !z)
949
+ return N.current !== 0 && (N.current = 0, b?.(0, et)), N.current;
950
+ const ct = typeof p == "function" ? p(N.current) : p;
951
+ if (!Number.isFinite(ct))
952
+ return C.warn("[ScrollPane] scrollTo received a non-finite position; keeping the current position", { nextPosition: ct }), N.current;
953
+ const kt = Math.max(ft - mt, 0), Ot = vt(ct, 0, kt);
954
+ return N.current !== Ot && (N.current = Ot, b?.(Ot, et)), N.current;
954
955
  },
955
- [x]
956
- ), Rt = T(k);
957
- Y(() => {
958
- Rt.current = k;
959
- }, [k]);
960
- const U = v(() => {
961
- const d = h.current;
962
- d.generation += 1, d.frame !== null && cancelAnimationFrame(d.frame), d.frame = null, d.velocity = 0, d.lastTimestamp = null;
963
- }, []), Ct = T(U);
964
- Y(() => {
965
- Ct.current = U;
966
- }, [U]), Y(() => () => {
967
- Ct.current();
956
+ [b]
957
+ ), Ct = I(F);
958
+ q(() => {
959
+ Ct.current = F;
960
+ }, [F]);
961
+ const W = S(() => {
962
+ const p = V.current;
963
+ p.generation += 1, p.frame !== null && cancelAnimationFrame(p.frame), p.frame = null, p.velocity = 0, p.lastTimestamp = null;
964
+ }, []), At = I(W);
965
+ q(() => {
966
+ At.current = W;
967
+ }, [W]), q(() => () => {
968
+ At.current();
968
969
  }, []);
969
- const w = v(
970
- (d) => {
971
- if (!Z)
970
+ const y = S(
971
+ (p) => {
972
+ if (!J)
972
973
  return;
973
- const { maxVelocity: mt, minVelocity: ct, deceleration: H, startVelocityThreshold: nt } = $, J = xt(d, -mt, mt);
974
- if (Math.abs(J) < nt)
974
+ const { maxVelocity: ft, minVelocity: mt, deceleration: z, startVelocityThreshold: et } = Tt, ct = vt(p, -ft, ft);
975
+ if (Math.abs(ct) < et)
975
976
  return;
976
- U(), h.current.velocity = J, h.current.lastTimestamp = null;
977
- const Pt = h.current.generation, Mt = (Et) => {
978
- const st = h.current;
979
- if (st.generation !== Pt)
977
+ W(), V.current.velocity = ct, V.current.lastTimestamp = null;
978
+ const kt = V.current.generation, Ot = (Mt) => {
979
+ const it = V.current;
980
+ if (it.generation !== kt)
980
981
  return;
981
- if (st.lastTimestamp === null) {
982
- st.lastTimestamp = Et, st.frame = requestAnimationFrame(Mt);
982
+ if (it.lastTimestamp === null) {
983
+ it.lastTimestamp = Mt, it.frame = requestAnimationFrame(Ot);
983
984
  return;
984
985
  }
985
- const St = Et - st.lastTimestamp;
986
- if (st.lastTimestamp = Et, St <= 0) {
987
- st.frame = requestAnimationFrame(Mt);
986
+ const ht = Mt - it.lastTimestamp;
987
+ if (it.lastTimestamp = Mt, ht <= 0) {
988
+ it.frame = requestAnimationFrame(Ot);
988
989
  return;
989
990
  }
990
- const yt = st.velocity;
991
- let ut = yt;
992
- const ot = H * St;
993
- yt > 0 ? ut = Math.max(0, yt - ot) : yt < 0 && (ut = Math.min(0, yt + ot));
994
- const qt = (yt + ut) / 2 * St, le = N.current;
995
- if (qt !== 0 && Rt.current((Lt) => Lt + qt), h.current.generation !== Pt)
991
+ const st = it.velocity;
992
+ let Q = st;
993
+ const qt = z * ht;
994
+ st > 0 ? Q = Math.max(0, st - qt) : st < 0 && (Q = Math.min(0, st + qt));
995
+ const Nt = (st + Q) / 2 * ht, $t = N.current;
996
+ if (Nt !== 0 && Ct.current((gt) => gt + Nt), V.current.generation !== kt)
996
997
  return;
997
- const dt = N.current, { contentSize: Qt, viewportSize: m } = wt.current, y = Math.max(Qt - m, 0);
998
- st.velocity = ut;
999
- const Nt = dt === le || dt <= 0 && ut <= 0 || dt >= y && ut >= 0;
1000
- if (Math.abs(ut) < ct || Nt) {
1001
- U();
998
+ const Gt = N.current, { contentSize: Vt, viewportSize: f } = yt.current, w = Math.max(Vt - f, 0);
999
+ it.velocity = Q;
1000
+ const at = Gt === $t || Gt <= 0 && Q <= 0 || Gt >= w && Q >= 0;
1001
+ if (Math.abs(Q) < mt || at) {
1002
+ W();
1002
1003
  return;
1003
1004
  }
1004
- st.frame = requestAnimationFrame(Mt);
1005
+ it.frame = requestAnimationFrame(Ot);
1005
1006
  };
1006
- h.current.frame = requestAnimationFrame(Mt);
1007
+ V.current.frame = requestAnimationFrame(Ot);
1007
1008
  },
1008
- [Z, $, U]
1009
- ), Yt = T(w);
1010
- Y(() => {
1011
- Yt.current = w;
1012
- }, [w]), xe(() => {
1013
- wt.current = { contentSize: t, viewportSize: e };
1014
- }, [t, e]), xe(() => {
1015
- const d = et.current;
1016
- if (!d) return;
1017
- const mt = () => {
1018
- d.scrollTop !== 0 && (C.debug("[ScrollPane] Native scroll detected, resetting to 0", () => ({ scrollTop: d.scrollTop })), d.scrollTop = 0), d.scrollLeft !== 0 && (d.scrollLeft = 0);
1009
+ [J, Tt, W]
1010
+ ), Kt = I(y);
1011
+ q(() => {
1012
+ Kt.current = y;
1013
+ }, [y]), Te(() => {
1014
+ yt.current = { contentSize: t, viewportSize: e };
1015
+ }, [t, e]), Te(() => {
1016
+ const p = K.current;
1017
+ if (!p) return;
1018
+ const ft = () => {
1019
+ p.scrollTop !== 0 && (C.debug("[ScrollPane] Native scroll detected, resetting to 0", () => ({ scrollTop: p.scrollTop })), p.scrollTop = 0), p.scrollLeft !== 0 && (p.scrollLeft = 0);
1019
1020
  };
1020
- return d.addEventListener("scroll", mt), () => d.removeEventListener("scroll", mt);
1021
- }, []), xe(() => {
1022
- if (Z) {
1021
+ return p.addEventListener("scroll", ft), () => p.removeEventListener("scroll", ft);
1022
+ }, []), Te(() => {
1023
+ if (J) {
1023
1024
  C.debug("[ScrollPane] Adjusting scroll position due to content or viewport size change", () => ({ contentSize: t, viewportSize: e, scrollPosition: N.current }));
1024
- const d = xt(t - e, 0, t);
1025
- N.current > d && k(d);
1025
+ const p = vt(t - e, 0, t);
1026
+ N.current > p && F(p);
1026
1027
  } else
1027
- k(0);
1028
- }, [Z, k, t, e]), Y(() => {
1029
- const d = (H) => {
1030
- if (H.ctrlKey)
1028
+ F(0);
1029
+ }, [J, F, t, e]), q(() => {
1030
+ const p = (z) => {
1031
+ if (z.ctrlKey)
1031
1032
  return;
1032
- const nt = H.shiftKey && H.deltaX === 0, J = nt ? H.deltaY : H.deltaX, Pt = nt ? 0 : H.deltaY;
1033
- if (J !== 0 && Math.abs(J) >= Math.abs(Pt)) {
1034
- if (G.current) {
1035
- H.preventDefault(), U();
1036
- let st = J;
1037
- H.deltaMode === 1 ? st *= 16 : H.deltaMode === 2 && (st *= e), G.current(st);
1033
+ const et = z.shiftKey && z.deltaX === 0, ct = et ? z.deltaY : z.deltaX, kt = et ? 0 : z.deltaY;
1034
+ if (ct !== 0 && Math.abs(ct) >= Math.abs(kt)) {
1035
+ if (T.current) {
1036
+ z.preventDefault(), W();
1037
+ let it = ct;
1038
+ z.deltaMode === 1 ? it *= 16 : z.deltaMode === 2 && (it *= e), T.current(it);
1038
1039
  }
1039
1040
  return;
1040
1041
  }
1041
- if (!Z || H.deltaY === 0)
1042
+ if (!J || z.deltaY === 0)
1042
1043
  return;
1043
- H.preventDefault(), U();
1044
- let Et = H.deltaY;
1045
- H.deltaMode === 1 ? Et *= 16 : H.deltaMode === 2 && (Et *= e), Q !== 1 && (Et *= Q), C.debug("[ScrollPane] wheel event", () => ({ deltaY: Et, scrollPosition: N.current, wheelSpeedMultiplier: Q, deltaMode: H.deltaMode, scrollTop: et.current?.scrollTop })), k((st) => st + Et);
1046
- }, mt = () => {
1047
- U();
1048
- }, ct = q.current;
1049
- return ct && (ct.addEventListener("wheel", d, { passive: !1 }), ct.addEventListener("pointerdown", mt, { capture: !0, passive: !0 })), () => {
1050
- ct && (ct.removeEventListener("wheel", d), ct.removeEventListener("pointerdown", mt, { capture: !0 }));
1044
+ z.preventDefault(), W();
1045
+ let Mt = z.deltaY;
1046
+ z.deltaMode === 1 ? Mt *= 16 : z.deltaMode === 2 && (Mt *= e), rt !== 1 && (Mt *= rt), C.debug("[ScrollPane] wheel event", () => ({ deltaY: Mt, scrollPosition: N.current, wheelSpeedMultiplier: rt, deltaMode: z.deltaMode, scrollTop: K.current?.scrollTop })), F((it) => it + Mt);
1047
+ }, ft = () => {
1048
+ W();
1049
+ }, mt = lt.current;
1050
+ return mt && (mt.addEventListener("wheel", p, { passive: !1 }), mt.addEventListener("pointerdown", ft, { capture: !0, passive: !0 })), () => {
1051
+ mt && (mt.removeEventListener("wheel", p), mt.removeEventListener("pointerdown", ft, { capture: !0 }));
1051
1052
  };
1052
- }, [Z, k, U, e, Q]), Be(
1053
- B,
1053
+ }, [J, F, W, e, rt]), qe(
1054
+ $,
1054
1055
  () => ({
1055
- scrollTo: (d) => (U(), k(d)),
1056
+ scrollTo: (p) => (W(), F(p)),
1056
1057
  getScrollPosition: () => N.current,
1057
1058
  getContentSize: () => t,
1058
1059
  getViewportSize: () => e
1059
1060
  }),
1060
- [k, t, e, U]
1061
+ [F, t, e, W]
1061
1062
  );
1062
- const Xt = tr(), S = T({
1063
+ const ae = er(), A = X?.id ?? ae, j = I({
1063
1064
  pointerType: "",
1064
1065
  pointerId: null,
1065
1066
  startClientY: 0,
@@ -1068,147 +1069,147 @@ const xt = (n, t, e) => Math.max(t, Math.min(e, n)), ze = "virtualscroll:tap-scr
1068
1069
  shouldCancelNextClick: !1,
1069
1070
  clickResetTimer: null,
1070
1071
  velocitySamples: []
1071
- }), $t = T(c), Bt = T(f);
1072
- Y(() => {
1073
- $t.current = c;
1074
- }, [c]), Y(() => {
1075
- Bt.current = f;
1076
- }, [f]);
1077
- const Jt = T(Z);
1078
- Y(() => {
1079
- Jt.current = Z;
1080
- }, [Z]);
1081
- const lt = T($);
1082
- Y(() => {
1083
- lt.current = $;
1084
- }, [$]), Y(() => {
1085
- const d = S.current;
1086
- if (c && Z && (d.pointerId === null || ke(d.pointerType, f)) || d.pointerId === null)
1072
+ }), Bt = I(c), _t = I(d);
1073
+ q(() => {
1074
+ Bt.current = c;
1075
+ }, [c]), q(() => {
1076
+ _t.current = d;
1077
+ }, [d]);
1078
+ const Et = I(J);
1079
+ q(() => {
1080
+ Et.current = J;
1081
+ }, [J]);
1082
+ const Xt = I(Tt);
1083
+ q(() => {
1084
+ Xt.current = Tt;
1085
+ }, [Tt]), q(() => {
1086
+ const p = j.current;
1087
+ if (c && J && (p.pointerId === null || Oe(p.pointerType, d)) || p.pointerId === null)
1087
1088
  return;
1088
- const mt = et.current;
1089
- d.clickResetTimer !== null && (window.clearTimeout(d.clickResetTimer), d.clickResetTimer = null);
1090
- const ct = d.isDragging && d.shouldCancelNextClick, H = d.pointerId;
1091
- d.pointerId = null, d.pointerType = "", d.startClientY = 0, d.startScroll = 0, d.isDragging = !1, d.shouldCancelNextClick = ct, d.velocitySamples = [], mt?.hasPointerCapture(H) && mt.releasePointerCapture(H);
1092
- }, [c, f, Z]), Y(() => {
1093
- const d = et.current;
1094
- if (!d)
1089
+ const ft = K.current;
1090
+ p.clickResetTimer !== null && (window.clearTimeout(p.clickResetTimer), p.clickResetTimer = null);
1091
+ const mt = p.isDragging && p.shouldCancelNextClick, z = p.pointerId;
1092
+ p.pointerId = null, p.pointerType = "", p.startClientY = 0, p.startScroll = 0, p.isDragging = !1, p.shouldCancelNextClick = mt, p.velocitySamples = [], ft?.hasPointerCapture(z) && ft.releasePointerCapture(z);
1093
+ }, [c, d, J]), q(() => {
1094
+ const p = K.current;
1095
+ if (!p)
1095
1096
  return;
1096
- const mt = 6, ct = () => typeof performance < "u" && typeof performance.now == "function" ? performance.now() : Date.now(), H = () => {
1097
- const m = S.current;
1098
- m.pointerId = null, m.pointerType = "", m.startClientY = 0, m.startScroll = 0, m.isDragging = !1, m.velocitySamples = [];
1099
- }, nt = () => {
1100
- const m = S.current;
1101
- m.clickResetTimer !== null && (window.clearTimeout(m.clickResetTimer), m.clickResetTimer = null);
1102
- }, J = (m) => {
1103
- const y = S.current, Nt = ct();
1104
- y.velocitySamples.push({ clientY: m, time: Nt });
1105
- const Lt = lt.current.velocitySampleWindow;
1106
- y.velocitySamples = y.velocitySamples.filter((at) => Nt - at.time <= Lt);
1107
- }, Pt = (m) => m instanceof HTMLElement && m.closest("[data-scrollpane-ignore-drag='true']") !== null, Mt = (m) => {
1108
- const y = S.current;
1109
- y.shouldCancelNextClick && (m.preventDefault(), m.stopPropagation(), y.shouldCancelNextClick = !1);
1110
- }, Et = (m) => {
1111
- const y = S.current;
1112
- if (!y.isDragging) {
1113
- if (y.isDragging = !0, y.shouldCancelNextClick = !0, !d.hasPointerCapture(m.pointerId))
1097
+ const ft = 6, mt = () => typeof performance < "u" && typeof performance.now == "function" ? performance.now() : Date.now(), z = () => {
1098
+ const f = j.current;
1099
+ f.pointerId = null, f.pointerType = "", f.startClientY = 0, f.startScroll = 0, f.isDragging = !1, f.velocitySamples = [];
1100
+ }, et = () => {
1101
+ const f = j.current;
1102
+ f.clickResetTimer !== null && (window.clearTimeout(f.clickResetTimer), f.clickResetTimer = null);
1103
+ }, ct = (f) => {
1104
+ const w = j.current, at = mt();
1105
+ w.velocitySamples.push({ clientY: f, time: at });
1106
+ const gt = Xt.current.velocitySampleWindow;
1107
+ w.velocitySamples = w.velocitySamples.filter((wt) => at - wt.time <= gt);
1108
+ }, kt = (f) => f instanceof HTMLElement && f.closest("[data-scrollpane-ignore-drag='true']") !== null, Ot = (f) => {
1109
+ const w = j.current;
1110
+ w.shouldCancelNextClick && (f.preventDefault(), f.stopPropagation(), w.shouldCancelNextClick = !1);
1111
+ }, Mt = (f) => {
1112
+ const w = j.current;
1113
+ if (!w.isDragging) {
1114
+ if (w.isDragging = !0, w.shouldCancelNextClick = !0, !p.hasPointerCapture(f.pointerId))
1114
1115
  try {
1115
- d.setPointerCapture(m.pointerId);
1116
+ p.setPointerCapture(f.pointerId);
1116
1117
  } catch {
1117
1118
  }
1118
- J(m.clientY);
1119
+ ct(f.clientY);
1119
1120
  }
1120
- }, st = (m) => m.isTrusted || m.target === d, St = (m) => {
1121
- const y = S.current;
1122
- d.hasPointerCapture(m) && d.releasePointerCapture(m), y.shouldCancelNextClick = !1, nt(), H();
1123
- }, yt = (m) => {
1124
- const y = S.current;
1125
- if (y.pointerId !== m.pointerId)
1121
+ }, it = (f) => f.isTrusted || f.target === p, ht = (f) => {
1122
+ const w = j.current;
1123
+ p.hasPointerCapture(f) && p.releasePointerCapture(f), w.shouldCancelNextClick = !1, et(), z();
1124
+ }, st = (f) => {
1125
+ const w = j.current;
1126
+ if (w.pointerId !== f.pointerId)
1126
1127
  return;
1127
- if (m.buttons === 0 && Tr(m.pointerType)) {
1128
- St(m.pointerId);
1128
+ if (f.buttons === 0 && Sr(f.pointerType)) {
1129
+ ht(f.pointerId);
1129
1130
  return;
1130
1131
  }
1131
- if (!($t.current && Jt.current) || !ke(m.pointerType, Bt.current) || !y.isDragging && (Math.abs(m.clientY - y.startClientY) < mt || (Et(m), !y.isDragging)))
1132
+ if (!(Bt.current && Et.current) || !Oe(f.pointerType, _t.current) || !w.isDragging && (Math.abs(f.clientY - w.startClientY) < ft || (Mt(f), !w.isDragging)))
1132
1133
  return;
1133
- J(m.clientY);
1134
- const Nt = m.clientY - y.startClientY, Lt = y.startScroll - Nt;
1135
- Rt.current(Lt), m.cancelable && m.preventDefault();
1136
- }, ut = () => {
1137
- const m = S.current;
1138
- return m.pointerId !== null || !m.shouldCancelNextClick ? !1 : (nt(), m.clickResetTimer = window.setTimeout(() => {
1139
- const y = S.current;
1140
- y.shouldCancelNextClick = !1, y.clickResetTimer = null;
1134
+ ct(f.clientY);
1135
+ const at = f.clientY - w.startClientY, gt = w.startScroll - at;
1136
+ Ct.current(gt), f.cancelable && f.preventDefault();
1137
+ }, Q = () => {
1138
+ const f = j.current;
1139
+ return f.pointerId !== null || !f.shouldCancelNextClick ? !1 : (et(), f.clickResetTimer = window.setTimeout(() => {
1140
+ const w = j.current;
1141
+ w.shouldCancelNextClick = !1, w.clickResetTimer = null;
1141
1142
  }, 0), !0);
1142
- }, ot = (m) => {
1143
- const y = S.current;
1144
- if (y.pointerId !== m.pointerId) {
1145
- ut();
1143
+ }, qt = (f) => {
1144
+ const w = j.current;
1145
+ if (w.pointerId !== f.pointerId) {
1146
+ Q();
1146
1147
  return;
1147
1148
  }
1148
- y.isDragging && y.shouldCancelNextClick && m.cancelable && (m.preventDefault(), m.stopPropagation()), y.isDragging && J(m.clientY);
1149
- let Nt = 0;
1150
- if (y.isDragging && y.velocitySamples.length >= 2) {
1151
- const at = y.velocitySamples, _t = lt.current.velocitySampleWindow, Ht = at[at.length - 1], kt = at.find((jt) => Ht.time - jt.time <= _t) ?? at[0];
1152
- if (Ht && kt && Ht.time !== kt.time) {
1153
- const jt = Ht.clientY - kt.clientY, ce = Ht.time - kt.time;
1154
- Nt = -(jt / ce);
1149
+ w.isDragging && w.shouldCancelNextClick && f.cancelable && (f.preventDefault(), f.stopPropagation()), w.isDragging && ct(f.clientY);
1150
+ let at = 0;
1151
+ if (w.isDragging && w.velocitySamples.length >= 2) {
1152
+ const wt = w.velocitySamples, Qt = Xt.current.velocitySampleWindow, Ht = wt[wt.length - 1], Ut = wt.find((te) => Ht.time - te.time <= Qt) ?? wt[0];
1153
+ if (Ht && Ut && Ht.time !== Ut.time) {
1154
+ const te = Ht.clientY - Ut.clientY, ce = Ht.time - Ut.time;
1155
+ at = -(te / ce);
1155
1156
  }
1156
1157
  }
1157
- nt(), y.shouldCancelNextClick && (y.clickResetTimer = window.setTimeout(() => {
1158
- const at = S.current;
1159
- at.shouldCancelNextClick = !1, at.clickResetTimer = null;
1158
+ et(), w.shouldCancelNextClick && (w.clickResetTimer = window.setTimeout(() => {
1159
+ const wt = j.current;
1160
+ wt.shouldCancelNextClick = !1, wt.clickResetTimer = null;
1160
1161
  }, 0));
1161
- const Lt = lt.current.startVelocityThreshold;
1162
- H(), d.hasPointerCapture(m.pointerId) && d.releasePointerCapture(m.pointerId), Math.abs(Nt) >= Lt && Yt.current?.(Nt);
1163
- }, Dt = (m) => {
1164
- if (S.current.pointerId !== null) {
1165
- if (!m.isPrimary || m.pointerType !== S.current.pointerType)
1162
+ const gt = Xt.current.startVelocityThreshold;
1163
+ z(), p.hasPointerCapture(f.pointerId) && p.releasePointerCapture(f.pointerId), Math.abs(at) >= gt && Kt.current?.(at);
1164
+ }, le = (f) => {
1165
+ if (j.current.pointerId !== null) {
1166
+ if (!f.isPrimary || f.pointerType !== j.current.pointerType)
1166
1167
  return;
1167
- St(S.current.pointerId);
1168
+ ht(j.current.pointerId);
1168
1169
  }
1169
- if (S.current.shouldCancelNextClick && (nt(), S.current.shouldCancelNextClick = !1), !($t.current && Jt.current) || !ke(m.pointerType, Bt.current) || m.button !== 0 && m.pointerType === "mouse" || m.ctrlKey || m.metaKey || m.altKey || Pt(m.target))
1170
+ if (j.current.shouldCancelNextClick && (et(), j.current.shouldCancelNextClick = !1), !(Bt.current && Et.current) || !Oe(f.pointerType, _t.current) || f.button !== 0 && f.pointerType === "mouse" || f.ctrlKey || f.metaKey || f.altKey || kt(f.target))
1170
1171
  return;
1171
- window.dispatchEvent(new CustomEvent(ze, { detail: { paneId: Xt } })), Ct.current?.();
1172
- const y = S.current;
1173
- nt(), y.pointerId = m.pointerId, y.pointerType = m.pointerType, y.startClientY = m.clientY, y.startScroll = N.current, y.isDragging = !1, y.shouldCancelNextClick = !1, y.velocitySamples = [];
1174
- }, qt = (m) => {
1175
- if (S.current.pointerId !== m.pointerId) {
1176
- ut();
1172
+ window.dispatchEvent(new CustomEvent(Ye, { detail: { paneId: ae } })), At.current?.();
1173
+ const w = j.current;
1174
+ et(), w.pointerId = f.pointerId, w.pointerType = f.pointerType, w.startClientY = f.clientY, w.startScroll = N.current, w.isDragging = !1, w.shouldCancelNextClick = !1, w.velocitySamples = [];
1175
+ }, Nt = (f) => {
1176
+ if (j.current.pointerId !== f.pointerId) {
1177
+ Q();
1177
1178
  return;
1178
1179
  }
1179
- st(m) && St(m.pointerId);
1180
- }, dt = [
1181
- ["click", Mt, !0],
1182
- ["pointerdown", Dt, { passive: !1 }],
1183
- ["lostpointercapture", (m) => {
1184
- m.target !== d || S.current.pointerId !== m.pointerId || St(m.pointerId);
1180
+ it(f) && ht(f.pointerId);
1181
+ }, Gt = [
1182
+ ["click", Ot, !0],
1183
+ ["pointerdown", le, { passive: !1 }],
1184
+ ["lostpointercapture", (f) => {
1185
+ f.target !== p || j.current.pointerId !== f.pointerId || ht(f.pointerId);
1185
1186
  }, void 0]
1186
- ], Qt = [
1187
- ["pointermove", yt, { passive: !1 }],
1188
- ["pointerup", ot, void 0],
1189
- ["pointercancel", qt, void 0]
1187
+ ], Vt = [
1188
+ ["pointermove", st, { passive: !1 }],
1189
+ ["pointerup", qt, void 0],
1190
+ ["pointercancel", Nt, void 0]
1190
1191
  ];
1191
- return Ee(d, dt, "add"), Ee(window, Qt, "add"), () => {
1192
- Ee(d, dt, "remove"), Ee(window, Qt, "remove");
1193
- const m = S.current;
1194
- m.pointerId !== null && d.hasPointerCapture(m.pointerId) && d.releasePointerCapture(m.pointerId), nt(), H();
1192
+ return Ne(p, Gt, "add"), Ne(window, Vt, "add"), () => {
1193
+ Ne(p, Gt, "remove"), Ne(window, Vt, "remove");
1194
+ const f = j.current;
1195
+ f.pointerId !== null && p.hasPointerCapture(f.pointerId) && p.releasePointerCapture(f.pointerId), et(), z();
1195
1196
  };
1196
- }, [Xt]);
1197
- const Wt = v(
1198
- (d) => (U(), k(d)),
1199
- [k, U]
1197
+ }, [ae]);
1198
+ const dt = S(
1199
+ (p) => (W(), F(p)),
1200
+ [F, W]
1200
1201
  );
1201
- return /* @__PURE__ */ de("div", { ref: q, "data-testid": P, className: ue("aqvs-scroll-pane", I), style: E, children: [
1202
- /* @__PURE__ */ de(
1202
+ return /* @__PURE__ */ he("div", { ref: lt, "data-testid": v, className: pe("aqvs-scroll-pane", x), style: E, children: [
1203
+ /* @__PURE__ */ he(
1203
1204
  "div",
1204
1205
  {
1205
- ref: et,
1206
- className: ue("aqvs-scroll-pane-content"),
1206
+ ref: K,
1207
+ className: pe("aqvs-scroll-pane-content"),
1207
1208
  "data-testid": "aqvs-scroll-pane-content",
1208
1209
  style: {
1209
1210
  height: e,
1210
- paddingTop: Tt.top,
1211
- paddingBottom: Tt.bottom,
1211
+ paddingTop: Yt.top,
1212
+ paddingBottom: Yt.bottom,
1212
1213
  // スクロール不能時 (contentSize <= viewportSize) は touch-action を通常に戻し、
1213
1214
  // 短いリスト上のタッチがページ全体のパンを妨げるデッドゾーン化を防ぐ。
1214
1215
  // 直接操作 (指・ペン) のドラッグを許可していない場合も付けない。
@@ -1222,101 +1223,102 @@ const xt = (n, t, e) => Math.max(t, Math.min(e, n)), ze = "virtualscroll:tap-scr
1222
1223
  // 同一条件で揃えてあるため状態としても一貫している。
1223
1224
  // 非同期コンテンツを先読みして確保する挙動は意図的に入れていない
1224
1225
  // (空のペインがページのパンを殺すデッドゾーンになり、そちらの実害の方が大きいため)。
1225
- ...c && Z && f.some((d) => d === "touch" || d === "pen") ? { touchAction: "none" } : {}
1226
+ ...c && J && d.some((p) => p === "touch" || p === "pen") ? { touchAction: "none" } : {}
1226
1227
  },
1227
- id: Xt,
1228
+ ...X,
1229
+ id: A,
1228
1230
  children: [
1229
- g,
1231
+ m,
1230
1232
  n(N.current)
1231
1233
  ]
1232
1234
  }
1233
1235
  ),
1234
- /* @__PURE__ */ it(
1235
- xr,
1236
+ /* @__PURE__ */ ot(
1237
+ Ir,
1236
1238
  {
1237
1239
  contentSize: t,
1238
1240
  viewportSize: e,
1239
1241
  scrollPosition: N.current,
1240
- onScroll: Wt,
1242
+ onScroll: dt,
1241
1243
  enableThumbDrag: i,
1242
1244
  enableTrackClick: s,
1243
- enableArrowButtons: l,
1245
+ enableArrowButtons: a,
1244
1246
  scrollBarWidth: r,
1245
- ariaControls: Xt,
1247
+ ariaControls: A,
1246
1248
  tapScrollCircleOptions: _,
1247
- itemCount: j,
1248
- renderThumbOverlay: ft,
1249
- visibleStartIndex: It,
1249
+ itemCount: Z,
1250
+ renderThumbOverlay: ut,
1251
+ visibleStartIndex: Pt,
1250
1252
  visibleEndIndex: D
1251
1253
  },
1252
1254
  "scrollbar"
1253
1255
  ),
1254
- O?.()
1256
+ k?.()
1255
1257
  ] });
1256
1258
  }
1257
- ), $e = (n, t, e) => Math.min(Math.max(n, t), e), kr = ({ dragState: n, normalizedDistance: t, sizeScale: e, size: r }) => {
1258
- const i = Math.max(r / 2, 1), s = 1 + t * 0.65, l = Math.max(0.65, 1 - t * 0.25), c = n.direction * t * 26 * e, f = 0.8 + t * 0.18, x = 3 * e, I = 6 * e, P = 22 * e, E = Math.abs(c) + I, g = c > 0 ? x : -Math.abs(c) - x, _ = Math.max(2.5, 3 * e), z = $e(n.offsetX, -i, i), j = $e(n.offsetY, -i, i), ft = i * 0.35, Q = z / i * ft, tt = j / i * ft, pt = Q * 0.45, It = tt * 0.45, D = Math.max(P * 0.38, 6), O = 0.65 + t * 0.2, M = n.active;
1259
- return /* @__PURE__ */ de(je, { children: [
1260
- /* @__PURE__ */ it(
1259
+ ), Ue = (n, t, e) => Math.min(Math.max(n, t), e), Or = ({ dragState: n, normalizedDistance: t, sizeScale: e, size: r }) => {
1260
+ const i = Math.max(r / 2, 1), s = 1 + t * 0.65, a = Math.max(0.65, 1 - t * 0.25), c = n.direction * t * 26 * e, d = 0.8 + t * 0.18, b = 3 * e, x = 6 * e, v = 22 * e, E = Math.abs(c) + x, m = c > 0 ? b : -Math.abs(c) - b, _ = Math.max(2.5, 3 * e), B = Ue(n.offsetX, -i, i), Z = Ue(n.offsetY, -i, i), ut = i * 0.35, rt = B / i * ut, nt = Z / i * ut, pt = rt * 0.45, Pt = nt * 0.45, D = Math.max(v * 0.38, 6), k = 0.65 + t * 0.2, P = n.active;
1261
+ return /* @__PURE__ */ he(Ge, { children: [
1262
+ /* @__PURE__ */ ot(
1261
1263
  "div",
1262
1264
  {
1263
1265
  className: "aqvs-tap-scroll-circle-gradient",
1264
1266
  style: {
1265
- transform: `scale(${l}, ${s})`,
1266
- transition: M ? "40ms transform ease-out" : "200ms ease transform"
1267
+ transform: `scale(${a}, ${s})`,
1268
+ transition: P ? "40ms transform ease-out" : "200ms ease transform"
1267
1269
  }
1268
1270
  }
1269
1271
  ),
1270
- /* @__PURE__ */ it(
1272
+ /* @__PURE__ */ ot(
1271
1273
  "div",
1272
1274
  {
1273
1275
  className: "aqvs-sample-visual-pupil",
1274
1276
  style: {
1275
- width: P,
1276
- height: P,
1277
- transform: `translate(calc(-50% + ${Q}px), calc(-50% + ${tt}px)) scale(${l}, ${f * s})`,
1278
- transition: M ? "70ms transform ease-out" : "200ms ease transform"
1277
+ width: v,
1278
+ height: v,
1279
+ transform: `translate(calc(-50% + ${rt}px), calc(-50% + ${nt}px)) scale(${a}, ${d * s})`,
1280
+ transition: P ? "70ms transform ease-out" : "200ms ease transform"
1279
1281
  }
1280
1282
  }
1281
1283
  ),
1282
- /* @__PURE__ */ it(
1284
+ /* @__PURE__ */ ot(
1283
1285
  "div",
1284
1286
  {
1285
1287
  className: "aqvs-sample-visual-highlight",
1286
1288
  style: {
1287
1289
  width: D,
1288
1290
  height: D,
1289
- transform: `translate(calc(-50% + ${pt}px), calc(-50% + ${It}px)) scale(${l}, ${s})`,
1290
- opacity: O,
1291
+ transform: `translate(calc(-50% + ${pt}px), calc(-50% + ${Pt}px)) scale(${a}, ${s})`,
1292
+ opacity: k,
1291
1293
  boxShadow: "0 0 8px rgba(255,255,255,0.45)",
1292
- transition: M ? "120ms opacity 150ms, 120ms transform ease-out ease-out" : "220ms ease transform, 240ms opacity ease"
1294
+ transition: P ? "120ms opacity 150ms, 120ms transform ease-out ease-out" : "220ms ease transform, 240ms opacity ease"
1293
1295
  }
1294
1296
  }
1295
1297
  ),
1296
- /* @__PURE__ */ it(
1298
+ /* @__PURE__ */ ot(
1297
1299
  "div",
1298
1300
  {
1299
1301
  className: "aqvs-sample-visual-rod",
1300
1302
  style: {
1301
1303
  width: _,
1302
1304
  height: E,
1303
- transform: `translate(-50%, ${g}px)`,
1305
+ transform: `translate(-50%, ${m}px)`,
1304
1306
  opacity: t,
1305
- transition: M ? "40ms height, 60ms opacity ease-out ease-out" : "200ms ease height, 120ms ease opacity"
1307
+ transition: P ? "40ms height, 60ms opacity ease-out ease-out" : "200ms ease height, 120ms ease opacity"
1306
1308
  }
1307
1309
  }
1308
1310
  )
1309
1311
  ] });
1310
- }, Ne = 100, vr = (n) => {
1312
+ }, Ve = 100, Pr = (n) => {
1311
1313
  if (!Number.isFinite(n))
1312
1314
  return 0n;
1313
1315
  const t = Math.trunc(n);
1314
1316
  return t <= 0 ? 0n : BigInt(t);
1315
- }, Oe = (n, t) => {
1317
+ }, Fe = (n, t) => {
1316
1318
  if (!Number.isFinite(n))
1317
1319
  throw new Error(`valueFn returned a non-finite value at index ${t}: ${n}`);
1318
1320
  return n;
1319
- }, ge = (n) => {
1321
+ }, xe = (n) => {
1320
1322
  if (n <= 0 || !Number.isFinite(n))
1321
1323
  return 0;
1322
1324
  const t = Math.trunc(n);
@@ -1325,7 +1327,7 @@ const xt = (n, t, e) => Math.max(t, Math.min(e, n)), ze = "virtualscroll:tap-scr
1325
1327
  const e = BigInt(t) & -BigInt(t);
1326
1328
  return Number(e);
1327
1329
  };
1328
- class ae {
1330
+ class me {
1329
1331
  /**
1330
1332
  * @private
1331
1333
  * @property {Map<number, number>} tree - The Map storing the Fenwick tree structure, specifically the sums of deltas. It is 1-indexed.
@@ -1389,27 +1391,27 @@ class ae {
1389
1391
  this.size = i, this.tree = /* @__PURE__ */ new Map(), this.deltas = /* @__PURE__ */ new Map(), this.valueFn = void 0, this.baseValue = e, this.total = this.baseValue * this.size;
1390
1392
  return;
1391
1393
  }
1392
- let s = 0, l;
1394
+ let s = 0, a;
1393
1395
  if (i > 0) {
1394
1396
  const c = r?.sampleRange ?? {
1395
1397
  from: 0,
1396
- to: Math.min(Ne - 1, i - 1)
1398
+ to: Math.min(Ve - 1, i - 1)
1397
1399
  };
1398
- let f = Math.max(0, Math.trunc(c.from)), x = Math.min(Math.trunc(c.to), i - 1);
1399
- if (f > x && (f = 0, x = Math.min(Ne - 1, i - 1)), i > Ne)
1400
- s = ae._sampleBaseValueStrided(e, i, Ne), r?.materialize && (l = { from: f, values: ae._collectValidatedValues(e, f, x) });
1400
+ let d = Math.max(0, Math.trunc(c.from)), b = Math.min(Math.trunc(c.to), i - 1);
1401
+ if (d > b && (d = 0, b = Math.min(Ve - 1, i - 1)), i > Ve)
1402
+ s = me._sampleBaseValueStrided(e, i, Ve), r?.materialize && (a = { from: d, values: me._collectValidatedValues(e, d, b) });
1401
1403
  else {
1402
- const I = ae._collectValidatedValues(e, f, x);
1403
- s = ae._modeOrMedian([...I]), r?.materialize && (l = { from: f, values: I });
1404
+ const x = me._collectValidatedValues(e, d, b);
1405
+ s = me._modeOrMedian([...x]), r?.materialize && (a = { from: d, values: x });
1404
1406
  }
1405
1407
  }
1406
- if (this.size = i, this.tree = /* @__PURE__ */ new Map(), this.deltas = /* @__PURE__ */ new Map(), this.total = void 0, this.valueFn = e, this.baseValue = s, l)
1407
- for (let c = 0; c < l.values.length; c++) {
1408
- const f = l.from + c;
1409
- if (f >= this.size)
1408
+ if (this.size = i, this.tree = /* @__PURE__ */ new Map(), this.deltas = /* @__PURE__ */ new Map(), this.total = void 0, this.valueFn = e, this.baseValue = s, a)
1409
+ for (let c = 0; c < a.values.length; c++) {
1410
+ const d = a.from + c;
1411
+ if (d >= this.size)
1410
1412
  break;
1411
- const x = l.values[c] - this.baseValue;
1412
- x !== 0 && (this.deltas.set(f, x), this._updateTree(f, x));
1413
+ const b = a.values[c] - this.baseValue;
1414
+ b !== 0 && (this.deltas.set(d, b), this._updateTree(d, b));
1413
1415
  }
1414
1416
  this.total = this.getTotal();
1415
1417
  }
@@ -1440,7 +1442,7 @@ class ae {
1440
1442
  static _collectValidatedValues(t, e, r) {
1441
1443
  const i = [];
1442
1444
  for (let s = e; s <= r; s++)
1443
- i.push(Oe(t(s), s));
1445
+ i.push(Fe(t(s), s));
1444
1446
  return i;
1445
1447
  }
1446
1448
  /**
@@ -1454,22 +1456,22 @@ class ae {
1454
1456
  static _modeOrMedian(t) {
1455
1457
  if (t.length === 0)
1456
1458
  return 0;
1457
- t.sort((l, c) => l - c);
1459
+ t.sort((a, c) => a - c);
1458
1460
  const e = Math.floor(t.length / 2);
1459
1461
  let r;
1460
1462
  t.length % 2 === 0 ? r = Math.floor((t[e - 1] + t[e]) / 2) : r = t[e];
1461
1463
  const i = /* @__PURE__ */ new Map();
1462
1464
  let s = 0;
1463
- for (const l of t) {
1464
- const c = (i.get(l) ?? 0) + 1;
1465
- i.set(l, c), c > s && (s = c);
1465
+ for (const a of t) {
1466
+ const c = (i.get(a) ?? 0) + 1;
1467
+ i.set(a, c), c > s && (s = c);
1466
1468
  }
1467
1469
  if (s > t.length * 0.2) {
1468
- const l = [];
1469
- for (const [f, x] of i.entries())
1470
- x === s && l.push(f);
1471
- const c = l.reduce((f, x) => f + x, 0);
1472
- r = Math.floor(c / l.length);
1470
+ const a = [];
1471
+ for (const [d, b] of i.entries())
1472
+ b === s && a.push(d);
1473
+ const c = a.reduce((d, b) => d + b, 0);
1474
+ r = Math.floor(c / a.length);
1473
1475
  }
1474
1476
  return r;
1475
1477
  }
@@ -1489,9 +1491,9 @@ class ae {
1489
1491
  let i = Math.max(1, Math.ceil(e / r));
1490
1492
  i % 2 === 0 && (i += 1);
1491
1493
  const s = [];
1492
- for (let l = 0; l < e && s.length < r; l += i)
1493
- s.push(Oe(t(l), l));
1494
- return ae._modeOrMedian(s);
1494
+ for (let a = 0; a < e && s.length < r; a += i)
1495
+ s.push(Fe(t(a), a));
1496
+ return me._modeOrMedian(s);
1495
1497
  }
1496
1498
  /**
1497
1499
  * @method update
@@ -1538,14 +1540,14 @@ class ae {
1538
1540
  throw new Error(`Index must be an integer: ${r}`);
1539
1541
  if (!Number.isFinite(i))
1540
1542
  throw new Error(`Change must be a finite number: ${i}`);
1541
- const l = (e.get(r) ?? this.deltas.get(r) ?? 0) + i;
1542
- if (l + this.baseValue < -1e-9)
1543
- throw new Error(`Change would make the value at index ${r} negative: ${l + this.baseValue}`);
1544
- e.set(r, l);
1543
+ const a = (e.get(r) ?? this.deltas.get(r) ?? 0) + i;
1544
+ if (a + this.baseValue < -1e-9)
1545
+ throw new Error(`Change would make the value at index ${r} negative: ${a + this.baseValue}`);
1546
+ e.set(r, a);
1545
1547
  }
1546
1548
  for (const { index: r, change: i } of t) {
1547
- const l = (this.deltas.get(r) ?? 0) + i;
1548
- l === 0 ? this.deltas.delete(r) : this.deltas.set(r, l), this._updateTree(r, i);
1549
+ const a = (this.deltas.get(r) ?? 0) + i;
1550
+ a === 0 ? this.deltas.delete(r) : this.deltas.set(r, a), this._updateTree(r, i);
1549
1551
  }
1550
1552
  return this.total;
1551
1553
  }
@@ -1563,7 +1565,7 @@ class ae {
1563
1565
  let r = t + 1;
1564
1566
  for (; r <= this.size; ) {
1565
1567
  this.tree.set(r, (this.tree.get(r) ?? 0) + e);
1566
- const i = ge(r);
1568
+ const i = xe(r);
1567
1569
  if (i === 0)
1568
1570
  break;
1569
1571
  r += i;
@@ -1589,8 +1591,8 @@ class ae {
1589
1591
  throw new Error(`Value must be a finite number: ${s}`);
1590
1592
  if (s < 0)
1591
1593
  throw new Error("Value cannot be negative.");
1592
- const l = r.has(i) ? r.get(i) ?? 0 : this.deltas.get(i) ?? 0, c = l + this.baseValue, f = s - c;
1593
- f !== 0 && e.push({ index: i, change: f }), r.set(i, l + f);
1594
+ const a = r.has(i) ? r.get(i) ?? 0 : this.deltas.get(i) ?? 0, c = a + this.baseValue, d = s - c;
1595
+ d !== 0 && e.push({ index: i, change: d }), r.set(i, a + d);
1594
1596
  }
1595
1597
  return e;
1596
1598
  }
@@ -1607,7 +1609,7 @@ class ae {
1607
1609
  let t = 0, e = this.size;
1608
1610
  for (; e > 0; ) {
1609
1611
  t += this.tree.get(e) ?? 0;
1610
- const r = ge(e);
1612
+ const r = xe(e);
1611
1613
  if (r === 0)
1612
1614
  break;
1613
1615
  e -= r;
@@ -1624,10 +1626,10 @@ class ae {
1624
1626
  */
1625
1627
  _materialize(t, e = !0) {
1626
1628
  if (this.valueFn) {
1627
- const r = this.deltas.get(t) ?? 0, s = Oe(this.valueFn(t), t) - this.baseValue;
1629
+ const r = this.deltas.get(t) ?? 0, s = Fe(this.valueFn(t), t) - this.baseValue;
1628
1630
  if (s !== r && (s === 0 ? this.deltas.delete(t) : this.deltas.set(t, s), e)) {
1629
- const l = s - r;
1630
- this._updateTree(t, l);
1631
+ const a = s - r;
1632
+ this._updateTree(t, a);
1631
1633
  }
1632
1634
  }
1633
1635
  }
@@ -1646,9 +1648,9 @@ class ae {
1646
1648
  const i = t.ranges;
1647
1649
  if (i && i.length > 0) {
1648
1650
  for (const c of i) {
1649
- const f = Math.max(0, Math.trunc(c.from)), x = Math.min(Math.trunc(c.to), this.size - 1);
1650
- for (let I = f; I <= x; I++)
1651
- this._materialize(I);
1651
+ const d = Math.max(0, Math.trunc(c.from)), b = Math.min(Math.trunc(c.to), this.size - 1);
1652
+ for (let x = d; x <= b; x++)
1653
+ this._materialize(x);
1652
1654
  }
1653
1655
  if (e === void 0)
1654
1656
  return;
@@ -1656,8 +1658,8 @@ class ae {
1656
1658
  this._materialize(e);
1657
1659
  return;
1658
1660
  }
1659
- const s = i[0].from, l = i[i.length - 1].to;
1660
- e >= s && e <= l && this._materialize(e);
1661
+ const s = i[0].from, a = i[i.length - 1].to;
1662
+ e >= s && e <= a && this._materialize(e);
1661
1663
  return;
1662
1664
  }
1663
1665
  e !== void 0 && this._materialize(e);
@@ -1689,13 +1691,13 @@ class ae {
1689
1691
  if (this._materialize(s), (this.deltas.get(s) ?? 0) === c)
1690
1692
  break;
1691
1693
  }
1692
- const l = this.prefixSum(s);
1694
+ const a = this.prefixSum(s);
1693
1695
  return {
1694
1696
  index: s,
1695
- total: this.total ?? l.total,
1696
- cumulative: l.cumulative,
1697
- currentValue: l.currentValue,
1698
- safeIndex: l.safeIndex
1697
+ total: this.total ?? a.total,
1698
+ cumulative: a.cumulative,
1699
+ currentValue: a.currentValue,
1700
+ safeIndex: a.safeIndex
1699
1701
  };
1700
1702
  }
1701
1703
  /**
@@ -1712,10 +1714,10 @@ class ae {
1712
1714
  for (; s << 1 <= this.size; )
1713
1715
  s <<= 1;
1714
1716
  for (; s > 0; s >>= 1) {
1715
- const l = r + s;
1716
- if (l <= this.size) {
1717
- const f = (this.tree.get(l) ?? 0) + this.baseValue * s;
1718
- (e ? i + f < t : i + f <= t) && (r = l, i += f);
1717
+ const a = r + s;
1718
+ if (a <= this.size) {
1719
+ const d = (this.tree.get(a) ?? 0) + this.baseValue * s;
1720
+ (e ? i + d < t : i + d <= t) && (r = a, i += d);
1719
1721
  }
1720
1722
  }
1721
1723
  return e ? r : r - 1;
@@ -1728,42 +1730,42 @@ class ae {
1728
1730
  _findIndexLarge(t, e, r) {
1729
1731
  if (this.size === 0)
1730
1732
  return { index: -1, total: this.total ?? 0, cumulative: void 0, currentValue: void 0, safeIndex: void 0 };
1731
- const i = vr(this.size);
1733
+ const i = Pr(this.size);
1732
1734
  if (i === 0n)
1733
1735
  return { index: -1, total: this.total ?? 0, cumulative: void 0, currentValue: void 0, safeIndex: void 0 };
1734
1736
  this._materializeRanges(e.materializeOption);
1735
1737
  const s = e.materializeOption?.materialize === !0;
1736
1738
  for (; ; ) {
1737
- let l = 0n, c = i - 1n, f, x, I = this.total;
1738
- for (; l <= c; ) {
1739
- const g = l + c >> 1n, _ = Number(g), z = this.prefixSum(_);
1740
- if (I = z.total, r ? z.cumulative >= t : z.cumulative <= t)
1741
- if (f = g, x = z, r) {
1742
- if (g === 0n)
1739
+ let a = 0n, c = i - 1n, d, b, x = this.total;
1740
+ for (; a <= c; ) {
1741
+ const m = a + c >> 1n, _ = Number(m), B = this.prefixSum(_);
1742
+ if (x = B.total, r ? B.cumulative >= t : B.cumulative <= t)
1743
+ if (d = m, b = B, r) {
1744
+ if (m === 0n)
1743
1745
  break;
1744
- c = g - 1n;
1746
+ c = m - 1n;
1745
1747
  } else
1746
- l = g + 1n;
1748
+ a = m + 1n;
1747
1749
  else if (r)
1748
- l = g + 1n;
1750
+ a = m + 1n;
1749
1751
  else {
1750
- if (g === 0n)
1752
+ if (m === 0n)
1751
1753
  break;
1752
- c = g - 1n;
1754
+ c = m - 1n;
1753
1755
  }
1754
1756
  }
1755
- const P = x, E = f !== void 0 ? Number(f) : -1;
1757
+ const v = b, E = d !== void 0 ? Number(d) : -1;
1756
1758
  if (s && E >= 0) {
1757
- const g = this.deltas.get(E) ?? 0;
1758
- if (this._materialize(E), (this.deltas.get(E) ?? 0) !== g)
1759
+ const m = this.deltas.get(E) ?? 0;
1760
+ if (this._materialize(E), (this.deltas.get(E) ?? 0) !== m)
1759
1761
  continue;
1760
1762
  }
1761
1763
  return {
1762
1764
  index: E,
1763
- total: I,
1764
- cumulative: P?.cumulative,
1765
- currentValue: P?.currentValue,
1766
- safeIndex: P?.safeIndex
1765
+ total: x,
1766
+ cumulative: v?.cumulative,
1767
+ currentValue: v?.currentValue,
1768
+ safeIndex: v?.safeIndex
1767
1769
  };
1768
1770
  }
1769
1771
  }
@@ -1780,16 +1782,16 @@ class ae {
1780
1782
  return { cumulative: 0, total: this.total, currentValue: 0, safeIndex: 0 };
1781
1783
  if (this.size === 0)
1782
1784
  return { cumulative: 0, total: this.total ?? 0, currentValue: 0, safeIndex: 0 };
1783
- const r = xt(Math.trunc(t), 0, this.size - 1), i = e?.materializeOption;
1785
+ const r = vt(Math.trunc(t), 0, this.size - 1), i = e?.materializeOption;
1784
1786
  this._materializeRanges(i, r, !0);
1785
- let s = 0, l = r + 1;
1786
- for (; l > 0; ) {
1787
- const f = this.tree.get(l) ?? 0;
1788
- s += f;
1789
- const x = ge(l);
1790
- if (x === 0)
1787
+ let s = 0, a = r + 1;
1788
+ for (; a > 0; ) {
1789
+ const d = this.tree.get(a) ?? 0;
1790
+ s += d;
1791
+ const b = xe(a);
1792
+ if (b === 0)
1791
1793
  break;
1792
- l -= x;
1794
+ a -= b;
1793
1795
  }
1794
1796
  const c = i?.materialize ? this.get(r) : (this.deltas.get(r) || 0) + this.baseValue;
1795
1797
  return { cumulative: s + this.baseValue * (r + 1), total: this.total, currentValue: c, safeIndex: r };
@@ -1849,10 +1851,10 @@ class ae {
1849
1851
  let s = r + 1;
1850
1852
  for (; s <= this.size; ) {
1851
1853
  e.set(s, (e.get(s) ?? 0) + i);
1852
- const l = ge(s);
1853
- if (l === 0)
1854
+ const a = xe(s);
1855
+ if (a === 0)
1854
1856
  break;
1855
- s += l;
1857
+ s += a;
1856
1858
  }
1857
1859
  }
1858
1860
  this.tree = e, this.total = this._computeTreeTotal();
@@ -1966,17 +1968,17 @@ class ae {
1966
1968
  _propagateDeltaToGrownNodes(t, e, r, i) {
1967
1969
  let s = t + 1;
1968
1970
  for (; s <= r; ) {
1969
- const l = ge(s);
1970
- if (l === 0)
1971
+ const a = xe(s);
1972
+ if (a === 0)
1971
1973
  break;
1972
- s += l;
1974
+ s += a;
1973
1975
  }
1974
1976
  for (; s <= i; ) {
1975
1977
  this.tree.set(s, (this.tree.get(s) ?? 0) + e);
1976
- const l = ge(s);
1977
- if (l === 0)
1978
+ const a = xe(s);
1979
+ if (a === 0)
1978
1980
  break;
1979
- s += l;
1981
+ s += a;
1980
1982
  }
1981
1983
  }
1982
1984
  /**
@@ -1989,15 +1991,15 @@ class ae {
1989
1991
  */
1990
1992
  _growSize(t, e) {
1991
1993
  if (this.size = e, this.deltas.size > 0) {
1992
- const r = ae._minCoveredLowBound(t, e);
1994
+ const r = me._minCoveredLowBound(t, e);
1993
1995
  if (t - r < this.deltas.size)
1994
1996
  for (let s = r; s < t; s++) {
1995
- const l = this.deltas.get(s);
1996
- l === void 0 || l === 0 || this._propagateDeltaToGrownNodes(s, l, t, e);
1997
+ const a = this.deltas.get(s);
1998
+ a === void 0 || a === 0 || this._propagateDeltaToGrownNodes(s, a, t, e);
1997
1999
  }
1998
2000
  else
1999
- for (const [s, l] of this.deltas.entries())
2000
- l === 0 || s < r || this._propagateDeltaToGrownNodes(s, l, t, e);
2001
+ for (const [s, a] of this.deltas.entries())
2002
+ a === 0 || s < r || this._propagateDeltaToGrownNodes(s, a, t, e);
2001
2003
  }
2002
2004
  this.total = this._computeTreeTotal();
2003
2005
  }
@@ -2067,20 +2069,20 @@ class ae {
2067
2069
  return this._findIndex(t, e ?? {}, !1);
2068
2070
  }
2069
2071
  }
2070
- const Pr = (n, t) => {
2072
+ const Mr = (n, t) => {
2071
2073
  const e = n?.sampleRange, r = t?.sampleRange;
2072
2074
  return e === r ? !1 : e && r ? e.from !== r.from || e.to !== r.to : !0;
2073
- }, Mr = (n, t, e) => {
2074
- const r = Number.isFinite(n) && n > 0 ? Math.trunc(n) : 0, i = T(null), s = T({ size: r, valueOrFn: t, options: e });
2075
- i.current === null && (i.current = new ae(r, t, e));
2076
- const l = i.current, c = s.current, f = c.size !== r, x = c.valueOrFn !== t, I = Pr(c.options, e), P = c.size === 0 && r > 0 && (!i.current || i.current.base === 0);
2077
- if (x || I) {
2075
+ }, yr = (n, t, e) => {
2076
+ const r = Number.isFinite(n) && n > 0 ? Math.trunc(n) : 0, i = I(null), s = I({ size: r, valueOrFn: t, options: e });
2077
+ i.current === null && (i.current = new me(r, t, e));
2078
+ const a = i.current, c = s.current, d = c.size !== r, b = c.valueOrFn !== t, x = Mr(c.options, e), v = c.size === 0 && r > 0 && (!i.current || i.current.base === 0);
2079
+ if (b || x) {
2078
2080
  const E = e?.resetOnValueFnChange ?? !0;
2079
- I || x && E || P ? (e?.debug && C.debug("[useFenwickMapTree] reset", { valueOrFnChanged: x, optionsChanged: I }), l.reset(r, t, e)) : (f && (e?.debug && C.debug("[useFenwickMapTree] resize (with valueFn change)", { from: c.size, to: r }), l.changeSize(r)), e?.debug && C.debug("[useFenwickMapTree] setValueFn (no reset)", { valueOrFnChanged: x }), l.setValueFn(t, { reset: !1 })), s.current = { size: r, valueOrFn: t, options: e };
2080
- } else f && (e?.debug && C.debug("[useFenwickMapTree] resize", { from: c.size, to: r }), P ? l.reset(r, t, e) : l.changeSize(r), s.current = { size: r, valueOrFn: t, options: e });
2081
- return l;
2081
+ x || b && E || v ? (e?.debug && C.debug("[useFenwickMapTree] reset", { valueOrFnChanged: b, optionsChanged: x }), a.reset(r, t, e)) : (d && (e?.debug && C.debug("[useFenwickMapTree] resize (with valueFn change)", { from: c.size, to: r }), a.changeSize(r)), e?.debug && C.debug("[useFenwickMapTree] setValueFn (no reset)", { valueOrFnChanged: b }), a.setValueFn(t, { reset: !1 })), s.current = { size: r, valueOrFn: t, options: e };
2082
+ } else d && (e?.debug && C.debug("[useFenwickMapTree] resize", { from: c.size, to: r }), v ? a.reset(r, t, e) : a.changeSize(r), s.current = { size: r, valueOrFn: t, options: e });
2083
+ return a;
2082
2084
  };
2083
- class yr {
2085
+ class wr {
2084
2086
  key;
2085
2087
  value;
2086
2088
  prev = null;
@@ -2089,7 +2091,7 @@ class yr {
2089
2091
  this.key = t, this.value = e;
2090
2092
  }
2091
2093
  }
2092
- class Fe {
2094
+ class ze {
2093
2095
  head = null;
2094
2096
  tail = null;
2095
2097
  /**
@@ -2130,242 +2132,242 @@ class Fe {
2130
2132
  this.remove(t), this.addToTail(t);
2131
2133
  }
2132
2134
  }
2133
- function wr(n) {
2134
- const t = T(/* @__PURE__ */ new Map()), e = T(new Fe()), r = Math.floor(n), i = T(r);
2135
- Y(() => {
2135
+ function Rr(n) {
2136
+ const t = I(/* @__PURE__ */ new Map()), e = I(new ze()), r = Math.floor(n), i = I(r);
2137
+ q(() => {
2136
2138
  if (i.current = r, Number.isNaN(r) || r < 0) {
2137
- C.warn(`useLruCache: invalid capacity ${n}; the cache will not store any entries.`), t.current.clear(), e.current = new Fe();
2139
+ C.warn(`useLruCache: invalid capacity ${n}; the cache will not store any entries.`), t.current.clear(), e.current = new ze();
2138
2140
  return;
2139
2141
  }
2140
2142
  if (Number.isFinite(r))
2141
2143
  for (; t.current.size > r; ) {
2142
- const I = e.current.removeHead();
2143
- if (I)
2144
- t.current.delete(I.key);
2144
+ const x = e.current.removeHead();
2145
+ if (x)
2146
+ t.current.delete(x.key);
2145
2147
  else
2146
2148
  break;
2147
2149
  }
2148
2150
  }, [n, r]);
2149
- const s = v((I) => {
2150
- const P = t.current.get(I);
2151
- if (P)
2152
- return e.current.moveToTail(P), P.value;
2153
- }, []), l = v((I, P) => {
2151
+ const s = S((x) => {
2152
+ const v = t.current.get(x);
2153
+ if (v)
2154
+ return e.current.moveToTail(v), v.value;
2155
+ }, []), a = S((x, v) => {
2154
2156
  const E = i.current;
2155
2157
  if (Number.isNaN(E) || E <= 0)
2156
2158
  return;
2157
- let g = t.current.get(I);
2158
- if (g)
2159
- g.value = P, e.current.moveToTail(g);
2159
+ let m = t.current.get(x);
2160
+ if (m)
2161
+ m.value = v, e.current.moveToTail(m);
2160
2162
  else {
2161
2163
  if (t.current.size >= E) {
2162
2164
  const _ = e.current.removeHead();
2163
2165
  _ && t.current.delete(_.key);
2164
2166
  }
2165
- g = new yr(I, P), t.current.set(I, g), e.current.addToTail(g);
2167
+ m = new wr(x, v), t.current.set(x, m), e.current.addToTail(m);
2166
2168
  }
2167
- }, []), c = v((I) => t.current.has(I), []), f = v((I) => {
2168
- const P = t.current.get(I);
2169
- P && (e.current.remove(P), t.current.delete(I));
2170
- }, []), x = v(() => {
2171
- t.current.clear(), e.current = new Fe();
2169
+ }, []), c = S((x) => t.current.has(x), []), d = S((x) => {
2170
+ const v = t.current.get(x);
2171
+ v && (e.current.remove(v), t.current.delete(x));
2172
+ }, []), b = S(() => {
2173
+ t.current.clear(), e.current = new ze();
2172
2174
  }, []);
2173
- return At(() => ({ get: s, set: l, has: c, remove: f, clear: x }), [s, l, c, f, x]);
2175
+ return Lt(() => ({ get: s, set: a, has: c, remove: d, clear: b }), [s, a, c, d, b]);
2174
2176
  }
2175
- const Rr = 1e4, Or = () => {
2176
- const { get: n, set: t, has: e, clear: r } = wr(Rr);
2177
- return At(() => ({ get: n, set: t, has: e, clear: r }), [n, t, e, r]);
2178
- }, bt = (n, t) => t <= 0 ? 0 : xt(n, 0, t - 1), Ue = (n) => ({
2177
+ const Cr = 1e4, Fr = () => {
2178
+ const { get: n, set: t, has: e, clear: r } = Rr(Cr);
2179
+ return Lt(() => ({ get: n, set: t, has: e, clear: r }), [n, t, e, r]);
2180
+ }, It = (n, t) => t <= 0 ? 0 : vt(n, 0, t - 1), Ke = (n) => ({
2179
2181
  top: Math.max(0, n?.top ?? 0),
2180
2182
  bottom: Math.max(0, n?.bottom ?? 0)
2181
- }), ne = (n, t) => n <= t ? 0 : n - t, be = (n, t) => n <= 0 ? t : n + t, Ve = 1e3, Ke = 2e3, Cr = 1048576, Me = (n) => {
2183
+ }), oe = (n, t) => n <= t ? 0 : n - t, Ie = (n, t) => n <= 0 ? t : n + t, Ae = 1e3, We = 2e3, Er = 1048576, ye = (n) => {
2182
2184
  if (!Number.isFinite(n)) return 0n;
2183
2185
  const t = Math.trunc(n);
2184
2186
  return t <= 0 ? 0n : BigInt(t);
2185
- }, Er = (n, t, e, r, i, s, l, c) => {
2186
- const f = Me(r);
2187
- if (f === 0n)
2187
+ }, Nr = (n, t, e, r, i, s, a, c) => {
2188
+ const d = ye(r);
2189
+ if (d === 0n)
2188
2190
  return { renderingStartIndex: 0, renderingEndIndex: 0, visibleStartIndex: 0, visibleEndIndex: 0 };
2189
- const x = (D) => D < 0n ? 0n : D >= f ? f - 1n : D, I = { materializeOption: { materialize: !1 } }, { index: P, cumulative: E } = s.findIndexAtOrAfter(n, I);
2190
- let g;
2191
- P === -1 ? g = f - 1n : (E === n ? g = Me(P + 1) : g = Me(P), g >= f && (g = f - 1n)), n <= 0 && (g = 0n), c && n >= l && (g = f - 1n);
2191
+ const b = (D) => D < 0n ? 0n : D >= d ? d - 1n : D, x = { materializeOption: { materialize: !1 } }, { index: v, cumulative: E } = s.findIndexAtOrAfter(n, x);
2192
+ let m;
2193
+ v === -1 ? m = d - 1n : (E === n ? m = ye(v + 1) : m = ye(v), m >= d && (m = d - 1n)), n <= 0 && (m = 0n), c && n >= a && (m = d - 1n);
2192
2194
  const _ = (D) => {
2193
- const O = Number(D);
2194
- if (!Number.isSafeInteger(O))
2195
+ const k = Number(D);
2196
+ if (!Number.isSafeInteger(k))
2195
2197
  return null;
2196
- const { cumulative: M } = s.prefixSum(O, { materializeOption: { materialize: !1 } });
2197
- if (!Number.isFinite(M))
2198
+ const { cumulative: P } = s.prefixSum(k, { materializeOption: { materialize: !1 } });
2199
+ if (!Number.isFinite(P))
2198
2200
  return null;
2199
- const { index: B } = s.findIndexAtOrAfter(M + 0.5, { materializeOption: { materialize: !1 } });
2200
- if (B === -1)
2201
+ const { index: X } = s.findIndexAtOrAfter(P + 0.5, { materializeOption: { materialize: !1 } });
2202
+ if (X === -1)
2201
2203
  return null;
2202
- const N = Me(B);
2203
- return N > D ? N : null;
2204
- }, z = (D) => {
2205
- let O = 0, M = D, B = D, N = 0n, q = 0;
2206
- for (; M < f && O < t; ) {
2207
- const et = Number(M), G = i(et);
2208
- if (O += G, B = M, M += 1n, N += 1n, !Number.isFinite(G) || G < 0)
2204
+ const $ = ye(X);
2205
+ return $ > D ? $ : null;
2206
+ }, B = (D) => {
2207
+ let k = 0, P = D, X = D, $ = 0n, N = 0;
2208
+ for (; P < d && k < t; ) {
2209
+ const lt = Number(P), K = i(lt);
2210
+ if (k += K, X = P, P += 1n, $ += 1n, !Number.isFinite(K) || K < 0)
2209
2211
  break;
2210
- if (G === 0) {
2211
- if (q += 1, q > Ve) {
2212
- const h = _(B);
2213
- if (h !== null && h > M)
2214
- M = h, q = 0;
2215
- else if (h !== null && h === M && i(Number(M)) > 0)
2216
- q = 0;
2212
+ if (K === 0) {
2213
+ if (N += 1, N > Ae) {
2214
+ const T = _(X);
2215
+ if (T !== null && T > P)
2216
+ P = T, N = 0;
2217
+ else if (T !== null && T === P && i(Number(P)) > 0)
2218
+ N = 0;
2217
2219
  else
2218
2220
  break;
2219
2221
  }
2220
2222
  } else
2221
- q = 0;
2223
+ N = 0;
2222
2224
  }
2223
- return N === 0n && (B = D), { height: O, end: B };
2225
+ return $ === 0n && (X = D), { height: k, end: X };
2224
2226
  };
2225
- let { height: j, end: ft } = z(g);
2226
- if (j < t && g > 0n) {
2227
- let D = g, O = j, M = 0;
2228
- for (; D > 0n && O < t; ) {
2227
+ let { height: Z, end: ut } = B(m);
2228
+ if (Z < t && m > 0n) {
2229
+ let D = m, k = Z, P = 0;
2230
+ for (; D > 0n && k < t; ) {
2229
2231
  D -= 1n;
2230
- const N = Number(D), q = i(N);
2231
- if (O += q, !Number.isFinite(q) || q < 0)
2232
+ const $ = Number(D), N = i($);
2233
+ if (k += N, !Number.isFinite(N) || N < 0)
2232
2234
  break;
2233
- if (q === 0) {
2234
- if (M += 1, M > Ve) {
2235
- const et = Number(D);
2236
- if (!Number.isSafeInteger(et))
2235
+ if (N === 0) {
2236
+ if (P += 1, P > Ae) {
2237
+ const lt = Number(D);
2238
+ if (!Number.isSafeInteger(lt))
2237
2239
  break;
2238
- const { cumulative: G } = s.prefixSum(et, { materializeOption: { materialize: !1 } });
2239
- if (!Number.isFinite(G))
2240
+ const { cumulative: K } = s.prefixSum(lt, { materializeOption: { materialize: !1 } });
2241
+ if (!Number.isFinite(K))
2240
2242
  break;
2241
- const { index: h } = s.findIndexAtOrAfter(G - 0.5, { materializeOption: { materialize: !1 } }), $ = h === -1 ? -1n : Me(h);
2242
- if ($ >= 0n && $ < D)
2243
- D = $ + 1n, M = 0;
2244
- else if ($ === D && D >= 1n && i(Number(D - 1n)) > 0)
2245
- M = 0;
2243
+ const { index: T } = s.findIndexAtOrAfter(K - 0.5, { materializeOption: { materialize: !1 } }), V = T === -1 ? -1n : ye(T);
2244
+ if (V >= 0n && V < D)
2245
+ D = V + 1n, P = 0;
2246
+ else if (V === D && D >= 1n && i(Number(D - 1n)) > 0)
2247
+ P = 0;
2246
2248
  else
2247
2249
  break;
2248
2250
  }
2249
2251
  } else
2250
- M = 0;
2252
+ P = 0;
2251
2253
  }
2252
- g = x(D);
2253
- const B = z(g);
2254
- j = B.height, ft = B.end;
2254
+ m = b(D);
2255
+ const X = B(m);
2256
+ Z = X.height, ut = X.end;
2255
2257
  }
2256
- const Q = x(g), tt = x(ft), pt = x(Q - BigInt(Math.max(0, e))), It = x(tt + BigInt(Math.max(0, e)));
2258
+ const rt = b(m), nt = b(ut), pt = b(rt - BigInt(Math.max(0, e))), Pt = b(nt + BigInt(Math.max(0, e)));
2257
2259
  return {
2258
- renderingStartIndex: bt(Number(pt), r),
2259
- renderingEndIndex: bt(Number(It), r),
2260
- visibleStartIndex: bt(Number(Q), r),
2261
- visibleEndIndex: bt(Number(tt), r)
2260
+ renderingStartIndex: It(Number(pt), r),
2261
+ renderingEndIndex: It(Number(Pt), r),
2262
+ visibleStartIndex: It(Number(rt), r),
2263
+ visibleEndIndex: It(Number(nt), r)
2262
2264
  };
2263
- }, Nr = (n, t, e, r, i, s, l) => {
2265
+ }, Vr = (n, t, e, r, i, s, a) => {
2264
2266
  if (r === 0)
2265
2267
  return { renderingStartIndex: 0, renderingEndIndex: 0, visibleStartIndex: 0, visibleEndIndex: 0 };
2266
- const c = Number.isFinite(l), f = c ? Math.min(Math.max(0, n), l) : Math.max(0, n);
2268
+ const c = Number.isFinite(a), d = c ? Math.min(Math.max(0, n), a) : Math.max(0, n);
2267
2269
  if (r >= Number.MAX_SAFE_INTEGER)
2268
- return Er(f, t, e, r, i, s, l, c);
2269
- const { index: x, cumulative: I, currentValue: P } = s.findIndexAtOrAfter(f, { materializeOption: { materialize: !1 } }), E = x === -1 ? t <= 0 || (I ?? 0) < f + (P ?? 0) ? r - 1 : 0 : x;
2270
- let g = bt(E, r), _ = 0;
2271
- if (x !== -1 && I === f)
2272
- g = bt(x + 1, r), _ = 0;
2273
- else if (g === x && I !== void 0 && P !== void 0)
2274
- _ = I - P - f;
2270
+ return Nr(d, t, e, r, i, s, a, c);
2271
+ const { index: b, cumulative: x, currentValue: v } = s.findIndexAtOrAfter(d, { materializeOption: { materialize: !1 } }), E = b === -1 ? t <= 0 || (x ?? 0) < d + (v ?? 0) ? r - 1 : 0 : b;
2272
+ let m = It(E, r), _ = 0;
2273
+ if (b !== -1 && x === d)
2274
+ m = It(b + 1, r), _ = 0;
2275
+ else if (m === b && x !== void 0 && v !== void 0)
2276
+ _ = x - v - d;
2275
2277
  else {
2276
- const { cumulative: D, currentValue: O } = s.prefixSum(g, { materializeOption: { materialize: !1 } });
2277
- _ = (D ?? 0) - (O ?? 0) - f;
2278
+ const { cumulative: D, currentValue: k } = s.prefixSum(m, { materializeOption: { materialize: !1 } });
2279
+ _ = (D ?? 0) - (k ?? 0) - d;
2278
2280
  }
2279
- const z = _, j = (D, O) => {
2280
- let M = D, B = O, N = 0;
2281
- for (; M < r && B < t; ) {
2282
- const q = i(M);
2283
- if (B += q, M++, !Number.isFinite(q) || q < 0)
2281
+ const B = _, Z = (D, k) => {
2282
+ let P = D, X = k, $ = 0;
2283
+ for (; P < r && X < t; ) {
2284
+ const N = i(P);
2285
+ if (X += N, P++, !Number.isFinite(N) || N < 0)
2284
2286
  break;
2285
- if (q === 0) {
2286
- if (N++, N > Ve) {
2287
- const { cumulative: et } = s.prefixSum(M - 1, { materializeOption: { materialize: !1 } }), { index: G } = Number.isFinite(et) ? s.findIndexAtOrAfter(et + 0.5, { materializeOption: { materialize: !1 } }) : { index: -1 };
2288
- if (G > M)
2289
- M = G, N = 0;
2290
- else if (G === M && i(M) > 0)
2291
- N = 0;
2287
+ if (N === 0) {
2288
+ if ($++, $ > Ae) {
2289
+ const { cumulative: lt } = s.prefixSum(P - 1, { materializeOption: { materialize: !1 } }), { index: K } = Number.isFinite(lt) ? s.findIndexAtOrAfter(lt + 0.5, { materializeOption: { materialize: !1 } }) : { index: -1 };
2290
+ if (K > P)
2291
+ P = K, $ = 0;
2292
+ else if (K === P && i(P) > 0)
2293
+ $ = 0;
2292
2294
  else
2293
2295
  break;
2294
2296
  }
2295
2297
  } else
2296
- N = 0;
2298
+ $ = 0;
2297
2299
  }
2298
- return { cursor: M, height: B };
2299
- }, ft = j(g, _);
2300
- let Q = ft.cursor;
2301
- if (_ = ft.height, _ < t && g > 0) {
2302
- let D = _ + Math.abs(Math.min(0, z)), O = g - 1, M = 0;
2303
- for (; O >= 0 && D < t; ) {
2304
- const N = i(O);
2305
- if (D += N, !Number.isFinite(N) || N < 0) {
2306
- O--;
2300
+ return { cursor: P, height: X };
2301
+ }, ut = Z(m, _);
2302
+ let rt = ut.cursor;
2303
+ if (_ = ut.height, _ < t && m > 0) {
2304
+ let D = _ + Math.abs(Math.min(0, B)), k = m - 1, P = 0;
2305
+ for (; k >= 0 && D < t; ) {
2306
+ const $ = i(k);
2307
+ if (D += $, !Number.isFinite($) || $ < 0) {
2308
+ k--;
2307
2309
  break;
2308
2310
  }
2309
- if (N === 0) {
2310
- if (M++, M > Ve) {
2311
- const { cumulative: q } = s.prefixSum(O, { materializeOption: { materialize: !1 } }), { index: et } = Number.isFinite(q) ? s.findIndexAtOrAfter(q - 0.5, { materializeOption: { materialize: !1 } }) : { index: -1 };
2312
- if (et !== -1 && et < O) {
2313
- O = et, M = 0;
2311
+ if ($ === 0) {
2312
+ if (P++, P > Ae) {
2313
+ const { cumulative: N } = s.prefixSum(k, { materializeOption: { materialize: !1 } }), { index: lt } = Number.isFinite(N) ? s.findIndexAtOrAfter(N - 0.5, { materializeOption: { materialize: !1 } }) : { index: -1 };
2314
+ if (lt !== -1 && lt < k) {
2315
+ k = lt, P = 0;
2314
2316
  continue;
2315
2317
  }
2316
- if (et === O && O >= 1 && i(O - 1) > 0)
2317
- M = 0;
2318
+ if (lt === k && k >= 1 && i(k - 1) > 0)
2319
+ P = 0;
2318
2320
  else {
2319
- O--;
2321
+ k--;
2320
2322
  break;
2321
2323
  }
2322
2324
  }
2323
2325
  } else
2324
- M = 0;
2325
- O--;
2326
+ P = 0;
2327
+ k--;
2326
2328
  }
2327
- g = bt(O + 1, r);
2328
- const B = j(g, 0);
2329
- Q = B.cursor, _ = B.height;
2329
+ m = It(k + 1, r);
2330
+ const X = Z(m, 0);
2331
+ rt = X.cursor, _ = X.height;
2330
2332
  }
2331
- const tt = bt(g - e, r), pt = bt(Math.max(Q - 1, g), r), It = bt(pt + e, r);
2332
- return { renderingStartIndex: tt, renderingEndIndex: It, visibleStartIndex: g, visibleEndIndex: pt };
2333
- }, We = (n, t, e) => {
2334
- const r = Math.max(0, t ?? 0), i = T({ last: 0, id: null, arg: null }).current;
2335
- return Y(
2333
+ const nt = It(m - e, r), pt = It(Math.max(rt - 1, m), r), Pt = It(pt + e, r);
2334
+ return { renderingStartIndex: nt, renderingEndIndex: Pt, visibleStartIndex: m, visibleEndIndex: pt };
2335
+ }, je = (n, t, e) => {
2336
+ const r = Math.max(0, t ?? 0), i = I({ last: 0, id: null, arg: null }).current;
2337
+ return q(
2336
2338
  () => () => {
2337
2339
  i.id !== null && (cancelAnimationFrame(i.id), i.id = null);
2338
2340
  },
2339
2341
  [i]
2340
- ), v(
2342
+ ), S(
2341
2343
  (s) => {
2342
2344
  if (i.arg = s, i.id !== null) return;
2343
- const l = (c) => {
2345
+ const a = (c) => {
2344
2346
  if (i.id = null, i.arg === null) return;
2345
- const f = c - i.last;
2346
- if (r === 0 || i.last === 0 || f >= r) {
2347
+ const d = c - i.last;
2348
+ if (r === 0 || i.last === 0 || d >= r) {
2347
2349
  if (n.current)
2348
2350
  try {
2349
2351
  e(n.current, i.arg);
2350
- } catch (x) {
2351
- console.error("[useThrottledInvoker] Error invoking callback", x);
2352
+ } catch (b) {
2353
+ console.error("[useThrottledInvoker] Error invoking callback", b);
2352
2354
  }
2353
2355
  i.arg = null, i.last = c;
2354
2356
  }
2355
- i.arg !== null && (i.id = requestAnimationFrame(l));
2357
+ i.arg !== null && (i.id = requestAnimationFrame(a));
2356
2358
  };
2357
- i.id = requestAnimationFrame(l);
2359
+ i.id = requestAnimationFrame(a);
2358
2360
  },
2359
2361
  [r, e, n, i]
2360
2362
  );
2361
- }, Vr = Je.memo(({ index: n, top: t, height: e, item: r, children: i, clipItemHeight: s, enableKeyboardNavigation: l, onKeyDown: c, onFocus: f, registerItemRef: x }) => {
2362
- const I = v((_) => x(n, _), [n, x]), P = v((_) => c(_, n), [n, c]), E = v(() => f(n), [n, f]), g = v((_) => {
2363
+ }, Ar = Qe.memo(({ index: n, top: t, height: e, item: r, children: i, clipItemHeight: s, enableKeyboardNavigation: a, onKeyDown: c, onFocus: d, registerItemRef: b }) => {
2364
+ const x = S((_) => b(n, _), [n, b]), v = S((_) => c(_, n), [n, c]), E = S(() => d(n), [n, d]), m = S((_) => {
2363
2365
  _.currentTarget.focus({ preventScroll: !0 });
2364
2366
  }, []);
2365
- return /* @__PURE__ */ it(
2367
+ return /* @__PURE__ */ ot(
2366
2368
  "div",
2367
2369
  {
2368
- ref: I,
2370
+ ref: x,
2369
2371
  "data-index": n,
2370
2372
  "data-virtualscroll-item": "true",
2371
2373
  className: "aqvs-item-container",
@@ -2374,580 +2376,582 @@ const Rr = 1e4, Or = () => {
2374
2376
  height: e,
2375
2377
  overflow: s ? "hidden" : void 0
2376
2378
  },
2377
- tabIndex: l ? -1 : void 0,
2378
- onPointerDown: l ? g : void 0,
2379
- onKeyDownCapture: l ? P : void 0,
2380
- onFocusCapture: l ? E : void 0,
2379
+ tabIndex: a ? -1 : void 0,
2380
+ onPointerDown: a ? m : void 0,
2381
+ onKeyDownCapture: a ? v : void 0,
2382
+ onFocusCapture: a ? E : void 0,
2381
2383
  children: i(r, n)
2382
2384
  }
2383
2385
  );
2384
- }), Ar = ({
2386
+ }), Dr = ({
2385
2387
  itemCount: n,
2386
2388
  getItem: t,
2387
2389
  getItemKey: e,
2388
2390
  getItemHeight: r,
2389
2391
  viewportSize: i,
2390
2392
  overscanCount: s = 15,
2391
- className: l,
2393
+ className: a,
2392
2394
  testId: c,
2393
- onScroll: f,
2394
- onRangeChange: x,
2395
- children: I,
2396
- background: P,
2395
+ onScroll: d,
2396
+ onRangeChange: b,
2397
+ children: x,
2398
+ background: v,
2397
2399
  initialScrollIndex: E,
2398
- initialScrollOffset: g,
2400
+ initialScrollOffset: m,
2399
2401
  callbackThrottleMs: _ = 5,
2400
- contentInsets: z,
2401
- onItemFocus: j,
2402
- scrollBarOptions: ft,
2403
- behaviorOptions: Q,
2404
- onWheelHorizontal: tt
2405
- }, pt) => {
2406
- const { width: It, enableThumbDrag: D, enableTrackClick: O, enableArrowButtons: M, enableScrollToTopBottomButtons: B, renderThumbOverlay: N, tapScrollCircleOptions: q } = ft ?? {}, { enablePointerDrag: et, pointerDragInputs: G, enableKeyboardNavigation: h = !0, wheelSpeedMultiplier: $, inertiaOptions: Tt, clipItemHeight: wt = !1, resetOnGetItemHeightChange: Z = !1 } = Q ?? {}, k = T(null), Rt = T({
2402
+ contentInsets: B,
2403
+ onItemFocus: Z,
2404
+ scrollBarOptions: ut,
2405
+ behaviorOptions: rt,
2406
+ onWheelHorizontal: nt,
2407
+ contentProps: pt
2408
+ }, Pt) => {
2409
+ const { width: D, enableThumbDrag: k, enableTrackClick: P, enableArrowButtons: X, enableScrollToTopBottomButtons: $, renderThumbOverlay: N, tapScrollCircleOptions: lt } = ut ?? {}, { enablePointerDrag: K, pointerDragInputs: T, enableKeyboardNavigation: V = !0, wheelSpeedMultiplier: Tt, inertiaOptions: Yt, clipItemHeight: yt = !1, resetOnGetItemHeightChange: J = !1 } = rt ?? {}, F = I(null), Ct = I({
2407
2410
  renderingStartIndex: 0,
2408
2411
  renderingEndIndex: 0,
2409
2412
  visibleStartIndex: 0,
2410
2413
  visibleEndIndex: 0,
2411
2414
  scrollPosition: 0,
2412
2415
  totalHeight: 0
2413
- }), U = T(null), Ct = T(!1);
2414
- Y(() => {
2415
- Z && (U.current = null);
2416
- }, [Z, r]);
2417
- const w = At(() => Ue(z), [z]), [Yt] = Zt(() => {
2416
+ }), W = I(null), At = I(!1);
2417
+ q(() => {
2418
+ J && (W.current = null);
2419
+ }, [J, r]);
2420
+ const y = Lt(() => Ke(B), [B]), [Kt] = Jt(() => {
2418
2421
  const u = typeof E == "number" && Number.isFinite(E) ? Math.max(0, Math.trunc(E)) : 0;
2419
2422
  return { from: Math.max(0, u - 50), to: u + 50 };
2420
- }), Xt = At(
2423
+ }), ae = Lt(
2421
2424
  // 目的: Fenwick Tree のオプション設定
2422
2425
  // 依存関係: resetOnGetItemHeightChange, initialSampleRange (マウント時固定)
2423
2426
  // itemCount には依存させない (依存させると追記のたびに options 参照が変わり、計測済み高さが全消去される)。
2424
2427
  // この useMemo により sampleRange を毎レンダー新規生成しない = 参照同一性由来の破壊的 reset を防ぐ。
2425
2428
  () => ({
2426
- sampleRange: Yt,
2427
- resetOnValueFnChange: Z,
2429
+ sampleRange: Kt,
2430
+ resetOnValueFnChange: J,
2428
2431
  materialize: !0
2429
2432
  }),
2430
- [Z, Yt]
2431
- ), S = Mr(n, r, Xt), [$t] = Zt(() => {
2432
- let a = 0, u = 0;
2433
+ [J, Kt]
2434
+ ), A = yr(n, r, ae), [j] = Jt(() => {
2435
+ let l = 0, u = 0;
2433
2436
  if (typeof E == "number") {
2434
- const p = xt(E, 0, n - 1), V = xt(p - s * 2, 0, n - 1), A = xt(p + s * 2, 0, n - 1), F = E > 0 ? { materializeOption: { materialize: !0, ranges: [{ from: V, to: A }] } } : void 0, { cumulative: K, total: W, currentValue: vt } = S.prefixSum(E, F), ht = Math.max(K - vt, 0);
2435
- a = be(ht, w.top), u = W ?? S.getTotal();
2436
- } else typeof g == "number" && (a = be(Math.max(g, 0), w.top)), u = S.getTotal();
2437
- return { position: a, total: u };
2438
- }), [Bt, Jt] = Zt($t.position), [lt, Wt] = Zt($t.total), d = T($t.position), mt = T(w.top), ct = T(f ?? void 0), H = T(x ?? void 0), nt = T(/* @__PURE__ */ new Map()), J = T(null), Pt = T(null), [Mt, Et] = Zt(null), [st, St] = Zt(!1), yt = T(null), ut = T(!1), ot = T(0), Dt = T(!1), qt = T(!1), le = T(n);
2439
- le.current !== n && (le.current = n, qt.current = !0), Y(() => {
2440
- ct.current = f ?? void 0, H.current = x ?? void 0;
2441
- }, [x, f]);
2442
- const dt = v(
2443
- (a) => {
2444
- if (h && a && typeof a.focus == "function")
2437
+ const h = vt(E, 0, n - 1), R = vt(h - s * 2, 0, n - 1), O = vt(h + s * 2, 0, n - 1), Y = E > 0 ? { materializeOption: { materialize: !0, ranges: [{ from: R, to: O }] } } : void 0, { cumulative: U, total: G, currentValue: Rt } = A.prefixSum(E, Y), bt = Math.max(U - Rt, 0);
2438
+ l = Ie(bt, y.top), u = G ?? A.getTotal();
2439
+ } else typeof m == "number" && (l = Ie(Math.max(m, 0), y.top)), u = A.getTotal();
2440
+ return { position: l, total: u };
2441
+ }), [Bt, _t] = Jt(j.position), [Et, Xt] = Jt(j.total), dt = I(j.position), p = I(y.top), ft = I(d ?? void 0), mt = I(b ?? void 0), z = I(/* @__PURE__ */ new Map()), et = I(null), ct = I(null), [kt, Ot] = Jt(null), [Mt, it] = Jt(!1), ht = I(null), st = I(!1), Q = I(0), qt = I(!1), le = I(!1), Nt = I(n);
2442
+ Nt.current !== n && (Nt.current = n, le.current = !0), q(() => {
2443
+ ft.current = d ?? void 0, mt.current = b ?? void 0;
2444
+ }, [b, d]);
2445
+ const $t = S(
2446
+ (l) => {
2447
+ if (V && l && typeof l.focus == "function")
2445
2448
  try {
2446
- a.focus({ preventScroll: !0 });
2449
+ l.focus({ preventScroll: !0 });
2447
2450
  } catch {
2448
- a.focus();
2451
+ l.focus();
2449
2452
  }
2450
2453
  },
2451
- [h]
2452
- ), Qt = v((a, { position: u, totalHeight: p }) => {
2453
- a(u, p);
2454
- }, []), m = We(ct, _, Qt), y = v((a, u) => {
2455
- a(u);
2456
- }, []), Nt = We(H, _, y), Lt = T(w.top);
2457
- Lt.current = w.top;
2458
- const at = T(m);
2459
- at.current = m, Y(() => (Ct.current = !1, () => {
2460
- Ct.current = !0, yt.current && (clearTimeout(yt.current), yt.current = null);
2461
- }), []), Y(() => {
2462
- h || (nt.current.clear(), J.current = null, Pt.current = null);
2463
- }, [h]);
2464
- const _t = v(
2465
- (a, u) => {
2454
+ [V]
2455
+ ), Gt = S((l, { position: u, totalHeight: h }) => {
2456
+ l(u, h);
2457
+ }, []), Vt = je(ft, _, Gt), f = S((l, u) => {
2458
+ l(u);
2459
+ }, []), w = je(mt, _, f), at = I(y.top);
2460
+ at.current = y.top;
2461
+ const gt = I(Vt);
2462
+ gt.current = Vt, q(() => (At.current = !1, () => {
2463
+ At.current = !0, ht.current && (clearTimeout(ht.current), ht.current = null);
2464
+ }), []), q(() => {
2465
+ V || (z.current.clear(), et.current = null, ct.current = null);
2466
+ }, [V]);
2467
+ const wt = S(
2468
+ (l, u) => {
2466
2469
  if (!u) {
2467
- nt.current.delete(a);
2470
+ z.current.delete(l);
2468
2471
  return;
2469
2472
  }
2470
- h && (nt.current.set(a, u), J.current === a && (J.current = null, Pt.current = a, dt(u)));
2473
+ V && (z.current.set(l, u), et.current === l && (et.current = null, ct.current = l, $t(u)));
2471
2474
  },
2472
- [h, dt]
2473
- ), Ht = 0.01, kt = T({
2475
+ [V, $t]
2476
+ ), Qt = 0.01, Ht = I({
2474
2477
  rafId: null,
2475
2478
  loopActive: !1,
2476
2479
  idleFrames: 0,
2477
- lastRenderedPosition: $t.position
2478
- }), jt = v(() => {
2479
- const a = kt.current;
2480
- a.rafId !== null && typeof cancelAnimationFrame == "function" && cancelAnimationFrame(a.rafId), a.rafId = null, a.loopActive = !1, a.idleFrames = 0;
2480
+ lastRenderedPosition: j.position
2481
+ }), Ut = S(() => {
2482
+ const l = Ht.current;
2483
+ l.rafId !== null && typeof cancelAnimationFrame == "function" && cancelAnimationFrame(l.rafId), l.rafId = null, l.loopActive = !1, l.idleFrames = 0;
2481
2484
  }, []);
2482
- Y(
2485
+ q(
2483
2486
  () => () => {
2484
- jt();
2487
+ Ut();
2485
2488
  },
2486
- [jt]
2489
+ [Ut]
2487
2490
  );
2488
- const ce = T(() => {
2489
- }), fe = v(() => {
2490
- const a = kt.current;
2491
- a.rafId = null;
2492
- const u = d.current, p = ne(u, Lt.current), V = S.getTotal();
2493
- if (Jt((F) => Math.abs(F - u) < Ht ? F : u), Math.abs(a.lastRenderedPosition - u) >= Ht ? (at.current({ position: p, totalHeight: V }), a.lastRenderedPosition = u, a.idleFrames = 0) : a.idleFrames += 1, a.idleFrames >= 2) {
2494
- jt();
2491
+ const te = I(() => {
2492
+ }), ce = S(() => {
2493
+ const l = Ht.current;
2494
+ l.rafId = null;
2495
+ const u = dt.current, h = oe(u, at.current), R = A.getTotal();
2496
+ if (_t((Y) => Math.abs(Y - u) < Qt ? Y : u), Math.abs(l.lastRenderedPosition - u) >= Qt ? (gt.current({ position: h, totalHeight: R }), l.lastRenderedPosition = u, l.idleFrames = 0) : l.idleFrames += 1, l.idleFrames >= 2) {
2497
+ Ut();
2495
2498
  return;
2496
2499
  }
2497
2500
  if (typeof requestAnimationFrame == "function") {
2498
- a.rafId = requestAnimationFrame((F) => ce.current(F));
2501
+ l.rafId = requestAnimationFrame((Y) => te.current(Y));
2499
2502
  return;
2500
2503
  }
2501
- a.loopActive = !1;
2502
- }, [S, jt]);
2503
- ce.current = fe;
2504
- const Ie = v(() => {
2505
- const a = kt.current;
2506
- if (a.idleFrames = 0, !a.loopActive) {
2507
- if (a.loopActive = !0, typeof requestAnimationFrame == "function") {
2508
- a.rafId = requestAnimationFrame(fe);
2504
+ l.loopActive = !1;
2505
+ }, [A, Ut]);
2506
+ te.current = ce;
2507
+ const ue = S(() => {
2508
+ const l = Ht.current;
2509
+ if (l.idleFrames = 0, !l.loopActive) {
2510
+ if (l.loopActive = !0, typeof requestAnimationFrame == "function") {
2511
+ l.rafId = requestAnimationFrame(ce);
2509
2512
  return;
2510
2513
  }
2511
- a.loopActive = !1;
2514
+ l.loopActive = !1;
2512
2515
  }
2513
- }, [fe]), rt = v(
2514
- (a, u) => {
2515
- const p = u?.immediate ?? !1, V = ne(a, w.top);
2516
- if (d.current = a, p) {
2517
- kt.current.lastRenderedPosition = a, kt.current.idleFrames = 0, Jt(a), m({ position: V, totalHeight: S.getTotal() });
2516
+ }, [ce]), tt = S(
2517
+ (l, u) => {
2518
+ const h = u?.immediate ?? !1, R = oe(l, y.top);
2519
+ if (dt.current = l, h) {
2520
+ Ht.current.lastRenderedPosition = l, Ht.current.idleFrames = 0, _t(l), Vt({ position: R, totalHeight: A.getTotal() });
2518
2521
  return;
2519
2522
  }
2520
- Ie();
2523
+ ue();
2521
2524
  },
2522
- [Ie, S, w.top, m]
2523
- ), zt = v((a) => {
2524
- const u = k.current;
2525
+ [ue, A, y.top, Vt]
2526
+ ), ee = S((l) => {
2527
+ const u = F.current;
2525
2528
  if (!u)
2526
- return a;
2527
- const p = u.getScrollPosition();
2528
- ot.current += 1;
2529
- const V = u.scrollTo(a);
2530
- return V === p && (ot.current = Math.max(0, ot.current - 1)), Math.abs(V - a) > 0.5 && (Dt.current = !0), V;
2531
- }, []), Te = T(!1);
2532
- Y(() => {
2533
- if (!Te.current)
2534
- if (Te.current = !0, typeof g == "number") {
2535
- const a = be(Math.max(g, 0), w.top), u = Math.abs(a - d.current) > 0.5;
2536
- rt(a, { immediate: !0 }), u && k.current?.scrollTo(a);
2529
+ return l;
2530
+ const h = u.getScrollPosition();
2531
+ Q.current += 1;
2532
+ const R = u.scrollTo(l);
2533
+ return R === h && (Q.current = Math.max(0, Q.current - 1)), Math.abs(R - l) > 0.5 && (qt.current = !0), R;
2534
+ }, []), Se = I(!1);
2535
+ q(() => {
2536
+ if (!Se.current)
2537
+ if (Se.current = !0, typeof m == "number") {
2538
+ const l = Ie(Math.max(m, 0), y.top), u = Math.abs(l - dt.current) > 0.5;
2539
+ tt(l, { immediate: !0 }), u && F.current?.scrollTo(l);
2537
2540
  } else
2538
- rt(d.current, { immediate: !0 });
2539
- }, [g, w.top, rt]), Y(() => {
2540
- const a = S.getTotal();
2541
- if (lt !== a) {
2542
- Wt(a);
2541
+ tt(dt.current, { immediate: !0 });
2542
+ }, [m, y.top, tt]), q(() => {
2543
+ const l = A.getTotal();
2544
+ if (Et !== l) {
2545
+ Xt(l);
2543
2546
  return;
2544
2547
  }
2545
- if (Dt.current) {
2546
- Dt.current = !1;
2547
- const u = k.current;
2548
- if (u && Math.abs(u.getScrollPosition() - d.current) > 0.5) {
2549
- const p = zt(d.current);
2550
- Dt.current = !1, rt(p, { immediate: !0 });
2548
+ if (qt.current) {
2549
+ qt.current = !1;
2550
+ const u = F.current;
2551
+ if (u && Math.abs(u.getScrollPosition() - dt.current) > 0.5) {
2552
+ const h = ee(dt.current);
2553
+ qt.current = !1, tt(h, { immediate: !0 });
2551
2554
  }
2552
2555
  }
2553
- }, [S, lt, n, zt, rt]), Y(() => {
2554
- if (U.current !== null) {
2555
- const { index: a, align: u, offset: p } = U.current, V = bt(a, n), { cumulative: A, currentValue: F } = S.prefixSum(V, { materializeOption: { materialize: !1 } });
2556
- if (A !== void 0 && F !== void 0) {
2557
- const K = Math.max(A - F, 0);
2558
- let W = K;
2559
- u === "bottom" ? W = A - i : u === "center" && (W = K + F / 2 - i / 2), p && (W -= p), W = Math.max(0, W);
2560
- const vt = Math.max(0, lt + w.top + w.bottom - i), ht = Math.min(be(W, w.top), vt);
2561
- Math.abs(ht - d.current) > 1 && (C.debug("[VirtualScroll] Drift correction", {
2562
- from: d.current,
2563
- to: ht,
2564
- targetIndex: V
2565
- }), ot.current === 0 && (ot.current += 1), k.current?.scrollTo(ht), rt(ht, { immediate: !0 }));
2556
+ }, [A, Et, n, ee, tt]), q(() => {
2557
+ if (W.current !== null) {
2558
+ const { index: l, align: u, offset: h } = W.current, R = It(l, n), { cumulative: O, currentValue: Y } = A.prefixSum(R, { materializeOption: { materialize: !1 } });
2559
+ if (O !== void 0 && Y !== void 0) {
2560
+ const U = Math.max(O - Y, 0);
2561
+ let G = U;
2562
+ u === "bottom" ? G = O - i : u === "center" && (G = U + Y / 2 - i / 2), h && (G -= h), G = Math.max(0, G);
2563
+ const Rt = Math.max(0, Et + y.top + y.bottom - i), bt = Math.min(Ie(G, y.top), Rt);
2564
+ Math.abs(bt - dt.current) > 1 && (C.debug("[VirtualScroll] Drift correction", {
2565
+ from: dt.current,
2566
+ to: bt,
2567
+ targetIndex: R
2568
+ }), Q.current === 0 && (Q.current += 1), F.current?.scrollTo(bt), tt(bt, { immediate: !0 }));
2566
2569
  }
2567
2570
  }
2568
- qt.current = !1;
2569
- }, [lt, S, n, w.top, rt, i, w.bottom]), Y(() => {
2570
- const a = mt.current;
2571
- if (a === w.top) return;
2572
- const u = ne(d.current, a), p = be(u, w.top);
2573
- mt.current = w.top, d.current = p, k.current?.scrollTo(p), rt(p, { immediate: !0 });
2574
- }, [w.top, rt]);
2575
- const Se = v(
2576
- (a, u) => {
2571
+ le.current = !1;
2572
+ }, [Et, A, n, y.top, tt, i, y.bottom]), q(() => {
2573
+ const l = p.current;
2574
+ if (l === y.top) return;
2575
+ const u = oe(dt.current, l), h = Ie(u, y.top);
2576
+ p.current = y.top, dt.current = h, F.current?.scrollTo(h), tt(h, { immediate: !0 });
2577
+ }, [y.top, tt]);
2578
+ const we = S(
2579
+ (l, u) => {
2577
2580
  if (n === 0)
2578
2581
  return;
2579
- const p = bt(a, n), V = S.get(p), A = u - V, F = S.update(p, u);
2580
- F !== void 0 && Wt(F), C.debug("[VirtualScroll] Updated item size manually", { index: p, size: u, total: F });
2581
- let K = U.current ? U.current.index : null;
2582
- if (K === null) {
2583
- const W = d.current, vt = Ue(z).top, ht = ne(W, vt), { index: gt, cumulative: Ot } = S.findIndexAtOrAfter(ht, { materializeOption: { materialize: !1 } });
2584
- K = Ot !== void 0 && Ot === ht ? gt + 1 : gt;
2582
+ const h = It(l, n), R = A.get(h), O = u - R, Y = A.update(h, u);
2583
+ Y !== void 0 && Xt(Y), C.debug("[VirtualScroll] Updated item size manually", { index: h, size: u, total: Y });
2584
+ let U = W.current ? W.current.index : null;
2585
+ if (U === null) {
2586
+ const G = dt.current, Rt = Ke(B).top, bt = oe(G, Rt), { index: xt, cumulative: Ft } = A.findIndexAtOrAfter(bt, { materializeOption: { materialize: !1 } });
2587
+ U = Ft !== void 0 && Ft === bt ? xt + 1 : xt;
2585
2588
  }
2586
- if (K !== -1 && p < K && A !== 0) {
2587
- const W = d.current, vt = W + A;
2588
- zt(vt), rt(vt, { immediate: !0 }), C.debug("[VirtualScroll] Adjusted scroll for layout shift (manual update)", { from: W, to: vt, causedByIndex: p, delta: A, activeVisibleStartIndex: K });
2589
+ if (U !== -1 && h < U && O !== 0) {
2590
+ const G = dt.current, Rt = G + O;
2591
+ ee(Rt), tt(Rt, { immediate: !0 }), C.debug("[VirtualScroll] Adjusted scroll for layout shift (manual update)", { from: G, to: Rt, causedByIndex: h, delta: O, activeVisibleStartIndex: U });
2589
2592
  }
2590
2593
  },
2591
- [S, n, zt, rt, z]
2592
- ), Kt = v(
2593
- (a, u) => {
2594
- if (!k.current || n === 0)
2594
+ [A, n, ee, tt, B]
2595
+ ), Wt = S(
2596
+ (l, u) => {
2597
+ if (!F.current || n === 0)
2595
2598
  return;
2596
- const p = bt(a, n), V = bt(p - s * 2, n), A = bt(p + s * 2, n), { cumulative: F, total: K, currentValue: W } = S.prefixSum(p, { materializeOption: { materialize: !0, ranges: [{ from: V, to: A }] } });
2597
- if (C.debug("[VirtualScroll] Scrolling to index:", p, "ItemBottom:", F, "Total height:", K, "ItemHeight:", W, "safeIndexFrom:", V, "safeIndexTo:", A), !K)
2599
+ const h = It(l, n), R = It(h - s * 2, n), O = It(h + s * 2, n), { cumulative: Y, total: U, currentValue: G } = A.prefixSum(h, { materializeOption: { materialize: !0, ranges: [{ from: R, to: O }] } });
2600
+ if (C.debug("[VirtualScroll] Scrolling to index:", h, "ItemBottom:", Y, "Total height:", U, "ItemHeight:", G, "safeIndexFrom:", R, "safeIndexTo:", O), !U)
2598
2601
  return;
2599
- const vt = Math.max(F - W, 0);
2600
- let ht = vt;
2601
- u?.align === "bottom" ? ht = F - i : u?.align === "center" && (ht = vt + W / 2 - i / 2), u?.offset && (ht -= u.offset), ht = Math.max(0, ht);
2602
- const gt = be(ht, w.top), Ot = k.current?.getContentSize() ?? K + w.top + w.bottom, Vt = Math.max(0, Ot - i), Ft = Math.min(gt, Vt);
2603
- U.current = {
2604
- index: p,
2602
+ const Rt = Math.max(Y - G, 0);
2603
+ let bt = Rt;
2604
+ u?.align === "bottom" ? bt = Y - i : u?.align === "center" && (bt = Rt + G / 2 - i / 2), u?.offset && (bt -= u.offset), bt = Math.max(0, bt);
2605
+ const xt = Ie(bt, y.top), Ft = F.current?.getContentSize() ?? U + y.top + y.bottom, Dt = Math.max(0, Ft - i), zt = Math.min(xt, Dt);
2606
+ W.current = {
2607
+ index: h,
2605
2608
  align: u?.align,
2606
2609
  offset: u?.offset
2607
2610
  };
2608
- const ve = k.current?.getScrollPosition() ?? -1, De = Math.abs(ve - Ft) > 0.5;
2609
- ut.current = !1, ot.current = 0, De && (ut.current = !0, ot.current += 1, k.current?.scrollTo(Ft)), Wt(K), rt(Ft, { immediate: !0 }), C.debug("[VirtualScroll] Setting scroll position to:", Ft, { original: gt, max: Vt });
2611
+ const Pe = F.current?.getScrollPosition() ?? -1, Le = Math.abs(Pe - zt) > 0.5;
2612
+ st.current = !1, Q.current = 0, Le && (st.current = !0, Q.current += 1, F.current?.scrollTo(zt)), Xt(U), tt(zt, { immediate: !0 }), C.debug("[VirtualScroll] Setting scroll position to:", zt, { original: xt, max: Dt });
2610
2613
  },
2611
- [S, s, n, w.top, w.bottom, i, rt]
2612
- ), ye = v(
2613
- (a) => {
2614
- if (!k.current || n === 0)
2614
+ [A, s, n, y.top, y.bottom, i, tt]
2615
+ ), ge = S(
2616
+ (l) => {
2617
+ if (!F.current || n === 0)
2615
2618
  return;
2616
- const u = S.getTotal(), p = xt(Math.floor(a), 0, u), { index: V, cumulative: A, currentValue: F } = S.findIndexAtOrAfter(p, { materializeOption: { materialize: !1 } }), W = (A ?? 0) - (F ?? 0) - p;
2617
- Kt(V, { offset: W });
2619
+ const u = A.getTotal(), h = vt(Math.floor(l), 0, u), { index: R, cumulative: O, currentValue: Y } = A.findIndexAtOrAfter(h, { materializeOption: { materialize: !1 } }), G = (O ?? 0) - (Y ?? 0) - h;
2620
+ Wt(R, { offset: G });
2618
2621
  },
2619
- [S, n, Kt]
2620
- ), me = v(
2621
- (a) => {
2622
- const u = ne(d.current, w.top), p = typeof a == "function" ? a(u) : a;
2623
- ye(p);
2624
- const V = k.current?.getScrollPosition(), A = typeof V == "number" ? V : d.current;
2625
- return rt(A), A;
2622
+ [A, n, Wt]
2623
+ ), Re = S(
2624
+ (l) => {
2625
+ const u = oe(dt.current, y.top), h = typeof l == "function" ? l(u) : l;
2626
+ ge(h);
2627
+ const R = F.current?.getScrollPosition(), O = typeof R == "number" ? R : dt.current;
2628
+ return tt(O), O;
2626
2629
  },
2627
- [w.top, ye, rt]
2628
- ), Ae = v(
2629
- (a, u) => {
2630
- C.debug("[VirtualScroll] Scroll position changed:", a);
2631
- const p = ut.current;
2632
- p && (ut.current = !1);
2633
- const V = ot.current > 0;
2634
- if (V && (ot.current = 0), p || V || qt.current || (U.current = null), rt(a), B) {
2635
- if (p || V)
2630
+ [y.top, ge, tt]
2631
+ ), De = S(
2632
+ (l, u) => {
2633
+ C.debug("[VirtualScroll] Scroll position changed:", l);
2634
+ const h = st.current;
2635
+ h && (st.current = !1);
2636
+ const R = Q.current > 0;
2637
+ if (R && (Q.current = 0), h || R || le.current || (W.current = null), tt(l), $) {
2638
+ if (h || R)
2636
2639
  return;
2637
- const A = a - u;
2638
- if (C.debug("[VirtualScroll] Scroll diff:", A, "New:", a, "Prev:", u), Math.abs(A) > 1) {
2639
- const F = A > 0 ? "down" : "up";
2640
- Et(F), St(!0), C.debug("[VirtualScroll] Showing scroll buttons. Direction:", F), yt.current && clearTimeout(yt.current), yt.current = setTimeout(() => {
2641
- St(!1), C.debug("[VirtualScroll] Hiding scroll buttons");
2640
+ const O = l - u;
2641
+ if (C.debug("[VirtualScroll] Scroll diff:", O, "New:", l, "Prev:", u), Math.abs(O) > 1) {
2642
+ const Y = O > 0 ? "down" : "up";
2643
+ Ot(Y), it(!0), C.debug("[VirtualScroll] Showing scroll buttons. Direction:", Y), ht.current && clearTimeout(ht.current), ht.current = setTimeout(() => {
2644
+ it(!1), C.debug("[VirtualScroll] Hiding scroll buttons");
2642
2645
  }, 2e3);
2643
2646
  }
2644
2647
  }
2645
2648
  },
2646
- [rt, B]
2647
- ), te = At(() => ne(Bt, w.top), [w.top, Bt]), ie = At(() => {
2648
- const a = S.getTotal(), u = Nr(te, i, s, n, r, S, a);
2649
+ [tt, $]
2650
+ ), re = Lt(() => oe(Bt, y.top), [y.top, Bt]), jt = Lt(() => {
2651
+ const l = A.getTotal(), u = Vr(re, i, s, n, r, A, l);
2649
2652
  return C.debug("[VirtualScroll] Calculated rendering range:", () => ({
2650
2653
  ...u,
2651
- scrollPosition: te,
2652
- renderingContentSize: a,
2654
+ scrollPosition: re,
2655
+ renderingContentSize: l,
2653
2656
  overscanCount: s,
2654
2657
  viewportSize: i
2655
2658
  })), u;
2656
- }, [te, i, s, n, r, S]), { renderingStartIndex: Ut, renderingEndIndex: ee, visibleStartIndex: se, visibleEndIndex: pe } = ie, re = v(
2657
- (a, u) => {
2658
- if (!h || n === 0)
2659
+ }, [re, i, s, n, r, A]), { renderingStartIndex: ne, renderingEndIndex: ie, visibleStartIndex: de, visibleEndIndex: be } = jt, se = S(
2660
+ (l, u) => {
2661
+ if (!V || n === 0)
2659
2662
  return;
2660
- const p = bt(a, n);
2663
+ const h = It(l, n);
2661
2664
  if (!(u?.ensureVisible ?? !0)) {
2662
- const Vt = nt.current.get(p);
2663
- Vt && (J.current = null, Pt.current = p, dt(Vt));
2665
+ const Dt = z.current.get(h);
2666
+ Dt && (et.current = null, ct.current = h, $t(Dt));
2664
2667
  return;
2665
2668
  }
2666
- const A = S.prefixSum(p, { materializeOption: { materialize: !1 } }), F = A.currentValue, K = Math.max(A.cumulative - F, 0), W = K + F, vt = ne(d.current, w.top), ht = vt + i;
2667
- if (K < vt || W > ht) {
2668
- Kt(p);
2669
- const Vt = nt.current.get(p);
2670
- Vt ? (J.current = null, Pt.current = p, dt(Vt)) : J.current = p;
2669
+ const O = A.prefixSum(h, { materializeOption: { materialize: !1 } }), Y = O.currentValue, U = Math.max(O.cumulative - Y, 0), G = U + Y, Rt = oe(dt.current, y.top), bt = Rt + i;
2670
+ if (U < Rt || G > bt) {
2671
+ Wt(h);
2672
+ const Dt = z.current.get(h);
2673
+ Dt ? (et.current = null, ct.current = h, $t(Dt)) : et.current = h;
2671
2674
  return;
2672
2675
  }
2673
- const Ot = nt.current.get(p);
2674
- if (Ot) {
2675
- J.current = null, Pt.current = p, dt(Ot);
2676
+ const Ft = z.current.get(h);
2677
+ if (Ft) {
2678
+ et.current = null, ct.current = h, $t(Ft);
2676
2679
  return;
2677
2680
  }
2678
- J.current = p;
2681
+ et.current = h;
2679
2682
  },
2680
- [h, n, S, w.top, Kt, dt, i]
2681
- ), we = v(
2682
- (a, u) => {
2683
- if (!h || a.defaultPrevented || a.altKey || a.metaKey || a.ctrlKey)
2683
+ [V, n, A, y.top, Wt, $t, i]
2684
+ ), Ce = S(
2685
+ (l, u) => {
2686
+ if (!V || l.defaultPrevented || l.altKey || l.metaKey || l.ctrlKey)
2684
2687
  return;
2685
- const p = a.target;
2686
- if (p) {
2687
- const V = p.tagName;
2688
- if (V === "INPUT" || V === "TEXTAREA" || V === "SELECT" || p.isContentEditable)
2688
+ const h = l.target;
2689
+ if (h) {
2690
+ const R = h.tagName;
2691
+ if (R === "INPUT" || R === "TEXTAREA" || R === "SELECT" || h.isContentEditable)
2689
2692
  return;
2690
2693
  }
2691
- if (a.key === "ArrowDown") {
2692
- u < n - 1 && (a.preventDefault(), re(u + 1));
2694
+ if (l.key === "ArrowDown") {
2695
+ u < n - 1 && (l.preventDefault(), se(u + 1));
2693
2696
  return;
2694
2697
  }
2695
- if (a.key === "ArrowUp") {
2696
- u > 0 && (a.preventDefault(), re(u - 1));
2698
+ if (l.key === "ArrowUp") {
2699
+ u > 0 && (l.preventDefault(), se(u - 1));
2697
2700
  return;
2698
2701
  }
2699
- if (a.key === "PageDown") {
2702
+ if (l.key === "PageDown") {
2700
2703
  if (u < n - 1) {
2701
- a.preventDefault();
2702
- const { visibleStartIndex: V, visibleEndIndex: A } = Rt.current, F = Math.max(A - V + 1, 1), K = Math.max(F, 1), W = bt(Math.min(u + K, n - 1), n);
2703
- re(W);
2704
+ l.preventDefault();
2705
+ const { visibleStartIndex: R, visibleEndIndex: O } = Ct.current, Y = Math.max(O - R + 1, 1), U = Math.max(Y, 1), G = It(Math.min(u + U, n - 1), n);
2706
+ se(G);
2704
2707
  }
2705
2708
  return;
2706
2709
  }
2707
- if (a.key === "PageUp" && u > 0) {
2708
- a.preventDefault();
2709
- const { visibleStartIndex: V, visibleEndIndex: A } = Rt.current, F = Math.max(A - V + 1, 1), K = Math.max(F, 1), W = bt(u - K, n);
2710
- re(W);
2710
+ if (l.key === "PageUp" && u > 0) {
2711
+ l.preventDefault();
2712
+ const { visibleStartIndex: R, visibleEndIndex: O } = Ct.current, Y = Math.max(O - R + 1, 1), U = Math.max(Y, 1), G = It(u - U, n);
2713
+ se(G);
2711
2714
  }
2712
2715
  },
2713
- [h, n, re]
2714
- ), Re = v(
2715
- (a) => {
2716
- if (!h)
2716
+ [V, n, se]
2717
+ ), ve = S(
2718
+ (l) => {
2719
+ if (!V)
2717
2720
  return;
2718
- const u = bt(a, n);
2719
- J.current = null, Pt.current = u, j?.(u);
2721
+ const u = It(l, n);
2722
+ et.current = null, ct.current = u, Z?.(u);
2720
2723
  },
2721
- [h, n, j]
2724
+ [V, n, Z]
2722
2725
  );
2723
- Y(() => {
2724
- const a = k.current?.getScrollPosition() ?? 0, u = d.current, p = ne(u, w.top);
2726
+ q(() => {
2727
+ const l = F.current?.getScrollPosition() ?? 0, u = dt.current, h = oe(u, y.top);
2725
2728
  C.debug("[VirtualScroll] Range change effect triggered", () => ({
2726
- renderingStartIndex: Ut,
2727
- renderingEndIndex: ee,
2728
- visibleStartIndex: se,
2729
- visibleEndIndex: pe,
2729
+ renderingStartIndex: ne,
2730
+ renderingEndIndex: ie,
2731
+ visibleStartIndex: de,
2732
+ visibleEndIndex: be,
2730
2733
  scrollPositionState: Bt,
2731
2734
  paneScrollPosition: u,
2732
- logicalScrollPosition: p,
2733
- contentSize: lt,
2734
- scrollPaneScrollPosition: a
2735
- })), Nt({
2736
- renderingStartIndex: Ut,
2737
- renderingEndIndex: ee,
2738
- visibleStartIndex: se,
2739
- visibleEndIndex: pe,
2740
- scrollPosition: p,
2741
- totalHeight: lt
2735
+ logicalScrollPosition: h,
2736
+ contentSize: Et,
2737
+ scrollPaneScrollPosition: l
2738
+ })), w({
2739
+ renderingStartIndex: ne,
2740
+ renderingEndIndex: ie,
2741
+ visibleStartIndex: de,
2742
+ visibleEndIndex: be,
2743
+ scrollPosition: h,
2744
+ totalHeight: Et
2742
2745
  });
2743
- }, [lt, ee, Ut, w.top, Nt, Bt, pe, se]);
2744
- const Ce = v(() => B ? /* @__PURE__ */ it("div", { className: "aqvs-scroll-to-edge-overlay", "data-visible": st && Mt !== null, children: Mt === "up" ? /* @__PURE__ */ it("div", { className: "aqvs-scroll-to-edge-button-container aqvs-scroll-to-edge-button-container-top", children: /* @__PURE__ */ it(
2746
+ }, [Et, ie, ne, y.top, w, Bt, be, de]);
2747
+ const Ee = S(() => $ ? /* @__PURE__ */ ot("div", { className: "aqvs-scroll-to-edge-overlay", "data-visible": Mt && kt !== null, children: kt === "up" ? /* @__PURE__ */ ot("div", { className: "aqvs-scroll-to-edge-button-container aqvs-scroll-to-edge-button-container-top", children: /* @__PURE__ */ ot(
2745
2748
  "button",
2746
2749
  {
2747
2750
  type: "button",
2748
2751
  className: "aqvs-scroll-to-edge-button",
2749
- onClick: (p) => {
2750
- p.stopPropagation(), ut.current = !0, Kt(0), St(!1);
2752
+ onClick: (h) => {
2753
+ h.stopPropagation(), st.current = !0, Wt(0), it(!1);
2751
2754
  },
2752
2755
  children: "Top"
2753
2756
  }
2754
- ) }) : /* @__PURE__ */ it("div", { className: "aqvs-scroll-to-edge-button-container aqvs-scroll-to-edge-button-container-bottom", children: /* @__PURE__ */ it(
2757
+ ) }) : /* @__PURE__ */ ot("div", { className: "aqvs-scroll-to-edge-button-container aqvs-scroll-to-edge-button-container-bottom", children: /* @__PURE__ */ ot(
2755
2758
  "button",
2756
2759
  {
2757
2760
  type: "button",
2758
2761
  className: "aqvs-scroll-to-edge-button",
2759
- onClick: (p) => {
2760
- p.stopPropagation(), ut.current = !0, Kt(n - 1), St(!1);
2762
+ onClick: (h) => {
2763
+ h.stopPropagation(), st.current = !0, Wt(n - 1), it(!1);
2761
2764
  },
2762
2765
  children: "Bottom"
2763
2766
  }
2764
- ) }) }) : null, [B, st, Mt, Kt, n]), he = T(0), { visibleItems: o, renderAnchor: b } = At(() => {
2767
+ ) }) }) : null, [$, Mt, kt, Wt, n]), o = I(0), { visibleItems: g, renderAnchor: M } = Lt(() => {
2765
2768
  if (n === 0)
2766
2769
  return {
2767
- visibleItems: /* @__PURE__ */ it("div", { className: "aqvs-no-items-container", children: /* @__PURE__ */ it("div", { className: "aqvs-no-items-text", children: "No items" }) }),
2770
+ visibleItems: /* @__PURE__ */ ot("div", { className: "aqvs-no-items-container", children: /* @__PURE__ */ ot("div", { className: "aqvs-no-items-text", children: "No items" }) }),
2768
2771
  renderAnchor: 0
2769
2772
  };
2770
- const a = bt(Ut, n), u = bt(ee, n), { cumulative: p, currentValue: V } = S.prefixSum(a, { materializeOption: { materialize: !1 } }), A = p - V;
2771
- Number.isFinite(A) && Math.abs(A - he.current) > Cr && (he.current = A);
2772
- const F = he.current, K = [], W = [];
2773
- let vt = 0, ht = A;
2774
- for (let gt = a; gt <= u; gt++) {
2775
- if (W.length >= Ke) {
2776
- C.warn("[VirtualScroll] Rendered item count reached the safety cap; truncating render window.", { cap: Ke, safeRenderingStartIndex: a, safeRenderingEndIndex: u });
2773
+ const l = It(ne, n), u = It(ie, n), { cumulative: h, currentValue: R } = A.prefixSum(l, { materializeOption: { materialize: !1 } }), O = h - R;
2774
+ Number.isFinite(O) && Math.abs(O - o.current) > Er && (o.current = O);
2775
+ const Y = o.current, U = [], G = [];
2776
+ let Rt = 0, bt = O;
2777
+ for (let xt = l; xt <= u; xt++) {
2778
+ if (G.length >= We) {
2779
+ C.warn("[VirtualScroll] Rendered item count reached the safety cap; truncating render window.", { cap: We, safeRenderingStartIndex: l, safeRenderingEndIndex: u });
2777
2780
  break;
2778
2781
  }
2779
- const Ot = r(gt), Vt = S.get(gt), Ft = Ot - Vt;
2780
- Ft !== 0 && K.push({ index: gt, value: Ot });
2781
- const ve = ht + vt, De = e ? e(gt) : gt;
2782
- W.push(
2783
- /* @__PURE__ */ it(
2784
- Vr,
2782
+ const Ft = r(xt), Dt = A.get(xt), zt = Ft - Dt;
2783
+ zt !== 0 && U.push({ index: xt, value: Ft });
2784
+ const Pe = bt + Rt, Le = e ? e(xt) : xt;
2785
+ G.push(
2786
+ /* @__PURE__ */ ot(
2787
+ Ar,
2785
2788
  {
2786
- index: gt,
2787
- top: ve - F,
2788
- height: Ot,
2789
- item: t(gt),
2790
- clipItemHeight: wt,
2791
- enableKeyboardNavigation: h,
2792
- onKeyDown: we,
2793
- onFocus: Re,
2794
- registerItemRef: _t,
2795
- children: I
2789
+ index: xt,
2790
+ top: Pe - Y,
2791
+ height: Ft,
2792
+ item: t(xt),
2793
+ clipItemHeight: yt,
2794
+ enableKeyboardNavigation: V,
2795
+ onKeyDown: Ce,
2796
+ onFocus: ve,
2797
+ registerItemRef: wt,
2798
+ children: x
2796
2799
  },
2797
- De
2800
+ Le
2798
2801
  )
2799
- ), vt += Ft, ht += Vt;
2802
+ ), Rt += zt, bt += Dt;
2800
2803
  }
2801
- return K.length > 0 && Promise.resolve().then(() => {
2802
- if (Ct.current)
2804
+ return U.length > 0 && Promise.resolve().then(() => {
2805
+ if (At.current)
2803
2806
  return;
2804
- let gt = 0;
2805
- for (const Ft of K)
2806
- if (Ft.index < se) {
2807
- const ve = S.get(Ft.index);
2808
- gt += Ft.value - ve;
2807
+ let xt = 0;
2808
+ for (const zt of U)
2809
+ if (zt.index < de) {
2810
+ const Pe = A.get(zt.index);
2811
+ xt += zt.value - Pe;
2809
2812
  }
2810
- const Ot = S.updates(K);
2811
- if (Ct.current || typeof Ot != "number")
2813
+ const Ft = A.updates(U);
2814
+ if (At.current || typeof Ft != "number")
2812
2815
  return;
2813
- Wt(Ot), C.debug("[VirtualScroll] Updated heights for items", K, "New total height:", Ot);
2814
- const Vt = k.current?.getScrollPosition() ?? d.current;
2815
- if (gt !== 0) {
2816
- const Ft = Vt + gt;
2817
- zt(Ft), rt(Ft, { immediate: !0 }), C.debug("[VirtualScroll] Adjusted scroll for layout shift (auto update)", { from: Vt, to: Ft, shiftAmount: gt });
2818
- } else Vt !== d.current && rt(Vt);
2819
- }), { visibleItems: W, renderAnchor: F };
2816
+ Xt(Ft), C.debug("[VirtualScroll] Updated heights for items", U, "New total height:", Ft);
2817
+ const Dt = F.current?.getScrollPosition() ?? dt.current;
2818
+ if (xt !== 0) {
2819
+ const zt = Dt + xt;
2820
+ ee(zt), tt(zt, { immediate: !0 }), C.debug("[VirtualScroll] Adjusted scroll for layout shift (auto update)", { from: Dt, to: zt, shiftAmount: xt });
2821
+ } else Dt !== dt.current && tt(Dt);
2822
+ }), { visibleItems: G, renderAnchor: Y };
2820
2823
  }, [
2821
- I,
2822
- wt,
2823
- lt,
2824
- h,
2824
+ x,
2825
+ yt,
2826
+ Et,
2827
+ V,
2825
2828
  n,
2826
- S,
2829
+ A,
2827
2830
  t,
2828
2831
  e,
2829
2832
  r,
2830
- Re,
2831
- we,
2832
- zt,
2833
- _t,
2833
+ ve,
2834
+ Ce,
2834
2835
  ee,
2835
- Ut,
2836
- rt,
2837
- se
2838
- ]), R = v(
2839
- (a) => {
2840
- const u = (_ ?? 0) > 0, p = Math.abs(a - Bt), V = u && p > 0.5 ? Bt : a, A = ne(V, w.top);
2836
+ wt,
2837
+ ie,
2838
+ ne,
2839
+ tt,
2840
+ de
2841
+ ]), L = S(
2842
+ (l) => {
2843
+ const u = (_ ?? 0) > 0, h = Math.abs(l - Bt), R = u && h > 0.5 ? Bt : l, O = oe(R, y.top);
2841
2844
  if (C.debug("[VirtualScroll] Rendering visible items", () => ({
2842
- currentScrollPosition: a,
2843
- effectiveScrollPosition: A,
2844
- renderingStartIndex: Ut,
2845
- renderingEndIndex: ee,
2845
+ currentScrollPosition: l,
2846
+ effectiveScrollPosition: O,
2847
+ renderingStartIndex: ne,
2848
+ renderingEndIndex: ie,
2846
2849
  itemCount: n,
2847
2850
  viewportSize: i,
2848
2851
  callbackThrottleMs: _,
2849
- diff: p,
2850
- rawEffectiveScrollPosition: V
2852
+ diff: h,
2853
+ rawEffectiveScrollPosition: R
2851
2854
  })), n === 0)
2852
- return o;
2853
- const F = w.top + b - V, K = w.bottom > 0 ? /* @__PURE__ */ it(
2855
+ return g;
2856
+ const Y = y.top + M - R, U = y.bottom > 0 ? /* @__PURE__ */ ot(
2854
2857
  "div",
2855
2858
  {
2856
2859
  className: "aqvs-bottom-inset",
2857
2860
  style: {
2858
2861
  // ラッパー座標での bottom インセット位置 = コンテンツ総高さ (最終行の下端) - アンカー。
2859
- top: S.getTotal() - b,
2860
- height: w.bottom
2862
+ top: A.getTotal() - M,
2863
+ height: y.bottom
2861
2864
  }
2862
2865
  },
2863
2866
  "virtualscroll-bottom-inset"
2864
2867
  ) : null;
2865
2868
  return C.debug("[VirtualScroll] Rendering items", () => ({
2866
- containerTop: F,
2867
- logicalScrollPosition: te,
2868
- resolvedInsets: w,
2869
- effectiveScrollPosition: A
2870
- })), /* @__PURE__ */ de("div", { className: "aqvs-items-wrapper", style: { top: 0, transform: `translateY(${F}px)`, willChange: "transform" }, children: [
2871
- o,
2872
- K
2869
+ containerTop: Y,
2870
+ logicalScrollPosition: re,
2871
+ resolvedInsets: y,
2872
+ effectiveScrollPosition: O
2873
+ })), /* @__PURE__ */ he("div", { className: "aqvs-items-wrapper", style: { top: 0, transform: `translateY(${Y}px)`, willChange: "transform" }, children: [
2874
+ g,
2875
+ U
2873
2876
  ] });
2874
2877
  },
2875
- [_, n, S, te, b, ee, Ut, w, Bt, i, o]
2876
- ), L = At(
2878
+ [_, n, A, re, M, ie, ne, y, Bt, i, g]
2879
+ ), H = Lt(
2877
2880
  () => ({
2878
- renderingStartIndex: ie.renderingStartIndex,
2879
- renderingEndIndex: ie.renderingEndIndex,
2880
- visibleStartIndex: ie.visibleStartIndex,
2881
- visibleEndIndex: ie.visibleEndIndex,
2882
- scrollPosition: te,
2883
- totalHeight: S.getTotal()
2881
+ renderingStartIndex: jt.renderingStartIndex,
2882
+ renderingEndIndex: jt.renderingEndIndex,
2883
+ visibleStartIndex: jt.visibleStartIndex,
2884
+ visibleEndIndex: jt.visibleEndIndex,
2885
+ scrollPosition: re,
2886
+ totalHeight: A.getTotal()
2884
2887
  // contentSize (State) ではなく最新値を反映
2885
2888
  }),
2886
2889
  // contentSize を依存に含めることで、updateItemSize/updates 等で木の総高さが変わった際に
2887
2890
  // (fenwickTree は安定参照のため getTotal() の変化だけでは再計算されない) 総高さを再取得する。
2888
- [ie, te, S, lt]
2891
+ [jt, re, A, Et]
2889
2892
  );
2890
- Y(() => {
2891
- Rt.current = L;
2892
- }, [L]), Be(
2893
- pt,
2893
+ q(() => {
2894
+ Ct.current = H;
2895
+ }, [H]), qe(
2896
+ Pt,
2894
2897
  () => ({
2895
- getScrollPosition: () => k.current?.getScrollPosition() ?? -1,
2896
- getContentSize: () => k.current?.getContentSize() ?? -1,
2897
- getViewportSize: () => k.current?.getViewportSize() ?? -1,
2898
- scrollTo: me,
2899
- scrollToIndex: Kt,
2900
- getFenwickTreeTotalHeight: () => S.getTotal(),
2901
- getFenwickSize: () => S.getSize(),
2902
- focusItemAtIndex: re,
2903
- getRange: () => Rt.current,
2904
- updateItemSize: Se
2898
+ getScrollPosition: () => F.current?.getScrollPosition() ?? -1,
2899
+ getContentSize: () => F.current?.getContentSize() ?? -1,
2900
+ getViewportSize: () => F.current?.getViewportSize() ?? -1,
2901
+ scrollTo: Re,
2902
+ scrollToIndex: Wt,
2903
+ getFenwickTreeTotalHeight: () => A.getTotal(),
2904
+ getFenwickSize: () => A.getSize(),
2905
+ focusItemAtIndex: se,
2906
+ getRange: () => Ct.current,
2907
+ updateItemSize: we
2905
2908
  }),
2906
- [me, Kt, S, re, Se]
2909
+ [Re, Wt, A, se, we]
2907
2910
  );
2908
- const X = S.getTotal() + w.top + w.bottom;
2909
- return /* @__PURE__ */ it(
2910
- Sr,
2911
+ const St = A.getTotal() + y.top + y.bottom;
2912
+ return /* @__PURE__ */ ot(
2913
+ vr,
2911
2914
  {
2912
- ref: k,
2913
- contentSize: X,
2915
+ ref: F,
2916
+ contentSize: St,
2914
2917
  viewportSize: i,
2915
- className: l,
2918
+ className: a,
2916
2919
  testId: c,
2917
- onScroll: Ae,
2918
- background: P,
2919
- tapScrollCircleOptions: q,
2920
- inertiaOptions: Tt,
2920
+ onScroll: De,
2921
+ background: v,
2922
+ tapScrollCircleOptions: lt,
2923
+ inertiaOptions: Yt,
2921
2924
  itemCount: n,
2922
- scrollBarWidth: It,
2923
- enableThumbDrag: D,
2924
- enableTrackClick: O,
2925
- enableArrowButtons: M,
2926
- enablePointerDrag: et,
2927
- pointerDragInputs: G,
2925
+ scrollBarWidth: D,
2926
+ enableThumbDrag: k,
2927
+ enableTrackClick: P,
2928
+ enableArrowButtons: X,
2929
+ enablePointerDrag: K,
2930
+ pointerDragInputs: T,
2928
2931
  renderThumbOverlay: N,
2929
- wheelSpeedMultiplier: $,
2930
- onWheelHorizontal: tt,
2931
- contentInsets: w,
2932
- visibleStartIndex: se,
2933
- visibleEndIndex: pe,
2934
- renderOverlay: Ce,
2935
- initialScrollPosition: $t.position,
2936
- children: R
2932
+ wheelSpeedMultiplier: Tt,
2933
+ onWheelHorizontal: nt,
2934
+ contentInsets: y,
2935
+ contentProps: pt,
2936
+ visibleStartIndex: de,
2937
+ visibleEndIndex: be,
2938
+ renderOverlay: Ee,
2939
+ initialScrollPosition: j.position,
2940
+ children: L
2937
2941
  }
2938
2942
  );
2939
- }, Fr = Ye(Ar);
2943
+ }, zr = Be(Dr);
2940
2944
  export {
2941
- ae as FenwickMapTree,
2942
- xr as ScrollBar,
2943
- Sr as ScrollPane,
2944
- Ze as TAP_SCROLL_SPEED_DEFAULTS,
2945
- Fr as VirtualScroll,
2946
- br as computeAutoTapScrollMaxSpeedMultiplier,
2947
- gr as computeTapScrollSpeed,
2948
- xt as minmax,
2949
- kr as tapScrollCircleSampleVisual,
2950
- Mr as useFenwickMapTree,
2951
- Or as useHeightCache,
2952
- wr as useLruCache
2945
+ me as FenwickMapTree,
2946
+ Ir as ScrollBar,
2947
+ vr as ScrollPane,
2948
+ Je as TAP_SCROLL_SPEED_DEFAULTS,
2949
+ zr as VirtualScroll,
2950
+ xr as computeAutoTapScrollMaxSpeedMultiplier,
2951
+ br as computeTapScrollSpeed,
2952
+ vt as minmax,
2953
+ Or as tapScrollCircleSampleVisual,
2954
+ yr as useFenwickMapTree,
2955
+ Fr as useHeightCache,
2956
+ Rr as useLruCache
2953
2957
  };